Upstream 2017-07-20 27/139627/1
authorSumin Lim <sumin.lim@samsung.com>
Wed, 19 Jul 2017 17:08:04 +0000 (02:08 +0900)
committerSumin Lim <sumin.lim@samsung.com>
Wed, 19 Jul 2017 17:08:38 +0000 (02:08 +0900)
Change-Id: I0af3ff4ed9b19c15db0883b8d74fdcf3dd7e712f

3113 files changed:
.clang-format [new file with mode: 0644]
.gbs.conf [new file with mode: 0644]
.gitignore [new file with mode: 0644]
.gitmodules
.travis.yml [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
LICENSE [new file with mode: 0644]
README.md [new file with mode: 0644]
build.config [new file with mode: 0644]
cmake/config/arm-linux.cmake [new file with mode: 0644]
cmake/config/arm-nuttx.cmake [new file with mode: 0644]
cmake/config/arm-tizen.cmake [new file with mode: 0644]
cmake/config/arm-tizenrt.cmake [new file with mode: 0644]
cmake/config/i686-linux.cmake [new file with mode: 0644]
cmake/config/x86_64-darwin.cmake [new file with mode: 0644]
cmake/config/x86_64-linux.cmake [new file with mode: 0644]
cmake/http-parser.cmake [new file with mode: 0644]
cmake/iotjs.cmake [new file with mode: 0644]
cmake/jerry.cmake [new file with mode: 0644]
cmake/libtuv.cmake [new file with mode: 0644]
config/nuttx/stm32f4dis/.config.default [new file with mode: 0644]
config/nuttx/stm32f4dis/.config.travis [new file with mode: 0644]
config/nuttx/stm32f4dis/app/Kconfig [new file with mode: 0644]
config/nuttx/stm32f4dis/app/Make.defs [new file with mode: 0644]
config/nuttx/stm32f4dis/app/Makefile [new file with mode: 0644]
config/nuttx/stm32f4dis/app/iotjs_main.c [new file with mode: 0644]
config/nuttx/stm32f4dis/app/jerry_port.c [new file with mode: 0644]
config/nuttx/stm32f4dis/app/setjmp.S [new file with mode: 0644]
config/nuttx/stm32f4dis/app/setjmp.h [new file with mode: 0644]
config/nuttx/stm32f4dis/patch [new file with mode: 0644]
config/tizen/gbsbuild.sh [new file with mode: 0755]
config/tizen/packaging/iotjs.manifest [new file with mode: 0644]
config/tizen/packaging/iotjs.pc.in [new file with mode: 0644]
config/tizen/packaging/iotjs.spec [new file with mode: 0644]
config/tizen/sample.gbs.conf [new file with mode: 0644]
config/tizenrt/artik05x/app/.gitignore [new file with mode: 0644]
config/tizenrt/artik05x/app/Kconfig [new file with mode: 0644]
config/tizenrt/artik05x/app/Kconfig_ENTRY [new file with mode: 0644]
config/tizenrt/artik05x/app/Make.defs [new file with mode: 0644]
config/tizenrt/artik05x/app/Makefile [new file with mode: 0644]
config/tizenrt/artik05x/app/iotjs_main.c [new file with mode: 0644]
config/tizenrt/artik05x/app/jerry_port.c [new file with mode: 0644]
config/tizenrt/artik05x/configs/Make.defs [new file with mode: 0644]
config/tizenrt/artik05x/configs/defconfig [new file with mode: 0644]
deps/http-parser/.mailmap [new file with mode: 0644]
deps/http-parser/.travis.yml [new file with mode: 0644]
deps/http-parser/AUTHORS [new file with mode: 0644]
deps/http-parser/CMakeLists.txt [new file with mode: 0644]
deps/http-parser/LICENSE-MIT [new file with mode: 0644]
deps/http-parser/Makefile [new file with mode: 0644]
deps/http-parser/README.md [new file with mode: 0644]
deps/http-parser/bench.c [new file with mode: 0644]
deps/http-parser/contrib/parsertrace.c [new file with mode: 0644]
deps/http-parser/contrib/url_parser.c [new file with mode: 0644]
deps/http-parser/http_parser.c [new file with mode: 0644]
deps/http-parser/http_parser.gyp [new file with mode: 0644]
deps/http-parser/http_parser.h [new file with mode: 0644]
deps/http-parser/test.c [new file with mode: 0644]
deps/jerry/.gitignore [new file with mode: 0644]
deps/jerry/.travis.yml [new file with mode: 0644]
deps/jerry/CMakeLists.txt [new file with mode: 0644]
deps/jerry/CONTRIBUTING.md [new file with mode: 0644]
deps/jerry/DCO.md [new file with mode: 0644]
deps/jerry/Doxyfile [new file with mode: 0644]
deps/jerry/LICENSE [new file with mode: 0644]
deps/jerry/LOGO.png [new file with mode: 0644]
deps/jerry/LOGO.svg [new file with mode: 0644]
deps/jerry/README.md [new file with mode: 0644]
deps/jerry/cmake/toolchain_external.cmake [new file with mode: 0644]
deps/jerry/cmake/toolchain_linux_armv7l-el.cmake [new file with mode: 0644]
deps/jerry/cmake/toolchain_linux_armv7l.cmake [new file with mode: 0644]
deps/jerry/cmake/toolchain_linux_i686.cmake [new file with mode: 0644]
deps/jerry/cmake/toolchain_mcu_stm32f3.cmake [new file with mode: 0644]
deps/jerry/cmake/toolchain_mcu_stm32f4.cmake [new file with mode: 0644]
deps/jerry/cmake/toolchain_mcu_tim4f.cmake [new file with mode: 0644]
deps/jerry/cmake/toolchain_openwrt_mips.cmake [new file with mode: 0644]
deps/jerry/docs/01.GETTING-STARTED.md [new file with mode: 0644]
deps/jerry/docs/02.API-REFERENCE.md [new file with mode: 0644]
deps/jerry/docs/03.API-EXAMPLE.md [new file with mode: 0644]
deps/jerry/docs/04.INTERNALS.md [new file with mode: 0644]
deps/jerry/docs/05.PORT-API.md [new file with mode: 0644]
deps/jerry/docs/06.REFERENCE-COUNTING.md [new file with mode: 0644]
deps/jerry/docs/07.DEBUGGER.md [new file with mode: 0644]
deps/jerry/docs/08.CODING-STANDARDS.md [new file with mode: 0644]
deps/jerry/docs/09.EXT-REFERENCE-ARG.md [new file with mode: 0644]
deps/jerry/docs/10.EXT-REFERENCE-HANDLER.md [new file with mode: 0644]
deps/jerry/docs/11.EXT-REFERENCE-AUTORELEASE.md [new file with mode: 0644]
deps/jerry/docs/12.EXT-REFERENCE-MODULE.md [new file with mode: 0644]
deps/jerry/docs/img/CBC_layout.png [new file with mode: 0644]
deps/jerry/docs/img/bytecode-layout.png [new file with mode: 0644]
deps/jerry/docs/img/ecma_compressed.png [new file with mode: 0644]
deps/jerry/docs/img/ecma_lcache.png [new file with mode: 0644]
deps/jerry/docs/img/ecma_object.png [new file with mode: 0644]
deps/jerry/docs/img/ecma_object_property.png [new file with mode: 0644]
deps/jerry/docs/img/ecma_value.png [new file with mode: 0644]
deps/jerry/docs/img/engines_high_level_design.png [new file with mode: 0644]
deps/jerry/docs/img/number.png [new file with mode: 0644]
deps/jerry/docs/img/opcode_layout.png [new file with mode: 0644]
deps/jerry/docs/img/parser_dependency.png [new file with mode: 0644]
deps/jerry/jerry-core/CMakeLists.txt [new file with mode: 0644]
deps/jerry/jerry-core/api/jerry-debugger.c [new file with mode: 0644]
deps/jerry/jerry-core/api/jerry-snapshot.c [new file with mode: 0644]
deps/jerry/jerry-core/api/jerry-snapshot.h [new file with mode: 0644]
deps/jerry/jerry-core/api/jerry.c [new file with mode: 0644]
deps/jerry/jerry-core/config.h [new file with mode: 0644]
deps/jerry/jerry-core/debugger/debugger-sha1.c [new file with mode: 0644]
deps/jerry/jerry-core/debugger/debugger-ws.c [new file with mode: 0644]
deps/jerry/jerry-core/debugger/debugger-ws.h [new file with mode: 0644]
deps/jerry/jerry-core/debugger/debugger.c [new file with mode: 0644]
deps/jerry/jerry-core/debugger/debugger.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-alloc.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-alloc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-gc.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-gc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-globals.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-helpers-conversion.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-helpers-errol.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-helpers-external-pointers.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-helpers-number.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-helpers-string.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-helpers-value.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-helpers-values-collection.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-helpers.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-helpers.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-init-finalize.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-init-finalize.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-lcache.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-lcache.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-literal-storage.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-literal-storage.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-property-hashmap.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/base/ecma-property-hashmap.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-global.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-error.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-json.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-json.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-math.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-type-error-thrower.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-type-error-thrower.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray-prototype.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray-prototype.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-array-object.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-array-object.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-arraybuffer-object.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-arraybuffer-object.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-boolean-object.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-boolean-object.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-comparison.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-comparison.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-conversion.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-conversion.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-eval.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-eval.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-exceptions.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-exceptions.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-function-object.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-function-object.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-get-put-value.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-jobqueue.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-jobqueue.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-lex-env.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-lex-env.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-number-arithmetic.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-number-arithmetic.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-number-object.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-number-object.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-objects-arguments.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-objects-arguments.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-objects-general.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-objects-general.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-objects.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-objects.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-promise-object.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-promise-object.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-reference.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-reference.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-regexp-object.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-regexp-object.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-string-object.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-string-object.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-try-catch-macro.h [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-typedarray-object.c [new file with mode: 0644]
deps/jerry/jerry-core/ecma/operations/ecma-typedarray-object.h [new file with mode: 0644]
deps/jerry/jerry-core/include/jerry-api.h [new file with mode: 0644]
deps/jerry/jerry-core/include/jerry-port.h [new file with mode: 0644]
deps/jerry/jerry-core/include/jerryscript-core.h [new file with mode: 0644]
deps/jerry/jerry-core/include/jerryscript-debugger.h [new file with mode: 0644]
deps/jerry/jerry-core/include/jerryscript-port.h [new file with mode: 0644]
deps/jerry/jerry-core/include/jerryscript-snapshot.h [new file with mode: 0644]
deps/jerry/jerry-core/include/jerryscript.h [new file with mode: 0644]
deps/jerry/jerry-core/jcontext/jcontext.c [new file with mode: 0644]
deps/jerry/jerry-core/jcontext/jcontext.h [new file with mode: 0644]
deps/jerry/jerry-core/jmem/jmem-allocator-internal.h [new file with mode: 0644]
deps/jerry/jerry-core/jmem/jmem-allocator.c [new file with mode: 0644]
deps/jerry/jerry-core/jmem/jmem-heap.c [new file with mode: 0644]
deps/jerry/jerry-core/jmem/jmem-poolman.c [new file with mode: 0644]
deps/jerry/jerry-core/jmem/jmem.h [new file with mode: 0644]
deps/jerry/jerry-core/jrt/jrt-bit-fields.h [new file with mode: 0644]
deps/jerry/jerry-core/jrt/jrt-fatals.c [new file with mode: 0644]
deps/jerry/jerry-core/jrt/jrt-libc-includes.h [new file with mode: 0644]
deps/jerry/jerry-core/jrt/jrt-types.h [new file with mode: 0644]
deps/jerry/jerry-core/jrt/jrt.h [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-char-helpers.c [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-char-helpers.h [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-globals.h [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-magic-strings.c [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-magic-strings.h [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-magic-strings.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-magic-strings.ini [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-strings.c [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-strings.h [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-unicode-conversions.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/lit/lit-unicode-ranges.inc.h [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/byte-code.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/byte-code.h [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/common.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/common.h [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-lexer.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-lexer.h [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-parser-expr.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-parser-internal.h [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-parser-limits.h [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-parser-mem.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-parser-scanner.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-parser-statm.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-parser-util.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-parser.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/js/js-parser.h [new file with mode: 0644]
deps/jerry/jerry-core/parser/regexp/re-bytecode.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/regexp/re-bytecode.h [new file with mode: 0644]
deps/jerry/jerry-core/parser/regexp/re-compiler.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/regexp/re-compiler.h [new file with mode: 0644]
deps/jerry/jerry-core/parser/regexp/re-parser.c [new file with mode: 0644]
deps/jerry/jerry-core/parser/regexp/re-parser.h [new file with mode: 0644]
deps/jerry/jerry-core/profiles/README.md [new file with mode: 0644]
deps/jerry/jerry-core/profiles/es2015-subset.profile [new file with mode: 0644]
deps/jerry/jerry-core/profiles/es5.1.profile [new file with mode: 0644]
deps/jerry/jerry-core/profiles/minimal.profile [new file with mode: 0644]
deps/jerry/jerry-core/vm/opcodes-ecma-arithmetics.c [new file with mode: 0644]
deps/jerry/jerry-core/vm/opcodes-ecma-bitwise.c [new file with mode: 0644]
deps/jerry/jerry-core/vm/opcodes-ecma-equality.c [new file with mode: 0644]
deps/jerry/jerry-core/vm/opcodes-ecma-relational.c [new file with mode: 0644]
deps/jerry/jerry-core/vm/opcodes.c [new file with mode: 0644]
deps/jerry/jerry-core/vm/opcodes.h [new file with mode: 0644]
deps/jerry/jerry-core/vm/vm-defines.h [new file with mode: 0644]
deps/jerry/jerry-core/vm/vm-stack.c [new file with mode: 0644]
deps/jerry/jerry-core/vm/vm-stack.h [new file with mode: 0644]
deps/jerry/jerry-core/vm/vm.c [new file with mode: 0644]
deps/jerry/jerry-core/vm/vm.h [new file with mode: 0644]
deps/jerry/jerry-debugger/jerry-client-ws-html.py [new file with mode: 0644]
deps/jerry/jerry-debugger/jerry-client-ws.html [new file with mode: 0644]
deps/jerry/jerry-debugger/jerry-client-ws.py [new file with mode: 0755]
deps/jerry/jerry-ext/CMakeLists.txt [new file with mode: 0644]
deps/jerry/jerry-ext/arg/arg-internal.h [new file with mode: 0644]
deps/jerry/jerry-ext/arg/arg-js-iterator-helper.c [new file with mode: 0644]
deps/jerry/jerry-ext/arg/arg-transform-functions.c [new file with mode: 0644]
deps/jerry/jerry-ext/arg/arg.c [new file with mode: 0644]
deps/jerry/jerry-ext/handler/handler-assert.c [new file with mode: 0644]
deps/jerry/jerry-ext/handler/handler-gc.c [new file with mode: 0644]
deps/jerry/jerry-ext/handler/handler-print.c [new file with mode: 0644]
deps/jerry/jerry-ext/handler/handler-register.c [new file with mode: 0644]
deps/jerry/jerry-ext/include/jerryscript-ext/arg.h [new file with mode: 0644]
deps/jerry/jerry-ext/include/jerryscript-ext/arg.impl.h [new file with mode: 0644]
deps/jerry/jerry-ext/include/jerryscript-ext/autorelease.h [new file with mode: 0644]
deps/jerry/jerry-ext/include/jerryscript-ext/autorelease.impl.h [new file with mode: 0644]
deps/jerry/jerry-ext/include/jerryscript-ext/handler.h [new file with mode: 0644]
deps/jerry/jerry-ext/include/jerryscript-ext/module.h [new file with mode: 0644]
deps/jerry/jerry-ext/include/jerryscript-ext/section.impl.h [new file with mode: 0644]
deps/jerry/jerry-ext/module/module.c [new file with mode: 0644]
deps/jerry/jerry-libc/CMakeLists.txt [new file with mode: 0644]
deps/jerry/jerry-libc/arch/arm-v7.h [new file with mode: 0644]
deps/jerry/jerry-libc/arch/x86-32.h [new file with mode: 0644]
deps/jerry/jerry-libc/arch/x86-64.h [new file with mode: 0644]
deps/jerry/jerry-libc/include/assert.h [new file with mode: 0644]
deps/jerry/jerry-libc/include/setjmp.h [new file with mode: 0644]
deps/jerry/jerry-libc/include/stdio.h [new file with mode: 0644]
deps/jerry/jerry-libc/include/stdlib.h [new file with mode: 0644]
deps/jerry/jerry-libc/include/string.h [new file with mode: 0644]
deps/jerry/jerry-libc/include/sys/time.h [new file with mode: 0644]
deps/jerry/jerry-libc/jerry-libc-defs.h [new file with mode: 0644]
deps/jerry/jerry-libc/jerry-libc-init.c [new file with mode: 0644]
deps/jerry/jerry-libc/jerry-libc-printf.c [new file with mode: 0644]
deps/jerry/jerry-libc/jerry-libc.c [new file with mode: 0644]
deps/jerry/jerry-libc/target/posix/jerry-asm.S [new file with mode: 0644]
deps/jerry/jerry-libc/target/posix/jerry-libc-target.c [new file with mode: 0644]
deps/jerry/jerry-libm/CMakeLists.txt [new file with mode: 0644]
deps/jerry/jerry-libm/acos.c [new file with mode: 0644]
deps/jerry/jerry-libm/asin.c [new file with mode: 0644]
deps/jerry/jerry-libm/atan.c [new file with mode: 0644]
deps/jerry/jerry-libm/atan2.c [new file with mode: 0644]
deps/jerry/jerry-libm/ceil.c [new file with mode: 0644]
deps/jerry/jerry-libm/copysign.c [new file with mode: 0644]
deps/jerry/jerry-libm/exp.c [new file with mode: 0644]
deps/jerry/jerry-libm/fabs.c [new file with mode: 0644]
deps/jerry/jerry-libm/finite.c [new file with mode: 0644]
deps/jerry/jerry-libm/floor.c [new file with mode: 0644]
deps/jerry/jerry-libm/fmod.c [new file with mode: 0644]
deps/jerry/jerry-libm/include/math.h [new file with mode: 0644]
deps/jerry/jerry-libm/isnan.c [new file with mode: 0644]
deps/jerry/jerry-libm/jerry-libm-internal.h [new file with mode: 0644]
deps/jerry/jerry-libm/log.c [new file with mode: 0644]
deps/jerry/jerry-libm/nextafter.c [new file with mode: 0644]
deps/jerry/jerry-libm/pow.c [new file with mode: 0644]
deps/jerry/jerry-libm/scalbn.c [new file with mode: 0644]
deps/jerry/jerry-libm/sqrt.c [new file with mode: 0644]
deps/jerry/jerry-libm/trig.c [new file with mode: 0644]
deps/jerry/jerry-main/CMakeLists.txt [new file with mode: 0644]
deps/jerry/jerry-main/cli.c [new file with mode: 0644]
deps/jerry/jerry-main/cli.h [new file with mode: 0644]
deps/jerry/jerry-main/main-unix-minimal.c [new file with mode: 0644]
deps/jerry/jerry-main/main-unix.c [new file with mode: 0644]
deps/jerry/jerry-port/default/CMakeLists.txt [new file with mode: 0644]
deps/jerry/jerry-port/default/default-date.c [new file with mode: 0644]
deps/jerry/jerry-port/default/default-external-context.c [new file with mode: 0644]
deps/jerry/jerry-port/default/default-fatal.c [new file with mode: 0644]
deps/jerry/jerry-port/default/default-io.c [new file with mode: 0644]
deps/jerry/jerry-port/default/defaultx-handler.c [new file with mode: 0644]
deps/jerry/jerry-port/default/include/jerryscript-port-default.h [new file with mode: 0644]
deps/jerry/targets/curie_bsp/README.md [new file with mode: 0644]
deps/jerry/targets/curie_bsp/image/connect.png [new file with mode: 0644]
deps/jerry/targets/curie_bsp/include/inttypes.h [new file with mode: 0644]
deps/jerry/targets/curie_bsp/include/setjmp.h [new file with mode: 0644]
deps/jerry/targets/curie_bsp/jerry_app/arc/defconfig [new file with mode: 0644]
deps/jerry/targets/curie_bsp/jerry_app/arc/main.c [new file with mode: 0644]
deps/jerry/targets/curie_bsp/jerry_app/arc/memory_pool_list.def [new file with mode: 0644]
deps/jerry/targets/curie_bsp/jerry_app/include/project_mapping.h [new file with mode: 0644]
deps/jerry/targets/curie_bsp/jerry_app/quark/defconfig [new file with mode: 0644]
deps/jerry/targets/curie_bsp/jerry_app/quark/main.c [new file with mode: 0644]
deps/jerry/targets/curie_bsp/jerry_app/quark/memory_pool_list.def [new file with mode: 0644]
deps/jerry/targets/curie_bsp/setup.py [new file with mode: 0755]
deps/jerry/targets/curie_bsp/source/curie-bsp-port.c [new file with mode: 0644]
deps/jerry/targets/curie_bsp/source/setjmp.S [new file with mode: 0644]
deps/jerry/targets/esp8266/LICENSE [new file with mode: 0644]
deps/jerry/targets/esp8266/Makefile [new file with mode: 0644]
deps/jerry/targets/esp8266/Makefile.esp8266 [new file with mode: 0644]
deps/jerry/targets/esp8266/docs/ESP-PATCHFORJERRYSCRIPT.md [new file with mode: 0644]
deps/jerry/targets/esp8266/docs/ESP-PREREQUISITES.md [new file with mode: 0644]
deps/jerry/targets/esp8266/gen_misc.sh [new file with mode: 0644]
deps/jerry/targets/esp8266/include/esp8266_gpio.h [new file with mode: 0644]
deps/jerry/targets/esp8266/include/esp8266_uart.h [new file with mode: 0644]
deps/jerry/targets/esp8266/include/jerry_extapi.h [new file with mode: 0644]
deps/jerry/targets/esp8266/include/jerry_run.h [new file with mode: 0644]
deps/jerry/targets/esp8266/include/native_esp8266.h [new file with mode: 0644]
deps/jerry/targets/esp8266/include/user_config.h [new file with mode: 0644]
deps/jerry/targets/esp8266/js/blink.js [new file with mode: 0644]
deps/jerry/targets/esp8266/js/main.js [new file with mode: 0644]
deps/jerry/targets/esp8266/readme.md [new file with mode: 0644]
deps/jerry/targets/esp8266/source/jerry_extapi.c [new file with mode: 0644]
deps/jerry/targets/esp8266/source/jerry_run.c [new file with mode: 0644]
deps/jerry/targets/esp8266/user/Makefile [new file with mode: 0644]
deps/jerry/targets/esp8266/user/jerry_port.c [new file with mode: 0644]
deps/jerry/targets/esp8266/user/native_esp8266.c [new file with mode: 0644]
deps/jerry/targets/esp8266/user/user_gpio.c [new file with mode: 0644]
deps/jerry/targets/esp8266/user/user_main.c [new file with mode: 0644]
deps/jerry/targets/mbed/Makefile.mbed [new file with mode: 0644]
deps/jerry/targets/mbed/js/blink.js [new file with mode: 0644]
deps/jerry/targets/mbed/js/main.js [new file with mode: 0644]
deps/jerry/targets/mbed/module.json [new file with mode: 0644]
deps/jerry/targets/mbed/readme.md [new file with mode: 0644]
deps/jerry/targets/mbed/source/jerry_extapi.cpp [new file with mode: 0644]
deps/jerry/targets/mbed/source/jerry_extapi.h [new file with mode: 0644]
deps/jerry/targets/mbed/source/jerry_run.cpp [new file with mode: 0644]
deps/jerry/targets/mbed/source/jerry_run.h [new file with mode: 0644]
deps/jerry/targets/mbed/source/main.cpp [new file with mode: 0644]
deps/jerry/targets/mbed/source/makejerry.cmake [new file with mode: 0644]
deps/jerry/targets/mbed/source/native_mbed.cpp [new file with mode: 0644]
deps/jerry/targets/mbed/source/native_mbed.h [new file with mode: 0644]
deps/jerry/targets/mbed/source/port/jerry_port.c [new file with mode: 0644]
deps/jerry/targets/mbedos5/.gitignore [new file with mode: 0644]
deps/jerry/targets/mbedos5/Makefile [new file with mode: 0644]
deps/jerry/targets/mbedos5/README.md [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/AnalogIn-js.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/DigitalOut-js.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/I2C-js.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/InterruptIn-js.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/PwmOut-js.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/lib_drivers.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/setInterval-js.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/setTimeout-js.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/AnalogIn-js.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/DigitalOut-js.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/I2C-js.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/InterruptIn-js.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/PwmOut-js.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/setInterval-js.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/setTimeout-js.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-event-loop/BoundCallback.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-event-loop/EventLoop.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-event-loop/source/EventLoop.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/launcher.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/setup.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/source/launcher.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/source/setup.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/registry.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/source/registry.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/source/wrap_tools.cpp [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/wrap_tools.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-util/js_source.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-util/logging.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-util/wrappers.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/js/flash_leds.js [new file with mode: 0644]
deps/jerry/targets/mbedos5/js/main.js [new file with mode: 0644]
deps/jerry/targets/mbedos5/mbed-os.lib [new file with mode: 0644]
deps/jerry/targets/mbedos5/mbed_app.json [new file with mode: 0644]
deps/jerry/targets/mbedos5/source/jerry_port_mbed.c [new file with mode: 0644]
deps/jerry/targets/mbedos5/template-mbedignore.txt [new file with mode: 0644]
deps/jerry/targets/mbedos5/tools/check_pins.sh [new file with mode: 0755]
deps/jerry/targets/mbedos5/tools/cmsis.h [new file with mode: 0644]
deps/jerry/targets/mbedos5/tools/generate_pins.py [new file with mode: 0644]
deps/jerry/targets/mbedos5/tools/jshint.conf [new file with mode: 0644]
deps/jerry/targets/mbedos5/tools/requirements.txt [new file with mode: 0644]
deps/jerry/targets/nuttx-stm32f4/Kconfig [new file with mode: 0644]
deps/jerry/targets/nuttx-stm32f4/Make.defs [new file with mode: 0644]
deps/jerry/targets/nuttx-stm32f4/Makefile [new file with mode: 0644]
deps/jerry/targets/nuttx-stm32f4/README.md [new file with mode: 0644]
deps/jerry/targets/nuttx-stm32f4/jerry_main.c [new file with mode: 0644]
deps/jerry/targets/nuttx-stm32f4/setjmp.S [new file with mode: 0644]
deps/jerry/targets/nuttx-stm32f4/setjmp.h [new file with mode: 0644]
deps/jerry/targets/particle/Makefile.particle [new file with mode: 0644]
deps/jerry/targets/particle/README.md [new file with mode: 0644]
deps/jerry/targets/particle/source/main.cpp [new file with mode: 0644]
deps/jerry/targets/riot-stm32f4/Makefile [new file with mode: 0644]
deps/jerry/targets/riot-stm32f4/Makefile.riot [new file with mode: 0644]
deps/jerry/targets/riot-stm32f4/README.md [new file with mode: 0644]
deps/jerry/targets/riot-stm32f4/source/main-riotos.c [new file with mode: 0644]
deps/jerry/targets/tizenrt-artik05x/Makefile.tizenrt [new file with mode: 0644]
deps/jerry/targets/tizenrt-artik05x/README.md [new file with mode: 0644]
deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/Kconfig [new file with mode: 0644]
deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/Make.defs [new file with mode: 0644]
deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/Makefile [new file with mode: 0644]
deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/jerry_main.c [new file with mode: 0644]
deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/setjmp.S [new file with mode: 0644]
deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/setjmp.h [new file with mode: 0644]
deps/jerry/targets/tizenrt-artik05x/configs/jerryscript/Make.defs [new file with mode: 0644]
deps/jerry/targets/tizenrt-artik05x/configs/jerryscript/defconfig [new file with mode: 0644]
deps/jerry/targets/zephyr/Makefile [new file with mode: 0644]
deps/jerry/targets/zephyr/Makefile.zephyr [new file with mode: 0644]
deps/jerry/targets/zephyr/README.md [new file with mode: 0644]
deps/jerry/targets/zephyr/docs/arduino_101.jpg [new file with mode: 0644]
deps/jerry/targets/zephyr/prj.conf [new file with mode: 0644]
deps/jerry/targets/zephyr/prj.mdef [new file with mode: 0644]
deps/jerry/targets/zephyr/src/Makefile [new file with mode: 0644]
deps/jerry/targets/zephyr/src/getline-zephyr.c [new file with mode: 0644]
deps/jerry/targets/zephyr/src/getline-zephyr.h [new file with mode: 0644]
deps/jerry/targets/zephyr/src/jerry-port.c [new file with mode: 0644]
deps/jerry/targets/zephyr/src/main-zephyr.c [new file with mode: 0644]
deps/jerry/tests/benchmarks/jerry/fill-array-with-numbers-3-times-5000-elements.js [new file with mode: 0644]
deps/jerry/tests/benchmarks/jerry/function_loop.js [new file with mode: 0644]
deps/jerry/tests/benchmarks/jerry/gc.js [new file with mode: 0644]
deps/jerry/tests/benchmarks/jerry/loop_arithmetics_10kk.js [new file with mode: 0644]
deps/jerry/tests/benchmarks/jerry/loop_arithmetics_1kk.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_backtrace.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_backtrace.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_backtrace.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_break.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_break.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_break.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_continue.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_continue.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_continue.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_delete.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_delete.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_delete.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_delete_all.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_delete_all.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_delete_all.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_display.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_display.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_display.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_eval.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_eval.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_eval.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_eval_syntax.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_eval_syntax.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_eval_syntax.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_exception.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_exception.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_exception.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_help.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_help.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_help.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_list.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_list.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_list.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_next.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_next.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_next.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_pending_breakpoints.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_pending_breakpoints.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_pending_breakpoints.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_quit.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_quit.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_quit.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_src.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_src.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_src.js [new file with mode: 0644]
deps/jerry/tests/debugger/do_step.cmd [new file with mode: 0644]
deps/jerry/tests/debugger/do_step.expected [new file with mode: 0644]
deps/jerry/tests/debugger/do_step.js [new file with mode: 0644]
deps/jerry/tests/hello.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/06/06-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/06/06-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/06/06-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/06/06-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/06/06-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.06/07.06.01/07.06.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.08/07.08.05/07.08.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.09/07.09-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.09/07.09-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.09/07.09-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.09/07.09-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.09/07.09-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.09/07.09-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.09/07.09-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.09/07.09-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.09/07.09-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/07/07.09/07.09-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.01/08.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.02/08.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.02/08.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.03/08.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.03/08.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.03/08.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.03/08.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.04/08.04-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.05/08.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.05/08.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.05/08.05-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/08/08.12/08.12.02/08.12.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/10/10.03/10.03.01/10.03.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.02/11.04.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.02/11.04.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-026.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-027.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-028.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-026.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-027.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-028.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-029.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-030.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-031.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-032.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-033.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-026.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-027.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-028.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-029.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-030.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-031.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-032.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-033.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-034.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-035.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-036.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-037.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-038.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-039.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-040.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-041.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-042.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-043.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-044.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-045.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-046.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-047.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-048.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-049.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-050.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-051.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-052.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-053.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-054.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-055.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-056.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-057.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-058.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-059.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-060.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-061.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-062.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-063.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-064.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-065.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-066.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-067.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-068.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-069.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-070.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-071.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-072.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-073.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-074.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-075.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-076.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-077.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-078.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-079.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-080.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-081.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-082.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-083.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-084.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-085.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-086.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-087.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-088.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-089.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-090.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-026.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-027.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-028.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-029.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-030.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-031.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-032.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-033.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-034.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-035.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-036.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-037.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-038.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-039.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-040.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-041.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-042.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-043.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-044.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-045.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-046.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-047.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-048.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-049.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-050.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-051.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-052.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-053.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-054.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-055.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-056.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-057.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-058.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-059.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-060.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-061.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-062.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-063.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-064.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-065.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-066.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-067.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-068.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-069.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-070.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-071.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-072.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-073.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-074.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-075.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-076.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-077.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-078.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-079.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-080.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-081.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-082.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-083.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-084.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-085.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-086.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-087.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-088.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-089.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-090.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-026.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-027.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-028.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-029.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-030.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-026.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-027.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-028.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-029.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-030.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-031.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-032.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-033.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-034.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-035.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-036.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-037.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-038.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-026.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-027.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-028.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-029.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-030.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-031.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-032.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-033.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-034.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-035.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-036.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-037.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-038.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.10/11.10-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-026.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.11/11.11-027.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.12/11.12-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.12/11.12-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.12/11.12-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.12/11.12-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.12/11.12-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.12/11.12-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.12/11.12-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.01/11.13.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-039.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-040.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-041.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-042.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-043.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-044.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-045.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-046.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-047.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-048.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-049.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-050.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-051.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.14/11.14-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/11/11.14/11.14-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.01/12.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.01/12.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.01/12.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.01/12.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.01/12.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02.01/12.02.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.02/12.02.01/12.02.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.03/12.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.03/12.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.03/12.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.04/12.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.04/12.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.04/12.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.04/12.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.05/12.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.05/12.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.05/12.05-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.05/12.05-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.05/12.05-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.05/12.05-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.05/12.05-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.05/12.05-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.07/12.07-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.08/12.08-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.09/12.09-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.09/12.09-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.09/12.09-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.09/12.09-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.09/12.09-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.09/12.09-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.10/12.10-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.10/12.10-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.10/12.10-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.10/12.10-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.10/12.10-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.10/12.10-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.10/12.10-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.11/12.11-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.11/12.11-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.11/12.11-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.11/12.11-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.11/12.11-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.11/12.11-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.11/12.11-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.12/12.12-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.12/12.12-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.12/12.12-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.12/12.12-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.12/12.12-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.12/12.12-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.12/12.12-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.12/12.12-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.12/12.12-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.12/12.12-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.13/12.13-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.13/12.13-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.13/12.13-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.14/12.14-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.14/12.14-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.14/12.14-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.14/12.14-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.14/12.14-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/12/12.14/12.14-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13.01/13.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13.02/13.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13.02/13.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13.02/13.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13.02/13.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13.02/13.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13.02/13.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13.02/13.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/13/13.02/13.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.01/15.02.04.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.01/15.02.04.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.03/15.02.04.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.03/15.02.04.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.03/15.02.04.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.07/15.02.04.07-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.07/15.02.04.07-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.07/15.02.04.07-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-012s.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.02/15.03.03.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.02/15.05.02.01/15.05.02.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.02/15.05.02.01/15.05.02.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.01/15.05.03.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.01/15.05.03.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.01/15.05.04.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.03/15.05.04.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.07/15.05.04.07-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.07/15.05.04.07-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.07/15.05.04.07-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.02/15.06.02.01/15.06.02.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.02/15.06.02.01/15.06.02.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.03/15.06.03.01/15.06.03.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.01/15.06.04.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.02/15.06.04.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.02/15.06.04.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.02/15.06.04.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.03/15.06.04.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.01/15.07.04.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.01/15.07.04.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-026.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-027.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-028.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-029.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-022.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-023.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-024.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-025.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-026.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-027.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-028.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-029.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-030.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-031.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-019.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-020.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-021.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-009.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-010.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-011.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-012.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-013.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-014.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-015.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-016.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-017.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-018.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.05/22.02.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.06/22.02.06-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-008.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.03/24.01.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-006.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-007.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.03/25.04.03-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.03/25.04.03-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-001.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-002.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-003.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-004.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-005.js [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/es51-profile-list [new file with mode: 0644]
deps/jerry/tests/jerry-test-suite/minimal-profile-list [new file with mode: 0644]
deps/jerry/tests/jerry/N.compact-profile-error.js [new file with mode: 0644]
deps/jerry/tests/jerry/and-or.js [new file with mode: 0644]
deps/jerry/tests/jerry/arguments.js [new file with mode: 0644]
deps/jerry/tests/jerry/arithmetics-2.js [new file with mode: 0644]
deps/jerry/tests/jerry/arithmetics-bignums.js [new file with mode: 0644]
deps/jerry/tests/jerry/arithmetics.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-concat.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-every.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-filter.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-foreach.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-indexof.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-join.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-lastindexof.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-map.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-pop.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-push.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-reduce-right.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-reduce.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-reverse.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-shift.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-slice.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-some.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-sort.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-splice.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-tolocalestring.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-tostring.js [new file with mode: 0644]
deps/jerry/tests/jerry/array-prototype-unshift.js [new file with mode: 0644]
deps/jerry/tests/jerry/array.js [new file with mode: 0644]
deps/jerry/tests/jerry/assignments.js [new file with mode: 0644]
deps/jerry/tests/jerry/bitwise-logic.js [new file with mode: 0644]
deps/jerry/tests/jerry/break-continue-nested-to-try-with-blocks.js [new file with mode: 0644]
deps/jerry/tests/jerry/builtin-constructor-class.js [new file with mode: 0644]
deps/jerry/tests/jerry/date-annexb.js [new file with mode: 0644]
deps/jerry/tests/jerry/date-construct.js [new file with mode: 0644]
deps/jerry/tests/jerry/date-getters.js [new file with mode: 0644]
deps/jerry/tests/jerry/date-parse.js [new file with mode: 0644]
deps/jerry/tests/jerry/date-setters.js [new file with mode: 0644]
deps/jerry/tests/jerry/date-tostring.js [new file with mode: 0644]
deps/jerry/tests/jerry/date-utc.js [new file with mode: 0644]
deps/jerry/tests/jerry/delete.js [new file with mode: 0644]
deps/jerry/tests/jerry/empty-varg.js [new file with mode: 0644]
deps/jerry/tests/jerry/equality.js [new file with mode: 0644]
deps/jerry/tests/jerry/error.js [new file with mode: 0644]
deps/jerry/tests/jerry/es2015/regression-test-issue-1616.js [new file with mode: 0644]
deps/jerry/tests/jerry/es2015/regression-test-issue-1622.js [new file with mode: 0644]
deps/jerry/tests/jerry/es2015/regression-test-issue-1633.js [new file with mode: 0644]
deps/jerry/tests/jerry/es2015/regression-test-issue-1670.js [new file with mode: 0644]
deps/jerry/tests/jerry/es2015/regression-test-issue-1763.js [new file with mode: 0644]
deps/jerry/tests/jerry/es2015/regression-test-issue-1765.js [new file with mode: 0644]
deps/jerry/tests/jerry/es2015/regression-test-issue-1881.js [new file with mode: 0644]
deps/jerry/tests/jerry/escape-sequences.js [new file with mode: 0644]
deps/jerry/tests/jerry/eval.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/arguments-assignment-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/arguments-catch-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/arguments-in-prop-set-param-list-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/arguments-in-var-decl-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/arguments-param-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/arguments-postfix-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/arguments-prefix-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/delete-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/escape-sequences-invalid-hex.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/escape-sequences-invalid-unicode.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/escape-sequences-invalid-variable.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/eval-assignment-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/eval-catch-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/eval-in-prop-set-param-list-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/eval-in-var-decl-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/eval-param-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/eval-postfix-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/eval-prefix-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/func-expr-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/labelled-statements-break-across-function.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/labelled-statements-duplicate-label.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/labelled-statements-no-label.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/let-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/object-get-data.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/object-get-get.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/object-several-prop-names-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/octal-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/param-duplication-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1549.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1550.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1597.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1598.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1615.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1624.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1671.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1831.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1871-1.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1871-2.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1873.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-1918.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-358.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/regression-test-issue-384.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/throw-error-object.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/throw-number.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/throw-string.js [new file with mode: 0644]
deps/jerry/tests/jerry/fail/with-strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/for-in.js [new file with mode: 0644]
deps/jerry/tests/jerry/for.js [new file with mode: 0644]
deps/jerry/tests/jerry/func-decl.js [new file with mode: 0644]
deps/jerry/tests/jerry/function-args.js [new file with mode: 0644]
deps/jerry/tests/jerry/function-construct.js [new file with mode: 0644]
deps/jerry/tests/jerry/function-external.js [new file with mode: 0644]
deps/jerry/tests/jerry/function-prototype-apply.js [new file with mode: 0644]
deps/jerry/tests/jerry/function-prototype-bind.js [new file with mode: 0644]
deps/jerry/tests/jerry/function-prototype-tostring.js [new file with mode: 0644]
deps/jerry/tests/jerry/function-return.js [new file with mode: 0644]
deps/jerry/tests/jerry/function-scopes.js [new file with mode: 0644]
deps/jerry/tests/jerry/function.js [new file with mode: 0644]
deps/jerry/tests/jerry/function.prototype.js [new file with mode: 0644]
deps/jerry/tests/jerry/gc.js [new file with mode: 0644]
deps/jerry/tests/jerry/get-value.js [new file with mode: 0644]
deps/jerry/tests/jerry/getter-setter-this-value.js [new file with mode: 0644]
deps/jerry/tests/jerry/global-escaping.js [new file with mode: 0644]
deps/jerry/tests/jerry/global-parsefloat.js [new file with mode: 0644]
deps/jerry/tests/jerry/global-parseint.js [new file with mode: 0644]
deps/jerry/tests/jerry/global-uri-coding.js [new file with mode: 0644]
deps/jerry/tests/jerry/global.js [new file with mode: 0644]
deps/jerry/tests/jerry/hash.js [new file with mode: 0644]
deps/jerry/tests/jerry/if-else.js [new file with mode: 0644]
deps/jerry/tests/jerry/insert-semicolon.js [new file with mode: 0644]
deps/jerry/tests/jerry/json-parse.js [new file with mode: 0644]
deps/jerry/tests/jerry/json-stringify.js [new file with mode: 0644]
deps/jerry/tests/jerry/labelled-statements.js [new file with mode: 0644]
deps/jerry/tests/jerry/logical.js [new file with mode: 0644]
deps/jerry/tests/jerry/math-abs.js [new file with mode: 0644]
deps/jerry/tests/jerry/math-exp.js [new file with mode: 0644]
deps/jerry/tests/jerry/math-log.js [new file with mode: 0644]
deps/jerry/tests/jerry/math-max.js [new file with mode: 0644]
deps/jerry/tests/jerry/math-min.js [new file with mode: 0644]
deps/jerry/tests/jerry/math-pow.js [new file with mode: 0644]
deps/jerry/tests/jerry/math-round.js [new file with mode: 0644]
deps/jerry/tests/jerry/math-trig.js [new file with mode: 0644]
deps/jerry/tests/jerry/nested-function.js [new file with mode: 0644]
deps/jerry/tests/jerry/new-line-in-literal.js [new file with mode: 0644]
deps/jerry/tests/jerry/number-prototype-to-exponential.js [new file with mode: 0644]
deps/jerry/tests/jerry/number-prototype-to-fixed.js [new file with mode: 0644]
deps/jerry/tests/jerry/number-prototype-to-precision.js [new file with mode: 0644]
deps/jerry/tests/jerry/number-prototype-to-string.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-create.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-define-properties.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-defineproperty.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-get-own-property-descriptor.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-get-own-property-names.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-getprototypeof.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-is-extensible.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-keys.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-literal-2.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-literal-3.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-literal.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-prototype-hasownproperty.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-prototype-isprototypeof.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-prototype-propertyisenumerable.js [new file with mode: 0644]
deps/jerry/tests/jerry/object-prototype-tolocalestring.js [new file with mode: 0644]
deps/jerry/tests/jerry/object_freeze.js [new file with mode: 0644]
deps/jerry/tests/jerry/object_seal.js [new file with mode: 0644]
deps/jerry/tests/jerry/octal.js [new file with mode: 0644]
deps/jerry/tests/jerry/parser-oom.js [new file with mode: 0644]
deps/jerry/tests/jerry/regexp-alternatives.js [new file with mode: 0644]
deps/jerry/tests/jerry/regexp-assertions.js [new file with mode: 0644]
deps/jerry/tests/jerry/regexp-backreference.js [new file with mode: 0644]
deps/jerry/tests/jerry/regexp-capture-groups.js [new file with mode: 0644]
deps/jerry/tests/jerry/regexp-character-class.js [new file with mode: 0644]
deps/jerry/tests/jerry/regexp-construct.js [new file with mode: 0644]
deps/jerry/tests/jerry/regexp-literal.js [new file with mode: 0644]
deps/jerry/tests/jerry/regexp-non-capture-groups.js [new file with mode: 0644]
deps/jerry/tests/jerry/regexp-routines.js [new file with mode: 0644]
deps/jerry/tests/jerry/regexp-simple-atom-and-iterations.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1054.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1065.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1071.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1072.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1073.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1074.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1075.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1076.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1078.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1079.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1080.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1081.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1082.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1083.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-112.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-113.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-114.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-115.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-116.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-117.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-121.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-122.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-123.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-128.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1282.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1284.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1286.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-129.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1292.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-130.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1300.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1309.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-132.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1386.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1387.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1389.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1533.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1546.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1547.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1552.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1555.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1556.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-156.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1621.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1636.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-164.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1641.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1657.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1829.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1830.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1833.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-1855.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-195.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-212.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-245.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-255.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-257.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-260.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-261.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-262.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-263.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-264.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-265.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-266.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-267.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-274.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-276.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-279.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-280.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-281.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-285.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-312.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-316.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-339.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-340.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-341.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-354.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-359.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-380.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-381.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-429.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-440.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-447.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-453.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-541.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-563.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-566.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-612.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-613.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-614.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-639.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-640.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-641.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-642.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-644.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-646.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-652.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-653.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-654.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-655.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-667.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-669.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-680.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-686.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-689.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-703.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-725.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-736.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-737.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-738.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-739.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-741.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-743.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-745.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-747.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-781.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-782.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-783.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-785.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-786.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-787.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-798.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issue-962.js [new file with mode: 0644]
deps/jerry/tests/jerry/regression-test-issues-43-183.js [new file with mode: 0644]
deps/jerry/tests/jerry/relational.js [new file with mode: 0644]
deps/jerry/tests/jerry/shift.js [new file with mode: 0644]
deps/jerry/tests/jerry/sqrt.js [new file with mode: 0644]
deps/jerry/tests/jerry/strict.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-charat.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-charcodeat.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-concat.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-indexof.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-lastindexof.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-localecompare.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-match.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-replace.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-search.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-slice.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-split.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-substr.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-substring.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype-trim.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-prototype.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-surrogates-concat.js [new file with mode: 0644]
deps/jerry/tests/jerry/string-upper-lower-case-conversion.js [new file with mode: 0644]
deps/jerry/tests/jerry/string.js [new file with mode: 0644]
deps/jerry/tests/jerry/switch-case.js [new file with mode: 0644]
deps/jerry/tests/jerry/test-new-string.js [new file with mode: 0644]
deps/jerry/tests/jerry/this-arg.js [new file with mode: 0644]
deps/jerry/tests/jerry/try-catch-finally.js [new file with mode: 0644]
deps/jerry/tests/jerry/typeof.js [new file with mode: 0644]
deps/jerry/tests/jerry/unary-plus-minus.js [new file with mode: 0644]
deps/jerry/tests/jerry/var-decl.js [new file with mode: 0644]
deps/jerry/tests/jerry/variables.js [new file with mode: 0644]
deps/jerry/tests/jerry/zero-character.js [new file with mode: 0644]
deps/jerry/tests/unit-core/CMakeLists.txt [new file with mode: 0644]
deps/jerry/tests/unit-core/test-api.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-common.h [new file with mode: 0644]
deps/jerry/tests/unit-core/test-context-data.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-date-helpers.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-has-property.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-heap.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-lit-char-helpers.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-literal-storage.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-longjmp.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-number-to-integer.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-number-to-string.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-poolman.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-promise.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-string-to-number.c [new file with mode: 0644]
deps/jerry/tests/unit-core/test-strings.c [new file with mode: 0644]
deps/jerry/tests/unit-doc/CMakeLists.txt [new file with mode: 0644]
deps/jerry/tests/unit-ext/CMakeLists.txt [new file with mode: 0644]
deps/jerry/tests/unit-ext/module/CMakeLists.txt [new file with mode: 0644]
deps/jerry/tests/unit-ext/module/jerry-module-test.c [new file with mode: 0644]
deps/jerry/tests/unit-ext/module/my-broken-module.c [new file with mode: 0644]
deps/jerry/tests/unit-ext/module/my-custom-module.c [new file with mode: 0644]
deps/jerry/tests/unit-ext/test-common.h [new file with mode: 0644]
deps/jerry/tests/unit-ext/test-ext-arg.c [new file with mode: 0644]
deps/jerry/tests/unit-ext/test-ext-autorelease.c [new file with mode: 0644]
deps/jerry/tests/unit-ext/test-ext-module-empty.c [new file with mode: 0644]
deps/jerry/tests/unit-libm/CMakeLists.txt [new file with mode: 0644]
deps/jerry/tests/unit-libm/test-libm.c [new file with mode: 0644]
deps/jerry/tests/unit-libm/test-libm.inc.h [new file with mode: 0644]
deps/jerry/third-party/valgrind/memcheck.h [new file with mode: 0644]
deps/jerry/third-party/valgrind/valgrind.h [new file with mode: 0644]
deps/jerry/tools/apt-get-install-deps.sh [new file with mode: 0755]
deps/jerry/tools/apt-get-install-qemu-arm.sh [new file with mode: 0755]
deps/jerry/tools/brew-install-deps.sh [new file with mode: 0755]
deps/jerry/tools/build.py [new file with mode: 0755]
deps/jerry/tools/check-cppcheck.sh [new file with mode: 0755]
deps/jerry/tools/check-doxygen.sh [new file with mode: 0755]
deps/jerry/tools/check-license.py [new file with mode: 0755]
deps/jerry/tools/check-magic-strings.sh [new file with mode: 0755]
deps/jerry/tools/check-pylint.sh [new file with mode: 0755]
deps/jerry/tools/check-signed-off.sh [new file with mode: 0755]
deps/jerry/tools/check-vera.sh [new file with mode: 0755]
deps/jerry/tools/cppcheck/suppressions-list [new file with mode: 0644]
deps/jerry/tools/gen-doctest.py [new file with mode: 0755]
deps/jerry/tools/gen-magic-strings.py [new file with mode: 0755]
deps/jerry/tools/gen-test-libm.sh [new file with mode: 0755]
deps/jerry/tools/gen-unicode.py [new file with mode: 0755]
deps/jerry/tools/gen_c_source.py [new file with mode: 0644]
deps/jerry/tools/generator.sh [new file with mode: 0755]
deps/jerry/tools/js2c.py [new file with mode: 0755]
deps/jerry/tools/make-log-perf-compare.sh [new file with mode: 0755]
deps/jerry/tools/mem-stats-measure.sh [new file with mode: 0755]
deps/jerry/tools/perf.sh [new file with mode: 0755]
deps/jerry/tools/pylint/pylintrc [new file with mode: 0644]
deps/jerry/tools/rss-measure.sh [new file with mode: 0755]
deps/jerry/tools/run-mem-stats-test.sh [new file with mode: 0755]
deps/jerry/tools/run-perf-test.sh [new file with mode: 0755]
deps/jerry/tools/run-tests.py [new file with mode: 0755]
deps/jerry/tools/runners/run-benchmarks.sh [new file with mode: 0755]
deps/jerry/tools/runners/run-debugger-test.sh [new file with mode: 0755]
deps/jerry/tools/runners/run-stability-test.sh [new file with mode: 0755]
deps/jerry/tools/runners/run-test-suite-test262.sh [new file with mode: 0755]
deps/jerry/tools/runners/run-test-suite.sh [new file with mode: 0755]
deps/jerry/tools/runners/run-tests-remote.sh [new file with mode: 0755]
deps/jerry/tools/runners/run-unittests-remote.sh [new file with mode: 0755]
deps/jerry/tools/runners/run-unittests.sh [new file with mode: 0755]
deps/jerry/tools/settings.py [new file with mode: 0755]
deps/jerry/tools/sort-fails.sh [new file with mode: 0755]
deps/jerry/tools/unit-tests/Makefile [new file with mode: 0644]
deps/jerry/tools/unit-tests/gen-test-libm.c [new file with mode: 0644]
deps/jerry/tools/update-webpage.sh [new file with mode: 0755]
deps/jerry/tools/vera++/profiles/jerry [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_always_curly.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_braces_on_separate_line.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_braces_same_line_or_column.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_comment_function_end.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_funcname_space_parentheses.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_identifier_no_space_bracket.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_indentation.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_max_line_length.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_no_space_after_opening_parentheses.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_no_space_before_closing_parentheses.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_no_tabs.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_no_trailing_spaces.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_pointer_declarator_space.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_switch_case.tcl [new file with mode: 0644]
deps/jerry/tools/vera++/scripts/rules/jerry_typecast_space_parentheses.tcl [new file with mode: 0644]
deps/libtuv/.gitignore [new file with mode: 0644]
deps/libtuv/.travis.yml [new file with mode: 0644]
deps/libtuv/CMakeLists.txt [new file with mode: 0644]
deps/libtuv/LICENSE [new file with mode: 0644]
deps/libtuv/Makefile [new file with mode: 0644]
deps/libtuv/Makefile.all [new file with mode: 0644]
deps/libtuv/README.md [new file with mode: 0644]
deps/libtuv/cmake/apiemultest.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_arm-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_arm-mbed.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_arm-nuttx.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_arm-tizen.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_arm-tizenrt.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_armhf-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_i686-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_mips-openwrt.cmake [new file with mode: 0755]
deps/libtuv/cmake/config/config_mipsel-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_noarch-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_x86_64-darwin.cmake [new file with mode: 0644]
deps/libtuv/cmake/config/config_x86_64-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/libtuv.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_arm-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_arm-mbed.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_arm-nuttx.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_arm-tizen.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_arm-tizenrt.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_armhf-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_i686-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_linux_common.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_mips-openwrt.cmake [new file with mode: 0755]
deps/libtuv/cmake/option/option_mipsel-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_noarch-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_raw_common.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_unix_common.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_x86_64-darwin.cmake [new file with mode: 0644]
deps/libtuv/cmake/option/option_x86_64-linux.cmake [new file with mode: 0644]
deps/libtuv/cmake/options.cmake [new file with mode: 0644]
deps/libtuv/cmake/tuvtest.cmake [new file with mode: 0644]
deps/libtuv/include/android-ifaddrs.h [new file with mode: 0644]
deps/libtuv/include/pthread-barrier.h [new file with mode: 0644]
deps/libtuv/include/stdint-msvc2008.h [new file with mode: 0644]
deps/libtuv/include/tree.h [new file with mode: 0644]
deps/libtuv/include/tuv__debuglog.h [new file with mode: 0644]
deps/libtuv/include/uv-aix.h [new file with mode: 0644]
deps/libtuv/include/uv-bsd.h [new file with mode: 0644]
deps/libtuv/include/uv-darwin.h [new file with mode: 0644]
deps/libtuv/include/uv-errno.h [new file with mode: 0644]
deps/libtuv/include/uv-linux.h [new file with mode: 0644]
deps/libtuv/include/uv-nuttx.h [new file with mode: 0644]
deps/libtuv/include/uv-os390.h [new file with mode: 0644]
deps/libtuv/include/uv-sunos.h [new file with mode: 0644]
deps/libtuv/include/uv-threadpool.h [new file with mode: 0644]
deps/libtuv/include/uv-tizenrt.h [new file with mode: 0644]
deps/libtuv/include/uv-unix.h [new file with mode: 0644]
deps/libtuv/include/uv-version.h [new file with mode: 0644]
deps/libtuv/include/uv-win.h [new file with mode: 0644]
deps/libtuv/include/uv.h [new file with mode: 0644]
deps/libtuv/src/fs-poll.c [new file with mode: 0644]
deps/libtuv/src/heap-inl.h [new file with mode: 0644]
deps/libtuv/src/inet.c [new file with mode: 0644]
deps/libtuv/src/queue.h [new file with mode: 0644]
deps/libtuv/src/threadpool.c [new file with mode: 0644]
deps/libtuv/src/tuv__config.h.in [new file with mode: 0644]
deps/libtuv/src/tuv_debuglog.c [new file with mode: 0644]
deps/libtuv/src/unix/aix.c [new file with mode: 0644]
deps/libtuv/src/unix/android-ifaddrs.c [new file with mode: 0644]
deps/libtuv/src/unix/async.c [new file with mode: 0644]
deps/libtuv/src/unix/atomic-ops.h [new file with mode: 0644]
deps/libtuv/src/unix/core.c [new file with mode: 0644]
deps/libtuv/src/unix/darwin-proctitle.c [new file with mode: 0644]
deps/libtuv/src/unix/darwin.c [new file with mode: 0644]
deps/libtuv/src/unix/dl.c [new file with mode: 0644]
deps/libtuv/src/unix/freebsd.c [new file with mode: 0644]
deps/libtuv/src/unix/fs.c [new file with mode: 0644]
deps/libtuv/src/unix/fsevents.c [new file with mode: 0644]
deps/libtuv/src/unix/getaddrinfo.c [new file with mode: 0644]
deps/libtuv/src/unix/getnameinfo.c [new file with mode: 0644]
deps/libtuv/src/unix/internal.h [new file with mode: 0644]
deps/libtuv/src/unix/kqueue.c [new file with mode: 0644]
deps/libtuv/src/unix/linux-core.c [new file with mode: 0644]
deps/libtuv/src/unix/linux-inotify.c [new file with mode: 0644]
deps/libtuv/src/unix/linux-syscalls.c [new file with mode: 0644]
deps/libtuv/src/unix/linux-syscalls.h [new file with mode: 0644]
deps/libtuv/src/unix/loop-watcher.c [new file with mode: 0644]
deps/libtuv/src/unix/loop.c [new file with mode: 0644]
deps/libtuv/src/unix/netbsd.c [new file with mode: 0644]
deps/libtuv/src/unix/nuttx.c [new file with mode: 0644]
deps/libtuv/src/unix/openbsd.c [new file with mode: 0644]
deps/libtuv/src/unix/os390.c [new file with mode: 0644]
deps/libtuv/src/unix/pipe.c [new file with mode: 0644]
deps/libtuv/src/unix/poll.c [new file with mode: 0644]
deps/libtuv/src/unix/process.c [new file with mode: 0644]
deps/libtuv/src/unix/proctitle.c [new file with mode: 0644]
deps/libtuv/src/unix/pthread-barrier.c [new file with mode: 0644]
deps/libtuv/src/unix/pthread-fixes.c [new file with mode: 0644]
deps/libtuv/src/unix/signal.c [new file with mode: 0644]
deps/libtuv/src/unix/spinlock.h [new file with mode: 0644]
deps/libtuv/src/unix/stream.c [new file with mode: 0644]
deps/libtuv/src/unix/sunos.c [new file with mode: 0644]
deps/libtuv/src/unix/tcp.c [new file with mode: 0644]
deps/libtuv/src/unix/thread.c [new file with mode: 0644]
deps/libtuv/src/unix/timer.c [new file with mode: 0644]
deps/libtuv/src/unix/tizenrt.c [new file with mode: 0644]
deps/libtuv/src/unix/tty.c [new file with mode: 0644]
deps/libtuv/src/unix/udp.c [new file with mode: 0644]
deps/libtuv/src/uv-common.c [new file with mode: 0644]
deps/libtuv/src/uv-common.h [new file with mode: 0644]
deps/libtuv/src/version.c [new file with mode: 0644]
deps/libtuv/test/echo_server.c [new file with mode: 0644]
deps/libtuv/test/raw/apiemul.h [new file with mode: 0644]
deps/libtuv/test/raw/apiemul_main.c [new file with mode: 0644]
deps/libtuv/test/raw/apiemul_socket.c [new file with mode: 0644]
deps/libtuv/test/raw/echo_server_raw.c [new file with mode: 0644]
deps/libtuv/test/raw/raw_main.c [new file with mode: 0644]
deps/libtuv/test/raw/raw_main.h [new file with mode: 0644]
deps/libtuv/test/raw/runner_main_raw.c [new file with mode: 0644]
deps/libtuv/test/raw/test_active_raw.c [new file with mode: 0644]
deps/libtuv/test/raw/test_async_raw.c [new file with mode: 0644]
deps/libtuv/test/raw/test_condvar_raw.c [new file with mode: 0644]
deps/libtuv/test/raw/test_idle_raw.c [new file with mode: 0644]
deps/libtuv/test/raw/test_shutdown_eof_raw.c [new file with mode: 0644]
deps/libtuv/test/raw/test_tcp_open_raw.c [new file with mode: 0644]
deps/libtuv/test/raw/test_threadpool_raw_queue_work_simple.c [new file with mode: 0644]
deps/libtuv/test/raw/test_timer_raw_again.c [new file with mode: 0644]
deps/libtuv/test/raw/test_timer_raw_huge_repeat.c [new file with mode: 0644]
deps/libtuv/test/raw/test_timer_raw_huge_timeout.c [new file with mode: 0644]
deps/libtuv/test/raw/test_timer_raw_init.c [new file with mode: 0644]
deps/libtuv/test/raw/test_timer_raw_norm.c [new file with mode: 0644]
deps/libtuv/test/raw/test_timer_raw_order.c [new file with mode: 0644]
deps/libtuv/test/raw/test_timer_raw_run_null_callback.c [new file with mode: 0644]
deps/libtuv/test/raw/test_timer_raw_run_once.c [new file with mode: 0644]
deps/libtuv/test/raw/test_timer_raw_start_twice.c [new file with mode: 0644]
deps/libtuv/test/raw/test_walk_handles_raw.c [new file with mode: 0644]
deps/libtuv/test/resources/empty_file [new file with mode: 0644]
deps/libtuv/test/runner.h [new file with mode: 0644]
deps/libtuv/test/runner_linux.c [new file with mode: 0644]
deps/libtuv/test/runner_linux_raw.c [new file with mode: 0644]
deps/libtuv/test/runner_list.h [new file with mode: 0644]
deps/libtuv/test/runner_main.c [new file with mode: 0644]
deps/libtuv/test/runner_nuttx.c [new file with mode: 0644]
deps/libtuv/test/runner_tizenrt.c [new file with mode: 0644]
deps/libtuv/test/test_active.c [new file with mode: 0644]
deps/libtuv/test/test_async.c [new file with mode: 0644]
deps/libtuv/test/test_condvar.c [new file with mode: 0644]
deps/libtuv/test/test_cwd.c [new file with mode: 0644]
deps/libtuv/test/test_error.c [new file with mode: 0644]
deps/libtuv/test/test_fs.c [new file with mode: 0644]
deps/libtuv/test/test_getaddrinfo.c [new file with mode: 0644]
deps/libtuv/test/test_idle.c [new file with mode: 0644]
deps/libtuv/test/test_shutdown_eof.c [new file with mode: 0644]
deps/libtuv/test/test_tcp_open.c [new file with mode: 0644]
deps/libtuv/test/test_threadpool.c [new file with mode: 0644]
deps/libtuv/test/test_timer.c [new file with mode: 0644]
deps/libtuv/test/test_timer_again.c [new file with mode: 0644]
deps/libtuv/test/test_walk_handles.c [new file with mode: 0644]
deps/libtuv/tools/apt-get-install-arm.sh [new file with mode: 0755]
deps/libtuv/tools/apt-get-install-deps.sh [new file with mode: 0755]
deps/libtuv/tools/check-signed-off.sh [new file with mode: 0755]
docs/Developer's-Guide.md [new file with mode: 0644]
docs/Getting-Started.md [new file with mode: 0644]
docs/License.md [new file with mode: 0644]
docs/README.md [new file with mode: 0644]
docs/api/IoT.js-API-ADC.md [new file with mode: 0644]
docs/api/IoT.js-API-Assert.md [new file with mode: 0644]
docs/api/IoT.js-API-BLE.md [new file with mode: 0644]
docs/api/IoT.js-API-Buffer.md [new file with mode: 0644]
docs/api/IoT.js-API-DGRAM.md [new file with mode: 0644]
docs/api/IoT.js-API-DNS.md [new file with mode: 0644]
docs/api/IoT.js-API-Events.md [new file with mode: 0644]
docs/api/IoT.js-API-File-System.md [new file with mode: 0644]
docs/api/IoT.js-API-GPIO.md [new file with mode: 0644]
docs/api/IoT.js-API-HTTP.md [new file with mode: 0644]
docs/api/IoT.js-API-HTTPS.md [new file with mode: 0644]
docs/api/IoT.js-API-I2C.md [new file with mode: 0644]
docs/api/IoT.js-API-Module.md [new file with mode: 0644]
docs/api/IoT.js-API-Net.md [new file with mode: 0644]
docs/api/IoT.js-API-PWM.md [new file with mode: 0644]
docs/api/IoT.js-API-Process.md [new file with mode: 0644]
docs/api/IoT.js-API-SPI.md [new file with mode: 0644]
docs/api/IoT.js-API-Stream.md [new file with mode: 0644]
docs/api/IoT.js-API-Timers.md [new file with mode: 0644]
docs/api/IoT.js-API-UART.md [new file with mode: 0644]
docs/api/IoT.js-API-reference.md [new file with mode: 0644]
docs/build/Build-Script.md [new file with mode: 0644]
docs/build/Build-for-ARTIK053-TizenRT.md [new file with mode: 0644]
docs/build/Build-for-ARTIK10-Tizen.md [new file with mode: 0644]
docs/build/Build-for-RPi2-Linux.md [new file with mode: 0644]
docs/build/Build-for-STM32F4-NuttX.md [new file with mode: 0644]
docs/build/Build-for-x86-Linux.md [new file with mode: 0644]
docs/contributing/Assigned-People.md [new file with mode: 0644]
docs/contributing/Community-Guidelines.md [new file with mode: 0644]
docs/contributing/Governance.md [new file with mode: 0644]
docs/contributing/Patch-Submission-Process.md [new file with mode: 0644]
docs/devs/API-Document-Guidelines.md [new file with mode: 0644]
docs/devs/Advanced-Development.md [new file with mode: 0644]
docs/devs/Coding-Style-Guidelines.md [new file with mode: 0644]
docs/devs/Developer-Tutorial.md [new file with mode: 0644]
docs/devs/Development-Process.md [new file with mode: 0644]
docs/devs/Experimental-Features.md [new file with mode: 0644]
docs/devs/Extended-API-Guidelines.md [new file with mode: 0644]
docs/devs/Inside-IoT.js-Validated-Struct.md [new file with mode: 0644]
docs/devs/Inside-IoT.js.md [new file with mode: 0644]
docs/devs/IoT.js-Developer's-Certificate-of-Origin-1.0.md [new file with mode: 0644]
docs/devs/IoT.js-Package-(outdated).md [new file with mode: 0644]
docs/devs/Logging-IoT.js-execution.md [new file with mode: 0644]
docs/devs/Memory-savings-with-libtuv.md [new file with mode: 0644]
docs/devs/Native-Module-vs-JS-Module.md [new file with mode: 0644]
docs/devs/Optimization-Tips.md [new file with mode: 0644]
docs/devs/Test-Guidelines.md [new file with mode: 0644]
docs/devs/Use-JerryScript-Debugger.md [new file with mode: 0644]
docs/devs/Writing-New-Builtin-Module.md [new file with mode: 0644]
docs/targets/nuttx/stm32f4dis/IoT.js-API-Stm32f4dis.md [new file with mode: 0644]
docs/targets/tizenrt/artik05x/IoT.js-API-artik053.md [new file with mode: 0644]
include/iotjs.h [new file with mode: 0644]
iotjs [deleted submodule]
iotjs_linux.c [new file with mode: 0644]
samples/gpio-blinkedled/gpio_led.js [new file with mode: 0644]
samples/gpio-blinkedled/systemio_pin.js [new file with mode: 0644]
samples/http-hello/client_get.js [new file with mode: 0644]
samples/http-hello/client_post.js [new file with mode: 0644]
samples/http-hello/server.js [new file with mode: 0644]
samples/net-hello/client.js [new file with mode: 0644]
samples/net-hello/server.js [new file with mode: 0644]
src/iotjs.c [new file with mode: 0644]
src/iotjs_binding.c [new file with mode: 0644]
src/iotjs_binding.h [new file with mode: 0644]
src/iotjs_binding_helper.c [new file with mode: 0644]
src/iotjs_binding_helper.h [new file with mode: 0644]
src/iotjs_debuglog.c [new file with mode: 0644]
src/iotjs_debuglog.h [new file with mode: 0644]
src/iotjs_def.h [new file with mode: 0644]
src/iotjs_env.c [new file with mode: 0644]
src/iotjs_env.h [new file with mode: 0644]
src/iotjs_exception.c [new file with mode: 0644]
src/iotjs_exception.h [new file with mode: 0644]
src/iotjs_handlewrap.c [new file with mode: 0644]
src/iotjs_handlewrap.h [new file with mode: 0644]
src/iotjs_magic_strings.h [new file with mode: 0644]
src/iotjs_module.c [new file with mode: 0644]
src/iotjs_module.h [new file with mode: 0644]
src/iotjs_objectwrap.c [new file with mode: 0644]
src/iotjs_objectwrap.h [new file with mode: 0644]
src/iotjs_reqwrap.c [new file with mode: 0644]
src/iotjs_reqwrap.h [new file with mode: 0644]
src/iotjs_string.c [new file with mode: 0644]
src/iotjs_string.h [new file with mode: 0644]
src/iotjs_string_ext.c [new file with mode: 0644]
src/iotjs_string_ext.h [new file with mode: 0644]
src/iotjs_util.c [new file with mode: 0644]
src/iotjs_util.h [new file with mode: 0644]
src/js/adc.js [new file with mode: 0644]
src/js/assert.js [new file with mode: 0644]
src/js/ble.js [new file with mode: 0644]
src/js/ble_characteristic.js [new file with mode: 0644]
src/js/ble_descriptor.js [new file with mode: 0644]
src/js/ble_hci_socket.js [new file with mode: 0644]
src/js/ble_hci_socket_acl_stream.js [new file with mode: 0644]
src/js/ble_hci_socket_bindings.js [new file with mode: 0644]
src/js/ble_hci_socket_crypto.js [new file with mode: 0644]
src/js/ble_hci_socket_gap.js [new file with mode: 0644]
src/js/ble_hci_socket_gatt.js [new file with mode: 0644]
src/js/ble_hci_socket_hci.js [new file with mode: 0644]
src/js/ble_hci_socket_hci_status.js [new file with mode: 0644]
src/js/ble_hci_socket_mgmt.js [new file with mode: 0644]
src/js/ble_hci_socket_smp.js [new file with mode: 0644]
src/js/ble_primary_service.js [new file with mode: 0644]
src/js/ble_uuid_util.js [new file with mode: 0644]
src/js/buffer.js [new file with mode: 0644]
src/js/console.js [new file with mode: 0644]
src/js/constants.js [new file with mode: 0644]
src/js/dgram.js [new file with mode: 0644]
src/js/dns.js [new file with mode: 0644]
src/js/events.js [new file with mode: 0644]
src/js/fs.js [new file with mode: 0644]
src/js/gpio.js [new file with mode: 0644]
src/js/http.js [new file with mode: 0644]
src/js/http_client.js [new file with mode: 0644]
src/js/http_common.js [new file with mode: 0644]
src/js/http_incoming.js [new file with mode: 0644]
src/js/http_outgoing.js [new file with mode: 0644]
src/js/http_server.js [new file with mode: 0644]
src/js/https.js [new file with mode: 0644]
src/js/https_client.js [new file with mode: 0644]
src/js/https_incoming.js [new file with mode: 0644]
src/js/i2c.js [new file with mode: 0644]
src/js/iotjs.js [new file with mode: 0644]
src/js/module.js [new file with mode: 0644]
src/js/net.js [new file with mode: 0644]
src/js/pwm.js [new file with mode: 0644]
src/js/spi.js [new file with mode: 0644]
src/js/stm32f4dis.js [new file with mode: 0644]
src/js/stream.js [new file with mode: 0644]
src/js/stream_duplex.js [new file with mode: 0644]
src/js/stream_readable.js [new file with mode: 0644]
src/js/stream_writable.js [new file with mode: 0644]
src/js/testdriver.js [new file with mode: 0644]
src/js/timers.js [new file with mode: 0644]
src/js/uart.js [new file with mode: 0644]
src/js/util.js [new file with mode: 0644]
src/modules/iotjs_module_adc.c [new file with mode: 0644]
src/modules/iotjs_module_adc.h [new file with mode: 0644]
src/modules/iotjs_module_blehcisocket.c [new file with mode: 0644]
src/modules/iotjs_module_blehcisocket.h [new file with mode: 0644]
src/modules/iotjs_module_buffer.c [new file with mode: 0644]
src/modules/iotjs_module_buffer.h [new file with mode: 0644]
src/modules/iotjs_module_console.c [new file with mode: 0644]
src/modules/iotjs_module_constants.c [new file with mode: 0644]
src/modules/iotjs_module_dns.c [new file with mode: 0644]
src/modules/iotjs_module_dns.h [new file with mode: 0644]
src/modules/iotjs_module_fs.c [new file with mode: 0644]
src/modules/iotjs_module_gpio.c [new file with mode: 0644]
src/modules/iotjs_module_gpio.h [new file with mode: 0644]
src/modules/iotjs_module_httpparser.c [new file with mode: 0644]
src/modules/iotjs_module_httpparser.h [new file with mode: 0644]
src/modules/iotjs_module_https.c [new file with mode: 0644]
src/modules/iotjs_module_https.h [new file with mode: 0644]
src/modules/iotjs_module_i2c.c [new file with mode: 0644]
src/modules/iotjs_module_i2c.h [new file with mode: 0644]
src/modules/iotjs_module_process.c [new file with mode: 0644]
src/modules/iotjs_module_pwm.c [new file with mode: 0644]
src/modules/iotjs_module_pwm.h [new file with mode: 0644]
src/modules/iotjs_module_spi.c [new file with mode: 0644]
src/modules/iotjs_module_spi.h [new file with mode: 0644]
src/modules/iotjs_module_stm32f4dis.c [new file with mode: 0644]
src/modules/iotjs_module_stm32f4dis.h [new file with mode: 0644]
src/modules/iotjs_module_tcp.c [new file with mode: 0644]
src/modules/iotjs_module_tcp.h [new file with mode: 0644]
src/modules/iotjs_module_testdriver.c [new file with mode: 0644]
src/modules/iotjs_module_timer.c [new file with mode: 0644]
src/modules/iotjs_module_timer.h [new file with mode: 0644]
src/modules/iotjs_module_uart.c [new file with mode: 0644]
src/modules/iotjs_module_uart.h [new file with mode: 0644]
src/modules/iotjs_module_udp.c [new file with mode: 0644]
src/modules/iotjs_module_udp.h [new file with mode: 0644]
src/platform/linux/iotjs_module_adc-linux.c [new file with mode: 0644]
src/platform/linux/iotjs_module_blehcisocket-linux.c [new file with mode: 0644]
src/platform/linux/iotjs_module_gpio-linux.c [new file with mode: 0644]
src/platform/linux/iotjs_module_i2c-linux.c [new file with mode: 0644]
src/platform/linux/iotjs_module_pwm-linux.c [new file with mode: 0644]
src/platform/linux/iotjs_module_spi-linux.c [new file with mode: 0644]
src/platform/linux/iotjs_module_uart-linux.c [new file with mode: 0644]
src/platform/linux/iotjs_systemio-linux.c [new file with mode: 0644]
src/platform/linux/iotjs_systemio-linux.h [new file with mode: 0644]
src/platform/nuttx/iotjs_module_adc-nuttx.c [new file with mode: 0644]
src/platform/nuttx/iotjs_module_blehcisocket-nuttx.c [new file with mode: 0644]
src/platform/nuttx/iotjs_module_i2c-nuttx.c [new file with mode: 0644]
src/platform/nuttx/iotjs_module_pwm-nuttx.c [new file with mode: 0644]
src/platform/nuttx/iotjs_module_spi-nuttx.c [new file with mode: 0644]
src/platform/nuttx/iotjs_module_stm32f4dis-nuttx.c [new file with mode: 0644]
src/platform/nuttx/iotjs_module_uart-nuttx.c [new file with mode: 0644]
src/platform/nuttx/iotjs_systemio-nuttx.h [new file with mode: 0644]
src/platform/nuttx/stm32f4dis/iotjs_module_gpio-nuttx-stm32f4dis.c [new file with mode: 0644]
src/platform/nuttx/stm32f4dis/iotjs_systemio-nuttx-stm32f4dis.c [new file with mode: 0644]
src/platform/tizenrt/iotjs_module_gpio-tizenrt.c [new file with mode: 0644]
src/platform/tizenrt/iotjs_module_pwm-tizenrt.c [new file with mode: 0644]
src/platform/tizenrt/iotjs_module_uart-tizenrt.c [new file with mode: 0644]
test/node/common.js [new file with mode: 0644]
test/node/parallel/test-assert.js [new file with mode: 0644]
test/node/parallel/test-http-catch-uncaughtexception.js [new file with mode: 0644]
test/node/parallel/test-http-status-message.js [new file with mode: 0644]
test/node/parallel/test-http-write-head.js [new file with mode: 0644]
test/node/parallel/test-net-after-close.js [new file with mode: 0644]
test/node/parallel/test-net-bind-twice.js [new file with mode: 0644]
test/node/parallel/test-net-end-without-connect.js [new file with mode: 0644]
test/node/parallel/test-net-keepalive.js [new file with mode: 0644]
test/node/parallel/test-timers-clear-null-does-not-throw-error.js [new file with mode: 0644]
test/resources/greeting.txt [new file with mode: 0644]
test/resources/process/package.json [new file with mode: 0644]
test/resources/readdir/DO_NOT_MODIFY_THIS_FOLDER [new file with mode: 0644]
test/resources/readdir/This_is_a_directory/.gitkeep [new file with mode: 0644]
test/resources/readdir/This_is_another_directory/.gitkeep [new file with mode: 0644]
test/resources/readdir/regular.txt [new file with mode: 0644]
test/resources/rename.txt [new file with mode: 0644]
test/resources/test1.txt [new file with mode: 0644]
test/resources/test2.txt [new file with mode: 0644]
test/resources/test_console_stdout.txt [new file with mode: 0644]
test/resources/tobeornottobe.txt [new file with mode: 0644]
test/run_fail/test_assert_equal.js [new file with mode: 0644]
test/run_fail/test_assert_fail.js [new file with mode: 0644]
test/run_fail/test_assert_notequal.js [new file with mode: 0644]
test/run_fail/test_events_emit_error.js [new file with mode: 0644]
test/run_fail/test_fs_callbacks_called.js [new file with mode: 0644]
test/run_fail/test_iotjs_runtime_error.js [new file with mode: 0644]
test/run_fail/test_iotjs_syntax_error.js [new file with mode: 0644]
test/run_fail/test_module_require_invalid_file.js [new file with mode: 0644]
test/run_fail/test_process_exitcode_arg.js [new file with mode: 0644]
test/run_fail/test_process_exitcode_var.js [new file with mode: 0644]
test/run_fail/test_process_explicit_exit.js [new file with mode: 0644]
test/run_fail/test_process_implicit_exit.js [new file with mode: 0644]
test/run_pass/issue/issue-1046.js [new file with mode: 0644]
test/run_pass/issue/issue-133.js [new file with mode: 0644]
test/run_pass/issue/issue-137.js [new file with mode: 0644]
test/run_pass/issue/issue-198.js [new file with mode: 0644]
test/run_pass/issue/issue-223.js [new file with mode: 0644]
test/run_pass/issue/issue-266.js [new file with mode: 0644]
test/run_pass/issue/issue-323.js [new file with mode: 0644]
test/run_pass/issue/issue-816.js [new file with mode: 0644]
test/run_pass/require1/module_cache.js [new file with mode: 0644]
test/run_pass/require1/require_add.js [new file with mode: 0644]
test/run_pass/require1/test_index/add2.js [new file with mode: 0644]
test/run_pass/require1/test_index/index.js [new file with mode: 0644]
test/run_pass/require1/test_index/lib/multi.js [new file with mode: 0644]
test/run_pass/require1/test_index/package.json [new file with mode: 0644]
test/run_pass/require1/test_pkg/add2.js [new file with mode: 0644]
test/run_pass/require1/test_pkg/lib/multi.js [new file with mode: 0644]
test/run_pass/require1/test_pkg/main.js [new file with mode: 0644]
test/run_pass/require1/test_pkg/package.json [new file with mode: 0644]
test/run_pass/test_adc.js [new file with mode: 0644]
test/run_pass/test_assert.js [new file with mode: 0644]
test/run_pass/test_ble_advertisement.js [new file with mode: 0644]
test/run_pass/test_ble_setservices.js [new file with mode: 0644]
test/run_pass/test_ble_setservices_central.js [new file with mode: 0644]
test/run_pass/test_buffer.js [new file with mode: 0644]
test/run_pass/test_buffer_builtin.js [new file with mode: 0644]
test/run_pass/test_console.js [new file with mode: 0644]
test/run_pass/test_dgram_1_server_1_client.js [new file with mode: 0644]
test/run_pass/test_dgram_1_server_n_clients.js [new file with mode: 0644]
test/run_pass/test_dgram_address.js [new file with mode: 0644]
test/run_pass/test_dgram_broadcast.js [new file with mode: 0644]
test/run_pass/test_dgram_multicast_membership.js [new file with mode: 0644]
test/run_pass/test_dgram_multicast_set_multicast_loop.js [new file with mode: 0644]
test/run_pass/test_dgram_setttl_client.js [new file with mode: 0644]
test/run_pass/test_dgram_setttl_server.js [new file with mode: 0644]
test/run_pass/test_dns.js [new file with mode: 0644]
test/run_pass/test_dns_lookup.js [new file with mode: 0644]
test/run_pass/test_events.js [new file with mode: 0644]
test/run_pass/test_events_assert_emit_error.js [new file with mode: 0644]
test/run_pass/test_events_uncaught_error.js [new file with mode: 0644]
test/run_pass/test_fs_event.js [new file with mode: 0644]
test/run_pass/test_fs_exists.js [new file with mode: 0644]
test/run_pass/test_fs_exists_sync.js [new file with mode: 0644]
test/run_pass/test_fs_fstat.js [new file with mode: 0644]
test/run_pass/test_fs_fstat_sync.js [new file with mode: 0644]
test/run_pass/test_fs_mkdir_rmdir.js [new file with mode: 0644]
test/run_pass/test_fs_open_close.js [new file with mode: 0644]
test/run_pass/test_fs_open_read.js [new file with mode: 0644]
test/run_pass/test_fs_open_read_sync_1.js [new file with mode: 0644]
test/run_pass/test_fs_open_read_sync_2.js [new file with mode: 0644]
test/run_pass/test_fs_open_read_sync_3.js [new file with mode: 0644]
test/run_pass/test_fs_readdir.js [new file with mode: 0644]
test/run_pass/test_fs_readfile.js [new file with mode: 0644]
test/run_pass/test_fs_readfile_sync.js [new file with mode: 0644]
test/run_pass/test_fs_rename.js [new file with mode: 0644]
test/run_pass/test_fs_rename_sync.js [new file with mode: 0644]
test/run_pass/test_fs_stat.js [new file with mode: 0644]
test/run_pass/test_fs_write.js [new file with mode: 0644]
test/run_pass/test_fs_writefile.js [new file with mode: 0644]
test/run_pass/test_fs_writefile_sync.js [new file with mode: 0644]
test/run_pass/test_fs_writefile_unlink.js [new file with mode: 0644]
test/run_pass/test_fs_writefile_unlink_sync.js [new file with mode: 0644]
test/run_pass/test_gpio_event.js [new file with mode: 0644]
test/run_pass/test_gpio_input.js [new file with mode: 0644]
test/run_pass/test_gpio_output.js [new file with mode: 0644]
test/run_pass/test_https_get.js [new file with mode: 0644]
test/run_pass/test_https_request_response.js [new file with mode: 0644]
test/run_pass/test_https_timeout.js [new file with mode: 0644]
test/run_pass/test_i2c.js [new file with mode: 0644]
test/run_pass/test_iotjs_promise.js [new file with mode: 0644]
test/run_pass/test_module_cache.js [new file with mode: 0644]
test/run_pass/test_module_require.js [new file with mode: 0644]
test/run_pass/test_net_1.js [new file with mode: 0644]
test/run_pass/test_net_10.js [new file with mode: 0644]
test/run_pass/test_net_2.js [new file with mode: 0644]
test/run_pass/test_net_3.js [new file with mode: 0644]
test/run_pass/test_net_4.js [new file with mode: 0644]
test/run_pass/test_net_5.js [new file with mode: 0644]
test/run_pass/test_net_6.js [new file with mode: 0644]
test/run_pass/test_net_7.js [new file with mode: 0644]
test/run_pass/test_net_8.js [new file with mode: 0644]
test/run_pass/test_net_9.js [new file with mode: 0644]
test/run_pass/test_net_connect.js [new file with mode: 0644]
test/run_pass/test_net_headers.js [new file with mode: 0644]
test/run_pass/test_net_http_get.js [new file with mode: 0644]
test/run_pass/test_net_http_request_response.js [new file with mode: 0644]
test/run_pass/test_net_http_response_twice.js [new file with mode: 0644]
test/run_pass/test_net_http_status_codes.js [new file with mode: 0644]
test/run_pass/test_net_httpclient_error.js [new file with mode: 0644]
test/run_pass/test_net_httpclient_parse_error.js [new file with mode: 0644]
test/run_pass/test_net_httpclient_timeout_1.js [new file with mode: 0644]
test/run_pass/test_net_httpclient_timeout_2.js [new file with mode: 0644]
test/run_pass/test_net_httpserver.js [new file with mode: 0644]
test/run_pass/test_net_httpserver_timeout.js [new file with mode: 0644]
test/run_pass/test_process.js [new file with mode: 0644]
test/run_pass/test_process_chdir.js [new file with mode: 0644]
test/run_pass/test_process_cwd.js [new file with mode: 0644]
test/run_pass/test_process_exit.js [new file with mode: 0644]
test/run_pass/test_process_experimental_off.js [new file with mode: 0644]
test/run_pass/test_process_experimental_on.js [new file with mode: 0644]
test/run_pass/test_process_next_tick.js [new file with mode: 0644]
test/run_pass/test_process_readsource.js [new file with mode: 0644]
test/run_pass/test_process_uncaught_order.js [new file with mode: 0644]
test/run_pass/test_process_uncaught_simple.js [new file with mode: 0644]
test/run_pass/test_pwm.js [new file with mode: 0644]
test/run_pass/test_spi_buffer.js [new file with mode: 0644]
test/run_pass/test_spi_mcp3008.js [new file with mode: 0644]
test/run_pass/test_stream.js [new file with mode: 0644]
test/run_pass/test_stream_duplex.js [new file with mode: 0644]
test/run_pass/test_timers_arguments.js [new file with mode: 0644]
test/run_pass/test_timers_error.js [new file with mode: 0644]
test/run_pass/test_timers_simple.js [new file with mode: 0644]
test/run_pass/test_uart.js [new file with mode: 0644]
test/run_pass/test_util.js [new file with mode: 0644]
test/testsets.json [new file with mode: 0644]
tools/__init__.py [new file with mode: 0644]
tools/apt-get-install-arm.sh [new file with mode: 0755]
tools/apt-get-install-deps.sh [new file with mode: 0755]
tools/apt-get-install-nuttx.sh [new file with mode: 0755]
tools/apt-get-install-tizen.sh [new file with mode: 0755]
tools/apt-get-install-tizenrt.sh [new file with mode: 0755]
tools/apt-get-install-travis-i686.sh [new file with mode: 0755]
tools/brew-install-deps.sh [new file with mode: 0755]
tools/build.py [new file with mode: 0755]
tools/check_license.py [new file with mode: 0755]
tools/check_signed_off.sh [new file with mode: 0755]
tools/check_test.js [new file with mode: 0644]
tools/check_tidy.py [new file with mode: 0755]
tools/common_js/logger.js [new file with mode: 0644]
tools/common_js/module/console.js [new file with mode: 0644]
tools/common_js/option_parser.js [new file with mode: 0644]
tools/common_js/util.js [new file with mode: 0644]
tools/common_py/__init__.py [new file with mode: 0644]
tools/common_py/path.py [new file with mode: 0644]
tools/common_py/system/__init__.py [new file with mode: 0644]
tools/common_py/system/executor.py [new file with mode: 0644]
tools/common_py/system/filesystem.py [new file with mode: 0644]
tools/common_py/system/platform.py [new file with mode: 0644]
tools/js2c.py [new file with mode: 0755]
tools/measure_coverage.sh [new file with mode: 0755]
tools/measure_js_heap.py [new file with mode: 0755]
tools/mem_stats.sh [new file with mode: 0755]
tools/module_analyzer.py [new file with mode: 0644]
tools/precommit.py [new file with mode: 0755]
tools/test_runner.js [new file with mode: 0644]

diff --git a/.clang-format b/.clang-format
new file mode 100644 (file)
index 0000000..b2d9afe
--- /dev/null
@@ -0,0 +1,99 @@
+# This file is generated by below command,
+# $ clang-format-3.8 -style=google -dump-config  > .clang-format
+# then modified according to IoT.js style guide.
+---
+Language:        Cpp
+# BasedOnStyle:  Google
+AccessModifierOffset: -1
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlinesLeft: true
+AlignOperands:   true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: true
+AlwaysBreakTemplateDeclarations: true
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+  AfterClass:      false
+  AfterControlStatement: false
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  BeforeCatch:     false
+  BeforeElse:      false
+  IndentBraces:    false
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Attach
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+ColumnLimit:     80
+CommentPragmas:  '^ IWYU pragma:'
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: false
+DerivePointerAlignment: true
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+ForEachMacros:   [ ]
+IncludeCategories:
+  - Regex:           '^"(iotjs_def)'
+    Priority:        -1
+  - Regex:           '^.iotjs'
+    Priority:        1
+  - Regex:           '^.jerry'
+    Priority:        2
+  - Regex:           '^.uv'
+    Priority:        2
+  - Regex:           '^.http'
+    Priority:        2
+  - Regex:           '^(<)'
+    Priority:        3
+IndentCaseLabels: true
+IndentWidth:     2
+IndentWrappedFunctionNames: false
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 2
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: false
+PenaltyBreakBeforeFirstCallParameter: 500
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 200
+PointerAlignment: Left
+ReflowComments:  true
+SortIncludes:    true
+SpaceAfterCStyleCast: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard:        Auto
+TabWidth:        8
+UseTab:          Never
+...
+
diff --git a/.gbs.conf b/.gbs.conf
new file mode 100644 (file)
index 0000000..27429e2
--- /dev/null
+++ b/.gbs.conf
@@ -0,0 +1,4 @@
+[general]
+upstream_branch = ${upstreamversion}
+upstream_tag = ${upstreamversion}
+packaging_dir = config/tizen/packaging
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..1ab732e
--- /dev/null
@@ -0,0 +1,36 @@
+# Produced files
+
+/build
+/build/*
+/src/iotjs_js.h
+/src/iotjs_js.c
+/src/iotjs_string_ext.inl.h
+/test/tmp/*
+
+# IDE related files
+nbproject
+**.sublime-project
+**.sublime-workspace
+.idea
+
+# Random Trash
+*.swp
+*.swo
+*~
+core
+vgcore.*
+**.orig
+**.directory
+**.patch
+.tags*
+cscope.*
+*.pyc
+
+# ctags and ID database
+tags
+ID
+TAGS
+
+# config files
+*.config
+!build.config
index 4ca9d255068a46db290861e5a080873a99cc4a38..c0b8b94cf6a24b789be45e29cfd4b5081453ec32 100644 (file)
@@ -1,3 +1,9 @@
-[submodule "iotjs"]
-       path = iotjs
-       url = https://github.com/Samsung/iotjs.git
+[submodule "deps/jerry"]
+       path = deps/jerry
+       url = https://github.com/jerryscript-project/jerryscript.git
+[submodule "deps/http-parser"]
+       path = deps/http-parser
+       url = https://github.com/Samsung/http-parser.git
+[submodule "deps/libtuv"]
+       path = deps/libtuv
+       url = https://github.com/Samsung/libtuv.git
diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..0da7e7e
--- /dev/null
@@ -0,0 +1,66 @@
+language: c
+
+os: linux
+dist: trusty
+sudo: required
+
+before_install:
+  - if [[ "$INSTALL_ARM_DEPS" == "yes" ]]; then tools/apt-get-install-arm.sh; fi
+  - if [[ "$INSTALL_NUTTX_DEPS" == "yes" ]]; then tools/apt-get-install-nuttx.sh; fi
+  - if [[ "$INSTALL_TIZEN_DEPS" == "yes" ]]; then . tools/apt-get-install-tizen.sh; fi
+  - if [[ "$INSTALL_TIZENRT_DEPS" == "yes" ]]; then . tools/apt-get-install-tizenrt.sh; fi
+  - if [[ "$INSTALL_TRAVIS_I686_DEPS" == "yes" ]]; then tools/apt-get-install-travis-i686.sh; fi
+  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tools/apt-get-install-deps.sh; fi
+  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tools/brew-install-deps.sh; fi
+
+install:
+
+script: "tools/precommit.py $OPTS"
+
+env:
+  global:
+    - secure: "lUGzoKK/Yn4/OmpqLQALrIgfY9mQWE51deUawPrCO87UQ2GknfQ4BvwY3UT5QY0XnztPBP1+vRQ2qxbiAU7VWicp280sXDnh0FeuZD14FcE9l0FczraL12reoLu+gY5HWFfbkZncmcBsZkxDEYxhkM14FJU8fxyqGQW2ypJNz+gUGP+8r40Re5J3WjcddCQNe5IG8U+M9B4YeDHhN2QspLdN5pkgn56XtdGa3+qbecO2NpjJG5ltM9j1tTuo/Dg22DxrIFVfeFSFKUj4nfMrgPo5LevRsC/lfaBSCsj751eqrxRcQRh2hkpiIJ7mEBs2LL1EH9O6Mbj+eRh8BvIYqTB85VPNFc43sLWk14apcSVBrxJE5j3kP9sAsOD9Y5JynnkeuxYyISrkywwoX2uxsmCzIfGbwsv5VLToQzrqWlGYrHOAmVXNi8561dLfsWwxxFUjdqkZr1Kgc8UfnBEcBUtSiKCHS86/YUUbBJGkEkjDUS0GiqhFY4bXLQCR7EX4qDX3m6p7Mnh4NVUolpnSmyeYE/MjmqQ+7PJsPLL3EcIYmJ7dtW3mZ3yE2NyaFD0Pym9+TiuCCXRtrNVK1M3Kya64KNv+HbhjT/fTCgXLSeyDmJOKVAqugRlDo3b1KGR1LI0AfegzSA6mEC4e9JLjYiSnHPMUahzgLt8oU0hNFRY="
+  matrix:
+    - OPTS="--test=host-linux"
+    - OPTS="--test=rpi2" INSTALL_ARM_DEPS=yes
+    - OPTS="--test=nuttx" INSTALL_NUTTX_DEPS=yes
+    - OPTS="--test=artik10" INSTALL_TIZEN_DEPS=yes
+    - OPTS="--test=artik053" INSTALL_TIZENRT_DEPS=yes
+    - OPTS="--test=misc"
+
+matrix:
+  include:
+    - os: osx
+      env: OPTS="--test=host-darwin"
+    - os: linux
+      before_install:
+        - tools/apt-get-install-deps.sh
+        - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
+      addons:
+        coverity_scan:
+          project:
+            name: "Samsung/iotjs"
+            description: "Platform for Internet of Things with JavaScript"
+          notification_email: duddlf.choi@samsung.com
+          build_command: "tools/precommit.py --test=coverity"
+          branch_pattern: master
+      env: OPTS="--test=coverity"
+    - compiler: gcc-4.9
+      addons:
+        apt:
+          sources:
+            - ubuntu-toolchain-r-test
+          packages:
+            - gcc-4.9
+            - gcc-4.9-multilib
+      env: OPTS="--test=host-linux --buildtype=debug --buildoptions=--target-arch=i686,--compile-flag=-fsanitize=address,--compile-flag=-fno-omit-frame-pointer,--compile-flag=-fno-common,--compile-flag=-O2,--jerry-cmake-param=-DJERRY_LIBC=OFF,--jerry-cmake-param=-DFEATURE_SYSTEM_ALLOCATOR=ON,--no-snapshot,--no-check-valgrind" INSTALL_TRAVIS_I686_DEPS=yes ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=true:strict_init_order=true
+    - compiler: gcc-4.9
+      addons:
+        apt:
+          sources:
+            - ubuntu-toolchain-r-test
+          packages:
+            - gcc-4.9
+            - gcc-4.9-multilib
+      env: OPTS="--test=host-linux --buildtype=debug --buildoptions=--target-arch=i686,--compile-flag=-fsanitize=undefined,--compile-flag=-fno-omit-frame-pointer,--compile-flag=-fno-common,--jerry-cmake-param=-DJERRY_LIBC=OFF,--jerry-cmake-param=-DFEATURE_SYSTEM_ALLOCATOR=ON,--no-snapshot,--no-check-valgrind" INSTALL_TRAVIS_I686_DEPS=yes UBSAN_OPTIONS=print_stacktrace=1
+  fast_finish: true
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e639a82
--- /dev/null
@@ -0,0 +1,77 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+cmake_minimum_required(VERSION 2.8)
+
+project(IOTJS C)
+
+set(IOTJS_VERSION_MAJOR 0)
+set(IOTJS_VERSION_MINOR 1)
+
+# Do a few default checks
+if(NOT DEFINED PLATFORM_DESCRIPTOR)
+  message(FATAL_ERROR "No PLATFORM_DESCRIPTOR specified (format: <arch>-<os>)")
+endif()
+
+string(REPLACE "-" ";" PLATFORM_ARGS ${PLATFORM_DESCRIPTOR})
+if(NOT DEFINED TARGET_OS)
+  list(GET PLATFORM_ARGS 1 TARGET_OS)
+  message(
+    "TARGET_OS not specified, using '${TARGET_OS}' from PLATFORM_DESCRIPTOR")
+endif()
+string(TOUPPER "${TARGET_OS}" TARGET_OS)
+
+if(NOT CMAKE_BUILD_TYPE)
+  message("CMAKE_BUILD_TYPE was not set! Configuring for Debug build!")
+  set(CMAKE_BUILD_TYPE Debug)
+elseif("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
+  message("CMAKE_BUILD_TYPE was set to Release, switching to MinSizeRel")
+  set(CMAKE_BUILD_TYPE MinSizeRel)
+endif()
+
+if(NOT DEFINED BUILD_LIB_ONLY)
+  set(BUILD_LIB_ONLY OFF)
+endif()
+
+if(NOT DEFINED ENABLE_SNAPSHOT)
+  message("Snapshot mode force enabled")
+  set(ENABLE_SNAPSHOT ON)
+endif()
+
+if(NOT DEFINED ENABLE_LTO)
+  message("LTO force disabled")
+  set(ENABLE_LTO OFF)
+endif()
+
+set(ROOT_DIR ${CMAKE_SOURCE_DIR})
+
+# Common compile flags
+set(CFLAGS_COMMON
+  -Wall
+  -Wextra
+  -Werror
+  -Wno-unused-parameter
+  -Wsign-conversion
+  -std=gnu99
+)
+
+include(ExternalProject)
+
+# Include external projects
+include(cmake/jerry.cmake)
+include(cmake/http-parser.cmake)
+include(cmake/libtuv.cmake)
+
+include(cmake/iotjs.cmake)
+
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..5146304
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,218 @@
+Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+
+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.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+--------
+
+   Copyright Node.js contributors. All rights reserved.
+
+   Permission is hereby granted, free of charge, to any person obtaining a copy
+   of this software and associated documentation files (the "Software"), to
+   deal in the Software without restriction, including without limitation the
+   rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+   sell copies of the Software, and to permit persons to whom the Software is
+   furnished to do so, subject to the following conditions:
+
+   The above copyright notice and this permission notice shall be included in
+   all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+   IN THE SOFTWARE.
+
+
+   This license applies to parts of '*.js' files in '/src/js', implementing node.js 
+   compatible API, originating from the https://github.com/node/node repository:
+
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..6ac7727
--- /dev/null
+++ b/README.md
@@ -0,0 +1,78 @@
+# IoT.js: Platform for Internet of Things with JavaScript
+[![License](https://img.shields.io/badge/licence-Apache%202.0-brightgreen.svg?style=flat)](LICENSE)
+[![Build Status](https://travis-ci.org/Samsung/iotjs.svg?branch=master)](https://travis-ci.org/Samsung/iotjs)
+[![Coverity Scan Build Status](https://img.shields.io/coverity/scan/12140.svg)](https://scan.coverity.com/projects/samsung-iotjs)
+[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FSamsung%2Fiotjs.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FSamsung%2Fiotjs?ref=badge_shield)
+[![IRC Channel](https://img.shields.io/badge/chat-on%20freenode-brightgreen.svg)](https://kiwiirc.com/client/irc.freenode.net/#iotjs)
+
+You can find project details on our [project page](http://samsung.github.io/iotjs/) and [wiki](https://github.com/Samsung/iotjs/wiki).
+
+Memory usage and Binary footprint are measured at [here](https://samsung.github.io/iotjs-test-results) with real target daily.
+
+The following table shows the latest results on the devices:
+
+|  STM32F4-Discovery  | [![Remote Testrunner](https://samsung.github.io/iotjs-test-results/status/stm32f4dis.svg)](https://samsung.github.io/iotjs-test-results/) |
+|        :---:        |                                             :---:                                                                                         |
+|  **Raspberry Pi 2** | [![Remote Testrunner](https://samsung.github.io/iotjs-test-results/status/rpi2.svg)](https://samsung.github.io/iotjs-test-results/)       |
+
+IRC channel: #iotjs on [freenode](https://freenode.net)  
+Mailing list: iotjs-dev@groups.io, you can subscribe [here](https://groups.io/g/iotjs-dev) and access the mailing list archive [here](https://groups.io/g/iotjs-dev/topics).
+
+## Quick Start
+### Getting the sources
+
+```bash
+git clone https://github.com/Samsung/iotjs.git
+cd iotjs
+```
+
+### How to Build
+
+```bash
+tools/build.py
+```
+
+### How to Test
+
+```bash
+build/x86_64-linux/debug/bin/iotjs tools/check_test.js
+```
+
+
+For Additional information see [Getting Started](docs/help/Getting-Started.md).
+
+## Documentation
+- [Getting Started](docs/help/Getting-Started.md)
+- [API Reference](docs/api/IoT.js-API-reference.md)
+
+## License
+IoT.js is Open Source software under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0). Complete license and copyright information can be found within the code.
+
+[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FSamsung%2Fiotjs.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FSamsung%2Fiotjs?ref=badge_large)
+
+> Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+
+> 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.
+
+> Copyright Node.js contributors. All rights reserved.
+
+> Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to
+ deal in the Software without restriction, including without limitation the
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+> The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ IN THE SOFTWARE.
+
+> This license applies to parts of '*.js' files in '/src/js', implementing node.js
+ compatible API, originating from the https://github.com/nodejs/node repository:
diff --git a/build.config b/build.config
new file mode 100644 (file)
index 0000000..7a7271d
--- /dev/null
@@ -0,0 +1,117 @@
+{
+  "build_option" : {
+    "buildtype": "debug",
+    "buildlib": false,
+    "builddir": "",
+    "clean": false,
+    "config": "",
+    "target-arch": "",
+    "target-os": "",
+    "target-board":"",
+    "cmake-param": [],
+    "compile-flag": [],
+    "link-flag": [],
+    "external-include-dir": [],
+    "external-static-lib": [],
+    "external-shared-lib": [],
+    "jerry-cmake-param": [],
+    "jerry-compile-flag": [],
+    "jerry-link-flag": [],
+    "jerry-lto": false,
+    "jerry-heaplimit": 256,
+    "jerry-memstat": false,
+    "no-init-submodule": false,
+    "no-check-tidy": false,
+    "no-check-test": false,
+    "no-parallel-build": false,
+    "sysroot": "",
+    "no-snapshot": false
+  },
+  "compile_flags": {
+    "os": {
+      "linux": ["-D__LINUX__",
+                "-fno-builtin"],
+      "darwin": ["-D__DARWIN__",
+                 "-fno-builtin"],
+      "nuttx": ["-D__NUTTX__",
+                "-Os",
+                "-fno-strict-aliasing",
+                "-fno-strength-reduce",
+                "-fomit-frame-pointer"],
+      "tizen": ["-D__LINUX__",
+                "-fno-builtin"],
+      "tizenrt": ["-D__TIZENRT__",
+                "-Os",
+                "-fno-strict-aliasing",
+                "-fno-strength-reduce",
+                "-fomit-frame-pointer"]
+  },
+    "arch": {
+      "i686": ["-D__i686__",
+               "-D__x86__",
+               "-D__I686__",
+               "-D__X86__",
+               "-march=i686",
+               "-m32"],
+      "x86_64": ["-D__x86_64__",
+                 "-D__X86_64__"],
+      "arm": ["-D__ARM__",
+              "-D__arm__",
+              "-mthumb",
+              "-fno-short-enums",
+              "-mlittle-endian"]
+    },
+    "board": {
+      "stm32f4dis": ["-mcpu=cortex-m4",
+                     "-march=armv7e-m",
+                     "-mfpu=fpv4-sp-d16",
+                     "-mfloat-abi=hard",
+                     "-DTARGET_BOARD=STM32F4DIS"],
+      "rpi2": ["-mcpu=cortex-a7",
+               "-mfpu=neon-vfpv4",
+               "-DTARGET_BOARD=RP2"],
+      "artik05x": ["-mcpu=cortex-r4",
+                   "-mfpu=vfp3",
+                   "-DTARGET_BOARD=artik05x"],
+      "artik10": ["-mcpu=cortex-a7",
+                  "-mfpu=neon-vfpv4",
+                  "-mfloat-abi=softfp",
+                  "-DTARGET_BOARD=artik10"]
+    },
+    "buildtype": {
+      "release": [],
+      "debug": ["-DDEBUG",
+                "-DENABLE_DEBUG_LOG"]
+    }
+  },
+  "link_flags": {
+    "os": {
+      "linux": ["-pthread"],
+      "darwin": [],
+      "nuttx": [],
+      "tizen": ["-pthread"],
+      "tizenrt": []
+    }
+  },
+  "shared_libs": {
+    "os": {
+      "linux": ["m", "rt"],
+      "darwin": [],
+      "nuttx": [],
+      "tizen": ["m", "rt", "curl"],
+      "tizenrt": []
+    }
+  },
+  "module": {
+    "always": ["buffer", "console", "events", "fs", "module", "timers"],
+    "include": ["assert", "dns", "http", "net", "stream", "testdriver"],
+    "exclude": {
+      "all": [],
+      "linux": ["adc", "ble", "dgram", "gpio", "i2c", "pwm", "spi", "uart"],
+      "nuttx": ["adc", "dgram", "gpio", "i2c", "pwm", "stm32f4dis", "uart"],
+      "darwin": [],
+      "tizen": ["adc", "ble", "dgram", "gpio", "i2c", "pwm", "spi", "uart", "https"],
+      "tizenrt": []
+    }
+  }
+}
diff --git a/cmake/config/arm-linux.cmake b/cmake/config/arm-linux.cmake
new file mode 100644 (file)
index 0000000..974b541
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR armv7l)
+
+set(EXTERNAL_CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
+
+CMAKE_FORCE_C_COMPILER(${EXTERNAL_CMAKE_C_COMPILER} GNU)
diff --git a/cmake/config/arm-nuttx.cmake b/cmake/config/arm-nuttx.cmake
new file mode 100644 (file)
index 0000000..86b1595
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Nuttx)
+set(CMAKE_SYSTEM_PROCESSOR armv7l)
+
+set(EXTERNAL_CMAKE_C_COMPILER arm-none-eabi-gcc)
+
+CMAKE_FORCE_C_COMPILER(${EXTERNAL_CMAKE_C_COMPILER} GNU)
diff --git a/cmake/config/arm-tizen.cmake b/cmake/config/arm-tizen.cmake
new file mode 100644 (file)
index 0000000..18dfc60
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR armv7l)
+
diff --git a/cmake/config/arm-tizenrt.cmake b/cmake/config/arm-tizenrt.cmake
new file mode 100644 (file)
index 0000000..df25d4a
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Tizenrt)
+set(CMAKE_SYSTEM_PROCESSOR armv7l)
+
+set(EXTERNAL_CMAKE_C_COMPILER arm-none-eabi-gcc)
+
+CMAKE_FORCE_C_COMPILER(${EXTERNAL_CMAKE_C_COMPILER} GNU)
diff --git a/cmake/config/i686-linux.cmake b/cmake/config/i686-linux.cmake
new file mode 100644 (file)
index 0000000..c4c7f56
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR i686)
diff --git a/cmake/config/x86_64-darwin.cmake b/cmake/config/x86_64-darwin.cmake
new file mode 100644 (file)
index 0000000..e3c4bc4
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Darwin)
+set(CMAKE_SYSTEM_PROCESSOR x86_64)
diff --git a/cmake/config/x86_64-linux.cmake b/cmake/config/x86_64-linux.cmake
new file mode 100644 (file)
index 0000000..79cf370
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR x86_64)
diff --git a/cmake/http-parser.cmake b/cmake/http-parser.cmake
new file mode 100644 (file)
index 0000000..07f5671
--- /dev/null
@@ -0,0 +1,46 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+cmake_minimum_required(VERSION 2.8)
+
+if("${TARGET_OS}" MATCHES "NUTTX|TIZENRT")
+  set(HTTPPARSER_NUTTX_ARG -DNUTTX_HOME=${TARGET_SYSTEMROOT})
+endif()
+
+set(DEPS_HTTPPARSER deps/http-parser)
+set(DEPS_HTTPPARSER_SRC ${ROOT_DIR}/${DEPS_HTTPPARSER}/)
+ExternalProject_Add(http-parser
+  PREFIX ${DEPS_HTTPPARSER}
+  SOURCE_DIR ${DEPS_HTTPPARSER_SRC}
+  BUILD_IN_SOURCE 0
+  BINARY_DIR ${DEPS_HTTPPARSER}
+  INSTALL_COMMAND
+    ${CMAKE_COMMAND} -E copy
+    ${CMAKE_BINARY_DIR}/${DEPS_HTTPPARSER}/libhttpparser.a
+    ${CMAKE_BINARY_DIR}/lib/
+  CMAKE_ARGS
+    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+    -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+    -DOS=${TARGET_OS}
+    ${HTTPPARSER_NUTTX_ARG}
+)
+add_library(libhttp-parser STATIC IMPORTED)
+add_dependencies(libhttp-parser http-parser)
+set_property(TARGET libhttp-parser PROPERTY
+  IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libhttpparser.a)
+set_property(DIRECTORY APPEND PROPERTY
+  ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_BINARY_DIR}/lib/libhttpparser.a)
+
+set(HTTPPARSER_INCLUDE_DIR ${DEPS_HTTPPARSER_SRC})
diff --git a/cmake/iotjs.cmake b/cmake/iotjs.cmake
new file mode 100644 (file)
index 0000000..9e59905
--- /dev/null
@@ -0,0 +1,278 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+cmake_minimum_required(VERSION 2.8)
+
+set(IOTJS_SOURCE_DIR ${ROOT_DIR}/src)
+
+function(find_value RESULT VALUE VALUE_TRUE VALUE_FALSE)
+  list(FIND ARGN ${VALUE} idx)
+  if(${idx} GREATER -1)
+    set(${RESULT} ${VALUE_TRUE} PARENT_SCOPE)
+  else()
+    set(${RESULT} ${VALUE_FALSE} PARENT_SCOPE)
+  endif()
+endfunction(find_value)
+
+# System Configuration (not module)
+string(TOLOWER ${CMAKE_SYSTEM_NAME} IOTJS_SYSTEM_OS)
+set(PLATFORM_OS_DIR
+    ${IOTJS_SOURCE_DIR}/platform/${IOTJS_SYSTEM_OS})
+file(GLOB IOTJS_PLATFORM_SRC ${PLATFORM_OS_DIR}/iotjs_*.c)
+file(GLOB PLATFORM_MODULE_SRC ${PLATFORM_OS_DIR}/iotjs_module_*.c)
+if (IOTJS_PLATFORM_SRC AND PLATFORM_MODULE_SRC)
+  list(REMOVE_ITEM IOTJS_PLATFORM_SRC ${PLATFORM_MODULE_SRC})
+endif()
+
+# Board Configuration (not module)
+if(NOT "${TARGET_BOARD}" STREQUAL "None")
+  set(PLATFORM_BOARD_DIR
+      ${PLATFORM_OS_DIR}/${TARGET_BOARD})
+  file(GLOB IOTJS_BOARD_SRC ${PLATFORM_BOARD_DIR}/iotjs_*.c)
+  file(GLOB PLATFORM_MODULE_SRC ${PLATFORM_BOARD_DIR}/iotjs_module_*.c)
+  if (IOTJS_BOARD_SRC AND PLATFORM_MODULE_SRC)
+    list(REMOVE_ITEM IOTJS_BOARD_SRC ${PLATFORM_MODULE_SRC})
+  endif()
+  list(APPEND IOTJS_PLATFORM_SRC ${IOTJS_BOARD_SRC})
+endif()
+
+# Run js/native module analyzer
+if(ENABLE_MINIMAL)
+    set(MODULE_ANALYZER_ARGS --iotjs-minimal-profile)
+endif()
+
+execute_process(
+  COMMAND python ${ROOT_DIR}/tools/module_analyzer.py
+          --mode cmake-dump
+          --target-os ${TARGET_OS}
+          --iotjs-include-module "${IOTJS_INCLUDE_MODULE}"
+          --iotjs-exclude-module "${IOTJS_EXCLUDE_MODULE}"
+          ${MODULE_ANALYZER_ARGS}
+  RESULT_VARIABLE MODULE_ANALYZER_RETURN_CODE
+  ERROR_VARIABLE MODULE_ANALYZER_OUTPUT_ERR
+  OUTPUT_VARIABLE MODULE_ANALYZER_OUTPUT
+)
+
+if(MODULE_ANALYZER_RETURN_CODE)
+  message(FATAL_ERROR
+    "Error during module analyzer execution (${MODULE_ANALYZER_RETURN_CODE}): "
+    "${MODULE_ANALYZER_OUTPUT}"
+    "${MODULE_ANALYZER_OUTPUT_ERR}")
+endif()
+
+if(VERBOSE)
+  message("Module analyzer:\n${MODULE_ANALYZER_OUTPUT}")
+endif()
+
+function(get_variable_value OUTPUT_VAR VAR_NAME STRING_DATA)
+  string(REGEX MATCHALL "${VAR_NAME}=[a-zA-Z;_0-9-]+" LINE "${STRING_DATA}")
+  string(REPLACE "${VAR_NAME}=" "" VAR_VALUE "${LINE}")
+  string(STRIP "${VAR_VALUE}" VAR_VALUE)
+  separate_arguments(VAR_VALUE)
+  set(${OUTPUT_VAR} ${VAR_VALUE} PARENT_SCOPE)
+endfunction(get_variable_value)
+
+get_variable_value(IOTJS_NATIVE_MODULES
+  "IOTJS_NATIVE_MODULES" "${MODULE_ANALYZER_OUTPUT}")
+get_variable_value(IOTJS_JS_MODULES
+  "IOTJS_JS_MODULES" "${MODULE_ANALYZER_OUTPUT}")
+
+# Run js2c
+set(JS2C_RUN_MODE "release")
+if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+  set(JS2C_RUN_MODE "debug")
+endif()
+
+if(ENABLE_SNAPSHOT)
+  set(JS2C_SNAPSHOT_ARG --snapshot-generator=${JERRY_HOST})
+  set(IOTJS_CFLAGS ${IOTJS_CFLAGS} -DENABLE_SNAPSHOT)
+endif()
+
+add_custom_command(
+  OUTPUT ${IOTJS_SOURCE_DIR}/iotjs_js.c ${IOTJS_SOURCE_DIR}/iotjs_js.h
+  COMMAND python ${ROOT_DIR}/tools/js2c.py
+  ARGS --buildtype=${JS2C_RUN_MODE}
+       --modules '${IOTJS_JS_MODULES}'
+       ${JS2C_SNAPSHOT_ARG}
+  DEPENDS ${ROOT_DIR}/tools/js2c.py
+          jerry
+          ${IOTJS_SOURCE_DIR}/js/*.js
+)
+
+# Module Configuration - listup all possible native C modules
+set(IOTJS_MODULES_ENABLED)
+set(IOTJS_MODULES_DISABLED)
+# List all modules and mark them as disabled by default
+file(GLOB IOTJS_MODULES_ALL_SRC ${IOTJS_SOURCE_DIR}/modules/*.c)
+foreach(module ${IOTJS_MODULES_ALL_SRC})
+  ## iotjs_module_adc.c -> ADC
+  get_filename_component(IOTJS_MODULENAME ${module} NAME_WE)
+  string(SUBSTRING ${IOTJS_MODULENAME} 13 -1 IOTJS_MODULENAME)
+  string(TOUPPER ${IOTJS_MODULENAME} IOTJS_MODULENAME)
+  list(APPEND IOTJS_MODULES_DISABLED ${IOTJS_MODULENAME})
+endforeach()
+
+# Module Configuration - enable only selected modules and add board support
+set(IOTJS_PLATFORM_SUPPORT)
+set(IOTJS_BOARD_SUPPORT)
+set(IOTJS_MODULES_SRC)
+set(PLATFORM_SRC
+  ${IOTJS_SOURCE_DIR}/platform/${PLATFORM_DESCRIPTOR}/iotjs_module)
+foreach(module ${IOTJS_NATIVE_MODULES})
+  string(TOUPPER ${module} MODULE)
+  # check if there is a native file for the module
+  set(BASE_MODULE_SRC ${IOTJS_SOURCE_DIR}/modules/iotjs_module_${module}.c)
+  if(EXISTS "${BASE_MODULE_SRC}")
+    list(APPEND IOTJS_MODULE_SRC ${BASE_MODULE_SRC})
+  endif()
+
+  # first, check if there is the module in <os>/<board>
+  set(ADD_MODULE_RESULT FALSE)
+  if(NOT "${TARGET_BOARD}" STREQUAL "None")
+    set(PLATFORM_MODULE_SRC ${PLATFORM_BOARD_DIR}/iotjs_module_${module})
+    set(PLATFORM_MODULE_SRC
+        ${PLATFORM_MODULE_SRC}-${IOTJS_SYSTEM_OS}-${TARGET_BOARD}.c)
+    if(EXISTS "${PLATFORM_MODULE_SRC}")
+      list(APPEND IOTJS_MODULE_SRC ${PLATFORM_MODULE_SRC})
+      list(APPEND IOTJS_BOARD_SUPPORT ${MODULE})
+      set(${ADD_MODULE_RESULT} TRUE)
+    else()
+      set(${ADD_MODULE_RESULT} FALSE)
+    endif()
+  endif()
+
+  # if the module is not in <os>/<board>, look in <os>
+  if(NOT ${ADD_MODULE_RESULT})
+    set(PLATFORM_MODULE_SRC
+        ${PLATFORM_OS_DIR}/iotjs_module_${module}-${IOTJS_SYSTEM_OS}.c)
+    if(EXISTS "${PLATFORM_MODULE_SRC}")
+      list(APPEND IOTJS_MODULE_SRC ${PLATFORM_MODULE_SRC})
+      list(APPEND IOTJS_PLATFORM_SUPPORT ${MODULE})
+    endif()
+  endif()
+
+  list(APPEND IOTJS_MODULES_ENABLED ${MODULE})
+  list(REMOVE_ITEM IOTJS_MODULES_DISABLED ${MODULE})
+endforeach()
+# Build the module enable defines and print out the module configurations
+message("Native module configuration:")
+set(IOTJS_MODULES_ALL ${IOTJS_MODULES_ENABLED} ${IOTJS_MODULES_DISABLED})
+list(SORT IOTJS_MODULES_ALL)
+foreach(module ${IOTJS_MODULES_ALL})
+  find_value(MODULE_ENABLED "${module}" 1 0 ${IOTJS_MODULES_ENABLED})
+  list(APPEND IOTJS_CFLAGS "-DENABLE_MODULE_${module}=${MODULE_ENABLED}")
+
+  if(MODULE_ENABLED)
+    find_value(PLATFORM_SUPPORT "${module}" "found" "NOT found"
+               ${IOTJS_PLATFORM_SUPPORT})
+    if(DEFINED TARGET_BOARD)
+      find_value(BOARD_SUPPORT "${module}" "found" "NOT found"
+        ${IOTJS_BOARD_SUPPORT})
+      set(BOARD_SUPPORT_STR "[Board support: ${BOARD_SUPPORT}]")
+    else()
+      set(BOARD_SUPPORT_STR "")
+    endif()
+
+    message(STATUS "${module}: ON "
+            "[Platform support: ${PLATFORM_SUPPORT}]"
+            "${BOARD_SUPPORT_STR}")
+  else()
+    message(STATUS "${module}: OFF")
+  endif()
+endforeach()
+
+# List the enabled js modules
+message("Enabled JS modules:")
+foreach(module ${IOTJS_JS_MODULES})
+  message(STATUS "${module}")
+endforeach()
+
+# Print out some configs
+message("IoT.js configured with:")
+message(STATUS "CMAKE_BUILD_TYPE         ${CMAKE_BUILD_TYPE}")
+message(STATUS "CMAKE_C_FLAGS            ${CMAKE_C_FLAGS}")
+message(STATUS "PLATFORM_DESCRIPTOR      ${PLATFORM_DESCRIPTOR}")
+message(STATUS "TARGET_OS                ${TARGET_OS}")
+message(STATUS "TARGET_SYSTEMROOT        ${TARGET_SYSTEMROOT}")
+message(STATUS "TARGET_BOARD             ${TARGET_BOARD}")
+message(STATUS "BUILD_LIB_ONLY           ${BUILD_LIB_ONLY}")
+message(STATUS "ENABLE_LTO               ${ENABLE_LTO}")
+message(STATUS "ENABLE_SNAPSHOT          ${ENABLE_SNAPSHOT}")
+message(STATUS "ENABLE_MINIMAL           ${ENABLE_MINIMAL}")
+message(STATUS "IOTJS_INCLUDE_MODULE     ${IOTJS_INCLUDE_MODULE}")
+message(STATUS "IOTJS_EXCLUDE_MODULE     ${IOTJS_EXCLUDE_MODULE}")
+message(STATUS "IOTJS_C_FLAGS            ${IOTJS_C_FLAGS}")
+message(STATUS "IOTJS_LINK_FLAGS         ${IOTJS_LINK_FLAGS}")
+
+# Collect all sources into LIB_IOTJS_SRC
+file(GLOB LIB_IOTJS_SRC ${IOTJS_SOURCE_DIR}/*.c)
+list(APPEND LIB_IOTJS_SRC
+  ${IOTJS_SOURCE_DIR}/iotjs_js.c
+  ${IOTJS_SOURCE_DIR}/iotjs_js.h
+  ${IOTJS_MODULE_SRC}
+  ${IOTJS_PLATFORM_SRC}
+)
+
+separate_arguments(EXTERNAL_INCLUDE_DIR)
+separate_arguments(EXTERNAL_STATIC_LIB)
+separate_arguments(EXTERNAL_SHARED_LIB)
+
+set(IOTJS_INCLUDE_DIRS
+  ${EXTERNAL_INCLUDE_DIR}
+  ${ROOT_DIR}/include
+  ${IOTJS_SOURCE_DIR}
+  ${JERRY_PORT_DIR}/include
+  ${JERRY_INCLUDE_DIR}
+  ${HTTPPARSER_INCLUDE_DIR}
+  ${TUV_INCLUDE_DIR}
+)
+
+set(IOTJS_CFLAGS ${IOTJS_CFLAGS} ${CFLAGS_COMMON})
+
+# Configure the libiotjs.a
+set(TARGET_LIB_IOTJS libiotjs)
+add_library(${TARGET_LIB_IOTJS} STATIC ${LIB_IOTJS_SRC})
+set_target_properties(${TARGET_LIB_IOTJS} PROPERTIES
+  COMPILE_OPTIONS "${IOTJS_CFLAGS}"
+  OUTPUT_NAME iotjs
+  ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
+)
+target_include_directories(${TARGET_LIB_IOTJS} PRIVATE ${IOTJS_INCLUDE_DIRS})
+target_link_libraries(${TARGET_LIB_IOTJS}
+  ${JERRY_LIBS}
+  ${TUV_LIBS}
+  libhttp-parser
+  ${EXTERNAL_STATIC_LIB}
+  ${EXTERNAL_SHARED_LIB}
+)
+
+if(NOT BUILD_LIB_ONLY)
+
+  if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
+    set(IOTJS_LINK_FLAGS "-Xlinker -map -Xlinker iotjs.map")
+  else()
+    set(IOTJS_LINK_FLAGS "-Xlinker -Map -Xlinker iotjs.map")
+  endif()
+
+  # Configure the iotjs executable
+  set(TARGET_IOTJS iotjs)
+  add_executable(${TARGET_IOTJS} ${ROOT_DIR}/iotjs_linux.c)
+  set_target_properties(${TARGET_IOTJS} PROPERTIES
+    COMPILE_OPTIONS "${IOTJS_CFLAGS}"
+    LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${IOTJS_LINK_FLAGS}"
+    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
+  )
+  target_include_directories(${TARGET_IOTJS} PRIVATE ${IOTJS_INCLUDE_DIRS})
+  target_link_libraries(${TARGET_IOTJS} ${TARGET_LIB_IOTJS})
+endif()
diff --git a/cmake/jerry.cmake b/cmake/jerry.cmake
new file mode 100644 (file)
index 0000000..ee7d9ec
--- /dev/null
@@ -0,0 +1,167 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+cmake_minimum_required(VERSION 2.8)
+
+# Host jerry for snapshot generation
+set(DEPS_HOST_JERRY deps/jerry-host)
+ExternalProject_Add(hostjerry
+  PREFIX ${DEPS_HOST_JERRY}
+  SOURCE_DIR ${ROOT_DIR}/deps/jerry/
+  BUILD_IN_SOURCE 0
+  BINARY_DIR ${DEPS_HOST_JERRY}
+  INSTALL_COMMAND ""
+  CMAKE_ARGS
+    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+    -DJERRY_LIBC=OFF
+    -DJERRY_CMDLINE=ON
+    -DJERRY_CMDLINE_MINIMAL=OFF
+    -DFEATURE_SNAPSHOT_SAVE=${ENABLE_SNAPSHOT}
+    -DFEATURE_PROFILE=es5.1
+)
+add_executable(jerry IMPORTED)
+add_dependencies(jerry hostjerry)
+set_property(TARGET jerry PROPERTY
+  IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/${DEPS_HOST_JERRY}/bin/jerry)
+set(JERRY_HOST ${CMAKE_BINARY_DIR}/${DEPS_HOST_JERRY}/bin/jerry)
+
+# Utility method to add -D<KEY>=<KEY_Value>
+macro(add_cmake_arg TARGET_ARG KEY)
+  if(${KEY})
+    list(APPEND ${TARGET_ARG} -D${KEY}=${${KEY}})
+  endif()
+endmacro(add_cmake_arg)
+
+# Target libjerry
+set(JERRY_LIBS jerry-core jerry-port-default)
+set(DEPS_LIB_JERRY_ARGS)
+
+# Configure the MinSizeRel as the default build type
+# for target jerry in release mode.
+if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
+  set(JERRY_CMAKE_BUILD_TYPE MinSizeRel)
+else()
+  set(JERRY_CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE})
+endif()
+
+
+# use system libc/libm on Unix like targets
+if("${TARGET_OS}" MATCHES "TIZENRT|NUTTX")
+  list(APPEND JERRY_LIBS jerry-libm)
+  list(APPEND DEPS_LIB_JERRY_ARGS
+    -DJERRY_LIBC=OFF
+    -DJERRY_LIBM=ON
+    -DEXTERNAL_LIBC_INTERFACE=${EXTERNAL_LIBC_INTERFACE}
+    -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=${EXTERNAL_CMAKE_SYSTEM_PROCESSOR}
+  )
+elseif("${TARGET_OS}" MATCHES "LINUX|TIZEN|DARWIN")
+  list(APPEND JERRY_LIBS m)
+  list(APPEND DEPS_LIB_JERRY_ARGS
+    -DJERRY_LIBC=OFF
+    -DJERRY_LIBM=OFF)
+else()
+  list(APPEND JERRY_LIBS jerry-libm jerry-libc)
+  list(APPEND DEPS_LIB_JERRY_ARGS
+    -DEXTERNAL_LIBC_INTERFACE=${EXTERNAL_LIBC_INTERFACE}
+    -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=${EXTERNAL_CMAKE_SYSTEM_PROCESSOR}
+  )
+endif()
+
+# Add a few cmake options based on buildtype/external cmake defines
+if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+  list(APPEND DEPS_LIB_JERRY_ARGS -DFEATURE_ERROR_MESSAGES=ON)
+endif()
+
+# NuttX is not using the default port implementation of JerryScript
+if("${TARGET_OS}" MATCHES "NUTTX")
+  list(APPEND DEPS_LIB_JERRY_ARGS -DJERRY_PORT_DEFAULT=OFF)
+else()
+  list(APPEND DEPS_LIB_JERRY_ARGS -DJERRY_PORT_DEFAULT=ON)
+endif()
+
+add_cmake_arg(DEPS_LIB_JERRY_ARGS ENABLE_LTO)
+add_cmake_arg(DEPS_LIB_JERRY_ARGS FEATURE_MEM_STATS)
+add_cmake_arg(DEPS_LIB_JERRY_ARGS FEATURE_ERROR_MESSAGES)
+add_cmake_arg(DEPS_LIB_JERRY_ARGS FEATURE_DEBUGGER)
+add_cmake_arg(DEPS_LIB_JERRY_ARGS FEATURE_DEBUGGER_PORT)
+add_cmake_arg(DEPS_LIB_JERRY_ARGS MEM_HEAP_SIZE_KB)
+add_cmake_arg(DEPS_LIB_JERRY_ARGS JERRY_HEAP_SECTION_ATTR)
+
+separate_arguments(EXTRA_JERRY_CMAKE_PARAMS)
+set(DEPS_LIB_JERRY deps/jerry)
+set(DEPS_LIB_JERRY_SRC ${ROOT_DIR}/${DEPS_LIB_JERRY})
+ExternalProject_Add(libjerry
+  PREFIX ${DEPS_LIB_JERRY}
+  SOURCE_DIR ${ROOT_DIR}/deps/jerry/
+  BUILD_IN_SOURCE 0
+  BINARY_DIR ${DEPS_LIB_JERRY}
+  INSTALL_COMMAND
+    ${CMAKE_COMMAND} -E copy_directory
+    ${CMAKE_BINARY_DIR}/${DEPS_LIB_JERRY}/lib/
+    ${CMAKE_BINARY_DIR}/lib/
+  CMAKE_ARGS
+    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+    -DCMAKE_BUILD_TYPE=${JERRY_CMAKE_BUILD_TYPE}
+    -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+    -DJERRY_CMDLINE=OFF
+    -DJERRY_CMDLINE_MINIMAL=OFF
+    -DFEATURE_SNAPSHOT_EXEC=${ENABLE_SNAPSHOT}
+    -DFEATURE_SNAPSHOT_SAVE=OFF
+    -DFEATURE_PROFILE=${FEATURE_PROFILE}
+    -DENABLE_LTO=${ENABLE_LTO}
+    ${DEPS_LIB_JERRY_ARGS}
+    ${EXTRA_JERRY_CMAKE_PARAMS}
+)
+
+set_property(DIRECTORY APPEND PROPERTY
+  ADDITIONAL_MAKE_CLEAN_FILES
+    ${CMAKE_BINARY_DIR}/lib/libjerry-core.a
+    ${CMAKE_BINARY_DIR}/lib/libjerry-libm.a
+    ${CMAKE_BINARY_DIR}/lib/libjerry-libc.a
+)
+
+# define external jerry-core target
+add_library(jerry-core STATIC IMPORTED)
+add_dependencies(jerry-core libjerry)
+set_property(TARGET jerry-core PROPERTY
+  IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libjerry-core.a)
+
+# define external jerry-libc target
+add_library(jerry-libc STATIC IMPORTED)
+add_dependencies(jerry-libc libjerry)
+set_property(TARGET jerry-libc PROPERTY
+  IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libjerry-libc.a)
+
+# define external jerry-libm target
+add_library(jerry-libm STATIC IMPORTED)
+add_dependencies(jerry-libm libjerry)
+set_property(TARGET jerry-libm PROPERTY
+  IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libjerry-libm.a)
+
+if(NOT "${TARGET_OS}" MATCHES "NUTTX")
+  set_property(DIRECTORY APPEND PROPERTY
+    ADDITIONAL_MAKE_CLEAN_FILES
+      ${CMAKE_BINARY_DIR}/lib/libjerry-port.a
+  )
+
+  # define external jerry-port-default target
+  add_library(jerry-port-default STATIC IMPORTED)
+  add_dependencies(jerry-port-default libjerry)
+  set_property(TARGET jerry-port-default PROPERTY
+    IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libjerry-port-default.a)
+
+  set(JERRY_PORT_DIR ${DEPS_LIB_JERRY_SRC}/jerry-port/default)
+endif()
+
+set(JERRY_INCLUDE_DIR ${DEPS_LIB_JERRY}/jerry-core/include)
diff --git a/cmake/libtuv.cmake b/cmake/libtuv.cmake
new file mode 100644 (file)
index 0000000..40eb22a
--- /dev/null
@@ -0,0 +1,55 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+cmake_minimum_required(VERSION 2.8)
+
+# Configure external libtuv
+set(DEPS_TUV deps/libtuv)
+set(DEPS_TUV_SRC ${ROOT_DIR}/${DEPS_TUV})
+
+set(DEPS_TUV_TOOLCHAIN
+  ${DEPS_TUV_SRC}/cmake/config/config_${PLATFORM_DESCRIPTOR}.cmake)
+message(STATUS "libtuv toolchain file: ${DEPS_TUV_TOOLCHAIN}")
+ExternalProject_Add(libtuv
+  PREFIX ${DEPS_TUV}
+  SOURCE_DIR ${DEPS_TUV_SRC}
+  BUILD_IN_SOURCE 0
+  BINARY_DIR ${DEPS_TUV}
+  INSTALL_COMMAND
+    ${CMAKE_COMMAND} -E copy
+    ${CMAKE_BINARY_DIR}/${DEPS_TUV}/lib/libtuv.a
+    ${CMAKE_BINARY_DIR}/lib/
+  CMAKE_ARGS
+    -DCMAKE_TOOLCHAIN_FILE=${DEPS_TUV_TOOLCHAIN}
+    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+    -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+    -DTARGET_PLATFORM=${PLATFORM_DESCRIPTOR}
+    -DLIBTUV_CUSTOM_LIB_OUT=lib
+    -DBUILDTESTER=NO
+    -DBUILDAPIEMULTESTER=NO
+    -DTARGET_SYSTEMROOT=${TARGET_SYSTEMROOT}
+    -DTARGET_BOARD=${TARGET_BOARD}
+)
+add_library(tuv STATIC IMPORTED)
+add_dependencies(tuv libtuv)
+set_property(TARGET tuv PROPERTY
+  IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libtuv.a)
+set_property(DIRECTORY APPEND PROPERTY
+  ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_BINARY_DIR}/lib/libtuv.a)
+set(TUV_INCLUDE_DIR ${DEPS_TUV_SRC}/include)
+set(TUV_LIBS tuv)
+
+if("${TARGET_OS}" STREQUAL "LINUX")
+  list(APPEND TUV_LIBS pthread)
+endif()
diff --git a/config/nuttx/stm32f4dis/.config.default b/config/nuttx/stm32f4dis/.config.default
new file mode 100644 (file)
index 0000000..7aaddc0
--- /dev/null
@@ -0,0 +1,1471 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Nuttx/ Configuration
+#
+
+#
+# Build Setup
+#
+# CONFIG_EXPERIMENTAL is not set
+# CONFIG_DEFAULT_SMALL is not set
+CONFIG_HOST_LINUX=y
+# CONFIG_HOST_OSX is not set
+# CONFIG_HOST_WINDOWS is not set
+# CONFIG_HOST_OTHER is not set
+
+#
+# Build Configuration
+#
+CONFIG_APPS_DIR="../apps"
+CONFIG_BUILD_FLAT=y
+# CONFIG_BUILD_2PASS is not set
+
+#
+# Binary Output Formats
+#
+# CONFIG_RRLOAD_BINARY is not set
+CONFIG_INTELHEX_BINARY=y
+# CONFIG_MOTOROLA_SREC is not set
+CONFIG_RAW_BINARY=y
+# CONFIG_UBOOT_UIMAGE is not set
+
+#
+# Customize Header Files
+#
+# CONFIG_ARCH_STDINT_H is not set
+# CONFIG_ARCH_STDBOOL_H is not set
+# CONFIG_ARCH_MATH_H is not set
+# CONFIG_ARCH_FLOAT_H is not set
+# CONFIG_ARCH_STDARG_H is not set
+# CONFIG_ARCH_DEBUG_H is not set
+
+#
+# Debug Options
+#
+CONFIG_DEBUG_ALERT=y
+# CONFIG_DEBUG_FEATURES is not set
+CONFIG_ARCH_HAVE_STACKCHECK=y
+# CONFIG_STACK_COLORATION is not set
+CONFIG_ARCH_HAVE_HEAPCHECK=y
+# CONFIG_HEAP_COLORATION is not set
+# CONFIG_DEBUG_SYMBOLS is not set
+CONFIG_ARCH_HAVE_CUSTOMOPT=y
+# CONFIG_DEBUG_NOOPT is not set
+# CONFIG_DEBUG_CUSTOMOPT is not set
+CONFIG_DEBUG_FULLOPT=y
+
+#
+# System Type
+#
+CONFIG_ARCH_ARM=y
+# CONFIG_ARCH_AVR is not set
+# CONFIG_ARCH_HC is not set
+# CONFIG_ARCH_MIPS is not set
+# CONFIG_ARCH_RGMP is not set
+# CONFIG_ARCH_RENESAS is not set
+# CONFIG_ARCH_SIM is not set
+# CONFIG_ARCH_X86 is not set
+# CONFIG_ARCH_Z16 is not set
+# CONFIG_ARCH_Z80 is not set
+CONFIG_ARCH="arm"
+
+#
+# ARM Options
+#
+# CONFIG_ARCH_CHIP_A1X is not set
+# CONFIG_ARCH_CHIP_C5471 is not set
+# CONFIG_ARCH_CHIP_CALYPSO is not set
+# CONFIG_ARCH_CHIP_DM320 is not set
+# CONFIG_ARCH_CHIP_EFM32 is not set
+# CONFIG_ARCH_CHIP_IMX1 is not set
+# CONFIG_ARCH_CHIP_IMX6 is not set
+# CONFIG_ARCH_CHIP_KINETIS is not set
+# CONFIG_ARCH_CHIP_KL is not set
+# CONFIG_ARCH_CHIP_LM is not set
+# CONFIG_ARCH_CHIP_TIVA is not set
+# CONFIG_ARCH_CHIP_LPC11XX is not set
+# CONFIG_ARCH_CHIP_LPC17XX is not set
+# CONFIG_ARCH_CHIP_LPC214X is not set
+# CONFIG_ARCH_CHIP_LPC2378 is not set
+# CONFIG_ARCH_CHIP_LPC31XX is not set
+# CONFIG_ARCH_CHIP_LPC43XX is not set
+# CONFIG_ARCH_CHIP_NUC1XX is not set
+# CONFIG_ARCH_CHIP_SAMA5 is not set
+# CONFIG_ARCH_CHIP_SAMD is not set
+# CONFIG_ARCH_CHIP_SAML is not set
+# CONFIG_ARCH_CHIP_SAM34 is not set
+# CONFIG_ARCH_CHIP_SAMV7 is not set
+CONFIG_ARCH_CHIP_STM32=y
+# CONFIG_ARCH_CHIP_STM32F7 is not set
+# CONFIG_ARCH_CHIP_STM32L4 is not set
+# CONFIG_ARCH_CHIP_STR71X is not set
+# CONFIG_ARCH_CHIP_TMS570 is not set
+# CONFIG_ARCH_CHIP_MOXART is not set
+# CONFIG_ARCH_ARM7TDMI is not set
+# CONFIG_ARCH_ARM926EJS is not set
+# CONFIG_ARCH_ARM920T is not set
+# CONFIG_ARCH_CORTEXM0 is not set
+# CONFIG_ARCH_CORTEXM3 is not set
+CONFIG_ARCH_CORTEXM4=y
+# CONFIG_ARCH_CORTEXM7 is not set
+# CONFIG_ARCH_CORTEXA5 is not set
+# CONFIG_ARCH_CORTEXA8 is not set
+# CONFIG_ARCH_CORTEXA9 is not set
+# CONFIG_ARCH_CORTEXR4 is not set
+# CONFIG_ARCH_CORTEXR4F is not set
+# CONFIG_ARCH_CORTEXR5 is not set
+# CONFIG_ARCH_CORTEX5F is not set
+# CONFIG_ARCH_CORTEXR7 is not set
+# CONFIG_ARCH_CORTEXR7F is not set
+CONFIG_ARCH_FAMILY="armv7-m"
+CONFIG_ARCH_CHIP="stm32"
+# CONFIG_ARM_TOOLCHAIN_IAR is not set
+CONFIG_ARM_TOOLCHAIN_GNU=y
+# CONFIG_ARMV7M_USEBASEPRI is not set
+CONFIG_ARCH_HAVE_CMNVECTOR=y
+# CONFIG_ARMV7M_CMNVECTOR is not set
+# CONFIG_ARMV7M_LAZYFPU is not set
+CONFIG_ARCH_HAVE_FPU=y
+# CONFIG_ARCH_HAVE_DPFPU is not set
+CONFIG_ARCH_FPU=y
+# CONFIG_ARCH_HAVE_TRUSTZONE is not set
+CONFIG_ARM_HAVE_MPU_UNIFIED=y
+# CONFIG_ARM_MPU is not set
+
+#
+# ARMV7M Configuration Options
+#
+# CONFIG_ARMV7M_HAVE_ICACHE is not set
+# CONFIG_ARMV7M_HAVE_DCACHE is not set
+# CONFIG_ARMV7M_HAVE_ITCM is not set
+# CONFIG_ARMV7M_HAVE_DTCM is not set
+# CONFIG_ARMV7M_TOOLCHAIN_IARL is not set
+# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set
+# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set
+# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set
+CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y
+CONFIG_ARMV7M_HAVE_STACKCHECK=y
+# CONFIG_ARMV7M_STACKCHECK is not set
+# CONFIG_ARMV7M_ITMSYSLOG is not set
+# CONFIG_SERIAL_TERMIOS is not set
+# CONFIG_SDIO_DMA is not set
+# CONFIG_SDIO_WIDTH_D1_ONLY is not set
+
+#
+# STM32 Configuration Options
+#
+# CONFIG_ARCH_CHIP_STM32L151C6 is not set
+# CONFIG_ARCH_CHIP_STM32L151C8 is not set
+# CONFIG_ARCH_CHIP_STM32L151CB is not set
+# CONFIG_ARCH_CHIP_STM32L151R6 is not set
+# CONFIG_ARCH_CHIP_STM32L151R8 is not set
+# CONFIG_ARCH_CHIP_STM32L151RB is not set
+# CONFIG_ARCH_CHIP_STM32L151V6 is not set
+# CONFIG_ARCH_CHIP_STM32L151V8 is not set
+# CONFIG_ARCH_CHIP_STM32L151VB is not set
+# CONFIG_ARCH_CHIP_STM32L152C6 is not set
+# CONFIG_ARCH_CHIP_STM32L152C8 is not set
+# CONFIG_ARCH_CHIP_STM32L152CB is not set
+# CONFIG_ARCH_CHIP_STM32L152R6 is not set
+# CONFIG_ARCH_CHIP_STM32L152R8 is not set
+# CONFIG_ARCH_CHIP_STM32L152RB is not set
+# CONFIG_ARCH_CHIP_STM32L152V6 is not set
+# CONFIG_ARCH_CHIP_STM32L152V8 is not set
+# CONFIG_ARCH_CHIP_STM32L152VB is not set
+# CONFIG_ARCH_CHIP_STM32L162ZD is not set
+# CONFIG_ARCH_CHIP_STM32L162VE is not set
+# CONFIG_ARCH_CHIP_STM32F100C8 is not set
+# CONFIG_ARCH_CHIP_STM32F100CB is not set
+# CONFIG_ARCH_CHIP_STM32F100R8 is not set
+# CONFIG_ARCH_CHIP_STM32F100RB is not set
+# CONFIG_ARCH_CHIP_STM32F100RC is not set
+# CONFIG_ARCH_CHIP_STM32F100RD is not set
+# CONFIG_ARCH_CHIP_STM32F100RE is not set
+# CONFIG_ARCH_CHIP_STM32F100V8 is not set
+# CONFIG_ARCH_CHIP_STM32F100VB is not set
+# CONFIG_ARCH_CHIP_STM32F100VC is not set
+# CONFIG_ARCH_CHIP_STM32F100VD is not set
+# CONFIG_ARCH_CHIP_STM32F100VE is not set
+# CONFIG_ARCH_CHIP_STM32F102CB is not set
+# CONFIG_ARCH_CHIP_STM32F103T8 is not set
+# CONFIG_ARCH_CHIP_STM32F103TB is not set
+# CONFIG_ARCH_CHIP_STM32F103C4 is not set
+# CONFIG_ARCH_CHIP_STM32F103C8 is not set
+# CONFIG_ARCH_CHIP_STM32F103CB is not set
+# CONFIG_ARCH_CHIP_STM32F103R8 is not set
+# CONFIG_ARCH_CHIP_STM32F103RB is not set
+# CONFIG_ARCH_CHIP_STM32F103RC is not set
+# CONFIG_ARCH_CHIP_STM32F103RD is not set
+# CONFIG_ARCH_CHIP_STM32F103RE is not set
+# CONFIG_ARCH_CHIP_STM32F103RG is not set
+# CONFIG_ARCH_CHIP_STM32F103V8 is not set
+# CONFIG_ARCH_CHIP_STM32F103VB is not set
+# CONFIG_ARCH_CHIP_STM32F103VC is not set
+# CONFIG_ARCH_CHIP_STM32F103VE is not set
+# CONFIG_ARCH_CHIP_STM32F103ZE is not set
+# CONFIG_ARCH_CHIP_STM32F105VB is not set
+# CONFIG_ARCH_CHIP_STM32F105RB is not set
+# CONFIG_ARCH_CHIP_STM32F107VC is not set
+# CONFIG_ARCH_CHIP_STM32F205RG is not set
+# CONFIG_ARCH_CHIP_STM32F207IG is not set
+# CONFIG_ARCH_CHIP_STM32F207ZE is not set
+# CONFIG_ARCH_CHIP_STM32F302K6 is not set
+# CONFIG_ARCH_CHIP_STM32F302K8 is not set
+# CONFIG_ARCH_CHIP_STM32F302CB is not set
+# CONFIG_ARCH_CHIP_STM32F302CC is not set
+# CONFIG_ARCH_CHIP_STM32F302RB is not set
+# CONFIG_ARCH_CHIP_STM32F302RC is not set
+# CONFIG_ARCH_CHIP_STM32F302VB is not set
+# CONFIG_ARCH_CHIP_STM32F302VC is not set
+# CONFIG_ARCH_CHIP_STM32F303K6 is not set
+# CONFIG_ARCH_CHIP_STM32F303K8 is not set
+# CONFIG_ARCH_CHIP_STM32F303C6 is not set
+# CONFIG_ARCH_CHIP_STM32F303C8 is not set
+# CONFIG_ARCH_CHIP_STM32F303CB is not set
+# CONFIG_ARCH_CHIP_STM32F303CC is not set
+# CONFIG_ARCH_CHIP_STM32F303RB is not set
+# CONFIG_ARCH_CHIP_STM32F303RC is not set
+# CONFIG_ARCH_CHIP_STM32F303RD is not set
+# CONFIG_ARCH_CHIP_STM32F303RE is not set
+# CONFIG_ARCH_CHIP_STM32F303VB is not set
+# CONFIG_ARCH_CHIP_STM32F303VC is not set
+# CONFIG_ARCH_CHIP_STM32F372C8 is not set
+# CONFIG_ARCH_CHIP_STM32F372R8 is not set
+# CONFIG_ARCH_CHIP_STM32F372V8 is not set
+# CONFIG_ARCH_CHIP_STM32F372CB is not set
+# CONFIG_ARCH_CHIP_STM32F372RB is not set
+# CONFIG_ARCH_CHIP_STM32F372VB is not set
+# CONFIG_ARCH_CHIP_STM32F372CC is not set
+# CONFIG_ARCH_CHIP_STM32F372RC is not set
+# CONFIG_ARCH_CHIP_STM32F372VC is not set
+# CONFIG_ARCH_CHIP_STM32F373C8 is not set
+# CONFIG_ARCH_CHIP_STM32F373R8 is not set
+# CONFIG_ARCH_CHIP_STM32F373V8 is not set
+# CONFIG_ARCH_CHIP_STM32F373CB is not set
+# CONFIG_ARCH_CHIP_STM32F373RB is not set
+# CONFIG_ARCH_CHIP_STM32F373VB is not set
+# CONFIG_ARCH_CHIP_STM32F373CC is not set
+# CONFIG_ARCH_CHIP_STM32F373RC is not set
+# CONFIG_ARCH_CHIP_STM32F373VC is not set
+# CONFIG_ARCH_CHIP_STM32F401RE is not set
+# CONFIG_ARCH_CHIP_STM32F411RE is not set
+# CONFIG_ARCH_CHIP_STM32F411VE is not set
+# CONFIG_ARCH_CHIP_STM32F405RG is not set
+# CONFIG_ARCH_CHIP_STM32F405VG is not set
+# CONFIG_ARCH_CHIP_STM32F405ZG is not set
+# CONFIG_ARCH_CHIP_STM32F407VE is not set
+CONFIG_ARCH_CHIP_STM32F407VG=y
+# CONFIG_ARCH_CHIP_STM32F407ZE is not set
+# CONFIG_ARCH_CHIP_STM32F407ZG is not set
+# CONFIG_ARCH_CHIP_STM32F407IE is not set
+# CONFIG_ARCH_CHIP_STM32F407IG is not set
+# CONFIG_ARCH_CHIP_STM32F427V is not set
+# CONFIG_ARCH_CHIP_STM32F427Z is not set
+# CONFIG_ARCH_CHIP_STM32F427I is not set
+# CONFIG_ARCH_CHIP_STM32F429V is not set
+# CONFIG_ARCH_CHIP_STM32F429Z is not set
+# CONFIG_ARCH_CHIP_STM32F429I is not set
+# CONFIG_ARCH_CHIP_STM32F429B is not set
+# CONFIG_ARCH_CHIP_STM32F429N is not set
+# CONFIG_ARCH_CHIP_STM32F446M is not set
+# CONFIG_ARCH_CHIP_STM32F446R is not set
+# CONFIG_ARCH_CHIP_STM32F446V is not set
+# CONFIG_ARCH_CHIP_STM32F446Z is not set
+# CONFIG_ARCH_CHIP_STM32F469A is not set
+# CONFIG_ARCH_CHIP_STM32F469I is not set
+# CONFIG_ARCH_CHIP_STM32F469B is not set
+# CONFIG_ARCH_CHIP_STM32F469N is not set
+CONFIG_STM32_FLASH_CONFIG_DEFAULT=y
+# CONFIG_STM32_FLASH_CONFIG_4 is not set
+# CONFIG_STM32_FLASH_CONFIG_6 is not set
+# CONFIG_STM32_FLASH_CONFIG_8 is not set
+# CONFIG_STM32_FLASH_CONFIG_B is not set
+# CONFIG_STM32_FLASH_CONFIG_C is not set
+# CONFIG_STM32_FLASH_CONFIG_D is not set
+# CONFIG_STM32_FLASH_CONFIG_E is not set
+# CONFIG_STM32_FLASH_CONFIG_F is not set
+# CONFIG_STM32_FLASH_CONFIG_G is not set
+# CONFIG_STM32_FLASH_CONFIG_I is not set
+# CONFIG_STM32_STM32L15XX is not set
+# CONFIG_STM32_ENERGYLITE is not set
+# CONFIG_STM32_STM32F10XX is not set
+# CONFIG_STM32_VALUELINE is not set
+# CONFIG_STM32_CONNECTIVITYLINE is not set
+# CONFIG_STM32_PERFORMANCELINE is not set
+# CONFIG_STM32_USBACCESSLINE is not set
+# CONFIG_STM32_HIGHDENSITY is not set
+# CONFIG_STM32_MEDIUMDENSITY is not set
+# CONFIG_STM32_LOWDENSITY is not set
+# CONFIG_STM32_STM32F20XX is not set
+# CONFIG_STM32_STM32F205 is not set
+# CONFIG_STM32_STM32F207 is not set
+# CONFIG_STM32_STM32F30XX is not set
+# CONFIG_STM32_STM32F302 is not set
+# CONFIG_STM32_STM32F303 is not set
+# CONFIG_STM32_STM32F37XX is not set
+CONFIG_STM32_STM32F40XX=y
+# CONFIG_STM32_STM32F401 is not set
+# CONFIG_STM32_STM32F411 is not set
+# CONFIG_STM32_STM32F405 is not set
+CONFIG_STM32_STM32F407=y
+# CONFIG_STM32_STM32F427 is not set
+# CONFIG_STM32_STM32F429 is not set
+# CONFIG_STM32_STM32F446 is not set
+# CONFIG_STM32_STM32F469 is not set
+# CONFIG_STM32_DFU is not set
+
+#
+# STM32 Peripheral Support
+#
+CONFIG_STM32_HAVE_CCM=y
+# CONFIG_STM32_HAVE_USBDEV is not set
+CONFIG_STM32_HAVE_OTGFS=y
+CONFIG_STM32_HAVE_FSMC=y
+# CONFIG_STM32_HAVE_LTDC is not set
+CONFIG_STM32_HAVE_USART3=y
+CONFIG_STM32_HAVE_UART4=y
+CONFIG_STM32_HAVE_UART5=y
+CONFIG_STM32_HAVE_USART6=y
+# CONFIG_STM32_HAVE_UART7 is not set
+# CONFIG_STM32_HAVE_UART8 is not set
+CONFIG_STM32_HAVE_TIM1=y
+CONFIG_STM32_HAVE_TIM2=y
+CONFIG_STM32_HAVE_TIM3=y
+CONFIG_STM32_HAVE_TIM4=y
+CONFIG_STM32_HAVE_TIM5=y
+CONFIG_STM32_HAVE_TIM6=y
+CONFIG_STM32_HAVE_TIM7=y
+CONFIG_STM32_HAVE_TIM8=y
+CONFIG_STM32_HAVE_TIM9=y
+CONFIG_STM32_HAVE_TIM10=y
+CONFIG_STM32_HAVE_TIM11=y
+CONFIG_STM32_HAVE_TIM12=y
+CONFIG_STM32_HAVE_TIM13=y
+CONFIG_STM32_HAVE_TIM14=y
+# CONFIG_STM32_HAVE_TIM15 is not set
+# CONFIG_STM32_HAVE_TIM16 is not set
+# CONFIG_STM32_HAVE_TIM17 is not set
+CONFIG_STM32_HAVE_ADC2=y
+CONFIG_STM32_HAVE_ADC3=y
+# CONFIG_STM32_HAVE_ADC4 is not set
+# CONFIG_STM32_HAVE_ADC1_DMA is not set
+# CONFIG_STM32_HAVE_ADC2_DMA is not set
+# CONFIG_STM32_HAVE_ADC3_DMA is not set
+# CONFIG_STM32_HAVE_ADC4_DMA is not set
+CONFIG_STM32_HAVE_CAN1=y
+CONFIG_STM32_HAVE_CAN2=y
+CONFIG_STM32_HAVE_DAC1=y
+CONFIG_STM32_HAVE_DAC2=y
+CONFIG_STM32_HAVE_RNG=y
+CONFIG_STM32_HAVE_ETHMAC=y
+CONFIG_STM32_HAVE_I2C2=y
+CONFIG_STM32_HAVE_I2C3=y
+CONFIG_STM32_HAVE_SPI2=y
+CONFIG_STM32_HAVE_SPI3=y
+# CONFIG_STM32_HAVE_SPI4 is not set
+# CONFIG_STM32_HAVE_SPI5 is not set
+# CONFIG_STM32_HAVE_SPI6 is not set
+# CONFIG_STM32_HAVE_SAIPLL is not set
+# CONFIG_STM32_HAVE_I2SPLL is not set
+# CONFIG_STM32_ADC1 is not set
+# CONFIG_STM32_ADC2 is not set
+# CONFIG_STM32_ADC3 is not set
+# CONFIG_STM32_BKPSRAM is not set
+# CONFIG_STM32_CAN1 is not set
+# CONFIG_STM32_CAN2 is not set
+# CONFIG_STM32_CCMDATARAM is not set
+# CONFIG_STM32_CRC is not set
+# CONFIG_STM32_CRYP is not set
+# CONFIG_STM32_DMA1 is not set
+# CONFIG_STM32_DMA2 is not set
+# CONFIG_STM32_DAC1 is not set
+# CONFIG_STM32_DAC2 is not set
+# CONFIG_STM32_DCMI is not set
+# CONFIG_STM32_ETHMAC is not set
+# CONFIG_STM32_FSMC is not set
+# CONFIG_STM32_HASH is not set
+# CONFIG_STM32_I2C1 is not set
+# CONFIG_STM32_I2C2 is not set
+# CONFIG_STM32_I2C3 is not set
+CONFIG_STM32_OTGFS=y
+# CONFIG_STM32_OTGHS is not set
+CONFIG_STM32_PWR=y
+# CONFIG_STM32_RNG is not set
+CONFIG_STM32_SDIO=y
+CONFIG_STM32_SPI1=y
+# CONFIG_STM32_SPI2 is not set
+# CONFIG_STM32_SPI3 is not set
+CONFIG_STM32_SYSCFG=y
+# CONFIG_STM32_TIM1 is not set
+# CONFIG_STM32_TIM2 is not set
+# CONFIG_STM32_TIM3 is not set
+# CONFIG_STM32_TIM4 is not set
+# CONFIG_STM32_TIM5 is not set
+# CONFIG_STM32_TIM6 is not set
+# CONFIG_STM32_TIM7 is not set
+# CONFIG_STM32_TIM8 is not set
+# CONFIG_STM32_TIM9 is not set
+# CONFIG_STM32_TIM10 is not set
+# CONFIG_STM32_TIM11 is not set
+# CONFIG_STM32_TIM12 is not set
+# CONFIG_STM32_TIM13 is not set
+# CONFIG_STM32_TIM14 is not set
+# CONFIG_STM32_USART1 is not set
+CONFIG_STM32_USART2=y
+# CONFIG_STM32_USART3 is not set
+# CONFIG_STM32_UART4 is not set
+# CONFIG_STM32_UART5 is not set
+# CONFIG_STM32_USART6 is not set
+# CONFIG_STM32_IWDG is not set
+# CONFIG_STM32_WWDG is not set
+CONFIG_STM32_SPI=y
+# CONFIG_STM32_NOEXT_VECTORS is not set
+
+#
+# Alternate Pin Mapping
+#
+# CONFIG_STM32_FLASH_PREFETCH is not set
+# CONFIG_STM32_JTAG_DISABLE is not set
+# CONFIG_STM32_JTAG_FULL_ENABLE is not set
+# CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set
+CONFIG_STM32_JTAG_SW_ENABLE=y
+# CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG is not set
+# CONFIG_STM32_FORCEPOWER is not set
+# CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set
+# CONFIG_STM32_CCMEXCLUDE is not set
+
+#
+# Timer Configuration
+#
+# CONFIG_STM32_ONESHOT is not set
+# CONFIG_STM32_FREERUN is not set
+# CONFIG_STM32_TIM1_CAP is not set
+# CONFIG_STM32_TIM2_CAP is not set
+# CONFIG_STM32_TIM3_CAP is not set
+# CONFIG_STM32_TIM4_CAP is not set
+# CONFIG_STM32_TIM5_CAP is not set
+# CONFIG_STM32_TIM8_CAP is not set
+# CONFIG_STM32_TIM9_CAP is not set
+# CONFIG_STM32_TIM10_CAP is not set
+# CONFIG_STM32_TIM11_CAP is not set
+# CONFIG_STM32_TIM12_CAP is not set
+# CONFIG_STM32_TIM13_CAP is not set
+# CONFIG_STM32_TIM14_CAP is not set
+CONFIG_STM32_USART=y
+CONFIG_STM32_SERIALDRIVER=y
+
+#
+# U[S]ART Configuration
+#
+
+#
+# U[S]ART Device Configuration
+#
+CONFIG_STM32_USART2_SERIALDRIVER=y
+# CONFIG_STM32_USART2_1WIREDRIVER is not set
+# CONFIG_USART2_RS485 is not set
+
+#
+# Serial Driver Configuration
+#
+# CONFIG_SERIAL_DISABLE_REORDERING is not set
+# CONFIG_STM32_FLOWCONTROL_BROKEN is not set
+# CONFIG_STM32_USART_BREAKS is not set
+# CONFIG_STM32_USART_SINGLEWIRE is not set
+
+#
+# SPI Configuration
+#
+# CONFIG_STM32_SPI_INTERRUPTS is not set
+# CONFIG_STM32_SPI_DMA is not set
+
+#
+# SDIO Configuration
+#
+CONFIG_SDIO_DMAPRIO=0x00010000
+# CONFIG_STM32_HAVE_RTC_COUNTER is not set
+# CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set
+
+#
+# USB FS Host Configuration
+#
+
+#
+# USB HS Host Configuration
+#
+
+#
+# USB Host Debug Configuration
+#
+
+#
+# USB Device Configuration
+#
+
+#
+# Architecture Options
+#
+# CONFIG_ARCH_NOINTC is not set
+# CONFIG_ARCH_VECNOTIRQ is not set
+# CONFIG_ARCH_DMA is not set
+CONFIG_ARCH_HAVE_IRQPRIO=y
+# CONFIG_ARCH_L2CACHE is not set
+# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set
+# CONFIG_ARCH_HAVE_ADDRENV is not set
+# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set
+# CONFIG_ARCH_HAVE_MULTICPU is not set
+CONFIG_ARCH_HAVE_VFORK=y
+# CONFIG_ARCH_HAVE_MMU is not set
+CONFIG_ARCH_HAVE_MPU=y
+# CONFIG_ARCH_NAND_HWECC is not set
+# CONFIG_ARCH_HAVE_EXTCLK is not set
+# CONFIG_ARCH_HAVE_POWEROFF is not set
+CONFIG_ARCH_HAVE_RESET=y
+# CONFIG_ARCH_USE_MPU is not set
+# CONFIG_ARCH_IRQPRIO is not set
+CONFIG_ARCH_STACKDUMP=y
+# CONFIG_ENDIAN_BIG is not set
+# CONFIG_ARCH_IDLE_CUSTOM is not set
+# CONFIG_ARCH_HAVE_RAMFUNCS is not set
+CONFIG_ARCH_HAVE_RAMVECTORS=y
+# CONFIG_ARCH_RAMVECTORS is not set
+
+#
+# Board Settings
+#
+CONFIG_BOARD_LOOPSPERMSEC=16717
+# CONFIG_ARCH_CALIBRATION is not set
+
+#
+# Interrupt options
+#
+CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
+CONFIG_ARCH_INTERRUPTSTACK=0
+CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y
+# CONFIG_ARCH_HIPRI_INTERRUPT is not set
+
+#
+# Boot options
+#
+# CONFIG_BOOT_RUNFROMEXTSRAM is not set
+CONFIG_BOOT_RUNFROMFLASH=y
+# CONFIG_BOOT_RUNFROMISRAM is not set
+# CONFIG_BOOT_RUNFROMSDRAM is not set
+# CONFIG_BOOT_COPYTORAM is not set
+
+#
+# Boot Memory Configuration
+#
+CONFIG_RAM_START=0x20000000
+CONFIG_RAM_SIZE=114688
+# CONFIG_ARCH_HAVE_SDRAM is not set
+
+#
+# Board Selection
+#
+CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
+# CONFIG_ARCH_BOARD_MIKROE_STM32F4 is not set
+# CONFIG_ARCH_BOARD_CUSTOM is not set
+CONFIG_ARCH_BOARD="stm32f4discovery"
+
+#
+# Common Board Options
+#
+CONFIG_ARCH_HAVE_LEDS=y
+CONFIG_ARCH_LEDS=y
+CONFIG_ARCH_HAVE_BUTTONS=y
+CONFIG_ARCH_BUTTONS=y
+CONFIG_ARCH_HAVE_IRQBUTTONS=y
+# CONFIG_ARCH_IRQBUTTONS is not set
+
+#
+# Board-Specific Options
+#
+# CONFIG_STM32F4DISBB is not set
+# CONFIG_BOARD_CRASHDUMP is not set
+CONFIG_LIB_BOARDCTL=y
+# CONFIG_BOARDCTL_RESET is not set
+# CONFIG_BOARDCTL_UNIQUEID is not set
+CONFIG_BOARDCTL_USBDEVCTRL=y
+# CONFIG_BOARDCTL_TSCTEST is not set
+# CONFIG_BOARDCTL_ADCTEST is not set
+# CONFIG_BOARDCTL_PWMTEST is not set
+# CONFIG_BOARDCTL_GRAPHICS is not set
+# CONFIG_BOARDCTL_IOCTL is not set
+
+#
+# RTOS Features
+#
+CONFIG_DISABLE_OS_API=y
+# CONFIG_DISABLE_POSIX_TIMERS is not set
+# CONFIG_DISABLE_PTHREAD is not set
+# CONFIG_DISABLE_SIGNALS is not set
+# CONFIG_DISABLE_MQUEUE is not set
+# CONFIG_DISABLE_ENVIRON is not set
+
+#
+# Clocks and Timers
+#
+CONFIG_ARCH_HAVE_TICKLESS=y
+# CONFIG_SCHED_TICKLESS is not set
+CONFIG_USEC_PER_TICK=10000
+# CONFIG_SYSTEM_TIME64 is not set
+CONFIG_CLOCK_MONOTONIC=y
+CONFIG_ARCH_HAVE_TIMEKEEPING=y
+# CONFIG_JULIAN_TIME is not set
+CONFIG_START_YEAR=2013
+CONFIG_START_MONTH=1
+CONFIG_START_DAY=27
+CONFIG_MAX_WDOGPARMS=2
+CONFIG_PREALLOC_WDOGS=8
+CONFIG_WDOG_INTRESERVE=1
+CONFIG_PREALLOC_TIMERS=4
+
+#
+# Tasks and Scheduling
+#
+# CONFIG_INIT_NONE is not set
+CONFIG_INIT_ENTRYPOINT=y
+# CONFIG_INIT_FILEPATH is not set
+CONFIG_USER_ENTRYPOINT="nsh_main"
+CONFIG_RR_INTERVAL=200
+# CONFIG_SCHED_SPORADIC is not set
+CONFIG_TASK_NAME_SIZE=31
+CONFIG_MAX_TASKS=16
+# CONFIG_SCHED_HAVE_PARENT is not set
+CONFIG_SCHED_WAITPID=y
+
+#
+# Pthread Options
+#
+CONFIG_MUTEX_TYPES=y
+CONFIG_NPTHREAD_KEYS=4
+
+#
+# Performance Monitoring
+#
+# CONFIG_SCHED_CPULOAD is not set
+# CONFIG_SCHED_INSTRUMENTATION is not set
+
+#
+# Files and I/O
+#
+CONFIG_DEV_CONSOLE=y
+# CONFIG_FDCLONE_DISABLE is not set
+# CONFIG_FDCLONE_STDIO is not set
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_NFILE_DESCRIPTORS=8
+CONFIG_NFILE_STREAMS=8
+CONFIG_NAME_MAX=32
+# CONFIG_PRIORITY_INHERITANCE is not set
+
+#
+# RTOS hooks
+#
+# CONFIG_BOARD_INITIALIZE is not set
+# CONFIG_SCHED_STARTHOOK is not set
+# CONFIG_SCHED_ATEXIT is not set
+# CONFIG_SCHED_ONEXIT is not set
+# CONFIG_SIG_EVTHREAD is not set
+
+#
+# Signal Numbers
+#
+CONFIG_SIG_SIGUSR1=1
+CONFIG_SIG_SIGUSR2=2
+CONFIG_SIG_SIGALARM=3
+CONFIG_SIG_SIGCONDTIMEDOUT=16
+CONFIG_SIG_SIGWORK=17
+
+#
+# POSIX Message Queue Options
+#
+CONFIG_PREALLOC_MQ_MSGS=4
+CONFIG_MQ_MAXMSGSIZE=32
+# CONFIG_MODULE is not set
+
+#
+# Work queue support
+#
+CONFIG_SCHED_WORKQUEUE=y
+CONFIG_SCHED_HPWORK=y
+CONFIG_SCHED_HPWORKPRIORITY=224
+CONFIG_SCHED_HPWORKPERIOD=50000
+CONFIG_SCHED_HPWORKSTACKSIZE=2048
+# CONFIG_SCHED_LPWORK is not set
+
+#
+# Stack and heap information
+#
+CONFIG_IDLETHREAD_STACKSIZE=2048
+CONFIG_USERMAIN_STACKSIZE=2048
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=2048
+# CONFIG_LIB_SYSCALL is not set
+
+#
+# Device Drivers
+#
+# CONFIG_DISABLE_POLL is not set
+CONFIG_DEV_NULL=y
+# CONFIG_DEV_ZERO is not set
+# CONFIG_DEV_URANDOM is not set
+# CONFIG_DEV_LOOP is not set
+
+#
+# Buffering
+#
+# CONFIG_DRVR_WRITEBUFFER is not set
+# CONFIG_DRVR_READAHEAD is not set
+# CONFIG_RAMDISK is not set
+# CONFIG_CAN is not set
+# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set
+# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set
+# CONFIG_PWM is not set
+CONFIG_ARCH_HAVE_I2CRESET=y
+# CONFIG_I2C is not set
+CONFIG_SPI=y
+# CONFIG_SPI_SLAVE is not set
+CONFIG_SPI_EXCHANGE=y
+# CONFIG_SPI_CMDDATA is not set
+# CONFIG_SPI_CALLBACK is not set
+# CONFIG_SPI_HWFEATURES is not set
+# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set
+# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set
+CONFIG_ARCH_HAVE_SPI_BITORDER=y
+# CONFIG_SPI_BITORDER is not set
+# CONFIG_SPI_CS_DELAY_CONTROL is not set
+# CONFIG_SPI_DRIVER is not set
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_I2S is not set
+
+#
+# Timer Driver Support
+#
+# CONFIG_TIMER is not set
+# CONFIG_ONESHOT is not set
+# CONFIG_RTC is not set
+# CONFIG_WATCHDOG is not set
+# CONFIG_ANALOG is not set
+# CONFIG_AUDIO_DEVICES is not set
+# CONFIG_VIDEO_DEVICES is not set
+# CONFIG_BCH is not set
+# CONFIG_INPUT is not set
+
+#
+# IO Expander/GPIO Support
+#
+# CONFIG_IOEXPANDER is not set
+# CONFIG_DEV_GPIO is not set
+
+#
+# LCD Driver Support
+#
+# CONFIG_LCD is not set
+# CONFIG_SLCD is not set
+
+#
+# LED Support
+#
+# CONFIG_USERLED is not set
+# CONFIG_RGBLED is not set
+# CONFIG_PCA9635PW is not set
+# CONFIG_NCP5623C is not set
+CONFIG_MMCSD=y
+CONFIG_MMCSD_NSLOTS=1
+# CONFIG_MMCSD_READONLY is not set
+# CONFIG_MMCSD_MULTIBLOCK_DISABLE is not set
+CONFIG_MMCSD_MMCSUPPORT=y
+CONFIG_MMCSD_HAVECARDDETECT=y
+CONFIG_MMCSD_SPI=y
+CONFIG_MMCSD_SPICLOCK=20000000
+CONFIG_MMCSD_SPIMODE=0
+CONFIG_ARCH_HAVE_SDIO=y
+CONFIG_ARCH_HAVE_SDIOWAIT_WRCOMPLETE=y
+CONFIG_MMCSD_SDIO=y
+CONFIG_SDIO_PREFLIGHT=y
+# CONFIG_SDIO_MUXBUS is not set
+# CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE is not set
+# CONFIG_SDIO_BLOCKSETUP is not set
+# CONFIG_MODEM is not set
+# CONFIG_MTD is not set
+# CONFIG_EEPROM is not set
+CONFIG_NETDEVICES=y
+
+#
+# General Ethernet MAC Driver Options
+#
+# CONFIG_NETDEV_LOOPBACK is not set
+# CONFIG_NETDEV_TELNET is not set
+# CONFIG_NETDEV_MULTINIC is not set
+# CONFIG_ARCH_HAVE_NETDEV_STATISTICS is not set
+CONFIG_NETDEV_LATEINIT=y
+
+#
+# External Ethernet MAC Device Support
+#
+# CONFIG_NET_DM90x0 is not set
+# CONFIG_ENC28J60 is not set
+# CONFIG_ENCX24J600 is not set
+# CONFIG_NET_E1000 is not set
+# CONFIG_NET_SLIP is not set
+# CONFIG_NET_FTMAC100 is not set
+# CONFIG_NET_VNET is not set
+CONFIG_PIPES=y
+CONFIG_DEV_PIPE_MAXSIZE=1024
+CONFIG_DEV_PIPE_SIZE=1024
+CONFIG_DEV_FIFO_SIZE=1024
+# CONFIG_PM is not set
+# CONFIG_POWER is not set
+# CONFIG_SENSORS is not set
+# CONFIG_SERCOMM_CONSOLE is not set
+CONFIG_SERIAL=y
+# CONFIG_DEV_LOWCONSOLE is not set
+CONFIG_SERIAL_REMOVABLE=y
+# CONFIG_SERIAL_CONSOLE is not set
+# CONFIG_16550_UART is not set
+# CONFIG_UART_SERIALDRIVER is not set
+# CONFIG_UART0_SERIALDRIVER is not set
+# CONFIG_UART1_SERIALDRIVER is not set
+# CONFIG_UART2_SERIALDRIVER is not set
+# CONFIG_UART3_SERIALDRIVER is not set
+# CONFIG_UART4_SERIALDRIVER is not set
+# CONFIG_UART5_SERIALDRIVER is not set
+# CONFIG_UART6_SERIALDRIVER is not set
+# CONFIG_UART7_SERIALDRIVER is not set
+# CONFIG_UART8_SERIALDRIVER is not set
+# CONFIG_SCI0_SERIALDRIVER is not set
+# CONFIG_SCI1_SERIALDRIVER is not set
+# CONFIG_USART0_SERIALDRIVER is not set
+# CONFIG_USART1_SERIALDRIVER is not set
+CONFIG_USART2_SERIALDRIVER=y
+# CONFIG_USART3_SERIALDRIVER is not set
+# CONFIG_USART4_SERIALDRIVER is not set
+# CONFIG_USART5_SERIALDRIVER is not set
+# CONFIG_USART6_SERIALDRIVER is not set
+# CONFIG_USART7_SERIALDRIVER is not set
+# CONFIG_USART8_SERIALDRIVER is not set
+# CONFIG_OTHER_UART_SERIALDRIVER is not set
+CONFIG_MCU_SERIAL=y
+CONFIG_STANDARD_SERIAL=y
+CONFIG_SERIAL_NPOLLWAITERS=2
+# CONFIG_SERIAL_IFLOWCONTROL is not set
+# CONFIG_SERIAL_OFLOWCONTROL is not set
+# CONFIG_SERIAL_DMA is not set
+CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
+# CONFIG_USART2_SERIAL_CONSOLE is not set
+# CONFIG_OTHER_SERIAL_CONSOLE is not set
+CONFIG_NO_SERIAL_CONSOLE=y
+
+#
+# USART2 Configuration
+#
+CONFIG_USART2_RXBUFSIZE=256
+CONFIG_USART2_TXBUFSIZE=256
+CONFIG_USART2_BAUD=115200
+CONFIG_USART2_BITS=8
+CONFIG_USART2_PARITY=0
+CONFIG_USART2_2STOP=0
+# CONFIG_USART2_IFLOWCONTROL is not set
+# CONFIG_USART2_OFLOWCONTROL is not set
+# CONFIG_USART2_DMA is not set
+# CONFIG_PSEUDOTERM is not set
+CONFIG_USBDEV=y
+
+#
+# USB Device Controller Driver Options
+#
+# CONFIG_USBDEV_ISOCHRONOUS is not set
+# CONFIG_USBDEV_DUALSPEED is not set
+CONFIG_USBDEV_SELFPOWERED=y
+# CONFIG_USBDEV_BUSPOWERED is not set
+CONFIG_USBDEV_MAXPOWER=100
+# CONFIG_USBDEV_DMA is not set
+# CONFIG_ARCH_USBDEV_STALLQUEUE is not set
+# CONFIG_USBDEV_TRACE is not set
+
+#
+# USB Device Class Driver Options
+#
+# CONFIG_USBDEV_COMPOSITE is not set
+# CONFIG_PL2303 is not set
+CONFIG_CDCACM=y
+CONFIG_CDCACM_CONSOLE=y
+CONFIG_CDCACM_EP0MAXPACKET=64
+CONFIG_CDCACM_EPINTIN=1
+CONFIG_CDCACM_EPINTIN_FSSIZE=64
+CONFIG_CDCACM_EPINTIN_HSSIZE=64
+CONFIG_CDCACM_EPBULKOUT=3
+CONFIG_CDCACM_EPBULKOUT_FSSIZE=64
+CONFIG_CDCACM_EPBULKOUT_HSSIZE=512
+CONFIG_CDCACM_EPBULKIN=2
+CONFIG_CDCACM_EPBULKIN_FSSIZE=64
+CONFIG_CDCACM_EPBULKIN_HSSIZE=512
+CONFIG_CDCACM_NRDREQS=4
+CONFIG_CDCACM_NWRREQS=4
+CONFIG_CDCACM_BULKIN_REQLEN=96
+CONFIG_CDCACM_RXBUFSIZE=256
+CONFIG_CDCACM_TXBUFSIZE=256
+CONFIG_CDCACM_VENDORID=0x0525
+CONFIG_CDCACM_PRODUCTID=0xa4a7
+CONFIG_CDCACM_VENDORSTR="NuttX"
+CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial"
+# CONFIG_USBMSC is not set
+# CONFIG_USBHOST is not set
+# CONFIG_HAVE_USBTRACE is not set
+# CONFIG_DRIVERS_WIRELESS is not set
+# CONFIG_DRIVERS_CONTACTLESS is not set
+
+#
+# System Logging
+#
+# CONFIG_ARCH_SYSLOG is not set
+# CONFIG_RAMLOG is not set
+# CONFIG_SYSLOG_INTBUFFER is not set
+# CONFIG_SYSLOG_TIMESTAMP is not set
+# CONFIG_SYSLOG_SERIAL_CONSOLE is not set
+CONFIG_SYSLOG_CHAR=y
+# CONFIG_SYSLOG_CONSOLE is not set
+# CONFIG_SYSLOG_NONE is not set
+# CONFIG_SYSLOG_FILE is not set
+# CONFIG_CONSOLE_SYSLOG is not set
+CONFIG_SYSLOG_CHAR_CRLF=y
+CONFIG_SYSLOG_DEVPATH="/dev/ttyS0"
+# CONFIG_SYSLOG_CHARDEV is not set
+
+#
+# Networking Support
+#
+CONFIG_ARCH_HAVE_NET=y
+# CONFIG_ARCH_HAVE_PHY is not set
+CONFIG_NET=y
+# CONFIG_NET_NOINTS is not set
+# CONFIG_NET_PROMISCUOUS is not set
+
+#
+# Driver buffer configuration
+#
+# CONFIG_NET_MULTIBUFFER is not set
+CONFIG_NET_ETH_MTU=590
+CONFIG_NET_ETH_TCP_RECVWNDO=536
+CONFIG_NET_GUARDSIZE=2
+
+#
+# Data link support
+#
+# CONFIG_NET_MULTILINK is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_NET_LOOPBACK is not set
+# CONFIG_NET_TUN is not set
+
+#
+# Network Device Operations
+#
+# CONFIG_NETDEV_PHY_IOCTL is not set
+
+#
+# Internet Protocol Selection
+#
+CONFIG_NET_IPv4=y
+# CONFIG_NET_IPv6 is not set
+
+#
+# Socket Support
+#
+CONFIG_NSOCKET_DESCRIPTORS=8
+CONFIG_NET_NACTIVESOCKETS=16
+CONFIG_NET_SOCKOPTS=y
+# CONFIG_NET_SOLINGER is not set
+
+#
+# Raw Socket Support
+#
+# CONFIG_NET_PKT is not set
+
+#
+# Unix Domain Socket Support
+#
+CONFIG_NET_LOCAL=y
+CONFIG_NET_LOCAL_STREAM=y
+CONFIG_NET_LOCAL_DGRAM=y
+
+#
+# TCP/IP Networking
+#
+CONFIG_NET_TCP=y
+# CONFIG_NET_TCPURGDATA is not set
+CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_MAX_LISTENPORTS=20
+CONFIG_NET_TCP_READAHEAD=y
+CONFIG_NET_TCP_WRITE_BUFFERS=y
+CONFIG_NET_TCP_NWRBCHAINS=8
+CONFIG_NET_TCP_RECVDELAY=0
+# CONFIG_NET_TCPBACKLOG is not set
+# CONFIG_NET_SENDFILE is not set
+
+#
+# UDP Networking
+#
+# CONFIG_NET_UDP is not set
+
+#
+# ICMP Networking Support
+#
+# CONFIG_NET_ICMP is not set
+
+#
+# IGMPv2 Client Support
+#
+# CONFIG_NET_IGMP is not set
+
+#
+# ARP Configuration
+#
+CONFIG_NET_ARP=y
+CONFIG_NET_ARPTAB_SIZE=16
+CONFIG_NET_ARP_MAXAGE=120
+# CONFIG_NET_ARP_IPIN is not set
+# CONFIG_NET_ARP_SEND is not set
+
+#
+# Network I/O Buffer Support
+#
+CONFIG_NET_IOB=y
+CONFIG_IOB_NBUFFERS=36
+CONFIG_IOB_BUFSIZE=196
+CONFIG_IOB_NCHAINS=8
+CONFIG_IOB_THROTTLE=8
+# CONFIG_NET_ARCH_INCR32 is not set
+# CONFIG_NET_ARCH_CHKSUM is not set
+# CONFIG_NET_STATISTICS is not set
+
+#
+# Routing Table Configuration
+#
+# CONFIG_NET_ROUTE is not set
+CONFIG_NET_HOSTNAME=""
+
+#
+# Crypto API
+#
+# CONFIG_CRYPTO is not set
+
+#
+# File Systems
+#
+
+#
+# File system configuration
+#
+# CONFIG_DISABLE_MOUNTPOINT is not set
+# CONFIG_FS_AUTOMOUNTER is not set
+# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
+CONFIG_FS_READABLE=y
+CONFIG_FS_WRITABLE=y
+# CONFIG_FS_NAMED_SEMAPHORES is not set
+CONFIG_FS_MQUEUE_MPATH="/var/mqueue"
+# CONFIG_FS_RAMMAP is not set
+CONFIG_FS_FAT=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FAT_MAXFNAME=32
+# CONFIG_FS_FATTIME is not set
+# CONFIG_FAT_FORCE_INDIRECT is not set
+# CONFIG_FAT_DMAMEMORY is not set
+# CONFIG_FAT_DIRECT_RETRY is not set
+# CONFIG_FS_NXFFS is not set
+# CONFIG_FS_ROMFS is not set
+# CONFIG_FS_TMPFS is not set
+# CONFIG_FS_SMARTFS is not set
+# CONFIG_FS_BINFS is not set
+CONFIG_FS_PROCFS=y
+# CONFIG_FS_PROCFS_REGISTER is not set
+
+#
+# Exclude individual procfs entries
+#
+# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set
+# CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_NET is not set
+# CONFIG_FS_UNIONFS is not set
+
+#
+# Graphics Support
+#
+# CONFIG_NX is not set
+
+#
+# Memory Management
+#
+# CONFIG_MM_SMALL is not set
+CONFIG_MM_REGIONS=2
+# CONFIG_ARCH_HAVE_HEAP2 is not set
+# CONFIG_GRAN is not set
+
+#
+# Audio Support
+#
+# CONFIG_AUDIO is not set
+
+#
+# Wireless Support
+#
+
+#
+# Binary Loader
+#
+# CONFIG_BINFMT_DISABLE is not set
+# CONFIG_BINFMT_EXEPATH is not set
+# CONFIG_NXFLAT is not set
+# CONFIG_ELF is not set
+CONFIG_BUILTIN=y
+# CONFIG_PIC is not set
+# CONFIG_SYMTAB_ORDEREDBYNAME is not set
+
+#
+# Library Routines
+#
+
+#
+# Standard C Library Options
+#
+CONFIG_STDIO_BUFFER_SIZE=64
+CONFIG_STDIO_LINEBUFFER=y
+CONFIG_NUNGET_CHARS=2
+CONFIG_LIB_HOMEDIR="/"
+CONFIG_LIBM=y
+# CONFIG_NOPRINTF_FIELDWIDTH is not set
+# CONFIG_LIBC_FLOATINGPOINT is not set
+CONFIG_LIBC_LONG_LONG=y
+# CONFIG_LIBC_IOCTL_VARIADIC is not set
+CONFIG_LIB_RAND_ORDER=1
+# CONFIG_EOL_IS_CR is not set
+# CONFIG_EOL_IS_LF is not set
+# CONFIG_EOL_IS_BOTH_CRLF is not set
+CONFIG_EOL_IS_EITHER_CRLF=y
+# CONFIG_LIBC_EXECFUNCS is not set
+CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024
+CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
+# CONFIG_LIBC_STRERROR is not set
+# CONFIG_LIBC_PERROR_STDOUT is not set
+CONFIG_LIBC_TMPDIR="/tmp"
+CONFIG_LIBC_MAX_TMPFILE=32
+CONFIG_ARCH_LOWPUTC=y
+# CONFIG_LIBC_LOCALTIME is not set
+# CONFIG_TIME_EXTENDED is not set
+CONFIG_LIB_SENDFILE_BUFSIZE=512
+# CONFIG_ARCH_ROMGETC is not set
+# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
+CONFIG_ARCH_HAVE_TLS=y
+# CONFIG_TLS is not set
+CONFIG_LIBC_NETDB=y
+# CONFIG_NETDB_HOSTFILE is not set
+
+#
+# Non-standard Library Support
+#
+# CONFIG_LIB_CRC64_FAST is not set
+# CONFIG_LIB_KBDCODEC is not set
+# CONFIG_LIB_SLCDCODEC is not set
+# CONFIG_LIB_HEX2BIN is not set
+
+#
+# Basic CXX Support
+#
+# CONFIG_C99_BOOL8 is not set
+CONFIG_HAVE_CXX=y
+CONFIG_HAVE_CXXINITIALIZE=y
+# CONFIG_CXX_NEWLONG is not set
+
+#
+# uClibc++ Standard C++ Library
+#
+# CONFIG_UCLIBCXX is not set
+
+#
+# Application Configuration
+#
+
+#
+# Built-In Applications
+#
+CONFIG_BUILTIN_PROXY_STACKSIZE=1024
+
+#
+# CAN Utilities
+#
+
+#
+# Examples
+#
+# CONFIG_EXAMPLES_BUTTONS is not set
+# CONFIG_EXAMPLES_CHAT is not set
+# CONFIG_EXAMPLES_CONFIGDATA is not set
+# CONFIG_EXAMPLES_CPUHOG is not set
+# CONFIG_EXAMPLES_CXXTEST is not set
+# CONFIG_EXAMPLES_DHCPD is not set
+# CONFIG_EXAMPLES_ELF is not set
+# CONFIG_EXAMPLES_FSTEST is not set
+# CONFIG_EXAMPLES_FTPC is not set
+# CONFIG_EXAMPLES_FTPD is not set
+# CONFIG_EXAMPLES_HELLO is not set
+# CONFIG_EXAMPLES_HELLOXX is not set
+# CONFIG_EXAMPLES_HIDKBD is not set
+# CONFIG_EXAMPLES_IGMP is not set
+# CONFIG_EXAMPLES_JSON is not set
+# CONFIG_EXAMPLES_KEYPADTEST is not set
+# CONFIG_EXAMPLES_MEDIA is not set
+# CONFIG_EXAMPLES_MM is not set
+# CONFIG_EXAMPLES_MODBUS is not set
+# CONFIG_EXAMPLES_MOUNT is not set
+# CONFIG_EXAMPLES_NETTEST is not set
+# CONFIG_EXAMPLES_NRF24L01TERM is not set
+CONFIG_EXAMPLES_NSH=y
+CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
+# CONFIG_EXAMPLES_NULL is not set
+# CONFIG_EXAMPLES_NXFFS is not set
+# CONFIG_EXAMPLES_NXHELLO is not set
+# CONFIG_EXAMPLES_NXIMAGE is not set
+# CONFIG_EXAMPLES_NX is not set
+# CONFIG_EXAMPLES_NXLINES is not set
+# CONFIG_EXAMPLES_NXTERM is not set
+# CONFIG_EXAMPLES_NXTEXT is not set
+# CONFIG_EXAMPLES_OSTEST is not set
+# CONFIG_EXAMPLES_PCA9635 is not set
+# CONFIG_EXAMPLES_PIPE is not set
+# CONFIG_EXAMPLES_POSIXSPAWN is not set
+# CONFIG_EXAMPLES_PPPD is not set
+# CONFIG_EXAMPLES_RFID_READUID is not set
+# CONFIG_EXAMPLES_RGBLED is not set
+# CONFIG_EXAMPLES_RGMP is not set
+# CONFIG_EXAMPLES_SENDMAIL is not set
+# CONFIG_EXAMPLES_SERIALBLASTER is not set
+# CONFIG_EXAMPLES_SERIALRX is not set
+# CONFIG_EXAMPLES_SERLOOP is not set
+# CONFIG_EXAMPLES_SLCD is not set
+# CONFIG_EXAMPLES_SMART is not set
+# CONFIG_EXAMPLES_SMART_TEST is not set
+# CONFIG_EXAMPLES_SMP is not set
+# CONFIG_EXAMPLES_TCPECHO is not set
+# CONFIG_EXAMPLES_TELNETD is not set
+# CONFIG_EXAMPLES_TIFF is not set
+# CONFIG_EXAMPLES_TOUCHSCREEN is not set
+# CONFIG_EXAMPLES_UDGRAM is not set
+# CONFIG_EXAMPLES_USBSERIAL is not set
+# CONFIG_EXAMPLES_USBTERM is not set
+# CONFIG_EXAMPLES_USTREAM is not set
+# CONFIG_EXAMPLES_WATCHDOG is not set
+# CONFIG_EXAMPLES_WEBSERVER is not set
+# CONFIG_EXAMPLES_XMLRPC is not set
+
+#
+# File System Utilities
+#
+# CONFIG_FSUTILS_INIFILE is not set
+# CONFIG_FSUTILS_PASSWD is not set
+
+#
+# GPS Utilities
+#
+# CONFIG_GPSUTILS_MINMEA_LIB is not set
+
+#
+# Graphics Support
+#
+# CONFIG_TIFF is not set
+# CONFIG_GRAPHICS_TRAVELER is not set
+
+#
+# Interpreters
+#
+# CONFIG_INTERPRETERS_BAS is not set
+# CONFIG_INTERPRETERS_FICL is not set
+# CONFIG_INTERPRETERS_MICROPYTHON is not set
+# CONFIG_INTERPRETERS_MINIBASIC is not set
+# CONFIG_INTERPRETERS_PCODE is not set
+
+#
+# FreeModBus
+#
+# CONFIG_MODBUS is not set
+
+#
+# Network Utilities
+#
+# CONFIG_NETUTILS_CHAT is not set
+# CONFIG_NETUTILS_CODECS is not set
+# CONFIG_NETUTILS_ESP8266 is not set
+# CONFIG_NETUTILS_FTPC is not set
+# CONFIG_NETUTILS_FTPD is not set
+# CONFIG_NETUTILS_JSON is not set
+CONFIG_NETUTILS_NETLIB=y
+# CONFIG_NETUTILS_SMTP is not set
+# CONFIG_NETUTILS_TELNETD is not set
+# CONFIG_NETUTILS_WEBCLIENT is not set
+# CONFIG_NETUTILS_WEBSERVER is not set
+# CONFIG_NETUTILS_XMLRPC is not set
+
+#
+# NSH Library
+#
+CONFIG_NSH_LIBRARY=y
+# CONFIG_NSH_MOTD is not set
+
+#
+# Command Line Configuration
+#
+CONFIG_NSH_READLINE=y
+# CONFIG_NSH_CLE is not set
+CONFIG_NSH_LINELEN=64
+# CONFIG_NSH_DISABLE_SEMICOLON is not set
+CONFIG_NSH_CMDPARMS=y
+CONFIG_NSH_MAXARGUMENTS=6
+CONFIG_NSH_ARGCAT=y
+CONFIG_NSH_NESTDEPTH=3
+# CONFIG_NSH_DISABLEBG is not set
+CONFIG_NSH_BUILTIN_APPS=y
+
+#
+# Disable Individual commands
+#
+# CONFIG_NSH_DISABLE_ADDROUTE is not set
+# CONFIG_NSH_DISABLE_ARP is not set
+# CONFIG_NSH_DISABLE_BASENAME is not set
+# CONFIG_NSH_DISABLE_CAT is not set
+# CONFIG_NSH_DISABLE_CD is not set
+# CONFIG_NSH_DISABLE_CP is not set
+# CONFIG_NSH_DISABLE_CMP is not set
+CONFIG_NSH_DISABLE_DATE=y
+# CONFIG_NSH_DISABLE_DD is not set
+# CONFIG_NSH_DISABLE_DF is not set
+# CONFIG_NSH_DISABLE_DELROUTE is not set
+# CONFIG_NSH_DISABLE_DIRNAME is not set
+# CONFIG_NSH_DISABLE_ECHO is not set
+# CONFIG_NSH_DISABLE_EXEC is not set
+# CONFIG_NSH_DISABLE_EXIT is not set
+# CONFIG_NSH_DISABLE_FREE is not set
+# CONFIG_NSH_DISABLE_GET is not set
+# CONFIG_NSH_DISABLE_HELP is not set
+# CONFIG_NSH_DISABLE_HEXDUMP is not set
+# CONFIG_NSH_DISABLE_IFCONFIG is not set
+# CONFIG_NSH_DISABLE_IFUPDOWN is not set
+# CONFIG_NSH_DISABLE_KILL is not set
+# CONFIG_NSH_DISABLE_LOSETUP is not set
+CONFIG_NSH_DISABLE_LOSMART=y
+# CONFIG_NSH_DISABLE_LS is not set
+# CONFIG_NSH_DISABLE_MB is not set
+# CONFIG_NSH_DISABLE_MKDIR is not set
+# CONFIG_NSH_DISABLE_MKFATFS is not set
+# CONFIG_NSH_DISABLE_MKFIFO is not set
+# CONFIG_NSH_DISABLE_MKRD is not set
+# CONFIG_NSH_DISABLE_MH is not set
+# CONFIG_NSH_DISABLE_MOUNT is not set
+# CONFIG_NSH_DISABLE_MV is not set
+# CONFIG_NSH_DISABLE_MW is not set
+CONFIG_NSH_DISABLE_PRINTF=y
+# CONFIG_NSH_DISABLE_PS is not set
+# CONFIG_NSH_DISABLE_PUT is not set
+# CONFIG_NSH_DISABLE_PWD is not set
+# CONFIG_NSH_DISABLE_RM is not set
+# CONFIG_NSH_DISABLE_RMDIR is not set
+# CONFIG_NSH_DISABLE_SET is not set
+# CONFIG_NSH_DISABLE_SH is not set
+# CONFIG_NSH_DISABLE_SLEEP is not set
+# CONFIG_NSH_DISABLE_TIME is not set
+# CONFIG_NSH_DISABLE_TEST is not set
+# CONFIG_NSH_DISABLE_UMOUNT is not set
+# CONFIG_NSH_DISABLE_UNAME is not set
+# CONFIG_NSH_DISABLE_UNSET is not set
+# CONFIG_NSH_DISABLE_USLEEP is not set
+# CONFIG_NSH_DISABLE_WGET is not set
+# CONFIG_NSH_DISABLE_XD is not set
+CONFIG_NSH_MMCSDMINOR=0
+CONFIG_NSH_MMCSDSLOTNO=0
+CONFIG_NSH_MMCSDSPIPORTNO=0
+
+#
+# Configure Command Options
+#
+CONFIG_NSH_CMDOPT_DF_H=y
+CONFIG_NSH_CODECS_BUFSIZE=128
+CONFIG_NSH_CMDOPT_HEXDUMP=y
+CONFIG_NSH_PROC_MOUNTPOINT="/proc"
+CONFIG_NSH_FILEIOSIZE=512
+
+#
+# Scripting Support
+#
+# CONFIG_NSH_DISABLESCRIPT is not set
+# CONFIG_NSH_DISABLE_ITEF is not set
+# CONFIG_NSH_DISABLE_LOOPS is not set
+
+#
+# Console Configuration
+#
+CONFIG_NSH_CONSOLE=y
+# CONFIG_NSH_USBCONSOLE is not set
+# CONFIG_NSH_ALTCONDEV is not set
+CONFIG_NSH_ARCHINIT=y
+
+#
+# Networking Configuration
+#
+CONFIG_NSH_NETINIT=y
+# CONFIG_NSH_NETINIT_THREAD is not set
+
+#
+# IP Address Configuration
+#
+
+#
+# IPv4 Addresses
+#
+CONFIG_NSH_IPADDR=0x0a000002
+CONFIG_NSH_DRIPADDR=0x0a000001
+CONFIG_NSH_NETMASK=0xffffff00
+# CONFIG_NSH_NOMAC is not set
+CONFIG_NSH_MAX_ROUNDTRIP=20
+# CONFIG_NSH_LOGIN is not set
+# CONFIG_NSH_CONSOLE_LOGIN is not set
+
+#
+# NxWidgets/NxWM
+#
+
+#
+# Platform-specific Support
+#
+# CONFIG_PLATFORM_CONFIGDATA is not set
+
+#
+# System Libraries and NSH Add-Ons
+#
+# CONFIG_SYSTEM_CDCACM is not set
+# CONFIG_SYSTEM_CLE is not set
+# CONFIG_SYSTEM_CUTERM is not set
+# CONFIG_SYSTEM_FREE is not set
+# CONFIG_SYSTEM_HEX2BIN is not set
+# CONFIG_SYSTEM_HEXED is not set
+# CONFIG_SYSTEM_INSTALL is not set
+CONFIG_IOTJS=y
+CONFIG_IOTJS_PRIORITY=100
+CONFIG_IOTJS_STACKSIZE=16384
+CONFIG_IOTJS_HEAPSIZE=107520
+# CONFIG_SYSTEM_NETDB is not set
+# CONFIG_SYSTEM_RAMTEST is not set
+CONFIG_READLINE_HAVE_EXTMATCH=y
+CONFIG_SYSTEM_READLINE=y
+CONFIG_READLINE_ECHO=y
+CONFIG_READLINE_TABCOMPLETION=y
+CONFIG_READLINE_MAX_BUILTINS=64
+CONFIG_READLINE_MAX_EXTCMDS=64
+CONFIG_READLINE_CMD_HISTORY=y
+CONFIG_READLINE_CMD_HISTORY_LINELEN=80
+CONFIG_READLINE_CMD_HISTORY_LEN=16
+# CONFIG_SYSTEM_SUDOKU is not set
+# CONFIG_SYSTEM_SYSTEM is not set
+# CONFIG_SYSTEM_TEE is not set
+# CONFIG_SYSTEM_UBLOXMODEM is not set
+# CONFIG_SYSTEM_VI is not set
+# CONFIG_SYSTEM_ZMODEM is not set
diff --git a/config/nuttx/stm32f4dis/.config.travis b/config/nuttx/stm32f4dis/.config.travis
new file mode 100644 (file)
index 0000000..2079a4a
--- /dev/null
@@ -0,0 +1,1522 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Nuttx/ Configuration
+#
+
+#
+# Build Setup
+#
+# CONFIG_EXPERIMENTAL is not set
+# CONFIG_DEFAULT_SMALL is not set
+CONFIG_HOST_LINUX=y
+# CONFIG_HOST_OSX is not set
+# CONFIG_HOST_WINDOWS is not set
+# CONFIG_HOST_OTHER is not set
+
+#
+# Build Configuration
+#
+CONFIG_APPS_DIR="../apps"
+CONFIG_BUILD_FLAT=y
+# CONFIG_BUILD_2PASS is not set
+
+#
+# Binary Output Formats
+#
+# CONFIG_RRLOAD_BINARY is not set
+CONFIG_INTELHEX_BINARY=y
+# CONFIG_MOTOROLA_SREC is not set
+CONFIG_RAW_BINARY=y
+# CONFIG_UBOOT_UIMAGE is not set
+
+#
+# Customize Header Files
+#
+# CONFIG_ARCH_STDINT_H is not set
+# CONFIG_ARCH_STDBOOL_H is not set
+# CONFIG_ARCH_MATH_H is not set
+# CONFIG_ARCH_FLOAT_H is not set
+# CONFIG_ARCH_STDARG_H is not set
+# CONFIG_ARCH_DEBUG_H is not set
+
+#
+# Debug Options
+#
+CONFIG_DEBUG_ALERT=y
+# CONFIG_DEBUG_FEATURES is not set
+CONFIG_ARCH_HAVE_STACKCHECK=y
+# CONFIG_STACK_COLORATION is not set
+CONFIG_ARCH_HAVE_HEAPCHECK=y
+# CONFIG_HEAP_COLORATION is not set
+# CONFIG_DEBUG_SYMBOLS is not set
+CONFIG_ARCH_HAVE_CUSTOMOPT=y
+# CONFIG_DEBUG_NOOPT is not set
+# CONFIG_DEBUG_CUSTOMOPT is not set
+CONFIG_DEBUG_FULLOPT=y
+
+#
+# System Type
+#
+CONFIG_ARCH_ARM=y
+# CONFIG_ARCH_AVR is not set
+# CONFIG_ARCH_HC is not set
+# CONFIG_ARCH_MIPS is not set
+# CONFIG_ARCH_MISOC is not set
+# CONFIG_ARCH_RENESAS is not set
+# CONFIG_ARCH_RISCV is not set
+# CONFIG_ARCH_SIM is not set
+# CONFIG_ARCH_X86 is not set
+# CONFIG_ARCH_XTENSA is not set
+# CONFIG_ARCH_Z16 is not set
+# CONFIG_ARCH_Z80 is not set
+CONFIG_ARCH="arm"
+
+#
+# ARM Options
+#
+# CONFIG_ARCH_CHIP_A1X is not set
+# CONFIG_ARCH_CHIP_C5471 is not set
+# CONFIG_ARCH_CHIP_DM320 is not set
+# CONFIG_ARCH_CHIP_EFM32 is not set
+# CONFIG_ARCH_CHIP_IMX1 is not set
+# CONFIG_ARCH_CHIP_IMX6 is not set
+# CONFIG_ARCH_CHIP_KINETIS is not set
+# CONFIG_ARCH_CHIP_KL is not set
+# CONFIG_ARCH_CHIP_LM is not set
+# CONFIG_ARCH_CHIP_TIVA is not set
+# CONFIG_ARCH_CHIP_LPC11XX is not set
+# CONFIG_ARCH_CHIP_LPC17XX is not set
+# CONFIG_ARCH_CHIP_LPC214X is not set
+# CONFIG_ARCH_CHIP_LPC2378 is not set
+# CONFIG_ARCH_CHIP_LPC31XX is not set
+# CONFIG_ARCH_CHIP_LPC43XX is not set
+# CONFIG_ARCH_CHIP_NUC1XX is not set
+# CONFIG_ARCH_CHIP_SAMA5 is not set
+# CONFIG_ARCH_CHIP_SAMD is not set
+# CONFIG_ARCH_CHIP_SAML is not set
+# CONFIG_ARCH_CHIP_SAM34 is not set
+# CONFIG_ARCH_CHIP_SAMV7 is not set
+CONFIG_ARCH_CHIP_STM32=y
+# CONFIG_ARCH_CHIP_STM32F7 is not set
+# CONFIG_ARCH_CHIP_STM32L4 is not set
+# CONFIG_ARCH_CHIP_STR71X is not set
+# CONFIG_ARCH_CHIP_TMS570 is not set
+# CONFIG_ARCH_CHIP_MOXART is not set
+# CONFIG_ARCH_ARM7TDMI is not set
+# CONFIG_ARCH_ARM926EJS is not set
+# CONFIG_ARCH_ARM920T is not set
+# CONFIG_ARCH_CORTEXM0 is not set
+# CONFIG_ARCH_CORTEXM3 is not set
+CONFIG_ARCH_CORTEXM4=y
+# CONFIG_ARCH_CORTEXM7 is not set
+# CONFIG_ARCH_CORTEXA5 is not set
+# CONFIG_ARCH_CORTEXA8 is not set
+# CONFIG_ARCH_CORTEXA9 is not set
+# CONFIG_ARCH_CORTEXR4 is not set
+# CONFIG_ARCH_CORTEXR4F is not set
+# CONFIG_ARCH_CORTEXR5 is not set
+# CONFIG_ARCH_CORTEX5F is not set
+# CONFIG_ARCH_CORTEXR7 is not set
+# CONFIG_ARCH_CORTEXR7F is not set
+CONFIG_ARCH_FAMILY="armv7-m"
+CONFIG_ARCH_CHIP="stm32"
+# CONFIG_ARM_TOOLCHAIN_IAR is not set
+CONFIG_ARM_TOOLCHAIN_GNU=y
+# CONFIG_ARMV7M_USEBASEPRI is not set
+CONFIG_ARCH_HAVE_CMNVECTOR=y
+# CONFIG_ARMV7M_CMNVECTOR is not set
+# CONFIG_ARMV7M_LAZYFPU is not set
+CONFIG_ARCH_HAVE_FPU=y
+# CONFIG_ARCH_HAVE_DPFPU is not set
+CONFIG_ARCH_FPU=y
+# CONFIG_ARCH_HAVE_TRUSTZONE is not set
+CONFIG_ARM_HAVE_MPU_UNIFIED=y
+# CONFIG_ARM_MPU is not set
+
+#
+# ARMV7M Configuration Options
+#
+# CONFIG_ARMV7M_HAVE_ICACHE is not set
+# CONFIG_ARMV7M_HAVE_DCACHE is not set
+# CONFIG_ARMV7M_HAVE_ITCM is not set
+# CONFIG_ARMV7M_HAVE_DTCM is not set
+# CONFIG_ARMV7M_TOOLCHAIN_IARL is not set
+# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set
+# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set
+# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set
+CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y
+CONFIG_ARMV7M_HAVE_STACKCHECK=y
+# CONFIG_ARMV7M_STACKCHECK is not set
+# CONFIG_ARMV7M_ITMSYSLOG is not set
+# CONFIG_SERIAL_TERMIOS is not set
+# CONFIG_SDIO_DMA is not set
+# CONFIG_SDIO_WIDTH_D1_ONLY is not set
+
+#
+# STM32 Configuration Options
+#
+# CONFIG_ARCH_CHIP_STM32L151C6 is not set
+# CONFIG_ARCH_CHIP_STM32L151C8 is not set
+# CONFIG_ARCH_CHIP_STM32L151CB is not set
+# CONFIG_ARCH_CHIP_STM32L151R6 is not set
+# CONFIG_ARCH_CHIP_STM32L151R8 is not set
+# CONFIG_ARCH_CHIP_STM32L151RB is not set
+# CONFIG_ARCH_CHIP_STM32L151V6 is not set
+# CONFIG_ARCH_CHIP_STM32L151V8 is not set
+# CONFIG_ARCH_CHIP_STM32L151VB is not set
+# CONFIG_ARCH_CHIP_STM32L152C6 is not set
+# CONFIG_ARCH_CHIP_STM32L152C8 is not set
+# CONFIG_ARCH_CHIP_STM32L152CB is not set
+# CONFIG_ARCH_CHIP_STM32L152R6 is not set
+# CONFIG_ARCH_CHIP_STM32L152R8 is not set
+# CONFIG_ARCH_CHIP_STM32L152RB is not set
+# CONFIG_ARCH_CHIP_STM32L152V6 is not set
+# CONFIG_ARCH_CHIP_STM32L152V8 is not set
+# CONFIG_ARCH_CHIP_STM32L152VB is not set
+# CONFIG_ARCH_CHIP_STM32L162ZD is not set
+# CONFIG_ARCH_CHIP_STM32L162VE is not set
+# CONFIG_ARCH_CHIP_STM32F100C8 is not set
+# CONFIG_ARCH_CHIP_STM32F100CB is not set
+# CONFIG_ARCH_CHIP_STM32F100R8 is not set
+# CONFIG_ARCH_CHIP_STM32F100RB is not set
+# CONFIG_ARCH_CHIP_STM32F100RC is not set
+# CONFIG_ARCH_CHIP_STM32F100RD is not set
+# CONFIG_ARCH_CHIP_STM32F100RE is not set
+# CONFIG_ARCH_CHIP_STM32F100V8 is not set
+# CONFIG_ARCH_CHIP_STM32F100VB is not set
+# CONFIG_ARCH_CHIP_STM32F100VC is not set
+# CONFIG_ARCH_CHIP_STM32F100VD is not set
+# CONFIG_ARCH_CHIP_STM32F100VE is not set
+# CONFIG_ARCH_CHIP_STM32F102CB is not set
+# CONFIG_ARCH_CHIP_STM32F103T8 is not set
+# CONFIG_ARCH_CHIP_STM32F103TB is not set
+# CONFIG_ARCH_CHIP_STM32F103C4 is not set
+# CONFIG_ARCH_CHIP_STM32F103C8 is not set
+# CONFIG_ARCH_CHIP_STM32F103CB is not set
+# CONFIG_ARCH_CHIP_STM32F103R8 is not set
+# CONFIG_ARCH_CHIP_STM32F103RB is not set
+# CONFIG_ARCH_CHIP_STM32F103RC is not set
+# CONFIG_ARCH_CHIP_STM32F103RD is not set
+# CONFIG_ARCH_CHIP_STM32F103RE is not set
+# CONFIG_ARCH_CHIP_STM32F103RG is not set
+# CONFIG_ARCH_CHIP_STM32F103V8 is not set
+# CONFIG_ARCH_CHIP_STM32F103VB is not set
+# CONFIG_ARCH_CHIP_STM32F103VC is not set
+# CONFIG_ARCH_CHIP_STM32F103VE is not set
+# CONFIG_ARCH_CHIP_STM32F103ZE is not set
+# CONFIG_ARCH_CHIP_STM32F105VB is not set
+# CONFIG_ARCH_CHIP_STM32F105RB is not set
+# CONFIG_ARCH_CHIP_STM32F107VC is not set
+# CONFIG_ARCH_CHIP_STM32F205RG is not set
+# CONFIG_ARCH_CHIP_STM32F207IG is not set
+# CONFIG_ARCH_CHIP_STM32F207ZE is not set
+# CONFIG_ARCH_CHIP_STM32F302K6 is not set
+# CONFIG_ARCH_CHIP_STM32F302K8 is not set
+# CONFIG_ARCH_CHIP_STM32F302CB is not set
+# CONFIG_ARCH_CHIP_STM32F302CC is not set
+# CONFIG_ARCH_CHIP_STM32F302RB is not set
+# CONFIG_ARCH_CHIP_STM32F302RC is not set
+# CONFIG_ARCH_CHIP_STM32F302VB is not set
+# CONFIG_ARCH_CHIP_STM32F302VC is not set
+# CONFIG_ARCH_CHIP_STM32F303K6 is not set
+# CONFIG_ARCH_CHIP_STM32F303K8 is not set
+# CONFIG_ARCH_CHIP_STM32F303C6 is not set
+# CONFIG_ARCH_CHIP_STM32F303C8 is not set
+# CONFIG_ARCH_CHIP_STM32F303CB is not set
+# CONFIG_ARCH_CHIP_STM32F303CC is not set
+# CONFIG_ARCH_CHIP_STM32F303RB is not set
+# CONFIG_ARCH_CHIP_STM32F303RC is not set
+# CONFIG_ARCH_CHIP_STM32F303RD is not set
+# CONFIG_ARCH_CHIP_STM32F303RE is not set
+# CONFIG_ARCH_CHIP_STM32F303VB is not set
+# CONFIG_ARCH_CHIP_STM32F303VC is not set
+# CONFIG_ARCH_CHIP_STM32F372C8 is not set
+# CONFIG_ARCH_CHIP_STM32F372R8 is not set
+# CONFIG_ARCH_CHIP_STM32F372V8 is not set
+# CONFIG_ARCH_CHIP_STM32F372CB is not set
+# CONFIG_ARCH_CHIP_STM32F372RB is not set
+# CONFIG_ARCH_CHIP_STM32F372VB is not set
+# CONFIG_ARCH_CHIP_STM32F372CC is not set
+# CONFIG_ARCH_CHIP_STM32F372RC is not set
+# CONFIG_ARCH_CHIP_STM32F372VC is not set
+# CONFIG_ARCH_CHIP_STM32F373C8 is not set
+# CONFIG_ARCH_CHIP_STM32F373R8 is not set
+# CONFIG_ARCH_CHIP_STM32F373V8 is not set
+# CONFIG_ARCH_CHIP_STM32F373CB is not set
+# CONFIG_ARCH_CHIP_STM32F373RB is not set
+# CONFIG_ARCH_CHIP_STM32F373VB is not set
+# CONFIG_ARCH_CHIP_STM32F373CC is not set
+# CONFIG_ARCH_CHIP_STM32F373RC is not set
+# CONFIG_ARCH_CHIP_STM32F373VC is not set
+# CONFIG_ARCH_CHIP_STM32F401RE is not set
+# CONFIG_ARCH_CHIP_STM32F411RE is not set
+# CONFIG_ARCH_CHIP_STM32F411VE is not set
+# CONFIG_ARCH_CHIP_STM32F405RG is not set
+# CONFIG_ARCH_CHIP_STM32F405VG is not set
+# CONFIG_ARCH_CHIP_STM32F405ZG is not set
+# CONFIG_ARCH_CHIP_STM32F407VE is not set
+CONFIG_ARCH_CHIP_STM32F407VG=y
+# CONFIG_ARCH_CHIP_STM32F407ZE is not set
+# CONFIG_ARCH_CHIP_STM32F407ZG is not set
+# CONFIG_ARCH_CHIP_STM32F407IE is not set
+# CONFIG_ARCH_CHIP_STM32F407IG is not set
+# CONFIG_ARCH_CHIP_STM32F427V is not set
+# CONFIG_ARCH_CHIP_STM32F427Z is not set
+# CONFIG_ARCH_CHIP_STM32F427I is not set
+# CONFIG_ARCH_CHIP_STM32F429V is not set
+# CONFIG_ARCH_CHIP_STM32F429Z is not set
+# CONFIG_ARCH_CHIP_STM32F429I is not set
+# CONFIG_ARCH_CHIP_STM32F429B is not set
+# CONFIG_ARCH_CHIP_STM32F429N is not set
+# CONFIG_ARCH_CHIP_STM32F446M is not set
+# CONFIG_ARCH_CHIP_STM32F446R is not set
+# CONFIG_ARCH_CHIP_STM32F446V is not set
+# CONFIG_ARCH_CHIP_STM32F446Z is not set
+# CONFIG_ARCH_CHIP_STM32F469A is not set
+# CONFIG_ARCH_CHIP_STM32F469I is not set
+# CONFIG_ARCH_CHIP_STM32F469B is not set
+# CONFIG_ARCH_CHIP_STM32F469N is not set
+CONFIG_STM32_FLASH_CONFIG_DEFAULT=y
+# CONFIG_STM32_FLASH_CONFIG_4 is not set
+# CONFIG_STM32_FLASH_CONFIG_6 is not set
+# CONFIG_STM32_FLASH_CONFIG_8 is not set
+# CONFIG_STM32_FLASH_CONFIG_B is not set
+# CONFIG_STM32_FLASH_CONFIG_C is not set
+# CONFIG_STM32_FLASH_CONFIG_D is not set
+# CONFIG_STM32_FLASH_CONFIG_E is not set
+# CONFIG_STM32_FLASH_CONFIG_F is not set
+# CONFIG_STM32_FLASH_CONFIG_G is not set
+# CONFIG_STM32_FLASH_CONFIG_I is not set
+# CONFIG_STM32_STM32L15XX is not set
+# CONFIG_STM32_ENERGYLITE is not set
+# CONFIG_STM32_STM32F10XX is not set
+# CONFIG_STM32_VALUELINE is not set
+# CONFIG_STM32_CONNECTIVITYLINE is not set
+# CONFIG_STM32_PERFORMANCELINE is not set
+# CONFIG_STM32_USBACCESSLINE is not set
+# CONFIG_STM32_HIGHDENSITY is not set
+# CONFIG_STM32_MEDIUMDENSITY is not set
+# CONFIG_STM32_LOWDENSITY is not set
+# CONFIG_STM32_STM32F20XX is not set
+# CONFIG_STM32_STM32F205 is not set
+# CONFIG_STM32_STM32F207 is not set
+# CONFIG_STM32_STM32F30XX is not set
+# CONFIG_STM32_STM32F302 is not set
+# CONFIG_STM32_STM32F303 is not set
+# CONFIG_STM32_STM32F37XX is not set
+CONFIG_STM32_STM32F40XX=y
+# CONFIG_STM32_STM32F401 is not set
+# CONFIG_STM32_STM32F411 is not set
+# CONFIG_STM32_STM32F405 is not set
+CONFIG_STM32_STM32F407=y
+# CONFIG_STM32_STM32F427 is not set
+# CONFIG_STM32_STM32F429 is not set
+# CONFIG_STM32_STM32F446 is not set
+# CONFIG_STM32_STM32F469 is not set
+# CONFIG_STM32_DFU is not set
+
+#
+# STM32 Peripheral Support
+#
+CONFIG_STM32_HAVE_CCM=y
+# CONFIG_STM32_HAVE_USBDEV is not set
+CONFIG_STM32_HAVE_OTGFS=y
+CONFIG_STM32_HAVE_FSMC=y
+# CONFIG_STM32_HAVE_LTDC is not set
+CONFIG_STM32_HAVE_USART3=y
+CONFIG_STM32_HAVE_UART4=y
+CONFIG_STM32_HAVE_UART5=y
+CONFIG_STM32_HAVE_USART6=y
+# CONFIG_STM32_HAVE_UART7 is not set
+# CONFIG_STM32_HAVE_UART8 is not set
+CONFIG_STM32_HAVE_TIM1=y
+CONFIG_STM32_HAVE_TIM2=y
+CONFIG_STM32_HAVE_TIM3=y
+CONFIG_STM32_HAVE_TIM4=y
+CONFIG_STM32_HAVE_TIM5=y
+CONFIG_STM32_HAVE_TIM6=y
+CONFIG_STM32_HAVE_TIM7=y
+CONFIG_STM32_HAVE_TIM8=y
+CONFIG_STM32_HAVE_TIM9=y
+CONFIG_STM32_HAVE_TIM10=y
+CONFIG_STM32_HAVE_TIM11=y
+CONFIG_STM32_HAVE_TIM12=y
+CONFIG_STM32_HAVE_TIM13=y
+CONFIG_STM32_HAVE_TIM14=y
+# CONFIG_STM32_HAVE_TIM15 is not set
+# CONFIG_STM32_HAVE_TIM16 is not set
+# CONFIG_STM32_HAVE_TIM17 is not set
+CONFIG_STM32_HAVE_ADC2=y
+CONFIG_STM32_HAVE_ADC3=y
+# CONFIG_STM32_HAVE_ADC4 is not set
+# CONFIG_STM32_HAVE_ADC1_DMA is not set
+# CONFIG_STM32_HAVE_ADC2_DMA is not set
+# CONFIG_STM32_HAVE_ADC3_DMA is not set
+# CONFIG_STM32_HAVE_ADC4_DMA is not set
+# CONFIG_STM32_HAVE_SDADC1 is not set
+# CONFIG_STM32_HAVE_SDADC2 is not set
+# CONFIG_STM32_HAVE_SDADC3 is not set
+# CONFIG_STM32_HAVE_SDADC1_DMA is not set
+# CONFIG_STM32_HAVE_SDADC2_DMA is not set
+# CONFIG_STM32_HAVE_SDADC3_DMA is not set
+CONFIG_STM32_HAVE_CAN1=y
+CONFIG_STM32_HAVE_CAN2=y
+CONFIG_STM32_HAVE_DAC1=y
+CONFIG_STM32_HAVE_DAC2=y
+CONFIG_STM32_HAVE_RNG=y
+CONFIG_STM32_HAVE_ETHMAC=y
+CONFIG_STM32_HAVE_I2C2=y
+CONFIG_STM32_HAVE_I2C3=y
+CONFIG_STM32_HAVE_SPI2=y
+CONFIG_STM32_HAVE_SPI3=y
+# CONFIG_STM32_HAVE_SPI4 is not set
+# CONFIG_STM32_HAVE_SPI5 is not set
+# CONFIG_STM32_HAVE_SPI6 is not set
+# CONFIG_STM32_HAVE_SAIPLL is not set
+# CONFIG_STM32_HAVE_I2SPLL is not set
+CONFIG_STM32_ADC1=y
+# CONFIG_STM32_ADC2 is not set
+# CONFIG_STM32_ADC3 is not set
+# CONFIG_STM32_BKPSRAM is not set
+# CONFIG_STM32_CAN1 is not set
+# CONFIG_STM32_CAN2 is not set
+# CONFIG_STM32_CCMDATARAM is not set
+# CONFIG_STM32_CRC is not set
+# CONFIG_STM32_CRYP is not set
+# CONFIG_STM32_DMA1 is not set
+# CONFIG_STM32_DMA2 is not set
+# CONFIG_STM32_DAC1 is not set
+# CONFIG_STM32_DAC2 is not set
+# CONFIG_STM32_DCMI is not set
+# CONFIG_STM32_ETHMAC is not set
+# CONFIG_STM32_FSMC is not set
+# CONFIG_STM32_HASH is not set
+CONFIG_STM32_I2C1=y
+# CONFIG_STM32_I2C2 is not set
+# CONFIG_STM32_I2C3 is not set
+CONFIG_STM32_OTGFS=y
+# CONFIG_STM32_OTGHS is not set
+CONFIG_STM32_PWR=y
+# CONFIG_STM32_RNG is not set
+CONFIG_STM32_SDIO=y
+CONFIG_STM32_SPI1=y
+# CONFIG_STM32_SPI2 is not set
+# CONFIG_STM32_SPI3 is not set
+CONFIG_STM32_SYSCFG=y
+CONFIG_STM32_TIM1=y
+# CONFIG_STM32_TIM2 is not set
+CONFIG_STM32_TIM3=y
+# CONFIG_STM32_TIM4 is not set
+# CONFIG_STM32_TIM5 is not set
+# CONFIG_STM32_TIM6 is not set
+# CONFIG_STM32_TIM7 is not set
+# CONFIG_STM32_TIM8 is not set
+# CONFIG_STM32_TIM9 is not set
+# CONFIG_STM32_TIM10 is not set
+# CONFIG_STM32_TIM11 is not set
+# CONFIG_STM32_TIM12 is not set
+# CONFIG_STM32_TIM13 is not set
+# CONFIG_STM32_TIM14 is not set
+# CONFIG_STM32_USART1 is not set
+CONFIG_STM32_USART2=y
+# CONFIG_STM32_USART3 is not set
+# CONFIG_STM32_UART4 is not set
+# CONFIG_STM32_UART5 is not set
+# CONFIG_STM32_USART6 is not set
+# CONFIG_STM32_IWDG is not set
+# CONFIG_STM32_WWDG is not set
+CONFIG_STM32_ADC=y
+CONFIG_STM32_SPI=y
+CONFIG_STM32_I2C=y
+# CONFIG_STM32_NOEXT_VECTORS is not set
+
+#
+# Alternate Pin Mapping
+#
+# CONFIG_STM32_FLASH_PREFETCH is not set
+# CONFIG_STM32_JTAG_DISABLE is not set
+# CONFIG_STM32_JTAG_FULL_ENABLE is not set
+# CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set
+CONFIG_STM32_JTAG_SW_ENABLE=y
+# CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG is not set
+# CONFIG_STM32_FORCEPOWER is not set
+# CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set
+# CONFIG_STM32_CCMEXCLUDE is not set
+
+#
+# Timer Configuration
+#
+# CONFIG_STM32_ONESHOT is not set
+# CONFIG_STM32_FREERUN is not set
+CONFIG_STM32_TIM1_PWM=y
+CONFIG_STM32_TIM1_MODE=0
+CONFIG_STM32_TIM1_CHANNEL=1
+CONFIG_STM32_TIM1_CHMODE=0
+# CONFIG_STM32_TIM3_PWM is not set
+# CONFIG_STM32_PWM_MULTICHAN is not set
+# CONFIG_STM32_TIM1_ADC is not set
+CONFIG_STM32_TIM3_ADC=y
+CONFIG_STM32_TIM3_ADC1=y
+CONFIG_HAVE_ADC1_TIMER=y
+CONFIG_STM32_ADC1_SAMPLE_FREQUENCY=100
+CONFIG_STM32_ADC1_TIMTRIG=0
+# CONFIG_STM32_TIM1_CAP is not set
+# CONFIG_STM32_TIM2_CAP is not set
+# CONFIG_STM32_TIM3_CAP is not set
+# CONFIG_STM32_TIM4_CAP is not set
+# CONFIG_STM32_TIM5_CAP is not set
+# CONFIG_STM32_TIM8_CAP is not set
+# CONFIG_STM32_TIM9_CAP is not set
+# CONFIG_STM32_TIM10_CAP is not set
+# CONFIG_STM32_TIM11_CAP is not set
+# CONFIG_STM32_TIM12_CAP is not set
+# CONFIG_STM32_TIM13_CAP is not set
+# CONFIG_STM32_TIM14_CAP is not set
+
+#
+# ADC Configuration
+#
+CONFIG_STM32_USART=y
+CONFIG_STM32_SERIALDRIVER=y
+
+#
+# U[S]ART Configuration
+#
+
+#
+# U[S]ART Device Configuration
+#
+CONFIG_STM32_USART2_SERIALDRIVER=y
+# CONFIG_STM32_USART2_1WIREDRIVER is not set
+# CONFIG_USART2_RS485 is not set
+
+#
+# Serial Driver Configuration
+#
+# CONFIG_SERIAL_DISABLE_REORDERING is not set
+# CONFIG_STM32_FLOWCONTROL_BROKEN is not set
+# CONFIG_STM32_USART_BREAKS is not set
+# CONFIG_STM32_USART_SINGLEWIRE is not set
+
+#
+# SPI Configuration
+#
+# CONFIG_STM32_SPI_INTERRUPTS is not set
+# CONFIG_STM32_SPI_DMA is not set
+
+#
+# I2C Configuration
+#
+# CONFIG_STM32_I2C_ALT is not set
+# CONFIG_STM32_I2C_DYNTIMEO is not set
+CONFIG_STM32_I2CTIMEOSEC=0
+CONFIG_STM32_I2CTIMEOMS=500
+CONFIG_STM32_I2CTIMEOTICKS=500
+# CONFIG_STM32_I2C_DUTY16_9 is not set
+
+#
+# SDIO Configuration
+#
+CONFIG_SDIO_DMAPRIO=0x00010000
+# CONFIG_STM32_HAVE_RTC_COUNTER is not set
+# CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set
+
+#
+# USB FS Host Configuration
+#
+
+#
+# USB HS Host Configuration
+#
+
+#
+# USB Host Debug Configuration
+#
+
+#
+# USB Device Configuration
+#
+
+#
+# Architecture Options
+#
+# CONFIG_ARCH_NOINTC is not set
+# CONFIG_ARCH_VECNOTIRQ is not set
+# CONFIG_ARCH_DMA is not set
+CONFIG_ARCH_HAVE_IRQPRIO=y
+# CONFIG_ARCH_L2CACHE is not set
+# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set
+# CONFIG_ARCH_HAVE_ADDRENV is not set
+# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set
+# CONFIG_ARCH_HAVE_MULTICPU is not set
+CONFIG_ARCH_HAVE_VFORK=y
+# CONFIG_ARCH_HAVE_MMU is not set
+CONFIG_ARCH_HAVE_MPU=y
+# CONFIG_ARCH_NAND_HWECC is not set
+# CONFIG_ARCH_HAVE_EXTCLK is not set
+# CONFIG_ARCH_HAVE_POWEROFF is not set
+CONFIG_ARCH_HAVE_RESET=y
+# CONFIG_ARCH_USE_MPU is not set
+# CONFIG_ARCH_IRQPRIO is not set
+CONFIG_ARCH_STACKDUMP=y
+# CONFIG_ENDIAN_BIG is not set
+# CONFIG_ARCH_IDLE_CUSTOM is not set
+# CONFIG_ARCH_HAVE_RAMFUNCS is not set
+CONFIG_ARCH_HAVE_RAMVECTORS=y
+# CONFIG_ARCH_RAMVECTORS is not set
+
+#
+# Board Settings
+#
+CONFIG_BOARD_LOOPSPERMSEC=16717
+# CONFIG_ARCH_CALIBRATION is not set
+
+#
+# Interrupt options
+#
+CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
+CONFIG_ARCH_INTERRUPTSTACK=0
+CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y
+# CONFIG_ARCH_HIPRI_INTERRUPT is not set
+
+#
+# Boot options
+#
+# CONFIG_BOOT_RUNFROMEXTSRAM is not set
+CONFIG_BOOT_RUNFROMFLASH=y
+# CONFIG_BOOT_RUNFROMISRAM is not set
+# CONFIG_BOOT_RUNFROMSDRAM is not set
+# CONFIG_BOOT_COPYTORAM is not set
+
+#
+# Boot Memory Configuration
+#
+CONFIG_RAM_START=0x20000000
+CONFIG_RAM_SIZE=114688
+# CONFIG_ARCH_HAVE_SDRAM is not set
+
+#
+# Board Selection
+#
+CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
+# CONFIG_ARCH_BOARD_MIKROE_STM32F4 is not set
+# CONFIG_ARCH_BOARD_CUSTOM is not set
+CONFIG_ARCH_BOARD="stm32f4discovery"
+
+#
+# Common Board Options
+#
+CONFIG_ARCH_HAVE_LEDS=y
+CONFIG_ARCH_LEDS=y
+CONFIG_ARCH_HAVE_BUTTONS=y
+CONFIG_ARCH_BUTTONS=y
+CONFIG_ARCH_HAVE_IRQBUTTONS=y
+# CONFIG_ARCH_IRQBUTTONS is not set
+
+#
+# Board-Specific Options
+#
+# CONFIG_STM32F4DISBB is not set
+# CONFIG_BOARD_CRASHDUMP is not set
+CONFIG_LIB_BOARDCTL=y
+# CONFIG_BOARDCTL_RESET is not set
+# CONFIG_BOARDCTL_UNIQUEID is not set
+CONFIG_BOARDCTL_USBDEVCTRL=y
+# CONFIG_BOARDCTL_TSCTEST is not set
+# CONFIG_BOARDCTL_GRAPHICS is not set
+# CONFIG_BOARDCTL_IOCTL is not set
+
+#
+# RTOS Features
+#
+CONFIG_DISABLE_OS_API=y
+# CONFIG_DISABLE_POSIX_TIMERS is not set
+# CONFIG_DISABLE_PTHREAD is not set
+# CONFIG_DISABLE_SIGNALS is not set
+# CONFIG_DISABLE_MQUEUE is not set
+# CONFIG_DISABLE_ENVIRON is not set
+
+#
+# Clocks and Timers
+#
+CONFIG_ARCH_HAVE_TICKLESS=y
+# CONFIG_SCHED_TICKLESS is not set
+CONFIG_USEC_PER_TICK=10000
+# CONFIG_SYSTEM_TIME64 is not set
+CONFIG_CLOCK_MONOTONIC=y
+CONFIG_ARCH_HAVE_TIMEKEEPING=y
+# CONFIG_JULIAN_TIME is not set
+CONFIG_START_YEAR=2013
+CONFIG_START_MONTH=1
+CONFIG_START_DAY=27
+CONFIG_MAX_WDOGPARMS=2
+CONFIG_PREALLOC_WDOGS=8
+CONFIG_WDOG_INTRESERVE=1
+CONFIG_PREALLOC_TIMERS=4
+
+#
+# Tasks and Scheduling
+#
+# CONFIG_SPINLOCK is not set
+# CONFIG_INIT_NONE is not set
+CONFIG_INIT_ENTRYPOINT=y
+# CONFIG_INIT_FILEPATH is not set
+CONFIG_USER_ENTRYPOINT="nsh_main"
+CONFIG_RR_INTERVAL=200
+# CONFIG_SCHED_SPORADIC is not set
+CONFIG_TASK_NAME_SIZE=31
+CONFIG_MAX_TASKS=16
+# CONFIG_SCHED_HAVE_PARENT is not set
+CONFIG_SCHED_WAITPID=y
+
+#
+# Pthread Options
+#
+CONFIG_MUTEX_TYPES=y
+CONFIG_NPTHREAD_KEYS=4
+# CONFIG_PTHREAD_CLEANUP is not set
+# CONFIG_CANCELLATION_POINTS is not set
+
+#
+# Performance Monitoring
+#
+# CONFIG_SCHED_CPULOAD is not set
+# CONFIG_SCHED_INSTRUMENTATION is not set
+
+#
+# Files and I/O
+#
+CONFIG_DEV_CONSOLE=y
+# CONFIG_FDCLONE_DISABLE is not set
+# CONFIG_FDCLONE_STDIO is not set
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_NFILE_DESCRIPTORS=8
+CONFIG_NFILE_STREAMS=8
+CONFIG_NAME_MAX=32
+# CONFIG_PRIORITY_INHERITANCE is not set
+
+#
+# RTOS hooks
+#
+# CONFIG_BOARD_INITIALIZE is not set
+# CONFIG_SCHED_STARTHOOK is not set
+# CONFIG_SCHED_ATEXIT is not set
+# CONFIG_SCHED_ONEXIT is not set
+# CONFIG_SIG_EVTHREAD is not set
+
+#
+# Signal Numbers
+#
+CONFIG_SIG_SIGUSR1=1
+CONFIG_SIG_SIGUSR2=2
+CONFIG_SIG_SIGALARM=3
+CONFIG_SIG_SIGCONDTIMEDOUT=16
+CONFIG_SIG_SIGWORK=17
+
+#
+# POSIX Message Queue Options
+#
+CONFIG_PREALLOC_MQ_MSGS=4
+CONFIG_MQ_MAXMSGSIZE=32
+# CONFIG_MODULE is not set
+
+#
+# Work queue support
+#
+CONFIG_SCHED_WORKQUEUE=y
+CONFIG_SCHED_HPWORK=y
+CONFIG_SCHED_HPWORKPRIORITY=224
+CONFIG_SCHED_HPWORKPERIOD=50000
+CONFIG_SCHED_HPWORKSTACKSIZE=2048
+# CONFIG_SCHED_LPWORK is not set
+
+#
+# Stack and heap information
+#
+CONFIG_IDLETHREAD_STACKSIZE=2048
+CONFIG_USERMAIN_STACKSIZE=2048
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=2048
+# CONFIG_LIB_SYSCALL is not set
+
+#
+# Device Drivers
+#
+# CONFIG_DISABLE_POLL is not set
+CONFIG_DEV_NULL=y
+# CONFIG_DEV_ZERO is not set
+# CONFIG_DEV_URANDOM is not set
+# CONFIG_DEV_LOOP is not set
+
+#
+# Buffering
+#
+# CONFIG_DRVR_WRITEBUFFER is not set
+# CONFIG_DRVR_READAHEAD is not set
+# CONFIG_RAMDISK is not set
+# CONFIG_CAN is not set
+CONFIG_ARCH_HAVE_PWM_PULSECOUNT=y
+# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set
+CONFIG_PWM=y
+# CONFIG_PWM_PULSECOUNT is not set
+CONFIG_ARCH_HAVE_I2CRESET=y
+CONFIG_I2C=y
+# CONFIG_I2C_SLAVE is not set
+# CONFIG_I2C_POLLED is not set
+# CONFIG_I2C_RESET is not set
+# CONFIG_I2C_TRACE is not set
+# CONFIG_I2C_DRIVER is not set
+CONFIG_SPI=y
+# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set
+# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set
+CONFIG_ARCH_HAVE_SPI_BITORDER=y
+# CONFIG_SPI_SLAVE is not set
+CONFIG_SPI_EXCHANGE=y
+# CONFIG_SPI_CMDDATA is not set
+# CONFIG_SPI_CALLBACK is not set
+# CONFIG_SPI_HWFEATURES is not set
+# CONFIG_SPI_BITORDER is not set
+# CONFIG_SPI_CS_DELAY_CONTROL is not set
+# CONFIG_SPI_DRIVER is not set
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_I2S is not set
+
+#
+# Timer Driver Support
+#
+# CONFIG_TIMER is not set
+# CONFIG_ONESHOT is not set
+# CONFIG_RTC is not set
+# CONFIG_WATCHDOG is not set
+# CONFIG_TIMERS_CS2100CP is not set
+CONFIG_ANALOG=y
+CONFIG_ADC=y
+CONFIG_ADC_FIFOSIZE=8
+# CONFIG_ADC_NO_STARTUP_CONV is not set
+# CONFIG_ADC_ADS1242 is not set
+# CONFIG_ADC_ADS125X is not set
+# CONFIG_ADC_PGA11X is not set
+# CONFIG_DAC is not set
+# CONFIG_AUDIO_DEVICES is not set
+# CONFIG_VIDEO_DEVICES is not set
+# CONFIG_BCH is not set
+# CONFIG_INPUT is not set
+
+#
+# IO Expander/GPIO Support
+#
+# CONFIG_IOEXPANDER is not set
+# CONFIG_DEV_GPIO is not set
+
+#
+# LCD Driver Support
+#
+# CONFIG_LCD is not set
+# CONFIG_SLCD is not set
+
+#
+# LED Support
+#
+# CONFIG_USERLED is not set
+# CONFIG_RGBLED is not set
+# CONFIG_PCA9635PW is not set
+# CONFIG_NCP5623C is not set
+CONFIG_MMCSD=y
+CONFIG_MMCSD_NSLOTS=1
+# CONFIG_MMCSD_READONLY is not set
+# CONFIG_MMCSD_MULTIBLOCK_DISABLE is not set
+CONFIG_MMCSD_MMCSUPPORT=y
+CONFIG_MMCSD_HAVECARDDETECT=y
+CONFIG_MMCSD_SPI=y
+CONFIG_MMCSD_SPICLOCK=20000000
+CONFIG_MMCSD_SPIMODE=0
+CONFIG_ARCH_HAVE_SDIO=y
+CONFIG_ARCH_HAVE_SDIOWAIT_WRCOMPLETE=y
+CONFIG_MMCSD_SDIO=y
+CONFIG_SDIO_PREFLIGHT=y
+# CONFIG_SDIO_MUXBUS is not set
+# CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE is not set
+# CONFIG_SDIO_BLOCKSETUP is not set
+# CONFIG_MODEM is not set
+# CONFIG_MTD is not set
+# CONFIG_EEPROM is not set
+CONFIG_NETDEVICES=y
+
+#
+# General Ethernet MAC Driver Options
+#
+# CONFIG_NETDEV_LOOPBACK is not set
+# CONFIG_NETDEV_TELNET is not set
+# CONFIG_NETDEV_MULTINIC is not set
+# CONFIG_ARCH_HAVE_NETDEV_STATISTICS is not set
+CONFIG_NETDEV_LATEINIT=y
+
+#
+# External Ethernet MAC Device Support
+#
+# CONFIG_NET_DM90x0 is not set
+# CONFIG_ENC28J60 is not set
+# CONFIG_ENCX24J600 is not set
+# CONFIG_NET_SLIP is not set
+# CONFIG_NET_FTMAC100 is not set
+CONFIG_PIPES=y
+CONFIG_DEV_PIPE_MAXSIZE=1024
+CONFIG_DEV_PIPE_SIZE=1024
+CONFIG_DEV_FIFO_SIZE=1024
+# CONFIG_PM is not set
+# CONFIG_POWER is not set
+# CONFIG_SENSORS is not set
+CONFIG_SERIAL=y
+# CONFIG_DEV_LOWCONSOLE is not set
+CONFIG_SERIAL_REMOVABLE=y
+# CONFIG_SERIAL_CONSOLE is not set
+# CONFIG_16550_UART is not set
+# CONFIG_UART_SERIALDRIVER is not set
+# CONFIG_UART0_SERIALDRIVER is not set
+# CONFIG_UART1_SERIALDRIVER is not set
+# CONFIG_UART2_SERIALDRIVER is not set
+# CONFIG_UART3_SERIALDRIVER is not set
+# CONFIG_UART4_SERIALDRIVER is not set
+# CONFIG_UART5_SERIALDRIVER is not set
+# CONFIG_UART6_SERIALDRIVER is not set
+# CONFIG_UART7_SERIALDRIVER is not set
+# CONFIG_UART8_SERIALDRIVER is not set
+# CONFIG_SCI0_SERIALDRIVER is not set
+# CONFIG_SCI1_SERIALDRIVER is not set
+# CONFIG_USART0_SERIALDRIVER is not set
+# CONFIG_USART1_SERIALDRIVER is not set
+CONFIG_USART2_SERIALDRIVER=y
+# CONFIG_USART3_SERIALDRIVER is not set
+# CONFIG_USART4_SERIALDRIVER is not set
+# CONFIG_USART5_SERIALDRIVER is not set
+# CONFIG_USART6_SERIALDRIVER is not set
+# CONFIG_USART7_SERIALDRIVER is not set
+# CONFIG_USART8_SERIALDRIVER is not set
+# CONFIG_OTHER_UART_SERIALDRIVER is not set
+CONFIG_MCU_SERIAL=y
+CONFIG_STANDARD_SERIAL=y
+CONFIG_SERIAL_NPOLLWAITERS=2
+# CONFIG_SERIAL_IFLOWCONTROL is not set
+# CONFIG_SERIAL_OFLOWCONTROL is not set
+# CONFIG_SERIAL_DMA is not set
+CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
+# CONFIG_USART2_SERIAL_CONSOLE is not set
+# CONFIG_OTHER_SERIAL_CONSOLE is not set
+CONFIG_NO_SERIAL_CONSOLE=y
+
+#
+# USART2 Configuration
+#
+CONFIG_USART2_RXBUFSIZE=256
+CONFIG_USART2_TXBUFSIZE=256
+CONFIG_USART2_BAUD=115200
+CONFIG_USART2_BITS=8
+CONFIG_USART2_PARITY=0
+CONFIG_USART2_2STOP=0
+# CONFIG_USART2_IFLOWCONTROL is not set
+# CONFIG_USART2_OFLOWCONTROL is not set
+# CONFIG_USART2_DMA is not set
+# CONFIG_PSEUDOTERM is not set
+CONFIG_USBDEV=y
+
+#
+# USB Device Controller Driver Options
+#
+# CONFIG_USBDEV_ISOCHRONOUS is not set
+# CONFIG_USBDEV_DUALSPEED is not set
+CONFIG_USBDEV_SELFPOWERED=y
+# CONFIG_USBDEV_BUSPOWERED is not set
+CONFIG_USBDEV_MAXPOWER=100
+# CONFIG_USBDEV_DMA is not set
+# CONFIG_ARCH_USBDEV_STALLQUEUE is not set
+# CONFIG_USBDEV_TRACE is not set
+
+#
+# USB Device Class Driver Options
+#
+# CONFIG_USBDEV_COMPOSITE is not set
+# CONFIG_PL2303 is not set
+CONFIG_CDCACM=y
+CONFIG_CDCACM_CONSOLE=y
+CONFIG_CDCACM_EP0MAXPACKET=64
+CONFIG_CDCACM_EPINTIN=1
+CONFIG_CDCACM_EPINTIN_FSSIZE=64
+CONFIG_CDCACM_EPINTIN_HSSIZE=64
+CONFIG_CDCACM_EPBULKOUT=3
+CONFIG_CDCACM_EPBULKOUT_FSSIZE=64
+CONFIG_CDCACM_EPBULKOUT_HSSIZE=512
+CONFIG_CDCACM_EPBULKIN=2
+CONFIG_CDCACM_EPBULKIN_FSSIZE=64
+CONFIG_CDCACM_EPBULKIN_HSSIZE=512
+CONFIG_CDCACM_NRDREQS=4
+CONFIG_CDCACM_NWRREQS=4
+CONFIG_CDCACM_BULKIN_REQLEN=96
+CONFIG_CDCACM_RXBUFSIZE=256
+CONFIG_CDCACM_TXBUFSIZE=256
+CONFIG_CDCACM_VENDORID=0x0525
+CONFIG_CDCACM_PRODUCTID=0xa4a7
+CONFIG_CDCACM_VENDORSTR="NuttX"
+CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial"
+# CONFIG_USBMSC is not set
+# CONFIG_USBHOST is not set
+# CONFIG_HAVE_USBTRACE is not set
+# CONFIG_DRIVERS_WIRELESS is not set
+# CONFIG_DRIVERS_CONTACTLESS is not set
+
+#
+# System Logging
+#
+# CONFIG_ARCH_SYSLOG is not set
+# CONFIG_RAMLOG is not set
+# CONFIG_SYSLOG_INTBUFFER is not set
+# CONFIG_SYSLOG_TIMESTAMP is not set
+# CONFIG_SYSLOG_SERIAL_CONSOLE is not set
+CONFIG_SYSLOG_CHAR=y
+# CONFIG_SYSLOG_CONSOLE is not set
+# CONFIG_SYSLOG_NONE is not set
+# CONFIG_SYSLOG_FILE is not set
+# CONFIG_CONSOLE_SYSLOG is not set
+CONFIG_SYSLOG_CHAR_CRLF=y
+CONFIG_SYSLOG_DEVPATH="/dev/ttyS0"
+# CONFIG_SYSLOG_CHARDEV is not set
+
+#
+# Networking Support
+#
+CONFIG_ARCH_HAVE_NET=y
+# CONFIG_ARCH_HAVE_PHY is not set
+CONFIG_NET=y
+# CONFIG_NET_PROMISCUOUS is not set
+
+#
+# Driver buffer configuration
+#
+CONFIG_NET_ETH_MTU=590
+CONFIG_NET_ETH_TCP_RECVWNDO=536
+CONFIG_NET_GUARDSIZE=2
+
+#
+# Data link support
+#
+# CONFIG_NET_MULTILINK is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_NET_LOOPBACK is not set
+# CONFIG_NET_TUN is not set
+
+#
+# Network Device Operations
+#
+# CONFIG_NETDEV_PHY_IOCTL is not set
+
+#
+# Internet Protocol Selection
+#
+CONFIG_NET_IPv4=y
+# CONFIG_NET_IPv6 is not set
+
+#
+# Socket Support
+#
+CONFIG_NSOCKET_DESCRIPTORS=8
+CONFIG_NET_NACTIVESOCKETS=16
+CONFIG_NET_SOCKOPTS=y
+# CONFIG_NET_SOLINGER is not set
+
+#
+# Raw Socket Support
+#
+# CONFIG_NET_PKT is not set
+
+#
+# Unix Domain Socket Support
+#
+CONFIG_NET_LOCAL=y
+CONFIG_NET_LOCAL_STREAM=y
+CONFIG_NET_LOCAL_DGRAM=y
+
+#
+# TCP/IP Networking
+#
+CONFIG_NET_TCP=y
+# CONFIG_NET_TCPURGDATA is not set
+CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_MAX_LISTENPORTS=20
+CONFIG_NET_TCP_READAHEAD=y
+CONFIG_NET_TCP_WRITE_BUFFERS=y
+CONFIG_NET_TCP_NWRBCHAINS=8
+CONFIG_NET_TCP_RECVDELAY=0
+# CONFIG_NET_TCPBACKLOG is not set
+# CONFIG_NET_SENDFILE is not set
+
+#
+# UDP Networking
+#
+# CONFIG_NET_UDP is not set
+
+#
+# ICMP Networking Support
+#
+# CONFIG_NET_ICMP is not set
+
+#
+# IGMPv2 Client Support
+#
+# CONFIG_NET_IGMP is not set
+
+#
+# ARP Configuration
+#
+CONFIG_NET_ARP=y
+CONFIG_NET_ARPTAB_SIZE=16
+CONFIG_NET_ARP_MAXAGE=120
+# CONFIG_NET_ARP_IPIN is not set
+# CONFIG_NET_ARP_SEND is not set
+
+#
+# Network I/O Buffer Support
+#
+CONFIG_NET_IOB=y
+CONFIG_IOB_NBUFFERS=36
+CONFIG_IOB_BUFSIZE=196
+CONFIG_IOB_NCHAINS=8
+CONFIG_IOB_THROTTLE=8
+# CONFIG_NET_ARCH_INCR32 is not set
+# CONFIG_NET_ARCH_CHKSUM is not set
+# CONFIG_NET_STATISTICS is not set
+
+#
+# Routing Table Configuration
+#
+# CONFIG_NET_ROUTE is not set
+CONFIG_NET_HOSTNAME=""
+
+#
+# Crypto API
+#
+# CONFIG_CRYPTO is not set
+
+#
+# File Systems
+#
+
+#
+# File system configuration
+#
+# CONFIG_DISABLE_MOUNTPOINT is not set
+# CONFIG_FS_AUTOMOUNTER is not set
+# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
+CONFIG_FS_READABLE=y
+CONFIG_FS_WRITABLE=y
+# CONFIG_FS_NAMED_SEMAPHORES is not set
+CONFIG_FS_MQUEUE_MPATH="/var/mqueue"
+# CONFIG_FS_RAMMAP is not set
+CONFIG_FS_FAT=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FAT_MAXFNAME=32
+# CONFIG_FS_FATTIME is not set
+# CONFIG_FAT_FORCE_INDIRECT is not set
+# CONFIG_FAT_DMAMEMORY is not set
+# CONFIG_FAT_DIRECT_RETRY is not set
+# CONFIG_FS_NXFFS is not set
+# CONFIG_FS_ROMFS is not set
+# CONFIG_FS_TMPFS is not set
+# CONFIG_FS_SMARTFS is not set
+# CONFIG_FS_BINFS is not set
+CONFIG_FS_PROCFS=y
+# CONFIG_FS_PROCFS_REGISTER is not set
+
+#
+# Exclude individual procfs entries
+#
+# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set
+# CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_NET is not set
+# CONFIG_FS_UNIONFS is not set
+
+#
+# Graphics Support
+#
+# CONFIG_NX is not set
+
+#
+# Memory Management
+#
+# CONFIG_MM_SMALL is not set
+CONFIG_MM_REGIONS=2
+# CONFIG_ARCH_HAVE_HEAP2 is not set
+# CONFIG_GRAN is not set
+
+#
+# Audio Support
+#
+# CONFIG_AUDIO is not set
+
+#
+# Wireless Support
+#
+
+#
+# Binary Loader
+#
+# CONFIG_BINFMT_DISABLE is not set
+# CONFIG_BINFMT_EXEPATH is not set
+# CONFIG_NXFLAT is not set
+# CONFIG_ELF is not set
+CONFIG_BUILTIN=y
+# CONFIG_PIC is not set
+# CONFIG_SYMTAB_ORDEREDBYNAME is not set
+
+#
+# Library Routines
+#
+
+#
+# Standard C Library Options
+#
+CONFIG_STDIO_BUFFER_SIZE=64
+CONFIG_STDIO_LINEBUFFER=y
+CONFIG_NUNGET_CHARS=2
+CONFIG_LIB_HOMEDIR="/"
+CONFIG_LIBM=y
+# CONFIG_NOPRINTF_FIELDWIDTH is not set
+# CONFIG_LIBC_FLOATINGPOINT is not set
+CONFIG_LIBC_LONG_LONG=y
+# CONFIG_LIBC_IOCTL_VARIADIC is not set
+# CONFIG_LIBC_WCHAR is not set
+# CONFIG_LIBC_LOCALE is not set
+CONFIG_LIB_RAND_ORDER=1
+# CONFIG_EOL_IS_CR is not set
+# CONFIG_EOL_IS_LF is not set
+# CONFIG_EOL_IS_BOTH_CRLF is not set
+CONFIG_EOL_IS_EITHER_CRLF=y
+# CONFIG_LIBC_EXECFUNCS is not set
+CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024
+CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
+# CONFIG_LIBC_STRERROR is not set
+# CONFIG_LIBC_PERROR_STDOUT is not set
+CONFIG_LIBC_TMPDIR="/tmp"
+CONFIG_LIBC_MAX_TMPFILE=32
+CONFIG_ARCH_LOWPUTC=y
+# CONFIG_LIBC_LOCALTIME is not set
+# CONFIG_TIME_EXTENDED is not set
+CONFIG_LIB_SENDFILE_BUFSIZE=512
+# CONFIG_ARCH_ROMGETC is not set
+# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
+CONFIG_ARCH_HAVE_TLS=y
+# CONFIG_TLS is not set
+# CONFIG_LIBC_IPv6_ADDRCONV is not set
+CONFIG_LIBC_NETDB=y
+# CONFIG_NETDB_HOSTFILE is not set
+
+#
+# Non-standard Library Support
+#
+# CONFIG_LIB_CRC64_FAST is not set
+# CONFIG_LIB_KBDCODEC is not set
+# CONFIG_LIB_SLCDCODEC is not set
+# CONFIG_LIB_HEX2BIN is not set
+
+#
+# Basic CXX Support
+#
+# CONFIG_C99_BOOL8 is not set
+CONFIG_HAVE_CXX=y
+CONFIG_HAVE_CXXINITIALIZE=y
+# CONFIG_CXX_NEWLONG is not set
+
+#
+# uClibc++ Standard C++ Library
+#
+# CONFIG_UCLIBCXX is not set
+
+#
+# Application Configuration
+#
+
+#
+# NxWidgets/NxWM
+#
+
+#
+# Built-In Applications
+#
+CONFIG_BUILTIN_PROXY_STACKSIZE=1024
+
+#
+# CAN Utilities
+#
+
+#
+# Examples
+#
+# CONFIG_EXAMPLES_ADC is not set
+# CONFIG_EXAMPLES_BUTTONS is not set
+# CONFIG_EXAMPLES_CCTYPE is not set
+# CONFIG_EXAMPLES_CHAT is not set
+# CONFIG_EXAMPLES_CONFIGDATA is not set
+# CONFIG_EXAMPLES_CPUHOG is not set
+# CONFIG_EXAMPLES_CXXTEST is not set
+# CONFIG_EXAMPLES_DHCPD is not set
+# CONFIG_EXAMPLES_ELF is not set
+# CONFIG_EXAMPLES_FSTEST is not set
+# CONFIG_EXAMPLES_FTPC is not set
+# CONFIG_EXAMPLES_FTPD is not set
+# CONFIG_EXAMPLES_HELLO is not set
+# CONFIG_EXAMPLES_HELLOXX is not set
+# CONFIG_EXAMPLES_HIDKBD is not set
+# CONFIG_EXAMPLES_IGMP is not set
+# CONFIG_EXAMPLES_JSON is not set
+# CONFIG_EXAMPLES_KEYPADTEST is not set
+# CONFIG_EXAMPLES_MEDIA is not set
+# CONFIG_EXAMPLES_MM is not set
+# CONFIG_EXAMPLES_MODBUS is not set
+# CONFIG_EXAMPLES_MOUNT is not set
+# CONFIG_EXAMPLES_NETTEST is not set
+# CONFIG_EXAMPLES_NRF24L01TERM is not set
+CONFIG_EXAMPLES_NSH=y
+CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
+# CONFIG_EXAMPLES_NULL is not set
+# CONFIG_EXAMPLES_NX is not set
+# CONFIG_EXAMPLES_NXFFS is not set
+# CONFIG_EXAMPLES_NXHELLO is not set
+# CONFIG_EXAMPLES_NXIMAGE is not set
+# CONFIG_EXAMPLES_NXLINES is not set
+# CONFIG_EXAMPLES_NXTERM is not set
+# CONFIG_EXAMPLES_NXTEXT is not set
+# CONFIG_EXAMPLES_OSTEST is not set
+# CONFIG_EXAMPLES_PCA9635 is not set
+# CONFIG_EXAMPLES_PIPE is not set
+# CONFIG_EXAMPLES_POSIXSPAWN is not set
+# CONFIG_EXAMPLES_PPPD is not set
+# CONFIG_EXAMPLES_PWM is not set
+# CONFIG_EXAMPLES_RFID_READUID is not set
+# CONFIG_EXAMPLES_RGBLED is not set
+# CONFIG_EXAMPLES_SENDMAIL is not set
+# CONFIG_EXAMPLES_SERIALBLASTER is not set
+# CONFIG_EXAMPLES_SERIALRX is not set
+# CONFIG_EXAMPLES_SERLOOP is not set
+# CONFIG_EXAMPLES_SLCD is not set
+# CONFIG_EXAMPLES_SMART is not set
+# CONFIG_EXAMPLES_SMART_TEST is not set
+# CONFIG_EXAMPLES_SMP is not set
+# CONFIG_EXAMPLES_TCPECHO is not set
+# CONFIG_EXAMPLES_TELNETD is not set
+# CONFIG_EXAMPLES_TIFF is not set
+# CONFIG_EXAMPLES_TOUCHSCREEN is not set
+# CONFIG_EXAMPLES_UDGRAM is not set
+# CONFIG_EXAMPLES_USBSERIAL is not set
+# CONFIG_EXAMPLES_USBTERM is not set
+# CONFIG_EXAMPLES_USTREAM is not set
+# CONFIG_EXAMPLES_WATCHDOG is not set
+# CONFIG_EXAMPLES_WEBSERVER is not set
+# CONFIG_EXAMPLES_XMLRPC is not set
+
+#
+# File System Utilities
+#
+# CONFIG_FSUTILS_INIFILE is not set
+# CONFIG_FSUTILS_PASSWD is not set
+
+#
+# GPS Utilities
+#
+# CONFIG_GPSUTILS_MINMEA_LIB is not set
+
+#
+# Graphics Support
+#
+# CONFIG_TIFF is not set
+# CONFIG_GRAPHICS_TRAVELER is not set
+
+#
+# Interpreters
+#
+# CONFIG_INTERPRETERS_BAS is not set
+# CONFIG_INTERPRETERS_FICL is not set
+# CONFIG_INTERPRETERS_MICROPYTHON is not set
+# CONFIG_INTERPRETERS_MINIBASIC is not set
+# CONFIG_INTERPRETERS_PCODE is not set
+
+#
+# FreeModBus
+#
+# CONFIG_MODBUS is not set
+
+#
+# Network Utilities
+#
+# CONFIG_NETUTILS_CHAT is not set
+# CONFIG_NETUTILS_CODECS is not set
+# CONFIG_NETUTILS_ESP8266 is not set
+# CONFIG_NETUTILS_FTPC is not set
+# CONFIG_NETUTILS_FTPD is not set
+# CONFIG_NETUTILS_JSON is not set
+CONFIG_NETUTILS_NETLIB=y
+# CONFIG_NETUTILS_SMTP is not set
+# CONFIG_NETUTILS_TELNETD is not set
+# CONFIG_NETUTILS_WEBCLIENT is not set
+# CONFIG_NETUTILS_WEBSERVER is not set
+# CONFIG_NETUTILS_XMLRPC is not set
+
+#
+# NSH Library
+#
+CONFIG_NSH_LIBRARY=y
+# CONFIG_NSH_MOTD is not set
+
+#
+# Command Line Configuration
+#
+CONFIG_NSH_READLINE=y
+# CONFIG_NSH_CLE is not set
+CONFIG_NSH_LINELEN=64
+# CONFIG_NSH_DISABLE_SEMICOLON is not set
+CONFIG_NSH_CMDPARMS=y
+CONFIG_NSH_MAXARGUMENTS=6
+CONFIG_NSH_ARGCAT=y
+CONFIG_NSH_NESTDEPTH=3
+# CONFIG_NSH_DISABLEBG is not set
+CONFIG_NSH_BUILTIN_APPS=y
+
+#
+# Disable Individual commands
+#
+# CONFIG_NSH_DISABLE_ADDROUTE is not set
+# CONFIG_NSH_DISABLE_ARP is not set
+# CONFIG_NSH_DISABLE_BASENAME is not set
+# CONFIG_NSH_DISABLE_CAT is not set
+# CONFIG_NSH_DISABLE_CD is not set
+# CONFIG_NSH_DISABLE_CP is not set
+# CONFIG_NSH_DISABLE_CMP is not set
+CONFIG_NSH_DISABLE_DATE=y
+# CONFIG_NSH_DISABLE_DD is not set
+# CONFIG_NSH_DISABLE_DF is not set
+# CONFIG_NSH_DISABLE_DELROUTE is not set
+# CONFIG_NSH_DISABLE_DIRNAME is not set
+# CONFIG_NSH_DISABLE_ECHO is not set
+# CONFIG_NSH_DISABLE_EXEC is not set
+# CONFIG_NSH_DISABLE_EXIT is not set
+# CONFIG_NSH_DISABLE_FREE is not set
+# CONFIG_NSH_DISABLE_GET is not set
+# CONFIG_NSH_DISABLE_HELP is not set
+# CONFIG_NSH_DISABLE_HEXDUMP is not set
+# CONFIG_NSH_DISABLE_IFCONFIG is not set
+# CONFIG_NSH_DISABLE_IFUPDOWN is not set
+# CONFIG_NSH_DISABLE_KILL is not set
+# CONFIG_NSH_DISABLE_LOSETUP is not set
+CONFIG_NSH_DISABLE_LOSMART=y
+# CONFIG_NSH_DISABLE_LS is not set
+# CONFIG_NSH_DISABLE_MB is not set
+# CONFIG_NSH_DISABLE_MKDIR is not set
+# CONFIG_NSH_DISABLE_MKFATFS is not set
+# CONFIG_NSH_DISABLE_MKFIFO is not set
+# CONFIG_NSH_DISABLE_MKRD is not set
+# CONFIG_NSH_DISABLE_MH is not set
+# CONFIG_NSH_DISABLE_MOUNT is not set
+# CONFIG_NSH_DISABLE_MV is not set
+# CONFIG_NSH_DISABLE_MW is not set
+CONFIG_NSH_DISABLE_PRINTF=y
+# CONFIG_NSH_DISABLE_PS is not set
+# CONFIG_NSH_DISABLE_PUT is not set
+# CONFIG_NSH_DISABLE_PWD is not set
+# CONFIG_NSH_DISABLE_RM is not set
+# CONFIG_NSH_DISABLE_RMDIR is not set
+# CONFIG_NSH_DISABLE_SET is not set
+# CONFIG_NSH_DISABLE_SH is not set
+# CONFIG_NSH_DISABLE_SLEEP is not set
+# CONFIG_NSH_DISABLE_TIME is not set
+# CONFIG_NSH_DISABLE_TEST is not set
+# CONFIG_NSH_DISABLE_UMOUNT is not set
+# CONFIG_NSH_DISABLE_UNAME is not set
+# CONFIG_NSH_DISABLE_UNSET is not set
+# CONFIG_NSH_DISABLE_USLEEP is not set
+# CONFIG_NSH_DISABLE_WGET is not set
+# CONFIG_NSH_DISABLE_XD is not set
+CONFIG_NSH_MMCSDMINOR=0
+CONFIG_NSH_MMCSDSLOTNO=0
+CONFIG_NSH_MMCSDSPIPORTNO=0
+
+#
+# Configure Command Options
+#
+CONFIG_NSH_CMDOPT_DF_H=y
+# CONFIG_NSH_CMDOPT_DD_STATS is not set
+CONFIG_NSH_CODECS_BUFSIZE=128
+CONFIG_NSH_CMDOPT_HEXDUMP=y
+CONFIG_NSH_PROC_MOUNTPOINT="/proc"
+CONFIG_NSH_FILEIOSIZE=512
+
+#
+# Scripting Support
+#
+# CONFIG_NSH_DISABLESCRIPT is not set
+# CONFIG_NSH_DISABLE_ITEF is not set
+# CONFIG_NSH_DISABLE_LOOPS is not set
+
+#
+# Console Configuration
+#
+CONFIG_NSH_CONSOLE=y
+# CONFIG_NSH_USBCONSOLE is not set
+# CONFIG_NSH_ALTCONDEV is not set
+CONFIG_NSH_ARCHINIT=y
+
+#
+# Networking Configuration
+#
+CONFIG_NSH_NETINIT=y
+# CONFIG_NSH_NETINIT_THREAD is not set
+
+#
+# IP Address Configuration
+#
+
+#
+# IPv4 Addresses
+#
+CONFIG_NSH_IPADDR=0x0a000002
+CONFIG_NSH_DRIPADDR=0x0a000001
+CONFIG_NSH_NETMASK=0xffffff00
+# CONFIG_NSH_NOMAC is not set
+CONFIG_NSH_MAX_ROUNDTRIP=20
+# CONFIG_NSH_LOGIN is not set
+# CONFIG_NSH_CONSOLE_LOGIN is not set
+
+#
+# Platform-specific Support
+#
+# CONFIG_PLATFORM_CONFIGDATA is not set
+
+#
+# System Libraries and NSH Add-Ons
+#
+# CONFIG_SYSTEM_CDCACM is not set
+# CONFIG_SYSTEM_CLE is not set
+# CONFIG_SYSTEM_CUTERM is not set
+# CONFIG_SYSTEM_FREE is not set
+# CONFIG_SYSTEM_HEX2BIN is not set
+# CONFIG_SYSTEM_HEXED is not set
+# CONFIG_SYSTEM_I2CTOOL is not set
+# CONFIG_SYSTEM_INSTALL is not set
+CONFIG_IOTJS=y
+CONFIG_IOTJS_PRIORITY=100
+CONFIG_IOTJS_STACKSIZE=16384
+# CONFIG_SYSTEM_NETDB is not set
+# CONFIG_SYSTEM_RAMTEST is not set
+CONFIG_READLINE_HAVE_EXTMATCH=y
+CONFIG_SYSTEM_READLINE=y
+CONFIG_READLINE_ECHO=y
+CONFIG_READLINE_TABCOMPLETION=y
+CONFIG_READLINE_MAX_BUILTINS=64
+CONFIG_READLINE_MAX_EXTCMDS=64
+CONFIG_READLINE_CMD_HISTORY=y
+CONFIG_READLINE_CMD_HISTORY_LINELEN=80
+CONFIG_READLINE_CMD_HISTORY_LEN=16
+# CONFIG_SYSTEM_SUDOKU is not set
+# CONFIG_SYSTEM_SYSTEM is not set
+# CONFIG_SYSTEM_TEE is not set
+# CONFIG_SYSTEM_UBLOXMODEM is not set
+# CONFIG_SYSTEM_VI is not set
+# CONFIG_SYSTEM_ZMODEM is not set
diff --git a/config/nuttx/stm32f4dis/app/Kconfig b/config/nuttx/stm32f4dis/app/Kconfig
new file mode 100644 (file)
index 0000000..85409a7
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config IOTJS
+  bool "IoT.js"
+  default n
+  ---help---
+    Enable IoT.js platform
+
+if IOTJS
+
+config IOTJS_PRIORITY
+  int "IoT.js task priority"
+  default 100
+
+config IOTJS_STACKSIZE
+  int "IoT.js stack size"
+  default 16384
+
+endif
diff --git a/config/nuttx/stm32f4dis/app/Make.defs b/config/nuttx/stm32f4dis/app/Make.defs
new file mode 100644 (file)
index 0000000..4cd4a82
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+# Copyright 2016 University of Szeged
+#
+# 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.
+
+ifeq ($(CONFIG_IOTJS),y)
+CONFIGURED_APPS += system/iotjs
+endif
diff --git a/config/nuttx/stm32f4dis/app/Makefile b/config/nuttx/stm32f4dis/app/Makefile
new file mode 100644 (file)
index 0000000..cda803a
--- /dev/null
@@ -0,0 +1,179 @@
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+############################################################################
+#   Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved.
+#   Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+#    used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# TODO, this makefile should run make under the app dirs, instead of
+# sourcing the Make.defs!
+
+-include $(TOPDIR)/.config
+-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
+
+IOTJS_ABSOLUTE_ROOT_DIR := $(shell cd $(TOPDIR) && cd $(IOTJS_ROOT_DIR) && pwd)
+
+CONFIG_IOTJS_PRIORITY ?= SCHED_PRIORITY_DEFAULT
+CONFIG_IOTJS_STACKSIZE ?= 16384
+# NSH sysinfo command
+
+APPNAME = iotjs
+CFLAGS += -I$(IOTJS_ABSOLUTE_ROOT_DIR)/deps/jerry/jerry-core/include
+CFLAGS += -I$(IOTJS_ABSOLUTE_ROOT_DIR)/deps/jerry/jerry-ext/include
+PRIORITY = $(CONFIG_IOTJS_PRIORITY)
+STACKSIZE = $(CONFIG_IOTJS_STACKSIZE)
+HEAPSIZE = $(CONFIG_IOTJS_HEAPSIZE)
+
+ASRCS = setjmp.S
+CSRCS = jerry_port.c
+MAINSRC = iotjs_main.c
+LIBS = libhttpparser.a libiotjs.a libjerry-core.a libtuv.a libjerry-libm.a
+
+AOBJS = $(ASRCS:.S=$(OBJEXT))
+COBJS = $(CSRCS:.c=$(OBJEXT))
+MAINOBJ = $(MAINSRC:.c=$(OBJEXT))
+
+SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
+OBJS = $(AOBJS) $(COBJS)
+
+ifeq ($(R),1)
+  BUILD_TYPE = release
+else
+  BUILD_TYPE = debug
+endif
+
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+  OBJS += $(MAINOBJ)
+endif
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+  BIN = ..\..\libapps$(LIBEXT)
+else
+ifeq ($(WINTOOL),y)
+  BIN = ..\\..\\libapps$(LIBEXT)
+else
+  BIN = ../../libapps$(LIBEXT)
+endif
+endif
+
+ifeq ($(WINTOOL),y)
+  INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}"
+else
+  INSTALL_DIR = $(BIN_DIR)
+endif
+
+CONFIG_XYZ_PROGNAME ?= iotjs$(EXEEXT)
+PROGNAME = $(CONFIG_XYZ_PROGNAME)
+
+ROOTDEPPATH = --dep-path .
+
+# Common build
+
+VPATH =
+
+all: .built
+.PHONY: context depend clean distclean
+
+$(AOBJS): %$(OBJEXT): %.S
+       $(call ASSEMBLE, $<, $@)
+
+$(COBJS): %$(OBJEXT): %.c
+       $(call COMPILE, $<, $@)
+
+copylibs :
+       cp $(IOTJS_ABSOLUTE_ROOT_DIR)/build/arm-nuttx/$(BUILD_TYPE)/lib/lib*.a .
+
+$(LIBS) : copylibs
+       $(firstword $(AR)) x $@
+
+.built: $(LIBS) $(OBJS)
+       $(eval OBJS += $(shell find . -name "*.obj"))
+       $(call ARCHIVE, $(BIN), $(OBJS))
+       $(Q) touch .built
+
+ifeq ($(CONFIG_BUILD_KERNEL),y)
+$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ)
+       @echo "LD: $(PROGNAME)"
+       $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS)
+       $(Q) $(NM) -u  $(INSTALL_DIR)$(DELIM)$(PROGNAME)
+
+install: $(BIN_DIR)$(DELIM)$(PROGNAME)
+
+else
+install:
+
+endif
+
+# Register application
+
+ifeq ($(CONFIG_NSH_BUILTIN_APPS),y)
+$(BUILTIN_REGISTRY)$(DELIM)iotjs.bdat: $(DEPCONFIG) Makefile
+       $(call REGISTER,"iotjs",$(PRIORITY),$(STACKSIZE),iotjs_main)
+
+context: $(BUILTIN_REGISTRY)$(DELIM)iotjs.bdat
+else
+context:
+endif
+
+# Create dependencies
+
+.depend: Makefile $(SRCS)
+       $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) touch $@
+
+depend: .depend
+
+clean:
+       $(eval OBJS += $(shell find . -name "*.obj"))
+       $(call DELFILE, $(OBJS))
+       $(call DELFILE, .built)
+       $(call CLEAN)
+
+distclean: clean
+       $(call DELFILE, Make.dep)
+       $(call DELFILE, .depend)
+
+-include Make.dep
+.PHONY: preconfig
+preconfig:
diff --git a/config/nuttx/stm32f4dis/app/iotjs_main.c b/config/nuttx/stm32f4dis/app/iotjs_main.c
new file mode 100644 (file)
index 0000000..966945e
--- /dev/null
@@ -0,0 +1,76 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/****************************************************************************
+ *   Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/arch.h>
+#include <nuttx/config.h>
+
+#include <stdio.h>
+#include "setjmp.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+extern int iotjs_entry(int argc, char *argv[]);
+extern int tuv_cleanup(void);
+
+#ifdef CONFIG_BUILD_KERNEL
+extern int main(int argc, FAR char *argv[])
+#else
+extern int iotjs_main(int argc, char *argv[])
+#endif
+{
+  int ret = 0;
+  ret = iotjs_entry(argc, argv);
+  tuv_cleanup();
+  return ret;
+}
diff --git a/config/nuttx/stm32f4dis/app/jerry_port.c b/config/nuttx/stm32f4dis/app/jerry_port.c
new file mode 100644 (file)
index 0000000..886f749
--- /dev/null
@@ -0,0 +1,68 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "jerryscript-ext/handler.h"
+#include "jerryscript-port.h"
+#include "jerryscript.h"
+
+/**
+ * Aborts the program.
+ */
+void jerry_port_fatal(jerry_fatal_code_t code) {
+  exit(1);
+} /* jerry_port_fatal */
+
+/**
+ * Provide log message implementation for the engine.
+ */
+void jerry_port_log(jerry_log_level_t level, /**< log level */
+                    const char *format,      /**< format string */
+                    ...) {                   /**< parameters */
+  /* Drain log messages since IoT.js has not support log levels yet. */
+} /* jerry_port_log */
+
+/**
+ * Dummy function to get the time zone.
+ *
+ * @return true
+ */
+bool jerry_port_get_time_zone(jerry_time_zone_t *tz_p) {
+  /* We live in UTC. */
+  tz_p->offset = 0;
+  tz_p->daylight_saving_time = 0;
+
+  return true;
+} /* jerry_port_get_time_zone */
+
+/**
+ * Dummy function to get the current time.
+ *
+ * @return 0
+ */
+double jerry_port_get_current_time(void) {
+  return 0;
+} /* jerry_port_get_current_time */
+
+/**
+ * Provide the implementation of jerryx_port_handler_print_char.
+ * Uses 'printf' to print a single character to standard output.
+ */
+void jerryx_port_handler_print_char(char c) { /**< the character to print */
+  printf("%c", c);
+} /* jerryx_port_handler_print_char */
diff --git a/config/nuttx/stm32f4dis/app/setjmp.S b/config/nuttx/stm32f4dis/app/setjmp.S
new file mode 100644 (file)
index 0000000..7fd3f89
--- /dev/null
@@ -0,0 +1,80 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* 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.
+ */
+
+.syntax unified
+
+.macro func _name
+.global \_name
+.type \_name, %function
+\_name:
+.endm
+.macro endfunc _name
+.size \_name, .-\_name
+.endm
+
+/**
+ * setjmp (jmp_buf env)
+ *
+ * See also:
+ *          longjmp
+ *
+ * @return 0 - if returns from direct call,
+ *         nonzero - if returns after longjmp.
+ */
+func setjmp
+  stmia r0!, {r4 - r11, lr}
+  str sp, [r0], #4
+  vstm r0, {s16 - s31}
+  mov r0, #0
+  bx lr
+endfunc setjmp
+
+/**
+ * longjmp (jmp_buf env, int val)
+ *
+ * Note:
+ *      if val is not 0, then it would be returned from setjmp,
+ *      otherwise - 0 would be returned.
+ *
+ * See also:
+ *          setjmp
+ */
+func longjmp
+  ldmia r0!, {r4 - r11, lr}
+  ldr sp, [r0]
+  add r0, r0, #4
+  vldm r0, {s16 - s31}
+  mov r0, r1
+  cmp r0, #0
+  bne 1f
+  mov r0, #1
+  1:
+  bx lr
+endfunc longjmp
diff --git a/config/nuttx/stm32f4dis/app/setjmp.h b/config/nuttx/stm32f4dis/app/setjmp.h
new file mode 100644 (file)
index 0000000..c19789e
--- /dev/null
@@ -0,0 +1,41 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* 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.
+ */
+
+#ifndef SETJMP_H
+#define SETJMP_H
+
+#include <stdint.h>
+
+typedef uint64_t jmp_buf[14];
+
+int setjmp(jmp_buf env);
+void longjmp(jmp_buf env, int val);
+
+#endif /* !SETJMP_H */
diff --git a/config/nuttx/stm32f4dis/patch b/config/nuttx/stm32f4dis/patch
new file mode 100644 (file)
index 0000000..efa8999
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/configs/stm32f4discovery/include/board.h
++++ b/configs/stm32f4discovery/include/board.h
+@@ -253,6 +253,13 @@
+ #  define GPIO_CAN2_TX GPIO_CAN2_TX_1
+ #endif
+
+# Patch code to enable UART1:
+# It maps pin PB6 and pin PB7 to USART1_TX and USART2_RX respectively.
+#
++
++#define GPIO_USART1_RX GPIO_USART1_RX_2
++#define GPIO_USART1_TX GPIO_USART1_TX_2
++
+# Patch code to enable UART4:
+# It maps pin PA0 and pin PA1 to UART4_TX and UART4_RX respectively.
+# Because it makes conflict with pins of USART2,
+# you have to disable USART2 to use this port.
+#
++#define GPIO_UART4_RX GPIO_UART4_RX_1
++#define GPIO_UART4_TX GPIO_UART4_TX_1
++
+ /* UART2:
+  *
+  * The STM32F4 Discovery has no on-board serial devices, but the console is
diff --git a/config/tizen/gbsbuild.sh b/config/tizen/gbsbuild.sh
new file mode 100755 (executable)
index 0000000..32f02d1
--- /dev/null
@@ -0,0 +1,98 @@
+#!/bin/bash
+
+# Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+cd ..
+
+echo "******************************************************************"
+echo "*                       Tizen GBS build                          *"
+echo "*                                                                *"
+echo "* Please input user, passwd of http://Tizen.org on '~/.gbs.conf' *"
+echo "* For more information, please read Guide Docs. folder           *"
+echo "* ~/.gbs.conf sample is at 'config/tizen/sample.gbs.conf'.       *"
+echo "*                                                                *"
+echo "******************************************************************"
+read -p "[Warning] This working folder will be copied to ../iotjs_tizen_gbs \
+Are you sure to continue? (y/n) " -n 1 -r
+
+echo ""
+if [[ $REPLY =~ ^[Yy]$ ]]
+then
+  echo copy from $OLDPWD to ../iotjs_tizen_gbs
+  cp -ra $OLDPWD iotjs_tizen_gbs
+  cd iotjs_tizen_gbs
+  echo -e "\n(1) Now, cloning submodules. "
+  git submodule init
+  echo -e "\n(2) Update submodules... "
+  git submodule update
+  echo -e "\n(3) Remove compiler specified lines on CMake"
+  rm ./cmake/config/arm-tizen.cmake
+  echo "include(CMakeForceCompiler)
+
+  set(CMAKE_SYSTEM_NAME Linux)
+  set(CMAKE_SYSTEM_PROCESSOR armv7l)"\
+   >> ./cmake/config/arm-tizen.cmake
+
+  rm ./deps/libtuv/cmake/config/config_arm-tizen.cmake
+  echo "include(CMakeForceCompiler)
+
+  set(CMAKE_SYSTEM_NAME Linux)
+  set(CMAKE_SYSTEM_PROCESSOR arm)"\
+   >> ./deps/libtuv/cmake/config/config_arm-tizen.cmake
+
+  rm ./deps/jerry/cmake/toolchain_linux_armv7l-el.cmake
+  echo "set(CMAKE_SYSTEM_NAME Linux)
+  set(CMAKE_SYSTEM_PROCESSOR armv7l-el)
+  set(FLAGS_COMMON_ARCH -mlittle-endian -mthumb)" \
+   >> ./deps/jerry/cmake/toolchain_linux_armv7l-el.cmake
+
+  echo -e "\n(4) 3 files have been modified."
+
+  find ./ -name '.git' | xargs rm -rf
+  # Initialize Git repositoryㅣ
+  if [ ! -d .git ]
+  then
+    git init ./
+    git checkout -b tizen_gbs
+    git add ./
+    git commit -m "Initial commit"
+  fi
+
+  echo -e "\n(5) Calling core gbs build command"
+  gbscommand="gbs build -A armv7l --include-all --clean"
+  echo $gbscommand
+  if eval $gbscommand
+  then
+    echo "========================================================"
+    echo "1. GBS Build is successful."
+    echo "2. Please move to new working folder ../iotjs_tizen_gbs "
+    echo "   cd ../iotjs_tizen_gbs"
+    echo "3. From now, you can build with this command on new directory"
+    echo "   gbs build -A armv7l --include"
+    echo "4. Your new branch 'tizen_gbs' is added."
+    echo "5. 'iotjs origin' repository is added."
+    git remote add origin https://github.com/samsung/iotjs
+    echo "(You cant fetch origin repository with this command)"
+    echo "   git fetch --all"
+    echo "========================================================"
+    # git remote add origin
+    # https://review.tizen.org/git/platform/upstream/iotjs
+    git branch -a
+    git status
+  else
+    echo "GBS Build failed!"
+    exit 1
+  fi
+fi
diff --git a/config/tizen/packaging/iotjs.manifest b/config/tizen/packaging/iotjs.manifest
new file mode 100644 (file)
index 0000000..f5a44ec
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+        <request>
+                <domain name="_"/>
+        </request>
+</manifest>
diff --git a/config/tizen/packaging/iotjs.pc.in b/config/tizen/packaging/iotjs.pc.in
new file mode 100644 (file)
index 0000000..4d4ff64
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: iotjs
+Description: Platform for Internet of Things with JavaScript
+Version: 1.0.0
+Libs:
+Cflags: -I${includedir}
diff --git a/config/tizen/packaging/iotjs.spec b/config/tizen/packaging/iotjs.spec
new file mode 100644 (file)
index 0000000..d01d45d
--- /dev/null
@@ -0,0 +1,101 @@
+Name: iotjs
+Version: 1.0.0
+Release: 0
+Summary: Platform for Internet of Things with JavaScript
+Group: Network & Connectivity
+License: Apache-2.0
+URL: https://www.iotjs.net/
+Source:     %{name}-%{version}.tar.gz
+Source1:    %{name}.pc.in
+Source1001: %{name}.manifest
+
+BuildRequires: python
+BuildRequires: cmake
+BuildRequires: glibc-static
+BuildRequires: aul
+BuildRequires: pkgconfig(appcore-agent)
+BuildRequires: pkgconfig(capi-appfw-service-application)
+BuildRequires: pkgconfig(capi-appfw-app-common)
+BuildRequires: pkgconfig(capi-appfw-package-manager)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(dlog)
+#for https
+BuildRequires:  openssl-devel
+BuildRequires:  libcurl-devel
+
+Requires(postun): /sbin/ldconfig
+Requires(post): /sbin/ldconfig
+
+%description
+Platform for Internet of Things with JavaScript
+
+# default is RELEASE mode.
+# If DEBUG mode is needed, please use tizen_build_devel_mode
+%define RELEASE False
+# For Example
+%if %{RELEASE} == "True"
+%define build_mode release
+%else
+%define build_mode debug
+%endif
+
+# Default values to be eventually overiden BEFORE or as gbs params:
+%{!?RELEASE: %define RELEASE 0}
+
+%package service
+Summary: Development files for %{name}
+Group: Network & Connectivity/Service
+Requires: %{name} = %{version}-%{release}
+
+%description service
+The %{name}-service package contains service iotjs files for
+developing applications that use %{name}.
+
+%package devel
+Summary: Header files for %{name}
+Group: Network & Connectivity/Service
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Development libraries for %{name}
+
+%prep
+%setup -q -c
+chmod g-w %_sourcedir/*
+cat LICENSE
+cp %{SOURCE1001} .
+
+%build
+./tools/build.py --clean --buildtype=%{build_mode} --target-arch=arm \
+ --target-os=tizen --target-board=artik10 \
+ --no-init-submodule --no-parallel-build --no-check-test
+
+%install
+mkdir -p %{buildroot}%{_bindir}
+mkdir -p %{buildroot}%{_includedir}/iotjs
+mkdir -p %{buildroot}%{_libdir}/iotjs
+mkdir -p %{buildroot}%{_libdir}/pkgconfig
+
+
+cp ./build/arm-tizen/%{build_mode}/bin/iotjs %{buildroot}%{_bindir}/
+cp ./build/arm-tizen/%{build_mode}/lib/* %{buildroot}%{_libdir}/iotjs/
+
+cp ./include/*.h %{buildroot}%{_includedir}
+cp ./src/*.h %{buildroot}%{_includedir}
+cp ./config/tizen/packaging/%{name}.pc.in %{buildroot}/%{_libdir}/pkgconfig/%{name}.pc
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+
+%files
+%manifest config/tizen/packaging/%{name}.manifest
+%defattr(-,root,root,-)
+%license LICENSE
+%{_bindir}/*
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/iotjs/*.a
+%{_libdir}/pkgconfig/%{name}.pc
+%{_includedir}/*
diff --git a/config/tizen/sample.gbs.conf b/config/tizen/sample.gbs.conf
new file mode 100644 (file)
index 0000000..16d69ad
--- /dev/null
@@ -0,0 +1,45 @@
+[general]
+profile = profile.tizen_unified
+
+[profile.tizen_unified]
+obs = obs.spin
+repos = repo.public_4.0_base_arm, repo.tizen_unified
+
+[profile.tizen_artik10]
+obs = obs.spin
+repos = repo.public_3.0_base_arm, repo.public_3_arm
+
+[obs.spin]
+url = http://168.219.209.58:81
+
+[obs.tizen]
+url = https://api.tizen.org
+user = obs_viewer
+passwdx = QlpoOTFBWSZTWRP5nYMAAB6fgCAAeUA9mr+QBvzF4CAAVGAZDTRoDI0YBlCKeptQBoA0aGZIAottAkltEPOK7BAFXE9mTUzocPMzQRkPoPpNwEZx3rRQhxkXmGHS6wCjHskyVCP4u5IpwoSAn8zsGA==
+
+[repo.public_3_arm] 
+url = http://download.tizen.org/releases/milestone/tizen/3.0.m2/common_artik/tizen-common-artik_20170111.3/repos/arm-wayland/packages/
+user =
+passwdx = 
+
+[repo.tizen_unified]
+url=http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/
+user=
+passwdx=
+
+[repo.base_arm]
+url=http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/
+user=
+passwdx=
+
+
+[repo.public_3.0_base_arm]
+url = http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/packages/armv7l/
+user = 
+passwdx = 
+
+[repo.public_4.0_base_arm]
+url = http://download.tizen.org/snapshots/tizen/base/latest/repos/arm/packages/
+user = 
+passwdx =
+
diff --git a/config/tizenrt/artik05x/app/.gitignore b/config/tizenrt/artik05x/app/.gitignore
new file mode 100644 (file)
index 0000000..fa1ec75
--- /dev/null
@@ -0,0 +1,11 @@
+/Make.dep
+/.depend
+/.built
+/*.asm
+/*.obj
+/*.rel
+/*.lst
+/*.sym
+/*.adb
+/*.lib
+/*.src
diff --git a/config/tizenrt/artik05x/app/Kconfig b/config/tizenrt/artik05x/app/Kconfig
new file mode 100644 (file)
index 0000000..9538b6d
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config SYSTEM_IOTJS
+  bool "IoT.js"
+  default y
+  ---help---
+    Enable IoT.js platform
+
+if SYSTEM_IOTJS
+
+config IOTJS_PRIORITY
+  int "IoT.js task priority"
+  default 100
+
+config IOTJS_STACKSIZE
+  int "IoT.js stack size"
+  default 32768
+
+endif
+
+config USER_ENTRYPOINT
+        string
+        default "iotjs_main" if ENTRY_IOTJS
+
diff --git a/config/tizenrt/artik05x/app/Kconfig_ENTRY b/config/tizenrt/artik05x/app/Kconfig_ENTRY
new file mode 100644 (file)
index 0000000..94c48db
--- /dev/null
@@ -0,0 +1,3 @@
+config ENTRY_IOTJS
+       bool "iotjs application"
+       depends on SYSTEM_IOTJS
diff --git a/config/tizenrt/artik05x/app/Make.defs b/config/tizenrt/artik05x/app/Make.defs
new file mode 100644 (file)
index 0000000..da059d9
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+# Copyright 2016 University of Szeged
+#
+# 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.
+
+ifeq ($(CONFIG_SYSTEM_IOTJS),y)
+CONFIGURED_APPS += system/iotjs
+endif
diff --git a/config/tizenrt/artik05x/app/Makefile b/config/tizenrt/artik05x/app/Makefile
new file mode 100644 (file)
index 0000000..4fad35b
--- /dev/null
@@ -0,0 +1,181 @@
+###########################################################################
+#
+# Copyright 2016 Samsung Electronics All Rights Reserved.
+#
+# 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.
+#
+###########################################################################
+############################################################################
+# apps/examples/iotjs/Makefile
+#
+#   Copyright (C) 2008, 2010-2013 Gregory Nutt. All rights reserved.
+#   Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+#    used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+EXTRA_LIBS += libhttpparser.a libiotjs.a libjerrycore.a libtuv.a libjerry-libm.a
+LINKLIBS=$(EXTRA_LIBS)
+
+-include $(TOPDIR)/.config
+-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
+
+ifeq ($(IOTJS_ROOT_DIR),)
+  IOTJS_ROOT_DIR = ../../iotjs
+endif
+IOTJS_ABSOLUTE_ROOT_DIR := $(shell cd $(TOPDIR) && cd $(IOTJS_ROOT_DIR) && pwd)
+
+ifeq ($(IOTJS_LIB_DIR),)
+  ifeq ($(CONFIG_DEBUG),y)
+    IOTJS_LIB_DIR = $(IOTJS_ABSOLUTE_ROOT_DIR)/build/arm-tizenrt/debug/lib
+  else
+    IOTJS_LIB_DIR = $(IOTJS_ABSOLUTE_ROOT_DIR)/build/arm-tizenrt/release/lib
+  endif
+endif
+EXTRA_LIBPATHS += -L$(IOTJS_LIB_DIR)
+
+
+# IoT.js application
+CONFIG_IOTJS_PRIORITY ?= SCHED_PRIORITY_DEFAULT
+CONFIG_IOTJS_STACKSIZE ?= 16384
+IOTJS_LIB_DIR ?= n
+
+APPNAME = iotjs
+CFLAGS += -I$(IOTJS_ABSOLUTE_ROOT_DIR)/deps/jerry/jerry-core/include
+CFLAGS += -I$(IOTJS_ABSOLUTE_ROOT_DIR)/deps/jerry/jerry-ext/include
+PRIORITY = $(CONFIG_IOTJS_PRIORITY)
+STACKSIZE = $(CONFIG_IOTJS_STACKSIZE)
+HEAPSIZE = $(CONFIG_IOTJS_HEAPSIZE)
+
+ASRCS =
+CSRCS = jerry_port.c
+MAINSRC = iotjs_main.c
+
+AOBJS = $(ASRCS:.S=$(OBJEXT))
+COBJS = $(CSRCS:.c=$(OBJEXT))
+MAINOBJ = $(MAINSRC:.c=$(OBJEXT))
+
+SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
+OBJS = $(AOBJS) $(COBJS)
+
+
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+  OBJS += $(MAINOBJ)
+endif
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+  BIN = ..\..\libapps$(LIBEXT)
+else
+ifeq ($(WINTOOL),y)
+  BIN = ..\\..\\libapps$(LIBEXT)
+else
+  BIN = ../../libapps$(LIBEXT)
+endif
+endif
+
+ifeq ($(WINTOOL),y)
+  INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}"
+else
+  INSTALL_DIR = $(BIN_DIR)
+endif
+
+CONFIG_IOTJS_PROGNAME ?= iotjs$(EXEEXT)
+PROGNAME = $(CONFIG_IOTJS_PROGNAME)
+
+ROOTDEPPATH = --dep-path .
+
+# Common build
+
+VPATH =
+
+all: .built
+.PHONY: clean depend distclean check_iotjs
+
+$(AOBJS): %$(OBJEXT): %.S
+       $(call ASSEMBLE, $<, $@)
+
+$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c
+       $(call COMPILE, $<, $@)
+
+.built: $(OBJS) check_iotjs
+       $(call ARCHIVE, $(BIN), $(OBJS))
+       @touch .built
+
+ifeq ($(CONFIG_BUILD_KERNEL),y)
+$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) check_iotjs
+       $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS)
+       $(Q) $(NM) -u  $(INSTALL_DIR)$(DELIM)$(PROGNAME)
+
+install: $(BIN_DIR)$(DELIM)$(PROGNAME)
+
+else
+install:
+
+endif
+
+check_iotjs:
+ifeq ($(IOTJS_LIB_DIR),n)
+       @echo "ERROR: IOTJS_LIB_DIR not set! Aborting..."
+       @exit 1
+endif
+       @echo IOTJS_LIB_DIR set!
+       @echo "$(LDLIBPATH), $(IOTJS_LIB_DIR) $(TOPDIR)"
+       @cp $(IOTJS_LIB_DIR)/lib* $(TOPDIR)/../build/output/libraries/
+       @cp $(IOTJS_LIB_DIR)/../deps/jerry/lib/libjerry-libm.a $(TOPDIR)/../build/output/libraries/
+
+context:
+
+.depend: Makefile $(SRCS)
+       @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       @touch $@
+
+depend: .depend
+
+clean:
+       $(call DELFILE, .built)
+       $(call CLEAN)
+
+distclean: clean
+       $(call DELFILE, Make.dep)
+       $(call DELFILE, .depend)
+
+-include Make.dep
+.PHONY: preconfig
+preconfig:
diff --git a/config/tizenrt/artik05x/app/iotjs_main.c b/config/tizenrt/artik05x/app/iotjs_main.c
new file mode 100644 (file)
index 0000000..3fad50f
--- /dev/null
@@ -0,0 +1,162 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/****************************************************************************
+ *   Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <apps/shell/tash.h>
+#include <tinyara/arch.h>
+#include <tinyara/config.h>
+
+#include <setjmp.h>
+#include <stdio.h>
+
+#define USE_IOTJS_THREAD 1
+
+/**
+ * Compiler built-in setjmp function.
+ *
+ * @return 0 when called the first time
+ *         1 when returns from a longjmp call
+ */
+
+int setjmp(jmp_buf buf) {
+  return __builtin_setjmp(buf);
+} /* setjmp */
+
+/**
+ * Compiler built-in longjmp function.
+ *
+ * Note:
+ *   ignores value argument
+ */
+
+void longjmp(jmp_buf buf, int value) {
+  /* Must be called with 1. */
+  __builtin_longjmp(buf, 1);
+} /* longjmp */
+
+int iotjs_entry(int argc, char **argv);
+int tuv_cleanup(void);
+
+
+#if USE_IOTJS_THREAD
+struct iotjs_thread_arg {
+  int argc;
+  char **argv;
+};
+
+pthread_addr_t iotjs_thread(void *thread_arg) {
+  struct iotjs_thread_arg *arg = thread_arg;
+  int ret = 0;
+
+  ret = iotjs_entry(arg->argc, arg->argv);
+  tuv_cleanup();
+
+  sleep(1);
+  printf("iotjs thread end\n");
+  return NULL;
+}
+
+int iotjs(int argc, char *argv[]) {
+  pthread_attr_t attr;
+  int status;
+  struct sched_param sparam;
+  pthread_t tid;
+  struct iotjs_thread_arg arg;
+
+  status = pthread_attr_init(&attr);
+  if (status != 0) {
+    printf("fail to initialize iotjs thread\n");
+    return -1;
+  }
+
+  sparam.sched_priority = CONFIG_IOTJS_PRIORITY;
+  status = pthread_attr_setschedparam(&attr, &sparam);
+  status = pthread_attr_setschedpolicy(&attr, SCHED_RR);
+  status = pthread_attr_setstacksize(&attr, CONFIG_IOTJS_STACKSIZE);
+
+  arg.argc = argc;
+  arg.argv = argv;
+
+  status = pthread_create(&tid, &attr, iotjs_thread, &arg);
+  if (status < 0) {
+    printf("fail to start iotjs thread\n");
+    return -1;
+  }
+  pthread_setname_np(tid, "iotjs_thread");
+  pthread_join(tid, NULL);
+
+  return 0;
+}
+
+#else
+
+static int iotjs(int argc, char *argv[]) {
+  int ret = 0;
+  ret = iotjs_entry(argc, argv);
+  tuv_cleanup();
+  return ret;
+}
+
+#endif
+
+int iotjs_register_cmds(void) {
+  tash_cmd_install("iotjs", iotjs, TASH_EXECMD_SYNC);
+  return 0;
+}
+
+#ifdef CONFIG_BUILD_KERNEL
+int main(int argc, FAR char *argv[])
+#else
+int iotjs_main(int argc, char *argv[])
+#endif
+{
+  return iotjs_register_cmds();
+}
diff --git a/config/tizenrt/artik05x/app/jerry_port.c b/config/tizenrt/artik05x/app/jerry_port.c
new file mode 100644 (file)
index 0000000..886f749
--- /dev/null
@@ -0,0 +1,68 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "jerryscript-ext/handler.h"
+#include "jerryscript-port.h"
+#include "jerryscript.h"
+
+/**
+ * Aborts the program.
+ */
+void jerry_port_fatal(jerry_fatal_code_t code) {
+  exit(1);
+} /* jerry_port_fatal */
+
+/**
+ * Provide log message implementation for the engine.
+ */
+void jerry_port_log(jerry_log_level_t level, /**< log level */
+                    const char *format,      /**< format string */
+                    ...) {                   /**< parameters */
+  /* Drain log messages since IoT.js has not support log levels yet. */
+} /* jerry_port_log */
+
+/**
+ * Dummy function to get the time zone.
+ *
+ * @return true
+ */
+bool jerry_port_get_time_zone(jerry_time_zone_t *tz_p) {
+  /* We live in UTC. */
+  tz_p->offset = 0;
+  tz_p->daylight_saving_time = 0;
+
+  return true;
+} /* jerry_port_get_time_zone */
+
+/**
+ * Dummy function to get the current time.
+ *
+ * @return 0
+ */
+double jerry_port_get_current_time(void) {
+  return 0;
+} /* jerry_port_get_current_time */
+
+/**
+ * Provide the implementation of jerryx_port_handler_print_char.
+ * Uses 'printf' to print a single character to standard output.
+ */
+void jerryx_port_handler_print_char(char c) { /**< the character to print */
+  printf("%c", c);
+} /* jerryx_port_handler_print_char */
diff --git a/config/tizenrt/artik05x/configs/Make.defs b/config/tizenrt/artik05x/configs/Make.defs
new file mode 100644 (file)
index 0000000..b12a570
--- /dev/null
@@ -0,0 +1,164 @@
+###########################################################################
+#
+# Copyright 2017-present Samsung Electronics All Rights Reserved.
+#
+# 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.
+#
+###########################################################################
+############################################################################
+# configs/artik053/iotivity/Make.defs
+#
+#   Copyright (C) 2011, 2012-2013 Gregory Nutt. All rights reserved.
+#   Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+#    used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+include ${TOPDIR}/tools/Config.mk
+include ${TOPDIR}/arch/arm/src/armv7-r/Toolchain.defs
+
+LDSCRIPT = flash.ld
+
+ifeq ($(CONFIG_UCLIBCXX_HAVE_LIBSUPCXX),y)
+LIBSUPXX = ${shell $(CC) --print-file-name=libsupc++.a}
+EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}"
+EXTRA_LIBS = -lsupc++
+endif
+
+EXTRA_LIBS += -lhttpparser -liotjs -ljerry-core -ltuv -ljerry-libm
+
+ifeq ($(WINTOOL),y)
+  # Windows-native toolchains
+  DIRLINK = $(TOPDIR)/tools/copydir.sh
+  DIRUNLINK = $(TOPDIR)/tools/unlink.sh
+  MKDEP = $(TOPDIR)/tools/mkwindeps.sh
+  ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
+  ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" -isystem "${shell cygpath -w $(TOPDIR)/include/uClibc++}"
+  ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
+else
+  # Linux/Cygwin-native toolchain
+  MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
+  ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/../framework/include
+  ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx -isystem $(TOPDIR)/include/uClibc++
+  ARCHSCRIPT = -T$(TOPDIR)/../build/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
+
+endif
+
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
+ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
+ARCHCCMINOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f2}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+  ARCHOPTIMIZATION = -g
+endif
+
+ifneq ($(CONFIG_DEBUG_NOOPT),y)
+  ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
+endif
+
+ifeq ($(CONFIG_FRAME_POINTER),y)
+  ARCHOPTIMIZATION += -fno-omit-frame-pointer -mapcs -mno-sched-prolog
+endif
+
+ARCHCFLAGS = -fno-builtin -mcpu=cortex-r4 -mfpu=vfpv3
+ARCHCXXFLAGS = -fno-builtin -fexceptions -mcpu=cortex-r4 -mfpu=vfpv3
+ifeq ($(QUICKBUILD),y)
+ARCHWARNINGS = -Wall -Werror -Wstrict-prototypes -Wshadow -Wundef -Wno-implicit-function-declaration -Wno-unused-function -Wno-unused-but-set-variable
+ARCHWARNINGSXX = -Wall -Werror -Wshadow -Wundef
+else
+ARCHWARNINGS = -Wall -Werror -Wstrict-prototypes -Wshadow -Wundef -Wno-implicit-function-declaration -Wno-unused-function -Wno-unused-but-set-variable
+ARCHWARNINGSXX = -Wall -Werror -Wshadow -Wundef
+# only version 4.9 supports color diagnostics
+ifeq "$(ARCHMAJOR)" "4"
+ifeq "$(ARCHMINOR)" "9"
+  ARCHWARNINGS += -fdiagnostics-color=auto
+  ARCHWARNINGSCC += -fdiagnostics-color=auto
+endif
+endif
+
+endif
+ARCHDEFINES =
+ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
+
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -ffunction-sections -fdata-sections
+CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+MAXOPTIMIZATION = -O0
+
+
+NXFLATLDFLAGS1 = -r -d -warn-common
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
+LDNXFLATFLAGS = -e main -s 2048
+
+ASMEXT = .S
+OBJEXT = .o
+LIBEXT = .a
+EXEEXT =
+
+ifneq ($(CROSSDEV),arm-nuttx-elf-)
+  LDFLAGS += -nostartfiles -nodefaultlibs
+endif
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+  LDFLAGS += -g
+endif
+
+LDFLAGS += --gc-sections
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
+HOSTLDFLAGS =
+
+define DOWNLOAD
+       @$(TOPDIR)/../build/configs/artik053/artik053_download.sh $(1)
+endef
+
diff --git a/config/tizenrt/artik05x/configs/defconfig b/config/tizenrt/artik05x/configs/defconfig
new file mode 100644 (file)
index 0000000..920bc20
--- /dev/null
@@ -0,0 +1,1201 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# TinyAra Configuration
+#
+
+#
+# Build Setup
+#
+# CONFIG_EXPERIMENTAL is not set
+# CONFIG_DEFAULT_SMALL is not set
+CONFIG_HOST_LINUX=y
+# CONFIG_HOST_OSX is not set
+# CONFIG_HOST_WINDOWS is not set
+# CONFIG_HOST_OTHER is not set
+# CONFIG_WINDOWS_NATIVE is not set
+
+#
+# Build Configuration
+#
+CONFIG_APPS_DIR="../apps"
+CONFIG_FRAMEWORK_DIR="../framework"
+CONFIG_TOOLS_DIR="../tools"
+CONFIG_BUILD_FLAT=y
+# CONFIG_BUILD_PROTECTED is not set
+# CONFIG_BUILD_2PASS is not set
+
+#
+# Binary Output Formats
+#
+# CONFIG_INTELHEX_BINARY is not set
+# CONFIG_MOTOROLA_SREC is not set
+CONFIG_RAW_BINARY=y
+CONFIG_SAMSUNG_NS2=y
+# CONFIG_UBOOT_UIMAGE is not set
+# CONFIG_DOWNLOAD_IMAGE is not set
+# CONFIG_SMARTFS_IMAGE is not set
+
+#
+# Customize Header Files
+#
+# CONFIG_ARCH_STDINT_H is not set
+# CONFIG_ARCH_STDBOOL_H is not set
+# CONFIG_ARCH_MATH_H is not set
+# CONFIG_ARCH_FLOAT_H is not set
+# CONFIG_ARCH_STDARG_H is not set
+
+#
+# Debug Options
+#
+CONFIG_DEBUG=y
+CONFIG_DEBUG_ERROR=y
+# CONFIG_DEBUG_WARN is not set
+CONFIG_DEBUG_VERBOSE=y
+
+#
+# Subsystem Debug Options
+#
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_LIB is not set
+# CONFIG_DEBUG_MM is not set
+CONFIG_DEBUG_NET=y
+# CONFIG_DEBUG_NET_ERROR is not set
+# CONFIG_DEBUG_NET_INFO is not set
+# CONFIG_DEBUG_SCHED is not set
+CONFIG_DEBUG_WLAN=y
+
+#
+# SLSI WLAN FW Debug Options
+#
+# CONFIG_SCSC_ENABLE_FWFAULT_LOG is not set
+
+#
+# SLSI WLAN Driver Debug Options
+#
+CONFIG_DEBUG_WLAN_DRIVER_ERROR=y
+# CONFIG_DEBUG_WLAN_DRIVER_DEBUG is not set
+# CONFIG_DEBUG_WLAN_DRIVER_MORE is not set
+# CONFIG_DEBUG_WLAN_DRIVER_VERBOSE is not set
+
+#
+# SLSI WPA Supplicant Debug Options
+#
+CONFIG_DEBUG_WLAN_SUPPLICANT_ERROR=y
+# CONFIG_DEBUG_WLAN_SUPPLICANT_DEBUG is not set
+# CONFIG_DEBUG_WLAN_SUPPLICANT_MORE is not set
+# CONFIG_DEBUG_WLAN_SUPPLICANT_VERBOSE is not set
+
+#
+# SLSI Wi-Fi API Debug Options
+#
+CONFIG_DEBUG_WLAN_API_ERROR=y
+# CONFIG_DEBUG_WLAN_API_DEBUG is not set
+# CONFIG_DEBUG_WLAN_API_VERBOSE is not set
+
+#
+# OS Function Debug Options
+#
+# CONFIG_ARCH_HAVE_HEAPCHECK is not set
+CONFIG_DEBUG_MM_HEAPINFO=y
+# CONFIG_DEBUG_IRQ is not set
+
+#
+# Driver Debug Options
+#
+# CONFIG_DEBUG_PWM is not set
+# CONFIG_DEBUG_RTC is not set
+# CONFIG_DEBUG_SPI is not set
+# CONFIG_DEBUG_WATCHDOG is not set
+# CONFIG_DEBUG_TTRACE is not set
+
+#
+# Stack Debug Options
+#
+CONFIG_ARCH_HAVE_STACKCHECK=y
+CONFIG_STACK_COLORATION=y
+
+#
+# Build Debug Options
+#
+CONFIG_DEBUG_SYMBOLS=y
+# CONFIG_FRAME_POINTER is not set
+CONFIG_ARCH_HAVE_CUSTOMOPT=y
+# CONFIG_DEBUG_NOOPT is not set
+# CONFIG_DEBUG_CUSTOMOPT is not set
+CONFIG_DEBUG_FULLOPT=y
+
+#
+# Chip Selection
+#
+CONFIG_ARCH_ARM=y
+CONFIG_ARCH="arm"
+
+#
+# ARM Options
+#
+CONFIG_ARCH_CHIP_S5J=y
+# CONFIG_ARCH_CORTEXM3 is not set
+# CONFIG_ARCH_CORTEXM4 is not set
+CONFIG_ARCH_CORTEXR4=y
+CONFIG_ARCH_FAMILY="armv7-r"
+CONFIG_ARCH_CHIP="s5j"
+# CONFIG_ARCH_HAVE_FPU is not set
+CONFIG_ARMV7M_MPU=y
+CONFIG_ARMV7M_MPU_NREGIONS=12
+
+#
+# Exception stack options
+#
+CONFIG_ARCH_HAVE_DABORTSTACK=y
+CONFIG_ARCH_DABORTSTACK=0
+
+#
+# ARMv7-R Configuration Options
+#
+CONFIG_ARMV7R_HAVE_GICv2=y
+CONFIG_ARMV7R_MEMINIT=y
+CONFIG_ARMV7R_ICACHE=y
+CONFIG_ARMV7R_DCACHE=y
+# CONFIG_ARMV7R_DCACHE_WRITETHROUGH is not set
+# CONFIG_ARMV7R_HAVE_L2CC is not set
+# CONFIG_ARMV7R_HAVE_L2CC_PL310 is not set
+# CONFIG_ARMV7R_TOOLCHAIN_BUILDROOT is not set
+# CONFIG_ARMV7R_TOOLCHAIN_CODESOURCERYL is not set
+CONFIG_ARMV7R_TOOLCHAIN_GNU_EABIL=y
+# CONFIG_ARMV7R_TOOLCHAIN_GNU_OABI is not set
+# CONFIG_ARMV7R_HAVE_DECODEFIQ is not set
+# CONFIG_BOOT_RESULT is not set
+
+#
+# S5J Configuration Options
+#
+CONFIG_ARCH_CHIP_S5JT200=y
+CONFIG_S5J_S5JT200=y
+
+#
+# S5J Peripheral Support
+#
+CONFIG_S5J_HAVE_ADC=y
+CONFIG_S5J_HAVE_I2C=y
+CONFIG_S5J_HAVE_MCT=y
+CONFIG_S5J_HAVE_PWM0=y
+CONFIG_S5J_HAVE_PWM1=y
+CONFIG_S5J_HAVE_PWM2=y
+CONFIG_S5J_HAVE_PWM3=y
+CONFIG_S5J_HAVE_PWM4=y
+CONFIG_S5J_HAVE_PWM5=y
+CONFIG_S5J_HAVE_PWR=y
+CONFIG_S5J_HAVE_RTC=y
+CONFIG_S5J_HAVE_SFLASH=y
+CONFIG_S5J_HAVE_SPI=y
+CONFIG_S5J_HAVE_SSS=y
+CONFIG_S5J_HAVE_UART0=y
+CONFIG_S5J_HAVE_UART1=y
+CONFIG_S5J_HAVE_UART2=y
+CONFIG_S5J_HAVE_UART3=y
+CONFIG_S5J_HAVE_UART4=y
+CONFIG_S5J_HAVE_WATCHDOG=y
+CONFIG_S5J_ADC=y
+CONFIG_S5J_I2C=y
+# CONFIG_S5J_MCT is not set
+# CONFIG_S5J_TIMER0 is not set
+# CONFIG_S5J_TIMER1 is not set
+# CONFIG_S5J_TIMER2 is not set
+# CONFIG_S5J_TIMER3 is not set
+# CONFIG_S5J_UART_FLOWCONTROL is not set
+CONFIG_S5J_UART0=y
+CONFIG_S5J_UART1=y
+CONFIG_S5J_UART2=y
+# CONFIG_S5J_UART2_FLOWCONTROL is not set
+CONFIG_S5J_UART3=y
+# CONFIG_S5J_UART3_FLOWCONTROL is not set
+CONFIG_S5J_UART4=y
+CONFIG_S5J_PWM=y
+CONFIG_S5J_PWM0=y
+CONFIG_S5J_PWM1=y
+CONFIG_S5J_PWM2=y
+CONFIG_S5J_PWM3=y
+CONFIG_S5J_PWM4=y
+CONFIG_S5J_PWM5=y
+CONFIG_S5J_SSS=y
+CONFIG_S5J_SPI=y
+# CONFIG_S5J_WATCHDOG is not set
+CONFIG_S5J_SFLASH=y
+CONFIG_S5J_PWR=y
+
+#
+# PMU Configuration
+#
+CONFIG_S5J_PWR_DSTOP=y
+# CONFIG_S5J_PWR_SLEEP is not set
+
+#
+# Architecture Options
+#
+# CONFIG_ARCH_NOINTC is not set
+# CONFIG_ARCH_VECNOTIRQ is not set
+# CONFIG_ARCH_DMA is not set
+# CONFIG_ARCH_HAVE_IRQPRIO is not set
+# CONFIG_ARCH_L2CACHE is not set
+# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set
+# CONFIG_ARCH_HAVE_ADDRENV is not set
+# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set
+CONFIG_ARCH_HAVE_VFORK=y
+# CONFIG_ARCH_HAVE_MMU is not set
+CONFIG_ARCH_HAVE_MPU=y
+# CONFIG_ARCH_NAND_HWECC is not set
+# CONFIG_ARCH_HAVE_EXTCLK is not set
+# CONFIG_ARCH_HAVE_POWEROFF is not set
+CONFIG_ARCH_HAVE_RESET=y
+CONFIG_ARCH_USE_MPU=y
+CONFIG_ARCH_STACKDUMP=y
+# CONFIG_ENDIAN_BIG is not set
+# CONFIG_ARCH_IDLE_CUSTOM is not set
+CONFIG_ARCH_CUSTOM_PMINIT=y
+# CONFIG_ARCH_HAVE_RAMFUNCS is not set
+# CONFIG_ARCH_HAVE_RAMVECTORS is not set
+
+#
+# Board Settings
+#
+CONFIG_BOARD_LOOPSPERMSEC=29100
+# CONFIG_ARCH_CALIBRATION is not set
+
+#
+# Interrupt options
+#
+CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
+CONFIG_ARCH_INTERRUPTSTACK=0
+# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set
+
+#
+# Boot options
+#
+# CONFIG_BOOT_RUNFROMEXTSRAM is not set
+CONFIG_BOOT_RUNFROMFLASH=y
+# CONFIG_BOOT_RUNFROMISRAM is not set
+# CONFIG_BOOT_RUNFROMSDRAM is not set
+# CONFIG_BOOT_COPYTORAM is not set
+
+#
+# Boot Memory Configuration
+#
+CONFIG_RAM_START=0x02023800
+CONFIG_RAM_SIZE=804864
+# CONFIG_ARCH_HAVE_SDRAM is not set
+
+#
+# Board Selection
+#
+CONFIG_ARCH_BOARD_ARTIK053=y
+# CONFIG_ARCH_BOARD_SIDK_S5JT200 is not set
+CONFIG_ARCH_BOARD="artik053"
+
+#
+# Common Board Options
+#
+# CONFIG_BOARD_CRASHDUMP is not set
+CONFIG_LIB_BOARDCTL=y
+CONFIG_BOARDCTL_RESET=y
+# CONFIG_BOARDCTL_UNIQUEID is not set
+# CONFIG_BOARD_COREDUMP_FLASH is not set
+# CONFIG_BOARD_FOTA_SUPPORT is not set
+# CONFIG_BOARD_RAMDUMP_FLASH is not set
+# CONFIG_BOARD_RAMDUMP_UART is not set
+
+#
+# Board-Specific Options
+#
+CONFIG_ARTIK053_BOOT_FAILURE_DETECTION=y
+CONFIG_ARTIK053_BOOT_COUNTS_ADDR=0x80090810
+CONFIG_ARTIK053_FLASH_CAPACITY=8388608
+CONFIG_ARTIK053_FLASH_PAGE_SIZE=4096
+CONFIG_ARTIK053_FLASH_PART=y
+CONFIG_ARTIK053_FLASH_MINOR=0
+CONFIG_ARTIK053_FLASH_PART_LIST="16,48,192,32,512,2400,1536,1536,1000,400,8,512,"
+CONFIG_ARTIK053_FLASH_PART_TYPE="none,ftl,none,none,none,none,none,ftl,smartfs,romfs,config,none,"
+CONFIG_ARTIK053_FLASH_PART_NAME="bl1,sssro,bl2,sssfw,wlanfw,os,factory,ota,user,rom,nvram,sssrw,"
+CONFIG_ARTIK053_AUTOMOUNT=y
+CONFIG_ARTIK053_AUTOMOUNT_USERFS=y
+CONFIG_ARTIK053_AUTOMOUNT_USERFS_DEVNAME="/dev/smart0p8"
+CONFIG_ARTIK053_AUTOMOUNT_USERFS_MOUNTPOINT="/mnt"
+
+#
+# RTOS Features
+#
+CONFIG_DISABLE_OS_API=y
+# CONFIG_DISABLE_POSIX_TIMERS is not set
+# CONFIG_DISABLE_PTHREAD is not set
+# CONFIG_DISABLE_SIGNALS is not set
+# CONFIG_DISABLE_MQUEUE is not set
+# CONFIG_DISABLE_ENVIRON is not set
+
+#
+# Clocks and Timers
+#
+CONFIG_ARCH_HAVE_TICKLESS=y
+# CONFIG_SCHED_TICKLESS is not set
+CONFIG_USEC_PER_TICK=9979
+CONFIG_SYSTEM_TIME64=y
+CONFIG_CLOCK_MONOTONIC=y
+# CONFIG_JULIAN_TIME is not set
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_WDOG_INTRESERVE=4
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# Tasks and Scheduling
+#
+CONFIG_INIT_ENTRYPOINT=y
+CONFIG_RR_INTERVAL=100
+CONFIG_TASK_NAME_SIZE=31
+CONFIG_MAX_TASKS=32
+CONFIG_SCHED_HAVE_PARENT=y
+# CONFIG_SCHED_CHILD_STATUS is not set
+CONFIG_SCHED_WAITPID=y
+
+#
+# Pthread Options
+#
+CONFIG_PTHREAD_MUTEX_TYPES=y
+# CONFIG_PTHREAD_MUTEX_ROBUST is not set
+CONFIG_PTHREAD_MUTEX_UNSAFE=y
+# CONFIG_PTHREAD_MUTEX_BOTH is not set
+CONFIG_NPTHREAD_KEYS=4
+# CONFIG_PTHREAD_CLEANUP is not set
+# CONFIG_CANCELLATION_POINTS is not set
+
+#
+# Performance Monitoring
+#
+# CONFIG_SCHED_CPULOAD is not set
+# CONFIG_SCHED_INSTRUMENTATION is not set
+
+#
+# Latency optimization
+#
+# CONFIG_SCHED_YIELD_OPTIMIZATION is not set
+
+#
+# Files and I/O
+#
+CONFIG_DEV_CONSOLE=y
+# CONFIG_FDCLONE_DISABLE is not set
+# CONFIG_FDCLONE_STDIO is not set
+# CONFIG_SDCLONE_DISABLE is not set
+CONFIG_NFILE_DESCRIPTORS=16
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_PRIORITY_INHERITANCE=y
+CONFIG_SEM_PREALLOCHOLDERS=16
+CONFIG_SEM_NNESTPRIO=16
+
+#
+# RTOS hooks
+#
+CONFIG_BOARD_INITIALIZE=y
+# CONFIG_BOARD_INITTHREAD is not set
+# CONFIG_SCHED_STARTHOOK is not set
+CONFIG_SCHED_ATEXIT=y
+CONFIG_SCHED_ONEXIT=y
+CONFIG_SCHED_ONEXIT_MAX=1
+
+#
+# Signal Numbers
+#
+CONFIG_SIG_SIGUSR1=1
+CONFIG_SIG_SIGUSR2=2
+CONFIG_SIG_SIGALARM=3
+CONFIG_SIG_SIGCHLD=4
+CONFIG_SIG_SIGCONDTIMEDOUT=16
+CONFIG_SIG_SIGWORK=17
+
+#
+# POSIX Message Queue Options
+#
+CONFIG_PREALLOC_MQ_MSGS=4
+CONFIG_MQ_MAXMSGSIZE=600
+
+#
+# Work Queue Support
+#
+CONFIG_SCHED_WORKQUEUE=y
+CONFIG_SCHED_WORKQUEUE_SORTING=y
+CONFIG_SCHED_HPWORK=y
+CONFIG_SCHED_HPWORKPRIORITY=224
+CONFIG_SCHED_HPWORKPERIOD=50000
+CONFIG_SCHED_HPWORKSTACKSIZE=2048
+CONFIG_SCHED_LPWORK=y
+CONFIG_SCHED_LPNTHREADS=1
+CONFIG_SCHED_LPWORKPRIORITY=176
+CONFIG_SCHED_LPWORKPRIOMAX=176
+CONFIG_SCHED_LPWORKPERIOD=50000
+CONFIG_SCHED_LPWORKSTACKSIZE=2048
+
+#
+# Stack size information
+#
+CONFIG_IDLETHREAD_STACKSIZE=1024
+CONFIG_USERMAIN_STACKSIZE=2048
+CONFIG_PREAPP_STACKSIZE=2048
+# CONFIG_MPU_STACKGAURD is not set
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=2048
+
+#
+# System Call
+#
+# CONFIG_LIB_SYSCALL is not set
+
+#
+# Device Drivers
+#
+# CONFIG_DISABLE_POLL is not set
+CONFIG_DEV_NULL=y
+CONFIG_DEV_ZERO=y
+
+#
+# Buffering
+#
+# CONFIG_DRVR_WRITEBUFFER is not set
+# CONFIG_DRVR_READAHEAD is not set
+# CONFIG_CAN is not set
+# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set
+# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set
+CONFIG_PWM=y
+# CONFIG_ARCH_HAVE_I2CRESET is not set
+CONFIG_I2C=y
+CONFIG_I2C_SLAVE=y
+CONFIG_I2C_USERIO=y
+CONFIG_I2C_TRANSFER=y
+CONFIG_I2C_POLLED=y
+# CONFIG_I2C_TRACE is not set
+# CONFIG_I2C_WRITEREAD is not set
+CONFIG_SPI=y
+# CONFIG_SPI_OWNBUS is not set
+# CONFIG_SPI_EXCHANGE is not set
+# CONFIG_SPI_CMDDATA is not set
+# CONFIG_SPI_BITBANG is not set
+CONFIG_GPIO=y
+CONFIG_I2S=y
+# CONFIG_BCH is not set
+CONFIG_RTC=y
+CONFIG_RTC_DATETIME=y
+# CONFIG_RTC_ALARM is not set
+CONFIG_RTC_DRIVER=y
+# CONFIG_RTC_IOCTL is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_DEVPATH="/dev/watchdog0"
+# CONFIG_TIMER is not set
+CONFIG_ANALOG=y
+CONFIG_ADC=y
+CONFIG_ADC_FIFOSIZE=8
+# CONFIG_DAC is not set
+# CONFIG_AUDIO_DEVICES is not set
+# CONFIG_LCD is not set
+CONFIG_NETDEVICES=y
+
+#
+# General Ethernet MAC Driver Options
+#
+CONFIG_NETDEV_TELNET=y
+CONFIG_NETDEV_MULTINIC=y
+# CONFIG_NET_DUMPPACKET is not set
+
+#
+# External Ethernet MAC Device Support
+#
+# CONFIG_NET_DM90x0 is not set
+# CONFIG_ENC28J60 is not set
+# CONFIG_ENCX24J600 is not set
+# CONFIG_NET_E1000 is not set
+# CONFIG_NET_SLIP is not set
+# CONFIG_NET_VNET is not set
+# CONFIG_PIPES is not set
+CONFIG_POWER=y
+# CONFIG_BATTERY_CHARGER is not set
+# CONFIG_BATTERY_GAUGE is not set
+# CONFIG_SERCOMM_CONSOLE is not set
+CONFIG_SERIAL=y
+# CONFIG_DEV_LOWCONSOLE is not set
+# CONFIG_16550_UART is not set
+# CONFIG_ARCH_HAVE_UART is not set
+CONFIG_ARCH_HAVE_UART0=y
+CONFIG_ARCH_HAVE_UART1=y
+CONFIG_ARCH_HAVE_UART2=y
+CONFIG_ARCH_HAVE_UART3=y
+CONFIG_ARCH_HAVE_UART4=y
+# CONFIG_ARCH_HAVE_UART5 is not set
+# CONFIG_ARCH_HAVE_UART6 is not set
+# CONFIG_ARCH_HAVE_UART7 is not set
+# CONFIG_ARCH_HAVE_UART8 is not set
+# CONFIG_ARCH_HAVE_SCI0 is not set
+# CONFIG_ARCH_HAVE_SCI1 is not set
+# CONFIG_ARCH_HAVE_USART0 is not set
+# CONFIG_ARCH_HAVE_USART1 is not set
+# CONFIG_ARCH_HAVE_USART2 is not set
+# CONFIG_ARCH_HAVE_USART3 is not set
+# CONFIG_ARCH_HAVE_USART4 is not set
+# CONFIG_ARCH_HAVE_USART5 is not set
+# CONFIG_ARCH_HAVE_USART6 is not set
+# CONFIG_ARCH_HAVE_USART7 is not set
+# CONFIG_ARCH_HAVE_USART8 is not set
+# CONFIG_ARCH_HAVE_OTHER_UART is not set
+
+#
+# USART Configuration
+#
+CONFIG_MCU_SERIAL=y
+CONFIG_STANDARD_SERIAL=y
+CONFIG_SERIAL_NPOLLWAITERS=2
+# CONFIG_SERIAL_IFLOWCONTROL is not set
+# CONFIG_SERIAL_OFLOWCONTROL is not set
+# CONFIG_SERIAL_TIOCSERGSTRUCT is not set
+CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
+CONFIG_SERIAL_TERMIOS=y
+# CONFIG_UART0_SERIAL_CONSOLE is not set
+# CONFIG_UART1_SERIAL_CONSOLE is not set
+# CONFIG_UART2_SERIAL_CONSOLE is not set
+# CONFIG_UART3_SERIAL_CONSOLE is not set
+CONFIG_UART4_SERIAL_CONSOLE=y
+# CONFIG_OTHER_SERIAL_CONSOLE is not set
+# CONFIG_NO_SERIAL_CONSOLE is not set
+
+#
+# UART0 Configuration
+#
+CONFIG_UART0_RXBUFSIZE=64
+CONFIG_UART0_TXBUFSIZE=64
+CONFIG_UART0_BAUD=115200
+CONFIG_UART0_BITS=8
+CONFIG_UART0_PARITY=0
+CONFIG_UART0_2STOP=0
+# CONFIG_UART0_IFLOWCONTROL is not set
+# CONFIG_UART0_OFLOWCONTROL is not set
+
+#
+# UART1 Configuration
+#
+CONFIG_UART1_RXBUFSIZE=256
+CONFIG_UART1_TXBUFSIZE=256
+CONFIG_UART1_BAUD=115200
+CONFIG_UART1_BITS=8
+CONFIG_UART1_PARITY=0
+CONFIG_UART1_2STOP=0
+# CONFIG_UART1_IFLOWCONTROL is not set
+# CONFIG_UART1_OFLOWCONTROL is not set
+
+#
+# UART2 Configuration
+#
+CONFIG_UART2_RXBUFSIZE=256
+CONFIG_UART2_TXBUFSIZE=256
+CONFIG_UART2_BAUD=115200
+CONFIG_UART2_BITS=8
+CONFIG_UART2_PARITY=0
+CONFIG_UART2_2STOP=0
+# CONFIG_UART2_IFLOWCONTROL is not set
+# CONFIG_UART2_OFLOWCONTROL is not set
+
+#
+# UART3 Configuration
+#
+CONFIG_UART3_RXBUFSIZE=256
+CONFIG_UART3_TXBUFSIZE=256
+CONFIG_UART3_BAUD=115200
+CONFIG_UART3_BITS=8
+CONFIG_UART3_PARITY=0
+CONFIG_UART3_2STOP=0
+# CONFIG_UART3_IFLOWCONTROL is not set
+# CONFIG_UART3_OFLOWCONTROL is not set
+
+#
+# UART4 Configuration
+#
+CONFIG_UART4_RXBUFSIZE=256
+CONFIG_UART4_TXBUFSIZE=256
+CONFIG_UART4_BAUD=115200
+CONFIG_UART4_BITS=8
+CONFIG_UART4_PARITY=0
+CONFIG_UART4_2STOP=0
+# CONFIG_UART4_IFLOWCONTROL is not set
+# CONFIG_UART4_OFLOWCONTROL is not set
+# CONFIG_USBDEV is not set
+# CONFIG_FOTA_DRIVER is not set
+
+#
+# System Logging
+#
+# CONFIG_RAMLOG is not set
+# CONFIG_SYSLOG_CONSOLE is not set
+
+#
+# T-trace
+#
+# CONFIG_TTRACE is not set
+
+#
+# Wireless Device Options
+#
+CONFIG_DRIVERS_WIRELESS=y
+CONFIG_SCSC_WLAN=y
+# CONFIG_SLSI_RX_PERFORMANCE_TEST is not set
+CONFIG_SCSC_TX_FLOW_CONTROL=y
+CONFIG_SCSC_ENABLE_PORT_CONTROL=y
+# CONFIG_SCSC_WLAN_STA_ONLY is not set
+# CONFIG_SCSC_WLAN_BLOCK_IPV6 is not set
+# CONFIG_SCSC_WLAN_UDP_FLOWCONTROL is not set
+# CONFIG_SCSC_WLAN_AUTO_RECOVERY is not set
+CONFIG_SCSC_WLAN_POWER_SAVE=y
+CONFIG_SCSC_WLAN_MAX_INTERFACES=1
+CONFIG_SCSC_CORE=y
+CONFIG_SCSC_PLATFORM=y
+# CONFIG_SCSC_WLANLITE is not set
+# CONFIG_SCSC_DISABLE_WLAN_RESET is not set
+
+#
+# Networking Support
+#
+CONFIG_ARCH_HAVE_NET=y
+# CONFIG_ARCH_HAVE_PHY is not set
+CONFIG_NET=y
+CONFIG_NET_LWIP=y
+
+#
+# LwIP options
+#
+CONFIG_NET_IPv4=y
+CONFIG_NET_IP_DEFAULT_TTL=255
+# CONFIG_NET_IP_FORWARD is not set
+CONFIG_NET_IP_OPTIONS_ALLOWED=y
+CONFIG_NET_IP_FRAG=y
+CONFIG_NET_IP_REASSEMBLY=y
+CONFIG_NET_IPV4_REASS_MAX_PBUFS=20
+CONFIG_NET_IPV4_REASS_MAXAGE=5
+
+#
+# Socket support
+#
+CONFIG_NET_SOCKET=y
+CONFIG_NSOCKET_DESCRIPTORS=8
+CONFIG_NET_TCP_KEEPALIVE=y
+CONFIG_NET_RAW=y
+# CONFIG_NET_SOCKET_OPTION_BROADCAST is not set
+# CONFIG_NET_RANDOMIZE_INITIAL_LOCAL_PORTS is not set
+# CONFIG_NET_SO_SNDTIMEO is not set
+CONFIG_NET_SO_RCVTIMEO=y
+# CONFIG_NET_SO_RCVBUF is not set
+CONFIG_NET_SO_REUSE=y
+# CONFIG_NET_SO_REUSE_RXTOALL is not set
+CONFIG_NET_ARP=y
+CONFIG_NET_ARP_TABLESIZE=10
+CONFIG_NET_ARP_QUEUEING=y
+CONFIG_NET_ETHARP_TRUST_IP_MAC=y
+CONFIG_NET_ETH_PAD_SIZE=0
+# CONFIG_NET_ARP_STATIC_ENTRIES is not set
+CONFIG_NET_UDP=y
+# CONFIG_NET_NETBUF_RECVINFO is not set
+CONFIG_NET_UDP_TTL=255
+# CONFIG_NET_UDPLITE is not set
+CONFIG_NET_TCP=y
+CONFIG_NET_TCP_TTL=255
+CONFIG_NET_TCP_WND=58400
+CONFIG_NET_TCP_MAXRTX=12
+CONFIG_NET_TCP_SYNMAXRTX=6
+CONFIG_NET_TCP_QUEUE_OOSEQ=y
+CONFIG_NET_TCP_MSS=1460
+CONFIG_NET_TCP_CALCULATE_EFF_SEND_MSS=y
+CONFIG_NET_TCP_SND_BUF=29200
+CONFIG_NET_TCP_SND_QUEUELEN=80
+# CONFIG_NET_TCP_LISTEN_BACKLOG is not set
+CONFIG_NET_TCP_OVERSIZE=536
+# CONFIG_NET_TCP_TIMESTAMPS is not set
+CONFIG_NET_TCP_WND_UPDATE_THREASHOLD=536
+CONFIG_NET_ICMP=y
+CONFIG_NET_ICMP_TTL=255
+# CONFIG_NET_BROADCAST_PING is not set
+# CONFIG_NET_MULTICAST_PING is not set
+CONFIG_NET_LWIP_IGMP=y
+CONFIG_NET_LWIP_MEMP_NUM_IGMP_GROUP=8
+
+#
+# LWIP Mailbox Configurations
+#
+CONFIG_NET_TCPIP_MBOX_SIZE=64
+CONFIG_NET_DEFAULT_ACCEPTMBOX_SIZE=64
+CONFIG_NET_DEFAULT_RAW_RECVMBOX_SIZE=64
+CONFIG_NET_DEFAULT_TCP_RECVMBOX_SIZE=54
+CONFIG_NET_DEFAULT_UDP_RECVMBOX_SIZE=64
+
+#
+# Memory Configurations
+#
+CONFIG_NET_MEM_ALIGNMENT=4
+# CONFIG_NET_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT is not set
+# CONFIG_NET_MEM_LIBC_MALLOC is not set
+CONFIG_NET_MEMP_MEM_MALLOC=y
+# CONFIG_NET_MEM_USE_POOLS is not set
+CONFIG_NET_MEM_SIZE=153600
+
+#
+# LWIP Task Configurations
+#
+# CONFIG_NET_TCPIP_CORE_LOCKING is not set
+# CONFIG_NET_TCPIP_CORE_LOCKING_INPUT is not set
+CONFIG_NET_TCPIP_THREAD_NAME="LWIP_TCP/IP"
+CONFIG_NET_TCPIP_THREAD_PRIO=110
+CONFIG_NET_TCPIP_THREAD_STACKSIZE=4096
+CONFIG_NET_COMPAT_MUTEX=y
+CONFIG_NET_SYS_LIGHTWEIGHT_PROT=y
+CONFIG_NET_DEFAULT_THREAD_NAME="lwIP"
+CONFIG_NET_DEFAULT_THREAD_PRIO=1
+CONFIG_NET_DEFAULT_THREAD_STACKSIZE=0
+
+#
+# Debug Options for Network
+#
+# CONFIG_NET_LWIP_DEBUG is not set
+
+#
+# Enable Statistics
+#
+CONFIG_NET_STATS=y
+CONFIG_NET_STATS_DISPLAY=y
+CONFIG_NET_LINK_STATS=y
+CONFIG_NET_ETHARP_STATS=y
+CONFIG_NET_IP_STATS=y
+# CONFIG_NET_IPFRAG_STATS is not set
+# CONFIG_NET_ICMP_STATS is not set
+CONFIG_NET_UDP_STATS=y
+CONFIG_NET_TCP_STATS=y
+CONFIG_NET_MEM_STATS=y
+CONFIG_NET_SYS_STATS=y
+# CONFIG_NET_LWIP_VLAN is not set
+CONFIG_NET_LWIP_LOOPBACK_INTERFACE=y
+# CONFIG_NET_LWIP_SLIP_INTERFACE is not set
+# CONFIG_NET_LWIP_PPP_SUPPORT is not set
+# CONFIG_NET_LWIP_SNMP is not set
+CONFIG_NET_SECURITY_TLS=y
+# CONFIG_TLS_WITH_SSS is not set
+
+#
+# Driver buffer configuration
+#
+CONFIG_NET_MULTIBUFFER=y
+CONFIG_NET_ETH_MTU=1500
+CONFIG_NET_GUARDSIZE=2
+
+#
+# Data link support
+#
+# CONFIG_NET_MULTILINK is not set
+CONFIG_NET_ETHERNET=y
+
+#
+# Network Device Operations
+#
+# CONFIG_NETDEV_PHY_IOCTL is not set
+
+#
+# Routing Table Configuration
+#
+# CONFIG_NET_ROUTE is not set
+
+#
+# File Systems
+#
+
+#
+# File system configuration
+#
+# CONFIG_DISABLE_MOUNTPOINT is not set
+# CONFIG_FS_AUTOMOUNTER is not set
+# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
+CONFIG_FS_READABLE=y
+CONFIG_FS_WRITABLE=y
+# CONFIG_FS_AIO is not set
+# CONFIG_FS_NAMED_SEMAPHORES is not set
+CONFIG_FS_MQUEUE_MPATH="/var/mqueue"
+CONFIG_FS_SMARTFS=y
+
+#
+# SMARTFS options
+#
+CONFIG_SMARTFS_ERASEDSTATE=0xff
+CONFIG_SMARTFS_MAXNAMLEN=32
+# CONFIG_SMARTFS_MULTI_ROOT_DIRS is not set
+CONFIG_SMARTFS_ALIGNED_ACCESS=y
+# CONFIG_SMARTFS_BAD_SECTOR is not set
+# CONFIG_SMARTFS_DYNAMIC_HEADER is not set
+# CONFIG_SMARTFS_JOURNALING is not set
+# CONFIG_SMARTFS_SECTOR_RECOVERY is not set
+CONFIG_FS_PROCFS=y
+
+#
+# Exclude individual procfs entries
+#
+# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set
+# CONFIG_FS_PROCFS_EXCLUDE_VERSION is not set
+# CONFIG_FS_PROCFS_EXCLUDE_MTD is not set
+# CONFIG_FS_PROCFS_EXCLUDE_PARTITIONS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_SMARTFS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_POWER is not set
+CONFIG_FS_ROMFS=y
+
+#
+# Block Driver Configurations
+#
+CONFIG_RAMDISK=y
+
+#
+# MTD Configuration
+#
+CONFIG_MTD=y
+CONFIG_MTD_PARTITION=y
+CONFIG_MTD_PARTITION_NAMES=y
+CONFIG_MTD_PROGMEM=y
+CONFIG_MTD_FTL=y
+
+#
+# MTD_FTL Configurations
+#
+CONFIG_MTD_CONFIG=y
+
+#
+# MTD Configurations
+#
+# CONFIG_MTD_CONFIG_RAM_CONSOLIDATE is not set
+CONFIG_MTD_CONFIG_ERASEDVALUE=0xff
+# CONFIG_MTD_BYTE_WRITE is not set
+
+#
+# MTD Device Drivers
+#
+# CONFIG_MTD_M25P is not set
+# CONFIG_RAMMTD is not set
+CONFIG_MTD_SMART=y
+
+#
+# SMART Device options
+#
+CONFIG_MTD_SMART_SECTOR_SIZE=4096
+# CONFIG_MTD_SMART_WEAR_LEVEL is not set
+# CONFIG_MTD_SMART_ENABLE_CRC is not set
+# CONFIG_MTD_SMART_SECTOR_ERASE_DEBUG is not set
+# CONFIG_MTD_SMART_ALLOC_DEBUG is not set
+
+#
+# System Logging
+#
+# CONFIG_SYSLOG is not set
+# CONFIG_SYSLOG_TIMESTAMP is not set
+
+#
+# Arastorage
+#
+
+#
+# AraStorage database configuration
+#
+# CONFIG_ARASTORAGE is not set
+
+#
+# Memory Management
+#
+# CONFIG_DISABLE_REALLOC_NEIGHBOR_EXTENTION is not set
+# CONFIG_MM_SMALL is not set
+CONFIG_MM_REGIONS=1
+# CONFIG_ARCH_HAVE_HEAP2 is not set
+# CONFIG_GRAN is not set
+
+#
+# Power Management
+#
+CONFIG_PM=y
+# CONFIG_DEBUG_PM is not set
+# CONFIG_PM_TEST is not set
+CONFIG_PM_DEVNAME_LEN=32
+# CONFIG_PM_METRICS is not set
+CONFIG_PM_SLICEMS=100
+CONFIG_PM_NDOMAINS=1
+CONFIG_PM_MEMORY=2
+CONFIG_PM_COEFN=1
+CONFIG_PM_COEF1=1
+CONFIG_PM_COEF2=1
+CONFIG_PM_COEF3=1
+CONFIG_PM_COEF4=1
+CONFIG_PM_COEF5=1
+CONFIG_PM_IDLEENTER_THRESH=1
+CONFIG_PM_IDLEEXIT_THRESH=2
+CONFIG_PM_IDLEENTER_COUNT=30
+CONFIG_PM_STANDBYENTER_THRESH=1
+CONFIG_PM_STANDBYEXIT_THRESH=2
+CONFIG_PM_STANDBYENTER_COUNT=50
+CONFIG_PM_SLEEPENTER_THRESH=1
+CONFIG_PM_SLEEPEXIT_THRESH=2
+CONFIG_PM_SLEEPENTER_COUNT=70
+
+#
+# Logger Module
+#
+CONFIG_LOGM=y
+# CONFIG_PRINTF2LOGM is not set
+CONFIG_SYSLOG2LOGM=y
+# CONFIG_LOGM_TIMESTAMP is not set
+CONFIG_LOGM_BUFFER_SIZE=10240
+CONFIG_LOGM_PRINT_INTERVAL=1000
+CONFIG_LOGM_TASK_PRIORITY=110
+CONFIG_LOGM_TASK_STACKSIZE=2048
+# CONFIG_LOGM_TEST is not set
+
+#
+# Library Routines
+#
+
+#
+# Standard C Library Options
+#
+CONFIG_STDIO_BUFFER_SIZE=64
+CONFIG_STDIO_LINEBUFFER=y
+CONFIG_NUNGET_CHARS=2
+CONFIG_LIB_HOMEDIR="/"
+CONFIG_LIBM=y
+# CONFIG_NOPRINTF_FIELDWIDTH is not set
+CONFIG_LIBC_FLOATINGPOINT=y
+CONFIG_LIBC_IOCTL_VARIADIC=y
+CONFIG_LIB_RAND_ORDER=1
+# CONFIG_EOL_IS_CR is not set
+# CONFIG_EOL_IS_LF is not set
+# CONFIG_EOL_IS_BOTH_CRLF is not set
+CONFIG_EOL_IS_EITHER_CRLF=y
+CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024
+CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
+CONFIG_LIBC_STRERROR=y
+# CONFIG_LIBC_STRERROR_SHORT is not set
+# CONFIG_LIBC_PERROR_STDOUT is not set
+CONFIG_LIBC_TMPDIR="/tmp"
+CONFIG_LIBC_MAX_TMPFILE=32
+CONFIG_ARCH_LOWPUTC=y
+# CONFIG_LIBC_LOCALTIME is not set
+# CONFIG_TIME_EXTENDED is not set
+CONFIG_LIB_SENDFILE_BUFSIZE=512
+# CONFIG_ARCH_ROMGETC is not set
+CONFIG_ARCH_OPTIMIZED_FUNCTIONS=y
+# CONFIG_ARCH_MEMCPY is not set
+CONFIG_MEMCPY_VIK=y
+# CONFIG_MEMCPY_PRE_INC_PTRS is not set
+CONFIG_MEMCPY_INDEXED_COPY=y
+# CONFIG_MEMCPY_64BIT is not set
+# CONFIG_ARCH_MEMCMP is not set
+# CONFIG_ARCH_MEMMOVE is not set
+# CONFIG_ARCH_MEMSET is not set
+# CONFIG_MEMSET_OPTSPEED is not set
+# CONFIG_ARCH_STRCHR is not set
+# CONFIG_ARCH_STRCMP is not set
+# CONFIG_ARCH_STRCPY is not set
+# CONFIG_ARCH_STRNCPY is not set
+# CONFIG_ARCH_STRLEN is not set
+# CONFIG_ARCH_STRNLEN is not set
+# CONFIG_ARCH_BZERO is not set
+CONFIG_LIBC_NETDB=y
+# CONFIG_NETDB_HOSTFILE is not set
+CONFIG_NETDB_DNSCLIENT=y
+CONFIG_NETDB_DNSCLIENT_ENTRIES=8
+CONFIG_NETDB_DNSCLIENT_NAMESIZE=32
+CONFIG_NETDB_DNSCLIENT_LIFESEC=3600
+CONFIG_NETDB_DNSCLIENT_MAXRESPONSE=512
+# CONFIG_NETDB_RESOLVCONF is not set
+CONFIG_NETDB_DNSSERVER_BY_DHCP=y
+# CONFIG_NETDB_DNSSERVER_IPv4 is not set
+
+#
+# Non-standard Library Support
+#
+
+#
+# Basic CXX Support
+#
+# CONFIG_C99_BOOL8 is not set
+# CONFIG_HAVE_CXX is not set
+
+#
+# External Functions
+#
+CONFIG_DM=y
+# CONFIG_LWM2M_WAKAAMA is not set
+CONFIG_DM_WIFI=y
+CONFIG_DM_AP_SSID="TizenRT1"
+CONFIG_DM_AP_PASS="tizenrt_tdc2017"
+CONFIG_DM_AP_SECURITY="wpa2_aes"
+
+#
+# IOTIVITY Config Parameters
+#
+# CONFIG_ENABLE_IOTIVITY is not set
+# CONFIG_LIBTUV is not set
+# CONFIG_AWS_SDK is not set
+
+#
+# Application Configuration
+#
+# CONFIG_ENTRY_MANUAL is not set
+
+#
+# Application entry point list
+#
+# CONFIG_ENTRY_HELLO is not set
+# CONFIG_ENTRY_IPERF is not set
+# CONFIG_ENTRY_WIFI_TEST is not set
+CONFIG_ENTRY_IOTJS=y
+CONFIG_USER_ENTRYPOINT="iotjs_main"
+CONFIG_BUILTIN_APPS=y
+
+#
+# Examples
+#
+# CONFIG_EXAMPLES_ARTIK_DEMO is not set
+# CONFIG_EXAMPLES_AWS is not set
+# CONFIG_EXAMPLES_DNSCLIENT_TEST is not set
+# CONFIG_EXAMPLES_DTLS_CLIENT is not set
+# CONFIG_EXAMPLES_DTLS_SERVER is not set
+# CONFIG_EXAMPLES_EEPROM_TEST is not set
+# CONFIG_EXAMPLES_FOTA_SAMPLE is not set
+CONFIG_EXAMPLES_HELLO=y
+# CONFIG_EXAMPLES_HELLO_TASH is not set
+# CONFIG_EXAMPLES_HELLOXX is not set
+# CONFIG_EXAMPLES_IOTBUS_TEST is not set
+CONFIG_EXAMPLES_IPERF=y
+# CONFIG_EXAMPLES_KERNEL_SAMPLE is not set
+# CONFIG_EXAMPLES_LIBTUV is not set
+# CONFIG_EXAMPLES_MTDPART is not set
+# CONFIG_EXAMPLES_NETTEST is not set
+# CONFIG_EXAMPLES_PROC_TEST is not set
+# CONFIG_EXAMPLES_SELECT_TEST is not set
+# CONFIG_EXAMPLES_SENSORBOARD is not set
+CONFIG_EXAMPLES_SLSIWIFI=y
+CONFIG_EXAMPLES_SLSIWIFI_PRIORITY=50
+CONFIG_EXAMPLES_SLSIWIFI_STACKSIZE=2048
+# CONFIG_EXAMPLES_SMART is not set
+# CONFIG_EXAMPLES_SMART_TEST is not set
+# CONFIG_EXAMPLES_SYSIO_TEST is not set
+# CONFIG_EXAMPLES_TESTCASE is not set
+# CONFIG_EXAMPLES_TLS_CLIENT is not set
+# CONFIG_EXAMPLES_TLS_SELFTEST is not set
+# CONFIG_EXAMPLES_TLS_SERVER is not set
+# CONFIG_EXAMPLES_WAKAAMA_CLIENT is not set
+CONFIG_EXAMPLES_WIFI_TEST=y
+# CONFIG_EXAMPLES_WORKQUEUE is not set
+
+#
+# Network Utilities
+#
+# CONFIG_NETUTILS_CODECS is not set
+CONFIG_NETUTILS_DHCPC=y
+CONFIG_NETUTILS_DHCPD=y
+CONFIG_NETUTILS_DHCPD_IGNOREBROADCAST=y
+CONFIG_NETUTILS_DHCPD_INTERFACE="wl1"
+CONFIG_NETUTILS_DHCPD_LEASETIME=864000
+CONFIG_NETUTILS_DHCPD_MINLEASETIME=86400
+CONFIG_NETUTILS_DHCPD_MAXLEASETIME=2592000
+CONFIG_NETUTILS_DHCPD_MAXLEASES=6
+CONFIG_NETUTILS_DHCPD_STARTIP=0xc0a82f02
+CONFIG_NETUTILS_DHCPD_ROUTERIP=0xc0a82f01
+CONFIG_NETUTILS_DHCPD_NETMASK=0xffffff00
+CONFIG_NETUTILS_DHCPD_DNSIP=0x08080808
+CONFIG_NETUTILS_DHCPD_OFFERTIME=3600
+CONFIG_NETUTILS_DHCPD_DECLINETIME=3600
+# CONFIG_NETUTILS_ERCOAP is not set
+# CONFIG_NETUTILS_FTPC is not set
+CONFIG_NETUTILS_FTPD=y
+CONFIG_NETUTILS_JSON=y
+# CONFIG_NETUTILS_MDNS is not set
+# CONFIG_NETUTILS_MQTT is not set
+CONFIG_NETUTILS_NETLIB=y
+# CONFIG_NETUTILS_NTPCLIENT is not set
+# CONFIG_NETUTILS_SMTP is not set
+# CONFIG_NETUTILS_TELNETD is not set
+# CONFIG_NETUTILS_TFTPC is not set
+# CONFIG_NETUTILS_WEBCLIENT is not set
+# CONFIG_NETUTILS_WEBSERVER is not set
+# CONFIG_NETUTILS_WEBSOCKET is not set
+CONFIG_NETUTILS_WIFI=y
+CONFIG_SLSI_WIFI_DEFAULT_WLAN_COUNTRY_CODE="00"
+CONFIG_SLSI_WIFI_DEFAULT_WLAN_TX_POWER=30
+# CONFIG_SLSI_WIFI_FILESYSTEM_SUPPORT is not set
+# CONFIG_NETUTILS_XMLRPC is not set
+
+#
+# Platform-specific Support
+#
+# CONFIG_PLATFORM_CONFIGDATA is not set
+
+#
+# Shell
+#
+CONFIG_TASH=y
+CONFIG_TASH_MAX_COMMANDS=132
+# CONFIG_DEBUG_TASH is not set
+CONFIG_TASH_TELNET_INTERFACE=y
+CONFIG_TASH_CMDTASK_STACKSIZE=4096
+CONFIG_TASH_CMDTASK_PRIORITY=100
+
+#
+# System Libraries and Add-Ons
+#
+# CONFIG_SYSTEM_CLE is not set
+# CONFIG_SYSTEM_CUTERM is not set
+# CONFIG_SYSTEM_FOTA_HAL is not set
+# CONFIG_SYSTEM_I2CTOOL is not set
+# CONFIG_SYSTEM_INIFILE is not set
+# CONFIG_SYSTEM_INSTALL is not set
+CONFIG_SYSTEM_IOTJS=y
+CONFIG_IOTJS_PRIORITY=100
+CONFIG_IOTJS_STACKSIZE=65536
+# CONFIG_SYSTEM_NETDB is not set
+# CONFIG_SYSTEM_POWEROFF is not set
+CONFIG_SYSTEM_RAMTEST=y
+# CONFIG_SYSTEM_RAMTRON is not set
+CONFIG_SYSTEM_READLINE=y
+CONFIG_READLINE_ECHO=y
+CONFIG_SYSTEM_INFORMATION=y
+CONFIG_KERNEL_CMDS=y
+CONFIG_FS_CMDS=y
+CONFIG_FSCMD_BUFFER_LEN=64
+CONFIG_NET_CMDS=y
+CONFIG_ENABLE_DATE=y
+CONFIG_ENABLE_ENV_GET=y
+CONFIG_ENABLE_ENV_SET=y
+CONFIG_ENABLE_ENV_UNSET=y
+CONFIG_ENABLE_FREE=y
+CONFIG_ENABLE_HEAPINFO=y
+CONFIG_ENABLE_KILL=y
+CONFIG_ENABLE_KILLALL=y
+CONFIG_ENABLE_PS=y
+CONFIG_ENABLE_STACKMONITOR=y
+CONFIG_STACKMONITOR_PRIORITY=100
+CONFIG_STACKMONITOR_INTERVAL=5
+CONFIG_ENABLE_UPTIME=y
+CONFIG_SYSTEM_VI=y
+CONFIG_SYSTEM_VI_COLS=64
+CONFIG_SYSTEM_VI_ROWS=16
+CONFIG_SYSTEM_VI_DEBUGLEVEL=0
+
+#
+# wpa_supplicant
+#
+CONFIG_WPA_SUPPLICANT=y
+CONFIG_WPA_SUPPLICANT_PRIORITY=100
+CONFIG_WPA_SUPPLICANT_STACKSIZE=16384
+CONFIG_WPA_SUPPLICANT_ENTRYPOINT="wpa_supplicant_main"
+CONFIG_CTRL_IFACE=y
+CONFIG_CTRL_IFACE_FIFO=y
+CONFIG_WPA_CTRL_FIFO_DEV_REQ="/dev/wpa_ctrl_req"
+CONFIG_WPA_CTRL_FIFO_DEV_CFM="/dev/wpa_ctrl_cfm"
+CONFIG_WPA_CTRL_FIFO_DEV_GLOBAL_REQ="/dev/wpa_ctrl_global_req"
+CONFIG_WPA_CTRL_FIFO_DEV_GLOBAL_CFM="/dev/wpa_ctrl_global_cfm"
+CONFIG_WPA_MONITOR_FIFO_DEV="/dev/wpa_monitor"
+CONFIG_WPA_CTRL_FIFO_MK_MODE=666
+CONFIG_ELOOP_POLL=y
+# CONFIG_WPA_SUPPLICANT_CMD is not set
diff --git a/deps/http-parser/.mailmap b/deps/http-parser/.mailmap
new file mode 100644 (file)
index 0000000..278d141
--- /dev/null
@@ -0,0 +1,8 @@
+# update AUTHORS with:
+#   git log --all --reverse --format='%aN <%aE>' | perl -ne 'BEGIN{print "# Authors ordered by first contribution.\n"} print unless $h{$_}; $h{$_} = 1' > AUTHORS
+Ryan Dahl <ry@tinyclouds.org>
+Salman Haq <salman.haq@asti-usa.com>
+Simon Zimmermann <simonz05@gmail.com>
+Thomas LE ROUX <thomas@november-eleven.fr> LE ROUX Thomas <thomas@procheo.fr>
+Thomas LE ROUX <thomas@november-eleven.fr> Thomas LE ROUX <thomas@procheo.fr>
+Fedor Indutny <fedor@indutny.com>
diff --git a/deps/http-parser/.travis.yml b/deps/http-parser/.travis.yml
new file mode 100644 (file)
index 0000000..4b038e6
--- /dev/null
@@ -0,0 +1,13 @@
+language: c
+
+compiler:
+  - clang
+  - gcc
+
+script:
+  - "make"
+
+notifications:
+  email: false
+  irc:
+    - "irc.freenode.net#node-ci"
diff --git a/deps/http-parser/AUTHORS b/deps/http-parser/AUTHORS
new file mode 100644 (file)
index 0000000..8e2df1d
--- /dev/null
@@ -0,0 +1,67 @@
+# Authors ordered by first contribution.
+Ryan Dahl <ry@tinyclouds.org>
+Jeremy Hinegardner <jeremy@hinegardner.org>
+Sergey Shepelev <temotor@gmail.com>
+Joe Damato <ice799@gmail.com>
+tomika <tomika_nospam@freemail.hu>
+Phoenix Sol <phoenix@burninglabs.com>
+Cliff Frey <cliff@meraki.com>
+Ewen Cheslack-Postava <ewencp@cs.stanford.edu>
+Santiago Gala <sgala@apache.org>
+Tim Becker <tim.becker@syngenio.de>
+Jeff Terrace <jterrace@gmail.com>
+Ben Noordhuis <info@bnoordhuis.nl>
+Nathan Rajlich <nathan@tootallnate.net>
+Mark Nottingham <mnot@mnot.net>
+Aman Gupta <aman@tmm1.net>
+Tim Becker <tim.becker@kuriositaet.de>
+Sean Cunningham <sean.cunningham@mandiant.com>
+Peter Griess <pg@std.in>
+Salman Haq <salman.haq@asti-usa.com>
+Cliff Frey <clifffrey@gmail.com>
+Jon Kolb <jon@b0g.us>
+Fouad Mardini <f.mardini@gmail.com>
+Paul Querna <pquerna@apache.org>
+Felix Geisendörfer <felix@debuggable.com>
+koichik <koichik@improvement.jp>
+Andre Caron <andre.l.caron@gmail.com>
+Ivo Raisr <ivosh@ivosh.net>
+James McLaughlin <jamie@lacewing-project.org>
+David Gwynne <loki@animata.net>
+Thomas LE ROUX <thomas@november-eleven.fr>
+Randy Rizun <rrizun@ortivawireless.com>
+Andre Louis Caron <andre.louis.caron@usherbrooke.ca>
+Simon Zimmermann <simonz05@gmail.com>
+Erik Dubbelboer <erik@dubbelboer.com>
+Martell Malone <martellmalone@gmail.com>
+Bertrand Paquet <bpaquet@octo.com>
+BogDan Vatra <bogdan@kde.org>
+Peter Faiman <peter@thepicard.org>
+Corey Richardson <corey@octayn.net>
+Tóth Tamás <tomika_nospam@freemail.hu>
+Cam Swords <cam.swords@gmail.com>
+Chris Dickinson <christopher.s.dickinson@gmail.com>
+Uli Köhler <ukoehler@btronik.de>
+Charlie Somerville <charlie@charliesomerville.com>
+Patrik Stutz <patrik.stutz@gmail.com>
+Fedor Indutny <fedor.indutny@gmail.com>
+runner <runner.mei@gmail.com>
+Alexis Campailla <alexis@janeasystems.com>
+David Wragg <david@wragg.org>
+Vinnie Falco <vinnie.falco@gmail.com>
+Alex Butum <alexbutum@linux.com>
+Rex Feng <rexfeng@gmail.com>
+Alex Kocharin <alex@kocharin.ru>
+Mark Koopman <markmontymark@yahoo.com>
+Helge Heß <me@helgehess.eu>
+Alexis La Goutte <alexis.lagoutte@gmail.com>
+George Miroshnykov <george.miroshnykov@gmail.com>
+Maciej Małecki <me@mmalecki.com>
+Marc O'Morain <github.com@marcomorain.com>
+Jeff Pinner <jpinner@twitter.com>
+Timothy J Fontaine <tjfontaine@gmail.com>
+Akagi201 <akagi201@gmail.com>
+Romain Giraud <giraud.romain@gmail.com>
+Jay Satiro <raysatiro@yahoo.com>
+Arne Steen <Arne.Steen@gmx.de>
+Kjell Schubert <kjell.schubert@gmail.com>
diff --git a/deps/http-parser/CMakeLists.txt b/deps/http-parser/CMakeLists.txt
new file mode 100644 (file)
index 0000000..cd3d8ee
--- /dev/null
@@ -0,0 +1,29 @@
+cmake_minimum_required(VERSION 2.8)
+
+PROJECT(http-parser C)
+
+set(targetName httpparser)
+
+INCLUDE_DIRECTORIES(./)
+
+if("${OS}" MATCHES "NUTTX|TIZENRT")
+  set(TARGET_INCLUDE "${NUTTX_HOME}/include")
+  set(TARGET_INCLUDE ${TARGET_INCLUDE} "${NUTTX_HOME}/include/cxx")
+  INCLUDE_DIRECTORIES(./ ${TARGET_INCLUDE})
+endif()
+
+
+if("${CMAKE_BUILD_TYPE}" MATCHES "Release|MinSizeRel")
+  # If we are building for release modify it to MinSizeRel for -Os option.
+  set(CMAKE_BUILD_TYPE "MinSizeRel")
+else()
+  # Any other case just assume debug build.
+  set(CMAKE_BUILD_TYPE "Debug")
+endif()
+
+message("HTTP Parser configured with:")
+message(STATUS "CMAKE_BUILD_TYPE     ${CMAKE_BUILD_TYPE}")
+message(STATUS "OS                   ${OS}")
+message(STATUS "NUTTX_HOME           ${NUTTX_HOME}")
+
+ADD_LIBRARY(${targetName} STATIC http_parser.c)
diff --git a/deps/http-parser/LICENSE-MIT b/deps/http-parser/LICENSE-MIT
new file mode 100644 (file)
index 0000000..58010b3
--- /dev/null
@@ -0,0 +1,23 @@
+http_parser.c is based on src/http/ngx_http_parse.c from NGINX copyright
+Igor Sysoev.
+
+Additional changes are licensed under the same terms as NGINX and
+copyright Joyent, Inc. and other Node contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE. 
diff --git a/deps/http-parser/Makefile b/deps/http-parser/Makefile
new file mode 100644 (file)
index 0000000..62009ff
--- /dev/null
@@ -0,0 +1,141 @@
+# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
+ifeq (darwin,$(PLATFORM))
+SONAME ?= libhttp_parser.2.5.0.dylib
+SOEXT ?= dylib
+else
+SONAME ?= libhttp_parser.so.2.5.0
+SOEXT ?= so
+endif
+CC?=gcc
+AR?=ar
+
+CPPFLAGS ?=
+LDFLAGS ?=
+
+CPPFLAGS += -I.
+CPPFLAGS_DEBUG = $(CPPFLAGS) -DHTTP_PARSER_STRICT=1
+CPPFLAGS_DEBUG += $(CPPFLAGS_DEBUG_EXTRA)
+CPPFLAGS_FAST = $(CPPFLAGS) -DHTTP_PARSER_STRICT=0
+CPPFLAGS_FAST += $(CPPFLAGS_FAST_EXTRA)
+CPPFLAGS_BENCH = $(CPPFLAGS_FAST)
+
+CFLAGS += -Wall -Wextra -Werror
+CFLAGS_DEBUG = $(CFLAGS) -O0 -g $(CFLAGS_DEBUG_EXTRA)
+CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA)
+CFLAGS_BENCH = $(CFLAGS_FAST) -Wno-unused-parameter
+CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
+
+LDFLAGS_LIB = $(LDFLAGS) -shared
+
+INSTALL ?= install
+PREFIX ?= $(DESTDIR)/usr/local
+LIBDIR = $(PREFIX)/lib
+INCLUDEDIR = $(PREFIX)/include
+
+ifneq (darwin,$(PLATFORM))
+# TODO(bnoordhuis) The native SunOS linker expects -h rather than -soname...
+LDFLAGS_LIB += -Wl,-soname=$(SONAME)
+endif
+
+test: test_g test_fast
+       ./test_g
+       ./test_fast
+
+test_g: http_parser_g.o test_g.o
+       $(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o test_g.o -o $@
+
+test_g.o: test.c http_parser.h Makefile
+       $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) -c test.c -o $@
+
+http_parser_g.o: http_parser.c http_parser.h Makefile
+       $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) -c http_parser.c -o $@
+
+test_fast: http_parser.o test.o http_parser.h
+       $(CC) $(CFLAGS_FAST) $(LDFLAGS) http_parser.o test.o -o $@
+
+test.o: test.c http_parser.h Makefile
+       $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c test.c -o $@
+
+bench: http_parser.o bench.o
+       $(CC) $(CFLAGS_BENCH) $(LDFLAGS) http_parser.o bench.o -o $@
+
+bench.o: bench.c http_parser.h Makefile
+       $(CC) $(CPPFLAGS_BENCH) $(CFLAGS_BENCH) -c bench.c -o $@
+
+http_parser.o: http_parser.c http_parser.h Makefile
+       $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c
+
+test-run-timed: test_fast
+       while(true) do time ./test_fast > /dev/null; done
+
+test-valgrind: test_g
+       valgrind ./test_g
+
+libhttp_parser.o: http_parser.c http_parser.h Makefile
+       $(CC) $(CPPFLAGS_FAST) $(CFLAGS_LIB) -c http_parser.c -o libhttp_parser.o
+
+library: libhttp_parser.o
+       $(CC) $(LDFLAGS_LIB) -o $(SONAME) $<
+
+package: http_parser.o
+       $(AR) rcs libhttp_parser.a http_parser.o
+
+url_parser: http_parser.o contrib/url_parser.c
+       $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o $@
+
+url_parser_g: http_parser_g.o contrib/url_parser.c
+       $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o $@
+
+parsertrace: http_parser.o contrib/parsertrace.c
+       $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace
+
+parsertrace_g: http_parser_g.o contrib/parsertrace.c
+       $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g
+
+tags: http_parser.c http_parser.h test.c
+       ctags $^
+
+install: library
+       $(INSTALL) -D  http_parser.h $(INCLUDEDIR)/http_parser.h
+       $(INSTALL) -D $(SONAME) $(LIBDIR)/$(SONAME)
+       ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT)
+
+install-strip: library
+       $(INSTALL) -D  http_parser.h $(INCLUDEDIR)/http_parser.h
+       $(INSTALL) -D -s $(SONAME) $(LIBDIR)/$(SONAME)
+       ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT)
+
+uninstall:
+       rm $(INCLUDEDIR)/http_parser.h
+       rm $(LIBDIR)/$(SONAME)
+       rm $(LIBDIR)/libhttp_parser.so
+
+clean:
+       rm -f *.o *.a tags test test_fast test_g \
+               http_parser.tar libhttp_parser.so.* \
+               url_parser url_parser_g parsertrace parsertrace_g
+
+contrib/url_parser.c:  http_parser.h
+contrib/parsertrace.c: http_parser.h
+
+.PHONY: clean package test-run test-run-timed test-valgrind install install-strip uninstall
diff --git a/deps/http-parser/README.md b/deps/http-parser/README.md
new file mode 100644 (file)
index 0000000..7c54dd4
--- /dev/null
@@ -0,0 +1,183 @@
+HTTP Parser
+===========
+
+[![Build Status](https://travis-ci.org/joyent/http-parser.png?branch=master)](https://travis-ci.org/joyent/http-parser)
+
+This is a parser for HTTP messages written in C. It parses both requests and
+responses. The parser is designed to be used in performance HTTP
+applications. It does not make any syscalls nor allocations, it does not
+buffer data, it can be interrupted at anytime. Depending on your
+architecture, it only requires about 40 bytes of data per message
+stream (in a web server that is per connection).
+
+Features:
+
+  * No dependencies
+  * Handles persistent streams (keep-alive).
+  * Decodes chunked encoding.
+  * Upgrade support
+  * Defends against buffer overflow attacks.
+
+The parser extracts the following information from HTTP messages:
+
+  * Header fields and values
+  * Content-Length
+  * Request method
+  * Response status code
+  * Transfer-Encoding
+  * HTTP version
+  * Request URL
+  * Message body
+
+
+Usage
+-----
+
+One `http_parser` object is used per TCP connection. Initialize the struct
+using `http_parser_init()` and set the callbacks. That might look something
+like this for a request parser:
+```c
+http_parser_settings settings;
+settings.on_url = my_url_callback;
+settings.on_header_field = my_header_field_callback;
+/* ... */
+
+http_parser *parser = malloc(sizeof(http_parser));
+http_parser_init(parser, HTTP_REQUEST);
+parser->data = my_socket;
+```
+
+When data is received on the socket execute the parser and check for errors.
+
+```c
+size_t len = 80*1024, nparsed;
+char buf[len];
+ssize_t recved;
+
+recved = recv(fd, buf, len, 0);
+
+if (recved < 0) {
+  /* Handle error. */
+}
+
+/* Start up / continue the parser.
+ * Note we pass recved==0 to signal that EOF has been received.
+ */
+nparsed = http_parser_execute(parser, &settings, buf, recved);
+
+if (parser->upgrade) {
+  /* handle new protocol */
+} else if (nparsed != recved) {
+  /* Handle error. Usually just close the connection. */
+}
+```
+
+HTTP needs to know where the end of the stream is. For example, sometimes
+servers send responses without Content-Length and expect the client to
+consume input (for the body) until EOF. To tell http_parser about EOF, give
+`0` as the fourth parameter to `http_parser_execute()`. Callbacks and errors
+can still be encountered during an EOF, so one must still be prepared
+to receive them.
+
+Scalar valued message information such as `status_code`, `method`, and the
+HTTP version are stored in the parser structure. This data is only
+temporally stored in `http_parser` and gets reset on each new message. If
+this information is needed later, copy it out of the structure during the
+`headers_complete` callback.
+
+The parser decodes the transfer-encoding for both requests and responses
+transparently. That is, a chunked encoding is decoded before being sent to
+the on_body callback.
+
+
+The Special Problem of Upgrade
+------------------------------
+
+HTTP supports upgrading the connection to a different protocol. An
+increasingly common example of this is the Web Socket protocol which sends
+a request like
+
+        GET /demo HTTP/1.1
+        Upgrade: WebSocket
+        Connection: Upgrade
+        Host: example.com
+        Origin: http://example.com
+        WebSocket-Protocol: sample
+
+followed by non-HTTP data.
+
+(See http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75 for more
+information the Web Socket protocol.)
+
+To support this, the parser will treat this as a normal HTTP message without a
+body, issuing both on_headers_complete and on_message_complete callbacks. However
+http_parser_execute() will stop parsing at the end of the headers and return.
+
+The user is expected to check if `parser->upgrade` has been set to 1 after
+`http_parser_execute()` returns. Non-HTTP data begins at the buffer supplied
+offset by the return value of `http_parser_execute()`.
+
+
+Callbacks
+---------
+
+During the `http_parser_execute()` call, the callbacks set in
+`http_parser_settings` will be executed. The parser maintains state and
+never looks behind, so buffering the data is not necessary. If you need to
+save certain data for later usage, you can do that from the callbacks.
+
+There are two types of callbacks:
+
+* notification `typedef int (*http_cb) (http_parser*);`
+    Callbacks: on_message_begin, on_headers_complete, on_message_complete.
+* data `typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);`
+    Callbacks: (requests only) on_url,
+               (common) on_header_field, on_header_value, on_body;
+
+Callbacks must return 0 on success. Returning a non-zero value indicates
+error to the parser, making it exit immediately.
+
+In case you parse HTTP message in chunks (i.e. `read()` request line
+from socket, parse, read half headers, parse, etc) your data callbacks
+may be called more than once. Http-parser guarantees that data pointer is only
+valid for the lifetime of callback. You can also `read()` into a heap allocated
+buffer to avoid copying memory around if this fits your application.
+
+Reading headers may be a tricky task if you read/parse headers partially.
+Basically, you need to remember whether last header callback was field or value
+and apply the following logic:
+
+    (on_header_field and on_header_value shortened to on_h_*)
+     ------------------------ ------------ --------------------------------------------
+    | State (prev. callback) | Callback   | Description/action                         |
+     ------------------------ ------------ --------------------------------------------
+    | nothing (first call)   | on_h_field | Allocate new buffer and copy callback data |
+    |                        |            | into it                                    |
+     ------------------------ ------------ --------------------------------------------
+    | value                  | on_h_field | New header started.                        |
+    |                        |            | Copy current name,value buffers to headers |
+    |                        |            | list and allocate new buffer for new name  |
+     ------------------------ ------------ --------------------------------------------
+    | field                  | on_h_field | Previous name continues. Reallocate name   |
+    |                        |            | buffer and append callback data to it      |
+     ------------------------ ------------ --------------------------------------------
+    | field                  | on_h_value | Value for current header started. Allocate |
+    |                        |            | new buffer and copy callback data to it    |
+     ------------------------ ------------ --------------------------------------------
+    | value                  | on_h_value | Value continues. Reallocate value buffer   |
+    |                        |            | and append callback data to it             |
+     ------------------------ ------------ --------------------------------------------
+
+
+Parsing URLs
+------------
+
+A simplistic zero-copy URL parser is provided as `http_parser_parse_url()`.
+Users of this library may wish to use it to parse URLs constructed from
+consecutive `on_url` callbacks.
+
+See examples of reading in headers:
+
+* [partial example](http://gist.github.com/155877) in C
+* [from http-parser tests](http://github.com/joyent/http-parser/blob/37a0ff8/test.c#L403) in C
+* [from Node library](http://github.com/joyent/node/blob/842eaf4/src/http.js#L284) in Javascript
diff --git a/deps/http-parser/bench.c b/deps/http-parser/bench.c
new file mode 100644 (file)
index 0000000..5b452fa
--- /dev/null
@@ -0,0 +1,111 @@
+/* Copyright Fedor Indutny. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "http_parser.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/time.h>
+
+static const char data[] =
+    "POST /joyent/http-parser HTTP/1.1\r\n"
+    "Host: github.com\r\n"
+    "DNT: 1\r\n"
+    "Accept-Encoding: gzip, deflate, sdch\r\n"
+    "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4\r\n"
+    "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) "
+        "AppleWebKit/537.36 (KHTML, like Gecko) "
+        "Chrome/39.0.2171.65 Safari/537.36\r\n"
+    "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,"
+        "image/webp,*/*;q=0.8\r\n"
+    "Referer: https://github.com/joyent/http-parser\r\n"
+    "Connection: keep-alive\r\n"
+    "Transfer-Encoding: chunked\r\n"
+    "Cache-Control: max-age=0\r\n\r\nb\r\nhello world\r\n0\r\n\r\n";
+static const size_t data_len = sizeof(data) - 1;
+
+static int on_info(http_parser* p) {
+  return 0;
+}
+
+
+static int on_data(http_parser* p, const char *at, size_t length) {
+  return 0;
+}
+
+static http_parser_settings settings = {
+  .on_message_begin = on_info,
+  .on_headers_complete = on_info,
+  .on_message_complete = on_info,
+  .on_header_field = on_data,
+  .on_header_value = on_data,
+  .on_url = on_data,
+  .on_status = on_data,
+  .on_body = on_data
+};
+
+int bench(int iter_count, int silent) {
+  struct http_parser parser;
+  int i;
+  int err;
+  struct timeval start;
+  struct timeval end;
+  float rps;
+
+  if (!silent) {
+    err = gettimeofday(&start, NULL);
+    assert(err == 0);
+  }
+
+  for (i = 0; i < iter_count; i++) {
+    size_t parsed;
+    http_parser_init(&parser, HTTP_REQUEST);
+
+    parsed = http_parser_execute(&parser, &settings, data, data_len);
+    assert(parsed == data_len);
+  }
+
+  if (!silent) {
+    err = gettimeofday(&end, NULL);
+    assert(err == 0);
+
+    fprintf(stdout, "Benchmark result:\n");
+
+    rps = (float) (end.tv_sec - start.tv_sec) +
+          (end.tv_usec - start.tv_usec) * 1e-6f;
+    fprintf(stdout, "Took %f seconds to run\n", rps);
+
+    rps = (float) iter_count / rps;
+    fprintf(stdout, "%f req/sec\n", rps);
+    fflush(stdout);
+  }
+
+  return 0;
+}
+
+int main(int argc, char** argv) {
+  if (argc == 2 && strcmp(argv[1], "infinite") == 0) {
+    for (;;)
+      bench(5000000, 1);
+    return 0;
+  } else {
+    return bench(5000000, 0);
+  }
+}
diff --git a/deps/http-parser/contrib/parsertrace.c b/deps/http-parser/contrib/parsertrace.c
new file mode 100644 (file)
index 0000000..e715368
--- /dev/null
@@ -0,0 +1,160 @@
+/* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev
+ *
+ * Additional changes are licensed under the same terms as NGINX and
+ * copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/* Dump what the parser finds to stdout as it happen */
+
+#include "http_parser.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int on_message_begin(http_parser* _) {
+  (void)_;
+  printf("\n***MESSAGE BEGIN***\n\n");
+  return 0;
+}
+
+int on_headers_complete(http_parser* _) {
+  (void)_;
+  printf("\n***HEADERS COMPLETE***\n\n");
+  return 0;
+}
+
+int on_message_complete(http_parser* _) {
+  (void)_;
+  printf("\n***MESSAGE COMPLETE***\n\n");
+  return 0;
+}
+
+int on_url(http_parser* _, const char* at, size_t length) {
+  (void)_;
+  printf("Url: %.*s\n", (int)length, at);
+  return 0;
+}
+
+int on_header_field(http_parser* _, const char* at, size_t length) {
+  (void)_;
+  printf("Header field: %.*s\n", (int)length, at);
+  return 0;
+}
+
+int on_header_value(http_parser* _, const char* at, size_t length) {
+  (void)_;
+  printf("Header value: %.*s\n", (int)length, at);
+  return 0;
+}
+
+int on_body(http_parser* _, const char* at, size_t length) {
+  (void)_;
+  printf("Body: %.*s\n", (int)length, at);
+  return 0;
+}
+
+void usage(const char* name) {
+  fprintf(stderr,
+          "Usage: %s $type $filename\n"
+          "  type: -x, where x is one of {r,b,q}\n"
+          "  parses file as a Response, reQuest, or Both\n",
+          name);
+  exit(EXIT_FAILURE);
+}
+
+int main(int argc, char* argv[]) {
+  enum http_parser_type file_type;
+
+  if (argc != 3) {
+    usage(argv[0]);
+  }
+
+  char* type = argv[1];
+  if (type[0] != '-') {
+    usage(argv[0]);
+  }
+
+  switch (type[1]) {
+    /* in the case of "-", type[1] will be NUL */
+    case 'r':
+      file_type = HTTP_RESPONSE;
+      break;
+    case 'q':
+      file_type = HTTP_REQUEST;
+      break;
+    case 'b':
+      file_type = HTTP_BOTH;
+      break;
+    default:
+      usage(argv[0]);
+  }
+
+  char* filename = argv[2];
+  FILE* file = fopen(filename, "r");
+  if (file == NULL) {
+    perror("fopen");
+    goto fail;
+  }
+
+  fseek(file, 0, SEEK_END);
+  long file_length = ftell(file);
+  if (file_length == -1) {
+    perror("ftell");
+    goto fail;
+  }
+  fseek(file, 0, SEEK_SET);
+
+  char* data = malloc(file_length);
+  if (fread(data, 1, file_length, file) != (size_t)file_length) {
+    fprintf(stderr, "couldn't read entire file\n");
+    free(data);
+    goto fail;
+  }
+
+  http_parser_settings settings;
+  memset(&settings, 0, sizeof(settings));
+  settings.on_message_begin = on_message_begin;
+  settings.on_url = on_url;
+  settings.on_header_field = on_header_field;
+  settings.on_header_value = on_header_value;
+  settings.on_headers_complete = on_headers_complete;
+  settings.on_body = on_body;
+  settings.on_message_complete = on_message_complete;
+
+  http_parser parser;
+  http_parser_init(&parser, file_type);
+  size_t nparsed = http_parser_execute(&parser, &settings, data, file_length);
+  free(data);
+
+  if (nparsed != (size_t)file_length) {
+    fprintf(stderr,
+            "Error: %s (%s)\n",
+            http_errno_description(HTTP_PARSER_ERRNO(&parser)),
+            http_errno_name(HTTP_PARSER_ERRNO(&parser)));
+    goto fail;
+  }
+
+  return EXIT_SUCCESS;
+
+fail:
+  fclose(file);
+  return EXIT_FAILURE;
+}
diff --git a/deps/http-parser/contrib/url_parser.c b/deps/http-parser/contrib/url_parser.c
new file mode 100644 (file)
index 0000000..6650b41
--- /dev/null
@@ -0,0 +1,46 @@
+#include "http_parser.h"
+#include <stdio.h>
+#include <string.h>
+
+void
+dump_url (const char *url, const struct http_parser_url *u)
+{
+  unsigned int i;
+
+  printf("\tfield_set: 0x%x, port: %u\n", u->field_set, u->port);
+  for (i = 0; i < UF_MAX; i++) {
+    if ((u->field_set & (1 << i)) == 0) {
+      printf("\tfield_data[%u]: unset\n", i);
+      continue;
+    }
+
+    printf("\tfield_data[%u]: off: %u, len: %u, part: %.*s\n",
+           i,
+           u->field_data[i].off,
+           u->field_data[i].len,
+           u->field_data[i].len,
+           url + u->field_data[i].off);
+  }
+}
+
+int main(int argc, char ** argv) {
+  struct http_parser_url u;
+  int len, connect, result;
+
+  if (argc != 3) {
+    printf("Syntax : %s connect|get url\n", argv[0]);
+    return 1;
+  }
+  len = strlen(argv[2]);
+  connect = strcmp("connect", argv[1]) == 0 ? 1 : 0;
+  printf("Parsing %s, connect %d\n", argv[2], connect);
+
+  result = http_parser_parse_url(argv[2], len, connect, &u);
+  if (result != 0) {
+    printf("Parse error : %d\n", result);
+    return result;
+  }
+  printf("Parse ok, result : \n");
+  dump_url(argv[2], &u);
+  return 0;
+}
\ No newline at end of file
diff --git a/deps/http-parser/http_parser.c b/deps/http-parser/http_parser.c
new file mode 100644 (file)
index 0000000..cbe8a90
--- /dev/null
@@ -0,0 +1,2434 @@
+/* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev
+ *
+ * Additional changes are licensed under the same terms as NGINX and
+ * copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "http_parser.h"
+#include <assert.h>
+#include <stddef.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+
+#ifndef ULLONG_MAX
+# define ULLONG_MAX ((uint64_t) -1) /* 2^64-1 */
+#endif
+
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+#ifndef ARRAY_SIZE
+# define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#endif
+
+#ifndef BIT_AT
+# define BIT_AT(a, i)                                                \
+  (!!((unsigned int) (a)[(unsigned int) (i) >> 3] &                  \
+   (1 << ((unsigned int) (i) & 7))))
+#endif
+
+#ifndef ELEM_AT
+# define ELEM_AT(a, i, v) ((unsigned int) (i) < ARRAY_SIZE(a) ? (a)[(i)] : (v))
+#endif
+
+#define SET_ERRNO(e)                                                 \
+do {                                                                 \
+  parser->http_errno = (e);                                          \
+} while(0)
+
+#define CURRENT_STATE() p_state
+#define UPDATE_STATE(V) p_state = (enum state) (V);
+#define RETURN(V)                                                    \
+do {                                                                 \
+  parser->state = CURRENT_STATE();                                   \
+  return (V);                                                        \
+} while (0);
+#define REEXECUTE()                                                  \
+  goto reexecute;                                                    \
+
+
+#ifdef __GNUC__
+# define LIKELY(X) __builtin_expect(!!(X), 1)
+# define UNLIKELY(X) __builtin_expect(!!(X), 0)
+#else
+# define LIKELY(X) (X)
+# define UNLIKELY(X) (X)
+#endif
+
+
+/* Run the notify callback FOR, returning ER if it fails */
+#define CALLBACK_NOTIFY_(FOR, ER)                                    \
+do {                                                                 \
+  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
+                                                                     \
+  if (LIKELY(settings->on_##FOR)) {                                  \
+    parser->state = CURRENT_STATE();                                 \
+    if (UNLIKELY(0 != settings->on_##FOR(parser))) {                 \
+      SET_ERRNO(HPE_CB_##FOR);                                       \
+    }                                                                \
+    UPDATE_STATE(parser->state);                                     \
+                                                                     \
+    /* We either errored above or got paused; get out */             \
+    if (UNLIKELY(HTTP_PARSER_ERRNO(parser) != HPE_OK)) {             \
+      return (ER);                                                   \
+    }                                                                \
+  }                                                                  \
+} while (0)
+
+/* Run the notify callback FOR and consume the current byte */
+#define CALLBACK_NOTIFY(FOR)            CALLBACK_NOTIFY_(FOR, p - data + 1)
+
+/* Run the notify callback FOR and don't consume the current byte */
+#define CALLBACK_NOTIFY_NOADVANCE(FOR)  CALLBACK_NOTIFY_(FOR, p - data)
+
+/* Run data callback FOR with LEN bytes, returning ER if it fails */
+#define CALLBACK_DATA_(FOR, LEN, ER)                                 \
+do {                                                                 \
+  assert(HTTP_PARSER_ERRNO(parser) == HPE_OK);                       \
+                                                                     \
+  if (FOR##_mark) {                                                  \
+    if (LIKELY(settings->on_##FOR)) {                                \
+      parser->state = CURRENT_STATE();                               \
+      if (UNLIKELY(0 !=                                              \
+                   settings->on_##FOR(parser, FOR##_mark, (LEN)))) { \
+        SET_ERRNO(HPE_CB_##FOR);                                     \
+      }                                                              \
+      UPDATE_STATE(parser->state);                                   \
+                                                                     \
+      /* We either errored above or got paused; get out */           \
+      if (UNLIKELY(HTTP_PARSER_ERRNO(parser) != HPE_OK)) {           \
+        return (ER);                                                 \
+      }                                                              \
+    }                                                                \
+    FOR##_mark = NULL;                                               \
+  }                                                                  \
+} while (0)
+  
+/* Run the data callback FOR and consume the current byte */
+#define CALLBACK_DATA(FOR)                                           \
+    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
+
+/* Run the data callback FOR and don't consume the current byte */
+#define CALLBACK_DATA_NOADVANCE(FOR)                                 \
+    CALLBACK_DATA_(FOR, p - FOR##_mark, p - data)
+
+/* Set the mark FOR; non-destructive if mark is already set */
+#define MARK(FOR)                                                    \
+do {                                                                 \
+  if (!FOR##_mark) {                                                 \
+    FOR##_mark = p;                                                  \
+  }                                                                  \
+} while (0)
+
+/* Don't allow the total size of the HTTP headers (including the status
+ * line) to exceed HTTP_MAX_HEADER_SIZE.  This check is here to protect
+ * embedders against denial-of-service attacks where the attacker feeds
+ * us a never-ending header that the embedder keeps buffering.
+ *
+ * This check is arguably the responsibility of embedders but we're doing
+ * it on the embedder's behalf because most won't bother and this way we
+ * make the web a little safer.  HTTP_MAX_HEADER_SIZE is still far bigger
+ * than any reasonable request or response so this should never affect
+ * day-to-day operation.
+ */
+#define COUNT_HEADER_SIZE(V)                                         \
+do {                                                                 \
+  parser->nread += (V);                                              \
+  if (UNLIKELY(parser->nread > (HTTP_MAX_HEADER_SIZE))) {            \
+    SET_ERRNO(HPE_HEADER_OVERFLOW);                                  \
+    goto error;                                                      \
+  }                                                                  \
+} while (0)
+
+
+#define PROXY_CONNECTION "proxy-connection"
+#define CONNECTION "connection"
+#define CONTENT_LENGTH "content-length"
+#define TRANSFER_ENCODING "transfer-encoding"
+#define UPGRADE "upgrade"
+#define CHUNKED "chunked"
+#define KEEP_ALIVE "keep-alive"
+#define CLOSE "close"
+
+
+static const char *method_strings[] =
+  {
+#define XX(num, name, string) #string,
+  HTTP_METHOD_MAP(XX)
+#undef XX
+  };
+
+
+/* Tokens as defined by rfc 2616. Also lowercases them.
+ *        token       = 1*<any CHAR except CTLs or separators>
+ *     separators     = "(" | ")" | "<" | ">" | "@"
+ *                    | "," | ";" | ":" | "\" | <">
+ *                    | "/" | "[" | "]" | "?" | "="
+ *                    | "{" | "}" | SP | HT
+ */
+static const char tokens[256] = {
+/*   0 nul    1 soh    2 stx    3 etx    4 eot    5 enq    6 ack    7 bel  */
+        0,       0,       0,       0,       0,       0,       0,       0,
+/*   8 bs     9 ht    10 nl    11 vt    12 np    13 cr    14 so    15 si   */
+        0,       0,       0,       0,       0,       0,       0,       0,
+/*  16 dle   17 dc1   18 dc2   19 dc3   20 dc4   21 nak   22 syn   23 etb */
+        0,       0,       0,       0,       0,       0,       0,       0,
+/*  24 can   25 em    26 sub   27 esc   28 fs    29 gs    30 rs    31 us  */
+        0,       0,       0,       0,       0,       0,       0,       0,
+/*  32 sp    33  !    34  "    35  #    36  $    37  %    38  &    39  '  */
+        0,      '!',      0,      '#',     '$',     '%',     '&',    '\'',
+/*  40  (    41  )    42  *    43  +    44  ,    45  -    46  .    47  /  */
+        0,       0,      '*',     '+',      0,      '-',     '.',      0,
+/*  48  0    49  1    50  2    51  3    52  4    53  5    54  6    55  7  */
+       '0',     '1',     '2',     '3',     '4',     '5',     '6',     '7',
+/*  56  8    57  9    58  :    59  ;    60  <    61  =    62  >    63  ?  */
+       '8',     '9',      0,       0,       0,       0,       0,       0,
+/*  64  @    65  A    66  B    67  C    68  D    69  E    70  F    71  G  */
+        0,      'a',     'b',     'c',     'd',     'e',     'f',     'g',
+/*  72  H    73  I    74  J    75  K    76  L    77  M    78  N    79  O  */
+       'h',     'i',     'j',     'k',     'l',     'm',     'n',     'o',
+/*  80  P    81  Q    82  R    83  S    84  T    85  U    86  V    87  W  */
+       'p',     'q',     'r',     's',     't',     'u',     'v',     'w',
+/*  88  X    89  Y    90  Z    91  [    92  \    93  ]    94  ^    95  _  */
+       'x',     'y',     'z',      0,       0,       0,      '^',     '_',
+/*  96  `    97  a    98  b    99  c   100  d   101  e   102  f   103  g  */
+       '`',     'a',     'b',     'c',     'd',     'e',     'f',     'g',
+/* 104  h   105  i   106  j   107  k   108  l   109  m   110  n   111  o  */
+       'h',     'i',     'j',     'k',     'l',     'm',     'n',     'o',
+/* 112  p   113  q   114  r   115  s   116  t   117  u   118  v   119  w  */
+       'p',     'q',     'r',     's',     't',     'u',     'v',     'w',
+/* 120  x   121  y   122  z   123  {   124  |   125  }   126  ~   127 del */
+       'x',     'y',     'z',      0,      '|',      0,      '~',       0 };
+
+
+static const int8_t unhex[256] =
+  {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  , 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1
+  ,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+  };
+
+
+#if HTTP_PARSER_STRICT
+# define T(v) 0
+#else
+# define T(v) v
+#endif
+
+
+static const uint8_t normal_url_char[32] = {
+/*   0 nul    1 soh    2 stx    3 etx    4 eot    5 enq    6 ack    7 bel  */
+        0    |   0    |   0    |   0    |   0    |   0    |   0    |   0,
+/*   8 bs     9 ht    10 nl    11 vt    12 np    13 cr    14 so    15 si   */
+        0    | T(2)   |   0    |   0    | T(16)  |   0    |   0    |   0,
+/*  16 dle   17 dc1   18 dc2   19 dc3   20 dc4   21 nak   22 syn   23 etb */
+        0    |   0    |   0    |   0    |   0    |   0    |   0    |   0,
+/*  24 can   25 em    26 sub   27 esc   28 fs    29 gs    30 rs    31 us  */
+        0    |   0    |   0    |   0    |   0    |   0    |   0    |   0,
+/*  32 sp    33  !    34  "    35  #    36  $    37  %    38  &    39  '  */
+        0    |   2    |   4    |   0    |   16   |   32   |   64   |  128,
+/*  40  (    41  )    42  *    43  +    44  ,    45  -    46  .    47  /  */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |  128,
+/*  48  0    49  1    50  2    51  3    52  4    53  5    54  6    55  7  */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |  128,
+/*  56  8    57  9    58  :    59  ;    60  <    61  =    62  >    63  ?  */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |   0,
+/*  64  @    65  A    66  B    67  C    68  D    69  E    70  F    71  G  */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |  128,
+/*  72  H    73  I    74  J    75  K    76  L    77  M    78  N    79  O  */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |  128,
+/*  80  P    81  Q    82  R    83  S    84  T    85  U    86  V    87  W  */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |  128,
+/*  88  X    89  Y    90  Z    91  [    92  \    93  ]    94  ^    95  _  */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |  128,
+/*  96  `    97  a    98  b    99  c   100  d   101  e   102  f   103  g  */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |  128,
+/* 104  h   105  i   106  j   107  k   108  l   109  m   110  n   111  o  */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |  128,
+/* 112  p   113  q   114  r   115  s   116  t   117  u   118  v   119  w  */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |  128,
+/* 120  x   121  y   122  z   123  {   124  |   125  }   126  ~   127 del */
+        1    |   2    |   4    |   8    |   16   |   32   |   64   |   0, };
+
+#undef T
+
+enum state
+  { s_dead = 1 /* important that this is > 0 */
+
+  , s_start_req_or_res
+  , s_res_or_resp_H
+  , s_start_res
+  , s_res_H
+  , s_res_HT
+  , s_res_HTT
+  , s_res_HTTP
+  , s_res_first_http_major
+  , s_res_http_major
+  , s_res_first_http_minor
+  , s_res_http_minor
+  , s_res_first_status_code
+  , s_res_status_code
+  , s_res_status_start
+  , s_res_status
+  , s_res_line_almost_done
+
+  , s_start_req
+
+  , s_req_method
+  , s_req_spaces_before_url
+  , s_req_schema
+  , s_req_schema_slash
+  , s_req_schema_slash_slash
+  , s_req_server_start
+  , s_req_server
+  , s_req_server_with_at
+  , s_req_path
+  , s_req_query_string_start
+  , s_req_query_string
+  , s_req_fragment_start
+  , s_req_fragment
+  , s_req_http_start
+  , s_req_http_H
+  , s_req_http_HT
+  , s_req_http_HTT
+  , s_req_http_HTTP
+  , s_req_first_http_major
+  , s_req_http_major
+  , s_req_first_http_minor
+  , s_req_http_minor
+  , s_req_line_almost_done
+
+  , s_header_field_start
+  , s_header_field
+  , s_header_value_discard_ws
+  , s_header_value_discard_ws_almost_done
+  , s_header_value_discard_lws
+  , s_header_value_start
+  , s_header_value
+  , s_header_value_lws
+
+  , s_header_almost_done
+
+  , s_chunk_size_start
+  , s_chunk_size
+  , s_chunk_parameters
+  , s_chunk_size_almost_done
+
+  , s_headers_almost_done
+  , s_headers_done
+
+  /* Important: 's_headers_done' must be the last 'header' state. All
+   * states beyond this must be 'body' states. It is used for overflow
+   * checking. See the PARSING_HEADER() macro.
+   */
+
+  , s_chunk_data
+  , s_chunk_data_almost_done
+  , s_chunk_data_done
+
+  , s_body_identity
+  , s_body_identity_eof
+
+  , s_message_done
+  };
+
+
+#define PARSING_HEADER(state) (state <= s_headers_done)
+
+
+enum header_states
+  { h_general = 0
+  , h_C
+  , h_CO
+  , h_CON
+
+  , h_matching_connection
+  , h_matching_proxy_connection
+  , h_matching_content_length
+  , h_matching_transfer_encoding
+  , h_matching_upgrade
+
+  , h_connection
+  , h_content_length
+  , h_transfer_encoding
+  , h_upgrade
+
+  , h_matching_transfer_encoding_chunked
+  , h_matching_connection_token_start
+  , h_matching_connection_keep_alive
+  , h_matching_connection_close
+  , h_matching_connection_upgrade
+  , h_matching_connection_token
+
+  , h_transfer_encoding_chunked
+  , h_connection_keep_alive
+  , h_connection_close
+  , h_connection_upgrade
+  };
+
+enum http_host_state
+  {
+    s_http_host_dead = 1
+  , s_http_userinfo_start
+  , s_http_userinfo
+  , s_http_host_start
+  , s_http_host_v6_start
+  , s_http_host
+  , s_http_host_v6
+  , s_http_host_v6_end
+  , s_http_host_port_start
+  , s_http_host_port
+};
+
+/* Macros for character classes; depends on strict-mode  */
+#define CR                  '\r'
+#define LF                  '\n'
+#define LOWER(c)            (unsigned char)(c | 0x20)
+#define IS_ALPHA(c)         (LOWER(c) >= 'a' && LOWER(c) <= 'z')
+#define IS_NUM(c)           ((c) >= '0' && (c) <= '9')
+#define IS_ALPHANUM(c)      (IS_ALPHA(c) || IS_NUM(c))
+#define IS_HEX(c)           (IS_NUM(c) || (LOWER(c) >= 'a' && LOWER(c) <= 'f'))
+#define IS_MARK(c)          ((c) == '-' || (c) == '_' || (c) == '.' || \
+  (c) == '!' || (c) == '~' || (c) == '*' || (c) == '\'' || (c) == '(' || \
+  (c) == ')')
+#define IS_USERINFO_CHAR(c) (IS_ALPHANUM(c) || IS_MARK(c) || (c) == '%' || \
+  (c) == ';' || (c) == ':' || (c) == '&' || (c) == '=' || (c) == '+' || \
+  (c) == '$' || (c) == ',')
+
+#define STRICT_TOKEN(c)     (tokens[(unsigned char)c])
+
+#if HTTP_PARSER_STRICT
+#define TOKEN(c)            (tokens[(unsigned char)c])
+#define IS_URL_CHAR(c)      (BIT_AT(normal_url_char, (unsigned char)c))
+#define IS_HOST_CHAR(c)     (IS_ALPHANUM(c) || (c) == '.' || (c) == '-')
+#else
+#define TOKEN(c)            ((c == ' ') ? ' ' : tokens[(unsigned char)c])
+#define IS_URL_CHAR(c)                                                         \
+  (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80))
+#define IS_HOST_CHAR(c)                                                        \
+  (IS_ALPHANUM(c) || (c) == '.' || (c) == '-' || (c) == '_')
+#endif
+
+
+#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
+
+
+#if HTTP_PARSER_STRICT
+# define STRICT_CHECK(cond)                                          \
+do {                                                                 \
+  if (cond) {                                                        \
+    SET_ERRNO(HPE_STRICT);                                           \
+    goto error;                                                      \
+  }                                                                  \
+} while (0)
+# define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
+#else
+# define STRICT_CHECK(cond)
+# define NEW_MESSAGE() start_state
+#endif
+
+
+/* Map errno values to strings for human-readable output */
+#define HTTP_STRERROR_GEN(n, s) { "HPE_" #n, s },
+static struct {
+  const char *name;
+  const char *description;
+} http_strerror_tab[] = {
+  HTTP_ERRNO_MAP(HTTP_STRERROR_GEN)
+};
+#undef HTTP_STRERROR_GEN
+
+int http_message_needs_eof(const http_parser *parser);
+
+/* Our URL parser.
+ *
+ * This is designed to be shared by http_parser_execute() for URL validation,
+ * hence it has a state transition + byte-for-byte interface. In addition, it
+ * is meant to be embedded in http_parser_parse_url(), which does the dirty
+ * work of turning state transitions URL components for its API.
+ *
+ * This function should only be invoked with non-space characters. It is
+ * assumed that the caller cares about (and can detect) the transition between
+ * URL and non-URL states by looking for these.
+ */
+static enum state
+parse_url_char(enum state s, const char ch)
+{
+  if (ch == ' ' || ch == '\r' || ch == '\n') {
+    return s_dead;
+  }
+
+#if HTTP_PARSER_STRICT
+  if (ch == '\t' || ch == '\f') {
+    return s_dead;
+  }
+#endif
+
+  switch (s) {
+    case s_req_spaces_before_url:
+      /* Proxied requests are followed by scheme of an absolute URI (alpha).
+       * All methods except CONNECT are followed by '/' or '*'.
+       */
+
+      if (ch == '/' || ch == '*') {
+        return s_req_path;
+      }
+
+      if (IS_ALPHA(ch)) {
+        return s_req_schema;
+      }
+
+      break;
+
+    case s_req_schema:
+      if (IS_ALPHA(ch)) {
+        return s;
+      }
+
+      if (ch == ':') {
+        return s_req_schema_slash;
+      }
+
+      break;
+
+    case s_req_schema_slash:
+      if (ch == '/') {
+        return s_req_schema_slash_slash;
+      }
+
+      break;
+
+    case s_req_schema_slash_slash:
+      if (ch == '/') {
+        return s_req_server_start;
+      }
+
+      break;
+
+    case s_req_server_with_at:
+      if (ch == '@') {
+        return s_dead;
+      }
+
+    /* FALLTHROUGH */
+    case s_req_server_start:
+    case s_req_server:
+      if (ch == '/') {
+        return s_req_path;
+      }
+
+      if (ch == '?') {
+        return s_req_query_string_start;
+      }
+
+      if (ch == '@') {
+        return s_req_server_with_at;
+      }
+
+      if (IS_USERINFO_CHAR(ch) || ch == '[' || ch == ']') {
+        return s_req_server;
+      }
+
+      break;
+
+    case s_req_path:
+      if (IS_URL_CHAR(ch)) {
+        return s;
+      }
+
+      switch (ch) {
+        case '?':
+          return s_req_query_string_start;
+
+        case '#':
+          return s_req_fragment_start;
+      }
+
+      break;
+
+    case s_req_query_string_start:
+    case s_req_query_string:
+      if (IS_URL_CHAR(ch)) {
+        return s_req_query_string;
+      }
+
+      switch (ch) {
+        case '?':
+          /* allow extra '?' in query string */
+          return s_req_query_string;
+
+        case '#':
+          return s_req_fragment_start;
+      }
+
+      break;
+
+    case s_req_fragment_start:
+      if (IS_URL_CHAR(ch)) {
+        return s_req_fragment;
+      }
+
+      switch (ch) {
+        case '?':
+          return s_req_fragment;
+
+        case '#':
+          return s;
+      }
+
+      break;
+
+    case s_req_fragment:
+      if (IS_URL_CHAR(ch)) {
+        return s;
+      }
+
+      switch (ch) {
+        case '?':
+        case '#':
+          return s;
+      }
+
+      break;
+
+    default:
+      break;
+  }
+
+  /* We should never fall out of the switch above unless there's an error */
+  return s_dead;
+}
+
+size_t http_parser_execute (http_parser *parser,
+                            const http_parser_settings *settings,
+                            const char *data,
+                            size_t len)
+{
+  char c, ch;
+  int8_t unhex_val;
+  const char *p = data;
+  const char *header_field_mark = 0;
+  const char *header_value_mark = 0;
+  const char *url_mark = 0;
+  const char *body_mark = 0;
+  const char *status_mark = 0;
+  enum state p_state = (enum state) parser->state;
+
+  /* We're in an error state. Don't bother doing anything. */
+  if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
+    return 0;
+  }
+
+  if (len == 0) {
+    switch (CURRENT_STATE()) {
+      case s_body_identity_eof:
+        /* Use of CALLBACK_NOTIFY() here would erroneously return 1 byte read if
+         * we got paused.
+         */
+        CALLBACK_NOTIFY_NOADVANCE(message_complete);
+        return 0;
+
+      case s_dead:
+      case s_start_req_or_res:
+      case s_start_res:
+      case s_start_req:
+        return 0;
+
+      default:
+        SET_ERRNO(HPE_INVALID_EOF_STATE);
+        return 1;
+    }
+  }
+
+
+  if (CURRENT_STATE() == s_header_field)
+    header_field_mark = data;
+  if (CURRENT_STATE() == s_header_value)
+    header_value_mark = data;
+  switch (CURRENT_STATE()) {
+  case s_req_path:
+  case s_req_schema:
+  case s_req_schema_slash:
+  case s_req_schema_slash_slash:
+  case s_req_server_start:
+  case s_req_server:
+  case s_req_server_with_at:
+  case s_req_query_string_start:
+  case s_req_query_string:
+  case s_req_fragment_start:
+  case s_req_fragment:
+    url_mark = data;
+    break;
+  case s_res_status:
+    status_mark = data;
+    break;
+  default:
+    break;
+  }
+
+  for (p=data; p != data + len; p++) {
+    ch = *p;
+
+    if (PARSING_HEADER(CURRENT_STATE()))
+      COUNT_HEADER_SIZE(1);
+
+reexecute:
+    switch (CURRENT_STATE()) {
+
+      case s_dead:
+        /* this state is used after a 'Connection: close' message
+         * the parser will error out if it reads another message
+         */
+        if (LIKELY(ch == CR || ch == LF))
+          break;
+
+        SET_ERRNO(HPE_CLOSED_CONNECTION);
+        goto error;
+
+      case s_start_req_or_res:
+      {
+        if (ch == CR || ch == LF)
+          break;
+        parser->flags = 0;
+        parser->content_length = ULLONG_MAX;
+
+        if (ch == 'H') {
+          UPDATE_STATE(s_res_or_resp_H);
+
+          CALLBACK_NOTIFY(message_begin);
+        } else {
+          parser->type = HTTP_REQUEST;
+          UPDATE_STATE(s_start_req);
+          REEXECUTE();
+        }
+
+        break;
+      }
+
+      case s_res_or_resp_H:
+        if (ch == 'T') {
+          parser->type = HTTP_RESPONSE;
+          UPDATE_STATE(s_res_HT);
+        } else {
+          if (UNLIKELY(ch != 'E')) {
+            SET_ERRNO(HPE_INVALID_CONSTANT);
+            goto error;
+          }
+
+          parser->type = HTTP_REQUEST;
+          parser->method = HTTP_HEAD;
+          parser->index = 2;
+          UPDATE_STATE(s_req_method);
+        }
+        break;
+
+      case s_start_res:
+      {
+        parser->flags = 0;
+        parser->content_length = ULLONG_MAX;
+
+        switch (ch) {
+          case 'H':
+            UPDATE_STATE(s_res_H);
+            break;
+
+          case CR:
+          case LF:
+            break;
+
+          default:
+            SET_ERRNO(HPE_INVALID_CONSTANT);
+            goto error;
+        }
+
+        CALLBACK_NOTIFY(message_begin);
+        break;
+      }
+
+      case s_res_H:
+        STRICT_CHECK(ch != 'T');
+        UPDATE_STATE(s_res_HT);
+        break;
+
+      case s_res_HT:
+        STRICT_CHECK(ch != 'T');
+        UPDATE_STATE(s_res_HTT);
+        break;
+
+      case s_res_HTT:
+        STRICT_CHECK(ch != 'P');
+        UPDATE_STATE(s_res_HTTP);
+        break;
+
+      case s_res_HTTP:
+        STRICT_CHECK(ch != '/');
+        UPDATE_STATE(s_res_first_http_major);
+        break;
+
+      case s_res_first_http_major:
+        if (UNLIKELY(ch < '0' || ch > '9')) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        parser->http_major = ch - '0';
+        UPDATE_STATE(s_res_http_major);
+        break;
+
+      /* major HTTP version or dot */
+      case s_res_http_major:
+      {
+        if (ch == '.') {
+          UPDATE_STATE(s_res_first_http_minor);
+          break;
+        }
+
+        if (!IS_NUM(ch)) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        parser->http_major *= 10;
+        parser->http_major += ch - '0';
+
+        if (UNLIKELY(parser->http_major > 999)) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        break;
+      }
+
+      /* first digit of minor HTTP version */
+      case s_res_first_http_minor:
+        if (UNLIKELY(!IS_NUM(ch))) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        parser->http_minor = ch - '0';
+        UPDATE_STATE(s_res_http_minor);
+        break;
+
+      /* minor HTTP version or end of request line */
+      case s_res_http_minor:
+      {
+        if (ch == ' ') {
+          UPDATE_STATE(s_res_first_status_code);
+          break;
+        }
+
+        if (UNLIKELY(!IS_NUM(ch))) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        parser->http_minor *= 10;
+        parser->http_minor += ch - '0';
+
+        if (UNLIKELY(parser->http_minor > 999)) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        break;
+      }
+
+      case s_res_first_status_code:
+      {
+        if (!IS_NUM(ch)) {
+          if (ch == ' ') {
+            break;
+          }
+
+          SET_ERRNO(HPE_INVALID_STATUS);
+          goto error;
+        }
+        parser->status_code = ch - '0';
+        UPDATE_STATE(s_res_status_code);
+        break;
+      }
+
+      case s_res_status_code:
+      {
+        if (!IS_NUM(ch)) {
+          switch (ch) {
+            case ' ':
+              UPDATE_STATE(s_res_status_start);
+              break;
+            case CR:
+              UPDATE_STATE(s_res_line_almost_done);
+              break;
+            case LF:
+              UPDATE_STATE(s_header_field_start);
+              break;
+            default:
+              SET_ERRNO(HPE_INVALID_STATUS);
+              goto error;
+          }
+          break;
+        }
+
+        parser->status_code *= 10;
+        parser->status_code += ch - '0';
+
+        if (UNLIKELY(parser->status_code > 999)) {
+          SET_ERRNO(HPE_INVALID_STATUS);
+          goto error;
+        }
+
+        break;
+      }
+
+      case s_res_status_start:
+      {
+        if (ch == CR) {
+          UPDATE_STATE(s_res_line_almost_done);
+          break;
+        }
+
+        if (ch == LF) {
+          UPDATE_STATE(s_header_field_start);
+          break;
+        }
+
+        MARK(status);
+        UPDATE_STATE(s_res_status);
+        parser->index = 0;
+        break;
+      }
+
+      case s_res_status:
+        if (ch == CR) {
+          UPDATE_STATE(s_res_line_almost_done);
+          CALLBACK_DATA(status);
+          break;
+        }
+
+        if (ch == LF) {
+          UPDATE_STATE(s_header_field_start);
+          CALLBACK_DATA(status);
+          break;
+        }
+
+        break;
+
+      case s_res_line_almost_done:
+        STRICT_CHECK(ch != LF);
+        UPDATE_STATE(s_header_field_start);
+        break;
+
+      case s_start_req:
+      {
+        if (ch == CR || ch == LF)
+          break;
+        parser->flags = 0;
+        parser->content_length = ULLONG_MAX;
+
+        if (UNLIKELY(!IS_ALPHA(ch))) {
+          SET_ERRNO(HPE_INVALID_METHOD);
+          goto error;
+        }
+
+        parser->method = (enum http_method) 0;
+        parser->index = 1;
+        switch (ch) {
+          case 'C': parser->method = HTTP_CONNECT; /* or COPY, CHECKOUT */ break;
+          case 'D': parser->method = HTTP_DELETE; break;
+          case 'G': parser->method = HTTP_GET; break;
+          case 'H': parser->method = HTTP_HEAD; break;
+          case 'L': parser->method = HTTP_LOCK; break;
+          case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH, MKCALENDAR */ break;
+          case 'N': parser->method = HTTP_NOTIFY; break;
+          case 'O': parser->method = HTTP_OPTIONS; break;
+          case 'P': parser->method = HTTP_POST;
+            /* or PROPFIND|PROPPATCH|PUT|PATCH|PURGE */
+            break;
+          case 'R': parser->method = HTTP_REPORT; break;
+          case 'S': parser->method = HTTP_SUBSCRIBE; /* or SEARCH */ break;
+          case 'T': parser->method = HTTP_TRACE; break;
+          case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE */ break;
+          default:
+            SET_ERRNO(HPE_INVALID_METHOD);
+            goto error;
+        }
+        UPDATE_STATE(s_req_method);
+
+        CALLBACK_NOTIFY(message_begin);
+
+        break;
+      }
+
+      case s_req_method:
+      {
+        const char *matcher;
+        if (UNLIKELY(ch == '\0')) {
+          SET_ERRNO(HPE_INVALID_METHOD);
+          goto error;
+        }
+
+        matcher = method_strings[parser->method];
+        if (ch == ' ' && matcher[parser->index] == '\0') {
+          UPDATE_STATE(s_req_spaces_before_url);
+        } else if (ch == matcher[parser->index]) {
+          ; /* nada */
+        } else if (parser->method == HTTP_CONNECT) {
+          if (parser->index == 1 && ch == 'H') {
+            parser->method = HTTP_CHECKOUT;
+          } else if (parser->index == 2  && ch == 'P') {
+            parser->method = HTTP_COPY;
+          } else {
+            SET_ERRNO(HPE_INVALID_METHOD);
+            goto error;
+          }
+        } else if (parser->method == HTTP_MKCOL) {
+          if (parser->index == 1 && ch == 'O') {
+            parser->method = HTTP_MOVE;
+          } else if (parser->index == 1 && ch == 'E') {
+            parser->method = HTTP_MERGE;
+          } else if (parser->index == 1 && ch == '-') {
+            parser->method = HTTP_MSEARCH;
+          } else if (parser->index == 2 && ch == 'A') {
+            parser->method = HTTP_MKACTIVITY;
+          } else if (parser->index == 3 && ch == 'A') {
+            parser->method = HTTP_MKCALENDAR;
+          } else {
+            SET_ERRNO(HPE_INVALID_METHOD);
+            goto error;
+          }
+        } else if (parser->method == HTTP_SUBSCRIBE) {
+          if (parser->index == 1 && ch == 'E') {
+            parser->method = HTTP_SEARCH;
+          } else {
+            SET_ERRNO(HPE_INVALID_METHOD);
+            goto error;
+          }
+        } else if (parser->index == 1 && parser->method == HTTP_POST) {
+          if (ch == 'R') {
+            parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */
+          } else if (ch == 'U') {
+            parser->method = HTTP_PUT; /* or HTTP_PURGE */
+          } else if (ch == 'A') {
+            parser->method = HTTP_PATCH;
+          } else {
+            SET_ERRNO(HPE_INVALID_METHOD);
+            goto error;
+          }
+        } else if (parser->index == 2) {
+          if (parser->method == HTTP_PUT) {
+            if (ch == 'R') {
+              parser->method = HTTP_PURGE;
+            } else {
+              SET_ERRNO(HPE_INVALID_METHOD);
+              goto error;
+            }
+          } else if (parser->method == HTTP_UNLOCK) {
+            if (ch == 'S') {
+              parser->method = HTTP_UNSUBSCRIBE;
+            } else {
+              SET_ERRNO(HPE_INVALID_METHOD);
+              goto error;
+            }
+          } else {
+            SET_ERRNO(HPE_INVALID_METHOD);
+            goto error;
+          }
+        } else if (parser->index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') {
+          parser->method = HTTP_PROPPATCH;
+        } else {
+          SET_ERRNO(HPE_INVALID_METHOD);
+          goto error;
+        }
+
+        ++parser->index;
+        break;
+      }
+
+      case s_req_spaces_before_url:
+      {
+        if (ch == ' ') break;
+
+        MARK(url);
+        if (parser->method == HTTP_CONNECT) {
+          UPDATE_STATE(s_req_server_start);
+        }
+
+        UPDATE_STATE(parse_url_char(CURRENT_STATE(), ch));
+        if (UNLIKELY(CURRENT_STATE() == s_dead)) {
+          SET_ERRNO(HPE_INVALID_URL);
+          goto error;
+        }
+
+        break;
+      }
+
+      case s_req_schema:
+      case s_req_schema_slash:
+      case s_req_schema_slash_slash:
+      case s_req_server_start:
+      {
+        switch (ch) {
+          /* No whitespace allowed here */
+          case ' ':
+          case CR:
+          case LF:
+            SET_ERRNO(HPE_INVALID_URL);
+            goto error;
+          default:
+            UPDATE_STATE(parse_url_char(CURRENT_STATE(), ch));
+            if (UNLIKELY(CURRENT_STATE() == s_dead)) {
+              SET_ERRNO(HPE_INVALID_URL);
+              goto error;
+            }
+        }
+
+        break;
+      }
+
+      case s_req_server:
+      case s_req_server_with_at:
+      case s_req_path:
+      case s_req_query_string_start:
+      case s_req_query_string:
+      case s_req_fragment_start:
+      case s_req_fragment:
+      {
+        switch (ch) {
+          case ' ':
+            UPDATE_STATE(s_req_http_start);
+            CALLBACK_DATA(url);
+            break;
+          case CR:
+          case LF:
+            parser->http_major = 0;
+            parser->http_minor = 9;
+            UPDATE_STATE((ch == CR) ?
+              s_req_line_almost_done :
+              s_header_field_start);
+            CALLBACK_DATA(url);
+            break;
+          default:
+            UPDATE_STATE(parse_url_char(CURRENT_STATE(), ch));
+            if (UNLIKELY(CURRENT_STATE() == s_dead)) {
+              SET_ERRNO(HPE_INVALID_URL);
+              goto error;
+            }
+        }
+        break;
+      }
+
+      case s_req_http_start:
+        switch (ch) {
+          case 'H':
+            UPDATE_STATE(s_req_http_H);
+            break;
+          case ' ':
+            break;
+          default:
+            SET_ERRNO(HPE_INVALID_CONSTANT);
+            goto error;
+        }
+        break;
+
+      case s_req_http_H:
+        STRICT_CHECK(ch != 'T');
+        UPDATE_STATE(s_req_http_HT);
+        break;
+
+      case s_req_http_HT:
+        STRICT_CHECK(ch != 'T');
+        UPDATE_STATE(s_req_http_HTT);
+        break;
+
+      case s_req_http_HTT:
+        STRICT_CHECK(ch != 'P');
+        UPDATE_STATE(s_req_http_HTTP);
+        break;
+
+      case s_req_http_HTTP:
+        STRICT_CHECK(ch != '/');
+        UPDATE_STATE(s_req_first_http_major);
+        break;
+
+      /* first digit of major HTTP version */
+      case s_req_first_http_major:
+        if (UNLIKELY(ch < '1' || ch > '9')) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        parser->http_major = ch - '0';
+        UPDATE_STATE(s_req_http_major);
+        break;
+
+      /* major HTTP version or dot */
+      case s_req_http_major:
+      {
+        if (ch == '.') {
+          UPDATE_STATE(s_req_first_http_minor);
+          break;
+        }
+
+        if (UNLIKELY(!IS_NUM(ch))) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        parser->http_major *= 10;
+        parser->http_major += ch - '0';
+
+        if (UNLIKELY(parser->http_major > 999)) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        break;
+      }
+
+      /* first digit of minor HTTP version */
+      case s_req_first_http_minor:
+        if (UNLIKELY(!IS_NUM(ch))) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        parser->http_minor = ch - '0';
+        UPDATE_STATE(s_req_http_minor);
+        break;
+
+      /* minor HTTP version or end of request line */
+      case s_req_http_minor:
+      {
+        if (ch == CR) {
+          UPDATE_STATE(s_req_line_almost_done);
+          break;
+        }
+
+        if (ch == LF) {
+          UPDATE_STATE(s_header_field_start);
+          break;
+        }
+
+        /* XXX allow spaces after digit? */
+
+        if (UNLIKELY(!IS_NUM(ch))) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        parser->http_minor *= 10;
+        parser->http_minor += ch - '0';
+
+        if (UNLIKELY(parser->http_minor > 999)) {
+          SET_ERRNO(HPE_INVALID_VERSION);
+          goto error;
+        }
+
+        break;
+      }
+
+      /* end of request line */
+      case s_req_line_almost_done:
+      {
+        if (UNLIKELY(ch != LF)) {
+          SET_ERRNO(HPE_LF_EXPECTED);
+          goto error;
+        }
+
+        UPDATE_STATE(s_header_field_start);
+        break;
+      }
+
+      case s_header_field_start:
+      {
+        if (ch == CR) {
+          UPDATE_STATE(s_headers_almost_done);
+          break;
+        }
+
+        if (ch == LF) {
+          /* they might be just sending \n instead of \r\n so this would be
+           * the second \n to denote the end of headers*/
+          UPDATE_STATE(s_headers_almost_done);
+          REEXECUTE();
+        }
+
+        c = TOKEN(ch);
+
+        if (UNLIKELY(!c)) {
+          SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
+          goto error;
+        }
+
+        MARK(header_field);
+
+        parser->index = 0;
+        UPDATE_STATE(s_header_field);
+
+        switch (c) {
+          case 'c':
+            parser->header_state = h_C;
+            break;
+
+          case 'p':
+            parser->header_state = h_matching_proxy_connection;
+            break;
+
+          case 't':
+            parser->header_state = h_matching_transfer_encoding;
+            break;
+
+          case 'u':
+            parser->header_state = h_matching_upgrade;
+            break;
+
+          default:
+            parser->header_state = h_general;
+            break;
+        }
+        break;
+      }
+
+      case s_header_field:
+      {
+        const char* start = p;
+        for (; p != data + len; p++) {
+          ch = *p;
+          c = TOKEN(ch);
+
+          if (!c)
+            break;
+
+          switch (parser->header_state) {
+            case h_general:
+              break;
+
+            case h_C:
+              parser->index++;
+              parser->header_state = (c == 'o' ? h_CO : h_general);
+              break;
+
+            case h_CO:
+              parser->index++;
+              parser->header_state = (c == 'n' ? h_CON : h_general);
+              break;
+
+            case h_CON:
+              parser->index++;
+              switch (c) {
+                case 'n':
+                  parser->header_state = h_matching_connection;
+                  break;
+                case 't':
+                  parser->header_state = h_matching_content_length;
+                  break;
+                default:
+                  parser->header_state = h_general;
+                  break;
+              }
+              break;
+
+            /* connection */
+
+            case h_matching_connection:
+              parser->index++;
+              if (parser->index > sizeof(CONNECTION)-1
+                  || c != CONNECTION[parser->index]) {
+                parser->header_state = h_general;
+              } else if (parser->index == sizeof(CONNECTION)-2) {
+                parser->header_state = h_connection;
+              }
+              break;
+
+            /* proxy-connection */
+
+            case h_matching_proxy_connection:
+              parser->index++;
+              if (parser->index > sizeof(PROXY_CONNECTION)-1
+                  || c != PROXY_CONNECTION[parser->index]) {
+                parser->header_state = h_general;
+              } else if (parser->index == sizeof(PROXY_CONNECTION)-2) {
+                parser->header_state = h_connection;
+              }
+              break;
+
+            /* content-length */
+
+            case h_matching_content_length:
+              parser->index++;
+              if (parser->index > sizeof(CONTENT_LENGTH)-1
+                  || c != CONTENT_LENGTH[parser->index]) {
+                parser->header_state = h_general;
+              } else if (parser->index == sizeof(CONTENT_LENGTH)-2) {
+                parser->header_state = h_content_length;
+              }
+              break;
+
+            /* transfer-encoding */
+
+            case h_matching_transfer_encoding:
+              parser->index++;
+              if (parser->index > sizeof(TRANSFER_ENCODING)-1
+                  || c != TRANSFER_ENCODING[parser->index]) {
+                parser->header_state = h_general;
+              } else if (parser->index == sizeof(TRANSFER_ENCODING)-2) {
+                parser->header_state = h_transfer_encoding;
+              }
+              break;
+
+            /* upgrade */
+
+            case h_matching_upgrade:
+              parser->index++;
+              if (parser->index > sizeof(UPGRADE)-1
+                  || c != UPGRADE[parser->index]) {
+                parser->header_state = h_general;
+              } else if (parser->index == sizeof(UPGRADE)-2) {
+                parser->header_state = h_upgrade;
+              }
+              break;
+
+            case h_connection:
+            case h_content_length:
+            case h_transfer_encoding:
+            case h_upgrade:
+              if (ch != ' ') parser->header_state = h_general;
+              break;
+
+            default:
+              assert(0 && "Unknown header_state");
+              break;
+          }
+        }
+
+        COUNT_HEADER_SIZE(p - start);
+
+        if (p == data + len) {
+          --p;
+          break;
+        }
+
+        if (ch == ':') {
+          UPDATE_STATE(s_header_value_discard_ws);
+          CALLBACK_DATA(header_field);
+          break;
+        }
+
+        SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
+        goto error;
+      }
+
+      case s_header_value_discard_ws:
+        if (ch == ' ' || ch == '\t') break;
+
+        if (ch == CR) {
+          UPDATE_STATE(s_header_value_discard_ws_almost_done);
+          break;
+        }
+
+        if (ch == LF) {
+          UPDATE_STATE(s_header_value_discard_lws);
+          break;
+        }
+
+        /* FALLTHROUGH */
+
+      case s_header_value_start:
+      {
+        MARK(header_value);
+
+        UPDATE_STATE(s_header_value);
+        parser->index = 0;
+
+        c = LOWER(ch);
+
+        switch (parser->header_state) {
+          case h_upgrade:
+            parser->flags |= F_UPGRADE;
+            parser->header_state = h_general;
+            break;
+
+          case h_transfer_encoding:
+            /* looking for 'Transfer-Encoding: chunked' */
+            if ('c' == c) {
+              parser->header_state = h_matching_transfer_encoding_chunked;
+            } else {
+              parser->header_state = h_general;
+            }
+            break;
+
+          case h_content_length:
+            if (UNLIKELY(!IS_NUM(ch))) {
+              SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
+              goto error;
+            }
+
+            parser->content_length = ch - '0';
+            break;
+
+          case h_connection:
+            /* looking for 'Connection: keep-alive' */
+            if (c == 'k') {
+              parser->header_state = h_matching_connection_keep_alive;
+            /* looking for 'Connection: close' */
+            } else if (c == 'c') {
+              parser->header_state = h_matching_connection_close;
+            } else if (c == 'u') {
+              parser->header_state = h_matching_connection_upgrade;
+            } else {
+              parser->header_state = h_matching_connection_token;
+            }
+            break;
+
+          /* Multi-value `Connection` header */
+          case h_matching_connection_token_start:
+            break;
+
+          default:
+            parser->header_state = h_general;
+            break;
+        }
+        break;
+      }
+
+      case s_header_value:
+      {
+        const char* start = p;
+        enum header_states h_state = (enum header_states) parser->header_state;
+        for (; p != data + len; p++) {
+          ch = *p;
+          if (ch == CR) {
+            UPDATE_STATE(s_header_almost_done);
+            parser->header_state = h_state;
+            CALLBACK_DATA(header_value);
+            break;
+          }
+
+          if (ch == LF) {
+            UPDATE_STATE(s_header_almost_done);
+            COUNT_HEADER_SIZE(p - start);
+            parser->header_state = h_state;
+            CALLBACK_DATA_NOADVANCE(header_value);
+            REEXECUTE();
+          }
+
+          c = LOWER(ch);
+
+          switch (h_state) {
+            case h_general:
+            {
+              const char* p_cr;
+              const char* p_lf;
+              size_t limit = data + len - p;
+
+              limit = MIN(limit, HTTP_MAX_HEADER_SIZE);
+
+              p_cr = (const char*) memchr(p, CR, limit);
+              p_lf = (const char*) memchr(p, LF, limit);
+              if (p_cr != NULL) {
+                if (p_lf != NULL && p_cr >= p_lf)
+                  p = p_lf;
+                else
+                  p = p_cr;
+              } else if (UNLIKELY(p_lf != NULL)) {
+                p = p_lf;
+              } else {
+                p = data + len;
+              }
+              --p;
+
+              break;
+            }
+
+            case h_connection:
+            case h_transfer_encoding:
+              assert(0 && "Shouldn't get here.");
+              break;
+
+            case h_content_length:
+            {
+              uint64_t t;
+
+              if (ch == ' ') break;
+
+              if (UNLIKELY(!IS_NUM(ch))) {
+                SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
+                parser->header_state = h_state;
+                goto error;
+              }
+
+              t = parser->content_length;
+              t *= 10;
+              t += ch - '0';
+
+              /* Overflow? Test against a conservative limit for simplicity. */
+              if (UNLIKELY((ULLONG_MAX - 10) / 10 < parser->content_length)) {
+                SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
+                parser->header_state = h_state;
+                goto error;
+              }
+
+              parser->content_length = t;
+              break;
+            }
+
+            /* Transfer-Encoding: chunked */
+            case h_matching_transfer_encoding_chunked:
+              parser->index++;
+              if (parser->index > sizeof(CHUNKED)-1
+                  || c != CHUNKED[parser->index]) {
+                h_state = h_general;
+              } else if (parser->index == sizeof(CHUNKED)-2) {
+                h_state = h_transfer_encoding_chunked;
+              }
+              break;
+
+            case h_matching_connection_token_start:
+              /* looking for 'Connection: keep-alive' */
+              if (c == 'k') {
+                h_state = h_matching_connection_keep_alive;
+              /* looking for 'Connection: close' */
+              } else if (c == 'c') {
+                h_state = h_matching_connection_close;
+              } else if (c == 'u') {
+                h_state = h_matching_connection_upgrade;
+              } else if (STRICT_TOKEN(c)) {
+                h_state = h_matching_connection_token;
+              } else if (c == ' ' || c == '\t') {
+                /* Skip lws */
+              } else {
+                h_state = h_general;
+              }
+              break;
+
+            /* looking for 'Connection: keep-alive' */
+            case h_matching_connection_keep_alive:
+              parser->index++;
+              if (parser->index > sizeof(KEEP_ALIVE)-1
+                  || c != KEEP_ALIVE[parser->index]) {
+                h_state = h_matching_connection_token;
+              } else if (parser->index == sizeof(KEEP_ALIVE)-2) {
+                h_state = h_connection_keep_alive;
+              }
+              break;
+
+            /* looking for 'Connection: close' */
+            case h_matching_connection_close:
+              parser->index++;
+              if (parser->index > sizeof(CLOSE)-1 || c != CLOSE[parser->index]) {
+                h_state = h_matching_connection_token;
+              } else if (parser->index == sizeof(CLOSE)-2) {
+                h_state = h_connection_close;
+              }
+              break;
+
+            /* looking for 'Connection: upgrade' */
+            case h_matching_connection_upgrade:
+              parser->index++;
+              if (parser->index > sizeof(UPGRADE) - 1 ||
+                  c != UPGRADE[parser->index]) {
+                h_state = h_matching_connection_token;
+              } else if (parser->index == sizeof(UPGRADE)-2) {
+                h_state = h_connection_upgrade;
+              }
+              break;
+
+            case h_matching_connection_token:
+              if (ch == ',') {
+                h_state = h_matching_connection_token_start;
+                parser->index = 0;
+              }
+              break;
+
+            case h_transfer_encoding_chunked:
+              if (ch != ' ') h_state = h_general;
+              break;
+
+            case h_connection_keep_alive:
+            case h_connection_close:
+            case h_connection_upgrade:
+              if (ch == ',') {
+                if (h_state == h_connection_keep_alive) {
+                  parser->flags |= F_CONNECTION_KEEP_ALIVE;
+                } else if (h_state == h_connection_close) {
+                  parser->flags |= F_CONNECTION_CLOSE;
+                } else if (h_state == h_connection_upgrade) {
+                  parser->flags |= F_CONNECTION_UPGRADE;
+                }
+                h_state = h_matching_connection_token_start;
+                parser->index = 0;
+              } else if (ch != ' ') {
+                h_state = h_matching_connection_token;
+              }
+              break;
+
+            default:
+              UPDATE_STATE(s_header_value);
+              h_state = h_general;
+              break;
+          }
+        }
+        parser->header_state = h_state;
+
+        COUNT_HEADER_SIZE(p - start);
+
+        if (p == data + len)
+          --p;
+        break;
+      }
+
+      case s_header_almost_done:
+      {
+        STRICT_CHECK(ch != LF);
+
+        UPDATE_STATE(s_header_value_lws);
+        break;
+      }
+
+      case s_header_value_lws:
+      {
+        if (ch == ' ' || ch == '\t') {
+          UPDATE_STATE(s_header_value_start);
+          REEXECUTE();
+        }
+
+        /* finished the header */
+        switch (parser->header_state) {
+          case h_connection_keep_alive:
+            parser->flags |= F_CONNECTION_KEEP_ALIVE;
+            break;
+          case h_connection_close:
+            parser->flags |= F_CONNECTION_CLOSE;
+            break;
+          case h_transfer_encoding_chunked:
+            parser->flags |= F_CHUNKED;
+            break;
+          case h_connection_upgrade:
+            parser->flags |= F_CONNECTION_UPGRADE;
+            break;
+          default:
+            break;
+        }
+
+        UPDATE_STATE(s_header_field_start);
+        REEXECUTE();
+      }
+
+      case s_header_value_discard_ws_almost_done:
+      {
+        STRICT_CHECK(ch != LF);
+        UPDATE_STATE(s_header_value_discard_lws);
+        break;
+      }
+
+      case s_header_value_discard_lws:
+      {
+        if (ch == ' ' || ch == '\t') {
+          UPDATE_STATE(s_header_value_discard_ws);
+          break;
+        } else {
+          switch (parser->header_state) {
+            case h_connection_keep_alive:
+              parser->flags |= F_CONNECTION_KEEP_ALIVE;
+              break;
+            case h_connection_close:
+              parser->flags |= F_CONNECTION_CLOSE;
+              break;
+            case h_connection_upgrade:
+              parser->flags |= F_CONNECTION_UPGRADE;
+              break;
+            case h_transfer_encoding_chunked:
+              parser->flags |= F_CHUNKED;
+              break;
+            default:
+              break;
+          }
+
+          /* header value was empty */
+          MARK(header_value);
+          UPDATE_STATE(s_header_field_start);
+          CALLBACK_DATA_NOADVANCE(header_value);
+          REEXECUTE();
+        }
+      }
+
+      case s_headers_almost_done:
+      {
+        STRICT_CHECK(ch != LF);
+
+        if (parser->flags & F_TRAILING) {
+          /* End of a chunked request */
+          UPDATE_STATE(s_message_done);
+          CALLBACK_NOTIFY_NOADVANCE(chunk_complete);
+          REEXECUTE();
+        }
+
+        UPDATE_STATE(s_headers_done);
+
+        /* Set this here so that on_headers_complete() callbacks can see it */
+        parser->upgrade =
+          ((parser->flags & (F_UPGRADE | F_CONNECTION_UPGRADE)) ==
+           (F_UPGRADE | F_CONNECTION_UPGRADE) ||
+           parser->method == HTTP_CONNECT);
+
+        /* Here we call the headers_complete callback. This is somewhat
+         * different than other callbacks because if the user returns 1, we
+         * will interpret that as saying that this message has no body. This
+         * is needed for the annoying case of recieving a response to a HEAD
+         * request.
+         *
+         * We'd like to use CALLBACK_NOTIFY_NOADVANCE() here but we cannot, so
+         * we have to simulate it by handling a change in errno below.
+         */
+        if (settings->on_headers_complete) {
+          switch (settings->on_headers_complete(parser)) {
+            case 0:
+              break;
+
+            case 1:
+              parser->flags |= F_SKIPBODY;
+              break;
+
+            default:
+              SET_ERRNO(HPE_CB_headers_complete);
+              RETURN(p - data); /* Error */
+          }
+        }
+
+        if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
+          RETURN(p - data);
+        }
+
+        REEXECUTE();
+      }
+
+      case s_headers_done:
+      {
+        STRICT_CHECK(ch != LF);
+
+        parser->nread = 0;
+
+        int hasBody = parser->flags & F_CHUNKED ||
+          (parser->content_length > 0 && parser->content_length != ULLONG_MAX);
+        if (parser->upgrade && (parser->method == HTTP_CONNECT ||
+                                (parser->flags & F_SKIPBODY) || !hasBody)) {
+          /* Exit, the rest of the message is in a different protocol. */
+          UPDATE_STATE(NEW_MESSAGE());
+          CALLBACK_NOTIFY(message_complete);
+          RETURN((p - data) + 1);
+        }
+
+        if (parser->flags & F_SKIPBODY) {
+          UPDATE_STATE(NEW_MESSAGE());
+          CALLBACK_NOTIFY(message_complete);
+        } else if (parser->flags & F_CHUNKED) {
+          /* chunked encoding - ignore Content-Length header */
+          UPDATE_STATE(s_chunk_size_start);
+        } else {
+          if (parser->content_length == 0) {
+            /* Content-Length header given but zero: Content-Length: 0\r\n */
+            UPDATE_STATE(NEW_MESSAGE());
+            CALLBACK_NOTIFY(message_complete);
+          } else if (parser->content_length != ULLONG_MAX) {
+            /* Content-Length header given and non-zero */
+            UPDATE_STATE(s_body_identity);
+          } else {
+            if (!http_message_needs_eof(parser)) {
+              /* Assume content-length 0 - read the next */
+              UPDATE_STATE(NEW_MESSAGE());
+              CALLBACK_NOTIFY(message_complete);
+            } else {
+              /* Read body until EOF */
+              UPDATE_STATE(s_body_identity_eof);
+            }
+          }
+        }
+
+        break;
+      }
+
+      case s_body_identity:
+      {
+        uint64_t to_read = MIN(parser->content_length,
+                               (uint64_t) ((data + len) - p));
+
+        assert(parser->content_length != 0
+            && parser->content_length != ULLONG_MAX);
+
+        /* The difference between advancing content_length and p is because
+         * the latter will automaticaly advance on the next loop iteration.
+         * Further, if content_length ends up at 0, we want to see the last
+         * byte again for our message complete callback.
+         */
+        MARK(body);
+        parser->content_length -= to_read;
+        p += to_read - 1;
+
+        if (parser->content_length == 0) {
+          UPDATE_STATE(s_message_done);
+
+          /* Mimic CALLBACK_DATA_NOADVANCE() but with one extra byte.
+           *
+           * The alternative to doing this is to wait for the next byte to
+           * trigger the data callback, just as in every other case. The
+           * problem with this is that this makes it difficult for the test
+           * harness to distinguish between complete-on-EOF and
+           * complete-on-length. It's not clear that this distinction is
+           * important for applications, but let's keep it for now.
+           */
+          CALLBACK_DATA_(body, p - body_mark + 1, p - data);
+          REEXECUTE();
+        }
+
+        break;
+      }
+
+      /* read until EOF */
+      case s_body_identity_eof:
+        MARK(body);
+        p = data + len - 1;
+
+        break;
+
+      case s_message_done:
+        UPDATE_STATE(NEW_MESSAGE());
+        CALLBACK_NOTIFY(message_complete);
+        if (parser->upgrade) {
+          /* Exit, the rest of the message is in a different protocol. */
+          RETURN((p - data) + 1);
+        }
+        break;
+
+      case s_chunk_size_start:
+      {
+        assert(parser->nread == 1);
+        assert(parser->flags & F_CHUNKED);
+
+        unhex_val = unhex[(unsigned char)ch];
+        if (UNLIKELY(unhex_val == -1)) {
+          SET_ERRNO(HPE_INVALID_CHUNK_SIZE);
+          goto error;
+        }
+
+        parser->content_length = unhex_val;
+        UPDATE_STATE(s_chunk_size);
+        break;
+      }
+
+      case s_chunk_size:
+      {
+        uint64_t t;
+
+        assert(parser->flags & F_CHUNKED);
+
+        if (ch == CR) {
+          UPDATE_STATE(s_chunk_size_almost_done);
+          break;
+        }
+
+        unhex_val = unhex[(unsigned char)ch];
+
+        if (unhex_val == -1) {
+          if (ch == ';' || ch == ' ') {
+            UPDATE_STATE(s_chunk_parameters);
+            break;
+          }
+
+          SET_ERRNO(HPE_INVALID_CHUNK_SIZE);
+          goto error;
+        }
+
+        t = parser->content_length;
+        t *= 16;
+        t += unhex_val;
+
+        /* Overflow? Test against a conservative limit for simplicity. */
+        if (UNLIKELY((ULLONG_MAX - 16) / 16 < parser->content_length)) {
+          SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
+          goto error;
+        }
+
+        parser->content_length = t;
+        break;
+      }
+
+      case s_chunk_parameters:
+      {
+        assert(parser->flags & F_CHUNKED);
+        /* just ignore this shit. TODO check for overflow */
+        if (ch == CR) {
+          UPDATE_STATE(s_chunk_size_almost_done);
+          break;
+        }
+        break;
+      }
+
+      case s_chunk_size_almost_done:
+      {
+        assert(parser->flags & F_CHUNKED);
+        STRICT_CHECK(ch != LF);
+
+        parser->nread = 0;
+
+        if (parser->content_length == 0) {
+          parser->flags |= F_TRAILING;
+          UPDATE_STATE(s_header_field_start);
+        } else {
+          UPDATE_STATE(s_chunk_data);
+        }
+        CALLBACK_NOTIFY(chunk_header);
+        break;
+      }
+
+      case s_chunk_data:
+      {
+        uint64_t to_read = MIN(parser->content_length,
+                               (uint64_t) ((data + len) - p));
+
+        assert(parser->flags & F_CHUNKED);
+        assert(parser->content_length != 0
+            && parser->content_length != ULLONG_MAX);
+
+        /* See the explanation in s_body_identity for why the content
+         * length and data pointers are managed this way.
+         */
+        MARK(body);
+        parser->content_length -= to_read;
+        p += to_read - 1;
+
+        if (parser->content_length == 0) {
+          UPDATE_STATE(s_chunk_data_almost_done);
+        }
+
+        break;
+      }
+
+      case s_chunk_data_almost_done:
+        assert(parser->flags & F_CHUNKED);
+        assert(parser->content_length == 0);
+        STRICT_CHECK(ch != CR);
+        UPDATE_STATE(s_chunk_data_done);
+        CALLBACK_DATA(body);
+        break;
+
+      case s_chunk_data_done:
+        assert(parser->flags & F_CHUNKED);
+        STRICT_CHECK(ch != LF);
+        parser->nread = 0;
+        UPDATE_STATE(s_chunk_size_start);
+        CALLBACK_NOTIFY(chunk_complete);
+        break;
+
+      default:
+        assert(0 && "unhandled state");
+        SET_ERRNO(HPE_INVALID_INTERNAL_STATE);
+        goto error;
+    }
+  }
+
+  /* Run callbacks for any marks that we have leftover after we ran our of
+   * bytes. There should be at most one of these set, so it's OK to invoke
+   * them in series (unset marks will not result in callbacks).
+   *
+   * We use the NOADVANCE() variety of callbacks here because 'p' has already
+   * overflowed 'data' and this allows us to correct for the off-by-one that
+   * we'd otherwise have (since CALLBACK_DATA() is meant to be run with a 'p'
+   * value that's in-bounds).
+   */
+
+  assert(((header_field_mark ? 1 : 0) +
+          (header_value_mark ? 1 : 0) +
+          (url_mark ? 1 : 0)  +
+          (body_mark ? 1 : 0) +
+          (status_mark ? 1 : 0)) <= 1);
+
+  CALLBACK_DATA_NOADVANCE(header_field);
+  CALLBACK_DATA_NOADVANCE(header_value);
+  CALLBACK_DATA_NOADVANCE(url);
+  CALLBACK_DATA_NOADVANCE(body);
+  CALLBACK_DATA_NOADVANCE(status);
+
+  RETURN(len);
+
+error:
+  if (HTTP_PARSER_ERRNO(parser) == HPE_OK) {
+    SET_ERRNO(HPE_UNKNOWN);
+  }
+
+  RETURN(p - data);
+}
+
+
+/* Does the parser need to see an EOF to find the end of the message? */
+int
+http_message_needs_eof (const http_parser *parser)
+{
+  if (parser->type == HTTP_REQUEST) {
+    return 0;
+  }
+
+  /* See RFC 2616 section 4.4 */
+  if (parser->status_code / 100 == 1 || /* 1xx e.g. Continue */
+      parser->status_code == 204 ||     /* No Content */
+      parser->status_code == 304 ||     /* Not Modified */
+      parser->flags & F_SKIPBODY) {     /* response to a HEAD request */
+    return 0;
+  }
+
+  if ((parser->flags & F_CHUNKED) || parser->content_length != ULLONG_MAX) {
+    return 0;
+  }
+
+  return 1;
+}
+
+
+int
+http_should_keep_alive (const http_parser *parser)
+{
+  if (parser->http_major > 0 && parser->http_minor > 0) {
+    /* HTTP/1.1 */
+    if (parser->flags & F_CONNECTION_CLOSE) {
+      return 0;
+    }
+  } else {
+    /* HTTP/1.0 or earlier */
+    if (!(parser->flags & F_CONNECTION_KEEP_ALIVE)) {
+      return 0;
+    }
+  }
+
+  return !http_message_needs_eof(parser);
+}
+
+
+const char *
+http_method_str (enum http_method m)
+{
+  return ELEM_AT(method_strings, m, "<unknown>");
+}
+
+
+void
+http_parser_init (http_parser *parser, enum http_parser_type t)
+{
+  void *data = parser->data; /* preserve application data */
+  memset(parser, 0, sizeof(*parser));
+  parser->data = data;
+  parser->type = t;
+  parser->state = (t == HTTP_REQUEST ? s_start_req : (t == HTTP_RESPONSE ? s_start_res : s_start_req_or_res));
+  parser->http_errno = HPE_OK;
+}
+
+void
+http_parser_settings_init(http_parser_settings *settings)
+{
+  memset(settings, 0, sizeof(*settings));
+}
+
+const char *
+http_errno_name(enum http_errno err) {
+  assert(((size_t) err) <
+      (sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0])));
+  return http_strerror_tab[err].name;
+}
+
+const char *
+http_errno_description(enum http_errno err) {
+  assert(((size_t) err) <
+      (sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0])));
+  return http_strerror_tab[err].description;
+}
+
+static enum http_host_state
+http_parse_host_char(enum http_host_state s, const char ch) {
+  switch(s) {
+    case s_http_userinfo:
+    case s_http_userinfo_start:
+      if (ch == '@') {
+        return s_http_host_start;
+      }
+
+      if (IS_USERINFO_CHAR(ch)) {
+        return s_http_userinfo;
+      }
+      break;
+
+    case s_http_host_start:
+      if (ch == '[') {
+        return s_http_host_v6_start;
+      }
+
+      if (IS_HOST_CHAR(ch)) {
+        return s_http_host;
+      }
+
+      break;
+
+    case s_http_host:
+      if (IS_HOST_CHAR(ch)) {
+        return s_http_host;
+      }
+
+    /* FALLTHROUGH */
+    case s_http_host_v6_end:
+      if (ch == ':') {
+        return s_http_host_port_start;
+      }
+
+      break;
+
+    case s_http_host_v6:
+      if (ch == ']') {
+        return s_http_host_v6_end;
+      }
+
+    /* FALLTHROUGH */
+    case s_http_host_v6_start:
+      if (IS_HEX(ch) || ch == ':' || ch == '.') {
+        return s_http_host_v6;
+      }
+
+      break;
+
+    case s_http_host_port:
+    case s_http_host_port_start:
+      if (IS_NUM(ch)) {
+        return s_http_host_port;
+      }
+
+      break;
+
+    default:
+      break;
+  }
+  return s_http_host_dead;
+}
+
+static int
+http_parse_host(const char * buf, struct http_parser_url *u, int found_at) {
+  assert(u->field_set & (1 << UF_HOST));
+  enum http_host_state s;
+
+  const char *p;
+  size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len;
+
+  u->field_data[UF_HOST].len = 0;
+
+  s = found_at ? s_http_userinfo_start : s_http_host_start;
+
+  for (p = buf + u->field_data[UF_HOST].off; p < buf + buflen; p++) {
+    enum http_host_state new_s = http_parse_host_char(s, *p);
+
+    if (new_s == s_http_host_dead) {
+      return 1;
+    }
+
+    switch(new_s) {
+      case s_http_host:
+        if (s != s_http_host) {
+          u->field_data[UF_HOST].off = p - buf;
+        }
+        u->field_data[UF_HOST].len++;
+        break;
+
+      case s_http_host_v6:
+        if (s != s_http_host_v6) {
+          u->field_data[UF_HOST].off = p - buf;
+        }
+        u->field_data[UF_HOST].len++;
+        break;
+
+      case s_http_host_port:
+        if (s != s_http_host_port) {
+          u->field_data[UF_PORT].off = p - buf;
+          u->field_data[UF_PORT].len = 0;
+          u->field_set |= (1 << UF_PORT);
+        }
+        u->field_data[UF_PORT].len++;
+        break;
+
+      case s_http_userinfo:
+        if (s != s_http_userinfo) {
+          u->field_data[UF_USERINFO].off = p - buf ;
+          u->field_data[UF_USERINFO].len = 0;
+          u->field_set |= (1 << UF_USERINFO);
+        }
+        u->field_data[UF_USERINFO].len++;
+        break;
+
+      default:
+        break;
+    }
+    s = new_s;
+  }
+
+  /* Make sure we don't end somewhere unexpected */
+  switch (s) {
+    case s_http_host_start:
+    case s_http_host_v6_start:
+    case s_http_host_v6:
+    case s_http_host_port_start:
+    case s_http_userinfo:
+    case s_http_userinfo_start:
+      return 1;
+    default:
+      break;
+  }
+
+  return 0;
+}
+
+int
+http_parser_parse_url(const char *buf, size_t buflen, int is_connect,
+                      struct http_parser_url *u)
+{
+  enum state s;
+  const char *p;
+  enum http_parser_url_fields uf, old_uf;
+  int found_at = 0;
+
+  u->port = u->field_set = 0;
+  s = is_connect ? s_req_server_start : s_req_spaces_before_url;
+  old_uf = UF_MAX;
+
+  for (p = buf; p < buf + buflen; p++) {
+    s = parse_url_char(s, *p);
+
+    /* Figure out the next field that we're operating on */
+    switch (s) {
+      case s_dead:
+        return 1;
+
+      /* Skip delimeters */
+      case s_req_schema_slash:
+      case s_req_schema_slash_slash:
+      case s_req_server_start:
+      case s_req_query_string_start:
+      case s_req_fragment_start:
+        continue;
+
+      case s_req_schema:
+        uf = UF_SCHEMA;
+        break;
+
+      case s_req_server_with_at:
+        found_at = 1;
+
+      /* FALLTROUGH */
+      case s_req_server:
+        uf = UF_HOST;
+        break;
+
+      case s_req_path:
+        uf = UF_PATH;
+        break;
+
+      case s_req_query_string:
+        uf = UF_QUERY;
+        break;
+
+      case s_req_fragment:
+        uf = UF_FRAGMENT;
+        break;
+
+      default:
+        assert(!"Unexpected state");
+        return 1;
+    }
+
+    /* Nothing's changed; soldier on */
+    if (uf == old_uf) {
+      u->field_data[uf].len++;
+      continue;
+    }
+
+    u->field_data[uf].off = p - buf;
+    u->field_data[uf].len = 1;
+
+    u->field_set |= (1 << uf);
+    old_uf = uf;
+  }
+
+  /* host must be present if there is a schema */
+  /* parsing http:///toto will fail */
+  if ((u->field_set & (1 << UF_SCHEMA)) &&
+      (u->field_set & (1 << UF_HOST)) == 0) {
+    return 1;
+  }
+
+  if (u->field_set & (1 << UF_HOST)) {
+    if (http_parse_host(buf, u, found_at) != 0) {
+      return 1;
+    }
+  }
+
+  /* CONNECT requests can only contain "hostname:port" */
+  if (is_connect && u->field_set != ((1 << UF_HOST)|(1 << UF_PORT))) {
+    return 1;
+  }
+
+  if (u->field_set & (1 << UF_PORT)) {
+    /* Don't bother with endp; we've already validated the string */
+    unsigned long v = strtoul(buf + u->field_data[UF_PORT].off, NULL, 10);
+
+    /* Ports have a max value of 2^16 */
+    if (v > 0xffff) {
+      return 1;
+    }
+
+    u->port = (uint16_t) v;
+  }
+
+  return 0;
+}
+
+void
+http_parser_pause(http_parser *parser, int paused) {
+  /* Users should only be pausing/unpausing a parser that is not in an error
+   * state. In non-debug builds, there's not much that we can do about this
+   * other than ignore it.
+   */
+  if (HTTP_PARSER_ERRNO(parser) == HPE_OK ||
+      HTTP_PARSER_ERRNO(parser) == HPE_PAUSED) {
+    SET_ERRNO((paused) ? HPE_PAUSED : HPE_OK);
+  } else {
+    assert(0 && "Attempting to pause parser in error state");
+  }
+}
+
+int
+http_body_is_final(const struct http_parser *parser) {
+    return parser->state == s_message_done;
+}
+
+unsigned long
+http_parser_version(void) {
+  return HTTP_PARSER_VERSION_MAJOR * 0x10000 |
+         HTTP_PARSER_VERSION_MINOR * 0x00100 |
+         HTTP_PARSER_VERSION_PATCH * 0x00001;
+}
diff --git a/deps/http-parser/http_parser.gyp b/deps/http-parser/http_parser.gyp
new file mode 100644 (file)
index 0000000..ef34eca
--- /dev/null
@@ -0,0 +1,111 @@
+# This file is used with the GYP meta build system.
+# http://code.google.com/p/gyp/
+# To build try this:
+#   svn co http://gyp.googlecode.com/svn/trunk gyp
+#   ./gyp/gyp -f make --depth=`pwd` http_parser.gyp 
+#   ./out/Debug/test 
+{
+  'target_defaults': {
+    'default_configuration': 'Debug',
+    'configurations': {
+      # TODO: hoist these out and put them somewhere common, because
+      #       RuntimeLibrary MUST MATCH across the entire project
+      'Debug': {
+        'defines': [ 'DEBUG', '_DEBUG' ],
+        'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ],
+        'msvs_settings': {
+          'VCCLCompilerTool': {
+            'RuntimeLibrary': 1, # static debug
+          },
+        },
+      },
+      'Release': {
+        'defines': [ 'NDEBUG' ],
+        'cflags': [ '-Wall', '-Wextra', '-O3' ],
+        'msvs_settings': {
+          'VCCLCompilerTool': {
+            'RuntimeLibrary': 0, # static release
+          },
+        },
+      }
+    },
+    'msvs_settings': {
+      'VCCLCompilerTool': {
+      },
+      'VCLibrarianTool': {
+      },
+      'VCLinkerTool': {
+        'GenerateDebugInformation': 'true',
+      },
+    },
+    'conditions': [
+      ['OS == "win"', {
+        'defines': [
+          'WIN32'
+        ],
+      }]
+    ],
+  },
+
+  'targets': [
+    {
+      'target_name': 'http_parser',
+      'type': 'static_library',
+      'include_dirs': [ '.' ],
+      'direct_dependent_settings': {
+        'defines': [ 'HTTP_PARSER_STRICT=0' ],
+        'include_dirs': [ '.' ],
+      },
+      'defines': [ 'HTTP_PARSER_STRICT=0' ],
+      'sources': [ './http_parser.c', ],
+      'conditions': [
+        ['OS=="win"', {
+          'msvs_settings': {
+            'VCCLCompilerTool': {
+              # Compile as C++. http_parser.c is actually C99, but C++ is
+              # close enough in this case.
+              'CompileAs': 2,
+            },
+          },
+        }]
+      ],
+    },
+
+    {
+      'target_name': 'http_parser_strict',
+      'type': 'static_library',
+      'include_dirs': [ '.' ],
+      'direct_dependent_settings': {
+        'defines': [ 'HTTP_PARSER_STRICT=1' ],
+        'include_dirs': [ '.' ],
+      },
+      'defines': [ 'HTTP_PARSER_STRICT=1' ],
+      'sources': [ './http_parser.c', ],
+      'conditions': [
+        ['OS=="win"', {
+          'msvs_settings': {
+            'VCCLCompilerTool': {
+              # Compile as C++. http_parser.c is actually C99, but C++ is
+              # close enough in this case.
+              'CompileAs': 2,
+            },
+          },
+        }]
+      ],
+    },
+
+    {
+      'target_name': 'test-nonstrict',
+      'type': 'executable',
+      'dependencies': [ 'http_parser' ],
+      'sources': [ 'test.c' ]
+    },
+
+    {
+      'target_name': 'test-strict',
+      'type': 'executable',
+      'dependencies': [ 'http_parser_strict' ],
+      'sources': [ 'test.c' ]
+    }
+  ]
+}
diff --git a/deps/http-parser/http_parser.h b/deps/http-parser/http_parser.h
new file mode 100644 (file)
index 0000000..eb71bf9
--- /dev/null
@@ -0,0 +1,342 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#ifndef http_parser_h
+#define http_parser_h
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Also update SONAME in the Makefile whenever you change these. */
+#define HTTP_PARSER_VERSION_MAJOR 2
+#define HTTP_PARSER_VERSION_MINOR 5
+#define HTTP_PARSER_VERSION_PATCH 0
+
+#include <sys/types.h>
+#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
+#include <BaseTsd.h>
+#include <stddef.h>
+typedef __int8 int8_t;
+typedef unsigned __int8 uint8_t;
+typedef __int16 int16_t;
+typedef unsigned __int16 uint16_t;
+typedef __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <stdint.h>
+#endif
+
+/* Compile with -DHTTP_PARSER_STRICT=0 to make less checks, but run
+ * faster
+ */
+#ifndef HTTP_PARSER_STRICT
+# define HTTP_PARSER_STRICT 1
+#endif
+
+/* Maximium header size allowed. If the macro is not defined
+ * before including this header then the default is used. To
+ * change the maximum header size, define the macro in the build
+ * environment (e.g. -DHTTP_MAX_HEADER_SIZE=<value>). To remove
+ * the effective limit on the size of the header, define the macro
+ * to a very large number (e.g. -DHTTP_MAX_HEADER_SIZE=0x7fffffff)
+ */
+#ifndef HTTP_MAX_HEADER_SIZE
+# define HTTP_MAX_HEADER_SIZE (80*1024)
+#endif
+
+typedef struct http_parser http_parser;
+typedef struct http_parser_settings http_parser_settings;
+
+
+/* Callbacks should return non-zero to indicate an error. The parser will
+ * then halt execution.
+ *
+ * The one exception is on_headers_complete. In a HTTP_RESPONSE parser
+ * returning '1' from on_headers_complete will tell the parser that it
+ * should not expect a body. This is used when receiving a response to a
+ * HEAD request which may contain 'Content-Length' or 'Transfer-Encoding:
+ * chunked' headers that indicate the presence of a body.
+ *
+ * http_data_cb does not return data chunks. It will be called arbitrarily
+ * many times for each string. E.G. you might get 10 callbacks for "on_url"
+ * each providing just a few characters more data.
+ */
+typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);
+typedef int (*http_cb) (http_parser*);
+
+
+/* Request Methods */
+#define HTTP_METHOD_MAP(XX)         \
+  XX(0,  DELETE,      DELETE)       \
+  XX(1,  GET,         GET)          \
+  XX(2,  HEAD,        HEAD)         \
+  XX(3,  POST,        POST)         \
+  XX(4,  PUT,         PUT)          \
+  /* pathological */                \
+  XX(5,  CONNECT,     CONNECT)      \
+  XX(6,  OPTIONS,     OPTIONS)      \
+  XX(7,  TRACE,       TRACE)        \
+  /* webdav */                      \
+  XX(8,  COPY,        COPY)         \
+  XX(9,  LOCK,        LOCK)         \
+  XX(10, MKCOL,       MKCOL)        \
+  XX(11, MOVE,        MOVE)         \
+  XX(12, PROPFIND,    PROPFIND)     \
+  XX(13, PROPPATCH,   PROPPATCH)    \
+  XX(14, SEARCH,      SEARCH)       \
+  XX(15, UNLOCK,      UNLOCK)       \
+  /* subversion */                  \
+  XX(16, REPORT,      REPORT)       \
+  XX(17, MKACTIVITY,  MKACTIVITY)   \
+  XX(18, CHECKOUT,    CHECKOUT)     \
+  XX(19, MERGE,       MERGE)        \
+  /* upnp */                        \
+  XX(20, MSEARCH,     M-SEARCH)     \
+  XX(21, NOTIFY,      NOTIFY)       \
+  XX(22, SUBSCRIBE,   SUBSCRIBE)    \
+  XX(23, UNSUBSCRIBE, UNSUBSCRIBE)  \
+  /* RFC-5789 */                    \
+  XX(24, PATCH,       PATCH)        \
+  XX(25, PURGE,       PURGE)        \
+  /* CalDAV */                      \
+  XX(26, MKCALENDAR,  MKCALENDAR)   \
+
+enum http_method
+  {
+#define XX(num, name, string) HTTP_##name = num,
+  HTTP_METHOD_MAP(XX)
+#undef XX
+  };
+
+
+enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH };
+
+
+/* Flag values for http_parser.flags field */
+enum flags
+  { F_CHUNKED               = 1 << 0
+  , F_CONNECTION_KEEP_ALIVE = 1 << 1
+  , F_CONNECTION_CLOSE      = 1 << 2
+  , F_CONNECTION_UPGRADE    = 1 << 3
+  , F_TRAILING              = 1 << 4
+  , F_UPGRADE               = 1 << 5
+  , F_SKIPBODY              = 1 << 6
+  };
+
+
+/* Map for errno-related constants
+ * 
+ * The provided argument should be a macro that takes 2 arguments.
+ */
+#define HTTP_ERRNO_MAP(XX)                                           \
+  /* No error */                                                     \
+  XX(OK, "success")                                                  \
+                                                                     \
+  /* Callback-related errors */                                      \
+  XX(CB_message_begin, "the on_message_begin callback failed")       \
+  XX(CB_url, "the on_url callback failed")                           \
+  XX(CB_header_field, "the on_header_field callback failed")         \
+  XX(CB_header_value, "the on_header_value callback failed")         \
+  XX(CB_headers_complete, "the on_headers_complete callback failed") \
+  XX(CB_body, "the on_body callback failed")                         \
+  XX(CB_message_complete, "the on_message_complete callback failed") \
+  XX(CB_status, "the on_status callback failed")                     \
+  XX(CB_chunk_header, "the on_chunk_header callback failed")         \
+  XX(CB_chunk_complete, "the on_chunk_complete callback failed")     \
+                                                                     \
+  /* Parsing-related errors */                                       \
+  XX(INVALID_EOF_STATE, "stream ended at an unexpected time")        \
+  XX(HEADER_OVERFLOW,                                                \
+     "too many header bytes seen; overflow detected")                \
+  XX(CLOSED_CONNECTION,                                              \
+     "data received after completed connection: close message")      \
+  XX(INVALID_VERSION, "invalid HTTP version")                        \
+  XX(INVALID_STATUS, "invalid HTTP status code")                     \
+  XX(INVALID_METHOD, "invalid HTTP method")                          \
+  XX(INVALID_URL, "invalid URL")                                     \
+  XX(INVALID_HOST, "invalid host")                                   \
+  XX(INVALID_PORT, "invalid port")                                   \
+  XX(INVALID_PATH, "invalid path")                                   \
+  XX(INVALID_QUERY_STRING, "invalid query string")                   \
+  XX(INVALID_FRAGMENT, "invalid fragment")                           \
+  XX(LF_EXPECTED, "LF character expected")                           \
+  XX(INVALID_HEADER_TOKEN, "invalid character in header")            \
+  XX(INVALID_CONTENT_LENGTH,                                         \
+     "invalid character in content-length header")                   \
+  XX(INVALID_CHUNK_SIZE,                                             \
+     "invalid character in chunk size header")                       \
+  XX(INVALID_CONSTANT, "invalid constant string")                    \
+  XX(INVALID_INTERNAL_STATE, "encountered unexpected internal state")\
+  XX(STRICT, "strict mode assertion failed")                         \
+  XX(PAUSED, "parser is paused")                                     \
+  XX(UNKNOWN, "an unknown error occurred")
+
+
+/* Define HPE_* values for each errno value above */
+#define HTTP_ERRNO_GEN(n, s) HPE_##n,
+enum http_errno {
+  HTTP_ERRNO_MAP(HTTP_ERRNO_GEN)
+};
+#undef HTTP_ERRNO_GEN
+
+
+/* Get an http_errno value from an http_parser */
+#define HTTP_PARSER_ERRNO(p)            ((enum http_errno) (p)->http_errno)
+
+
+struct http_parser {
+  /** PRIVATE **/
+  unsigned int type : 2;         /* enum http_parser_type */
+  unsigned int flags : 7;        /* F_* values from 'flags' enum; semi-public */
+  unsigned int state : 7;        /* enum state from http_parser.c */
+  unsigned int header_state : 8; /* enum header_state from http_parser.c */
+  unsigned int index : 8;        /* index into current matcher */
+
+  uint32_t nread;          /* # bytes read in various scenarios */
+  uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
+
+  /** READ-ONLY **/
+  unsigned short http_major;
+  unsigned short http_minor;
+  unsigned int status_code : 16; /* responses only */
+  unsigned int method : 8;       /* requests only */
+  unsigned int http_errno : 7;
+
+  /* 1 = Upgrade header was present and the parser has exited because of that.
+   * 0 = No upgrade header present.
+   * Should be checked when http_parser_execute() returns in addition to
+   * error checking.
+   */
+  unsigned int upgrade : 1;
+
+  /** PUBLIC **/
+  void *data; /* A pointer to get hook to the "connection" or "socket" object */
+};
+
+
+struct http_parser_settings {
+  http_cb      on_message_begin;
+  http_data_cb on_url;
+  http_data_cb on_status;
+  http_data_cb on_header_field;
+  http_data_cb on_header_value;
+  http_cb      on_headers_complete;
+  http_data_cb on_body;
+  http_cb      on_message_complete;
+  /* When on_chunk_header is called, the current chunk length is stored
+   * in parser->content_length.
+   */
+  http_cb      on_chunk_header;
+  http_cb      on_chunk_complete;
+};
+
+
+enum http_parser_url_fields
+  { UF_SCHEMA           = 0
+  , UF_HOST             = 1
+  , UF_PORT             = 2
+  , UF_PATH             = 3
+  , UF_QUERY            = 4
+  , UF_FRAGMENT         = 5
+  , UF_USERINFO         = 6
+  , UF_MAX              = 7
+  };
+
+
+/* Result structure for http_parser_parse_url().
+ *
+ * Callers should index into field_data[] with UF_* values iff field_set
+ * has the relevant (1 << UF_*) bit set. As a courtesy to clients (and
+ * because we probably have padding left over), we convert any port to
+ * a uint16_t.
+ */
+struct http_parser_url {
+  uint16_t field_set;           /* Bitmask of (1 << UF_*) values */
+  uint16_t port;                /* Converted UF_PORT string */
+
+  struct {
+    uint16_t off;               /* Offset into buffer in which field starts */
+    uint16_t len;               /* Length of run in buffer */
+  } field_data[UF_MAX];
+};
+
+
+/* Returns the library version. Bits 16-23 contain the major version number,
+ * bits 8-15 the minor version number and bits 0-7 the patch level.
+ * Usage example:
+ *
+ *   unsigned long version = http_parser_version();
+ *   unsigned major = (version >> 16) & 255;
+ *   unsigned minor = (version >> 8) & 255;
+ *   unsigned patch = version & 255;
+ *   printf("http_parser v%u.%u.%u\n", major, minor, patch);
+ */
+unsigned long http_parser_version(void);
+
+void http_parser_init(http_parser *parser, enum http_parser_type type);
+
+
+/* Initialize http_parser_settings members to 0
+ */
+void http_parser_settings_init(http_parser_settings *settings);
+
+
+/* Executes the parser. Returns number of parsed bytes. Sets
+ * `parser->http_errno` on error. */
+size_t http_parser_execute(http_parser *parser,
+                           const http_parser_settings *settings,
+                           const char *data,
+                           size_t len);
+
+
+/* If http_should_keep_alive() in the on_headers_complete or
+ * on_message_complete callback returns 0, then this should be
+ * the last message on the connection.
+ * If you are the server, respond with the "Connection: close" header.
+ * If you are the client, close the connection.
+ */
+int http_should_keep_alive(const http_parser *parser);
+
+/* Returns a string version of the HTTP method. */
+const char *http_method_str(enum http_method m);
+
+/* Return a string name of the given error */
+const char *http_errno_name(enum http_errno err);
+
+/* Return a string description of the given error */
+const char *http_errno_description(enum http_errno err);
+
+/* Parse a URL; return nonzero on failure */
+int http_parser_parse_url(const char *buf, size_t buflen,
+                          int is_connect,
+                          struct http_parser_url *u);
+
+/* Pause or un-pause the parser; a nonzero value pauses */
+void http_parser_pause(http_parser *parser, int paused);
+
+/* Checks if this is the final chunk of the body. */
+int http_body_is_final(const http_parser *parser);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/http-parser/test.c b/deps/http-parser/test.c
new file mode 100644 (file)
index 0000000..4c00571
--- /dev/null
@@ -0,0 +1,3852 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "http_parser.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h> /* rand */
+#include <string.h>
+#include <stdarg.h>
+
+#if defined(__APPLE__)
+# undef strlcat
+# undef strlncpy
+# undef strlcpy
+#endif  /* defined(__APPLE__) */
+
+#undef TRUE
+#define TRUE 1
+#undef FALSE
+#define FALSE 0
+
+#define MAX_HEADERS 13
+#define MAX_ELEMENT_SIZE 2048
+#define MAX_CHUNKS 16
+
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+
+static http_parser *parser;
+
+struct message {
+  const char *name; // for debugging purposes
+  const char *raw;
+  enum http_parser_type type;
+  enum http_method method;
+  int status_code;
+  char response_status[MAX_ELEMENT_SIZE];
+  char request_path[MAX_ELEMENT_SIZE];
+  char request_url[MAX_ELEMENT_SIZE];
+  char fragment[MAX_ELEMENT_SIZE];
+  char query_string[MAX_ELEMENT_SIZE];
+  char body[MAX_ELEMENT_SIZE];
+  size_t body_size;
+  const char *host;
+  const char *userinfo;
+  uint16_t port;
+  int num_headers;
+  enum { NONE=0, FIELD, VALUE } last_header_element;
+  char headers [MAX_HEADERS][2][MAX_ELEMENT_SIZE];
+  int should_keep_alive;
+
+  int num_chunks;
+  int num_chunks_complete;
+  int chunk_lengths[MAX_CHUNKS];
+
+  const char *upgrade; // upgraded body
+
+  unsigned short http_major;
+  unsigned short http_minor;
+
+  int message_begin_cb_called;
+  int headers_complete_cb_called;
+  int message_complete_cb_called;
+  int message_complete_on_eof;
+  int body_is_final;
+};
+
+static int currently_parsing_eof;
+
+static struct message messages[5];
+static int num_messages;
+static http_parser_settings *current_pause_parser;
+
+/* * R E Q U E S T S * */
+const struct message requests[] =
+#define CURL_GET 0
+{ {.name= "curl get"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /test HTTP/1.1\r\n"
+         "User-Agent: curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1\r\n"
+         "Host: 0.0.0.0=5000\r\n"
+         "Accept: */*\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/test"
+  ,.request_url= "/test"
+  ,.num_headers= 3
+  ,.headers=
+    { { "User-Agent", "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1" }
+    , { "Host", "0.0.0.0=5000" }
+    , { "Accept", "*/*" }
+    }
+  ,.body= ""
+  }
+
+#define FIREFOX_GET 1
+, {.name= "firefox get"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /favicon.ico HTTP/1.1\r\n"
+         "Host: 0.0.0.0=5000\r\n"
+         "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0\r\n"
+         "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"
+         "Accept-Language: en-us,en;q=0.5\r\n"
+         "Accept-Encoding: gzip,deflate\r\n"
+         "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
+         "Keep-Alive: 300\r\n"
+         "Connection: keep-alive\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/favicon.ico"
+  ,.request_url= "/favicon.ico"
+  ,.num_headers= 8
+  ,.headers=
+    { { "Host", "0.0.0.0=5000" }
+    , { "User-Agent", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0" }
+    , { "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" }
+    , { "Accept-Language", "en-us,en;q=0.5" }
+    , { "Accept-Encoding", "gzip,deflate" }
+    , { "Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7" }
+    , { "Keep-Alive", "300" }
+    , { "Connection", "keep-alive" }
+    }
+  ,.body= ""
+  }
+
+#define DUMBFUCK 2
+, {.name= "dumbfuck"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /dumbfuck HTTP/1.1\r\n"
+         "aaaaaaaaaaaaa:++++++++++\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/dumbfuck"
+  ,.request_url= "/dumbfuck"
+  ,.num_headers= 1
+  ,.headers=
+    { { "aaaaaaaaaaaaa",  "++++++++++" }
+    }
+  ,.body= ""
+  }
+
+#define FRAGMENT_IN_URI 3
+, {.name= "fragment in url"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /forums/1/topics/2375?page=1#posts-17408 HTTP/1.1\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= "page=1"
+  ,.fragment= "posts-17408"
+  ,.request_path= "/forums/1/topics/2375"
+  /* XXX request url does include fragment? */
+  ,.request_url= "/forums/1/topics/2375?page=1#posts-17408"
+  ,.num_headers= 0
+  ,.body= ""
+  }
+
+#define GET_NO_HEADERS_NO_BODY 4
+, {.name= "get no headers no body"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /get_no_headers_no_body/world HTTP/1.1\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE /* would need Connection: close */
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/get_no_headers_no_body/world"
+  ,.request_url= "/get_no_headers_no_body/world"
+  ,.num_headers= 0
+  ,.body= ""
+  }
+
+#define GET_ONE_HEADER_NO_BODY 5
+, {.name= "get one header no body"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /get_one_header_no_body HTTP/1.1\r\n"
+         "Accept: */*\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE /* would need Connection: close */
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/get_one_header_no_body"
+  ,.request_url= "/get_one_header_no_body"
+  ,.num_headers= 1
+  ,.headers=
+    { { "Accept" , "*/*" }
+    }
+  ,.body= ""
+  }
+
+#define GET_FUNKY_CONTENT_LENGTH 6
+, {.name= "get funky content length body hello"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /get_funky_content_length_body_hello HTTP/1.0\r\n"
+         "conTENT-Length: 5\r\n"
+         "\r\n"
+         "HELLO"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 0
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/get_funky_content_length_body_hello"
+  ,.request_url= "/get_funky_content_length_body_hello"
+  ,.num_headers= 1
+  ,.headers=
+    { { "conTENT-Length" , "5" }
+    }
+  ,.body= "HELLO"
+  }
+
+#define POST_IDENTITY_BODY_WORLD 7
+, {.name= "post identity body world"
+  ,.type= HTTP_REQUEST
+  ,.raw= "POST /post_identity_body_world?q=search#hey HTTP/1.1\r\n"
+         "Accept: */*\r\n"
+         "Transfer-Encoding: identity\r\n"
+         "Content-Length: 5\r\n"
+         "\r\n"
+         "World"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_POST
+  ,.query_string= "q=search"
+  ,.fragment= "hey"
+  ,.request_path= "/post_identity_body_world"
+  ,.request_url= "/post_identity_body_world?q=search#hey"
+  ,.num_headers= 3
+  ,.headers=
+    { { "Accept", "*/*" }
+    , { "Transfer-Encoding", "identity" }
+    , { "Content-Length", "5" }
+    }
+  ,.body= "World"
+  }
+
+#define POST_CHUNKED_ALL_YOUR_BASE 8
+, {.name= "post - chunked body: all your base are belong to us"
+  ,.type= HTTP_REQUEST
+  ,.raw= "POST /post_chunked_all_your_base HTTP/1.1\r\n"
+         "Transfer-Encoding: chunked\r\n"
+         "\r\n"
+         "1e\r\nall your base are belong to us\r\n"
+         "0\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_POST
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/post_chunked_all_your_base"
+  ,.request_url= "/post_chunked_all_your_base"
+  ,.num_headers= 1
+  ,.headers=
+    { { "Transfer-Encoding" , "chunked" }
+    }
+  ,.body= "all your base are belong to us"
+  ,.num_chunks_complete= 2
+  ,.chunk_lengths= { 0x1e }
+  }
+
+#define TWO_CHUNKS_MULT_ZERO_END 9
+, {.name= "two chunks ; triple zero ending"
+  ,.type= HTTP_REQUEST
+  ,.raw= "POST /two_chunks_mult_zero_end HTTP/1.1\r\n"
+         "Transfer-Encoding: chunked\r\n"
+         "\r\n"
+         "5\r\nhello\r\n"
+         "6\r\n world\r\n"
+         "000\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_POST
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/two_chunks_mult_zero_end"
+  ,.request_url= "/two_chunks_mult_zero_end"
+  ,.num_headers= 1
+  ,.headers=
+    { { "Transfer-Encoding", "chunked" }
+    }
+  ,.body= "hello world"
+  ,.num_chunks_complete= 3
+  ,.chunk_lengths= { 5, 6 }
+  }
+
+#define CHUNKED_W_TRAILING_HEADERS 10
+, {.name= "chunked with trailing headers. blech."
+  ,.type= HTTP_REQUEST
+  ,.raw= "POST /chunked_w_trailing_headers HTTP/1.1\r\n"
+         "Transfer-Encoding: chunked\r\n"
+         "\r\n"
+         "5\r\nhello\r\n"
+         "6\r\n world\r\n"
+         "0\r\n"
+         "Vary: *\r\n"
+         "Content-Type: text/plain\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_POST
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/chunked_w_trailing_headers"
+  ,.request_url= "/chunked_w_trailing_headers"
+  ,.num_headers= 3
+  ,.headers=
+    { { "Transfer-Encoding",  "chunked" }
+    , { "Vary", "*" }
+    , { "Content-Type", "text/plain" }
+    }
+  ,.body= "hello world"
+  ,.num_chunks_complete= 3
+  ,.chunk_lengths= { 5, 6 }
+  }
+
+#define CHUNKED_W_BULLSHIT_AFTER_LENGTH 11
+, {.name= "with bullshit after the length"
+  ,.type= HTTP_REQUEST
+  ,.raw= "POST /chunked_w_bullshit_after_length HTTP/1.1\r\n"
+         "Transfer-Encoding: chunked\r\n"
+         "\r\n"
+         "5; ihatew3;whatthefuck=aretheseparametersfor\r\nhello\r\n"
+         "6; blahblah; blah\r\n world\r\n"
+         "0\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_POST
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/chunked_w_bullshit_after_length"
+  ,.request_url= "/chunked_w_bullshit_after_length"
+  ,.num_headers= 1
+  ,.headers=
+    { { "Transfer-Encoding", "chunked" }
+    }
+  ,.body= "hello world"
+  ,.num_chunks_complete= 3
+  ,.chunk_lengths= { 5, 6 }
+  }
+
+#define WITH_QUOTES 12
+, {.name= "with quotes"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /with_\"stupid\"_quotes?foo=\"bar\" HTTP/1.1\r\n\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= "foo=\"bar\""
+  ,.fragment= ""
+  ,.request_path= "/with_\"stupid\"_quotes"
+  ,.request_url= "/with_\"stupid\"_quotes?foo=\"bar\""
+  ,.num_headers= 0
+  ,.headers= { }
+  ,.body= ""
+  }
+
+#define APACHEBENCH_GET 13
+/* The server receiving this request SHOULD NOT wait for EOF
+ * to know that content-length == 0.
+ * How to represent this in a unit test? message_complete_on_eof
+ * Compare with NO_CONTENT_LENGTH_RESPONSE.
+ */
+, {.name = "apachebench get"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /test HTTP/1.0\r\n"
+         "Host: 0.0.0.0:5000\r\n"
+         "User-Agent: ApacheBench/2.3\r\n"
+         "Accept: */*\r\n\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 0
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/test"
+  ,.request_url= "/test"
+  ,.num_headers= 3
+  ,.headers= { { "Host", "0.0.0.0:5000" }
+             , { "User-Agent", "ApacheBench/2.3" }
+             , { "Accept", "*/*" }
+             }
+  ,.body= ""
+  }
+
+#define QUERY_URL_WITH_QUESTION_MARK_GET 14
+/* Some clients include '?' characters in query strings.
+ */
+, {.name = "query url with question mark"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /test.cgi?foo=bar?baz HTTP/1.1\r\n\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= "foo=bar?baz"
+  ,.fragment= ""
+  ,.request_path= "/test.cgi"
+  ,.request_url= "/test.cgi?foo=bar?baz"
+  ,.num_headers= 0
+  ,.headers= {}
+  ,.body= ""
+  }
+
+#define PREFIX_NEWLINE_GET 15
+/* Some clients, especially after a POST in a keep-alive connection,
+ * will send an extra CRLF before the next request
+ */
+, {.name = "newline prefix get"
+  ,.type= HTTP_REQUEST
+  ,.raw= "\r\nGET /test HTTP/1.1\r\n\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/test"
+  ,.request_url= "/test"
+  ,.num_headers= 0
+  ,.headers= { }
+  ,.body= ""
+  }
+
+#define UPGRADE_REQUEST 16
+, {.name = "upgrade request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /demo HTTP/1.1\r\n"
+         "Host: example.com\r\n"
+         "Connection: Upgrade\r\n"
+         "Sec-WebSocket-Key2: 12998 5 Y3 1  .P00\r\n"
+         "Sec-WebSocket-Protocol: sample\r\n"
+         "Upgrade: WebSocket\r\n"
+         "Sec-WebSocket-Key1: 4 @1  46546xW%0l 1 5\r\n"
+         "Origin: http://example.com\r\n"
+         "\r\n"
+         "Hot diggity dogg"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/demo"
+  ,.request_url= "/demo"
+  ,.num_headers= 7
+  ,.upgrade="Hot diggity dogg"
+  ,.headers= { { "Host", "example.com" }
+             , { "Connection", "Upgrade" }
+             , { "Sec-WebSocket-Key2", "12998 5 Y3 1  .P00" }
+             , { "Sec-WebSocket-Protocol", "sample" }
+             , { "Upgrade", "WebSocket" }
+             , { "Sec-WebSocket-Key1", "4 @1  46546xW%0l 1 5" }
+             , { "Origin", "http://example.com" }
+             }
+  ,.body= ""
+  }
+
+#define CONNECT_REQUEST 17
+, {.name = "connect request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "CONNECT 0-home0.netscape.com:443 HTTP/1.0\r\n"
+         "User-agent: Mozilla/1.1N\r\n"
+         "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n"
+         "\r\n"
+         "some data\r\n"
+         "and yet even more data"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 0
+  ,.method= HTTP_CONNECT
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= ""
+  ,.request_url= "0-home0.netscape.com:443"
+  ,.num_headers= 2
+  ,.upgrade="some data\r\nand yet even more data"
+  ,.headers= { { "User-agent", "Mozilla/1.1N" }
+             , { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" }
+             }
+  ,.body= ""
+  }
+
+#define REPORT_REQ 18
+, {.name= "report request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "REPORT /test HTTP/1.1\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_REPORT
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/test"
+  ,.request_url= "/test"
+  ,.num_headers= 0
+  ,.headers= {}
+  ,.body= ""
+  }
+
+#define NO_HTTP_VERSION 19
+, {.name= "request with no http version"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 0
+  ,.http_minor= 9
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/"
+  ,.request_url= "/"
+  ,.num_headers= 0
+  ,.headers= {}
+  ,.body= ""
+  }
+
+#define MSEARCH_REQ 20
+, {.name= "m-search request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "M-SEARCH * HTTP/1.1\r\n"
+         "HOST: 239.255.255.250:1900\r\n"
+         "MAN: \"ssdp:discover\"\r\n"
+         "ST: \"ssdp:all\"\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_MSEARCH
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "*"
+  ,.request_url= "*"
+  ,.num_headers= 3
+  ,.headers= { { "HOST", "239.255.255.250:1900" }
+             , { "MAN", "\"ssdp:discover\"" }
+             , { "ST", "\"ssdp:all\"" }
+             }
+  ,.body= ""
+  }
+
+#define LINE_FOLDING_IN_HEADER 21
+, {.name= "line folding in header value"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET / HTTP/1.1\r\n"
+         "Line1:   abc\r\n"
+         "\tdef\r\n"
+         " ghi\r\n"
+         "\t\tjkl\r\n"
+         "  mno \r\n"
+         "\t \tqrs\r\n"
+         "Line2: \t line2\t\r\n"
+         "Line3:\r\n"
+         " line3\r\n"
+         "Line4: \r\n"
+         " \r\n"
+         "Connection:\r\n"
+         " close\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/"
+  ,.request_url= "/"
+  ,.num_headers= 5
+  ,.headers= { { "Line1", "abc\tdef ghi\t\tjkl  mno \t \tqrs" }
+             , { "Line2", "line2\t" }
+             , { "Line3", "line3" }
+             , { "Line4", "" }
+             , { "Connection", "close" },
+             }
+  ,.body= ""
+  }
+
+
+#define QUERY_TERMINATED_HOST 22
+, {.name= "host terminated by a query string"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET http://hypnotoad.org?hail=all HTTP/1.1\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= "hail=all"
+  ,.fragment= ""
+  ,.request_path= ""
+  ,.request_url= "http://hypnotoad.org?hail=all"
+  ,.host= "hypnotoad.org"
+  ,.num_headers= 0
+  ,.headers= { }
+  ,.body= ""
+  }
+
+#define QUERY_TERMINATED_HOSTPORT 23
+, {.name= "host:port terminated by a query string"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET http://hypnotoad.org:1234?hail=all HTTP/1.1\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= "hail=all"
+  ,.fragment= ""
+  ,.request_path= ""
+  ,.request_url= "http://hypnotoad.org:1234?hail=all"
+  ,.host= "hypnotoad.org"
+  ,.port= 1234
+  ,.num_headers= 0
+  ,.headers= { }
+  ,.body= ""
+  }
+
+#define SPACE_TERMINATED_HOSTPORT 24
+, {.name= "host:port terminated by a space"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET http://hypnotoad.org:1234 HTTP/1.1\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= ""
+  ,.request_url= "http://hypnotoad.org:1234"
+  ,.host= "hypnotoad.org"
+  ,.port= 1234
+  ,.num_headers= 0
+  ,.headers= { }
+  ,.body= ""
+  }
+
+#define PATCH_REQ 25
+, {.name = "PATCH request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "PATCH /file.txt HTTP/1.1\r\n"
+         "Host: www.example.com\r\n"
+         "Content-Type: application/example\r\n"
+         "If-Match: \"e0023aa4e\"\r\n"
+         "Content-Length: 10\r\n"
+         "\r\n"
+         "cccccccccc"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_PATCH
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/file.txt"
+  ,.request_url= "/file.txt"
+  ,.num_headers= 4
+  ,.headers= { { "Host", "www.example.com" }
+             , { "Content-Type", "application/example" }
+             , { "If-Match", "\"e0023aa4e\"" }
+             , { "Content-Length", "10" }
+             }
+  ,.body= "cccccccccc"
+  }
+
+#define CONNECT_CAPS_REQUEST 26
+, {.name = "connect caps request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "CONNECT HOME0.NETSCAPE.COM:443 HTTP/1.0\r\n"
+         "User-agent: Mozilla/1.1N\r\n"
+         "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 0
+  ,.method= HTTP_CONNECT
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= ""
+  ,.request_url= "HOME0.NETSCAPE.COM:443"
+  ,.num_headers= 2
+  ,.upgrade=""
+  ,.headers= { { "User-agent", "Mozilla/1.1N" }
+             , { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" }
+             }
+  ,.body= ""
+  }
+
+#if !HTTP_PARSER_STRICT
+#define UTF8_PATH_REQ 27
+, {.name= "utf-8 path request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /δ¶/δt/pope?q=1#narf HTTP/1.1\r\n"
+         "Host: github.com\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= "q=1"
+  ,.fragment= "narf"
+  ,.request_path= "/δ¶/δt/pope"
+  ,.request_url= "/δ¶/δt/pope?q=1#narf"
+  ,.num_headers= 1
+  ,.headers= { {"Host", "github.com" }
+             }
+  ,.body= ""
+  }
+
+#define HOSTNAME_UNDERSCORE 28
+, {.name = "hostname underscore"
+  ,.type= HTTP_REQUEST
+  ,.raw= "CONNECT home_0.netscape.com:443 HTTP/1.0\r\n"
+         "User-agent: Mozilla/1.1N\r\n"
+         "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 0
+  ,.method= HTTP_CONNECT
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= ""
+  ,.request_url= "home_0.netscape.com:443"
+  ,.num_headers= 2
+  ,.upgrade=""
+  ,.headers= { { "User-agent", "Mozilla/1.1N" }
+             , { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" }
+             }
+  ,.body= ""
+  }
+#endif  /* !HTTP_PARSER_STRICT */
+
+/* see https://github.com/ry/http-parser/issues/47 */
+#define EAT_TRAILING_CRLF_NO_CONNECTION_CLOSE 29
+, {.name = "eat CRLF between requests, no \"Connection: close\" header"
+  ,.raw= "POST / HTTP/1.1\r\n"
+         "Host: www.example.com\r\n"
+         "Content-Type: application/x-www-form-urlencoded\r\n"
+         "Content-Length: 4\r\n"
+         "\r\n"
+         "q=42\r\n" /* note the trailing CRLF */
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_POST
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/"
+  ,.request_url= "/"
+  ,.num_headers= 3
+  ,.upgrade= 0
+  ,.headers= { { "Host", "www.example.com" }
+             , { "Content-Type", "application/x-www-form-urlencoded" }
+             , { "Content-Length", "4" }
+             }
+  ,.body= "q=42"
+  }
+
+/* see https://github.com/ry/http-parser/issues/47 */
+#define EAT_TRAILING_CRLF_WITH_CONNECTION_CLOSE 30
+, {.name = "eat CRLF between requests even if \"Connection: close\" is set"
+  ,.raw= "POST / HTTP/1.1\r\n"
+         "Host: www.example.com\r\n"
+         "Content-Type: application/x-www-form-urlencoded\r\n"
+         "Content-Length: 4\r\n"
+         "Connection: close\r\n"
+         "\r\n"
+         "q=42\r\n" /* note the trailing CRLF */
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE /* input buffer isn't empty when on_message_complete is called */
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_POST
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/"
+  ,.request_url= "/"
+  ,.num_headers= 4
+  ,.upgrade= 0
+  ,.headers= { { "Host", "www.example.com" }
+             , { "Content-Type", "application/x-www-form-urlencoded" }
+             , { "Content-Length", "4" }
+             , { "Connection", "close" }
+             }
+  ,.body= "q=42"
+  }
+
+#define PURGE_REQ 31
+, {.name = "PURGE request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "PURGE /file.txt HTTP/1.1\r\n"
+         "Host: www.example.com\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_PURGE
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/file.txt"
+  ,.request_url= "/file.txt"
+  ,.num_headers= 1
+  ,.headers= { { "Host", "www.example.com" } }
+  ,.body= ""
+  }
+
+#define SEARCH_REQ 32
+, {.name = "SEARCH request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "SEARCH / HTTP/1.1\r\n"
+         "Host: www.example.com\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_SEARCH
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/"
+  ,.request_url= "/"
+  ,.num_headers= 1
+  ,.headers= { { "Host", "www.example.com" } }
+  ,.body= ""
+  }
+
+#define PROXY_WITH_BASIC_AUTH 33
+, {.name= "host:port and basic_auth"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET http://a%12:b!&*$@hypnotoad.org:1234/toto HTTP/1.1\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.fragment= ""
+  ,.request_path= "/toto"
+  ,.request_url= "http://a%12:b!&*$@hypnotoad.org:1234/toto"
+  ,.host= "hypnotoad.org"
+  ,.userinfo= "a%12:b!&*$"
+  ,.port= 1234
+  ,.num_headers= 0
+  ,.headers= { }
+  ,.body= ""
+  }
+
+#define LINE_FOLDING_IN_HEADER_WITH_LF 34
+, {.name= "line folding in header value"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET / HTTP/1.1\n"
+         "Line1:   abc\n"
+         "\tdef\n"
+         " ghi\n"
+         "\t\tjkl\n"
+         "  mno \n"
+         "\t \tqrs\n"
+         "Line2: \t line2\t\n"
+         "Line3:\n"
+         " line3\n"
+         "Line4: \n"
+         " \n"
+         "Connection:\n"
+         " close\n"
+         "\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/"
+  ,.request_url= "/"
+  ,.num_headers= 5
+  ,.headers= { { "Line1", "abc\tdef ghi\t\tjkl  mno \t \tqrs" }
+             , { "Line2", "line2\t" }
+             , { "Line3", "line3" }
+             , { "Line4", "" }
+             , { "Connection", "close" },
+             }
+  ,.body= ""
+  }
+
+#define CONNECTION_MULTI 35
+, {.name = "multiple connection header values with folding"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /demo HTTP/1.1\r\n"
+         "Host: example.com\r\n"
+         "Connection: Something,\r\n"
+         " Upgrade, ,Keep-Alive\r\n"
+         "Sec-WebSocket-Key2: 12998 5 Y3 1  .P00\r\n"
+         "Sec-WebSocket-Protocol: sample\r\n"
+         "Upgrade: WebSocket\r\n"
+         "Sec-WebSocket-Key1: 4 @1  46546xW%0l 1 5\r\n"
+         "Origin: http://example.com\r\n"
+         "\r\n"
+         "Hot diggity dogg"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/demo"
+  ,.request_url= "/demo"
+  ,.num_headers= 7
+  ,.upgrade="Hot diggity dogg"
+  ,.headers= { { "Host", "example.com" }
+             , { "Connection", "Something, Upgrade, ,Keep-Alive" }
+             , { "Sec-WebSocket-Key2", "12998 5 Y3 1  .P00" }
+             , { "Sec-WebSocket-Protocol", "sample" }
+             , { "Upgrade", "WebSocket" }
+             , { "Sec-WebSocket-Key1", "4 @1  46546xW%0l 1 5" }
+             , { "Origin", "http://example.com" }
+             }
+  ,.body= ""
+  }
+
+#define CONNECTION_MULTI_LWS 36
+, {.name = "multiple connection header values with folding and lws"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /demo HTTP/1.1\r\n"
+         "Connection: keep-alive, upgrade\r\n"
+         "Upgrade: WebSocket\r\n"
+         "\r\n"
+         "Hot diggity dogg"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/demo"
+  ,.request_url= "/demo"
+  ,.num_headers= 2
+  ,.upgrade="Hot diggity dogg"
+  ,.headers= { { "Connection", "keep-alive, upgrade" }
+             , { "Upgrade", "WebSocket" }
+             }
+  ,.body= ""
+  }
+
+#define CONNECTION_MULTI_LWS_CRLF 37
+, {.name = "multiple connection header values with folding and lws"
+  ,.type= HTTP_REQUEST
+  ,.raw= "GET /demo HTTP/1.1\r\n"
+         "Connection: keep-alive, \r\n upgrade\r\n"
+         "Upgrade: WebSocket\r\n"
+         "\r\n"
+         "Hot diggity dogg"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_GET
+  ,.query_string= ""
+  ,.fragment= ""
+  ,.request_path= "/demo"
+  ,.request_url= "/demo"
+  ,.num_headers= 2
+  ,.upgrade="Hot diggity dogg"
+  ,.headers= { { "Connection", "keep-alive,  upgrade" }
+             , { "Upgrade", "WebSocket" }
+             }
+  ,.body= ""
+  }
+
+#define UPGRADE_POST_REQUEST 38
+, {.name = "upgrade post request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "POST /demo HTTP/1.1\r\n"
+         "Host: example.com\r\n"
+         "Connection: Upgrade\r\n"
+         "Upgrade: HTTP/2.0\r\n"
+         "Content-Length: 15\r\n"
+         "\r\n"
+         "sweet post body"
+         "Hot diggity dogg"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.method= HTTP_POST
+  ,.request_path= "/demo"
+  ,.request_url= "/demo"
+  ,.num_headers= 4
+  ,.upgrade="Hot diggity dogg"
+  ,.headers= { { "Host", "example.com" }
+             , { "Connection", "Upgrade" }
+             , { "Upgrade", "HTTP/2.0" }
+             , { "Content-Length", "15" }
+             }
+  ,.body= "sweet post body"
+  }
+
+#define CONNECT_WITH_BODY_REQUEST 39
+, {.name = "connect with body request"
+  ,.type= HTTP_REQUEST
+  ,.raw= "CONNECT foo.bar.com:443 HTTP/1.0\r\n"
+         "User-agent: Mozilla/1.1N\r\n"
+         "Proxy-authorization: basic aGVsbG86d29ybGQ=\r\n"
+         "Content-Length: 10\r\n"
+         "\r\n"
+         "blarfcicle"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 0
+  ,.method= HTTP_CONNECT
+  ,.request_url= "foo.bar.com:443"
+  ,.num_headers= 3
+  ,.upgrade="blarfcicle"
+  ,.headers= { { "User-agent", "Mozilla/1.1N" }
+             , { "Proxy-authorization", "basic aGVsbG86d29ybGQ=" }
+             , { "Content-Length", "10" }
+             }
+  ,.body= ""
+  }
+
+, {.name= NULL } /* sentinel */
+};
+
+/* * R E S P O N S E S * */
+const struct message responses[] =
+#define GOOGLE_301 0
+{ {.name= "google 301"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 301 Moved Permanently\r\n"
+         "Location: http://www.google.com/\r\n"
+         "Content-Type: text/html; charset=UTF-8\r\n"
+         "Date: Sun, 26 Apr 2009 11:11:49 GMT\r\n"
+         "Expires: Tue, 26 May 2009 11:11:49 GMT\r\n"
+         "X-$PrototypeBI-Version: 1.6.0.3\r\n" /* $ char in header field */
+         "Cache-Control: public, max-age=2592000\r\n"
+         "Server: gws\r\n"
+         "Content-Length:  219  \r\n"
+         "\r\n"
+         "<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n"
+         "<TITLE>301 Moved</TITLE></HEAD><BODY>\n"
+         "<H1>301 Moved</H1>\n"
+         "The document has moved\n"
+         "<A HREF=\"http://www.google.com/\">here</A>.\r\n"
+         "</BODY></HTML>\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 301
+  ,.response_status= "Moved Permanently"
+  ,.num_headers= 8
+  ,.headers=
+    { { "Location", "http://www.google.com/" }
+    , { "Content-Type", "text/html; charset=UTF-8" }
+    , { "Date", "Sun, 26 Apr 2009 11:11:49 GMT" }
+    , { "Expires", "Tue, 26 May 2009 11:11:49 GMT" }
+    , { "X-$PrototypeBI-Version", "1.6.0.3" }
+    , { "Cache-Control", "public, max-age=2592000" }
+    , { "Server", "gws" }
+    , { "Content-Length", "219  " }
+    }
+  ,.body= "<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n"
+          "<TITLE>301 Moved</TITLE></HEAD><BODY>\n"
+          "<H1>301 Moved</H1>\n"
+          "The document has moved\n"
+          "<A HREF=\"http://www.google.com/\">here</A>.\r\n"
+          "</BODY></HTML>\r\n"
+  }
+
+#define NO_CONTENT_LENGTH_RESPONSE 1
+/* The client should wait for the server's EOF. That is, when content-length
+ * is not specified, and "Connection: close", the end of body is specified
+ * by the EOF.
+ * Compare with APACHEBENCH_GET
+ */
+, {.name= "no content-length response"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "Date: Tue, 04 Aug 2009 07:59:32 GMT\r\n"
+         "Server: Apache\r\n"
+         "X-Powered-By: Servlet/2.5 JSP/2.1\r\n"
+         "Content-Type: text/xml; charset=utf-8\r\n"
+         "Connection: close\r\n"
+         "\r\n"
+         "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+         "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
+         "  <SOAP-ENV:Body>\n"
+         "    <SOAP-ENV:Fault>\n"
+         "       <faultcode>SOAP-ENV:Client</faultcode>\n"
+         "       <faultstring>Client Error</faultstring>\n"
+         "    </SOAP-ENV:Fault>\n"
+         "  </SOAP-ENV:Body>\n"
+         "</SOAP-ENV:Envelope>"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= TRUE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 5
+  ,.headers=
+    { { "Date", "Tue, 04 Aug 2009 07:59:32 GMT" }
+    , { "Server", "Apache" }
+    , { "X-Powered-By", "Servlet/2.5 JSP/2.1" }
+    , { "Content-Type", "text/xml; charset=utf-8" }
+    , { "Connection", "close" }
+    }
+  ,.body= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+          "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
+          "  <SOAP-ENV:Body>\n"
+          "    <SOAP-ENV:Fault>\n"
+          "       <faultcode>SOAP-ENV:Client</faultcode>\n"
+          "       <faultstring>Client Error</faultstring>\n"
+          "    </SOAP-ENV:Fault>\n"
+          "  </SOAP-ENV:Body>\n"
+          "</SOAP-ENV:Envelope>"
+  }
+
+#define NO_HEADERS_NO_BODY_404 2
+, {.name= "404 no headers no body"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 404 Not Found\r\n\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= TRUE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 404
+  ,.response_status= "Not Found"
+  ,.num_headers= 0
+  ,.headers= {}
+  ,.body_size= 0
+  ,.body= ""
+  }
+
+#define NO_REASON_PHRASE 3
+, {.name= "301 no response phrase"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 301\r\n\r\n"
+  ,.should_keep_alive = FALSE
+  ,.message_complete_on_eof= TRUE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 301
+  ,.response_status= ""
+  ,.num_headers= 0
+  ,.headers= {}
+  ,.body= ""
+  }
+
+#define TRAILING_SPACE_ON_CHUNKED_BODY 4
+, {.name="200 trailing space on chunked body"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "Content-Type: text/plain\r\n"
+         "Transfer-Encoding: chunked\r\n"
+         "\r\n"
+         "25  \r\n"
+         "This is the data in the first chunk\r\n"
+         "\r\n"
+         "1C\r\n"
+         "and this is the second one\r\n"
+         "\r\n"
+         "0  \r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 2
+  ,.headers=
+    { {"Content-Type", "text/plain" }
+    , {"Transfer-Encoding", "chunked" }
+    }
+  ,.body_size = 37+28
+  ,.body =
+         "This is the data in the first chunk\r\n"
+         "and this is the second one\r\n"
+  ,.num_chunks_complete= 3
+  ,.chunk_lengths= { 0x25, 0x1c }
+  }
+
+#define NO_CARRIAGE_RET 5
+, {.name="no carriage ret"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\n"
+         "Content-Type: text/html; charset=utf-8\n"
+         "Connection: close\n"
+         "\n"
+         "these headers are from http://news.ycombinator.com/"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= TRUE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 2
+  ,.headers=
+    { {"Content-Type", "text/html; charset=utf-8" }
+    , {"Connection", "close" }
+    }
+  ,.body= "these headers are from http://news.ycombinator.com/"
+  }
+
+#define PROXY_CONNECTION 6
+, {.name="proxy connection"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "Content-Type: text/html; charset=UTF-8\r\n"
+         "Content-Length: 11\r\n"
+         "Proxy-Connection: close\r\n"
+         "Date: Thu, 31 Dec 2009 20:55:48 +0000\r\n"
+         "\r\n"
+         "hello world"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 4
+  ,.headers=
+    { {"Content-Type", "text/html; charset=UTF-8" }
+    , {"Content-Length", "11" }
+    , {"Proxy-Connection", "close" }
+    , {"Date", "Thu, 31 Dec 2009 20:55:48 +0000"}
+    }
+  ,.body= "hello world"
+  }
+
+#define UNDERSTORE_HEADER_KEY 7
+  // shown by
+  // curl -o /dev/null -v "http://ad.doubleclick.net/pfadx/DARTSHELLCONFIGXML;dcmt=text/xml;"
+, {.name="underscore header key"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "Server: DCLK-AdSvr\r\n"
+         "Content-Type: text/xml\r\n"
+         "Content-Length: 0\r\n"
+         "DCLK_imp: v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o\r\n\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 4
+  ,.headers=
+    { {"Server", "DCLK-AdSvr" }
+    , {"Content-Type", "text/xml" }
+    , {"Content-Length", "0" }
+    , {"DCLK_imp", "v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o" }
+    }
+  ,.body= ""
+  }
+
+#define BONJOUR_MADAME_FR 8
+/* The client should not merge two headers fields when the first one doesn't
+ * have a value.
+ */
+, {.name= "bonjourmadame.fr"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.0 301 Moved Permanently\r\n"
+         "Date: Thu, 03 Jun 2010 09:56:32 GMT\r\n"
+         "Server: Apache/2.2.3 (Red Hat)\r\n"
+         "Cache-Control: public\r\n"
+         "Pragma: \r\n"
+         "Location: http://www.bonjourmadame.fr/\r\n"
+         "Vary: Accept-Encoding\r\n"
+         "Content-Length: 0\r\n"
+         "Content-Type: text/html; charset=UTF-8\r\n"
+         "Connection: keep-alive\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 0
+  ,.status_code= 301
+  ,.response_status= "Moved Permanently"
+  ,.num_headers= 9
+  ,.headers=
+    { { "Date", "Thu, 03 Jun 2010 09:56:32 GMT" }
+    , { "Server", "Apache/2.2.3 (Red Hat)" }
+    , { "Cache-Control", "public" }
+    , { "Pragma", "" }
+    , { "Location", "http://www.bonjourmadame.fr/" }
+    , { "Vary",  "Accept-Encoding" }
+    , { "Content-Length", "0" }
+    , { "Content-Type", "text/html; charset=UTF-8" }
+    , { "Connection", "keep-alive" }
+    }
+  ,.body= ""
+  }
+
+#define RES_FIELD_UNDERSCORE 9
+/* Should handle spaces in header fields */
+, {.name= "field underscore"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "Date: Tue, 28 Sep 2010 01:14:13 GMT\r\n"
+         "Server: Apache\r\n"
+         "Cache-Control: no-cache, must-revalidate\r\n"
+         "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n"
+         ".et-Cookie: PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com\r\n"
+         "Vary: Accept-Encoding\r\n"
+         "_eep-Alive: timeout=45\r\n" /* semantic value ignored */
+         "_onnection: Keep-Alive\r\n" /* semantic value ignored */
+         "Transfer-Encoding: chunked\r\n"
+         "Content-Type: text/html\r\n"
+         "Connection: close\r\n"
+         "\r\n"
+         "0\r\n\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 11
+  ,.headers=
+    { { "Date", "Tue, 28 Sep 2010 01:14:13 GMT" }
+    , { "Server", "Apache" }
+    , { "Cache-Control", "no-cache, must-revalidate" }
+    , { "Expires", "Mon, 26 Jul 1997 05:00:00 GMT" }
+    , { ".et-Cookie", "PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com" }
+    , { "Vary", "Accept-Encoding" }
+    , { "_eep-Alive", "timeout=45" }
+    , { "_onnection", "Keep-Alive" }
+    , { "Transfer-Encoding", "chunked" }
+    , { "Content-Type", "text/html" }
+    , { "Connection", "close" }
+    }
+  ,.body= ""
+  ,.num_chunks_complete= 1
+  ,.chunk_lengths= {}
+  }
+
+#define NON_ASCII_IN_STATUS_LINE 10
+/* Should handle non-ASCII in status line */
+, {.name= "non-ASCII in status line"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 500 Oriëntatieprobleem\r\n"
+         "Date: Fri, 5 Nov 2010 23:07:12 GMT+2\r\n"
+         "Content-Length: 0\r\n"
+         "Connection: close\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 500
+  ,.response_status= "Oriëntatieprobleem"
+  ,.num_headers= 3
+  ,.headers=
+    { { "Date", "Fri, 5 Nov 2010 23:07:12 GMT+2" }
+    , { "Content-Length", "0" }
+    , { "Connection", "close" }
+    }
+  ,.body= ""
+  }
+
+#define HTTP_VERSION_0_9 11
+/* Should handle HTTP/0.9 */
+, {.name= "http version 0.9"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/0.9 200 OK\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= TRUE
+  ,.http_major= 0
+  ,.http_minor= 9
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 0
+  ,.headers=
+    {}
+  ,.body= ""
+  }
+
+#define NO_CONTENT_LENGTH_NO_TRANSFER_ENCODING_RESPONSE 12
+/* The client should wait for the server's EOF. That is, when neither
+ * content-length nor transfer-encoding is specified, the end of body
+ * is specified by the EOF.
+ */
+, {.name= "neither content-length nor transfer-encoding response"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "Content-Type: text/plain\r\n"
+         "\r\n"
+         "hello world"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= TRUE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 1
+  ,.headers=
+    { { "Content-Type", "text/plain" }
+    }
+  ,.body= "hello world"
+  }
+
+#define NO_BODY_HTTP10_KA_200 13
+, {.name= "HTTP/1.0 with keep-alive and EOF-terminated 200 status"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.0 200 OK\r\n"
+         "Connection: keep-alive\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= TRUE
+  ,.http_major= 1
+  ,.http_minor= 0
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 1
+  ,.headers=
+    { { "Connection", "keep-alive" }
+    }
+  ,.body_size= 0
+  ,.body= ""
+  }
+
+#define NO_BODY_HTTP10_KA_204 14
+, {.name= "HTTP/1.0 with keep-alive and a 204 status"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.0 204 No content\r\n"
+         "Connection: keep-alive\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 0
+  ,.status_code= 204
+  ,.response_status= "No content"
+  ,.num_headers= 1
+  ,.headers=
+    { { "Connection", "keep-alive" }
+    }
+  ,.body_size= 0
+  ,.body= ""
+  }
+
+#define NO_BODY_HTTP11_KA_200 15
+, {.name= "HTTP/1.1 with an EOF-terminated 200 status"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= TRUE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 0
+  ,.headers={}
+  ,.body_size= 0
+  ,.body= ""
+  }
+
+#define NO_BODY_HTTP11_KA_204 16
+, {.name= "HTTP/1.1 with a 204 status"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 204 No content\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 204
+  ,.response_status= "No content"
+  ,.num_headers= 0
+  ,.headers={}
+  ,.body_size= 0
+  ,.body= ""
+  }
+
+#define NO_BODY_HTTP11_NOKA_204 17
+, {.name= "HTTP/1.1 with a 204 status and keep-alive disabled"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 204 No content\r\n"
+         "Connection: close\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 204
+  ,.response_status= "No content"
+  ,.num_headers= 1
+  ,.headers=
+    { { "Connection", "close" }
+    }
+  ,.body_size= 0
+  ,.body= ""
+  }
+
+#define NO_BODY_HTTP11_KA_CHUNKED_200 18
+, {.name= "HTTP/1.1 with chunked endocing and a 200 response"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "Transfer-Encoding: chunked\r\n"
+         "\r\n"
+         "0\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 1
+  ,.headers=
+    { { "Transfer-Encoding", "chunked" }
+    }
+  ,.body_size= 0
+  ,.body= ""
+  ,.num_chunks_complete= 1
+  }
+
+#if !HTTP_PARSER_STRICT
+#define SPACE_IN_FIELD_RES 19
+/* Should handle spaces in header fields */
+, {.name= "field space"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "Server: Microsoft-IIS/6.0\r\n"
+         "X-Powered-By: ASP.NET\r\n"
+         "en-US Content-Type: text/xml\r\n" /* this is the problem */
+         "Content-Type: text/xml\r\n"
+         "Content-Length: 16\r\n"
+         "Date: Fri, 23 Jul 2010 18:45:38 GMT\r\n"
+         "Connection: keep-alive\r\n"
+         "\r\n"
+         "<xml>hello</xml>" /* fake body */
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.num_headers= 7
+  ,.headers=
+    { { "Server",  "Microsoft-IIS/6.0" }
+    , { "X-Powered-By", "ASP.NET" }
+    , { "en-US Content-Type", "text/xml" }
+    , { "Content-Type", "text/xml" }
+    , { "Content-Length", "16" }
+    , { "Date", "Fri, 23 Jul 2010 18:45:38 GMT" }
+    , { "Connection", "keep-alive" }
+    }
+  ,.body= "<xml>hello</xml>"
+  }
+#endif /* !HTTP_PARSER_STRICT */
+
+#define AMAZON_COM 20
+, {.name= "amazon.com"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 301 MovedPermanently\r\n"
+         "Date: Wed, 15 May 2013 17:06:33 GMT\r\n"
+         "Server: Server\r\n"
+         "x-amz-id-1: 0GPHKXSJQ826RK7GZEB2\r\n"
+         "p3p: policyref=\"http://www.amazon.com/w3c/p3p.xml\",CP=\"CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC \"\r\n"
+         "x-amz-id-2: STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD\r\n"
+         "Location: http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846\r\n"
+         "Vary: Accept-Encoding,User-Agent\r\n"
+         "Content-Type: text/html; charset=ISO-8859-1\r\n"
+         "Transfer-Encoding: chunked\r\n"
+         "\r\n"
+         "1\r\n"
+         "\n\r\n"
+         "0\r\n"
+         "\r\n"
+  ,.should_keep_alive= TRUE
+  ,.message_complete_on_eof= FALSE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 301
+  ,.response_status= "MovedPermanently"
+  ,.num_headers= 9
+  ,.headers= { { "Date", "Wed, 15 May 2013 17:06:33 GMT" }
+             , { "Server", "Server" }
+             , { "x-amz-id-1", "0GPHKXSJQ826RK7GZEB2" }
+             , { "p3p", "policyref=\"http://www.amazon.com/w3c/p3p.xml\",CP=\"CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC \"" }
+             , { "x-amz-id-2", "STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD" }
+             , { "Location", "http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846" }
+             , { "Vary", "Accept-Encoding,User-Agent" }
+             , { "Content-Type", "text/html; charset=ISO-8859-1" }
+             , { "Transfer-Encoding", "chunked" }
+             }
+  ,.body= "\n"
+  ,.num_chunks_complete= 2
+  ,.chunk_lengths= { 1 }
+  }
+
+#define EMPTY_REASON_PHRASE_AFTER_SPACE 20
+, {.name= "empty reason phrase after space"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 \r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= TRUE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= ""
+  ,.num_headers= 0
+  ,.headers= {}
+  ,.body= ""
+  }
+
+, {.name= NULL } /* sentinel */
+};
+
+/* strnlen() is a POSIX.2008 addition. Can't rely on it being available so
+ * define it ourselves.
+ */
+size_t
+strnlen(const char *s, size_t maxlen)
+{
+  const char *p;
+
+  p = memchr(s, '\0', maxlen);
+  if (p == NULL)
+    return maxlen;
+
+  return p - s;
+}
+
+size_t
+strlncat(char *dst, size_t len, const char *src, size_t n)
+{
+  size_t slen;
+  size_t dlen;
+  size_t rlen;
+  size_t ncpy;
+
+  slen = strnlen(src, n);
+  dlen = strnlen(dst, len);
+
+  if (dlen < len) {
+    rlen = len - dlen;
+    ncpy = slen < rlen ? slen : (rlen - 1);
+    memcpy(dst + dlen, src, ncpy);
+    dst[dlen + ncpy] = '\0';
+  }
+
+  assert(len > slen + dlen);
+  return slen + dlen;
+}
+
+size_t
+strlcat(char *dst, const char *src, size_t len)
+{
+  return strlncat(dst, len, src, (size_t) -1);
+}
+
+size_t
+strlncpy(char *dst, size_t len, const char *src, size_t n)
+{
+  size_t slen;
+  size_t ncpy;
+
+  slen = strnlen(src, n);
+
+  if (len > 0) {
+    ncpy = slen < len ? slen : (len - 1);
+    memcpy(dst, src, ncpy);
+    dst[ncpy] = '\0';
+  }
+
+  assert(len > slen);
+  return slen;
+}
+
+size_t
+strlcpy(char *dst, const char *src, size_t len)
+{
+  return strlncpy(dst, len, src, (size_t) -1);
+}
+
+int
+request_url_cb (http_parser *p, const char *buf, size_t len)
+{
+  assert(p == parser);
+  strlncat(messages[num_messages].request_url,
+           sizeof(messages[num_messages].request_url),
+           buf,
+           len);
+  return 0;
+}
+
+int
+header_field_cb (http_parser *p, const char *buf, size_t len)
+{
+  assert(p == parser);
+  struct message *m = &messages[num_messages];
+
+  if (m->last_header_element != FIELD)
+    m->num_headers++;
+
+  strlncat(m->headers[m->num_headers-1][0],
+           sizeof(m->headers[m->num_headers-1][0]),
+           buf,
+           len);
+
+  m->last_header_element = FIELD;
+
+  return 0;
+}
+
+int
+header_value_cb (http_parser *p, const char *buf, size_t len)
+{
+  assert(p == parser);
+  struct message *m = &messages[num_messages];
+
+  strlncat(m->headers[m->num_headers-1][1],
+           sizeof(m->headers[m->num_headers-1][1]),
+           buf,
+           len);
+
+  m->last_header_element = VALUE;
+
+  return 0;
+}
+
+void
+check_body_is_final (const http_parser *p)
+{
+  if (messages[num_messages].body_is_final) {
+    fprintf(stderr, "\n\n *** Error http_body_is_final() should return 1 "
+                    "on last on_body callback call "
+                    "but it doesn't! ***\n\n");
+    assert(0);
+    abort();
+  }
+  messages[num_messages].body_is_final = http_body_is_final(p);
+}
+
+int
+body_cb (http_parser *p, const char *buf, size_t len)
+{
+  assert(p == parser);
+  strlncat(messages[num_messages].body,
+           sizeof(messages[num_messages].body),
+           buf,
+           len);
+  messages[num_messages].body_size += len;
+  check_body_is_final(p);
+ // printf("body_cb: '%s'\n", requests[num_messages].body);
+  return 0;
+}
+
+int
+count_body_cb (http_parser *p, const char *buf, size_t len)
+{
+  assert(p == parser);
+  assert(buf);
+  messages[num_messages].body_size += len;
+  check_body_is_final(p);
+  return 0;
+}
+
+int
+message_begin_cb (http_parser *p)
+{
+  assert(p == parser);
+  messages[num_messages].message_begin_cb_called = TRUE;
+  return 0;
+}
+
+int
+headers_complete_cb (http_parser *p)
+{
+  assert(p == parser);
+  messages[num_messages].method = parser->method;
+  messages[num_messages].status_code = parser->status_code;
+  messages[num_messages].http_major = parser->http_major;
+  messages[num_messages].http_minor = parser->http_minor;
+  messages[num_messages].headers_complete_cb_called = TRUE;
+  messages[num_messages].should_keep_alive = http_should_keep_alive(parser);
+  return 0;
+}
+
+int
+message_complete_cb (http_parser *p)
+{
+  assert(p == parser);
+  if (messages[num_messages].should_keep_alive != http_should_keep_alive(parser))
+  {
+    fprintf(stderr, "\n\n *** Error http_should_keep_alive() should have same "
+                    "value in both on_message_complete and on_headers_complete "
+                    "but it doesn't! ***\n\n");
+    assert(0);
+    abort();
+  }
+
+  if (messages[num_messages].body_size &&
+      http_body_is_final(p) &&
+      !messages[num_messages].body_is_final)
+  {
+    fprintf(stderr, "\n\n *** Error http_body_is_final() should return 1 "
+                    "on last on_body callback call "
+                    "but it doesn't! ***\n\n");
+    assert(0);
+    abort();
+  }
+
+  messages[num_messages].message_complete_cb_called = TRUE;
+
+  messages[num_messages].message_complete_on_eof = currently_parsing_eof;
+
+  num_messages++;
+  return 0;
+}
+
+int
+response_status_cb (http_parser *p, const char *buf, size_t len)
+{
+  assert(p == parser);
+  strlncat(messages[num_messages].response_status,
+           sizeof(messages[num_messages].response_status),
+           buf,
+           len);
+  return 0;
+}
+
+int
+chunk_header_cb (http_parser *p)
+{
+  assert(p == parser);
+  int chunk_idx = messages[num_messages].num_chunks;
+  messages[num_messages].num_chunks++;
+  if (chunk_idx < MAX_CHUNKS) {
+    messages[num_messages].chunk_lengths[chunk_idx] = p->content_length;
+  }
+
+  return 0;
+}
+
+int
+chunk_complete_cb (http_parser *p)
+{
+  assert(p == parser);
+
+  /* Here we want to verify that each chunk_header_cb is matched by a
+   * chunk_complete_cb, so not only should the total number of calls to
+   * both callbacks be the same, but they also should be interleaved
+   * properly */
+  assert(messages[num_messages].num_chunks ==
+         messages[num_messages].num_chunks_complete + 1);
+
+  messages[num_messages].num_chunks_complete++;
+  return 0;
+}
+
+/* These dontcall_* callbacks exist so that we can verify that when we're
+ * paused, no additional callbacks are invoked */
+int
+dontcall_message_begin_cb (http_parser *p)
+{
+  if (p) { } // gcc
+  fprintf(stderr, "\n\n*** on_message_begin() called on paused parser ***\n\n");
+  abort();
+}
+
+int
+dontcall_header_field_cb (http_parser *p, const char *buf, size_t len)
+{
+  if (p || buf || len) { } // gcc
+  fprintf(stderr, "\n\n*** on_header_field() called on paused parser ***\n\n");
+  abort();
+}
+
+int
+dontcall_header_value_cb (http_parser *p, const char *buf, size_t len)
+{
+  if (p || buf || len) { } // gcc
+  fprintf(stderr, "\n\n*** on_header_value() called on paused parser ***\n\n");
+  abort();
+}
+
+int
+dontcall_request_url_cb (http_parser *p, const char *buf, size_t len)
+{
+  if (p || buf || len) { } // gcc
+  fprintf(stderr, "\n\n*** on_request_url() called on paused parser ***\n\n");
+  abort();
+}
+
+int
+dontcall_body_cb (http_parser *p, const char *buf, size_t len)
+{
+  if (p || buf || len) { } // gcc
+  fprintf(stderr, "\n\n*** on_body_cb() called on paused parser ***\n\n");
+  abort();
+}
+
+int
+dontcall_headers_complete_cb (http_parser *p)
+{
+  if (p) { } // gcc
+  fprintf(stderr, "\n\n*** on_headers_complete() called on paused "
+                  "parser ***\n\n");
+  abort();
+}
+
+int
+dontcall_message_complete_cb (http_parser *p)
+{
+  if (p) { } // gcc
+  fprintf(stderr, "\n\n*** on_message_complete() called on paused "
+                  "parser ***\n\n");
+  abort();
+}
+
+int
+dontcall_response_status_cb (http_parser *p, const char *buf, size_t len)
+{
+  if (p || buf || len) { } // gcc
+  fprintf(stderr, "\n\n*** on_status() called on paused parser ***\n\n");
+  abort();
+}
+
+int
+dontcall_chunk_header_cb (http_parser *p)
+{
+  if (p) { } // gcc
+  fprintf(stderr, "\n\n*** on_chunk_header() called on paused parser ***\n\n");
+  exit(1);
+}
+
+int
+dontcall_chunk_complete_cb (http_parser *p)
+{
+  if (p) { } // gcc
+  fprintf(stderr, "\n\n*** on_chunk_complete() "
+          "called on paused parser ***\n\n");
+  exit(1);
+}
+
+static http_parser_settings settings_dontcall =
+  {.on_message_begin = dontcall_message_begin_cb
+  ,.on_header_field = dontcall_header_field_cb
+  ,.on_header_value = dontcall_header_value_cb
+  ,.on_url = dontcall_request_url_cb
+  ,.on_status = dontcall_response_status_cb
+  ,.on_body = dontcall_body_cb
+  ,.on_headers_complete = dontcall_headers_complete_cb
+  ,.on_message_complete = dontcall_message_complete_cb
+  ,.on_chunk_header = dontcall_chunk_header_cb
+  ,.on_chunk_complete = dontcall_chunk_complete_cb
+  };
+
+/* These pause_* callbacks always pause the parser and just invoke the regular
+ * callback that tracks content. Before returning, we overwrite the parser
+ * settings to point to the _dontcall variety so that we can verify that
+ * the pause actually did, you know, pause. */
+int
+pause_message_begin_cb (http_parser *p)
+{
+  http_parser_pause(p, 1);
+  *current_pause_parser = settings_dontcall;
+  return message_begin_cb(p);
+}
+
+int
+pause_header_field_cb (http_parser *p, const char *buf, size_t len)
+{
+  http_parser_pause(p, 1);
+  *current_pause_parser = settings_dontcall;
+  return header_field_cb(p, buf, len);
+}
+
+int
+pause_header_value_cb (http_parser *p, const char *buf, size_t len)
+{
+  http_parser_pause(p, 1);
+  *current_pause_parser = settings_dontcall;
+  return header_value_cb(p, buf, len);
+}
+
+int
+pause_request_url_cb (http_parser *p, const char *buf, size_t len)
+{
+  http_parser_pause(p, 1);
+  *current_pause_parser = settings_dontcall;
+  return request_url_cb(p, buf, len);
+}
+
+int
+pause_body_cb (http_parser *p, const char *buf, size_t len)
+{
+  http_parser_pause(p, 1);
+  *current_pause_parser = settings_dontcall;
+  return body_cb(p, buf, len);
+}
+
+int
+pause_headers_complete_cb (http_parser *p)
+{
+  http_parser_pause(p, 1);
+  *current_pause_parser = settings_dontcall;
+  return headers_complete_cb(p);
+}
+
+int
+pause_message_complete_cb (http_parser *p)
+{
+  http_parser_pause(p, 1);
+  *current_pause_parser = settings_dontcall;
+  return message_complete_cb(p);
+}
+
+int
+pause_response_status_cb (http_parser *p, const char *buf, size_t len)
+{
+  http_parser_pause(p, 1);
+  *current_pause_parser = settings_dontcall;
+  return response_status_cb(p, buf, len);
+}
+
+int
+pause_chunk_header_cb (http_parser *p)
+{
+  http_parser_pause(p, 1);
+  *current_pause_parser = settings_dontcall;
+  return chunk_header_cb(p);
+}
+
+int
+pause_chunk_complete_cb (http_parser *p)
+{
+  http_parser_pause(p, 1);
+  *current_pause_parser = settings_dontcall;
+  return chunk_complete_cb(p);
+}
+
+static http_parser_settings settings_pause =
+  {.on_message_begin = pause_message_begin_cb
+  ,.on_header_field = pause_header_field_cb
+  ,.on_header_value = pause_header_value_cb
+  ,.on_url = pause_request_url_cb
+  ,.on_status = pause_response_status_cb
+  ,.on_body = pause_body_cb
+  ,.on_headers_complete = pause_headers_complete_cb
+  ,.on_message_complete = pause_message_complete_cb
+  ,.on_chunk_header = pause_chunk_header_cb
+  ,.on_chunk_complete = pause_chunk_complete_cb
+  };
+
+static http_parser_settings settings =
+  {.on_message_begin = message_begin_cb
+  ,.on_header_field = header_field_cb
+  ,.on_header_value = header_value_cb
+  ,.on_url = request_url_cb
+  ,.on_status = response_status_cb
+  ,.on_body = body_cb
+  ,.on_headers_complete = headers_complete_cb
+  ,.on_message_complete = message_complete_cb
+  ,.on_chunk_header = chunk_header_cb
+  ,.on_chunk_complete = chunk_complete_cb
+  };
+
+static http_parser_settings settings_count_body =
+  {.on_message_begin = message_begin_cb
+  ,.on_header_field = header_field_cb
+  ,.on_header_value = header_value_cb
+  ,.on_url = request_url_cb
+  ,.on_status = response_status_cb
+  ,.on_body = count_body_cb
+  ,.on_headers_complete = headers_complete_cb
+  ,.on_message_complete = message_complete_cb
+  ,.on_chunk_header = chunk_header_cb
+  ,.on_chunk_complete = chunk_complete_cb
+  };
+
+static http_parser_settings settings_null =
+  {.on_message_begin = 0
+  ,.on_header_field = 0
+  ,.on_header_value = 0
+  ,.on_url = 0
+  ,.on_status = 0
+  ,.on_body = 0
+  ,.on_headers_complete = 0
+  ,.on_message_complete = 0
+  ,.on_chunk_header = 0
+  ,.on_chunk_complete = 0
+  };
+
+void
+parser_init (enum http_parser_type type)
+{
+  num_messages = 0;
+
+  assert(parser == NULL);
+
+  parser = malloc(sizeof(http_parser));
+
+  http_parser_init(parser, type);
+
+  memset(&messages, 0, sizeof messages);
+
+}
+
+void
+parser_free ()
+{
+  assert(parser);
+  free(parser);
+  parser = NULL;
+}
+
+size_t parse (const char *buf, size_t len)
+{
+  size_t nparsed;
+  currently_parsing_eof = (len == 0);
+  nparsed = http_parser_execute(parser, &settings, buf, len);
+  return nparsed;
+}
+
+size_t parse_count_body (const char *buf, size_t len)
+{
+  size_t nparsed;
+  currently_parsing_eof = (len == 0);
+  nparsed = http_parser_execute(parser, &settings_count_body, buf, len);
+  return nparsed;
+}
+
+size_t parse_pause (const char *buf, size_t len)
+{
+  size_t nparsed;
+  http_parser_settings s = settings_pause;
+
+  currently_parsing_eof = (len == 0);
+  current_pause_parser = &s;
+  nparsed = http_parser_execute(parser, current_pause_parser, buf, len);
+  return nparsed;
+}
+
+static inline int
+check_str_eq (const struct message *m,
+              const char *prop,
+              const char *expected,
+              const char *found) {
+  if ((expected == NULL) != (found == NULL)) {
+    printf("\n*** Error: %s in '%s' ***\n\n", prop, m->name);
+    printf("expected %s\n", (expected == NULL) ? "NULL" : expected);
+    printf("   found %s\n", (found == NULL) ? "NULL" : found);
+    return 0;
+  }
+  if (expected != NULL && 0 != strcmp(expected, found)) {
+    printf("\n*** Error: %s in '%s' ***\n\n", prop, m->name);
+    printf("expected '%s'\n", expected);
+    printf("   found '%s'\n", found);
+    return 0;
+  }
+  return 1;
+}
+
+static inline int
+check_num_eq (const struct message *m,
+              const char *prop,
+              int expected,
+              int found) {
+  if (expected != found) {
+    printf("\n*** Error: %s in '%s' ***\n\n", prop, m->name);
+    printf("expected %d\n", expected);
+    printf("   found %d\n", found);
+    return 0;
+  }
+  return 1;
+}
+
+#define MESSAGE_CHECK_STR_EQ(expected, found, prop) \
+  if (!check_str_eq(expected, #prop, expected->prop, found->prop)) return 0
+
+#define MESSAGE_CHECK_NUM_EQ(expected, found, prop) \
+  if (!check_num_eq(expected, #prop, expected->prop, found->prop)) return 0
+
+#define MESSAGE_CHECK_URL_EQ(u, expected, found, prop, fn)           \
+do {                                                                 \
+  char ubuf[256];                                                    \
+                                                                     \
+  if ((u)->field_set & (1 << (fn))) {                                \
+    memcpy(ubuf, (found)->request_url + (u)->field_data[(fn)].off,   \
+      (u)->field_data[(fn)].len);                                    \
+    ubuf[(u)->field_data[(fn)].len] = '\0';                          \
+  } else {                                                           \
+    ubuf[0] = '\0';                                                  \
+  }                                                                  \
+                                                                     \
+  check_str_eq(expected, #prop, expected->prop, ubuf);               \
+} while(0)
+
+int
+message_eq (int index, const struct message *expected)
+{
+  int i;
+  struct message *m = &messages[index];
+
+  MESSAGE_CHECK_NUM_EQ(expected, m, http_major);
+  MESSAGE_CHECK_NUM_EQ(expected, m, http_minor);
+
+  if (expected->type == HTTP_REQUEST) {
+    MESSAGE_CHECK_NUM_EQ(expected, m, method);
+  } else {
+    MESSAGE_CHECK_NUM_EQ(expected, m, status_code);
+    MESSAGE_CHECK_STR_EQ(expected, m, response_status);
+  }
+
+  MESSAGE_CHECK_NUM_EQ(expected, m, should_keep_alive);
+  MESSAGE_CHECK_NUM_EQ(expected, m, message_complete_on_eof);
+
+  assert(m->message_begin_cb_called);
+  assert(m->headers_complete_cb_called);
+  assert(m->message_complete_cb_called);
+
+
+  MESSAGE_CHECK_STR_EQ(expected, m, request_url);
+
+  /* Check URL components; we can't do this w/ CONNECT since it doesn't
+   * send us a well-formed URL.
+   */
+  if (*m->request_url && m->method != HTTP_CONNECT) {
+    struct http_parser_url u;
+
+    if (http_parser_parse_url(m->request_url, strlen(m->request_url), 0, &u)) {
+      fprintf(stderr, "\n\n*** failed to parse URL %s ***\n\n",
+        m->request_url);
+      abort();
+    }
+
+    if (expected->host) {
+      MESSAGE_CHECK_URL_EQ(&u, expected, m, host, UF_HOST);
+    }
+
+    if (expected->userinfo) {
+      MESSAGE_CHECK_URL_EQ(&u, expected, m, userinfo, UF_USERINFO);
+    }
+
+    m->port = (u.field_set & (1 << UF_PORT)) ?
+      u.port : 0;
+
+    MESSAGE_CHECK_URL_EQ(&u, expected, m, query_string, UF_QUERY);
+    MESSAGE_CHECK_URL_EQ(&u, expected, m, fragment, UF_FRAGMENT);
+    MESSAGE_CHECK_URL_EQ(&u, expected, m, request_path, UF_PATH);
+    MESSAGE_CHECK_NUM_EQ(expected, m, port);
+  }
+
+  if (expected->body_size) {
+    MESSAGE_CHECK_NUM_EQ(expected, m, body_size);
+  } else {
+    MESSAGE_CHECK_STR_EQ(expected, m, body);
+  }
+
+  assert(m->num_chunks == m->num_chunks_complete);
+  MESSAGE_CHECK_NUM_EQ(expected, m, num_chunks_complete);
+  for (i = 0; i < m->num_chunks && i < MAX_CHUNKS; i++) {
+    MESSAGE_CHECK_NUM_EQ(expected, m, chunk_lengths[i]);
+  }
+
+  MESSAGE_CHECK_NUM_EQ(expected, m, num_headers);
+
+  int r;
+  for (i = 0; i < m->num_headers; i++) {
+    r = check_str_eq(expected, "header field", expected->headers[i][0], m->headers[i][0]);
+    if (!r) return 0;
+    r = check_str_eq(expected, "header value", expected->headers[i][1], m->headers[i][1]);
+    if (!r) return 0;
+  }
+
+  MESSAGE_CHECK_STR_EQ(expected, m, upgrade);
+
+  return 1;
+}
+
+/* Given a sequence of varargs messages, return the number of them that the
+ * parser should successfully parse, taking into account that upgraded
+ * messages prevent all subsequent messages from being parsed.
+ */
+size_t
+count_parsed_messages(const size_t nmsgs, ...) {
+  size_t i;
+  va_list ap;
+
+  va_start(ap, nmsgs);
+
+  for (i = 0; i < nmsgs; i++) {
+    struct message *m = va_arg(ap, struct message *);
+
+    if (m->upgrade) {
+      va_end(ap);
+      return i + 1;
+    }
+  }
+
+  va_end(ap);
+  return nmsgs;
+}
+
+/* Given a sequence of bytes and the number of these that we were able to
+ * parse, verify that upgrade bodies are correct.
+ */
+void
+upgrade_message_fix(char *body, const size_t nread, const size_t nmsgs, ...) {
+  va_list ap;
+  size_t i;
+  size_t off = 0;
+  va_start(ap, nmsgs);
+
+  for (i = 0; i < nmsgs; i++) {
+    struct message *m = va_arg(ap, struct message *);
+
+    off += strlen(m->raw);
+
+    if (m->upgrade) {
+      off -= strlen(m->upgrade);
+
+      /* Check the portion of the response after its specified upgrade */
+      if (!check_str_eq(m, "upgrade", body + off, body + nread)) {
+        abort();
+      }
+
+      /* Fix up the response so that message_eq() will verify the beginning
+       * of the upgrade */
+      *(body + nread + strlen(m->upgrade)) = '\0';
+      messages[num_messages -1 ].upgrade = body + nread;
+
+      va_end(ap);
+      return;
+    }
+  }
+
+  va_end(ap);
+  printf("\n\n*** Error: expected a message with upgrade ***\n");
+
+  abort();
+}
+
+static void
+print_error (const char *raw, size_t error_location)
+{
+  fprintf(stderr, "\n*** %s ***\n\n",
+          http_errno_description(HTTP_PARSER_ERRNO(parser)));
+
+  int this_line = 0, char_len = 0;
+  size_t i, j, len = strlen(raw), error_location_line = 0;
+  for (i = 0; i < len; i++) {
+    if (i == error_location) this_line = 1;
+    switch (raw[i]) {
+      case '\r':
+        char_len = 2;
+        fprintf(stderr, "\\r");
+        break;
+
+      case '\n':
+        fprintf(stderr, "\\n\n");
+
+        if (this_line) goto print;
+
+        error_location_line = 0;
+        continue;
+
+      default:
+        char_len = 1;
+        fputc(raw[i], stderr);
+        break;
+    }
+    if (!this_line) error_location_line += char_len;
+  }
+
+  fprintf(stderr, "[eof]\n");
+
+ print:
+  for (j = 0; j < error_location_line; j++) {
+    fputc(' ', stderr);
+  }
+  fprintf(stderr, "^\n\nerror location: %u\n", (unsigned int)error_location);
+}
+
+void
+test_preserve_data (void)
+{
+  char my_data[] = "application-specific data";
+  http_parser parser;
+  parser.data = my_data;
+  http_parser_init(&parser, HTTP_REQUEST);
+  if (parser.data != my_data) {
+    printf("\n*** parser.data not preserved accross http_parser_init ***\n\n");
+    abort();
+  }
+}
+
+struct url_test {
+  const char *name;
+  const char *url;
+  int is_connect;
+  struct http_parser_url u;
+  int rv;
+};
+
+const struct url_test url_tests[] =
+{ {.name="proxy request"
+  ,.url="http://hostname/"
+  ,.is_connect=0
+  ,.u=
+    {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH)
+    ,.port=0
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{  7,  8 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{ 15,  1 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="proxy request with port"
+  ,.url="http://hostname:444/"
+  ,.is_connect=0
+  ,.u=
+    {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PORT) | (1 << UF_PATH)
+    ,.port=444
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{  7,  8 } /* UF_HOST */
+      ,{ 16,  3 } /* UF_PORT */
+      ,{ 19,  1 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="CONNECT request"
+  ,.url="hostname:443"
+  ,.is_connect=1
+  ,.u=
+    {.field_set=(1 << UF_HOST) | (1 << UF_PORT)
+    ,.port=443
+    ,.field_data=
+      {{  0,  0 } /* UF_SCHEMA */
+      ,{  0,  8 } /* UF_HOST */
+      ,{  9,  3 } /* UF_PORT */
+      ,{  0,  0 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="CONNECT request but not connect"
+  ,.url="hostname:443"
+  ,.is_connect=0
+  ,.rv=1
+  }
+
+, {.name="proxy ipv6 request"
+  ,.url="http://[1:2::3:4]/"
+  ,.is_connect=0
+  ,.u=
+    {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH)
+    ,.port=0
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{  8,  8 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{ 17,  1 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="proxy ipv6 request with port"
+  ,.url="http://[1:2::3:4]:67/"
+  ,.is_connect=0
+  ,.u=
+    {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PORT) | (1 << UF_PATH)
+    ,.port=67
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{  8,  8 } /* UF_HOST */
+      ,{ 18,  2 } /* UF_PORT */
+      ,{ 20,  1 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="CONNECT ipv6 address"
+  ,.url="[1:2::3:4]:443"
+  ,.is_connect=1
+  ,.u=
+    {.field_set=(1 << UF_HOST) | (1 << UF_PORT)
+    ,.port=443
+    ,.field_data=
+      {{  0,  0 } /* UF_SCHEMA */
+      ,{  1,  8 } /* UF_HOST */
+      ,{ 11,  3 } /* UF_PORT */
+      ,{  0,  0 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="ipv4 in ipv6 address"
+  ,.url="http://[2001:0000:0000:0000:0000:0000:1.9.1.1]/"
+  ,.is_connect=0
+  ,.u=
+    {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH)
+    ,.port=0
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{  8, 37 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{ 46,  1 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="extra ? in query string"
+  ,.url="http://a.tbcdn.cn/p/fp/2010c/??fp-header-min.css,fp-base-min.css,"
+  "fp-channel-min.css,fp-product-min.css,fp-mall-min.css,fp-category-min.css,"
+  "fp-sub-min.css,fp-gdp4p-min.css,fp-css3-min.css,fp-misc-min.css?t=20101022.css"
+  ,.is_connect=0
+  ,.u=
+    {.field_set=(1<<UF_SCHEMA) | (1<<UF_HOST) | (1<<UF_PATH) | (1<<UF_QUERY)
+    ,.port=0
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{  7, 10 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{ 17, 12 } /* UF_PATH */
+      ,{ 30,187 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="space URL encoded"
+  ,.url="/toto.html?toto=a%20b"
+  ,.is_connect=0
+  ,.u=
+    {.field_set= (1<<UF_PATH) | (1<<UF_QUERY)
+    ,.port=0
+    ,.field_data=
+      {{  0,  0 } /* UF_SCHEMA */
+      ,{  0,  0 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{  0, 10 } /* UF_PATH */
+      ,{ 11, 10 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+
+, {.name="URL fragment"
+  ,.url="/toto.html#titi"
+  ,.is_connect=0
+  ,.u=
+    {.field_set= (1<<UF_PATH) | (1<<UF_FRAGMENT)
+    ,.port=0
+    ,.field_data=
+      {{  0,  0 } /* UF_SCHEMA */
+      ,{  0,  0 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{  0, 10 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{ 11,  4 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="complex URL fragment"
+  ,.url="http://www.webmasterworld.com/r.cgi?f=21&d=8405&url="
+    "http://www.example.com/index.html?foo=bar&hello=world#midpage"
+  ,.is_connect=0
+  ,.u=
+    {.field_set= (1<<UF_SCHEMA) | (1<<UF_HOST) | (1<<UF_PATH) | (1<<UF_QUERY) |\
+      (1<<UF_FRAGMENT)
+    ,.port=0
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{  7, 22 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{ 29,  6 } /* UF_PATH */
+      ,{ 36, 69 } /* UF_QUERY */
+      ,{106,  7 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="complex URL from node js url parser doc"
+  ,.url="http://host.com:8080/p/a/t/h?query=string#hash"
+  ,.is_connect=0
+  ,.u=
+    {.field_set= (1<<UF_SCHEMA) | (1<<UF_HOST) | (1<<UF_PORT) | (1<<UF_PATH) |\
+      (1<<UF_QUERY) | (1<<UF_FRAGMENT)
+    ,.port=8080
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{  7,  8 } /* UF_HOST */
+      ,{ 16,  4 } /* UF_PORT */
+      ,{ 20,  8 } /* UF_PATH */
+      ,{ 29, 12 } /* UF_QUERY */
+      ,{ 42,  4 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="complex URL with basic auth from node js url parser doc"
+  ,.url="http://a:b@host.com:8080/p/a/t/h?query=string#hash"
+  ,.is_connect=0
+  ,.u=
+    {.field_set= (1<<UF_SCHEMA) | (1<<UF_HOST) | (1<<UF_PORT) | (1<<UF_PATH) |\
+      (1<<UF_QUERY) | (1<<UF_FRAGMENT) | (1<<UF_USERINFO)
+    ,.port=8080
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{ 11,  8 } /* UF_HOST */
+      ,{ 20,  4 } /* UF_PORT */
+      ,{ 24,  8 } /* UF_PATH */
+      ,{ 33, 12 } /* UF_QUERY */
+      ,{ 46,  4 } /* UF_FRAGMENT */
+      ,{  7,  3 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="double @"
+  ,.url="http://a:b@@hostname:443/"
+  ,.is_connect=0
+  ,.rv=1
+  }
+
+, {.name="proxy empty host"
+  ,.url="http://:443/"
+  ,.is_connect=0
+  ,.rv=1
+  }
+
+, {.name="proxy empty port"
+  ,.url="http://hostname:/"
+  ,.is_connect=0
+  ,.rv=1
+  }
+
+, {.name="CONNECT with basic auth"
+  ,.url="a:b@hostname:443"
+  ,.is_connect=1
+  ,.rv=1
+  }
+
+, {.name="CONNECT empty host"
+  ,.url=":443"
+  ,.is_connect=1
+  ,.rv=1
+  }
+
+, {.name="CONNECT empty port"
+  ,.url="hostname:"
+  ,.is_connect=1
+  ,.rv=1
+  }
+
+, {.name="CONNECT with extra bits"
+  ,.url="hostname:443/"
+  ,.is_connect=1
+  ,.rv=1
+  }
+
+, {.name="space in URL"
+  ,.url="/foo bar/"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="proxy basic auth with space url encoded"
+  ,.url="http://a%20:b@host.com/"
+  ,.is_connect=0
+  ,.u=
+    {.field_set= (1<<UF_SCHEMA) | (1<<UF_HOST) | (1<<UF_PATH) | (1<<UF_USERINFO)
+    ,.port=0
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{ 14,  8 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{ 22,  1 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  7,  6 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="carriage return in URL"
+  ,.url="/foo\rbar/"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="proxy double : in URL"
+  ,.url="http://hostname::443/"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="proxy basic auth with double :"
+  ,.url="http://a::b@host.com/"
+  ,.is_connect=0
+  ,.u=
+    {.field_set= (1<<UF_SCHEMA) | (1<<UF_HOST) | (1<<UF_PATH) | (1<<UF_USERINFO)
+    ,.port=0
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{ 12,  8 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{ 20,  1 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  7,  4 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="line feed in URL"
+  ,.url="/foo\nbar/"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="proxy empty basic auth"
+  ,.url="http://@hostname/fo"
+  ,.u=
+    {.field_set= (1<<UF_SCHEMA) | (1<<UF_HOST) | (1<<UF_PATH)
+    ,.port=0
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{  8,  8 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{ 16,  3 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+, {.name="proxy line feed in hostname"
+  ,.url="http://host\name/fo"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="proxy % in hostname"
+  ,.url="http://host%name/fo"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="proxy ; in hostname"
+  ,.url="http://host;ame/fo"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="proxy basic auth with unreservedchars"
+  ,.url="http://a!;-_!=+$@host.com/"
+  ,.is_connect=0
+  ,.u=
+    {.field_set= (1<<UF_SCHEMA) | (1<<UF_HOST) | (1<<UF_PATH) | (1<<UF_USERINFO)
+    ,.port=0
+    ,.field_data=
+      {{  0,  4 } /* UF_SCHEMA */
+      ,{ 17,  8 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{ 25,  1 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  7,  9 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="proxy only empty basic auth"
+  ,.url="http://@/fo"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="proxy only basic auth"
+  ,.url="http://toto@/fo"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="proxy emtpy hostname"
+  ,.url="http:///fo"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="proxy = in URL"
+  ,.url="http://host=ame/fo"
+  ,.rv=1 /* s_dead */
+  }
+
+#if HTTP_PARSER_STRICT
+
+, {.name="tab in URL"
+  ,.url="/foo\tbar/"
+  ,.rv=1 /* s_dead */
+  }
+
+, {.name="form feed in URL"
+  ,.url="/foo\fbar/"
+  ,.rv=1 /* s_dead */
+  }
+
+#else /* !HTTP_PARSER_STRICT */
+
+, {.name="tab in URL"
+  ,.url="/foo\tbar/"
+  ,.u=
+    {.field_set=(1 << UF_PATH)
+    ,.field_data=
+      {{  0,  0 } /* UF_SCHEMA */
+      ,{  0,  0 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{  0,  9 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+
+, {.name="form feed in URL"
+  ,.url="/foo\fbar/"
+  ,.u=
+    {.field_set=(1 << UF_PATH)
+    ,.field_data=
+      {{  0,  0 } /* UF_SCHEMA */
+      ,{  0,  0 } /* UF_HOST */
+      ,{  0,  0 } /* UF_PORT */
+      ,{  0,  9 } /* UF_PATH */
+      ,{  0,  0 } /* UF_QUERY */
+      ,{  0,  0 } /* UF_FRAGMENT */
+      ,{  0,  0 } /* UF_USERINFO */
+      }
+    }
+  ,.rv=0
+  }
+#endif
+};
+
+void
+dump_url (const char *url, const struct http_parser_url *u)
+{
+  unsigned int i;
+
+  printf("\tfield_set: 0x%x, port: %u\n", u->field_set, u->port);
+  for (i = 0; i < UF_MAX; i++) {
+    if ((u->field_set & (1 << i)) == 0) {
+      printf("\tfield_data[%u]: unset\n", i);
+      continue;
+    }
+
+    printf("\tfield_data[%u]: off: %u len: %u part: \"%.*s\n\"",
+           i,
+           u->field_data[i].off,
+           u->field_data[i].len,
+           u->field_data[i].len,
+           url + u->field_data[i].off);
+  }
+}
+
+void
+test_parse_url (void)
+{
+  struct http_parser_url u;
+  const struct url_test *test;
+  unsigned int i;
+  int rv;
+
+  for (i = 0; i < (sizeof(url_tests) / sizeof(url_tests[0])); i++) {
+    test = &url_tests[i];
+    memset(&u, 0, sizeof(u));
+
+    rv = http_parser_parse_url(test->url,
+                               strlen(test->url),
+                               test->is_connect,
+                               &u);
+
+    if (test->rv == 0) {
+      if (rv != 0) {
+        printf("\n*** http_parser_parse_url(\"%s\") \"%s\" test failed, "
+               "unexpected rv %d ***\n\n", test->url, test->name, rv);
+        abort();
+      }
+
+      if (memcmp(&u, &test->u, sizeof(u)) != 0) {
+        printf("\n*** http_parser_parse_url(\"%s\") \"%s\" failed ***\n",
+               test->url, test->name);
+
+        printf("target http_parser_url:\n");
+        dump_url(test->url, &test->u);
+        printf("result http_parser_url:\n");
+        dump_url(test->url, &u);
+
+        abort();
+      }
+    } else {
+      /* test->rv != 0 */
+      if (rv == 0) {
+        printf("\n*** http_parser_parse_url(\"%s\") \"%s\" test failed, "
+               "unexpected rv %d ***\n\n", test->url, test->name, rv);
+        abort();
+      }
+    }
+  }
+}
+
+void
+test_method_str (void)
+{
+  assert(0 == strcmp("GET", http_method_str(HTTP_GET)));
+  assert(0 == strcmp("<unknown>", http_method_str(1337)));
+}
+
+void
+test_message (const struct message *message)
+{
+  size_t raw_len = strlen(message->raw);
+  size_t msg1len;
+  for (msg1len = 0; msg1len < raw_len; msg1len++) {
+    parser_init(message->type);
+
+    size_t read;
+    const char *msg1 = message->raw;
+    const char *msg2 = msg1 + msg1len;
+    size_t msg2len = raw_len - msg1len;
+
+    if (msg1len) {
+      read = parse(msg1, msg1len);
+
+      if (message->upgrade && parser->upgrade && num_messages > 0) {
+        messages[num_messages - 1].upgrade = msg1 + read;
+        goto test;
+      }
+
+      if (read != msg1len) {
+        print_error(msg1, read);
+        abort();
+      }
+    }
+
+
+    read = parse(msg2, msg2len);
+
+    if (message->upgrade && parser->upgrade) {
+      messages[num_messages - 1].upgrade = msg2 + read;
+      goto test;
+    }
+
+    if (read != msg2len) {
+      print_error(msg2, read);
+      abort();
+    }
+
+    read = parse(NULL, 0);
+
+    if (read != 0) {
+      print_error(message->raw, read);
+      abort();
+    }
+
+  test:
+
+    if (num_messages != 1) {
+      printf("\n*** num_messages != 1 after testing '%s' ***\n\n", message->name);
+      abort();
+    }
+
+    if(!message_eq(0, message)) abort();
+
+    parser_free();
+  }
+}
+
+void
+test_message_count_body (const struct message *message)
+{
+  parser_init(message->type);
+
+  size_t read;
+  size_t l = strlen(message->raw);
+  size_t i, toread;
+  size_t chunk = 4024;
+
+  for (i = 0; i < l; i+= chunk) {
+    toread = MIN(l-i, chunk);
+    read = parse_count_body(message->raw + i, toread);
+    if (read != toread) {
+      print_error(message->raw, read);
+      abort();
+    }
+  }
+
+
+  read = parse_count_body(NULL, 0);
+  if (read != 0) {
+    print_error(message->raw, read);
+    abort();
+  }
+
+  if (num_messages != 1) {
+    printf("\n*** num_messages != 1 after testing '%s' ***\n\n", message->name);
+    abort();
+  }
+
+  if(!message_eq(0, message)) abort();
+
+  parser_free();
+}
+
+void
+test_simple (const char *buf, enum http_errno err_expected)
+{
+  parser_init(HTTP_REQUEST);
+
+  enum http_errno err;
+
+  parse(buf, strlen(buf));
+  err = HTTP_PARSER_ERRNO(parser);
+  parse(NULL, 0);
+
+  parser_free();
+
+  /* In strict mode, allow us to pass with an unexpected HPE_STRICT as
+   * long as the caller isn't expecting success.
+   */
+#if HTTP_PARSER_STRICT
+  if (err_expected != err && err_expected != HPE_OK && err != HPE_STRICT) {
+#else
+  if (err_expected != err) {
+#endif
+    fprintf(stderr, "\n*** test_simple expected %s, but saw %s ***\n\n%s\n",
+        http_errno_name(err_expected), http_errno_name(err), buf);
+    abort();
+  }
+}
+
+void
+test_header_overflow_error (int req)
+{
+  http_parser parser;
+  http_parser_init(&parser, req ? HTTP_REQUEST : HTTP_RESPONSE);
+  size_t parsed;
+  const char *buf;
+  buf = req ? "GET / HTTP/1.1\r\n" : "HTTP/1.0 200 OK\r\n";
+  parsed = http_parser_execute(&parser, &settings_null, buf, strlen(buf));
+  assert(parsed == strlen(buf));
+
+  buf = "header-key: header-value\r\n";
+  size_t buflen = strlen(buf);
+
+  int i;
+  for (i = 0; i < 10000; i++) {
+    parsed = http_parser_execute(&parser, &settings_null, buf, buflen);
+    if (parsed != buflen) {
+      //fprintf(stderr, "error found on iter %d\n", i);
+      assert(HTTP_PARSER_ERRNO(&parser) == HPE_HEADER_OVERFLOW);
+      return;
+    }
+  }
+
+  fprintf(stderr, "\n*** Error expected but none in header overflow test ***\n");
+  abort();
+}
+
+
+void
+test_header_nread_value ()
+{
+  http_parser parser;
+  http_parser_init(&parser, HTTP_REQUEST);
+  size_t parsed;
+  const char *buf;
+  buf = "GET / HTTP/1.1\r\nheader: value\nhdr: value\r\n";
+  parsed = http_parser_execute(&parser, &settings_null, buf, strlen(buf));
+  assert(parsed == strlen(buf));
+
+  assert(parser.nread == strlen(buf));
+}
+
+
+static void
+test_content_length_overflow (const char *buf, size_t buflen, int expect_ok)
+{
+  http_parser parser;
+  http_parser_init(&parser, HTTP_RESPONSE);
+  http_parser_execute(&parser, &settings_null, buf, buflen);
+
+  if (expect_ok)
+    assert(HTTP_PARSER_ERRNO(&parser) == HPE_OK);
+  else
+    assert(HTTP_PARSER_ERRNO(&parser) == HPE_INVALID_CONTENT_LENGTH);
+}
+
+void
+test_header_content_length_overflow_error (void)
+{
+#define X(size)                                                               \
+  "HTTP/1.1 200 OK\r\n"                                                       \
+  "Content-Length: " #size "\r\n"                                             \
+  "\r\n"
+  const char a[] = X(1844674407370955160);  /* 2^64 / 10 - 1 */
+  const char b[] = X(18446744073709551615); /* 2^64-1 */
+  const char c[] = X(18446744073709551616); /* 2^64   */
+#undef X
+  test_content_length_overflow(a, sizeof(a) - 1, 1); /* expect ok      */
+  test_content_length_overflow(b, sizeof(b) - 1, 0); /* expect failure */
+  test_content_length_overflow(c, sizeof(c) - 1, 0); /* expect failure */
+}
+
+void
+test_chunk_content_length_overflow_error (void)
+{
+#define X(size)                                                               \
+    "HTTP/1.1 200 OK\r\n"                                                     \
+    "Transfer-Encoding: chunked\r\n"                                          \
+    "\r\n"                                                                    \
+    #size "\r\n"                                                              \
+    "..."
+  const char a[] = X(FFFFFFFFFFFFFFE);   /* 2^64 / 16 - 1 */
+  const char b[] = X(FFFFFFFFFFFFFFFF);  /* 2^64-1 */
+  const char c[] = X(10000000000000000); /* 2^64   */
+#undef X
+  test_content_length_overflow(a, sizeof(a) - 1, 1); /* expect ok      */
+  test_content_length_overflow(b, sizeof(b) - 1, 0); /* expect failure */
+  test_content_length_overflow(c, sizeof(c) - 1, 0); /* expect failure */
+}
+
+void
+test_no_overflow_long_body (int req, size_t length)
+{
+  http_parser parser;
+  http_parser_init(&parser, req ? HTTP_REQUEST : HTTP_RESPONSE);
+  size_t parsed;
+  size_t i;
+  char buf1[3000];
+  size_t buf1len = sprintf(buf1, "%s\r\nConnection: Keep-Alive\r\nContent-Length: %lu\r\n\r\n",
+      req ? "POST / HTTP/1.0" : "HTTP/1.0 200 OK", (unsigned long)length);
+  parsed = http_parser_execute(&parser, &settings_null, buf1, buf1len);
+  if (parsed != buf1len)
+    goto err;
+
+  for (i = 0; i < length; i++) {
+    char foo = 'a';
+    parsed = http_parser_execute(&parser, &settings_null, &foo, 1);
+    if (parsed != 1)
+      goto err;
+  }
+
+  parsed = http_parser_execute(&parser, &settings_null, buf1, buf1len);
+  if (parsed != buf1len) goto err;
+  return;
+
+ err:
+  fprintf(stderr,
+          "\n*** error in test_no_overflow_long_body %s of length %lu ***\n",
+          req ? "REQUEST" : "RESPONSE",
+          (unsigned long)length);
+  abort();
+}
+
+void
+test_multiple3 (const struct message *r1, const struct message *r2, const struct message *r3)
+{
+  int message_count = count_parsed_messages(3, r1, r2, r3);
+
+  char total[ strlen(r1->raw)
+            + strlen(r2->raw)
+            + strlen(r3->raw)
+            + 1
+            ];
+  total[0] = '\0';
+
+  strcat(total, r1->raw);
+  strcat(total, r2->raw);
+  strcat(total, r3->raw);
+
+  parser_init(r1->type);
+
+  size_t read;
+
+  read = parse(total, strlen(total));
+
+  if (parser->upgrade) {
+    upgrade_message_fix(total, read, 3, r1, r2, r3);
+    goto test;
+  }
+
+  if (read != strlen(total)) {
+    print_error(total, read);
+    abort();
+  }
+
+  read = parse(NULL, 0);
+
+  if (read != 0) {
+    print_error(total, read);
+    abort();
+  }
+
+test:
+
+  if (message_count != num_messages) {
+    fprintf(stderr, "\n\n*** Parser didn't see 3 messages only %d *** \n", num_messages);
+    abort();
+  }
+
+  if (!message_eq(0, r1)) abort();
+  if (message_count > 1 && !message_eq(1, r2)) abort();
+  if (message_count > 2 && !message_eq(2, r3)) abort();
+
+  parser_free();
+}
+
+/* SCAN through every possible breaking to make sure the
+ * parser can handle getting the content in any chunks that
+ * might come from the socket
+ */
+void
+test_scan (const struct message *r1, const struct message *r2, const struct message *r3)
+{
+  char total[80*1024] = "\0";
+  char buf1[80*1024] = "\0";
+  char buf2[80*1024] = "\0";
+  char buf3[80*1024] = "\0";
+
+  strcat(total, r1->raw);
+  strcat(total, r2->raw);
+  strcat(total, r3->raw);
+
+  size_t read;
+
+  int total_len = strlen(total);
+
+  int total_ops = 2 * (total_len - 1) * (total_len - 2) / 2;
+  int ops = 0 ;
+
+  size_t buf1_len, buf2_len, buf3_len;
+  int message_count = count_parsed_messages(3, r1, r2, r3);
+
+  int i,j,type_both;
+  for (type_both = 0; type_both < 2; type_both ++ ) {
+    for (j = 2; j < total_len; j ++ ) {
+      for (i = 1; i < j; i ++ ) {
+
+        if (ops % 1000 == 0)  {
+          printf("\b\b\b\b%3.0f%%", 100 * (float)ops /(float)total_ops);
+          fflush(stdout);
+        }
+        ops += 1;
+
+        parser_init(type_both ? HTTP_BOTH : r1->type);
+
+        buf1_len = i;
+        strlncpy(buf1, sizeof(buf1), total, buf1_len);
+        buf1[buf1_len] = 0;
+
+        buf2_len = j - i;
+        strlncpy(buf2, sizeof(buf1), total+i, buf2_len);
+        buf2[buf2_len] = 0;
+
+        buf3_len = total_len - j;
+        strlncpy(buf3, sizeof(buf1), total+j, buf3_len);
+        buf3[buf3_len] = 0;
+
+        read = parse(buf1, buf1_len);
+
+        if (parser->upgrade) goto test;
+
+        if (read != buf1_len) {
+          print_error(buf1, read);
+          goto error;
+        }
+
+        read += parse(buf2, buf2_len);
+
+        if (parser->upgrade) goto test;
+
+        if (read != buf1_len + buf2_len) {
+          print_error(buf2, read);
+          goto error;
+        }
+
+        read += parse(buf3, buf3_len);
+
+        if (parser->upgrade) goto test;
+
+        if (read != buf1_len + buf2_len + buf3_len) {
+          print_error(buf3, read);
+          goto error;
+        }
+
+        parse(NULL, 0);
+
+test:
+        if (parser->upgrade) {
+          upgrade_message_fix(total, read, 3, r1, r2, r3);
+        }
+
+        if (message_count != num_messages) {
+          fprintf(stderr, "\n\nParser didn't see %d messages only %d\n",
+            message_count, num_messages);
+          goto error;
+        }
+
+        if (!message_eq(0, r1)) {
+          fprintf(stderr, "\n\nError matching messages[0] in test_scan.\n");
+          goto error;
+        }
+
+        if (message_count > 1 && !message_eq(1, r2)) {
+          fprintf(stderr, "\n\nError matching messages[1] in test_scan.\n");
+          goto error;
+        }
+
+        if (message_count > 2 && !message_eq(2, r3)) {
+          fprintf(stderr, "\n\nError matching messages[2] in test_scan.\n");
+          goto error;
+        }
+
+        parser_free();
+      }
+    }
+  }
+  puts("\b\b\b\b100%");
+  return;
+
+ error:
+  fprintf(stderr, "i=%d  j=%d\n", i, j);
+  fprintf(stderr, "buf1 (%u) %s\n\n", (unsigned int)buf1_len, buf1);
+  fprintf(stderr, "buf2 (%u) %s\n\n", (unsigned int)buf2_len , buf2);
+  fprintf(stderr, "buf3 (%u) %s\n", (unsigned int)buf3_len, buf3);
+  abort();
+}
+
+// user required to free the result
+// string terminated by \0
+char *
+create_large_chunked_message (int body_size_in_kb, const char* headers)
+{
+  int i;
+  size_t wrote = 0;
+  size_t headers_len = strlen(headers);
+  size_t bufsize = headers_len + (5+1024+2)*body_size_in_kb + 6;
+  char * buf = malloc(bufsize);
+
+  memcpy(buf, headers, headers_len);
+  wrote += headers_len;
+
+  for (i = 0; i < body_size_in_kb; i++) {
+    // write 1kb chunk into the body.
+    memcpy(buf + wrote, "400\r\n", 5);
+    wrote += 5;
+    memset(buf + wrote, 'C', 1024);
+    wrote += 1024;
+    strcpy(buf + wrote, "\r\n");
+    wrote += 2;
+  }
+
+  memcpy(buf + wrote, "0\r\n\r\n", 6);
+  wrote += 6;
+  assert(wrote == bufsize);
+
+  return buf;
+}
+
+/* Verify that we can pause parsing at any of the bytes in the
+ * message and still get the result that we're expecting. */
+void
+test_message_pause (const struct message *msg)
+{
+  char *buf = (char*) msg->raw;
+  size_t buflen = strlen(msg->raw);
+  size_t nread;
+
+  parser_init(msg->type);
+
+  do {
+    nread = parse_pause(buf, buflen);
+
+    // We can only set the upgrade buffer once we've gotten our message
+    // completion callback.
+    if (messages[0].message_complete_cb_called &&
+        msg->upgrade &&
+        parser->upgrade) {
+      messages[0].upgrade = buf + nread;
+      goto test;
+    }
+
+    if (nread < buflen) {
+
+      // Not much do to if we failed a strict-mode check
+      if (HTTP_PARSER_ERRNO(parser) == HPE_STRICT) {
+        parser_free();
+        return;
+      }
+
+      assert (HTTP_PARSER_ERRNO(parser) == HPE_PAUSED);
+    }
+
+    buf += nread;
+    buflen -= nread;
+    http_parser_pause(parser, 0);
+  } while (buflen > 0);
+
+  nread = parse_pause(NULL, 0);
+  assert (nread == 0);
+
+test:
+  if (num_messages != 1) {
+    printf("\n*** num_messages != 1 after testing '%s' ***\n\n", msg->name);
+    abort();
+  }
+
+  if(!message_eq(0, msg)) abort();
+
+  parser_free();
+}
+
+int
+main (void)
+{
+  parser = NULL;
+  int i, j, k;
+  int request_count;
+  int response_count;
+  unsigned long version;
+  unsigned major;
+  unsigned minor;
+  unsigned patch;
+
+  version = http_parser_version();
+  major = (version >> 16) & 255;
+  minor = (version >> 8) & 255;
+  patch = version & 255;
+  printf("http_parser v%u.%u.%u (0x%06lx)\n", major, minor, patch, version);
+
+  printf("sizeof(http_parser) = %u\n", (unsigned int)sizeof(http_parser));
+
+  for (request_count = 0; requests[request_count].name; request_count++);
+  for (response_count = 0; responses[response_count].name; response_count++);
+
+  //// API
+  test_preserve_data();
+  test_parse_url();
+  test_method_str();
+
+  //// NREAD
+  test_header_nread_value();
+
+  //// OVERFLOW CONDITIONS
+
+  test_header_overflow_error(HTTP_REQUEST);
+  test_no_overflow_long_body(HTTP_REQUEST, 1000);
+  test_no_overflow_long_body(HTTP_REQUEST, 100000);
+
+  test_header_overflow_error(HTTP_RESPONSE);
+  test_no_overflow_long_body(HTTP_RESPONSE, 1000);
+  test_no_overflow_long_body(HTTP_RESPONSE, 100000);
+
+  test_header_content_length_overflow_error();
+  test_chunk_content_length_overflow_error();
+
+  //// RESPONSES
+
+  for (i = 0; i < response_count; i++) {
+    test_message(&responses[i]);
+  }
+
+  for (i = 0; i < response_count; i++) {
+    test_message_pause(&responses[i]);
+  }
+
+  for (i = 0; i < response_count; i++) {
+    if (!responses[i].should_keep_alive) continue;
+    for (j = 0; j < response_count; j++) {
+      if (!responses[j].should_keep_alive) continue;
+      for (k = 0; k < response_count; k++) {
+        test_multiple3(&responses[i], &responses[j], &responses[k]);
+      }
+    }
+  }
+
+  test_message_count_body(&responses[NO_HEADERS_NO_BODY_404]);
+  test_message_count_body(&responses[TRAILING_SPACE_ON_CHUNKED_BODY]);
+
+  // test very large chunked response
+  {
+    char * msg = create_large_chunked_message(31337,
+      "HTTP/1.0 200 OK\r\n"
+      "Transfer-Encoding: chunked\r\n"
+      "Content-Type: text/plain\r\n"
+      "\r\n");
+    struct message large_chunked =
+      {.name= "large chunked"
+      ,.type= HTTP_RESPONSE
+      ,.raw= msg
+      ,.should_keep_alive= FALSE
+      ,.message_complete_on_eof= FALSE
+      ,.http_major= 1
+      ,.http_minor= 0
+      ,.status_code= 200
+      ,.response_status= "OK"
+      ,.num_headers= 2
+      ,.headers=
+        { { "Transfer-Encoding", "chunked" }
+        , { "Content-Type", "text/plain" }
+        }
+      ,.body_size= 31337*1024
+      ,.num_chunks_complete= 31338
+      };
+    for (i = 0; i < MAX_CHUNKS; i++) {
+      large_chunked.chunk_lengths[i] = 1024;
+    }
+    test_message_count_body(&large_chunked);
+    free(msg);
+  }
+
+
+
+  printf("response scan 1/2      ");
+  test_scan( &responses[TRAILING_SPACE_ON_CHUNKED_BODY]
+           , &responses[NO_BODY_HTTP10_KA_204]
+           , &responses[NO_REASON_PHRASE]
+           );
+
+  printf("response scan 2/2      ");
+  test_scan( &responses[BONJOUR_MADAME_FR]
+           , &responses[UNDERSTORE_HEADER_KEY]
+           , &responses[NO_CARRIAGE_RET]
+           );
+
+  puts("responses okay");
+
+
+  /// REQUESTS
+
+  test_simple("GET / HTP/1.1\r\n\r\n", HPE_INVALID_VERSION);
+
+  // Well-formed but incomplete
+  test_simple("GET / HTTP/1.1\r\n"
+              "Content-Type: text/plain\r\n"
+              "Content-Length: 6\r\n"
+              "\r\n"
+              "fooba",
+              HPE_OK);
+
+  static const char *all_methods[] = {
+    "DELETE",
+    "GET",
+    "HEAD",
+    "POST",
+    "PUT",
+    //"CONNECT", //CONNECT can't be tested like other methods, it's a tunnel
+    "OPTIONS",
+    "TRACE",
+    "COPY",
+    "LOCK",
+    "MKCOL",
+    "MOVE",
+    "PROPFIND",
+    "PROPPATCH",
+    "UNLOCK",
+    "REPORT",
+    "MKACTIVITY",
+    "CHECKOUT",
+    "MERGE",
+    "M-SEARCH",
+    "NOTIFY",
+    "SUBSCRIBE",
+    "UNSUBSCRIBE",
+    "PATCH",
+    0 };
+  const char **this_method;
+  for (this_method = all_methods; *this_method; this_method++) {
+    char buf[200];
+    sprintf(buf, "%s / HTTP/1.1\r\n\r\n", *this_method);
+    test_simple(buf, HPE_OK);
+  }
+
+  static const char *bad_methods[] = {
+      "ASDF",
+      "C******",
+      "COLA",
+      "GEM",
+      "GETA",
+      "M****",
+      "MKCOLA",
+      "PROPPATCHA",
+      "PUN",
+      "PX",
+      "SA",
+      "hello world",
+      0 };
+  for (this_method = bad_methods; *this_method; this_method++) {
+    char buf[200];
+    sprintf(buf, "%s / HTTP/1.1\r\n\r\n", *this_method);
+    test_simple(buf, HPE_INVALID_METHOD);
+  }
+
+  // illegal header field name line folding
+  test_simple("GET / HTTP/1.1\r\n"
+              "name\r\n"
+              " : value\r\n"
+              "\r\n",
+              HPE_INVALID_HEADER_TOKEN);
+
+  const char *dumbfuck2 =
+    "GET / HTTP/1.1\r\n"
+    "X-SSL-Bullshit:   -----BEGIN CERTIFICATE-----\r\n"
+    "\tMIIFbTCCBFWgAwIBAgICH4cwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UEBhMCVUsx\r\n"
+    "\tETAPBgNVBAoTCGVTY2llbmNlMRIwEAYDVQQLEwlBdXRob3JpdHkxCzAJBgNVBAMT\r\n"
+    "\tAkNBMS0wKwYJKoZIhvcNAQkBFh5jYS1vcGVyYXRvckBncmlkLXN1cHBvcnQuYWMu\r\n"
+    "\tdWswHhcNMDYwNzI3MTQxMzI4WhcNMDcwNzI3MTQxMzI4WjBbMQswCQYDVQQGEwJV\r\n"
+    "\tSzERMA8GA1UEChMIZVNjaWVuY2UxEzARBgNVBAsTCk1hbmNoZXN0ZXIxCzAJBgNV\r\n"
+    "\tBAcTmrsogriqMWLAk1DMRcwFQYDVQQDEw5taWNoYWVsIHBhcmQYJKoZIhvcNAQEB\r\n"
+    "\tBQADggEPADCCAQoCggEBANPEQBgl1IaKdSS1TbhF3hEXSl72G9J+WC/1R64fAcEF\r\n"
+    "\tW51rEyFYiIeZGx/BVzwXbeBoNUK41OK65sxGuflMo5gLflbwJtHBRIEKAfVVp3YR\r\n"
+    "\tgW7cMA/s/XKgL1GEC7rQw8lIZT8RApukCGqOVHSi/F1SiFlPDxuDfmdiNzL31+sL\r\n"
+    "\t0iwHDdNkGjy5pyBSB8Y79dsSJtCW/iaLB0/n8Sj7HgvvZJ7x0fr+RQjYOUUfrePP\r\n"
+    "\tu2MSpFyf+9BbC/aXgaZuiCvSR+8Snv3xApQY+fULK/xY8h8Ua51iXoQ5jrgu2SqR\r\n"
+    "\twgA7BUi3G8LFzMBl8FRCDYGUDy7M6QaHXx1ZWIPWNKsCAwEAAaOCAiQwggIgMAwG\r\n"
+    "\tA1UdEwEB/wQCMAAwEQYJYIZIAYb4QgHTTPAQDAgWgMA4GA1UdDwEB/wQEAwID6DAs\r\n"
+    "\tBglghkgBhvhCAQ0EHxYdVUsgZS1TY2llbmNlIFVzZXIgQ2VydGlmaWNhdGUwHQYD\r\n"
+    "\tVR0OBBYEFDTt/sf9PeMaZDHkUIldrDYMNTBZMIGaBgNVHSMEgZIwgY+AFAI4qxGj\r\n"
+    "\tloCLDdMVKwiljjDastqooXSkcjBwMQswCQYDVQQGEwJVSzERMA8GA1UEChMIZVNj\r\n"
+    "\taWVuY2UxEjAQBgNVBAsTCUF1dGhvcml0eTELMAkGA1UEAxMCQ0ExLTArBgkqhkiG\r\n"
+    "\t9w0BCQEWHmNhLW9wZXJhdG9yQGdyaWQtc3VwcG9ydC5hYy51a4IBADApBgNVHRIE\r\n"
+    "\tIjAggR5jYS1vcGVyYXRvckBncmlkLXN1cHBvcnQuYWMudWswGQYDVR0gBBIwEDAO\r\n"
+    "\tBgwrBgEEAdkvAQEBAQYwPQYJYIZIAYb4QgEEBDAWLmh0dHA6Ly9jYS5ncmlkLXN1\r\n"
+    "\tcHBvcnQuYWMudmT4sopwqlBWsvcHViL2NybC9jYWNybC5jcmwwPQYJYIZIAYb4QgEDBDAWLmh0\r\n"
+    "\tdHA6Ly9jYS5ncmlkLXN1cHBvcnQuYWMudWsvcHViL2NybC9jYWNybC5jcmwwPwYD\r\n"
+    "\tVR0fBDgwNjA0oDKgMIYuaHR0cDovL2NhLmdyaWQt5hYy51ay9wdWIv\r\n"
+    "\tY3JsL2NhY3JsLmNybDANBgkqhkiG9w0BAQUFAAOCAQEAS/U4iiooBENGW/Hwmmd3\r\n"
+    "\tXCy6Zrt08YjKCzGNjorT98g8uGsqYjSxv/hmi0qlnlHs+k/3Iobc3LjS5AMYr5L8\r\n"
+    "\tUO7OSkgFFlLHQyC9JzPfmLCAugvzEbyv4Olnsr8hbxF1MbKZoQxUZtMVu29wjfXk\r\n"
+    "\thTeApBv7eaKCWpSp7MCbvgzm74izKhu3vlDk9w6qVrxePfGgpKPqfHiOoGhFnbTK\r\n"
+    "\twTC6o2xq5y0qZ03JonF7OJspEd3I5zKY3E+ov7/ZhW6DqT8UFvsAdjvQbXyhV8Eu\r\n"
+    "\tYhixw1aKEPzNjNowuIseVogKOLXxWI5vAi5HgXdS0/ES5gDGsABo4fqovUKlgop3\r\n"
+    "\tRA==\r\n"
+    "\t-----END CERTIFICATE-----\r\n"
+    "\r\n";
+  test_simple(dumbfuck2, HPE_OK);
+
+  const char *corrupted_connection =
+    "GET / HTTP/1.1\r\n"
+    "Host: www.example.com\r\n"
+    "Connection\r\033\065\325eep-Alive\r\n"
+    "Accept-Encoding: gzip\r\n"
+    "\r\n";
+  test_simple(corrupted_connection, HPE_INVALID_HEADER_TOKEN);
+
+  const char *corrupted_header_name =
+    "GET / HTTP/1.1\r\n"
+    "Host: www.example.com\r\n"
+    "X-Some-Header\r\033\065\325eep-Alive\r\n"
+    "Accept-Encoding: gzip\r\n"
+    "\r\n";
+  test_simple(corrupted_header_name, HPE_INVALID_HEADER_TOKEN);
+
+#if 0
+  // NOTE(Wed Nov 18 11:57:27 CET 2009) this seems okay. we just read body
+  // until EOF.
+  //
+  // no content-length
+  // error if there is a body without content length
+  const char *bad_get_no_headers_no_body = "GET /bad_get_no_headers_no_body/world HTTP/1.1\r\n"
+                                           "Accept: */*\r\n"
+                                           "\r\n"
+                                           "HELLO";
+  test_simple(bad_get_no_headers_no_body, 0);
+#endif
+  /* TODO sending junk and large headers gets rejected */
+
+
+  /* check to make sure our predefined requests are okay */
+  for (i = 0; requests[i].name; i++) {
+    test_message(&requests[i]);
+  }
+
+  for (i = 0; i < request_count; i++) {
+    test_message_pause(&requests[i]);
+  }
+
+  for (i = 0; i < request_count; i++) {
+    if (!requests[i].should_keep_alive) continue;
+    for (j = 0; j < request_count; j++) {
+      if (!requests[j].should_keep_alive) continue;
+      for (k = 0; k < request_count; k++) {
+        test_multiple3(&requests[i], &requests[j], &requests[k]);
+      }
+    }
+  }
+
+  printf("request scan 1/4      ");
+  test_scan( &requests[GET_NO_HEADERS_NO_BODY]
+           , &requests[GET_ONE_HEADER_NO_BODY]
+           , &requests[GET_NO_HEADERS_NO_BODY]
+           );
+
+  printf("request scan 2/4      ");
+  test_scan( &requests[POST_CHUNKED_ALL_YOUR_BASE]
+           , &requests[POST_IDENTITY_BODY_WORLD]
+           , &requests[GET_FUNKY_CONTENT_LENGTH]
+           );
+
+  printf("request scan 3/4      ");
+  test_scan( &requests[TWO_CHUNKS_MULT_ZERO_END]
+           , &requests[CHUNKED_W_TRAILING_HEADERS]
+           , &requests[CHUNKED_W_BULLSHIT_AFTER_LENGTH]
+           );
+
+  printf("request scan 4/4      ");
+  test_scan( &requests[QUERY_URL_WITH_QUESTION_MARK_GET]
+           , &requests[PREFIX_NEWLINE_GET ]
+           , &requests[CONNECT_REQUEST]
+           );
+
+  puts("requests okay");
+
+  return 0;
+}
diff --git a/deps/jerry/.gitignore b/deps/jerry/.gitignore
new file mode 100644 (file)
index 0000000..6517d25
--- /dev/null
@@ -0,0 +1,45 @@
+# Produced files
+.mbedignore
+build/*
+
+# IDE related files
+nbproject
+*.sublime-project
+*.sublime-workspace
+.idea
+
+# Random Trash
+*.swp
+*.swo
+*~
+core
+vgcore.*
+*.orig
+*.directory
+*.patch
+.tags*
+cscope.*
+__pycache__
+*.pyc
+.DS_Store
+
+# ctags and ID database
+tags
+ID
+
+# targets
+jerry-targetjs.h
+targets/mbed/libjerry
+targets/mbed/build
+targets/mbed/yotta_modules
+targets/mbed/yotta_targets
+.output
+targets/esp8266/output.map
+targets/esp8266/libs
+
+# Generated documentation
+docs/doxygen
+
+# Tests
+tests/test262/
+tests/unit-doc/*.c
diff --git a/deps/jerry/.travis.yml b/deps/jerry/.travis.yml
new file mode 100644 (file)
index 0000000..6a1cbc9
--- /dev/null
@@ -0,0 +1,88 @@
+language: c
+
+os: linux
+dist: trusty
+sudo: required
+
+env:
+  matrix:
+    - OPTS="--check-signed-off-travis --check-cppcheck --check-doxygen --check-vera --check-license --check-magic-strings"
+    - OPTS="--jerry-debugger"
+    - OPTS="--jerry-tests --jerry-test-suite"
+    - OPTS="--jerry-tests --jerry-test-suite --toolchain=cmake/toolchain_linux_armv7l.cmake" TIMEOUT=300 INSTALL_QEMU_ARM=yes
+    - OPTS="--buildoption-test"
+    - OPTS="--jerry-tests --jerry-test-suite --buildoptions=--jerry-libc=off,--compile-flag=-m32,--cpointer-32bit=on"
+    - OPTS="--unittests"
+    - OPTS="--test262"
+    - OPTS="--check-pylint"
+  global:
+    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
+    #   via the "travis encrypt" command using the project repo's public key
+    - secure: "V7BdXv3FCVkFGEfKfWto6I+Sytou1zTCGyn49xurkBfKNsG/3vbkXfsbK1m6lCZxmY7W/1odpfjixpAPZgy2L4FgPZK6/UyVvC8pIFjDOubcEniN48haleSvm/ZFPLDifxDL2+VVFtK1oRYPtDBzzSoUCcfwovgk+Wy+tSBnhnyRLqO/WaI6PqFof7ECYMTRlJVjioZARVP4YmkBruIPmGDdR/3EvwowlxfuiFoPheix61ug4x3tpTBW2qWgvFjDyCZXFz4pJrBQPTAIbyKMxHcBykJjl9eR+dWAOsvE1Uw48tFOJxjKDfUttVQUPsyKFllmcCVS0fDYB5pzZOmRUPxJmox1jt8J1FY85Ri1PGY0THBPM2H7to4Yf2418Y3539epbN8p+79dwaM7e2OiJ2owukbWI7PoNqIz5DV5zxpIKsOQfeWuNLJOgsBePEIU7lz133Si/2d5W/7If46B1d+hZRBJfSYksgDqDU6G/voZkPf0K5bKe2O2BxiIW1DYk4yQ1ecZAkqGjZ8jG3zYGMG3mSF4VyuU4UGFG1Pg8fw7Ap5zuHxSVY1H9dtu4T6JQG3aj/x1omlzfw48DjgkwxVhf7Xvl3yfR7pzydYheLX3MZYtcVo7rWnglZFZoUjWDK1StbmzsvPftvwWtoDTWlzo4xeSXhahSJvJyc4U8Wc="
+
+matrix:
+  include:
+    - os: osx
+      env: OPTS="--jerry-tests --jerry-test-suite --unittests"
+    - os: linux
+      before_install:
+        - tools/apt-get-install-deps.sh
+        - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
+      addons:
+        coverity_scan:
+          project:
+            name: "jerryscript-project/jerryscript"
+            description: "Ultra-lightweight JavaScript engine for the Internet of Things."
+          notification_email: rsipka.uszeged@partner.samsung.com
+          build_command: "tools/build.py --clean"
+          branch_pattern: master
+      env: OPTS=""
+    - compiler: gcc-5
+      addons:
+        apt:
+          sources:
+            - ubuntu-toolchain-r-test
+          packages:
+            - gcc-5
+            - gcc-5-multilib
+      env: OPTS="--jerry-tests --jerry-test-suite --skip-list=parser-oom.js --buildoptions=--compile-flag=-fsanitize=address,--compile-flag=-m32,--compile-flag=-fno-omit-frame-pointer,--compile-flag=-fno-common,--compile-flag=-O2,--debug,--jerry-libc=off,--static-link=off,--system-allocator=on,--linker-flag=-fuse-ld=gold" ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=true:strict_init_order=true TIMEOUT=600
+    - compiler: gcc-5
+      addons:
+        apt:
+          sources:
+            - ubuntu-toolchain-r-test
+          packages:
+            - gcc-5
+            - gcc-5-multilib
+      env: OPTS="--jerry-tests --jerry-test-suite --skip-list=parser-oom.js --buildoptions=--compile-flag=-fsanitize=undefined,--compile-flag=-m32,--compile-flag=-fno-omit-frame-pointer,--compile-flag=-fno-common,--debug,--jerry-libc=off,--static-link=off,--system-allocator=on,--linker-flag=-fuse-ld=gold" UBSAN_OPTIONS=print_stacktrace=1 TIMEOUT=600
+  allow_failures:
+    - env: OPTS="--check-pylint"
+  fast_finish: true
+
+before_install:
+  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tools/apt-get-install-deps.sh; fi
+  - if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$INSTALL_QEMU_ARM" == "yes" ]]; then tools/apt-get-install-qemu-arm.sh; fi
+  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tools/brew-install-deps.sh; fi
+  - if [[ "$OPTS" == "--test262" ]]; then sudo timedatectl set-timezone America/Los_Angeles; fi
+  - if [[ "$OPTS" == *"--check-pylint"* ]]; then pip install pylint==1.6.5; fi
+
+install:
+
+script: if [[ -n "$OPTS" ]]; then tools/run-tests.py $OPTS; fi
+
+# The channel name "chat.freenode.net#jerryscript"
+# is encrypted against Samsung/jerryscript
+# to prevent IRC spam of forks
+#
+# travis encrypt -r "Samsung/jerryscript" "chat.freenode.net#jerryscript"
+notifications:
+  irc:
+    channels:
+      - secure: "4kML4uZywOPaT3r/bHCvZCeQWooyzZumESmKuHG2Y8/B29WtMBobsoRQZRfOmlUP5kshfjh0Itp5WFpdACiBCoorHch/8z3VT7fIbKF4UnxrAvNiFArqxXC0OWGIu93e7uyyXJCsQ/JiOXU7bD31Mh8LbnfS1z3wBAMXi+AwcaGiVVH4VTL6O8sR3ij5WmsqpECWhyWTgTP3MiLquZ+09Lv9mp5GGciEemq4p8VnaQt2BdyEBmUJJ1EAyMCJlKNObQudegOzYsY3CVON9C87dCuHf7DYstsxb8AzwRAKn8LHiaWhYaWLfvHqoXmc4w1ZgN0HZ5Qyx8KMkZkXKUiHxuCSoXDxNAHWTGQBsTDid5drZeqOFucOHEKJzkqaWSUKUF3pY/hq/h2kjAn230DlBNkJt+ikSxwy6Mm8GG8LnH5gRMl37zHDHrtyRsKR8GIst9B1B95LAOLA5t8U/ucGKXqLsohS8glXaM4jjh69it3GeHj6NhB8NbC/LsmRrhjKzV+VnjPI6gZvN+5tDiuxMbsMal+0DdWVNCst/aO3Jz0iaA5ahyo2ZwBb2efw3CekRLMKmHtnjqB0SWWXT3/t2+5zNoM6gBjo4RPOg7k5eTOXcfk8okWtQ5d3n8UtvZ5rSiDl3rssHwp1yHuuC8rGGov74DLvyDlpM6p/dmtu2o8="
+    on_success: always
+    on_failure: always
+    use_notice: true
+    template:
+      - "%{repository_name} (%{branch}@%{commit}): %{author} - %{commit_subject} [%{result}]"
+      - "Commit: %{compare_url}"
+      - "Build: %{build_url}"
diff --git a/deps/jerry/CMakeLists.txt b/deps/jerry/CMakeLists.txt
new file mode 100644 (file)
index 0000000..495b8a2
--- /dev/null
@@ -0,0 +1,285 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+project (Jerry C ASM)
+
+# Determining platform
+set(PLATFORM "${CMAKE_SYSTEM_NAME}")
+string(TOUPPER "${PLATFORM}" PLATFORM)
+
+# Determining compiler
+if(CMAKE_C_COMPILER_ID MATCHES "GNU")
+  set(USING_GCC 1)
+endif()
+
+if(CMAKE_C_COMPILER_ID MATCHES "Clang")
+  set(USING_CLANG 1)
+endif()
+
+if(CMAKE_C_COMPILER_ID MATCHES "TI")
+  set(USING_TI 1)
+endif()
+
+# Determining build type
+if(NOT CMAKE_BUILD_TYPE)
+  set(CMAKE_BUILD_TYPE "MinSizeRel")
+endif()
+
+# Optional components
+set(JERRY_CMDLINE         ON  CACHE BOOL "Build jerry command line tool?")
+set(JERRY_CMDLINE_MINIMAL OFF CACHE BOOL "Build jerry minimal command line tool?")
+set(JERRY_PORT_DEFAULT    ON  CACHE BOOL "Build default jerry port implementation?")
+set(JERRY_EXT             ON  CACHE BOOL "Build jerry-ext?")
+set(JERRY_LIBC            ON  CACHE BOOL "Build and use jerry-libc?")
+set(JERRY_LIBM            ON  CACHE BOOL "Build and use jerry-libm?")
+set(UNITTESTS             OFF CACHE BOOL "Build unit tests?")
+set(DOCTESTS              OFF CACHE BOOL "Build doc tests?")
+
+# Optional build settings
+set(ENABLE_ALL_IN_ONE  OFF CACHE BOOL "Enable all-in-one build?")
+set(ENABLE_LTO         ON  CACHE BOOL "Enable LTO build?")
+set(ENABLE_STATIC_LINK ON  CACHE BOOL "Enable static linking?")
+set(ENABLE_STRIP       ON  CACHE BOOL "Enable stripping all symbols from release binary?")
+
+# Option overrides
+if(JERRY_CMDLINE OR JERRY_CMDLINE_MINIMAL OR UNITTESTS OR DOCTESTS)
+  set(JERRY_PORT_DEFAULT ON)
+
+  set(JERRY_PORT_DEFAULT_MESSAGE " (FORCED BY CMDLINE OR TESTS)")
+endif()
+
+if(JERRY_CMDLINE OR DOCTESTS)
+  set(JERRY_EXT ON)
+
+  set(JERRY_EXT_MESSAGE " (FORCED BY CMDLINE OR TESTS)")
+endif()
+
+if("${PLATFORM}" STREQUAL "DARWIN")
+  set(JERRY_LIBC         OFF)
+  set(JERRY_LIBM         OFF)
+  set(ENABLE_ALL_IN_ONE  ON)
+  set(ENABLE_LTO         OFF)
+  set(ENABLE_STATIC_LINK OFF)
+  set(ENABLE_STRIP       OFF)
+
+  set(JERRY_LIBC_MESSAGE         " (FORCED BY PLATFORM)")
+  set(JERRY_LIBM_MESSAGE         " (FORCED BY PLATFORM)")
+  set(ENABLE_ALL_IN_ONE_MESSAGE  " (FORCED BY PLATFORM)")
+  set(ENABLE_LTO_MESSAGE         " (FORCED BY PLATFORM)")
+  set(ENABLE_STATIC_LINK_MESSAGE " (FORCED BY PLATFORM)")
+  set(ENABLE_STRIP_MESSAGE       " (FORCED BY PLATFORM)")
+endif()
+
+if(USING_TI)
+  set(ENABLE_STATIC_LINK ON)
+  set(ENABLE_STRIP       OFF)
+
+  set(ENABLE_STATIC_LINK_MESSAGE " (FORCED BY COMPILER)")
+  set(ENABLE_STRIP_MESSAGE       " (FORCED BY COMPILER)")
+endif()
+
+# Status messages
+message(STATUS "CMAKE_BUILD_TYPE          " ${CMAKE_BUILD_TYPE})
+message(STATUS "CMAKE_SYSTEM_NAME         " ${CMAKE_SYSTEM_NAME})
+message(STATUS "CMAKE_SYSTEM_PROCESSOR    " ${CMAKE_SYSTEM_PROCESSOR})
+message(STATUS "ENABLE_ALL_IN_ONE         " ${ENABLE_ALL_IN_ONE} ${ENABLE_ALL_IN_ONE_MESSAGE})
+message(STATUS "ENABLE_LTO                " ${ENABLE_LTO} ${ENABLE_LTO_MESSAGE})
+message(STATUS "ENABLE_STATIC_LINK        " ${ENABLE_STATIC_LINK} ${ENABLE_STATIC_LINK_MESSAGE})
+message(STATUS "ENABLE_STRIP              " ${ENABLE_STRIP} ${ENABLE_STRIP_MESSAGE})
+message(STATUS "JERRY_CMDLINE             " ${JERRY_CMDLINE})
+message(STATUS "JERRY_CMDLINE_MINIMAL     " ${JERRY_CMDLINE_MINIMAL})
+message(STATUS "JERRY_PORT_DEFAULT        " ${JERRY_PORT_DEFAULT} ${JERRY_PORT_DEFAULT_MESSAGE})
+message(STATUS "JERRY_EXT                 " ${JERRY_EXT} ${JERRY_EXT_MESSAGE})
+message(STATUS "JERRY_LIBC                " ${JERRY_LIBC} ${JERRY_LIBC_MESSAGE})
+message(STATUS "JERRY_LIBM                " ${JERRY_LIBM} ${JERRY_LIBM_MESSAGE})
+message(STATUS "UNITTESTS                 " ${UNITTESTS})
+message(STATUS "DOCTESTS                  " ${DOCTESTS})
+
+# Setup directories
+# Project binary dir
+set(PROJECT_BINARY_DIR "${CMAKE_BINARY_DIR}")
+
+# Library output directory
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib/")
+
+# Executable output directory
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/")
+
+# Archive targets output Directory
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib/")
+
+# Remove rdynamic option
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS )
+
+# Compile/link flags
+# Helper macros
+macro(jerry_add_flags VAR)
+  foreach(_flag ${ARGN})
+    set(${VAR} "${${VAR}} ${_flag}")
+  endforeach()
+endmacro()
+
+macro(jerry_add_compile_flags)
+  jerry_add_flags(CMAKE_C_FLAGS ${ARGV})
+endmacro()
+
+macro(jerry_add_compile_warnings)
+  foreach(_warning ${ARGV})
+    jerry_add_compile_flags(-W${_warning})
+    if(USING_GCC)
+      jerry_add_compile_flags(-Werror=${_warning})
+    endif()
+  endforeach()
+endmacro()
+
+macro(jerry_add_link_flags)
+  jerry_add_flags(LINKER_FLAGS_COMMON ${ARGV})
+endmacro()
+
+# Architecture-specific compile/link flags
+jerry_add_compile_flags(${FLAGS_COMMON_ARCH})
+jerry_add_flags(CMAKE_EXE_LINKER_FLAGS ${FLAGS_COMMON_ARCH})
+
+# Enable static build
+if(ENABLE_STATIC_LINK)
+  if (USING_GCC OR USING_CLANG)
+    jerry_add_link_flags("-static")
+  endif()
+endif()
+
+# LTO
+if(ENABLE_LTO)
+  if (USING_GCC OR USING_CLANG)
+    jerry_add_compile_flags(-flto)
+    jerry_add_link_flags(-flto)
+  endif()
+  if(USING_GCC)
+    jerry_add_compile_flags(-fno-fat-lto-objects)
+    # Use gcc-ar and gcc-ranlib to support LTO
+    set(CMAKE_AR "gcc-ar")
+    set(CMAKE_RANLIB "gcc-ranlib")
+  endif()
+  if(USING_TI)
+    jerry_add_link_flags(-lto)
+  endif()
+endif()
+
+# Compiler / Linker flags
+if (USING_GCC OR USING_CLANG)
+  jerry_add_compile_flags(-fno-builtin)
+endif()
+if(("${PLATFORM}" STREQUAL "DARWIN"))
+  jerry_add_link_flags(-lSystem)
+  set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Sqc <TARGET> <LINK_FLAGS> <OBJECTS>")
+  set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
+else()
+  jerry_add_link_flags(-Wl,-z,noexecstack)
+endif()
+
+# Turn off linking to compiler's default libc, in case jerry-libc is used
+if(JERRY_LIBC)
+  jerry_add_link_flags(-nostdlib)
+endif()
+
+# Turn off stack protector
+if (USING_GCC OR USING_CLANG)
+jerry_add_compile_flags(-fno-stack-protector)
+endif()
+
+if (USING_GCC OR USING_CLANG)
+  jerry_add_compile_warnings(all extra format-nonliteral init-self conversion sign-conversion format-security missing-declarations shadow strict-prototypes undef old-style-definition)
+  jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes)
+endif()
+
+if(USING_GCC)
+  jerry_add_compile_warnings(logical-op)
+elseif(USING_CLANG)
+  jerry_add_compile_flags(-Wno-nested-anon-types -Wno-static-in-inline)
+endif()
+
+if(JERRY_LIBC)
+  jerry_add_compile_flags(-Werror)
+endif()
+
+# C
+if (USING_GCC OR USING_CLANG)
+  jerry_add_compile_flags(-std=c99 -pedantic)
+elseif(USING_TI)
+  jerry_add_compile_flags(--c99)
+endif()
+
+# Strip binary
+if(ENABLE_STRIP AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+  jerry_add_link_flags(-s)
+endif()
+
+# TODO: Remove workaround for gcc 7 bug if the
+# fallthrough comment detection is fixed.
+if (USING_GCC AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 7.0)
+  jerry_add_compile_flags(-Wno-implicit-fallthrough)
+endif()
+
+# External compiler & linker flags
+if(DEFINED EXTERNAL_COMPILE_FLAGS)
+  jerry_add_compile_flags(${EXTERNAL_COMPILE_FLAGS})
+endif()
+
+if(DEFINED EXTERNAL_LINKER_FLAGS)
+  jerry_add_link_flags(${EXTERNAL_LINKER_FLAGS})
+endif()
+
+# Jerry's libc
+if(JERRY_LIBC)
+  add_subdirectory(jerry-libc)
+endif()
+
+# Jerry's libm
+if(JERRY_LIBM)
+  add_subdirectory(jerry-libm)
+endif()
+
+# Jerry's core
+add_subdirectory(jerry-core)
+
+# Jerry's default port implementation
+if(JERRY_PORT_DEFAULT)
+  add_subdirectory(jerry-port/default)
+endif()
+
+# Jerry's extension tools
+if(JERRY_EXT)
+  add_subdirectory(jerry-ext)
+endif()
+
+# Jerry command line tool
+if(JERRY_CMDLINE OR JERRY_CMDLINE_MINIMAL)
+  add_subdirectory(jerry-main)
+endif()
+
+# Unittests
+if(UNITTESTS)
+  add_subdirectory(tests/unit-core)
+  if(JERRY_LIBM)
+    add_subdirectory(tests/unit-libm)
+  endif()
+  if(JERRY_EXT)
+    add_subdirectory(tests/unit-ext)
+  endif()
+endif()
+
+# Doctests
+if(DOCTESTS)
+  add_subdirectory(tests/unit-doc)
+endif()
diff --git a/deps/jerry/CONTRIBUTING.md b/deps/jerry/CONTRIBUTING.md
new file mode 100644 (file)
index 0000000..e66d785
--- /dev/null
@@ -0,0 +1,99 @@
+# Contribution Guidelines
+## Patch Submission Process
+
+The following guidelines on the submission process are provided to help you be more effective when submitting code to the JerryScript project.
+
+When development is complete, a patch set should be submitted via GitHub pull requests. A review of the patch set will take place. When accepted, the patch set will be integrated into the master branch, verified, and tested. It is then the responsibility of the authoring developer to maintain the code throughout its lifecycle.
+
+Please submit all patches in public by opening a pull request. Patches sent privately to Maintainers and Committers will not be considered. Because the JerryScript Project is an Open Source project, be prepared for feedback and criticism-it happens to everyone-. If asked to rework your code, be persistent and resubmit after making changes.
+
+### 1. Scope the patch
+
+Smaller patches are generally easier to understand and test, so please submit changes in the smallest increments possible, within reason. Smaller patches are less likely to have unintended consequences, and if they do, getting to the root cause is much easier for you and the Maintainers and Committers. Additionally, smaller patches are much more likely to be accepted.
+
+### 2. Ensure all files have a proper license header and copyright notice
+
+Any code that you want to contribute to the project must be licensed under the [Apache License 2.0](LICENSE). Contributions under a different license can not be accepted. Each file should start with the following header:
+
+```c
+/* 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.
+ */
+```
+
+Adding copyright notices other than the project-wide notice ("Copyright JS Foundation and other contributors, http://js.foundation") is not permitted. The only exception is adding third-party code which requires copyright notices to be preserved. Adding third-party code to the project generally requires a strong justification.
+
+### 3. Sign your work with the JerryScript [Developer's Certificate of Origin](DCO.md)
+
+The sign-off is a simple line at the end of the commit message of the patch, which certifies that you wrote it or otherwise have the right to pass it on as an Open Source patch. The sign-off is required for a patch to be accepted.
+
+We have the same requirements for using the signed-off-by process as the Linux kernel.
+In short, you need to include a signed-off-by tag in every patch.
+
+You should use your real name and email address in the format below:
+
+> JerryScript-DCO-1.0-Signed-off-by: Random J Developer random@developer.example.org
+
+"JerryScript-DCO-1.0-Signed-off-by:" this is a developer's certification that he or she has the right to submit the patch for inclusion into the project. It is an agreement to the JerryScript [Developer's Certificate of Origin](DCO.md). **Code without a proper signoff cannot be merged into the mainline.**
+
+### 4. Open a GitHub [pull request](https://github.com/jerryscript-project/jerryscript/pulls)
+
+You can find instructions about opening a pull request [here](https://help.github.com/articles/creating-a-pull-request).
+
+### 5. What if my patch is rejected?
+
+It happens all the time, for many reasons, and not necessarily because the code is bad. Take the feedback, adapt your code, and try again. Remember, the ultimate goal is to preserve the quality of the code and maintain the focus of the Project through intensive review.
+
+Maintainers and Committers typically have to process a lot of submissions, and the time for any individual response is generally limited. If the reason for rejection is unclear, please ask for more information from the Maintainers and Committers.
+If you have a solid technical reason to disagree with feedback and you feel that reason has been overlooked, take the time to thoroughly explain it in your response.
+
+### 6. Code review
+
+Code review can be performed by all the members of the Project (not just Maintainers and Committers). Members can review code changes and share their opinion through comments guided by the following principles:
+* Discuss code; never discuss the code's author
+* Respect and acknowledge contributions, suggestions, and comments
+* Listen and be open to all different opinions
+* Help each other
+
+Changes are submitted via pull requests and only the Maintainers and Committers should approve or reject the pull request (note that only Maintainers can give binding review scores).
+Changes should be reviewed in reasonable amount of time. Maintainers and Committers should leave changes open for some time (at least 1 full business day) so others can offer feedback. Review times increase with the complexity of the review.
+
+## Tips on GitHub Pull Requests
+
+* [Fork](https://guides.github.com/activities/forking) the GitHub repository and clone it locally
+* Connect your local repository to the original upstream repository by adding it as a remote
+* Create a [branch](https://guides.github.com/introduction/flow) for your edits
+* Pull in upstream changes often to stay up-to-date so that when you submit your pull request, merge conflicts will be less likely
+
+For more details, see the GitHub [fork syncing](https://help.github.com/articles/syncing-a-fork) guidelines.
+
+## How to add the DCO line to every single commit automatically
+
+It is easy to forget adding the DCO line to the end of every commit message. Fortunately there is a nice way to do it automatically. Once you've cloned the repository into your local machine, you can add `prepare commit message hook` in `.git/hooks` directory like this:
+
+```
+#!/usr/bin/env python
+
+import sys
+
+commit_msg_filepath = sys.argv[1]
+
+with open(commit_msg_filepath, "r+") as f:
+       content = f.read()
+       f.seek(0, 0)
+       f.write("%s\n\nJerryScript-DCO-1.0-Signed-off-by: <Your Name> <Your Email>" % content)
+```
+
+Please refer [Git Hooks](http://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) for more information.
+
diff --git a/deps/jerry/DCO.md b/deps/jerry/DCO.md
new file mode 100644 (file)
index 0000000..9350b88
--- /dev/null
@@ -0,0 +1,22 @@
+# JerryScript Developer's Certificate of Origin
+
+The JerryScript project uses the signed-off-by language and process to give us a clear chain of trust for every patch received.
+
+> By making a contribution to this project, I certify that:
+
+> (a)  The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
+
+> (b)  The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
+
+> (c)  The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
+
+> (d)  I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project, under the same open source license.
+
+We have the same requirements for using the signed-off-by process as the Linux kernel.
+In short, you need to include a signed-off-by tag in the commit message of every patch.
+
+You should use your real name and email address in the format below:
+
+> JerryScript-DCO-1.0-Signed-off-by: Random J Developer random@developer.example.org
+
+"JerryScript-DCO-1.0-Signed-off-by:" this is a developer's certification that he or she has the right to submit the patch for inclusion into the project. It is an agreement to the Developer's Certificate of Origin (above). **Code without a proper signoff cannot be merged into the mainline.**
diff --git a/deps/jerry/Doxyfile b/deps/jerry/Doxyfile
new file mode 100644 (file)
index 0000000..185950c
--- /dev/null
@@ -0,0 +1,2384 @@
+# Doxyfile 1.8.9.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME           = "JerryScript"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          = "JavaScript Engine for Internet of Things"
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
+
+PROJECT_LOGO           =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = "docs/doxygen"
+
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS         = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+# ALLOW_UNICODE_NAMES    = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC    = YES
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES        = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF      = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE               = 2
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT       = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS  = YES
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO, these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES, upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+# HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC  = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS        = YES
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
+# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES        = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS               = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC       = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces.
+# Note: If this tag is empty the current directory is searched.
+
+INPUT                  = jerry-core jerry-libc
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
+
+FILE_PATTERNS          = *.h, *.c
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS        = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS       = YES
+
+# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
+# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
+# cost of reduced performance. This can be particularly helpful with template
+# rich C++ code for which doxygen's built-in parser lacks the necessary type
+# information.
+# Note: The availability of this option depends on whether or not doxygen was
+# compiled with the --with-libclang option.
+# The default value is: NO.
+
+# CLANG_ASSISTED_PARSING = NO
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+# CLANG_OPTIONS          =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX     = YES
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET  =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP         = NO
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS  = YES
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET        = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP      = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE               =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION           =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the master .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI           = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING     =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX          = YES
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW      = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH         = 250
+
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT         = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS     =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE       =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH    = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH        = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL       =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE        = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID     =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS  =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE             = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. To get the times font for
+# instance you can specify
+# EXTRA_PACKAGES=times
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER           =
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+# LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES      =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES, to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE        = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES     = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE    =
+
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+# RTF_SOURCE_CODE        = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION          = .3
+
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+# MAN_SUBDIR             =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT             = xml
+
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK       = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT         = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+# DOCBOOK_PROGRAMLISTING = NO
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sf.net) file that captures the
+# structure of the code including all documentation. Note that this feature is
+# still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS        = YES
+
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES         = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH               =
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: YES.
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS        = 0
+
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME           = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH          = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot.
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd,
+# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo,
+# gif:cairo:gd, gif:gd, gif:gd:gd and svg.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG        = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS           =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS           =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+# PLANTUML_JAR_PATH      =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+# PLANTUML_INCLUDE_PATH  =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP            = YES
diff --git a/deps/jerry/LICENSE b/deps/jerry/LICENSE
new file mode 100644 (file)
index 0000000..8e755f4
--- /dev/null
@@ -0,0 +1,203 @@
+Copyright JS Foundation and other contributors, http://js.foundation
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   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.
diff --git a/deps/jerry/LOGO.png b/deps/jerry/LOGO.png
new file mode 100644 (file)
index 0000000..b0f0817
Binary files /dev/null and b/deps/jerry/LOGO.png differ
diff --git a/deps/jerry/LOGO.svg b/deps/jerry/LOGO.svg
new file mode 100644 (file)
index 0000000..72d1697
--- /dev/null
@@ -0,0 +1,2430 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+The MIT License (MIT)
+Copyright (c) 2016 JerryScript Community
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-->
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   id="svg3044"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   width="779"
+   height="778"
+   sodipodi:docname="rounded_square_1.png">
+  <metadata
+     id="metadata3050">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs3048" />
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1280"
+     inkscape:window-height="972"
+     id="namedview3046"
+     showgrid="false"
+     inkscape:zoom="1.0372751"
+     inkscape:cx="389.5"
+     inkscape:cy="389"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="g3256" />
+  <image
+     width="779"
+     height="778"
+     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwsAAAMKCAYAAADK+tgfAAAABHNCSVQICAgIfAhkiAAAIABJREFU
+eJzs3XeYVPXZxvHvmbadXVjYQm8CUpQuKCpSVBSxxsgbTezGGk1iYokRSyyxx5JgmsbeiFERG8Ve
+QQVXRAEp0vv23Snn/eMsTWZhF2bO78zu/bmuuZayzHPvMrNznvk1EBERERERERERERERERERERER
+ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER
+ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER
+ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER
+ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER
+ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER
+ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER
+ERERERERSW0WcDzwKdDOcBYREREREfGIocA7gF13e8ZsHBERERERMa0L8BTbm4Qdb2MN5hIRERER
+EUNaAncCNcRvFGxgAZBmKqCIiIiIiLgrDbgC2Ej9TcKOt2vNxBQREREREbdYwKnAYhrWJGy9VeJM
+VRIRERERkSZoBPARjWsSdry95H5kERERERFJph7AC+x9k7Dj7TiXs4uIiIiISBK0Ae4HwiSmUbCB
+JUCmi1+DiIiIiIgkUAZwFbCFxDUJO95udu9LERERERGRRPABZwDLSE6TsPVWgzO1SUREREREUsAo
+YA7JbRJ2vL2Js7OSiIiIiIh4VB/gFdxrEna8nerC1yciIiIiIo1UDEwGophpFGxgBZCT7C9URERE
+REQaJgv4I1COuSZhx9tdyf1yRURERERkT/zAucBKzDcIO94iQL8kft0iIiIiIrIbo4AvMd8Y1Hd7
+Fy12FhERERFx1X7Ai5hvBhpy+0WSvgciIiIiIrKDlsDdJPbk5WTf1tblFhERERGRJAgCFwPrMX/x
+vze3hxL/LRERERERkdHA15i/4N+XWwwYnOhvjIiIiIhIc9UeeBrzF/qJun2Ks3OTiIiIiIjspRDw
+W7xzXkIib79M4PdJRERERKRZOYLUn3K0u9tGoE3CvlsiIiIiIs1AW+BJzF/Mu3H7d4K+ZyIiIiIi
+TZofZ5ejUsxfxLt5G5GIb56IiIiISFPVF/gQ8xfuJm5zgcC+fwtFJJXoOHeR5Hqk7uMRQCbOvutb
+dxapBXw7fO7WX8dwnptbX6Bh5+eqD4jW/Vm07v5iOC/isR0+L/aj+/xxrcgO9+Wvq7X1vvx1f74v
+tfZUvyl9rQ2ttaevdet97q6WvtZd78ONx1AUyADSad5qgCr2/vtaW3ebU/dn99V9nJXM0CKy99Qs
+iOy9C+o+no7TCBTiXEhsvWm7QRGRPYvhNJ5htjcUEWAFUAk8Xvd5k42kE2nm1CyINNxIoAdwPtAd
+yEYNgYiIG2ycEYww8DmwFqeJ2IBGJUSSSs2CSHyDgBzgZOBgnFGDQpzmQM8bERFvsHFGImqA74B1
+wPfAB3V//27d35fhnIEhIo2kix4R6Fx3GwCchrOfeFucQ5b0HBERST02zlSmzTijD18AbwArgZk4
+DYSINIAuhKS56Vx368P2xqA9zsJFX73/SkREUl0MZw3EF8C3wHU4zYOI7IaaBWnqRuKsLbgEpyno
+hLMYWY2BiEjzZeOsf1gC3IXTPMwymEfEs9QsSFPUGfgFzrqDkTjNgh7rIiISjw1UAK8BC3F2XVpi
+MpCIl+gCSpqKkcB+wK9x1hvkoMe3iIg0jo1zMvcy4A5gOfAZWhwtzZgupiSVdQYuBQYDw3AWJIuI
+iCSCjbPG4QOc06sfwZmupMXR0qyoWZBU1Bu4FmdL045o/YGIiCSXjTO6sA64F5iHM1VpiblIIu5Q
+syCpIgScAJwHHITWIYiIiDlVwCfAdJxpSh/ibNMq0uToYku8ri1wBTAB6AIE0ONWRES8IQasAd4G
+pgFPo2lK0sTooku8qi3wR2AsznanfrNxRERE6mXjnCI9G2cL1kdxTpQWSXlqFsRLinGmGp0J7I+z
+o5GIiEgqieDsovQB8B+c5kGjDZKy1CyIadk4uxmdBpyBc2CaiIhIqosBm4C3gGeBGWhdg6QgNQti
+0snAqcBJOGsRREREmhobp2l4EadpmIlGGiSFqFkQt3UG7gF6Ar3QY1BERJoHG9gAPAg8D3yPc3K0
+iKfpQk3cMhJ4DGhvOIeIiIhpG4HfAy8Baw1nEdktNQuSbIOAh4GBpoOIiDQVtm0DYFl6GU9xy3Ga
+hqdMBxGpj37KSDJdgDPlKMN0EBGRpmBrk7AjNQxNwn3A5aZDiMTjMx1Amqx/48zLVKMgIrKPTjnl
+lLiNgjQZvwK+Mh1CJB69HSGJ1hZ4HehrOoiISFPQkCZBowtNxnrgDzivo0vMRhFx6KeLJEpb4B/A
+KCDNcBYRkZTX2JEENQxNRgR4AfgbzoFuIkbpJ4vsq0E4J1T2QtPaGswCgkEffp9FMGDh81nEYs6F
+gc9nYdtgWc4NYMdrhljMxu93Psfvs4jGbHw+i0gkhs+3/Sn94/vc+uut9xEI+Jz7qrsPy4Jo1Lmv
+aNSpUV+tcDhmA7FozI5GonYkGrXD0di2lDGcx8LWj/zo1/zozy2cLQW3/nvrR58XrfuzKOCv+zeB
+uo/bvqQ91IrscF/+ulpb78tf9+du1NrT17r1PndXq9l9rS2yA3mVVVEi0aY/DSct5KO6JrpX/zYz
+3U9VTWzPnyipogK4A7jBdBBp3tQsyN4aBNwLDMe5OJA6FhAIWAQDTjOQlemcN9e/V0vSgj7OmNCF
+/LwQI4cWmg26Gzu+o6l3K5PF2v5h27e76V8MN9Y3i0sZf9HbLFpebjpKUh3cvzV/u34I/U54dZ/u
+Z8IR7Xh51soEpUqso0cU89p7q07JyQpc0L4os8uWsnDnWMwO1IZjhMMxIlGbmtooMT0NfmwzMAaY
+bTqINE+6CpC9cQFwF5BlOohpWxuDotYZtG2TwehhhYwZXkSvri3Izw0RCqV2HxWOxLB8FgGfflQk
+jG1DLEwsGoVYlO3DSH4sfwDL7wdLg3QAb36wip9c8T5bysOmoyRNXk6Q23/dn/MnfZKQ+/v+jQn0
+Pm4q1bXeHGF4//ExHDygTb1/v2pdFWvWV/Ov/y5mzfpqZn6yhsrqCJVVUbXSsAY4DU1NEpfpCkAa
+ozPOwWrNcjTBAvx+i5YtQhS0SqfvfrmMO7QYv9/i0EEFhII+sjMD5GQFTUdNONu2t40wxGwbn0Yb
+Gs2ORqC2klhNJbFwjdMoxGI4owl1c878AaxACF9aJlYoAysQMh3bmIee+o7LbplNtAm/zfyz8Z24
++5pDKRj+WELv95bLD+Ta++Ym9D4T5YAeecx+7igCgcY1xLM+WQPAfY8tAOCTeRupqIpQUxslGrOJ
+RJzHSdN9tOxkDnA+GmkQl+gVXxpqJPBPoAvN5HET8FtkZQToWJxJu8JMzjulG61yQwzu04rsJtgQ
+NEa0bq2DNEAsRqy6nFhVKXZtFXYsUrcIpa5J2Gbr7y0snx8rmI4vswW+9BzwN5/ePBKJccXtc3jg
+ye9MR0ma/Tpm89frhzD67BlJq9Gzcwu+XVqWtPvfF/f8fgCX/7xXwu5v1idriERtpry5nE/mbWDR
+8nK2lIWbeuNQg7Pd6mTTQaTp06u9NMSvgJuBbNNBksUCsjIDdCrOokNxJqeP70y7wgw6t8uic7sm
++2XvEzUMe2aHa4hVbCZatQWiURr3vqcFPj++jBz8WS2xgulN/if2lrJaTv31+7zxwWrTUZLCZ8Hv
+z+3NLQ+XJL3WW/8cxdhzZya9zt7IyQzwzdRjaVuQmZT7X72uiqenLeWtD9fw5oerqQ17c0pWAsSA
+D4Az0DarkkRN/KVH9tEgnMPV+tLEHitbm4OCVmmcfVI3DhnQWo3BXojV7Y4kP2LbznSj8g3EairB
+3oeLFcuHLy0Lf04+VloGTeypuM3yVRWMu+BtShZtMR0lKXp1yeHRW4Yz9LTXXat52rhOPPPaMtfq
+NcZp4zry1J2HJL3OqnVVvDj9B/75wiK+W1pGWUWkKY44LAbOQWsZJEma5quOJMIFOFu25ZgOkigW
+kJnh5+D+bTigZx5nntCFHp1yUn4RsniJBdEw0cpSYpWbsCM1CZpEbeFLz8KfW+CMMDQxcxdsYtwF
+b7NyXZXpKAnns+A3Z/biz/+a73rtFTNPoNf4qZRXRlyv3RDT/3kEo4YVuVZvyYpy7n/iWz77aiMf
+zd3Q1EYcqnEOc7vLdBBpetQsSDwPA2cCKT8xf2uD0LV9NleevT8dijK15kCSxq6tJlqxiVhVqbOA
+OZEsC39mLr4WBVj+QGLv26DpH63mpMvepbTCmxe0+6JHpxweuWUYw//vDWMZ7r1qIFfc/rmx+rvT
+q0sOX04ZZ+QNm1mfrOG7pWXc/eg3rFxb1ZRGHJYBv0CjDJJAahZkR9nA/4AjSPHHRsBv0b1jNsMO
+bM31F/XV9CJJMptYdSWxsvXEait3PkUvgSxfAH+LNviy8raf2JfCHn/5e87+w8eEI03kMq2OBVz+
+857c/eg3pqMAcGDPlsz9drPpGHHd8qsDuPr8PkYzLFlRziMvfs/HczfwzmdrqaxOcKNvxg3AJNMh
+pGlI/VcbSZSjgEcA98aEE2zrKMIhA9owpG8rLpq4X9IW0O1OiyHP0aE4kw5FmbQvdD52KN7+6/ZF
+mU1ye9XmzK4uI1K6Hrs2+dNofGnZ+FsWpfS2qrZtc/s/5nP1vV+ajpJw3Tpk88ifhjHijDdNR9nm
+/cfHMuKMt0zHiCsjzc/8V46lU1tvHNsz65M1lFdGuO7+uSxZUZHquyrNwnnzT2SfqFkQgOtw5jqm
+5NWHz4JWuSFOPbojY4YXcexhbY2uQ7D6PLXHz8nNDm5rHOI1Fe0LMzRVKkXYNRVEt6wl5kKjAIDP
+TyC3EF9mbkqOLkSjMS67ZTYPPb3QdJSEu+i07jz4lDe3fD37pK78+7/fm44R1/FHtOPFBw4zHWMX
+K9dW8vBzi3hq6lKWrKwgHI6lYuPwLuC9b66klNR7pZFEewE4AUi5I2ODAYsu7bIZdVAhZ57YhQG9
+WnpisXJDmoWGyMtxGopdmoq6UYt2BZlkZTadueupyA5XO41CdQVuHgfly8wjkFcIPvOP98aorY1y
++lUf8tzry01HSahWuSH+ffNBTLjkHdNR6rXxiyvpfvh9bCr15mnYrzx0GMce3s50jLhqa6O8OOMH
+Hvnv93z61QY2bK5NtabhTuBK0yEkdalZaL46A68C+xvO0WjZmQHGDi+iZ5ccTj+uM32655mOtJNE
+NQsN0So3tH1UYqemIoMOxVm0L8wgI10NRTLY0Qix0vVEKzclbY1CfXyhDAKt2kEKTUWqqIxw8uXv
+8vr7TesMhSOGFvDYbcNpd8SLpqPs0cOThnLBDZ+ajhFXl3ZZlLx0jOd/Xn23tIy/Pv0dU99eyaLl
+5al0wvi1wC2mQ0hqUrPQPJ0GPADkmw7SGIX56dx4ST96dM5h5NBC03Hq5Waz0BD5uaGd1kz8eKSi
+fVEm6Wn79g71j88ibvJsm2jlFqJb1kLM/V18LH+QQKu2WGnemOe9J5tLaxl/0du8//l601ESxu+z
+uPHSflyTYusuDjogn0/mbTQdI67rftmHGy89wHSMBtlcWssd/5rPM68tY/Hy8lQZaZgLnA3MNh1E
+Ukuzen0XAG4FLgdSZrP2DkWZ/OfWYZ5uEHbktWahIdq0TNs2xal9YQYdirJ2airaFmTsc0PRlNjh
+GiKbV2HXVJoJ4PMTaFmML6OFmfqNsGZ9FUedP4svF3hzN5690aVdFk/ecTDDJprbEnVvzX7uaIb+
+9HW8+IZ4KOjjq/8dw36dUud4n5VrK3nwye944MlvU2X732rg98BfTAeR1KFmoXl5CjgF8PY4L858
+/ZFDCrjnqoEpt+1pKjYLDVHQKm2ndRM/XpTdriDDE2tGks62iVZsdEYVXJ5+tI3lI5BXiC+rpZn6
+DbR0ZQVjz5nBd8vKTUdJmP87thNPvLLEdIx9csn/9fDsQuwjDy7itYdHYqXY4v2KyggDTp6WKo/1
+KPA0cLrpIJIaUuvZKPviRWACHv8/9/ssDhvchhn/Hm06yl5rqs1CQxTmp8dfP1GURYfiTIpbp6d8
+Q2FHaoluWknM1KgCpESz8M3iUsaeO4Mf1jSNU5mzMvw8dN0Qfn71h6aj7LNo9WratuvM2o01pqPE
+9dzdh3DKUR1Nx9grR5w5nVmfrjUdoyFs4G20tao0gKcvHCVhUqJRyMrwc+35fYwf0LOvmnOzsCcW
+UNQ6fVsjEW/72OI2GQSDXt2cyyZWuYXIptVgx8zFsHwE8oqcw9k86KvvNjPqrBms2+TNi9HG6t2t
+BS/ceyi9xr9iOkrCPH77cM646iPTMeJqV5DBN68cm7LbR096cB43PPSV6RgNNRMYZTqEeJunLx4l
+IV4CxuPh/2sLGNSnFbf/+kBGDUvZM+G2UbOwbyyguE1GXSOx4/oJ59ftCzMobpNBIGCgoYjFiGxe
+TawyUfPvLfZqy1Wrbs1CpvfWLMxdsInRZ89g/eZa01ESYuIxnXhy6hLTMZLi8MEFvDN7nekYcf32
+zF7cceUA0zH22qxP1nDBpE/5dmmZ6SgNMRc40HQI8S7PXkBKQnh6RMFnwX6dcrjjtwM4YmhByr6L
+9GNqFpLPZ0Hbgoxd10/sMFJR1Dodvz+xDYUdriaycQV2OEHvmFs+59kZa9wohVd3Q/pi/ibGnDOD
+DVtSv1EI+C3u+t0ALrul6W4cU/LSMfQ/6TUiUe+tdg74Lb6YcrTntsZurNklGznh0ndSYTreB8Ah
+pkOIN3nyIlISwrONgs+Cof3yueDU7owY2IaOxZkpP499R2oWvMHvs2hbkPGjRdk7j1QU5jemobCI
+VW4msnk1xKKJCbl1EWcjF0pbwTQC+e2xAmmJyZEAc77eyJhzZnj20K/GaNsmg+fuOYSDf/am6ShJ
+9/tzevPnf803HSOuwwa1Ydajo1NusXM8n8zdwE9/8z5LVlaYjrI7OrxN4kr9Z6DE8zowFg/+/3Ys
+zuSvfxzCfp1y6NTEmoSt1CykjoB/e0MRd6enokwK8tPx+SxnF6TSdUTLN5jbBQkAG19aFoFW7cHv
+jY3NPp23gSPPm8nmstRvFEYOKeDpOw+m8LD/mo7img5FmZ595/s/tw7jjAldTMdIiPKKMI+9vIRr
+7v3Sy8+VX6FtVeVHPHcxKfvsTWA0Hvu/Dfgtxh/elv/cNpycJjLdqD5qFpqWYMCiXcGP1k/scEJ2
+h6JM2rRKJ7LSvXdnfVl5BHKLwGd+IfjHc9dz5LkzU2WP+d363dn7c/s/vzYdw3VT7juUky9/z3SM
+uApapbFg6njyWqTOaeV7srVpuOK2OdSEDW6UEF8UOA/4t+kg4h2euqCUffYeHpxzmB7yceOlB3Dl
+2fubjuIKNQvNTzBgbRuNqG+npzat0givSEBDYVn4WxTgz261fRqTIZ/O28Dos2dQVpnajUJOZoBH
+bx3GiZe9azqKMeMObctr760yHSOuiyfuxwN/GGw6RlIc8rM3+fCL9V47AToM3AD8yXQQ8QY1C03H
+uziNgqf+T7t1yObhSUOaxC5HDaVmQeJJC/pov8O5E/F2esrPC+2xobD8Qfwti/Glmz2s8MtvNnHE
+WdNTfo1Ctw7ZvPzgYex/3FTTUYxaOO04+h7/qhff6cZnwafPHsXA3q1MR0mK03//Ac9MW+a1heYx
+YDJwkekgYp6nLixlr00FjjEdYkfpIR83X3YAZ57Ylfw87yzCdIOaBdlb6SHfLudO/HikolVuCKIR
+rIC56XzzF23h8F9MT/lzFEYOKeCV5+4kq9MZpqN4wg0X92OSR88HGNqvFR8+eaSzfqgJ+svjC/j9
+XV9QXeupZs0GngD0BGnmmuazrnmZjscOVCnMT+eZuw5hUO+WTWY71MZQsyDJlB7ybWsc2hVk0q4w
+g3YFGbQr3PprZ9vYZJ1DsWhZGYee8Rar1lcn5f7dcv5PujH52YWmY3hO9445LFpebjpGXJOvH8L5
+p3Y3HSNpZpds5OdXf8j8RaVempZk42yaMs50EDFHzUJq81yjMHD/lrzy18PJzw01yZ2OGkLNgphm
+AYWt07c3ETt9zKBtgdNU5OYEG7Ut5bKVFRz687dYtqoyeeGTzGfBPVcNbNLnJ+yLaZNHcswv3zYd
+I65WuSEWTB1P65ZNe7T66VeXcs51H1NZnaAtmhNjBs7mKdIMqVlIXS8Bx5kOsaOrz+vNLZfrEEg1
+C5IqMtP9u4xKOI3E9uaiuE0GwaCPVeuqOOznb7FwmTffdW6I3Owgz9x1CEedP9N0FE87eWwHprz1
+g+kYcZ19Ylf+efNBpmMk3dcLtzDyTM9N9ZuGx6Y8izvULKSmV/HQkGB+bojn7x3ByKGFpqN4gpoF
+aUosoHXLNMoqwl6bT90o3Ttm8/KDh9Nr/Cumo3je8unH02v8VK+9s73NB0+MZXj/1qZjJN3aDdUM
++enrXhvJ0whDM2R+k25prGl4qFEYO7yI9R+crEZBpImygXWbalK6URh1UCHzPn5BjUIDdRj9PyZd
+3M90jHpdeOOnRCKp+3hsqIL8dGY9MpqenXNMR9nRKOAd0yHEXWoWUsvLwNGmQ4BzyNrPxnfijX8c
+YTqKiEi9zj6xK9M/Wk160ZGmo6SUK+/8nN7dWpiOEdeXCzbz4FPfmY7hii7ts5k2eSTDDsj30lSQ
+Q3FGGKSZULOQOj4DxpsOAZCR5ueu3w3g8dsPNh1FRKRef7ywD/+cssh0jJT10HVDTEeo13V/mcuq
+dVWmY7iiS/ts/vfAYVz6sx4EA55pGY4AvjQdQtyhZiE1zAQGmQ4B0Kk4k3cfG8Nlp/c0HUVEJC6f
+BQ9PGsINHj0zIFUc/ou3OH18Z9Mx4iqrjPCbP39uOoZrCvLTueXyA/n3zcOcs1a84QA0JalZULPg
+fZOAkYYzYAHHjWzLkreOZ1CfpnmKpoikvsx0P/974DDOu/4T01GahDt+25/cbG+el/PUq0uZ+fEa
+0zFck5UZ4GfHdWbpmxMY2s8zr8OH4lynSBOmZsHbRgLXmw5hAROOaMdLDx5uOoqISL1a54WY+e/R
+jL/Im+cEpKKiw//Ln351gOkY9bropk+prfXmrk3Jkp0V5OOnj+LoEcWmo2x1PR54U1OSR82Ctz1v
+OsDWRuHFBw4zHUVEpF7dOmTz4ZNHMvS0101HaXIuvvkzBu7f0nSMuL75voy7H11gOoYR0yaPZNRB
+ntmJ0Pj1iiSPmgXvegPINxnAAsaPbKtGQUQ8bXCfVnzwzAl0H/ey6ShN1kN/HOyl3Xh2ctPfvmLZ
+ygrTMYx46YHD6No+y3QMcK5X3jAdQpJDzYI3PQ6MNRnAAk45qoOmHomIp40bUcynX22gYPhjpqM0
+aQed9gbn/aSb6RhxVVZHufy2OaZjGJGVGeDDJ4+kfWGG6SgAY3CuX6SJUbPgPZcBp5kMYAFnTOjM
+s3ePMBlDRGS3Jh7TiVffXWk6RrNx9x3Xk++dnXh28t/pP/DqO83zsVCQn847/xlD57bGRxgs4FSc
+6xhpQtQseMsg4M+A31QAC/j58V149NbhpiKIiOzRead048mpS0zHaFayOp3BHb8dYDpGvS7902dU
+VUdMxzCiS/tsZvx7FF3aGW8YgsAteGS7d0kMNQve8m8gzVRxCzj9uM48csswUxFERPbo17/oycPP
+LTQdo1k66w8fcXD/1qZjxLX4hwpu+8fXpmMY06V9Nh89dSQH9MgzHSULuN90CEkcNQvecRTQz1Rx
+CzhqRDH/uU0jCiLiXddf1Je7HvnGdIxm7aHrBuP3eXO58+3/mM/CpWWmYxhTkJ/OB0+MZUAv47tX
+DQOGmg4hiaFmwRuyMbzt2BEHFTJt8kiTEUREduvO3/Zn0oPzTMdo9g48aRqXnd7DdIy4asIxLr1l
+NrZtm45iTFZmgDkvHM2IgUZHgCzgVZzrG0lxaha84VMMPqGOObSY6f8aZaq8iMhuWcDk64fwmzs+
+Nx1F6tz96DcUt043HSOu195bxZQ3fzAdw7h3HxvLOLMHt+UDH5sMIImhZsG894FepoqPOqiQqX8b
+aaq8JFH/Xnm08ujOJSIN5fdZPH77cM6f9InpKPIj91w10HSEel1+22zKK8KmYxj3qvmD23oDM00G
+kH3nzUmHzce9wK9MFT9sUBve/s8YU+WbLKvPU6YjAOw0DP/NK+NZtqqC5asrt39cWbnt99W1MYNJ
+ReILBX08e/chHH/JO6ajSD3GDCti+sdrTMeI68qzevFnD+/e5KbRZ89ghtn/pxuASSYDyN5Ts2DO
+ROBJU8VHDimwZz4yWv//SeDFZmFPtrx7IYvWfM+yVZUsX1XhfNyhsVi5topY850CLAaEgj5evP9Q
+xl0wy3QU2Y0FU8fT74RXCUe89wMi4Lf4cso4enfPNR3FEyZc/DYvzzJ6FsURwCyTAWTv6GLRjAKc
+eXydTRRv0zJtxdr3TmpnonZzkIrNQkMse+v4uiZi52Zi6683bqlNaD1pvkJBH1PuG8GxF75tOoo0
+wB8u6MOfHvbmlqWHD27DzEdGY1m63AE45oJZTHtvlany3wI9TRWXvadnj/uygPHA04bqf2OXTDS2
+RqI5aKrNQkNoupPsq2DAYsp9hzL+IjUKqaRz2yyWrqo0HSOux24bxunHdTEdwzMO//lbvDN7nany
+g4HZporL3lGz4L6uwGeAiU2Q1wNd7JKJzXcTahc052ZhT0rfvZCFmu7J3cb+AAAgAElEQVQk9QgG
+LJ6/ZwQTtEYh5bz0wGEcf+m7pmPEVZifzjevHEteC234AFBeEWa/Y15h9fpqE+XXAkZXXEvjqVlw
+313Arw3UDQPH2SUTXzNQu1lRs7BvNN2peQr4LZ6/d4QWM6ewCUe0Mz0nvl6X/N9+3H/tYNMxPOP1
+91Yx/qK3iUSNvE5cDtxnorDsHTUL7joBeBRo4XLdKHCDXTLxRpfrNktqFpJP052aloDf4tm7D+HE
+y7z5zrQ0zPdvTKD3cVM9+fzzWfDZc0cxYP9WpqN4xk1//YpJD84zMZq7BjgNLXZOGWoW3NMZp5Oe
+YKD2G3bJxCMN1G2W1CyYV7rgThbOe0vTnVKA32fxzF2HcPLlahSaglsuP5Br75trOkZcB/XL54Mn
+x+Lz6dJnq8E/eY3ZX28yUfoRnO1Ul5goLo2jZ4x7LgDuATJcrjsHOFzrFNyjZiE1aLqTeT4Lnrnr
+EE654j3TUSSBenZuwbdLvfmS8/CkIZz3k+6mY3jGkhXljPzFdBOL0yuAi3FmW4jHqVlwz39xpiG5
+qQroZpdM9OYk0iZKzULToelOyfWvmw7irD98ZDqGJNhb/xzF2HO9eWhvq9wQC6aOp3XLNNNRPGPW
+J2s48ryZJs7KmAKc7HZRaTw1C+44AXge8Ltc9yS7ZOIUl2s2e2oWmg9Nd9p7d105gF//eY7pGJIk
+p43rxDOvLTMdI65zT+7K3288yHQMT7nhwXlMeugrt8tGgZ8CL7hdWBpHzULydQFeB/Zzue4Su2Ri
+Z5drCmoWZGea7rSra8/vzc2TS0zHkCRaMfMEeo2fSnllxHSUuD54YizD+7c2HcNTig//r4ntVD8H
+DgPK3S4sDadmIbm6AA8AxxiofYRdMtGb48BNnJoFaazmNN3pl6d256/PfGc6hrjg3qsGcsXtn5uO
+EVf/Xnl8+sxRBAI+01E8Y9YnazjirBkmSk8GfmmisDSMmoXkKQCuwVnAE3C59g12ycTrXa4pddQs
+SKJtne406Cevm46yT356dEeenrbUdAxx0YE9WzL3282mY8R139UDuez0nqZjeMqkB+dxg/vTkcLA
+2cDjbheWhlGzkBxZwETgL7i/+9Esu2TiSJdryg7ULEiyWFbq/sg+6pAiXntvlekY4rL3Hx/LiDPe
+Mh0jrhZZARZMHU9RG7dfpr3tkJ+9yQdfrHe77EZgHPCJ24VlzzT+lhxdgN/hfqOwWI2CiHjNwf1b
+q1Fopg45/U3OOrGL6RhxlVZE+O2d3pwmZdLrD4+kuHW622VbAbcD2W4Xlj1Ts5B4IeAUwO2NnGuB
+A1yuKSKyW3265TJzpjffWRZ3/PKIQbRsETQdI64nXlnKrE/WmI7hKdlZQV68/zACftdHMkcCx7ld
+VPZMzULiHYGzTsHtZ9l9dslE7SYgIp5RmJ/O1L8dTijvQNNRxKChlz7HbVf0Nx2jXhfd9Bm1tVHT
+MTylQ3EmE4/pZKL0PSaKyu6pWUisPOBUIN/luuuAh1yuKSJSr8x0P688dBidxvzPdBTxgPMnfcLQ
+fq1Mx4hr/uJS7vnPAtMxPCU/N8Q5J3ejRZbb+7NQCBzldlHZPTULiTUK5wA2t0cVLrNLJn7vck0R
+kbgs4Mk7Dmbwqam9e5Mk1kPXDcHn0TX6N/71K5avqjAdwzNCIT+Derfkjxf2NVH+HyaKSv3ULCRO
+CGdUoaXLddfZJRO9sf2OiAhwz1UDOf6Sd0zHEI8Z9JPXuPA0t88nbZjK6iiX36YTxXeUnRXkzBO7
+kpvt+nqT9sBQt4tK/dQsJM5IYCzujyqMc7meiEi9Lv1ZD35162zTMcSj7vvXOxS0SjMdI64pb/3A
+tHdXmo7hKfl5afzn1mEmSj+GdkbyDDULiXMOzpoFN62xSyZ+5nJNETFg+vTppiPs0XEj2/KXxzX3
+W+rnTy/irt8NMB2jXpf+aTZV1RHTMTxlwqj2dO/o+nV7D7QzkmeoWUiM3sAw3P9+nuZyPRExYPPm
+zZx11lmmY+zWwP1b8tLMFaZjSAo4/fcfctigNqZjxLVoeTm3/3O+6Rie8/Sdh5g4xfd+90tKPGoW
+EuMMoK3LNefYJRNnulxTRAy47LLLWL58uekY9Spunc7LDx1mOoakkIf+ONjEPv4Nctvfv2bRsjLT
+MTxlUJ9WHHu425c55AMnu11UdqVmITF6Am7uL1YFnO9iPREx5IUXXuCxxx4zHaNewYDFC/cdStuR
+L5qOIimkz4RX+fUvepmOEVdNOMalf5qNbdumo+wFa4cb2LEYdiyKbcdg29ezd03a/dcOIi/H9cXO
+d7pdUHblzbY+tYwEXsa9hTgR4BK7ZOLfXKonjWT18cbmVKn5Qic7WrNmDX379mX9+vWmo9Tr4UlD
+OO/6T0zHkBTVoSiTH9ZUmY4R1wv3juCksR1Mx9gz28aORiBSix0NA7bTGMSixKIRsGNgWViWHysQ
+BH8QK5iG5Q+C1bjLwKdfXcrPr/6QcMTV1xddqxqmkYV91wN3V+w/pkZBpHm47LLLPN0oXHBqNzUK
+sk/uu3qQ6Qj1uvy2OVRUenixs21j11QSLV1LdNMKIptWEtmyhsiWtURK1xEpW0+scjOxyi3EKrYQ
+rdjo/N3mVUQ3riRaug67tnqHEYc9O+2YTvzmzF5uX71Pcrec/JiahX13o4u1vrBLJnp7laOIJMRL
+L73Es88+azpGvYYfmM/fnlloOoakuJN+9S5Hjyg2HSOu5asruelvX5mOEZ8dJVa5mcjm1UTLNxKr
+qXRGFWLR7Tfb3qERqPu1HYNohFhtJdHyDUQ2riRWvhGi0QaXvvWK/gxx9zRu1+c+yc7ULOybkThH
+k7thHXCsS7VExKDS0lIuuugi0zHqVdw6nefvHWE6hjQR918ziLSgNy9H7nrkG75euMV0jJ3ZNrGq
+cqKl67HDjRsZ+PH92JFqImXriZSvq5vC1DC3/7q/mwvUtfOjYd58dqaOJ1yqEwP+bpdM1L6EIs3A
+Nddcw4oV3ny6a0GzJFr3cS9z9Xm9TceIKxK1ufjmzzy1BsyOhIlVbG7Uxf1uxaLEKpypSsRiDfon
+I4cWcvyodompv2cpsHCkaVOzsPd64952qd8Bd7hUS0QM+uCDD3jooYdMx6jXA9cOZvj/vWE6hjQx
+1z84j24dvHlg76xP1/LkK0tNx9guXI1dm+BF4bEosapS7Eg1DV1PPHZ4MekhVy4jg8AJbhSS+NQs
+7J0Q8G+XatnAq3bJxE0u1RMRQ2pqajj33HM99S7mjs46sQvnT9KCZkmO+6/17mLn3975OVvKak3H
+cKYgRWuT8jPCjtYSq6nEmcywZ0eNKOL4Ue0TnqMeD7pVSHalZmHv9ADc2iC6lFTdZ9jazU1EdnHr
+rbcyf753T4/915TFpiNIEzbuglmcNMa1i89GWb2+mj/eP890jOSK2RAJOx8boHO7bH750+743HlN
+b4t7113yI2oW9s5VQI5LtRakzFqFrY2A3wKfRTRqUxO2qaqJbb/VxghHbGzLgoDlPALVPIjw9ddf
+c8stt5iOIWLUvVcNJDPdbzpGXA88+S1fzDc8yG9ZWP5Ao89HaJi63ZKcQg36FyOHFtKzS4skZInr
+P24Vkp25eepwU7EfMAT3LnEfAYa6VGvv1DUJtbU267dEWb4uzPpNUVasj7B+S4TqcIxY1PmcoN9H
+iywfbVsHKGoVoF3rAMX5ATLSffgsa+93dRBJYbZtc8kllxAOJ2jBYhJ4dWqUNC0dRv+PSRcP4Hd3
+fWE6yi5iNlx446e8/8RYfC69nR6PFUjDCgSxwzWJvmew/HVXNw1/vo8ZXsT8xaUJzhLXACAP2OxG
+MdlOzULjTQS6uFSrEngR8OZqRwuiMVi3KcK8xTV8Or+Kb5fXsnJ9hNLKKJU1MWrCENthSNOyLAIB
+yAj5yM6wKMwL0Lk4yID90hmwXwadiwJuLZgS8Yznn3+emTNnmo5RLzUK4qYr7/ycR17M5etFrlyA
+NspHczfwrymLOfeUbsYyWME0rPRs7EhtYt9g8/mwgmlgNe41+KB++dyfuBS7EwCmAKPcKSdbaQJI
+4z0L/MSlWpPtkokXuFSr4SyIRGDVhjDvzqtkxuwKvl5ay+ayKLUR25nuaNtY9QyT1v21MyBhgd8H
+WRk+OhYEOaRfJkcOyaZnxxAZaVZj3tzwDKvPU6YjALrASxWVlZX06tWL5cuXm44S18KFC+nWzdyF
+kTRPbz86hpFnTjcdI6783BALXh1Pfl6asQyxcA3RLWuwqytI1AulLy0bf16h0zA0wqp1VfQ85hXK
+3Dvt+ghgllvFRGsWGmsQcKhLtSLA0y7VahgLbAs2lkaZ+mEZf/jHWu54cgOzvqhkzcYItRHnB5bP
+Ap/PwucDvx/SgpCTaZGXZZGTYZEesgj66+7PhkgMSitifLWkhn9N28zv/7aGyS9tYtEPtURjqKWV
+Ju3WW2/1bKMAqFEQIw7/xVucPr6z6RhxbdhSy9X3fGk0gy8YIpDTGl96TqNHAnZlYwXT8WXlYQVD
+jf7Xfp/FgP1b7mOGRrnVzWKiy7DGGgm8iTvTt54FzrFLJpa5UGvPLAhHbb5dVsvT00t587Ny1m+J
+Om9oWM4Igc/afp6LZYHPBwG/RU46FOX5aJVjkZtlkZVuUVVrs3RdjJUbY2wstakOOw9Gn895Rzw9
+zWJgjwx+fmQew/tlkJ3uS5lRBo0sSEMtXryY3r17U1OT6LnHiaHHkJi0+u0T6TV+KlvKvbmW58Mn
+xzLswNZmQ4RriFaVOmckhGudBcqNWPxs+XxYoQz8WS2x0rP3uvF49Z2VjL/wbTdfpnX96iJvbjng
+Xb8GhrtQJwrcYJdM9MYKLwuqam1mfV7BA1M28ebscsorbay6WUI2zs+nmO2sYYjWfYzFIBKFqlrY
+UGqzttQmZtt0au3j8L5Bxg8JMmQ/P0V5fizLorzaprrWWdcQicHytRHmfV+DhUXHwiCZGanRMNzw
+0FemIwAwadIk0xFkD84880y+/vpr0zHiUqMgpmV3Po2cyv/x6rurTEeJa07JJs45uavRxc74A/hC
+GfhCmViBEJbPudh31ihbxH3RtHxY/gC+tEz8WS3xZbXCCmXu0wiF32fx9LRlVFS5NhXJQlORXKPO
+rOHygHeBvi7UescumXiYC3X2zILasM0bn5bz4Iub+HZZ7bY1Bz4fpAUgIwgt0iErzfm9z3KmFpXX
+wOZKKK+FmvD2dVhBP3Rv62fCQUEmDA2Q38LH4tUxPvg6whufh5m3NEp1uG6kwobWuX4mjsnljCNz
+aZ3r93zDoJEFaYjXXnuNcePGmY5RLz1+xCsG9W7FHNNbltbjL1cP5NLTe5qO4bBtsKPEImGIRiAa
+xo5uPTehbhqA34flD0EwhOUPYvkSsw1rRWWEx17+ngtv/Gyf76uBbgauc6tYc6dmoeFGAS8BWUmu
+EwVusksmTkpynT2rm1b03rxK7n52A/MW1YAFLTOgewF0bQOdW0FBDuRlOg1DWtA5ZiEchdJq2FgB
+q7bA3BXObdVmZ+QBoEWGxZj+Ac47Ko0e7X2Ew7BgRZT/fRRm6mcR1m6OYdVlyM/zc9a4PE4fm0uL
+LG+PMKhZkD2pra2lX79+fPvtt6ajxKXHjnjJx08fyfCJb3ryx36LrAALpo6nqE2G6Shx2HF2S6q7
+7EvCOQ3zvt3M0J++TnVtw06A3kffAPu7UUi0dWpDWcBoINOFWouBR4FJLtTao4Uranns9c2ULK4h
+6IfBneDEAdC3LbTOhsygM1JgWXU/gnb4+WPX/ZyqjcLmKvh6JUz9Ct7+DrZUQVmVzdTPIpRX2Vw2
+IY39O/jp18lPh3wfXQt9PDK9lsVrY/h8sH5zlKenb6E4P8D44dkEA6m5U5IIwOTJk9UoiDTQQae9
+wXlTuvPwc4tMR9lFaUWEK+/8gsdud2OGcmNZSTq8Lb7e3VpwzGFtmfLWD26UK3ajiDi0G1LD9AWO
+xp2RmPfskonfu1Bn9yxYvyXKszNLef+rKgJ+OLoP/P4oOLYvdG8DeRlOo2BTt15h65qFutvW4xVC
+ASjMgcN7wJVj4eLDoVMrtk1xevurCH+bVsuytc67EXk5FiceHOTS8Wl0LXQeon4f/LAuwlNvlbJg
+Wa2Z74lIApSWlnLjjTeajiGSUu6+43rycxu/U48bHn9lCbM+WWM6hnF+v48TRrd33sxLvmycQ3LF
+BWoWGqY/0M+FOlE8siVYeXWMl94r48V3y7BjNsf2hUtGQq9i58I9Zju3Pb0HuXV9w9bGobAFnDYE
+LjkcuuQ7f1YbgZlzIzz5dpgtlc6dZgQtjhwQ5JdHp9G2lW/buQxzF1Xz6ofllFbGNIlOUtKdd97J
++vXrTceIS6MK4lVZnc7gjt8OMB2jXhff/BnhsCvTbzytf6+W9Nsvz41SfuBqNwqJmoWG8ANjgKAL
+tcrtkonG5yZEYjaz5lTy6GtbKKuMMqYXnDcCOrdmn6f+xGxnEfTR/eCsg53mAQsqamxemx3mvZKI
+M8XSctY/HDUwwKkjgmSmOZ1Bbdhm+pxyvltek9CDK0XcsGrVKu666y7TMeJSoyBed9YfPuLg/oa3
+Kq3H14tKufexBaZjGNd3v1yOHlHs1nt5I4DO7pRq3tQs7FkBcIJLtYzvD2cDJd/X8Ohrm1m5PsyQ
+TnDmwdCtIHGnyts2hOqmNY3r6zQPFrBiQ4ypn0VYsWH7qEFWusW4wUEGdvM7ezlYsGxthI++rt52
+CJxIqrjxxhuprKw0HUMkZT103WD8Jrcq3Y0bHprH8lUVpmMYZVkWo4cVkpnhys78XYFfuFGouVOz
+sGe5QAuXaj3vUp34LPhhfZh/v7qZLxfV0KU1nHGQs5g50WzbWfNwUn/Yv8hpAqI2fLYwymffRYlF
+2dYwdGjjY0z/ANnpTjNTG7aZ8201W8qjiQ8mkiQLFizg73//u+kYcWlUQVLFgSdN47LTe5iOEVdF
+VZQrbp9jOoZxA3u3oku7bDdK+YFhbhRq7tQs7JmbawjMXf1aUFEd479vlzHz80qyQzanDIQR3Z01
+Csm4lojZ0K0NHNXHOavB54MNpTE+WhBlU3ldQdtZIN2vo5/2+XVrFyxYsrqWDaVR58wZkRRw7bXX
+Eo16r8FVoyCp5u5Hv6G4dbrpGHG98OYPvPbuStMxjMprEeKIgwrdKjey7iZJpGZh9yygvVvF7JKJ
+17tVa9fi8NFXVbz0fhnVNTFG9YLjDoD0YHIaha0CPji4K7Rv6WSI2fDlkig/bNi5aHG+Rbci53wF
+GyitiLJ2U1Tbp0pK+Pjjj3nhhRdMxxBpMu65aqDpCPW65E+zqa7x3hsDbjppTHsCflfezUsHitwo
+1JypWdi9vrh36MdHLtXZlQ+WrQ3zwjulLF0TplsbOHUQtMnevotRMrXLhQPbO52ZZcGqjTG+Wxkh
+ssPP2sx0i1YtfFg+5/Nqw7B6Y0S9gqSE667z5kGjGlWQVPXT37zPaPfevW6URcvL+fM/55uOYVRO
+VpDWLdPcKvd7two1V2oWdq8/4NaxjGa2ALMgHLaZ9UUlH8+vJi0AEw6EPm3dedPeBtJDsF8BhIJO
+s1BWbbN4dYyaSN1+qXUfAnWHvznnOthU19jaEUk878MPP+TNN980HWMXahQk1T143WC39vRvtFse
+LmHRsjLTMYwZ1KcVhw5q41a5ArcKNVdqFurnBwbgzvdopl0ycaYLdeJa+EMtr31czsayKP3bw+he
+zg5Fbgn4oGsbyEmvO5MhBj9siFFVvf1zLJz/CGuH3/v96KwF8bybbrrJdASRJqnnsa/wu7PdGvxv
+nJpwjMtumd2sm/K+3fPcauaK0LqFpFKzUL8C4EgX6kSBk1yosysLqmpjvPNlJXMX1ZCb7iw2bp+H
+q2sBLAtyMyBzh8M5f1gPpVXbQ9hAJMa2w9n8PoucTJ96BfG0Tz/9lGnTppmOsYvmfAEjTcvNk0vo
+VJxpOkZcr767ihen/2A6hjETj+3k1q5IPiDfjULNlZqF+lm4s2XqUrtk4iYX6sQvvirM9DkVlFXF
+6N8ehnWBYMDddcMWzkhGZsja9vuyqhg1YXvbJ4SjUFljO6dG25AWtChsGcBStyAeplEFkeT7yzWD
+TEeo1+W3zaGiMmI6hhH7dcphSL9Wbr2pd7o7ZZonNQv1Owh35sHd7UKNXVlQE7H56OsqSr6vJTcD
+Du8J7Vw5pX1nNs5UpIygva1JCUec6UhbbSm3WbXJ3rZ1ama6j7wsPXzFuz7//HNefvll0zF2oVEF
+aWomXPIOx41MwoFACbBsVSU3T/7KdAxjrjq3N+lprhzQ5s3hpSZCV1v1ywKCSa4RBUqSXCM+G9Zv
+ivD25xWUV8XoWQiDOyZ/q9T6bN0JaWu3YNs7j25sLLNZtck52dm2oSg/QE6WpiGJd918882mI+xC
+jYI0VfddPYj0kDcvae565BvmL9piOoYRPTrlUNzGlTMxvLuXbhPgzWeWN3Ql+d+fTcCSJNeIKwrM
+W1zDvO9rSQ/CwI7QsZW5RiFqQ23U2mkFs1X3MRZ1FjxvLLOdRc4WdGsbIi/Hr3MWxJPmzZvHlClT
+TMcQaTa6HPkS113Y13SMuMIRm4tv/qxZNuuhkJ8/uvP/Etrzp8jeUrNQv+Eu1Fhsl0z83oU6u6iu
+tvmopIpNZVHatHDOOchOc+dchXhqo1BVa2/rFXY8y6Wy1mbBDzG2VNpYPkhP89GjY4hQUOMK4k23
+33676Qi7aI4XKtK8XHPvl/TolGM6RlwzP1nLU1OXmo5hRKe2WW7MAkgDXFlN3RypWahfshc324Cx
+bRJWbQwz57tqYjZ0bgU9CjC2WNi2oTYCVbXb/ywt6KxjANhUZvPVsijRqPO5BXl++nZJI+BTsyDe
+s2LFCp555hnTMUSapQevG2w6Qr1+c8fnbCmr3fMnNjEjhxa6sW7BD3j3Pz/FqVmonxubNz/hQo1d
+xID5S2pYvi5MWgB6FUFhrrlRhZgN68qgcoefoS2zfWSkWdg2LFwV49uVUeedCRt6d06jbWvthCTe
+9MADDxCJeGv3E40qSHMx5pwZjB1eZDpGXKvXV3P9A/NMxzAiPS3pl5s+tMg5adQs1C/ZK3JiwMYk
+19hV3YnN8xbXUFFpk5MOPYucMw6MrVeIwffroaIGfHULmDu0scjJsqissfloQYQNpXbdLkgWQ3tl
+0DLHld0VRBqloqKCyZMnm44h0iwtnHYcJ45uz5sfrjYdpV73P/EtX8w3tlu6Mft3zU12CQs4OdlF
+mis1C/GNJPnNQgT4LMk14iqrivHt8loiUZv8LOjW2txByDZQFYYlG5yzFGzbOZm5KM8iFITl62w+
+/CZKNOZspdq1OMSA7mmEApYWN4vnPPLII2za5K0LAY0qSFMXrV7Nb8/an94TpvLijBWm4+xWzIaL
+bvqUmKmhfENaZCd7c0ksdDBb0qhZqF+yr59r7JKJZUmusSsLVqwPs2pjGCxone3cTLEs2FAB36xx
+fm/bkJNh0aXQj9+yeH9+hMVrogAEgxbD+mTQqVibHoj3xGIx7r33XtMxdjJwoHYTlKbtr38cQlFx
+J+565BvCkdS4AP/wyw088uJi0zFcNfzA1m6U2R8tck4KNQvx/cqFGmZWOVkWqzdE2FwWw29BcR60
+yDC3XsGOwaJ1sGpz3e+B1i0sOhX6WLclxltfhKmudfJ1aBPg0H6ZtMjyaVRBPOeVV15h4cKFpmPs
+ZPbs2aYjiCTFjH+N4oAeeVx002es35x6i4Z/d+cXbNhcYzqGa7p2yMKFPUmKAG9uh5Xi1CzE50YL
+PMeFGruyobTSpiZs4/M5owpZhtYrgLNl6pxlUFa9/VC2Hm39tGlhMXNuhPnLY9g2BPwWw/bPoE+X
+NHNzpkR245577jEdYSd5eQaOYxdJsu/fmMApR3Zg9Dkzmfdd6h50tmFLLdfc+6XpGK7Jygjg9yf9
+xTsD54wsSTA1C/G5sf1WpQs1dhGL2mzYHCEStfFbkBE0t2WqZcHqUqdZiNpOw5IesujbyU9ppc1r
+s8OUV9t1C54DjB6cRatcv7M0XMRD5s6dy6xZs0zH2InX1k6I7KvrftmX/cdP5YU3je06nlB/f24R
+H89dbzqGKw46IJ/0UNI3JgkC5yS7SHOkZiE+N84mf9yFGjuzIBK12VweJRIFvw/Sk77maDds+Hw5
+fL/BmVUUs6FtvsV+7ZxRhZJlMWI2pAUtDj0wk0G9XDkyXqTR/v73v5uOsBONKkhT8vw9I+hYnMXN
+k0uoCTedd4ts4KIbPyMabTpfU30syyIt5MolpzeP8U5xahZ2NcmFGjawwYU6u4jGbCprnKk9Ph+k
++c3M6rEs2FgJb3/nTEHCdrZN7dvRR2U1vP55hLJq50Tnbu1CjD84h9xsv9YqiOdUVVXx+OPu9/67
+o1EFaQpKXjqG0cOK+Mmv32f5aiOD8Uk3Z/4m/vaMt9Y6JUNBqzQ6tc1yo9QBODtaSgKpWTCjyi6Z
+ONNE4VgMasLONbfPgoCh4wos4Mvlzi0ac6Ygtcz20akgwPtfR7YdwpaT6eO44dkc2DVNjYJ40nPP
+PcfmzZtNxxBpUn5zZi8OPPE1Zny8xnSUpLv2vrmsWV9lOkZS+f0+Oha70iykoS1UE07Nwq6Od6GG
+0Z8K0aiNbdvOtbeBBQs+C0qrnVGFteXOn1k+6FAYpLQ2yLvzo9SGnfMWhvXJ5NiDswmFdK6CeJPX
+piDpXAVJZU/feQht22Rw96MLiDaTswi2lIe58s4vTMdIup5dctyayXC6O2WaDzULu3Jjsq+RUYWt
+/H4LLAs7BjUR96/BLQu+WgmfLIHaiPNnWek+Wub4mf1dLWs2xbB80LkwyM/GtKBt66AaBfGk+fPn
+895775mOIZLy5r98LKOHFTHxyg9Ytb7adBzXPfbyEt7+dK3pGEl15MHFZKS7Mp1BCxwTTM3Crtx4
+kJW4UCOuoN8iN8tHwHK2Ld1S6e62qT7LqTnjG1i2yZmOZPkgO06+p40AACAASURBVMNizcYIC1fU
+YtuQm+Xj1FG5DO6V4cbezCJ75R//+IfpCDvRqIKkomvO78OBJ01rFlOOdufqe5r26IJluXKSM0Bv
+N4o0J2oWduVGszDLhRq7sp1TkDsWBgmFIBKFpRtsyqpx5YLcwmlMZi+HdxY6oxpW3bqJaBSWrglT
+U2sTClocc1A2xx2STUaaOgXxppqaGh599FHTMURS1rTJI+naPptb//51ypy+nAwBv8XFE/fjfw8c
+ZjpKUo0cWshhgwrcKBVyo0hzEjAdwIOSPUYWM7W4GcDyWXRvH6JVToDSijALVsPi9TCwI0mf6mNZ
+sKoUps6DpRt26FRtiy0VMcIR56C44X0y+NmRuRS2DGj6kXjWSy+9xIYNRjY1i0ujCpIqVs46gctv
+m8Nzry83HcW4k8a059YrDqRH5xamo7iia4cs6s5fTSY1CwmmkYVdJftBZvZ8d9ume9sQ+7UP4bNg
+ZSl8uhTC0eSudbZwany4GN5f5OzKtLVeNGYTiTo/Og7olsY5x+bRs0Na8sKIJMATTzxhOoJIyvnr
+H4ew//ipzb5RGH5gPu8/PoYX7ju02TQKABec2h1f8qcyqFlIMDULu0r2hLpwku9/92zIy/FzcJ8M
+MtN9lFc7F+9L1if5wWDB8k3wyjzYUOGc8bAtUt3pzft1CHHeca04qE+G8/d6o1Q8avPmzUybNs10
+jG00qiBeV/LSMRwyoA0X3fQZpRUR03GM6d4xm+fuPoT3nxjLwQPamI7jus7tsgkGkt4smDxutknS
+NKSdXUDyzygzflSj3wfD+mbQ9b0Q8xZVM28FvDEfivMgM5ScBc9VYXjja5izLP7fdykOcf5xLTli
+QCZBv7ZJFW+bMmUKtbW1pmOIpITrL+rb7NcltM4L8ccL+3LBqd0JhQwdcOQRwYCP6tqkXgqFgGJg
+VTKLNCcaWdhVspuFsiTf/x5ZQJeiEOOGZZGd4aO0Cl76Et5fCJFYcr4BJSvh5XlQWbP9/u26MF2L
+Q1x4fB7jDsomXecpSAp46qmnTEfYRqMK4lUfPDGW/bu24Ma/ljTbRiE95OOqc/dn4WvHcenpPZt9
+owAQCib90tMCDk52keZEIws7c+MgD080aGkhi3EHZTPnm2qmf17B4g3wyIeQkwaDO0PQD4k4D8ey
+nF2Ppn/jTHXauk7BtsHns+jVMcSFx7dk9KAs0tQoSApYs2YNM2bMMB1DxNMuP6Mnf3n822b7I90C
+zpjQmZsvO4AO7pxcnDICAVcugw4HXnCjUHPgiQtXD8l0ocbHLtTYMxvatwlyxlG59O6Yhh2DOcvh
+3pnw5nwoq3GmK+3tomcL598DfLPKWdgcqRt1jMUgGLAYtn86v/1pK44ckkVaUI2CpIZnn32WWMz4
+bEIRT5r+r1F0aZfNfc24URg7vIg5zx/No7cOV6MQR7uCDFfKuFGkudDIws4KXaixwoUaDeL3/T97
+9x0nVXn2f/xzn2nbO2XpZelVEQRBUECxYGwxdo0aEzWKMYklz2M01ZIY8/gzRo3RGJNI1MQSO1JF
+mjQpC0jvS9tep53z++PsLkyApc3sPWfmer9eWJZl5svszDnnOtddYET/VG67JJfn3ilj084Ay7dD
+aQ1s2Afn94eebcDnbpyETMvzGZRq3GRN2YVBSQUs2QYfrLSXZ7Usu1uRm2kwaXgG15+XTb9uXlyx
+XIZJiCiTIUhCHNmdV/fihTc36o6hzeDeOfzmR0OZNKZQd5S4lpbaKkOxTmuNJ0kWUixEao0N2eYA
+97TC8xybBT6PYtLwdJRl8dKHFazb5mdrKbwyH77cCqN72nsw9CyAzFS7cHAd4dretOwdoWv9sL0M
+VuyCRVtgxU7YX23/vtuAPp28XDk2i4tGZVBY0LiPglzvCIfYtm0bCxYs0B1DiLgy85Xx3PbTL9m6
+u1Z3FC06tk3ll/cM5qZLu+FyyYCNY7lhcne+WHYg1k8j17dRJC9mpFh/yk1gfoyf48RYkOpTXDAy
+g5xMg9c+reLLtfXUNph8uRXWlED7bOiaB11yoXsB5KaBx23v+mxZ9k7QVQ2wtQy2l8K2MthVAVX1
+dpHgMqB9rouxQ9K5dEwmQ3r5SPMZcbAulBAn5r333tMdodkLL7ygO4IQ3H1db56bukF3DC0y09w8
+dHt/fnBjH9JS5XLqRLTCxmytMaw8acj4j0hlQG4MH99vFV8bn7uNKQiFLXbsDfLxwlo+XFjNlj1B
+GoKWPRlZgdcAn8ee/Ox22cONLAvCpr3hmj8EgRCELVCW/T15WW7O6JvK5JHpDOubSn62C6MVjhI6
+qQHxMUxFhqhE3/nnn89nn32mOwYgP1+h18Kp53PTQwvYsL1Gd5RW53YpvvetIh69ayBt8lpjQELi
+cQ2cGpVFVFpQQWyv55KKlMKRYl08BYH4LBYscBuK7h283HKxh7FD05j9VS0LiuvZWhKgstYkELSo
+9tsTlGmcw6Cw/6GU3UHweCDH56JDvpuhvXyMHZLOkF4p5Ga6cDdttCbXOMKBqqqqmD17tu4YQmj3
+8PcG8PhLa2J9sReXrpjYicfvG5JUuy7Hgsdt4A/GdHiBjF2IIikWIiX8hmzHZEGqVzGgh4/eXbxc
+MTaLDTv9rNsaYOeBEHvKQlTUhGkIWpiNezK43YrMVIP2eW46FLgo6uilX1cfHQrcpPqMgy9qEp5Y
+ROKYNm0awaDeDdibSFdB6LDug8lc/8B8lq0t1x2l1Y0aks9T95+WlLsux4LbrfDH9nAq17dRJC9m
+pFifgeO/WGikLPC6FB0K3HRo42bckHT8QYuq2jA1DRbBkIVpNS6R6lKkehXZGQbpKYa93KpS0dmo
+QYg48f777+uOIIQ2Lz46gvueXEa9P6w7Sqsq6pLB4z8YwpXnd0bJyn1R43EbQEzfS4653nICKRYi
+xXqCs/OWSThk2JDPo2iT56YN6vAeTPPaqhx7jVUhHCYcDvPRRx/pjiFEq/vy2av49TsL+M+suFn1
+u1UU5Hh55M6BfO9bRbLrskh6UixEivUtE+ffkjFBxhOJZLNo0SIOHIj5Un/HRYYgidYy6y8TuOGX
+C9i9v153lFbjcSvuvaEPD98xgOxMr+44QsQFKRYixbrHKD1MIRxIhiCJZPPInQP51QvFSXVr6KKz
+C/n9Q6fL5OVWYBgxvxySYUhRJMVCJOksCCEOM23aNN0RhGgVO2dexrX3z2uNTbPiRu+umfz+odO5
+aGwH3VGShhn7OY3OG/Ydx6RYiBTrgYky8FEIhykvL2f58uW6Y9ClSxe2bdumO4ZIYJ/+6VxueHA+
+ByoCuqO0isw0N4/cNZAp1/eWeQlCtECKhUixbltJW0wIh5k7d25czBO44oordEcQCeyndwzk1y8m
+z7CjWy7vzuM/GEK7glTdUZKSDENyFikWIsX69ZDXWwiHmTVrlu4IAFx55ZW6I4gEtPofP+S+P7zO
+9IV7dUdpFaf3y+W5n57ByCEFuqMkNRmG5Cxy8RpJOgtCiAjxUCy0b9+eMWPG6I4hEsySNydx5f1f
+sL2kTneUmMvL9vLrewdz+zd74nLJdaQQJ0I+MUIIcRSlpaWsXLlSdwwuuugi3RFEgvnLr0Yy5obp
+CV8oKOC7V/Xk6w8nc8fVvaRQSCJW8bXddGdIFNJZEEKIo5gzZ05czFc477zzdEcQCeTeG/rw//6x
+XneMmBs+MI8//vQMzhiYrzuK+C+tNAypG7A11k+UDKRYiCTDkIQQzeJhCBLA+eefrzuCSAAV617h
+ym//DzMXJfb8hJxMD4/9YAjfvUqGHMUrtzvmP5dQrJ8gmUixECnW7145agnhIHPnztUdgaFDh5KX
+l6c7hnC4dR9MZvJdc9i0o0Z3lJi6YXI3nrp/qKxyFOdaqbMg17hRIi+kEEIcQV1dHatXr9YdQ4Yg
+iVM245XxXHnvF1TWBHVHiZl+PbL440/P4JwR7XRHEcfBFfulU8NA+1g/SbKQYiGSDEMSQgCwYsUK
+wmH9m65PnDhRdwThYC//8kzu+PliQmH9c29iIcVr8MidA/nRt/vKxmoOEo59Z8EFyPq4USLFQiQZ
+hiSEAGDx4sW6I+Dz+WS+gjhpP/v+IH7+R/3dsViZOLIdLzw6nJ5dMnVHESdIxbyxgAXsifmzJAkp
+FoQQ4gjioViQvRXEybr1ih785Z0tumPEREGOl6cfPJ0bLumGaoWrThF94dh3ulxAYk/QaUVSLAgh
+xBEsWbJEdwTOPfdc3RGEA11yTkc+mLNbd4yYuPnS7jx1/2kU5Pp0RxGnwIj9nAUTmbMQNVIsRJJh
+SEIIqqqq+Prrr3XHYOTIkbojCIcZO6wtc5ft1x0j6np0SudPPx/BhJFy/ZcIWmH7GgVIRRklcvEa
+Kdbr8sq6v0I4wNKlS7VvxqaUYsKECVozCOdY/Y8fcnq/vIQrFBRw3019WPnORVIoJJBQ2Iz10lwy
+ZyGKpLMQSToLQgiWLl2qOwJ9+/bVHUE4xN7PL+fan81i9cZK3VGiqn/PLF7+5ZmMHCKL2iSaBr9Z
+D3hi+BQW4I/h4ycVKRYixXqdRP3rMAohjqm4uFh3BEaMGKE7gnCAkjmXM/6WGazbUq07StS4XYqH
+vtOfh+8YgE+WQ01IYdNqjeshaUVFiRQLkWJ9VJKjnhAOsHbtWt0ROPPMM3VHEHFu9s9Gcdff1iRU
+oTCoVzavPT6Kof1ydUcRsRXrGc6yTFYUSbEQKdaDlBNzVxwhEohlWXFRLEhnQbRk9T9+yJTX17J2
+c5XuKFFhKHjoO/155K6B0k0Q0SJzFqJEioVI0lkQIsmVlJRQVaX3Aszn8zFs2DCtGUR8u+Xxv7Jq
+Q2LMUejbPZO/PjaKEYPzdUcRiUX2WYgSKRYimQ5/fCHEKYqHrsLQoUN1RxBxbMLI9iwpLtMd45Qp
+4L6b+/CrKYNJTZHLkSQjC8o4iHw6I0lnQYgkFw/FwuDBg3VHEHHqqkldmLlor+4Yp6xTu1T++thI
+xstyqMmqNRaUqYjxcyQNKRYiyWpIQiS5eCgWZNlUcST339KPf03boTvGKfvWpC688OhwcrO9uqMI
+fVpjgvPWGD9H0pBiIZK0xYRIcvFQLPTr1093BBFnXnx0BE+9uk53jFOSmebmuZ+ewQ2XdEMpWawm
+ycX85qwaMFU6C1EixUIk6SwIkeS2bNmiO4J0FkSEz1+byN2/XqI7xikZMSiPfz41mu6dMnRHEfFB
+hn07iBQLkWTdX3Fy5CebEEzTZNeuXVozpKSk0L17d60ZRPzYMeNSrrrvC0Jh5668/aNv9+Wxewfj
+lSVRxUGyoIyDSLEQSToL4vgosCz7aBQMWtTUmdT7LcqqQ7qTiVOwd+9egsGg1gx9+vTR+vwivlz9
+o3nsK/PrjnFSCnK8/PXxUVw0toPuKCL+xPr6U65vo0hezEjSFhNH19g9CJtQW2+ye3+IlZsb2LAz
+wKadQfZXhqipl5sZTrZjh/7JozJfQTR58Lb+LFhRqjvGSRlzegH/fGo0Hdul6Y4i4pN0FhxEioVI
+8uYVh1P2L38A9pUHWb3Zz7zV9Sz9up7dB0LU+03MxhEClnNHCgjio1iQ+QoCYMYr4/nNK/on25+M
+H9zYh9/8aCgej6zpIUQikGIhkrTFxEEKUAp/wGRrSYCFxfXMWVHPqs0NlFeHMS0wDpmrYFkgtYKz
+xUOxUFRUpDuCiAO3/O8i3RFOWHqqi5d/eSZXX9j1xP/wYfO+jjYRzDrifwohYkcuXiNJZ0HYGuck
+7NgTYOayWj5ZXEvxFj819SZKgTpkSJKFXTT4POB1y0xnJ4uHYqFjx466IwjNvnNlT3bsqdMd44T0
+6pLBu8+OpX9R9vH9gRbmfe08EKK8ysQfNDEjjrGKtrkuurX3kJ/pJivDwOVWGDQek6V4cBK53nIQ
+KRaE+G8G1DWYLFhdz79mV7FwTT0VNXaR4GrsqrsMRaoXcjMUnQoMCnMV3doZtM1WXOW8G4KikRQL
+Qre5f5vIy29v1h3jhEwc2Y43nx5z7E3WjnPeV019mEAQQiY0VQAK+7ib4lNkp7voWOChTxcvndu4
+6d/NR4cCN1npBileQwoHZ5B9rRxEigUhDmEBJftDvDu3infnVrO5JIBpqeYiAcDtgqxURftcRX6m
+IjdDkZ1udxbccnhytJKSEt0R6NWrl+4IQqM7f+6s/RTuub43Tz9wGu6WDn4nOO+rqXP739f7Coua
+BjhQEWbz7gBfrKolxWOQm2V3G07vncLwvin07uwlL8ttH7elaBDilEmxEEnaYkksbMLabX5e+aiC
+WV/VUlljopSKmJcA9sms1m+ydZ9i676DLXJD2YWEcK6ysjKtz5+dfZxDOERCevHRERRvqtQd47i4
+DMVzD5/B965uYY7NSc77Mo9wpmxqFhgGzR0Ky4L6gEndfpNd+wMsWlPH27kezujrY+KwdIb3TaMg
+12V/uxQN8UautxxEioVI0hZLRgoCIYtFxfW88F45S9c3EAjZZxaXglQvpHkPdg1cjcORDCPy7GNZ
+NN8dE85UXl6u9fk7dJD16JPZo8+t0h3huKSluHjz6dFcPK6FIXOnMO/LZdjHW5fLfoxQGMIWBEPQ
+ELAIhpvrEPvfBigUoTDs3B9k14Eg84sbOGdIPZeOyWRorxRSU5RcPsYXud5yECkWRHJT4A9azFhS
+y/PvlbNuu5+waZ+4OuTAyO4wqCN0yoF0n/1HXAb4XHYXwTi0XW7ZJ7QBs3T9ZcSp0t1ZkPkKyet3
+95/G3tIG3TGOqU2ujw+fH8fwQflH/6ZTnPeV6lV43Qp3Y7EQDFv4g1BRY7H9gMm+SpOSMou9FRZV
+dRbV9RZhy+46NB2T95WFePvzKlZtbuCb52RxyehMCrJd0mEQ4iRIsRBJ2mLJRIE/YPHZklr+8E4Z
+G3YGsExI9cAZ3eBbw2B0T8hIaf72Fs8zsg6Ss9XX1+P3690pVzoLyeupV9fpjnBM3Tqk89mfz6Wo
+a+ZRvyca877soZ4WYdM+rhoGeFzQKV/Rv4uHVK+iPmARDNkFw1dbQizfbLJ5T5g6v91xMIyDQ0uf
+f7ec7ftC3DQpm27tPXKsFuIESbEQSdpiyUJBOGzxxco6XnivnA07AlhAdhpcPBBuOBOK2trf2rTR
+2rFuSMkNK2fT3VUAKRaS1V8fG8meA/HdVSjqksHMV8bTuTD9qN8TzXlfYbPx2Ns41Mjtsm/kZKcb
+5KQr2uca9Omk6N7WxTVjvVw2ElZsCfPJsiCrt4epa2gcpqQUB6rC/Gt2FVW1Ye68LI+ehZ7mYVBC
+G7nechApFiJJZyFJWBYs3+jnpQ8qWLvNvpucmwZXnwHXjYDCLJl/kGx0z1cAyMvL0x1BaPDHf27Q
+HaFF/XpkMeOV8RS2ST3yN0R53lfItIuFUBiCYQiEobYBykzYccCesGAY4HPbHYmubVyc3sPgjCI3
+933Dx/x1IT5aGmLrPpNw2C5C6hpMPl5Ug2XBlCvz6CodBt1CDn/8pCLFQiSpdJOBgs27ArzyYQVL
+1zdgAVkp8M3T4cYzoU2mFArJKB46C7IaUvJZ98Fkvlyl/713NH27ZzL71Qm0zU858jfEYN5XMAwN
+QagNQGU9lNVCeR3sKIdd5XCgFirqoM5vUVIGJeUhlm2CdxcGOa2Hi1H93Nw83stHS4J8tdWkIWCh
+GnNOW1xLZqrB3Vfm0SZH5jBoJNdbDiLFgkg6lTUmb82uZs5XdYRNixT3waFHbTIPDjsSyaWiokJ3
+BCkWktAbH2/THeGouhSmMe2lc1suFGI07+u/v880ocYPVQ2wsxzW74N1e2D9XruIqKiHXeUWJctC
+LPg6zJAeLvp09mBisWprgPqAhQLq/SYfLKihczsPN5yXTYpPScGgR9jhj59UpFiIJMOQElzQtJix
+tIb3vqiiPmBiKDizu91RKMyWQiGZNTToHzMuxULy+WDObt0RjqhNro/P/nzu0ecotPK8L6XsDnBO
+GnTJg1E9GguHClixAxZthRU7YXcllNZYzF4Vos12k8I8F1kpCn/Awmp8nPKaMP+cWUX3Qg8Thh19
+DoaIqVjvSiS7HkWRFAuRpC2WwCwFG3YGeH1GFfsr7JsOPQvg+hHQow1ydynJBQIB3RGkWEgyDXum
+sbQ4/oYgeT0G7/1hLL27ZR31e3TM+7Kw5zI0yUqBAYXQtx2c2wdW7YLZG2D+JthdAfsrTMqqTbyN
+w53CjXmUgm17Arw1u5KeHb10K/TIrbzWF+szrpzRo0iKBZEcFNTWmfx7djXFW/yYFuSkwmVD7c6C
+y5B5CskuGAzqjkBm5tGXpBSJZ/Z7j8XlFc2Ljw5n1NCCo39DnMz7Mi3AsocvFWZD20w4rTOc2ws+
+XA1fbLLnPDSEIoc4KeyiY9GaBqYvruWGSdmkeGU4UiuTzoKDyJ1ukRQsCxauqWf60lr8QQuXguHd
+YNIAe9KdFAoiHjoLPp9PdwTRipav1b8C13+7+7pefPvyHi1+T7zN+2rqOCgFBRkwvg88cD7ce67d
+dXCpwzMZCiprwkxbXMOGnQHZKKf1ybBvB5FiIZIMQ0pEyt7N87151ZQcCGIBhTlwyWDokmtPnBMi
+HooFr9erO4JoRRu31+iOEKFfjyx+86OhLX5PPM/7alp6VSlonw1XDYOHL4IJfe3lW/87m1KKNdv8
+fLGyjnq/2XLBoBp/GY2/GhsR1lF+T4qPY5LOgoPIMCSR2BqX35hfXM+StfWEwuBz25PjRvawTyrS
+VRAQH8OQpFhILrv21emO0MxlKP7+5ChSU45+WeCUeV9Ny7B6XHYHuSDTHqL0wSp7ydWmDdmUgtoG
+i9lf1TFxWDq9Oh/h82fYjxUMQX3ApKbOpMFvUlVnUtdg/4W9bkVmuoHPo/B5FBnpBqleA5er8bma
+qwpxCFkNyUGkWGjUY8Aw9+bipdIWSzQK9pSFmLWslgNV9mY+7bPhwgGQmyqFgjgoHjoLWVlHn1Aq
+Eo+Ko22E77i6iNP7t7ApoEPnfVkW9MiHO8fZKzW9/iWU1x4sGAwF67b7WbGpge4dPLhdTZUEBIIW
++w6E2LonxOZdfrbtDbJpV5Cy6jB1DSb+oL3FtNsFKV5FileRl+miZwcvXdp56NnRS+d2HtrmuvB6
+DDtMHL5GmshIDgeRYqHR5uKlsttfIjJh+YYGlm/yEwqD1w2jusPQTrJMqogUD8VCeros45hMMtPj
+4xScmebmkTsHtvg9x5r3FY7jW2GmBW0y4Prh9k7QbyyF+oBdMCgFNXVhFq6pY+IZ6eRkuggGLTbs
+DLCwuJ4v19bz9c4Ae8tC+AMmpmVPgLCUamo6AGA1nlAUMPurOlK9inZ5bnp18jKsTyrD+6XSq5OH
+9FRDOg026Sw4SHwcqYSIBQMqqsMsWF3P3tIghoL8dJjYH9JTpFgQkSx5Q4hWlpXu0R0BAJdLkZrS
+whBvBftKnT3vy7Ts4/+1w2F7Ocxef8j+D5Zi1aYAO/aFCIbhg/nVfLqohrXbAlTVhQGFYdidILvx
+cKSOUOTX6gMWm3YH2FwSZN7qenp28DB6UBrnD0+nfzcfHnfSr74U67Za/LTtEoAUC5Fi+tGVd27r
+27gryJKv6wmG7Tb5kE4wsPDYO4mK5ON26z8chsNhXC6Zl5csunfK0B0BgIrqIM/+Yz3/890Bh/9m
+As37soCu+XbBsHEfbC+z8xsGlJTaw1X3V4b4eFENZZV2BeQyVMSfb/q/5qkIh4wsaqojFPbjNg1p
+qmswWbHJz4adARasruOSszK5+KwM2uR4UMl7JpLOgoPoPzsKEQsK/AGLFRsa2L7X7iqke+HsXvYO
+oHITWfy3eCgWGhoaZChSEunTLX721XjipTXccnkPCtukRv5Ggs37UsDpnWFiP3htwcGN2ur9Jq9P
+r6SmzqTOb9lzGhqHKRnK7ix4DIsMH3Rp66IwzyDFY//9A2GoqYddpWH2VlrUNlgEwzRXF0rZy7fW
+ByxWbPKzfV+I1Vv93Dwpm/49UnAn551EWQ3JQfSfHeNLTD+yhqHkzdtaFJRXh1m2oYHaBhOFoms+
+DO1sdxikWBD/LR6KhdraWikWkki/nvEzob26LsSUx5by5tOjIydeJ9i8LwvI8MHZRTBtDewotyc5
+m8C+ijAK++/YdJ5onKKAZUEwDA1BRWU9FJgwqKOLwd1cdGpj4HVDaaXFjlKTVVvDLN8UYv1uk7Jq
+i0CoqeiwM5RXh/lgQQ079we5+/I8Rg5MxeNKumFJsqCMg+g/O8aXmBYLjfOhRGuwYOueIGu3+lGN
+402HdILC+Dk3izgTD8VCOCyd82Qy4BsfkZ3hpbJG/7K9AP+atoN/fLCVGy7pbn8hQed9KQXdC6BP
+W3sokoVdHORnQL9C6FFwcNJ2QwiqGyz2VcH+Giirs9i6N8z6XWFmrQzRta3B2f1cTBzqpl8XF706
+uRk7wE1ZtZdV20LMWR1m4ddhtu8PEwjSOPcBwmGLpV838Nt/ljLlylzOGZqOO7nmMcT6gKv/gJ5A
+5MWMFOuPafIcBjQLhCy+3u5nT3kIpew7SUM7Q9oRNuYRAuKjWIiHvR5E6zp7WBs+mLNbd4xmd/5i
+CcMH5tOnu31nJRHnfVlAbhoM7gRzNtpfG1MEkwfB8K72LtRN+yNY2B2Fynoor4MdZbBsByzdBhv3
+WazZEWbj7jBz14S5eLibi8/w0LWdQdscxYRcD6P6ulmxJcz7i4PMWhlib4U9xKnpzuSarX6ee7sc
+r8dg9KA0XIcusZTYpLPgIPrPjvElpnf+DUPJ690aFNTVm3y1wY8/YGFa0CkXitqAO07XAhf6xcOG
+aHV18bNJl2gd5wxvG1fFQk1diCvuncuC18/Hl+JOyHlflgUpHjijKwwoBLcL7hwLp3W2f988ZMay
+AlLckJoFHbKhf6H9GmzcB3M3wmdr4eu9sHZnmJ2lYdbtDHPzBB9De7hwG5DmVYzq66Z3RxeDugb5
+5+dB1uwIY5p2QWJZsGqzn5c+qCA308WgHj5dL4sQRyXDpOkimAAAIABJREFUYiLFdAyAx63k9W4N
+FpRWmmzaHcCy7Ls4PdtAOxmCJFqQkaF/ZZqamhrdEUQru2xCJ90RDrNmUxXX/ngeLqzmeV+WRcS8
+L8ezoH8H+OFE+MF46NvOvnA/0s0kC/vrIdMempTihsEd4Zaz4CcXwKVD7A3qquvh02UhfveOnwVr
+Q4TCBx8gP0txxVleHrgyhbP6unG5Guc/N448Wry2nn/PrqK0MixLJ4q4kwgf+WiK8ZwFKRZagwls
+2ROg5EAIUHjd0KsdZPqSpbsrTkY8FAvV1dW6I4hW1vOC9xk+sIWdkzX5aG4Jd/96CX+4t11Czvuy
+gFSPvfzriO7g8xz/+cHCXkUpxWNvTHfPuXDDSGibaRcUizeE+MMHfpZtDB0sPszGJWf7ubjvUh+j
++riaiy6l7KGz0xbXMn91HaFwUpypZBiSg8jFa6SYdhaUkjdvawibsK0kSE29iaUgI8XeOMjnQaoF
+cVTxUCxIZyE5XXNhV90RjujFNzfxs+dWJfa8L+vk/z5NqyR1yIabzoQbzoS8dLsLsXxzmBc/DbBp
+j3nwtGPZF12Du7u440IfvQpdzb9nKNhTHuKjhTXsK0+K7kKsrz/l+jaK5MWMFNOlTU3TSvyPfxwI
+BEzWbfcTDFtYFrTPhI45zp6QJ2IvM1P/mvfSWUhO3/7m3fg88Xk6/sXzxdx1fjBi3lciicY5wbTs
+IuGqYXD5EHtuR8iE+etCTJ0ToPLQqUiNBcOwnm6uP8dLbrpqLlYUsHR9A6s2+QnLrUURRxLsY3/K
+YvrxNAypFVpDvd9id2kIy7IPvgUZ9oFcXn7RknjoLFRUVOiOIDTIG3Er102Oz+4CwI+f+orzTgvL
+vK8WmBa0ybALhhHd7PNNIAifLg8xb23osIsLrwcmDnVxVl8XTdtaqMb9geavrqXen/DVggxDchAp
+FiLFdLWicFg6C7FmKdhbEeRAZQgLe03rtpmQ4ZUjh2hZPHQW9u/frzuC0OSe63vrjtCiHzyxjKkr
+Q9KdbYGFvX/DJYPtBTUsYF+lyQeLg+yrtCKvuCzIzzSYdLqH7HTVPLfBNGHV5gAHyhN+zxUZhuQg
+8mJGkkrX8RT7ysOU19gvtcewx5NmOHgDIdE68vPzdUeQYiGJnXblJ0wa3V53jBb98DfLeXKmX3eM
+uGVZ9kpRI3vAsC72kK2wCV9tCrFkfeiwMU8uA/p3dlHU3jg4FEnB7tIgeytCyO1FES+kWGhFYdNK
++FsFullYVNdbNATsI6/HBZkpiTfOVkRfSkqK9qFI+/bt0/r8Qq9fTRmsO8IxPfz/VvI/71Xj7tVT
+d5S4FDahIB3G9ITsVPtrpdUW89aGqKm3Dpu4nJ+t6N/FFfHler/JrgNBucEl4oZcQomEYplQURki
+3Lj0nNcN6b6Du3EK0ZKCggKtzy+dheR2xrc+5bLxHXXHOKanXl3HrQ8vgu49dEeJS4YBQzo3Lqyh
+IBSGtTtMtu03DysWvG7Iz7SXpm06RQVDUFIaxkzsakGGITmIvJiRYjpMSMnlasyFQ1BSFiZk2i3h
+VI99d0dqBXE8dBcLe/fu1fr8Qr9f3zsEtyv+x5+8+u4WLr37c/wd43diti6mBe0yoWdbcDWe+EvK
+TTaXHH6JoZTC51Z299s6+Of9ASvRT1ohhz9+UpFiIVJMX49wgt8miAdh06SsKoxpHtx0JzuF5tUm
+hGiJ7mJhx44dWp9f6Nf/Gx9y7419dMc4Lh9/UcK4m2dwIDf+uyGtybLsjnb3fHC77JtVtX7YccAk
+ZO8VGklFfk0p+88l+F4L0llwEHkxW5FpygTnWDMtqA+YWI23ZHweSPNJsSCOT5s2bbQ+f01NDQ0N
+DVozCP2e+staCgtSdMc4LsvWlnPmNdNYh95CO94Yyp4v53HZ55+GgMXOUotaf+S8BcuyCIYse1+F
+xq+7XZCb6UIldrUQ6zmcMkc0iqRYiCSrITmdZY/3bGrfugx7RaQEb+eKKOnUqZPuCKxdu1Z3BBEH
+fv/Q6bojHLcde+oYff1nTCtJ1R0lrmT4GhfXUPbE5+p6yz4/HSJsQV3ALhaaSgOPR9GxwJ3oN7li
+ugluKzx+UpFiIZK0xRzOAsLmwcpA0dhVSOyDroiSeCgWtm3bpjuCiANX/2geV56n//14vKrrQlxy
+1+c8My8oKyU1cht2h0FhD00Kha3D7lvVNcDOA1bzykcWkO4zyM92JXqxEOtbeHKLMIrk4rUVWZbM
+WWgV8iqLk9S5c2fdEaRYEM3yOp1N2zyf7hjHzQLuf+orbv7JQkJduumOo119EHuxDQ6bltCsssZk
+855DBh1YFh0LPORnuhP9Hpd0FhxEioVWZB1+U0HEwqHjQbHnMcgrL45HPBQLGzdu1B1BxIk/vfI6
+f/r5CN0xTtjf3t/K2JtmsDerg+4o2lhAZR0Hhx0pcLki58+FLdi4x6SkzMRo/LpSiqJOXnKyXYl+
+3pJh3w4ixUIkGYbkdI0H5CaBEDQE9cURzhIPw5DWrVunO4KII5fe/Tl3XVOkO8YJW1JcxrCrPmFe
+RabuKK1OKXv1oy0HIBAGLHtIUlaqwnvI+akhYLFsU5iKWgul7KFKaT6DIT18pHi0xW8tsW6cJHhj
+pnXJxWskWffX4QwUKR6FahwnWh+EqoZEv0EjoiU/P5/UVL2TNKVYEP/tuakbOL1fru4YJ2xfmZ+J
+t83i2fmhpJrHYCjYVgarS+zugQWk+BRd2xpkpBzccWl3qcnCr8M0TbOzLOjSzsOA7j5H7LVximTO
+goNIsRBJOgsO5zIgK82FUnbBUBeA8jr7IJzwh15xypRS9Oyp96Jm586dWp9fxKe3fj+G7Azn3W4O
+mxY/+u1yrv3x/KTYwE0pu5s962vYXgZY9vknJ13Rs9CF4ba/FgjDnFVhtjTOV7AAwwUj+qXQqa3z
+fs4nQYoFB5GL10iy7q/DudyKtnluXI3v7IbGzoIphw1xnHr16qU7AkuXLtUdQcSZHpP+w2uPj3Ts
+TY83PtnOyGs/Y6uvne4oMWUAq3bB9LVQ07hlisuAfp0M+nZ2Nc923rLH5OOlQeoD9hAk04TCPDej
+B6WRkWbIpa6IK1IsRJLZ+Q5nGNA+39W8a2YgBOW1jeNGnXqWFa0qHoqF1atX644g4tA37v6cx+8b
+ojvGSSveVMkZV33CJ7sScz8Gw4DSOvhgFWzYd3Ayc26G4tzBbgpz7CFINfUW7ywMsm5XY1fBsguK
+swamMbhnCkZyXJnJnAUHSY635PGTtpjDKaXIz3SR5jNA2UXCllKorKd5tQkhWhIPxcLy5ct1RxBx
+6sGnv+LGS7rpjnHSqmpDfOPuz/nlp3UYPXvojhM1SoE/BDPXwfR19rlHKbsIGNbTxbiBbgyX3eWe
+vTrEx0uDNATtSwLTgm7tPVwwIoM2OS5Zx0fEHSkWIsX0zr8lr3fMKcuic1sPbXLtH6Vpwc5yOFCj
+OZhwjKIi/SvPLFu2THcEEcde+88WRg3J1x3jlPzyhWIm3/U51W31L1ccDZZlDz96YynsrbJvTlkW
+tM0xuHyUl/a59tCiVVvDvD47yO5Ss3mztrQUg/OHZ3BG3xTdfw0hjkguXiPFtJ5X0lloFW1y3HRr
+5wXsN/jOcti0H8Km9CXFsfXu3Vt3BOksiGMaPvEW+nRz9rKkn3xRwhnf+pQ1prMLH7DPMX+ZD6t3
+HRx+5PPApNPcjOrrxjBg8x6Tlz8LsGxTqHkenVIwtMjH5NEZZKYn1VwFWVDGQeTFjCRzFhJAqk8x
+pMiH160wDKiog6Xb7KFISqoFcQyFhYXk5updprKmpob169drzSDi2zNP/ZZPXzqXDm2cPf5/y65a
+zrr+M97b4o3p8yhic/xXwPZyeGkefL7BXiq16TdO7+niqrM9ZKbBzn0mf5keYOaKEMHGIUqWBZ3b
+urn+vGz6dvbJ8CMRt6RYiCSrISUAt0sxtCiV9nluTMs+eC/cAuv22gdnIVqilGLw4MG6Y8iKSOKY
+uk58j0/+dI4jl1Q9VF1DmKt+OI9fTavDVRSbpYtNC+r80VsZT2EPNdpVAa/Mg0+L7TkLTUOLerZz
+cet5PooKXWzda/KnaQHeW3Rw9SPLgtxMg2+dm824oenJMqn5ULKDs4Mk39uzZTF9PWSp/9ahFBR1
+9HB67xQM7AP69jKYVgyVDfJDEMc2aNAg3RFYsGCB7gjCAQZd9hEf/HEcaSnOb1z/4vlirpgyl4Yo
+78fgMuxN0j5cDaW10TkHKAN2lMPL8+H9lVAfsB83bEL7HMXN4z2M6uvi650mz77v5+0FQWobDhYK
+GakG3zwni6vGZ5GeIoOURXyTYiFSTO/8K6l0W4cFWRkuJpyeTkFOY3fBtFeoaGoTS8EgWhIPnYUv
+vvhCdwThEGNu/Iz3nxtLitf5p/T3Zu1i1LWfsSO1fVQez6VgXxX8c4l9Yb9y16k/pqFg837401x4
+9yuo9dO8V0JBpuKGc7yMH+Jhwdowv/l3PR8uCVLvP6RQSDH45rhMbr4wh4IslxQKIu45/8gSXbLu
+b4JwGTCsbwpjBqU2b9C2rxr+vghW7mzcF0d+GuIo4qFYWLFihe4IwkHG3zqTd58di9fj/NN68aZK
+hl/9KZ+XZZzS4xgKDtTCXxfCO8th6wH49zJ7Oe2TfpUUfL0X/jgH/rMCapoKBQvysxTXjfMyZoCb
+dxcFeOLfDcxbGyZ0yByF7HSDayZmcdvkXArz3MlcKMgwJAdx/lElumTOQqKwoG2Om8vOzqRXRy9m
+42Fj1S54/nMo3m3/vxQM4kgGDBiA0vzmME2T6dOna80gnGXSd2fx9jNj8Lidf2Arqwww6fbZvPDl
+yZ02m4YEzd8M766A8nr7unzeJvjDbHsOm2md4DnAgnUl8Oxs+KQY6oMH9+9pn2tw+SgPnfIVL34c
+4MWPA2wqsU88TYVCfraLmy7I4bbJuXQoSOpCAWQ1JEeRFzOSrIaUQJSyuwtXnZtFmxwX4cbJzvM3
+2Qf75duxJ5I4/7wqoiwjI4P+/fvrjiFDkcQJu/jOObz77Fh8CdBhCJsWUx5fxn1vVqB6nNgGbkrZ
+HYT3V9pdZZeyCwh/CKatgV9/DJ+thap6ms8DRzsXNA0xWrELnpkFs9ZBINT4Z4D8LBfDeqewrwKe
++yjAZyuCVNUdHHakgB4dvNx1WR43XZhN21wZeiScxflHk+iStlgisSDVa/CN0RlcNjaTzFR7Deug
+CV9shKenw7R1UBeQD4I43IgRI3RHYNasWbojCAe66I7ZfPRCYkx6Bnhu6gYm3zWHusIux/X9SsHe
+apj6JSzYbH/Nsho7CUAwDF9ugyc+gd9Nh3mb7Y3U/EH7Gt5l2L+Mxh2YG4IwZyM8NQ3mboCQebCw
+cLsUHpdi6Xo/Hy8LsKPUbO5km6a9lPeogak8dH0+10zIIi9ddmhuJNdbDiL3VCNVAlmxenAF1Wbx
+tc7eRceJFOzYF+KP75bx/vwa6v32McQAOufBNwbDJYOgU97BlvKp8F6++NQfJAosWSf2lLzwwgvc
+eeedWjN4PB4CgYDWDMK55v39PC66YzZVtSHdUaJiQM9sPnh+LB1r9xz1ewwFB2rgtUXwj0VQ3WB/
+3WUovB5FQ8C07/arg4VBmwwY1AEGdICiNtA2E7xue1M1peDLLfDaAthcevjy2007NVsWzVdUpgmG
+AV3aujl/eAaXj8uiV0cPhiGrHjVRA6ZWADkxfIoKQO+GOQlEioVI5cTwzaug0iy+NjtWjy9atmN/
+kFc+rODdL6qprDWb3/xpPhjaEb4xBM7qAfkZ4Gm8IXcya3JLsZAYli1bxrBhw3TH4P3332fy5Mm6
+YwiHWvLmJC747mxKKxOj6GyT6+O9P4zljLSKw37PZcCeKrtImLoEKuvsrysFw/qkcGb/NBYV1/PV
+xgaCYat5GJFp2tfwHhfkpEFWCqR5Id2nUAo2H7DYX33sC6amjkKbHDdn9kvhkrMyGTkwlcy0pNqZ
++bioAVPLgLwYPkUZ4PytweOEFAuRpFhIYJaC0oowr0+v5F+zq9hdGmq+AwSQnQand4bxfeD0LlCY
+Bale+wRkWY3HeuvYx3wpFhJDMBgkMzMTv9+vNceUKVN45plntGYQzvb1h5OZdPsstpXU6Y4SFT6P
+wauPjeTKoiDQeCGjYFsp/O1LeO8rqKy37/qbFvTt4uWH38pn9KA01m/38/bcamYsq6WkNIR1yDnA
+4mDh0KRp87WjzWdo6iooBQXZLk7vlcLEMzI4a2Aq7fLddrdaDsWHkc6Cs0ixEEmKhUSnoLreZObS
+Wt6cVcWKjX7qGsyIE0FGCvRuB8O6wOCO0C0f2mXad5o8LnC7AKtxQOR/FQ9KgetSKRYSxejRo5k/
+f77WDP369WPNmjVaMwjn2z37Mi783hxWrj/8jrxT/fz7g/jpnQPwf72Jr3bC3xbB3PVQGzi4AlGP
+Dh7uvCyPi0ZlkOJVWJairDLEkq8bmLG0lsVf17OnNIQ/aGFwfMtqN908UsqeF1dY4GZYbx+jB6Uz
+tCiFwgIXbpfsrNQSKRacRYqFSKXEsC2moNwsvlbevLope5WNDTsCfDC/hulL69hSEiAQsprvMJkW
+uA3IS4fOudC7LXTMsf+7TWPHIcMLKR67gDCwJ73VBaHoVikWEsVDDz3Ek08+qTsGW7ZsoVu3brpj
+iARwzvC2zFmyX3eMqLn18h688OhwrvqfzawtsScvGwpQ0LODh+99I48Lz8wg1XfIfIHG1Y3Kqk02
+7/KzbEM9qzYH2LgrQHl1mIaARTBoEW7sMijswsDtAp9HkeozaJfrpqijh0E9UhjU00fndh6yM5qK
+BDn2HktrDEOyiq8tUAOmyg8jCty6A8SZmC6KIxsHxwkLXErRt1sKndp6OGtAGjOW1TJvdR1b9wTt
+O0yNd6X2V9urZCzbDiluyE61Ow+pXntca4YXvB775BQM2xv0iMQxbty4uCgW/vOf/zBlyhTdMUQC
+mL14H9de1JV/frxdd5SoeOWdzezaV8dbvx/DabdvQ2EPHR3Q3cd3L8nlnNPSSfH+18Riyz5mF2Qb
+5GelMqR3CjW1Jgcqw5RVhdi+L8jesjB1fotw2EIphdcDWWkGndp4KCxwk5vhIi/LRWqKvRpSMykU
+jpfss+AgcvEaKabDkIAKq/jaWD6+OFGNn4CKGpP1O/wsWF3PguJ6NuwMUFUXbl5qDw4uvXfonaam
+x2gelmrBlpXSWUgUVVVV5OXlEQ7r3U9x/PjxzJgxQ2sGkVh+esdAfvVise4YUTO0bw4fPj+OCx7a
+w1kDUrn9klwGF/nsC/njPBRah6xmZFnWYX9MAYahmidGy1yEk9caw5Cs4mvzpLMQHVIsRIrpMCTs
+tlgsH1+crMbFKurqTfaUhli3LcDS9fWs2uxnx/4g1bUmgaDVXBCgDl9Cr8lmKRYSyogRI1i8WO/P
+1OVyUVdXh9fr1ZpDJJbXHh/Fdx5ZRDCUGMeKLoVpfPzCOaSmp9Gt0CMXOHFMigVnkWFIkaQtlqxM
+u3JOTzHo2dFLt0Iv5wxLp7QixK79QdZt97N5d5B95WH2lIWorDUJhixCptW8XJ6h7LtOm7X+RUS0
+jRs3TnuxEA6HefPNN7nhhhu05hCJ5aafLKBrh4lcPuVzyquCuuOcsu0ldYy+4TPefXYs3Qvb6o4j
+WibXWw4ihXckGYYkIliN44tM0yIchlq/SVlVmJoGk1AI/CELf8DEtMDjUqR4FWde+a7u2IB0FqLl
+o48+4uKLL9YdgyuuuIJ///vfumOIBLTx40u47J65FG+q1B0lKrweg78+NpJrLuqqO4o4CjVgahUx
+3AQXqLKKr82RzkJ0SGdBiBaoxsOMy1C4DPB6XORmug5OWGgel9T0B6T+TjTjxo3D6/Vq30n5ww8/
+1Pr8InEVXfg+qzfC5RM68e7MXbrjnLJA0OS6++dTWuHn+9f11h1HHFmsF5aVhWujSNo0kaQtJo7N
+wp7pbFoHF9y2Dvm6SCjp6emMHTtWdwz8fj9KilERQ+/M2Mmjdw3UHSMqLODuXy/lZ8+tki5rfIr1
+wUwOllEkF6+RQg5/fCFEDEyaNEl3BCFaxc+eW8Xbz4whIy0xBh78/I+r+f4vlxAOy43mOBPrCk4q
+xCiSYiGSdBaEEIe54IILdEdoJt0FEWuXT5nLl/88nz7dMnVHiYrn39jIdfcvwB/QuwSyiCDFgoPI
+xWukWB9J5EglhAMNGDCAjh076o4hRKvpd8mHrNtSxeUTOumOEhVvfrqdS+76nJpa56/6JERrk2Ih
+ksvhjy+EiAGlFBdddJHuGEK0uren7+CJ+4ZgJEBD67MFexh/60xKK/y6owiZs+AoUixEkraYEOKI
+Lr/8ct0RmslQJNGaHnz6K6b9+VwKcpy/KeDi1WWcc/MM9h6o1x1FCMeQYiGSdBaEEEc0fvx4MjMT
+Ywy3ECdqwq0zWfrWBZwxIE93lFO2emMlY2+awY6SWt1RRCzJKlhRI8VCJFn3VwhxRD6fLy42ZxNC
+ly4T32Px6lJuvrS77iinbP22as6+cTqbtlfrjpKsYr+gjCnTRKNFigUhhDhOMhRJCHj13c38/sHT
+HD+PYVtJHWffOJ21CbJztcPEfEEZ6StEjxQLQghxnC688EK8XueP2xbiVP3giWV8+tK55GU7+/NQ
+cqCBsTdN56u15bqjJJuYT3BWSi5xo0VeyUgywVkIcVSZmZlxtSqSdBeEThNvm8niNyYxsChbd5RT
+cqAiwLm3zGDRygO6oyST2C9Vb8glbrTIKymEECfguuuu0x1BiLjRY9J/WLWhwvH7MVRUBzn/O7NY
+uEIKhlYiC8o4iBQLkWTdXyFEiyZPnkxGRobuGM2kuyDiwdvTd/DTOwbojnFKqmpDUjC0HllQxkGk
+WIgkxYIQokWpqalcccUVumMIEXd+8fxq/vHkKHwe515aVNfZBcOCr6RgiDG3wx8/qTj3Ex0bMmdB
+CHFMMhRJiCO77oH5zPzLeNrk+nRHOWnVdSEm3S4FQ4xJZ8FBpFiIFPt1f4UQjjdhwgTatm2rO0Yz
+GYok4slZ13/Gl2+c7+iJz00Fw/zl+3VHEUI7uXgVQogT5Ha7ufHGG3XHECJudTvPnvh84ZhC3VFO
+WnVdiEnfnS0Fg0h6UixEkraYEOK43HbbbbojRJDugohHH83dzZTre+uOcdJq6kJc+L3ZLFldqjtK
+opHrLQeRYkEIIU5Cv379GD16tO4YQsS9Z/7+Nb9/8DTHrvBRVRvi/NtnsfJr2bgtimTYt4PIiymE
+ECdJugtCHJ8fPLGMf/3fGFK8zrzsKK8KMvG2WazbXKU7ihCtzpmf2tiRtpgQ4rhdddVVcbXnghDx
+7Ip75zLzLxMoyPHqjnJS9pf7mXDrTDbvqNEdJRHI9ZaDSLEQSdpiQojjlpGRwfXXX687RgTpLoh4
+Nuq6aSx4/XyKujizyN69v57xt8xgR0mt7ihOJ9dbDiIvphBCnIK77rpLdwQhHKXowvdZOu1Rzhpa
+oDvKSdlWUsf4W2dSsr9edxQhWoUUC5GkLSaEOCGDBw9m3LhxumNEkO6CiHdZfX7MvOX7ueScDrqj
+nJSN22u44LuzqagK6I4ijkINmCob4UaJFAuRpC0mhDhh99xzj+4IQjjSf2bt4pbLu+uOcVJWrq/g
+ku/Pob4hpDuKE8n1loPIixlJOgtCiBN26aWX0rlzZ90xIkh3QTjFK29v5sHb+umOcVK+WHaAq380
+j1BITu8nKNYVllRwUSTFQiSpdIUQJ8ztdnPnnXfqjnEYKRiEUzzx5zU8/cBpumOclPdn7+Y7j3yJ
+ZcmolxMg11sOIi9mvFPYPyU55wsR126//XZSU1N1xxDCse57chl/f2IUbpfzTnh/fW8LDzz1le4Y
+ThJ2+OMnFSkWIsXXMCQFgaBFRXWYer+F3LMQIn4VFBTwne98R3eMw0h3QTjJ9Q/O5z/PjXXk5m1P
+vbqO37y8RncMp3A5/PGTivM+jbEVH20xw64qNu8OMHV6JU+/UcbLH1WwdlsAU4ZFChG3fvjDH+Jy
+yTlKiFNx4fdm8+lL55KZ5tYd5YQ9+PQK/vH+Vt0xnCDW9z/l/moUSbEQZ0yg5ECITxbW8JupZfzu
+zTL+8Vklz79bxrP/LmVzSUCGJAkRp7p168Y111yjO8ZhpLsgnGbsTdOZ8cp48rKdt9vzLQ8vZNai
+vbpjxDvpLDiIFAvxQkEgbDF3RR2/eu0Av3ujlI1bavEqE6Wg3m8xb3U9X6yq051UCNGCBx54QHcE
+IRLC8Ks/Zc5fJ9C+IEV3lBMSDFlcPmUuxRsrdEeJZ/E17Fu0SIqFSHqGISnwByw+XlDLb6aWMmtZ
+Lb3ygvz8Eotvj4bsVMACf8Bk9/4QlindNSHi1eDBg7nooot0xziMdBeEEw289CPmvjaRroVpuqOc
+kMqaIBfdMYfd++QG31HE+oAkB7wokmIhkpZ1f8NhmLm8lj++W8aGHX5GdLP4/jgYXQR92kKKp3Hw
+nQJlKJR8BoSIaw8//LDuCEckBYNwoqIL3+eLv59H766ZuqOckO0ldUy+83NqaoO6o8QjmbPgIFIs
+RGr9zoKCVZv9/OWjCjbtDtA9H247C/q1h1AY9lRBfeNu8l6XQUG2IT81IeLcqFGjuOCCC3THECJh
+dBr/LrNeHU+fbs4qGJavK5dN245MigUHkcvOSK277q8BlbUmHy6opnizH58bLh4Ep3UBQ0F1AxSX
+QI3f/v+sdIO+XX3SXBPCAR599FHdEY5IugvCqTqc8y6zX51A/55ZuqOckI/mlnDv40t1xxDipEmx
+EKnVZ+ev2drA3JV11PotereD8/pBihtQsGk/rNkNQROUgp4dPRR19Eq9LIQDjBw5kgsvvFB3jCOS
+gkE4Vftx7/DcDf0ZWJStO8oJ+eM/N/LHqRt0x4gnMmfBQaRYiNR6bTEFfj8s+7qB7XuDeN0wqgd0
+zrMLg9oG+HwjbDpgv+NTvAZjBqdRkO2SYkEIh4hK/qGoAAAgAElEQVTX7oIQTnbOzxbw8pTzGNw7
+R3eUEzLlsaVMX7BHdwwhTpgUC5Far7OgoLw6xNptAWr9JtmpcFpn8LnBtGDxNvi02J6voBQM6OZl
+/GnpuN1SLAvhFGeeeSaTJ0/WHeOIpLsgnGzEPW8x573fcVrfXN1RjlvYtLjqvi9Yv7VKdxQhTogU
+C5Facd1fRXmNye4DISxLkZECbTLBsmDVLnhtkd1VACjIdnHVuVl0be9BSVdBCEd57LHH4vbC/Kqr
+rtIdQYiTltP3Vma+85SjOgwV1UEuuetzyisDuqPopmepenFS5MWM1KpzFizTImxaKKAhCMW74Y2l
+8OQ0WLgZzDCk+Qwmn5XJuael43HF5wWHEOLoBg0axM0336w7xhH961//0h1BiFOS0/dWXrp7oqMm
+Pa/fVi0rJAlHkWIhUiuuhmSRk+WiU1sPhgEHquGpz+A302DpNvCHID1VccmoDG46P4f8bNm5XAin
++sUvfoHP59Md44jiteshxPEacc9bTH95vKP2YfhswR5+/NvlumPoJDs4O4gUC5Fary1mQZtsF+cN
+S6dHoRcTqKiFmgYwXNCtvYfrz8vmjsty6dreLZOahXCwzp07c++99+qOcVRSMAinKxz3DjP/Mp4e
+ndJ1Rzluz/x9Pf94f6vuGEIck5whIpUBsZwtVW4VX3vw8RVU15p8vrKOeSvr2FMewutRdGrj5sx+
+aQzvl0pOhiGFgsOoAVN1RwDAsuSNE0/Ky8vp2bMn5eXluqMckbxfRCLYNv1Sxt00nW0ldbqjHJdU
+n4sFr5/HEAdN1I4GNWBqBRDLySYVxPZ6LqlIsRCpnBi/ea3iayMfX0HYsqiutaiqC+NxK7LTDNJS
+GpsQcv52HCkWxNE8++yzTJkyRXeMo5L3jEgEmz/9BmNu+IySAw26oxyX7h3TWfLmJPJy4nOoYiyo
+AVPLgLwYPkUZkB/Dx08qMgwpUuvu4AxggUspcjINurT3UJjvJi1VCgUhEtEdd9xB//79dcc4KhmO
+JBJBj0n/4dOXziU3y6M7ynHZsquW6x6YTzicVMPsZTUkB5EXM1Kr7+AM2EWBiV1KmI2/pFAQIuF4
+PB6eeeYZ3TGESHiDLvuID58/h7QUZywO8um8PTzy7CoALBSWkY6lkqfTIOKbFAuRZHa+ECKmJk6c
+yGWXXaY7xlFJd0EkilHXTePdZ8/G45DNTB97aQ3vzdwJ6QMgbxLK7ZzVnU6CXG85iBQLkdwOf3wh
+hAP87ne/w+v16o5xVFIwiERx3ndm8fpvzsJwyFv62/+zkG3rF6LS+mCF63XHiSUZhuQg8mJGkkpX
+CBFzPXr04P7779cdo0VSMIhE8c37vuDFn43QHeO4VFQHueZH8wls/BXhkDMmaJ8kud5yECkWhBBC
+g//93/+lR48eumO0aNOmTbojCBEV33lkET///iDdMY7LolWl/OT/VuBSId1RYkk6Cw4iL6ZwAHXI
+L7BME8sMY1kmNC/1KHdBhbOkpqby/PPP647RoqKiIt0RhIiaR/6wktu/2VN3jOPy9F+/5oPZu3XH
+EAKQYuG/SVssXlgWViiI1VCLWVuOWVuGWVOKWbWfcOVewhV77F+V+zBryjDrq7BCgUOKByHi3/nn
+n88111yjO0aLZDiSSCR/emsjF4/toDvGcbn5fxawfXet7hixItdbDiJngUitvymbiGRZWIF6zIZq
+rEC9XTBYh3zmm/7bsgDV+A5WYBgYLi/Kl4aRmoXy+EDTRY5syiZOxJ49e+jbty+VlZW6o7RI3k8i
+kZw5OJ8vV5XpjnFMIwfn8/lrE/F4Euveruzg7CyJ9e4TzmaFMesqCFXsIVxThumvwwoHwQwf/GVZ
+h3QPGv/bMiEcwgzUEa4pJVS2G7OmDMKx3mNPiFPXvn17nnzySd0xjkk6DCKRPPfd8RR1ydAd45gW
+rizlly+s1h1DJDkpFiJJW0wXy8KsryFcdQAr2HDyw4ksCyvUQKj6AKGa/XaxIUScu/322xk7dqzu
+GEIkjTPufouPXjjHEbs8//rFYuYt2687hkhiUixEktn5mlihIGZtRfQu7s0wZm0lZm0lmFKjifhm
+GAYvv/wyqampuqO06KKznTHWW4jj0evC93n7mbNxu+K7a2ZacONDC6iqSaibX3K95SDyYor4EGzA
+CkR5Axoz3DjxuQGZniPiXVFREY8//rjuGC36+IsSfnxLP90xhIiac749gz85YA+GLbtquftXS3TH
+EElKigWhn2VhhgMxmUBphQOY/jpkBJhwgrvvvpvRo0frjtGi3726jld+dabuGEJEzS0PL+TB2+K/
+CP7b+1t54+NtumNEiwz7dhApFiJJWyzRmBaEgva/hYhzLpeLV155hZSUFN1RWvS9ny3msz+fqzuG
+EFHzxJ/XcNn4jrpjHNMdP1/MjpKEWE411u1+GU4QRXLxGinW2yUm9HaMJ00plMsdo6VOrYPLrcqx
+QzhA7969eeKJJ3THaFEobHHlvV+w8p0LdUcRImrembGToX3je3Xziuogt/30y0RYyjjWfwHHv0Dx
+RIqFSNJZ0ES5fSh3LFalUKBcjXWCHDuEM9xzzz2cd955umO0qLouxEV3zGHnzMt0RxEiat59diwF
+OV7dMVr02YI9vPTWJt0xTpUUCw4iF6+RYr0wvyz8fxTK40OlZES/u2AYjRu0yVtdOIdhGLz66qvk
+5eXpjtKiXfvqufjOObpjCBE1XSe+x1u/H4PLiO9O9I9/uzyRd3cWcUauoCK5HP74zqUMjLQclC+d
+aA4XMjypKF9a1B5PiNbSoUMHXnrpJd0xjmnl+gomjmyvO4YQUXPOt2fw+wdP0x2jRdV1Ib7ziKOH
+I8mcBQeRYiGStMU0Mjxe3JkFGCmZUegEWChPCkZ6DsoT3y1lIY7miiuu4NZbb9Ud45hmLNrLVZO6
+6I4hRNTc89hSvn1Zd90xWpQgw5GEA0ixEEk6C1oplC8Nd3YbXJn59vAh1Anv5qwMAyMlA3dWAUZq
+BnKDQTjZM888Q1FRke4Yx/SvaTu44+r4zynE8frLO5sZMSi+hwLKcCTRGqRYiCTr/sYDjw9XZj7u
+3A64sttipGWh3F6U4eKob1lloFwejJQMXFltcWW3R0WlQyGEXhkZGbzxxht4vfHfIXvxzU08/L0B
+umMIETX/+v0Y8rPj97NXXRfiez9f7MThSLKgjIPIiynikzJQ3lRcGXm4cwtx5XXEldsBd05bXJn5
+uNLzcKXn2v/OKsCd0x5XfkdcuYUY6bmNk5qloyASw+mnn87TTz+tO8Zx+fWf1vDMT4bpjiFEVHSe
+8B5/f3KU7hgt+uSLEt74eLvuGCdKFpRxELmailQOxHKR5Qqr+Nr4XsQ57llHGJbU+DaOk+JADZiq
+OwKAE+80iRZYloVhOOf+zp9/MYLbfrpIdwwhouKndwzkVy8W645xVO3yU1j7/sXkxnEX5FBqwNQK
+Yny9BeTG8PGTinPOPK1DJjjHPWUPLYr4peKmUBAiVpTD3uO3P/Jl3N+RFeJ4/fKF1Yw/s53uGEe1
+t7SBn/zfV7pjnAjpLDiIFAtCCCGizgJu/slC3vr9GN1RhIiK138zisKCFN0xjurFNzcxb9l+3TGO
+lywo4yBSLESSdX+FECJKTAuuu38+7/1hrO4oQpyydmPfYepTo+P6RP69ny0mEHDETXVZUMZBpFiI
+JMWCEEJEUShs8a0fzuOjF87RHUWIUzbu5un8bxyv+FW8qZLfvbpOd4zj4Xb44ycVKRYiyZwFIYSI
+skDQ5PIpc/ngj+N0RxHilP3yhdWMGpKvO8ZR/fpPxezaW6c7xrFIZ8FBpFiIJOv+CiFEDASCJlfc
+O1eGJImE8PpvzyIrPT5vXtfWh3ngd46a7CzinFy8CiGEaBXB/8/efYdHUa1xHP/Obja9EVrovTeR
+jiiCVAWRa792kItdFLF3RSlib4gUCyJWVBApIr333gkgoQbS++7cPxYikQDZemZ238/z8KiQnfkR
+k82857znnEKdG4Ys5sd3L1cdRQiP1Oz+K5+90lZ1jPP6ZsZ+My12FgYnxUJxMi0mhBA+VGjXuXno
+EqaOuUx1FCE8cvPQJdzTv5bqGOf18PA12O0uPnZoJfzyDXneMhEpFoQQQviV3aHz32FL+eKN9qqj
+COGRCT/tpUalSNUxSrRu+ynG/7j3/B+g4XwKPF0U2HXIK9TJznf+ysnXySvUnU/d3i8cpO3bRIzZ
+cCeEECKgOXS4+7kVpGW24pE31qiOI4TbJg5vT9cB81THKNGz727gxp7V/znZueihX6Ow0EFGjs7x
+k4WcyrRzLLWQoymFZOY4KHRAiFUjPtpC1XIhlC9jo0KClXKxVmw2C+i6bNkSRKRYKE6mxYQQwo8e
+fXMtqenNefHDjaqjCOGWLvf8yaPzGvDe1ztVRzlHSlo+b47bwqhhLcECdjukpds5dLyQLfvy2Lwv
+l20H8jl6spCsXJ28fAcFdh0dsGhgs1qIDNcoE22lQfVQ2jaKoF3jCGpXthFi1TwpGOR5y0Rk3//i
+TgHxPrx+qr7lVl9eXxiA1mSK6ggA6LoM+wQaTQvct+whdzTgnS9NsT+8ECVqUDOWnfszVMc4R5jN
+wo7f+5Cnh7BuZy5rd+Sx/UAe+48WkJ5tx+HQ0LTTkw6a8xc4Jw/AWQ+c+ffYSI1mdcLo2yGWHm2j
+KBNjdatg0JpMScXHz1tAGR9eP6jIzIIQQgjl3v1qB6kZtZn48wV6rIUwsC9HtKfjf+fgMNg4TV6B
+gxfe30hBVHV2HswjNcOB3aFjsWhYNA2L9dzX6PrpAuFMEWFx/jMj28HSzbnsOVTIweMF3NU7jvJx
+IdKSFOBkAUhxMi0mhBCKTJq2j75XVlEdQwi3tLtlNsMGNFIdo0Rf/5bEUzdEcird+RhitWhYzuoi
+OnsJQnQ4NKlhpX0DKw2rWKkYrxEa4vwYy+nXHT1VyOQ56XwxM43UTIf0qQQ4KRaKk9X5Qgih0PQF
+yXRoUY4HH39SdRQhXDbi863UrR6tOsY5dOCpt9ejWcBqgfhIqFkWGiVCvQpQKR6iQp0tSLkFzhdc
+3drGmAERjBkYyQO9w2hVN4SIUGdVYNEgPcvOzwsz+GttFrrrQ6HyvGUi0oZUnMwsCCGEYss3pnAy
+7VP29dpOrR6/qo4jhEs+e7mtIXdHmr30CLPHNWTW4iw61YH6FSEiFAodcCIDdhyFpXthVRJs+9vO
+5AVQNsZC1xYhtKpr5erWDn5aVsCPS/M5nq6jnZ5hmLEsgzYNw6la0ebKU06h7/6mfrl+UJHKqzip
+dIUQwgB27s+g421zWP9jb9VRhHBJl3v+5N7ra6uOUaJn3tnA6GF16NPMWSxUKwO1ykKbGnBbW3jx
+arirPZSJhB2H7Hw8M491e+3YrFCnkoX/9Qrl5stDiQ3X0HVwOGBLUj7rduW6GkWet0xEPplCCCEM
+6ciJXK64cy6zx3VRHUUIl3z0+U8klgtXHeMca7ae4re/DhXtcFT06/SfV46H29pB7yYQHgLb/7bz
+3aJ8TqQ7PyIuSuM/HWy0qGUt2jnpZLqdTXvyyM7RXVm7YPf+386v1w8qUiwUJ21IQghhIBnZhVx9
+3wI+e7mt6ihClFpofAs+fK616hgleumjTYTUq1Pin9kdUDYK+rWAOhWc/71seyHLd5zu6nFA1XIW
+Oja0OtcvaJBfqHPwWAHpOXbnYobSKWEPJq/y9fWDihQLxcm0mBBCGIzdoTP4lVUMu8eYO80IUZLr
+hyyi52WJqmOcY/32VKb9+fd5/9yhQ4NEaF8LwkIgJUNn8VY76dmA5lwg3bCqldhI53ZKuq6TkeMg
+N0/HhT1Ufb3Zqmzm6kXy8CqEEMIU3pq0nf5XVVUdQ4hS++C51oTajPeo9fJHm7HWLXl2QdedLUit
+a0BcJBTYYeuBQvYdtRe1GVUtbyE28p+uo5x8nZxcB+gysxCIjPcVLIQQQpzHtHmHaN0kgcML+quO
+IsRF1ev9G8Puaag6xjk27kzlpzkHz/vnOlC3PFQ4vQvs0VSdvUf+6aQOD9WwhWgu1AbnkLZvE5Fi
+oThpQxJCCINbs/UUbW6axerveqqOIsRFvT52C9UrRaqOcY4LzS4AxEVA1TJgsUBGLuw96iAv37mI
+Ob9Ax27/Z2V0uE0jLMwCWqm7f2RmwUTk4VUIIYTpHDqWw+V3zGXyyI6qowhxUe8+fanqCOfYsieN
+GQuSS/wzXYeoMKheBqyni4PkEw6y8wANTmSc/vfTIsI0wkM1XNgOSXZDMhEpFoqTaTEhhDCJ3HwH
+tz+9jKcGNlYdRYgL6v/IIq5qV1F1jHOM+HzreXdGCtEgNtxZLDh0SM/RyS1wzhwcS4WsXP30gmeN
+6AgroSGaK8uKpZPDROSTKYQQwtRGTdjG1ZdXVh1DiAsa82RLF44h8I+l60+weO3xEv9M1yA81Ln7
+ETqkZ+tknN4R6VSmg9wC5wyELUQjMcFKVLjF+RulIzMLJiLFghAe0nWd1PR89hzIYOXGFNVxhAhK
+MxcfpmGtWLZP76M6ihAlavGfmdzT33gnO4/8fFuJv68B4TbnmgVdg6xcyM7TcRTAoRQHBYU6ug5h
+oRpVytuICHNpZsHXdZPR6jJTC1EdwGBk398gV1jo4FR6Pimp+aSk5pGSmseJ1Lyi/z5xKu/07+ef
+/n3nv9sd8r9WCNV2JGXQ5uZZTBp+OdcPWaQ6jhDneO2RZnw7cz/ZucYZ+J6xMJntj7WgISfO+TOr
+xXlKM0C+XaegEDJydHYnOyg8/VeIi7JQuVyI80A2u8wsBCIpFkTAysu3czItv/gD/qk8UtLyznrw
+zz+rIMjjVHqB6thCCA9kZhdyw2OLeXJTY0aO36o6jhDFVL5yGk8NbM5LH21SHaWYEZ9vZdK9Fc75
+fbvjn84i/fTmR/tP6Bw4oePQnYVE5bIh1K4c6upwqOyGZCJSLBQn02IGpOs62Tn2Yg/1RQ/+qXmk
+FCsI/hn1z8wuVB1dCKHIqAnbWLW5IimWhmxYtkB1HCGKvPjhRsZ+F0ny8RzVUYp898cBRg29hApp
+/+yOpAO5Bc7FzRrOiQNNh037Cjma6ihar1CvahgVylhdWa8AsqGMqUixUJwUCz7mcOikZxaUur3n
+zJ/lFcj3vRDCNX+tPEaVChksn9KD9rfOVh1HiCLP39eEB15brTpGkUK7zqdTd/Nir7POg9Ahp+Cf
+2YXIMI3sfJ21ewrJPL0TUmykhUvqhRMVYXH18dzXz5/yfOtF8sksTtYsuODs/v6z23uKjfr/qyiQ
+/n4hhD8dOpbDFXfO5f3tbbjvlVWq4wgBwP2vrmL0hGj2HcpSHaXIZ9/v5vn7+mFJ2gf8M7NgdwAa
+REfA4ZMOth10rlewaFC9Yggt6oa5czuZWTARKRaKC9p9f/Py7eeM5qek5pOSlnfenn/p7xdCmEFB
+oc79r65mxcbaTPx5r+o4QgDw8oPNuOvZ5apjFDl2Mo/v/jjALQ2daxFy8+FYhrMNyaKBzWphxyEH
+ySd1NJwtSJfWj6Bq+RB5NA9wUiwUZ/rV+Wf6+/9p5SlpIe+/Wn/S8qW/XwgR8CZN28eGRgn8+F4n
+avX4VXUcEeTufGYZIz6PY9vedNVRirz/9U5un9oD++49ZOTC/hRnC1KIBdKyHWxIch7GpmmQEGul
+Y7NIwkItAdY3If5NioXiDLVm4Ux//z+j+edv7zm7IJD+fiGEL8REhpBh8oGFddtP0fqmWUwd05Vu
+A+epjiOC3KsPNePGx5eojlFk9ZaTrNiYQutIOJ4JxzOcdYAtRCM9Wyc1U8d+eqahSc1QmtQMdffB
+SdqQTESKheJ8OvJfJsYWv21PWontPUUP/GcVBSfTpL9fCGEc8yZ2pdf/5pOSlq86ikdOpuXTc9Bf
+jNrekqGj16mOI4LYDY8tptkn8WzalaY6SpEPv9nJF/dWYPsROJnlHOXUdZ2TmZB5elYhMszC5c0i
+KRMb4u6sQtC2fZtR0O/O8y+ngHjVIYTwBt21beyECWia2rdsfcutbN2dRvd7/zLUto+e+O81NZg8
+PUl1DBHEpo65jFueWKo6RpHwUAvJ8/vzwRcH+GYlFDicbUgWDQrszrakJrXCGH1/RepXc29mQWsy
+JRXfPm+lAmV8eP2gEuyVlwZEAzWAS5FDPIQQ4oIa141j8dfdqFMtWnUUr/hmxn4ubZTAwT/7qY4i
+gtTNQ5dQr7pxvp9y8x18MyOJHUeg0O58UHLoUOhwTiKEhGh0bhFJtQo2T0acpQ3JRAKpWLDgrCLr
+Au2Aa4A7gceA4cCnwPfAX8BG4BCQC2QAScAaIMbfoYUQwmxqVY1mydfdaNU4MAbu1m0/RZubZ7N0
+cnfVUUSQemZQE9URihn/414Opf3zxK3rzl8OB1SvYOOKFpFEhHk00yltSCZixjakUUDZs36VO/3P
+BGRmQIgi0oYUeIzQhnS2jKwCbhiymNlLjyhK5F2hNgufvtiGe543znaWInjUqBzFgcPZqmMUWfN9
+T2587SRn3nZ0HaxWuLNHPA/fkEBclPu7IEkbkrmYsfIaBgwA+gGdgIZAeaRQEEIIv4qJsvHbR1dw
+e5+aqqN4RX6BgwEvrOCJexqpjiKC0FMDG6uOUMznP+wpNqTs0KFO5VC6t470qFAQ5mPGYkEIIYRB
+hIZa+eLN9gy7p6HqKF4zZtJ2+l5ZRXUMEWQeeG0VZWJtqmMU+WbGfjZPqAk4ZxUiwjS6t46mSe1w
+b1xe2pBMRD6ZQgghPGKxaIx6oiXvPNXSlL2tJZm+IJnm9ePZP1cWPgv/GXxTXdURiqRlFjB9QTLg
+nERoWjOM7m2iiI60emNWwdcHtpj7QBiDkWJBCCGEVwy5syE/vteJiLDA6ArdtCuNtjfPYtXUnqqj
+iCDx4K31CbEap+T+ZnoSDh0SYqz06RhDw+qhzmkGz8nMgonIJ1MIIYTX9O9WjQVfXEXFsl5pVVDu
+2Mk8Ot/1J798eIXqKCIIVO06jRt7Vlcdo8jviw6z5tPqdGwaQbc2UdhsmrfWKvj0EFw/XD+oSLEg
+hBDCq9o0K8uKb3vQtG6c6ihekZNnp//Di3jvmVaqo4ggMOSOBqojFMkvcPDT3IPc2CWOyuVCvHl6
+ga+nHwNjetMgpFgQQgjhdTUqR7Fkcnd6XpaoOopX6MCQEWt57M7AWcgtjKntLbNo16ys6hhFpszY
+T5uGYd7e/cjXeynJXk1eJMWCEEIIn4iNtjH9487cf7NxFm166t2vdnBTL+O0iYjAZKSFzvNWHOVU
+ap63H79lZsFEpFgQQgjhMyEhFj5+sQ0fPd8aq8U4Czc98f2sg1zRqgL5qRtURxEB6p7nlxMXbYxt
+VHXgh1kHvH1Z7zU0qbl+UJFiQQghhM89cGs9Zo+7koS4UNVRvGLR2uNc2rozh/66TnUUEaDuuLam
+6ghFps075O1L+nrkIDBGJgxCigUhhBB+0bV9Iiu/7UHjOrGqo3jFlj1pXHbbHHbM6KM6ighARmpF
+WrDqGCdT87x5SVmzYCJSLAghhPCbOtVjWPZND/p0rqw6ilfsP5xNp9vnyFkMwuua9vudjpeUUx0D
+ALtDZ8bCZG9eUooFE5FiQQghhF/FRtuY9sHlPDOoseooXnEiNZ+uA+Yxf9JVqqOIAHP3dbVURyjy
+89y/VUcQikixIIQQwu+sVgtvDGnBj+92IjoyRHUcj2VmF9J78HxmfNJZdRQRQAY89SthNmM8qs1a
+cpic3EJvXU7WLJiIMb4ChRBCBKX/dK/Gqqk9aVgrRnUUj+XmO7ju4UVMHXOZ6igiQFjDE+nbpYrq
+GABk59qZs/SI6hhCASkWhBBCKNWwdiwrvu3Jf7pVVR3FY4V2nf8OW8qXb3ZQHUUEiNv71lQdocgf
+iw+rjiAUkGJBCCGEcrHRNn54txNvDmmB2Y9jcOhw97PL+fzVdqqjiADQ76GFhtlyeLb3ZhZ8/fwp
+z7deJJ9MIYQQhqBpGk8PasyscV0oa5CHI3fpwKCXVvLJi21URxEB4Kaexjg1fM/BTPYezPTGpeze
+uIjC6wcVKRaEEEIYSrcOiaz5oReXNiqjOorHHnhtNWNfaqs6hjC563tUUx2hyKwlXmlFkgXOJiLF
+ghBCCMOpUTmKxV93M9TWke6679VVfPayFAzCfd0GzjNOK5J3igWZWTARKRaEEEIYUkR4CBNeb8dH
+z7fGFmLugcLBr6xiwuuyhkG4r19XY+yKNG/FUQoKHJ5exuqNLAqvH1SkWBBCCGFYmqbxwK31+Gvi
+VVQsG646jkfufWEl374l26oK91zf3RitSOlZhazectLTy3hcbSi+flAx41CNHOEtiAizUjY+lLLx
+Yad/hVI2Luzc3zv979VaPswjDz/AuB/2qI7uN7ou3yqBRtPUvmXrW25Vev+Dh7Po/8gi1mw9pTSH
+J6wWjR/f60S/hxaqjiJMKC7aRnqW1w5Gc9uooZcwbEAjt1+vNZmSDsR6L9E50oE4H14/qJj/2Exh
+ahYNysSGnvNwX/TvZxUACXHOf1btOs29e8k8mhCmVq1SFIu+6sagl1Yyefp+1XHcYnfo3PT4EmZG
+dqXrgHmq4wiT6dmpEt/POqg6BovWHPOoWEBmFkxFigXhNe6M9ocn9lAdWwhhIhHhIXw1ogOXNCzD
+U2PW4zDhBFp+gYN+Dy9iXlRP2tw8S3UcYSK9O1U2RLGweO1xHA4di9kPRRGlIsWCOIcro/1n/lml
+i3uj/UII4SpN03jinkY0qh3LLU8sJTNbfVuGqzKzC+k9eD6Lo/rQsM901XGESfTslKg6AgCn0gvY
+tjeNJnXjVUcRfiDFQoCLDLcWG+VPkNF+IUSAuKZzFZZO7k7fBxaw/3C26jguS0nLp/fg+Sz7pj+J
+nX9WHUeYQOUrp9GiQRk27EhVHYVFa457UixIG5KJSLFgEjLaL4QQ52pWP56VU3ty3cMLWbYhRXUc
+lyUlZ3HN/QtYs1V1EmEWvS+vZJhi4b6b6yZsgegAACAASURBVLn7cl+vIpRVil4kxYIC/x7tP/sB
+/8wiXhntF0KI0qlQNpx5E69i4Asr+GaG+RY+r912imuuqMyMhcmqowgT6NWpMiM+36Y6Bqs2ma84
+F+6RYsGP4mNsnErPVx1DCCECTniYla9HdqBWlSiGf2a+YfrfFx3m0dsb8N7XO1RHEQbX+a65hA2y
+kuf5wWge2XUgk7SMfOJi3DpZWtqQTESmadz06aefouu6S7+kUBBCCN/RNI3XH23B56+2xWrCXVre
+n7yTj19oozqGMIH2LcqqjgDAWvfPPJE2JBORT6aLzjz4Dx48WHUUIYQQJRh4fR1+/7QzMZHmmzx/
+5I01zJ90leoYwuA6t6mgOgIAa7Z6fJKzMAEpFoQQQgScHpdVYtFX3UgsF646ikvsDp0bhiwmac61
+qqMIA7uyTUXVEQBYs0WKhWAgxYIQQoiA1KJhGZZO7k7d6tGqo7gkJS2f6x5epDqGMLAu9/xJqE39
+I5wHxYK0IZmIfDKFEEIErFpVo1nydXdaNS6jOopLNuxIZeB/6qiOIQzMCF/Tuw5kkpFV4M5LfX2S
+ovlOajQwKRaEEEIEtAplw/lr0lV0a2+M1o3SmvDzXia83k51DGFQbZoaY5Hz9r3p7rxMZhZMRD6Z
+QgghAl5MlI3pn3Tmuq5VVEdxyUOvr2Hrr9eojiEMqE2zBNURANi6J82dl9m9ncPP1w8qUiwIIYQI
+CmGhVr5/pxO396mpOkqp5eTZueWJJapjCAMyyszC1j1uzSxYvZ3Dz9cPKlIsiKChYb5914UISBrO
+nz4KviVDQix88WZ77ruprv9v7qZNu9J49PYGqmMIg2lwzXRio9RvD+zmzILu7Rx+vn5QkWJBBA2L
+fLULoZ4G+QU6qRl2cvJ0JT/RLRaNj19szZA7zPMA/v7knfw1Uc5fEMW1NsDswjb31izIzIKJyOOT
+CBoWE57oKkTAsIAD2Jucz5S5abw99STjf09l2/58HA7/x9E0jbefasljd5qnYLj7ueWqIwiDadEg
+XnUE9h7MJCfX5c2HfP1dr+BdJXCpn78Swk80TYoFIVRwAEdPFLJuZy6/Ls1k6eZssnIchIdpbNmb
+y9Cby1K3aqjfGwc0TWPMky3RNHj7ix3+vbkbDhzO5sFb6/HRlF2qowiDaFI3TnUEdGDf31k0di2L
+zCyYiMwsuGjPnj2qIwg3ycSCEH6mQb5dZ9GGbF7/8gRjpqawe18WoZoDTYOcPJ0lm3NYvClbXURN
+461h5plh+OTb3Syd3F11DGEQTeupLxYAkpKzXH2J7IZkIlIsuOimm25SHUG4SdqQhPAjDfLydWYu
+y2LUlBT+WptFvYQCXumrc/dlEBcB6JCX7yD5eCG6Q916xDMzDINvMv4haDrwv5dWqY4hDKLdLbNV
+RwBg39+Zrr5EzlkwEflkumjt2rWqIwg3SbEghP/Y7TBvXRYfTzvJroN5tK2p82BnuKwuNKgA4bbT
+XUcaaBZN+W5lmqbx8QttTLGt6pY9abzz1KWqYwiDqFEpUnUEkg7JzEIgk2JBBA2pFYTwEw027c1j
+4u+p7EnOp1ZZGNgRGiVCoR2OpENOvvNDQ60WysVZDPHTyGLRmDi8Hf2vqqo6ykW99OEmjizorzqG
+MIDGddS3IrnRhuTrn8jyE9+LDPD2LIR/2ELky10In7NAWpaDGcsy2LI3j7AQuKYZtKzuLNgzcmHL
+YcjMc/53bJSFhjXCDPOjPSTEwjejO3L5peVVR7mgjOxCXv1ks+oYwgDqVI9WHUFmFgKcPD2JoBFq
+ky93Ifxha1IuizZmk5WnU78idG8E4SGABnuOw9ZkKHCApkGdKjbqVvH/TkgXEh5m5ZcPr6BxnVjV
+US7os+/3sPP3PqpjCMVqVzVCseDymgXZDclE5OlJBA0pFoTwMQ3y8mDtjlwOHC0gNAQ61IZqCc7C
+ICsXFu6GPSecEwnhoRY6NY+kXJzVUMUCQJm4UP4YeyVVKkSojnJedofOyx/J7EKwq2WAYuFEaj4F
+BS4dbSDnLJiIPD2JoCHFghA+psGpjEK27c8nK89BXAS0rAZhIeDQYdV+mLXFuV5B06BJzVC6towi
+JMQgPUj/Uq1SFL9+dAWR4cYdpPz29/1s++0a1TGEQrWrRqmOAMDxU7mufLivz/mSc8S8SJ6eRNAI
+CzXuD3whAoPGqUwHyScK0XWN6HAoHwO6DpsOwZcrnLMKAOXirNzYJZYaiTY0g80qnO3Sxgl8NaKD
+6hjnpQNvjtuqOoZQqHn/maojAHA0xaViQWYWTESKBRE0ZGZBCN/THTp2h44G5BbAlmSYugZGzobl
+e8Fhh8gwC306xtClZRQ2qzFnFc72n+7VeP2R5qpjnNeU3/dz6K/rVMcQCsXH2FRH4OgJl4oFYSJm
+fHoy8BiUMDIpFoTwNZ34WCtVK9iwWOBEBrw1B0bNhjX7Ia8QoiI0+naI5s4e8ZSNM89s3zODGnNt
+lyqqY5So0K7z0ZRdqmMIhSqVV7+2xsWZBWEiZnx6KlQdQJhTWKgZv9yFMBEdysdZ6d4qitqVQnEA
+qVmQmQsWK9RMtHFb9zjuu64MNRJDTDX0Y7FofPFGe8P0h//bhJ/2qo4gFEosF646grQhBTAzLgAp
+BNTPtwnTiYww45e7ECaigy1E46pWUdhsGks2ZnPkVCGhNo2q5UNo1yiSNo0iiI+2mKpQOCM+NpQf
+3u1E+1vnkO/azi8+dzQllx/fvZzrhyxSHUUokFhO/czCiVN5rny4r0fvZHTQi8z49CQzC8ItUVIs
+COF7OsREWejVPorLmkWSnm3HFqIRF2khMtxS9DFm1bJRAm8OacHQ0etURznH5OlJXD9EdQqhghFm
+FjKy5PEsUJmx8pKvRuEWKRaE8BMdrJpGfIyF6ok2KpUNITLC/IXCGUPubEDXdhVVxzjH7wuTVUcQ
+ihihWEjPKnDlw6UNyUSkWBBBw8h7pQsRcHScP67tp//pICAKBXCuX5g0vB0xkcYagMgrcPD9O51U
+xxAKJMSFqY5AeqZLxYK0IZmIGT+ZUiwIt8jMghDCW6pVimL4o8bbTnXmIpldCEax0ep/vrlYLAgT
+MWOxIF+Nwi1RBhsFFEKY2wO31qNN0wTVMYqZu+yo6ghCgdgo9fu+yJqFwGXGYkG+GoVbKnX+WXUE
+IUQAsVotfPhca9Uxijl4JJu/58kBbcEmNlp9sZCWme/Kh0sbkomY8ZMpxYJwm/HPihVCmEnb5mW5
+uVd11TGKWbExRXUE4WdxBjjBOS/fpTXFvn6Wk2dFL5JiQQQVI4y+CCECyxtDWhBiNc5QxOZdqaoj
+CD+LiVT/s62g0KViQWYWTMSMn0wpFoTbysSGqo7gF1aLcR5cRGAw0sOw0dSuFs2tV9dQHaPItr3p
+qiMIPwu1qX+cK7S7tN2Z3Vc5/HT9oKL+q8t1UiwIt8XHqh998Qd5sBPeJl9TFzZsQCPVEYr8fTRb
+dQThZzGNnlQdgQLXTjX39V7msle6F0mxIIJKfEyQzCzIg13AseceUXp/W4gZf1z4T7P68VzZpoLq
+GAAcPp6jOoLws6gKHVRHcLUNydenrgTIqS7GYMZ3/yzVAYR5xRtgEZg/yChw4Fkz7mGl97cZoM3B
+6O7qV0t1BAAys2VMTfifi21IMrNgImZ8989QHUDT5EHMrOKDZM2CjAIHnmrN1T4ASgF6cV3aVVQd
+AYCcXGnXFv7nYrHg0jSEG3x9/aBixieKTNUBhHmVLxOmOoJfyAF0gcfFfmCvkwL04kZP2KY6AgAh
+IVLYCf+zufZ15+svUvkm8CIzvvsrn1kQ5lWhbLjqCH4RFSHFQqBxsR/Y62Rm4cK27E7l06m7VccA
+IDxUOjCE/7m4I5OsWTARKRZEUAmamQUpFgJOQaHan32yZuH8CgsdDHx+JXaHMZ5PgmVQRBiLi7OP
+UiyYiBnf/aVYEG4Llh+iUREyshhoCu3ShmRUI8dvY8Um45yanFguON7nxD9yj8xWHcEQZz0I3zDj
+/1kpFoTbKiQExw/RhLjgmEEJJtKGZEzLN5zglY83qY5RTK0q0aojCD9L2/mJ6giuFguyZsFEpFgQ
+QaVCQnA8RJeND45dn4JJRpba3ZBkZuFcR47ncP2ji5W3iP1b3epSLAQbI3wNysxC4DLj/1kpFoTb
+ql31i+oIflE2PjiKomCSnlmg9P6yw05xefl2bnp8CckGPADtkkZlVEcQfqZ65hFkQCGQmfH/rBQL
+wiPBMLsgxULgSctQWyzIovl/OBw6dz69nEVrj6uOcg4NuOzqp1XHEH6Wm6f+bA0XZxZ8/fxpxudb
+wzLjJ1OKBeGRaomRqiP4XDAURMEmPUttsRAbFRynn1+Mrus8PnIt3806oDpKiVo0jCc8sYfqGMLP
+0hTPPAKEh8nGGoFKigURdKpWDPxioUoQ/B2DjeqZhdhoKRZ0Xef59zby3tc7VUc5r+4dElVHEAqk
+puerjkCZWJfWyskJziYixYIIOlWDYGYhGAqiYJOWqfZhINiLhTOFwhvjtqqOckHXXVVVdQShQKri
+wQRwuVgQJmLGJtRTqgMAaJqGrqvffUC4LhjakBr2ma46gvAy1Qucg7lYcDh0nhyznjGTtquOckFV
+K0bQ8bY5qmMIBVTPPIIUC4HMjMVCKlCIObMLA6heKbCLhbggfqgLZKp7koN1zUJ+vp0BL6xg8vT9
+qqNc1F39aqmOIBRJzTBAG1KctCEFKjM+cDuA40Al1UGEOdWtHqM6gk/VqxHYf79gJTML/peeWcCN
+jy1m9tIjqqNclAYM+E8d1TGEIoYoFlybWZDdkEzErJ/MY6oDCPNq1nmo6gg+JcVCYFLdZhAbbcax
+JfftOZBBh//ONkWhAM61CrV7/qo6hlAkJVV9sZDg2syCMBEpFkTQCU/sQZnYwB0lrVdDTm8NRMdO
+5iq9fzC1Ic1bfoS2t8xm65501VFKbdiARqojCIUOHc1WHUF2QwpgZi0WjqoOIMwtkFuR6teIVR1B
++MDh44qLhSBoQ9J1nbcmbqPHoPmcTFM/UltavTpVosN/Z6uOIRQywkni0oYUuMz6yZSZBeGRQC4W
+WjSMVx1B+IDqBc5xMYFdLJxMzaPfQwsZ9tZ67A5z7XT3+iPNVUcQiiUfU18sJJYLd+XDZWbBRMza
+hCrFgvBIg5qBWSyE2iw07fe76hjCy/bOulZ1BGIiA7dYWLruOP8dtpT9h9W3crjqrn61aHXjH6pj
+CMWOncxTHcHVbcllZsFEpFgQQalZ/cAcfW9cR1qQAtFhA7QYlCsTpjqC1xUUOHjt080MH7sFk00m
+ABAbFcIbQ2RWIdgdmNtPdQTiY2xEB9G6pmAjxYIH5GA282paL051BJ+4tFGC6gjCB46cULteITzU
+EnBtSDv2pXPH08tYtfmk6ihuGzn0EipfOU11DKHYIQO0IFWt6PL5RdKGZCJSLIigVP/q6YSHWsnN
+D6z3k44ty6mOIHxA9cxCYrkINE1TmsFbCgsdvPPlDl78YKOpv/+vaFWe+15ZpTqGMICkQ5mqI7ja
+ggTShmQqZi0WZDck4bHGdeJYu+2U6hhe1fESKRYCkfpiwaWFi4a1eVcqA55fYerZBHC2H305ooPq
+GMIgdiZlqI5AtUouFwvCRMxaeR1XHUCYX6DtGhQfY6NR3xmqYwgfOHxCigVP5OQW8sL7G7n0hj9M
+XygAfPxCG2p0+0V1DGEQuw4YoFhwfWZBmIhZi4UcwPzv+EKpNk3Lqo7gVVe2qaA6gvAR1dsiViof
+ofT+nvh9YTJNrv2d18duoaDQ/GvM7rupLrc9tVR1DGEgu/absliQNiQTMWsbEkASIKs5hdvaNgus
+YqF7x0qqIwgf2XtQbU9yYjnzFQsHkrN4fNRafpzzt+ooXtOmaQKfTN2lOoYwGCO0IVWvFKU6gvAh
+sxcLl6oOIcyr1Y1/EGazkldg3kWOZ+vRMVF1BOEjSclZSu9vpjakrOxCRk/cxsjPt5p6AfO/VS4f
+wbQPLlcdQxhMeno6qRlqD2wEaFjb5W27ZTckEzF7saCcbJ9qbi0blWH5xhTVMTxWq0oUdXv/pjqG
+8IF9s69V3j5jhmJB13WmzNjPU2+v5++j6reS9KbIcCu/fHi5bJMqzrH5t+tVRyAu2ubOe4Svt1cL
+jO3bDMLMxcI+1QGE+bVvUS4gioX/dK+mOoLwkd0GWLxo9DakhauP8eRb61mxyfzfy/9mtWh8/04n
+Wt80S3UUYUAbdqSqjkCj2rHubK3s6xEQGcX1IjMvAElSHUCYX5e2gbEo+IYeUiwEqt0H1O+hXqm8
+MWcWtu5O49oHF9D5rj8DslAA+PzVtlx933zVMYRBrd+ufvvvRnVcbkEiLNQS6oMoZ5NiwYvMPLOQ
+pDqAML9r7v0OyyOVcJj4baVKhQja3zpbdQzhI3sUL24GqFDWWMXCgeQsXv1kMxN/3mvq792L+eDZ
+Vtz93HLVMYSBrTPAWUGNase5/JqIMGtEXgCtKQp0Zi4W9qsOIMzPGp5IqyYJpt57/bY+NVVHED60
+W/G2iFUqRBAWalWa4YzDx3N4c9xWxn63m/wA2ZjgfEYNvYSHhq9WHUMY3KadxmhDcoOsWTARMxcL
+GUAKEFj7Xwq/69K2oqmLhbuvq6U6gvAh1W1IdapFK70/wIlTeYwav5UPv9lFTp5ddRyfe/vJljw2
+cq3qGMLgNv9ytSF2/HKnWJB9YczFzGsWwCCtSG4s7BEG0vty855P0KFFWTm1OcDtOah2ZqFOdXXF
+wtETOTz51jpqdv+F0RO3B0Wh8OFzraRQEKVihPUKYTYLNau4fsaC7CJpLmaeWQDnjkitVIcQ5nbl
+3X+SMCSMk2n5qqO4bPBNdVVHED6UNOda5SOHdarF+P2eyceyGT1hO2O/2x0UBQJAiFVj0vD2cjqz
+KLXVBpgRb1Y/HqvV9XHnQrvPiwWzD4YbitmLhSTVAURguOaKynz1W5LqGC5JLBfOXc/K4sdAtn67
++n5kf7Yh7T2YyVsTtzHhp70Bc1hiaUSGW/n+nU6y65FwyeK1x1VHoG2zBJdfcywl1wdJzmG+0T8D
+M3uxIGctCK/o17Wq6YqFB2+tpzqC8LENBmgz8EexsH7bKUZN2MbUmfsDenejkiSWC2f6x51pdeMf
+qqMIkzHCYEKbpq4vG7U7dOy+n1mQ/nAvMnuxsFV1ABEYrh+yiOjnbGRmF6qOUioxkSE8NnSY6hjC
+x4zQk1zbR8WCrussWHWMkeO38cfiwz65h9E1rRvH9E86U6PbL6qjCJOZO74rdgNU1m3cmFnYmZTh
+j0MQ0n1/i+Bh9mJhi+oAInDc1LM6E37eqzpGqQy5swFRNe5QHUP4mOrTWeOibSTEeffsJIdDZ8aC
+ZN74bEtAnJ7urmu7VOGXeX+rjiFMatGaY6ojEB0ZQsNaru+EdPBIFoWFPm8zNMfIn0mYfQHIceCE
+6hAgOyIFgrv7m2ML0vgYGy+9M1d1DOEH+w5lKb1/nWrRXntvKyx0MGVGEi36z+TahxYGdaHwzKDG
+UigIjyxeq/7Rp1XjMm4tbk46lOWPdsM0n98hiJh9ZgGcswudVYcQ5nf5HXOp/Ww0e/9W+4B2Mc8P
+boI1PFF1DOFji77qpjqCV7ZNzc2z8+Uv+xg5fqvhv7d8LSYyhC9HdOC6hxeqjiJMbvkG9cWCO+sV
+AH6bf8jLSUrkl5sEC7PPLIC0IgkvevDW+qojXFDDWjEMHb1OdQzhBxsMsHjRk8XNGVkFjJm4jdo9
+fmXwK6uCvlBoWjeOVd/1lEJBeGzRV93IzlW/pbA76xUAjqXkeTnJOXTA5zcJJoEysyCEVzw+ai2v
+fGwjPcuY7Y4fPNdadQThJ0ZY3NyodpzLr0lJzeODyTt5/+sdnEov8EEq87n3+tqM+2GP6hgiQMxc
+ZIwNAdo3L+fya+avPMrfR7N9kOYca/xxk2ARCDMLsiOS8KpBNxrzoLMB/WvTbeA81TGEn6zbpr5Y
+aNEgvtQfe+hoNkNHraVGt1945ePNUijgbDuaPLKDFArCq/4wQLFQp1o01Su7fnIz+OVANjuQ7Oub
+BBOZWfAiTdPkCPMAMOSOBnz0zU7lJ+eerXqlSMb/JA8cwUT1TkghVo2GtS++08nu/RmMmrCNL37Z
+R34QHaR2MR1alOXrkR2p3fNX1VFEADmyoD/rDDDr2LVdRbde995XO7ycpEQFgOwg4EWBMLNw/PQv
+IbyiatdpDLmzgeoYRSwafPFGe9UxhB8ZYQ/1hrViCQu1nvfPN+44xX+HLaXBNdMZ98MeKRROs1o0
+Xn6gKUvXn5BCQXjd7KVHVEcA3C8WUjP8MuOYDPilKgkWgVAsgIFmF0RgeHPcVsp6eX95d735WAuu
+vPtP1TGEHy1eq378o0XDkluQlq47Tt8HFtDiP38w5ffgO3H5QhrVjmX5lO689NEm1VFEgJq5yBjd
+NV3aVnDrdau3nPRykhJl+OMmwSRQigVZtyC87o0hLVRHoP9VVXlyzHrVMYSfLTFAsdC8/j/Fgq7r
+zF5ymCvvmstlt89l+gJjPLAYhUWDoXc3ZOueNFrfNEt1HBHAZi1Rv16hcZ1YKpaLcOu1uXl+2cVp
+EqD+ExVAAmHNAoAM4wiv+9/LK/lhdiXmLFMz7du2WQI/zT2o5N5CrWUG2EO9RYMy2O0Opv15iDc+
+28JaAyy4NqLGdWKZ8Ho72t0yW3UUEeBmj+tiiI0D3G1BGjt1N3bfL27WgeA98dFHAqVYWKU6wBmy
+yDmwjH+tLU37/e73rVTrVY9m5pcD/HpPYQxrvu9FVo76PdS37U3j0TfXsCNJZvRLYgvRePrexrz6
+yWbVUUSQ+GG2MQaP3C0WwPkk72O5wDTf3ya4BEob0ibkAA7hA9Wu+oWvR3ZE8+M9q1eKZM74riRc
+MtqPdxVGsWSd+hYkiwaPjVwnhcJ5dLq0HOt/7C2FgvCrnw0w02zRoHNr99YrfD19n5fTlCgfyPTH
+jYJJoBQL+YAcayt8ou+DC3j7qZZ+uVeDmjHMm9CVGt1+8cv9hPEYYXGzLFouWUJcKONeacuiNcdp
+fO0M1XFEEJk7visnUvNVx+CyluVJiA9z67XZ/pkxXeaPmwSbQCkWAFaqDiAC15ARa3n4tvo+vcd/
+r6nB9n3p1On1m0/vI4xt4Wr1xYI4173X12Zf0t/c++IK1VFEEPph9gHVEQDo17WK269NPp7jxSTn
+tcsfNwk2gVQsGOYdXNP82bQi/OX9r3fw1MBGXr9u22YJzJvQlcnTk7x+bWEu637sxdGUXNUxxFla
+NS7D8indGffDHmLjy6uOI4LUT3OMccZYv65V3X5tVrZf1v4t8MdNgk0gFQsysyB8bsTnW1k+pTs9
+L0v06DqJ5cK59/raLPumOys2ptDlHjlHQcDMRbLbn1FUSAhj/GttWb3lpOx0JJSa8Ulnjp9Svyyz
+cZ1Y6taIcfv1BYU+P7hRB5b6+ibBKFB2QwLYA5wCyqgOIgJbu1tm88ctcPDPfsxcdJgVG1PYsjuN
+Q8eyOZmWT26eHU3TCA+zEBkeQsWy4VRNjKRWlSgubZxA6yYJXHL9TNV/DWFAf0ixoJwtROPR2xsw
+euI21VGEAGDiz3tVRwA8m1VYvTml0O7Qff3MmYOcr+ATgdYv8wfQU3UIQLZPFUK4xJ57hLCoythl
+dbEyN/SoxojHWsi6IWEY6enplCsbT0Gh+veF5VO60655uXP/QDv9S+e8e6P+tfKoftU98zQf/y1O
+AmV9e4vgFEhtSCDrFoQQJvXzJzcYolCIjbapjuB37ZuXZcnX3fh+1gEpFIShTHyziyEKhcRy4bRp
+WsJzuAb5BTqpGXZy8vTznqPw05yDvi4UANScoBoEAqkNCWTdghDCpIyyXuHu62rx/tc7Vcfwi/o1
+YnjzsRb859FFqqMIUSKjtCD1vbIKFstZg6AWcDggKTmfRRuy2ZNcQIWEELq2jKJhtVAs/xqKnrXY
+L+9vwfHGpUCgFQuGOclZCCFc8Yd/fpheUESYlZfub8qXv+wjNaNAdRyfqVQunJceaMbgV2R8SRjX
+uh97sWFHquoYgHNr7zMcwNEThazbmcuvSzNZujmbrBwH4WEaW/bmMvTmstStGlrUkpR0KJNDx/yy
+bWqaP24SjAKtDekYBtpjV1qRhBClseGn3v7ag/yC2jZLICE+jIf+69szRVRJiAtl1NBLSD6eI4WC
+MLyx3+1WHQGAqhUjuKJ1BWfLkV1n0YZsXv/yBGOmprB7XxahmgNNg5w8nSWbc1i8KbvY6z+YvJOc
+XJ8fyKYD3/j6JsEq0IoFgHmqAwghhCt+/euQ6giA83RWgEdur09EmFVxGu+JjQrhpQeakpKax7C3
+1qmOI8RF5adu4Ktfk1THAOC2PjWxWDXy8nVmLsti1JQU/lqbRb2EAl7pq3P3ZRAXAeiQl+8g+Xgh
++lnrr1ZvPnnetQxeZAfUH3EdoAKxWJAN64UQpjJ1pjFOZ+3Y0rnTSfmEcO69oY7iNJ6Ljgzhuf81
+5ujuGbz80SbVcYQotfeH302270fjS+W2PjWx22Heuiw+nnaSXQfzaFtT58HOcFldaFABwm2nu440
+0Cwa2unNNuevPMryjSn+iHkSWO2PGwWjQCwW5qsOIIQQpbXl16vZskd9q60GdGjxz7aIQ+9uiNVi
+zlbK6MgQnr63EUe2TuD1sVsIT+yhOpIQLvlwsjHW6rZoEE+zBvFs2pvHxN9T2ZOcT62yMLAjNEqE
+QjscSYec02P6oVYLlctaizbm37U/g/wCnx/GBpAMZPrjRsEoEIuF48AG1SHOkHULQogLMcqsQuum
+zvUKZ9SoHFVsUaMZxEaF8PzgJhzZOoE3x20lqsYdqiMJ4bKf37+c/YezL/6BfnB735qkZTmYsSyD
+LXvzCAuBa5pBy+pg0SAjF7Ychsw853/HRlloVuef95G3v9jur6hr/HWjYBSIxQLIugUhhEl894cx
+ioVenSqd83tPDmykIInrEuJCeeXBoCraogAAIABJREFUZpw8cZDXPt0sRYIwNaNsXawBt15dg61J
+uSzamE1Wnk79itC9EYSHOD9gz3HYmgwFDtA0qFPFRq1KoYBzF6Rk/+yCVAh8648bBatALRZk3YIQ
+wvA2/NSbHUkZqmMA0POyc4uFpvXi6XtlZQVpSqdy+QjGDGtJSmoeL364EWt4oupIQnhk3Y+9mL/q
+mOoYAHRpV5FyCZGs3ZHLgaMFhIZAh9pQLcFZGGTlwsLdsOeEs7AID7XQqXkksZHOR8svpu0jI6vQ
+H1HTcBYMwkcCtVhYhHNlvCFIK5IQoiRTDTKrEBdto13zEk5nBZ6+t7Gf01xcXLSNz15uw6Fj2Tw+
+aq3qOEJ4zfCxW1RHKPK/G+twKqOQbfvzycpzEBcBLatBWAg4dFi1H2Ztca5X0DRoUjOUri2jig5v
+W74xxR+7IAH8haxX9alALRbSkdOchRAGZ5QWpG4dKhISUvKPg44ty3NFq/J+TnRhmdmF9ChhJkQI
+M9v66zX8NOdv1TEAqFg2nP5XVeVUpoPkE4XoukZ0OJSPAV2HTYfgyxXOWQWAcnFWbuwSS41EGxrO
+XZAWrvbLDIkOGONAigAWqMUCyLoFIYSBrZrakz0HjbF5R69OF241enqQsWYX7A6dMZP8tnBSCL94
+c9xWf43EX9S919cmNDwE3aFjd+hoQG4BbEmGqWtg5GxYvhccdogMs9CnYwxdWkZhszpnFTKzC/21
+9Ws6MNYfNwpmgVwsGGrdgrQiCSHO9vmPe1RHKNLzsgv3+vfqVInm9eP9lKZ0Pv9hDyfXD1MdQwiv
+2DvrWqb8vl91DMC5q9H/bqwL6MTHWqlawYbFAicy4K05MGo2rNkPeYUQFaHRt0M0d/aIp2zsPwc5
+PjbSb+2BB4Akf90sWAVysbAMyFIdQgghSvLNDGM8GDSuE0u1SlEX/BhN03j6XmPtjJSTZ+edT2eq
+jiGEV4z4fCt2hzHmFfpeWYXqlaNAh/JxVrq3iqJ2pVAcQGoWZOaCxQo1E23c1j2O+64rQ43EkKLX
+r9lykoP+2fpVB0b740bBLuTiH2JaucAfwPWqgwghxNk+f7UdmdnG2LyjpC1TS3Jjz+o8//5G9v5t
+nDGYD7/ZyWufqk4hhGf2z+3HpGl7Vccocv8t9Zz/ooMtROOqVlHYbBpLNmZz5FQhoTaNquVDaNco
+kjaNIoiPtnB2/9RbE7f56yC2bOCgP24U7AK5WACYhoGKBU3T0HVjjBwIIdT57HvjrMcracvUkoSE
+WBg2oBH3v7rax4lKLzWjgLeGteSJ0etURxHCbS99uImCQmM8G9SpFk33jme1JeoQE2WhV/soLmsW
+SXq2HVuIRlykhchwS9HHnG3p+hP+WnuxFDDOG1IAC+Q2JIAZGGgLVSGEWP9jb1ZtPqk6BuDcgvTK
+NhVK/fF39atFxbLhPkzkurdlobMwsU3TrubLX/apjlHkvpvrFm19WkQHq6YRH2OheqKNSmVDiIwo
+uVAYO3U3h4/75SA2HdgIGGOXiAAX6MXCKWTvXSGEgRhpVuG6q6oSGmq9+AeeFhEewpA7GvgwkesO
+n8hl3CttVccQwi3PvrvBMDsgxUaFMOiGOiX/oQ44cA6/Ok7/KiF4Wma+v2ZJMoFJ/riRCPxiAZyt
+SIYhuyIJEdwmT09SHaHIjT2rufya+2+pS2yUsTpYR03YpjqCEC5b/FV3pi9IVh2jyP231CMuJtSj
+a3w61W+DIceBnf66WbALhmLhF9UBhBACYMLr7UjPMsbC5rhoG907XHjL1BJfFxPKA7fW80Ei9+0+
+kMn373RSHUMIlzz9znrVEYqE2iw86uGsYVZ2ob9akADeBfL9dbNgFwzFwkFgjeoQQgjx9qQdqiMU
+cbUF6WyP3t6AMJuxfny8+dlW1RGEKLWf37+cJetOqI5R5O7ralGpfIRH15jw0x7y8v2yC1IOsMkf
+NxJOxnq39x1pRRJCKPX7p1eyZU+a6hhF3GlBOiOxfAT39K/txTSeW7f9FLPHdVEdQ4hSeXykcXbw
+0oAn7vH8HJWPv93lr/UXy5GD2PxKigUhhPCDUeONM/LtbgvS2Z64pyH/3jRFtRGfG+dzLMT5vPpQ
+c5KSjXNeyQ09q1GvRoxH11iz5aS/zmDRgb+QYsGvgqVY2ALsUR3ibDK7IETwWPltTxasPq46RhFP
+WpDOqFM9hpt71/BSIu/4a+UxVnzbQ3UMIc5r/9x+hitqnxrY2ONrvPzRJn8dxJYCLPLHjcQ/gqVY
+0IHvVIcQQgSn0RONtVuPJy1IZ3tqoOetC942YpyxHsSEONvQUWvJyTPO8U/d2lekVZMEj66RfCyb
+lZtSvJToopIA46wMDxLBUiwAfKU6gBAi+Oye2ZcfZx9UHaNIfIznLUhntGhYht6dSncCtL9Mm3eI
+rb9eozqGEOeYO74rP875W3WMYl57pLnH13j1k80cP5nnhTSlMhpI9dfNhFMwFQvbgFWqQ5xNWpGE
+CHxjJm03zKFLALf1qelxC9LZnh7keQuDt8m5C8KIHh6+WnWEYq7tUoX2Lcp5dI3kY9n89leyv97j
+MpAWJCWCqVgA+FJ1ACFE8DiyoD+Tpu1VHaOYgdd7dxejy1uVp0OLsl69pqcmT0/iwNx+qmMIUeTF
++5uyfV+G6hhFNOC1h5t5fJ0X3t/kz7MVZuIsGISfBVux8C1gjBORTpPZBSEC1/DPtpDrn33HS6VV
+4zK0bORZf/K/aZrGM4OaePWaniq064yZtF11DCEA2Phzb9402FqaW6+pQfMGZTy6RvKxbKbN+9tf
+swp24Asg0z+3E2cLtmLhBDBDdQghROBLmnMtY7/brTpGMYNuqOuT617TuTJN6sT55NruGvfDHh5/
+5gXVMYRg4AsrKbQbpxnRatF4+UHPZxVGfr6Nk2l+O0T5MM5DdoUCwVYsgAFbkWR2QYjA8/JHmyko
+NM4DQmS4lVuuru6Ta1ssGk/da6ydkXLy7MSk/aw6hghybw1ryeotJ1XHKGbAf2p7fK5CZlYB43/y
+2470OjAF2OGvG4rigrFYmAEY6ztXCBFQtv56DV/9uk91jGJu6lWduJhQn13/lt41qF4p0mfXd8cH
+k3eqjiCC2O6ZfXnxg02qYxQTZrPwwn2etw12HTCPrBy/bQGbh3OTGr9NY4jigrFYyMO5dsFQZHZB
+iMDxwgcbcRhnUgGAQTfU8en1bTYLT9zd0Kf3cNWp9ALefvJS1TFEkBr4wgpDnakA8NBt9alWKcqj
+a/zvpZWs3uzXMdd1yFlZSgVjsQAGbEUSQgSGVVN78tNcY+2l3qh2LB0u8WyLxNIYeH0dysX7bvbC
+HW9/IQudhf+NeOwSFq4xzqntAOXLhHk8qzB26m4mTdvrz+2g7cBqIMt/txT/FqzFwkqcU1qGUqaM
+ZzsTCCHUe/bdDaojnGPQDXX8MnsZGRHCo3c08Pl9XHHoWA7jX2unOoYIImu+78ULH2xUHeMcbwxp
+4VEr4potJ3lyzDp/r8U6AHzqzxuKcwVrsaADH6oO8W+pqXIooRBm9sfYK5m7/KjqGMWEh1q449pa
+frvfA7fUIzoyxG/3K41R4w03NiQC2G1PLjXU7kcALRuW4Z7+nr0PPDx8NelZft193gHMAoy172wQ
+CtZiAZytSOmqQ/ybrF0QwrweeWON6gjnuKd/bcqVCfPb/RLiwxh8k2+2aHXXzv0Z/PBOJ9UxRBB4
+4JZ67Egy3rlh7z17KVar+498KzemsHxDihcTlcphYKK/byrOFczFQiYwXnUIIURgeGNIC3YdMNZ5
+QRrw2F3+X3T82J0NsIUYa+BjxOcyOCl8a8YnnflkqrHOVgG4pXd1Lm9Vwe3XZ2YVcMfTy/y5TgGc
+HSDjgPX+va0oSTAXCwAfgb+//i9OZheEMJcDc/sxfOwW1THO0b9bVY/3U3dHlYqR3NXPf61PpbFm
+6ynmju+qOoYIUAf/7Mfdzy5XHeMcEWFWRg29xKNr/Db/EDv3+322ZB/wM7JdqiEEe7GwB5iuOoQQ
+wtweH7WW7FxjbZEIMFThVqbDBjTCaMMeb46T2QXhGzcPXcKJVOM91z59b2OPt0p9eLjf2yt14B1A
+tjIziGAvFgDeVx2gJDK7IIQ5zPm8Cz/OMdZWqQAdLylHx5blld2/fs1Yru9RTdn9SzJvxVFWfttT
+dQwRYIbc0YBl/u/nv6i61aMZNsCzAYMfZx8kJc3vRdAe4A9kVsEwpFiAPzHgNqpCCHNQMOpWKsMG
+NFIdgafvbaw6wjlGjpfZBeE937/Tife+NuZJ4Z+93JaIcM92Jnto+GovpXHJ4zi3TBUGIcWCc7pL
+ZheEEC57Y0gLQ+58Uq96NH2vrKw6Bq2aJNC9Q6LqGMX8PPdvtk/vozqGCAA7f+/DwOdXqI5RooH/
+qU2XdhU9usaaLSc5ciLXS4lKLRn4C5lVMBQpFpy+BtJUhxBCmMfmX67mlY83q45RoqF3N/Jom0Rv
+evpe9TMcZ9OBURNkdkF47oYhi8nI9uu5A6VSsWw4o59o6dE1Dh/Poeegv7yUyCV34NytUhiIMX6a
+qJcJjFUdoiQyuyCEMd31zHLyCxyqY5yjQkIYd/arqTpGkS7tKtKmaYLqGMV8/VsSB//spzqGMLEb
+elRj0y5jjjF+8FwrysS5f1JzZlYB/R9epGqtwjx/31RcnBQL/xgD5KgOIYQwvlcfas7abadUxyjR
+c4ObeNyn7E2aphlu7UJBoc7bX+xQHUOY1EsPNDXkpgYAfa+szA0ebixw17PLWbFJyYLte1XcVFyc
+FAv/OAZ8rDpESWR2QQjjWP9jb1771JjtR9USIw13ejJAv65VaFDT/+c9XMhn3+/m2FpDTigLA/vu
+7ct49RPjnakCEBMZwscvtPHomWHs1N38Mu+QF1OV2ivAfBU3FhcnxUJxozHo7IIUDEIYw53PLKPQ
+brizHAF4+cGmhIVaVcc4h9Vq4amBxppdyM618/H4D1XHECay5vte3P2sMRc0A4x4/BKqJka6/fo1
+W04yZMQa7A6/v7/tBF72901F6UmxUNxR4FPVIYQQxvTc/5oYtk+5fo0Y7rzWWKcmn+22PjWoUiFC
+dYxiPphszC0vhfEcXtCffg8tJCfPeIcvAvTomMh9N3s2q/i/l1aSm+/3dVjHADn8xOCkWDjXaMDv
+e4WVhswuCKHO8ik9GDneuEeyvPpwM0JCjPuWHhpqVXqidElOpuXz7tOXqo4hTKDfQws5dMyQjQck
+xIUycXg7LBb3nxHmrzyqYh2WHbgZSPL3jYVrjPuTRZ3DwGeqQ5yPFAxC+F/Gvi+5eegSFdPzpdKi
+QTw39qyuOsZFDbqhDmVibapjFDNm0nbVEYTBXXNFZVZtPqk6xnmNfakNlSu4334E0HvwfO+Ecc33
+yDoFU5BioWQjgTzVIYQQxnDLXU9z4HC26hjnNfzR5h6NKvpLdJSNh2+rrzpGMX8fzWHi6+1VxxAG
+de/1dfh90WHVMc7rzmtrcoOHAwXdBsxT0X6Uj0G3rBfnkmKhZMnAONUhzkdmF4TwnxGPXWLoh4WO
+l5Tj6ivUn9ZcWg/f1oDIcGMtwh45Xg5pE+d66YGmjP9pr+oY51WjUiTvP9vKo2vc+sQS/lxx1EuJ
+XDIPaT8yDSkWzm8kBj5uXAoGIXxv4ZfdeO69DapjXNCbj7Uw1ftBuTJhDLqhjuoYxexIyuCn9y5X
+HUMYyGcvtzXsFqkAGvDliA7Exbh/+Noz76znh9kHvReq9AqAP5BiwTSkWDi/v4F3VIcQQqhxdGF/
+bhm6BIMuUwDg1qtrcEXrCqpjuOzxuxoSYjVWgTPic5ldEE6/fdSZ+19dpTrGBT05sJFH3/vf/r6f
+d7/coWob6CWAsUdhRDFSLFzYGzi39TIkM40mCmE2/31yGYdPGHJjNACiI0MY/cQlqmO4pXrlKG7r
+U1N1jGJWbT7JnxO6qo4hFJs3oSs3PrbY0IMEbZsl8OpDzdx+fdKhTB4evlrFOgVw7jb5C7Bexc2F
+e6RYuLB04HnVIS5ECgYhvO+ZQY2Zp6aPt9RevL8pVSp6tgOKSk8OaKQ6wjlGjJPZhWC25Ovu9H1w
+IXkFSh6iS6VMrI3v3u5EqAeHL/Z7aBEnUpV1Wf8ETANSVQUQrpNi4eImABtVhxBC+Mek4e0Z8blx
+z1MAaFgrhkdvN9auQq5qXDeO67pWUR2jmLnLj7L6OzkfKhit+b4XV983n+xcYx66dsZXIzpQo3KU
+26/vPXg+G3cqe04/gfMsqyRVAYR7pFi4ODvwmOoQFyKzC0J4x4IvuvG/l1eqjnFRHzzX2qORRaN4
+6t7GqiOcQ9YuBJ/Nv1xNj0F/kZ5VqDrKBT0zqDHXdHa/wO77wAL+WKxsZzc78AjSfmRKUiyUzjyc
+PXaGJQWDEJ7ZNbMv/R9ZSEGhgZuVgRt6VKNbh0TVMbyifYtyXNnGWAu0f5rzNztm9FEdQ/jJzt/7
+0G3gX5xMM+zmhwB0bl3eo3UKrW/8g+kLkr2YyCUO4HVgiqoAwjNSLJTeMJzbfRmWFAxCuCdj35dc
+c998TqUb+luciDArY4a1VB3Dq5422OyCDowab+w2NOEdu2b25aoB8ziaYtyNDAAqlg1nyluXERLi
+3iPbFXfMZc3WU15O5ZIfgJdVBhCekWKh9HYB76sOcTFSMAjhur43PcGuA5mqY1zUc4ObUN2DfmUj
+6nFZIpc0jFcdo5ivftvH3/OuUx1D+ND26X3ofOdc/j6aozrKBVk0mDK6I5XKR7j1+mGj17Fo7XEv
+p3LJfOBmlQGE56RYcM3rOBfoCCECxD39a7NgtdIfpqXSvH48w+5pqDqG12maxjODjDW7UFCo886X
+21XHED6y+Zer6XzXXENvjXzG6480p0u7im699v2vd/DWJKVfx5lAF5UBhHdIseCaVGCI6hAXI7ML
+QpTOkwMaMWnaPtUxLirEqvHFG+0DYlFzSa7vXo061aJVxyhm7He7yT0yW3UM4WXrf+zNlXf9ybGT
+eaqjXNQtvavztJuF9MSf9vL4yHVeTuSyvqoDCO+QYsF13wAzVYe4GCkYhLiw1x5uzuiJ5hg9fvH+
+plzSqIzqGD5jtVoMd+5CVo6dUa8/oTqG8KJVU3vS5Z4/STH4YmaA1k0SGP9aO7d+lg8fu4XBr6zE
+rvZkufmnf4kAIE+U7qkObAGMNRRWAl039s4uQqjw7tOX8pj6UbdSadW4DMu+6YHNFthjO7l5dmr1
++JUjBmoNKRsXyolU449Ai4tbOrk7vQfPN/z2qACVyoWz6ruebh26+MCrqxj73W7VJ1BnA02Q8xQC
+RmD/9PGdA8CTqkOUhswwCFHc+NfamaZQCLVZ+OLN9gFfKACEh1l5/C5jrclIScvnvWdaqY4hPDTj
+k850G2j8cxQAwmwWfv7gcrcKhTueWsanU5UXCnZgIFIoBJTA/wnkO2OBRapDlIYUDEI4ffvWZQx6
+0fiHrp3x2sPNaFLXWDsF+dLgm+oSF21THaOYMWoXiAoPfflmB/o9tIicPGOfzHzG56+1pV3zci6/
+rvfg+UyenoTiXgId5wnN36qNIbxNigX3OYBBgCnmqKVgEMHut486c8fTy1T/MC21Di3KMvRuY420
++1pstI0Hb62nOkYxB49k88Ub7VXHEG4YM6wldz27XHXvfqk9NbARt/et5fLrrhowjz8WHzbCe9t3
+wDOqQwjvkydIzz0NvKk6RGnJGgYRjH798ApufHwJ+QUO1VFKJSLMyvqfelG/ZqzqKH539EQONbv/
+Sm6+cf5fNaody9Y9aapjCBc8NbAxoyaY53C9Pp0rM+3/7d13eFRV4sbx751JI/SmUkQQFMGCgoAK
+iKKAoiwosKtYEcuuiouuAoo/264UKwoqKCo2LKAgFgSlKIiCgIhUBRM6AUJJQurM3N8fdyIQKRnI
+zLkz836e5z5JkGTeieTOfXPuOWdkO7ze0H6H2+WO2UyduyVMqUKyDqhvOoSEh0YWjt2zwBLTIUpL
+IwwSbz58tg09+s+NmqIAzgTseCwKAMfXKMctV59sOsYBVv6RxeSRF5qOIaV0y9UnR1VROPf0arz/
+9AUhF4VLbpnplqKQB/QwHULCR2Xh2BUBfQD3r8UWpMIg8eLN/51H7wfm4fNHz4ja9VfW57ZeDU3H
+MOr+Pk3wetx1nhr62nLTEaQUOrepxZuT3L93SrGGJ1bgi1faU6F8aHN1LrzhG2bOzwhTqpD4cO6w
+WGQ6iISPykLZWAI8YDpEKFQYJNaNGnwut/zffNMrg4SkacNKjH60Zdz/fDaoW4FrutQzHeMAC37d
+yaw3LzEdQw5h3TfdOKNRFabP22o6SqnVrJrMV2Mu4rjqKaX+nEXLd1LnosnMWeyKXedt4EPgRdNB
+JLxUFsrOSGCK6RChiPcLEoldw+87m35DousXXeXLeZn4fFvKpyaYjuIKbtukDWDY2BWmI8hBLPig
+M62vmc7yKJpXkpri5YtX2tPopIql/pwxH66hzXVfs3l7XhiTheRb4HrTIST8VBbKjg3cAmw0HSQU
+KgwSa+7ufSqDnv/FdIyQvfpYK5o0rGw6hmuc1bgqV1xY23SMA0yft5XFEy8zHUP28/GIdrS/6Rsy
+Mt2zmd+ReD0WE55vS8szq5f6c/oM/pG7n1xIgXvmXs0CLjYdQiJDZaFsZQLX4iyrGjVUGCRWdL2o
+Di+9/7vpGCH71z8a0fvK+qZjuM6gW5uajvAXGl1wj6fvP4ee98511cpZpTHmsZZ0CaEId7ljNm9N
+TnPT3KulQAfTISRyVBbK3lzgEdMhQqXCINFsy7dX0aJpNT7/drPpKCFr0bQqzw1sbjqGK7VtUZO2
+zUPfoCqcJk7bwO9Tu5qOEfdu7n4yA56NmoUI/zT8vmb07VG6BQzSN+Vw2hWfM9UdeygUWwo0Mx1C
+IktlITyGATNNhwiVCoNEo2WfduG8a6ezeOUu01FCVqViIhOeb0tKstd0FNdy2+iCDTz1ukYXTNkw
+oxstz6jOW59Gz4pHxQbf3pQBfUv373nqnM2cffVXrE7PDnOqkMxHRSEuqSyEhx9n0o8rlisIhQqD
+RJNPR11Im+u+Zv2WXNNRQlZ833KDuhVMR3G1LhfW5oxG7prL8faUdDbP7m46RtyZ886lnPv3aSxc
+vtN0lJD1u+5U/nvPWaX6u0+OWU73fnPYk1MU5lQhSQe0HFicUlkIny04hcFFo4elo8Ig0WDw7afT
+vd8csvb6TEc5KqMfbcml559gOobrWZblutGFwqIAz7212nSMuDL60ZZ06DOTbTsLTEcJ2c3dGzBi
+UPPDvrbuzfXxx4Ycej8wj/97canbNpHcCLQG9poOImboqjD8/gM8YzrE0bLtqOs6EuMeeugBFs5+
+l69/iJ711Esa2LcJw+4723SMqOHzBTjl8s9J3+yea5UKqQlkblpIUhXdlRFut/VsyNiP/zAd46j0
+6FiXD55pQ0LCoX83uy0zn1kLMrj90QVu/OVHOs5k5ui770vKjEYWwu854E3TIY6WRhnETRZ+1Jn3
+xr0c1UWhZ6cTGdJfF5ihSEjw8IDL9l3IyfXx1CM3mI4R09Z9043WZ1WP2qJwWdtajH/qgsMWhfe/
+SKf1NdO55v55biwKaagoCBpZiJQk4BugnekgR0sjDGLayIda8MAzS9y0znjIWp9ZnVnjOlAuRRuv
+hSov38dJl05h+y733IZSo0qSq/LEks9fbs+ND/7ArixX3bdfap0uOIHJI9sd9me9/9BFvPDubxFM
+FZKlQEdgm+kgYp5GFiKjELiaKG7nlmXRq1cv0zEkDm359ioua1uLe4YujuqiUL92eT4ddfiLBzm0
+cikJ9L+xsekYB9ixu5CRD7UwHSPmDOzblK53fRezRSF9Uw6nXP6Zm4vCz8AFqChIkEYWIut04Aeg
+9Pu7u5BGGSRSPnmhHbc/uoDMPYWmoxyTyhUSmfdeR5q6bFWfaLNrTyH1Lv2UnFz33K5Rr1Yq61w0
+lyKabZzZnWvu/57vf95hOspRO1JRGPH2Kp54ZZmbi9BcovguCAkPjSxE1nLgGqJsh+eSNI9BIqHv
+1Q3p0X9u1BeF5EQPn7zQNnqKgnWQwyWqVk7iX/9oZDrGAdZvyeXtoeebjhH1pr16Mef0mBqTRWHF
+mj08+PwSzu31Ffc/vcTNRWEqKgpyEC56GYgr/YHnTYcoCxplkLL25eiLuPOJn1gXhXsnlJSYYDHp
+xXZc0b6O6SgHV1wGgj/G/gD4Ajb+wL7/7PFAotfCU/xqYfhHfsv2POp3nOKqpSWbNqzE8jV7TMeI
+WgP7NuXpN1aa/qd1TEoWhcJCP7+ty2bc5DS+mrOF1elZ+PyufoYz0T4KcggqC2ZYwEvAv0wHKQsq
+DFIWtnx7Ff2HLuajaetNRykTXo/Fh8+2oUenE01HOdCfowUWPl+A7Dyb7Tt97Mrxs223j4xMHzl5
+AXwBSPBaVKngoW6NBGpWTeS4al5qVPKSmOgB2zZWHO54bAGvTlhr5sEPYfLIdnS7+zvTMaLK6i+u
+pPcD86Jy9/X9lSwKOXuLmPb9VoaNXcHPK3fhD7j+NVJFQQ5LZcEcD/AO0Nt0kLKi0iBHa8yjrRj4
+3BK37Vh61CzgnWHnc13X+qaj7GMBHvD7YU+2n03bfSxPK2BZWj4r1xeSsdPH3nybgsIARX4bG/BY
+kOj1kJpiUbWCl8b1kmjVpBytm5bj5NqJJHgtI4Xh93XZnHbF57jpGuy8s6rzwy/RewtNpL32eCv6
+D1tMbr7fdJRj0r1DHT54tg3JSV4AVqdlMWzsCt77PJ0in4v+gR7aZ8DfTIcQd1NZMCsRmAB0Mx2k
+rKgwSCiWfHw5d/1vIfOWxNZF1muPt+LWng1Nx3AERxKKiiBtawE//5bP4tUFrFpfwLqMIrJy/QQC
+FpYV/KuWc4AzeABOHyh+v1KqxZkNk+l6fiU6tSpP1YpeI4XhH/d977pRqNnjLqH9Td+YjuFqezd+
+zQ0338KkGRtNRzlmN3Stzxu0uz0OAAAUKElEQVT/a01BYYCMzHwW/JrJnf/9yc1zEvZnA18BXUwH
+EfdTWTAvBafZX2o6SFlSaZDD2TSrOw+/uJS3JqdF9X3KB/Pig83pd71Llvi0wB+wSdtcxIzFe5m9
+JJffNhSwOzuAP2Dj8ew3F6EE2w4WBOvPu5awgEDABsvi+KoJ9GhfkZsur0zNygkRLww/r9xJ857T
+IvugR9C5zQl8NXeL6RiuNeONDtw46Ec2b88zHeWY3XlNI0YOPpcduwqYtSCD+4b/HE3Pywe8C/Qx
+HUSig8qCO5QHpuOsaxxTVBqkpEf+dQbPvLmKvILovv3gYIbd24yBtzY1HQNwLvS37/Ezc3EOn83L
+YXlaAVl7nUnBxSMHVvAuIosDi0GFFKh3nJcKybB7L+zeG2DXXpvCon2fG7Chcnkv13WsxK1XVqVK
+BU/EC8Nlt89i2vfu2s178cTOnNPjK9MxXKf/DY3dvK9ASAbd2oQh/ZvxwZfr6Pfkomhbsa0QuAcY
+YzqIRA/tDuQOe4ErcCYZnWM4S5kqXmZVpUFee7wVj4z6la078k1HCYvH7zrTHUXBgtyCAL/8XsBH
+s7L4flkumVl+bBus4GLZXgsqpkDVVEhJdFZByi6ArDzIK4L8IsCGLucm0qJhArtzbRb+7mPOCj8r
+N/jJK7TxWJC118+k77JpWDuJ7m0rEulVlQfd2tR1ZWH42JV80MN0Cvf4/t2O3Dz4R9aszzEdpUzc
+1vNkGtSpwPHtJkXj7t2bceYnLDIdRKKLRhbcpSbwHXCa6SDhMGDAAIYPH246hkTY2CdaM+TV5aRt
+it2Nq4b2b8ag2wwXBQvsAGze4ePzedl8Mieb9K1F+IKzgG0bkhOgVhVofiK0bQinHg/lksAXgB3Z
+sDoD5v0BP6VDTgE0quXlniuT6dAsAcuCDdsDfPJDER/PK2R7lv3nC8hFZ6fyWJ+a1D0+MaK7yNi2
+zXnXTmfBrzsj96BH4LGcVX4aXf6Z6SjGPdCnCc+OWxUztxo2a1yFtRtyXLUpYAi+A9qbDiHRSWXB
+feoAc4AGpoOES/PmzVm0SL/YiHWvPNKSoa+tYMPW6N8v4XBGDGrOv28wPEfBgoKiAEvXFPDO9D18
+90su2XkBZ46B7VzA1q4CF54CnZvCGbWhYjIHvgIEV0LNyIKJi2H8T7AjB06v52Xw31NofaoXy4I9
+uTZvfF3I2zMKycqzsW04vloCD11fna5tK0Z8y8nJMzZy1T1zIvugR3B7r4aM+WiN6RjGzP+gEzc9
++COr07NNRykTxfuN+N2ztUcobGASoPEuOWoqC+5UD5gFnGw6SLjp9qTY88KDLXjq9ZXRNNnvqI1+
+pCV3mN5R2AN7cgJM/ymH977ew/K0AgLBi5qADVVSoUU9+FszZzShcrkDVzcqyeuBzL0wahZMWARF
+AejaMpEHe6VQs7IzqWFdRoBH38tn7koftu3sx3BT58r0/3t1UlMiu5xqIGBzRrcvWflHVuQe9AiS
+Ej2kf/03arWfZDpKxD14W1Oeen2lq5a1jWMBYAjwf6aDSHTzmA4gB7UeZ7jwd9NBws2yrD/nNUj0
++u3LK/n39Y2pVD6R/sMWx3xR8Fgw7snW5ouCBZu3+3hr6m5enLiLpWsLCARXMUr0wjn14K6L4MHL
+4PLTnaJQ/N8PxR+A6uWhWzNoeJzz8Q+rfPy4OnjrRQDq1vBwwWleyiU55aHQZ7NhWxFZeX4OubxS
+mHg8FgP7NonoYx5JYVGA599aZTpGRH339qWc1qASw8aqKLhENtATFQUpAyoL7rURuAhYbThHRKg0
+RKepYy6iS7vaNL7iC1587zeyo/Ne3pB4PRbvPXUBN3U3O/BnA6s3FDLyk528OXU3G7cX/blXQu0q
+0LsVDL4cereEBtWdzyntRVzAhsYnwHkNnHkOmdk2c1f4ycoFLGf04bS6XiqlOqMItm2TnRcgv8DG
+xKYL13Y5iRNPSI344x7O6A/X4M931+TrcPDnb+WOvzei/U0zYua2oxiwEmiMc/uRyDFTWXC3zTiF
+YYXhHBFTXBrWrl1rOoocwrpvujGkfzNOOakiXf75LVPjaF355EQPE0e05ZouJxnNEQBWpBfwwsRM
+Pp2bzZ69AbweSLDgrDowoBPc2R7OrgtJXvCHeP1u25CSAOeeBJVTocgPK9b7SMvw/3nzat2aHiql
+7ruXNa/QJi8/AHbkS39Skpf/3OyudSGyc30MG9jZdIyw+nhEO+qe2IBXJ+h87RIBnFuYWwHxc2KW
+sFNZcL+twMXAMtNBIqlRo0YabXCZcU+eR4fWx1O/4xQGv7A0ZpZCLK3qlZOY+WYHul9S12iOABa/
+/lHAcx/tZOaiXAoKbSwLErzQ+mQY0Bk6ne7MVbDto/89vw00qgnHVXA+ztht88fWfTM8U5IsEhMs
+E93goG7t0ZDqlZNMxzjAC+/E5sDwxpnd6dahLj3vnRuzSyFHoULgMaADEF8nZwk7lYXosA2nMMTl
+EkLFpUHFIfKmjLqQ666sT2pKAn0ens+sBdtMRzLi5LrlmTe+IxecU9NcCAt8NixZk8fT72cyZ2ku
+vuCQQbLXWemo/yXQvJ4zwnAsRaFY5XJQt6qzEkx2PvyREaCg0HbmKRTZ+P37HiQl0SI52QOWmRvW
+y6cmcI9bds4O2r6rgJcePtd0jDI1avC5NO36BVNmbTIdRfZZi7N/wn9NB5HYpLIQPXbg3JI0zXAO
+o1Qcwitr9TO8NeQ8rrqkLqkpCXTrN4fxX6yLyd2WS6vVmdX4YXwnTq1fyVwIC4r8NgtW5PLs+5ks
+WJFLIGATsJ19Ejo1hXsugjNrBXdjLoOHtG0onwz1qjqbuBUW2WzeESC3wMmzIzv4flC5ZIuUJAuT
+i+zd1fsUypfzGnv8g3n6jZWmI5SJH8Z3onmTavQbsigu5iZFiXzgn8DZxPm1gYSXdnCOLjlAV+A1
+4CbDWYzbvzBoCdaj9/PHlzHjxww+n72JOYu2ayWT/XS7uA7jn76A1HIGT5XBC/Xvfsll9Ke7+GVN
+vrOiEVAhGbqcDn3aQMOa/LlXQllJsKBSilMWimzIyrPJL7IBi227YW++HZzwbFGhnJekhMgum1pS
+9SrJ3N6rEc+/7Z7bf9ZtyeXd4edz/cAfTEc5KgtG9uLV2Yt5/ZM/TEeRA60EWgKxu9uluIbKQvQp
+AvrgrJY02HAW1yg50qDycGjLp3Rh1vxtzJyfweyfMtiVVWQ6kivd3fsURgxqjtdrcAA2uCzp7J9z
+eXnSLpal5zu3F1mQmghdzoRb20D96odfDvVo2RakJDmrH2FDVq5Ndi7UqgG7cgLkFzmPm5RgcUI1
+L+VTPOEJEoJ7b2zMqPG/UeRzzzlg+NiVXD/QdIrQjX60JQ+N+EXnCPeZjXNrskhEqCxEJxt4GKcw
+vIRuJ/uLkuWhZ8+eTJgwwVAac/aue4e5095g4fKdLFyWybwlO9i2s+DInxjHErwWIwY1585rTzF+
+u5vfb/Pj8lxemRIsCoBlOXMUOjaBvmEsCuDcUJSS6MxZsC3Ymw+5BTaBItiUGaDI5+zgnJxkUadm
+IuWSzY4sAJxYqzzXd63Pm5PSzAbZz7I1e/jspfZ0vetb01FKZf4HnbjrvwtZtGKX6SjyV4/jTGQW
+iRiVheg2Gmd5tPeBcoazuNrEiRMPeuEXSyMQa6Z2ZVVaFivW7mHR8l38tCyTtE0aoQ7FCTVSmPBc
+W9q2MDiROcgGfk0rYMyne/h1rTOiYFnOnmetG8AtbaBBNcJ+ce71OI8LUOi3KfJBdp7Nms0BfMGp
+LJXLe6hdI8EJF+o6rWEw4JamjJuUZrq3HGDY2BV0vct0isPb+u1VDH5hKW9M0i1HLrQe5/bj2YZz
+SBzSLNHYcA7O5itmF3+PMW4sEpUqJAJQVBTABgIBG3/AJhA4/OfJkSV4LVKSPOTk+Xfv98cB9o3c
+7f8+wfd9wbd+wItz6e4N/t1ixf+Qimf/2iW+5uEe60iPX/JrHOqx/MGPi3MGcH5ZdKTHL+1z9Qb/
+/Fgeq0yfa1KCVaXQRbciAVQsn0BWjjtv6SmX7CW/UCcSF9oB9AM+MB1ERKJfTWAmzgumDoPH6NGj
+7UMZPXq08Xw6dOgwd7iN6e+HjkMemcCjQH1EDNPIQmxJBJ4G/m06iIiIHJztglFL0/Nx5KD8wBxg
+DBpJEBfR2SI23Qi8CiSbDiIiIgcyWRZUElxrFXAJsNl0EJGStIpObHobaAtsMB1EREQOZOqCXUXB
+lfYC9wJNUFEQl9KZI7ZVw9nA7WrTQUREZJ9Iji6oJLhSPjASeBlINxtF5PB0Bol9FnAbMAItryoi
+4hrhLgwqCa6UiTO3cBTafVmihM4k8aMJzn4MzUwHERGR8JUFlQRXygP+A7xiOohIqDRnIX6sBFoD
+L5gOIiIisHbt2jL9epZlqSi4TwHwLNAQFQWJUjqrxKfLcOYy1DUdREQknpXF6IIKgivlAu/gLIG6
+EMgxG0fk6OkME78qAcOBf5oOIiISr46lLKgkuE42zij+OGAysMVoGpEyojONtAPGAqeaDiIiEo9C
+LQwqCa7iB9YBXwNPoOVPJQbpjCMAKcAjwADAaziLiEhcKW1ZUElwDRvwAWnAFOB5VBIkhunMI/s7
+G2fn55amg4iIxJPDFQaVBNewceYezMeZ9zcZKDSaSCQCdAaSkjzA9cBQoLbhLCIiceFgZUElwTUC
+OKMI84EngRVm44hEls5EcigVgIHA/Ti3KYmISBgVFwaVBNfIB2YDS4AxaKdliVM6I8mRnISzatI/
+TAcREREJIxvYA2wFHsbZbXm2yUAibqCyIKXVBqc0tDEdREREpIwUz0OYDSzGWfY03VwcEfdRWZBQ
+WEBH4DHgfLNRREREQubH2TAtHWcFo1HsKwsichAqC3I0LKAzTmlobTaKiIjIQQWAPJxisBt4BdgU
+/DjdVCiRaKOyIMfCAi7DKQ2tzEYREZE4ZuMsY7oZ2AG8D/yMioHIMVNZkLJgAR2A/sAV6N+ViIiE
+j41zO1FG8JgHfIxzO9FCg7lEYpIu6qSsnQLcA/QByhvOIiIiscGPUwbW4ixj+huaZyASESoLEi5V
+gL5AP5zlV0VERA4mAPiAouBbH84eBxk4k5HfDf69MUbSicQ5lQUJtwScW5P6BN8mmI0jBhRfBBTi
+3D7Afm+t4GHj7B4OzoUD+73vKfH+wf6s2MG+xqEeyx/82A94g5+TUIrH3/+xfPt9LW/wa3sp3ePH
+0nP1Bv/8WB7L5HMtFzwkPGygAOfCvxBnhGAZzp4G44J/Z7aJYCIi4i7H4cxr+AXnxUNH7B7rgCeA
+hoi4XzmcjbhM/9zE4vE+ULv0/ytERESc3/qdA7yIs2qF6RczHWVz7ADeAC7hwN8Ki0SDQZj/GYql
+YxXOuUBEROSYJOJs9PYyzpJ3pl/gdIR2rMcpfRejW8wkulXGuS3G9M9UtB+5wENAcmjffhERkSPz
+4OwM/RSwBvMvejoOfqwEhgAt0bwniS1DMf/zFc3HFKB+qN90EXE3vdCLW1nAGTiToi8F2gApRhPF
+rx3ALOAbYAbO0oUisegEnA289Fvx0PwO3Ad8bjqIiIjErxSc+1+HAPNxVjox/Vu0WD1ygC+B/wBn
+o/kHEl9ewfzPYLQce3DOE0lH9Z0WkaigkQWJVlWA9sAFQCugBVDRaKLo9TuwAPgp+HYRzvKGIvGo
+Ic6GXyrJh2YDrwODgW2Gs4hImKksSKzwAo1xikPL4NtmOBOoZZ/NOKWguBgsBHYZTSTiPuOBa02H
+cKm5wL+BxaaDiEhkqCxILEsGTgGalDgaE9vzHwJAGs5E5P2PVcBug7lEokUzYInpEC6zHhgAfIQz
+siAicUJlQeKRBzgJpzjUB04E6u73ti7unuBYBGwCNgAb93u7EWfy8W9AvrF0IrHhS+By0yFcYDfO
+XLGR6LwiEpdUFkT+ygJq4JSGWkBVnDkSVQ/xfjLOBL/E/d7u/74X5wK/+Cgs8bYI50V4N84tQcVv
+d5X4eAdOIdiGM3ogIuFzIfCt6RAGFQKjgCeBnYaziIiIiIi4igXMw/yKQyaO94AGx/4tFBERERGJ
+XV0xf+EeyWMGzspyIiIiIiJyBB5gGeYv4sN9LMaZn6Fbk0VEREREQnAD5i/mw3WsAHqiPSVERERE
+RI5KIrAO8xf2ZXmsxSlB3jL8PomIiIiIxKV+mL/AL4tjI3AH2qxSRERERKTMpALbMX+xf7RHBnAv
+sb0ZpYiIiIiIMQ9j/qI/1GMz0B+n7IiIiIiISJhUA7IxXwBKc2wA7kYjCSIiIiIiEfMM5ovA4Y50
+nDkJyWF6/iIiIiIicgh1gELMl4KSx1qgL5AUvqcuIiIiIiJH8hrmy0Hx8T3QC0gI6zMWEREREZFS
+ORUIYK4gFAHjgZbhfqIiIiIiIhK6CUS+JGQCQ3FuhRIREREREZdqQeRKwkqcScta/lREREREJEpM
+J7wlYRpwGeCJ1BMSEREREZGy0YGyLwh5wKtA0wg+DxERERERKWMWsICyKQmbgIeAGhF9BiIiIiIi
+EjZXc2wl4SfgOrQ/goiIiIhIzPECqwitIPiBiUBbnNEJERERERGJUX0oXUnYAzwL1DeSUkRERERE
+Ii4J2MihS8Ia4B6goqmAIiIiIiJizr38tSTMAv6Gc6uSiIiIiIjEqQrATqAAGAecbTSNiIiIiIi4
+SgfgeNMhRERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERE
+RERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERE
+REREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREREIuv/AWme
+RiHpiLeCAAAAAElFTkSuQmCC
+"
+     id="image3052"
+     x="0"
+     y="0" />
+  <g
+     id="g3256">
+    <path
+       style="fill:#fefefe"
+       d="m 463.07629,743.75 c -2.10768,-4.5375 -5.88598,-12.6375 -8.39622,-18 l -4.56408,-9.75 -83.46782,0 -83.46782,0 -9.04071,2.95437 c -16.62473,5.43271 -28.6529,7.27404 -50.94797,7.79937 -22.93437,0.5404 -33.85722,-0.47809 -50.73999,-4.73119 C 144.7693,715.04881 123.25936,702.41414 101,680.05273 86.55362,665.54011 78.039237,653.57802 68.576447,634.5 57.663286,612.49787 51.499508,592.03841 46.885162,562.5 44.94157,550.05824 44.649714,543.48 44.262979,503.39772 l -0.435171,-45.10227 4.725667,-0.64773 C 51.152592,457.29148 54.960085,457 57.014571,457 c 2.054486,0 5.142369,-0.28139 6.861963,-0.62531 l 3.126534,-0.6253 -0.0104,-108.1247 c -0.0067,-69.88703 0.361207,-110.95384 1.0404,-116.12469 0.577942,-4.4 1.424744,-11.15 1.881782,-15 0.835965,-7.042 4.408921,-18.72556 8.562697,-28 1.231651,-2.75 3.022067,-7.15527 3.978701,-9.78949 0.956634,-2.63422 2.925044,-6.19863 4.374244,-7.9209 1.449201,-1.72228 3.542696,-4.80565 4.652211,-6.85194 8.140139,-15.0129 36.363237,-42.8473 54.161877,-53.41592 14.94103,-8.87181 32.03207,-15.62499 50.10766,-19.799032 L 209.5,87.548064 334.81689,87.244351 460.13378,86.940638 464.31689,84.299184 C 472.2628,79.281684 507.20777,60 508.35528,60 c 0.63309,0 4.7873,5.9625 9.23159,13.25 l 8.08052,13.25 12.41631,0.594362 c 6.82896,0.326899 16.6913,1.154075 21.9163,1.838168 15.54172,2.03483 45.24601,12.15235 50.71251,17.2731 1.21689,1.13991 3.10061,2.57247 4.18607,3.18347 13.44546,7.56839 23.42066,15.77739 38.60142,31.76669 7.68645,8.09584 19.5,23.56832 19.5,25.53961 0,0.3387 1.0125,2.00829 2.25,3.71021 2.95423,4.06291 5.3017,8.84476 7.65549,15.59439 1.0549,3.025 3.27229,9.20217 4.92754,13.72704 2.89806,7.92229 6.20633,23.2306 7.73087,35.77296 0.40113,3.3 0.64551,80.40901 0.54308,171.35336 -0.15919,141.333 -0.39839,166.16784 -1.64661,170.9601 -0.8032,3.08371 -1.46037,6.83606 -1.46037,8.33856 0,3.50147 -6.29069,24.29074 -9.9579,32.90857 -1.55027,3.64309 -4.38945,8.83231 -6.30928,11.5316 -1.91984,2.6993 -3.81902,6.03281 -4.22041,7.40781 -0.40138,1.375 -2.19741,4.075 -3.99117,6 -1.79376,1.925 -3.65735,4.24536 -4.14131,5.15637 -2.17155,4.08768 -14.50782,17.38833 -23.63276,25.48023 -11.83087,10.49148 -18.65881,15.38339 -28.52457,20.43656 -4.00257,2.05008 -7.82757,4.14339 -8.5,4.65179 -0.67243,0.5084 -6.07562,2.82948 -12.00709,5.15795 -11.39105,4.47169 -32.16861,9.40028 -44.71551,10.60684 -6.44768,0.62004 -8.54968,1.3545 -14.98118,5.23456 -12.7807,7.71049 -28.8181,15.84181 -46.76789,23.71238 C 475.76394,748.59651 467.75584,752 467.45515,752 c -0.3007,0 -2.27118,-3.7125 -4.37886,-8.25 z"
+       id="path3754"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f9f9f9"
+       d="m 465.07498,747.75 c -1.01967,-2.3375 -4.80201,-10.4375 -8.4052,-18 l -6.55126,-13.75 -84.03903,0 c -70.84232,0 -84.63106,0.22673 -87.80925,1.44389 -15.72977,6.02401 -31.36311,8.69065 -54.49205,9.29491 -34.37384,0.89804 -56.77039,-3.58835 -82.00092,-16.42608 C 127.04806,702.81824 115.50329,694.39512 102.97172,682 72.12264,651.48682 55.217176,615.45038 46.911726,562.5 44.958667,550.04851 44.66591,543.51161 44.264926,503.4003 l -0.450852,-45.0997 5.342963,-0.64161 C 52.095667,457.30611 56.3,457.00733 58.5,456.99504 c 2.2,-0.0123 5.013191,-0.29387 6.251535,-0.62573 l 2.251535,-0.60338 -0.0104,-108.13296 c -0.0067,-69.2609 0.364125,-111.00884 1.031449,-116.13297 0.57302,-4.4 1.434224,-10.925 1.913787,-14.5 0.958388,-7.14449 5.013925,-20.69914 8.527175,-28.5 1.238508,-2.75 3.034534,-7.15527 3.991168,-9.78949 0.956634,-2.63422 2.925044,-6.19863 4.374244,-7.9209 1.449201,-1.72228 3.542696,-4.80565 4.652211,-6.85194 8.140139,-15.0129 36.363236,-42.8473 54.161876,-53.41592 14.94703,-8.87537 32.03868,-15.627608 50.10766,-19.795557 L 209.5,87.555014 335.5,87.027507 461.5,86.5 467,82.919223 c 7.02375,-4.572813 40.29373,-22.92076 41.55036,-22.914468 0.5223,0.0026 4.54964,5.965116 8.94964,13.25 L 525.5,86.5 538,87.094362 c 6.875,0.326899 16.775,1.154075 22,1.838168 15.54172,2.03483 45.24601,12.15235 50.71251,17.2731 1.21689,1.13991 3.10061,2.57247 4.18607,3.18347 13.44546,7.56839 23.42066,15.77739 38.60142,31.76669 7.68645,8.09584 19.5,23.56832 19.5,25.53961 0,0.3387 1.0125,2.00829 2.25,3.71021 2.95423,4.06291 5.3017,8.84476 7.65549,15.59439 1.0549,3.025 3.27229,9.20217 4.92754,13.72704 4.19443,11.46613 7.12864,27.90281 7.96027,44.59143 0.38869,7.79984 0.45981,85.28153 0.15805,172.18153 -0.59234,170.58404 -0.29472,161.73633 -6.13895,182.5 -4.03411,14.33261 -8.19072,24.45216 -12.73325,31 -2.09858,3.025 -4.14881,6.625 -4.55607,8 -0.40725,1.375 -2.20808,4.075 -4.00184,6 -1.79376,1.925 -3.65735,4.24536 -4.14131,5.15637 -2.17155,4.08768 -14.50782,17.38833 -23.63276,25.48023 -11.83087,10.49148 -18.65881,15.38339 -28.52457,20.43656 -4.00257,2.05008 -7.82757,4.14339 -8.5,4.65179 -0.67243,0.5084 -6.07562,2.82948 -12.00709,5.15795 -11.35093,4.45594 -32.08347,9.38122 -44.71551,10.62273 -6.55402,0.64415 -8.63518,1.39696 -16.5,5.96846 -16.22399,9.43036 -27.73913,15.24827 -45.4118,22.94389 C 475.51171,748.58809 467.50822,752 467.30266,752 c -0.20555,0 -1.20801,-1.9125 -2.22768,-4.25 z m 32.74648,-47.19801 c 31.36282,-15.95041 56.83658,-34.02594 78.183,-55.47666 17.01603,-17.09916 25.50336,-28.5611 34.4881,-46.57533 10.4002,-20.85222 14.80792,-36.89743 16.43373,-59.82296 C 629.8679,497.19765 617.41968,459.48738 587.58578,419.5 575.93606,403.8855 545.50672,373.43017 525.46915,357.33031 505.92083,341.62356 499.88126,336.0515 492.90304,327.28506 480.7746,312.04861 477.33306,299.50511 482.30277,288.64984 c 8.5093,-18.58676 29.32501,-36.69431 70.83866,-61.62241 l 12.64143,-7.59093 -33.30908,-54.77793 c -18.32,-30.12786 -33.94507,-55.73576 -34.72237,-56.90645 -1.40352,-2.11381 -1.47497,-2.09168 -10.33235,3.20113 -22.85114,13.65489 -43.51849,29.99433 -64.47605,50.97424 -16.44198,16.45951 -23.66844,25.06401 -34.45622,41.02681 -14.88538,22.02605 -25.55701,47.61682 -29.55131,70.86464 -2.25338,13.11521 -2.71485,35.7646 -0.97673,47.93866 4.0768,28.55456 16.16091,55.3823 36.78398,81.66352 9.19749,11.72091 30.69489,32.24217 49.25727,47.02062 31.40775,25.00529 51.52352,47.60142 56.98411,64.0105 3.3042,9.92913 2.65644,19.77028 -1.9134,29.06947 -4.30755,8.76545 -16.73528,21.41642 -29.57071,30.10189 -9.22774,6.24423 -31.22531,18.62118 -35.25,19.83346 -1.2375,0.37274 -2.25,1.18245 -2.25,1.79935 0,0.6169 9.97275,22.29908 22.16166,48.18261 12.18892,25.88354 23.88515,50.77348 25.99162,55.31098 2.10648,4.5375 4.09089,8.25 4.4098,8.25 0.31892,0 6.28519,-2.90161 13.25838,-6.44801 z m -258.34022,-9.68558 c 36.70791,-4.79916 67.00705,-23.3303 91.15056,-55.74824 8.57737,-11.51698 19.39728,-33.52388 23.9036,-48.61817 7.92407,-26.54226 9.41721,-45.24194 9.44551,-118.2927 L 364,418.9146 360.19198,413.7073 C 349.35699,398.89095 338.29479,377.29394 332.55516,359.75123 319.75308,320.62275 319.93715,279.14552 333.0888,239.5 c 4.75113,-14.32222 16.40717,-38.40417 24.83332,-51.30684 6.82867,-10.4565 8.03898,-15.72167 3.82788,-16.65229 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 0,188.94846 c 0,205.46517 0.20196,197.65797 -5.50527,212.82067 -3.55239,9.43784 -10.41233,18.68739 -15.79039,21.29086 -6.14647,2.97545 -17.33756,2.96187 -21.13557,-0.0256 C 193.33831,572.04155 187,542.09008 187,497.85478 L 187,482 l -4.75,0.0417 c -7.85811,0.0689 -105.176596,7.55159 -105.756437,8.13143 -0.913826,0.91383 1.390052,43.83203 3.028479,56.41656 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3752"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f5f5f5"
+       d="m 466.07361,749.75 c -0.48229,-1.2375 -4.26931,-9.3375 -8.4156,-18 l -7.5387,-15.75 -83.70623,0 -83.70623,0 -9.22381,2.95465 c -20.04113,6.41975 -27.57883,7.44777 -54.98304,7.4988 -28.33851,0.0528 -38.39537,-1.35171 -57.63665,-8.04916 C 106.50572,699.48364 65.865276,650.45603 51.520053,586.49529 45.338109,558.932 44.75116,552.21026 44.264105,503.4003 l -0.450031,-45.0997 5.342963,-0.64161 C 52.095667,457.30611 56.3,457.00733 58.5,456.99504 c 2.2,-0.0123 4.999596,-0.29031 6.221325,-0.61783 l 2.221324,-0.59548 0.306384,-112.64086 c 0.239318,-87.9847 0.5995,-114.50145 1.645475,-121.14087 2.513121,-15.95225 13.065984,-45.55326 18.427533,-51.68963 1.052231,-1.20429 2.872731,-3.96793 4.045554,-6.14142 8.195689,-15.18834 36.376705,-43.0375 54.276985,-53.63783 14.95461,-8.85593 32.22091,-15.67699 50.16248,-19.816696 L 209.5,87.555014 335.5,87.027507 461.5,86.5 l 10,-6.071994 c 11.96108,-7.26276 35.91912,-20.433384 37.13556,-20.414799 0.47544,0.0073 4.46444,6.021026 8.86444,13.363917 l 8,13.350711 13.5,0.56325 c 7.425,0.309788 17.325,1.095231 22,1.745428 7.97818,1.109603 29.52079,7.269071 36.75,10.507571 1.7875,0.800756 4.9375,2.205056 7,3.120676 2.0625,0.91561 4.74563,2.55321 5.96251,3.63909 1.21689,1.08589 3.10061,2.47425 4.18607,3.08525 13.44546,7.56839 23.42066,15.77739 38.60142,31.76669 7.68645,8.09584 19.5,23.56832 19.5,25.53961 0,0.3387 1.0125,2.00829 2.25,3.71021 2.95423,4.06291 5.3017,8.84476 7.65549,15.59439 1.0549,3.025 3.27229,9.20217 4.92754,13.72704 2.84379,7.77394 6.16376,23.06201 7.65989,35.27296 1.01608,8.29283 0.56452,337.71873 -0.46664,340.43089 -0.48785,1.28313 -1.34817,5.6487 -1.91183,9.70125 -1.90883,13.72399 -10.23573,36.28716 -17.11198,46.36786 -1.50066,2.2 -3.06403,5.125 -3.47416,6.5 -0.41013,1.375 -2.21331,4.075 -4.00707,6 -1.79376,1.925 -3.65735,4.24536 -4.14131,5.15637 -2.17155,4.08768 -14.50782,17.38833 -23.63276,25.48023 -11.83087,10.49148 -18.65881,15.38339 -28.52457,20.43656 -4.00257,2.05008 -7.82757,4.13523 -8.5,4.63365 -0.67243,0.49842 -6.11545,2.82805 -12.0956,5.17695 -11.52473,4.52671 -32.16561,9.42209 -44.627,10.58414 -6.64294,0.61947 -8.52847,1.30609 -16.5,6.00856 -12.34583,7.2829 -30.1387,16.19038 -47.90937,23.98443 C 474.39047,749.0574 467.51683,752 467.31587,752 c -0.20095,0 -0.75997,-1.0125 -1.24226,-2.25 z m 31.74785,-49.19801 c 31.36282,-15.95041 56.83658,-34.02594 78.183,-55.47666 17.01603,-17.09916 25.50336,-28.5611 34.4881,-46.57533 10.4002,-20.85222 14.80792,-36.89743 16.43373,-59.82296 C 629.8679,497.19765 617.41968,459.48738 587.58578,419.5 575.93606,403.8855 545.50672,373.43017 525.46915,357.33031 505.92083,341.62356 499.88126,336.0515 492.90304,327.28506 480.7746,312.04861 477.33306,299.50511 482.30277,288.64984 c 8.5093,-18.58676 29.32501,-36.69431 70.83866,-61.62241 l 12.64143,-7.59093 -33.30908,-54.77793 c -18.32,-30.12786 -33.94507,-55.73576 -34.72237,-56.90645 -1.40352,-2.11381 -1.47497,-2.09168 -10.33235,3.20113 -22.85114,13.65489 -43.51849,29.99433 -64.47605,50.97424 -16.44198,16.45951 -23.66844,25.06401 -34.45622,41.02681 -20.87234,30.88501 -31.51503,63.42053 -31.59944,96.60193 -0.0565,22.19136 3.0504,39.14827 10.61649,57.94377 13.09864,32.53932 36.80355,61.34045 76.49616,92.94174 31.40775,25.00529 51.52352,47.60142 56.98411,64.0105 3.3042,9.92913 2.65644,19.77028 -1.9134,29.06947 -4.30755,8.76545 -16.73528,21.41642 -29.57071,30.10189 -9.22774,6.24423 -31.22531,18.62118 -35.25,19.83346 -1.2375,0.37274 -2.25,1.18245 -2.25,1.79935 0,0.6169 9.97275,22.29908 22.16166,48.18261 12.18892,25.88354 23.88515,50.77348 25.99162,55.31098 2.10648,4.5375 4.09089,8.25 4.4098,8.25 0.31892,0 6.28519,-2.90161 13.25838,-6.44801 z m -258.34022,-9.68558 c 36.70791,-4.79916 67.00705,-23.3303 91.15056,-55.74824 8.57737,-11.51698 19.39728,-33.52388 23.9036,-48.61817 7.91854,-26.52373 9.41718,-45.2572 9.44551,-118.07176 L 364,419.35649 356.40299,407.98622 C 322.40866,357.10767 314.13763,297.49347 333.0511,239.67547 c 4.63661,-14.17403 16.23835,-38.16336 24.89789,-51.48231 6.80052,-10.45964 8.00212,-15.72388 3.80101,-16.65229 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 0,188.94846 c 0,205.46517 0.20196,197.65797 -5.50527,212.82067 -3.55239,9.43784 -10.41233,18.68739 -15.79039,21.29086 -6.14647,2.97545 -17.33756,2.96187 -21.13557,-0.0256 C 193.33831,572.04155 187,542.09008 187,497.85478 L 187,482 l -4.75,0.0417 c -7.85811,0.0689 -105.176596,7.55159 -105.756437,8.13143 -0.913826,0.91383 1.390052,43.83203 3.028479,56.41656 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3750"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fbf6e6"
+       d="m 463.11491,743.25 c -2.27393,-4.8125 -6.04253,-12.89242 -8.37467,-17.95537 L 450.5,716.08925 366.42515,716.04463 282.3503,716 l -6.94976,2.36377 c -19.9046,6.76999 -37.6988,9.08077 -64.17873,8.33435 -22.08495,-0.62253 -32.21995,-2.2726 -49.52437,-8.06302 C 113.75194,702.59153 75.640742,662.0332 57.581192,607.83351 47.12101,576.44077 44,550.89446 44,496.66773 l 0,-38.38915 5.25,-0.6306 c 2.8875,-0.34683 7.05,-0.64065 9.25,-0.65294 2.2,-0.0123 4.999596,-0.29031 6.221325,-0.61783 l 2.221324,-0.59548 0.306384,-112.64086 C 67.488351,255.15617 67.848533,228.63942 68.894508,222 71.159473,207.62294 80.091137,181.78618 86,172.51867 c 1.375,-2.15656 3.625,-5.76336 5,-8.01512 10.9079,-17.86325 36.71966,-43.35751 54.64458,-53.97243 14.95461,-8.85593 32.22091,-15.67699 50.16248,-19.816696 L 209.5,87.555014 335.5,87.027507 461.5,86.5 468,82.441568 c 8.87779,-5.543064 39.50355,-22.447961 40.60726,-22.414514 0.49101,0.01488 4.49274,6.02833 8.89274,13.363223 l 8,13.336169 13.5,0.563945 c 7.425,0.31017 17.325,1.095925 22,1.746122 8.61265,1.197844 29.97934,7.430674 37.7391,11.008787 2.33151,1.07509 4.47795,1.9547 4.76987,1.9547 0.47094,0 2.07179,1.01296 11.06262,7 1.23891,0.825 4.65463,2.90658 7.59049,4.62574 11.60779,6.79721 36.2093,30.93661 45.58792,44.73162 2.8875,4.24722 5.25,7.99934 5.25,8.33804 0,0.3387 1.0125,2.00829 2.25,3.71021 2.95423,4.06291 5.3017,8.84476 7.65549,15.59439 1.0549,3.025 3.27229,9.20217 4.92754,13.72704 2.84379,7.77394 6.16376,23.06201 7.65989,35.27296 1.01608,8.29283 0.56452,337.71873 -0.46664,340.43089 -0.48785,1.28313 -1.35645,5.64861 -1.93023,9.70104 -1.92419,13.59001 -10.30649,36.47664 -16.86797,46.05552 -1.62475,2.3719 -3.29944,5.43755 -3.72153,6.81255 -0.4221,1.375 -2.39625,4.36238 -4.387,6.63862 -1.99075,2.27624 -5.05192,6.10124 -6.8026,8.5 C 654.99335,661.80315 628.29918,687 625.44337,687 c -0.62337,0 -1.89227,0.83855 -2.81979,1.86345 -0.92752,1.02489 -5.15977,3.56053 -9.40499,5.63475 -4.24522,2.07422 -8.39359,4.29955 -9.21859,4.94518 -0.825,0.64562 -6.39285,3.09474 -12.373,5.44248 -11.49739,4.51375 -32.10966,9.40684 -44.627,10.59389 -6.69337,0.63475 -8.5755,1.3336 -17.5,6.49791 -12.85604,7.43937 -28.69032,15.34514 -47.10323,23.51779 C 474.3367,749.07295 467.63122,752 467.49571,752 c -0.1355,0 -2.10686,-3.9375 -4.3808,-8.75 z m 34.70655,-42.69801 c 31.36282,-15.95041 56.83658,-34.02594 78.183,-55.47666 17.01603,-17.09916 25.50336,-28.5611 34.4881,-46.57533 10.4002,-20.85222 14.80792,-36.89743 16.43373,-59.82296 C 629.8679,497.19765 617.41968,459.48738 587.58578,419.5 575.93606,403.8855 545.50672,373.43017 525.46915,357.33031 505.92083,341.62356 499.88126,336.0515 492.90304,327.28506 480.7746,312.04861 477.33306,299.50511 482.30277,288.64984 c 8.5093,-18.58676 29.32501,-36.69431 70.83866,-61.62241 l 12.64143,-7.59093 -33.30908,-54.77793 c -18.32,-30.12786 -33.94507,-55.73576 -34.72237,-56.90645 -1.40352,-2.11381 -1.47497,-2.09168 -10.33235,3.20113 -22.85114,13.65489 -43.51849,29.99433 -64.47605,50.97424 -16.44198,16.45951 -23.66844,25.06401 -34.45622,41.02681 -21.27758,31.48464 -31.58418,63.49581 -31.56767,98.0457 0.0104,21.77888 2.98004,37.53244 10.70015,56.76294 12.92464,32.19482 36.80456,61.17022 76.38073,92.6788 31.40775,25.00529 51.52352,47.60142 56.98411,64.0105 3.3042,9.92913 2.65644,19.77028 -1.9134,29.06947 -4.30755,8.76545 -16.73528,21.41642 -29.57071,30.10189 -9.22774,6.24423 -31.22531,18.62118 -35.25,19.83346 -1.2375,0.37274 -2.25,1.18245 -2.25,1.79935 0,0.6169 9.97275,22.29908 22.16166,48.18261 12.18892,25.88354 23.88515,50.77348 25.99162,55.31098 2.10648,4.5375 4.09089,8.25 4.4098,8.25 0.31892,0 6.28519,-2.90161 13.25838,-6.44801 z m -258.34022,-9.68558 c 36.70791,-4.79916 67.00705,-23.3303 91.15056,-55.74824 8.57737,-11.51698 19.39728,-33.52388 23.9036,-48.61817 7.91773,-26.52103 9.41717,-45.25942 9.44551,-118.0397 L 364,419.4206 356.40035,407.9603 c -31.51394,-47.52311 -40.93658,-102.34081 -26.88652,-156.41657 5.12428,-19.72227 14.99606,-41.74727 27.97416,-62.41332 7.24298,-11.53357 8.48428,-16.65645 4.26201,-17.58954 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 0,188.94846 c 0,205.46517 0.20196,197.65797 -5.50527,212.82067 -3.55239,9.43784 -10.41233,18.68739 -15.79039,21.29086 -6.14647,2.97545 -17.33756,2.96187 -21.13557,-0.0256 C 193.33831,572.04155 187,542.09008 187,497.85478 L 187,482 l -4.75,0.0417 c -7.85811,0.0689 -105.176596,7.55159 -105.756437,8.13143 -0.913826,0.91383 1.390052,43.83203 3.028479,56.41656 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3748"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f2f2f2"
+       d="m 463.11491,743.25 c -2.27393,-4.8125 -6.04253,-12.89242 -8.37467,-17.95537 L 450.5,716.08925 366.42515,716.04463 282.3503,716 l -6.94976,2.36377 c -19.9046,6.76999 -37.6988,9.08077 -64.17873,8.33435 -22.08495,-0.62253 -32.21995,-2.2726 -49.52437,-8.06302 C 113.75194,702.59153 75.640742,662.0332 57.581192,607.83351 47.12101,576.44077 44,550.89446 44,496.66773 l 0,-38.38915 5.25,-0.6306 c 2.8875,-0.34683 7.05,-0.64065 9.25,-0.65294 2.2,-0.0123 4.999596,-0.29031 6.221325,-0.61783 l 2.221324,-0.59548 0.306384,-112.64086 C 67.488351,255.15617 67.848533,228.63942 68.894508,222 71.159473,207.62294 80.091137,181.78618 86,172.51867 c 1.375,-2.15656 3.625,-5.76336 5,-8.01512 10.9079,-17.86325 36.71966,-43.35751 54.64458,-53.97243 14.95461,-8.85593 32.22091,-15.67699 50.16248,-19.816696 L 209.5,87.555014 335.5,87.027507 461.5,86.5 468,82.441568 c 8.87779,-5.543064 39.50355,-22.447961 40.60726,-22.414514 0.49101,0.01488 4.49274,6.02833 8.89274,13.363223 l 8,13.336169 13.5,0.563945 c 7.425,0.31017 17.325,1.095925 22,1.746122 8.61265,1.197844 29.97934,7.430674 37.7391,11.008787 2.33151,1.07509 4.47795,1.9547 4.76987,1.9547 0.47094,0 2.07179,1.01296 11.06262,7 1.23891,0.825 4.65463,2.90658 7.59049,4.62574 11.60779,6.79721 36.2093,30.93661 45.58792,44.73162 2.8875,4.24722 5.25,7.99934 5.25,8.33804 0,0.3387 1.0125,2.00829 2.25,3.71021 2.95423,4.06291 5.3017,8.84476 7.65549,15.59439 1.0549,3.025 3.27229,9.20217 4.92754,13.72704 2.84851,7.78685 6.17878,23.13288 7.65464,35.27296 1.01702,8.3657 0.57506,337.7048 -0.45682,340.41886 -0.49036,1.28975 -1.36102,5.66064 -1.9348,9.71307 -1.92419,13.59001 -10.30649,36.47664 -16.86797,46.05552 -1.62475,2.3719 -3.29944,5.43755 -3.72153,6.81255 -0.4221,1.375 -2.39625,4.36238 -4.387,6.63862 -1.99075,2.27624 -5.05192,6.10124 -6.8026,8.5 C 654.99335,661.80315 628.29918,687 625.44337,687 c -0.62337,0 -1.89227,0.83855 -2.81979,1.86345 -0.92752,1.02489 -5.15977,3.56053 -9.40499,5.63475 -4.24522,2.07422 -8.39359,4.29955 -9.21859,4.94518 -0.825,0.64562 -6.39285,3.09474 -12.373,5.44248 -11.49739,4.51375 -32.10966,9.40684 -44.627,10.59389 -6.69337,0.63475 -8.5755,1.3336 -17.5,6.49791 -12.85604,7.43937 -28.69032,15.34514 -47.10323,23.51779 C 474.3367,749.07295 467.63122,752 467.49571,752 c -0.1355,0 -2.10686,-3.9375 -4.3808,-8.75 z m 32.15326,-41.34475 c 31.59713,-15.7332 59.19691,-35.15661 80.73629,-56.81838 17.01538,-17.11205 25.5111,-28.58815 34.4881,-46.58687 11.9173,-23.89398 16.5814,-43.62465 16.66537,-70.5 0.11998,-38.40243 -11.93635,-71.45881 -39.57215,-108.5 -11.64972,-15.6145 -42.07906,-46.06983 -62.11663,-62.16969 -19.54832,-15.70675 -25.58789,-21.27881 -32.56611,-30.04525 -12.12844,-15.23645 -15.56998,-27.77995 -10.60027,-38.63522 7.09038,-15.48743 21.9536,-29.87582 50.19723,-48.59357 7.15,-4.73849 17.58543,-11.27639 23.18984,-14.52869 5.60441,-3.25229 10.03889,-6.16398 9.85439,-6.47042 -15.96236,-26.51335 -67.98703,-111.81777 -68.5716,-112.43628 -1.73012,-1.83059 -29.15329,16.14199 -48.19009,31.5828 -13.00211,10.54604 -37.53954,34.75742 -46.60098,45.98172 -22.85283,28.30757 -38.13896,59.98404 -43.25448,89.63354 -2.53142,14.67209 -2.72977,38.50194 -0.43016,51.68106 4.90582,28.11538 16.05322,52.04795 36.33114,78 9.05101,11.58365 30.60249,32.15766 49.17194,46.94174 31.40775,25.00529 51.52352,47.60142 56.98411,64.0105 3.3042,9.92913 2.65644,19.77028 -1.9134,29.06947 -4.30945,8.76933 -16.74275,21.42373 -29.57071,30.09659 -9.08148,6.1399 -28.24723,16.96089 -34.25,19.33757 -1.7875,0.70772 -3.25,1.76046 -3.25,2.33942 0,0.57896 9.75176,21.78686 21.67057,47.12868 11.91882,25.34182 23.62226,50.23853 26.00764,55.32603 2.38538,5.0875 4.5668,9.25 4.84759,9.25 0.2808,0 5.11486,-2.29264 10.74237,-5.09475 z M 239.48124,690.86641 c 16.84159,-2.20186 34.47331,-8.10012 48.01876,-16.06351 34.37565,-20.20949 60.29807,-57.1792 70.3304,-100.3029 4.87798,-20.96783 5.34231,-28.39304 5.84701,-93.5 l 0.47674,-61.5 -7.67673,-11.5 c -31.53249,-47.23674 -41.02705,-102.32895 -26.96359,-156.45627 5.12428,-19.72227 14.99606,-41.74727 27.97416,-62.41332 7.24298,-11.53357 8.48428,-16.65645 4.26201,-17.58954 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 -0.0349,189.32945 c -0.0375,203.31681 0.1207,196.71035 -5.06087,211.38779 -1.21624,3.44515 -4.28761,9.30928 -6.82527,13.0314 C 228.99133,580.51881 224.48975,583 214.37751,583 c -6.65618,0 -7.60571,-0.26147 -10.64706,-2.9318 -4.38713,-3.85195 -8.36189,-12.15614 -11.21546,-23.43167 -3.4453,-13.61368 -4.57217,-24.59574 -5.22149,-50.88653 l -0.58657,-23.75 -4.60346,0.0417 c -7.7753,0.0704 -105.037564,7.55909 -105.609907,8.13143 -0.913826,0.91383 1.390052,43.83203 3.028479,56.41656 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3746"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fef3d5"
+       d="m 458.9011,734.07252 -8.4011,-18.02548 -84.09345,-0.0235 c -82.04176,-0.0229 -84.23756,0.0262 -90,2.01395 -20.18334,6.96227 -37.92517,9.3507 -64.40655,8.6705 -27.62875,-0.7097 -44.61293,-4.39443 -65.78441,-14.27199 C 103.32857,692.42706 69.863972,651.10039 55.058943,599.8633 46.380453,569.82888 44.748983,555.11271 44.253787,502.3988 l -0.414288,-44.10121 5.33025,-0.6401 C 52.101387,457.30543 56.75,457.00658 59.5,456.99338 c 2.75,-0.0132 5.549431,-0.3731 6.220957,-0.79976 0.94644,-0.60134 1.289956,-26.06086 1.527834,-113.23469 C 67.577596,222.46401 67.576462,222.49242 72.757911,205 c 3.662476,-12.36441 12.45007,-33.09779 14.884381,-35.11809 0.674729,-0.55998 2.196561,-2.89999 3.381848,-5.20002 1.185287,-2.30004 3.157782,-5.30689 4.383322,-6.68189 1.225539,-1.375 3.065835,-3.85 4.089547,-5.5 3.087091,-4.97573 23.442411,-25.26686 32.278961,-32.17717 17.92408,-14.01692 39.30366,-23.90298 64.03109,-29.608406 L 209.5,87.555014 335.5,87.027507 461.5,86.5 468,82.441568 c 8.92457,-5.572271 39.50875,-22.449307 40.60726,-22.407993 0.49101,0.01847 4.49191,6.034543 8.89091,13.369058 l 7.99816,13.335482 13.50184,0.55811 c 7.426,0.306961 17.32683,1.103202 22.00183,1.769424 14.61608,2.0829 44.70869,12.645781 50.20988,17.624291 0.99214,0.89788 2.67202,2.12245 3.73307,2.72128 9.27583,5.23505 13.71358,8.35729 21.05705,14.81495 10.41955,9.1627 24.89359,24.14007 28.39806,29.38558 1.42873,2.13854 3.81969,5.68825 5.31323,7.88825 5.07967,7.48237 13.28871,23.04471 13.28871,25.19215 0,0.68672 1.05832,3.62442 2.35182,6.52821 5.74301,12.89254 9.52818,31.46275 10.48524,51.44102 0.36462,7.61124 0.40447,84.93862 0.0886,171.83862 -0.56359,155.03058 -0.61365,158.19734 -2.66354,168.5 -3.3973,17.07463 -9.88568,34.81793 -16.5311,45.20638 -1.91836,2.9989 -3.80179,6.44139 -4.18538,7.64999 -0.3836,1.20859 -2.35078,4.17921 -4.37152,6.60137 -2.02074,2.42215 -5.19949,6.47354 -7.06388,9.00307 -6.93919,9.4148 -24.83724,25.9165 -38.77188,35.74702 -5.50825,3.88592 -20.25207,11.31093 -31.64537,15.93664 -10.4079,4.22564 -31.24707,9.15501 -43.69294,10.33528 -6.69337,0.63475 -8.5755,1.3336 -17.5,6.49791 -15.22233,8.80866 -39.63152,20.65774 -61.0989,29.65955 -0.62786,0.26328 -4.69998,-7.26573 -9.5,-17.56469 z m 36.36707,-32.16727 c 31.59713,-15.7332 59.19691,-35.15661 80.73629,-56.81838 C 593.3224,627.67054 601.61369,616.3809 610.95298,597.5 621.0898,577.00677 625.35921,561.42046 626.90075,539.27952 629.8437,497.01019 617.6125,459.74583 587.58578,419.5 575.93606,403.8855 545.50672,373.43017 525.46915,357.33031 505.92083,341.62356 499.88126,336.0515 492.90304,327.28506 480.7746,312.04861 477.33306,299.50511 482.30277,288.64984 c 7.09038,-15.48743 21.9536,-29.87582 50.19723,-48.59357 7.15,-4.73849 17.58543,-11.27639 23.18984,-14.52869 5.60441,-3.25229 10.03889,-6.16398 9.85439,-6.47042 -15.96236,-26.51335 -67.98703,-111.81777 -68.5716,-112.43628 -1.73012,-1.83059 -29.15329,16.14199 -48.19009,31.5828 -13.00211,10.54604 -37.53954,34.75742 -46.60098,45.98172 -22.83813,28.28935 -38.10137,59.90691 -43.2702,89.63354 -2.55562,14.69769 -2.75235,38.47004 -0.42771,51.68106 4.96426,28.21195 16.077,52.0614 36.34441,78 9.05101,11.58365 30.60249,32.15766 49.17194,46.94174 31.40775,25.00529 51.52352,47.60142 56.98411,64.0105 3.3042,9.92913 2.65644,19.77028 -1.9134,29.06947 -4.30945,8.76933 -16.74275,21.42373 -29.57071,30.09659 -9.08148,6.1399 -28.24723,16.96089 -34.25,19.33757 -1.7875,0.70772 -3.25,1.76046 -3.25,2.33942 0,0.57896 9.75176,21.78686 21.67057,47.12868 11.91882,25.34182 23.62226,50.23853 26.00764,55.32603 2.38538,5.0875 4.5668,9.25 4.84759,9.25 0.2808,0 5.11486,-2.29264 10.74237,-5.09475 z M 239.48124,690.86641 c 16.84159,-2.20186 34.47331,-8.10012 48.01876,-16.06351 34.37565,-20.20949 60.29807,-57.1792 70.3304,-100.3029 4.87059,-20.93608 5.34098,-28.42371 5.87392,-93.5 l 0.50365,-61.5 -7.7061,-11.5 c -25.38017,-37.87547 -36.90419,-82.63339 -32.45046,-126.03383 3.34268,-32.57356 13.99217,-61.86748 34.08852,-93.76847 6.60131,-10.47894 7.74234,-15.74363 3.61007,-16.65683 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 -0.0349,189.32945 c -0.0375,203.31681 0.1207,196.71035 -5.06087,211.38779 -1.21624,3.44515 -4.28761,9.30928 -6.82527,13.0314 C 228.99133,580.51881 224.48975,583 214.37751,583 c -6.65618,0 -7.60571,-0.26147 -10.64706,-2.9318 -4.38713,-3.85195 -8.36189,-12.15614 -11.21546,-23.43167 -3.4453,-13.61368 -4.57217,-24.59574 -5.22149,-50.88653 l -0.58657,-23.75 -4.60346,0.0417 c -7.7753,0.0704 -105.037564,7.55909 -105.609907,8.13143 -0.913826,0.91383 1.390052,43.83203 3.028479,56.41656 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3744"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ebebeb"
+       d="m 458.9011,734.07252 -8.4011,-18.02548 -84.09345,-0.0235 c -82.04176,-0.0229 -84.23756,0.0262 -90,2.01395 -20.18334,6.96227 -37.92517,9.3507 -64.40655,8.6705 -27.62875,-0.7097 -44.61293,-4.39443 -65.78441,-14.27199 C 103.32857,692.42706 69.863972,651.10039 55.058943,599.8633 46.380453,569.82888 44.748983,555.11271 44.253787,502.3988 l -0.414288,-44.10121 5.33025,-0.6401 C 52.101387,457.30543 56.75,457.00658 59.5,456.99338 c 2.75,-0.0132 5.549431,-0.3731 6.220957,-0.79976 0.94644,-0.60134 1.289956,-26.06086 1.527834,-113.23469 C 67.577596,222.46401 67.576462,222.49242 72.757911,205 c 3.662476,-12.36441 12.45007,-33.09779 14.884381,-35.11809 0.674729,-0.55998 2.196561,-2.89999 3.381848,-5.20002 1.185287,-2.30004 3.157782,-5.30689 4.383322,-6.68189 1.225539,-1.375 3.065835,-3.85 4.089547,-5.5 3.087091,-4.97573 23.442411,-25.26686 32.278961,-32.17717 17.92408,-14.01692 39.30366,-23.90298 64.03109,-29.608406 L 209.5,87.555014 335.5,87.027507 461.5,86.5 468,82.441568 c 8.92457,-5.572271 39.50875,-22.449307 40.60726,-22.407993 0.49101,0.01847 4.49191,6.034543 8.89091,13.369058 l 7.99816,13.335482 13.50184,0.55811 c 7.426,0.306961 17.32683,1.103202 22.00183,1.769424 14.61608,2.0829 44.70869,12.645781 50.20988,17.624291 0.99214,0.89788 2.67202,2.12245 3.73307,2.72128 9.27583,5.23505 13.71358,8.35729 21.05705,14.81495 10.41955,9.1627 24.89359,24.14007 28.39806,29.38558 1.42873,2.13854 3.81969,5.68825 5.31323,7.88825 5.07967,7.48237 13.28871,23.04471 13.28871,25.19215 0,0.68672 1.05832,3.62442 2.35182,6.52821 5.94432,13.34448 9.65831,32.09538 10.52465,53.136 0.34294,8.329 0.36808,85.56864 0.0559,171.64364 -0.5575,153.70081 -0.60514,156.6878 -2.66354,167 -3.41331,17.09999 -9.89858,34.82757 -16.53783,45.20638 -1.91836,2.9989 -3.80179,6.44139 -4.18538,7.64999 -0.3836,1.20859 -2.35078,4.17921 -4.37152,6.60137 -2.02074,2.42215 -5.19949,6.47354 -7.06388,9.00307 -6.93919,9.4148 -24.83724,25.9165 -38.77188,35.74702 -5.50825,3.88592 -20.25207,11.31093 -31.64537,15.93664 -10.4079,4.22564 -31.24707,9.15501 -43.69294,10.33528 -6.69337,0.63475 -8.5755,1.3336 -17.5,6.49791 -15.22233,8.80866 -39.63152,20.65774 -61.0989,29.65955 -0.62786,0.26328 -4.69998,-7.26573 -9.5,-17.56469 z m 36.36707,-32.16727 c 31.59713,-15.7332 59.19691,-35.15661 80.73629,-56.81838 C 593.3224,627.67054 601.61369,616.3809 610.95298,597.5 621.0898,577.00677 625.35921,561.42046 626.90075,539.27952 629.8437,497.01019 617.6125,459.74583 587.58578,419.5 575.93606,403.8855 545.50672,373.43017 525.46915,357.33031 505.92083,341.62356 499.88126,336.0515 492.90304,327.28506 480.7746,312.04861 477.33306,299.50511 482.30277,288.64984 c 7.09038,-15.48743 21.9536,-29.87582 50.19723,-48.59357 7.15,-4.73849 17.58543,-11.27639 23.18984,-14.52869 5.60441,-3.25229 10.03889,-6.16398 9.85439,-6.47042 -15.96236,-26.51335 -67.98703,-111.81777 -68.5716,-112.43628 -1.73012,-1.83059 -29.15329,16.14199 -48.19009,31.5828 -13.00211,10.54604 -37.53954,34.75742 -46.60098,45.98172 -22.83813,28.28935 -38.10137,59.90691 -43.2702,89.63354 -2.55562,14.69769 -2.75235,38.47004 -0.42771,51.68106 4.96426,28.21195 16.077,52.0614 36.34441,78 9.05101,11.58365 30.60249,32.15766 49.17194,46.94174 31.40775,25.00529 51.52352,47.60142 56.98411,64.0105 3.3042,9.92913 2.65644,19.77028 -1.9134,29.06947 -4.30945,8.76933 -16.74275,21.42373 -29.57071,30.09659 -9.08148,6.1399 -28.24723,16.96089 -34.25,19.33757 -1.7875,0.70772 -3.25,1.76046 -3.25,2.33942 0,0.57896 9.75176,21.78686 21.67057,47.12868 11.91882,25.34182 23.62226,50.23853 26.00764,55.32603 2.38538,5.0875 4.5668,9.25 4.84759,9.25 0.2808,0 5.11486,-2.29264 10.74237,-5.09475 z M 239.48124,690.86641 c 16.84159,-2.20186 34.47331,-8.10012 48.01876,-16.06351 34.37565,-20.20949 60.29807,-57.1792 70.3304,-100.3029 4.87059,-20.93608 5.34098,-28.42371 5.87392,-93.5 l 0.50365,-61.5 -7.7061,-11.5 c -25.38017,-37.87547 -36.90419,-82.63339 -32.45046,-126.03383 3.34268,-32.57356 13.99217,-61.86748 34.08852,-93.76847 6.60131,-10.47894 7.74234,-15.74363 3.61007,-16.65683 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 -0.0349,189.32945 c -0.0375,203.31681 0.1207,196.71035 -5.06087,211.38779 -1.21624,3.44515 -4.28761,9.30928 -6.82527,13.0314 C 228.99133,580.51881 224.48975,583 214.37751,583 c -6.65618,0 -7.60571,-0.26147 -10.64706,-2.9318 -4.38713,-3.85195 -8.36189,-12.15614 -11.21546,-23.43167 -3.4453,-13.61368 -4.57217,-24.59574 -5.22149,-50.88653 l -0.58657,-23.75 -4.60346,0.0417 c -7.7753,0.0704 -105.037564,7.55909 -105.609907,8.13143 -0.913826,0.91383 1.390052,43.83203 3.028479,56.41656 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3742"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fef1ca"
+       d="M 458.86325,733.95224 450.5,716.04009 l -84.07485,-0.02 -84.07485,-0.02 -7.42515,2.53548 C 270.84132,719.93 261.875,722.28392 255,723.76643 c -11.71897,2.52705 -14.06206,2.69408 -37.5,2.67333 -22.18311,-0.0196 -26.18309,-0.27777 -35.5,-2.29093 C 146.44703,716.46668 119.32998,700.62751 94.728156,673.17302 69.675644,645.21558 54.225654,609.15936 46.876582,561.5 44.977623,549.18509 44.663306,542.13205 44.265187,502.90225 l -0.452596,-44.59775 6.240396,-0.65225 c 3.432217,-0.35874 8.086884,-0.65914 10.343704,-0.66756 2.25682,-0.008 4.65274,-0.36441 5.324266,-0.79107 0.94644,-0.60134 1.289956,-26.06086 1.527834,-113.23469 C 67.488697,255.04236 67.848306,228.64501 68.896605,222 71.280107,206.89134 80.504996,180.78449 86.716627,171.56854 88.224855,169.33084 90.055073,166.375 90.78378,165 c 0.728707,-1.375 2.551149,-4.075 4.04987,-6 1.498722,-1.925 3.579882,-4.85 4.624801,-6.5 3.204929,-5.06081 23.565479,-25.33295 32.317519,-32.17717 17.92408,-14.01692 39.30366,-23.90298 64.03109,-29.608406 L 209.5,87.555014 335.5,87.027507 461.5,86.5 l 4,-2.59758 c 5.88733,-3.823203 42.19473,-23.906544 43.16725,-23.877849 0.45801,0.01351 4.38662,6.027961 8.73024,13.365437 l 7.89749,13.340866 13.60251,0.561731 c 18.83866,0.777964 28.58024,2.344326 43.0384,6.920207 13.64832,4.319574 23.36884,8.433758 28.31416,11.983898 1.76465,1.26681 3.97652,2.75329 4.91527,3.30329 0.93874,0.55 4.09808,2.40658 7.02074,4.12574 9.77727,5.75114 35.82388,30.42422 42.212,39.98601 1.42873,2.13854 3.81969,5.68825 5.31323,7.88825 5.07967,7.48237 13.28871,23.04471 13.28871,25.19215 0,0.68672 1.05832,3.62442 2.35182,6.52821 5.94432,13.34448 9.65831,32.09538 10.52465,53.136 0.34294,8.329 0.36808,85.56864 0.0559,171.64364 -0.5575,153.70081 -0.60514,156.6878 -2.66354,167 -3.41331,17.09999 -9.89858,34.82757 -16.53783,45.20638 -1.91836,2.9989 -3.80179,6.44139 -4.18538,7.64999 -0.3836,1.20859 -2.35078,4.17302 -4.37152,6.58761 -2.02074,2.41459 -5.02407,6.26315 -6.67407,8.55236 -1.65,2.2892 -7.5,8.61241 -13,14.05157 -19.16827,18.95624 -32.8145,27.94951 -57.80706,38.09656 -10.40231,4.22337 -31.23466,9.15226 -43.69294,10.33766 -6.74883,0.64215 -8.60171,1.34187 -18.5,6.98636 -16.85214,9.60991 -43.24549,22.35728 -59.13675,28.56165 -1.98083,0.77337 -2.74696,-0.47272 -10.5,-17.0779 z m 36.40492,-32.04699 c 31.59713,-15.7332 59.19691,-35.15661 80.73629,-56.81838 C 593.3224,627.67054 601.61369,616.3809 610.95298,597.5 621.0898,577.00677 625.35921,561.42046 626.90075,539.27952 629.8437,497.01019 617.6125,459.74583 587.58578,419.5 575.93606,403.8855 545.50672,373.43017 525.46915,357.33031 505.92083,341.62356 499.88126,336.0515 492.90304,327.28506 480.7746,312.04861 477.33306,299.50511 482.30277,288.64984 c 7.09038,-15.48743 21.9536,-29.87582 50.19723,-48.59357 7.15,-4.73849 17.58543,-11.27639 23.18984,-14.52869 5.60441,-3.25229 10.03889,-6.16398 9.85439,-6.47042 -15.96236,-26.51335 -67.98703,-111.81777 -68.5716,-112.43628 -1.73012,-1.83059 -29.15329,16.14199 -48.19009,31.5828 -13.00211,10.54604 -37.53954,34.75742 -46.60098,45.98172 -33.01408,40.8942 -48.36766,84.51789 -45.10975,128.16911 2.4009,32.16872 14.60597,61.67355 37.67092,91.06661 9.19749,11.72091 30.69489,32.24217 49.25727,47.02062 31.40775,25.00529 51.52352,47.60142 56.98411,64.0105 3.3042,9.92913 2.65644,19.77028 -1.9134,29.06947 -6.46428,13.15419 -24.24354,28.26987 -49.88142,42.40846 -5.12088,2.82403 -11.08338,5.84389 -13.25,6.7108 -2.16661,0.8669 -3.93929,2.05561 -3.93929,2.64158 0,0.58596 9.75176,21.7996 21.67057,47.14142 11.91882,25.34182 23.62226,50.23853 26.00764,55.32603 2.38538,5.0875 4.5668,9.25 4.84759,9.25 0.2808,0 5.11486,-2.29264 10.74237,-5.09475 z M 239.48124,690.86641 c 16.84159,-2.20186 34.47331,-8.10012 48.01876,-16.06351 34.37565,-20.20949 60.29807,-57.1792 70.3304,-100.3029 4.87059,-20.93608 5.34098,-28.42371 5.87392,-93.5 l 0.50365,-61.5 -7.58805,-11.3389 c -45.6063,-68.14992 -44.49064,-150.12213 3.02518,-222.27393 5.13854,-7.80277 5.97319,-13.49144 2.1049,-14.3463 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 -0.0349,189.32945 c -0.0375,203.31681 0.1207,196.71035 -5.06087,211.38779 -1.21624,3.44515 -4.28761,9.30928 -6.82527,13.0314 C 228.99133,580.51881 224.48975,583 214.37751,583 c -6.65618,0 -7.60571,-0.26147 -10.64706,-2.9318 -4.38713,-3.85195 -8.36189,-12.15614 -11.21546,-23.43167 -3.4453,-13.61368 -4.57217,-24.59574 -5.22149,-50.88653 l -0.58657,-23.75 -4.60346,0.0417 c -7.7753,0.0704 -105.037564,7.55909 -105.609907,8.13143 -0.913826,0.91383 1.390052,43.83203 3.028479,56.41656 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3740"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f8edcb"
+       d="M 458.86325,733.95224 450.5,716.04009 l -84.07485,-0.02 -84.07485,-0.02 -7.42515,2.53548 C 270.84132,719.93 261.875,722.28392 255,723.76643 c -11.71897,2.52705 -14.06206,2.69408 -37.5,2.67333 -22.18311,-0.0196 -26.18309,-0.27777 -35.5,-2.29093 C 146.44703,716.46668 119.32998,700.62751 94.728156,673.17302 69.675644,645.21558 54.225654,609.15936 46.876582,561.5 44.977623,549.18509 44.663306,542.13205 44.265187,502.90225 l -0.452596,-44.59775 6.240396,-0.65225 c 3.432217,-0.35874 8.086884,-0.65914 10.343704,-0.66756 2.25682,-0.008 4.65274,-0.36441 5.324266,-0.79107 0.94644,-0.60134 1.289956,-26.06086 1.527834,-113.23469 C 67.488697,255.04236 67.848306,228.64501 68.896605,222 71.280107,206.89134 80.504996,180.78449 86.716627,171.56854 88.224855,169.33084 90.055073,166.375 90.78378,165 c 0.728707,-1.375 2.551149,-4.075 4.04987,-6 1.498722,-1.925 3.579882,-4.85 4.624801,-6.5 3.204929,-5.06081 23.565479,-25.33295 32.317519,-32.17717 17.92408,-14.01692 39.30366,-23.90298 64.03109,-29.608406 L 209.5,87.555014 335.5,87.027507 461.5,86.5 l 4,-2.59758 c 5.88733,-3.823203 42.19473,-23.906544 43.16725,-23.877849 0.45801,0.01351 4.38662,6.027961 8.73024,13.365437 l 7.89749,13.340866 13.60251,0.561731 c 18.83866,0.777964 28.58024,2.344326 43.0384,6.920207 13.64832,4.319574 23.36884,8.433758 28.31416,11.983898 1.76465,1.26681 3.97652,2.75329 4.91527,3.30329 0.93874,0.55 4.09808,2.40658 7.02074,4.12574 9.77727,5.75114 35.82388,30.42422 42.212,39.98601 1.42873,2.13854 3.81969,5.68825 5.31323,7.88825 5.1258,7.55032 13.28871,23.05011 13.28871,25.23269 0,0.70901 0.87843,3.1967 1.95206,5.52821 4.5761,9.9375 7.34719,20.86111 10.08099,39.7391 1.18914,8.21156 1.26482,340.55348 0.0781,342.84757 -0.47015,0.90884 -1.38218,5.33126 -2.02674,9.82761 -1.96723,13.72316 -9.59966,34.97341 -16.3534,45.5312 -1.91836,2.9989 -3.80179,6.44139 -4.18538,7.64999 -0.3836,1.20859 -2.35078,4.17302 -4.37152,6.58761 -2.02074,2.41459 -5.02407,6.26315 -6.67407,8.55236 -1.65,2.2892 -7.5,8.61241 -13,14.05157 -19.16827,18.95624 -32.8145,27.94951 -57.80706,38.09656 -10.40231,4.22337 -31.23466,9.15226 -43.69294,10.33766 -6.74883,0.64215 -8.60171,1.34187 -18.5,6.98636 -16.85214,9.60991 -43.24549,22.35728 -59.13675,28.56165 -1.98083,0.77337 -2.74696,-0.47272 -10.5,-17.0779 z m 36.40492,-32.04699 c 31.59713,-15.7332 59.19691,-35.15661 80.73629,-56.81838 C 593.3224,627.67054 601.61369,616.3809 610.95298,597.5 621.0898,577.00677 625.35921,561.42046 626.90075,539.27952 629.8437,497.01019 617.6125,459.74583 587.58578,419.5 575.93606,403.8855 545.50672,373.43017 525.46915,357.33031 505.92083,341.62356 499.88126,336.0515 492.90304,327.28506 480.7746,312.04861 477.33306,299.50511 482.30277,288.64984 c 7.09038,-15.48743 21.9536,-29.87582 50.19723,-48.59357 7.15,-4.73849 17.58543,-11.27639 23.18984,-14.52869 5.60441,-3.25229 10.03889,-6.16398 9.85439,-6.47042 -15.96236,-26.51335 -67.98703,-111.81777 -68.5716,-112.43628 -1.73012,-1.83059 -29.15329,16.14199 -48.19009,31.5828 -13.00211,10.54604 -37.53954,34.75742 -46.60098,45.98172 -33.01408,40.8942 -48.36766,84.51789 -45.10975,128.16911 2.4009,32.16872 14.60597,61.67355 37.67092,91.06661 9.19749,11.72091 30.69489,32.24217 49.25727,47.02062 31.40775,25.00529 51.52352,47.60142 56.98411,64.0105 3.3042,9.92913 2.65644,19.77028 -1.9134,29.06947 -6.46428,13.15419 -24.24354,28.26987 -49.88142,42.40846 -5.12088,2.82403 -11.08338,5.84389 -13.25,6.7108 -2.16661,0.8669 -3.93929,2.05561 -3.93929,2.64158 0,0.58596 9.75176,21.7996 21.67057,47.14142 11.91882,25.34182 23.62226,50.23853 26.00764,55.32603 2.38538,5.0875 4.5668,9.25 4.84759,9.25 0.2808,0 5.11486,-2.29264 10.74237,-5.09475 z M 239.48124,690.86641 c 16.84159,-2.20186 34.47331,-8.10012 48.01876,-16.06351 34.37565,-20.20949 60.29807,-57.1792 70.3304,-100.3029 4.87059,-20.93608 5.34098,-28.42371 5.87392,-93.5 l 0.50365,-61.5 -7.58805,-11.3389 c -45.6063,-68.14992 -44.49064,-150.12213 3.02518,-222.27393 5.13854,-7.80277 5.97319,-13.49144 2.1049,-14.3463 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 -0.0349,189.32945 c -0.0375,203.31681 0.1207,196.71035 -5.06087,211.38779 -1.21624,3.44515 -4.28761,9.30928 -6.82527,13.0314 C 228.99133,580.51881 224.48975,583 214.37751,583 c -6.65618,0 -7.60571,-0.26147 -10.64706,-2.9318 -4.38713,-3.85195 -8.36189,-12.15614 -11.21546,-23.43167 -3.4453,-13.61368 -4.57217,-24.59574 -5.22149,-50.88653 l -0.58657,-23.75 -4.60346,0.0417 c -7.7753,0.0704 -105.037564,7.55909 -105.609907,8.13143 -0.913826,0.91383 1.390052,43.83203 3.028479,56.41656 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3738"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e4e4e4"
+       d="M 458.86325,733.95224 450.5,716.04009 l -84.07485,-0.02 -84.07485,-0.02 -7.42515,2.53548 C 270.84132,719.93 261.875,722.28392 255,723.76643 c -11.71897,2.52705 -14.06206,2.69408 -37.5,2.67333 -22.18311,-0.0196 -26.18309,-0.27777 -35.5,-2.29093 C 146.44703,716.46668 119.32998,700.62751 94.728156,673.17302 69.675644,645.21558 54.225654,609.15936 46.876582,561.5 44.977623,549.18509 44.663306,542.13205 44.265187,502.90225 l -0.452596,-44.59775 6.240396,-0.65225 c 3.432217,-0.35874 8.086884,-0.65914 10.343704,-0.66756 2.25682,-0.008 4.65274,-0.36441 5.324266,-0.79107 0.94644,-0.60134 1.289956,-26.06086 1.527834,-113.23469 C 67.488697,255.04236 67.848306,228.64501 68.896605,222 71.280107,206.89134 80.504996,180.78449 86.716627,171.56854 88.224855,169.33084 90.055073,166.375 90.78378,165 c 0.728707,-1.375 2.551149,-4.075 4.04987,-6 1.498722,-1.925 3.579882,-4.85 4.624801,-6.5 3.204929,-5.06081 23.565479,-25.33295 32.317519,-32.17717 17.92408,-14.01692 39.30366,-23.90298 64.03109,-29.608406 L 209.5,87.555014 335.5,87.027507 461.5,86.5 l 4,-2.59758 c 5.88733,-3.823203 42.19473,-23.906544 43.16725,-23.877849 0.45801,0.01351 4.38662,6.027961 8.73024,13.365437 l 7.89749,13.340866 13.60251,0.561731 c 18.83866,0.777964 28.58024,2.344326 43.0384,6.920207 13.64832,4.319574 23.36884,8.433758 28.31416,11.983898 1.76465,1.26681 3.97652,2.75329 4.91527,3.30329 0.93874,0.55 4.09808,2.40658 7.02074,4.12574 9.77727,5.75114 35.82388,30.42422 42.212,39.98601 1.42873,2.13854 3.81969,5.68825 5.31323,7.88825 5.1258,7.55032 13.28871,23.05011 13.28871,25.23269 0,0.70901 0.87843,3.1967 1.95206,5.52821 4.5761,9.9375 7.34719,20.86111 10.08099,39.7391 1.18914,8.21156 1.26482,340.55348 0.0781,342.84757 -0.47015,0.90884 -1.38218,5.33126 -2.02674,9.82761 -1.96723,13.72316 -9.59966,34.97341 -16.3534,45.5312 -1.91836,2.9989 -3.80179,6.44139 -4.18538,7.64999 -0.3836,1.20859 -2.35078,4.17302 -4.37152,6.58761 -2.02074,2.41459 -5.02407,6.26315 -6.67407,8.55236 -1.65,2.2892 -7.5,8.61241 -13,14.05157 -19.16827,18.95624 -32.8145,27.94951 -57.80706,38.09656 -10.40231,4.22337 -31.23466,9.15226 -43.69294,10.33766 -6.74883,0.64215 -8.60171,1.34187 -18.5,6.98636 -16.85214,9.60991 -43.24549,22.35728 -59.13675,28.56165 -1.98083,0.77337 -2.74696,-0.47272 -10.5,-17.0779 z m 36.40492,-32.04699 C 511.36252,693.89137 534.31801,679.83843 548.5,669.31767 564.58222,657.38724 587.73732,634.42338 597.22005,621 c 30.08276,-42.58395 38.13951,-94.09847 22.28667,-142.5 -6.50734,-19.86806 -16.55554,-38.47548 -31.75396,-58.80253 -11.83795,-15.8326 -42.17438,-46.20973 -62.28361,-62.36716 -19.54832,-15.70675 -25.58789,-21.27881 -32.56611,-30.04525 -12.12844,-15.23645 -15.56998,-27.77995 -10.60027,-38.63522 7.09038,-15.48743 21.9536,-29.87582 50.19723,-48.59357 7.15,-4.73849 17.58543,-11.27639 23.18984,-14.52869 5.60441,-3.25229 10.03889,-6.16398 9.85439,-6.47042 -15.96236,-26.51335 -67.98703,-111.81777 -68.5716,-112.43628 -1.74659,-1.84802 -29.3975,16.30449 -48.19009,31.63624 -64.34016,52.4913 -96.26379,113.09293 -91.71073,174.09739 2.4009,32.16872 14.60597,61.67355 37.67092,91.06661 9.17111,11.6873 30.66694,32.21831 49.25727,47.04641 31.63343,25.23159 51.51798,47.55899 56.98411,63.98471 3.3042,9.92913 2.65644,19.77028 -1.9134,29.06947 -6.46428,13.15419 -24.24354,28.26987 -49.88142,42.40846 -5.12088,2.82403 -11.08338,5.84389 -13.25,6.7108 -2.16661,0.8669 -3.93929,2.05301 -3.93929,2.63579 0,0.58278 9.74869,21.79642 21.66375,47.14142 11.91506,25.345 23.61849,50.24432 26.00763,55.33182 2.38914,5.0875 4.57363,9.25 4.85442,9.25 0.2808,0 5.11486,-2.29264 10.74237,-5.09475 z M 239.48124,690.86641 c 16.84159,-2.20186 34.47331,-8.10012 48.01876,-16.06351 34.37565,-20.20949 60.29807,-57.1792 70.3304,-100.3029 4.87059,-20.93608 5.34098,-28.42371 5.87392,-93.5 l 0.50365,-61.5 -7.58805,-11.3389 c -45.6063,-68.14992 -44.49064,-150.12213 3.02518,-222.27393 5.13854,-7.80277 5.97319,-13.49144 2.1049,-14.3463 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 -0.0349,189.32945 c -0.0375,203.31681 0.1207,196.71035 -5.06087,211.38779 -1.21624,3.44515 -4.28761,9.30928 -6.82527,13.0314 C 228.99133,580.51881 224.48975,583 214.37751,583 c -6.65618,0 -7.60571,-0.26147 -10.64706,-2.9318 -4.38713,-3.85195 -8.36189,-12.15614 -11.21546,-23.43167 -3.4453,-13.61368 -4.57217,-24.59574 -5.22149,-50.88653 l -0.58657,-23.75 -4.60346,0.0417 c -7.7753,0.0704 -105.037564,7.55909 -105.609907,8.13143 -0.913826,0.91383 1.390052,43.83203 3.028479,56.41656 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3736"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f8e7b8"
+       d="M 458.86712,733.93404 450.5,716.00665 366.42515,716.00333 282.3503,716 l -7.42515,2.53548 C 270.84132,719.93 261.875,722.27747 255,723.75208 c -11.67412,2.50397 -14.15176,2.68093 -37.5,2.67825 -22.25118,-0.003 -26.1545,-0.25286 -35.5,-2.27658 -31.34105,-6.78674 -54.59274,-19.07085 -76.8301,-40.59014 -18.042559,-17.45993 -27.421608,-30.4244 -38.047183,-52.59183 -11.611833,-24.225 -18.042232,-48.80184 -21.640928,-82.71114 -1.011557,-9.53156 -1.463667,-25.4723 -1.471083,-51.86818 L 44,458.28491 l 6.146691,-0.64245 c 3.38068,-0.35335 7.99318,-0.64935 10.25,-0.65777 2.25682,-0.008 4.649363,-0.36232 5.316762,-0.78643 0.935999,-0.59481 1.298612,-26.71435 1.585897,-114.23469 C 67.660263,232.01282 67.735983,228.17492 69.745086,218 c 3.21709,-16.29266 10.989019,-37.55543 16.971541,-46.43146 1.508228,-2.2377 3.338446,-5.19354 4.067153,-6.56854 0.728707,-1.375 2.551149,-4.075 4.04987,-6 1.498722,-1.925 3.57872,-4.85 4.622218,-6.5 5.937572,-9.3886 41.545422,-41.5 46.018732,-41.5 0.75457,0 2.73826,-1.14967 4.40819,-2.55483 2.6709,-2.24742 8.91215,-5.10147 27.61721,-12.62903 2.75,-1.106695 11.075,-3.418187 18.5,-5.13665 l 13.5,-3.124476 126,-0.527507 L 461.5,86.5 470,81.387001 c 16.69924,-10.045081 38.03441,-21.48377 38.98046,-20.899077 0.52937,0.32717 4.42201,6.362818 8.6503,13.41255 l 7.6878,12.817694 14.09072,0.616523 c 7.7499,0.339088 18.1688,1.266648 23.15313,2.061246 15.09091,2.405782 39.02096,10.762513 47.33164,16.528923 4.33865,3.0104 5.87883,3.97633 12.60595,7.90592 9.43635,5.51215 35.5996,30.35339 41.89806,39.78097 1.42873,2.13854 3.81969,5.68825 5.31323,7.88825 5.1258,7.55032 13.28871,23.05011 13.28871,25.23269 0,0.70901 0.87843,3.1967 1.95206,5.52821 4.71116,10.2308 7.54836,21.66135 10.11195,40.7391 1.20699,8.98217 1.16503,336.71457 -0.0436,340.92898 -0.51985,1.81259 -1.4194,6.70519 -1.99901,10.87246 -1.76608,12.69761 -8.88907,33.03458 -15.30535,43.69856 -2.31646,3.85 -4.78016,8.30094 -5.47488,9.89098 -0.69473,1.59004 -2.72068,4.57709 -4.50213,6.6379 -1.78145,2.06081 -4.589,5.63304 -6.239,7.93829 -8.45054,11.80643 -39.51172,38.75245 -46.75945,40.56449 -1.5177,0.37944 -2.97148,1.03298 -3.23063,1.45229 -0.83578,1.35232 -23.82895,11.81091 -30.50992,13.87763 -6.35842,1.96695 -27.37325,6.02438 -34.82631,6.72408 -6.35819,0.59691 -8.40641,1.33363 -15.5,5.57514 -13.97976,8.359 -46.14075,24.03308 -61.30657,29.87855 -1.97379,0.76077 -2.75696,-0.51507 -10.5,-17.10531 z m 36.40105,-32.02879 C 511.36252,693.89137 534.31801,679.83843 548.5,669.31767 564.58222,657.38724 587.73732,634.42338 597.22005,621 c 30.08276,-42.58395 38.13951,-94.09847 22.28667,-142.5 -6.50734,-19.86806 -16.55554,-38.47548 -31.75396,-58.80253 -11.83795,-15.8326 -42.17438,-46.20973 -62.28361,-62.36716 -19.54832,-15.70675 -25.58789,-21.27881 -32.56611,-30.04525 -12.12844,-15.23645 -15.56998,-27.77995 -10.60027,-38.63522 7.09038,-15.48743 21.9536,-29.87582 50.19723,-48.59357 7.15,-4.73849 17.58543,-11.27639 23.18984,-14.52869 5.60441,-3.25229 10.03889,-6.16398 9.85439,-6.47042 -15.96236,-26.51335 -67.98703,-111.81777 -68.5716,-112.43628 -1.74659,-1.84802 -29.3975,16.30449 -48.19009,31.63624 -47.96869,39.13479 -79.78984,85.61497 -88.76485,129.65607 -9.89749,48.5678 1.54677,93.22686 34.72504,135.50793 9.17111,11.6873 30.66694,32.21831 49.25727,47.04641 31.63343,25.23159 51.51798,47.55899 56.98411,63.98471 3.3042,9.92913 2.65644,19.77028 -1.9134,29.06947 -6.46428,13.15419 -24.24354,28.26987 -49.88142,42.40846 -5.12088,2.82403 -11.08338,5.84389 -13.25,6.7108 -2.16661,0.8669 -3.93929,2.05301 -3.93929,2.63579 0,0.58278 9.74869,21.79642 21.66375,47.14142 11.91506,25.345 23.61849,50.24432 26.00763,55.33182 2.38914,5.0875 4.57363,9.25 4.85442,9.25 0.2808,0 5.11486,-2.29264 10.74237,-5.09475 z M 239.48124,690.86641 c 16.84159,-2.20186 34.47331,-8.10012 48.01876,-16.06351 34.37565,-20.20949 60.29807,-57.1792 70.3304,-100.3029 4.86895,-20.92904 5.34054,-28.42897 5.88276,-93.55701 l 0.51249,-61.55702 -7.22075,-10.74049 C 311.79394,341.39654 312.0907,259.44854 357.80072,188.88711 362.51141,181.61534 364,178.44347 364,175.67777 c 0,-2.96047 -0.41987,-3.73245 -2.25,-4.1369 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 -0.0349,189.32945 c -0.0375,203.31681 0.1207,196.71035 -5.06087,211.38779 -1.21624,3.44515 -4.28761,9.30928 -6.82527,13.0314 C 228.99133,580.51881 224.48975,583 214.37751,583 c -6.65618,0 -7.60571,-0.26147 -10.64706,-2.9318 -4.38713,-3.85195 -8.36189,-12.15614 -11.21546,-23.43167 -3.4453,-13.61368 -4.57217,-24.59574 -5.22149,-50.88653 l -0.58657,-23.75 -4.60346,0.0417 c -7.7753,0.0704 -105.037564,7.55909 -105.609907,8.13143 -0.913826,0.91383 1.390052,43.83203 3.028479,56.41656 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3734"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#dcdcdc"
+       d="M 458.86712,733.93404 450.5,716.00665 366.42515,716.00333 282.3503,716 l -7.42515,2.53548 C 270.84132,719.93 261.875,722.27747 255,723.75208 c -11.67412,2.50397 -14.15176,2.68093 -37.5,2.67825 -22.25118,-0.003 -26.1545,-0.25286 -35.5,-2.27658 -31.34105,-6.78674 -54.59274,-19.07085 -76.8301,-40.59014 -18.042559,-17.45993 -27.421608,-30.4244 -38.047183,-52.59183 -11.611833,-24.225 -18.042232,-48.80184 -21.640928,-82.71114 -1.011557,-9.53156 -1.463667,-25.4723 -1.471083,-51.86818 L 44,458.28491 l 6.146691,-0.64245 c 3.38068,-0.35335 7.99318,-0.64935 10.25,-0.65777 2.25682,-0.008 4.649363,-0.36232 5.316762,-0.78643 0.935999,-0.59481 1.298612,-26.71435 1.585897,-114.23469 C 67.660263,232.01282 67.735983,228.17492 69.745086,218 c 3.21709,-16.29266 10.989019,-37.55543 16.971541,-46.43146 1.508228,-2.2377 3.338446,-5.19354 4.067153,-6.56854 0.728707,-1.375 2.551149,-4.075 4.04987,-6 1.498722,-1.925 3.57872,-4.85 4.622218,-6.5 5.937572,-9.3886 41.545422,-41.5 46.018732,-41.5 0.75457,0 2.73826,-1.14967 4.40819,-2.55483 2.6709,-2.24742 8.91215,-5.10147 27.61721,-12.62903 2.75,-1.106695 11.075,-3.418187 18.5,-5.13665 l 13.5,-3.124476 126,-0.527507 L 461.5,86.5 470,81.387001 c 16.69924,-10.045081 38.03441,-21.48377 38.98046,-20.899077 0.52937,0.32717 4.42201,6.362818 8.6503,13.41255 l 7.6878,12.817694 14.09072,0.616523 c 7.7499,0.339088 18.1688,1.266648 23.15313,2.061246 15.09091,2.405782 39.02096,10.762513 47.33164,16.528923 4.33865,3.0104 5.87883,3.97633 12.60595,7.90592 9.43635,5.51215 35.5996,30.35339 41.89806,39.78097 1.42873,2.13854 3.81969,5.68825 5.31323,7.88825 5.1258,7.55032 13.28871,23.05011 13.28871,25.23269 0,0.70901 0.87843,3.1967 1.95206,5.52821 4.72206,10.25447 7.6317,22.00018 10.09187,40.7391 1.21067,9.22154 1.20458,336.64668 -0.006,340.8689 -0.52932,1.84563 -1.43663,6.76527 -2.01624,10.93254 -1.76608,12.69761 -8.88907,33.03458 -15.30535,43.69856 -2.31646,3.85 -4.78016,8.30094 -5.47488,9.89098 -0.69473,1.59004 -2.72068,4.57709 -4.50213,6.6379 -1.78145,2.06081 -4.589,5.63304 -6.239,7.93829 -8.45054,11.80643 -39.51172,38.75245 -46.75945,40.56449 -1.5177,0.37944 -2.97148,1.03298 -3.23063,1.45229 -0.83578,1.35232 -23.82895,11.81091 -30.50992,13.87763 -6.35842,1.96695 -27.37325,6.02438 -34.82631,6.72408 -6.35819,0.59691 -8.40641,1.33363 -15.5,5.57514 -13.97976,8.359 -46.14075,24.03308 -61.30657,29.87855 -1.97379,0.76077 -2.75696,-0.51507 -10.5,-17.10531 z m 36.40105,-32.02879 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -5.92725,-12.8295 -14.17123,-26.35274 -24.42623,-40.06824 -11.83795,-15.8326 -42.17438,-46.20973 -62.28361,-62.36716 -19.54832,-15.70675 -25.58789,-21.27881 -32.56611,-30.04525 -17.87883,-22.46043 -16.87048,-37.75561 3.88279,-58.89615 12.65751,-12.8937 33.90357,-28.35334 58.90401,-42.86133 5.60441,-3.25229 10.03889,-6.16398 9.85439,-6.47042 -15.96236,-26.51335 -67.98703,-111.81777 -68.5716,-112.43628 -1.68392,-1.78171 -26.7611,14.52124 -46.20519,30.0385 -48.50491,38.70912 -81.66364,86.66749 -90.74975,131.25381 -9.89749,48.5678 1.54677,93.22686 34.72504,135.50793 9.17111,11.6873 30.66694,32.21831 49.25727,47.04641 31.6744,25.26427 51.51736,47.55714 57.00267,64.04051 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.47271,13.17325 -24.95984,28.74616 -50.48982,42.53087 -5.5,2.96968 -11.4625,5.9905 -13.25,6.71293 -1.7875,0.72243 -3.25,1.78763 -3.25,2.36712 0,0.57948 9.74696,21.78739 21.65991,47.12868 11.91295,25.34129 23.61639,50.23757 26.00764,55.32507 2.39124,5.0875 4.57746,9.25 4.85825,9.25 0.2808,0 5.11486,-2.29264 10.74237,-5.09475 z M 239.48124,690.86641 c 16.84159,-2.20186 34.47331,-8.10012 48.01876,-16.06351 34.37565,-20.20949 60.29807,-57.1792 70.3304,-100.3029 4.86895,-20.92904 5.34054,-28.42897 5.88276,-93.55701 l 0.51249,-61.55702 -7.22075,-10.74049 C 311.79394,341.39654 312.0907,259.44854 357.80072,188.88711 362.51141,181.61534 364,178.44347 364,175.67777 c 0,-2.96047 -0.41987,-3.73245 -2.25,-4.1369 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 -0.0349,189.32945 c -0.0375,203.31681 0.1207,196.71035 -5.06087,211.38779 -1.21624,3.44515 -4.28761,9.30928 -6.82527,13.0314 C 228.99133,580.51881 224.48975,583 214.37751,583 c -6.65618,0 -7.60571,-0.26147 -10.64706,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.072121,4.31469 -55.377552,4.62012 -0.927666,0.92766 1.355093,43.71894 3.010574,56.43446 4.896158,37.60671 15.246285,68.33798 30.757778,91.32502 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.3741,30.74802 68.5331,43.23773 116.0754,37.02209 z"
+       id="path3732"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#d3d3d3"
+       d="M 458.92334,733.95415 450.563,716 l -84.19132,0 -84.19133,0 -9.04071,2.95437 c -15.84671,5.17846 -28.76027,7.2166 -49.33852,7.78707 -20.77381,0.5759 -32.35764,-0.45244 -48.74676,-4.32742 -26.95425,-6.37297 -49.3659,-18.89688 -70.42465,-39.35419 C 77.74372,656.94171 61.479078,627.4106 51.998895,587.5 45.544609,560.32812 44.001898,542.55241 44.000836,495.34332 L 44,458.18665 l 9.75,-0.65082 c 5.3625,-0.35795 10.425,-0.74351 11.25,-0.85679 1.319437,-0.18118 1.570743,-13.92716 2.08769,-114.19251 C 67.654486,232.55231 67.748969,228.12672 69.745382,218 c 1.138502,-5.775 2.961416,-13.2 4.05092,-16.5 3.023897,-9.15908 9.818815,-25.28955 11.87201,-28.183 C 86.67574,171.8973 89.3,167.92142 91.5,164.48172 c 2.2,-3.4397 5.296925,-8.21774 6.882056,-10.61786 C 105.28383,143.41355 140.97048,111 145.57428,111 c 0.69975,0 2.56597,-1.08857 4.14715,-2.41905 2.67904,-2.25427 15.50283,-8.05215 28.27857,-12.7853 3.025,-1.1207 11.35,-3.433505 18.5,-5.139567 l 13,-3.101932 126,-0.527075 L 461.5,86.5 471,80.863779 c 16.77465,-9.95217 37.10937,-20.914219 37.89519,-20.428554 0.41954,0.259291 4.29222,6.279243 8.60594,13.377672 l 7.84314,12.906234 14.07787,0.601867 c 17.71306,0.757283 29.86214,2.799246 43.98186,7.392279 14.05723,4.572701 21.35849,7.847003 29.84393,13.383723 3.71137,2.42165 9.55819,6.203 12.99294,8.403 7.1456,4.57684 34.12666,30.82734 38.40372,37.36386 C 675.70301,170.76418 683,183.81471 683,186.69215 c 0,0.68672 1.125,3.70808 2.5,6.71414 1.375,3.00605 2.5,6.19174 2.5,7.07929 0,0.88756 0.65205,2.87467 1.449,4.4158 1.41936,2.74473 3.89444,15.17812 5.59353,28.09862 1.21161,9.21357 1.20688,336.64358 -0.005,340.8689 -0.52932,1.84563 -1.43897,6.79266 -2.02145,10.9934 -1.36429,9.8391 -9.15834,32.84241 -13.86057,40.90803 -2.01057,3.44868 -4.92507,8.62368 -6.47666,11.5 -1.55159,2.87632 -3.84169,6.35467 -5.08911,7.72967 -1.24743,1.375 -3.32333,4.075 -4.61313,6 -3.3699,5.0295 -21.36595,23.29168 -28.83795,29.26441 -9.8915,7.90676 -12.03328,9.32702 -21.29057,14.11821 -4.75851,2.4628 -9.48351,4.94144 -10.5,5.50807 -2.99277,1.66829 -15.49001,6.84657 -20.35373,8.43363 -7.22786,2.3585 -27.8605,6.53856 -35.97505,7.28834 -6.30319,0.58242 -8.50675,1.32019 -14,4.68731 -14.0044,8.58409 -34.92077,18.86093 -61.62754,30.27944 l -3.10816,1.3289 -8.36034,-17.95416 z m 36.34483,-32.0489 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -5.92725,-12.8295 -14.17123,-26.35274 -24.42623,-40.06824 -11.83795,-15.8326 -42.17438,-46.20973 -62.28361,-62.36716 -19.54832,-15.70675 -25.58789,-21.27881 -32.56611,-30.04525 -17.87883,-22.46043 -16.87048,-37.75561 3.88279,-58.89615 12.65751,-12.8937 33.90357,-28.35334 58.90401,-42.86133 5.60441,-3.25229 10.03889,-6.16398 9.85439,-6.47042 -15.96236,-26.51335 -67.98703,-111.81777 -68.5716,-112.43628 -1.68142,-1.77907 -26.75724,14.51833 -46.14888,29.9933 C 356.21855,212.11131 330.71313,307.64836 383.71156,388 c 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.47271,13.17325 -24.95984,28.74616 -50.48982,42.53087 -5.5,2.96968 -11.4625,5.9905 -13.25,6.71293 -1.7875,0.72243 -3.25,1.78763 -3.25,2.36712 0,0.57948 9.74448,21.78739 21.6544,47.12868 11.90992,25.34129 23.59518,50.23757 25.96725,55.32507 2.37206,5.0875 4.56076,9.25 4.86377,9.25 0.303,0 5.15524,-2.29264 10.78275,-5.09475 z M 239.48124,690.86641 c 16.84159,-2.20186 34.47331,-8.10012 48.01876,-16.06351 34.37565,-20.20949 60.29807,-57.1792 70.3304,-100.3029 4.86854,-20.92727 5.34056,-28.43161 5.88256,-93.52334 l 0.51228,-61.52334 -8.16393,-12.47666 c -45.01324,-68.79221 -43.68453,-149.83699 3.6227,-220.96598 5.12042,-7.69884 5.96418,-13.60834 2.06599,-14.46981 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 -0.0349,189.32945 c -0.0375,203.31681 0.1207,196.71035 -5.06087,211.38779 -1.21624,3.44515 -4.28761,9.30928 -6.82527,13.0314 C 228.99133,580.51881 224.48975,583 214.37751,583 c -6.65618,0 -7.60571,-0.26147 -10.64706,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40328,30.77857 68.48587,43.24391 116.0754,37.02209 z"
+       id="path3730"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f2dea0"
+       d="m 458.94735,733.94594 -8.32328,-17.96782 -85.56204,0.29229 -85.56203,0.29229 -9.5,3.10528 c -16.87843,5.51708 -26.78403,6.8036 -52.5,6.8186 -20.02377,0.0117 -24.45646,-0.28177 -34.2554,-2.26781 C 151.40027,717.76459 127.4757,705.2407 104.72899,683.11789 87.095017,665.96758 77.394042,652.45615 66.950249,630.5 55.135524,605.66172 48.323496,578.62226 45.032412,543.5 44.465505,537.45 44.001295,515.7795 44.000836,495.34332 L 44,458.18665 l 9.75,-0.65082 c 5.3625,-0.35795 10.425,-0.74352 11.25,-0.85681 1.319628,-0.18121 1.566142,-13.85254 2.050042,-113.6925 0.5975,-123.27824 0.417343,-119.31017 6.313041,-139.04905 3.499886,-11.71767 9.903312,-27.05692 13.425048,-32.15936 1.624024,-2.35296 4.248569,-6.35414 5.83232,-8.89151 C 99.649877,151.62456 102.002,148.76463 114.38206,136.42681 126.81822,124.03307 142.80648,111 145.57428,111 c 0.69975,0 2.56437,-1.08723 4.14361,-2.41607 1.57924,-1.32884 8.47626,-4.74158 15.32673,-7.58386 15.42621,-6.400401 15.57842,-6.450242 31.45538,-10.300519 l 13,-3.152592 125.88723,-0.303101 c 120.90413,-0.291104 125.99073,-0.376802 128.502,-2.164981 5.28076,-3.760237 44.22557,-25.125962 44.9654,-24.668719 0.42023,0.259712 4.2904,6.285032 8.6004,13.389599 l 7.83635,12.917394 14.10431,0.602857 c 18.04047,0.7711 30.07751,2.832699 44.54099,7.628589 14.2673,4.73084 20.56653,7.573803 29.56332,13.342483 3.85,2.46859 9.69682,6.22548 12.99294,8.34864 6.97255,4.49129 33.96815,30.83059 38.15165,37.22414 12.10461,18.4992 16.59386,26.59424 18.33576,33.06318 0.64817,2.40712 2.04275,5.9891 3.09907,7.95996 1.05632,1.97086 1.92058,4.39989 1.92058,5.39785 0,0.99796 0.65205,3.0754 1.449,4.61653 1.41936,2.74473 3.89444,15.17812 5.59353,28.09862 1.21161,9.21357 1.20688,336.64358 -0.005,340.8689 -0.52932,1.84563 -1.43687,6.76697 -2.01677,10.93631 -1.87868,13.50723 -11.10112,37.85637 -18.42748,48.65237 -1.42634,2.10183 -2.59335,4.35272 -2.59335,5.00197 0,0.64925 -1.48729,2.94895 -3.30508,5.11045 -1.81779,2.1615 -4.37569,5.505 -5.68421,7.43 -3.46392,5.09586 -21.4745,23.35125 -28.87198,29.26441 -9.8915,7.90676 -12.03328,9.32702 -21.29057,14.11821 -4.75851,2.4628 -9.48351,4.94512 -10.5,5.51626 -2.61218,1.46771 -16.08044,7.00818 -20.84816,8.57635 -6.73384,2.21485 -27.57133,6.40661 -35.48062,7.13743 -6.29632,0.58178 -8.51163,1.32226 -13.99302,4.67724 -14.14252,8.65617 -34.12371,18.47375 -61.64104,30.28675 l -3.11469,1.33711 -8.32328,-17.96782 z m 36.32082,-32.04069 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -5.92725,-12.8295 -14.17123,-26.35274 -24.42623,-40.06824 -11.83795,-15.8326 -42.17438,-46.20973 -62.28361,-62.36716 -19.54832,-15.70675 -25.58789,-21.27881 -32.56611,-30.04525 -17.87883,-22.46043 -16.87048,-37.75561 3.88279,-58.89615 12.65751,-12.8937 33.90357,-28.35334 58.90401,-42.86133 5.60441,-3.25229 10.03889,-6.16398 9.85439,-6.47042 -15.96236,-26.51335 -67.98703,-111.81777 -68.5716,-112.43628 -1.68142,-1.77907 -26.75724,14.51833 -46.14888,29.9933 C 364.57877,205.43967 335.3483,291.05178 371.9926,367.5 c 13.88462,28.96641 35.14921,53.43438 72.20562,83.08293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.47271,13.17325 -24.95984,28.74616 -50.48982,42.53087 -5.5,2.96968 -11.4625,5.9905 -13.25,6.71293 -1.7875,0.72243 -3.25,1.78763 -3.25,2.36712 0,0.57948 9.74448,21.78739 21.6544,47.12868 11.90992,25.34129 23.59518,50.23757 25.96725,55.32507 2.37206,5.0875 4.56076,9.25 4.86377,9.25 0.303,0 5.15524,-2.29264 10.78275,-5.09475 z M 239.48124,690.86641 c 16.84159,-2.20186 34.47331,-8.10012 48.01876,-16.06351 34.37565,-20.20949 60.29807,-57.1792 70.3304,-100.3029 4.86973,-20.93236 5.34051,-28.42403 5.88314,-93.61999 l 0.51288,-61.62 -5.96084,-8.88 C 340.8081,384.37316 330.06776,357.95309 325.38608,329.5 c -2.60205,-15.81406 -2.39265,-44.83637 0.43652,-60.5 5.00432,-27.70634 15.11376,-53.07648 31.64136,-79.40554 C 362.34895,181.8125 364,178.27997 364,175.6102 c 0,-2.8904 -0.42939,-3.66699 -2.25,-4.06933 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.7375,-6.30003 -56.25,-6.60128 l -2.75,-0.54771 -0.0349,189.32945 c -0.0375,203.31681 0.1207,196.71035 -5.06087,211.38779 -1.21624,3.44515 -4.28761,9.30928 -6.82527,13.0314 C 228.99133,580.51881 224.48975,583 214.37751,583 c -6.65618,0 -7.60571,-0.26147 -10.64706,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40328,30.77857 68.48587,43.24391 116.0754,37.02209 z"
+       id="path3728"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#cbcbcb"
+       d="m 458.94735,733.94594 -8.32328,-17.96782 -85.56204,0.29229 -85.56203,0.29229 -9.5,3.10528 c -16.87843,5.51708 -26.78403,6.8036 -52.5,6.8186 -20.02377,0.0117 -24.45646,-0.28177 -34.2554,-2.26781 C 151.40027,717.76459 127.4757,705.2407 104.72899,683.11789 87.095017,665.96758 77.394042,652.45615 66.950249,630.5 55.135524,605.66172 48.323496,578.62226 45.032412,543.5 44.465505,537.45 44.001295,515.7795 44.000836,495.34332 L 44,458.18665 l 9.75,-0.65082 c 5.3625,-0.35795 10.425,-0.74352 11.25,-0.85681 1.319628,-0.18121 1.566142,-13.85254 2.050042,-113.6925 0.5975,-123.27824 0.417343,-119.31017 6.313041,-139.04905 3.499886,-11.71767 9.903312,-27.05692 13.425048,-32.15936 1.624024,-2.35296 4.248569,-6.35414 5.83232,-8.89151 C 99.649877,151.62456 102.002,148.76463 114.38206,136.42681 126.81822,124.03307 142.80648,111 145.57428,111 c 0.69975,0 2.56437,-1.08723 4.14361,-2.41607 1.57924,-1.32884 8.47626,-4.74158 15.32673,-7.58386 15.42621,-6.400401 15.57842,-6.450242 31.45538,-10.300519 l 13,-3.152592 125.88723,-0.303101 c 120.90413,-0.291104 125.99073,-0.376802 128.502,-2.164981 5.28076,-3.760237 44.22557,-25.125962 44.9654,-24.668719 0.42023,0.259712 4.2904,6.285032 8.6004,13.389599 l 7.83635,12.917394 14.10431,0.602857 c 18.04047,0.7711 30.07751,2.832699 44.54099,7.628589 14.2673,4.73084 20.56653,7.573803 29.56332,13.342483 3.85,2.46859 9.69682,6.22548 12.99294,8.34864 6.97255,4.49129 33.96815,30.83059 38.15165,37.22414 12.10461,18.4992 16.59386,26.59424 18.33576,33.06318 0.64817,2.40712 2.04275,5.9891 3.09907,7.95996 1.05632,1.97086 1.92058,4.39989 1.92058,5.39785 0,0.99796 0.65205,3.0754 1.449,4.61653 1.41936,2.74473 3.89444,15.17812 5.59353,28.09862 1.21161,9.21357 1.20688,336.64358 -0.005,340.8689 -0.52932,1.84563 -1.43687,6.76697 -2.01677,10.93631 -1.87868,13.50723 -11.10112,37.85637 -18.42748,48.65237 -1.42634,2.10183 -2.59335,4.35272 -2.59335,5.00197 0,0.64925 -1.48729,2.94895 -3.30508,5.11045 -1.81779,2.1615 -4.37569,5.505 -5.68421,7.43 -3.46392,5.09586 -21.4745,23.35125 -28.87198,29.26441 -9.8915,7.90676 -12.03328,9.32702 -21.29057,14.11821 -4.75851,2.4628 -9.48351,4.94512 -10.5,5.51626 -2.61218,1.46771 -16.08044,7.00818 -20.84816,8.57635 -6.73384,2.21485 -27.57133,6.40661 -35.48062,7.13743 -6.29632,0.58178 -8.51163,1.32226 -13.99302,4.67724 -14.14252,8.65617 -34.12371,18.47375 -61.64104,30.28675 l -3.11469,1.33711 -8.32328,-17.96782 z m 36.32082,-32.04069 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -5.92725,-12.8295 -14.17123,-26.35274 -24.42623,-40.06824 -11.83795,-15.8326 -42.17438,-46.20973 -62.28361,-62.36716 -19.54832,-15.70675 -25.58789,-21.27881 -32.56611,-30.04525 -17.87883,-22.46043 -16.87048,-37.75561 3.88279,-58.89615 12.65751,-12.8937 33.90357,-28.35334 58.90401,-42.86133 5.60441,-3.25229 10.04248,-6.16398 9.86238,-6.47042 -5.37403,-9.14395 -67.99782,-111.82321 -68.56874,-112.42671 -1.67746,-1.77323 -28.95758,15.99487 -47.6903,31.06167 -12.8978,10.37375 -33.89609,30.80462 -43.97072,42.78251 -50.45669,59.98882 -62.31837,126.54884 -33.32986,187.02537 13.88462,28.96641 35.14921,53.43438 72.20562,83.08293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.60894 -12.25907,7.11765 -0.002,0.50871 9.74018,21.65871 21.6501,47 11.90992,25.34129 23.59518,50.23757 25.96725,55.32507 2.37206,5.0875 4.56076,9.25 4.86377,9.25 0.303,0 5.15524,-2.29264 10.78275,-5.09475 z M 239.5,690.90262 C 296.73343,683.69659 343.0194,638.1647 357.8304,574.5 c 4.86973,-20.93236 5.34051,-28.42403 5.88314,-93.61999 l 0.51288,-61.62 -5.96084,-8.88 C 340.8081,384.37316 330.06776,357.95309 325.38608,329.5 c -2.60205,-15.81406 -2.39265,-44.83637 0.43652,-60.5 5.00432,-27.70634 15.11376,-53.07648 31.64136,-79.40554 C 362.34895,181.8125 364,178.27997 364,175.6102 c 0,-2.8904 -0.42939,-3.66699 -2.25,-4.06933 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.72968,-6.29832 -56.23262,-6.59746 l -2.73262,-0.5439 -0.26738,192.82564 L 246.5,543.5 l -2.18456,7.65411 c -4.11698,14.42477 -11.59132,26.34875 -18.6617,29.77147 -3.11143,1.50621 -6.2435,2.07442 -11.43467,2.07442 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40877,30.78432 68.02395,43.11063 116.09416,37.0583 z"
+       id="path3726"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#eed69c"
+       d="m 458.94929,733.89097 -8.33183,-17.91285 -85.55873,0.27969 -85.55873,0.2797 -10,3.1985 c -17.38647,5.56107 -26.29682,6.7149 -52,6.73364 -20.04212,0.0146 -24.45676,-0.2775 -34.3275,-2.27146 -34.45,-6.95917 -59.15102,-20.75024 -84.446636,-47.14826 C 70.449938,647.54172 53.514036,608.7885 46.408283,557.33534 45.18561,548.4819 44.652333,534.51624 44.291674,501.90479 l -0.482131,-43.59522 7.746106,-0.65478 C 55.816008,457.29465 61.019287,457 63.118492,457 l 3.816736,0 0.330316,-113.75 c 0.356729,-122.84615 0.22843,-119.76179 5.753383,-138.31355 3.163024,-10.62084 10.596667,-28.7335 13.258742,-32.30597 1.282995,-1.72177 3.596156,-5.32225 5.140359,-8.00109 10.028272,-17.39672 37.859582,-45.12853 53.058742,-52.86904 2.21278,-1.12691 5.37323,-3.04256 7.02323,-4.257 3.04431,-2.24071 22.27685,-10.479912 30.5,-13.066189 2.475,-0.778416 9.675,-2.646888 16,-4.15216 l 11.5,-2.736858 125.88723,-0.303693 c 122.95786,-0.296627 125.95096,-0.349076 128.6261,-2.253939 5.21536,-3.713668 44.15309,-25.005693 44.89291,-24.548457 0.40865,0.252556 4.2408,6.26696 8.51591,13.365342 l 7.77292,12.90615 14.15247,0.60466 c 18.08734,0.772776 30.11541,2.831099 44.58914,7.630391 14.85379,4.925313 20.96944,7.718723 29.39158,13.425013 3.75554,2.54452 7.04273,4.62639 7.30487,4.62639 3.89055,0 35.7074,29.28632 41.81749,38.49157 1.9788,2.98118 4.06467,5.70886 4.63528,6.06152 0.57061,0.35265 1.45877,1.60998 1.97369,2.79405 0.51492,1.18407 2.77407,5.07124 5.02033,8.63815 4.6494,7.38293 8.91571,16.03631 8.92922,18.1112 0.005,0.77193 1.11596,3.65351 2.46873,6.40351 1.35277,2.75 2.47366,5.80985 2.49086,6.79966 0.0172,0.98981 0.68332,3.06059 1.48027,4.60172 1.41936,2.74473 3.89444,15.17812 5.59353,28.09862 1.21161,9.21357 1.20688,336.64358 -0.005,340.8689 -0.52932,1.84563 -1.43687,6.76697 -2.01677,10.93631 -1.88574,13.55799 -8.5201,30.85686 -19.63632,51.20105 -6.50861,11.91164 -23.64356,31.16895 -38.5983,43.37914 -12.65973,10.33636 -13.48411,10.90165 -22.49742,15.42677 -4.51616,2.26734 -9.01616,4.57304 -10,5.12378 -2.60749,1.45966 -16.13325,7.00952 -20.78879,8.53001 -6.69059,2.18514 -27.55292,6.39145 -35.30557,7.11839 -6.63216,0.62188 -8.41937,1.32313 -19.38871,7.60762 -17.63021,10.10059 -25.27005,13.82781 -51.91516,25.32766 l -7.60944,3.28419 -8.33183,-17.91285 z m 36.31888,-31.98572 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -5.92725,-12.8295 -14.17123,-26.35274 -24.42623,-40.06824 -11.83795,-15.8326 -42.17438,-46.20973 -62.28361,-62.36716 -19.54832,-15.70675 -25.58789,-21.27881 -32.56611,-30.04525 -17.87883,-22.46043 -16.87048,-37.75561 3.88279,-58.89615 12.65751,-12.8937 33.90357,-28.35334 58.90401,-42.86133 5.60441,-3.25229 10.04248,-6.16398 9.86238,-6.47042 -5.37403,-9.14395 -67.99782,-111.82321 -68.56874,-112.42671 -0.97049,-1.02591 -16.2627,7.91922 -29.23485,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -82.76592,79.73705 -93.31977,172.64683 -28.40062,250.02207 10.51748,12.53547 25.66124,26.69214 45.72813,42.74751 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.60894 -12.25907,7.11765 -0.002,0.50871 9.74018,21.65871 21.6501,47 11.90992,25.34129 23.59518,50.23757 25.96725,55.32507 2.37206,5.0875 4.56076,9.25 4.86377,9.25 0.303,0 5.15524,-2.29264 10.78275,-5.09475 z M 239.5,690.90262 C 296.73343,683.69659 343.0194,638.1647 357.8304,574.5 c 4.8701,-20.93398 5.34049,-28.42164 5.88333,-93.65059 l 0.51306,-61.65059 -7.5557,-11.34941 C 339.72183,382.38993 328.87749,354.32937 324.84618,325.5 c -1.82453,-13.04789 -1.59539,-39.74854 0.45484,-53 4.29805,-27.77999 15.16563,-55.8282 32.05762,-82.73777 C 362.33308,181.83776 364,178.28574 364,175.6102 c 0,-2.8904 -0.42939,-3.66699 -2.25,-4.06933 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.72968,-6.29832 -56.23262,-6.59746 l -2.73262,-0.5439 -0.26738,192.82564 L 246.5,543.5 l -2.18456,7.65411 c -4.11698,14.42477 -11.59132,26.34875 -18.6617,29.77147 -3.11143,1.50621 -6.2435,2.07442 -11.43467,2.07442 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40877,30.78432 68.02395,43.11063 116.09416,37.0583 z"
+       id="path3724"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f2d889"
+       d="m 458.94929,733.89097 -8.33183,-17.91285 -85.55873,0.27969 -85.55873,0.2797 -10,3.1985 c -17.38647,5.56107 -26.29682,6.7149 -52,6.73364 -20.04212,0.0146 -24.45676,-0.2775 -34.3275,-2.27146 -34.45,-6.95917 -59.15102,-20.75024 -84.446636,-47.14826 C 70.449938,647.54172 53.514036,608.7885 46.408283,557.33534 45.18561,548.4819 44.652333,534.51624 44.291674,501.90479 l -0.482131,-43.59522 7.746106,-0.65478 C 55.816008,457.29465 61.019287,457 63.118492,457 l 3.816736,0 0.330316,-113.75 c 0.356729,-122.84615 0.22843,-119.76179 5.753383,-138.31355 3.163024,-10.62084 10.596667,-28.7335 13.258742,-32.30597 1.282995,-1.72177 3.596156,-5.32225 5.140359,-8.00109 10.028272,-17.39672 37.859582,-45.12853 53.058742,-52.86904 2.21278,-1.12691 5.37323,-3.04256 7.02323,-4.257 3.04431,-2.24071 22.27685,-10.479912 30.5,-13.066189 2.475,-0.778416 9.675,-2.646888 16,-4.15216 l 11.5,-2.736858 125.88723,-0.303693 c 122.95786,-0.296627 125.95096,-0.349076 128.6261,-2.253939 5.21536,-3.713668 44.15309,-25.005693 44.89291,-24.548457 0.40865,0.252556 4.2408,6.26696 8.51591,13.365342 l 7.77292,12.90615 14.15247,0.60466 c 18.08734,0.772776 30.11541,2.831099 44.58914,7.630391 14.85379,4.925313 20.96944,7.718723 29.39158,13.425013 3.75554,2.54452 7.04273,4.62639 7.30487,4.62639 3.89055,0 35.7074,29.28632 41.81749,38.49157 1.9788,2.98118 4.06467,5.70886 4.63528,6.06152 0.57061,0.35265 1.45877,1.60998 1.97369,2.79405 0.51492,1.18407 2.77407,5.07124 5.02033,8.63815 4.6494,7.38293 8.91571,16.03631 8.92922,18.1112 0.005,0.77193 1.11596,3.65351 2.46873,6.40351 1.35277,2.75 2.47366,5.80985 2.49086,6.79966 0.0172,0.98981 0.68332,3.06059 1.48027,4.60172 1.41936,2.74473 3.89444,15.17812 5.59353,28.09862 1.21161,9.21357 1.20688,336.64358 -0.005,340.8689 -0.52932,1.84563 -1.43687,6.76697 -2.01677,10.93631 -1.88574,13.55799 -8.5201,30.85686 -19.63632,51.20105 -6.50861,11.91164 -23.64356,31.16895 -38.5983,43.37914 -12.65973,10.33636 -13.48411,10.90165 -22.49742,15.42677 -4.51616,2.26734 -9.01616,4.57304 -10,5.12378 -2.60749,1.45966 -16.13325,7.00952 -20.78879,8.53001 -6.69059,2.18514 -27.55292,6.39145 -35.30557,7.11839 -6.63216,0.62188 -8.41937,1.32313 -19.38871,7.60762 -17.63021,10.10059 -25.27005,13.82781 -51.91516,25.32766 l -7.60944,3.28419 -8.33183,-17.91285 z m 36.31888,-31.98572 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.8546,-34.31721 -44.86038,-68.49372 -87.20984,-102.75632 -25.4899,-20.62248 -34.47629,-30.16896 -41.13923,-43.7033 -2.88015,-5.85043 -3.32948,-7.77989 -3.32667,-14.28506 0.003,-6.62211 0.40126,-8.25546 3.33325,-13.66582 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04248,-6.15144 9.86238,-6.45788 -5.37403,-9.14395 -67.99782,-111.82321 -68.56874,-112.42671 -0.97049,-1.02591 -16.2627,7.91922 -29.23485,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -82.76592,79.73705 -93.31977,172.64683 -28.40062,250.02207 10.51748,12.53547 25.66124,26.69214 45.72813,42.74751 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.60894 -12.25907,7.11765 -0.002,0.50871 9.74018,21.65871 21.6501,47 11.90992,25.34129 23.59518,50.23757 25.96725,55.32507 2.37206,5.0875 4.56076,9.25 4.86377,9.25 0.303,0 5.15524,-2.29264 10.78275,-5.09475 z M 239.5,690.90262 C 296.73343,683.69659 343.0194,638.1647 357.8304,574.5 c 4.8701,-20.93398 5.34049,-28.42164 5.88333,-93.65059 l 0.51306,-61.65059 -7.5557,-11.34941 C 339.72183,382.38993 328.87749,354.32937 324.84618,325.5 c -1.82453,-13.04789 -1.59539,-39.74854 0.45484,-53 4.29805,-27.77999 15.16563,-55.8282 32.05762,-82.73777 C 362.33308,181.83776 364,178.28574 364,175.6102 c 0,-2.8904 -0.42939,-3.66699 -2.25,-4.06933 -1.2375,-0.27347 -26.325,-3.22133 -55.75,-6.55079 -29.425,-3.32946 -54.72968,-6.29832 -56.23262,-6.59746 l -2.73262,-0.5439 -0.26738,192.82564 L 246.5,543.5 l -2.18456,7.65411 c -4.11698,14.42477 -11.59132,26.34875 -18.6617,29.77147 -3.11143,1.50621 -6.2435,2.07442 -11.43467,2.07442 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40877,30.78432 68.02395,43.11063 116.09416,37.0583 z"
+       id="path3722"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#eaca99"
+       d="m 458.94929,733.89097 -8.33183,-17.91285 -85.55873,0.27969 -85.55873,0.2797 -10,3.1985 c -17.38647,5.56107 -26.29682,6.7149 -52,6.73364 -20.04212,0.0146 -24.45676,-0.2775 -34.3275,-2.27146 -34.45,-6.95917 -59.15102,-20.75024 -84.446636,-47.14826 C 70.449938,647.54172 53.514036,608.7885 46.408283,557.33534 45.18561,548.4819 44.652333,534.51624 44.291674,501.90479 l -0.482131,-43.59522 7.746106,-0.65478 C 55.816008,457.29465 61.019287,457 63.118492,457 l 3.816736,0 0.330316,-113.75 c 0.356729,-122.84615 0.22843,-119.76179 5.753383,-138.31355 3.163024,-10.62084 10.596667,-28.7335 13.258742,-32.30597 1.282995,-1.72177 3.596156,-5.32225 5.140359,-8.00109 10.028272,-17.39672 37.859582,-45.12853 53.058742,-52.86904 2.21278,-1.12691 5.37323,-3.04256 7.02323,-4.257 3.04431,-2.24071 22.27685,-10.479912 30.5,-13.066189 2.475,-0.778416 9.675,-2.646888 16,-4.15216 l 11.5,-2.736858 125.88723,-0.303693 c 122.95786,-0.296627 125.95096,-0.349076 128.6261,-2.253939 5.21536,-3.713668 44.15309,-25.005693 44.89291,-24.548457 0.40865,0.252556 4.2408,6.26696 8.51591,13.365342 l 7.77292,12.90615 14.15247,0.60466 c 18.08734,0.772776 30.11541,2.831099 44.58914,7.630391 14.85379,4.925313 20.96944,7.718723 29.39158,13.425013 3.75554,2.54452 7.04273,4.62639 7.30487,4.62639 3.89055,0 35.7074,29.28632 41.81749,38.49157 1.9788,2.98118 4.06467,5.70886 4.63528,6.06152 0.57061,0.35265 1.45877,1.60998 1.97369,2.79405 0.51492,1.18407 2.77407,5.07124 5.02033,8.63815 4.6494,7.38293 8.91571,16.03631 8.92922,18.1112 0.005,0.77193 1.11596,3.65351 2.46873,6.40351 1.35277,2.75 2.47366,5.80985 2.49086,6.79966 0.0172,0.98981 0.68332,3.06059 1.48027,4.60172 1.41936,2.74473 3.89444,15.17812 5.59353,28.09862 1.21161,9.21357 1.20688,336.64358 -0.005,340.8689 -0.52932,1.84563 -1.43687,6.76697 -2.01677,10.93631 -1.88574,13.55799 -8.5201,30.85686 -19.63632,51.20105 -6.50861,11.91164 -23.64356,31.16895 -38.5983,43.37914 -12.65973,10.33636 -13.48411,10.90165 -22.49742,15.42677 -4.51616,2.26734 -9.01616,4.57304 -10,5.12378 -2.60749,1.45966 -16.13325,7.00952 -20.78879,8.53001 -6.69059,2.18514 -27.55292,6.39145 -35.30557,7.11839 -6.63216,0.62188 -8.41937,1.32313 -19.38871,7.60762 -17.63021,10.10059 -25.27005,13.82781 -51.91516,25.32766 l -7.60944,3.28419 -8.33183,-17.91285 z m 36.31888,-31.98572 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.06588,-7.35534 -16.71495,-18.45068 -20.71235,-26.57055 -2.88015,-5.85043 -3.32948,-7.77989 -3.32667,-14.28506 0.003,-6.62211 0.40126,-8.25546 3.33325,-13.66582 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04248,-6.15144 9.86238,-6.45788 -5.37403,-9.14395 -67.99782,-111.82321 -68.56874,-112.42671 -0.97049,-1.02591 -16.2627,7.91922 -29.23485,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -82.76592,79.73705 -93.31977,172.64683 -28.40062,250.02207 10.51748,12.53547 25.66124,26.69214 45.72813,42.74751 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.60894 -12.25907,7.11765 -0.002,0.50871 9.74018,21.65871 21.6501,47 11.90992,25.34129 23.59518,50.23757 25.96725,55.32507 2.37206,5.0875 4.56076,9.25 4.86377,9.25 0.303,0 5.15524,-2.29264 10.78275,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.8701,-20.93398 5.34049,-28.42164 5.88333,-93.65059 l 0.51306,-61.65059 -7.5557,-11.34941 C 339.72183,382.38993 328.87749,354.32937 324.84618,325.5 c -1.82453,-13.04789 -1.59539,-39.74854 0.45484,-53 4.30384,-27.81741 15.16319,-55.82433 32.11771,-82.8335 5.64603,-8.99433 6.65262,-11.26135 6.39136,-14.39458 l -0.31009,-3.71893 -54,-6.17876 c -29.7,-3.39832 -55.90469,-6.43806 -58.23265,-6.75499 l -4.23264,-0.57622 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.11698,14.42477 -11.59132,26.34875 -18.6617,29.77147 -3.11143,1.50621 -6.2435,2.07442 -11.43467,2.07442 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z M 616,398 c 0,-0.55 -0.47656,-1 -1.05902,-1 -0.58246,0 -0.7809,0.45 -0.44098,1 0.33992,0.55 0.81648,1 1.05902,1 0.24254,0 0.44098,-0.45 0.44098,-1 z"
+       id="path3720"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#c4c4c4"
+       d="m 458.94929,733.89097 -8.33183,-17.91285 -85.55873,0.27969 -85.55873,0.2797 -10,3.1985 c -17.38647,5.56107 -26.29682,6.7149 -52,6.73364 -20.04212,0.0146 -24.45676,-0.2775 -34.3275,-2.27146 -34.45,-6.95917 -59.15102,-20.75024 -84.446636,-47.14826 C 70.449938,647.54172 53.514036,608.7885 46.408283,557.33534 45.18561,548.4819 44.652333,534.51624 44.291674,501.90479 l -0.482131,-43.59522 7.746106,-0.65478 C 55.816008,457.29465 61.019287,457 63.118492,457 l 3.816736,0 0.330316,-113.75 c 0.356729,-122.84615 0.22843,-119.76179 5.753383,-138.31355 3.163024,-10.62084 10.596667,-28.7335 13.258742,-32.30597 1.282995,-1.72177 3.596156,-5.32225 5.140359,-8.00109 10.028272,-17.39672 37.859582,-45.12853 53.058742,-52.86904 2.21278,-1.12691 5.37323,-3.04256 7.02323,-4.257 3.04431,-2.24071 22.27685,-10.479912 30.5,-13.066189 2.475,-0.778416 9.675,-2.646888 16,-4.15216 l 11.5,-2.736858 125.88723,-0.303693 c 122.95786,-0.296627 125.95096,-0.349076 128.6261,-2.253939 5.21536,-3.713668 44.15309,-25.005693 44.89291,-24.548457 0.40865,0.252556 4.2408,6.26696 8.51591,13.365342 l 7.77292,12.90615 14.15247,0.60466 c 18.08734,0.772776 30.11541,2.831099 44.58914,7.630391 14.85379,4.925313 20.96944,7.718723 29.39158,13.425013 3.75554,2.54452 7.04273,4.62639 7.30487,4.62639 3.89055,0 35.7074,29.28632 41.81749,38.49157 1.9788,2.98118 4.06467,5.70886 4.63528,6.06152 0.57061,0.35265 1.45877,1.60998 1.97369,2.79405 0.51492,1.18407 2.77407,5.07124 5.02033,8.63815 4.6494,7.38293 8.91571,16.03631 8.92922,18.1112 0.005,0.77193 1.11596,3.65351 2.46873,6.40351 1.35277,2.75 2.47366,5.80985 2.49086,6.79966 0.0172,0.98981 0.68332,3.06059 1.48027,4.60172 1.41936,2.74473 3.89444,15.17812 5.59353,28.09862 1.21161,9.21357 1.20688,336.64358 -0.005,340.8689 -0.52932,1.84563 -1.43687,6.76697 -2.01677,10.93631 -1.88574,13.55799 -8.5201,30.85686 -19.63632,51.20105 -6.50861,11.91164 -23.64356,31.16895 -38.5983,43.37914 -12.65973,10.33636 -13.48411,10.90165 -22.49742,15.42677 -4.51616,2.26734 -9.01616,4.57304 -10,5.12378 -2.60749,1.45966 -16.13325,7.00952 -20.78879,8.53001 -6.69059,2.18514 -27.55292,6.39145 -35.30557,7.11839 -6.63216,0.62188 -8.41937,1.32313 -19.38871,7.60762 -17.63021,10.10059 -25.27005,13.82781 -51.91516,25.32766 l -7.60944,3.28419 -8.33183,-17.91285 z m 36.31888,-31.98572 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04248,-6.15144 9.86238,-6.45788 -5.37403,-9.14395 -67.99782,-111.82321 -68.56874,-112.42671 -0.97049,-1.02591 -16.2627,7.91922 -29.23485,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -82.76592,79.73705 -93.31977,172.64683 -28.40062,250.02207 10.51748,12.53547 25.66124,26.69214 45.72813,42.74751 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.61868 -12.25907,7.13931 -0.002,0.52062 9.52397,21.22062 21.16963,46 11.64566,24.77937 23.33696,49.66591 25.98066,55.30341 2.6437,5.6375 5.04861,10.25 5.34424,10.25 0.29563,0 5.14183,-2.29264 10.76934,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.8701,-20.93398 5.34049,-28.42164 5.88333,-93.65059 l 0.51306,-61.65059 -7.5557,-11.34941 C 339.72183,382.38993 328.87749,354.32937 324.84618,325.5 c -1.82453,-13.04789 -1.59539,-39.74854 0.45484,-53 4.30384,-27.81741 15.16319,-55.82433 32.11771,-82.8335 5.64603,-8.99433 6.65262,-11.26135 6.39136,-14.39458 l -0.31009,-3.71893 -54,-6.17876 c -29.7,-3.39832 -55.90469,-6.43806 -58.23265,-6.75499 l -4.23264,-0.57622 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.11698,14.42477 -11.59132,26.34875 -18.6617,29.77147 -3.11143,1.50621 -6.2435,2.07442 -11.43467,2.07442 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z M 616,398 c 0,-0.55 -0.47656,-1 -1.05902,-1 -0.58246,0 -0.7809,0.45 -0.44098,1 0.33992,0.55 0.81648,1 1.05902,1 0.24254,0 0.44098,-0.45 0.44098,-1 z"
+       id="path3718"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fdd766"
+       d="m 458.9785,733.89399 -8.29922,-17.9159 -85.58964,0.29842 -85.58964,0.29841 -10.41929,3.21115 c -18.32398,5.64731 -26.06818,6.64968 -51.58071,6.67633 -19.91071,0.0208 -24.48512,-0.27637 -34.05687,-2.21244 -34.43229,-6.96459 -59.5441,-20.9298 -84.538884,-47.01388 -28.421466,-29.66009 -45.42853,-68.51076 -52.487108,-119.90074 -1.207597,-8.7919 -1.753586,-23.04562 -2.123247,-55.42999 l -0.497625,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.019287,457 63.118492,457 l 3.816736,0 0.330316,-113.75 c 0.356729,-122.84615 0.22843,-119.76179 5.753383,-138.31355 3.163024,-10.62084 10.596667,-28.7335 13.258742,-32.30597 1.282995,-1.72177 3.596156,-5.32225 5.140359,-8.00109 10.028272,-17.39672 37.859582,-45.12853 53.058742,-52.86904 2.21278,-1.12691 5.37323,-3.04256 7.02323,-4.257 3.04431,-2.24071 22.27685,-10.479912 30.5,-13.066189 2.475,-0.778416 9.675,-2.646888 16,-4.15216 l 11.5,-2.736858 125.88723,-0.303693 c 123.29962,-0.297452 125.94397,-0.3441 128.64789,-2.26946 5.30206,-3.775396 44.18116,-24.959357 44.94346,-24.48823 0.42284,0.26133 4.21336,6.268098 8.42339,13.348373 l 7.65459,12.873228 14.22172,0.607252 c 18.15477,0.77519 30.16997,2.828821 44.6584,7.632984 14.85379,4.925313 20.96944,7.718723 29.39158,13.425013 3.75554,2.54452 7.04273,4.62639 7.30487,4.62639 3.89055,0 35.7074,29.28632 41.81749,38.49157 1.9788,2.98118 4.06467,5.70886 4.63528,6.06152 0.57061,0.35265 1.45877,1.60998 1.97369,2.79405 0.51492,1.18407 2.77407,5.07124 5.02033,8.63815 4.6494,7.38293 8.91571,16.03631 8.92922,18.1112 0.005,0.77193 1.11596,3.65351 2.46873,6.40351 1.35277,2.75 2.47366,5.80985 2.49086,6.79966 0.0172,0.98981 0.70514,3.10279 1.52876,4.69549 1.40536,2.71766 3.43433,13.04587 5.50156,28.00485 1.2428,8.99329 1.27985,336.54074 0.0385,340.8689 -0.52932,1.84563 -1.43687,6.76697 -2.01677,10.93631 -1.88574,13.55799 -8.5201,30.85686 -19.63632,51.20105 -6.50861,11.91164 -23.64356,31.16895 -38.5983,43.37914 -12.65973,10.33636 -13.48411,10.90165 -22.49742,15.42677 -4.51616,2.26734 -9.01616,4.57304 -10,5.12378 -2.60749,1.45966 -16.13325,7.00952 -20.78879,8.53001 -6.69059,2.18514 -27.55292,6.39145 -35.30557,7.11839 -6.63357,0.62201 -8.41874,1.32277 -19.40724,7.61824 -18.00307,10.3142 -22.92212,12.6956 -55.39833,26.81937 l -4.11114,1.78792 -8.29922,-17.91589 z m 36.28967,-31.98874 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04248,-6.15144 9.86238,-6.45788 -5.37403,-9.14395 -67.99782,-111.82321 -68.56874,-112.42671 -1.67746,-1.77323 -28.95758,15.99487 -47.6903,31.06167 -12.8978,10.37375 -33.89609,30.80462 -43.97072,42.78251 -47.25536,56.1827 -60.87937,118.68694 -38.30039,175.71459 13.49473,34.08363 35.6201,61.14503 77.17615,94.39371 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.61868 -12.25907,7.13931 -0.002,0.52062 9.52397,21.22062 21.16963,46 11.64566,24.77937 23.33696,49.66591 25.98066,55.30341 2.6437,5.6375 5.04861,10.25 5.34424,10.25 0.29563,0 5.14183,-2.29264 10.76934,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.2651,-10.83454 C 317.2789,349.15485 312.52805,278.58082 343.90281,214.34187 c 3.71826,-7.61303 9.78919,-18.66614 13.49095,-24.56248 5.69686,-9.0742 6.68254,-11.29694 6.41836,-14.4735 l -0.31212,-3.7529 -54,-6.17876 c -29.7,-3.39832 -55.90469,-6.43806 -58.23265,-6.75499 l -4.23264,-0.57622 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.11698,14.42477 -11.59132,26.34875 -18.6617,29.77147 -3.11143,1.50621 -6.2435,2.07442 -11.43467,2.07442 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z M 616,398 c 0,-0.55 -0.47656,-1 -1.05902,-1 -0.58246,0 -0.7809,0.45 -0.44098,1 0.33992,0.55 0.81648,1 1.05902,1 0.24254,0 0.44098,-0.45 0.44098,-1 z"
+       id="path3716"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#bdbdbd"
+       d="m 458.9785,733.89399 -8.29922,-17.9159 -85.58964,0.29842 -85.58964,0.29841 -10.41929,3.21115 c -18.32398,5.64731 -26.06818,6.64968 -51.58071,6.67633 -19.91071,0.0208 -24.48512,-0.27637 -34.05687,-2.21244 -34.43229,-6.96459 -59.5441,-20.9298 -84.538884,-47.01388 -28.421466,-29.66009 -45.42853,-68.51076 -52.487108,-119.90074 -1.207597,-8.7919 -1.753586,-23.04562 -2.123247,-55.42999 l -0.497625,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.019287,457 63.118492,457 l 3.816736,0 0.330316,-113.75 c 0.356729,-122.84615 0.22843,-119.76179 5.753383,-138.31355 3.163024,-10.62084 10.596667,-28.7335 13.258742,-32.30597 1.282995,-1.72177 3.596156,-5.32225 5.140359,-8.00109 10.028272,-17.39672 37.859582,-45.12853 53.058742,-52.86904 2.21278,-1.12691 5.37323,-3.04256 7.02323,-4.257 3.04431,-2.24071 22.27685,-10.479912 30.5,-13.066189 2.475,-0.778416 9.675,-2.646888 16,-4.15216 l 11.5,-2.736858 125.88723,-0.303693 c 123.29962,-0.297452 125.94397,-0.3441 128.64789,-2.26946 5.30206,-3.775396 44.18116,-24.959357 44.94346,-24.48823 0.42284,0.26133 4.21336,6.268098 8.42339,13.348373 l 7.65459,12.873228 14.22172,0.607252 c 18.15477,0.77519 30.16997,2.828821 44.6584,7.632984 14.85379,4.925313 20.96944,7.718723 29.39158,13.425013 3.75554,2.54452 7.04273,4.62639 7.30487,4.62639 3.89055,0 35.7074,29.28632 41.81749,38.49157 1.9788,2.98118 4.06467,5.70886 4.63528,6.06152 0.57061,0.35265 1.45877,1.60998 1.97369,2.79405 0.51492,1.18407 2.77407,5.07124 5.02033,8.63815 4.6494,7.38293 8.91571,16.03631 8.92922,18.1112 0.005,0.77193 1.11596,3.65351 2.46873,6.40351 1.35277,2.75 2.47366,5.80985 2.49086,6.79966 0.0172,0.98981 0.70514,3.10279 1.52876,4.69549 1.40536,2.71766 3.43433,13.04587 5.50156,28.00485 1.2428,8.99329 1.27985,336.54074 0.0385,340.8689 -0.52932,1.84563 -1.43687,6.76697 -2.01677,10.93631 -1.88574,13.55799 -8.5201,30.85686 -19.63632,51.20105 -6.50861,11.91164 -23.64356,31.16895 -38.5983,43.37914 -12.65973,10.33636 -13.48411,10.90165 -22.49742,15.42677 -4.51616,2.26734 -9.01616,4.57304 -10,5.12378 -2.60749,1.45966 -16.13325,7.00952 -20.78879,8.53001 -6.69059,2.18514 -27.55292,6.39145 -35.30557,7.11839 -6.63357,0.62201 -8.41874,1.32277 -19.40724,7.61824 -18.00307,10.3142 -22.92212,12.6956 -55.39833,26.81937 l -4.11114,1.78792 -8.29922,-17.91589 z m 36.28967,-31.98874 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04248,-6.15144 9.86238,-6.45788 -5.37403,-9.14395 -67.99782,-111.82321 -68.56874,-112.42671 -1.67746,-1.77323 -28.95758,15.99487 -47.6903,31.06167 -12.8978,10.37375 -33.89609,30.80462 -43.97072,42.78251 -47.25536,56.1827 -60.87937,118.68694 -38.30039,175.71459 13.49473,34.08363 35.6201,61.14503 77.17615,94.39371 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.61868 -12.25907,7.13931 -0.002,0.52062 9.52397,21.22062 21.16963,46 11.64566,24.77937 23.33696,49.66591 25.98066,55.30341 2.6437,5.6375 5.04861,10.25 5.34424,10.25 0.29563,0 5.14183,-2.29264 10.76934,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.2651,-10.83454 C 317.2789,349.15485 312.52805,278.58082 343.90281,214.34187 c 3.71826,-7.61303 9.78919,-18.66614 13.49095,-24.56248 5.69686,-9.0742 6.68254,-11.29694 6.41836,-14.4735 l -0.31212,-3.7529 -54,-6.17876 c -29.7,-3.39832 -55.90469,-6.43806 -58.23265,-6.75499 l -4.23264,-0.57622 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.11698,14.42477 -11.59132,26.34875 -18.6617,29.77147 -3.11143,1.50621 -6.2435,2.07442 -11.43467,2.07442 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z M 617,398.16667 c 0,-1.30208 -1.18877,-2.16804 -2.15579,-1.57039 C 613.80999,397.23547 614.70176,399 616.05902,399 616.57656,399 617,398.625 617,398.16667 z"
+       id="path3714"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ecce73"
+       d="m 462.43499,741.25 c -2.51916,-5.3625 -6.18522,-13.2375 -8.1468,-17.5 l -3.56651,-7.75 -84.68569,0 -84.68569,0 -7.42515,2.53548 C 269.84132,719.93 260.875,722.27323 254,723.74266 c -11.49313,2.4565 -14.39292,2.67452 -36,2.70672 -26.30733,0.0392 -32.83689,-0.8331 -53,-7.08034 C 139.80995,711.56428 119.48325,698.67819 99.5,677.8454 70.419728,647.52885 54.077272,610.32194 46.420867,557 45.168185,548.27588 44.652129,534.9771 44.282934,501.90535 l -0.486668,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.03386,457 63.150878,457 L 67,457 67.032719,347.75 c 0.01863,-62.21931 0.434969,-112.04816 0.967126,-115.75 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 1.5873,-11.15642 11.792226,-39.66368 16.466914,-46 1.217305,-1.65 3.507377,-5.25 5.089048,-8 C 101.56568,146.97506 127.31847,121.57214 146,110.72677 c 19.84658,-11.521729 42.37031,-19.286075 66,-22.751418 3.025,-0.443623 60.29644,-0.844559 127.26987,-0.890969 L 461.03974,87 l 4.23013,-2.671135 c 2.32657,-1.469124 12.99009,-7.572948 23.69671,-13.564053 18.2105,-10.190054 19.55421,-10.775866 20.82473,-9.078865 0.74698,0.997729 4.53243,7.101553 8.4121,13.564053 l 7.05394,11.75 8.12133,0.01777 c 8.10499,0.01773 19.28066,1.050187 31.67194,2.925989 6.64303,1.005628 26.76608,7.338166 35.60938,11.205941 2.662,1.16428 8.665,4.61538 13.34,7.66913 4.675,3.05374 10.95556,7.15626 13.95679,9.11671 6.69452,4.37296 31.76576,28.93026 35.68622,34.95468 1.57135,2.41463 5.23958,8.03963 8.15164,12.5 C 677.334,173.8748 683,184.78755 683,186.9718 c 0,0.70296 1.06364,3.80938 2.36364,6.90315 4.75206,11.30906 6.64508,18.98604 9.6476,39.12505 0.451,3.025 0.85552,79.75 0.89893,170.5 l 0.0789,165 -2.499,13 c -3.25048,16.90929 -9.37272,35.14016 -14.95056,44.51994 -2.44648,4.11403 -5.32435,9.32638 -6.39527,11.58299 -1.07091,2.25661 -3.24875,5.63161 -4.83964,7.5 -1.59089,1.86839 -3.73341,4.73039 -4.76115,6.35999 -4.81824,7.63989 -27.27169,28.72691 -39.54349,37.13703 -6.02324,4.12784 -22.41246,12.30662 -33.5,16.71763 -10.29016,4.09378 -28.85825,8.46192 -41.93747,9.86577 -7.92123,0.85023 -9.74836,1.45155 -16.06902,5.28845 -12.17817,7.39265 -29.3158,16.10336 -46.16316,23.46382 C 476.43704,747.82103 468.67798,751 468.08798,751 c -0.58999,0 -3.13384,-4.3875 -5.65299,-9.75 z m 32.83318,-39.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04248,-6.15144 9.86238,-6.45788 -5.37403,-9.14395 -67.99782,-111.82321 -68.56874,-112.42671 -0.97049,-1.02591 -16.2627,7.91922 -29.23485,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.3412,36.93808 -60.93627,75.62241 -68.44736,117.18665 -2.36855,13.10683 -2.36587,38.14196 0.005,51.5 3.61054,20.33833 12.67251,42.3815 25.28271,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.61868 -12.25907,7.13931 -0.002,0.52062 9.52397,21.22062 21.16963,46 11.64566,24.77937 23.33696,49.66591 25.98066,55.30341 2.6437,5.6375 5.04861,10.25 5.34424,10.25 0.29563,0 5.14183,-2.29264 10.76934,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.18282,-10.7417 c -8.99093,-13.44566 -19.95403,-35.64309 -24.47169,-49.54881 -12.4146,-38.21317 -12.19372,-79.40264 0.6363,-118.65912 4.62875,-14.16272 16.94455,-39.5952 25.27757,-52.19888 4.80599,-7.26904 5.56395,-9.04951 5.30996,-12.47318 l -0.29629,-3.99375 -54,-6.17909 c -29.7,-3.39849 -55.90469,-6.43838 -58.23265,-6.75531 l -4.23264,-0.57622 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.11698,14.42477 -11.59132,26.34875 -18.6617,29.77147 -3.11143,1.50621 -6.2435,2.07442 -11.43467,2.07442 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z M 617,398.16667 c 0,-1.30208 -1.18877,-2.16804 -2.15579,-1.57039 C 613.80999,397.23547 614.70176,399 616.05902,399 616.57656,399 617,398.625 617,398.16667 z"
+       id="path3712"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fed658"
+       d="m 462.43499,741.25 c -2.51916,-5.3625 -6.18522,-13.2375 -8.1468,-17.5 l -3.56651,-7.75 -84.68569,0 -84.68569,0 -7.42515,2.53548 C 269.84132,719.93 260.875,722.27323 254,723.74266 c -11.49313,2.4565 -14.39292,2.67452 -36,2.70672 -26.30733,0.0392 -32.83689,-0.8331 -53,-7.08034 C 139.80995,711.56428 119.48325,698.67819 99.5,677.8454 70.419728,647.52885 54.077272,610.32194 46.420867,557 45.168185,548.27588 44.652129,534.9771 44.282934,501.90535 l -0.486668,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.03386,457 63.150878,457 L 67,457 67.032719,347.75 c 0.01863,-62.21931 0.434969,-112.04816 0.967126,-115.75 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 1.5873,-11.15642 11.792226,-39.66368 16.466914,-46 1.217305,-1.65 3.507377,-5.25 5.089048,-8 C 101.56568,146.97506 127.31847,121.57214 146,110.72677 c 19.84658,-11.521729 42.37031,-19.286075 66,-22.751418 3.025,-0.443623 60.29644,-0.844559 127.26987,-0.890969 L 461.03974,87 l 4.23013,-2.671135 c 2.32657,-1.469124 12.99009,-7.572948 23.69671,-13.564053 18.2105,-10.190054 19.55421,-10.775866 20.82473,-9.078865 0.74698,0.997729 4.53243,7.101553 8.4121,13.564053 l 7.05394,11.75 8.12133,0.01777 c 8.10499,0.01773 19.28066,1.050187 31.67194,2.925989 6.64303,1.005628 26.76608,7.338166 35.60938,11.205941 2.662,1.16428 8.665,4.61538 13.34,7.66913 4.675,3.05374 10.95556,7.15626 13.95679,9.11671 6.69452,4.37296 31.76576,28.93026 35.68622,34.95468 1.57135,2.41463 5.23958,8.03963 8.15164,12.5 C 677.334,173.8748 683,184.78755 683,186.9718 c 0,0.70296 1.06364,3.80938 2.36364,6.90315 4.75206,11.30906 6.64508,18.98604 9.6476,39.12505 0.451,3.025 0.85552,79.75 0.89893,170.5 l 0.0789,165 -2.499,13 c -3.25048,16.90929 -9.37272,35.14016 -14.95056,44.51994 -2.44648,4.11403 -5.32435,9.32638 -6.39527,11.58299 -1.07091,2.25661 -3.24875,5.63161 -4.83964,7.5 -1.59089,1.86839 -3.73341,4.73039 -4.76115,6.35999 -4.81824,7.63989 -27.27169,28.72691 -39.54349,37.13703 -6.02324,4.12784 -22.41246,12.30662 -33.5,16.71763 -10.29016,4.09378 -28.85825,8.46192 -41.93747,9.86577 -7.92123,0.85023 -9.74836,1.45155 -16.06902,5.28845 -12.17817,7.39265 -29.3158,16.10336 -46.16316,23.46382 C 476.43704,747.82103 468.67798,751 468.08798,751 c -0.58999,0 -3.13384,-4.3875 -5.65299,-9.75 z m 32.83318,-39.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.3412,36.93808 -60.93627,75.62241 -68.44736,117.18665 -2.36855,13.10683 -2.36587,38.14196 0.005,51.5 3.61054,20.33833 12.67251,42.3815 25.28271,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.18282,-10.7417 c -8.99093,-13.44566 -19.95403,-35.64309 -24.47169,-49.54881 -12.4146,-38.21317 -12.19372,-79.40264 0.6363,-118.65912 4.62875,-14.16272 16.94455,-39.5952 25.27757,-52.19888 4.80145,-7.26217 5.56371,-9.0513 5.30996,-12.46313 l -0.29629,-3.98371 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z M 617,398.16667 c 0,-1.30208 -1.18877,-2.16804 -2.15579,-1.57039 C 613.80999,397.23547 614.70176,399 616.05902,399 616.57656,399 617,398.625 617,398.16667 z"
+       id="path3710"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fed458"
+       d="m 462.43499,741.25 c -2.51916,-5.3625 -6.18522,-13.2375 -8.1468,-17.5 l -3.56651,-7.75 -84.68569,0 -84.68569,0 -7.42515,2.53548 C 269.84132,719.93 260.875,722.27323 254,723.74266 c -11.49313,2.4565 -14.39292,2.67452 -36,2.70672 -26.30733,0.0392 -32.83689,-0.8331 -53,-7.08034 C 139.80995,711.56428 119.48325,698.67819 99.5,677.8454 70.419728,647.52885 54.077272,610.32194 46.420867,557 45.168185,548.27588 44.652129,534.9771 44.282934,501.90535 l -0.486668,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.03386,457 63.150878,457 L 67,457 67.032719,347.75 c 0.01863,-62.21931 0.434969,-112.04816 0.967126,-115.75 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 1.5873,-11.15642 11.792226,-39.66368 16.466914,-46 1.217305,-1.65 3.507377,-5.25 5.089048,-8 C 101.56568,146.97506 127.31847,121.57214 146,110.72677 c 19.84658,-11.521729 42.37031,-19.286075 66,-22.751418 3.025,-0.443623 60.29644,-0.844559 127.26987,-0.890969 L 461.03974,87 l 4.23013,-2.671135 c 2.32657,-1.469124 12.99009,-7.572948 23.69671,-13.564053 18.2105,-10.190054 19.55421,-10.775866 20.82473,-9.078865 0.74698,0.997729 4.53243,7.101553 8.4121,13.564053 l 7.05394,11.75 8.12133,0.01777 c 8.10499,0.01773 19.28066,1.050187 31.67194,2.925989 6.64303,1.005628 26.76608,7.338166 35.60938,11.205941 2.662,1.16428 8.665,4.61538 13.34,7.66913 4.675,3.05374 10.95556,7.15626 13.95679,9.11671 6.69452,4.37296 31.76576,28.93026 35.68622,34.95468 1.57135,2.41463 5.23958,8.03963 8.15164,12.5 C 677.334,173.8748 683,184.78755 683,186.9718 c 0,0.70296 1.06364,3.80938 2.36364,6.90315 4.75206,11.30906 6.64508,18.98604 9.6476,39.12505 0.451,3.025 0.85552,79.75 0.89893,170.5 l 0.0789,165 -2.499,13 c -3.25048,16.90929 -9.37272,35.14016 -14.95056,44.51994 -2.44648,4.11403 -5.32435,9.32638 -6.39527,11.58299 -1.07091,2.25661 -3.24875,5.63161 -4.83964,7.5 -1.59089,1.86839 -3.73341,4.73039 -4.76115,6.35999 -4.81824,7.63989 -27.27169,28.72691 -39.54349,37.13703 -6.02324,4.12784 -22.41246,12.30662 -33.5,16.71763 -10.29016,4.09378 -28.85825,8.46192 -41.93747,9.86577 -7.92123,0.85023 -9.74836,1.45155 -16.06902,5.28845 -12.17817,7.39265 -29.3158,16.10336 -46.16316,23.46382 C 476.43704,747.82103 468.67798,751 468.08798,751 c -0.58999,0 -3.13384,-4.3875 -5.65299,-9.75 z m 32.83318,-39.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.3412,36.93808 -60.93627,75.62241 -68.44736,117.18665 -2.36855,13.10683 -2.36587,38.14196 0.005,51.5 3.61054,20.33833 12.67251,42.3815 25.28271,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.18282,-10.7417 c -8.99093,-13.44566 -19.95403,-35.64309 -24.47169,-49.54881 -12.4146,-38.21317 -12.19372,-79.40264 0.6363,-118.65912 4.62875,-14.16272 16.94455,-39.5952 25.27757,-52.19888 4.80145,-7.26217 5.56371,-9.0513 5.30996,-12.46313 l -0.29629,-3.98371 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 166.20726,-8.12586 c -0.23919,-1.24391 -0.44398,-0.46166 -0.45508,1.73834 -0.0111,2.2 0.18461,3.21775 0.4349,2.26166 0.25029,-0.95609 0.25937,-2.75609 0.0202,-4 z M 655.25,601.33772 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z m -244,-86 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z M 404.66228,508.75 c -0.27741,-0.6875 -0.50439,-0.125 -0.50439,1.25 0,1.375 0.22698,1.9375 0.50439,1.25 0.27741,-0.6875 0.27741,-1.8125 0,-2.5 z m 257.04498,-69.98834 c -0.23919,-1.24391 -0.44398,-0.46166 -0.45508,1.73834 -0.0111,2.2 0.18461,3.21775 0.4349,2.26166 0.25029,-0.95609 0.25937,-2.75609 0.0202,-4 z M 617,398.16667 c 0,-1.30208 -1.18877,-2.16804 -2.15579,-1.57039 C 613.80999,397.23547 614.70176,399 616.05902,399 616.57656,399 617,398.625 617,398.16667 z m -515.75,-2.82895 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z M 94.662281,388.75 c -0.277413,-0.6875 -0.504386,-0.125 -0.504386,1.25 0,1.375 0.226973,1.9375 0.504386,1.25 0.277412,-0.6875 0.277412,-1.8125 0,-2.5 z M 145.76166,247.31292 c -0.95609,-0.25029 -2.75609,-0.25937 -4,-0.0202 -1.24391,0.23919 -0.46166,0.44398 1.73834,0.45508 2.2,0.0111 3.21775,-0.18461 2.26166,-0.4349 z M 124.68311,222.8125 c -0.31922,-0.79773 -0.55618,-0.56078 -0.60416,0.60417 -0.0434,1.05416 0.19292,1.64479 0.52522,1.3125 0.33229,-0.3323 0.36781,-1.1948 0.0789,-1.91667 z"
+       id="path3708"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fdd256"
+       d="m 462.43499,741.25 c -2.51916,-5.3625 -6.18522,-13.2375 -8.1468,-17.5 l -3.56651,-7.75 -84.68569,0 -84.68569,0 -7.42515,2.53548 C 269.84132,719.93 260.875,722.27323 254,723.74266 c -11.49313,2.4565 -14.39292,2.67452 -36,2.70672 -26.30733,0.0392 -32.83689,-0.8331 -53,-7.08034 C 139.80995,711.56428 119.48325,698.67819 99.5,677.8454 70.419728,647.52885 54.077272,610.32194 46.420867,557 45.168185,548.27588 44.652129,534.9771 44.282934,501.90535 l -0.486668,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.03386,457 63.150878,457 L 67,457 67.032719,347.75 c 0.01863,-62.21931 0.434969,-112.04816 0.967126,-115.75 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 1.5873,-11.15642 11.792226,-39.66368 16.466914,-46 1.217305,-1.65 3.507377,-5.25 5.089048,-8 C 101.56568,146.97506 127.31847,121.57214 146,110.72677 c 19.84658,-11.521729 42.37031,-19.286075 66,-22.751418 3.025,-0.443623 60.29644,-0.844559 127.26987,-0.890969 L 461.03974,87 l 4.23013,-2.671135 c 2.32657,-1.469124 12.99009,-7.572948 23.69671,-13.564053 18.2105,-10.190054 19.55421,-10.775866 20.82473,-9.078865 0.74698,0.997729 4.53243,7.101553 8.4121,13.564053 l 7.05394,11.75 8.12133,0.01777 c 8.10499,0.01773 19.28066,1.050187 31.67194,2.925989 6.64303,1.005628 26.76608,7.338166 35.60938,11.205941 2.662,1.16428 8.665,4.61538 13.34,7.66913 4.675,3.05374 10.95556,7.15626 13.95679,9.11671 6.69452,4.37296 31.76576,28.93026 35.68622,34.95468 1.57135,2.41463 5.23958,8.03963 8.15164,12.5 C 677.334,173.8748 683,184.78755 683,186.9718 c 0,0.70296 1.06364,3.80938 2.36364,6.90315 4.75206,11.30906 6.64508,18.98604 9.6476,39.12505 0.451,3.025 0.85552,79.75 0.89893,170.5 l 0.0789,165 -2.499,13 c -3.25048,16.90929 -9.37272,35.14016 -14.95056,44.51994 -2.44648,4.11403 -5.32435,9.32638 -6.39527,11.58299 -1.07091,2.25661 -3.24875,5.63161 -4.83964,7.5 -1.59089,1.86839 -3.73341,4.73039 -4.76115,6.35999 -4.81824,7.63989 -27.27169,28.72691 -39.54349,37.13703 -6.02324,4.12784 -22.41246,12.30662 -33.5,16.71763 -10.29016,4.09378 -28.85825,8.46192 -41.93747,9.86577 -7.92123,0.85023 -9.74836,1.45155 -16.06902,5.28845 -12.17817,7.39265 -29.3158,16.10336 -46.16316,23.46382 C 476.43704,747.82103 468.67798,751 468.08798,751 c -0.58999,0 -3.13384,-4.3875 -5.65299,-9.75 z m 32.83318,-39.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.3412,36.93808 -60.93627,75.62241 -68.44736,117.18665 -2.36855,13.10683 -2.36587,38.14196 0.005,51.5 3.61054,20.33833 12.67251,42.3815 25.28271,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.18282,-10.7417 c -8.99093,-13.44566 -19.95403,-35.64309 -24.47169,-49.54881 -12.4146,-38.21317 -12.19372,-79.40264 0.6363,-118.65912 4.62875,-14.16272 16.94455,-39.5952 25.27757,-52.19888 4.80145,-7.26217 5.56371,-9.0513 5.30996,-12.46313 l -0.29629,-3.98371 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 124.54485,-5.00941 c 16.44182,-15.43736 31.9245,-18.98333 38.76429,-8.87811 1.94424,2.87244 2.29346,4.44134 1.94766,8.75 l -0.42135,5.25 16.91561,0 c 9.90232,0 16.77741,-0.38242 16.58227,-0.92238 -0.18333,-0.50731 -11.11357,-23.89129 -24.28943,-51.96441 l -23.95609,-51.04203 -2.73063,9.71441 c -5.1906,18.4659 -12.20407,34.51768 -21.64456,49.53807 -7.8195,12.44127 -15.46476,21.68824 -28.46319,34.42634 l -10.45949,10.25 16.14988,0 16.14989,0 5.45514,-5.12189 z m 233.87372,-13.28 c 0.63991,-0.77103 2.38251,-1.69932 3.87245,-2.06286 1.48994,-0.36353 4.37009,-1.98268 6.40034,-3.59811 2.03025,-1.61543 3.99144,-2.93714 4.35821,-2.93714 1.5682,0 13.85507,-10.65099 20.78566,-18.01826 C 640.1161,638.77364 650,625.4159 650,623.45991 c 0,-0.42412 1.06007,-2.1636 2.35571,-3.86552 6.58546,-8.65044 13.835,-29.52806 16.7003,-48.09439 1.95632,-12.67646 1.99863,-17.00697 1.70017,-174 C 670.47213,248.08882 670.32593,236.14665 668.72505,231.59107 667.77627,228.89116 667,225.04728 667,223.04911 c 0,-1.99817 -2.025,-8.97048 -4.5,-15.49402 -2.475,-6.52355 -4.5,-12.38264 -4.5,-13.02021 0,-1.78393 -3.63475,-8.5881 -6.96317,-13.03488 -1.6467,-2.2 -3.47562,-5.09961 -4.06426,-6.44358 -2.03354,-4.64289 -10.92804,-15.578 -17.68848,-21.74665 -11.80593,-10.77246 -20.74922,-18.27441 -21.80689,-18.29239 -0.56255,-0.01 -3.48755,-1.64062 -6.5,-3.62457 -7.98749,-5.26042 -11.38175,-6.83528 -24.42639,-11.33326 -10.83989,-3.73776 -29.56635,-7.63477 -33.0633,-6.88054 -1.04869,0.22618 8.9971,17.58693 34.01212,58.77844 19.5252,32.1516 35.50037,58.93269 35.50037,59.51353 0,0.58084 -7.56447,5.20623 -16.80994,10.27865 -20.57254,11.28688 -41.02402,23.81488 -54.53276,33.40521 -11.54336,8.19503 -25.66826,21.68016 -25.63506,24.47395 0.0236,1.98326 3.52932,7.17869 4.28907,6.35627 0.24645,-0.26678 1.65476,-2.88694 3.12958,-5.82256 3.43844,-6.84422 9.65306,-13.03378 16.5247,-16.45806 4.43567,-2.21039 6.78582,-2.70444 12.86473,-2.70444 4.0907,0 9.20398,0.52921 11.36284,1.17602 5.08138,1.52242 11.827,7.50086 14.8118,13.12726 l 2.35719,4.44335 3.28681,-1.37332 C 586.4567,297.61799 590.59883,297 593.85369,297 c 7.69377,0 15.38521,3.84099 19.5459,9.76094 7.73887,11.01106 0.0734,28.50733 -15.87118,36.22546 -6.26269,3.03152 -16.29479,3.37892 -21.45289,0.74288 -3.35248,-1.71328 -3.47864,-1.70255 -6,0.51032 -1.41654,1.24322 -2.71737,2.32725 -2.89075,2.40896 -0.17337,0.0817 5.74197,6.06454 13.1452,13.29519 7.40323,7.23064 17.67008,18.1636 22.81522,24.29546 5.14515,6.13186 10.36731,12.20698 11.60481,13.50026 1.2375,1.29329 2.25,2.55982 2.25,2.81452 0,0.25469 2.83747,4.62174 6.3055,9.70454 3.46802,5.08281 7.63052,11.60736 9.25,14.499 2.06995,3.69599 3.39002,5.08129 4.4445,4.66415 9.23569,-3.65354 17.84287,-2.27558 21.71344,3.4762 3.81306,5.66631 2.41956,15.32352 -3.9463,27.34866 l -3.0421,5.74654 2.59147,9.25346 c 5.51575,19.69528 6.18692,25.41003 6.13694,52.25346 -0.0498,26.73901 -0.80652,32.66377 -6.79168,53.17535 l -2.38552,8.17535 3.91968,-2.47439 c 6.3071,-3.98149 9.24835,-1.82155 7.65791,5.62369 -1.55443,7.27666 -10.92113,11.76237 -13.29135,6.36523 -0.81233,-1.8497 -1.69256,-0.58112 -6.59178,9.5 -10.07231,20.72578 -20.38548,35.68955 -37.82708,54.88477 -5.62222,6.1875 -9.80964,11.25 -9.30537,11.25 0.50427,0 1.44041,-0.63085 2.08031,-1.40189 z M 630,199.85939 c -4.97352,-1.45282 -8.00305,-4.59579 -7.98469,-8.2837 0.008,-1.69163 0.34592,-3.57082 0.75,-4.17599 2.52563,-3.78247 13.46501,-4.95058 19.02765,-2.03178 4.08519,2.14356 5.73094,5.95305 4.18461,9.68623 -1.82388,4.40324 -9.47566,6.70451 -15.97757,4.80524 z M 416.44497,563.99878 c 11.03026,-5.35847 24.14325,-12.47934 29.13997,-15.82416 C 455.25433,541.70191 468,529.17046 468,526.13629 c 0,-6.27504 -19.23978,-27.63693 -40,-44.41192 -6.875,-5.55524 -16.8875,-13.86559 -22.25,-18.46745 l -9.75,-8.36702 0,44.81118 c 0,42.42429 -0.99891,62.47778 -3.63544,72.98253 -0.57686,2.29839 -0.41715,2.46786 1.69424,1.79773 1.28212,-0.40693 11.3559,-5.12408 22.38617,-10.48256 z M 406.2,513.8 c -3.08076,-3.08076 -0.20374,-10.42021 5.37488,-13.71168 6.05028,-3.56975 8.82328,-1.31764 7.27896,5.91168 -1.34937,6.31672 -9.26056,11.19328 -12.65384,7.8 z M 150.5,450.00005 c 29.7,-2.20368 55.9125,-4.25778 58.25,-4.56465 l 4.25,-0.55795 0,-47.80436 0,-47.80436 -6.75,-0.48646 c -12.57078,-0.90595 -23.00557,-8.75246 -25.19094,-18.94249 -2.79954,-13.05382 1.12255,-29.31579 9.83282,-40.76932 3.42836,-4.50811 13.47942,-10.94629 18.28983,-11.71551 L 213,276.74438 213,198.87219 213,121 l 2.33593,0 c 2.25777,0 106.83339,11.431 113.41407,12.39712 2.41506,0.35456 3.25,0.0977 3.25,-0.99983 0,-4.98522 8.7579,-15.02259 15.71788,-18.01416 6.93002,-2.9787 14.26004,-0.63932 18.35414,5.85773 1.70595,2.70722 1.98513,4.46689 1.64863,10.39101 l -0.40511,7.13186 13.59223,1.41163 13.59223,1.41162 10.5,-10.09195 c 5.775,-5.55057 12.75,-11.97973 15.5,-14.28703 l 5,-4.19509 -80.37244,-0.006 c -74.66521,-0.006 -80.27499,0.11103 -79,1.64807 1.27692,1.53937 1.14969,1.53937 -1.8279,0 -2.64987,-1.36995 -6.34792,-1.64428 -21.5,-1.59492 -10.06481,0.0328 -20.32466,0.4356 -22.79966,0.89514 -2.475,0.45953 -8.67946,1.59494 -13.78768,2.52311 -14.45696,2.62687 -37.76472,11.11974 -42.99712,15.66728 C 161.40857,132.71531 159.28672,134 158.5,134 c -0.78672,0 -2.90857,1.24913 -4.7152,2.77585 -1.80664,1.52672 -4.6348,3.43922 -6.2848,4.25 -5.21135,2.56077 -25.72391,23.88502 -31.04885,32.27747 -2.72313,4.29182 -6.02562,9.46562 -7.33885,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 94.21261,454.003 C 95.470674,454.005 120.8,452.20336 150.5,449.99967 z M 170,417.85939 c -4.97352,-1.45282 -8.00305,-4.59579 -7.98469,-8.2837 0.008,-1.69163 0.34592,-3.57082 0.75,-4.17599 2.52563,-3.78247 13.46501,-4.95058 19.02765,-2.03178 4.08519,2.14356 5.73094,5.95305 4.18461,9.68623 -1.82388,4.40324 -9.47566,6.70451 -15.97757,4.80524 z M 96.2,393.8 c -3.080757,-3.08076 -0.203743,-10.42021 5.37488,-13.71168 6.05028,-3.56975 8.82328,-1.31764 7.27896,5.91168 -1.34937,6.31672 -9.260556,11.19328 -12.65384,7.8 z m 39.3,-148.24109 c -8.68481,-3.20284 -12.5726,-11.46231 -10.56617,-22.44743 1.3671,-7.48483 3.22036,-11.39145 9.35558,-19.72133 7.07315,-9.6033 16.43669,-13.06523 27.01793,-9.98918 14.60622,4.24614 18.71874,15.58882 11.3091,31.19142 -3.95943,8.33743 -11.68018,16.83411 -17.99125,19.79934 -5.26037,2.47156 -14.12183,3.01236 -19.12519,1.16718 z M 270.40499,115.75 268.5,113.5 l 2.25,1.90499 c 2.11444,1.79022 2.70524,2.59501 1.90499,2.59501 -0.18976,0 -1.20226,-1.0125 -2.25,-2.25 z"
+       id="path3706"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fad258"
+       d="m 462.43499,741.25 c -2.51916,-5.3625 -6.18522,-13.2375 -8.1468,-17.5 l -3.56651,-7.75 -84.68569,0 -84.68569,0 -7.42515,2.53548 C 269.84132,719.93 260.875,722.27323 254,723.74266 c -11.49313,2.4565 -14.39292,2.67452 -36,2.70672 -26.30733,0.0392 -32.83689,-0.8331 -53,-7.08034 C 139.80995,711.56428 119.48325,698.67819 99.5,677.8454 70.419728,647.52885 54.077272,610.32194 46.420867,557 45.168185,548.27588 44.652129,534.9771 44.282934,501.90535 l -0.486668,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.03386,457 63.150878,457 L 67,457 67.032719,347.75 c 0.01863,-62.21931 0.434969,-112.04816 0.967126,-115.75 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 1.5873,-11.15642 11.792226,-39.66368 16.466914,-46 1.217305,-1.65 3.507377,-5.25 5.089048,-8 C 101.56568,146.97506 127.31847,121.57214 146,110.72677 c 19.84658,-11.521729 42.37031,-19.286075 66,-22.751418 3.025,-0.443623 60.29644,-0.844559 127.26987,-0.890969 L 461.03974,87 l 4.23013,-2.671135 c 2.32657,-1.469124 12.99009,-7.572948 23.69671,-13.564053 18.2105,-10.190054 19.55421,-10.775866 20.82473,-9.078865 0.74698,0.997729 4.53243,7.101553 8.4121,13.564053 l 7.05394,11.75 8.12133,0.01777 c 8.10499,0.01773 19.28066,1.050187 31.67194,2.925989 6.64303,1.005628 26.76608,7.338166 35.60938,11.205941 2.662,1.16428 8.665,4.61538 13.34,7.66913 4.675,3.05374 10.95556,7.15626 13.95679,9.11671 6.69452,4.37296 31.76576,28.93026 35.68622,34.95468 1.57135,2.41463 5.23958,8.03963 8.15164,12.5 C 677.334,173.8748 683,184.78755 683,186.9718 c 0,0.70296 1.06364,3.80938 2.36364,6.90315 4.75206,11.30906 6.64508,18.98604 9.6476,39.12505 0.451,3.025 0.85552,79.75 0.89893,170.5 l 0.0789,165 -2.499,13 c -3.25048,16.90929 -9.37272,35.14016 -14.95056,44.51994 -2.44648,4.11403 -5.32435,9.32638 -6.39527,11.58299 -1.07091,2.25661 -3.24875,5.63161 -4.83964,7.5 -1.59089,1.86839 -3.73341,4.73039 -4.76115,6.35999 -4.81824,7.63989 -27.27169,28.72691 -39.54349,37.13703 -6.02324,4.12784 -22.41246,12.30662 -33.5,16.71763 -10.29016,4.09378 -28.85825,8.46192 -41.93747,9.86577 -7.92123,0.85023 -9.74836,1.45155 -16.06902,5.28845 -12.17817,7.39265 -29.3158,16.10336 -46.16316,23.46382 C 476.43704,747.82103 468.67798,751 468.08798,751 c -0.58999,0 -3.13384,-4.3875 -5.65299,-9.75 z m 32.83318,-39.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.3412,36.93808 -60.93627,75.62241 -68.44736,117.18665 -2.36855,13.10683 -2.36587,38.14196 0.005,51.5 3.61054,20.33833 12.67251,42.3815 25.28271,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.18282,-10.7417 c -8.99093,-13.44566 -19.95403,-35.64309 -24.47169,-49.54881 -12.4146,-38.21317 -12.19372,-79.40264 0.6363,-118.65912 4.62875,-14.16272 16.94455,-39.5952 25.27757,-52.19888 4.80145,-7.26217 5.56371,-9.0513 5.30996,-12.46313 l -0.29629,-3.98371 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 124.54485,-5.00941 c 16.44182,-15.43736 31.9245,-18.98333 38.76429,-8.87811 1.94424,2.87244 2.29346,4.44134 1.94766,8.75 l -0.42135,5.25 16.93927,0 c 13.14059,0 16.83168,-0.28032 16.45954,-1.25 -0.26384,-0.6875 -11.19226,-24.07414 -24.28538,-51.97031 l -23.80566,-50.72031 -3.24478,11.22031 c -6.17439,21.35075 -16.33548,42.31033 -28.56721,58.92642 -3.35799,4.56164 -11.81733,14.03139 -18.79852,21.04389 l -12.69309,12.75 16.12504,0 16.12505,0 5.45514,-5.12189 z m 233.87372,-13.28 c 0.63991,-0.77103 2.38251,-1.69932 3.87245,-2.06286 1.48994,-0.36353 4.37009,-1.98268 6.40034,-3.59811 2.03025,-1.61543 3.99144,-2.93714 4.35821,-2.93714 1.5682,0 13.85507,-10.65099 20.78566,-18.01826 C 640.1161,638.77364 650,625.4159 650,623.45991 c 0,-0.42412 1.06007,-2.1636 2.35571,-3.86552 6.58546,-8.65044 13.835,-29.52806 16.7003,-48.09439 1.95632,-12.67646 1.99863,-17.00697 1.70017,-174 -0.28405,-149.41118 -0.43025,-161.35335 -2.03113,-165.90893 -0.94878,-2.69991 -1.7314,-6.52491 -1.73916,-8.5 -0.008,-1.97509 -1.62675,-7.86607 -3.59776,-13.09107 -1.97101,-5.225 -4.12658,-11.3 -4.79016,-13.5 -1.7495,-5.80024 -4.08392,-10.45247 -7.52679,-15 -1.66559,-2.2 -3.50997,-5.09961 -4.09861,-6.44358 -2.03354,-4.64289 -10.92804,-15.578 -17.68848,-21.74665 -11.80593,-10.77246 -20.74922,-18.27441 -21.80689,-18.29239 -0.56255,-0.01 -3.48755,-1.64062 -6.5,-3.62457 -7.98749,-5.26042 -11.38175,-6.83528 -24.42639,-11.33326 -10.8704,-3.74828 -29.53893,-7.62807 -33.1073,-6.88054 -1.10486,0.23145 8.2854,16.49242 33.66475,58.29669 19.35837,31.88664 35.36824,58.66164 35.57751,59.5 0.26809,1.07402 -3.3957,3.57445 -12.40264,8.46446 -27.86165,15.12653 -50.78949,29.44632 -65.85595,41.13092 C 525.20266,287.72504 516,297.3571 516,299.85808 c 0,1.89373 2.68767,6.14192 3.88577,6.14192 0.42479,0 1.86178,-2.33293 3.19329,-5.18429 3.14292,-6.73036 10.02641,-13.71321 16.86728,-17.11076 4.44837,-2.2093 6.80921,-2.70495 12.88398,-2.70495 4.0907,0 9.20398,0.52921 11.36284,1.17602 5.08138,1.52242 11.827,7.50086 14.8118,13.12726 l 2.35719,4.44335 3.28681,-1.37332 C 586.4567,297.61799 590.59883,297 593.85369,297 c 7.69377,0 15.38521,3.84099 19.5459,9.76094 7.78547,11.07737 0.008,28.53849 -16.20883,36.38876 -5.9206,2.86612 -16.09459,3.14538 -21.11524,0.57958 -3.35248,-1.71328 -3.47864,-1.70255 -6,0.51032 -1.41654,1.24322 -2.70232,2.3122 -2.85731,2.37552 -0.15498,0.0633 6.86036,7.26332 15.58965,16 8.7293,8.73668 19.36549,20.15988 23.636,25.38488 4.2705,5.225 8.32482,9.95 9.00958,10.5 0.68477,0.55 1.2544,1.225 1.26585,1.5 0.0115,0.275 4.10239,6.71928 9.09097,14.32062 4.98859,7.60134 9.20956,14.19809 9.37995,14.65944 0.17038,0.46136 3.01742,0.12905 6.32675,-0.73846 5.28147,-1.38448 6.56128,-1.40397 10.47007,-0.15944 10.71662,3.4121 11.73486,15.24911 2.76868,32.18582 l -3.05353,5.76799 2.08996,7.23201 c 5.77967,19.9997 6.63904,26.79025 6.67346,52.73202 0.0252,19.02763 -0.34886,26.51026 -1.67488,33.5 -1.52967,8.06323 -5.46434,22.93996 -7.3674,27.85568 -0.60976,1.57505 -0.0824,1.4542 3.48695,-0.79903 5.85328,-3.69502 8.08973,-2.83504 8.08973,3.11074 0,3.83917 -0.53077,5.06338 -3.46938,8.00199 -4.03851,4.03851 -8.3768,4.32005 -9.98864,0.64822 -0.83753,-1.9079 -1.73097,-0.58727 -7.10354,10.5 -9.5881,19.78676 -21.22275,36.38985 -39.29665,56.07779 -4.59701,5.00753 -7.91461,9.10461 -7.37244,9.10461 0.54217,0 1.50932,-0.63085 2.14922,-1.40189 z M 627.32874,198.5972 c -5.46917,-2.47383 -7.10909,-8.67603 -3.22375,-12.19221 1.66613,-1.50783 3.62991,-1.90499 9.41943,-1.90499 6.36489,0 7.64946,0.31473 9.89502,2.42431 3.2175,3.02269 3.47026,7.96055 0.54309,10.6096 -2.67475,2.42062 -12.27611,3.03437 -16.63379,1.06329 z M 414.40291,565.07077 c 28.39075,-13.70215 43.3946,-23.69102 50.54875,-33.65298 3.85154,-5.36318 3.70204,-6.48363 -2.02936,-15.20875 -5.85663,-8.91578 -20.26964,-22.9466 -39.69615,-38.64354 -9.19938,-7.43324 -19.04984,-15.55843 -21.8899,-18.05597 l -5.16375,-4.54098 -0.484,50.76573 c -0.28863,30.275 -0.92674,53.18752 -1.58089,56.76572 -2.08749,11.41848 -2.19461,12.5 -1.23811,12.5 0.52808,0 10.21811,-4.46815 21.53341,-9.92923 z M 406.2,513.8 c -3.08076,-3.08076 -0.20374,-10.42021 5.37488,-13.71168 5.29215,-3.12244 7.42512,-2.09431 7.42512,3.57907 0,3.8214 -0.53349,5.0661 -3.4,7.93261 -3.50484,3.50484 -7.22458,4.37542 -9.4,2.2 z M 151.5,449.97546 c 30.25,-2.23265 56.4625,-4.28587 58.25,-4.56272 l 3.25,-0.50337 0,-47.82032 0,-47.82032 -6.75,-0.48646 c -12.57078,-0.90595 -23.00557,-8.75246 -25.19094,-18.94249 -2.79954,-13.05382 1.12255,-29.31579 9.83282,-40.76932 3.42836,-4.50811 13.47942,-10.94629 18.28983,-11.71551 L 213,276.74438 213,198.87219 213,121 l 2.33593,0 c 2.71623,0 108.65671,11.6815 113.24926,12.4874 2.90021,0.50893 3.16917,0.2857 4.48583,-3.72301 2.41397,-7.34956 13.86329,-16.72047 20.42898,-16.72047 1.1,0 3.93192,0.87681 6.29315,1.94847 5.73,2.60058 8.73608,8.89126 7.84483,16.41648 -0.33084,2.79344 -1.17223,5.29114 -1.86975,5.55044 -0.69753,0.25931 5.48177,1.18875 13.73177,2.06543 l 15,1.59396 10,-9.6043 c 5.5,-5.28237 12.46727,-11.72158 15.48282,-14.30935 L 425.46565,112 324.98282,112.05961 C 269.71727,112.0924 222.475,112.49521 220,112.95475 c -2.475,0.45953 -8.67946,1.59494 -13.78768,2.52311 -14.45696,2.62687 -37.76472,11.11974 -42.99712,15.66728 C 161.40857,132.71531 159.28672,134 158.5,134 c -0.78672,0 -2.90857,1.24913 -4.7152,2.77585 -1.80664,1.52672 -4.6348,3.43922 -6.2848,4.25 -5.21135,2.56077 -25.72391,23.88502 -31.04885,32.27747 -2.72313,4.29182 -6.02562,9.46562 -7.33885,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 l 2.287391,0.0174 c 1.258064,0.01 27.03739,-1.80929 57.28739,-4.04195 z m 15.82874,-33.37826 c -5.46917,-2.47383 -7.10909,-8.67603 -3.22375,-12.19221 1.66613,-1.50783 3.62991,-1.90499 9.41943,-1.90499 6.36489,0 7.64946,0.31473 9.89502,2.42431 3.2175,3.02269 3.47026,7.96055 0.54309,10.6096 -2.67475,2.42062 -12.27611,3.03437 -16.63379,1.06329 z M 96.2,393.8 c -3.080757,-3.08076 -0.203743,-10.42021 5.37488,-13.71168 5.29215,-3.12244 7.42512,-2.09431 7.42512,3.57907 0,3.8214 -0.53349,5.0661 -3.4,7.93261 -3.50484,3.50484 -7.224584,4.37542 -9.4,2.2 z m 39.3,-148.24109 c -8.68481,-3.20284 -12.5726,-11.46231 -10.56617,-22.44743 1.3671,-7.48483 3.22036,-11.39145 9.35558,-19.72133 7.07315,-9.6033 16.43669,-13.06523 27.01793,-9.98918 14.60622,4.24614 18.71874,15.58882 11.3091,31.19142 -3.95943,8.33743 -11.68018,16.83411 -17.99125,19.79934 -5.26037,2.47156 -14.12183,3.01236 -19.12519,1.16718 z"
+       id="path3704"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f9d156"
+       d="m 462.43499,741.25 c -2.51916,-5.3625 -6.18522,-13.2375 -8.1468,-17.5 l -3.56651,-7.75 -84.68569,0 -84.68569,0 -7.42515,2.53548 C 269.84132,719.93 260.875,722.27323 254,723.74266 c -11.49313,2.4565 -14.39292,2.67452 -36,2.70672 -26.30733,0.0392 -32.83689,-0.8331 -53,-7.08034 C 139.80995,711.56428 119.48325,698.67819 99.5,677.8454 70.419728,647.52885 54.077272,610.32194 46.420867,557 45.168185,548.27588 44.652129,534.9771 44.282934,501.90535 l -0.486668,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.03386,457 63.150878,457 L 67,457 67.032719,347.75 c 0.01863,-62.21931 0.434969,-112.04816 0.967126,-115.75 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 1.5873,-11.15642 11.792226,-39.66368 16.466914,-46 1.217305,-1.65 3.507377,-5.25 5.089048,-8 C 101.56568,146.97506 127.31847,121.57214 146,110.72677 c 19.84658,-11.521729 42.37031,-19.286075 66,-22.751418 3.025,-0.443623 60.29644,-0.844559 127.26987,-0.890969 L 461.03974,87 l 4.23013,-2.671135 c 2.32657,-1.469124 12.99009,-7.572948 23.69671,-13.564053 18.2105,-10.190054 19.55421,-10.775866 20.82473,-9.078865 0.74698,0.997729 4.53243,7.101553 8.4121,13.564053 l 7.05394,11.75 8.12133,0.01777 c 8.10499,0.01773 19.28066,1.050187 31.67194,2.925989 6.64303,1.005628 26.76608,7.338166 35.60938,11.205941 2.662,1.16428 8.665,4.61538 13.34,7.66913 4.675,3.05374 10.95556,7.15626 13.95679,9.11671 6.69452,4.37296 31.76576,28.93026 35.68622,34.95468 1.57135,2.41463 5.23958,8.03963 8.15164,12.5 C 677.334,173.8748 683,184.78755 683,186.9718 c 0,0.70296 1.06364,3.80938 2.36364,6.90315 4.75206,11.30906 6.64508,18.98604 9.6476,39.12505 0.451,3.025 0.85552,79.75 0.89893,170.5 l 0.0789,165 -2.499,13 c -3.25048,16.90929 -9.37272,35.14016 -14.95056,44.51994 -2.44648,4.11403 -5.32435,9.32638 -6.39527,11.58299 -1.07091,2.25661 -3.24875,5.63161 -4.83964,7.5 -1.59089,1.86839 -3.73341,4.73039 -4.76115,6.35999 -4.81824,7.63989 -27.27169,28.72691 -39.54349,37.13703 -6.02324,4.12784 -22.41246,12.30662 -33.5,16.71763 -10.29016,4.09378 -28.85825,8.46192 -41.93747,9.86577 -7.92123,0.85023 -9.74836,1.45155 -16.06902,5.28845 -12.17817,7.39265 -29.3158,16.10336 -46.16316,23.46382 C 476.43704,747.82103 468.67798,751 468.08798,751 c -0.58999,0 -3.13384,-4.3875 -5.65299,-9.75 z m 32.83318,-39.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.3412,36.93808 -60.93627,75.62241 -68.44736,117.18665 -2.36855,13.10683 -2.36587,38.14196 0.005,51.5 3.61054,20.33833 12.67251,42.3815 25.28271,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.18282,-10.7417 c -8.99093,-13.44566 -19.95403,-35.64309 -24.47169,-49.54881 -12.4146,-38.21317 -12.19372,-79.40264 0.6363,-118.65912 4.62875,-14.16272 16.94455,-39.5952 25.27757,-52.19888 4.80145,-7.26217 5.56371,-9.0513 5.30996,-12.46313 l -0.29629,-3.98371 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 125.73002,-5.92336 c 8.18733,-7.88159 18.9648,-13.39273 26.19055,-13.39273 9.11115,0 14.35263,5.87637 13.33045,14.94514 L 404.24567,691 l 16.98416,0 c 13.1765,0 16.8766,-0.28024 16.50443,-1.25 -0.26384,-0.6875 -11.19226,-24.07414 -24.28538,-51.97031 l -23.80566,-50.72031 -3.24478,11.22031 c -6.17439,21.35075 -16.33548,42.31033 -28.56721,58.92642 -3.35799,4.56164 -11.81733,14.03139 -18.79852,21.04389 l -12.69309,12.75 16.31021,0 16.3102,0 6.26999,-6.03584 z m 232.68855,-12.36605 c 0.63991,-0.77103 2.38251,-1.69932 3.87245,-2.06286 1.48994,-0.36353 4.37009,-1.98268 6.40034,-3.59811 2.03025,-1.61543 3.99144,-2.93714 4.35821,-2.93714 1.5682,0 13.85507,-10.65099 20.78566,-18.01826 C 640.1161,638.77364 650,625.4159 650,623.45991 c 0,-0.42412 1.06007,-2.1636 2.35571,-3.86552 6.58546,-8.65044 13.835,-29.52806 16.7003,-48.09439 1.95632,-12.67646 1.99863,-17.00697 1.70017,-174 -0.28405,-149.41118 -0.43025,-161.35335 -2.03113,-165.90893 -0.94878,-2.69991 -1.7314,-6.52491 -1.73916,-8.5 -0.008,-1.97509 -1.62675,-7.86607 -3.59776,-13.09107 -1.97101,-5.225 -4.12658,-11.3 -4.79016,-13.5 -1.7495,-5.80024 -4.08392,-10.45247 -7.52679,-15 -1.66559,-2.2 -3.50997,-5.09961 -4.09861,-6.44358 -2.03354,-4.64289 -10.92804,-15.578 -17.68848,-21.74665 -11.80593,-10.77246 -20.74922,-18.27441 -21.80689,-18.29239 -0.56255,-0.01 -3.48755,-1.64062 -6.5,-3.62457 -7.98749,-5.26042 -11.38175,-6.83528 -24.42639,-11.33326 -10.8704,-3.74828 -29.53893,-7.62807 -33.1073,-6.88054 -1.10486,0.23145 8.2854,16.49242 33.66475,58.29669 19.35837,31.88664 35.36824,58.66164 35.57751,59.5 0.26809,1.07402 -3.3957,3.57445 -12.40264,8.46446 -27.86165,15.12653 -50.78949,29.44632 -65.85595,41.13092 C 525.20266,287.72504 516,297.3571 516,299.85808 c 0,1.89373 2.68767,6.14192 3.88577,6.14192 0.42479,0 1.84144,-2.28255 3.14811,-5.07233 2.99412,-6.39258 10.40177,-13.98006 16.65415,-17.05846 6.77283,-3.33465 21.78199,-3.42358 27.90665,-0.16535 4.73393,2.51838 10.06301,8.23262 11.9991,12.86634 1.34323,3.21481 1.34459,3.2153 5.1249,1.86662 15.23385,-5.43488 31.26281,4.1062 31.2762,18.61684 0.01,10.29835 -6.70576,19.7234 -18.20898,25.5568 -6.47426,3.28316 -16.31507,3.71862 -21.65322,0.95815 -3.26134,-1.6865 -3.39663,-1.67287 -5.98472,0.60294 -1.45638,1.28065 -2.76481,2.3703 -2.90762,2.42145 -0.14282,0.0512 7.29426,7.70115 16.52685,17 9.23258,9.29885 20.5711,21.632 25.19669,27.407 7.31326,9.13051 25.28783,35.25514 26.2569,38.16234 0.21638,0.64915 2.42986,0.41368 6.07644,-0.64641 C 652.54565,425.24592 661,430.38044 661,440.48189 c 0,4.33291 -3.2313,14.28555 -6.74086,20.76237 l -2.57075,4.74426 2.09598,7.25574 c 4.96147,17.17536 6.37125,26.73535 6.92761,46.97755 0.72736,26.46359 -1.54805,43.99533 -8.33935,64.25357 -1.94455,5.80053 -2.0515,6.65676 -0.61377,4.91363 0.95763,-1.16105 3.17413,-2.92814 4.92556,-3.92687 2.74089,-1.56296 3.41729,-1.62262 4.85631,-0.42834 2.77859,2.30603 1.39178,9.74381 -2.45819,13.18376 -1.71275,1.53034 -3.81158,2.78244 -4.66406,2.78244 -2.58709,0 -5.41701,-1.96793 -5.44316,-3.78518 -0.0136,-0.94315 -2.87266,4.13518 -6.35354,11.28518 -9.82321,20.17766 -21.35941,36.6566 -39.47999,56.39539 -4.59701,5.00753 -7.91461,9.10461 -7.37244,9.10461 0.54217,0 1.50932,-0.63085 2.14922,-1.40189 z M 627.32874,198.5972 c -5.46917,-2.47383 -7.10909,-8.67603 -3.22375,-12.19221 1.66613,-1.50783 3.62991,-1.90499 9.41943,-1.90499 6.36489,0 7.64946,0.31473 9.89502,2.42431 3.2175,3.02269 3.47026,7.96055 0.54309,10.6096 -2.67475,2.42062 -12.27611,3.03437 -16.63379,1.06329 z M 414.40291,565.07077 c 28.39075,-13.70215 43.3946,-23.69102 50.54875,-33.65298 3.85154,-5.36318 3.70204,-6.48363 -2.02936,-15.20875 -5.85663,-8.91578 -20.26964,-22.9466 -39.69615,-38.64354 -9.19938,-7.43324 -19.04984,-15.55843 -21.8899,-18.05597 l -5.16375,-4.54098 -0.484,50.76573 c -0.28863,30.275 -0.92674,53.18752 -1.58089,56.76572 -2.08749,11.41848 -2.19461,12.5 -1.23811,12.5 0.52808,0 10.21811,-4.46815 21.53341,-9.92923 z M 406.75,513.9199 c -4.02343,-2.34343 -0.61869,-10.95551 5.6588,-14.31359 4.57429,-2.44696 6.5912,-1.03443 6.5912,4.61613 0,3.19017 -0.67306,4.65062 -3.4,7.37756 -3.49559,3.49559 -5.7961,4.09863 -8.85,2.3199 z M 151.5,449.97546 c 30.25,-2.23265 56.4625,-4.28587 58.25,-4.56272 l 3.25,-0.50337 0,-47.95468 0,-47.95469 -4.3185,0 c -10.12406,0 -21.05527,-5.82293 -25.36947,-13.51402 -6.20489,-11.0617 -2.37091,-34.06579 7.72282,-46.3373 4.07854,-4.95851 11.44955,-9.83171 17.03715,-11.26377 L 213,276.6219 213,198.81095 213,121 l 2.33593,0 c 2.71623,0 108.65671,11.6815 113.24926,12.4874 2.90021,0.50893 3.16917,0.2857 4.48583,-3.72301 2.41397,-7.34956 13.86329,-16.72047 20.42898,-16.72047 1.1,0 3.93192,0.87681 6.29315,1.94847 5.73,2.60058 8.73608,8.89126 7.84483,16.41648 -0.33084,2.79344 -1.17223,5.29114 -1.86975,5.55044 -0.69753,0.25931 5.48177,1.18875 13.73177,2.06543 l 15,1.59396 10,-9.6043 c 5.5,-5.28237 12.46727,-11.72158 15.48282,-14.30935 L 425.46565,112 324.98282,112.05961 C 269.71727,112.0924 222.475,112.49521 220,112.95475 c -2.475,0.45953 -8.67946,1.59494 -13.78768,2.52311 -14.45696,2.62687 -37.76472,11.11974 -42.99712,15.66728 C 161.40857,132.71531 159.28672,134 158.5,134 c -0.78672,0 -2.90857,1.24913 -4.7152,2.77585 -1.80664,1.52672 -4.6348,3.43922 -6.2848,4.25 -5.21135,2.56077 -25.72391,23.88502 -31.04885,32.27747 -2.72313,4.29182 -6.02562,9.46562 -7.33885,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 l 2.287391,0.0174 c 1.258064,0.01 27.03739,-1.80929 57.28739,-4.04195 z m 15.82874,-33.37826 c -5.46917,-2.47383 -7.10909,-8.67603 -3.22375,-12.19221 1.66613,-1.50783 3.62991,-1.90499 9.41943,-1.90499 6.36489,0 7.64946,0.31473 9.89502,2.42431 3.2175,3.02269 3.47026,7.96055 0.54309,10.6096 -2.67475,2.42062 -12.27611,3.03437 -16.63379,1.06329 z M 96.75,393.9199 c -4.023434,-2.34343 -0.618694,-10.95551 5.6588,-14.31359 4.57429,-2.44696 6.5912,-1.03443 6.5912,4.61613 0,3.19017 -0.67306,4.65062 -3.4,7.37756 -3.49559,3.49559 -5.796102,4.09863 -8.85,2.3199 z m 39.5064,-147.97764 c -1.78398,-0.54787 -4.74609,-2.49862 -6.58246,-4.33499 -8.35174,-8.35174 -6.81842,-22.42761 4.06298,-37.29814 9.16526,-12.52525 22.54798,-15.5055 34.55212,-7.69456 8.84385,5.75458 10.32725,15.88705 4.1373,28.26004 -4.10035,8.19613 -11.13726,15.91694 -17.43555,19.13009 -4.92045,2.51023 -13.85933,3.43471 -18.73439,1.93756 z"
+       id="path3702"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f6d056"
+       d="m 462.43499,741.25 c -2.51916,-5.3625 -6.18522,-13.2375 -8.1468,-17.5 l -3.56651,-7.75 -84.68569,0 -84.68569,0 -7.42515,2.53548 C 269.84132,719.93 260.875,722.27323 254,723.74266 c -11.49313,2.4565 -14.39292,2.67452 -36,2.70672 -26.30733,0.0392 -32.83689,-0.8331 -53,-7.08034 C 139.80995,711.56428 119.48325,698.67819 99.5,677.8454 70.419728,647.52885 54.077272,610.32194 46.420867,557 45.168185,548.27588 44.652129,534.9771 44.282934,501.90535 l -0.486668,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.03386,457 63.150878,457 L 67,457 67.032719,347.75 c 0.01863,-62.21931 0.434969,-112.04816 0.967126,-115.75 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 1.5873,-11.15642 11.792226,-39.66368 16.466914,-46 1.217305,-1.65 3.507377,-5.25 5.089048,-8 C 101.56568,146.97506 127.31847,121.57214 146,110.72677 c 19.84658,-11.521729 42.37031,-19.286075 66,-22.751418 3.025,-0.443623 60.29644,-0.844559 127.26987,-0.890969 L 461.03974,87 l 4.23013,-2.671135 c 2.32657,-1.469124 12.99009,-7.572948 23.69671,-13.564053 18.2105,-10.190054 19.55421,-10.775866 20.82473,-9.078865 0.74698,0.997729 4.53243,7.101553 8.4121,13.564053 l 7.05394,11.75 8.12133,0.01777 c 8.10499,0.01773 19.28066,1.050187 31.67194,2.925989 6.64303,1.005628 26.76608,7.338166 35.60938,11.205941 2.662,1.16428 8.665,4.61538 13.34,7.66913 4.675,3.05374 10.95556,7.15626 13.95679,9.11671 6.69452,4.37296 31.76576,28.93026 35.68622,34.95468 1.57135,2.41463 5.23958,8.03963 8.15164,12.5 C 677.334,173.8748 683,184.78755 683,186.9718 c 0,0.70296 1.06364,3.80938 2.36364,6.90315 4.75206,11.30906 6.64508,18.98604 9.6476,39.12505 0.451,3.025 0.85552,79.75 0.89893,170.5 l 0.0789,165 -2.499,13 c -3.25048,16.90929 -9.37272,35.14016 -14.95056,44.51994 -2.44648,4.11403 -5.32435,9.32638 -6.39527,11.58299 -1.07091,2.25661 -3.24875,5.63161 -4.83964,7.5 -1.59089,1.86839 -3.73341,4.73039 -4.76115,6.35999 -4.81824,7.63989 -27.27169,28.72691 -39.54349,37.13703 -6.02324,4.12784 -22.41246,12.30662 -33.5,16.71763 -10.29016,4.09378 -28.85825,8.46192 -41.93747,9.86577 -7.92123,0.85023 -9.74836,1.45155 -16.06902,5.28845 -12.17817,7.39265 -29.3158,16.10336 -46.16316,23.46382 C 476.43704,747.82103 468.67798,751 468.08798,751 c -0.58999,0 -3.13384,-4.3875 -5.65299,-9.75 z m 32.83318,-39.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.3412,36.93808 -60.93627,75.62241 -68.44736,117.18665 -2.36855,13.10683 -2.36587,38.14196 0.005,51.5 3.61054,20.33833 12.67251,42.3815 25.28271,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.18282,-10.7417 c -8.99093,-13.44566 -19.95403,-35.64309 -24.47169,-49.54881 -12.4146,-38.21317 -12.19372,-79.40264 0.6363,-118.65912 4.62875,-14.16272 16.94455,-39.5952 25.27757,-52.19888 4.80145,-7.26217 5.56371,-9.0513 5.30996,-12.46313 l -0.29629,-3.98371 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.56556,-6.38062 c 6.98782,-6.74617 15.95984,-11.82855 22.97276,-13.01337 2.75848,-0.46605 5.08275,-0.0912 8.32344,1.3423 5.77871,2.55619 8.03997,6.63146 7.39635,13.32977 l -0.46452,4.8344 16.96019,0 c 14.38761,0 16.87599,-0.21945 16.40502,-1.44678 -0.30535,-0.79573 -11.23936,-24.22533 -24.2978,-52.06579 l -23.74261,-50.619 -3.21815,11.31578 c -1.76998,6.22369 -5.24465,16.04079 -7.72149,21.81579 -10.11122,23.57535 -20.64048,39.0791 -39.22051,57.75 l -13.18551,13.25 16.53357,0 16.53358,0 6.72568,-6.4931 z m 227.062,-9.2569 c 1.24387,-1.58606 1.2085,-1.62143 -0.37756,-0.37756 -0.9625,0.75485 -1.75,1.54235 -1.75,1.75 0,0.82304 0.82119,0.29331 2.12756,-1.37244 z m 4.79101,-2.65189 c 0.63991,-0.77103 2.38251,-1.69932 3.87245,-2.06286 1.48994,-0.36353 4.37009,-1.98268 6.40034,-3.59811 2.03025,-1.61543 3.99144,-2.93714 4.35821,-2.93714 1.5682,0 13.85507,-10.65099 20.78566,-18.01826 C 640.1161,638.77364 650,625.4159 650,623.45991 c 0,-0.42412 1.06007,-2.1636 2.35571,-3.86552 6.50851,-8.54936 13.8166,-29.49916 16.66666,-47.77761 1.91051,-12.25279 1.97515,-18.02212 1.90463,-170 C 670.88685,315.29255 670.47422,242.25 670.01004,239.5 c -0.46417,-2.75 -1.37236,-8.15 -2.01819,-12 -1.19639,-7.13203 -6.32548,-23.97436 -8.67928,-28.5 -0.71513,-1.375 -1.30302,-3.20298 -1.30641,-4.06217 -0.008,-2.14858 -3.36837,-8.62694 -6.96933,-13.43783 -1.6467,-2.2 -3.47562,-5.09961 -4.06426,-6.44358 -2.03354,-4.64289 -10.92804,-15.578 -17.68848,-21.74665 -11.80593,-10.77246 -20.74922,-18.27441 -21.80689,-18.29239 -0.56255,-0.01 -3.48755,-1.65745 -6.5,-3.66197 -7.40398,-4.9267 -15.35618,-8.44738 -28.4772,-12.60772 -10.15512,-3.21993 -28.89255,-6.68848 -30.02331,-5.55772 -0.26698,0.26698 15.33343,26.54596 34.66756,58.39773 19.33414,31.85176 35.32644,58.5873 35.53844,59.4123 0.25964,1.01035 -1.99228,2.77421 -6.89861,5.40346 -37.94866,20.33631 -68.18045,39.97742 -81.03408,52.64655 -5.03029,4.95809 -8.75,9.44924 -8.75,10.56469 0,2.02259 2.60292,6.38705 3.8067,6.38292 0.38132,-10e-4 1.99668,-2.49676 3.58969,-5.54546 3.53959,-6.77401 10.33677,-13.64701 16.49954,-16.6836 6.49263,-3.19911 21.62269,-3.2168 27.69875,-0.0324 4.75807,2.49367 10.05809,8.18854 12.04384,12.94109 1.61779,3.87192 1.15589,3.7244 5.70724,1.82273 7.43498,-3.10654 17.11504,-1.36532 23.68804,4.26093 5.29649,4.53359 6.9662,8.0074 6.9662,14.49307 0,10.14252 -7.26561,20.16748 -18.36044,25.3334 -6.1865,2.88053 -16.98214,3.32105 -21.69261,0.88517 -2.76288,-1.42874 -3.14735,-1.38428 -5.95034,0.68806 -1.64813,1.21852 -2.99661,2.32196 -2.99661,2.4521 0,0.13013 7.11307,7.35801 15.80681,16.06194 8.69375,8.70393 19.65529,20.55033 24.35899,26.32533 8.31755,10.21195 21.9514,29.44284 25.16793,35.5 3.12381,5.88256 2.80003,5.74923 9.46294,3.89678 5.79722,-1.61177 6.36094,-1.6083 10.74542,0.0661 10.23295,3.908 11.09831,13.20648 2.80925,30.18629 l -3.49004,7.1492 3.48521,13.86748 c 4.84716,19.2866 6.01016,30.94133 5.36415,53.75533 -0.58152,20.53657 -2.9606,35.2256 -8.18319,50.52505 -2.37196,6.94862 -2.40575,7.3002 -0.50565,5.26068 3.33353,-3.57812 7.8648,-5.54594 9.55001,-4.14733 3.27325,2.71655 0.31107,12.32713 -4.61146,14.96159 -2.87558,1.53896 -6.67186,0.46317 -7.49277,-2.12331 -0.52622,-1.65795 -1.98346,0.59511 -6.95445,10.75233 -9.84067,20.10742 -21.53594,36.70925 -40.3691,57.30527 -4.04577,4.42448 -6.91337,8.0445 -6.37244,8.0445 0.54092,0 1.50706,-0.63085 2.14696,-1.40189 z M 627.32874,198.5972 c -5.46917,-2.47383 -7.10909,-8.67603 -3.22375,-12.19221 1.66613,-1.50783 3.62991,-1.90499 9.41943,-1.90499 6.36489,0 7.64946,0.31473 9.89502,2.42431 3.2175,3.02269 3.47026,7.96055 0.54309,10.6096 -2.67475,2.42062 -12.27611,3.03437 -16.63379,1.06329 z M 439.39215,552.26557 c 14.36452,-8.4131 28.62395,-21.46594 28.59969,-26.17968 -0.0126,-2.44966 -4.92035,-10.31951 -10.99184,-17.62604 -6.55743,-7.89133 -15.61623,-16.15053 -34.5,-31.45478 -7.7,-6.24042 -16.77628,-13.76762 -20.16952,-16.7271 l -6.16951,-5.38089 -0.43361,50.30146 c -0.34834,40.40966 -0.75394,52.16964 -2.06255,59.80146 -0.89591,5.225 -1.63701,9.81605 -1.64687,10.20234 -0.0251,0.9839 37.80285,-17.33095 47.37421,-22.93677 z m -32.82072,-38.837 c -3.40252,-3.40252 -0.68945,-9.8699 5.6305,-13.4219 4.59027,-2.57988 6.79807,-1.55184 6.79807,3.16543 0,7.95736 -8.06893,14.61611 -12.42857,10.25647 z M 151.5,449.98473 c 30.25,-2.22746 56.4625,-4.28065 58.25,-4.56265 l 3.25,-0.51271 0,-47.95468 0,-47.95469 -4.3185,0 c -10.42955,0 -21.38606,-5.98238 -25.37057,-13.85263 -5.9159,-11.68515 -2.73724,-31.94299 7.06594,-45.03184 3.84114,-5.12854 11.95825,-10.7603 17.58886,-12.20339 L 213,276.6219 213,198.81095 213,121 l 2.49535,0 c 2.64582,0 107.83975,11.64148 113.08984,12.5153 2.89266,0.48144 3.1726,0.24737 4.48583,-3.75091 2.41397,-7.34956 13.86329,-16.72047 20.42898,-16.72047 1.1,0 3.93192,0.87681 6.29315,1.94847 5.73,2.60058 8.73608,8.89126 7.84483,16.41648 -0.33084,2.79344 -1.17223,5.29225 -1.86975,5.55291 -0.69753,0.26067 5.48177,1.20766 13.73177,2.10444 l 15,1.63049 9.5,-9.1382 c 5.225,-5.02601 12.2,-11.47641 15.5,-14.33421 l 6,-5.19601 -100.5,0.0455 c -55.275,0.025 -102.525,0.42145 -105,0.88099 -2.475,0.45953 -8.67946,1.59494 -13.78768,2.52311 -14.45696,2.62687 -37.76472,11.11974 -42.99712,15.66728 C 161.40857,132.71531 159.28672,134 158.5,134 c -0.78672,0 -2.90857,1.24913 -4.7152,2.77585 -1.80664,1.52672 -4.6348,3.43922 -6.2848,4.25 -5.21135,2.56077 -25.72391,23.88502 -31.04885,32.27747 -2.72313,4.29182 -6.02562,9.46562 -7.33885,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 l 2.287391,0.0173 c 1.258064,0.01 27.03739,-1.80513 57.28739,-4.0326 z m 15.82874,-33.38753 c -5.46917,-2.47383 -7.10909,-8.67603 -3.22375,-12.19221 1.66613,-1.50783 3.62991,-1.90499 9.41943,-1.90499 6.36489,0 7.64946,0.31473 9.89502,2.42431 3.2175,3.02269 3.47026,7.96055 0.54309,10.6096 -2.67475,2.42062 -12.27611,3.03437 -16.63379,1.06329 z M 96.571429,393.42857 c -3.402517,-3.40252 -0.689447,-9.8699 5.630501,-13.4219 4.59027,-2.57988 6.79807,-1.55184 6.79807,3.16543 0,7.95736 -8.06893,14.61611 -12.428571,10.25647 z M 136.09391,245.76822 c -4.68597,-1.5781 -9.42621,-6.59625 -10.91041,-11.55008 -3.59421,-11.99643 6.4222,-32.73033 18.81102,-38.93867 10.3862,-5.20478 22.84622,-2.59898 29.18362,6.10324 2.74023,3.76276 2.96737,4.68271 2.63783,10.68364 -0.6514,11.862 -10.32132,26.57968 -21.06462,32.0605 -4.83749,2.4679 -13.84907,3.26069 -18.65744,1.64137 z"
+       id="path3700"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f9ce54"
+       d="m 462.43499,741.25 c -2.51916,-5.3625 -6.18522,-13.2375 -8.1468,-17.5 l -3.56651,-7.75 -84.68569,0 -84.68569,0 -7.42515,2.53548 C 269.84132,719.93 260.875,722.27323 254,723.74266 c -11.49313,2.4565 -14.39292,2.67452 -36,2.70672 -26.30733,0.0392 -32.83689,-0.8331 -53,-7.08034 C 139.80995,711.56428 119.48325,698.67819 99.5,677.8454 70.419728,647.52885 54.077272,610.32194 46.420867,557 45.168185,548.27588 44.652129,534.9771 44.282934,501.90535 l -0.486668,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.03386,457 63.150878,457 L 67,457 67.032719,347.75 c 0.01863,-62.21931 0.434969,-112.04816 0.967126,-115.75 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 1.5873,-11.15642 11.792226,-39.66368 16.466914,-46 1.217305,-1.65 3.507377,-5.25 5.089048,-8 C 101.56568,146.97506 127.31847,121.57214 146,110.72677 c 19.84658,-11.521729 42.37031,-19.286075 66,-22.751418 3.025,-0.443623 60.29644,-0.844559 127.26987,-0.890969 L 461.03974,87 l 4.23013,-2.671135 c 2.32657,-1.469124 12.99009,-7.572948 23.69671,-13.564053 18.2105,-10.190054 19.55421,-10.775866 20.82473,-9.078865 0.74698,0.997729 4.53243,7.101553 8.4121,13.564053 l 7.05394,11.75 8.12133,0.01777 c 8.10499,0.01773 19.28066,1.050187 31.67194,2.925989 6.64303,1.005628 26.76608,7.338166 35.60938,11.205941 2.662,1.16428 8.665,4.61538 13.34,7.66913 4.675,3.05374 10.95556,7.15626 13.95679,9.11671 6.69452,4.37296 31.76576,28.93026 35.68622,34.95468 1.57135,2.41463 5.23958,8.03963 8.15164,12.5 C 677.334,173.8748 683,184.78755 683,186.9718 c 0,0.70296 1.06364,3.80938 2.36364,6.90315 4.75206,11.30906 6.64508,18.98604 9.6476,39.12505 0.451,3.025 0.85552,79.75 0.89893,170.5 l 0.0789,165 -2.499,13 c -3.25048,16.90929 -9.37272,35.14016 -14.95056,44.51994 -2.44648,4.11403 -5.32435,9.32638 -6.39527,11.58299 -1.07091,2.25661 -3.24875,5.63161 -4.83964,7.5 -1.59089,1.86839 -3.73341,4.73039 -4.76115,6.35999 -4.81824,7.63989 -27.27169,28.72691 -39.54349,37.13703 -6.02324,4.12784 -22.41246,12.30662 -33.5,16.71763 -10.29016,4.09378 -28.85825,8.46192 -41.93747,9.86577 -7.92123,0.85023 -9.74836,1.45155 -16.06902,5.28845 -12.17817,7.39265 -29.3158,16.10336 -46.16316,23.46382 C 476.43704,747.82103 468.67798,751 468.08798,751 c -0.58999,0 -3.13384,-4.3875 -5.65299,-9.75 z m 32.83318,-39.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.3412,36.93808 -60.93627,75.62241 -68.44736,117.18665 -2.36855,13.10683 -2.36587,38.14196 0.005,51.5 3.61054,20.33833 12.67251,42.3815 25.28271,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.18282,-10.7417 c -8.99093,-13.44566 -19.95403,-35.64309 -24.47169,-49.54881 -12.4146,-38.21317 -12.19372,-79.40264 0.6363,-118.65912 4.62875,-14.16272 16.94455,-39.5952 25.27757,-52.19888 4.80145,-7.26217 5.56371,-9.0513 5.30996,-12.46313 l -0.29629,-3.98371 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.75626,-6.49045 c 8.65588,-8.16552 17.03015,-12.39516 24.5434,-12.39628 9.90721,-0.001 14.83878,5.003 13.95845,14.16481 l -0.46452,4.8344 16.96019,0 c 14.38761,0 16.87599,-0.21945 16.40502,-1.44678 -0.30535,-0.79573 -11.23936,-24.22533 -24.2978,-52.06579 l -23.74261,-50.619 -3.21815,11.31578 c -1.76998,6.22369 -5.24465,16.04079 -7.72149,21.81579 -10.11122,23.57535 -20.64048,39.0791 -39.22051,57.75 l -13.18551,13.25 16.49204,0 16.49203,0 6.99946,-6.60293 z M 593.12756,675.25 c 1.24387,-1.58606 1.2085,-1.62143 -0.37756,-0.37756 -0.9625,0.75485 -1.75,1.54235 -1.75,1.75 0,0.82304 0.82119,0.29331 2.12756,-1.37244 z m 4.79101,-2.65189 c 0.63991,-0.77103 2.38251,-1.69932 3.87245,-2.06286 1.48994,-0.36353 4.37009,-1.98268 6.40034,-3.59811 2.03025,-1.61543 3.99144,-2.93714 4.35821,-2.93714 1.5682,0 13.85507,-10.65099 20.78566,-18.01826 C 640.1161,638.77364 650,625.4159 650,623.45991 c 0,-0.42412 1.06007,-2.1636 2.35571,-3.86552 6.50851,-8.54936 13.8166,-29.49916 16.66666,-47.77761 1.91051,-12.25279 1.97515,-18.02212 1.90463,-170 C 670.88685,315.29255 670.47422,242.25 670.01004,239.5 c -0.46417,-2.75 -1.37236,-8.15 -2.01819,-12 -1.19639,-7.13203 -6.32548,-23.97436 -8.67928,-28.5 -0.71513,-1.375 -1.30302,-3.20298 -1.30641,-4.06217 -0.008,-2.14858 -3.36837,-8.62694 -6.96933,-13.43783 -1.6467,-2.2 -3.47562,-5.09961 -4.06426,-6.44358 -2.03354,-4.64289 -10.92804,-15.578 -17.68848,-21.74665 -11.80593,-10.77246 -20.74922,-18.27441 -21.80689,-18.29239 -0.56255,-0.01 -3.48755,-1.65745 -6.5,-3.66197 -7.40398,-4.9267 -15.35618,-8.44738 -28.4772,-12.60772 -10.15512,-3.21993 -28.89255,-6.68848 -30.02331,-5.55772 -0.26698,0.26698 15.33343,26.54596 34.66756,58.39773 19.33414,31.85176 35.32644,58.5873 35.53844,59.4123 0.25964,1.01035 -1.99228,2.77421 -6.89861,5.40346 -44.40189,23.79453 -79.06829,47.35634 -87.87781,59.72817 -2.43832,3.42431 -2.05497,5.95076 1.56895,10.3401 1.97781,2.39555 2.34719,2.56516 1.90515,0.8748 -1.31973,-5.04665 9.15911,-18.4761 18.09983,-23.19633 4.43119,-2.33945 6.13374,-2.64611 14.5198,-2.6153 7.7719,0.0286 10.25021,0.42987 13.62421,2.20615 4.62481,2.4348 8.51056,6.64263 11.44391,12.39248 1.08489,2.12656 2.13343,3.86647 2.33008,3.86647 0.19665,0 1.97305,-0.675 3.94756,-1.5 7.43498,-3.10654 17.11504,-1.36532 23.68804,4.26093 5.29649,4.53359 6.9662,8.0074 6.9662,14.49307 0,18.19412 -22.68678,33.0567 -39.92845,26.15795 -3.86889,-1.54802 -4.03516,-1.52663 -6.59667,0.84854 l -2.62775,2.43659 15.88325,15.90146 c 21.47707,21.5017 40.56663,45.47597 50.332,63.21116 1.92921,3.50371 2.75309,4.18652 4.40532,3.65103 1.11776,-0.36227 4.77444,-0.88708 8.12594,-1.16624 9.85947,-0.82124 15.40636,3.5621 15.40636,12.17463 0,4.38571 -4.23577,16.78703 -7.32235,21.43812 l -2.27876,3.43379 2.31457,7.99116 c 5.95315,20.55355 6.70267,26.47812 6.7263,53.16781 0.0208,23.43794 -0.14628,25.78103 -2.67333,37.5 -1.48251,6.875 -3.83914,15.84929 -5.23697,19.94286 l -2.54151,7.44286 2.75603,-2.57067 c 4.26453,-3.97773 7.10181,-5.18793 8.81994,-3.762 3.28039,2.72248 0.32547,12.33023 -4.60355,14.96816 -2.87558,1.53896 -6.67186,0.46317 -7.49277,-2.12331 -0.52622,-1.65795 -1.98346,0.59511 -6.95445,10.75233 -9.84067,20.10742 -21.53594,36.70925 -40.3691,57.30527 -4.04577,4.42448 -6.91337,8.0445 -6.37244,8.0445 0.54092,0 1.50706,-0.63085 2.14696,-1.40189 z M 627.32874,198.5972 c -5.46917,-2.47383 -7.10909,-8.67603 -3.22375,-12.19221 1.66613,-1.50783 3.62991,-1.90499 9.41943,-1.90499 6.36489,0 7.64946,0.31473 9.89502,2.42431 3.2175,3.02269 3.47026,7.96055 0.54309,10.6096 -2.67475,2.42062 -12.27611,3.03437 -16.63379,1.06329 z M 439.39215,552.26557 c 14.36452,-8.4131 28.62395,-21.46594 28.59969,-26.17968 -0.0126,-2.44966 -4.92035,-10.31951 -10.99184,-17.62604 -6.55743,-7.89133 -15.61623,-16.15053 -34.5,-31.45478 -7.7,-6.24042 -16.77628,-13.76762 -20.16952,-16.7271 l -6.16951,-5.38089 -0.43361,50.30146 c -0.34834,40.40966 -0.75394,52.16964 -2.06255,59.80146 -0.89591,5.225 -1.63701,9.81605 -1.64687,10.20234 -0.0251,0.9839 37.80285,-17.33095 47.37421,-22.93677 z m -32.91298,-38.92926 c -3.30341,-3.30341 0.24626,-10.56295 6.84266,-13.99415 2.1953,-1.14191 3.13894,-1.20465 4.25,-0.28254 3.08405,2.55953 0.82033,11.15144 -3.78862,14.37968 -2.87178,2.01147 -5.22273,1.97832 -7.30404,-0.10299 z M 151.5,449.98473 c 30.25,-2.22746 56.4625,-4.28065 58.25,-4.56265 l 3.25,-0.51271 0,-47.81008 0,-47.81008 -6.52627,-0.60943 c -11.40628,-1.06514 -19.53123,-6.03928 -23.60829,-14.45312 -4.17875,-8.62369 -2.65514,-25.87792 3.31921,-37.5886 4.47726,-8.77616 14.89901,-17.2206 23.56535,-19.0943 l 3.25,-0.70267 0,-77.92055 0,-77.92054 2.49535,0 c 2.64582,0 107.83975,11.64148 113.08984,12.5153 2.89266,0.48144 3.1726,0.24737 4.48583,-3.75091 2.41397,-7.34956 13.86329,-16.72047 20.42898,-16.72047 1.1,0 3.93192,0.87681 6.29315,1.94847 5.73,2.60058 8.73608,8.89126 7.84483,16.41648 -0.33084,2.79344 -1.17223,5.29225 -1.86975,5.55291 -0.69753,0.26067 5.48177,1.20766 13.73177,2.10444 l 15,1.63049 9.5,-9.1382 c 5.225,-5.02601 12.2,-11.47641 15.5,-14.33421 l 6,-5.19601 -100.5,0.0455 c -55.275,0.025 -102.525,0.42145 -105,0.88099 -2.475,0.45953 -8.67946,1.59494 -13.78768,2.52311 -14.45696,2.62687 -37.76472,11.11974 -42.99712,15.66728 C 161.40857,132.71531 159.28672,134 158.5,134 c -0.78672,0 -2.90857,1.24913 -4.7152,2.77585 -1.80664,1.52672 -4.6348,3.43922 -6.2848,4.25 -5.21135,2.56077 -25.72391,23.88502 -31.04885,32.27747 -2.72313,4.29182 -6.02562,9.46562 -7.33885,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 l 2.287391,0.0173 c 1.258064,0.01 27.03739,-1.80513 57.28739,-4.0326 z m 15.82874,-33.38753 c -5.46917,-2.47383 -7.10909,-8.67603 -3.22375,-12.19221 1.66613,-1.50783 3.62991,-1.90499 9.41943,-1.90499 6.36489,0 7.64946,0.31473 9.89502,2.42431 3.2175,3.02269 3.47026,7.96055 0.54309,10.6096 -2.67475,2.42062 -12.27611,3.03437 -16.63379,1.06329 z M 96.479167,393.33631 c -3.303406,-3.30341 0.246265,-10.56295 6.842663,-13.99415 2.1953,-1.14191 3.13894,-1.20465 4.25,-0.28254 3.08405,2.55953 0.82033,11.15144 -3.78862,14.37968 -2.87178,2.01147 -5.222733,1.97832 -7.304043,-0.10299 z M 136.95124,245.73163 c -12.82593,-4.45137 -15.98509,-17.81666 -7.96617,-33.70206 3.86111,-7.64881 11.06607,-15.42487 16.25719,-17.5458 9.53653,-3.89635 21.92336,-1.06639 27.53493,6.29076 2.37538,3.11429 2.72281,4.47957 2.72281,10.69985 0,6.10516 -0.48067,8.07707 -3.34394,13.71816 -3.75069,7.38944 -11.68897,15.98576 -17.53366,18.9871 -4.80566,2.46777 -12.96716,3.18457 -17.67116,1.55199 z"
+       id="path3698"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b3b3b3"
+       d="m 462.43499,741.25 c -2.51916,-5.3625 -6.18522,-13.2375 -8.1468,-17.5 l -3.56651,-7.75 -84.68569,0 -84.68569,0 -7.42515,2.53548 C 269.84132,719.93 260.875,722.27323 254,723.74266 c -11.49313,2.4565 -14.39292,2.67452 -36,2.70672 -26.30733,0.0392 -32.83689,-0.8331 -53,-7.08034 C 139.80995,711.56428 119.48325,698.67819 99.5,677.8454 70.419728,647.52885 54.077272,610.32194 46.420867,557 45.168185,548.27588 44.652129,534.9771 44.282934,501.90535 l -0.486668,-43.59466 7.752745,-0.65534 C 55.81302,457.29491 61.03386,457 63.150878,457 L 67,457 67.032719,347.75 c 0.01863,-62.21931 0.434969,-112.04816 0.967126,-115.75 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 1.5873,-11.15642 11.792226,-39.66368 16.466914,-46 1.217305,-1.65 3.507377,-5.25 5.089048,-8 C 101.56568,146.97506 127.31847,121.57214 146,110.72677 c 19.84658,-11.521729 42.37031,-19.286075 66,-22.751418 3.025,-0.443623 60.29644,-0.844559 127.26987,-0.890969 L 461.03974,87 l 4.23013,-2.671135 c 2.32657,-1.469124 12.99009,-7.572948 23.69671,-13.564053 18.2105,-10.190054 19.55421,-10.775866 20.82473,-9.078865 0.74698,0.997729 4.53243,7.101553 8.4121,13.564053 l 7.05394,11.75 8.12133,0.01777 c 8.10499,0.01773 19.28066,1.050187 31.67194,2.925989 6.64303,1.005628 26.76608,7.338166 35.60938,11.205941 2.662,1.16428 8.665,4.61538 13.34,7.66913 4.675,3.05374 10.95556,7.15626 13.95679,9.11671 6.69452,4.37296 31.76576,28.93026 35.68622,34.95468 1.57135,2.41463 5.23958,8.03963 8.15164,12.5 C 677.334,173.8748 683,184.78755 683,186.9718 c 0,0.70296 1.06364,3.80938 2.36364,6.90315 4.75206,11.30906 6.64508,18.98604 9.6476,39.12505 0.451,3.025 0.85552,79.75 0.89893,170.5 l 0.0789,165 -2.499,13 c -3.25048,16.90929 -9.37272,35.14016 -14.95056,44.51994 -2.44648,4.11403 -5.32435,9.32638 -6.39527,11.58299 -1.07091,2.25661 -3.24875,5.63161 -4.83964,7.5 -1.59089,1.86839 -3.73341,4.73039 -4.76115,6.35999 -4.81824,7.63989 -27.27169,28.72691 -39.54349,37.13703 -6.02324,4.12784 -22.41246,12.30662 -33.5,16.71763 -10.29016,4.09378 -28.85825,8.46192 -41.93747,9.86577 -7.92123,0.85023 -9.74836,1.45155 -16.06902,5.28845 -12.17817,7.39265 -29.3158,16.10336 -46.16316,23.46382 C 476.43704,747.82103 468.67798,751 468.08798,751 c -0.58999,0 -3.13384,-4.3875 -5.65299,-9.75 z m 32.83318,-39.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.3412,36.93808 -60.93627,75.62241 -68.44736,117.18665 -2.36855,13.10683 -2.36587,38.14196 0.005,51.5 3.61054,20.33833 12.67251,42.3815 25.28271,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87028,-20.93476 5.34048,-28.42047 5.88342,-93.66546 l 0.51315,-61.66546 -7.18282,-10.7417 c -8.99093,-13.44566 -19.95403,-35.64309 -24.47169,-49.54881 -12.4146,-38.21317 -12.19372,-79.40264 0.6363,-118.65912 4.62875,-14.16272 16.94455,-39.5952 25.27757,-52.19888 4.80145,-7.26217 5.56371,-9.0513 5.30996,-12.46313 l -0.29629,-3.98371 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.75626,-6.49045 c 8.65588,-8.16552 17.03015,-12.39516 24.5434,-12.39628 9.90721,-0.001 14.83878,5.003 13.95845,14.16481 l -0.46452,4.8344 16.96019,0 c 15.5522,0 16.90604,-0.14114 16.3078,-1.70013 -3.83323,-9.98924 -48.14535,-102.19567 -48.41068,-100.73486 -0.19329,1.06425 -2.52186,8.54995 -5.1746,16.6349 -9.55755,29.12927 -22.59535,50.47449 -44.00865,72.05009 l -13.64657,13.75 16.46786,0 16.46786,0 6.99946,-6.60293 z M 593.12756,675.25 c 1.24387,-1.58606 1.2085,-1.62143 -0.37756,-0.37756 -0.9625,0.75485 -1.75,1.54235 -1.75,1.75 0,0.82304 0.82119,0.29331 2.12756,-1.37244 z m 8.40001,-4.33333 c 3.28484,-1.69583 6.90143,-3.94583 8.03688,-5 C 610.6999,664.8625 611.98609,664 612.42266,664 c 1.67881,0 13.73079,-10.38398 20.91257,-18.01826 C 640.1161,638.77364 650,625.4159 650,623.45991 c 0,-0.42412 1.06007,-2.1636 2.35571,-3.86552 6.50851,-8.54936 13.8166,-29.49916 16.66666,-47.77761 1.91051,-12.25279 1.97515,-18.02212 1.90463,-170 C 670.88685,315.29255 670.47422,242.25 670.01004,239.5 c -0.46417,-2.75 -1.36029,-8.15 -1.99136,-12 -1.15131,-7.02375 -6.28539,-23.82233 -8.71033,-28.5 -0.71282,-1.375 -1.2988,-3.29361 -1.30219,-4.26357 -0.008,-2.37354 -2.88893,-7.35126 -14.89386,-25.73643 -6.2076,-9.50674 -28.97573,-30.46703 -38.6123,-35.54639 -2.75,-1.4495 -5.675,-3.21824 -6.5,-3.93053 -5.50151,-4.74992 -31.51574,-13.58505 -45.76894,-15.54437 -5.09792,-0.70078 -9.49552,-1.04759 -9.77243,-0.77067 -0.27692,0.27691 15.32412,26.55589 34.66896,58.39772 19.34484,31.84183 35.33929,58.56924 35.54322,59.39424 0.25853,1.04591 -3.79799,3.75216 -13.40002,8.93961 -40.82777,22.057 -72.76277,44.11198 -81.36452,56.19202 -2.43832,3.42431 -2.05497,5.95076 1.56895,10.3401 1.97781,2.39555 2.34719,2.56516 1.90515,0.8748 -1.31973,-5.04665 9.15911,-18.4761 18.09983,-23.19633 4.43119,-2.33945 6.13374,-2.64611 14.5198,-2.6153 7.7719,0.0286 10.25021,0.42987 13.62421,2.20615 4.62481,2.4348 8.51056,6.64263 11.44391,12.39248 1.08489,2.12656 2.13343,3.86647 2.33008,3.86647 0.19665,0 1.97305,-0.675 3.94756,-1.5 7.43498,-3.10654 17.11504,-1.36532 23.68804,4.26093 5.29649,4.53359 6.9662,8.0074 6.9662,14.49307 0,18.19412 -22.68678,33.0567 -39.92845,26.15795 -3.8909,-1.55683 -4.02321,-1.53771 -6.73025,0.9724 l -2.76133,2.56045 9.89157,9.2776 c 19.91724,18.68097 40.91084,44.02755 53.16089,64.18368 4.95052,8.14555 6.18015,9.55611 7.86757,9.02522 1.1,-0.34609 4.74214,-0.85765 8.09364,-1.13681 9.85947,-0.82124 15.40636,3.5621 15.40636,12.17463 0,4.38571 -4.23577,16.78703 -7.32235,21.43812 l -2.27876,3.43379 2.31457,7.99116 c 5.95315,20.55355 6.70267,26.47812 6.7263,53.16781 0.0208,23.43794 -0.14628,25.78103 -2.67333,37.5 -1.48251,6.875 -3.83914,15.84929 -5.23697,19.94286 l -2.54151,7.44286 2.75603,-2.57067 c 4.26453,-3.97773 7.10181,-5.18793 8.81994,-3.762 3.28039,2.72248 0.32547,12.33023 -4.60355,14.96816 -3.12206,1.67087 -6.81307,0.41386 -7.56343,-2.57581 -0.5557,-2.21409 -1.03669,-1.59671 -3.91573,5.02607 -9.42029,21.66994 -21.60036,39.39286 -44.33419,64.50963 -3.49415,3.8604 -6.18174,7.0189 -5.97243,7.0189 0.20931,0 3.06815,-1.3875 6.35298,-3.08333 z m 25.8603,-472.49757 c -6.21389,-3.06561 -6.96932,-10.30068 -1.37126,-13.1331 4.16457,-2.10714 12.21115,-1.6071 16.07858,0.99917 3.61411,2.43554 4.44725,4.41745 3.47888,8.27574 -1.23908,4.9369 -11.56104,7.12669 -18.1862,3.85819 z M 438.5,552.82342 c 14.87619,-8.67201 29.51591,-21.92788 29.49184,-26.70405 -0.0125,-2.47503 -4.88168,-10.30474 -10.99184,-17.67494 -6.45462,-7.78569 -15.87991,-16.35297 -36.50409,-33.18102 -8.24775,-6.72966 -17.09723,-14.05825 -19.6655,-16.28577 l -4.6696,-4.05003 -0.43353,50.28619 c -0.34826,40.39574 -0.75391,52.15469 -2.06247,59.7862 -0.89591,5.225 -1.63701,9.81605 -1.64687,10.20234 -0.0236,0.92408 37.48916,-17.13654 46.48206,-22.37892 z m -32.02083,-39.48711 c -3.30341,-3.30341 0.24626,-10.56295 6.84266,-13.99415 2.1953,-1.14191 3.13894,-1.20465 4.25,-0.28254 3.08405,2.55953 0.82033,11.15144 -3.78862,14.37968 -2.87178,2.01147 -5.22273,1.97832 -7.30404,-0.10299 z M 151.5,449.98473 c 30.25,-2.22746 56.4625,-4.28065 58.25,-4.56265 l 3.25,-0.51271 0,-47.81008 0,-47.81008 -6.52627,-0.60943 c -11.40628,-1.06514 -19.53123,-6.03928 -23.60829,-14.45312 -4.17875,-8.62369 -2.65514,-25.87792 3.31921,-37.5886 4.47726,-8.77616 14.89901,-17.2206 23.56535,-19.0943 l 3.25,-0.70267 0,-77.92055 0,-77.92054 2.45949,0 c 2.26762,0 104.61524,11.30774 112.54051,12.43388 3.4325,0.48775 3.55336,0.38311 6.26676,-5.42523 2.16207,-4.62818 3.9946,-6.80182 8.38483,-9.9456 7.3069,-5.23235 10.96537,-5.91098 16.75542,-3.10806 6.21391,3.00809 9.09358,8.88286 8.13092,16.58773 -0.37501,3.0015 -1.21196,5.51646 -1.85989,5.5888 -0.64792,0.0723 5.57196,0.90374 13.82196,1.84756 l 15,1.71604 9,-8.63549 c 4.95,-4.74953 11.925,-11.20391 15.5,-14.34307 l 6.5,-5.70757 -100.5,0.0685 c -55.275,0.0377 -102.75,0.45368 -105.5,0.92446 -13.51546,2.31372 -22.46056,4.15638 -27,5.56191 -8.64963,2.67816 -25.92093,9.71833 -27.84199,11.34902 -1.01309,0.85997 -3.78659,2.69387 -6.16333,4.07534 -15.61262,9.07476 -33.2812,25.60585 -42.02035,39.31509 -2.73588,4.29182 -6.0488,9.46562 -7.36203,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 l 2.287391,0.0173 c 1.258064,0.01 27.03739,-1.80513 57.28739,-4.0326 z m 15.88787,-33.56563 c -6.21389,-3.06561 -6.96932,-10.30068 -1.37126,-13.1331 4.16457,-2.10714 12.21115,-1.6071 16.07858,0.99917 3.61411,2.43554 4.44725,4.41745 3.47888,8.27574 -1.23908,4.9369 -11.56104,7.12669 -18.1862,3.85819 z M 96.479167,393.33631 c -3.303406,-3.30341 0.246265,-10.56295 6.842663,-13.99415 2.1953,-1.14191 3.13894,-1.20465 4.25,-0.28254 3.08405,2.55953 0.82033,11.15144 -3.78862,14.37968 -2.87178,2.01147 -5.222733,1.97832 -7.304043,-0.10299 z M 136.95124,245.73163 c -12.82593,-4.45137 -15.98509,-17.81666 -7.96617,-33.70206 3.86111,-7.64881 11.06607,-15.42487 16.25719,-17.5458 9.53653,-3.89635 21.92336,-1.06639 27.53493,6.29076 2.37538,3.11429 2.72281,4.47957 2.72281,10.69985 0,6.10516 -0.48067,8.07707 -3.34394,13.71816 -3.75069,7.38944 -11.68897,15.98576 -17.53366,18.9871 -4.80566,2.46777 -12.96716,3.18457 -17.67116,1.55199 z"
+       id="path3696"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f5cd55"
+       d="m 463.15804,742.75 c -2.10386,-4.5375 -5.76536,-12.4125 -8.13666,-17.5 l -4.31145,-9.25 -84.67981,0 -84.67982,0 -7.42515,2.53466 c -27.35567,9.33816 -66.8298,11.08931 -96.42515,4.2776 -29.63955,-6.82187 -52.39145,-19.64748 -75.01566,-42.2875 C 79.100149,657.12421 64.63787,632.23542 55.112259,599 46.673811,569.55775 44.89847,553.53391 44.293817,501.35509 L 43.79385,458.21018 55.396925,457.48519 67,456.7602 67.032719,347.6301 c 0.01863,-62.14498 0.43502,-111.92862 0.967126,-115.6301 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 C 71.615463,206.65497 80.513569,182.23417 87,171.652 c 1.925,-3.1405 4.943031,-7.83445 6.706735,-10.431 1.763704,-2.59655 4.423858,-6.51465 5.911453,-8.70689 7.304512,-10.7645 34.558372,-35.46732 45.104212,-40.88231 1.77233,-0.91004 4.74445,-2.6875 6.60472,-3.94992 9.87286,-6.6999 41.62577,-17.026521 60.67288,-19.731912 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.823792 c 6.31363,-3.851867 32.52705,-18.53868 38.46426,-21.550693 l 3.19664,-1.621695 8.12591,13.347537 8.1259,13.347538 13.67745,0.597738 c 18.64361,0.814771 26.24282,2.117745 43.17745,7.403291 16.03783,5.005638 23.06599,8.166936 33.5,15.068456 3.85,2.54656 9.45556,6.22795 12.45679,8.18086 6.67648,4.34442 31.75355,28.8978 35.68622,34.94098 11.09868,17.05492 13.69892,21.29722 16.35841,26.68881 1.64922,3.34346 2.99858,6.66219 2.99858,7.37495 0,0.71276 1.08198,3.8272 2.4044,6.92097 4.23427,9.90601 6.7615,20.20435 9.60133,39.12505 0.45403,3.025 0.86348,79.70696 0.90989,170.40435 L 696,568.30871 l -2.53971,13.30478 c -3.09486,16.21307 -9.17001,34.37943 -14.78139,44.20034 -2.29839,4.02261 -5.36906,9.53429 -6.8237,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.29178 -5.8552,7.59704 -4.69656,6.56171 -24.1231,24.88688 -33.5,31.60075 -21.41549,15.33352 -51.24004,26.48272 -79,29.53227 -8.69203,0.95486 -10.1804,1.45127 -17.5,5.83672 -13.53254,8.10785 -28.27238,15.58039 -45.29652,22.96359 C 476.24039,747.81956 468.47412,751 467.9451,751 c -0.52902,0 -2.6832,-3.7125 -4.78706,-8.25 z m 32.11013,-40.84475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.15993,36.76344 -61.1789,76.07616 -68.46403,116.92562 -2.38091,13.35039 -2.39106,38.31217 -0.021,51.76103 3.53285,20.04741 12.75404,42.4396 25.32592,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.86989,-20.93309 5.3405,-28.42295 5.88323,-93.63378 l 0.51296,-61.63377 -7.0837,-10.7256 C 339.81103,382.26423 328.9911,354.27226 324.86444,325 c -1.96032,-13.90543 -1.44093,-41.45699 1.04524,-55.44512 5.05159,-28.42217 16.73189,-57.46784 32.95665,-81.9541 4.48493,-6.7686 5.19111,-8.48089 4.93388,-11.96313 l -0.30021,-4.06392 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.75626,-6.49045 c 8.65588,-8.16552 17.03015,-12.39516 24.5434,-12.39628 9.90721,-0.001 14.83878,5.003 13.95845,14.16481 l -0.46452,4.8344 16.96019,0 c 15.5522,0 16.90604,-0.14114 16.3078,-1.70013 -3.83323,-9.98924 -48.14535,-102.19567 -48.41068,-100.73486 -0.19329,1.06425 -2.52186,8.54995 -5.1746,16.6349 -9.55755,29.12927 -22.59535,50.47449 -44.00865,72.05009 l -13.64657,13.75 16.46786,0 16.46786,0 6.99946,-6.60293 z M 593.12756,675.25 c 1.24387,-1.58606 1.2085,-1.62143 -0.37756,-0.37756 -0.9625,0.75485 -1.75,1.54235 -1.75,1.75 0,0.82304 0.82119,0.29331 2.12756,-1.37244 z m 8.40001,-4.33333 c 3.28484,-1.69583 6.90143,-3.94583 8.03688,-5 C 610.6999,664.8625 611.98609,664 612.42266,664 c 1.67881,0 13.73079,-10.38398 20.91257,-18.01826 C 640.1161,638.77364 650,625.4159 650,623.45991 c 0,-0.42412 1.06007,-2.1636 2.35571,-3.86552 6.50851,-8.54936 13.8166,-29.49916 16.66666,-47.77761 1.91051,-12.25279 1.97515,-18.02212 1.90463,-170 C 670.88685,315.29255 670.47422,242.25 670.01004,239.5 c -0.46417,-2.75 -1.36029,-8.15 -1.99136,-12 -1.15131,-7.02375 -6.28539,-23.82233 -8.71033,-28.5 -0.71282,-1.375 -1.2988,-3.29361 -1.30219,-4.26357 -0.008,-2.37354 -2.88893,-7.35126 -14.89386,-25.73643 -6.2076,-9.50674 -28.97573,-30.46703 -38.6123,-35.54639 -2.75,-1.4495 -5.675,-3.21824 -6.5,-3.93053 -5.50151,-4.74992 -31.51574,-13.58505 -45.76894,-15.54437 -5.09792,-0.70078 -9.49552,-1.04759 -9.77243,-0.77067 -0.27692,0.27691 15.32412,26.55589 34.66896,58.39772 19.34484,31.84183 35.33929,58.56924 35.54322,59.39424 0.25853,1.04591 -3.79799,3.75216 -13.40002,8.93961 -40.82777,22.057 -72.76277,44.11198 -81.36452,56.19202 -2.43832,3.42431 -2.05497,5.95076 1.56895,10.3401 1.97781,2.39555 2.34719,2.56516 1.90515,0.8748 -1.31973,-5.04665 9.15911,-18.4761 18.09983,-23.19633 4.43119,-2.33945 6.13374,-2.64611 14.5198,-2.6153 7.7719,0.0286 10.25021,0.42987 13.62421,2.20615 4.62481,2.4348 8.51056,6.64263 11.44391,12.39248 1.08489,2.12656 2.13343,3.86647 2.33008,3.86647 0.19665,0 1.97305,-0.675 3.94756,-1.5 7.43498,-3.10654 17.11504,-1.36532 23.68804,4.26093 5.29649,4.53359 6.9662,8.0074 6.9662,14.49307 0,18.19412 -22.68678,33.0567 -39.92845,26.15795 -3.8909,-1.55683 -4.02321,-1.53771 -6.73025,0.9724 l -2.76133,2.56045 9.89157,9.2776 c 19.91724,18.68097 40.91084,44.02755 53.16089,64.18368 4.95052,8.14555 6.18015,9.55611 7.86757,9.02522 1.1,-0.34609 4.74214,-0.85765 8.09364,-1.13681 9.85947,-0.82124 15.40636,3.5621 15.40636,12.17463 0,4.38571 -4.23577,16.78703 -7.32235,21.43812 l -2.27876,3.43379 2.31457,7.99116 c 5.95315,20.55355 6.70267,26.47812 6.7263,53.16781 0.0208,23.43794 -0.14628,25.78103 -2.67333,37.5 -1.48251,6.875 -3.83914,15.84929 -5.23697,19.94286 l -2.54151,7.44286 2.75603,-2.57067 c 4.26453,-3.97773 7.10181,-5.18793 8.81994,-3.762 3.28039,2.72248 0.32547,12.33023 -4.60355,14.96816 -3.12206,1.67087 -6.81307,0.41386 -7.56343,-2.57581 -0.5557,-2.21409 -1.03669,-1.59671 -3.91573,5.02607 -9.42029,21.66994 -21.60036,39.39286 -44.33419,64.50963 -3.49415,3.8604 -6.18174,7.0189 -5.97243,7.0189 0.20931,0 3.06815,-1.3875 6.35298,-3.08333 z m 25.8603,-472.49757 c -6.21389,-3.06561 -6.96932,-10.30068 -1.37126,-13.1331 4.16457,-2.10714 12.21115,-1.6071 16.07858,0.99917 3.61411,2.43554 4.44725,4.41745 3.47888,8.27574 -1.23908,4.9369 -11.56104,7.12669 -18.1862,3.85819 z M 438.5,552.82342 c 14.87619,-8.67201 29.51591,-21.92788 29.49184,-26.70405 -0.0125,-2.47503 -4.88168,-10.30474 -10.99184,-17.67494 -6.45462,-7.78569 -15.87991,-16.35297 -36.50409,-33.18102 -8.24775,-6.72966 -17.09723,-14.05825 -19.6655,-16.28577 l -4.6696,-4.05003 -0.43353,50.28619 c -0.34826,40.39574 -0.75391,52.15469 -2.06247,59.7862 -0.89591,5.225 -1.63701,9.81605 -1.64687,10.20234 -0.0236,0.92408 37.48916,-17.13654 46.48206,-22.37892 z m -32.02083,-39.48711 c -3.30341,-3.30341 0.24626,-10.56295 6.84266,-13.99415 2.1953,-1.14191 3.13894,-1.20465 4.25,-0.28254 3.08405,2.55953 0.82033,11.15144 -3.78862,14.37968 -2.87178,2.01147 -5.22273,1.97832 -7.30404,-0.10299 z M 151.5,449.98473 c 30.25,-2.22746 56.4625,-4.28065 58.25,-4.56265 l 3.25,-0.51271 0,-47.81008 0,-47.81008 -6.52627,-0.60943 c -11.40628,-1.06514 -19.53123,-6.03928 -23.60829,-14.45312 -4.17875,-8.62369 -2.65514,-25.87792 3.31921,-37.5886 4.47726,-8.77616 14.89901,-17.2206 23.56535,-19.0943 l 3.25,-0.70267 0,-77.92055 0,-77.92054 2.45949,0 c 2.26762,0 104.61524,11.30774 112.54051,12.43388 3.4325,0.48775 3.55336,0.38311 6.26676,-5.42523 2.16207,-4.62818 3.9946,-6.80182 8.38483,-9.9456 7.3069,-5.23235 10.96537,-5.91098 16.75542,-3.10806 6.21391,3.00809 9.09358,8.88286 8.13092,16.58773 -0.37501,3.0015 -1.21196,5.51646 -1.85989,5.5888 -0.64792,0.0723 5.57196,0.90374 13.82196,1.84756 l 15,1.71604 9,-8.63549 c 4.95,-4.74953 11.925,-11.20391 15.5,-14.34307 l 6.5,-5.70757 -100.5,0.0685 c -55.275,0.0377 -102.75,0.45368 -105.5,0.92446 -13.51546,2.31372 -22.46056,4.15638 -27,5.56191 -8.64963,2.67816 -25.92093,9.71833 -27.84199,11.34902 -1.01309,0.85997 -3.78659,2.69387 -6.16333,4.07534 -15.63846,9.08978 -33.44486,25.73836 -42.04925,39.31509 -2.71999,4.29182 -6.0199,9.46562 -7.33313,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 l 2.287391,0.0173 c 1.258064,0.01 27.03739,-1.80513 57.28739,-4.0326 z m 15.88787,-33.56563 c -6.21389,-3.06561 -6.96932,-10.30068 -1.37126,-13.1331 4.16457,-2.10714 12.21115,-1.6071 16.07858,0.99917 3.61411,2.43554 4.44725,4.41745 3.47888,8.27574 -1.23908,4.9369 -11.56104,7.12669 -18.1862,3.85819 z M 96.479167,393.33631 c -3.303406,-3.30341 0.246265,-10.56295 6.842663,-13.99415 2.1953,-1.14191 3.13894,-1.20465 4.25,-0.28254 3.08405,2.55953 0.82033,11.15144 -3.78862,14.37968 -2.87178,2.01147 -5.222733,1.97832 -7.304043,-0.10299 z M 136.95124,245.73163 c -12.82593,-4.45137 -15.98509,-17.81666 -7.96617,-33.70206 3.86111,-7.64881 11.06607,-15.42487 16.25719,-17.5458 9.53653,-3.89635 21.92336,-1.06639 27.53493,6.29076 2.37538,3.11429 2.72281,4.47957 2.72281,10.69985 0,6.10516 -0.48067,8.07707 -3.34394,13.71816 -3.75069,7.38944 -11.68897,15.98576 -17.53366,18.9871 -4.80566,2.46777 -12.96716,3.18457 -17.67116,1.55199 z"
+       id="path3694"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fccb4b"
+       d="m 463.15804,742.75 c -2.10386,-4.5375 -5.76536,-12.4125 -8.13666,-17.5 l -4.31145,-9.25 -84.67981,0 -84.67982,0 -7.42515,2.53466 c -27.35567,9.33816 -66.8298,11.08931 -96.42515,4.2776 -29.63955,-6.82187 -52.39145,-19.64748 -75.01566,-42.2875 C 79.100149,657.12421 64.63787,632.23542 55.112259,599 46.673811,569.55775 44.89847,553.53391 44.293817,501.35509 L 43.79385,458.21018 55.396925,457.48519 67,456.7602 67.032719,347.6301 c 0.01863,-62.14498 0.43502,-111.92862 0.967126,-115.6301 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 C 71.615463,206.65497 80.513569,182.23417 87,171.652 c 1.925,-3.1405 4.943031,-7.83445 6.706735,-10.431 1.763704,-2.59655 4.423858,-6.51465 5.911453,-8.70689 7.304512,-10.7645 34.558372,-35.46732 45.104212,-40.88231 1.77233,-0.91004 4.74445,-2.6875 6.60472,-3.94992 9.87286,-6.6999 41.62577,-17.026521 60.67288,-19.731912 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.823792 c 6.31363,-3.851867 32.52705,-18.53868 38.46426,-21.550693 l 3.19664,-1.621695 8.12591,13.347537 8.1259,13.347538 13.67745,0.597738 c 18.64361,0.814771 26.24282,2.117745 43.17745,7.403291 16.03783,5.005638 23.06599,8.166936 33.5,15.068456 3.85,2.54656 9.45556,6.22795 12.45679,8.18086 6.67648,4.34442 31.75355,28.8978 35.68622,34.94098 11.09868,17.05492 13.69892,21.29722 16.35841,26.68881 1.64922,3.34346 2.99858,6.66219 2.99858,7.37495 0,0.71276 1.08198,3.8272 2.4044,6.92097 4.23427,9.90601 6.7615,20.20435 9.60133,39.12505 0.45403,3.025 0.86348,79.70696 0.90989,170.40435 L 696,568.30871 l -2.53971,13.30478 c -3.09486,16.21307 -9.17001,34.37943 -14.78139,44.20034 -2.29839,4.02261 -5.36906,9.53429 -6.8237,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.29178 -5.8552,7.59704 -4.69656,6.56171 -24.1231,24.88688 -33.5,31.60075 -21.41549,15.33352 -51.24004,26.48272 -79,29.53227 -8.69203,0.95486 -10.1804,1.45127 -17.5,5.83672 -13.53254,8.10785 -28.27238,15.58039 -45.29652,22.96359 C 476.24039,747.81956 468.47412,751 467.9451,751 c -0.52902,0 -2.6832,-3.7125 -4.78706,-8.25 z m 32.11013,-40.84475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.15993,36.76344 -61.1789,76.07616 -68.46403,116.92562 -2.38091,13.35039 -2.39106,38.31217 -0.021,51.76103 3.53285,20.04741 12.75404,42.4396 25.32592,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.86989,-20.93309 5.3405,-28.42295 5.88323,-93.63378 l 0.51296,-61.63377 -7.0837,-10.7256 C 339.81103,382.26423 328.9911,354.27226 324.86444,325 c -1.96032,-13.90543 -1.44093,-41.45699 1.04524,-55.44512 5.05159,-28.42217 16.73189,-57.46784 32.95665,-81.9541 4.48493,-6.7686 5.19111,-8.48089 4.93388,-11.96313 l -0.30021,-4.06392 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.49233,-6.24148 c 3.70454,-3.49467 9.56864,-7.76967 13.03132,-9.5 14.93346,-7.46233 27.72492,-1.48244 25.57594,11.95654 L 403.97636,691 l 17.01182,0 C 430.34468,691 438,690.74556 438,690.43458 c 0,-0.31098 -10.9087,-23.81121 -24.24156,-52.22274 -14.22901,-30.32119 -24.38971,-50.84251 -24.60027,-49.68458 -0.19729,1.08501 -2.50115,8.49774 -5.11968,16.47274 -10.14915,30.91024 -25.21784,54.72451 -48.67387,76.92324 L 325.77377,691 l 16.74152,0 16.74151,0 6.73553,-6.35396 z m 235.25672,-13.6562 c 3.71198,-1.83165 7.49423,-4.15367 8.40499,-5.16005 C 610.56481,664.8234 611.73892,664 612.2632,664 c 1.81852,0 13.59353,-10.06856 21.07203,-18.01826 C 640.1161,638.77364 650,625.4159 650,623.45991 c 0,-0.42412 1.06007,-2.1636 2.35571,-3.86552 6.50851,-8.54936 13.8166,-29.49916 16.66666,-47.77761 1.91051,-12.25279 1.97515,-18.02212 1.90463,-170 C 670.88685,315.29255 670.47422,242.25 670.01004,239.5 c -0.46417,-2.75 -1.36029,-8.15 -1.99136,-12 -1.15131,-7.02375 -6.28539,-23.82233 -8.71033,-28.5 -0.71282,-1.375 -1.2988,-3.29361 -1.30219,-4.26357 -0.008,-2.37354 -2.88893,-7.35126 -14.89386,-25.73643 -6.2076,-9.50674 -28.97573,-30.46703 -38.6123,-35.54639 -2.75,-1.4495 -5.675,-3.21824 -6.5,-3.93053 -5.50151,-4.74992 -31.51574,-13.58505 -45.76894,-15.54437 -5.09792,-0.70078 -9.5016,-1.0415 -9.78595,-0.75715 -0.28436,0.28435 15.31415,26.56333 34.66334,58.39772 19.34919,31.8344 35.34404,58.55572 35.54412,59.38072 0.25562,1.05407 -5.21277,4.54645 -18.3944,11.74756 -22.26,12.16062 -44.00634,25.66427 -56.62527,35.16217 C 527.16623,285.78769 516,296.98853 516,299.6097 c 0,1.48247 4.66739,9.3903 5.54238,9.3903 0.14871,0 0.0497,-0.84384 -0.21999,-1.8752 -0.69316,-2.65064 3.09866,-9.59154 8.24632,-15.0948 6.09591,-6.51702 13.16471,-10.15864 20.92886,-10.78187 12.70401,-1.01975 22.07532,3.48156 27.58941,13.252 1.70717,3.02493 3.23102,5.49987 3.38635,5.49987 0.15533,0 1.89792,-0.675 3.87243,-1.5 5.26013,-2.19782 12.3249,-1.86667 18.16152,0.85131 5.49031,2.55671 11.09956,8.23403 12.109,12.25595 0.94825,3.77814 -0.20114,12.68927 -2.11378,16.3879 -2.58972,5.00796 -10.0488,11.88545 -15.78919,14.55807 -6.6463,3.09441 -16.50612,3.35646 -21.94556,0.58328 l -3.65513,-1.8635 -2.78607,2.90803 -2.78607,2.90803 8.91332,8.20547 c 19.41007,17.86859 41.874,44.8656 54.17863,65.11154 4.95052,8.14555 6.18015,9.55611 7.86757,9.02522 5.19714,-1.63513 14.23383,-1.6203 17.42241,0.0286 3.47802,1.79855 6.08641,6.64095 6.06421,11.258 -0.0177,3.68762 -5.18582,18.4118 -7.64952,21.79391 l -1.94987,2.67674 3.28584,12.00759 c 5.21628,19.06205 6.62359,31.98267 6.02371,55.30388 -0.55392,21.53433 -2.81095,35.74909 -8.16815,51.44286 l -2.54068,7.44286 2.75603,-2.55901 c 6.11414,-5.67709 10.2592,-5.49172 10.25228,0.45847 -0.0105,9.0243 -11.66244,15.87735 -13.63471,8.0192 -0.59079,-2.35389 -0.82229,-2.12479 -2.84606,2.81665 -8.95672,21.86966 -25.11111,45.49087 -45.36746,66.33705 -5.85642,6.02695 -9.74803,10.26147 -8.64803,9.41005 1.1,-0.85141 5.03707,-3.04665 8.74905,-4.87829 z M 627.38787,198.4191 c -6.21389,-3.06561 -6.96932,-10.30068 -1.37126,-13.1331 4.16457,-2.10714 12.21115,-1.6071 16.07858,0.99917 3.61411,2.43554 4.44725,4.41745 3.47888,8.27574 -1.23908,4.9369 -11.56104,7.12669 -18.1862,3.85819 z M 436.78546,553.77617 c 17.43664,-9.63348 32.23508,-23.57388 30.85634,-29.06723 -2.24208,-8.93313 -19.27481,-27.014 -45.15862,-47.93752 -9.34075,-7.55073 -19.12068,-15.58506 -21.73318,-17.85407 l -4.75,-4.12548 -0.0312,44.85406 c -0.0297,42.70762 -0.60618,54.5085 -3.5231,72.12064 l -0.70663,4.26657 17.88046,-8.56345 c 9.83425,-4.70989 22.05892,-10.87198 27.16592,-13.69352 z m -30.30629,-40.43986 c -3.23146,-3.23146 0.23483,-10.55568 6.55172,-13.8437 3.52944,-1.83712 5.97015,-0.27947 5.96537,3.80708 -0.005,4.12136 -3.28228,9.47836 -6.56182,10.72524 -3.45156,1.31228 -4.02012,1.24653 -5.95527,-0.68862 z M 152,449.97552 c 29.975,-2.21627 55.9625,-4.26282 57.75,-4.54787 l 3.25,-0.51828 0,-47.95468 0,-47.95469 -3.89466,0 c -5.82472,0 -16.12265,-3.54138 -20.26555,-6.96916 -2.01311,-1.66563 -4.66811,-5.11048 -5.9,-7.65521 -4.21943,-8.71618 -2.4209,-27.20902 3.74865,-38.54453 4.62001,-8.48847 14.70263,-16.48429 23.06156,-18.28852 l 3.25,-0.70149 0,-77.92055 0,-77.92054 2.25,4.8e-4 c 2.12492,4.6e-4 105.28143,11.37751 112.75,12.43511 3.43205,0.48601 3.55371,0.38065 6.26676,-5.42694 2.16207,-4.62818 3.9946,-6.80182 8.38483,-9.9456 7.3069,-5.23235 10.96537,-5.91098 16.75542,-3.10806 6.21391,3.00809 9.09358,8.88286 8.13092,16.58773 -0.37501,3.0015 -1.21196,5.51646 -1.85989,5.5888 -0.64792,0.0723 5.57196,0.90374 13.82196,1.84756 l 15,1.71604 9,-8.63549 c 4.95,-4.74953 11.925,-11.20391 15.5,-14.34307 l 6.5,-5.70757 -100.5,0.0685 c -55.275,0.0377 -102.75,0.45368 -105.5,0.92446 -13.51546,2.31372 -22.46056,4.15638 -27,5.56191 -8.64963,2.67816 -25.92093,9.71833 -27.84199,11.34902 -1.01309,0.85997 -3.78659,2.69387 -6.16333,4.07534 -15.63846,9.08978 -33.44486,25.73836 -42.04925,39.31509 -2.71999,4.29182 -6.0199,9.46562 -7.33313,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 94.71261,454.003 C 96.245674,454.004 122.025,452.19224 152,449.97596 z m 15.38787,-33.55642 c -6.21389,-3.06561 -6.96932,-10.30068 -1.37126,-13.1331 4.16457,-2.10714 12.21115,-1.6071 16.07858,0.99917 3.61411,2.43554 4.44725,4.41745 3.47888,8.27574 -1.23908,4.9369 -11.56104,7.12669 -18.1862,3.85819 z M 96.479167,393.33631 c -3.231457,-3.23146 0.234832,-10.55568 6.551723,-13.8437 3.52944,-1.83712 5.97015,-0.27947 5.96537,3.80708 -0.005,4.12136 -3.28228,9.47836 -6.56182,10.72524 -3.451561,1.31228 -4.020119,1.24653 -5.955273,-0.68862 z M 136.63726,245.53519 c -4.57386,-1.63054 -9.02747,-5.64881 -10.67847,-9.63467 -2.10952,-5.09283 -0.82112,-15.715 2.78572,-22.96687 4.13452,-8.3128 10.57969,-15.72196 15.69923,-18.04732 6.13359,-2.78596 14.93716,-2.49747 21.35309,0.69972 7.5649,3.76974 9.70317,7.27668 9.70317,15.91395 0,9.39265 -3.54235,16.68502 -12.427,25.5825 -9.1917,9.20499 -17.16974,11.75592 -26.43574,8.45269 z"
+       id="path3692"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f1ca55"
+       d="m 463.15804,742.75 c -2.10386,-4.5375 -5.76536,-12.4125 -8.13666,-17.5 l -4.31145,-9.25 -84.67981,0 -84.67982,0 -7.42515,2.53466 c -27.35567,9.33816 -66.8298,11.08931 -96.42515,4.2776 -29.63955,-6.82187 -52.39145,-19.64748 -75.01566,-42.2875 C 79.100149,657.12421 64.63787,632.23542 55.112259,599 46.673811,569.55775 44.89847,553.53391 44.293817,501.35509 L 43.79385,458.21018 55.396925,457.48519 67,456.7602 67.032719,347.6301 c 0.01863,-62.14498 0.43502,-111.92862 0.967126,-115.6301 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 C 71.615463,206.65497 80.513569,182.23417 87,171.652 c 1.925,-3.1405 4.943031,-7.83445 6.706735,-10.431 1.763704,-2.59655 4.423858,-6.51465 5.911453,-8.70689 7.304512,-10.7645 34.558372,-35.46732 45.104212,-40.88231 1.77233,-0.91004 4.74445,-2.6875 6.60472,-3.94992 9.87286,-6.6999 41.62577,-17.026521 60.67288,-19.731912 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.823792 c 6.31363,-3.851867 32.52705,-18.53868 38.46426,-21.550693 l 3.19664,-1.621695 8.12591,13.347537 8.1259,13.347538 13.67745,0.597738 c 18.64361,0.814771 26.24282,2.117745 43.17745,7.403291 16.03783,5.005638 23.06599,8.166936 33.5,15.068456 3.85,2.54656 9.45556,6.22795 12.45679,8.18086 6.67648,4.34442 31.75355,28.8978 35.68622,34.94098 11.09868,17.05492 13.69892,21.29722 16.35841,26.68881 1.64922,3.34346 2.99858,6.66219 2.99858,7.37495 0,0.71276 1.08198,3.8272 2.4044,6.92097 4.23427,9.90601 6.7615,20.20435 9.60133,39.12505 0.45403,3.025 0.86348,79.70696 0.90989,170.40435 L 696,568.30871 l -2.53971,13.30478 c -3.09486,16.21307 -9.17001,34.37943 -14.78139,44.20034 -2.29839,4.02261 -5.36906,9.53429 -6.8237,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.29178 -5.8552,7.59704 -4.69656,6.56171 -24.1231,24.88688 -33.5,31.60075 -21.41549,15.33352 -51.24004,26.48272 -79,29.53227 -8.69203,0.95486 -10.1804,1.45127 -17.5,5.83672 -13.53254,8.10785 -28.27238,15.58039 -45.29652,22.96359 C 476.24039,747.81956 468.47412,751 467.9451,751 c -0.52902,0 -2.6832,-3.7125 -4.78706,-8.25 z m 32.11013,-40.84475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.15993,36.76344 -61.1789,76.07616 -68.46403,116.92562 -2.38091,13.35039 -2.39106,38.31217 -0.021,51.76103 3.53285,20.04741 12.75404,42.4396 25.32592,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.86989,-20.93309 5.3405,-28.42295 5.88323,-93.63378 l 0.51296,-61.63377 -7.0837,-10.7256 C 339.81103,382.26423 328.9911,354.27226 324.86444,325 c -1.96032,-13.90543 -1.44093,-41.45699 1.04524,-55.44512 5.05159,-28.42217 16.73189,-57.46784 32.95665,-81.9541 4.48493,-6.7686 5.19111,-8.48089 4.93388,-11.96313 l -0.30021,-4.06392 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.49233,-6.24148 c 3.70454,-3.49467 9.56864,-7.76967 13.03132,-9.5 14.93346,-7.46233 27.72492,-1.48244 25.57594,11.95654 L 403.97636,691 l 17.01182,0 C 430.34468,691 438,690.74556 438,690.43458 c 0,-0.31098 -10.9087,-23.81121 -24.24156,-52.22274 -14.22901,-30.32119 -24.38971,-50.84251 -24.60027,-49.68458 -0.19729,1.08501 -2.50115,8.49774 -5.11968,16.47274 -10.14915,30.91024 -25.21784,54.72451 -48.67387,76.92324 L 325.77377,691 l 16.74152,0 16.74151,0 6.73553,-6.35396 z m 235.25672,-13.6562 c 3.71198,-1.83165 7.49423,-4.15367 8.40499,-5.16005 C 610.56481,664.8234 611.73892,664 612.2632,664 c 1.81852,0 13.59353,-10.06856 21.07203,-18.01826 C 640.1161,638.77364 650,625.4159 650,623.45991 c 0,-0.42412 1.06007,-2.1636 2.35571,-3.86552 6.50851,-8.54936 13.8166,-29.49916 16.66666,-47.77761 1.91051,-12.25279 1.97515,-18.02212 1.90463,-170 C 670.88685,315.29255 670.47422,242.25 670.01004,239.5 c -0.46417,-2.75 -1.36029,-8.15 -1.99136,-12 -1.15131,-7.02375 -6.28539,-23.82233 -8.71033,-28.5 -0.71282,-1.375 -1.2988,-3.29361 -1.30219,-4.26357 -0.008,-2.37354 -2.88893,-7.35126 -14.89386,-25.73643 -6.2076,-9.50674 -28.97573,-30.46703 -38.6123,-35.54639 -2.75,-1.4495 -5.675,-3.21824 -6.5,-3.93053 -5.50151,-4.74992 -31.51574,-13.58505 -45.76894,-15.54437 -5.09792,-0.70078 -9.5016,-1.0415 -9.78595,-0.75715 -0.28436,0.28435 15.31415,26.56333 34.66334,58.39772 19.34919,31.8344 35.34404,58.55572 35.54412,59.38072 0.25562,1.05407 -5.21277,4.54645 -18.3944,11.74756 -22.26,12.16062 -44.00634,25.66427 -56.62527,35.16217 C 527.16623,285.78769 516,296.98853 516,299.6097 c 0,1.48247 4.66739,9.3903 5.54238,9.3903 0.14871,0 0.0497,-0.84384 -0.21999,-1.8752 -0.69316,-2.65064 3.09866,-9.59154 8.24632,-15.0948 6.09591,-6.51702 13.16471,-10.15864 20.92886,-10.78187 12.70401,-1.01975 22.07532,3.48156 27.58941,13.252 1.70717,3.02493 3.23102,5.49987 3.38635,5.49987 0.15533,0 1.89792,-0.675 3.87243,-1.5 5.26013,-2.19782 12.3249,-1.86667 18.16152,0.85131 5.49031,2.55671 11.09956,8.23403 12.109,12.25595 0.94825,3.77814 -0.20114,12.68927 -2.11378,16.3879 -2.58972,5.00796 -10.0488,11.88545 -15.78919,14.55807 -6.6463,3.09441 -16.50612,3.35646 -21.94556,0.58328 l -3.65513,-1.8635 -2.78607,2.90803 -2.78607,2.90803 8.91332,8.20547 c 19.41007,17.86859 41.874,44.8656 54.17863,65.11154 4.95052,8.14555 6.18015,9.55611 7.86757,9.02522 5.19714,-1.63513 14.23383,-1.6203 17.42241,0.0286 3.47802,1.79855 6.08641,6.64095 6.06421,11.258 -0.0177,3.68762 -5.18582,18.4118 -7.64952,21.79391 l -1.94987,2.67674 3.28584,12.00759 c 5.21628,19.06205 6.62359,31.98267 6.02371,55.30388 -0.55392,21.53433 -2.81095,35.74909 -8.16815,51.44286 l -2.54068,7.44286 2.75603,-2.55901 c 6.11414,-5.67709 10.2592,-5.49172 10.25228,0.45847 -0.0105,9.0243 -11.66244,15.87735 -13.63471,8.0192 -0.59079,-2.35389 -0.82229,-2.12479 -2.84606,2.81665 -8.95672,21.86966 -25.11111,45.49087 -45.36746,66.33705 -5.85642,6.02695 -9.74803,10.26147 -8.64803,9.41005 1.1,-0.85141 5.03707,-3.04665 8.74905,-4.87829 z m 28.16962,-472.01377 c -6.02369,-1.84902 -8.61114,-7.19037 -5.43757,-11.22491 3.87828,-4.93044 16.92263,-4.58209 20.5158,0.54787 2.08245,2.97312 1.88235,5.15738 -0.7469,8.15279 -2.56669,2.92414 -9.21419,4.09499 -14.33133,2.52425 z m -192.63321,354.8001 c 17.43664,-9.63348 32.23508,-23.57388 30.85634,-29.06723 -2.24208,-8.93313 -19.27481,-27.014 -45.15862,-47.93752 -9.34075,-7.55073 -19.12068,-15.58506 -21.73318,-17.85407 l -4.75,-4.12548 -0.0312,44.85406 c -0.0297,42.70762 -0.60618,54.5085 -3.5231,72.12064 l -0.70663,4.26657 17.88046,-8.56345 c 9.83425,-4.70989 22.05892,-10.87198 27.16592,-13.69352 z m -30.30629,-40.43986 c -3.23146,-3.23146 0.23483,-10.55568 6.55172,-13.8437 3.52944,-1.83712 5.97015,-0.27947 5.96537,3.80708 -0.005,4.12136 -3.28228,9.47836 -6.56182,10.72524 -3.45156,1.31228 -4.02012,1.24653 -5.95527,-0.68862 z M 152,449.97552 c 29.975,-2.21627 55.9625,-4.26282 57.75,-4.54787 l 3.25,-0.51828 0,-47.95468 0,-47.95469 -3.89466,0 c -5.82472,0 -16.12265,-3.54138 -20.26555,-6.96916 -2.01311,-1.66563 -4.66811,-5.11048 -5.9,-7.65521 -4.21943,-8.71618 -2.4209,-27.20902 3.74865,-38.54453 4.62001,-8.48847 14.70263,-16.48429 23.06156,-18.28852 l 3.25,-0.70149 0,-77.92055 0,-77.92054 2.75,0.0312 c 1.5125,0.0171 28.17113,2.90157 59.24139,6.40983 31.07027,3.50827 56.79815,6.18908 57.17307,5.95737 0.37491,-0.23171 0.95933,-1.68549 1.2987,-3.23063 0.84774,-3.85971 6.01517,-9.88094 11.42321,-13.31062 7.54362,-4.78402 16.02143,-3.33638 20.15411,3.44144 2.29767,3.7683 2.78632,15.05298 0.70952,16.38536 -0.70736,0.4538 5.26173,1.49853 13.75,2.40657 l 15,1.60464 9,-8.63549 c 4.95,-4.74953 11.925,-11.20391 15.5,-14.34307 l 6.5,-5.70757 -100.5,0.0685 c -55.275,0.0377 -102.75,0.45368 -105.5,0.92446 -13.51546,2.31372 -22.46056,4.15638 -27,5.56191 -8.64963,2.67816 -25.92093,9.71833 -27.84199,11.34902 -1.01309,0.85997 -3.78659,2.69387 -6.16333,4.07534 -15.63846,9.08978 -33.44486,25.73836 -42.04925,39.31509 -2.71999,4.29182 -6.0199,9.46562 -7.33313,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 94.71261,454.003 C 96.245674,454.004 122.025,452.19224 152,449.97596 z m 17.41867,-32.99945 c -6.02369,-1.84902 -8.61114,-7.19037 -5.43757,-11.22491 3.87828,-4.93044 16.92263,-4.58209 20.5158,0.54787 2.08245,2.97312 1.88235,5.15738 -0.7469,8.15279 -2.56669,2.92414 -9.21419,4.09499 -14.33133,2.52425 z M 96.479167,393.33631 c -3.231457,-3.23146 0.234832,-10.55568 6.551723,-13.8437 3.52944,-1.83712 5.97015,-0.27947 5.96537,3.80708 -0.005,4.12136 -3.28228,9.47836 -6.56182,10.72524 -3.451561,1.31228 -4.020119,1.24653 -5.955273,-0.68862 z M 136.63726,245.53519 c -4.57386,-1.63054 -9.02747,-5.64881 -10.67847,-9.63467 -2.10952,-5.09283 -0.82112,-15.715 2.78572,-22.96687 4.13452,-8.3128 10.57969,-15.72196 15.69923,-18.04732 6.13359,-2.78596 14.93716,-2.49747 21.35309,0.69972 7.5649,3.76974 9.70317,7.27668 9.70317,15.91395 0,9.39265 -3.54235,16.68502 -12.427,25.5825 -9.1917,9.20499 -17.16974,11.75592 -26.43574,8.45269 z"
+       id="path3690"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f1c853"
+       d="m 463.15804,742.75 c -2.10386,-4.5375 -5.76536,-12.4125 -8.13666,-17.5 l -4.31145,-9.25 -84.67981,0 -84.67982,0 -7.42515,2.53466 c -27.35567,9.33816 -66.8298,11.08931 -96.42515,4.2776 -29.63955,-6.82187 -52.39145,-19.64748 -75.01566,-42.2875 C 79.100149,657.12421 64.63787,632.23542 55.112259,599 46.673811,569.55775 44.89847,553.53391 44.293817,501.35509 L 43.79385,458.21018 55.396925,457.48519 67,456.7602 67.032719,347.6301 c 0.01863,-62.14498 0.43502,-111.92862 0.967126,-115.6301 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 C 71.615463,206.65497 80.513569,182.23417 87,171.652 c 1.925,-3.1405 4.943031,-7.83445 6.706735,-10.431 1.763704,-2.59655 4.423858,-6.51465 5.911453,-8.70689 7.304512,-10.7645 34.558372,-35.46732 45.104212,-40.88231 1.77233,-0.91004 4.74445,-2.6875 6.60472,-3.94992 9.87286,-6.6999 41.62577,-17.026521 60.67288,-19.731912 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.823792 c 6.31363,-3.851867 32.52705,-18.53868 38.46426,-21.550693 l 3.19664,-1.621695 8.12591,13.347537 8.1259,13.347538 13.67745,0.597738 c 18.64361,0.814771 26.24282,2.117745 43.17745,7.403291 16.03783,5.005638 23.06599,8.166936 33.5,15.068456 3.85,2.54656 9.45556,6.22795 12.45679,8.18086 6.67648,4.34442 31.75355,28.8978 35.68622,34.94098 11.09868,17.05492 13.69892,21.29722 16.35841,26.68881 1.64922,3.34346 2.99858,6.66219 2.99858,7.37495 0,0.71276 1.08198,3.8272 2.4044,6.92097 4.23427,9.90601 6.7615,20.20435 9.60133,39.12505 0.45403,3.025 0.86348,79.70696 0.90989,170.40435 L 696,568.30871 l -2.53971,13.30478 c -3.09486,16.21307 -9.17001,34.37943 -14.78139,44.20034 -2.29839,4.02261 -5.36906,9.53429 -6.8237,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.29178 -5.8552,7.59704 -4.69656,6.56171 -24.1231,24.88688 -33.5,31.60075 -21.41549,15.33352 -51.24004,26.48272 -79,29.53227 -8.69203,0.95486 -10.1804,1.45127 -17.5,5.83672 -13.53254,8.10785 -28.27238,15.58039 -45.29652,22.96359 C 476.24039,747.81956 468.47412,751 467.9451,751 c -0.52902,0 -2.6832,-3.7125 -4.78706,-8.25 z m 32.11013,-40.84475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.15993,36.76344 -61.1789,76.07616 -68.46403,116.92562 -2.38091,13.35039 -2.39106,38.31217 -0.021,51.76103 3.53285,20.04741 12.75404,42.4396 25.32592,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.86989,-20.93309 5.3405,-28.42295 5.88323,-93.63378 l 0.51296,-61.63377 -7.0837,-10.7256 C 339.81103,382.26423 328.9911,354.27226 324.86444,325 c -1.96032,-13.90543 -1.44093,-41.45699 1.04524,-55.44512 5.05159,-28.42217 16.73189,-57.46784 32.95665,-81.9541 4.48493,-6.7686 5.19111,-8.48089 4.93388,-11.96313 l -0.30021,-4.06392 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.49233,-6.24148 c 3.70454,-3.49467 9.56864,-7.76967 13.03132,-9.5 14.93346,-7.46233 27.72492,-1.48244 25.57594,11.95654 L 403.97636,691 l 17.01182,0 C 430.34468,691 438,690.72869 438,690.39709 c 0,-0.3316 -10.90976,-23.82632 -24.24392,-52.21048 -14.34585,-30.53775 -24.39604,-50.80716 -24.61653,-49.64709 -1.59493,8.39148 -10.38417,31.8642 -16.23652,43.36155 -9.38539,18.43827 -17.94218,30.13295 -33.54686,45.84893 L 326.2,691 l 16.5284,0 16.5284,0 6.73553,-6.35396 z m 237.28108,-14.64347 c 2.45874,-0.008 17.71862,-11.97265 26.77721,-20.99461 C 639.05728,640.03772 650,626.02399 650,623.45991 c 0,-0.42412 1.06116,-2.1636 2.35812,-3.86552 6.58733,-8.64406 13.78239,-29.2862 16.70818,-47.93466 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36066,-8.15 -1.9922,-12 -0.98312,-5.99327 -3.39268,-14.06837 -9.10103,-30.5 -2.64584,-7.61613 -3.57166,-9.25661 -15.80203,-28 -6.50372,-9.96714 -28.50334,-30.19393 -38.6924,-35.5744 -2.70731,-1.42963 -5.82238,-3.38129 -6.92238,-4.33702 -5.16364,-4.48643 -31.16034,-13.1616 -45.26894,-15.10637 -5.09792,-0.70271 -9.50051,-1.04609 -9.78354,-0.76307 -0.28302,0.28303 15.3113,26.562 34.65404,58.39773 19.34275,31.83572 35.34395,58.55813 35.55823,59.38313 0.27429,1.05601 -3.9671,3.84677 -14.32928,9.42844 -19.58012,10.54697 -43.3236,24.95015 -55.71984,33.80055 -11.86377,8.47025 -25.39921,21.08029 -26.24516,24.45083 -0.41638,1.659 0.23552,3.57996 2.15475,6.34941 3.11573,4.496 3.50356,4.77787 2.78305,2.02264 -0.7588,-2.90168 5.03646,-12.27293 10.78701,-17.44317 8.69198,-7.81483 20.33665,-10.49123 31.29584,-7.193 6.52322,1.9632 11.14637,5.78629 14.77736,12.22004 2.32925,4.1272 3.49304,5.31545 4.71458,4.81364 10.30872,-4.23487 21.2906,-2.21408 28.30828,5.20904 9.43075,9.9756 4.52128,26.92323 -10.46537,36.12673 -5.02201,3.08407 -6.79037,3.60202 -13.5,3.95408 -6.24199,0.32753 -8.42857,0.0343 -11.4147,-1.53054 l -3.69369,-1.93568 -2.78607,2.90803 -2.78607,2.90803 8.91332,8.20547 c 19.41007,17.86859 41.874,44.8656 54.17863,65.11154 4.95052,8.14555 6.18015,9.55611 7.86757,9.02522 5.19714,-1.63513 14.23383,-1.6203 17.42241,0.0286 3.42206,1.76962 6.07759,6.61162 6.07759,11.08168 0,3.63129 -4.53607,16.77141 -7.29384,21.12886 l -2.29105,3.62 3.2719,11.95665 c 5.20215,19.01043 6.60925,31.94714 6.00977,55.25293 -0.55392,21.53433 -2.81095,35.74909 -8.16815,51.44286 l -2.54068,7.44286 2.75603,-2.55901 C 658.9037,583.1073 663,583.3312 663,589.3873 c 0,7.19937 -7.91869,13.80624 -12.05786,10.06033 -1.06818,-0.96668 -1.96116,-2.47536 -1.98441,-3.35262 -0.0232,-0.87725 -1.07793,0.87999 -2.34373,3.90499 -9.49796,22.69805 -25.45739,45.98068 -45.46597,66.32863 L 590.5,677.15727 l 6,-3.57607 c 3.3,-1.96683 6.34803,-3.57722 6.77341,-3.57863 z m 26.14526,-471.0265 c -6.02369,-1.84902 -8.61114,-7.19037 -5.43757,-11.22491 3.87828,-4.93044 16.92263,-4.58209 20.5158,0.54787 2.08245,2.97312 1.88235,5.15738 -0.7469,8.15279 -2.56669,2.92414 -9.21419,4.09499 -14.33133,2.52425 z M 432.09829,556.34924 C 449.48581,547.33207 468,531.87224 468,526.37036 c 0,-5.03581 -12.07827,-20.66309 -24.78815,-32.07176 -4.81,-4.31756 -15.26289,-13.1135 -23.22865,-19.54654 -7.96576,-6.43304 -16.6207,-13.55578 -19.2332,-15.82831 l -4.75,-4.13188 -0.0312,44.85406 c -0.0297,42.69444 -0.60668,54.51389 -3.51967,72.09918 l -0.70319,4.24511 14.87702,-7.07235 c 8.18237,-3.8898 19.64626,-9.54568 25.47532,-12.56863 z m -25.53751,-43.28208 c -2.30591,-2.548 -1.34726,-6.9623 2.23781,-10.30443 3.96725,-3.69842 6.45173,-4.76177 8.47723,-3.62825 3.95631,2.21406 0.49437,12.8618 -4.84138,14.89045 -3.48409,1.32464 -3.8642,1.26266 -5.87366,-0.95777 z M 152,449.98462 c 29.975,-2.21827 55.9625,-4.26768 57.75,-4.55423 l 3.25,-0.52102 0,-47.95468 0,-47.95469 -3.8185,0 c -9.44976,0 -21.06069,-5.83238 -25.31516,-12.71627 -1.89262,-3.06231 -2.38418,-5.48802 -2.69863,-13.31669 -0.65055,-16.197 3.86621,-28.31677 13.92261,-37.35834 C 199.34337,281.78484 208.76287,277 212.03751,277 212.64594,277 213,248.30665 213,199 l 0,-78 2.25,0.009 c 1.2375,0.005 27.89806,2.88812 59.24568,6.40717 31.34763,3.51906 57.30051,6.20989 57.67307,5.97964 0.37256,-0.23025 0.95504,-1.68284 1.29441,-3.22798 0.84774,-3.85971 6.01517,-9.88094 11.42321,-13.31062 7.54362,-4.78402 16.02143,-3.33638 20.15411,3.44144 2.29767,3.7683 2.78632,15.05298 0.70952,16.38536 -0.70733,0.45379 5.262,1.49819 13.75,2.40571 l 15,1.60377 8.5,-8.13123 c 4.675,-4.47217 11.64375,-10.92819 15.48612,-14.34669 L 425.47224,112 324.98612,112.073 C 269.71875,112.1132 222.25,112.53118 219.5,113.00196 c -13.51546,2.31372 -22.46056,4.15638 -27,5.56191 -8.64963,2.67816 -25.92093,9.71833 -27.84199,11.34902 -1.01309,0.85997 -3.78659,2.69387 -6.16333,4.07534 -15.63846,9.08978 -33.44486,25.73836 -42.04925,39.31509 -2.71999,4.29182 -6.0199,9.46562 -7.33313,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 94.71261,454.009 C 96.245674,454.014 122.025,452.20297 152,449.9847 z m 17.41867,-33.00855 c -6.02369,-1.84902 -8.61114,-7.19037 -5.43757,-11.22491 3.87828,-4.93044 16.92263,-4.58209 20.5158,0.54787 2.08245,2.97312 1.88235,5.15738 -0.7469,8.15279 -2.56669,2.92414 -9.21419,4.09499 -14.33133,2.52425 z M 96.560781,393.06716 c -2.305914,-2.548 -1.347264,-6.9623 2.237806,-10.30443 3.967253,-3.69842 6.451733,-4.76177 8.477233,-3.62825 3.95631,2.21406 0.49437,12.8618 -4.84138,14.89045 -3.484089,1.32464 -3.864196,1.26266 -5.873659,-0.95777 z M 136.63726,245.53519 c -4.57386,-1.63054 -9.02747,-5.64881 -10.67847,-9.63467 -2.10952,-5.09283 -0.82112,-15.715 2.78572,-22.96687 4.13452,-8.3128 10.57969,-15.72196 15.69923,-18.04732 10.14462,-4.60782 24.12875,-0.8847 29.20377,7.77517 2.25652,3.85046 2.54626,5.26495 2.09587,10.23195 -0.76799,8.46946 -4.96383,16.4742 -12.71519,24.25775 -5.28447,5.30641 -7.71221,6.97445 -12.00744,8.25 -6.47621,1.92323 -9.29089,1.94945 -14.38349,0.13399 z"
+       id="path3688"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#eec955"
+       d="m 463.15804,742.75 c -2.10386,-4.5375 -5.76536,-12.4125 -8.13666,-17.5 l -4.31145,-9.25 -84.67981,0 -84.67982,0 -7.42515,2.53466 c -27.35567,9.33816 -66.8298,11.08931 -96.42515,4.2776 -29.63955,-6.82187 -52.39145,-19.64748 -75.01566,-42.2875 C 79.100149,657.12421 64.63787,632.23542 55.112259,599 46.673811,569.55775 44.89847,553.53391 44.293817,501.35509 L 43.79385,458.21018 55.396925,457.48519 67,456.7602 67.032719,347.6301 c 0.01863,-62.14498 0.43502,-111.92862 0.967126,-115.6301 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 C 71.615463,206.65497 80.513569,182.23417 87,171.652 c 1.925,-3.1405 4.943031,-7.83445 6.706735,-10.431 1.763704,-2.59655 4.423858,-6.51465 5.911453,-8.70689 7.304512,-10.7645 34.558372,-35.46732 45.104212,-40.88231 1.77233,-0.91004 4.74445,-2.6875 6.60472,-3.94992 9.87286,-6.6999 41.62577,-17.026521 60.67288,-19.731912 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.823792 c 6.31363,-3.851867 32.52705,-18.53868 38.46426,-21.550693 l 3.19664,-1.621695 8.12591,13.347537 8.1259,13.347538 13.67745,0.597738 c 18.64361,0.814771 26.24282,2.117745 43.17745,7.403291 16.03783,5.005638 23.06599,8.166936 33.5,15.068456 3.85,2.54656 9.45556,6.22795 12.45679,8.18086 6.67648,4.34442 31.75355,28.8978 35.68622,34.94098 11.09868,17.05492 13.69892,21.29722 16.35841,26.68881 1.64922,3.34346 2.99858,6.66219 2.99858,7.37495 0,0.71276 1.08198,3.8272 2.4044,6.92097 4.23427,9.90601 6.7615,20.20435 9.60133,39.12505 0.45403,3.025 0.86348,79.70696 0.90989,170.40435 L 696,568.30871 l -2.53971,13.30478 c -3.09486,16.21307 -9.17001,34.37943 -14.78139,44.20034 -2.29839,4.02261 -5.36906,9.53429 -6.8237,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.29178 -5.8552,7.59704 -4.69656,6.56171 -24.1231,24.88688 -33.5,31.60075 -21.41549,15.33352 -51.24004,26.48272 -79,29.53227 -8.69203,0.95486 -10.1804,1.45127 -17.5,5.83672 -13.53254,8.10785 -28.27238,15.58039 -45.29652,22.96359 C 476.24039,747.81956 468.47412,751 467.9451,751 c -0.52902,0 -2.6832,-3.7125 -4.78706,-8.25 z m 32.11013,-40.84475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.15993,36.76344 -61.1789,76.07616 -68.46403,116.92562 -2.38091,13.35039 -2.39106,38.31217 -0.021,51.76103 3.53285,20.04741 12.75404,42.4396 25.32592,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.86989,-20.93309 5.3405,-28.42295 5.88323,-93.63378 l 0.51296,-61.63377 -7.0837,-10.7256 C 339.81103,382.26423 328.9911,354.27226 324.86444,325 c -1.96032,-13.90543 -1.44093,-41.45699 1.04524,-55.44512 5.05159,-28.42217 16.73189,-57.46784 32.95665,-81.9541 4.48493,-6.7686 5.19111,-8.48089 4.93388,-11.96313 l -0.30021,-4.06392 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.49233,-6.24148 c 3.70454,-3.49467 9.56864,-7.76967 13.03132,-9.5 14.93346,-7.46233 27.72492,-1.48244 25.57594,11.95654 L 403.97636,691 l 17.01182,0 C 430.34468,691 438,690.72981 438,690.39957 438,689.67933 394.79149,597.44101 391.43684,591 c -1.34544,-2.58329 -2.36355,-3.72786 -2.39028,-2.6872 -0.12102,4.71162 -10.78929,33.34794 -16.64793,44.6872 -9.0819,17.57781 -17.84013,29.43924 -33.04246,44.75 L 326.2,691 l 16.5284,0 16.5284,0 6.73553,-6.35396 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36066,-8.15 -1.9922,-12 -0.98207,-5.98692 -3.73851,-15.20928 -9.11603,-30.5 -2.35437,-6.69454 -4.0188,-10.03471 -7.9486,-15.95113 C 648.77895,177.77545 647,174.84597 647,174.53893 c 0,-0.30705 -2.44422,-3.81641 -5.43159,-7.7986 -8.45118,-11.26544 -28.64577,-29.26886 -38.24764,-34.09766 -2.84858,-1.43255 -5.44468,-3.03415 -5.76912,-3.5591 -2.04877,-3.31497 -31.87924,-13.25714 -45.32059,-15.10486 -5.09792,-0.70078 -9.5047,-1.03841 -9.79283,-0.75027 -0.28814,0.28813 15.47039,26.875 35.01894,59.08193 19.54856,32.20693 35.53043,58.92516 35.51528,59.37384 -0.0151,0.44869 -5.50948,3.74079 -12.20961,7.31579 -17.56955,9.37462 -46.32676,26.78614 -57.96962,35.09866 -10.98368,7.84189 -23.08787,18.74304 -25.88528,23.31253 -1.76475,2.88267 -1.75296,2.95372 1.20296,7.25 3.30465,4.80314 3.94958,5.28611 3.19241,2.39068 -0.7588,-2.90168 5.03646,-12.27293 10.78701,-17.44317 8.69198,-7.81483 20.33665,-10.49123 31.29584,-7.193 6.52322,1.9632 11.14637,5.78629 14.77736,12.22004 2.32925,4.1272 3.49304,5.31545 4.71458,4.81364 10.30872,-4.23487 21.2906,-2.21408 28.30828,5.20904 9.43075,9.9756 4.52128,26.92323 -10.46537,36.12673 -5.02201,3.08407 -6.79037,3.60202 -13.5,3.95408 -6.24199,0.32753 -8.42857,0.0343 -11.4147,-1.53054 l -3.69369,-1.93568 -2.77653,2.89807 -2.77653,2.89808 10.75892,10.08358 c 19.54861,18.32157 41.56625,45.11684 53.52639,65.14113 3.90083,6.53098 4.9792,7.68971 6.65513,7.15103 5.12417,-1.64702 14.22359,-1.6392 17.42241,0.015 3.42206,1.76962 6.07759,6.61162 6.07759,11.08168 0,3.65081 -4.54202,16.78081 -7.32736,21.18182 l -2.32457,3.67297 2.34228,8.05182 c 5.7298,19.69683 6.81295,28.35375 6.76295,54.05183 -0.043,22.11044 -0.25674,24.98415 -2.71452,36.5 -1.4673,6.875 -3.81149,15.84929 -5.20932,19.94286 l -2.54151,7.44286 2.75603,-2.55901 C 658.9037,583.1073 663,583.3312 663,589.3873 c 0,7.19937 -7.91869,13.80624 -12.05786,10.06033 -1.06818,-0.96668 -1.94432,-2.47536 -1.94698,-3.35262 -0.003,-0.87725 -1.93393,2.67999 -4.2917,7.90499 -9.68554,21.46391 -24.1723,42.28962 -42.68655,61.36483 l -11.51591,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z m 25.977,-471.02393 c -6.02369,-1.84902 -8.61114,-7.19037 -5.43757,-11.22491 3.87828,-4.93044 16.92263,-4.58209 20.5158,0.54787 2.08245,2.97312 1.88235,5.15738 -0.7469,8.15279 -2.56669,2.92414 -9.21419,4.09499 -14.33133,2.52425 z M 430,557.40663 c 6.875,-3.53675 16.40444,-9.32151 21.17654,-12.85502 C 459.6641,538.26697 468,529.25829 468,526.37036 468,521.33682 455.73185,505.46097 443.13724,494.19621 438.38676,489.94732 427.75,480.96503 419.5,474.23555 c -8.25,-6.72947 -16.9125,-13.8687 -19.25,-15.86496 l -4.25,-3.62956 -0.0312,44.87949 c -0.0297,42.72017 -0.60636,54.53743 -3.51959,72.1241 l -0.70312,4.24462 12.87695,-6.07607 C 411.70537,566.57132 423.125,560.94338 430,557.40663 z m -23.43922,-44.33947 c -2.30591,-2.548 -1.34726,-6.9623 2.23781,-10.30443 3.96725,-3.69842 6.45173,-4.76177 8.47723,-3.62825 3.95631,2.21406 0.49437,12.8618 -4.84138,14.89045 -3.48409,1.32464 -3.8642,1.26266 -5.87366,-0.95777 z M 152,449.98462 c 29.975,-2.21827 55.9625,-4.26768 57.75,-4.55423 l 3.25,-0.52102 0,-47.95468 0,-47.95469 -3.8185,0 c -9.44976,0 -21.06069,-5.83238 -25.31516,-12.71627 -1.89262,-3.06231 -2.38418,-5.48802 -2.69863,-13.31669 -0.65055,-16.197 3.86621,-28.31677 13.92261,-37.35834 C 199.34337,281.78484 208.76287,277 212.03751,277 212.64594,277 213,248.30665 213,199 c 0,-75.00975 0.0704,-78 1.83593,-78 1.00975,0 26.09725,2.69327 55.75,5.98504 68.48765,7.60287 61.45206,7.23842 62.81564,3.25384 C 336.11756,122.3024 346.26307,114 353.24544,114 c 8.77895,0 13.74477,5.66646 13.75082,15.69098 0.002,3.86212 -0.46647,6.49265 -1.24626,6.99293 -0.70733,0.45379 5.262,1.49819 13.75,2.40571 l 15,1.60377 8.5,-8.12799 c 4.675,-4.4704 11.65,-10.92803 15.5,-14.35028 l 7,-6.22228 -104.5,0.28815 c -75.81758,0.20906 -105.46066,0.6061 -108,1.44656 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -8.50771,1.66035 -33.12372,10.59935 -36.05909,13.09441 -0.85751,0.72887 -3.37967,2.34572 -5.6048,3.593 -14.60004,8.18391 -34.41313,26.69451 -42.89068,40.0711 -2.71999,4.29182 -6.0199,9.46562 -7.33313,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 94.71261,454.009 C 96.245674,454.014 122.025,452.20297 152,449.9847 z m 17.41867,-33.00855 c -6.02369,-1.84902 -8.61114,-7.19037 -5.43757,-11.22491 3.87828,-4.93044 16.92263,-4.58209 20.5158,0.54787 2.08245,2.97312 1.88235,5.15738 -0.7469,8.15279 -2.56669,2.92414 -9.21419,4.09499 -14.33133,2.52425 z M 96.560781,393.06716 c -2.305914,-2.548 -1.347264,-6.9623 2.237806,-10.30443 3.967253,-3.69842 6.451733,-4.76177 8.477233,-3.62825 3.95631,2.21406 0.49437,12.8618 -4.84138,14.89045 -3.484089,1.32464 -3.864196,1.26266 -5.873659,-0.95777 z M 136.63726,245.53519 c -4.57386,-1.63054 -9.02747,-5.64881 -10.67847,-9.63467 -2.10952,-5.09283 -0.82112,-15.715 2.78572,-22.96687 4.13452,-8.3128 10.57969,-15.72196 15.69923,-18.04732 10.14462,-4.60782 24.12875,-0.8847 29.20377,7.77517 2.25652,3.85046 2.54626,5.26495 2.09587,10.23195 -0.76799,8.46946 -4.96383,16.4742 -12.71519,24.25775 -5.28447,5.30641 -7.71221,6.97445 -12.00744,8.25 -6.47621,1.92323 -9.29089,1.94945 -14.38349,0.13399 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -34,-28 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3686"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fdc842"
+       d="m 463.15804,742.75 c -2.10386,-4.5375 -5.76536,-12.4125 -8.13666,-17.5 l -4.31145,-9.25 -84.67981,0 -84.67982,0 -7.42515,2.53466 c -27.35567,9.33816 -66.8298,11.08931 -96.42515,4.2776 -29.63955,-6.82187 -52.39145,-19.64748 -75.01566,-42.2875 C 79.100149,657.12421 64.63787,632.23542 55.112259,599 46.673811,569.55775 44.89847,553.53391 44.293817,501.35509 L 43.79385,458.21018 55.396925,457.48519 67,456.7602 67.032719,347.6301 c 0.01863,-62.14498 0.43502,-111.92862 0.967126,-115.6301 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 C 71.615463,206.65497 80.513569,182.23417 87,171.652 c 1.925,-3.1405 4.943031,-7.83445 6.706735,-10.431 1.763704,-2.59655 4.423858,-6.51465 5.911453,-8.70689 7.304512,-10.7645 34.558372,-35.46732 45.104212,-40.88231 1.77233,-0.91004 4.74445,-2.6875 6.60472,-3.94992 9.87286,-6.6999 41.62577,-17.026521 60.67288,-19.731912 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.823792 c 6.31363,-3.851867 32.52705,-18.53868 38.46426,-21.550693 l 3.19664,-1.621695 8.12591,13.347537 8.1259,13.347538 13.67745,0.597738 c 18.64361,0.814771 26.24282,2.117745 43.17745,7.403291 16.03783,5.005638 23.06599,8.166936 33.5,15.068456 3.85,2.54656 9.45556,6.22795 12.45679,8.18086 6.67648,4.34442 31.75355,28.8978 35.68622,34.94098 11.09868,17.05492 13.69892,21.29722 16.35841,26.68881 1.64922,3.34346 2.99858,6.66219 2.99858,7.37495 0,0.71276 1.08198,3.8272 2.4044,6.92097 4.23427,9.90601 6.7615,20.20435 9.60133,39.12505 0.45403,3.025 0.86348,79.70696 0.90989,170.40435 L 696,568.30871 l -2.53971,13.30478 c -3.09486,16.21307 -9.17001,34.37943 -14.78139,44.20034 -2.29839,4.02261 -5.36906,9.53429 -6.8237,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.29178 -5.8552,7.59704 -4.69656,6.56171 -24.1231,24.88688 -33.5,31.60075 -21.41549,15.33352 -51.24004,26.48272 -79,29.53227 -8.69203,0.95486 -10.1804,1.45127 -17.5,5.83672 -13.53254,8.10785 -28.27238,15.58039 -45.29652,22.96359 C 476.24039,747.81956 468.47412,751 467.9451,751 c -0.52902,0 -2.6832,-3.7125 -4.78706,-8.25 z m 32.11013,-40.84475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.15993,36.76344 -61.1789,76.07616 -68.46403,116.92562 -2.38091,13.35039 -2.39106,38.31217 -0.021,51.76103 3.53285,20.04741 12.75404,42.4396 25.32592,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.86989,-20.93309 5.3405,-28.42295 5.88323,-93.63378 l 0.51296,-61.63377 -7.0837,-10.7256 C 339.81103,382.26423 328.9911,354.27226 324.86444,325 c -1.96032,-13.90543 -1.44093,-41.45699 1.04524,-55.44512 5.05159,-28.42217 16.73189,-57.46784 32.95665,-81.9541 4.48493,-6.7686 5.19111,-8.48089 4.93388,-11.96313 l -0.30021,-4.06392 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.69082,-6.35785 c 8.32816,-7.7106 15.98016,-11.71345 23.59982,-12.34533 10.02519,-0.83137 16.12594,5.11186 14.84447,14.46119 L 404.03826,691 l 16.98087,0 C 430.35861,691 438,690.72981 438,690.39957 438,689.67933 394.79149,597.44101 391.43684,591 c -1.34544,-2.58329 -2.36355,-3.72786 -2.39028,-2.6872 -0.12102,4.71162 -10.78929,33.34794 -16.64793,44.6872 -9.0819,17.57781 -17.84013,29.43924 -33.04246,44.75 L 326.2,691 l 16.50113,0 16.50114,0 6.98855,-6.47033 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36066,-8.15 -1.9922,-12 -0.98207,-5.98692 -3.73851,-15.20928 -9.11603,-30.5 -2.35437,-6.69454 -4.0188,-10.03471 -7.9486,-15.95113 C 648.77895,177.77545 647,174.84597 647,174.53893 c 0,-0.30705 -2.44422,-3.81641 -5.43159,-7.7986 -8.45118,-11.26544 -28.64577,-29.26886 -38.24764,-34.09766 -2.84858,-1.43255 -5.44468,-3.03415 -5.76912,-3.5591 -2.04877,-3.31497 -31.87924,-13.25714 -45.32059,-15.10486 -5.09792,-0.70078 -9.5047,-1.03841 -9.79283,-0.75027 -0.28814,0.28813 15.47039,26.875 35.01894,59.08193 19.54856,32.20693 35.53043,58.92516 35.51528,59.37384 -0.0151,0.44869 -5.50948,3.74079 -12.20961,7.31579 -17.56955,9.37462 -46.32676,26.78614 -57.96962,35.09866 -10.98368,7.84189 -23.08787,18.74304 -25.88528,23.31253 -1.76475,2.88267 -1.75296,2.95372 1.20296,7.25 3.04719,4.42894 4.274,5.50542 3.25859,2.8593 -0.9747,-2.54002 3.77833,-10.77747 9.58276,-16.60786 9.10647,-9.1472 20.52509,-12.03882 32.95879,-8.34641 6.04432,1.79497 12.80077,7.83102 15.03711,13.43378 0.76837,1.925 1.49474,3.63787 1.61416,3.80638 0.11942,0.16852 2.54118,-0.45377 5.3817,-1.38286 6.15506,-2.01322 13.0725,-1.47607 18.83228,1.46235 16.96166,8.6532 14.21233,30.2459 -5.30766,41.68538 -6.40684,3.75466 -18.08069,4.56249 -23.66232,1.63744 l -3.69369,-1.93568 -2.77653,2.89807 -2.77653,2.89808 10.75892,10.08358 c 19.56876,18.34045 41.61399,45.17503 53.52639,65.15507 4.21391,7.06777 4.89208,7.75012 7.15513,7.19918 7.17923,-1.74778 13.38662,-1.75359 16.61398,-0.0155 3.51572,1.89334 6.38602,6.74953 6.38602,10.80434 0,3.73408 -3.62621,14.53486 -6.79666,20.24405 l -2.79874,5.03983 1.80674,5.96017 c 0.99371,3.27809 3.03105,11.58516 4.52742,18.46016 2.5512,11.72134 2.71947,14.02618 2.70119,37 -0.0181,22.73619 -0.21205,25.3999 -2.69424,37 -1.47111,6.875 -3.81571,15.84132 -5.21023,19.92515 -1.39451,4.08384 -2.53548,7.52634 -2.53548,7.65 0,0.12367 1.56122,-1.33637 3.46938,-3.24453 6.59018,-6.59018 11.82061,-2.74711 8.16588,5.99991 -0.86647,2.07374 -2.78273,4.21149 -4.63268,5.16814 -2.88759,1.49323 -3.36039,1.4969 -5.57878,0.0434 -1.33309,-0.87347 -2.42598,-2.36526 -2.42864,-3.31508 -0.003,-0.94982 -1.93393,2.54805 -4.2917,7.77305 -9.68554,21.46391 -24.1723,42.28962 -42.68655,61.36483 l -11.51591,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z m 25.977,-471.02393 c -6.02369,-1.84902 -8.61114,-7.19037 -5.43757,-11.22491 3.87828,-4.93044 16.92263,-4.58209 20.5158,0.54787 2.08245,2.97312 1.88235,5.15738 -0.7469,8.15279 -2.56669,2.92414 -9.21419,4.09499 -14.33133,2.52425 z M 430,557.40663 c 6.875,-3.53675 16.40444,-9.32151 21.17654,-12.85502 C 459.6641,538.26697 468,529.25829 468,526.37036 468,521.33682 455.73185,505.46097 443.13724,494.19621 438.38676,489.94732 427.75,480.96503 419.5,474.23555 c -8.25,-6.72947 -16.9125,-13.8687 -19.25,-15.86496 l -4.25,-3.62956 -0.0312,44.87949 c -0.0297,42.72017 -0.60636,54.53743 -3.51959,72.1241 l -0.70312,4.24462 12.87695,-6.07607 C 411.70537,566.57132 423.125,560.94338 430,557.40663 z m -23.03997,-44.23791 c -2.9779,-2.41136 -2.07147,-6.25728 2.56829,-10.89704 2.55109,-2.55109 4.11108,-3.32996 6.19106,-3.09106 2.31213,0.26557 2.83262,0.85622 3.08923,3.5057 0.4054,4.18569 -2.11989,8.90617 -5.77588,10.79675 -3.62824,1.87624 -3.34962,1.89066 -6.0727,-0.31435 z M 152,449.98462 c 29.975,-2.21827 55.9625,-4.26768 57.75,-4.55423 l 3.25,-0.52102 0,-47.81223 0,-47.81223 -6.25,-0.64204 c -7.74789,-0.79591 -17.84527,-5.55738 -21.10694,-9.95309 -3.53136,-4.75917 -4.64435,-9.10642 -4.63119,-18.089 0.031,-21.18403 10.76796,-37.70176 27.73813,-42.67249 l 4.25,-1.24487 0,-77.84171 C 213,123.98554 213.07041,121 214.83593,121 c 1.00975,0 26.09725,2.69327 55.75,5.98504 68.48765,7.60287 61.45206,7.23842 62.81564,3.25384 C 336.11756,122.3024 346.26307,114 353.24544,114 c 8.77895,0 13.74477,5.66646 13.75082,15.69098 0.002,3.86212 -0.46647,6.49265 -1.24626,6.99293 -0.70733,0.45379 5.262,1.49819 13.75,2.40571 l 15,1.60377 8.5,-8.12799 c 4.675,-4.4704 11.65,-10.92803 15.5,-14.35028 l 7,-6.22228 -104.5,0.28815 c -75.81758,0.20906 -105.46066,0.6061 -108,1.44656 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -8.50771,1.66035 -33.12372,10.59935 -36.05909,13.09441 -0.85751,0.72887 -3.37967,2.34572 -5.6048,3.593 -14.60004,8.18391 -34.41313,26.69451 -42.89068,40.0711 -2.71999,4.29182 -6.0199,9.46562 -7.33313,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 94.71261,454.009 C 96.245674,454.014 122.025,452.20297 152,449.9847 z m 17.41867,-33.00855 c -6.02369,-1.84902 -8.61114,-7.19037 -5.43757,-11.22491 3.87828,-4.93044 16.92263,-4.58209 20.5158,0.54787 2.08245,2.97312 1.88235,5.15738 -0.7469,8.15279 -2.56669,2.92414 -9.21419,4.09499 -14.33133,2.52425 z M 96.96003,393.16872 c -2.977905,-2.41136 -2.071472,-6.25728 2.568292,-10.89704 2.551088,-2.55109 4.111078,-3.32996 6.191058,-3.09106 2.31213,0.26557 2.83262,0.85622 3.08923,3.5057 0.4054,4.18569 -2.11989,8.90617 -5.77588,10.79675 -3.628241,1.87624 -3.34962,1.89066 -6.0727,-0.31435 z M 136.65519,245.54135 C 128.78006,242.73348 125,237.07267 125,228.08717 c 0,-7.65799 2.8194,-15.26342 8.53801,-23.0316 6.27518,-8.52423 11.03193,-11.40939 19.60973,-11.89408 5.89802,-0.33326 7.64509,-0.008 12.36184,2.2994 7.70777,3.77105 10.96855,9.3296 10.23281,17.44351 -0.75218,8.29509 -5.01647,16.39059 -12.77196,24.2468 -5.26121,5.32953 -7.63574,6.96889 -11.94968,8.25 -6.47138,1.92179 -9.2915,1.9493 -14.36556,0.14015 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -34,-28 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3684"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fdc642"
+       d="m 463.15804,742.75 c -2.10386,-4.5375 -5.76536,-12.4125 -8.13666,-17.5 l -4.31145,-9.25 -84.67981,0 -84.67982,0 -7.42515,2.53466 c -27.35567,9.33816 -66.8298,11.08931 -96.42515,4.2776 -29.63955,-6.82187 -52.39145,-19.64748 -75.01566,-42.2875 C 79.100149,657.12421 64.63787,632.23542 55.112259,599 46.673811,569.55775 44.89847,553.53391 44.293817,501.35509 L 43.79385,458.21018 55.396925,457.48519 67,456.7602 67.032719,347.6301 c 0.01863,-62.14498 0.43502,-111.92862 0.967126,-115.6301 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 C 71.615463,206.65497 80.513569,182.23417 87,171.652 c 1.925,-3.1405 4.943031,-7.83445 6.706735,-10.431 1.763704,-2.59655 4.423858,-6.51465 5.911453,-8.70689 7.304512,-10.7645 34.558372,-35.46732 45.104212,-40.88231 1.77233,-0.91004 4.74445,-2.6875 6.60472,-3.94992 9.87286,-6.6999 41.62577,-17.026521 60.67288,-19.731912 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.823792 c 6.31363,-3.851867 32.52705,-18.53868 38.46426,-21.550693 l 3.19664,-1.621695 8.12591,13.347537 8.1259,13.347538 13.67745,0.597738 c 18.64361,0.814771 26.24282,2.117745 43.17745,7.403291 16.03783,5.005638 23.06599,8.166936 33.5,15.068456 3.85,2.54656 9.45556,6.22795 12.45679,8.18086 6.67648,4.34442 31.75355,28.8978 35.68622,34.94098 11.09868,17.05492 13.69892,21.29722 16.35841,26.68881 1.64922,3.34346 2.99858,6.66219 2.99858,7.37495 0,0.71276 1.08198,3.8272 2.4044,6.92097 4.23427,9.90601 6.7615,20.20435 9.60133,39.12505 0.45403,3.025 0.86348,79.70696 0.90989,170.40435 L 696,568.30871 l -2.53971,13.30478 c -3.09486,16.21307 -9.17001,34.37943 -14.78139,44.20034 -2.29839,4.02261 -5.36906,9.53429 -6.8237,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.29178 -5.8552,7.59704 -4.69656,6.56171 -24.1231,24.88688 -33.5,31.60075 -21.41549,15.33352 -51.24004,26.48272 -79,29.53227 -8.69203,0.95486 -10.1804,1.45127 -17.5,5.83672 -13.53254,8.10785 -28.27238,15.58039 -45.29652,22.96359 C 476.24039,747.81956 468.47412,751 467.9451,751 c -0.52902,0 -2.6832,-3.7125 -4.78706,-8.25 z m 32.11013,-40.84475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.15993,36.76344 -61.1789,76.07616 -68.46403,116.92562 -2.38091,13.35039 -2.39106,38.31217 -0.021,51.76103 3.53285,20.04741 12.75404,42.4396 25.32592,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.86989,-20.93309 5.3405,-28.42295 5.88323,-93.63378 l 0.51296,-61.63377 -7.0837,-10.7256 C 339.81103,382.26423 328.9911,354.27226 324.86444,325 c -1.96032,-13.90543 -1.44093,-41.45699 1.04524,-55.44512 5.05159,-28.42217 16.73189,-57.46784 32.95665,-81.9541 4.48493,-6.7686 5.19111,-8.48089 4.93388,-11.96313 l -0.30021,-4.06392 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.69082,-6.35785 c 8.32816,-7.7106 15.98016,-11.71345 23.59982,-12.34533 10.02519,-0.83137 16.12594,5.11186 14.84447,14.46119 L 404.03826,691 l 16.98087,0 C 430.35861,691 438,690.72981 438,690.39957 438,689.67933 394.79149,597.44101 391.43684,591 c -1.34544,-2.58329 -2.36355,-3.72786 -2.39028,-2.6872 -0.12102,4.71162 -10.78929,33.34794 -16.64793,44.6872 -9.0819,17.57781 -17.84013,29.43924 -33.04246,44.75 L 326.2,691 l 16.50113,0 16.50114,0 6.98855,-6.47033 z m 31.88296,-2.33841 c -0.59743,-0.19914 -0.8511,-0.74255 -0.5637,-1.20757 0.2874,-0.46502 -0.006,-1.17195 -0.65129,-1.57096 -0.83531,-0.51625 -0.97727,-0.0315 -0.49224,1.6809 0.37488,1.3235 1.00791,3.75637 1.40673,5.40637 l 0.72514,3 0.33081,-3.47333 c 0.18194,-1.91033 -0.15801,-3.63626 -0.75545,-3.83541 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36066,-8.15 -1.9922,-12 -0.98207,-5.98692 -3.73851,-15.20928 -9.11603,-30.5 -2.35437,-6.69454 -4.0188,-10.03471 -7.9486,-15.95113 C 648.77895,177.77545 647,174.84597 647,174.53893 c 0,-0.30705 -2.44422,-3.81641 -5.43159,-7.7986 -8.45118,-11.26544 -28.64577,-29.26886 -38.24764,-34.09766 -2.84858,-1.43255 -5.44468,-3.03415 -5.76912,-3.5591 -2.04877,-3.31497 -31.87924,-13.25714 -45.32059,-15.10486 -5.09792,-0.70078 -9.5047,-1.03841 -9.79283,-0.75027 -0.28814,0.28813 15.47039,26.875 35.01894,59.08193 19.54856,32.20693 35.53043,58.92516 35.51528,59.37384 -0.0151,0.44869 -5.50948,3.74079 -12.20961,7.31579 -17.56955,9.37462 -46.32676,26.78614 -57.96962,35.09866 -10.98368,7.84189 -23.08787,18.74304 -25.88528,23.31253 -1.76475,2.88267 -1.75296,2.95372 1.20296,7.25 3.04719,4.42894 4.274,5.50542 3.25859,2.8593 -0.9747,-2.54002 3.77833,-10.77747 9.58276,-16.60786 9.10647,-9.1472 20.52509,-12.03882 32.95879,-8.34641 6.04432,1.79497 12.80077,7.83102 15.03711,13.43378 0.76837,1.925 1.49474,3.63787 1.61416,3.80638 0.11942,0.16852 2.54118,-0.45377 5.3817,-1.38286 6.15506,-2.01322 13.0725,-1.47607 18.83228,1.46235 16.96166,8.6532 14.21233,30.2459 -5.30766,41.68538 -6.40684,3.75466 -18.08069,4.56249 -23.66232,1.63744 l -3.69369,-1.93568 -2.77653,2.89807 -2.77653,2.89808 10.75892,10.08358 c 19.56876,18.34045 41.61399,45.17503 53.52639,65.15507 4.21391,7.06777 4.89208,7.75012 7.15513,7.19918 7.17923,-1.74778 13.38662,-1.75359 16.61398,-0.0155 3.51572,1.89334 6.38602,6.74953 6.38602,10.80434 0,3.73408 -3.62621,14.53486 -6.79666,20.24405 l -2.79874,5.03983 1.80674,5.96017 c 0.99371,3.27809 3.03105,11.58516 4.52742,18.46016 2.5512,11.72134 2.71947,14.02618 2.70119,37 -0.0181,22.73619 -0.21205,25.3999 -2.69424,37 -1.47111,6.875 -3.81571,15.84132 -5.21023,19.92515 -1.39451,4.08384 -2.53548,7.52634 -2.53548,7.65 0,0.12367 1.56122,-1.33637 3.46938,-3.24453 6.59018,-6.59018 11.82061,-2.74711 8.16588,5.99991 -0.86647,2.07374 -2.78273,4.21149 -4.63268,5.16814 -2.88759,1.49323 -3.36039,1.4969 -5.57878,0.0434 -1.33309,-0.87347 -2.42598,-2.36526 -2.42864,-3.31508 -0.003,-0.94982 -1.93393,2.54805 -4.2917,7.77305 -9.68554,21.46391 -24.1723,42.28962 -42.68655,61.36483 l -11.51591,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z m 26.68774,-470.95661 c -6.44677,-1.60686 -9.4591,-7.08325 -6.18541,-11.24506 3.85104,-4.89581 17.29297,-4.41868 20.66891,0.73365 4.38958,6.69934 -4.34496,13.03844 -14.4835,10.51141 z M 430,557.40663 c 6.875,-3.53675 16.40444,-9.32151 21.17654,-12.85502 C 459.6641,538.26697 468,529.25829 468,526.37036 468,521.33682 455.73185,505.46097 443.13724,494.19621 438.38676,489.94732 427.75,480.96503 419.5,474.23555 c -8.25,-6.72947 -16.9125,-13.8687 -19.25,-15.86496 l -4.25,-3.62956 -0.0312,44.87949 c -0.0297,42.72017 -0.60636,54.53743 -3.51959,72.1241 l -0.70312,4.24462 12.87695,-6.07607 C 411.70537,566.57132 423.125,560.94338 430,557.40663 z m -23.03997,-44.23791 c -2.9779,-2.41136 -2.07147,-6.25728 2.56829,-10.89704 2.55109,-2.55109 4.11108,-3.32996 6.19106,-3.09106 2.31213,0.26557 2.83262,0.85622 3.08923,3.5057 0.4054,4.18569 -2.11989,8.90617 -5.77588,10.79675 -3.62824,1.87624 -3.34962,1.89066 -6.0727,-0.31435 z M 152,449.98462 c 29.975,-2.21827 55.9625,-4.26768 57.75,-4.55423 l 3.25,-0.52102 0,-47.81223 0,-47.81223 -6.25,-0.64204 c -7.74789,-0.79591 -17.84527,-5.55738 -21.10694,-9.95309 -3.53136,-4.75917 -4.64435,-9.10642 -4.63119,-18.089 0.031,-21.18403 10.76796,-37.70176 27.73813,-42.67249 l 4.25,-1.24487 0,-77.84171 C 213,123.98554 213.07041,121 214.83593,121 c 2.00589,0 107.35682,11.58399 113.36548,12.46524 3.61521,0.53021 3.75027,0.43241 5.79885,-4.19873 6.7751,-15.31623 24.11486,-20.32594 31.04022,-8.96796 2.29767,3.7683 2.78632,15.05298 0.70952,16.38536 -0.70733,0.45379 5.262,1.49819 13.75,2.40571 l 15,1.60377 8.5,-8.12799 c 4.675,-4.4704 11.65,-10.92803 15.5,-14.35028 l 7,-6.22228 -104.5,0.28815 c -75.81758,0.20906 -105.46066,0.6061 -108,1.44656 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -8.50771,1.66035 -33.12372,10.59935 -36.05909,13.09441 -0.85751,0.72887 -3.37967,2.34572 -5.6048,3.593 -14.60004,8.18391 -34.41313,26.69451 -42.89068,40.0711 -2.71999,4.29182 -6.0199,9.46562 -7.33313,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 94.71261,454.009 C 96.245674,454.014 122.025,452.20297 152,449.9847 z m 18.12941,-32.94123 c -6.44677,-1.60686 -9.4591,-7.08325 -6.18541,-11.24506 3.85104,-4.89581 17.29297,-4.41868 20.66891,0.73365 4.38958,6.69934 -4.34496,13.03844 -14.4835,10.51141 z M 96.96003,393.16872 c -2.977905,-2.41136 -2.071472,-6.25728 2.568292,-10.89704 2.551088,-2.55109 4.111078,-3.32996 6.191058,-3.09106 2.31213,0.26557 2.83262,0.85622 3.08923,3.5057 0.4054,4.18569 -2.11989,8.90617 -5.77588,10.79675 -3.628241,1.87624 -3.34962,1.89066 -6.0727,-0.31435 z M 136.65519,245.54135 C 128.78006,242.73348 125,237.07267 125,228.08717 c 0,-7.65799 2.8194,-15.26342 8.53801,-23.0316 6.27518,-8.52423 11.03193,-11.40939 19.60973,-11.89408 5.89802,-0.33326 7.64509,-0.008 12.36184,2.2994 7.70777,3.77105 10.96855,9.3296 10.23281,17.44351 -0.75218,8.29509 -5.01647,16.39059 -12.77196,24.2468 -5.26121,5.32953 -7.63574,6.96889 -11.94968,8.25 -6.47138,1.92179 -9.2915,1.9493 -14.36556,0.14015 z m 33.24513,-33.70956 c 0.11513,-4.23685 -0.74517,-7.04571 -1.93311,-6.31153 -0.45277,0.27983 -1.11109,-0.39823 -1.46294,-1.5068 -0.35184,-1.10857 -1.60625,-2.53286 -2.78758,-3.16508 -1.8696,-1.00058 -1.79605,-0.7314 0.56773,2.07779 1.49357,1.775 2.72247,3.98025 2.73089,4.90056 0.0124,1.35185 0.18452,1.40607 0.89617,0.28226 0.53873,-0.85074 0.73461,1.28545 0.50433,5.5 -0.26239,4.80212 -0.10956,6.13318 0.50415,4.39101 0.48438,-1.375 0.92554,-4.1507 0.98036,-6.16821 z m 484.17346,226.35947 c -0.59743,-0.19914 -0.8511,-0.74255 -0.5637,-1.20757 0.2874,-0.46502 -0.006,-1.17195 -0.65129,-1.57096 -0.83531,-0.51625 -0.97727,-0.0315 -0.49224,1.6809 0.37488,1.3235 1.00791,3.75637 1.40673,5.40637 l 0.72514,3 0.33081,-3.47333 c 0.18194,-1.91033 -0.15801,-3.63626 -0.75545,-3.83541 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 42.79864,-22.4173 c 0.0836,-2.58783 -0.5187,-6.05514 -1.33841,-7.70514 -0.81972,-1.65 -1.20412,-2.1 -0.85423,-1 1.68376,5.29349 1.48722,11.07639 -0.50981,15 l -2.03591,4 2.29319,-2.79486 c 1.59074,-1.93873 2.33975,-4.23617 2.44517,-7.5 z m 1.91894,-6.94139 c -0.22985,-1.52006 -0.42406,-0.51375 -0.43157,2.23625 -0.008,2.75 0.18056,3.99369 0.41792,2.76375 0.23736,-1.22994 0.24351,-3.47994 0.0136,-5 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 76,-7.38189 c 0,-0.4177 -1.0125,-1.38145 -2.25,-2.14166 -2.24201,-1.37729 -2.24323,-1.37459 -0.34501,0.75946 2.03808,2.29128 2.59501,2.58792 2.59501,1.3822 z m -5,-3.12392 c 0,-0.48585 -1.0125,-1.13847 -2.25,-1.45026 -2.17308,-0.54752 -2.18364,-0.51732 -0.30887,0.88337 2.26423,1.69166 2.55887,1.75693 2.55887,0.56689 z"
+       id="path3682"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#edc551"
+       d="m 463.15804,742.75 c -2.10386,-4.5375 -5.76536,-12.4125 -8.13666,-17.5 l -4.31145,-9.25 -84.67981,0 -84.67982,0 -7.42515,2.53466 c -27.35567,9.33816 -66.8298,11.08931 -96.42515,4.2776 -29.63955,-6.82187 -52.39145,-19.64748 -75.01566,-42.2875 C 79.100149,657.12421 64.63787,632.23542 55.112259,599 46.673811,569.55775 44.89847,553.53391 44.293817,501.35509 L 43.79385,458.21018 55.396925,457.48519 67,456.7602 67.032719,347.6301 c 0.01863,-62.14498 0.43502,-111.92862 0.967126,-115.6301 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 C 71.615463,206.65497 80.513569,182.23417 87,171.652 c 1.925,-3.1405 4.943031,-7.83445 6.706735,-10.431 1.763704,-2.59655 4.423858,-6.51465 5.911453,-8.70689 7.304512,-10.7645 34.558372,-35.46732 45.104212,-40.88231 1.77233,-0.91004 4.74445,-2.6875 6.60472,-3.94992 9.87286,-6.6999 41.62577,-17.026521 60.67288,-19.731912 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.823792 c 6.31363,-3.851867 32.52705,-18.53868 38.46426,-21.550693 l 3.19664,-1.621695 8.12591,13.347537 8.1259,13.347538 13.67745,0.597738 c 18.64361,0.814771 26.24282,2.117745 43.17745,7.403291 16.03783,5.005638 23.06599,8.166936 33.5,15.068456 3.85,2.54656 9.45556,6.22795 12.45679,8.18086 6.67648,4.34442 31.75355,28.8978 35.68622,34.94098 11.09868,17.05492 13.69892,21.29722 16.35841,26.68881 1.64922,3.34346 2.99858,6.66219 2.99858,7.37495 0,0.71276 1.08198,3.8272 2.4044,6.92097 4.23427,9.90601 6.7615,20.20435 9.60133,39.12505 0.45403,3.025 0.86348,79.70696 0.90989,170.40435 L 696,568.30871 l -2.53971,13.30478 c -3.09486,16.21307 -9.17001,34.37943 -14.78139,44.20034 -2.29839,4.02261 -5.36906,9.53429 -6.8237,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.29178 -5.8552,7.59704 -4.69656,6.56171 -24.1231,24.88688 -33.5,31.60075 -21.41549,15.33352 -51.24004,26.48272 -79,29.53227 -8.69203,0.95486 -10.1804,1.45127 -17.5,5.83672 -13.53254,8.10785 -28.27238,15.58039 -45.29652,22.96359 C 476.24039,747.81956 468.47412,751 467.9451,751 c -0.52902,0 -2.6832,-3.7125 -4.78706,-8.25 z m 32.11013,-40.84475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.15993,36.76344 -61.1789,76.07616 -68.46403,116.92562 -2.38091,13.35039 -2.39106,38.31217 -0.021,51.76103 3.53285,20.04741 12.75404,42.4396 25.32592,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.86989,-20.93309 5.3405,-28.42295 5.88323,-93.63378 l 0.51296,-61.63377 -7.0837,-10.7256 C 339.81103,382.26423 328.9911,354.27226 324.86444,325 c -1.96032,-13.90543 -1.44093,-41.45699 1.04524,-55.44512 5.05159,-28.42217 16.73189,-57.46784 32.95665,-81.9541 4.48493,-6.7686 5.19111,-8.48089 4.93388,-11.96313 l -0.30021,-4.06392 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.69082,-6.35785 c 8.32816,-7.7106 15.98016,-11.71345 23.59982,-12.34533 10.02519,-0.83137 16.12594,5.11186 14.84447,14.46119 L 404.03826,691 l 16.98087,0 C 430.35861,691 438,690.72981 438,690.39957 438,689.67933 394.79149,597.44101 391.43684,591 c -1.34544,-2.58329 -2.36355,-3.72786 -2.39028,-2.6872 -0.12102,4.71162 -10.78929,33.34794 -16.64793,44.6872 -9.0819,17.57781 -17.84013,29.43924 -33.04246,44.75 L 326.2,691 l 16.50113,0 16.50114,0 6.98855,-6.47033 z m 31.83184,-3.48733 c -1.83191,-3.42295 -3.01757,-2.27442 -1.47163,1.42554 0.79693,1.90734 1.52462,4.49484 1.61707,5.75 0.0925,1.25517 0.34349,0.61367 0.55784,-1.42554 0.21436,-2.03922 -0.10212,-4.62672 -0.70328,-5.75 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36066,-8.15 -1.9922,-12 -0.98207,-5.98692 -3.73851,-15.20928 -9.11603,-30.5 -2.35437,-6.69454 -4.0188,-10.03471 -7.9486,-15.95113 C 648.77895,177.77545 647,174.84597 647,174.53893 c 0,-0.30705 -2.44422,-3.81641 -5.43159,-7.7986 -8.45118,-11.26544 -28.64577,-29.26886 -38.24764,-34.09766 -2.84858,-1.43255 -5.44468,-3.03415 -5.76912,-3.5591 -2.04877,-3.31497 -31.87924,-13.25714 -45.32059,-15.10486 -5.09792,-0.70078 -9.5047,-1.03841 -9.79283,-0.75027 -0.28814,0.28813 15.47039,26.875 35.01894,59.08193 19.54856,32.20693 35.53043,58.92516 35.51528,59.37384 -0.0151,0.44869 -5.50948,3.74079 -12.20961,7.31579 -17.56955,9.37462 -46.32676,26.78614 -57.96962,35.09866 -10.98368,7.84189 -23.08787,18.74304 -25.88528,23.31253 -1.76475,2.88267 -1.75296,2.95372 1.20296,7.25 3.04719,4.42894 4.274,5.50542 3.25859,2.8593 -0.9747,-2.54002 3.77833,-10.77747 9.58276,-16.60786 9.10647,-9.1472 20.52509,-12.03882 32.95879,-8.34641 6.04432,1.79497 12.80077,7.83102 15.03711,13.43378 0.76837,1.925 1.49474,3.63787 1.61416,3.80638 0.11942,0.16852 2.54118,-0.45377 5.3817,-1.38286 6.15506,-2.01322 13.0725,-1.47607 18.83228,1.46235 16.96166,8.6532 14.21233,30.2459 -5.30766,41.68538 -6.40684,3.75466 -18.08069,4.56249 -23.66232,1.63744 l -3.69369,-1.93568 -2.77653,2.89807 -2.77653,2.89808 10.75892,10.08358 c 19.56876,18.34045 41.61399,45.17503 53.52639,65.15507 4.21391,7.06777 4.89208,7.75012 7.15513,7.19918 7.17923,-1.74778 13.38662,-1.75359 16.61398,-0.0155 3.51572,1.89334 6.38602,6.74953 6.38602,10.80434 0,3.73408 -3.62621,14.53486 -6.79666,20.24405 l -2.79874,5.03983 1.80674,5.96017 c 0.99371,3.27809 3.03105,11.58516 4.52742,18.46016 2.5512,11.72134 2.71947,14.02618 2.70119,37 -0.0181,22.73619 -0.21205,25.3999 -2.69424,37 -1.47111,6.875 -3.81571,15.84132 -5.21023,19.92515 -1.39451,4.08384 -2.53548,7.52634 -2.53548,7.65 0,0.12367 1.56122,-1.33637 3.46938,-3.24453 6.59018,-6.59018 11.82061,-2.74711 8.16588,5.99991 -0.86647,2.07374 -2.78273,4.21149 -4.63268,5.16814 -2.88759,1.49323 -3.36039,1.4969 -5.57878,0.0434 -1.33309,-0.87347 -2.42598,-2.36526 -2.42864,-3.31508 -0.003,-0.94982 -1.93393,2.54805 -4.2917,7.77305 -9.68554,21.46391 -24.1723,42.28962 -42.68655,61.36483 l -11.51591,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z M 629.74052,198.57069 C 624.39898,196.66462 623,195.20387 623,191.53254 c 0,-4.71057 2.5922,-6.52998 9.69193,-6.80256 6.99142,-0.26842 10.67093,1.3176 12.32586,5.31298 1.52369,3.67851 -0.0723,6.66404 -4.56616,8.5417 -4.12145,1.72205 -5.85243,1.71979 -10.71111,-0.014 z M 430,557.40663 c 6.875,-3.53675 16.40444,-9.32151 21.17654,-12.85502 C 459.6641,538.26697 468,529.25829 468,526.37036 468,521.33682 455.73185,505.46097 443.13724,494.19621 438.38676,489.94732 427.75,480.96503 419.5,474.23555 c -8.25,-6.72947 -16.9125,-13.8687 -19.25,-15.86496 l -4.25,-3.62956 -0.0312,44.87949 c -0.0297,42.72017 -0.60636,54.53743 -3.51959,72.1241 l -0.70312,4.24462 12.87695,-6.07607 C 411.70537,566.57132 423.125,560.94338 430,557.40663 z m -23.03997,-44.23791 c -2.9779,-2.41136 -2.07147,-6.25728 2.56829,-10.89704 2.55109,-2.55109 4.11108,-3.32996 6.19106,-3.09106 2.31213,0.26557 2.83262,0.85622 3.08923,3.5057 0.4054,4.18569 -2.11989,8.90617 -5.77588,10.79675 -3.62824,1.87624 -3.34962,1.89066 -6.0727,-0.31435 z M 152,449.98462 c 29.975,-2.21827 55.9625,-4.26768 57.75,-4.55423 l 3.25,-0.52102 0,-47.81223 0,-47.81223 -6.25,-0.64204 c -7.74789,-0.79591 -17.84527,-5.55738 -21.10694,-9.95309 -3.53136,-4.75917 -4.64435,-9.10642 -4.63119,-18.089 0.031,-21.18403 10.76796,-37.70176 27.73813,-42.67249 l 4.25,-1.24487 0,-77.84171 C 213,123.98554 213.07041,121 214.83593,121 c 1.99893,0 107.3407,11.58183 113.34072,12.46128 3.623,0.53103 3.7122,0.46125 6.11241,-4.7815 2.30917,-5.04388 7.90179,-10.70012 13.3952,-13.54759 5.58208,-2.89342 13.96301,-0.39871 17.35622,5.16636 2.11141,3.46282 2.7025,12.98541 0.97464,15.70145 -0.81786,1.2856 1.14967,1.72822 13.76531,3.0967 L 394.5,140.69339 403,132.5654 c 4.675,-4.4704 11.65,-10.92803 15.5,-14.35028 l 7,-6.22228 -104.5,0.28815 c -75.81758,0.20906 -105.46066,0.6061 -108,1.44656 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -8.50771,1.66035 -33.12372,10.59935 -36.05909,13.09441 -0.85751,0.72887 -3.37967,2.34572 -5.6048,3.593 -14.60004,8.18391 -34.41313,26.69451 -42.89068,40.0711 -2.71999,4.29182 -6.0199,9.46562 -7.33313,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 94.71261,454.009 C 96.245674,454.014 122.025,452.20297 152,449.9847 z m 17.74052,-33.41393 C 164.39898,414.66462 163,413.20387 163,409.53254 c 0,-4.71057 2.5922,-6.52998 9.69193,-6.80256 6.99142,-0.26842 10.67093,1.3176 12.32586,5.31298 1.52369,3.67851 -0.0723,6.66404 -4.56616,8.5417 -4.12145,1.72205 -5.85243,1.71979 -10.71111,-0.014 z M 96.96003,393.16872 c -2.977905,-2.41136 -2.071472,-6.25728 2.568292,-10.89704 2.551088,-2.55109 4.111078,-3.32996 6.191058,-3.09106 2.31213,0.26557 2.83262,0.85622 3.08923,3.5057 0.4054,4.18569 -2.11989,8.90617 -5.77588,10.79675 -3.628241,1.87624 -3.34962,1.89066 -6.0727,-0.31435 z M 136.65519,245.54135 C 128.78006,242.73348 125,237.07267 125,228.08717 c 0,-7.65799 2.8194,-15.26342 8.53801,-23.0316 6.27518,-8.52423 11.03193,-11.40939 19.60973,-11.89408 5.89802,-0.33326 7.64509,-0.008 12.36184,2.2994 7.70777,3.77105 10.96855,9.3296 10.23281,17.44351 -0.75218,8.29509 -5.01647,16.39059 -12.77196,24.2468 -5.26121,5.32953 -7.63574,6.96889 -11.94968,8.25 -6.47138,1.92179 -9.2915,1.9493 -14.36556,0.14015 z m 33.27452,-33.65649 c 0.0752,-4.936 -2.16784,-8.89228 -6.25726,-11.03669 -2.06454,-1.0826 -2.09151,-1.04504 -0.54304,0.75632 3.1745,3.69292 4.87147,8.3625 4.94088,13.59585 0.0881,6.63931 1.75303,3.67053 1.85942,-3.31548 z m 484.09295,225.15748 c -1.83191,-3.42295 -3.01757,-2.27442 -1.47163,1.42554 0.79693,1.90734 1.52462,4.49484 1.61707,5.75 0.0925,1.25517 0.34349,0.61367 0.55784,-1.42554 0.21436,-2.03922 -0.10212,-4.62672 -0.70328,-5.75 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 43.07309,-18.7657 c 2.16587,-4.24547 2.50379,-10.49652 0.77278,-14.29566 -1.22802,-2.69522 -4.15606,-4.96812 -8.55436,-6.64035 l -2.69614,-1.02507 2.74934,2.54801 c 3.36896,3.12224 6.61137,10.01587 6.61137,14.05633 0,1.65 -0.89437,4.97112 -1.98748,7.38027 -1.5855,3.49437 -1.6674,4.11465 -0.40495,3.0669 0.87039,-0.72236 2.44964,-3.01305 3.50944,-5.09043 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3680"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e9c554"
+       d="m 463.15804,742.75 c -2.10386,-4.5375 -5.76536,-12.4125 -8.13666,-17.5 l -4.31145,-9.25 -84.67981,0 -84.67982,0 -7.42515,2.53466 c -27.35567,9.33816 -66.8298,11.08931 -96.42515,4.2776 -29.63955,-6.82187 -52.39145,-19.64748 -75.01566,-42.2875 C 79.100149,657.12421 64.63787,632.23542 55.112259,599 46.673811,569.55775 44.89847,553.53391 44.293817,501.35509 L 43.79385,458.21018 55.396925,457.48519 67,456.7602 67.032719,347.6301 c 0.01863,-62.14498 0.43502,-111.92862 0.967126,-115.6301 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 C 71.615463,206.65497 80.513569,182.23417 87,171.652 c 1.925,-3.1405 4.943031,-7.83445 6.706735,-10.431 1.763704,-2.59655 4.423858,-6.51465 5.911453,-8.70689 7.304512,-10.7645 34.558372,-35.46732 45.104212,-40.88231 1.77233,-0.91004 4.74445,-2.6875 6.60472,-3.94992 9.87286,-6.6999 41.62577,-17.026521 60.67288,-19.731912 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.823792 c 6.31363,-3.851867 32.52705,-18.53868 38.46426,-21.550693 l 3.19664,-1.621695 8.12591,13.347537 8.1259,13.347538 13.67745,0.597738 c 18.64361,0.814771 26.24282,2.117745 43.17745,7.403291 16.03783,5.005638 23.06599,8.166936 33.5,15.068456 3.85,2.54656 9.45556,6.22795 12.45679,8.18086 6.67648,4.34442 31.75355,28.8978 35.68622,34.94098 11.09868,17.05492 13.69892,21.29722 16.35841,26.68881 1.64922,3.34346 2.99858,6.66219 2.99858,7.37495 0,0.71276 1.08198,3.8272 2.4044,6.92097 4.23427,9.90601 6.7615,20.20435 9.60133,39.12505 0.45403,3.025 0.86348,79.70696 0.90989,170.40435 L 696,568.30871 l -2.53971,13.30478 c -3.09486,16.21307 -9.17001,34.37943 -14.78139,44.20034 -2.29839,4.02261 -5.36906,9.53429 -6.8237,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.29178 -5.8552,7.59704 -4.69656,6.56171 -24.1231,24.88688 -33.5,31.60075 -21.41549,15.33352 -51.24004,26.48272 -79,29.53227 -8.69203,0.95486 -10.1804,1.45127 -17.5,5.83672 -13.53254,8.10785 -28.27238,15.58039 -45.29652,22.96359 C 476.24039,747.81956 468.47412,751 467.9451,751 c -0.52902,0 -2.6832,-3.7125 -4.78706,-8.25 z m 32.11013,-40.84475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.07631,-11.94553 -67.98282,-111.82517 -68.5577,-112.42671 -0.98013,-1.02557 -16.24719,7.90227 -29.24329,17.10084 -14.52861,10.28326 -26.76323,20.48391 -40.87792,34.08206 -38.15993,36.76344 -61.1789,76.07616 -68.46403,116.92562 -2.38091,13.35039 -2.39106,38.31217 -0.021,51.76103 3.53285,20.04741 12.75404,42.4396 25.32592,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.86989,-20.93309 5.3405,-28.42295 5.88323,-93.63378 l 0.51296,-61.63377 -7.0837,-10.7256 C 339.81103,382.26423 328.9911,354.27226 324.86444,325 c -1.96032,-13.90543 -1.44093,-41.45699 1.04524,-55.44512 5.05159,-28.42217 16.73189,-57.46784 32.95665,-81.9541 4.48493,-6.7686 5.19111,-8.48089 4.93388,-11.96313 l -0.30021,-4.06392 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.69082,-6.35785 c 8.32816,-7.7106 15.98016,-11.71345 23.59982,-12.34533 10.02519,-0.83137 16.12594,5.11186 14.84447,14.46119 L 404.03826,691 l 17.04826,0 c 15.81451,0 17.00785,-0.12729 16.48998,-1.75898 -0.30706,-0.96744 -11.29304,-24.58228 -24.41331,-52.47743 l -23.85503,-50.71845 -1.27838,5.72743 C 384.00864,609.78822 370.8702,638.66564 359.26302,655 c -3.71288,5.225 -12.67096,15.4625 -19.90685,22.75 L 326.2,691 l 16.50113,0 16.50114,0 6.98855,-6.47033 z m 31.83184,-3.48733 c -1.83191,-3.42295 -3.01757,-2.27442 -1.47163,1.42554 0.79693,1.90734 1.52462,4.49484 1.61707,5.75 0.0925,1.25517 0.34349,0.61367 0.55784,-1.42554 0.21436,-2.03922 -0.10212,-4.62672 -0.70328,-5.75 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36061,-8.15 -1.99208,-12 -0.98541,-6.00792 -4.31351,-17.16997 -9.09394,-30.5 -2.02102,-5.63552 -4.77047,-11.1783 -7.93666,-16 -1.62523,-2.475 -3.27373,-5.175 -3.66335,-6 -4.95458,-10.49106 -31.55625,-36.09771 -44.00324,-42.35733 -2.84858,-1.43255 -5.46174,-3.06174 -5.80702,-3.62043 -2.04328,-3.30609 -31.79201,-13.18903 -45.28269,-15.04353 -5.09792,-0.70078 -9.51256,-1.03055 -9.8103,-0.73281 -0.29774,0.29775 15.46079,26.90164 35.01895,59.11976 19.55816,32.21813 35.54776,58.9285 35.53245,59.35638 -0.0153,0.42788 -6.65281,4.34979 -14.75,8.71535 -36.60013,19.73281 -62.84526,37.22468 -75.34674,50.21713 -8.08232,8.39975 -8.25975,8.92653 -4.73299,14.0525 3.01883,4.38771 4.23955,5.45199 3.22706,2.81347 -0.9747,-2.54002 3.77833,-10.77747 9.58276,-16.60786 9.10647,-9.1472 20.52509,-12.03882 32.95879,-8.34641 6.04432,1.79497 12.80077,7.83102 15.03711,13.43378 0.76837,1.925 1.49474,3.63787 1.61416,3.80638 0.11942,0.16852 2.54118,-0.45377 5.3817,-1.38286 6.15506,-2.01322 13.0725,-1.47607 18.83228,1.46235 16.96166,8.6532 14.21233,30.2459 -5.30766,41.68538 -6.40684,3.75466 -18.08069,4.56249 -23.66232,1.63744 l -3.69369,-1.93568 -2.66177,2.77829 -2.66177,2.77829 15.88466,15.8352 c 21.06961,21.00402 42.58775,48.21036 50.76687,64.18683 1.48312,2.89702 2.07825,3.26313 4.38762,2.69919 7.33165,-1.79037 13.53075,-1.8123 16.78575,-0.0594 3.51572,1.89334 6.38602,6.74953 6.38602,10.80434 0,3.75596 -3.63306,14.54701 -6.84601,20.33429 l -2.84809,5.13008 1.855,5.86992 c 1.02026,3.22846 3.07394,11.49492 4.56376,18.36992 2.50536,11.56145 2.71124,14.26447 2.74204,36 0.0267,18.86475 -0.33663,25.47245 -1.8422,33.5 -1.61226,8.59644 -5.99147,25.08259 -8.17113,30.76134 -0.37183,0.96874 0.93527,0.15002 2.90467,-1.81938 6.69517,-6.69517 11.96776,-2.94415 8.27722,5.88857 -0.86647,2.07374 -2.78273,4.21149 -4.63268,5.16814 -2.88759,1.49323 -3.36039,1.4969 -5.57878,0.0434 -1.33309,-0.87347 -2.42598,-2.36526 -2.42864,-3.31508 -0.003,-0.94982 -1.98258,2.65863 -4.39982,8.01877 -9.49642,21.05798 -24.18889,42.14278 -42.58949,61.11911 l -11.50485,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z M 629.74052,198.57069 C 624.39898,196.66462 623,195.20387 623,191.53254 c 0,-4.71057 2.5922,-6.52998 9.69193,-6.80256 6.99142,-0.26842 10.67093,1.3176 12.32586,5.31298 1.52369,3.67851 -0.0723,6.66404 -4.56616,8.5417 -4.12145,1.72205 -5.85243,1.71979 -10.71111,-0.014 z M 425.30081,559.89268 c 16.33616,-8.16653 27.89505,-15.83928 35.42645,-23.51595 7.77766,-7.92767 8.29072,-9.73571 4.65711,-16.41185 C 459.31975,508.82219 447.94554,497.426 421.5,475.99574 413.8,469.75601 405.025,462.45845 402,459.77894 l -5.5,-4.87184 -0.60767,49.79645 c -0.47839,39.20279 -0.95323,51.81747 -2.23206,59.29645 -0.89342,5.225 -1.63247,10.03315 -1.64233,10.68478 -0.0184,1.21796 11.47305,-3.88927 33.28287,-14.7921 z m -18.34078,-46.72396 c -2.9779,-2.41136 -2.07147,-6.25728 2.56829,-10.89704 2.55109,-2.55109 4.11108,-3.32996 6.19106,-3.09106 2.31213,0.26557 2.83262,0.85622 3.08923,3.5057 0.4054,4.18569 -2.11989,8.90617 -5.77588,10.79675 -3.62824,1.87624 -3.34962,1.89066 -6.0727,-0.31435 z M 153,449.94694 c 30.525,-2.24689 56.5125,-4.2877 57.75,-4.53514 l 2.25,-0.4499 0,-47.8385 0,-47.83849 -6.25,-0.64204 c -7.74789,-0.79591 -17.84527,-5.55738 -21.10694,-9.95309 -3.53136,-4.75917 -4.64435,-9.10642 -4.63119,-18.089 0.031,-21.18403 10.76796,-37.70176 27.73813,-42.67249 l 4.25,-1.24487 0,-77.84171 C 213,123.98554 213.07041,121 214.83593,121 c 1.99893,0 107.3407,11.58183 113.34072,12.46128 3.623,0.53103 3.7122,0.46125 6.11241,-4.7815 2.30917,-5.04388 7.90179,-10.70012 13.3952,-13.54759 5.58208,-2.89342 13.96301,-0.39871 17.35622,5.16636 2.36905,3.88537 2.7292,13.90744 0.5718,15.91202 -1.14219,1.0613 1.29056,1.57348 13.75,2.89491 l 15.13772,1.60548 8,-7.6354 c 4.4,-4.19947 11.375,-10.66471 15.5,-14.3672 l 7.5,-6.7318 -104.5,0.29629 c -75.79778,0.21491 -105.46132,0.61446 -108,1.4547 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -10.0441,1.96019 -32.8537,10.66281 -38.40004,14.65088 -2.14502,1.54237 -4.2999,2.80431 -4.78861,2.80431 -0.48872,0 -5.04098,3.1074 -10.11615,6.90534 -11.66679,8.73071 -24.75747,22.32269 -31.20307,32.39798 -2.74567,4.29182 -6.0666,9.46562 -7.37983,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 l 2.787391,0.0161 c 1.533064,0.009 27.76239,-1.82227 58.28739,-4.06915 z m 16.74052,-33.37625 C 164.39898,414.66462 163,413.20387 163,409.53254 c 0,-4.71057 2.5922,-6.52998 9.69193,-6.80256 6.99142,-0.26842 10.67093,1.3176 12.32586,5.31298 1.52369,3.67851 -0.0723,6.66404 -4.56616,8.5417 -4.12145,1.72205 -5.85243,1.71979 -10.71111,-0.014 z M 96.96003,393.16872 c -2.977905,-2.41136 -2.071472,-6.25728 2.568292,-10.89704 2.551088,-2.55109 4.111078,-3.32996 6.191058,-3.09106 2.31213,0.26557 2.83262,0.85622 3.08923,3.5057 0.4054,4.18569 -2.11989,8.90617 -5.77588,10.79675 -3.628241,1.87624 -3.34962,1.89066 -6.0727,-0.31435 z M 136.65519,245.54135 C 128.78006,242.73348 125,237.07267 125,228.08717 c 0,-7.65799 2.8194,-15.26342 8.53801,-23.0316 6.27518,-8.52423 11.03193,-11.40939 19.60973,-11.89408 5.89802,-0.33326 7.64509,-0.008 12.36184,2.2994 7.70777,3.77105 10.96855,9.3296 10.23281,17.44351 -0.75218,8.29509 -5.01647,16.39059 -12.77196,24.2468 -5.26121,5.32953 -7.63574,6.96889 -11.94968,8.25 -6.47138,1.92179 -9.2915,1.9493 -14.36556,0.14015 z m 33.27452,-33.65649 c 0.0752,-4.936 -2.16784,-8.89228 -6.25726,-11.03669 -2.06454,-1.0826 -2.09151,-1.04504 -0.54304,0.75632 3.1745,3.69292 4.87147,8.3625 4.94088,13.59585 0.0881,6.63931 1.75303,3.67053 1.85942,-3.31548 z m 484.09295,225.15748 c -1.83191,-3.42295 -3.01757,-2.27442 -1.47163,1.42554 0.79693,1.90734 1.52462,4.49484 1.61707,5.75 0.0925,1.25517 0.34349,0.61367 0.55784,-1.42554 0.21436,-2.03922 -0.10212,-4.62672 -0.70328,-5.75 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 43.07309,-18.7657 c 2.16587,-4.24547 2.50379,-10.49652 0.77278,-14.29566 -1.22802,-2.69522 -4.15606,-4.96812 -8.55436,-6.64035 l -2.69614,-1.02507 2.74934,2.54801 c 3.36896,3.12224 6.61137,10.01587 6.61137,14.05633 0,1.65 -0.89437,4.97112 -1.98748,7.38027 -1.5855,3.49437 -1.6674,4.11465 -0.40495,3.0669 0.87039,-0.72236 2.44964,-3.01305 3.50944,-5.09043 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3678"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ababab"
+       d="m 463.15804,742.75 c -2.10386,-4.5375 -5.76536,-12.4125 -8.13666,-17.5 l -4.31145,-9.25 -84.67981,0 -84.67982,0 -7.42515,2.53466 c -27.35567,9.33816 -66.8298,11.08931 -96.42515,4.2776 -29.63955,-6.82187 -52.39145,-19.64748 -75.01566,-42.2875 C 79.100149,657.12421 64.63787,632.23542 55.112259,599 46.673811,569.55775 44.89847,553.53391 44.293817,501.35509 L 43.79385,458.21018 55.396925,457.48519 67,456.7602 67.032719,347.6301 c 0.01863,-62.14498 0.43502,-111.92862 0.967126,-115.6301 0.513924,-3.575 1.38258,-9.65 1.930345,-13.5 C 71.615463,206.65497 80.513569,182.23417 87,171.652 c 1.925,-3.1405 4.943031,-7.83445 6.706735,-10.431 1.763704,-2.59655 4.423858,-6.51465 5.911453,-8.70689 7.304512,-10.7645 34.558372,-35.46732 45.104212,-40.88231 1.77233,-0.91004 4.74445,-2.6875 6.60472,-3.94992 9.87286,-6.6999 41.62577,-17.026521 60.67288,-19.731912 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.823792 c 6.31363,-3.851867 32.52705,-18.53868 38.46426,-21.550693 l 3.19664,-1.621695 8.12591,13.347537 8.1259,13.347538 13.67745,0.597738 c 18.64361,0.814771 26.24282,2.117745 43.17745,7.403291 16.03783,5.005638 23.06599,8.166936 33.5,15.068456 3.85,2.54656 9.45556,6.22795 12.45679,8.18086 6.67648,4.34442 31.75355,28.8978 35.68622,34.94098 11.09868,17.05492 13.69892,21.29722 16.35841,26.68881 1.64922,3.34346 2.99858,6.66219 2.99858,7.37495 0,0.71276 1.08198,3.8272 2.4044,6.92097 4.23427,9.90601 6.7615,20.20435 9.60133,39.12505 0.45403,3.025 0.86348,79.70696 0.90989,170.40435 L 696,568.30871 l -2.53971,13.30478 c -3.09486,16.21307 -9.17001,34.37943 -14.78139,44.20034 -2.29839,4.02261 -5.36906,9.53429 -6.8237,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.29178 -5.8552,7.59704 -4.69656,6.56171 -24.1231,24.88688 -33.5,31.60075 -21.41549,15.33352 -51.24004,26.48272 -79,29.53227 -8.69203,0.95486 -10.1804,1.45127 -17.5,5.83672 -13.53254,8.10785 -28.27238,15.58039 -45.29652,22.96359 C 476.24039,747.81956 468.47412,751 467.9451,751 c -0.52902,0 -2.6832,-3.7125 -4.78706,-8.25 z m 32.11013,-40.84475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.00915,-11.83217 -67.98011,-111.82246 -68.54897,-112.41798 -1.00163,-1.04856 -16.09282,7.74191 -28.95077,16.86356 -15.07641,10.69545 -27.53663,21.07638 -41.40701,34.49726 -38.09479,36.86023 -60.9699,75.99513 -68.23619,116.73897 -2.38091,13.35039 -2.39106,38.31217 -0.021,51.76103 3.53285,20.04741 12.75404,42.4396 25.32592,61.5 14.30553,21.68881 31.12371,39.08986 60.48666,62.58293 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.86989,-20.93309 5.3405,-28.42295 5.88323,-93.63378 l 0.51296,-61.63377 -7.0837,-10.7256 C 339.81103,382.26423 328.9911,354.27226 324.86444,325 c -1.96032,-13.90543 -1.44093,-41.45699 1.04524,-55.44512 5.05159,-28.42217 16.73189,-57.46784 32.95665,-81.9541 4.48493,-6.7686 5.19111,-8.48089 4.93388,-11.96313 l -0.30021,-4.06392 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.48012,-6.16277 c 8.76741,-8.11728 16.43686,-12.02916 24.60328,-12.54916 5.94397,-0.37849 6.36895,-0.24617 10.05293,3.12994 3.68151,3.37385 3.84304,3.78626 3.76391,9.6098 l -0.0827,6.08467 16.9086,0 c 15.68123,0 16.86807,-0.12768 16.35032,-1.75898 -0.30706,-0.96744 -11.29304,-24.58228 -24.41331,-52.47743 l -23.85503,-50.71845 -1.27838,5.72743 c -4.0211,18.01565 -17.15954,46.89307 -28.76672,63.22743 -3.71288,5.225 -12.67096,15.4625 -19.90685,22.75 L 326.2,691 l 16.50113,0 16.50114,0 6.77785,-6.27525 z m 32.04254,-3.68241 c -1.83191,-3.42295 -3.01757,-2.27442 -1.47163,1.42554 0.79693,1.90734 1.52462,4.49484 1.61707,5.75 0.0925,1.25517 0.34349,0.61367 0.55784,-1.42554 0.21436,-2.03922 -0.10212,-4.62672 -0.70328,-5.75 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36061,-8.15 -1.99208,-12 -0.98541,-6.00792 -4.31351,-17.16997 -9.09394,-30.5 -2.02102,-5.63552 -4.77047,-11.1783 -7.93666,-16 -1.62523,-2.475 -3.27373,-5.175 -3.66335,-6 -4.95458,-10.49106 -31.55625,-36.09771 -44.00324,-42.35733 -2.84858,-1.43255 -5.46174,-3.06174 -5.80702,-3.62043 -2.04328,-3.30609 -31.79201,-13.18903 -45.28269,-15.04353 -5.09792,-0.70078 -9.51256,-1.03055 -9.8103,-0.73281 -0.29774,0.29775 15.46079,26.90164 35.01895,59.11976 19.55816,32.21813 35.54776,58.9285 35.53245,59.35638 -0.0153,0.42788 -6.65281,4.34979 -14.75,8.71535 -36.60013,19.73281 -62.84526,37.22468 -75.34674,50.21713 -8.08232,8.39975 -8.25975,8.92653 -4.73299,14.0525 3.01883,4.38771 4.23955,5.45199 3.22706,2.81347 -0.85334,-2.22378 3.22306,-9.851 8.25773,-15.45077 C 536.27817,284.67226 543.44305,281.5 553.5,281.5 c 6.72033,0 8.90379,0.44384 13.65015,2.7747 5.84855,2.87212 9.8869,7.17639 12.41914,13.23689 l 1.46691,3.5108 2.68792,-1.7612 c 1.92378,-1.26051 4.69042,-1.76119 9.7319,-1.76119 5.8973,0 7.81171,0.4513 11.76009,2.7723 10.27405,6.03943 13.35696,15.42762 8.5291,25.97307 -6.6289,14.4794 -24.30837,22.58024 -37.0139,16.95997 l -4.54418,-2.0101 -2.69902,2.81717 -2.69903,2.81718 15.88466,15.8352 c 21.06961,21.00402 42.58775,48.21036 50.76687,64.18683 1.48698,2.90457 2.07223,3.26254 4.38762,2.68372 1.46947,-0.36735 5.414,-0.91103 8.76562,-1.20818 5.7499,-0.50977 6.29399,-0.36453 9.64003,2.57332 6.15212,5.40164 5.845,13.21393 -1.07739,27.40578 l -3.76723,7.72333 1.81333,5.73521 c 0.99732,3.15436 3.03225,11.3602 4.52207,18.2352 2.50536,11.56145 2.71124,14.26447 2.74204,36 0.0267,18.86475 -0.33663,25.47245 -1.8422,33.5 -1.61226,8.59644 -5.99147,25.08259 -8.17113,30.76134 -0.37183,0.96874 0.93527,0.15002 2.90467,-1.81938 6.77935,-6.77935 12.22404,-2.68554 8.07024,6.06793 -0.93388,1.96802 -3.02158,4.26268 -4.63932,5.09924 -2.64732,1.36898 -3.18366,1.36228 -5.36516,-0.0671 -1.33309,-0.87347 -2.42598,-2.36526 -2.42864,-3.31508 -0.003,-0.94982 -1.98258,2.65863 -4.39982,8.01877 -9.49642,21.05798 -24.18889,42.14278 -42.58949,61.11911 l -11.50485,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z M 629.74052,198.57069 C 624.39898,196.66462 623,195.20387 623,191.53254 c 0,-4.71057 2.5922,-6.52998 9.69193,-6.80256 6.99142,-0.26842 10.67093,1.3176 12.32586,5.31298 1.52369,3.67851 -0.0723,6.66404 -4.56616,8.5417 -4.12145,1.72205 -5.85243,1.71979 -10.71111,-0.014 z M 425.30081,559.89268 c 16.33616,-8.16653 27.89505,-15.83928 35.42645,-23.51595 7.77766,-7.92767 8.29072,-9.73571 4.65711,-16.41185 C 459.31975,508.82219 447.94554,497.426 421.5,475.99574 413.8,469.75601 405.025,462.45845 402,459.77894 l -5.5,-4.87184 -0.60767,49.79645 c -0.47839,39.20279 -0.95323,51.81747 -2.23206,59.29645 -0.89342,5.225 -1.63247,10.03315 -1.64233,10.68478 -0.0184,1.21796 11.47305,-3.88927 33.28287,-14.7921 z m -18.34078,-46.72396 c -2.9779,-2.41136 -2.07147,-6.25728 2.56829,-10.89704 2.55109,-2.55109 4.11108,-3.32996 6.19106,-3.09106 2.33065,0.2677 2.83165,0.84956 3.09594,3.59566 0.38422,3.99222 -2.7186,9.40299 -6.33781,11.05201 -3.21391,1.46436 -2.83922,1.50915 -5.51748,-0.65957 z M 153,449.94694 c 30.525,-2.24689 56.5125,-4.2877 57.75,-4.53514 l 2.25,-0.4499 0,-47.8385 0,-47.83849 -5.9939,-0.62648 c -11.18933,-1.16952 -19.58485,-6.16536 -23.47299,-13.96783 -4.22729,-8.48306 -3.28492,-24.82202 2.09448,-36.31459 4.68585,-10.01084 13.55654,-17.81134 23.12241,-20.33283 l 4.25,-1.12027 0,-77.96145 C 213,123.9891 213.07039,121 214.83593,121 c 1.99893,0 107.3407,11.58183 113.34072,12.46128 3.623,0.53103 3.7122,0.46125 6.11241,-4.7815 2.30917,-5.04388 7.90179,-10.70012 13.3952,-13.54759 5.58208,-2.89342 13.96301,-0.39871 17.35622,5.16636 2.36905,3.88537 2.7292,13.90744 0.5718,15.91202 -1.14219,1.0613 1.29056,1.57348 13.75,2.89491 l 15.13772,1.60548 8,-7.6354 c 4.4,-4.19947 11.375,-10.66471 15.5,-14.3672 l 7.5,-6.7318 -104.5,0.29629 c -75.79778,0.21491 -105.46132,0.61446 -108,1.4547 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -10.0441,1.96019 -32.8537,10.66281 -38.40004,14.65088 -2.14502,1.54237 -4.2999,2.80431 -4.78861,2.80431 -0.48872,0 -5.04098,3.1074 -10.11615,6.90534 -11.66679,8.73071 -24.75747,22.32269 -31.20307,32.39798 -2.74567,4.29182 -6.0666,9.46562 -7.37983,11.49732 -2.69445,4.16857 -9.1123,18.93694 -9.1123,20.96866 0,0.73151 -0.71772,2.71794 -1.594934,4.41428 -0.877214,1.69635 -2.542827,7.8615 -3.701362,13.70034 -2.05089,10.33617 -2.115288,13.50977 -2.442456,120.36608 L 91.925219,454 l 2.787391,0.0161 c 1.533064,0.009 27.76239,-1.82227 58.28739,-4.06915 z m 16.74052,-33.37625 C 164.39898,414.66462 163,413.20387 163,409.53254 c 0,-4.71057 2.5922,-6.52998 9.69193,-6.80256 6.99142,-0.26842 10.67093,1.3176 12.32586,5.31298 1.52369,3.67851 -0.0723,6.66404 -4.56616,8.5417 -4.12145,1.72205 -5.85243,1.71979 -10.71111,-0.014 z M 96.96003,393.16872 c -2.977905,-2.41136 -2.071472,-6.25728 2.568292,-10.89704 2.551088,-2.55109 4.111078,-3.32996 6.191058,-3.09106 2.33065,0.2677 2.83165,0.84956 3.09594,3.59566 0.38422,3.99222 -2.7186,9.40299 -6.33781,11.05201 -3.213907,1.46436 -2.839224,1.50915 -5.51748,-0.65957 z M 138.1228,246.04835 c -3.99824,-1.00368 -7.71624,-3.62187 -10.56101,-7.43699 -3.21459,-4.31108 -2.92806,-17.22521 0.54605,-24.61136 3.67751,-7.81857 11.02699,-16.40277 16.17862,-18.89663 9.00372,-4.35862 21.02217,-2.07164 27.42279,5.21827 5.45674,6.21487 5.59858,13.17716 0.48958,24.03104 -7.2676,15.43974 -21.89579,24.75328 -34.07603,21.69567 z m 31.80691,-34.16349 c 0.0752,-4.936 -2.16784,-8.89228 -6.25726,-11.03669 -2.06454,-1.0826 -2.09151,-1.04504 -0.54304,0.75632 3.1745,3.69292 4.87147,8.3625 4.94088,13.59585 0.0881,6.63931 1.75303,3.67053 1.85942,-3.31548 z m 484.09295,225.15748 c -1.83191,-3.42295 -3.01757,-2.27442 -1.47163,1.42554 0.79693,1.90734 1.52462,4.49484 1.61707,5.75 0.0925,1.25517 0.34349,0.61367 0.55784,-1.42554 0.21436,-2.03922 -0.10212,-4.62672 -0.70328,-5.75 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 43.07309,-18.7657 c 2.16587,-4.24547 2.50379,-10.49652 0.77278,-14.29566 -1.22802,-2.69522 -4.15606,-4.96812 -8.55436,-6.64035 l -2.69614,-1.02507 2.74934,2.54801 c 3.36896,3.12224 6.61137,10.01587 6.61137,14.05633 0,1.65 -0.89437,4.97112 -1.98748,7.38027 -1.5855,3.49437 -1.6674,4.11465 -0.40495,3.0669 0.87039,-0.72236 2.44964,-3.01305 3.50944,-5.09043 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3676"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fac541"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 32.28604,-40.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.00915,-11.83217 -67.98011,-111.82246 -68.54897,-112.41798 -1.72895,-1.80996 -28.59126,15.68766 -47.92001,31.21422 -12.84956,10.32191 -33.49859,30.43936 -43.77349,42.6466 -20.25574,24.06513 -35.62729,51.81515 -43.33888,78.23897 -5.89976,20.21559 -7.19699,49.40108 -3.11501,70.08276 6.87979,34.85702 26.52832,68.28157 57.55023,97.89996 5.77112,5.51002 18.27875,16.24758 27.79473,23.86124 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87091,-20.93747 5.34046,-28.41644 5.88373,-93.71696 l 0.51347,-61.71697 -7.20505,-10.78303 c -44.99778,-67.34348 -44.62831,-148.80188 0.99408,-219.16855 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.48012,-6.16277 c 8.76741,-8.11728 16.43686,-12.02916 24.60328,-12.54916 5.94397,-0.37849 6.36895,-0.24617 10.05293,3.12994 3.68151,3.37385 3.84304,3.78626 3.76391,9.6098 l -0.0827,6.08467 16.9086,0 c 15.68123,0 16.86807,-0.12768 16.35032,-1.75898 -0.30706,-0.96744 -11.29304,-24.58228 -24.41331,-52.47743 l -23.85503,-50.71845 -1.27838,5.72743 c -4.0211,18.01565 -17.15954,46.89307 -28.76672,63.22743 -3.71288,5.225 -12.67096,15.4625 -19.90685,22.75 L 326.2,691 l 16.50113,0 16.50114,0 6.77785,-6.27525 z m 32.04254,-3.68241 c -1.83191,-3.42295 -3.01757,-2.27442 -1.47163,1.42554 0.79693,1.90734 1.52462,4.49484 1.61707,5.75 0.0925,1.25517 0.34349,0.61367 0.55784,-1.42554 0.21436,-2.03922 -0.10212,-4.62672 -0.70328,-5.75 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36061,-8.15 -1.99208,-12 -0.98541,-6.00792 -4.31351,-17.16997 -9.09394,-30.5 -2.02102,-5.63552 -4.77047,-11.1783 -7.93666,-16 -1.62523,-2.475 -3.27373,-5.175 -3.66335,-6 -4.95458,-10.49106 -31.55625,-36.09771 -44.00324,-42.35733 -2.84858,-1.43255 -5.46174,-3.06174 -5.80702,-3.62043 -2.10045,-3.39858 -29.7073,-12.57323 -44.90262,-14.92259 -6.34347,-0.98076 -11.38076,-1.51691 -11.19398,-1.19143 0.18679,0.32548 16.36935,27.0167 35.96124,59.31382 19.59188,32.29712 35.60908,59.07212 35.59377,59.5 -0.0153,0.42788 -6.65281,4.34979 -14.75,8.71535 -36.60013,19.73281 -62.84526,37.22468 -75.34674,50.21713 -8.08232,8.39975 -8.25975,8.92653 -4.73299,14.0525 3.01883,4.38771 4.23955,5.45199 3.22706,2.81347 -0.85334,-2.22378 3.22306,-9.851 8.25773,-15.45077 C 536.27817,284.67226 543.44305,281.5 553.5,281.5 c 6.72033,0 8.90379,0.44384 13.65015,2.7747 5.84855,2.87212 9.8869,7.17639 12.41914,13.23689 l 1.46691,3.5108 2.68792,-1.7612 c 1.92378,-1.26051 4.69042,-1.76119 9.7319,-1.76119 5.8973,0 7.81171,0.4513 11.76009,2.7723 10.27405,6.03943 13.35696,15.42762 8.5291,25.97307 -6.6289,14.4794 -24.30837,22.58024 -37.0139,16.95997 l -4.54418,-2.0101 -2.69902,2.81717 -2.69903,2.81718 15.88466,15.8352 c 21.06961,21.00402 42.58775,48.21036 50.76687,64.18683 1.48698,2.90457 2.07223,3.26254 4.38762,2.68372 1.46947,-0.36735 5.414,-0.91103 8.76562,-1.20818 5.7499,-0.50977 6.29399,-0.36453 9.64003,2.57332 6.15212,5.40164 5.845,13.21393 -1.07739,27.40578 l -3.76723,7.72333 1.81333,5.73521 c 0.99732,3.15436 3.03225,11.3602 4.52207,18.2352 2.50536,11.56145 2.71124,14.26447 2.74204,36 0.0267,18.86475 -0.33663,25.47245 -1.8422,33.5 -1.61226,8.59644 -5.99147,25.08259 -8.17113,30.76134 -0.37183,0.96874 0.93527,0.15002 2.90467,-1.81938 6.77935,-6.77935 12.22404,-2.68554 8.07024,6.06793 -0.93388,1.96802 -3.02158,4.26268 -4.63932,5.09924 -2.64732,1.36898 -3.18366,1.36228 -5.36516,-0.0671 -1.33309,-0.87347 -2.42598,-2.36526 -2.42864,-3.31508 -0.003,-0.94982 -1.98258,2.65863 -4.39982,8.01877 -9.49642,21.05798 -24.18889,42.14278 -42.58949,61.11911 l -11.50485,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z M 629.74052,198.57069 C 624.39898,196.66462 623,195.20387 623,191.53254 c 0,-4.71057 2.5922,-6.52998 9.69193,-6.80256 6.99142,-0.26842 10.67093,1.3176 12.32586,5.31298 1.52369,3.67851 -0.0723,6.66404 -4.56616,8.5417 -4.12145,1.72205 -5.85243,1.71979 -10.71111,-0.014 z M 425.30081,559.89268 c 16.33616,-8.16653 27.89505,-15.83928 35.42645,-23.51595 7.77766,-7.92767 8.29072,-9.73571 4.65711,-16.41185 C 459.31975,508.82219 447.94554,497.426 421.5,475.99574 413.8,469.75601 405.025,462.45845 402,459.77894 l -5.5,-4.87184 -0.60767,49.79645 c -0.47839,39.20279 -0.95323,51.81747 -2.23206,59.29645 -0.89342,5.225 -1.63247,10.03315 -1.64233,10.68478 -0.0184,1.21796 11.47305,-3.88927 33.28287,-14.7921 z m -18.34078,-46.72396 c -2.9779,-2.41136 -2.07147,-6.25728 2.56829,-10.89704 2.55109,-2.55109 4.11108,-3.32996 6.19106,-3.09106 2.33065,0.2677 2.83165,0.84956 3.09594,3.59566 0.38422,3.99222 -2.7186,9.40299 -6.33781,11.05201 -3.21391,1.46436 -2.83922,1.50915 -5.51748,-0.65957 z M 153,449.94694 c 30.525,-2.24689 56.5125,-4.2877 57.75,-4.53514 l 2.25,-0.4499 0,-47.8385 0,-47.83849 -5.9939,-0.62648 c -11.18933,-1.16952 -19.58485,-6.16536 -23.47299,-13.96783 -4.22729,-8.48306 -3.28492,-24.82202 2.09448,-36.31459 4.68585,-10.01084 13.55654,-17.81134 23.12241,-20.33283 l 4.25,-1.12027 0,-77.96145 C 213,123.9891 213.07039,121 214.83593,121 c 1.99893,0 107.3407,11.58183 113.34072,12.46128 3.623,0.53103 3.7122,0.46125 6.11241,-4.7815 2.30917,-5.04388 7.90179,-10.70012 13.3952,-13.54759 5.58208,-2.89342 13.96301,-0.39871 17.35622,5.16636 2.36905,3.88537 2.7292,13.90744 0.5718,15.91202 -1.14219,1.0613 1.29056,1.57348 13.75,2.89491 l 15.13772,1.60548 8,-7.6354 c 4.4,-4.19947 11.375,-10.66471 15.5,-14.3672 l 7.5,-6.7318 -104.5,0.29629 c -75.79778,0.21491 -105.46132,0.61446 -108,1.4547 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -10.0441,1.96019 -32.8537,10.66281 -38.40004,14.65088 -2.14502,1.54237 -4.2999,2.80431 -4.78861,2.80431 -0.48872,0 -5.08065,3.13709 -10.20429,6.9713 -11.6822,8.74224 -25.72956,23.37346 -31.60706,32.92078 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0161 C 96.24744,454.02494 122.475,452.19382 153,449.94694 z m 16.74052,-33.37625 C 164.39898,414.66462 163,413.20387 163,409.53254 c 0,-4.71057 2.5922,-6.52998 9.69193,-6.80256 6.99142,-0.26842 10.67093,1.3176 12.32586,5.31298 1.52369,3.67851 -0.0723,6.66404 -4.56616,8.5417 -4.12145,1.72205 -5.85243,1.71979 -10.71111,-0.014 z M 96.96003,393.16872 c -2.977905,-2.41136 -2.071472,-6.25728 2.568292,-10.89704 2.551088,-2.55109 4.111078,-3.32996 6.191058,-3.09106 2.33065,0.2677 2.83165,0.84956 3.09594,3.59566 0.38422,3.99222 -2.7186,9.40299 -6.33781,11.05201 -3.213907,1.46436 -2.839224,1.50915 -5.51748,-0.65957 z M 138.1228,246.04835 c -3.99824,-1.00368 -7.71624,-3.62187 -10.56101,-7.43699 -3.21459,-4.31108 -2.92806,-17.22521 0.54605,-24.61136 3.67751,-7.81857 11.02699,-16.40277 16.17862,-18.89663 9.00372,-4.35862 21.02217,-2.07164 27.42279,5.21827 5.45674,6.21487 5.59858,13.17716 0.48958,24.03104 -7.2676,15.43974 -21.89579,24.75328 -34.07603,21.69567 z m 31.80691,-34.16349 c 0.0752,-4.936 -2.16784,-8.89228 -6.25726,-11.03669 -2.06454,-1.0826 -2.09151,-1.04504 -0.54304,0.75632 3.1745,3.69292 4.87147,8.3625 4.94088,13.59585 0.0881,6.63931 1.75303,3.67053 1.85942,-3.31548 z m 484.09295,225.15748 c -1.83191,-3.42295 -3.01757,-2.27442 -1.47163,1.42554 0.79693,1.90734 1.52462,4.49484 1.61707,5.75 0.0925,1.25517 0.34349,0.61367 0.55784,-1.42554 0.21436,-2.03922 -0.10212,-4.62672 -0.70328,-5.75 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 43.07309,-18.7657 c 2.16587,-4.24547 2.50379,-10.49652 0.77278,-14.29566 -1.22802,-2.69522 -4.15606,-4.96812 -8.55436,-6.64035 l -2.69614,-1.02507 2.74934,2.54801 c 3.36896,3.12224 6.61137,10.01587 6.61137,14.05633 0,1.65 -0.89437,4.97112 -1.98748,7.38027 -1.5855,3.49437 -1.6674,4.11465 -0.40495,3.0669 0.87039,-0.72236 2.44964,-3.01305 3.50944,-5.09043 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3674"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e4c153"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 32.28604,-40.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.00915,-11.83217 -67.98011,-111.82246 -68.54897,-112.41798 -1.72895,-1.80996 -28.59126,15.68766 -47.92001,31.21422 -12.84956,10.32191 -33.49859,30.43936 -43.77349,42.6466 -20.25574,24.06513 -35.62729,51.81515 -43.33888,78.23897 -5.89976,20.21559 -7.19699,49.40108 -3.11501,70.08276 6.87979,34.85702 26.52832,68.28157 57.55023,97.89996 5.77112,5.51002 18.27875,16.24758 27.79473,23.86124 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87091,-20.93747 5.34046,-28.41644 5.88373,-93.71696 l 0.51347,-61.71697 -7.20505,-10.78303 c -44.99778,-67.34348 -44.62831,-148.80188 0.99408,-219.16855 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 126.48012,-6.16277 c 8.76741,-8.11728 16.43686,-12.02916 24.60328,-12.54916 5.94397,-0.37849 6.36895,-0.24617 10.05293,3.12994 3.68151,3.37385 3.84304,3.78626 3.76391,9.6098 l -0.0827,6.08467 16.9086,0 c 15.68123,0 16.86807,-0.12768 16.35032,-1.75898 -0.30706,-0.96744 -11.29304,-24.58228 -24.41331,-52.47743 l -23.85503,-50.71845 -1.27838,5.72743 c -4.0211,18.01565 -17.15954,46.89307 -28.76672,63.22743 -3.71288,5.225 -12.67096,15.4625 -19.90685,22.75 L 326.2,691 l 16.50113,0 16.50114,0 6.77785,-6.27525 z m 30.94597,-5.1318 c -2.13464,-2.02686 -2.17912,-2.02979 -1.40849,-0.0929 0.43767,1.1 1.28776,4.00043 1.88908,6.4454 l 1.09332,4.44539 0.31517,-4.35244 c 0.24944,-3.4447 -0.14455,-4.78896 -1.88908,-6.4454 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36061,-8.15 -1.99208,-12 -0.98541,-6.00792 -4.31351,-17.16997 -9.09394,-30.5 -2.02102,-5.63552 -4.77047,-11.1783 -7.93666,-16 -1.62523,-2.475 -3.27373,-5.175 -3.66335,-6 -4.95458,-10.49106 -31.55625,-36.09771 -44.00324,-42.35733 -2.84858,-1.43255 -5.46174,-3.06174 -5.80702,-3.62043 -2.10045,-3.39858 -29.7073,-12.57323 -44.90262,-14.92259 -6.34347,-0.98076 -11.38076,-1.51691 -11.19398,-1.19143 0.18679,0.32548 16.36935,27.0167 35.96124,59.31382 19.59188,32.29712 35.60908,59.07212 35.59377,59.5 -0.0153,0.42788 -6.65281,4.34979 -14.75,8.71535 -36.60013,19.73281 -62.84526,37.22468 -75.34674,50.21713 -8.08232,8.39975 -8.25975,8.92653 -4.73299,14.0525 3.01883,4.38771 4.23955,5.45199 3.22706,2.81347 -0.85334,-2.22378 3.22306,-9.851 8.25773,-15.45077 C 536.27817,284.67226 543.44305,281.5 553.5,281.5 c 6.72033,0 8.90379,0.44384 13.65015,2.7747 5.84855,2.87212 9.8869,7.17639 12.41914,13.23689 l 1.46691,3.5108 2.68792,-1.7612 c 1.92378,-1.26051 4.69042,-1.76119 9.7319,-1.76119 5.8973,0 7.81171,0.4513 11.76009,2.7723 10.27405,6.03943 13.35696,15.42762 8.5291,25.97307 -6.6289,14.4794 -24.30837,22.58024 -37.0139,16.95997 l -4.54418,-2.0101 -2.69902,2.81717 -2.69903,2.81718 15.88466,15.8352 c 21.06961,21.00402 42.58775,48.21036 50.76687,64.18683 1.48698,2.90457 2.07223,3.26254 4.38762,2.68372 1.46947,-0.36735 5.414,-0.91103 8.76562,-1.20818 5.7499,-0.50977 6.29399,-0.36453 9.64003,2.57332 6.15212,5.40164 5.845,13.21393 -1.07739,27.40578 l -3.76723,7.72333 1.81333,5.73521 c 0.99732,3.15436 3.03225,11.3602 4.52207,18.2352 2.50536,11.56145 2.71124,14.26447 2.74204,36 0.0267,18.86475 -0.33663,25.47245 -1.8422,33.5 -1.61226,8.59644 -5.99147,25.08259 -8.17113,30.76134 -0.37183,0.96874 0.93527,0.15002 2.90467,-1.81938 6.77935,-6.77935 12.22404,-2.68554 8.07024,6.06793 -0.93388,1.96802 -3.02158,4.26268 -4.63932,5.09924 -2.64732,1.36898 -3.18366,1.36228 -5.36516,-0.0671 -1.33309,-0.87347 -2.42598,-2.36526 -2.42864,-3.31508 -0.003,-0.94982 -1.98258,2.65863 -4.39982,8.01877 -9.49642,21.05798 -24.18889,42.14278 -42.58949,61.11911 l -11.50485,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z M 627.5,197.84527 c -4.51615,-2.47015 -6.08883,-8.28177 -2.94678,-10.88944 2.18712,-1.81514 10.21171,-2.85952 13.979,-1.81932 6.46063,1.78386 8.93765,8.44509 4.482,12.05306 -2.56032,2.07322 -12.17929,2.47976 -15.51422,0.6557 z M 425.30081,559.89268 c 16.33616,-8.16653 27.89505,-15.83928 35.42645,-23.51595 7.77766,-7.92767 8.29072,-9.73571 4.65711,-16.41185 C 459.31975,508.82219 447.94554,497.426 421.5,475.99574 413.8,469.75601 405.025,462.45845 402,459.77894 l -5.5,-4.87184 -0.60767,49.79645 c -0.47839,39.20279 -0.95323,51.81747 -2.23206,59.29645 -0.89342,5.225 -1.63247,10.03315 -1.64233,10.68478 -0.0184,1.21796 11.47305,-3.88927 33.28287,-14.7921 z m -18.34078,-46.72396 c -2.9779,-2.41136 -2.07147,-6.25728 2.56829,-10.89704 2.55109,-2.55109 4.11108,-3.32996 6.19106,-3.09106 2.33065,0.2677 2.83165,0.84956 3.09594,3.59566 0.38422,3.99222 -2.7186,9.40299 -6.33781,11.05201 -3.21391,1.46436 -2.83922,1.50915 -5.51748,-0.65957 z M 153,449.94694 c 30.525,-2.24689 56.5125,-4.2877 57.75,-4.53514 l 2.25,-0.4499 0,-47.8385 0,-47.83849 -5.9939,-0.62648 c -11.18933,-1.16952 -19.58485,-6.16536 -23.47299,-13.96783 -4.22729,-8.48306 -3.28492,-24.82202 2.09448,-36.31459 4.68585,-10.01084 13.55654,-17.81134 23.12241,-20.33283 l 4.25,-1.12027 0,-77.96145 C 213,123.9891 213.07039,121 214.83593,121 c 1.95266,0 106.72091,11.52239 113.91407,12.52825 3.58587,0.50143 4.25,0.32498 4.25,-1.12912 0,-5.99111 11.61716,-17.13571 18.8774,-18.10951 4.9474,-0.66359 10.72592,2.01259 13.23692,6.13034 2.29816,3.76871 2.61523,13.82331 0.49796,15.79061 -1.14219,1.0613 1.29056,1.57348 13.75,2.89491 l 15.13772,1.60548 8,-7.6354 c 4.4,-4.19947 11.375,-10.66471 15.5,-14.3672 l 7.5,-6.7318 -104.5,0.29629 c -75.79778,0.21491 -105.46132,0.61446 -108,1.4547 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -10.0441,1.96019 -32.8537,10.66281 -38.40004,14.65088 -2.14502,1.54237 -4.2999,2.80431 -4.78861,2.80431 -0.48872,0 -5.08065,3.13709 -10.20429,6.9713 -11.6822,8.74224 -25.72956,23.37346 -31.60706,32.92078 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0161 C 96.24744,454.02494 122.475,452.19382 153,449.94694 z m 14.5,-34.10167 c -4.51615,-2.47015 -6.08883,-8.28177 -2.94678,-10.88944 2.18712,-1.81514 10.21171,-2.85952 13.979,-1.81932 6.46063,1.78386 8.93765,8.44509 4.482,12.05306 -2.56032,2.07322 -12.17929,2.47976 -15.51422,0.6557 z M 96.96003,393.16872 c -2.977905,-2.41136 -2.071472,-6.25728 2.568292,-10.89704 2.551088,-2.55109 4.111078,-3.32996 6.191058,-3.09106 2.33065,0.2677 2.83165,0.84956 3.09594,3.59566 0.38422,3.99222 -2.7186,9.40299 -6.33781,11.05201 -3.213907,1.46436 -2.839224,1.50915 -5.51748,-0.65957 z M 138.1228,246.04835 c -3.99824,-1.00368 -7.71624,-3.62187 -10.56101,-7.43699 -3.21459,-4.31108 -2.92806,-17.22521 0.54605,-24.61136 3.67751,-7.81857 11.02699,-16.40277 16.17862,-18.89663 9.00372,-4.35862 21.02217,-2.07164 27.42279,5.21827 5.45674,6.21487 5.59858,13.17716 0.48958,24.03104 -7.2676,15.43974 -21.89579,24.75328 -34.07603,21.69567 z m 31.80691,-34.68199 c 0.0651,-4.75841 -0.22229,-5.39796 -3.93259,-8.75 -4.43486,-4.00662 -6.54564,-4.89359 -3.21916,-1.35271 3.12633,3.32782 5.21254,9.02561 5.29233,14.45423 0.0965,6.5659 1.76336,2.66503 1.85942,-4.35152 z m 482.99638,224.22659 c -2.13464,-2.02686 -2.17912,-2.02979 -1.40849,-0.0929 0.43767,1.1 1.28776,4.00043 1.88908,6.4454 l 1.09332,4.44539 0.31517,-4.35244 c 0.24944,-3.4447 -0.14455,-4.78896 -1.88908,-6.4454 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 44.84037,-23.32208 c 1.60871,-7.54277 -0.42961,-12.02983 -6.98363,-15.37345 -5.34335,-2.72597 -5.55854,-2.44612 -1.53965,2.00231 3.39902,3.76231 5.66543,9.21196 5.67733,13.6513 0.003,1.14429 -1.09542,4.29429 -2.44109,7 l -2.44668,4.91948 3.38634,-3.84681 c 2.03531,-2.31207 3.76976,-5.64455 4.34738,-8.35283 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3672"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fac13c"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 32.28604,-40.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.00915,-11.83217 -67.98011,-111.82246 -68.54897,-112.41798 -1.72895,-1.80996 -28.59126,15.68766 -47.92001,31.21422 -12.84956,10.32191 -33.49859,30.43936 -43.77349,42.6466 -20.25574,24.06513 -35.62729,51.81515 -43.33888,78.23897 -5.89976,20.21559 -7.19699,49.40108 -3.11501,70.08276 6.87979,34.85702 26.52832,68.28157 57.55023,97.89996 5.77112,5.51002 18.27875,16.24758 27.79473,23.86124 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87091,-20.93747 5.34046,-28.41644 5.88373,-93.71696 l 0.51347,-61.71697 -7.20505,-10.78303 c -44.99778,-67.34348 -44.62831,-148.80188 0.99408,-219.16855 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 7.01638,-2.39072 13.88281,-1.41942 17.82349,2.52126 2.86874,2.86875 3.12917,3.66112 3.00326,9.13787 L 404.19234,691 l 16.97122,0 c 15.74099,0 16.93075,-0.12751 16.41294,-1.75898 -0.30706,-0.96744 -11.29304,-24.58228 -24.41331,-52.47743 l -23.85503,-50.71845 -1.27838,5.72743 C 384.00864,609.78822 370.8702,638.66564 359.26302,655 c -3.71288,5.225 -12.67096,15.4625 -19.90685,22.75 L 326.2,691 l 16.70383,0 16.70384,0 3.44616,-3.59733 z m 33.87226,-7.80972 c -2.13464,-2.02686 -2.17912,-2.02979 -1.40849,-0.0929 0.43767,1.1 1.28776,4.00043 1.88908,6.4454 l 1.09332,4.44539 0.31517,-4.35244 c 0.24944,-3.4447 -0.14455,-4.78896 -1.88908,-6.4454 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36061,-8.15 -1.99208,-12 -0.98541,-6.00792 -4.31351,-17.16997 -9.09394,-30.5 -2.02102,-5.63552 -4.77047,-11.1783 -7.93666,-16 -1.62523,-2.475 -3.27373,-5.175 -3.66335,-6 -4.95458,-10.49106 -31.55625,-36.09771 -44.00324,-42.35733 -2.84858,-1.43255 -5.46174,-3.06174 -5.80702,-3.62043 -2.10045,-3.39858 -29.7073,-12.57323 -44.90262,-14.92259 -6.34347,-0.98076 -11.38076,-1.51691 -11.19398,-1.19143 0.18679,0.32548 16.36935,27.0167 35.96124,59.31382 19.59188,32.29712 35.60908,59.07212 35.59377,59.5 -0.0153,0.42788 -6.65281,4.34979 -14.75,8.71535 -36.60013,19.73281 -62.84526,37.22468 -75.34674,50.21713 -8.08232,8.39975 -8.25975,8.92653 -4.73299,14.0525 3.006,4.36907 4.23997,5.45306 3.23943,2.84572 -0.91043,-2.37255 5.63132,-13.39121 10.54527,-17.76203 7.08573,-6.30256 12.18363,-8.2582 21.57287,-8.27576 6.73887,-0.0126 8.8907,0.42246 13.65015,2.75975 5.87024,2.88277 9.88714,7.17696 12.44899,13.30834 1.09615,2.62346 1.82206,3.31229 2.71211,2.57361 2.87141,-2.38306 10.71682,-3.46863 16.19988,-2.24157 14.46293,3.23666 21.13271,15.86582 15.0964,28.58492 -6.74418,14.21068 -24.41699,22.21666 -36.87622,16.70534 l -4.54418,-2.0101 -2.69902,2.81717 -2.69903,2.81718 15.88466,15.8352 c 21.07361,21.008 42.58731,48.20976 50.77049,64.19384 1.58673,3.09933 1.96407,3.29512 4.88762,2.536 1.74248,-0.45244 5.95172,-0.83883 9.35386,-0.85863 5.45535,-0.0317 6.53471,0.29853 9.14165,2.79729 1.62578,1.55832 3.21826,4.14479 3.53884,5.74773 0.92785,4.63924 -1.09108,12.8 -5.21734,21.08917 l -3.81814,7.67019 1.84259,5.82981 c 1.01343,3.20639 3.06153,11.45481 4.55135,18.32981 2.50536,11.56145 2.71124,14.26447 2.74204,36 0.0267,18.86475 -0.33663,25.47245 -1.8422,33.5 -1.60468,8.55606 -5.98937,25.07714 -8.14812,30.70139 -0.35918,0.93576 1.01952,0.12395 3.06377,-1.80403 4.78697,-4.51469 8.81372,-4.46995 9.23863,0.10264 0.38902,4.18641 -2.85718,9.68143 -6.6284,11.22025 -2.81864,1.15012 -3.36013,1.07 -5.1995,-0.76937 -1.43176,-1.43176 -1.84877,-2.7187 -1.3778,-4.25203 1.27622,-4.15504 -0.30819,-1.18326 -4.48605,8.41418 -9.05858,20.80952 -24.42035,43.00709 -43.08118,62.2518 l -11.50485,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z M 627.5,197.84527 c -4.51615,-2.47015 -6.08883,-8.28177 -2.94678,-10.88944 2.18712,-1.81514 10.21171,-2.85952 13.979,-1.81932 6.46063,1.78386 8.93765,8.44509 4.482,12.05306 -2.56032,2.07322 -12.17929,2.47976 -15.51422,0.6557 z M 425.30081,559.89268 c 16.33616,-8.16653 27.89505,-15.83928 35.42645,-23.51595 7.77766,-7.92767 8.29072,-9.73571 4.65711,-16.41185 C 459.31975,508.82219 447.94554,497.426 421.5,475.99574 413.8,469.75601 405.025,462.45845 402,459.77894 l -5.5,-4.87184 -0.60767,49.79645 c -0.47839,39.20279 -0.95323,51.81747 -2.23206,59.29645 -0.89342,5.225 -1.63247,10.03315 -1.64233,10.68478 -0.0184,1.21796 11.47305,-3.88927 33.28287,-14.7921 z m -17.06227,-45.61356 c -4.43228,-1.59317 -2.89475,-9.25155 2.65005,-13.19979 4.28409,-3.05054 7.52899,-2.46628 7.89019,1.42067 0.54981,5.91672 -6.11829,13.36858 -10.54024,11.77912 z M 153,449.94694 c 30.525,-2.24689 56.5125,-4.2877 57.75,-4.53514 l 2.25,-0.4499 0,-47.8385 0,-47.83849 -5.9939,-0.62648 c -11.41055,-1.19264 -19.64789,-6.183 -23.62543,-14.31281 -2.46769,-5.04377 -2.60785,-6.06637 -2.14105,-15.62135 0.99612,-20.38971 11.11472,-35.86433 26.34652,-40.29233 L 213,276.85808 213,198.92904 C 213,123.98814 213.0704,121 214.83593,121 c 1.95266,0 106.72091,11.52239 113.91407,12.52825 3.58587,0.50143 4.25,0.32498 4.25,-1.12912 0,-5.99111 11.61716,-17.13571 18.8774,-18.10951 4.9474,-0.66359 10.72592,2.01259 13.23692,6.13034 2.29816,3.76871 2.61523,13.82331 0.49796,15.79061 -1.14219,1.0613 1.29056,1.57348 13.75,2.89491 l 15.13772,1.60548 8,-7.6354 c 4.4,-4.19947 11.375,-10.66471 15.5,-14.3672 l 7.5,-6.7318 -104.5,0.29629 c -75.79778,0.21491 -105.46132,0.61446 -108,1.4547 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -10.0441,1.96019 -32.8537,10.66281 -38.40004,14.65088 -2.14502,1.54237 -4.2999,2.80431 -4.78861,2.80431 -0.48872,0 -5.08065,3.13709 -10.20429,6.9713 -11.6822,8.74224 -25.72956,23.37346 -31.60706,32.92078 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0161 C 96.24744,454.02494 122.475,452.19382 153,449.94694 z m 14.5,-34.10167 c -4.51615,-2.47015 -6.08883,-8.28177 -2.94678,-10.88944 2.18712,-1.81514 10.21171,-2.85952 13.979,-1.81932 6.46063,1.78386 8.93765,8.44509 4.482,12.05306 -2.56032,2.07322 -12.17929,2.47976 -15.51422,0.6557 z M 98.238541,394.27912 c -4.432278,-1.59317 -2.894748,-9.25155 2.650049,-13.19979 4.28409,-3.05054 7.52899,-2.46628 7.89019,1.42067 0.54981,5.91672 -6.11829,13.36858 -10.540239,11.77912 z m 38.614989,-148.8105 c -11.98596,-3.78881 -15.28992,-17.38708 -7.95745,-32.75089 3.93387,-8.24268 12.20765,-16.88355 17.71994,-18.50614 9.73443,-2.86542 19.22859,-0.56941 25.04679,6.05715 5.44029,6.19615 5.57594,13.51317 0.45049,24.29947 -7.5931,15.97936 -22.6302,24.89268 -35.25977,20.90041 z m 33.07618,-34.10226 c 0.0651,-4.75841 -0.22229,-5.39796 -3.93259,-8.75 -4.43486,-4.00662 -6.54564,-4.89359 -3.21916,-1.35271 3.12633,3.32782 5.21254,9.02561 5.29233,14.45423 0.0965,6.5659 1.76336,2.66503 1.85942,-4.35152 z m 482.99638,224.22659 c -2.13464,-2.02686 -2.17912,-2.02979 -1.40849,-0.0929 0.43767,1.1 1.28776,4.00043 1.88908,6.4454 l 1.09332,4.44539 0.31517,-4.35244 c 0.24944,-3.4447 -0.14455,-4.78896 -1.88908,-6.4454 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 44.84037,-23.32208 c 1.60871,-7.54277 -0.42961,-12.02983 -6.98363,-15.37345 -5.34335,-2.72597 -5.55854,-2.44612 -1.53965,2.00231 3.39902,3.76231 5.66543,9.21196 5.67733,13.6513 0.003,1.14429 -1.09542,4.29429 -2.44109,7 l -2.44668,4.91948 3.38634,-3.84681 c 2.03531,-2.31207 3.76976,-5.64455 4.34738,-8.35283 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3670"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f4c141"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 32.28604,-40.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.00915,-11.83217 -67.98011,-111.82246 -68.54897,-112.41798 -1.72895,-1.80996 -28.59126,15.68766 -47.92001,31.21422 -12.84956,10.32191 -33.49859,30.43936 -43.77349,42.6466 -20.25574,24.06513 -35.62729,51.81515 -43.33888,78.23897 -5.89976,20.21559 -7.19699,49.40108 -3.11501,70.08276 6.87979,34.85702 26.52832,68.28157 57.55023,97.89996 5.77112,5.51002 18.27875,16.24758 27.79473,23.86124 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87091,-20.93747 5.34046,-28.41644 5.88373,-93.71696 l 0.51347,-61.71697 -7.20505,-10.78303 c -44.99778,-67.34348 -44.62831,-148.80188 0.99408,-219.16855 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 7.01638,-2.39072 13.88281,-1.41942 17.82349,2.52126 2.86874,2.86875 3.12917,3.66112 3.00326,9.13787 L 404.19234,691 l 16.97122,0 c 15.74099,0 16.93075,-0.12751 16.41294,-1.75898 -0.30706,-0.96744 -11.29304,-24.58228 -24.41331,-52.47743 l -23.85503,-50.71845 -1.27838,5.72743 C 384.00864,609.78822 370.8702,638.66564 359.26302,655 c -3.71288,5.225 -12.67096,15.4625 -19.90685,22.75 L 326.2,691 l 16.70383,0 16.70384,0 3.44616,-3.59733 z m 33.87226,-7.80972 c -2.13464,-2.02686 -2.17912,-2.02979 -1.40849,-0.0929 0.43767,1.1 1.28776,4.00043 1.88908,6.4454 l 1.09332,4.44539 0.31517,-4.35244 c 0.24944,-3.4447 -0.14455,-4.78896 -1.88908,-6.4454 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36061,-8.15 -1.99208,-12 -0.98541,-6.00792 -4.31351,-17.16997 -9.09394,-30.5 -2.02102,-5.63552 -4.77047,-11.1783 -7.93666,-16 -1.62523,-2.475 -3.27373,-5.175 -3.66335,-6 -4.95458,-10.49106 -31.55625,-36.09771 -44.00324,-42.35733 -2.84858,-1.43255 -5.46174,-3.06174 -5.80702,-3.62043 -2.10045,-3.39858 -29.7073,-12.57323 -44.90262,-14.92259 -6.34347,-0.98076 -11.38076,-1.51691 -11.19398,-1.19143 0.18679,0.32548 16.36935,27.0167 35.96124,59.31382 19.59188,32.29712 35.60908,59.07212 35.59377,59.5 -0.0153,0.42788 -6.65281,4.34979 -14.75,8.71535 -36.60013,19.73281 -62.84526,37.22468 -75.34674,50.21713 -8.08232,8.39975 -8.25975,8.92653 -4.73299,14.0525 3.006,4.36907 4.23997,5.45306 3.23943,2.84572 -0.91043,-2.37255 5.63132,-13.39121 10.54527,-17.76203 7.08573,-6.30256 12.18363,-8.2582 21.57287,-8.27576 6.73887,-0.0126 8.8907,0.42246 13.65015,2.75975 5.87024,2.88277 9.88714,7.17696 12.44899,13.30834 1.09615,2.62346 1.82206,3.31229 2.71211,2.57361 2.87141,-2.38306 10.71682,-3.46863 16.19988,-2.24157 14.46293,3.23666 21.13271,15.86582 15.0964,28.58492 -6.74418,14.21068 -24.41699,22.21666 -36.87622,16.70534 l -4.54418,-2.0101 -2.69902,2.81717 -2.69903,2.81718 15.88466,15.8352 c 21.07361,21.008 42.58731,48.20976 50.77049,64.19384 1.58673,3.09933 1.96407,3.29512 4.88762,2.536 1.74248,-0.45244 5.95172,-0.83883 9.35386,-0.85863 5.45535,-0.0317 6.53471,0.29853 9.14165,2.79729 1.62578,1.55832 3.21826,4.14479 3.53884,5.74773 0.92785,4.63924 -1.09108,12.8 -5.21734,21.08917 l -3.81814,7.67019 1.84259,5.82981 c 1.01343,3.20639 3.06153,11.45481 4.55135,18.32981 2.50536,11.56145 2.71124,14.26447 2.74204,36 0.0267,18.86475 -0.33663,25.47245 -1.8422,33.5 -1.60468,8.55606 -5.98937,25.07714 -8.14812,30.70139 -0.35918,0.93576 1.01952,0.12395 3.06377,-1.80403 4.78697,-4.51469 8.81372,-4.46995 9.23863,0.10264 0.38902,4.18641 -2.85718,9.68143 -6.6284,11.22025 -2.81864,1.15012 -3.36013,1.07 -5.1995,-0.76937 -1.43176,-1.43176 -1.84877,-2.7187 -1.3778,-4.25203 1.27622,-4.15504 -0.30819,-1.18326 -4.48605,8.41418 -9.05858,20.80952 -24.42035,43.00709 -43.08118,62.2518 l -11.50485,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z M 629,198.34716 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 425.30081,559.89268 c 16.33616,-8.16653 27.89505,-15.83928 35.42645,-23.51595 7.77766,-7.92767 8.29072,-9.73571 4.65711,-16.41185 C 459.31975,508.82219 447.94554,497.426 421.5,475.99574 413.8,469.75601 405.025,462.45845 402,459.77894 l -5.5,-4.87184 -0.60767,49.79645 c -0.47839,39.20279 -0.95323,51.81747 -2.23206,59.29645 -0.89342,5.225 -1.63247,10.03315 -1.64233,10.68478 -0.0184,1.21796 11.47305,-3.88927 33.28287,-14.7921 z m -17.06227,-45.61356 c -4.43228,-1.59317 -2.89475,-9.25155 2.65005,-13.19979 4.28409,-3.05054 7.52899,-2.46628 7.89019,1.42067 0.54981,5.91672 -6.11829,13.36858 -10.54024,11.77912 z M 153,449.94694 c 30.525,-2.24689 56.5125,-4.2877 57.75,-4.53514 l 2.25,-0.4499 0,-47.8385 0,-47.83849 -5.9939,-0.62648 c -11.41055,-1.19264 -19.64789,-6.183 -23.62543,-14.31281 -2.46769,-5.04377 -2.60785,-6.06637 -2.14105,-15.62135 0.99612,-20.38971 11.11472,-35.86433 26.34652,-40.29233 L 213,276.85808 213,198.92904 C 213,123.98814 213.0704,121 214.83593,121 c 1.93258,0 106.66205,11.51482 113.82412,12.51476 3.96522,0.55361 4.19009,0.44401 4.8016,-2.34013 1.02349,-4.65993 5.91121,-10.40182 11.96379,-14.05456 7.28789,-4.39826 12.12934,-4.03196 17.48414,1.32284 3.45102,3.45102 3.59042,3.86803 3.59042,10.74042 0,5.4478 -0.35711,7.27915 -1.5,7.69246 -0.825,0.29836 5.475,1.28332 14,2.18882 l 15.5,1.64635 8,-7.6354 c 4.4,-4.19947 11.375,-10.66471 15.5,-14.3672 l 7.5,-6.7318 -104.5,0.29629 c -75.79778,0.21491 -105.46132,0.61446 -108,1.4547 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -10.0441,1.96019 -32.8537,10.66281 -38.40004,14.65088 -2.14502,1.54237 -4.2999,2.80431 -4.78861,2.80431 -0.48872,0 -5.08065,3.13709 -10.20429,6.9713 -11.6822,8.74224 -25.72956,23.37346 -31.60706,32.92078 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0161 C 96.24744,454.02494 122.475,452.19382 153,449.94694 z m 16,-33.59978 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 98.238541,394.27912 c -4.432278,-1.59317 -2.894748,-9.25155 2.650049,-13.19979 4.28409,-3.05054 7.52899,-2.46628 7.89019,1.42067 0.54981,5.91672 -6.11829,13.36858 -10.540239,11.77912 z m 38.614989,-148.8105 c -11.98596,-3.78881 -15.28992,-17.38708 -7.95745,-32.75089 3.93387,-8.24268 12.20765,-16.88355 17.71994,-18.50614 9.73443,-2.86542 19.22859,-0.56941 25.04679,6.05715 5.44029,6.19615 5.57594,13.51317 0.45049,24.29947 -7.5931,15.97936 -22.6302,24.89268 -35.25977,20.90041 z m 33.07618,-34.10226 c 0.0651,-4.75841 -0.22229,-5.39796 -3.93259,-8.75 -4.43486,-4.00662 -6.54564,-4.89359 -3.21916,-1.35271 3.12633,3.32782 5.21254,9.02561 5.29233,14.45423 0.0965,6.5659 1.76336,2.66503 1.85942,-4.35152 z m 482.99638,224.22659 c -2.13464,-2.02686 -2.17912,-2.02979 -1.40849,-0.0929 0.43767,1.1 1.28776,4.00043 1.88908,6.4454 l 1.09332,4.44539 0.31517,-4.35244 c 0.24944,-3.4447 -0.14455,-4.78896 -1.88908,-6.4454 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 44.84037,-23.32208 c 1.60871,-7.54277 -0.42961,-12.02983 -6.98363,-15.37345 -5.34335,-2.72597 -5.55854,-2.44612 -1.53965,2.00231 3.39902,3.76231 5.66543,9.21196 5.67733,13.6513 0.003,1.14429 -1.09542,4.29429 -2.44109,7 l -2.44668,4.91948 3.38634,-3.84681 c 2.03531,-2.31207 3.76976,-5.64455 4.34738,-8.35283 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3668"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e7c04f"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 32.28604,-40.34475 c 16.2124,-8.07266 39.59148,-22.38337 53.46501,-32.72679 15.87662,-11.83682 39.15146,-34.96361 48.48687,-48.17846 34.18198,-48.38664 39.68609,-107.71248 14.95894,-161.23429 -15.80994,-34.22054 -44.8444,-68.48784 -86.75361,-102.38907 -8.24289,-6.66785 -17.64029,-14.54285 -20.88311,-17.5 -8.10432,-7.3904 -16.799,-18.56028 -20.72868,-26.62972 -2.81685,-5.78429 -3.28717,-7.817 -3.29636,-14.24692 -0.009,-6.61273 0.38322,-8.22694 3.31927,-13.64479 4.57506,-8.44229 11.9238,-16.83139 23.1635,-26.44278 10.28262,-8.79296 32.40516,-23.96728 48.68984,-33.39739 5.60441,-3.24539 10.04131,-6.15144 9.85978,-6.45788 -7.00915,-11.83217 -67.98011,-111.82246 -68.54897,-112.41798 -1.72895,-1.80996 -28.59126,15.68766 -47.92001,31.21422 -12.84956,10.32191 -33.49859,30.43936 -43.77349,42.6466 -20.25574,24.06513 -35.62729,51.81515 -43.33888,78.23897 -5.89976,20.21559 -7.19699,49.40108 -3.11501,70.08276 6.87979,34.85702 26.52832,68.28157 57.55023,97.89996 5.77112,5.51002 18.27875,16.24758 27.79473,23.86124 31.57837,25.26561 51.34001,47.50445 56.80445,63.92511 3.25302,9.77531 2.55601,19.87875 -2.01285,29.17729 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.11587,6.25 3.43535,6.25 0.31949,0 5.18521,-2.29264 10.81272,-5.09475 z M 239.5,690.88752 C 296.94019,683.54701 343.00139,638.2421 357.8304,574.5 c 4.87091,-20.93747 5.34046,-28.41644 5.88373,-93.71696 l 0.51347,-61.71697 -7.20505,-10.78303 c -44.99778,-67.34348 -44.62831,-148.80188 0.99408,-219.16855 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 7.01638,-2.39072 13.88281,-1.41942 17.82349,2.52126 2.86874,2.86875 3.12917,3.66112 3.00326,9.13787 L 404.19234,691 l 16.97122,0 c 15.74099,0 16.93075,-0.12751 16.41294,-1.75898 -0.30706,-0.96744 -11.29304,-24.58228 -24.41331,-52.47743 l -23.85503,-50.71845 -1.27838,5.72743 C 384.00864,609.78822 370.8702,638.66564 359.26302,655 c -3.71288,5.225 -12.67096,15.4625 -19.90685,22.75 L 326.2,691 l 16.70383,0 16.70384,0 3.44616,-3.59733 z m 34.35367,-7.50488 c -2.37858,-2.6283 -3.76697,-2.38435 -2.00453,0.35221 0.79699,1.2375 1.81987,4.05 2.27305,6.25 l 0.82398,4 0.31249,-4.35221 c 0.21899,-3.04995 -0.2014,-4.92005 -1.40499,-6.25 z M 603.44167,670 c 2.29331,0 17.8365,-12.251 26.63321,-20.99204 9.29141,-9.23262 14.70282,-16.25435 22.42512,-29.09833 7.83012,-13.02332 13.74013,-30.23643 16.5663,-48.2499 1.81948,-11.59707 1.90498,-19.44766 1.84773,-169.65973 -0.033,-86.625 -0.43981,-159.75 -0.90399,-162.5 -0.46417,-2.75 -1.36061,-8.15 -1.99208,-12 -0.98541,-6.00792 -4.31351,-17.16997 -9.09394,-30.5 -2.02102,-5.63552 -4.77047,-11.1783 -7.93666,-16 -1.62523,-2.475 -3.27373,-5.175 -3.66335,-6 -4.95458,-10.49106 -31.55625,-36.09771 -44.00324,-42.35733 -2.84858,-1.43255 -5.46174,-3.06174 -5.80702,-3.62043 -2.10045,-3.39858 -29.7073,-12.57323 -44.90262,-14.92259 -6.34347,-0.98076 -11.38076,-1.51691 -11.19398,-1.19143 0.18679,0.32548 16.36935,27.0167 35.96124,59.31382 19.59188,32.29712 35.60908,59.07212 35.59377,59.5 -0.0153,0.42788 -6.65281,4.34979 -14.75,8.71535 -36.60013,19.73281 -62.84526,37.22468 -75.34674,50.21713 -8.08232,8.39975 -8.25975,8.92653 -4.73299,14.0525 3.006,4.36907 4.23997,5.45306 3.23943,2.84572 -0.91043,-2.37255 5.63132,-13.39121 10.54527,-17.76203 7.08573,-6.30256 12.18363,-8.2582 21.57287,-8.27576 6.73887,-0.0126 8.8907,0.42246 13.65015,2.75975 5.87024,2.88277 9.88714,7.17696 12.44899,13.30834 1.09615,2.62346 1.82206,3.31229 2.71211,2.57361 2.87141,-2.38306 10.71682,-3.46863 16.19988,-2.24157 14.46293,3.23666 21.13271,15.86582 15.0964,28.58492 -6.74418,14.21068 -24.41699,22.21666 -36.87622,16.70534 l -4.54418,-2.0101 -2.69902,2.81717 -2.69903,2.81718 15.88466,15.8352 c 21.07361,21.008 42.58731,48.20976 50.77049,64.19384 1.58673,3.09933 1.96407,3.29512 4.88762,2.536 1.74248,-0.45244 5.95172,-0.83883 9.35386,-0.85863 5.45535,-0.0317 6.53471,0.29853 9.14165,2.79729 1.62578,1.55832 3.21826,4.14479 3.53884,5.74773 0.92785,4.63924 -1.09108,12.8 -5.21734,21.08917 l -3.81814,7.67019 1.84259,5.82981 c 1.01343,3.20639 3.06153,11.45481 4.55135,18.32981 2.50536,11.56145 2.71124,14.26447 2.74204,36 0.0267,18.86475 -0.33663,25.47245 -1.8422,33.5 -1.60468,8.55606 -5.98937,25.07714 -8.14812,30.70139 -0.35918,0.93576 1.01952,0.12395 3.06377,-1.80403 4.78697,-4.51469 8.81372,-4.46995 9.23863,0.10264 0.38902,4.18641 -2.85718,9.68143 -6.6284,11.22025 -2.81864,1.15012 -3.36013,1.07 -5.1995,-0.76937 -1.43176,-1.43176 -1.84877,-2.7187 -1.3778,-4.25203 1.27622,-4.15504 -0.30819,-1.18326 -4.48605,8.41418 -9.05858,20.80952 -24.42035,43.00709 -43.08118,62.2518 l -11.50485,11.86483 6.16776,-3.61483 C 600.06103,671.62667 603.10884,670 603.44167,670 z M 629,198.34716 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 425.30081,559.89268 c 16.33616,-8.16653 27.89505,-15.83928 35.42645,-23.51595 7.77766,-7.92767 8.29072,-9.73571 4.65711,-16.41185 C 459.31975,508.82219 447.94554,497.426 421.5,475.99574 413.8,469.75601 405.025,462.45845 402,459.77894 l -5.5,-4.87184 -0.60767,49.79645 c -0.47839,39.20279 -0.95323,51.81747 -2.23206,59.29645 -0.89342,5.225 -1.63247,10.03315 -1.64233,10.68478 -0.0184,1.21796 11.47305,-3.88927 33.28287,-14.7921 z m -17.06227,-45.61356 c -4.43228,-1.59317 -2.89475,-9.25155 2.65005,-13.19979 4.28409,-3.05054 7.52899,-2.46628 7.89019,1.42067 0.54981,5.91672 -6.11829,13.36858 -10.54024,11.77912 z M 153,449.94694 c 30.525,-2.24689 56.5125,-4.2877 57.75,-4.53514 l 2.25,-0.4499 0,-47.8385 0,-47.83849 -5.9939,-0.62648 c -11.41055,-1.19264 -19.64789,-6.183 -23.62543,-14.31281 -2.46769,-5.04377 -2.60785,-6.06637 -2.14105,-15.62135 0.99612,-20.38971 11.11472,-35.86433 26.34652,-40.29233 L 213,276.85808 213,198.92904 C 213,123.98814 213.0704,121 214.83593,121 c 1.93258,0 106.66205,11.51482 113.82412,12.51476 3.96522,0.55361 4.19009,0.44401 4.8016,-2.34013 1.02349,-4.65993 5.91121,-10.40182 11.96379,-14.05456 7.28789,-4.39826 12.12934,-4.03196 17.48414,1.32284 3.45102,3.45102 3.59042,3.86803 3.59042,10.74042 0,5.4478 -0.35711,7.27915 -1.5,7.69246 -0.825,0.29836 5.475,1.28332 14,2.18882 l 15.5,1.64635 8,-7.6354 c 4.4,-4.19947 11.375,-10.66471 15.5,-14.3672 l 7.5,-6.7318 -104.5,0.29629 c -75.79778,0.21491 -105.46132,0.61446 -108,1.4547 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -10.0441,1.96019 -32.8537,10.66281 -38.40004,14.65088 -2.14502,1.54237 -4.2999,2.80431 -4.78861,2.80431 -0.48872,0 -5.08065,3.13709 -10.20429,6.9713 -11.6822,8.74224 -25.72956,23.37346 -31.60706,32.92078 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0161 C 96.24744,454.02494 122.475,452.19382 153,449.94694 z m 16,-33.59978 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 98.238541,394.27912 c -4.432278,-1.59317 -2.894748,-9.25155 2.650049,-13.19979 4.28409,-3.05054 7.52899,-2.46628 7.89019,1.42067 0.54981,5.91672 -6.11829,13.36858 -10.540239,11.77912 z m 38.614989,-148.8105 c -11.98596,-3.78881 -15.28992,-17.38708 -7.95745,-32.75089 3.93387,-8.24268 12.20765,-16.88355 17.71994,-18.50614 9.73443,-2.86542 19.22859,-0.56941 25.04679,6.05715 5.44029,6.19615 5.57594,13.51317 0.45049,24.29947 -7.5931,15.97936 -22.6302,24.89268 -35.25977,20.90041 z m 33.4484,-33.60528 c 0.0897,-5.42575 -1.70044,-8.57356 -6.43345,-11.31298 l -3.36848,-1.94964 2.7237,3.24511 c 3.44705,4.10693 5.11252,10.22993 4.52801,16.6469 L 167.2956,223.5 168.76046,220 c 0.80567,-1.925 1.49933,-5.5865 1.54147,-8.13666 z M 653.4075,435.89779 c -2.37858,-2.6283 -3.76697,-2.38435 -2.00453,0.35221 0.79699,1.2375 1.81987,4.05 2.27305,6.25 l 0.82398,4 0.31249,-4.35221 c 0.21899,-3.04995 -0.2014,-4.92005 -1.40499,-6.25 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 45.08961,-22.95521 c 2.06608,-7.67286 -2.47608,-15.23546 -10.32728,-17.19468 -2.65441,-0.6624 -2.61932,-0.56483 1.1539,3.20839 6.68066,6.68066 7.61308,15.13902 2.53195,22.96848 l -2.49893,3.85058 4.01976,-4.37228 c 2.22768,-2.42304 4.51053,-6.19487 5.1206,-8.46049 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3666"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e0be53"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 36.57033,-42.62542 c 31.96064,-16.52531 54.90449,-32.8959 76.452,-54.54903 16.35636,-16.43652 25.05164,-28.00957 33.86699,-45.07555 10.3626,-20.06138 15.19248,-37.133 17.07922,-60.36802 5.1366,-63.2567 -28.0535,-122.82035 -101.58162,-182.30055 -19.63898,-15.88685 -25.55334,-21.36226 -32.49632,-30.08451 -10.31811,-12.96233 -14.5695,-25.28468 -12.00134,-34.78503 1.48235,-5.48366 7.57131,-15.19817 13.62861,-21.74351 11.83799,-12.79177 35.8449,-30.52662 61.18984,-45.20334 5.60441,-3.24539 10.04512,-6.15144 9.86826,-6.45788 C 564.92673,217.96326 522.48983,148.11117 509.78295,127.25 502.66389,115.5625 496.60579,106 496.32049,106 c -1.44732,0 -20.23546,11.78551 -30.50677,19.13643 -39.75802,28.45381 -72.81804,65.07555 -90.491,100.24007 -13.63527,27.13056 -18.65916,47.46098 -18.68746,75.6235 -0.0193,19.21741 2.21269,32.93456 7.94409,48.82173 13.50486,37.43476 35.9383,65.82331 79.61887,100.75425 31.50059,25.19072 51.36955,47.60017 56.87666,64.14902 3.17649,9.54537 2.44201,19.74684 -2.08506,28.96033 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.17251,6.25 3.56123,6.25 0.38872,0 7.12573,-3.31894 14.97113,-7.37542 z M 239.5,690.88752 C 296.86012,683.55725 343.02206,638.15324 357.8304,574.5 c 4.87091,-20.93747 5.34046,-28.41644 5.88373,-93.71696 l 0.51347,-61.71697 -7.20505,-10.78303 c -44.99778,-67.34348 -44.62831,-148.80188 0.99408,-219.16855 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 7.01638,-2.39072 13.88281,-1.41942 17.82349,2.52126 2.86874,2.86875 3.12917,3.66112 3.00326,9.13787 L 404.19234,691 l 17.01082,0 c 15.77713,0 16.96455,-0.12692 16.37289,-1.75 -0.35087,-0.9625 -11.31151,-24.52521 -24.35699,-52.36158 L 389.5,586.27684 l -2.20223,8.27771 c -5.44614,20.47084 -16.22536,43.67256 -28.08218,60.44545 -3.69358,5.225 -12.64945,15.4625 -19.90195,22.75 l -13.18637,13.25 16.7402,0 16.7402,0 3.44616,-3.59733 z m 34.35367,-7.50488 c -2.37858,-2.6283 -3.76697,-2.38435 -2.00453,0.35221 0.79699,1.2375 1.81987,4.05 2.27305,6.25 l 0.82398,4 0.31249,-4.35221 c 0.21899,-3.04995 -0.2014,-4.92005 -1.40499,-6.25 z M 603.5,669.95569 c 6.94339,-3.37999 20.88007,-14.53078 29.36701,-23.49664 9.09971,-9.61322 17.25677,-21.39385 24.40031,-35.23954 4.28961,-8.31416 9.59877,-25.90605 11.74422,-38.9144 1.87297,-11.35629 1.94501,-17.81215 1.89472,-169.80511 -0.0287,-86.9 -0.43204,-160.25 -0.89622,-163 -0.46417,-2.75 -1.3567,-8.15 -1.9834,-12 -2.35622,-14.4749 -10.36929,-36.34247 -17.03928,-46.5 -1.62523,-2.475 -3.27373,-5.175 -3.66335,-6 -3.24022,-6.86099 -18.86048,-23.88513 -29.81993,-32.5 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.46337,-3.0749 -5.81065,-3.63681 -2.09092,-3.38318 -29.47675,-12.53464 -44.41716,-14.84278 -6.60815,-1.02089 -11.86087,-1.59009 -11.67273,-1.26488 0.18814,0.3252 16.40064,27.0887 36.02777,59.47443 21.80238,35.975 35.32666,59.24219 34.76282,59.80603 -0.50758,0.50758 -9.65017,5.76023 -20.31685,11.67256 -39.41945,21.84938 -64.54324,39.6344 -74.58261,52.7967 l -2.47445,3.24416 3.12959,4.5487 c 3.16408,4.59884 4.43169,5.74994 3.41536,3.10144 -0.91043,-2.37255 5.63132,-13.39121 10.54527,-17.76203 7.08573,-6.30256 12.18363,-8.2582 21.57287,-8.27576 6.73887,-0.0126 8.8907,0.42246 13.65015,2.75975 5.87024,2.88277 9.88714,7.17696 12.44899,13.30834 1.09615,2.62346 1.82206,3.31229 2.71211,2.57361 2.87141,-2.38306 10.71682,-3.46863 16.19988,-2.24157 14.46293,3.23666 21.13271,15.86582 15.0964,28.58492 -6.74418,14.21068 -24.41699,22.21666 -36.87622,16.70534 l -4.54418,-2.0101 -2.71695,2.83588 -2.71695,2.83589 15.90482,15.8165 c 21.03226,20.91546 42.57679,48.13986 50.78618,64.17512 1.58673,3.09933 1.96407,3.29512 4.88762,2.536 1.74248,-0.45244 5.95172,-0.83883 9.35386,-0.85863 5.45535,-0.0317 6.53471,0.29853 9.14165,2.79729 1.62578,1.55832 3.21826,4.14479 3.53884,5.74773 0.92785,4.63924 -1.09108,12.8 -5.21734,21.08917 l -3.81814,7.67019 1.84259,5.82981 c 1.01343,3.20639 3.06459,11.45481 4.55814,18.32981 2.52783,11.63589 2.71659,14.1591 2.73065,36.5 0.012,19.12187 -0.3497,25.8293 -1.77969,33 -1.60176,8.032 -6.45498,26.20475 -8.19914,30.70139 -0.36297,0.93576 1.01263,0.12395 3.05688,-1.80403 4.78697,-4.51469 8.81372,-4.46995 9.23863,0.10264 0.38902,4.18641 -2.85718,9.68143 -6.6284,11.22025 -2.81864,1.15012 -3.36013,1.07 -5.1995,-0.76937 -1.43176,-1.43176 -1.84877,-2.7187 -1.3778,-4.25203 1.27622,-4.15504 -0.30819,-1.18326 -4.48605,8.41418 -9.02175,20.7249 -24.0605,42.47544 -42.98876,62.17463 -9.8594,10.26096 -10.92361,11.66169 -7.09827,9.34292 2.475,-1.50025 6.3,-3.60395 8.5,-4.67489 z M 629,198.34716 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 425.42105,559.86198 c 20.76269,-10.3786 36.72109,-22.14007 41.11769,-30.30406 l 1.94611,-3.6137 -2.85293,-5.44902 c -5.86946,-11.21052 -18.63311,-24.10662 -43.9529,-44.40898 -7.05154,-5.65419 -15.60154,-12.76208 -19,-15.79532 l -6.17902,-5.51498 -0.60767,49.86204 c -0.4785,39.26401 -0.95292,51.88124 -2.23206,59.36204 -0.89342,5.225 -1.63247,10.03315 -1.64233,10.68478 -0.0184,1.21379 11.91715,-4.08266 33.40311,-14.8228 z m -17.18251,-45.58286 c -4.43228,-1.59317 -2.89475,-9.25155 2.65005,-13.19979 4.28409,-3.05054 7.52899,-2.46628 7.89019,1.42067 0.54981,5.91672 -6.11829,13.36858 -10.54024,11.77912 z M 153,449.95624 c 30.525,-2.24184 56.5125,-4.28268 57.75,-4.53521 l 2.25,-0.45913 0,-47.8385 0,-47.83849 -5.9939,-0.62648 c -11.41055,-1.19264 -19.64789,-6.183 -23.62543,-14.31281 -2.46769,-5.04377 -2.60785,-6.06637 -2.14105,-15.62135 0.99612,-20.38971 11.11472,-35.86433 26.34652,-40.29233 L 213,276.85808 213,198.92904 C 213,123.98814 213.0704,121 214.83593,121 c 2.06245,0 107.34675,11.64782 113.81301,12.59137 3.97376,0.57985 4.17649,0.47995 4.80159,-2.36614 1.03398,-4.70769 5.89931,-10.43852 11.97491,-14.10516 7.28789,-4.39826 12.12934,-4.03196 17.48414,1.32284 3.45102,3.45102 3.59042,3.86803 3.59042,10.74042 0,5.4478 -0.35711,7.27915 -1.5,7.69246 -0.825,0.29836 5.475,1.26964 14,2.15841 l 15.5,1.61596 12,-11.18993 c 6.6,-6.15446 13.575,-12.59777 15.5,-14.31847 l 3.5,-3.12855 -104.5,0.27796 c -75.84235,0.20174 -105.45983,0.59564 -108,1.43638 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -10.0441,1.96019 -32.8537,10.66281 -38.40004,14.65088 -2.14502,1.54237 -4.2999,2.80431 -4.78861,2.80431 -0.48872,0 -5.08065,3.13709 -10.20429,6.9713 -11.6822,8.74224 -25.72956,23.37346 -31.60706,32.92078 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0162 C 96.24744,454.02504 122.475,452.19808 153,449.95624 z m 16,-33.60908 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 98.238541,394.27912 c -4.432278,-1.59317 -2.894748,-9.25155 2.650049,-13.19979 4.28409,-3.05054 7.52899,-2.46628 7.89019,1.42067 0.54981,5.91672 -6.11829,13.36858 -10.540239,11.77912 z m 38.614989,-148.8105 c -11.98596,-3.78881 -15.28992,-17.38708 -7.95745,-32.75089 3.93387,-8.24268 12.20765,-16.88355 17.71994,-18.50614 9.73443,-2.86542 19.22859,-0.56941 25.04679,6.05715 5.44029,6.19615 5.57594,13.51317 0.45049,24.29947 -7.5931,15.97936 -22.6302,24.89268 -35.25977,20.90041 z m 33.4484,-33.60528 c 0.0897,-5.42575 -1.70044,-8.57356 -6.43345,-11.31298 l -3.36848,-1.94964 2.7237,3.24511 c 3.44705,4.10693 5.11252,10.22993 4.52801,16.6469 L 167.2956,223.5 168.76046,220 c 0.80567,-1.925 1.49933,-5.5865 1.54147,-8.13666 z M 653.4075,435.89779 c -2.37858,-2.6283 -3.76697,-2.38435 -2.00453,0.35221 0.79699,1.2375 1.81987,4.05 2.27305,6.25 l 0.82398,4 0.31249,-4.35221 c 0.21899,-3.04995 -0.2014,-4.92005 -1.40499,-6.25 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 45.08961,-22.95521 c 2.06608,-7.67286 -2.47608,-15.23546 -10.32728,-17.19468 -2.65441,-0.6624 -2.61932,-0.56483 1.1539,3.20839 6.68066,6.68066 7.61308,15.13902 2.53195,22.96848 l -2.49893,3.85058 4.01976,-4.37228 c 2.22768,-2.42304 4.51053,-6.19487 5.1206,-8.46049 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3664"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e4be4e"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 36.57033,-42.62542 c 31.96064,-16.52531 54.90449,-32.8959 76.452,-54.54903 16.35636,-16.43652 25.05164,-28.00957 33.86699,-45.07555 10.3626,-20.06138 15.19248,-37.133 17.07922,-60.36802 5.1366,-63.2567 -28.0535,-122.82035 -101.58162,-182.30055 -19.63898,-15.88685 -25.55334,-21.36226 -32.49632,-30.08451 -10.31811,-12.96233 -14.5695,-25.28468 -12.00134,-34.78503 1.48235,-5.48366 7.57131,-15.19817 13.62861,-21.74351 11.83799,-12.79177 35.8449,-30.52662 61.18984,-45.20334 5.60441,-3.24539 10.04512,-6.15144 9.86826,-6.45788 C 564.92673,217.96326 522.48983,148.11117 509.78295,127.25 502.66389,115.5625 496.60579,106 496.32049,106 c -1.44732,0 -20.23546,11.78551 -30.50677,19.13643 -39.75802,28.45381 -72.81804,65.07555 -90.491,100.24007 -13.63527,27.13056 -18.65916,47.46098 -18.68746,75.6235 -0.0193,19.21741 2.21269,32.93456 7.94409,48.82173 13.50486,37.43476 35.9383,65.82331 79.61887,100.75425 31.50059,25.19072 51.36955,47.60017 56.87666,64.14902 3.17649,9.54537 2.44201,19.74684 -2.08506,28.96033 -6.8975,14.03779 -27.58795,30.90803 -54.72645,44.62195 -6.74012,3.406 -12.2567,6.64338 -12.25907,7.19418 -0.002,0.5508 10.38297,23.0508 23.07852,50 12.69555,26.9492 24.36732,51.81104 25.93728,55.24854 1.56996,3.4375 3.17251,6.25 3.56123,6.25 0.38872,0 7.12573,-3.31894 14.97113,-7.37542 z M 239.5,690.88752 C 296.86012,683.55725 343.02206,638.15324 357.8304,574.5 c 4.87091,-20.93747 5.34046,-28.41644 5.88373,-93.71696 l 0.51347,-61.71697 -7.20505,-10.78303 c -44.99778,-67.34348 -44.62831,-148.80188 0.99408,-219.16855 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.14196,-8.90477 -15.38583,-32.57433 -16.41272,-74.08305 l -0.60648,-24.51486 -54.82223,4.06479 c -30.15222,2.23564 -55.084281,4.32685 -55.404573,4.64714 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 6.25632,-2.13174 13.75606,-1.38843 17.03071,1.68796 3.00363,2.82176 4.52006,7.859 3.76557,12.50837 l -0.5614,3.45954 17.23783,0 c 15.99333,0 17.19177,-0.12634 16.5999,-1.75 -0.35087,-0.9625 -11.31151,-24.52521 -24.35699,-52.36158 L 389.5,586.27684 l -2.20223,8.27771 c -5.44614,20.47084 -16.22536,43.67256 -28.08218,60.44545 -3.69358,5.225 -12.64945,15.4625 -19.90195,22.75 l -13.18637,13.25 16.7402,0 16.7402,0 3.44616,-3.59733 z m 34.35367,-7.50488 c -2.37858,-2.6283 -3.76697,-2.38435 -2.00453,0.35221 0.79699,1.2375 1.81987,4.05 2.27305,6.25 l 0.82398,4 0.31249,-4.35221 c 0.21899,-3.04995 -0.2014,-4.92005 -1.40499,-6.25 z M 603.5,669.95569 c 6.94339,-3.37999 20.88007,-14.53078 29.36701,-23.49664 9.09971,-9.61322 17.25677,-21.39385 24.40031,-35.23954 4.28961,-8.31416 9.59877,-25.90605 11.74422,-38.9144 1.87297,-11.35629 1.94501,-17.81215 1.89472,-169.80511 -0.0287,-86.9 -0.43204,-160.25 -0.89622,-163 -0.46417,-2.75 -1.3567,-8.15 -1.9834,-12 -2.35622,-14.4749 -10.36929,-36.34247 -17.03928,-46.5 -1.62523,-2.475 -3.27373,-5.175 -3.66335,-6 -3.24022,-6.86099 -18.86048,-23.88513 -29.81993,-32.5 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.46337,-3.0749 -5.81065,-3.63681 -2.09092,-3.38318 -29.47675,-12.53464 -44.41716,-14.84278 -6.60815,-1.02089 -11.86087,-1.59009 -11.67273,-1.26488 0.18814,0.3252 16.40064,27.0887 36.02777,59.47443 21.80238,35.975 35.32666,59.24219 34.76282,59.80603 -0.50758,0.50758 -9.65017,5.76023 -20.31685,11.67256 -39.41945,21.84938 -64.54324,39.6344 -74.58261,52.7967 l -2.47445,3.24416 3.12959,4.5487 c 3.16408,4.59884 4.43169,5.74994 3.41536,3.10144 -0.89696,-2.33745 5.60399,-13.37031 10.32892,-17.52936 7.13619,-6.28152 12.55417,-8.38492 21.78922,-8.45911 6.77224,-0.0544 8.85484,0.35555 13.57008,2.67125 5.6042,2.75228 10.68314,8.355 12.92918,14.26255 0.76572,2.01398 1.35726,2.45093 2.28061,1.68462 0.6857,-0.56908 3.3314,-1.55962 5.87934,-2.2012 9.72127,-2.44784 21.58459,2.67566 25.93341,11.20006 4.0399,7.91885 1.16335,18.40419 -7.2601,26.46387 -8.93676,8.55083 -20.99374,11.58859 -30.06652,7.57527 l -4.57887,-2.02545 -2.71695,2.83588 -2.71695,2.83589 15.90482,15.8165 c 21.03226,20.91546 42.57679,48.13986 50.78618,64.17512 1.58673,3.09933 1.96407,3.29512 4.88762,2.536 1.74248,-0.45244 5.94503,-0.83883 9.33899,-0.85863 5.18473,-0.0303 6.58324,0.35164 8.75152,2.38974 5.65547,5.31593 5.2423,14.15498 -1.2735,27.24445 l -3.81814,7.67019 1.84259,5.82981 c 1.01343,3.20639 3.06459,11.45481 4.55814,18.32981 2.52783,11.63589 2.71659,14.1591 2.73065,36.5 0.012,19.12187 -0.3497,25.8293 -1.77969,33 -1.60176,8.032 -6.45498,26.20475 -8.19914,30.70139 -0.36297,0.93576 1.01263,0.12395 3.05688,-1.80403 2.66512,-2.51352 4.4586,-3.41938 6.33833,-3.20138 2.38903,0.27706 2.61369,0.68328 2.53326,4.58049 C 662.3024,595.07403 658.1762,600 653.84809,600 c -3.14301,0 -5.21612,-2.81235 -4.18517,-5.67756 1.6616,-4.61794 -0.78513,0.0824 -4.57589,8.79059 -9.02175,20.7249 -24.0605,42.47544 -42.98876,62.17463 -9.8594,10.26096 -10.92361,11.66169 -7.09827,9.34292 2.475,-1.50025 6.3,-3.60395 8.5,-4.67489 z M 629,198.34716 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 425.42105,559.86198 c 20.76269,-10.3786 36.72109,-22.14007 41.11769,-30.30406 l 1.94611,-3.6137 -2.85293,-5.44902 c -5.86946,-11.21052 -18.63311,-24.10662 -43.9529,-44.40898 -7.05154,-5.65419 -15.60154,-12.76208 -19,-15.79532 l -6.17902,-5.51498 -0.60767,49.86204 c -0.4785,39.26401 -0.95292,51.88124 -2.23206,59.36204 -0.89342,5.225 -1.63247,10.03315 -1.64233,10.68478 -0.0184,1.21379 11.91715,-4.08266 33.40311,-14.8228 z m -19.40883,-47.83914 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 153,449.95624 c 30.525,-2.24184 56.5125,-4.28268 57.75,-4.53521 L 213,444.9619 213,396.98095 213,349 l -3.25,-0.0119 c -4.04611,-0.0148 -12.25074,-2.15958 -16.32515,-4.26762 -4.3158,-2.23292 -9.95342,-8.76204 -11.43071,-13.23826 -0.81629,-2.4734 -1.0738,-7.09666 -0.74526,-13.38071 0.5598,-10.7077 2.85824,-18.06073 8.06834,-25.81183 5.06476,-7.53488 11.517,-11.81366 22.43278,-14.87624 0.98632,-0.27672 1.25,-16.81069 1.25,-78.38209 C 213,123.99119 213.07038,121 214.83593,121 c 2.06245,0 107.34675,11.64782 113.81301,12.59137 3.97376,0.57985 4.17649,0.47995 4.80159,-2.36614 1.03398,-4.70769 5.89931,-10.43852 11.97491,-14.10516 7.28789,-4.39826 12.12934,-4.03196 17.48414,1.32284 3.45102,3.45102 3.59042,3.86803 3.59042,10.74042 0,5.4478 -0.35711,7.27915 -1.5,7.69246 -0.825,0.29836 5.475,1.26964 14,2.15841 l 15.5,1.61596 12,-11.18993 c 6.6,-6.15446 13.575,-12.59777 15.5,-14.31847 l 3.5,-3.12855 -104.5,0.27796 c -75.84235,0.20174 -105.45983,0.59564 -108,1.43638 -1.925,0.63712 -7.325,1.90489 -12,2.81726 -10.0441,1.96019 -32.8537,10.66281 -38.40004,14.65088 -2.14502,1.54237 -4.2999,2.80431 -4.78861,2.80431 -0.48872,0 -5.08065,3.13709 -10.20429,6.9713 -11.6822,8.74224 -25.72956,23.37346 -31.60706,32.92078 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0162 C 96.24744,454.02504 122.475,452.19808 153,449.95624 z m 16,-33.60908 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 96.012222,392.02284 c -2.352864,-4.39637 4.977198,-13.58958 10.239508,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.851184,4.00699 -9.462418,0.99637 z M 136.58194,245.24523 c -14.1751,-5.03021 -15.54418,-22.26169 -3.14948,-39.64011 3.96631,-5.5611 6.24739,-7.70273 10.49685,-9.85512 9.83866,-4.98337 21.0038,-3.14597 27.77994,4.57164 1.75566,1.99958 3.4992,5.27255 3.87453,7.27326 2.06971,11.03252 -8.29224,29.14132 -20.43571,35.71396 -6.41777,3.4736 -12.45874,4.10366 -18.56613,1.93637 z m 33.71999,-33.38189 c 0.0897,-5.42575 -1.70044,-8.57356 -6.43345,-11.31298 l -3.36848,-1.94964 2.7237,3.24511 c 3.44705,4.10693 5.11252,10.22993 4.52801,16.6469 L 167.2956,223.5 168.76046,220 c 0.80567,-1.925 1.49933,-5.5865 1.54147,-8.13666 z M 653.4075,435.89779 c -2.37858,-2.6283 -3.76697,-2.38435 -2.00453,0.35221 0.79699,1.2375 1.81987,4.05 2.27305,6.25 l 0.82398,4 0.31249,-4.35221 c 0.21899,-3.04995 -0.2014,-4.92005 -1.40499,-6.25 z M 564,344.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 45.08961,-22.95521 c 2.06608,-7.67286 -2.47608,-15.23546 -10.32728,-17.19468 -2.65441,-0.6624 -2.61932,-0.56483 1.1539,3.20839 6.68066,6.68066 7.61308,15.13902 2.53195,22.96848 l -2.49893,3.85058 4.01976,-4.37228 c 2.22768,-2.42304 4.51053,-6.19487 5.1206,-8.46049 z M 530,316.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z"
+       id="path3662"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f0be41"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 36.57033,-42.62542 c 18.28035,-9.45189 34.83352,-19.73399 49.94754,-31.02523 15.222,-11.3719 38.75288,-34.83238 47.74217,-47.59935 8.05434,-11.43911 17.47179,-29.36664 21.56733,-41.05667 9.26183,-26.43635 11.12408,-57.82252 5.08473,-85.69753 -9.96448,-45.99169 -42.70319,-91.8166 -96.75972,-135.43616 -26.63909,-21.49573 -36.93327,-32.31612 -43.16299,-45.36932 -5.5779,-11.68744 -5.11227,-19.93763 1.75997,-31.18332 9.71324,-15.8947 35.17923,-36.52759 70.14946,-56.83606 5.4993,-3.19364 9.85401,-6.05734 9.67715,-6.36378 C 564.92673,217.96326 522.48983,148.11117 509.78295,127.25 502.66389,115.5625 496.60579,106 496.32049,106 c -1.44732,0 -20.23546,11.78551 -30.50677,19.13643 -22.82079,16.33226 -49.47599,41.17619 -64.77907,60.37721 -17.88728,22.44346 -31.92512,48.75573 -39.06638,73.22533 -5.89976,20.21559 -7.19699,49.40108 -3.11501,70.08276 3.98101,20.1701 12.47267,40.3785 24.87322,59.19311 14.28171,21.66878 31.71813,39.69813 60.76741,62.8338 31.02832,24.71184 51.08161,47.35074 56.58099,63.87636 3.20759,9.63884 2.44743,19.85014 -2.15748,28.98144 -7.22317,14.32318 -27.6941,31.01135 -54.71068,44.60084 -10.40432,5.23344 -12.24225,6.50253 -11.86493,8.19272 0.24557,1.1 10.43759,23.15 22.64894,49 12.21135,25.85 23.70839,50.2625 25.54897,54.25 1.84058,3.9875 3.66194,7.25 4.04745,7.25 0.38552,0 7.11991,-3.31894 14.96531,-7.37542 z M 239.5,690.88752 c 30.51451,-3.89957 56.49963,-17.35758 78.59671,-40.7062 19.13749,-20.2214 32.95354,-46.53703 39.73369,-75.68132 4.88726,-21.00775 5.35095,-28.39208 5.88512,-93.72252 l 0.50467,-61.72252 -7.20134,-10.77748 c -44.99385,-67.33749 -44.62298,-148.79884 0.99778,-219.16299 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.13771,-8.90104 -15.34742,-32.42743 -16.40495,-74.08275 l -0.62236,-24.51455 -54.81817,4.06448 c -30.15,2.23547 -55.080231,4.32655 -55.400523,4.64684 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 6.25632,-2.13174 13.75606,-1.38843 17.03071,1.68796 3.00363,2.82176 4.52006,7.859 3.76557,12.50837 l -0.5614,3.45954 17.23783,0 c 15.99063,0 17.19219,-0.12662 16.607,-1.75 -0.34696,-0.9625 -11.3076,-24.52172 -24.35699,-52.35383 L 389.5,586.29234 l -2.20223,8.26996 c -5.4532,20.4782 -16.22952,43.6707 -28.08218,60.4377 -3.69358,5.225 -12.64945,15.4625 -19.90195,22.75 l -13.18637,13.25 16.7402,0 16.7402,0 3.44616,-3.59733 z m 34.35367,-7.50488 c -2.37858,-2.6283 -3.76697,-2.38435 -2.00453,0.35221 0.79699,1.2375 1.81987,4.05 2.27305,6.25 l 0.82398,4 0.31249,-4.35221 c 0.21899,-3.04995 -0.2014,-4.92005 -1.40499,-6.25 z M 603.5,669.95569 c 6.91566,-3.3665 20.86691,-14.51687 29.2683,-23.39237 9.10204,-9.61567 12.80146,-14.51499 17.17108,-22.74047 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.44816,-2.13108 12.13468,-28.12846 14.98722,-44.85437 1.97162,-11.56061 2.01909,-15.70351 1.94787,-170 C 670.88685,315.66778 670.4764,242.25 670.01491,239.5 c -3.22426,-19.21282 -4.28443,-23.94225 -7.0612,-31.5 -1.71763,-4.675 -3.55982,-9.97622 -4.09375,-11.78048 -1.64406,-5.55554 -9.83357,-19.52725 -17.32608,-29.55914 -5.17147,-6.9242 -16.16797,-17.98044 -24.0298,-24.16038 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.49369,-3.12396 -5.87802,-3.74582 -1.94639,-3.14932 -28.36299,-12.19282 -41.94275,-14.35874 -14.5879,-2.32671 -14.46904,-2.31277 -14.10203,-1.65417 0.18559,0.33305 16.40477,27.10024 36.04262,59.48266 21.98188,36.24767 35.34815,59.23414 34.77626,59.80603 -0.5109,0.5109 -9.6562,5.76626 -20.32288,11.67859 -39.26098,21.76154 -64.53423,39.62259 -74.43721,52.60607 l -2.71228,3.55597 2.79411,4.0319 c 3.00143,4.33108 4.79592,5.9796 3.8632,3.549 -0.91363,-2.38089 5.53557,-13.37957 10.30899,-17.5813 7.13619,-6.28152 12.55417,-8.38492 21.78922,-8.45911 6.77224,-0.0544 8.85484,0.35555 13.57008,2.67125 5.6042,2.75228 10.68314,8.355 12.92918,14.26255 0.76572,2.01398 1.35726,2.45093 2.28061,1.68462 0.6857,-0.56908 3.3314,-1.55962 5.87934,-2.2012 9.72127,-2.44784 21.58459,2.67566 25.93341,11.20006 4.0399,7.91885 1.16335,18.40419 -7.2601,26.46387 -8.93676,8.55083 -20.99374,11.58859 -30.06652,7.57527 l -4.57887,-2.02545 -2.73148,2.85105 -2.73147,2.85105 14.92672,14.80133 c 21.31192,21.13289 37.93798,41.6968 49.42802,61.13494 4.21981,7.13882 4.41578,7.31243 7.37802,6.53601 1.67368,-0.43869 5.81994,-0.81382 9.2139,-0.83362 5.18473,-0.0303 6.58324,0.35164 8.75152,2.38974 5.6796,5.33862 5.24365,14.15245 -1.35572,27.40936 l -3.90036,7.8351 1.95558,5.6649 c 1.07557,3.11569 3.15393,11.2899 4.61857,18.1649 2.44177,11.46158 2.66701,14.45222 2.71128,36 0.038,18.51885 -0.33066,25.51365 -1.73949,33 -1.55669,8.272 -6.27636,26.16738 -8.22895,31.20139 -0.36297,0.93576 1.01263,0.12395 3.05688,-1.80403 2.66512,-2.51352 4.4586,-3.41938 6.33833,-3.20138 2.38903,0.27706 2.61369,0.68328 2.53326,4.58049 C 662.3024,595.07403 658.1762,600 653.84809,600 c -3.0903,0 -5.16592,-2.73195 -4.31357,-5.67756 0.29004,-1.00234 -0.0116,-0.69744 -0.67025,0.67756 -10.20578,21.30482 -13.79968,28.04184 -19.46943,36.49692 -9.26318,13.8138 -16.062,22.18498 -28.35641,34.91436 -9.1813,9.50615 -9.95892,10.56232 -6.03843,8.20143 2.475,-1.49042 6.3,-3.58608 8.5,-4.65702 z M 629,198.34716 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 426.22423,559.53158 c 19.71512,-9.87566 36.01913,-21.99762 40.31451,-29.97366 l 1.94611,-3.6137 -2.85293,-5.44902 c -5.86946,-11.21052 -18.63311,-24.10662 -43.9529,-44.40898 -7.05154,-5.65419 -15.60154,-12.76208 -19,-15.79532 l -6.17902,-5.51498 -0.60767,49.86204 c -0.4785,39.26401 -0.95292,51.88124 -2.23206,59.36204 -0.89342,5.225 -1.63247,10.03607 -1.64233,10.69127 -0.018,1.19232 13.69202,-4.88372 34.20629,-15.15969 z m -20.21201,-47.50874 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 153,449.96538 c 30.525,-2.24027 56.5125,-4.28254 57.75,-4.53836 L 213,444.9619 213,396.98095 213,349 l -3.25,-0.0119 c -4.04611,-0.0148 -12.25074,-2.15958 -16.32515,-4.26762 -4.3158,-2.23292 -9.95342,-8.76204 -11.43071,-13.23826 -0.81629,-2.4734 -1.0738,-7.09666 -0.74526,-13.38071 0.5598,-10.7077 2.85824,-18.06073 8.06834,-25.81183 5.06476,-7.53488 11.517,-11.81366 22.43278,-14.87624 0.98632,-0.27672 1.25,-16.81069 1.25,-78.38209 C 213,122.93586 213.04731,121 214.90695,121 c 2.05377,0 106.85856,11.61 113.74199,12.60004 3.97119,0.57117 4.17689,0.46943 4.80159,-2.37481 1.03398,-4.70769 5.89931,-10.43852 11.97491,-14.10516 7.28789,-4.39826 12.12934,-4.03196 17.48414,1.32284 3.45102,3.45102 3.59042,3.86803 3.59042,10.74042 0,5.44966 -0.35671,7.27801 -1.5,7.68827 -0.825,0.29604 5.57341,1.2803 14.21868,2.18723 l 15.71868,1.64898 7.28132,-7.15794 C 406.22341,129.613 413.1,123.15529 417.5,119.1994 l 8,-7.19254 -100.5,0.081 c -55.275,0.0445 -102.975,0.42751 -106,0.85107 -9.77711,1.36901 -26.34213,5.22073 -32.5,7.55696 -14.71144,5.58135 -20.25984,8.063 -23.90004,10.68982 -2.14502,1.54789 -4.32454,2.81434 -4.84337,2.81434 -0.51883,0 -5.09454,3.12011 -10.16823,6.93359 -11.63594,8.74576 -25.74529,23.4671 -31.58836,32.95849 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0193 C 96.24744,454.02993 122.475,452.20566 153,449.96538 z m 16,-33.61822 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 96.012222,392.02284 c -2.352864,-4.39637 4.977198,-13.58958 10.239508,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.851184,4.00699 -9.462418,0.99637 z M 136.58194,245.24523 c -14.1751,-5.03021 -15.54418,-22.26169 -3.14948,-39.64011 3.96631,-5.5611 6.24739,-7.70273 10.49685,-9.85512 9.83866,-4.98337 21.0038,-3.14597 27.77994,4.57164 1.75566,1.99958 3.4992,5.27255 3.87453,7.27326 2.06971,11.03252 -8.29224,29.14132 -20.43571,35.71396 -6.41777,3.4736 -12.45874,4.10366 -18.56613,1.93637 z m 33.71999,-33.38189 c 0.0897,-5.42575 -1.70044,-8.57356 -6.43345,-11.31298 l -3.36848,-1.94964 2.7237,3.24511 c 3.44705,4.10693 5.11252,10.22993 4.52801,16.6469 L 167.2956,223.5 168.76046,220 c 0.80567,-1.925 1.49933,-5.5865 1.54147,-8.13666 z M 653.4075,435.89779 c -2.37858,-2.6283 -3.76697,-2.38435 -2.00453,0.35221 0.79699,1.2375 1.81987,4.05 2.27305,6.25 l 0.82398,4 0.31249,-4.35221 c 0.21899,-3.04995 -0.2014,-4.92005 -1.40499,-6.25 z M 565,345.65499 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 44.08961,-23.98776 c 2.06608,-7.67286 -2.47608,-15.23546 -10.32728,-17.19468 -2.65441,-0.6624 -2.61932,-0.56483 1.1539,3.20839 6.68066,6.68066 7.61308,15.13902 2.53195,22.96848 l -2.49893,3.85058 4.01976,-4.37228 c 2.22768,-2.42304 4.51053,-6.19487 5.1206,-8.46049 z M 531,317.65499 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3660"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f9be38"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 36.57033,-42.62542 c 18.28035,-9.45189 34.83352,-19.73399 49.94754,-31.02523 15.222,-11.3719 38.75288,-34.83238 47.74217,-47.59935 8.05434,-11.43911 17.47179,-29.36664 21.56733,-41.05667 9.26183,-26.43635 11.12408,-57.82252 5.08473,-85.69753 -9.96448,-45.99169 -42.70319,-91.8166 -96.75972,-135.43616 -26.63909,-21.49573 -36.93327,-32.31612 -43.16299,-45.36932 -5.5779,-11.68744 -5.11227,-19.93763 1.75997,-31.18332 9.71324,-15.8947 35.17923,-36.52759 70.14946,-56.83606 5.4993,-3.19364 9.85401,-6.05734 9.67715,-6.36378 C 564.92673,217.96326 522.48983,148.11117 509.78295,127.25 502.66389,115.5625 496.60579,106 496.32049,106 c -1.44732,0 -20.23546,11.78551 -30.50677,19.13643 -22.82079,16.33226 -49.47599,41.17619 -64.77907,60.37721 -17.88728,22.44346 -31.92512,48.75573 -39.06638,73.22533 -5.89976,20.21559 -7.19699,49.40108 -3.11501,70.08276 3.98101,20.1701 12.47267,40.3785 24.87322,59.19311 14.28171,21.66878 31.71813,39.69813 60.76741,62.8338 31.02832,24.71184 51.08161,47.35074 56.58099,63.87636 3.20759,9.63884 2.44743,19.85014 -2.15748,28.98144 -7.22317,14.32318 -27.6941,31.01135 -54.71068,44.60084 -10.40432,5.23344 -12.24225,6.50253 -11.86493,8.19272 0.24557,1.1 10.43759,23.15 22.64894,49 12.21135,25.85 23.70839,50.2625 25.54897,54.25 1.84058,3.9875 3.66194,7.25 4.04745,7.25 0.38552,0 7.11991,-3.31894 14.96531,-7.37542 z M 239.5,690.88752 c 30.51451,-3.89957 56.49963,-17.35758 78.59671,-40.7062 19.13749,-20.2214 32.95354,-46.53703 39.73369,-75.68132 4.88726,-21.00775 5.35095,-28.39208 5.88512,-93.72252 l 0.50467,-61.72252 -7.20134,-10.77748 c -44.99385,-67.33749 -44.62298,-148.79884 0.99778,-219.16299 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.13771,-8.90104 -15.34742,-32.42743 -16.40495,-74.08275 l -0.62236,-24.51455 -54.81817,4.06448 c -30.15,2.23547 -55.080231,4.32655 -55.400523,4.64684 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 6.25632,-2.13174 13.75606,-1.38843 17.03071,1.68796 3.00363,2.82176 4.52006,7.859 3.76557,12.50837 l -0.5614,3.45954 17.23783,0 c 15.99063,0 17.19219,-0.12662 16.607,-1.75 -0.34696,-0.9625 -11.3076,-24.52172 -24.35699,-52.35383 L 389.5,586.29234 l -2.20223,8.26996 c -5.4532,20.4782 -16.22952,43.6707 -28.08218,60.4377 -3.69358,5.225 -12.64945,15.4625 -19.90195,22.75 l -13.18637,13.25 16.7402,0 16.7402,0 3.44616,-3.59733 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.46677,-2.46677 -3.45266,-1.84205 -1.85994,1.17857 0.79751,1.5125 1.72834,4.4375 2.0685,6.5 0.84846,5.14436 1.36287,4.69951 1.36287,-1.17857 z m 204.5,-16.11574 c 6.91566,-3.3665 20.86691,-14.51687 29.2683,-23.39237 9.10204,-9.61567 12.80146,-14.51499 17.17108,-22.74047 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.44816,-2.13108 12.13468,-28.12846 14.98722,-44.85437 1.97162,-11.56061 2.01909,-15.70351 1.94787,-170 C 670.88685,315.66778 670.4764,242.25 670.01491,239.5 c -3.22426,-19.21282 -4.28443,-23.94225 -7.0612,-31.5 -1.71763,-4.675 -3.55982,-9.97622 -4.09375,-11.78048 -1.64406,-5.55554 -9.83357,-19.52725 -17.32608,-29.55914 -5.17147,-6.9242 -16.16797,-17.98044 -24.0298,-24.16038 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.49369,-3.12396 -5.87802,-3.74582 -1.94639,-3.14932 -28.36299,-12.19282 -41.94275,-14.35874 -14.5879,-2.32671 -14.46904,-2.31277 -14.10203,-1.65417 0.18559,0.33305 16.40477,27.10024 36.04262,59.48266 21.98188,36.24767 35.34815,59.23414 34.77626,59.80603 -0.5109,0.5109 -9.6562,5.76626 -20.32288,11.67859 -39.26098,21.76154 -64.53423,39.62259 -74.43721,52.60607 l -2.71228,3.55597 2.79411,4.0319 c 3.00143,4.33108 4.79592,5.9796 3.8632,3.549 -0.91363,-2.38089 5.53557,-13.37957 10.30899,-17.5813 7.13619,-6.28152 12.55417,-8.38492 21.78922,-8.45911 6.77224,-0.0544 8.85484,0.35555 13.57008,2.67125 5.6042,2.75228 10.68314,8.355 12.92918,14.26255 0.76572,2.01398 1.35726,2.45093 2.28061,1.68462 0.6857,-0.56908 3.3314,-1.55962 5.87934,-2.2012 9.72127,-2.44784 21.58459,2.67566 25.93341,11.20006 4.0399,7.91885 1.16335,18.40419 -7.2601,26.46387 -8.93676,8.55083 -20.99374,11.58859 -30.06652,7.57527 l -4.57887,-2.02545 -2.73148,2.85105 -2.73147,2.85105 14.92672,14.80133 c 21.31192,21.13289 37.93798,41.6968 49.42802,61.13494 4.21981,7.13882 4.41578,7.31243 7.37802,6.53601 1.67368,-0.43869 5.81994,-0.81382 9.2139,-0.83362 5.18473,-0.0303 6.58324,0.35164 8.75152,2.38974 5.6796,5.33862 5.24365,14.15245 -1.35572,27.40936 l -3.90036,7.8351 1.95558,5.6649 c 1.07557,3.11569 3.15393,11.2899 4.61857,18.1649 2.44177,11.46158 2.66701,14.45222 2.71128,36 0.038,18.51885 -0.33066,25.51365 -1.73949,33 -1.55669,8.272 -6.27636,26.16738 -8.22895,31.20139 -0.36297,0.93576 1.01263,0.12395 3.05688,-1.80403 2.66512,-2.51352 4.4586,-3.41938 6.33833,-3.20138 2.38903,0.27706 2.61369,0.68328 2.53326,4.58049 C 662.3024,595.07403 658.1762,600 653.84809,600 c -3.0903,0 -5.16592,-2.73195 -4.31357,-5.67756 0.29004,-1.00234 -0.0116,-0.69744 -0.67025,0.67756 -10.20578,21.30482 -13.79968,28.04184 -19.46943,36.49692 -9.26318,13.8138 -16.062,22.18498 -28.35641,34.91436 -9.1813,9.50615 -9.95892,10.56232 -6.03843,8.20143 2.475,-1.49042 6.3,-3.58608 8.5,-4.65702 z M 629,198.34716 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 426.22423,559.53158 c 19.71512,-9.87566 36.01913,-21.99762 40.31451,-29.97366 l 1.94611,-3.6137 -2.85293,-5.44902 c -5.86946,-11.21052 -18.63311,-24.10662 -43.9529,-44.40898 -7.05154,-5.65419 -15.60154,-12.76208 -19,-15.79532 l -6.17902,-5.51498 -0.60767,49.86204 c -0.4785,39.26401 -0.95292,51.88124 -2.23206,59.36204 -0.89342,5.225 -1.63247,10.03607 -1.64233,10.69127 -0.018,1.19232 13.69202,-4.88372 34.20629,-15.15969 z m -20.21201,-47.50874 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 153,449.96538 c 30.525,-2.24027 56.5125,-4.28254 57.75,-4.53836 L 213,444.9619 213,396.98095 213,349 l -3.25,-0.0119 c -4.04611,-0.0148 -12.25074,-2.15958 -16.32515,-4.26762 -4.3158,-2.23292 -9.95342,-8.76204 -11.43071,-13.23826 -0.81629,-2.4734 -1.0738,-7.09666 -0.74526,-13.38071 0.5598,-10.7077 2.85824,-18.06073 8.06834,-25.81183 5.06476,-7.53488 11.517,-11.81366 22.43278,-14.87624 0.98632,-0.27672 1.25,-16.81069 1.25,-78.38209 C 213,122.93586 213.04731,121 214.90695,121 c 2.05377,0 106.85856,11.61 113.74199,12.60004 3.97119,0.57117 4.17689,0.46943 4.80159,-2.37481 1.03398,-4.70769 5.89931,-10.43852 11.97491,-14.10516 7.28789,-4.39826 12.12934,-4.03196 17.48414,1.32284 3.45102,3.45102 3.59042,3.86803 3.59042,10.74042 0,5.44966 -0.35671,7.27801 -1.5,7.68827 -0.825,0.29604 5.57341,1.2803 14.21868,2.18723 l 15.71868,1.64898 7.28132,-7.15794 C 406.22341,129.613 413.1,123.15529 417.5,119.1994 l 8,-7.19254 -100.5,0.081 c -55.275,0.0445 -102.975,0.42751 -106,0.85107 -9.77711,1.36901 -26.34213,5.22073 -32.5,7.55696 -14.71144,5.58135 -20.25984,8.063 -23.90004,10.68982 -2.14502,1.54789 -4.32454,2.81434 -4.84337,2.81434 -0.51883,0 -5.09454,3.12011 -10.16823,6.93359 -11.63594,8.74576 -25.74529,23.4671 -31.58836,32.95849 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0193 C 96.24744,454.02993 122.475,452.20566 153,449.96538 z m 16,-33.61822 c -5.75858,-2.31005 -7.87619,-8.91961 -3.77749,-11.79046 3.44321,-2.41172 13.81769,-2.09952 17.14263,0.51588 3.05962,2.4067 3.63222,7.85479 1.05072,9.99725 -1.67641,1.3913 -11.87835,2.29525 -14.41586,1.27733 z M 96.012222,392.02284 c -2.352864,-4.39637 4.977198,-13.58958 10.239508,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.851184,4.00699 -9.462418,0.99637 z M 136.58194,245.24523 c -14.1751,-5.03021 -15.54418,-22.26169 -3.14948,-39.64011 3.96631,-5.5611 6.24739,-7.70273 10.49685,-9.85512 9.83866,-4.98337 21.0038,-3.14597 27.77994,4.57164 1.75566,1.99958 3.4992,5.27255 3.87453,7.27326 2.06971,11.03252 -8.29224,29.14132 -20.43571,35.71396 -6.41777,3.4736 -12.45874,4.10366 -18.56613,1.93637 z m 33.77462,-33.28649 c 0.16802,-5.3196 -1.98479,-9.19801 -6.36203,-11.46157 l -2.98664,-1.54445 3.24605,4.60488 c 2.96169,4.20147 3.24606,5.26017 3.24606,12.0849 0,7.258 0.0403,7.38174 1.35656,4.16876 0.7461,-1.82119 1.4211,-5.35483 1.5,-7.85252 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.46677,-2.46677 -3.45266,-1.84205 -1.85994,1.17857 0.79751,1.5125 1.72834,4.4375 2.0685,6.5 0.84846,5.14436 1.36287,4.69951 1.36287,-1.17857 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 42.56067,-19.80002 c 2.37421,-4.54362 2.81555,-10.22677 1.05811,-13.62528 -1.80382,-3.48819 -5.99545,-6.78416 -9.86185,-7.75456 -2.50247,-0.62808 -2.44857,-0.47651 1.19113,3.34961 6.61989,6.95895 7.34017,15.59956 1.9524,23.42124 l -2.24145,3.25402 3.25977,-3 c 1.79287,-1.65 3.88173,-4.19026 4.64189,-5.64503 z M 531,317.65499 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3658"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e2bc4e"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 36.57033,-42.62542 c 18.28035,-9.45189 34.83352,-19.73399 49.94754,-31.02523 15.222,-11.3719 38.75288,-34.83238 47.74217,-47.59935 8.05434,-11.43911 17.47179,-29.36664 21.56733,-41.05667 9.26183,-26.43635 11.12408,-57.82252 5.08473,-85.69753 -9.96448,-45.99169 -42.70319,-91.8166 -96.75972,-135.43616 -26.63909,-21.49573 -36.93327,-32.31612 -43.16299,-45.36932 -5.5779,-11.68744 -5.11227,-19.93763 1.75997,-31.18332 9.71324,-15.8947 35.17923,-36.52759 70.14946,-56.83606 5.4993,-3.19364 9.85401,-6.05734 9.67715,-6.36378 C 564.92673,217.96326 522.48983,148.11117 509.78295,127.25 502.66389,115.5625 496.60579,106 496.32049,106 c -1.44732,0 -20.23546,11.78551 -30.50677,19.13643 -22.82079,16.33226 -49.47599,41.17619 -64.77907,60.37721 -17.88728,22.44346 -31.92512,48.75573 -39.06638,73.22533 -5.89976,20.21559 -7.19699,49.40108 -3.11501,70.08276 3.98101,20.1701 12.47267,40.3785 24.87322,59.19311 14.28171,21.66878 31.71813,39.69813 60.76741,62.8338 31.02832,24.71184 51.08161,47.35074 56.58099,63.87636 3.20759,9.63884 2.44743,19.85014 -2.15748,28.98144 -7.22317,14.32318 -27.6941,31.01135 -54.71068,44.60084 -10.40432,5.23344 -12.24225,6.50253 -11.86493,8.19272 0.24557,1.1 10.43759,23.15 22.64894,49 12.21135,25.85 23.70839,50.2625 25.54897,54.25 1.84058,3.9875 3.66194,7.25 4.04745,7.25 0.38552,0 7.11991,-3.31894 14.96531,-7.37542 z M 239.5,690.88752 c 30.51451,-3.89957 56.49963,-17.35758 78.59671,-40.7062 19.13749,-20.2214 32.95354,-46.53703 39.73369,-75.68132 4.88726,-21.00775 5.35095,-28.39208 5.88512,-93.72252 l 0.50467,-61.72252 -7.20134,-10.77748 c -44.99385,-67.33749 -44.62298,-148.79884 0.99778,-219.16299 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 -2.91518,1.41121 -6.1612,1.98372 -11.24731,1.98372 -6.48095,0 -7.46171,-0.27414 -10.48862,-2.9318 -10.13771,-8.90104 -15.34742,-32.42743 -16.40495,-74.08275 l -0.62236,-24.51455 -54.81817,4.06448 c -30.15,2.23547 -55.080231,4.32655 -55.400523,4.64684 -0.936467,0.93647 1.361015,43.52892 3.046231,56.47332 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 6.25632,-2.13174 13.75606,-1.38843 17.03071,1.68796 3.00363,2.82176 4.52006,7.859 3.76557,12.50837 l -0.5614,3.45954 17.23783,0 c 15.99063,0 17.19219,-0.12662 16.607,-1.75 -0.34696,-0.9625 -11.3076,-24.52172 -24.35699,-52.35383 L 389.5,586.29234 l -2.20223,8.26996 c -5.4532,20.4782 -16.22952,43.6707 -28.08218,60.4377 -3.69358,5.225 -12.64945,15.4625 -19.90195,22.75 l -13.18637,13.25 16.7402,0 16.7402,0 3.44616,-3.59733 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.46677,-2.46677 -3.45266,-1.84205 -1.85994,1.17857 0.79751,1.5125 1.72834,4.4375 2.0685,6.5 0.84846,5.14436 1.36287,4.69951 1.36287,-1.17857 z m 204.5,-16.11574 c 6.91566,-3.3665 20.86691,-14.51687 29.2683,-23.39237 9.10204,-9.61567 12.80146,-14.51499 17.17108,-22.74047 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.44816,-2.13108 12.13468,-28.12846 14.98722,-44.85437 1.97162,-11.56061 2.01909,-15.70351 1.94787,-170 C 670.88685,315.66778 670.4764,242.25 670.01491,239.5 c -3.22426,-19.21282 -4.28443,-23.94225 -7.0612,-31.5 -1.71763,-4.675 -3.55982,-9.97622 -4.09375,-11.78048 -1.64406,-5.55554 -9.83357,-19.52725 -17.32608,-29.55914 -5.17147,-6.9242 -16.16797,-17.98044 -24.0298,-24.16038 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.49369,-3.12396 -5.87802,-3.74582 -1.94639,-3.14932 -28.36299,-12.19282 -41.94275,-14.35874 -14.5879,-2.32671 -14.46904,-2.31277 -14.10203,-1.65417 0.18559,0.33305 16.40477,27.10024 36.04262,59.48266 21.98188,36.24767 35.34815,59.23414 34.77626,59.80603 -0.5109,0.5109 -9.6562,5.76626 -20.32288,11.67859 -39.26098,21.76154 -64.53423,39.62259 -74.43721,52.60607 l -2.71228,3.55597 2.79411,4.0319 c 3.00143,4.33108 4.79592,5.9796 3.8632,3.549 -0.91363,-2.38089 5.53557,-13.37957 10.30899,-17.5813 7.13619,-6.28152 12.55417,-8.38492 21.78922,-8.45911 6.77224,-0.0544 8.85484,0.35555 13.57008,2.67125 5.6042,2.75228 10.68314,8.355 12.92918,14.26255 0.76572,2.01398 1.35726,2.45093 2.28061,1.68462 0.6857,-0.56908 3.3314,-1.55962 5.87934,-2.2012 9.72127,-2.44784 21.58459,2.67566 25.93341,11.20006 4.0399,7.91885 1.16335,18.40419 -7.2601,26.46387 -8.93676,8.55083 -20.99374,11.58859 -30.06652,7.57527 l -4.57887,-2.02545 -2.73148,2.85105 -2.73147,2.85105 14.92672,14.80133 c 21.31192,21.13289 37.93798,41.6968 49.42802,61.13494 4.21981,7.13882 4.41578,7.31243 7.37802,6.53601 1.67368,-0.43869 5.81994,-0.81382 9.2139,-0.83362 5.18473,-0.0303 6.58324,0.35164 8.75152,2.38974 5.6796,5.33862 5.24365,14.15245 -1.35572,27.40936 l -3.90036,7.8351 1.95558,5.6649 c 1.07557,3.11569 3.15393,11.2899 4.61857,18.1649 2.44177,11.46158 2.66701,14.45222 2.71128,36 0.038,18.51885 -0.33066,25.51365 -1.73949,33 -1.55669,8.272 -6.27636,26.16738 -8.22895,31.20139 -0.36297,0.93576 1.01263,0.12395 3.05688,-1.80403 2.66512,-2.51352 4.4586,-3.41938 6.33833,-3.20138 2.38903,0.27706 2.61369,0.68328 2.53326,4.58049 C 662.3024,595.07403 658.1762,600 653.84809,600 c -3.0903,0 -5.16592,-2.73195 -4.31357,-5.67756 0.29004,-1.00234 -0.0116,-0.69744 -0.67025,0.67756 -10.20578,21.30482 -13.79968,28.04184 -19.46943,36.49692 -9.26318,13.8138 -16.062,22.18498 -28.35641,34.91436 -9.1813,9.50615 -9.95892,10.56232 -6.03843,8.20143 2.475,-1.49042 6.3,-3.58608 8.5,-4.65702 z m 23.83929,-472.89043 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 426.22423,559.53158 c 19.71512,-9.87566 36.01913,-21.99762 40.31451,-29.97366 l 1.94611,-3.6137 -2.85293,-5.44902 c -5.86946,-11.21052 -18.63311,-24.10662 -43.9529,-44.40898 -7.05154,-5.65419 -15.60154,-12.76208 -19,-15.79532 l -6.17902,-5.51498 -0.60767,49.86204 c -0.4785,39.26401 -0.95292,51.88124 -2.23206,59.36204 -0.89342,5.225 -1.63247,10.03607 -1.64233,10.69127 -0.018,1.19232 13.69202,-4.88372 34.20629,-15.15969 z m -20.21201,-47.50874 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 153,449.96538 c 30.525,-2.24027 56.5125,-4.28254 57.75,-4.53836 L 213,444.9619 213,396.98095 213,349 l -3.25,-0.0119 c -4.04611,-0.0148 -12.25074,-2.15958 -16.32515,-4.26762 -4.3158,-2.23292 -9.95342,-8.76204 -11.43071,-13.23826 -0.81629,-2.4734 -1.0738,-7.09666 -0.74526,-13.38071 0.5598,-10.7077 2.85824,-18.06073 8.06834,-25.81183 5.06476,-7.53488 11.517,-11.81366 22.43278,-14.87624 0.98632,-0.27672 1.25,-16.81069 1.25,-78.38209 C 213,122.93586 213.04731,121 214.90695,121 c 2.03889,0 106.82502,11.60546 113.67354,12.58977 l 4.08048,0.58648 1.74924,-4.58032 c 2.08549,-5.46076 10.34372,-13.17036 15.64494,-14.60558 6.77918,-1.83536 13.78659,1.97006 16.00488,8.69153 1.30267,3.94713 0.32986,13.25856 -1.40387,13.43736 -0.63589,0.0656 5.91725,0.89983 14.56252,1.8539 l 15.71868,1.73467 7.28132,-7.15794 C 406.22341,129.613 413.1,123.15529 417.5,119.1994 l 8,-7.19254 -100.5,0.081 c -55.275,0.0445 -102.975,0.42751 -106,0.85107 -9.77711,1.36901 -26.34213,5.22073 -32.5,7.55696 -14.71144,5.58135 -20.25984,8.063 -23.90004,10.68982 -2.14502,1.54789 -4.32454,2.81434 -4.84337,2.81434 -0.51883,0 -5.09454,3.12011 -10.16823,6.93359 -11.63594,8.74576 -25.74529,23.4671 -31.58836,32.95849 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0193 C 96.24744,454.02993 122.475,452.20566 153,449.96538 z m 14.33929,-34.90012 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 96.012222,392.02284 c -2.352864,-4.39637 4.977198,-13.58958 10.239508,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.851184,4.00699 -9.462418,0.99637 z M 136.58194,245.24523 c -14.1751,-5.03021 -15.54418,-22.26169 -3.14948,-39.64011 3.96631,-5.5611 6.24739,-7.70273 10.49685,-9.85512 9.83866,-4.98337 21.0038,-3.14597 27.77994,4.57164 1.75566,1.99958 3.4992,5.27255 3.87453,7.27326 2.06971,11.03252 -8.29224,29.14132 -20.43571,35.71396 -6.41777,3.4736 -12.45874,4.10366 -18.56613,1.93637 z m 33.77462,-33.28649 c 0.16802,-5.3196 -1.98479,-9.19801 -6.36203,-11.46157 l -2.98664,-1.54445 3.24605,4.60488 c 2.96169,4.20147 3.24606,5.26017 3.24606,12.0849 0,7.258 0.0403,7.38174 1.35656,4.16876 0.7461,-1.82119 1.4211,-5.35483 1.5,-7.85252 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.46677,-2.46677 -3.45266,-1.84205 -1.85994,1.17857 0.79751,1.5125 1.72834,4.4375 2.0685,6.5 0.84846,5.14436 1.36287,4.69951 1.36287,-1.17857 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 42.56067,-19.80002 c 2.37421,-4.54362 2.81555,-10.22677 1.05811,-13.62528 -1.80382,-3.48819 -5.99545,-6.78416 -9.86185,-7.75456 -2.50247,-0.62808 -2.44857,-0.47651 1.19113,3.34961 6.61989,6.95895 7.34017,15.59956 1.9524,23.42124 l -2.24145,3.25402 3.25977,-3 c 1.79287,-1.65 3.88173,-4.19026 4.64189,-5.64503 z M 531,317.65499 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3656"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#a3a3a3"
+       d="m 462.98213,742.25 c -2.26274,-4.8125 -5.94965,-12.6875 -8.19313,-17.5 l -4.07907,-8.75 -84.69841,0 c -82.88257,0 -84.82505,0.0441 -90.60497,2.05579 -16.18225,5.63229 -37.18164,8.89546 -57.43278,8.92469 -36.01984,0.052 -65.99644,-8.7134 -93.47377,-27.33244 C 112.95896,691.82767 91.665202,670.57768 82.766178,658 61.642681,628.14453 48.860877,588.37766 45.033197,540.60478 44.464938,533.51241 44,512.0693 44,492.95343 L 44,458.1973 55.5,457.47875 67,456.7602 67.032719,347.6301 C 67.051047,286.49835 67.471451,235.64113 67.988558,232 c 2.419383,-17.03567 3.248442,-21.12613 5.979097,-29.5 4.688698,-14.37844 11.775595,-30.60525 13.954731,-31.95203 0.523031,-0.32325 1.654462,-1.92878 2.51429,-3.56785 0.859828,-1.63907 2.26682,-4.32117 3.126648,-5.96024 0.859828,-1.63907 2.003062,-3.25189 2.54052,-3.58406 0.537458,-0.33217 2.156616,-2.47226 3.598129,-4.75577 6.744297,-10.68365 34.353947,-35.61899 45.980177,-41.52645 2.30018,-1.16876 4.43899,-2.54059 4.7529,-3.04851 0.31391,-0.50792 7.16009,-3.70298 15.21373,-7.10014 C 179.70197,95.077081 197.89181,89.953851 212,87.949968 c 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.832974 c 5.91182,-3.615391 31.52837,-17.945984 38.44753,-21.508596 l 3.17992,-1.637313 8.21975,13.489442 L 525.29933,87 l 8.60033,0.05392 c 8.36804,0.05246 16.2507,0.789407 30.60034,2.860804 7.95457,1.148257 30.26567,8.417255 38.5,12.543366 3.025,1.51579 8.65,4.82248 12.5,7.34819 3.85,2.52572 9.45556,6.19005 12.45679,8.14296 6.22895,4.05321 31.63557,28.72473 35.18485,34.16684 1.2971,1.98885 4.04586,6.16009 6.10836,9.26942 2.0625,3.10933 3.75,6.0395 3.75,6.51147 0,0.47198 0.62407,1.37607 1.38681,2.00909 1.73294,1.43821 8.61319,15.42537 8.61319,17.51012 0,0.84673 1.07567,3.91198 2.39037,6.81167 4.30747,9.50045 6.84586,19.95151 9.65998,39.77215 1.22946,8.65942 1.09652,334.65245 -0.13865,340 -0.57167,2.475 -1.66966,8.1 -2.43999,12.5 -1.90973,10.90817 -8.77403,30.44104 -13.81579,39.31383 -2.28576,4.02261 -5.34608,9.53429 -6.80072,12.24817 -1.45465,2.71389 -3.92965,6.46689 -5.5,8.33999 -1.57036,1.87311 -4.2052,5.28587 -5.8552,7.58392 -4.53324,6.31369 -22.91067,23.76919 -32.5,30.86959 -10.94689,8.1056 -28.97456,17.27364 -44.69802,22.73135 -7.38505,2.5634 -26.51613,6.63917 -35.72672,7.61137 -8.17073,0.86245 -9.69148,1.38899 -18,6.23226 C 524.58387,724.3401 516.675,728.77752 512,731.29141 503.32735,735.95495 469.77628,751 468.04903,751 c -0.52405,0 -2.80416,-3.9375 -5.0669,-8.75 z m 34.83933,-41.70232 C 531.5851,683.36478 557.32048,664.8725 579.5,641.85717 602.4827,618.00839 617.62948,590.71461 623.84848,561.94333 639.22453,490.80834 607.11549,423.42925 527,358.71204 c -26.54096,-21.43976 -36.81202,-32.24629 -43.02848,-45.27172 -5.5779,-11.68744 -5.11227,-19.93763 1.75997,-31.18332 9.92622,-16.24322 34.39886,-36.00955 70.9531,-57.30817 5.05153,-2.94332 9.04554,-5.59838 8.87558,-5.90015 C 565.39021,218.7469 558.96326,208.15 551.27805,195.5 543.59285,182.85 528.4256,157.875 517.57307,140 506.72053,122.125 497.4712,107.11679 497.019,106.64841 c -1.69661,-1.7573 -27.82061,15.08712 -46.519,29.99484 -13.10208,10.44594 -40.65649,37.63376 -49.51551,48.85675 -18.06723,22.88834 -31.8995,48.85348 -39.01622,73.23897 -5.89976,20.21559 -7.19699,49.40108 -3.11501,70.08276 3.98174,20.17385 12.47547,40.38539 24.8754,59.19311 14.38174,21.81365 31.44704,39.46662 60.76523,62.85776 9.35336,7.46246 22.64705,19.20645 29.54154,26.09775 27.19362,27.18107 34.69002,47.28722 24.88197,66.73609 -7.22317,14.32318 -27.6941,31.01135 -54.71068,44.60084 -10.40265,5.2326 -12.24235,6.5028 -11.86593,8.19272 0.24501,1.1 10.22123,22.7 22.16938,48 11.94815,25.3 23.45064,49.7125 25.56109,54.25 2.11044,4.5375 4.11493,8.25 4.45442,8.25 0.33949,0 6.32259,-2.90355 13.29578,-6.45232 z M 239.5,690.88752 c 30.59757,-3.91018 56.43949,-17.29403 78.59671,-40.7062 19.13749,-20.2214 32.95354,-46.53703 39.73369,-75.68132 4.88726,-21.00775 5.35095,-28.39208 5.88512,-93.72252 l 0.50467,-61.72252 -7.20134,-10.77748 c -44.99385,-67.33749 -44.62298,-148.79884 0.99778,-219.16299 5.2882,-8.15637 6.04572,-9.91953 5.78425,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 C 222.55811,582.42414 219.3053,583 214.261,583 c -6.2185,0 -7.49903,-0.32941 -10.23726,-2.63348 -1.72134,-1.44841 -4.45117,-5.25128 -6.06629,-8.45081 C 191.15077,558.43175 188.19049,540.07585 187.32713,506 l -0.62075,-24.5 -5.10319,0.34192 c -32.75314,2.19447 -104.685475,7.90703 -105.127196,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 6.25632,-2.13174 13.75606,-1.38843 17.03071,1.68796 3.00363,2.82176 4.52006,7.859 3.76557,12.50837 l -0.5614,3.45954 17.23783,0 c 15.99049,0 17.19221,-0.12663 16.60736,-1.75 -0.34676,-0.9625 -11.3074,-24.52811 -24.35699,-52.36803 L 389.5,586.26394 l -2.20223,8.28417 c -5.43651,20.45056 -16.12926,43.442 -28.12812,60.48077 -3.7085,5.26619 -12.52405,15.35377 -19.85601,22.72112 l -13.18637,13.25 16.7402,0 16.7402,0 3.44616,-3.59733 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.46677,-2.46677 -3.45266,-1.84205 -1.85994,1.17857 0.79751,1.5125 1.72834,4.4375 2.0685,6.5 0.84846,5.14436 1.36287,4.69951 1.36287,-1.17857 z m 204.5,-16.11574 c 6.91566,-3.3665 20.86691,-14.51687 29.2683,-23.39237 9.10204,-9.61567 12.80146,-14.51499 17.17108,-22.74047 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.44816,-2.13108 12.13468,-28.12846 14.98722,-44.85437 1.97162,-11.56061 2.01909,-15.70351 1.94787,-170 C 670.88685,315.66778 670.4764,242.25 670.01491,239.5 c -3.22426,-19.21282 -4.28443,-23.94225 -7.0612,-31.5 -1.71763,-4.675 -3.55982,-9.97622 -4.09375,-11.78048 -1.64406,-5.55554 -9.83357,-19.52725 -17.32608,-29.55914 -5.17147,-6.9242 -16.16797,-17.98044 -24.0298,-24.16038 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.49369,-3.12396 -5.87802,-3.74582 -1.94639,-3.14932 -28.36299,-12.19282 -41.94275,-14.35874 -14.5879,-2.32671 -14.46904,-2.31277 -14.10203,-1.65417 0.18559,0.33305 16.40477,27.10024 36.04262,59.48266 21.98188,36.24767 35.34815,59.23414 34.77626,59.80603 -0.5109,0.5109 -9.6668,5.76997 -20.34644,11.68682 -39.40191,21.82989 -64.433,39.51253 -74.364,52.53275 l -2.76193,3.62106 2.79411,4.0319 c 3.00143,4.33108 4.79592,5.9796 3.8632,3.549 -0.91363,-2.38089 5.53557,-13.37957 10.30899,-17.5813 7.13619,-6.28152 12.55417,-8.38492 21.78922,-8.45911 6.77224,-0.0544 8.85484,0.35555 13.57008,2.67125 5.6042,2.75228 10.68314,8.355 12.92918,14.26255 0.76572,2.01398 1.35726,2.45093 2.28061,1.68462 0.6857,-0.56908 3.3314,-1.55962 5.87934,-2.2012 9.72127,-2.44784 21.58459,2.67566 25.93341,11.20006 4.0399,7.91885 1.16335,18.40419 -7.2601,26.46387 -8.93676,8.55083 -20.99374,11.58859 -30.06652,7.57527 l -4.57887,-2.02545 -2.73148,2.85105 -2.73147,2.85105 14.90282,14.80133 c 21.53391,21.38726 36.78515,40.12093 48.14718,59.14099 5.51257,9.22804 5.61597,9.33005 8.65253,8.536 1.69031,-0.44201 5.85017,-0.81986 9.24413,-0.83966 5.18473,-0.0303 6.58324,0.35164 8.75152,2.38974 5.6796,5.33862 5.24365,14.15245 -1.35572,27.40936 l -3.90036,7.8351 1.95475,5.6649 c 1.07512,3.11569 3.09496,11.0649 4.48853,17.6649 3.4507,16.34266 4.37766,45.53349 1.98776,62.597 -5.98958,42.76478 -24.86618,79.46949 -59.04009,114.80088 -8.8906,9.19172 -9.53523,10.08508 -5.55723,7.70142 2.475,-1.48304 6.3,-3.57267 8.5,-4.64361 z m 46.51222,-71.93285 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 627.33929,197.06526 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 424.06716,560.60751 c 21.4827,-10.6722 38.00097,-22.74817 42.47158,-31.04959 l 1.94611,-3.6137 -2.85293,-5.44902 c -5.86946,-11.21052 -18.63311,-24.10662 -43.9529,-44.40898 -7.05154,-5.65419 -15.60154,-12.76208 -19,-15.79532 l -6.17902,-5.51498 -0.60767,49.86204 c -0.4785,39.26401 -0.95292,51.88124 -2.23206,59.36204 -0.89342,5.225 -1.63247,10.0364 -1.64233,10.692 -0.0188,1.25092 10.36893,-3.31413 32.04922,-14.08449 z m -18.05494,-48.58467 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 153,449.96538 c 30.525,-2.24027 56.5125,-4.28254 57.75,-4.53836 L 213,444.9619 213,396.98095 213,349 l -3.25,-0.0119 c -4.04611,-0.0148 -12.25074,-2.15958 -16.32515,-4.26762 -4.3158,-2.23292 -9.95342,-8.76204 -11.43071,-13.23826 -0.81629,-2.4734 -1.0738,-7.09666 -0.74526,-13.38071 0.5598,-10.7077 2.85824,-18.06073 8.06834,-25.81183 5.06476,-7.53488 11.517,-11.81366 22.43278,-14.87624 0.98632,-0.27672 1.25,-16.81069 1.25,-78.38209 C 213,122.2377 213.03104,121 214.95704,121 c 2.02461,0 106.38642,11.57046 113.62345,12.59729 l 4.08048,0.57896 1.74924,-4.58032 c 2.08549,-5.46076 10.34372,-13.17036 15.64494,-14.60558 6.7964,-1.84002 13.78674,1.9705 16.01813,8.73168 1.20293,3.64493 0.42047,12.35046 -1.20036,13.35493 -0.51205,0.31733 6.04954,1.25753 14.5813,2.08933 l 15.51229,1.51236 7.26675,-7.14336 c 3.9967,-3.92884 10.86674,-10.38 15.26674,-14.33589 l 8,-7.19254 -100.5,0.081 c -55.275,0.0445 -102.975,0.42751 -106,0.85107 -9.77711,1.36901 -26.34213,5.22073 -32.5,7.55696 -14.71144,5.58135 -20.25984,8.063 -23.90004,10.68982 -2.14502,1.54789 -4.32454,2.81434 -4.84337,2.81434 -0.51883,0 -5.09454,3.12011 -10.16823,6.93359 -11.63594,8.74576 -25.74529,23.4671 -31.58836,32.95849 -2.475,4.02034 -5.57663,8.95181 -6.89251,10.95882 C 106.42431,188.94334 100,203.48179 100,205.4615 c 0,0.70634 -0.870426,3.25397 -1.934281,5.66138 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0193 C 96.24744,454.02993 122.475,452.20566 153,449.96538 z m 14.33929,-34.90012 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 96.012222,392.02284 c -2.352864,-4.39637 4.977198,-13.58958 10.239508,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.851184,4.00699 -9.462418,0.99637 z M 136.58194,245.24523 c -14.1751,-5.03021 -15.54418,-22.26169 -3.14948,-39.64011 3.96631,-5.5611 6.24739,-7.70273 10.49685,-9.85512 9.83866,-4.98337 21.0038,-3.14597 27.77994,4.57164 1.75566,1.99958 3.4992,5.27255 3.87453,7.27326 2.06971,11.03252 -8.29224,29.14132 -20.43571,35.71396 -6.41777,3.4736 -12.45874,4.10366 -18.56613,1.93637 z m 33.77462,-33.28649 c 0.16802,-5.3196 -1.98479,-9.19801 -6.36203,-11.46157 l -2.98664,-1.54445 3.24605,4.60488 c 2.96169,4.20147 3.24606,5.26017 3.24606,12.0849 0,7.258 0.0403,7.38174 1.35656,4.16876 0.7461,-1.82119 1.4211,-5.35483 1.5,-7.85252 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.46677,-2.46677 -3.45266,-1.84205 -1.85994,1.17857 0.79751,1.5125 1.72834,4.4375 2.0685,6.5 0.84846,5.14436 1.36287,4.69951 1.36287,-1.17857 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 42.56067,-19.80002 c 2.37421,-4.54362 2.81555,-10.22677 1.05811,-13.62528 -1.80382,-3.48819 -5.99545,-6.78416 -9.86185,-7.75456 -2.50247,-0.62808 -2.44857,-0.47651 1.19113,3.34961 6.61989,6.95895 7.34017,15.59956 1.9524,23.42124 l -2.24145,3.25402 3.25977,-3 c 1.79287,-1.65 3.88173,-4.19026 4.64189,-5.64503 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3654"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ebbb41"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 C 531.5851,683.36478 557.32048,664.8725 579.5,641.85717 602.4827,618.00839 617.62948,590.71461 623.84848,561.94333 639.22453,490.80834 607.11549,423.42925 527,358.71204 c -26.54096,-21.43976 -36.81202,-32.24629 -43.02848,-45.27172 -5.5779,-11.68744 -5.11227,-19.93763 1.75997,-31.18332 9.92622,-16.24322 34.39886,-36.00955 70.9531,-57.30817 5.05153,-2.94332 9.04554,-5.59838 8.87558,-5.90015 C 565.39021,218.7469 558.96326,208.15 551.27805,195.5 543.59285,182.85 528.4256,157.875 517.57307,140 506.72053,122.125 497.4712,107.11679 497.019,106.64841 c -1.69661,-1.7573 -27.82061,15.08712 -46.519,29.99484 -13.10208,10.44594 -40.65649,37.63376 -49.51551,48.85675 -44.32877,56.15758 -56.19099,116.99438 -33.51308,171.87566 14.1976,34.35863 35.86371,60.65894 77.02248,93.49694 9.35336,7.46246 22.64705,19.20645 29.54154,26.09775 27.19362,27.18107 34.69002,47.28722 24.88197,66.73609 -7.22317,14.32318 -27.6941,31.01135 -54.71068,44.60084 -10.40265,5.2326 -12.24235,6.5028 -11.86593,8.19272 0.24501,1.1 10.22123,22.7 22.16938,48 11.94815,25.3 23.45064,49.7125 25.56109,54.25 2.11044,4.5375 4.11493,8.25 4.45442,8.25 0.33949,0 6.32259,-2.90355 13.29578,-6.45232 z M 239.5,690.88752 c 30.59757,-3.91018 56.43949,-17.29403 78.59671,-40.7062 19.13749,-20.2214 32.95354,-46.53703 39.73369,-75.68132 4.88726,-21.00775 5.35095,-28.39208 5.88512,-93.72252 l 0.50467,-61.72252 -7.20134,-10.77748 c -36.21656,-54.20147 -43.45899,-119.41332 -19.84782,-178.71254 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.28473,-8.1551 6.04263,-9.92008 5.7812,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 C 222.55811,582.42414 219.3053,583 214.261,583 c -6.2185,0 -7.49903,-0.32941 -10.23726,-2.63348 -1.72134,-1.44841 -4.45117,-5.25128 -6.06629,-8.45081 C 191.15077,558.43175 188.19049,540.07585 187.32713,506 l -0.62075,-24.5 -5.10319,0.34192 c -32.75314,2.19447 -104.685475,7.90703 -105.127196,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 6.25632,-2.13174 13.75606,-1.38843 17.03071,1.68796 3.00363,2.82176 4.52006,7.859 3.76557,12.50837 l -0.5614,3.45954 17.23783,0 c 15.99049,0 17.19221,-0.12663 16.60736,-1.75 -0.34676,-0.9625 -11.3074,-24.52811 -24.35699,-52.36803 L 389.5,586.26394 l -2.20223,8.28417 c -5.43651,20.45056 -16.12926,43.442 -28.12812,60.48077 -3.7085,5.26619 -12.52405,15.35377 -19.85601,22.72112 l -13.18637,13.25 16.7402,0 16.7402,0 3.44616,-3.59733 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.46677,-2.46677 -3.45266,-1.84205 -1.85994,1.17857 0.79751,1.5125 1.72834,4.4375 2.0685,6.5 0.84846,5.14436 1.36287,4.69951 1.36287,-1.17857 z m 204.5,-16.11574 c 6.91566,-3.3665 20.86691,-14.51687 29.2683,-23.39237 9.10204,-9.61567 12.80146,-14.51499 17.17108,-22.74047 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.44816,-2.13108 12.13468,-28.12846 14.98722,-44.85437 1.97162,-11.56061 2.01909,-15.70351 1.94787,-170 C 670.88685,315.66778 670.4764,242.25 670.01491,239.5 c -3.22426,-19.21282 -4.28443,-23.94225 -7.0612,-31.5 -1.71763,-4.675 -3.55982,-9.97622 -4.09375,-11.78048 -1.64406,-5.55554 -9.83357,-19.52725 -17.32608,-29.55914 -5.17147,-6.9242 -16.16797,-17.98044 -24.0298,-24.16038 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.49369,-3.12396 -5.87802,-3.74582 -1.94639,-3.14932 -28.36299,-12.19282 -41.94275,-14.35874 -14.5879,-2.32671 -14.46904,-2.31277 -14.10203,-1.65417 0.18559,0.33305 16.40477,27.10024 36.04262,59.48266 21.98188,36.24767 35.34815,59.23414 34.77626,59.80603 -0.5109,0.5109 -9.6668,5.76997 -20.34644,11.68682 -39.40191,21.82989 -64.433,39.51253 -74.364,52.53275 l -2.76193,3.62106 2.79411,4.0319 c 3.00143,4.33108 4.79592,5.9796 3.8632,3.549 -0.91363,-2.38089 5.53557,-13.37957 10.30899,-17.5813 7.13619,-6.28152 12.55417,-8.38492 21.78922,-8.45911 6.77224,-0.0544 8.85484,0.35555 13.57008,2.67125 5.6042,2.75228 10.68314,8.355 12.92918,14.26255 0.76572,2.01398 1.35726,2.45093 2.28061,1.68462 0.6857,-0.56908 3.3314,-1.55962 5.87934,-2.2012 9.72127,-2.44784 21.58459,2.67566 25.93341,11.20006 4.0399,7.91885 1.16335,18.40419 -7.2601,26.46387 -8.93676,8.55083 -20.99374,11.58859 -30.06652,7.57527 l -4.57887,-2.02545 -2.73148,2.85105 -2.73147,2.85105 14.90282,14.80133 c 21.53391,21.38726 36.78515,40.12093 48.14718,59.14099 5.51257,9.22804 5.61597,9.33005 8.65253,8.536 1.69031,-0.44201 5.85017,-0.81986 9.24413,-0.83966 5.18473,-0.0303 6.58324,0.35164 8.75152,2.38974 5.6796,5.33862 5.24365,14.15245 -1.35572,27.40936 l -3.90036,7.8351 1.95475,5.6649 c 1.07512,3.11569 3.09496,11.0649 4.48853,17.6649 3.4507,16.34266 4.37766,45.53349 1.98776,62.597 -5.98958,42.76478 -24.86618,79.46949 -59.04009,114.80088 -8.8906,9.19172 -9.53523,10.08508 -5.55723,7.70142 2.475,-1.48304 6.3,-3.57267 8.5,-4.64361 z m 46.51222,-71.93285 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 627.33929,197.06526 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 424.06716,560.60751 c 21.4827,-10.6722 38.00097,-22.74817 42.47158,-31.04959 l 1.94611,-3.6137 -2.85293,-5.44902 c -5.86946,-11.21052 -18.63311,-24.10662 -43.9529,-44.40898 -7.05154,-5.65419 -15.60154,-12.76208 -19,-15.79532 l -6.17902,-5.51498 -0.60767,49.86204 c -0.4785,39.26401 -0.95292,51.88124 -2.23206,59.36204 -0.89342,5.225 -1.63247,10.0364 -1.64233,10.692 -0.0188,1.25092 10.36893,-3.31413 32.04922,-14.08449 z m -18.05494,-48.58467 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 153,449.96538 c 30.525,-2.24027 56.5125,-4.28254 57.75,-4.53836 L 213,444.9619 213,396.98095 213,349 l -3.25,-0.0119 c -4.04611,-0.0148 -12.25074,-2.15958 -16.32515,-4.26762 -4.3158,-2.23292 -9.95342,-8.76204 -11.43071,-13.23826 -0.81629,-2.4734 -1.0738,-7.09666 -0.74526,-13.38071 0.5598,-10.7077 2.85824,-18.06073 8.06834,-25.81183 5.06476,-7.53488 11.517,-11.81366 22.43278,-14.87624 0.98632,-0.27672 1.25,-16.81069 1.25,-78.38209 C 213,122.2377 213.03104,121 214.95704,121 c 2.02461,0 106.38642,11.57046 113.62345,12.59729 l 4.08048,0.57896 1.74924,-4.58032 c 2.08549,-5.46076 10.34372,-13.17036 15.64494,-14.60558 6.7964,-1.84002 13.78674,1.9705 16.01813,8.73168 1.20293,3.64493 0.42047,12.35046 -1.20036,13.35493 -0.51205,0.31733 6.04954,1.25753 14.5813,2.08933 l 15.51229,1.51236 7.26675,-7.14336 c 3.9967,-3.92884 10.86674,-10.38 15.26674,-14.33589 l 8,-7.19254 -100.5,0.081 c -55.275,0.0445 -102.975,0.42751 -106,0.85107 -9.77711,1.36901 -26.34213,5.22073 -32.5,7.55696 -14.71144,5.58135 -20.25984,8.063 -23.90004,10.68982 -2.14502,1.54789 -4.32454,2.81434 -4.84337,2.81434 -2.17422,0 -19.89194,14.42929 -27.81938,22.65607 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0193 C 96.24744,454.02993 122.475,452.20566 153,449.96538 z m 14.33929,-34.90012 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 96.012222,392.02284 c -2.352864,-4.39637 4.977198,-13.58958 10.239508,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.851184,4.00699 -9.462418,0.99637 z M 136.58194,245.24523 c -14.1751,-5.03021 -15.54418,-22.26169 -3.14948,-39.64011 3.96631,-5.5611 6.24739,-7.70273 10.49685,-9.85512 9.83866,-4.98337 21.0038,-3.14597 27.77994,4.57164 1.75566,1.99958 3.4992,5.27255 3.87453,7.27326 2.06971,11.03252 -8.29224,29.14132 -20.43571,35.71396 -6.41777,3.4736 -12.45874,4.10366 -18.56613,1.93637 z m 33.77462,-33.28649 c 0.16802,-5.3196 -1.98479,-9.19801 -6.36203,-11.46157 l -2.98664,-1.54445 3.24605,4.60488 c 2.96169,4.20147 3.24606,5.26017 3.24606,12.0849 0,7.258 0.0403,7.38174 1.35656,4.16876 0.7461,-1.82119 1.4211,-5.35483 1.5,-7.85252 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.46677,-2.46677 -3.45266,-1.84205 -1.85994,1.17857 0.79751,1.5125 1.72834,4.4375 2.0685,6.5 0.84846,5.14436 1.36287,4.69951 1.36287,-1.17857 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 42.56067,-19.80002 c 2.37421,-4.54362 2.81555,-10.22677 1.05811,-13.62528 -1.80382,-3.48819 -5.99545,-6.78416 -9.86185,-7.75456 -2.50247,-0.62808 -2.44857,-0.47651 1.19113,3.34961 6.61989,6.95895 7.34017,15.59956 1.9524,23.42124 l -2.24145,3.25402 3.25977,-3 c 1.79287,-1.65 3.88173,-4.19026 4.64189,-5.64503 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3652"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e0ba4d"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 C 531.5851,683.36478 557.32048,664.8725 579.5,641.85717 602.4827,618.00839 617.62948,590.71461 623.84848,561.94333 639.22453,490.80834 607.11549,423.42925 527,358.71204 c -26.54096,-21.43976 -36.81202,-32.24629 -43.02848,-45.27172 -5.5779,-11.68744 -5.11227,-19.93763 1.75997,-31.18332 9.92622,-16.24322 34.39886,-36.00955 70.9531,-57.30817 5.05153,-2.94332 9.04554,-5.59838 8.87558,-5.90015 C 565.39021,218.7469 558.96326,208.15 551.27805,195.5 543.59285,182.85 528.4256,157.875 517.57307,140 506.72053,122.125 497.4712,107.11679 497.019,106.64841 c -1.69661,-1.7573 -27.82061,15.08712 -46.519,29.99484 -13.10208,10.44594 -40.65649,37.63376 -49.51551,48.85675 -44.32877,56.15758 -56.19099,116.99438 -33.51308,171.87566 14.1976,34.35863 35.86371,60.65894 77.02248,93.49694 9.35336,7.46246 22.64705,19.20645 29.54154,26.09775 27.19362,27.18107 34.69002,47.28722 24.88197,66.73609 -7.22317,14.32318 -27.6941,31.01135 -54.71068,44.60084 -10.40265,5.2326 -12.24235,6.5028 -11.86593,8.19272 0.24501,1.1 10.22123,22.7 22.16938,48 11.94815,25.3 23.45064,49.7125 25.56109,54.25 2.11044,4.5375 4.11493,8.25 4.45442,8.25 0.33949,0 6.32259,-2.90355 13.29578,-6.45232 z M 239.5,690.88752 c 30.59757,-3.91018 56.43949,-17.29403 78.59671,-40.7062 19.13749,-20.2214 32.95354,-46.53703 39.73369,-75.68132 4.88726,-21.00775 5.35095,-28.39208 5.88512,-93.72252 l 0.50467,-61.72252 -7.20134,-10.77748 c -36.21656,-54.20147 -43.45899,-119.41332 -19.84782,-178.71254 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.28473,-8.1551 6.04263,-9.92008 5.7812,-13.46314 l -0.30088,-4.07762 -54,-6.20346 c -29.7,-3.41191 -55.90469,-6.45632 -58.23265,-6.76536 l -4.23264,-0.56189 -0.26736,192.72849 L 246.5,543.5 l -2.18456,7.65411 c -4.08501,14.31273 -11.72215,26.41208 -18.84906,29.86217 C 222.55811,582.42414 219.3053,583 214.261,583 c -6.2185,0 -7.49903,-0.32941 -10.23726,-2.63348 -1.72134,-1.44841 -4.45117,-5.25128 -6.06629,-8.45081 C 191.15077,558.43175 188.19049,540.07585 187.32713,506 l -0.62075,-24.5 -5.10319,0.34192 c -32.75314,2.19447 -104.685475,7.90703 -105.127196,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.40839,30.78392 68.2051,43.16313 116.09416,37.0432 z m 123.55383,-3.48485 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 6.25632,-2.13174 13.75606,-1.38843 17.03071,1.68796 3.00363,2.82176 4.52006,7.859 3.76557,12.50837 l -0.5614,3.45954 17.23783,0 c 15.99049,0 17.19221,-0.12663 16.60736,-1.75 -0.34676,-0.9625 -11.3074,-24.52811 -24.35699,-52.36803 L 389.5,586.26394 l -2.20223,8.28417 c -5.43651,20.45056 -16.12926,43.442 -28.12812,60.48077 -3.7085,5.26619 -12.52405,15.35377 -19.85601,22.72112 l -13.18637,13.25 16.7402,0 16.7402,0 3.44616,-3.59733 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z m 204.5,-16.11574 c 6.91566,-3.3665 20.86691,-14.51687 29.2683,-23.39237 9.10204,-9.61567 12.80146,-14.51499 17.17108,-22.74047 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.44816,-2.13108 12.13468,-28.12846 14.98722,-44.85437 1.97162,-11.56061 2.01909,-15.70351 1.94787,-170 C 670.88685,315.66778 670.4764,242.25 670.01491,239.5 c -3.22426,-19.21282 -4.28443,-23.94225 -7.0612,-31.5 -1.71763,-4.675 -3.55982,-9.97622 -4.09375,-11.78048 -1.64406,-5.55554 -9.83357,-19.52725 -17.32608,-29.55914 -5.17147,-6.9242 -16.16797,-17.98044 -24.0298,-24.16038 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.49369,-3.12396 -5.87802,-3.74582 -1.94639,-3.14932 -28.36299,-12.19282 -41.94275,-14.35874 -14.5879,-2.32671 -14.46904,-2.31277 -14.10203,-1.65417 0.18559,0.33305 16.40477,27.10024 36.04262,59.48266 21.98188,36.24767 35.34815,59.23414 34.77626,59.80603 -0.5109,0.5109 -9.6668,5.76997 -20.34644,11.68682 -39.40191,21.82989 -64.433,39.51253 -74.364,52.53275 l -2.76193,3.62106 2.79411,4.0319 c 3.00143,4.33108 4.79592,5.9796 3.8632,3.549 -0.91363,-2.38089 5.53557,-13.37957 10.30899,-17.5813 7.13619,-6.28152 12.55417,-8.38492 21.78922,-8.45911 6.77224,-0.0544 8.85484,0.35555 13.57008,2.67125 5.6042,2.75228 10.68314,8.355 12.92918,14.26255 0.76572,2.01398 1.35726,2.45093 2.28061,1.68462 0.6857,-0.56908 3.3314,-1.55962 5.87934,-2.2012 9.72127,-2.44784 21.58459,2.67566 25.93341,11.20006 4.0399,7.91885 1.16335,18.40419 -7.2601,26.46387 -8.93676,8.55083 -20.99374,11.58859 -30.06652,7.57527 l -4.57887,-2.02545 -2.73148,2.85105 -2.73147,2.85105 14.90282,14.80133 c 21.53391,21.38726 36.78515,40.12093 48.14718,59.14099 5.51257,9.22804 5.61597,9.33005 8.65253,8.536 1.69031,-0.44201 5.85017,-0.81986 9.24413,-0.83966 5.18473,-0.0303 6.58324,0.35164 8.75152,2.38974 5.6796,5.33862 5.24365,14.15245 -1.35572,27.40936 l -3.90036,7.8351 1.95475,5.6649 c 1.07512,3.11569 3.09496,11.0649 4.48853,17.6649 3.4507,16.34266 4.37766,45.53349 1.98776,62.597 -5.98958,42.76478 -24.86618,79.46949 -59.04009,114.80088 -8.8906,9.19172 -9.53523,10.08508 -5.55723,7.70142 2.475,-1.48304 6.3,-3.57267 8.5,-4.64361 z m 46.51222,-71.93285 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 627.33929,197.06526 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 424.06716,560.60751 c 21.4827,-10.6722 38.00097,-22.74817 42.47158,-31.04959 l 1.94611,-3.6137 -2.85293,-5.44902 c -5.86946,-11.21052 -18.63311,-24.10662 -43.9529,-44.40898 -7.05154,-5.65419 -15.60154,-12.76208 -19,-15.79532 l -6.17902,-5.51498 -0.60767,49.86204 c -0.4785,39.26401 -0.95292,51.88124 -2.23206,59.36204 -0.89342,5.225 -1.63247,10.0364 -1.64233,10.692 -0.0188,1.25092 10.36893,-3.31413 32.04922,-14.08449 z m -18.05494,-48.58467 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 153,449.96538 c 30.525,-2.24027 56.5125,-4.28254 57.75,-4.53836 L 213,444.9619 213,396.98095 213,349 l -3.25,-0.0119 c -4.04611,-0.0148 -12.25074,-2.15958 -16.32515,-4.26762 -4.3158,-2.23292 -9.95342,-8.76204 -11.43071,-13.23826 -0.81629,-2.4734 -1.0738,-7.09666 -0.74526,-13.38071 0.5598,-10.7077 2.85824,-18.06073 8.06834,-25.81183 5.06476,-7.53488 11.517,-11.81366 22.43278,-14.87624 0.98632,-0.27672 1.25,-16.81069 1.25,-78.38209 C 213,122.2377 213.03104,121 214.95704,121 c 2.02461,0 106.38642,11.57046 113.62345,12.59729 l 4.08048,0.57896 1.74924,-4.58032 c 2.08549,-5.46076 10.34372,-13.17036 15.64494,-14.60558 6.7964,-1.84002 13.78674,1.9705 16.01813,8.73168 1.20293,3.64493 0.42047,12.35046 -1.20036,13.35493 -0.51205,0.31733 6.04954,1.25753 14.5813,2.08933 l 15.51229,1.51236 7.26675,-7.14336 c 3.9967,-3.92884 10.86674,-10.38 15.26674,-14.33589 l 8,-7.19254 -100.5,0.081 c -55.275,0.0445 -102.975,0.42751 -106,0.85107 -9.77711,1.36901 -26.34213,5.22073 -32.5,7.55696 -14.71144,5.58135 -20.25984,8.063 -23.90004,10.68982 -2.14502,1.54789 -4.32454,2.81434 -4.84337,2.81434 -2.17422,0 -19.89194,14.42929 -27.81938,22.65607 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 2.783467,0.0193 C 96.24744,454.02993 122.475,452.20566 153,449.96538 z m 14.33929,-34.90012 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 96.012222,392.02284 c -2.352864,-4.39637 4.977198,-13.58958 10.239508,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.851184,4.00699 -9.462418,0.99637 z M 136.58194,245.24523 c -14.1751,-5.03021 -15.54418,-22.26169 -3.14948,-39.64011 3.96631,-5.5611 6.24739,-7.70273 10.49685,-9.85512 9.83866,-4.98337 21.0038,-3.14597 27.77994,4.57164 1.75566,1.99958 3.4992,5.27255 3.87453,7.27326 2.06971,11.03252 -8.29224,29.14132 -20.43571,35.71396 -6.41777,3.4736 -12.45874,4.10366 -18.56613,1.93637 z m 33.94331,-31.93605 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 43.61997,-22.32995 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3650"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#dbba52"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 21.59155,-10.98831 44.3713,-25.45425 59.47052,-37.76586 8.85557,-7.22066 25.8871,-24.0751 32.62102,-32.28182 45.47954,-55.42656 50.01965,-127.65132 11.95951,-190.25348 -17.98566,-29.5832 -43.98256,-57.26166 -82.37251,-87.70063 -18.45533,-14.63302 -31.06358,-28.79687 -36.69259,-41.21968 -3.3296,-7.3482 -3.13093,-18.15321 0.46018,-25.02796 2.67098,-5.11326 10.0394,-14.86749 14.20036,-18.79825 15.10784,-14.27204 34.08689,-27.90907 59.2332,-42.56085 l 9.20115,-5.36116 -1.83273,-3.03899 c -1.008,-1.67145 -7.43995,-12.264 -14.29322,-23.539 -6.85326,-11.275 -21.34052,-35.125 -32.1939,-53 -10.85338,-17.875 -20.10516,-32.88321 -20.55952,-33.35159 -1.71881,-1.77183 -28.0717,15.24792 -46.51029,30.03821 -13.91749,11.16374 -35.42516,31.99907 -45.74335,44.31338 -47.13247,56.25055 -60.60664,119.96771 -37.29788,176.37566 13.80798,33.41573 35.96948,60.70067 74.02859,91.14296 35.69926,28.55472 52.80567,47.47243 59.13208,65.39327 4.48652,12.70897 2.74268,23.96896 -5.53825,35.76058 -9.18081,13.07301 -26.81126,26.44234 -51.27355,38.8812 l -12.814,6.51581 2.97969,5.90273 c 1.63883,3.24651 4.28545,8.74337 5.88137,12.21526 1.59592,3.47189 10.21644,21.83753 19.15672,40.81253 8.94027,18.975 18.2025,38.6625 20.58274,43.75 2.38023,5.0875 4.59959,9.25 4.93191,9.25 0.33232,0 6.30956,-2.90355 13.28275,-6.45232 z M 242.51189,690.44551 c 29.15196,-4.43931 54.34998,-17.82665 75.38098,-40.04881 23.91942,-25.27416 37.90717,-56.143 43.68074,-96.3967 1.33713,-9.32259 1.74298,-23.18784 2.14346,-73.22934 l 0.49402,-61.72935 -7.19679,-10.77065 c -36.21183,-54.19431 -43.45325,-119.4095 -19.84327,-178.70572 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26734,192.70083 L 246.5,543.5 l -2.222,7.80048 c -4.30562,15.11517 -13.21318,28.20291 -20.92788,30.74899 -1.94301,0.64125 -6.61974,0.99147 -10.39273,0.77828 -8.08948,-0.4571 -10.13819,-1.93738 -14.80853,-10.69984 C 191.28495,559.2499 188.2072,540.30855 187.32259,505.5 l -0.60993,-24 -5.10633,0.34192 c -32.6556,2.18659 -104.688554,7.90697 -105.130336,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 17.63752,26.13766 46.2732,45.35856 76.92411,51.63313 16.50397,3.37854 36.84842,3.70875 55.30796,0.8977 z m 120.54194,-3.04284 c 5.1297,-5.35469 15.17713,-12.26203 20.44961,-14.05854 6.25632,-2.13174 13.75606,-1.38843 17.03071,1.68796 3.00363,2.82176 4.52006,7.859 3.76557,12.50837 l -0.5614,3.45954 17.13084,0 C 430.29112,691 438,690.66592 438,690.25761 c 0,-0.40832 -10.89804,-23.95816 -24.21786,-52.33299 l -24.21787,-51.5906 -3.18934,11.08299 c -9.98721,34.70557 -27.27397,62.89151 -52.95618,86.34467 l -7.91875,7.23146 17.05383,0.003 17.05384,0.003 3.44616,-3.59733 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z m 204.5,-16.11574 c 6.91566,-3.3665 20.86691,-14.51687 29.2683,-23.39237 9.10204,-9.61567 12.80146,-14.51499 17.17108,-22.74047 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.44816,-2.13108 12.13468,-28.12846 14.98722,-44.85437 1.97162,-11.56061 2.01909,-15.70351 1.94787,-170 C 670.88685,315.66778 670.4764,242.25 670.01491,239.5 c -3.22426,-19.21282 -4.28443,-23.94225 -7.0612,-31.5 -1.71763,-4.675 -3.55982,-9.97622 -4.09375,-11.78048 -1.64406,-5.55554 -9.83357,-19.52725 -17.32608,-29.55914 -5.17147,-6.9242 -16.16797,-17.98044 -24.0298,-24.16038 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.49369,-3.12396 -5.87802,-3.74582 -0.95289,-1.54182 -8.87036,-4.94 -21.44275,-9.20326 -8.8385,-2.99711 -16.29001,-4.60984 -32.76911,-7.09225 l -2.26912,-0.34182 1.84238,3.11498 c 1.01331,1.71324 17.23164,28.45472 36.04072,59.42552 18.80908,30.9708 33.97285,56.67538 33.69725,57.1213 -0.27559,0.44592 -6.92281,4.31339 -14.7716,8.59437 -40.63911,22.1659 -69.91616,42.33594 -79.28695,54.62374 l -3.72849,4.88912 2.78881,4.02426 c 2.99679,4.32437 4.79006,5.97049 3.8579,3.54135 -0.91363,-2.38089 5.53557,-13.37957 10.30899,-17.5813 7.13619,-6.28152 12.55417,-8.38492 21.78922,-8.45911 6.77224,-0.0544 8.85484,0.35555 13.57008,2.67125 5.6042,2.75228 10.68314,8.355 12.92918,14.26255 0.76572,2.01398 1.35726,2.45093 2.28061,1.68462 0.6857,-0.56908 3.3314,-1.55962 5.87934,-2.2012 9.72127,-2.44784 21.58459,2.67566 25.93341,11.20006 4.0399,7.91885 1.16335,18.40419 -7.2601,26.46387 -8.93676,8.55083 -20.99374,11.58859 -30.06652,7.57527 l -4.57887,-2.02545 -2.74122,2.86122 -2.74122,2.86122 14.9158,14.79116 c 21.62516,21.44445 36.61834,40.05855 49.41202,61.34525 l 4.57393,7.61032 3.94678,-1.40269 c 5.70525,-2.02764 13.82906,-1.19067 16.95599,1.74693 5.58951,5.25108 5.12009,14.14329 -1.44257,27.32645 l -3.90036,7.8351 1.95475,5.6649 c 4.42482,12.82315 6.98003,28.97754 7.58292,47.94023 0.69155,21.75114 -0.53259,34.18225 -5.20475,52.85434 -8.29276,33.14164 -26.74503,65.02609 -53.99012,93.29182 -9.47463,9.82956 -10.38187,11.04237 -6.50908,8.70143 2.475,-1.49603 6.3,-3.59629 8.5,-4.66723 z m 46.51222,-71.93285 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 627.33929,197.06526 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 423.12255,561.14645 c 20.52577,-9.99668 35.62581,-20.69254 42.40911,-30.03978 l 3.28748,-4.53007 -2.53975,-5.0383 C 460.49256,510.0585 448.12392,497.32626 423.5,477.5013 415.8,471.30195 406.575,463.67338 403,460.54892 l -6.5,-5.68085 -0.60191,49.31597 c -0.46748,38.30229 -0.96289,51.54925 -2.21829,59.31596 -0.88901,5.5 -1.63065,10.5364 -1.64809,11.192 -0.0323,1.21419 7.72149,-2.16396 31.09084,-13.54555 z m -17.11033,-49.12361 c -2.35286,-4.39637 4.9772,-13.58958 10.23951,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.85118,4.00699 -9.46242,0.99637 z M 153.5,449.95608 c 30.25,-2.23281 56.0125,-4.26993 57.25,-4.52692 L 213,444.9619 213,396.98095 213,349 l -3.25,-0.0119 c -4.04611,-0.0148 -12.25074,-2.15958 -16.32515,-4.26762 -4.3158,-2.23292 -9.95342,-8.76204 -11.43071,-13.23826 -0.81629,-2.4734 -1.0738,-7.09666 -0.74526,-13.38071 0.5598,-10.7077 2.85824,-18.06073 8.06834,-25.81183 5.06476,-7.53488 11.517,-11.81366 22.43278,-14.87624 0.98632,-0.27672 1.25,-16.81069 1.25,-78.38209 C 213,122.06412 213.02686,121 214.9699,121 c 1.08344,0 27.88919,2.925 59.56832,6.5 31.67914,3.575 57.73155,6.5 57.89425,6.5 0.1627,0 1.06783,-2.02149 2.0114,-4.4922 2.05138,-5.37146 10.35671,-13.09486 15.61128,-14.51745 6.77918,-1.83536 13.78659,1.97006 16.00488,8.69153 1.30244,3.94645 0.33021,13.25591 -1.40387,13.44258 -0.63589,0.0685 5.94335,0.92814 14.62053,1.91041 l 15.77669,1.78594 6.72331,-6.72638 C 405.47451,130.39493 412.325,123.90703 417,119.67688 l 8.5,-7.69118 -104.5,0.27211 -104.5,0.2721 -13.33712,3.23049 c -7.33542,1.77676 -16.11042,4.37858 -19.5,5.78181 -3.38958,1.40324 -8.62575,3.50017 -11.63593,4.65986 -3.01017,1.15969 -7.24019,3.38865 -9.40003,4.95323 -2.15985,1.56459 -4.3515,2.8447 -4.87033,2.8447 -2.17422,0 -19.89194,14.42929 -27.81938,22.65607 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 3.283467,0.008 C 97.02244,454.0122 123.25,452.18889 153.5,449.95608 z m 13.83929,-34.89082 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 96.012222,392.02284 c -2.352864,-4.39637 4.977198,-13.58958 10.239508,-12.84216 1.9476,0.27662 2.23647,0.89123 2.16001,4.59579 -0.0674,3.26554 -0.76171,4.97938 -2.9371,7.25 -3.38876,3.5371 -7.851184,4.00699 -9.462418,0.99637 z M 136.58194,245.24523 c -14.1751,-5.03021 -15.54418,-22.26169 -3.14948,-39.64011 3.96631,-5.5611 6.24739,-7.70273 10.49685,-9.85512 9.83866,-4.98337 21.0038,-3.14597 27.77994,4.57164 1.75566,1.99958 3.4992,5.27255 3.87453,7.27326 2.06971,11.03252 -8.29224,29.14132 -20.43571,35.71396 -6.41777,3.4736 -12.45874,4.10366 -18.56613,1.93637 z m 33.94331,-31.93605 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 43.61997,-22.32995 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3648"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#d2a370"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 21.59155,-10.98831 44.3713,-25.45425 59.47052,-37.76586 8.85557,-7.22066 25.8871,-24.0751 32.62102,-32.28182 45.47954,-55.42656 50.01965,-127.65132 11.95951,-190.25348 -17.98566,-29.5832 -43.98256,-57.26166 -82.37251,-87.70063 -18.45533,-14.63302 -31.06358,-28.79687 -36.69259,-41.21968 -3.3296,-7.3482 -3.13093,-18.15321 0.46018,-25.02796 2.67098,-5.11326 10.0394,-14.86749 14.20036,-18.79825 15.10784,-14.27204 34.08689,-27.90907 59.2332,-42.56085 l 9.20115,-5.36116 -1.83273,-3.03899 c -1.008,-1.67145 -7.43995,-12.264 -14.29322,-23.539 -6.85326,-11.275 -21.34052,-35.125 -32.1939,-53 -10.85338,-17.875 -20.10516,-32.88321 -20.55952,-33.35159 -1.71881,-1.77183 -28.0717,15.24792 -46.51029,30.03821 -13.91749,11.16374 -35.42516,31.99907 -45.74335,44.31338 -47.13247,56.25055 -60.60664,119.96771 -37.29788,176.37566 13.80798,33.41573 35.96948,60.70067 74.02859,91.14296 35.69926,28.55472 52.80567,47.47243 59.13208,65.39327 4.48652,12.70897 2.74268,23.96896 -5.53825,35.76058 -9.18081,13.07301 -26.81126,26.44234 -51.27355,38.8812 l -12.814,6.51581 2.97969,5.90273 c 1.63883,3.24651 4.28545,8.74337 5.88137,12.21526 1.59592,3.47189 10.21644,21.83753 19.15672,40.81253 8.94027,18.975 18.2025,38.6625 20.58274,43.75 2.38023,5.0875 4.59959,9.25 4.93191,9.25 0.33232,0 6.30956,-2.90355 13.28275,-6.45232 z M 242.51189,690.44551 c 29.15196,-4.43931 54.34998,-17.82665 75.38098,-40.04881 23.91942,-25.27416 37.90717,-56.143 43.68074,-96.3967 1.33713,-9.32259 1.74298,-23.18784 2.14346,-73.22934 l 0.49402,-61.72935 -7.19679,-10.77065 c -36.21183,-54.19431 -43.45325,-119.4095 -19.84327,-178.70572 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26734,192.70083 L 246.5,543.5 l -2.222,7.80048 c -4.30562,15.11517 -13.21318,28.20291 -20.92788,30.74899 -1.94301,0.64125 -6.61974,0.99147 -10.39273,0.77828 -8.08948,-0.4571 -10.13819,-1.93738 -14.80853,-10.69984 C 191.28495,559.2499 188.2072,540.30855 187.32259,505.5 l -0.60993,-24 -5.10633,0.34192 c -32.6556,2.18659 -104.688554,7.90697 -105.130336,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 17.63752,26.13766 46.2732,45.35856 76.92411,51.63313 16.50397,3.37854 36.84842,3.70875 55.30796,0.8977 z m 123.27595,-5.4126 c 15.35793,-13.86109 30.64225,-16.93711 36.87704,-7.42162 1.11693,1.70466 1.6358,4.39065 1.54139,7.97919 L 404.06394,691 l 16.96803,0 C 430.36439,691 438,690.66592 438,690.25761 c 0,-0.40832 -10.89804,-23.95816 -24.21786,-52.33299 l -24.21787,-51.5906 -3.18934,11.08299 c -9.98721,34.70557 -27.27397,62.89151 -52.95618,86.34467 l -7.91875,7.23146 16.83819,0.003 16.83819,0.003 6.61146,-5.96709 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z m 204.5,-16.11574 c 6.91566,-3.3665 20.86691,-14.51687 29.2683,-23.39237 9.10204,-9.61567 12.80146,-14.51499 17.17108,-22.74047 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.44816,-2.13108 12.13468,-28.12846 14.98722,-44.85437 1.97162,-11.56061 2.01909,-15.70351 1.94787,-170 C 670.88685,315.66778 670.4764,242.25 670.01491,239.5 c -3.22426,-19.21282 -4.28443,-23.94225 -7.0612,-31.5 -1.71763,-4.675 -3.55982,-9.97622 -4.09375,-11.78048 -1.64406,-5.55554 -9.83357,-19.52725 -17.32608,-29.55914 -5.17147,-6.9242 -16.16797,-17.98044 -24.0298,-24.16038 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.49369,-3.12396 -5.87802,-3.74582 -0.95289,-1.54182 -8.87036,-4.94 -21.44275,-9.20326 -8.8385,-2.99711 -16.29001,-4.60984 -32.76911,-7.09225 l -2.26912,-0.34182 1.84238,3.11498 c 1.01331,1.71324 17.23164,28.45472 36.04072,59.42552 18.80908,30.9708 33.97285,56.67538 33.69725,57.1213 -0.27559,0.44592 -6.92281,4.31339 -14.7716,8.59437 -40.63911,22.1659 -69.91616,42.33594 -79.28695,54.62374 l -3.72849,4.88912 2.78881,4.02426 c 2.97373,4.2911 4.79161,5.97454 3.87651,3.58984 -0.88839,-2.31511 4.33133,-11.50153 9.41267,-16.5658 15.26157,-15.21028 39.69073,-12.39631 48.12333,5.54327 1.59919,3.40211 2.4459,4.28037 3.37958,3.50548 2.64007,-2.19106 10.78266,-3.25329 16.24531,-2.11924 14.60255,3.03147 21.24886,16.59493 14.55821,29.70968 -2.42992,4.76304 -9.49129,11.39128 -15.29009,14.35223 -6.07635,3.10268 -16.02,3.62083 -21.34941,1.11249 l -4,-1.88264 -3.07204,2.59568 -3.07204,2.59568 15.10011,15 c 16.40946,16.30068 29.26423,31.2666 39.29423,45.74757 4.8314,6.97542 13.28013,20.43156 14.72822,23.45738 0.0539,0.11272 1.88086,-0.43003 4.0598,-1.20611 8.20337,-2.92181 16.56152,-0.91791 19.56295,4.69031 2.67896,5.00567 0.0904,17.68904 -5.58755,27.37771 l -2.47699,4.22668 2.01955,5.85323 c 4.48888,13.01006 7.042,29.07735 7.64771,48.12856 0.69155,21.75114 -0.53259,34.18225 -5.20475,52.85434 -8.29276,33.14164 -26.74503,65.02609 -53.99012,93.29182 -9.47463,9.82956 -10.38187,11.04237 -6.50908,8.70143 2.475,-1.49603 6.3,-3.59629 8.5,-4.66723 z m 46.51222,-71.93285 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 627.33929,197.06526 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 423.12255,561.14645 c 20.52577,-9.99668 35.62581,-20.69254 42.40911,-30.03978 l 3.28748,-4.53007 -2.53975,-5.0383 C 460.49256,510.0585 448.12392,497.32626 423.5,477.5013 415.8,471.30195 406.575,463.67338 403,460.54892 l -6.5,-5.68085 -0.60191,49.31597 c -0.46748,38.30229 -0.96289,51.54925 -2.21829,59.31596 -0.88901,5.5 -1.63065,10.5364 -1.64809,11.192 -0.0323,1.21419 7.72149,-2.16396 31.09084,-13.54555 z m -17.11033,-49.12361 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 153.5,449.95608 c 30.25,-2.23281 56.0125,-4.26993 57.25,-4.52692 l 2.25,-0.46726 0,-47.84327 0,-47.84327 -5.47935,-0.64399 c -8.79683,-1.03389 -15.84205,-4.17152 -20.35142,-9.06361 -4.71575,-5.11597 -6.15602,-9.53785 -6.16365,-18.92342 -0.0169,-20.79031 12.3453,-39.27532 28.49442,-42.60725 l 3,-0.61896 0.25609,-78.20907 C 213.00815,122.23411 213.04318,121 214.97599,121 c 1.0801,0 27.8831,2.925 59.56223,6.5 31.67914,3.575 57.73155,6.5 57.89425,6.5 0.1627,0 1.06783,-2.02149 2.0114,-4.4922 2.05138,-5.37146 10.35671,-13.09486 15.61128,-14.51745 6.77918,-1.83536 13.78659,1.97006 16.00488,8.69153 1.30244,3.94645 0.33021,13.25591 -1.40387,13.44258 -0.63589,0.0685 5.94335,0.92814 14.62053,1.91041 l 15.77669,1.78594 6.72331,-6.72638 C 405.47451,130.39493 412.325,123.90703 417,119.67688 l 8.5,-7.69118 -104.5,0.27211 -104.5,0.2721 -13.33712,3.23049 c -7.33542,1.77676 -16.11042,4.37858 -19.5,5.78181 -3.38958,1.40324 -8.62575,3.50017 -11.63593,4.65986 -3.01017,1.15969 -7.24019,3.38865 -9.40003,4.95323 -2.15985,1.56459 -4.3515,2.8447 -4.87033,2.8447 -2.17422,0 -19.89194,14.42929 -27.81938,22.65607 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 3.283467,0.008 C 97.02244,454.0122 123.25,452.18889 153.5,449.95608 z m 13.83929,-34.89082 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 96.012222,392.02284 c -1.542432,-2.88206 1.11095,-8.51784 5.177598,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.678543,4.10282 -9.329788,1.01744 z M 139.1376,245.88391 c -16.5405,-3.10151 -18.88427,-22.68836 -4.9388,-41.27358 6.82284,-9.09285 12.84116,-12.12175 22.53876,-11.34332 5.00381,0.40165 7.43081,1.17954 10.53756,3.37742 6.59604,4.66639 8.22726,7.59475 8.20869,14.73623 -0.0388,14.92065 -14.86824,32.76321 -28.98381,34.87287 -1.65,0.24661 -4.96308,0.0803 -7.3624,-0.36962 z m 31.38765,-32.57473 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 43.61997,-22.32995 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3646"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f8ba32"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 21.59155,-10.98831 44.3713,-25.45425 59.47052,-37.76586 8.85557,-7.22066 25.8871,-24.0751 32.62102,-32.28182 45.47954,-55.42656 50.01965,-127.65132 11.95951,-190.25348 -17.98566,-29.5832 -43.98256,-57.26166 -82.37251,-87.70063 -18.45533,-14.63302 -31.06358,-28.79687 -36.69259,-41.21968 -3.29802,-7.2785 -3.12839,-18.15947 0.38794,-24.8854 9.16598,-17.53237 34.77116,-38.95769 73.5058,-61.5065 l 9.20115,-5.35632 -1.83273,-3.03899 c -1.008,-1.67145 -7.43995,-12.264 -14.29322,-23.539 -6.85326,-11.275 -21.34052,-35.125 -32.1939,-53 -10.85338,-17.875 -20.10516,-32.88321 -20.55952,-33.35159 -1.71881,-1.77183 -28.0717,15.24792 -46.51029,30.03821 -13.91749,11.16374 -35.42516,31.99907 -45.74335,44.31338 -47.13247,56.25055 -60.60664,119.96771 -37.29788,176.37566 13.80798,33.41573 35.96948,60.70067 74.02859,91.14296 35.69926,28.55472 52.80567,47.47243 59.13208,65.39327 4.48652,12.70897 2.74268,23.96896 -5.53825,35.76058 -9.18081,13.07301 -26.81126,26.44234 -51.27355,38.8812 l -12.814,6.51581 2.97969,5.90273 c 1.63883,3.24651 4.28545,8.74337 5.88137,12.21526 1.59592,3.47189 10.21644,21.83753 19.15672,40.81253 8.94027,18.975 18.2025,38.6625 20.58274,43.75 2.38023,5.0875 4.59959,9.25 4.93191,9.25 0.33232,0 6.30956,-2.90355 13.28275,-6.45232 z M 242.51189,690.44551 c 29.15196,-4.43931 54.34998,-17.82665 75.38098,-40.04881 23.91942,-25.27416 37.90717,-56.143 43.68074,-96.3967 1.33713,-9.32259 1.74298,-23.18784 2.14346,-73.22934 l 0.49402,-61.72935 -7.19679,-10.77065 c -36.21183,-54.19431 -43.45325,-119.4095 -19.84327,-178.70572 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26734,192.70083 L 246.5,543.5 l -2.222,7.80048 c -4.30562,15.11517 -13.21318,28.20291 -20.92788,30.74899 -1.94301,0.64125 -6.61974,0.99147 -10.39273,0.77828 -8.08948,-0.4571 -10.13819,-1.93738 -14.80853,-10.69984 C 191.28495,559.2499 188.2072,540.30855 187.32259,505.5 l -0.60993,-24 -5.10633,0.34192 c -32.6556,2.18659 -104.688554,7.90697 -105.130336,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 17.63752,26.13766 46.2732,45.35856 76.92411,51.63313 16.50397,3.37854 36.84842,3.70875 55.30796,0.8977 z m 123.27595,-5.4126 c 15.35793,-13.86109 30.64225,-16.93711 36.87704,-7.42162 1.11693,1.70466 1.6358,4.39065 1.54139,7.97919 L 404.06394,691 l 16.96803,0 C 430.36439,691 438,690.66592 438,690.25761 c 0,-0.40832 -10.89804,-23.95816 -24.21786,-52.33299 l -24.21787,-51.5906 -3.18934,11.08299 c -9.98721,34.70557 -27.27397,62.89151 -52.95618,86.34467 l -7.91875,7.23146 16.83819,0.003 16.83819,0.003 6.61146,-5.96709 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z m 204.5,-16.11574 c 6.91566,-3.3665 20.86691,-14.51687 29.2683,-23.39237 9.10204,-9.61567 12.80146,-14.51499 17.17108,-22.74047 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.44816,-2.13108 12.13468,-28.12846 14.98722,-44.85437 1.97162,-11.56061 2.01909,-15.70351 1.94787,-170 C 670.88685,315.66778 670.4764,242.25 670.01491,239.5 c -3.22426,-19.21282 -4.28443,-23.94225 -7.0612,-31.5 -1.71763,-4.675 -3.55982,-9.97622 -4.09375,-11.78048 -1.64406,-5.55554 -9.83357,-19.52725 -17.32608,-29.55914 -5.17147,-6.9242 -16.16797,-17.98044 -24.0298,-24.16038 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.49369,-3.12396 -5.87802,-3.74582 -0.95289,-1.54182 -8.87036,-4.94 -21.44275,-9.20326 -8.8385,-2.99711 -16.29001,-4.60984 -32.76911,-7.09225 l -2.26912,-0.34182 1.84238,3.11498 c 1.01331,1.71324 17.23164,28.45472 36.04072,59.42552 18.80908,30.9708 33.97285,56.67538 33.69725,57.1213 -0.27559,0.44592 -6.92281,4.31339 -14.7716,8.59437 -40.63911,22.1659 -69.91616,42.33594 -79.28695,54.62374 l -3.72849,4.88912 2.78881,4.02426 c 2.97373,4.2911 4.79161,5.97454 3.87651,3.58984 -0.88839,-2.31511 4.33133,-11.50153 9.41267,-16.5658 15.26157,-15.21028 39.69073,-12.39631 48.12333,5.54327 1.59919,3.40211 2.4459,4.28037 3.37958,3.50548 2.64007,-2.19106 10.78266,-3.25329 16.24531,-2.11924 14.60255,3.03147 21.24886,16.59493 14.55821,29.70968 -2.42992,4.76304 -9.49129,11.39128 -15.29009,14.35223 -6.07635,3.10268 -16.02,3.62083 -21.34941,1.11249 l -4,-1.88264 -3.07204,2.59568 -3.07204,2.59568 15.10011,15 c 16.40946,16.30068 29.26423,31.2666 39.29423,45.74757 4.8314,6.97542 13.28013,20.43156 14.72822,23.45738 0.0539,0.11272 1.88086,-0.43003 4.0598,-1.20611 8.20337,-2.92181 16.56152,-0.91791 19.56295,4.69031 2.67896,5.00567 0.0904,17.68904 -5.58755,27.37771 l -2.47699,4.22668 2.01955,5.85323 c 4.48888,13.01006 7.042,29.07735 7.64771,48.12856 0.69155,21.75114 -0.53259,34.18225 -5.20475,52.85434 -8.29276,33.14164 -26.74503,65.02609 -53.99012,93.29182 -9.47463,9.82956 -10.38187,11.04237 -6.50908,8.70143 2.475,-1.49603 6.3,-3.59629 8.5,-4.66723 z m 46.51222,-71.93285 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 627.33929,197.06526 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 423.12255,561.14645 c 20.52577,-9.99668 35.62581,-20.69254 42.40911,-30.03978 l 3.28748,-4.53007 -2.53975,-5.0383 C 460.49256,510.0585 448.12392,497.32626 423.5,477.5013 415.8,471.30195 406.575,463.67338 403,460.54892 l -6.5,-5.68085 -0.60191,49.31597 c -0.46748,38.30229 -0.96289,51.54925 -2.21829,59.31596 -0.88901,5.5 -1.63065,10.5364 -1.64809,11.192 -0.0323,1.21419 7.72149,-2.16396 31.09084,-13.54555 z m -17.11033,-49.12361 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 153.5,449.95608 c 30.25,-2.23281 56.0125,-4.26993 57.25,-4.52692 l 2.25,-0.46726 0,-47.84327 0,-47.84327 -5.47935,-0.64399 c -8.79683,-1.03389 -15.84205,-4.17152 -20.35142,-9.06361 -4.71575,-5.11597 -6.15602,-9.53785 -6.16365,-18.92342 -0.0169,-20.79031 12.3453,-39.27532 28.49442,-42.60725 l 3,-0.61896 0.25609,-78.20907 C 213.00815,122.23411 213.04318,121 214.97599,121 c 1.0801,0 27.8831,2.925 59.56223,6.5 31.67914,3.575 57.73155,6.5 57.89425,6.5 0.1627,0 1.06783,-2.02149 2.0114,-4.4922 2.05138,-5.37146 10.35671,-13.09486 15.61128,-14.51745 6.77918,-1.83536 13.78659,1.97006 16.00488,8.69153 1.30244,3.94645 0.33021,13.25591 -1.40387,13.44258 -0.63589,0.0685 5.94335,0.92814 14.62053,1.91041 l 15.77669,1.78594 6.72331,-6.72638 C 405.47451,130.39493 412.325,123.90703 417,119.67688 l 8.5,-7.69118 -104.5,0.27211 -104.5,0.2721 -13.33712,3.23049 c -7.33542,1.77676 -16.11042,4.37858 -19.5,5.78181 -3.38958,1.40324 -8.62575,3.50017 -11.63593,4.65986 -3.01017,1.15969 -7.24019,3.38865 -9.40003,4.95323 -2.15985,1.56459 -4.3515,2.8447 -4.87033,2.8447 -2.17422,0 -19.89194,14.42929 -27.81938,22.65607 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 3.283467,0.008 C 97.02244,454.0122 123.25,452.18889 153.5,449.95608 z m 13.83929,-34.89082 c -3.406,-2.07683 -4.82387,-4.96313 -3.88746,-7.9135 1.808,-5.69649 18.71205,-5.379 20.92699,0.39304 2.93098,7.63802 -8.54222,12.70175 -17.03953,7.52046 z M 96.012222,392.02284 c -1.542432,-2.88206 1.11095,-8.51784 5.177598,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.678543,4.10282 -9.329788,1.01744 z M 139.1376,245.88391 c -16.5405,-3.10151 -18.88427,-22.68836 -4.9388,-41.27358 6.82284,-9.09285 12.84116,-12.12175 22.53876,-11.34332 5.00381,0.40165 7.43081,1.17954 10.53756,3.37742 6.59604,4.66639 8.22726,7.59475 8.20869,14.73623 -0.0388,14.92065 -14.86824,32.76321 -28.98381,34.87287 -1.65,0.24661 -4.96308,0.0803 -7.3624,-0.36962 z m 31.38765,-32.57473 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 43.61997,-22.32995 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3644"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#deb94c"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 21.59155,-10.98831 44.3713,-25.45425 59.47052,-37.76586 8.85557,-7.22066 25.8871,-24.0751 32.62102,-32.28182 45.47954,-55.42656 50.01965,-127.65132 11.95951,-190.25348 -17.98566,-29.5832 -43.98256,-57.26166 -82.37251,-87.70063 -18.45533,-14.63302 -31.06358,-28.79687 -36.69259,-41.21968 -3.29802,-7.2785 -3.12839,-18.15947 0.38794,-24.8854 9.16598,-17.53237 34.77116,-38.95769 73.5058,-61.5065 l 9.20115,-5.35632 -1.83273,-3.03899 c -1.008,-1.67145 -7.43995,-12.264 -14.29322,-23.539 -6.85326,-11.275 -21.34052,-35.125 -32.1939,-53 -10.85338,-17.875 -20.10516,-32.88321 -20.55952,-33.35159 -1.71881,-1.77183 -28.0717,15.24792 -46.51029,30.03821 -13.91749,11.16374 -35.42516,31.99907 -45.74335,44.31338 -47.13247,56.25055 -60.60664,119.96771 -37.29788,176.37566 13.80798,33.41573 35.96948,60.70067 74.02859,91.14296 35.69926,28.55472 52.80567,47.47243 59.13208,65.39327 4.48652,12.70897 2.74268,23.96896 -5.53825,35.76058 -9.18081,13.07301 -26.81126,26.44234 -51.27355,38.8812 l -12.814,6.51581 2.97969,5.90273 c 1.63883,3.24651 4.28545,8.74337 5.88137,12.21526 1.59592,3.47189 10.21644,21.83753 19.15672,40.81253 8.94027,18.975 18.2025,38.6625 20.58274,43.75 2.38023,5.0875 4.59959,9.25 4.93191,9.25 0.33232,0 6.30956,-2.90355 13.28275,-6.45232 z M 242.51189,690.44551 c 29.15196,-4.43931 54.34998,-17.82665 75.38098,-40.04881 23.91942,-25.27416 37.90717,-56.143 43.68074,-96.3967 1.33713,-9.32259 1.74298,-23.18784 2.14346,-73.22934 l 0.49402,-61.72935 -7.19679,-10.77065 c -36.21183,-54.19431 -43.45325,-119.4095 -19.84327,-178.70572 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26734,192.70083 L 246.5,543.5 l -2.222,7.80048 c -4.30562,15.11517 -13.21318,28.20291 -20.92788,30.74899 -1.94301,0.64125 -6.61974,0.99147 -10.39273,0.77828 -8.08948,-0.4571 -10.13819,-1.93738 -14.80853,-10.69984 C 191.28495,559.2499 188.2072,540.30855 187.32259,505.5 l -0.60993,-24 -5.10633,0.34192 c -32.6556,2.18659 -104.688554,7.90697 -105.130336,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 17.63752,26.13766 46.2732,45.35856 76.92411,51.63313 16.50397,3.37854 36.84842,3.70875 55.30796,0.8977 z m 123.27595,-5.4126 c 15.35793,-13.86109 30.64225,-16.93711 36.87704,-7.42162 1.11693,1.70466 1.6358,4.39065 1.54139,7.97919 L 404.06394,691 l 16.96803,0 C 430.36439,691 438,690.66592 438,690.25761 c 0,-0.40832 -10.89804,-23.95816 -24.21786,-52.33299 l -24.21787,-51.5906 -3.18934,11.08299 c -9.98721,34.70557 -27.27397,62.89151 -52.95618,86.34467 l -7.91875,7.23146 16.83819,0.003 16.83819,0.003 6.61146,-5.96709 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z m 204.5,-16.11574 c 6.91566,-3.3665 20.86691,-14.51687 29.2683,-23.39237 9.10204,-9.61567 12.80146,-14.51499 17.17108,-22.74047 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.44816,-2.13108 12.13468,-28.12846 14.98722,-44.85437 1.97162,-11.56061 2.01909,-15.70351 1.94787,-170 C 670.88685,315.66778 670.4764,242.25 670.01491,239.5 c -3.22426,-19.21282 -4.28443,-23.94225 -7.0612,-31.5 -1.71763,-4.675 -3.55982,-9.97622 -4.09375,-11.78048 -1.64406,-5.55554 -9.83357,-19.52725 -17.32608,-29.55914 -5.17147,-6.9242 -16.16797,-17.98044 -24.0298,-24.16038 -2.09906,-1.65 -4.98368,-3.95212 -6.41027,-5.11582 -1.4266,-1.1637 -4.92446,-3.29265 -7.77304,-4.73099 -2.84858,-1.43834 -5.49369,-3.12396 -5.87802,-3.74582 -0.95289,-1.54182 -8.87036,-4.94 -21.44275,-9.20326 -8.8385,-2.99711 -16.29001,-4.60984 -32.76911,-7.09225 l -2.26912,-0.34182 1.84238,3.11498 c 1.01331,1.71324 17.23164,28.45472 36.04072,59.42552 18.80908,30.9708 33.97285,56.67538 33.69725,57.1213 -0.27559,0.44592 -6.92281,4.31339 -14.7716,8.59437 -40.63911,22.1659 -69.91616,42.33594 -79.28695,54.62374 l -3.72849,4.88912 2.78881,4.02426 c 2.97373,4.2911 4.79161,5.97454 3.87651,3.58984 -0.88839,-2.31511 4.33133,-11.50153 9.41267,-16.5658 15.26157,-15.21028 39.69073,-12.39631 48.12333,5.54327 1.59919,3.40211 2.4459,4.28037 3.37958,3.50548 2.64007,-2.19106 10.78266,-3.25329 16.24531,-2.11924 14.60255,3.03147 21.24886,16.59493 14.55821,29.70968 -2.42992,4.76304 -9.49129,11.39128 -15.29009,14.35223 -6.07635,3.10268 -16.02,3.62083 -21.34941,1.11249 l -4,-1.88264 -3.07204,2.59568 -3.07204,2.59568 15.10011,15 c 16.40946,16.30068 29.26423,31.2666 39.29423,45.74757 4.8314,6.97542 13.28013,20.43156 14.72822,23.45738 0.0539,0.11272 1.88086,-0.43003 4.0598,-1.20611 8.20337,-2.92181 16.56152,-0.91791 19.56295,4.69031 2.67896,5.00567 0.0904,17.68904 -5.58755,27.37771 l -2.47699,4.22668 2.01955,5.85323 c 4.48888,13.01006 7.042,29.07735 7.64771,48.12856 0.69155,21.75114 -0.53259,34.18225 -5.20475,52.85434 -8.29276,33.14164 -26.74503,65.02609 -53.99012,93.29182 -9.47463,9.82956 -10.38187,11.04237 -6.50908,8.70143 2.475,-1.49603 6.3,-3.59629 8.5,-4.66723 z m 46.51222,-71.93285 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 629.29481,197.89283 C 625.93025,196.91996 623,193.6799 623,190.93248 c 0,-2.6614 3.18481,-4.67487 8.52095,-5.38704 5.95343,-0.79456 9.7614,0.42965 12.00968,3.86096 4.22048,6.44127 -4.11792,11.41206 -14.23582,8.48643 z M 423.12255,561.14645 c 20.52577,-9.99668 35.62581,-20.69254 42.40911,-30.03978 l 3.28748,-4.53007 -2.53975,-5.0383 C 460.49256,510.0585 448.12392,497.32626 423.5,477.5013 415.8,471.30195 406.575,463.67338 403,460.54892 l -6.5,-5.68085 -0.60191,49.31597 c -0.46748,38.30229 -0.96289,51.54925 -2.21829,59.31596 -0.88901,5.5 -1.63065,10.5364 -1.64809,11.192 -0.0323,1.21419 7.72149,-2.16396 31.09084,-13.54555 z m -17.11033,-49.12361 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 153.5,449.95608 c 30.25,-2.23281 56.0125,-4.26993 57.25,-4.52692 l 2.25,-0.46726 0,-47.84327 0,-47.84327 -5.47935,-0.64399 c -8.79683,-1.03389 -15.84205,-4.17152 -20.35142,-9.06361 -4.71575,-5.11597 -6.15602,-9.53785 -6.16365,-18.92342 -0.0169,-20.79031 12.3453,-39.27532 28.49442,-42.60725 l 3,-0.61896 0.25609,-78.20907 C 213.00815,122.23411 213.04318,121 214.97599,121 c 1.0801,0 27.89344,2.92617 59.58521,6.50259 31.69176,3.57643 58.03031,6.24987 58.5301,5.94099 0.49978,-0.30889 0.9087,-1.36754 0.9087,-2.35256 0,-2.89967 5.39093,-9.49911 10.55227,-12.91785 7.79268,-5.16166 16.47924,-3.82535 20.11078,3.09376 1.87716,3.57653 2.15691,13.04016 0.44639,15.10121 -0.81951,0.98744 2.26367,1.59285 14.46449,2.84024 l 15.506,1.5853 6.71003,-6.71281 C 405.48048,130.38882 412.325,123.90703 417,119.67688 l 8.5,-7.69118 -104.5,0.27211 -104.5,0.2721 -13.33712,3.23049 c -7.33542,1.77676 -16.11042,4.37858 -19.5,5.78181 -3.38958,1.40324 -8.62575,3.50017 -11.63593,4.65986 -3.01017,1.15969 -7.24019,3.38865 -9.40003,4.95323 -2.15985,1.56459 -4.3515,2.8447 -4.87033,2.8447 -2.17422,0 -19.89194,14.42929 -27.81938,22.65607 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 3.283467,0.008 C 97.02244,454.0122 123.25,452.18889 153.5,449.95608 z m 15.79481,-34.06325 C 165.93025,414.91996 163,411.6799 163,408.93248 c 0,-2.6614 3.18481,-4.67487 8.52095,-5.38704 5.95343,-0.79456 9.7614,0.42965 12.00968,3.86096 4.22048,6.44127 -4.11792,11.41206 -14.23582,8.48643 z M 96.012222,392.02284 c -1.542432,-2.88206 1.11095,-8.51784 5.177598,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.678543,4.10282 -9.329788,1.01744 z M 139.1376,245.88391 c -16.5405,-3.10151 -18.88427,-22.68836 -4.9388,-41.27358 6.82284,-9.09285 12.84116,-12.12175 22.53876,-11.34332 5.00381,0.40165 7.43081,1.17954 10.53756,3.37742 6.59604,4.66639 8.22726,7.59475 8.20869,14.73623 -0.0388,14.92065 -14.86824,32.76321 -28.98381,34.87287 -1.65,0.24661 -4.96308,0.0803 -7.3624,-0.36962 z m 31.38765,-32.57473 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 43.61997,-22.32995 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3642"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#fcb034"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 21.59155,-10.98831 44.3713,-25.45425 59.47052,-37.76586 8.85557,-7.22066 25.8871,-24.0751 32.62102,-32.28182 32.6403,-39.7792 44.6616,-88.8878 33.66833,-137.53958 C 612.884,445.61836 579.72822,400.36348 522.33241,354.76409 501.41292,338.14413 489.87514,325.6846 483.73587,313.08407 c -2.74585,-5.63571 -3.2063,-7.66436 -3.1967,-14.08407 0.009,-6.15394 0.48592,-8.408 2.65618,-12.55919 9.17857,-17.55647 34.96263,-39.11617 73.50415,-61.46156 5.05973,-2.9335 9.06425,-5.5914 8.89894,-5.90644 C 565.43313,218.75776 559.00201,208.15 551.30705,195.5 543.6121,182.85 528.71612,158.325 518.20488,141 c -10.51124,-17.325 -19.7345,-32.34992 -20.49613,-33.38871 -1.32786,-1.81109 -1.68941,-1.71218 -8.79676,2.40653 -28.28955,16.39381 -62.78852,45.49689 -84.1427,70.98218 -47.13247,56.25055 -60.60664,119.96771 -37.29788,176.37566 13.82818,33.46462 35.80977,60.53483 74.04315,91.18373 C 485.4315,483.76438 503,506.17568 503,526.99344 c 0,20.69002 -20.23692,41.75815 -59.08539,61.51227 l -12.90833,6.56377 2.97969,5.90273 c 1.63883,3.24651 4.28545,8.74337 5.88137,12.21526 1.59592,3.47189 10.21644,21.83753 19.15672,40.81253 8.94027,18.975 18.2025,38.6625 20.58274,43.75 2.38023,5.0875 4.59959,9.25 4.93191,9.25 0.33232,0 6.30956,-2.90355 13.28275,-6.45232 z M 242.51189,690.44551 c 29.15196,-4.43931 54.34998,-17.82665 75.38098,-40.04881 23.80828,-25.15673 37.98553,-56.34792 43.78887,-96.33933 1.1939,-8.22727 1.64292,-24.29064 2.03448,-72.78103 l 0.50244,-62.22367 -7.20057,-10.77633 C 320.80223,354.07593 313.56,288.86381 337.17103,229.56494 c 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26734,192.70083 L 246.5,543.5 l -2.222,7.80048 c -4.30562,15.11517 -13.21318,28.20291 -20.92788,30.74899 -1.94301,0.64125 -6.61974,0.99147 -10.39273,0.77828 -8.08948,-0.4571 -10.13819,-1.93738 -14.80853,-10.69984 C 191.28495,559.2499 188.2072,540.30855 187.32259,505.5 l -0.60993,-24 -5.10633,0.34192 c -32.6556,2.18659 -104.688554,7.90697 -105.130336,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 17.63752,26.13766 46.2732,45.35856 76.92411,51.63313 16.50397,3.37854 36.84842,3.70875 55.30796,0.8977 z m 123.27595,-5.4126 c 15.35793,-13.86109 30.64225,-16.93711 36.87704,-7.42162 1.11693,1.70466 1.6358,4.39065 1.54139,7.97919 L 404.06394,691 l 16.96803,0 c 9.33242,0 16.9693,-0.3375 16.97085,-0.75 0.002,-0.4125 -10.89654,-23.96219 -24.21797,-52.33265 l -24.22077,-51.58264 -3.18925,11.08264 c -9.78708,34.01013 -26.23112,61.19864 -51.17042,84.605 L 325.63879,691 l 16.76879,0 16.7688,0 6.61146,-5.96709 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z M 602.51957,670.5591 c 8.60507,-4.40812 16.42079,-10.48569 27.07531,-21.054 11.56812,-11.47451 15.29866,-16.18383 20.3445,-25.68225 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.44001,242.025 669.96186,239 c -2.64924,-16.76007 -4.07384,-22.74639 -8.32912,-35 -4.82271,-13.88757 -10.35438,-24.17254 -20.16899,-37.5 -8.79439,-11.94208 -27.36329,-28.37497 -38.36006,-33.94746 -2.72919,-1.38298 -5.27661,-3.02331 -5.66094,-3.64517 -0.95894,-1.5516 -9.51935,-5.23958 -21.72452,-9.35931 -8.62499,-2.91129 -15.46975,-4.37268 -32.48734,-6.9362 l -2.26912,-0.34182 1.84238,3.11498 c 1.01331,1.71324 17.23164,28.45472 36.04072,59.42552 18.80908,30.9708 33.97285,56.67538 33.69725,57.1213 -0.27559,0.44592 -6.92281,4.31339 -14.7716,8.59437 -40.75162,22.22726 -69.86862,42.2736 -79.22818,54.54668 l -3.78726,4.96618 2.78881,4.02426 c 2.97373,4.2911 4.79161,5.97454 3.87651,3.58984 -0.88839,-2.31511 4.33133,-11.50153 9.41267,-16.5658 15.26157,-15.21028 39.69073,-12.39631 48.12333,5.54327 1.59919,3.40211 2.4459,4.28037 3.37958,3.50548 2.64007,-2.19106 10.78266,-3.25329 16.24531,-2.11924 18.80996,3.90493 23.10229,23.88062 8.10241,37.70703 -9.2977,8.57032 -20.87562,11.49652 -29.82474,7.5379 l -4.4859,-1.98433 -3.15042,2.8149 -3.15041,2.81489 9.27958,8.53427 c 18.96168,17.43872 40.98498,43.84681 53.84622,64.56685 3.13392,5.04889 5.83392,9.57454 6,10.05702 0.16608,0.48247 2.10197,0.23488 4.30197,-0.5502 8.23651,-2.93925 16.59322,-0.94658 19.60123,4.67394 2.67104,4.99088 0.0914,17.68733 -5.5493,27.31245 l -2.43875,4.16142 2.44951,7.91849 c 6.52972,21.10845 9.1807,51.95613 6.46623,75.24311 -4.89555,41.99795 -25.03743,82.30989 -58.51984,117.1215 -8.63279,8.9755 -10.14569,10.93089 -7.00908,9.05911 2.2,-1.31286 5.80881,-3.31362 8.01957,-4.44613 z m 47.49265,-72.53626 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 629.29481,197.89283 C 625.93025,196.91996 623,193.6799 623,190.93248 c 0,-2.6614 3.18481,-4.67487 8.52095,-5.38704 5.95343,-0.79456 9.7614,0.42965 12.00968,3.86096 4.22048,6.44127 -4.11792,11.41206 -14.23582,8.48643 z M 422.62557,561.41158 c 20.99803,-10.22563 36.95519,-21.58154 43.31487,-30.82501 l 2.88753,-4.19688 -2.47118,-4.87493 c -5.61054,-11.068 -18.89236,-24.84482 -40.69295,-42.20957 C 418.97373,473.97634 409.675,466.24024 405,462.11385 l -8.5,-7.50252 -0.60191,49.44434 c -0.46773,38.42201 -0.96224,51.67357 -2.21829,59.44433 -0.88901,5.5 -1.63065,10.53343 -1.64809,11.18539 -0.033,1.234 7.62828,-2.09002 30.59386,-13.27381 z m -16.61335,-49.38874 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 153.5,449.95608 c 30.25,-2.23281 56.0125,-4.26993 57.25,-4.52692 l 2.25,-0.46726 0,-47.84327 0,-47.84327 -5.47935,-0.64399 c -8.79683,-1.03389 -15.84205,-4.17152 -20.35142,-9.06361 -4.71575,-5.11597 -6.15602,-9.53785 -6.16365,-18.92342 -0.0169,-20.79031 12.3453,-39.27532 28.49442,-42.60725 l 3,-0.61896 0.25609,-78.20907 C 213.00375,123.57588 213.07377,121 214.88182,121 c 1.02829,0 27.83755,2.92869 59.57613,6.5082 31.73858,3.57951 58.1195,6.25295 58.62428,5.94098 C 333.587,133.13721 334,132.07604 334,131.09102 c 0,-2.89967 5.39093,-9.49911 10.55227,-12.91785 7.79268,-5.16166 16.47924,-3.82535 20.11078,3.09376 1.87716,3.57653 2.15691,13.04016 0.44639,15.10121 -0.81951,0.98744 2.26367,1.59285 14.46449,2.84024 l 15.506,1.5853 6.71003,-6.71281 C 405.48048,130.38882 412.325,123.90703 417,119.67688 l 8.5,-7.69118 -104.5,0.29373 -104.5,0.29372 -11.5,2.69706 c -13.86609,3.25196 -19.72956,5.02146 -24.06036,7.261 -1.79592,0.92871 -5.61072,2.4955 -8.47735,3.48176 -2.86663,0.98627 -7.13587,3.18682 -9.48721,4.89012 -2.35134,1.7033 -4.69966,3.09691 -5.21849,3.09691 -2.17422,0 -19.89194,14.42929 -27.81938,22.65607 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 3.283467,0.008 C 97.02244,454.0122 123.25,452.18889 153.5,449.95608 z m 15.79481,-34.06325 C 165.93025,414.91996 163,411.6799 163,408.93248 c 0,-2.6614 3.18481,-4.67487 8.52095,-5.38704 5.95343,-0.79456 9.7614,0.42965 12.00968,3.86096 4.22048,6.44127 -4.11792,11.41206 -14.23582,8.48643 z M 96.012222,392.02284 c -1.542432,-2.88206 1.11095,-8.51784 5.177598,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.678543,4.10282 -9.329788,1.01744 z M 139.1376,245.88391 c -16.5405,-3.10151 -18.88427,-22.68836 -4.9388,-41.27358 6.82284,-9.09285 12.84116,-12.12175 22.53876,-11.34332 5.00381,0.40165 7.43081,1.17954 10.53756,3.37742 6.59604,4.66639 8.22726,7.59475 8.20869,14.73623 -0.0388,14.92065 -14.86824,32.76321 -28.98381,34.87287 -1.65,0.24661 -4.96308,0.0803 -7.3624,-0.36962 z m 31.38765,-32.57473 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m -7,-6.03255 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-5 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 56.61997,-11.2974 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3640"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f8b82e"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 21.59155,-10.98831 44.3713,-25.45425 59.47052,-37.76586 8.85557,-7.22066 25.8871,-24.0751 32.62102,-32.28182 32.6403,-39.7792 44.6616,-88.8878 33.66833,-137.53958 C 612.884,445.61836 579.72822,400.36348 522.33241,354.76409 501.41292,338.14413 489.87514,325.6846 483.73587,313.08407 c -2.74585,-5.63571 -3.2063,-7.66436 -3.1967,-14.08407 0.009,-6.15394 0.48592,-8.408 2.65618,-12.55919 9.17857,-17.55647 34.96263,-39.11617 73.50415,-61.46156 5.05973,-2.9335 9.06425,-5.5914 8.89894,-5.90644 C 565.43313,218.75776 559.00201,208.15 551.30705,195.5 543.6121,182.85 528.71612,158.325 518.20488,141 c -10.51124,-17.325 -19.7345,-32.34992 -20.49613,-33.38871 -1.32786,-1.81109 -1.68941,-1.71218 -8.79676,2.40653 -28.28955,16.39381 -62.78852,45.49689 -84.1427,70.98218 -47.13247,56.25055 -60.60664,119.96771 -37.29788,176.37566 13.82818,33.46462 35.80977,60.53483 74.04315,91.18373 C 485.4315,483.76438 503,506.17568 503,526.99344 c 0,20.69002 -20.23692,41.75815 -59.08539,61.51227 l -12.90833,6.56377 2.97969,5.90273 c 1.63883,3.24651 4.28545,8.74337 5.88137,12.21526 1.59592,3.47189 10.21644,21.83753 19.15672,40.81253 8.94027,18.975 18.2025,38.6625 20.58274,43.75 2.38023,5.0875 4.59959,9.25 4.93191,9.25 0.33232,0 6.30956,-2.90355 13.28275,-6.45232 z M 242.51189,690.44551 c 29.15196,-4.43931 54.34998,-17.82665 75.38098,-40.04881 23.80828,-25.15673 37.98553,-56.34792 43.78887,-96.33933 1.1939,-8.22727 1.64292,-24.29064 2.03448,-72.78103 l 0.50244,-62.22367 -7.20057,-10.77633 C 320.80223,354.07593 313.56,288.86381 337.17103,229.56494 c 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26734,192.70083 L 246.5,543.5 l -2.222,7.80048 c -4.30562,15.11517 -13.21318,28.20291 -20.92788,30.74899 -1.94301,0.64125 -6.61974,0.99147 -10.39273,0.77828 -8.08948,-0.4571 -10.13819,-1.93738 -14.80853,-10.69984 C 191.28495,559.2499 188.2072,540.30855 187.32259,505.5 l -0.60993,-24 -5.10633,0.34192 c -32.6556,2.18659 -104.688554,7.90697 -105.130336,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 17.63752,26.13766 46.2732,45.35856 76.92411,51.63313 16.50397,3.37854 36.84842,3.70875 55.30796,0.8977 z m 123.27595,-5.4126 c 15.35793,-13.86109 30.64225,-16.93711 36.87704,-7.42162 1.11693,1.70466 1.6358,4.39065 1.54139,7.97919 L 404.06394,691 l 16.96803,0 c 9.33242,0 16.9693,-0.3375 16.97085,-0.75 0.002,-0.4125 -10.89654,-23.96219 -24.21797,-52.33265 l -24.22077,-51.58264 -3.18925,11.08264 c -9.78708,34.01013 -26.23112,61.19864 -51.17042,84.605 L 325.63879,691 l 16.76879,0 16.7688,0 6.61146,-5.96709 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z M 602.51957,670.5591 c 8.60507,-4.40812 16.42079,-10.48569 27.07531,-21.054 11.56812,-11.47451 15.29866,-16.18383 20.3445,-25.68225 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.44001,242.025 669.96186,239 c -2.64924,-16.76007 -4.07384,-22.74639 -8.32912,-35 -4.82271,-13.88757 -10.35438,-24.17254 -20.16899,-37.5 -8.79439,-11.94208 -27.36329,-28.37497 -38.36006,-33.94746 -2.72919,-1.38298 -5.27661,-3.02331 -5.66094,-3.64517 -0.95894,-1.5516 -9.51935,-5.23958 -21.72452,-9.35931 -8.62499,-2.91129 -15.46975,-4.37268 -32.48734,-6.9362 l -2.26912,-0.34182 1.84238,3.11498 c 1.01331,1.71324 17.23164,28.45472 36.04072,59.42552 18.80908,30.9708 33.97285,56.67538 33.69725,57.1213 -0.27559,0.44592 -6.92281,4.31339 -14.7716,8.59437 -40.75162,22.22726 -69.86862,42.2736 -79.22818,54.54668 l -3.78726,4.96618 2.78881,4.02426 c 2.97373,4.2911 4.79161,5.97454 3.87651,3.58984 -0.88839,-2.31511 4.33133,-11.50153 9.41267,-16.5658 15.26157,-15.21028 39.69073,-12.39631 48.12333,5.54327 1.59919,3.40211 2.4459,4.28037 3.37958,3.50548 2.64007,-2.19106 10.78266,-3.25329 16.24531,-2.11924 18.80996,3.90493 23.10229,23.88062 8.10241,37.70703 -9.2977,8.57032 -20.87562,11.49652 -29.82474,7.5379 l -4.4859,-1.98433 -3.15042,2.8149 -3.15041,2.81489 9.27958,8.53427 c 18.96168,17.43872 40.98498,43.84681 53.84622,64.56685 3.13392,5.04889 5.83392,9.57454 6,10.05702 0.16608,0.48247 2.10197,0.23488 4.30197,-0.5502 8.23651,-2.93925 16.59322,-0.94658 19.60123,4.67394 2.67104,4.99088 0.0914,17.68733 -5.5493,27.31245 l -2.43875,4.16142 2.44951,7.91849 c 6.52972,21.10845 9.1807,51.95613 6.46623,75.24311 -4.89555,41.99795 -25.03743,82.30989 -58.51984,117.1215 -8.63279,8.9755 -10.14569,10.93089 -7.00908,9.05911 2.2,-1.31286 5.80881,-3.31362 8.01957,-4.44613 z m 47.49265,-72.53626 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 629.29481,197.89283 C 625.93025,196.91996 623,193.6799 623,190.93248 c 0,-2.6614 3.18481,-4.67487 8.52095,-5.38704 5.95343,-0.79456 9.7614,0.42965 12.00968,3.86096 4.22048,6.44127 -4.11792,11.41206 -14.23582,8.48643 z M 422.62557,561.41158 c 20.99803,-10.22563 36.95519,-21.58154 43.31487,-30.82501 l 2.88753,-4.19688 -2.47118,-4.87493 c -5.61054,-11.068 -18.89236,-24.84482 -40.69295,-42.20957 C 418.97373,473.97634 409.675,466.24024 405,462.11385 l -8.5,-7.50252 -0.60191,49.44434 c -0.46773,38.42201 -0.96224,51.67357 -2.21829,59.44433 -0.88901,5.5 -1.63065,10.53343 -1.64809,11.18539 -0.033,1.234 7.62828,-2.09002 30.59386,-13.27381 z m -16.61335,-49.38874 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 153.5,449.95608 c 30.25,-2.23281 56.0125,-4.26993 57.25,-4.52692 l 2.25,-0.46726 0,-47.84327 0,-47.84327 -5.47935,-0.64399 c -8.79683,-1.03389 -15.84205,-4.17152 -20.35142,-9.06361 -4.71575,-5.11597 -6.15602,-9.53785 -6.16365,-18.92342 -0.0169,-20.79031 12.3453,-39.27532 28.49442,-42.60725 l 3,-0.61896 0.25609,-78.20907 C 213.00375,123.57588 213.07377,121 214.88182,121 c 1.02829,0 27.83755,2.92869 59.57613,6.5082 31.73858,3.57951 58.1195,6.25295 58.62428,5.94098 C 333.587,133.13721 334,132.07604 334,131.09102 c 0,-2.89967 5.39093,-9.49911 10.55227,-12.91785 7.79268,-5.16166 16.47924,-3.82535 20.11078,3.09376 1.87716,3.57653 2.15691,13.04016 0.44639,15.10121 -0.81951,0.98744 2.26367,1.59285 14.46449,2.84024 l 15.506,1.5853 6.71003,-6.71281 C 405.48048,130.38882 412.325,123.90703 417,119.67688 l 8.5,-7.69118 -104.5,0.29373 -104.5,0.29372 -11.5,2.69706 c -13.86609,3.25196 -19.72956,5.02146 -24.06036,7.261 -1.79592,0.92871 -5.61072,2.4955 -8.47735,3.48176 -2.86663,0.98627 -7.13587,3.18682 -9.48721,4.89012 -2.35134,1.7033 -4.69966,3.09691 -5.21849,3.09691 -2.17422,0 -19.89194,14.42929 -27.81938,22.65607 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 3.283467,0.008 C 97.02244,454.0122 123.25,452.18889 153.5,449.95608 z m 15.79481,-34.06325 C 165.93025,414.91996 163,411.6799 163,408.93248 c 0,-2.6614 3.18481,-4.67487 8.52095,-5.38704 5.95343,-0.79456 9.7614,0.42965 12.00968,3.86096 4.22048,6.44127 -4.11792,11.41206 -14.23582,8.48643 z M 96.012222,392.02284 c -1.542432,-2.88206 1.11095,-8.51784 5.177598,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.678543,4.10282 -9.329788,1.01744 z M 139.1376,245.88391 c -16.5405,-3.10151 -18.88427,-22.68836 -4.9388,-41.27358 6.82284,-9.09285 12.84116,-12.12175 22.53876,-11.34332 5.00381,0.40165 7.43081,1.17954 10.53756,3.37742 6.59604,4.66639 8.22726,7.59475 8.20869,14.73623 -0.0388,14.92065 -14.86824,32.76321 -28.98381,34.87287 -1.65,0.24661 -4.96308,0.0803 -7.3624,-0.36962 z m 6.13143,-4.53985 c -0.67703,-0.27392 -2.02703,-0.29059 -3,-0.0371 -0.97297,0.25354 -0.41903,0.47766 1.23097,0.49804 1.65,0.0204 2.44606,-0.18706 1.76903,-0.46099 z M 130.68311,220.8125 c -0.31922,-0.79773 -0.55618,-0.56078 -0.60416,0.60417 -0.0434,1.05416 0.19292,1.64479 0.52522,1.3125 0.33229,-0.3323 0.36781,-1.1948 0.0789,-1.91667 z m 39.84214,-7.50332 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z M 150.25,201.33772 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m -356.75,-3.31727 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z M 558,339.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-5 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 56.61997,-11.2974 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z M 186.70573,318.75 c -0.23835,-1.2375 -0.43337,-0.225 -0.43337,2.25 0,2.475 0.19502,3.4875 0.43337,2.25 0.23836,-1.2375 0.23836,-3.2625 0,-4.5 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3638"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#faae34"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 21.59155,-10.98831 44.3713,-25.45425 59.47052,-37.76586 8.85557,-7.22066 25.8871,-24.0751 32.62102,-32.28182 32.6403,-39.7792 44.6616,-88.8878 33.66833,-137.53958 C 612.884,445.61836 579.72822,400.36348 522.33241,354.76409 501.41292,338.14413 489.87514,325.6846 483.73587,313.08407 c -2.74585,-5.63571 -3.2063,-7.66436 -3.1967,-14.08407 0.009,-6.15394 0.48592,-8.408 2.65618,-12.55919 9.17857,-17.55647 34.96263,-39.11617 73.50415,-61.46156 5.05973,-2.9335 9.06425,-5.5914 8.89894,-5.90644 C 565.43313,218.75776 559.00201,208.15 551.30705,195.5 543.6121,182.85 528.71612,158.325 518.20488,141 c -10.51124,-17.325 -19.7345,-32.34992 -20.49613,-33.38871 -1.32786,-1.81109 -1.68941,-1.71218 -8.79676,2.40653 -28.28955,16.39381 -62.78852,45.49689 -84.1427,70.98218 -47.13247,56.25055 -60.60664,119.96771 -37.29788,176.37566 13.82818,33.46462 35.80977,60.53483 74.04315,91.18373 C 485.4315,483.76438 503,506.17568 503,526.99344 c 0,20.69002 -20.23692,41.75815 -59.08539,61.51227 l -12.90833,6.56377 2.97969,5.90273 c 1.63883,3.24651 4.28545,8.74337 5.88137,12.21526 1.59592,3.47189 10.21644,21.83753 19.15672,40.81253 8.94027,18.975 18.2025,38.6625 20.58274,43.75 2.38023,5.0875 4.59959,9.25 4.93191,9.25 0.33232,0 6.30956,-2.90355 13.28275,-6.45232 z M 242.51189,690.44551 c 29.15196,-4.43931 54.34998,-17.82665 75.38098,-40.04881 23.80828,-25.15673 37.98553,-56.34792 43.78887,-96.33933 1.1939,-8.22727 1.64292,-24.29064 2.03448,-72.78103 l 0.50244,-62.22367 -7.20057,-10.77633 C 320.80223,354.07593 313.56,288.86381 337.17103,229.56494 c 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26734,192.70083 L 246.5,543.5 l -2.222,7.80048 c -4.30562,15.11517 -13.21318,28.20291 -20.92788,30.74899 -1.94301,0.64125 -6.61974,0.99147 -10.39273,0.77828 -8.08948,-0.4571 -10.13819,-1.93738 -14.80853,-10.69984 C 191.28495,559.2499 188.2072,540.30855 187.32259,505.5 l -0.60993,-24 -5.10633,0.34192 c -32.6556,2.18659 -104.688554,7.90697 -105.130336,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 17.63752,26.13766 46.2732,45.35856 76.92411,51.63313 16.50397,3.37854 36.84842,3.70875 55.30796,0.8977 z m 123.27595,-5.4126 c 15.35793,-13.86109 30.64225,-16.93711 36.87704,-7.42162 1.11693,1.70466 1.6358,4.39065 1.54139,7.97919 L 404.06394,691 l 16.96803,0 c 9.33242,0 16.9693,-0.3375 16.97085,-0.75 0.002,-0.4125 -10.89654,-23.96219 -24.21797,-52.33265 l -24.22077,-51.58264 -3.18925,11.08264 c -9.78708,34.01013 -26.23112,61.19864 -51.17042,84.605 L 325.63879,691 l 16.76879,0 16.7688,0 6.61146,-5.96709 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z M 602.51957,670.5591 c 8.60507,-4.40812 16.42079,-10.48569 27.07531,-21.054 11.56812,-11.47451 15.29866,-16.18383 20.3445,-25.68225 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.44001,242.025 669.96186,239 c -2.64924,-16.76007 -4.07384,-22.74639 -8.32912,-35 -4.82271,-13.88757 -10.35438,-24.17254 -20.16899,-37.5 -8.79439,-11.94208 -27.36329,-28.37497 -38.36006,-33.94746 -2.72919,-1.38298 -5.27661,-3.02331 -5.66094,-3.64517 -0.95894,-1.5516 -9.51935,-5.23958 -21.72452,-9.35931 -8.62499,-2.91129 -15.46975,-4.37268 -32.48734,-6.9362 l -2.26912,-0.34182 1.84238,3.11498 c 1.01331,1.71324 17.23164,28.45472 36.04072,59.42552 18.80908,30.9708 33.97285,56.67538 33.69725,57.1213 -0.27559,0.44592 -6.92281,4.31339 -14.7716,8.59437 -40.75162,22.22726 -69.86862,42.2736 -79.22818,54.54668 l -3.78726,4.96618 2.78881,4.02426 c 2.97373,4.2911 4.79161,5.97454 3.87651,3.58984 -0.88839,-2.31511 4.33133,-11.50153 9.41267,-16.5658 15.26157,-15.21028 39.69073,-12.39631 48.12333,5.54327 1.59919,3.40211 2.4459,4.28037 3.37958,3.50548 2.64007,-2.19106 10.78266,-3.25329 16.24531,-2.11924 18.80996,3.90493 23.10229,23.88062 8.10241,37.70703 -9.2977,8.57032 -20.87562,11.49652 -29.82474,7.5379 l -4.4859,-1.98433 -3.15042,2.8149 -3.15041,2.81489 9.27958,8.53427 c 18.96168,17.43872 40.98498,43.84681 53.84622,64.56685 3.13392,5.04889 5.83392,9.57454 6,10.05702 0.16608,0.48247 2.10197,0.23488 4.30197,-0.5502 8.23651,-2.93925 16.59322,-0.94658 19.60123,4.67394 2.67104,4.99088 0.0914,17.68733 -5.5493,27.31245 l -2.43875,4.16142 2.44951,7.91849 c 6.52972,21.10845 9.1807,51.95613 6.46623,75.24311 -4.89555,41.99795 -25.03743,82.30989 -58.51984,117.1215 -8.63279,8.9755 -10.14569,10.93089 -7.00908,9.05911 2.2,-1.31286 5.80881,-3.31362 8.01957,-4.44613 z m 47.49265,-72.53626 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 422.62557,561.41158 c 20.99803,-10.22563 36.95519,-21.58154 43.31487,-30.82501 l 2.88753,-4.19688 -2.47118,-4.87493 c -5.61054,-11.068 -18.89236,-24.84482 -40.69295,-42.20957 C 418.97373,473.97634 409.675,466.24024 405,462.11385 l -8.5,-7.50252 -0.60191,49.44434 c -0.46773,38.42201 -0.96224,51.67357 -2.21829,59.44433 -0.88901,5.5 -1.63065,10.53343 -1.64809,11.18539 -0.033,1.234 7.62828,-2.09002 30.59386,-13.27381 z m -16.61335,-49.38874 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z M 153.5,449.95608 c 30.25,-2.23281 56.0125,-4.26993 57.25,-4.52692 l 2.25,-0.46726 0,-47.84327 0,-47.84327 -5.47935,-0.64399 c -8.79683,-1.03389 -15.84205,-4.17152 -20.35142,-9.06361 -4.71575,-5.11597 -6.15602,-9.53785 -6.16365,-18.92342 -0.0169,-20.79031 12.3453,-39.27532 28.49442,-42.60725 l 3,-0.61896 0.25609,-78.20907 c 0.24107,-73.61927 0.35844,-78.20864 2,-78.20191 0.95915,0.004 41.89181,4.49082 90.96147,9.97085 l 89.21755,9.96369 6.78245,-6.78682 C 405.4479,130.42212 412.325,123.90703 417,119.67688 l 8.5,-7.69118 -104.5,0.29373 -104.5,0.29372 -11.5,2.69706 c -13.86609,3.25196 -19.72956,5.02146 -24.06036,7.261 -1.79592,0.92871 -5.61072,2.4955 -8.47735,3.48176 -2.86663,0.98627 -7.13587,3.18682 -9.48721,4.89012 -2.35134,1.7033 -4.69966,3.09691 -5.21849,3.09691 -2.17422,0 -19.89194,14.42929 -27.81938,22.65607 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 3.283467,0.008 C 97.02244,454.0122 123.25,452.18889 153.5,449.95608 z M 96.012222,392.02284 c -1.542432,-2.88206 1.11095,-8.51784 5.177598,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.678543,4.10282 -9.329788,1.01744 z M 139.1376,245.88391 c -16.5405,-3.10151 -18.88427,-22.68836 -4.9388,-41.27358 6.82284,-9.09285 12.84116,-12.12175 22.53876,-11.34332 5.00381,0.40165 7.43081,1.17954 10.53756,3.37742 6.59604,4.66639 8.22726,7.59475 8.20869,14.73623 -0.0388,14.92065 -14.86824,32.76321 -28.98381,34.87287 -1.65,0.24661 -4.96308,0.0803 -7.3624,-0.36962 z m 6.13143,-4.53985 c -0.67703,-0.27392 -2.02703,-0.29059 -3,-0.0371 -0.97297,0.25354 -0.41903,0.47766 1.23097,0.49804 1.65,0.0204 2.44606,-0.18706 1.76903,-0.46099 z M 130.68311,220.8125 c -0.31922,-0.79773 -0.55618,-0.56078 -0.60416,0.60417 -0.0434,1.05416 0.19292,1.64479 0.52522,1.3125 0.33229,-0.3323 0.36781,-1.1948 0.0789,-1.91667 z m 39.84214,-7.50332 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z M 150.25,201.33772 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -90,-96.41644 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 560.5,341.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m -356.75,-3.31727 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z M 558,339.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-5 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 56.61997,-11.2974 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z M 186.70573,318.75 c -0.23835,-1.2375 -0.43337,-0.225 -0.43337,2.25 0,2.475 0.19502,3.4875 0.43337,2.25 0.23836,-1.2375 0.23836,-3.2625 0,-4.5 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z"
+       id="path3636"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#dab54b"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 21.59155,-10.98831 44.3713,-25.45425 59.47052,-37.76586 8.85557,-7.22066 25.8871,-24.0751 32.62102,-32.28182 32.6403,-39.7792 44.6616,-88.8878 33.66833,-137.53958 C 612.884,445.61836 579.72822,400.36348 522.33241,354.76409 501.41292,338.14413 489.87514,325.6846 483.73587,313.08407 c -2.74585,-5.63571 -3.2063,-7.66436 -3.1967,-14.08407 0.009,-6.15394 0.48592,-8.408 2.65618,-12.55919 9.17857,-17.55647 34.96263,-39.11617 73.50415,-61.46156 5.05973,-2.9335 9.06425,-5.5914 8.89894,-5.90644 C 565.43313,218.75776 559.00201,208.15 551.30705,195.5 543.6121,182.85 528.71612,158.325 518.20488,141 c -10.51124,-17.325 -19.7345,-32.34992 -20.49613,-33.38871 -1.32786,-1.81109 -1.68941,-1.71218 -8.79676,2.40653 -28.28955,16.39381 -62.78852,45.49689 -84.1427,70.98218 -47.13247,56.25055 -60.60664,119.96771 -37.29788,176.37566 13.82818,33.46462 35.80977,60.53483 74.04315,91.18373 C 485.4315,483.76438 503,506.17568 503,526.99344 c 0,20.69002 -20.23692,41.75815 -59.08539,61.51227 l -12.90833,6.56377 2.97969,5.90273 c 1.63883,3.24651 4.28545,8.74337 5.88137,12.21526 1.59592,3.47189 10.21644,21.83753 19.15672,40.81253 8.94027,18.975 18.2025,38.6625 20.58274,43.75 2.38023,5.0875 4.59959,9.25 4.93191,9.25 0.33232,0 6.30956,-2.90355 13.28275,-6.45232 z M 242.51189,690.44551 c 29.15196,-4.43931 54.34998,-17.82665 75.38098,-40.04881 23.80828,-25.15673 37.98553,-56.34792 43.78887,-96.33933 1.1939,-8.22727 1.64292,-24.29064 2.03448,-72.78103 l 0.50244,-62.22367 -7.20057,-10.77633 C 320.80223,354.07593 313.56,288.86381 337.17103,229.56494 c 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26734,192.70083 L 246.5,543.5 l -2.222,7.80048 c -4.30562,15.11517 -13.21318,28.20291 -20.92788,30.74899 -1.94301,0.64125 -6.61974,0.99147 -10.39273,0.77828 -8.08948,-0.4571 -10.13819,-1.93738 -14.80853,-10.69984 C 191.28495,559.2499 188.2072,540.30855 187.32259,505.5 l -0.60993,-24 -5.10633,0.34192 c -32.6556,2.18659 -104.688554,7.90697 -105.130336,8.34875 -0.929923,0.92993 1.377522,43.58233 3.054684,56.46487 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 17.63752,26.13766 46.2732,45.35856 76.92411,51.63313 16.50397,3.37854 36.84842,3.70875 55.30796,0.8977 z m 123.27595,-5.4126 c 15.35793,-13.86109 30.64225,-16.93711 36.87704,-7.42162 1.11693,1.70466 1.6358,4.39065 1.54139,7.97919 L 404.06394,691 l 16.96803,0 c 9.33242,0 16.9693,-0.3375 16.97085,-0.75 0.002,-0.4125 -10.89654,-23.96219 -24.21797,-52.33265 l -24.22077,-51.58264 -3.18925,11.08264 c -9.78708,34.01013 -26.23112,61.19864 -51.17042,84.605 L 325.63879,691 l 16.76879,0 16.7688,0 6.61146,-5.96709 z M 371,689 c 1.1,-1.1 1.61974,-2 1.15499,-2 -0.46476,0 -1.6595,0.9 -2.65499,2 -0.99549,1.1 -1.51523,2 -1.15499,2 0.36025,0 1.55499,-0.9 2.65499,-2 z m 28,-2.92857 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z m -20.43502,-3.17658 c 0.48462,-0.78412 0.0909,-0.78107 -1.38861,0.0108 -1.13574,0.60783 -2.36935,1.59762 -2.74135,2.19954 -0.48462,0.78412 -0.0909,0.78107 1.38861,-0.0108 1.13574,-0.60783 2.36935,-1.59762 2.74135,-2.19954 z M 392,684.69113 c 0,-0.71988 -0.66145,-2.18238 -1.4699,-3.25 -1.32892,-1.75496 -1.35585,-1.62943 -0.28076,1.30887 1.27799,3.49286 1.75066,4.01695 1.75066,1.94113 z m -6.58729,-4.74835 c 2.83846,-0.67857 2.88105,-0.74631 0.52842,-0.84042 -1.40738,-0.0563 -3.43238,0.60601 -4.5,1.4718 -1.06762,0.86578 -1.30541,1.24397 -0.52842,0.84042 0.77699,-0.40355 2.80199,-1.06586 4.5,-1.4718 z m 217.10686,-9.38368 c 8.60507,-4.40812 16.42079,-10.48569 27.07531,-21.054 11.56812,-11.47451 15.29866,-16.18383 20.3445,-25.68225 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.44001,242.025 669.96186,239 c -2.64924,-16.76007 -4.07384,-22.74639 -8.32912,-35 -4.82271,-13.88757 -10.35438,-24.17254 -20.16899,-37.5 -8.79439,-11.94208 -27.36329,-28.37497 -38.36006,-33.94746 -2.72919,-1.38298 -5.27661,-3.02331 -5.66094,-3.64517 -0.95894,-1.5516 -9.51935,-5.23958 -21.72452,-9.35931 -8.62499,-2.91129 -15.46975,-4.37268 -32.48734,-6.9362 l -2.26912,-0.34182 1.84238,3.11498 c 1.01331,1.71324 17.23164,28.45472 36.04072,59.42552 18.80908,30.9708 33.97285,56.67538 33.69725,57.1213 -0.27559,0.44592 -6.92281,4.31339 -14.7716,8.59437 -40.75162,22.22726 -69.86862,42.2736 -79.22818,54.54668 l -3.78726,4.96618 2.78881,4.02426 c 2.97373,4.2911 4.79161,5.97454 3.87651,3.58984 -0.88839,-2.31511 4.33133,-11.50153 9.41267,-16.5658 15.26157,-15.21028 39.69073,-12.39631 48.12333,5.54327 1.59919,3.40211 2.4459,4.28037 3.37958,3.50548 2.64007,-2.19106 10.78266,-3.25329 16.24531,-2.11924 18.80996,3.90493 23.10229,23.88062 8.10241,37.70703 -9.2977,8.57032 -20.87562,11.49652 -29.82474,7.5379 l -4.4859,-1.98433 -3.15042,2.8149 -3.15041,2.81489 9.27958,8.53427 c 18.96168,17.43872 40.98498,43.84681 53.84622,64.56685 3.13392,5.04889 5.83392,9.57454 6,10.05702 0.16608,0.48247 2.10197,0.23488 4.30197,-0.5502 8.23651,-2.93925 16.59322,-0.94658 19.60123,4.67394 2.67104,4.99088 0.0914,17.68733 -5.5493,27.31245 l -2.43875,4.16142 2.44951,7.91849 c 6.52972,21.10845 9.1807,51.95613 6.46623,75.24311 -4.89555,41.99795 -25.03743,82.30989 -58.51984,117.1215 -8.63279,8.9755 -10.14569,10.93089 -7.00908,9.05911 2.2,-1.31286 5.80881,-3.31362 8.01957,-4.44613 z m 47.49265,-72.53626 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z m 7.95598,-8.46397 c -0.0175,-0.58238 -0.6925,-0.18536 -1.5,0.88226 -0.80751,1.06762 -1.45389,2.41762 -1.4364,3 0.0175,0.58238 0.6925,0.18536 1.5,-0.88226 0.80751,-1.06762 1.45389,-2.41762 1.4364,-3 z M 422.62557,561.41158 c 20.99803,-10.22563 36.95519,-21.58154 43.31487,-30.82501 l 2.88753,-4.19688 -2.47118,-4.87493 c -5.61054,-11.068 -18.89236,-24.84482 -40.69295,-42.20957 C 418.97373,473.97634 409.675,466.24024 405,462.11385 l -8.5,-7.50252 -0.60191,49.44434 c -0.46773,38.42201 -0.96224,51.67357 -2.21829,59.44433 -0.88901,5.5 -1.63065,10.53343 -1.64809,11.18539 -0.033,1.234 7.62828,-2.09002 30.59386,-13.27381 z m -16.61335,-49.38874 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z m 7.95598,-8.46397 c -0.0175,-0.58238 -0.6925,-0.18536 -1.5,0.88226 -0.80751,1.06762 -1.45389,2.41762 -1.4364,3 0.0175,0.58238 0.6925,0.18536 1.5,-0.88226 0.80751,-1.06762 1.45389,-2.41762 1.4364,-3 z M 648,453.44098 c 0,-1.40746 -0.40775,-2.30701 -0.90612,-1.999 -0.49837,0.30801 -0.67088,1.45956 -0.38337,2.55902 0.71955,2.75155 1.28949,2.50403 1.28949,-0.56002 z m -494.5,-3.4849 c 30.25,-2.23281 56.0125,-4.26993 57.25,-4.52692 l 2.25,-0.46726 0,-47.84327 0,-47.84327 -5.47935,-0.64399 c -8.79683,-1.03389 -15.84205,-4.17152 -20.35142,-9.06361 -4.71575,-5.11597 -6.15602,-9.53785 -6.16365,-18.92342 -0.0169,-20.79031 12.3453,-39.27532 28.49442,-42.60725 l 3,-0.61896 0.25609,-78.20907 c 0.24107,-73.61927 0.35844,-78.20864 2,-78.20191 0.95915,0.004 41.89181,4.49082 90.96147,9.97085 l 89.21755,9.96369 6.78245,-6.78682 C 405.4479,130.42212 412.325,123.90703 417,119.67688 l 8.5,-7.69118 -104.5,0.29373 -104.5,0.29372 -11.5,2.69706 c -13.86609,3.25196 -19.72956,5.02146 -24.06036,7.261 -1.79592,0.92871 -5.61072,2.4955 -8.47735,3.48176 -2.86663,0.98627 -7.13587,3.18682 -9.48721,4.89012 -2.35134,1.7033 -4.69966,3.09691 -5.21849,3.09691 -2.17422,0 -19.89194,14.42929 -27.81938,22.65607 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 l -0.33397,109.75 3.283467,0.008 C 97.02244,454.0122 123.25,452.18889 153.5,449.95608 z M 96.012222,392.02284 c -1.542432,-2.88206 1.11095,-8.51784 5.177598,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.678543,4.10282 -9.329788,1.01744 z m 7.955978,-8.46397 c -0.0175,-0.58238 -0.6925,-0.18536 -1.5,0.88226 -0.80751,1.06762 -1.45389,2.41762 -1.4364,3 0.0175,0.58238 0.6925,0.18536 1.5,-0.88226 0.80751,-1.06762 1.45389,-2.41762 1.4364,-3 z m 35.1694,-137.67496 c -16.5405,-3.10151 -18.88427,-22.68836 -4.9388,-41.27358 6.82284,-9.09285 12.84116,-12.12175 22.53876,-11.34332 5.00381,0.40165 7.43081,1.17954 10.53756,3.37742 6.59604,4.66639 8.22726,7.59475 8.20869,14.73623 -0.0388,14.92065 -14.86824,32.76321 -28.98381,34.87287 -1.65,0.24661 -4.96308,0.0803 -7.3624,-0.36962 z m 9.99638,-5.0422 C 151.26029,240.20465 153,239.32762 153,238.89274 c 0,-0.43488 -1.56055,-0.13865 -3.46788,0.65829 -6.76922,2.82835 -14.10242,0.84248 -17.50649,-4.74085 -1.10998,-1.8206 -2.01984,-2.80837 -2.02189,-2.19504 -0.007,2.00669 4.26017,6.59138 7.41145,7.96345 3.85139,1.67689 6.78052,1.74266 11.71879,0.26312 z m 8.9047,-11.05187 c 3.07408,-5.81513 2.27665,-5.87239 -1.04806,-0.0753 -1.64484,2.86802 -2.98373,5.56802 -2.97531,6 0.0197,1.00963 1.54506,-1.2366 4.02337,-5.92474 z M 129.68933,226.25 c -0.25153,-0.9625 -0.45733,-0.175 -0.45733,1.75 0,1.925 0.2058,2.7125 0.45733,1.75 0.25152,-0.9625 0.25152,-2.5375 0,-3.5 z m 4.67736,-13.75 c 0.36963,-1.1 -0.45588,0.25 -1.83445,3 -1.37858,2.75 -2.49761,5.9 -2.48673,7 0.0169,1.70518 1.6856,-2.15657 4.32118,-10 z m 36.15856,0.80918 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z m -8.81799,0.45248 c -0.23919,-1.24391 -0.44398,-0.46166 -0.45508,1.73834 -0.0111,2.2 0.18461,3.21775 0.4349,2.26166 0.25029,-0.95609 0.25937,-2.75609 0.0202,-4 z m -22.61748,-7.92942 c 1.51837,-2.8371 0.53359,-2.16999 -2.09287,1.41776 -1.47225,2.0111 -1.71373,2.70955 -0.63346,1.83224 0.96016,-0.77976 2.18701,-2.24226 2.72633,-3.25 z M 160,206.65499 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 155.5,202.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m -6.34549,-4.88968 c -1.41925,-0.90315 -7.53889,-0.86906 -9.86721,0.055 -0.94198,0.37384 1.15255,0.67971 4.65451,0.67971 3.50197,0 5.84768,-0.33061 5.2127,-0.73469 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -7,-1.3803 c 0,-0.71988 -0.66145,-2.18238 -1.4699,-3.25 -1.32892,-1.75496 -1.35585,-1.62943 -0.28076,1.30887 1.27799,3.49286 1.75066,4.01695 1.75066,1.94113 z m -5.25,-5.38046 c -0.9625,-0.25152 -2.5375,-0.25152 -3.5,0 -0.9625,0.25153 -0.175,0.45733 1.75,0.45733 1.925,0 2.7125,-0.2058 1.75,-0.45733 z m -79.13818,-91.18711 c -1.38586,-1.53136 -1.44314,-1.97431 -0.31142,-2.40859 0.76271,-0.29268 2.89302,-2.48578 4.73402,-4.87356 l 3.34727,-4.34141 -5.00448,5 c -4.5413,4.53722 -4.86856,5.16197 -3.53586,6.75 0.80774,0.9625 1.69363,1.75 1.96863,1.75 0.275,0 -0.26418,-0.8444 -1.19816,-1.87644 z M 212.91667,342.6389 C 212.6875,342.44029 209.8,342.01313 206.5,341.68966 c -3.81123,-0.37359 -5.27041,-0.2675 -4,0.29082 1.89204,0.8315 11.30275,1.42634 10.41667,0.65842 z M 558,339.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -365.76165,-3.87653 c -2.14562,-2.21371 -3.52275,-4.97359 -4.30743,-8.63242 -1.03921,-4.84568 -0.92192,-8.19073 0.64881,-18.5037 0.4192,-2.75238 0.35864,-2.84931 -0.52687,-0.84343 -1.77203,4.014 -2.37168,14.73617 -1.11672,19.96746 1.06881,4.4553 5.726,11.26618 7.70366,11.26618 0.41389,0 -0.66676,-1.46434 -2.40145,-3.25409 z m 394.17237,2.39855 c 0.29082,-0.47055 -0.58263,-0.64309 -1.94098,-0.38343 -1.35836,0.25967 -2.46974,0.64466 -2.46974,0.85555 0,0.77375 3.89864,0.35644 4.41072,-0.47212 z m -11.06564,-3.68759 c -0.32569,-0.84872 -0.80663,-1.32866 -1.06875,-1.06653 -0.26213,0.26213 -0.17998,0.95654 0.18255,1.54313 0.98605,1.59546 1.56238,1.28551 0.8862,-0.4766 z M 552,334.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 40.53895,-1.66547 c 1.51896,-1.67844 1.56042,-1.93233 0.2323,-1.42269 -0.88914,0.3412 -1.86228,1.26056 -2.16255,2.04304 -0.74711,1.94695 -0.24796,1.78653 1.93025,-0.62035 z m 16.08102,-9.63193 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z M 598.01096,325.75 c 1.08986,-1.7875 1.93718,-4.375 1.88294,-5.75 -0.0847,-2.14706 -0.20679,-2.04472 -0.86484,0.72495 -0.42142,1.77372 -1.51073,4.36122 -2.42069,5.75 -0.90996,1.38878 -1.41249,2.52505 -1.11672,2.52505 0.29576,0 1.42945,-1.4625 2.51931,-3.25 z M 537,322.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 65.99964,-5.6555 c -2.33124,-3.27391 -6.81359,-6.02599 -9.69998,-5.9556 -0.98981,0.0241 3.4e-4,0.68159 2.20034,1.461 4.05789,1.43762 8.421,5.7606 8.57398,8.49511 0.0563,1.00579 0.24849,1.09296 0.58344,0.26458 0.27474,-0.67949 -0.47126,-2.59878 -1.65778,-4.26509 z m -71.31653,-1.18699 c -0.31922,-0.79773 -0.55618,-0.56078 -0.60416,0.60417 -0.0434,1.05416 0.19293,1.64479 0.52522,1.3125 0.33229,-0.33229 0.36781,-1.1948 0.0789,-1.91667 z M 578.5,309 c 0.33992,-0.55 0.14148,-1 -0.44098,-1 -0.58246,0 -1.05902,0.45 -1.05902,1 0,0.55 0.19844,1 0.44098,1 0.24254,0 0.7191,-0.45 1.05902,-1 z m -3.44727,-4.36131 c -1.40053,-3.68367 -2.18549,-3.31796 -0.88509,0.41236 0.58498,1.67807 1.24916,2.86548 1.47596,2.63868 0.2268,-0.22679 -0.0391,-1.59976 -0.59087,-3.05104 z M 581.5,307 c 0.33992,-0.55 0.14148,-1 -0.44098,-1 -0.58246,0 -1.05902,0.45 -1.05902,1 0,0.55 0.19844,1 0.44098,1 0.24254,0 0.7191,-0.45 1.05902,-1 z m -44.56125,-13.96722 c 1.06137,-0.56803 5.67185,-1.12219 10.24551,-1.23148 l 8.31574,-0.19869 -7.48822,-0.34992 c -4.11853,-0.19246 -8.50143,-0.0956 -9.73978,0.21518 -2.29881,0.57696 -10.272,9.78167 -10.272,11.85858 0,0.63077 1.57702,-1.19489 3.50449,-4.05702 1.92747,-2.86213 4.37289,-5.66862 5.43426,-6.23665 z M 573,300.65499 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 568.5,296.5 l 1.90499,2.25 C 572.19521,300.86444 573,301.45524 573,300.65499 z M 199.93875,289.03278 c 1.06137,-0.56803 4.54685,-1.11389 7.74551,-1.21303 l 5.81574,-0.18025 -4.93373,-0.38204 c -2.71355,-0.21013 -5.97145,-0.1216 -7.23978,0.19673 C 198.98695,288.04138 191,297.22389 191,299.32645 c 0,0.63077 1.57702,-1.19489 3.50449,-4.05702 1.92747,-2.86213 4.37289,-5.66862 5.43426,-6.23665 z M 564,294.5 c -2.475,-1.32529 -5.4,-2.41021 -6.5,-2.41092 -1.20368,-7.8e-4 -0.60643,0.49993 1.5,1.25755 1.925,0.69237 4.4,1.78393 5.5,2.4257 1.1,0.64177 2.45,1.1602 3,1.15207 0.55,-0.008 -1.025,-1.09911 -3.5,-2.4244 z"
+       id="path3634"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f8ae34"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 46.38224,-23.60472 81.5436,-52.51757 103.081,-84.76252 24.02434,-35.96831 32.2449,-80.48939 22.67887,-122.82474 -9.87022,-43.68163 -40.25342,-87.47001 -88.67734,-127.80214 -6.37781,-5.31205 -16.08003,-13.3579 -21.5605,-17.87967 -28.79423,-23.75721 -38.68129,-43.83806 -30.00976,-60.9505 8.69212,-17.15307 36.45836,-40.33994 73.40842,-61.30148 5.08318,-2.88366 9.08024,-5.53183 8.88235,-5.88482 C 565.12465,218.25018 547.64621,189.41215 529.17316,159 520.65405,144.975 510.4094,128.1 506.40727,121.5 495.59038,103.66161 497.60209,104.9819 488.91199,110.01782 460.49023,126.48825 426.34144,155.29939 404.77942,181 c -47.12239,56.16701 -60.61751,119.96592 -37.30801,176.37566 13.82818,33.46462 35.80977,60.53483 74.04315,91.18373 36.34851,29.13793 53.29166,48.05465 59.47128,66.39859 8.4952,25.21762 -9.75314,48.93008 -56.21626,73.04915 l -13.73042,7.12748 2.96325,5.87017 c 1.62979,3.22859 4.27087,8.7108 5.86907,12.18269 2.77657,6.03173 29.07611,62.02495 39.24862,83.56253 2.66267,5.6375 5.10708,10.25 5.43202,10.25 0.32494,0 6.29615,-2.90355 13.26934,-6.45232 z M 234.78566,691.459 c 9.97828,-0.72578 25.34092,-4.32433 35.94354,-8.41942 36.06207,-13.9284 67.24975,-48.17138 81.5505,-89.53958 1.90131,-5.5 4.44988,-14.24918 5.66347,-19.44263 4.87726,-20.87166 5.25404,-26.926 5.77457,-92.78786 l 0.49183,-62.23048 -7.19603,-10.76952 c -36.21102,-54.19307 -43.45228,-119.40888 -19.84251,-178.70457 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26943,192.70083 -0.26943,192.70083 -2.29205,7.86595 c -3.07215,10.54311 -7.41175,18.87298 -12.87505,24.71369 -5.45277,5.82946 -9.34265,7.25828 -18.37134,6.74811 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42845 c -2.0625,0.23565 -22.425,1.7853 -45.25,3.44367 -52.530511,3.81665 -60.917141,4.52138 -61.569402,5.17364 -0.894834,0.89483 1.466698,43.87321 3.10008,56.41947 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 22.04124,23.07219 48.69526,35.53734 81.59416,38.15876 9.30882,0.74173 13.04666,0.67345 29.78566,-0.54408 z m 131.00218,-6.42609 c 15.35793,-13.86109 30.64225,-16.93711 36.87704,-7.42162 1.11693,1.70466 1.6358,4.39065 1.54139,7.97919 L 404.06394,691 l 16.96803,0 c 9.33242,0 16.97173,-0.3375 16.97625,-0.75 0.005,-0.4125 -10.89069,-23.9722 -24.21157,-52.35489 l -24.21979,-51.60489 -3.3169,11.53916 c -6.1513,21.39976 -15.94687,41.62659 -28.75145,59.36875 -3.29532,4.56603 -11.73762,14.03937 -18.76067,21.05187 l -12.76919,12.75 16.59886,0 16.59887,0 6.61146,-5.96709 z M 371,689 c 1.1,-1.1 1.61974,-2 1.15499,-2 -0.46476,0 -1.6595,0.9 -2.65499,2 -0.99549,1.1 -1.51523,2 -1.15499,2 0.36025,0 1.55499,-0.9 2.65499,-2 z m 28,-2.92857 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z m -20.43502,-3.17658 c 0.48462,-0.78412 0.0909,-0.78107 -1.38861,0.0108 -1.13574,0.60783 -2.36935,1.59762 -2.74135,2.19954 -0.48462,0.78412 -0.0909,0.78107 1.38861,-0.0108 1.13574,-0.60783 2.36935,-1.59762 2.74135,-2.19954 z M 392,684.69113 c 0,-0.71988 -0.66145,-2.18238 -1.4699,-3.25 -1.32892,-1.75496 -1.35585,-1.62943 -0.28076,1.30887 1.27799,3.49286 1.75066,4.01695 1.75066,1.94113 z m -6.58729,-4.74835 c 2.83846,-0.67857 2.88105,-0.74631 0.52842,-0.84042 -1.40738,-0.0563 -3.43238,0.60601 -4.5,1.4718 -1.06762,0.86578 -1.30541,1.24397 -0.52842,0.84042 0.77699,-0.40355 2.80199,-1.06586 4.5,-1.4718 z m 217.10686,-9.38368 c 8.60507,-4.40812 16.42079,-10.48569 27.07531,-21.054 11.56812,-11.47451 15.29866,-16.18383 20.3445,-25.68225 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -5.07271,-32.24695 -12.18859,-50.34731 -28.50229,-72.5 -8.79439,-11.94208 -27.36329,-28.37497 -38.36006,-33.94746 -2.72919,-1.38298 -5.24953,-2.9795 -5.60077,-3.54781 -1.08402,-1.75398 -7.48973,-4.5842 -20.00292,-8.83784 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.823,-0.27252 -2.0448,-0.0277 -1.27607,1.40871 0.51175,0.95621 16.73389,27.75311 36.0492,59.54866 32.76886,53.94188 34.99545,57.9005 33.27607,59.161 -1.01347,0.74299 -8.14268,4.78748 -15.84268,8.98774 -38.42046,20.95796 -68.64452,41.88762 -77.07639,53.37413 l -3.64624,4.96718 2.77766,4.00817 c 2.96401,4.27706 4.77929,5.9554 3.86537,3.57376 -0.88839,-2.31511 4.33133,-11.50153 9.41267,-16.5658 15.26157,-15.21028 39.69073,-12.39631 48.12333,5.54327 1.59919,3.40211 2.4459,4.28037 3.37958,3.50548 2.64007,-2.19106 10.78266,-3.25329 16.24531,-2.11924 14.60255,3.03147 21.24886,16.59493 14.55821,29.70968 -2.42992,4.76304 -9.49129,11.39128 -15.29009,14.35223 -6.07635,3.10268 -16.02,3.62083 -21.34941,1.11249 l -4,-1.88264 -3.09082,2.59568 -3.09082,2.59568 14.62196,14.5 c 15.19705,15.07029 27.72677,29.42421 37.29863,42.72892 5.42762,7.5443 16.29672,24.40738 16.94183,26.28473 0.17985,0.5234 2.06556,0.30579 4.31922,-0.49844 8.23651,-2.93925 16.59322,-0.94658 19.60123,4.67394 2.67104,4.99088 0.0914,17.68733 -5.5493,27.31245 l -2.43875,4.16142 2.44951,7.91849 c 4.75473,15.3705 6.6296,27.80785 7.17889,47.62292 0.40605,14.64774 0.13964,21.37113 -1.22835,31 -6.05027,42.58589 -25.01104,79.48193 -58.961,114.73306 -8.10269,8.41324 -9.27647,9.97623 -6.05223,8.0591 2.2,-1.30811 5.80881,-3.30498 8.01957,-4.43749 z m 47.49265,-72.53626 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z m 7.95598,-8.46397 c -0.0175,-0.58238 -0.6925,-0.18536 -1.5,0.88226 -0.80751,1.06762 -1.45389,2.41762 -1.4364,3 0.0175,0.58238 0.6925,0.18536 1.5,-0.88226 0.80751,-1.06762 1.45389,-2.41762 1.4364,-3 z M 421.11148,562.15688 c 22.88737,-11.15069 38.22658,-21.97408 44.91072,-31.68914 l 2.80577,-4.07805 -2.47118,-4.87493 C 460.61623,510.19027 447.87624,497.08706 423.70561,477.6476 415.89253,471.36385 406.575,463.61161 403,460.4204 l -6.5,-5.8022 -0.61022,49.4409 c -0.4719,38.23364 -0.97474,51.7077 -2.21829,59.4409 -0.88444,5.5 -1.62234,10.5369 -1.63978,11.19311 -0.0348,1.30939 6.00697,-1.2952 29.07977,-12.53623 z m -15.09926,-50.13404 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z m 7.95598,-8.46397 c -0.0175,-0.58238 -0.6925,-0.18536 -1.5,0.88226 -0.80751,1.06762 -1.45389,2.41762 -1.4364,3 0.0175,0.58238 0.6925,0.18536 1.5,-0.88226 0.80751,-1.06762 1.45389,-2.41762 1.4364,-3 z M 648,453.44098 c 0,-1.40746 -0.40775,-2.30701 -0.90612,-1.999 -0.49837,0.30801 -0.67088,1.45956 -0.38337,2.55902 0.71955,2.75155 1.28949,2.50403 1.28949,-0.56002 z m -490.5,-3.78028 55,-4.20868 0.25952,-48.08721 0.25952,-48.08721 -5.48887,-0.64511 c -8.80604,-1.03498 -15.85004,-4.17098 -20.36094,-9.06473 -4.71575,-5.11597 -6.15602,-9.53785 -6.16365,-18.92342 -0.0169,-20.79031 12.3453,-39.27532 28.49442,-42.60725 l 3,-0.61896 0.25609,-78.20907 C 212.97247,133.13004 213.22835,121 214.4059,121 c 0.76654,0 41.7409,4.488 91.05415,9.97333 l 89.66044,9.97333 6.68976,-6.80017 C 405.48961,130.40639 412.325,123.89017 417,119.66601 l 8.5,-7.68031 -104.5,0.29373 -104.5,0.29372 -11.5,2.67059 c -14.15221,3.28651 -30.68019,9.04007 -38,13.22819 -1.375,0.78673 -4.3,2.41288 -6.5,3.61366 -7.69235,4.19858 -22.07112,15.75816 -30.56279,24.57048 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 L 91.933066,454 97.216533,453.9347 C 100.12244,453.89877 127.25,451.97548 157.5,449.6607 z M 96.012222,392.02284 c -1.542432,-2.88206 1.11095,-8.51784 5.177598,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.678543,4.10282 -9.329788,1.01744 z m 7.955978,-8.46397 c -0.0175,-0.58238 -0.6925,-0.18536 -1.5,0.88226 -0.80751,1.06762 -1.45389,2.41762 -1.4364,3 0.0175,0.58238 0.6925,0.18536 1.5,-0.88226 0.80751,-1.06762 1.45389,-2.41762 1.4364,-3 z m 35.1694,-137.67496 c -16.5405,-3.10151 -18.88427,-22.68836 -4.9388,-41.27358 6.82284,-9.09285 12.84116,-12.12175 22.53876,-11.34332 5.00381,0.40165 7.43081,1.17954 10.53756,3.37742 6.59604,4.66639 8.22726,7.59475 8.20869,14.73623 -0.0388,14.92065 -14.86824,32.76321 -28.98381,34.87287 -1.65,0.24661 -4.96308,0.0803 -7.3624,-0.36962 z m 9.99638,-5.0422 C 151.26029,240.20465 153,239.32762 153,238.89274 c 0,-0.43488 -1.56055,-0.13865 -3.46788,0.65829 -6.76922,2.82835 -14.10242,0.84248 -17.50649,-4.74085 -1.10998,-1.8206 -2.01984,-2.80837 -2.02189,-2.19504 -0.007,2.00669 4.26017,6.59138 7.41145,7.96345 3.85139,1.67689 6.78052,1.74266 11.71879,0.26312 z m 8.9047,-11.05187 c 3.07408,-5.81513 2.27665,-5.87239 -1.04806,-0.0753 -1.64484,2.86802 -2.98373,5.56802 -2.97531,6 0.0197,1.00963 1.54506,-1.2366 4.02337,-5.92474 z M 129.68933,226.25 c -0.25153,-0.9625 -0.45733,-0.175 -0.45733,1.75 0,1.925 0.2058,2.7125 0.45733,1.75 0.25152,-0.9625 0.25152,-2.5375 0,-3.5 z m 4.67736,-13.75 c 0.36963,-1.1 -0.45588,0.25 -1.83445,3 -1.37858,2.75 -2.49761,5.9 -2.48673,7 0.0169,1.70518 1.6856,-2.15657 4.32118,-10 z m 36.15856,0.80918 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z m -8.81799,0.45248 c -0.23919,-1.24391 -0.44398,-0.46166 -0.45508,1.73834 -0.0111,2.2 0.18461,3.21775 0.4349,2.26166 0.25029,-0.95609 0.25937,-2.75609 0.0202,-4 z m -22.61748,-7.92942 c 1.51837,-2.8371 0.53359,-2.16999 -2.09287,1.41776 -1.47225,2.0111 -1.71373,2.70955 -0.63346,1.83224 0.96016,-0.77976 2.18701,-2.24226 2.72633,-3.25 z M 160,206.65499 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 155.5,202.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m -6.34549,-4.88968 c -1.41925,-0.90315 -7.53889,-0.86906 -9.86721,0.055 -0.94198,0.37384 1.15255,0.67971 4.65451,0.67971 3.50197,0 5.84768,-0.33061 5.2127,-0.73469 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -7,-1.3803 c 0,-0.71988 -0.66145,-2.18238 -1.4699,-3.25 -1.32892,-1.75496 -1.35585,-1.62943 -0.28076,1.30887 1.27799,3.49286 1.75066,4.01695 1.75066,1.94113 z m -5.25,-5.38046 c -0.9625,-0.25152 -2.5375,-0.25152 -3.5,0 -0.9625,0.25153 -0.175,0.45733 1.75,0.45733 1.925,0 2.7125,-0.2058 1.75,-0.45733 z m -79.13818,-91.18711 c -1.38586,-1.53136 -1.44314,-1.97431 -0.31142,-2.40859 0.76271,-0.29268 2.89302,-2.48578 4.73402,-4.87356 l 3.34727,-4.34141 -5.00448,5 c -4.5413,4.53722 -4.86856,5.16197 -3.53586,6.75 0.80774,0.9625 1.69363,1.75 1.96863,1.75 0.275,0 -0.26418,-0.8444 -1.19816,-1.87644 z M 212.91667,342.6389 C 212.6875,342.44029 209.8,342.01313 206.5,341.68966 c -3.81123,-0.37359 -5.27041,-0.2675 -4,0.29082 1.89204,0.8315 11.30275,1.42634 10.41667,0.65842 z M 558,339.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -365.76165,-3.87653 c -2.14562,-2.21371 -3.52275,-4.97359 -4.30743,-8.63242 -1.03921,-4.84568 -0.92192,-8.19073 0.64881,-18.5037 0.4192,-2.75238 0.35864,-2.84931 -0.52687,-0.84343 -1.77203,4.014 -2.37168,14.73617 -1.11672,19.96746 1.06881,4.4553 5.726,11.26618 7.70366,11.26618 0.41389,0 -0.66676,-1.46434 -2.40145,-3.25409 z m 394.17237,2.39855 c 0.29082,-0.47055 -0.58263,-0.64309 -1.94098,-0.38343 -1.35836,0.25967 -2.46974,0.64466 -2.46974,0.85555 0,0.77375 3.89864,0.35644 4.41072,-0.47212 z m -11.06564,-3.68759 c -0.32569,-0.84872 -0.80663,-1.32866 -1.06875,-1.06653 -0.26213,0.26213 -0.17998,0.95654 0.18255,1.54313 0.98605,1.59546 1.56238,1.28551 0.8862,-0.4766 z M 552,334.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m 40.53895,-1.66547 c 1.51896,-1.67844 1.56042,-1.93233 0.2323,-1.42269 -0.88914,0.3412 -1.86228,1.26056 -2.16255,2.04304 -0.74711,1.94695 -0.24796,1.78653 1.93025,-0.62035 z m 16.08102,-9.63193 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z M 598.01096,325.75 c 1.08986,-1.7875 1.93718,-4.375 1.88294,-5.75 -0.0847,-2.14706 -0.20679,-2.04472 -0.86484,0.72495 -0.42142,1.77372 -1.51073,4.36122 -2.42069,5.75 -0.90996,1.38878 -1.41249,2.52505 -1.11672,2.52505 0.29576,0 1.42945,-1.4625 2.51931,-3.25 z M 542,326.62244 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -5,-4 c 0,-0.20765 -0.7875,-0.99515 -1.75,-1.75 -1.58606,-1.24387 -1.62143,-1.2085 -0.37756,0.37756 1.30637,1.66575 2.12756,2.19548 2.12756,1.37244 z m -6,-4.96745 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 526.5,313.5 l 1.90499,2.25 c 1.79022,2.11444 2.59501,2.70524 2.59501,1.90499 z m 65.99964,-5.6555 c -2.33124,-3.27391 -6.81359,-6.02599 -9.69998,-5.9556 -0.98981,0.0241 3.4e-4,0.68159 2.20034,1.461 4.05789,1.43762 8.421,5.7606 8.57398,8.49511 0.0563,1.00579 0.24849,1.09296 0.58344,0.26458 0.27474,-0.67949 -0.47126,-2.59878 -1.65778,-4.26509 z m -71.31653,-1.18699 c -0.31922,-0.79773 -0.55618,-0.56078 -0.60416,0.60417 -0.0434,1.05416 0.19293,1.64479 0.52522,1.3125 0.33229,-0.33229 0.36781,-1.1948 0.0789,-1.91667 z M 578.5,309 c 0.33992,-0.55 0.14148,-1 -0.44098,-1 -0.58246,0 -1.05902,0.45 -1.05902,1 0,0.55 0.19844,1 0.44098,1 0.24254,0 0.7191,-0.45 1.05902,-1 z m -3.44727,-4.36131 c -1.40053,-3.68367 -2.18549,-3.31796 -0.88509,0.41236 0.58498,1.67807 1.24916,2.86548 1.47596,2.63868 0.2268,-0.22679 -0.0391,-1.59976 -0.59087,-3.05104 z M 581.5,307 c 0.33992,-0.55 0.14148,-1 -0.44098,-1 -0.58246,0 -1.05902,0.45 -1.05902,1 0,0.55 0.19844,1 0.44098,1 0.24254,0 0.7191,-0.45 1.05902,-1 z m -44.56125,-13.96722 c 1.06137,-0.56803 5.67185,-1.12219 10.24551,-1.23148 l 8.31574,-0.19869 -7.48822,-0.34992 c -4.11853,-0.19246 -8.50143,-0.0956 -9.73978,0.21518 -2.29881,0.57696 -10.272,9.78167 -10.272,11.85858 0,0.63077 1.57702,-1.19489 3.50449,-4.05702 1.92747,-2.86213 4.37289,-5.66862 5.43426,-6.23665 z M 573,300.65499 c 0,-0.18976 -1.0125,-1.20226 -2.25,-2.25 L 568.5,296.5 l 1.90499,2.25 C 572.19521,300.86444 573,301.45524 573,300.65499 z M 199.93875,289.03278 c 1.06137,-0.56803 4.54685,-1.11389 7.74551,-1.21303 l 5.81574,-0.18025 -4.93373,-0.38204 c -2.71355,-0.21013 -5.97145,-0.1216 -7.23978,0.19673 C 198.98695,288.04138 191,297.22389 191,299.32645 c 0,0.63077 1.57702,-1.19489 3.50449,-4.05702 1.92747,-2.86213 4.37289,-5.66862 5.43426,-6.23665 z M 564,294.5 c -2.475,-1.32529 -5.4,-2.41021 -6.5,-2.41092 -1.20368,-7.8e-4 -0.60643,0.49993 1.5,1.25755 1.925,0.69237 4.4,1.78393 5.5,2.4257 1.1,0.64177 2.45,1.1602 3,1.15207 0.55,-0.008 -1.025,-1.09911 -3.5,-2.4244 z"
+       id="path3632"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#d4b451"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 46.38224,-23.60472 81.5436,-52.51757 103.081,-84.76252 24.02434,-35.96831 32.2449,-80.48939 22.67887,-122.82474 -9.87022,-43.68163 -40.25342,-87.47001 -88.67734,-127.80214 -6.37781,-5.31205 -16.08003,-13.3579 -21.5605,-17.87967 -28.79423,-23.75721 -38.68129,-43.83806 -30.00976,-60.9505 8.69212,-17.15307 36.45836,-40.33994 73.40842,-61.30148 5.08318,-2.88366 9.08024,-5.53183 8.88235,-5.88482 C 565.12465,218.25018 547.64621,189.41215 529.17316,159 520.65405,144.975 510.4094,128.1 506.40727,121.5 495.59038,103.66161 497.60209,104.9819 488.91199,110.01782 460.49023,126.48825 426.34144,155.29939 404.77942,181 c -47.12239,56.16701 -60.61751,119.96592 -37.30801,176.37566 13.82818,33.46462 35.80977,60.53483 74.04315,91.18373 36.34851,29.13793 53.29166,48.05465 59.47128,66.39859 8.4952,25.21762 -9.75314,48.93008 -56.21626,73.04915 l -13.73042,7.12748 2.96325,5.87017 c 1.62979,3.22859 4.27087,8.7108 5.86907,12.18269 2.77657,6.03173 29.07611,62.02495 39.24862,83.56253 2.66267,5.6375 5.10708,10.25 5.43202,10.25 0.32494,0 6.29615,-2.90355 13.26934,-6.45232 z M 234.78566,691.459 c 9.97828,-0.72578 25.34092,-4.32433 35.94354,-8.41942 36.06207,-13.9284 67.24975,-48.17138 81.5505,-89.53958 1.90131,-5.5 4.44988,-14.24918 5.66347,-19.44263 4.87726,-20.87166 5.25404,-26.926 5.77457,-92.78786 l 0.49183,-62.23048 -7.19603,-10.76952 c -36.21102,-54.19307 -43.45228,-119.40888 -19.84251,-178.70457 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26943,192.70083 -0.26943,192.70083 -2.29205,7.86595 c -3.07215,10.54311 -7.41175,18.87298 -12.87505,24.71369 -5.45277,5.82946 -9.34265,7.25828 -18.37134,6.74811 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42845 c -2.0625,0.23565 -22.425,1.7853 -45.25,3.44367 -52.530511,3.81665 -60.917141,4.52138 -61.569402,5.17364 -0.894834,0.89483 1.466698,43.87321 3.10008,56.41947 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 22.04124,23.07219 48.69526,35.53734 81.59416,38.15876 9.30882,0.74173 13.04666,0.67345 29.78566,-0.54408 z m 131.00218,-6.42609 c 15.35793,-13.86109 30.64225,-16.93711 36.87704,-7.42162 1.11693,1.70466 1.6358,4.39065 1.54139,7.97919 L 404.06394,691 l 16.96803,0 c 9.33242,0 16.97173,-0.3375 16.97625,-0.75 0.005,-0.4125 -10.89069,-23.9722 -24.21157,-52.35489 l -24.21979,-51.60489 -3.3169,11.53916 c -6.1513,21.39976 -15.94687,41.62659 -28.75145,59.36875 -3.29532,4.56603 -11.73762,14.03937 -18.76067,21.05187 l -12.76919,12.75 16.59886,0 16.59887,0 6.61146,-5.96709 z m 26.74947,2.21709 c -0.98856,-5.40976 -3.11913,-8.25 -6.18864,-8.25 -3.27441,0 -11.91611,4.88964 -15.78576,8.9319 l -2.93709,3.0681 12.79838,0 12.79838,0 -0.68527,-3.75 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z M 602.51957,670.5591 c 8.60507,-4.40812 16.42079,-10.48569 27.07531,-21.054 11.56812,-11.47451 15.29866,-16.18383 20.3445,-25.68225 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -5.07271,-32.24695 -12.18859,-50.34731 -28.50229,-72.5 -8.79439,-11.94208 -27.36329,-28.37497 -38.36006,-33.94746 -2.72919,-1.38298 -5.24953,-2.9795 -5.60077,-3.54781 -1.08402,-1.75398 -7.48973,-4.5842 -20.00292,-8.83784 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.823,-0.27252 -2.0448,-0.0277 -1.27607,1.40871 0.51175,0.95621 16.73389,27.75311 36.0492,59.54866 32.76886,53.94188 34.99545,57.9005 33.27607,59.161 -1.01347,0.74299 -8.14268,4.78748 -15.84268,8.98774 -38.42046,20.95796 -68.64452,41.88762 -77.07639,53.37413 l -3.64624,4.96718 2.77766,4.00817 c 2.96401,4.27706 4.77929,5.9554 3.86537,3.57376 -0.88839,-2.31511 4.33133,-11.50153 9.41267,-16.5658 15.26157,-15.21028 39.69073,-12.39631 48.12333,5.54327 1.59919,3.40211 2.4459,4.28037 3.37958,3.50548 2.64007,-2.19106 10.78266,-3.25329 16.24531,-2.11924 14.60255,3.03147 21.24886,16.59493 14.55821,29.70968 -2.42992,4.76304 -9.49129,11.39128 -15.29009,14.35223 -6.07635,3.10268 -16.02,3.62083 -21.34941,1.11249 l -4,-1.88264 -3.09082,2.59568 -3.09082,2.59568 14.62196,14.5 c 15.19705,15.07029 27.72677,29.42421 37.29863,42.72892 5.42762,7.5443 16.29672,24.40738 16.94183,26.28473 0.17985,0.5234 2.06556,0.30579 4.31922,-0.49844 8.23651,-2.93925 16.59322,-0.94658 19.60123,4.67394 2.67104,4.99088 0.0914,17.68733 -5.5493,27.31245 l -2.43875,4.16142 2.44951,7.91849 c 4.75473,15.3705 6.6296,27.80785 7.17889,47.62292 0.40605,14.64774 0.13964,21.37113 -1.22835,31 -6.05027,42.58589 -25.01104,79.48193 -58.961,114.73306 -8.10269,8.41324 -9.27647,9.97623 -6.05223,8.0591 2.2,-1.30811 5.80881,-3.30498 8.01957,-4.43749 z m 47.49265,-72.53626 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z m 6.53584,-5.11577 c 0.87968,-1.70111 1.37441,-3.31793 1.09941,-3.59293 -0.46223,-0.46223 -3.64747,4.89634 -3.64747,6.1362 0,1.37147 1.08229,0.29121 2.54806,-2.54327 z M 421.11148,562.15688 c 22.88737,-11.15069 38.22658,-21.97408 44.91072,-31.68914 l 2.80577,-4.07805 -2.47118,-4.87493 C 460.61623,510.19027 447.87624,497.08706 423.70561,477.6476 415.89253,471.36385 406.575,463.61161 403,460.4204 l -6.5,-5.8022 -0.61022,49.4409 c -0.4719,38.23364 -0.97474,51.7077 -2.21829,59.4409 -0.88444,5.5 -1.62234,10.5369 -1.63978,11.19311 -0.0348,1.30939 6.00697,-1.2952 29.07977,-12.53623 z m -15.09926,-50.13404 c -1.54243,-2.88206 1.11095,-8.51784 5.1776,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.67854,4.10282 -9.32979,1.01744 z m 6.53584,-5.11577 c 0.87968,-1.70111 1.37441,-3.31793 1.09941,-3.59293 -0.46223,-0.46223 -3.64747,4.89634 -3.64747,6.1362 0,1.37147 1.08229,0.29121 2.54806,-2.54327 z M 648.56314,444.06496 C 647.72876,437.63609 645.68795,435 641.54521,435 l -3.40869,0 4.43174,9.48366 c 2.43746,5.21602 4.47694,10.05352 4.53219,10.75 0.0553,0.69649 0.53647,-0.53366 1.06937,-2.73366 0.53291,-2.2 0.7099,-5.99577 0.39332,-8.43504 z M 157.5,449.6607 l 55,-4.20868 0.25952,-48.08721 0.25952,-48.08721 -5.48887,-0.64511 c -8.80604,-1.03498 -15.85004,-4.17098 -20.36094,-9.06473 -4.71575,-5.11597 -6.15602,-9.53785 -6.16365,-18.92342 -0.0169,-20.79031 12.3453,-39.27532 28.49442,-42.60725 l 3,-0.61896 0.25609,-78.20907 C 212.97247,133.13004 213.22835,121 214.4059,121 c 0.76654,0 41.7409,4.488 91.05415,9.97333 l 89.66044,9.97333 6.68976,-6.80017 C 405.48961,130.40639 412.325,123.89017 417,119.66601 l 8.5,-7.68031 -104.5,0.29373 -104.5,0.29372 -11.5,2.67059 c -14.15221,3.28651 -30.68019,9.04007 -38,13.22819 -1.375,0.78673 -4.3,2.41288 -6.5,3.61366 -7.69235,4.19858 -22.07112,15.75816 -30.56279,24.57048 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 L 91.933066,454 97.216533,453.9347 C 100.12244,453.89877 127.25,451.97548 157.5,449.6607 z M 96.012222,392.02284 c -1.542432,-2.88206 1.11095,-8.51784 5.177598,-10.99721 4.41368,-2.69094 6.63548,-2.56988 7.38142,0.4022 0.79392,3.16321 -0.12488,5.88825 -3.22923,9.57757 -3.02531,3.59537 -7.678543,4.10282 -9.329788,1.01744 z m 6.535838,-5.11577 c 0.87968,-1.70111 1.37441,-3.31793 1.09941,-3.59293 -0.46223,-0.46223 -3.64747,4.89634 -3.64747,6.1362 0,1.37147 1.08229,0.29121 2.54806,-2.54327 z M 139.1376,245.88391 c -16.5405,-3.10151 -18.88427,-22.68836 -4.9388,-41.27358 6.82284,-9.09285 12.84116,-12.12175 22.53876,-11.34332 5.00381,0.40165 7.43081,1.17954 10.53756,3.37742 6.59604,4.66639 8.22726,7.59475 8.20869,14.73623 -0.0388,14.92065 -14.86824,32.76321 -28.98381,34.87287 -1.65,0.24661 -4.96308,0.0803 -7.3624,-0.36962 z m 9.99364,-4.9037 c 3.25439,-0.90396 4.08462,-1.9028 8,-9.62472 3.98066,-7.85068 4.36876,-9.26908 4.36876,-15.96656 0,-6.97001 -0.16934,-7.51968 -3.2717,-10.6197 -3.02079,-3.0185 -3.76387,-3.26783 -9.68888,-3.25096 -7.90091,0.0225 -10.08162,1.74755 -15.12072,11.96133 -6.49234,13.15937 -5.40342,22.80614 3.00544,26.62529 4.64963,2.11178 7.53909,2.31082 12.7071,0.87532 z m 21.39401,-27.67103 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -90.96823,-97.53315 c -0.99401,-1.19771 -0.34746,-2.46442 3.57956,-7.01307 l 4.79269,-5.55136 2.04799,2.48146 c 2.14046,2.59351 6.28606,4.54469 9.65593,4.54469 2.69881,0 11.11858,-8.06587 13.9074,-13.32285 2.96353,-5.58629 2.15737,-10.70444 -2.40461,-15.26642 C 590.95652,305.75652 580,303.40997 580,307.06739 580,307.58032 579.16826,308 578.15169,308 c -1.22071,0 -2.3698,-1.32757 -3.38412,-3.90978 C 571.60992,296.05162 560.64462,291 546.3533,291 c -7.81571,0 -8.48076,0.17302 -11.77167,3.06247 C 530.98505,297.22031 525,307.90213 525,311.16329 c 0,1.12796 3.93432,5.04561 10.13322,10.09028 5.57328,4.53554 14.46078,11.92625 19.75,16.4238 9.78582,8.32112 11.30751,9.4623 9.14855,6.86091 z M 213,315 l 0,-28 -5.9652,0 c -5.17091,0 -6.40973,0.3903 -9.3036,2.93115 -8.80749,7.73308 -14.03673,27.22401 -10.61282,39.55716 2.11617,7.6226 11.20616,13.27118 21.63162,13.44204 L 213,343 l 0,-28 z m 395.61997,8.32504 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z"
+       id="path3630"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e3b540"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 46.38224,-23.60472 81.5436,-52.51757 103.081,-84.76252 24.02434,-35.96831 32.2449,-80.48939 22.67887,-122.82474 -9.87022,-43.68163 -40.25342,-87.47001 -88.67734,-127.80214 -6.37781,-5.31205 -16.08003,-13.3579 -21.5605,-17.87967 -28.79423,-23.75721 -38.68129,-43.83806 -30.00976,-60.9505 8.69212,-17.15307 36.45836,-40.33994 73.40842,-61.30148 5.08318,-2.88366 9.08024,-5.53183 8.88235,-5.88482 C 565.12465,218.25018 547.64621,189.41215 529.17316,159 520.65405,144.975 510.4094,128.1 506.40727,121.5 495.59038,103.66161 497.60209,104.9819 488.91199,110.01782 460.49023,126.48825 426.34144,155.29939 404.77942,181 c -47.12239,56.16701 -60.61751,119.96592 -37.30801,176.37566 13.82818,33.46462 35.80977,60.53483 74.04315,91.18373 36.34851,29.13793 53.29166,48.05465 59.47128,66.39859 8.4952,25.21762 -9.75314,48.93008 -56.21626,73.04915 l -13.73042,7.12748 2.96325,5.87017 c 1.62979,3.22859 4.27087,8.7108 5.86907,12.18269 2.77657,6.03173 29.07611,62.02495 39.24862,83.56253 2.66267,5.6375 5.10708,10.25 5.43202,10.25 0.32494,0 6.29615,-2.90355 13.26934,-6.45232 z M 234.78566,691.459 c 9.97828,-0.72578 25.34092,-4.32433 35.94354,-8.41942 36.06207,-13.9284 67.24975,-48.17138 81.5505,-89.53958 1.90131,-5.5 4.44988,-14.24918 5.66347,-19.44263 4.87726,-20.87166 5.25404,-26.926 5.77457,-92.78786 l 0.49183,-62.23048 -7.19603,-10.76952 c -36.21102,-54.19307 -43.45228,-119.40888 -19.84251,-178.70457 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26943,192.70083 -0.26943,192.70083 -2.29205,7.86595 c -3.07215,10.54311 -7.41175,18.87298 -12.87505,24.71369 -5.45277,5.82946 -9.34265,7.25828 -18.37134,6.74811 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42845 c -2.0625,0.23565 -22.425,1.7853 -45.25,3.44367 -52.530511,3.81665 -60.917141,4.52138 -61.569402,5.17364 -0.894834,0.89483 1.466698,43.87321 3.10008,56.41947 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 22.04124,23.07219 48.69526,35.53734 81.59416,38.15876 9.30882,0.74173 13.04666,0.67345 29.78566,-0.54408 z m 131.87937,-7.07065 C 385.91244,667.60209 404,667.96374 404,685.13486 l 0,5.86514 17,0 c 9.35,0 17.0037,-0.3375 17.00822,-0.75 0.005,-0.4125 -10.89069,-23.9722 -24.21157,-52.35489 l -24.21979,-51.60489 -3.3169,11.53916 c -6.1513,21.39976 -15.94687,41.62659 -28.75145,59.36875 -3.29532,4.56603 -11.73762,14.03937 -18.76067,21.05187 l -12.76919,12.75 16.55268,0 16.55267,0 7.58103,-6.61165 z m 25.87228,2.86165 c -0.98856,-5.40976 -3.11913,-8.25 -6.18864,-8.25 -3.27441,0 -11.91611,4.88964 -15.78576,8.9319 l -2.93709,3.0681 12.79838,0 12.79838,0 -0.68527,-3.75 z M 399,686.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 398.4798,692.3711 399,691.9431 399,686.07143 z M 602.51957,670.5591 c 8.60507,-4.40812 16.42079,-10.48569 27.07531,-21.054 11.56812,-11.47451 15.29866,-16.18383 20.3445,-25.68225 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -5.07271,-32.24695 -12.18859,-50.34731 -28.50229,-72.5 -8.79439,-11.94208 -27.36329,-28.37497 -38.36006,-33.94746 -2.72919,-1.38298 -5.24953,-2.9795 -5.60077,-3.54781 -1.08402,-1.75398 -7.48973,-4.5842 -20.00292,-8.83784 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.823,-0.27252 -2.0448,-0.0277 -1.27607,1.40871 0.51175,0.95621 16.73389,27.75311 36.0492,59.54866 32.76886,53.94188 34.99545,57.9005 33.27607,59.161 -1.01347,0.74299 -8.14268,4.78748 -15.84268,8.98774 -38.42046,20.95796 -68.64452,41.88762 -77.07639,53.37413 l -3.64624,4.96718 2.77766,4.00817 c 2.98925,4.31348 4.77758,5.95094 3.84496,3.52056 -0.84323,-2.19741 4.43343,-11.41235 9.40351,-16.42192 6.34287,-6.39325 14.02642,-9.65573 22.6965,-9.63705 3.85,0.008 8.76214,0.6245 10.91586,1.36933 5.21062,1.80203 11.82264,8.03894 14.11903,13.31805 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.71488,-0.46153 3.55349,-1.4213 5.04917,-2.63569 14.67704,-2.27259 20.60298,0.777 5.64981,2.90749 10.17695,8.93195 10.92978,14.54472 1.23369,9.19789 -6.09036,20.85848 -16.84148,26.81323 -4.60604,2.55116 -6.38929,2.96008 -12.84835,2.94629 -5.02653,-0.0107 -8.48259,-0.55422 -10.47938,-1.64797 -2.88392,-1.57968 -3.07907,-1.54712 -6.09082,1.01616 L 566.31836,346.5 580.94032,361 c 15.19705,15.07029 27.72677,29.42421 37.29863,42.72892 5.56699,7.73802 16.32226,24.4547 16.95491,26.35265 0.20436,0.61309 2.01191,0.40429 4.69494,-0.54234 7.93823,-2.80077 14.99242,-1.4023 18.5505,3.67756 3.37348,4.81633 1.0759,17.7243 -5.03832,28.30562 l -2.32427,4.02241 2.46775,7.97759 c 4.77335,15.431 6.64724,27.84577 7.19712,47.68202 0.40605,14.64774 0.13964,21.37113 -1.22835,31 -6.05027,42.58589 -25.01104,79.48193 -58.961,114.73306 -8.10269,8.41324 -9.27647,9.97623 -6.05223,8.0591 2.2,-1.30811 5.80881,-3.30498 8.01957,-4.43749 z m 48.1471,-71.22577 c -1.37855,-1.37855 -0.59341,-7.15675 1.29944,-9.56311 2.75831,-3.50663 7.56285,-5.40604 9.53479,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 5.88139,-6.42626 c 0.87968,-1.70111 1.37441,-3.31793 1.09941,-3.59293 -0.46223,-0.46223 -3.64747,4.89634 -3.64747,6.1362 0,1.37147 1.08229,0.29121 2.54806,-2.54327 z M 421.11148,562.15688 c 22.88737,-11.15069 38.22658,-21.97408 44.91072,-31.68914 l 2.80577,-4.07805 -2.47118,-4.87493 C 460.61623,510.19027 447.87624,497.08706 423.70561,477.6476 415.89253,471.36385 406.575,463.61161 403,460.4204 l -6.5,-5.8022 -0.61022,49.4409 c -0.4719,38.23364 -0.97474,51.7077 -2.21829,59.4409 -0.88444,5.5 -1.62234,10.5369 -1.63978,11.19311 -0.0348,1.30939 6.00697,-1.2952 29.07977,-12.53623 z m -14.44481,-48.82355 c -1.37855,-1.37855 -0.59341,-7.15675 1.29944,-9.56311 2.75831,-3.50663 7.56285,-5.40604 9.53479,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 5.88139,-6.42626 c 0.87968,-1.70111 1.37441,-3.31793 1.09941,-3.59293 -0.46223,-0.46223 -3.64747,4.89634 -3.64747,6.1362 0,1.37147 1.08229,0.29121 2.54806,-2.54327 z M 648.56314,444.06496 C 647.72876,437.63609 645.68795,435 641.54521,435 l -3.40869,0 4.43174,9.48366 c 2.43746,5.21602 4.47694,10.05352 4.53219,10.75 0.0553,0.69649 0.53647,-0.53366 1.06937,-2.73366 0.53291,-2.2 0.7099,-5.99577 0.39332,-8.43504 z M 157.5,449.6607 l 55,-4.20868 0.25952,-48.08721 0.25952,-48.08721 -5.27672,-0.62017 C 194.72883,347.12795 184.4101,340.05614 181.97772,331 c -1.50522,-5.60417 -0.74112,-19.56307 1.46107,-26.69124 3.64441,-11.79642 13.93178,-22.60685 24.42437,-25.66621 l 4.63684,-1.35198 0.25609,-78.14528 C 212.97247,133.12079 213.22836,121 214.4059,121 c 0.76654,0 41.7409,4.488 91.05415,9.97333 l 89.66044,9.97333 6.68976,-6.80017 C 405.48961,130.40639 412.325,123.89017 417,119.66601 l 8.5,-7.68031 -104.5,0.29373 -104.5,0.29372 -11.5,2.67059 c -14.15221,3.28651 -30.68019,9.04007 -38,13.22819 -1.375,0.78673 -4.3,2.41288 -6.5,3.61366 -7.69235,4.19858 -22.07112,15.75816 -30.56279,24.57048 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 L 91.933066,454 97.216533,453.9347 C 100.12244,453.89877 127.25,451.97548 157.5,449.6607 z M 96.666667,393.33333 c -1.378552,-1.37855 -0.593408,-7.15675 1.299439,-9.56311 2.758314,-3.50663 7.562854,-5.40604 9.534794,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 5.881393,-6.42626 c 0.87968,-1.70111 1.37441,-3.31793 1.09941,-3.59293 -0.46223,-0.46223 -3.64747,4.89634 -3.64747,6.1362 0,1.37147 1.08229,0.29121 2.54806,-2.54327 z m 30.97232,-143.1939 c -2.18879,-1.23967 -5.01907,-4.04476 -6.28951,-6.23355 -6.51986,-11.23279 3.39325,-35.23458 17.37838,-42.07687 9.5779,-4.68603 21.21383,-2.17357 27.83746,6.01072 2.71137,3.35022 3.04526,4.48085 2.98158,10.09631 -0.057,5.02442 -0.74155,7.68424 -3.33199,12.94618 -3.86127,7.84333 -12.2388,16.7997 -18.27721,19.54004 -6.12471,2.7795 -15.11287,2.65426 -20.29871,-0.28283 z m 15.61086,-2.73296 c 3.25439,-0.90396 4.08462,-1.9028 8,-9.62472 3.98066,-7.85068 4.36876,-9.26908 4.36876,-15.96656 0,-6.97001 -0.16934,-7.51968 -3.2717,-10.6197 -3.02079,-3.0185 -3.76387,-3.26783 -9.68888,-3.25096 -7.90091,0.0225 -10.08162,1.74755 -15.12072,11.96133 -6.49234,13.15937 -5.40342,22.80614 3.00544,26.62529 4.64963,2.11178 7.53909,2.31082 12.7071,0.87532 z m 21.39401,-27.67103 c 0.73803,-4.95106 -1.87293,-10.07548 -6.49363,-12.74476 l -3.46839,-2.00361 2.62621,3.4696 c 3.36524,4.44597 5.15989,11.22763 4.48795,16.95924 l -0.52876,4.51035 1.4044,-3.19082 c 0.77242,-1.75495 1.65992,-4.90495 1.97222,-7 z M 655,442.07143 c 0,-3.14719 -0.56798,-5.49655 -1.57143,-6.5 -2.49364,-2.49364 -3.61269,-1.82816 -2.03998,1.21313 0.79197,1.5315 1.75361,4.4565 2.13697,6.5 C 654.4798,448.3711 655,447.9431 655,442.07143 z m -90.96823,-97.53315 c -0.99401,-1.19771 -0.34746,-2.46442 3.57956,-7.01307 l 4.79269,-5.55136 2.04799,2.48146 c 2.14046,2.59351 6.28606,4.54469 9.65593,4.54469 2.69881,0 11.11858,-8.06587 13.9074,-13.32285 2.96353,-5.58629 2.15737,-10.70444 -2.40461,-15.26642 C 590.95652,305.75652 580,303.40997 580,307.06739 580,307.58032 579.16826,308 578.15169,308 c -1.22071,0 -2.3698,-1.32757 -3.38412,-3.90978 C 571.60992,296.05162 560.64462,291 546.3533,291 c -7.81571,0 -8.48076,0.17302 -11.77167,3.06247 C 530.98505,297.22031 525,307.90213 525,311.16329 c 0,1.12796 3.93432,5.04561 10.13322,10.09028 5.57328,4.53554 14.46078,11.92625 19.75,16.4238 9.78582,8.32112 11.30751,9.4623 9.14855,6.86091 z M 213,315 l 0,-28 -5.9652,0 c -5.17091,0 -6.40973,0.3903 -9.3036,2.93115 -8.80749,7.73308 -14.03673,27.22401 -10.61282,39.55716 2.11617,7.6226 11.20616,13.27118 21.63162,13.44204 L 213,343 l 0,-28 z m 395.61997,8.32504 c 3.45592,-9.0492 -0.75167,-16.49485 -10.9789,-19.42798 l -3.08016,-0.88338 3.58915,2.95848 c 7.31944,6.03331 9.20225,17.0202 4.20635,24.54571 l -2.64359,3.98213 3.63122,-3.43418 c 1.99717,-1.8888 4.37134,-5.37215 5.27593,-7.74078 z"
+       id="path3628"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#f3ab34"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 46.38224,-23.60472 81.5436,-52.51757 103.081,-84.76252 24.02434,-35.96831 32.2449,-80.48939 22.67887,-122.82474 -9.87022,-43.68163 -40.25342,-87.47001 -88.67734,-127.80214 -6.37781,-5.31205 -16.08003,-13.3579 -21.5605,-17.87967 -28.79423,-23.75721 -38.68129,-43.83806 -30.00976,-60.9505 8.69212,-17.15307 36.45836,-40.33994 73.40842,-61.30148 5.08318,-2.88366 9.08024,-5.53183 8.88235,-5.88482 C 565.12465,218.25018 547.64621,189.41215 529.17316,159 520.65405,144.975 510.4094,128.1 506.40727,121.5 495.59038,103.66161 497.60209,104.9819 488.91199,110.01782 460.49023,126.48825 426.34144,155.29939 404.77942,181 c -47.12239,56.16701 -60.61751,119.96592 -37.30801,176.37566 13.82818,33.46462 35.80977,60.53483 74.04315,91.18373 36.34851,29.13793 53.29166,48.05465 59.47128,66.39859 8.4952,25.21762 -9.75314,48.93008 -56.21626,73.04915 l -13.73042,7.12748 2.96325,5.87017 c 1.62979,3.22859 4.27087,8.7108 5.86907,12.18269 2.77657,6.03173 29.07611,62.02495 39.24862,83.56253 2.66267,5.6375 5.10708,10.25 5.43202,10.25 0.32494,0 6.29615,-2.90355 13.26934,-6.45232 z M 234.78566,691.459 c 9.97828,-0.72578 25.34092,-4.32433 35.94354,-8.41942 36.06207,-13.9284 67.24975,-48.17138 81.5505,-89.53958 1.90131,-5.5 4.44988,-14.24918 5.66347,-19.44263 4.87726,-20.87166 5.25404,-26.926 5.77457,-92.78786 l 0.49183,-62.23048 -7.19603,-10.76952 c -36.21102,-54.19307 -43.45228,-119.40888 -19.84251,-178.70457 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26943,192.70083 -0.26943,192.70083 -2.29205,7.86595 c -3.07215,10.54311 -7.41175,18.87298 -12.87505,24.71369 -5.45277,5.82946 -9.34265,7.25828 -18.37134,6.74811 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42845 c -2.0625,0.23565 -22.425,1.7853 -45.25,3.44367 -52.530511,3.81665 -60.917141,4.52138 -61.569402,5.17364 -0.894834,0.89483 1.466698,43.87321 3.10008,56.41947 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 22.04124,23.07219 48.69526,35.53734 81.59416,38.15876 9.30882,0.74173 13.04666,0.67345 29.78566,-0.54408 z m 131.87937,-7.07065 C 385.91244,667.60209 404,667.96374 404,685.13486 l 0,5.86514 17,0 c 9.35,0 17.0037,-0.3375 17.00822,-0.75 0.005,-0.4125 -10.89069,-23.9722 -24.21157,-52.35489 l -24.21979,-51.60489 -3.3169,11.53916 c -6.1513,21.39976 -15.94687,41.62659 -28.75145,59.36875 -3.29532,4.56603 -11.73762,14.03937 -18.76067,21.05187 l -12.76919,12.75 16.55268,0 16.55267,0 7.58103,-6.61165 z m 25.87228,2.86165 c -0.98856,-5.40976 -3.11913,-8.25 -6.18864,-8.25 -3.27441,0 -11.91611,4.88964 -15.78576,8.9319 l -2.93709,3.0681 12.79838,0 12.79838,0 -0.68527,-3.75 z m 6.20314,-5.22965 c -0.83777,-2.40001 -2.41556,-3.97344 -4.01613,-4.00504 -0.42662,-0.008 -0.14927,1.22219 0.61635,2.73469 0.76562,1.5125 1.75802,4.55 2.20534,6.75 l 0.8133,4 0.62336,-3.5 c 0.34284,-1.925 0.23384,-4.61584 -0.24222,-5.97965 z M 602.51957,670.5591 c 8.60507,-4.40812 16.42079,-10.48569 27.07531,-21.054 11.56812,-11.47451 15.29866,-16.18383 20.3445,-25.68225 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -5.07271,-32.24695 -12.18859,-50.34731 -28.50229,-72.5 -8.79439,-11.94208 -27.36329,-28.37497 -38.36006,-33.94746 -2.72919,-1.38298 -5.24953,-2.9795 -5.60077,-3.54781 -1.08402,-1.75398 -7.48973,-4.5842 -20.00292,-8.83784 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.823,-0.27252 -2.0448,-0.0277 -1.27607,1.40871 0.51175,0.95621 16.73389,27.75311 36.0492,59.54866 32.76886,53.94188 34.99545,57.9005 33.27607,59.161 -1.01347,0.74299 -8.14268,4.78748 -15.84268,8.98774 -38.42046,20.95796 -68.64452,41.88762 -77.07639,53.37413 l -3.64624,4.96718 2.77766,4.00817 c 2.98925,4.31348 4.77758,5.95094 3.84496,3.52056 -0.84323,-2.19741 4.43343,-11.41235 9.40351,-16.42192 6.34287,-6.39325 14.02642,-9.65573 22.6965,-9.63705 3.85,0.008 8.76214,0.6245 10.91586,1.36933 5.21062,1.80203 11.82264,8.03894 14.11903,13.31805 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.71488,-0.46153 3.55349,-1.4213 5.04917,-2.63569 14.67704,-2.27259 20.60298,0.777 5.64981,2.90749 10.17695,8.93195 10.92978,14.54472 1.23369,9.19789 -6.09036,20.85848 -16.84148,26.81323 -4.60604,2.55116 -6.38929,2.96008 -12.84835,2.94629 -5.02653,-0.0107 -8.48259,-0.55422 -10.47938,-1.64797 -2.88392,-1.57968 -3.07907,-1.54712 -6.09082,1.01616 L 566.31836,346.5 580.94032,361 c 15.19705,15.07029 27.72677,29.42421 37.29863,42.72892 5.56699,7.73802 16.32226,24.4547 16.95491,26.35265 0.20436,0.61309 2.01191,0.40429 4.69494,-0.54234 7.93823,-2.80077 14.99242,-1.4023 18.5505,3.67756 3.37348,4.81633 1.0759,17.7243 -5.03832,28.30562 l -2.32427,4.02241 2.46775,7.97759 c 4.77335,15.431 6.64724,27.84577 7.19712,47.68202 0.40605,14.64774 0.13964,21.37113 -1.22835,31 -6.05027,42.58589 -25.01104,79.48193 -58.961,114.73306 -8.10269,8.41324 -9.27647,9.97623 -6.05223,8.0591 2.2,-1.30811 5.80881,-3.30498 8.01957,-4.43749 z m 48.1471,-71.22577 c -1.37855,-1.37855 -0.59341,-7.15675 1.29944,-9.56311 2.75831,-3.50663 7.56285,-5.40604 9.53479,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 5.88139,-6.42626 c 0.87968,-1.70111 1.37441,-3.31793 1.09941,-3.59293 -0.46223,-0.46223 -3.64747,4.89634 -3.64747,6.1362 0,1.37147 1.08229,0.29121 2.54806,-2.54327 z M 421.11148,562.15688 c 22.88737,-11.15069 38.22658,-21.97408 44.91072,-31.68914 l 2.80577,-4.07805 -2.47118,-4.87493 C 460.61623,510.19027 447.87624,497.08706 423.70561,477.6476 415.89253,471.36385 406.575,463.61161 403,460.4204 l -6.5,-5.8022 -0.61022,49.4409 c -0.4719,38.23364 -0.97474,51.7077 -2.21829,59.4409 -0.88444,5.5 -1.62234,10.5369 -1.63978,11.19311 -0.0348,1.30939 6.00697,-1.2952 29.07977,-12.53623 z m -14.44481,-48.82355 c -1.37855,-1.37855 -0.59341,-7.15675 1.29944,-9.56311 2.75831,-3.50663 7.56285,-5.40604 9.53479,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 5.88139,-6.42626 c 0.87968,-1.70111 1.37441,-3.31793 1.09941,-3.59293 -0.46223,-0.46223 -3.64747,4.89634 -3.64747,6.1362 0,1.37147 1.08229,0.29121 2.54806,-2.54327 z M 648.56314,444.06496 C 647.72876,437.63609 645.68795,435 641.54521,435 l -3.40869,0 4.43174,9.48366 c 2.43746,5.21602 4.47694,10.05352 4.53219,10.75 0.0553,0.69649 0.53647,-0.53366 1.06937,-2.73366 0.53291,-2.2 0.7099,-5.99577 0.39332,-8.43504 z M 157.5,449.6607 l 55,-4.20868 0.25952,-48.08721 0.25952,-48.08721 -5.27672,-0.62017 C 194.72883,347.12795 184.4101,340.05614 181.97772,331 c -1.50522,-5.60417 -0.74112,-19.56307 1.46107,-26.69124 3.64441,-11.79642 13.93178,-22.60685 24.42437,-25.66621 l 4.63684,-1.35198 0.25609,-78.14528 C 212.97247,133.12079 213.22836,121 214.4059,121 c 0.76654,0 41.7409,4.488 91.05415,9.97333 l 89.66044,9.97333 6.68976,-6.80017 C 405.48961,130.40639 412.325,123.89017 417,119.66601 l 8.5,-7.68031 -104.5,0.29373 -104.5,0.29372 -11.5,2.67059 c -14.15221,3.28651 -30.68019,9.04007 -38,13.22819 -1.375,0.78673 -4.3,2.41288 -6.5,3.61366 -7.69235,4.19858 -22.07112,15.75816 -30.56279,24.57048 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 L 91.933066,454 97.216533,453.9347 C 100.12244,453.89877 127.25,451.97548 157.5,449.6607 z M 96.666667,393.33333 c -1.378552,-1.37855 -0.593408,-7.15675 1.299439,-9.56311 2.758314,-3.50663 7.562854,-5.40604 9.534794,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 5.881393,-6.42626 c 0.87968,-1.70111 1.37441,-3.31793 1.09941,-3.59293 -0.46223,-0.46223 -3.64747,4.89634 -3.64747,6.1362 0,1.37147 1.08229,0.29121 2.54806,-2.54327 z m 30.97232,-143.1939 c -2.18879,-1.23967 -5.01907,-4.04476 -6.28951,-6.23355 -6.51986,-11.23279 3.39325,-35.23458 17.37838,-42.07687 9.5779,-4.68603 21.21383,-2.17357 27.83746,6.01072 2.71137,3.35022 3.04526,4.48085 2.98158,10.09631 -0.057,5.02442 -0.74155,7.68424 -3.33199,12.94618 -3.86127,7.84333 -12.2388,16.7997 -18.27721,19.54004 -6.12471,2.7795 -15.11287,2.65426 -20.29871,-0.28283 z m 15.61086,-2.73296 c 3.25439,-0.90396 4.08462,-1.9028 8,-9.62472 3.98066,-7.85068 4.36876,-9.26908 4.36876,-15.96656 0,-6.97001 -0.16934,-7.51968 -3.2717,-10.6197 -3.02079,-3.0185 -3.76387,-3.26783 -9.68888,-3.25096 -7.90091,0.0225 -10.08162,1.74755 -15.12072,11.96133 -6.49234,13.15937 -5.40342,22.80614 3.00544,26.62529 4.64963,2.11178 7.53909,2.31082 12.7071,0.87532 z m 19.28833,-19.44196 c 2.52411,-6.04105 2.95231,-11.91843 1.12567,-15.45076 -1.5448,-2.98732 -6.8347,-7.1123 -9.04524,-7.05334 -0.55,0.0147 -0.20933,0.48712 0.75703,1.04989 4.4851,2.61191 7.79513,14.44583 5.93,21.20075 -1.28893,4.66814 -0.66559,4.79632 1.23254,0.25346 z m 486.32088,216.4821 c -0.83777,-2.40001 -2.41556,-3.97344 -4.01613,-4.00504 -0.42662,-0.008 -0.14927,1.22219 0.61635,2.73469 0.76562,1.5125 1.75802,4.55 2.20534,6.75 l 0.8133,4 0.62336,-3.5 c 0.34284,-1.925 0.23384,-4.61584 -0.24222,-5.97965 z m -90.70868,-93.48207 c -0.99401,-1.19771 -0.34746,-2.46442 3.57956,-7.01307 l 4.79269,-5.55136 2.04799,2.48146 c 2.14046,2.59351 6.28606,4.54469 9.65593,4.54469 2.69881,0 11.11858,-8.06587 13.9074,-13.32285 2.96353,-5.58629 2.15737,-10.70444 -2.40461,-15.26642 C 590.95652,305.75652 580,303.40997 580,307.06739 580,307.58032 579.16826,308 578.15169,308 c -1.22071,0 -2.3698,-1.32757 -3.38412,-3.90978 C 571.60992,296.05162 560.64462,291 546.3533,291 c -7.81571,0 -8.48076,0.17302 -11.77167,3.06247 C 530.98505,297.22031 525,307.90213 525,311.16329 c 0,1.12796 3.93432,5.04561 10.13322,10.09028 5.57328,4.53554 14.46078,11.92625 19.75,16.4238 9.78582,8.32112 11.30751,9.4623 9.14855,6.86091 z M 213,315 l 0,-28 -5.9652,0 c -5.17091,0 -6.40973,0.3903 -9.3036,2.93115 -8.80749,7.73308 -14.03673,27.22401 -10.61282,39.55716 2.11617,7.6226 11.20616,13.27118 21.63162,13.44204 L 213,343 l 0,-28 z m 392.18362,14.5 c 0.96756,-1.1 2.50662,-3.90835 3.42013,-6.24078 3.61045,-9.21842 -1.23204,-17.0981 -12.10375,-19.6952 l -3,-0.71665 3.48477,2.35589 c 9.21387,6.22905 10.6434,19.09249 3.14464,28.29674 -1.62941,2 -1.62941,2 0.8328,0 1.35422,-1.1 3.25385,-2.9 4.22141,-4 z"
+       id="path3626"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#d4b149"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.20232 c 46.38224,-23.60472 81.5436,-52.51757 103.081,-84.76252 24.02434,-35.96831 32.2449,-80.48939 22.67887,-122.82474 -9.87022,-43.68163 -40.25342,-87.47001 -88.67734,-127.80214 -6.37781,-5.31205 -16.08003,-13.3579 -21.5605,-17.87967 -28.79423,-23.75721 -38.68129,-43.83806 -30.00976,-60.9505 8.69212,-17.15307 36.45836,-40.33994 73.40842,-61.30148 5.08318,-2.88366 9.08024,-5.53183 8.88235,-5.88482 C 565.12465,218.25018 547.64621,189.41215 529.17316,159 520.65405,144.975 510.4094,128.1 506.40727,121.5 495.59038,103.66161 497.60209,104.9819 488.91199,110.01782 460.49023,126.48825 426.34144,155.29939 404.77942,181 c -47.12239,56.16701 -60.61751,119.96592 -37.30801,176.37566 13.82818,33.46462 35.80977,60.53483 74.04315,91.18373 36.34851,29.13793 53.29166,48.05465 59.47128,66.39859 8.4952,25.21762 -9.75314,48.93008 -56.21626,73.04915 l -13.73042,7.12748 2.96325,5.87017 c 1.62979,3.22859 4.27087,8.7108 5.86907,12.18269 2.77657,6.03173 29.07611,62.02495 39.24862,83.56253 2.66267,5.6375 5.10708,10.25 5.43202,10.25 0.32494,0 6.29615,-2.90355 13.26934,-6.45232 z M 234.78566,691.459 c 9.97828,-0.72578 25.34092,-4.32433 35.94354,-8.41942 36.06207,-13.9284 67.24975,-48.17138 81.5505,-89.53958 1.90131,-5.5 4.44988,-14.24918 5.66347,-19.44263 4.87726,-20.87166 5.25404,-26.926 5.77457,-92.78786 l 0.49183,-62.23048 -7.19603,-10.76952 c -36.21102,-54.19307 -43.45228,-119.40888 -19.84251,-178.70457 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.2925,-8.16709 6.04301,-9.917 5.7812,-13.47955 L 363.5,171.54091 310,165.37716 c -29.425,-3.39006 -55.62969,-6.41464 -58.23265,-6.72128 l -4.73266,-0.55754 -0.26943,192.70083 -0.26943,192.70083 -2.29205,7.86595 c -3.07215,10.54311 -7.41175,18.87298 -12.87505,24.71369 -5.45277,5.82946 -9.34265,7.25828 -18.37134,6.74811 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42845 c -2.0625,0.23565 -22.425,1.7853 -45.25,3.44367 -52.530511,3.81665 -60.917141,4.52138 -61.569402,5.17364 -0.894834,0.89483 1.466698,43.87321 3.10008,56.41947 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 22.04124,23.07219 48.69526,35.53734 81.59416,38.15876 9.30882,0.74173 13.04666,0.67345 29.78566,-0.54408 z m 131.87937,-7.07065 C 385.91244,667.60209 404,667.96374 404,685.13486 l 0,5.86514 17,0 c 9.35,0 17.0037,-0.3375 17.00822,-0.75 0.005,-0.4125 -10.89069,-23.9722 -24.21157,-52.35489 l -24.21979,-51.60489 -3.3169,11.53916 c -6.1513,21.39976 -15.94687,41.62659 -28.75145,59.36875 -3.29532,4.56603 -11.73762,14.03937 -18.76067,21.05187 l -12.76919,12.75 16.55268,0 16.55267,0 7.58103,-6.61165 z m 25.91516,2.38777 c -0.82165,-5.1383 -3.02682,-7.77924 -6.48518,-7.76674 -3.27335,0.0118 -11.67957,4.82334 -15.5321,8.89016 L 367.62582,691 l 12.8149,0 12.8149,0 -0.67543,-4.22388 z m 6.16026,-4.75577 c -0.83777,-2.40001 -2.41556,-3.97344 -4.01613,-4.00504 -0.42662,-0.008 -0.14927,1.22219 0.61635,2.73469 0.76562,1.5125 1.75802,4.55 2.20534,6.75 l 0.8133,4 0.62336,-3.5 c 0.34284,-1.925 0.23384,-4.61584 -0.24222,-5.97965 z M 602.51957,670.5591 c 8.60507,-4.40812 16.42079,-10.48569 27.07531,-21.054 11.56812,-11.47451 15.29866,-16.18383 20.3445,-25.68225 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -5.07271,-32.24695 -12.18859,-50.34731 -28.50229,-72.5 -8.79439,-11.94208 -27.36329,-28.37497 -38.36006,-33.94746 -2.72919,-1.38298 -5.24953,-2.9795 -5.60077,-3.54781 -1.08402,-1.75398 -7.48973,-4.5842 -20.00292,-8.83784 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.823,-0.27252 -2.0448,-0.0277 -1.27607,1.40871 0.51175,0.95621 16.73389,27.75311 36.0492,59.54866 32.76886,53.94188 34.99545,57.9005 33.27607,59.161 -1.01347,0.74299 -8.14268,4.78748 -15.84268,8.98774 -38.42046,20.95796 -68.64452,41.88762 -77.07639,53.37413 l -3.64624,4.96718 2.77766,4.00817 c 2.98925,4.31348 4.77758,5.95094 3.84496,3.52056 -0.84323,-2.19741 4.43343,-11.41235 9.40351,-16.42192 6.34287,-6.39325 14.02642,-9.65573 22.6965,-9.63705 3.85,0.008 8.76214,0.6245 10.91586,1.36933 5.21062,1.80203 11.82264,8.03894 14.11903,13.31805 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.71488,-0.46153 3.55349,-1.4213 5.04917,-2.63569 14.67704,-2.27259 20.60298,0.777 5.64981,2.90749 10.17695,8.93195 10.92978,14.54472 1.23369,9.19789 -6.09036,20.85848 -16.84148,26.81323 -4.60604,2.55116 -6.38929,2.96008 -12.84835,2.94629 -5.02653,-0.0107 -8.48259,-0.55422 -10.47938,-1.64797 -2.88392,-1.57968 -3.07907,-1.54712 -6.09082,1.01616 L 566.31836,346.5 580.94032,361 c 15.19705,15.07029 27.72677,29.42421 37.29863,42.72892 5.56699,7.73802 16.32226,24.4547 16.95491,26.35265 0.20436,0.61309 2.01191,0.40429 4.69494,-0.54234 7.93823,-2.80077 14.99242,-1.4023 18.5505,3.67756 3.37348,4.81633 1.0759,17.7243 -5.03832,28.30562 l -2.32427,4.02241 2.46775,7.97759 c 4.77335,15.431 6.64724,27.84577 7.19712,47.68202 0.40605,14.64774 0.13964,21.37113 -1.22835,31 -6.05027,42.58589 -25.01104,79.48193 -58.961,114.73306 -8.10269,8.41324 -9.27647,9.97623 -6.05223,8.0591 2.2,-1.30811 5.80881,-3.30498 8.01957,-4.43749 z m 48.1471,-71.22577 c -1.37855,-1.37855 -0.59341,-7.15675 1.29944,-9.56311 2.75831,-3.50663 7.56285,-5.40604 9.53479,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z M 657.44553,591 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 421.11148,562.15688 c 22.88737,-11.15069 38.22658,-21.97408 44.91072,-31.68914 l 2.80577,-4.07805 -2.47118,-4.87493 C 460.61623,510.19027 447.87624,497.08706 423.70561,477.6476 415.89253,471.36385 406.575,463.61161 403,460.4204 l -6.5,-5.8022 -0.61022,49.4409 c -0.4719,38.23364 -0.97474,51.7077 -2.21829,59.4409 -0.88444,5.5 -1.62234,10.5369 -1.63978,11.19311 -0.0348,1.30939 6.00697,-1.2952 29.07977,-12.53623 z m -14.44481,-48.82355 c -1.37855,-1.37855 -0.59341,-7.15675 1.29944,-9.56311 2.75831,-3.50663 7.56285,-5.40604 9.53479,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z M 413.44553,505 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 648.60439,443.61285 C 647.93677,437.60017 645.76581,435 641.41327,435 l -3.27675,0 4.43174,9.48366 c 2.43746,5.21602 4.47694,10.05352 4.53219,10.75 0.0553,0.69649 0.53833,-0.53366 1.07352,-2.73366 0.53519,-2.2 0.72888,-6.19922 0.43042,-8.88715 z M 157.5,449.6607 l 55,-4.20868 0.25952,-48.08721 0.25952,-48.08721 -5.27672,-0.62017 C 194.72883,347.12795 184.4101,340.05614 181.97772,331 c -1.50522,-5.60417 -0.74112,-19.56307 1.46107,-26.69124 3.64441,-11.79642 13.93178,-22.60685 24.42437,-25.66621 l 4.63684,-1.35198 0.25609,-78.14528 C 212.97247,133.12079 213.22836,121 214.4059,121 c 0.76654,0 41.7409,4.488 91.05415,9.97333 l 89.66044,9.97333 6.68976,-6.80017 C 405.48961,130.40639 412.325,123.89017 417,119.66601 l 8.5,-7.68031 -104.5,0.29373 -104.5,0.29372 -11.5,2.67059 c -14.15221,3.28651 -30.68019,9.04007 -38,13.22819 -1.375,0.78673 -4.3,2.41288 -6.5,3.61366 -7.69235,4.19858 -22.07112,15.75816 -30.56279,24.57048 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728628,8.65212 -3.699497,13.87712 -1.604224,8.63358 -1.795675,19.50949 -2.099186,119.25 L 91.933066,454 97.216533,453.9347 C 100.12244,453.89877 127.25,451.97548 157.5,449.6607 z M 96.666667,393.33333 c -1.378552,-1.37855 -0.593408,-7.15675 1.299439,-9.56311 2.758314,-3.50663 7.562854,-5.40604 9.534794,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z M 103.44553,385 l 0.66018,-2.5 -2.05285,2.36078 c -2.412793,2.77471 -3.026915,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z m 30.07485,-141.28683 c -2.18879,-1.23967 -5.01907,-4.04476 -6.28951,-6.23355 -6.51986,-11.23279 3.39325,-35.23458 17.37838,-42.07687 9.5779,-4.68603 21.21383,-2.17357 27.83746,6.01072 2.71137,3.35022 3.04526,4.48085 2.98158,10.09631 -0.057,5.02442 -0.74155,7.68424 -3.33199,12.94618 -3.86127,7.84333 -12.2388,16.7997 -18.27721,19.54004 -6.12471,2.7795 -15.11287,2.65426 -20.29871,-0.28283 z m 16.3765,-2.82707 c 2.61732,-0.9124 3.93496,-2.58495 7.28414,-9.24612 9.20217,-18.30222 4.87594,-31.63871 -9.86672,-30.41614 -6.64609,0.55115 -10.16869,3.59467 -14.38689,12.43025 -3.84559,8.0551 -4.74053,16.54961 -2.23998,21.2611 3.23423,6.09385 11.49291,8.66091 19.20945,5.97091 z m 18.52269,-19.34785 c 2.52411,-6.04105 2.95231,-11.91843 1.12567,-15.45076 -1.5448,-2.98732 -6.8347,-7.1123 -9.04524,-7.05334 -0.55,0.0147 -0.20933,0.48712 0.75703,1.04989 4.4851,2.61191 7.79513,14.44583 5.93,21.20075 -1.28893,4.66814 -0.66559,4.79632 1.23254,0.25346 z m 486.32088,216.4821 c -0.83777,-2.40001 -2.41556,-3.97344 -4.01613,-4.00504 -0.42662,-0.008 -0.14927,1.22219 0.61635,2.73469 0.76562,1.5125 1.75802,4.55 2.20534,6.75 l 0.8133,4 0.62336,-3.5 c 0.34284,-1.925 0.23384,-4.61584 -0.24222,-5.97965 z m -90.70759,-93.48076 c -0.99099,-1.19406 -0.4206,-2.37941 3.12755,-6.49951 C 571.22785,333.317 574,331.68547 574,334.0147 c 0,1.71166 6.317,4.97761 9.63534,4.98156 2.57003,0.003 4.22917,-1.16556 9.20191,-6.48143 6.69138,-7.15311 8.12653,-11.06451 6.20076,-16.89967 -2.54981,-7.726 -13.06117,-12.79568 -18.77197,-9.05382 -2.54396,1.66687 -2.717,1.66561 -3.71711,-0.0271 C 569.61628,294.8003 562.2292,291 546.3533,291 c -7.915,0 -8.448,0.14425 -11.9749,3.24091 -3.64126,3.19707 -9.37608,13.60105 -9.37761,17.01266 -4.6e-4,1.01406 4.27255,5.23122 10.13243,10 5.57328,4.53554 14.46078,11.92625 19.75,16.4238 9.78463,8.3201 11.30743,9.4622 9.14964,6.86222 z M 213,315 l 0,-28 -5.9652,0 c -5.26916,0 -6.38516,0.36872 -9.56423,3.15998 C 190.77976,296.03459 186,308.88481 186,320.99821 c 0,13.63108 8.30704,21.82906 22.25,21.9579 L 213,343 l 0,-28 z m 392.18362,14.5 c 0.96756,-1.1 2.50662,-3.90835 3.42013,-6.24078 3.61045,-9.21842 -1.23204,-17.0981 -12.10375,-19.6952 l -3,-0.71665 3.48477,2.35589 c 9.21387,6.22905 10.6434,19.09249 3.14464,28.29674 -1.62941,2 -1.62941,2 0.8328,0 1.35422,-1.1 3.25385,-2.9 4.22141,-4 z"
+       id="path3624"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ceb050"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.21427 C 544.49243,676.74008 579.27698,648.16494 600.79659,615.94274 628.10186,575.05745 634.86376,524.93371 619.40564,478 605.66547,436.28232 575.51631,397.7844 523.73296,355.8341 c -27.23071,-22.05992 -37.85635,-34.36092 -42.12384,-48.7656 -2.12544,-7.17432 -2.02977,-10.86919 0.45329,-17.50575 6.31941,-16.89013 29.06664,-37.02816 68.93759,-61.03016 7.975,-4.80089 14.36272,-9.20906 14.19493,-9.79594 -0.16779,-0.58689 -5.53385,-9.65522 -11.92457,-20.15186 C 546.87963,188.08816 534.82794,168.25 526.48883,154.5 503.94673,117.33132 497.95017,107.59111 497.02898,106.64841 495.3488,104.929 467.70464,122.71895 450.0217,136.89919 437.46673,146.96723 414.68591,169.16907 404.77083,181 c -22.79363,27.19794 -39.51425,59.88287 -45.27391,88.5 -9.90249,49.2009 3.06644,95.35251 38.83904,138.21373 8.11559,9.72376 25.83858,27.05436 35.57388,34.78627 39.76305,31.58037 56.33253,48.76563 65.09016,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.82437,7.83174 5.61545,11.68174 2.96223,6.36743 28.30315,60.22126 40.11439,85.25 2.66038,5.6375 5.10291,10.25 5.42785,10.25 0.32494,0 6.29615,-2.90892 13.26934,-6.46427 z m -258.16527,-9.61421 c 41.80362,-4.97694 78.65039,-31.30314 102.1347,-72.97297 5.0957,-9.04165 11.88501,-27.01148 15.17455,-40.16378 5.88159,-23.51582 6.2278,-28.46375 6.75373,-96.52234 l 0.48095,-62.23758 -7.1913,-10.76242 c -36.206,-54.18547 -43.44624,-119.4051 -19.83779,-178.69749 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.30211,-8.18191 6.04349,-9.91316 5.7812,-13.5 L 363.5,171.5 310,165.34318 c -29.425,-3.38626 -55.6286,-6.43807 -58.23023,-6.78182 l -4.73022,-0.625 -0.29963,192.78182 -0.29962,192.78182 -2.11377,7.2241 c -4.67144,15.96526 -13.26345,28.77986 -21.01086,31.33673 -1.92406,0.635 -6.58529,0.98011 -10.35828,0.76692 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42845 c -2.0625,0.23565 -22.425,1.7853 -45.25,3.44367 -52.530511,3.81665 -60.917141,4.52138 -61.569402,5.17364 -0.894834,0.89483 1.466698,43.87321 3.10008,56.41947 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.46568,30.84389 67.28661,42.90659 116.25035,37.0772 z m 127.00884,-6.53317 C 385.91244,667.60209 404,667.96374 404,685.13486 l 0,5.86514 17.38834,0 17.38834,0 -24.60072,-52.35206 -24.60072,-52.35207 -3.31609,11.53633 c -9.21294,32.0509 -24.57358,57.86466 -48.44817,81.4178 l -11.91036,11.75 16.59169,0 16.59169,0 7.58103,-6.61165 z m 25.91516,2.38777 c -0.82165,-5.1383 -3.02682,-7.77924 -6.48518,-7.76674 -3.27335,0.0118 -11.67957,4.82334 -15.5321,8.89016 L 367.62582,691 l 12.8149,0 12.8149,0 -0.67543,-4.22388 z m 6.16026,-4.75577 c -0.83777,-2.40001 -2.41556,-3.97344 -4.01613,-4.00504 -0.42662,-0.008 -0.14927,1.22219 0.61635,2.73469 0.76562,1.5125 1.75802,4.55 2.20534,6.75 l 0.8133,4 0.62336,-3.5 c 0.34284,-1.925 0.23384,-4.61584 -0.24222,-5.97965 z M 601.881,671.13268 c 8.00329,-4.17834 17.87524,-11.88515 27.71015,-21.63268 11.56958,-11.46679 15.29988,-16.174 20.34823,-25.67715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -2.66356,-16.93209 -4.28512,-23.74898 -8.44452,-35.5 -7.32429,-20.69238 -18.83702,-38.15216 -35.12459,-53.26863 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.08608,-1.75732 -7.48431,-4.58501 -20.005,-8.8412 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.91756,-0.28666 -2.06791,-0.0709 -1.14813,1.64778 0.58212,1.08769 16.79888,27.88853 36.03724,59.55741 32.54666,53.57612 34.85154,57.67311 33.14812,58.92193 -1.00689,0.73818 -8.13071,4.77873 -15.83071,8.97899 -39.02847,21.28963 -69.01853,42.10936 -77.3318,53.68538 l -3.31335,4.61376 2.08466,3.37305 c 2.45935,3.97932 5.48355,6.86393 4.49483,4.28736 -0.87299,-2.27496 4.31405,-11.41616 9.36916,-16.51143 6.34287,-6.39325 14.02642,-9.65573 22.6965,-9.63705 3.85,0.008 8.76214,0.6245 10.91586,1.36933 5.21062,1.80203 11.82264,8.03894 14.11903,13.31805 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.71488,-0.46153 3.55349,-1.4213 5.04917,-2.63569 14.67704,-2.27259 20.60298,0.777 5.64981,2.90749 10.17695,8.93195 10.92978,14.54472 1.23369,9.19789 -6.09036,20.85848 -16.84148,26.81323 -4.60886,2.55272 -6.38534,2.95958 -12.84835,2.9426 -5.10582,-0.0134 -8.49484,-0.55815 -10.61644,-1.70646 -3.04093,-1.64589 -3.17237,-1.62723 -5.42432,0.76985 -2.64318,2.81355 -4.20082,3.07538 -5.92638,0.99621 -0.99099,-1.19406 -0.4206,-2.37941 3.12755,-6.49951 C 571.22785,333.317 574,331.68547 574,334.0147 c 0,1.71166 6.317,4.97761 9.63534,4.98156 2.57003,0.003 4.22917,-1.16556 9.20191,-6.48143 6.69138,-7.15311 8.12653,-11.06451 6.20076,-16.89967 -2.54981,-7.726 -13.06117,-12.79568 -18.77197,-9.05382 -2.54396,1.66687 -2.717,1.66561 -3.71711,-0.0271 C 569.61628,294.8003 562.2292,291 546.3533,291 c -7.915,0 -8.448,0.14425 -11.9749,3.24091 -3.58995,3.15201 -9.37602,13.58574 -9.37761,16.91015 -8.3e-4,1.73819 5.18123,6.43116 21.23236,19.22844 35.61675,28.39658 63.32548,58.37246 83.11249,89.91284 3.03375,4.83578 5.66545,9.24094 5.84822,9.78923 0.20436,0.61309 2.01191,0.40429 4.69494,-0.54234 7.93823,-2.80077 14.99242,-1.4023 18.5505,3.67756 3.37418,4.81733 1.07584,17.72451 -5.04114,28.31044 l -2.3271,4.02724 2.01621,6.47276 c 6.17921,19.83749 8.37472,37.56849 7.59561,61.34233 -1.65301,50.44035 -20.75614,92.85541 -60.13065,133.50929 -9.15296,9.45036 -9.66031,10.16603 -5.67123,8 2.40955,-1.30837 5.55955,-2.99414 7,-3.74617 z m 48.78567,-71.79935 c -1.37855,-1.37855 -0.59341,-7.15675 1.29944,-9.56311 2.75831,-3.50663 7.56285,-5.40604 9.53479,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z M 657.44553,591 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 422.15915,561.6058 c 18.91504,-9.28129 29.36467,-16.04688 37.93065,-24.55812 9.07716,-9.01915 9.29539,-9.55875 6.27522,-15.51668 -5.92848,-11.69519 -17.86755,-23.83148 -45.52022,-46.27216 -9.53964,-7.7416 -18.66649,-15.46686 -20.28189,-17.16724 -1.6154,-1.70038 -3.26353,-3.0916 -3.66251,-3.0916 -0.39898,0 -0.94714,22.3875 -1.21814,49.75 -0.38077,38.44627 -0.84707,51.9085 -2.0523,59.25 -0.85776,5.225 -1.57541,10.0369 -1.59477,10.69311 -0.0393,1.33334 6.71741,-1.60211 30.12396,-13.08731 z m -15.49248,-48.27247 c -1.37855,-1.37855 -0.59341,-7.15675 1.29944,-9.56311 2.75831,-3.50663 7.56285,-5.40604 9.53479,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z M 413.44553,505 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 648.60439,443.61285 C 647.93677,437.60017 645.76581,435 641.41327,435 l -3.27675,0 4.43174,9.48366 c 2.43746,5.21602 4.47694,10.05352 4.53219,10.75 0.0553,0.69649 0.53833,-0.53366 1.07352,-2.73366 0.53519,-2.2 0.72888,-6.19922 0.43042,-8.88715 z m -435.84487,-46.23079 0.25952,-48.10446 -5.27672,-0.62017 C 194.72883,347.12795 184.4101,340.05614 181.97772,331 c -1.50522,-5.60417 -0.74112,-19.56307 1.46107,-26.69124 3.64441,-11.79642 13.93178,-22.60685 24.42437,-25.66621 l 4.63684,-1.35198 0.25609,-78.14528 C 212.95822,137.46952 213.2754,121 214.26108,121 c 0.68689,0 41.63777,4.48566 91.00196,9.96813 l 89.75308,9.96813 8.53422,-8.45771 c 4.69383,-4.65174 11.69505,-11.17814 15.55828,-14.50312 l 7.02405,-6.04541 -104.81634,0.3214 -104.81633,0.3214 -11.5,2.67076 c -6.325,1.46891 -13.975,3.54253 -17,4.60803 -9.99691,3.52123 -21.47646,8.326 -23,9.62665 -0.825,0.70431 -3.075,2.07206 -5,3.03945 -6.66455,3.3492 -21.53749,15.29115 -30.06279,24.13836 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604647,8.63513 -1.795723,19.51571 -2.098829,119.51523 l -0.333465,110.01523 60.283112,-4.52197 60.28311,-4.52197 0.25952,-48.10446 z M 96.666667,393.33333 c -1.378552,-1.37855 -0.593408,-7.15675 1.299439,-9.56311 2.758314,-3.50663 7.562854,-5.40604 9.534794,-3.76947 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z M 103.44553,385 l 0.66018,-2.5 -2.05285,2.36078 c -2.412793,2.77471 -3.026915,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z m 30.07485,-141.28683 c -2.18879,-1.23967 -5.01907,-4.04476 -6.28951,-6.23355 -6.51986,-11.23279 3.39325,-35.23458 17.37838,-42.07687 9.5779,-4.68603 21.21383,-2.17357 27.83746,6.01072 2.71137,3.35022 3.04526,4.48085 2.98158,10.09631 -0.057,5.02442 -0.74155,7.68424 -3.33199,12.94618 -3.86127,7.84333 -12.2388,16.7997 -18.27721,19.54004 -6.12471,2.7795 -15.11287,2.65426 -20.29871,-0.28283 z m 16.3765,-2.82707 c 2.61732,-0.9124 3.93496,-2.58495 7.28414,-9.24612 9.20217,-18.30222 4.87594,-31.63871 -9.86672,-30.41614 -6.64609,0.55115 -10.16869,3.59467 -14.38689,12.43025 -3.84559,8.0551 -4.74053,16.54961 -2.23998,21.2611 3.23423,6.09385 11.49291,8.66091 19.20945,5.97091 z m 18.52269,-19.34785 c 2.52411,-6.04105 2.95231,-11.91843 1.12567,-15.45076 -1.5448,-2.98732 -6.8347,-7.1123 -9.04524,-7.05334 -0.55,0.0147 -0.20933,0.48712 0.75703,1.04989 4.4851,2.61191 7.79513,14.44583 5.93,21.20075 -1.28893,4.66814 -0.66559,4.79632 1.23254,0.25346 z m 486.32088,216.4821 c -0.83777,-2.40001 -2.41556,-3.97344 -4.01613,-4.00504 -0.42662,-0.008 -0.14927,1.22219 0.61635,2.73469 0.76562,1.5125 1.75802,4.55 2.20534,6.75 l 0.8133,4 0.62336,-3.5 c 0.34284,-1.925 0.23384,-4.61584 -0.24222,-5.97965 z M 213,315 l 0,-28 -5.9652,0 c -5.26916,0 -6.38516,0.36872 -9.56423,3.15998 C 190.77976,296.03459 186,308.88481 186,320.99821 c 0,13.63108 8.30704,21.82906 22.25,21.9579 L 213,343 l 0,-28 z m 392.18362,14.5 c 0.96756,-1.1 2.50662,-3.90835 3.42013,-6.24078 3.61045,-9.21842 -1.23204,-17.0981 -12.10375,-19.6952 l -3,-0.71665 3.48477,2.35589 c 9.21387,6.22905 10.6434,19.09249 3.14464,28.29674 -1.62941,2 -1.62941,2 0.8328,0 1.35422,-1.1 3.25385,-2.9 4.22141,-4 z"
+       id="path3622"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ddb040"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.21427 C 544.49243,676.74008 579.27698,648.16494 600.79659,615.94274 628.10186,575.05745 634.86376,524.93371 619.40564,478 605.66547,436.28232 575.51631,397.7844 523.73296,355.8341 c -27.23071,-22.05992 -37.85635,-34.36092 -42.12384,-48.7656 -2.12544,-7.17432 -2.02977,-10.86919 0.45329,-17.50575 6.31941,-16.89013 29.06664,-37.02816 68.93759,-61.03016 7.975,-4.80089 14.36272,-9.20906 14.19493,-9.79594 -0.16779,-0.58689 -5.53385,-9.65522 -11.92457,-20.15186 C 546.87963,188.08816 534.82794,168.25 526.48883,154.5 503.94673,117.33132 497.95017,107.59111 497.02898,106.64841 495.3488,104.929 467.70464,122.71895 450.0217,136.89919 437.46673,146.96723 414.68591,169.16907 404.77083,181 c -22.79363,27.19794 -39.51425,59.88287 -45.27391,88.5 -9.90249,49.2009 3.06644,95.35251 38.83904,138.21373 8.11559,9.72376 25.83858,27.05436 35.57388,34.78627 39.76305,31.58037 56.33253,48.76563 65.09016,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.82437,7.83174 5.61545,11.68174 2.96223,6.36743 28.30315,60.22126 40.11439,85.25 2.66038,5.6375 5.10291,10.25 5.42785,10.25 0.32494,0 6.29615,-2.90892 13.26934,-6.46427 z m -258.16527,-9.61421 c 41.80362,-4.97694 78.65039,-31.30314 102.1347,-72.97297 5.0957,-9.04165 11.88501,-27.01148 15.17455,-40.16378 5.88159,-23.51582 6.2278,-28.46375 6.75373,-96.52234 l 0.48095,-62.23758 -7.1913,-10.76242 c -36.206,-54.18547 -43.44624,-119.4051 -19.83779,-178.69749 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.30211,-8.18191 6.04349,-9.91316 5.7812,-13.5 L 363.5,171.5 310,165.34318 c -29.425,-3.38626 -55.6286,-6.43807 -58.23023,-6.78182 l -4.73022,-0.625 -0.29963,192.78182 -0.29962,192.78182 -2.11377,7.2241 c -4.67144,15.96526 -13.26345,28.77986 -21.01086,31.33673 -1.92406,0.635 -6.58529,0.98011 -10.35828,0.76692 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42845 c -2.0625,0.23565 -22.425,1.7853 -45.25,3.44367 -52.530511,3.81665 -60.917141,4.52138 -61.569402,5.17364 -0.894834,0.89483 1.466698,43.87321 3.10008,56.41947 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.46568,30.84389 67.28661,42.90659 116.25035,37.0772 z m 126.4451,-5.93364 c 10.59745,-9.95719 22.37081,-14.63733 30.26648,-12.03152 5.4987,1.81474 7.63223,5.21914 7.63223,12.1785 l 0,5.86514 17.38834,0 17.38834,0 -24.60072,-52.35206 -24.60072,-52.35207 -3.31609,11.53633 c -9.21294,32.0509 -24.57358,57.86466 -48.44817,81.4178 l -11.91036,11.75 16.90098,0 16.90097,0 6.39872,-6.01212 z m 26.4789,1.78824 c -0.82165,-5.1383 -3.02682,-7.77924 -6.48518,-7.76674 -3.27335,0.0118 -11.67957,4.82334 -15.5321,8.89016 L 367.62582,691 l 12.8149,0 12.8149,0 -0.67543,-4.22388 z m 6.16026,-4.75577 c -0.83777,-2.40001 -2.41556,-3.97344 -4.01613,-4.00504 -0.42662,-0.008 -0.14927,1.22219 0.61635,2.73469 0.76562,1.5125 1.75802,4.55 2.20534,6.75 l 0.8133,4 0.62336,-3.5 c 0.34284,-1.925 0.23384,-4.61584 -0.24222,-5.97965 z M 601.881,671.13268 c 8.00329,-4.17834 17.87524,-11.88515 27.71015,-21.63268 11.56958,-11.46679 15.29988,-16.174 20.34823,-25.67715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -2.66356,-16.93209 -4.28512,-23.74898 -8.44452,-35.5 -7.32429,-20.69238 -18.83702,-38.15216 -35.12459,-53.26863 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.08608,-1.75732 -7.48431,-4.58501 -20.005,-8.8412 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.91756,-0.28666 -2.06791,-0.0709 -1.14813,1.64778 0.58212,1.08769 16.79888,27.88853 36.03724,59.55741 32.54666,53.57612 34.85154,57.67311 33.14812,58.92193 -1.00689,0.73818 -8.13071,4.77873 -15.83071,8.97899 -39.02847,21.28963 -69.01853,42.10936 -77.3318,53.68538 l -3.31335,4.61376 2.08466,3.37305 c 2.45935,3.97932 5.48355,6.86393 4.49483,4.28736 -0.87299,-2.27496 4.31405,-11.41616 9.36916,-16.51143 8.43954,-8.50657 21.45867,-11.79532 33.03714,-8.34546 5.46979,1.62975 12.27455,7.8332 14.69425,13.39579 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.68881,-0.4407 3.49555,-1.375 2.05334,-1.06182 5.60695,-1.69874 9.47794,-1.69874 10.887,0 20.57174,7.22991 22.07244,16.47763 1.53795,9.47727 -6.46536,22.07933 -17.4469,27.47201 -7.14195,3.50717 -18.00691,3.96906 -22.59827,0.96068 -2.78647,-1.82576 -2.82814,-1.82009 -5.51074,0.75 -3.08948,2.95991 -4.34699,3.19422 -6.06074,1.12927 -0.99099,-1.19406 -0.4206,-2.37941 3.12755,-6.49951 C 571.22785,333.317 574,331.68547 574,334.0147 c 0,1.71166 6.317,4.97761 9.63534,4.98156 2.57003,0.003 4.22917,-1.16556 9.20191,-6.48143 6.69138,-7.15311 8.12653,-11.06451 6.20076,-16.89967 -2.54981,-7.726 -13.06117,-12.79568 -18.77197,-9.05382 -2.54396,1.66687 -2.717,1.66561 -3.71711,-0.0271 C 569.61628,294.8003 562.2292,291 546.3533,291 c -7.915,0 -8.448,0.14425 -11.9749,3.24091 -3.62841,3.18578 -9.37606,13.5972 -9.37761,16.98679 -7.4e-4,1.6078 3.87328,5.03962 26.09048,23.11248 21.50941,17.49709 43.50603,39.39157 59.43581,59.15982 6.52839,8.10148 23.0602,32.62428 24.00933,35.61473 0.43946,1.3846 1.17188,1.82644 2.30393,1.38986 8.98494,-3.46507 15.85793,-2.96017 20.31012,1.49203 2.44684,2.44683 2.84954,3.63238 2.84954,8.38894 0,5.84738 -2.62892,14.26622 -6.60184,21.14167 l -2.3271,4.02724 2.01621,6.47276 c 6.17921,19.83749 8.37472,37.56849 7.59561,61.34233 -1.65301,50.44035 -20.75614,92.85541 -60.13065,133.50929 -9.15296,9.45036 -9.66031,10.16603 -5.67123,8 2.40955,-1.30837 5.55955,-2.99414 7,-3.74617 z m 48.78567,-71.79935 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 1.08573,-1.52477 3.36531,-3.34858 5.06574,-4.05292 2.62433,-1.08704 3.32417,-1.04813 4.62968,0.25738 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z M 657.44553,591 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 422.15915,561.6058 c 18.91504,-9.28129 29.36467,-16.04688 37.93065,-24.55812 9.07716,-9.01915 9.29539,-9.55875 6.27522,-15.51668 -5.92848,-11.69519 -17.86755,-23.83148 -45.52022,-46.27216 -9.53964,-7.7416 -18.66649,-15.46686 -20.28189,-17.16724 -1.6154,-1.70038 -3.26353,-3.0916 -3.66251,-3.0916 -0.39898,0 -0.94714,22.3875 -1.21814,49.75 -0.38077,38.44627 -0.84707,51.9085 -2.0523,59.25 -0.85776,5.225 -1.57541,10.0369 -1.59477,10.69311 -0.0393,1.33334 6.71741,-1.60211 30.12396,-13.08731 z m -15.49248,-48.27247 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 2.63084,-3.69467 7.46851,-5.74397 9.52685,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z M 413.44553,505 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 648.60439,443.61285 C 647.93677,437.60017 645.76581,435 641.41327,435 l -3.27675,0 4.43174,9.48366 c 2.43746,5.21602 4.47694,10.05352 4.53219,10.75 0.0553,0.69649 0.53833,-0.53366 1.07352,-2.73366 0.53519,-2.2 0.72888,-6.19922 0.43042,-8.88715 z m -435.84487,-46.2395 0.25953,-48.11316 -5.25953,-0.66665 c -9.15865,-1.16086 -14.7073,-3.53481 -19.79195,-8.46784 -5.55275,-5.38719 -6.98008,-9.44438 -6.90435,-19.6257 0.10295,-13.83991 5.97355,-28.04742 14.49424,-35.07765 4.65123,-3.83764 11.89935,-7.36824 15.19254,-7.40039 L 213,278 l 0,-78.5 c 0,-62.29958 0.259,-78.5 1.25498,-78.5 0.69024,0 41.64387,4.48566 91.00806,9.96813 l 89.75308,9.96813 8.53422,-8.45771 c 4.69383,-4.65174 11.69505,-11.17814 15.55828,-14.50312 l 7.02405,-6.04541 -104.81634,0.3214 -104.81633,0.3214 -11.5,2.67076 c -6.325,1.46891 -13.975,3.54253 -17,4.60803 -9.99691,3.52123 -21.47646,8.326 -23,9.62665 -0.825,0.70431 -3.075,2.07206 -5,3.03945 -6.66455,3.3492 -21.53749,15.29115 -30.06279,24.13836 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604647,8.63513 -1.795723,19.51571 -2.098829,119.51523 l -0.333465,110.01523 60.283112,-4.52197 60.28311,-4.52197 0.25952,-48.11317 z M 96.666667,393.33333 c -1.34912,-1.34912 -0.610152,-6.60396 1.307387,-9.29689 2.630836,-3.69467 7.468506,-5.74397 9.526846,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z M 103.44553,385 l 0.66018,-2.5 -2.05285,2.36078 c -2.412793,2.77471 -3.026915,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z m 30.07485,-141.28683 c -2.18879,-1.23967 -5.02357,-4.04476 -6.29951,-6.23355 -4.65931,-7.99272 -1.55939,-21.49462 7.77283,-33.85505 7.68616,-10.18025 18.79592,-13.26393 29.62333,-8.22241 9.97255,4.64348 12.96474,12.03155 9.49684,23.44885 -3.3843,11.14207 -12.38138,21.85585 -21.58214,25.70018 -5.35193,2.23618 -14.27816,1.84271 -19.01135,-0.83802 z m 16.3765,-2.82707 c 2.61732,-0.9124 3.93496,-2.58495 7.28414,-9.24612 9.20217,-18.30222 4.87594,-31.63871 -9.86672,-30.41614 -6.64609,0.55115 -10.16869,3.59467 -14.38689,12.43025 -3.84559,8.0551 -4.74053,16.54961 -2.23998,21.2611 3.23423,6.09385 11.49291,8.66091 19.20945,5.97091 z m 18.52269,-19.34785 c 2.52411,-6.04105 2.95231,-11.91843 1.12567,-15.45076 -1.5448,-2.98732 -6.8347,-7.1123 -9.04524,-7.05334 -0.55,0.0147 -0.20933,0.48712 0.75703,1.04989 4.4851,2.61191 7.79513,14.44583 5.93,21.20075 -1.28893,4.66814 -0.66559,4.79632 1.23254,0.25346 z m 486.32088,216.4821 c -0.83777,-2.40001 -2.41556,-3.97344 -4.01613,-4.00504 -0.42662,-0.008 -0.14927,1.22219 0.61635,2.73469 0.76562,1.5125 1.75802,4.55 2.20534,6.75 l 0.8133,4 0.62336,-3.5 c 0.34284,-1.925 0.23384,-4.61584 -0.24222,-5.97965 z M 213,315 l 0,-28 -5.9652,0 c -5.26916,0 -6.38516,0.36872 -9.56423,3.15998 C 190.77976,296.03459 186,308.88481 186,320.99821 c 0,13.63108 8.30704,21.82906 22.25,21.9579 L 213,343 l 0,-28 z m 392.18362,14.5 c 0.96756,-1.1 2.50662,-3.90835 3.42013,-6.24078 3.61045,-9.21842 -1.23204,-17.0981 -12.10375,-19.6952 l -3,-0.71665 3.48477,2.35589 c 9.21387,6.22905 10.6434,19.09249 3.14464,28.29674 -1.62941,2 -1.62941,2 0.8328,0 1.35422,-1.1 3.25385,-2.9 4.22141,-4 z"
+       id="path3620"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#999999"
+       d="m 463.70581,743.75 c -1.84512,-3.9875 -5.52664,-11.8625 -8.18116,-17.5 l -4.8264,-10.25 -84.67397,0 -84.67398,0 -7.21645,2.45448 c -33.64412,11.4431 -80.39862,11.21719 -113.74629,-0.54962 -22.974,-8.10642 -42.89883,-21.20116 -60.901844,-40.02512 C 75.835891,653.15147 61.093058,624.87972 52.094782,587 45.748439,560.28403 44,539.97496 44,492.97468 L 44,458.2398 55.5,457.52125 67,456.8027 67.032719,347.65135 C 67.050714,287.61811 67.466952,235.575 67.957693,232 c 2.545977,-18.54721 5.704312,-30.66536 11.868598,-45.53837 3.983238,-9.61064 6.729915,-14.84842 8.600621,-16.40097 C 89.29211,169.34261 90,168.36895 90,167.89697 c 0,-0.76763 2.172997,-4.2236 9.874248,-15.7042 3.482322,-5.19126 19.552522,-21.5676 27.625752,-28.15204 6.7156,-5.47717 12.19377,-9.3145 21.87052,-15.31977 12.90963,-8.01155 42.95726,-17.976812 62.62948,-20.770992 3.025,-0.429661 60.27957,-0.819175 127.23239,-0.865585 L 460.96477,87 l 6.26762,-3.826639 c 5.24439,-3.20192 32.02429,-18.158525 39.442,-22.028399 2.0465,-1.067675 2.65613,-0.340705 10.36534,12.360322 L 525.23069,87 l 8.63465,0.05392 c 17.75025,0.11084 36.12012,3.24069 52.57645,8.957951 16.27362,5.653779 18.11832,6.627839 41.515,21.921259 6.65759,4.35178 31.74059,28.90394 35.68622,34.93098 C 674.44598,169.36587 683,184.65096 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29595,163.81077 -0.31346,165.07643 -2.42956,175.6037 -2.87448,14.30012 -9.5703,33.79587 -14.65643,42.67411 -2.2931,4.0028 -5.06928,8.98402 -6.16928,11.06939 -6.66059,12.62709 -27.64403,35.43082 -43.52736,47.30332 -11.80223,8.82195 -34.1338,19.9759 -48.47264,24.21065 -9.74564,2.87822 -27.10188,6.47128 -34.44034,7.12979 -6.56218,0.58885 -8.50962,1.28924 -16.5,5.93412 -16.29884,9.47468 -25.80028,14.29273 -43.36664,21.99066 C 476.67418,747.58708 468.47531,751 467.9733,751 c -0.502,0 -2.42238,-3.2625 -4.26749,-7.25 z m 34.11565,-43.21427 C 544.49243,676.74008 579.27698,648.16494 600.79659,615.94274 628.10186,575.05745 634.86376,524.93371 619.40564,478 605.66547,436.28232 575.51631,397.7844 523.73296,355.8341 c -27.23071,-22.05992 -37.85635,-34.36092 -42.12384,-48.7656 -2.12544,-7.17432 -2.02977,-10.86919 0.45329,-17.50575 6.31941,-16.89013 29.06664,-37.02816 68.93759,-61.03016 7.975,-4.80089 14.36272,-9.20906 14.19493,-9.79594 -0.16779,-0.58689 -5.53385,-9.65522 -11.92457,-20.15186 C 546.87963,188.08816 534.82794,168.25 526.48883,154.5 503.94673,117.33132 497.95017,107.59111 497.02898,106.64841 495.3488,104.929 467.70464,122.71895 450.0217,136.89919 437.46673,146.96723 414.68591,169.16907 404.77083,181 c -22.79363,27.19794 -39.51425,59.88287 -45.27391,88.5 -9.90249,49.2009 3.06644,95.35251 38.83904,138.21373 8.11559,9.72376 25.83858,27.05436 35.57388,34.78627 39.76305,31.58037 56.33253,48.76563 65.09016,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.82437,7.83174 5.61545,11.68174 2.96223,6.36743 28.30315,60.22126 40.11439,85.25 2.66038,5.6375 5.10291,10.25 5.42785,10.25 0.32494,0 6.29615,-2.90892 13.26934,-6.46427 z m -258.16527,-9.61421 c 41.80362,-4.97694 78.65039,-31.30314 102.1347,-72.97297 5.0957,-9.04165 11.88501,-27.01148 15.17455,-40.16378 5.88159,-23.51582 6.2278,-28.46375 6.75373,-96.52234 l 0.48095,-62.23758 -7.1913,-10.76242 c -36.206,-54.18547 -43.44624,-119.4051 -19.83779,-178.69749 5.25035,-13.18622 13.29419,-28.79283 20.84865,-40.45045 5.30211,-8.18191 6.04349,-9.91316 5.7812,-13.5 L 363.5,171.5 310,165.34318 c -29.425,-3.38626 -55.6286,-6.43807 -58.23023,-6.78182 l -4.73022,-0.625 -0.29963,192.78182 -0.29962,192.78182 -2.11377,7.2241 c -4.67144,15.96526 -13.26345,28.77986 -21.01086,31.33673 -1.92406,0.635 -6.58529,0.98011 -10.35828,0.76692 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42845 c -2.0625,0.23565 -22.425,1.7853 -45.25,3.44367 -52.530511,3.81665 -60.917141,4.52138 -61.569402,5.17364 -0.894834,0.89483 1.466698,43.87321 3.10008,56.41947 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.46568,30.84389 67.28661,42.90659 116.25035,37.0772 z m 126.4451,-5.93364 c 10.59745,-9.95719 22.37081,-14.63733 30.26648,-12.03152 5.4987,1.81474 7.63223,5.21914 7.63223,12.1785 l 0,5.86514 17.38834,0 17.38834,0 -24.60072,-52.35206 -24.60072,-52.35207 -3.31609,11.53633 c -9.21294,32.0509 -24.57358,57.86466 -48.44817,81.4178 l -11.91036,11.75 16.90098,0 16.90097,0 6.39872,-6.01212 z m 26.4789,1.78824 c -0.82165,-5.1383 -3.02682,-7.77924 -6.48518,-7.76674 -3.27335,0.0118 -11.67957,4.82334 -15.5321,8.89016 L 367.62582,691 l 12.8149,0 12.8149,0 -0.67543,-4.22388 z m 6.1678,-5.61606 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z M 601.881,671.13268 c 8.00329,-4.17834 17.87524,-11.88515 27.71015,-21.63268 11.56958,-11.46679 15.29988,-16.174 20.34823,-25.67715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -2.66356,-16.93209 -4.28512,-23.74898 -8.44452,-35.5 -7.32429,-20.69238 -18.83702,-38.15216 -35.12459,-53.26863 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.08608,-1.75732 -7.48431,-4.58501 -20.005,-8.8412 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.91756,-0.28666 -2.06791,-0.0709 -1.14813,1.64778 0.58212,1.08769 16.79888,27.88853 36.03724,59.55741 32.54666,53.57612 34.85154,57.67311 33.14812,58.92193 -1.00689,0.73818 -8.13071,4.77873 -15.83071,8.97899 -39.02847,21.28963 -69.01853,42.10936 -77.3318,53.68538 l -3.31335,4.61376 2.08466,3.37305 c 2.45935,3.97932 5.48355,6.86393 4.49483,4.28736 -0.87299,-2.27496 4.31405,-11.41616 9.36916,-16.51143 8.43954,-8.50657 21.45867,-11.79532 33.03714,-8.34546 5.46979,1.62975 12.27455,7.8332 14.69425,13.39579 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.68881,-0.4407 3.49555,-1.375 2.05334,-1.06182 5.60695,-1.69874 9.47794,-1.69874 10.887,0 20.57174,7.22991 22.07244,16.47763 1.53795,9.47727 -6.46536,22.07933 -17.4469,27.47201 -7.14195,3.50717 -18.00691,3.96906 -22.59827,0.96068 -2.78647,-1.82576 -2.82814,-1.82009 -5.51074,0.75 -3.08948,2.95991 -4.34699,3.19422 -6.06074,1.12927 -0.99099,-1.19406 -0.4206,-2.37941 3.12755,-6.49951 C 571.22785,333.317 574,331.68547 574,334.0147 c 0,1.71166 6.317,4.97761 9.63534,4.98156 2.57003,0.003 4.22917,-1.16556 9.20191,-6.48143 6.69138,-7.15311 8.12653,-11.06451 6.20076,-16.89967 -2.54981,-7.726 -13.06117,-12.79568 -18.77197,-9.05382 -2.54396,1.66687 -2.717,1.66561 -3.71711,-0.0271 C 569.61628,294.8003 562.2292,291 546.3533,291 c -7.915,0 -8.448,0.14425 -11.9749,3.24091 -3.62841,3.18578 -9.37606,13.5972 -9.37761,16.98679 -7.4e-4,1.6078 3.87328,5.03962 26.09048,23.11248 21.50941,17.49709 43.50603,39.39157 59.43581,59.15982 6.52839,8.10148 23.0602,32.62428 24.00933,35.61473 0.43946,1.3846 1.17188,1.82644 2.30393,1.38986 8.98494,-3.46507 15.85793,-2.96017 20.31012,1.49203 2.44684,2.44683 2.84954,3.63238 2.84954,8.38894 0,5.84738 -2.62892,14.26622 -6.60184,21.14167 l -2.3271,4.02724 2.01621,6.47276 c 6.17921,19.83749 8.37472,37.56849 7.59561,61.34233 -1.65301,50.44035 -20.75614,92.85541 -60.13065,133.50929 -9.15296,9.45036 -9.66031,10.16603 -5.67123,8 2.40955,-1.30837 5.55955,-2.99414 7,-3.74617 z m 48.78567,-71.79935 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 1.08573,-1.52477 3.36531,-3.34858 5.06574,-4.05292 2.62433,-1.08704 3.32417,-1.04813 4.62968,0.25738 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z M 657.44553,591 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 422.15915,561.6058 c 18.91504,-9.28129 29.36467,-16.04688 37.93065,-24.55812 9.07716,-9.01915 9.29539,-9.55875 6.27522,-15.51668 -5.92848,-11.69519 -17.86755,-23.83148 -45.52022,-46.27216 -9.53964,-7.7416 -18.66649,-15.46686 -20.28189,-17.16724 -1.6154,-1.70038 -3.26353,-3.0916 -3.66251,-3.0916 -0.39898,0 -0.94714,22.3875 -1.21814,49.75 -0.38077,38.44627 -0.84707,51.9085 -2.0523,59.25 -0.85776,5.225 -1.57541,10.0369 -1.59477,10.69311 -0.0393,1.33334 6.71741,-1.60211 30.12396,-13.08731 z m -15.49248,-48.27247 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 2.63084,-3.69467 7.46851,-5.74397 9.52685,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z M 413.44553,505 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 648.60439,443.61285 C 647.93677,437.60017 645.76581,435 641.41327,435 l -3.27675,0 4.43174,9.48366 c 2.43746,5.21602 4.47694,10.05352 4.53219,10.75 0.0553,0.69649 0.53833,-0.53366 1.07352,-2.73366 0.53519,-2.2 0.72888,-6.19922 0.43042,-8.88715 z m -435.84487,-46.2395 0.25953,-48.11316 -5.25953,-0.66665 c -9.15865,-1.16086 -14.7073,-3.53481 -19.79195,-8.46784 -5.55275,-5.38719 -6.98008,-9.44438 -6.90435,-19.6257 0.10295,-13.83991 5.97355,-28.04742 14.49424,-35.07765 4.65123,-3.83764 11.89935,-7.36824 15.19254,-7.40039 L 213,278 l 0,-78.5 c 0,-62.29958 0.259,-78.5 1.25498,-78.5 0.69024,0 41.64387,4.48566 91.00806,9.96813 l 89.75308,9.96813 8.53422,-8.45771 c 4.69383,-4.65174 11.69505,-11.17814 15.55828,-14.50312 l 7.02405,-6.04541 -104.81634,0.3214 -104.81633,0.3214 -11.5,2.67076 c -6.325,1.46891 -13.975,3.54253 -17,4.60803 -9.99691,3.52123 -21.47646,8.326 -23,9.62665 -0.825,0.70431 -3.075,2.07206 -5,3.03945 -6.66455,3.3492 -21.53749,15.29115 -30.06279,24.13836 -7.6287,7.91675 -12.15623,14.04959 -21.07798,28.55148 C 105.90549,190.00871 100,203.52056 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604647,8.63513 -1.795723,19.51571 -2.098829,119.51523 l -0.333465,110.01523 60.283112,-4.52197 60.28311,-4.52197 0.25952,-48.11317 z M 96.666667,393.33333 c -1.34912,-1.34912 -0.610152,-6.60396 1.307387,-9.29689 2.630836,-3.69467 7.468506,-5.74397 9.526846,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z M 103.44553,385 l 0.66018,-2.5 -2.05285,2.36078 c -2.412793,2.77471 -3.026915,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z m 30.07485,-141.28683 c -2.18879,-1.23967 -5.02357,-4.04476 -6.29951,-6.23355 -4.65931,-7.99272 -1.55939,-21.49462 7.77283,-33.85505 7.68616,-10.18025 18.79592,-13.26393 29.62333,-8.22241 9.97255,4.64348 12.96474,12.03155 9.49684,23.44885 -3.3843,11.14207 -12.38138,21.85585 -21.58214,25.70018 -5.35193,2.23618 -14.27816,1.84271 -19.01135,-0.83802 z m 16.3765,-2.82707 c 2.61732,-0.9124 3.93496,-2.58495 7.28414,-9.24612 9.20217,-18.30222 4.87594,-31.63871 -9.86672,-30.41614 -6.64609,0.55115 -10.16869,3.59467 -14.38689,12.43025 -3.84559,8.0551 -4.74053,16.54961 -2.23998,21.2611 3.23423,6.09385 11.49291,8.66091 19.20945,5.97091 z m 19.57423,-22.43355 c 1.99478,-6.34195 1.56995,-11.64471 -1.17601,-14.67896 -2.16635,-2.39379 -7.25939,-5.14263 -8.0547,-4.34733 -0.31555,0.31556 -0.0677,0.57374 0.55078,0.57374 1.69839,0 5.93039,7.96193 6.66512,12.5395 0.3566,2.22172 0.22344,5.93073 -0.29593,8.24224 -1.33113,5.92443 0.20015,4.38092 2.31074,-2.32919 z m 485.27688,218.70751 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z M 213,315 l 0,-28 -5.9652,0 c -5.26916,0 -6.38516,0.36872 -9.56423,3.15998 C 190.77976,296.03459 186,308.88481 186,320.99821 c 0,13.63108 8.30704,21.82906 22.25,21.9579 L 213,343 l 0,-28 z m 393.58458,12.70067 c 1.83053,-2.76096 2.92974,-5.93018 3.20717,-9.24687 0.3685,-4.40534 0.0645,-5.47114 -2.39345,-8.39229 -2.73935,-3.25553 -9.37192,-7.01238 -12.3983,-7.0227 -0.825,-0.003 -0.0265,0.93847 1.77448,2.09174 9.27746,5.94094 10.88321,19.4736 3.35493,28.27425 -1.58838,1.85684 -1.56269,1.8619 1.02035,0.20067 1.45736,-0.93727 3.90304,-3.59443 5.43482,-5.9048 z"
+       id="path3618"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#d1ae48"
+       d="m 464.24418,744.75 c -1.61938,-3.4375 -5.32776,-11.3125 -8.24084,-17.5 l -5.29652,-11.25 -84.36467,0 -84.36467,0 -11.23874,3.38694 c -19.28562,5.81197 -29.35869,7.1213 -54.23874,7.05012 -19.85965,-0.0568 -23.22599,-0.322 -34.60155,-2.72573 -30.53316,-6.45184 -53.94731,-18.7052 -76.52782,-40.04939 C 69.421049,649.68065 49.980714,603.39893 45.047413,540.05011 44.471336,532.65266 44,511.21912 44,492.42 L 44,458.2398 55.5,457.52125 67,456.8027 67.01777,349.15135 C 67.035144,243.85306 67.293758,233.64677 70.366309,217 c 1.524336,-8.2587 5.805294,-22.49738 8.095583,-26.92631 0.805792,-1.55823 2.089787,-4.64638 2.853322,-6.86256 1.372558,-3.98387 2.740384,-6.39656 10.968549,-19.34727 8.269777,-13.01621 10.101677,-15.36961 19.599927,-25.17962 C 128.3936,121.63242 145.70632,109.44042 165,101.27855 179.20986,95.267312 182.04094,94.355031 197.83956,90.696431 L 211.5,87.532985 l 124.80569,-0.289101 124.80568,-0.2891 3.84409,-2.426665 c 3.88418,-2.451977 34.83936,-19.833552 40.7358,-22.873467 l 3.19125,-1.645257 8.03323,13.35057 8.03322,13.350569 12.77552,0.559956 C 544.75102,87.578465 555,88.547988 560.5,89.424985 c 13.41479,2.139041 36.59945,9.743241 45.47655,14.915585 21.20265,12.35397 26.40356,16.21983 40.57489,30.15943 7.828,7.7 15.51879,15.96385 17.09064,18.36411 C 674.4297,169.33708 683,184.65051 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29739,164.60779 -0.30324,165.02565 -2.46297,175.79255 -2.82311,14.07408 -9.47082,33.33611 -14.66251,42.48526 -2.27138,4.0028 -5.02979,8.9876 -6.12979,11.07735 -7.53001,14.30526 -26.49531,34.27214 -48.21379,50.76003 -6.40758,4.8644 -28.63093,15.71305 -40.78621,19.91037 -6.15327,2.12478 -30.16779,7.14806 -38,7.94872 -5.33024,0.5449 -8.31196,1.5064 -12.5,4.03085 -11.78105,7.10131 -28.77024,15.76895 -45.98451,23.46065 C 477.12602,747.3846 468.61926,751 468.11157,751 c -0.50768,0 -2.24801,-2.8125 -3.86739,-6.25 z m 33.57728,-44.21427 C 544.49243,676.74008 579.27698,648.16494 600.79659,615.94274 628.10186,575.05745 634.86376,524.93371 619.40564,478 605.66547,436.28232 575.51631,397.7844 523.73296,355.8341 c -27.23071,-22.05992 -37.85635,-34.36092 -42.12384,-48.7656 -2.12544,-7.17432 -2.02977,-10.86919 0.45329,-17.50575 6.31941,-16.89013 29.06664,-37.02816 68.93759,-61.03016 7.975,-4.80089 14.36272,-9.20906 14.19493,-9.79594 -0.16779,-0.58689 -5.53385,-9.65522 -11.92457,-20.15186 C 546.87963,188.08816 534.82794,168.25 526.48883,154.5 503.94673,117.33132 497.95017,107.59111 497.02898,106.64841 495.3488,104.929 467.70464,122.71895 450.0217,136.89919 437.46673,146.96723 414.68591,169.16907 404.77083,181 c -22.86562,27.28385 -39.4535,59.70945 -45.29748,88.54646 -9.9248,48.97376 3.11591,95.33708 38.86261,138.16727 8.11559,9.72376 25.83858,27.05436 35.57388,34.78627 39.76305,31.58037 56.33253,48.76563 65.09016,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.82437,7.83174 5.61545,11.68174 2.96223,6.36743 28.30315,60.22126 40.11439,85.25 2.66038,5.6375 5.10291,10.25 5.42785,10.25 0.32494,0 6.29615,-2.90892 13.26934,-6.46427 z m -257.58469,-9.65311 c 41.65575,-5.24603 78.19631,-31.48871 101.55412,-72.93407 5.0957,-9.04165 11.88501,-27.01148 15.17455,-40.16378 5.88181,-23.51669 6.22779,-28.46219 6.75382,-96.53925 l 0.48104,-62.25447 -6.81595,-10.23837 C 340.6412,383.60251 330.55943,358.43155 325.8414,330 c -2.60529,-15.69985 -2.80479,-41.47079 -0.44054,-56.90915 4.35041,-28.40795 15.93367,-58.22876 32.61882,-83.97636 5.30211,-8.18191 6.04349,-9.91316 5.7812,-13.5 L 363.5,171.5 310,165.34318 c -29.425,-3.38626 -55.6286,-6.43807 -58.23023,-6.78182 l -4.73022,-0.625 -0.29963,192.78182 -0.29962,192.78182 -2.11377,7.2241 c -4.67144,15.96526 -13.26345,28.77986 -21.01086,31.33673 -1.92406,0.635 -6.58529,0.98011 -10.35828,0.76692 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42809 c -4.15021,0.47377 -80.124,6.09758 -95.428341,7.0639 -5.323087,0.3361 -10.183506,0.9233 -10.80093,1.30489 -1.433872,0.88618 0.277225,39.51845 2.509949,56.66835 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.53837,30.91997 68.16863,43.16672 116.83093,37.0383 z m 125.86452,-5.89474 c 10.59745,-9.95719 22.37081,-14.63733 30.26648,-12.03152 5.4987,1.81474 7.63223,5.21914 7.63223,12.1785 l 0,5.86514 17.38834,0 17.38834,0 -24.60072,-52.35206 -24.60072,-52.35207 -3.31609,11.53633 c -9.21294,32.0509 -24.57358,57.86466 -48.44817,81.4178 l -11.91036,11.75 16.90098,0 16.90097,0 6.39872,-6.01212 z m 26.4789,1.78824 c -0.82165,-5.1383 -3.02682,-7.77924 -6.48518,-7.76674 -3.27335,0.0118 -11.67957,4.82334 -15.5321,8.89016 L 367.62582,691 l 12.8149,0 12.8149,0 -0.67543,-4.22388 z m 6.1678,-5.61606 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z M 601.881,671.13268 c 8.00329,-4.17834 17.87524,-11.88515 27.71015,-21.63268 11.56958,-11.46679 15.29988,-16.174 20.34823,-25.67715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -2.66356,-16.93209 -4.28512,-23.74898 -8.44452,-35.5 -7.32429,-20.69238 -18.83702,-38.15216 -35.12459,-53.26863 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.08608,-1.75732 -7.48431,-4.58501 -20.005,-8.8412 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.91756,-0.28666 -2.06791,-0.0709 -1.14813,1.64778 0.58212,1.08769 16.79888,27.88853 36.03724,59.55741 32.54666,53.57612 34.85154,57.67311 33.14812,58.92193 -1.00689,0.73818 -8.13071,4.77873 -15.83071,8.97899 -39.02847,21.28963 -69.01853,42.10936 -77.3318,53.68538 l -3.31335,4.61376 2.08466,3.37305 c 2.45935,3.97932 5.48355,6.86393 4.49483,4.28736 -0.87299,-2.27496 4.31405,-11.41616 9.36916,-16.51143 8.43954,-8.50657 21.45867,-11.79532 33.03714,-8.34546 5.46979,1.62975 12.27455,7.8332 14.69425,13.39579 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.68881,-0.4407 3.49555,-1.375 2.05334,-1.06182 5.60695,-1.69874 9.47794,-1.69874 10.887,0 20.57174,7.22991 22.07244,16.47763 1.53795,9.47727 -6.46536,22.07933 -17.4469,27.47201 -7.14195,3.50717 -18.00691,3.96906 -22.59827,0.96068 -2.78647,-1.82576 -2.82814,-1.82009 -5.51074,0.75 -3.08948,2.95991 -4.34699,3.19422 -6.06074,1.12927 -0.99099,-1.19406 -0.4206,-2.37941 3.12755,-6.49951 C 571.22785,333.317 574,331.68547 574,334.0147 c 0,1.71166 6.317,4.97761 9.63534,4.98156 2.57003,0.003 4.22917,-1.16556 9.20191,-6.48143 6.69138,-7.15311 8.12653,-11.06451 6.20076,-16.89967 -2.54981,-7.726 -13.06117,-12.79568 -18.77197,-9.05382 -2.54396,1.66687 -2.717,1.66561 -3.71711,-0.0271 C 569.61628,294.8003 562.2292,291 546.3533,291 c -7.915,0 -8.448,0.14425 -11.9749,3.24091 -3.62841,3.18578 -9.37606,13.5972 -9.37761,16.98679 -7.4e-4,1.6078 3.87328,5.03962 26.09048,23.11248 21.50941,17.49709 43.50603,39.39157 59.43581,59.15982 6.52839,8.10148 23.0602,32.62428 24.00933,35.61473 0.43946,1.3846 1.17188,1.82644 2.30393,1.38986 8.98494,-3.46507 15.85793,-2.96017 20.31012,1.49203 2.44684,2.44683 2.84954,3.63238 2.84954,8.38894 0,5.84738 -2.62892,14.26622 -6.60184,21.14167 l -2.3271,4.02724 2.01621,6.47276 c 6.17921,19.83749 8.37472,37.56849 7.59561,61.34233 -1.65301,50.44035 -20.75614,92.85541 -60.13065,133.50929 -9.15296,9.45036 -9.66031,10.16603 -5.67123,8 2.40955,-1.30837 5.55955,-2.99414 7,-3.74617 z m 48.78567,-71.79935 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 1.08573,-1.52477 3.36531,-3.34858 5.06574,-4.05292 2.62433,-1.08704 3.32417,-1.04813 4.62968,0.25738 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z M 657.44553,591 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 422.15915,561.6058 c 18.91504,-9.28129 29.36467,-16.04688 37.93065,-24.55812 9.07716,-9.01915 9.29539,-9.55875 6.27522,-15.51668 -5.92848,-11.69519 -17.86755,-23.83148 -45.52022,-46.27216 -9.53964,-7.7416 -18.66649,-15.46686 -20.28189,-17.16724 -1.6154,-1.70038 -3.26353,-3.0916 -3.66251,-3.0916 -0.39898,0 -0.94714,22.3875 -1.21814,49.75 -0.38077,38.44627 -0.84707,51.9085 -2.0523,59.25 -0.85776,5.225 -1.57541,10.0369 -1.59477,10.69311 -0.0393,1.33334 6.71741,-1.60211 30.12396,-13.08731 z m -15.49248,-48.27247 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 2.63084,-3.69467 7.46851,-5.74397 9.52685,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z M 413.44553,505 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 648.60439,443.61285 C 647.93677,437.60017 645.76581,435 641.41327,435 l -3.27675,0 4.43174,9.48366 c 2.43746,5.21602 4.47694,10.05352 4.53219,10.75 0.0553,0.69649 0.53833,-0.53366 1.07352,-2.73366 0.53519,-2.2 0.72888,-6.19922 0.43042,-8.88715 z m -435.84487,-46.2395 0.25953,-48.11316 -5.25953,-0.66665 c -9.15865,-1.16086 -14.7073,-3.53481 -19.79195,-8.46784 -5.55275,-5.38719 -6.98008,-9.44438 -6.90435,-19.6257 0.10295,-13.83991 5.97355,-28.04742 14.49424,-35.07765 4.65123,-3.83764 11.89935,-7.36824 15.19254,-7.40039 L 213,278 l 0,-78.5 c 0,-62.29958 0.259,-78.5 1.25498,-78.5 0.69024,0 41.64387,4.48566 91.00806,9.96813 l 89.75308,9.96813 8.53422,-8.45771 c 4.69383,-4.65174 11.69505,-11.17814 15.55828,-14.50312 l 7.02405,-6.04541 -104.81634,0.3214 -104.81633,0.3214 -11.5,2.67076 c -6.325,1.46891 -13.975,3.54253 -17,4.60803 -9.99691,3.52123 -21.47646,8.326 -23,9.62665 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 109.08343,183.88282 100,201.4483 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604647,8.63513 -1.795723,19.51571 -2.098829,119.51523 l -0.333465,110.01523 60.283112,-4.52197 60.28311,-4.52197 0.25952,-48.11317 z M 96.666667,393.33333 c -1.34912,-1.34912 -0.610152,-6.60396 1.307387,-9.29689 2.630836,-3.69467 7.468506,-5.74397 9.526846,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z M 103.44553,385 l 0.66018,-2.5 -2.05285,2.36078 c -2.412793,2.77471 -3.026915,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z m 30.07485,-141.28683 c -2.18879,-1.23967 -5.02357,-4.04476 -6.29951,-6.23355 -4.65931,-7.99272 -1.55939,-21.49462 7.77283,-33.85505 7.68616,-10.18025 18.79592,-13.26393 29.62333,-8.22241 9.97255,4.64348 12.96474,12.03155 9.49684,23.44885 -3.3843,11.14207 -12.38138,21.85585 -21.58214,25.70018 -5.35193,2.23618 -14.27816,1.84271 -19.01135,-0.83802 z m 16.3765,-2.82707 c 2.61732,-0.9124 3.93496,-2.58495 7.28414,-9.24612 9.20217,-18.30222 4.87594,-31.63871 -9.86672,-30.41614 -6.64609,0.55115 -10.16869,3.59467 -14.38689,12.43025 -3.84559,8.0551 -4.74053,16.54961 -2.23998,21.2611 3.23423,6.09385 11.49291,8.66091 19.20945,5.97091 z m 19.57423,-22.43355 c 1.99478,-6.34195 1.56995,-11.64471 -1.17601,-14.67896 -2.16635,-2.39379 -7.25939,-5.14263 -8.0547,-4.34733 -0.31555,0.31556 -0.0677,0.57374 0.55078,0.57374 1.69839,0 5.93039,7.96193 6.66512,12.5395 0.3566,2.22172 0.22344,5.93073 -0.29593,8.24224 -1.33113,5.92443 0.20015,4.38092 2.31074,-2.32919 z m 485.27688,218.70751 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z M 213,315 l 0,-28 -5.9652,0 c -5.26916,0 -6.38516,0.36872 -9.56423,3.15998 C 190.77976,296.03459 186,308.88481 186,320.99821 c 0,13.63108 8.30704,21.82906 22.25,21.9579 L 213,343 l 0,-28 z m 393.58458,12.70067 c 1.83053,-2.76096 2.92974,-5.93018 3.20717,-9.24687 0.3685,-4.40534 0.0645,-5.47114 -2.39345,-8.39229 -2.73935,-3.25553 -9.37192,-7.01238 -12.3983,-7.0227 -0.825,-0.003 -0.0265,0.93847 1.77448,2.09174 9.27746,5.94094 10.88321,19.4736 3.35493,28.27425 -1.58838,1.85684 -1.56269,1.8619 1.02035,0.20067 1.45736,-0.93727 3.90304,-3.59443 5.43482,-5.9048 z"
+       id="path3616"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#caad50"
+       d="m 464.24418,744.75 c -1.61938,-3.4375 -5.32776,-11.3125 -8.24084,-17.5 l -5.29652,-11.25 -84.36467,0 -84.36467,0 -11.23874,3.38694 c -19.28562,5.81197 -29.35869,7.1213 -54.23874,7.05012 -19.85965,-0.0568 -23.22599,-0.322 -34.60155,-2.72573 -30.53316,-6.45184 -53.94731,-18.7052 -76.52782,-40.04939 C 69.421049,649.68065 49.980714,603.39893 45.047413,540.05011 44.471336,532.65266 44,511.21912 44,492.42 L 44,458.2398 55.5,457.52125 67,456.8027 67.01777,349.15135 C 67.035144,243.85306 67.293758,233.64677 70.366309,217 c 1.524336,-8.2587 5.805294,-22.49738 8.095583,-26.92631 0.805792,-1.55823 2.089787,-4.64638 2.853322,-6.86256 1.372558,-3.98387 2.740384,-6.39656 10.968549,-19.34727 8.269777,-13.01621 10.101677,-15.36961 19.599927,-25.17962 C 128.3936,121.63242 145.70632,109.44042 165,101.27855 179.20986,95.267312 182.04094,94.355031 197.83956,90.696431 L 211.5,87.532985 l 124.80569,-0.289101 124.80568,-0.2891 3.84409,-2.426665 c 3.88418,-2.451977 34.83936,-19.833552 40.7358,-22.873467 l 3.19125,-1.645257 8.03323,13.35057 8.03322,13.350569 12.77552,0.559956 C 544.75102,87.578465 555,88.547988 560.5,89.424985 c 13.41479,2.139041 36.59945,9.743241 45.47655,14.915585 21.20265,12.35397 26.40356,16.21983 40.57489,30.15943 7.828,7.7 15.51879,15.96385 17.09064,18.36411 C 674.4297,169.33708 683,184.65051 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29739,164.60779 -0.30324,165.02565 -2.46297,175.79255 -2.82311,14.07408 -9.47082,33.33611 -14.66251,42.48526 -2.27138,4.0028 -5.02979,8.9876 -6.12979,11.07735 -7.53001,14.30526 -26.49531,34.27214 -48.21379,50.76003 -6.40758,4.8644 -28.63093,15.71305 -40.78621,19.91037 -6.15327,2.12478 -30.16779,7.14806 -38,7.94872 -5.33024,0.5449 -8.31196,1.5064 -12.5,4.03085 -11.78105,7.10131 -28.77024,15.76895 -45.98451,23.46065 C 477.12602,747.3846 468.61926,751 468.11157,751 c -0.50768,0 -2.24801,-2.8125 -3.86739,-6.25 z m 33.57728,-44.21427 C 562.54991,667.5333 603.27373,626.47601 619.38325,577.97852 632.88941,537.31841 629.91367,496.4828 610.53097,456.5 593.31881,420.99459 566.93713,390.60542 521.63807,354.10385 496.93949,334.20197 485.7537,321.05829 481.60912,307.0685 c -2.12544,-7.17432 -2.02977,-10.86919 0.45329,-17.50575 6.31941,-16.89013 29.06664,-37.02816 68.93759,-61.03016 7.975,-4.80089 14.36272,-9.20906 14.19493,-9.79594 -0.16779,-0.58689 -5.53385,-9.65522 -11.92457,-20.15186 C 546.87963,188.08816 534.82794,168.25 526.48883,154.5 c -22.45479,-37.02472 -28.53825,-46.90843 -29.44169,-47.83343 -1.7331,-1.77447 -28.85968,15.6652 -47.02544,30.23262 -12.55497,10.06804 -35.33579,32.26988 -45.25087,44.10081 -22.86562,27.28385 -39.4535,59.70945 -45.29748,88.54646 -11.40471,56.27633 7.62543,109.51861 55.77012,156.03295 6.78613,6.55632 15.1787,14.17059 18.65016,16.92059 39.46621,31.26412 56.35243,48.77352 65.10637,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.82437,7.83174 5.61545,11.68174 2.96223,6.36743 28.30315,60.22126 40.11439,85.25 2.66038,5.6375 5.10291,10.25 5.42785,10.25 0.32494,0 6.29615,-2.90892 13.26934,-6.46427 z m -257.58469,-9.65311 c 28.81263,-3.6286 55.09644,-17.06314 76.35093,-39.02554 19.90765,-20.5707 33.00641,-44.60016 40.37774,-74.07231 5.90181,-23.59664 6.2412,-28.44741 6.75515,-96.54662 l 0.4699,-62.26185 -6.81105,-10.23099 C 340.64144,383.60288 330.55892,358.42847 325.8414,330 c -2.60529,-15.69985 -2.80479,-41.47079 -0.44054,-56.90915 4.35041,-28.40795 15.93367,-58.22876 32.61882,-83.97636 5.30211,-8.18191 6.04349,-9.91316 5.7812,-13.5 L 363.5,171.5 310,165.34318 c -29.425,-3.38626 -55.62966,-6.43822 -58.23259,-6.78214 l -4.73259,-0.62531 -0.2996,192.28214 c -0.28457,182.62842 -0.39157,192.63357 -2.13126,199.28213 -4.14339,15.83477 -13.37043,29.94771 -21.28829,32.56083 -1.92406,0.635 -6.58529,0.98011 -10.35828,0.76692 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42546 c -4.07613,0.46247 -81.00802,6.14881 -95.921094,7.08991 -5.044102,0.31832 -9.679521,0.89298 -10.300931,1.27703 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.53837,30.91997 68.16863,43.16672 116.83093,37.0383 z m 125.86452,-5.89474 c 10.59745,-9.95719 22.37081,-14.63733 30.26648,-12.03152 5.4987,1.81474 7.63223,5.21914 7.63223,12.1785 l 0,5.86514 17.40661,0 17.40661,0 -18.94984,-40.25 c -10.42241,-22.1375 -21.48769,-45.74207 -24.58952,-52.4546 l -5.63967,-12.20459 -3.34557,11.63886 c -9.2441,32.1593 -24.57453,57.93905 -48.47764,81.52033 l -11.91036,11.75 16.90098,0 16.90097,0 6.39872,-6.01212 z m 26.4789,1.78824 c -0.82165,-5.1383 -3.02682,-7.77924 -6.48518,-7.76674 -3.27335,0.0118 -11.67957,4.82334 -15.5321,8.89016 L 367.62582,691 l 12.8149,0 12.8149,0 -0.67543,-4.22388 z m 6.1678,-5.61606 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z m 212.74829,-16.03291 c 7.74212,-5.12044 27.44294,-24.0998 32.31035,-31.12715 1.71428,-2.475 4.47402,-7.05472 6.13275,-10.17715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -2.2484,-14.29296 -3.89748,-23.36713 -4.5182,-24.86174 -0.37422,-0.90104 -2.42531,-6.5704 -4.55798,-12.59858 -6.53757,-18.47892 -18.84362,-36.78421 -34.49293,-51.30831 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.08608,-1.75732 -7.48431,-4.58501 -20.005,-8.8412 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.91756,-0.28666 -2.06791,-0.0709 -1.14813,1.64778 0.58212,1.08769 16.79888,27.88853 36.03724,59.55741 32.54666,53.57612 34.85154,57.67311 33.14812,58.92193 -1.00689,0.73818 -8.13071,4.77873 -15.83071,8.97899 -39.02847,21.28963 -69.01853,42.10936 -77.3318,53.68538 l -3.31335,4.61376 2.08466,3.37305 c 2.45935,3.97932 5.48355,6.86393 4.49483,4.28736 -0.87299,-2.27496 4.31405,-11.41616 9.36916,-16.51143 8.43954,-8.50657 21.45867,-11.79532 33.03714,-8.34546 5.46979,1.62975 12.27455,7.8332 14.69425,13.39579 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.68881,-0.4407 3.49555,-1.375 2.05334,-1.06182 5.60695,-1.69874 9.47794,-1.69874 10.887,0 20.57174,7.22991 22.07244,16.47763 1.53795,9.47727 -6.46536,22.07933 -17.4469,27.47201 -7.14195,3.50717 -18.00691,3.96906 -22.59827,0.96068 -2.78647,-1.82576 -2.82814,-1.82009 -5.51074,0.75 -3.08948,2.95991 -4.34699,3.19422 -6.06074,1.12927 -0.99099,-1.19406 -0.4206,-2.37941 3.12755,-6.49951 C 571.22785,333.317 574,331.68547 574,334.0147 c 0,1.71166 6.317,4.97761 9.63534,4.98156 2.57003,0.003 4.22917,-1.16556 9.20191,-6.48143 6.69138,-7.15311 8.12653,-11.06451 6.20076,-16.89967 -2.54981,-7.726 -13.06117,-12.79568 -18.77197,-9.05382 -2.54396,1.66687 -2.717,1.66561 -3.71711,-0.0271 C 569.61628,294.8003 562.2292,291 546.3533,291 c -7.915,0 -8.448,0.14425 -11.9749,3.24091 -3.54032,3.10844 -9.37597,13.57105 -9.37761,16.81292 -0.001,1.99731 3.70019,5.42974 18.63192,17.2789 38.61872,30.6461 69.36138,63.96389 87.08319,94.37764 3.37757,5.7965 5.2251,8.0551 6.2841,7.68226 9.44289,-3.3245 15.72178,-2.8247 20.15046,1.60399 2.44684,2.44683 2.84954,3.63238 2.84954,8.38894 0,5.84738 -2.62892,14.26622 -6.60184,21.14167 l -2.3271,4.02724 2.01621,6.47276 c 6.16607,19.79531 8.36988,37.55337 7.61271,61.34233 -0.43963,13.81242 -1.1772,20.98841 -3.09688,30.13044 -8.16604,38.88876 -26.00148,71.22214 -57.05087,103.42598 L 590.5,677.35196 l 7,-3.79883 c 3.85,-2.08936 10.14832,-5.88105 13.99628,-8.42598 z m 39.17039,-65.79382 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 1.08573,-1.52477 3.36531,-3.34858 5.06574,-4.05292 2.62433,-1.08704 3.32417,-1.04813 4.62968,0.25738 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z M 657.44553,591 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 421,562.20136 c 20.01211,-9.80247 30.37803,-16.46958 39.0898,-25.14162 9.17729,-9.13543 9.4346,-9.77559 6.2994,-15.6721 -6.36244,-11.96611 -18.74828,-24.50189 -45.88247,-46.43795 -9.3537,-7.5618 -18.32842,-15.14395 -19.94382,-16.84921 C 398.94751,456.39522 397.29938,455 396.9004,455 c -0.39898,0 -0.94714,22.3875 -1.21814,49.75 -0.38077,38.44627 -0.84707,51.9085 -2.0523,59.25 -0.85776,5.225 -1.57541,10.04368 -1.59477,10.70818 -0.0408,1.40132 5.12173,-0.82784 28.96481,-12.50682 z m -14.33333,-48.86803 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 2.63084,-3.69467 7.46851,-5.74397 9.52685,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z M 413.44553,505 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 648.60439,443.61285 C 647.93826,437.61363 645.76391,435 641.43912,435 l -3.25091,0 4.6559,10.32708 4.65589,10.32708 0.82352,-3.57708 c 0.45293,-1.96739 0.57933,-5.7763 0.28087,-8.46423 z m -435.84487,-46.23276 0.25953,-48.1199 -5.25953,-0.66665 c -9.15865,-1.16086 -14.7073,-3.53481 -19.79195,-8.46784 -5.55275,-5.38719 -6.98008,-9.44438 -6.90435,-19.6257 0.10295,-13.83991 5.97355,-28.04742 14.49424,-35.07765 4.65123,-3.83764 11.89935,-7.36824 15.19254,-7.40039 L 213,278 l 0,-78.5 c 0,-62.29958 0.259,-78.5 1.25498,-78.5 0.69024,0 41.65846,4.48728 91.04049,9.97173 l 89.7855,9.97173 7.70952,-7.63594 c 4.24023,-4.19976 11.21772,-10.72778 15.50554,-14.5067 l 7.79604,-6.87076 -104.79604,0.32138 -104.79603,0.32138 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 109.08343,183.88282 100,201.4483 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604651,8.63515 -1.795723,19.51596 -2.098834,119.52066 L 91.933768,454.54132 152.21688,450.02066 212.5,445.5 212.75952,397.38009 z M 96.666667,393.33333 c -1.34912,-1.34912 -0.610152,-6.60396 1.307387,-9.29689 2.630836,-3.69467 7.468506,-5.74397 9.526846,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z M 103.44553,385 l 0.66018,-2.5 -2.05285,2.36078 c -2.412793,2.77471 -3.026915,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z m 30.07485,-141.28683 c -2.18879,-1.23967 -5.02357,-4.04476 -6.29951,-6.23355 -4.65931,-7.99272 -1.55939,-21.49462 7.77283,-33.85505 7.68616,-10.18025 18.79592,-13.26393 29.62333,-8.22241 9.97255,4.64348 12.96474,12.03155 9.49684,23.44885 -3.3843,11.14207 -12.38138,21.85585 -21.58214,25.70018 -5.35193,2.23618 -14.27816,1.84271 -19.01135,-0.83802 z m 16.3765,-2.82707 c 2.61732,-0.9124 3.93496,-2.58495 7.28414,-9.24612 9.20217,-18.30222 4.87594,-31.63871 -9.86672,-30.41614 -6.64609,0.55115 -10.16869,3.59467 -14.38689,12.43025 -3.84559,8.0551 -4.74053,16.54961 -2.23998,21.2611 3.23423,6.09385 11.49291,8.66091 19.20945,5.97091 z m 19.57423,-22.43355 c 1.99478,-6.34195 1.56995,-11.64471 -1.17601,-14.67896 -2.16635,-2.39379 -7.25939,-5.14263 -8.0547,-4.34733 -0.31555,0.31556 -0.0677,0.57374 0.55078,0.57374 1.69839,0 5.93039,7.96193 6.66512,12.5395 0.3566,2.22172 0.22344,5.93073 -0.29593,8.24224 -1.33113,5.92443 0.20015,4.38092 2.31074,-2.32919 z m 485.27688,218.70751 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z M 213,315 l 0,-28 -5.9652,0 c -5.26916,0 -6.38516,0.36872 -9.56423,3.15998 C 190.77976,296.03459 186,308.88481 186,320.99821 c 0,13.63108 8.30704,21.82906 22.25,21.9579 L 213,343 l 0,-28 z m 393.58458,12.70067 c 1.83053,-2.76096 2.92974,-5.93018 3.20717,-9.24687 0.3685,-4.40534 0.0645,-5.47114 -2.39345,-8.39229 -2.73935,-3.25553 -9.37192,-7.01238 -12.3983,-7.0227 -0.825,-0.003 -0.0265,0.93847 1.77448,2.09174 9.27746,5.94094 10.88321,19.4736 3.35493,28.27425 -1.58838,1.85684 -1.56269,1.8619 1.02035,0.20067 1.45736,-0.93727 3.90304,-3.59443 5.43482,-5.9048 z"
+       id="path3614"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#eba534"
+       d="m 464.24418,744.75 c -1.61938,-3.4375 -5.32776,-11.3125 -8.24084,-17.5 l -5.29652,-11.25 -84.36467,0 -84.36467,0 -11.23874,3.38694 c -19.28562,5.81197 -29.35869,7.1213 -54.23874,7.05012 -19.85965,-0.0568 -23.22599,-0.322 -34.60155,-2.72573 -30.53316,-6.45184 -53.94731,-18.7052 -76.52782,-40.04939 C 69.421049,649.68065 49.980714,603.39893 45.047413,540.05011 44.471336,532.65266 44,511.21912 44,492.42 L 44,458.2398 55.5,457.52125 67,456.8027 67.01777,349.15135 C 67.035144,243.85306 67.293758,233.64677 70.366309,217 c 1.524336,-8.2587 5.805294,-22.49738 8.095583,-26.92631 0.805792,-1.55823 2.089787,-4.64638 2.853322,-6.86256 1.372558,-3.98387 2.740384,-6.39656 10.968549,-19.34727 8.269777,-13.01621 10.101677,-15.36961 19.599927,-25.17962 C 128.3936,121.63242 145.70632,109.44042 165,101.27855 179.20986,95.267312 182.04094,94.355031 197.83956,90.696431 L 211.5,87.532985 l 124.80569,-0.289101 124.80568,-0.2891 3.84409,-2.426665 c 3.88418,-2.451977 34.83936,-19.833552 40.7358,-22.873467 l 3.19125,-1.645257 8.03323,13.35057 8.03322,13.350569 12.77552,0.559956 C 544.75102,87.578465 555,88.547988 560.5,89.424985 c 13.41479,2.139041 36.59945,9.743241 45.47655,14.915585 21.20265,12.35397 26.40356,16.21983 40.57489,30.15943 7.828,7.7 15.51879,15.96385 17.09064,18.36411 C 674.4297,169.33708 683,184.65051 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29739,164.60779 -0.30324,165.02565 -2.46297,175.79255 -2.82311,14.07408 -9.47082,33.33611 -14.66251,42.48526 -2.27138,4.0028 -5.02979,8.9876 -6.12979,11.07735 -7.53001,14.30526 -26.49531,34.27214 -48.21379,50.76003 -6.40758,4.8644 -28.63093,15.71305 -40.78621,19.91037 -6.15327,2.12478 -30.16779,7.14806 -38,7.94872 -5.33024,0.5449 -8.31196,1.5064 -12.5,4.03085 -11.78105,7.10131 -28.77024,15.76895 -45.98451,23.46065 C 477.12602,747.3846 468.61926,751 468.11157,751 c -0.50768,0 -2.24801,-2.8125 -3.86739,-6.25 z m 33.57728,-44.21427 C 562.54991,667.5333 603.27373,626.47601 619.38325,577.97852 632.88941,537.31841 629.91367,496.4828 610.53097,456.5 593.31881,420.99459 566.93713,390.60542 521.63807,354.10385 496.93949,334.20197 485.7537,321.05829 481.60912,307.0685 c -2.12544,-7.17432 -2.02977,-10.86919 0.45329,-17.50575 6.31941,-16.89013 29.06664,-37.02816 68.93759,-61.03016 7.975,-4.80089 14.36272,-9.20906 14.19493,-9.79594 -0.16779,-0.58689 -5.53385,-9.65522 -11.92457,-20.15186 C 546.87963,188.08816 534.82794,168.25 526.48883,154.5 c -22.45479,-37.02472 -28.53825,-46.90843 -29.44169,-47.83343 -1.7331,-1.77447 -28.85968,15.6652 -47.02544,30.23262 -12.55497,10.06804 -35.33579,32.26988 -45.25087,44.10081 -22.86562,27.28385 -39.4535,59.70945 -45.29748,88.54646 -11.40471,56.27633 7.62543,109.51861 55.77012,156.03295 6.78613,6.55632 15.1787,14.17059 18.65016,16.92059 39.46621,31.26412 56.35243,48.77352 65.10637,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.82437,7.83174 5.61545,11.68174 2.96223,6.36743 28.30315,60.22126 40.11439,85.25 2.66038,5.6375 5.10291,10.25 5.42785,10.25 0.32494,0 6.29615,-2.90892 13.26934,-6.46427 z m -257.58469,-9.65311 c 28.81263,-3.6286 55.09644,-17.06314 76.35093,-39.02554 19.90765,-20.5707 33.00641,-44.60016 40.37774,-74.07231 5.90181,-23.59664 6.2412,-28.44741 6.75515,-96.54662 l 0.4699,-62.26185 -6.81105,-10.23099 C 340.64144,383.60288 330.55892,358.42847 325.8414,330 c -2.60529,-15.69985 -2.80479,-41.47079 -0.44054,-56.90915 4.35041,-28.40795 15.93367,-58.22876 32.61882,-83.97636 5.30211,-8.18191 6.04349,-9.91316 5.7812,-13.5 L 363.5,171.5 310,165.34318 c -29.425,-3.38626 -55.62966,-6.43822 -58.23259,-6.78214 l -4.73259,-0.62531 -0.2996,192.28214 c -0.28457,182.62842 -0.39157,192.63357 -2.13126,199.28213 -4.14339,15.83477 -13.37043,29.94771 -21.28829,32.56083 -1.92406,0.635 -6.58529,0.98011 -10.35828,0.76692 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42546 c -4.07613,0.46247 -81.00802,6.14881 -95.921094,7.08991 -5.044102,0.31832 -9.679521,0.89298 -10.300931,1.27703 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.53837,30.91997 68.16863,43.16672 116.83093,37.0383 z m 125.86452,-5.89474 c 10.59745,-9.95719 22.37081,-14.63733 30.26648,-12.03152 5.4987,1.81474 7.63223,5.21914 7.63223,12.1785 l 0,5.86514 17.40661,0 17.40661,0 -18.94984,-40.25 c -10.42241,-22.1375 -21.48769,-45.74207 -24.58952,-52.4546 l -5.63967,-12.20459 -3.34557,11.63886 c -9.2441,32.1593 -24.57453,57.93905 -48.47764,81.52033 l -11.91036,11.75 16.90098,0 16.90097,0 6.39872,-6.01212 z m 26.4789,1.78824 c -0.82165,-5.1383 -3.02682,-7.77924 -6.48518,-7.76674 -3.27335,0.0118 -11.67957,4.82334 -15.5321,8.89016 L 367.62582,691 l 12.8149,0 12.8149,0 -0.67543,-4.22388 z m 6.1678,-5.61606 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z m 212.74829,-16.03291 c 7.74212,-5.12044 27.44294,-24.0998 32.31035,-31.12715 1.71428,-2.475 4.47402,-7.05472 6.13275,-10.17715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -2.2484,-14.29296 -3.89748,-23.36713 -4.5182,-24.86174 -0.37422,-0.90104 -2.42531,-6.5704 -4.55798,-12.59858 -6.53757,-18.47892 -18.84362,-36.78421 -34.49293,-51.30831 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.08608,-1.75732 -7.48431,-4.58501 -20.005,-8.8412 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.91756,-0.28666 -2.06791,-0.0709 -1.14813,1.64778 0.58212,1.08769 16.79888,27.88853 36.03724,59.55741 32.54666,53.57612 34.85154,57.67311 33.14812,58.92193 -1.00689,0.73818 -8.13071,4.77873 -15.83071,8.97899 -39.02847,21.28963 -69.01853,42.10936 -77.3318,53.68538 l -3.31335,4.61376 2.08466,3.37305 c 1.14656,1.85517 2.8406,3.98613 3.76453,4.73546 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.1981,-1.99193 3.9181,-11.51832 8.98697,-16.7338 8.50655,-8.7526 21.51402,-12.1287 33.25329,-8.63093 5.46979,1.62975 12.27455,7.8332 14.69425,13.39579 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.67694,-0.43456 3.46918,-1.36137 2.07852,-1.07484 5.54425,-1.67191 9.56989,-1.64869 10.99408,0.0634 20.50466,7.15695 22.00686,16.41395 1.53795,9.47727 -6.46536,22.07933 -17.4469,27.47201 -7.09564,3.48443 -18.00875,3.96785 -22.54058,0.99848 -2.70719,-1.77381 -2.79724,-1.76213 -5.78275,0.75 -3.50977,2.95328 -4.19508,3.08122 -5.84642,1.09147 -0.99099,-1.19406 -0.4206,-2.37941 3.12755,-6.49951 C 571.22785,333.317 574,331.68547 574,334.0147 c 0,1.71166 6.317,4.97761 9.63534,4.98156 2.57003,0.003 4.22917,-1.16556 9.20191,-6.48143 6.69138,-7.15311 8.12653,-11.06451 6.20076,-16.89967 -2.54981,-7.726 -13.06117,-12.79568 -18.77197,-9.05382 -2.54396,1.66687 -2.717,1.66561 -3.71711,-0.0271 C 569.61628,294.8003 562.2292,291 546.3533,291 c -7.915,0 -8.448,0.14425 -11.9749,3.24091 -3.54032,3.10844 -9.37597,13.57105 -9.37761,16.81292 -0.001,1.99731 3.70019,5.42974 18.63192,17.2789 38.61872,30.6461 69.36138,63.96389 87.08319,94.37764 3.37757,5.7965 5.2251,8.0551 6.2841,7.68226 9.44289,-3.3245 15.72178,-2.8247 20.15046,1.60399 2.44684,2.44683 2.84954,3.63238 2.84954,8.38894 0,5.84738 -2.62892,14.26622 -6.60184,21.14167 l -2.3271,4.02724 2.01621,6.47276 c 6.16607,19.79531 8.36988,37.55337 7.61271,61.34233 -0.43963,13.81242 -1.1772,20.98841 -3.09688,30.13044 -8.16604,38.88876 -26.00148,71.22214 -57.05087,103.42598 L 590.5,677.35196 l 7,-3.79883 c 3.85,-2.08936 10.14832,-5.88105 13.99628,-8.42598 z m 39.17039,-65.79382 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 1.08573,-1.52477 3.36531,-3.34858 5.06574,-4.05292 2.62433,-1.08704 3.32417,-1.04813 4.62968,0.25738 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z M 657.44553,591 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 421,562.20136 c 20.01211,-9.80247 30.37803,-16.46958 39.0898,-25.14162 9.17729,-9.13543 9.4346,-9.77559 6.2994,-15.6721 -6.36244,-11.96611 -18.74828,-24.50189 -45.88247,-46.43795 -9.3537,-7.5618 -18.32842,-15.14395 -19.94382,-16.84921 C 398.94751,456.39522 397.29938,455 396.9004,455 c -0.39898,0 -0.94714,22.3875 -1.21814,49.75 -0.38077,38.44627 -0.84707,51.9085 -2.0523,59.25 -0.85776,5.225 -1.57541,10.04368 -1.59477,10.70818 -0.0408,1.40132 5.12173,-0.82784 28.96481,-12.50682 z m -14.33333,-48.86803 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 2.63084,-3.69467 7.46851,-5.74397 9.52685,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z M 413.44553,505 l 0.66018,-2.5 -2.05285,2.36078 c -2.41279,2.77471 -3.02691,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z M 648.60439,443.61285 C 647.93826,437.61363 645.76391,435 641.43912,435 l -3.25091,0 4.6559,10.32708 4.65589,10.32708 0.82352,-3.57708 c 0.45293,-1.96739 0.57933,-5.7763 0.28087,-8.46423 z m -435.84484,-46.2677 0.25954,-48.15485 -5.25954,-0.66329 c -13.07679,-1.64914 -22.21009,-7.53136 -25.16664,-16.20835 -4.54345,-13.33429 0.52047,-34.07822 10.93487,-44.79385 4.61186,-4.74526 13.21367,-9.49764 17.22222,-9.51504 L 213,278 l 0,-78.5 c 0,-62.29958 0.259,-78.5 1.25498,-78.5 0.69024,0 41.65846,4.48728 91.04049,9.97173 l 89.7855,9.97173 7.70952,-7.63594 c 4.24023,-4.19976 11.21772,-10.72778 15.50554,-14.5067 l 7.79604,-6.87076 -104.79604,0.32138 -104.79603,0.32138 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 109.08343,183.88282 100,201.4483 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604651,8.63515 -1.795723,19.51596 -2.098834,119.52066 L 91.933768,454.54132 152.21688,450.02066 212.5,445.5 212.75955,397.34515 z M 96.666667,393.33333 c -1.34912,-1.34912 -0.610152,-6.60396 1.307387,-9.29689 2.630836,-3.69467 7.468506,-5.74397 9.526846,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z M 103.44553,385 l 0.66018,-2.5 -2.05285,2.36078 c -2.412793,2.77471 -3.026915,6.59193 -0.66018,4.10351 0.76597,-0.80536 1.68975,-2.58929 2.05285,-3.96429 z m 30.07485,-141.28683 c -2.18879,-1.23967 -5.02357,-4.04476 -6.29951,-6.23355 -4.65931,-7.99272 -1.55939,-21.49462 7.77283,-33.85505 7.67457,-10.1649 18.79807,-13.26303 29.58516,-8.24009 5.77291,2.68811 8.90622,6.16482 10.57467,11.73362 3.25811,10.8746 -9.37384,31.89774 -22.44851,37.36069 -5.50857,2.30162 -14.39518,1.94697 -19.18464,-0.76562 z m 16.3765,-2.82707 c 2.61732,-0.9124 3.93496,-2.58495 7.28414,-9.24612 9.20217,-18.30222 4.87594,-31.63871 -9.86672,-30.41614 -6.64609,0.55115 -10.16869,3.59467 -14.38689,12.43025 -3.84559,8.0551 -4.74053,16.54961 -2.23998,21.2611 3.23423,6.09385 11.49291,8.66091 19.20945,5.97091 z m 19.57423,-22.43355 c 1.99478,-6.34195 1.56995,-11.64471 -1.17601,-14.67896 -2.16635,-2.39379 -7.25939,-5.14263 -8.0547,-4.34733 -0.31555,0.31556 -0.0677,0.57374 0.55078,0.57374 1.69839,0 5.93039,7.96193 6.66512,12.5395 0.3566,2.22172 0.22344,5.93073 -0.29593,8.24224 -1.33113,5.92443 0.20015,4.38092 2.31074,-2.32919 z m 485.27688,218.70751 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z M 213,315 l 0,-28 -5.9652,0 c -5.26916,0 -6.38516,0.36872 -9.56423,3.15998 C 190.77976,296.03459 186,308.88481 186,320.99821 c 0,13.63108 8.30704,21.82906 22.25,21.9579 L 213,343 l 0,-28 z m 393.58458,12.70067 c 1.83053,-2.76096 2.92974,-5.93018 3.20717,-9.24687 0.3685,-4.40534 0.0645,-5.47114 -2.39345,-8.39229 -2.73935,-3.25553 -9.37192,-7.01238 -12.3983,-7.0227 -0.825,-0.003 -0.0265,0.93847 1.77448,2.09174 9.27746,5.94094 10.88321,19.4736 3.35493,28.27425 -1.58838,1.85684 -1.56269,1.8619 1.02035,0.20067 1.45736,-0.93727 3.90304,-3.59443 5.43482,-5.9048 z"
+       id="path3612"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#c9ac4e"
+       d="m 464.24418,744.75 c -1.61938,-3.4375 -5.32776,-11.3125 -8.24084,-17.5 l -5.29652,-11.25 -84.36467,0 -84.36467,0 -11.23874,3.38694 c -19.28562,5.81197 -29.35869,7.1213 -54.23874,7.05012 -19.85965,-0.0568 -23.22599,-0.322 -34.60155,-2.72573 -30.53316,-6.45184 -53.94731,-18.7052 -76.52782,-40.04939 C 69.421049,649.68065 49.980714,603.39893 45.047413,540.05011 44.471336,532.65266 44,511.21912 44,492.42 L 44,458.2398 55.5,457.52125 67,456.8027 67.01777,349.15135 C 67.035144,243.85306 67.293758,233.64677 70.366309,217 c 1.524336,-8.2587 5.805294,-22.49738 8.095583,-26.92631 0.805792,-1.55823 2.089787,-4.64638 2.853322,-6.86256 1.372558,-3.98387 2.740384,-6.39656 10.968549,-19.34727 8.269777,-13.01621 10.101677,-15.36961 19.599927,-25.17962 C 128.3936,121.63242 145.70632,109.44042 165,101.27855 179.20986,95.267312 182.04094,94.355031 197.83956,90.696431 L 211.5,87.532985 l 124.80569,-0.289101 124.80568,-0.2891 3.84409,-2.426665 c 3.88418,-2.451977 34.83936,-19.833552 40.7358,-22.873467 l 3.19125,-1.645257 8.03323,13.35057 8.03322,13.350569 12.77552,0.559956 C 544.75102,87.578465 555,88.547988 560.5,89.424985 c 13.41479,2.139041 36.59945,9.743241 45.47655,14.915585 21.20265,12.35397 26.40356,16.21983 40.57489,30.15943 7.828,7.7 15.51879,15.96385 17.09064,18.36411 C 674.4297,169.33708 683,184.65051 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29739,164.60779 -0.30324,165.02565 -2.46297,175.79255 -2.82311,14.07408 -9.47082,33.33611 -14.66251,42.48526 -2.27138,4.0028 -5.02979,8.9876 -6.12979,11.07735 -7.53001,14.30526 -26.49531,34.27214 -48.21379,50.76003 -6.40758,4.8644 -28.63093,15.71305 -40.78621,19.91037 -6.15327,2.12478 -30.16779,7.14806 -38,7.94872 -5.33024,0.5449 -8.31196,1.5064 -12.5,4.03085 -11.78105,7.10131 -28.77024,15.76895 -45.98451,23.46065 C 477.12602,747.3846 468.61926,751 468.11157,751 c -0.50768,0 -2.24801,-2.8125 -3.86739,-6.25 z m 33.57728,-44.21427 C 562.54991,667.5333 603.27373,626.47601 619.38325,577.97852 632.88941,537.31841 629.91367,496.4828 610.53097,456.5 593.31881,420.99459 566.93713,390.60542 521.63807,354.10385 496.93949,334.20197 485.7537,321.05829 481.60912,307.0685 c -2.12544,-7.17432 -2.02977,-10.86919 0.45329,-17.50575 6.31941,-16.89013 29.06664,-37.02816 68.93759,-61.03016 7.975,-4.80089 14.36272,-9.20906 14.19493,-9.79594 -0.16779,-0.58689 -5.53385,-9.65522 -11.92457,-20.15186 C 546.87963,188.08816 534.82794,168.25 526.48883,154.5 c -22.45479,-37.02472 -28.53825,-46.90843 -29.44169,-47.83343 -1.7331,-1.77447 -28.85968,15.6652 -47.02544,30.23262 -12.55497,10.06804 -35.33579,32.26988 -45.25087,44.10081 -22.86562,27.28385 -39.4535,59.70945 -45.29748,88.54646 -11.40471,56.27633 7.62543,109.51861 55.77012,156.03295 6.78613,6.55632 15.1787,14.17059 18.65016,16.92059 39.46621,31.26412 56.35243,48.77352 65.10637,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.82437,7.83174 5.61545,11.68174 2.96223,6.36743 28.30315,60.22126 40.11439,85.25 2.66038,5.6375 5.10291,10.25 5.42785,10.25 0.32494,0 6.29615,-2.90892 13.26934,-6.46427 z m -257.58469,-9.65311 c 28.81263,-3.6286 55.09644,-17.06314 76.35093,-39.02554 19.90765,-20.5707 33.00641,-44.60016 40.37774,-74.07231 5.90181,-23.59664 6.2412,-28.44741 6.75515,-96.54662 l 0.4699,-62.26185 -6.81105,-10.23099 C 340.64144,383.60288 330.55892,358.42847 325.8414,330 c -2.60529,-15.69985 -2.80479,-41.47079 -0.44054,-56.90915 4.35041,-28.40795 15.93367,-58.22876 32.61882,-83.97636 5.30211,-8.18191 6.04349,-9.91316 5.7812,-13.5 L 363.5,171.5 310,165.34318 c -29.425,-3.38626 -55.62966,-6.43822 -58.23259,-6.78214 l -4.73259,-0.62531 -0.2996,192.28214 c -0.28457,182.62842 -0.39157,192.63357 -2.13126,199.28213 -4.14339,15.83477 -13.37043,29.94771 -21.28829,32.56083 -1.92406,0.635 -6.58529,0.98011 -10.35828,0.76692 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42546 c -4.07613,0.46247 -81.00802,6.14881 -95.921094,7.08991 -5.044102,0.31832 -9.679521,0.89298 -10.300931,1.27703 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.53837,30.91997 68.16863,43.16672 116.83093,37.0383 z m 125.86452,-5.89474 c 10.59745,-9.95719 22.37081,-14.63733 30.26648,-12.03152 5.4987,1.81474 7.63223,5.21914 7.63223,12.1785 l 0,5.86514 17.40661,0 17.40661,0 -18.94984,-40.25 c -10.42241,-22.1375 -21.48769,-45.74207 -24.58952,-52.4546 l -5.63967,-12.20459 -3.34557,11.63886 c -9.2441,32.1593 -24.57453,57.93905 -48.47764,81.52033 l -11.91036,11.75 16.90098,0 16.90097,0 6.39872,-6.01212 z M 393,688.5651 c 0,-3.10277 -1.77234,-7.80008 -3.31256,-8.77944 -3.83372,-2.43769 -12.17188,0.99199 -18.6427,7.66818 L 367.60767,691 l 12.69616,0 12.69617,0 0,-2.4349 z m 5.74799,-7.40504 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z m 212.74829,-16.03291 c 7.74212,-5.12044 27.44294,-24.0998 32.31035,-31.12715 1.71428,-2.475 4.47402,-7.05472 6.13275,-10.17715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -2.2484,-14.29296 -3.89748,-23.36713 -4.5182,-24.86174 -0.37422,-0.90104 -2.42531,-6.5704 -4.55798,-12.59858 -6.53757,-18.47892 -18.84362,-36.78421 -34.49293,-51.30831 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.08608,-1.75732 -7.48431,-4.58501 -20.005,-8.8412 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.91756,-0.28666 -2.06791,-0.0709 -1.14813,1.64778 0.58212,1.08769 16.79888,27.88853 36.03724,59.55741 32.54666,53.57612 34.85154,57.67311 33.14812,58.92193 -1.00689,0.73818 -8.13071,4.77873 -15.83071,8.97899 -39.02847,21.28963 -69.01853,42.10936 -77.3318,53.68538 l -3.31335,4.61376 2.08466,3.37305 c 1.14656,1.85517 2.8406,3.98613 3.76453,4.73546 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.1981,-1.99193 3.9181,-11.51832 8.98697,-16.7338 8.50655,-8.7526 21.51402,-12.1287 33.25329,-8.63093 5.46979,1.62975 12.27455,7.8332 14.69425,13.39579 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.67694,-0.43456 3.46918,-1.36137 2.07852,-1.07484 5.54425,-1.67191 9.56989,-1.64869 10.99408,0.0634 20.50466,7.15695 22.00686,16.41395 1.53795,9.47727 -6.46536,22.07933 -17.4469,27.47201 -7.09564,3.48443 -18.00875,3.96785 -22.54058,0.99848 -2.70719,-1.77381 -2.79724,-1.76213 -5.78275,0.75 -3.5233,2.96466 -4.19272,3.08406 -5.88161,1.04907 -1.03861,-1.25145 -0.52189,-2.2968 3.08941,-6.25 2.38514,-2.61095 4.683,-4.89443 5.10634,-5.07438 0.42335,-0.17995 1.79122,0.86037 3.03971,2.31183 1.55546,1.80833 3.63091,2.82157 6.59347,3.21893 4.17268,0.55967 4.51538,0.39184 9.82548,-4.81184 8.83203,-8.65503 10.31914,-13.6121 6.25366,-20.84565 -3.66909,-6.52827 -12.54423,-9.82342 -17.57685,-6.52592 -2.54252,1.66592 -2.72225,1.66237 -3.99558,-0.079 C 575.59999,305.43827 575,304.11702 575,303.50504 c 0,-1.765 -6.08282,-7.07501 -11,-9.60248 -3.69439,-1.89894 -6.47458,-2.38387 -15.52961,-2.70872 l -11.0296,-0.3957 -4.26892,4.63123 C 528.97569,299.98169 525,307.50184 525,310.88674 c 0,2.16783 3.44697,5.39525 18.63271,17.44599 38.61872,30.6461 69.36138,63.96389 87.08319,94.37764 3.37757,5.7965 5.2251,8.0551 6.2841,7.68226 9.44289,-3.3245 15.72178,-2.8247 20.15046,1.60399 2.44684,2.44683 2.84954,3.63238 2.84954,8.38894 0,5.84738 -2.62892,14.26622 -6.60184,21.14167 l -2.3271,4.02724 2.01621,6.47276 c 6.16607,19.79531 8.36988,37.55337 7.61271,61.34233 -0.43963,13.81242 -1.1772,20.98841 -3.09688,30.13044 -8.16604,38.88876 -26.00148,71.22214 -57.05087,103.42598 L 590.5,677.35196 l 7,-3.79883 c 3.85,-2.08936 10.14832,-5.88105 13.99628,-8.42598 z m 39.17039,-65.79382 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 1.08573,-1.52477 3.36531,-3.34858 5.06574,-4.05292 2.62433,-1.08704 3.32417,-1.04813 4.62968,0.25738 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 421,562.20136 c 20.01211,-9.80247 30.37803,-16.46958 39.0898,-25.14162 9.17729,-9.13543 9.4346,-9.77559 6.2994,-15.6721 -6.36244,-11.96611 -18.74828,-24.50189 -45.88247,-46.43795 -9.3537,-7.5618 -18.32842,-15.14395 -19.94382,-16.84921 C 398.94751,456.39522 397.29938,455 396.9004,455 c -0.39898,0 -0.94714,22.3875 -1.21814,49.75 -0.38077,38.44627 -0.84707,51.9085 -2.0523,59.25 -0.85776,5.225 -1.57541,10.04368 -1.59477,10.70818 -0.0408,1.40132 5.12173,-0.82784 28.96481,-12.50682 z m -14.33333,-48.86803 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 2.63084,-3.69467 7.46851,-5.74397 9.52685,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 648.90032,446.8151 c 0.10686,-5.0225 -1.28607,-9.80426 -3.21288,-11.02944 -0.65309,-0.41527 -2.60759,-0.76193 -4.34333,-0.77035 l -3.1559,-0.0153 4.6559,10.34347 c 4.97615,11.05495 5.8478,11.26676 6.05621,1.47163 z m -436.14077,-49.46995 0.25954,-48.15485 -5.25954,-0.66329 c -13.07679,-1.64914 -22.21009,-7.53136 -25.16664,-16.20835 -4.54345,-13.33429 0.52047,-34.07822 10.93487,-44.79385 4.61186,-4.74526 13.21367,-9.49764 17.22222,-9.51504 L 213,278 l 0,-78.5 c 0,-62.29958 0.259,-78.5 1.25498,-78.5 0.69024,0 41.65846,4.48728 91.04049,9.97173 l 89.7855,9.97173 7.70952,-7.63594 c 4.24023,-4.19976 11.21772,-10.72778 15.50554,-14.5067 l 7.79604,-6.87076 -104.79604,0.32138 -104.79603,0.32138 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 109.08343,183.88282 100,201.4483 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604651,8.63515 -1.795723,19.51596 -2.098834,119.52066 L 91.933768,454.54132 152.21688,450.02066 212.5,445.5 212.75955,397.34515 z M 96.666667,393.33333 c -1.34912,-1.34912 -0.610152,-6.60396 1.307387,-9.29689 2.630836,-3.69467 7.468506,-5.74397 9.526846,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 29.55365,-140.42605 c -2.18879,-1.23967 -5.02357,-4.04476 -6.29951,-6.23355 -4.65931,-7.99272 -1.55939,-21.49462 7.77283,-33.85505 7.67457,-10.1649 18.79807,-13.26303 29.58516,-8.24009 5.77291,2.68811 8.90622,6.16482 10.57467,11.73362 3.25811,10.8746 -9.37384,31.89774 -22.44851,37.36069 -5.50857,2.30162 -14.39518,1.94697 -19.18464,-0.76562 z m 17.2808,-3.11036 c 1.7448,-0.90227 4.10904,-4.13257 6.6744,-9.11934 3.2038,-6.22782 4.0461,-9.02422 4.35273,-14.45085 C 162.46108,205.83425 158.31695,201 148.08446,201 c -4.17702,0 -5.60201,0.51551 -8.52912,3.08555 -8.35856,7.33892 -13.0523,24.65324 -8.59925,31.721 1.14582,1.81861 3.53694,3.9385 5.3136,4.71086 4.18177,1.81793 11.1025,1.8586 14.53149,0.0854 z m 18.66993,-22.15026 c 1.99478,-6.34195 1.56995,-11.64471 -1.17601,-14.67896 -2.16635,-2.39379 -7.25939,-5.14263 -8.0547,-4.34733 -0.31555,0.31556 -0.0677,0.57374 0.55078,0.57374 1.69839,0 5.93039,7.96193 6.66512,12.5395 0.3566,2.22172 0.22344,5.93073 -0.29593,8.24224 -1.33113,5.92443 0.20015,4.38092 2.31074,-2.32919 z m 485.27688,218.70751 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z M 211.41821,343.39301 C 212.80828,342.85959 213,339.4053 213,314.89301 L 213,287 l -6.37264,0 c -6.28408,0 -6.43106,0.0634 -10.57626,4.56039 -4.44579,4.82311 -6.47568,8.78581 -8.6773,16.93961 -1.5852,5.87083 -1.7841,16.58257 -0.39768,21.41673 1.83036,6.3821 8.91721,11.54507 17.94433,13.07293 2.51875,0.42631 4.65525,0.82803 4.74776,0.89272 0.0925,0.0647 0.88002,-0.15552 1.75,-0.48937 z m 395.16637,-15.69234 c 1.83053,-2.76096 2.92974,-5.93018 3.20717,-9.24687 0.3685,-4.40534 0.0645,-5.47114 -2.39345,-8.39229 -2.73935,-3.25553 -9.37192,-7.01238 -12.3983,-7.0227 -0.825,-0.003 -0.0265,0.93847 1.77448,2.09174 9.27746,5.94094 10.88321,19.4736 3.35493,28.27425 -1.58838,1.85684 -1.56269,1.8619 1.02035,0.20067 1.45736,-0.93727 3.90304,-3.59443 5.43482,-5.9048 z"
+       id="path3610"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#d2ac43"
+       d="m 464.24418,744.75 c -1.61938,-3.4375 -5.32776,-11.3125 -8.24084,-17.5 l -5.29652,-11.25 -84.36467,0 -84.36467,0 -11.23874,3.38694 c -19.28562,5.81197 -29.35869,7.1213 -54.23874,7.05012 -19.85965,-0.0568 -23.22599,-0.322 -34.60155,-2.72573 -30.53316,-6.45184 -53.94731,-18.7052 -76.52782,-40.04939 C 69.421049,649.68065 49.980714,603.39893 45.047413,540.05011 44.471336,532.65266 44,511.21912 44,492.42 L 44,458.2398 55.5,457.52125 67,456.8027 67.01777,349.15135 C 67.035144,243.85306 67.293758,233.64677 70.366309,217 c 1.524336,-8.2587 5.805294,-22.49738 8.095583,-26.92631 0.805792,-1.55823 2.089787,-4.64638 2.853322,-6.86256 1.372558,-3.98387 2.740384,-6.39656 10.968549,-19.34727 8.269777,-13.01621 10.101677,-15.36961 19.599927,-25.17962 C 128.3936,121.63242 145.70632,109.44042 165,101.27855 179.20986,95.267312 182.04094,94.355031 197.83956,90.696431 L 211.5,87.532985 l 124.80569,-0.289101 124.80568,-0.2891 3.84409,-2.426665 c 3.88418,-2.451977 34.83936,-19.833552 40.7358,-22.873467 l 3.19125,-1.645257 8.03323,13.35057 8.03322,13.350569 12.77552,0.559956 C 544.75102,87.578465 555,88.547988 560.5,89.424985 c 13.41479,2.139041 36.59945,9.743241 45.47655,14.915585 21.20265,12.35397 26.40356,16.21983 40.57489,30.15943 7.828,7.7 15.51879,15.96385 17.09064,18.36411 C 674.4297,169.33708 683,184.65051 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29739,164.60779 -0.30324,165.02565 -2.46297,175.79255 -2.82311,14.07408 -9.47082,33.33611 -14.66251,42.48526 -2.27138,4.0028 -5.02979,8.9876 -6.12979,11.07735 -7.53001,14.30526 -26.49531,34.27214 -48.21379,50.76003 -6.40758,4.8644 -28.63093,15.71305 -40.78621,19.91037 -6.15327,2.12478 -30.16779,7.14806 -38,7.94872 -5.33024,0.5449 -8.31196,1.5064 -12.5,4.03085 -11.78105,7.10131 -28.77024,15.76895 -45.98451,23.46065 C 477.12602,747.3846 468.61926,751 468.11157,751 c -0.50768,0 -2.24801,-2.8125 -3.86739,-6.25 z m 33.57728,-44.21427 C 562.54991,667.5333 603.27373,626.47601 619.38325,577.97852 632.88941,537.31841 629.91367,496.4828 610.53097,456.5 593.31881,420.99459 566.93713,390.60542 521.63807,354.10385 496.93949,334.20197 485.7537,321.05829 481.60912,307.0685 c -2.12544,-7.17432 -2.02977,-10.86919 0.45329,-17.50575 6.31941,-16.89013 29.06664,-37.02816 68.93759,-61.03016 7.975,-4.80089 14.36272,-9.20906 14.19493,-9.79594 -0.16779,-0.58689 -5.53385,-9.65522 -11.92457,-20.15186 C 546.87963,188.08816 534.82794,168.25 526.48883,154.5 c -22.45479,-37.02472 -28.53825,-46.90843 -29.44169,-47.83343 -1.7331,-1.77447 -28.85968,15.6652 -47.02544,30.23262 -12.55497,10.06804 -35.33579,32.26988 -45.25087,44.10081 -22.86562,27.28385 -39.4535,59.70945 -45.29748,88.54646 -11.40471,56.27633 7.62543,109.51861 55.77012,156.03295 6.78613,6.55632 15.1787,14.17059 18.65016,16.92059 39.46621,31.26412 56.35243,48.77352 65.10637,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.82437,7.83174 5.61545,11.68174 2.96223,6.36743 28.30315,60.22126 40.11439,85.25 2.66038,5.6375 5.10291,10.25 5.42785,10.25 0.32494,0 6.29615,-2.90892 13.26934,-6.46427 z m -257.58469,-9.65311 c 28.81263,-3.6286 55.09644,-17.06314 76.35093,-39.02554 19.90765,-20.5707 33.00641,-44.60016 40.37774,-74.07231 5.90181,-23.59664 6.2412,-28.44741 6.75515,-96.54662 l 0.4699,-62.26185 -6.81105,-10.23099 C 340.64144,383.60288 330.55892,358.42847 325.8414,330 c -2.60529,-15.69985 -2.80479,-41.47079 -0.44054,-56.90915 4.35041,-28.40795 15.93367,-58.22876 32.61882,-83.97636 5.30211,-8.18191 6.04349,-9.91316 5.7812,-13.5 L 363.5,171.5 310,165.34318 c -29.425,-3.38626 -55.62966,-6.43822 -58.23259,-6.78214 l -4.73259,-0.62531 -0.2996,192.28214 c -0.28457,182.62842 -0.39157,192.63357 -2.13126,199.28213 -4.14339,15.83477 -13.37043,29.94771 -21.28829,32.56083 -1.92406,0.635 -6.58529,0.98011 -10.35828,0.76692 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42546 c -4.07613,0.46247 -81.00802,6.14881 -95.921094,7.08991 -5.044102,0.31832 -9.679521,0.89298 -10.300931,1.27703 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.53837,30.91997 68.16863,43.16672 116.83093,37.0383 z m 124.84362,-4.91505 c 7.37066,-6.8441 13.37455,-10.72822 19.30587,-12.48964 6.19167,-1.83872 8.77478,-1.85531 13.01517,-0.0836 4.90021,2.04744 6.59857,5.0918 6.59857,11.82814 l 0,5.77749 17.40661,0 17.40661,0 -18.94984,-40.25 c -10.42241,-22.1375 -21.48769,-45.74207 -24.58952,-52.4546 l -5.63967,-12.20459 -3.34557,11.63886 c -9.2441,32.1593 -24.57453,57.93905 -48.47764,81.52033 l -11.91036,11.75 16.88008,0 16.88008,0 5.41961,-5.03243 z M 393,688.5651 c 0,-3.10277 -1.77234,-7.80008 -3.31256,-8.77944 -3.83372,-2.43769 -12.17188,0.99199 -18.6427,7.66818 L 367.60767,691 l 12.69616,0 12.69617,0 0,-2.4349 z m 5.74799,-7.40504 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z m 212.74829,-16.03291 c 7.74212,-5.12044 27.44294,-24.0998 32.31035,-31.12715 1.71428,-2.475 4.47402,-7.05472 6.13275,-10.17715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -2.2484,-14.29296 -3.89748,-23.36713 -4.5182,-24.86174 -0.37422,-0.90104 -2.42531,-6.5704 -4.55798,-12.59858 -6.53757,-18.47892 -18.84362,-36.78421 -34.49293,-51.30831 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.08608,-1.75732 -7.48431,-4.58501 -20.005,-8.8412 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.91756,-0.28666 -2.06791,-0.0709 -1.14813,1.64778 0.58212,1.08769 16.79888,27.88853 36.03724,59.55741 32.54666,53.57612 34.85154,57.67311 33.14812,58.92193 -1.00689,0.73818 -8.13071,4.77873 -15.83071,8.97899 -39.02847,21.28963 -69.01853,42.10936 -77.3318,53.68538 l -3.31335,4.61376 2.08466,3.37305 c 1.14656,1.85517 2.8406,3.98613 3.76453,4.73546 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.1981,-1.99193 3.9181,-11.51832 8.98697,-16.7338 8.50655,-8.7526 21.51402,-12.1287 33.25329,-8.63093 5.46979,1.62975 12.27455,7.8332 14.69425,13.39579 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.67694,-0.43456 3.46918,-1.36137 2.07852,-1.07484 5.54425,-1.67191 9.56989,-1.64869 11.04048,0.0637 20.17466,6.88838 21.88558,16.352 1.71545,9.4887 -6.20933,22.08031 -17.32562,27.52849 -6.94089,3.40179 -16.62995,3.87178 -22.07612,1.07086 -3.31967,-1.70728 -3.42063,-1.69531 -6.32672,0.75 -3.44122,2.8956 -4.11889,3.01031 -5.8021,0.98216 -1.03861,-1.25145 -0.52189,-2.2968 3.08941,-6.25 2.38514,-2.61095 4.683,-4.89443 5.10634,-5.07438 0.42335,-0.17995 1.79122,0.86037 3.03971,2.31183 1.55546,1.80833 3.63091,2.82157 6.59347,3.21893 4.17268,0.55967 4.51538,0.39184 9.82548,-4.81184 8.83203,-8.65503 10.31914,-13.6121 6.25366,-20.84565 -3.66909,-6.52827 -12.54423,-9.82342 -17.57685,-6.52592 -2.54252,1.66592 -2.72225,1.66237 -3.99558,-0.079 C 575.59999,305.43827 575,304.11702 575,303.50504 c 0,-1.765 -6.08282,-7.07501 -11,-9.60248 -3.69439,-1.89894 -6.47458,-2.38387 -15.52961,-2.70872 l -11.0296,-0.3957 -4.26892,4.63123 C 528.97569,299.98169 525,307.50184 525,310.88674 c 0,2.16783 3.44697,5.39525 18.63271,17.44599 37.83671,30.02553 65.43201,59.63195 85.71293,91.95961 3.03375,4.83578 5.65957,9.19723 5.83514,9.6921 0.17557,0.49488 2.85527,0.19109 5.95489,-0.67507 7.09298,-1.98208 12.2029,-1.12465 16.01479,2.68725 4.90482,4.90481 3.8664,14.35131 -3.08031,28.02154 l -2.92854,5.76299 1.98093,6.35943 c 6.12868,19.67496 8.33309,37.48761 7.57744,61.22898 -0.43963,13.81242 -1.1772,20.98841 -3.09688,30.13044 -8.16604,38.88876 -26.00148,71.22214 -57.05087,103.42598 L 590.5,677.35196 l 7,-3.79883 c 3.85,-2.08936 10.14832,-5.88105 13.99628,-8.42598 z m 39.17039,-65.79382 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 1.08573,-1.52477 3.36531,-3.34858 5.06574,-4.05292 2.62433,-1.08704 3.32417,-1.04813 4.62968,0.25738 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 421,562.20136 c 20.01211,-9.80247 30.37803,-16.46958 39.0898,-25.14162 9.17729,-9.13543 9.4346,-9.77559 6.2994,-15.6721 -6.36244,-11.96611 -18.74828,-24.50189 -45.88247,-46.43795 -9.3537,-7.5618 -18.32842,-15.14395 -19.94382,-16.84921 C 398.94751,456.39522 397.29938,455 396.9004,455 c -0.39898,0 -0.94714,22.3875 -1.21814,49.75 -0.38077,38.44627 -0.84707,51.9085 -2.0523,59.25 -0.85776,5.225 -1.57541,10.04368 -1.59477,10.70818 -0.0408,1.40132 5.12173,-0.82784 28.96481,-12.50682 z m -14.33333,-48.86803 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 2.63084,-3.69467 7.46851,-5.74397 9.52685,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 648.90032,446.8151 c 0.10686,-5.0225 -1.28607,-9.80426 -3.21288,-11.02944 -0.65309,-0.41527 -2.60759,-0.76193 -4.34333,-0.77035 l -3.1559,-0.0153 4.6559,10.34347 c 4.97615,11.05495 5.8478,11.26676 6.05621,1.47163 z M 212.75215,397 l 0.25214,-48.5 -5.25214,-0.24961 c -11.65445,-0.55389 -22.19342,-7.22755 -25.15924,-15.93173 -4.54345,-13.33429 0.52047,-34.07822 10.93487,-44.79385 4.61186,-4.74526 13.21367,-9.49764 17.22222,-9.51504 L 213,278 l 0,-78.5 c 0,-62.29958 0.259,-78.5 1.25498,-78.5 0.69024,0 41.65846,4.48728 91.04049,9.97173 l 89.7855,9.97173 7.70952,-7.63594 c 4.24023,-4.19976 11.21772,-10.72778 15.50554,-14.5067 l 7.79604,-6.87076 -104.79604,0.32138 -104.79603,0.32138 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 109.08343,183.88282 100,201.4483 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604651,8.63515 -1.795723,19.51596 -2.098834,119.52066 L 91.933768,454.54132 152.21688,450.02066 212.5,445.5 212.75215,397 z M 96.666667,393.33333 c -1.34912,-1.34912 -0.610152,-6.60396 1.307387,-9.29689 2.630836,-3.69467 7.468506,-5.74397 9.526846,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 29.55365,-140.42605 c -2.18879,-1.23967 -5.02357,-4.04476 -6.29951,-6.23355 -1.95088,-3.3466 -2.2555,-5.02852 -1.91506,-10.57374 0.68633,-11.17903 9.23267,-26.03008 17.72682,-30.80406 12.18626,-6.84906 28.42458,-1.32092 32.09383,10.92594 3.2855,10.96602 -9.28458,31.96209 -22.42144,37.45103 -5.50857,2.30162 -14.39518,1.94697 -19.18464,-0.76562 z m 17.2808,-3.11036 c 1.7448,-0.90227 4.10904,-4.13257 6.6744,-9.11934 3.2038,-6.22782 4.0461,-9.02422 4.35273,-14.45085 C 162.46108,205.83425 158.31695,201 148.08446,201 c -4.17702,0 -5.60201,0.51551 -8.52912,3.08555 -8.35856,7.33892 -13.0523,24.65324 -8.59925,31.721 1.14582,1.81861 3.53694,3.9385 5.3136,4.71086 4.18177,1.81793 11.1025,1.8586 14.53149,0.0854 z m 18.66993,-22.15026 c 1.99478,-6.34195 1.56995,-11.64471 -1.17601,-14.67896 -2.16635,-2.39379 -7.25939,-5.14263 -8.0547,-4.34733 -0.31555,0.31556 -0.0677,0.57374 0.55078,0.57374 1.69839,0 5.93039,7.96193 6.66512,12.5395 0.3566,2.22172 0.22344,5.93073 -0.29593,8.24224 -1.33113,5.92443 0.20015,4.38092 2.31074,-2.32919 z m 485.27688,218.70751 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z M 211.41821,343.39301 C 212.80828,342.85959 213,339.4053 213,314.89301 L 213,287 l -6.37264,0 c -6.28408,0 -6.43106,0.0634 -10.57626,4.56039 -4.44579,4.82311 -6.47568,8.78581 -8.6773,16.93961 -1.5852,5.87083 -1.7841,16.58257 -0.39768,21.41673 1.83036,6.3821 8.91721,11.54507 17.94433,13.07293 2.51875,0.42631 4.65525,0.82803 4.74776,0.89272 0.0925,0.0647 0.88002,-0.15552 1.75,-0.48937 z m 395.16637,-15.69234 c 1.83053,-2.76096 2.92974,-5.93018 3.20717,-9.24687 0.3685,-4.40534 0.0645,-5.47114 -2.39345,-8.39229 -2.73935,-3.25553 -9.37192,-7.01238 -12.3983,-7.0227 -0.825,-0.003 -0.0265,0.93847 1.77448,2.09174 9.27746,5.94094 10.88321,19.4736 3.35493,28.27425 -1.58838,1.85684 -1.56269,1.8619 1.02035,0.20067 1.45736,-0.93727 3.90304,-3.59443 5.43482,-5.9048 z"
+       id="path3608"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#cdaa46"
+       d="m 464.24418,744.75 c -1.61938,-3.4375 -5.32776,-11.3125 -8.24084,-17.5 l -5.29652,-11.25 -84.36467,0 -84.36467,0 -11.23874,3.38694 c -19.28562,5.81197 -29.35869,7.1213 -54.23874,7.05012 -19.85965,-0.0568 -23.22599,-0.322 -34.60155,-2.72573 -30.53316,-6.45184 -53.94731,-18.7052 -76.52782,-40.04939 C 69.421049,649.68065 49.980714,603.39893 45.047413,540.05011 44.471336,532.65266 44,511.21912 44,492.42 L 44,458.2398 55.5,457.52125 67,456.8027 67.01777,349.15135 C 67.035144,243.85306 67.293758,233.64677 70.366309,217 c 1.524336,-8.2587 5.805294,-22.49738 8.095583,-26.92631 0.805792,-1.55823 2.089787,-4.64638 2.853322,-6.86256 1.372558,-3.98387 2.740384,-6.39656 10.968549,-19.34727 8.269777,-13.01621 10.101677,-15.36961 19.599927,-25.17962 C 128.3936,121.63242 145.70632,109.44042 165,101.27855 179.20986,95.267312 182.04094,94.355031 197.83956,90.696431 L 211.5,87.532985 l 124.80569,-0.289101 124.80568,-0.2891 3.84409,-2.426665 c 3.88418,-2.451977 34.83936,-19.833552 40.7358,-22.873467 l 3.19125,-1.645257 8.03323,13.35057 8.03322,13.350569 12.77552,0.559956 C 544.75102,87.578465 555,88.547988 560.5,89.424985 c 13.41479,2.139041 36.59945,9.743241 45.47655,14.915585 21.20265,12.35397 26.40356,16.21983 40.57489,30.15943 7.828,7.7 15.51879,15.96385 17.09064,18.36411 C 674.4297,169.33708 683,184.65051 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29739,164.60779 -0.30324,165.02565 -2.46297,175.79255 -2.82311,14.07408 -9.47082,33.33611 -14.66251,42.48526 -2.27138,4.0028 -5.02979,8.9876 -6.12979,11.07735 -7.53001,14.30526 -26.49531,34.27214 -48.21379,50.76003 -6.40758,4.8644 -28.63093,15.71305 -40.78621,19.91037 -6.15327,2.12478 -30.16779,7.14806 -38,7.94872 -5.33024,0.5449 -8.31196,1.5064 -12.5,4.03085 -11.78105,7.10131 -28.77024,15.76895 -45.98451,23.46065 C 477.12602,747.3846 468.61926,751 468.11157,751 c -0.50768,0 -2.24801,-2.8125 -3.86739,-6.25 z m 33.57728,-44.21427 C 562.54991,667.5333 603.27373,626.47601 619.38325,577.97852 632.88941,537.31841 629.91367,496.4828 610.53097,456.5 593.31881,420.99459 566.93713,390.60542 521.63807,354.10385 496.93949,334.20197 485.7537,321.05829 481.60912,307.0685 c -2.12544,-7.17432 -2.02977,-10.86919 0.45329,-17.50575 6.31941,-16.89013 29.06664,-37.02816 68.93759,-61.03016 7.975,-4.80089 14.36272,-9.20906 14.19493,-9.79594 -0.16779,-0.58689 -5.53385,-9.65522 -11.92457,-20.15186 C 546.87963,188.08816 534.82794,168.25 526.48883,154.5 c -22.45479,-37.02472 -28.53825,-46.90843 -29.44169,-47.83343 -1.7331,-1.77447 -28.85968,15.6652 -47.02544,30.23262 -12.55497,10.06804 -35.33579,32.26988 -45.25087,44.10081 -22.86562,27.28385 -39.4535,59.70945 -45.29748,88.54646 -11.40471,56.27633 7.62543,109.51861 55.77012,156.03295 6.78613,6.55632 15.1787,14.17059 18.65016,16.92059 39.46621,31.26412 56.35243,48.77352 65.10637,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.82437,7.83174 5.61545,11.68174 2.96223,6.36743 28.30315,60.22126 40.11439,85.25 2.66038,5.6375 5.10291,10.25 5.42785,10.25 0.32494,0 6.29615,-2.90892 13.26934,-6.46427 z m -257.58469,-9.65311 c 28.81263,-3.6286 55.09644,-17.06314 76.35093,-39.02554 19.90765,-20.5707 33.00641,-44.60016 40.37774,-74.07231 5.90181,-23.59664 6.2412,-28.44741 6.75515,-96.54662 l 0.4699,-62.26185 -6.81105,-10.23099 C 340.64144,383.60288 330.55892,358.42847 325.8414,330 c -2.60529,-15.69985 -2.80479,-41.47079 -0.44054,-56.90915 4.35041,-28.40795 15.93367,-58.22876 32.61882,-83.97636 5.30211,-8.18191 6.04349,-9.91316 5.7812,-13.5 L 363.5,171.5 310,165.34318 c -29.425,-3.38626 -55.62966,-6.43822 -58.23259,-6.78214 l -4.73259,-0.62531 -0.2996,192.28214 c -0.28457,182.62842 -0.39157,192.63357 -2.13126,199.28213 -4.14339,15.83477 -13.37043,29.94771 -21.28829,32.56083 -1.92406,0.635 -6.58529,0.98011 -10.35828,0.76692 -8.08882,-0.45706 -10.15598,-1.94976 -14.76904,-10.66473 -7.33195,-13.85146 -11.18017,-39.93463 -11.18592,-75.81786 L 187,481.19031 l -3.75,0.42546 c -4.07613,0.46247 -81.00802,6.14881 -95.921094,7.08991 -5.044102,0.31832 -9.679521,0.89298 -10.300931,1.27703 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 29.53837,30.91997 68.16863,43.16672 116.83093,37.0383 z m 124.84362,-4.91505 c 7.37066,-6.8441 13.37455,-10.72822 19.30587,-12.48964 6.19167,-1.83872 8.77478,-1.85531 13.01517,-0.0836 4.90021,2.04744 6.59857,5.0918 6.59857,11.82814 l 0,5.77749 17.40661,0 17.40661,0 -18.94984,-40.25 c -10.42241,-22.1375 -21.48769,-45.74207 -24.58952,-52.4546 l -5.63967,-12.20459 -3.34557,11.63886 c -9.2441,32.1593 -24.57453,57.93905 -48.47764,81.52033 l -11.91036,11.75 16.88008,0 16.88008,0 5.41961,-5.03243 z M 393,688.5651 c 0,-3.10277 -1.77234,-7.80008 -3.31256,-8.77944 -3.83372,-2.43769 -12.17188,0.99199 -18.6427,7.66818 L 367.60767,691 l 12.69616,0 12.69617,0 0,-2.4349 z m 5.74799,-7.40504 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z m 212.74829,-16.03291 c 7.74212,-5.12044 27.44294,-24.0998 32.31035,-31.12715 1.71428,-2.475 4.47402,-7.05472 6.13275,-10.17715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 3.48558,-2.15421 12.15662,-27.93864 14.92465,-44.38033 2.05295,-12.1942 2.0822,-14.68959 1.99906,-170.5 C 670.86921,315.6561 670.4419,242.025 669.96604,239 c -2.2484,-14.29296 -3.89748,-23.36713 -4.5182,-24.86174 -0.37422,-0.90104 -2.42531,-6.5704 -4.55798,-12.59858 -6.53757,-18.47892 -18.84362,-36.78421 -34.49293,-51.30831 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.08608,-1.75732 -7.48431,-4.58501 -20.005,-8.8412 -10.12949,-3.44334 -17.17545,-4.99709 -34.20652,-7.54307 -1.91756,-0.28666 -2.06791,-0.0709 -1.14813,1.64778 0.58212,1.08769 16.79888,27.88853 36.03724,59.55741 32.54666,53.57612 34.85154,57.67311 33.14812,58.92193 -1.00689,0.73818 -8.13071,4.77873 -15.83071,8.97899 -39.02847,21.28963 -69.01853,42.10936 -77.3318,53.68538 l -3.31335,4.61376 2.08466,3.37305 c 1.14656,1.85517 2.8406,3.98613 3.76453,4.73546 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.1981,-1.99193 3.9181,-11.51832 8.98697,-16.7338 8.50655,-8.7526 21.51402,-12.1287 33.25329,-8.63093 5.46979,1.62975 12.27455,7.8332 14.69425,13.39579 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.67694,-0.43456 3.46918,-1.36137 2.07852,-1.07484 5.54425,-1.67191 9.56989,-1.64869 11.04048,0.0637 20.17466,6.88838 21.88558,16.352 1.71545,9.4887 -6.20933,22.08031 -17.32562,27.52849 -6.94089,3.40179 -16.62995,3.87178 -22.07612,1.07086 -3.31967,-1.70728 -3.42063,-1.69531 -6.32672,0.75 -3.44122,2.8956 -4.11889,3.01031 -5.8021,0.98216 -1.03861,-1.25145 -0.52189,-2.2968 3.08941,-6.25 2.38514,-2.61095 4.683,-4.89443 5.10634,-5.07438 0.42335,-0.17995 1.79122,0.86037 3.03971,2.31183 1.55546,1.80833 3.63091,2.82157 6.59347,3.21893 4.17268,0.55967 4.51538,0.39184 9.82548,-4.81184 8.83203,-8.65503 10.31914,-13.6121 6.25366,-20.84565 -3.66909,-6.52827 -12.54423,-9.82342 -17.57685,-6.52592 -2.54252,1.66592 -2.72225,1.66237 -3.99558,-0.079 C 575.59999,305.43827 575,304.11702 575,303.50504 c 0,-1.765 -6.08282,-7.07501 -11,-9.60248 -3.69439,-1.89894 -6.47458,-2.38387 -15.52961,-2.70872 l -11.0296,-0.3957 -4.26892,4.63123 C 528.97569,299.98169 525,307.50184 525,310.88674 c 0,2.16783 3.44697,5.39525 18.63271,17.44599 37.83671,30.02553 65.43201,59.63195 85.71293,91.95961 3.03375,4.83578 5.65957,9.19723 5.83514,9.6921 0.17557,0.49488 2.85527,0.19109 5.95489,-0.67507 7.09298,-1.98208 12.2029,-1.12465 16.01479,2.68725 4.90482,4.90481 3.8664,14.35131 -3.08031,28.02154 l -2.92854,5.76299 1.98093,6.35943 c 6.12868,19.67496 8.33309,37.48761 7.57744,61.22898 -0.43963,13.81242 -1.1772,20.98841 -3.09688,30.13044 -8.16604,38.88876 -26.00148,71.22214 -57.05087,103.42598 L 590.5,677.35196 l 7,-3.79883 c 3.85,-2.08936 10.14832,-5.88105 13.99628,-8.42598 z m 39.17039,-65.79382 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 1.08573,-1.52477 3.36531,-3.34858 5.06574,-4.05292 2.62433,-1.08704 3.32417,-1.04813 4.62968,0.25738 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 421,562.20136 c 20.01211,-9.80247 30.37803,-16.46958 39.0898,-25.14162 9.17729,-9.13543 9.4346,-9.77559 6.2994,-15.6721 -6.36244,-11.96611 -18.74828,-24.50189 -45.88247,-46.43795 -9.3537,-7.5618 -18.32842,-15.14395 -19.94382,-16.84921 C 398.94751,456.39522 397.29938,455 396.9004,455 c -0.39898,0 -0.94714,22.3875 -1.21814,49.75 -0.38077,38.44627 -0.84707,51.9085 -2.0523,59.25 -0.85776,5.225 -1.57541,10.04368 -1.59477,10.70818 -0.0408,1.40132 5.12173,-0.82784 28.96481,-12.50682 z m -14.33333,-48.86803 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 2.63084,-3.69467 7.46851,-5.74397 9.52685,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 648.90032,446.8151 c 0.10686,-5.0225 -1.28607,-9.80426 -3.21288,-11.02944 -0.65309,-0.41527 -2.60759,-0.76193 -4.34333,-0.77035 l -3.1559,-0.0153 4.6559,10.34347 c 4.97615,11.05495 5.8478,11.26676 6.05621,1.47163 z M 212.75215,397 l 0.25214,-48.5 -5.25214,-0.24961 c -11.65445,-0.55389 -22.19342,-7.22755 -25.15924,-15.93173 -4.54345,-13.33429 0.52047,-34.07822 10.93487,-44.79385 4.61186,-4.74526 13.21367,-9.49764 17.22222,-9.51504 L 213,278 l 0,-78.5 c 0,-62.29958 0.259,-78.5 1.25498,-78.5 0.69024,0 41.65846,4.48728 91.04049,9.97173 l 89.7855,9.97173 7.70952,-7.63594 c 4.24023,-4.19976 11.21772,-10.72778 15.50554,-14.5067 l 7.79604,-6.87076 -104.79604,0.32138 -104.79603,0.32138 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 109.08343,183.88282 100,201.4483 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604651,8.63515 -1.795723,19.51596 -2.098834,119.52066 L 91.933768,454.54132 152.21688,450.02066 212.5,445.5 212.75215,397 z M 96.666667,393.33333 c -1.34912,-1.34912 -0.610152,-6.60396 1.307387,-9.29689 2.630836,-3.69467 7.468506,-5.74397 9.526846,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 29.55365,-140.42605 c -2.18879,-1.23967 -5.02357,-4.04476 -6.29951,-6.23355 -1.95088,-3.3466 -2.2555,-5.02852 -1.91506,-10.57374 0.68633,-11.17903 9.23267,-26.03008 17.72682,-30.80406 12.18626,-6.84906 28.42458,-1.32092 32.09383,10.92594 3.2855,10.96602 -9.28458,31.96209 -22.42144,37.45103 -5.50857,2.30162 -14.39518,1.94697 -19.18464,-0.76562 z m 17.2808,-3.11036 c 1.7448,-0.90227 4.10904,-4.13257 6.6744,-9.11934 3.2038,-6.22782 4.0461,-9.02422 4.35273,-14.45085 C 162.46108,205.83425 158.31695,201 148.08446,201 c -4.17702,0 -5.60201,0.51551 -8.52912,3.08555 -8.35856,7.33892 -13.0523,24.65324 -8.59925,31.721 1.14582,1.81861 3.53694,3.9385 5.3136,4.71086 4.18177,1.81793 11.1025,1.8586 14.53149,0.0854 z m 18.66993,-22.15026 c 1.99478,-6.34195 1.56995,-11.64471 -1.17601,-14.67896 -2.16635,-2.39379 -7.25939,-5.14263 -8.0547,-4.34733 -0.31555,0.31556 -0.0677,0.57374 0.55078,0.57374 1.69839,0 5.93039,7.96193 6.66512,12.5395 0.3566,2.22172 0.22344,5.93073 -0.29593,8.24224 -1.33113,5.92443 0.20015,4.38092 2.31074,-2.32919 z m 485.27688,218.70751 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z M 211.41821,343.39301 C 212.80828,342.85959 213,339.4053 213,314.89301 L 213,287 l -6.37264,0 c -6.28408,0 -6.43106,0.0634 -10.57626,4.56039 -4.44579,4.82311 -6.47568,8.78581 -8.6773,16.93961 -1.5852,5.87083 -1.7841,16.58257 -0.39768,21.41673 1.83036,6.3821 8.91721,11.54507 17.94433,13.07293 2.51875,0.42631 4.65525,0.82803 4.74776,0.89272 0.0925,0.0647 0.88002,-0.15552 1.75,-0.48937 z m 395.16637,-15.69234 c 1.83053,-2.76096 2.92974,-5.93018 3.20717,-9.24687 0.3685,-4.40534 0.0645,-5.47114 -2.39345,-8.39229 -2.73935,-3.25553 -9.37192,-7.01238 -12.3983,-7.0227 -0.825,-0.003 -0.0265,0.93847 1.77448,2.09174 9.27746,5.94094 10.88321,19.4736 3.35493,28.27425 -1.58838,1.85684 -1.56269,1.8619 1.02035,0.20067 1.45736,-0.93727 3.90304,-3.59443 5.43482,-5.9048 z"
+       id="path3606"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#d4aa3f"
+       d="m 464.24418,744.75 c -1.61938,-3.4375 -5.32776,-11.3125 -8.24084,-17.5 l -5.29652,-11.25 -84.36467,0 -84.36467,0 -11.23874,3.38694 c -19.28562,5.81197 -29.35869,7.1213 -54.23874,7.05012 -19.85965,-0.0568 -23.22599,-0.322 -34.60155,-2.72573 -30.53316,-6.45184 -53.94731,-18.7052 -76.52782,-40.04939 C 69.421049,649.68065 49.980714,603.39893 45.047413,540.05011 44.471336,532.65266 44,511.21912 44,492.42 L 44,458.2398 55.5,457.52125 67,456.8027 67.01777,349.15135 C 67.035144,243.85306 67.293758,233.64677 70.366309,217 c 1.524336,-8.2587 5.805294,-22.49738 8.095583,-26.92631 0.805792,-1.55823 2.089787,-4.64638 2.853322,-6.86256 1.372558,-3.98387 2.740384,-6.39656 10.968549,-19.34727 8.269777,-13.01621 10.101677,-15.36961 19.599927,-25.17962 C 128.3936,121.63242 145.70632,109.44042 165,101.27855 179.20986,95.267312 182.04094,94.355031 197.83956,90.696431 L 211.5,87.532985 l 124.80569,-0.289101 124.80568,-0.2891 3.84409,-2.426665 c 3.88418,-2.451977 34.83936,-19.833552 40.7358,-22.873467 l 3.19125,-1.645257 8.03323,13.35057 8.03322,13.350569 12.77552,0.559956 C 544.75102,87.578465 555,88.547988 560.5,89.424985 c 13.41479,2.139041 36.59945,9.743241 45.47655,14.915585 21.20265,12.35397 26.40356,16.21983 40.57489,30.15943 7.828,7.7 15.51879,15.96385 17.09064,18.36411 C 674.4297,169.33708 683,184.65051 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29739,164.60779 -0.30324,165.02565 -2.46297,175.79255 -2.82311,14.07408 -9.47082,33.33611 -14.66251,42.48526 -2.27138,4.0028 -5.02979,8.9876 -6.12979,11.07735 -7.53001,14.30526 -26.49531,34.27214 -48.21379,50.76003 -6.40758,4.8644 -28.63093,15.71305 -40.78621,19.91037 -6.15327,2.12478 -30.16779,7.14806 -38,7.94872 -5.33024,0.5449 -8.31196,1.5064 -12.5,4.03085 -11.78105,7.10131 -28.77024,15.76895 -45.98451,23.46065 C 477.12602,747.3846 468.61926,751 468.11157,751 c -0.50768,0 -2.24801,-2.8125 -3.86739,-6.25 z m 33.57728,-44.21427 c 64.50687,-32.88945 106.28606,-74.9627 121.5996,-122.45544 13.41627,-41.60866 10.52183,-81.28707 -8.86898,-121.58029 -16.903,-35.12366 -43.63985,-65.91464 -88.91401,-102.39615 -24.48971,-19.73358 -34.79605,-31.73052 -39.65818,-46.16355 -2.51317,-7.46024 -2.49509,-11.48829 0.0825,-18.37755 6.47576,-17.30803 31.90638,-39.40536 73.1497,-63.5617 9.57826,-5.61002 10.60282,-6.47834 9.67955,-8.20348 -0.56791,-1.06115 -6.02816,-10.11221 -12.1339,-20.11347 -6.10573,-10.00125 -17.92331,-29.4341 -26.26129,-43.1841 -22.09656,-36.43902 -28.53591,-46.8982 -29.44933,-47.83343 -1.7331,-1.77447 -28.85968,15.6652 -47.02544,30.23262 -12.55497,10.06804 -35.33579,32.26988 -45.25087,44.10081 -22.86562,27.28385 -39.4535,59.70945 -45.29748,88.54646 -11.40094,56.25774 7.49271,109.18168 55.67485,155.95354 6.799,6.6 15.21828,14.25 18.7095,17 38.83412,30.58924 56.39539,48.78857 65.1423,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.72078,7.60674 5.38526,11.18174 5.95369,12.78749 34.13931,72.7215 39.62089,84.25 3.07279,6.4625 5.84687,11.75 6.16462,11.75 0.31775,0 6.28307,-2.90892 13.25626,-6.46427 z M 229,691.98749 c 15.09509,-1.16792 25.66791,-3.22658 37,-7.20439 45.16593,-15.8542 80.26613,-58.11109 92.02074,-110.7831 4.90732,-21.98958 5.21704,-27.02944 5.70109,-92.76949 l 0.45849,-62.26948 -6.80597,-10.22336 C 340.6417,383.60326 330.55839,358.42527 325.8414,330 c -2.60529,-15.69985 -2.80479,-41.47079 -0.44054,-56.90915 4.34516,-28.37366 15.93603,-58.23269 32.56795,-83.89769 4.93666,-7.61786 6.03115,-10.06781 6.03094,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.29963,192.37152 c -0.33626,215.89031 0.33023,197.4683 -7.75755,214.4203 -6.94716,14.56126 -14.57608,19.51296 -28.06594,18.21675 -5.98593,-0.57517 -8.54401,-2.70684 -12.7234,-10.60252 -7.33991,-13.86649 -11.15774,-39.91968 -11.17957,-76.29018 L 187,481.24567 l -4.25,0.40667 c -5.78671,0.5537 -82.883987,6.2596 -94.928341,7.02556 -5.323087,0.33852 -10.183506,0.9277 -10.80093,1.30929 -1.433872,0.88618 0.277225,39.51845 2.509949,56.66835 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.08039,-6.01992 c 7.37066,-6.8441 13.37455,-10.72822 19.30587,-12.48964 6.19167,-1.83872 8.77478,-1.85531 13.01517,-0.0836 4.90021,2.04744 6.59857,5.0918 6.59857,11.82814 l 0,5.77749 17.43363,0 17.43363,0 -10.74457,-22.75 c -5.90952,-12.5125 -16.99256,-36.09759 -24.62898,-52.41132 l -13.8844,-29.66132 -3.23059,11.16132 c -9.97117,34.44927 -27.69934,63.35818 -53.00725,86.43772 l -7.87147,7.17838 17.08039,0.0226 17.08039,0.0226 5.41961,-5.03243 z M 393,688.5651 c 0,-3.10277 -1.77234,-7.80008 -3.31256,-8.77944 -3.83372,-2.43769 -12.17188,0.99199 -18.6427,7.66818 L 367.60767,691 l 12.69616,0 12.69617,0 0,-2.4349 z m 5.74799,-7.40504 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z m 212.74829,-16.03291 c 7.74212,-5.12044 27.44294,-24.0998 32.31035,-31.12715 1.71428,-2.475 4.47402,-7.05472 6.13275,-10.17715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 1.91127,-1.18123 4.74782,-7.90311 9.28584,-22.005 8.16378,-25.36894 7.74779,-14.86691 7.64482,-193 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.2484,-14.29296 -3.89748,-23.36713 -4.5182,-24.86174 -0.37422,-0.90104 -2.42531,-6.5704 -4.55798,-12.59858 -6.53757,-18.47892 -18.84362,-36.78421 -34.49293,-51.30831 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.0831,-1.7525 -7.46884,-4.57913 -20.005,-8.85517 -11.38573,-3.88363 -17.60983,-5.30716 -30.73653,-7.02984 l -5.73653,-0.75283 2.6701,4.56487 c 1.46855,2.51069 17.67897,29.2759 36.02315,59.47826 18.34417,30.20236 32.99907,55.25825 32.56643,55.67974 -0.43264,0.4215 -8.43662,5.00642 -17.78662,10.18872 -42.90526,23.78051 -70.10142,42.95695 -77.91896,54.94189 -1.71999,2.63689 -1.70937,2.83257 0.33325,6.13758 1.16043,1.87762 2.86582,4.02694 3.78975,4.77627 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.1981,-1.99193 3.9181,-11.51832 8.98697,-16.7338 8.50655,-8.7526 21.51402,-12.1287 33.25329,-8.63093 5.46979,1.62975 12.27455,7.8332 14.69425,13.39579 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.67694,-0.43456 3.46918,-1.36137 2.07852,-1.07484 5.54425,-1.67191 9.56989,-1.64869 11.04048,0.0637 20.17466,6.88838 21.88558,16.352 1.71545,9.4887 -6.20933,22.08031 -17.32562,27.52849 -6.94089,3.40179 -16.62995,3.87178 -22.07612,1.07086 -3.31967,-1.70728 -3.42063,-1.69531 -6.32672,0.75 -3.44122,2.8956 -4.11889,3.01031 -5.8021,0.98216 -1.03861,-1.25145 -0.52189,-2.2968 3.08941,-6.25 2.38514,-2.61095 4.683,-4.89443 5.10634,-5.07438 0.42335,-0.17995 1.79122,0.86037 3.03971,2.31183 1.55546,1.80833 3.63091,2.82157 6.59347,3.21893 4.17268,0.55967 4.51538,0.39184 9.82548,-4.81184 8.83203,-8.65503 10.31914,-13.6121 6.25366,-20.84565 -3.66909,-6.52827 -12.54423,-9.82342 -17.57685,-6.52592 -2.54252,1.66592 -2.72225,1.66237 -3.99558,-0.079 C 575.59999,305.43827 575,304.11702 575,303.50504 c 0,-1.765 -6.08282,-7.07501 -11,-9.60248 -3.69439,-1.89894 -6.47458,-2.38387 -15.52961,-2.70872 l -11.0296,-0.3957 -4.26892,4.63123 C 528.97569,299.98169 525,307.50184 525,310.88674 c 0,2.196 3.09839,5.05976 21.5,19.87189 26.3677,21.22434 46.27807,40.78774 63.85412,62.74137 8.17641,10.21287 23.11241,32.24382 24.21495,35.71763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 4.6764,-1.7945 10.69034,-2.70007 13.91448,-2.09522 11.23983,2.1086 12.5038,13.71596 3.43658,31.55908 l -2.92854,5.76299 1.98093,6.35943 c 10.68801,34.31184 10.441,77.27599 -0.64022,111.35942 -9.83517,30.25085 -26.5481,57.10026 -51.93009,83.42598 L 590.5,677.35196 l 7,-3.79883 c 3.85,-2.08936 10.14832,-5.88105 13.99628,-8.42598 z m 39.17039,-65.79382 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 1.08573,-1.52477 3.36531,-3.34858 5.06574,-4.05292 2.62433,-1.08704 3.32417,-1.04813 4.62968,0.25738 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 420.28012,562.56378 c 20.69513,-10.13707 31.01224,-16.74672 39.80968,-25.50404 9.17994,-9.13806 9.43378,-9.77094 6.29816,-15.70254 C 460.06737,509.40063 447.82777,496.98848 421,475.32938 411.375,467.55875 402.17831,459.80574 400.56291,458.10048 398.94751,456.39522 397.30224,455 396.90677,455 c -0.39548,0 -0.94185,22.3875 -1.21416,49.75 -0.38638,38.82549 -0.83838,51.72629 -2.05839,58.75 -2.33409,13.43759 -2.58057,12.80846 3.8959,9.94426 3.04157,-1.34512 13.27907,-6.24134 22.75,-10.88048 z m -13.61345,-49.23045 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 2.63084,-3.69467 7.46851,-5.74397 9.52685,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 648.90032,446.8151 c 0.10686,-5.0225 -1.28607,-9.80426 -3.21288,-11.02944 -0.65309,-0.41527 -2.60759,-0.76193 -4.34333,-0.77035 l -3.1559,-0.0153 4.6559,10.34347 c 4.97615,11.05495 5.8478,11.26676 6.05621,1.47163 z M 157.5,449.65804 l 55,-4.15804 0.25215,-48.5 0.25214,-48.5 -5.25214,-0.24961 c -11.65445,-0.55389 -22.19342,-7.22755 -25.15924,-15.93173 -4.54345,-13.33429 0.52047,-34.07822 10.93487,-44.79385 4.61186,-4.74526 13.21367,-9.49764 17.22222,-9.51504 L 213,278 l 0,-78.5 c 0,-66.0128 0.21915,-78.5 1.37766,-78.5 0.75771,0 31.69521,3.39217 68.75,7.53815 37.05479,4.14599 77.44566,8.62533 89.75751,9.9541 l 22.38516,2.41593 10.61484,-10.35635 c 5.83815,-5.696 12.79791,-12.2161 15.46612,-14.48912 l 4.85129,-4.13276 -104.85129,0.32143 -104.85129,0.32144 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 109.08343,183.88282 100,201.4483 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604582,8.63477 -1.795848,19.5184 -2.100068,119.5 l -0.334704,110 5.28435,-0.34196 c 2.90639,-0.18808 30.03435,-2.21308 60.28435,-4.5 z M 96.666667,393.33333 c -1.34912,-1.34912 -0.610152,-6.60396 1.307387,-9.29689 2.630836,-3.69467 7.468506,-5.74397 9.526846,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 29.55365,-140.42605 c -2.18879,-1.23967 -5.02357,-4.04476 -6.29951,-6.23355 -1.95088,-3.3466 -2.2555,-5.02852 -1.91506,-10.57374 0.68633,-11.17903 9.23267,-26.03008 17.72682,-30.80406 12.18626,-6.84906 28.42458,-1.32092 32.09383,10.92594 3.2855,10.96602 -9.28458,31.96209 -22.42144,37.45103 -5.50857,2.30162 -14.39518,1.94697 -19.18464,-0.76562 z m 17.2808,-3.11036 c 1.7448,-0.90227 4.10904,-4.13257 6.6744,-9.11934 3.2038,-6.22782 4.0461,-9.02422 4.35273,-14.45085 C 162.46108,205.83425 158.31695,201 148.08446,201 c -4.17702,0 -5.60201,0.51551 -8.52912,3.08555 -8.35856,7.33892 -13.0523,24.65324 -8.59925,31.721 1.14582,1.81861 3.53694,3.9385 5.3136,4.71086 4.18177,1.81793 11.1025,1.8586 14.53149,0.0854 z m 18.66993,-22.15026 c 1.99478,-6.34195 1.56995,-11.64471 -1.17601,-14.67896 -2.16635,-2.39379 -7.25939,-5.14263 -8.0547,-4.34733 -0.31555,0.31556 -0.0677,0.57374 0.55078,0.57374 1.69839,0 5.93039,7.96193 6.66512,12.5395 0.3566,2.22172 0.22344,5.93073 -0.29593,8.24224 -1.33113,5.92443 0.20015,4.38092 2.31074,-2.32919 z m 485.27688,218.70751 c -0.69477,-1.44958 -2.07908,-2.79272 -3.07624,-2.98476 -1.67162,-0.32192 -1.70095,-0.12792 -0.37603,2.48777 0.79034,1.56031 1.78895,4.63693 2.21914,6.83693 l 0.78216,4 0.85709,-3.85216 c 0.58993,-2.65143 0.46334,-4.6737 -0.40612,-6.48778 z M 211.41821,343.39301 C 212.80828,342.85959 213,339.4053 213,314.89301 L 213,287 l -6.37264,0 c -6.28408,0 -6.43106,0.0634 -10.57626,4.56039 -4.44579,4.82311 -6.47568,8.78581 -8.6773,16.93961 -1.5852,5.87083 -1.7841,16.58257 -0.39768,21.41673 1.83036,6.3821 8.91721,11.54507 17.94433,13.07293 2.51875,0.42631 4.65525,0.82803 4.74776,0.89272 0.0925,0.0647 0.88002,-0.15552 1.75,-0.48937 z m 395.16637,-15.69234 c 1.83053,-2.76096 2.92974,-5.93018 3.20717,-9.24687 0.3685,-4.40534 0.0645,-5.47114 -2.39345,-8.39229 -2.73935,-3.25553 -9.37192,-7.01238 -12.3983,-7.0227 -0.825,-0.003 -0.0265,0.93847 1.77448,2.09174 9.27746,5.94094 10.88321,19.4736 3.35493,28.27425 -1.58838,1.85684 -1.56269,1.8619 1.02035,0.20067 1.45736,-0.93727 3.90304,-3.59443 5.43482,-5.9048 z"
+       id="path3604"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#c5a94e"
+       d="m 464.24418,744.75 c -1.61938,-3.4375 -5.32776,-11.3125 -8.24084,-17.5 l -5.29652,-11.25 -84.36467,0 -84.36467,0 -11.23874,3.38694 c -19.28562,5.81197 -29.35869,7.1213 -54.23874,7.05012 -19.85965,-0.0568 -23.22599,-0.322 -34.60155,-2.72573 -30.53316,-6.45184 -53.94731,-18.7052 -76.52782,-40.04939 C 69.421049,649.68065 49.980714,603.39893 45.047413,540.05011 44.471336,532.65266 44,511.21912 44,492.42 L 44,458.2398 55.5,457.52125 67,456.8027 67.01777,349.15135 C 67.035144,243.85306 67.293758,233.64677 70.366309,217 c 1.524336,-8.2587 5.805294,-22.49738 8.095583,-26.92631 0.805792,-1.55823 2.089787,-4.64638 2.853322,-6.86256 1.372558,-3.98387 2.740384,-6.39656 10.968549,-19.34727 8.269777,-13.01621 10.101677,-15.36961 19.599927,-25.17962 C 128.3936,121.63242 145.70632,109.44042 165,101.27855 179.20986,95.267312 182.04094,94.355031 197.83956,90.696431 L 211.5,87.532985 l 124.80569,-0.289101 124.80568,-0.2891 3.84409,-2.426665 c 3.88418,-2.451977 34.83936,-19.833552 40.7358,-22.873467 l 3.19125,-1.645257 8.03323,13.35057 8.03322,13.350569 12.77552,0.559956 C 544.75102,87.578465 555,88.547988 560.5,89.424985 c 13.41479,2.139041 36.59945,9.743241 45.47655,14.915585 21.20265,12.35397 26.40356,16.21983 40.57489,30.15943 7.828,7.7 15.51879,15.96385 17.09064,18.36411 C 674.4297,169.33708 683,184.65051 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29739,164.60779 -0.30324,165.02565 -2.46297,175.79255 -2.82311,14.07408 -9.47082,33.33611 -14.66251,42.48526 -2.27138,4.0028 -5.02979,8.9876 -6.12979,11.07735 -7.53001,14.30526 -26.49531,34.27214 -48.21379,50.76003 -6.40758,4.8644 -28.63093,15.71305 -40.78621,19.91037 -6.15327,2.12478 -30.16779,7.14806 -38,7.94872 -5.33024,0.5449 -8.31196,1.5064 -12.5,4.03085 -11.78105,7.10131 -28.77024,15.76895 -45.98451,23.46065 C 477.12602,747.3846 468.61926,751 468.11157,751 c -0.50768,0 -2.24801,-2.8125 -3.86739,-6.25 z m 33.57728,-44.21427 c 64.50687,-32.88945 106.28606,-74.9627 121.5996,-122.45544 13.41627,-41.60866 10.52183,-81.28707 -8.86898,-121.58029 -16.903,-35.12366 -43.63985,-65.91464 -88.91401,-102.39615 -24.48971,-19.73358 -34.79605,-31.73052 -39.65818,-46.16355 -2.51317,-7.46024 -2.49509,-11.48829 0.0825,-18.37755 6.47576,-17.30803 31.90638,-39.40536 73.1497,-63.5617 9.57826,-5.61002 10.60282,-6.47834 9.67955,-8.20348 -0.56791,-1.06115 -6.02816,-10.11221 -12.1339,-20.11347 -6.10573,-10.00125 -17.92331,-29.4341 -26.26129,-43.1841 -22.09656,-36.43902 -28.53591,-46.8982 -29.44933,-47.83343 -1.7331,-1.77447 -28.85968,15.6652 -47.02544,30.23262 -12.55497,10.06804 -35.33579,32.26988 -45.25087,44.10081 -22.86562,27.28385 -39.4535,59.70945 -45.29748,88.54646 -11.40094,56.25774 7.49271,109.18168 55.67485,155.95354 6.799,6.6 15.21828,14.25 18.7095,17 38.83412,30.58924 56.39539,48.78857 65.1423,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.72078,7.60674 5.38526,11.18174 5.95369,12.78749 34.13931,72.7215 39.62089,84.25 3.07279,6.4625 5.84687,11.75 6.16462,11.75 0.31775,0 6.28307,-2.90892 13.25626,-6.46427 z M 229,691.98749 c 15.09509,-1.16792 25.66791,-3.22658 37,-7.20439 45.16593,-15.8542 80.26613,-58.11109 92.02074,-110.7831 4.90732,-21.98958 5.21704,-27.02944 5.70109,-92.76949 l 0.45849,-62.26948 -6.80597,-10.22336 C 340.6417,383.60326 330.55839,358.42527 325.8414,330 c -2.60529,-15.69985 -2.80479,-41.47079 -0.44054,-56.90915 4.34516,-28.37366 15.93603,-58.23269 32.56795,-83.89769 4.93666,-7.61786 6.03115,-10.06781 6.03094,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.29963,192.37152 c -0.33626,215.89031 0.33023,197.4683 -7.75755,214.4203 -6.94716,14.56126 -14.57608,19.51296 -28.06594,18.21675 -5.98593,-0.57517 -8.54401,-2.70684 -12.7234,-10.60252 -7.33991,-13.86649 -11.15774,-39.91968 -11.17957,-76.29018 L 187,481.24567 l -4.25,0.40667 c -5.78671,0.5537 -82.883987,6.2596 -94.928341,7.02556 -5.323087,0.33852 -10.183506,0.9277 -10.80093,1.30929 -1.433872,0.88618 0.277225,39.51845 2.509949,56.66835 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.08039,-6.01992 c 7.37066,-6.8441 13.37455,-10.72822 19.30587,-12.48964 6.19167,-1.83872 8.77478,-1.85531 13.01517,-0.0836 4.90021,2.04744 6.59857,5.0918 6.59857,11.82814 l 0,5.77749 17.43363,0 17.43363,0 -10.74457,-22.75 c -5.90952,-12.5125 -16.99256,-36.09759 -24.62898,-52.41132 l -13.8844,-29.66132 -3.23059,11.16132 c -9.97117,34.44927 -27.69934,63.35818 -53.00725,86.43772 l -7.87147,7.17838 17.08039,0.0226 17.08039,0.0226 5.41961,-5.03243 z M 393,688.5651 c 0,-3.10277 -1.77234,-7.80008 -3.31256,-8.77944 -3.83372,-2.43769 -12.17188,0.99199 -18.6427,7.66818 L 367.60767,691 l 12.69616,0 12.69617,0 0,-2.4349 z m 5.7556,-7.31785 c -0.69058,-1.40164 -2.1992,-2.89067 -3.3525,-3.30898 -2.09322,-0.75922 -2.09366,-0.7542 -0.25,2.86203 1.0158,1.99242 1.8469,4.39063 1.8469,5.32935 0,0.93873 0.31686,2.53108 0.70414,3.53856 0.54292,1.41241 0.88763,0.94984 1.5056,-2.02037 0.53621,-2.57727 0.38591,-4.69559 -0.45414,-6.40059 z m 212.74068,-16.1201 c 7.74212,-5.12044 27.44294,-24.0998 32.31035,-31.12715 1.71428,-2.475 4.47402,-7.05472 6.13275,-10.17715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 1.91127,-1.18123 4.74782,-7.90311 9.28584,-22.005 8.16378,-25.36894 7.74779,-14.86691 7.64482,-193 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.2484,-14.29296 -3.89748,-23.36713 -4.5182,-24.86174 -0.37422,-0.90104 -2.42531,-6.5704 -4.55798,-12.59858 -6.53757,-18.47892 -18.84362,-36.78421 -34.49293,-51.30831 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.0831,-1.7525 -7.46884,-4.57913 -20.005,-8.85517 -11.38573,-3.88363 -17.60983,-5.30716 -30.73653,-7.02984 l -5.73653,-0.75283 2.6701,4.56487 c 1.46855,2.51069 17.67897,29.2759 36.02315,59.47826 18.34417,30.20236 32.99907,55.25825 32.56643,55.67974 -0.43264,0.4215 -8.43662,5.00642 -17.78662,10.18872 -42.90526,23.78051 -70.10142,42.95695 -77.91896,54.94189 -1.71999,2.63689 -1.70937,2.83257 0.33325,6.13758 1.16043,1.87762 2.86582,4.02694 3.78975,4.77627 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.1981,-1.99193 3.9181,-11.51832 8.98697,-16.7338 8.50655,-8.7526 21.51402,-12.1287 33.25329,-8.63093 5.46979,1.62975 12.27455,7.8332 14.69425,13.39579 1.02197,2.34939 1.95289,4.4173 2.06869,4.59536 0.11581,0.17805 1.67694,-0.43456 3.46918,-1.36137 2.07852,-1.07484 5.54425,-1.67191 9.56989,-1.64869 11.04048,0.0637 20.17466,6.88838 21.88558,16.352 1.71545,9.4887 -6.20933,22.08031 -17.32562,27.52849 -6.94089,3.40179 -16.62995,3.87178 -22.07612,1.07086 -3.31967,-1.70728 -3.42063,-1.69531 -6.32672,0.75 -3.44122,2.8956 -4.11889,3.01031 -5.8021,0.98216 -1.03861,-1.25145 -0.52189,-2.2968 3.08941,-6.25 2.38514,-2.61095 4.683,-4.89443 5.10634,-5.07438 0.42335,-0.17995 1.79122,0.86037 3.03971,2.31183 1.55546,1.80833 3.63091,2.82157 6.59347,3.21893 4.17268,0.55967 4.51538,0.39184 9.82548,-4.81184 8.83203,-8.65503 10.31914,-13.6121 6.25366,-20.84565 -3.66909,-6.52827 -12.54423,-9.82342 -17.57685,-6.52592 -2.54252,1.66592 -2.72225,1.66237 -3.99558,-0.079 C 575.59999,305.43827 575,304.11702 575,303.50504 c 0,-1.765 -6.08282,-7.07501 -11,-9.60248 -3.69439,-1.89894 -6.47458,-2.38387 -15.52961,-2.70872 l -11.0296,-0.3957 -4.26892,4.63123 C 528.97569,299.98169 525,307.50184 525,310.88674 c 0,2.196 3.09839,5.05976 21.5,19.87189 26.3677,21.22434 46.27807,40.78774 63.85412,62.74137 8.17641,10.21287 23.11241,32.24382 24.21495,35.71763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 4.6764,-1.7945 10.69034,-2.70007 13.91448,-2.09522 11.23983,2.1086 12.5038,13.71596 3.43658,31.55908 l -2.92854,5.76299 1.98093,6.35943 c 10.68801,34.31184 10.441,77.27599 -0.64022,111.35942 -9.83517,30.25085 -26.5481,57.10026 -51.93009,83.42598 L 590.5,677.35196 l 7,-3.79883 c 3.85,-2.08936 10.14832,-5.88105 13.99628,-8.42598 z m 39.17039,-65.79382 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 1.08573,-1.52477 3.36531,-3.34858 5.06574,-4.05292 2.62433,-1.08704 3.32417,-1.04813 4.62968,0.25738 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 420.28012,562.56378 c 20.69513,-10.13707 31.01224,-16.74672 39.80968,-25.50404 9.17994,-9.13806 9.43378,-9.77094 6.29816,-15.70254 C 460.06737,509.40063 447.82777,496.98848 421,475.32938 411.375,467.55875 402.17831,459.80574 400.56291,458.10048 398.94751,456.39522 397.30224,455 396.90677,455 c -0.39548,0 -0.94185,22.3875 -1.21416,49.75 -0.38638,38.82549 -0.83838,51.72629 -2.05839,58.75 -2.33409,13.43759 -2.58057,12.80846 3.8959,9.94426 3.04157,-1.34512 13.27907,-6.24134 22.75,-10.88048 z m -13.61345,-49.23045 c -1.34912,-1.34912 -0.61016,-6.60396 1.30738,-9.29689 2.63084,-3.69467 7.46851,-5.74397 9.52685,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 648.90032,446.8151 c 0.10686,-5.0225 -1.28607,-9.80426 -3.21288,-11.02944 -0.65309,-0.41527 -2.60759,-0.76193 -4.34333,-0.77035 l -3.1559,-0.0153 4.6559,10.34347 c 4.97615,11.05495 5.8478,11.26676 6.05621,1.47163 z M 157.5,449.65804 l 55,-4.15804 0.25215,-48.5 0.25214,-48.5 -5.25214,-0.24961 c -11.65445,-0.55389 -22.19342,-7.22755 -25.15924,-15.93173 -4.54345,-13.33429 0.52047,-34.07822 10.93487,-44.79385 4.61186,-4.74526 13.21367,-9.49764 17.22222,-9.51504 L 213,278 l 0,-78.5 c 0,-66.0128 0.21915,-78.5 1.37766,-78.5 0.75771,0 31.69521,3.39217 68.75,7.53815 37.05479,4.14599 77.44566,8.62533 89.75751,9.9541 l 22.38516,2.41593 10.61484,-10.35635 c 5.83815,-5.696 12.79791,-12.2161 15.46612,-14.48912 l 4.85129,-4.13276 -104.85129,0.32143 -104.85129,0.32144 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 109.08343,183.88282 100,201.4483 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604582,8.63477 -1.795848,19.5184 -2.100068,119.5 l -0.334704,110 5.28435,-0.34196 c 2.90639,-0.18808 30.03435,-2.21308 60.28435,-4.5 z M 96.666667,393.33333 c -1.34912,-1.34912 -0.610152,-6.60396 1.307387,-9.29689 2.630836,-3.69467 7.468506,-5.74397 9.526846,-4.03569 2.69199,2.23415 1.567,6.95449 -2.80018,11.74925 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 29.55365,-140.42605 c -2.18879,-1.23967 -5.02357,-4.04476 -6.29951,-6.23355 -1.95088,-3.3466 -2.2555,-5.02852 -1.91506,-10.57374 0.68633,-11.17903 9.23267,-26.03008 17.72682,-30.80406 12.18626,-6.84906 28.42458,-1.32092 32.09383,10.92594 3.2855,10.96602 -9.28458,31.96209 -22.42144,37.45103 -5.50857,2.30162 -14.39518,1.94697 -19.18464,-0.76562 z m 17.2808,-3.11036 c 1.7448,-0.90227 4.10904,-4.13257 6.6744,-9.11934 3.2038,-6.22782 4.0461,-9.02422 4.35273,-14.45085 C 162.46108,205.83425 158.31695,201 148.08446,201 c -4.17702,0 -5.60201,0.51551 -8.52912,3.08555 -8.35856,7.33892 -13.0523,24.65324 -8.59925,31.721 1.14582,1.81861 3.53694,3.9385 5.3136,4.71086 4.18177,1.81793 11.1025,1.8586 14.53149,0.0854 z m 19.63498,-28.78479 c 0.0556,-4.94785 -0.30958,-6.07206 -2.82635,-8.70105 -1.5896,-1.66048 -4.22267,-3.48357 -5.85125,-4.05129 l -2.96107,-1.03224 3.54475,3.92362 c 4.0932,4.53068 5.0597,8.38972 4.45999,17.8079 l -0.42812,6.72352 1.99911,-4.49424 c 1.19224,-2.68031 2.02487,-6.78756 2.06294,-10.17622 z m 484.28972,225.36722 c -0.67423,-1.36753 -2.23953,-2.85458 -3.47844,-3.30455 -2.13947,-0.77706 -2.17914,-0.70609 -0.79027,1.4136 0.80426,1.22746 2.0113,4.70088 2.68231,7.71873 l 1.22002,5.48698 0.79613,-4.41417 c 0.53509,-2.96684 0.39419,-5.22943 -0.42975,-6.90059 z M 211.41821,343.39301 C 212.80828,342.85959 213,339.4053 213,314.89301 L 213,287 l -6.37264,0 c -6.28408,0 -6.43106,0.0634 -10.57626,4.56039 -4.44579,4.82311 -6.47568,8.78581 -8.6773,16.93961 -1.5852,5.87083 -1.7841,16.58257 -0.39768,21.41673 1.83036,6.3821 8.91721,11.54507 17.94433,13.07293 2.51875,0.42631 4.65525,0.82803 4.74776,0.89272 0.0925,0.0647 0.88002,-0.15552 1.75,-0.48937 z m 395.3129,-15.56287 c 1.70478,-2.5761 2.76539,-5.77217 3.04854,-9.18653 0.38298,-4.6183 0.10205,-5.63075 -2.38135,-8.5821 -2.72086,-3.23356 -9.33508,-6.99442 -12.38043,-7.03955 -0.81518,-0.0121 0.1492,1.08657 2.14307,2.44143 4.53895,3.0843 7.83906,9.71556 7.83906,15.75185 0,3.57071 -0.76429,5.71951 -3.45814,9.72256 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z"
+       id="path3602"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#939393"
+       d="m 464.24418,744.75 c -1.61938,-3.4375 -5.32776,-11.3125 -8.24084,-17.5 l -5.29652,-11.25 -84.36467,0 -84.36467,0 -11.23874,3.38694 c -19.28562,5.81197 -29.35869,7.1213 -54.23874,7.05012 -19.85965,-0.0568 -23.22599,-0.322 -34.60155,-2.72573 -30.53316,-6.45184 -53.94731,-18.7052 -76.52782,-40.04939 C 69.421049,649.68065 49.980714,603.39893 45.047413,540.05011 44.471336,532.65266 44,511.21912 44,492.42 L 44,458.2398 55.5,457.52125 67,456.8027 67.01777,349.15135 C 67.035144,243.85306 67.293758,233.64677 70.366309,217 c 1.524336,-8.2587 5.805294,-22.49738 8.095583,-26.92631 0.805792,-1.55823 2.089787,-4.64638 2.853322,-6.86256 1.372558,-3.98387 2.740384,-6.39656 10.968549,-19.34727 8.269777,-13.01621 10.101677,-15.36961 19.599927,-25.17962 C 128.3936,121.63242 145.70632,109.44042 165,101.27855 179.20986,95.267312 182.04094,94.355031 197.83956,90.696431 L 211.5,87.532985 l 124.80569,-0.289101 124.80568,-0.2891 3.84409,-2.426665 c 3.88418,-2.451977 34.83936,-19.833552 40.7358,-22.873467 l 3.19125,-1.645257 8.03323,13.35057 8.03322,13.350569 12.77552,0.559956 C 544.75102,87.578465 555,88.547988 560.5,89.424985 c 13.41479,2.139041 36.59945,9.743241 45.47655,14.915585 21.20265,12.35397 26.40356,16.21983 40.57489,30.15943 7.828,7.7 15.51879,15.96385 17.09064,18.36411 C 674.4297,169.33708 683,184.65051 683,187.45288 c 0,0.82655 1.09169,3.87528 2.42597,6.77497 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61272,4.70289 0.86598,69.03651 0.67906,172.5 -0.29739,164.60779 -0.30324,165.02565 -2.46297,175.79255 -2.82311,14.07408 -9.47082,33.33611 -14.66251,42.48526 -2.27138,4.0028 -5.02979,8.9876 -6.12979,11.07735 -7.53001,14.30526 -26.49531,34.27214 -48.21379,50.76003 -6.40758,4.8644 -28.63093,15.71305 -40.78621,19.91037 -6.15327,2.12478 -30.16779,7.14806 -38,7.94872 -5.33024,0.5449 -8.31196,1.5064 -12.5,4.03085 -11.78105,7.10131 -28.77024,15.76895 -45.98451,23.46065 C 477.12602,747.3846 468.61926,751 468.11157,751 c -0.50768,0 -2.24801,-2.8125 -3.86739,-6.25 z m 33.57728,-44.21427 c 64.50687,-32.88945 106.28606,-74.9627 121.5996,-122.45544 13.41627,-41.60866 10.52183,-81.28707 -8.86898,-121.58029 -16.903,-35.12366 -43.63985,-65.91464 -88.91401,-102.39615 -24.48971,-19.73358 -34.79605,-31.73052 -39.65818,-46.16355 -2.51317,-7.46024 -2.49509,-11.48829 0.0825,-18.37755 6.47576,-17.30803 31.90638,-39.40536 73.1497,-63.5617 9.57826,-5.61002 10.60282,-6.47834 9.67955,-8.20348 -0.56791,-1.06115 -6.02816,-10.11221 -12.1339,-20.11347 -6.10573,-10.00125 -17.92331,-29.4341 -26.26129,-43.1841 -22.09656,-36.43902 -28.53591,-46.8982 -29.44933,-47.83343 -1.7331,-1.77447 -28.85968,15.6652 -47.02544,30.23262 -12.55497,10.06804 -35.33579,32.26988 -45.25087,44.10081 -22.86562,27.28385 -39.4535,59.70945 -45.29748,88.54646 -11.40094,56.25774 7.49271,109.18168 55.67485,155.95354 6.799,6.6 15.21828,14.25 18.7095,17 38.83412,30.58924 56.39539,48.78857 65.1423,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.72078,7.60674 5.38526,11.18174 5.95369,12.78749 34.13931,72.7215 39.62089,84.25 3.07279,6.4625 5.84687,11.75 6.16462,11.75 0.31775,0 6.28307,-2.90892 13.25626,-6.46427 z M 229,691.98749 c 15.09509,-1.16792 25.66791,-3.22658 37,-7.20439 45.16593,-15.8542 80.26613,-58.11109 92.02074,-110.7831 4.90732,-21.98958 5.21704,-27.02944 5.70109,-92.76949 l 0.45849,-62.26948 -6.80597,-10.22336 C 340.6417,383.60326 330.55839,358.42527 325.8414,330 c -2.60529,-15.69985 -2.80479,-41.47079 -0.44054,-56.90915 4.34516,-28.37366 15.93603,-58.23269 32.56795,-83.89769 4.93666,-7.61786 6.03115,-10.06781 6.03094,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.29963,192.37152 c -0.33626,215.89031 0.33023,197.4683 -7.75755,214.4203 -6.94716,14.56126 -14.57608,19.51296 -28.06594,18.21675 -5.98593,-0.57517 -8.54401,-2.70684 -12.7234,-10.60252 -7.33991,-13.86649 -11.15774,-39.91968 -11.17957,-76.29018 L 187,481.24567 l -4.25,0.40667 c -5.78671,0.5537 -82.883987,6.2596 -94.928341,7.02556 -5.323087,0.33852 -10.183506,0.9277 -10.80093,1.30929 -1.433872,0.88618 0.277225,39.51845 2.509949,56.66835 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 135.63191,-5.57796 c 11.61031,-10.94819 23.21862,-15.96932 31.31283,-13.54423 5.81657,1.74268 8.05526,5.1526 8.05526,12.26956 l 0,5.86514 17.43363,0 17.43363,0 -10.74457,-22.75 c -5.90952,-12.5125 -16.99256,-36.09759 -24.62898,-52.41132 l -13.8844,-29.66132 -3.23059,11.16132 c -9.97117,34.44927 -27.69934,63.35818 -53.00725,86.43772 l -7.87147,7.17838 17.13191,0.0226 17.13191,0.0226 4.86809,-4.59047 z M 393,688.5651 c 0,-3.10277 -1.77234,-7.80008 -3.31256,-8.77944 -3.83372,-2.43769 -12.17188,0.99199 -18.6427,7.66818 L 367.60767,691 l 12.69616,0 12.69617,0 0,-2.4349 z m 5.7556,-7.31785 c -0.69058,-1.40164 -2.1992,-2.89067 -3.3525,-3.30898 -2.09322,-0.75922 -2.09366,-0.7542 -0.25,2.86203 1.0158,1.99242 1.8469,4.39063 1.8469,5.32935 0,0.93873 0.31686,2.53108 0.70414,3.53856 0.54292,1.41241 0.88763,0.94984 1.5056,-2.02037 0.53621,-2.57727 0.38591,-4.69559 -0.45414,-6.40059 z m 212.74068,-16.1201 c 7.74212,-5.12044 27.44294,-24.0998 32.31035,-31.12715 1.71428,-2.475 4.47402,-7.05472 6.13275,-10.17715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 1.91127,-1.18123 4.74782,-7.90311 9.28584,-22.005 8.16378,-25.36894 7.74779,-14.86691 7.64482,-193 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.2484,-14.29296 -3.89748,-23.36713 -4.5182,-24.86174 -0.37422,-0.90104 -2.42531,-6.5704 -4.55798,-12.59858 -6.53757,-18.47892 -18.84362,-36.78421 -34.49293,-51.30831 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.0831,-1.7525 -7.46884,-4.57913 -20.005,-8.85517 -11.38573,-3.88363 -17.60983,-5.30716 -30.73653,-7.02984 l -5.73653,-0.75283 2.6701,4.56487 c 1.46855,2.51069 17.67897,29.2759 36.02315,59.47826 18.34417,30.20236 32.99907,55.25825 32.56643,55.67974 -0.43264,0.4215 -8.43662,5.00642 -17.78662,10.18872 -42.90526,23.78051 -70.10142,42.95695 -77.91896,54.94189 -1.71999,2.63689 -1.70937,2.83257 0.33325,6.13758 1.16043,1.87762 2.86582,4.02694 3.78975,4.77627 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.19653,-1.98933 3.91548,-11.51563 8.97078,-16.71715 5.20177,-5.35222 12.70521,-9.1209 19.96589,-10.02807 11.30663,-1.41267 23.81571,5.16903 27.97117,14.71715 1.03664,2.38191 1.97956,4.47643 2.09536,4.65449 0.11581,0.17805 1.58003,-0.38445 3.25383,-1.25 4.95754,-2.56365 14.74396,-2.07502 21.01339,1.04917 12.85664,6.40673 14.44715,21.1337 3.58699,33.21281 -6.33166,7.04233 -13.97942,10.66884 -22.45779,10.64931 -4.14682,-0.01 -7.7213,-0.63767 -9.87351,-1.73497 -3.3133,-1.6893 -3.42621,-1.67565 -6.32672,0.76497 -3.44122,2.8956 -4.11889,3.01031 -5.8021,0.98216 -1.03861,-1.25145 -0.52189,-2.2968 3.08941,-6.25 2.38514,-2.61095 4.683,-4.89443 5.10634,-5.07438 0.42335,-0.17995 1.79122,0.86037 3.03971,2.31183 1.55546,1.80833 3.63091,2.82157 6.59347,3.21893 4.17268,0.55967 4.51538,0.39184 9.82548,-4.81184 8.83203,-8.65503 10.31914,-13.6121 6.25366,-20.84565 -3.66909,-6.52827 -12.54423,-9.82342 -17.57685,-6.52592 -2.54252,1.66592 -2.72225,1.66237 -3.99558,-0.079 C 575.59999,305.43827 575,304.11702 575,303.50504 c 0,-1.765 -6.08282,-7.07501 -11,-9.60248 -3.69439,-1.89894 -6.47458,-2.38387 -15.52961,-2.70872 l -11.0296,-0.3957 -4.26892,4.63123 C 528.97569,299.98169 525,307.50184 525,310.88674 c 0,2.196 3.09839,5.05976 21.5,19.87189 26.3677,21.22434 46.27807,40.78774 63.85412,62.74137 8.17641,10.21287 23.11241,32.24382 24.21495,35.71763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 9.01916,-3.46097 16.06049,-2.92856 20.5423,1.55324 2.79819,2.79819 2.93956,3.3303 2.57921,9.70762 -0.30327,5.36711 -1.22965,8.51528 -4.52919,15.39169 l -4.14794,8.64454 1.97,6.32431 c 10.67647,34.27465 10.42507,77.25626 -0.65115,111.3243 -9.83517,30.25085 -26.5481,57.10026 -51.93009,83.42598 L 590.5,677.35196 l 7,-3.79883 c 3.85,-2.08936 10.14832,-5.88105 13.99628,-8.42598 z m 39.17039,-65.79382 c -2.68522,-2.68521 1.36858,-11.27686 6.2808,-13.31157 2.73085,-1.13116 3.40289,-1.09997 4.722,0.21914 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 420.28012,562.56378 c 20.69513,-10.13707 31.01224,-16.74672 39.80968,-25.50404 9.17994,-9.13806 9.43378,-9.77094 6.29816,-15.70254 C 460.06737,509.40063 447.82777,496.98848 421,475.32938 411.375,467.55875 402.17831,459.80574 400.56291,458.10048 398.94751,456.39522 397.30224,455 396.90677,455 c -0.39548,0 -0.94185,22.3875 -1.21416,49.75 -0.38638,38.82549 -0.83838,51.72629 -2.05839,58.75 -2.33409,13.43759 -2.58057,12.80846 3.8959,9.94426 3.04157,-1.34512 13.27907,-6.24134 22.75,-10.88048 z m -13.61345,-49.23045 c -2.66649,-2.66648 1.36083,-11.27365 6.21596,-13.28472 7.14402,-2.95914 8.31381,4.56969 1.81809,11.70139 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 648.90032,446.8151 c 0.10686,-5.0225 -1.28607,-9.80426 -3.21288,-11.02944 -0.65309,-0.41527 -2.60759,-0.76193 -4.34333,-0.77035 l -3.1559,-0.0153 4.6559,10.34347 c 4.97615,11.05495 5.8478,11.26676 6.05621,1.47163 z M 157.5,449.65804 l 55,-4.15804 0.25955,-48.81492 c 0.1445,-27.17561 -0.12278,-48.57863 -0.60292,-48.28188 -1.6457,1.0171 -13.40475,-1.49533 -18.01853,-3.84981 -2.55096,-1.30179 -5.85812,-3.65273 -7.34925,-5.22432 -10.10911,-10.65448 -6.50948,-38.17265 6.78231,-51.8489 4.57474,-4.70706 13.18374,-9.45306 17.17884,-9.4704 L 213,278 l 0,-78.5 c 0,-66.0128 0.21915,-78.5 1.37766,-78.5 0.75771,0 31.69521,3.39217 68.75,7.53815 37.05479,4.14599 77.44566,8.62533 89.75751,9.9541 l 22.38516,2.41593 10.61484,-10.35635 c 5.83815,-5.696 12.79791,-12.2161 15.46612,-14.48912 l 4.85129,-4.13276 -104.85129,0.32143 -104.85129,0.32144 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 109.08343,183.88282 100,201.4483 100,205.47759 c 0,0.6975 -0.870426,3.23788 -1.934281,5.64529 -1.063855,2.40742 -2.728696,8.65212 -3.699647,13.87712 -1.604582,8.63477 -1.795848,19.5184 -2.100068,119.5 l -0.334704,110 5.28435,-0.34196 c 2.90639,-0.18808 30.03435,-2.21308 60.28435,-4.5 z M 96.666667,393.33333 c -2.666488,-2.66648 1.360837,-11.27365 6.215963,-13.28472 7.14402,-2.95914 8.31381,4.56969 1.81809,11.70139 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 133.5,243.72943 c -11.56591,-6.47016 -10.97605,-23.58879 1.37655,-39.9497 5.0112,-6.63728 10.4569,-9.81827 17.9756,-10.50004 10.2478,-0.92924 19.58717,4.77919 22.22534,13.58461 3.19988,10.68024 -8.26344,30.70193 -21.14321,36.92847 -6.24262,3.0179 -14.97471,2.99084 -20.43428,-0.0633 z m 17.30118,-3.12662 c 1.7448,-0.90227 4.10904,-4.13257 6.6744,-9.11934 3.2038,-6.22782 4.0461,-9.02422 4.35273,-14.45085 C 162.46108,205.83425 158.31695,201 148.08446,201 c -4.17702,0 -5.60201,0.51551 -8.52912,3.08555 -8.35856,7.33892 -13.0523,24.65324 -8.59925,31.721 1.14582,1.81861 3.53694,3.9385 5.3136,4.71086 4.18177,1.81793 11.1025,1.8586 14.53149,0.0854 z m 19.63498,-28.78479 c 0.0556,-4.94785 -0.30958,-6.07206 -2.82635,-8.70105 -1.5896,-1.66048 -4.22267,-3.48357 -5.85125,-4.05129 l -2.96107,-1.03224 3.54475,3.92362 c 4.0932,4.53068 5.0597,8.38972 4.45999,17.8079 l -0.42812,6.72352 1.99911,-4.49424 c 1.19224,-2.68031 2.02487,-6.78756 2.06294,-10.17622 z m 484.28972,225.36722 c -0.67423,-1.36753 -2.23953,-2.85458 -3.47844,-3.30455 -2.13947,-0.77706 -2.17914,-0.70609 -0.79027,1.4136 0.80426,1.22746 2.0113,4.70088 2.68231,7.71873 l 1.22002,5.48698 0.79613,-4.41417 c 0.53509,-2.96684 0.39419,-5.22943 -0.42975,-6.90059 z M 211.41821,343.39301 C 212.80828,342.85959 213,339.4053 213,314.89301 L 213,287 l -6.37264,0 c -6.28408,0 -6.43106,0.0634 -10.57626,4.56039 -4.44579,4.82311 -6.47568,8.78581 -8.6773,16.93961 -1.5852,5.87083 -1.7841,16.58257 -0.39768,21.41673 1.83036,6.3821 8.91721,11.54507 17.94433,13.07293 2.51875,0.42631 4.65525,0.82803 4.74776,0.89272 0.0925,0.0647 0.88002,-0.15552 1.75,-0.48937 z m 395.3129,-15.56287 c 1.70478,-2.5761 2.76539,-5.77217 3.04854,-9.18653 0.38298,-4.6183 0.10205,-5.63075 -2.38135,-8.5821 -2.72086,-3.23356 -9.33508,-6.99442 -12.38043,-7.03955 -0.81518,-0.0121 0.1492,1.08657 2.14307,2.44143 4.53895,3.0843 7.83906,9.71556 7.83906,15.75185 0,3.57071 -0.76429,5.71951 -3.45814,9.72256 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z"
+       id="path3600"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e3a134"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 33.0905,-45.21427 c 64.50687,-32.88945 106.28606,-74.9627 121.5996,-122.45544 13.41627,-41.60866 10.52183,-81.28707 -8.86898,-121.58029 -16.903,-35.12366 -43.63985,-65.91464 -88.91401,-102.39615 -24.48971,-19.73358 -34.79605,-31.73052 -39.65818,-46.16355 -2.51317,-7.46024 -2.49509,-11.48829 0.0825,-18.37755 6.47576,-17.30803 31.90638,-39.40536 73.1497,-63.5617 9.57826,-5.61002 10.60282,-6.47834 9.67955,-8.20348 -0.56791,-1.06115 -6.02816,-10.11221 -12.1339,-20.11347 -6.10573,-10.00125 -17.92331,-29.4341 -26.26129,-43.1841 -22.09656,-36.43902 -28.53591,-46.8982 -29.44933,-47.83343 -1.7331,-1.77447 -28.85968,15.6652 -47.02544,30.23262 -12.55497,10.06804 -35.33579,32.26988 -45.25087,44.10081 -21.85114,26.07334 -39.76012,60.58937 -45.16182,87.04052 -10.05476,49.23628 1.58098,92.96702 36.44174,136.95948 7.45329,9.40566 27.94913,29.73509 37.80695,37.5 38.83412,30.58924 56.39539,48.78857 65.1423,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.72078,7.60674 5.38526,11.18174 5.95369,12.78749 34.13931,72.7215 39.62089,84.25 3.07279,6.4625 5.84687,11.75 6.16462,11.75 0.31775,0 6.28307,-2.90892 13.25626,-6.46427 z M 229,691.98749 c 15.09509,-1.16792 25.66791,-3.22658 37,-7.20439 45.16593,-15.8542 80.26613,-58.11109 92.02074,-110.7831 4.91497,-22.02387 5.21834,-26.98553 5.70112,-93.24307 l 0.45717,-62.74308 -2.97391,-3.75692 C 356.38783,408.17128 347.00824,392.25826 341.89723,381.5 323.3654,342.49197 318.75984,298.17725 328.84897,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.29963,192.37152 c -0.33626,215.89031 0.33023,197.4683 -7.75755,214.4203 -6.94716,14.56126 -14.57608,19.51296 -28.06594,18.21675 -5.98593,-0.57517 -8.54401,-2.70684 -12.7234,-10.60252 -7.33991,-13.86649 -11.15774,-39.91968 -11.17957,-76.29018 L 187,481.24567 l -4.25,0.40667 c -5.78671,0.5537 -82.883987,6.2596 -94.928341,7.02556 -5.323087,0.33852 -10.183506,0.9277 -10.80093,1.30929 -1.433872,0.88618 0.277225,39.51845 2.509949,56.66835 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 135.63191,-5.57796 c 11.61031,-10.94819 23.21862,-15.96932 31.31283,-13.54423 5.81657,1.74268 8.05526,5.1526 8.05526,12.26956 l 0,5.86514 17.43363,0 17.43363,0 -10.74457,-22.75 c -5.90952,-12.5125 -16.99256,-36.09759 -24.62898,-52.41132 l -13.8844,-29.66132 -3.23059,11.16132 c -9.97117,34.44927 -27.69934,63.35818 -53.00725,86.43772 l -7.87147,7.17838 17.13191,0.0226 17.13191,0.0226 4.86809,-4.59047 z M 393,688.5651 c 0,-3.10277 -1.77234,-7.80008 -3.31256,-8.77944 -3.83372,-2.43769 -12.17188,0.99199 -18.6427,7.66818 L 367.60767,691 l 12.69616,0 12.69617,0 0,-2.4349 z m 5.7556,-7.31785 c -0.69058,-1.40164 -2.1992,-2.89067 -3.3525,-3.30898 -2.09322,-0.75922 -2.09366,-0.7542 -0.25,2.86203 1.0158,1.99242 1.8469,4.39063 1.8469,5.32935 0,0.93873 0.31686,2.53108 0.70414,3.53856 0.54292,1.41241 0.88763,0.94984 1.5056,-2.02037 0.53621,-2.57727 0.38591,-4.69559 -0.45414,-6.40059 z m 212.74068,-16.1201 c 7.74212,-5.12044 27.44294,-24.0998 32.31035,-31.12715 1.71428,-2.475 4.47402,-7.05472 6.13275,-10.17715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 1.91127,-1.18123 4.74782,-7.90311 9.28584,-22.005 8.16378,-25.36894 7.74779,-14.86691 7.64482,-193 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.2484,-14.29296 -3.89748,-23.36713 -4.5182,-24.86174 -0.37422,-0.90104 -2.42531,-6.5704 -4.55798,-12.59858 -6.53757,-18.47892 -18.84362,-36.78421 -34.49293,-51.30831 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.0831,-1.7525 -7.46884,-4.57913 -20.005,-8.85517 -11.38573,-3.88363 -17.60983,-5.30716 -30.73653,-7.02984 l -5.73653,-0.75283 2.6701,4.56487 c 1.46855,2.51069 17.67897,29.2759 36.02315,59.47826 18.34417,30.20236 32.99907,55.25825 32.56643,55.67974 -0.43264,0.4215 -8.43662,5.00642 -17.78662,10.18872 -42.90526,23.78051 -70.10142,42.95695 -77.91896,54.94189 -1.71999,2.63689 -1.70937,2.83257 0.33325,6.13758 1.16043,1.87762 2.86582,4.02694 3.78975,4.77627 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.19653,-1.98933 3.91548,-11.51563 8.97078,-16.71715 5.20177,-5.35222 12.70521,-9.1209 19.96589,-10.02807 11.30663,-1.41267 23.81571,5.16903 27.97117,14.71715 1.03664,2.38191 1.97956,4.47643 2.09536,4.65449 0.11581,0.17805 1.58003,-0.38445 3.25383,-1.25 4.95754,-2.56365 14.74396,-2.07502 21.01339,1.04917 12.85664,6.40673 14.44715,21.1337 3.58699,33.21281 -6.33166,7.04233 -13.97942,10.66884 -22.45779,10.64931 -4.14682,-0.01 -7.7213,-0.63767 -9.87351,-1.73497 -3.3133,-1.6893 -3.42621,-1.67565 -6.32672,0.76497 -3.44122,2.8956 -4.11889,3.01031 -5.8021,0.98216 -1.03861,-1.25145 -0.52189,-2.2968 3.08941,-6.25 2.38514,-2.61095 4.683,-4.89443 5.10634,-5.07438 0.42335,-0.17995 1.79122,0.86037 3.03971,2.31183 1.55546,1.80833 3.63091,2.82157 6.59347,3.21893 4.17268,0.55967 4.51538,0.39184 9.82548,-4.81184 8.83203,-8.65503 10.31914,-13.6121 6.25366,-20.84565 -3.66909,-6.52827 -12.54423,-9.82342 -17.57685,-6.52592 -2.54252,1.66592 -2.72225,1.66237 -3.99558,-0.079 C 575.59999,305.43827 575,304.11702 575,303.50504 c 0,-1.765 -6.08282,-7.07501 -11,-9.60248 -3.69439,-1.89894 -6.47458,-2.38387 -15.52961,-2.70872 l -11.0296,-0.3957 -4.26892,4.63123 C 528.97569,299.98169 525,307.50184 525,310.88674 c 0,2.196 3.09839,5.05976 21.5,19.87189 26.3677,21.22434 46.27807,40.78774 63.85412,62.74137 8.17641,10.21287 23.11241,32.24382 24.21495,35.71763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 9.01916,-3.46097 16.06049,-2.92856 20.5423,1.55324 2.79819,2.79819 2.93956,3.3303 2.57921,9.70762 -0.30327,5.36711 -1.22965,8.51528 -4.52919,15.39169 l -4.14794,8.64454 1.97,6.32431 c 10.67647,34.27465 10.42507,77.25626 -0.65115,111.3243 -9.83517,30.25085 -26.5481,57.10026 -51.93009,83.42598 L 590.5,677.35196 l 7,-3.79883 c 3.85,-2.08936 10.14832,-5.88105 13.99628,-8.42598 z m 39.17039,-65.79382 c -2.68522,-2.68521 1.36858,-11.27686 6.2808,-13.31157 2.73085,-1.13116 3.40289,-1.09997 4.722,0.21914 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 420.28012,562.56378 c 20.69513,-10.13707 31.01224,-16.74672 39.80968,-25.50404 9.17994,-9.13806 9.43378,-9.77094 6.29816,-15.70254 C 460.06737,509.40063 447.82777,496.98848 421,475.32938 411.375,467.55875 402.17831,459.80574 400.56291,458.10048 398.94751,456.39522 397.30224,455 396.90677,455 c -0.39548,0 -0.94185,22.3875 -1.21416,49.75 -0.38638,38.82549 -0.83838,51.72629 -2.05839,58.75 -2.33409,13.43759 -2.58057,12.80846 3.8959,9.94426 3.04157,-1.34512 13.27907,-6.24134 22.75,-10.88048 z m -13.61345,-49.23045 c -2.66649,-2.66648 1.36083,-11.27365 6.21596,-13.28472 7.14402,-2.95914 8.31381,4.56969 1.81809,11.70139 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 648.90032,446.8151 c 0.10686,-5.0225 -1.28607,-9.80426 -3.21288,-11.02944 -0.65309,-0.41527 -2.60759,-0.76193 -4.34333,-0.77035 l -3.1559,-0.0153 4.6559,10.34347 c 4.97615,11.05495 5.8478,11.26676 6.05621,1.47163 z M 157.5,449.65804 l 55,-4.15804 0.25955,-48.81492 c 0.1445,-27.17561 -0.12278,-48.57863 -0.60292,-48.28188 -1.6457,1.0171 -13.40475,-1.49533 -18.01853,-3.84981 -2.55096,-1.30179 -5.85812,-3.65273 -7.34925,-5.22432 -10.10911,-10.65448 -6.50948,-38.17265 6.78231,-51.8489 4.57474,-4.70706 13.18374,-9.45306 17.17884,-9.4704 L 213,278 l 0,-78.5 c 0,-66.0128 0.21915,-78.5 1.37766,-78.5 0.75771,0 31.69521,3.39217 68.75,7.53815 37.05479,4.14599 77.44566,8.62533 89.75751,9.9541 l 22.38516,2.41593 10.61484,-10.35635 c 5.83815,-5.696 12.79791,-12.2161 15.46612,-14.48912 l 4.85129,-4.13276 -104.85129,0.32143 -104.85129,0.32144 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 108.63532,184.54883 100,201.34316 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723076,9.73442 -1.879853,18.48392 -2.150208,120 l -0.291618,109.5 5.280547,-0.34196 c 2.904296,-0.18808 30.030546,-2.21308 60.280546,-4.5 z M 96.666667,393.33333 c -2.666488,-2.66648 1.360837,-11.27365 6.215963,-13.28472 7.14402,-2.95914 8.31381,4.56969 1.81809,11.70139 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 133.5,243.72943 c -11.56591,-6.47016 -10.97605,-23.58879 1.37655,-39.9497 5.0112,-6.63728 10.4569,-9.81827 17.9756,-10.50004 10.2478,-0.92924 19.58717,4.77919 22.22534,13.58461 3.19988,10.68024 -8.26344,30.70193 -21.14321,36.92847 -6.24262,3.0179 -14.97471,2.99084 -20.43428,-0.0633 z m 17.30118,-3.12662 c 1.7448,-0.90227 4.10904,-4.13257 6.6744,-9.11934 3.2038,-6.22782 4.0461,-9.02422 4.35273,-14.45085 C 162.46108,205.83425 158.31695,201 148.08446,201 c -4.17702,0 -5.60201,0.51551 -8.52912,3.08555 -8.35856,7.33892 -13.0523,24.65324 -8.59925,31.721 1.14582,1.81861 3.53694,3.9385 5.3136,4.71086 4.18177,1.81793 11.1025,1.8586 14.53149,0.0854 z m 19.63498,-28.78479 c 0.0556,-4.94785 -0.30958,-6.07206 -2.82635,-8.70105 -1.5896,-1.66048 -4.22267,-3.48357 -5.85125,-4.05129 l -2.96107,-1.03224 3.54475,3.92362 c 4.0932,4.53068 5.0597,8.38972 4.45999,17.8079 l -0.42812,6.72352 1.99911,-4.49424 c 1.19224,-2.68031 2.02487,-6.78756 2.06294,-10.17622 z m 484.28972,225.36722 c -0.67423,-1.36753 -2.23953,-2.85458 -3.47844,-3.30455 -2.13947,-0.77706 -2.17914,-0.70609 -0.79027,1.4136 0.80426,1.22746 2.0113,4.70088 2.68231,7.71873 l 1.22002,5.48698 0.79613,-4.41417 c 0.53509,-2.96684 0.39419,-5.22943 -0.42975,-6.90059 z M 211.41821,343.39301 C 212.80828,342.85959 213,339.4053 213,314.89301 L 213,287 l -6.37264,0 c -6.28408,0 -6.43106,0.0634 -10.57626,4.56039 -4.44579,4.82311 -6.47568,8.78581 -8.6773,16.93961 -1.5852,5.87083 -1.7841,16.58257 -0.39768,21.41673 1.83036,6.3821 8.91721,11.54507 17.94433,13.07293 2.51875,0.42631 4.65525,0.82803 4.74776,0.89272 0.0925,0.0647 0.88002,-0.15552 1.75,-0.48937 z m 395.3129,-15.56287 c 1.70478,-2.5761 2.76539,-5.77217 3.04854,-9.18653 0.38298,-4.6183 0.10205,-5.63075 -2.38135,-8.5821 -2.72086,-3.23356 -9.33508,-6.99442 -12.38043,-7.03955 -0.81518,-0.0121 0.1492,1.08657 2.14307,2.44143 4.53895,3.0843 7.83906,9.71556 7.83906,15.75185 0,3.57071 -0.76429,5.71951 -3.45814,9.72256 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z"
+       id="path3598"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#caa845"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 33.0905,-45.21427 c 64.50687,-32.88945 106.28606,-74.9627 121.5996,-122.45544 13.41627,-41.60866 10.52183,-81.28707 -8.86898,-121.58029 -16.903,-35.12366 -43.63985,-65.91464 -88.91401,-102.39615 -24.48971,-19.73358 -34.79605,-31.73052 -39.65818,-46.16355 -2.51317,-7.46024 -2.49509,-11.48829 0.0825,-18.37755 6.47576,-17.30803 31.90638,-39.40536 73.1497,-63.5617 9.57826,-5.61002 10.60282,-6.47834 9.67955,-8.20348 -0.56791,-1.06115 -6.02816,-10.11221 -12.1339,-20.11347 -6.10573,-10.00125 -17.92331,-29.4341 -26.26129,-43.1841 -22.09656,-36.43902 -28.53591,-46.8982 -29.44933,-47.83343 -1.7331,-1.77447 -28.85968,15.6652 -47.02544,30.23262 -12.55497,10.06804 -35.33579,32.26988 -45.25087,44.10081 -21.85114,26.07334 -39.76012,60.58937 -45.16182,87.04052 -10.05476,49.23628 1.58098,92.96702 36.44174,136.95948 7.45329,9.40566 27.94913,29.73509 37.80695,37.5 38.83412,30.58924 56.39539,48.78857 65.1423,67.50913 3.23036,6.91378 3.49968,8.22275 3.49581,16.99087 -0.004,8.31936 -0.3423,10.18353 -2.72473,15 -7.92848,16.02866 -25.52589,30.69867 -55.48794,46.2573 l -13.24765,6.87922 2.35894,4.68174 c 1.29742,2.57496 3.72078,7.60674 5.38526,11.18174 5.95369,12.78749 34.13931,72.7215 39.62089,84.25 3.07279,6.4625 5.84687,11.75 6.16462,11.75 0.31775,0 6.28307,-2.90892 13.25626,-6.46427 z M 229,691.98749 c 15.09509,-1.16792 25.66791,-3.22658 37,-7.20439 45.16593,-15.8542 80.26613,-58.11109 92.02074,-110.7831 4.91497,-22.02387 5.21834,-26.98553 5.70112,-93.24307 l 0.45717,-62.74308 -2.97391,-3.75692 C 356.38783,408.17128 347.00824,392.25826 341.89723,381.5 323.3654,342.49197 318.75984,298.17725 328.84897,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.29963,192.37152 c -0.33626,215.89031 0.33023,197.4683 -7.75755,214.4203 -6.94716,14.56126 -14.57608,19.51296 -28.06594,18.21675 -5.98593,-0.57517 -8.54401,-2.70684 -12.7234,-10.60252 -7.33991,-13.86649 -11.15774,-39.91968 -11.17957,-76.29018 L 187,481.24567 l -4.25,0.40667 c -5.78671,0.5537 -82.883987,6.2596 -94.928341,7.02556 -5.323087,0.33852 -10.183506,0.9277 -10.80093,1.30929 -1.433872,0.88618 0.277225,39.51845 2.509949,56.66835 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 135.63191,-5.57796 c 11.61031,-10.94819 23.21862,-15.96932 31.31283,-13.54423 5.81657,1.74268 8.05526,5.1526 8.05526,12.26956 l 0,5.86514 17.43363,0 17.43363,0 -10.74457,-22.75 c -5.90952,-12.5125 -16.99256,-36.09759 -24.62898,-52.41132 l -13.8844,-29.66132 -3.23059,11.16132 c -9.97117,34.44927 -27.69934,63.35818 -53.00725,86.43772 l -7.87147,7.17838 17.13191,0.0226 17.13191,0.0226 4.86809,-4.59047 z M 393,688.46788 c 0,-1.39266 -0.65204,-4.09266 -1.44897,-6 C 390.27565,679.41547 389.66801,679 386.4791,679 c -4.27534,0 -10.59619,3.46211 -15.43436,8.45384 L 367.60767,691 l 12.69616,0 12.69617,0 0,-2.53212 z m 5.7556,-7.22063 c -0.69058,-1.40164 -2.1992,-2.89067 -3.3525,-3.30898 -2.09322,-0.75922 -2.09366,-0.7542 -0.25,2.86203 1.0158,1.99242 1.8469,4.39063 1.8469,5.32935 0,0.93873 0.31686,2.53108 0.70414,3.53856 0.54292,1.41241 0.88763,0.94984 1.5056,-2.02037 0.53621,-2.57727 0.38591,-4.69559 -0.45414,-6.40059 z m 212.74068,-16.1201 c 7.74212,-5.12044 27.44294,-24.0998 32.31035,-31.12715 1.71428,-2.475 4.47402,-7.05472 6.13275,-10.17715 1.65872,-3.12244 3.48236,-5.96547 4.05253,-6.31785 1.91127,-1.18123 4.74782,-7.90311 9.28584,-22.005 8.16378,-25.36894 7.74779,-14.86691 7.64482,-193 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.2484,-14.29296 -3.89748,-23.36713 -4.5182,-24.86174 -0.37422,-0.90104 -2.42531,-6.5704 -4.55798,-12.59858 -6.53757,-18.47892 -18.84362,-36.78421 -34.49293,-51.30831 -11.13747,-10.33668 -14.45329,-12.85896 -22.57408,-17.17166 -3.12244,-1.65822 -5.96547,-3.48145 -6.31785,-4.05162 -1.0831,-1.7525 -7.46884,-4.57913 -20.005,-8.85517 -11.38573,-3.88363 -17.60983,-5.30716 -30.73653,-7.02984 l -5.73653,-0.75283 2.6701,4.56487 c 1.46855,2.51069 17.67897,29.2759 36.02315,59.47826 18.34417,30.20236 32.99907,55.25825 32.56643,55.67974 -0.43264,0.4215 -8.43662,5.00642 -17.78662,10.18872 -42.90526,23.78051 -70.10142,42.95695 -77.91896,54.94189 -1.71999,2.63689 -1.70937,2.83257 0.33325,6.13758 1.16043,1.87762 2.86582,4.02694 3.78975,4.77627 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.19653,-1.98933 3.91548,-11.51563 8.97078,-16.71715 5.20177,-5.35222 12.70521,-9.1209 19.96589,-10.02807 11.30663,-1.41267 23.81571,5.16903 27.97117,14.71715 1.03664,2.38191 1.97956,4.47643 2.09536,4.65449 0.11581,0.17805 1.58003,-0.38445 3.25383,-1.25 4.95754,-2.56365 14.74396,-2.07502 21.01339,1.04917 12.85664,6.40673 14.44715,21.1337 3.58699,33.21281 -6.33166,7.04233 -13.97942,10.66884 -22.45779,10.64931 -4.14682,-0.01 -7.7213,-0.63767 -9.87351,-1.73497 -3.3133,-1.6893 -3.42621,-1.67565 -6.32672,0.76497 -3.43762,2.89257 -4.11952,3.00955 -5.79248,0.99375 -1.01997,-1.22898 -0.72552,-1.97635 1.67441,-4.25 1.60161,-1.51733 3.65522,-3.83827 4.56358,-5.15765 l 1.65157,-2.39888 3.58637,3.14888 c 2.65753,2.33334 4.55669,3.14887 7.33288,3.14887 3.24445,0 4.49762,-0.77054 9.35149,-5.75 3.08273,-3.1625 6.10615,-6.73292 6.71869,-7.93426 1.65994,-3.25552 1.34948,-8.40735 -0.74162,-12.30642 C 594.83649,306.84088 583.18586,302.66127 580,306.5 c -1.94445,2.34291 -2.83396,1.83144 -5.0634,-2.91148 -3.96024,-8.42506 -13.38407,-12.60288 -28.34553,-12.56628 -7.11536,0.0174 -9.54623,0.39772 -11.18547,1.75 -3.42913,2.82883 -7.42881,8.78315 -9.42001,14.02355 l -1.86715,4.91396 3.69078,3.48933 c 2.02993,1.91912 10.44078,8.92178 18.69078,15.56146 26.36004,21.21482 46.27552,40.78264 63.85412,62.73946 8.17641,10.21287 23.11241,32.24382 24.21495,35.71763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 9.01916,-3.46097 16.06049,-2.92856 20.5423,1.55324 2.79819,2.79819 2.93956,3.3303 2.57921,9.70762 -0.30327,5.36711 -1.22965,8.51528 -4.52919,15.39169 l -4.14794,8.64454 1.97,6.32431 c 10.67647,34.27465 10.42507,77.25626 -0.65115,111.3243 -9.83517,30.25085 -26.5481,57.10026 -51.93009,83.42598 L 590.5,677.35196 l 7,-3.79883 c 3.85,-2.08936 10.14832,-5.88105 13.99628,-8.42598 z m 39.17039,-65.79382 c -2.68522,-2.68521 1.36858,-11.27686 6.2808,-13.31157 2.73085,-1.13116 3.40289,-1.09997 4.722,0.21914 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 420.28012,562.56378 c 20.69513,-10.13707 31.01224,-16.74672 39.80968,-25.50404 9.17994,-9.13806 9.43378,-9.77094 6.29816,-15.70254 C 460.06737,509.40063 447.82777,496.98848 421,475.32938 411.375,467.55875 402.17831,459.80574 400.56291,458.10048 398.94751,456.39522 397.30224,455 396.90677,455 c -0.39548,0 -0.94185,22.3875 -1.21416,49.75 -0.38638,38.82549 -0.83838,51.72629 -2.05839,58.75 -2.33409,13.43759 -2.58057,12.80846 3.8959,9.94426 3.04157,-1.34512 13.27907,-6.24134 22.75,-10.88048 z m -13.61345,-49.23045 c -2.66649,-2.66648 1.36083,-11.27365 6.21596,-13.28472 7.14402,-2.95914 8.31381,4.56969 1.81809,11.70139 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-56.92134 c 0.0387,-2.90516 -0.58175,-6.84266 -1.37868,-8.75 C 646.24374,435.3391 645.71513,435 642.14513,435 l -3.95692,0 4.6559,10.34949 c 4.98801,11.08777 5.95896,11.38587 6.0856,1.86839 z M 157.5,449.65804 l 55,-4.15804 0.25955,-48.81492 c 0.1445,-27.17561 -0.12278,-48.57863 -0.60292,-48.28188 -1.6457,1.0171 -13.40475,-1.49533 -18.01853,-3.84981 -2.55096,-1.30179 -5.85812,-3.65273 -7.34925,-5.22432 -10.10911,-10.65448 -6.50948,-38.17265 6.78231,-51.8489 4.57474,-4.70706 13.18374,-9.45306 17.17884,-9.4704 L 213,278 l 0,-78.5 c 0,-66.0128 0.21915,-78.5 1.37766,-78.5 0.75771,0 31.69521,3.39217 68.75,7.53815 37.05479,4.14599 77.44566,8.62533 89.75751,9.9541 l 22.38516,2.41593 10.61484,-10.35635 c 5.83815,-5.696 12.79791,-12.2161 15.46612,-14.48912 l 4.85129,-4.13276 -104.85129,0.32143 -104.85129,0.32144 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.075,2.07206 -5,3.03945 C 148.90001,138.09589 125.81238,159.01857 118.08754,170.5 108.63532,184.54883 100,201.34316 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723076,9.73442 -1.879853,18.48392 -2.150208,120 l -0.291618,109.5 5.280547,-0.34196 c 2.904296,-0.18808 30.030546,-2.21308 60.280546,-4.5 z M 96.666667,393.33333 c -2.666488,-2.66648 1.360837,-11.27365 6.215963,-13.28472 7.14402,-2.95914 8.31381,4.56969 1.81809,11.70139 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 133.5,243.72943 c -11.56591,-6.47016 -10.97605,-23.58879 1.37655,-39.9497 5.0112,-6.63728 10.4569,-9.81827 17.9756,-10.50004 10.2478,-0.92924 19.58717,4.77919 22.22534,13.58461 3.19988,10.68024 -8.26344,30.70193 -21.14321,36.92847 -6.24262,3.0179 -14.97471,2.99084 -20.43428,-0.0633 z m 17.38156,-3.16818 c 4.37331,-2.26153 10.42864,-15.06914 10.94289,-23.14528 C 162.55997,205.86496 158.72026,201 148.86802,201 c -5.29136,0 -6.23827,0.3397 -9.72328,3.4882 -7.66306,6.92312 -12.36783,23.31214 -8.71819,30.36976 0.9188,1.77677 3.1112,4.1089 4.872,5.18252 3.8394,2.34102 11.56383,2.59916 15.58301,0.52077 z m 19.5546,-28.74323 c 0.0556,-4.94785 -0.30958,-6.07206 -2.82635,-8.70105 -1.5896,-1.66048 -4.22267,-3.48357 -5.85125,-4.05129 l -2.96107,-1.03224 3.54475,3.92362 c 4.0932,4.53068 5.0597,8.38972 4.45999,17.8079 l -0.42812,6.72352 1.99911,-4.49424 c 1.19224,-2.68031 2.02487,-6.78756 2.06294,-10.17622 z m 484.28972,225.36722 c -0.67423,-1.36753 -2.23953,-2.85458 -3.47844,-3.30455 -2.13947,-0.77706 -2.17914,-0.70609 -0.79027,1.4136 0.80426,1.22746 2.0113,4.70088 2.68231,7.71873 l 1.22002,5.48698 0.79613,-4.41417 c 0.53509,-2.96684 0.39419,-5.22943 -0.42975,-6.90059 z M 212.76557,315.25 213.03115,287 l -6.43865,0 c -5.85969,0 -6.71596,0.27731 -9.52265,3.08399 C 189.94399,297.20985 186,308.13283 186,320.74222 c 0,8.65022 1.52308,12.83724 6.05766,16.65284 3.69569,3.10973 6.49942,4.37075 12.44234,5.59614 8.66009,1.78567 7.9661,4.11485 8.26557,-27.7412 z m 393.96554,12.58014 c 1.70478,-2.5761 2.76539,-5.77217 3.04854,-9.18653 0.38298,-4.6183 0.10205,-5.63075 -2.38135,-8.5821 -2.72086,-3.23356 -9.33508,-6.99442 -12.38043,-7.03955 -0.81518,-0.0121 0.1492,1.08657 2.14307,2.44143 4.53895,3.0843 7.83906,9.71556 7.83906,15.75185 0,3.57071 -0.76429,5.71951 -3.45814,9.72256 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z"
+       id="path3596"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#c1a64e"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 33.0905,-45.21427 C 573.09104,662.15881 616.32994,612.35817 625.47343,553.51189 630.82941,519.04146 626.2164,489.04975 610.55208,456.5 593.67097,421.42184 567.05293,390.7268 522,354.38472 508.46102,343.46345 497.60709,333.22691 491.69261,325.80126 486.40336,319.16057 480.98073,307.24383 480.34067,300.85431 478.46172,282.09716 501.94043,258.06606 551,228.53259 c 7.975,-4.80089 14.35844,-9.2219 14.18542,-9.82447 -0.17301,-0.60257 -6.02301,-10.48507 -13,-21.9611 -6.97698,-11.47604 -17.104,-28.15136 -22.50448,-37.05627 -19.75059,-32.56694 -30.59076,-50.23371 -31.94268,-52.05858 -1.32293,-1.78574 -1.70672,-1.68481 -8.73277,2.29661 -10.02927,5.68322 -27.54445,17.79836 -38.99186,26.97041 -13.34339,10.69119 -37.77561,34.75387 -47.31646,46.60081 -21.4027,26.57589 -37.83497,58.81657 -43.08816,84.54052 -10.0646,49.28448 1.56594,92.93021 36.52586,137.06995 7.59059,9.58374 30.28096,31.95222 39.43438,38.87496 32.64949,24.69282 54.97924,47.93538 63.43075,66.0237 3.22871,6.91024 3.5,8.22723 3.5,16.99087 0,8.46464 -0.30827,10.09942 -2.82857,15 -8.46223,16.45436 -25.66538,30.82285 -55.3746,46.25019 l -13.26134,6.88633 2.35894,4.68174 c 1.29742,2.57496 3.82314,7.83174 5.61272,11.68174 5.46101,11.74852 33.45169,71.25784 39.39248,83.75 3.07331,6.4625 5.84782,11.75 6.16557,11.75 0.31775,0 6.28307,-2.90892 13.25626,-6.46427 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.15976,-5.53676 8.93037,-6.17342 18.42425,-15.2217 23.09887,-22.0147 38.73024,-50.57281 45.70399,-83.5 4.39923,-20.77134 4.71557,-26.33432 5.18852,-91.24307 l 0.45717,-62.74308 -2.97391,-3.75692 C 356.38783,408.17128 347.00824,392.25826 341.89723,381.5 323.3654,342.49197 318.75984,298.17725 328.84897,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.29963,192.37152 c -0.33626,215.89031 0.33023,197.4683 -7.75755,214.4203 -6.94716,14.56126 -14.57608,19.51296 -28.06594,18.21675 -6.0105,-0.57753 -8.5281,-2.69234 -12.84334,-10.78856 -6.58269,-12.35041 -9.90014,-33.15394 -10.77784,-67.58732 l -0.58908,-23.11034 -4.10074,0.38984 c -5.75323,0.54694 -83.044463,6.26248 -94.779091,7.00874 -5.323087,0.33852 -10.183506,0.9277 -10.80093,1.30929 -1.433872,0.88618 0.277225,39.51845 2.509949,56.66835 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 135.63191,-5.57796 c 11.61031,-10.94819 23.21862,-15.96932 31.31283,-13.54423 5.81657,1.74268 8.05526,5.1526 8.05526,12.26956 l 0,5.86514 17.43363,0 17.43363,0 -10.73564,-22.75 c -5.9046,-12.5125 -16.98778,-36.09711 -24.62929,-52.41024 l -13.89365,-29.66024 -3.23027,11.16024 c -9.97085,34.44813 -27.69934,63.35739 -53.00694,86.43664 l -7.87147,7.17838 17.13191,0.0226 17.13191,0.0226 4.86809,-4.59047 z M 393,688.46788 c 0,-1.39266 -0.65204,-4.09266 -1.44897,-6 C 390.27565,679.41547 389.66801,679 386.4791,679 c -4.27534,0 -10.59619,3.46211 -15.43436,8.45384 L 367.60767,691 l 12.69616,0 12.69617,0 0,-2.53212 z m 5.7556,-7.22063 c -0.69058,-1.40164 -2.1992,-2.89067 -3.3525,-3.30898 -2.09322,-0.75922 -2.09366,-0.7542 -0.25,2.86203 1.0158,1.99242 1.8469,4.39063 1.8469,5.32935 0,0.93873 0.31686,2.53108 0.70414,3.53856 0.54292,1.41241 0.88763,0.94984 1.5056,-2.02037 0.53621,-2.57727 0.38591,-4.69559 -0.45414,-6.40059 z m 212.70572,-16.1201 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.38687 6.10208,-8.87886 0,-0.49199 1.62187,-3.30225 3.60415,-6.24502 5.27969,-7.8379 6.65419,-10.97105 11.12112,-25.35049 7.66504,-24.67446 7.29965,-14.92707 7.1973,-192 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.87427,-18.27161 -4.22677,-24.01346 -8.38835,-35.6117 -7.19458,-20.05115 -18.72435,-37.72622 -34.06291,-52.2182 -10.14729,-9.58724 -16.9619,-14.81599 -24.33256,-18.67 -2.85958,-1.49523 -5.45093,-3.12587 -5.75857,-3.62364 -1.00249,-1.62205 -7.69529,-4.55249 -19.92365,-8.72354 -11.38573,-3.88363 -17.60983,-5.30716 -30.73653,-7.02984 l -5.73653,-0.75283 2.6701,4.56487 c 1.46855,2.51069 17.67897,29.2759 36.02315,59.47826 18.34417,30.20236 32.99907,55.25825 32.56643,55.67974 -0.43264,0.4215 -8.43662,4.99943 -17.78662,10.17317 -39.51763,21.86676 -66.07136,40.12931 -75.42007,51.87079 -2.24396,2.8183 -4.07993,5.44788 -4.07993,5.84351 0,0.96387 5.86368,9.01941 6.56529,9.01941 0.30401,0 0.25998,-0.47371 -0.0978,-1.05268 -1.08061,-1.74846 4.35561,-11.5817 9.10372,-16.46715 5.20177,-5.35222 12.70521,-9.1209 19.96589,-10.02807 11.30663,-1.41267 23.81571,5.16903 27.97117,14.71715 1.03664,2.38191 1.97956,4.47643 2.09536,4.65449 0.11581,0.17805 1.58003,-0.38445 3.25383,-1.25 4.95754,-2.56365 14.74396,-2.07502 21.01339,1.04917 12.85664,6.40673 14.44715,21.1337 3.58699,33.21281 -6.33166,7.04233 -13.97942,10.66884 -22.45779,10.64931 -4.14682,-0.01 -7.7213,-0.63767 -9.87351,-1.73497 -3.3133,-1.6893 -3.42621,-1.67565 -6.32672,0.76497 -3.43762,2.89257 -4.11952,3.00955 -5.79248,0.99375 -1.01997,-1.22898 -0.72552,-1.97635 1.67441,-4.25 1.60161,-1.51733 3.65522,-3.83827 4.56358,-5.15765 l 1.65157,-2.39888 3.58637,3.14888 c 2.65753,2.33334 4.55669,3.14887 7.33288,3.14887 3.24445,0 4.49762,-0.77054 9.35149,-5.75 3.08273,-3.1625 6.10615,-6.73292 6.71869,-7.93426 1.65994,-3.25552 1.34948,-8.40735 -0.74162,-12.30642 C 594.83649,306.84088 583.18586,302.66127 580,306.5 c -1.94445,2.34291 -2.83396,1.83144 -5.0634,-2.91148 -3.96024,-8.42506 -13.38407,-12.60288 -28.34553,-12.56628 -7.11536,0.0174 -9.54623,0.39772 -11.18547,1.75 -3.42913,2.82883 -7.42881,8.78315 -9.42001,14.02355 l -1.86715,4.91396 3.69078,3.48933 c 2.02993,1.91912 10.44078,8.92147 18.69078,15.56076 26.11554,21.01681 46.52549,41.06856 63.86095,62.74016 8.17878,10.22455 23.10816,32.25195 24.20812,35.71763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 9.01916,-3.46097 16.06049,-2.92856 20.5423,1.55324 2.79819,2.79819 2.93956,3.3303 2.57921,9.70762 -0.30327,5.36711 -1.22965,8.51528 -4.52919,15.39169 l -4.14794,8.64454 1.98648,6.32431 c 10.06188,32.03373 10.41324,72.30029 0.92529,106.04044 -8.68452,30.88303 -26.52416,60.47498 -53.33057,88.46338 l -10.24467,10.6964 7,-3.81081 c 3.85,-2.09595 10.1326,-5.89303 13.96132,-8.43796 z m 39.20535,-65.79382 c -2.68522,-2.68521 1.36858,-11.27686 6.2808,-13.31157 2.73085,-1.13116 3.40289,-1.09997 4.722,0.21914 3.43682,3.43682 -2.25858,13.7591 -7.5917,13.7591 -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 420.28012,562.56378 c 20.69513,-10.13707 31.01224,-16.74672 39.80968,-25.50404 9.17994,-9.13806 9.43378,-9.77094 6.29816,-15.70254 -6.1687,-11.66925 -18.78602,-24.59824 -42.97907,-44.04073 -8.30011,-6.67029 -17.82318,-14.65722 -21.16236,-17.74871 l -6.07125,-5.62091 -0.44972,49.77658 c -0.35878,39.71062 -0.77732,51.69768 -2.06971,59.27657 -2.38445,13.98311 -2.63013,13.32081 3.87427,10.44426 3.04157,-1.34512 13.27907,-6.24134 22.75,-10.88048 z m -13.61345,-49.23045 c -2.66649,-2.66648 1.36083,-11.27365 6.21596,-13.28472 7.14402,-2.95914 8.31381,4.56969 1.81809,11.70139 -1.94173,2.13184 -6.57285,3.04453 -8.03405,1.58333 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-56.92134 c 0.0387,-2.90516 -0.58175,-6.84266 -1.37868,-8.75 C 646.24374,435.3391 645.71513,435 642.14513,435 l -3.95692,0 4.6559,10.34949 c 4.98801,11.08777 5.95896,11.38587 6.0856,1.86839 z M 157.5,449.65804 l 55,-4.15804 0.25955,-48.81492 c 0.1445,-27.17561 -0.12278,-48.57863 -0.60292,-48.28188 -1.6457,1.0171 -13.40475,-1.49533 -18.01853,-3.84981 -2.55096,-1.30179 -5.85812,-3.65273 -7.34925,-5.22432 -10.10911,-10.65448 -6.50948,-38.17265 6.78231,-51.8489 4.57474,-4.70706 13.18374,-9.45306 17.17884,-9.4704 L 213,278 l 0,-78.5 c 0,-66.5069 0.21325,-78.5 1.39581,-78.5 0.7677,0 27.6552,2.94589 59.75,6.54642 32.09481,3.60053 72.51187,8.08892 89.8157,9.9742 l 31.46151,3.42778 10.53849,-10.37841 c 5.79617,-5.70812 12.72157,-12.23728 15.38978,-14.50923 l 4.85129,-4.13081 -104.85129,0.32143 -104.85129,0.32144 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.06936,2.07664 -4.98746,3.04963 C 148.5721,138.33122 125.90921,158.85544 118.08366,170.5 108.61137,184.59494 100,201.34627 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723076,9.73442 -1.879853,18.48392 -2.150208,120 l -0.291618,109.5 5.280547,-0.34196 c 2.904296,-0.18808 30.030546,-2.21308 60.280546,-4.5 z M 96.666667,393.33333 c -2.666488,-2.66648 1.360837,-11.27365 6.215963,-13.28472 7.14402,-2.95914 8.31381,4.56969 1.81809,11.70139 -1.94173,2.13184 -6.572854,3.04453 -8.034053,1.58333 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 133.5,243.72943 c -11.56591,-6.47016 -10.97605,-23.58879 1.37655,-39.9497 5.0112,-6.63728 10.4569,-9.81827 17.9756,-10.50004 10.2478,-0.92924 19.58717,4.77919 22.22534,13.58461 3.19988,10.68024 -8.26344,30.70193 -21.14321,36.92847 -6.24262,3.0179 -14.97471,2.99084 -20.43428,-0.0633 z m 17.38156,-3.16818 c 4.37331,-2.26153 10.42864,-15.06914 10.94289,-23.14528 C 162.55997,205.86496 158.72026,201 148.86802,201 c -5.29136,0 -6.23827,0.3397 -9.72328,3.4882 -7.66306,6.92312 -12.36783,23.31214 -8.71819,30.36976 0.9188,1.77677 3.1112,4.1089 4.872,5.18252 3.8394,2.34102 11.56383,2.59916 15.58301,0.52077 z m 19.5546,-28.74323 c 0.0556,-4.94785 -0.30958,-6.07206 -2.82635,-8.70105 -1.5896,-1.66048 -4.22267,-3.48357 -5.85125,-4.05129 l -2.96107,-1.03224 3.54475,3.92362 c 4.0932,4.53068 5.0597,8.38972 4.45999,17.8079 l -0.42812,6.72352 1.99911,-4.49424 c 1.19224,-2.68031 2.02487,-6.78756 2.06294,-10.17622 z m 484.28972,225.36722 c -0.67423,-1.36753 -2.23953,-2.85458 -3.47844,-3.30455 -2.13947,-0.77706 -2.17914,-0.70609 -0.79027,1.4136 0.80426,1.22746 2.0113,4.70088 2.68231,7.71873 l 1.22002,5.48698 0.79613,-4.41417 c 0.53509,-2.96684 0.39419,-5.22943 -0.42975,-6.90059 z M 212.76557,315.25 213.03115,287 l -6.43865,0 c -5.85969,0 -6.71596,0.27731 -9.52265,3.08399 C 189.94399,297.20985 186,308.13283 186,320.74222 c 0,8.65022 1.52308,12.83724 6.05766,16.65284 3.69569,3.10973 6.49942,4.37075 12.44234,5.59614 8.66009,1.78567 7.9661,4.11485 8.26557,-27.7412 z m 393.96554,12.58014 c 1.70478,-2.5761 2.76539,-5.77217 3.04854,-9.18653 0.38298,-4.6183 0.10205,-5.63075 -2.38135,-8.5821 -2.72086,-3.23356 -9.33508,-6.99442 -12.38043,-7.03955 -0.81518,-0.0121 0.1492,1.08657 2.14307,2.44143 4.53895,3.0843 7.83906,9.71556 7.83906,15.75185 0,3.57071 -0.76429,5.71951 -3.45814,9.72256 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z"
+       id="path3594"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#e09f34"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 33.0905,-45.21427 C 573.09104,662.15881 616.32994,612.35817 625.47343,553.51189 630.82941,519.04146 626.2164,489.04975 610.55208,456.5 593.67097,421.42184 567.05293,390.7268 522,354.38472 508.46102,343.46345 497.60709,333.22691 491.69261,325.80126 486.40336,319.16057 480.98073,307.24383 480.34067,300.85431 478.46172,282.09716 501.94043,258.06606 551,228.53259 c 7.975,-4.80089 14.35844,-9.2219 14.18542,-9.82447 -0.17301,-0.60257 -6.02301,-10.48507 -13,-21.9611 -6.97698,-11.47604 -17.104,-28.15136 -22.50448,-37.05627 -19.75059,-32.56694 -30.59076,-50.23371 -31.94268,-52.05858 -1.32293,-1.78574 -1.70672,-1.68481 -8.73277,2.29661 -10.02927,5.68322 -27.54445,17.79836 -38.99186,26.97041 -13.34339,10.69119 -37.77561,34.75387 -47.31646,46.60081 -21.4027,26.57589 -37.83497,58.81657 -43.08816,84.54052 -10.0646,49.28448 1.56594,92.93021 36.52586,137.06995 7.59059,9.58374 30.28096,31.95222 39.43438,38.87496 32.64949,24.69282 54.97924,47.93538 63.43075,66.0237 3.22871,6.91024 3.5,8.22723 3.5,16.99087 0,8.46464 -0.30827,10.09942 -2.82857,15 -8.46223,16.45436 -25.66538,30.82285 -55.3746,46.25019 l -13.26134,6.88633 2.35894,4.68174 c 1.29742,2.57496 3.82314,7.83174 5.61272,11.68174 5.46101,11.74852 33.45169,71.25784 39.39248,83.75 3.07331,6.4625 5.84782,11.75 6.16557,11.75 0.31775,0 6.28307,-2.90892 13.25626,-6.46427 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.15976,-5.53676 8.93037,-6.17342 18.42425,-15.2217 23.09887,-22.0147 38.73024,-50.57281 45.70399,-83.5 4.39923,-20.77134 4.71557,-26.33432 5.18852,-91.24307 l 0.45717,-62.74308 -2.97391,-3.75692 C 356.38783,408.17128 347.00824,392.25826 341.89723,381.5 323.3654,342.49197 318.75984,298.17725 328.84897,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.29963,192.37152 c -0.33626,215.89031 0.33023,197.4683 -7.75755,214.4203 -6.94716,14.56126 -14.57608,19.51296 -28.06594,18.21675 -6.0105,-0.57753 -8.5281,-2.69234 -12.84334,-10.78856 -6.58269,-12.35041 -9.90014,-33.15394 -10.77784,-67.58732 l -0.58908,-23.11034 -4.10074,0.38984 c -5.75323,0.54694 -83.044463,6.26248 -94.779091,7.00874 -5.323087,0.33852 -10.183506,0.9277 -10.80093,1.30929 -1.433872,0.88618 0.277225,39.51845 2.509949,56.66835 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 135.78637,-5.60006 c 10.95231,-10.71748 23.02794,-15.95807 31.15837,-13.52213 5.81657,1.74268 8.05526,5.1526 8.05526,12.26956 l 0,5.86514 17.43363,0 17.43363,0 -10.73564,-22.75 c -5.9046,-12.5125 -16.98778,-36.09711 -24.62929,-52.41024 l -13.89365,-29.66024 -3.23027,11.16024 c -9.97085,34.44813 -27.69934,63.35739 -53.00694,86.43664 l -7.87147,7.17838 17.28637,0.0226 17.28636,0.0226 4.71364,-4.61257 z M 393,688.46788 c 0,-1.39266 -0.65204,-4.09266 -1.44897,-6 C 390.27565,679.41547 389.66801,679 386.4791,679 c -4.27534,0 -10.59619,3.46211 -15.43436,8.45384 L 367.60767,691 l 12.69616,0 12.69617,0 0,-2.53212 z m 5.7556,-7.22063 c -0.69058,-1.40164 -2.1992,-2.89067 -3.3525,-3.30898 -2.09322,-0.75922 -2.09366,-0.7542 -0.25,2.86203 1.0158,1.99242 1.8469,4.39063 1.8469,5.32935 0,0.93873 0.31686,2.53108 0.70414,3.53856 0.54292,1.41241 0.88763,0.94984 1.5056,-2.02037 0.53621,-2.57727 0.38591,-4.69559 -0.45414,-6.40059 z m 212.70572,-16.1201 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.38687 6.10208,-8.87886 0,-0.49199 1.62187,-3.30225 3.60415,-6.24502 5.27969,-7.8379 6.65419,-10.97105 11.12112,-25.35049 7.66504,-24.67446 7.29965,-14.92707 7.1973,-192 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.87427,-18.27161 -4.22677,-24.01346 -8.38835,-35.6117 -7.19458,-20.05115 -18.72435,-37.72622 -34.06291,-52.2182 -10.14729,-9.58724 -16.9619,-14.81599 -24.33256,-18.67 -2.85958,-1.49523 -5.45093,-3.12587 -5.75857,-3.62364 -1.00249,-1.62205 -7.69529,-4.55249 -19.92365,-8.72354 -11.38573,-3.88363 -17.60983,-5.30716 -30.73653,-7.02984 l -5.73653,-0.75283 2.6701,4.56487 c 1.46855,2.51069 17.67897,29.2759 36.02315,59.47826 18.34417,30.20236 32.99907,55.25825 32.56643,55.67974 -0.43264,0.4215 -8.43662,4.99943 -17.78662,10.17317 -39.51763,21.86676 -66.07136,40.12931 -75.42007,51.87079 -2.24396,2.8183 -4.07993,5.44788 -4.07993,5.84351 0,0.96387 5.86368,9.01941 6.56529,9.01941 0.30401,0 0.25998,-0.47371 -0.0978,-1.05268 -1.11743,-1.80805 4.45358,-11.71044 9.33376,-16.59062 8.76682,-8.76683 19.93419,-11.93735 31.05534,-8.81692 7.46037,2.09328 13.93872,7.39584 16.65168,13.62947 1.03664,2.38191 1.95228,4.44916 2.03475,4.59388 0.0825,0.14472 1.77959,-0.41778 3.77137,-1.25 4.95179,-2.06899 14.25226,-1.89554 19.18566,0.3578 2.2,1.00486 5.47031,3.33839 7.26735,5.18563 16.66011,17.12545 -12.75836,48.57286 -35.04042,37.4571 -2.79832,-1.39598 -3.14835,-1.33685 -5.92716,1.00137 -3.43762,2.89257 -4.11952,3.00955 -5.79248,0.99375 -1.01997,-1.22898 -0.72552,-1.97635 1.67441,-4.25 1.60161,-1.51733 3.65522,-3.83827 4.56358,-5.15765 l 1.65157,-2.39888 3.58637,3.14888 c 2.65753,2.33334 4.55669,3.14887 7.33288,3.14887 3.24445,0 4.49762,-0.77054 9.35149,-5.75 3.08273,-3.1625 6.10615,-6.73292 6.71869,-7.93426 1.65994,-3.25552 1.34948,-8.40735 -0.74162,-12.30642 C 594.83649,306.84088 583.18586,302.66127 580,306.5 c -1.94445,2.34291 -2.83396,1.83144 -5.0634,-2.91148 -3.96024,-8.42506 -13.38407,-12.60288 -28.34553,-12.56628 -7.11536,0.0174 -9.54623,0.39772 -11.18547,1.75 -3.42913,2.82883 -7.42881,8.78315 -9.42001,14.02355 l -1.86715,4.91396 3.69078,3.48933 c 2.02993,1.91912 10.44078,8.92147 18.69078,15.56076 26.11554,21.01681 46.52549,41.06856 63.86095,62.74016 8.17878,10.22455 23.10816,32.25195 24.20812,35.71763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 9.01916,-3.46097 16.06049,-2.92856 20.5423,1.55324 2.79581,2.79581 2.93931,3.33398 2.58021,9.67646 -0.29205,5.15835 -1.24169,8.52951 -4.09448,14.53518 -2.04284,4.30054 -4.12267,7.56675 -4.62186,7.25824 -0.49918,-0.30852 0.2029,2.92285 1.56019,7.18082 10.53932,33.06302 11.05688,73.08071 1.38979,107.4579 -8.68452,30.88303 -26.52416,60.47498 -53.33057,88.46338 l -10.24467,10.6964 7,-3.81081 c 3.85,-2.09595 10.1326,-5.89303 13.96132,-8.43796 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 665.10037,589.6718 659.48773,600 654.07777,600 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 420.28012,562.56378 c 20.69513,-10.13707 31.01224,-16.74672 39.80968,-25.50404 9.17994,-9.13806 9.43378,-9.77094 6.29816,-15.70254 -6.1687,-11.66925 -18.78602,-24.59824 -42.97907,-44.04073 -8.30011,-6.67029 -17.82318,-14.65722 -21.16236,-17.74871 l -6.07125,-5.62091 -0.44972,49.77658 c -0.35878,39.71062 -0.77732,51.69768 -2.06971,59.27657 -2.38445,13.98311 -2.63013,13.32081 3.87427,10.44426 3.04157,-1.34512 13.27907,-6.24134 22.75,-10.88048 z m -13.61345,-49.23045 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 421.10037,503.6718 415.48773,514 410.07777,514 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-56.92134 c 0.0387,-2.90516 -0.58175,-6.84266 -1.37868,-8.75 C 646.24374,435.3391 645.71513,435 642.14513,435 l -3.95692,0 4.6559,10.34949 c 4.98801,11.08777 5.95896,11.38587 6.0856,1.86839 z M 157.5,449.65804 l 55,-4.15804 0.25958,-48.86066 c 0.20996,-39.52039 0.0134,-48.76622 -1.028,-48.36658 -2.39022,0.91721 -12.87352,-1.31099 -17.71818,-3.76597 C 184.97846,339.92844 181,332.69427 181,320.84408 c 0,-12.63603 4.98167,-25.66785 12.8012,-33.48738 4.81466,-4.81467 13.00195,-9.32979 16.9488,-9.34693 L 213,278 l 0,-78.5 c 0,-66.5069 0.21325,-78.5 1.39581,-78.5 0.7677,0 27.6552,2.94589 59.75,6.54642 32.09481,3.60053 72.51187,8.08892 89.8157,9.9742 l 31.46151,3.42778 10.53849,-10.37841 c 5.79617,-5.70812 12.72157,-12.23728 15.38978,-14.50923 l 4.85129,-4.13081 -104.85129,0.32143 -104.85129,0.32144 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.06936,2.07664 -4.98746,3.04963 C 148.5721,138.33122 125.90921,158.85544 118.08366,170.5 108.61137,184.59494 100,201.34627 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723076,9.73442 -1.879853,18.48392 -2.150208,120 l -0.291618,109.5 5.280547,-0.34196 c 2.904296,-0.18808 30.030546,-2.21308 60.280546,-4.5 z M 96.666667,393.33333 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 111.10037,383.6718 105.48773,394 100.07777,394 c -1.509439,0 -3.044437,-0.3 -3.411103,-0.66667 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 30.08601,-140.36508 c -12.23095,-6.54448 -11.77597,-23.75536 1.06254,-40.1937 4.96149,-6.35267 9.98705,-9.45063 16.59669,-10.23088 12.76997,-1.50746 23.67265,6.63261 23.67265,17.67429 0,9.9569 -8.10608,23.78585 -17.89391,30.52699 -4.93011,3.3955 -6.5045,3.93828 -12.32153,4.24792 -5.5438,0.2951 -7.41963,-0.0465 -11.11644,-2.02462 z m 16.82882,-3.21289 c 4.37331,-2.26153 10.42864,-15.06914 10.94289,-23.14528 C 162.55997,205.86496 158.72026,201 148.86802,201 c -5.29136,0 -6.23827,0.3397 -9.72328,3.4882 -7.66306,6.92312 -12.36783,23.31214 -8.71819,30.36976 0.9188,1.77677 3.1112,4.1089 4.872,5.18252 3.8394,2.34102 11.56383,2.59916 15.58301,0.52077 z m 19.5546,-28.74323 c 0.0556,-4.94785 -0.30958,-6.07206 -2.82635,-8.70105 -1.5896,-1.66048 -4.22267,-3.48357 -5.85125,-4.05129 l -2.96107,-1.03224 3.54475,3.92362 c 4.0932,4.53068 5.0597,8.38972 4.45999,17.8079 l -0.42812,6.72352 1.99911,-4.49424 c 1.19224,-2.68031 2.02487,-6.78756 2.06294,-10.17622 z m 484.28972,225.36722 c -0.67423,-1.36753 -2.23953,-2.85458 -3.47844,-3.30455 -2.13947,-0.77706 -2.17914,-0.70609 -0.79027,1.4136 0.80426,1.22746 2.0113,4.70088 2.68231,7.71873 l 1.22002,5.48698 0.79613,-4.41417 c 0.53509,-2.96684 0.39419,-5.22943 -0.42975,-6.90059 z M 212.76557,315.25 213.03115,287 l -6.43865,0 c -5.85969,0 -6.71596,0.27731 -9.52265,3.08399 C 189.94399,297.20985 186,308.13283 186,320.74222 c 0,8.65022 1.52308,12.83724 6.05766,16.65284 3.69569,3.10973 6.49942,4.37075 12.44234,5.59614 8.66009,1.78567 7.9661,4.11485 8.26557,-27.7412 z m 393.96554,12.58014 c 1.70478,-2.5761 2.76539,-5.77217 3.04854,-9.18653 0.38298,-4.6183 0.10205,-5.63075 -2.38135,-8.5821 -2.72086,-3.23356 -9.33508,-6.99442 -12.38043,-7.03955 -0.81518,-0.0121 0.1492,1.08657 2.14307,2.44143 4.53895,3.0843 7.83906,9.71556 7.83906,15.75185 0,3.57071 -0.76429,5.71951 -3.45814,9.72256 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z"
+       id="path3592"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#c8a644"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 33.0905,-45.21427 C 573.09104,662.15881 616.32994,612.35817 625.47343,553.51189 630.82941,519.04146 626.2164,489.04975 610.55208,456.5 593.67097,421.42184 567.05293,390.7268 522,354.38472 508.46102,343.46345 497.60709,333.22691 491.69261,325.80126 486.40336,319.16057 480.98073,307.24383 480.34067,300.85431 478.46172,282.09716 501.94043,258.06606 551,228.53259 c 7.975,-4.80089 14.35844,-9.2219 14.18542,-9.82447 -0.17301,-0.60257 -6.02301,-10.48507 -13,-21.9611 -6.97698,-11.47604 -17.104,-28.15136 -22.50448,-37.05627 -19.75059,-32.56694 -30.59076,-50.23371 -31.94268,-52.05858 -1.32293,-1.78574 -1.70672,-1.68481 -8.73277,2.29661 -10.02927,5.68322 -27.54445,17.79836 -38.99186,26.97041 -13.34339,10.69119 -37.77561,34.75387 -47.31646,46.60081 -21.4027,26.57589 -37.83497,58.81657 -43.08816,84.54052 -10.0646,49.28448 1.56594,92.93021 36.52586,137.06995 7.59059,9.58374 30.28096,31.95222 39.43438,38.87496 32.64949,24.69282 54.97924,47.93538 63.43075,66.0237 3.22871,6.91024 3.5,8.22723 3.5,16.99087 0,8.46464 -0.30827,10.09942 -2.82857,15 -8.46223,16.45436 -25.66538,30.82285 -55.3746,46.25019 l -13.26134,6.88633 2.35894,4.68174 c 1.29742,2.57496 3.82314,7.83174 5.61272,11.68174 5.46101,11.74852 33.45169,71.25784 39.39248,83.75 3.07331,6.4625 5.84782,11.75 6.16557,11.75 0.31775,0 6.28307,-2.90892 13.25626,-6.46427 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.15976,-5.53676 8.93037,-6.17342 18.42425,-15.2217 23.09887,-22.0147 38.73024,-50.57281 45.70399,-83.5 4.39923,-20.77134 4.71557,-26.33432 5.18852,-91.24307 l 0.45717,-62.74308 -2.97391,-3.75692 C 356.38783,408.17128 347.00824,392.25826 341.89723,381.5 323.3654,342.49197 318.75984,298.17725 328.84897,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.29963,192.37152 c -0.33626,215.89031 0.33023,197.4683 -7.75755,214.4203 -6.94716,14.56126 -14.57608,19.51296 -28.06594,18.21675 -6.0105,-0.57753 -8.5281,-2.69234 -12.84334,-10.78856 -6.58269,-12.35041 -9.90014,-33.15394 -10.77784,-67.58732 l -0.58908,-23.11034 -4.10074,0.38984 c -5.75323,0.54694 -83.044463,6.26248 -94.779091,7.00874 -5.323087,0.33852 -10.183506,0.9277 -10.80093,1.30929 -1.433872,0.88618 0.277225,39.51845 2.509949,56.66835 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 135.78637,-5.60006 c 10.95231,-10.71748 23.02794,-15.95807 31.15837,-13.52213 5.81657,1.74268 8.05526,5.1526 8.05526,12.26956 l 0,5.86514 17.43363,0 17.43363,0 -10.73564,-22.75 c -5.9046,-12.5125 -16.98778,-36.09711 -24.62929,-52.41024 l -13.89365,-29.66024 -3.23027,11.16024 c -9.97085,34.44813 -27.69934,63.35739 -53.00694,86.43664 l -7.87147,7.17838 17.28637,0.0226 17.28636,0.0226 4.71364,-4.61257 z M 393,688.46788 c 0,-4.58398 -2.56126,-9.15086 -5.44084,-9.70132 -3.49561,-0.66823 -11.31979,3.37989 -16.20783,8.3857 L 367.5941,691 l 12.70295,0 12.70295,0 0,-2.53212 z m 5.7556,-7.22063 c -0.69058,-1.40164 -2.1992,-2.89067 -3.3525,-3.30898 -2.09322,-0.75922 -2.09366,-0.7542 -0.25,2.86203 1.0158,1.99242 1.8469,4.39063 1.8469,5.32935 0,0.93873 0.31686,2.53108 0.70414,3.53856 0.54292,1.41241 0.88763,0.94984 1.5056,-2.02037 0.53621,-2.57727 0.38591,-4.69559 -0.45414,-6.40059 z m 212.70572,-16.1201 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.38687 6.10208,-8.87886 0,-0.49199 1.62187,-3.30225 3.60415,-6.24502 5.27969,-7.8379 6.65419,-10.97105 11.12112,-25.35049 7.66504,-24.67446 7.29965,-14.92707 7.1973,-192 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.87427,-18.27161 -4.22677,-24.01346 -8.38835,-35.6117 -7.19458,-20.05115 -18.72435,-37.72622 -34.06291,-52.2182 -10.14729,-9.58724 -16.9619,-14.81599 -24.33256,-18.67 -2.85958,-1.49523 -5.45093,-3.12587 -5.75857,-3.62364 -1.00249,-1.62205 -7.69529,-4.55249 -19.92365,-8.72354 -11.38573,-3.88363 -17.60983,-5.30716 -30.73653,-7.02984 l -5.73653,-0.75283 2.6701,4.56487 c 1.46855,2.51069 17.67897,29.2759 36.02315,59.47826 18.34417,30.20236 32.99907,55.25825 32.56643,55.67974 -0.43264,0.4215 -8.43662,4.99943 -17.78662,10.17317 -39.51763,21.86676 -66.07136,40.12931 -75.42007,51.87079 -2.24396,2.8183 -4.07993,5.44788 -4.07993,5.84351 0,0.96387 5.86368,9.01941 6.56529,9.01941 0.30401,0 0.25998,-0.47371 -0.0978,-1.05268 -1.11743,-1.80805 4.45358,-11.71044 9.33376,-16.59062 8.76682,-8.76683 19.93419,-11.93735 31.05534,-8.81692 7.46037,2.09328 13.93872,7.39584 16.65168,13.62947 1.03664,2.38191 1.95228,4.44916 2.03475,4.59388 0.0825,0.14472 1.77959,-0.41778 3.77137,-1.25 4.95179,-2.06899 14.25226,-1.89554 19.18566,0.3578 2.2,1.00486 5.47031,3.33839 7.26735,5.18563 16.66011,17.12545 -12.75836,48.57286 -35.04042,37.4571 -2.79832,-1.39598 -3.14835,-1.33685 -5.92716,1.00137 -3.43762,2.89257 -4.11952,3.00955 -5.79248,0.99375 -1.01997,-1.22898 -0.72552,-1.97635 1.67441,-4.25 1.60161,-1.51733 3.65522,-3.83827 4.56358,-5.15765 l 1.65157,-2.39888 3.58637,3.14888 c 5.48106,4.81243 9.72549,4.41971 15.87027,-1.4684 8.75482,-8.38913 10.60114,-14.17998 6.82252,-21.39833 C 594.97271,306.86509 583.18664,302.66034 580,306.5 c -1.90613,2.29674 -2.64468,1.86544 -4.94596,-2.88837 -2.33852,-4.83074 -7.21408,-8.70557 -13.92977,-11.07063 -6.06499,-2.13591 -22.32506,-2.11077 -25.60692,0.0396 -2.94556,1.93001 -7.94846,9.55556 -9.90232,15.09337 l -1.44253,4.08858 3.66375,3.46293 c 2.01506,1.90461 10.41375,8.89508 18.66375,15.53437 26.11554,21.01681 46.52549,41.06856 63.86095,62.74016 8.17878,10.22455 23.10816,32.25195 24.20812,35.71763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 9.01916,-3.46097 16.06049,-2.92856 20.5423,1.55324 2.79581,2.79581 2.93931,3.33398 2.58021,9.67646 -0.29205,5.15835 -1.24169,8.52951 -4.09448,14.53518 -2.04284,4.30054 -4.12267,7.56675 -4.62186,7.25824 -0.49918,-0.30852 0.2029,2.92285 1.56019,7.18082 10.53932,33.06302 11.05688,73.08071 1.38979,107.4579 -8.68452,30.88303 -26.52416,60.47498 -53.33057,88.46338 l -10.24467,10.6964 7,-3.81081 c 3.85,-2.09595 10.1326,-5.89303 13.96132,-8.43796 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 665.10037,589.6718 659.48773,600 654.07777,600 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 420.28012,562.56378 c 20.69513,-10.13707 31.01224,-16.74672 39.80968,-25.50404 9.17994,-9.13806 9.43378,-9.77094 6.29816,-15.70254 -6.1687,-11.66925 -18.78602,-24.59824 -42.97907,-44.04073 -8.30011,-6.67029 -17.82318,-14.65722 -21.16236,-17.74871 l -6.07125,-5.62091 -0.44972,49.77658 c -0.35878,39.71062 -0.77732,51.69768 -2.06971,59.27657 -2.38445,13.98311 -2.63013,13.32081 3.87427,10.44426 3.04157,-1.34512 13.27907,-6.24134 22.75,-10.88048 z m -13.61345,-49.23045 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 421.10037,503.6718 415.48773,514 410.07777,514 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-56.92134 c 0.12341,-9.27433 -3.09395,-13.69631 -9.0626,-12.45573 -1.36984,0.28472 -0.88655,1.99847 3,10.63811 4.96505,11.03711 5.93605,11.32822 6.0626,1.81762 z M 157.5,449.65804 l 55,-4.15804 0.25958,-48.86066 c 0.20996,-39.52039 0.0134,-48.76622 -1.028,-48.36658 -2.39022,0.91721 -12.87352,-1.31099 -17.71818,-3.76597 C 184.97846,339.92844 181,332.69427 181,320.84408 c 0,-12.63603 4.98167,-25.66785 12.8012,-33.48738 4.81466,-4.81467 13.00195,-9.32979 16.9488,-9.34693 L 213,278 l 0,-78.5 c 0,-66.5069 0.21325,-78.5 1.39581,-78.5 0.7677,0 27.6552,2.94589 59.75,6.54642 32.09481,3.60053 72.51187,8.08892 89.8157,9.9742 l 31.46151,3.42778 10.53849,-10.37841 c 5.79617,-5.70812 12.72157,-12.23728 15.38978,-14.50923 l 4.85129,-4.13081 -104.85129,0.32143 -104.85129,0.32144 -12,2.74842 c -6.6,1.51163 -14.25,3.5927 -17,4.6246 -12.28126,4.60839 -21.11704,8.35178 -22.5,9.53242 -0.825,0.70431 -3.06936,2.07664 -4.98746,3.04963 C 148.5721,138.33122 125.90921,158.85544 118.08366,170.5 108.61137,184.59494 100,201.34627 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723076,9.73442 -1.879853,18.48392 -2.150208,120 l -0.291618,109.5 5.280547,-0.34196 c 2.904296,-0.18808 30.030546,-2.21308 60.280546,-4.5 z M 96.666667,393.33333 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 111.10037,383.6718 105.48773,394 100.07777,394 c -1.509439,0 -3.044437,-0.3 -3.411103,-0.66667 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 30.08601,-140.36508 c -12.23095,-6.54448 -11.77597,-23.75536 1.06254,-40.1937 4.96149,-6.35267 9.98705,-9.45063 16.59669,-10.23088 12.76997,-1.50746 23.67265,6.63261 23.67265,17.67429 0,9.9569 -8.10608,23.78585 -17.89391,30.52699 -4.93011,3.3955 -6.5045,3.93828 -12.32153,4.24792 -5.5438,0.2951 -7.41963,-0.0465 -11.11644,-2.02462 z m 16.87886,-3.03888 c 1.44098,-0.73202 4.07003,-4.39735 6.45336,-8.99704 3.17562,-6.12877 4.10881,-9.12895 4.43554,-14.26009 C 162.56027,205.86017 158.73998,201 148.86802,201 c -5.29136,0 -6.23827,0.3397 -9.72328,3.4882 -7.7523,7.00374 -12.40317,23.2438 -8.70478,30.39569 2.36152,4.56669 7.04297,7.11087 13.06004,7.09763 2.75,-0.006 6.09422,-0.56687 7.4316,-1.24626 z m 19.50456,-28.91724 c 0.0556,-4.94785 -0.30958,-6.07206 -2.82635,-8.70105 -1.5896,-1.66048 -4.22267,-3.48357 -5.85125,-4.05129 l -2.96107,-1.03224 3.54475,3.92362 c 4.0932,4.53068 5.0597,8.38972 4.45999,17.8079 l -0.42812,6.72352 1.99911,-4.49424 c 1.19224,-2.68031 2.02487,-6.78756 2.06294,-10.17622 z m 484.28972,225.36722 c -0.67423,-1.36753 -2.23953,-2.85458 -3.47844,-3.30455 -2.13947,-0.77706 -2.17914,-0.70609 -0.79027,1.4136 0.80426,1.22746 2.0113,4.70088 2.68231,7.71873 l 1.22002,5.48698 0.79613,-4.41417 c 0.53509,-2.96684 0.39419,-5.22943 -0.42975,-6.90059 z M 212.76557,315.25 213.03115,287 l -6.05076,0 c -7.31016,0 -9.74767,1.40388 -14.0333,8.08245 -4.57888,7.13557 -6.94709,15.6711 -6.94709,25.03876 0,9.27911 1.44148,13.3896 6.05766,17.27385 3.69569,3.10973 6.49942,4.37075 12.44234,5.59614 8.66009,1.78567 7.9661,4.11485 8.26557,-27.7412 z m 393.96554,12.58014 c 1.70478,-2.5761 2.76539,-5.77217 3.04854,-9.18653 0.38298,-4.6183 0.10205,-5.63075 -2.38135,-8.5821 -2.72086,-3.23356 -9.33508,-6.99442 -12.38043,-7.03955 -0.81518,-0.0121 0.1492,1.08657 2.14307,2.44143 4.53895,3.0843 7.83906,9.71556 7.83906,15.75185 0,3.57071 -0.76429,5.71951 -3.45814,9.72256 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z"
+       id="path3590"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#c6a544"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 36.6844,-47.11502 c 16.73521,-8.70337 17.37478,-9.07792 33.32959,-19.51861 30.63695,-20.04856 55.81171,-45.18193 70.84907,-70.73259 27.8136,-47.25933 29.34868,-103.67868 4.1853,-153.82338 C 603.28015,441.6091 598.45877,433.93115 588.391,420.5 571.15966,397.5121 552.80497,379.23365 522,354.38472 508.46102,343.46345 497.60709,333.22691 491.69261,325.80126 486.40336,319.16057 480.98073,307.24383 480.34067,300.85431 478.46172,282.09716 501.94043,258.06606 551,228.53259 c 7.975,-4.80089 14.35041,-9.24722 14.16757,-9.88074 -0.18283,-0.63352 -6.03283,-10.49716 -13,-21.91921 -6.96716,-11.42205 -14.61878,-24.02205 -17.00359,-28 -10.06519,-16.7891 -36.15329,-59.37933 -37.42231,-61.09393 -1.3215,-1.7855 -1.61912,-1.72741 -7.30963,1.42674 -13.81936,7.65982 -33.34407,21.62577 -48.93204,35.00089 -12.21402,10.48014 -33.64695,32.56337 -41.66935,42.93366 -19.91825,25.74766 -35.2304,56.59931 -40.22164,81.04052 -10.0646,49.28448 1.56594,92.93021 36.52586,137.06995 7.59059,9.58374 30.28096,31.95222 39.43438,38.87496 22.59963,17.09211 44.25024,37.3586 54.05693,50.6011 18.92758,25.55893 17.79411,44.6422 -3.90407,65.72906 -8.53722,8.29669 -26.73785,20.49434 -42.79835,28.68247 l -11.92478,6.07962 1.86129,3.71116 c 1.02371,2.04114 3.23496,6.63616 4.91388,10.21116 41.04804,87.40517 46.1168,98 46.88494,98 0.36939,0 7.90971,-3.76426 16.75627,-8.36502 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.25202,-5.59936 8.95368,-6.18295 18.9025,-15.7217 25.15757,-24.12062 40.7142,-54.85949 47.06636,-93 2.88747,-17.33735 3.5604,-33.99312 3.60938,-89.33597 l 0.0485,-54.83597 -2.90034,-3.66403 C 356.38081,408.16242 346.9773,392.19323 341.89719,381.5 323.36536,342.49197 318.7598,298.17725 328.84893,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.29963,192.37152 c -0.28459,182.71502 -0.39157,192.72289 -2.13128,199.37151 -4.22675,16.15333 -13.57191,30.2856 -21.47917,32.48199 -6.50878,1.80794 -14.46037,1.26808 -18.14597,-1.23199 -10.71927,-7.27124 -16.57112,-32.53372 -17.68825,-76.36034 l -0.58908,-23.11034 -4.10074,0.38984 c -5.75323,0.54694 -83.044463,6.26248 -94.779091,7.00874 -5.323087,0.33852 -10.183506,0.9277 -10.80093,1.30929 -1.433872,0.88618 0.277225,39.51845 2.509949,56.66835 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 135.78637,-5.60006 c 10.95231,-10.71748 23.02794,-15.95807 31.15837,-13.52213 5.81657,1.74268 8.05526,5.1526 8.05526,12.26956 l 0,5.86514 17.43363,0 17.43363,0 -10.73564,-22.75 c -5.9046,-12.5125 -16.98778,-36.09711 -24.62929,-52.41024 l -13.89365,-29.66024 -3.23027,11.16024 c -9.97085,34.44813 -27.69934,63.35739 -53.00694,86.43664 l -7.87147,7.17838 17.28637,0.0226 17.28636,0.0226 4.71364,-4.61257 z M 393,688.46788 c 0,-4.58398 -2.56126,-9.15086 -5.44084,-9.70132 -3.49561,-0.66823 -11.31979,3.37989 -16.20783,8.3857 L 367.5941,691 l 12.70295,0 12.70295,0 0,-2.53212 z m 5.7556,-7.22063 c -0.69058,-1.40164 -2.1992,-2.89067 -3.3525,-3.30898 -2.09322,-0.75922 -2.09366,-0.7542 -0.25,2.86203 1.0158,1.99242 1.8469,4.39063 1.8469,5.32935 0,0.93873 0.31686,2.53108 0.70414,3.53856 0.54292,1.41241 0.88763,0.94984 1.5056,-2.02037 0.53621,-2.57727 0.38591,-4.69559 -0.45414,-6.40059 z m 212.70572,-16.1201 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.62324,-3.23256 3.60719,-6.24501 5.33118,-8.09492 6.67475,-11.17372 11.11808,-25.4772 7.66504,-24.67446 7.29965,-14.92707 7.1973,-192 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.86903,-18.23827 -4.22426,-23.96624 -8.47112,-35.80375 -2.59457,-7.23199 -6.69234,-16.35233 -9.10616,-20.26743 C 649.97494,179.01373 648,175.64136 648,175.43467 c 0,-0.20669 -2.63274,-3.87655 -5.85054,-8.15524 -9.58574,-12.74611 -27.4693,-28.78383 -38.83605,-34.82758 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -2.58363,-2.25576 -6.99743,-4.16168 -19.54695,-8.44055 -11.3861,-3.88219 -17.61198,-5.30579 -30.73653,-7.02819 l -5.73653,-0.75283 2.67376,4.56487 c 1.47057,2.51069 17.67634,29.28055 36.01282,59.48859 18.33648,30.20804 32.98973,55.26393 32.56277,55.67974 -0.42696,0.41582 -8.42629,4.9891 -17.77629,10.16284 -39.72179,21.97973 -66.02306,40.06865 -75.42007,51.87079 -2.24396,2.8183 -4.07993,5.44788 -4.07993,5.84351 0,0.96387 5.86368,9.01941 6.56529,9.01941 0.30401,0 0.25998,-0.47371 -0.0978,-1.05268 -1.11743,-1.80805 4.45358,-11.71044 9.33376,-16.59062 8.76682,-8.76683 19.93419,-11.93735 31.05534,-8.81692 7.46037,2.09328 13.93872,7.39584 16.65168,13.62947 1.03664,2.38191 1.95228,4.44916 2.03475,4.59388 0.0825,0.14472 1.77959,-0.41778 3.77137,-1.25 4.95179,-2.06899 14.25226,-1.89554 19.18566,0.3578 2.2,1.00486 5.47031,3.33839 7.26735,5.18563 16.66011,17.12545 -12.75836,48.57286 -35.04042,37.4571 -2.79832,-1.39598 -3.14835,-1.33685 -5.92716,1.00137 -3.43762,2.89257 -4.11952,3.00955 -5.79248,0.99375 -1.01997,-1.22898 -0.72552,-1.97635 1.67441,-4.25 1.60161,-1.51733 3.65522,-3.83827 4.56358,-5.15765 l 1.65157,-2.39888 3.58637,3.14888 c 5.48106,4.81243 9.72549,4.41971 15.87027,-1.4684 8.75482,-8.38913 10.60114,-14.17998 6.82252,-21.39833 C 594.97271,306.86509 583.18664,302.66034 580,306.5 c -1.90613,2.29674 -2.64468,1.86544 -4.94596,-2.88837 -2.33852,-4.83074 -7.21408,-8.70557 -13.92977,-11.07063 -6.06499,-2.13591 -22.32506,-2.11077 -25.60692,0.0396 -2.94556,1.93001 -7.94846,9.55556 -9.90232,15.09337 l -1.44253,4.08858 3.66375,3.46293 c 2.01506,1.90461 10.41375,8.89042 18.66375,15.52402 25.69562,20.66115 46.71208,41.31217 63.86095,62.75051 8.17878,10.22455 23.10816,32.25195 24.20812,35.71763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 9.01916,-3.46097 16.06049,-2.92856 20.5423,1.55324 2.79581,2.79581 2.93931,3.33398 2.58021,9.67646 -0.29205,5.15835 -1.24169,8.52951 -4.09448,14.53518 -2.04284,4.30054 -4.12267,7.56675 -4.62186,7.25824 -0.49918,-0.30852 0.2029,2.92285 1.56019,7.18082 10.71705,33.62057 11.06699,75.21179 0.91573,108.83509 -9.70344,32.14001 -26.0687,59.05245 -53.10118,87.32416 l -10,10.45843 7,-3.81081 c 3.85,-2.09595 10.1326,-5.89303 13.96132,-8.43796 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 665.10037,589.6718 659.48773,600 654.07777,600 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 420.28012,562.56378 c 20.69513,-10.13707 31.01224,-16.74672 39.80968,-25.50404 8.75047,-8.71056 9.21303,-9.67891 6.97922,-14.6109 -4.77948,-10.55259 -19.269,-25.53069 -43.66013,-45.13237 -8.30011,-6.67029 -17.82318,-14.65722 -21.16236,-17.74871 l -6.07125,-5.62091 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.30597,14.04662 -2.58087,13.31048 3.90016,10.44426 3.04157,-1.34512 13.27907,-6.24134 22.75,-10.88048 z m -13.61345,-49.23045 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 421.10037,503.6718 415.48773,514 410.07777,514 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-56.92134 c 0.12341,-9.27433 -3.09395,-13.69631 -9.0626,-12.45573 -1.36984,0.28472 -0.88655,1.99847 3,10.63811 4.96505,11.03711 5.93605,11.32822 6.0626,1.81762 z m -481.17971,1.69275 45.25,-3.3812 0,-48.8717 c 0,-39.25758 -0.25141,-48.77523 -1.278,-48.38129 -2.38198,0.91405 -12.87273,-1.31913 -17.7086,-3.76965 C 184.97846,339.92844 181,332.69427 181,320.84408 c 0,-12.63603 4.98167,-25.66785 12.8012,-33.48738 4.81466,-4.81467 13.00195,-9.32979 16.9488,-9.34693 L 213,278 l 0,-78.5 c 0,-66.87935 0.2087,-78.5 1.40982,-78.5 0.7754,0 39.5879,4.25137 86.25,9.44748 46.6621,5.19612 87.10853,9.68898 89.88096,9.98415 l 5.04077,0.53666 7.45923,-7.58372 c 4.10257,-4.17105 10.96743,-10.70465 15.25525,-14.51912 l 7.79604,-6.93539 -104.79604,0.32138 -104.79603,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -7.86267,2.74167 -22.02658,8.77447 -23.5,10.00932 -0.825,0.69141 -3.06936,2.05319 -4.98746,3.02618 C 148.5721,138.33122 125.90921,158.85544 118.08366,170.5 108.61137,184.59494 100,201.34627 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.72316,9.7349 -1.879749,18.48143 -2.14897,120.03409 L 91.941382,454.56818 107.22069,453.43 c 8.40362,-0.62599 35.64181,-2.65971 60.52931,-4.51937 z m -71.083333,-55.5773 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 111.10037,383.6718 105.48773,394 100.07777,394 c -1.509439,0 -3.044437,-0.3 -3.411103,-0.66667 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 30.08601,-140.36508 c -12.23095,-6.54448 -11.77597,-23.75536 1.06254,-40.1937 4.96149,-6.35267 9.98705,-9.45063 16.59669,-10.23088 12.76997,-1.50746 23.67265,6.63261 23.67265,17.67429 0,9.9569 -8.10608,23.78585 -17.89391,30.52699 -4.93011,3.3955 -6.5045,3.93828 -12.32153,4.24792 -5.5438,0.2951 -7.41963,-0.0465 -11.11644,-2.02462 z m 16.87886,-3.03888 c 1.44098,-0.73202 4.07003,-4.39735 6.45336,-8.99704 3.17562,-6.12877 4.10881,-9.12895 4.43554,-14.26009 C 162.56027,205.86017 158.73998,201 148.86802,201 c -5.29136,0 -6.23827,0.3397 -9.72328,3.4882 -7.7523,7.00374 -12.40317,23.2438 -8.70478,30.39569 2.36152,4.56669 7.04297,7.11087 13.06004,7.09763 2.75,-0.006 6.09422,-0.56687 7.4316,-1.24626 z m 19.50456,-28.91724 c 0.0556,-4.94785 -0.30958,-6.07206 -2.82635,-8.70105 -1.5896,-1.66048 -4.22267,-3.48357 -5.85125,-4.05129 l -2.96107,-1.03224 3.54475,3.92362 c 4.0932,4.53068 5.0597,8.38972 4.45999,17.8079 l -0.42812,6.72352 1.99911,-4.49424 c 1.19224,-2.68031 2.02487,-6.78756 2.06294,-10.17622 z m 484.28972,225.36722 c -0.67423,-1.36753 -2.23953,-2.85458 -3.47844,-3.30455 -2.13947,-0.77706 -2.17914,-0.70609 -0.79027,1.4136 0.80426,1.22746 2.0113,4.70088 2.68231,7.71873 l 1.22002,5.48698 0.79613,-4.41417 c 0.53509,-2.96684 0.39419,-5.22943 -0.42975,-6.90059 z M 212.76557,315.25 213.03115,287 l -6.05076,0 c -7.31016,0 -9.74767,1.40388 -14.0333,8.08245 -4.57888,7.13557 -6.94709,15.6711 -6.94709,25.03876 0,9.27911 1.44148,13.3896 6.05766,17.27385 3.69569,3.10973 6.49942,4.37075 12.44234,5.59614 8.66009,1.78567 7.9661,4.11485 8.26557,-27.7412 z m 393.96554,12.58014 c 1.70478,-2.5761 2.76539,-5.77217 3.04854,-9.18653 0.38298,-4.6183 0.10205,-5.63075 -2.38135,-8.5821 -2.72086,-3.23356 -9.33508,-6.99442 -12.38043,-7.03955 -0.81518,-0.0121 0.1492,1.08657 2.14307,2.44143 4.53895,3.0843 7.83906,9.71556 7.83906,15.75185 0,3.57071 -0.76429,5.71951 -3.45814,9.72256 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z"
+       id="path3588"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#c89153"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 37.1844,-47.3449 c 9.12155,-4.7272 17.29507,-9.2272 18.16338,-10 0.86831,-0.77281 1.90743,-1.4051 2.30917,-1.4051 1.36277,0 22.06046,-14.23157 32.55686,-22.38584 64.12447,-49.81598 87.5862,-120.18277 63.35571,-190.0175 C 608.54176,446.471 589.09821,417.30829 561.5032,389.40836 549.87211,377.64875 540.36395,369.17654 524,355.99127 c -15.35686,-12.3738 -26.1506,-22.46014 -32.30739,-30.19001 -5.28925,-6.64069 -10.71188,-18.55743 -11.35194,-24.94695 -1.90771,-19.04424 22.51436,-43.64105 73.53265,-74.05874 6.39467,-3.81258 11.47709,-7.46378 11.29425,-8.11377 -0.18283,-0.64999 -6.03283,-10.52711 -13,-21.94916 -6.96716,-11.42205 -14.61878,-24.02205 -17.00359,-28 -10.06519,-16.7891 -36.15329,-59.37933 -37.42231,-61.09393 -1.32154,-1.78556 -1.61892,-1.72766 -7.30963,1.42328 -10.04995,5.56465 -27.59121,17.56173 -39.028,26.69262 -12.63925,10.09089 -36.56605,33.16428 -46.4075,44.75226 -21.13867,24.89004 -40.03835,61.33966 -45.38753,87.53365 -10.05652,49.24489 1.64102,93.177 36.46736,136.95948 10.1949,12.81667 30.1641,31.95241 46.43822,44.5 18.4845,14.25184 37.46407,32.2765 46.35939,44.02695 2.90038,3.83132 7.15276,10.75767 9.44972,15.39189 3.98087,8.03158 4.1763,8.85278 4.1763,17.54935 0,8.57149 -0.23342,9.59615 -3.858,16.93566 -7.24539,14.67136 -25.88443,29.99093 -54.8756,45.1027 l -12.73359,6.63744 1.84438,3.678 c 1.0144,2.02291 3.21804,6.60301 4.89696,10.17801 41.04804,87.40517 46.1168,98 46.88494,98 0.36939,0 8.13471,-3.86771 17.25627,-8.5949 z M 229,691.98749 c 29.42177,-2.27638 51.77989,-10.45807 73.4051,-26.86174 4.97801,-3.77604 24.47643,-24.16967 28.57335,-29.88521 14.90553,-20.79445 24.74293,-45.30488 29.39551,-73.24054 2.88747,-17.33735 3.5604,-33.99312 3.60938,-89.33597 l 0.0485,-54.83597 -2.90034,-3.66403 C 356.38081,408.16242 346.9773,392.19323 341.89719,381.5 323.36536,342.49197 318.7598,298.17725 328.84893,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 L 247.03483,157.75697 246.7674,350.12849 246.5,542.5 l -2.27289,8 c -3.22806,11.36196 -7.38913,19.68982 -12.6465,25.31037 C 226.4631,581.2814 222.20852,583 213.78186,583 c -7.21626,0 -11.12122,-2.67501 -15.44916,-10.58313 -6.78566,-12.39891 -10.11602,-32.95759 -11.03601,-68.12646 l -0.60714,-23.2096 -4.09478,0.48456 c -4.1605,0.49233 -78.49974,6.05726 -95.265864,7.13147 -5.044102,0.32318 -9.679521,0.90182 -10.300931,1.28587 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 135.78637,-5.60006 c 10.95231,-10.71748 23.02794,-15.95807 31.15837,-13.52213 5.81657,1.74268 8.05526,5.1526 8.05526,12.26956 l 0,5.86514 17.41793,0 17.41793,0 -14.46243,-30.75 c -7.95434,-16.9125 -19.02518,-40.51547 -24.60186,-52.45103 l -10.13943,-21.70104 -3.22821,11.20104 c -9.28228,32.20701 -24.18358,57.49707 -47.69407,80.94495 L 325.91973,691 l 17.0765,0 17.0765,0 4.71364,-4.61257 z M 393,688.46788 c 0,-4.58398 -2.56126,-9.15086 -5.44084,-9.70132 -3.49561,-0.66823 -11.31979,3.37989 -16.20783,8.3857 L 367.5941,691 l 12.70295,0 12.70295,0 0,-2.53212 z m 5.7556,-7.22063 c -0.69058,-1.40164 -2.1992,-2.89067 -3.3525,-3.30898 -2.09322,-0.75922 -2.09366,-0.7542 -0.25,2.86203 1.0158,1.99242 1.8469,4.39063 1.8469,5.32935 0,0.93873 0.31686,2.53108 0.70414,3.53856 0.54292,1.41241 0.88763,0.94984 1.5056,-2.02037 0.53621,-2.57727 0.38591,-4.69559 -0.45414,-6.40059 z m 212.70572,-16.1201 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.62324,-3.23256 3.60719,-6.24501 5.33118,-8.09492 6.67475,-11.17372 11.11808,-25.4772 7.66504,-24.67446 7.29965,-14.92707 7.1973,-192 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.86903,-18.23827 -4.22426,-23.96624 -8.47112,-35.80375 -2.59457,-7.23199 -6.69234,-16.35233 -9.10616,-20.26743 C 649.97494,179.01373 648,175.64136 648,175.43467 c 0,-0.20669 -2.63274,-3.87655 -5.85054,-8.15524 -9.58574,-12.74611 -27.4693,-28.78383 -38.83605,-34.82758 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -3.95736,-3.45517 -27.32543,-11.82288 -38.04695,-13.62398 -7.54124,-1.26684 -18,-2.67859 -18,-2.42968 0,0.0941 16.20929,26.86722 36.02064,59.49583 19.81135,32.6286 35.67385,59.64849 35.25,60.04418 -0.42385,0.3957 -9.09564,5.33565 -19.27064,10.97767 -39.83964,22.09101 -67.57668,41.50164 -75.35722,52.73567 l -2.85723,4.12544 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.23299,-2.04994 4.0141,-11.6539 9.20082,-16.84062 8.76682,-8.76683 19.93419,-11.93735 31.05534,-8.81692 7.46037,2.09328 13.93872,7.39584 16.65168,13.62947 1.03664,2.38191 1.95228,4.44916 2.03475,4.59388 0.0825,0.14472 1.77959,-0.41778 3.77137,-1.25 4.95179,-2.06899 14.25226,-1.89554 19.18566,0.3578 2.2,1.00486 5.47031,3.33839 7.26735,5.18563 16.66011,17.12545 -12.75836,48.57286 -35.04042,37.4571 -2.79832,-1.39598 -3.14835,-1.33685 -5.92716,1.00137 -3.43762,2.89257 -4.11952,3.00955 -5.79248,0.99375 -1.01997,-1.22898 -0.72552,-1.97635 1.67441,-4.25 1.60161,-1.51733 3.65522,-3.83827 4.56358,-5.15765 l 1.65157,-2.39888 3.58637,3.14888 c 5.48106,4.81243 9.72549,4.41971 15.87027,-1.4684 8.75482,-8.38913 10.60114,-14.17998 6.82252,-21.39833 C 594.97271,306.86509 583.18664,302.66034 580,306.5 c -1.90613,2.29674 -2.64468,1.86544 -4.94596,-2.88837 -2.33852,-4.83074 -7.21408,-8.70557 -13.92977,-11.07063 -6.06499,-2.13591 -22.32506,-2.11077 -25.60692,0.0396 -2.94556,1.93001 -7.94846,9.55556 -9.90232,15.09337 l -1.44253,4.08858 3.66375,3.46367 c 2.01506,1.90501 8.38875,7.22389 14.16375,11.81972 25.71155,20.46163 52.42562,46.36944 68.0066,65.95407 8.51873,10.70768 23.45684,32.73408 24.56247,36.21763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 9.01916,-3.46097 16.06049,-2.92856 20.5423,1.55324 2.79581,2.79581 2.93931,3.33398 2.58021,9.67646 -0.29205,5.15835 -1.24169,8.52951 -4.09448,14.53518 -2.04284,4.30054 -4.1581,7.54486 -4.70058,7.20958 -0.54249,-0.33527 -0.30467,1.3211 0.52848,3.68083 2.05192,5.81163 5.94765,21.62588 7.58501,30.79041 0.87132,4.87691 1.32191,15.36926 1.28833,30 -0.0469,20.45488 -0.29367,23.63618 -2.71445,35 -3.64933,17.13107 -7.74058,29.11895 -15.31306,44.86929 -10.52464,21.89067 -22.44026,38.67458 -41.92085,59.0482 l -10,10.45843 7,-3.81081 c 3.85,-2.09595 10.1326,-5.89303 13.96132,-8.43796 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 665.10037,589.6718 659.48773,600 654.07777,600 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 418,563.70154 c 9.625,-4.69696 21.12358,-10.79469 25.55241,-13.5505 8.74615,-5.44225 20.94218,-16.19291 23.6308,-20.83028 1.58514,-2.73406 1.57875,-3.13389 -0.10974,-6.86199 -4.78396,-10.56276 -19.2648,-25.53368 -43.66458,-45.1423 -8.30011,-6.67029 -17.82318,-14.65722 -21.16236,-17.74871 l -6.07125,-5.62091 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.2877,13.93532 -2.44228,13.28132 2.62004,11.08519 2.3375,-1.01405 12.125,-5.68669 21.75,-10.38365 z m -11.33333,-50.36821 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 421.10037,503.6718 415.48773,514 410.07777,514 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-56.92134 c 0.0905,-6.79852 -1.96336,-11.80792 -5.07132,-12.36921 -5.79352,-1.04629 -5.85291,-0.39099 -0.96536,10.65121 4.94597,11.17419 5.90722,11.44776 6.03668,1.718 z m -481.17971,1.69275 45.25,-3.3812 0,-48.8717 c 0,-39.25758 -0.25141,-48.77523 -1.278,-48.38129 -2.38198,0.91405 -12.87273,-1.31913 -17.7086,-3.76965 C 184.97846,339.92844 181,332.69427 181,320.84408 c 0,-12.63603 4.98167,-25.66785 12.8012,-33.48738 4.81466,-4.81467 13.00195,-9.32979 16.9488,-9.34693 L 213,278 l 0,-78.5 c 0,-62.13176 0.26064,-78.50061 1.25,-78.50294 0.6875,-0.002 41.72083,4.52045 91.18517,10.04904 l 89.93517,10.05198 11.06483,-10.86249 c 6.08566,-5.97437 12.99604,-12.53718 15.35641,-14.58401 l 4.29159,-3.72151 -104.79159,0.32137 -104.79158,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -7.86267,2.74167 -22.02658,8.77447 -23.5,10.00932 -0.825,0.69141 -3.06936,2.05319 -4.98746,3.02618 C 148.5721,138.33122 125.90921,158.85544 118.08366,170.5 108.61137,184.59494 100,201.34627 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.72316,9.7349 -1.879749,18.48143 -2.14897,120.03409 L 91.941382,454.56818 107.22069,453.43 c 8.40362,-0.62599 35.64181,-2.65971 60.52931,-4.51937 z m -71.083333,-55.5773 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 111.10037,383.6718 105.48773,394 100.07777,394 c -1.509439,0 -3.044437,-0.3 -3.411103,-0.66667 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 30.08601,-140.36508 c -12.23095,-6.54448 -11.77597,-23.75536 1.06254,-40.1937 4.96149,-6.35267 9.98705,-9.45063 16.59669,-10.23088 12.76997,-1.50746 23.67265,6.63261 23.67265,17.67429 0,9.9569 -8.10608,23.78585 -17.89391,30.52699 -4.93011,3.3955 -6.5045,3.93828 -12.32153,4.24792 -5.5438,0.2951 -7.41963,-0.0465 -11.11644,-2.02462 z m 16.87886,-3.03888 c 1.44098,-0.73202 4.07003,-4.39735 6.45336,-8.99704 3.17562,-6.12877 4.10881,-9.12895 4.43554,-14.26009 C 162.56027,205.86017 158.73998,201 148.86802,201 c -5.29136,0 -6.23827,0.3397 -9.72328,3.4882 -7.7523,7.00374 -12.40317,23.2438 -8.70478,30.39569 2.36152,4.56669 7.04297,7.11087 13.06004,7.09763 2.75,-0.006 6.09422,-0.56687 7.4316,-1.24626 z m 19.50456,-28.91724 c 0.0556,-4.94785 -0.30958,-6.07206 -2.82635,-8.70105 -1.5896,-1.66048 -4.22267,-3.48357 -5.85125,-4.05129 l -2.96107,-1.03224 3.54475,3.92362 c 4.0932,4.53068 5.0597,8.38972 4.45999,17.8079 l -0.42812,6.72352 1.99911,-4.49424 c 1.19224,-2.68031 2.02487,-6.78756 2.06294,-10.17622 z m 484.28972,225.36722 c -0.67423,-1.36753 -2.23953,-2.85458 -3.47844,-3.30455 -2.13947,-0.77706 -2.17914,-0.70609 -0.79027,1.4136 0.80426,1.22746 2.0113,4.70088 2.68231,7.71873 l 1.22002,5.48698 0.79613,-4.41417 c 0.53509,-2.96684 0.39419,-5.22943 -0.42975,-6.90059 z M 212.76557,315.25 213.03115,287 l -6.05076,0 c -7.31016,0 -9.74767,1.40388 -14.0333,8.08245 -4.57888,7.13557 -6.94709,15.6711 -6.94709,25.03876 0,9.27911 1.44148,13.3896 6.05766,17.27385 3.69569,3.10973 6.49942,4.37075 12.44234,5.59614 8.66009,1.78567 7.9661,4.11485 8.26557,-27.7412 z m 393.96554,12.58014 c 1.70478,-2.5761 2.76539,-5.77217 3.04854,-9.18653 0.38298,-4.6183 0.10205,-5.63075 -2.38135,-8.5821 -2.72086,-3.23356 -9.33508,-6.99442 -12.38043,-7.03955 -0.81518,-0.0121 0.1492,1.08657 2.14307,2.44143 4.53895,3.0843 7.83906,9.71556 7.83906,15.75185 0,3.57071 -0.76429,5.71951 -3.45814,9.72256 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z"
+       id="path3586"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#caa33e"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 30.4331,-43.83233 C 548.692,675.05609 586.22617,642.74751 607.31587,605.37987 633.99261,558.11287 634.47295,502.55002 608.6375,452.5 591.05618,418.4404 564.96377,388.83023 522.5,354.74953 c -13.91733,-11.16981 -24.76767,-21.36537 -30.80739,-28.94827 -5.28925,-6.64069 -10.71188,-18.55743 -11.35194,-24.94695 -1.91426,-19.10968 23.92285,-44.93674 74.86605,-74.83692 l 10.70671,-6.28411 -1.39427,-2.61664 C 562.81748,213.92307 500.1217,111.12551 497.95975,107.98416 l -1.54025,-2.23801 -5.95975,3.30021 c -10.07738,5.58033 -27.60804,17.56867 -39.05571,26.70825 -12.63925,10.09089 -36.56605,33.16428 -46.4075,44.75226 -21.13867,24.89004 -40.03835,61.33966 -45.38753,87.53365 -10.05652,49.24489 1.64102,93.177 36.46736,136.95948 10.1949,12.81667 30.1641,31.95241 46.43822,44.5 18.4845,14.25184 37.46407,32.2765 46.35939,44.02695 2.90038,3.83132 7.15276,10.75767 9.44972,15.39189 3.98087,8.03158 4.1763,8.85278 4.1763,17.54935 0,8.57149 -0.23342,9.59615 -3.858,16.93566 -7.24539,14.67136 -25.88443,29.99093 -54.8756,45.1027 l -12.73359,6.63744 1.84438,3.678 c 1.0144,2.02291 3.21804,6.60301 4.89696,10.17801 39.40886,83.9148 46.12631,98 46.73775,98 0.28844,0 5.08191,-2.28705 10.65216,-5.08233 z M 229,691.98749 c 29.42177,-2.27638 51.77989,-10.45807 73.4051,-26.86174 4.97801,-3.77604 24.47643,-24.16967 28.57335,-29.88521 C 345.88398,614.44609 355.72138,589.93566 360.37396,562 363.29481,544.46223 364,527.00735 364,472.24869 l 0,-54.46088 -2.8844,-3.64391 C 356.37933,408.16049 346.97059,392.17903 341.89723,381.5 323.3654,342.49197 318.75984,298.17725 328.84897,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.26743,192.37152 L 246.5,542.5 l -2.27289,8 c -3.22806,11.36196 -7.38913,19.68982 -12.6465,25.31037 C 226.4631,581.2814 222.20852,583 213.78186,583 c -7.21626,0 -11.12122,-2.67501 -15.44916,-10.58313 -6.78566,-12.39891 -10.11602,-32.95759 -11.03601,-68.12646 l -0.60714,-23.2096 -4.09478,0.48456 c -4.1605,0.49233 -78.49974,6.05726 -95.265864,7.13147 -5.044102,0.32318 -9.679521,0.90182 -10.300931,1.28587 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 135.78637,-5.60006 c 10.95231,-10.71748 23.02794,-15.95807 31.15837,-13.52213 5.81657,1.74268 8.05526,5.1526 8.05526,12.26956 l 0,5.86514 17.41793,0 17.41793,0 -14.46243,-30.75 c -7.95434,-16.9125 -19.02518,-40.51547 -24.60186,-52.45103 l -10.13943,-21.70104 -3.22821,11.20104 c -9.28228,32.20701 -24.18358,57.49707 -47.69407,80.94495 L 325.91973,691 l 17.0765,0 17.0765,0 4.71364,-4.61257 z M 393,688.46788 c 0,-4.58398 -2.56126,-9.15086 -5.44084,-9.70132 -3.49561,-0.66823 -11.31979,3.37989 -16.20783,8.3857 L 367.5941,691 l 12.70295,0 12.70295,0 0,-2.53212 z m 5.7556,-7.22063 c -0.69058,-1.40164 -2.1992,-2.89067 -3.3525,-3.30898 -2.09322,-0.75922 -2.09366,-0.7542 -0.25,2.86203 1.0158,1.99242 1.8469,4.39063 1.8469,5.32935 0,0.93873 0.31686,2.53108 0.70414,3.53856 0.54292,1.41241 0.88763,0.94984 1.5056,-2.02037 0.53621,-2.57727 0.38591,-4.69559 -0.45414,-6.40059 z m 212.70572,-16.1201 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.62324,-3.23256 3.60719,-6.24501 5.33118,-8.09492 6.67475,-11.17372 11.11808,-25.4772 7.66504,-24.67446 7.29965,-14.92707 7.1973,-192 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.86903,-18.23827 -4.22426,-23.96624 -8.47112,-35.80375 -2.59457,-7.23199 -6.69234,-16.35233 -9.10616,-20.26743 C 649.97494,179.01373 648,175.64136 648,175.43467 c 0,-0.20669 -2.63274,-3.87655 -5.85054,-8.15524 -9.58574,-12.74611 -27.4693,-28.78383 -38.83605,-34.82758 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -3.95736,-3.45517 -27.32543,-11.82288 -38.04695,-13.62398 -7.54124,-1.26684 -18,-2.67859 -18,-2.42968 0,0.0941 16.20929,26.86722 36.02064,59.49583 19.81135,32.6286 35.67385,59.64849 35.25,60.04418 -0.42385,0.3957 -9.09564,5.33565 -19.27064,10.97767 -39.83964,22.09101 -67.57668,41.50164 -75.35722,52.73567 l -2.85723,4.12544 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.23299,-2.04994 4.0141,-11.6539 9.20082,-16.84062 8.76682,-8.76683 19.93419,-11.93735 31.05534,-8.81692 7.46037,2.09328 13.93872,7.39584 16.65168,13.62947 1.03664,2.38191 1.95228,4.44916 2.03475,4.59388 0.0825,0.14472 1.77959,-0.41778 3.77137,-1.25 4.95179,-2.06899 14.25226,-1.89554 19.18566,0.3578 2.2,1.00486 5.47031,3.33839 7.26735,5.18563 16.66011,17.12545 -12.75836,48.57286 -35.04042,37.4571 -2.79832,-1.39598 -3.14835,-1.33685 -5.92716,1.00137 -3.43762,2.89257 -4.11952,3.00955 -5.79248,0.99375 -1.01997,-1.22898 -0.72552,-1.97635 1.67441,-4.25 1.60161,-1.51733 3.65522,-3.83827 4.56358,-5.15765 l 1.65157,-2.39888 3.58637,3.14888 c 5.48106,4.81243 9.72549,4.41971 15.87027,-1.4684 8.75482,-8.38913 10.60114,-14.17998 6.82252,-21.39833 C 594.97271,306.86509 583.18664,302.66034 580,306.5 c -1.90613,2.29674 -2.64468,1.86544 -4.94596,-2.88837 -2.33852,-4.83074 -7.21408,-8.70557 -13.92977,-11.07063 -6.06499,-2.13591 -22.32506,-2.11077 -25.60692,0.0396 -2.94556,1.93001 -7.94846,9.55556 -9.90232,15.09337 l -1.44253,4.08858 3.66375,3.46367 c 2.01506,1.90501 8.38875,7.22389 14.16375,11.81972 25.71155,20.46163 52.42562,46.36944 68.0066,65.95407 8.51873,10.70768 23.45684,32.73408 24.56247,36.21763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 9.01916,-3.46097 16.06049,-2.92856 20.5423,1.55324 2.79581,2.79581 2.93931,3.33398 2.58021,9.67646 -0.29205,5.15835 -1.24169,8.52951 -4.09448,14.53518 -2.04284,4.30054 -4.1581,7.54486 -4.70058,7.20958 -0.54249,-0.33527 -0.30467,1.3211 0.52848,3.68083 2.05192,5.81163 5.94765,21.62588 7.58501,30.79041 0.87132,4.87691 1.32191,15.36926 1.28833,30 -0.0469,20.45488 -0.29367,23.63618 -2.71445,35 -3.64933,17.13107 -7.74058,29.11895 -15.31306,44.86929 -10.52464,21.89067 -22.44026,38.67458 -41.92085,59.0482 l -10,10.45843 7,-3.81081 c 3.85,-2.09595 10.1326,-5.89303 13.96132,-8.43796 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 665.10037,589.6718 659.48773,600 654.07777,600 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 418,563.70154 c 9.625,-4.69696 21.12358,-10.79469 25.55241,-13.5505 8.74615,-5.44225 20.94218,-16.19291 23.6308,-20.83028 1.58514,-2.73406 1.57875,-3.13389 -0.10974,-6.86199 -4.78396,-10.56276 -19.2648,-25.53368 -43.66458,-45.1423 -8.30011,-6.67029 -17.82318,-14.65722 -21.16236,-17.74871 l -6.07125,-5.62091 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.2877,13.93532 -2.44228,13.28132 2.62004,11.08519 2.3375,-1.01405 12.125,-5.68669 21.75,-10.38365 z m -11.33333,-50.36821 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 421.10037,503.6718 415.48773,514 410.07777,514 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-56.92134 c 0.0905,-6.79852 -1.96336,-11.80792 -5.07132,-12.36921 -5.79352,-1.04629 -5.85291,-0.39099 -0.96536,10.65121 4.94597,11.17419 5.90722,11.44776 6.03668,1.718 z m -481.17971,1.69275 45.25,-3.3812 0,-48.8717 c 0,-39.25758 -0.25141,-48.77523 -1.278,-48.38129 -2.38198,0.91405 -12.87273,-1.31913 -17.7086,-3.76965 C 184.97846,339.92844 181,332.69427 181,320.84408 c 0,-12.63603 4.98167,-25.66785 12.8012,-33.48738 4.81466,-4.81467 13.00195,-9.32979 16.9488,-9.34693 L 213,278 l 0,-78.5 c 0,-62.13176 0.26064,-78.50061 1.25,-78.50294 0.6875,-0.002 41.72083,4.52045 91.18517,10.04904 l 89.93517,10.05198 11.06483,-10.86249 c 6.08566,-5.97437 12.99604,-12.53718 15.35641,-14.58401 l 4.29159,-3.72151 -104.79159,0.32137 -104.79158,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -7.86267,2.74167 -22.02658,8.77447 -23.5,10.00932 -0.825,0.69141 -3.06936,2.05319 -4.98746,3.02618 C 148.5721,138.33122 125.90921,158.85544 118.08366,170.5 108.61137,184.59494 100,201.34627 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.72316,9.7349 -1.879749,18.48143 -2.14897,120.03409 L 91.941382,454.56818 107.22069,453.43 c 8.40362,-0.62599 35.64181,-2.65971 60.52931,-4.51937 z m -71.083333,-55.5773 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 111.10037,383.6718 105.48773,394 100.07777,394 c -1.509439,0 -3.044437,-0.3 -3.411103,-0.66667 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 30.08601,-140.36508 c -12.23095,-6.54448 -11.77597,-23.75536 1.06254,-40.1937 4.96149,-6.35267 9.98705,-9.45063 16.59669,-10.23088 12.76997,-1.50746 23.67265,6.63261 23.67265,17.67429 0,9.9569 -8.10608,23.78585 -17.89391,30.52699 -4.93011,3.3955 -6.5045,3.93828 -12.32153,4.24792 -5.5438,0.2951 -7.41963,-0.0465 -11.11644,-2.02462 z m 16.87886,-3.03888 c 1.44098,-0.73202 4.07003,-4.39735 6.45336,-8.99704 3.17562,-6.12877 4.10881,-9.12895 4.43554,-14.26009 C 162.56027,205.86017 158.73998,201 148.86802,201 c -5.29136,0 -6.23827,0.3397 -9.72328,3.4882 -7.7523,7.00374 -12.40317,23.2438 -8.70478,30.39569 2.36152,4.56669 7.04297,7.11087 13.06004,7.09763 2.75,-0.006 6.09422,-0.56687 7.4316,-1.24626 z m 19.50456,-28.91724 c 0.0556,-4.94785 -0.30958,-6.07206 -2.82635,-8.70105 -1.5896,-1.66048 -4.22267,-3.48357 -5.85125,-4.05129 l -2.96107,-1.03224 3.54475,3.92362 c 4.0932,4.53068 5.0597,8.38972 4.45999,17.8079 l -0.42812,6.72352 1.99911,-4.49424 c 1.19224,-2.68031 2.02487,-6.78756 2.06294,-10.17622 z m 484.28972,225.36722 c -0.67423,-1.36753 -2.23953,-2.85458 -3.47844,-3.30455 -2.13947,-0.77706 -2.17914,-0.70609 -0.79027,1.4136 0.80426,1.22746 2.0113,4.70088 2.68231,7.71873 l 1.22002,5.48698 0.79613,-4.41417 c 0.53509,-2.96684 0.39419,-5.22943 -0.42975,-6.90059 z M 212.76557,315.25 213.03115,287 l -6.05076,0 c -7.31016,0 -9.74767,1.40388 -14.0333,8.08245 -4.57888,7.13557 -6.94709,15.6711 -6.94709,25.03876 0,9.27911 1.44148,13.3896 6.05766,17.27385 3.69569,3.10973 6.49942,4.37075 12.44234,5.59614 8.66009,1.78567 7.9661,4.11485 8.26557,-27.7412 z m 393.96554,12.58014 c 1.70478,-2.5761 2.76539,-5.77217 3.04854,-9.18653 0.38298,-4.6183 0.10205,-5.63075 -2.38135,-8.5821 -2.72086,-3.23356 -9.33508,-6.99442 -12.38043,-7.03955 -0.81518,-0.0121 0.1492,1.08657 2.14307,2.44143 4.53895,3.0843 7.83906,9.71556 7.83906,15.75185 0,3.57071 -0.76429,5.71951 -3.45814,9.72256 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z"
+       id="path3584"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#bba24d"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 30.4331,-43.83233 C 548.692,675.05609 586.22617,642.74751 607.31587,605.37987 633.99261,558.11287 634.47295,502.55002 608.6375,452.5 591.05618,418.4404 564.96377,388.83023 522.5,354.74953 c -13.91733,-11.16981 -24.76767,-21.36537 -30.80739,-28.94827 -5.28925,-6.64069 -10.71188,-18.55743 -11.35194,-24.94695 -1.91426,-19.10968 23.92285,-44.93674 74.86605,-74.83692 l 10.70671,-6.28411 -1.39427,-2.61664 C 562.81748,213.92307 500.1217,111.12551 497.95975,107.98416 l -1.54025,-2.23801 -5.95975,3.30021 c -10.07738,5.58033 -27.60804,17.56867 -39.05571,26.70825 -12.63925,10.09089 -36.56605,33.16428 -46.4075,44.75226 -21.13867,24.89004 -40.03835,61.33966 -45.38753,87.53365 -10.05652,49.24489 1.64102,93.177 36.46736,136.95948 10.1949,12.81667 30.1641,31.95241 46.43822,44.5 18.4845,14.25184 37.46407,32.2765 46.35939,44.02695 2.90038,3.83132 7.15276,10.75767 9.44972,15.39189 3.98087,8.03158 4.1763,8.85278 4.1763,17.54935 0,8.57149 -0.23342,9.59615 -3.858,16.93566 -7.24539,14.67136 -25.88443,29.99093 -54.8756,45.1027 l -12.73359,6.63744 1.84438,3.678 c 1.0144,2.02291 3.21804,6.60301 4.89696,10.17801 39.40886,83.9148 46.12631,98 46.73775,98 0.28844,0 5.08191,-2.28705 10.65216,-5.08233 z M 229,691.98749 c 29.42177,-2.27638 51.77989,-10.45807 73.4051,-26.86174 4.97801,-3.77604 24.47643,-24.16967 28.57335,-29.88521 C 345.88398,614.44609 355.72138,589.93566 360.37396,562 363.29481,544.46223 364,527.00735 364,472.24869 l 0,-54.46088 -2.8844,-3.64391 C 356.37933,408.16049 346.97059,392.17903 341.89723,381.5 323.3654,342.49197 318.75984,298.17725 328.84897,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.26743,192.37152 L 246.5,542.5 l -2.27289,8 c -3.22806,11.36196 -7.38913,19.68982 -12.6465,25.31037 C 226.4631,581.2814 222.20852,583 213.78186,583 c -7.21626,0 -11.12122,-2.67501 -15.44916,-10.58313 -6.78566,-12.39891 -10.11602,-32.95759 -11.03601,-68.12646 l -0.60714,-23.2096 -4.09478,0.48456 c -4.1605,0.49233 -78.49974,6.05726 -95.265864,7.13147 -5.044102,0.32318 -9.679521,0.90182 -10.300931,1.28587 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 135.78637,-5.60006 c 10.95231,-10.71748 23.02794,-15.95807 31.15837,-13.52213 5.81657,1.74268 8.05526,5.1526 8.05526,12.26956 l 0,5.86514 17.41793,0 17.41793,0 -14.46243,-30.75 c -7.95434,-16.9125 -19.02518,-40.51547 -24.60186,-52.45103 l -10.13943,-21.70104 -3.22821,11.20104 c -9.28228,32.20701 -24.18358,57.49707 -47.69407,80.94495 L 325.91973,691 l 17.0765,0 17.0765,0 4.71364,-4.61257 z M 393,688.46788 c 0,-4.58398 -2.56126,-9.15086 -5.44084,-9.70132 -3.49561,-0.66823 -11.31979,3.37989 -16.20783,8.3857 L 367.5941,691 l 12.70295,0 12.70295,0 0,-2.53212 z m 6.43663,-0.98175 c 0.79807,-4.25413 -1.02693,-8.45696 -4.16751,-9.59742 l -2.23088,-0.81012 1.98088,3.6959 c 1.08948,2.03274 1.98088,5.16506 1.98088,6.9607 0,4.33862 1.60678,4.17437 2.43663,-0.24906 z m 212.02469,-22.35898 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.62324,-3.23256 3.60719,-6.24501 5.33118,-8.09492 6.67475,-11.17372 11.11808,-25.4772 7.66504,-24.67446 7.29965,-14.92707 7.1973,-192 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.86903,-18.23827 -4.22426,-23.96624 -8.47112,-35.80375 -2.59457,-7.23199 -6.69234,-16.35233 -9.10616,-20.26743 C 649.97494,179.01373 648,175.64136 648,175.43467 c 0,-0.20669 -2.63274,-3.87655 -5.85054,-8.15524 -9.58574,-12.74611 -27.4693,-28.78383 -38.83605,-34.82758 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -3.95736,-3.45517 -27.32543,-11.82288 -38.04695,-13.62398 -7.54124,-1.26684 -18,-2.67859 -18,-2.42968 0,0.0941 16.20929,26.86722 36.02064,59.49583 19.81135,32.6286 35.67385,59.64849 35.25,60.04418 -0.42385,0.3957 -9.09564,5.33565 -19.27064,10.97767 -39.83964,22.09101 -67.57668,41.50164 -75.35722,52.73567 l -2.85723,4.12544 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.28455,1.0418 1.49548,1.05586 0.89634,0.0597 -1.23299,-2.04994 4.0141,-11.6539 9.20082,-16.84062 8.76682,-8.76683 19.93419,-11.93735 31.05534,-8.81692 7.46037,2.09328 13.93872,7.39584 16.65168,13.62947 1.03664,2.38191 1.95228,4.44916 2.03475,4.59388 0.0825,0.14472 1.77959,-0.41778 3.77137,-1.25 4.95179,-2.06899 14.25226,-1.89554 19.18566,0.3578 2.2,1.00486 5.47031,3.33839 7.26735,5.18563 16.66011,17.12545 -12.75836,48.57286 -35.04042,37.4571 -2.79832,-1.39598 -3.14835,-1.33685 -5.92716,1.00137 -3.43762,2.89257 -4.11952,3.00955 -5.79248,0.99375 -1.01997,-1.22898 -0.72552,-1.97635 1.67441,-4.25 1.60161,-1.51733 3.65522,-3.83827 4.56358,-5.15765 l 1.65157,-2.39888 3.58637,3.14888 c 5.48106,4.81243 9.72549,4.41971 15.87027,-1.4684 8.75482,-8.38913 10.60114,-14.17998 6.82252,-21.39833 C 594.97271,306.86509 583.18664,302.66034 580,306.5 c -1.90613,2.29674 -2.64468,1.86544 -4.94596,-2.88837 -2.33852,-4.83074 -7.21408,-8.70557 -13.92977,-11.07063 -6.06499,-2.13591 -22.32506,-2.11077 -25.60692,0.0396 -2.94556,1.93001 -7.94846,9.55556 -9.90232,15.09337 l -1.44253,4.08858 3.66375,3.46367 c 2.01506,1.90501 8.38875,7.22389 14.16375,11.81972 25.71155,20.46163 52.42562,46.36944 68.0066,65.95407 8.51873,10.70768 23.45684,32.73408 24.56247,36.21763 0.38799,1.22244 1.1741,1.71117 2.15002,1.33667 9.01916,-3.46097 16.06049,-2.92856 20.5423,1.55324 2.79581,2.79581 2.93931,3.33398 2.58021,9.67646 -0.29205,5.15835 -1.24169,8.52951 -4.09448,14.53518 -2.04284,4.30054 -4.1581,7.54486 -4.70058,7.20958 -0.54249,-0.33527 -0.30467,1.3211 0.52848,3.68083 2.05192,5.81163 5.94765,21.62588 7.58501,30.79041 0.87132,4.87691 1.32191,15.36926 1.28833,30 -0.0469,20.45488 -0.29367,23.63618 -2.71445,35 -3.64933,17.13107 -7.74058,29.11895 -15.31306,44.86929 -10.52464,21.89067 -22.44026,38.67458 -41.92085,59.0482 l -10,10.45843 7,-3.81081 c 3.85,-2.09595 10.1326,-5.89303 13.96132,-8.43796 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 665.10037,589.6718 659.48773,600 654.07777,600 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 418,563.70154 c 9.625,-4.69696 21.12358,-10.79469 25.55241,-13.5505 8.74615,-5.44225 20.94218,-16.19291 23.6308,-20.83028 1.58514,-2.73406 1.57875,-3.13389 -0.10974,-6.86199 -4.78396,-10.56276 -19.2648,-25.53368 -43.66458,-45.1423 -8.30011,-6.67029 -17.82318,-14.65722 -21.16236,-17.74871 l -6.07125,-5.62091 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.2877,13.93532 -2.44228,13.28132 2.62004,11.08519 2.3375,-1.01405 12.125,-5.68669 21.75,-10.38365 z m -11.33333,-50.36821 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 421.10037,503.6718 415.48773,514 410.07777,514 c -1.50944,0 -3.04444,-0.3 -3.4111,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-56.92134 c 0.0905,-6.79852 -1.96336,-11.80792 -5.07132,-12.36921 -5.79352,-1.04629 -5.85291,-0.39099 -0.96536,10.65121 4.94597,11.17419 5.90722,11.44776 6.03668,1.718 z m -481.17971,1.69275 45.25,-3.3812 0,-48.8717 c 0,-39.25758 -0.25141,-48.77523 -1.278,-48.38129 -2.38198,0.91405 -12.87273,-1.31913 -17.7086,-3.76965 C 184.97846,339.92844 181,332.69427 181,320.84408 c 0,-12.63603 4.98167,-25.66785 12.8012,-33.48738 4.81466,-4.81467 13.00195,-9.32979 16.9488,-9.34693 L 213,278 l 0,-78.5 c 0,-62.13176 0.26064,-78.50061 1.25,-78.50294 0.6875,-0.002 41.72083,4.52045 91.18517,10.04904 l 89.93517,10.05198 11.06483,-10.86249 c 6.08566,-5.97437 12.99604,-12.53718 15.35641,-14.58401 l 4.29159,-3.72151 -104.79159,0.32137 -104.79158,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -7.86267,2.74167 -22.02658,8.77447 -23.5,10.00932 -0.825,0.69141 -3.06936,2.05319 -4.98746,3.02618 C 148.5721,138.33122 125.90921,158.85544 118.08366,170.5 108.61137,184.59494 100,201.34627 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.72316,9.7349 -1.879749,18.48143 -2.14897,120.03409 L 91.941382,454.56818 107.22069,453.43 c 8.40362,-0.62599 35.64181,-2.65971 60.52931,-4.51937 z m -71.083333,-55.5773 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.28266,-1.76783 3.69799,-1.79265 5.18101,-0.30963 C 111.10037,383.6718 105.48773,394 100.07777,394 c -1.509439,0 -3.044437,-0.3 -3.411103,-0.66667 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 30.08601,-140.36508 c -12.23095,-6.54448 -11.77597,-23.75536 1.06254,-40.1937 4.96149,-6.35267 9.98705,-9.45063 16.59669,-10.23088 12.76997,-1.50746 23.67265,6.63261 23.67265,17.67429 0,9.9569 -8.10608,23.78585 -17.89391,30.52699 -4.93011,3.3955 -6.5045,3.93828 -12.32153,4.24792 -5.5438,0.2951 -7.41963,-0.0465 -11.11644,-2.02462 z m 16.87886,-3.03888 c 1.44098,-0.73202 4.07003,-4.39735 6.45336,-8.99704 3.17562,-6.12877 4.10881,-9.12895 4.43554,-14.26009 C 162.56027,205.86017 158.73998,201 148.86802,201 c -5.29136,0 -6.23827,0.3397 -9.72328,3.4882 -7.7523,7.00374 -12.40317,23.2438 -8.70478,30.39569 2.36152,4.56669 7.04297,7.11087 13.06004,7.09763 2.75,-0.006 6.09422,-0.56687 7.4316,-1.24626 z m 19.8483,-28.3246 c 0.39771,-4.5886 0.13256,-5.44077 -2.6949,-8.66107 -1.72481,-1.96445 -4.5201,-4.05422 -6.21176,-4.64394 l -3.07575,-1.07221 3.54475,3.92362 c 4.1186,4.55879 5.11292,8.58021 4.42307,17.88858 l -0.49316,6.65436 2.03332,-4.5 c 1.11832,-2.475 2.23182,-6.7902 2.47443,-9.58934 z M 655.40714,443.5 c 0.71909,-4.69238 -0.88583,-8.41818 -4.13802,-9.60636 l -2.23088,-0.81505 1.98088,3.6959 c 1.12687,2.1025 1.98088,5.62078 1.98088,8.1607 0,5.30806 1.51191,4.40663 2.40714,-1.43519 z M 212.76557,315.25 213.03115,287 l -6.05076,0 c -7.31016,0 -9.74767,1.40388 -14.0333,8.08245 -4.57888,7.13557 -6.94709,15.6711 -6.94709,25.03876 0,9.27911 1.44148,13.3896 6.05766,17.27385 3.69569,3.10973 6.49942,4.37075 12.44234,5.59614 8.66009,1.78567 7.9661,4.11485 8.26557,-27.7412 z m 393.91359,12.65863 c 1.41478,-2.13788 2.79802,-5.96256 3.08852,-8.53981 0.73705,-6.5391 -1.66483,-10.64035 -8.11342,-13.85382 -6.32946,-3.1541 -10.92991,-3.49917 -5.62558,-0.42196 5.30225,3.07601 8.2851,8.09535 8.76577,14.75043 0.37253,5.15791 0.0948,6.12269 -3.1511,10.94482 l -3.55963,5.28829 3.01653,-2.14796 c 1.65909,-1.18138 4.1696,-3.89037 5.57891,-6.01999 z m -46.94999,-40.5128 c -0.33229,-0.33229 -1.1948,-0.36781 -1.91667,-0.0789 -0.79773,0.31922 -0.56078,0.55618 0.60417,0.60416 1.05416,0.0434 1.64479,-0.19293 1.3125,-0.52522 z"
+       id="path3582"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#da9b34"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 30.4331,-43.83233 C 548.692,675.05609 586.22617,642.74751 607.31587,605.37987 633.99261,558.11287 634.47295,502.55002 608.6375,452.5 591.05618,418.4404 564.96377,388.83023 522.5,354.74953 c -13.91733,-11.16981 -24.76767,-21.36537 -30.80739,-28.94827 -5.28925,-6.64069 -10.71188,-18.55743 -11.35194,-24.94695 -1.91426,-19.10968 23.92285,-44.93674 74.86605,-74.83692 l 10.70671,-6.28411 -1.39427,-2.61664 C 562.81748,213.92307 500.1217,111.12551 497.95975,107.98416 l -1.54025,-2.23801 -5.95975,3.30021 c -10.07738,5.58033 -27.60804,17.56867 -39.05571,26.70825 -12.63925,10.09089 -36.56605,33.16428 -46.4075,44.75226 -21.13867,24.89004 -40.03835,61.33966 -45.38753,87.53365 -10.05652,49.24489 1.64102,93.177 36.46736,136.95948 10.1949,12.81667 30.1641,31.95241 46.43822,44.5 18.4845,14.25184 37.46407,32.2765 46.35939,44.02695 2.90038,3.83132 7.15276,10.75767 9.44972,15.39189 3.98087,8.03158 4.1763,8.85278 4.1763,17.54935 0,8.57149 -0.23342,9.59615 -3.858,16.93566 -7.24539,14.67136 -25.88443,29.99093 -54.8756,45.1027 l -12.73359,6.63744 1.84438,3.678 c 1.0144,2.02291 3.21804,6.60301 4.89696,10.17801 39.40886,83.9148 46.12631,98 46.73775,98 0.28844,0 5.08191,-2.28705 10.65216,-5.08233 z M 229,691.98749 c 29.42177,-2.27638 51.77989,-10.45807 73.4051,-26.86174 4.97801,-3.77604 24.47643,-24.16967 28.57335,-29.88521 C 345.88398,614.44609 355.72138,589.93566 360.37396,562 363.29481,544.46223 364,527.00735 364,472.24869 l 0,-54.46088 -2.8844,-3.64391 C 356.37933,408.16049 346.97059,392.17903 341.89723,381.5 323.3654,342.49197 318.75984,298.17725 328.84897,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.26743,192.37152 L 246.5,542.5 l -2.27289,8 c -3.22806,11.36196 -7.38913,19.68982 -12.6465,25.31037 C 226.4631,581.2814 222.20852,583 213.78186,583 c -7.21626,0 -11.12122,-2.67501 -15.44916,-10.58313 -6.78566,-12.39891 -10.11602,-32.95759 -11.03601,-68.12646 l -0.60714,-23.2096 -4.09478,0.48456 c -4.1605,0.49233 -78.49974,6.05726 -95.265864,7.13147 -5.044102,0.32318 -9.679521,0.90182 -10.300931,1.28587 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.04179,-5.61312 c 13.26629,-13.76448 30.24615,-18.18024 36.98167,-9.61741 1.7327,2.20276 2.06961,3.78636 1.80362,8.47771 l -0.32708,5.76897 17.66793,-0.002 17.66793,-0.002 -14.46243,-30.75 c -7.95434,-16.9125 -19.02518,-40.51547 -24.60186,-52.45103 l -10.13943,-21.70104 -3.22821,11.20104 c -9.28228,32.20701 -24.18358,57.49707 -47.69407,80.94495 L 325.91973,691 l 17.33193,0 17.33192,0 4.45821,-4.62563 z M 393,688.46788 c 0,-4.58398 -2.56126,-9.15086 -5.44084,-9.70132 -3.49561,-0.66823 -11.31979,3.37989 -16.20783,8.3857 L 367.5941,691 l 12.70295,0 12.70295,0 0,-2.53212 z m 6.43663,-0.98175 c 0.79807,-4.25413 -1.02693,-8.45696 -4.16751,-9.59742 l -2.23088,-0.81012 1.98088,3.6959 c 1.08948,2.03274 1.98088,5.16506 1.98088,6.9607 0,4.33862 1.60678,4.17437 2.43663,-0.24906 z m 212.02469,-22.35898 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.62324,-3.23256 3.60719,-6.24501 5.33118,-8.09492 6.67475,-11.17372 11.11808,-25.4772 7.66504,-24.67446 7.29965,-14.92707 7.1973,-192 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.86903,-18.23827 -4.22426,-23.96624 -8.47112,-35.80375 -2.59457,-7.23199 -6.69234,-16.35233 -9.10616,-20.26743 C 649.97494,179.01373 648,175.64136 648,175.43467 c 0,-0.20669 -2.63274,-3.87655 -5.85054,-8.15524 -9.58574,-12.74611 -27.4693,-28.78383 -38.83605,-34.82758 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -3.95736,-3.45517 -27.32543,-11.82288 -38.04695,-13.62398 -7.54124,-1.26684 -18,-2.67859 -18,-2.42968 0,0.0941 16.20929,26.86722 36.02064,59.49583 19.81135,32.6286 35.67385,59.64849 35.25,60.04418 -0.42385,0.3957 -9.09564,5.33565 -19.27064,10.97767 -39.83964,22.09101 -67.57668,41.50164 -75.35722,52.73567 l -2.85723,4.12544 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.28661,1.04347 1.49632,1.05725 0.89579,0.0589 -1.17565,-1.95457 4.0653,-11.52724 9.11575,-16.65006 14.90196,-15.11547 38.71375,-13.03955 47.35559,4.12848 1.33586,2.65383 2.47224,4.94356 2.52529,5.08828 0.053,0.14472 1.7261,-0.41778 3.71788,-1.25 4.67789,-1.95455 13.7323,-1.93705 18.46778,0.0357 5.2458,2.18534 11.0755,8.2087 12.28226,12.69027 2.83661,10.53436 -5.05008,23.67819 -17.98881,29.97985 -5.84891,2.84864 -14.93617,3.04188 -20.71493,0.4405 l -4.08864,-1.84054 -2.59054,2.59054 c -2.98244,2.98244 -3.95496,3.17086 -5.67417,1.09933 -1.01997,-1.22898 -0.72552,-1.97635 1.67441,-4.25 1.60161,-1.51733 3.65522,-3.83827 4.56358,-5.15765 l 1.65157,-2.39888 3.58637,3.14888 c 5.48106,4.81243 9.72549,4.41971 15.87027,-1.4684 8.75482,-8.38913 10.60114,-14.17998 6.82252,-21.39833 C 594.97271,306.86509 583.18664,302.66034 580,306.5 c -1.90613,2.29674 -2.64468,1.86544 -4.94596,-2.88837 -2.33852,-4.83074 -7.21408,-8.70557 -13.92977,-11.07063 -6.06499,-2.13591 -22.32506,-2.11077 -25.60692,0.0396 -2.94556,1.93001 -7.94846,9.55556 -9.90232,15.09337 l -1.44253,4.08858 3.66375,3.46367 c 2.01506,1.90501 8.38875,7.22389 14.16375,11.81972 17.42852,13.86987 29.75237,24.96765 45.07655,40.592 21.36417,21.78264 36.12992,41.02629 48.39808,63.0754 0.0653,0.11733 2.3477,-0.4688 5.07203,-1.30252 6.83989,-2.09317 12.91455,-1.10344 16.74645,2.72845 2.82877,2.82878 2.94537,3.28198 2.48628,9.66435 -0.35002,4.86614 -1.47093,8.83571 -4.10112,14.52358 -1.99071,4.30495 -4.06915,7.54927 -4.61877,7.20959 -0.54961,-0.33969 -0.31763,1.31308 0.51552,3.67281 2.05192,5.81163 5.94765,21.62588 7.58501,30.79041 0.87132,4.87691 1.32191,15.36926 1.28833,30 -0.0469,20.45488 -0.29367,23.63618 -2.71445,35 -3.64933,17.13107 -7.74058,29.11895 -15.31306,44.86929 -10.52464,21.89067 -22.44026,38.67458 -41.92085,59.0482 l -10,10.45843 7,-3.81081 c 3.85,-2.09595 10.1326,-5.89303 13.96132,-8.43796 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 418,563.70154 c 9.625,-4.69696 21.12358,-10.79469 25.55241,-13.5505 8.74615,-5.44225 20.94218,-16.19291 23.6308,-20.83028 1.58514,-2.73406 1.57875,-3.13389 -0.10974,-6.86199 -4.78396,-10.56276 -19.2648,-25.53368 -43.66458,-45.1423 -8.30011,-6.67029 -17.82318,-14.65722 -21.16236,-17.74871 l -6.07125,-5.62091 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.2877,13.93532 -2.44228,13.28132 2.62004,11.08519 2.3375,-1.01405 12.125,-5.68669 21.75,-10.38365 z m -11.33333,-50.36821 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-56.92134 c 0.0905,-6.79852 -1.96336,-11.80792 -5.07132,-12.36921 -5.79352,-1.04629 -5.85291,-0.39099 -0.96536,10.65121 4.94597,11.17419 5.90722,11.44776 6.03668,1.718 z m -481.17971,1.69275 45.25,-3.3812 0,-48.63035 0,-48.63035 -6.75,-0.48646 c -12.08914,-0.87124 -21.76189,-7.81535 -24.16168,-17.34578 -2.42872,-9.64533 0.0799,-25.74831 5.43472,-34.8856 C 192.65266,286.79786 204.26891,278 210.69634,278 l 2.30366,0 0,-78.5 c 0,-62.13176 0.26064,-78.50061 1.25,-78.50294 0.6875,-0.002 41.72083,4.52045 91.18517,10.04904 l 89.93517,10.05198 11.06483,-10.86249 c 6.08566,-5.97437 12.99604,-12.53718 15.35641,-14.58401 l 4.29159,-3.72151 -104.79159,0.32137 -104.79158,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -7.86267,2.74167 -22.02658,8.77447 -23.5,10.00932 -0.825,0.69141 -3.06936,2.05319 -4.98746,3.02618 C 148.5721,138.33122 125.90921,158.85544 118.08366,170.5 108.61137,184.59494 100,201.34627 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.72316,9.7349 -1.879749,18.48143 -2.14897,120.03409 L 91.941382,454.56818 107.22069,453.43 c 8.40362,-0.62599 35.64181,-2.65971 60.52931,-4.51937 z m -71.083333,-55.5773 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.130862,13.7659 -1.209161,0 -2.498475,-0.3 -2.865141,-0.66667 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 29.99329,-140.44196 c -12.15099,-6.4256 -11.71334,-22.86505 1.06313,-39.93495 5.60485,-7.48832 11.03053,-10.26331 20.05962,-10.25962 5.57138,0.002 7.33081,0.46516 11.45138,3.01272 9.92533,6.13636 11.50946,14.94166 5.04227,28.02715 -8.81354,17.83299 -24.76021,25.95321 -37.6164,19.1547 z m 16.97158,-2.962 c 1.44098,-0.73202 4.07003,-4.39735 6.45336,-8.99704 3.17562,-6.12877 4.10881,-9.12895 4.43554,-14.26009 C 162.56027,205.86017 158.73998,201 148.86802,201 c -5.29136,0 -6.23827,0.3397 -9.72328,3.4882 -7.7523,7.00374 -12.40317,23.2438 -8.70478,30.39569 2.36152,4.56669 7.04297,7.11087 13.06004,7.09763 2.75,-0.006 6.09422,-0.56687 7.4316,-1.24626 z m 19.8483,-28.3246 c 0.39771,-4.5886 0.13256,-5.44077 -2.6949,-8.66107 -1.72481,-1.96445 -4.5201,-4.05422 -6.21176,-4.64394 l -3.07575,-1.07221 3.54475,3.92362 c 4.1186,4.55879 5.11292,8.58021 4.42307,17.88858 l -0.49316,6.65436 2.03332,-4.5 c 1.11832,-2.475 2.23182,-6.7902 2.47443,-9.58934 z M 655.40714,443.5 c 0.71909,-4.69238 -0.88583,-8.41818 -4.13802,-9.60636 l -2.23088,-0.81505 1.98088,3.6959 c 1.12687,2.1025 1.98088,5.62078 1.98088,8.1607 0,5.30806 1.51191,4.40663 2.40714,-1.43519 z M 212.76557,315.25 213.03115,287 l -6.05076,0 c -7.31016,0 -9.74767,1.40388 -14.0333,8.08245 -4.57888,7.13557 -6.94709,15.6711 -6.94709,25.03876 0,9.27911 1.44148,13.3896 6.05766,17.27385 3.69569,3.10973 6.49942,4.37075 12.44234,5.59614 8.66009,1.78567 7.9661,4.11485 8.26557,-27.7412 z m 393.91359,12.65863 c 1.41478,-2.13788 2.79802,-5.96256 3.08852,-8.53981 0.73705,-6.5391 -1.66483,-10.64035 -8.11342,-13.85382 -6.32946,-3.1541 -10.92991,-3.49917 -5.62558,-0.42196 5.30225,3.07601 8.2851,8.09535 8.76577,14.75043 0.37253,5.15791 0.0948,6.12269 -3.1511,10.94482 l -3.55963,5.28829 3.01653,-2.14796 c 1.65909,-1.18138 4.1696,-3.89037 5.57891,-6.01999 z m -46.94999,-40.5128 c -0.33229,-0.33229 -1.1948,-0.36781 -1.91667,-0.0789 -0.79773,0.31922 -0.56078,0.55618 0.60417,0.60416 1.05416,0.0434 1.64479,-0.19293 1.3125,-0.52522 z"
+       id="path3580"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#8c8c8c"
+       d="m 464.73096,745.75 c -1.32862,-2.8875 -5.02904,-10.7625 -8.22318,-17.5 l -5.80751,-12.25 -84.44383,0 -84.44383,0 -9.65631,2.95278 c -36.25282,11.08569 -78.37243,10.65801 -112.09963,-1.13824 -11.1832,-3.91137 -27.11237,-12.23352 -37.32976,-19.50282 C 112.4406,690.99339 92.959496,671.84173 85.790566,662 61.831936,629.10884 49.154068,591.03694 45.033197,539.60478 44.464938,532.51241 44,511.30387 44,492.47468 L 44,458.2398 55.5,457.52125 67,456.8027 67.017766,349.15135 C 67.028193,285.9744 67.43761,237.98836 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.57274,-6.392106 15.51683,-6.374126 31,-9.970112 l 14,-3.251519 L 337,87.01538 462.5,86.5 l 3,-2.102395 c 2.79555,-1.959116 33.06748,-19.094739 40.19126,-22.75052 l 3.19125,-1.63769 8.02945,13.344294 8.02945,13.344295 13.2793,0.608604 c 42.23249,1.935561 75.72411,16.069292 105.97414,44.721932 6.66106,6.30931 14.62336,14.84648 17.694,18.97148 C 670.99181,163.22863 683,183.9613 683,187.44933 c 0,0.8285 1.09169,3.87883 2.42597,6.77852 4.1078,8.92711 7.20753,22.02343 9.65024,40.77215 0.61409,4.71339 0.85211,68.80549 0.64061,172.5 -0.32948,161.54322 -0.37948,165.21998 -2.38665,175.5 -2.65901,13.61861 -9.53503,33.57617 -14.72728,42.74579 -2.25659,3.98519 -5.05486,9.02022 -6.21838,11.18895 -7.90063,14.72632 -26.17424,33.97592 -48.17415,50.74709 -5.8382,4.45063 -29.59004,16.0326 -40.71036,19.85135 -6.14911,2.11162 -30.1661,7.13891 -37.98327,7.95074 -5.94396,0.6173 -8.32522,1.51353 -16,6.02188 C 514.43532,730.365 471.34883,751 467.93196,751 c -0.43194,0 -1.87239,-2.3625 -3.201,-5.25 z m 30.4331,-43.83233 C 548.692,675.05609 586.22617,642.74751 607.31587,605.37987 633.99261,558.11287 634.47295,502.55002 608.6375,452.5 591.05618,418.4404 564.96377,388.83023 522.5,354.74953 c -13.91733,-11.16981 -24.76767,-21.36537 -30.80739,-28.94827 -5.28925,-6.64069 -10.71188,-18.55743 -11.35194,-24.94695 -1.91426,-19.10968 23.92285,-44.93674 74.86605,-74.83692 l 10.70671,-6.28411 -1.39427,-2.61664 C 562.81748,213.92307 500.1217,111.12551 497.95975,107.98416 l -1.54025,-2.23801 -5.95975,3.30021 c -10.07738,5.58033 -27.60804,17.56867 -39.05571,26.70825 -12.63925,10.09089 -36.56605,33.16428 -46.4075,44.75226 -21.13867,24.89004 -40.03835,61.33966 -45.38753,87.53365 -10.05652,49.24489 1.64102,93.177 36.46736,136.95948 10.1949,12.81667 30.1641,31.95241 46.43822,44.5 18.4845,14.25184 37.46407,32.2765 46.35939,44.02695 2.90038,3.83132 7.15276,10.75767 9.44972,15.39189 3.98087,8.03158 4.1763,8.85278 4.1763,17.54935 0,8.57149 -0.23342,9.59615 -3.858,16.93566 -7.24539,14.67136 -25.88443,29.99093 -54.8756,45.1027 l -12.73359,6.63744 1.84438,3.678 c 1.0144,2.02291 3.21804,6.60301 4.89696,10.17801 39.40886,83.9148 46.12631,98 46.73775,98 0.28844,0 5.08191,-2.28705 10.65216,-5.08233 z M 229,691.98749 c 29.42177,-2.27638 51.77989,-10.45807 73.4051,-26.86174 4.97801,-3.77604 24.47643,-24.16967 28.57335,-29.88521 C 345.88398,614.44609 355.72138,589.93566 360.37396,562 363.29481,544.46223 364,527.00735 364,472.24869 l 0,-54.46088 -2.8844,-3.64391 C 356.37933,408.16049 346.97059,392.17903 341.89723,381.5 323.3654,342.49197 318.75984,298.17725 328.84897,255.94972 c 4.90602,-20.5339 16.81389,-47.8488 29.10236,-66.75656 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.26743,192.37152 L 246.5,542.5 l -2.27289,8 c -3.22806,11.36196 -7.38913,19.68982 -12.6465,25.31037 C 226.4631,581.2814 222.20852,583 213.78186,583 c -7.21626,0 -11.12122,-2.67501 -15.44916,-10.58313 -6.78566,-12.39891 -10.11602,-32.95759 -11.03601,-68.12646 l -0.60714,-23.2096 -4.09478,0.48456 c -4.1605,0.49233 -78.49974,6.05726 -95.265864,7.13147 -5.044102,0.32318 -9.679521,0.90182 -10.300931,1.28587 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.04179,-5.61312 c 13.26629,-13.76448 30.24615,-18.18024 36.98167,-9.61741 1.7327,2.20276 2.06961,3.78636 1.80362,8.47771 l -0.32708,5.76897 17.66793,-0.002 17.66793,-0.002 -14.46243,-30.75 c -7.95434,-16.9125 -19.02518,-40.51547 -24.60186,-52.45103 l -10.13943,-21.70104 -3.22821,11.20104 c -9.28228,32.20701 -24.18358,57.49707 -47.69407,80.94495 L 325.91973,691 l 17.33193,0 17.33192,0 4.45821,-4.62563 z M 393,687.95034 c 0,-4.16388 -2.4512,-8.57356 -5.15945,-9.28178 -1.23896,-0.324 -4.04922,0.22168 -6.29004,1.22136 -3.96227,1.76765 -12.72277,8.45792 -13.38384,10.22106 -0.18345,0.48925 5.325,0.88902 12.25,0.88902 L 393,691 l 0,-3.04966 z m 6.43663,-0.46421 c 0.79807,-4.25413 -1.02693,-8.45696 -4.16751,-9.59742 l -2.23088,-0.81012 1.98088,3.6959 c 1.08948,2.03274 1.98088,5.16506 1.98088,6.9607 0,4.33862 1.60678,4.17437 2.43663,-0.24906 z m 212.02469,-22.35898 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.62324,-3.23256 3.60719,-6.24501 5.33118,-8.09492 6.67475,-11.17372 11.11808,-25.4772 7.66504,-24.67446 7.29965,-14.92707 7.1973,-192 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.86903,-18.23827 -4.22426,-23.96624 -8.47112,-35.80375 -2.59457,-7.23199 -6.69234,-16.35233 -9.10616,-20.26743 C 649.97494,179.01373 648,175.64136 648,175.43467 c 0,-0.20669 -2.63274,-3.87655 -5.85054,-8.15524 -9.58574,-12.74611 -27.4693,-28.78383 -38.83605,-34.82758 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -3.95736,-3.45517 -27.32543,-11.82288 -38.04695,-13.62398 -7.54124,-1.26684 -18,-2.67859 -18,-2.42968 0,0.0941 16.20929,26.86722 36.02064,59.49583 19.81135,32.6286 35.67385,59.64849 35.25,60.04418 -0.42385,0.3957 -9.09564,5.33565 -19.27064,10.97767 -39.83964,22.09101 -67.57668,41.50164 -75.35722,52.73567 l -2.85723,4.12544 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.28661,1.04347 1.49632,1.05725 0.89579,0.0589 -1.17565,-1.95457 4.0653,-11.52724 9.11575,-16.65006 14.90196,-15.11547 38.71375,-13.03955 47.35559,4.12848 1.33586,2.65383 2.47224,4.94356 2.52529,5.08828 0.053,0.14472 1.7261,-0.41778 3.71788,-1.25 4.67789,-1.95455 13.7323,-1.93705 18.46778,0.0357 5.2458,2.18534 11.0755,8.2087 12.28226,12.69027 2.83661,10.53436 -5.05008,23.67819 -17.98881,29.97985 -5.84891,2.84864 -14.93617,3.04188 -20.71493,0.4405 l -4.08864,-1.84054 -2.59054,2.59054 c -2.93315,2.93315 -3.96028,3.16445 -5.54939,1.24969 -0.86305,-1.03991 -0.0207,-2.5288 3.75308,-6.63363 3.73262,-4.06007 5.06957,-4.97052 5.74038,-3.90914 1.5227,2.40929 4.20195,4.05534 7.99223,4.91019 3.33884,0.75303 4.07777,0.49282 8.09018,-2.84892 9.41066,-7.83767 12.29429,-15.6634 8.54051,-23.17764 -3.04496,-6.09533 -15.03875,-10.36745 -18.24845,-6.5 -1.93624,2.33302 -2.75617,1.83964 -4.86483,-2.92733 -2.15085,-4.86235 -6.77773,-8.48988 -14.12473,-11.07394 -6.32181,-2.22349 -21.93001,-2.25276 -25.29576,-0.0474 -3.32258,2.17704 -7.36662,8.12699 -9.70307,14.27604 l -1.89317,4.98242 3.69078,3.49006 c 2.02993,1.91954 8.41578,7.25029 14.19078,11.84612 17.42852,13.86987 29.75237,24.96765 45.07655,40.592 21.36417,21.78264 36.12992,41.02629 48.39808,63.0754 0.0653,0.11733 2.3477,-0.4688 5.07203,-1.30252 6.83989,-2.09317 12.91455,-1.10344 16.74645,2.72845 2.82877,2.82878 2.94537,3.28198 2.48628,9.66435 -0.35002,4.86614 -1.47093,8.83571 -4.10112,14.52358 -1.99071,4.30495 -4.06915,7.54927 -4.61877,7.20959 -0.54961,-0.33969 -0.31763,1.31308 0.51552,3.67281 2.05192,5.81163 5.94765,21.62588 7.58501,30.79041 0.87132,4.87691 1.32191,15.36926 1.28833,30 -0.0469,20.45488 -0.29367,23.63618 -2.71445,35 -3.64933,17.13107 -7.74058,29.11895 -15.31306,44.86929 -10.52464,21.89067 -22.44026,38.67458 -41.92085,59.0482 l -10,10.45843 7,-3.81081 c 3.85,-2.09595 10.1326,-5.89303 13.96132,-8.43796 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 418,563.70154 c 9.625,-4.69696 21.12358,-10.79469 25.55241,-13.5505 8.74615,-5.44225 20.94218,-16.19291 23.6308,-20.83028 1.58514,-2.73406 1.57875,-3.13389 -0.10974,-6.86199 -4.78396,-10.56276 -19.2648,-25.53368 -43.66458,-45.1423 -8.30011,-6.67029 -17.82318,-14.65722 -21.16236,-17.74871 l -6.07125,-5.62091 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.2877,13.93532 -2.44228,13.28132 2.62004,11.08519 2.3375,-1.01405 12.125,-5.68669 21.75,-10.38365 z m -11.33333,-50.36821 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-57.43888 c 0.1083,-8.93621 -3.20953,-13.48595 -8.77341,-12.03096 -1.67468,0.43794 -1.42257,1.43357 2.75,10.86047 4.98955,11.27266 5.89885,11.44935 6.02341,1.17049 z m -481.17971,2.21029 45.25,-3.3812 0,-48.63035 0,-48.63035 -6.75,-0.48646 c -12.08914,-0.87124 -21.76189,-7.81535 -24.16168,-17.34578 -2.42872,-9.64533 0.0799,-25.74831 5.43472,-34.8856 C 192.65266,286.79786 204.26891,278 210.69634,278 l 2.30366,0 0,-78.5 c 0,-62.13176 0.26064,-78.50061 1.25,-78.50294 0.6875,-0.002 41.72083,4.52045 91.18517,10.04904 l 89.93517,10.05198 11.06483,-10.86249 c 6.08566,-5.97437 12.99604,-12.53718 15.35641,-14.58401 l 4.29159,-3.72151 -104.79159,0.32137 -104.79158,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -7.86267,2.74167 -22.02658,8.77447 -23.5,10.00932 -0.825,0.69141 -3.06936,2.05319 -4.98746,3.02618 C 148.5721,138.33122 125.90921,158.85544 118.08366,170.5 108.61137,184.59494 100,201.34627 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.72316,9.7349 -1.879749,18.48143 -2.14897,120.03409 L 91.941382,454.56818 107.22069,453.43 c 8.40362,-0.62599 35.64181,-2.65971 60.52931,-4.51937 z m -71.083333,-55.5773 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.130862,13.7659 -1.209161,0 -2.498475,-0.3 -2.865141,-0.66667 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 29.99329,-140.44196 c -12.15099,-6.4256 -11.71334,-22.86505 1.06313,-39.93495 5.60485,-7.48832 11.03053,-10.26331 20.05962,-10.25962 5.57138,0.002 7.33081,0.46516 11.45138,3.01272 9.92533,6.13636 11.50946,14.94166 5.04227,28.02715 -8.81354,17.83299 -24.76021,25.95321 -37.6164,19.1547 z m 19.3181,-4.75316 c 1.10598,-1.34426 3.54406,-5.65025 5.41794,-9.56888 5.3305,-11.14706 4.53501,-22.29825 -1.91285,-26.81452 -2.58133,-1.80802 -11.52374,-2.1023 -14.98616,-0.49315 -3.38189,1.57172 -8.60082,8.94345 -10.83802,15.3087 -3.66102,10.41625 -2.08064,18.69129 4.33952,22.72226 4.73141,2.97068 15.13525,2.30268 17.97957,-1.15441 z m 17.50178,-26.53344 c 0.39771,-4.5886 0.13256,-5.44077 -2.6949,-8.66107 -1.72481,-1.96445 -4.5201,-4.05422 -6.21176,-4.64394 l -3.07575,-1.07221 3.54475,3.92362 c 4.1186,4.55879 5.11292,8.58021 4.42307,17.88858 l -0.49316,6.65436 2.03332,-4.5 c 1.11832,-2.475 2.23182,-6.7902 2.47443,-9.58934 z M 655.40714,443.5 c 0.71909,-4.69238 -0.88583,-8.41818 -4.13802,-9.60636 l -2.23088,-0.81505 1.98088,3.6959 c 1.12687,2.1025 1.98088,5.62078 1.98088,8.1607 0,5.30806 1.51191,4.40663 2.40714,-1.43519 z M 213,315.5 c 0,-31.99631 0.83384,-29.00353 -7.94825,-28.52745 -2.44653,0.13262 -5.46968,0.91041 -6.71809,1.7284 -3.4842,2.28293 -8.16689,10.0193 -10.35759,17.11196 -2.331,7.5469 -2.65196,20.63369 -0.62503,25.48483 1.23037,2.94468 7.71101,9.64009 9.43376,9.74639 0.39336,0.0243 2.9652,0.6689 5.7152,1.43251 2.75,0.7636 6.2375,1.41874 7.75,1.45587 L 213,344 l 0,-28.5 z m 393.67916,12.40863 c 1.41478,-2.13788 2.79802,-5.96256 3.08852,-8.53981 0.73705,-6.5391 -1.66483,-10.64035 -8.11342,-13.85382 -6.32946,-3.1541 -10.92991,-3.49917 -5.62558,-0.42196 5.30225,3.07601 8.2851,8.09535 8.76577,14.75043 0.37253,5.15791 0.0948,6.12269 -3.1511,10.94482 l -3.55963,5.28829 3.01653,-2.14796 c 1.65909,-1.18138 4.1696,-3.89037 5.57891,-6.01999 z m -46.94999,-40.5128 c -0.33229,-0.33229 -1.1948,-0.36781 -1.91667,-0.0789 -0.79773,0.31922 -0.56078,0.55618 0.60417,0.60416 1.05416,0.0434 1.64479,-0.19293 1.3125,-0.52522 z"
+       id="path3578"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#c1a142"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 36.16406,-31.58233 C 548.692,675.05609 586.22617,642.74751 607.31587,605.37987 633.99261,558.11287 634.47295,502.55002 608.6375,452.5 591.05618,418.4404 564.96377,388.83023 522.5,354.74953 c -13.91733,-11.16981 -24.76767,-21.36537 -30.80739,-28.94827 -5.28925,-6.64069 -10.71188,-18.55743 -11.35194,-24.94695 -1.91426,-19.10968 23.92285,-44.93674 74.86605,-74.83692 l 10.70671,-6.28411 -1.39427,-2.61664 C 562.81748,213.92307 500.1217,111.12551 497.95975,107.98416 l -1.54025,-2.23801 -5.95975,3.30021 c -10.07738,5.58033 -27.60804,17.56867 -39.05571,26.70825 -12.63925,10.09089 -36.56605,33.16428 -46.4075,44.75226 -20.01272,23.56427 -37.94787,57.16112 -44.53072,83.4167 -7.50765,29.94414 -5.24837,63.14187 6.23225,91.57643 13.92013,34.4766 39.09043,65.68363 75.81652,94 18.4845,14.25184 37.46407,32.2765 46.35939,44.02695 2.90038,3.83132 7.15276,10.75767 9.44972,15.39189 3.98087,8.03158 4.1763,8.85278 4.1763,17.54935 0,8.57149 -0.23342,9.59615 -3.858,16.93566 -7.24539,14.67136 -25.88443,29.99093 -54.8756,45.1027 l -12.73359,6.63744 1.84438,3.678 c 1.0144,2.02291 3.21804,6.60301 4.89696,10.17801 39.40886,83.9148 46.12631,98 46.73775,98 0.28844,0 5.08191,-2.28705 10.65216,-5.08233 z M 229,691.98749 c 29.42177,-2.27638 51.77989,-10.45807 73.4051,-26.86174 4.97801,-3.77604 24.47643,-24.16967 28.57335,-29.88521 C 345.88398,614.44609 355.72138,589.93566 360.37396,562 363.29254,544.47583 364,527.02035 364,472.53303 l 0,-54.17654 -7.54244,-11.2886 C 322.81134,356.71035 314.62588,295.2341 334.01017,238.47864 c 4.93706,-14.45526 15.68694,-36.58506 23.94116,-49.28548 4.95719,-7.62743 6.04863,-10.0635 6.04842,-13.5 l -2.4e-4,-4.19316 -55.74976,-6.36555 c -30.66236,-3.50105 -56.9794,-6.59323 -58.48231,-6.87151 l -2.73257,-0.50597 -0.26743,192.37152 L 246.5,542.5 l -2.27289,8 c -3.22806,11.36196 -7.38913,19.68982 -12.6465,25.31037 C 226.4631,581.2814 222.20852,583 213.78186,583 c -7.21626,0 -11.12122,-2.67501 -15.44916,-10.58313 -6.78566,-12.39891 -10.11602,-32.95759 -11.03601,-68.12646 l -0.60714,-23.2096 -4.09478,0.48456 c -4.1605,0.49233 -78.49974,6.05726 -95.265864,7.13147 -5.044102,0.32318 -9.679521,0.90182 -10.300931,1.28587 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.04179,-5.61312 c 13.26629,-13.76448 30.24615,-18.18024 36.98167,-9.61741 1.7327,2.20276 2.06961,3.78636 1.80362,8.47771 l -0.32708,5.76897 17.66793,-0.002 17.66793,-0.002 -14.46243,-30.75 c -7.95434,-16.9125 -19.02518,-40.51547 -24.60186,-52.45103 l -10.13943,-21.70104 -3.22821,11.20104 c -9.28228,32.20701 -24.18358,57.49707 -47.69407,80.94495 L 325.91973,691 l 17.33193,0 17.33192,0 4.45821,-4.62563 z M 393,687.95034 c 0,-4.16388 -2.4512,-8.57356 -5.15945,-9.28178 -1.23896,-0.324 -4.04922,0.22168 -6.29004,1.22136 -3.96227,1.76765 -12.72277,8.45792 -13.38384,10.22106 -0.18345,0.48925 5.325,0.88902 12.25,0.88902 L 393,691 l 0,-3.04966 z m 6.43663,-0.46421 c 0.79807,-4.25413 -1.02693,-8.45696 -4.16751,-9.59742 l -2.23088,-0.81012 1.98088,3.6959 c 1.08948,2.03274 1.98088,5.16506 1.98088,6.9607 0,4.33862 1.60678,4.17437 2.43663,-0.24906 z m 212.02469,-22.35898 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.62324,-3.23256 3.60719,-6.24501 5.33118,-8.09492 6.67475,-11.17372 11.11808,-25.4772 7.66504,-24.67446 7.29965,-14.92707 7.1973,-192 -0.0502,-86.9 -0.48067,-160.475 -0.95653,-163.5 -2.86903,-18.23827 -4.22426,-23.96624 -8.47112,-35.80375 -2.59457,-7.23199 -6.69234,-16.35233 -9.10616,-20.26743 C 649.97494,179.01373 648,175.64136 648,175.43467 c 0,-0.20669 -2.63274,-3.87655 -5.85054,-8.15524 -9.58574,-12.74611 -27.4693,-28.78383 -38.83605,-34.82758 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -3.95736,-3.45517 -27.32543,-11.82288 -38.04695,-13.62398 -7.54124,-1.26684 -18,-2.67859 -18,-2.42968 0,0.0941 16.20929,26.86722 36.02064,59.49583 19.81135,32.6286 35.67385,59.64849 35.25,60.04418 -0.42385,0.3957 -9.09564,5.33565 -19.27064,10.97767 -39.83964,22.09101 -67.57668,41.50164 -75.35722,52.73567 l -2.85723,4.12544 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.28661,1.04347 1.49632,1.05725 0.89579,0.0589 -1.17565,-1.95457 4.0653,-11.52724 9.11575,-16.65006 14.90196,-15.11547 38.71375,-13.03955 47.35559,4.12848 1.33586,2.65383 2.47224,4.94356 2.52529,5.08828 0.053,0.14472 1.7261,-0.41778 3.71788,-1.25 4.67789,-1.95455 13.7323,-1.93705 18.46778,0.0357 5.2458,2.18534 11.0755,8.2087 12.28226,12.69027 2.83661,10.53436 -5.05008,23.67819 -17.98881,29.97985 -5.84891,2.84864 -14.93617,3.04188 -20.71493,0.4405 l -4.08864,-1.84054 -2.59054,2.59054 c -2.93315,2.93315 -3.96028,3.16445 -5.54939,1.24969 -0.86305,-1.03991 -0.0207,-2.5288 3.75308,-6.63363 3.73262,-4.06007 5.06957,-4.97052 5.74038,-3.90914 1.5227,2.40929 4.20195,4.05534 7.99223,4.91019 3.33884,0.75303 4.07777,0.49282 8.09018,-2.84892 9.41066,-7.83767 12.29429,-15.6634 8.54051,-23.17764 -3.04496,-6.09533 -15.03875,-10.36745 -18.24845,-6.5 -1.93624,2.33302 -2.75617,1.83964 -4.86483,-2.92733 -2.15085,-4.86235 -6.77773,-8.48988 -14.12473,-11.07394 -6.32181,-2.22349 -21.93001,-2.25276 -25.29576,-0.0474 -3.32258,2.17704 -7.36662,8.12699 -9.70307,14.27604 l -1.89317,4.98242 3.69078,3.49006 c 2.02993,1.91954 8.41578,7.25029 14.19078,11.84612 17.42852,13.86987 29.75237,24.96765 45.07655,40.592 21.36417,21.78264 36.12992,41.02629 48.39808,63.0754 0.0653,0.11733 2.3477,-0.4688 5.07203,-1.30252 6.83989,-2.09317 12.91455,-1.10344 16.74645,2.72845 2.82877,2.82878 2.94537,3.28198 2.48628,9.66435 -0.35002,4.86614 -1.47093,8.83571 -4.10112,14.52358 -1.99071,4.30495 -4.06915,7.54927 -4.61877,7.20959 -0.54961,-0.33969 -0.31763,1.31308 0.51552,3.67281 2.05192,5.81163 5.94765,21.62588 7.58501,30.79041 0.87132,4.87691 1.32191,15.36926 1.28833,30 -0.0469,20.45488 -0.29367,23.63618 -2.71445,35 -3.64933,17.13107 -7.74058,29.11895 -15.31306,44.86929 -10.52464,21.89067 -22.44026,38.67458 -41.92085,59.0482 l -10,10.45843 7,-3.81081 c 3.85,-2.09595 10.1326,-5.89303 13.96132,-8.43796 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 418,563.70154 c 9.625,-4.69696 21.12358,-10.79469 25.55241,-13.5505 8.74615,-5.44225 20.94218,-16.19291 23.6308,-20.83028 1.58514,-2.73406 1.57875,-3.13389 -0.10974,-6.86199 -4.78396,-10.56276 -19.2648,-25.53368 -43.66458,-45.1423 -8.30011,-6.67029 -17.82318,-14.65722 -21.16236,-17.74871 l -6.07125,-5.62091 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.2877,13.93532 -2.44228,13.28132 2.62004,11.08519 2.3375,-1.01405 12.125,-5.68669 21.75,-10.38365 z m -11.33333,-50.36821 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-57.43888 c 0.1083,-8.93621 -3.20953,-13.48595 -8.77341,-12.03096 -1.67468,0.43794 -1.42257,1.43357 2.75,10.86047 4.98955,11.27266 5.89885,11.44935 6.02341,1.17049 z m -481.17971,2.21029 45.25,-3.3812 0,-48.63035 0,-48.63035 -6.75,-0.48646 c -12.08914,-0.87124 -21.76189,-7.81535 -24.16168,-17.34578 -2.42872,-9.64533 0.0799,-25.74831 5.43472,-34.8856 C 192.65266,286.79786 204.26891,278 210.69634,278 l 2.30366,0 0,-78.5 c 0,-62.13176 0.26064,-78.50061 1.25,-78.50294 0.6875,-0.002 41.72083,4.52045 91.18517,10.04904 l 89.93517,10.05198 11.06483,-10.86249 c 6.08566,-5.97437 12.99604,-12.53718 15.35641,-14.58401 l 4.29159,-3.72151 -104.79159,0.32137 -104.79158,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -7.86267,2.74167 -22.02658,8.77447 -23.5,10.00932 -0.825,0.69141 -3.06936,2.05319 -4.98746,3.02618 C 148.5721,138.33122 125.90921,158.85544 118.08366,170.5 108.61137,184.59494 100,201.34627 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.72316,9.7349 -1.879749,18.48143 -2.14897,120.03409 L 91.941382,454.56818 107.22069,453.43 c 8.40362,-0.62599 35.64181,-2.65971 60.52931,-4.51937 z m -71.083333,-55.5773 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.130862,13.7659 -1.209161,0 -2.498475,-0.3 -2.865141,-0.66667 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 29.99329,-140.44196 c -12.15099,-6.4256 -11.71334,-22.86505 1.06313,-39.93495 5.60485,-7.48832 11.03053,-10.26331 20.05962,-10.25962 5.57138,0.002 7.33081,0.46516 11.45138,3.01272 9.92533,6.13636 11.50946,14.94166 5.04227,28.02715 -8.81354,17.83299 -24.76021,25.95321 -37.6164,19.1547 z m 19.3181,-4.75316 c 1.10598,-1.34426 3.54406,-5.65025 5.41794,-9.56888 5.3305,-11.14706 4.53501,-22.29825 -1.91285,-26.81452 -2.58133,-1.80802 -11.52374,-2.1023 -14.98616,-0.49315 -3.38189,1.57172 -8.60082,8.94345 -10.83802,15.3087 -3.66102,10.41625 -2.08064,18.69129 4.33952,22.72226 4.73141,2.97068 15.13525,2.30268 17.97957,-1.15441 z m 17.50178,-26.53344 c 0.39771,-4.5886 0.13256,-5.44077 -2.6949,-8.66107 -1.72481,-1.96445 -4.5201,-4.05422 -6.21176,-4.64394 l -3.07575,-1.07221 3.54475,3.92362 c 4.1186,4.55879 5.11292,8.58021 4.42307,17.88858 l -0.49316,6.65436 2.03332,-4.5 c 1.11832,-2.475 2.23182,-6.7902 2.47443,-9.58934 z M 655.40714,443.5 c 0.71909,-4.69238 -0.88583,-8.41818 -4.13802,-9.60636 l -2.23088,-0.81505 1.98088,3.6959 c 1.12687,2.1025 1.98088,5.62078 1.98088,8.1607 0,5.30806 1.51191,4.40663 2.40714,-1.43519 z M 213,315.5 c 0,-31.99631 0.83384,-29.00353 -7.94825,-28.52745 -2.44653,0.13262 -5.46968,0.91041 -6.71809,1.7284 -3.4842,2.28293 -8.16689,10.0193 -10.35759,17.11196 -2.331,7.5469 -2.65196,20.63369 -0.62503,25.48483 1.23037,2.94468 7.71101,9.64009 9.43376,9.74639 0.39336,0.0243 2.9652,0.6689 5.7152,1.43251 2.75,0.7636 6.2375,1.41874 7.75,1.45587 L 213,344 l 0,-28.5 z m 393.67916,12.40863 c 1.41478,-2.13788 2.79802,-5.96256 3.08852,-8.53981 0.73705,-6.5391 -1.66483,-10.64035 -8.11342,-13.85382 -6.32946,-3.1541 -10.92991,-3.49917 -5.62558,-0.42196 5.30225,3.07601 8.2851,8.09535 8.76577,14.75043 0.37253,5.15791 0.0948,6.12269 -3.1511,10.94482 l -3.55963,5.28829 3.01653,-2.14796 c 1.65909,-1.18138 4.1696,-3.89037 5.57891,-6.01999 z m -46.94999,-40.5128 c -0.33229,-0.33229 -1.1948,-0.36781 -1.91667,-0.0789 -0.79773,0.31922 -0.56078,0.55618 0.60417,0.60416 1.05416,0.0434 1.64479,-0.19293 1.3125,-0.52522 z"
+       id="path3576"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#d59834"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 42.66166,-34.97968 C 563.89272,666.20747 602.97279,626.45955 619.17379,579 638.29905,522.97407 625.18446,464.66773 581.49877,411.5 565.15204,391.60519 549.4197,376.46254 522.5,354.71262 c -22.67582,-18.32105 -32.15356,-28.57809 -38.265,-41.41136 -4.91215,-10.3149 -5.15935,-17.90048 -0.86816,-26.63974 8.33783,-16.98046 31.35262,-36.52196 70.50648,-59.86595 6.39467,-3.81258 11.48166,-7.46378 11.30442,-8.11377 -0.38297,-1.40446 -64.78153,-107.50507 -67.18491,-110.69131 l -1.65721,-2.197 -5.91781,3.27366 c -10.20006,5.64256 -27.47975,17.45204 -38.91781,26.59765 -12.74497,10.19058 -36.65763,33.24894 -46.50346,44.84207 -20.01272,23.56427 -37.94787,57.16112 -44.53072,83.4167 -7.50765,29.94414 -5.24837,63.14187 6.23225,91.57643 13.92013,34.4766 39.09043,65.68363 75.81652,94 18.4845,14.25184 37.46407,32.2765 46.35939,44.02695 2.90038,3.83132 7.15276,10.75767 9.44972,15.39189 3.98087,8.03158 4.1763,8.85278 4.1763,17.54935 0,8.57149 -0.23342,9.59615 -3.858,16.93566 -7.24575,14.67207 -25.88431,29.99087 -54.87942,45.10469 l -12.73742,6.63944 1.37148,2.67601 c 1.49294,2.91298 2.2443,4.50425 24.40044,51.67601 22.52954,47.96673 27.151,57.5 27.87443,57.5 0.36256,0 8.00813,-3.81585 16.99015,-8.47968 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.38826,-5.69181 8.97551,-6.18527 19.80395,-16.64127 25.59306,-24.71279 40.28668,-54.90196 47.00746,-96.58043 1.92918,-11.96366 2.12912,-18.02226 2.50813,-76 l 0.41184,-63 -7.61067,-11.36035 C 322.82818,356.83967 314.61019,295.28003 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.91545,181.55507 364,179.13223 364,175.68066 l 0,-4.20565 -55.25,-6.29955 c -30.3875,-3.46476 -56.70466,-6.54524 -58.48257,-6.84553 l -3.23256,-0.54597 -0.26744,192.35802 L 246.5,542.5 l -2.27289,8 c -3.22806,11.36196 -7.38913,19.68982 -12.6465,25.31037 C 226.4631,581.2814 222.20852,583 213.78186,583 c -7.77869,0 -11.32951,-2.6524 -15.99009,-11.94431 -6.65695,-13.27212 -9.49714,-31.27147 -10.45625,-66.26502 l -0.64983,-23.70933 -4.09284,0.48429 c -4.1593,0.49215 -78.50366,6.05738 -95.263944,7.13121 -5.044102,0.32318 -9.679521,0.90182 -10.300931,1.28587 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.04179,-5.61312 c 13.26629,-13.76448 30.24615,-18.18024 36.98167,-9.61741 1.7327,2.20276 2.06961,3.78636 1.80362,8.47771 l -0.32708,5.76897 17.67601,-0.002 17.67601,-0.002 -14.22381,-30.25 c -7.8231,-16.6375 -18.90758,-40.26775 -24.63219,-52.51166 l -10.40838,-22.26165 -3.2133,11.26165 c -3.58639,12.56928 -10.51675,29.71626 -16.03922,39.68403 -9.5401,17.21934 -24.10157,35.50312 -37.7673,47.42165 L 324.9361,691 l 17.82374,0 17.82374,0 4.45821,-4.62563 z M 393,687.95034 c 0,-4.16388 -2.4512,-8.57356 -5.15945,-9.28178 -1.23896,-0.324 -4.04922,0.22168 -6.29004,1.22136 -3.96227,1.76765 -12.72277,8.45792 -13.38384,10.22106 -0.18345,0.48925 5.325,0.88902 12.25,0.88902 L 393,691 l 0,-3.04966 z m 6.41087,-0.32694 c 0.76908,-4.09954 -0.62071,-8.13015 -3.29726,-9.5626 -3.10971,-1.66426 -3.25467,-1.31673 -1.11555,2.67439 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.27503 1.60183,4.20075 2.41087,-0.11179 z m 212.05045,-22.49625 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.61576,-3.22123 3.59058,-6.21984 5.2419,-7.95941 6.10496,-9.86581 10.55123,-23.30647 7.71965,-23.33575 7.24438,-11.41862 7.57789,-190.01052 0.18523,-99.18682 -0.068,-162.3508 -0.66752,-166.5 -2.57642,-17.83117 -4.20809,-24.90224 -8.48352,-36.76448 -7.48256,-20.76049 -18.25455,-37.28071 -34.07006,-52.2508 -9.8421,-9.31599 -17.17322,-14.98995 -24.18519,-18.71825 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -3.95736,-3.45517 -27.32543,-11.82288 -38.04695,-13.62398 -7.35997,-1.23639 -18,-2.68058 -18,-2.44317 0,0.0867 16.20463,26.86445 36.0103,59.50616 19.80566,32.64172 35.66816,59.66768 35.25,60.05769 -0.41817,0.39 -9.0853,5.3253 -19.2603,10.96732 -39.83964,22.09101 -67.57668,41.50164 -75.35722,52.73567 l -2.85723,4.12544 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.28661,1.04347 1.49632,1.05725 0.89579,0.0589 -1.17565,-1.95457 4.0653,-11.52724 9.11575,-16.65006 14.90196,-15.11547 38.71375,-13.03955 47.35559,4.12848 1.33586,2.65383 2.47224,4.94356 2.52529,5.08828 0.053,0.14472 1.7261,-0.41778 3.71788,-1.25 4.67789,-1.95455 13.7323,-1.93705 18.46778,0.0357 5.2458,2.18534 11.0755,8.2087 12.28226,12.69027 2.83661,10.53436 -5.05008,23.67819 -17.98881,29.97985 -5.84891,2.84864 -14.93617,3.04188 -20.71493,0.4405 l -4.08864,-1.84054 -2.59054,2.59054 c -2.93315,2.93315 -3.96028,3.16445 -5.54939,1.24969 -0.86305,-1.03991 -0.0207,-2.5288 3.75308,-6.63363 3.73262,-4.06007 5.06957,-4.97052 5.74038,-3.90914 1.5227,2.40929 4.20195,4.05534 7.99223,4.91019 3.33884,0.75303 4.07777,0.49282 8.09018,-2.84892 9.41066,-7.83767 12.29429,-15.6634 8.54051,-23.17764 -3.04496,-6.09533 -15.03875,-10.36745 -18.24845,-6.5 -1.93624,2.33302 -2.75617,1.83964 -4.86483,-2.92733 -2.15085,-4.86235 -6.77773,-8.48988 -14.12473,-11.07394 -6.32181,-2.22349 -21.93001,-2.25276 -25.29576,-0.0474 -3.32258,2.17704 -7.36662,8.12699 -9.70307,14.27604 l -1.89317,4.98242 3.69078,3.49006 c 2.02993,1.91954 8.41578,7.24745 14.19078,11.83981 39.56438,31.46213 70.96684,65.47988 89.50607,96.96038 2.10536,3.575 3.88628,6.596 3.95759,6.71333 0.0713,0.11733 2.35867,-0.4688 5.083,-1.30252 6.83989,-2.09317 12.91455,-1.10344 16.74645,2.72845 2.82877,2.82878 2.94537,3.28198 2.48628,9.66435 -0.35002,4.86614 -1.47093,8.83571 -4.10112,14.52358 -1.99071,4.30495 -4.06915,7.54927 -4.61877,7.20959 -0.54961,-0.33969 -0.31763,1.31308 0.51552,3.67281 2.05192,5.81163 5.94765,21.62588 7.58501,30.79041 0.87132,4.87691 1.32191,15.36926 1.28833,30 -0.0469,20.45488 -0.29367,23.63618 -2.71445,35 -3.84123,18.0319 -7.84108,29.4894 -16.2728,46.61317 -10.77336,21.87935 -22.57546,38.24855 -42.38129,58.78173 l -8.57982,8.89489 7,-3.76775 c 3.85,-2.07226 10.1326,-5.84996 13.96132,-8.39489 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z M 417,564.27263 c 9.075,-4.36591 20.58613,-10.46833 25.5803,-13.56092 9.61057,-5.95126 21.79167,-16.54209 24.60291,-21.39095 1.58514,-2.73406 1.57875,-3.13389 -0.10974,-6.86199 -4.79076,-10.57777 -19.92368,-26.20132 -44.10014,-45.5299 -7.96033,-6.36412 -17.24639,-14.13858 -20.63569,-17.27658 l -6.16236,-5.70544 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.28746,13.93382 -2.4413,13.28384 2.62004,11.06979 2.3375,-1.02252 11.675,-5.43125 20.75,-9.79716 z m -10.33333,-50.9393 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z m 7.30006,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 234.96298,-57.43888 c 0.1085,-8.95252 -3.20878,-13.48615 -8.79833,-12.02445 -1.70836,0.44675 -1.47297,1.38024 2.74465,10.88434 5.01642,11.30417 5.92843,11.47593 6.05368,1.14011 z M 154.75,449.81359 213,445.53937 l 0,-48.63532 0,-48.63532 -6.75,-0.48646 c -12.08914,-0.87124 -21.76189,-7.81535 -24.16168,-17.34578 -2.42872,-9.64533 0.0799,-25.74831 5.43472,-34.8856 C 192.65266,286.79786 204.26891,278 210.69634,278 l 2.30366,0 0,-78.5 c 0,-57.10559 0.30415,-78.5 1.11598,-78.5 0.61379,0 41.64665,4.52254 91.18413,10.05008 l 90.06815,10.05008 11.06587,-10.86353 c 6.08623,-5.97495 12.99708,-12.53822 15.35745,-14.58505 l 4.29159,-3.72151 -104.79159,0.32137 -104.79158,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -8.07973,2.81735 -21.76282,8.7427 -25.04435,10.84525 -1.85619,1.1893 -5.53056,3.49075 -8.16527,5.11435 C 143.34203,142.81494 125.27431,159.83811 118.09179,170.5 108.66133,184.4988 100,201.33974 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.48256 c 1.253729,-0.2654 28.492007,-2.40595 60.529507,-4.75677 z M 96.666667,393.33333 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.130862,13.7659 -1.209161,0 -2.498475,-0.3 -2.865141,-0.66667 z m 7.300063,-9.19411 c -0.0261,-1.28503 -0.45822,-1.12912 -2,0.72156 -1.0817,1.29844 -1.95176,3.09844 -1.93346,4 0.0261,1.28503 0.45822,1.12912 2,-0.72156 1.0817,-1.29844 1.95176,-3.09844 1.93346,-4 z m 29.99329,-140.44196 c -12.15099,-6.4256 -11.71334,-22.86505 1.06313,-39.93495 5.60485,-7.48832 11.03053,-10.26331 20.05962,-10.25962 5.57138,0.002 7.33081,0.46516 11.45138,3.01272 9.92533,6.13636 11.50946,14.94166 5.04227,28.02715 -8.81354,17.83299 -24.76021,25.95321 -37.6164,19.1547 z m 19.3181,-4.75316 c 1.10598,-1.34426 3.54406,-5.65025 5.41794,-9.56888 5.3305,-11.14706 4.53501,-22.29825 -1.91285,-26.81452 -2.58133,-1.80802 -11.52374,-2.1023 -14.98616,-0.49315 -3.38189,1.57172 -8.60082,8.94345 -10.83802,15.3087 -3.66102,10.41625 -2.08064,18.69129 4.33952,22.72226 4.73141,2.97068 15.13525,2.30268 17.97957,-1.15441 z m 17.50178,-26.53344 c 0.39771,-4.5886 0.13256,-5.44077 -2.6949,-8.66107 -1.72481,-1.96445 -4.5201,-4.05422 -6.21176,-4.64394 l -3.07575,-1.07221 3.54475,3.92362 c 4.1186,4.55879 5.11292,8.58021 4.42307,17.88858 l -0.49316,6.65436 2.03332,-4.5 c 1.11832,-2.475 2.23182,-6.7902 2.47443,-9.58934 z M 655.34514,442.0185 c 0.1299,-4.35442 -0.22569,-5.4997 -2.20592,-7.10486 -3.60997,-2.92622 -4.34889,-2.2976 -2.14116,1.82155 1.14594,2.13809 2.00194,5.64427 2.00194,8.2 0,6.43251 2.14586,3.76367 2.34514,-2.91669 z M 213,315.5 c 0,-31.99631 0.83384,-29.00353 -7.94825,-28.52745 -2.44653,0.13262 -5.46968,0.91041 -6.71809,1.7284 -3.4842,2.28293 -8.16689,10.0193 -10.35759,17.11196 -2.331,7.5469 -2.65196,20.63369 -0.62503,25.48483 1.23037,2.94468 7.71101,9.64009 9.43376,9.74639 0.39336,0.0243 2.9652,0.6689 5.7152,1.43251 2.75,0.7636 6.2375,1.41874 7.75,1.45587 L 213,344 l 0,-28.5 z m 393.73111,12.33014 c 3.50377,-5.29456 4.15095,-13.105 1.44262,-17.41018 -2.0831,-3.3113 -6.9872,-6.09376 -12.34389,-7.0036 l -3.32984,-0.56558 3.52868,2.14468 c 5.34781,3.25033 8.2878,8.23027 8.76577,14.84801 0.37253,5.15791 0.0948,6.12269 -3.1511,10.94482 l -3.55963,5.28829 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z M 560.25,287.33772 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3574"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#d19634"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 42.66166,-34.97968 C 563.89272,666.20747 602.97279,626.45955 619.17379,579 638.29905,522.97407 625.18446,464.66773 581.49877,411.5 565.15204,391.60519 549.4197,376.46254 522.5,354.71262 c -22.67582,-18.32105 -32.15356,-28.57809 -38.265,-41.41136 -4.91215,-10.3149 -5.15935,-17.90048 -0.86816,-26.63974 8.33783,-16.98046 31.35262,-36.52196 70.50648,-59.86595 6.39467,-3.81258 11.48166,-7.46378 11.30442,-8.11377 -0.38297,-1.40446 -64.78153,-107.50507 -67.18491,-110.69131 l -1.65721,-2.197 -5.91781,3.27366 c -10.20006,5.64256 -27.47975,17.45204 -38.91781,26.59765 -12.74497,10.19058 -36.65763,33.24894 -46.50346,44.84207 -20.01272,23.56427 -37.94787,57.16112 -44.53072,83.4167 -7.50765,29.94414 -5.24837,63.14187 6.23225,91.57643 13.92013,34.4766 39.09043,65.68363 75.81652,94 18.4845,14.25184 37.46407,32.2765 46.35939,44.02695 2.90038,3.83132 7.15276,10.75767 9.44972,15.39189 3.98087,8.03158 4.1763,8.85278 4.1763,17.54935 0,8.57149 -0.23342,9.59615 -3.858,16.93566 -7.24575,14.67207 -25.88431,29.99087 -54.87942,45.10469 l -12.73742,6.63944 1.37148,2.67601 c 1.49294,2.91298 2.2443,4.50425 24.40044,51.67601 22.52954,47.96673 27.151,57.5 27.87443,57.5 0.36256,0 8.00813,-3.81585 16.99015,-8.47968 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.38826,-5.69181 8.97551,-6.18527 19.80395,-16.64127 25.59306,-24.71279 40.28668,-54.90196 47.00746,-96.58043 1.92918,-11.96366 2.12912,-18.02226 2.50813,-76 l 0.41184,-63 -7.61067,-11.36035 C 322.82818,356.83967 314.61019,295.28003 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.91545,181.55507 364,179.13223 364,175.68066 l 0,-4.20565 -55.25,-6.29955 c -30.3875,-3.46476 -56.70466,-6.54524 -58.48257,-6.84553 l -3.23256,-0.54597 -0.26744,192.35802 L 246.5,542.5 l -2.27289,8 c -3.22806,11.36196 -7.38913,19.68982 -12.6465,25.31037 C 226.4631,581.2814 222.20852,583 213.78186,583 c -7.77869,0 -11.32951,-2.6524 -15.99009,-11.94431 -6.65695,-13.27212 -9.49714,-31.27147 -10.45625,-66.26502 l -0.64983,-23.70933 -4.09284,0.48429 c -4.1593,0.49215 -78.50366,6.05738 -95.263944,7.13121 -5.044102,0.32318 -9.679521,0.90182 -10.300931,1.28587 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.04179,-5.61312 c 13.26629,-13.76448 30.24615,-18.18024 36.98167,-9.61741 1.7327,2.20276 2.06961,3.78636 1.80362,8.47771 l -0.32708,5.76897 17.67601,-0.002 17.67601,-0.002 -14.22381,-30.25 c -7.8231,-16.6375 -18.90758,-40.26775 -24.63219,-52.51166 l -10.40838,-22.26165 -3.2133,11.26165 c -3.58639,12.56928 -10.51675,29.71626 -16.03922,39.68403 -9.5401,17.21934 -24.10157,35.50312 -37.7673,47.42165 L 324.9361,691 l 17.82374,0 17.82374,0 4.45821,-4.62563 z M 393,687.95034 c 0,-7.52621 -5.22639,-11.40408 -11.25863,-8.35365 C 377.4591,681.76218 368,689.00718 368,690.12161 368,690.60472 373.625,691 380.5,691 l 12.5,0 0,-3.04966 z m 6.41087,-0.32694 c 0.76908,-4.09954 -0.62071,-8.13015 -3.29726,-9.5626 -3.10971,-1.66426 -3.25467,-1.31673 -1.11555,2.67439 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.27503 1.60183,4.20075 2.41087,-0.11179 z m 212.05045,-22.49625 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.61576,-3.22123 3.59058,-6.21984 5.2419,-7.95941 6.10496,-9.86581 10.55123,-23.30647 7.71965,-23.33575 7.24438,-11.41862 7.57789,-190.01052 0.18523,-99.18682 -0.068,-162.3508 -0.66752,-166.5 -2.57642,-17.83117 -4.20809,-24.90224 -8.48352,-36.76448 -7.48256,-20.76049 -18.25455,-37.28071 -34.07006,-52.2508 -9.8421,-9.31599 -17.17322,-14.98995 -24.18519,-18.71825 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -3.95736,-3.45517 -27.32543,-11.82288 -38.04695,-13.62398 -7.35997,-1.23639 -18,-2.68058 -18,-2.44317 0,0.0867 16.20463,26.86445 36.0103,59.50616 19.80566,32.64172 35.66816,59.66768 35.25,60.05769 -0.41817,0.39 -9.0853,5.3253 -19.2603,10.96732 -39.83964,22.09101 -67.57668,41.50164 -75.35722,52.73567 l -2.85723,4.12544 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.28661,1.04347 1.49632,1.05725 0.89579,0.0589 -1.17565,-1.95457 4.0653,-11.52724 9.11575,-16.65006 14.90196,-15.11547 38.71375,-13.03955 47.35559,4.12848 1.33586,2.65383 2.47224,4.94356 2.52529,5.08828 0.053,0.14472 1.7261,-0.41778 3.71788,-1.25 4.67789,-1.95455 13.7323,-1.93705 18.46778,0.0357 5.2458,2.18534 11.0755,8.2087 12.28226,12.69027 2.83661,10.53436 -5.05008,23.67819 -17.98881,29.97985 -5.84891,2.84864 -14.93617,3.04188 -20.71493,0.4405 l -4.08864,-1.84054 -2.59054,2.59054 c -2.9266,2.9266 -3.96092,3.16368 -5.53382,1.26844 -0.84263,-1.0153 0.0334,-2.54558 3.7751,-6.59429 3.65747,-3.9576 5.0849,-4.93698 5.72481,-3.92789 1.50645,2.37562 4.2032,4.02125 7.98895,4.87508 3.35643,0.75699 4.10423,0.49721 8.20082,-2.84892 9.42815,-7.70101 12.51738,-16.80744 8.13828,-23.99001 C 594.51797,306.52067 583.00765,302.876 580,306.5 c -1.93624,2.33302 -2.75617,1.83964 -4.86483,-2.92733 -3.61684,-8.17647 -13.46537,-12.71099 -27.9038,-12.84763 -7.80456,-0.0739 -9.70008,0.23023 -12,1.92512 -3.09526,2.281 -8.88131,11.34358 -10.11942,15.84984 -1.06105,3.86184 -0.6327,4.34597 14.88805,16.82707 42.6167,34.27045 72.65254,66.65873 91.50607,98.67293 2.10536,3.575 3.88628,6.596 3.95759,6.71333 0.0713,0.11733 2.35867,-0.4688 5.083,-1.30252 6.83989,-2.09317 12.91455,-1.10344 16.74645,2.72845 2.82877,2.82878 2.94537,3.28198 2.48628,9.66435 -0.35002,4.86614 -1.47093,8.83571 -4.10112,14.52358 -1.99071,4.30495 -4.06915,7.54927 -4.61877,7.20959 -0.54961,-0.33969 -0.31763,1.31308 0.51552,3.67281 2.05192,5.81163 5.94765,21.62588 7.58501,30.79041 0.87132,4.87691 1.32191,15.36926 1.28833,30 -0.0469,20.45488 -0.29367,23.63618 -2.71445,35 -3.84123,18.0319 -7.84108,29.4894 -16.2728,46.61317 -10.77336,21.87935 -22.57546,38.24855 -42.38129,58.78173 l -8.57982,8.89489 7,-3.76775 c 3.85,-2.07226 10.1326,-5.84996 13.96132,-8.39489 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z M 658,590.23423 c 0,-1.30368 -0.31152,-1.26229 -2,0.26577 -1.1,0.99549 -1.98503,2.75273 -1.96673,3.90499 0.0324,2.03968 0.0852,2.03266 2,-0.26577 1.0817,-1.29844 1.96673,-3.05568 1.96673,-3.90499 z m -241,-25.9616 c 9.075,-4.36591 20.58613,-10.46833 25.5803,-13.56092 9.61057,-5.95126 21.79167,-16.54209 24.60291,-21.39095 1.58514,-2.73406 1.57875,-3.13389 -0.10974,-6.86199 -4.79076,-10.57777 -19.92368,-26.20132 -44.10014,-45.5299 -7.96033,-6.36412 -17.24639,-14.13858 -20.63569,-17.27658 l -6.16236,-5.70544 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.28746,13.93382 -2.4413,13.28384 2.62004,11.06979 2.3375,-1.02252 11.675,-5.43125 20.75,-9.79716 z m -10.33333,-50.9393 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z M 414,504.23423 c 0,-1.30368 -0.31152,-1.26229 -2,0.26577 -1.1,0.99549 -1.98503,2.75273 -1.96673,3.90499 0.0324,2.03968 0.0852,2.03266 2,-0.26577 1.0817,-1.29844 1.96673,-3.05568 1.96673,-3.90499 z m 234.92971,-57.53389 c 0.0825,-6.80958 -1.85501,-11.21379 -5.31534,-12.08228 -5.56106,-1.39574 -5.64831,-0.12211 -0.74809,10.92021 5.02627,11.32635 5.93814,11.50111 6.06343,1.16207 z M 154.75,449.81359 213,445.53937 l 0,-48.63532 0,-48.63532 -6.75,-0.48646 c -12.08914,-0.87124 -21.76189,-7.81535 -24.16168,-17.34578 -2.42872,-9.64533 0.0799,-25.74831 5.43472,-34.8856 C 192.65266,286.79786 204.26891,278 210.69634,278 l 2.30366,0 0,-78.5 c 0,-57.10559 0.30415,-78.5 1.11598,-78.5 0.61379,0 41.64665,4.52254 91.18413,10.05008 l 90.06815,10.05008 11.06587,-10.86353 c 6.08623,-5.97495 12.99708,-12.53822 15.35745,-14.58505 l 4.29159,-3.72151 -104.79159,0.32137 -104.79158,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -8.07973,2.81735 -21.76282,8.7427 -25.04435,10.84525 -1.85619,1.1893 -5.53056,3.49075 -8.16527,5.11435 C 143.34203,142.81494 125.27431,159.83811 118.09179,170.5 108.66133,184.4988 100,201.33974 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.48256 c 1.253729,-0.2654 28.492007,-2.40595 60.529507,-4.75677 z M 96.666667,393.33333 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.130862,13.7659 -1.209161,0 -2.498475,-0.3 -2.865141,-0.66667 z M 104,384.23423 c 0,-1.30368 -0.31152,-1.26229 -2,0.26577 -1.1,0.99549 -1.98503,2.75273 -1.96673,3.90499 0.0324,2.03968 0.0852,2.03266 2,-0.26577 1.0817,-1.29844 1.96673,-3.05568 1.96673,-3.90499 z m 29.96002,-140.53697 c -12.15099,-6.4256 -11.71334,-22.86505 1.06313,-39.93495 5.60485,-7.48832 11.03053,-10.26331 20.05962,-10.25962 5.57138,0.002 7.33081,0.46516 11.45138,3.01272 9.92533,6.13636 11.50946,14.94166 5.04227,28.02715 -8.81354,17.83299 -24.76021,25.95321 -37.6164,19.1547 z m 16.97501,-2.962 c 3.19227,-1.6194 9.77871,-13.95285 11.0604,-20.71118 2.405,-12.68148 -4.35178,-20.65171 -16.31098,-19.24028 -7.68452,0.90694 -15.6414,13.15327 -16.38387,25.2162 -0.46584,7.56845 0.69501,10.40651 5.61187,13.71998 3.84417,2.59059 11.90974,3.10167 16.02258,1.01528 z m 19.84487,-28.3246 c 0.39771,-4.5886 0.13256,-5.44077 -2.6949,-8.66107 -1.72481,-1.96445 -4.5201,-4.05422 -6.21176,-4.64394 l -3.07575,-1.07221 3.54475,3.92362 c 4.1186,4.55879 5.11292,8.58021 4.42307,17.88858 l -0.49316,6.65436 2.03332,-4.5 c 1.11832,-2.475 2.23182,-6.7902 2.47443,-9.58934 z M 655.34514,442.0185 c 0.1299,-4.35442 -0.22569,-5.4997 -2.20592,-7.10486 -3.60997,-2.92622 -4.34889,-2.2976 -2.14116,1.82155 1.14594,2.13809 2.00194,5.64427 2.00194,8.2 0,6.43251 2.14586,3.76367 2.34514,-2.91669 z M 213,314.86408 l 0,-29.13593 -4.63957,0.63593 C 205.80866,286.71383 202.91819,287 201.93715,287 c -4.67471,0 -12.36322,11.09766 -14.87335,21.46832 -1.53055,6.32347 -1.57596,18.13516 -0.0847,22.03168 3.00415,7.84959 11.84212,12.93509 23.27091,13.39043 L 213,344 l 0,-29.13592 z m 393.73111,12.96606 c 3.50377,-5.29456 4.15095,-13.105 1.44262,-17.41018 -2.0831,-3.3113 -6.9872,-6.09376 -12.34389,-7.0036 l -3.32984,-0.56558 3.52868,2.14468 c 5.34781,3.25033 8.2878,8.23027 8.76577,14.84801 0.37253,5.15791 0.0948,6.12269 -3.1511,10.94482 l -3.55963,5.28829 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z M 560.25,287.33772 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3572"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b39c4b"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 42.66166,-34.97968 C 563.89272,666.20747 602.97279,626.45955 619.17379,579 638.29905,522.97407 625.18446,464.66773 581.49877,411.5 565.15204,391.60519 549.4197,376.46254 522.5,354.71262 c -22.67582,-18.32105 -32.15356,-28.57809 -38.265,-41.41136 -4.91215,-10.3149 -5.15935,-17.90048 -0.86816,-26.63974 8.33783,-16.98046 31.35262,-36.52196 70.50648,-59.86595 6.39467,-3.81258 11.48166,-7.46378 11.30442,-8.11377 -0.38297,-1.40446 -64.78153,-107.50507 -67.18491,-110.69131 l -1.65721,-2.197 -5.91781,3.27366 c -10.20006,5.64256 -27.47975,17.45204 -38.91781,26.59765 -12.74497,10.19058 -36.65763,33.24894 -46.50346,44.84207 -20.01272,23.56427 -37.94787,57.16112 -44.53072,83.4167 -7.50765,29.94414 -5.24837,63.14187 6.23225,91.57643 13.92013,34.4766 39.09043,65.68363 75.81652,94 18.4845,14.25184 37.46407,32.2765 46.35939,44.02695 2.90038,3.83132 7.15276,10.75767 9.44972,15.39189 3.98087,8.03158 4.1763,8.85278 4.1763,17.54935 0,8.57149 -0.23342,9.59615 -3.858,16.93566 -7.24575,14.67207 -25.88431,29.99087 -54.87942,45.10469 l -12.73742,6.63944 1.37148,2.67601 c 1.49294,2.91298 2.2443,4.50425 24.40044,51.67601 22.52954,47.96673 27.151,57.5 27.87443,57.5 0.36256,0 8.00813,-3.81585 16.99015,-8.47968 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.38826,-5.69181 8.97551,-6.18527 19.80395,-16.64127 25.59306,-24.71279 40.28668,-54.90196 47.00746,-96.58043 1.92918,-11.96366 2.12912,-18.02226 2.50813,-76 l 0.41184,-63 -7.61067,-11.36035 C 322.82818,356.83967 314.61019,295.28003 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.91545,181.55507 364,179.13223 364,175.68066 l 0,-4.20565 -55.25,-6.29955 c -30.3875,-3.46476 -56.70466,-6.54524 -58.48257,-6.84553 l -3.23256,-0.54597 -0.26744,192.35802 L 246.5,542.5 l -2.27289,8 c -3.22806,11.36196 -7.38913,19.68982 -12.6465,25.31037 C 226.4631,581.2814 222.20852,583 213.78186,583 c -7.77869,0 -11.32951,-2.6524 -15.99009,-11.94431 -6.65695,-13.27212 -9.49714,-31.27147 -10.45625,-66.26502 l -0.64983,-23.70933 -4.09284,0.48429 c -4.1593,0.49215 -78.50366,6.05738 -95.263944,7.13121 -5.044102,0.32318 -9.679521,0.90182 -10.300931,1.28587 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.04179,-5.61312 c 13.26629,-13.76448 30.24615,-18.18024 36.98167,-9.61741 1.7327,2.20276 2.06961,3.78636 1.80362,8.47771 l -0.32708,5.76897 17.67601,-0.002 17.67601,-0.002 -14.22381,-30.25 c -7.8231,-16.6375 -18.90758,-40.26775 -24.63219,-52.51166 l -10.40838,-22.26165 -3.2133,11.26165 c -3.58639,12.56928 -10.51675,29.71626 -16.03922,39.68403 -9.5401,17.21934 -24.10157,35.50312 -37.7673,47.42165 L 324.9361,691 l 17.82374,0 17.82374,0 4.45821,-4.62563 z M 393,687.95034 c 0,-4.35841 -2.5052,-8.60934 -5.51961,-9.36591 -3.15351,-0.79148 -10.01902,2.7068 -16.52912,8.42231 l -4.45127,3.90799 13.25,0.0426 L 393,691 l 0,-3.04966 z m 6.41087,-0.32694 c 0.76908,-4.09954 -0.62071,-8.13015 -3.29726,-9.5626 -3.10971,-1.66426 -3.25467,-1.31673 -1.11555,2.67439 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.27503 1.60183,4.20075 2.41087,-0.11179 z m 212.05045,-22.49625 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.61576,-3.22123 3.59058,-6.21984 5.2419,-7.95941 6.10496,-9.86581 10.55123,-23.30647 7.71965,-23.33575 7.24438,-11.41862 7.57789,-190.01052 0.18523,-99.18682 -0.068,-162.3508 -0.66752,-166.5 -2.57642,-17.83117 -4.20809,-24.90224 -8.48352,-36.76448 -7.48256,-20.76049 -18.25455,-37.28071 -34.07006,-52.2508 -9.8421,-9.31599 -17.17322,-14.98995 -24.18519,-18.71825 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -3.95736,-3.45517 -27.32543,-11.82288 -38.04695,-13.62398 -7.35997,-1.23639 -18,-2.68058 -18,-2.44317 0,0.0867 16.20463,26.86445 36.0103,59.50616 19.80566,32.64172 35.66816,59.66768 35.25,60.05769 -0.41817,0.39 -9.0853,5.3253 -19.2603,10.96732 -39.83964,22.09101 -67.57668,41.50164 -75.35722,52.73567 l -2.85723,4.12544 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.28661,1.04347 1.49632,1.05725 0.89579,0.0589 -1.17565,-1.95457 4.0653,-11.52724 9.11575,-16.65006 14.90196,-15.11547 38.71375,-13.03955 47.35559,4.12848 1.33586,2.65383 2.47224,4.94356 2.52529,5.08828 0.053,0.14472 1.7261,-0.41778 3.71788,-1.25 4.67789,-1.95455 13.7323,-1.93705 18.46778,0.0357 5.2458,2.18534 11.0755,8.2087 12.28226,12.69027 2.83661,10.53436 -5.05008,23.67819 -17.98881,29.97985 -5.84891,2.84864 -14.93617,3.04188 -20.71493,0.4405 l -4.08864,-1.84054 -2.59054,2.59054 c -2.9266,2.9266 -3.96092,3.16368 -5.53382,1.26844 -0.84222,-1.0148 0.002,-2.51119 3.63048,-6.4378 l 4.72773,-5.11569 2.10237,2.36029 c 1.1563,1.29816 4.00134,2.87163 6.32232,3.49661 4.08528,1.10005 4.36101,1.02072 8.64017,-2.48573 10.03063,-8.21935 13.07207,-17.32811 8.17929,-24.49608 -4.10529,-6.01429 -14.61924,-9.27183 -17.75,-5.49949 -1.93076,2.32643 -2.7557,1.84072 -4.82715,-2.84215 -3.98807,-9.01569 -18.69935,-14.86046 -32.9289,-13.08259 -7.06977,0.88331 -10.2738,3.68284 -14.87875,13.00031 -4.41745,8.9381 -5.39767,7.25059 12.6348,21.7515 42.6167,34.27045 72.65254,66.65873 91.50607,98.67293 2.10536,3.575 3.88628,6.596 3.95759,6.71333 0.0713,0.11733 2.35867,-0.4688 5.083,-1.30252 6.83989,-2.09317 12.91455,-1.10344 16.74645,2.72845 2.82877,2.82878 2.94537,3.28198 2.48628,9.66435 -0.35002,4.86614 -1.47093,8.83571 -4.10112,14.52358 -1.99071,4.30495 -4.06915,7.54927 -4.61877,7.20959 -0.54961,-0.33969 -0.31763,1.31308 0.51552,3.67281 2.05192,5.81163 5.94765,21.62588 7.58501,30.79041 0.87132,4.87691 1.32191,15.36926 1.28833,30 -0.0469,20.45488 -0.29367,23.63618 -2.71445,35 -3.84123,18.0319 -7.84108,29.4894 -16.2728,46.61317 -10.77336,21.87935 -22.57546,38.24855 -42.38129,58.78173 l -8.57982,8.89489 7,-3.76775 c 3.85,-2.07226 10.1326,-5.84996 13.96132,-8.39489 z m 39.20535,-65.79382 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z m 6.3067,-6.60681 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.70319,2.62215 1.56979,1.54373 3.33138,-1.58058 z M 417,564.27263 c 9.075,-4.36591 20.58613,-10.46833 25.5803,-13.56092 9.61057,-5.95126 21.79167,-16.54209 24.60291,-21.39095 1.58514,-2.73406 1.57875,-3.13389 -0.10974,-6.86199 -4.79076,-10.57777 -19.92368,-26.20132 -44.10014,-45.5299 -7.96033,-6.36412 -17.24639,-14.13858 -20.63569,-17.27658 l -6.16236,-5.70544 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.28746,13.93382 -2.4413,13.28384 2.62004,11.06979 2.3375,-1.02252 11.675,-5.43125 20.75,-9.79716 z m -10.33333,-50.9393 c -1.12606,-1.12605 -0.74158,-5.2878 0.75606,-8.18391 0.7825,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.13086,13.7659 -1.20916,0 -2.49848,-0.3 -2.86514,-0.66667 z m 6.3067,-6.60681 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.70319,2.62215 1.56979,1.54373 3.33138,-1.58058 z m 235.95634,-60.02618 c 0.0825,-6.80958 -1.85501,-11.21379 -5.31534,-12.08228 -5.56106,-1.39574 -5.64831,-0.12211 -0.74809,10.92021 5.02627,11.32635 5.93814,11.50111 6.06343,1.16207 z M 154.75,449.81359 213,445.53937 l 0,-48.63532 0,-48.63532 -6.75,-0.48646 c -12.08914,-0.87124 -21.76189,-7.81535 -24.16168,-17.34578 -2.42872,-9.64533 0.0799,-25.74831 5.43472,-34.8856 C 192.65266,286.79786 204.26891,278 210.69634,278 l 2.30366,0 0,-78.5 c 0,-57.10559 0.30415,-78.5 1.11598,-78.5 0.61379,0 41.64665,4.52254 91.18413,10.05008 l 90.06815,10.05008 11.06587,-10.86353 c 6.08623,-5.97495 12.99708,-12.53822 15.35745,-14.58505 l 4.29159,-3.72151 -104.79159,0.32137 -104.79158,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -8.07973,2.81735 -21.76282,8.7427 -25.04435,10.84525 -1.85619,1.1893 -5.53056,3.49075 -8.16527,5.11435 C 143.34203,142.81494 125.27431,159.83811 118.09179,170.5 108.66133,184.4988 100,201.33974 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.48256 c 1.253729,-0.2654 28.492007,-2.40595 60.529507,-4.75677 z M 96.666667,393.33333 c -1.126053,-1.12605 -0.741574,-5.2878 0.756063,-8.18391 0.782502,-1.51319 3.02867,-3.61611 4.99147,-4.67315 3.34193,-1.79974 3.67551,-1.81514 5.24847,-0.24217 3.59001,3.59001 -2.4204,13.7659 -8.130862,13.7659 -1.209161,0 -2.498475,-0.3 -2.865141,-0.66667 z m 6.306703,-6.60681 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.703189,2.62215 1.56979,1.54373 3.33138,-1.58058 z m 30.98665,-143.02926 c -12.15099,-6.4256 -11.71334,-22.86505 1.06313,-39.93495 5.60485,-7.48832 11.03053,-10.26331 20.05962,-10.25962 5.57138,0.002 7.33081,0.46516 11.45138,3.01272 9.92533,6.13636 11.50946,14.94166 5.04227,28.02715 -8.81354,17.83299 -24.76021,25.95321 -37.6164,19.1547 z m 16.96874,-2.962 c 3.09414,-1.57367 9.69311,-13.67893 11.08412,-20.33291 2.75993,-13.20227 -4.70708,-21.76282 -16.9582,-19.44169 -5.13508,0.97291 -8.45583,4.35521 -12.80205,13.03934 -2.28589,4.56741 -2.75263,6.79998 -2.75263,13.16671 0,6.79311 0.28487,7.97352 2.5,10.35936 1.375,1.48095 3.4,3.06491 4.5,3.5199 3.05238,1.26255 11.70164,1.07629 14.42876,-0.31071 z m 19.85114,-28.3246 c 0.39771,-4.5886 0.13256,-5.44077 -2.6949,-8.66107 -1.72481,-1.96445 -4.5201,-4.05422 -6.21176,-4.64394 l -3.07575,-1.07221 3.54475,3.92362 c 4.1186,4.55879 5.11292,8.58021 4.42307,17.88858 l -0.49316,6.65436 2.03332,-4.5 c 1.11832,-2.475 2.23182,-6.7902 2.47443,-9.58934 z M 655.34514,442.0185 c 0.1299,-4.35442 -0.22569,-5.4997 -2.20592,-7.10486 -3.60997,-2.92622 -4.34889,-2.2976 -2.14116,1.82155 1.14594,2.13809 2.00194,5.64427 2.00194,8.2 0,6.43251 2.14586,3.76367 2.34514,-2.91669 z M 213,315 l 0,-29 -2.75,0.0435 c -5.55242,0.0879 -11.4163,1.76406 -13.70995,3.91883 -4.16278,3.91072 -8.64547,13.71286 -10.11149,22.11042 -2.31104,13.23795 0.0202,21.95519 7.18428,26.86409 3.86679,2.64956 11.10778,4.89117 16.13716,4.99562 L 213,344 l 0,-29 z m 393.73111,12.83014 c 3.50377,-5.29456 4.15095,-13.105 1.44262,-17.41018 -2.0831,-3.3113 -6.9872,-6.09376 -12.34389,-7.0036 l -3.32984,-0.56558 3.52868,2.14468 c 5.34781,3.25033 8.2878,8.23027 8.76577,14.84801 0.37253,5.15791 0.0948,6.12269 -3.1511,10.94482 l -3.55963,5.28829 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z M 560.25,287.33772 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3570"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#bc9d40"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 42.66166,-34.97968 C 563.89272,666.20747 602.97279,626.45955 619.17379,579 638.29905,522.97407 625.18446,464.66773 581.49877,411.5 565.15204,391.60519 549.4197,376.46254 522.5,354.71262 c -22.67582,-18.32105 -32.15356,-28.57809 -38.265,-41.41136 -4.91215,-10.3149 -5.15935,-17.90048 -0.86816,-26.63974 8.33783,-16.98046 31.35262,-36.52196 70.50648,-59.86595 6.39467,-3.81258 11.48166,-7.46378 11.30442,-8.11377 -0.38297,-1.40446 -64.78153,-107.50507 -67.18491,-110.69131 l -1.65721,-2.197 -5.91781,3.27366 c -10.20006,5.64256 -27.47975,17.45204 -38.91781,26.59765 -12.74497,10.19058 -36.65763,33.24894 -46.50346,44.84207 -20.01272,23.56427 -37.94787,57.16112 -44.53072,83.4167 -7.50765,29.94414 -5.24837,63.14187 6.23225,91.57643 13.92013,34.4766 39.09043,65.68363 75.81652,94 18.4845,14.25184 37.46407,32.2765 46.35939,44.02695 2.90038,3.83132 7.15276,10.75767 9.44972,15.39189 3.98087,8.03158 4.1763,8.85278 4.1763,17.54935 0,8.57149 -0.23342,9.59615 -3.858,16.93566 -7.24575,14.67207 -25.88431,29.99087 -54.87942,45.10469 l -12.73742,6.63944 1.37148,2.67601 c 1.49294,2.91298 2.2443,4.50425 24.40044,51.67601 22.52954,47.96673 27.151,57.5 27.87443,57.5 0.36256,0 8.00813,-3.81585 16.99015,-8.47968 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.38826,-5.69181 8.97551,-6.18527 19.80395,-16.64127 25.59306,-24.71279 40.28668,-54.90196 47.00746,-96.58043 1.92918,-11.96366 2.12912,-18.02226 2.50813,-76 l 0.41184,-63 -7.61067,-11.36035 C 322.82818,356.83967 314.61019,295.28003 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.91545,181.55507 364,179.13223 364,175.68066 l 0,-4.20565 -55.25,-6.29955 c -30.3875,-3.46476 -56.70466,-6.54524 -58.48257,-6.84553 l -3.23256,-0.54597 -0.26744,192.35802 L 246.5,542.5 l -2.27289,8 c -3.22806,11.36196 -7.38913,19.68982 -12.6465,25.31037 C 226.4631,581.2814 222.20852,583 213.78186,583 c -7.77869,0 -11.32951,-2.6524 -15.99009,-11.94431 -6.65695,-13.27212 -9.49714,-31.27147 -10.45625,-66.26502 l -0.64983,-23.70933 -4.09284,0.48429 c -4.1593,0.49215 -78.50366,6.05738 -95.263944,7.13121 -5.044102,0.32318 -9.679521,0.90182 -10.300931,1.28587 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 138.00537,-7.35375 c 8.60214,-8.11481 16.17222,-11.92656 23.8944,-12.03147 9.60167,-0.13045 13.58124,4.07166 12.92551,13.64835 L 403.5,691.00124 421.17601,691.00062 438.85202,691 424.62821,660.75 c -7.8231,-16.6375 -18.90758,-40.26775 -24.63219,-52.51166 l -10.40838,-22.26165 -3.2133,11.26165 c -3.58639,12.56928 -10.51675,29.71626 -16.03922,39.68403 -9.5401,17.21934 -24.10157,35.50312 -37.7673,47.42165 L 324.9361,691 l 17.66035,0 17.66035,0 6.74857,-6.36626 z M 393,687.95034 c 0,-4.35841 -2.5052,-8.60934 -5.51961,-9.36591 -3.15351,-0.79148 -10.01902,2.7068 -16.52912,8.42231 l -4.45127,3.90799 13.25,0.0426 L 393,691 l 0,-3.04966 z m 6.41087,-0.32694 c 0.76908,-4.09954 -0.62071,-8.13015 -3.29726,-9.5626 -3.10971,-1.66426 -3.25467,-1.31673 -1.11555,2.67439 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.27503 1.60183,4.20075 2.41087,-0.11179 z m 212.05045,-22.49625 c 9.09572,-6.04587 23.76867,-20.1196 31.4366,-30.15278 3.35614,-4.39139 6.10208,-8.32986 6.10208,-8.75216 0,-0.4223 1.61576,-3.22123 3.59058,-6.21984 5.2419,-7.95941 6.10496,-9.86581 10.55123,-23.30647 7.71965,-23.33575 7.24438,-11.41862 7.57789,-190.01052 0.18523,-99.18682 -0.068,-162.3508 -0.66752,-166.5 -2.57642,-17.83117 -4.20809,-24.90224 -8.48352,-36.76448 -7.48256,-20.76049 -18.25455,-37.28071 -34.07006,-52.2508 -9.8421,-9.31599 -17.17322,-14.98995 -24.18519,-18.71825 -2.59573,-1.38017 -5.41564,-3.11718 -6.26646,-3.86003 -3.95736,-3.45517 -27.32543,-11.82288 -38.04695,-13.62398 -7.35997,-1.23639 -18,-2.68058 -18,-2.44317 0,0.0867 16.20463,26.86445 36.0103,59.50616 19.80566,32.64172 35.66816,59.66768 35.25,60.05769 -0.41817,0.39 -9.0853,5.3253 -19.2603,10.96732 -39.83964,22.09101 -67.57668,41.50164 -75.35722,52.73567 l -2.85723,4.12544 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.09113,0.88494 1.4222,0.93326 0.94463,0.13787 -1.27596,-2.12511 4.47918,-12.10625 9.9805,-17.30917 7.0654,-6.68217 12.98645,-9.19225 21.87083,-9.27162 11.76977,-0.10514 20.82517,5.32688 25.29207,15.17183 0.90674,1.99843 1.70537,3.75192 1.77473,3.89664 0.0694,0.14472 1.75576,-0.41778 3.74754,-1.25 4.98416,-2.08252 14.26068,-1.89746 19.18566,0.38273 8.04837,3.72628 13.16909,12.06626 11.96131,19.48107 -2.85316,17.51604 -23.95314,30.08721 -39.0851,23.28653 l -4.08642,-1.83653 -2.79092,2.58653 c -3.18539,2.95213 -3.82512,3.10329 -5.35123,1.26443 -0.84222,-1.0148 0.002,-2.51119 3.63048,-6.4378 l 4.72773,-5.11569 2.10237,2.36029 c 1.1563,1.29816 4.00134,2.87163 6.32232,3.49661 4.08528,1.10005 4.36101,1.02072 8.64017,-2.48573 10.03063,-8.21935 13.07207,-17.32811 8.17929,-24.49608 -4.10529,-6.01429 -14.61924,-9.27183 -17.75,-5.49949 -1.93076,2.32643 -2.7557,1.84072 -4.82715,-2.84215 -3.98807,-9.01569 -18.69935,-14.86046 -32.9289,-13.08259 -7.06977,0.88331 -10.2738,3.68284 -14.87875,13.00031 -4.41745,8.9381 -5.39767,7.25059 12.6348,21.7515 37.14643,29.8715 64.59098,58.13288 83.19677,85.67293 3.52996,5.225 7.74226,11.86589 9.36067,14.75753 2.04974,3.66231 3.39701,5.08422 4.44033,4.68631 4.86395,-1.85504 11.10189,-2.49409 14.7518,-1.51127 6.27326,1.68921 7.75735,4.08115 7.70932,12.42527 -0.0351,6.09457 -0.5808,8.29022 -3.72059,14.96935 -2.02372,4.30495 -4.12918,7.54927 -4.6788,7.20959 -0.54961,-0.33969 -0.31763,1.31308 0.51552,3.67281 2.05192,5.81163 5.94765,21.62588 7.58501,30.79041 0.87132,4.87691 1.32191,15.36926 1.28833,30 -0.0469,20.45488 -0.29367,23.63618 -2.71445,35 -3.84123,18.0319 -7.84108,29.4894 -16.2728,46.61317 -10.77336,21.87935 -22.57546,38.24855 -42.38129,58.78173 l -8.57982,8.89489 7,-3.76775 c 3.85,-2.07226 10.1326,-5.84996 13.96132,-8.39489 z M 651.25,599.33772 c -3.58341,-1.44594 -0.0132,-9.93338 5.40612,-12.85186 3.16279,-1.70328 3.53965,-1.71866 5.05201,-0.20631 1.39946,1.39947 1.46253,2.20747 0.439,5.62371 -1.76049,5.876 -6.59142,9.17185 -10.89713,7.43446 z m 5.72337,-6.6112 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.70319,2.62215 1.56979,1.54373 3.33138,-1.58058 z M 417,564.27263 c 9.075,-4.36591 20.58613,-10.46833 25.5803,-13.56092 9.61057,-5.95126 21.79167,-16.54209 24.60291,-21.39095 1.58514,-2.73406 1.57875,-3.13389 -0.10974,-6.86199 -4.79076,-10.57777 -19.92368,-26.20132 -44.10014,-45.5299 -7.96033,-6.36412 -17.24639,-14.13858 -20.63569,-17.27658 l -6.16236,-5.70544 -0.49287,49.77658 c -0.38091,38.46995 -0.84712,51.93447 -2.05245,59.27657 -2.28746,13.93382 -2.4413,13.28384 2.62004,11.06979 2.3375,-1.02252 11.675,-5.43125 20.75,-9.79716 z m -9.75,-50.93491 c -3.58341,-1.44594 -0.0132,-9.93338 5.40612,-12.85186 3.16279,-1.70328 3.53965,-1.71866 5.05201,-0.20631 1.39946,1.39947 1.46253,2.20747 0.439,5.62371 -1.76049,5.876 -6.59142,9.17185 -10.89713,7.43446 z m 5.72337,-6.6112 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.70319,2.62215 1.56979,1.54373 3.33138,-1.58058 z m 235.95634,-60.02618 c 0.0825,-6.80958 -1.85501,-11.21379 -5.31534,-12.08228 -5.56106,-1.39574 -5.64831,-0.12211 -0.74809,10.92021 5.02627,11.32635 5.93814,11.50111 6.06343,1.16207 z M 154.75,449.81359 213,445.53937 213,396.76969 213,348 l -4.96249,0 c -5.89746,0 -14.8758,-3.15161 -19.09696,-6.70348 -9.33234,-7.85264 -10.3749,-27.32403 -2.34146,-43.73045 C 191.16448,288.24231 203.98111,278 211.08291,278 212.95608,278 213,276.20175 213,199.5 c 0,-57.10559 0.30415,-78.5 1.11598,-78.5 0.61379,0 41.64665,4.52254 91.18413,10.05008 l 90.06815,10.05008 11.06587,-10.86353 c 6.08623,-5.97495 12.99708,-12.53822 15.35745,-14.58505 l 4.29159,-3.72151 -104.79159,0.32137 -104.79158,0.32138 -12,2.7624 c -6.6,1.51932 -13.8,3.39005 -16,4.15717 -8.07973,2.81735 -21.76282,8.7427 -25.04435,10.84525 -1.85619,1.1893 -5.53056,3.49075 -8.16527,5.11435 C 143.34203,142.81494 125.27431,159.83811 118.09179,170.5 108.66133,184.4988 100,201.33974 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.48256 c 1.253729,-0.2654 28.492007,-2.40595 60.529507,-4.75677 z m -57.5,-56.47587 c -3.583413,-1.44594 -0.01318,-9.93338 5.40612,-12.85186 3.16279,-1.70328 3.53965,-1.71866 5.05201,-0.20631 1.39946,1.39947 1.46253,2.20747 0.439,5.62371 -1.76049,5.876 -6.59142,9.17185 -10.89713,7.43446 z m 5.72337,-6.6112 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.703189,2.62215 1.56979,1.54373 3.33138,-1.58058 z M 133.96002,243.69726 C 128.83916,240.98928 125,234.6696 125,228.94805 c 0,-9.44834 7.41122,-24.06761 15.76413,-31.09612 3.88447,-3.26857 11.90811,-5.27813 17.6414,-4.41837 5.63899,0.84562 13.02343,5.57841 15.22738,9.75944 2.88697,5.47676 2.22397,12.68863 -1.94127,21.11643 -8.75706,17.71869 -25.05331,26.09228 -37.73162,19.38783 z m 16.96874,-2.962 c 3.09414,-1.57367 9.69311,-13.67893 11.08412,-20.33291 2.75993,-13.20227 -4.70708,-21.76282 -16.9582,-19.44169 -5.13508,0.97291 -8.45583,4.35521 -12.80205,13.03934 -2.28589,4.56741 -2.75263,6.79998 -2.75263,13.16671 0,6.79311 0.28487,7.97352 2.5,10.35936 1.375,1.48095 3.4,3.06491 4.5,3.5199 3.05238,1.26255 11.70164,1.07629 14.42876,-0.31071 z m 19.85114,-28.3246 c 0.39771,-4.5886 0.13256,-5.44077 -2.6949,-8.66107 -1.72481,-1.96445 -4.5201,-4.05422 -6.21176,-4.64394 l -3.07575,-1.07221 3.54475,3.92362 c 4.1186,4.55879 5.11292,8.58021 4.42307,17.88858 l -0.49316,6.65436 2.03332,-4.5 c 1.11832,-2.475 2.23182,-6.7902 2.47443,-9.58934 z M 655.34514,442.0185 c 0.1299,-4.35442 -0.22569,-5.4997 -2.20592,-7.10486 -3.60997,-2.92622 -4.34889,-2.2976 -2.14116,1.82155 1.14594,2.13809 2.00194,5.64427 2.00194,8.2 0,6.43251 2.14586,3.76367 2.34514,-2.91669 z M 213,315 l 0,-29 -2.75,0.0435 c -5.55242,0.0879 -11.4163,1.76406 -13.70995,3.91883 -4.16278,3.91072 -8.64547,13.71286 -10.11149,22.11042 -2.31104,13.23795 0.0202,21.95519 7.18428,26.86409 3.86679,2.64956 11.10778,4.89117 16.13716,4.99562 L 213,344 l 0,-29 z m 393.73111,12.83014 c 3.50377,-5.29456 4.15095,-13.105 1.44262,-17.41018 -2.0831,-3.3113 -6.9872,-6.09376 -12.34389,-7.0036 l -3.32984,-0.56558 3.52868,2.14468 c 5.34781,3.25033 8.2878,8.23027 8.76577,14.84801 0.37253,5.15791 0.0948,6.12269 -3.1511,10.94482 l -3.55963,5.28829 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z M 560.25,287.33772 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3568"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ae984b"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 42.8095,-35.05644 c 53.39494,-27.72479 89.89048,-61.15644 109.10301,-99.94356 18.81733,-37.98929 21.92467,-79.17183 9.01661,-119.5 -4.00957,-12.52696 -15.12165,-35.09979 -23.23648,-47.20207 -17.51669,-26.12402 -40.587,-50.16229 -73.32606,-76.40259 -13.01866,-10.43444 -25.77778,-22.38155 -31.64153,-29.62784 -5.06205,-6.25555 -10.63925,-18.2474 -11.37473,-24.45744 -1.46659,-12.38302 8.93749,-27.77889 30.82243,-45.61078 8.72637,-7.11027 30.53114,-21.78292 44.11657,-29.68649 5.93412,-3.45229 10.65912,-6.58173 10.5,-6.95432 C 565.0859,217.41144 499.67681,110.223 498.09756,108.12934 l -1.76312,-2.33743 -9.17243,5.17068 c -10.73385,6.05089 -28.12858,18.31893 -40.16201,28.3252 -11.05036,9.18881 -33.30837,31.04331 -41.98012,41.21908 -15.66936,18.38701 -31.63867,45.57815 -39.34497,66.99313 -4.65211,12.92771 -6.49649,20.42014 -8.22774,33.42357 -5.79453,43.52278 6.8438,84.11692 38.6292,124.07643 9.62436,12.0994 30.75968,32.49039 44.92896,43.34664 9.75455,7.47378 25.36607,21.03832 32.98818,28.66278 11.83541,11.83905 18.84899,21.05529 24.28752,31.91519 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.5769 -0.23263,9.59795 -3.858,16.9334 -7.24921,14.66776 -25.89358,29.98969 -54.8756,45.09668 l -12.73359,6.63744 1.84438,3.678 c 1.0144,2.02291 3.21133,6.60301 4.88205,10.17801 32.06473,68.61182 46.13275,98 46.91227,98 0.36256,0 8.07466,-3.8504 17.13799,-8.55644 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.14472,-5.52656 8.91592,-6.16283 18.44947,-15.2217 26.14774,-24.84581 41.79646,-56.36718 48.2758,-97.24239 2.03183,-12.8179 2.20898,-18.0608 2.59345,-76.75761 l 0.41266,-63 -7.61067,-11.36035 C 322.82818,356.83967 314.61019,295.28003 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.91545,181.55507 364,179.13223 364,175.68066 l 0,-4.20565 -55.25,-6.29955 c -30.3875,-3.46476 -56.70357,-6.54504 -58.48015,-6.84508 l -3.23016,-0.54552 -0.27154,192.35757 -0.27155,192.35757 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -2.49299,1.13235 -6.40714,1.85067 -10.15793,1.86417 -8.3749,0.0301 -11.83548,-2.41165 -16.44855,-11.60612 -6.75965,-13.4729 -9.6231,-31.44581 -10.60371,-66.5561 l -0.66149,-23.68418 -4.59207,0.46752 c -5.26768,0.53631 -80.98002,6.20358 -94.763154,7.09328 -5.044102,0.3256 -9.679521,0.90622 -10.300931,1.29027 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 138.00537,-7.35375 c 8.60214,-8.11481 16.17222,-11.92656 23.8944,-12.03147 9.60167,-0.13045 13.58124,4.07166 12.92551,13.64835 l -0.32528,4.75062 17.70872,-6.2e-4 17.70872,-6.2e-4 -6.26929,-13.25 c -3.4481,-7.2875 -14.54914,-30.91128 -24.66898,-52.4973 l -18.39969,-39.24729 -3.20017,11.24729 c -9.64053,33.88255 -28.88922,65.07054 -53.63566,86.90398 L 324.98731,691 l 17.63475,0 17.63474,0 6.74857,-6.36626 z M 393,687.95034 c 0,-4.35841 -2.5052,-8.60934 -5.51961,-9.36591 -3.15351,-0.79148 -10.01902,2.7068 -16.52912,8.42231 l -4.45127,3.90799 13.25,0.0426 L 393,691 l 0,-3.04966 z m 6.375,-0.0753 c 0.98144,-4.90718 0.78649,-5.80442 -1.82955,-8.42045 -3.60778,-3.60779 -4.83639,-2.99013 -2.54739,1.28064 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.15345 1.55398,4.24493 2.375,0.13981 z M 611.5,665.1563 c 7.88058,-5.17641 28.6737,-25.33491 33.09725,-32.08711 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42606,-5.74419 4.12942,-6.56919 0.70336,-0.825 2.02432,-2.97153 2.93547,-4.77006 C 660.00305,607.12228 668,582.88765 668,580.15366 c 0,-1.34975 0.68852,-5.874 1.53004,-10.05388 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26422,-153.31913 -0.38415,-163.00848 -2.12275,-171.5 -2.59309,-12.66498 -9.1308,-33.0713 -12.70933,-39.66999 -8.46258,-15.60472 -16.51129,-26.2839 -28.17579,-37.38419 C 616.16896,140.40386 607.66745,134.22695 592.84182,126.06658 585.68374,122.12662 563.64337,115.32955 554,114.0881 c -5.225,-0.67265 -10.2875,-1.37552 -11.25,-1.56193 -0.9625,-0.18641 -1.75,-0.20784 -1.75,-0.0476 0,0.16023 16.20266,26.98044 36.00591,59.60048 19.80324,32.62004 35.66574,59.62628 35.25,60.01388 -0.41575,0.38759 -9.08091,5.3175 -19.25591,10.95534 -40.37375,22.37062 -67.45108,41.33716 -75.40956,52.82125 l -2.80489,4.04745 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.09113,0.88494 1.4222,0.93326 0.94463,0.13787 -1.27596,-2.12511 4.47918,-12.10625 9.9805,-17.30917 7.0654,-6.68217 12.98645,-9.19225 21.87083,-9.27162 11.76977,-0.10514 20.82517,5.32688 25.29207,15.17183 0.90674,1.99843 1.70537,3.75192 1.77473,3.89664 0.0694,0.14472 1.75576,-0.41778 3.74754,-1.25 4.98416,-2.08252 14.26068,-1.89746 19.18566,0.38273 8.04837,3.72628 13.16909,12.06626 11.96131,19.48107 -2.85316,17.51604 -23.95314,30.08721 -39.0851,23.28653 l -4.08642,-1.83653 -2.79092,2.58653 c -3.18539,2.95213 -3.82512,3.10329 -5.35123,1.26443 -0.84222,-1.0148 0.002,-2.51119 3.63048,-6.4378 l 4.72773,-5.11569 2.10237,2.36029 c 1.1563,1.29816 4.00134,2.87163 6.32232,3.49661 4.08528,1.10005 4.36101,1.02072 8.64017,-2.48573 10.03063,-8.21935 13.07207,-17.32811 8.17929,-24.49608 -4.10529,-6.01429 -14.61924,-9.27183 -17.75,-5.49949 -1.93076,2.32643 -2.7557,1.84072 -4.82715,-2.84215 -3.98807,-9.01569 -18.69935,-14.86046 -32.9289,-13.08259 -7.07195,0.88358 -10.27381,3.68285 -14.88539,13.01374 l -3.67804,7.44202 2.40974,2.58604 c 1.32536,1.42231 6.68474,6.00653 11.90974,10.18715 37.13373,29.71137 64.95705,57.89735 83.11247,84.19579 4.9517,7.17261 12.65285,19.37528 14.30588,22.66801 0.0464,0.0924 2.55874,-0.48239 5.583,-1.27733 6.67922,-1.75567 12.15627,-1.02014 15.80642,2.12268 2.47666,2.13243 2.68894,2.9053 2.65112,9.65234 -0.0354,6.31664 -0.55165,8.42035 -3.72059,15.16149 -2.02372,4.30495 -4.09375,7.57116 -4.60007,7.25824 -0.50632,-0.31292 0.15576,2.82046 1.47128,6.96307 7.09951,22.35648 10.1162,53.2804 7.45801,76.4515 -5.12822,44.70201 -24.28729,83.12482 -60.04979,120.42768 l -9.51773,9.92768 7,-3.80053 c 3.85,-2.09029 10.15,-5.86963 14,-8.39853 z m 39.75,-65.81858 c -3.58341,-1.44594 -0.0132,-9.93338 5.40612,-12.85186 3.16279,-1.70328 3.53965,-1.71866 5.05201,-0.20631 1.39946,1.39947 1.46253,2.20747 0.439,5.62371 -1.76049,5.876 -6.59142,9.17185 -10.89713,7.43446 z m 5.72337,-6.6112 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.70319,2.62215 1.56979,1.54373 3.33138,-1.58058 z M 417,564.2877 c 9.075,-4.36706 20.72191,-10.55732 25.88203,-13.75613 9.72213,-6.02687 21.37308,-16.20376 24.30118,-21.22664 1.58506,-2.71902 1.57866,-3.11824 -0.10974,-6.84616 -4.80139,-10.60125 -19.74635,-26.01604 -44.55798,-45.95877 -8.21135,-6.6 -17.49423,-14.37182 -20.62863,-17.2707 l -5.69889,-5.2707 -0.50726,49.7707 c -0.38989,38.25472 -0.86625,51.96882 -2.05879,59.2707 -2.27657,13.93939 -2.43254,13.28189 2.62808,11.07836 2.3375,-1.01781 11.675,-5.42361 20.75,-9.79066 z m -9.75,-50.94998 c -3.58341,-1.44594 -0.0132,-9.93338 5.40612,-12.85186 3.16279,-1.70328 3.53965,-1.71866 5.05201,-0.20631 1.39946,1.39947 1.46253,2.20747 0.439,5.62371 -1.76049,5.876 -6.59142,9.17185 -10.89713,7.43446 z m 5.72337,-6.6112 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.70319,2.62215 1.56979,1.54373 3.33138,-1.58058 z m 235.95634,-60.02618 c 0.0825,-6.80958 -1.85501,-11.21379 -5.31534,-12.08228 -5.56106,-1.39574 -5.64831,-0.12211 -0.74809,10.92021 5.02627,11.32635 5.93814,11.50111 6.06343,1.16207 z M 154.75,449.8277 213,445.56109 213,396.78054 213,348 l -4.96249,0 c -5.89746,0 -14.8758,-3.15161 -19.09696,-6.70348 -9.33234,-7.85264 -10.3749,-27.32403 -2.34146,-43.73045 C 191.16448,288.24231 203.98111,278 211.08291,278 212.95608,278 213,276.20175 213,199.5 c 0,-43.175 0.36452,-78.5 0.81004,-78.5 0.44552,0 41.48298,4.51763 91.19436,10.03918 l 90.38433,10.03919 10.55564,-10.34574 c 5.80559,-5.69016 12.68308,-12.23279 15.28329,-14.53918 L 425.95531,112 325.22766,112.0327 c -56.61853,0.0184 -103.57404,0.44022 -107.22766,0.96329 -29.37607,4.20561 -53.38798,14.02963 -73.42841,30.04182 -8.60395,6.87452 -21.90005,20.66389 -26.4798,27.46217 C 108.66133,184.4988 100,201.33974 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.4793 C 95.474222,454.31 122.7125,452.17434 154.75,449.8277 z m -57.5,-56.48998 c -3.583413,-1.44594 -0.01318,-9.93338 5.40612,-12.85186 3.16279,-1.70328 3.53965,-1.71866 5.05201,-0.20631 1.39946,1.39947 1.46253,2.20747 0.439,5.62371 -1.76049,5.876 -6.59142,9.17185 -10.89713,7.43446 z m 5.72337,-6.6112 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.703189,2.62215 1.56979,1.54373 3.33138,-1.58058 z M 133.96002,243.69726 C 128.83916,240.98928 125,234.6696 125,228.94805 c 0,-9.44834 7.41122,-24.06761 15.76413,-31.09612 3.88447,-3.26857 11.90811,-5.27813 17.6414,-4.41837 5.63899,0.84562 13.02343,5.57841 15.22738,9.75944 2.88697,5.47676 2.22397,12.68863 -1.94127,21.11643 -8.75706,17.71869 -25.05331,26.09228 -37.73162,19.38783 z m 16.96874,-2.962 c 3.09414,-1.57367 9.69311,-13.67893 11.08412,-20.33291 2.75993,-13.20227 -4.70708,-21.76282 -16.9582,-19.44169 -5.13508,0.97291 -8.45583,4.35521 -12.80205,13.03934 -2.28589,4.56741 -2.75263,6.79998 -2.75263,13.16671 0,6.79311 0.28487,7.97352 2.5,10.35936 1.375,1.48095 3.4,3.06491 4.5,3.5199 3.05238,1.26255 11.70164,1.07629 14.42876,-0.31071 z m 19.80433,-27.7283 c 0.47724,-5.2631 0.29367,-5.90689 -2.63557,-9.24311 -1.73169,-1.97229 -4.53262,-4.06848 -6.22428,-4.6582 l -3.07575,-1.07221 3.54475,3.92362 c 4.13283,4.57454 5.12499,8.62275 4.38427,17.88858 l -0.53196,6.65436 2.01278,-3.91796 c 1.10703,-2.15488 2.24362,-6.46366 2.52576,-9.57508 z m 484.77655,229.80225 c 0.6249,-4.1894 0.42614,-4.96434 -1.85952,-7.25 -3.70221,-3.70221 -4.96622,-3.14173 -2.65206,1.17598 1.21945,2.27524 2.01383,5.69531 2.03235,8.75 0.0361,5.94756 1.41493,4.45927 2.47923,-2.67598 z M 213,315 l 0,-29 -2.75,0.0435 c -5.55242,0.0879 -11.4163,1.76406 -13.70995,3.91883 -4.16278,3.91072 -8.64547,13.71286 -10.11149,22.11042 -2.31104,13.23795 0.0202,21.95519 7.18428,26.86409 3.86679,2.64956 11.10778,4.89117 16.13716,4.99562 L 213,344 l 0,-29 z m 393.73111,12.83014 c 3.50377,-5.29456 4.15095,-13.105 1.44262,-17.41018 -2.07564,-3.29944 -6.9527,-6.07487 -12.34389,-7.02465 l -3.32984,-0.58662 3,1.96262 c 10.11037,6.61427 12.43232,16.6703 6.04186,26.16649 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z M 560.25,287.33772 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3566"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#c99334"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 42.8095,-35.05644 c 53.39494,-27.72479 89.89048,-61.15644 109.10301,-99.94356 18.81733,-37.98929 21.92467,-79.17183 9.01661,-119.5 -4.00957,-12.52696 -15.12165,-35.09979 -23.23648,-47.20207 -17.51669,-26.12402 -40.587,-50.16229 -73.32606,-76.40259 -13.01866,-10.43444 -25.77778,-22.38155 -31.64153,-29.62784 -5.06205,-6.25555 -10.63925,-18.2474 -11.37473,-24.45744 -1.46659,-12.38302 8.93749,-27.77889 30.82243,-45.61078 8.72637,-7.11027 30.53114,-21.78292 44.11657,-29.68649 5.93412,-3.45229 10.65912,-6.58173 10.5,-6.95432 C 565.0859,217.41144 499.67681,110.223 498.09756,108.12934 l -1.76312,-2.33743 -9.17243,5.17068 c -10.73385,6.05089 -28.12858,18.31893 -40.16201,28.3252 -11.05036,9.18881 -33.30837,31.04331 -41.98012,41.21908 -15.66936,18.38701 -31.63867,45.57815 -39.34497,66.99313 -4.65211,12.92771 -6.49649,20.42014 -8.22774,33.42357 -5.79453,43.52278 6.8438,84.11692 38.6292,124.07643 9.62436,12.0994 30.75968,32.49039 44.92896,43.34664 9.75455,7.47378 25.36607,21.03832 32.98818,28.66278 11.83541,11.83905 18.84899,21.05529 24.28752,31.91519 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.5769 -0.23263,9.59795 -3.858,16.9334 -7.24921,14.66776 -25.89358,29.98969 -54.8756,45.09668 l -12.73359,6.63744 1.84438,3.678 c 1.0144,2.02291 3.21133,6.60301 4.88205,10.17801 32.06473,68.61182 46.13275,98 46.91227,98 0.36256,0 8.07466,-3.8504 17.13799,-8.55644 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.14472,-5.52656 8.91592,-6.16283 18.44947,-15.2217 26.14774,-24.84581 41.79646,-56.36718 48.2758,-97.24239 2.03183,-12.8179 2.20898,-18.0608 2.59345,-76.75761 l 0.41266,-63 -7.61067,-11.36035 C 322.82818,356.83967 314.61019,295.28003 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.91545,181.55507 364,179.13223 364,175.68066 l 0,-4.20565 -55.25,-6.29955 c -30.3875,-3.46476 -56.70357,-6.54504 -58.48015,-6.84508 l -3.23016,-0.54552 -0.27154,192.35757 -0.27155,192.35757 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -2.49299,1.13235 -6.40714,1.85067 -10.15793,1.86417 -8.3749,0.0301 -11.83548,-2.41165 -16.44855,-11.60612 -6.75965,-13.4729 -9.6231,-31.44581 -10.60371,-66.5561 l -0.66149,-23.68418 -4.59207,0.46752 c -5.26768,0.53631 -80.98002,6.20358 -94.763154,7.09328 -5.044102,0.3256 -9.679521,0.90622 -10.300931,1.29027 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.04179,-5.61312 c 17.72452,-18.39012 39.75476,-18.74432 38.74952,-0.62301 l -0.29131,5.25137 17.70872,-0.001 17.70872,-10e-4 -6.26929,-13.25 c -3.4481,-7.2875 -14.54914,-30.91128 -24.66898,-52.4973 l -18.39969,-39.24729 -3.20017,11.24729 c -9.64053,33.88255 -28.88922,65.07054 -53.63566,86.90398 L 324.98731,691 l 17.79814,0 17.79813,0 4.45821,-4.62563 z M 393,687.95034 c 0,-4.35841 -2.5052,-8.60934 -5.51961,-9.36591 -3.15351,-0.79148 -10.01902,2.7068 -16.52912,8.42231 l -4.45127,3.90799 13.25,0.0426 L 393,691 l 0,-3.04966 z m 6.375,-0.0753 c 0.98144,-4.90718 0.78649,-5.80442 -1.82955,-8.42045 -3.60778,-3.60779 -4.83639,-2.99013 -2.54739,1.28064 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.15345 1.55398,4.24493 2.375,0.13981 z M 611.5,665.1563 c 7.88058,-5.17641 28.6737,-25.33491 33.09725,-32.08711 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42606,-5.74419 4.12942,-6.56919 0.70336,-0.825 2.02432,-2.97153 2.93547,-4.77006 C 660.00305,607.12228 668,582.88765 668,580.15366 c 0,-1.34975 0.68852,-5.874 1.53004,-10.05388 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26422,-153.31913 -0.38415,-163.00848 -2.12275,-171.5 -2.59309,-12.66498 -9.1308,-33.0713 -12.70933,-39.66999 -8.46258,-15.60472 -16.51129,-26.2839 -28.17579,-37.38419 C 616.16896,140.40386 607.66745,134.22695 592.84182,126.06658 585.68374,122.12662 563.64337,115.32955 554,114.0881 c -5.225,-0.67265 -10.2875,-1.37552 -11.25,-1.56193 -0.9625,-0.18641 -1.75,-0.20784 -1.75,-0.0476 0,0.16023 16.20266,26.98044 36.00591,59.60048 19.80324,32.62004 35.66574,59.62628 35.25,60.01388 -0.41575,0.38759 -9.08091,5.3175 -19.25591,10.95534 -40.37375,22.37062 -67.45108,41.33716 -75.40956,52.82125 l -2.80489,4.04745 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05314,0.85412 1.40886,0.91089 0.95346,0.15216 -1.23889,-2.06409 4.87941,-12.58289 10.22995,-17.58769 6.90542,-6.45921 12.83135,-8.92894 21.61255,-9.00739 11.76977,-0.10514 20.82517,5.32688 25.29207,15.17183 0.90674,1.99843 1.70537,3.75192 1.77473,3.89664 0.0694,0.14472 1.75576,-0.41778 3.74754,-1.25 4.98416,-2.08252 14.26068,-1.89746 19.18566,0.38273 8.04837,3.72628 13.16909,12.06626 11.96131,19.48107 -2.87067,17.6235 -23.95231,30.08825 -39.25499,23.20992 l -4.25631,-1.91314 -2.98889,2.86354 c -2.64833,2.53726 -3.15873,2.69371 -4.4794,1.37304 -1.32067,-1.32066 -0.94843,-2.07704 3.26682,-6.63819 l 4.75731,-5.1477 2.10237,2.36029 c 1.1563,1.29816 4.00134,2.87163 6.32232,3.49661 4.08528,1.10005 4.36101,1.02072 8.64017,-2.48573 10.03063,-8.21935 13.07207,-17.32811 8.17929,-24.49608 -4.10529,-6.01429 -14.61924,-9.27183 -17.75,-5.49949 -1.93076,2.32643 -2.7557,1.84072 -4.82715,-2.84215 -3.98807,-9.01569 -18.69935,-14.86046 -32.9289,-13.08259 -7.07195,0.88358 -10.27381,3.68285 -14.88539,13.01374 l -3.67804,7.44202 2.40974,2.58604 c 1.32536,1.42231 6.68474,6.00653 11.90974,10.18715 37.35402,29.88763 64.3618,57.26248 83.14429,84.27434 4.04564,5.8182 8.93071,13.35413 10.85571,16.74651 2.45696,4.32983 3.94635,6.00101 4.99777,5.60776 5.07522,-1.89826 11.10862,-2.48126 14.95622,-1.44521 9.06508,2.44097 10.46201,12.74999 3.70841,27.36726 -1.98197,4.28973 -4.01785,7.54348 -4.52417,7.23056 -0.50632,-0.31292 0.15576,2.82046 1.47128,6.96307 7.09951,22.35648 10.1162,53.2804 7.45801,76.4515 -5.12822,44.70201 -24.28729,83.12482 -60.04979,120.42768 l -9.51773,9.92768 7,-3.80053 c 3.85,-2.09029 10.15,-5.86963 14,-8.39853 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 664.88159,589.97211 658.95403,600 654.06514,600 653.14931,600 651.86,599.46 651.2,598.8 z m 5.77337,-6.07348 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.70319,2.62215 1.56979,1.54373 3.33138,-1.58058 z M 417,564.2877 c 9.075,-4.36706 20.72191,-10.55732 25.88203,-13.75613 9.72213,-6.02687 21.37308,-16.20376 24.30118,-21.22664 1.58506,-2.71902 1.57866,-3.11824 -0.10974,-6.84616 -4.80139,-10.60125 -19.74635,-26.01604 -44.55798,-45.95877 -8.21135,-6.6 -17.49423,-14.37182 -20.62863,-17.2707 l -5.69889,-5.2707 -0.50726,49.7707 c -0.38989,38.25472 -0.86625,51.96882 -2.05879,59.2707 -2.27657,13.93939 -2.43254,13.28189 2.62808,11.07836 2.3375,-1.01781 11.675,-5.42361 20.75,-9.79066 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 420.88159,503.97211 414.95403,514 410.06514,514 409.14931,514 407.86,513.46 407.2,512.8 z m 5.77337,-6.07348 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.70319,2.62215 1.56979,1.54373 3.33138,-1.58058 z m 235.95634,-60.02618 c 0.0825,-6.80958 -1.85501,-11.21379 -5.31534,-12.08228 -5.56106,-1.39574 -5.64831,-0.12211 -0.74809,10.92021 5.02627,11.32635 5.93814,11.50111 6.06343,1.16207 z M 154.75,449.8277 213,445.56109 213,396.78054 213,348 l -4.98927,0 c -9.74621,0 -20.34412,-5.81284 -24.13089,-13.23554 C 177.34377,321.95272 182.8331,297.9023 194.846,286.7183 199.91994,281.99447 207.35921,278 211.08291,278 212.95608,278 213,276.20175 213,199.5 c 0,-43.175 0.36452,-78.5 0.81004,-78.5 0.44552,0 41.48298,4.51763 91.19436,10.03918 l 90.38433,10.03919 10.55564,-10.34574 c 5.80559,-5.69016 12.68308,-12.23279 15.28329,-14.53918 L 425.95531,112 325.22766,112.0327 c -56.61853,0.0184 -103.57404,0.44022 -107.22766,0.96329 -29.37607,4.20561 -53.38798,14.02963 -73.42841,30.04182 -8.60395,6.87452 -21.90005,20.66389 -26.4798,27.46217 C 108.66133,184.4988 100,201.33974 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.4793 C 95.474222,454.31 122.7125,452.17434 154.75,449.8277 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 110.88159,383.97211 104.95403,394 100.06514,394 99.149314,394 97.86,393.46 97.2,392.8 z m 5.77337,-6.07348 c 0.81035,-1.43722 1.1432,-2.94329 0.73966,-3.34682 -0.83195,-0.83195 -3.3409,2.20477 -4.07104,4.9274 -0.703189,2.62215 1.56979,1.54373 3.33138,-1.58058 z m 32.50804,-142.12009 c -4.31019,-1.87807 -9.26384,-7.92975 -10.0883,-12.32449 -1.6624,-8.86135 3.68984,-22.25375 12.47906,-31.22521 4.62322,-4.71907 6.57753,-5.9717 10.94803,-7.0172 6.52098,-1.55994 12.29013,-0.75055 17.84277,2.50328 9.50747,5.57135 11.23022,15.24129 4.96467,27.86708 -8.21593,16.55603 -24.11432,25.43918 -36.14623,20.19654 z m 15.44735,-3.87117 c 3.09414,-1.57367 9.69311,-13.67893 11.08412,-20.33291 2.75993,-13.20227 -4.70708,-21.76282 -16.9582,-19.44169 -5.13508,0.97291 -8.45583,4.35521 -12.80205,13.03934 -2.28589,4.56741 -2.75263,6.79998 -2.75263,13.16671 0,6.79311 0.28487,7.97352 2.5,10.35936 1.375,1.48095 3.4,3.06491 4.5,3.5199 3.05238,1.26255 11.70164,1.07629 14.42876,-0.31071 z m 19.80433,-27.7283 c 0.47724,-5.2631 0.29367,-5.90689 -2.63557,-9.24311 -1.73169,-1.97229 -4.53262,-4.06848 -6.22428,-4.6582 l -3.07575,-1.07221 3.54475,3.92362 c 4.13283,4.57454 5.12499,8.62275 4.38427,17.88858 l -0.53196,6.65436 2.01278,-3.91796 c 1.10703,-2.15488 2.24362,-6.46366 2.52576,-9.57508 z m 484.77655,229.80225 c 0.6249,-4.1894 0.42614,-4.96434 -1.85952,-7.25 -3.70221,-3.70221 -4.96622,-3.14173 -2.65206,1.17598 1.21945,2.27524 2.01383,5.69531 2.03235,8.75 0.0361,5.94756 1.41493,4.45927 2.47923,-2.67598 z M 213,315 l 0,-29 -2.75,0.0435 c -5.55242,0.0879 -11.4163,1.76406 -13.70995,3.91883 -4.16278,3.91072 -8.64547,13.71286 -10.11149,22.11042 -2.31104,13.23795 0.0202,21.95519 7.18428,26.86409 3.86679,2.64956 11.10778,4.89117 16.13716,4.99562 L 213,344 l 0,-29 z m 393.73111,12.83014 c 3.50377,-5.29456 4.15095,-13.105 1.44262,-17.41018 -2.07564,-3.29944 -6.9527,-6.07487 -12.34389,-7.02465 l -3.32984,-0.58662 3,1.96262 c 10.11037,6.61427 12.43232,16.6703 6.04186,26.16649 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z M 560.25,287.33772 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3564"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b9993e"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 42.8095,-35.05644 c 53.39494,-27.72479 89.89048,-61.15644 109.10301,-99.94356 18.81733,-37.98929 21.92467,-79.17183 9.01661,-119.5 -4.00957,-12.52696 -15.12165,-35.09979 -23.23648,-47.20207 -17.51669,-26.12402 -40.587,-50.16229 -73.32606,-76.40259 -13.01866,-10.43444 -25.77778,-22.38155 -31.64153,-29.62784 -5.06205,-6.25555 -10.63925,-18.2474 -11.37473,-24.45744 -1.46659,-12.38302 8.93749,-27.77889 30.82243,-45.61078 8.72637,-7.11027 30.53114,-21.78292 44.11657,-29.68649 5.93412,-3.45229 10.65912,-6.58173 10.5,-6.95432 C 565.0859,217.41144 499.67681,110.223 498.09756,108.12934 l -1.76312,-2.33743 -9.17243,5.17068 c -10.73385,6.05089 -28.12858,18.31893 -40.16201,28.3252 -11.05036,9.18881 -33.30837,31.04331 -41.98012,41.21908 -15.66936,18.38701 -31.63867,45.57815 -39.34497,66.99313 -4.65211,12.92771 -6.49649,20.42014 -8.22774,33.42357 -5.79453,43.52278 6.8438,84.11692 38.6292,124.07643 9.62436,12.0994 30.75968,32.49039 44.92896,43.34664 9.75455,7.47378 25.36607,21.03832 32.98818,28.66278 11.83541,11.83905 18.84899,21.05529 24.28752,31.91519 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.5769 -0.23263,9.59795 -3.858,16.9334 -7.24921,14.66776 -25.89358,29.98969 -54.8756,45.09668 l -12.73359,6.63744 1.84438,3.678 c 1.0144,2.02291 3.21133,6.60301 4.88205,10.17801 32.06473,68.61182 46.13275,98 46.91227,98 0.36256,0 8.07466,-3.8504 17.13799,-8.55644 z M 229,691.98749 c 26.09918,-2.01931 47.10715,-8.84983 65.4051,-21.26579 8.14472,-5.52656 8.91592,-6.16283 18.44947,-15.2217 26.14774,-24.84581 41.79646,-56.36718 48.2758,-97.24239 2.03183,-12.8179 2.20898,-18.0608 2.59345,-76.75761 l 0.41266,-63 -7.61067,-11.36035 C 322.82818,356.83967 314.61019,295.28003 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.91545,181.55507 364,179.13223 364,175.68066 l 0,-4.20565 -55.25,-6.29955 c -30.3875,-3.46476 -56.70357,-6.54504 -58.48015,-6.84508 l -3.23016,-0.54552 -0.27154,192.35757 -0.27155,192.35757 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -2.49299,1.13235 -6.40714,1.85067 -10.15793,1.86417 -8.3749,0.0301 -11.83548,-2.41165 -16.44855,-11.60612 -6.75965,-13.4729 -9.6231,-31.44581 -10.60371,-66.5561 l -0.66149,-23.68418 -4.59207,0.46752 c -5.26768,0.53631 -80.98002,6.20358 -94.763154,7.09328 -5.044102,0.3256 -9.679521,0.90622 -10.300931,1.29027 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.04179,-5.61312 c 17.72452,-18.39012 39.75476,-18.74432 38.74952,-0.62301 l -0.29131,5.25137 17.70872,-0.001 17.70872,-10e-4 -6.26929,-13.25 c -3.4481,-7.2875 -14.54914,-30.91128 -24.66898,-52.4973 l -18.39969,-39.24729 -3.20017,11.24729 c -9.64053,33.88255 -28.88922,65.07054 -53.63566,86.90398 L 324.98731,691 l 17.79814,0 17.79813,0 4.45821,-4.62563 z M 393,688.0651 c 0,-4.64496 -1.73489,-8.01141 -4.73207,-9.18229 -2.36946,-0.92565 -3.64152,-0.633 -8.83621,2.03284 -3.33755,1.71279 -7.58832,4.68245 -9.44616,6.59925 l -3.37789,3.4851 13.19616,0 13.19617,0 0,-2.9349 z m 6.375,-0.1901 c 0.98144,-4.90718 0.78649,-5.80442 -1.82955,-8.42045 -3.60778,-3.60779 -4.83639,-2.99013 -2.54739,1.28064 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.15345 1.55398,4.24493 2.375,0.13981 z M 611.5,665.1563 c 7.88058,-5.17641 28.6737,-25.33491 33.09725,-32.08711 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42606,-5.74419 4.12942,-6.56919 0.70336,-0.825 2.02432,-2.97153 2.93547,-4.77006 C 660.00305,607.12228 668,582.88765 668,580.15366 c 0,-1.34975 0.68852,-5.874 1.53004,-10.05388 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26422,-153.31913 -0.38415,-163.00848 -2.12275,-171.5 -2.59309,-12.66498 -9.1308,-33.0713 -12.70933,-39.66999 -8.46258,-15.60472 -16.51129,-26.2839 -28.17579,-37.38419 C 616.16896,140.40386 607.66745,134.22695 592.84182,126.06658 585.68374,122.12662 563.64337,115.32955 554,114.0881 c -5.225,-0.67265 -10.2875,-1.37552 -11.25,-1.56193 -0.9625,-0.18641 -1.75,-0.20784 -1.75,-0.0476 0,0.16023 16.20266,26.98044 36.00591,59.60048 19.80324,32.62004 35.66574,59.62628 35.25,60.01388 -0.41575,0.38759 -9.08091,5.3175 -19.25591,10.95534 -40.37375,22.37062 -67.45108,41.33716 -75.40956,52.82125 l -2.80489,4.04745 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05314,0.85412 1.40886,0.91089 0.95346,0.15216 -1.23889,-2.06409 4.87941,-12.58289 10.22995,-17.58769 6.90542,-6.45921 12.83135,-8.92894 21.61255,-9.00739 11.76977,-0.10514 20.82517,5.32688 25.29207,15.17183 0.90674,1.99843 1.70537,3.75192 1.77473,3.89664 0.0694,0.14472 1.75576,-0.41778 3.74754,-1.25 4.98416,-2.08252 14.26068,-1.89746 19.18566,0.38273 8.04837,3.72628 13.16909,12.06626 11.96131,19.48107 -2.87067,17.6235 -23.95231,30.08825 -39.25499,23.20992 l -4.25631,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 5.42953,-7.49524 3.09544,-17.44358 -5.11646,-21.80739 -4.20572,-2.23492 -10.3158,-2.40856 -12.37274,-0.35161 -2.13158,2.13158 -2.32667,2.00324 -4.53145,-2.98105 -1.41888,-3.20761 -3.3406,-5.34253 -6.76228,-7.51249 -5.80773,-3.68316 -9.68576,-4.84069 -18.93225,-5.651 -12.223,-1.07115 -16.76786,1.82256 -22.6974,14.45142 l -2.96123,6.30689 2.37087,2.54466 c 1.30399,1.39956 6.64588,5.96516 11.87088,10.14578 37.35402,29.88763 64.3618,57.26248 83.14429,84.27434 4.04564,5.8182 8.93071,13.35413 10.85571,16.74651 2.45696,4.32983 3.94635,6.00101 4.99777,5.60776 5.07522,-1.89826 11.10862,-2.48126 14.95622,-1.44521 9.06508,2.44097 10.46201,12.74999 3.70841,27.36726 -1.98197,4.28973 -4.01785,7.54348 -4.52417,7.23056 -0.50632,-0.31292 0.15576,2.82046 1.47128,6.96307 7.09951,22.35648 10.1162,53.2804 7.45801,76.4515 -5.12822,44.70201 -24.28729,83.12482 -60.04979,120.42768 l -9.51773,9.92768 7,-3.80053 c 3.85,-2.09029 10.15,-5.86963 14,-8.39853 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 664.88159,589.97211 658.95403,600 654.06514,600 653.14931,600 651.86,599.46 651.2,598.8 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 417,564.2877 c 9.075,-4.36706 20.72191,-10.55732 25.88203,-13.75613 9.72213,-6.02687 21.37308,-16.20376 24.30118,-21.22664 1.58506,-2.71902 1.57866,-3.11824 -0.10974,-6.84616 -4.80139,-10.60125 -19.74635,-26.01604 -44.55798,-45.95877 -8.21135,-6.6 -17.49423,-14.37182 -20.62863,-17.2707 l -5.69889,-5.2707 -0.50726,49.7707 c -0.38989,38.25472 -0.86625,51.96882 -2.05879,59.2707 -2.27657,13.93939 -2.43254,13.28189 2.62808,11.07836 2.3375,-1.01781 11.675,-5.42361 20.75,-9.79066 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 420.88159,503.97211 414.95403,514 410.06514,514 409.14931,514 407.86,513.46 407.2,512.8 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z m 236.37674,-60.9349 c 0.008,-3.4017 -0.42662,-7.34727 -0.96676,-8.76793 -1.07263,-2.82124 -5.25677,-4.92353 -8.04064,-4.03996 -1.56845,0.49781 -1.25929,1.6832 2.85999,10.96571 2.79832,6.30581 4.9168,9.93848 5.37532,9.21733 0.41623,-0.65464 0.76367,-3.97346 0.77209,-7.37515 z M 154.75,449.8277 213,445.56109 213,396.78054 213,348 l -4.98927,0 c -9.74621,0 -20.34412,-5.81284 -24.13089,-13.23554 C 177.34377,321.95272 182.8331,297.9023 194.846,286.7183 199.91994,281.99447 207.35921,278 211.08291,278 212.95608,278 213,276.20175 213,199.5 c 0,-43.175 0.36452,-78.5 0.81004,-78.5 0.44552,0 41.48298,4.51763 91.19436,10.03918 l 90.38433,10.03919 10.55564,-10.34574 c 5.80559,-5.69016 12.68308,-12.23279 15.28329,-14.53918 L 425.95531,112 325.22766,112.0327 c -56.61853,0.0184 -103.57404,0.44022 -107.22766,0.96329 -29.37607,4.20561 -53.38798,14.02963 -73.42841,30.04182 -8.60395,6.87452 -21.90005,20.66389 -26.4798,27.46217 C 108.66133,184.4988 100,201.33974 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.4793 C 95.474222,454.31 122.7125,452.17434 154.75,449.8277 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 110.88159,383.97211 104.95403,394 100.06514,394 99.149314,394 97.86,393.46 97.2,392.8 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.930842,6.25 -0.72394,1.52442 2.086642,0.69037 3.369812,-1 z m 32.87346,-143.64357 c -4.31019,-1.87807 -9.26384,-7.92975 -10.0883,-12.32449 -1.6624,-8.86135 3.68984,-22.25375 12.47906,-31.22521 4.62322,-4.71907 6.57753,-5.9717 10.94803,-7.0172 6.52098,-1.55994 12.29013,-0.75055 17.84277,2.50328 9.50747,5.57135 11.23022,15.24129 4.96467,27.86708 -8.21593,16.55603 -24.11432,25.43918 -36.14623,20.19654 z m 15.85724,-3.71487 c 2.57189,-1.17183 9.90447,-15.39321 11.16964,-21.66329 2.40325,-11.91028 -6.24022,-20.85559 -17.69046,-18.30823 -7.97223,1.7736 -14.96525,13.23904 -15.63536,25.63504 -0.35276,6.52551 -0.17362,7.30198 2.38651,10.34453 1.52234,1.8092 3.7046,3.66839 4.84946,4.13154 3.04,1.22981 12.10076,1.14504 14.92021,-0.13959 z m 19.39444,-27.8846 c 0.47724,-5.2631 0.29367,-5.90689 -2.63557,-9.24311 -1.73169,-1.97229 -4.53262,-4.06848 -6.22428,-4.6582 l -3.07575,-1.07221 3.54475,3.92362 c 4.13283,4.57454 5.12499,8.62275 4.38427,17.88858 l -0.53196,6.65436 2.01278,-3.91796 c 1.10703,-2.15488 2.24362,-6.46366 2.52576,-9.57508 z m 484.77655,229.80225 c 0.6249,-4.1894 0.42614,-4.96434 -1.85952,-7.25 -3.70221,-3.70221 -4.96622,-3.14173 -2.65206,1.17598 1.21945,2.27524 2.01383,5.69531 2.03235,8.75 0.0361,5.94756 1.41493,4.45927 2.47923,-2.67598 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.48813,7.3994 -6.50115,14.91876 -6.53711,24.4185 -0.0365,9.64895 2.29928,15.08571 7.9932,18.60474 4.23097,2.61489 11.26889,4.72784 16.08052,4.82777 L 213,344 l 0,-29.12019 z m 393.73111,12.95033 c 3.50377,-5.29456 4.15095,-13.105 1.44262,-17.41018 -2.07564,-3.29944 -6.9527,-6.07487 -12.34389,-7.02465 l -3.32984,-0.58662 3,1.96262 c 10.11037,6.61427 12.43232,16.6703 6.04186,26.16649 l -3.45814,5.13878 3.01653,-2.14796 c 1.65909,-1.18138 4.19297,-3.92569 5.63086,-6.09848 z M 560.25,287.33772 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3562"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b7983f"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 42.8095,-35.05644 C 555.20444,670.71877 591.69998,637.28712 610.91251,598.5 629.72984,560.51071 632.83718,519.32817 619.92912,479 615.91733,466.46612 604.80613,443.89822 596.68031,431.77949 578.9984,405.40892 555.95973,381.51621 521.5,353.81227 500.3281,336.7911 490.19446,325.82848 484.44917,313.73054 c -6.41471,-13.50756 -5.60841,-21.50896 3.46652,-34.40011 10.71466,-15.22043 35.21234,-34.60722 67.37363,-53.31764 5.93412,-3.45229 10.65912,-6.58173 10.5,-6.95432 C 565.0859,217.41144 499.67681,110.223 498.09756,108.12934 l -1.76312,-2.33743 -9.17243,5.17068 c -10.73385,6.05089 -28.12858,18.31893 -40.16201,28.3252 -11.05036,9.18881 -33.30837,31.04331 -41.98012,41.21908 -15.66936,18.38701 -31.63867,45.57815 -39.34497,66.99313 -4.65211,12.92771 -6.49649,20.42014 -8.22774,33.42357 -5.76377,43.2917 6.51464,83.07184 38.14268,123.57643 8.97259,11.49079 31.22314,32.97272 45.41548,43.84664 9.75455,7.47378 25.36607,21.03832 32.98818,28.66278 11.83541,11.83905 18.84899,21.05529 24.28752,31.91519 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.5769 -0.23263,9.59795 -3.858,16.9334 -7.24921,14.66776 -25.89358,29.98969 -54.8756,45.09668 l -12.73359,6.63744 1.84438,3.678 c 1.0144,2.02291 3.21133,6.60301 4.88205,10.17801 32.06473,68.61182 46.13275,98 46.91227,98 0.36256,0 8.07466,-3.8504 17.13799,-8.55644 z M 229,691.98749 c 29.42242,-2.27643 51.76783,-10.45332 73.4051,-26.86126 1.15219,-0.87374 7.2879,-6.77207 13.63491,-13.10742 25.68264,-25.63546 39.62446,-55.77033 46.04214,-99.51881 0.75789,-5.16648 1.32954,-30.314 1.61395,-71 l 0.44038,-63 -7.61067,-11.36035 C 322.82818,356.83967 314.61019,295.28003 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.91545,181.55507 364,179.13223 364,175.68066 l 0,-4.20565 -55.25,-6.29955 c -30.3875,-3.46476 -56.70357,-6.54504 -58.48015,-6.84508 l -3.23016,-0.54552 -0.27154,192.35757 -0.27155,192.35757 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -2.49299,1.13235 -6.40714,1.85067 -10.15793,1.86417 -8.3749,0.0301 -11.83548,-2.41165 -16.44855,-11.60612 -6.75965,-13.4729 -9.6231,-31.44581 -10.60371,-66.5561 l -0.66149,-23.68418 -4.59207,0.46752 c -5.26768,0.53631 -80.98002,6.20358 -94.763154,7.09328 -5.044102,0.3256 -9.679521,0.90622 -10.300931,1.29027 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 10.94754,16.22354 29.01313,32.19023 46.19662,40.82937 18.01774,9.05856 29.18524,11.74737 58.52356,14.09076 0.825,0.0659 7.125,-0.3154 14,-0.84732 z m 136.04179,-5.61312 c 17.72452,-18.39012 39.75476,-18.74432 38.74952,-0.62301 l -0.29131,5.25137 17.70872,-0.001 17.70872,-10e-4 -6.26929,-13.25 c -3.4481,-7.2875 -14.54914,-30.91128 -24.66898,-52.4973 l -18.39969,-39.24729 -3.20017,11.24729 c -9.64053,33.88255 -28.88922,65.07054 -53.63566,86.90398 L 324.98731,691 l 17.79814,0 17.79813,0 4.45821,-4.62563 z M 393,688.0651 c 0,-4.64496 -1.73489,-8.01141 -4.73207,-9.18229 -2.36946,-0.92565 -3.64152,-0.633 -8.83621,2.03284 -3.33755,1.71279 -7.58832,4.68245 -9.44616,6.59925 l -3.37789,3.4851 13.19616,0 13.19617,0 0,-2.9349 z m 6.375,-0.1901 c 0.98144,-4.90718 0.78649,-5.80442 -1.82955,-8.42045 -3.60778,-3.60779 -4.83639,-2.99013 -2.54739,1.28064 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.15345 1.55398,4.24493 2.375,0.13981 z M 611.5,665.1563 c 7.88058,-5.17641 28.6737,-25.33491 33.09725,-32.08711 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42606,-5.74419 4.12942,-6.56919 0.70336,-0.825 2.02432,-2.97153 2.93547,-4.77006 C 660.00305,607.12228 668,582.88765 668,580.15366 c 0,-1.34975 0.68852,-5.874 1.53004,-10.05388 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26422,-153.31913 -0.38415,-163.00848 -2.12275,-171.5 -2.59309,-12.66498 -9.1308,-33.0713 -12.70933,-39.66999 -8.46258,-15.60472 -16.51129,-26.2839 -28.17579,-37.38419 C 616.16896,140.40386 607.66745,134.22695 592.84182,126.06658 585.68374,122.12662 563.64337,115.32955 554,114.0881 c -5.225,-0.67265 -10.2875,-1.37552 -11.25,-1.56193 -0.9625,-0.18641 -1.75,-0.20784 -1.75,-0.0476 0,0.16023 16.20266,26.98044 36.00591,59.60048 19.80324,32.62004 35.66574,59.62628 35.25,60.01388 -0.41575,0.38759 -9.08091,5.3175 -19.25591,10.95534 -40.37375,22.37062 -67.45108,41.33716 -75.40956,52.82125 l -2.80489,4.04745 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05314,0.85412 1.40886,0.91089 0.95346,0.15216 -1.23889,-2.06409 4.87941,-12.58289 10.22995,-17.58769 6.90542,-6.45921 12.83135,-8.92894 21.61255,-9.00739 11.76977,-0.10514 20.82517,5.32688 25.29207,15.17183 0.90674,1.99843 1.70537,3.75192 1.77473,3.89664 0.0694,0.14472 1.75576,-0.41778 3.74754,-1.25 4.98416,-2.08252 14.26068,-1.89746 19.18566,0.38273 8.04837,3.72628 13.16909,12.06626 11.96131,19.48107 -2.87067,17.6235 -23.95231,30.08825 -39.25499,23.20992 l -4.25631,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 5.42953,-7.49524 3.09544,-17.44358 -5.11646,-21.80739 -4.20572,-2.23492 -10.3158,-2.40856 -12.37274,-0.35161 -2.13158,2.13158 -2.32667,2.00324 -4.53145,-2.98105 -1.41888,-3.20761 -3.3406,-5.34253 -6.76228,-7.51249 -5.80773,-3.68316 -9.68576,-4.84069 -18.93225,-5.651 -12.223,-1.07115 -16.76786,1.82256 -22.6974,14.45142 l -2.96123,6.30689 2.37087,2.54466 c 1.30399,1.39956 6.64588,5.96516 11.87088,10.14578 37.35402,29.88763 64.3618,57.26248 83.14429,84.27434 4.04564,5.8182 8.93071,13.35413 10.85571,16.74651 2.45696,4.32983 3.94635,6.00101 4.99777,5.60776 5.07522,-1.89826 11.10862,-2.48126 14.95622,-1.44521 9.06508,2.44097 10.46201,12.74999 3.70841,27.36726 -1.98197,4.28973 -4.01785,7.54348 -4.52417,7.23056 -0.50632,-0.31292 0.15576,2.82046 1.47128,6.96307 7.09951,22.35648 10.1162,53.2804 7.45801,76.4515 -5.12822,44.70201 -24.28729,83.12482 -60.04979,120.42768 l -9.51773,9.92768 7,-3.80053 c 3.85,-2.09029 10.15,-5.86963 14,-8.39853 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 664.88159,589.97211 658.95403,600 654.06514,600 653.14931,600 651.86,599.46 651.2,598.8 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 417,564.2877 c 9.075,-4.36706 20.72191,-10.55732 25.88203,-13.75613 9.72213,-6.02687 21.37308,-16.20376 24.30118,-21.22664 1.58506,-2.71902 1.57866,-3.11824 -0.10974,-6.84616 -4.80139,-10.60125 -19.74635,-26.01604 -44.55798,-45.95877 -8.21135,-6.6 -17.49423,-14.37182 -20.62863,-17.2707 l -5.69889,-5.2707 -0.50726,49.7707 c -0.38989,38.25472 -0.86625,51.96882 -2.05879,59.2707 -2.27657,13.93939 -2.43254,13.28189 2.62808,11.07836 2.3375,-1.01781 11.675,-5.42361 20.75,-9.79066 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 420.88159,503.97211 414.95403,514 410.06514,514 409.14931,514 407.86,513.46 407.2,512.8 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 648.8358,445.41945 c -0.43634,-8.6407 -1.77985,-10.56835 -7.59452,-10.89643 l -3.93217,-0.22187 2.20527,4.09943 c 1.21289,2.25468 3.49106,7.13137 5.06259,10.83709 3.50029,8.25379 4.80918,7.08032 4.25883,-3.81822 z M 154.75,449.83902 213,445.57127 213,396.78563 213,348 l -4.98927,0 c -9.74621,0 -20.34412,-5.81284 -24.13089,-13.23554 C 177.34377,321.95272 182.8331,297.9023 194.846,286.7183 199.91994,281.99447 207.35921,278 211.08291,278 212.95608,278 213,276.20175 213,199.5 c 0,-43.175 0.3817,-78.5 0.84823,-78.5 0.46653,0 41.48512,4.51994 91.15242,10.0443 l 90.30419,10.0443 11.09758,-10.84437 c 6.10367,-5.96441 13.09108,-12.50934 15.52758,-14.5443 L 426.36,112 325.43,112.0327 c -56.74339,0.0184 -103.77567,0.44012 -107.43,0.96329 -29.37607,4.20561 -53.38798,14.02963 -73.42841,30.04182 -8.60395,6.87452 -21.90005,20.66389 -26.4798,27.46217 C 108.66133,184.4988 100,201.33974 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.47307 C 95.474222,454.31966 122.7125,452.18629 154.75,449.83902 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 110.88159,383.97211 104.95403,394 100.06514,394 99.149314,394 97.86,393.46 97.2,392.8 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.930842,6.25 -0.72394,1.52442 2.086642,0.69037 3.369812,-1 z m 32.87346,-143.64357 c -4.31019,-1.87807 -9.26384,-7.92975 -10.0883,-12.32449 -1.6624,-8.86135 3.68984,-22.25375 12.47906,-31.22521 4.62322,-4.71907 6.57753,-5.9717 10.94803,-7.0172 6.52098,-1.55994 12.29013,-0.75055 17.84277,2.50328 9.50747,5.57135 11.23022,15.24129 4.96467,27.86708 -8.21593,16.55603 -24.11432,25.43918 -36.14623,20.19654 z m 15.85724,-3.71487 c 2.57189,-1.17183 9.90447,-15.39321 11.16964,-21.66329 2.40325,-11.91028 -6.24022,-20.85559 -17.69046,-18.30823 -7.97223,1.7736 -14.96525,13.23904 -15.63536,25.63504 -0.35276,6.52551 -0.17362,7.30198 2.38651,10.34453 1.52234,1.8092 3.7046,3.66839 4.84946,4.13154 3.04,1.22981 12.10076,1.14504 14.92021,-0.13959 z m 16.75196,-18.06917 c 1.17219,-2.29768 2.35993,-6.69946 2.63942,-9.78173 0.45657,-5.03514 0.23015,-5.93453 -2.23005,-8.85831 C 165.81577,200.99234 161.20455,198 158.97293,198 c -0.61951,0 0.31933,1.21649 2.08632,2.70331 1.76698,1.48682 3.82651,4.17236 4.57672,5.96788 1.58266,3.78783 1.8069,14.03377 0.38878,17.76371 -1.51029,3.97236 -0.3023,3.02946 2.06586,-1.61251 z m 487.41903,219.98682 c 0.6249,-4.1894 0.42614,-4.96434 -1.85952,-7.25 -3.70221,-3.70221 -4.96622,-3.14173 -2.65206,1.17598 1.21945,2.27524 2.01383,5.69531 2.03235,8.75 0.0361,5.94756 1.41493,4.45927 2.47923,-2.67598 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.48813,7.3994 -6.50115,14.91876 -6.53711,24.4185 -0.0365,9.64895 2.29928,15.08571 7.9932,18.60474 4.23097,2.61489 11.26889,4.72784 16.08052,4.82777 L 213,344 l 0,-29.12019 z m 391.54368,15.89273 c 5.63928,-6.68797 7.03081,-14.67823 3.5503,-20.38603 -2.05099,-3.36348 -9.2261,-7.38881 -13.1597,-7.38277 -2.36134,0.004 -2.34312,0.0593 0.60834,1.85918 10.07799,6.14576 12.2872,17.27625 5.34715,26.9401 -2.5226,3.51267 -2.7564,4.19597 -1.1396,3.33068 1.11876,-0.59874 3.27584,-2.56126 4.79351,-4.36116 z M 563.5,288.46389 c -1.65,-0.75553 -4.125,-1.35776 -5.5,-1.33831 -1.69485,0.024 -1.05073,0.45048 2,1.32429 5.93416,1.6997 7.19239,1.70473 3.5,0.014 z m -9.77083,-2.06806 c -0.33229,-0.33229 -1.1948,-0.36781 -1.91667,-0.0789 -0.79773,0.31922 -0.56078,0.55618 0.60417,0.60416 1.05416,0.0434 1.64479,-0.19293 1.3125,-0.52522 z"
+       id="path3560"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ab954a"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 42.59539,-34.94527 C 555.28581,670.67652 591.6962,637.3476 610.9008,598.5 c 9.96549,-20.15846 14.17446,-35.24793 16.24535,-58.24085 2.58538,-28.70514 -2.83852,-55.58505 -17.10291,-84.75915 -17.1538,-35.08365 -43.49378,-65.49156 -86.79897,-100.20414 -12.71469,-10.19185 -25.53167,-22.20893 -31.49402,-29.52852 -4.69889,-5.76852 -10.46325,-17.67069 -11.31771,-23.36865 -1.92091,-12.80949 8.96165,-29.24406 31.06746,-46.91733 9.47843,-7.57786 30.63901,-21.81814 43.78932,-29.46857 5.93412,-3.45229 10.65912,-6.58173 10.5,-6.95432 -0.70499,-1.6507 -66.11436,-108.83792 -67.69732,-110.9365 l -1.76868,-2.34479 -8.41166,4.74384 c -19.66055,11.08778 -41.21255,27.81271 -61.76335,47.93002 -17.79594,17.42056 -25.56125,26.51665 -36.54115,42.80338 -13.35756,19.81357 -24.29238,43.32916 -29.14134,62.66915 -2.33932,9.33033 -4.42506,26.2849 -4.43809,36.07643 -0.0487,36.56458 12.60707,69.99141 39.56483,104.5 9.23505,11.82178 29.89662,31.76294 45.41277,43.82936 10.88063,8.46152 25.36321,21.05273 32.98818,28.68006 11.83541,11.83905 18.84899,21.05529 24.28752,31.91519 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.5769 -0.23263,9.59795 -3.858,16.9334 -7.25014,14.66966 -25.89327,29.98951 -54.8858,45.10201 -10.66143,5.55731 -12.60164,6.91608 -11.87376,8.31544 1.01263,1.9468 3.50616,7.22399 24.41591,51.67268 23.2893,49.50699 27.65101,58.5 28.37316,58.5 0.36256,0 7.97831,-3.80037 16.92388,-8.44527 z m -258.26468,-8.12909 c 16.83233,-2.39215 37.0641,-10.19735 51.07439,-19.70394 8.91033,-6.04606 9.23831,-6.3295 21.64092,-18.70289 25.70786,-25.64726 39.60733,-55.69451 46.03613,-99.51881 0.75789,-5.16648 1.32954,-30.314 1.61395,-71 l 0.44038,-63 -7.61067,-11.36035 C 322.82818,356.83967 314.61019,295.28003 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.93019,181.53239 364,179.13795 364,175.65504 l 0,-4.23128 -55.25,-6.3296 c -30.3875,-3.48128 -56.70357,-6.55906 -58.48015,-6.8395 l -3.23015,-0.5099 -0.27155,192.37762 -0.27155,192.37762 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -2.49299,1.13235 -6.40714,1.85067 -10.15793,1.86417 -8.3749,0.0301 -11.83548,-2.41165 -16.44855,-11.60612 -6.75965,-13.4729 -9.6231,-31.44581 -10.60371,-66.5561 l -0.66149,-23.68418 -4.59207,0.46752 c -5.26768,0.53631 -80.98002,6.20358 -94.763154,7.09328 -5.044102,0.3256 -9.679521,0.90622 -10.300931,1.29027 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 30.18263,31.59437 69.85778,43.69669 119.92487,36.58132 z m 121.71108,-4.05127 c 17.72452,-18.39012 39.75476,-18.74432 38.74952,-0.62301 l -0.29131,5.25137 17.70872,-0.001 17.70872,-10e-4 -6.26104,-13.25 c -3.44357,-7.2875 -14.54147,-30.90114 -24.662,-52.47475 l -18.40095,-39.22475 -3.60232,12.22475 c -10.15357,34.45689 -28.97793,64.74879 -53.55992,86.18791 L 324.9361,691 l 17.82374,0 17.82374,0 4.45821,-4.62563 z M 393,688.0651 c 0,-4.64496 -1.73489,-8.01141 -4.73207,-9.18229 -2.36946,-0.92565 -3.64152,-0.633 -8.83621,2.03284 -3.33755,1.71279 -7.58832,4.68245 -9.44616,6.59925 l -3.37789,3.4851 13.19616,0 13.19617,0 0,-2.9349 z m 6.375,-0.1901 c 0.98144,-4.90718 0.78649,-5.80442 -1.82955,-8.42045 -3.60778,-3.60779 -4.83639,-2.99013 -2.54739,1.28064 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.15345 1.55398,4.24493 2.375,0.13981 z M 611.5,665.1563 c 7.88058,-5.17641 28.6737,-25.33491 33.09725,-32.08711 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42606,-5.74419 4.12942,-6.56919 0.70336,-0.825 2.02432,-2.97153 2.93547,-4.77006 C 660.00305,607.12228 668,582.88765 668,580.15366 c 0,-1.34975 0.68852,-5.874 1.53004,-10.05388 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26422,-153.31913 -0.38415,-163.00848 -2.12275,-171.5 -2.59309,-12.66498 -9.1308,-33.0713 -12.70933,-39.66999 C 647.3985,173.06509 639.50715,162.571 627.94595,151.59231 616.14582,140.38672 607.69697,134.2432 592.84182,126.06658 585.68374,122.12662 563.64337,115.32955 554,114.0881 c -5.225,-0.67265 -10.2875,-1.37552 -11.25,-1.56193 -0.9625,-0.18641 -1.75,-0.21029 -1.75,-0.0531 0,0.15722 16.19937,26.98072 35.99861,59.60777 19.79923,32.62705 35.66173,59.62928 35.25,60.00495 -0.41174,0.37567 -9.07361,5.30148 -19.24861,10.94625 -40.45033,22.44057 -67.45908,41.36486 -75.40956,52.83742 l -2.80489,4.04745 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05314,0.85412 1.40886,0.91089 0.95346,0.15216 -1.23889,-2.06409 4.87941,-12.58289 10.22995,-17.58769 6.90542,-6.45921 12.83135,-8.92894 21.61255,-9.00739 11.76977,-0.10514 20.82517,5.32688 25.29207,15.17183 0.90674,1.99843 1.70537,3.75192 1.77473,3.89664 0.0694,0.14472 1.75576,-0.41778 3.74754,-1.25 4.98416,-2.08252 14.26068,-1.89746 19.18566,0.38273 8.04837,3.72628 13.16909,12.06626 11.96131,19.48107 -2.87067,17.6235 -23.95231,30.08825 -39.25499,23.20992 l -4.25631,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 5.42953,-7.49524 3.09544,-17.44358 -5.11646,-21.80739 -4.20572,-2.23492 -10.3158,-2.40856 -12.37274,-0.35161 -2.13158,2.13158 -2.32667,2.00324 -4.53145,-2.98105 -1.41888,-3.20761 -3.3406,-5.34253 -6.76228,-7.51249 -5.80773,-3.68316 -9.68576,-4.84069 -18.93225,-5.651 -12.223,-1.07115 -16.76786,1.82256 -22.6974,14.45142 l -2.96123,6.30689 2.37087,2.54466 c 1.30399,1.39956 6.64588,5.96516 11.87088,10.14578 37.35402,29.88763 64.3618,57.26248 83.14429,84.27434 4.04564,5.8182 8.93071,13.35413 10.85571,16.74651 2.45696,4.32983 3.94635,6.00101 4.99777,5.60776 5.07522,-1.89826 11.10862,-2.48126 14.95622,-1.44521 9.06508,2.44097 10.46201,12.74999 3.70841,27.36726 -1.98197,4.28973 -4.01785,7.54348 -4.52417,7.23056 -0.50632,-0.31292 0.15576,2.82046 1.47128,6.96307 9.26654,29.18052 10.89754,65.41834 4.31859,95.9515 -7.70169,35.7438 -26.67225,69.38715 -56.91037,100.92768 l -9.51773,9.92768 7,-3.80053 c 3.85,-2.09029 10.15,-5.86963 14,-8.39853 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 664.88159,589.97211 658.95403,600 654.06514,600 653.14931,600 651.86,599.46 651.2,598.8 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 414.29368,565.58361 c 10.56348,-5.08964 23.42823,-11.86709 28.58835,-15.06098 9.71624,-6.01396 21.36939,-16.18848 24.30118,-21.2177 1.58506,-2.71902 1.57866,-3.11824 -0.10974,-6.84616 -4.78782,-10.57129 -20.14098,-26.42073 -44.53059,-45.97002 -8.22641,-6.59381 -17.56391,-14.39972 -20.75,-17.34646 L 396,453.78457 l -0.003,42.35772 c -0.003,40.89704 -0.76706,57.25538 -3.39046,72.61695 -1.1813,6.91723 -1.15205,7.23142 0.62077,6.66875 1.02326,-0.32477 10.50331,-4.75474 21.06679,-9.84438 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 420.88159,503.97211 414.95403,514 410.06514,514 409.14931,514 407.86,513.46 407.2,512.8 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 648.8358,445.41945 c -0.43634,-8.6407 -1.77985,-10.56835 -7.59452,-10.89643 l -3.93217,-0.22187 2.20527,4.09943 c 1.21289,2.25468 3.49106,7.13137 5.06259,10.83709 3.50029,8.25379 4.80918,7.08032 4.25883,-3.81822 z M 154.75,449.83902 213,445.57127 213,396.78563 213,348 l -4.98927,0 c -9.74621,0 -20.34412,-5.81284 -24.13089,-13.23554 C 177.34377,321.95272 182.8331,297.9023 194.846,286.7183 199.91994,281.99447 207.35921,278 211.08291,278 212.95608,278 213,276.20175 213,199.5 c 0,-43.175 0.3366,-78.5 0.748,-78.5 0.4114,0 41.43218,4.51778 91.15728,10.0395 l 90.40928,10.03951 11.09272,-10.83958 c 6.101,-5.96176 13.08622,-12.50454 15.52272,-14.5395 L 426.36,112 325.43,112.0327 c -56.74339,0.0184 -103.77567,0.44012 -107.43,0.96329 -29.37607,4.20561 -53.38798,14.02963 -73.42841,30.04182 -8.60395,6.87452 -21.90005,20.66389 -26.4798,27.46217 C 108.66133,184.4988 100,201.33974 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.47307 C 95.474222,454.31966 122.7125,452.18629 154.75,449.83902 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.40063,-4.18622 6.03655,-4.66023 7.98423,-2.31343 C 110.88159,383.97211 104.95403,394 100.06514,394 99.149314,394 97.86,393.46 97.2,392.8 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.930842,6.25 -0.72394,1.52442 2.086642,0.69037 3.369812,-1 z m 32.87346,-143.64357 c -4.31019,-1.87807 -9.26384,-7.92975 -10.0883,-12.32449 -1.6624,-8.86135 3.68984,-22.25375 12.47906,-31.22521 4.62322,-4.71907 6.57753,-5.9717 10.94803,-7.0172 6.52098,-1.55994 12.29013,-0.75055 17.84277,2.50328 9.50747,5.57135 11.23022,15.24129 4.96467,27.86708 -8.21593,16.55603 -24.11432,25.43918 -36.14623,20.19654 z m 15.85724,-3.71487 c 2.57189,-1.17183 9.90447,-15.39321 11.16964,-21.66329 2.40325,-11.91028 -6.24022,-20.85559 -17.69046,-18.30823 -7.97223,1.7736 -14.96525,13.23904 -15.63536,25.63504 -0.35276,6.52551 -0.17362,7.30198 2.38651,10.34453 1.52234,1.8092 3.7046,3.66839 4.84946,4.13154 3.04,1.22981 12.10076,1.14504 14.92021,-0.13959 z m 16.75196,-18.06917 c 1.17219,-2.29768 2.35993,-6.69946 2.63942,-9.78173 0.45657,-5.03514 0.23015,-5.93453 -2.23005,-8.85831 C 165.81577,200.99234 161.20455,198 158.97293,198 c -0.61951,0 0.31933,1.21649 2.08632,2.70331 1.76698,1.48682 3.82651,4.17236 4.57672,5.96788 1.58266,3.78783 1.8069,14.03377 0.38878,17.76371 -1.51029,3.97236 -0.3023,3.02946 2.06586,-1.61251 z m 487.41903,219.98682 c 0.6249,-4.1894 0.42614,-4.96434 -1.85952,-7.25 -3.70221,-3.70221 -4.96622,-3.14173 -2.65206,1.17598 1.21945,2.27524 2.01383,5.69531 2.03235,8.75 0.0361,5.94756 1.41493,4.45927 2.47923,-2.67598 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.48813,7.3994 -6.50115,14.91876 -6.53711,24.4185 -0.0365,9.64895 2.29928,15.08571 7.9932,18.60474 4.23097,2.61489 11.26889,4.72784 16.08052,4.82777 L 213,344 l 0,-29.12019 z m 391.54368,15.89273 c 5.63928,-6.68797 7.03081,-14.67823 3.5503,-20.38603 -2.05099,-3.36348 -9.2261,-7.38881 -13.1597,-7.38277 -2.36134,0.004 -2.34312,0.0593 0.60834,1.85918 10.06523,6.13798 12.22538,16.80013 5.41047,26.70526 -2.53238,3.68069 -2.77227,4.40541 -1.17531,3.55075 1.10357,-0.59062 3.24823,-2.54649 4.7659,-4.34639 z M 563.5,288.46389 c -1.65,-0.75553 -4.125,-1.35776 -5.5,-1.33831 -1.69485,0.024 -1.05073,0.45048 2,1.32429 5.93416,1.6997 7.19239,1.70473 3.5,0.014 z m -9.25,-2.12617 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3558"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#838383"
+       d="m 459,733.5 -8.33012,-17.5 -84.70921,0 c -73.69779,0 -85.27628,0.20007 -89.07155,1.53912 C 241.51542,730.01969 193.20817,729.92541 159,717.30903 137.13489,709.24492 120.57616,698.51495 102.96712,681 81.108323,659.25799 67.836257,637.50926 57.645971,606.73292 47.424536,575.8625 44,547.03316 44,491.85478 L 44,458 l 3.849122,0 c 2.117018,0 7.292018,-0.29103 11.5,-0.64674 L 67,456.70653 67.017766,349.10326 C 67.028192,285.9575 67.437637,237.98813 68.00877,233 c 2.025893,-17.6936 5.156285,-30.58037 10.445354,-43 1.288239,-3.025 3.163458,-7.48357 4.167154,-9.90793 1.003696,-2.42436 2.979882,-6.02436 4.391525,-8 1.411642,-1.97564 3.837027,-5.78384 5.389745,-8.46268 5.039602,-8.6946 14.165892,-19.9314 23.733612,-29.22217 15.82617,-15.36805 31.7716,-26.02333 50.36384,-33.65483 15.37465,-6.310798 15.3971,-6.318003 31,-9.951617 l 14,-3.260329 L 337,87.020222 462.5,86.5 469,82.417026 c 5.28451,-3.319465 28.16405,-16.228461 37.68741,-21.263833 2.06742,-1.093124 2.6281,-0.42419 10.22071,12.19411 l 8.03329,13.350681 13.2793,0.609038 c 17.65648,0.809793 32.59566,3.522853 47.77929,8.677057 16.59408,5.632991 16.37037,5.516801 39,20.254881 10.22565,6.65969 30.21451,25.54165 37.31089,35.24477 9.01574,12.32751 20.68911,32.62031 20.68911,35.9656 0,0.8285 1.09169,3.87883 2.42597,6.77852 3.98554,8.66142 6.87814,20.66124 9.58719,39.77215 0.53132,3.74815 0.92389,75.50796 0.92727,169.5 l 0.006,163 -2.36463,13.58279 c -5.63253,32.35398 -20.12534,61.11967 -42.46246,84.28052 -5.73974,5.95141 -17.5515,16.18743 -26.89357,23.30587 -5.57546,4.24837 -30.31292,16.307 -40.72564,19.8523 -5.87001,1.99861 -30.97214,7.23635 -38.5,8.0333 -5.40946,0.57268 -8.17776,1.65358 -16.5,6.44255 C 512.3864,731.26976 471.24497,751 468.02371,751 467.64223,751 463.58156,743.125 459,733.5 z m 42.59539,-34.94527 C 555.28581,670.67652 591.6962,637.3476 610.9008,598.5 c 9.96549,-20.15846 14.17446,-35.24793 16.24535,-58.24085 2.58538,-28.70514 -2.83852,-55.58505 -17.10291,-84.75915 -17.1538,-35.08365 -43.49378,-65.49156 -86.79897,-100.20414 -12.71469,-10.19185 -25.53167,-22.20893 -31.49402,-29.52852 -4.69889,-5.76852 -10.46325,-17.67069 -11.31771,-23.36865 -1.92091,-12.80949 8.96165,-29.24406 31.06746,-46.91733 9.47843,-7.57786 30.63901,-21.81814 43.78932,-29.46857 5.93412,-3.45229 10.65912,-6.58173 10.5,-6.95432 -0.70499,-1.6507 -66.11436,-108.83792 -67.69732,-110.9365 l -1.76868,-2.34479 -8.41166,4.74384 c -19.66055,11.08778 -41.21255,27.81271 -61.76335,47.93002 -17.79594,17.42056 -25.56125,26.51665 -36.54115,42.80338 -13.35756,19.81357 -24.29238,43.32916 -29.14134,62.66915 -2.33932,9.33033 -4.42506,26.2849 -4.43809,36.07643 -0.0487,36.56458 12.60707,69.99141 39.56483,104.5 9.23505,11.82178 29.89662,31.76294 45.41277,43.82936 10.88063,8.46152 25.36321,21.05273 32.98818,28.68006 11.83541,11.83905 18.84899,21.05529 24.28752,31.91519 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.5769 -0.23263,9.59795 -3.858,16.9334 -7.25014,14.66966 -25.89327,29.98951 -54.8858,45.10201 -10.66143,5.55731 -12.60164,6.91608 -11.87376,8.31544 1.01263,1.9468 3.50616,7.22399 24.41591,51.67268 23.2893,49.50699 27.65101,58.5 28.37316,58.5 0.36256,0 7.97831,-3.80037 16.92388,-8.44527 z m -258.26468,-8.12909 c 16.83233,-2.39215 37.0641,-10.19735 51.07439,-19.70394 8.91033,-6.04606 9.23831,-6.3295 21.64092,-18.70289 25.70786,-25.64726 39.60733,-55.69451 46.03613,-99.51881 0.75789,-5.16648 1.32954,-30.314 1.61395,-71 l 0.44038,-63 -7.61067,-11.36035 C 322.82818,356.83967 314.61019,295.28003 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.93019,181.53239 364,179.13795 364,175.65504 l 0,-4.23128 -55.25,-6.3296 c -30.3875,-3.48128 -56.70357,-6.55906 -58.48015,-6.8395 l -3.23015,-0.5099 -0.27155,192.37762 -0.27155,192.37762 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -2.49299,1.13235 -6.40714,1.85067 -10.15793,1.86417 -8.3749,0.0301 -11.83548,-2.41165 -16.44855,-11.60612 -6.75965,-13.4729 -9.6231,-31.44581 -10.60371,-66.5561 l -0.66149,-23.68418 -4.59207,0.46752 c -5.26768,0.53631 -80.98002,6.20358 -94.763154,7.09328 -5.044102,0.3256 -9.679521,0.90622 -10.300931,1.29027 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 30.18263,31.59437 69.85778,43.69669 119.92487,36.58132 z m 121.71108,-3.99257 c 18.05217,-18.4924 39.75872,-18.87428 38.74952,-0.68171 l -0.29131,5.25137 17.70872,-0.001 17.70872,-10e-4 -6.26104,-13.25 c -3.44357,-7.2875 -14.54147,-30.90114 -24.662,-52.47475 l -18.40095,-39.22475 -3.60232,12.22475 c -10.15357,34.45689 -28.97793,64.74879 -53.55992,86.18791 L 324.9361,691 l 17.82374,0 17.82374,0 4.45821,-4.56693 z M 393,688.0651 c 0,-4.64496 -1.73489,-8.01141 -4.73207,-9.18229 -2.36946,-0.92565 -3.64152,-0.633 -8.83621,2.03284 -3.33755,1.71279 -7.58832,4.68245 -9.44616,6.59925 l -3.37789,3.4851 13.19616,0 13.19617,0 0,-2.9349 z m 6.375,-0.1901 c 0.98144,-4.90718 0.78649,-5.80442 -1.82955,-8.42045 -3.60778,-3.60779 -4.83639,-2.99013 -2.54739,1.28064 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.15345 1.55398,4.24493 2.375,0.13981 z M 611.5,665.1563 c 7.88058,-5.17641 28.6737,-25.33491 33.09725,-32.08711 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42606,-5.74419 4.12942,-6.56919 0.70336,-0.825 2.02432,-2.97153 2.93547,-4.77006 C 660.00305,607.12228 668,582.88765 668,580.15366 c 0,-1.34975 0.68852,-5.874 1.53004,-10.05388 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26422,-153.31913 -0.38415,-163.00848 -2.12275,-171.5 -2.59309,-12.66498 -9.1308,-33.0713 -12.70933,-39.66999 C 647.3985,173.06509 639.50715,162.571 627.94595,151.59231 616.14582,140.38672 607.69697,134.2432 592.84182,126.06658 585.68374,122.12662 563.64337,115.32955 554,114.0881 c -5.225,-0.67265 -10.2875,-1.37552 -11.25,-1.56193 -0.9625,-0.18641 -1.75,-0.21029 -1.75,-0.0531 0,0.15722 16.19937,26.98072 35.99861,59.60777 19.79923,32.62705 35.66173,59.62928 35.25,60.00495 -0.41174,0.37567 -9.07361,5.30148 -19.24861,10.94625 -40.45033,22.44057 -67.45908,41.36486 -75.40956,52.83742 l -2.80489,4.04745 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05918,0.85902 1.41096,0.91441 0.95207,0.14991 -1.09619,-1.82623 3.92255,-10.92272 9.05164,-16.40613 9.2868,-9.92835 23.31317,-13.09593 35.08575,-7.92344 5.84883,2.56979 11.51715,8.42331 13.25452,13.68757 0.6089,1.84498 1.24223,3.35451 1.40741,3.35451 0.16518,0 1.91582,-0.675 3.89033,-1.5 4.9151,-2.05366 14.22931,-1.87626 19.16282,0.36498 8.62122,3.91654 13.60089,13.21844 11.44824,21.38502 -4.54335,17.23628 -24.01745,27.95913 -38.7505,21.33685 l -4.25631,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 5.42953,-7.49524 3.09544,-17.44358 -5.11646,-21.80739 -4.20572,-2.23492 -10.3158,-2.40856 -12.37274,-0.35161 -2.13158,2.13158 -2.32667,2.00324 -4.53145,-2.98105 -1.41888,-3.20761 -3.3406,-5.34253 -6.76228,-7.51249 -5.80773,-3.68316 -9.68576,-4.84069 -18.93225,-5.651 -12.223,-1.07115 -16.76786,1.82256 -22.6974,14.45142 l -2.96123,6.30689 2.37087,2.54466 c 1.30399,1.39956 6.64588,5.96516 11.87088,10.14578 37.35402,29.88763 64.3618,57.26248 83.14429,84.27434 4.04564,5.8182 8.93071,13.35413 10.85571,16.74651 2.45696,4.32983 3.94635,6.00101 4.99777,5.60776 13.22964,-4.9482 22.98863,-0.63672 22.99849,10.16063 0.006,6.49433 -6.88468,24.21158 -8.92578,22.95011 -0.46905,-0.28989 0.22351,2.86233 1.53903,7.00494 9.26654,29.18052 10.89754,65.41834 4.31859,95.9515 -7.70169,35.7438 -26.67225,69.38715 -56.91037,100.92768 l -9.51773,9.92768 7,-3.80053 c 3.85,-2.09029 10.15,-5.86963 14,-8.39853 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 414.29368,565.58361 c 10.56348,-5.08964 23.42823,-11.86709 28.58835,-15.06098 9.71624,-6.01396 21.36939,-16.18848 24.30118,-21.2177 1.58506,-2.71902 1.57866,-3.11824 -0.10974,-6.84616 -4.78782,-10.57129 -20.14098,-26.42073 -44.53059,-45.97002 -8.22641,-6.59381 -17.56391,-14.39972 -20.75,-17.34646 L 396,453.78457 l -0.003,42.35772 c -0.003,40.89704 -0.76706,57.25538 -3.39046,72.61695 -1.1813,6.91723 -1.15205,7.23142 0.62077,6.66875 1.02326,-0.32477 10.50331,-4.75474 21.06679,-9.84438 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 648.8358,445.41945 c -0.43634,-8.6407 -1.77985,-10.56835 -7.59452,-10.89643 l -3.93217,-0.22187 2.20527,4.09943 c 1.21289,2.25468 3.49106,7.13137 5.06259,10.83709 3.50029,8.25379 4.80918,7.08032 4.25883,-3.81822 z M 154.75,449.83902 213,445.57127 213,396.78563 213,348 l -4.98927,0 c -5.81465,0 -13.6739,-2.74297 -18.57904,-6.48431 -12.62962,-9.63308 -10.43809,-37.90372 4.14702,-53.49638 C 198.21475,283.06301 206.98687,278 210.93807,278 l 2.06193,0 0,-78.5 c 0,-43.175 0.3366,-78.5 0.748,-78.5 0.4114,0 41.43218,4.51778 91.15728,10.0395 l 90.40928,10.03951 11.09272,-10.83958 c 6.101,-5.96176 13.08622,-12.50454 15.52272,-14.5395 L 426.36,112 325.43,112.0327 c -56.74339,0.0184 -103.77567,0.44012 -107.43,0.96329 -29.37607,4.20561 -53.38798,14.02963 -73.42841,30.04182 -8.60395,6.87452 -21.90005,20.66389 -26.4798,27.46217 C 108.66133,184.4988 100,201.33974 100,205.67738 c 0,0.77126 -0.846152,3.07187 -1.880338,5.11246 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.47307 C 95.474222,454.31966 122.7125,452.18629 154.75,449.83902 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.930842,6.25 -0.72394,1.52442 2.086642,0.69037 3.369812,-1 z m 32.87346,-143.64357 c -4.24772,-1.85085 -9.25984,-7.90845 -10.0563,-12.15395 -1.67243,-8.91481 3.70093,-22.46828 12.44706,-31.39575 4.62322,-4.71907 6.57753,-5.9717 10.94803,-7.0172 14.09869,-3.37267 26.75182,5.08918 26.45672,17.69307 -0.25941,11.07993 -11.02873,26.85585 -21.77692,31.90092 -5.65239,2.65316 -13.22412,3.062 -18.01859,0.97291 z m 15.85724,-3.71487 c 2.57189,-1.17183 9.90447,-15.39321 11.16964,-21.66329 2.40325,-11.91028 -6.24022,-20.85559 -17.69046,-18.30823 -7.97223,1.7736 -14.96525,13.23904 -15.63536,25.63504 -0.35276,6.52551 -0.17362,7.30198 2.38651,10.34453 1.52234,1.8092 3.7046,3.66839 4.84946,4.13154 3.04,1.22981 12.10076,1.14504 14.92021,-0.13959 z m 16.75196,-18.06917 c 1.17219,-2.29768 2.35993,-6.69946 2.63942,-9.78173 0.45657,-5.03514 0.23015,-5.93453 -2.23005,-8.85831 C 165.81577,200.99234 161.20455,198 158.97293,198 c -0.61951,0 0.31933,1.21649 2.08632,2.70331 1.76698,1.48682 3.82651,4.17236 4.57672,5.96788 1.58266,3.78783 1.8069,14.03377 0.38878,17.76371 -1.51029,3.97236 -0.3023,3.02946 2.06586,-1.61251 z m 487.41903,219.98682 c 0.6249,-4.1894 0.42614,-4.96434 -1.85952,-7.25 -3.70221,-3.70221 -4.96622,-3.14173 -2.65206,1.17598 1.21945,2.27524 2.01383,5.69531 2.03235,8.75 0.0361,5.94756 1.41493,4.45927 2.47923,-2.67598 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.48813,7.3994 -6.50115,14.91876 -6.53711,24.4185 -0.0365,9.64895 2.29928,15.08571 7.9932,18.60474 4.23097,2.61489 11.26889,4.72784 16.08052,4.82777 L 213,344 l 0,-29.12019 z m 391.54368,15.89273 c 5.63928,-6.68797 7.03081,-14.67823 3.5503,-20.38603 -2.05099,-3.36348 -9.2261,-7.38881 -13.1597,-7.38277 -2.36134,0.004 -2.34312,0.0593 0.60834,1.85918 10.06523,6.13798 12.22538,16.80013 5.41047,26.70526 -2.53238,3.68069 -2.77227,4.40541 -1.17531,3.55075 1.10357,-0.59062 3.24823,-2.54649 4.7659,-4.34639 z M 563.5,288.46389 c -1.65,-0.75553 -4.125,-1.35776 -5.5,-1.33831 -1.69485,0.024 -1.05073,0.45048 2,1.32429 5.93416,1.6997 7.19239,1.70473 3.5,0.014 z m -9.25,-2.12617 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3556"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b4963d"
+       d="m 459.17065,733.75 -8.15255,-17.25 -84.62882,-0.25567 -84.62882,-0.25567 -7.63023,2.40354 C 239.16411,729.40664 196.72137,729.63311 163.8676,718.98056 151.06545,714.82957 134.31018,706.47376 123.5,698.84933 111.77688,690.58101 92.266504,671.00378 83.786753,659 63.562065,630.37029 51.948941,598.01713 46.424287,554.91138 45.297609,546.12056 44.677539,530.17514 44.298668,500.25 L 43.763755,458 47.731,458 c 2.181985,0 7.393851,-0.28965 11.581926,-0.64368 l 7.614682,-0.64367 0.288761,-113.10633 C 67.539416,217.07018 67.135338,224.56782 74.901985,201 79.998914,185.53342 82.328522,179.77413 85.678373,174.35848 87.230268,171.84956 90.075,167.23682 92,164.10796 c 12.76284,-20.74454 33.38975,-40.75873 56,-54.33656 6.82463,-4.0983 24.26862,-11.872247 33,-14.706508 1.925,-0.624867 9.575,-2.573495 17,-4.330285 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.40166,-2.212652 31.98894,-18.382598 39.99705,-22.623696 2.01349,-1.066347 2.64928,-0.309138 10.23759,12.192706 l 8.09078,13.329663 13.2624,0.607896 c 17.82153,0.816868 33.67664,3.758553 48.8356,9.06073 14.28552,4.996674 16.69209,6.127514 26.42681,12.417904 3.85,2.48779 9.475,6.11504 12.5,8.06055 6.10124,3.92398 7.25843,4.91802 21.31091,18.30632 5.39601,5.14096 12.13301,12.4972 14.97113,16.3472 C 671.20591,163.60553 683,184.07037 683,187.44933 c 0,0.8285 1.09557,3.87883 2.43461,6.77852 2.37403,5.14099 4.58888,13.00962 8.23948,29.27215 1.68134,7.48994 1.81577,18.6156 2.10858,174.5 l 0.31275,166.5 -2.16585,13.5 c -2.57135,16.02752 -9.73269,38.05257 -15.76955,48.5 -2.22465,3.85 -5.02529,8.8 -6.22365,11 -7.16896,13.16109 -26.4637,34.08894 -42.58021,46.1842 -10.85645,8.14764 -31.89364,19.08335 -45.85616,23.83728 -5.96004,2.02926 -31.05577,7.24893 -38.5,8.00762 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 -5.5,3.18227 -14.725,8.15634 -20.5,11.05349 C 497.34666,738.37547 469.24531,751 468.00223,751 c -0.37346,0 -4.34767,-7.7625 -8.83158,-17.25 z m 42.42474,-35.19527 C 555.28581,670.67652 591.6962,637.3476 610.9008,598.5 c 9.96549,-20.15846 14.17446,-35.24793 16.24535,-58.24085 2.58538,-28.70514 -2.83852,-55.58505 -17.10291,-84.75915 -17.1538,-35.08365 -43.49378,-65.49156 -86.79897,-100.20414 -12.71469,-10.19185 -25.53167,-22.20893 -31.49402,-29.52852 -4.69889,-5.76852 -10.46325,-17.67069 -11.31771,-23.36865 -1.92091,-12.80949 8.96165,-29.24406 31.06746,-46.91733 9.47843,-7.57786 30.63901,-21.81814 43.78932,-29.46857 5.93412,-3.45229 10.65912,-6.58173 10.5,-6.95432 -0.70499,-1.6507 -66.11436,-108.83792 -67.69732,-110.9365 l -1.76868,-2.34479 -8.41166,4.74384 c -10.58604,5.97011 -24.13911,15.35373 -37.24137,25.78447 -11.89388,9.46874 -35.9375,32.73727 -45.67375,44.20138 -22.54578,26.54687 -41.57301,64.45332 -46.42715,92.49313 -9.51281,54.9505 9.27937,106.1826 55.60165,151.58381 10.3601,10.15411 17.63425,16.59097 26.83429,23.74555 10.88063,8.46152 25.36321,21.05273 32.98818,28.68006 11.83541,11.83905 18.84899,21.05529 24.28752,31.91519 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.5769 -0.23263,9.59795 -3.858,16.9334 -7.25014,14.66966 -25.89327,29.98951 -54.8858,45.10201 -10.66143,5.55731 -12.60164,6.91608 -11.87376,8.31544 1.01263,1.9468 3.50616,7.22399 24.41591,51.67268 23.2893,49.50699 27.65101,58.5 28.37316,58.5 0.36256,0 7.97831,-3.80037 16.92388,-8.44527 z m -258.26468,-8.12909 c 16.83233,-2.39215 37.0641,-10.19735 51.07439,-19.70394 8.91033,-6.04606 9.23831,-6.3295 21.64092,-18.70289 25.70786,-25.64726 39.60733,-55.69451 46.03613,-99.51881 0.75789,-5.16648 1.32954,-30.314 1.61395,-71 l 0.44038,-63 -7.65343,-11.42434 C 322.88513,356.92377 314.65208,295.15739 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.93019,181.53239 364,179.13795 364,175.65504 l 0,-4.23128 -55.25,-6.3296 c -30.3875,-3.48128 -56.70357,-6.55906 -58.48015,-6.8395 l -3.23015,-0.5099 -0.27155,192.37762 -0.27155,192.37762 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -2.49299,1.13235 -6.40714,1.85067 -10.15793,1.86417 -8.3749,0.0301 -11.83548,-2.41165 -16.44855,-11.60612 -6.75965,-13.4729 -9.6231,-31.44581 -10.60371,-66.5561 l -0.66149,-23.68418 -4.59207,0.46752 c -5.26768,0.53631 -80.98002,6.20358 -94.763154,7.09328 -5.044102,0.3256 -9.679521,0.90622 -10.300931,1.29027 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 30.18263,31.59437 69.85778,43.69669 119.92487,36.58132 z m 121.71108,-3.99257 c 18.05217,-18.4924 39.75872,-18.87428 38.74952,-0.68171 l -0.29131,5.25137 17.70872,-0.001 17.70872,-10e-4 -6.26104,-13.25 c -3.44357,-7.2875 -14.54147,-30.90114 -24.662,-52.47475 l -18.40095,-39.22475 -3.60232,12.22475 c -10.15357,34.45689 -28.97793,64.74879 -53.55992,86.18791 L 324.9361,691 l 17.82374,0 17.82374,0 4.45821,-4.56693 z M 393,688.0651 c 0,-4.64496 -1.73489,-8.01141 -4.73207,-9.18229 -2.36946,-0.92565 -3.64152,-0.633 -8.83621,2.03284 -3.33755,1.71279 -7.58832,4.68245 -9.44616,6.59925 l -3.37789,3.4851 13.19616,0 13.19617,0 0,-2.9349 z m 6.375,-0.1901 c 0.98144,-4.90718 0.78649,-5.80442 -1.82955,-8.42045 -3.60778,-3.60779 -4.83639,-2.99013 -2.54739,1.28064 1.10107,2.05436 2.00194,5.20436 2.00194,7 0,4.15345 1.55398,4.24493 2.375,0.13981 z M 611.5,665.1563 c 7.88058,-5.17641 28.6737,-25.33491 33.09725,-32.08711 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42606,-5.74419 4.12942,-6.56919 0.70336,-0.825 2.02432,-2.97153 2.93547,-4.77006 C 660.00305,607.12228 668,582.88765 668,580.15366 c 0,-1.34975 0.68852,-5.874 1.53004,-10.05388 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26422,-153.31913 -0.38415,-163.00848 -2.12275,-171.5 -2.59309,-12.66498 -9.1308,-33.0713 -12.70933,-39.66999 C 647.3985,173.06509 639.50715,162.571 627.94595,151.59231 616.14582,140.38672 607.69697,134.2432 592.84182,126.06658 585.68374,122.12662 563.64337,115.32955 554,114.0881 c -5.225,-0.67265 -10.2875,-1.37552 -11.25,-1.56193 -0.9625,-0.18641 -1.75,-0.21029 -1.75,-0.0531 0,0.15722 16.19937,26.98072 35.99861,59.60777 19.79923,32.62705 35.66173,59.62928 35.25,60.00495 -0.41174,0.37567 -9.07361,5.30148 -19.24861,10.94625 -40.45033,22.44057 -67.45908,41.36486 -75.40956,52.83742 l -2.80489,4.04745 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05918,0.85902 1.41096,0.91441 0.95207,0.14991 -1.09619,-1.82623 3.92255,-10.92272 9.05164,-16.40613 9.2868,-9.92835 23.31317,-13.09593 35.08575,-7.92344 5.84883,2.56979 11.51715,8.42331 13.25452,13.68757 0.6089,1.84498 1.24223,3.35451 1.40741,3.35451 0.16518,0 1.91582,-0.675 3.89033,-1.5 4.9151,-2.05366 14.22931,-1.87626 19.16282,0.36498 8.62122,3.91654 13.60089,13.21844 11.44824,21.38502 -4.54335,17.23628 -24.01745,27.95913 -38.7505,21.33685 l -4.25631,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 5.42953,-7.49524 3.09544,-17.44358 -5.11646,-21.80739 -4.20572,-2.23492 -10.3158,-2.40856 -12.37274,-0.35161 -2.13158,2.13158 -2.32667,2.00324 -4.53145,-2.98105 -1.41888,-3.20761 -3.3406,-5.34253 -6.76228,-7.51249 -5.80773,-3.68316 -9.68576,-4.84069 -18.93225,-5.651 -12.223,-1.07115 -16.76786,1.82256 -22.6974,14.45142 l -2.96123,6.30689 2.37087,2.54466 c 1.30399,1.39956 6.64588,5.96516 11.87088,10.14578 37.35402,29.88763 64.3618,57.26248 83.14429,84.27434 4.04564,5.8182 8.93071,13.35413 10.85571,16.74651 2.45696,4.32983 3.94635,6.00101 4.99777,5.60776 13.22964,-4.9482 22.98863,-0.63672 22.99849,10.16063 0.006,6.49433 -6.88468,24.21158 -8.92578,22.95011 -0.46905,-0.28989 0.22351,2.86233 1.53903,7.00494 9.26654,29.18052 10.89754,65.41834 4.31859,95.9515 -7.70169,35.7438 -26.67225,69.38715 -56.91037,100.92768 l -9.51773,9.92768 7,-3.80053 c 3.85,-2.09029 10.15,-5.86963 14,-8.39853 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 414.29368,565.58361 c 10.56348,-5.08964 23.42823,-11.86709 28.58835,-15.06098 9.71624,-6.01396 21.36939,-16.18848 24.30118,-21.2177 1.58506,-2.71902 1.57866,-3.11824 -0.10974,-6.84616 -4.78782,-10.57129 -20.14098,-26.42073 -44.53059,-45.97002 -8.22641,-6.59381 -17.56391,-14.39972 -20.75,-17.34646 L 396,453.78457 l -0.003,42.35772 c -0.003,40.89704 -0.76706,57.25538 -3.39046,72.61695 -1.1813,6.91723 -1.15205,7.23142 0.62077,6.66875 1.02326,-0.32477 10.50331,-4.75474 21.06679,-9.84438 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 648.8358,445.41945 c -0.43634,-8.6407 -1.77985,-10.56835 -7.59452,-10.89643 l -3.93217,-0.22187 2.20527,4.09943 c 1.21289,2.25468 3.49106,7.13137 5.06259,10.83709 3.50029,8.25379 4.80918,7.08032 4.25883,-3.81822 z M 154.75,449.83902 213,445.57127 213,396.78563 213,348 l -4.98927,0 c -5.81465,0 -13.6739,-2.74297 -18.57904,-6.48431 -12.62962,-9.63308 -10.43809,-37.90372 4.14702,-53.49638 C 198.21475,283.06301 206.98687,278 210.93807,278 l 2.06193,0 0,-78.5 c 0,-43.175 0.3366,-78.5 0.748,-78.5 0.4114,0 41.43218,4.51778 91.15728,10.0395 l 90.40928,10.03951 11.09272,-10.83958 c 6.101,-5.96176 13.08622,-12.50454 15.52272,-14.5395 L 426.36,112 325.43,112.0327 c -56.74339,0.0184 -103.77567,0.44012 -107.43,0.96329 -29.43188,4.2136 -53.582,14.1081 -73.42841,30.0842 -8.86093,7.13293 -21.2526,19.8366 -25.83627,26.48677 C 109.3621,183.166 100,201.11437 100,205.48503 c 0,0.87705 -0.846152,3.26422 -1.880338,5.30481 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723349,9.73596 -1.879734,18.48793 -2.149169,120.27646 l -0.290579,109.77646 2.279508,-0.47307 C 95.474222,454.31966 122.7125,452.18629 154.75,449.83902 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.930842,6.25 -0.72394,1.52442 2.086642,0.69037 3.369812,-1 z m 32.87346,-143.64357 c -4.24772,-1.85085 -9.25984,-7.90845 -10.0563,-12.15395 -1.67243,-8.91481 3.70093,-22.46828 12.44706,-31.39575 4.62322,-4.71907 6.57753,-5.9717 10.94803,-7.0172 14.09869,-3.37267 26.75182,5.08918 26.45672,17.69307 -0.25941,11.07993 -11.02873,26.85585 -21.77692,31.90092 -5.65239,2.65316 -13.22412,3.062 -18.01859,0.97291 z m 15.85724,-3.71487 c 2.57189,-1.17183 9.90447,-15.39321 11.16964,-21.66329 2.40325,-11.91028 -6.24022,-20.85559 -17.69046,-18.30823 -7.97223,1.7736 -14.96525,13.23904 -15.63536,25.63504 -0.35276,6.52551 -0.17362,7.30198 2.38651,10.34453 1.52234,1.8092 3.7046,3.66839 4.84946,4.13154 3.04,1.22981 12.10076,1.14504 14.92021,-0.13959 z m 16.75196,-18.06917 c 1.17219,-2.29768 2.35993,-6.69946 2.63942,-9.78173 0.45657,-5.03514 0.23015,-5.93453 -2.23005,-8.85831 C 165.81577,200.99234 161.20455,198 158.97293,198 c -0.61951,0 0.31933,1.21649 2.08632,2.70331 1.76698,1.48682 3.82651,4.17236 4.57672,5.96788 1.58266,3.78783 1.8069,14.03377 0.38878,17.76371 -1.51029,3.97236 -0.3023,3.02946 2.06586,-1.61251 z m 487.41903,219.98682 c 0.6249,-4.1894 0.42614,-4.96434 -1.85952,-7.25 -3.70221,-3.70221 -4.96622,-3.14173 -2.65206,1.17598 1.21945,2.27524 2.01383,5.69531 2.03235,8.75 0.0361,5.94756 1.41493,4.45927 2.47923,-2.67598 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.48813,7.3994 -6.50115,14.91876 -6.53711,24.4185 -0.0365,9.64895 2.29928,15.08571 7.9932,18.60474 4.23097,2.61489 11.26889,4.72784 16.08052,4.82777 L 213,344 l 0,-29.12019 z m 391.54368,15.89273 c 5.63928,-6.68797 7.03081,-14.67823 3.5503,-20.38603 -2.05099,-3.36348 -9.2261,-7.38881 -13.1597,-7.38277 -2.36134,0.004 -2.34312,0.0593 0.60834,1.85918 10.06523,6.13798 12.22538,16.80013 5.41047,26.70526 -2.53238,3.68069 -2.77227,4.40541 -1.17531,3.55075 1.10357,-0.59062 3.24823,-2.54649 4.7659,-4.34639 z M 563.5,288.46389 c -1.65,-0.75553 -4.125,-1.35776 -5.5,-1.33831 -1.69485,0.024 -1.05073,0.45048 2,1.32429 5.93416,1.6997 7.19239,1.70473 3.5,0.014 z m -9.25,-2.12617 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3554"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#c28d34"
+       d="m 459.17065,733.75 -8.15255,-17.25 -84.62882,-0.25567 -84.62882,-0.25567 -7.63023,2.40354 C 239.16411,729.40664 196.72137,729.63311 163.8676,718.98056 151.06545,714.82957 134.31018,706.47376 123.5,698.84933 111.77688,690.58101 92.266504,671.00378 83.786753,659 63.562065,630.37029 51.948941,598.01713 46.424287,554.91138 45.297609,546.12056 44.677539,530.17514 44.298668,500.25 L 43.763755,458 47.731,458 c 2.181985,0 7.393851,-0.28965 11.581926,-0.64368 l 7.614682,-0.64367 0.288761,-113.10633 C 67.539416,217.07018 67.135338,224.56782 74.901985,201 79.998914,185.53342 82.328522,179.77413 85.678373,174.35848 87.230268,171.84956 90.075,167.23682 92,164.10796 c 12.76284,-20.74454 33.38975,-40.75873 56,-54.33656 6.82463,-4.0983 24.26862,-11.872247 33,-14.706508 1.925,-0.624867 9.575,-2.573495 17,-4.330285 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.40166,-2.212652 31.98894,-18.382598 39.99705,-22.623696 2.01349,-1.066347 2.64928,-0.309138 10.23759,12.192706 l 8.09078,13.329663 13.2624,0.607896 c 17.82153,0.816868 33.67664,3.758553 48.8356,9.06073 14.28552,4.996674 16.69209,6.127514 26.42681,12.417904 3.85,2.48779 9.475,6.11504 12.5,8.06055 6.10124,3.92398 7.25843,4.91802 21.31091,18.30632 5.39601,5.14096 12.13301,12.4972 14.97113,16.3472 C 671.20591,163.60553 683,184.07037 683,187.44933 c 0,0.8285 1.09557,3.87883 2.43461,6.77852 2.37403,5.14099 4.58888,13.00962 8.23948,29.27215 1.68134,7.48994 1.81577,18.6156 2.10858,174.5 l 0.31275,166.5 -2.16585,13.5 c -2.57135,16.02752 -9.73269,38.05257 -15.76955,48.5 -2.22465,3.85 -5.02529,8.8 -6.22365,11 -7.16896,13.16109 -26.4637,34.08894 -42.58021,46.1842 -10.85645,8.14764 -31.89364,19.08335 -45.85616,23.83728 -5.96004,2.02926 -31.05577,7.24893 -38.5,8.00762 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 -5.5,3.18227 -14.725,8.15634 -20.5,11.05349 C 497.34666,738.37547 469.24531,751 468.00223,751 c -0.37346,0 -4.34767,-7.7625 -8.83158,-17.25 z m 42.42474,-35.19527 C 555.28581,670.67652 591.6962,637.3476 610.9008,598.5 620.86629,578.34154 625.07526,563.25207 627.14615,540.25915 629.73153,511.55401 624.30763,484.6741 610.04324,455.5 592.85222,420.34023 566.61077,390.06495 523,355.0765 c -12.43843,-9.97922 -25.27499,-22.02697 -31.24975,-29.32946 -4.69015,-5.7324 -10.46149,-17.63862 -11.31771,-23.34835 -1.91995,-12.80314 8.86679,-29.10338 31.06746,-46.94719 8.31792,-6.68553 34.61027,-24.25484 46.29543,-30.93595 4.56248,-2.60865 8.16248,-5.06134 8,-5.45042 -0.68098,-1.63065 -66.05666,-108.76856 -67.68751,-110.92654 l -1.7846,-2.36141 -8.41166,4.74024 c -27.1775,15.31539 -62.3453,45.25749 -84.72243,72.13323 -21.46067,25.77504 -39.90719,63.12684 -44.61984,90.34935 -8.0369,46.42495 3.61462,88.4366 36.19291,130.5 10.29327,13.29014 28.97393,31.39973 46.24303,44.82936 10.88063,8.46152 25.36321,21.05273 32.98818,28.68006 11.83541,11.83905 18.84899,21.05529 24.28752,31.91519 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.55231 -0.23929,9.61143 -3.79878,16.81357 -7.24383,14.65689 -26.13314,30.20351 -54.94502,45.22184 -10.66143,5.55731 -12.60164,6.91608 -11.87376,8.31544 1.01263,1.9468 3.50616,7.22399 24.41591,51.67268 23.2893,49.50699 27.65101,58.5 28.37316,58.5 0.36256,0 7.97831,-3.80037 16.92388,-8.44527 z m -258.522,-8.09061 c 17.16402,-2.43588 37.1569,-10.08517 51.1647,-19.57566 8.73063,-5.91513 9.42532,-6.51622 21.80793,-18.86965 25.75723,-25.69652 39.59498,-55.61035 46.03613,-99.51881 0.75789,-5.16648 1.32954,-30.314 1.61395,-71 l 0.44038,-63 -7.65343,-11.42434 C 322.88513,356.92377 314.65208,295.15739 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.93019,181.53239 364,179.13795 364,175.65504 l 0,-4.23128 -55.25,-6.3296 c -30.3875,-3.48128 -56.70357,-6.55906 -58.48015,-6.8395 l -3.23015,-0.5099 -0.27155,192.37762 -0.27155,192.37762 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -5.56051,2.52566 -15.03913,2.49857 -19.22693,-0.0549 -11.35385,-6.92302 -18.28529,-39.56229 -18.31899,-86.26182 l -0.01,-13.70288 -4.75,0.48623 c -5.34781,0.54742 -80.77855,6.19908 -94.921094,7.11198 -5.044102,0.3256 -9.679521,0.90622 -10.300931,1.29027 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 30.11936,31.52815 69.85795,43.68866 119.66755,36.6198 z m 121.9684,-4.03105 c 18.05217,-18.4924 39.75872,-18.87428 38.74952,-0.68171 l -0.29131,5.25137 17.70872,-0.001 17.70872,-10e-4 -6.2649,-13.25 c -3.4457,-7.2875 -14.54008,-30.91318 -24.65419,-52.5015 l -18.38929,-39.2515 -3.61013,12.2515 c -10.16149,34.48454 -28.978,64.7688 -53.56772,86.21466 L 324.9361,691 l 17.82374,0 17.82374,0 4.45821,-4.56693 z M 393,688.0651 c 0,-4.64496 -1.73489,-8.01141 -4.73207,-9.18229 -2.36946,-0.92565 -3.64152,-0.633 -8.83621,2.03284 -3.33755,1.71279 -7.58832,4.68245 -9.44616,6.59925 l -3.37789,3.4851 13.19616,0 13.19617,0 0,-2.9349 z m 6.48735,-0.99024 c 0.74311,-4.39842 -0.46029,-7.45483 -3.59591,-9.13296 -2.80955,-1.50362 -3.60492,-0.38777 -1.43371,2.01139 0.97834,1.08105 2.0091,4.00881 2.29059,6.50613 0.62913,5.58164 1.85352,5.85675 2.73903,0.61544 z m 212.96831,-22.42712 c 7.072,-4.66267 27.93992,-25.16503 32.14159,-31.57855 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42606,-5.74419 4.12942,-6.56919 0.70336,-0.825 2.02432,-2.97153 2.93547,-4.77006 C 660.00305,607.12228 668,582.88765 668,580.15366 c 0,-1.34975 0.68852,-5.874 1.53004,-10.05388 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26371,-153.02215 -0.38701,-163.02493 -2.11413,-171.5 -2.81457,-13.81129 -8.495,-31.61894 -12.49141,-39.15952 -8.25827,-15.58202 -16.51917,-26.62877 -28.22855,-37.74817 C 616.14582,140.38672 607.69697,134.2432 592.84182,126.06658 585.68374,122.12662 563.64337,115.32955 554,114.0881 c -5.225,-0.67265 -10.2875,-1.37552 -11.25,-1.56193 -0.9625,-0.18641 -1.75,-0.202 -1.75,-0.0346 0,0.16736 16.19779,26.99244 35.9951,59.61128 19.7973,32.61885 35.6598,59.61735 35.25,59.99666 -0.40981,0.37932 -8.8451,5.1642 -18.7451,10.63307 -40.1856,22.199 -67.96417,41.62534 -75.85722,53.0491 l -2.85723,4.13531 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05918,0.85902 1.41096,0.91441 0.95207,0.14991 -1.09619,-1.82623 3.92255,-10.92272 9.05164,-16.40613 9.2868,-9.92835 23.31317,-13.09593 35.08575,-7.92344 5.84883,2.56979 11.51715,8.42331 13.25452,13.68757 0.6089,1.84498 1.24223,3.35451 1.40741,3.35451 0.16518,0 1.91582,-0.675 3.89033,-1.5 4.9151,-2.05366 14.22931,-1.87626 19.16282,0.36498 8.62122,3.91654 13.60089,13.21844 11.44824,21.38502 -4.54335,17.23628 -24.01745,27.95913 -38.7505,21.33685 l -4.25631,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 5.42953,-7.49524 3.09544,-17.44358 -5.11646,-21.80739 -4.20572,-2.23492 -10.3158,-2.40856 -12.37274,-0.35161 -2.13158,2.13158 -2.32667,2.00324 -4.53145,-2.98105 -1.41888,-3.20761 -3.3406,-5.34253 -6.76228,-7.51249 -5.80773,-3.68316 -9.68576,-4.84069 -18.93225,-5.651 -12.223,-1.07115 -16.76786,1.82256 -22.6974,14.45142 l -2.96123,6.30689 2.37087,2.54466 c 1.30399,1.39956 6.64588,5.96516 11.87088,10.14578 37.35402,29.88763 64.3618,57.26248 83.14429,84.27434 4.04564,5.8182 8.93071,13.35413 10.85571,16.74651 2.45696,4.32983 3.94635,6.00101 4.99777,5.60776 13.22964,-4.9482 22.98863,-0.63672 22.99849,10.16063 0.006,6.64815 -6.89668,24.20416 -9.0045,22.90146 -0.51236,-0.31666 -0.24293,1.35495 0.59873,3.71468 C 657.05721,482.53646 661,507.51762 661,526.82745 661,556.45188 654.81316,582.84807 641.62288,609.5 631.15994,630.64112 619.12742,647.38218 600,667.41061 l -9.5,9.94751 7.95566,-4.36263 c 4.37561,-2.39945 10.67561,-6.15594 14,-8.34775 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 416.47394,564.49372 c 23.67894,-11.51999 36.4268,-19.56198 44.60762,-28.14069 7.74629,-8.12306 8.16523,-9.09592 5.98746,-13.90419 -4.78336,-10.56114 -20.1454,-26.41791 -44.52614,-45.96009 -8.22641,-6.59381 -17.56391,-14.39972 -20.75,-17.34646 L 396,453.78457 l -0.003,42.35772 c -0.003,40.89704 -0.76706,57.25538 -3.39046,72.61695 -1.2157,7.11868 -1.20019,7.2467 0.80103,6.61154 1.1224,-0.35624 11.50246,-5.25092 23.06679,-10.87706 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.93084,6.25 -0.72394,1.52442 2.08664,0.69037 3.36981,-1 z M 648.8358,445.41945 c -0.43634,-8.6407 -1.77985,-10.56835 -7.59452,-10.89643 l -3.93217,-0.22187 2.20527,4.09943 c 1.21289,2.25468 3.49106,7.13137 5.06259,10.83709 3.50029,8.25379 4.80918,7.08032 4.25883,-3.81822 z M 155.25,449.8129 213,445.56511 213,396.78256 213,348 l -4.98927,0 c -5.81465,0 -13.6739,-2.74297 -18.57904,-6.48431 -12.62962,-9.63308 -10.43809,-37.90372 4.14702,-53.49638 C 198.21475,283.06301 206.98687,278 210.93807,278 l 2.06193,0 0,-78.5 c 0,-43.175 0.3366,-78.5 0.748,-78.5 0.4114,0 41.43218,4.51778 91.15728,10.0395 l 90.40928,10.03951 11.09272,-10.83958 c 6.101,-5.96176 13.08622,-12.50454 15.52272,-14.5395 L 426.36,112 325.43,112.0327 c -56.74339,0.0184 -103.77567,0.44012 -107.43,0.96329 -20.24682,2.89862 -43.00789,10.09579 -54.08755,17.10275 -2.52315,1.59568 -4.92767,2.90124 -5.34337,2.90124 -0.4157,0 -4.87631,3.11609 -9.91245,6.92465 -10.31033,7.79713 -24.6751,22.02752 -29.92225,29.64233 C 109.35692,183.17581 100,201.11515 100,205.48503 c 0,0.87705 -0.846152,3.26422 -1.880338,5.30481 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723314,9.73576 -1.879737,18.48671 -2.149132,120.23089 l -0.290541,109.7309 2.77947,-0.45055 c 1.528708,-0.2478 28.76697,-2.36206 60.52947,-4.69834 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 1.48672,-1.9585 1.83846,-5.25 0.56103,-5.25 -0.69818,0 -1.77837,1.71749 -3.930842,6.25 -0.72394,1.52442 2.086642,0.69037 3.369812,-1 z m 32.87346,-143.64357 c -4.24772,-1.85085 -9.25984,-7.90845 -10.0563,-12.15395 -1.67243,-8.91481 3.70093,-22.46828 12.44706,-31.39575 4.62322,-4.71907 6.57753,-5.9717 10.94803,-7.0172 14.09869,-3.37267 26.75182,5.08918 26.45672,17.69307 -0.25941,11.07993 -11.02873,26.85585 -21.77692,31.90092 -5.65239,2.65316 -13.22412,3.062 -18.01859,0.97291 z m 15.85724,-3.71487 c 2.57189,-1.17183 9.90447,-15.39321 11.16964,-21.66329 2.40325,-11.91028 -6.24022,-20.85559 -17.69046,-18.30823 -7.97223,1.7736 -14.96525,13.23904 -15.63536,25.63504 -0.35276,6.52551 -0.17362,7.30198 2.38651,10.34453 1.52234,1.8092 3.7046,3.66839 4.84946,4.13154 3.04,1.22981 12.10076,1.14504 14.92021,-0.13959 z m 16.75196,-18.06917 c 1.17219,-2.29768 2.35993,-6.69946 2.63942,-9.78173 0.45657,-5.03514 0.23015,-5.93453 -2.23005,-8.85831 C 165.81577,200.99234 161.20455,198 158.97293,198 c -0.61951,0 0.31933,1.21649 2.08632,2.70331 1.76698,1.48682 3.82651,4.17236 4.57672,5.96788 1.58266,3.78783 1.8069,14.03377 0.38878,17.76371 -1.51029,3.97236 -0.3023,3.02946 2.06586,-1.61251 z m 487.37204,220.50247 c 0.76751,-4.65868 -0.38069,-7.67544 -3.57121,-9.38296 -2.84634,-1.52331 -3.59458,-0.37634 -1.36308,2.08944 1.22688,1.35568 1.99809,4.0987 2.29104,8.14864 0.47024,6.50107 1.48543,6.17265 2.64325,-0.85512 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.48813,7.3994 -6.50115,14.91876 -6.53711,24.4185 -0.0365,9.64895 2.29928,15.08571 7.9932,18.60474 4.23097,2.61489 11.26889,4.72784 16.08052,4.82777 L 213,344 l 0,-29.12019 z m 390.64501,16.96201 c 6.45755,-7.05007 8.17691,-15.34174 4.44897,-21.45531 -2.05099,-3.36348 -9.2261,-7.38881 -13.1597,-7.38277 -2.36134,0.004 -2.34312,0.0593 0.60834,1.85918 10.06523,6.13798 12.22538,16.80013 5.41047,26.70526 -2.31202,3.36041 -2.67216,4.34998 -1.31745,3.62003 1.0254,-0.55251 2.82961,-2.05839 4.00937,-3.34639 z M 563.5,288.46389 c -1.65,-0.75553 -4.125,-1.35776 -5.5,-1.33831 -1.69485,0.024 -1.05073,0.45048 2,1.32429 5.93416,1.6997 7.19239,1.70473 3.5,0.014 z m -9.25,-2.12617 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3552"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b2943d"
+       d="m 459.17065,733.75 -8.15255,-17.25 -84.62882,-0.25567 -84.62882,-0.25567 -7.63023,2.40354 C 239.16411,729.40664 196.72137,729.63311 163.8676,718.98056 151.06545,714.82957 134.31018,706.47376 123.5,698.84933 111.77688,690.58101 92.266504,671.00378 83.786753,659 63.562065,630.37029 51.948941,598.01713 46.424287,554.91138 45.297609,546.12056 44.677539,530.17514 44.298668,500.25 L 43.763755,458 47.731,458 c 2.181985,0 7.393851,-0.28965 11.581926,-0.64368 l 7.614682,-0.64367 0.288761,-113.10633 C 67.539416,217.07018 67.135338,224.56782 74.901985,201 79.998914,185.53342 82.328522,179.77413 85.678373,174.35848 87.230268,171.84956 90.075,167.23682 92,164.10796 c 12.76284,-20.74454 33.38975,-40.75873 56,-54.33656 6.82463,-4.0983 24.26862,-11.872247 33,-14.706508 1.925,-0.624867 9.575,-2.573495 17,-4.330285 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.40166,-2.212652 31.98894,-18.382598 39.99705,-22.623696 2.01349,-1.066347 2.64928,-0.309138 10.23759,12.192706 l 8.09078,13.329663 13.2624,0.607896 c 17.82153,0.816868 33.67664,3.758553 48.8356,9.06073 14.28552,4.996674 16.69209,6.127514 26.42681,12.417904 3.85,2.48779 9.475,6.11504 12.5,8.06055 6.10124,3.92398 7.25843,4.91802 21.31091,18.30632 5.39601,5.14096 12.13301,12.4972 14.97113,16.3472 C 671.20591,163.60553 683,184.07037 683,187.44933 c 0,0.8285 1.09557,3.87883 2.43461,6.77852 2.37403,5.14099 4.58888,13.00962 8.23948,29.27215 1.68134,7.48994 1.81577,18.6156 2.10858,174.5 l 0.31275,166.5 -2.16585,13.5 c -2.57135,16.02752 -9.73269,38.05257 -15.76955,48.5 -2.22465,3.85 -5.02529,8.8 -6.22365,11 -7.16896,13.16109 -26.4637,34.08894 -42.58021,46.1842 -10.85645,8.14764 -31.89364,19.08335 -45.85616,23.83728 -5.96004,2.02926 -31.05577,7.24893 -38.5,8.00762 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 -5.5,3.18227 -14.725,8.15634 -20.5,11.05349 C 497.34666,738.37547 469.24531,751 468.00223,751 c -0.37346,0 -4.34767,-7.7625 -8.83158,-17.25 z m 42.42474,-35.19527 C 555.28581,670.67652 591.6962,637.3476 610.9008,598.5 620.86629,578.34154 625.07526,563.25207 627.14615,540.25915 629.73153,511.55401 624.30763,484.6741 610.04324,455.5 592.85222,420.34023 566.61077,390.06495 523,355.0765 c -12.43843,-9.97922 -25.27499,-22.02697 -31.24975,-29.32946 -4.69015,-5.7324 -10.46149,-17.63862 -11.31771,-23.34835 -1.91995,-12.80314 8.86679,-29.10338 31.06746,-46.94719 8.31792,-6.68553 34.61027,-24.25484 46.29543,-30.93595 4.56248,-2.60865 8.16248,-5.06134 8,-5.45042 -0.68098,-1.63065 -66.05666,-108.76856 -67.68751,-110.92654 l -1.7846,-2.36141 -8.41166,4.74024 c -27.1775,15.31539 -62.3453,45.25749 -84.72243,72.13323 -21.46067,25.77504 -39.90719,63.12684 -44.61984,90.34935 -8.0369,46.42495 3.61462,88.4366 36.19291,130.5 10.29327,13.29014 28.97393,31.39973 46.24303,44.82936 10.88063,8.46152 25.36321,21.05273 32.98818,28.68006 11.83541,11.83905 18.84899,21.05529 24.28752,31.91519 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.55231 -0.23929,9.61143 -3.79878,16.81357 -7.24383,14.65689 -26.13314,30.20351 -54.94502,45.22184 -10.66143,5.55731 -12.60164,6.91608 -11.87376,8.31544 1.01263,1.9468 3.50616,7.22399 24.41591,51.67268 23.2893,49.50699 27.65101,58.5 28.37316,58.5 0.36256,0 7.97831,-3.80037 16.92388,-8.44527 z m -258.522,-8.09061 c 17.16402,-2.43588 37.1569,-10.08517 51.1647,-19.57566 8.73063,-5.91513 9.42532,-6.51622 21.80793,-18.86965 25.75723,-25.69652 39.59498,-55.61035 46.03613,-99.51881 0.75789,-5.16648 1.32954,-30.314 1.61395,-71 l 0.44038,-63 -7.65343,-11.42434 C 322.88513,356.92377 314.65208,295.15739 334.01017,238.47864 338.94723,224.02338 349.69711,201.89358 357.95133,189.19316 362.93019,181.53239 364,179.13795 364,175.65504 l 0,-4.23128 -55.25,-6.3296 c -30.3875,-3.48128 -56.70357,-6.55906 -58.48015,-6.8395 l -3.23015,-0.5099 -0.27155,192.37762 -0.27155,192.37762 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -5.56051,2.52566 -15.03913,2.49857 -19.22693,-0.0549 -11.35385,-6.92302 -18.28529,-39.56229 -18.31899,-86.26182 l -0.01,-13.70288 -4.75,0.48623 c -5.34781,0.54742 -80.77855,6.19908 -94.921094,7.11198 -5.044102,0.3256 -9.679521,0.90622 -10.300931,1.29027 -1.441221,0.89072 0.262139,39.46271 2.502703,56.67283 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 30.11936,31.52815 69.85795,43.68866 119.66755,36.6198 z m 121.9684,-4.03105 c 18.05217,-18.4924 39.75872,-18.87428 38.74952,-0.68171 l -0.29131,5.25137 17.70872,-0.001 17.70872,-10e-4 -6.2649,-13.25 c -3.4457,-7.2875 -14.54008,-30.91318 -24.65419,-52.5015 l -18.38929,-39.2515 -3.61013,12.2515 c -10.16149,34.48454 -28.978,64.7688 -53.56772,86.21466 L 324.9361,691 l 17.82374,0 17.82374,0 4.45821,-4.56693 z m 27.68737,-0.14361 c -0.64792,-5.7483 -3.67326,-8.75064 -7.95482,-7.89433 -3.42751,0.6855 -12.40149,6.38421 -15.69865,9.96904 L 366.65137,691 l 13.30437,0 13.30436,0 -0.53094,-4.71054 z m 6.75819,0.7854 c 0.74311,-4.39842 -0.46029,-7.45483 -3.59591,-9.13296 -2.80955,-1.50362 -3.60492,-0.38777 -1.43371,2.01139 0.97834,1.08105 2.0091,4.00881 2.29059,6.50613 0.62913,5.58164 1.85352,5.85675 2.73903,0.61544 z m 212.96831,-22.42712 c 7.072,-4.66267 27.93992,-25.16503 32.14159,-31.57855 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42606,-5.74419 4.12942,-6.56919 0.70336,-0.825 2.02432,-2.97153 2.93547,-4.77006 C 660.00305,607.12228 668,582.88765 668,580.15366 c 0,-1.34975 0.68852,-5.874 1.53004,-10.05388 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26371,-153.02215 -0.38701,-163.02493 -2.11413,-171.5 -2.81457,-13.81129 -8.495,-31.61894 -12.49141,-39.15952 -8.25827,-15.58202 -16.51917,-26.62877 -28.22855,-37.74817 C 616.14582,140.38672 607.69697,134.2432 592.84182,126.06658 585.68374,122.12662 563.64337,115.32955 554,114.0881 c -5.225,-0.67265 -10.2875,-1.37552 -11.25,-1.56193 -0.9625,-0.18641 -1.75,-0.202 -1.75,-0.0346 0,0.16736 16.19779,26.99244 35.9951,59.61128 19.7973,32.61885 35.6598,59.61735 35.25,59.99666 -0.40981,0.37932 -8.8451,5.1642 -18.7451,10.63307 -40.1856,22.199 -67.96417,41.62534 -75.85722,53.0491 l -2.85723,4.13531 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05918,0.85902 1.41096,0.91441 0.95207,0.14991 -1.09619,-1.82623 3.92255,-10.92272 9.05164,-16.40613 9.2868,-9.92835 23.31317,-13.09593 35.08575,-7.92344 5.84883,2.56979 11.51715,8.42331 13.25452,13.68757 0.6089,1.84498 1.24223,3.35451 1.40741,3.35451 0.16518,0 1.91582,-0.675 3.89033,-1.5 4.9151,-2.05366 14.22931,-1.87626 19.16282,0.36498 8.62122,3.91654 13.60089,13.21844 11.44824,21.38502 -4.54335,17.23628 -24.01745,27.95913 -38.7505,21.33685 l -4.25631,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 7.37762,-10.1845 -0.36805,-24.51575 -12.63206,-23.37218 -2.2,0.20514 -4.78125,0.72028 -5.7361,1.14474 -1.29932,0.57759 -1.96644,0.16591 -2.65163,-1.63627 -3.02675,-7.96096 -12.89441,-13.38534 -26.1958,-14.40016 -13.13542,-1.00215 -17.42206,1.73038 -23.48306,14.96935 l -2.64621,5.7801 2.3564,2.52925 c 1.29602,1.39109 6.6314,5.94976 11.8564,10.13038 37.35402,29.88763 64.3618,57.26248 83.14429,84.27434 4.04564,5.8182 8.93071,13.35413 10.85571,16.74651 2.45696,4.32983 3.94635,6.00101 4.99777,5.60776 13.22964,-4.9482 22.98863,-0.63672 22.99849,10.16063 0.006,6.64815 -6.89668,24.20416 -9.0045,22.90146 -0.51236,-0.31666 -0.24293,1.35495 0.59873,3.71468 C 657.05721,482.53646 661,507.51762 661,526.82745 661,556.45188 654.81316,582.84807 641.62288,609.5 631.15994,630.64112 619.12742,647.38218 600,667.41061 l -9.5,9.94751 7.95566,-4.36263 c 4.37561,-2.39945 10.67561,-6.15594 14,-8.34775 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.81211,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z M 416.47394,564.49372 c 23.67894,-11.51999 36.4268,-19.56198 44.60762,-28.14069 7.74629,-8.12306 8.16523,-9.09592 5.98746,-13.90419 -4.78336,-10.56114 -20.1454,-26.41791 -44.52614,-45.96009 -8.22641,-6.59381 -17.56391,-14.39972 -20.75,-17.34646 L 396,453.78457 l -0.003,42.35772 c -0.003,40.89704 -0.76706,57.25538 -3.39046,72.61695 -1.2157,7.11868 -1.20019,7.2467 0.80103,6.61154 1.1224,-0.35624 11.50246,-5.25092 23.06679,-10.87706 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.81211,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z m 236.2215,-62.95623 c -0.32308,-6.39804 -0.7238,-7.7898 -2.70467,-9.39381 -1.41101,-1.14257 -3.5792,-1.78802 -5.51401,-1.64147 l -3.18863,0.24151 2.14875,4 c 1.18182,2.2 3.43455,7.03195 5.00608,10.73767 3.51149,8.28019 4.809,7.07683 4.25248,-3.9439 z M 155.25,449.8129 213,445.56511 213,396.78256 213,348 l -4.98927,0 c -5.81465,0 -13.6739,-2.74297 -18.57904,-6.48431 -12.62962,-9.63308 -10.43809,-37.90372 4.14702,-53.49638 C 198.21475,283.06301 206.98687,278 210.93807,278 l 2.06193,0 0,-78.5 c 0,-43.175 0.3366,-78.5 0.748,-78.5 0.4114,0 41.43218,4.51778 91.15728,10.0395 l 90.40928,10.03951 11.09272,-10.83958 c 6.101,-5.96176 13.08622,-12.50454 15.52272,-14.5395 L 426.36,112 325.43,112.0327 c -56.74339,0.0184 -103.77567,0.44012 -107.43,0.96329 -20.24682,2.89862 -43.00789,10.09579 -54.08755,17.10275 -2.52315,1.59568 -4.92767,2.90124 -5.34337,2.90124 -0.4157,0 -4.87631,3.11609 -9.91245,6.92465 -10.31033,7.79713 -24.6751,22.02752 -29.92225,29.64233 C 109.35692,183.17581 100,201.11515 100,205.48503 c 0,0.87705 -0.846152,3.26422 -1.880338,5.30481 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723314,9.73576 -1.879737,18.48671 -2.149132,120.23089 l -0.290541,109.7309 2.77947,-0.45055 c 1.528708,-0.2478 28.76697,-2.36206 60.52947,-4.69834 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.812109,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z m 32.87346,-143.64357 c -4.24772,-1.85085 -9.25984,-7.90845 -10.0563,-12.15395 -1.67243,-8.91481 3.70093,-22.46828 12.44706,-31.39575 4.62322,-4.71907 6.57753,-5.9717 10.94803,-7.0172 14.09869,-3.37267 26.75182,5.08918 26.45672,17.69307 -0.25941,11.07993 -11.02873,26.85585 -21.77692,31.90092 -5.65239,2.65316 -13.22412,3.062 -18.01859,0.97291 z m 15.80248,-3.68992 c 2.63169,-1.19908 8.77647,-12.58519 10.71003,-19.84541 3.32696,-12.49222 -4.1792,-22.20301 -15.8282,-20.4771 -5.68545,0.84236 -10.26332,5.21363 -14.03962,13.406 -5.03782,10.92913 -3.89124,22.20016 2.67253,26.27128 3.1199,1.93509 12.82098,2.31479 16.48526,0.64523 z m 16.80672,-18.09412 c 1.17219,-2.29768 2.35993,-6.69946 2.63942,-9.78173 0.45657,-5.03514 0.23015,-5.93453 -2.23005,-8.85831 C 165.81577,200.99234 161.20455,198 158.97293,198 c -0.61951,0 0.31933,1.21649 2.08632,2.70331 1.76698,1.48682 3.82651,4.17236 4.57672,5.96788 1.58266,3.78783 1.8069,14.03377 0.38878,17.76371 -1.51029,3.97236 -0.3023,3.02946 2.06586,-1.61251 z m 487.37204,220.50247 c 0.76751,-4.65868 -0.38069,-7.67544 -3.57121,-9.38296 -2.84634,-1.52331 -3.59458,-0.37634 -1.36308,2.08944 1.22688,1.35568 1.99809,4.0987 2.29104,8.14864 0.47024,6.50107 1.48543,6.17265 2.64325,-0.85512 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.54257,7.48916 -6.55723,14.97596 -6.57087,24.4185 -0.0134,9.29186 1.88561,14.31575 6.70986,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29.12019 z m 390.64501,16.96201 c 6.45755,-7.05007 8.17691,-15.34174 4.44897,-21.45531 -2.05099,-3.36348 -9.2261,-7.38881 -13.1597,-7.38277 -2.36134,0.004 -2.34312,0.0593 0.60834,1.85918 10.06523,6.13798 12.22538,16.80013 5.41047,26.70526 -2.31202,3.36041 -2.67216,4.34998 -1.31745,3.62003 1.0254,-0.55251 2.82961,-2.05839 4.00937,-3.34639 z M 563.5,288.46389 c -1.65,-0.75553 -4.125,-1.35776 -5.5,-1.33831 -1.69485,0.024 -1.05073,0.45048 2,1.32429 5.93416,1.6997 7.19239,1.70473 3.5,0.014 z m -9.25,-2.12617 c -0.6875,-0.27741 -1.8125,-0.27741 -2.5,0 -0.6875,0.27741 -0.125,0.50439 1.25,0.50439 1.375,0 1.9375,-0.22698 1.25,-0.50439 z"
+       id="path3550"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#a69249"
+       d="m 459.17065,733.75 -8.15255,-17.25 -84.62882,-0.25567 -84.62882,-0.25567 -7.63023,2.40354 C 239.16411,729.40664 196.72137,729.63311 163.8676,718.98056 151.06545,714.82957 134.31018,706.47376 123.5,698.84933 111.77688,690.58101 92.266504,671.00378 83.786753,659 63.562065,630.37029 51.948941,598.01713 46.424287,554.91138 45.297609,546.12056 44.677539,530.17514 44.298668,500.25 L 43.763755,458 47.731,458 c 2.181985,0 7.393851,-0.28965 11.581926,-0.64368 l 7.614682,-0.64367 0.288761,-113.10633 C 67.539416,217.07018 67.135338,224.56782 74.901985,201 79.998914,185.53342 82.328522,179.77413 85.678373,174.35848 87.230268,171.84956 90.075,167.23682 92,164.10796 c 12.76284,-20.74454 33.38975,-40.75873 56,-54.33656 6.82463,-4.0983 24.26862,-11.872247 33,-14.706508 1.925,-0.624867 9.575,-2.573495 17,-4.330285 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.40166,-2.212652 31.98894,-18.382598 39.99705,-22.623696 2.01349,-1.066347 2.64928,-0.309138 10.23759,12.192706 l 8.09078,13.329663 13.2624,0.607896 c 17.82153,0.816868 33.67664,3.758553 48.8356,9.06073 14.28552,4.996674 16.69209,6.127514 26.42681,12.417904 3.85,2.48779 9.475,6.11504 12.5,8.06055 6.10124,3.92398 7.25843,4.91802 21.31091,18.30632 5.39601,5.14096 12.13301,12.4972 14.97113,16.3472 C 671.20591,163.60553 683,184.07037 683,187.44933 c 0,0.8285 1.09557,3.87883 2.43461,6.77852 2.37403,5.14099 4.58888,13.00962 8.23948,29.27215 1.68134,7.48994 1.81577,18.6156 2.10858,174.5 l 0.31275,166.5 -2.16585,13.5 c -2.57135,16.02752 -9.73269,38.05257 -15.76955,48.5 -2.22465,3.85 -5.02529,8.8 -6.22365,11 -7.16896,13.16109 -26.4637,34.08894 -42.58021,46.1842 -10.85645,8.14764 -31.89364,19.08335 -45.85616,23.83728 -5.96004,2.02926 -31.05577,7.24893 -38.5,8.00762 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 -5.5,3.18227 -14.725,8.15634 -20.5,11.05349 C 497.34666,738.37547 469.24531,751 468.00223,751 c -0.37346,0 -4.34767,-7.7625 -8.83158,-17.25 z m 42.63885,-35.30644 c 69.25599,-35.96048 110.13712,-81.55966 122.24598,-136.35426 3.24868,-14.70086 4.45502,-33.23877 3.07865,-47.31022 C 624.88836,491.81915 620.7385,477.43528 610.03164,455.5 592.89269,420.38722 566.67089,390.12888 523,355.07089 c -12.20974,-9.8017 -25.42208,-22.2189 -31.38617,-29.49728 -4.56795,-5.57458 -10.33418,-17.52597 -11.18129,-23.17492 -1.91995,-12.80314 8.86679,-29.10338 31.06746,-46.94719 8.31792,-6.68553 34.61027,-24.25484 46.29543,-30.93595 4.56248,-2.60865 8.16248,-5.06134 8,-5.45042 -0.67952,-1.62716 -66.05482,-108.76613 -67.68196,-110.91917 l -1.77903,-2.35405 -9.15133,5.15879 c -10.983,6.19134 -28.39068,18.54736 -41.8474,29.70342 -11.15168,9.2451 -33.30823,31.31041 -42.1702,41.99653 -15.76308,19.00776 -32.17363,48.24963 -39.48008,70.34935 -11.01056,33.30349 -9.91806,70.47396 3.01264,102.5 13.94153,34.52961 38.01987,64.6098 74.30726,92.82936 19.67023,15.29691 39.05354,33.62582 47.7757,45.17682 2.90457,3.8466 7.17957,10.78489 9.5,15.41843 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.55231 -0.23929,9.61143 -3.79878,16.81357 -7.24383,14.65689 -26.13314,30.20351 -54.94502,45.22184 -10.66143,5.55731 -12.60164,6.91608 -11.87376,8.31544 1.06185,2.04144 4.51174,9.34893 24.39482,51.67268 22.27063,47.40597 27.65585,58.5 28.39686,58.5 0.36113,0 8.07205,-3.8504 17.13538,-8.55644 z M 229,691.99049 c 15.8843,-1.1821 21.22744,-2.15888 34,-6.21557 13.35574,-4.24191 30.93651,-13.41284 38.72908,-20.20285 11.24167,-9.79537 14.78905,-13.17196 20.18111,-19.20948 21.55066,-24.13044 34.27811,-53.86354 40.17851,-93.86259 0.76776,-5.20473 1.33059,-30.01272 1.61079,-71 l 0.43069,-63 -7.65028,-11.42434 c -33.59778,-50.17234 -41.8272,-111.9201 -22.46973,-168.59702 4.93706,-14.45526 15.68694,-36.58506 23.94116,-49.28548 C 362.93019,181.53239 364,179.13795 364,175.65504 l 0,-4.23128 -55.25,-6.3296 c -30.3875,-3.48128 -56.70357,-6.55906 -58.48015,-6.8395 l -3.23015,-0.5099 -0.27155,192.37762 -0.27155,192.37762 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.91103,2.23066 -14.52878,2.46859 -18.42125,0.45572 -11.93081,-6.16967 -19.09011,-38.6834 -19.12467,-86.85403 l -0.01,-13.78445 -4.75,0.55684 c -2.6125,0.30626 -23.425,1.94143 -46.25,3.6337 -22.825,1.69228 -45.40549,3.37519 -50.178866,3.73981 -4.773376,0.36462 -8.957904,0.94198 -9.298951,1.28302 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80531 10.00793,0.88235 0.55,0.077 7.075,-0.31202 14.5,-0.86458 z m 136.04179,-5.55742 c 18.05217,-18.4924 39.75872,-18.87428 38.74952,-0.68171 l -0.29131,5.25137 17.68605,-0.001 17.68606,-10e-4 -9.49993,-20.25 c -5.22497,-11.1375 -16.33133,-34.82451 -24.68081,-52.63779 -14.53817,-31.01662 -15.21818,-32.24437 -16.062,-29 -2.84005,10.91953 -10.39494,31.76026 -14.67318,40.47706 -9.84478,20.05845 -26.91618,42.48392 -42.37176,55.66073 l -6.74439,5.75 17.87177,0 17.87177,0 4.45821,-4.56693 z m 27.68737,-0.14361 c -0.64792,-5.7483 -3.67326,-8.75064 -7.95482,-7.89433 -3.42751,0.6855 -12.40149,6.38421 -15.69865,9.96904 L 366.65137,691 l 13.30437,0 13.30436,0 -0.53094,-4.71054 z m 6.82051,1.29748 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.08073,-2.01857 -4.30162,-0.99945 -1.93522,1.61539 0.97834,1.08105 2.0091,4.00881 2.29059,6.50613 0.60621,5.37836 1.90576,5.90142 2.80135,1.12752 z m 212.90599,-22.9392 c 7.072,-4.66267 27.93992,-25.16503 32.14159,-31.57855 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42789,-5.74419 4.13349,-6.56919 1.79821,-2.10249 5.09208,-8.84131 6.35428,-13 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26371,-153.02215 -0.38701,-163.02493 -2.11413,-171.5 -2.81457,-13.81129 -8.495,-31.61894 -12.49141,-39.15952 C 643.18792,164.83691 625.614,145.95253 602.58095,131.75054 588.62693,123.1466 569.33305,116.11746 554,114.05153 c -4.675,-0.62989 -9.5125,-1.28677 -10.75,-1.45972 -1.2375,-0.17296 -2.25,-0.18707 -2.25,-0.0314 0,0.1557 16.1995,26.9588 35.99889,59.56244 19.79938,32.60364 35.66188,59.5914 35.25,59.9728 -0.41189,0.3814 -9.01333,5.2588 -19.11431,10.83868 -40.01903,22.10687 -67.53142,41.37277 -75.49785,52.86834 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05918,0.85902 1.41096,0.91441 0.95207,0.14991 -1.09619,-1.82623 3.92255,-10.92272 9.05164,-16.40613 9.2868,-9.92835 23.31317,-13.09593 35.08575,-7.92344 5.84883,2.56979 11.51715,8.42331 13.25452,13.68757 0.6089,1.84498 1.24223,3.35451 1.40741,3.35451 0.16518,0 1.91582,-0.675 3.89033,-1.5 4.9151,-2.05366 14.22931,-1.87626 19.16282,0.36498 8.62122,3.91654 13.60089,13.21844 11.44824,21.38502 -4.54335,17.23628 -24.01745,27.95913 -38.7505,21.33685 l -4.25631,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 7.37762,-10.1845 -0.36805,-24.51575 -12.63206,-23.37218 -2.2,0.20514 -4.78125,0.72028 -5.7361,1.14474 -1.29932,0.57759 -1.96644,0.16591 -2.65163,-1.63627 -3.02675,-7.96096 -12.89441,-13.38534 -26.1958,-14.40016 -13.13542,-1.00215 -17.42206,1.73038 -23.48306,14.96935 l -2.64621,5.7801 2.3564,2.56016 c 1.29602,1.4081 7.9814,7.06917 14.8564,12.58018 19.2834,15.45758 30.29951,25.32734 45.07329,40.3829 20.07091,20.45372 34.70807,38.89171 45.02449,56.71599 3.12628,5.40148 4.83633,7.44409 5.89999,7.0474 13.24728,-4.94057 22.98863,-0.6362 22.99849,10.16224 0.006,6.62384 -6.89478,24.20533 -8.99198,22.90919 -0.50548,-0.3124 -0.0577,1.93556 0.99507,4.99547 6.23202,18.11367 9.49206,42.42382 8.71496,64.98742 -1.7,49.36066 -20.71766,91.75089 -59.4863,132.59454 l -10.72801,11.3022 7.95566,-4.3747 c 4.37561,-2.40609 10.67561,-6.16802 14,-8.35983 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.81211,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z M 416.5,564.49472 c 23.64185,-11.50714 36.39617,-19.55818 44.58156,-28.14169 7.74629,-8.12306 8.16523,-9.09592 5.98746,-13.90419 -4.79519,-10.58726 -20.39511,-26.69968 -44.46941,-45.93035 -8.19521,-6.54637 -17.53271,-14.33957 -20.75,-17.31821 L 396,453.78457 l -0.003,42.35772 c -0.003,40.89704 -0.76706,57.25538 -3.39046,72.61695 -1.22008,7.14433 -1.20699,7.24893 0.82709,6.608 1.13673,-0.35818 11.51679,-5.25081 23.06679,-10.87252 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.81211,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z m 236.2215,-62.95623 c -0.32308,-6.39804 -0.7238,-7.7898 -2.70467,-9.39381 -1.39232,-1.12744 -3.5892,-1.79028 -5.47508,-1.65195 l -3.1497,0.23104 4.10687,8.51048 c 2.25877,4.68076 4.44986,9.59627 4.86909,10.92336 1.41057,4.46532 2.76394,-0.49108 2.35349,-8.61912 z M 155.25,449.8129 213,445.56511 213,396.78256 213,348 l -4.98927,0 c -5.81465,0 -13.6739,-2.74297 -18.57904,-6.48431 -12.62962,-9.63308 -10.43809,-37.90372 4.14702,-53.49638 C 198.21475,283.06301 206.98687,278 210.93807,278 l 2.06193,0 0,-78.5 c 0,-43.85807 0.384,-78.5 0.87016,-78.5 0.47859,0 33.21609,3.61243 72.75,8.02762 39.53391,4.41519 80.17575,8.9205 90.31519,10.01181 l 18.43535,1.98419 11.06465,-10.81188 C 412.52091,124.2652 419.4935,117.73489 421.93,115.69993 L 426.36,112 325.43,112.0327 c -56.74339,0.0184 -103.77567,0.44012 -107.43,0.96329 -20.12023,2.8805 -42.42931,9.91371 -54.26502,17.10771 -2.62077,1.59295 -5.02528,2.89628 -5.34337,2.89628 -0.3181,0 -4.69884,3.11609 -9.73498,6.92465 -10.31033,7.79713 -24.6751,22.02752 -29.92225,29.64233 C 109.35692,183.17581 100,201.11515 100,205.48503 c 0,0.87705 -0.846152,3.26422 -1.880338,5.30481 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723314,9.73576 -1.879737,18.48671 -2.149132,120.23089 l -0.290541,109.7309 2.77947,-0.45055 c 1.528708,-0.2478 28.76697,-2.36206 60.52947,-4.69834 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.812109,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z m 32.87346,-143.64357 c -4.24772,-1.85085 -9.25984,-7.90845 -10.0563,-12.15395 -1.67243,-8.91481 3.70093,-22.46828 12.44706,-31.39575 4.62322,-4.71907 6.57753,-5.9717 10.94803,-7.0172 14.09869,-3.37267 26.75182,5.08918 26.45672,17.69307 -0.25941,11.07993 -11.02873,26.85585 -21.77692,31.90092 -5.65239,2.65316 -13.22412,3.062 -18.01859,0.97291 z m 15.80248,-3.68992 c 2.63169,-1.19908 8.77647,-12.58519 10.71003,-19.84541 3.32696,-12.49222 -4.1792,-22.20301 -15.8282,-20.4771 -5.68545,0.84236 -10.26332,5.21363 -14.03962,13.406 -5.03782,10.92913 -3.89124,22.20016 2.67253,26.27128 3.1199,1.93509 12.82098,2.31479 16.48526,0.64523 z m 16.80672,-18.09412 c 1.17219,-2.29768 2.35993,-6.69946 2.63942,-9.78173 0.45657,-5.03514 0.23015,-5.93453 -2.23005,-8.85831 C 165.81577,200.99234 161.20455,198 158.97293,198 c -0.61951,0 0.20439,1.11977 1.83089,2.48838 1.6265,1.36861 3.68602,4.02411 4.57672,5.90113 1.80868,3.8115 2.17325,14.02371 0.64421,18.04539 -1.51029,3.97236 -0.3023,3.02946 2.06586,-1.61251 z m 487.4766,220.54198 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.84634,-1.52331 -3.59458,-0.37634 -1.36308,2.08944 1.22383,1.35232 1.99784,4.09523 2.28815,8.10868 0.47725,6.59796 1.68694,6.25685 2.7507,-0.77565 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.54257,7.48916 -6.55723,14.97596 -6.57087,24.4185 -0.0134,9.29186 1.88561,14.31575 6.70986,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29.12019 z m 391.13584,16.45625 c 6.08302,-6.54509 7.76566,-15.85691 3.85718,-21.34586 -2.27807,-3.19926 -9.41931,-7.00525 -13.05874,-6.95979 -2.31989,0.029 -2.3403,0.0824 -0.43428,1.13657 10.54482,5.83213 13.32618,17.4115 6.54847,27.26257 -3.57329,5.19361 -1.77589,5.13917 3.08737,-0.0935 z M 563.5,288.53309 c -3.79234,-1.6481 -13.50236,-2.99882 -13.49283,-1.87693 0.004,0.46411 2.19277,0.94821 4.86404,1.07577 2.67127,0.12756 5.93055,0.66153 7.24283,1.18661 3.61052,1.44466 4.8219,1.10776 1.38596,-0.38545 z"
+       id="path3548"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b0923c"
+       d="m 459.17065,733.75 -8.15255,-17.25 -84.62882,-0.25567 -84.62882,-0.25567 -7.63023,2.40354 C 239.16411,729.40664 196.72137,729.63311 163.8676,718.98056 151.06545,714.82957 134.31018,706.47376 123.5,698.84933 111.77688,690.58101 92.266504,671.00378 83.786753,659 63.562065,630.37029 51.948941,598.01713 46.424287,554.91138 45.297609,546.12056 44.677539,530.17514 44.298668,500.25 L 43.763755,458 47.731,458 c 2.181985,0 7.393851,-0.28965 11.581926,-0.64368 l 7.614682,-0.64367 0.288761,-113.10633 C 67.539416,217.07018 67.135338,224.56782 74.901985,201 79.998914,185.53342 82.328522,179.77413 85.678373,174.35848 87.230268,171.84956 90.075,167.23682 92,164.10796 c 12.76284,-20.74454 33.38975,-40.75873 56,-54.33656 6.82463,-4.0983 24.26862,-11.872247 33,-14.706508 1.925,-0.624867 9.575,-2.573495 17,-4.330285 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.40166,-2.212652 31.98894,-18.382598 39.99705,-22.623696 2.01349,-1.066347 2.64928,-0.309138 10.23759,12.192706 l 8.09078,13.329663 13.2624,0.607896 c 17.82153,0.816868 33.67664,3.758553 48.8356,9.06073 14.28552,4.996674 16.69209,6.127514 26.42681,12.417904 3.85,2.48779 9.475,6.11504 12.5,8.06055 6.10124,3.92398 7.25843,4.91802 21.31091,18.30632 5.39601,5.14096 12.13301,12.4972 14.97113,16.3472 C 671.20591,163.60553 683,184.07037 683,187.44933 c 0,0.8285 1.09557,3.87883 2.43461,6.77852 2.37403,5.14099 4.58888,13.00962 8.23948,29.27215 1.68134,7.48994 1.81577,18.6156 2.10858,174.5 l 0.31275,166.5 -2.16585,13.5 c -2.57135,16.02752 -9.73269,38.05257 -15.76955,48.5 -2.22465,3.85 -5.02529,8.8 -6.22365,11 -7.16896,13.16109 -26.4637,34.08894 -42.58021,46.1842 -10.85645,8.14764 -31.89364,19.08335 -45.85616,23.83728 -5.96004,2.02926 -31.05577,7.24893 -38.5,8.00762 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 -5.5,3.18227 -14.725,8.15634 -20.5,11.05349 C 497.34666,738.37547 469.24531,751 468.00223,751 c -0.37346,0 -4.34767,-7.7625 -8.83158,-17.25 z m 42.63885,-35.30644 c 69.25599,-35.96048 110.13712,-81.55966 122.24598,-136.35426 3.24868,-14.70086 4.45502,-33.23877 3.07865,-47.31022 C 624.88836,491.81915 620.7385,477.43528 610.03164,455.5 592.89269,420.38722 566.67089,390.12888 523,355.07089 c -12.20974,-9.8017 -25.42208,-22.2189 -31.38617,-29.49728 -4.56795,-5.57458 -10.33418,-17.52597 -11.18129,-23.17492 -1.91995,-12.80314 8.86679,-29.10338 31.06746,-46.94719 8.31792,-6.68553 34.61027,-24.25484 46.29543,-30.93595 4.56248,-2.60865 8.16248,-5.06134 8,-5.45042 -0.67952,-1.62716 -66.05482,-108.76613 -67.68196,-110.91917 l -1.77903,-2.35405 -9.15133,5.15879 c -10.983,6.19134 -28.39068,18.54736 -41.8474,29.70342 -11.15168,9.2451 -33.30823,31.31041 -42.1702,41.99653 -15.76308,19.00776 -32.17363,48.24963 -39.48008,70.34935 -11.01056,33.30349 -9.91806,70.47396 3.01264,102.5 13.94153,34.52961 38.01987,64.6098 74.30726,92.82936 19.67023,15.29691 39.05354,33.62582 47.7757,45.17682 2.90457,3.8466 7.17957,10.78489 9.5,15.41843 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.55231 -0.23929,9.61143 -3.79878,16.81357 -7.24383,14.65689 -26.13314,30.20351 -54.94502,45.22184 -10.66143,5.55731 -12.60164,6.91608 -11.87376,8.31544 1.06185,2.04144 4.51174,9.34893 24.39482,51.67268 22.27063,47.40597 27.65585,58.5 28.39686,58.5 0.36113,0 8.07205,-3.8504 17.13538,-8.55644 z M 229,691.99049 c 15.8843,-1.1821 21.22744,-2.15888 34,-6.21557 13.35574,-4.24191 30.93651,-13.41284 38.72908,-20.20285 11.24167,-9.79537 14.78905,-13.17196 20.18111,-19.20948 21.55066,-24.13044 34.27811,-53.86354 40.17851,-93.86259 0.76776,-5.20473 1.33059,-30.01272 1.61079,-71 l 0.43069,-63 -7.65028,-11.42434 c -33.59778,-50.17234 -41.8272,-111.9201 -22.46973,-168.59702 4.93706,-14.45526 15.68694,-36.58506 23.94116,-49.28548 C 362.93019,181.53239 364,179.13795 364,175.65504 l 0,-4.23128 -55.25,-6.3296 c -30.3875,-3.48128 -56.70357,-6.55906 -58.48015,-6.8395 l -3.23015,-0.5099 -0.27155,192.37762 -0.27155,192.37762 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.91103,2.23066 -14.52878,2.46859 -18.42125,0.45572 -11.93081,-6.16967 -19.09011,-38.6834 -19.12467,-86.85403 l -0.01,-13.78445 -4.75,0.55684 c -2.6125,0.30626 -23.425,1.94143 -46.25,3.6337 -22.825,1.69228 -45.40549,3.37519 -50.178866,3.73981 -4.773376,0.36462 -8.957904,0.94198 -9.298951,1.28302 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80531 10.00793,0.88235 0.55,0.077 7.075,-0.31202 14.5,-0.86458 z m 136.04179,-5.54838 c 18.21077,-18.61793 40.28632,-18.60876 38.80502,0.0161 L 403.48559,691 l 17.69326,0 17.69326,0 -9.49993,-20.25 c -5.22497,-11.1375 -16.33133,-34.82451 -24.68081,-52.63779 -14.53817,-31.01662 -15.21818,-32.24437 -16.062,-29 -2.84005,10.91953 -10.39494,31.76026 -14.67318,40.47706 -9.84478,20.05845 -26.91618,42.48392 -42.37176,55.66073 l -6.74439,5.75 17.87177,0 17.87177,0 4.45821,-4.55789 z m 27.68737,-0.15265 c -0.64792,-5.7483 -3.67326,-8.75064 -7.95482,-7.89433 -3.42751,0.6855 -12.40149,6.38421 -15.69865,9.96904 L 366.65137,691 l 13.30437,0 13.30436,0 -0.53094,-4.71054 z m 6.82051,1.29748 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.08073,-2.01857 -4.30162,-0.99945 -1.93522,1.61539 0.97834,1.08105 2.0091,4.00881 2.29059,6.50613 0.60621,5.37836 1.90576,5.90142 2.80135,1.12752 z m 212.90599,-22.9392 c 7.072,-4.66267 27.93992,-25.16503 32.14159,-31.57855 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42789,-5.74419 4.13349,-6.56919 1.79821,-2.10249 5.09208,-8.84131 6.35428,-13 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26371,-153.02215 -0.38701,-163.02493 -2.11413,-171.5 -2.81457,-13.81129 -8.495,-31.61894 -12.49141,-39.15952 C 643.18792,164.83691 625.614,145.95253 602.58095,131.75054 588.62693,123.1466 569.33305,116.11746 554,114.05153 c -4.675,-0.62989 -9.5125,-1.28677 -10.75,-1.45972 -1.2375,-0.17296 -2.25,-0.18707 -2.25,-0.0314 0,0.1557 16.1995,26.9588 35.99889,59.56244 19.79938,32.60364 35.66188,59.5914 35.25,59.9728 -0.41189,0.3814 -9.01333,5.2588 -19.11431,10.83868 -40.01903,22.10687 -67.53142,41.37277 -75.49785,52.86834 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.1559,0.93746 1.4457,0.97263 0.9291,0.11275 -1.26223,-2.101 5.35579,-13.03953 11.0227,-18.21876 6.32619,-5.78178 13.33491,-8.4781 21.84416,-8.40363 11.05059,0.0967 21.55592,6.95143 24.54802,16.01755 0.6089,1.84498 1.24223,3.35451 1.40741,3.35451 0.16518,0 1.91582,-0.675 3.89033,-1.5 4.9151,-2.05366 14.22931,-1.87626 19.16282,0.36498 8.62122,3.91654 13.60089,13.21844 11.44824,21.38502 -4.54716,17.25074 -24.03529,27.97766 -38.76371,21.33685 l -4.2431,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 7.37762,-10.1845 -0.36805,-24.51575 -12.63206,-23.37218 -2.2,0.20514 -4.78125,0.72028 -5.7361,1.14474 -1.29932,0.57759 -1.96644,0.16591 -2.65163,-1.63627 -3.02675,-7.96096 -12.89441,-13.38534 -26.1958,-14.40016 -13.13542,-1.00215 -17.42206,1.73038 -23.48306,14.96935 l -2.64621,5.7801 2.3564,2.56016 c 1.29602,1.4081 7.9814,7.06917 14.8564,12.58018 19.2834,15.45758 30.29951,25.32734 45.07329,40.3829 19.8063,20.18406 33.46246,37.31949 44.49572,55.83218 2.62232,4.4 4.8687,8.13913 4.99194,8.30918 0.12324,0.17005 2.75494,-0.42656 5.84821,-1.3258 C 652.60206,426.22952 660,430.76881 660,440.8905 c 0,6.38098 -6.95817,23.87142 -8.99572,22.61214 -0.50548,-0.3124 -0.0577,1.93556 0.99507,4.99547 6.23202,18.11367 9.49206,42.42382 8.71496,64.98742 -1.7,49.36066 -20.71766,91.75089 -59.4863,132.59454 l -10.72801,11.3022 7.95566,-4.3747 c 4.37561,-2.40609 10.67561,-6.16802 14,-8.35983 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.81211,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z M 416.5,564.49472 c 23.64185,-11.50714 36.39617,-19.55818 44.58156,-28.14169 7.74629,-8.12306 8.16523,-9.09592 5.98746,-13.90419 -4.79519,-10.58726 -20.39511,-26.69968 -44.46941,-45.93035 -8.19521,-6.54637 -17.53271,-14.33957 -20.75,-17.31821 L 396,453.78457 l -0.003,42.35772 c -0.003,40.89704 -0.76706,57.25538 -3.39046,72.61695 -1.22008,7.14433 -1.20699,7.24893 0.82709,6.608 1.13673,-0.35818 11.51679,-5.25081 23.06679,-10.87252 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.81211,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z m 236.2215,-62.95623 c -0.32308,-6.39804 -0.7238,-7.7898 -2.70467,-9.39381 -1.39232,-1.12744 -3.5892,-1.79028 -5.47508,-1.65195 l -3.1497,0.23104 4.10687,8.51048 c 2.25877,4.68076 4.44986,9.59627 4.86909,10.92336 1.41057,4.46532 2.76394,-0.49108 2.35349,-8.61912 z M 155.25,449.8129 213,445.56511 213,396.78256 213,348 l -4.98927,0 c -5.81465,0 -13.6739,-2.74297 -18.57904,-6.48431 -7.03855,-5.36856 -9.72036,-15.94693 -7.45209,-29.39473 2.65309,-15.72929 13.04884,-29.34088 25.11735,-32.88718 l 5.90028,-1.73378 0.001,-78.25 c 7.8e-4,-43.71521 0.38543,-78.25 0.87155,-78.25 0.47859,0 33.21609,3.61243 72.75,8.02762 39.53391,4.41519 80.17575,8.9205 90.31519,10.01181 l 18.43535,1.98419 11.06465,-10.81188 C 412.52091,124.2652 419.4935,117.73489 421.93,115.69993 L 426.36,112 325.43,112.0327 c -56.74339,0.0184 -103.77567,0.44012 -107.43,0.96329 -20.12023,2.8805 -42.42931,9.91371 -54.26502,17.10771 -2.62077,1.59295 -5.02528,2.89628 -5.34337,2.89628 -0.3181,0 -4.69884,3.11609 -9.73498,6.92465 -10.31033,7.79713 -24.6751,22.02752 -29.92225,29.64233 C 109.35692,183.17581 100,201.11515 100,205.48503 c 0,0.87705 -0.846152,3.26422 -1.880338,5.30481 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723314,9.73576 -1.879737,18.48671 -2.149132,120.23089 l -0.290541,109.7309 2.77947,-0.45055 c 1.528708,-0.2478 28.76697,-2.36206 60.52947,-4.69834 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.812109,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z m 32.87346,-143.64357 c -4.24772,-1.85085 -9.25984,-7.90845 -10.0563,-12.15395 -2.1442,-11.42954 7.91129,-30.91777 18.93206,-36.69164 9.18981,-4.81462 22.99635,-1.71706 28.34036,6.35829 5.46598,8.25965 1.76997,22.18675 -8.89898,33.53269 -8.65551,9.20473 -19.71603,12.70236 -28.31714,8.95461 z m 15.80248,-3.68992 c 2.63169,-1.19908 8.77647,-12.58519 10.71003,-19.84541 3.32696,-12.49222 -4.1792,-22.20301 -15.8282,-20.4771 -5.68545,0.84236 -10.26332,5.21363 -14.03962,13.406 -5.03782,10.92913 -3.89124,22.20016 2.67253,26.27128 3.1199,1.93509 12.82098,2.31479 16.48526,0.64523 z m 16.80672,-18.09412 c 1.17219,-2.29768 2.35993,-6.69946 2.63942,-9.78173 0.45657,-5.03514 0.23015,-5.93453 -2.23005,-8.85831 C 165.81577,200.99234 161.20455,198 158.97293,198 c -0.61951,0 0.20439,1.11977 1.83089,2.48838 1.6265,1.36861 3.68602,4.02411 4.57672,5.90113 1.80868,3.8115 2.17325,14.02371 0.64421,18.04539 -1.51029,3.97236 -0.3023,3.02946 2.06586,-1.61251 z m 487.4766,220.54198 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.84634,-1.52331 -3.59458,-0.37634 -1.36308,2.08944 1.22383,1.35232 1.99784,4.09523 2.28815,8.10868 0.47725,6.59796 1.68694,6.25685 2.7507,-0.77565 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.54257,7.48916 -6.55723,14.97596 -6.57087,24.4185 -0.0134,9.29186 1.88561,14.31575 6.70986,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29.12019 z m 391.13584,16.45625 c 6.08302,-6.54509 7.76566,-15.85691 3.85718,-21.34586 -2.27807,-3.19926 -9.41931,-7.00525 -13.05874,-6.95979 -2.31989,0.029 -2.3403,0.0824 -0.43428,1.13657 10.54482,5.83213 13.32618,17.4115 6.54847,27.26257 -3.57329,5.19361 -1.77589,5.13917 3.08737,-0.0935 z M 563.5,288.53309 c -3.79234,-1.6481 -13.50236,-2.99882 -13.49283,-1.87693 0.004,0.46411 2.19277,0.94821 4.86404,1.07577 2.67127,0.12756 5.93055,0.66153 7.24283,1.18661 3.61052,1.44466 4.8219,1.10776 1.38596,-0.38545 z"
+       id="path3546"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ae913b"
+       d="m 459.17065,733.75 -8.15255,-17.25 -84.62882,-0.25567 -84.62882,-0.25567 -7.63023,2.40354 C 239.16411,729.40664 196.72137,729.63311 163.8676,718.98056 151.06545,714.82957 134.31018,706.47376 123.5,698.84933 111.77688,690.58101 92.266504,671.00378 83.786753,659 63.562065,630.37029 51.948941,598.01713 46.424287,554.91138 45.297609,546.12056 44.677539,530.17514 44.298668,500.25 L 43.763755,458 47.731,458 c 2.181985,0 7.393851,-0.28965 11.581926,-0.64368 l 7.614682,-0.64367 0.288761,-113.10633 C 67.539416,217.07018 67.135338,224.56782 74.901985,201 79.998914,185.53342 82.328522,179.77413 85.678373,174.35848 87.230268,171.84956 90.075,167.23682 92,164.10796 c 12.76284,-20.74454 33.38975,-40.75873 56,-54.33656 6.82463,-4.0983 24.26862,-11.872247 33,-14.706508 1.925,-0.624867 9.575,-2.573495 17,-4.330285 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.40166,-2.212652 31.98894,-18.382598 39.99705,-22.623696 2.01349,-1.066347 2.64928,-0.309138 10.23759,12.192706 l 8.09078,13.329663 13.2624,0.607896 c 17.82153,0.816868 33.67664,3.758553 48.8356,9.06073 14.28552,4.996674 16.69209,6.127514 26.42681,12.417904 3.85,2.48779 9.475,6.11504 12.5,8.06055 6.10124,3.92398 7.25843,4.91802 21.31091,18.30632 5.39601,5.14096 12.13301,12.4972 14.97113,16.3472 C 671.20591,163.60553 683,184.07037 683,187.44933 c 0,0.8285 1.09557,3.87883 2.43461,6.77852 2.37403,5.14099 4.58888,13.00962 8.23948,29.27215 1.68134,7.48994 1.81577,18.6156 2.10858,174.5 l 0.31275,166.5 -2.16585,13.5 c -2.57135,16.02752 -9.73269,38.05257 -15.76955,48.5 -2.22465,3.85 -5.02529,8.8 -6.22365,11 -7.16896,13.16109 -26.4637,34.08894 -42.58021,46.1842 -10.85645,8.14764 -31.89364,19.08335 -45.85616,23.83728 -5.96004,2.02926 -31.05577,7.24893 -38.5,8.00762 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 -5.5,3.18227 -14.725,8.15634 -20.5,11.05349 C 497.34666,738.37547 469.24531,751 468.00223,751 c -0.37346,0 -4.34767,-7.7625 -8.83158,-17.25 z M 501.8095,698.44356 C 571.06549,662.48308 611.94662,616.8839 624.05548,562.0893 632.00753,526.10492 627.25498,490.04995 609.96032,455.15714 592.52459,419.9797 566.39885,389.9105 523,355.07089 c -12.45451,-9.99819 -26.11267,-22.873 -30.58864,-28.83425 -1.5431,-2.05515 -3.13337,-3.96746 -3.53394,-4.24958 -1.62834,-1.14682 -7.84009,-15.5553 -8.44488,-19.58837 -1.91995,-12.80314 8.86679,-29.10338 31.06746,-46.94719 8.31792,-6.68553 34.61027,-24.25484 46.29543,-30.93595 4.56248,-2.60865 8.16248,-5.07297 8,-5.47627 C 565.16805,217.48209 499.792,110.371 498.10637,108.13859 l -1.78305,-2.36141 -8.41166,4.75152 c -30.12402,17.01625 -69.11381,51.027 -89.35236,77.94196 -20.65284,27.46593 -35.56986,58.99702 -39.98991,84.52934 -9.91683,57.28432 10.83249,110.19933 61.98203,158.06689 5.40988,5.06276 9.60044,8.58432 22.5299,18.93311 21.13493,16.91648 37.0288,32.0715 45.83787,43.707 2.82858,3.73615 7.04141,10.58407 9.36184,15.21761 4.03512,8.05749 4.21897,8.82234 4.21897,17.55186 0,8.55231 -0.23929,9.61143 -3.79878,16.81357 -7.24383,14.65689 -26.13314,30.20351 -54.94502,45.22184 -10.66143,5.55731 -12.60164,6.91608 -11.87376,8.31544 1.17652,2.26189 6.18675,12.88159 23.90671,50.67268 21.09007,44.97851 28.14121,59.5 28.89113,59.5 0.35774,0 8.06589,-3.8504 17.12922,-8.55644 z M 229.5,691.95271 c 20.47913,-1.52006 35.07047,-5.29821 51,-13.20548 15.40912,-7.64895 27.89576,-17.38425 41.30414,-32.20308 17.704,-19.56631 31.30716,-47.51669 37.13097,-76.29292 4.09244,-20.22127 4.32558,-24.56428 4.76438,-88.75123 l 0.43069,-63 -7.65028,-11.42434 c -33.59778,-50.17234 -41.8272,-111.9201 -22.46973,-168.59702 4.93706,-14.45526 15.68694,-36.58506 23.94116,-49.28548 C 362.93019,181.53239 364,179.13795 364,175.65504 l 0,-4.23128 -55.25,-6.3296 c -30.3875,-3.48128 -56.70357,-6.55906 -58.48015,-6.8395 l -3.23015,-0.5099 -0.27155,192.37762 -0.27155,192.37762 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.91103,2.23066 -14.52878,2.46859 -18.42125,0.45572 -5.58655,-2.88892 -10.58136,-12.59176 -13.93667,-27.07315 -2.97722,-12.84961 -4.12554,-24.82747 -4.86632,-50.75975 l -0.65025,-22.7633 -4.59066,0.5357 c -2.52486,0.29463 -23.26566,1.92029 -46.09066,3.61256 -22.825,1.69228 -45.40549,3.37519 -50.178866,3.73981 -4.773376,0.36462 -8.957904,0.94198 -9.298951,1.28302 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 135.54179,-5.5106 c 18.21077,-18.61793 40.28632,-18.60876 38.80502,0.0161 L 403.48559,691 l 17.69326,0 17.69326,0 -9.49993,-20.25 c -5.22497,-11.1375 -16.33133,-34.82451 -24.68081,-52.63779 -14.53817,-31.01662 -15.21818,-32.24437 -16.062,-29 -2.84005,10.91953 -10.39494,31.76026 -14.67318,40.47706 -9.84478,20.05845 -26.91618,42.48392 -42.37176,55.66073 l -6.74439,5.75 17.87177,0 17.87177,0 4.45821,-4.55789 z m 27.68737,-0.15265 c -0.64792,-5.7483 -3.67326,-8.75064 -7.95482,-7.89433 -3.42751,0.6855 -12.40149,6.38421 -15.69865,9.96904 L 366.65137,691 l 13.30437,0 13.30436,0 -0.53094,-4.71054 z m 6.82051,1.29748 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36928,-2.20764 -3.89022,-1.20233 -1.45058,2.79932 1.12759,1.84953 2.05184,4.82528 2.05389,6.61278 0.005,4.28412 1.7399,4.17333 2.55341,-0.16306 z m 212.90599,-22.9392 c 7.072,-4.66267 27.93992,-25.16503 32.14159,-31.57855 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42789,-5.74419 4.13349,-6.56919 1.79821,-2.10249 5.09208,-8.84131 6.35428,-13 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26371,-153.02215 -0.38701,-163.02493 -2.11413,-171.5 -2.70469,-13.27206 -8.07801,-30.28292 -12.31918,-39 C 645.75154,167.72315 625.30575,145.76246 602.58095,131.75054 588.62693,123.1466 569.33305,116.11746 554,114.05153 c -4.675,-0.62989 -9.5125,-1.28677 -10.75,-1.45972 -1.2375,-0.17296 -2.25,-0.18707 -2.25,-0.0314 0,0.1557 16.1995,26.9588 35.99889,59.56244 19.79938,32.60364 35.66188,59.5914 35.25,59.9728 -0.41189,0.3814 -9.01333,5.2588 -19.11431,10.83868 -40.01903,22.10687 -67.53142,41.37277 -75.49785,52.86834 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.1559,0.93746 1.4457,0.97263 0.9291,0.11275 -1.26223,-2.101 5.35579,-13.03953 11.0227,-18.21876 6.32619,-5.78178 13.33491,-8.4781 21.84416,-8.40363 11.05059,0.0967 21.55592,6.95143 24.54802,16.01755 0.6089,1.84498 1.24223,3.35451 1.40741,3.35451 0.16518,0 1.91582,-0.675 3.89033,-1.5 4.9151,-2.05366 14.22931,-1.87626 19.16282,0.36498 8.62122,3.91654 13.60089,13.21844 11.44824,21.38502 -4.54716,17.25074 -24.03529,27.97766 -38.76371,21.33685 l -4.2431,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 7.37762,-10.1845 -0.36805,-24.51575 -12.63206,-23.37218 -2.2,0.20514 -4.78125,0.72028 -5.7361,1.14474 -1.29932,0.57759 -1.96644,0.16591 -2.65163,-1.63627 -3.02675,-7.96096 -12.89441,-13.38534 -26.1958,-14.40016 -13.13759,-1.00232 -17.42173,1.72966 -23.48675,14.97743 l -2.64992,5.78817 2.8601,3.01061 c 1.57306,1.65584 6.9101,6.21772 11.8601,10.13751 17.76796,14.07005 27.22484,22.33807 41.35337,36.15467 21.95266,21.46799 38.49612,41.63906 50.18255,61.18647 2.91004,4.86751 5.39406,8.98914 5.52005,9.15919 0.12598,0.17005 2.75992,-0.42656 5.85319,-1.3258 14.77419,-4.29497 22.15902,4.83243 16.71416,20.65817 -2.50047,7.26775 -6.01478,14.04356 -6.97574,13.44966 -0.42666,-0.26369 0.66806,4.55792 2.43271,10.71468 5.69627,19.87401 6.86316,28.82846 6.8668,52.69411 0.003,18.13434 -0.34916,23.35498 -2.24816,33.3497 -7.34452,38.65546 -25.78099,72.87106 -56.97092,105.73037 l -10.72801,11.3022 7.95566,-4.3747 c 4.37561,-2.40609 10.67561,-6.16802 14,-8.35983 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.81211,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z M 416.5,564.49472 c 23.64185,-11.50714 36.39617,-19.55818 44.58156,-28.14169 7.74629,-8.12306 8.16523,-9.09592 5.98746,-13.90419 -4.79519,-10.58726 -20.39511,-26.69968 -44.46941,-45.93035 -8.19521,-6.54637 -17.53271,-14.33957 -20.75,-17.31821 L 396,453.78457 l 0,41.68563 c 0,40.24948 -0.82397,57.96318 -3.40911,73.28904 -1.20452,7.14091 -1.19079,7.24862 0.84232,6.608 1.13673,-0.35818 11.51679,-5.25081 23.06679,-10.87252 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.81211,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z m 236.2215,-62.95623 c -0.32308,-6.39804 -0.7238,-7.7898 -2.70467,-9.39381 -1.40795,-1.14009 -3.57855,-1.7877 -5.50174,-1.64147 L 637.44669,434.5 641.591,443 c 2.27936,4.675 4.48245,9.5858 4.89574,10.91289 1.39599,4.4826 2.75233,-0.50752 2.34271,-8.61912 z m -495.11654,4.67611 C 182.98001,447.78645 208.29251,446 209.96291,446 l 3.03709,0 0,-49 0,-49 -4.98927,0 c -5.81465,0 -13.6739,-2.74297 -18.57904,-6.48431 -7.03855,-5.36856 -9.72036,-15.94693 -7.45209,-29.39473 2.65309,-15.72929 13.04884,-29.34088 25.11735,-32.88718 l 5.90028,-1.73378 0.001,-78.25 c 8.3e-4,-46.59119 0.37119,-78.25 0.9154,-78.25 0.50271,0 33.24021,3.6151 72.75,8.03356 39.50979,4.41845 80.1319,8.92377 90.27134,10.01181 l 18.43535,1.97825 11.06465,-10.81188 C 412.52091,124.2652 419.4935,117.73489 421.93,115.69993 L 426.36,112 325.43,112.0327 c -56.74339,0.0184 -103.77567,0.44012 -107.43,0.96329 -20.12023,2.8805 -42.42931,9.91371 -54.26502,17.10771 -2.62077,1.59295 -5.02528,2.89628 -5.34337,2.89628 -0.3181,0 -4.69884,3.11609 -9.73498,6.92465 -10.31033,7.79713 -24.6751,22.02752 -29.92225,29.64233 C 109.35692,183.17581 100,201.11515 100,205.48503 c 0,0.87705 -0.846152,3.26422 -1.880338,5.30481 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723317,9.73578 -1.879737,18.48682 -2.149135,120.23491 l -0.290545,109.73491 4.279474,-0.51503 c 2.35371,-0.28326 28.225283,-2.30147 57.492383,-4.48491 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.812109,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z m 32.87346,-143.64357 c -4.24772,-1.85085 -9.25984,-7.90845 -10.0563,-12.15395 -2.1442,-11.42954 7.91129,-30.91777 18.93206,-36.69164 9.18981,-4.81462 22.99635,-1.71706 28.34036,6.35829 5.46598,8.25965 1.76997,22.18675 -8.89898,33.53269 -8.65551,9.20473 -19.71603,12.70236 -28.31714,8.95461 z m 15.80248,-3.68992 c 2.63169,-1.19908 8.77647,-12.58519 10.71003,-19.84541 3.32696,-12.49222 -4.1792,-22.20301 -15.8282,-20.4771 -5.68545,0.84236 -10.26332,5.21363 -14.03962,13.406 -5.03782,10.92913 -3.89124,22.20016 2.67253,26.27128 3.1199,1.93509 12.82098,2.31479 16.48526,0.64523 z m 19.71299,-28.76222 c 0.004,-5.47688 -2.27593,-9.38081 -7.04296,-12.06003 -5.54448,-3.11617 -6.0862,-2.55885 -1.84569,1.89886 2.25128,2.36658 4.06916,5.43553 4.46288,7.53423 0.70526,3.75936 0.15022,13.63172 -0.95423,16.97265 -0.36364,1.1 0.6974,-0.7 2.35786,-4 1.9717,-3.91855 3.02011,-7.50756 3.02214,-10.34571 z m 484.57033,231.21008 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.98998,-1.60019 -3.27914,-0.62661 -0.94907,3.19532 1.33386,2.18787 2.05681,5.10971 2.0692,8.36278 0.0222,5.82952 1.54304,4.55863 2.55564,-2.13563 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.54257,7.48916 -6.55723,14.97596 -6.57087,24.4185 -0.0134,9.29186 1.88561,14.31575 6.70986,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29.12019 z m 391.13584,16.45625 c 6.08302,-6.54509 7.76566,-15.85691 3.85718,-21.34586 -2.26491,-3.18078 -9.38884,-6.9921 -13.05874,-6.98646 -2.34834,0.004 -2.32523,0.0702 0.65442,1.88721 6.29799,3.84047 10.05194,11.29609 9.1339,18.14058 -0.28021,2.08909 -1.95888,5.90499 -3.73039,8.47979 -3.52999,5.13066 -1.6925,5.02822 3.14363,-0.17526 z m -40.75036,-42.86522 c -3.91064,-1.71519 -13.3879,-3.0255 -13.37831,-1.84967 0.004,0.48336 2.19277,0.9832 4.86404,1.11076 2.67127,0.12756 5.93055,0.66153 7.24283,1.18661 3.68905,1.47609 4.78102,1.09158 1.27144,-0.4477 z"
+       id="path3544"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ba8934"
+       d="m 459.17065,733.75 -8.15255,-17.25 -84.62882,-0.25567 -84.62882,-0.25567 -7.63023,2.40354 C 239.16411,729.40664 196.72137,729.63311 163.8676,718.98056 151.06545,714.82957 134.31018,706.47376 123.5,698.84933 111.77688,690.58101 92.266504,671.00378 83.786753,659 63.562065,630.37029 51.948941,598.01713 46.424287,554.91138 45.297609,546.12056 44.677539,530.17514 44.298668,500.25 L 43.763755,458 47.731,458 c 2.181985,0 7.393851,-0.28965 11.581926,-0.64368 l 7.614682,-0.64367 0.288761,-113.10633 C 67.539416,217.07018 67.135338,224.56782 74.901985,201 79.998914,185.53342 82.328522,179.77413 85.678373,174.35848 87.230268,171.84956 90.075,167.23682 92,164.10796 c 12.76284,-20.74454 33.38975,-40.75873 56,-54.33656 6.82463,-4.0983 24.26862,-11.872247 33,-14.706508 1.925,-0.624867 9.575,-2.573495 17,-4.330285 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.40166,-2.212652 31.98894,-18.382598 39.99705,-22.623696 2.01349,-1.066347 2.64928,-0.309138 10.23759,12.192706 l 8.09078,13.329663 13.2624,0.607896 c 17.82153,0.816868 33.67664,3.758553 48.8356,9.06073 14.28552,4.996674 16.69209,6.127514 26.42681,12.417904 3.85,2.48779 9.475,6.11504 12.5,8.06055 6.10124,3.92398 7.25843,4.91802 21.31091,18.30632 5.39601,5.14096 12.13301,12.4972 14.97113,16.3472 C 671.20591,163.60553 683,184.07037 683,187.44933 c 0,0.8285 1.09557,3.87883 2.43461,6.77852 2.37403,5.14099 4.58888,13.00962 8.23948,29.27215 1.68134,7.48994 1.81577,18.6156 2.10858,174.5 l 0.31275,166.5 -2.16585,13.5 c -2.57135,16.02752 -9.73269,38.05257 -15.76955,48.5 -2.22465,3.85 -5.02529,8.8 -6.22365,11 -7.16896,13.16109 -26.4637,34.08894 -42.58021,46.1842 -10.85645,8.14764 -31.89364,19.08335 -45.85616,23.83728 -5.96004,2.02926 -31.05577,7.24893 -38.5,8.00762 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 -5.5,3.18227 -14.725,8.15634 -20.5,11.05349 C 497.34666,738.37547 469.24531,751 468.00223,751 c -0.37346,0 -4.34767,-7.7625 -8.83158,-17.25 z m 42.63885,-35.30644 c 46.02859,-23.89989 78.19449,-50.83881 99.85832,-83.6313 22.65981,-34.3001 31.00114,-76.18577 23.22266,-116.61173 -5.46486,-28.40174 -19.88607,-57.6152 -42.25046,-85.58796 C 571.40173,398.55603 547.13024,374.64685 530.48284,361.23396 514.46993,348.33229 496.048,331.67382 493.73073,328 c -0.86728,-1.375 -2.52911,-3.5126 -3.69296,-4.75021 -3.06937,-3.26394 -8.84949,-15.81145 -9.60523,-20.8511 -1.91995,-12.80314 8.86679,-29.10338 31.06746,-46.94719 8.30487,-6.67504 34.60509,-24.25198 46.25,-30.90975 4.5375,-2.59424 8.25,-4.85911 8.25,-5.03306 0,-0.4431 -63.20425,-104.34911 -66.53903,-109.3883 C 497.96126,107.85418 496.55342,106 496.33243,106 c -0.85819,0 -17.14114,9.50283 -22.83243,13.32515 -23.91885,16.0641 -51.42263,40.68606 -69.03808,61.80435 -22.70861,27.22421 -41.0615,63.96416 -45.89253,91.8705 -9.91683,57.28432 10.83249,110.19933 61.98203,158.06689 5.40988,5.06276 9.60044,8.58432 22.5299,18.93311 21.13493,16.91648 37.0288,32.0715 45.83787,43.707 2.82858,3.73615 7.04141,10.58407 9.36184,15.21761 4.02984,8.04695 4.21897,8.83143 4.21897,17.5 0,8.09775 -0.33529,9.7756 -3.11249,15.57539 -7.62873,15.93152 -24.79239,30.26996 -55.62832,46.47162 -10.63245,5.58645 -12.59733,6.97008 -11.87376,8.36129 1.11994,2.15332 5.62988,11.72312 23.4065,49.66709 20.24065,43.20341 28.64453,60.5 29.39508,60.5 0.35404,0 8.05916,-3.8504 17.12249,-8.55644 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 12.03903,-6.01965 17.31997,-9.62971 27.96522,-19.11705 23.84629,-21.25247 39.43648,-47.50275 48.04808,-80.90188 5.88061,-22.80727 6.24168,-28.03285 6.69891,-96.94841 l 0.41797,-63 -7.65028,-11.42434 c -33.59778,-50.17234 -41.8272,-111.9201 -22.46973,-168.59702 4.93706,-14.45526 15.68694,-36.58506 23.94116,-49.28548 C 362.934,181.52652 364,179.13944 364,175.64836 l 0,-4.23795 -54.75,-6.27254 c -30.1125,-3.4499 -56.42857,-6.52332 -58.48015,-6.82984 l -3.73015,-0.5573 -0.27155,192.37464 -0.27155,192.37463 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.91103,2.23066 -14.52878,2.46859 -18.42125,0.45572 -11.90231,-6.15493 -19.06263,-38.87001 -19.11909,-87.35403 L 187,480.93111 l -4.75,0.55684 c -2.6125,0.30626 -23.425,1.94143 -46.25,3.6337 -22.825,1.69228 -45.40549,3.37519 -50.178866,3.73981 -4.773376,0.36462 -8.957904,0.94198 -9.298951,1.28302 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 135.54179,-5.5106 c 18.21077,-18.61793 40.28632,-18.60876 38.80502,0.0161 L 403.48559,691 l 17.71947,0 17.71947,0 -5.52569,-11.75 c -3.03914,-6.4625 -14.15774,-30.14797 -24.708,-52.63438 -18.28119,-38.96378 -19.22365,-40.72539 -20.06245,-37.5 -2.82474,10.86181 -10.2203,31.24064 -14.59958,40.22985 -9.84006,20.19839 -26.05869,41.61193 -41.96344,55.40453 l -7.2071,6.25 17.86266,0 17.86265,0 4.45821,-4.55789 z m 27.68737,-0.15265 c -0.64792,-5.7483 -3.67326,-8.75064 -7.95482,-7.89433 -3.42751,0.6855 -12.40149,6.38421 -15.69865,9.96904 L 366.65137,691 l 13.30437,0 13.30436,0 -0.53094,-4.71054 z m 6.82051,1.29748 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36264,-2.20329 -3.71373,-1.38998 -1.37783,3.19176 1.09168,2.14127 1.98488,5.14807 1.98488,6.68178 0,3.91586 1.77967,3.47996 2.54967,-0.6245 z m 212.90599,-22.9392 c 7.072,-4.66267 27.93992,-25.16503 32.14159,-31.57855 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42789,-5.74419 4.13349,-6.56919 1.79821,-2.10249 5.09208,-8.84131 6.35428,-13 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26148,-151.72862 -0.39919,-163.09657 -2.07753,-171.5 -2.53901,-12.71276 -8.08847,-30.22918 -12.35578,-39 C 645.75154,167.72315 625.30575,145.76246 602.58095,131.75054 588.62693,123.1466 569.33305,116.11746 554,114.05153 c -4.675,-0.62989 -9.5125,-1.28677 -10.75,-1.45972 -1.2375,-0.17296 -2.25,-0.18914 -2.25,-0.0359 0,0.15318 16.194,26.96178 35.98667,59.57466 19.79266,32.61288 35.65516,59.6027 35.25,59.97738 -0.40517,0.37468 -9.00111,5.24658 -19.10209,10.82646 -40.01903,22.10687 -67.53142,41.37277 -75.49785,52.86834 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.1559,0.93746 1.4457,0.97263 0.9291,0.11275 -1.26223,-2.101 5.35579,-13.03953 11.0227,-18.21876 6.32619,-5.78178 13.33491,-8.4781 21.84416,-8.40363 11.05059,0.0967 21.55592,6.95143 24.54802,16.01755 0.6089,1.84498 1.24223,3.35451 1.40741,3.35451 0.16518,0 1.91582,-0.675 3.89033,-1.5 4.9151,-2.05366 14.22931,-1.87626 19.16282,0.36498 8.62122,3.91654 13.60089,13.21844 11.44824,21.38502 -4.54716,17.25074 -24.03529,27.97766 -38.76371,21.33685 l -4.2431,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.3055,-1.08346 -0.87768,-1.98192 3.18391,-6.68643 4.5461,-5.26574 4.73964,-5.37274 6.22198,-3.43998 1.53412,2.00027 7.78379,5.07316 10.31782,5.07316 1.91475,0 9.44582,-6.6497 12.84418,-11.341 7.37762,-10.1845 -0.36805,-24.51575 -12.63206,-23.37218 -2.2,0.20514 -4.78125,0.72028 -5.7361,1.14474 -1.29932,0.57759 -1.96644,0.16591 -2.65163,-1.63627 -3.02675,-7.96096 -12.89441,-13.38534 -26.1958,-14.40016 -13.13759,-1.00232 -17.42173,1.72966 -23.48675,14.97743 l -2.64992,5.78817 2.8601,3.01061 c 1.57306,1.65584 6.9101,6.21772 11.8601,10.13751 17.76796,14.07005 27.22484,22.33807 41.35337,36.15467 21.95266,21.46799 38.49612,41.63906 50.18255,61.18647 2.91004,4.86751 5.39406,8.98914 5.52005,9.15919 0.12598,0.17005 2.75992,-0.42656 5.85319,-1.3258 14.77419,-4.29497 22.15902,4.83243 16.71416,20.65817 -2.50047,7.26775 -6.01478,14.04356 -6.97574,13.44966 -0.42666,-0.26369 0.66806,4.55792 2.43271,10.71468 5.72236,19.96502 6.87536,28.82685 6.85597,52.69411 -0.0145,17.84551 -0.38761,23.45473 -2.1951,33 -7.38206,38.98442 -25.72939,73.12191 -57.01315,106.08007 l -10.72801,11.3022 7.95566,-4.3747 c 4.37561,-2.40609 10.67561,-6.16802 14,-8.35983 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.81211,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z M 416.5,564.47422 c 28.68412,-13.98935 41.52589,-22.74471 49.62119,-33.83112 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.4875,-13.49567 -20.75,-17.29892 l -7.75,-6.915 0,41.65901 c 0,40.22486 -0.82426,57.93826 -3.40911,73.26243 -1.20452,7.14091 -1.19079,7.24862 0.84232,6.608 C 394.56994,575.00906 404.95,570.1072 416.5,564.47422 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.81211,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z m 236.2215,-62.95623 c -0.32308,-6.39804 -0.7238,-7.7898 -2.70467,-9.39381 -1.42282,-1.15213 -3.58171,-1.78925 -5.56222,-1.64147 l -3.23682,0.24151 4.2085,8.5 c 2.31467,4.675 4.54497,9.5858 4.95622,10.91289 1.39095,4.48863 2.74832,-0.51323 2.33899,-8.61912 z m -495.11654,4.67611 C 182.98001,447.78645 208.29251,446 209.96291,446 l 3.03709,0 0,-49 0,-49 -4.98927,0 c -5.81465,0 -13.6739,-2.74297 -18.57904,-6.48431 -7.03855,-5.36856 -9.72036,-15.94693 -7.45209,-29.39473 2.65309,-15.72929 13.04884,-29.34088 25.11735,-32.88718 l 5.90028,-1.73378 0.001,-78.25 c 8.9e-4,-49.92122 0.35279,-78.25 0.97203,-78.25 0.53386,0 35.07136,3.82191 76.75,8.49312 41.67865,4.67122 82.27672,9.17511 90.21794,10.00863 l 14.43857,1.51551 11.06143,-10.8087 c 6.08378,-5.94479 13.07538,-12.49119 15.53689,-14.54756 l 4.47547,-3.73885 -105.97547,0.3275 c -76.321,0.23586 -106.95485,0.64906 -109.47547,1.47665 -1.925,0.63203 -7.0605,1.8654 -11.41221,2.74082 -9.05953,1.82248 -28.81389,9.3297 -35.85281,13.6251 -2.62039,1.59928 -5.0249,2.90778 -5.34299,2.90778 -0.3181,0 -4.69884,3.11609 -9.73498,6.92465 -10.31033,7.79713 -24.6751,22.02752 -29.92225,29.64233 C 109.35692,183.17581 100,201.11515 100,205.48503 c 0,0.87705 -0.846152,3.26422 -1.880338,5.30481 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723317,9.73578 -1.879737,18.48682 -2.149135,120.23491 l -0.290545,109.73491 4.279474,-0.51503 c 2.35371,-0.28326 28.225283,-2.30147 57.492383,-4.48491 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 5.40795,-4.55 c 0.73065,-0.9625 1.34275,-2.8176 1.36025,-4.12244 0.026,-1.93923 -0.22794,-2.15689 -1.39061,-1.19195 -1.98175,1.64471 -3.812109,7.06439 -2.38581,7.06439 0.59825,0 1.68553,-0.7875 2.41617,-1.75 z m 32.87346,-143.64357 c -4.24772,-1.85085 -9.25984,-7.90845 -10.0563,-12.15395 -2.1442,-11.42954 7.91129,-30.91777 18.93206,-36.69164 9.18981,-4.81462 22.99635,-1.71706 28.34036,6.35829 5.46598,8.25965 1.76997,22.18675 -8.89898,33.53269 -8.65551,9.20473 -19.71603,12.70236 -28.31714,8.95461 z m 15.80248,-3.68992 c 2.63169,-1.19908 8.77647,-12.58519 10.71003,-19.84541 3.32696,-12.49222 -4.1792,-22.20301 -15.8282,-20.4771 -5.68545,0.84236 -10.26332,5.21363 -14.03962,13.406 -5.03782,10.92913 -3.89124,22.20016 2.67253,26.27128 3.1199,1.93509 12.82098,2.31479 16.48526,0.64523 z m 19.71299,-28.76222 c 0.004,-5.47688 -2.27593,-9.38081 -7.04296,-12.06003 -4.80833,-2.70244 -6.9966,-2.70227 -3.56088,2.7e-4 4.88765,3.84462 6.91019,9.37499 6.34482,17.34906 -0.27518,3.88102 -0.78873,7.95641 -1.14123,9.05641 -0.3525,1.1 0.71765,-0.7 2.37811,-4 1.9717,-3.91855 3.02011,-7.50756 3.02214,-10.34571 z m 484.57033,231.21008 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.94719,-1.57729 -3.12936,-0.83145 -0.87632,3.58776 1.10395,2.16533 1.99168,5.90753 2.00019,8.43178 0.0184,5.43692 1.57651,3.85117 2.5519,-2.59707 z M 213,314.87981 l 0,-29.12019 -6.01344,0.43497 c -7.33439,0.53052 -10.30314,2.51736 -14.77317,9.88691 -4.54257,7.48916 -6.55723,14.97596 -6.57087,24.4185 -0.0134,9.29186 1.88561,14.31575 6.70986,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29.12019 z m 391.13584,16.45625 c 6.08302,-6.54509 7.76566,-15.85691 3.85718,-21.34586 -2.26491,-3.18078 -9.38884,-6.9921 -13.05874,-6.98646 -2.34834,0.004 -2.32523,0.0702 0.65442,1.88721 6.29799,3.84047 10.05194,11.29609 9.1339,18.14058 -0.28021,2.08909 -1.95888,5.90499 -3.73039,8.47979 -3.52999,5.13066 -1.6925,5.02822 3.14363,-0.17526 z M 564,288.56132 c -3.19325,-1.73535 -13.57036,-3.06551 -14.32973,-1.83682 -0.31873,0.51571 1.75677,0.986 4.69228,1.06324 2.89509,0.0762 6.36038,0.57656 7.70063,1.11199 3.59876,1.43769 4.81426,1.22531 1.93682,-0.33841 z"
+       id="path3542"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#a18d48"
+       d="m 459.17065,733.75 -8.15255,-17.25 -84.62882,-0.25567 -84.62882,-0.25567 -7.63023,2.40354 C 239.16411,729.40664 196.72137,729.63311 163.8676,718.98056 151.06545,714.82957 134.31018,706.47376 123.5,698.84933 111.77688,690.58101 92.266504,671.00378 83.786753,659 63.562065,630.37029 51.948941,598.01713 46.424287,554.91138 45.297609,546.12056 44.677539,530.17514 44.298668,500.25 L 43.763755,458 47.731,458 c 2.181985,0 7.393851,-0.28965 11.581926,-0.64368 l 7.614682,-0.64367 0.288761,-113.10633 C 67.539416,217.07018 67.135338,224.56782 74.901985,201 79.998914,185.53342 82.328522,179.77413 85.678373,174.35848 87.230268,171.84956 90.075,167.23682 92,164.10796 c 12.76284,-20.74454 33.38975,-40.75873 56,-54.33656 6.82463,-4.0983 24.26862,-11.872247 33,-14.706508 1.925,-0.624867 9.575,-2.573495 17,-4.330285 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.40166,-2.212652 31.98894,-18.382598 39.99705,-22.623696 2.01349,-1.066347 2.64928,-0.309138 10.23759,12.192706 l 8.09078,13.329663 13.2624,0.607896 c 17.82153,0.816868 33.67664,3.758553 48.8356,9.06073 14.28552,4.996674 16.69209,6.127514 26.42681,12.417904 3.85,2.48779 9.475,6.11504 12.5,8.06055 6.10124,3.92398 7.25843,4.91802 21.31091,18.30632 5.39601,5.14096 12.13301,12.4972 14.97113,16.3472 C 671.20591,163.60553 683,184.07037 683,187.44933 c 0,0.8285 1.09557,3.87883 2.43461,6.77852 2.37403,5.14099 4.58888,13.00962 8.23948,29.27215 1.68134,7.48994 1.81577,18.6156 2.10858,174.5 l 0.31275,166.5 -2.16585,13.5 c -2.57135,16.02752 -9.73269,38.05257 -15.76955,48.5 -2.22465,3.85 -5.02529,8.8 -6.22365,11 -7.16896,13.16109 -26.4637,34.08894 -42.58021,46.1842 -10.85645,8.14764 -31.89364,19.08335 -45.85616,23.83728 -5.96004,2.02926 -31.05577,7.24893 -38.5,8.00762 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 -5.5,3.18227 -14.725,8.15634 -20.5,11.05349 C 497.34666,738.37547 469.24531,751 468.00223,751 c -0.37346,0 -4.34767,-7.7625 -8.83158,-17.25 z m 42.63885,-35.30644 c 46.02859,-23.89989 78.19449,-50.83881 99.85832,-83.6313 22.65981,-34.3001 31.00114,-76.18577 23.22266,-116.61173 -5.46486,-28.40174 -19.88607,-57.6152 -42.25046,-85.58796 C 571.40173,398.55603 547.13024,374.64685 530.48284,361.23396 514.46993,348.33229 496.048,331.67382 493.73073,328 c -0.86728,-1.375 -2.52911,-3.5126 -3.69296,-4.75021 -3.06937,-3.26394 -8.84949,-15.81145 -9.60523,-20.8511 -1.91995,-12.80314 8.86679,-29.10338 31.06746,-46.94719 8.30487,-6.67504 34.60509,-24.25198 46.25,-30.90975 4.5375,-2.59424 8.25,-4.85911 8.25,-5.03306 0,-0.4431 -63.20425,-104.34911 -66.53903,-109.3883 C 497.96126,107.85418 496.55342,106 496.33243,106 c -0.85819,0 -17.14114,9.50283 -22.83243,13.32515 -23.91885,16.0641 -51.42263,40.68606 -69.03808,61.80435 -22.70861,27.22421 -41.0615,63.96416 -45.89253,91.8705 -9.91683,57.28432 10.83249,110.19933 61.98203,158.06689 5.40988,5.06276 9.60044,8.58432 22.5299,18.93311 21.13493,16.91648 37.0288,32.0715 45.83787,43.707 2.82858,3.73615 7.04141,10.58407 9.36184,15.21761 4.02984,8.04695 4.21897,8.83143 4.21897,17.5 0,8.09775 -0.33529,9.7756 -3.11249,15.57539 -7.62873,15.93152 -24.79239,30.26996 -55.62832,46.47162 -10.63245,5.58645 -12.59733,6.97008 -11.87376,8.36129 1.11994,2.15332 5.62988,11.72312 23.4065,49.66709 20.24065,43.20341 28.64453,60.5 29.39508,60.5 0.35404,0 8.05916,-3.8504 17.12249,-8.55644 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 12.03903,-6.01965 17.31997,-9.62971 27.96522,-19.11705 23.84629,-21.25247 39.43648,-47.50275 48.04808,-80.90188 5.88061,-22.80727 6.24168,-28.03285 6.69891,-96.94841 l 0.41797,-63 -7.65028,-11.42434 c -33.59778,-50.17234 -41.8272,-111.9201 -22.46973,-168.59702 4.93706,-14.45526 15.68694,-36.58506 23.94116,-49.28548 C 362.934,181.52652 364,179.13944 364,175.64836 l 0,-4.23795 -54.75,-6.27254 c -30.1125,-3.4499 -56.42857,-6.52332 -58.48015,-6.82984 l -3.73015,-0.5573 -0.27155,192.37464 -0.27155,192.37463 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.91103,2.23066 -14.52878,2.46859 -18.42125,0.45572 -11.90231,-6.15493 -19.06263,-38.87001 -19.11909,-87.35403 L 187,480.93111 l -4.75,0.55684 c -2.6125,0.30626 -23.425,1.94143 -46.25,3.6337 -22.825,1.69228 -45.40549,3.37519 -50.178866,3.73981 -4.773376,0.36462 -8.957904,0.94198 -9.298951,1.28302 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 135.54179,-5.5106 c 18.21077,-18.61793 40.28632,-18.60876 38.80502,0.0161 L 403.48559,691 l 17.71947,0 17.71947,0 -5.52569,-11.75 c -3.03914,-6.4625 -14.15774,-30.14797 -24.708,-52.63438 -18.28119,-38.96378 -19.22365,-40.72539 -20.06245,-37.5 -2.82474,10.86181 -10.2203,31.24064 -14.59958,40.22985 -9.84006,20.19839 -26.05869,41.61193 -41.96344,55.40453 l -7.2071,6.25 17.86266,0 17.86265,0 4.45821,-4.55789 z M 393,686.95455 c 0,-5.44947 -3.76478,-9.45159 -8.07932,-8.58869 -3.55141,0.71029 -12.49001,6.35061 -15.84499,9.99831 L 366.65137,691 l 13.17432,0 13.17431,0 0,-4.04545 z m 6.54967,0.63239 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36264,-2.20329 -3.71373,-1.38998 -1.37783,3.19176 1.09168,2.14127 1.98488,5.14807 1.98488,6.68178 0,3.91586 1.77967,3.47996 2.54967,-0.6245 z m 212.90599,-22.9392 c 7.072,-4.66267 27.93992,-25.16503 32.14159,-31.57855 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42789,-5.74419 4.13349,-6.56919 1.79821,-2.10249 5.09208,-8.84131 6.35428,-13 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26148,-151.72862 -0.39919,-163.09657 -2.07753,-171.5 -2.53901,-12.71276 -8.08847,-30.22918 -12.35578,-39 C 645.75154,167.72315 625.30575,145.76246 602.58095,131.75054 588.62693,123.1466 569.33305,116.11746 554,114.05153 c -4.675,-0.62989 -9.5125,-1.28677 -10.75,-1.45972 -1.2375,-0.17296 -2.25,-0.18914 -2.25,-0.0359 0,0.15318 16.194,26.96178 35.98667,59.57466 19.79266,32.61288 35.65516,59.6027 35.25,59.97738 -0.40517,0.37468 -9.00111,5.24658 -19.10209,10.82646 -40.01903,22.10687 -67.53142,41.37277 -75.49785,52.86834 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.1559,0.93746 1.4457,0.97263 0.9291,0.11275 -1.26223,-2.101 5.35579,-13.03953 11.0227,-18.21876 6.32619,-5.78178 13.33491,-8.4781 21.84416,-8.40363 11.05059,0.0967 21.55592,6.95143 24.54802,16.01755 0.6089,1.84498 1.24223,3.35451 1.40741,3.35451 0.16518,0 1.91582,-0.675 3.89033,-1.5 4.9151,-2.05366 14.22931,-1.87626 19.16282,0.36498 8.62122,3.91654 13.60089,13.21844 11.44824,21.38502 -4.54716,17.25074 -24.03529,27.97766 -38.76371,21.33685 l -4.2431,-1.91314 -2.93885,2.8156 c -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.30583,-1.08373 -0.8897,-1.96799 3.10184,-6.59137 l 4.60998,-5.33973 2.93893,2.93892 c 1.61641,1.61641 3.29806,2.93893 3.737,2.93893 0.43895,0 2.15229,0.27084 3.80744,0.60187 2.52007,0.50402 3.70516,-0.0244 7.28889,-3.25 10.1419,-9.12842 12.62959,-17.04762 7.68182,-24.45399 -4.0052,-5.99541 -12.35342,-8.41221 -18.92998,-5.48021 -1.31686,0.58709 -2.02592,-0.0224 -3.14673,-2.70487 C 572.471,296.0964 562.35581,291.10173 548.5,290.30509 c -8.28516,-0.47635 -9.27488,-0.32924 -12.46083,1.85219 -4.21175,2.8838 -8.42818,8.81863 -10.50307,14.78355 -1.5327,4.40625 -1.5233,4.46334 1.20959,7.34098 1.51487,1.59511 6.80431,6.1073 11.75431,10.02709 17.76796,14.07005 27.22484,22.33807 41.35337,36.15467 21.95266,21.46799 38.49612,41.63906 50.18255,61.18647 2.91004,4.86751 5.39406,8.98914 5.52005,9.15919 0.12598,0.17005 2.75992,-0.42656 5.85319,-1.3258 14.77419,-4.29497 22.15902,4.83243 16.71416,20.65817 -2.50047,7.26775 -6.01478,14.04356 -6.97574,13.44966 -0.42666,-0.26369 0.66806,4.55792 2.43271,10.71468 5.72236,19.96502 6.87536,28.82685 6.85597,52.69411 -0.0145,17.84551 -0.38761,23.45473 -2.1951,33 -7.38206,38.98442 -25.72939,73.12191 -57.01315,106.08007 l -10.72801,11.3022 7.95566,-4.3747 c 4.37561,-2.40609 10.67561,-6.16802 14,-8.35983 z M 651.2,598.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 416.5,564.47422 c 28.68412,-13.98935 41.52589,-22.74471 49.62119,-33.83112 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.4875,-13.49567 -20.75,-17.29892 l -7.75,-6.915 0,41.65901 c 0,40.22486 -0.82426,57.93826 -3.40911,73.26243 -1.20452,7.14091 -1.19079,7.24862 0.84232,6.608 C 394.56994,575.00906 404.95,570.1072 416.5,564.47422 z M 407.2,512.8 c -2.35163,-2.35163 -1.30805,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-59.93777 c 0.0193,-8.99363 -1.8229,-11.8228 -7.77243,-11.93663 l -3.96456,-0.0759 4.24752,8.57585 c 2.33613,4.71672 4.5796,9.64781 4.98547,10.95798 1.25428,4.04883 2.48712,0.34569 2.504,-7.52135 z m -495.27178,3.6091 C 182.98001,447.78645 208.29251,446 209.96291,446 l 3.03709,0 0,-49 0,-49 -4.98927,0 c -5.81465,0 -13.6739,-2.74297 -18.57904,-6.48431 -7.03855,-5.36856 -9.72036,-15.94693 -7.45209,-29.39473 2.65309,-15.72929 13.04884,-29.34088 25.11735,-32.88718 l 5.90028,-1.73378 0.001,-78.25 c 8.9e-4,-49.92122 0.35279,-78.25 0.97203,-78.25 0.53386,0 35.07136,3.82191 76.75,8.49312 41.67865,4.67122 82.27672,9.17511 90.21794,10.00863 l 14.43857,1.51551 11.06143,-10.8087 c 6.08378,-5.94479 13.07538,-12.49119 15.53689,-14.54756 l 4.47547,-3.73885 -105.97547,0.3275 c -76.321,0.23586 -106.95485,0.64906 -109.47547,1.47665 -1.925,0.63203 -7.0605,1.8654 -11.41221,2.74082 -9.05953,1.82248 -28.81389,9.3297 -35.85281,13.6251 -2.62039,1.59928 -5.0249,2.90778 -5.34299,2.90778 -0.3181,0 -4.69884,3.11609 -9.73498,6.92465 -10.31033,7.79713 -24.6751,22.02752 -29.92225,29.64233 C 109.35692,183.17581 100,201.11515 100,205.48503 c 0,0.87705 -0.846152,3.26422 -1.880338,5.30481 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723317,9.73578 -1.879737,18.48682 -2.149135,120.23491 l -0.290545,109.73491 4.279474,-0.51503 c 2.35371,-0.28326 28.225283,-2.30147 57.492383,-4.48491 z M 97.2,392.8 c -2.351626,-2.35163 -1.308048,-6.00689 2.84211,-9.95484 4.36642,-4.15367 6.03896,-4.65733 7.9239,-2.38612 1.7468,2.10477 0.39293,6.9452 -2.94073,10.5139 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 31.82153,-141.69212 c -4.24772,-1.85085 -9.25984,-7.90845 -10.0563,-12.15395 -2.1442,-11.42954 7.91129,-30.91777 18.93206,-36.69164 9.18981,-4.81462 22.99635,-1.71706 28.34036,6.35829 5.46598,8.25965 1.76997,22.18675 -8.89898,33.53269 -8.65551,9.20473 -19.71603,12.70236 -28.31714,8.95461 z m 15.59935,-3.72018 c 1.781,-0.6823 3.71586,-3.21956 6.2436,-8.18747 6.71952,-13.20626 7.19591,-21.75876 1.56897,-28.16749 -5.81442,-6.62226 -16.60326,-5.5745 -22.51351,2.1864 -6.67536,8.7656 -9.47085,22.9339 -5.76333,29.21022 3.68921,6.24533 11.90733,8.23653 20.46427,4.95834 z m 19.91612,-28.73196 c 0.004,-5.47688 -2.27593,-9.38081 -7.04296,-12.06003 -4.80833,-2.70244 -6.9966,-2.70227 -3.56088,2.7e-4 4.88765,3.84462 6.91019,9.37499 6.34482,17.34906 -0.27518,3.88102 -0.78873,7.95641 -1.14123,9.05641 -0.3525,1.1 0.71765,-0.7 2.37811,-4 1.9717,-3.91855 3.02011,-7.50756 3.02214,-10.34571 z m 484.57033,231.21008 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.94719,-1.57729 -3.12936,-0.83145 -0.87632,3.58776 1.10395,2.16533 1.99168,5.90753 2.00019,8.43178 0.0184,5.43692 1.57651,3.85117 2.5519,-2.59707 z M 213,315 l 0,-29 -5.35212,0 c -3.90382,0 -6.26099,0.61249 -8.71082,2.26343 -7.84594,5.28738 -13.28126,18.42562 -13.33634,32.23657 -0.037,9.27306 1.8638,14.27046 6.75166,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29 z m 391.13584,16.33606 c 6.08302,-6.54509 7.76566,-15.85691 3.85718,-21.34586 -2.26491,-3.18078 -9.38884,-6.9921 -13.05874,-6.98646 -2.34834,0.004 -2.32523,0.0702 0.65442,1.88721 6.29799,3.84047 10.05194,11.29609 9.1339,18.14058 -0.28021,2.08909 -1.95888,5.90499 -3.73039,8.47979 -3.52999,5.13066 -1.6925,5.02822 3.14363,-0.17526 z M 564,288.56132 c -3.19325,-1.73535 -13.57036,-3.06551 -14.32973,-1.83682 -0.31873,0.51571 1.75677,0.986 4.69228,1.06324 2.89509,0.0762 6.36038,0.57656 7.70063,1.11199 3.59876,1.43769 4.81426,1.22531 1.93682,-0.33841 z"
+       id="path3540"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#7c7c7c"
+       d="m 459.17065,733.75 -8.15255,-17.25 -84.62882,-0.25567 -84.62882,-0.25567 -7.63023,2.40354 C 239.16411,729.40664 196.72137,729.63311 163.8676,718.98056 151.06545,714.82957 134.31018,706.47376 123.5,698.84933 111.77688,690.58101 92.266504,671.00378 83.786753,659 63.562065,630.37029 51.948941,598.01713 46.424287,554.91138 45.297609,546.12056 44.677539,530.17514 44.298668,500.25 L 43.763755,458 47.731,458 c 2.181985,0 7.393851,-0.28965 11.581926,-0.64368 l 7.614682,-0.64367 0.288761,-113.10633 C 67.539416,217.07018 67.135338,224.56782 74.901985,201 79.998914,185.53342 82.328522,179.77413 85.678373,174.35848 87.230268,171.84956 90.075,167.23682 92,164.10796 c 12.76284,-20.74454 33.38975,-40.75873 56,-54.33656 6.82463,-4.0983 24.26862,-11.872247 33,-14.706508 1.925,-0.624867 9.575,-2.573495 17,-4.330285 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.40166,-2.212652 31.98894,-18.382598 39.99705,-22.623696 2.01349,-1.066347 2.64928,-0.309138 10.23759,12.192706 l 8.09078,13.329663 13.2624,0.607896 c 17.82153,0.816868 33.67664,3.758553 48.8356,9.06073 14.28552,4.996674 16.69209,6.127514 26.42681,12.417904 3.85,2.48779 9.475,6.11504 12.5,8.06055 6.10124,3.92398 7.25843,4.91802 21.31091,18.30632 5.39601,5.14096 12.13301,12.4972 14.97113,16.3472 C 671.20591,163.60553 683,184.07037 683,187.44933 c 0,0.8285 1.09557,3.87883 2.43461,6.77852 2.37403,5.14099 4.58888,13.00962 8.23948,29.27215 1.68134,7.48994 1.81577,18.6156 2.10858,174.5 l 0.31275,166.5 -2.16585,13.5 c -2.57135,16.02752 -9.73269,38.05257 -15.76955,48.5 -2.22465,3.85 -5.02529,8.8 -6.22365,11 -7.16896,13.16109 -26.4637,34.08894 -42.58021,46.1842 -10.85645,8.14764 -31.89364,19.08335 -45.85616,23.83728 -5.96004,2.02926 -31.05577,7.24893 -38.5,8.00762 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 -5.5,3.18227 -14.725,8.15634 -20.5,11.05349 C 497.34666,738.37547 469.24531,751 468.00223,751 c -0.37346,0 -4.34767,-7.7625 -8.83158,-17.25 z m 42.63885,-35.30644 c 46.02859,-23.89989 78.19449,-50.83881 99.85832,-83.6313 22.65981,-34.3001 31.00114,-76.18577 23.22266,-116.61173 -5.46486,-28.40174 -19.88607,-57.6152 -42.25046,-85.58796 C 571.40173,398.55603 547.13024,374.64685 530.48284,361.23396 514.46993,348.33229 496.048,331.67382 493.73073,328 c -0.86728,-1.375 -2.52911,-3.5126 -3.69296,-4.75021 -3.06937,-3.26394 -8.84949,-15.81145 -9.60523,-20.8511 -1.91995,-12.80314 8.86679,-29.10338 31.06746,-46.94719 8.30487,-6.67504 34.60509,-24.25198 46.25,-30.90975 4.5375,-2.59424 8.25,-4.85911 8.25,-5.03306 0,-0.4431 -63.20425,-104.34911 -66.53903,-109.3883 C 497.96126,107.85418 496.55342,106 496.33243,106 c -0.85819,0 -17.14114,9.50283 -22.83243,13.32515 -23.91885,16.0641 -51.42263,40.68606 -69.03808,61.80435 -22.70861,27.22421 -41.0615,63.96416 -45.89253,91.8705 -9.91683,57.28432 10.83249,110.19933 61.98203,158.06689 5.40988,5.06276 9.60044,8.58432 22.5299,18.93311 21.13493,16.91648 37.0288,32.0715 45.83787,43.707 2.82858,3.73615 7.04141,10.58407 9.36184,15.21761 4.02984,8.04695 4.21897,8.83143 4.21897,17.5 0,8.09775 -0.33529,9.7756 -3.11249,15.57539 -7.62873,15.93152 -24.79239,30.26996 -55.62832,46.47162 -10.63245,5.58645 -12.59733,6.97008 -11.87376,8.36129 1.11994,2.15332 5.62988,11.72312 23.4065,49.66709 20.24065,43.20341 28.64453,60.5 29.39508,60.5 0.35404,0 8.05916,-3.8504 17.12249,-8.55644 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 12.03903,-6.01965 17.31997,-9.62971 27.96522,-19.11705 23.84629,-21.25247 39.43648,-47.50275 48.04808,-80.90188 5.88061,-22.80727 6.24168,-28.03285 6.69891,-96.94841 l 0.41797,-63 -7.65028,-11.42434 c -33.59778,-50.17234 -41.8272,-111.9201 -22.46973,-168.59702 4.93706,-14.45526 15.68694,-36.58506 23.94116,-49.28548 C 362.934,181.52652 364,179.13944 364,175.64836 l 0,-4.23795 -54.75,-6.27254 c -30.1125,-3.4499 -56.42857,-6.52332 -58.48015,-6.82984 l -3.73015,-0.5573 -0.27155,192.37464 -0.27155,192.37463 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.91103,2.23066 -14.52878,2.46859 -18.42125,0.45572 -11.90231,-6.15493 -19.06263,-38.87001 -19.11909,-87.35403 L 187,480.93111 l -4.75,0.55684 c -2.6125,0.30626 -23.425,1.94143 -46.25,3.6337 -22.825,1.69228 -45.40549,3.37519 -50.178866,3.73981 -4.773376,0.36462 -8.957904,0.94198 -9.298951,1.28302 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 135.54179,-5.5106 c 6.30837,-6.44941 13.6713,-11.07592 20.76618,-13.04847 5.77057,-1.60437 6.35823,-1.60188 10.67076,0.0451 5.80523,2.21703 7.93196,5.9353 7.27938,12.72687 l -0.46452,4.8344 17.81547,0 17.81547,0 -5.52569,-11.75 c -3.03914,-6.4625 -14.15774,-30.14797 -24.708,-52.63438 -18.28119,-38.96378 -19.22365,-40.72539 -20.06245,-37.5 -2.82474,10.86181 -10.2203,31.24064 -14.59958,40.22985 -9.84006,20.19839 -26.05869,41.61193 -41.96344,55.40453 l -7.2071,6.25 17.86266,0 17.86265,0 4.45821,-4.55789 z M 393,686.95455 c 0,-5.44947 -3.76478,-9.45159 -8.07932,-8.58869 -3.55141,0.71029 -12.49001,6.35061 -15.84499,9.99831 L 366.65137,691 l 13.17432,0 13.17431,0 0,-4.04545 z m 6.54967,0.63239 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36264,-2.20329 -3.71373,-1.38998 -1.37783,3.19176 1.09168,2.14127 1.98488,5.14807 1.98488,6.68178 0,3.91586 1.77967,3.47996 2.54967,-0.6245 z m 212.90599,-22.9392 c 7.072,-4.66267 27.93992,-25.16503 32.14159,-31.57855 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42789,-5.74419 4.13349,-6.56919 1.79821,-2.10249 5.09208,-8.84131 6.35428,-13 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26148,-151.72862 -0.39919,-163.09657 -2.07753,-171.5 -2.53901,-12.71276 -8.08847,-30.22918 -12.35578,-39 C 645.75154,167.72315 625.30575,145.76246 602.58095,131.75054 588.62693,123.1466 569.33305,116.11746 554,114.05153 c -4.675,-0.62989 -9.5125,-1.28677 -10.75,-1.45972 -1.2375,-0.17296 -2.25,-0.18914 -2.25,-0.0359 0,0.15318 16.194,26.96178 35.98667,59.57466 19.79266,32.61288 35.65516,59.6027 35.25,59.97738 -0.40517,0.37468 -9.00111,5.24658 -19.10209,10.82646 -40.01903,22.10687 -67.53142,41.37277 -75.49785,52.86834 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05918,0.85902 1.41096,0.91441 0.95207,0.14991 -1.09075,-1.81718 3.91278,-10.91228 8.9884,-16.33853 14.71124,-15.7275 40.61203,-13.00831 48.11212,5.05104 0.79946,1.925 1.53599,3.59223 1.63675,3.70495 0.10075,0.11272 1.96596,-0.43003 4.1449,-1.20611 4.82117,-1.71716 11.59133,-1.86813 16.95842,-0.37814 5.16614,1.4342 11.93697,8.16871 13.347,13.27539 2.34308,8.48596 -3.12623,20.28534 -12.21976,26.36262 -9.38981,6.27529 -17.96901,7.40648 -26.89893,3.54667 -3.7447,-1.61857 -3.79859,-1.60907 -6.71385,1.18393 -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.30583,-1.08373 -0.8897,-1.96799 3.10184,-6.59137 l 4.60998,-5.33973 2.93893,2.93892 c 1.61641,1.61641 3.29806,2.93893 3.737,2.93893 0.43895,0 2.15229,0.27084 3.80744,0.60187 2.52007,0.50402 3.70516,-0.0244 7.28889,-3.25 10.1419,-9.12842 12.62959,-17.04762 7.68182,-24.45399 -4.0052,-5.99541 -12.35342,-8.41221 -18.92998,-5.48021 -1.31686,0.58709 -2.02592,-0.0224 -3.14673,-2.70487 C 572.471,296.0964 562.35581,291.10173 548.5,290.30509 c -8.28516,-0.47635 -9.27488,-0.32924 -12.46083,1.85219 -4.21175,2.8838 -8.42818,8.81863 -10.50307,14.78355 -1.5327,4.40625 -1.5233,4.46334 1.20959,7.34098 1.51487,1.59511 6.80431,6.1073 11.75431,10.02709 17.76796,14.07005 27.22484,22.33807 41.35337,36.15467 21.95266,21.46799 38.49612,41.63906 50.18255,61.18647 2.91004,4.86751 5.38523,8.9803 5.50041,9.13955 0.11518,0.15925 2.94747,-0.4717 6.29398,-1.40211 5.74435,-1.59708 6.33972,-1.59421 10.64842,0.0513 7.69381,2.93829 9.333,9.22466 5.43482,20.84282 -2.35353,7.01446 -5.90693,13.84058 -6.88892,13.23368 -0.35903,-0.2219 0.79101,4.6339 2.55566,10.79066 5.72236,19.96502 6.87536,28.82685 6.85597,52.69411 -0.0145,17.84551 -0.38761,23.45473 -2.1951,33 -7.38206,38.98442 -25.72939,73.12191 -57.01315,106.08007 l -10.72801,11.3022 7.95566,-4.3747 c 4.37561,-2.40609 10.67561,-6.16802 14,-8.35983 z M 651.2,598.8 c -2.97422,-2.97422 0.12137,-9.36347 6.01261,-12.40995 2.5925,-1.34063 3.23917,-1.36684 4.42659,-0.17942 1.98749,1.98749 0.69587,7.21916 -2.67255,10.82507 -2.91572,3.12129 -5.76289,3.76806 -7.76665,1.7643 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 416.5,564.47422 c 28.68412,-13.98935 41.52589,-22.74471 49.62119,-33.83112 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.4875,-13.49567 -20.75,-17.29892 l -7.75,-6.915 0,41.65901 c 0,40.22486 -0.82426,57.93826 -3.40911,73.26243 -1.20452,7.14091 -1.19079,7.24862 0.84232,6.608 C 394.56994,575.00906 404.95,570.1072 416.5,564.47422 z M 407.2,512.8 c -2.97422,-2.97422 0.12137,-9.36347 6.01261,-12.40995 2.67992,-1.38583 3.20955,-1.39646 4.51544,-0.0906 2.0575,2.0575 0.83464,6.88665 -2.70277,10.67346 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-59.93777 c 0.0193,-8.99363 -1.8229,-11.8228 -7.77243,-11.93663 l -3.96456,-0.0759 4.24752,8.57585 c 2.33613,4.71672 4.5796,9.64781 4.98547,10.95798 1.25428,4.04883 2.48712,0.34569 2.504,-7.52135 z m -495.27178,3.6091 C 182.98001,447.78645 208.29251,446 209.96291,446 l 3.03709,0 0,-49 0,-49 -4.98927,0 c -9.75498,0 -20.26789,-5.77227 -24.23745,-13.30793 -1.79718,-3.4117 -2.21202,-5.86745 -2.22848,-13.19207 -0.0111,-4.95 0.60098,-11.25 1.36022,-14 3.78607,-13.71313 13.20508,-24.73893 24.01248,-28.10876 l 6.0654,-1.89124 0.009,-78.25 c 0.005,-49.9163 0.36001,-78.25 0.97919,-78.25 0.53386,0 35.07136,3.82191 76.75,8.49312 41.67865,4.67122 82.27672,9.17511 90.21794,10.00863 l 14.43857,1.51551 11.06143,-10.8087 c 6.08378,-5.94479 13.07538,-12.49119 15.53689,-14.54756 l 4.47547,-3.73885 -105.97547,0.3275 c -76.321,0.23586 -106.95485,0.64906 -109.47547,1.47665 -1.925,0.63203 -7.0605,1.8654 -11.41221,2.74082 -9.05953,1.82248 -28.81389,9.3297 -35.85281,13.6251 C 161.11421,131.6915 158.7097,133 158.39161,133 c -0.3181,0 -4.69884,3.11609 -9.73498,6.92465 -10.31033,7.79713 -24.6751,22.02752 -29.92225,29.64233 C 109.35692,183.17581 100,201.11515 100,205.48503 c 0,0.87705 -0.846152,3.26422 -1.880338,5.30481 -1.034186,2.04059 -2.716704,8.43516 -3.738929,14.21016 -1.723317,9.73578 -1.879737,18.48682 -2.149135,120.23491 l -0.290545,109.73491 4.279474,-0.51503 c 2.35371,-0.28326 28.225283,-2.30147 57.492383,-4.48491 z M 97.2,392.8 c -2.974216,-2.97422 0.121375,-9.36347 6.01261,-12.40995 2.67992,-1.38583 3.20955,-1.39646 4.51544,-0.0906 2.0575,2.0575 0.83464,6.88665 -2.70277,10.67346 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 31.82153,-141.69212 c -4.74539,-2.06769 -9.25119,-7.88842 -10.00678,-12.92703 -1.74659,-11.64709 8.02187,-30.22856 18.88282,-35.9187 9.17756,-4.80821 22.99647,-1.71632 28.32647,6.33785 5.25728,7.94429 1.36372,22.65393 -8.87981,33.54738 -8.66131,9.21086 -19.71924,12.70927 -28.3227,8.9605 z m 15.59935,-3.72018 c 1.781,-0.6823 3.71586,-3.21956 6.2436,-8.18747 6.71952,-13.20626 7.19591,-21.75876 1.56897,-28.16749 -5.81442,-6.62226 -16.60326,-5.5745 -22.51351,2.1864 -6.67536,8.7656 -9.47085,22.9339 -5.76333,29.21022 3.68921,6.24533 11.90733,8.23653 20.46427,4.95834 z m 19.91612,-28.73196 c 0.004,-5.47688 -2.27593,-9.38081 -7.04296,-12.06003 -4.80833,-2.70244 -6.9966,-2.70227 -3.56088,2.7e-4 4.88765,3.84462 6.91019,9.37499 6.34482,17.34906 -0.27518,3.88102 -0.78873,7.95641 -1.14123,9.05641 -0.3525,1.1 0.71765,-0.7 2.37811,-4 1.9717,-3.91855 3.02011,-7.50756 3.02214,-10.34571 z m 484.57033,231.21008 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.94719,-1.57729 -3.12936,-0.83145 -0.87632,3.58776 1.10395,2.16533 1.99168,5.90753 2.00019,8.43178 0.0184,5.43692 1.57651,3.85117 2.5519,-2.59707 z M 213,315 l 0,-29 -5.35212,0 c -3.90382,0 -6.26099,0.61249 -8.71082,2.26343 -7.84594,5.28738 -13.28126,18.42562 -13.33634,32.23657 -0.037,9.27306 1.8638,14.27046 6.75166,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29 z m 391.13584,16.33606 c 6.08302,-6.54509 7.76566,-15.85691 3.85718,-21.34586 -2.26491,-3.18078 -9.38884,-6.9921 -13.05874,-6.98646 -2.34834,0.004 -2.32523,0.0702 0.65442,1.88721 6.29799,3.84047 10.05194,11.29609 9.1339,18.14058 -0.28021,2.08909 -1.95888,5.90499 -3.73039,8.47979 -3.52999,5.13066 -1.6925,5.02822 3.14363,-0.17526 z M 564,288.56132 c -3.19325,-1.73535 -13.57036,-3.06551 -14.32973,-1.83682 -0.31873,0.51571 1.75677,0.986 4.69228,1.06324 2.89509,0.0762 6.36038,0.57656 7.70063,1.11199 3.59876,1.43769 4.81426,1.22531 1.93682,-0.33841 z"
+       id="path3538"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#be7e37"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.60995,-35.30644 c 46.02859,-23.89989 78.19449,-50.83881 99.85832,-83.6313 22.65981,-34.3001 31.00114,-76.18577 23.22266,-116.61173 -5.46486,-28.40174 -19.88607,-57.6152 -42.25046,-85.58796 C 571.40173,398.55603 547.13024,374.64685 530.48284,361.23396 514.46993,348.33229 496.048,331.67382 493.73073,328 c -0.86728,-1.375 -2.52911,-3.5126 -3.69296,-4.75021 -3.06937,-3.26394 -8.84949,-15.81145 -9.60523,-20.8511 -1.91995,-12.80314 8.86679,-29.10338 31.06746,-46.94719 8.30487,-6.67504 34.60509,-24.25198 46.25,-30.90975 4.5375,-2.59424 8.25,-4.85911 8.25,-5.03306 0,-0.4431 -63.20425,-104.34911 -66.53903,-109.3883 C 497.96126,107.85418 496.55342,106 496.33243,106 c -0.85819,0 -17.14114,9.50283 -22.83243,13.32515 -23.91885,16.0641 -51.42263,40.68606 -69.03808,61.80435 -22.78277,27.31312 -40.67612,63.18115 -46.08052,92.3705 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 6.26219,33.85346 23.41089,66.16927 49.61668,93.5 12.06928,12.58738 17.47374,17.43582 35.66978,32 21.13493,16.91648 37.0288,32.0715 45.83787,43.707 2.82858,3.73615 7.04141,10.58407 9.36184,15.21761 4.02984,8.04695 4.21897,8.83143 4.21897,17.5 0,8.09775 -0.33529,9.7756 -3.11249,15.57539 -7.62873,15.93152 -24.79239,30.26996 -55.62832,46.47162 -10.63245,5.58645 -12.59733,6.97008 -11.87376,8.36129 1.11994,2.15332 5.62988,11.72312 23.4065,49.66709 20.24065,43.20341 28.64453,60.5 29.39508,60.5 0.35404,0 8.05916,-3.8504 17.12249,-8.55644 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 12.03903,-6.01965 17.31997,-9.62971 27.96522,-19.11705 23.84629,-21.25247 39.43648,-47.50275 48.04808,-80.90188 5.88302,-22.81664 6.24248,-28.02576 6.68994,-96.94841 l 0.40901,-63 -7.65402,-11.5 C 342.1635,385.52248 331.84291,360.77108 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 C 362.81163,181.64788 364,179.00102 364,175.58562 l 0,-4.17521 -54.75,-6.27254 c -30.1125,-3.4499 -56.42857,-6.52332 -58.48015,-6.82984 l -3.73015,-0.5573 -0.27155,192.37464 -0.27155,192.37463 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.91103,2.23066 -14.52878,2.46859 -18.42125,0.45572 -11.90231,-6.15493 -19.06263,-38.87001 -19.11909,-87.35403 L 187,480.93111 l -4.75,0.55684 c -2.6125,0.30626 -23.425,1.94143 -46.25,3.6337 -22.825,1.69228 -45.40549,3.37519 -50.178866,3.73981 -4.773376,0.36462 -8.957904,0.94198 -9.298951,1.28302 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 135.54179,-5.5106 c 6.30837,-6.44941 13.6713,-11.07592 20.76618,-13.04847 5.77057,-1.60437 6.35823,-1.60188 10.67076,0.0451 5.80523,2.21703 7.93196,5.9353 7.27938,12.72687 l -0.46452,4.8344 17.81547,0 17.81547,0 -5.52569,-11.75 c -3.03914,-6.4625 -14.15774,-30.14797 -24.708,-52.63438 -18.28119,-38.96378 -19.22365,-40.72539 -20.06245,-37.5 -2.82474,10.86181 -10.2203,31.24064 -14.59958,40.22985 -9.84006,20.19839 -26.05869,41.61193 -41.96344,55.40453 l -7.2071,6.25 17.86266,0 17.86265,0 4.45821,-4.55789 z M 393,686.95455 c 0,-5.44947 -3.76478,-9.45159 -8.07932,-8.58869 -3.55141,0.71029 -12.49001,6.35061 -15.84499,9.99831 L 366.65137,691 l 13.17432,0 13.17431,0 0,-4.04545 z m 6.54967,0.63239 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36264,-2.20329 -3.71373,-1.38998 -1.37783,3.19176 1.09168,2.14127 1.98488,5.14807 1.98488,6.68178 0,3.91586 1.77967,3.47996 2.54967,-0.6245 z m 212.90599,-22.9392 c 7.072,-4.66267 27.93992,-25.16503 32.14159,-31.57855 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42789,-5.74419 4.13349,-6.56919 1.79821,-2.10249 5.09208,-8.84131 6.35428,-13 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26148,-151.72862 -0.39919,-163.09657 -2.07753,-171.5 -2.53901,-12.71276 -8.08847,-30.22918 -12.35578,-39 C 645.75154,167.72315 625.30575,145.76246 602.58095,131.75054 588.62693,123.1466 569.33305,116.11746 554,114.05153 c -4.675,-0.62989 -9.5125,-1.28677 -10.75,-1.45972 -1.2375,-0.17296 -2.25,-0.18914 -2.25,-0.0359 0,0.15318 16.194,26.96178 35.98667,59.57466 19.79266,32.61288 35.65516,59.6027 35.25,59.97738 -0.40517,0.37468 -9.00111,5.24658 -19.10209,10.82646 -40.01903,22.10687 -67.53142,41.37277 -75.49785,52.86834 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05918,0.85902 1.41096,0.91441 0.95207,0.14991 -1.09075,-1.81718 3.91278,-10.91228 8.9884,-16.33853 14.71124,-15.7275 40.61203,-13.00831 48.11212,5.05104 0.79946,1.925 1.53599,3.59223 1.63675,3.70495 0.10075,0.11272 1.96596,-0.43003 4.1449,-1.20611 4.82117,-1.71716 11.59133,-1.86813 16.95842,-0.37814 5.16614,1.4342 11.93697,8.16871 13.347,13.27539 2.34308,8.48596 -3.12623,20.28534 -12.21976,26.36262 -9.38981,6.27529 -17.96901,7.40648 -26.89893,3.54667 -3.7447,-1.61857 -3.79859,-1.60907 -6.71385,1.18393 -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.30583,-1.08373 -0.8897,-1.96799 3.10184,-6.59137 l 4.60998,-5.33973 2.93893,2.93892 c 1.61641,1.61641 3.29806,2.93893 3.737,2.93893 0.43895,0 2.15229,0.27084 3.80744,0.60187 2.52007,0.50402 3.70516,-0.0244 7.28889,-3.25 10.1419,-9.12842 12.62959,-17.04762 7.68182,-24.45399 -4.0052,-5.99541 -12.35342,-8.41221 -18.92998,-5.48021 -1.31686,0.58709 -2.02592,-0.0224 -3.14673,-2.70487 C 572.471,296.0964 562.35581,291.10173 548.5,290.30509 c -8.28516,-0.47635 -9.27488,-0.32924 -12.46083,1.85219 -4.21175,2.8838 -8.42818,8.81863 -10.50307,14.78355 -1.5327,4.40625 -1.5233,4.46334 1.20959,7.34098 1.51487,1.59511 6.80431,6.1073 11.75431,10.02709 17.76796,14.07005 27.22484,22.33807 41.35337,36.15467 21.95266,21.46799 38.49612,41.63906 50.18255,61.18647 2.91004,4.86751 5.38523,8.9803 5.50041,9.13955 0.11518,0.15925 2.94747,-0.4717 6.29398,-1.40211 5.74435,-1.59708 6.33972,-1.59421 10.64842,0.0513 7.69381,2.93829 9.333,9.22466 5.43482,20.84282 -2.35353,7.01446 -5.90693,13.84058 -6.88892,13.23368 -0.35903,-0.2219 0.79101,4.6339 2.55566,10.79066 5.72236,19.96502 6.87536,28.82685 6.85597,52.69411 -0.0145,17.84551 -0.38761,23.45473 -2.1951,33 -7.38206,38.98442 -25.72939,73.12191 -57.01315,106.08007 l -10.72801,11.3022 7.95566,-4.3747 c 4.37561,-2.40609 10.67561,-6.16802 14,-8.35983 z M 651.2,598.8 c -2.97422,-2.97422 0.12137,-9.36347 6.01261,-12.40995 2.5925,-1.34063 3.23917,-1.36684 4.42659,-0.17942 1.98749,1.98749 0.69587,7.21916 -2.67255,10.82507 -2.91572,3.12129 -5.76289,3.76806 -7.76665,1.7643 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 416.5,564.47422 c 28.68412,-13.98935 41.52589,-22.74471 49.62119,-33.83112 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.4875,-13.49567 -20.75,-17.29892 l -7.75,-6.915 0,41.65901 c 0,40.22486 -0.82426,57.93826 -3.40911,73.26243 -1.20452,7.14091 -1.19079,7.24862 0.84232,6.608 C 394.56994,575.00906 404.95,570.1072 416.5,564.47422 z M 407.2,512.8 c -2.97422,-2.97422 0.12137,-9.36347 6.01261,-12.40995 2.67992,-1.38583 3.20955,-1.39646 4.51544,-0.0906 2.0575,2.0575 0.83464,6.88665 -2.70277,10.67346 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-59.93777 c 0.0193,-8.99363 -1.8229,-11.8228 -7.77243,-11.93663 l -3.96456,-0.0759 4.24752,8.57585 c 2.33613,4.71672 4.5796,9.64781 4.98547,10.95798 1.25428,4.04883 2.48712,0.34569 2.504,-7.52135 z m -495.27178,3.6091 C 182.98001,447.78645 208.29251,446 209.96291,446 l 3.03709,0 0,-49 0,-49 -4.98927,0 c -9.75498,0 -20.26789,-5.77227 -24.23745,-13.30793 -1.79718,-3.4117 -2.21202,-5.86745 -2.22848,-13.19207 -0.0111,-4.95 0.60098,-11.25 1.36022,-14 3.78607,-13.71313 13.20508,-24.73893 24.01248,-28.10876 l 6.0654,-1.89124 0.009,-78.25 c 0.005,-49.9163 0.36001,-78.25 0.97919,-78.25 0.53386,0 35.07136,3.82191 76.75,8.49312 41.67865,4.67122 82.27672,9.17511 90.21794,10.00863 l 14.43857,1.51551 11.06143,-10.8087 c 6.08378,-5.94479 13.07538,-12.49119 15.53689,-14.54756 l 4.47547,-3.73885 -105.97547,0.3275 c -76.321,0.23586 -106.95485,0.64906 -109.47547,1.47665 -1.925,0.63203 -7.0605,1.8654 -11.41221,2.74082 -9.05953,1.82248 -28.81389,9.3297 -35.85281,13.6251 C 161.11421,131.6915 158.7097,133 158.39161,133 c -0.3181,0 -4.69884,3.10008 -9.73498,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.99267,9.20077 -2.069938,13.00374 -2.453118,120.73645 l -0.395642,111.23646 4.290738,-0.51657 c 2.359906,-0.28412 28.236548,-2.30302 57.503648,-4.48646 z M 97.2,392.8 c -2.974216,-2.97422 0.121375,-9.36347 6.01261,-12.40995 2.67992,-1.38583 3.20955,-1.39646 4.51544,-0.0906 2.0575,2.0575 0.83464,6.88665 -2.70277,10.67346 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 31.82153,-141.69212 c -4.74539,-2.06769 -9.25119,-7.88842 -10.00678,-12.92703 -1.74659,-11.64709 8.02187,-30.22856 18.88282,-35.9187 9.17756,-4.80821 22.99647,-1.71632 28.32647,6.33785 5.25728,7.94429 1.36372,22.65393 -8.87981,33.54738 -8.66131,9.21086 -19.71924,12.70927 -28.3227,8.9605 z m 15.59935,-3.72018 c 1.781,-0.6823 3.71586,-3.21956 6.2436,-8.18747 6.71952,-13.20626 7.19591,-21.75876 1.56897,-28.16749 -5.81442,-6.62226 -16.60326,-5.5745 -22.51351,2.1864 -6.67536,8.7656 -9.47085,22.9339 -5.76333,29.21022 3.68921,6.24533 11.90733,8.23653 20.46427,4.95834 z m 19.91612,-28.73196 c 0.004,-5.47688 -2.27593,-9.38081 -7.04296,-12.06003 -4.80833,-2.70244 -6.9966,-2.70227 -3.56088,2.7e-4 4.88765,3.84462 6.91019,9.37499 6.34482,17.34906 -0.27518,3.88102 -0.78873,7.95641 -1.14123,9.05641 -0.3525,1.1 0.71765,-0.7 2.37811,-4 1.9717,-3.91855 3.02011,-7.50756 3.02214,-10.34571 z m 484.57033,231.21008 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.94719,-1.57729 -3.12936,-0.83145 -0.87632,3.58776 1.10395,2.16533 1.99168,5.90753 2.00019,8.43178 0.0184,5.43692 1.57651,3.85117 2.5519,-2.59707 z M 213,315 l 0,-29 -5.35212,0 c -3.90382,0 -6.26099,0.61249 -8.71082,2.26343 -7.84594,5.28738 -13.28126,18.42562 -13.33634,32.23657 -0.037,9.27306 1.8638,14.27046 6.75166,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29 z m 391.13584,16.33606 c 6.08302,-6.54509 7.76566,-15.85691 3.85718,-21.34586 -2.26491,-3.18078 -9.38884,-6.9921 -13.05874,-6.98646 -2.34834,0.004 -2.32523,0.0702 0.65442,1.88721 6.29799,3.84047 10.05194,11.29609 9.1339,18.14058 -0.28021,2.08909 -1.95888,5.90499 -3.73039,8.47979 -3.52999,5.13066 -1.6925,5.02822 3.14363,-0.17526 z M 564,288.56132 c -3.19325,-1.73535 -13.57036,-3.06551 -14.32973,-1.83682 -0.31873,0.51571 1.75677,0.986 4.69228,1.06324 2.89509,0.0762 6.36038,0.57656 7.70063,1.11199 3.59876,1.43769 4.81426,1.22531 1.93682,-0.33841 z"
+       id="path3536"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#aa8d3a"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.60995,-35.30644 c 46.02859,-23.89989 78.19449,-50.83881 99.85832,-83.6313 22.65981,-34.3001 31.00114,-76.18577 23.22266,-116.61173 -5.4635,-28.39469 -19.86963,-57.58166 -42.24459,-85.58796 C 571.4021,398.53894 547.13675,374.63373 530.49325,361.23396 514.49365,348.3526 496.05327,331.68218 493.73073,328 c -0.86728,-1.375 -2.52911,-3.5126 -3.69296,-4.75021 -3.06937,-3.26394 -8.84949,-15.81145 -9.60523,-20.8511 -2.56233,-17.0868 16.0424,-38.50611 56.21197,-64.7159 7.07052,-4.61336 16.56799,-10.51866 21.10549,-13.12288 4.5375,-2.60422 8.25,-4.87727 8.25,-5.05122 0,-0.4431 -63.20425,-104.34911 -66.53903,-109.3883 C 497.96126,107.85418 496.55342,106 496.33243,106 c -0.85819,0 -17.14114,9.50283 -22.83243,13.32515 -23.91885,16.0641 -51.42263,40.68606 -69.03808,61.80435 -22.78277,27.31312 -40.67612,63.18115 -46.08052,92.3705 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 6.26219,33.85346 23.41089,66.16927 49.61668,93.5 12.06928,12.58738 17.47374,17.43582 35.66978,32 21.13493,16.91648 37.0288,32.0715 45.83787,43.707 2.82858,3.73615 7.04141,10.58407 9.36184,15.21761 4.02984,8.04695 4.21897,8.83143 4.21897,17.5 0,8.09775 -0.33529,9.7756 -3.11249,15.57539 -7.62873,15.93152 -24.79239,30.26996 -55.62832,46.47162 -10.63245,5.58645 -12.59733,6.97008 -11.87376,8.36129 1.11994,2.15332 5.62988,11.72312 23.4065,49.66709 20.24065,43.20341 28.64453,60.5 29.39508,60.5 0.35404,0 8.05916,-3.8504 17.12249,-8.55644 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 12.03903,-6.01965 17.31997,-9.62971 27.96522,-19.11705 23.84629,-21.25247 39.43648,-47.50275 48.04808,-80.90188 5.88302,-22.81664 6.24248,-28.02576 6.68994,-96.94841 l 0.40901,-63 -7.65402,-11.5 C 342.1635,385.52248 331.84291,360.77108 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 C 362.81163,181.64788 364,179.00102 364,175.58562 l 0,-4.17521 -54.75,-6.27254 c -30.1125,-3.4499 -56.42857,-6.52332 -58.48015,-6.82984 l -3.73015,-0.5573 -0.27155,192.37464 -0.27155,192.37463 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.91103,2.23066 -14.52878,2.46859 -18.42125,0.45572 -11.90231,-6.15493 -19.06263,-38.87001 -19.11909,-87.35403 L 187,480.93111 l -4.75,0.55684 c -2.6125,0.30626 -23.425,1.94143 -46.25,3.6337 -22.825,1.69228 -45.40549,3.37519 -50.178866,3.73981 -4.773376,0.36462 -8.957904,0.94198 -9.298951,1.28302 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 135.54179,-5.5106 c 6.30837,-6.44941 13.6713,-11.07592 20.76618,-13.04847 5.77057,-1.60437 6.35823,-1.60188 10.67076,0.0451 5.80523,2.21703 7.93196,5.9353 7.27938,12.72687 l -0.46452,4.8344 17.81547,0 17.81547,0 -5.52569,-11.75 c -3.03914,-6.4625 -14.15774,-30.14797 -24.708,-52.63438 -18.28119,-38.96378 -19.22365,-40.72539 -20.06245,-37.5 -2.82474,10.86181 -10.2203,31.24064 -14.59958,40.22985 -9.84006,20.19839 -26.05869,41.61193 -41.96344,55.40453 l -7.2071,6.25 17.86266,0 17.86265,0 4.45821,-4.55789 z M 393,686.95455 c 0,-5.44947 -3.76478,-9.45159 -8.07932,-8.58869 -3.55141,0.71029 -12.49001,6.35061 -15.84499,9.99831 L 366.65137,691 l 13.17432,0 13.17431,0 0,-4.04545 z m 6.54967,0.63239 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36264,-2.20329 -3.71373,-1.38998 -1.37783,3.19176 1.09168,2.14127 1.98488,5.14807 1.98488,6.68178 0,3.91586 1.77967,3.47996 2.54967,-0.6245 z m 212.90599,-22.9392 c 7.072,-4.66267 27.93992,-25.16503 32.14159,-31.57855 1.59651,-2.43694 4.18551,-6.71194 5.75332,-9.5 1.56782,-2.78805 3.42789,-5.74419 4.13349,-6.56919 1.79821,-2.10249 5.09208,-8.84131 6.35428,-13 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26148,-151.72862 -0.39919,-163.09657 -2.07753,-171.5 -2.53901,-12.71276 -8.08847,-30.22918 -12.35578,-39 C 645.75154,167.72315 625.30575,145.76246 602.58095,131.75054 588.62693,123.1466 569.33305,116.11746 554,114.05153 c -4.675,-0.62989 -9.5125,-1.28677 -10.75,-1.45972 -1.2375,-0.17296 -2.25,-0.18914 -2.25,-0.0359 0,0.15318 16.194,26.96178 35.98667,59.57466 19.79266,32.61288 35.65516,59.6027 35.25,59.97738 -0.40517,0.37468 -9.00111,5.24658 -19.10209,10.82646 -40.01903,22.10687 -67.53142,41.37277 -75.49785,52.86834 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05918,0.85902 1.41096,0.91441 0.95207,0.14991 -1.09075,-1.81718 3.91278,-10.91228 8.9884,-16.33853 14.71124,-15.7275 40.61203,-13.00831 48.11212,5.05104 0.79946,1.925 1.53599,3.59223 1.63675,3.70495 0.10075,0.11272 1.96596,-0.43003 4.1449,-1.20611 4.82117,-1.71716 11.59133,-1.86813 16.95842,-0.37814 5.16614,1.4342 11.93697,8.16871 13.347,13.27539 2.34308,8.48596 -3.12623,20.28534 -12.21976,26.36262 -9.38981,6.27529 -17.96901,7.40648 -26.89893,3.54667 -3.7447,-1.61857 -3.79859,-1.60907 -6.71385,1.18393 -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.30583,-1.08373 -0.8897,-1.96799 3.10184,-6.59137 l 4.60998,-5.33973 2.93893,2.93892 c 1.61641,1.61641 3.29806,2.93893 3.737,2.93893 0.43895,0 2.15229,0.27084 3.80744,0.60187 2.52007,0.50402 3.70516,-0.0244 7.28889,-3.25 10.1419,-9.12842 12.62959,-17.04762 7.68182,-24.45399 -4.0052,-5.99541 -12.35342,-8.41221 -18.92998,-5.48021 -1.31686,0.58709 -2.02592,-0.0224 -3.14673,-2.70487 C 572.471,296.0964 562.35581,291.10173 548.5,290.30509 c -8.28516,-0.47635 -9.27488,-0.32924 -12.46083,1.85219 -4.21175,2.8838 -8.42818,8.81863 -10.50307,14.78355 -1.5327,4.40625 -1.5233,4.46334 1.20959,7.34098 1.51487,1.59511 6.80431,6.1073 11.75431,10.02709 17.76796,14.07005 27.22484,22.33807 41.35337,36.15467 21.95266,21.46799 38.49612,41.63906 50.18255,61.18647 2.91004,4.86751 5.38523,8.9803 5.50041,9.13955 0.11518,0.15925 2.94747,-0.4717 6.29398,-1.40211 5.74435,-1.59708 6.33972,-1.59421 10.64842,0.0513 7.69381,2.93829 9.333,9.22466 5.43482,20.84282 -2.35353,7.01446 -5.90693,13.84058 -6.88892,13.23368 -0.35903,-0.2219 0.79101,4.6339 2.55566,10.79066 5.72236,19.96502 6.87536,28.82685 6.85597,52.69411 -0.0145,17.84551 -0.38761,23.45473 -2.1951,33 -7.38206,38.98442 -25.72939,73.12191 -57.01315,106.08007 l -10.72801,11.3022 7.95566,-4.3747 c 4.37561,-2.40609 10.67561,-6.16802 14,-8.35983 z M 651.2,598.8 c -2.97422,-2.97422 0.12137,-9.36347 6.01261,-12.40995 2.5925,-1.34063 3.23917,-1.36684 4.42659,-0.17942 1.98749,1.98749 0.69587,7.21916 -2.67255,10.82507 -2.91572,3.12129 -5.76289,3.76806 -7.76665,1.7643 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 416.5,564.47422 c 28.68412,-13.98935 41.52589,-22.74471 49.62119,-33.83112 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.4875,-13.49567 -20.75,-17.29892 l -7.75,-6.915 0,41.65901 c 0,40.22486 -0.82426,57.93826 -3.40911,73.26243 -1.20452,7.14091 -1.19079,7.24862 0.84232,6.608 C 394.56994,575.00906 404.95,570.1072 416.5,564.47422 z M 407.2,512.8 c -2.97422,-2.97422 0.12137,-9.36347 6.01261,-12.40995 2.67992,-1.38583 3.20955,-1.39646 4.51544,-0.0906 2.0575,2.0575 0.83464,6.88665 -2.70277,10.67346 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-59.93777 c 0.0193,-8.99363 -1.8229,-11.8228 -7.77243,-11.93663 l -3.96456,-0.0759 4.24752,8.57585 c 2.33613,4.71672 4.5796,9.64781 4.98547,10.95798 1.25428,4.04883 2.48712,0.34569 2.504,-7.52135 z m -495.27178,3.6091 C 182.98001,447.78645 208.29251,446 209.96291,446 l 3.03709,0 0,-49 0,-49 -4.98927,0 c -9.75498,0 -20.26789,-5.77227 -24.23745,-13.30793 -1.79718,-3.4117 -2.21202,-5.86745 -2.22848,-13.19207 -0.0111,-4.95 0.60098,-11.25 1.36022,-14 3.78607,-13.71313 13.20508,-24.73893 24.01248,-28.10876 l 6.0654,-1.89124 0.009,-78.25 c 0.005,-49.9163 0.36001,-78.25 0.97919,-78.25 0.53386,0 35.07136,3.82191 76.75,8.49312 41.67865,4.67122 82.27672,9.17511 90.21794,10.00863 l 14.43857,1.51551 11.06143,-10.8087 c 6.08378,-5.94479 13.07538,-12.49119 15.53689,-14.54756 l 4.47547,-3.73885 -105.97547,0.3275 c -76.321,0.23586 -106.95485,0.64906 -109.47547,1.47665 -1.925,0.63203 -7.0605,1.8654 -11.41221,2.74082 -9.05953,1.82248 -28.81389,9.3297 -35.85281,13.6251 C 161.11421,131.6915 158.7097,133 158.39161,133 c -0.3181,0 -4.69884,3.10008 -9.73498,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.99267,9.20077 -2.069938,13.00374 -2.453118,120.73645 l -0.395642,111.23646 4.290738,-0.51657 c 2.359906,-0.28412 28.236548,-2.30302 57.503648,-4.48646 z M 97.2,392.8 c -2.974216,-2.97422 0.121375,-9.36347 6.01261,-12.40995 2.67992,-1.38583 3.20955,-1.39646 4.51544,-0.0906 2.0575,2.0575 0.83464,6.88665 -2.70277,10.67346 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 31.82153,-141.69212 c -4.74539,-2.06769 -9.25119,-7.88842 -10.00678,-12.92703 -1.74659,-11.64709 8.02187,-30.22856 18.88282,-35.9187 9.17756,-4.80821 22.99647,-1.71632 28.32647,6.33785 5.25728,7.94429 1.36372,22.65393 -8.87981,33.54738 -8.66131,9.21086 -19.71924,12.70927 -28.3227,8.9605 z m 15.59935,-3.72018 c 1.781,-0.6823 3.71586,-3.21956 6.2436,-8.18747 6.71952,-13.20626 7.19591,-21.75876 1.56897,-28.16749 -5.81442,-6.62226 -16.60326,-5.5745 -22.51351,2.1864 -6.67536,8.7656 -9.47085,22.9339 -5.76333,29.21022 3.68921,6.24533 11.90733,8.23653 20.46427,4.95834 z m 19.91612,-28.73196 c 0.004,-5.47688 -2.27593,-9.38081 -7.04296,-12.06003 -4.80833,-2.70244 -6.9966,-2.70227 -3.56088,2.7e-4 4.88765,3.84462 6.91019,9.37499 6.34482,17.34906 -0.27518,3.88102 -0.78873,7.95641 -1.14123,9.05641 -0.3525,1.1 0.71765,-0.7 2.37811,-4 1.9717,-3.91855 3.02011,-7.50756 3.02214,-10.34571 z m 484.57033,231.21008 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.94719,-1.57729 -3.12936,-0.83145 -0.87632,3.58776 1.10395,2.16533 1.99168,5.90753 2.00019,8.43178 0.0184,5.43692 1.57651,3.85117 2.5519,-2.59707 z M 213,315 l 0,-29 -5.35212,0 c -3.90382,0 -6.26099,0.61249 -8.71082,2.26343 -7.84594,5.28738 -13.28126,18.42562 -13.33634,32.23657 -0.037,9.27306 1.8638,14.27046 6.75166,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29 z m 391.13584,16.33606 c 6.08302,-6.54509 7.76566,-15.85691 3.85718,-21.34586 -2.26491,-3.18078 -9.38884,-6.9921 -13.05874,-6.98646 -2.34834,0.004 -2.32523,0.0702 0.65442,1.88721 6.29799,3.84047 10.05194,11.29609 9.1339,18.14058 -0.28021,2.08909 -1.95888,5.90499 -3.73039,8.47979 -3.52999,5.13066 -1.6925,5.02822 3.14363,-0.17526 z M 564,288.56132 c -3.19325,-1.73535 -13.57036,-3.06551 -14.32973,-1.83682 -0.31873,0.51571 1.75677,0.986 4.69228,1.06324 2.89509,0.0762 6.36038,0.57656 7.70063,1.11199 3.59876,1.43769 4.81426,1.22531 1.93682,-0.33841 z"
+       id="path3534"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#9c8a48"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.50284,-35.25083 c 19.07125,-9.90255 32.29968,-17.99109 45.63175,-27.90157 42.36771,-31.49433 67.73845,-67.38997 76.6972,-108.51459 C 639.39609,491.55201 607.15414,423.00252 529,360.03723 514.27201,348.17155 495.96491,331.54209 493.73073,328 c -0.86728,-1.375 -2.52911,-3.5126 -3.69296,-4.75021 -3.26218,-3.46897 -8.78307,-15.76248 -9.53543,-21.2328 -2.67969,-19.48365 23.41331,-45.91242 75.23302,-76.20116 C 561.38091,222.51599 566,219.67579 566,219.50427 566,219.06417 502.77489,115.12805 499.46097,110.12039 497.96126,107.85418 496.55342,106 496.33243,106 c -0.85819,0 -17.14114,9.50283 -22.83243,13.32515 -23.90877,16.05733 -51.48531,40.69589 -68.70521,61.38541 -23.17939,27.84979 -40.97799,63.43267 -46.41339,92.78944 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 5.34443,28.89201 16.9438,53.41781 37.83566,80 11.86638,15.09845 25.42253,28.08324 48.02406,46 42.04269,33.32821 60.75437,58.35868 59.09355,79.04898 -1.59383,19.85579 -20.39223,38.64346 -58.91999,58.88635 l -12.67185,6.65793 3.50223,7.68514 c 1.92622,4.22683 4.11588,8.81834 4.8659,10.20337 0.75002,1.38503 7.8748,16.46823 15.83284,33.51823 19.75737,42.32992 28.56604,60.5 29.32975,60.5 0.35404,0 8.01096,-3.82537 17.01538,-8.50083 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 12.03903,-6.01965 17.31997,-9.62971 27.96522,-19.11705 28.84361,-25.70621 45.62538,-58.63758 52.66756,-103.35109 1.3715,-8.70822 1.7245,-21.3312 2.06937,-73.9992 l 0.41579,-63.5 -7.65686,-11.5 C 342.16743,385.53209 331.84392,360.77605 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 C 362.81163,181.64788 364,179.00102 364,175.58562 l 0,-4.17521 -54.75,-6.27254 c -30.1125,-3.4499 -56.42857,-6.52332 -58.48015,-6.82984 l -3.73015,-0.5573 -0.27155,192.37464 -0.27155,192.37463 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.94443,2.24583 -14.53695,2.46436 -18.48801,0.42119 -6.32425,-3.27039 -12.35995,-16.97518 -15.49513,-35.18354 -1.91913,-11.14583 -3.53706,-34.84717 -3.5572,-52.11026 L 187,480.98253 l -5.25,0.54167 c -2.8875,0.29791 -23.7,1.91967 -46.25,3.6039 -22.55,1.68423 -44.90549,3.3624 -49.678866,3.72927 -4.773376,0.36687 -8.957904,0.94607 -9.298951,1.28711 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 135.54179,-5.5106 c 6.30837,-6.44941 13.6713,-11.07592 20.76618,-13.04847 5.77057,-1.60437 6.35823,-1.60188 10.67076,0.0451 5.80523,2.21703 7.93196,5.9353 7.27938,12.72687 l -0.46452,4.8344 17.81547,0 17.81547,0 -5.28338,-11.25 c -2.90586,-6.1875 -14.02497,-29.87119 -24.70913,-52.63041 -18.50127,-39.41108 -19.46759,-41.21954 -20.30477,-38 -2.82281,10.85571 -10.21971,31.23778 -14.59844,40.22588 -9.82468,20.16682 -26.03017,41.5406 -42.06022,55.47414 L 324.85827,691 l 17.86266,0 17.86265,0 4.45821,-4.55789 z M 393,686.95455 c 0,-5.44947 -3.76478,-9.45159 -8.07932,-8.58869 -3.55141,0.71029 -12.49001,6.35061 -15.84499,9.99831 L 366.65137,691 l 13.17432,0 13.17431,0 0,-4.04545 z m 6.54967,0.63239 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36264,-2.20329 -3.71373,-1.38998 -1.37783,3.19176 1.09168,2.14127 1.98488,5.14807 1.98488,6.68178 0,3.91586 1.77967,3.47996 2.54967,-0.6245 z M 612.06699,664.9059 c 7.29688,-4.81309 28.14997,-25.18199 32.53026,-31.77493 1.59651,-2.40297 3.93716,-6.22797 5.20143,-8.5 1.26428,-2.27203 3.11729,-5.26978 4.11779,-6.66165 2.55253,-3.551 5.6683,-9.83908 6.92187,-13.96932 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26148,-151.72862 -0.39919,-163.09657 -2.07753,-171.5 -2.53901,-12.71276 -8.08847,-30.22918 -12.35578,-39 -6.17059,-12.68274 -16.42176,-26.42324 -27.89951,-37.39604 C 616.06331,140.26487 607.30716,133.90934 591.99578,125.64621 585.06353,121.90506 563.4743,115.31287 554,114.04435 c -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.17126 -2.25,0.004 0,0.17503 15.76173,26.26413 35.02607,57.97578 19.26434,31.71164 35.46052,58.46931 35.99151,59.46148 0.84727,1.58313 -1.33988,3.08316 -17.86788,12.25451 -41.08731,22.79923 -68.52667,41.9911 -76.51297,53.51534 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 1.05918,0.85902 1.41096,0.91441 0.95207,0.14991 -1.09075,-1.81718 3.91278,-10.91228 8.9884,-16.33853 14.71124,-15.7275 40.61203,-13.00831 48.11212,5.05104 0.79946,1.925 1.53599,3.59223 1.63675,3.70495 0.10075,0.11272 1.96596,-0.43003 4.1449,-1.20611 4.82117,-1.71716 11.59133,-1.86813 16.95842,-0.37814 5.16614,1.4342 11.93697,8.16871 13.347,13.27539 2.34308,8.48596 -3.12623,20.28534 -12.21976,26.36262 -9.38981,6.27529 -17.96901,7.40648 -26.89893,3.54667 -3.7447,-1.61857 -3.79859,-1.60907 -6.71385,1.18393 -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.30583,-1.08373 -0.8897,-1.96799 3.10184,-6.59137 l 4.60998,-5.33973 2.93893,2.93892 c 1.61641,1.61641 3.29806,2.93893 3.737,2.93893 0.43895,0 2.15229,0.27084 3.80744,0.60187 2.52007,0.50402 3.70516,-0.0244 7.28889,-3.25 10.1419,-9.12842 12.62959,-17.04762 7.68182,-24.45399 -4.0052,-5.99541 -12.35342,-8.41221 -18.92998,-5.48021 -1.31686,0.58709 -2.02592,-0.0224 -3.14673,-2.70487 C 572.471,296.09657 562.35581,291.1019 548.5,290.30526 c -8.28516,-0.47635 -9.27488,-0.32924 -12.46083,1.85219 -4.21002,2.88261 -8.42798,8.81808 -10.50061,14.77635 -1.48919,4.28099 -1.46477,4.51754 0.70959,6.87321 1.23852,1.3418 10.12463,8.79669 19.74691,16.56642 36.23935,29.26229 66.82645,62.48294 84.04086,91.27678 2.91004,4.86751 5.38523,8.9803 5.50041,9.13955 0.11518,0.15925 2.94747,-0.4717 6.29398,-1.40211 5.74435,-1.59708 6.33972,-1.59421 10.64842,0.0513 7.69381,2.93829 9.333,9.22466 5.43482,20.84282 -2.35353,7.01446 -5.90693,13.84058 -6.88892,13.23368 -0.35903,-0.2219 0.78992,4.6339 2.55322,10.79066 4.5918,16.03273 6.48784,28.06764 7.13271,45.27416 2.03476,54.29199 -17.36818,102.15322 -59.33968,146.37319 L 590.5,677.40649 l 7.56699,-4.12865 c 4.16184,-2.27076 10.46184,-6.03813 14,-8.37194 z M 651.2,598.8 c -2.97422,-2.97422 0.12137,-9.36347 6.01261,-12.40995 2.5925,-1.34063 3.23917,-1.36684 4.42659,-0.17942 1.98749,1.98749 0.69587,7.21916 -2.67255,10.82507 -2.91572,3.12129 -5.76289,3.76806 -7.76665,1.7643 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 415.19993,565.11511 c 30.04122,-14.66342 42.72872,-23.25244 50.92126,-34.47201 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.4875,-13.49567 -20.75,-17.29892 l -7.75,-6.915 0,41.65901 c 0,40.21767 -0.82432,57.9385 -3.40753,73.25319 -0.67259,3.9875 -0.87858,7.25 -0.45775,7.25 0.42083,0 10.80018,-4.8982 23.06521,-10.88489 z M 407.2,512.8 c -2.97422,-2.97422 0.12137,-9.36347 6.01261,-12.40995 2.67992,-1.38583 3.20955,-1.39646 4.51544,-0.0906 2.0575,2.0575 0.83464,6.88665 -2.70277,10.67346 -2.96908,3.17841 -5.81051,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-59.93777 c 0.0193,-8.9823 -1.82511,-11.82284 -7.75023,-11.93622 l -3.94237,-0.0754 5.10396,10.69165 c 2.93513,6.14846 5.41614,10.21733 5.83864,9.57543 0.40408,-0.61391 0.74158,-4.32886 0.75,-8.25543 z M 153.8842,449.97275 C 183.2455,447.78774 208.558,446 210.1342,446 l 2.8658,0 0,-49 0,-49 -4.98927,0 c -9.75498,0 -20.26789,-5.77227 -24.23745,-13.30793 -1.79718,-3.4117 -2.21202,-5.86745 -2.22848,-13.19207 -0.0111,-4.95 0.60098,-11.25 1.36022,-14 3.78607,-13.71313 13.20508,-24.73893 24.01248,-28.10876 l 6.0654,-1.89124 0.009,-78.25 c 0.005,-43.0375 0.34605,-78.25114 0.75855,-78.25254 0.4125,-0.001 41.40843,4.5409 91.10206,10.09399 l 90.35206,10.09653 11.14794,-10.89406 c 6.13137,-5.99174 13.15976,-12.57471 15.61865,-14.62884 l 4.4707,-3.73477 -105.9707,0.31891 C 243.87815,112.47971 213.5297,112.88795 211,113.72178 c -1.925,0.63451 -7.0605,1.86992 -11.41221,2.74534 -9.05953,1.82248 -28.81389,9.3297 -35.85281,13.6251 C 161.11421,131.6915 158.7097,133 158.39161,133 c -0.3181,0 -4.69884,3.10008 -9.73498,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.99267,9.20077 -2.069938,13.00374 -2.453118,120.73645 l -0.395642,111.23646 4.290738,-0.51371 c 2.359906,-0.28254 28.313628,-2.30144 57.674938,-4.48645 z M 97.2,392.8 c -2.974216,-2.97422 0.121375,-9.36347 6.01261,-12.40995 2.67992,-1.38583 3.20955,-1.39646 4.51544,-0.0906 2.0575,2.0575 0.83464,6.88665 -2.70277,10.67346 -2.96908,3.17841 -5.810507,3.84183 -7.82528,1.82706 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 31.82153,-141.69212 c -4.74539,-2.06769 -9.25119,-7.88842 -10.00678,-12.92703 -1.74659,-11.64709 8.02187,-30.22856 18.88282,-35.9187 9.17756,-4.80821 22.99647,-1.71632 28.32647,6.33785 5.25728,7.94429 1.36372,22.65393 -8.87981,33.54738 -8.66131,9.21086 -19.71924,12.70927 -28.3227,8.9605 z m 15.59935,-3.72018 c 1.781,-0.6823 3.71586,-3.21956 6.2436,-8.18747 6.71952,-13.20626 7.19591,-21.75876 1.56897,-28.16749 -5.81442,-6.62226 -16.60326,-5.5745 -22.51351,2.1864 -6.67536,8.7656 -9.47085,22.9339 -5.76333,29.21022 3.68921,6.24533 11.90733,8.23653 20.46427,4.95834 z m 19.91612,-28.68591 c 0.004,-5.756 -1.98557,-9.26367 -6.785,-11.9611 -5.32339,-2.99191 -7.08016,-2.84073 -3.36045,0.2892 4.41369,3.71387 6.53879,10.11133 5.88749,17.72384 -0.29399,3.43624 -0.81548,7.14772 -1.15887,8.24772 -0.34338,1.1 0.73423,-0.7 2.39469,-4 1.95682,-3.88899 3.02012,-7.51277 3.02214,-10.29966 z m 484.57033,231.16403 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.94719,-1.57729 -3.12936,-0.83145 -0.87632,3.58776 1.10395,2.16533 1.99168,5.90753 2.00019,8.43178 0.0184,5.43692 1.57651,3.85117 2.5519,-2.59707 z M 213,315 l 0,-29 -5.35212,0 c -3.90382,0 -6.26099,0.61249 -8.71082,2.26343 -7.84594,5.28738 -13.28126,18.42562 -13.33634,32.23657 -0.037,9.27306 1.8638,14.27046 6.75166,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29 z m 390.34158,17.05001 c 6.49042,-5.82444 8.71148,-16.35801 4.65144,-22.05981 -2.26491,-3.18078 -9.38884,-6.9921 -13.05874,-6.98646 -2.34834,0.004 -2.32523,0.0702 0.65442,1.88721 6.32801,3.85878 10.05178,11.29724 9.1228,18.22333 -0.30194,2.25113 -2.10141,6.08693 -4.28471,9.13341 -3.65831,5.10463 -2.93946,5.05588 2.91479,-0.19768 z M 563.94861,288.53209 C 560.47039,286.6401 549,285.36538 549,286.87083 c 0,0.69983 2.18633,1.15589 5.75,1.19946 3.1625,0.0387 6.65,0.45702 7.75,0.92971 3.20982,1.37931 4.23548,1.04801 1.44861,-0.46791 z"
+       id="path3532"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b38434"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.50284,-35.25083 c 19.07125,-9.90255 32.29968,-17.99109 45.63175,-27.90157 42.36771,-31.49433 67.73845,-67.38997 76.6972,-108.51459 C 639.39609,491.55201 607.15414,423.00252 529,360.03723 514.27201,348.17155 495.96491,331.54209 493.73073,328 c -0.86728,-1.375 -2.52911,-3.5126 -3.69296,-4.75021 -3.26218,-3.46897 -8.78307,-15.76248 -9.53543,-21.2328 -2.67969,-19.48365 23.41331,-45.91242 75.23302,-76.20116 C 561.38091,222.51599 566,219.67579 566,219.50427 566,219.06417 502.77489,115.12805 499.46097,110.12039 497.96126,107.85418 496.55342,106 496.33243,106 c -0.85819,0 -17.14114,9.50283 -22.83243,13.32515 -23.90877,16.05733 -51.48531,40.69589 -68.70521,61.38541 -23.17939,27.84979 -40.97799,63.43267 -46.41339,92.78944 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 5.34443,28.89201 16.9438,53.41781 37.83566,80 11.86638,15.09845 25.42253,28.08324 48.02406,46 42.04269,33.32821 60.75437,58.35868 59.09355,79.04898 -1.59383,19.85579 -20.39223,38.64346 -58.91999,58.88635 l -12.67185,6.65793 3.50223,7.68514 c 1.92622,4.22683 4.11588,8.81834 4.8659,10.20337 0.75002,1.38503 7.8748,16.46823 15.83284,33.51823 19.75737,42.32992 28.56604,60.5 29.32975,60.5 0.35404,0 8.01096,-3.82537 17.01538,-8.50083 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 12.03903,-6.01965 17.31997,-9.62971 27.96522,-19.11705 28.84361,-25.70621 45.62538,-58.63758 52.66756,-103.35109 1.3715,-8.70822 1.7245,-21.3312 2.06937,-73.9992 l 0.41579,-63.5 -7.65686,-11.5 C 342.16743,385.53209 331.84392,360.77605 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 C 362.81163,181.64788 364,179.00102 364,175.58562 l 0,-4.17521 -54.75,-6.27254 c -30.1125,-3.4499 -56.42857,-6.52332 -58.48015,-6.82984 l -3.73015,-0.5573 -0.27155,192.37464 -0.27155,192.37463 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.94443,2.24583 -14.53695,2.46436 -18.48801,0.42119 -6.32425,-3.27039 -12.35995,-16.97518 -15.49513,-35.18354 -1.91913,-11.14583 -3.53706,-34.84717 -3.5572,-52.11026 L 187,480.98253 l -5.25,0.54167 c -2.8875,0.29791 -23.7,1.91967 -46.25,3.6039 -22.55,1.68423 -44.90549,3.3624 -49.678866,3.72927 -4.773376,0.36687 -8.957904,0.94607 -9.298951,1.28711 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 135.54179,-5.5106 c 18.08156,-18.48583 40.79632,-18.44213 38.70923,0.0745 L 403.24567,691 l 17.83943,0 17.83943,0 -5.28338,-11.25 c -2.90586,-6.1875 -14.02497,-29.87119 -24.70913,-52.63041 -18.50127,-39.41108 -19.46759,-41.21954 -20.30477,-38 -2.82281,10.85571 -10.21971,31.23778 -14.59844,40.22588 -9.82468,20.16682 -26.03017,41.5406 -42.06022,55.47414 L 324.85827,691 l 17.86266,0 17.86265,0 4.45821,-4.55789 z M 393,686.95455 c 0,-5.44947 -3.76478,-9.45159 -8.07932,-8.58869 -3.55141,0.71029 -12.49001,6.35061 -15.84499,9.99831 L 366.65137,691 l 13.17432,0 13.17431,0 0,-4.04545 z m 6.54967,0.63239 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36264,-2.20329 -3.71373,-1.38998 -1.37783,3.19176 1.09168,2.14127 1.98488,5.14807 1.98488,6.68178 0,3.91586 1.77967,3.47996 2.54967,-0.6245 z M 612.06699,664.9059 c 7.29688,-4.81309 28.14997,-25.18199 32.53026,-31.77493 1.59651,-2.40297 3.93716,-6.22797 5.20143,-8.5 1.26428,-2.27203 3.11729,-5.26978 4.11779,-6.66165 2.55253,-3.551 5.6683,-9.83908 6.92187,-13.96932 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26148,-151.72862 -0.39919,-163.09657 -2.07753,-171.5 -2.53901,-12.71276 -8.08847,-30.22918 -12.35578,-39 -6.17059,-12.68274 -16.42176,-26.42324 -27.89951,-37.39604 C 616.06331,140.26487 607.30716,133.90934 591.99578,125.64621 585.06353,121.90506 563.4743,115.31287 554,114.04435 c -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.17126 -2.25,0.004 0,0.17503 15.76173,26.26413 35.02607,57.97578 19.26434,31.71164 35.46052,58.46931 35.99151,59.46148 0.84727,1.58313 -1.33988,3.08316 -17.86788,12.25451 -41.08731,22.79923 -68.52667,41.9911 -76.51297,53.51534 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 0.92393,0.74933 1.39247,0.88168 1.0412,0.29412 -1.08451,-1.81403 3.91398,-11.15307 8.71862,-16.28961 10.94597,-11.70213 28.91228,-13.85133 40.66792,-4.86487 3.58264,2.73871 7.6131,8.45741 9.09597,12.90602 0.28889,0.86667 1.52531,0.7326 4.60384,-0.49918 8.63536,-3.45519 18.05701,-1.68437 24.60819,4.62516 5.37471,5.17645 6.91298,9.9475 5.43269,16.84985 -2.1623,10.08245 -11.29802,19.16452 -22.57554,22.44299 -5.92719,1.72308 -10.39415,1.37356 -16.57192,-1.29668 -3.7447,-1.61857 -3.79859,-1.60907 -6.71385,1.18393 -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.30583,-1.08373 -0.8897,-1.96799 3.10184,-6.59137 l 4.60998,-5.33973 2.93893,2.93892 c 1.61641,1.61641 3.29806,2.93893 3.737,2.93893 0.43895,0 2.15229,0.27084 3.80744,0.60187 2.52007,0.50402 3.70516,-0.0244 7.28889,-3.25 10.1419,-9.12842 12.62959,-17.04762 7.68182,-24.45399 -4.0052,-5.99541 -12.35342,-8.41221 -18.92998,-5.48021 -1.31686,0.58709 -2.02592,-0.0224 -3.14673,-2.70487 C 572.471,296.09657 562.35581,291.1019 548.5,290.30526 c -8.28516,-0.47635 -9.27488,-0.32924 -12.46083,1.85219 -4.21002,2.88261 -8.42798,8.81808 -10.50061,14.77635 -1.48919,4.28099 -1.46477,4.51754 0.70959,6.87321 1.23852,1.3418 10.12463,8.79669 19.74691,16.56642 36.23935,29.26229 66.82645,62.48294 84.04086,91.27678 2.91004,4.86751 5.39406,8.98914 5.52005,9.15919 0.12598,0.17005 2.74979,-0.42361 5.83067,-1.31925 5.462,-1.58785 7.14838,-1.49406 12.91052,0.71797 3.39951,1.30505 5.70284,5.45463 5.70284,10.27399 0,6.10764 -7.05733,24.21875 -8.97537,23.03334 -0.35903,-0.2219 0.78992,4.6339 2.55322,10.79066 4.5918,16.03273 6.48784,28.06764 7.13271,45.27416 2.03476,54.29199 -17.36818,102.15322 -59.33968,146.37319 L 590.5,677.40649 l 7.56699,-4.12865 c 4.16184,-2.27076 10.46184,-6.03813 14,-8.37194 z M 651.2,598.8 c -2.98645,-2.98645 0.12443,-9.36505 6.06581,-12.43746 2.88904,-1.49398 3.17634,-1.47834 4.43377,0.24129 0.7395,1.01133 1.10962,2.451 0.82249,3.19926 C 662.23493,590.55136 662,591.75418 662,592.47603 662,594.53442 656.40567,600 654.29879,600 653.25446,600 651.86,599.46 651.2,598.8 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 415.19993,565.11511 c 30.04122,-14.66342 42.72872,-23.25244 50.92126,-34.47201 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.4875,-13.49567 -20.75,-17.29892 l -7.75,-6.915 0,41.65901 c 0,40.21767 -0.82432,57.9385 -3.40753,73.25319 -0.67259,3.9875 -0.87858,7.25 -0.45775,7.25 0.42083,0 10.80018,-4.8982 23.06521,-10.88489 z M 407.2,512.8 c -2.98645,-2.98645 0.12443,-9.36505 6.06581,-12.43746 2.88249,-1.49059 3.17772,-1.47646 4.4117,0.21111 1.69036,2.3117 1.66456,2.90323 -0.30787,7.05983 -2.61027,5.50072 -7.40139,7.93477 -10.16964,5.16652 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-59.93777 c 0.0193,-8.9823 -1.82511,-11.82284 -7.75023,-11.93622 l -3.94237,-0.0754 5.10396,10.69165 c 2.93513,6.14846 5.41614,10.21733 5.83864,9.57543 0.40408,-0.61391 0.74158,-4.32886 0.75,-8.25543 z M 153.8842,449.97275 C 183.2455,447.78774 208.558,446 210.1342,446 l 2.8658,0 0,-49 0,-49 -4.34107,0 c -10.0943,0 -19.87764,-5.11293 -24.35365,-12.72761 -2.55661,-4.34934 -2.80067,-5.61452 -2.7533,-14.27239 0.103,-18.82338 8.19098,-33.61888 21.94802,-40.14996 3.3,-1.56665 6.7875,-2.84882 7.75,-2.84925 1.6518,-7.5e-4 1.75,-4.40585 1.75,-78.50079 0,-43.175 0.3375,-78.50114 0.75,-78.50254 0.4125,-0.001 41.40843,4.5409 91.10206,10.09399 l 90.35206,10.09653 11.14794,-10.89406 c 6.13137,-5.99174 13.15976,-12.57471 15.61865,-14.62884 l 4.4707,-3.73477 -105.9707,0.31891 C 243.87815,112.47971 213.5297,112.88795 211,113.72178 c -1.925,0.63451 -7.0605,1.86992 -11.41221,2.74534 -9.05953,1.82248 -28.81389,9.3297 -35.85281,13.6251 C 161.11421,131.6915 158.7097,133 158.39161,133 c -0.3181,0 -4.69884,3.10008 -9.73498,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.99267,9.20077 -2.069938,13.00374 -2.453118,120.73645 l -0.395642,111.23646 4.290738,-0.51371 c 2.359906,-0.28254 28.313628,-2.30144 57.674938,-4.48645 z M 97.2,392.8 c -2.986447,-2.98645 0.124429,-9.36505 6.06581,-12.43746 2.88249,-1.49059 3.17772,-1.47646 4.4117,0.21111 1.69036,2.3117 1.66456,2.90323 -0.30787,7.05983 C 104.75937,393.1342 99.968252,395.56825 97.2,392.8 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 135.5,244.58264 c -4.30859,-1.92317 -8.12416,-6.43301 -9.55382,-11.2922 -3.19819,-10.87018 6.94256,-31.51986 18.43666,-37.5427 9.1511,-4.79512 22.97844,-1.69224 28.30108,6.35081 2.21686,3.34991 2.49767,4.67989 2.13859,10.12886 -1.09864,16.67128 -17.01655,33.84384 -31.26885,33.73345 -2.77951,-0.0215 -6.40366,-0.64173 -8.05366,-1.37822 z m 15.58076,-3.69639 c 1.781,-0.6823 3.71586,-3.21956 6.2436,-8.18747 6.71952,-13.20626 7.19591,-21.75876 1.56897,-28.16749 -5.81442,-6.62226 -16.60326,-5.5745 -22.51351,2.1864 -6.67536,8.7656 -9.47085,22.9339 -5.76333,29.21022 3.68921,6.24533 11.90733,8.23653 20.46427,4.95834 z m 19.91612,-28.68591 c 0.004,-5.756 -1.98557,-9.26367 -6.785,-11.9611 -5.32339,-2.99191 -7.08016,-2.84073 -3.36045,0.2892 4.41369,3.71387 6.53879,10.11133 5.88749,17.72384 -0.29399,3.43624 -0.81548,7.14772 -1.15887,8.24772 -0.34338,1.1 0.73423,-0.7 2.39469,-4 1.95682,-3.88899 3.02012,-7.51277 3.02214,-10.29966 z m 484.57033,231.16403 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.94719,-1.57729 -3.12936,-0.83145 -0.87632,3.58776 1.10395,2.16533 1.99168,5.90753 2.00019,8.43178 0.0184,5.43692 1.57651,3.85117 2.5519,-2.59707 z M 213,315 l 0,-29 -5.35212,0 c -3.90382,0 -6.26099,0.61249 -8.71082,2.26343 -7.84594,5.28738 -13.28126,18.42562 -13.33634,32.23657 -0.037,9.27306 1.8638,14.27046 6.75166,17.75092 4.1113,2.9275 12.23533,5.67585 16.89762,5.71643 L 213,344 l 0,-29 z m 390.34158,17.05001 c 6.49042,-5.82444 8.71148,-16.35801 4.65144,-22.05981 -2.26491,-3.18078 -9.38884,-6.9921 -13.05874,-6.98646 -2.34834,0.004 -2.32523,0.0702 0.65442,1.88721 6.32801,3.85878 10.05178,11.29724 9.1228,18.22333 -0.30194,2.25113 -2.10141,6.08693 -4.28471,9.13341 -3.65831,5.10463 -2.93946,5.05588 2.91479,-0.19768 z M 563.94861,288.53209 C 560.47039,286.6401 549,285.36538 549,286.87083 c 0,0.69983 2.18633,1.15589 5.75,1.19946 3.1625,0.0387 6.65,0.45702 7.75,0.92971 3.20982,1.37931 4.23548,1.04801 1.44861,-0.46791 z"
+       id="path3530"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#998847"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.50284,-35.25083 c 19.07125,-9.90255 32.29968,-17.99109 45.63175,-27.90157 42.36771,-31.49433 67.73845,-67.38997 76.6972,-108.51459 C 639.39609,491.55201 607.15414,423.00252 529,360.03723 514.27201,348.17155 495.96491,331.54209 493.73073,328 c -0.86728,-1.375 -2.52911,-3.5126 -3.69296,-4.75021 -3.26218,-3.46897 -8.78307,-15.76248 -9.53543,-21.2328 -2.67969,-19.48365 23.41331,-45.91242 75.23302,-76.20116 C 561.38091,222.51599 566,219.67579 566,219.50427 566,219.06417 502.77489,115.12805 499.46097,110.12039 497.96126,107.85418 496.55342,106 496.33243,106 c -0.85819,0 -17.14114,9.50283 -22.83243,13.32515 -23.90877,16.05733 -51.48531,40.69589 -68.70521,61.38541 -23.17939,27.84979 -40.97799,63.43267 -46.41339,92.78944 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 5.34443,28.89201 16.9438,53.41781 37.83566,80 11.86638,15.09845 25.42253,28.08324 48.02406,46 42.04269,33.32821 60.75437,58.35868 59.09355,79.04898 -1.59383,19.85579 -20.39223,38.64346 -58.91999,58.88635 l -12.67185,6.65793 3.50223,7.68514 c 1.92622,4.22683 4.11588,8.81834 4.8659,10.20337 0.75002,1.38503 7.8748,16.46823 15.83284,33.51823 19.75737,42.32992 28.56604,60.5 29.32975,60.5 0.35404,0 8.01096,-3.82537 17.01538,-8.50083 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 12.03903,-6.01965 17.31997,-9.62971 27.96522,-19.11705 28.84361,-25.70621 45.62538,-58.63758 52.66756,-103.35109 1.3715,-8.70822 1.7245,-21.3312 2.06937,-73.9992 l 0.41579,-63.5 -7.65686,-11.5 C 342.16743,385.53209 331.84392,360.77605 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 C 362.81163,181.64788 364,179.00102 364,175.58562 l 0,-4.17521 -54.75,-6.27254 c -30.1125,-3.4499 -56.42857,-6.52332 -58.48015,-6.82984 l -3.73015,-0.5573 -0.27155,192.37464 -0.27155,192.37463 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.94443,2.24583 -14.53695,2.46436 -18.48801,0.42119 -6.32425,-3.27039 -12.35995,-16.97518 -15.49513,-35.18354 -1.91913,-11.14583 -3.53706,-34.84717 -3.5572,-52.11026 L 187,480.98253 l -5.25,0.54167 c -2.8875,0.29791 -23.7,1.91967 -46.25,3.6039 -22.55,1.68423 -44.90549,3.3624 -49.678866,3.72927 -4.773376,0.36687 -8.957904,0.94607 -9.298951,1.28711 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 135.54179,-5.5106 c 18.08156,-18.48583 40.79632,-18.44213 38.70923,0.0745 L 403.24567,691 l 17.83943,0 17.83943,0 -5.28338,-11.25 c -2.90586,-6.1875 -14.02497,-29.87119 -24.70913,-52.63041 -18.50127,-39.41108 -19.46759,-41.21954 -20.30477,-38 -2.82281,10.85571 -10.21971,31.23778 -14.59844,40.22588 -9.82468,20.16682 -26.03017,41.5406 -42.06022,55.47414 L 324.85827,691 l 17.86266,0 17.86265,0 4.45821,-4.55789 z M 393,686.95455 C 393,682.53177 389.61419,678 386.30981,678 c -3.10046,0 -11.9948,5.09307 -15.92722,9.12024 L 366.5941,691 l 13.20295,0 13.20295,0 0,-4.04545 z m 6.54967,0.63239 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36264,-2.20329 -3.71373,-1.38998 -1.37783,3.19176 1.09168,2.14127 1.98488,5.14807 1.98488,6.68178 0,3.91586 1.77967,3.47996 2.54967,-0.6245 z M 612.06699,664.9059 c 7.29688,-4.81309 28.14997,-25.18199 32.53026,-31.77493 1.59651,-2.40297 3.93716,-6.22797 5.20143,-8.5 1.26428,-2.27203 3.11729,-5.26978 4.11779,-6.66165 2.55253,-3.551 5.6683,-9.83908 6.92187,-13.96932 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26148,-151.72862 -0.39919,-163.09657 -2.07753,-171.5 -2.53901,-12.71276 -8.08847,-30.22918 -12.35578,-39 -6.17059,-12.68274 -16.42176,-26.42324 -27.89951,-37.39604 C 616.06331,140.26487 607.30716,133.90934 591.99578,125.64621 585.06353,121.90506 563.4743,115.31287 554,114.04435 c -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.17126 -2.25,0.004 0,0.17503 15.76173,26.26413 35.02607,57.97578 19.26434,31.71164 35.46052,58.46931 35.99151,59.46148 0.84727,1.58313 -1.33988,3.08316 -17.86788,12.25451 -41.08731,22.79923 -68.52667,41.9911 -76.51297,53.51534 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 0.92393,0.74933 1.39247,0.88168 1.0412,0.29412 -1.08451,-1.81403 3.91398,-11.15307 8.71862,-16.28961 10.94597,-11.70213 28.91228,-13.85133 40.66792,-4.86487 3.58264,2.73871 7.6131,8.45741 9.09597,12.90602 0.28889,0.86667 1.52531,0.7326 4.60384,-0.49918 8.63536,-3.45519 18.05701,-1.68437 24.60819,4.62516 5.37471,5.17645 6.91298,9.9475 5.43269,16.84985 -2.1623,10.08245 -11.29802,19.16452 -22.57554,22.44299 -5.92719,1.72308 -10.39415,1.37356 -16.57192,-1.29668 -3.7447,-1.61857 -3.79859,-1.60907 -6.71385,1.18393 -2.43238,2.33036 -3.19876,2.59989 -4.44699,1.56394 -1.30569,-1.08362 -0.8848,-1.97367 3.13531,-6.63015 4.53098,-5.2482 4.67881,-5.32803 6.10268,-3.29516 1.60566,2.2924 6.98669,4.87206 10.16284,4.87206 2.38531,0 9.17047,-5.86042 13.19889,-11.40004 7.2946,-10.03106 -0.14517,-24.29394 -12.16389,-23.31954 -2.475,0.20066 -5.26496,0.70915 -6.19991,1.12997 -1.31724,0.5929 -2.02088,-0.003 -3.12577,-2.64742 -3.52819,-8.44415 -13.88084,-13.15909 -29.03177,-13.22202 l -9.85746,-0.041 -4.33178,4.77963 c -2.38248,2.6288 -5.27695,7.30583 -6.43216,10.39339 l -2.10037,5.61375 2.28961,2.47983 c 1.25928,1.3639 10.16239,8.83688 19.78467,16.60661 36.23935,29.26229 66.82645,62.48294 84.04086,91.27678 2.91004,4.86751 5.39406,8.98914 5.52005,9.15919 0.12598,0.17005 2.74979,-0.42361 5.83067,-1.31925 5.462,-1.58785 7.14838,-1.49406 12.91052,0.71797 3.39951,1.30505 5.70284,5.45463 5.70284,10.27399 0,6.10764 -7.05733,24.21875 -8.97537,23.03334 -0.35903,-0.2219 0.78992,4.6339 2.55322,10.79066 4.5918,16.03273 6.48784,28.06764 7.13271,45.27416 2.03476,54.29199 -17.36818,102.15322 -59.33968,146.37319 L 590.5,677.40649 l 7.56699,-4.12865 c 4.16184,-2.27076 10.46184,-6.03813 14,-8.37194 z M 651.2,598.8 c -2.98645,-2.98645 0.12443,-9.36505 6.06581,-12.43746 2.88904,-1.49398 3.17634,-1.47834 4.43377,0.24129 0.7395,1.01133 1.10962,2.451 0.82249,3.19926 C 662.23493,590.55136 662,591.75418 662,592.47603 662,594.53442 656.40567,600 654.29879,600 653.25446,600 651.86,599.46 651.2,598.8 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 415.19993,565.11511 c 30.04122,-14.66342 42.72872,-23.25244 50.92126,-34.47201 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.4875,-13.49567 -20.75,-17.29892 l -7.75,-6.915 0,41.65901 c 0,40.21767 -0.82432,57.9385 -3.40753,73.25319 -0.67259,3.9875 -0.87858,7.25 -0.45775,7.25 0.42083,0 10.80018,-4.8982 23.06521,-10.88489 z M 407.2,512.8 c -2.98645,-2.98645 0.12443,-9.36505 6.06581,-12.43746 2.88249,-1.49059 3.17772,-1.47646 4.4117,0.21111 1.69036,2.3117 1.66456,2.90323 -0.30787,7.05983 -2.61027,5.50072 -7.40139,7.93477 -10.16964,5.16652 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-59.93777 c 0.0193,-8.9823 -1.82511,-11.82284 -7.75023,-11.93622 l -3.94237,-0.0754 5.10396,10.69165 c 2.93513,6.14846 5.41614,10.21733 5.83864,9.57543 0.40408,-0.61391 0.74158,-4.32886 0.75,-8.25543 z M 153.8842,449.97275 C 183.2455,447.78774 208.558,446 210.1342,446 l 2.8658,0 0,-49 0,-49 -4.34107,0 c -10.0943,0 -19.87764,-5.11293 -24.35365,-12.72761 -2.55661,-4.34934 -2.80067,-5.61452 -2.7533,-14.27239 0.103,-18.82338 8.19098,-33.61888 21.94802,-40.14996 3.3,-1.56665 6.7875,-2.84882 7.75,-2.84925 1.6518,-7.5e-4 1.75,-4.40585 1.75,-78.50079 0,-43.175 0.3375,-78.50114 0.75,-78.50254 0.4125,-0.001 41.40843,4.5409 91.10206,10.09399 l 90.35206,10.09653 11.14794,-10.89406 c 6.13137,-5.99174 13.15976,-12.57471 15.61865,-14.62884 l 4.4707,-3.73477 -105.9707,0.31891 C 243.87815,112.47971 213.5297,112.88795 211,113.72178 c -1.925,0.63451 -7.0605,1.86992 -11.41221,2.74534 -9.05953,1.82248 -28.81389,9.3297 -35.85281,13.6251 C 161.11421,131.6915 158.7097,133 158.39161,133 c -0.3181,0 -4.69884,3.10008 -9.73498,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.99267,9.20077 -2.069938,13.00374 -2.453118,120.73645 l -0.395642,111.23646 4.290738,-0.51371 c 2.359906,-0.28254 28.313628,-2.30144 57.674938,-4.48645 z M 97.2,392.8 c -2.986447,-2.98645 0.124429,-9.36505 6.06581,-12.43746 2.88249,-1.49059 3.17772,-1.47646 4.4117,0.21111 1.69036,2.3117 1.66456,2.90323 -0.30787,7.05983 C 104.75937,393.1342 99.968252,395.56825 97.2,392.8 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 135.5,244.58264 c -4.30859,-1.92317 -8.12416,-6.43301 -9.55382,-11.2922 -3.19819,-10.87018 6.94256,-31.51986 18.43666,-37.5427 9.1511,-4.79512 22.97844,-1.69224 28.30108,6.35081 2.21686,3.34991 2.49767,4.67989 2.13859,10.12886 -1.09864,16.67128 -17.01655,33.84384 -31.26885,33.73345 -2.77951,-0.0215 -6.40366,-0.64173 -8.05366,-1.37822 z m 15.85944,-3.70055 c 1.56296,-0.71213 3.87109,-3.9968 6.49531,-9.24339 6.40273,-12.80093 6.70813,-20.65015 1.05401,-27.08983 -3.38864,-3.85946 -7.13021,-5.02515 -12.96519,-4.03934 -5.36243,0.90598 -8.93211,4.11558 -12.93957,11.63435 -5.82925,10.93678 -5.24759,24.51465 1.19795,27.9642 5.58125,2.987 11.69517,3.26281 17.15749,0.77401 z m 19.63744,-28.68175 c 0.004,-5.756 -1.98557,-9.26367 -6.785,-11.9611 -5.32339,-2.99191 -7.08016,-2.84073 -3.36045,0.2892 4.41369,3.71387 6.53879,10.11133 5.88749,17.72384 -0.29399,3.43624 -0.81548,7.14772 -1.15887,8.24772 -0.34338,1.1 0.73423,-0.7 2.39469,-4 1.95682,-3.88899 3.02012,-7.51277 3.02214,-10.29966 z m 484.57033,231.16403 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.94719,-1.57729 -3.12936,-0.83145 -0.87632,3.58776 1.10395,2.16533 1.99168,5.90753 2.00019,8.43178 0.0184,5.43692 1.57651,3.85117 2.5519,-2.59707 z M 213,314.8835 l 0,-29.11649 -6.66434,0.42435 c -6.47576,0.41235 -6.7853,0.55797 -10.93924,5.14613 -10.01298,11.05969 -13.3235,33.93432 -6.33211,43.75283 3.39556,4.76862 12.10023,8.67032 19.68569,8.82373 L 213,344 l 0,-29.1165 z m 390.34158,17.16651 c 6.49042,-5.82444 8.71148,-16.35801 4.65144,-22.05981 -2.26491,-3.18078 -9.38884,-6.9921 -13.05874,-6.98646 -2.34834,0.004 -2.32523,0.0702 0.65442,1.88721 6.32801,3.85878 10.05178,11.29724 9.1228,18.22333 -0.30194,2.25113 -2.10141,6.08693 -4.28471,9.13341 -3.65831,5.10463 -2.93946,5.05588 2.91479,-0.19768 z M 563.94861,288.53209 C 560.47039,286.6401 549,285.36538 549,286.87083 c 0,0.69983 2.18633,1.15589 5.75,1.19946 3.1625,0.0387 6.65,0.45702 7.75,0.92971 3.20982,1.37931 4.23548,1.04801 1.44861,-0.46791 z"
+       id="path3528"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#a58939"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.50284,-35.25083 c 19.07125,-9.90255 32.29968,-17.99109 45.63175,-27.90157 42.36771,-31.49433 67.73845,-67.38997 76.6972,-108.51459 C 639.39609,491.55201 607.15414,423.00252 529,360.03723 514.27201,348.17155 495.96491,331.54209 493.73073,328 c -0.86728,-1.375 -2.52911,-3.5126 -3.69296,-4.75021 -3.26218,-3.46897 -8.78307,-15.76248 -9.53543,-21.2328 -2.67969,-19.48365 23.41331,-45.91242 75.23302,-76.20116 C 561.38091,222.51599 566,219.67579 566,219.50427 566,219.06417 502.77489,115.12805 499.46097,110.12039 497.96126,107.85418 496.55342,106 496.33243,106 c -0.85819,0 -17.14114,9.50283 -22.83243,13.32515 -23.90877,16.05733 -51.48531,40.69589 -68.70521,61.38541 -23.17939,27.84979 -40.97799,63.43267 -46.41339,92.78944 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 5.34443,28.89201 16.9438,53.41781 37.83566,80 11.86638,15.09845 25.42253,28.08324 48.02406,46 42.04269,33.32821 60.75437,58.35868 59.09355,79.04898 -1.59383,19.85579 -20.39223,38.64346 -58.91999,58.88635 l -12.67185,6.65793 3.50223,7.68514 c 1.92622,4.22683 4.11588,8.81834 4.8659,10.20337 0.75002,1.38503 7.8748,16.46823 15.83284,33.51823 19.75737,42.32992 28.56604,60.5 29.32975,60.5 0.35404,0 8.01096,-3.82537 17.01538,-8.50083 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 12.03903,-6.01965 17.31997,-9.62971 27.96522,-19.11705 28.84361,-25.70621 45.62538,-58.63758 52.66756,-103.35109 1.3715,-8.70822 1.7245,-21.3312 2.06937,-73.9992 l 0.41579,-63.5 -7.65686,-11.5 C 342.16743,385.53209 331.84392,360.77605 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 C 362.81163,181.64788 364,179.00102 364,175.58562 l 0,-4.17521 -54.75,-6.27254 c -30.1125,-3.4499 -56.42857,-6.52332 -58.48015,-6.82984 l -3.73015,-0.5573 -0.27155,192.37464 -0.27155,192.37463 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.94443,2.24583 -14.53695,2.46436 -18.48801,0.42119 -6.32425,-3.27039 -12.35995,-16.97518 -15.49513,-35.18354 -1.91913,-11.14583 -3.53706,-34.84717 -3.5572,-52.11026 L 187,480.98253 l -5.25,0.54167 c -2.8875,0.29791 -23.7,1.91967 -46.25,3.6039 -22.55,1.68423 -44.90549,3.3624 -49.678866,3.72927 -4.773376,0.36687 -8.957904,0.94607 -9.298951,1.28711 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 137.0584,-6.85846 c 18.29126,-17.11057 39.19146,-16.31131 37.19262,1.42232 L 403.24567,691 l 17.83943,0 17.83943,0 -5.28338,-11.25 c -2.90586,-6.1875 -14.02497,-29.87119 -24.70913,-52.63041 -18.50127,-39.41108 -19.46759,-41.21954 -20.30477,-38 -2.82281,10.85571 -10.21971,31.23778 -14.59844,40.22588 -9.82468,20.16682 -26.03017,41.5406 -42.06022,55.47414 L 324.85827,691 l 17.69343,0 17.69344,0 6.31326,-5.90575 z M 393,686.95455 C 393,682.53177 389.61419,678 386.30981,678 c -3.10046,0 -11.9948,5.09307 -15.92722,9.12024 L 366.5941,691 l 13.20295,0 13.20295,0 0,-4.04545 z m 6.54967,0.63239 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36264,-2.20329 -3.71373,-1.38998 -1.37783,3.19176 1.09168,2.14127 1.98488,5.14807 1.98488,6.68178 0,3.91586 1.77967,3.47996 2.54967,-0.6245 z M 612.06699,664.9059 c 7.29688,-4.81309 28.14997,-25.18199 32.53026,-31.77493 1.59651,-2.40297 3.93716,-6.22797 5.20143,-8.5 1.26428,-2.27203 3.11729,-5.26978 4.11779,-6.66165 2.55253,-3.551 5.6683,-9.83908 6.92187,-13.96932 0.58425,-1.925 2.43464,-7.54701 4.11197,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26148,-151.72862 -0.39919,-163.09657 -2.07753,-171.5 -2.53901,-12.71276 -8.08847,-30.22918 -12.35578,-39 -6.17059,-12.68274 -16.42176,-26.42324 -27.89951,-37.39604 C 616.06331,140.26487 607.30716,133.90934 591.99578,125.64621 585.06353,121.90506 563.4743,115.31287 554,114.04435 c -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.17126 -2.25,0.004 0,0.17503 15.76173,26.26413 35.02607,57.97578 19.26434,31.71164 35.46052,58.46931 35.99151,59.46148 0.84727,1.58313 -1.33988,3.08316 -17.86788,12.25451 -41.08731,22.79923 -68.52667,41.9911 -76.51297,53.51534 l -2.85118,4.11425 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 0.92393,0.74933 1.39247,0.88168 1.0412,0.29412 -1.08451,-1.81403 3.91398,-11.15307 8.71862,-16.28961 2.87407,-3.07261 6.83754,-5.90177 10.69013,-7.63071 5.46528,-2.45267 7.00339,-2.70144 14.32642,-2.31708 6.62451,0.3477 9.09434,0.95248 12.8298,3.14161 4.51863,2.64809 9.71039,8.91083 11.12018,13.41409 0.83305,2.661 1.22329,2.71048 5.91537,0.75 7.82533,-3.26963 17.83863,-1.21756 24.26458,4.97265 5.14497,4.95622 6.75166,9.94261 5.29947,16.44696 -2.08684,9.34697 -8.56409,16.87091 -18.08031,21.002 -7.3422,3.18732 -11.8058,3.4445 -18.81301,1.08395 l -6.28904,-2.11863 -2.82757,2.70899 c -2.33787,2.23983 -3.08876,2.49222 -4.33571,1.45733 -1.30569,-1.08362 -0.8848,-1.97367 3.13531,-6.63015 4.53098,-5.2482 4.67881,-5.32803 6.10268,-3.29516 1.60566,2.2924 6.98669,4.87206 10.16284,4.87206 2.38531,0 9.17047,-5.86042 13.19889,-11.40004 7.2946,-10.03106 -0.14517,-24.29394 -12.16389,-23.31954 -2.475,0.20066 -5.26496,0.70915 -6.19991,1.12997 -1.31724,0.5929 -2.02088,-0.003 -3.12577,-2.64742 -3.52819,-8.44415 -13.88084,-13.15909 -29.03177,-13.22202 l -9.85746,-0.041 -4.33178,4.77963 c -2.38248,2.6288 -5.27695,7.30583 -6.43216,10.39339 l -2.10037,5.61375 2.28961,2.47983 c 1.25928,1.3639 10.16239,8.83688 19.78467,16.60661 36.23935,29.26229 66.82645,62.48294 84.04086,91.27678 2.91004,4.86751 5.37839,8.97347 5.48522,9.12437 0.10684,0.1509 2.82838,-0.41175 6.04787,-1.25032 3.2195,-0.83857 6.77103,-1.26936 7.89231,-0.95731 7.83174,2.17957 10.53868,5.24008 10.53868,11.91516 0,6.10764 -7.05733,24.21875 -8.97537,23.03334 -0.35903,-0.2219 0.78992,4.6339 2.55322,10.79066 4.5918,16.03273 6.48784,28.06764 7.13271,45.27416 2.03476,54.29199 -17.36818,102.15322 -59.33968,146.37319 L 590.5,677.40649 l 7.56699,-4.12865 c 4.16184,-2.27076 10.46184,-6.03813 14,-8.37194 z M 651.2,598.8 c -2.93357,-2.93357 0.11116,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 415.19993,565.11511 c 30.04122,-14.66342 42.72872,-23.25244 50.92126,-34.47201 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.4875,-13.49567 -20.75,-17.29892 l -7.75,-6.915 0,41.65901 c 0,40.21767 -0.82432,57.9385 -3.40753,73.25319 -0.67259,3.9875 -0.87858,7.25 -0.45775,7.25 0.42083,0 10.80018,-4.8982 23.06521,-10.88489 z M 407.2,512.8 c -2.93357,-2.93357 0.11116,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-59.93777 c 0.0193,-8.9823 -1.82511,-11.82284 -7.75023,-11.93622 l -3.94237,-0.0754 5.10396,10.69165 c 2.93513,6.14846 5.41614,10.21733 5.83864,9.57543 0.40408,-0.61391 0.74158,-4.32886 0.75,-8.25543 z M 153.8842,449.97275 C 183.2455,447.78774 208.558,446 210.1342,446 l 2.8658,0 0,-49 0,-49 -4.3185,0 c -10.50616,0 -20.88238,-5.65207 -24.64492,-13.42443 -6.02397,-12.44388 -1.6877,-34.37825 9.12383,-46.15146 4.20715,-4.58139 14.34286,-10.42163 18.08959,-10.42332 1.6518,-7.5e-4 1.75,-4.40585 1.75,-78.50079 0,-43.175 0.3375,-78.50114 0.75,-78.50254 0.4125,-0.001 41.40843,4.5409 91.10206,10.09399 l 90.35206,10.09653 11.14794,-10.89406 c 6.13137,-5.99174 13.15976,-12.57471 15.61865,-14.62884 l 4.4707,-3.73477 -105.9707,0.31891 C 243.87815,112.47971 213.5297,112.88795 211,113.72178 c -1.925,0.63451 -7.0605,1.86992 -11.41221,2.74534 -9.05953,1.82248 -28.81389,9.3297 -35.85281,13.6251 C 161.11421,131.6915 158.7097,133 158.39161,133 c -0.3181,0 -4.69884,3.10008 -9.73498,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.99267,9.20077 -2.069938,13.00374 -2.453118,120.73645 l -0.395642,111.23646 4.290738,-0.51371 c 2.359906,-0.28254 28.313628,-2.30144 57.674938,-4.48645 z M 97.2,392.8 c -2.93357,-2.93357 0.111159,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 136.6193,244.96558 c -7.18026,-2.14986 -12.22754,-10.94186 -11.16474,-19.44818 1.3109,-10.49207 10.73223,-25.54563 18.42828,-29.44501 8.92203,-4.52055 19.67219,-3.12014 26.43006,3.44302 4.28736,4.16383 5.08737,6.64437 4.48511,13.90679 -1.26805,15.29098 -17.77544,32.73664 -30.74435,32.49185 -2.50451,-0.0473 -5.84997,-0.47409 -7.43436,-0.94847 z m 14.74014,-4.08349 c 1.56296,-0.71213 3.87109,-3.9968 6.49531,-9.24339 6.40273,-12.80093 6.70813,-20.65015 1.05401,-27.08983 -3.38864,-3.85946 -7.13021,-5.02515 -12.96519,-4.03934 -5.36243,0.90598 -8.93211,4.11558 -12.93957,11.63435 -5.82925,10.93678 -5.24759,24.51465 1.19795,27.9642 5.58125,2.987 11.69517,3.26281 17.15749,0.77401 z m 19.63744,-28.68175 c 0.004,-5.756 -1.98557,-9.26367 -6.785,-11.9611 -5.32339,-2.99191 -7.08016,-2.84073 -3.36045,0.2892 4.41369,3.71387 6.53879,10.11133 5.88749,17.72384 -0.29399,3.43624 -0.81548,7.14772 -1.15887,8.24772 -0.34338,1.1 0.73423,-0.7 2.39469,-4 1.95682,-3.88899 3.02012,-7.51277 3.02214,-10.29966 z m 484.57033,231.16403 c 0.6978,-4.6131 -0.51938,-7.73322 -3.67577,-9.42247 -2.94719,-1.57729 -3.12936,-0.83145 -0.87632,3.58776 1.10395,2.16533 1.99168,5.90753 2.00019,8.43178 0.0184,5.43692 1.57651,3.85117 2.5519,-2.59707 z M 213,314.8835 l 0,-29.11649 -6.66434,0.42435 c -6.47576,0.41235 -6.7853,0.55797 -10.93924,5.14613 -10.01298,11.05969 -13.3235,33.93432 -6.33211,43.75283 3.39556,4.76862 12.10023,8.67032 19.68569,8.82373 L 213,344 l 0,-29.1165 z m 390.34158,17.16651 c 6.49042,-5.82444 8.71148,-16.35801 4.65144,-22.05981 -2.26491,-3.18078 -9.38884,-6.9921 -13.05874,-6.98646 -2.34834,0.004 -2.32523,0.0702 0.65442,1.88721 6.32801,3.85878 10.05178,11.29724 9.1228,18.22333 -0.30194,2.25113 -2.10141,6.08693 -4.28471,9.13341 -3.65831,5.10463 -2.93946,5.05588 2.91479,-0.19768 z M 563.94861,288.53209 C 560.47039,286.6401 549,285.36538 549,286.87083 c 0,0.69983 2.18633,1.15589 5.75,1.19946 3.1625,0.0387 6.65,0.45702 7.75,0.92971 3.20982,1.37931 4.23548,1.04801 1.44861,-0.46791 z"
+       id="path3526"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#a28639"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.50284,-35.25083 c 45.61953,-23.68748 77.59723,-50.21789 98.83683,-82.00031 12.57319,-18.81421 20.18318,-37.27886 24.62258,-59.74346 2.91622,-14.7569 3.16091,-41.57169 0.50421,-55.2554 -10.18285,-52.44828 -41.55908,-97.50325 -101.16141,-145.26358 -13.7992,-11.05753 -27.45534,-23.82287 -32.09324,-29.99978 -1.5431,-2.05515 -3.09093,-3.96164 -3.43962,-4.23664 -1.87098,-1.47558 -7.86033,-15.55449 -8.4543,-19.87318 -2.67947,-19.48206 21.48386,-44.25197 73.26628,-75.10549 6.75605,-4.02546 12.15605,-7.6473 12,-8.04854 -0.58388,-1.50132 -65.95636,-108.57009 -67.67153,-110.8342 l -1.78887,-2.36141 -8.41166,4.75916 c -27.83146,15.74652 -61.42962,44.11723 -83.14681,70.2102 -23.14844,27.8126 -40.95098,63.41251 -46.38345,92.75346 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 5.34326,28.8857 16.9228,53.37343 37.82969,80 11.86603,15.11231 25.3175,27.99525 48.03003,46 41.90244,33.21703 60.74883,58.4277 59.09355,79.04898 -1.59011,19.80947 -20.48211,38.69068 -58.91999,58.88635 l -12.67185,6.65793 3.50223,7.68514 c 1.92622,4.22683 4.11588,8.81834 4.8659,10.20337 0.75002,1.38503 7.8748,16.46823 15.83284,33.51823 19.75737,42.32992 28.56604,60.5 29.32975,60.5 0.35404,0 8.01096,-3.82537 17.01538,-8.50083 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 7.50353,-3.75186 16.0932,-8.99435 20.14204,-12.29321 34.3383,-27.97769 52.85731,-61.70732 60.49074,-110.17493 1.3715,-8.70822 1.7245,-21.3312 2.06937,-73.9992 l 0.41579,-63.5 -7.65686,-11.5 C 342.16743,385.53209 331.84392,360.77605 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 5.46825,-8.68326 6.53021,-11.08194 6.53021,-14.75 0,-3.50497 -0.34974,-4.38051 -1.75,-4.38089 -0.9625,-2.6e-4 -27.04094,-2.92526 -57.95209,-6.5 C 273.38677,160.92478 247.85818,158 247.56773,158 c -0.29046,0 -0.65029,86.5125 -0.79962,192.25 l -0.27151,192.25 -2.25414,8 c -4.36565,15.49382 -11.77911,27.02216 -19.68665,30.61387 -4.94443,2.24583 -14.53695,2.46436 -18.48801,0.42119 -11.70233,-6.05151 -18.96932,-39.54705 -19.0472,-87.7938 L 187,480.98253 l -5.25,0.54167 c -2.8875,0.29791 -23.7,1.91967 -46.25,3.6039 -22.55,1.68423 -44.90549,3.3624 -49.678866,3.72927 -4.773376,0.36687 -8.957904,0.94607 -9.298951,1.28711 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 137.0584,-6.85846 c 18.29126,-17.11057 39.19146,-16.31131 37.19262,1.42232 L 403.24567,691 l 17.83943,0 17.83943,0 -5.52139,-11.75 c -3.03677,-6.4625 -14.14177,-30.13408 -24.67776,-52.60352 -15.30325,-32.63623 -19.29263,-40.38013 -19.83383,-38.5 -6.91249,24.01396 -11.45617,35.53145 -20.08743,50.9183 -9.40983,16.7748 -21.94408,32.39621 -36.10322,44.99538 L 324.90179,691 l 17.67167,0 17.67168,0 6.31326,-5.90575 z M 393,686.95455 C 393,682.53177 389.61419,678 386.30981,678 c -3.10046,0 -11.9948,5.09307 -15.92722,9.12024 L 366.5941,691 l 13.20295,0 13.20295,0 0,-4.04545 z m 6.54967,0.63239 c 0.83479,-4.44984 -0.12526,-7.26275 -3.15672,-9.24904 -3.36264,-2.20329 -3.71373,-1.38998 -1.37783,3.19176 1.09168,2.14127 1.98488,5.14807 1.98488,6.68178 0,3.91586 1.77967,3.47996 2.54967,-0.6245 z m 202.36339,-16.24955 c 5.27282,-3.11444 12.55376,-8.05767 16.17986,-10.98496 8.06535,-6.51099 22.68727,-21.55516 26.55726,-27.32416 7.39718,-11.02701 14.69242,-24.10964 16.18695,-29.02827 0.58492,-1.925 2.43585,-7.54701 4.11318,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26148,-151.72862 -0.39919,-163.09657 -2.07753,-171.5 -2.43689,-12.20144 -7.88729,-29.64061 -12.03273,-38.5 -5.66922,-12.11597 -17.2483,-27.46819 -29.46481,-39.06618 -11.09263,-10.53102 -20.87727,-17.55884 -35.20919,-25.28899 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.17582 -2.25,-0.006 0,0.16946 15.79327,26.31956 35.09616,58.11133 19.30288,31.79178 35.50251,58.56045 35.99917,59.48594 0.76288,1.42159 -1.69609,3.11543 -15.84616,10.91548 -41.95466,23.12697 -70.50233,43.00162 -78.64566,54.75245 l -2.81796,4.06631 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 0.92393,0.74933 1.39247,0.88168 1.0412,0.29412 -1.08451,-1.81403 3.91398,-11.15307 8.71862,-16.28961 2.87407,-3.07261 6.83754,-5.90177 10.69013,-7.63071 5.46528,-2.45267 7.00339,-2.70144 14.32642,-2.31708 6.62451,0.3477 9.09434,0.95248 12.8298,3.14161 4.51863,2.64809 9.71039,8.91083 11.12018,13.41409 0.83305,2.661 1.22329,2.71048 5.91537,0.75 7.82533,-3.26963 17.83863,-1.21756 24.26458,4.97265 5.14497,4.95622 6.75166,9.94261 5.29947,16.44696 -2.08684,9.34697 -8.56409,16.87091 -18.08031,21.002 -7.3422,3.18732 -11.8058,3.4445 -18.81301,1.08395 l -6.28904,-2.11863 -2.82757,2.70899 c -2.33787,2.23983 -3.08876,2.49222 -4.33571,1.45733 -1.30569,-1.08362 -0.8848,-1.97367 3.13531,-6.63015 4.53098,-5.2482 4.67881,-5.32803 6.10268,-3.29516 1.60566,2.2924 6.98669,4.87206 10.16284,4.87206 2.38531,0 9.17047,-5.86042 13.19889,-11.40004 7.2946,-10.03106 -0.14517,-24.29394 -12.16389,-23.31954 -2.475,0.20066 -5.26496,0.70915 -6.19991,1.12997 -1.31724,0.5929 -2.02088,-0.003 -3.12577,-2.64742 -3.52819,-8.44415 -13.88084,-13.15909 -29.03177,-13.22202 l -9.85746,-0.041 -4.33178,4.77963 c -2.38248,2.6288 -5.27695,7.30583 -6.43216,10.39339 l -2.10037,5.61375 2.28961,2.48296 c 1.25928,1.36563 7.91461,7.01139 14.78961,12.54612 18.86989,15.19126 32.16856,27.13152 46.04266,41.33958 19.0353,19.49349 30.76724,34.21893 42.50027,53.34457 3.20539,5.225 5.90548,9.62346 6.00022,9.77436 0.0947,0.1509 2.80637,-0.41175 6.02586,-1.25032 3.2195,-0.83857 6.77103,-1.26936 7.89231,-0.95731 7.83174,2.17957 10.53868,5.24008 10.53868,11.91516 0,6.10764 -7.05733,24.21875 -8.97537,23.03334 -0.35903,-0.2219 0.79101,4.6339 2.55566,10.79066 5.64892,19.7088 6.85788,28.87819 6.88166,52.19411 0.0224,21.96803 -0.6503,27.99889 -5.13102,46 -8.2446,33.12235 -26.238,64.30739 -53.80414,93.25 -5.89324,6.1875 -10.37425,11.25 -9.95782,11.25 0.41644,0 5.07128,-2.54818 10.34409,-5.66261 z M 651.2,598.8 c -2.93357,-2.93357 0.11116,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 414.39463,565.58519 c 29.62442,-14.3255 43.53276,-23.7208 51.72656,-34.94209 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.44751,-13.45957 -20.66114,-17.21869 l -7.66114,-6.83476 -0.46565,48.75087 c -0.36118,37.81265 -0.82944,51.21893 -2.087,59.75086 -0.89174,6.05 -1.83306,11.5625 -2.09182,12.25 -0.25877,0.6875 -0.0667,1.25 0.42679,1.25 0.4935,0 10.58907,-4.68667 22.43459,-10.41481 z M 407.2,512.8 c -2.93357,-2.93357 0.11116,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-59.93777 c 0.0193,-8.9823 -1.82511,-11.82284 -7.75023,-11.93622 l -3.94237,-0.0754 5.10396,10.69165 c 2.93513,6.14846 5.41614,10.21733 5.83864,9.57543 0.40408,-0.61391 0.74158,-4.32886 0.75,-8.25543 z m -494.52822,3.59574 C 183.58253,447.78043 208.67003,446 210.20647,446 l 2.79353,0 0,-49 0,-49 -4.3185,0 c -10.50616,0 -20.88238,-5.65207 -24.64492,-13.42443 -6.02397,-12.44388 -1.6877,-34.37825 9.12383,-46.15146 4.20715,-4.58139 14.34286,-10.42163 18.08959,-10.42332 1.6518,-7.5e-4 1.75,-4.40585 1.75,-78.50079 0,-43.175 0.29982,-78.5 0.66626,-78.5 0.36645,0 41.36155,4.5431 91.10024,10.09579 l 90.43397,10.09579 11.14976,-10.89586 c 6.13238,-5.99273 13.16159,-12.57651 15.62048,-14.63064 l 4.4707,-3.73477 -105.9707,0.31891 C 243.87815,112.47971 213.5297,112.88795 211,113.72178 c -1.925,0.63451 -7.0605,1.86992 -11.41221,2.74534 -9.05953,1.82248 -28.81389,9.3297 -35.85281,13.6251 C 161.11421,131.6915 158.7097,133 158.39161,133 c -0.3181,0 -4.69884,3.10008 -9.73498,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.992649,9.20067 -2.069941,13.00396 -2.453086,120.70771 l -0.39561,111.2077 4.790706,-0.50118 c 2.634888,-0.27566 28.621116,-2.28162 57.747176,-4.45771 z M 97.2,392.8 c -2.93357,-2.93357 0.111159,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 136.6193,244.96558 c -7.18026,-2.14986 -12.22754,-10.94186 -11.16474,-19.44818 1.3109,-10.49207 10.73223,-25.54563 18.42828,-29.44501 8.92203,-4.52055 19.67219,-3.12014 26.43006,3.44302 4.28736,4.16383 5.08737,6.64437 4.48511,13.90679 -1.26805,15.29098 -17.77544,32.73664 -30.74435,32.49185 -2.50451,-0.0473 -5.84997,-0.47409 -7.43436,-0.94847 z m 14.74014,-4.08349 c 1.56296,-0.71213 3.87109,-3.9968 6.49531,-9.24339 6.40273,-12.80093 6.70813,-20.65015 1.05401,-27.08983 -3.38864,-3.85946 -7.13021,-5.02515 -12.96519,-4.03934 -5.36243,0.90598 -8.93211,4.11558 -12.93957,11.63435 -5.82925,10.93678 -5.24759,24.51465 1.19795,27.9642 5.58125,2.987 11.69517,3.26281 17.15749,0.77401 z m 19.63744,-28.68175 c 0.004,-5.82673 -2.261,-9.78428 -6.97765,-12.19053 -5.39098,-2.75027 -6.78202,-2.52253 -3.1678,0.51863 4.41369,3.71387 6.53879,10.11133 5.88749,17.72384 -0.29399,3.43624 -0.81548,7.14772 -1.15887,8.24772 -0.34338,1.1 0.73423,-0.7 2.39469,-4 1.95682,-3.88899 3.02012,-7.51277 3.02214,-10.29966 z m 484.92627,228.50421 c 0.076,-2.76388 -3.69319,-7.70455 -5.8777,-7.70455 -1.36003,0 -1.37452,-0.0683 0.95455,4.5 1.14014,2.23632 2.04508,6.0891 2.10485,8.96144 l 0.10486,5.03856 1.31829,-4 c 0.72506,-2.2 1.35288,-5.25795 1.39515,-6.79545 z M 213,314.8835 l 0,-29.11649 -6.66434,0.42435 c -6.47576,0.41235 -6.7853,0.55797 -10.93924,5.14613 -10.01298,11.05969 -13.3235,33.93432 -6.33211,43.75283 3.39556,4.76862 12.10023,8.67032 19.68569,8.82373 L 213,344 l 0,-29.1165 z m 390.34158,17.16651 c 6.63729,-5.95624 8.83765,-17.00986 4.48702,-22.54078 -2.44793,-3.11204 -9.06462,-6.45609 -12.8286,-6.48353 -2.48331,-0.0181 -2.47997,-0.006 0.5,1.83486 3.99876,2.47001 6.10934,4.96022 7.96186,9.39392 2.81177,6.72951 1.75527,11.51593 -4.3584,19.74552 -2.81098,3.78386 -1.45727,3.16101 4.23812,-1.94999 z M 563.94861,288.53209 C 560.47039,286.6401 549,285.36538 549,286.87083 c 0,0.69983 2.18633,1.15589 5.75,1.19946 3.1625,0.0387 6.65,0.45702 7.75,0.92971 3.20982,1.37931 4.23548,1.04801 1.44861,-0.46791 z"
+       id="path3524"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ac8034"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.50284,-35.25083 c 45.61953,-23.68748 77.59723,-50.21789 98.83683,-82.00031 C 613.11241,597.68465 620.7224,579.22 625.1618,556.7554 628.07802,541.9985 628.32271,515.18371 625.66601,501.5 615.37657,448.50267 583.69533,403.38646 522.5,354.58471 c -11.96843,-9.54453 -25.64513,-22.43006 -30.08864,-28.34807 -1.5431,-2.05515 -3.09093,-3.96164 -3.43962,-4.23664 -1.87098,-1.47558 -7.86033,-15.55449 -8.4543,-19.87318 -2.67947,-19.48206 21.48386,-44.25197 73.26628,-75.10549 6.75605,-4.02546 12.15605,-7.6473 12,-8.04854 -0.58388,-1.50132 -65.95636,-108.57009 -67.67153,-110.8342 l -1.78887,-2.36141 -8.41166,4.75916 c -27.83146,15.74652 -61.42962,44.11723 -83.14681,70.2102 -23.14844,27.8126 -40.95098,63.41251 -46.38345,92.75346 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 4.29662,23.22759 12.89404,44.13129 26.528,64.5 15.20255,22.71215 31.77786,39.9042 59.29375,61.5 41.13253,32.28279 60.78263,58.47968 59.14723,78.85324 -1.59069,19.81667 -20.87231,39.15179 -58.9357,59.09923 l -12.67185,6.64079 3.50223,7.68514 c 1.92622,4.22683 4.11588,8.81834 4.8659,10.20337 0.75002,1.38503 7.8748,16.46823 15.83284,33.51823 19.75737,42.32992 28.56604,60.5 29.32975,60.5 0.35404,0 8.01096,-3.82537 17.01538,-8.50083 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 7.50353,-3.75186 16.0932,-8.99435 20.14204,-12.29321 34.33688,-27.97653 52.8237,-61.64392 60.49726,-110.17493 1.3812,-8.73539 1.72832,-21.16687 2.06624,-73.9992 l 0.40615,-63.5 -7.65374,-11.5 C 342.16311,385.52152 331.84281,360.77058 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 5.46825,-8.68326 6.53021,-11.08194 6.53021,-14.75 0,-3.50497 -0.34974,-4.38051 -1.75,-4.38089 -0.9625,-2.6e-4 -27.04094,-2.92526 -57.95209,-6.5 C 273.38677,160.92478 247.84927,158 247.54791,158 c -0.30135,0 -0.54972,84.4875 -0.55193,187.75 -0.004,201.4179 0.10031,196.95883 -4.96637,211.67009 -3.93093,11.41357 -10.74515,20.63671 -17.52103,23.71493 -4.89751,2.22489 -14.50872,2.43339 -18.44078,0.40004 -11.70233,-6.05151 -18.96932,-39.54705 -19.0472,-87.7938 L 187,480.98253 l -5.25,0.54167 c -2.8875,0.29791 -23.7,1.91967 -46.25,3.6039 -22.55,1.68423 -44.90549,3.3624 -49.678866,3.72927 -4.773376,0.36687 -8.957904,0.94607 -9.298951,1.28711 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 137.0584,-6.85846 c 18.29126,-17.11057 39.19146,-16.31131 37.19262,1.42232 L 403.24567,691 l 17.83943,0 17.83943,0 -5.27533,-11.25 c -42.44675,-90.52044 -44.09802,-93.89921 -44.76203,-91.5904 -6.88534,23.94088 -11.45541,35.52478 -20.08305,50.90518 -9.39133,16.74183 -22.34149,32.82056 -36.61513,45.46083 L 324.87798,691 l 17.68358,0 17.68358,0 6.31326,-5.90575 z M 393,686.95455 C 393,682.53177 389.61419,678 386.30981,678 c -3.10046,0 -11.9948,5.09307 -15.92722,9.12024 L 366.5941,691 l 13.20295,0 13.20295,0 0,-4.04545 z m 6.39301,2.46366 C 401.32615,684.38053 397.83297,677 393.51552,677 c -1.30994,0 -1.22078,0.47964 0.52911,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.08082 c 5.27282,-3.11444 12.55376,-8.05767 16.17986,-10.98496 8.06535,-6.51099 22.68727,-21.55516 26.55726,-27.32416 7.39718,-11.02701 14.69242,-24.10964 16.18695,-29.02827 0.58492,-1.925 2.43585,-7.54701 4.11318,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26068,-151.26376 -0.40344,-163.12232 -2.06473,-171.5 -1.9344,-9.75495 -10.01815,-35.14791 -12.73384,-40 -8.96096,-16.01044 -16.8331,-26.2798 -29.00967,-37.84367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.17718 -2.25,-0.009 0,0.1678 15.37924,25.6429 34.17608,56.61133 18.79684,30.96844 35.0168,57.72725 36.04436,59.46402 l 1.86828,3.15777 -16.79436,9.25771 c -42.00179,23.15302 -70.54404,43.02153 -78.69085,54.77739 l -2.81796,4.06631 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 0.92393,0.74933 1.39247,0.88168 1.0412,0.29412 -1.08451,-1.81403 3.91398,-11.15307 8.71862,-16.28961 2.87407,-3.07261 6.83754,-5.90177 10.69013,-7.63071 5.46528,-2.45267 7.00339,-2.70144 14.32642,-2.31708 6.62451,0.3477 9.09434,0.95248 12.8298,3.14161 4.51863,2.64809 9.71039,8.91083 11.12018,13.41409 0.83305,2.661 1.22329,2.71048 5.91537,0.75 7.82533,-3.26963 17.83863,-1.21756 24.26458,4.97265 5.14497,4.95622 6.75166,9.94261 5.29947,16.44696 -2.08684,9.34697 -8.56409,16.87091 -18.08031,21.002 -7.3422,3.18732 -11.8058,3.4445 -18.81301,1.08395 l -6.28904,-2.11863 -2.82757,2.70899 c -2.33787,2.23983 -3.08876,2.49222 -4.33571,1.45733 -1.30569,-1.08362 -0.8848,-1.97367 3.13531,-6.63015 4.53098,-5.2482 4.67881,-5.32803 6.10268,-3.29516 1.60566,2.2924 6.98669,4.87206 10.16284,4.87206 2.38531,0 9.17047,-5.86042 13.19889,-11.40004 7.2946,-10.03106 -0.14517,-24.29394 -12.16389,-23.31954 -2.475,0.20066 -5.26496,0.70915 -6.19991,1.12997 -1.31724,0.5929 -2.02088,-0.003 -3.12577,-2.64742 -3.52819,-8.44415 -13.88084,-13.15909 -29.03177,-13.22202 l -9.85746,-0.041 -4.33178,4.77963 c -2.38248,2.6288 -5.27695,7.30583 -6.43216,10.39339 l -2.10037,5.61375 2.28961,2.48296 c 1.25928,1.36563 7.91461,7.01139 14.78961,12.54612 41.26642,33.22165 69.03822,62.92113 88.53855,94.68415 3.2078,5.225 5.90986,9.62346 6.0046,9.77436 0.0947,0.1509 2.80637,-0.41175 6.02586,-1.25032 3.2195,-0.83857 6.77103,-1.26936 7.89231,-0.95731 7.83174,2.17957 10.53868,5.24008 10.53868,11.91516 0,6.10764 -7.05733,24.21875 -8.97537,23.03334 -0.35903,-0.2219 0.79101,4.6339 2.55566,10.79066 5.64892,19.7088 6.85788,28.87819 6.88166,52.19411 0.0224,21.96803 -0.6503,27.99889 -5.13102,46 -8.2446,33.12235 -26.238,64.30739 -53.80414,93.25 -5.89324,6.1875 -10.37425,11.25 -9.95782,11.25 0.41644,0 5.07128,-2.54818 10.34409,-5.66261 z M 651.2,598.8 c -2.93357,-2.93357 0.11116,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 414.39463,565.58519 c 29.62442,-14.3255 43.53276,-23.7208 51.72656,-34.94209 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.44751,-13.45957 -20.66114,-17.21869 l -7.66114,-6.83476 -0.46565,48.75087 c -0.36118,37.81265 -0.82944,51.21893 -2.087,59.75086 -0.89174,6.05 -1.83306,11.5625 -2.09182,12.25 -0.25877,0.6875 -0.0667,1.25 0.42679,1.25 0.4935,0 10.58907,-4.68667 22.43459,-10.41481 z M 407.2,512.8 c -2.93357,-2.93357 0.11116,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-59.93777 c 0.0193,-8.9823 -1.82511,-11.82284 -7.75023,-11.93622 l -3.94237,-0.0754 5.10396,10.69165 c 2.93513,6.14846 5.41614,10.21733 5.83864,9.57543 0.40408,-0.61391 0.74158,-4.32886 0.75,-8.25543 z m -494.52822,3.59574 C 183.58253,447.78043 208.67003,446 210.20647,446 l 2.79353,0 0,-49 0,-49 -4.3185,0 c -10.50616,0 -20.88238,-5.65207 -24.64492,-13.42443 -6.02397,-12.44388 -1.6877,-34.37825 9.12383,-46.15146 4.20715,-4.58139 14.34286,-10.42163 18.08959,-10.42332 1.6518,-7.5e-4 1.75,-4.40585 1.75,-78.50079 0,-43.175 0.27384,-78.5 0.60853,-78.5 0.33469,0 41.33019,4.54272 91.10111,10.09492 l 90.49258,10.09492 11.14889,-10.89499 c 6.13189,-5.99225 13.16071,-12.57564 15.6196,-14.62977 l 4.4707,-3.73477 -105.9707,0.34798 c -77.20381,0.25351 -107.05655,0.66636 -109.97071,1.52084 -2.2,0.64508 -7.28121,1.84593 -11.29159,2.66856 -8.58339,1.76067 -28.68166,9.47996 -35.47343,13.62453 C 161.11421,131.6915 158.7097,133 158.39161,133 c -0.3181,0 -4.69884,3.10008 -9.73498,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.992649,9.20067 -2.069941,13.00396 -2.453086,120.70771 l -0.39561,111.2077 4.790706,-0.50118 c 2.634888,-0.27566 28.621116,-2.28162 57.747176,-4.45771 z M 97.2,392.8 c -2.93357,-2.93357 0.111159,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 136.6193,244.96558 c -7.18026,-2.14986 -12.22754,-10.94186 -11.16474,-19.44818 1.3109,-10.49207 10.73223,-25.54563 18.42828,-29.44501 8.92203,-4.52055 19.67219,-3.12014 26.43006,3.44302 4.28736,4.16383 5.08737,6.64437 4.48511,13.90679 -1.26805,15.29098 -17.77544,32.73664 -30.74435,32.49185 -2.50451,-0.0473 -5.84997,-0.47409 -7.43436,-0.94847 z m 14.74014,-4.08349 c 1.56296,-0.71213 3.87109,-3.9968 6.49531,-9.24339 6.40273,-12.80093 6.70813,-20.65015 1.05401,-27.08983 -3.38864,-3.85946 -7.13021,-5.02515 -12.96519,-4.03934 -5.36243,0.90598 -8.93211,4.11558 -12.93957,11.63435 -5.82925,10.93678 -5.24759,24.51465 1.19795,27.9642 5.58125,2.987 11.69517,3.26281 17.15749,0.77401 z m 17.97143,-20.65233 c 2.13359,-5.45849 2.14096,-12.58002 0.0164,-15.82255 C 167.76321,201.98967 161.29717,198 158.96311,198 c -0.61411,0 0.23563,1.1378 1.88832,2.52844 4.41369,3.71387 6.53879,10.11133 5.88749,17.72384 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -1.469,4.05109 2.06797,-1.70677 3.85172,-6.27024 z m 486.34491,222.85998 c 0.5175,-4.36949 0.29291,-5.21196 -2.00097,-7.50584 -1.42115,-1.42115 -3.29283,-2.5839 -4.15929,-2.5839 -1.29139,0 -1.17591,0.54033 0.64053,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51052,7.05796 1.89844,6.06289 2.85929,-2.04996 z M 213,314.8835 l 0,-29.11649 -6.66434,0.42435 c -6.47576,0.41235 -6.7853,0.55797 -10.93924,5.14613 -10.01298,11.05969 -13.3235,33.93432 -6.33211,43.75283 3.39556,4.76862 12.10023,8.67032 19.68569,8.82373 L 213,344 l 0,-29.1165 z m 390.34158,17.16651 c 6.63729,-5.95624 8.83765,-17.00986 4.48702,-22.54078 -2.44793,-3.11204 -9.06462,-6.45609 -12.8286,-6.48353 -2.48331,-0.0181 -2.47997,-0.006 0.5,1.83486 3.99876,2.47001 6.10934,4.96022 7.96186,9.39392 2.81177,6.72951 1.75527,11.51593 -4.3584,19.74552 -2.81098,3.78386 -1.45727,3.16101 4.23812,-1.94999 z M 566.35229,289.5342 C 562.35688,286.73571 549,284.78501 549,287 c 0,0.55 2.5875,1.0203 5.75,1.0451 3.1625,0.0248 7.1,0.66326 8.75,1.41879 4.01966,1.84057 5.4293,1.87532 2.85229,0.0703 z"
+       id="path3522"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#a18637"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.50284,-35.25083 c 45.61953,-23.68748 77.59723,-50.21789 98.83683,-82.00031 C 613.11241,597.68465 620.7224,579.22 625.1618,556.7554 628.07802,541.9985 628.32271,515.18371 625.66601,501.5 615.37657,448.50267 583.69533,403.38646 522.5,354.58471 c -11.96843,-9.54453 -25.64513,-22.43006 -30.08864,-28.34807 -1.5431,-2.05515 -3.09093,-3.96164 -3.43962,-4.23664 -1.87098,-1.47558 -7.86033,-15.55449 -8.4543,-19.87318 -2.67947,-19.48206 21.48386,-44.25197 73.26628,-75.10549 6.75605,-4.02546 12.15605,-7.6473 12,-8.04854 -0.58388,-1.50132 -65.95636,-108.57009 -67.67153,-110.8342 l -1.78887,-2.36141 -8.41166,4.75916 c -27.83146,15.74652 -61.42962,44.11723 -83.14681,70.2102 -23.14844,27.8126 -40.95098,63.41251 -46.38345,92.75346 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 4.29662,23.22759 12.89404,44.13129 26.528,64.5 15.20255,22.71215 31.77786,39.9042 59.29375,61.5 41.13253,32.28279 60.78263,58.47968 59.14723,78.85324 -1.59069,19.81667 -20.87231,39.15179 -58.9357,59.09923 l -12.67185,6.64079 3.50223,7.68514 c 1.92622,4.22683 4.11588,8.81834 4.8659,10.20337 0.75002,1.38503 7.8748,16.46823 15.83284,33.51823 19.75737,42.32992 28.56604,60.5 29.32975,60.5 0.35404,0 8.01096,-3.82537 17.01538,-8.50083 z M 229.5,691.95271 c 20.75074,-1.54022 35.15213,-5.31125 51.5,-13.48537 7.50353,-3.75186 16.0932,-8.99435 20.14204,-12.29321 34.33688,-27.97653 52.8237,-61.64392 60.49726,-110.17493 1.3812,-8.73539 1.72832,-21.16687 2.06624,-73.9992 l 0.40615,-63.5 -7.65374,-11.5 C 342.16311,385.52152 331.84281,360.77058 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 5.46825,-8.68326 6.53021,-11.08194 6.53021,-14.75 0,-3.50497 -0.34974,-4.38051 -1.75,-4.38089 -0.9625,-2.6e-4 -27.04094,-2.92526 -57.95209,-6.5 C 273.38677,160.92478 247.84927,158 247.54791,158 c -0.30135,0 -0.54972,84.4875 -0.55193,187.75 -0.004,201.4179 0.10031,196.95883 -4.96637,211.67009 -3.93093,11.41357 -10.74515,20.63671 -17.52103,23.71493 -4.89751,2.22489 -14.50872,2.43339 -18.44078,0.40004 -11.70233,-6.05151 -18.96932,-39.54705 -19.0472,-87.7938 L 187,480.98253 l -5.25,0.54167 c -2.8875,0.29791 -23.7,1.91967 -46.25,3.6039 -22.55,1.68423 -44.90549,3.3624 -49.678866,3.72927 -4.773376,0.36687 -8.957904,0.94607 -9.298951,1.28711 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32918 15,-0.90072 z m 137.0584,-6.85846 c 18.29126,-17.11057 39.19146,-16.31131 37.19262,1.42232 L 403.24567,691 l 17.83943,0 17.83943,0 -5.27533,-11.25 c -42.44675,-90.52044 -44.09802,-93.89921 -44.76203,-91.5904 -6.88534,23.94088 -11.45541,35.52478 -20.08305,50.90518 -9.39133,16.74183 -22.34149,32.82056 -36.61513,45.46083 L 324.87798,691 l 17.68358,0 17.68358,0 6.31326,-5.90575 z M 393,686.95455 C 393,682.3312 389.57413,678 385.91718,678 c -3.03891,0 -11.74958,5.1813 -15.86335,9.43587 L 366.60767,691 l 13.19616,0 13.19617,0 0,-4.04545 z m 6.39301,2.46366 C 401.32615,684.38053 397.83297,677 393.51552,677 c -1.30994,0 -1.22078,0.47964 0.52911,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.08082 c 5.27282,-3.11444 12.55376,-8.05767 16.17986,-10.98496 8.06535,-6.51099 22.68727,-21.55516 26.55726,-27.32416 7.39718,-11.02701 14.69242,-24.10964 16.18695,-29.02827 0.58492,-1.925 2.43585,-7.54701 4.11318,-12.49335 C 666.62764,586.56031 668,581.43021 668,580.10643 c 0,-1.32378 0.68852,-5.82677 1.53004,-10.00665 1.34304,-6.67096 1.49581,-27.45996 1.25,-170.09978 -0.26068,-151.26376 -0.40344,-163.12232 -2.06473,-171.5 -1.9344,-9.75495 -10.01815,-35.14791 -12.73384,-40 -8.96096,-16.01044 -16.8331,-26.2798 -29.00967,-37.84367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.17718 -2.25,-0.009 0,0.1678 15.37924,25.6429 34.17608,56.61133 18.79684,30.96844 35.0168,57.72725 36.04436,59.46402 l 1.86828,3.15777 -16.79436,9.25771 c -42.00179,23.15302 -70.54404,43.02153 -78.69085,54.77739 l -2.81796,4.06631 2.11931,3.42911 c 1.16562,1.88601 2.87525,4.04219 3.79918,4.79152 0.92393,0.74933 1.39247,0.88168 1.0412,0.29412 -1.08451,-1.81403 3.91398,-11.15307 8.71862,-16.28961 2.87407,-3.07261 6.83754,-5.90177 10.69013,-7.63071 5.46528,-2.45267 7.00339,-2.70144 14.32642,-2.31708 6.62451,0.3477 9.09434,0.95248 12.8298,3.14161 4.51863,2.64809 9.71039,8.91083 11.12018,13.41409 0.83305,2.661 1.22329,2.71048 5.91537,0.75 7.82533,-3.26963 17.83863,-1.21756 24.26458,4.97265 5.14497,4.95622 6.75166,9.94261 5.29947,16.44696 -2.08684,9.34697 -8.56409,16.87091 -18.08031,21.002 -7.3422,3.18732 -11.8058,3.4445 -18.81301,1.08395 l -6.28904,-2.11863 -2.82757,2.70899 c -2.3395,2.24139 -3.0882,2.49268 -4.33751,1.45584 -1.30754,-1.08516 -0.88464,-1.96237 3.15503,-6.54426 l 4.66496,-5.29113 1.82446,2.31943 c 2.18369,2.77611 7.99346,4.88173 11.22895,4.06968 3.31777,-0.83271 13.29367,-11.96606 14.43907,-16.11436 1.78803,-6.4757 -1.64559,-13.74082 -8.07518,-17.08613 -3.1061,-1.6165 -11.38272,-1.88902 -12.29966,-0.40538 -1.13241,1.83228 -2.45905,1.03376 -3.86235,-2.32479 -0.76405,-1.82864 -3.11833,-4.7501 -5.23173,-6.49215 -5.88179,-4.84827 -12.33639,-6.6605 -23.76576,-6.67261 l -9.85983,-0.0104 -4.25082,4.69284 c -2.33795,2.58106 -5.27369,7.21301 -6.52386,10.29324 l -2.27304,5.6004 2.3837,2.58311 c 1.31103,1.42071 8.00869,7.11153 14.88369,12.64626 41.26642,33.22165 69.03822,62.92113 88.53855,94.68415 3.2078,5.225 5.90986,9.62346 6.0046,9.77436 0.0947,0.1509 2.80637,-0.41175 6.02586,-1.25032 3.2195,-0.83857 6.77103,-1.26936 7.89231,-0.95731 7.83174,2.17957 10.53868,5.24008 10.53868,11.91516 0,6.10764 -7.05733,24.21875 -8.97537,23.03334 -0.35903,-0.2219 0.79101,4.6339 2.55566,10.79066 5.64892,19.7088 6.85788,28.87819 6.88166,52.19411 0.0224,21.96803 -0.6503,27.99889 -5.13102,46 -8.2446,33.12235 -26.238,64.30739 -53.80414,93.25 -5.89324,6.1875 -10.37425,11.25 -9.95782,11.25 0.41644,0 5.07128,-2.54818 10.34409,-5.66261 z M 651.2,598.8 c -2.93357,-2.93357 0.11116,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 414.39463,565.58519 c 29.62442,-14.3255 43.53276,-23.7208 51.72656,-34.94209 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.44751,-13.45957 -20.66114,-17.21869 l -7.66114,-6.83476 -0.46565,48.75087 c -0.36118,37.81265 -0.82944,51.21893 -2.087,59.75086 -0.89174,6.05 -1.83306,11.5625 -2.09182,12.25 -0.25877,0.6875 -0.0667,1.25 0.42679,1.25 0.4935,0 10.58907,-4.68667 22.43459,-10.41481 z M 407.2,512.8 c -2.93357,-2.93357 0.11116,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-60.094 c 0.0135,-6.44912 -0.27318,-7.58395 -2.47145,-9.78222 -1.80802,-1.80802 -3.40327,-2.42504 -5.84466,-2.26062 l -3.3579,0.22614 5.09466,10.67229 c 2.92996,6.13768 5.40683,10.19801 5.82935,9.55607 0.40408,-0.61391 0.74158,-4.39916 0.75,-8.41166 z m -494.52822,3.75197 C 183.58253,447.78043 208.67003,446 210.20647,446 l 2.79353,0 0,-49 0,-49 -4.3185,0 c -10.50616,0 -20.88238,-5.65207 -24.64492,-13.42443 -6.02397,-12.44388 -1.6877,-34.37825 9.12383,-46.15146 4.20715,-4.58139 14.34286,-10.42163 18.08959,-10.42332 1.6518,-7.5e-4 1.75,-4.40585 1.75,-78.50079 0,-43.175 0.27384,-78.5 0.60853,-78.5 0.33469,0 41.33019,4.54272 91.10111,10.09492 l 90.49258,10.09492 11.14889,-10.89499 c 6.13189,-5.99225 13.16071,-12.57564 15.6196,-14.62977 l 4.4707,-3.73477 -105.9707,0.34798 c -77.20381,0.25351 -107.05655,0.66636 -109.97071,1.52084 -2.2,0.64508 -7.28121,1.84593 -11.29159,2.66856 -8.58339,1.76067 -28.68166,9.47996 -35.47343,13.62453 C 161.11421,131.6915 158.7097,133 158.39161,133 c -0.3181,0 -4.69884,3.10008 -9.73498,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.992649,9.20067 -2.069941,13.00396 -2.453086,120.70771 l -0.39561,111.2077 4.790706,-0.50118 c 2.634888,-0.27566 28.621116,-2.28162 57.747176,-4.45771 z M 97.2,392.8 c -2.93357,-2.93357 0.111159,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 136.6193,244.96558 c -7.18026,-2.14986 -12.22754,-10.94186 -11.16474,-19.44818 1.3109,-10.49207 10.73223,-25.54563 18.42828,-29.44501 8.92203,-4.52055 19.67219,-3.12014 26.43006,3.44302 4.28736,4.16383 5.08737,6.64437 4.48511,13.90679 -1.26805,15.29098 -17.77544,32.73664 -30.74435,32.49185 -2.50451,-0.0473 -5.84997,-0.47409 -7.43436,-0.94847 z m 14.65039,-3.87802 c 3.49003,-1.3269 10.6645,-15.94375 11.41253,-23.25124 1.17685,-11.49654 -5.44873,-18.73473 -16.00472,-17.48453 -6.32812,0.74947 -9.57428,3.71955 -14.22441,13.0146 C 129.59175,219.08587 129,221.3681 129,226.68402 c 0,3.76617 0.62368,7.62137 1.51035,9.336 3.12379,6.04074 12.30487,8.28193 20.75934,5.06754 z m 18.06118,-20.8578 c 2.13359,-5.45849 2.14096,-12.58002 0.0164,-15.82255 C 167.76321,201.98967 161.29717,198 158.96311,198 c -0.61411,0 0.23563,1.1378 1.88832,2.52844 4.41369,3.71387 6.53879,10.11133 5.88749,17.72384 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -1.469,4.05109 2.06797,-1.70677 3.85172,-6.27024 z m 486.34491,222.85998 c 0.5175,-4.36949 0.29291,-5.21196 -2.00097,-7.50584 -1.42115,-1.42115 -3.29283,-2.5839 -4.15929,-2.5839 -1.29139,0 -1.17591,0.54033 0.64053,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51052,7.05796 1.89844,6.06289 2.85929,-2.04996 z M 213,314.8835 l 0,-29.11649 -6.49289,0.41343 c -5.77822,0.36793 -6.8859,0.79351 -10.0635,3.8665 -9.58384,9.26833 -14.37128,32.45711 -8.88947,43.05775 2.9712,5.74567 12.75493,10.75276 21.19586,10.84757 L 213,344 l 0,-29.1165 z m 390.34158,17.16651 c 6.63729,-5.95624 8.83765,-17.00986 4.48702,-22.54078 -2.44793,-3.11204 -9.06462,-6.45609 -12.8286,-6.48353 -2.48331,-0.0181 -2.47997,-0.006 0.5,1.83486 3.99876,2.47001 6.10934,4.96022 7.96186,9.39392 2.81177,6.72951 1.75527,11.51593 -4.3584,19.74552 -2.81098,3.78386 -1.45727,3.16101 4.23812,-1.94999 z M 566.35229,289.5342 C 562.35688,286.73571 549,284.78501 549,287 c 0,0.55 2.5875,1.0203 5.75,1.0451 3.1625,0.0248 7.1,0.66326 8.75,1.41879 4.01966,1.84057 5.4293,1.87532 2.85229,0.0703 z"
+       id="path3520"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#938346"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.50284,-35.25083 c 45.70106,-23.72981 77.55927,-50.16108 98.83683,-82.00031 30.76046,-46.0292 35.76241,-100.90233 13.86992,-152.15769 C 598.2249,426.45014 570.34549,393.14309 522.5232,354.56665 509.49217,344.055 496.89396,332.20558 492.43264,326.26454 c -1.5548,-2.0705 -3.11221,-3.98954 -3.4609,-4.26454 -1.97342,-1.55637 -7.92346,-15.76545 -8.48551,-20.26395 -2.41291,-19.31227 21.87824,-44.07781 73.26377,-74.69456 6.7375,-4.01436 12.25,-7.43862 12.25,-7.60945 0,-0.4504 -63.10145,-104.1329 -66.44848,-109.18204 -1.54951,-2.3375 -2.9981,-4.25 -3.21909,-4.25 -0.22099,0 -4.0987,2.08374 -8.61712,4.63054 -28.70211,16.17785 -62.30067,44.93496 -85.48687,73.16847 -21.01407,25.58854 -38.66072,61.68954 -43.84704,89.70099 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 4.29662,23.22759 12.89404,44.13129 26.528,64.5 15.31656,22.88247 31.57151,39.74226 59.29375,61.5 41.05805,32.22433 60.77967,58.51658 59.14723,78.85324 -1.59069,19.81667 -20.87231,39.15179 -58.9357,59.09923 l -12.67185,6.64079 3.50223,7.68514 c 1.92622,4.22683 4.11772,8.81834 4.86999,10.20337 0.75226,1.38503 7.64492,16.01823 15.31701,32.51823 18.22716,39.20028 29.04862,61.5 29.84432,61.5 0.35248,0 8.00813,-3.82537 17.01255,-8.50083 z M 229.5,691.94922 c 14.828,-1.10431 27.94686,-3.70571 38.27032,-7.5888 11.11302,-4.18008 26.41824,-12.52082 33.37172,-18.18629 34.33688,-27.97653 52.8237,-61.64392 60.49726,-110.17493 1.3812,-8.73539 1.72832,-21.16687 2.06624,-73.9992 l 0.40615,-63.5 -7.65374,-11.5 C 342.16311,385.52152 331.84281,360.77058 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 5.46825,-8.68326 6.53021,-11.08194 6.53021,-14.75 0,-3.50497 -0.34974,-4.38051 -1.75,-4.38089 -0.9625,-2.6e-4 -27.04094,-2.92526 -57.95209,-6.5 C 273.38677,160.92478 247.84927,158 247.54791,158 c -0.30135,0 -0.55056,84.2625 -0.55381,187.25 -0.006,203.38879 0.12121,198.42772 -5.48724,213.328 -4.53025,12.03578 -10.62939,19.90506 -17.72474,22.86895 -4.69128,1.95966 -14.00555,2.00599 -17.71432,0.0881 -11.66958,-6.03457 -18.99436,-39.81173 -19.05233,-87.85702 L 187,480.85609 l -5.25,0.58824 c -2.8875,0.32354 -23.7,1.96751 -46.25,3.65327 -58.042902,4.33909 -58.291278,4.36034 -58.977817,5.04688 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.33075 15,-0.90421 z m 137.0584,-6.85497 c 18.29126,-17.11057 39.19146,-16.31131 37.19262,1.42232 L 403.24567,691 l 17.90285,0 17.90284,0 -1.3744,-2.75 c -0.75592,-1.5125 -11.90097,-25.20525 -24.76677,-52.65057 -22.26683,-47.49956 -23.43494,-49.73694 -24.27716,-46.5 -2.50671,9.63419 -9.88182,30.41156 -13.45314,37.90057 -10.574,22.17351 -24.31231,40.55754 -42.78269,57.25 l -7.46894,6.75 17.65844,0 17.65844,0 6.31326,-5.90575 z M 393,686.95455 C 393,682.3312 389.57413,678 385.91718,678 c -3.03891,0 -11.74958,5.1813 -15.86335,9.43587 L 366.60767,691 l 13.19616,0 13.19617,0 0,-4.04545 z m 6.39301,2.46366 C 401.32615,684.38053 397.83297,677 393.51552,677 c -1.30994,0 -1.22078,0.47964 0.52911,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.08082 c 5.27282,-3.11444 12.55376,-8.05767 16.17986,-10.98496 8.06535,-6.51099 22.68727,-21.55516 26.55726,-27.32416 7.39718,-11.02701 14.69242,-24.10964 16.18695,-29.02827 0.58492,-1.925 2.43585,-7.54701 4.11318,-12.49335 1.67733,-4.94634 3.06572,-10.34634 3.08531,-12 0.0196,-1.65366 0.68756,-5.70665 1.48438,-9.00665 1.23426,-5.11165 1.44623,-29.61526 1.43166,-165.5 -0.01,-92.24026 -0.40711,-162.24099 -0.94197,-166 -2.38319,-16.74917 -4.09703,-24.35244 -7.88929,-35 -4.61951,-12.97023 -5.08087,-13.97312 -10.5806,-23 -7.3243,-12.0216 -14.14273,-20.44297 -24.568,-30.34367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.1631 -2.25,0.0219 0,0.185 15.37953,25.6601 34.17673,56.61133 18.79721,30.95123 35.01717,57.69597 36.04436,59.43274 l 1.86763,3.15777 -16.74666,9.24178 c -42.57707,23.49648 -69.91479,42.48425 -78.56657,54.56942 -2.79906,3.90984 -2.87618,4.27787 -1.46729,7.00236 0.81787,1.58159 2.51046,3.77456 3.76132,4.87326 1.25085,1.0987 1.99589,1.5169 1.65565,0.92934 -1.05908,-1.82895 3.95483,-11.17527 8.73869,-16.28961 2.87407,-3.07261 6.83754,-5.90177 10.69013,-7.63071 5.46528,-2.45267 7.00339,-2.70144 14.32642,-2.31708 6.62451,0.3477 9.09434,0.95248 12.8298,3.14161 4.51863,2.64809 9.71039,8.91083 11.12018,13.41409 0.83305,2.661 1.22329,2.71048 5.91537,0.75 7.82533,-3.26963 17.83863,-1.21756 24.26458,4.97265 5.14497,4.95622 6.75166,9.94261 5.29947,16.44696 -2.08684,9.34697 -8.56409,16.87091 -18.08031,21.002 -7.3422,3.18732 -11.8058,3.4445 -18.81301,1.08395 l -6.28904,-2.11863 -2.82757,2.70899 c -2.3395,2.24139 -3.0882,2.49268 -4.33751,1.45584 -1.30754,-1.08516 -0.88464,-1.96237 3.15503,-6.54426 l 4.66496,-5.29113 1.82446,2.31943 c 2.18369,2.77611 7.99346,4.88173 11.22895,4.06968 3.31777,-0.83271 13.29367,-11.96606 14.43907,-16.11436 1.78803,-6.4757 -1.64559,-13.74082 -8.07518,-17.08613 -3.1061,-1.61612 -11.38272,-1.88864 -12.29966,-0.405 -1.13241,1.83228 -2.45905,1.03376 -3.86235,-2.32479 -0.76405,-1.82864 -3.11833,-4.7501 -5.23173,-6.49215 -5.88179,-4.84827 -12.33639,-6.6605 -23.76576,-6.67261 l -9.85983,-0.0104 -4.25082,4.69284 c -2.33795,2.58106 -5.27369,7.21301 -6.52386,10.29324 l -2.27304,5.6004 2.3837,2.58311 c 1.31103,1.42071 8.00869,7.11153 14.88369,12.64626 41.26642,33.22165 69.03822,62.92113 88.53855,94.68415 3.2078,5.225 5.90986,9.62346 6.0046,9.77436 0.0947,0.1509 2.80637,-0.41175 6.02586,-1.25032 3.2195,-0.83857 6.77103,-1.26936 7.89231,-0.95731 7.83174,2.17957 10.53868,5.24008 10.53868,11.91516 0,6.28106 -7.07017,24.21081 -9.06162,22.98003 -0.40648,-0.25122 0.57941,3.92958 2.19087,9.29066 4.67877,15.56564 6.9503,30.08329 7.54912,48.24742 1.78503,54.14552 -17.96959,101.87132 -60.51319,146.19569 -5.17572,5.39237 -9.05685,9.80431 -8.62473,9.80431 0.43212,0 5.0998,-2.54818 10.37261,-5.66261 z M 651.2,598.8 c -2.93357,-2.93357 0.11116,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 414.39463,565.58519 c 29.62442,-14.3255 43.53276,-23.7208 51.72656,-34.94209 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.44222,-13.45479 -20.64938,-17.20807 l -7.64938,-6.82414 -0.51222,49.24025 c -0.43141,41.47196 -0.80713,51.09395 -2.38155,60.99024 -1.02813,6.4625 -1.55001,11.75 -1.15974,11.75 0.39027,0 10.40138,-4.68667 22.2469,-10.41481 z M 407.2,512.8 c -2.93357,-2.93357 0.11116,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-60.094 c 0.0135,-6.44912 -0.27318,-7.58395 -2.47145,-9.78222 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.06999,10.72737 c 3.02733,6.40538 5.36993,10.25586 5.81444,9.55708 0.40944,-0.64366 0.75133,-4.45324 0.75975,-8.46574 z M 155.75,449.85025 213,445.62615 213,396.81307 213,348 l -4.3185,0 c -10.50616,0 -20.88238,-5.65207 -24.64492,-13.42443 -6.02397,-12.44388 -1.6877,-34.37825 9.12383,-46.15146 4.20715,-4.58139 14.34286,-10.42163 18.08959,-10.42332 1.65182,-7.5e-4 1.75,-4.41233 1.75,-78.63671 l 0,-78.63593 4.25,0.5736 c 2.3375,0.31548 43.33565,4.91578 91.10699,10.22288 l 86.85699,9.64928 10.64301,-10.37949 c 5.85366,-5.70872 12.85961,-12.28671 15.56879,-14.61776 l 4.92578,-4.23826 -105.42578,0.29361 c -105.2142,0.29302 -105.4457,0.29812 -115.3522,2.54445 -5.45952,1.23796 -11.98452,2.88615 -14.5,3.66264 -7.42418,2.29175 -23.55245,9.20684 -27.95414,11.9855 -2.24383,1.41647 -4.35566,2.5754 -4.69294,2.5754 -0.33728,0 -4.73373,3.10008 -9.76987,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.992718,9.20099 -2.069931,13.00322 -2.453193,120.80297 l -0.395717,111.30297 3.290813,-0.51579 c 1.809947,-0.28369 29.053313,-2.41664 60.540813,-4.7399 z M 97.2,392.8 c -2.93357,-2.93357 0.111159,-9.35819 5.83864,-12.31998 3.63301,-1.87871 3.68033,-1.87364 4.96772,0.53186 0.83166,1.55397 0.63348,3.0139 -0.87076,6.41447 -2.58289,5.83906 -7.0527,8.25655 -9.9356,5.37365 z m 6.45988,-6.50145 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 136.6193,244.96558 c -7.18026,-2.14986 -12.22754,-10.94186 -11.16474,-19.44818 1.3109,-10.49207 10.73223,-25.54563 18.42828,-29.44501 8.92203,-4.52055 19.67219,-3.12014 26.43006,3.44302 4.28736,4.16383 5.08737,6.64437 4.48511,13.90679 -1.26805,15.29098 -17.77544,32.73664 -30.74435,32.49185 -2.50451,-0.0473 -5.84997,-0.47409 -7.43436,-0.94847 z m 14.65039,-3.87802 c 3.49003,-1.3269 10.6645,-15.94375 11.41253,-23.25124 1.17685,-11.49654 -5.44873,-18.73473 -16.00472,-17.48453 -6.32812,0.74947 -9.57428,3.71955 -14.22441,13.0146 C 129.59175,219.08587 129,221.3681 129,226.68402 c 0,3.76617 0.62368,7.62137 1.51035,9.336 3.12379,6.04074 12.30487,8.28193 20.75934,5.06754 z m 18.06118,-20.8578 c 2.13359,-5.45849 2.14096,-12.58002 0.0164,-15.82255 C 167.76321,201.98967 161.29717,198 158.96311,198 c -0.61411,0 0.23563,1.1378 1.88832,2.52844 4.41369,3.71387 6.53879,10.11133 5.88749,17.72384 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -1.469,4.05109 2.06797,-1.70677 3.85172,-6.27024 z m 486.34491,222.85998 c 0.5175,-4.36949 0.29291,-5.21196 -2.00097,-7.50584 -1.42115,-1.42115 -3.29283,-2.5839 -4.15929,-2.5839 -1.29139,0 -1.17591,0.54033 0.64053,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51052,7.05796 1.89844,6.06289 2.85929,-2.04996 z M 213,314.8835 l 0,-29.11649 -6.49289,0.41343 c -5.77822,0.36793 -6.8859,0.79351 -10.0635,3.8665 -9.58384,9.26833 -14.37128,32.45711 -8.88947,43.05775 2.9712,5.74567 12.75493,10.75276 21.19586,10.84757 L 213,344 l 0,-29.1165 z m 390.34158,17.16651 c 6.63729,-5.95624 8.83765,-17.00986 4.48702,-22.54078 -2.44793,-3.11204 -9.06462,-6.45609 -12.8286,-6.48353 -2.48331,-0.0181 -2.47997,-0.006 0.5,1.83486 3.99876,2.47001 6.10934,4.96022 7.96186,9.39392 2.81177,6.72951 1.75527,11.51593 -4.3584,19.74552 -2.81098,3.78386 -1.45727,3.16101 4.23812,-1.94999 z M 566.35229,289.5342 C 562.35688,286.73571 549,284.78501 549,287 c 0,0.55 2.5875,1.0203 5.75,1.0451 3.1625,0.0248 7.1,0.66326 8.75,1.41879 4.01966,1.84057 5.4293,1.87532 2.85229,0.0703 z"
+       id="path3518"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#737373"
+       d="m 459.19955,733.75 -8.08162,-17.25 -86.30897,0.0346 -86.30896,0.0345 -10.04216,3.10818 c -17.23769,5.3353 -27.5297,6.70498 -50.45784,6.71503 -22.03804,0.01 -32.47299,-1.24556 -49.01183,-5.89565 C 132.92456,710.35697 101.89277,686.63554 78.728409,651.5 62.69194,627.176 51.332656,593.21741 46.42704,554.93502 45.297172,546.11778 44.677956,530.20802 44.298668,500.25 L 43.763755,458 l 4.868123,-0.007 c 2.677467,-0.004 7.890986,-0.29261 11.585598,-0.64157 l 6.717475,-0.63446 0.319569,-112.60843 c 0.313242,-110.37918 0.362109,-112.83025 2.468486,-123.81363 3.273968,-17.07158 10.994117,-38.3865 17.598593,-48.58876 1.853585,-2.86332 4.437103,-7.00604 5.741152,-9.20604 4.740095,-7.9968 14.182859,-19.44272 23.208519,-28.13191 16.29241,-15.68503 31.68334,-25.991 50.22873,-33.63382 13.92603,-5.739116 15.19345,-6.141458 31.5,-9.999663 L 211.5,87.540444 337,87.020222 462.5,86.5 l 4.14977,-2.699273 c 3.39664,-2.209387 31.99619,-18.386832 39.9712,-22.609864 1.97904,-1.047963 2.66398,-0.232005 10.23486,12.192591 l 8.11388,13.315716 13.26515,0.608445 c 29.10652,1.335057 56.25303,9.135101 75.76514,21.769705 19.03024,12.32257 18.18044,11.66012 32.80359,25.57176 24.16861,22.99266 38.89566,50.94277 46.816,88.85092 1.79032,8.56883 1.89335,16.97468 2.15047,175.45962 0.26602,163.96486 0.23921,166.64757 -1.78829,179 -2.50951,15.28907 -9.7994,37.97719 -15.27513,47.54038 -2.20445,3.85 -5.15179,9.025 -6.54965,11.5 -8.35544,14.79389 -26.77258,34.73549 -43.43131,47.0263 -9.93479,7.32989 -29.08893,17.46862 -41.45553,21.94338 -9.21625,3.33483 -32.20388,8.5335 -42.27015,9.55942 -5.45718,0.55618 -8.10435,1.59073 -16.5,6.44842 C 513.19633,730.83214 471.16269,751 468.01163,751 c -0.40175,0 -4.36718,-7.7625 -8.81208,-17.25 z m 42.50284,-35.25083 c 45.70106,-23.72981 77.55927,-50.16108 98.83683,-82.00031 30.76046,-46.0292 35.76241,-100.90233 13.86992,-152.15769 C 598.2249,426.45014 570.34549,393.14309 522.5232,354.56665 509.49217,344.055 496.89396,332.20558 492.43264,326.26454 c -1.5548,-2.0705 -3.11221,-3.98954 -3.4609,-4.26454 -1.97342,-1.55637 -7.92346,-15.76545 -8.48551,-20.26395 -2.41291,-19.31227 21.87824,-44.07781 73.26377,-74.69456 6.7375,-4.01436 12.25,-7.43862 12.25,-7.60945 0,-0.4504 -63.10145,-104.1329 -66.44848,-109.18204 -1.54951,-2.3375 -2.9981,-4.25 -3.21909,-4.25 -0.22099,0 -4.0987,2.08374 -8.61712,4.63054 -28.70211,16.17785 -62.30067,44.93496 -85.48687,73.16847 -21.01407,25.58854 -38.66072,61.68954 -43.84704,89.70099 -2.24699,12.13606 -2.5706,40.27417 -0.58654,51 4.29662,23.22759 12.89404,44.13129 26.528,64.5 15.31656,22.88247 31.57151,39.74226 59.29375,61.5 41.05805,32.22433 60.77967,58.51658 59.14723,78.85324 -1.59069,19.81667 -20.87231,39.15179 -58.9357,59.09923 l -12.67185,6.64079 3.50223,7.68514 c 1.92622,4.22683 4.11772,8.81834 4.86999,10.20337 0.75226,1.38503 7.64492,16.01823 15.31701,32.51823 18.22716,39.20028 29.04862,61.5 29.84432,61.5 0.35248,0 8.00813,-3.82537 17.01255,-8.50083 z M 229.5,691.94922 c 14.828,-1.10431 27.94686,-3.70571 38.27032,-7.5888 11.11302,-4.18008 26.41824,-12.52082 33.37172,-18.18629 34.33688,-27.97653 52.8237,-61.64392 60.49726,-110.17493 1.3812,-8.73539 1.72832,-21.16687 2.06624,-73.9992 l 0.40615,-63.5 -7.65374,-11.5 C 342.16311,385.52152 331.84281,360.77058 326.81164,335.89995 324.77112,325.81301 324.50809,321.67818 324.52796,300 c 0.0208,-22.75748 0.21336,-25.39056 2.70674,-37.02136 5.2442,-24.46259 15.83711,-49.98506 30.23509,-72.84823 5.46825,-8.68326 6.53021,-11.08194 6.53021,-14.75 0,-3.50497 -0.34974,-4.38051 -1.75,-4.38089 -0.9625,-2.6e-4 -27.04094,-2.92526 -57.95209,-6.5 C 273.38677,160.92478 247.84927,158 247.54791,158 c -0.30135,0 -0.55056,84.2625 -0.55381,187.25 -0.006,203.38879 0.12121,198.42772 -5.48724,213.328 -4.53025,12.03578 -10.62939,19.90506 -17.72474,22.86895 -4.69128,1.95966 -14.00555,2.00599 -17.71432,0.0881 -11.66958,-6.03457 -18.99436,-39.81173 -19.05233,-87.85702 L 187,480.85609 l -5.25,0.58824 c -2.8875,0.32354 -23.7,1.96751 -46.25,3.65327 -58.042902,4.33909 -58.291278,4.36034 -58.977817,5.04688 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.886821,37.53643 15.248325,68.28792 30.749142,91.25914 2.76753,4.10129 8.67424,11.26963 13.12602,15.92964 21.90705,22.93172 48.51789,35.44467 81.08623,38.1284 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.33075 15,-0.90421 z m 137.0584,-6.85497 c 18.29126,-17.11057 39.19146,-16.31131 37.19262,1.42232 L 403.24567,691 l 17.90285,0 17.90284,0 -1.3744,-2.75 c -0.75592,-1.5125 -11.90097,-25.20525 -24.76677,-52.65057 -22.26683,-47.49956 -23.43494,-49.73694 -24.27716,-46.5 -2.50671,9.63419 -9.88182,30.41156 -13.45314,37.90057 -10.574,22.17351 -24.31231,40.55754 -42.78269,57.25 l -7.46894,6.75 17.65844,0 17.65844,0 6.31326,-5.90575 z M 393,686.95455 C 393,682.3312 389.57413,678 385.91718,678 c -3.03891,0 -11.74958,5.1813 -15.86335,9.43587 L 366.60767,691 l 13.19616,0 13.19617,0 0,-4.04545 z m 6.39301,2.46366 C 401.32615,684.38053 397.83297,677 393.51552,677 c -1.30994,0 -1.22078,0.47964 0.52911,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.08082 c 5.27282,-3.11444 12.55376,-8.05767 16.17986,-10.98496 8.06535,-6.51099 22.68727,-21.55516 26.55726,-27.32416 7.39718,-11.02701 14.69242,-24.10964 16.18695,-29.02827 0.58492,-1.925 2.43585,-7.54701 4.11318,-12.49335 1.67733,-4.94634 3.06572,-10.34634 3.08531,-12 0.0196,-1.65366 0.68756,-5.70665 1.48438,-9.00665 1.23426,-5.11165 1.44623,-29.61526 1.43166,-165.5 -0.01,-92.24026 -0.40711,-162.24099 -0.94197,-166 -2.38319,-16.74917 -4.09703,-24.35244 -7.88929,-35 -4.61951,-12.97023 -5.08087,-13.97312 -10.5806,-23 -7.3243,-12.0216 -14.14273,-20.44297 -24.568,-30.34367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.1631 -2.25,0.0219 0,0.185 15.37953,25.6601 34.17673,56.61133 18.79721,30.95123 35.01717,57.69597 36.04436,59.43274 l 1.86763,3.15777 -16.74666,9.24178 c -42.57707,23.49648 -69.91479,42.48425 -78.56657,54.56942 -2.79906,3.90984 -2.87618,4.27787 -1.46729,7.00236 0.81787,1.58159 2.51046,3.77456 3.76132,4.87326 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13308,-1.95005 5.17,-12.99011 9.91192,-17.36106 2.50148,-2.30579 7.0354,-5.33104 10.07538,-6.72279 4.86891,-2.22906 6.52002,-2.47834 13.86267,-2.09295 10.65977,0.5595 16.37214,3.72587 21.17704,11.73846 1.76916,2.95022 3.37177,5.82939 3.56136,6.39815 0.21719,0.65158 1.90159,0.41116 4.55358,-0.64996 10.56458,-4.22711 23.97053,0.23124 28.80465,9.57941 5.31706,10.28204 -2.59606,26.24328 -15.98828,32.24933 -8.03678,3.60428 -12.38258,3.93473 -19.63147,1.49276 l -6.28904,-2.11863 -2.82757,2.70899 c -2.3395,2.24139 -3.0882,2.49268 -4.33751,1.45584 -1.30754,-1.08516 -0.88464,-1.96237 3.15503,-6.54426 l 4.66496,-5.29113 1.82446,2.31943 c 2.18369,2.77611 7.99346,4.88173 11.22895,4.06968 3.31777,-0.83271 13.29367,-11.96606 14.43907,-16.11436 1.78803,-6.4757 -1.64559,-13.74082 -8.07518,-17.08613 -3.1061,-1.61612 -11.38272,-1.88864 -12.29966,-0.405 -1.13241,1.83228 -2.45905,1.03376 -3.86235,-2.32479 -0.76405,-1.82864 -3.11833,-4.7501 -5.23173,-6.49215 -5.88179,-4.84827 -12.33639,-6.6605 -23.76576,-6.67261 l -9.85983,-0.0104 -4.25082,4.69284 c -2.33795,2.58106 -5.27369,7.21301 -6.52386,10.29324 l -2.27304,5.6004 2.3837,2.58311 c 1.31103,1.42071 8.00869,7.11153 14.88369,12.64626 41.26642,33.22165 69.03822,62.92113 88.53855,94.68415 3.2078,5.225 5.90986,9.62346 6.0046,9.77436 0.0947,0.1509 2.80637,-0.41175 6.02586,-1.25032 3.2195,-0.83857 6.77103,-1.26936 7.89231,-0.95731 7.83174,2.17957 10.53868,5.24008 10.53868,11.91516 0,6.28106 -7.07017,24.21081 -9.06162,22.98003 -0.40648,-0.25122 0.57941,3.92958 2.19087,9.29066 4.67877,15.56564 6.9503,30.08329 7.54912,48.24742 1.78503,54.14552 -17.96959,101.87132 -60.51319,146.19569 -5.17572,5.39237 -9.05685,9.80431 -8.62473,9.80431 0.43212,0 5.0998,-2.54818 10.37261,-5.66261 z m 49.12093,-72.79643 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.62589,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 414.39463,565.58519 c 29.62442,-14.3255 43.53276,-23.7208 51.72656,-34.94209 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.44222,-13.45479 -20.64938,-17.20807 l -7.64938,-6.82414 -0.51222,49.24025 c -0.43141,41.47196 -0.80713,51.09395 -2.38155,60.99024 -1.02813,6.4625 -1.55001,11.75 -1.15974,11.75 0.39027,0 10.40138,-4.68667 22.2469,-10.41481 z m -7.36064,-53.04423 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.62589,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-60.094 c 0.0135,-6.44912 -0.27318,-7.58395 -2.47145,-9.78222 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.06999,10.72737 c 3.02733,6.40538 5.36993,10.25586 5.81444,9.55708 0.40944,-0.64366 0.75133,-4.45324 0.75975,-8.46574 z m -493.23469,3.6457 57.25,-4.2241 0,-48.67617 0,-48.67616 -6.60009,-0.52979 c -19.04176,-1.52849 -28.21818,-15.04026 -24.16989,-35.58883 2.02328,-10.26988 5.46181,-17.78069 10.78313,-23.55364 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93116,278 213,275.05833 213,199.36408 l 0,-78.63593 4.25,0.5736 c 2.3375,0.31548 43.33565,4.91578 91.10699,10.22288 l 86.85699,9.64928 10.64301,-10.37949 c 5.85366,-5.70872 12.85961,-12.28671 15.56879,-14.61776 l 4.92578,-4.23826 -105.42578,0.29361 c -105.2142,0.29302 -105.4457,0.29812 -115.3522,2.54445 -5.45952,1.23796 -11.98452,2.88615 -14.5,3.66264 -7.42418,2.29175 -23.55245,9.20684 -27.95414,11.9855 -2.24383,1.41647 -4.35566,2.5754 -4.69294,2.5754 -0.33728,0 -4.73373,3.10008 -9.76987,6.88907 -11.50538,8.65617 -26.82083,24.46036 -32.57152,33.61093 -2.41955,3.85 -5.563,8.8 -6.98547,11 -5.15187,7.96795 -11.292005,24.46176 -14.332356,38.5 -1.992718,9.20099 -2.069931,13.00322 -2.453193,120.80297 l -0.395717,111.30297 3.290813,-0.51579 c 1.809947,-0.28369 29.053313,-2.41664 60.540813,-4.7399 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.625887,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 135.4214,244.10367 c -10.74492,-4.8801 -13.01574,-17.06505 -5.83326,-31.30053 7.85201,-15.56245 19.06593,-22.08058 31.67942,-18.41374 6.49092,1.88697 12.40555,7.35118 13.33816,12.32245 1.66085,8.8531 -2.32546,19.53785 -10.71329,28.71547 -8.87232,9.70774 -19.24219,12.86788 -28.47103,8.67635 z m 15.84829,-3.01611 c 3.49003,-1.3269 10.6645,-15.94375 11.41253,-23.25124 1.17685,-11.49654 -5.44873,-18.73473 -16.00472,-17.48453 -6.32812,0.74947 -9.57428,3.71955 -14.22441,13.0146 C 129.59175,219.08587 129,221.3681 129,226.68402 c 0,3.76617 0.62368,7.62137 1.51035,9.336 3.12379,6.04074 12.30487,8.28193 20.75934,5.06754 z m 18.06118,-20.8578 c 2.13359,-5.45849 2.14096,-12.58002 0.0164,-15.82255 C 167.76321,201.98967 161.29717,198 158.96311,198 c -0.61411,0 0.23563,1.1378 1.88832,2.52844 4.41369,3.71387 6.53879,10.11133 5.88749,17.72384 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -1.469,4.05109 2.06797,-1.70677 3.85172,-6.27024 z m 486.34491,222.85998 c 0.5175,-4.36949 0.29291,-5.21196 -2.00097,-7.50584 -1.42115,-1.42115 -3.29283,-2.5839 -4.15929,-2.5839 -1.29139,0 -1.17591,0.54033 0.64053,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51052,7.05796 1.89844,6.06289 2.85929,-2.04996 z M 213,314.8835 l 0,-29.11649 -6.49289,0.41343 c -5.77822,0.36793 -6.8859,0.79351 -10.0635,3.8665 -9.58384,9.26833 -14.37128,32.45711 -8.88947,43.05775 2.9712,5.74567 12.75493,10.75276 21.19586,10.84757 L 213,344 l 0,-29.1165 z m 390.34158,17.16651 c 6.63729,-5.95624 8.83765,-17.00986 4.48702,-22.54078 -2.44793,-3.11204 -9.06462,-6.45609 -12.8286,-6.48353 -2.48331,-0.0181 -2.47997,-0.006 0.5,1.83486 3.99876,2.47001 6.10934,4.96022 7.96186,9.39392 2.81177,6.72951 1.75527,11.51593 -4.3584,19.74552 -2.81098,3.78386 -1.45727,3.16101 4.23812,-1.94999 z M 566.35229,289.5342 C 562.35688,286.73571 549,284.78501 549,287 c 0,0.55 2.5875,1.0203 5.75,1.0451 3.1625,0.0248 7.1,0.66326 8.75,1.41879 4.01966,1.84057 5.4293,1.87532 2.85229,0.0703 z"
+       id="path3516"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#9a823b"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.00694,707.47646 78.044244,666.1067 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 c 3.687843,-18.66175 10.889399,-38.04115 18.476314,-49.71979 2.422585,-3.72912 4.97091,-7.85434 5.662946,-9.16718 2.905449,-5.5118 13.711766,-18.46479 22.312546,-26.74494 C 140.40722,111.13193 163.14421,98.992468 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.609388 C 556.4008,88.140817 571.0156,90.88227 587,96.458287 c 15.86403,5.534023 19.63372,7.528723 39.5,20.901033 6.93248,4.66636 8.12195,5.70522 21.91562,19.14068 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 42.47405,-35.25083 c 45.70106,-23.72981 77.55927,-50.16108 98.83683,-82.00031 30.76046,-46.0292 35.76241,-100.90233 13.86992,-152.15769 C 598.2249,426.45014 570.34549,393.14309 522.5232,354.56665 509.49217,344.055 496.89396,332.20558 492.43264,326.26454 c -1.5548,-2.0705 -3.11221,-3.98954 -3.4609,-4.26454 -1.97342,-1.55637 -7.92346,-15.76545 -8.48551,-20.26395 -2.41291,-19.31227 21.87824,-44.07781 73.26377,-74.69456 6.7375,-4.01436 12.25,-7.43862 12.25,-7.60945 0,-0.4504 -63.10145,-104.1329 -66.44848,-109.18204 -1.54951,-2.3375 -2.9981,-4.25 -3.21909,-4.25 -1.19909,0 -18.13103,10.15366 -26.33243,15.79091 -12.17384,8.3677 -22.66913,16.78932 -36.75932,29.49639 -31.86089,28.73335 -54.77986,61.47399 -67.84818,96.92377 -6.63783,18.00611 -8.82091,30.7668 -8.85998,51.78893 -0.0433,23.29416 2.27301,35.93762 10.16767,55.5 14.40066,35.68377 37.16724,63.80293 76.91642,95 41.05805,32.22433 60.77967,58.51658 59.14723,78.85324 -1.59083,19.81843 -20.8717,39.15143 -58.94449,59.10385 l -12.68065,6.64542 3.80187,8.19875 C 460.60214,658.64048 483.80111,707 484.68681,707 c 0.35415,0 8.01116,-3.82537 17.01558,-8.50083 z M 229.5,691.94922 c 31.90362,-2.37601 56.94592,-12.48027 78.84626,-31.8135 24.05069,-21.23152 41.19138,-50.309 49.16793,-83.4085 5.52115,-22.9106 5.75384,-26.46391 6.20326,-94.72722 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.79397,-15.39044 -0.80725,-44.22655 1.99621,-58.33768 4.69916,-23.6531 16.17094,-51.62665 30.49853,-74.36959 5.47111,-8.68458 6.53263,-11.08138 6.53263,-14.75 0,-3.50497 -0.34974,-4.38051 -1.75,-4.38089 -0.9625,-2.6e-4 -27.04094,-2.92526 -57.95209,-6.5 C 273.38677,160.92478 247.84927,158 247.54791,158 c -0.30135,0 -0.55056,84.2625 -0.55381,187.25 -0.006,203.38879 0.12121,198.42772 -5.48724,213.328 -4.53025,12.03578 -10.62939,19.90506 -17.72474,22.86895 -4.69128,1.95966 -14.00555,2.00599 -17.71432,0.0881 -11.66958,-6.03457 -18.99436,-39.81173 -19.05233,-87.85702 L 187,480.85609 l -5.25,0.58824 c -2.8875,0.32354 -23.7,1.96751 -46.25,3.65327 -58.042902,4.33909 -58.291278,4.36034 -58.977817,5.04688 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.33075 15,-0.90421 z m 137.0584,-6.85497 c 18.29126,-17.11057 39.19146,-16.31131 37.19262,1.42232 L 403.24567,691 l 17.90285,0 17.90284,0 -1.3744,-2.75 c -0.75592,-1.5125 -11.90097,-25.20525 -24.76677,-52.65057 -22.26683,-47.49956 -23.43494,-49.73694 -24.27716,-46.5 -2.50671,9.63419 -9.88182,30.41156 -13.45314,37.90057 -10.574,22.17351 -24.31231,40.55754 -42.78269,57.25 l -7.46894,6.75 17.65844,0 17.65844,0 6.31326,-5.90575 z M 393,686.95455 C 393,682.3312 389.57413,678 385.91718,678 c -3.03891,0 -11.74958,5.1813 -15.86335,9.43587 L 366.60767,691 l 13.19616,0 13.19617,0 0,-4.04545 z m 6.39301,2.46366 C 401.32615,684.38053 397.83297,677 393.51552,677 c -1.30994,0 -1.22078,0.47964 0.52911,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.08082 c 5.27282,-3.11444 12.55376,-8.05767 16.17986,-10.98496 8.06535,-6.51099 22.68727,-21.55516 26.55726,-27.32416 7.39718,-11.02701 14.69242,-24.10964 16.18695,-29.02827 0.58492,-1.925 2.43585,-7.54701 4.11318,-12.49335 1.67733,-4.94634 3.06572,-10.34634 3.08531,-12 0.0196,-1.65366 0.68756,-5.70665 1.48438,-9.00665 1.23426,-5.11165 1.44623,-29.61526 1.43166,-165.5 -0.01,-92.24026 -0.40711,-162.24099 -0.94197,-166 -2.38319,-16.74917 -4.09703,-24.35244 -7.88929,-35 -4.61951,-12.97023 -5.08087,-13.97312 -10.5806,-23 -7.3243,-12.0216 -14.14273,-20.44297 -24.568,-30.34367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.1631 -2.25,0.0219 0,0.185 15.37953,25.6601 34.17673,56.61133 18.79721,30.95123 35.01717,57.69597 36.04436,59.43274 l 1.86763,3.15777 -16.74666,9.24178 c -42.57707,23.49648 -69.91479,42.48425 -78.56657,54.56942 -2.79906,3.90984 -2.87618,4.27787 -1.46729,7.00236 0.81787,1.58159 2.51046,3.77456 3.76132,4.87326 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13308,-1.95005 5.17,-12.99011 9.91192,-17.36106 2.50148,-2.30579 7.0354,-5.33104 10.07538,-6.72279 4.86891,-2.22906 6.52002,-2.47834 13.86267,-2.09295 10.65977,0.5595 16.37214,3.72587 21.17704,11.73846 1.76916,2.95022 3.37177,5.82939 3.56136,6.39815 0.21719,0.65158 1.90159,0.41116 4.55358,-0.64996 10.56458,-4.22711 23.97053,0.23124 28.80465,9.57941 5.31706,10.28204 -2.59606,26.24328 -15.98828,32.24933 -8.03678,3.60428 -12.38258,3.93473 -19.63147,1.49276 l -6.28904,-2.11863 -2.82757,2.70899 c -2.3395,2.24139 -3.0882,2.49268 -4.33751,1.45584 -1.30754,-1.08516 -0.88464,-1.96237 3.15503,-6.54426 l 4.66496,-5.29113 1.82446,2.31943 c 2.18369,2.77611 7.99346,4.88173 11.22895,4.06968 3.31777,-0.83271 13.29367,-11.96606 14.43907,-16.11436 1.78803,-6.4757 -1.64559,-13.74082 -8.07518,-17.08613 -3.1061,-1.61612 -11.38272,-1.88864 -12.29966,-0.405 -1.13241,1.83228 -2.45905,1.03376 -3.86235,-2.32479 -0.76405,-1.82864 -3.11833,-4.7501 -5.23173,-6.49215 -5.88179,-4.84827 -12.33639,-6.6605 -23.76576,-6.67261 l -9.85983,-0.0104 -4.25082,4.69284 c -2.33795,2.58106 -5.27369,7.21301 -6.52386,10.29324 l -2.27304,5.6004 2.3837,2.58311 c 1.31103,1.42071 8.00869,7.11153 14.88369,12.64626 41.26642,33.22165 69.03822,62.92113 88.53855,94.68415 3.2078,5.225 5.90986,9.62346 6.0046,9.77436 0.0947,0.1509 2.80637,-0.41175 6.02586,-1.25032 3.2195,-0.83857 6.77103,-1.26936 7.89231,-0.95731 7.83174,2.17957 10.53868,5.24008 10.53868,11.91516 0,6.28106 -7.07017,24.21081 -9.06162,22.98003 -0.40648,-0.25122 0.57941,3.92958 2.19087,9.29066 4.67877,15.56564 6.9503,30.08329 7.54912,48.24742 1.78503,54.14552 -17.96959,101.87132 -60.51319,146.19569 -5.17572,5.39237 -9.05685,9.80431 -8.62473,9.80431 0.43212,0 5.0998,-2.54818 10.37261,-5.66261 z m 49.12093,-72.79643 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.62589,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 414.39463,565.58519 c 29.62442,-14.3255 43.53276,-23.7208 51.72656,-34.94209 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.44222,-13.45479 -20.64938,-17.20807 l -7.64938,-6.82414 -0.51222,49.24025 c -0.43141,41.47196 -0.80713,51.09395 -2.38155,60.99024 -1.02813,6.4625 -1.55001,11.75 -1.15974,11.75 0.39027,0 10.40138,-4.68667 22.2469,-10.41481 z m -7.36064,-53.04423 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.62589,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-60.094 c 0.0135,-6.44912 -0.27318,-7.58395 -2.47145,-9.78222 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.06999,10.72737 c 3.02733,6.40538 5.36993,10.25586 5.81444,9.55708 0.40944,-0.64366 0.75133,-4.45324 0.75975,-8.46574 z m -493.23469,3.6457 57.25,-4.2241 0,-48.67617 0,-48.67616 -6.60009,-0.52979 c -19.04176,-1.52849 -28.21818,-15.04026 -24.16989,-35.58883 2.02328,-10.26988 5.46181,-17.78069 10.78313,-23.55364 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93116,278 213,275.05833 213,199.36408 l 0,-78.63593 4.25,0.5736 c 2.3375,0.31548 43.33565,4.91578 91.10699,10.22288 l 86.85699,9.64928 10.64301,-10.37949 c 5.85366,-5.70872 12.85961,-12.28671 15.56879,-14.61776 l 4.92578,-4.23826 -105.42578,0.29361 c -105.2142,0.29302 -105.4457,0.29812 -115.3522,2.54445 -5.45952,1.23796 -11.98452,2.88615 -14.5,3.66264 -7.42418,2.29175 -23.55245,9.20684 -27.95414,11.9855 -2.24383,1.41647 -4.35566,2.5754 -4.69294,2.5754 -0.33728,0 -4.73373,3.10008 -9.76987,6.88907 -11.09889,8.35035 -26.71099,24.32474 -32.15962,32.90591 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990649,9.19837 -2.068488,13.03387 -2.451641,120.80297 l -0.395717,111.30297 3.290813,-0.51579 c 1.809947,-0.28369 29.053313,-2.41664 60.540813,-4.7399 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.625887,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 135.4214,244.10367 c -10.74492,-4.8801 -13.01574,-17.06505 -5.83326,-31.30053 7.85201,-15.56245 19.06593,-22.08058 31.67942,-18.41374 6.49092,1.88697 12.40555,7.35118 13.33816,12.32245 1.66085,8.8531 -2.32546,19.53785 -10.71329,28.71547 -8.87232,9.70774 -19.24219,12.86788 -28.47103,8.67635 z m 15.84829,-3.01611 c 3.49003,-1.3269 10.6645,-15.94375 11.41253,-23.25124 1.17685,-11.49654 -5.44873,-18.73473 -16.00472,-17.48453 -6.32812,0.74947 -9.57428,3.71955 -14.22441,13.0146 C 129.59175,219.08587 129,221.3681 129,226.68402 c 0,3.76617 0.62368,7.62137 1.51035,9.336 3.12379,6.04074 12.30487,8.28193 20.75934,5.06754 z m 18.06118,-20.8578 c 2.13359,-5.45849 2.14096,-12.58002 0.0164,-15.82255 C 167.76321,201.98967 161.29717,198 158.96311,198 c -0.61411,0 0.23563,1.1378 1.88832,2.52844 4.41369,3.71387 6.53879,10.11133 5.88749,17.72384 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -1.469,4.05109 2.06797,-1.70677 3.85172,-6.27024 z m 486.34491,222.85998 c 0.5175,-4.36949 0.29291,-5.21196 -2.00097,-7.50584 -1.42115,-1.42115 -3.29283,-2.5839 -4.15929,-2.5839 -1.29139,0 -1.17591,0.54033 0.64053,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51052,7.05796 1.89844,6.06289 2.85929,-2.04996 z M 213,314.8835 l 0,-29.11649 -6.49289,0.41343 c -5.77822,0.36793 -6.8859,0.79351 -10.0635,3.8665 -9.58384,9.26833 -14.37128,32.45711 -8.88947,43.05775 2.9712,5.74567 12.75493,10.75276 21.19586,10.84757 L 213,344 l 0,-29.1165 z m 390.34158,17.16651 c 6.63729,-5.95624 8.83765,-17.00986 4.48702,-22.54078 -2.44793,-3.11204 -9.06462,-6.45609 -12.8286,-6.48353 -2.48331,-0.0181 -2.47997,-0.006 0.5,1.83486 3.99876,2.47001 6.10934,4.96022 7.96186,9.39392 2.81177,6.72951 1.75527,11.51593 -4.3584,19.74552 -2.81098,3.78386 -1.45727,3.16101 4.23812,-1.94999 z M 566.35229,289.5342 C 562.35688,286.73571 549,284.78501 549,287 c 0,0.55 2.5875,1.0203 5.75,1.0451 3.1625,0.0248 7.1,0.66326 8.75,1.41879 4.01966,1.84057 5.4293,1.87532 2.85229,0.0703 z"
+       id="path3514"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#8e8046"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.00694,707.47646 78.044244,666.1067 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 c 3.687843,-18.66175 10.889399,-38.04115 18.476314,-49.71979 2.422585,-3.72912 4.97091,-7.85434 5.662946,-9.16718 2.905449,-5.5118 13.711766,-18.46479 22.312546,-26.74494 C 140.40722,111.13193 163.14421,98.992468 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.609388 C 556.4008,88.140817 571.0156,90.88227 587,96.458287 c 15.86403,5.534023 19.63372,7.528723 39.5,20.901033 6.93248,4.66636 8.12195,5.70522 21.91562,19.14068 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 42.47405,-35.25083 c 45.70106,-23.72981 77.55927,-50.16108 98.83683,-82.00031 30.76046,-46.0292 35.76241,-100.90233 13.86992,-152.15769 C 598.2249,426.45014 570.34549,393.14309 522.5232,354.56665 509.49217,344.055 496.89396,332.20558 492.43264,326.26454 c -1.5548,-2.0705 -3.11221,-3.98954 -3.4609,-4.26454 -1.97342,-1.55637 -7.92346,-15.76545 -8.48551,-20.26395 -2.41291,-19.31227 21.87824,-44.07781 73.26377,-74.69456 6.7375,-4.01436 12.25,-7.43862 12.25,-7.60945 0,-0.4504 -63.10145,-104.1329 -66.44848,-109.18204 -1.54951,-2.3375 -2.9981,-4.25 -3.21909,-4.25 -1.19909,0 -18.13103,10.15366 -26.33243,15.79091 -12.17384,8.3677 -22.66913,16.78932 -36.75932,29.49639 -31.86089,28.73335 -54.77986,61.47399 -67.84818,96.92377 -6.63783,18.00611 -8.82091,30.7668 -8.85998,51.78893 -0.0433,23.29416 2.27301,35.93762 10.16767,55.5 14.40066,35.68377 37.16724,63.80293 76.91642,95 41.05805,32.22433 60.77967,58.51658 59.14723,78.85324 -1.59083,19.81843 -20.8717,39.15143 -58.94449,59.10385 l -12.68065,6.64542 3.80187,8.19875 C 460.60214,658.64048 483.80111,707 484.68681,707 c 0.35415,0 8.01116,-3.82537 17.01558,-8.50083 z M 229.5,691.94922 c 31.90362,-2.37601 56.94592,-12.48027 78.84626,-31.8135 24.05069,-21.23152 41.19138,-50.309 49.16793,-83.4085 5.52115,-22.9106 5.75384,-26.46391 6.20326,-94.72722 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.79397,-15.39044 -0.80725,-44.22655 1.99621,-58.33768 4.69916,-23.6531 16.17094,-51.62665 30.49853,-74.36959 5.47111,-8.68458 6.53263,-11.08138 6.53263,-14.75 0,-3.50497 -0.34974,-4.38051 -1.75,-4.38089 -0.9625,-2.6e-4 -27.04094,-2.92526 -57.95209,-6.5 C 273.38677,160.92478 247.84927,158 247.54791,158 c -0.30135,0 -0.55056,84.2625 -0.55381,187.25 -0.006,203.38879 0.12121,198.42772 -5.48724,213.328 -4.53025,12.03578 -10.62939,19.90506 -17.72474,22.86895 -4.69128,1.95966 -14.00555,2.00599 -17.71432,0.0881 -11.66958,-6.03457 -18.99436,-39.81173 -19.05233,-87.85702 L 187,480.85609 l -5.25,0.58824 c -2.8875,0.32354 -23.7,1.96751 -46.25,3.65327 -58.042902,4.33909 -58.291278,4.36034 -58.977817,5.04688 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.33075 15,-0.90421 z m 137.0584,-6.85497 c 18.29126,-17.11057 39.19146,-16.31131 37.19262,1.42232 L 403.24567,691 l 17.90285,0 17.90284,0 -1.3744,-2.75 c -0.75592,-1.5125 -11.90097,-25.20525 -24.76677,-52.65057 -22.26683,-47.49956 -23.43494,-49.73694 -24.27716,-46.5 -2.50671,9.63419 -9.88182,30.41156 -13.45314,37.90057 -10.574,22.17351 -24.31231,40.55754 -42.78269,57.25 l -7.46894,6.75 17.65844,0 17.65844,0 6.31326,-5.90575 z M 393,686.95455 C 393,682.3312 389.57413,678 385.91718,678 c -3.03891,0 -11.74958,5.1813 -15.86335,9.43587 L 366.60767,691 l 13.19616,0 13.19617,0 0,-4.04545 z m 6.39301,2.46366 c 1.47442,-3.84226 0.60573,-8.27404 -2.02787,-10.34563 -4.00151,-3.14759 -5.89374,-2.70657 -3.32051,0.77391 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.08082 c 5.27282,-3.11444 12.55376,-8.05767 16.17986,-10.98496 8.06535,-6.51099 22.68727,-21.55516 26.55726,-27.32416 7.39718,-11.02701 14.69242,-24.10964 16.18695,-29.02827 0.58492,-1.925 2.43585,-7.54701 4.11318,-12.49335 1.67733,-4.94634 3.06572,-10.34634 3.08531,-12 0.0196,-1.65366 0.68756,-5.70665 1.48438,-9.00665 1.23426,-5.11165 1.44623,-29.61526 1.43166,-165.5 -0.01,-92.24026 -0.40711,-162.24099 -0.94197,-166 -2.38319,-16.74917 -4.09703,-24.35244 -7.88929,-35 -4.61951,-12.97023 -5.08087,-13.97312 -10.5806,-23 -7.3243,-12.0216 -14.14273,-20.44297 -24.568,-30.34367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.1631 -2.25,0.0219 0,0.185 15.37953,25.6601 34.17673,56.61133 18.79721,30.95123 35.01717,57.69597 36.04436,59.43274 l 1.86763,3.15777 -16.74666,9.24178 c -42.57707,23.49648 -69.91479,42.48425 -78.56657,54.56942 -2.79906,3.90984 -2.87618,4.27787 -1.46729,7.00236 0.81787,1.58159 2.51046,3.77456 3.76132,4.87326 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13308,-1.95005 5.17,-12.99011 9.91192,-17.36106 2.50148,-2.30579 7.0354,-5.33104 10.07538,-6.72279 4.86891,-2.22906 6.52002,-2.47834 13.86267,-2.09295 10.65977,0.5595 16.37214,3.72587 21.17704,11.73846 1.76916,2.95022 3.37177,5.82939 3.56136,6.39815 0.21719,0.65158 1.90159,0.41116 4.55358,-0.64996 10.56458,-4.22711 23.97053,0.23124 28.80465,9.57941 5.31706,10.28204 -2.59606,26.24328 -15.98828,32.24933 -8.03678,3.60428 -12.38258,3.93473 -19.63147,1.49276 l -6.28904,-2.11863 -2.82757,2.70899 c -2.3395,2.24139 -3.0882,2.49268 -4.33751,1.45584 -1.30754,-1.08516 -0.88464,-1.96237 3.15503,-6.54426 l 4.66496,-5.29113 1.82446,2.31943 c 2.18369,2.77611 7.99346,4.88173 11.22895,4.06968 3.31777,-0.83271 13.29367,-11.96606 14.43907,-16.11436 1.78803,-6.4757 -1.64559,-13.74082 -8.07518,-17.08613 -3.1061,-1.61612 -11.38272,-1.88864 -12.29966,-0.405 -1.13241,1.83228 -2.45905,1.03376 -3.86235,-2.32479 -0.76405,-1.82864 -3.11833,-4.7501 -5.23173,-6.49215 -5.88179,-4.84827 -12.33639,-6.6605 -23.76576,-6.67261 l -9.85983,-0.0104 -4.25082,4.69284 c -2.33795,2.58106 -5.27369,7.21301 -6.52386,10.29324 l -2.27304,5.6004 2.3837,2.58311 c 1.31103,1.42071 8.00869,7.11153 14.88369,12.64626 41.26642,33.22165 69.03822,62.92113 88.53855,94.68415 3.2078,5.225 5.90986,9.62346 6.0046,9.77436 0.0947,0.1509 2.80637,-0.41175 6.02586,-1.25032 3.2195,-0.83857 6.77103,-1.26936 7.89231,-0.95731 7.83174,2.17957 10.53868,5.24008 10.53868,11.91516 0,6.28106 -7.07017,24.21081 -9.06162,22.98003 -0.40648,-0.25122 0.57941,3.92958 2.19087,9.29066 4.67877,15.56564 6.9503,30.08329 7.54912,48.24742 1.78503,54.14552 -17.96959,101.87132 -60.51319,146.19569 -5.17572,5.39237 -9.05685,9.80431 -8.62473,9.80431 0.43212,0 5.0998,-2.54818 10.37261,-5.66261 z m 49.12093,-72.79643 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.62589,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 414.39463,565.58519 c 29.62442,-14.3255 43.53276,-23.7208 51.72656,-34.94209 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.44222,-13.45479 -20.64938,-17.20807 l -7.64938,-6.82414 -0.51222,49.24025 c -0.43141,41.47196 -0.80713,51.09395 -2.38155,60.99024 -1.02813,6.4625 -1.55001,11.75 -1.15974,11.75 0.39027,0 10.40138,-4.68667 22.2469,-10.41481 z m -7.36064,-53.04423 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.62589,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-60.094 c 0.0135,-6.44912 -0.27318,-7.58395 -2.47145,-9.78222 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.06999,10.72737 c 3.02733,6.40538 5.36993,10.25586 5.81444,9.55708 0.40944,-0.64366 0.75133,-4.45324 0.75975,-8.46574 z m -493.23469,3.6457 57.25,-4.2241 0,-48.67617 0,-48.67616 -6.60009,-0.52979 c -19.04176,-1.52849 -28.21818,-15.04026 -24.16989,-35.58883 2.02328,-10.26988 5.46181,-17.78069 10.78313,-23.55364 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93116,278 213,275.05833 213,199.36408 l 0,-78.63593 4.25,0.5736 c 2.3375,0.31548 43.33565,4.91578 91.10699,10.22288 l 86.85699,9.64928 10.64301,-10.37949 c 5.85366,-5.70872 12.85961,-12.28671 15.56879,-14.61776 l 4.92578,-4.23826 -105.42578,0.29361 c -105.2142,0.29302 -105.4457,0.29812 -115.3522,2.54445 -5.45952,1.23796 -11.98452,2.88615 -14.5,3.66264 -7.42418,2.29175 -23.55245,9.20684 -27.95414,11.9855 -2.24383,1.41647 -4.35566,2.5754 -4.69294,2.5754 -0.33728,0 -4.73373,3.10008 -9.76987,6.88907 -11.09889,8.35035 -26.71099,24.32474 -32.15962,32.90591 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990649,9.19837 -2.068488,13.03387 -2.451641,120.80297 l -0.395717,111.30297 3.290813,-0.51579 c 1.809947,-0.28369 29.053313,-2.41664 60.540813,-4.7399 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.625887,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 135.4214,244.10367 c -10.74492,-4.8801 -13.01574,-17.06505 -5.83326,-31.30053 7.85201,-15.56245 19.06593,-22.08058 31.67942,-18.41374 6.49092,1.88697 12.40555,7.35118 13.33816,12.32245 1.66085,8.8531 -2.32546,19.53785 -10.71329,28.71547 -8.87232,9.70774 -19.24219,12.86788 -28.47103,8.67635 z m 15.84829,-3.01611 c 3.49003,-1.3269 10.6645,-15.94375 11.41253,-23.25124 1.17685,-11.49654 -5.44873,-18.73473 -16.00472,-17.48453 -6.32812,0.74947 -9.57428,3.71955 -14.22441,13.0146 C 129.59175,219.08587 129,221.3681 129,226.68402 c 0,3.76617 0.62368,7.62137 1.51035,9.336 3.12379,6.04074 12.30487,8.28193 20.75934,5.06754 z m 18.26214,-21.17777 c 3.31596,-9.39844 1.11427,-16.95172 -5.91327,-20.2865 -5.06722,-2.40456 -6.56017,-1.94921 -2.94705,0.89885 4.53907,3.57794 6.73037,9.98136 6.06741,17.73014 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -0.6423,1.77127 -0.53598,1.74675 0.92964,-0.21449 0.91018,-1.21796 2.31554,-4.08704 3.12304,-6.37572 z m 486.16799,222.70969 c 0.50381,-4.88136 0.33614,-5.44603 -2.21221,-7.45057 -4.17478,-3.28388 -6.03068,-2.82247 -3.33156,0.82829 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.52415,7.24637 2.00931,5.94825 2.88333,-2.52022 z M 213,314.8835 l 0,-29.11649 -6.49289,0.41343 c -5.77822,0.36793 -6.8859,0.79351 -10.0635,3.8665 -9.58384,9.26833 -14.37128,32.45711 -8.88947,43.05775 2.9712,5.74567 12.75493,10.75276 21.19586,10.84757 L 213,344 l 0,-29.1165 z m 391.83062,15.57159 c 6.54007,-7.42992 7.36966,-17.09995 1.90725,-22.23162 -2.91852,-2.74181 -8.90682,-5.23426 -12.45575,-5.18433 l -2.78212,0.0391 3.04958,1.32832 c 6.50902,2.83515 11.35366,11.9652 10.04645,18.93322 -0.36451,1.94301 -2.25178,5.8428 -4.19394,8.66619 -4.3486,6.32176 -1.67802,5.38649 4.42853,-1.55092 z M 566.16013,289.3996 c -2.95075,-2.06678 -14.21176,-4.01353 -16.73694,-2.8934 -1.37879,0.61161 0.22914,1.04804 5.68031,1.54177 4.18192,0.37877 8.45692,1.18425 9.5,1.78995 2.92573,1.69892 4.12561,1.36107 1.55663,-0.43832 z M 213,283 c 0,-0.55 -0.19844,-1 -0.44098,-1 -0.24254,0 -0.7191,0.45 -1.05902,1 -0.33992,0.55 -0.14148,1 0.44098,1 0.58246,0 1.05902,-0.45 1.05902,-1 z"
+       id="path3512"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#a47b34"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.00694,707.47646 78.044244,666.1067 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 c 3.687843,-18.66175 10.889399,-38.04115 18.476314,-49.71979 2.422585,-3.72912 4.97091,-7.85434 5.662946,-9.16718 2.905449,-5.5118 13.711766,-18.46479 22.312546,-26.74494 C 140.40722,111.13193 163.14421,98.992468 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.609388 C 556.4008,88.140817 571.0156,90.88227 587,96.458287 c 15.86403,5.534023 19.63372,7.528723 39.5,20.901033 6.93248,4.66636 8.12195,5.70522 21.91562,19.14068 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 42.47405,-35.25083 c 45.70106,-23.72981 77.55927,-50.16108 98.83683,-82.00031 30.76046,-46.0292 35.76241,-100.90233 13.86992,-152.15769 C 598.2249,426.45014 570.34549,393.14309 522.5232,354.56665 509.49217,344.055 496.89396,332.20558 492.43264,326.26454 c -1.5548,-2.0705 -3.11221,-3.98954 -3.4609,-4.26454 -1.97342,-1.55637 -7.92346,-15.76545 -8.48551,-20.26395 -2.41291,-19.31227 21.87824,-44.07781 73.26377,-74.69456 6.7375,-4.01436 12.25,-7.43862 12.25,-7.60945 0,-0.4504 -63.10145,-104.1329 -66.44848,-109.18204 -1.54951,-2.3375 -2.9981,-4.25 -3.21909,-4.25 -1.19909,0 -18.13103,10.15366 -26.33243,15.79091 -12.17384,8.3677 -22.66913,16.78932 -36.75932,29.49639 -31.86089,28.73335 -54.77986,61.47399 -67.84818,96.92377 -6.63783,18.00611 -8.82091,30.7668 -8.85998,51.78893 -0.0433,23.29416 2.27301,35.93762 10.16767,55.5 14.40066,35.68377 37.16724,63.80293 76.91642,95 41.05805,32.22433 60.77967,58.51658 59.14723,78.85324 -1.59083,19.81843 -20.8717,39.15143 -58.94449,59.10385 l -12.68065,6.64542 3.80187,8.19875 C 460.60214,658.64048 483.80111,707 484.68681,707 c 0.35415,0 8.01116,-3.82537 17.01558,-8.50083 z M 229.5,691.94922 c 31.90362,-2.37601 56.94592,-12.48027 78.84626,-31.8135 24.05069,-21.23152 41.19138,-50.309 49.16793,-83.4085 5.52115,-22.9106 5.75384,-26.46391 6.20326,-94.72722 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.79397,-15.39044 -0.80725,-44.22655 1.99621,-58.33768 4.69916,-23.6531 16.17094,-51.62665 30.49853,-74.36959 5.47111,-8.68458 6.53263,-11.08138 6.53263,-14.75 0,-3.50497 -0.34974,-4.38051 -1.75,-4.38089 -0.9625,-2.6e-4 -27.04094,-2.92526 -57.95209,-6.5 C 273.38677,160.92478 247.84927,158 247.54791,158 c -0.30135,0 -0.55056,84.2625 -0.55381,187.25 -0.006,203.38879 0.12121,198.42772 -5.48724,213.328 -4.53025,12.03578 -10.62939,19.90506 -17.72474,22.86895 -4.69128,1.95966 -14.00555,2.00599 -17.71432,0.0881 -11.66958,-6.03457 -18.99436,-39.81173 -19.05233,-87.85702 L 187,480.85609 l -5.25,0.58824 c -2.8875,0.32354 -23.7,1.96751 -46.25,3.65327 -58.042902,4.33909 -58.291278,4.36034 -58.977817,5.04688 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.33075 15,-0.90421 z m 137.26144,-6.96767 c 18.52094,-16.97107 38.97979,-16.12206 36.98958,1.53502 L 403.24567,691 l 17.90285,0 17.90284,0 -1.3744,-2.75 c -0.75592,-1.5125 -11.90097,-25.20525 -24.76677,-52.65057 -22.26683,-47.49956 -23.43494,-49.73694 -24.27716,-46.5 -2.50671,9.63419 -9.88182,30.41156 -13.45314,37.90057 -10.574,22.17351 -24.31231,40.55754 -42.78269,57.25 l -7.46894,6.75 17.63255,0 17.63255,0 6.56808,-6.01845 z M 393,686.95455 C 393,682.3312 389.57413,678 385.91718,678 c -3.03891,0 -11.74958,5.1813 -15.86335,9.43587 L 366.60767,691 l 13.19616,0 13.19617,0 0,-4.04545 z m 6.39301,2.46366 c 1.47442,-3.84226 0.60573,-8.27404 -2.02787,-10.34563 -4.00151,-3.14759 -5.89374,-2.70657 -3.32051,0.77391 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.08082 c 5.27282,-3.11444 12.55376,-8.05767 16.17986,-10.98496 8.06535,-6.51099 22.68727,-21.55516 26.55726,-27.32416 7.39718,-11.02701 14.69242,-24.10964 16.18695,-29.02827 0.58492,-1.925 2.43585,-7.54701 4.11318,-12.49335 1.67733,-4.94634 3.06572,-10.34634 3.08531,-12 0.0196,-1.65366 0.68756,-5.70665 1.48438,-9.00665 1.23426,-5.11165 1.44623,-29.61526 1.43166,-165.5 -0.01,-92.24026 -0.40711,-162.24099 -0.94197,-166 -2.38319,-16.74917 -4.09703,-24.35244 -7.88929,-35 -4.61951,-12.97023 -5.08087,-13.97312 -10.5806,-23 -7.3243,-12.0216 -14.14273,-20.44297 -24.568,-30.34367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.1631 -2.25,0.0219 0,0.185 15.37953,25.6601 34.17673,56.61133 18.79721,30.95123 35.01717,57.69597 36.04436,59.43274 l 1.86763,3.15777 -16.74666,9.24178 c -42.57707,23.49648 -69.91479,42.48425 -78.56657,54.56942 -2.79906,3.90984 -2.87618,4.27787 -1.46729,7.00236 0.81787,1.58159 2.51046,3.77456 3.76132,4.87326 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13103,-1.94653 5.16621,-12.98661 9.89249,-17.34315 6.67438,-6.15223 13.49715,-9.00943 21.54214,-9.02129 12.16318,-0.0179 19.87392,4.29665 24.60741,13.76919 l 2.90173,5.80688 3.9333,-1.7667 c 7.43151,-3.33797 17.44286,-1.90849 23.89789,3.41229 4.76156,3.92489 6.73321,8.01641 6.6878,13.87845 -0.13885,17.92464 -23.34025,32.94331 -38.9563,25.2171 l -4.0552,-2.00635 -3.01125,3.01126 c -2.5218,2.5218 -3.26043,2.80446 -4.54424,1.739 -1.33855,-1.1109 -0.94132,-1.94334 3.13199,-6.56339 l 4.66496,-5.29113 1.82446,2.31943 c 2.18369,2.77611 7.99346,4.88173 11.22895,4.06968 3.31777,-0.83271 13.29367,-11.96606 14.43907,-16.11436 1.78803,-6.4757 -1.64559,-13.74082 -8.07518,-17.08613 -3.1061,-1.61612 -11.38272,-1.88864 -12.29966,-0.405 -1.13241,1.83228 -2.45905,1.03376 -3.86235,-2.32479 -0.76405,-1.82864 -3.11833,-4.7501 -5.23173,-6.49215 -5.88179,-4.84827 -12.33639,-6.6605 -23.76576,-6.67261 l -9.85983,-0.0104 -4.25082,4.69284 c -2.33795,2.58106 -5.27369,7.21301 -6.52386,10.29324 l -2.27304,5.6004 2.3837,2.58311 c 1.31103,1.42071 8.00869,7.11153 14.88369,12.64626 41.26642,33.22165 69.03822,62.92113 88.53855,94.68415 3.2078,5.225 5.94375,9.65735 6.0799,9.84966 0.13615,0.19232 1.83153,-0.17309 3.76752,-0.81203 C 650.99292,426.20699 660,430.77049 660,440.48189 c 0,6.28106 -7.07017,24.21081 -9.06162,22.98003 -0.40648,-0.25122 0.57941,3.92958 2.19087,9.29066 4.67877,15.56564 6.9503,30.08329 7.54912,48.24742 1.78503,54.14552 -17.96959,101.87132 -60.51319,146.19569 -5.17572,5.39237 -9.05685,9.80431 -8.62473,9.80431 0.43212,0 5.0998,-2.54818 10.37261,-5.66261 z m 49.12093,-72.79643 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.62589,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 414.39463,565.58519 c 29.62442,-14.3255 43.53276,-23.7208 51.72656,-34.94209 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.44222,-13.45479 -20.64938,-17.20807 l -7.64938,-6.82414 -0.51222,49.24025 c -0.43141,41.47196 -0.80713,51.09395 -2.38155,60.99024 -1.02813,6.4625 -1.55001,11.75 -1.15974,11.75 0.39027,0 10.40138,-4.68667 22.2469,-10.41481 z m -7.36064,-53.04423 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.62589,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.45305,4.02346 -2.52865,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z m 235.32481,-60.094 c 0.0135,-6.44912 -0.27318,-7.58395 -2.47145,-9.78222 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.06999,10.72737 c 3.02733,6.40538 5.36993,10.25586 5.81444,9.55708 0.40944,-0.64366 0.75133,-4.45324 0.75975,-8.46574 z M 155.75,449.85025 213,445.62615 213,396.81307 213,348 l -4.52498,0 c -5.63708,0 -14.24114,-2.95709 -18.86439,-6.48342 -12.31922,-9.39632 -10.49002,-37.84339 3.40252,-52.91502 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93116,278 213,275.05833 213,199.36408 l 0,-78.63593 4.25,0.5736 c 2.3375,0.31548 43.33565,4.91578 91.10699,10.22288 l 86.85699,9.64928 10.64301,-10.37949 c 5.85366,-5.70872 12.85961,-12.28671 15.56879,-14.61776 l 4.92578,-4.23826 -105.42578,0.29361 c -105.2142,0.29302 -105.4457,0.29812 -115.3522,2.54445 -5.45952,1.23796 -11.98452,2.88615 -14.5,3.66264 -7.42418,2.29175 -23.55245,9.20684 -27.95414,11.9855 -2.24383,1.41647 -4.35566,2.5754 -4.69294,2.5754 -0.33728,0 -4.73373,3.10008 -9.76987,6.88907 -11.09889,8.35035 -26.71099,24.32474 -32.15962,32.90591 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990649,9.19837 -2.068488,13.03387 -2.451641,120.80297 l -0.395717,111.30297 3.290813,-0.51579 c 1.809947,-0.28369 29.053313,-2.41664 60.540813,-4.7399 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.625887,-6.24241 c 1.81276,-4.44289 -0.11317,-5.24371 -2.64074,-1.09805 -2.453054,4.02346 -2.528655,5.04439 -0.34232,4.62282 0.92225,-0.17782 2.26462,-1.76397 2.98306,-3.52477 z M 135.4214,244.16674 c -13.52736,-6.353 -13.31388,-23.47221 0.5108,-40.96175 9.18175,-11.61578 23.37494,-13.18389 33.81096,-3.73555 l 4.75684,4.30665 0,7.36195 c 0,8.84961 -2.98361,15.84682 -10.16103,23.82984 -8.88984,9.88764 -19.95565,13.40774 -28.91757,9.19886 z m 15.84829,-3.07918 c 3.49003,-1.3269 10.6645,-15.94375 11.41253,-23.25124 1.17685,-11.49654 -5.44873,-18.73473 -16.00472,-17.48453 -6.32812,0.74947 -9.57428,3.71955 -14.22441,13.0146 C 129.59175,219.08587 129,221.3681 129,226.68402 c 0,3.76617 0.62368,7.62137 1.51035,9.336 3.12379,6.04074 12.30487,8.28193 20.75934,5.06754 z m 18.26214,-21.17777 c 3.31596,-9.39844 1.11427,-16.95172 -5.91327,-20.2865 -5.06722,-2.40456 -6.56017,-1.94921 -2.94705,0.89885 4.53907,3.57794 6.73037,9.98136 6.06741,17.73014 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -0.6423,1.77127 -0.53598,1.74675 0.92964,-0.21449 0.91018,-1.21796 2.31554,-4.08704 3.12304,-6.37572 z m 486.16799,222.70969 c 0.50381,-4.88136 0.33614,-5.44603 -2.21221,-7.45057 -4.17478,-3.28388 -6.03068,-2.82247 -3.33156,0.82829 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.52415,7.24637 2.00931,5.94825 2.88333,-2.52022 z M 213,314.8835 l 0,-29.11649 -6.49289,0.41343 c -5.77822,0.36793 -6.8859,0.79351 -10.0635,3.8665 -9.58384,9.26833 -14.37128,32.45711 -8.88947,43.05775 2.9712,5.74567 12.75493,10.75276 21.19586,10.84757 L 213,344 l 0,-29.1165 z m 391.83062,15.57159 c 6.54007,-7.42992 7.36966,-17.09995 1.90725,-22.23162 -2.91852,-2.74181 -8.90682,-5.23426 -12.45575,-5.18433 l -2.78212,0.0391 3.04958,1.32832 c 6.50902,2.83515 11.35366,11.9652 10.04645,18.93322 -0.36451,1.94301 -2.25178,5.8428 -4.19394,8.66619 -4.3486,6.32176 -1.67802,5.38649 4.42853,-1.55092 z M 566.16013,289.3996 c -2.95075,-2.06678 -14.21176,-4.01353 -16.73694,-2.8934 -1.37879,0.61161 0.22914,1.04804 5.68031,1.54177 4.18192,0.37877 8.45692,1.18425 9.5,1.78995 2.92573,1.69892 4.12561,1.36107 1.55663,-0.43832 z M 213,283 c 0,-0.55 -0.19844,-1 -0.44098,-1 -0.24254,0 -0.7191,0.45 -1.05902,1 -0.33992,0.55 -0.14148,1 0.44098,1 0.58246,0 1.05902,-0.45 1.05902,-1 z"
+       id="path3510"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#9c8135"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.00694,707.47646 78.044244,666.1067 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 c 3.687843,-18.66175 10.889399,-38.04115 18.476314,-49.71979 2.422585,-3.72912 4.97091,-7.85434 5.662946,-9.16718 2.905449,-5.5118 13.711766,-18.46479 22.312546,-26.74494 C 140.40722,111.13193 163.14421,98.992468 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.609388 C 556.4008,88.140817 571.0156,90.88227 587,96.458287 c 15.86403,5.534023 19.63372,7.528723 39.5,20.901033 6.93248,4.66636 8.12195,5.70522 21.91562,19.14068 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 42.47405,-35.25083 c 45.70106,-23.72981 77.55927,-50.16108 98.83683,-82.00031 30.76046,-46.0292 35.76241,-100.90233 13.86992,-152.15769 C 598.2249,426.45014 570.34549,393.14309 522.5232,354.56665 509.49217,344.055 496.89396,332.20558 492.43264,326.26454 c -1.5548,-2.0705 -3.11221,-3.98954 -3.4609,-4.26454 -1.97342,-1.55637 -7.92346,-15.76545 -8.48551,-20.26395 -2.41291,-19.31227 21.87824,-44.07781 73.26377,-74.69456 6.7375,-4.01436 12.25,-7.43862 12.25,-7.60945 0,-0.4504 -63.10145,-104.1329 -66.44848,-109.18204 -1.54951,-2.3375 -2.9981,-4.25 -3.21909,-4.25 -1.19909,0 -18.13103,10.15366 -26.33243,15.79091 -12.17384,8.3677 -22.66913,16.78932 -36.75932,29.49639 -31.86089,28.73335 -54.77986,61.47399 -67.84818,96.92377 -6.63783,18.00611 -8.82091,30.7668 -8.85998,51.78893 -0.0433,23.29416 2.27301,35.93762 10.16767,55.5 14.40066,35.68377 37.16724,63.80293 76.91642,95 41.05805,32.22433 60.77967,58.51658 59.14723,78.85324 -1.59083,19.81843 -20.8717,39.15143 -58.94449,59.10385 l -12.68065,6.64542 3.80187,8.19875 C 460.60214,658.64048 483.80111,707 484.68681,707 c 0.35415,0 8.01116,-3.82537 17.01558,-8.50083 z M 229.5,691.94922 c 31.90362,-2.37601 56.94592,-12.48027 78.84626,-31.8135 24.05069,-21.23152 41.19138,-50.309 49.16793,-83.4085 5.52115,-22.9106 5.75384,-26.46391 6.20326,-94.72722 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.79397,-15.39044 -0.80725,-44.22655 1.99621,-58.33768 4.69916,-23.6531 16.17094,-51.62665 30.49853,-74.36959 5.47111,-8.68458 6.53263,-11.08138 6.53263,-14.75 0,-3.50497 -0.34974,-4.38051 -1.75,-4.38089 -0.9625,-2.6e-4 -27.04094,-2.92526 -57.95209,-6.5 C 273.38677,160.92478 247.84927,158 247.54791,158 c -0.30135,0 -0.55056,84.2625 -0.55381,187.25 -0.006,203.38879 0.12121,198.42772 -5.48724,213.328 -4.53025,12.03578 -10.62939,19.90506 -17.72474,22.86895 -4.69128,1.95966 -14.00555,2.00599 -17.71432,0.0881 -11.66958,-6.03457 -18.99436,-39.81173 -19.05233,-87.85702 L 187,480.85609 l -5.25,0.58824 c -2.8875,0.32354 -23.7,1.96751 -46.25,3.65327 -58.042902,4.33909 -58.291278,4.36034 -58.977817,5.04688 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.33075 15,-0.90421 z m 137.26144,-6.96767 c 18.52094,-16.97107 38.97979,-16.12206 36.98958,1.53502 L 403.24567,691 l 17.90285,0 17.90284,0 -1.3744,-2.75 c -0.75592,-1.5125 -11.90097,-25.20525 -24.76677,-52.65057 -22.26683,-47.49956 -23.43494,-49.73694 -24.27716,-46.5 -2.50671,9.63419 -9.88182,30.41156 -13.45314,37.90057 -10.574,22.17351 -24.31231,40.55754 -42.78269,57.25 l -7.46894,6.75 17.63255,0 17.63255,0 6.56808,-6.01845 z m 26.55552,2.26845 c -0.75223,-5.06171 -2.79744,-8.0815 -6.02134,-8.89065 -3.40603,-0.85486 -11.78715,3.51151 -17.01324,8.86351 L 366.5941,691 l 13.64008,0 13.64008,0 -0.5573,-3.75 z m 6.07605,2.16821 c 1.47442,-3.84226 0.60573,-8.27404 -2.02787,-10.34563 -4.00151,-3.14759 -5.89374,-2.70657 -3.32051,0.77391 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.08082 c 5.27282,-3.11444 12.55376,-8.05767 16.17986,-10.98496 8.06535,-6.51099 22.68727,-21.55516 26.55726,-27.32416 7.39718,-11.02701 14.69242,-24.10964 16.18695,-29.02827 0.58492,-1.925 2.43585,-7.54701 4.11318,-12.49335 1.67733,-4.94634 3.06572,-10.34634 3.08531,-12 0.0196,-1.65366 0.68756,-5.70665 1.48438,-9.00665 1.23426,-5.11165 1.44623,-29.61526 1.43166,-165.5 -0.01,-92.24026 -0.40711,-162.24099 -0.94197,-166 -2.38319,-16.74917 -4.09703,-24.35244 -7.88929,-35 -4.61951,-12.97023 -5.08087,-13.97312 -10.5806,-23 -7.3243,-12.0216 -14.14273,-20.44297 -24.568,-30.34367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.1631 -2.25,0.0219 0,0.185 15.37953,25.6601 34.17673,56.61133 18.79721,30.95123 35.01717,57.69597 36.04436,59.43274 l 1.86763,3.15777 -16.74666,9.24178 c -42.57707,23.49648 -69.91479,42.48425 -78.56657,54.56942 -2.79906,3.90984 -2.87618,4.27787 -1.46729,7.00236 0.81787,1.58159 2.51046,3.77456 3.76132,4.87326 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13103,-1.94653 5.16621,-12.98661 9.89249,-17.34315 6.67438,-6.15223 13.49715,-9.00943 21.54214,-9.02129 12.16318,-0.0179 19.87392,4.29665 24.60741,13.76919 l 2.90173,5.80688 3.9333,-1.7667 c 7.43151,-3.33797 17.44286,-1.90849 23.89789,3.41229 4.76156,3.92489 6.73321,8.01641 6.6878,13.87845 -0.13885,17.92464 -23.34025,32.94331 -38.9563,25.2171 l -4.0552,-2.00635 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.57963,2.41637 6.88406,4.20528 10.11864,4.20528 3.04568,0 13.88989,-11.3303 15.49056,-16.18491 2.18095,-6.61453 -1.40371,-14.00528 -8.58141,-17.6929 -2.7091,-1.39184 -10.97821,-1.47735 -11.81574,-0.1222 -1.1258,1.82158 -2.31407,1.0432 -4.16764,-2.73008 -2.14729,-4.37117 -8.81962,-9.72003 -14.10762,-11.30933 -2.04861,-0.6157 -8.04779,-1.36578 -13.33151,-1.66683 l -9.60676,-0.54736 -4.10695,3.71038 C 530.47342,296.80501 524,307.61242 524,310.45151 c 0,1.59782 6.77587,7.87073 19,17.58969 38.1161,30.30471 67.3569,61.71486 86.53855,92.9588 3.2078,5.225 5.94375,9.65735 6.0799,9.84966 0.13615,0.19232 1.83153,-0.17309 3.76752,-0.81203 C 650.99292,426.20699 660,430.77049 660,440.48189 c 0,6.28106 -7.07017,24.21081 -9.06162,22.98003 -0.40648,-0.25122 0.57941,3.92958 2.19087,9.29066 4.67877,15.56564 6.9503,30.08329 7.54912,48.24742 1.78503,54.14552 -17.96959,101.87132 -60.51319,146.19569 -5.17572,5.39237 -9.05685,9.80431 -8.62473,9.80431 0.43212,0 5.0998,-2.54818 10.37261,-5.66261 z m 49.12093,-72.79643 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39463,565.58519 c 29.62442,-14.3255 43.53276,-23.7208 51.72656,-34.94209 2.70374,-3.70274 2.75757,-3.9975 1.34667,-7.37426 -4.29904,-10.28905 -20.23389,-27.05806 -42.96786,-45.21712 -7.15,-5.71116 -16.44222,-13.45479 -20.64938,-17.20807 l -7.64938,-6.82414 -0.51222,49.24025 c -0.43141,41.47196 -0.80713,51.09395 -2.38155,60.99024 -1.02813,6.4625 -1.55001,11.75 -1.15974,11.75 0.39027,0 10.40138,-4.68667 22.2469,-10.41481 z m -7.36064,-53.04423 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 649.08154,450 c 0.48201,-8.41152 -0.0116,-11.02096 -2.5683,-13.57767 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.07974,10.75465 c 2.79386,5.91506 5.37758,10.44074 5.74159,10.05708 0.36401,-0.38366 0.77788,-2.72257 0.9197,-5.19757 z M 155.75,449.85025 213,445.62615 213,396.81307 213,348 l -4.52498,0 c -5.63708,0 -14.24114,-2.95709 -18.86439,-6.48342 -12.31922,-9.39632 -10.49002,-37.84339 3.40252,-52.91502 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93116,278 213,275.05833 213,199.36408 l 0,-78.63593 4.25,0.5736 c 2.3375,0.31548 43.33565,4.91578 91.10699,10.22288 l 86.85699,9.64928 10.64301,-10.37949 c 5.85366,-5.70872 12.85961,-12.28671 15.56879,-14.61776 l 4.92578,-4.23826 -105.42578,0.29361 c -105.2142,0.29302 -105.4457,0.29812 -115.3522,2.54445 -5.45952,1.23796 -11.98452,2.88615 -14.5,3.66264 -7.42418,2.29175 -23.55245,9.20684 -27.95414,11.9855 -2.24383,1.41647 -4.35566,2.5754 -4.69294,2.5754 -0.33728,0 -4.73373,3.10008 -9.76987,6.88907 -11.09889,8.35035 -26.71099,24.32474 -32.15962,32.90591 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990649,9.19837 -2.068488,13.03387 -2.451641,120.80297 l -0.395717,111.30297 3.290813,-0.51579 c 1.809947,-0.28369 29.053313,-2.41664 60.540813,-4.7399 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.52736,-6.353 -13.31388,-23.47221 0.5108,-40.96175 9.18175,-11.61578 23.37494,-13.18389 33.81096,-3.73555 l 4.75684,4.30665 0,7.36195 c 0,8.84961 -2.98361,15.84682 -10.16103,23.82984 -8.88984,9.88764 -19.95565,13.40774 -28.91757,9.19886 z m 15.657,-2.96362 c 3.66665,-1.45496 10.83405,-15.84677 11.59512,-23.28245 1.19574,-11.68253 -5.30332,-18.83527 -15.96645,-17.57238 -5.45664,0.64626 -7.56131,2.11866 -11.65214,8.15171 -6.11078,9.01201 -8.10066,20.69878 -4.65316,27.32858 3.20153,6.15679 12.56901,8.59171 20.67663,5.37454 z m 18.45343,-21.29333 c 3.31596,-9.39844 1.11427,-16.95172 -5.91327,-20.2865 -5.06722,-2.40456 -6.56017,-1.94921 -2.94705,0.89885 4.53907,3.57794 6.73037,9.98136 6.06741,17.73014 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -0.6423,1.77127 -0.53598,1.74675 0.92964,-0.21449 0.91018,-1.21796 2.31554,-4.08704 3.12304,-6.37572 z m 486.16799,222.70969 c 0.50381,-4.88136 0.33614,-5.44603 -2.21221,-7.45057 -4.17478,-3.28388 -6.03068,-2.82247 -3.33156,0.82829 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.52415,7.24637 2.00931,5.94825 2.88333,-2.52022 z M 213,315 l 0,-29 -5.99712,0 c -5.48334,0 -6.33922,0.30907 -9.99031,3.60761 -10.05685,9.08575 -15.16693,32.45807 -9.49476,43.42682 3.10147,5.99759 12.37798,10.75931 21.23219,10.89867 L 213,344 l 0,-29 z m 391.83062,15.45509 c 6.54007,-7.42992 7.36966,-17.09995 1.90725,-22.23162 -2.91852,-2.74181 -8.90682,-5.23426 -12.45575,-5.18433 l -2.78212,0.0391 3.04958,1.32832 c 6.50902,2.83515 11.35366,11.9652 10.04645,18.93322 -0.36451,1.94301 -2.25178,5.8428 -4.19394,8.66619 -4.3486,6.32176 -1.67802,5.38649 4.42853,-1.55092 z M 566.16013,289.3996 c -2.95075,-2.06678 -14.21176,-4.01353 -16.73694,-2.8934 -1.37879,0.61161 0.22914,1.04804 5.68031,1.54177 4.18192,0.37877 8.45692,1.18425 9.5,1.78995 2.92573,1.69892 4.12561,1.36107 1.55663,-0.43832 z M 213,283 c 0,-0.55 -0.19844,-1 -0.44098,-1 -0.24254,0 -0.7191,0.45 -1.05902,1 -0.33992,0.55 -0.14148,1 0.44098,1 0.58246,0 1.05902,-0.45 1.05902,-1 z"
+       id="path3508"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#6b7173"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.00694,707.47646 78.044244,666.1067 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 c 3.687843,-18.66175 10.889399,-38.04115 18.476314,-49.71979 2.422585,-3.72912 4.97091,-7.85434 5.662946,-9.16718 2.905449,-5.5118 13.711766,-18.46479 22.312546,-26.74494 C 140.40722,111.13193 163.14421,98.992468 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.609388 C 556.4008,88.140817 571.0156,90.88227 587,96.458287 c 15.86403,5.534023 19.63372,7.528723 39.5,20.901033 6.93248,4.66636 8.12195,5.70522 21.91562,19.14068 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 42.47405,-35.25083 c 45.70106,-23.72981 77.55927,-50.16108 98.83683,-82.00031 C 629.33157,573.41468 635.70352,521.10228 618.01818,473 603.12987,432.50534 573.27203,395.4737 522.5232,354.5609 c -13.02315,-10.49904 -25.62449,-22.34901 -30.09056,-28.29636 -1.5548,-2.0705 -3.11221,-3.98954 -3.4609,-4.26454 -1.97342,-1.55637 -7.92346,-15.76545 -8.48551,-20.26395 -2.40655,-19.26133 21.99703,-44.14102 73.26377,-74.6931 6.7375,-4.01517 12.25,-7.45163 12.25,-7.63657 0,-0.46832 -62.98156,-103.9322 -66.44675,-109.15638 -1.55046,-2.3375 -2.99983,-4.25 -3.22082,-4.25 -1.19909,0 -18.13103,10.15366 -26.33243,15.79091 -18.17815,12.49476 -42.92287,33.83028 -55.68145,48.00991 -29.48293,32.76675 -48.8583,68.17069 -55.49838,101.41025 -2.6728,13.37975 -3.21311,41.46169 -1.02531,53.28893 5.2846,28.56859 16.2769,51.99088 37.3101,79.5 9.98741,13.06244 33.25584,35.52638 46.39736,44.79321 0.55128,0.38873 6.17628,5.03317 12.5,10.32096 34.44788,28.80476 50.25731,51.60471 48.75551,70.31397 -1.64311,20.46975 -22.97683,41.06757 -63.78662,61.58634 l -7.87036,3.95713 3.32744,7.2642 C 452.61543,641.94054 483.82641,707 484.68681,707 c 0.35415,0 8.01116,-3.82537 17.01558,-8.50083 z M 229.5,691.9582 c 23.18949,-1.71216 41.54909,-7.16804 59.30383,-17.62318 33.60482,-19.78869 59.10912,-56.35023 69.08154,-99.03143 5.15259,-22.0527 5.38776,-25.8151 5.83208,-93.30359 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.79397,-15.39044 -0.80725,-44.22655 1.99621,-58.33768 4.69916,-23.6531 16.17094,-51.62665 30.49853,-74.36959 C 362.93848,181.44583 364,179.04903 364,175.38041 364,172.09312 363.61372,171 362.45209,171 c -0.85136,0 -26.83886,-2.92478 -57.75,-6.49952 -30.91115,-3.57474 -56.53959,-6.49974 -56.95209,-6.5 -0.4125,-2.6e-4 -0.75891,84.26202 -0.76981,187.24952 -0.0126,119.29265 -0.38246,189.79046 -1.01905,194.25 -0.54959,3.85 -1.67221,9.64936 -2.49472,12.88747 -3.62371,14.26604 -12.88177,27.29539 -20.96642,29.5071 -5.60904,1.53446 -13.086,1.37088 -16.4322,-0.35951 -6.4297,-3.32492 -12.63825,-17.63871 -15.56242,-35.8791 -1.79091,-11.1713 -3.49704,-36.98271 -3.50184,-52.97792 L 187,480.85609 l -5.25,0.58824 c -2.8875,0.32354 -23.7,1.96751 -46.25,3.65327 -58.042902,4.33909 -58.291278,4.36034 -58.977817,5.04688 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32672 15,-0.89523 z m 137.26144,-6.97665 c 18.52094,-16.97107 38.97979,-16.12206 36.98958,1.53502 L 403.24567,691 l 17.84441,0 17.84441,0 -4.31196,-9.25 c -2.37158,-5.0875 -13.4882,-28.78767 -24.70361,-52.66704 -19.57012,-41.66787 -20.4285,-43.27938 -21.30631,-40 -10.76455,40.21459 -28.63862,70.35081 -56.741,95.66704 l -6.93784,6.25 17.6298,0 17.62979,0 6.56808,-6.01845 z m 26.55552,2.26845 c -0.75223,-5.06171 -2.79744,-8.0815 -6.02134,-8.89065 -3.40603,-0.85486 -11.78715,3.51151 -17.01324,8.86351 L 366.5941,691 l 13.64008,0 13.64008,0 -0.5573,-3.75 z m 6.07605,2.16821 c 1.47442,-3.84226 0.60573,-8.27404 -2.02787,-10.34563 -4.00151,-3.14759 -5.89374,-2.70657 -3.32051,0.77391 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.07753 c 17.44815,-10.2999 30.28388,-22.09115 44.69877,-41.06147 1.1615,-1.52856 3.32172,-5.02921 4.80048,-7.77921 1.47876,-2.75 3.79192,-6.8 5.14035,-9 1.34844,-2.2 3.10849,-6.025 3.91123,-8.5 0.80274,-2.475 2.82676,-8.54701 4.49782,-13.49335 1.67106,-4.94634 3.05432,-10.34634 3.07391,-12 0.0196,-1.65366 0.68756,-5.70665 1.48438,-9.00665 1.23426,-5.11165 1.44623,-29.61526 1.43166,-165.5 -0.01,-92.24026 -0.40711,-162.24099 -0.94197,-166 -2.38319,-16.74917 -4.09703,-24.35244 -7.88929,-35 -4.61951,-12.97023 -5.08087,-13.97312 -10.5806,-23 -7.3243,-12.0216 -14.14273,-20.44297 -24.568,-30.34367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.16742 -2.25,0.0123 0,0.17972 16.03459,26.77982 35.63242,59.11133 19.59783,32.33151 35.80464,59.0901 36.01513,59.46355 0.21049,0.37344 -5.5866,3.93945 -12.88242,7.92446 -43.0406,23.50898 -73.71994,44.64203 -82.08374,56.54226 -2.71763,3.86672 -2.79156,4.24057 -1.37887,6.9724 0.821,1.58764 2.51614,3.78555 3.767,4.88425 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13103,-1.94653 5.16621,-12.98661 9.89249,-17.34315 6.67438,-6.15223 13.49715,-9.00943 21.54214,-9.02129 12.16318,-0.0179 19.87392,4.29665 24.60741,13.76919 l 2.90173,5.80688 3.9333,-1.7667 c 7.43151,-3.33797 17.44286,-1.90849 23.89789,3.41229 4.76156,3.92489 6.73321,8.01641 6.6878,13.87845 -0.13885,17.92464 -23.34025,32.94331 -38.9563,25.2171 l -4.0552,-2.00635 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.57963,2.41637 6.88406,4.20528 10.11864,4.20528 3.04568,0 13.88989,-11.3303 15.49056,-16.18491 2.18095,-6.61453 -1.40371,-14.00528 -8.58141,-17.6929 C 588.60664,304.73036 580.33753,304.64485 579.5,306 c -1.1258,1.82158 -2.31407,1.0432 -4.16764,-2.73008 -2.14729,-4.37117 -8.81962,-9.72003 -14.10762,-11.30933 -2.04861,-0.6157 -8.04779,-1.36578 -13.33151,-1.66683 l -9.60676,-0.54736 -4.10695,3.71038 C 530.47342,296.80501 524,307.61242 524,310.45151 c 0,1.59782 6.77587,7.87073 19,17.58969 38.1161,30.30471 67.3569,61.71486 86.53855,92.9588 3.2078,5.225 5.94375,9.65735 6.0799,9.84966 0.13615,0.19232 1.83153,-0.17309 3.76752,-0.81203 C 650.99292,426.20699 660,430.77049 660,440.48189 c 0,6.80601 -7.10913,24.18673 -9.33123,22.8134 -0.63544,-0.39272 -0.72492,0.0848 -0.24183,1.29067 8.10693,20.23575 12.34462,55.75696 9.65307,80.91404 -4.82605,45.10746 -23.71909,83.57962 -59.55076,121.26407 -5.35297,5.62976 -9.38853,10.23593 -8.9679,10.23593 0.42063,0 5.0789,-2.54669 10.35171,-5.65932 z m 49.12093,-72.79972 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39463,565.58519 c 11.84553,-5.72815 25.44972,-12.96504 30.23154,-16.08199 9.44225,-6.15477 19.25057,-14.94966 22.45546,-20.13528 1.92768,-3.11906 1.94351,-3.42125 0.34392,-6.56869 -5.81961,-11.45101 -21.18382,-27.4807 -42.92555,-44.78481 -7.15,-5.69064 -16.44222,-13.41749 -20.64938,-17.17077 l -7.64938,-6.82414 -0.51222,49.24025 c -0.43141,41.47196 -0.80713,51.09395 -2.38155,60.99024 -1.02813,6.4625 -1.55001,11.75 -1.15974,11.75 0.39027,0 10.40138,-4.68667 22.2469,-10.41481 z m -7.36064,-53.04423 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 649.08154,450 c 0.48201,-8.41152 -0.0116,-11.02096 -2.5683,-13.57767 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.07974,10.75465 c 2.79386,5.91506 5.37758,10.44074 5.74159,10.05708 0.36401,-0.38366 0.77788,-2.72257 0.9197,-5.19757 z m -494.36863,-0.0272 c 29.2671,-2.18503 54.3546,-3.9728 55.75,-3.9728 l 2.53709,0 0,-49 0,-49 -4.52498,0 c -5.63708,0 -14.24114,-2.95709 -18.86439,-6.48342 -12.31922,-9.39632 -10.49002,-37.84339 3.40252,-52.91502 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93115,278 213,275.05898 213,199.38646 l 0,-78.61355 4.25,0.59799 c 2.3375,0.32889 43.3354,4.91936 91.10643,10.20104 l 86.85644,9.60307 10.64356,-10.38004 c 5.85397,-5.70902 12.86222,-12.28906 15.5739,-14.62231 l 4.93033,-4.24227 -105.93033,0.34208 -105.93033,0.34208 -11,2.59329 c -6.05,1.42631 -12.8,3.25107 -15,4.05503 -9.16157,3.34798 -20.35058,8.1976 -25.5,11.0524 -15.37298,8.52267 -38.15711,29.33559 -46.50299,42.47971 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990639,9.19833 -2.06849,13.03397 -2.451627,120.78985 l -0.395702,111.28986 4.790799,-0.56704 c 2.634939,-0.31186 28.736608,-2.3548 58.003708,-4.53985 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.52736,-6.353 -13.31388,-23.47221 0.5108,-40.96175 9.18175,-11.61578 23.37494,-13.18389 33.81096,-3.73555 l 4.75684,4.30665 0,7.36195 c 0,8.84961 -2.98361,15.84682 -10.16103,23.82984 -8.88984,9.88764 -19.95565,13.40774 -28.91757,9.19886 z m 15.657,-2.96362 c 3.66665,-1.45496 10.83405,-15.84677 11.59512,-23.28245 1.19574,-11.68253 -5.30332,-18.83527 -15.96645,-17.57238 -5.45664,0.64626 -7.56131,2.11866 -11.65214,8.15171 -6.11078,9.01201 -8.10066,20.69878 -4.65316,27.32858 3.20153,6.15679 12.56901,8.59171 20.67663,5.37454 z m 18.45343,-21.29333 c 3.31596,-9.39844 1.11427,-16.95172 -5.91327,-20.2865 -5.06722,-2.40456 -6.56017,-1.94921 -2.94705,0.89885 4.53907,3.57794 6.73037,9.98136 6.06741,17.73014 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -0.6423,1.77127 -0.53598,1.74675 0.92964,-0.21449 0.91018,-1.21796 2.31554,-4.08704 3.12304,-6.37572 z m 486.16799,222.70969 c 0.50381,-4.88136 0.33614,-5.44603 -2.21221,-7.45057 -4.17478,-3.28388 -6.03068,-2.82247 -3.33156,0.82829 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.52415,7.24637 2.00931,5.94825 2.88333,-2.52022 z M 213,315 l 0,-29 -5.99712,0 c -5.48334,0 -6.33922,0.30907 -9.99031,3.60761 -10.05685,9.08575 -15.16693,32.45807 -9.49476,43.42682 3.10147,5.99759 12.37798,10.75931 21.23219,10.89867 L 213,344 l 0,-29 z m 391.83062,15.45509 c 6.54007,-7.42992 7.36966,-17.09995 1.90725,-22.23162 -2.91852,-2.74181 -8.90682,-5.23426 -12.45575,-5.18433 l -2.78212,0.0391 3.04958,1.32832 c 6.50902,2.83515 11.35366,11.9652 10.04645,18.93322 -0.36451,1.94301 -2.25178,5.8428 -4.19394,8.66619 -4.3486,6.32176 -1.67802,5.38649 4.42853,-1.55092 z M 566.16013,289.3996 c -2.95075,-2.06678 -14.21176,-4.01353 -16.73694,-2.8934 -1.37879,0.61161 0.22914,1.04804 5.68031,1.54177 4.18192,0.37877 8.45692,1.18425 9.5,1.78995 2.92573,1.69892 4.12561,1.36107 1.55663,-0.43832 z M 213,283 c 0,-0.55 -0.19844,-1 -0.44098,-1 -0.24254,0 -0.7191,0.45 -1.05902,1 -0.33992,0.55 -0.14148,1 0.44098,1 0.58246,0 1.05902,-0.45 1.05902,-1 z"
+       id="path3506"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#8a7d45"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.07239,707.49364 78.019759,666.03521 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 73.774871,199.98428 80.063669,183.6054 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 140.41309,111.1255 163.09172,99.004905 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.608954 c 34.37711,1.575455 58.69187,9.838585 88.28763,30.003671 6.95606,4.73952 8.18067,5.81183 21.91562,19.19009 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 42.47405,-35.25083 c 45.70106,-23.72981 77.55927,-50.16108 98.83683,-82.00031 C 629.33157,573.41468 635.70352,521.10228 618.01818,473 602.9898,432.12436 573.42975,395.64889 521,353.28488 c -11.00708,-8.89389 -24.28924,-21.6468 -30.59606,-29.37691 -3.82822,-4.69215 -9.24745,-16.80733 -9.91771,-22.17192 -2.40655,-19.26133 21.99703,-44.14102 73.26377,-74.6931 6.7375,-4.01517 12.25,-7.45163 12.25,-7.63657 0,-0.46832 -62.98156,-103.9322 -66.44675,-109.15638 -1.55046,-2.3375 -2.99983,-4.25 -3.22082,-4.25 -0.22099,0 -4.0987,2.08374 -8.61712,4.63054 -28.78486,16.22449 -62.24135,44.85979 -85.48687,73.16792 -12.97628,15.80238 -28.80433,42.65669 -34.89364,59.20154 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.42125,3.04745 -3.73396,12.00739 -5.67858,22 -2.16645,11.13256 -2.47545,40.51697 -0.5363,51 5.30888,28.69987 16.12755,51.69545 37.59708,79.91436 9.31533,12.24379 32.86768,34.9069 46.11038,44.36943 0.55128,0.39392 6.17628,5.04259 12.5,10.33038 34.44788,28.80476 50.25731,51.60471 48.75551,70.31397 -1.64311,20.46975 -22.97683,41.06757 -63.78662,61.58634 l -7.87036,3.95713 3.32744,7.2642 C 452.61543,641.94054 483.82641,707 484.68681,707 c 0.35415,0 8.01116,-3.82537 17.01558,-8.50083 z M 229.5,691.9582 c 23.18949,-1.71216 41.54909,-7.16804 59.30383,-17.62318 33.60482,-19.78869 59.10912,-56.35023 69.08154,-99.03143 5.15259,-22.0527 5.38776,-25.8151 5.83208,-93.30359 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.60438,-13.76399 -0.78809,-44.23477 1.49585,-55.83768 5.25749,-26.70911 15.64967,-52.47437 31.00464,-76.86959 C 362.93744,181.44897 364,179.04771 364,175.38041 364,172.09312 363.61372,171 362.45209,171 c -0.85136,0 -26.83886,-2.92478 -57.75,-6.49952 -30.91115,-3.57474 -56.53959,-6.49974 -56.95209,-6.5 -0.4125,-2.6e-4 -0.75891,84.26202 -0.76981,187.24952 -0.0126,119.29265 -0.38246,189.79046 -1.01905,194.25 -0.54959,3.85 -1.67221,9.64936 -2.49472,12.88747 -3.62371,14.26604 -12.88177,27.29539 -20.96642,29.5071 -5.60904,1.53446 -13.086,1.37088 -16.4322,-0.35951 -6.4297,-3.32492 -12.63825,-17.63871 -15.56242,-35.8791 -1.79091,-11.1713 -3.49704,-36.98271 -3.50184,-52.97792 L 187,480.85609 l -5.25,0.58824 c -2.8875,0.32354 -23.7,1.96751 -46.25,3.65327 -58.042902,4.33909 -58.291278,4.36034 -58.977817,5.04688 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32672 15,-0.89523 z m 137.26144,-6.97665 c 18.52094,-16.97107 38.97979,-16.12206 36.98958,1.53502 L 403.24567,691 l 17.84441,0 17.84441,0 -4.31196,-9.25 c -2.37158,-5.0875 -13.4882,-28.78767 -24.70361,-52.66704 -19.57012,-41.66787 -20.4285,-43.27938 -21.30631,-40 -10.76455,40.21459 -28.63862,70.35081 -56.741,95.66704 l -6.93784,6.25 17.6298,0 17.62979,0 6.56808,-6.01845 z m 26.55552,2.26845 c -0.75223,-5.06171 -2.79744,-8.0815 -6.02134,-8.89065 -3.40603,-0.85486 -11.78715,3.51151 -17.01324,8.86351 L 366.5941,691 l 13.64008,0 13.64008,0 -0.5573,-3.75 z m 6.07605,2.16821 c 1.47442,-3.84226 0.60573,-8.27404 -2.02787,-10.34563 -4.00151,-3.14759 -5.89374,-2.70657 -3.32051,0.77391 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.07753 c 17.44815,-10.2999 30.28388,-22.09115 44.69877,-41.06147 1.1615,-1.52856 3.32172,-5.02921 4.80048,-7.77921 1.47876,-2.75 3.79192,-6.8 5.14035,-9 1.34844,-2.2 3.10849,-6.025 3.91123,-8.5 0.80274,-2.475 2.82676,-8.54701 4.49782,-13.49335 1.67106,-4.94634 3.05432,-10.34634 3.07391,-12 0.0196,-1.65366 0.68756,-5.70665 1.48438,-9.00665 1.23426,-5.11165 1.44623,-29.61526 1.43166,-165.5 -0.01,-92.24026 -0.40711,-162.24099 -0.94197,-166 -2.38319,-16.74917 -4.09703,-24.35244 -7.88929,-35 -4.61951,-12.97023 -5.08087,-13.97312 -10.5806,-23 -7.3243,-12.0216 -14.14273,-20.44297 -24.568,-30.34367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.16742 -2.25,0.0123 0,0.17972 16.03459,26.77982 35.63242,59.11133 19.59783,32.33151 35.80464,59.0901 36.01513,59.46355 0.21049,0.37344 -5.5866,3.93945 -12.88242,7.92446 -43.0406,23.50898 -73.71994,44.64203 -82.08374,56.54226 -2.71763,3.86672 -2.79156,4.24057 -1.37887,6.9724 0.821,1.58764 2.51614,3.78555 3.767,4.88425 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13103,-1.94653 5.16621,-12.98661 9.89249,-17.34315 6.67438,-6.15223 13.49715,-9.00943 21.54214,-9.02129 12.16318,-0.0179 19.87392,4.29665 24.60741,13.76919 l 2.90173,5.80688 3.9333,-1.7667 c 7.43151,-3.33797 17.44286,-1.90849 23.89789,3.41229 4.76156,3.92489 6.73321,8.01641 6.6878,13.87845 -0.13885,17.92464 -23.34025,32.94331 -38.9563,25.2171 l -4.0552,-2.00635 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.57963,2.41637 6.88406,4.20528 10.11864,4.20528 3.04568,0 13.88989,-11.3303 15.49056,-16.18491 2.18095,-6.61453 -1.40371,-14.00528 -8.58141,-17.6929 C 588.60664,304.73036 580.33753,304.64485 579.5,306 c -1.1258,1.82158 -2.31407,1.0432 -4.16764,-2.73008 -2.14729,-4.37117 -8.81962,-9.72003 -14.10762,-11.30933 -2.04861,-0.6157 -8.04779,-1.36578 -13.33151,-1.66683 l -9.60676,-0.54736 -4.10695,3.71038 C 530.47342,296.80501 524,307.61242 524,310.45151 c 0,1.59782 6.77587,7.87073 19,17.58969 38.1161,30.30471 67.3569,61.71486 86.53855,92.9588 3.2078,5.225 5.94375,9.65735 6.0799,9.84966 0.13615,0.19232 1.83153,-0.17309 3.76752,-0.81203 C 650.99292,426.20699 660,430.77049 660,440.48189 c 0,6.80601 -7.10913,24.18673 -9.33123,22.8134 -0.63544,-0.39272 -0.72492,0.0848 -0.24183,1.29067 8.10693,20.23575 12.34462,55.75696 9.65307,80.91404 -4.82605,45.10746 -23.71909,83.57962 -59.55076,121.26407 -5.35297,5.62976 -9.38853,10.23593 -8.9679,10.23593 0.42063,0 5.0789,-2.54669 10.35171,-5.65932 z m 49.12093,-72.79972 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39463,565.58519 c 11.84553,-5.72815 25.44972,-12.96504 30.23154,-16.08199 9.44225,-6.15477 19.25057,-14.94966 22.45546,-20.13528 1.92768,-3.11906 1.94351,-3.42125 0.34392,-6.56869 -5.81961,-11.45101 -21.18382,-27.4807 -42.92555,-44.78481 -7.15,-5.69064 -16.44222,-13.41749 -20.64938,-17.17077 l -7.64938,-6.82414 -0.51222,49.24025 c -0.43141,41.47196 -0.80713,51.09395 -2.38155,60.99024 -1.02813,6.4625 -1.55001,11.75 -1.15974,11.75 0.39027,0 10.40138,-4.68667 22.2469,-10.41481 z m -7.36064,-53.04423 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 649.08154,450 c 0.48201,-8.41152 -0.0116,-11.02096 -2.5683,-13.57767 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.07974,10.75465 c 2.79386,5.91506 5.37758,10.44074 5.74159,10.05708 0.36401,-0.38366 0.77788,-2.72257 0.9197,-5.19757 z m -494.36863,-0.0272 c 29.2671,-2.18503 54.3546,-3.9728 55.75,-3.9728 l 2.53709,0 0,-49 0,-49 -4.52498,0 c -5.63708,0 -14.24114,-2.95709 -18.86439,-6.48342 -12.31922,-9.39632 -10.49002,-37.84339 3.40252,-52.91502 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93115,278 213,275.05898 213,199.38646 l 0,-78.61355 4.25,0.59799 c 2.3375,0.32889 43.3354,4.91936 91.10643,10.20104 l 86.85644,9.60307 10.64356,-10.38004 c 5.85397,-5.70902 12.86222,-12.28906 15.5739,-14.62231 l 4.93033,-4.24227 -105.93033,0.34208 -105.93033,0.34208 -11,2.59329 c -6.05,1.42631 -12.8,3.25107 -15,4.05503 -9.16157,3.34798 -20.35058,8.1976 -25.5,11.0524 -15.37298,8.52267 -38.15711,29.33559 -46.50299,42.47971 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990639,9.19833 -2.06849,13.03397 -2.451627,120.78985 l -0.395702,111.28986 4.790799,-0.56704 c 2.634939,-0.31186 28.736608,-2.3548 58.003708,-4.53985 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.52736,-6.353 -13.31388,-23.47221 0.5108,-40.96175 9.18175,-11.61578 23.37494,-13.18389 33.81096,-3.73555 l 4.75684,4.30665 0,7.36195 c 0,8.84961 -2.98361,15.84682 -10.16103,23.82984 -8.88984,9.88764 -19.95565,13.40774 -28.91757,9.19886 z m 15.657,-2.96362 c 3.66665,-1.45496 10.83405,-15.84677 11.59512,-23.28245 1.19574,-11.68253 -5.30332,-18.83527 -15.96645,-17.57238 -5.45664,0.64626 -7.56131,2.11866 -11.65214,8.15171 -6.11078,9.01201 -8.10066,20.69878 -4.65316,27.32858 3.20153,6.15679 12.56901,8.59171 20.67663,5.37454 z m 18.45343,-21.29333 c 3.31596,-9.39844 1.11427,-16.95172 -5.91327,-20.2865 -5.06722,-2.40456 -6.56017,-1.94921 -2.94705,0.89885 4.53907,3.57794 6.73037,9.98136 6.06741,17.73014 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -0.6423,1.77127 -0.53598,1.74675 0.92964,-0.21449 0.91018,-1.21796 2.31554,-4.08704 3.12304,-6.37572 z m 486.16799,222.70969 c 0.50381,-4.88136 0.33614,-5.44603 -2.21221,-7.45057 -4.17478,-3.28388 -6.03068,-2.82247 -3.33156,0.82829 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.52415,7.24637 2.00931,5.94825 2.88333,-2.52022 z M 213,315 l 0,-29 -5.99712,0 c -5.48334,0 -6.33922,0.30907 -9.99031,3.60761 -10.05685,9.08575 -15.16693,32.45807 -9.49476,43.42682 3.10147,5.99759 12.37798,10.75931 21.23219,10.89867 L 213,344 l 0,-29 z m 391.83062,15.45509 c 6.54007,-7.42992 7.36966,-17.09995 1.90725,-22.23162 -2.91852,-2.74181 -8.90682,-5.23426 -12.45575,-5.18433 l -2.78212,0.0391 3.04958,1.32832 c 6.50902,2.83515 11.35366,11.9652 10.04645,18.93322 -0.36451,1.94301 -2.25178,5.8428 -4.19394,8.66619 -4.3486,6.32176 -1.67802,5.38649 4.42853,-1.55092 z M 566.16013,289.3996 c -2.95075,-2.06678 -14.21176,-4.01353 -16.73694,-2.8934 -1.37879,0.61161 0.22914,1.04804 5.68031,1.54177 4.18192,0.37877 8.45692,1.18425 9.5,1.78995 2.92573,1.69892 4.12561,1.36107 1.55663,-0.43832 z M 213,283 c 0,-0.55 -0.19844,-1 -0.44098,-1 -0.24254,0 -0.7191,0.45 -1.05902,1 -0.33992,0.55 -0.14148,1 0.44098,1 0.58246,0 1.05902,-0.45 1.05902,-1 z"
+       id="path3504"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#937c3b"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.07239,707.49364 78.019759,666.03521 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 73.774871,199.98428 80.063669,183.6054 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 140.41309,111.1255 163.09172,99.004905 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.608954 c 34.37711,1.575455 58.69187,9.838585 88.28763,30.003671 6.95606,4.73952 8.18067,5.81183 21.91562,19.19009 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 42.47405,-35.25083 c 45.70106,-23.72981 77.55927,-50.16108 98.83683,-82.00031 C 629.33157,573.41468 635.70352,521.10228 618.01818,473 602.9898,432.12436 573.42975,395.64889 521,353.28488 c -11.00708,-8.89389 -24.28924,-21.6468 -30.59606,-29.37691 -3.82822,-4.69215 -9.24745,-16.80733 -9.91771,-22.17192 -2.40655,-19.26133 21.99703,-44.14102 73.26377,-74.6931 6.7375,-4.01517 12.25,-7.45163 12.25,-7.63657 0,-0.46832 -62.98156,-103.9322 -66.44675,-109.15638 -1.55046,-2.3375 -2.99983,-4.25 -3.22082,-4.25 -0.22099,0 -4.0987,2.08374 -8.61712,4.63054 -28.78486,16.22449 -62.24135,44.85979 -85.48687,73.16792 -12.97628,15.80238 -28.80433,42.65669 -34.89364,59.20154 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.42125,3.04745 -3.73396,12.00739 -5.67858,22 -2.16645,11.13256 -2.47545,40.51697 -0.5363,51 5.30888,28.69987 16.12755,51.69545 37.59708,79.91436 9.31533,12.24379 32.86768,34.9069 46.11038,44.36943 0.55128,0.39392 6.17628,5.04259 12.5,10.33038 34.44788,28.80476 50.25731,51.60471 48.75551,70.31397 -1.64311,20.46975 -22.97683,41.06757 -63.78662,61.58634 l -7.87036,3.95713 3.32744,7.2642 C 452.61543,641.94054 483.82641,707 484.68681,707 c 0.35415,0 8.01116,-3.82537 17.01558,-8.50083 z M 229.5,691.9582 c 23.18949,-1.71216 41.54909,-7.16804 59.30383,-17.62318 33.60482,-19.78869 59.10912,-56.35023 69.08154,-99.03143 5.15259,-22.0527 5.38776,-25.8151 5.83208,-93.30359 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.60438,-13.76399 -0.78809,-44.23477 1.49585,-55.83768 5.25749,-26.70911 15.64967,-52.47437 31.00464,-76.86959 C 362.93744,181.44897 364,179.04771 364,175.38041 364,172.09312 363.61372,171 362.45209,171 c -0.85136,0 -26.83886,-2.92478 -57.75,-6.49952 -30.91115,-3.57474 -56.53959,-6.49974 -56.95209,-6.5 -0.4125,-2.6e-4 -0.75891,84.26202 -0.76981,187.24952 -0.0126,119.29265 -0.38246,189.79046 -1.01905,194.25 -0.54959,3.85 -1.67221,9.64936 -2.49472,12.88747 -3.62371,14.26604 -12.88177,27.29539 -20.96642,29.5071 -5.60904,1.53446 -13.086,1.37088 -16.4322,-0.35951 -6.4297,-3.32492 -12.63825,-17.63871 -15.56242,-35.8791 -1.79091,-11.1713 -3.49704,-36.98271 -3.50184,-52.97792 L 187,480.85609 l -5.25,0.58824 c -2.8875,0.32354 -23.7,1.96751 -46.25,3.65327 -58.042902,4.33909 -58.291278,4.36034 -58.977817,5.04688 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32672 15,-0.89523 z m 137.22743,-6.94549 C 375.60658,676.87659 383.52333,673 391.25972,673 c 5.46263,0 6.22348,0.2832 9.46229,3.52201 3.33984,3.33984 3.4985,3.80533 3.06772,9 L 403.33545,691 l 17.79952,0 17.79952,0 -4.31196,-9.25 c -2.37158,-5.0875 -13.4882,-28.78767 -24.70361,-52.66704 -19.57012,-41.66787 -20.4285,-43.27938 -21.30631,-40 -10.76455,40.21459 -28.63862,70.35081 -56.741,95.66704 l -6.93784,6.25 17.6298,0 17.62979,0 6.53407,-5.98729 z m 26.58953,2.23729 c -0.75223,-5.06171 -2.79744,-8.0815 -6.02134,-8.89065 -3.40603,-0.85486 -11.78715,3.51151 -17.01324,8.86351 L 366.5941,691 l 13.64008,0 13.64008,0 -0.5573,-3.75 z m 6.07605,2.16821 c 1.47442,-3.84226 0.60573,-8.27404 -2.02787,-10.34563 -4.00151,-3.14759 -5.89374,-2.70657 -3.32051,0.77391 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.07753 c 17.44815,-10.2999 30.28388,-22.09115 44.69877,-41.06147 1.1615,-1.52856 3.32172,-5.02921 4.80048,-7.77921 1.47876,-2.75 3.79192,-6.8 5.14035,-9 1.34844,-2.2 3.10849,-6.025 3.91123,-8.5 0.80274,-2.475 2.82676,-8.54701 4.49782,-13.49335 1.67106,-4.94634 3.05432,-10.34634 3.07391,-12 0.0196,-1.65366 0.68756,-5.70665 1.48438,-9.00665 1.23426,-5.11165 1.44623,-29.61526 1.43166,-165.5 -0.01,-92.24026 -0.40711,-162.24099 -0.94197,-166 -2.38319,-16.74917 -4.09703,-24.35244 -7.88929,-35 -4.61951,-12.97023 -5.08087,-13.97312 -10.5806,-23 -7.3243,-12.0216 -14.14273,-20.44297 -24.568,-30.34367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.16742 -2.25,0.0123 0,0.17972 16.03459,26.77982 35.63242,59.11133 19.59783,32.33151 35.80464,59.0901 36.01513,59.46355 0.21049,0.37344 -5.5866,3.93945 -12.88242,7.92446 -43.0406,23.50898 -73.71994,44.64203 -82.08374,56.54226 -2.71763,3.86672 -2.79156,4.24057 -1.37887,6.9724 0.821,1.58764 2.51614,3.78555 3.767,4.88425 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13103,-1.94653 5.16621,-12.98661 9.89249,-17.34315 6.67438,-6.15223 13.49715,-9.00943 21.54214,-9.02129 12.16318,-0.0179 19.87392,4.29665 24.60741,13.76919 l 2.90173,5.80688 3.9333,-1.7667 c 9.9513,-4.46977 24.22108,0.14185 29.0283,9.3812 2.1253,4.08476 1.76408,12.42643 -0.76427,17.64931 -6.64067,13.71779 -24.74423,21.36024 -36.64768,15.47088 l -4.04216,-1.9999 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.57963,2.41637 6.88406,4.20528 10.11864,4.20528 3.04568,0 13.88989,-11.3303 15.49056,-16.18491 2.18095,-6.61453 -1.40371,-14.00528 -8.58141,-17.6929 C 588.60664,304.73036 580.33753,304.64485 579.5,306 c -1.1258,1.82158 -2.31407,1.0432 -4.16764,-2.73008 -2.14729,-4.37117 -8.81962,-9.72003 -14.10762,-11.30933 -2.04861,-0.6157 -8.04779,-1.36578 -13.33151,-1.66683 l -9.60676,-0.54736 -4.10695,3.71038 C 530.47342,296.80501 524,307.61242 524,310.45151 c 0,1.59782 6.77587,7.87073 19,17.58969 39.69039,31.55636 72.87362,67.91977 90.10574,98.74117 1.921,3.4359 2.78959,4.15625 4.39426,3.64432 1.1,-0.35093 5.03203,-0.86597 8.73784,-1.14453 6.64355,-0.49939 6.78699,-0.45733 10.25,3.00568 3.97964,3.97964 4.5356,8.01734 2.17597,15.80323 -2.06682,6.81971 -6.8397,15.91826 -7.9805,15.2132 -0.65225,-0.40311 -0.74519,0.0615 -0.25637,1.28169 8.10693,20.23575 12.34462,55.75696 9.65307,80.91404 -4.82605,45.10746 -23.71909,83.57962 -59.55076,121.26407 -5.35297,5.62976 -9.38853,10.23593 -8.9679,10.23593 0.42063,0 5.0789,-2.54669 10.35171,-5.65932 z m 49.12093,-72.79972 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39463,565.58519 c 11.84553,-5.72815 25.44972,-12.96504 30.23154,-16.08199 9.44225,-6.15477 19.25057,-14.94966 22.45546,-20.13528 1.92768,-3.11906 1.94351,-3.42125 0.34392,-6.56869 -5.81961,-11.45101 -21.18382,-27.4807 -42.92555,-44.78481 -7.15,-5.69064 -16.44222,-13.41749 -20.64938,-17.17077 l -7.64938,-6.82414 -0.51222,49.24025 c -0.43141,41.47196 -0.80713,51.09395 -2.38155,60.99024 -1.02813,6.4625 -1.55001,11.75 -1.15974,11.75 0.39027,0 10.40138,-4.68667 22.2469,-10.41481 z m -7.36064,-53.04423 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 649.08154,450 c 0.48201,-8.41152 -0.0116,-11.02096 -2.5683,-13.57767 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.07974,10.75465 c 2.79386,5.91506 5.37758,10.44074 5.74159,10.05708 0.36401,-0.38366 0.77788,-2.72257 0.9197,-5.19757 z m -494.36863,-0.0272 c 29.2671,-2.18503 54.3546,-3.9728 55.75,-3.9728 l 2.53709,0 0,-49 0,-49 -4.46505,0 c -9.77287,0 -20.93919,-6.07214 -24.43105,-13.28538 -6.03007,-12.45644 -1.76475,-34.53314 8.90925,-46.11306 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93115,278 213,275.05898 213,199.38646 l 0,-78.61355 4.25,0.59799 c 2.3375,0.32889 43.3354,4.91936 91.10643,10.20104 l 86.85644,9.60307 10.64356,-10.38004 c 5.85397,-5.70902 12.86222,-12.28906 15.5739,-14.62231 l 4.93033,-4.24227 -105.93033,0.34208 -105.93033,0.34208 -11,2.59329 c -6.05,1.42631 -12.8,3.25107 -15,4.05503 -9.16157,3.34798 -20.35058,8.1976 -25.5,11.0524 -15.37298,8.52267 -38.15711,29.33559 -46.50299,42.47971 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990639,9.19833 -2.06849,13.03397 -2.451627,120.78985 l -0.395702,111.28986 4.790799,-0.56704 c 2.634939,-0.31186 28.736608,-2.3548 58.003708,-4.53985 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.52736,-6.353 -13.31388,-23.47221 0.5108,-40.96175 5.35054,-6.76894 10.75067,-9.54492 18.5678,-9.54492 6.86579,0 12.25232,2.31748 17,7.31401 2.76198,2.90674 3,3.72726 3,10.34158 0,8.65659 -3.03919,15.73102 -10.16103,23.65222 -8.88984,9.88764 -19.95565,13.40774 -28.91757,9.19886 z m 15.657,-2.96362 c 3.66665,-1.45496 10.83405,-15.84677 11.59512,-23.28245 1.19574,-11.68253 -5.30332,-18.83527 -15.96645,-17.57238 -5.45664,0.64626 -7.56131,2.11866 -11.65214,8.15171 -6.11078,9.01201 -8.10066,20.69878 -4.65316,27.32858 3.20153,6.15679 12.56901,8.59171 20.67663,5.37454 z m 18.45343,-21.29333 c 3.31596,-9.39844 1.11427,-16.95172 -5.91327,-20.2865 -5.06722,-2.40456 -6.56017,-1.94921 -2.94705,0.89885 4.53907,3.57794 6.73037,9.98136 6.06741,17.73014 -0.29399,3.43624 -0.86089,7.14772 -1.25977,8.24772 -0.6423,1.77127 -0.53598,1.74675 0.92964,-0.21449 0.91018,-1.21796 2.31554,-4.08704 3.12304,-6.37572 z m 486.16799,222.70969 c 0.50381,-4.88136 0.33614,-5.44603 -2.21221,-7.45057 -4.17478,-3.28388 -6.03068,-2.82247 -3.33156,0.82829 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.52415,7.24637 2.00931,5.94825 2.88333,-2.52022 z M 213,315 l 0,-29 -5.99712,0 c -5.48334,0 -6.33922,0.30907 -9.99031,3.60761 -10.05685,9.08575 -15.16693,32.45807 -9.49476,43.42682 3.10147,5.99759 12.37798,10.75931 21.23219,10.89867 L 213,344 l 0,-29 z m 391.83062,15.45509 c 6.54007,-7.42992 7.36966,-17.09995 1.90725,-22.23162 -2.91852,-2.74181 -8.90682,-5.23426 -12.45575,-5.18433 l -2.78212,0.0391 3.04958,1.32832 c 6.50902,2.83515 11.35366,11.9652 10.04645,18.93322 -0.36451,1.94301 -2.25178,5.8428 -4.19394,8.66619 -4.3486,6.32176 -1.67802,5.38649 4.42853,-1.55092 z M 566.16013,289.3996 c -2.95075,-2.06678 -14.21176,-4.01353 -16.73694,-2.8934 -1.37879,0.61161 0.22914,1.04804 5.68031,1.54177 4.18192,0.37877 8.45692,1.18425 9.5,1.78995 2.92573,1.69892 4.12561,1.36107 1.55663,-0.43832 z M 213,283 c 0,-0.55 -0.19844,-1 -0.44098,-1 -0.24254,0 -0.7191,0.45 -1.05902,1 -0.33992,0.55 -0.14148,1 0.44098,1 0.58246,0 1.05902,-0.45 1.05902,-1 z"
+       id="path3502"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#997c34"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.07239,707.49364 78.019759,666.03521 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 73.774871,199.98428 80.063669,183.6054 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 140.41309,111.1255 163.09172,99.004905 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.608954 c 34.37711,1.575455 58.69187,9.838585 88.28763,30.003671 6.95606,4.73952 8.18067,5.81183 21.91562,19.19009 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 42.47405,-35.25083 c 45.70106,-23.72981 77.55927,-50.16108 98.83683,-82.00031 C 629.33157,573.41468 635.70352,521.10228 618.01818,473 602.9898,432.12436 573.42975,395.64889 521,353.28488 c -11.00708,-8.89389 -24.28924,-21.6468 -30.59606,-29.37691 -3.82822,-4.69215 -9.24745,-16.80733 -9.91771,-22.17192 -2.40655,-19.26133 21.99703,-44.14102 73.26377,-74.6931 6.7375,-4.01517 12.25,-7.45163 12.25,-7.63657 0,-0.46832 -62.98156,-103.9322 -66.44675,-109.15638 -1.55046,-2.3375 -2.99983,-4.25 -3.22082,-4.25 -0.22099,0 -4.0987,2.08374 -8.61712,4.63054 -28.78486,16.22449 -62.24135,44.85979 -85.48687,73.16792 -12.97628,15.80238 -28.80433,42.65669 -34.89364,59.20154 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.42125,3.04745 -3.73396,12.00739 -5.67858,22 -2.16645,11.13256 -2.47545,40.51697 -0.5363,51 5.30888,28.69987 16.12755,51.69545 37.59708,79.91436 9.31533,12.24379 32.86768,34.9069 46.11038,44.36943 0.55128,0.39392 6.17628,5.04259 12.5,10.33038 34.44788,28.80476 50.25731,51.60471 48.75551,70.31397 -1.64311,20.46975 -22.97683,41.06757 -63.78662,61.58634 l -7.87036,3.95713 3.32744,7.2642 C 452.61543,641.94054 483.82641,707 484.68681,707 c 0.35415,0 8.01116,-3.82537 17.01558,-8.50083 z M 229.5,691.9582 c 23.18949,-1.71216 41.54909,-7.16804 59.30383,-17.62318 33.60482,-19.78869 59.10912,-56.35023 69.08154,-99.03143 5.15259,-22.0527 5.38776,-25.8151 5.83208,-93.30359 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.60438,-13.76399 -0.78809,-44.23477 1.49585,-55.83768 5.25749,-26.70911 15.64967,-52.47437 31.00464,-76.86959 C 362.93744,181.44897 364,179.04771 364,175.38041 364,172.09312 363.61372,171 362.45209,171 c -0.85136,0 -26.83886,-2.92478 -57.75,-6.49952 -30.91115,-3.57474 -56.53959,-6.49974 -56.95209,-6.5 -0.4125,-2.6e-4 -0.75891,84.26202 -0.76981,187.24952 -0.0126,119.29265 -0.38246,189.79046 -1.01905,194.25 -0.54959,3.85 -1.67221,9.64936 -2.49472,12.88747 -3.62371,14.26604 -12.88177,27.29539 -20.96642,29.5071 -5.60904,1.53446 -13.086,1.37088 -16.4322,-0.35951 -6.4297,-3.32492 -12.63825,-17.63871 -15.56242,-35.8791 -1.79091,-11.1713 -3.49704,-36.98271 -3.50184,-52.97792 L 187,480.85609 l -5.25,0.58824 c -2.8875,0.32354 -23.7,1.96751 -46.25,3.65327 -58.042902,4.33909 -58.291278,4.36034 -58.977817,5.04688 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32672 15,-0.89523 z m 137.22743,-6.94549 C 375.60658,676.87659 383.52333,673 391.25972,673 c 5.46263,0 6.22348,0.2832 9.46229,3.52201 3.33984,3.33984 3.4985,3.80533 3.06772,9 L 403.33545,691 l 17.79952,0 17.79952,0 -4.31196,-9.25 c -2.37158,-5.0875 -13.4882,-28.78767 -24.70361,-52.66704 -19.57012,-41.66787 -20.4285,-43.27938 -21.30631,-40 -10.76455,40.21459 -28.63862,70.35081 -56.741,95.66704 l -6.93784,6.25 17.6298,0 17.62979,0 6.53407,-5.98729 z m 26.58953,2.23729 c -0.75223,-5.06171 -2.79744,-8.0815 -6.02134,-8.89065 -3.40603,-0.85486 -11.78715,3.51151 -17.01324,8.86351 L 366.5941,691 l 13.64008,0 13.64008,0 -0.5573,-3.75 z m 6.07605,2.16821 C 401.39724,684.19527 398.15412,677 393.79575,677 c -1.74921,0 -1.73494,0.16324 0.24888,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z m 202.52005,-18.07753 c 17.44815,-10.2999 30.28388,-22.09115 44.69877,-41.06147 1.1615,-1.52856 3.32172,-5.02921 4.80048,-7.77921 1.47876,-2.75 3.79192,-6.8 5.14035,-9 1.34844,-2.2 3.10849,-6.025 3.91123,-8.5 0.80274,-2.475 2.82676,-8.54701 4.49782,-13.49335 1.67106,-4.94634 3.05432,-10.34634 3.07391,-12 0.0196,-1.65366 0.68756,-5.70665 1.48438,-9.00665 1.23426,-5.11165 1.44623,-29.61526 1.43166,-165.5 -0.01,-92.24026 -0.40711,-162.24099 -0.94197,-166 -2.38319,-16.74917 -4.09703,-24.35244 -7.88929,-35 -4.61951,-12.97023 -5.08087,-13.97312 -10.5806,-23 -7.3243,-12.0216 -14.14273,-20.44297 -24.568,-30.34367 -10.71416,-10.17505 -20.67455,-17.29777 -34.97602,-25.0115 -6.9362,-3.74116 -28.525,-10.33243 -37.99578,-11.60048 -4.675,-0.62595 -9.5125,-1.27959 -10.75,-1.45254 -1.2375,-0.17296 -2.25,-0.16742 -2.25,0.0123 0,0.17972 16.03459,26.77982 35.63242,59.11133 19.59783,32.33151 35.80464,59.0901 36.01513,59.46355 0.21049,0.37344 -5.5866,3.93945 -12.88242,7.92446 -43.0406,23.50898 -73.71994,44.64203 -82.08374,56.54226 -2.71763,3.86672 -2.79156,4.24057 -1.37887,6.9724 0.821,1.58764 2.51614,3.78555 3.767,4.88425 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13103,-1.94653 5.16621,-12.98661 9.89249,-17.34315 6.67438,-6.15223 13.49715,-9.00943 21.54214,-9.02129 12.16318,-0.0179 19.87392,4.29665 24.60741,13.76919 l 2.90173,5.80688 3.9333,-1.7667 c 9.9513,-4.46977 24.22108,0.14185 29.0283,9.3812 2.1253,4.08476 1.76408,12.42643 -0.76427,17.64931 -6.64067,13.71779 -24.74423,21.36024 -36.64768,15.47088 l -4.04216,-1.9999 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.57963,2.41637 6.88406,4.20528 10.11864,4.20528 3.04568,0 13.88989,-11.3303 15.49056,-16.18491 2.18095,-6.61453 -1.40371,-14.00528 -8.58141,-17.6929 C 588.60664,304.73036 580.33753,304.64485 579.5,306 c -1.1258,1.82158 -2.31407,1.0432 -4.16764,-2.73008 -2.14729,-4.37117 -8.81962,-9.72003 -14.10762,-11.30933 -2.04861,-0.6157 -8.04779,-1.36578 -13.33151,-1.66683 l -9.60676,-0.54736 -4.10695,3.71038 C 530.47342,296.80501 524,307.61242 524,310.45151 c 0,1.59782 6.77587,7.87073 19,17.58969 39.69039,31.55636 72.87362,67.91977 90.10574,98.74117 1.921,3.4359 2.78959,4.15625 4.39426,3.64432 1.1,-0.35093 5.03203,-0.86597 8.73784,-1.14453 6.64355,-0.49939 6.78699,-0.45733 10.25,3.00568 3.97964,3.97964 4.5356,8.01734 2.17597,15.80323 -2.06682,6.81971 -6.8397,15.91826 -7.9805,15.2132 -0.65225,-0.40311 -0.74519,0.0615 -0.25637,1.28169 8.10693,20.23575 12.34462,55.75696 9.65307,80.91404 -4.82605,45.10746 -23.71909,83.57962 -59.55076,121.26407 -5.35297,5.62976 -9.38853,10.23593 -8.9679,10.23593 0.42063,0 5.0789,-2.54669 10.35171,-5.65932 z m 49.12093,-72.79972 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39463,565.58519 c 11.84553,-5.72815 25.44972,-12.96504 30.23154,-16.08199 9.44225,-6.15477 19.25057,-14.94966 22.45546,-20.13528 1.92768,-3.11906 1.94351,-3.42125 0.34392,-6.56869 -5.81961,-11.45101 -21.18382,-27.4807 -42.92555,-44.78481 -7.15,-5.69064 -16.44222,-13.41749 -20.64938,-17.17077 l -7.64938,-6.82414 -0.51222,49.24025 c -0.43141,41.47196 -0.80713,51.09395 -2.38155,60.99024 -1.02813,6.4625 -1.55001,11.75 -1.15974,11.75 0.39027,0 10.40138,-4.68667 22.2469,-10.41481 z m -7.36064,-53.04423 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 649.08154,450 c 0.48201,-8.41152 -0.0116,-11.02096 -2.5683,-13.57767 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.07974,10.75465 c 2.79386,5.91506 5.37758,10.44074 5.74159,10.05708 0.36401,-0.38366 0.77788,-2.72257 0.9197,-5.19757 z m -494.36863,-0.0272 c 29.2671,-2.18503 54.3546,-3.9728 55.75,-3.9728 l 2.53709,0 0,-49 0,-49 -4.46505,0 c -9.77287,0 -20.93919,-6.07214 -24.43105,-13.28538 -6.03007,-12.45644 -1.76475,-34.53314 8.90925,-46.11306 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93115,278 213,275.05898 213,199.38646 l 0,-78.61355 4.25,0.59799 c 2.3375,0.32889 43.3354,4.91936 91.10643,10.20104 l 86.85644,9.60307 10.64356,-10.38004 c 5.85397,-5.70902 12.86222,-12.28906 15.5739,-14.62231 l 4.93033,-4.24227 -105.93033,0.34208 -105.93033,0.34208 -11,2.59329 c -6.05,1.42631 -12.8,3.25107 -15,4.05503 -9.16157,3.34798 -20.35058,8.1976 -25.5,11.0524 -15.37298,8.52267 -38.15711,29.33559 -46.50299,42.47971 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990639,9.19833 -2.06849,13.03397 -2.451627,120.78985 l -0.395702,111.28986 4.790799,-0.56704 c 2.634939,-0.31186 28.736608,-2.3548 58.003708,-4.53985 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.52736,-6.353 -13.31388,-23.47221 0.5108,-40.96175 5.35054,-6.76894 10.75067,-9.54492 18.5678,-9.54492 6.86579,0 12.25232,2.31748 17,7.31401 2.76198,2.90674 3,3.72726 3,10.34158 0,8.65659 -3.03919,15.73102 -10.16103,23.65222 -8.88984,9.88764 -19.95565,13.40774 -28.91757,9.19886 z m 15.657,-2.96362 c 3.66665,-1.45496 10.83405,-15.84677 11.59512,-23.28245 1.19574,-11.68253 -5.30332,-18.83527 -15.96645,-17.57238 -5.45664,0.64626 -7.56131,2.11866 -11.65214,8.15171 -6.11078,9.01201 -8.10066,20.69878 -4.65316,27.32858 3.20153,6.15679 12.56901,8.59171 20.67663,5.37454 z m 17.85686,-19.75964 c 4.06898,-10.87531 2.2831,-18.21385 -5.30919,-21.81663 -5.07391,-2.40773 -6.5698,-1.95444 -2.95456,0.89529 5.80522,4.57599 7.84897,15.46921 4.76252,25.38423 -1.49573,4.80494 1.42811,1.07803 3.50123,-4.46289 z m 486.75438,221.52925 c 0.51656,-4.36159 0.28525,-5.37055 -1.72074,-7.50584 C 652.69426,434.1101 650.81634,433 649.79575,433 c -1.72736,0 -1.70245,0.20718 0.3603,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51334,7.09689 1.89983,6.05118 2.87315,-2.16697 z M 213,315 l 0,-29 -5.99712,0 c -5.48334,0 -6.33922,0.30907 -9.99031,3.60761 -10.05685,9.08575 -15.16693,32.45807 -9.49476,43.42682 3.10147,5.99759 12.37798,10.75931 21.23219,10.89867 L 213,344 l 0,-29 z m 391.80719,15.4817 c 6.62585,-7.52736 7.54952,-16.0397 2.37321,-21.8711 -2.31327,-2.60603 -9.05873,-5.56684 -12.6804,-5.56587 l -3,8.1e-4 3.27735,1.61538 c 4.41178,2.17453 7.93547,6.55885 9.27777,11.54378 1.72885,6.42046 0.67127,9.85563 -5.75749,18.70114 -1.71731,2.3629 -1.71062,2.38555 0.3748,1.26947 1.16782,-0.625 3.92847,-3.18712 6.13476,-5.69361 z m -38.4549,-40.9475 C 562.29045,286.68918 548,284.71586 548,287 c 0,0.55 2.5875,1.0254 5.75,1.05644 3.1625,0.031 7.325,0.65236 9.25,1.38069 4.78003,1.80856 5.83958,1.83924 3.35229,0.0971 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3500"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#9a7534"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.07239,707.49364 78.019759,666.03521 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 73.774871,199.98428 80.063669,183.6054 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 140.41309,111.1255 163.09172,99.004905 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.608954 c 34.37711,1.575455 58.69187,9.838585 88.28763,30.003671 6.95606,4.73952 8.18067,5.81183 21.91562,19.19009 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 43.68862,-35.88213 c 44.7863,-23.26074 76.28814,-49.52132 97.60919,-81.36901 33.3498,-49.81528 36.38684,-109.55048 8.34589,-164.1543 C 591.5991,418.70917 565.35698,389.12596 521,353.28488 c -11.02571,-8.90894 -24.26935,-21.62782 -30.63214,-29.41841 -1.17268,-1.43582 -3.84788,-6.08214 -5.94489,-10.32516 -6.97128,-14.10542 -4.98817,-24.41746 7.57161,-39.37188 10.94865,-13.03611 31.08945,-28.56312 58.70263,-45.25522 7.95709,-4.81003 14.67646,-8.95455 14.93195,-9.21003 C 566.3399,218.99343 497.56079,106 496.41741,106 c -0.2145,0 -4.02829,2.01247 -8.47508,4.47217 -10.16823,5.62443 -24.6612,15.61468 -36.90189,25.4371 -10.24214,8.2187 -32.8094,28.71706 -35.11695,31.89753 -0.78292,1.07909 -4.96647,5.9515 -9.29678,10.82759 -14.48057,16.30566 -32.41863,45.69068 -39.29191,64.36561 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.42125,3.04745 -3.73396,12.00739 -5.67858,22 -2.16645,11.13256 -2.47545,40.51697 -0.5363,51 4.30061,23.24913 12.93032,44.22048 26.54174,64.5 15.71971,23.42062 31.11483,39.39909 59.56341,61.82034 25.56911,20.15186 46.41409,41.99196 53.57387,56.13144 7.64016,15.08817 7.21744,27.47976 -1.39183,40.79998 -9.13922,14.14015 -32.11471,31.34958 -58.58205,43.87996 -3.3,1.56231 -6.14252,2.91432 -6.31671,3.00447 C 430.3763,595.0538 483.68257,707 484.68841,707 c 0.35503,0 8.55788,-4.10946 18.22855,-9.13213 z M 229.5,691.9582 c 35.96389,-2.65534 62.74811,-14.87788 87.16413,-39.77592 19.84355,-20.2353 34.27542,-47.15111 41.22124,-76.87869 5.15259,-22.0527 5.38776,-25.8151 5.83208,-93.30359 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.60438,-13.76399 -0.78809,-44.23477 1.49585,-55.83768 5.25749,-26.70911 15.64967,-52.47437 31.00464,-76.86959 C 362.93744,181.44897 364,179.04771 364,175.38041 364,172.09312 363.61372,171 362.45209,171 c -0.85136,0 -26.83886,-2.92478 -57.75,-6.49952 -30.91115,-3.57474 -56.53959,-6.49974 -56.95209,-6.5 -0.4125,-2.6e-4 -0.75891,84.26202 -0.76981,187.24952 -0.0126,119.29265 -0.38246,189.79046 -1.01905,194.25 -2.38,16.67255 -7.27732,28.74165 -14.81546,36.51169 -6.49527,6.69509 -16.44794,8.97799 -24.49062,5.61754 -6.67008,-2.78693 -13.12828,-17.16269 -16.15212,-35.95414 -1.73989,-10.81241 -3.48133,-37.46471 -3.494,-53.47475 L 187,480.90069 l -5.75,0.57866 c -3.1625,0.31826 -23.975,1.95021 -46.25,3.62656 -57.469757,4.325 -57.792007,4.35276 -58.477817,5.03857 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32672 15,-0.89523 z m 137.22743,-6.94549 C 375.60658,676.87659 383.52333,673 391.25972,673 c 5.46263,0 6.22348,0.2832 9.46229,3.52201 3.33984,3.33984 3.4985,3.80533 3.06772,9 L 403.33545,691 l 17.79952,0 17.79952,0 -4.30783,-9.25 c -2.36931,-5.0875 -13.4834,-28.79652 -24.69797,-52.68671 -19.5931,-41.7388 -20.42583,-43.30237 -21.30326,-40 -5.2147,19.62664 -15.40286,43.85395 -24.30234,57.79069 -8.02041,12.56008 -19.59438,26.09897 -31.96869,37.39602 l -7.39366,6.75 17.61631,0 17.61631,0 6.53407,-5.98729 z m 26.58953,2.23729 c -0.75223,-5.06171 -2.79744,-8.0815 -6.02134,-8.89065 -3.40603,-0.85486 -11.78715,3.51151 -17.01324,8.86351 L 366.5941,691 l 13.64008,0 13.64008,0 -0.5573,-3.75 z m 6.07605,2.16821 C 401.39724,684.19527 398.15412,677 393.79575,677 c -1.74921,0 -1.73494,0.16324 0.24888,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z M 603,670.67319 c 10.92298,-6.47058 16.55462,-10.87301 26.83672,-20.97915 8.60031,-8.45311 16.89792,-18.83214 21.3408,-26.69404 1.39867,-2.475 3.75061,-6.60393 5.22656,-9.17541 4.2494,-7.40356 10.45573,-26.80583 12.61533,-39.43815 1.91765,-11.21702 1.98041,-16.65874 1.9748,-171.23581 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -0.73543,-4.4 -3.35584,-13.69942 -5.82314,-20.66537 C 650.37345,170.76148 626.23997,144.082 591.83724,125.56449 584.8009,121.77713 563.59513,115.31771 554,114.03902 c -4.675,-0.62301 -9.5125,-1.27426 -10.75,-1.44721 -1.2375,-0.17296 -2.25,-0.15504 -2.25,0.0398 0,0.19485 16.03453,26.79495 35.63229,59.11133 19.59777,32.31638 35.79599,59.0487 35.99605,59.40516 0.20007,0.35647 -8.55692,5.60328 -19.45996,11.6596 -41.36722,22.97826 -69.39408,42.73125 -76.1577,53.67502 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 0.79682,1.54088 2.47218,3.70053 3.72304,4.79923 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13103,-1.94653 5.16621,-12.98661 9.89249,-17.34315 6.67438,-6.15223 13.49715,-9.00943 21.54214,-9.02129 12.16318,-0.0179 19.87392,4.29665 24.60741,13.76919 l 2.90173,5.80688 3.9333,-1.7667 c 9.9513,-4.46977 24.22108,0.14185 29.0283,9.3812 2.1253,4.08476 1.76408,12.42643 -0.76427,17.64931 -6.64067,13.71779 -24.74423,21.36024 -36.64768,15.47088 l -4.04216,-1.9999 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.57963,2.41637 6.88406,4.20528 10.11864,4.20528 3.04568,0 13.88989,-11.3303 15.49056,-16.18491 2.18095,-6.61453 -1.40371,-14.00528 -8.58141,-17.6929 C 588.60664,304.73036 580.33753,304.64485 579.5,306 c -1.1258,1.82158 -2.31407,1.0432 -4.16764,-2.73008 -2.14729,-4.37117 -8.81962,-9.72003 -14.10762,-11.30933 -2.04861,-0.6157 -8.04779,-1.36578 -13.33151,-1.66683 l -9.60676,-0.54736 -4.10695,3.71038 C 530.47342,296.80501 524,307.61242 524,310.45151 c 0,1.59782 6.77587,7.87073 19,17.58969 34.55561,27.47389 62.07522,56.16917 80.9004,84.35655 3.71078,5.55624 7.8242,12.04162 9.14093,14.41195 1.94772,3.50622 2.77296,4.18565 4.42637,3.64432 1.11776,-0.36596 5.06433,-0.8933 8.77014,-1.17186 6.64355,-0.49939 6.78699,-0.45733 10.25,3.00568 3.97964,3.97964 4.5356,8.01734 2.17597,15.80323 -2.06682,6.81971 -6.8397,15.91826 -7.9805,15.2132 -0.65081,-0.40222 -0.74746,0.0642 -0.26558,1.28169 8.5476,21.59481 12.45232,55.28703 9.52686,82.20345 -2.41676,22.23601 -8.23754,42.01777 -18.45258,62.71059 -10.41322,21.09427 -22.45951,37.86115 -41.67918,58.01201 -5.67206,5.94687 -9.18783,10.22388 -7.81283,9.50446 1.375,-0.71941 6.325,-3.57389 11,-6.34328 z m 48.03399,-72.13223 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39982,565.60558 c 11.80825,-5.71692 25.39603,-12.95382 30.19506,-16.08199 9.47005,-6.17289 19.27841,-14.96447 22.48675,-20.15567 1.92768,-3.11906 1.94351,-3.42125 0.34392,-6.56869 -5.81961,-11.45101 -21.18382,-27.4807 -42.92555,-44.78481 -7.15,-5.69064 -16.4875,-13.45837 -20.75,-17.26162 l -7.75,-6.915 0,41.15901 c 0,39.56945 -0.79755,56.59434 -3.43165,73.25319 -0.67398,4.2625 -0.86827,7.75 -0.43175,7.75 0.43652,0 10.45497,-4.67749 22.26322,-10.39442 z m -7.36583,-53.06462 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 649.08154,450 c 0.48201,-8.41152 -0.0116,-11.02096 -2.5683,-13.57767 -1.8039,-1.8039 -3.40475,-2.42494 -5.82975,-2.26163 l -3.34298,0.22514 5.07974,10.75465 c 2.79386,5.91506 5.37758,10.44074 5.74159,10.05708 0.36401,-0.38366 0.77788,-2.72257 0.9197,-5.19757 z M 154.8842,449.97568 C 184.2455,447.78906 209.333,446 210.6342,446 l 2.3658,0 0,-49 0,-49 -4.46505,0 c -9.77287,0 -20.93919,-6.07214 -24.43105,-13.28538 -6.03007,-12.45644 -1.76475,-34.53314 8.90925,-46.11306 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93115,278 213,275.05898 213,199.38646 l 0,-78.61355 4.25,0.59799 c 2.3375,0.32889 43.3354,4.91936 91.10643,10.20104 l 86.85644,9.60307 10.64356,-10.38004 c 5.85397,-5.70902 12.86017,-12.28726 15.56935,-14.61831 l 4.92578,-4.23826 -105.42578,0.29361 c -105.24487,0.2931 -105.44294,0.29748 -115.42578,2.54804 -16.11517,3.63306 -25.65068,7.07162 -40,14.42424 -16.62638,8.5194 -39.85374,29.18134 -49.00299,43.59069 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990639,9.19833 -2.06849,13.03397 -2.451627,120.78985 l -0.395702,111.28986 4.790799,-0.56418 c 2.634939,-0.31029 28.813688,-2.35323 58.174998,-4.53985 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.52736,-6.353 -13.31388,-23.47221 0.5108,-40.96175 5.35054,-6.76894 10.75067,-9.54492 18.5678,-9.54492 6.86579,0 12.25232,2.31748 17,7.31401 2.76198,2.90674 3,3.72726 3,10.34158 0,8.65659 -3.03919,15.73102 -10.16103,23.65222 -8.88984,9.88764 -19.95565,13.40774 -28.91757,9.19886 z m 15.657,-2.96362 c 3.66665,-1.45496 10.83405,-15.84677 11.59512,-23.28245 1.19574,-11.68253 -5.30332,-18.83527 -15.96645,-17.57238 -5.45664,0.64626 -7.56131,2.11866 -11.65214,8.15171 -6.11078,9.01201 -8.10066,20.69878 -4.65316,27.32858 3.20153,6.15679 12.56901,8.59171 20.67663,5.37454 z m 17.85686,-19.75964 c 4.06898,-10.87531 2.2831,-18.21385 -5.30919,-21.81663 -5.07391,-2.40773 -6.5698,-1.95444 -2.95456,0.89529 5.80522,4.57599 7.84897,15.46921 4.76252,25.38423 -1.49573,4.80494 1.42811,1.07803 3.50123,-4.46289 z m 486.75438,221.52925 c 0.51656,-4.36159 0.28525,-5.37055 -1.72074,-7.50584 C 652.69426,434.1101 650.81634,433 649.79575,433 c -1.72736,0 -1.70245,0.20718 0.3603,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51334,7.09689 1.89983,6.05118 2.87315,-2.16697 z M 213,315 l 0,-29 -5.99712,0 c -5.48334,0 -6.33922,0.30907 -9.99031,3.60761 -10.05685,9.08575 -15.16693,32.45807 -9.49476,43.42682 3.10147,5.99759 12.37798,10.75931 21.23219,10.89867 L 213,344 l 0,-29 z m 391.80719,15.4817 c 6.62585,-7.52736 7.54952,-16.0397 2.37321,-21.8711 -2.31327,-2.60603 -9.05873,-5.56684 -12.6804,-5.56587 l -3,8.1e-4 3.27735,1.61538 c 4.41178,2.17453 7.93547,6.55885 9.27777,11.54378 1.72885,6.42046 0.67127,9.85563 -5.75749,18.70114 -1.71731,2.3629 -1.71062,2.38555 0.3748,1.26947 1.16782,-0.625 3.92847,-3.18712 6.13476,-5.69361 z m -38.4549,-40.9475 C 562.29045,286.68918 548,284.71586 548,287 c 0,0.55 2.5875,1.0254 5.75,1.05644 3.1625,0.031 7.325,0.65236 9.25,1.38069 4.78003,1.80856 5.83958,1.83924 3.35229,0.0971 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3498"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#857944"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.07239,707.49364 78.019759,666.03521 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 73.774871,199.98428 80.063669,183.6054 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 140.41309,111.1255 163.09172,99.004905 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.608954 c 34.37711,1.575455 58.69187,9.838585 88.28763,30.003671 6.95606,4.73952 8.18067,5.81183 21.91562,19.19009 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 43.68862,-35.88213 c 44.7863,-23.26074 76.28814,-49.52132 97.60919,-81.36901 33.3498,-49.81528 36.38684,-109.55048 8.34589,-164.1543 C 591.5991,418.70917 565.35698,389.12596 521,353.28488 c -11.02571,-8.90894 -24.26935,-21.62782 -30.63214,-29.41841 -1.17268,-1.43582 -3.84788,-6.08214 -5.94489,-10.32516 -6.97128,-14.10542 -4.98817,-24.41746 7.57161,-39.37188 10.94865,-13.03611 31.08945,-28.56312 58.70263,-45.25522 7.95709,-4.81003 14.67646,-8.95455 14.93195,-9.21003 C 566.3399,218.99343 497.56079,106 496.41741,106 c -0.2145,0 -4.02829,2.01247 -8.47508,4.47217 -10.16823,5.62443 -24.6612,15.61468 -36.90189,25.4371 -10.24214,8.2187 -32.8094,28.71706 -35.11695,31.89753 -0.78292,1.07909 -4.96647,5.9515 -9.29678,10.82759 -14.48057,16.30566 -32.41863,45.69068 -39.29191,64.36561 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.42125,3.04745 -3.73396,12.00739 -5.67858,22 -2.16645,11.13256 -2.47545,40.51697 -0.5363,51 4.30061,23.24913 12.93032,44.22048 26.54174,64.5 15.71971,23.42062 31.11483,39.39909 59.56341,61.82034 25.56911,20.15186 46.41409,41.99196 53.57387,56.13144 7.64016,15.08817 7.21744,27.47976 -1.39183,40.79998 -9.13922,14.14015 -32.11471,31.34958 -58.58205,43.87996 -3.3,1.56231 -6.14252,2.91432 -6.31671,3.00447 C 430.3763,595.0538 483.68257,707 484.68841,707 c 0.35503,0 8.55788,-4.10946 18.22855,-9.13213 z M 229.5,691.9582 c 35.96389,-2.65534 62.74811,-14.87788 87.16413,-39.77592 19.84355,-20.2353 34.27542,-47.15111 41.22124,-76.87869 5.15259,-22.0527 5.38776,-25.8151 5.83208,-93.30359 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.60438,-13.76399 -0.78809,-44.23477 1.49585,-55.83768 5.25749,-26.70911 15.64967,-52.47437 31.00464,-76.86959 C 362.93744,181.44897 364,179.04771 364,175.38041 364,172.09312 363.61372,171 362.45209,171 c -0.85136,0 -26.83886,-2.92478 -57.75,-6.49952 -30.91115,-3.57474 -56.53959,-6.49974 -56.95209,-6.5 -0.4125,-2.6e-4 -0.75891,84.26202 -0.76981,187.24952 -0.0126,119.29265 -0.38246,189.79046 -1.01905,194.25 -2.38,16.67255 -7.27732,28.74165 -14.81546,36.51169 -6.49527,6.69509 -16.44794,8.97799 -24.49062,5.61754 -6.67008,-2.78693 -13.12828,-17.16269 -16.15212,-35.95414 -1.73989,-10.81241 -3.48133,-37.46471 -3.494,-53.47475 L 187,480.90069 l -5.75,0.57866 c -3.1625,0.31826 -23.975,1.95021 -46.25,3.62656 -57.469757,4.325 -57.792007,4.35276 -58.477817,5.03857 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32672 15,-0.89523 z m 137.22743,-6.94549 C 375.60658,676.87659 383.52333,673 391.25972,673 c 5.46263,0 6.22348,0.2832 9.46229,3.52201 3.33984,3.33984 3.4985,3.80533 3.06772,9 L 403.33545,691 l 17.79952,0 17.79952,0 -4.30783,-9.25 c -2.36931,-5.0875 -13.4834,-28.79652 -24.69797,-52.68671 -19.5931,-41.7388 -20.42583,-43.30237 -21.30326,-40 -5.2147,19.62664 -15.40286,43.85395 -24.30234,57.79069 -8.02041,12.56008 -19.59438,26.09897 -31.96869,37.39602 l -7.39366,6.75 17.61631,0 17.61631,0 6.53407,-5.98729 z m 26.72629,2.23729 c -0.85705,-5.04618 -3.58278,-8.68209 -6.79636,-9.06582 -3.44617,-0.4115 -11.41701,3.96126 -16.25838,8.91927 L 366.5941,691 l 13.74827,0 13.74826,0 -0.63691,-3.75 z m 5.93929,2.16821 C 401.39724,684.19527 398.15412,677 393.79575,677 c -1.74921,0 -1.73494,0.16324 0.24888,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z M 603,670.67319 c 10.92298,-6.47058 16.55462,-10.87301 26.83672,-20.97915 8.60031,-8.45311 16.89792,-18.83214 21.3408,-26.69404 1.39867,-2.475 3.75061,-6.60393 5.22656,-9.17541 4.2494,-7.40356 10.45573,-26.80583 12.61533,-39.43815 1.91765,-11.21702 1.98041,-16.65874 1.9748,-171.23581 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -0.73543,-4.4 -3.35584,-13.69942 -5.82314,-20.66537 C 650.37345,170.76148 626.23997,144.082 591.83724,125.56449 584.8009,121.77713 563.59513,115.31771 554,114.03902 c -4.675,-0.62301 -9.5125,-1.27426 -10.75,-1.44721 -1.2375,-0.17296 -2.25,-0.15504 -2.25,0.0398 0,0.19485 16.03453,26.79495 35.63229,59.11133 19.59777,32.31638 35.79599,59.0487 35.99605,59.40516 0.20007,0.35647 -8.55692,5.60328 -19.45996,11.6596 -41.36722,22.97826 -69.39408,42.73125 -76.1577,53.67502 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 0.79682,1.54088 2.47218,3.70053 3.72304,4.79923 1.25085,1.0987 1.9799,1.49103 1.62012,0.87185 -1.13103,-1.94653 5.16621,-12.98661 9.89249,-17.34315 6.67438,-6.15223 13.49715,-9.00943 21.54214,-9.02129 12.16318,-0.0179 19.87392,4.29665 24.60741,13.76919 l 2.90173,5.80688 3.9333,-1.7667 c 9.9513,-4.46977 24.22108,0.14185 29.0283,9.3812 2.1253,4.08476 1.76408,12.42643 -0.76427,17.64931 -6.64067,13.71779 -24.74423,21.36024 -36.64768,15.47088 l -4.04216,-1.9999 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.56262,2.40044 6.87956,4.20528 10.05845,4.20528 2.60643,0 12.58535,-9.79425 15.12051,-14.84069 3.14463,-6.25965 -0.37564,-14.99227 -7.53637,-18.69523 -3.2167,-1.66342 -11.49822,-1.9726 -12.43054,-0.46408 -1.12374,1.81824 -2.45473,1.04309 -3.86342,-2.25 -3.57612,-8.35987 -12.67467,-12.88214 -27.24555,-13.54189 l -10.10897,-0.45773 -4.10475,3.70839 C 530.47296,296.80543 524,307.61314 524,310.45151 c 0,1.59782 6.77587,7.87073 19,17.58969 34.55561,27.47389 62.07522,56.16917 80.9004,84.35655 3.71078,5.55624 7.8242,12.04162 9.14093,14.41195 1.94772,3.50622 2.77296,4.18565 4.42637,3.64432 1.11776,-0.36596 5.06433,-0.8933 8.77014,-1.17186 6.64355,-0.49939 6.78699,-0.45733 10.25,3.00568 3.97964,3.97964 4.5356,8.01734 2.17597,15.80323 -2.06682,6.81971 -6.8397,15.91826 -7.9805,15.2132 -0.65081,-0.40222 -0.74746,0.0642 -0.26558,1.28169 8.5476,21.59481 12.45232,55.28703 9.52686,82.20345 -2.41676,22.23601 -8.23754,42.01777 -18.45258,62.71059 -10.41322,21.09427 -22.45951,37.86115 -41.67918,58.01201 -5.67206,5.94687 -9.18783,10.22388 -7.81283,9.50446 1.375,-0.71941 6.325,-3.57389 11,-6.34328 z m 48.03399,-72.13223 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39982,565.60558 c 11.80825,-5.71692 25.39603,-12.95382 30.19506,-16.08199 9.47005,-6.17289 19.27841,-14.96447 22.48675,-20.15567 1.92768,-3.11906 1.94351,-3.42125 0.34392,-6.56869 -5.81961,-11.45101 -21.18382,-27.4807 -42.92555,-44.78481 -7.15,-5.69064 -16.4875,-13.45837 -20.75,-17.26162 l -7.75,-6.915 0,41.15901 c 0,39.56945 -0.79755,56.59434 -3.43165,73.25319 -0.67398,4.2625 -0.86827,7.75 -0.43175,7.75 0.43652,0 10.45497,-4.67749 22.26322,-10.39442 z m -7.36583,-53.06462 c -2.58543,-3.11526 0.77391,-9.38961 6.64656,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.37327,8.18559 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z m 235.97904,-60.02801 c 0.0835,-9.12279 -2.07635,-12.51896 -8.06602,-12.68287 l -3.99458,-0.10932 5.10444,10.80689 c 2.99402,6.3388 5.4739,10.43841 5.99807,9.91567 0.4915,-0.49016 0.92264,-4.05883 0.95809,-7.93037 z M 154.8842,449.97568 C 184.2455,447.78906 209.333,446 210.6342,446 l 2.3658,0 0,-49 0,-49 -4.46505,0 c -9.77287,0 -20.93919,-6.07214 -24.43105,-13.28538 -6.03007,-12.45644 -1.76475,-34.53314 8.90925,-46.11306 C 197.1617,284.10091 207.60456,278 211.15972,278 212.93115,278 213,275.05898 213,199.38646 l 0,-78.61355 4.25,0.59799 c 2.3375,0.32889 43.3354,4.91936 91.10643,10.20104 l 86.85644,9.60307 10.64356,-10.38004 c 5.85397,-5.70902 12.86017,-12.28726 15.56935,-14.61831 l 4.92578,-4.23826 -105.42578,0.29361 c -105.24487,0.2931 -105.44294,0.29748 -115.42578,2.54804 -16.11517,3.63306 -25.65068,7.07162 -40,14.42424 -16.62638,8.5194 -39.85374,29.18134 -49.00299,43.59069 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990639,9.19833 -2.06849,13.03397 -2.451627,120.78985 l -0.395702,111.28986 4.790799,-0.56418 c 2.634939,-0.31029 28.813688,-2.35323 58.174998,-4.53985 z M 97.033993,392.54096 c -2.585434,-3.11526 0.773903,-9.38961 6.646557,-12.41401 2.87475,-1.48049 5.70528,1.05165 4.72671,4.22842 -2.495,8.09961 -8.09791,12.13215 -11.373267,8.18559 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.52736,-6.353 -13.31388,-23.47221 0.5108,-40.96175 5.35054,-6.76894 10.75067,-9.54492 18.5678,-9.54492 6.86579,0 12.25232,2.31748 17,7.31401 2.76198,2.90674 3,3.72726 3,10.34158 0,8.65659 -3.03919,15.73102 -10.16103,23.65222 -8.88984,9.88764 -19.95565,13.40774 -28.91757,9.19886 z m 16.40157,-3.072 c 3.31,-1.77145 10.26099,-16.92914 10.87659,-23.71802 1.04436,-11.51743 -4.4401,-17.79247 -14.96068,-17.11725 -4.88801,0.31372 -6.27077,0.86372 -9.12389,3.62908 -4.48777,4.34972 -8.39976,12.32221 -9.71772,19.80436 -0.95516,5.42256 -0.84564,6.63539 0.96984,10.73957 1.60514,3.62869 2.97263,5.05974 6.33974,6.63442 4.4898,2.09972 11.72069,2.11261 15.61612,0.0278 z m 17.11229,-19.65126 c 4.06898,-10.87531 2.2831,-18.21385 -5.30919,-21.81663 -5.07391,-2.40773 -6.5698,-1.95444 -2.95456,0.89529 5.80522,4.57599 7.84897,15.46921 4.76252,25.38423 -1.49573,4.80494 1.42811,1.07803 3.50123,-4.46289 z m 486.75438,221.52925 c 0.51656,-4.36159 0.28525,-5.37055 -1.72074,-7.50584 C 652.69426,434.1101 650.81634,433 649.79575,433 c -1.72736,0 -1.70245,0.20718 0.3603,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51334,7.09689 1.89983,6.05118 2.87315,-2.16697 z M 213,315 l 0,-29 -5.99712,0 c -5.43151,0 -6.3569,0.32504 -9.81192,3.44645 -9.32504,8.42461 -14.57108,27.39771 -11.07476,40.05355 2.20142,7.96861 12.06488,14.25714 22.6338,14.43035 L 213,344 l 0,-29 z m 391.80719,15.4817 c 6.62585,-7.52736 7.54952,-16.0397 2.37321,-21.8711 -2.31327,-2.60603 -9.05873,-5.56684 -12.6804,-5.56587 l -3,8.1e-4 3.27735,1.61538 c 4.41178,2.17453 7.93547,6.55885 9.27777,11.54378 1.72885,6.42046 0.67127,9.85563 -5.75749,18.70114 -1.71731,2.3629 -1.71062,2.38555 0.3748,1.26947 1.16782,-0.625 3.92847,-3.18712 6.13476,-5.69361 z m -38.4549,-40.9475 C 562.29045,286.68918 548,284.71586 548,287 c 0,0.55 2.5875,1.0254 5.75,1.05644 3.1625,0.031 7.325,0.65236 9.25,1.38069 4.78003,1.80856 5.83958,1.83924 3.35229,0.0971 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3496"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#6b6b6b"
+       d="m 459.22834,733.75 -8.09513,-17.25 -86.3166,0.0346 -86.31661,0.0345 -10.14697,3.13761 c -16.26336,5.02889 -29.13844,6.73034 -50.85303,6.72026 -20.69189,-0.01 -29.15661,-1.01275 -46.12094,-5.46575 C 120.07239,707.49364 78.019759,666.03521 58.827476,610 47.62171,577.28282 43.641358,544.37167 44.195065,489.01336 44.456981,462.82766 44.711615,458.49767 46,458.32085 c 0.825,-0.11322 5.872844,-0.49763 11.217431,-0.85424 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546499,231.64403 67.549796,231.4853 69.819464,220 73.774871,199.98428 80.063669,183.6054 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 140.41309,111.1255 163.09172,99.004905 198,90.732478 L 211.5,87.5333 336.24265,87.244077 460.9853,86.954853 477.24265,77.669252 c 8.94154,-5.10708 19.68415,-11.150244 23.87247,-13.429253 l 7.61512,-4.143652 8.09725,13.300469 8.09725,13.300469 13.28763,0.608954 c 34.37711,1.575455 58.69187,9.838585 88.28763,30.003671 6.95606,4.73952 8.18067,5.81183 21.91562,19.19009 23.6284,23.01478 37.35489,49.43293 45.20397,87 1.78953,8.56503 1.89473,17.02279 2.17675,175 l 0.29633,166 -2.19468,13.5 c -2.56326,15.76723 -9.7616,38.13244 -15.44902,48 -2.06054,3.575 -4.89103,8.525 -6.28998,11 -8.27797,14.64523 -26.57348,34.51131 -43.15899,46.86395 -11.00819,8.19874 -29.57261,17.79409 -45,23.25904 -6.94294,2.45945 -30.43094,7.52908 -39,8.41773 -5.49071,0.56942 -8.20802,1.64802 -17.5,6.9464 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 499.03892,737.53906 469.03807,751 467.95706,751 c -0.34848,0 -4.27641,-7.7625 -8.72872,-17.25 z m 43.68862,-35.88213 c 44.7863,-23.26074 76.28814,-49.52132 97.60919,-81.36901 33.3498,-49.81528 36.38684,-109.55048 8.34589,-164.1543 C 591.5991,418.70917 565.35698,389.12596 521,353.28488 c -11.02571,-8.90894 -24.26935,-21.62782 -30.63214,-29.41841 -1.17268,-1.43582 -3.84788,-6.08214 -5.94489,-10.32516 -6.97128,-14.10542 -4.98817,-24.41746 7.57161,-39.37188 10.94865,-13.03611 31.08945,-28.56312 58.70263,-45.25522 7.95709,-4.81003 14.67646,-8.95455 14.93195,-9.21003 C 566.3399,218.99343 497.56079,106 496.41741,106 c -0.2145,0 -4.02829,2.01247 -8.47508,4.47217 -10.16823,5.62443 -24.6612,15.61468 -36.90189,25.4371 -10.24214,8.2187 -32.8094,28.71706 -35.11695,31.89753 -0.78292,1.07909 -4.96647,5.9515 -9.29678,10.82759 -14.48057,16.30566 -32.41863,45.69068 -39.29191,64.36561 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.42125,3.04745 -3.73396,12.00739 -5.67858,22 -2.16645,11.13256 -2.47545,40.51697 -0.5363,51 4.30061,23.24913 12.93032,44.22048 26.54174,64.5 15.71971,23.42062 31.11483,39.39909 59.56341,61.82034 25.56911,20.15186 46.41409,41.99196 53.57387,56.13144 7.64016,15.08817 7.21744,27.47976 -1.39183,40.79998 -9.13922,14.14015 -32.11471,31.34958 -58.58205,43.87996 -3.3,1.56231 -6.14252,2.91432 -6.31671,3.00447 C 430.3763,595.0538 483.68257,707 484.68841,707 c 0.35503,0 8.55788,-4.10946 18.22855,-9.13213 z M 229.5,691.9582 c 35.96389,-2.65534 62.74811,-14.87788 87.16413,-39.77592 19.84355,-20.2353 34.27542,-47.15111 41.22124,-76.87869 5.15259,-22.0527 5.38776,-25.8151 5.83208,-93.30359 l 0.41805,-63.5 -6.44389,-9.61886 c -18.09402,-27.00909 -29.2607,-56.37493 -32.71898,-86.04346 -1.60438,-13.76399 -0.78809,-44.23477 1.49585,-55.83768 5.25749,-26.70911 15.64967,-52.47437 31.00464,-76.86959 C 362.93744,181.44897 364,179.04771 364,175.38041 364,172.09312 363.61372,171 362.45209,171 c -0.85136,0 -26.83886,-2.92478 -57.75,-6.49952 -30.91115,-3.57474 -56.53959,-6.49974 -56.95209,-6.5 -0.4125,-2.6e-4 -0.75891,84.26202 -0.76981,187.24952 -0.0126,119.29265 -0.38246,189.79046 -1.01905,194.25 -2.38,16.67255 -7.27732,28.74165 -14.81546,36.51169 -6.49527,6.69509 -16.44794,8.97799 -24.49062,5.61754 -6.67008,-2.78693 -13.12828,-17.16269 -16.15212,-35.95414 -1.73989,-10.81241 -3.48133,-37.46471 -3.494,-53.47475 L 187,480.90069 l -5.75,0.57866 c -3.1625,0.31826 -23.975,1.95021 -46.25,3.62656 -57.469757,4.325 -57.792007,4.35276 -58.477817,5.03857 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32672 15,-0.89523 z m 137.22743,-6.94549 C 375.55179,676.92679 383.53321,673 391.14395,673 c 5.02398,0 6.27334,0.40133 9.09027,2.92008 3.02015,2.70044 3.26314,3.37736 3.23071,9 l -0.0351,6.07992 17.75232,0 17.75231,0 -4.30783,-9.25 c -2.36931,-5.0875 -13.4834,-28.79652 -24.69797,-52.68671 -19.5931,-41.7388 -20.42583,-43.30237 -21.30326,-40 -5.2147,19.62664 -15.40286,43.85395 -24.30234,57.79069 -8.02041,12.56008 -19.59438,26.09897 -31.96869,37.39602 l -7.39366,6.75 17.61631,0 17.61631,0 6.53407,-5.98729 z m 26.72629,2.23729 c -0.85705,-5.04618 -3.58278,-8.68209 -6.79636,-9.06582 -3.44617,-0.4115 -11.41701,3.96126 -16.25838,8.91927 L 366.5941,691 l 13.74827,0 13.74826,0 -0.63691,-3.75 z m 5.93929,2.16821 C 401.39724,684.19527 398.15412,677 393.79575,677 c -1.74921,0 -1.73494,0.16324 0.24888,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z M 603,670.67319 c 10.92298,-6.47058 16.55462,-10.87301 26.83672,-20.97915 8.60031,-8.45311 16.89792,-18.83214 21.3408,-26.69404 1.39867,-2.475 3.75061,-6.60393 5.22656,-9.17541 4.2494,-7.40356 10.45573,-26.80583 12.61533,-39.43815 1.91765,-11.21702 1.98041,-16.65874 1.9748,-171.23581 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -0.73543,-4.4 -3.35584,-13.69942 -5.82314,-20.66537 C 650.37345,170.76148 626.23997,144.082 591.83724,125.56449 584.8009,121.77713 563.59513,115.31771 554,114.03902 c -4.675,-0.62301 -9.5125,-1.27426 -10.75,-1.44721 -1.2375,-0.17296 -2.25,-0.15504 -2.25,0.0398 0,0.19485 16.03453,26.79495 35.63229,59.11133 19.59777,32.31638 35.79599,59.0487 35.99605,59.40516 0.20007,0.35647 -8.55692,5.60328 -19.45996,11.6596 -41.36722,22.97826 -69.39408,42.73125 -76.1577,53.67502 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 0.79682,1.54088 2.47218,3.70053 3.72304,4.79923 1.25085,1.0987 1.99589,1.5169 1.65565,0.92934 -0.97132,-1.6774 3.59962,-10.47612 8.03429,-15.4654 5.59925,-6.29952 12.93712,-10.09198 20.73811,-10.71817 13.06621,-1.04883 22.21069,3.47808 27.20172,13.466 l 2.93412,5.87171 3.9333,-1.7667 c 9.45658,-4.24755 22.33372,-0.54232 28.15949,8.10254 2.99148,4.43905 3.10162,12.73683 0.24733,18.633 -2.71213,5.60252 -9.31383,11.97546 -15.58224,15.04231 -6.53631,3.19791 -15.65148,3.47281 -21.36818,0.64441 l -3.88221,-1.92077 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.56262,2.40044 6.87956,4.20528 10.05845,4.20528 2.60643,0 12.58535,-9.79425 15.12051,-14.84069 3.14463,-6.25965 -0.37564,-14.99227 -7.53637,-18.69523 -3.2167,-1.66342 -11.49822,-1.9726 -12.43054,-0.46408 -1.12374,1.81824 -2.45473,1.04309 -3.86342,-2.25 -3.57612,-8.35987 -12.67467,-12.88214 -27.24555,-13.54189 l -10.10897,-0.45773 -4.10475,3.70839 C 530.47296,296.80543 524,307.61314 524,310.45151 c 0,1.59782 6.77587,7.87073 19,17.58969 34.55561,27.47389 62.07522,56.16917 80.9004,84.35655 3.71078,5.55624 7.8242,12.04162 9.14093,14.41195 1.94772,3.50622 2.77296,4.18565 4.42637,3.64432 1.11776,-0.36596 4.98089,-0.88859 8.58473,-1.16139 6.00644,-0.45467 6.81604,-0.27418 9.716,2.16597 3.83203,3.22445 4.82738,7.536 3.34039,14.46961 -1.3909,6.48553 -7.07439,18.2111 -8.42307,17.37758 -0.65363,-0.40397 -0.75084,0.0603 -0.26802,1.28017 8.5476,21.59481 12.45232,55.28703 9.52686,82.20345 -2.41676,22.23601 -8.23754,42.01777 -18.45258,62.71059 -10.41322,21.09427 -22.45951,37.86115 -41.67918,58.01201 -5.67206,5.94687 -9.18783,10.22388 -7.81283,9.50446 1.375,-0.71941 6.325,-3.57389 11,-6.34328 z m 48.03399,-72.13223 c -2.55122,-3.07403 0.82683,-9.48994 6.46601,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.96601,9.39189 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39982,565.60558 c 11.80825,-5.71692 25.39603,-12.95382 30.19506,-16.08199 9.47005,-6.17289 19.27841,-14.96447 22.48675,-20.15567 1.92768,-3.11906 1.94351,-3.42125 0.34392,-6.56869 -5.81961,-11.45101 -21.18382,-27.4807 -42.92555,-44.78481 -7.15,-5.69064 -16.4875,-13.45837 -20.75,-17.26162 l -7.75,-6.915 0,41.15901 c 0,39.56945 -0.79755,56.59434 -3.43165,73.25319 -0.67398,4.2625 -0.86827,7.75 -0.43175,7.75 0.43652,0 10.45497,-4.67749 22.26322,-10.39442 z m -7.36583,-53.06462 c -2.55122,-3.07403 0.82683,-9.48994 6.46601,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.96601,9.39189 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z m 235.97904,-60.02801 c 0.0835,-9.12279 -2.07635,-12.51896 -8.06602,-12.68287 l -3.99458,-0.10932 5.10444,10.80689 c 2.99402,6.3388 5.4739,10.43841 5.99807,9.91567 0.4915,-0.49016 0.92264,-4.05883 0.95809,-7.93037 z M 154.8842,449.97568 C 184.2455,447.78906 209.333,446 210.6342,446 l 2.3658,0 0,-49 0,-49 -4.46505,0 c -8.57235,0 -18.37685,-4.6863 -23.04648,-11.01562 -7.35329,-9.96684 -4.49469,-33.20635 5.66569,-46.0602 4.60392,-5.82439 11.45573,-10.53041 17.59584,-12.08534 l 4.25,-1.07627 0,-78.49483 0,-78.49483 4.25,0.59799 c 2.3375,0.32889 43.3354,4.91936 91.10643,10.20104 l 86.85644,9.60307 10.64356,-10.38004 c 5.85397,-5.70902 12.86017,-12.28726 15.56935,-14.61831 l 4.92578,-4.23826 -105.42578,0.29361 c -105.24487,0.2931 -105.44294,0.29748 -115.42578,2.54804 -16.11517,3.63306 -25.65068,7.07162 -40,14.42424 -16.62638,8.5194 -39.85374,29.18134 -49.00299,43.59069 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37735,8.36231 -11.328101,24.33561 -14.463508,38.82367 -1.990639,9.19833 -2.06849,13.03397 -2.451627,120.78985 l -0.395702,111.28986 4.790799,-0.56418 c 2.634939,-0.31029 28.813688,-2.35323 58.174998,-4.53985 z M 97.033993,392.54096 c -2.551219,-3.07403 0.826823,-9.48994 6.466007,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.966007,9.39189 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.40571,-6.29587 -13.1506,-23.67878 0.60286,-41.07821 5.10487,-6.45815 11.06833,-9.4152 18.97574,-9.40932 8.80349,0.007 17.87624,5.9952 19.62231,12.95209 2.66485,10.61762 -7.09273,28.87176 -19.23769,35.98918 -5.97025,3.4988 -14.41324,4.15276 -19.96322,1.54626 z m 16.40157,-3.072 c 3.31,-1.77145 10.26099,-16.92914 10.87659,-23.71802 1.04436,-11.51743 -4.4401,-17.79247 -14.96068,-17.11725 -4.88801,0.31372 -6.27077,0.86372 -9.12389,3.62908 -4.48777,4.34972 -8.39976,12.32221 -9.71772,19.80436 -0.95516,5.42256 -0.84564,6.63539 0.96984,10.73957 1.60514,3.62869 2.97263,5.05974 6.33974,6.63442 4.4898,2.09972 11.72069,2.11261 15.61612,0.0278 z m 17.11229,-19.65126 c 4.06898,-10.87531 2.2831,-18.21385 -5.30919,-21.81663 -5.07391,-2.40773 -6.5698,-1.95444 -2.95456,0.89529 5.80522,4.57599 7.84897,15.46921 4.76252,25.38423 -1.49573,4.80494 1.42811,1.07803 3.50123,-4.46289 z m 486.75438,221.52925 c 0.51656,-4.36159 0.28525,-5.37055 -1.72074,-7.50584 C 652.69426,434.1101 650.81634,433 649.79575,433 c -1.72736,0 -1.70245,0.20718 0.3603,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51334,7.09689 1.89983,6.05118 2.87315,-2.16697 z M 213,315 l 0,-29 -5.99712,0 c -5.43151,0 -6.3569,0.32504 -9.81192,3.44645 -9.32504,8.42461 -14.57108,27.39771 -11.07476,40.05355 2.20142,7.96861 12.06488,14.25714 22.6338,14.43035 L 213,344 l 0,-29 z m 391.80719,15.4817 c 6.62585,-7.52736 7.54952,-16.0397 2.37321,-21.8711 -2.31327,-2.60603 -9.05873,-5.56684 -12.6804,-5.56587 l -3,8.1e-4 3.27735,1.61538 c 4.41178,2.17453 7.93547,6.55885 9.27777,11.54378 1.72885,6.42046 0.67127,9.85563 -5.75749,18.70114 -1.71731,2.3629 -1.71062,2.38555 0.3748,1.26947 1.16782,-0.625 3.92847,-3.18712 6.13476,-5.69361 z m -38.4549,-40.9475 C 562.29045,286.68918 548,284.71586 548,287 c 0,0.55 2.5875,1.0254 5.75,1.05644 3.1625,0.031 7.325,0.65236 9.25,1.38069 4.78003,1.80856 5.83958,1.83924 3.35229,0.0971 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3494"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#937a32"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.88213 c 44.7863,-23.26074 76.28814,-49.52132 97.60919,-81.36901 33.3498,-49.81528 36.38684,-109.55048 8.34589,-164.1543 C 591.5991,418.70917 565.35698,389.12596 521,353.28488 c -11.02571,-8.90894 -24.26935,-21.62782 -30.63214,-29.41841 -1.17268,-1.43582 -3.84788,-6.08214 -5.94489,-10.32516 -6.97128,-14.10542 -4.98817,-24.41746 7.57161,-39.37188 10.94865,-13.03611 31.08945,-28.56312 58.70263,-45.25522 7.95709,-4.81003 14.67646,-8.95455 14.93195,-9.21003 C 566.3399,218.99343 497.56079,106 496.41741,106 c -0.2145,0 -4.02829,2.01247 -8.47508,4.47217 -10.16823,5.62443 -24.6612,15.61468 -36.90189,25.4371 -10.24214,8.2187 -32.8094,28.71706 -35.11695,31.89753 -0.78292,1.07909 -4.96647,5.9515 -9.29678,10.82759 -14.48057,16.30566 -32.41863,45.69068 -39.29191,64.36561 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.71971,23.42062 31.11483,39.39909 59.56341,61.82034 25.56911,20.15186 46.41409,41.99196 53.57387,56.13144 7.64016,15.08817 7.21744,27.47976 -1.39183,40.79998 -9.13922,14.14015 -32.11471,31.34958 -58.58205,43.87996 -3.3,1.56231 -6.14252,2.91432 -6.31671,3.00447 C 430.3763,595.0538 483.68257,707 484.68841,707 c 0.35503,0 8.55788,-4.10946 18.22855,-9.13213 z M 229.5,691.9582 c 35.96389,-2.65534 62.74811,-14.87788 87.16413,-39.77592 19.84355,-20.2353 34.27542,-47.15111 41.22124,-76.87869 5.15525,-22.06411 5.38843,-25.80213 5.82017,-93.30359 l 0.40615,-63.5 -7.57003,-11.41563 C 334.46572,373.79382 323.97331,339.36703 324.01832,300.37166 324.06372,261.0434 334.65198,226.47921 358.01385,189.39717 363.00723,181.47122 364,179.15779 364,175.4477 364,172.09967 363.61729,171 362.45209,171 c -0.85136,0 -26.83886,-2.92478 -57.75,-6.49952 -30.91115,-3.57474 -56.53959,-6.49974 -56.95209,-6.5 -0.4125,-2.6e-4 -0.75891,84.26202 -0.76981,187.24952 -0.0126,119.29265 -0.38246,189.79046 -1.01905,194.25 -2.38,16.67255 -7.27732,28.74165 -14.81546,36.51169 -6.49527,6.69509 -16.44794,8.97799 -24.49062,5.61754 -6.67008,-2.78693 -13.12828,-17.16269 -16.15212,-35.95414 -1.73989,-10.81241 -3.48133,-37.46471 -3.494,-53.47475 L 187,480.90069 l -5.75,0.57866 c -3.1625,0.31826 -23.975,1.95021 -46.25,3.62656 -57.469757,4.325 -57.792007,4.35276 -58.477817,5.03857 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.32672 15,-0.89523 z m 137.22743,-6.94549 C 375.55179,676.92679 383.53321,673 391.14395,673 c 5.02398,0 6.27334,0.40133 9.09027,2.92008 3.02015,2.70044 3.26314,3.37736 3.23071,9 l -0.0351,6.07992 17.75232,0 17.75231,0 -4.30783,-9.25 c -2.36931,-5.0875 -13.4834,-28.79652 -24.69797,-52.68671 -19.5931,-41.7388 -20.42583,-43.30237 -21.30326,-40 -5.2147,19.62664 -15.40286,43.85395 -24.30234,57.79069 -8.02041,12.56008 -19.59438,26.09897 -31.96869,37.39602 l -7.39366,6.75 17.61631,0 17.61631,0 6.53407,-5.98729 z m 26.72629,2.23729 c -0.85705,-5.04618 -3.58278,-8.68209 -6.79636,-9.06582 -3.44617,-0.4115 -11.41701,3.96126 -16.25838,8.91927 L 366.5941,691 l 13.74827,0 13.74826,0 -0.63691,-3.75 z m 5.93929,2.16821 C 401.39724,684.19527 398.15412,677 393.79575,677 c -1.74921,0 -1.73494,0.16324 0.24888,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z M 603,670.67319 c 10.92298,-6.47058 16.55462,-10.87301 26.83672,-20.97915 8.60031,-8.45311 16.89792,-18.83214 21.3408,-26.69404 1.39867,-2.475 3.75061,-6.60393 5.22656,-9.17541 4.2494,-7.40356 10.45573,-26.80583 12.61533,-39.43815 1.91765,-11.21702 1.98041,-16.65874 1.9748,-171.23581 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -0.73543,-4.4 -3.35584,-13.69942 -5.82314,-20.66537 C 650.37345,170.76148 626.23997,144.082 591.83724,125.56449 584.8009,121.77713 563.59513,115.31771 554,114.03902 c -4.675,-0.62301 -9.5125,-1.27426 -10.75,-1.44721 -1.2375,-0.17296 -2.25,-0.15504 -2.25,0.0398 0,0.19485 16.03453,26.79495 35.63229,59.11133 19.59777,32.31638 35.79599,59.0487 35.99605,59.40516 0.20007,0.35647 -8.55692,5.60328 -19.45996,11.6596 -41.36722,22.97826 -69.39408,42.73125 -76.1577,53.67502 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 0.79682,1.54088 2.47218,3.70053 3.72304,4.79923 1.25085,1.0987 1.99589,1.5169 1.65565,0.92934 -0.97132,-1.6774 3.59962,-10.47612 8.03429,-15.4654 5.59925,-6.29952 12.93712,-10.09198 20.73811,-10.71817 13.06621,-1.04883 22.21069,3.47808 27.20172,13.466 l 2.93412,5.87171 3.9333,-1.7667 c 9.45658,-4.24755 22.33372,-0.54232 28.15949,8.10254 2.99148,4.43905 3.10162,12.73683 0.24733,18.633 -2.71213,5.60252 -9.31383,11.97546 -15.58224,15.04231 -6.53631,3.19791 -15.65148,3.47281 -21.36818,0.64441 l -3.88221,-1.92077 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.56262,2.40044 6.87956,4.20528 10.05845,4.20528 2.60643,0 12.58535,-9.79425 15.12051,-14.84069 3.14463,-6.25965 -0.37564,-14.99227 -7.53637,-18.69523 -3.2167,-1.66342 -11.49822,-1.9726 -12.43054,-0.46408 -1.12374,1.81824 -2.45473,1.04309 -3.86342,-2.25 -3.57612,-8.35987 -12.67467,-12.88214 -27.24555,-13.54189 l -10.10897,-0.45773 -4.10475,3.70839 C 530.47296,296.80543 524,307.61314 524,310.45151 c 0,1.59782 6.77587,7.87073 19,17.58969 34.55561,27.47389 62.07522,56.16917 80.9004,84.35655 3.71078,5.55624 7.8242,12.04162 9.14093,14.41195 1.94772,3.50622 2.77296,4.18565 4.42637,3.64432 1.11776,-0.36596 4.98089,-0.88859 8.58473,-1.16139 6.00644,-0.45467 6.81604,-0.27418 9.716,2.16597 3.83203,3.22445 4.82738,7.536 3.34039,14.46961 -1.3909,6.48553 -7.07439,18.2111 -8.42307,17.37758 -0.65363,-0.40397 -0.75084,0.0603 -0.26802,1.28017 8.5476,21.59481 12.45232,55.28703 9.52686,82.20345 -2.41676,22.23601 -8.23754,42.01777 -18.45258,62.71059 -10.41322,21.09427 -22.45951,37.86115 -41.67918,58.01201 -5.67206,5.94687 -9.18783,10.22388 -7.81283,9.50446 1.375,-0.71941 6.325,-3.57389 11,-6.34328 z m 48.03399,-72.13223 c -2.55122,-3.07403 0.82683,-9.48994 6.46601,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.96601,9.39189 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39982,565.60558 c 11.80825,-5.71692 25.39603,-12.95382 30.19506,-16.08199 9.47005,-6.17289 19.27841,-14.96447 22.48675,-20.15567 1.92768,-3.11906 1.94351,-3.42125 0.34392,-6.56869 -5.81961,-11.45101 -21.18382,-27.4807 -42.92555,-44.78481 -7.15,-5.69064 -16.4875,-13.45837 -20.75,-17.26162 l -7.75,-6.915 0,41.15901 c 0,39.56945 -0.79755,56.59434 -3.43165,73.25319 -0.67398,4.2625 -0.86827,7.75 -0.43175,7.75 0.43652,0 10.45497,-4.67749 22.26322,-10.39442 z m -7.36583,-53.06462 c -2.55122,-3.07403 0.82683,-9.48994 6.46601,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.96601,9.39189 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z m 235.97904,-60.02801 c 0.0835,-9.12279 -2.07635,-12.51896 -8.06602,-12.68287 l -3.99458,-0.10932 5.10444,10.80689 c 2.99402,6.3388 5.4739,10.43841 5.99807,9.91567 0.4915,-0.49016 0.92264,-4.05883 0.95809,-7.93037 z M 154.8842,449.97568 C 184.2455,447.78906 209.333,446 210.6342,446 l 2.3658,0 0,-49 0,-49 -4.46505,0 c -8.57235,0 -18.37685,-4.6863 -23.04648,-11.01562 -7.35329,-9.96684 -4.49469,-33.20635 5.66569,-46.0602 4.60392,-5.82439 11.45573,-10.53041 17.59584,-12.08534 l 4.25,-1.07627 0,-78.49483 0,-78.49483 4.25,0.59799 c 2.3375,0.32889 43.3354,4.91936 91.10643,10.20104 l 86.85644,9.60307 10.64356,-10.38004 c 5.85397,-5.70902 12.86017,-12.28726 15.56935,-14.61831 l 4.92578,-4.23826 -105.42578,0.29361 c -105.24487,0.2931 -105.44294,0.29748 -115.42578,2.54804 -16.11517,3.63306 -25.65068,7.07162 -40,14.42424 -16.62638,8.5194 -39.85374,29.18134 -49.00299,43.59069 -2.19836,3.46225 -5.46885,8.58385 -7.26777,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996484,9.20672 -2.072052,12.93571 -2.4478,120.78935 l -0.387717,111.28934 4.786971,-0.56366 c 2.632835,-0.31002 28.809862,-2.35273 58.171172,-4.53935 z M 97.033993,392.54096 c -2.551219,-3.07403 0.826823,-9.48994 6.466007,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.966007,9.39189 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.40571,-6.29587 -13.1506,-23.67878 0.60286,-41.07821 5.10487,-6.45815 11.06833,-9.4152 18.97574,-9.40932 8.80349,0.007 17.87624,5.9952 19.62231,12.95209 2.66485,10.61762 -7.09273,28.87176 -19.23769,35.98918 -5.97025,3.4988 -14.41324,4.15276 -19.96322,1.54626 z m 16.40157,-3.072 c 3.31,-1.77145 10.26099,-16.92914 10.87659,-23.71802 1.04436,-11.51743 -4.4401,-17.79247 -14.96068,-17.11725 -4.88801,0.31372 -6.27077,0.86372 -9.12389,3.62908 -4.48777,4.34972 -8.39976,12.32221 -9.71772,19.80436 -0.95516,5.42256 -0.84564,6.63539 0.96984,10.73957 1.60514,3.62869 2.97263,5.05974 6.33974,6.63442 4.4898,2.09972 11.72069,2.11261 15.61612,0.0278 z m 17.11229,-19.65126 c 4.06898,-10.87531 2.2831,-18.21385 -5.30919,-21.81663 -5.07391,-2.40773 -6.5698,-1.95444 -2.95456,0.89529 5.80522,4.57599 7.84897,15.46921 4.76252,25.38423 -1.49573,4.80494 1.42811,1.07803 3.50123,-4.46289 z m 486.75438,221.52925 c 0.51656,-4.36159 0.28525,-5.37055 -1.72074,-7.50584 C 652.69426,434.1101 650.81634,433 649.79575,433 c -1.72736,0 -1.70245,0.20718 0.3603,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51334,7.09689 1.89983,6.05118 2.87315,-2.16697 z M 213,315 l 0,-29 -5.99712,0 c -5.43151,0 -6.3569,0.32504 -9.81192,3.44645 -9.32504,8.42461 -14.57108,27.39771 -11.07476,40.05355 2.20142,7.96861 12.06488,14.25714 22.6338,14.43035 L 213,344 l 0,-29 z m 391.80719,15.4817 c 6.62585,-7.52736 7.54952,-16.0397 2.37321,-21.8711 -2.31327,-2.60603 -9.05873,-5.56684 -12.6804,-5.56587 l -3,8.1e-4 3.27735,1.61538 c 4.41178,2.17453 7.93547,6.55885 9.27777,11.54378 1.72885,6.42046 0.67127,9.85563 -5.75749,18.70114 -1.71731,2.3629 -1.71062,2.38555 0.3748,1.26947 1.16782,-0.625 3.92847,-3.18712 6.13476,-5.69361 z m -38.4549,-40.9475 C 562.29045,286.68918 548,284.71586 548,287 c 0,0.55 2.5875,1.0254 5.75,1.05644 3.1625,0.031 7.325,0.65236 9.25,1.38069 4.78003,1.80856 5.83958,1.83924 3.35229,0.0971 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3492"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#8c783a"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.85773 C 570.00946,663.13946 610.81659,618.06345 623.47965,564.71742 635.85915,512.56594 622.13854,461.47079 582.55521,412.316 568.02632,394.27394 548.21503,375.27502 521,353.28488 c -11.02571,-8.90894 -24.26935,-21.62782 -30.63214,-29.41841 -1.17268,-1.43582 -3.84788,-6.08214 -5.94489,-10.32516 -6.97128,-14.10542 -4.98817,-24.41746 7.57161,-39.37188 10.98237,-13.07627 30.86203,-28.40084 58.02535,-44.72983 7.96404,-4.78751 14.84762,-9.035 15.29685,-9.43886 C 566.2724,219.14162 497.9179,106 496.44324,106 c -0.2003,0 -4.09447,2.04884 -8.65371,4.55299 -24.86204,13.65536 -59.07069,42.25905 -81.2614,67.94701 -14.82852,17.16549 -32.43767,46.14467 -39.19333,64.5 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.7819,23.51329 31.25674,39.57164 59.57395,61.82034 20.04013,15.74543 40.54133,36.08541 48.75943,48.37599 15.34912,22.95535 13.38967,40.804 -6.64042,60.48772 -10.31301,10.13468 -30.43465,23.38103 -48.52956,31.94767 -3.3,1.56231 -6.13984,2.91164 -6.31074,2.9985 C 430.34322,595.06021 483.64252,707 484.69329,707 c 0.35235,0 8.553,-4.09848 18.22367,-9.10773 z m -262.87281,-6.94064 c 30.2528,-3.33702 59.13081,-18.76656 80.80601,-43.17471 21.78757,-24.53469 34.60453,-53.08104 40.75774,-90.77692 1.45592,-8.91931 1.77336,-20.13467 2.10859,-74.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.4521,158 247.95093,158 c -0.5441,0 -1.02831,77.25195 -1.20188,191.75 l -0.29067,191.75 -2.25008,8.4008 c -4.56631,17.04862 -13.111,29.64181 -21.7083,31.99377 -10.49437,2.87094 -17.6131,0.721 -22.42096,-6.77139 -8.33866,-12.99468 -13.01185,-42.83419 -13.06492,-83.42284 L 187,480.90069 l -5.75,0.57866 c -3.1625,0.31826 -23.975,1.95021 -46.25,3.62656 -57.469757,4.325 -57.792007,4.35276 -58.477817,5.03857 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 6.63848,9.83842 20.64192,24.23566 30.39905,31.25391 27.10572,19.49702 58.07351,26.26876 99.32226,21.71883 z m 126.68328,-5.93892 C 375.55179,676.92679 383.53321,673 391.14395,673 c 5.02398,0 6.27334,0.40133 9.09027,2.92008 3.02015,2.70044 3.26314,3.37736 3.23071,9 l -0.0351,6.07992 17.75232,0 17.75231,0 -4.29685,-9.25 c -2.36327,-5.0875 -13.47716,-28.79719 -24.69754,-52.6882 -19.60788,-41.7501 -20.43619,-43.30459 -21.31424,-40 -10.54832,39.69946 -29.25027,70.90317 -57.95645,96.69878 L 324.83883,691 l 17.67726,0 17.67727,0 6.53407,-5.98729 z m 26.72629,2.23729 c -0.85705,-5.04618 -3.58278,-8.68209 -6.79636,-9.06582 -3.44617,-0.4115 -11.41701,3.96126 -16.25838,8.91927 L 366.5941,691 l 13.74827,0 13.74826,0 -0.63691,-3.75 z m 5.93929,2.16821 C 401.39724,684.19527 398.15412,677 393.79575,677 c -1.74921,0 -1.73494,0.16324 0.24888,2.84649 1.15748,1.56558 2.3552,4.71558 2.66161,7 0.57687,4.30094 1.63467,5.31344 2.68677,2.57172 z M 603,670.67319 c 4.675,-2.76938 10.75,-6.77841 13.5,-8.90894 7.98708,-6.18788 21.0833,-19.44023 26.83308,-27.15295 4.97432,-6.67252 6.82523,-9.64987 13.74583,-22.1113 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -0.73543,-4.4 -3.35584,-13.69942 -5.82314,-20.66537 -6.91192,-19.51449 -17.92491,-36.1474 -34.23209,-51.70073 -12.98117,-12.38107 -17.38864,-15.53708 -35.62986,-25.51309 -7.4721,-4.08645 -27.60958,-10.22119 -37.87163,-11.53732 -5.225,-0.67011 -10.2875,-1.37091 -11.25,-1.55732 -0.9625,-0.18641 -1.75,-0.16322 -1.75,0.0515 0,0.21475 16.02752,26.83513 35.61671,59.15638 19.58919,32.32125 35.79045,59.06247 36.00279,59.42494 0.21235,0.36246 -6.02767,4.16346 -13.86671,8.44666 -43.95453,24.01645 -74.65115,45.40361 -81.8234,57.00856 -1.8445,2.98447 -1.8982,3.54538 -0.58291,6.08888 0.79682,1.54088 2.47218,3.70053 3.72304,4.79923 1.25085,1.0987 1.99589,1.5169 1.65565,0.92934 -0.97132,-1.6774 3.59962,-10.47612 8.03429,-15.4654 5.59925,-6.29952 12.93712,-10.09198 20.73811,-10.71817 13.06621,-1.04883 22.21069,3.47808 27.20172,13.466 l 2.93412,5.87171 3.9333,-1.7667 c 9.45658,-4.24755 22.33372,-0.54232 28.15949,8.10254 2.99148,4.43905 3.10162,12.73683 0.24733,18.633 -2.71213,5.60252 -9.31383,11.97546 -15.58224,15.04231 -6.53631,3.19791 -15.65148,3.47281 -21.36818,0.64441 l -3.88221,-1.92077 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.56262,2.40044 6.87956,4.20528 10.05845,4.20528 2.60643,0 12.58535,-9.79425 15.12051,-14.84069 3.14463,-6.25965 -0.37564,-14.99227 -7.53637,-18.69523 -3.2167,-1.66342 -11.49822,-1.9726 -12.43054,-0.46408 -1.12374,1.81824 -2.45473,1.04309 -3.86342,-2.25 -3.57612,-8.35987 -12.67467,-12.88214 -27.24555,-13.54189 l -10.10897,-0.45773 -4.10475,3.70839 C 530.42829,296.84579 524,307.62399 524,310.52288 c 0,1.63549 6.68841,7.6529 24.98351,22.47712 19.43743,15.74983 42.24448,37.83683 55.71086,53.95199 9.9066,11.85519 23.2161,30.56239 28.35733,39.85771 1.94005,3.5076 2.76193,4.18587 4.416,3.64432 1.11776,-0.36596 4.98089,-0.88859 8.58473,-1.16139 6.00644,-0.45467 6.81604,-0.27418 9.716,2.16597 3.83203,3.22445 4.82738,7.536 3.34039,14.46961 -1.30046,6.0638 -7.04383,18.22999 -8.25313,17.4826 -1.15478,-0.71369 -1.10036,-0.349 0.7033,4.71346 5.43681,15.25983 9.44101,39.845 9.44101,57.96636 0,53.19472 -20.4168,99.50551 -63.38363,143.77107 -8.55091,8.80938 -8.20549,8.86145 5.38363,0.81149 z m 48.03399,-72.13223 c -2.55122,-3.07403 0.82683,-9.48994 6.46601,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.96601,9.39189 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39982,565.60558 c 11.80825,-5.71692 25.39603,-12.95382 30.19506,-16.08199 9.46668,-6.17069 19.27819,-14.96411 22.48363,-20.15062 l 2.01752,-3.26442 -2.18972,-4.30427 c -5.60364,-11.01494 -21.16081,-26.90942 -45.14124,-46.11999 -8.10422,-6.49223 -17.21672,-14.07226 -20.25,-16.84451 L 396,453.79931 l 0,40.54588 c 0,39.30879 -0.8542,57.75589 -3.42151,73.89002 -0.67956,4.27063 -0.87841,7.76479 -0.44189,7.76479 0.43652,0 10.45497,-4.67749 22.26322,-10.39442 z m -7.36583,-53.06462 c -2.55122,-3.07403 0.82683,-9.48994 6.46601,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.96601,9.39189 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 649.35382,446.8456 c 0.0814,-8.88955 -2.1291,-12.29277 -8.08976,-12.45473 l -4.01623,-0.10912 4.86171,10.10912 c 2.67394,5.56002 4.88186,10.78413 4.90649,11.60913 0.0329,1.10081 0.3416,0.98861 1.1601,-0.4216 0.61343,-1.05688 1.14338,-4.98664 1.17769,-8.7328 z m -493.89735,3.1116 C 184.58253,447.78074 209.44503,446 210.70647,446 l 2.29353,0 0,-49 0,-49 -4.46505,0 c -8.57235,0 -18.37685,-4.6863 -23.04648,-11.01562 -7.35329,-9.96684 -4.49469,-33.20635 5.66569,-46.0602 4.60392,-5.82439 11.45573,-10.53041 17.59584,-12.08534 l 4.25,-1.07627 0,-78.38128 C 213,156.27158 213.21319,121 213.47375,121 c 0.26056,0 34.34806,3.79919 75.75,8.44265 41.40194,4.64345 82.20392,9.1658 90.67108,10.04967 l 15.39482,1.60702 10.60518,-10.34812 C 411.72767,125.05974 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.39427,2.7942 -15.10077,3.60536 -24.5,7.34279 -11.75334,4.6735 -22.7589,10.67353 -32,17.44584 -10.37457,7.60297 -27.08888,24.68754 -32.50621,33.2263 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.55588 c 2.907815,-0.30573 29.117355,-2.33662 58.243415,-4.51308 z M 97.033993,392.54096 c -2.551219,-3.07403 0.826823,-9.48994 6.466007,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.966007,9.39189 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.40571,-6.29587 -13.1506,-23.67878 0.60286,-41.07821 5.10487,-6.45815 11.06833,-9.4152 18.97574,-9.40932 8.80349,0.007 17.87624,5.9952 19.62231,12.95209 2.66485,10.61762 -7.09273,28.87176 -19.23769,35.98918 -5.97025,3.4988 -14.41324,4.15276 -19.96322,1.54626 z m 16.40157,-3.072 c 3.31,-1.77145 10.26099,-16.92914 10.87659,-23.71802 1.04436,-11.51743 -4.4401,-17.79247 -14.96068,-17.11725 -4.88801,0.31372 -6.27077,0.86372 -9.12389,3.62908 -4.48777,4.34972 -8.39976,12.32221 -9.71772,19.80436 -0.95516,5.42256 -0.84564,6.63539 0.96984,10.73957 1.60514,3.62869 2.97263,5.05974 6.33974,6.63442 4.4898,2.09972 11.72069,2.11261 15.61612,0.0278 z m 17.11229,-19.65126 c 4.06898,-10.87531 2.2831,-18.21385 -5.30919,-21.81663 -5.07391,-2.40773 -6.5698,-1.95444 -2.95456,0.89529 5.80522,4.57599 7.84897,15.46921 4.76252,25.38423 -1.49573,4.80494 1.42811,1.07803 3.50123,-4.46289 z m 486.75438,221.52925 c 0.51656,-4.36159 0.28525,-5.37055 -1.72074,-7.50584 C 652.69426,434.1101 650.81634,433 649.79575,433 c -1.72736,0 -1.70245,0.20718 0.3603,2.9972 1.53528,2.07658 2.35246,4.88479 2.66044,9.1425 0.51334,7.09689 1.89983,6.05118 2.87315,-2.16697 z M 213,315 l 0,-29 -5.99712,0 c -5.43151,0 -6.3569,0.32504 -9.81192,3.44645 -9.32504,8.42461 -14.57108,27.39771 -11.07476,40.05355 2.20142,7.96861 12.06488,14.25714 22.6338,14.43035 L 213,344 l 0,-29 z m 391.80719,15.4817 c 6.62585,-7.52736 7.54952,-16.0397 2.37321,-21.8711 -2.31327,-2.60603 -9.05873,-5.56684 -12.6804,-5.56587 l -3,8.1e-4 3.27735,1.61538 c 4.41178,2.17453 7.93547,6.55885 9.27777,11.54378 1.72885,6.42046 0.67127,9.85563 -5.75749,18.70114 -1.71731,2.3629 -1.71062,2.38555 0.3748,1.26947 1.16782,-0.625 3.92847,-3.18712 6.13476,-5.69361 z m -38.4549,-40.9475 C 562.29045,286.68918 548,284.71586 548,287 c 0,0.55 2.5875,1.0254 5.75,1.05644 3.1625,0.031 7.325,0.65236 9.25,1.38069 4.78003,1.80856 5.83958,1.83924 3.35229,0.0971 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3490"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#827643"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.85773 C 570.00946,663.13946 610.81659,618.06345 623.47965,564.71742 635.85915,512.56594 622.13854,461.47079 582.55521,412.316 568.02632,394.27394 548.21503,375.27502 521,353.28488 c -11.02571,-8.90894 -24.26935,-21.62782 -30.63214,-29.41841 -1.17268,-1.43582 -3.84788,-6.08214 -5.94489,-10.32516 -6.97128,-14.10542 -4.98817,-24.41746 7.57161,-39.37188 10.98237,-13.07627 30.86203,-28.40084 58.02535,-44.72983 7.96404,-4.78751 14.84762,-9.035 15.29685,-9.43886 C 566.2724,219.14162 497.9179,106 496.44324,106 c -0.2003,0 -4.09447,2.04884 -8.65371,4.55299 -24.86204,13.65536 -59.07069,42.25905 -81.2614,67.94701 -14.82852,17.16549 -32.43767,46.14467 -39.19333,64.5 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.7819,23.51329 31.25674,39.57164 59.57395,61.82034 20.04013,15.74543 40.54133,36.08541 48.75943,48.37599 15.34912,22.95535 13.38967,40.804 -6.64042,60.48772 -10.31301,10.13468 -30.43465,23.38103 -48.52956,31.94767 -3.3,1.56231 -6.13984,2.91164 -6.31074,2.9985 C 430.34322,595.06021 483.64252,707 484.69329,707 c 0.35235,0 8.553,-4.09848 18.22367,-9.10773 z m -262.87281,-6.94064 c 30.2528,-3.33702 59.13081,-18.76656 80.80601,-43.17471 21.78757,-24.53469 34.60453,-53.08104 40.75774,-90.77692 1.45592,-8.91931 1.77336,-20.13467 2.10859,-74.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.4521,158 247.95093,158 c -0.5441,0 -1.02831,77.25195 -1.20188,191.75 l -0.29067,191.75 -2.25008,8.4008 c -4.56631,17.04862 -13.111,29.64181 -21.7083,31.99377 -10.49437,2.87094 -17.6131,0.721 -22.42096,-6.77139 -8.33866,-12.99468 -13.01185,-42.83419 -13.06492,-83.42284 L 187,480.90069 l -5.75,0.57866 c -3.1625,0.31826 -23.975,1.95021 -46.25,3.62656 -57.469757,4.325 -57.792007,4.35276 -58.477817,5.03857 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 6.63848,9.83842 20.64192,24.23566 30.39905,31.25391 27.10572,19.49702 58.07351,26.26876 99.32226,21.71883 z m 126.68328,-5.93892 C 375.55179,676.92679 383.53321,673 391.14395,673 c 5.02398,0 6.27334,0.40133 9.09027,2.92008 3.02015,2.70044 3.26314,3.37736 3.23071,9 l -0.0351,6.07992 17.75232,0 17.75231,0 -4.29685,-9.25 c -2.36327,-5.0875 -13.47716,-28.79719 -24.69754,-52.6882 -19.60788,-41.7501 -20.43619,-43.30459 -21.31424,-40 -10.54832,39.69946 -29.25027,70.90317 -57.95645,96.69878 L 324.83883,691 l 17.67726,0 17.67727,0 6.53407,-5.98729 z m 26.72629,2.23729 c -0.85705,-5.04618 -3.58278,-8.68209 -6.79636,-9.06582 -3.44617,-0.4115 -11.41701,3.96126 -16.25838,8.91927 L 366.5941,691 l 13.74827,0 13.74826,0 -0.63691,-3.75 z m 5.93929,2.16821 C 401.51181,683.8967 398.37167,677 393.73886,677 c -1.80961,0 -1.80416,0.10152 0.13784,2.57038 1.11202,1.41371 2.32078,4.56371 2.68613,7 0.68245,4.55094 1.76041,5.63562 2.83018,2.84783 z M 603,670.67319 c 4.675,-2.76938 10.75,-6.77841 13.5,-8.90894 7.98708,-6.18788 21.0833,-19.44023 26.83308,-27.15295 4.97432,-6.67252 6.82523,-9.64987 13.74583,-22.1113 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -0.73543,-4.4 -3.35584,-13.69942 -5.82314,-20.66537 -6.91192,-19.51449 -17.92491,-36.1474 -34.23209,-51.70073 -12.98117,-12.38107 -17.38864,-15.53708 -35.62986,-25.51309 -7.4721,-4.08645 -27.60958,-10.22119 -37.87163,-11.53732 -5.225,-0.67011 -10.2875,-1.37091 -11.25,-1.55732 -0.9625,-0.18641 -1.75,-0.16322 -1.75,0.0515 0,0.21475 16.02752,26.83513 35.61671,59.15638 19.58919,32.32125 35.79045,59.06247 36.00279,59.42494 0.21235,0.36246 -6.02767,4.16346 -13.86671,8.44666 -43.95453,24.01645 -74.65115,45.40361 -81.8234,57.00856 -1.8445,2.98447 -1.8982,3.54538 -0.58291,6.08888 0.79682,1.54088 2.47218,3.70053 3.72304,4.79923 1.25085,1.0987 1.99589,1.5169 1.65565,0.92934 -0.97132,-1.6774 3.59962,-10.47612 8.03429,-15.4654 5.59925,-6.29952 12.93712,-10.09198 20.73811,-10.71817 13.06621,-1.04883 22.21069,3.47808 27.20172,13.466 l 2.93412,5.87171 3.9333,-1.7667 c 9.45658,-4.24755 22.33372,-0.54232 28.15949,8.10254 2.99148,4.43905 3.10162,12.73683 0.24733,18.633 -2.71213,5.60252 -9.31383,11.97546 -15.58224,15.04231 -6.53631,3.19791 -15.65148,3.47281 -21.36818,0.64441 l -3.88221,-1.92077 -3.06221,3.06221 c -2.68668,2.68669 -3.23789,2.88164 -4.49481,1.58969 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.56262,2.40044 6.87956,4.20528 10.05845,4.20528 2.60643,0 12.58535,-9.79425 15.12051,-14.84069 3.14463,-6.25965 -0.37564,-14.99227 -7.53637,-18.69523 -3.2167,-1.66342 -11.49822,-1.9726 -12.43054,-0.46408 -1.12374,1.81824 -2.45473,1.04309 -3.86342,-2.25 -3.57612,-8.35987 -12.67467,-12.88214 -27.24555,-13.54189 l -10.10897,-0.45773 -4.10475,3.70839 C 530.42829,296.84579 524,307.62399 524,310.52288 c 0,1.63549 6.68841,7.6529 24.98351,22.47712 19.43743,15.74983 42.24448,37.83683 55.71086,53.95199 9.9066,11.85519 23.2161,30.56239 28.35733,39.85771 1.94005,3.5076 2.76193,4.18587 4.416,3.64432 1.11776,-0.36596 4.98089,-0.88859 8.58473,-1.16139 6.00644,-0.45467 6.81604,-0.27418 9.716,2.16597 3.83203,3.22445 4.82738,7.536 3.34039,14.46961 -1.30046,6.0638 -7.04383,18.22999 -8.25313,17.4826 -1.15478,-0.71369 -1.10036,-0.349 0.7033,4.71346 5.43681,15.25983 9.44101,39.845 9.44101,57.96636 0,53.19472 -20.4168,99.50551 -63.38363,143.77107 -8.55091,8.80938 -8.20549,8.86145 5.38363,0.81149 z m 48.03399,-72.13223 c -2.55122,-3.07403 0.82683,-9.48994 6.46601,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.96601,9.39189 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39982,565.60558 c 11.80825,-5.71692 25.39603,-12.95382 30.19506,-16.08199 9.46668,-6.17069 19.27819,-14.96411 22.48363,-20.15062 l 2.01752,-3.26442 -2.18972,-4.30427 c -5.60364,-11.01494 -21.16081,-26.90942 -45.14124,-46.11999 -8.10422,-6.49223 -17.21672,-14.07226 -20.25,-16.84451 L 396,453.79931 l 0,40.54588 c 0,39.30879 -0.8542,57.75589 -3.42151,73.89002 -0.67956,4.27063 -0.87841,7.76479 -0.44189,7.76479 0.43652,0 10.45497,-4.67749 22.26322,-10.39442 z m -7.36583,-53.06462 c -2.55122,-3.07403 0.82683,-9.48994 6.46601,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.96601,9.39189 z m 6.3387,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 649.35382,446.8456 c 0.0814,-8.88955 -2.1291,-12.29277 -8.08976,-12.45473 l -4.01623,-0.10912 4.86171,10.10912 c 2.67394,5.56002 4.88186,10.78413 4.90649,11.60913 0.0329,1.10081 0.3416,0.98861 1.1601,-0.4216 0.61343,-1.05688 1.14338,-4.98664 1.17769,-8.7328 z m -493.89735,3.1116 C 184.58253,447.78074 209.44503,446 210.70647,446 l 2.29353,0 0,-49 0,-49 -4.46505,0 c -8.57235,0 -18.37685,-4.6863 -23.04648,-11.01562 -7.35329,-9.96684 -4.49469,-33.20635 5.66569,-46.0602 4.60392,-5.82439 11.45573,-10.53041 17.59584,-12.08534 l 4.25,-1.07627 0,-78.38128 C 213,156.27158 213.21319,121 213.47375,121 c 0.26056,0 34.34806,3.79919 75.75,8.44265 41.40194,4.64345 82.20392,9.1658 90.67108,10.04967 l 15.39482,1.60702 10.60518,-10.34812 C 411.72767,125.05974 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.39427,2.7942 -15.10077,3.60536 -24.5,7.34279 -11.75334,4.6735 -22.7589,10.67353 -32,17.44584 -10.37457,7.60297 -27.08888,24.68754 -32.50621,33.2263 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.55588 c 2.907815,-0.30573 29.117355,-2.33662 58.243415,-4.51308 z M 97.033993,392.54096 c -2.551219,-3.07403 0.826823,-9.48994 6.466007,-12.28087 2.95496,-1.46246 4.5,-0.47055 4.5,2.88898 0,7.24734 -7.45024,13.62813 -10.966007,9.39189 z m 6.338697,-5.43939 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.40571,-6.29587 -13.1506,-23.67878 0.60286,-41.07821 5.10487,-6.45815 11.06833,-9.4152 18.97574,-9.40932 8.80349,0.007 17.87624,5.9952 19.62231,12.95209 2.66485,10.61762 -7.09273,28.87176 -19.23769,35.98918 -5.97025,3.4988 -14.41324,4.15276 -19.96322,1.54626 z m 16.40157,-3.072 c 3.31,-1.77145 10.26099,-16.92914 10.87659,-23.71802 1.04436,-11.51743 -4.4401,-17.79247 -14.96068,-17.11725 -4.88801,0.31372 -6.27077,0.86372 -9.12389,3.62908 -4.48777,4.34972 -8.39976,12.32221 -9.71772,19.80436 -0.95516,5.42256 -0.84564,6.63539 0.96984,10.73957 1.60514,3.62869 2.97263,5.05974 6.33974,6.63442 4.4898,2.09972 11.72069,2.11261 15.61612,0.0278 z m 17.13927,-19.72336 c 4.04172,-10.80248 2.2386,-18.15007 -5.33617,-21.74453 -5.05435,-2.39845 -6.57473,-1.95836 -2.99193,0.86604 5.8915,4.64441 7.86847,14.19645 4.94719,23.90312 -2.01774,6.70444 0.62556,4.33969 3.38091,-3.02463 z m 486.73908,221.23363 c 0.47864,-4.63759 0.25906,-5.56401 -1.76592,-7.45057 C 652.66351,433.9695 650.79426,433 649.7815,433 c -1.7254,0 -1.70837,0.1799 0.27036,2.85627 1.38321,1.8709 2.30735,5.01363 2.67877,9.10973 0.66271,7.30844 2.08977,6.17426 2.97069,-2.36099 z M 213,315 l 0,-29 -5.99712,0 c -5.43151,0 -6.3569,0.32504 -9.81192,3.44645 -9.32504,8.42461 -14.57108,27.39771 -11.07476,40.05355 2.20142,7.96861 12.06488,14.25714 22.6338,14.43035 L 213,344 l 0,-29 z m 391.7651,15.52952 c 4.92718,-5.59757 6.92395,-11.91164 5.31179,-16.79656 -1.90438,-5.7703 -9.0124,-10.75342 -15.27723,-10.71019 l -3.29966,0.0228 3.27735,1.61538 c 5.84955,2.88319 10.2499,10.15118 10.19511,16.83908 -0.0238,2.90878 -3.34831,9.69601 -5.83123,11.90499 -1.17768,1.04774 -2.14123,2.30107 -2.14123,2.78518 0,1.62828 3.76513,-1.11644 7.7651,-5.66065 z M 566.6399,289.52745 C 563.03235,286.79488 548,284.75659 548,287 c 0,0.55 2.5875,1.0254 5.75,1.05644 3.1625,0.031 7.325,0.65236 9.25,1.38069 4.67621,1.76928 5.89645,1.79956 3.6399,0.0903 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3488"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#927134"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.85773 C 570.00946,663.13946 610.81659,618.06345 623.47965,564.71742 635.85915,512.56594 622.13854,461.47079 582.55521,412.316 568.02632,394.27394 548.21503,375.27502 521,353.28488 c -11.02571,-8.90894 -24.26935,-21.62782 -30.63214,-29.41841 -1.17268,-1.43582 -3.84788,-6.08214 -5.94489,-10.32516 -6.97128,-14.10542 -4.98817,-24.41746 7.57161,-39.37188 10.98237,-13.07627 30.86203,-28.40084 58.02535,-44.72983 7.96404,-4.78751 14.84762,-9.035 15.29685,-9.43886 C 566.2724,219.14162 497.9179,106 496.44324,106 c -0.2003,0 -4.09447,2.04884 -8.65371,4.55299 -24.86204,13.65536 -59.07069,42.25905 -81.2614,67.94701 -14.82852,17.16549 -32.43767,46.14467 -39.19333,64.5 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.7819,23.51329 31.25674,39.57164 59.57395,61.82034 20.04013,15.74543 40.54133,36.08541 48.75943,48.37599 15.34912,22.95535 13.38967,40.804 -6.64042,60.48772 -10.31301,10.13468 -30.43465,23.38103 -48.52956,31.94767 -3.3,1.56231 -6.13984,2.91164 -6.31074,2.9985 C 430.34322,595.06021 483.64252,707 484.69329,707 c 0.35235,0 8.553,-4.09848 18.22367,-9.10773 z m -262.87281,-6.94064 c 30.2528,-3.33702 59.13081,-18.76656 80.80601,-43.17471 21.78757,-24.53469 34.60453,-53.08104 40.75774,-90.77692 1.45592,-8.91931 1.77336,-20.13467 2.10859,-74.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.4521,158 247.95093,158 c -0.5441,0 -1.02831,77.25195 -1.20188,191.75 l -0.29067,191.75 -2.25008,8.4008 c -4.56631,17.04862 -13.111,29.64181 -21.7083,31.99377 -10.49437,2.87094 -17.6131,0.721 -22.42096,-6.77139 -8.33866,-12.99468 -13.01185,-42.83419 -13.06492,-83.42284 L 187,480.90069 l -5.75,0.57866 c -3.1625,0.31826 -23.975,1.95021 -46.25,3.62656 -57.469757,4.325 -57.792007,4.35276 -58.477817,5.03857 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 6.63848,9.83842 20.64192,24.23566 30.39905,31.25391 27.10572,19.49702 58.07351,26.26876 99.32226,21.71883 z m 126.68328,-5.93892 C 375.55179,676.92679 383.53321,673 391.14395,673 c 5.02398,0 6.27334,0.40133 9.09027,2.92008 3.02015,2.70044 3.26314,3.37736 3.23071,9 l -0.0351,6.07992 17.75232,0 17.75231,0 -4.29685,-9.25 c -2.36327,-5.0875 -13.47716,-28.79719 -24.69754,-52.6882 -19.60788,-41.7501 -20.43619,-43.30459 -21.31424,-40 -10.54832,39.69946 -29.25027,70.90317 -57.95645,96.69878 L 324.83883,691 l 17.67726,0 17.67727,0 6.53407,-5.98729 z m 26.72629,2.23729 c -0.85705,-5.04618 -3.58278,-8.68209 -6.79636,-9.06582 -3.44617,-0.4115 -11.41701,3.96126 -16.25838,8.91927 L 366.5941,691 l 13.74827,0 13.74826,0 -0.63691,-3.75 z m 5.93929,2.16821 C 401.51181,683.8967 398.37167,677 393.73886,677 c -1.80961,0 -1.80416,0.10152 0.13784,2.57038 1.11202,1.41371 2.32078,4.56371 2.68613,7 0.68245,4.55094 1.76041,5.63562 2.83018,2.84783 z M 603,670.67319 c 4.675,-2.76938 10.75,-6.77841 13.5,-8.90894 7.98708,-6.18788 21.0833,-19.44023 26.83308,-27.15295 4.97432,-6.67252 6.82523,-9.64987 13.74583,-22.1113 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -0.73543,-4.4 -3.35584,-13.69942 -5.82314,-20.66537 -6.91192,-19.51449 -17.92491,-36.1474 -34.23209,-51.70073 -12.98117,-12.38107 -17.38864,-15.53708 -35.62986,-25.51309 -7.4721,-4.08645 -27.60958,-10.22119 -37.87163,-11.53732 -5.225,-0.67011 -10.2875,-1.37091 -11.25,-1.55732 -0.9625,-0.18641 -1.75,-0.16322 -1.75,0.0515 0,0.21475 16.02752,26.83513 35.61671,59.15638 19.58919,32.32125 35.79045,59.06247 36.00279,59.42494 0.21235,0.36246 -6.02767,4.16346 -13.86671,8.44666 -43.95453,24.01645 -74.65115,45.40361 -81.8234,57.00856 -1.8445,2.98447 -1.8982,3.54538 -0.58291,6.08888 0.79682,1.54088 2.30026,3.57219 3.34099,4.51403 1.79654,1.62585 1.89995,1.60983 2.04508,-0.31673 0.0841,-1.11604 1.35547,-4.08127 2.82533,-6.58941 6.49096,-11.07598 15.29798,-17.20867 25.93969,-18.06289 13.01155,-1.04444 22.26359,3.58394 27.29619,13.65506 2.89035,5.7841 2.91637,5.80458 5.59248,4.40242 9.31102,-4.87853 23.38115,-1.22621 29.33996,7.61607 2.99826,4.44911 3.0805,12.38394 0.19205,18.52884 -2.5224,5.36618 -10.41368,12.96405 -16.18633,15.58451 -5.67556,2.57638 -15.99926,2.63273 -20.93903,0.11429 l -3.63,-1.85067 -3.0732,3.0732 c -2.6963,2.6963 -3.24891,2.89261 -4.50581,1.60068 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.56262,2.40044 6.87956,4.20528 10.05845,4.20528 2.60643,0 12.58535,-9.79425 15.12051,-14.84069 3.14463,-6.25965 -0.37564,-14.99227 -7.53637,-18.69523 -3.2167,-1.66342 -11.49822,-1.9726 -12.43054,-0.46408 -1.12374,1.81824 -2.45473,1.04309 -3.86342,-2.25 -3.57612,-8.35987 -12.67467,-12.88214 -27.24555,-13.54189 l -10.10897,-0.45773 -4.10475,3.70839 C 530.42829,296.84579 524,307.62399 524,310.52288 c 0,1.63549 6.68841,7.6529 24.98351,22.47712 19.43743,15.74983 42.24448,37.83683 55.71086,53.95199 9.9066,11.85519 23.2161,30.56239 28.35733,39.85771 1.94005,3.5076 2.76193,4.18587 4.416,3.64432 1.11776,-0.36596 5.00967,-0.89021 8.64868,-1.165 6.27805,-0.47407 6.78939,-0.34479 10,2.52826 3.19851,2.86222 3.37813,3.37402 3.28326,9.35529 -0.0804,5.06805 -0.85255,7.96529 -3.87954,14.55639 -2.07855,4.52592 -4.17089,7.98686 -4.64964,7.69098 -1.1708,-0.72359 -1.11882,-0.36849 0.68853,4.70433 5.43681,15.25983 9.44101,39.845 9.44101,57.96636 0,53.19472 -20.4168,99.50551 -63.38363,143.77107 -8.55091,8.80938 -8.20549,8.86145 5.38363,0.81149 z M 651.2,598.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 6.17269,-5.69843 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 414.39982,565.60558 c 11.80825,-5.71692 25.39603,-12.95382 30.19506,-16.08199 9.46668,-6.17069 19.27819,-14.96411 22.48363,-20.15062 l 2.01752,-3.26442 -2.18972,-4.30427 c -5.60364,-11.01494 -21.16081,-26.90942 -45.14124,-46.11999 -8.10422,-6.49223 -17.21672,-14.07226 -20.25,-16.84451 L 396,453.79931 l 0,40.54588 c 0,39.30879 -0.8542,57.75589 -3.42151,73.89002 -0.67956,4.27063 -0.87841,7.76479 -0.44189,7.76479 0.43652,0 10.45497,-4.67749 22.26322,-10.39442 z M 407.2,512.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 6.17269,-5.69843 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.13451,1.86093 -2.06444,3.98351 -2.06649,4.71684 -0.006,2.19843 2.34996,0.72522 4.36895,-2.73176 z M 649.35382,446.8456 c 0.0814,-8.88955 -2.1291,-12.29277 -8.08976,-12.45473 l -4.01623,-0.10912 4.86171,10.10912 c 2.67394,5.56002 4.88186,10.78413 4.90649,11.60913 0.0329,1.10081 0.3416,0.98861 1.1601,-0.4216 0.61343,-1.05688 1.14338,-4.98664 1.17769,-8.7328 z m -493.89735,3.1116 C 184.58253,447.78074 209.44503,446 210.70647,446 l 2.29353,0 0,-49 0,-49 -4.48927,0 c -8.21136,0 -19.18123,-5.38646 -23.34484,-11.46286 -6.87466,-10.0329 -4.11707,-32.1933 5.60432,-45.03714 4.48424,-5.92456 11.82931,-11.11856 17.87659,-12.64128 L 213,277.76257 213,199.38129 C 213,156.27158 213.21319,121 213.47375,121 c 0.26056,0 34.34806,3.79919 75.75,8.44265 41.40194,4.64345 82.20392,9.1658 90.67108,10.04967 l 15.39482,1.60702 10.60518,-10.34812 C 411.72767,125.05974 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.39427,2.7942 -15.10077,3.60536 -24.5,7.34279 -11.75334,4.6735 -22.7589,10.67353 -32,17.44584 -10.37457,7.60297 -27.08888,24.68754 -32.50621,33.2263 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.55588 c 2.907815,-0.30573 29.117355,-2.33662 58.243415,-4.51308 z M 97.2,392.8 c -1.598363,-1.59836 -1.512591,-3.29484 0.348549,-6.89388 1.757195,-3.39804 7.027401,-7.00608 9.082021,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 C 99.272446,394.28862 98.675142,394.27514 97.2,392.8 z m 6.17269,-5.69843 c 1.33802,-2.291 1.57947,-3.54941 0.82565,-4.30323 -0.75381,-0.75381 -1.66857,-0.0759 -3.12811,2.31815 -1.134514,1.86093 -2.064436,3.98351 -2.066492,4.71684 -0.0062,2.19843 2.349962,0.72522 4.368952,-2.73176 z M 135.4214,244.16674 c -13.55141,-6.3643 -13.14493,-24.04675 0.95055,-41.35043 5.34287,-6.55893 10.55869,-9.08205 18.70943,-9.05057 8.87966,0.0343 17.79345,5.90306 19.54093,12.86556 2.66485,10.61762 -7.09273,28.87176 -19.23769,35.98918 -5.97025,3.4988 -14.41324,4.15276 -19.96322,1.54626 z m 16.40157,-3.072 c 3.31,-1.77145 10.26099,-16.92914 10.87659,-23.71802 1.04436,-11.51743 -4.4401,-17.79247 -14.96068,-17.11725 -4.88801,0.31372 -6.27077,0.86372 -9.12389,3.62908 -4.48777,4.34972 -8.39976,12.32221 -9.71772,19.80436 -0.95516,5.42256 -0.84564,6.63539 0.96984,10.73957 1.60514,3.62869 2.97263,5.05974 6.33974,6.63442 4.4898,2.09972 11.72069,2.11261 15.61612,0.0278 z m 17.13927,-19.72336 c 4.04172,-10.80248 2.2386,-18.15007 -5.33617,-21.74453 -5.05435,-2.39845 -6.57473,-1.95836 -2.99193,0.86604 5.8915,4.64441 7.86847,14.19645 4.94719,23.90312 -2.01774,6.70444 0.62556,4.33969 3.38091,-3.02463 z m 486.73908,221.23363 c 0.47864,-4.63759 0.25906,-5.56401 -1.76592,-7.45057 C 652.66351,433.9695 650.79426,433 649.7815,433 c -1.7254,0 -1.70837,0.1799 0.27036,2.85627 1.38321,1.8709 2.30735,5.01363 2.67877,9.10973 0.66271,7.30844 2.08977,6.17426 2.97069,-2.36099 z M 213,315 l 0,-29 -5.99712,0 c -5.43151,0 -6.3569,0.32504 -9.81192,3.44645 -9.32504,8.42461 -14.57108,27.39771 -11.07476,40.05355 2.20142,7.96861 12.06488,14.25714 22.6338,14.43035 L 213,344 l 0,-29 z m 391.7651,15.52952 c 4.92718,-5.59757 6.92395,-11.91164 5.31179,-16.79656 -1.90438,-5.7703 -9.0124,-10.75342 -15.27723,-10.71019 l -3.29966,0.0228 3.27735,1.61538 c 5.84955,2.88319 10.2499,10.15118 10.19511,16.83908 -0.0238,2.90878 -3.34831,9.69601 -5.83123,11.90499 -1.17768,1.04774 -2.14123,2.30107 -2.14123,2.78518 0,1.62828 3.76513,-1.11644 7.7651,-5.66065 z M 566.6399,289.52745 C 563.03235,286.79488 548,284.75659 548,287 c 0,0.55 2.5875,1.0254 5.75,1.05644 3.1625,0.031 7.325,0.65236 9.25,1.38069 4.67621,1.76928 5.89645,1.79956 3.6399,0.0903 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3486"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#88753a"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.85773 C 570.00946,663.13946 610.81659,618.06345 623.47965,564.71742 635.85915,512.56594 622.13854,461.47079 582.55521,412.316 568.02632,394.27394 548.21503,375.27502 521,353.28488 c -11.02571,-8.90894 -24.26935,-21.62782 -30.63214,-29.41841 -1.17268,-1.43582 -3.84788,-6.08214 -5.94489,-10.32516 -6.97128,-14.10542 -4.98817,-24.41746 7.57161,-39.37188 10.98237,-13.07627 30.86203,-28.40084 58.02535,-44.72983 7.96404,-4.78751 14.84762,-9.035 15.29685,-9.43886 C 566.2724,219.14162 497.9179,106 496.44324,106 c -0.2003,0 -4.09447,2.04884 -8.65371,4.55299 -24.86204,13.65536 -59.07069,42.25905 -81.2614,67.94701 -14.82852,17.16549 -32.43767,46.14467 -39.19333,64.5 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.7819,23.51329 31.25674,39.57164 59.57395,61.82034 20.04013,15.74543 40.54133,36.08541 48.75943,48.37599 15.34912,22.95535 13.38967,40.804 -6.64042,60.48772 -10.31301,10.13468 -30.43465,23.38103 -48.52956,31.94767 -3.3,1.56231 -6.13984,2.91164 -6.31074,2.9985 C 430.34322,595.06021 483.64252,707 484.69329,707 c 0.35235,0 8.553,-4.09848 18.22367,-9.10773 z m -262.87281,-6.94064 c 30.2528,-3.33702 59.13081,-18.76656 80.80601,-43.17471 21.78757,-24.53469 34.60453,-53.08104 40.75774,-90.77692 1.45592,-8.91931 1.77336,-20.13467 2.10859,-74.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.4521,158 247.95093,158 c -0.5441,0 -1.02831,77.25195 -1.20188,191.75 l -0.29067,191.75 -2.25008,8.4008 c -4.56631,17.04862 -13.111,29.64181 -21.7083,31.99377 -10.49437,2.87094 -17.6131,0.721 -22.42096,-6.77139 -8.33866,-12.99468 -13.01185,-42.83419 -13.06492,-83.42284 L 187,480.90069 l -5.75,0.57866 c -3.1625,0.31826 -23.975,1.95021 -46.25,3.62656 -57.469757,4.325 -57.792007,4.35276 -58.477817,5.03857 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 6.63848,9.83842 20.64192,24.23566 30.39905,31.25391 27.10572,19.49702 58.07351,26.26876 99.32226,21.71883 z m 126.68328,-5.93892 C 375.55179,676.92679 383.53321,673 391.14395,673 c 5.02398,0 6.27334,0.40133 9.09027,2.92008 3.02015,2.70044 3.26314,3.37736 3.23071,9 l -0.0351,6.07992 17.75232,0 17.75231,0 -4.29685,-9.25 c -2.36327,-5.0875 -13.47716,-28.79719 -24.69754,-52.6882 -19.60788,-41.7501 -20.43619,-43.30459 -21.31424,-40 -10.54832,39.69946 -29.25027,70.90317 -57.95645,96.69878 L 324.83883,691 l 17.67726,0 17.67727,0 6.53407,-5.98729 z m 26.8319,2.23729 c -0.88811,-5.02134 -3.67377,-8.68034 -6.90197,-9.06582 -3.44617,-0.4115 -11.41701,3.96126 -16.25838,8.91927 L 366.5941,691 l 13.81424,0 13.81424,0 -0.66325,-3.75 z m 5.83368,2.16821 C 401.51181,683.8967 398.37167,677 393.73886,677 c -1.80961,0 -1.80416,0.10152 0.13784,2.57038 1.11202,1.41371 2.32078,4.56371 2.68613,7 0.68245,4.55094 1.76041,5.63562 2.83018,2.84783 z M 603,670.67319 c 4.675,-2.76938 10.75,-6.77841 13.5,-8.90894 7.98708,-6.18788 21.0833,-19.44023 26.83308,-27.15295 4.97432,-6.67252 6.82523,-9.64987 13.74583,-22.1113 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -0.73543,-4.4 -3.35584,-13.69942 -5.82314,-20.66537 -6.91192,-19.51449 -17.92491,-36.1474 -34.23209,-51.70073 -12.98117,-12.38107 -17.38864,-15.53708 -35.62986,-25.51309 -7.4721,-4.08645 -27.60958,-10.22119 -37.87163,-11.53732 -5.225,-0.67011 -10.2875,-1.37091 -11.25,-1.55732 -0.9625,-0.18641 -1.75,-0.16322 -1.75,0.0515 0,0.21475 16.02752,26.83513 35.61671,59.15638 19.58919,32.32125 35.79045,59.06247 36.00279,59.42494 0.21235,0.36246 -6.02767,4.16346 -13.86671,8.44666 -43.95453,24.01645 -74.65115,45.40361 -81.8234,57.00856 -1.8445,2.98447 -1.8982,3.54538 -0.58291,6.08888 0.79682,1.54088 2.30026,3.57219 3.34099,4.51403 1.79654,1.62585 1.89995,1.60983 2.04508,-0.31673 0.0841,-1.11604 1.35547,-4.08127 2.82533,-6.58941 6.49096,-11.07598 15.29798,-17.20867 25.93969,-18.06289 13.01155,-1.04444 22.26359,3.58394 27.29619,13.65506 2.89035,5.7841 2.91637,5.80458 5.59248,4.40242 9.31102,-4.87853 23.38115,-1.22621 29.33996,7.61607 2.99826,4.44911 3.0805,12.38394 0.19205,18.52884 -2.5224,5.36618 -10.41368,12.96405 -16.18633,15.58451 -5.67556,2.57638 -15.99926,2.63273 -20.93903,0.11429 l -3.63,-1.85067 -3.0732,3.0732 c -2.6963,2.6963 -3.24891,2.89261 -4.50581,1.60068 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.57963,2.41637 6.88406,4.20528 10.11864,4.20528 2.76771,0 13.56826,-10.95701 15.50868,-15.73333 2.49984,-6.15334 -1.13673,-14.26135 -7.98473,-17.80259 -3.2167,-1.66342 -11.49822,-1.9726 -12.43054,-0.46408 -1.06629,1.72529 -2.21499,1.10229 -3.44562,-1.86871 -1.7143,-4.1387 -6.79847,-8.69347 -12.55438,-11.24715 -3.72255,-1.65155 -7.58275,-2.33525 -15.10897,-2.67603 l -10.10897,-0.45773 -4.29719,3.87481 c -3.82064,3.4451 -9.98191,13.92854 -9.98408,16.98797 -0.001,1.5455 6.96053,7.78376 24.98272,22.38684 19.43743,15.74983 42.24448,37.83683 55.71086,53.95199 9.9066,11.85519 23.2161,30.56239 28.35733,39.85771 1.94005,3.5076 2.76193,4.18587 4.416,3.64432 1.11776,-0.36596 5.00967,-0.89021 8.64868,-1.165 6.27805,-0.47407 6.78939,-0.34479 10,2.52826 3.19851,2.86222 3.37813,3.37402 3.28326,9.35529 -0.0804,5.06805 -0.85255,7.96529 -3.87954,14.55639 -2.07855,4.52592 -4.17089,7.98686 -4.64964,7.69098 -1.1708,-0.72359 -1.11882,-0.36849 0.68853,4.70433 5.43681,15.25983 9.44101,39.845 9.44101,57.96636 0,53.19472 -20.4168,99.50551 -63.38363,143.77107 -8.55091,8.80938 -8.20549,8.86145 5.38363,0.81149 z M 651.2,598.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 5.81096,-5.05 c 2.17505,-3.56734 2.5449,-5.75 0.97434,-5.75 -1.1788,0 -4.97605,5.90752 -4.98156,7.75 -0.007,2.29133 2.00208,1.28868 4.00722,-2 z M 414.39982,565.60558 c 11.80825,-5.71692 25.39603,-12.95382 30.19506,-16.08199 9.46668,-6.17069 19.27819,-14.96411 22.48363,-20.15062 l 2.01752,-3.26442 -2.18972,-4.30427 c -5.60364,-11.01494 -21.16081,-26.90942 -45.14124,-46.11999 -8.10422,-6.49223 -17.21672,-14.07226 -20.25,-16.84451 L 396,453.79931 l 0,40.54588 c 0,39.30879 -0.8542,57.75589 -3.42151,73.89002 -0.67956,4.27063 -0.87841,7.76479 -0.44189,7.76479 0.43652,0 10.45497,-4.67749 22.26322,-10.39442 z M 407.2,512.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 5.81096,-5.05 c 2.17505,-3.56734 2.5449,-5.75 0.97434,-5.75 -1.1788,0 -4.97605,5.90752 -4.98156,7.75 -0.007,2.29133 2.00208,1.28868 4.00722,-2 z m 236.43273,-60.92584 c 0.0739,-8.76399 -2.23376,-12.27173 -8.17963,-12.43329 l -4.01623,-0.10912 4.86171,10.10912 c 2.67394,5.56002 4.88186,10.78413 4.90649,11.60913 0.0319,1.06892 0.3791,0.92522 1.20807,-0.5 0.6398,-1.1 1.18862,-5.00413 1.21959,-8.67584 z M 155.45647,449.9572 C 184.58253,447.78074 209.44503,446 210.70647,446 l 2.29353,0 0,-49 0,-49 -4.48927,0 c -8.21136,0 -19.18123,-5.38646 -23.34484,-11.46286 -6.87466,-10.0329 -4.11707,-32.1933 5.60432,-45.03714 4.48424,-5.92456 11.82931,-11.11856 17.87659,-12.64128 L 213,277.76257 213,199.38129 C 213,156.27158 213.21319,121 213.47375,121 c 0.26056,0 34.34806,3.79919 75.75,8.44265 41.40194,4.64345 82.20392,9.1658 90.67108,10.04967 l 15.39482,1.60702 10.60518,-10.34812 C 411.72767,125.05974 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.39427,2.7942 -15.10077,3.60536 -24.5,7.34279 -11.75334,4.6735 -22.7589,10.67353 -32,17.44584 -10.37457,7.60297 -27.08888,24.68754 -32.50621,33.2263 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.55588 c 2.907815,-0.30573 29.117355,-2.33662 58.243415,-4.51308 z M 97.2,392.8 c -1.598363,-1.59836 -1.512591,-3.29484 0.348549,-6.89388 1.757195,-3.39804 7.027401,-7.00608 9.082021,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 C 99.272446,394.28862 98.675142,394.27514 97.2,392.8 z m 5.81096,-5.05 c 2.17505,-3.56734 2.5449,-5.75 0.97434,-5.75 -1.1788,0 -4.976052,5.90752 -4.981562,7.75 -0.0069,2.29133 2.002082,1.28868 4.007222,-2 z M 135.4214,244.16674 c -13.55141,-6.3643 -13.14493,-24.04675 0.95055,-41.35043 5.34287,-6.55893 10.55869,-9.08205 18.70943,-9.05057 8.87966,0.0343 17.79345,5.90306 19.54093,12.86556 2.66485,10.61762 -7.09273,28.87176 -19.23769,35.98918 -5.97025,3.4988 -14.41324,4.15276 -19.96322,1.54626 z m 16.50778,-3.12884 c 3.36244,-1.79952 10.38862,-17.2833 10.87139,-23.95758 0.82468,-11.40111 -4.69095,-17.48754 -15.23219,-16.80851 -5.60944,0.36133 -6.16288,0.63751 -10.18924,5.08477 -7.82255,8.64028 -11.32648,24.40885 -6.89639,31.03548 3.89436,5.82526 14.82022,8.19208 21.44643,4.64584 z m 17.03306,-19.66652 c 4.04172,-10.80248 2.2386,-18.15007 -5.33617,-21.74453 -5.05435,-2.39845 -6.57473,-1.95836 -2.99193,0.86604 5.8915,4.64441 7.86847,14.19645 4.94719,23.90312 -2.01774,6.70444 0.62556,4.33969 3.38091,-3.02463 z m 486.73908,221.23363 c 0.47864,-4.63759 0.25906,-5.56401 -1.76592,-7.45057 C 652.66351,433.9695 650.79426,433 649.7815,433 c -1.7254,0 -1.70837,0.1799 0.27036,2.85627 1.38321,1.8709 2.30735,5.01363 2.67877,9.10973 0.66271,7.30844 2.08977,6.17426 2.97069,-2.36099 z M 213,315 l 0,-29 -6.02234,0 c -5.63679,0 -6.30034,0.25625 -10.36457,4.00252 -8.97829,8.2759 -13.95199,26.99084 -10.49689,39.49748 2.18859,7.92219 11.90221,14.251 22.1338,14.42105 L 213,344 l 0,-29 z m 391.7651,15.52952 c 4.92718,-5.59757 6.92395,-11.91164 5.31179,-16.79656 -1.90438,-5.7703 -9.0124,-10.75342 -15.27723,-10.71019 l -3.29966,0.0228 3.27735,1.61538 c 5.84955,2.88319 10.2499,10.15118 10.19511,16.83908 -0.0238,2.90878 -3.34831,9.69601 -5.83123,11.90499 -1.17768,1.04774 -2.14123,2.30107 -2.14123,2.78518 0,1.62828 3.76513,-1.11644 7.7651,-5.66065 z M 566.6399,289.52745 C 563.03235,286.79488 548,284.75659 548,287 c 0,0.55 2.5875,1.0254 5.75,1.05644 3.1625,0.031 7.325,0.65236 9.25,1.38069 4.67621,1.76928 5.89645,1.79956 3.6399,0.0903 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3484"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#906f34"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.85773 C 570.00946,663.13946 610.81659,618.06345 623.47965,564.71742 635.85915,512.56594 622.13854,461.47079 582.55521,412.316 568.02632,394.27394 548.21503,375.27502 521,353.28488 c -11.02571,-8.90894 -24.26935,-21.62782 -30.63214,-29.41841 -1.17268,-1.43582 -3.84788,-6.08214 -5.94489,-10.32516 -6.97128,-14.10542 -4.98817,-24.41746 7.57161,-39.37188 10.98237,-13.07627 30.86203,-28.40084 58.02535,-44.72983 7.96404,-4.78751 14.84762,-9.035 15.29685,-9.43886 C 566.2724,219.14162 497.9179,106 496.44324,106 c -0.2003,0 -4.09447,2.04884 -8.65371,4.55299 -24.86204,13.65536 -59.07069,42.25905 -81.2614,67.94701 -14.82852,17.16549 -32.43767,46.14467 -39.19333,64.5 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.7819,23.51329 31.25674,39.57164 59.57395,61.82034 20.04013,15.74543 40.54133,36.08541 48.75943,48.37599 15.34912,22.95535 13.38967,40.804 -6.64042,60.48772 -10.31301,10.13468 -30.43465,23.38103 -48.52956,31.94767 -3.3,1.56231 -6.13984,2.91164 -6.31074,2.9985 C 430.34322,595.06021 483.64252,707 484.69329,707 c 0.35235,0 8.553,-4.09848 18.22367,-9.10773 z m -262.87281,-6.94064 c 30.2528,-3.33702 59.13081,-18.76656 80.80601,-43.17471 21.78757,-24.53469 34.60453,-53.08104 40.75774,-90.77692 1.45592,-8.91931 1.77336,-20.13467 2.10859,-74.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.4521,158 247.95093,158 c -0.5441,0 -1.02831,77.25195 -1.20188,191.75 l -0.29067,191.75 -2.25008,8.4008 c -4.56631,17.04862 -13.111,29.64181 -21.7083,31.99377 -10.49437,2.87094 -17.6131,0.721 -22.42096,-6.77139 -8.33866,-12.99468 -13.01185,-42.83419 -13.06492,-83.42284 L 187,480.90069 l -5.75,0.57866 c -3.1625,0.31826 -23.975,1.95021 -46.25,3.62656 -57.469757,4.325 -57.792007,4.35276 -58.477817,5.03857 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 6.63848,9.83842 20.64192,24.23566 30.39905,31.25391 27.10572,19.49702 58.07351,26.26876 99.32226,21.71883 z m 126.68328,-5.93892 C 375.55179,676.92679 383.53321,673 391.14395,673 c 5.02398,0 6.27334,0.40133 9.09027,2.92008 3.02015,2.70044 3.26314,3.37736 3.23071,9 l -0.0351,6.07992 17.75232,0 17.75231,0 -4.29685,-9.25 c -2.36327,-5.0875 -13.47716,-28.79719 -24.69754,-52.6882 -19.60788,-41.7501 -20.43619,-43.30459 -21.31424,-40 -10.54832,39.69946 -29.25027,70.90317 -57.95645,96.69878 L 324.83883,691 l 17.67726,0 17.67727,0 6.53407,-5.98729 z m 26.8319,2.23729 c -0.88811,-5.02134 -3.67377,-8.68034 -6.90197,-9.06582 -3.44617,-0.4115 -11.41701,3.96126 -16.25838,8.91927 L 366.5941,691 l 13.81424,0 13.81424,0 -0.66325,-3.75 z m 6.24331,-1.52553 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 603,670.67319 c 4.675,-2.76938 10.75,-6.77841 13.5,-8.90894 7.98708,-6.18788 21.0833,-19.44023 26.83308,-27.15295 4.97432,-6.67252 6.82523,-9.64987 13.74583,-22.1113 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -0.73543,-4.4 -3.35584,-13.69942 -5.82314,-20.66537 -6.91192,-19.51449 -17.92491,-36.1474 -34.23209,-51.70073 -12.98117,-12.38107 -17.38864,-15.53708 -35.62986,-25.51309 -7.4721,-4.08645 -27.60958,-10.22119 -37.87163,-11.53732 -5.225,-0.67011 -10.2875,-1.37091 -11.25,-1.55732 -0.9625,-0.18641 -1.75,-0.16322 -1.75,0.0515 0,0.21475 16.02752,26.83513 35.61671,59.15638 19.58919,32.32125 35.79045,59.06247 36.00279,59.42494 0.21235,0.36246 -6.02767,4.16346 -13.86671,8.44666 -43.95453,24.01645 -74.65115,45.40361 -81.8234,57.00856 -1.8445,2.98447 -1.8982,3.54538 -0.58291,6.08888 0.79682,1.54088 2.30026,3.57219 3.34099,4.51403 1.79654,1.62585 1.89995,1.60983 2.04508,-0.31673 0.0841,-1.11604 1.35547,-4.08127 2.82533,-6.58941 6.49096,-11.07598 15.29798,-17.20867 25.93969,-18.06289 13.01155,-1.04444 22.26359,3.58394 27.29619,13.65506 2.89035,5.7841 2.91637,5.80458 5.59248,4.40242 9.31102,-4.87853 23.38115,-1.22621 29.33996,7.61607 2.99826,4.44911 3.0805,12.38394 0.19205,18.52884 -2.5224,5.36618 -10.41368,12.96405 -16.18633,15.58451 -5.67556,2.57638 -15.99926,2.63273 -20.93903,0.11429 l -3.63,-1.85067 -3.0732,3.0732 c -2.6963,2.6963 -3.24891,2.89261 -4.50581,1.60068 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.07205 c 2.57963,2.41637 6.88406,4.20528 10.11864,4.20528 2.76771,0 13.56826,-10.95701 15.50868,-15.73333 2.49984,-6.15334 -1.13673,-14.26135 -7.98473,-17.80259 -3.2167,-1.66342 -11.49822,-1.9726 -12.43054,-0.46408 -1.06629,1.72529 -2.21499,1.10229 -3.44562,-1.86871 -1.7143,-4.1387 -6.79847,-8.69347 -12.55438,-11.24715 -3.72255,-1.65155 -7.58275,-2.33525 -15.10897,-2.67603 l -10.10897,-0.45773 -4.29719,3.87481 c -3.82064,3.4451 -9.98191,13.92854 -9.98408,16.98797 -0.001,1.5455 6.96053,7.78376 24.98272,22.38684 19.43743,15.74983 42.24448,37.83683 55.71086,53.95199 9.9066,11.85519 23.2161,30.56239 28.35733,39.85771 1.94005,3.5076 2.76193,4.18587 4.416,3.64432 1.11776,-0.36596 5.00967,-0.89021 8.64868,-1.165 6.27805,-0.47407 6.78939,-0.34479 10,2.52826 3.19851,2.86222 3.37813,3.37402 3.28326,9.35529 -0.0804,5.06805 -0.85255,7.96529 -3.87954,14.55639 -2.07855,4.52592 -4.17089,7.98686 -4.64964,7.69098 -1.1708,-0.72359 -1.11882,-0.36849 0.68853,4.70433 5.43681,15.25983 9.44101,39.845 9.44101,57.96636 0,53.19472 -20.4168,99.50551 -63.38363,143.77107 -8.55091,8.80938 -8.20549,8.86145 5.38363,0.81149 z M 651.2,598.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 5.81096,-5.05 c 2.17505,-3.56734 2.5449,-5.75 0.97434,-5.75 -1.1788,0 -4.97605,5.90752 -4.98156,7.75 -0.007,2.29133 2.00208,1.28868 4.00722,-2 z M 414.39982,565.60558 c 11.80825,-5.71692 25.39603,-12.95382 30.19506,-16.08199 9.46668,-6.17069 19.27819,-14.96411 22.48363,-20.15062 l 2.01752,-3.26442 -2.18972,-4.30427 c -5.60364,-11.01494 -21.16081,-26.90942 -45.14124,-46.11999 -8.10422,-6.49223 -17.21672,-14.07226 -20.25,-16.84451 L 396,453.79931 l 0,40.54588 c 0,39.30879 -0.8542,57.75589 -3.42151,73.89002 -0.67956,4.27063 -0.87841,7.76479 -0.44189,7.76479 0.43652,0 10.45497,-4.67749 22.26322,-10.39442 z M 407.2,512.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 5.81096,-5.05 c 2.17505,-3.56734 2.5449,-5.75 0.97434,-5.75 -1.1788,0 -4.97605,5.90752 -4.98156,7.75 -0.007,2.29133 2.00208,1.28868 4.00722,-2 z m 236.43273,-60.92584 c 0.0739,-8.76399 -2.23376,-12.27173 -8.17963,-12.43329 l -4.01623,-0.10912 4.86171,10.10912 c 2.67394,5.56002 4.88186,10.78413 4.90649,11.60913 0.0319,1.06892 0.3791,0.92522 1.20807,-0.5 0.6398,-1.1 1.18862,-5.00413 1.21959,-8.67584 z M 155.45647,449.9572 C 184.58253,447.78074 209.44503,446 210.70647,446 l 2.29353,0 0,-49 0,-49 -4.48927,0 c -8.21136,0 -19.18123,-5.38646 -23.34484,-11.46286 -6.87466,-10.0329 -4.11707,-32.1933 5.60432,-45.03714 4.48424,-5.92456 11.82931,-11.11856 17.87659,-12.64128 L 213,277.76257 213,199.38129 C 213,156.27158 213.21319,121 213.47375,121 c 0.26056,0 34.34806,3.79919 75.75,8.44265 41.40194,4.64345 82.20392,9.1658 90.67108,10.04967 l 15.39482,1.60702 10.60518,-10.34812 C 411.72767,125.05974 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.39427,2.7942 -15.10077,3.60536 -24.5,7.34279 -11.75334,4.6735 -22.7589,10.67353 -32,17.44584 -10.37457,7.60297 -27.08888,24.68754 -32.50621,33.2263 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.55588 c 2.907815,-0.30573 29.117355,-2.33662 58.243415,-4.51308 z M 97.2,392.8 c -1.598363,-1.59836 -1.512591,-3.29484 0.348549,-6.89388 1.757195,-3.39804 7.027401,-7.00608 9.082021,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 C 99.272446,394.28862 98.675142,394.27514 97.2,392.8 z m 5.81096,-5.05 c 2.17505,-3.56734 2.5449,-5.75 0.97434,-5.75 -1.1788,0 -4.976052,5.90752 -4.981562,7.75 -0.0069,2.29133 2.002082,1.28868 4.007222,-2 z M 135.4214,244.16674 c -13.55141,-6.3643 -13.14493,-24.04675 0.95055,-41.35043 5.34287,-6.55893 10.55869,-9.08205 18.70943,-9.05057 8.87966,0.0343 17.79345,5.90306 19.54093,12.86556 2.66485,10.61762 -7.09273,28.87176 -19.23769,35.98918 -5.97025,3.4988 -14.41324,4.15276 -19.96322,1.54626 z m 16.50778,-3.12884 c 3.36244,-1.79952 10.38862,-17.2833 10.87139,-23.95758 0.82468,-11.40111 -4.69095,-17.48754 -15.23219,-16.80851 -5.60944,0.36133 -6.16288,0.63751 -10.18924,5.08477 -7.82255,8.64028 -11.32648,24.40885 -6.89639,31.03548 3.89436,5.82526 14.82022,8.19208 21.44643,4.64584 z m 16.68246,-18.69443 c 2.78117,-6.28871 3.19785,-14.74275 0.88911,-18.03894 C 167.65708,201.67233 161.86713,198 159.56076,198 c -1.24546,0 -0.77377,0.87653 1.75523,3.26169 5.44828,5.13839 7.06282,13.839 4.28242,23.07757 -1.83597,6.10049 -0.0418,4.91211 3.01323,-1.99579 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -6.02234,0 c -5.63679,0 -6.30034,0.25625 -10.36457,4.00252 -8.97829,8.2759 -13.95199,26.99084 -10.49689,39.49748 2.18859,7.92219 11.90221,14.251 22.1338,14.42105 L 213,344 l 0,-29 z m 389.99219,17.41054 c 7.95467,-7.44066 9.87173,-16.49994 4.84414,-22.89148 -2.67536,-3.40117 -8.94825,-6.52466 -13.04649,-6.49629 l -3.28984,0.0228 3.27735,1.61538 c 5.84955,2.88319 10.2499,10.15118 10.19511,16.83908 -0.0238,2.90878 -3.34831,9.69601 -5.83123,11.90499 -2.01196,1.78998 -2.8145,3.59501 -1.59839,3.59501 0.29856,0 2.75077,-2.06526 5.44935,-4.58946 z M 566.6399,289.52745 C 563.03235,286.79488 548,284.75659 548,287 c 0,0.55 2.5875,1.03424 5.75,1.07608 3.1625,0.0418 7.325,0.68261 9.25,1.42392 4.58406,1.76531 5.94782,1.7756 3.6399,0.0274 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3482"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#8d7530"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.85773 C 570.00946,663.13946 610.81659,618.06345 623.47965,564.71742 635.85915,512.56594 622.13854,461.47079 582.55521,412.316 568.02632,394.27394 548.21503,375.27502 521,353.28488 c -11.02571,-8.90894 -24.26935,-21.62782 -30.63214,-29.41841 -1.17268,-1.43582 -3.84788,-6.08214 -5.94489,-10.32516 -6.97128,-14.10542 -4.98817,-24.41746 7.57161,-39.37188 10.98237,-13.07627 30.86203,-28.40084 58.02535,-44.72983 7.96404,-4.78751 14.84762,-9.035 15.29685,-9.43886 C 566.2724,219.14162 497.9179,106 496.44324,106 c -0.2003,0 -4.09447,2.04884 -8.65371,4.55299 -24.86204,13.65536 -59.07069,42.25905 -81.2614,67.94701 -14.82852,17.16549 -32.43767,46.14467 -39.19333,64.5 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.7819,23.51329 31.25674,39.57164 59.57395,61.82034 20.04013,15.74543 40.54133,36.08541 48.75943,48.37599 15.34912,22.95535 13.38967,40.804 -6.64042,60.48772 -10.31301,10.13468 -30.43465,23.38103 -48.52956,31.94767 -3.3,1.56231 -6.13984,2.91164 -6.31074,2.9985 C 430.34322,595.06021 483.64252,707 484.69329,707 c 0.35235,0 8.553,-4.09848 18.22367,-9.10773 z m -262.87281,-6.94064 c 30.2528,-3.33702 59.13081,-18.76656 80.80601,-43.17471 21.78757,-24.53469 34.60453,-53.08104 40.75774,-90.77692 1.45592,-8.91931 1.77336,-20.13467 2.10859,-74.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.4521,158 247.95093,158 c -0.5441,0 -1.02831,77.25195 -1.20188,191.75 l -0.29067,191.75 -2.25008,8.4008 c -4.56631,17.04862 -13.111,29.64181 -21.7083,31.99377 -10.49437,2.87094 -17.6131,0.721 -22.42096,-6.77139 -8.33866,-12.99468 -13.01185,-42.83419 -13.06492,-83.42284 L 187,480.90069 l -5.75,0.57866 c -3.1625,0.31826 -23.975,1.95021 -46.25,3.62656 -57.469757,4.325 -57.792007,4.35276 -58.477817,5.03857 -0.965714,0.96572 1.287691,43.29329 3.008495,56.51106 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 6.63848,9.83842 20.64192,24.23566 30.39905,31.25391 27.10572,19.49702 58.07351,26.26876 99.32226,21.71883 z m 126.68328,-5.93892 C 375.55179,676.92679 383.53321,673 391.14395,673 c 5.02398,0 6.27334,0.40133 9.09027,2.92008 3.02015,2.70044 3.26314,3.37736 3.23071,9 l -0.0351,6.07992 17.75232,0 17.75231,0 -4.29685,-9.25 c -2.36327,-5.0875 -13.47716,-28.79719 -24.69754,-52.6882 -19.60788,-41.7501 -20.43619,-43.30459 -21.31424,-40 -10.54832,39.69946 -29.25027,70.90317 -57.95645,96.69878 L 324.83883,691 l 17.67726,0 17.67727,0 6.53407,-5.98729 z m 27.26699,4.73729 c -0.012,-2.70135 -2.15008,-8.7628 -3.60354,-10.21626 -0.84355,-0.84356 -2.73909,-1.52952 -4.21231,-1.52436 -3.48129,0.0122 -11.75141,4.83037 -16.12474,9.39428 L 366.60767,691 l 13.69616,0 c 10.29324,0 13.69478,-0.31057 13.69059,-1.25 z m 5.80822,-4.02553 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 603,670.67319 c 4.675,-2.76938 10.75,-6.77841 13.5,-8.90894 7.98708,-6.18788 21.0833,-19.44023 26.83308,-27.15295 4.97432,-6.67252 6.82523,-9.64987 13.74583,-22.1113 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -0.73543,-4.4 -3.35584,-13.69942 -5.82314,-20.66537 -6.91192,-19.51449 -17.92491,-36.1474 -34.23209,-51.70073 -12.98117,-12.38107 -17.38864,-15.53708 -35.62986,-25.51309 -7.4721,-4.08645 -27.60958,-10.22119 -37.87163,-11.53732 -5.225,-0.67011 -10.2875,-1.37091 -11.25,-1.55732 -0.9625,-0.18641 -1.75,-0.16322 -1.75,0.0515 0,0.21475 16.02752,26.83513 35.61671,59.15638 19.58919,32.32125 35.79045,59.06247 36.00279,59.42494 0.21235,0.36246 -6.02767,4.16346 -13.86671,8.44666 -43.95453,24.01645 -74.65115,45.40361 -81.8234,57.00856 -1.8445,2.98447 -1.8982,3.54538 -0.58291,6.08888 0.79682,1.54088 2.30026,3.57219 3.34099,4.51403 1.79654,1.62585 1.89995,1.60983 2.04508,-0.31673 0.0841,-1.11604 1.35547,-4.08127 2.82533,-6.58941 6.49096,-11.07598 15.29798,-17.20867 25.93969,-18.06289 13.01155,-1.04444 22.26359,3.58394 27.29619,13.65506 2.89035,5.7841 2.91637,5.80458 5.59248,4.40242 9.31102,-4.87853 23.38115,-1.22621 29.33996,7.61607 2.99826,4.44911 3.0805,12.38394 0.19205,18.52884 -2.5224,5.36618 -10.41368,12.96405 -16.18633,15.58451 -5.67556,2.57638 -15.99926,2.63273 -20.93903,0.11429 l -3.63,-1.85067 -3.0732,3.0732 c -2.6963,2.6963 -3.24891,2.89261 -4.50581,1.60068 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.0137 c 3.22628,2.93699 6.19007,4.26363 9.52518,4.26363 3.99433,0 15.76588,-12.239 16.73376,-17.39826 1.19779,-6.38477 -3.29389,-14.40633 -9.36199,-16.7193 -3.14009,-1.1969 -10.9209,-1.11862 -11.6849,0.11756 -1.06629,1.72529 -2.21499,1.10229 -3.44562,-1.86871 -1.7143,-4.1387 -6.79847,-8.69347 -12.55438,-11.24715 -3.72255,-1.65155 -7.58275,-2.33525 -15.10897,-2.67603 l -10.10897,-0.45773 -4.29719,3.87481 c -3.82064,3.4451 -9.98191,13.92854 -9.98408,16.98797 -0.001,1.5455 6.96053,7.78376 24.98272,22.38684 19.43743,15.74983 42.24448,37.83683 55.71086,53.95199 9.9066,11.85519 23.2161,30.56239 28.35733,39.85771 1.94005,3.5076 2.76193,4.18587 4.416,3.64432 1.11776,-0.36596 5.00967,-0.89021 8.64868,-1.165 6.27805,-0.47407 6.78939,-0.34479 10,2.52826 3.19851,2.86222 3.37813,3.37402 3.28326,9.35529 -0.0804,5.06805 -0.85255,7.96529 -3.87954,14.55639 -2.07855,4.52592 -4.17089,7.98686 -4.64964,7.69098 -1.1708,-0.72359 -1.11882,-0.36849 0.68853,4.70433 5.43681,15.25983 9.44101,39.845 9.44101,57.96636 0,53.19472 -20.4168,99.50551 -63.38363,143.77107 -8.55091,8.80938 -8.20549,8.86145 5.38363,0.81149 z M 651.2,598.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 6.27609,-6.05807 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.99444,4.06763 1.4895,3.06377 4.05417,-1.63845 z M 414.39982,565.60558 c 11.80825,-5.71692 25.39603,-12.95382 30.19506,-16.08199 9.46668,-6.17069 19.27819,-14.96411 22.48363,-20.15062 l 2.01752,-3.26442 -2.18972,-4.30427 c -5.60364,-11.01494 -21.16081,-26.90942 -45.14124,-46.11999 -8.10422,-6.49223 -17.21672,-14.07226 -20.25,-16.84451 L 396,453.79931 l 0,40.54588 c 0,39.30879 -0.8542,57.75589 -3.42151,73.89002 -0.67956,4.27063 -0.87841,7.76479 -0.44189,7.76479 0.43652,0 10.45497,-4.67749 22.26322,-10.39442 z M 407.2,512.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 6.27609,-6.05807 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.99444,4.06763 1.4895,3.06377 4.05417,-1.63845 z m 236.03302,-56.80818 c 0.72037,-5.23767 -0.76195,-12.04373 -3.14124,-14.42302 -0.98285,-0.98285 -2.99485,-1.49575 -5.3276,-1.35811 l -3.74833,0.22117 4.83965,10.0631 c 2.66181,5.53471 4.85302,10.73811 4.86935,11.56311 0.0604,3.05291 1.84888,-1.27265 2.50817,-6.06625 z m -494.05264,0.0235 C 184.58253,447.78074 209.44503,446 210.70647,446 l 2.29353,0 0,-49 0,-49 -4.48927,0 c -8.21136,0 -19.18123,-5.38646 -23.34484,-11.46286 -6.87466,-10.0329 -4.11707,-32.1933 5.60432,-45.03714 4.48424,-5.92456 11.82931,-11.11856 17.87659,-12.64128 L 213,277.76257 213,199.38129 C 213,156.27158 213.21319,121 213.47375,121 c 0.26056,0 34.34806,3.79919 75.75,8.44265 41.40194,4.64345 82.20392,9.1658 90.67108,10.04967 l 15.39482,1.60702 10.60518,-10.34812 C 411.72767,125.05974 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.39427,2.7942 -15.10077,3.60536 -24.5,7.34279 -11.75334,4.6735 -22.7589,10.67353 -32,17.44584 -10.37457,7.60297 -27.08888,24.68754 -32.50621,33.2263 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.55588 c 2.907815,-0.30573 29.117355,-2.33662 58.243415,-4.51308 z M 97.2,392.8 c -1.598363,-1.59836 -1.512591,-3.29484 0.348549,-6.89388 1.757195,-3.39804 7.027401,-7.00608 9.082021,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 C 99.272446,394.28862 98.675142,394.27514 97.2,392.8 z m 6.27609,-6.05807 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.994436,4.06763 1.4895,3.06377 4.05417,-1.63845 z M 135.4214,244.16674 c -13.55141,-6.3643 -13.14493,-24.04675 0.95055,-41.35043 5.34287,-6.55893 10.55869,-9.08205 18.70943,-9.05057 8.87966,0.0343 17.79345,5.90306 19.54093,12.86556 2.66485,10.61762 -7.09273,28.87176 -19.23769,35.98918 -5.97025,3.4988 -14.41324,4.15276 -19.96322,1.54626 z m 16.50778,-3.12884 c 3.36244,-1.79952 10.38862,-17.2833 10.87139,-23.95758 0.81886,-11.32067 -4.70149,-17.48578 -15.06169,-16.82085 -4.95219,0.31784 -6.257,0.85038 -9.29266,3.79265 -7.06147,6.84425 -11.66012,20.72609 -9.5105,28.70916 1.13598,4.21872 5.34846,8.43613 9.56428,9.57548 2.82435,0.76329 11.06533,-0.0338 13.42918,-1.29886 z m 16.68246,-18.69443 c 2.78117,-6.28871 3.19785,-14.74275 0.88911,-18.03894 C 167.65708,201.67233 161.86713,198 159.56076,198 c -1.24546,0 -0.77377,0.87653 1.75523,3.26169 5.44828,5.13839 7.06282,13.839 4.28242,23.07757 -1.83597,6.10049 -0.0418,4.91211 3.01323,-1.99579 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -5.99712,0 c -5.50707,0 -6.33056,0.30125 -10.07768,3.68654 -9.19988,8.31154 -14.345,27.05964 -10.86507,39.59079 2.2932,8.25776 11.82081,14.55682 22.18987,14.67056 L 213,344 l 0,-29 z m 389.99219,17.41054 c 7.95467,-7.44066 9.87173,-16.49994 4.84414,-22.89148 -2.67536,-3.40117 -8.94825,-6.52466 -13.04649,-6.49629 l -3.28984,0.0228 3.27735,1.61538 c 5.84955,2.88319 10.2499,10.15118 10.19511,16.83908 -0.0238,2.90878 -3.34831,9.69601 -5.83123,11.90499 -2.01196,1.78998 -2.8145,3.59501 -1.59839,3.59501 0.29856,0 2.75077,-2.06526 5.44935,-4.58946 z M 566.6399,289.52745 C 563.03235,286.79488 548,284.75659 548,287 c 0,0.55 2.5875,1.03424 5.75,1.07608 3.1625,0.0418 7.325,0.68261 9.25,1.42392 4.58406,1.76531 5.94782,1.7756 3.6399,0.0274 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3480"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#83713a"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.84089 c 29.80838,-15.41171 53.44407,-32.23202 73.61326,-52.38678 26.97372,-26.95441 42.77179,-56.17107 49.21771,-91.02233 2.58966,-14.00159 2.2673,-42.8501 -0.63134,-56.5 -10.83452,-51.02034 -41.9585,-94.62858 -102.16535,-143.1453 -12.68793,-10.22435 -25.83139,-22.72773 -32.62532,-31.03646 -1.19575,-1.46236 -3.87044,-6.1822 -5.94377,-10.48853 -6.85438,-14.23668 -4.90715,-24.25372 7.61243,-39.16028 10.98237,-13.07627 30.86203,-28.40084 58.02535,-44.72983 7.96404,-4.78751 14.84794,-9.03531 15.29755,-9.43956 C 566.29894,219.1176 497.91289,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.62103,14.07223 -62.58871,45.29094 -83.41995,70.44701 -14.41716,17.41035 -30.58617,44.47892 -37.03478,62 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.85471,23.62177 31.65569,40.01232 59.59664,61.82034 10.15047,7.92249 24.73646,21.08011 33.59884,30.30859 30.85297,32.12751 33.23388,54.48501 8.36699,78.56855 -7.77488,7.52996 -13.42109,11.86388 -24.02162,18.43854 -7.70579,4.77928 -26.8444,15.0756 -29.7551,16.00784 -0.99889,0.31993 3.77856,11.42687 17.37678,40.39869 C 473.04065,684.69919 483.8727,707 484.69351,707 c 0.35223,0 8.55278,-4.0909 18.22345,-9.09089 z M 240.04415,690.95163 C 295.58054,684.82572 341.71099,640.07682 357.51388,577 c 5.54775,-22.14367 5.77808,-25.65288 6.20261,-94.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.4521,158 247.95093,158 c -0.5441,0 -1.02831,77.25195 -1.20188,191.75 l -0.29067,191.75 -2.25008,8.4008 c -4.56631,17.04862 -13.111,29.64181 -21.7083,31.99377 -5.09215,1.39305 -11.33829,1.40637 -15.27919,0.0326 -6.67777,-2.32788 -13.46628,-16.98989 -16.63426,-35.92713 -1.76644,-10.55924 -3.55074,-37.69497 -3.57243,-54.32959 L 187,480.84081 l -6.25,0.61688 c -3.4375,0.33928 -24.475,2.0002 -46.75,3.69094 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 6.63848,9.83842 20.64192,24.23566 30.39905,31.25391 27.10572,19.49702 58.07351,26.26876 99.32226,21.71883 z m 126.68328,-5.93892 C 375.55179,676.92679 383.53321,673 391.14395,673 c 5.02398,0 6.27334,0.40133 9.09027,2.92008 3.02015,2.70044 3.26314,3.37736 3.23071,9 l -0.0351,6.07992 17.82026,0 c 16.64097,0 17.76188,-0.11581 16.93832,-1.75 -0.48507,-0.9625 -11.61821,-24.64807 -24.74032,-52.6346 -19.17199,-40.88956 -23.99362,-50.4162 -24.54685,-48.5 -12.7114,44.02809 -28.27939,70.22516 -57.72363,97.1346 l -6.29164,5.75 17.65368,0 17.65368,0 6.53407,-5.98729 z m 27.26699,4.73729 c -0.012,-2.70135 -2.15008,-8.7628 -3.60354,-10.21626 -0.84355,-0.84356 -2.73909,-1.52952 -4.21231,-1.52436 -3.48129,0.0122 -11.75141,4.83037 -16.12474,9.39428 L 366.60767,691 l 13.69616,0 c 10.29324,0 13.69478,-0.31057 13.69059,-1.25 z m 5.80822,-4.02553 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.63719,-4.97335 5.77272,-8.48795 12.31197,-20.26271 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.04265,-18.20399 -11.94053,-38.0547 -25.10144,-56 -8.92638,-12.1714 -28.40076,-29.66796 -39.99671,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.42831,-1.86529 -16,-2.27734 -16,-1.84584 0,0.19512 16.02973,26.77968 35.62161,59.0768 19.59189,32.29712 35.79315,59.0186 36.0028,59.38107 0.20965,0.36246 -6.03258,4.16346 -13.87162,8.44666 -43.95453,24.01645 -74.65115,45.40361 -81.8234,57.00856 -1.8445,2.98447 -1.8982,3.54538 -0.58291,6.08888 0.79682,1.54088 2.30026,3.57219 3.34099,4.51403 1.79654,1.62585 1.89995,1.60983 2.04508,-0.31673 0.0841,-1.11604 1.35547,-4.08127 2.82533,-6.58941 6.49096,-11.07598 15.29798,-17.20867 25.93969,-18.06289 13.01155,-1.04444 22.26359,3.58394 27.29619,13.65506 2.89035,5.7841 2.91637,5.80458 5.59248,4.40242 9.31102,-4.87853 23.38115,-1.22621 29.33996,7.61607 2.99826,4.44911 3.0805,12.38394 0.19205,18.52884 -2.5224,5.36618 -10.41368,12.96405 -16.18633,15.58451 -5.67556,2.57638 -15.99926,2.63273 -20.93903,0.11429 l -3.63,-1.85067 -3.0732,3.0732 c -2.6963,2.6963 -3.24891,2.89261 -4.50581,1.60068 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.0137 c 3.22628,2.93699 6.19007,4.26363 9.52518,4.26363 3.99433,0 15.76588,-12.239 16.73376,-17.39826 1.19779,-6.38477 -3.29389,-14.40633 -9.36199,-16.7193 -3.14009,-1.1969 -10.9209,-1.11862 -11.6849,0.11756 -1.06629,1.72529 -2.21499,1.10229 -3.44562,-1.86871 -1.7143,-4.1387 -6.79847,-8.69347 -12.55438,-11.24715 -3.72255,-1.65155 -7.58275,-2.33525 -15.10897,-2.67603 l -10.10897,-0.45773 -4.30849,3.87481 c -2.72717,2.45267 -5.50162,6.44227 -7.55934,10.87018 l -3.25086,6.99537 3.16832,2.75751 c 1.74257,1.51663 9.60155,7.98029 17.46441,14.3637 36.00268,29.22854 61.40216,55.7846 80.02804,83.67214 3.75272,5.61875 7.90046,12.15528 9.21719,14.52561 1.94772,3.50622 2.77296,4.18565 4.42637,3.64432 1.11776,-0.36596 5.00967,-0.89021 8.64868,-1.165 6.27805,-0.47407 6.78939,-0.34479 10,2.52826 3.19851,2.86222 3.37813,3.37402 3.28326,9.35529 -0.0804,5.06805 -0.85255,7.96529 -3.87954,14.55639 -2.07855,4.52592 -4.17089,7.98686 -4.64964,7.69098 -1.1708,-0.72359 -1.11882,-0.36849 0.68853,4.70433 5.43681,15.25983 9.44101,39.845 9.44101,57.96636 0,53.19972 -20.28812,99.2293 -63.38363,143.8044 l -8.11637,8.39504 5,-2.79902 c 2.75,-1.53946 6.35,-3.52719 8,-4.41718 z M 651.2,598.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 6.27609,-6.05807 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.99444,4.06763 1.4895,3.06377 4.05417,-1.63845 z M 429,558.51973 c 16.46254,-8.25457 32.98976,-20.913 38.09975,-29.18113 l 2.03876,-3.29878 -3.31045,-6.26991 c -4.28357,-8.113 -24.68543,-28.76125 -41.82806,-42.33323 -6.875,-5.443 -15.94438,-12.92973 -20.15418,-16.63717 l -7.65417,-6.74081 -0.47131,48.22065 c -0.36707,37.55562 -0.83721,50.76412 -2.12571,59.72065 -0.90992,6.325 -1.88999,12.2677 -2.17794,13.20601 -0.49784,1.62227 13.18603,-4.45311 37.58331,-16.68628 z M 407.2,512.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 6.27609,-6.05807 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.99444,4.06763 1.4895,3.06377 4.05417,-1.63845 z m 236.03302,-56.80818 c 0.72037,-5.23767 -0.76195,-12.04373 -3.14124,-14.42302 -0.98285,-0.98285 -2.99485,-1.49575 -5.3276,-1.35811 l -3.74833,0.22117 4.83965,10.0631 c 2.66181,5.53471 4.85302,10.73811 4.86935,11.56311 0.0604,3.05291 1.84888,-1.27265 2.50817,-6.06625 z m -494.06564,0.0334 C 184.56238,447.78524 209.42488,446 210.69347,446 l 2.30653,0 0,-49 0,-49 -4.48927,0 c -8.21136,0 -19.18123,-5.38646 -23.34484,-11.46286 -6.87466,-10.0329 -4.11707,-32.1933 5.60432,-45.03714 4.48424,-5.92456 11.82931,-11.11856 17.87659,-12.64128 l 4.3532,-1.09615 0,-78.50909 0,-78.5091 3.75,0.55783 c 2.0625,0.30681 43.03607,4.92767 91.05238,10.26858 l 87.30239,9.71074 10.69761,-10.43922 C 411.68607,125.10074 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.39427,2.7942 -15.10077,3.60536 -24.5,7.34279 -11.75334,4.6735 -22.7589,10.67353 -32,17.44584 -10.37457,7.60297 -27.08888,24.68754 -32.50621,33.2263 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.54589 c 2.907815,-0.30024 29.111505,-2.33113 58.230415,-4.51308 z M 97.2,392.8 c -1.598363,-1.59836 -1.512591,-3.29484 0.348549,-6.89388 1.757195,-3.39804 7.027401,-7.00608 9.082021,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 C 99.272446,394.28862 98.675142,394.27514 97.2,392.8 z m 6.27609,-6.05807 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.994436,4.06763 1.4895,3.06377 4.05417,-1.63845 z M 135.4214,244.16674 c -13.55141,-6.3643 -13.14493,-24.04675 0.95055,-41.35043 5.34287,-6.55893 10.55869,-9.08205 18.70943,-9.05057 8.87966,0.0343 17.79345,5.90306 19.54093,12.86556 2.66485,10.61762 -7.09273,28.87176 -19.23769,35.98918 -5.97025,3.4988 -14.41324,4.15276 -19.96322,1.54626 z m 16.50778,-3.12884 c 3.36244,-1.79952 10.38862,-17.2833 10.87139,-23.95758 0.81886,-11.32067 -4.70149,-17.48578 -15.06169,-16.82085 -4.95219,0.31784 -6.257,0.85038 -9.29266,3.79265 -7.06147,6.84425 -11.66012,20.72609 -9.5105,28.70916 1.13598,4.21872 5.34846,8.43613 9.56428,9.57548 2.82435,0.76329 11.06533,-0.0338 13.42918,-1.29886 z m 16.68246,-18.69443 c 2.78117,-6.28871 3.19785,-14.74275 0.88911,-18.03894 C 167.65708,201.67233 161.86713,198 159.56076,198 c -1.24546,0 -0.77377,0.87653 1.75523,3.26169 5.44828,5.13839 7.06282,13.839 4.28242,23.07757 -1.83597,6.10049 -0.0418,4.91211 3.01323,-1.99579 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -5.99712,0 c -5.50707,0 -6.33056,0.30125 -10.07768,3.68654 -9.19988,8.31154 -14.345,27.05964 -10.86507,39.59079 2.2932,8.25776 11.82081,14.55682 22.18987,14.67056 L 213,344 l 0,-29 z m 389.99219,17.41054 c 7.95467,-7.44066 9.87173,-16.49994 4.84414,-22.89148 -2.67536,-3.40117 -8.94825,-6.52466 -13.04649,-6.49629 l -3.28984,0.0228 3.27735,1.61538 c 5.84955,2.88319 10.2499,10.15118 10.19511,16.83908 -0.0238,2.90878 -3.34831,9.69601 -5.83123,11.90499 -2.01196,1.78998 -2.8145,3.59501 -1.59839,3.59501 0.29856,0 2.75077,-2.06526 5.44935,-4.58946 z M 566.6399,289.52745 C 563.03235,286.79488 548,284.75659 548,287 c 0,0.55 2.5875,1.03424 5.75,1.07608 3.1625,0.0418 7.325,0.68261 9.25,1.42392 4.58406,1.76531 5.94782,1.7756 3.6399,0.0274 z M 213,283 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 0,0.55 0.45,1 1,1 0.55,0 1,-0.45 1,-1 z"
+       id="path3478"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#7b7142"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.84089 c 29.80838,-15.41171 53.44407,-32.23202 73.61326,-52.38678 26.97372,-26.95441 42.77179,-56.17107 49.21771,-91.02233 2.58966,-14.00159 2.2673,-42.8501 -0.63134,-56.5 -10.83452,-51.02034 -41.9585,-94.62858 -102.16535,-143.1453 -12.68793,-10.22435 -25.83139,-22.72773 -32.62532,-31.03646 -1.19575,-1.46236 -3.87044,-6.1822 -5.94377,-10.48853 -6.85438,-14.23668 -4.90715,-24.25372 7.61243,-39.16028 10.98237,-13.07627 30.86203,-28.40084 58.02535,-44.72983 7.96404,-4.78751 14.84794,-9.03531 15.29755,-9.43956 C 566.29894,219.1176 497.91289,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.62103,14.07223 -62.58871,45.29094 -83.41995,70.44701 -14.41716,17.41035 -30.58617,44.47892 -37.03478,62 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.85471,23.62177 31.65569,40.01232 59.59664,61.82034 10.15047,7.92249 24.73646,21.08011 33.59884,30.30859 30.85297,32.12751 33.23388,54.48501 8.36699,78.56855 -7.77488,7.52996 -13.42109,11.86388 -24.02162,18.43854 -7.70579,4.77928 -26.8444,15.0756 -29.7551,16.00784 -0.99889,0.31993 3.77856,11.42687 17.37678,40.39869 C 473.04065,684.69919 483.8727,707 484.69351,707 c 0.35223,0 8.55278,-4.0909 18.22345,-9.09089 z M 240.04415,690.95163 C 295.58054,684.82572 341.71099,640.07682 357.51388,577 c 5.54775,-22.14367 5.77808,-25.65288 6.20261,-94.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.4521,158 247.95093,158 c -0.5441,0 -1.02831,77.25195 -1.20188,191.75 l -0.29067,191.75 -2.25008,8.4008 c -4.56631,17.04862 -13.111,29.64181 -21.7083,31.99377 -5.09215,1.39305 -11.33829,1.40637 -15.27919,0.0326 -6.67777,-2.32788 -13.46628,-16.98989 -16.63426,-35.92713 -1.76644,-10.55924 -3.55074,-37.69497 -3.57243,-54.32959 L 187,480.84081 l -6.25,0.61688 c -3.4375,0.33928 -24.475,2.0002 -46.75,3.69094 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 6.63848,9.83842 20.64192,24.23566 30.39905,31.25391 27.10572,19.49702 58.07351,26.26876 99.32226,21.71883 z m 126.68328,-5.93892 C 375.55179,676.92679 383.53321,673 391.14395,673 c 5.02398,0 6.27334,0.40133 9.09027,2.92008 3.02015,2.70044 3.26314,3.37736 3.23071,9 l -0.0351,6.07992 17.82026,0 c 16.64097,0 17.76188,-0.11581 16.93832,-1.75 -0.48507,-0.9625 -11.61821,-24.64807 -24.74032,-52.6346 -19.17199,-40.88956 -23.99362,-50.4162 -24.54685,-48.5 -12.7114,44.02809 -28.27939,70.22516 -57.72363,97.1346 l -6.29164,5.75 17.65368,0 17.65368,0 6.53407,-5.98729 z m 27.26699,4.73729 c -0.012,-2.70135 -2.15008,-8.7628 -3.60354,-10.21626 -0.84355,-0.84356 -2.73909,-1.52952 -4.21231,-1.52436 -3.48129,0.0122 -11.75141,4.83037 -16.12474,9.39428 L 366.60767,691 l 13.69616,0 c 10.29324,0 13.69478,-0.31057 13.69059,-1.25 z m 5.80822,-4.02553 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.63719,-4.97335 5.77272,-8.48795 12.31197,-20.26271 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.04265,-18.20399 -11.94053,-38.0547 -25.10144,-56 -8.92638,-12.1714 -28.40076,-29.66796 -39.99671,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.42831,-1.86529 -16,-2.27734 -16,-1.84584 0,0.19512 16.02973,26.77968 35.62161,59.0768 19.59189,32.29712 35.79315,59.0186 36.0028,59.38107 0.20965,0.36246 -6.03258,4.16346 -13.87162,8.44666 -43.95453,24.01645 -74.65115,45.40361 -81.8234,57.00856 -1.8445,2.98447 -1.8982,3.54538 -0.58291,6.08888 0.79682,1.54088 2.30026,3.57219 3.34099,4.51403 1.79654,1.62585 1.89995,1.60983 2.04508,-0.31673 0.0841,-1.11604 1.35547,-4.08127 2.82533,-6.58941 6.49096,-11.07598 15.29798,-17.20867 25.93969,-18.06289 13.01155,-1.04444 22.26359,3.58394 27.29619,13.65506 2.89035,5.7841 2.91637,5.80458 5.59248,4.40242 9.31102,-4.87853 23.38115,-1.22621 29.33996,7.61607 2.99826,4.44911 3.0805,12.38394 0.19205,18.52884 -2.5224,5.36618 -10.41368,12.96405 -16.18633,15.58451 -5.67556,2.57638 -15.99926,2.63273 -20.93903,0.11429 l -3.63,-1.85067 -3.0732,3.0732 c -2.6963,2.6963 -3.24891,2.89261 -4.50581,1.60068 -1.24942,-1.28423 -0.862,-2.09766 3.0297,-6.36119 l 4.46232,-4.88867 2.21205,2.0137 c 3.22628,2.93699 6.19007,4.26363 9.52518,4.26363 3.99433,0 15.76588,-12.239 16.73376,-17.39826 1.19779,-6.38477 -3.29389,-14.40633 -9.36199,-16.7193 -3.14009,-1.1969 -10.9209,-1.11862 -11.6849,0.11756 -1.06629,1.72529 -2.21499,1.10229 -3.44562,-1.86871 -1.7143,-4.1387 -6.79847,-8.69347 -12.55438,-11.24715 -3.72255,-1.65155 -7.58275,-2.33525 -15.10897,-2.67603 l -10.10897,-0.45773 -4.30849,3.87481 c -2.72717,2.45267 -5.50162,6.44227 -7.55934,10.87018 l -3.25086,6.99537 3.16832,2.75751 c 1.74257,1.51663 9.60155,7.98029 17.46441,14.3637 36.00268,29.22854 61.40216,55.7846 80.02804,83.67214 3.75272,5.61875 7.90046,12.15528 9.21719,14.52561 1.94772,3.50622 2.77296,4.18565 4.42637,3.64432 1.11776,-0.36596 5.00967,-0.89021 8.64868,-1.165 6.27805,-0.47407 6.78939,-0.34479 10,2.52826 3.19851,2.86222 3.37813,3.37402 3.28326,9.35529 -0.0804,5.06805 -0.85255,7.96529 -3.87954,14.55639 -2.07855,4.52592 -4.17089,7.98686 -4.64964,7.69098 -1.1708,-0.72359 -1.11882,-0.36849 0.68853,4.70433 5.43681,15.25983 9.44101,39.845 9.44101,57.96636 0,53.19972 -20.28812,99.2293 -63.38363,143.8044 l -8.11637,8.39504 5,-2.79902 c 2.75,-1.53946 6.35,-3.52719 8,-4.41718 z M 651.2,598.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 6.27609,-6.05807 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.99444,4.06763 1.4895,3.06377 4.05417,-1.63845 z M 429,558.51973 c 16.46254,-8.25457 32.98976,-20.913 38.09975,-29.18113 l 2.03876,-3.29878 -3.31045,-6.26991 c -4.28357,-8.113 -24.68543,-28.76125 -41.82806,-42.33323 -6.875,-5.443 -15.94438,-12.92973 -20.15418,-16.63717 l -7.65417,-6.74081 -0.47131,48.22065 c -0.36707,37.55562 -0.83721,50.76412 -2.12571,59.72065 -0.90992,6.325 -1.88999,12.2677 -2.17794,13.20601 -0.49784,1.62227 13.18603,-4.45311 37.58331,-16.68628 z M 407.2,512.8 c -1.59836,-1.59836 -1.51259,-3.29484 0.34855,-6.89388 1.75719,-3.39804 7.0274,-7.00608 9.08202,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 -3.01523,1.37383 -3.61254,1.36035 -5.08768,-0.11479 z m 6.27609,-6.05807 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.99444,4.06763 1.4895,3.06377 4.05417,-1.63845 z m 236.03302,-56.80818 c 0.72037,-5.23767 -0.76195,-12.04373 -3.14124,-14.42302 -0.98285,-0.98285 -2.99485,-1.49575 -5.3276,-1.35811 l -3.74833,0.22117 4.83965,10.0631 c 2.66181,5.53471 4.85302,10.73811 4.86935,11.56311 0.0604,3.05291 1.84888,-1.27265 2.50817,-6.06625 z m -494.06564,0.0334 C 184.56238,447.78524 209.42488,446 210.69347,446 l 2.30653,0 0,-49 0,-49 -4.48927,0 c -8.21136,0 -19.18123,-5.38646 -23.34484,-11.46286 -6.87466,-10.0329 -4.11707,-32.1933 5.60432,-45.03714 4.48424,-5.92456 11.82931,-11.11856 17.87659,-12.64128 l 4.3532,-1.09615 0,-78.50909 0,-78.5091 3.75,0.55783 c 2.0625,0.30681 43.03607,4.92767 91.05238,10.26858 l 87.30239,9.71074 10.69761,-10.43922 C 411.68607,125.10074 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.39427,2.7942 -15.10077,3.60536 -24.5,7.34279 -11.75334,4.6735 -22.7589,10.67353 -32,17.44584 -10.37457,7.60297 -27.08888,24.68754 -32.50621,33.2263 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.54589 c 2.907815,-0.30024 29.111505,-2.33113 58.230415,-4.51308 z M 97.2,392.8 c -1.598363,-1.59836 -1.512591,-3.29484 0.348549,-6.89388 1.757195,-3.39804 7.027401,-7.00608 9.082021,-6.21764 3.49151,1.33982 0.2802,11.11988 -4.34289,13.22631 C 99.272446,394.28862 98.675142,394.27514 97.2,392.8 z m 6.27609,-6.05807 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.994436,4.06763 1.4895,3.06377 4.05417,-1.63845 z M 135.4214,244.16674 c -13.55141,-6.3643 -13.14493,-24.04675 0.95055,-41.35043 5.34287,-6.55893 10.55869,-9.08205 18.70943,-9.05057 8.87966,0.0343 17.79345,5.90306 19.54093,12.86556 2.66485,10.61762 -7.09273,28.87176 -19.23769,35.98918 -5.97025,3.4988 -14.41324,4.15276 -19.96322,1.54626 z m 16.50778,-3.12884 c 3.36244,-1.79952 10.38862,-17.2833 10.87139,-23.95758 0.81886,-11.32067 -4.70149,-17.48578 -15.06169,-16.82085 -4.95219,0.31784 -6.257,0.85038 -9.29266,3.79265 -7.06147,6.84425 -11.66012,20.72609 -9.5105,28.70916 1.13598,4.21872 5.34846,8.43613 9.56428,9.57548 2.82435,0.76329 11.06533,-0.0338 13.42918,-1.29886 z m 17.07996,-19.28079 c 2.74374,-6.37799 3.00518,-13.56012 0.6258,-17.19151 -2.22038,-3.38873 -7.40588,-6.56871 -10.63494,-6.52182 l -2.5,0.0363 2.65857,1.44399 c 6.42759,3.49113 9.48549,15.15578 6.49632,24.78088 -1.98485,6.3912 0.23374,4.70599 3.35425,-2.54784 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -5.99712,0 c -5.50707,0 -6.33056,0.30125 -10.07768,3.68654 -9.19988,8.31154 -14.345,27.05964 -10.86507,39.59079 2.2932,8.25776 11.82081,14.55682 22.18987,14.67056 L 213,344 l 0,-29 z m 390.54251,16.75 c 5.04336,-5.05476 7.43768,-9.98743 7.45191,-15.35212 0.015,-5.6706 -9.24319,-13.39075 -15.99442,-13.33723 l -3.5,0.0277 3.75245,1.98095 c 7.33878,3.87421 11.41408,14.00634 8.46879,21.05539 -0.80908,1.9364 -2.92396,5.1755 -4.69974,7.198 -4.91695,5.6001 -1.42291,4.38462 4.52101,-1.57273 z M 568.00262,290.50316 C 565.2906,287.23537 549.06767,284.46346 547.5,287 c -0.38586,0.62434 1.75204,1.02043 5.69098,1.05438 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.6676,1.88859 4.87244,1.94562 0.20485,0.057 -0.18657,-0.56989 -0.86982,-1.39315 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3476"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#8b6c34"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.84089 c 29.80838,-15.41171 53.44407,-32.23202 73.61326,-52.38678 26.97372,-26.95441 42.77179,-56.17107 49.21771,-91.02233 2.58966,-14.00159 2.2673,-42.8501 -0.63134,-56.5 -10.83452,-51.02034 -41.9585,-94.62858 -102.16535,-143.1453 -12.68793,-10.22435 -25.83139,-22.72773 -32.62532,-31.03646 -1.19575,-1.46236 -3.87044,-6.1822 -5.94377,-10.48853 -6.85438,-14.23668 -4.90715,-24.25372 7.61243,-39.16028 10.98237,-13.07627 30.86203,-28.40084 58.02535,-44.72983 7.96404,-4.78751 14.84794,-9.03531 15.29755,-9.43956 C 566.29894,219.1176 497.91289,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.62103,14.07223 -62.58871,45.29094 -83.41995,70.44701 -14.41716,17.41035 -30.58617,44.47892 -37.03478,62 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.85471,23.62177 31.65569,40.01232 59.59664,61.82034 10.15047,7.92249 24.73646,21.08011 33.59884,30.30859 30.85297,32.12751 33.23388,54.48501 8.36699,78.56855 -7.77488,7.52996 -13.42109,11.86388 -24.02162,18.43854 -7.70579,4.77928 -26.8444,15.0756 -29.7551,16.00784 -0.99889,0.31993 3.77856,11.42687 17.37678,40.39869 C 473.04065,684.69919 483.8727,707 484.69351,707 c 0.35223,0 8.55278,-4.0909 18.22345,-9.09089 z M 240.04415,690.95163 C 295.58054,684.82572 341.71099,640.07682 357.51388,577 c 5.54775,-22.14367 5.77808,-25.65288 6.20261,-94.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.4521,158 247.95093,158 c -0.5441,0 -1.02831,77.25195 -1.20188,191.75 l -0.29067,191.75 -2.25008,8.4008 c -4.56631,17.04862 -13.111,29.64181 -21.7083,31.99377 -5.09215,1.39305 -11.33829,1.40637 -15.27919,0.0326 -6.67777,-2.32788 -13.46628,-16.98989 -16.63426,-35.92713 -1.76644,-10.55924 -3.55074,-37.69497 -3.57243,-54.32959 L 187,480.84081 l -6.25,0.61688 c -3.4375,0.33928 -24.475,2.0002 -46.75,3.69094 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 6.63848,9.83842 20.64192,24.23566 30.39905,31.25391 27.10572,19.49702 58.07351,26.26876 99.32226,21.71883 z m 126.69525,-5.875 c 9.17188,-8.27796 15.01693,-11.25469 23.25718,-11.84427 6.35915,-0.455 6.86685,-0.32609 10.09958,2.56436 3.17571,2.83946 3.40149,3.45091 3.36877,9.12336 l -0.0351,6.07992 17.82026,0 c 16.64097,0 17.76188,-0.11581 16.93832,-1.75 -0.48507,-0.9625 -11.61821,-24.64807 -24.74032,-52.6346 -19.17199,-40.88956 -23.99362,-50.4162 -24.54685,-48.5 -12.7114,44.02809 -28.27939,70.22516 -57.72363,97.1346 l -6.29164,5.75 17.64519,0 17.64519,0 6.56302,-5.92337 z m 27.25502,4.67337 c -0.012,-2.70135 -2.15008,-8.7628 -3.60354,-10.21626 -0.84355,-0.84356 -2.73909,-1.52952 -4.21231,-1.52436 -3.48129,0.0122 -11.75141,4.83037 -16.12474,9.39428 L 366.60767,691 l 13.69616,0 c 10.29324,0 13.69478,-0.31057 13.69059,-1.25 z m 5.80822,-4.02553 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.63719,-4.97335 5.77272,-8.48795 12.31197,-20.26271 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.04265,-18.20399 -11.94053,-38.0547 -25.10144,-56 -8.92638,-12.1714 -28.40076,-29.66796 -39.99671,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.42831,-1.86529 -16,-2.27734 -16,-1.84584 0,0.19512 16.02973,26.77968 35.62161,59.0768 19.59189,32.29712 35.79315,59.0186 36.0028,59.38107 0.20965,0.36246 -6.03258,4.16346 -13.87162,8.44666 -43.95453,24.01645 -74.65115,45.40361 -81.8234,57.00856 -1.8445,2.98447 -1.8982,3.54538 -0.58291,6.08888 1.87803,3.6317 5.32019,6.84149 5.32019,4.96104 0,-3.09283 5.08296,-11.51384 9.81484,-16.26038 14.7422,-14.78786 39.4029,-11.75534 47.03502,5.78387 1.03207,2.37179 1.97402,4.4608 2.09322,4.64224 0.1192,0.18145 1.47348,-0.49355 3.00951,-1.5 4.16003,-2.72576 15.51991,-2.48826 21.07281,0.44057 12.37248,6.52576 13.76083,21.10201 3.11896,32.74592 C 601.14764,340.8072 594.51664,344 586.03805,344 c -4.56971,0 -7.62983,-0.57914 -10.05365,-1.90268 l -3.4844,-1.90268 -3.2592,3.10776 c -2.84158,2.70955 -3.44054,2.92132 -4.67437,1.65268 -1.22626,-1.26085 -0.81952,-2.10763 3.04715,-6.34374 l 4.46232,-4.88867 2.21205,2.0137 c 3.22628,2.93699 6.19007,4.26363 9.52518,4.26363 3.99433,0 15.76588,-12.239 16.73376,-17.39826 1.19779,-6.38477 -3.29389,-14.40633 -9.36199,-16.7193 -3.14009,-1.1969 -10.9209,-1.11862 -11.6849,0.11756 -1.06629,1.72529 -2.21499,1.10229 -3.44562,-1.86871 -1.7143,-4.1387 -6.79847,-8.69347 -12.55438,-11.24715 -3.72255,-1.65155 -7.58275,-2.33525 -15.10897,-2.67603 l -10.10897,-0.45773 -4.30849,3.87481 c -2.72717,2.45267 -5.50162,6.44227 -7.55934,10.87018 l -3.25086,6.99537 3.16832,2.75751 c 1.74257,1.51663 9.60155,7.98029 17.46441,14.3637 36.00268,29.22854 61.40216,55.7846 80.02804,83.67214 3.75272,5.61875 7.90046,12.15528 9.21719,14.52561 1.92926,3.47299 2.78863,4.18855 4.42637,3.68568 1.11776,-0.34321 4.97175,-0.87353 8.56442,-1.17848 6.03302,-0.51209 6.77538,-0.34976 9.71599,2.1246 3.86943,3.25591 4.92173,7.81295 3.30797,14.3254 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.16337,-0.719 -1.11027,-0.35948 0.69538,4.70856 5.43681,15.25983 9.44101,39.845 9.44101,57.96636 0,53.19972 -20.28812,99.2293 -63.38363,143.8044 l -8.11637,8.39504 5,-2.79902 c 2.75,-1.53946 6.35,-3.52719 8,-4.41718 z m 49.04367,-72.41828 C 647.72206,595.86116 653.86164,586 659.42308,586 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z m 5.93242,-5.91366 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.99444,4.06763 1.4895,3.06377 4.05417,-1.63845 z M 429,558.51973 c 16.46254,-8.25457 32.98976,-20.913 38.09975,-29.18113 l 2.03876,-3.29878 -3.31045,-6.26991 c -4.28357,-8.113 -24.68543,-28.76125 -41.82806,-42.33323 -6.875,-5.443 -15.94438,-12.92973 -20.15418,-16.63717 l -7.65417,-6.74081 -0.47131,48.22065 c -0.36707,37.55562 -0.83721,50.76412 -2.12571,59.72065 -0.90992,6.325 -1.88999,12.2677 -2.17794,13.20601 -0.49784,1.62227 13.18603,-4.45311 37.58331,-16.68628 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z m 5.93242,-5.91366 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.99444,4.06763 1.4895,3.06377 4.05417,-1.63845 z m 236.03302,-56.80818 c 0.72037,-5.23767 -0.76195,-12.04373 -3.14124,-14.42302 -0.98285,-0.98285 -2.99485,-1.49575 -5.3276,-1.35811 l -3.74833,0.22117 4.83965,10.0631 c 2.66181,5.53471 4.85302,10.73811 4.86935,11.56311 0.0604,3.05291 1.84888,-1.27265 2.50817,-6.06625 z m -494.06564,0.0334 C 184.56238,447.78524 209.42488,446 210.69347,446 l 2.30653,0 0,-48.86111 0,-48.86111 -5.86341,-0.53168 c -10.99491,-0.99698 -21.63725,-7.85685 -24.33173,-15.68381 -0.67448,-1.95926 -1.21828,-7.1804 -1.20844,-11.60254 0.0433,-19.46697 10.65,-36.28301 25.92189,-41.09704 L 213,277.63476 l 0,-78.44519 0,-78.44519 3.75,0.55783 c 2.0625,0.30681 43.03607,4.92767 91.05238,10.26858 l 87.30239,9.71074 10.69761,-10.43922 C 411.68607,125.10074 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.39427,2.7942 -15.10077,3.60536 -24.5,7.34279 -11.75334,4.6735 -22.7589,10.67353 -32,17.44584 -10.37457,7.60297 -27.08888,24.68754 -32.50621,33.2263 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.54589 c 2.907815,-0.30024 29.111505,-2.33113 58.230415,-4.51308 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.922256,1.33146 -2.540092,1.35234 -4.744009,-0.2592 z m 5.932419,-5.91366 c 1.08685,-1.9927 1.63685,-3.96233 1.22222,-4.37695 -1.11596,-1.11597 -4.46691,2.70431 -5.27639,6.0154 -0.994436,4.06763 1.4895,3.06377 4.05417,-1.63845 z M 136.5,244.49799 c -4.86245,-1.71915 -9.03192,-6.1432 -10.3754,-11.0089 -3.03876,-11.00548 7.22777,-32.09261 18.21397,-37.41094 5.71908,-2.76856 15.27671,-2.82523 20.57548,-0.122 4.42762,2.2588 8.80689,7.08381 9.71563,10.70452 2.00549,7.99052 -3.50219,21.37534 -12.4903,30.35405 -8.26211,8.25348 -16.58787,10.68349 -25.63938,7.48327 z m 15.42918,-3.46009 c 3.36244,-1.79952 10.38862,-17.2833 10.87139,-23.95758 0.81886,-11.32067 -4.70149,-17.48578 -15.06169,-16.82085 -4.95219,0.31784 -6.257,0.85038 -9.29266,3.79265 -7.06147,6.84425 -11.66012,20.72609 -9.5105,28.70916 1.13598,4.21872 5.34846,8.43613 9.56428,9.57548 2.82435,0.76329 11.06533,-0.0338 13.42918,-1.29886 z m 17.24422,-19.69699 c 2.5947,-5.86575 2.79679,-13.21126 0.46154,-16.77531 -2.22038,-3.38873 -7.40588,-6.56871 -10.63494,-6.52182 l -2.5,0.0363 2.65857,1.44399 c 7.54541,4.09827 9.69354,16.03478 5.23641,29.09718 -1.16794,3.42285 2.54882,-2.23995 4.77842,-7.28034 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -5.99712,0 c -5.50707,0 -6.33056,0.30125 -10.07768,3.68654 -9.19988,8.31154 -14.345,27.05964 -10.86507,39.59079 2.2932,8.25776 11.82081,14.55682 22.18987,14.67056 L 213,344 l 0,-29 z m 390.54251,16.75 c 5.04336,-5.05476 7.43768,-9.98743 7.45191,-15.35212 0.015,-5.6706 -9.24319,-13.39075 -15.99442,-13.33723 l -3.5,0.0277 3.75245,1.98095 c 7.33878,3.87421 11.41408,14.00634 8.46879,21.05539 -0.80908,1.9364 -2.92396,5.1755 -4.69974,7.198 -4.91695,5.6001 -1.42291,4.38462 4.52101,-1.57273 z M 568.00262,290.50316 C 565.2906,287.23537 549.06767,284.46346 547.5,287 c -0.38586,0.62434 1.75204,1.02043 5.69098,1.05438 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.6676,1.88859 4.87244,1.94562 0.20485,0.057 -0.18657,-0.56989 -0.86982,-1.39315 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3474"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#89722e"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.84089 c 29.80838,-15.41171 53.44407,-32.23202 73.61326,-52.38678 26.97372,-26.95441 42.77179,-56.17107 49.21771,-91.02233 2.58966,-14.00159 2.2673,-42.8501 -0.63134,-56.5 -10.83452,-51.02034 -41.9585,-94.62858 -102.16535,-143.1453 -12.68793,-10.22435 -25.83139,-22.72773 -32.62532,-31.03646 -1.19575,-1.46236 -3.87044,-6.1822 -5.94377,-10.48853 -6.85438,-14.23668 -4.90715,-24.25372 7.61243,-39.16028 10.98237,-13.07627 30.86203,-28.40084 58.02535,-44.72983 7.96404,-4.78751 14.84794,-9.03531 15.29755,-9.43956 C 566.29894,219.1176 497.91289,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.62103,14.07223 -62.58871,45.29094 -83.41995,70.44701 -14.41716,17.41035 -30.58617,44.47892 -37.03478,62 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 15.85471,23.62177 31.65569,40.01232 59.59664,61.82034 10.15047,7.92249 24.73646,21.08011 33.59884,30.30859 30.85297,32.12751 33.23388,54.48501 8.36699,78.56855 -7.77488,7.52996 -13.42109,11.86388 -24.02162,18.43854 -7.70579,4.77928 -26.8444,15.0756 -29.7551,16.00784 -0.99889,0.31993 3.77856,11.42687 17.37678,40.39869 C 473.04065,684.69919 483.8727,707 484.69351,707 c 0.35223,0 8.55278,-4.0909 18.22345,-9.09089 z M 240.04415,690.95163 C 295.58054,684.82572 341.71099,640.07682 357.51388,577 c 5.54775,-22.14367 5.77808,-25.65288 6.20261,-94.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.4521,158 247.95093,158 c -0.5441,0 -1.02831,77.25195 -1.20188,191.75 l -0.29067,191.75 -2.25008,8.4008 c -4.56631,17.04862 -13.111,29.64181 -21.7083,31.99377 -5.09215,1.39305 -11.33829,1.40637 -15.27919,0.0326 -6.67777,-2.32788 -13.46628,-16.98989 -16.63426,-35.92713 -1.76644,-10.55924 -3.55074,-37.69497 -3.57243,-54.32959 L 187,480.84081 l -6.25,0.61688 c -3.4375,0.33928 -24.475,2.0002 -46.75,3.69094 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 6.63848,9.83842 20.64192,24.23566 30.39905,31.25391 27.10572,19.49702 58.07351,26.26876 99.32226,21.71883 z m 126.69525,-5.875 c 9.17188,-8.27796 15.01693,-11.25469 23.25718,-11.84427 6.35915,-0.455 6.86685,-0.32609 10.09958,2.56436 3.17571,2.83946 3.40149,3.45091 3.36877,9.12336 l -0.0351,6.07992 17.82026,0 c 16.64097,0 17.76188,-0.11581 16.93832,-1.75 -0.48507,-0.9625 -11.61821,-24.64807 -24.74032,-52.6346 -19.17199,-40.88956 -23.99362,-50.4162 -24.54685,-48.5 -12.7114,44.02809 -28.27939,70.22516 -57.72363,97.1346 l -6.29164,5.75 17.64519,0 17.64519,0 6.56302,-5.92337 z m 27.25502,4.67337 c -0.012,-2.70135 -2.15008,-8.7628 -3.60354,-10.21626 -0.84355,-0.84356 -2.73909,-1.52952 -4.21231,-1.52436 -3.48129,0.0122 -11.75141,4.83037 -16.12474,9.39428 L 366.60767,691 l 13.69616,0 c 10.29324,0 13.69478,-0.31057 13.69059,-1.25 z m 5.80822,-4.02553 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.63719,-4.97335 5.77272,-8.48795 12.31197,-20.26271 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.04265,-18.20399 -11.94053,-38.0547 -25.10144,-56 -8.92638,-12.1714 -28.40076,-29.66796 -39.99671,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.42831,-1.86529 -16,-2.27734 -16,-1.84584 0,0.19512 16.02973,26.77968 35.62161,59.0768 19.59189,32.29712 35.79315,59.0186 36.0028,59.38107 0.20965,0.36246 -6.03258,4.16346 -13.87162,8.44666 -43.95453,24.01645 -74.65115,45.40361 -81.8234,57.00856 -1.8445,2.98447 -1.8982,3.54538 -0.58291,6.08888 1.87803,3.6317 5.32019,6.84149 5.32019,4.96104 0,-3.09283 5.08296,-11.51384 9.81484,-16.26038 14.7422,-14.78786 39.4029,-11.75534 47.03502,5.78387 1.03207,2.37179 1.97402,4.4608 2.09322,4.64224 0.1192,0.18145 1.47348,-0.49355 3.00951,-1.5 4.16003,-2.72576 15.51991,-2.48826 21.07281,0.44057 12.37248,6.52576 13.76083,21.10201 3.11896,32.74592 C 601.14764,340.8072 594.51664,344 586.03805,344 c -4.56971,0 -7.62983,-0.57914 -10.05365,-1.90268 l -3.4844,-1.90268 -3.20902,3.05913 c -2.73897,2.61103 -3.44157,2.86614 -4.79653,1.74162 -1.42208,-1.18022 -1.2961,-1.58728 1.20902,-3.90645 1.53809,-1.42392 3.53503,-3.71394 4.43764,-5.08894 l 1.64111,-2.5 2.35889,2.12504 c 3.39214,3.05585 6.30839,4.37496 9.67202,4.37496 2.34867,0 4.27406,-1.40928 9.51357,-6.96344 7.23719,-7.6718 8.68332,-11.44614 6.6945,-17.47232 -2.64604,-8.01757 -12.8456,-13.26574 -19.43353,-9.99948 -1.60178,0.79415 -2.9939,1.32946 -3.09359,1.18958 -0.0997,-0.13989 -1.17562,-2.06207 -2.39096,-4.27152 -4.34706,-7.90285 -14.50366,-12.39801 -28.13061,-12.45017 -11.63041,-0.0445 -14.46242,1.95773 -20.45618,14.46272 l -3.35296,6.99537 3.16832,2.75751 c 1.74257,1.51663 9.60155,7.98029 17.46441,14.3637 36.00268,29.22854 61.40216,55.7846 80.02804,83.67214 3.75272,5.61875 7.90046,12.15528 9.21719,14.52561 1.92926,3.47299 2.78863,4.18855 4.42637,3.68568 1.11776,-0.34321 4.97175,-0.87353 8.56442,-1.17848 6.03302,-0.51209 6.77538,-0.34976 9.71599,2.1246 3.86943,3.25591 4.92173,7.81295 3.30797,14.3254 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.16337,-0.719 -1.11027,-0.35948 0.69538,4.70856 5.43681,15.25983 9.44101,39.845 9.44101,57.96636 0,53.19972 -20.28812,99.2293 -63.38363,143.8044 l -8.11637,8.39504 5,-2.79902 c 2.75,-1.53946 6.35,-3.52719 8,-4.41718 z m 49.04367,-72.41828 C 647.72206,595.86116 653.86164,586 659.42308,586 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 429,558.51973 c 16.46254,-8.25457 32.98976,-20.913 38.09975,-29.18113 l 2.03876,-3.29878 -3.31045,-6.26991 c -4.28357,-8.113 -24.68543,-28.76125 -41.82806,-42.33323 -6.875,-5.443 -15.94438,-12.92973 -20.15418,-16.63717 l -7.65417,-6.74081 -0.47131,48.22065 c -0.36707,37.55562 -0.83721,50.76412 -2.12571,59.72065 -0.90992,6.325 -1.88999,12.2677 -2.17794,13.20601 -0.49784,1.62227 13.18603,-4.45311 37.58331,-16.68628 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.34519,-59.43803 c 0.67801,-4.94658 -0.91598,-11.9728 -3.24442,-14.30124 -0.98285,-0.98285 -2.99485,-1.49575 -5.3276,-1.35811 l -3.74833,0.22117 4.83965,10.0631 c 2.66181,5.53471 4.85981,10.73811 4.88444,11.56311 0.0857,2.86976 1.9705,-1.62259 2.59626,-6.18803 z m -494.16882,0.15522 C 184.56238,447.78524 209.42488,446 210.69347,446 l 2.30653,0 0,-48.86111 0,-48.86111 -5.86341,-0.53168 c -10.99491,-0.99698 -21.63725,-7.85685 -24.33173,-15.68381 -0.67448,-1.95926 -1.21828,-7.1804 -1.20844,-11.60254 0.0433,-19.46697 10.65,-36.28301 25.92189,-41.09704 L 213,277.63476 l 0,-78.44519 0,-78.44519 3.75,0.55783 c 2.0625,0.30681 43.03607,4.92767 91.05238,10.26858 l 87.30239,9.71074 10.69761,-10.43922 C 411.68607,125.10074 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.39427,2.7942 -15.10077,3.60536 -24.5,7.34279 -11.75334,4.6735 -22.7589,10.67353 -32,17.44584 -10.37457,7.60297 -27.08888,24.68754 -32.50621,33.2263 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.54589 c 2.907815,-0.30024 29.111505,-2.33113 58.230415,-4.51308 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.922256,1.33146 -2.540092,1.35234 -4.744009,-0.2592 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.5,244.49799 c -4.86245,-1.71915 -9.03192,-6.1432 -10.3754,-11.0089 -3.03876,-11.00548 7.22777,-32.09261 18.21397,-37.41094 5.71908,-2.76856 15.27671,-2.82523 20.57548,-0.122 4.42762,2.2588 8.80689,7.08381 9.71563,10.70452 2.00549,7.99052 -3.50219,21.37534 -12.4903,30.35405 -8.26211,8.25348 -16.58787,10.68349 -25.63938,7.48327 z m 13.93915,-2.90812 c 4.67048,-1.95145 11.74422,-15.97688 12.36142,-24.50955 0.81886,-11.32067 -4.70149,-17.48578 -15.06169,-16.82085 -4.94249,0.31722 -6.25917,0.85248 -9.26607,3.76688 -6.47618,6.27697 -11.47127,19.83784 -10.06613,27.32793 1.72733,9.20741 12.50731,14.21546 22.03247,10.23559 z m 18.73425,-20.24896 c 2.5947,-5.86575 2.79679,-13.21126 0.46154,-16.77531 -2.22038,-3.38873 -7.40588,-6.56871 -10.63494,-6.52182 l -2.5,0.0363 2.65857,1.44399 c 7.54541,4.09827 9.69354,16.03478 5.23641,29.09718 -1.16794,3.42285 2.54882,-2.23995 4.77842,-7.28034 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -5.77749,0 c -7.97727,0 -11.79975,2.79085 -16.75516,12.2332 -7.55755,14.40063 -7.21429,32.22179 0.762,39.56078 3.5215,3.24014 11.4363,6.10425 17.02065,6.15925 L 213,344 l 0,-29 z m 390.54251,16.75 c 5.04336,-5.05476 7.43768,-9.98743 7.45191,-15.35212 0.015,-5.6706 -9.24319,-13.39075 -15.99442,-13.33723 l -3.5,0.0277 3.75245,1.98095 c 7.33878,3.87421 11.41408,14.00634 8.46879,21.05539 -0.80908,1.9364 -2.92396,5.1755 -4.69974,7.198 -4.91695,5.6001 -1.42291,4.38462 4.52101,-1.57273 z M 568.00262,290.50316 C 565.2906,287.23537 549.06767,284.46346 547.5,287 c -0.38586,0.62434 1.75204,1.02043 5.69098,1.05438 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.6676,1.88859 4.87244,1.94562 0.20485,0.057 -0.18657,-0.56989 -0.86982,-1.39315 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3472"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#636363"
+       d="m 459.25713,733.75 -8.03458,-17.25 -86.36127,0 -86.36128,0 -8.5,2.79144 c -18.71128,6.14488 -48.18378,8.99938 -70,6.77971 -27.41098,-2.7889 -50.59048,-10.53032 -70.74157,-23.62604 C 87.240858,675.13886 60.154618,631.43924 49.623786,573.96647 45.304998,550.39637 44.545132,539.01002 44.521862,497.51576 44.502849,463.61121 44.695452,458.50439 46,458.32326 c 0.825,-0.11455 5.872844,-0.50004 11.217431,-0.85665 l 9.717431,-0.64838 0.306014,-112.65911 C 67.546832,231.52133 67.547322,231.49782 69.826915,220 73.780631,200.05823 80.146491,183.47245 89.785262,168 99.407134,152.55468 105.73351,144.51402 116.1689,134.46712 133.14322,118.12473 148.35517,108.06775 168.03843,100.17494 181.55484,94.754982 182.87327,94.346588 200,90.27461 L 211.5,87.540418 337,87.020209 462.5,86.5 l 4,-2.596079 c 4.58986,-2.97891 40.06798,-22.793593 41.46887,-23.160542 0.51102,-0.133858 4.49232,5.606621 8.84731,12.756621 l 7.91818,13 12.88282,0.662785 c 27.82621,1.43158 55.53687,9.091039 73.72951,20.379455 19.49091,12.09398 20.7073,13.04477 37.04709,28.95776 23.67104,23.05275 37.37156,49.40816 45.22581,87 1.79041,8.56924 1.89346,16.99113 2.15317,175.96125 0.23318,142.73553 0.0618,168.0551 -1.18114,174.5 -0.79965,4.14631 -1.74414,9.72076 -2.09887,12.38767 -0.92738,6.97214 -8.9976,29.94521 -13.40211,38.15108 -7.06316,13.1591 -9.48062,17.00718 -16.64796,26.5 -17.10657,22.65689 -39.36417,39.6508 -68.32479,52.16671 -12.33042,5.32884 -34.02689,10.79252 -49.11789,12.36905 -5.48486,0.57299 -8.21793,1.65862 -17.5,6.95136 -6.05,3.44977 -14.825,8.19556 -19.5,10.54621 C 498.96968,737.57388 469.03455,751 467.94118,751 c -0.35721,0 -4.26504,-7.7625 -8.68405,-17.25 z m 43.65983,-35.85429 C 570.0538,663.13306 610.49637,618.50621 623.4887,564.84935 634.2685,520.33004 625.13863,474.52431 597.08711,432.38904 578.72602,404.80947 557.85349,382.98012 522.95124,354.8547 510.27179,344.63718 496.70789,331.73199 490.5,323.97941 c -6.15065,-7.68109 -11.12618,-21.66202 -10.0668,-28.28705 2.92077,-18.26544 30.07029,-43.37147 75.8168,-70.11018 5.3625,-3.13437 9.75,-5.89517 9.75,-6.13512 C 566,218.04442 497.2585,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.72632,14.13007 -62.47266,45.16278 -83.41745,70.44701 -14.41273,17.39883 -30.587,44.47437 -37.03728,62 -1.31578,3.575 -2.81205,7.4 -3.32506,8.5 -1.40895,3.02107 -3.7215,11.95357 -5.69564,22 -2.72533,13.86928 -2.43487,43.51955 0.56328,57.5 3.84186,17.91463 13.83582,40.68242 25.45922,58 16.00234,23.84171 28.94468,37.27717 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.70156,11.58151 -20.28795,25.44415 -38.31168,36.41072 -6.90334,4.20035 -26.21194,14.49764 -28.6934,15.30221 -1.02599,0.33266 3.59073,11.06424 17.38176,40.40396 C 473.3675,685.35845 483.88458,707 484.69351,707 c 0.35223,0 8.55278,-4.09693 18.22345,-9.10429 z M 229.5,691.94102 c 17.19682,-1.29081 28.39153,-3.65114 41.24158,-8.69552 42.08465,-16.52062 74.12039,-55.74574 86.7723,-106.2455 5.54775,-22.14367 5.77808,-25.65288 6.20261,-94.5 l 0.39464,-64 -7.56975,-11.41563 c -22.0761,-33.29202 -32.56807,-67.71766 -32.52306,-106.71271 0.0454,-39.32826 10.63366,-73.89245 33.99553,-110.97449 C 363.00723,181.47122 364,179.15779 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.45318,158 247.95333,158 c -0.5409,0 -1.02849,77.62582 -1.20443,191.75 l -0.29562,191.75 -2.2563,8.43754 c -4.49411,16.80589 -13.20325,29.63341 -21.69698,31.95703 -5.09215,1.39305 -11.33829,1.40637 -15.27919,0.0326 -6.68467,-2.33029 -13.48731,-17.03488 -16.6206,-35.92713 -1.723,-10.38888 -3.56277,-38.52114 -3.58569,-54.82959 L 187,480.84081 l -6.25,0.61688 c -3.4375,0.33928 -24.475,2.0002 -46.75,3.69094 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.33445 15,-0.91241 z m 137.2394,-6.86439 c 9.17188,-8.27796 15.01693,-11.25469 23.25718,-11.84427 6.35915,-0.455 6.86685,-0.32609 10.09958,2.56436 3.17571,2.83946 3.40149,3.45091 3.36877,9.12336 l -0.0351,6.07992 17.84409,0 c 9.81425,0 17.65534,-0.3375 17.42465,-0.75 -0.23069,-0.4125 -11.37391,-24.10001 -24.76271,-52.63892 -19.58323,-41.74264 -24.47818,-51.4218 -25.03318,-49.5 -12.69613,43.96291 -28.33399,70.27807 -57.72507,97.13892 l -6.29164,5.75 17.64519,0 17.64519,0 6.56302,-5.92337 z m 27.25502,4.67337 c -0.012,-2.70135 -2.15008,-8.7628 -3.60354,-10.21626 -0.84355,-0.84356 -2.73909,-1.52952 -4.21231,-1.52436 -3.48129,0.0122 -11.75141,4.83037 -16.12474,9.39428 L 366.60767,691 l 13.69616,0 c 10.29324,0 13.69478,-0.31057 13.69059,-1.25 z m 5.80822,-4.02553 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.63719,-4.97335 5.77272,-8.48795 12.31197,-20.26271 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.02262,-18.0841 -12.25763,-38.72903 -25.05026,-56 -9.09572,-12.27988 -28.50772,-29.69811 -40.04789,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.39822,-1.86078 -16,-2.27736 -16,-1.85056 0,0.19253 16.02714,26.7771 35.61587,59.07681 19.58874,32.29971 35.78651,59.01768 35.99506,59.37325 0.20854,0.35558 -8.376,5.47334 -19.07677,11.37281 -39.99695,22.05084 -69.78136,43.05444 -76.52348,53.96342 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 1.87803,3.6317 5.32019,6.84149 5.32019,4.96104 0,-3.09283 5.08296,-11.51384 9.81484,-16.26038 14.7422,-14.78786 39.4029,-11.75534 47.03502,5.78387 1.03207,2.37179 1.97402,4.4608 2.09322,4.64224 0.1192,0.18145 1.47348,-0.49355 3.00951,-1.5 4.16003,-2.72576 15.51991,-2.48826 21.07281,0.44057 12.37248,6.52576 13.76083,21.10201 3.11896,32.74592 C 601.14764,340.8072 594.51664,344 586.03805,344 c -4.56971,0 -7.62983,-0.57914 -10.05365,-1.90268 l -3.4844,-1.90268 -3.20902,3.05913 c -2.73897,2.61103 -3.44157,2.86614 -4.79653,1.74162 -1.42208,-1.18022 -1.2961,-1.58728 1.20902,-3.90645 1.53809,-1.42392 3.53503,-3.71394 4.43764,-5.08894 l 1.64111,-2.5 2.35889,2.12504 c 3.39214,3.05585 6.30839,4.37496 9.67202,4.37496 2.34867,0 4.27406,-1.40928 9.51357,-6.96344 7.23719,-7.6718 8.68332,-11.44614 6.6945,-17.47232 -2.64604,-8.01757 -12.8456,-13.26574 -19.43353,-9.99948 -1.60178,0.79415 -2.9939,1.32946 -3.09359,1.18958 -0.0997,-0.13989 -1.17562,-2.06207 -2.39096,-4.27152 -4.34706,-7.90285 -14.50366,-12.39801 -28.13061,-12.45017 -11.57875,-0.0443 -14.46895,1.97751 -20.35161,14.23695 -1.7866,3.72327 -3.45459,6.64827 -3.70663,6.5 -2.03172,-1.19529 9.12902,8.35268 20.71331,17.72015 35.71364,28.87931 61.5476,55.87224 80.19656,83.79434 3.75272,5.61875 7.90046,12.15528 9.21719,14.52561 1.92926,3.47299 2.78863,4.18855 4.42637,3.68568 1.11776,-0.34321 4.97175,-0.87353 8.56442,-1.17848 6.03302,-0.51209 6.77538,-0.34976 9.71599,2.1246 3.86943,3.25591 4.92173,7.81295 3.30797,14.3254 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.16359,-0.71914 -1.11029,-0.35891 0.69678,4.70856 5.27231,14.78492 9.45033,40.35997 9.42228,57.67695 -0.0868,53.6116 -20.27817,99.52634 -63.3663,144.09381 l -8.11637,8.39504 5,-2.79902 c 2.75,-1.53946 6.35,-3.52719 8,-4.41718 z m 49.04367,-72.41828 C 647.72206,595.86116 653.86164,586 659.42308,586 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07308,-8.108 28.14968,-18.60369 33.12543,-26.58752 l 2.01308,-3.23009 -3.31045,-6.26991 c -4.30877,-8.16073 -24.8562,-28.97803 -41.70771,-42.25552 -6.8088,-5.36473 -15.87818,-12.83693 -20.15417,-16.60488 l -7.77453,-6.85081 -0.47131,48.22065 c -0.36707,37.55562 -0.83721,50.76412 -2.12571,59.72065 -0.90992,6.325 -1.89397,12.28024 -2.18678,13.23386 -0.3853,1.25485 4.38857,-0.6249 17.27988,-6.80411 C 418.48448,563.73387 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.34519,-59.43803 c 0.67801,-4.94658 -0.91598,-11.9728 -3.24442,-14.30124 -0.98285,-0.98285 -2.99485,-1.49575 -5.3276,-1.35811 l -3.74833,0.22117 4.83965,10.0631 c 2.66181,5.53471 4.85981,10.73811 4.88444,11.56311 0.0857,2.86976 1.9705,-1.62259 2.59626,-6.18803 z M 155.71291,449.9664 C 184.98001,447.78488 209.84251,446 210.96291,446 212.98457,446 213,445.62986 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -10.99491,-0.99698 -21.63725,-7.85685 -24.33173,-15.68381 -0.67448,-1.95926 -1.21828,-7.1804 -1.20844,-11.60254 0.0433,-19.46697 10.65,-36.28301 25.92189,-41.09704 L 213,277.63476 l 0,-78.44519 0,-78.44519 3.75,0.563 c 2.0625,0.30964 43.03558,4.93099 91.05128,10.26966 l 87.30128,9.70667 10.69872,-10.44031 C 411.68558,125.10123 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.41737,2.79941 -15.119,3.61018 -24.5,7.35248 -12.44547,4.96481 -23.59239,11.02506 -32.33043,17.57713 -10.36547,7.77236 -26.90842,24.78294 -32.17578,33.08532 -2.19659,3.46225 -5.46563,8.58385 -7.26455,11.38135 -5.37311,8.35571 -11.322982,24.32206 -14.467666,38.82367 -1.996465,9.20663 -2.072055,12.93593 -2.447773,120.76308 l -0.387691,111.26308 5.286945,-0.54668 c 2.907815,-0.30067 29.232755,-2.33156 58.499855,-4.51308 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.922256,1.33146 -2.540092,1.35234 -4.744009,-0.2592 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.5,244.49799 c -4.86245,-1.71915 -9.03192,-6.1432 -10.3754,-11.0089 -3.03876,-11.00548 7.22777,-32.09261 18.21397,-37.41094 5.71908,-2.76856 15.27671,-2.82523 20.57548,-0.122 4.42762,2.2588 8.80689,7.08381 9.71563,10.70452 2.00549,7.99052 -3.50219,21.37534 -12.4903,30.35405 -8.26211,8.25348 -16.58787,10.68349 -25.63938,7.48327 z m 13.93915,-2.90812 c 4.67048,-1.95145 11.74422,-15.97688 12.36142,-24.50955 0.81886,-11.32067 -4.70149,-17.48578 -15.06169,-16.82085 -4.94249,0.31722 -6.25917,0.85248 -9.26607,3.76688 -6.47618,6.27697 -11.47127,19.83784 -10.06613,27.32793 1.72733,9.20741 12.50731,14.21546 22.03247,10.23559 z m 18.73425,-20.24896 c 2.5947,-5.86575 2.79679,-13.21126 0.46154,-16.77531 -2.22038,-3.38873 -7.40588,-6.56871 -10.63494,-6.52182 l -2.5,0.0363 2.65857,1.44399 c 7.54541,4.09827 9.69354,16.03478 5.23641,29.09718 -1.16794,3.42285 2.54882,-2.23995 4.77842,-7.28034 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -5.77749,0 c -7.97727,0 -11.79975,2.79085 -16.75516,12.2332 -7.55755,14.40063 -7.21429,32.22179 0.762,39.56078 3.5215,3.24014 11.4363,6.10425 17.02065,6.15925 L 213,344 l 0,-29 z m 390.54251,16.75 c 5.04336,-5.05476 7.43768,-9.98743 7.45191,-15.35212 0.015,-5.6706 -9.24319,-13.39075 -15.99442,-13.33723 l -3.5,0.0277 3.75245,1.98095 c 7.33878,3.87421 11.41408,14.00634 8.46879,21.05539 -0.80908,1.9364 -2.92396,5.1755 -4.69974,7.198 -4.91695,5.6001 -1.42291,4.38462 4.52101,-1.57273 z M 568.00262,290.50316 C 565.2906,287.23537 549.06767,284.46346 547.5,287 c -0.38586,0.62434 1.75204,1.02043 5.69098,1.05438 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.6676,1.88859 4.87244,1.94562 0.20485,0.057 -0.18657,-0.56989 -0.86982,-1.39315 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3470"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#87702e"
+       d="m 459.28602,733.75 -8.05795,-17.25 -85.243,-0.25564 -85.24299,-0.25564 -9.51042,3.04646 c -26.64462,8.53503 -63.29517,10.10563 -91.66293,3.92807 -18.8597,-4.10702 -35.53772,-10.91176 -50.3103,-20.52692 C 84.344956,673.2031 56.82709,625.88522 47.587218,562 45.046497,544.43325 44.020254,524.02417 44.009889,490.85699 43.998902,455.70103 43.514353,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.546827,231.52324 67.547361,231.49763 69.826915,220 73.766717,200.12841 79.970437,183.96521 89.731255,168.14116 98.989548,153.13179 105.49104,144.79863 115.66301,134.90363 123.75187,127.03501 144.05676,111 145.9318,111 c 0.43401,0 2.53858,-1.18723 4.67684,-2.63828 C 158.92079,102.72093 181.07662,94.636247 200,90.338749 L 212.5,87.5 l 125,-0.5 125,-0.5 5,-3.147983 c 5.88937,-3.707925 39.1147,-22.257545 40.49769,-22.609757 0.52319,-0.133243 4.4733,5.60774 8.77801,12.75774 l 7.82676,13 12.94877,0.661881 c 7.12182,0.364034 18.12377,1.568513 24.44877,2.676618 13.39035,2.345917 35.91138,9.822465 43.92643,14.582731 16.94616,10.06459 23.16648,14.20471 29.45485,19.60459 8.30161,7.12867 24.73658,24.28114 28.72033,29.97418 7.2545,10.36718 17.82435,28.62898 17.87027,30.87495 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.73185,10.98185 8.26328,25.32922 10.61471,43.12505 1.22449,9.26706 1.16322,331.41424 -0.064,336.73278 -0.5372,2.32803 -1.44017,7.50046 -2.0066,11.4943 -1.34137,9.4579 -8.92215,32.0563 -13.79799,41.13198 -7.15927,13.32596 -9.54399,17.12718 -16.71336,26.64094 -8.13703,10.79784 -21.37404,23.79404 -33.61444,33.0029 -8.9915,6.76461 -35.59957,20.27446 -46.842,23.78333 -8.49335,2.65086 -28.76568,6.89177 -37,7.74029 -5.49524,0.56627 -8.20037,1.63921 -17.5,6.94108 -6.05,3.4492 -14.825,8.19488 -19.5,10.54596 C 499.22461,737.42673 468.99283,751 467.93874,751 c -0.32712,0 -4.22085,-7.7625 -8.65272,-17.25 z m 43.63094,-35.85429 C 570.0538,663.13306 610.49637,618.50621 623.4887,564.84935 634.2685,520.33004 625.13863,474.52431 597.08711,432.38904 578.72602,404.80947 557.85349,382.98012 522.95124,354.8547 510.27179,344.63718 496.70789,331.73199 490.5,323.97941 c -6.15065,-7.68109 -11.12618,-21.66202 -10.0668,-28.28705 2.92077,-18.26544 30.07029,-43.37147 75.8168,-70.11018 5.3625,-3.13437 9.75,-5.89517 9.75,-6.13512 C 566,218.04442 497.2585,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.72632,14.13007 -62.47266,45.16278 -83.41745,70.44701 -14.62315,17.65284 -31.29711,45.73319 -37.40905,63 -1.26545,3.575 -2.66606,6.98556 -3.11247,7.57903 -1.46734,1.9507 -5.68286,21.71333 -6.91563,32.42097 -1.56797,13.61915 -0.69899,33.56812 2.04735,47 3.59714,17.59305 13.61501,40.50972 25.35432,58 16.00234,23.84171 28.94468,37.27717 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.70156,11.58151 -20.28795,25.44415 -38.31168,36.41072 -6.90334,4.20035 -26.21194,14.49764 -28.6934,15.30221 -1.02599,0.33266 3.59073,11.06424 17.38176,40.40396 C 473.3675,685.35845 483.88458,707 484.69351,707 c 0.35223,0 8.55278,-4.09693 18.22345,-9.10429 z M 229.5,691.94102 c 17.19682,-1.29081 28.39153,-3.65114 41.24158,-8.69552 42.08465,-16.52062 74.12039,-55.74574 86.7723,-106.2455 5.54391,-22.12838 5.77662,-25.66482 6.22332,-94.57523 l 0.41536,-64.07523 -6.38874,-9.42477 c -22.72354,-33.52209 -33.79101,-69.12413 -33.7455,-108.55311 0.0455,-39.40947 10.5586,-73.64761 34.13692,-111.17396 C 363.01119,181.46916 364,179.14295 364,175.4477 364,172.25607 363.59585,171 362.56893,171 361.78184,171 335.87582,168.075 305,164.5 274.12418,160.925 248.45318,158 247.95333,158 c -0.5409,0 -1.02849,77.62582 -1.20443,191.75 l -0.29562,191.75 -2.2563,8.43754 c -4.49411,16.80589 -13.20325,29.63341 -21.69698,31.95703 -5.09215,1.39305 -11.33829,1.40637 -15.27919,0.0326 -6.68467,-2.33029 -13.48731,-17.03488 -16.6206,-35.92713 -1.723,-10.38888 -3.56277,-38.52114 -3.58569,-54.82959 L 187,480.84081 l -6.25,0.61688 c -3.4375,0.33928 -24.475,2.0002 -46.75,3.69094 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.45793,0.80457 10.00793,0.88071 0.55,0.0761 7.3,-0.33445 15,-0.91241 z m 137.2394,-6.86439 c 9.17188,-8.27796 15.01693,-11.25469 23.25718,-11.84427 6.35915,-0.455 6.86685,-0.32609 10.09958,2.56436 3.17571,2.83946 3.40149,3.45091 3.36877,9.12336 l -0.0351,6.07992 17.84409,0 c 9.81425,0 17.65534,-0.3375 17.42465,-0.75 -0.23069,-0.4125 -11.37391,-24.10001 -24.76271,-52.63892 -19.58323,-41.74264 -24.47818,-51.4218 -25.03318,-49.5 -12.69613,43.96291 -28.33399,70.27807 -57.72507,97.13892 l -6.29164,5.75 17.64519,0 17.64519,0 6.56302,-5.92337 z m 27.25502,4.67337 c -0.012,-2.70135 -2.15008,-8.7628 -3.60354,-10.21626 -0.84355,-0.84356 -2.73909,-1.52952 -4.21231,-1.52436 -3.48129,0.0122 -11.75141,4.83037 -16.12474,9.39428 L 366.60767,691 l 13.69616,0 c 10.29324,0 13.69478,-0.31057 13.69059,-1.25 z m 5.80822,-4.02553 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.63719,-4.97335 5.77272,-8.48795 12.31197,-20.26271 4.14651,-7.46632 9.78778,-25.52371 11.98064,-38.34937 1.86528,-10.90974 1.94023,-17.53373 1.93466,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.02262,-18.0841 -12.25763,-38.72903 -25.05026,-56 -9.09572,-12.27988 -28.50772,-29.69811 -40.04789,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.39822,-1.86078 -16,-2.27736 -16,-1.85056 0,0.19253 16.02714,26.7771 35.61587,59.07681 19.58874,32.29971 35.78651,59.01768 35.99506,59.37325 0.20854,0.35558 -8.376,5.47334 -19.07677,11.37281 -39.99695,22.05084 -69.78136,43.05444 -76.52348,53.96342 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 1.87803,3.6317 5.32019,6.84149 5.32019,4.96104 0,-3.09283 5.08296,-11.51384 9.81484,-16.26038 14.7422,-14.78786 39.4029,-11.75534 47.03502,5.78387 1.03207,2.37179 1.97402,4.4608 2.09322,4.64224 0.1192,0.18145 1.47348,-0.49355 3.00951,-1.5 4.16003,-2.72576 15.51991,-2.48826 21.07281,0.44057 12.37248,6.52576 13.76083,21.10201 3.11896,32.74592 C 601.14764,340.8072 594.51664,344 586.03805,344 c -4.56971,0 -7.62983,-0.57914 -10.05365,-1.90268 l -3.4844,-1.90268 -3.20902,3.05913 c -2.73897,2.61103 -3.44157,2.86614 -4.79653,1.74162 -1.42208,-1.18022 -1.2961,-1.58728 1.20902,-3.90645 1.53809,-1.42392 3.53503,-3.71394 4.43764,-5.08894 l 1.64111,-2.5 2.35889,2.12504 c 3.39214,3.05585 6.30839,4.37496 9.67202,4.37496 2.34867,0 4.27406,-1.40928 9.51357,-6.96344 7.23719,-7.6718 8.68332,-11.44614 6.6945,-17.47232 -2.64604,-8.01757 -12.8456,-13.26574 -19.43353,-9.99948 -1.60178,0.79415 -2.9939,1.32946 -3.09359,1.18958 -0.0997,-0.13989 -1.17562,-2.06207 -2.39096,-4.27152 -4.34706,-7.90285 -14.50366,-12.39801 -28.13061,-12.45017 -11.57875,-0.0443 -14.46895,1.97751 -20.35161,14.23695 -1.7866,3.72327 -3.45459,6.64827 -3.70663,6.5 -2.03172,-1.19529 9.12902,8.35268 20.71331,17.72015 35.71364,28.87931 61.5476,55.87224 80.19656,83.79434 3.75272,5.61875 7.90046,12.15528 9.21719,14.52561 1.92926,3.47299 2.78863,4.18855 4.42637,3.68568 1.11776,-0.34321 4.97175,-0.87353 8.56442,-1.17848 6.03302,-0.51209 6.77538,-0.34976 9.71599,2.1246 3.86943,3.25591 4.92173,7.81295 3.30797,14.3254 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.16359,-0.71914 -1.11029,-0.35891 0.69678,4.70856 5.27231,14.78492 9.45033,40.35997 9.42228,57.67695 -0.0868,53.6116 -20.27817,99.52634 -63.3663,144.09381 l -8.11637,8.39504 5,-2.79902 c 2.75,-1.53946 6.35,-3.52719 8,-4.41718 z m 49.04367,-72.41828 C 647.72206,595.86116 653.86164,586 659.42308,586 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07308,-8.108 28.14968,-18.60369 33.12543,-26.58752 l 2.01308,-3.23009 -3.31045,-6.26991 c -4.30877,-8.16073 -24.8562,-28.97803 -41.70771,-42.25552 -6.8088,-5.36473 -15.87818,-12.83693 -20.15417,-16.60488 l -7.77453,-6.85081 -0.47131,48.22065 c -0.36707,37.55562 -0.83721,50.76412 -2.12571,59.72065 -0.90992,6.325 -1.89397,12.28024 -2.18678,13.23386 -0.3853,1.25485 4.38857,-0.6249 17.27988,-6.80411 C 418.48448,563.73387 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.34519,-59.43803 c 0.67801,-4.94658 -0.91598,-11.9728 -3.24442,-14.30124 -0.98285,-0.98285 -2.99485,-1.49575 -5.3276,-1.35811 l -3.74833,0.22117 4.83965,10.0631 c 2.66181,5.53471 4.85981,10.73811 4.88444,11.56311 0.0857,2.86976 1.9705,-1.62259 2.59626,-6.18803 z M 155.71291,449.9664 C 184.98001,447.78488 209.84251,446 210.96291,446 212.98457,446 213,445.62986 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -10.99491,-0.99698 -21.63725,-7.85685 -24.33173,-15.68381 -0.67448,-1.95926 -1.21828,-7.1804 -1.20844,-11.60254 0.0433,-19.46697 10.65,-36.28301 25.92189,-41.09704 L 213,277.63476 l 0,-78.44519 0,-78.44519 3.75,0.563 c 2.0625,0.30964 43.03558,4.93099 91.05128,10.26966 l 87.30128,9.70667 10.69872,-10.44031 C 411.68558,125.10123 418.75,118.50649 421.5,116.18844 l 5,-4.21465 -105.5,0.27591 c -105.35382,0.27554 -105.51386,0.27904 -115.5,2.53035 -12.41737,2.79941 -15.119,3.61018 -24.5,7.35248 -12.44547,4.96481 -23.59239,11.02506 -32.33043,17.57713 -10.35588,7.76516 -26.9031,24.77669 -32.17578,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998379,9.20904 -2.073392,12.90771 -2.449209,120.76308 l -0.387691,111.26308 5.286945,-0.54668 c 2.907815,-0.30067 29.232755,-2.33156 58.499855,-4.51308 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.922256,1.33146 -2.540092,1.35234 -4.744009,-0.2592 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.5,244.49799 c -4.86245,-1.71915 -9.03192,-6.1432 -10.3754,-11.0089 -3.03876,-11.00548 7.22777,-32.09261 18.21397,-37.41094 5.71908,-2.76856 15.27671,-2.82523 20.57548,-0.122 4.42762,2.2588 8.80689,7.08381 9.71563,10.70452 2.00549,7.99052 -3.50219,21.37534 -12.4903,30.35405 -8.26211,8.25348 -16.58787,10.68349 -25.63938,7.48327 z m 13.93915,-2.90812 c 4.67048,-1.95145 11.74422,-15.97688 12.36142,-24.50955 0.81886,-11.32067 -4.70149,-17.48578 -15.06169,-16.82085 -4.94249,0.31722 -6.25917,0.85248 -9.26607,3.76688 -6.47618,6.27697 -11.47127,19.83784 -10.06613,27.32793 1.72733,9.20741 12.50731,14.21546 22.03247,10.23559 z m 18.73425,-20.24896 c 2.5947,-5.86575 2.79679,-13.21126 0.46154,-16.77531 -2.22038,-3.38873 -7.40588,-6.56871 -10.63494,-6.52182 l -2.5,0.0363 2.65857,1.44399 c 7.54541,4.09827 9.69354,16.03478 5.23641,29.09718 -1.16794,3.42285 2.54882,-2.23995 4.77842,-7.28034 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -5.77749,0 c -7.97727,0 -11.79975,2.79085 -16.75516,12.2332 -7.55755,14.40063 -7.21429,32.22179 0.762,39.56078 3.5215,3.24014 11.4363,6.10425 17.02065,6.15925 L 213,344 l 0,-29 z m 390.54251,16.75 c 5.04336,-5.05476 7.43768,-9.98743 7.45191,-15.35212 0.015,-5.6706 -9.24319,-13.39075 -15.99442,-13.33723 l -3.5,0.0277 3.75245,1.98095 c 7.33878,3.87421 11.41408,14.00634 8.46879,21.05539 -0.80908,1.9364 -2.92396,5.1755 -4.69974,7.198 -4.91695,5.6001 -1.42291,4.38462 4.52101,-1.57273 z M 568.00262,290.50316 C 565.2906,287.23537 549.06767,284.46346 547.5,287 c -0.38586,0.62434 1.75204,1.02043 5.69098,1.05438 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.6676,1.88859 4.87244,1.94562 0.20485,0.057 -0.18657,-0.56989 -0.86982,-1.39315 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3468"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#846834"
+       d="m 459.28602,733.75 -8.05795,-17.25 -85.243,-0.25564 -85.24299,-0.25564 -9.51042,3.04646 c -26.64462,8.53503 -63.29517,10.10563 -91.66293,3.92807 -18.8597,-4.10702 -35.53772,-10.91176 -50.3103,-20.52692 C 84.344956,673.2031 56.82709,625.88522 47.587218,562 45.046497,544.43325 44.020254,524.02417 44.009889,490.85699 43.998902,455.70103 43.514353,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.546827,231.52324 67.547361,231.49763 69.826915,220 73.766717,200.12841 79.970437,183.96521 89.731255,168.14116 98.989548,153.13179 105.49104,144.79863 115.66301,134.90363 123.75187,127.03501 144.05676,111 145.9318,111 c 0.43401,0 2.53858,-1.18723 4.67684,-2.63828 C 158.92079,102.72093 181.07662,94.636247 200,90.338749 L 212.5,87.5 l 125,-0.5 125,-0.5 5,-3.147983 c 5.88937,-3.707925 39.1147,-22.257545 40.49769,-22.609757 0.52319,-0.133243 4.4733,5.60774 8.77801,12.75774 l 7.82676,13 12.94877,0.661881 c 7.12182,0.364034 18.12377,1.568513 24.44877,2.676618 13.39035,2.345917 35.91138,9.822465 43.92643,14.582731 16.94616,10.06459 23.16648,14.20471 29.45485,19.60459 8.30161,7.12867 24.73658,24.28114 28.72033,29.97418 7.2545,10.36718 17.82435,28.62898 17.87027,30.87495 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.73185,10.98185 8.26328,25.32922 10.61471,43.12505 1.22449,9.26706 1.16322,331.41424 -0.064,336.73278 -0.5372,2.32803 -1.44017,7.50046 -2.0066,11.4943 -1.34137,9.4579 -8.92215,32.0563 -13.79799,41.13198 -7.15927,13.32596 -9.54399,17.12718 -16.71336,26.64094 -8.13703,10.79784 -21.37404,23.79404 -33.61444,33.0029 -8.9915,6.76461 -35.59957,20.27446 -46.842,23.78333 -8.49335,2.65086 -28.76568,6.89177 -37,7.74029 -5.49524,0.56627 -8.20037,1.63921 -17.5,6.94108 -6.05,3.4492 -14.825,8.19488 -19.5,10.54596 C 499.22461,737.42673 468.99283,751 467.93874,751 c -0.32712,0 -4.22085,-7.7625 -8.65272,-17.25 z m 43.63094,-35.85773 C 548.71872,674.16771 584.31477,643.79176 603.85868,611.75348 629.24422,570.13905 634.68092,522.99227 619.39769,477 605.68316,435.72847 574.69264,396.49572 522.7961,354.70628 510.09646,344.47996 498.47792,333.43783 491,324.48765 c -6.48861,-7.7661 -11.67117,-21.88894 -10.5668,-28.79529 2.92077,-18.26544 30.07029,-43.37147 75.8168,-70.11018 5.3625,-3.13437 9.75,-5.89517 9.75,-6.13512 C 566,218.04442 497.2585,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.72632,14.13007 -62.47266,45.16278 -83.41745,70.44701 -14.62315,17.65284 -31.29711,45.73319 -37.40905,63 -1.26545,3.575 -2.66606,6.98556 -3.11247,7.57903 -1.46734,1.9507 -5.68286,21.71333 -6.91563,32.42097 -1.56797,13.61915 -0.69899,33.56812 2.04735,47 3.59714,17.59305 13.61501,40.50972 25.35432,58 16.00234,23.84171 28.94468,37.27717 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.70156,11.58151 -20.28795,25.44415 -38.31168,36.41072 -6.90334,4.20035 -26.21194,14.49764 -28.6934,15.30221 -1.02599,0.33266 3.59073,11.06424 17.38176,40.40396 C 473.3675,685.35845 483.88458,707 484.69351,707 c 0.35223,0 8.55278,-4.09848 18.22345,-9.10773 z m -273.10435,-5.97138 c 8.07806,-0.59351 18.47269,-1.95642 23.09916,-3.02869 50.47806,-11.69922 90.12572,-54.11007 104.60211,-111.8922 5.56522,-22.21344 5.79048,-25.63636 6.22445,-94.58326 l 0.40335,-64.08325 -6.3833,-9.41675 c -22.71772,-33.51351 -33.78557,-69.11986 -33.74006,-108.54508 0.0455,-39.40947 10.5586,-73.64761 34.13692,-111.17396 4.85595,-7.72854 5.84476,-10.05475 5.84476,-13.75 0,-2.89124 -0.43743,-4.44787 -1.25,-4.44818 -0.6875,-2.6e-4 -26.54094,-2.92526 -57.45209,-6.5 C 274.38677,160.92478 248.63428,158 248.07017,158 c -0.69628,0 -1.12059,61.57749 -1.32127,191.75 l -0.29562,191.75 -2.2563,8.43754 c -4.4532,16.65292 -13.29072,29.67136 -21.69698,31.96155 -9.82618,2.67703 -16.86956,0.89915 -21.39332,-5.40007 -8.68595,-12.09497 -12.41768,-32.15047 -13.73415,-73.81165 l -0.68927,-21.81264 -6.09163,0.59992 c -3.3504,0.32995 -24.31663,1.98324 -46.59163,3.67398 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.3736,0.8064 9.82054,0.88478 0.44693,0.0784 7.42193,-0.3431 15.5,-0.93661 z m 136.92679,-6.84426 c 9.17188,-8.27796 15.01693,-11.25469 23.25718,-11.84427 6.35915,-0.455 6.86685,-0.32609 10.09958,2.56436 3.17571,2.83946 3.40149,3.45091 3.36877,9.12336 l -0.0351,6.07992 17.74325,0 17.74324,0 -2.84069,-6.25 c -4.90028,-10.78144 -42.67124,-91.05863 -44.74082,-95.09071 l -1.97135,-3.84071 -2.27281,8.34071 c -8.01104,29.39876 -24.09474,58.77764 -42.73229,78.05588 -3.37789,3.49401 -9.13186,9.14996 -12.78659,12.56878 L 324.92683,691 l 17.62477,0 17.62478,0 6.56302,-5.92337 z m 27.25502,4.67337 c -0.012,-2.70135 -2.15008,-8.7628 -3.60354,-10.21626 -0.84355,-0.84356 -2.73909,-1.52952 -4.21231,-1.52436 -3.48129,0.0122 -11.75141,4.83037 -16.12474,9.39428 L 366.60767,691 l 13.69616,0 c 10.29324,0 13.69478,-0.31057 13.69059,-1.25 z m 5.80822,-4.02553 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.6403,-4.97759 5.61919,-8.23441 12.42104,-20.44222 4.1459,-7.44096 9.60424,-25.00172 11.8642,-38.16986 1.87508,-10.92552 1.9476,-17.31176 1.94203,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.02262,-18.0841 -12.25763,-38.72903 -25.05026,-56 -9.09572,-12.27988 -28.50772,-29.69811 -40.04789,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.52529,-1.87985 -16,-2.2773 -16,-1.83014 0,0.20377 16.02611,26.78833 35.61357,59.07681 19.58747,32.28848 35.78524,58.99726 35.99505,59.35283 0.20982,0.35558 -8.37369,5.47334 -19.07446,11.37281 -39.99695,22.05084 -69.78136,43.05444 -76.52348,53.96342 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 1.87803,3.6317 5.32019,6.84149 5.32019,4.96104 0,-3.09283 5.08296,-11.51384 9.81484,-16.26038 14.7422,-14.78786 39.4029,-11.75534 47.03502,5.78387 1.03207,2.37179 1.97402,4.4608 2.09322,4.64224 0.1192,0.18145 1.47348,-0.49355 3.00951,-1.5 4.16003,-2.72576 15.51991,-2.48826 21.07281,0.44057 12.37248,6.52576 13.76083,21.10201 3.11896,32.74592 C 601.14764,340.8072 594.51664,344 586.03805,344 c -4.56971,0 -7.62983,-0.57914 -10.05365,-1.90268 l -3.4844,-1.90268 -3.20902,3.05913 c -2.73897,2.61103 -3.44157,2.86614 -4.79653,1.74162 -1.42208,-1.18022 -1.2961,-1.58728 1.20902,-3.90645 1.53809,-1.42392 3.53503,-3.71394 4.43764,-5.08894 l 1.64111,-2.5 2.35889,2.12504 c 3.39214,3.05585 6.30839,4.37496 9.67202,4.37496 2.34867,0 4.27406,-1.40928 9.51357,-6.96344 7.23719,-7.6718 8.68332,-11.44614 6.6945,-17.47232 -2.64604,-8.01757 -12.8456,-13.26574 -19.43353,-9.99948 -1.60178,0.79415 -2.9939,1.32946 -3.09359,1.18958 -0.0997,-0.13989 -1.17562,-2.06207 -2.39096,-4.27152 -4.34706,-7.90285 -14.50366,-12.39801 -28.13061,-12.45017 -11.57875,-0.0443 -14.46895,1.97751 -20.35161,14.23695 -1.7866,3.72327 -3.45459,6.64827 -3.70663,6.5 -2.03172,-1.19529 9.12902,8.35268 20.71331,17.72015 35.59529,28.78361 61.6094,55.96477 80.19656,83.79434 3.75272,5.61875 7.90046,12.15528 9.21719,14.52561 1.92926,3.47299 2.78863,4.18855 4.42637,3.68568 1.11776,-0.34321 4.97175,-0.87353 8.56442,-1.17848 6.03302,-0.51209 6.77538,-0.34976 9.71599,2.1246 3.86943,3.25591 4.92173,7.81295 3.30797,14.3254 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.17499,-0.72619 -1.13871,-0.5284 1.09312,5.95853 7.43617,21.61358 10.61276,51.89607 8.02299,76.48313 -4.79872,45.55877 -23.94455,83.74596 -61.9559,123.57378 l -8.52382,8.93116 5,-2.83514 c 2.75,-1.55933 6.35,-3.56331 8,-4.4533 z m 49.04367,-72.41828 C 647.72206,595.86116 653.86164,586 659.42308,586 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07308,-8.108 28.14968,-18.60369 33.12543,-26.58752 l 2.01308,-3.23009 -3.31045,-6.26991 c -4.34399,-8.22743 -24.82039,-28.92056 -42.32806,-42.77608 -7.15,-5.6585 -16.21652,-13.14625 -20.14783,-16.63945 l -7.14782,-6.35128 -0.48517,48.24845 c -0.46454,46.19686 -1.29282,60.23918 -4.2472,72.00526 -0.67819,2.70095 -0.33029,2.58334 17.1679,-5.80411 C 418.46295,563.74419 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.34519,-59.43803 c 0.67801,-4.94658 -0.91598,-11.9728 -3.24442,-14.30124 -0.98285,-0.98285 -2.99485,-1.49575 -5.3276,-1.35811 l -3.74833,0.22117 4.83965,10.0631 c 2.66181,5.53471 4.85981,10.73811 4.88444,11.56311 0.0857,2.86976 1.9705,-1.62259 2.59626,-6.18803 z m -493.89938,0.16659 C 184.98001,447.79035 209.84251,446 210.96291,446 212.98457,446 213,445.62986 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -10.99491,-0.99698 -21.63725,-7.85685 -24.33173,-15.68381 -0.67448,-1.95926 -1.21828,-7.1804 -1.20844,-11.60254 0.0433,-19.46697 10.65,-36.28301 25.92189,-41.09704 L 213,277.63476 l 0,-78.44519 0,-78.44519 3.75,0.56994 c 2.0625,0.31347 43.03554,4.93377 91.05119,10.26733 l 87.30119,9.69739 10.19881,-9.93447 C 410.91054,125.88061 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.28795 c -105.33213,0.28749 -105.51591,0.29153 -115.5,2.54238 -12.41737,2.79941 -15.119,3.61018 -24.5,7.35248 -12.44547,4.96481 -23.59239,11.02506 -32.33043,17.57713 -10.35588,7.76516 -26.9031,24.77669 -32.17578,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998425,9.20925 -2.073386,12.90717 -2.449274,120.82658 l -0.387755,111.32658 5.287009,-0.59802 c 2.90786,-0.3289 29.23282,-2.38836 58.49992,-4.57658 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.922256,1.33146 -2.540092,1.35234 -4.744009,-0.2592 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.5,244.49799 c -4.86245,-1.71915 -9.03192,-6.1432 -10.3754,-11.0089 -3.03876,-11.00548 7.22777,-32.09261 18.21397,-37.41094 5.71908,-2.76856 15.27671,-2.82523 20.57548,-0.122 4.42762,2.2588 8.80689,7.08381 9.71563,10.70452 2.00549,7.99052 -3.50219,21.37534 -12.4903,30.35405 -8.26211,8.25348 -16.58787,10.68349 -25.63938,7.48327 z m 13.93915,-2.90812 c 4.67048,-1.95145 11.74422,-15.97688 12.36142,-24.50955 0.81886,-11.32067 -4.70149,-17.48578 -15.06169,-16.82085 -4.94249,0.31722 -6.25917,0.85248 -9.26607,3.76688 -6.47618,6.27697 -11.47127,19.83784 -10.06613,27.32793 1.72733,9.20741 12.50731,14.21546 22.03247,10.23559 z m 18.73425,-20.24896 c 2.5947,-5.86575 2.79679,-13.21126 0.46154,-16.77531 -2.22038,-3.38873 -7.40588,-6.56871 -10.63494,-6.52182 l -2.5,0.0363 2.65857,1.44399 c 7.54541,4.09827 9.69354,16.03478 5.23641,29.09718 -1.16794,3.42285 2.54882,-2.23995 4.77842,-7.28034 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -5.77749,0 c -7.97727,0 -11.79975,2.79085 -16.75516,12.2332 -7.55755,14.40063 -7.21429,32.22179 0.762,39.56078 3.5215,3.24014 11.4363,6.10425 17.02065,6.15925 L 213,344 l 0,-29 z m 390.54251,16.75 c 5.04336,-5.05476 7.43768,-9.98743 7.45191,-15.35212 0.015,-5.6706 -9.24319,-13.39075 -15.99442,-13.33723 l -3.5,0.0277 3.75245,1.98095 c 7.33878,3.87421 11.41408,14.00634 8.46879,21.05539 -0.80908,1.9364 -2.92396,5.1755 -4.69974,7.198 -4.91695,5.6001 -1.42291,4.38462 4.52101,-1.57273 z M 568.00262,290.50316 C 565.2906,287.23537 549.06767,284.46346 547.5,287 c -0.38586,0.62434 1.75204,1.02043 5.69098,1.05438 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.6676,1.88859 4.87244,1.94562 0.20485,0.057 -0.18657,-0.56989 -0.86982,-1.39315 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3466"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#746b41"
+       d="m 459.28602,733.75 -8.05795,-17.25 -85.243,-0.25564 -85.24299,-0.25564 -9.51042,3.04646 c -26.64462,8.53503 -63.29517,10.10563 -91.66293,3.92807 -18.8597,-4.10702 -35.53772,-10.91176 -50.3103,-20.52692 C 84.344956,673.2031 56.82709,625.88522 47.587218,562 45.046497,544.43325 44.020254,524.02417 44.009889,490.85699 43.998902,455.70103 43.514353,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.546827,231.52324 67.547361,231.49763 69.826915,220 73.766717,200.12841 79.970437,183.96521 89.731255,168.14116 98.989548,153.13179 105.49104,144.79863 115.66301,134.90363 123.75187,127.03501 144.05676,111 145.9318,111 c 0.43401,0 2.53858,-1.18723 4.67684,-2.63828 C 158.92079,102.72093 181.07662,94.636247 200,90.338749 L 212.5,87.5 l 125,-0.5 125,-0.5 5,-3.147983 c 5.88937,-3.707925 39.1147,-22.257545 40.49769,-22.609757 0.52319,-0.133243 4.4733,5.60774 8.77801,12.75774 l 7.82676,13 12.94877,0.661881 c 7.12182,0.364034 18.12377,1.568513 24.44877,2.676618 13.39035,2.345917 35.91138,9.822465 43.92643,14.582731 16.94616,10.06459 23.16648,14.20471 29.45485,19.60459 8.30161,7.12867 24.73658,24.28114 28.72033,29.97418 7.2545,10.36718 17.82435,28.62898 17.87027,30.87495 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.73185,10.98185 8.26328,25.32922 10.61471,43.12505 1.22449,9.26706 1.16322,331.41424 -0.064,336.73278 -0.5372,2.32803 -1.44017,7.50046 -2.0066,11.4943 -1.34137,9.4579 -8.92215,32.0563 -13.79799,41.13198 -7.15927,13.32596 -9.54399,17.12718 -16.71336,26.64094 -8.13703,10.79784 -21.37404,23.79404 -33.61444,33.0029 -8.9915,6.76461 -35.59957,20.27446 -46.842,23.78333 -8.49335,2.65086 -28.76568,6.89177 -37,7.74029 -5.49524,0.56627 -8.20037,1.63921 -17.5,6.94108 -6.05,3.4492 -14.825,8.19488 -19.5,10.54596 C 499.22461,737.42673 468.99283,751 467.93874,751 c -0.32712,0 -4.22085,-7.7625 -8.65272,-17.25 z m 43.63094,-35.85773 C 548.71872,674.16771 584.31477,643.79176 603.85868,611.75348 629.24422,570.13905 634.68092,522.99227 619.39769,477 605.68316,435.72847 574.69264,396.49572 522.7961,354.70628 510.09646,344.47996 498.47792,333.43783 491,324.48765 c -6.48861,-7.7661 -11.67117,-21.88894 -10.5668,-28.79529 2.92077,-18.26544 30.07029,-43.37147 75.8168,-70.11018 5.3625,-3.13437 9.75,-5.89517 9.75,-6.13512 C 566,218.04442 497.2585,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.72632,14.13007 -62.47266,45.16278 -83.41745,70.44701 -14.62315,17.65284 -31.29711,45.73319 -37.40905,63 -1.26545,3.575 -2.66606,6.98556 -3.11247,7.57903 -1.46734,1.9507 -5.68286,21.71333 -6.91563,32.42097 -1.56797,13.61915 -0.69899,33.56812 2.04735,47 3.59714,17.59305 13.61501,40.50972 25.35432,58 16.00234,23.84171 28.94468,37.27717 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.70156,11.58151 -20.28795,25.44415 -38.31168,36.41072 -6.90334,4.20035 -26.21194,14.49764 -28.6934,15.30221 -1.02599,0.33266 3.59073,11.06424 17.38176,40.40396 C 473.3675,685.35845 483.88458,707 484.69351,707 c 0.35223,0 8.55278,-4.09848 18.22345,-9.10773 z m -273.10435,-5.97138 c 8.07806,-0.59351 18.47269,-1.95642 23.09916,-3.02869 50.47806,-11.69922 90.12572,-54.11007 104.60211,-111.8922 5.56522,-22.21344 5.79048,-25.63636 6.22445,-94.58326 l 0.40335,-64.08325 -6.3833,-9.41675 c -22.71772,-33.51351 -33.78557,-69.11986 -33.74006,-108.54508 0.0455,-39.40947 10.5586,-73.64761 34.13692,-111.17396 4.85595,-7.72854 5.84476,-10.05475 5.84476,-13.75 0,-2.89124 -0.43743,-4.44787 -1.25,-4.44818 -0.6875,-2.6e-4 -26.54094,-2.92526 -57.45209,-6.5 C 274.38677,160.92478 248.63428,158 248.07017,158 c -0.69628,0 -1.12059,61.57749 -1.32127,191.75 l -0.29562,191.75 -2.2563,8.43754 c -4.4532,16.65292 -13.29072,29.67136 -21.69698,31.96155 -9.82618,2.67703 -16.86956,0.89915 -21.39332,-5.40007 -8.68595,-12.09497 -12.41768,-32.15047 -13.73415,-73.81165 l -0.68927,-21.81264 -6.09163,0.59992 c -3.3504,0.32995 -24.31663,1.98324 -46.59163,3.67398 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.3736,0.8064 9.82054,0.88478 0.44693,0.0784 7.42193,-0.3431 15.5,-0.93661 z m 136.92679,-6.84426 c 9.17188,-8.27796 15.01693,-11.25469 23.25718,-11.84427 6.35915,-0.455 6.86685,-0.32609 10.09958,2.56436 3.17571,2.83946 3.40149,3.45091 3.36877,9.12336 l -0.0351,6.07992 17.74325,0 17.74324,0 -2.84069,-6.25 c -4.90028,-10.78144 -42.67124,-91.05863 -44.74082,-95.09071 l -1.97135,-3.84071 -2.27281,8.34071 c -8.01104,29.39876 -24.09474,58.77764 -42.73229,78.05588 -3.37789,3.49401 -9.13186,9.14996 -12.78659,12.56878 L 324.92683,691 l 17.62477,0 17.62478,0 6.56302,-5.92337 z M 394,689.625 c 0,-6.49963 -3.44066,-11.63067 -7.78896,-11.61562 -3.5097,0.0122 -11.76794,4.81373 -16.15721,9.39428 L 366.60767,691 l 13.69616,0 C 391.25816,691 394,690.72474 394,689.625 z m 5.80264,-3.90053 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.6403,-4.97759 5.61919,-8.23441 12.42104,-20.44222 4.1459,-7.44096 9.60424,-25.00172 11.8642,-38.16986 1.87508,-10.92552 1.9476,-17.31176 1.94203,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.02262,-18.0841 -12.25763,-38.72903 -25.05026,-56 -9.09572,-12.27988 -28.50772,-29.69811 -40.04789,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.52529,-1.87985 -16,-2.2773 -16,-1.83014 0,0.20377 16.02611,26.78833 35.61357,59.07681 19.58747,32.28848 35.78524,58.99726 35.99505,59.35283 0.20982,0.35558 -8.37369,5.47334 -19.07446,11.37281 -39.99695,22.05084 -69.78136,43.05444 -76.52348,53.96342 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 1.87803,3.6317 5.32019,6.84149 5.32019,4.96104 0,-3.09283 5.08296,-11.51384 9.81484,-16.26038 14.7422,-14.78786 39.4029,-11.75534 47.03502,5.78387 1.03207,2.37179 1.97402,4.4608 2.09322,4.64224 0.1192,0.18145 1.47348,-0.49355 3.00951,-1.5 4.16003,-2.72576 15.51991,-2.48826 21.07281,0.44057 12.37248,6.52576 13.76083,21.10201 3.11896,32.74592 C 601.14764,340.8072 594.51664,344 586.03805,344 c -4.56971,0 -7.62983,-0.57914 -10.05365,-1.90268 l -3.4844,-1.90268 -3.20902,3.05913 c -2.73897,2.61103 -3.44157,2.86614 -4.79653,1.74162 -1.4216,-1.17982 -1.29252,-1.58806 1.23522,-3.90645 1.5525,-1.42392 3.58927,-3.68849 4.52617,-5.03238 l 1.70344,-2.44344 2.27036,2.06848 c 3.28197,2.99013 6.22969,4.3184 9.58349,4.3184 2.34867,0 4.27406,-1.40928 9.51357,-6.96344 7.70668,-8.16949 8.85981,-11.64121 6.18925,-18.63396 -2.88672,-7.55877 -12.66345,-12.13542 -18.93832,-8.86532 -2.95042,1.53758 -4.52024,0.81589 -4.56232,-2.09744 -0.0309,-2.13658 -6.66324,-7.82154 -12.01531,-10.29896 -7.45947,-3.45291 -22.63509,-4.33074 -27.70134,-1.60238 -3.7103,1.99812 -8.35199,8.4158 -10.88611,15.05132 -0.9778,2.56032 -2.13339,4.12975 -2.7907,3.79008 -2.1669,-1.11977 7.0179,6.7988 21.00573,18.10985 35.59529,28.78361 61.6094,55.96477 80.19656,83.79434 3.75272,5.61875 7.90046,12.15528 9.21719,14.52561 1.92926,3.47299 2.78863,4.18855 4.42637,3.68568 1.11776,-0.34321 4.97175,-0.87353 8.56442,-1.17848 6.03302,-0.51209 6.77538,-0.34976 9.71599,2.1246 3.86943,3.25591 4.92173,7.81295 3.30797,14.3254 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.17499,-0.72619 -1.13871,-0.5284 1.09312,5.95853 7.43617,21.61358 10.61276,51.89607 8.02299,76.48313 -4.79872,45.55877 -23.94455,83.74596 -61.9559,123.57378 l -8.52382,8.93116 5,-2.83514 c 2.75,-1.55933 6.35,-3.56331 8,-4.4533 z m 49.04367,-72.41828 C 647.72206,595.86116 653.86164,586 659.42308,586 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07308,-8.108 28.14968,-18.60369 33.12543,-26.58752 l 2.01308,-3.23009 -3.31045,-6.26991 c -4.34399,-8.22743 -24.82039,-28.92056 -42.32806,-42.77608 -7.15,-5.6585 -16.21652,-13.14625 -20.14783,-16.63945 l -7.14782,-6.35128 -0.48517,48.24845 c -0.46454,46.19686 -1.29282,60.23918 -4.2472,72.00526 -0.67819,2.70095 -0.33029,2.58334 17.1679,-5.80411 C 418.46295,563.74419 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.92226,1.33146 -2.54009,1.35234 -4.74401,-0.2592 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.28527,-58.55996 c 0.92064,-5.44926 -0.28028,-12.02086 -2.6644,-14.57991 -1.50077,-1.61089 -3.02381,-2.12413 -5.8147,-1.95946 l -3.78133,0.22312 4.83965,10.0631 c 2.66181,5.53471 4.85302,10.73811 4.86935,11.56311 0.0529,2.67321 1.82618,-1.01728 2.55143,-5.30996 z M 155.71291,449.97856 C 184.98001,447.79035 209.84251,446 210.96291,446 212.98457,446 213,445.62986 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -10.99491,-0.99698 -21.63725,-7.85685 -24.33173,-15.68381 -0.67448,-1.95926 -1.21828,-7.1804 -1.20844,-11.60254 0.0433,-19.46697 10.65,-36.28301 25.92189,-41.09704 L 213,277.63476 l 0,-78.44519 0,-78.44519 3.75,0.56994 c 2.0625,0.31347 43.03554,4.93377 91.05119,10.26733 l 87.30119,9.69739 10.19881,-9.93447 C 410.91054,125.88061 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.28795 c -105.33213,0.28749 -105.51591,0.29153 -115.5,2.54238 -12.41737,2.79941 -15.119,3.61018 -24.5,7.35248 -12.44547,4.96481 -23.59239,11.02506 -32.33043,17.57713 -10.35588,7.76516 -26.9031,24.77669 -32.17578,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998425,9.20925 -2.073386,12.90717 -2.449274,120.82658 l -0.387755,111.32658 5.287009,-0.59802 c 2.90786,-0.3289 29.23282,-2.38836 58.49992,-4.57658 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 c 2.21428,0 2.57692,0.43564 2.57692,3.09571 0,3.90842 -2.6185,8.40944 -5.71232,9.81908 -2.922256,1.33146 -2.540092,1.35234 -4.744009,-0.2592 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.5,244.49799 c -4.86245,-1.71915 -9.03192,-6.1432 -10.3754,-11.0089 -3.03876,-11.00548 7.22777,-32.09261 18.21397,-37.41094 5.71908,-2.76856 15.27671,-2.82523 20.57548,-0.122 4.42762,2.2588 8.80689,7.08381 9.71563,10.70452 2.00549,7.99052 -3.50219,21.37534 -12.4903,30.35405 -8.26211,8.25348 -16.58787,10.68349 -25.63938,7.48327 z m 13.98551,-2.92749 c 4.78709,-2.00017 11.56584,-15.34107 12.27329,-24.15442 0.93145,-11.60389 -4.51972,-17.83052 -15.01992,-17.15661 -4.89425,0.31412 -6.26948,0.86248 -9.1396,3.64431 -6.70478,6.49853 -11.63317,19.77157 -10.1926,27.4505 1.73139,9.22909 12.50752,14.21537 22.07883,10.21622 z m 18.68789,-20.22959 c 2.5947,-5.86575 2.79679,-13.21126 0.46154,-16.77531 -2.22038,-3.38873 -7.40588,-6.56871 -10.63494,-6.52182 l -2.5,0.0363 2.65857,1.44399 c 7.54541,4.09827 9.69354,16.03478 5.23641,29.09718 -1.16794,3.42285 2.54882,-2.23995 4.77842,-7.28034 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -5.75,0.007 c -6.83856,0.008 -10.29165,1.93364 -14.37865,8.01903 -6.3888,9.51269 -9.75805,26.7276 -6.91629,35.33821 2.94023,8.90899 11.2787,14.35087 22.29494,14.55022 L 213,344 l 0,-29 z m 390.54251,16.75 c 5.04336,-5.05476 7.43768,-9.98743 7.45191,-15.35212 0.015,-5.6706 -9.24319,-13.39075 -15.99442,-13.33723 l -3.5,0.0277 3.75245,1.98095 c 7.33878,3.87421 11.41408,14.00634 8.46879,21.05539 -0.80908,1.9364 -2.92396,5.1755 -4.69974,7.198 -4.91695,5.6001 -1.42291,4.38462 4.52101,-1.57273 z M 568.00262,290.50316 C 565.2906,287.23537 549.06767,284.46346 547.5,287 c -0.38586,0.62434 1.75204,1.02043 5.69098,1.05438 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.6676,1.88859 4.87244,1.94562 0.20485,0.057 -0.18657,-0.56989 -0.86982,-1.39315 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3464"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#7b6c39"
+       d="m 459.28602,733.75 -8.05795,-17.25 -85.243,-0.25564 -85.24299,-0.25564 -9.51042,3.04646 c -26.64462,8.53503 -63.29517,10.10563 -91.66293,3.92807 -18.8597,-4.10702 -35.53772,-10.91176 -50.3103,-20.52692 C 84.344956,673.2031 56.82709,625.88522 47.587218,562 45.046497,544.43325 44.020254,524.02417 44.009889,490.85699 43.998902,455.70103 43.514353,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.546827,231.52324 67.547361,231.49763 69.826915,220 73.766717,200.12841 79.970437,183.96521 89.731255,168.14116 98.989548,153.13179 105.49104,144.79863 115.66301,134.90363 123.75187,127.03501 144.05676,111 145.9318,111 c 0.43401,0 2.53858,-1.18723 4.67684,-2.63828 C 158.92079,102.72093 181.07662,94.636247 200,90.338749 L 212.5,87.5 l 125,-0.5 125,-0.5 5,-3.147983 c 5.88937,-3.707925 39.1147,-22.257545 40.49769,-22.609757 0.52319,-0.133243 4.4733,5.60774 8.77801,12.75774 l 7.82676,13 12.94877,0.661881 c 7.12182,0.364034 18.12377,1.568513 24.44877,2.676618 13.39035,2.345917 35.91138,9.822465 43.92643,14.582731 16.94616,10.06459 23.16648,14.20471 29.45485,19.60459 8.30161,7.12867 24.73658,24.28114 28.72033,29.97418 7.2545,10.36718 17.82435,28.62898 17.87027,30.87495 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.73185,10.98185 8.26328,25.32922 10.61471,43.12505 1.22449,9.26706 1.16322,331.41424 -0.064,336.73278 -0.5372,2.32803 -1.44017,7.50046 -2.0066,11.4943 -1.34137,9.4579 -8.92215,32.0563 -13.79799,41.13198 -7.15927,13.32596 -9.54399,17.12718 -16.71336,26.64094 -8.13703,10.79784 -21.37404,23.79404 -33.61444,33.0029 -8.9915,6.76461 -35.59957,20.27446 -46.842,23.78333 -8.49335,2.65086 -28.76568,6.89177 -37,7.74029 -5.49524,0.56627 -8.20037,1.63921 -17.5,6.94108 -6.05,3.4492 -14.825,8.19488 -19.5,10.54596 C 499.22461,737.42673 468.99283,751 467.93874,751 c -0.32712,0 -4.22085,-7.7625 -8.65272,-17.25 z m 43.63094,-35.85773 C 548.71872,674.16771 584.31477,643.79176 603.85868,611.75348 629.24422,570.13905 634.68092,522.99227 619.39769,477 605.68316,435.72847 574.69264,396.49572 522.7961,354.70628 510.09646,344.47996 498.47792,333.43783 491,324.48765 c -6.48861,-7.7661 -11.67117,-21.88894 -10.5668,-28.79529 2.92077,-18.26544 30.07029,-43.37147 75.8168,-70.11018 5.3625,-3.13437 9.75,-5.89517 9.75,-6.13512 C 566,218.04442 497.2585,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.72632,14.13007 -62.47266,45.16278 -83.41745,70.44701 -14.62315,17.65284 -31.29711,45.73319 -37.40905,63 -1.26545,3.575 -2.66606,6.98556 -3.11247,7.57903 -1.46734,1.9507 -5.68286,21.71333 -6.91563,32.42097 -1.56797,13.61915 -0.69899,33.56812 2.04735,47 3.59714,17.59305 13.61501,40.50972 25.35432,58 16.00234,23.84171 28.94468,37.27717 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.70156,11.58151 -20.28795,25.44415 -38.31168,36.41072 -6.90334,4.20035 -26.21194,14.49764 -28.6934,15.30221 -1.02599,0.33266 3.59073,11.06424 17.38176,40.40396 C 473.3675,685.35845 483.88458,707 484.69351,707 c 0.35223,0 8.55278,-4.09848 18.22345,-9.10773 z m -273.10435,-5.97138 c 8.07806,-0.59351 18.47269,-1.95642 23.09916,-3.02869 50.47806,-11.69922 90.12572,-54.11007 104.60211,-111.8922 5.56522,-22.21344 5.79048,-25.63636 6.22445,-94.58326 l 0.40335,-64.08325 -6.3833,-9.41675 c -22.71772,-33.51351 -33.78557,-69.11986 -33.74006,-108.54508 0.0455,-39.40947 10.5586,-73.64761 34.13692,-111.17396 4.85595,-7.72854 5.84476,-10.05475 5.84476,-13.75 0,-2.89124 -0.43743,-4.44787 -1.25,-4.44818 -0.6875,-2.6e-4 -26.54094,-2.92526 -57.45209,-6.5 C 274.38677,160.92478 248.63428,158 248.07017,158 c -0.69628,0 -1.12059,61.57749 -1.32127,191.75 l -0.29562,191.75 -2.2563,8.43754 c -4.4532,16.65292 -13.29072,29.67136 -21.69698,31.96155 -9.82618,2.67703 -16.86956,0.89915 -21.39332,-5.40007 -8.68595,-12.09497 -12.41768,-32.15047 -13.73415,-73.81165 l -0.68927,-21.81264 -6.09163,0.59992 c -3.3504,0.32995 -24.31663,1.98324 -46.59163,3.67398 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.3736,0.8064 9.82054,0.88478 0.44693,0.0784 7.42193,-0.3431 15.5,-0.93661 z m 136.90061,-6.82063 c 8.61493,-7.77529 15.89623,-11.41693 23.83887,-11.92268 5.72661,-0.36464 6.42096,-0.17331 9.56148,2.63469 3.1561,2.82193 3.38404,3.44142 3.35136,9.10781 l -0.0351,6.07992 17.74325,0 17.74324,0 -2.84069,-6.25 c -4.90028,-10.78144 -42.67124,-91.05863 -44.74082,-95.09071 l -1.97135,-3.84071 -2.27281,8.34071 c -8.01104,29.39876 -24.09474,58.77764 -42.73229,78.05588 -3.37789,3.49401 -9.13186,9.14996 -12.78659,12.56878 L 324.92683,691 l 17.62477,0 17.62478,0 6.53684,-5.89974 z M 394,689.625 c 0,-6.49963 -3.44066,-11.63067 -7.78896,-11.61562 -3.5097,0.0122 -11.76794,4.81373 -16.15721,9.39428 L 366.60767,691 l 13.69616,0 C 391.25816,691 394,690.72474 394,689.625 z m 5.80264,-3.90053 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.6403,-4.97759 5.61919,-8.23441 12.42104,-20.44222 4.1459,-7.44096 9.60424,-25.00172 11.8642,-38.16986 1.87508,-10.92552 1.9476,-17.31176 1.94203,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.02262,-18.0841 -12.25763,-38.72903 -25.05026,-56 -9.09572,-12.27988 -28.50772,-29.69811 -40.04789,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.52529,-1.87985 -16,-2.2773 -16,-1.83014 0,0.20377 16.02611,26.78833 35.61357,59.07681 19.58747,32.28848 35.78524,58.99726 35.99505,59.35283 0.20982,0.35558 -8.37369,5.47334 -19.07446,11.37281 -39.99695,22.05084 -69.78136,43.05444 -76.52348,53.96342 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 1.87803,3.6317 5.32019,6.84149 5.32019,4.96104 0,-3.18019 5.12069,-11.55585 9.98062,-16.32481 7.1,-6.96709 14.2651,-9.69945 23.85271,-9.09607 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 9.33711,5.48878 12.16577,14.41168 7.79186,24.5791 -2.81177,6.53615 -11.12179,14.34707 -17.61915,16.56094 -6.36336,2.16822 -14.95344,2.00842 -19.35736,-0.3601 l -3.5,-1.88237 -3.20902,3.08074 c -2.73969,2.63016 -3.44121,2.88804 -4.79653,1.76322 -1.4216,-1.17982 -1.29252,-1.58806 1.23522,-3.90645 1.5525,-1.42392 3.58927,-3.68849 4.52617,-5.03238 l 1.70344,-2.44344 2.27036,2.06848 c 3.28197,2.99013 6.22969,4.3184 9.58349,4.3184 2.34867,0 4.27406,-1.40928 9.51357,-6.96344 7.70668,-8.16949 8.85981,-11.64121 6.18925,-18.63396 -2.88672,-7.55877 -12.66345,-12.13542 -18.93832,-8.86532 -2.95042,1.53758 -4.52024,0.81589 -4.56232,-2.09744 -0.0309,-2.13658 -6.66324,-7.82154 -12.01531,-10.29896 -7.45947,-3.45291 -22.63509,-4.33074 -27.70134,-1.60238 -3.7103,1.99812 -8.35199,8.4158 -10.88611,15.05132 -0.9778,2.56032 -2.13339,4.12975 -2.7907,3.79008 -2.1669,-1.11977 7.0179,6.7988 21.00573,18.10985 35.59529,28.78361 61.6094,55.96477 80.19656,83.79434 3.75272,5.61875 7.90394,12.16148 9.22494,14.53939 2.09519,3.77155 2.72409,4.24181 4.92636,3.68372 1.38851,-0.35188 5.24704,-0.88163 8.57452,-1.17724 5.49925,-0.48855 6.33817,-0.29497 9.216,2.12656 3.85075,3.24019 4.90115,7.80893 3.29012,14.31038 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.17499,-0.72619 -1.13871,-0.5284 1.09312,5.95853 7.43617,21.61358 10.61276,51.89607 8.02299,76.48313 -4.79872,45.55877 -23.94455,83.74596 -61.9559,123.57378 l -8.52382,8.93116 5,-2.83514 c 2.75,-1.55933 6.35,-3.56331 8,-4.4533 z m 49.04367,-72.41828 C 647.72206,595.86116 653.86164,586 659.42308,586 661.7151,586 662,586.39801 662,589.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07308,-8.108 28.14968,-18.60369 33.12543,-26.58752 l 2.01308,-3.23009 -3.31045,-6.26991 c -4.34399,-8.22743 -24.82039,-28.92056 -42.32806,-42.77608 -7.15,-5.6585 -16.21652,-13.14625 -20.14783,-16.63945 l -7.14782,-6.35128 -0.48517,48.24845 c -0.46454,46.19686 -1.29282,60.23918 -4.2472,72.00526 -0.67819,2.70095 -0.33029,2.58334 17.1679,-5.80411 C 418.46295,563.74419 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 417.7151,500 418,500.39801 418,503.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.28527,-58.55996 c 0.92064,-5.44926 -0.28028,-12.02086 -2.6644,-14.57991 -1.50077,-1.61089 -3.02381,-2.12413 -5.8147,-1.95946 l -3.78133,0.22312 4.83965,10.0631 c 2.66181,5.53471 4.85302,10.73811 4.86935,11.56311 0.0529,2.67321 1.82618,-1.01728 2.55143,-5.30996 z M 155.71291,449.97856 C 184.98001,447.79035 209.84251,446 210.96291,446 212.98457,446 213,445.62986 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -18.67586,-1.69347 -28.16069,-14.31599 -25.10946,-33.41595 2.93393,-18.36562 11.9257,-30.6913 25.5147,-34.97486 L 213,277.63476 l 0,-78.44519 0,-78.44519 3.75,0.56994 c 2.0625,0.31347 43.03554,4.93377 91.05119,10.26733 l 87.30119,9.69739 10.19881,-9.93447 C 410.91054,125.88061 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.28795 c -105.33213,0.28749 -105.51591,0.29153 -115.5,2.54238 -12.41737,2.79941 -15.119,3.61018 -24.5,7.35248 -12.44547,4.96481 -23.59239,11.02506 -32.33043,17.57713 -10.35588,7.76516 -26.9031,24.77669 -32.17578,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998425,9.20925 -2.073386,12.90717 -2.449274,120.82658 l -0.387755,111.32658 5.287009,-0.59802 c 2.90786,-0.3289 29.23282,-2.38836 58.49992,-4.57658 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 107.7151,380 108,380.39801 108,383.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.056329,2.05559 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.85894 2.95336,-15.61065 8.89807,-23.35486 6.05356,-7.886 11.25241,-10.74011 19.50921,-10.71035 9.79353,0.0353 18.41088,5.42102 20.2224,12.63871 2.7107,10.80028 -8.78564,30.99138 -20.88023,36.67209 -5.2085,2.44638 -12.45735,2.98822 -17.06565,1.27563 z m 13.80171,-3.03789 c 4.78709,-2.00017 11.56584,-15.34107 12.27329,-24.15442 0.93145,-11.60389 -4.51972,-17.83052 -15.01992,-17.15661 -4.89425,0.31412 -6.26948,0.86248 -9.1396,3.64431 -6.70478,6.49853 -11.63317,19.77157 -10.1926,27.4505 1.73139,9.22909 12.50752,14.21537 22.07883,10.21622 z m 18.68789,-20.22959 c 2.5947,-5.86575 2.79679,-13.21126 0.46154,-16.77531 -2.22038,-3.38873 -7.40588,-6.56871 -10.63494,-6.52182 l -2.5,0.0363 2.65857,1.44399 c 7.54541,4.09827 9.69354,16.03478 5.23641,29.09718 -1.16794,3.42285 2.54882,-2.23995 4.77842,-7.28034 z M 655.9549,441.25 c 0.0502,-4.72842 -2.5045,-8.25 -5.98484,-8.25 -2.02082,0 -2.02046,0.0128 0.0818,2.85627 1.39336,1.88463 2.31123,5.03128 2.69819,9.25 0.57574,6.2768 0.60999,6.33887 1.8731,3.39373 0.70765,-1.65 1.30694,-4.9125 1.33175,-7.25 z M 213,315 l 0,-29 -5.75,0.007 c -6.83856,0.008 -10.29165,1.93364 -14.37865,8.01903 -6.3888,9.51269 -9.75805,26.7276 -6.91629,35.33821 2.94023,8.90899 11.2787,14.35087 22.29494,14.55022 L 213,344 l 0,-29 z m 390.54251,16.75 c 5.04336,-5.05476 7.43768,-9.98743 7.45191,-15.35212 0.015,-5.6706 -9.24319,-13.39075 -15.99442,-13.33723 l -3.5,0.0277 3.75245,1.98095 c 7.33878,3.87421 11.41408,14.00634 8.46879,21.05539 -0.80908,1.9364 -2.92396,5.1755 -4.69974,7.198 -4.91695,5.6001 -1.42291,4.38462 4.52101,-1.57273 z M 568.00262,290.50316 C 565.2906,287.23537 549.06767,284.46346 547.5,287 c -0.38586,0.62434 1.75204,1.02043 5.69098,1.05438 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.6676,1.88859 4.87244,1.94562 0.20485,0.057 -0.18657,-0.56989 -0.86982,-1.39315 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3462"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#816634"
+       d="m 459.28602,733.75 -8.05795,-17.25 -85.243,-0.25564 -85.24299,-0.25564 -9.51042,3.04646 c -26.64462,8.53503 -63.29517,10.10563 -91.66293,3.92807 -18.8597,-4.10702 -35.53772,-10.91176 -50.3103,-20.52692 C 84.344956,673.2031 56.82709,625.88522 47.587218,562 45.046497,544.43325 44.020254,524.02417 44.009889,490.85699 43.998902,455.70103 43.514353,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.546827,231.52324 67.547361,231.49763 69.826915,220 73.766717,200.12841 79.970437,183.96521 89.731255,168.14116 98.989548,153.13179 105.49104,144.79863 115.66301,134.90363 123.75187,127.03501 144.05676,111 145.9318,111 c 0.43401,0 2.53858,-1.18723 4.67684,-2.63828 C 158.92079,102.72093 181.07662,94.636247 200,90.338749 L 212.5,87.5 l 125,-0.5 125,-0.5 5,-3.147983 c 5.88937,-3.707925 39.1147,-22.257545 40.49769,-22.609757 0.52319,-0.133243 4.4733,5.60774 8.77801,12.75774 l 7.82676,13 12.94877,0.661881 c 7.12182,0.364034 18.12377,1.568513 24.44877,2.676618 13.39035,2.345917 35.91138,9.822465 43.92643,14.582731 16.94616,10.06459 23.16648,14.20471 29.45485,19.60459 8.30161,7.12867 24.73658,24.28114 28.72033,29.97418 7.2545,10.36718 17.82435,28.62898 17.87027,30.87495 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.73185,10.98185 8.26328,25.32922 10.61471,43.12505 1.22449,9.26706 1.16322,331.41424 -0.064,336.73278 -0.5372,2.32803 -1.44017,7.50046 -2.0066,11.4943 -1.34137,9.4579 -8.92215,32.0563 -13.79799,41.13198 -7.15927,13.32596 -9.54399,17.12718 -16.71336,26.64094 -8.13703,10.79784 -21.37404,23.79404 -33.61444,33.0029 -8.9915,6.76461 -35.59957,20.27446 -46.842,23.78333 -8.49335,2.65086 -28.76568,6.89177 -37,7.74029 -5.49524,0.56627 -8.20037,1.63921 -17.5,6.94108 -6.05,3.4492 -14.825,8.19488 -19.5,10.54596 C 499.22461,737.42673 468.99283,751 467.93874,751 c -0.32712,0 -4.22085,-7.7625 -8.65272,-17.25 z m 43.63094,-35.85773 C 548.71872,674.16771 584.31477,643.79176 603.85868,611.75348 629.24422,570.13905 634.68092,522.99227 619.39769,477 605.68316,435.72847 574.69264,396.49572 522.7961,354.70628 510.09646,344.47996 498.47792,333.43783 491,324.48765 c -6.48861,-7.7661 -11.67117,-21.88894 -10.5668,-28.79529 2.92077,-18.26544 30.07029,-43.37147 75.8168,-70.11018 5.3625,-3.13437 9.75,-5.89517 9.75,-6.13512 C 566,218.04442 497.2585,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.72632,14.13007 -62.47266,45.16278 -83.41745,70.44701 -14.62315,17.65284 -31.29711,45.73319 -37.40905,63 -1.26545,3.575 -2.66606,6.98556 -3.11247,7.57903 -1.46734,1.9507 -5.68286,21.71333 -6.91563,32.42097 -1.56797,13.61915 -0.69899,33.56812 2.04735,47 3.59714,17.59305 13.61501,40.50972 25.35432,58 16.00234,23.84171 28.94468,37.27717 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.70156,11.58151 -20.28795,25.44415 -38.31168,36.41072 -6.90334,4.20035 -26.21194,14.49764 -28.6934,15.30221 -1.02599,0.33266 3.59073,11.06424 17.38176,40.40396 C 473.3675,685.35845 483.88458,707 484.69351,707 c 0.35223,0 8.55278,-4.09848 18.22345,-9.10773 z m -273.10435,-5.97138 c 8.07806,-0.59351 18.47269,-1.95642 23.09916,-3.02869 50.47806,-11.69922 90.12572,-54.11007 104.60211,-111.8922 5.56522,-22.21344 5.79048,-25.63636 6.22445,-94.58326 l 0.40335,-64.08325 -6.3833,-9.41675 c -22.71772,-33.51351 -33.78557,-69.11986 -33.74006,-108.54508 0.0455,-39.40947 10.5586,-73.64761 34.13692,-111.17396 4.85595,-7.72854 5.84476,-10.05475 5.84476,-13.75 0,-2.89124 -0.43743,-4.44787 -1.25,-4.44818 -0.6875,-2.6e-4 -26.54094,-2.92526 -57.45209,-6.5 C 274.38677,160.92478 248.63428,158 248.07017,158 c -0.69628,0 -1.12059,61.57749 -1.32127,191.75 l -0.29562,191.75 -2.2563,8.43754 c -4.4532,16.65292 -13.29072,29.67136 -21.69698,31.96155 -9.82618,2.67703 -16.86956,0.89915 -21.39332,-5.40007 -8.68595,-12.09497 -12.41768,-32.15047 -13.73415,-73.81165 l -0.68927,-21.81264 -6.09163,0.59992 c -3.3504,0.32995 -24.31663,1.98324 -46.59163,3.67398 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.3736,0.8064 9.82054,0.88478 0.44693,0.0784 7.42193,-0.3431 15.5,-0.93661 z m 136.90061,-6.82063 c 8.61493,-7.77529 15.89623,-11.41693 23.83887,-11.92268 5.72661,-0.36464 6.42096,-0.17331 9.56148,2.63469 3.1561,2.82193 3.38404,3.44142 3.35136,9.10781 l -0.0351,6.07992 17.74325,0 17.74324,0 -2.84069,-6.25 c -4.90028,-10.78144 -42.67124,-91.05863 -44.74082,-95.09071 l -1.97135,-3.84071 -2.27281,8.34071 c -8.01104,29.39876 -24.09474,58.77764 -42.73229,78.05588 -3.37789,3.49401 -9.13186,9.14996 -12.78659,12.56878 L 324.92683,691 l 17.62477,0 17.62478,0 6.53684,-5.89974 z M 394,689.625 c 0,-6.49963 -3.44066,-11.63067 -7.78896,-11.61562 -3.5097,0.0122 -11.76794,4.81373 -16.15721,9.39428 L 366.60767,691 l 13.69616,0 C 391.25816,691 394,690.72474 394,689.625 z m 5.80264,-3.90053 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.6403,-4.97759 5.61919,-8.23441 12.42104,-20.44222 4.1459,-7.44096 9.60424,-25.00172 11.8642,-38.16986 1.87508,-10.92552 1.9476,-17.31176 1.94203,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.02262,-18.0841 -12.25763,-38.72903 -25.05026,-56 -9.09572,-12.27988 -28.50772,-29.69811 -40.04789,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.52529,-1.87985 -16,-2.2773 -16,-1.83014 0,0.20377 16.02611,26.78833 35.61357,59.07681 19.58747,32.28848 35.78524,58.99726 35.99505,59.35283 0.20982,0.35558 -8.37369,5.47334 -19.07446,11.37281 -39.99695,22.05084 -69.78136,43.05444 -76.52348,53.96342 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 1.87803,3.6317 5.32019,6.84149 5.32019,4.96104 0,-3.18019 5.12069,-11.55585 9.98062,-16.32481 7.1,-6.96709 14.2651,-9.69945 23.85271,-9.09607 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 9.33711,5.48878 12.16577,14.41168 7.79186,24.5791 -2.81177,6.53615 -11.12179,14.34707 -17.61915,16.56094 -6.36336,2.16822 -14.95344,2.00842 -19.35736,-0.3601 l -3.5,-1.88237 -3.20902,3.08074 c -2.73969,2.63016 -3.44121,2.88804 -4.79653,1.76322 -1.4216,-1.17982 -1.29252,-1.58806 1.23522,-3.90645 1.5525,-1.42392 3.58927,-3.68849 4.52617,-5.03238 l 1.70344,-2.44344 2.27036,2.06848 c 3.28197,2.99013 6.22969,4.3184 9.58349,4.3184 2.34867,0 4.27406,-1.40928 9.51357,-6.96344 7.70668,-8.16949 8.85981,-11.64121 6.18925,-18.63396 -2.88672,-7.55877 -12.66345,-12.13542 -18.93832,-8.86532 -2.95042,1.53758 -4.52024,0.81589 -4.56232,-2.09744 -0.0309,-2.13658 -6.66324,-7.82154 -12.01531,-10.29896 -7.45947,-3.45291 -22.63509,-4.33074 -27.70134,-1.60238 -3.7103,1.99812 -8.35199,8.4158 -10.88611,15.05132 -0.9778,2.56032 -2.13339,4.12975 -2.7907,3.79008 -2.1669,-1.11977 7.0179,6.7988 21.00573,18.10985 35.59529,28.78361 61.6094,55.96477 80.19656,83.79434 3.75272,5.61875 7.90394,12.16148 9.22494,14.53939 2.09519,3.77155 2.72409,4.24181 4.92636,3.68372 1.38851,-0.35188 5.24704,-0.88163 8.57452,-1.17724 5.49925,-0.48855 6.33817,-0.29497 9.216,2.12656 3.85075,3.24019 4.90115,7.80893 3.29012,14.31038 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.17499,-0.72619 -1.13871,-0.5284 1.09312,5.95853 7.43617,21.61358 10.61276,51.89607 8.02299,76.48313 -4.79872,45.55877 -23.94455,83.74596 -61.9559,123.57378 l -8.52382,8.93116 5,-2.83514 c 2.75,-1.55933 6.35,-3.56331 8,-4.4533 z m 49.04367,-72.41828 C 647.72206,595.86116 653.86164,586 659.42308,586 661.7151,586 662,586.39801 662,589.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07308,-8.108 28.14968,-18.60369 33.12543,-26.58752 l 2.01308,-3.23009 -3.31045,-6.26991 c -4.34399,-8.22743 -24.82039,-28.92056 -42.32806,-42.77608 -7.15,-5.6585 -16.21652,-13.14625 -20.14783,-16.63945 l -7.14782,-6.35128 -0.48517,48.24845 c -0.46454,46.19686 -1.29282,60.23918 -4.2472,72.00526 -0.67819,2.70095 -0.33029,2.58334 17.1679,-5.80411 C 418.46295,563.74419 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 417.7151,500 418,500.39801 418,503.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.28527,-58.55996 c 0.92064,-5.44926 -0.28028,-12.02086 -2.6644,-14.57991 -1.50077,-1.61089 -3.02381,-2.12413 -5.8147,-1.95946 l -3.78133,0.22312 4.83965,10.0631 c 2.66181,5.53471 4.85302,10.73811 4.86935,11.56311 0.0529,2.67321 1.82618,-1.01728 2.55143,-5.30996 z M 155.71291,449.97856 C 184.98001,447.79035 209.84251,446 210.96291,446 212.98457,446 213,445.62986 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -18.67586,-1.69347 -28.16069,-14.31599 -25.10946,-33.41595 2.93393,-18.36562 11.9257,-30.6913 25.5147,-34.97486 L 213,277.63476 l 0,-78.44519 0,-78.44519 3.75,0.56994 c 2.0625,0.31347 43.03554,4.93377 91.05119,10.26733 l 87.30119,9.69739 10.19881,-9.93447 C 410.91054,125.88061 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.28795 c -105.33213,0.28749 -105.51591,0.29153 -115.5,2.54238 -12.41737,2.79941 -15.119,3.61018 -24.5,7.35248 -12.44547,4.96481 -23.59239,11.02506 -32.33043,17.57713 -10.35588,7.76516 -26.9031,24.77669 -32.17578,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998425,9.20925 -2.073386,12.90717 -2.449274,120.82658 l -0.387755,111.32658 5.287009,-0.59802 c 2.90786,-0.3289 29.23282,-2.38836 58.49992,-4.57658 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 107.7151,380 108,380.39801 108,383.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.056329,2.05559 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.85894 2.95336,-15.61065 8.89807,-23.35486 6.05356,-7.886 11.25241,-10.74011 19.50921,-10.71035 9.79353,0.0353 18.41088,5.42102 20.2224,12.63871 2.7107,10.80028 -8.78564,30.99138 -20.88023,36.67209 -5.2085,2.44638 -12.45735,2.98822 -17.06565,1.27563 z m 13.80171,-3.03789 c 4.78709,-2.00017 11.56584,-15.34107 12.27329,-24.15442 0.93145,-11.60389 -4.51972,-17.83052 -15.01992,-17.15661 -4.89425,0.31412 -6.26948,0.86248 -9.1396,3.64431 -6.70478,6.49853 -11.63317,19.77157 -10.1926,27.4505 1.73139,9.22909 12.50752,14.21537 22.07883,10.21622 z m 18.47045,-19.81867 c 1.01482,-2.3385 2.12541,-6.05183 2.46798,-8.25183 1.06645,-6.84876 -3.57877,-13.26439 -11.17394,-15.4326 -3.4836,-0.99447 -4.62148,0.36253 -1.21151,1.44482 3.16694,1.00514 6.94972,7.59263 7.62264,13.27434 0.53361,4.50556 -0.23643,9.88625 -2.26615,15.83469 -1.13816,3.33557 2.5298,-2.18884 4.56098,-6.86942 z M 655.92392,441.25 c 0.0847,-4.73031 -2.45541,-8.25 -5.95386,-8.25 -2.01539,0 -2.01463,0.0207 0.10628,2.88938 1.49181,2.01779 2.30287,4.9589 2.68872,9.75 l 0.55251,6.86062 1.26514,-3.5 c 0.69582,-1.925 1.29937,-5.4125 1.34121,-7.75 z M 213,315 l 0,-29 -5.75,0.007 c -6.83856,0.008 -10.29165,1.93364 -14.37865,8.01903 -6.3888,9.51269 -9.75805,26.7276 -6.91629,35.33821 2.94023,8.90899 11.2787,14.35087 22.29494,14.55022 L 213,344 l 0,-29 z m 388.03612,19.47335 c 7.70089,-5.68154 11.74257,-16.13307 8.59359,-22.22252 -1.45394,-2.81162 -6.94409,-8.19655 -8.45644,-8.29438 -0.3703,-0.024 -2.58577,-0.41353 -4.92327,-0.86573 -4.95099,-0.95778 -5.60461,0.10554 -1.18912,1.9345 6.42185,2.66002 10.93097,12.57763 8.99214,19.77787 -0.56323,2.09169 -2.64064,5.69169 -4.61646,8 -4.06707,4.75144 -3.45004,5.39574 1.59956,1.67026 z M 568.4956,290.99289 c -2.10546,-3.40671 -19.26548,-6.79229 -20.91329,-4.12608 -0.4923,0.79657 1.17376,1.14934 5.60867,1.18757 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.63906,1.88859 4.80902,1.94562 0.16996,0.057 0.0289,-0.34951 -0.31342,-0.90342 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3460"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#836c2c"
+       d="m 459.28602,733.75 -8.05795,-17.25 -85.243,-0.25564 -85.24299,-0.25564 -9.51042,3.04646 c -26.64462,8.53503 -63.29517,10.10563 -91.66293,3.92807 -18.8597,-4.10702 -35.53772,-10.91176 -50.3103,-20.52692 C 84.344956,673.2031 56.82709,625.88522 47.587218,562 45.046497,544.43325 44.020254,524.02417 44.009889,490.85699 43.998902,455.70103 43.514353,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.546827,231.52324 67.547361,231.49763 69.826915,220 73.766717,200.12841 79.970437,183.96521 89.731255,168.14116 98.989548,153.13179 105.49104,144.79863 115.66301,134.90363 123.75187,127.03501 144.05676,111 145.9318,111 c 0.43401,0 2.53858,-1.18723 4.67684,-2.63828 C 158.92079,102.72093 181.07662,94.636247 200,90.338749 L 212.5,87.5 l 125,-0.5 125,-0.5 5,-3.147983 c 5.88937,-3.707925 39.1147,-22.257545 40.49769,-22.609757 0.52319,-0.133243 4.4733,5.60774 8.77801,12.75774 l 7.82676,13 12.94877,0.661881 c 7.12182,0.364034 18.12377,1.568513 24.44877,2.676618 13.39035,2.345917 35.91138,9.822465 43.92643,14.582731 16.94616,10.06459 23.16648,14.20471 29.45485,19.60459 8.30161,7.12867 24.73658,24.28114 28.72033,29.97418 7.2545,10.36718 17.82435,28.62898 17.87027,30.87495 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.73185,10.98185 8.26328,25.32922 10.61471,43.12505 1.22449,9.26706 1.16322,331.41424 -0.064,336.73278 -0.5372,2.32803 -1.44017,7.50046 -2.0066,11.4943 -1.34137,9.4579 -8.92215,32.0563 -13.79799,41.13198 -7.15927,13.32596 -9.54399,17.12718 -16.71336,26.64094 -8.13703,10.79784 -21.37404,23.79404 -33.61444,33.0029 -8.9915,6.76461 -35.59957,20.27446 -46.842,23.78333 -8.49335,2.65086 -28.76568,6.89177 -37,7.74029 -5.49524,0.56627 -8.20037,1.63921 -17.5,6.94108 -6.05,3.4492 -14.825,8.19488 -19.5,10.54596 C 499.22461,737.42673 468.99283,751 467.93874,751 c -0.32712,0 -4.22085,-7.7625 -8.65272,-17.25 z m 43.63094,-35.85773 C 548.71872,674.16771 584.31477,643.79176 603.85868,611.75348 629.24422,570.13905 634.68092,522.99227 619.39769,477 605.68316,435.72847 574.69264,396.49572 522.7961,354.70628 510.09646,344.47996 498.47792,333.43783 491,324.48765 c -6.48861,-7.7661 -11.67117,-21.88894 -10.5668,-28.79529 2.92077,-18.26544 30.07029,-43.37147 75.8168,-70.11018 5.3625,-3.13437 9.75,-5.89517 9.75,-6.13512 C 566,218.04442 497.2585,106 496.39795,106 c -0.17539,0 -4.04918,2.04884 -8.60842,4.55299 -25.72632,14.13007 -62.47266,45.16278 -83.41745,70.44701 -14.62315,17.65284 -31.29711,45.73319 -37.40905,63 -1.26545,3.575 -2.66606,6.98556 -3.11247,7.57903 -1.46734,1.9507 -5.68286,21.71333 -6.91563,32.42097 -1.56797,13.61915 -0.69899,33.56812 2.04735,47 3.59714,17.59305 13.61501,40.50972 25.35432,58 16.00234,23.84171 28.94468,37.27717 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.70156,11.58151 -20.28795,25.44415 -38.31168,36.41072 -6.90334,4.20035 -26.21194,14.49764 -28.6934,15.30221 -1.02599,0.33266 3.59073,11.06424 17.38176,40.40396 C 473.3675,685.35845 483.88458,707 484.69351,707 c 0.35223,0 8.55278,-4.09848 18.22345,-9.10773 z m -273.10435,-5.97138 c 8.07806,-0.59351 18.47269,-1.95642 23.09916,-3.02869 50.47806,-11.69922 90.12572,-54.11007 104.60211,-111.8922 5.56522,-22.21344 5.79048,-25.63636 6.22445,-94.58326 l 0.40335,-64.08325 -6.3833,-9.41675 c -22.71772,-33.51351 -33.78557,-69.11986 -33.74006,-108.54508 0.0455,-39.40947 10.5586,-73.64761 34.13692,-111.17396 4.85595,-7.72854 5.84476,-10.05475 5.84476,-13.75 0,-2.89124 -0.43743,-4.44787 -1.25,-4.44818 -0.6875,-2.6e-4 -26.54094,-2.92526 -57.45209,-6.5 C 274.38677,160.92478 248.63428,158 248.07017,158 c -0.69628,0 -1.12059,61.57749 -1.32127,191.75 l -0.29562,191.75 -2.2563,8.43754 c -4.4532,16.65292 -13.29072,29.67136 -21.69698,31.96155 -9.82618,2.67703 -16.86956,0.89915 -21.39332,-5.40007 -8.68595,-12.09497 -12.41768,-32.15047 -13.73415,-73.81165 l -0.68927,-21.81264 -6.09163,0.59992 c -3.3504,0.32995 -24.31663,1.98324 -46.59163,3.67398 -22.275,1.69074 -44.175006,3.36147 -48.66668,3.71274 -4.491674,0.35126 -8.451202,0.92318 -8.798951,1.27093 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 2.79118,4.13661 9.02273,11.60217 13.8479,16.59013 21.88258,22.62087 47.88835,34.73113 80.32133,37.4037 4.95436,0.40825 9.3736,0.8064 9.82054,0.88478 0.44693,0.0784 7.42193,-0.3431 15.5,-0.93661 z m 136.90061,-6.82063 c 8.61493,-7.77529 15.89623,-11.41693 23.83887,-11.92268 5.72661,-0.36464 6.42096,-0.17331 9.56148,2.63469 3.1561,2.82193 3.38404,3.44142 3.35136,9.10781 l -0.0351,6.07992 17.74325,0 17.74324,0 -2.84069,-6.25 c -4.90028,-10.78144 -42.67124,-91.05863 -44.74082,-95.09071 l -1.97135,-3.84071 -2.27281,8.34071 c -8.01104,29.39876 -24.09474,58.77764 -42.73229,78.05588 -3.37789,3.49401 -9.13186,9.14996 -12.78659,12.56878 L 324.92683,691 l 17.62477,0 17.62478,0 6.53684,-5.89974 z M 394,689.625 C 394,683.26218 390.57236,678 386.4278,678 c -3.74801,0 -11.42826,4.3108 -15.88075,8.9136 L 366.5941,691 l 13.70295,0 C 391.25713,691 394,690.72477 394,689.625 z m 5.80264,-3.90053 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.07387 c 13.72295,-7.40197 31.34031,-23.37051 42.26694,-38.31116 3.6403,-4.97759 5.61919,-8.23441 12.42104,-20.44222 4.1459,-7.44096 9.60424,-25.00172 11.8642,-38.16986 1.87508,-10.92552 1.9476,-17.31176 1.94203,-171 -0.004,-106.72721 -0.35296,-161.6396 -1.05308,-165.65063 -0.576,-3.3 -1.64899,-9.6 -2.38441,-14 -3.02262,-18.0841 -12.25763,-38.72903 -25.05026,-56 -9.09572,-12.27988 -28.50772,-29.69811 -40.04789,-35.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.52529,-1.87985 -16,-2.2773 -16,-1.83014 0,0.20377 16.02611,26.78833 35.61357,59.07681 19.58747,32.28848 35.78524,58.99726 35.99505,59.35283 0.20982,0.35558 -8.37369,5.47334 -19.07446,11.37281 -39.99695,22.05084 -69.78136,43.05444 -76.52348,53.96342 -1.92532,3.11522 -1.9843,3.66761 -0.6642,6.2204 1.87803,3.6317 5.32019,6.84149 5.32019,4.96104 0,-3.18019 5.12069,-11.55585 9.98062,-16.32481 7.1,-6.96709 14.2651,-9.69945 23.85271,-9.09607 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 9.33711,5.48878 12.16577,14.41168 7.79186,24.5791 -2.81177,6.53615 -11.12179,14.34707 -17.61915,16.56094 -6.36336,2.16822 -14.95344,2.00842 -19.35736,-0.3601 l -3.5,-1.88237 -3.20902,3.08074 c -2.58409,2.48077 -3.4887,2.84863 -4.6451,1.8889 -1.20653,-1.00133 -0.6936,-1.97482 3.20903,-6.09039 4.5371,-4.78468 4.69159,-4.85651 6.64509,-3.08959 3.03105,2.74155 6.05371,4.05891 9.31313,4.05891 2.34867,0 4.27406,-1.40928 9.51357,-6.96344 7.70668,-8.16949 8.85981,-11.64121 6.18925,-18.63396 -2.89599,-7.58306 -13.60342,-12.54098 -19.18541,-8.88352 -1.37724,0.9024 -2.62958,1.49227 -2.78299,1.31082 -0.1534,-0.18144 -1.05979,-2.00509 -2.01419,-4.05253 -3.54865,-7.61283 -15.27255,-12.78196 -28.96486,-12.77078 -11.26735,0.009 -15.58863,3.26528 -20.70004,15.59748 -1.24461,3.00284 -2.67126,5.06716 -3.28442,4.75246 -2.12005,-1.08807 7.12139,6.87527 21.04354,18.13322 35.59529,28.78361 61.6094,55.96477 80.19656,83.79434 3.75272,5.61875 7.90394,12.16148 9.22494,14.53939 2.09519,3.77155 2.72409,4.24181 4.92636,3.68372 1.38851,-0.35188 5.24704,-0.88163 8.57452,-1.17724 5.49925,-0.48855 6.33817,-0.29497 9.216,2.12656 3.85075,3.24019 4.90115,7.80893 3.29012,14.31038 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.17499,-0.72619 -1.13871,-0.5284 1.09312,5.95853 7.43617,21.61358 10.61276,51.89607 8.02299,76.48313 -4.79872,45.55877 -23.94455,83.74596 -61.9559,123.57378 l -8.52382,8.93116 5,-2.83514 c 2.75,-1.55933 6.35,-3.56331 8,-4.4533 z m 49.04367,-72.41828 C 647.72206,595.86116 653.86164,586 659.42308,586 661.7151,586 662,586.39801 662,589.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07308,-8.108 28.14968,-18.60369 33.12543,-26.58752 l 2.01308,-3.23009 -3.31045,-6.26991 c -4.34399,-8.22743 -24.82039,-28.92056 -42.32806,-42.77608 -7.15,-5.6585 -16.21652,-13.14625 -20.14783,-16.63945 l -7.14782,-6.35128 -0.48517,48.24845 c -0.46454,46.19686 -1.29282,60.23918 -4.2472,72.00526 -0.67819,2.70095 -0.33029,2.58334 17.1679,-5.80411 C 418.46295,563.74419 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 417.7151,500 418,500.39801 418,503.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.23039,-58.23174 c 1.49474,-10.86806 -1.69978,-17.26436 -8.42422,-16.86759 l -3.78133,0.22312 4.83965,10.0631 c 2.66181,5.53471 4.84613,10.65217 4.85403,11.37213 0.0356,3.23967 1.89521,-0.3071 2.51187,-4.79076 z m -493.78458,-1.0397 C 184.98001,447.79035 209.84251,446 210.96291,446 212.98457,446 213,445.62986 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -18.67586,-1.69347 -28.16069,-14.31599 -25.10946,-33.41595 2.93393,-18.36562 11.9257,-30.6913 25.5147,-34.97486 L 213,277.63476 l 0,-78.44519 0,-78.44519 3.75,0.56994 c 2.0625,0.31347 43.03554,4.93377 91.05119,10.26733 l 87.30119,9.69739 10.19881,-9.93447 C 410.91054,125.88061 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.28795 c -105.33213,0.28749 -105.51591,0.29153 -115.5,2.54238 -12.41737,2.79941 -15.119,3.61018 -24.5,7.35248 -12.44547,4.96481 -23.59239,11.02506 -32.33043,17.57713 -10.35588,7.76516 -26.9031,24.77669 -32.17578,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998425,9.20925 -2.073386,12.90717 -2.449274,120.82658 l -0.387755,111.32658 5.287009,-0.59802 c 2.90786,-0.3289 29.23282,-2.38836 58.49992,-4.57658 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 107.7151,380 108,380.39801 108,383.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.056329,2.05559 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.85894 2.95336,-15.61065 8.89807,-23.35486 6.05356,-7.886 11.25241,-10.74011 19.50921,-10.71035 9.79353,0.0353 18.41088,5.42102 20.2224,12.63871 2.7107,10.80028 -8.78564,30.99138 -20.88023,36.67209 -5.2085,2.44638 -12.45735,2.98822 -17.06565,1.27563 z m 14.23882,-3.35994 c 4.80475,-2.45451 11.13766,-15.13035 11.82266,-23.66401 0.95414,-11.88654 -4.34895,-18.00898 -15.0064,-17.32497 -4.95604,0.31809 -6.25687,0.84984 -9.30859,3.80514 -1.9511,1.88947 -4.95005,6.28278 -6.66432,9.76293 -3.99438,8.10897 -4.52686,18.2881 -1.19489,22.84191 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54018,-0.7868 7.42262,-1.74844 z m 18.03334,-19.49662 c 1.01482,-2.3385 2.12541,-6.05183 2.46798,-8.25183 1.06645,-6.84876 -3.57877,-13.26439 -11.17394,-15.4326 -3.4836,-0.99447 -4.62148,0.36253 -1.21151,1.44482 3.16694,1.00514 6.94972,7.59263 7.62264,13.27434 0.53361,4.50556 -0.23643,9.88625 -2.26615,15.83469 -1.13816,3.33557 2.5298,-2.18884 4.56098,-6.86942 z M 655.92392,441.25 c 0.0847,-4.73031 -2.45541,-8.25 -5.95386,-8.25 -2.01539,0 -2.01463,0.0207 0.10628,2.88938 1.49181,2.01779 2.30287,4.9589 2.68872,9.75 l 0.55251,6.86062 1.26514,-3.5 c 0.69582,-1.925 1.29937,-5.4125 1.34121,-7.75 z M 213,315 l 0,-29 -5.75,0.007 c -6.83856,0.008 -10.29165,1.93364 -14.37865,8.01903 -6.3888,9.51269 -9.75805,26.7276 -6.91629,35.33821 2.94023,8.90899 11.2787,14.35087 22.29494,14.55022 L 213,344 l 0,-29 z m 388.03612,19.47335 c 7.70089,-5.68154 11.74257,-16.13307 8.59359,-22.22252 -1.45394,-2.81162 -6.94409,-8.19655 -8.45644,-8.29438 -0.3703,-0.024 -2.58577,-0.41353 -4.92327,-0.86573 -4.95099,-0.95778 -5.60461,0.10554 -1.18912,1.9345 6.42185,2.66002 10.93097,12.57763 8.99214,19.77787 -0.56323,2.09169 -2.64064,5.69169 -4.61646,8 -4.06707,4.75144 -3.45004,5.39574 1.59956,1.67026 z M 568.4956,290.99289 c -2.10546,-3.40671 -19.26548,-6.79229 -20.91329,-4.12608 -0.4923,0.79657 1.17376,1.14934 5.60867,1.18757 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.63906,1.88859 4.80902,1.94562 0.16996,0.057 0.0289,-0.34951 -0.31342,-0.90342 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3458"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#5b5b5b"
+       d="m 459.28602,733.75 -8.05795,-17.25 -85.243,-0.25564 -85.24299,-0.25564 -9.51042,3.04646 c -26.64462,8.53503 -63.29517,10.10563 -91.66293,3.92807 -18.8597,-4.10702 -35.53772,-10.91176 -50.3103,-20.52692 C 84.344956,673.2031 56.82709,625.88522 47.587218,562 45.046497,544.43325 44.020254,524.02417 44.009889,490.85699 43.998902,455.70103 43.514353,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.546827,231.52324 67.547361,231.49763 69.826915,220 73.766717,200.12841 79.970437,183.96521 89.731255,168.14116 98.989548,153.13179 105.49104,144.79863 115.66301,134.90363 123.75187,127.03501 144.05676,111 145.9318,111 c 0.43401,0 2.53858,-1.18723 4.67684,-2.63828 C 158.92079,102.72093 181.07662,94.636247 200,90.338749 L 212.5,87.5 l 125,-0.5 125,-0.5 5,-3.147983 c 5.88937,-3.707925 39.1147,-22.257545 40.49769,-22.609757 0.52319,-0.133243 4.4733,5.60774 8.77801,12.75774 l 7.82676,13 12.94877,0.661881 c 7.12182,0.364034 18.12377,1.568513 24.44877,2.676618 13.39035,2.345917 35.91138,9.822465 43.92643,14.582731 16.94616,10.06459 23.16648,14.20471 29.45485,19.60459 8.30161,7.12867 24.73658,24.28114 28.72033,29.97418 7.2545,10.36718 17.82435,28.62898 17.87027,30.87495 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.73185,10.98185 8.26328,25.32922 10.61471,43.12505 1.22449,9.26706 1.16322,331.41424 -0.064,336.73278 -0.5372,2.32803 -1.44017,7.50046 -2.0066,11.4943 -1.34137,9.4579 -8.92215,32.0563 -13.79799,41.13198 -7.15927,13.32596 -9.54399,17.12718 -16.71336,26.64094 -8.13703,10.79784 -21.37404,23.79404 -33.61444,33.0029 -8.9915,6.76461 -35.59957,20.27446 -46.842,23.78333 -8.49335,2.65086 -28.76568,6.89177 -37,7.74029 -5.49524,0.56627 -8.20037,1.63921 -17.5,6.94108 -6.05,3.4492 -14.825,8.19488 -19.5,10.54596 C 499.22461,737.42673 468.99283,751 467.93874,751 c -0.32712,0 -4.22085,-7.7625 -8.65272,-17.25 z m 43.63094,-35.85429 C 570.61993,662.83992 611.37606,617.53254 623.81226,563.5 634.0391,519.06665 624.87291,473.97339 597.18365,432.5 578.56066,404.60619 557.79204,382.88659 522.7961,354.70628 510.09646,344.47996 498.47792,333.43783 491,324.48765 484.45352,316.65229 479.43604,302.69672 480.57799,295.5 483.46321,277.31708 510.53909,252.30009 556.25,225.58218 561.6125,222.44781 566,219.67015 566,219.4096 566,217.85638 497.32186,106 496.36821,106 c -1.1107,0 -15.54613,8.49877 -23.86821,14.05226 -25.11492,16.75968 -50.7508,39.97347 -70.61995,63.94774 -12.18036,14.69691 -29.28483,44.08856 -34.91702,60 -1.26545,3.575 -2.66606,6.98556 -3.11247,7.57903 -1.46734,1.9507 -5.68286,21.71333 -6.91563,32.42097 -1.56797,13.61915 -0.69899,33.56812 2.04735,47 3.59714,17.59305 13.61501,40.50972 25.35432,58 16.07933,23.95642 28.79688,37.15853 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.73709,11.65368 -20.27354,25.43376 -38.58702,36.57925 -6.518,3.96682 -26.06249,14.33578 -28.64272,15.19586 C 430.32641,594.72453 482.90089,707 484.69499,707 c 0.35141,0 8.5513,-4.09693 18.22197,-9.10429 z m -262.32414,-6.9436 C 294.69993,685.44285 342.38602,639.14362 357.4433,577.5 c 5.675,-23.23311 5.86042,-26.03377 6.29503,-95.08326 l 0.40335,-64.08325 -6.3833,-9.41675 c -22.71772,-33.51351 -33.78557,-69.11986 -33.74006,-108.54508 0.0455,-39.40947 10.5586,-73.64761 34.13692,-111.17396 4.85595,-7.72854 5.84476,-10.05475 5.84476,-13.75 0,-2.89124 -0.43743,-4.44787 -1.25,-4.44818 -0.6875,-2.6e-4 -26.54094,-2.92526 -57.45209,-6.5 C 274.38677,160.92478 248.63428,158 248.07017,158 c -0.69628,0 -1.12059,61.57749 -1.32127,191.75 l -0.29562,191.75 -2.20683,8.23042 c -4.48667,16.73308 -13.38056,29.88948 -21.74645,32.16867 -9.82618,2.67703 -16.86956,0.89915 -21.39332,-5.40007 -8.68823,-12.09815 -12.38806,-32.0017 -13.72077,-73.81205 l -0.69529,-21.81303 -6.09531,0.58652 c -3.35242,0.32258 -24.32031,1.9739 -46.59531,3.6696 -57.933221,4.41021 -56.77257,4.30918 -57.465631,5.00224 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 126.1204,-5.85185 c 8.61493,-7.77529 15.89623,-11.41693 23.83887,-11.92268 5.72661,-0.36464 6.42096,-0.17331 9.56148,2.63469 3.1561,2.82193 3.38404,3.44142 3.35136,9.10781 l -0.0351,6.07992 17.84409,0 c 9.81425,0 17.6617,-0.3375 17.43878,-0.75 -0.22292,-0.4125 -11.36388,-24.10678 -24.7577,-52.65395 -19.67772,-41.94047 -24.48579,-51.44248 -25.04731,-49.5 -11.77132,40.7213 -24.44458,63.46931 -49.39045,88.65395 l -14.1149,14.25 17.387,0 17.38701,0 6.53684,-5.89974 z M 394,689.625 C 394,683.26218 390.57236,678 386.4278,678 c -3.74801,0 -11.42826,4.3108 -15.88075,8.9136 L 366.5941,691 l 13.70295,0 C 391.25713,691 394,690.72477 394,689.625 z m 5.80264,-3.90053 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.53751,-13.25545 8.85554,-16.09652 12.14519,-26.17951 7.28721,-22.33579 6.81613,-9.82319 7.14648,-189.82049 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.52952,-9.65 -2.09267,-13.5 -1.38805,-9.48955 -9.17848,-31.42551 -14.20577,-40 -13.01575,-22.19951 -33.47697,-43.34481 -51.22214,-52.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.63431,-1.89621 -16,-2.27727 -16,-1.81149 0,0.21402 16.02483,26.79858 35.61073,59.07681 19.5859,32.27822 35.78768,58.9851 36.00397,59.34861 0.21628,0.36351 -6.02105,4.15355 -13.86073,8.42232 -45.65095,24.8573 -77.82068,47.69002 -82.90069,58.83941 -0.90683,1.99028 -0.73391,2.93624 0.97559,5.33701 2.86386,4.02192 4.8378,5.60688 4.8378,3.88447 0,-3.16194 5.13371,-11.54859 9.98062,-16.30478 7.1,-6.96709 14.2651,-9.69945 23.85271,-9.09607 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 9.33711,5.48878 12.16577,14.41168 7.79186,24.5791 -2.81177,6.53615 -11.12179,14.34707 -17.61915,16.56094 -6.36336,2.16822 -14.95344,2.00842 -19.35736,-0.3601 l -3.5,-1.88237 -3.20902,3.08074 c -2.58409,2.48077 -3.4887,2.84863 -4.6451,1.8889 -1.20653,-1.00133 -0.6936,-1.97482 3.20903,-6.09039 4.5371,-4.78468 4.69159,-4.85651 6.64509,-3.08959 3.03105,2.74155 6.05371,4.05891 9.31313,4.05891 2.34867,0 4.27406,-1.40928 9.51357,-6.96344 7.70668,-8.16949 8.85981,-11.64121 6.18925,-18.63396 -2.89599,-7.58306 -13.60342,-12.54098 -19.18541,-8.88352 -1.37724,0.9024 -2.62958,1.49227 -2.78299,1.31082 -0.1534,-0.18144 -1.05979,-2.00509 -2.01419,-4.05253 -3.54865,-7.61283 -15.27255,-12.78196 -28.96486,-12.77078 -11.26735,0.009 -15.58863,3.26528 -20.70004,15.59748 -1.22404,2.95321 -2.68139,5.07414 -3.28442,4.77991 -2.0167,-0.98396 6.85415,6.71279 18.81132,16.32156 42.473,34.13126 73.78784,68.37995 91.75974,100.35663 1.98726,3.53585 2.63505,3.99882 4.82034,3.44503 1.38851,-0.35188 5.24704,-0.88163 8.57452,-1.17724 5.49925,-0.48855 6.33817,-0.29497 9.216,2.12656 3.85075,3.24019 4.90115,7.80893 3.29012,14.31038 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.17499,-0.72619 -1.13871,-0.5284 1.09312,5.95853 7.47183,21.71726 10.64064,52.04027 7.98551,76.41517 -4.97114,45.63653 -23.57759,83.1845 -60.53455,122.15922 -9.76624,10.29945 -9.8363,10.4079 -4.90769,7.59601 2.75,-1.56893 6.35,-3.58693 8,-4.48442 z m 49.04367,-72.40463 C 647.72206,595.86116 653.86164,586 659.42308,586 661.7151,586 662,586.39801 662,589.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07632,-8.10974 29.88607,-20.06565 33.61679,-27.13882 1.37579,-2.6084 1.2642,-3.16815 -1.7943,-9 -4.26345,-8.12944 -24.70814,-28.76424 -42.32249,-42.71604 -7.15,-5.6633 -16.21895,-13.15716 -20.15323,-16.65303 l -7.15322,-6.35611 -0.48374,47.75328 c -0.46064,45.47274 -1.3747,61.1013 -4.24169,72.52429 -0.67297,2.68132 -0.28915,2.55127 17.17176,-5.8183 C 418.46295,563.74419 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 417.7151,500 418,500.39801 418,503.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.23039,-58.23174 c 1.49474,-10.86806 -1.69978,-17.26436 -8.42422,-16.86759 l -3.78133,0.22312 4.83965,10.0631 c 2.66181,5.53471 4.84613,10.65217 4.85403,11.37213 0.0356,3.23967 1.89521,-0.3071 2.51187,-4.79076 z M 156.37784,449.95438 C 185.46065,447.77947 210.09815,446 211.12784,446 212.93184,446 213,444.22122 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -18.67586,-1.69347 -28.16069,-14.31599 -25.10946,-33.41595 2.93393,-18.36562 11.9257,-30.6913 25.5147,-34.97486 L 213,277.63476 l 0,-78.44822 0,-78.44822 3.25,0.52561 c 1.7875,0.28909 42.76307,4.90826 91.05682,10.26483 l 87.80682,9.7392 10.19318,-9.92893 C 410.91307,125.87811 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.29106 -105.5,0.29106 -10.5,2.28866 c -11.35512,2.47505 -12.71557,2.8907 -24,7.33244 -12.32857,4.85275 -23.60829,10.9727 -32.35883,17.55672 -10.35935,7.79449 -26.89589,24.81007 -32.14738,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.59946 c 3.182846,-0.3297 29.582016,-2.37893 58.664826,-4.55384 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 107.7151,380 108,380.39801 108,383.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.056329,2.05559 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.85894 2.95336,-15.61065 8.89807,-23.35486 6.05356,-7.886 11.25241,-10.74011 19.50921,-10.71035 9.79353,0.0353 18.41088,5.42102 20.2224,12.63871 2.7107,10.80028 -8.78564,30.99138 -20.88023,36.67209 -5.2085,2.44638 -12.45735,2.98822 -17.06565,1.27563 z m 14.23882,-3.35994 c 4.80475,-2.45451 11.13766,-15.13035 11.82266,-23.66401 0.95414,-11.88654 -4.34895,-18.00898 -15.0064,-17.32497 -4.95604,0.31809 -6.25687,0.84984 -9.30859,3.80514 -1.9511,1.88947 -4.95005,6.28278 -6.66432,9.76293 -3.99438,8.10897 -4.52686,18.2881 -1.19489,22.84191 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54018,-0.7868 7.42262,-1.74844 z m 18.03334,-19.49662 c 1.01482,-2.3385 2.12541,-6.05183 2.46798,-8.25183 1.06645,-6.84876 -3.57877,-13.26439 -11.17394,-15.4326 -3.4836,-0.99447 -4.62148,0.36253 -1.21151,1.44482 3.16694,1.00514 6.94972,7.59263 7.62264,13.27434 0.53361,4.50556 -0.23643,9.88625 -2.26615,15.83469 -1.13816,3.33557 2.5298,-2.18884 4.56098,-6.86942 z M 655.92392,441.25 c 0.0847,-4.73031 -2.45541,-8.25 -5.95386,-8.25 -2.01539,0 -2.01463,0.0207 0.10628,2.88938 1.49181,2.01779 2.30287,4.9589 2.68872,9.75 l 0.55251,6.86062 1.26514,-3.5 c 0.69582,-1.925 1.29937,-5.4125 1.34121,-7.75 z M 213,315 l 0,-29 -5.75,0.007 c -6.83856,0.008 -10.29165,1.93364 -14.37865,8.01903 -6.3888,9.51269 -9.75805,26.7276 -6.91629,35.33821 2.94023,8.90899 11.2787,14.35087 22.29494,14.55022 L 213,344 l 0,-29 z m 388.03612,19.47335 c 7.70089,-5.68154 11.74257,-16.13307 8.59359,-22.22252 -1.45394,-2.81162 -6.94409,-8.19655 -8.45644,-8.29438 -0.3703,-0.024 -2.58577,-0.41353 -4.92327,-0.86573 -4.95099,-0.95778 -5.60461,0.10554 -1.18912,1.9345 6.42185,2.66002 10.93097,12.57763 8.99214,19.77787 -0.56323,2.09169 -2.64064,5.69169 -4.61646,8 -4.06707,4.75144 -3.45004,5.39574 1.59956,1.67026 z M 568.4956,290.99289 c -2.10546,-3.40671 -19.26548,-6.79229 -20.91329,-4.12608 -0.4923,0.79657 1.17376,1.14934 5.60867,1.18757 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.63906,1.88859 4.80902,1.94562 0.16996,0.057 0.0289,-0.34951 -0.31342,-0.90342 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3456"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#7a6234"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.59573,-35.86844 c 67.70297,-35.05579 108.4591,-80.36317 120.8953,-134.39571 10.22684,-44.43335 1.06065,-89.52661 -26.62861,-131 -18.63783,-27.91603 -39.47557,-49.7024 -74.40785,-77.79522 -29.62682,-23.82613 -42.25571,-40.83404 -42.13943,-56.75111 0.13264,-18.15563 27.23072,-44.09181 75.61363,-72.37149 5.3625,-3.13437 9.75,-5.91203 9.75,-6.17258 C 566,217.85638 497.32186,106 496.36821,106 c -1.1107,0 -15.54613,8.49877 -23.86821,14.05226 -25.11492,16.75968 -50.7508,39.97347 -70.61995,63.94774 -12.18036,14.69691 -29.28483,44.08856 -34.91702,60 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 3.60858,17.60787 13.62555,40.51795 25.35934,58 16.07933,23.95642 28.79688,37.15853 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.73709,11.65368 -20.27354,25.43376 -38.58702,36.57925 -6.518,3.96682 -26.06249,14.33578 -28.64272,15.19586 C 430.32641,594.72453 482.90089,707 484.69499,707 c 0.35141,0 8.5513,-4.09693 18.22197,-9.10429 z m -262.32414,-6.9436 C 294.69993,685.44285 342.38602,639.14362 357.4433,577.5 c 5.67605,-23.23741 5.86038,-26.02434 6.29537,-95.18053 l 0.40369,-64.18054 -5.44235,-7.81946 C 343.41329,388.35581 333.01869,364.14635 327.28379,337.14983 324.81474,325.527 324.59266,322.59211 324.54829,301 c -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 3.56055,-5.40926 4.35277,-7.45681 4.35277,-11.25 0,-3.04281 -0.42978,-4.63734 -1.25,-4.63765 -0.6875,-2.6e-4 -26.54094,-2.92526 -57.45209,-6.5 C 274.38677,160.92478 248.63428,158 248.07017,158 c -0.69628,0 -1.12059,61.57749 -1.32127,191.75 l -0.29562,191.75 -2.20683,8.23042 c -4.48667,16.73308 -13.38056,29.88948 -21.74645,32.16867 -9.82618,2.67703 -16.86956,0.89915 -21.39332,-5.40007 -8.68823,-12.09815 -12.38806,-32.0017 -13.72077,-73.81205 l -0.69529,-21.81303 -6.09531,0.58652 c -3.35242,0.32258 -24.32031,1.9739 -46.59531,3.6696 -57.933221,4.41021 -56.77257,4.30918 -57.465631,5.00224 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 126.1204,-5.85185 c 8.61493,-7.77529 15.89623,-11.41693 23.83887,-11.92268 5.72661,-0.36464 6.42096,-0.17331 9.56148,2.63469 3.1561,2.82193 3.38404,3.44142 3.35136,9.10781 l -0.0351,6.07992 17.84409,0 c 9.81425,0 17.6617,-0.3375 17.43878,-0.75 -0.22292,-0.4125 -11.36388,-24.10678 -24.7577,-52.65395 -19.67772,-41.94047 -24.48579,-51.44248 -25.04731,-49.5 -11.77132,40.7213 -24.44458,63.46931 -49.39045,88.65395 l -14.1149,14.25 17.387,0 17.38701,0 6.53684,-5.89974 z M 394,689.625 C 394,683.26218 390.57236,678 386.4278,678 c -3.74801,0 -11.42826,4.3108 -15.88075,8.9136 L 366.5941,691 l 13.70295,0 C 391.25713,691 394,690.72477 394,689.625 z m 5.80264,-3.90053 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.53751,-13.25545 8.85554,-16.09652 12.14519,-26.17951 7.28721,-22.33579 6.81613,-9.82319 7.14648,-189.82049 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.52952,-9.65 -2.09267,-13.5 -1.38805,-9.48955 -9.17848,-31.42551 -14.20577,-40 -13.01575,-22.19951 -33.47697,-43.34481 -51.22214,-52.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.63431,-1.89621 -16,-2.27727 -16,-1.81149 0,0.21402 16.02483,26.79858 35.61073,59.07681 19.5859,32.27822 35.78768,58.9851 36.00397,59.34861 0.21628,0.36351 -6.02105,4.15355 -13.86073,8.42232 -45.65095,24.8573 -77.82068,47.69002 -82.90069,58.83941 -0.90683,1.99028 -0.73391,2.93624 0.97559,5.33701 2.86386,4.02192 4.8378,5.60688 4.8378,3.88447 0,-3.16194 5.13371,-11.54859 9.98062,-16.30478 7.1,-6.96709 14.2651,-9.69945 23.85271,-9.09607 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 9.33711,5.48878 12.16577,14.41168 7.79186,24.5791 -2.81177,6.53615 -11.12179,14.34707 -17.61915,16.56094 -6.36336,2.16822 -14.95344,2.00842 -19.35736,-0.3601 l -3.5,-1.88237 -3.20902,3.08074 c -2.58409,2.48077 -3.4887,2.84863 -4.6451,1.8889 -1.20653,-1.00133 -0.6936,-1.97482 3.20903,-6.09039 4.5371,-4.78468 4.69159,-4.85651 6.64509,-3.08959 3.03105,2.74155 6.05371,4.05891 9.31313,4.05891 2.34867,0 4.27406,-1.40928 9.51357,-6.96344 7.70668,-8.16949 8.85981,-11.64121 6.18925,-18.63396 -2.89599,-7.58306 -13.60342,-12.54098 -19.18541,-8.88352 -1.37724,0.9024 -2.62958,1.49227 -2.78299,1.31082 -0.1534,-0.18144 -1.05979,-2.00509 -2.01419,-4.05253 -3.54865,-7.61283 -15.27255,-12.78196 -28.96486,-12.77078 -11.26735,0.009 -15.58863,3.26528 -20.70004,15.59748 -1.22404,2.95321 -2.68139,5.07414 -3.28442,4.77991 -2.0167,-0.98396 6.85415,6.71279 18.81132,16.32156 42.473,34.13126 73.78784,68.37995 91.75974,100.35663 1.98726,3.53585 2.63505,3.99882 4.82034,3.44503 1.38851,-0.35188 5.24704,-0.88163 8.57452,-1.17724 5.49925,-0.48855 6.33817,-0.29497 9.216,2.12656 3.85075,3.24019 4.90115,7.80893 3.29012,14.31038 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.17499,-0.72619 -1.13871,-0.5284 1.09312,5.95853 7.47183,21.71726 10.64064,52.04027 7.98551,76.41517 -4.97114,45.63653 -23.57759,83.1845 -60.53455,122.15922 -9.76624,10.29945 -9.8363,10.4079 -4.90769,7.59601 2.75,-1.56893 6.35,-3.58693 8,-4.48442 z m 49.04367,-72.40463 C 647.72206,595.86116 653.86164,586 659.42308,586 661.7151,586 662,586.39801 662,589.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07632,-8.10974 29.88607,-20.06565 33.61679,-27.13882 1.37579,-2.6084 1.2642,-3.16815 -1.7943,-9 -4.26345,-8.12944 -24.70814,-28.76424 -42.32249,-42.71604 -7.15,-5.6633 -16.21895,-13.15716 -20.15323,-16.65303 l -7.15322,-6.35611 -0.48374,47.75328 c -0.46064,45.47274 -1.3747,61.1013 -4.24169,72.52429 -0.67297,2.68132 -0.28915,2.55127 17.17176,-5.8183 C 418.46295,563.74419 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 417.7151,500 418,500.39801 418,503.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.23039,-58.23174 c 1.49474,-10.86806 -1.69978,-17.26436 -8.42422,-16.86759 l -3.78133,0.22312 4.83965,10.0631 c 2.66181,5.53471 4.84613,10.65217 4.85403,11.37213 0.0356,3.23967 1.89521,-0.3071 2.51187,-4.79076 z M 156.37784,449.95438 C 185.46065,447.77947 210.09815,446 211.12784,446 212.93184,446 213,444.22122 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -18.67586,-1.69347 -28.16069,-14.31599 -25.10946,-33.41595 2.93393,-18.36562 11.9257,-30.6913 25.5147,-34.97486 L 213,277.63476 l 0,-78.44822 0,-78.44822 3.25,0.52561 c 1.7875,0.28909 42.76307,4.90826 91.05682,10.26483 l 87.80682,9.7392 10.19318,-9.92893 C 410.91307,125.87811 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.29106 -105.5,0.29106 -10.5,2.28866 c -11.35512,2.47505 -12.71557,2.8907 -24,7.33244 -12.32857,4.85275 -23.60829,10.9727 -32.35883,17.55672 -10.35935,7.79449 -26.89589,24.81007 -32.14738,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.59946 c 3.182846,-0.3297 29.582016,-2.37893 58.664826,-4.55384 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 107.7151,380 108,380.39801 108,383.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.056329,2.05559 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.85894 2.95336,-15.61065 8.89807,-23.35486 6.05356,-7.886 11.25241,-10.74011 19.50921,-10.71035 9.79353,0.0353 18.41088,5.42102 20.2224,12.63871 2.7107,10.80028 -8.78564,30.99138 -20.88023,36.67209 -5.2085,2.44638 -12.45735,2.98822 -17.06565,1.27563 z m 14.23882,-3.35994 c 4.80475,-2.45451 11.13766,-15.13035 11.82266,-23.66401 0.95414,-11.88654 -4.34895,-18.00898 -15.0064,-17.32497 -4.95604,0.31809 -6.25687,0.84984 -9.30859,3.80514 -1.9511,1.88947 -4.95005,6.28278 -6.66432,9.76293 -3.99438,8.10897 -4.52686,18.2881 -1.19489,22.84191 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54018,-0.7868 7.42262,-1.74844 z m 18.03334,-19.49662 c 1.01482,-2.3385 2.12541,-6.05183 2.46798,-8.25183 1.06645,-6.84876 -3.57877,-13.26439 -11.17394,-15.4326 -3.4836,-0.99447 -4.62148,0.36253 -1.21151,1.44482 3.16694,1.00514 6.94972,7.59263 7.62264,13.27434 0.53361,4.50556 -0.23643,9.88625 -2.26615,15.83469 -1.13816,3.33557 2.5298,-2.18884 4.56098,-6.86942 z M 655.92392,441.25 c 0.0847,-4.73031 -2.45541,-8.25 -5.95386,-8.25 -2.01539,0 -2.01463,0.0207 0.10628,2.88938 1.49181,2.01779 2.30287,4.9589 2.68872,9.75 l 0.55251,6.86062 1.26514,-3.5 c 0.69582,-1.925 1.29937,-5.4125 1.34121,-7.75 z M 213,315 l 0,-29 -5.75,0.007 c -6.83856,0.008 -10.29165,1.93364 -14.37865,8.01903 -6.3888,9.51269 -9.75805,26.7276 -6.91629,35.33821 2.94023,8.90899 11.2787,14.35087 22.29494,14.55022 L 213,344 l 0,-29 z m 388.03612,19.47335 c 7.70089,-5.68154 11.74257,-16.13307 8.59359,-22.22252 -1.45394,-2.81162 -6.94409,-8.19655 -8.45644,-8.29438 -0.3703,-0.024 -2.58577,-0.41353 -4.92327,-0.86573 -4.95099,-0.95778 -5.60461,0.10554 -1.18912,1.9345 6.42185,2.66002 10.93097,12.57763 8.99214,19.77787 -0.56323,2.09169 -2.64064,5.69169 -4.61646,8 -4.06707,4.75144 -3.45004,5.39574 1.59956,1.67026 z M 568.4956,290.99289 c -2.10546,-3.40671 -19.26548,-6.79229 -20.91329,-4.12608 -0.4923,0.79657 1.17376,1.14934 5.60867,1.18757 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.63906,1.88859 4.80902,1.94562 0.16996,0.057 0.0289,-0.34951 -0.31342,-0.90342 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3454"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#716539"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.59573,-35.86844 c 67.70297,-35.05579 108.4591,-80.36317 120.8953,-134.39571 10.22684,-44.43335 1.06065,-89.52661 -26.62861,-131 -18.63783,-27.91603 -39.47557,-49.7024 -74.40785,-77.79522 -29.62682,-23.82613 -42.25571,-40.83404 -42.13943,-56.75111 0.13264,-18.15563 27.23072,-44.09181 75.61363,-72.37149 5.3625,-3.13437 9.75,-5.91203 9.75,-6.17258 C 566,217.85638 497.32186,106 496.36821,106 c -1.1107,0 -15.54613,8.49877 -23.86821,14.05226 -25.11492,16.75968 -50.7508,39.97347 -70.61995,63.94774 -12.18036,14.69691 -29.28483,44.08856 -34.91702,60 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 3.60858,17.60787 13.62555,40.51795 25.35934,58 16.07933,23.95642 28.79688,37.15853 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.73709,11.65368 -20.27354,25.43376 -38.58702,36.57925 -6.518,3.96682 -26.06249,14.33578 -28.64272,15.19586 C 430.32641,594.72453 482.90089,707 484.69499,707 c 0.35141,0 8.5513,-4.09693 18.22197,-9.10429 z m -262.32414,-6.9436 C 294.69993,685.44285 342.38602,639.14362 357.4433,577.5 c 5.67605,-23.23741 5.86038,-26.02434 6.29537,-95.18053 l 0.40369,-64.18054 -5.44235,-7.81946 C 343.41329,388.35581 333.01869,364.14635 327.28379,337.14983 324.81474,325.527 324.59266,322.59211 324.54829,301 c -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 3.56055,-5.40926 4.35277,-7.45681 4.35277,-11.25 0,-3.04281 -0.42978,-4.63734 -1.25,-4.63765 -0.6875,-2.6e-4 -26.54094,-2.92526 -57.45209,-6.5 C 274.38677,160.92478 248.63428,158 248.07017,158 c -0.69628,0 -1.12059,61.57749 -1.32127,191.75 l -0.29562,191.75 -2.20683,8.23042 c -4.48667,16.73308 -13.38056,29.88948 -21.74645,32.16867 -9.82618,2.67703 -16.86956,0.89915 -21.39332,-5.40007 -8.68823,-12.09815 -12.38806,-32.0017 -13.72077,-73.81205 l -0.69529,-21.81303 -6.09531,0.58652 c -3.35242,0.32258 -24.32031,1.9739 -46.59531,3.6696 -57.933221,4.41021 -56.77257,4.30918 -57.465631,5.00224 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 126.1204,-5.85185 c 8.61493,-7.77529 15.89623,-11.41693 23.83887,-11.92268 5.72661,-0.36464 6.42096,-0.17331 9.56148,2.63469 3.1561,2.82193 3.38404,3.44142 3.35136,9.10781 l -0.0351,6.07992 17.84409,0 c 9.81425,0 17.6617,-0.3375 17.43878,-0.75 -0.22292,-0.4125 -11.36388,-24.10678 -24.7577,-52.65395 -19.67772,-41.94047 -24.48579,-51.44248 -25.04731,-49.5 -11.77132,40.7213 -24.44458,63.46931 -49.39045,88.65395 l -14.1149,14.25 17.387,0 17.38701,0 6.53684,-5.89974 z m 27.2812,4.14974 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.60104,-2.4624 -12.24328,0.58123 -19.16303,7.63194 L 366.58358,691 l 13.70821,0 c 12.3909,0 13.70767,-0.16817 13.70263,-1.75 z m 5.80822,-3.52553 C 400.13988,680.57725 397.73089,677 393.92742,677 l -2.07258,0 2.02186,2.57038 c 1.11202,1.41371 2.3237,4.5832 2.69262,7.04332 0.86288,5.75408 2.83357,5.2121 3.23332,-0.88923 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.53751,-13.25545 8.85554,-16.09652 12.14519,-26.17951 7.28721,-22.33579 6.81613,-9.82319 7.14648,-189.82049 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.52952,-9.65 -2.09267,-13.5 -1.38805,-9.48955 -9.17848,-31.42551 -14.20577,-40 -13.01575,-22.19951 -33.47697,-43.34481 -51.22214,-52.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.63431,-1.89621 -16,-2.27727 -16,-1.81149 0,0.21402 16.02483,26.79858 35.61073,59.07681 19.5859,32.27822 35.78768,58.9851 36.00397,59.34861 0.21628,0.36351 -6.02105,4.15355 -13.86073,8.42232 -45.65095,24.8573 -77.82068,47.69002 -82.90069,58.83941 -0.90683,1.99028 -0.73391,2.93624 0.97559,5.33701 2.86386,4.02192 4.8378,5.60688 4.8378,3.88447 0,-3.16194 5.13371,-11.54859 9.98062,-16.30478 7.1,-6.96709 14.2651,-9.69945 23.85271,-9.09607 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 9.33711,5.48878 12.16577,14.41168 7.79186,24.5791 -2.81177,6.53615 -11.12179,14.34707 -17.61915,16.56094 -6.36336,2.16822 -14.95344,2.00842 -19.35736,-0.3601 l -3.5,-1.88237 -3.20902,3.08074 c -2.58409,2.48077 -3.4887,2.84863 -4.6451,1.8889 -1.20655,-1.00135 -0.69366,-1.97542 3.20903,-6.0946 l 4.64509,-4.90276 2.67399,2.55242 c 1.73445,1.65558 4.194,2.7201 7,3.02968 4.15597,0.4585 4.55659,0.25136 10.19207,-5.26992 8.68343,-8.50747 10.22706,-13.33127 6.73006,-21.03135 -3.16121,-6.9607 -13.52832,-11.31705 -18.76558,-7.88546 -1.37724,0.9024 -2.62958,1.49227 -2.78299,1.31082 -0.1534,-0.18144 -1.09443,-2.07809 -2.09117,-4.21477 C 571.92144,295.03742 560.34527,290 546.46638,290 c -10.8925,0 -13.51776,1.74044 -19.14074,12.68957 -2.2959,4.4706 -4.34568,8.05683 -4.55505,7.9694 -1.31993,-0.55118 8.51608,7.92325 18.62477,16.04657 42.473,34.13126 73.78784,68.37995 91.75974,100.35663 1.98726,3.53585 2.63505,3.99882 4.82034,3.44503 1.38851,-0.35188 5.24704,-0.88163 8.57452,-1.17724 5.49925,-0.48855 6.33817,-0.29497 9.216,2.12656 3.85075,3.24019 4.90115,7.80893 3.29012,14.31038 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.17499,-0.72619 -1.13871,-0.5284 1.09312,5.95853 7.47183,21.71726 10.64064,52.04027 7.98551,76.41517 -4.97114,45.63653 -23.57759,83.1845 -60.53455,122.15922 -9.76624,10.29945 -9.8363,10.4079 -4.90769,7.59601 2.75,-1.56893 6.35,-3.58693 8,-4.48442 z m 49.04367,-72.40463 C 647.72206,595.86116 653.86164,586 659.42308,586 661.7151,586 662,586.39801 662,589.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07632,-8.10974 29.88607,-20.06565 33.61679,-27.13882 1.37579,-2.6084 1.2642,-3.16815 -1.7943,-9 -4.26345,-8.12944 -24.70814,-28.76424 -42.32249,-42.71604 -7.15,-5.6633 -16.21895,-13.15716 -20.15323,-16.65303 l -7.15322,-6.35611 -0.48374,47.75328 c -0.46064,45.47274 -1.3747,61.1013 -4.24169,72.52429 -0.67297,2.68132 -0.28915,2.55127 17.17176,-5.8183 C 418.46295,563.74419 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 417.7151,500 418,500.39801 418,503.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.30348,-59.26346 c 0.7772,-6.62493 -0.88344,-13.54843 -3.59814,-15.00129 -1.0778,-0.57682 -3.47023,-0.94703 -5.31651,-0.82269 l -3.35688,0.22607 4.8361,10.05569 c 2.65986,5.53062 4.84257,10.70818 4.85047,11.50568 0.0354,3.57425 1.9969,-0.95083 2.58496,-5.96346 z m -493.19274,-0.0322 C 185.46065,447.77947 210.09815,446 211.12784,446 212.93184,446 213,444.22122 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -18.67586,-1.69347 -28.16069,-14.31599 -25.10946,-33.41595 2.93393,-18.36562 11.9257,-30.6913 25.5147,-34.97486 L 213,277.63476 l 0,-78.44822 0,-78.44822 3.25,0.52561 c 1.7875,0.28909 42.76307,4.90826 91.05682,10.26483 l 87.80682,9.7392 10.19318,-9.92893 C 410.91307,125.87811 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.29106 -105.5,0.29106 -10.5,2.28866 c -11.35512,2.47505 -12.71557,2.8907 -24,7.33244 -12.32857,4.85275 -23.60829,10.9727 -32.35883,17.55672 -10.35935,7.79449 -26.89589,24.81007 -32.14738,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.59946 c 3.182846,-0.3297 29.582016,-2.37893 58.664826,-4.55384 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 107.7151,380 108,380.39801 108,383.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.056329,2.05559 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.85894 2.95336,-15.61065 8.89807,-23.35486 6.05356,-7.886 11.25241,-10.74011 19.50921,-10.71035 9.79353,0.0353 18.41088,5.42102 20.2224,12.63871 2.7107,10.80028 -8.78564,30.99138 -20.88023,36.67209 -5.2085,2.44638 -12.45735,2.98822 -17.06565,1.27563 z m 14.24314,-3.35994 c 2.61638,-1.3349 4.35894,-3.588 7.36735,-9.52584 9.06228,-17.88668 4.68667,-31.70838 -10.04141,-31.71887 -4.62449,-0.003 -5.72095,0.42434 -9.24031,3.60387 -2.19626,1.98419 -5.42651,6.51908 -7.17834,10.07754 -4.06406,8.25529 -4.62129,18.39472 -1.26315,22.9843 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 18.02902,-19.49662 c 1.01482,-2.3385 2.12541,-6.05183 2.46798,-8.25183 1.06645,-6.84876 -3.57877,-13.26439 -11.17394,-15.4326 -3.4836,-0.99447 -4.62148,0.36253 -1.21151,1.44482 3.16694,1.00514 6.94972,7.59263 7.62264,13.27434 0.53361,4.50556 -0.23643,9.88625 -2.26615,15.83469 -1.13816,3.33557 2.5298,-2.18884 4.56098,-6.86942 z M 655.92392,441.25 c 0.0847,-4.73031 -2.45541,-8.25 -5.95386,-8.25 -2.01539,0 -2.01463,0.0207 0.10628,2.88938 1.49181,2.01779 2.30287,4.9589 2.68872,9.75 l 0.55251,6.86062 1.26514,-3.5 c 0.69582,-1.925 1.29937,-5.4125 1.34121,-7.75 z M 213,315 l 0,-29 -5.85212,0 c -7.85262,0 -11.42839,2.50302 -16.20924,11.34641 -5.43821,10.05933 -7.51131,23.68321 -4.95834,32.58492 2.15484,7.51347 12.26281,14.04121 21.7697,14.0589 l 5.25,0.01 0,-29 z m 388.03612,19.47335 c 7.70089,-5.68154 11.74257,-16.13307 8.59359,-22.22252 -1.45394,-2.81162 -6.94409,-8.19655 -8.45644,-8.29438 -0.3703,-0.024 -2.58577,-0.41353 -4.92327,-0.86573 -4.95099,-0.95778 -5.60461,0.10554 -1.18912,1.9345 6.42185,2.66002 10.93097,12.57763 8.99214,19.77787 -0.56323,2.09169 -2.64064,5.69169 -4.61646,8 -4.06707,4.75144 -3.45004,5.39574 1.59956,1.67026 z M 568.4956,290.99289 c -2.10546,-3.40671 -19.26548,-6.79229 -20.91329,-4.12608 -0.4923,0.79657 1.17376,1.14934 5.60867,1.18757 3.71454,0.032 8.15957,0.81185 10.80902,1.89631 2.475,1.01307 4.63906,1.88859 4.80902,1.94562 0.16996,0.057 0.0289,-0.34951 -0.31342,-0.90342 z M 213,283 c 0,-0.55 -0.42344,-1 -0.94098,-1 -0.51754,0 -1.2191,0.45 -1.55902,1 -0.33992,0.55 0.0835,1 0.94098,1 0.85746,0 1.55902,-0.45 1.55902,-1 z"
+       id="path3452"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#7d682a"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.59573,-35.86844 c 67.70297,-35.05579 108.4591,-80.36317 120.8953,-134.39571 10.22684,-44.43335 1.06065,-89.52661 -26.62861,-131 -18.63783,-27.91603 -39.47557,-49.7024 -74.40785,-77.79522 -29.62682,-23.82613 -42.25571,-40.83404 -42.13943,-56.75111 0.13264,-18.15563 27.23072,-44.09181 75.61363,-72.37149 5.3625,-3.13437 9.75,-5.91203 9.75,-6.17258 C 566,217.85638 497.32186,106 496.36821,106 c -1.1107,0 -15.54613,8.49877 -23.86821,14.05226 -25.11492,16.75968 -50.7508,39.97347 -70.61995,63.94774 -12.18036,14.69691 -29.28483,44.08856 -34.91702,60 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 3.60858,17.60787 13.62555,40.51795 25.35934,58 16.07933,23.95642 28.79688,37.15853 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.77296,11.69917 10.0377,18.03689 10.04958,28.12301 0.009,7.67863 -0.32613,9.20705 -3.3788,15.40792 -5.73709,11.65368 -20.27354,25.43376 -38.58702,36.57925 -6.518,3.96682 -26.06249,14.33578 -28.64272,15.19586 C 430.32641,594.72453 482.90089,707 484.69499,707 c 0.35141,0 8.5513,-4.09693 18.22197,-9.10429 z m -262.32414,-6.9436 C 294.69993,685.44285 342.38602,639.14362 357.4433,577.5 c 5.67605,-23.23741 5.86038,-26.02434 6.29537,-95.18053 l 0.40369,-64.18054 -5.44235,-7.81946 C 343.41329,388.35581 333.01869,364.14635 327.28379,337.14983 324.81474,325.527 324.59266,322.59211 324.54829,301 c -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 3.56055,-5.40926 4.35277,-7.45681 4.35277,-11.25 0,-3.04281 -0.42978,-4.63734 -1.25,-4.63765 -0.6875,-2.6e-4 -26.54094,-2.92526 -57.45209,-6.5 C 274.38677,160.92478 248.63428,158 248.07017,158 c -0.69628,0 -1.12059,61.57749 -1.32127,191.75 l -0.29562,191.75 -2.20683,8.23042 c -4.48667,16.73308 -13.38056,29.88948 -21.74645,32.16867 -9.82618,2.67703 -16.86956,0.89915 -21.39332,-5.40007 -8.68823,-12.09815 -12.38806,-32.0017 -13.72077,-73.81205 l -0.69529,-21.81303 -6.09531,0.58652 c -3.35242,0.32258 -24.32031,1.9739 -46.59531,3.6696 -57.933221,4.41021 -56.77257,4.30918 -57.465631,5.00224 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 126.1204,-5.85185 c 8.61493,-7.77529 15.89623,-11.41693 23.83887,-11.92268 5.72661,-0.36464 6.42096,-0.17331 9.56148,2.63469 3.1561,2.82193 3.38404,3.44142 3.35136,9.10781 l -0.0351,6.07992 17.84409,0 c 9.81425,0 17.6617,-0.3375 17.43878,-0.75 -0.22292,-0.4125 -11.36388,-24.10678 -24.7577,-52.65395 -19.67772,-41.94047 -24.48579,-51.44248 -25.04731,-49.5 -11.77132,40.7213 -24.44458,63.46931 -49.39045,88.65395 l -14.1149,14.25 17.387,0 17.38701,0 6.53684,-5.89974 z m 27.2812,4.14974 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.60104,-2.4624 -12.24328,0.58123 -19.16303,7.63194 L 366.58358,691 l 13.70821,0 c 12.3909,0 13.70767,-0.16817 13.70263,-1.75 z m 5.80822,-3.52553 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.53751,-13.25545 8.85554,-16.09652 12.14519,-26.17951 7.28721,-22.33579 6.81613,-9.82319 7.14648,-189.82049 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.52952,-9.65 -2.09267,-13.5 -1.38805,-9.48955 -9.17848,-31.42551 -14.20577,-40 -13.01575,-22.19951 -33.47697,-43.34481 -51.22214,-52.93463 -2.72721,-1.47384 -6.88139,-3.81839 -9.2315,-5.21011 C 586.40548,122.31555 567.32711,116.09693 557,114.547 c -12.63431,-1.89621 -16,-2.27727 -16,-1.81149 0,0.21402 16.02483,26.79858 35.61073,59.07681 19.5859,32.27822 35.78768,58.9851 36.00397,59.34861 0.21628,0.36351 -6.02105,4.15355 -13.86073,8.42232 -45.65095,24.8573 -77.82068,47.69002 -82.90069,58.83941 -0.90683,1.99028 -0.73391,2.93624 0.97559,5.33701 2.86386,4.02192 4.8378,5.60688 4.8378,3.88447 0,-3.16194 5.13371,-11.54859 9.98062,-16.30478 7.1,-6.96709 14.2651,-9.69945 23.85271,-9.09607 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 9.33711,5.48878 12.16577,14.41168 7.79186,24.5791 -2.81177,6.53615 -11.12179,14.34707 -17.61915,16.56094 -6.36336,2.16822 -14.95344,2.00842 -19.35736,-0.3601 l -3.5,-1.88237 -3.20902,3.08074 c -2.58409,2.48077 -3.4887,2.84863 -4.6451,1.8889 -1.20655,-1.00135 -0.69366,-1.97542 3.20903,-6.0946 l 4.64509,-4.90276 2.67399,2.55242 c 1.73445,1.65558 4.194,2.7201 7,3.02968 4.15597,0.4585 4.55659,0.25136 10.19207,-5.26992 8.68343,-8.50747 10.22706,-13.33127 6.73006,-21.03135 -3.16121,-6.9607 -13.52832,-11.31705 -18.76558,-7.88546 -1.37724,0.9024 -2.62958,1.49227 -2.78299,1.31082 -0.1534,-0.18144 -1.09443,-2.07809 -2.09117,-4.21477 C 571.92144,295.03742 560.34527,290 546.46638,290 c -10.8925,0 -13.51776,1.74044 -19.14074,12.68957 -2.2959,4.4706 -4.34568,8.05683 -4.55505,7.9694 -1.31993,-0.55118 8.51608,7.92325 18.62477,16.04657 42.473,34.13126 73.78784,68.37995 91.75974,100.35663 1.98726,3.53585 2.63505,3.99882 4.82034,3.44503 1.38851,-0.35188 5.24704,-0.88163 8.57452,-1.17724 5.49925,-0.48855 6.33817,-0.29497 9.216,2.12656 3.85075,3.24019 4.90115,7.80893 3.29012,14.31038 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.17499,-0.72619 -1.13871,-0.5284 1.09312,5.95853 7.47183,21.71726 10.64064,52.04027 7.98551,76.41517 -4.97114,45.63653 -23.57759,83.1845 -60.53455,122.15922 -9.76624,10.29945 -9.8363,10.4079 -4.90769,7.59601 2.75,-1.56893 6.35,-3.58693 8,-4.48442 z m 49.04367,-72.40463 C 647.72206,595.86116 653.86164,586 659.42308,586 661.7151,586 662,586.39801 662,589.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 434,555.85743 c 15.07632,-8.10974 29.88607,-20.06565 33.61679,-27.13882 1.37579,-2.6084 1.2642,-3.16815 -1.7943,-9 -4.26345,-8.12944 -24.70814,-28.76424 -42.32249,-42.71604 -7.15,-5.6633 -16.21895,-13.15716 -20.15323,-16.65303 l -7.15322,-6.35611 -0.48374,47.75328 c -0.46064,45.47274 -1.3747,61.1013 -4.24169,72.52429 -0.67297,2.68132 -0.28915,2.55127 17.17176,-5.8183 C 418.46295,563.74419 429.875,558.07632 434,555.85743 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 417.7151,500 418,500.39801 418,503.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.30348,-59.26346 c 0.7772,-6.62493 -0.88344,-13.54843 -3.59814,-15.00129 -1.0778,-0.57682 -3.47023,-0.94703 -5.31651,-0.82269 l -3.35688,0.22607 4.8361,10.05569 c 2.65986,5.53062 4.84257,10.70818 4.85047,11.50568 0.0354,3.57425 1.9969,-0.95083 2.58496,-5.96346 z m -493.19274,-0.0322 C 185.46065,447.77947 210.09815,446 211.12784,446 212.93184,446 213,444.22122 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -18.67586,-1.69347 -28.16069,-14.31599 -25.10946,-33.41595 2.93393,-18.36562 11.9257,-30.6913 25.5147,-34.97486 L 213,277.63476 l 0,-78.44822 0,-78.44822 3.25,0.52561 c 1.7875,0.28909 42.76307,4.90826 91.05682,10.26483 l 87.80682,9.7392 10.19318,-9.92893 C 410.91307,125.87811 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.29106 -105.5,0.29106 -10.5,2.28866 c -11.35512,2.47505 -12.71557,2.8907 -24,7.33244 -12.32857,4.85275 -23.60829,10.9727 -32.35883,17.55672 -10.35935,7.79449 -26.89589,24.81007 -32.14738,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.59946 c 3.182846,-0.3297 29.582016,-2.37893 58.664826,-4.55384 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 107.7151,380 108,380.39801 108,383.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.056329,2.05559 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.85894 2.95336,-15.61065 8.89807,-23.35486 6.05356,-7.886 11.25241,-10.74011 19.50921,-10.71035 9.79353,0.0353 18.41088,5.42102 20.2224,12.63871 2.7107,10.80028 -8.78564,30.99138 -20.88023,36.67209 -5.2085,2.44638 -12.45735,2.98822 -17.06565,1.27563 z m 14.24314,-3.35994 c 2.61638,-1.3349 4.35894,-3.588 7.36735,-9.52584 9.06228,-17.88668 4.68667,-31.70838 -10.04141,-31.71887 -4.62449,-0.003 -5.72095,0.42434 -9.24031,3.60387 -2.19626,1.98419 -5.42651,6.51908 -7.17834,10.07754 -4.06406,8.25529 -4.62129,18.39472 -1.26315,22.9843 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 17.30648,-17.93356 c 5.67292,-12.12275 4.01862,-19.37901 -5.50748,-24.15753 -5.73982,-2.87923 -8.42255,-2.36904 -3.50945,0.66742 7.4835,4.62506 9.71945,16.75475 5.24021,28.42745 -0.36887,0.96127 -0.37389,1.74777 -0.0112,1.74777 0.36274,0 2.06728,-3.0083 3.78787,-6.68511 z m 487.49748,219.7162 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 213,315 l 0,-29 -5.85212,0 c -7.85262,0 -11.42839,2.50302 -16.20924,11.34641 -5.43821,10.05933 -7.51131,23.68321 -4.95834,32.58492 2.15484,7.51347 12.26281,14.04121 21.7697,14.0589 l 5.25,0.01 0,-29 z m 387.56388,19.96052 c 4.38149,-2.70791 9.19065,-10.14078 9.98394,-15.43085 1.14712,-7.64952 -4.31412,-14.31454 -13.54331,-16.52859 -6.45337,-1.54814 -7.37739,-0.74212 -2.18563,1.90652 4.7645,2.43067 7.55707,6.06113 9.11627,11.85157 1.52037,5.6462 0.11682,10.65184 -4.49859,16.04392 -4.00314,4.67676 -3.74583,5.1692 1.12732,2.15743 z M 568.4956,290.99289 c -2.13989,-3.46242 -20.21929,-6.86701 -21.91301,-4.12652 -0.4929,0.79752 1.16994,1.14661 5.60839,1.1774 5.00431,0.0347 11.10665,1.43841 16.61804,3.82255 0.16996,0.0735 0.0289,-0.31952 -0.31342,-0.87343 z M 213,283 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3450"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#6a6440"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.59573,-35.87188 c 30.06642,-15.57391 52.50867,-31.44354 72.67705,-51.39227 27.06071,-26.76599 43.75193,-57.12699 50.02803,-91 2.58597,-13.9569 2.59219,-41.17116 0.0126,-55 C 616.03497,449.03841 583.36918,403.21855 520,352.32775 493.23927,330.83663 480.66729,313.62329 480.59554,298.37587 480.50925,280.03681 506.89684,254.66034 556.25,225.62035 561.6125,222.46499 566,219.66502 566,219.3982 566,217.82323 497.33531,106 496.36821,106 c -1.12134,0 -15.60147,8.53451 -24.15808,14.23865 -22.64235,15.09417 -51.30795,40.76563 -67.84814,60.76135 -14.64141,17.70024 -31.29335,45.75109 -37.39896,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 3.60858,17.60787 13.62555,40.51795 25.35934,58 16.07933,23.95642 28.79688,37.15853 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.66038,11.52973 9.96625,18.00174 10.01864,28.11983 0.0399,7.70549 -0.2791,9.17755 -3.33288,15.38068 -7.57696,15.39098 -27.16507,31.49243 -56.21438,46.20829 -6.27475,3.17868 -11.56542,5.88608 -11.75705,6.01645 C 430.28387,595.2168 483.5457,707 484.69469,707 c 0.35158,0 8.5516,-4.09848 18.22227,-9.10773 z m -262.32414,-6.94016 c 53.97544,-5.49586 101.46748,-51.45564 116.81688,-113.04798 5.62637,-22.57688 5.87087,-26.27558 6.31832,-95.58466 l 0.41434,-64.18054 -5.44235,-7.81946 C 343.41329,388.35581 333.01869,364.14635 327.28379,337.14983 324.81474,325.527 324.59266,322.59211 324.54829,301 c -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.07104 363.53198,171 362.95209,171 c -0.57636,0 -26.33886,-2.92478 -57.25,-6.49952 -30.91115,-3.57474 -56.75563,-6.49974 -57.43218,-6.5 -0.9681,-3.8e-4 -1.29512,40.73232 -1.53544,191.24952 -0.34226,214.37002 0.25764,197.61148 -7.67357,214.36849 -4.63087,9.7841 -10.91874,16.72144 -16.5609,18.27147 -5.06022,1.39015 -11.32904,1.4142 -15.21836,0.0584 -6.76166,-2.35713 -13.1017,-15.84767 -16.33438,-34.75681 -1.94541,-11.37948 -3.92044,-40.22665 -3.9382,-57.52112 l -0.009,-8.8296 -6.25,0.60308 c -3.4375,0.3317 -24.475,1.99047 -46.75,3.68617 -57.933221,4.41021 -56.77257,4.30918 -57.465631,5.00224 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 126.1204,-5.85185 c 8.61493,-7.77529 15.89623,-11.41693 23.83887,-11.92268 5.72661,-0.36464 6.42096,-0.17331 9.56148,2.63469 3.1561,2.82193 3.38404,3.44142 3.35136,9.10781 l -0.0351,6.07992 17.84409,0 c 9.81425,0 17.66278,-0.3375 17.4412,-0.75 -0.22159,-0.4125 -11.3616,-24.10965 -24.75558,-52.66032 l -24.35269,-51.91033 -1.17538,3.91033 c -12.46142,41.45733 -23.98665,61.99415 -48.91423,87.16032 l -14.1149,14.25 17.387,0 17.38701,0 6.53684,-5.89974 z m 27.2812,4.14974 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.60104,-2.4624 -12.24328,0.58123 -19.16303,7.63194 L 366.58358,691 l 13.70821,0 c 12.3909,0 13.70767,-0.16817 13.70263,-1.75 z m 5.80822,-3.52553 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24233,-22.09789 6.78515,-9.90276 7.11532,-189.80047 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.52888,-9.65 -2.09124,-13.5 -0.56236,-3.85 -3.20271,-13.15394 -5.86745,-20.67543 -7.47323,-21.09394 -16.92237,-35.69752 -33.31215,-51.48371 -13.86328,-13.35273 -17.51378,-16.01372 -36.41128,-26.54155 -7.59589,-4.23169 -24.38823,-9.57632 -35.29703,-11.23427 -14.76482,-2.244 -16.13009,-2.34409 -15.66165,-1.14815 0.23334,0.59571 16.27747,27.18311 35.65362,59.08311 19.37615,31.9 35.40635,58.29742 35.62266,58.66093 0.21632,0.36351 -6.02098,4.15355 -13.86066,8.42232 -45.71425,24.89176 -77.81993,47.68837 -82.91694,58.87509 -2.01037,4.41227 4.96515,11.97209 28.16297,30.52207 39.04051,31.21849 69.29102,64.19829 87.61056,95.51505 3.49893,5.98134 4.13499,6.57952 6.38765,6.00738 1.37599,-0.34947 5.22427,-0.87727 8.55175,-1.17288 5.49925,-0.48855 6.33817,-0.29497 9.216,2.12656 3.85075,3.24019 4.90115,7.80893 3.29012,14.31038 -1.58213,6.38479 -7.11883,18.31235 -8.19247,17.64881 -1.17499,-0.72619 -1.13871,-0.5284 1.09312,5.95853 7.47183,21.71726 10.64064,52.04027 7.98551,76.41517 -4.97114,45.63653 -23.57759,83.1845 -60.53455,122.15922 -9.76624,10.29945 -9.8363,10.4079 -4.90769,7.59601 2.75,-1.56893 6.35,-3.58693 8,-4.48442 z m 49.04367,-72.40463 C 647.72206,595.86116 653.86164,586 659.42308,586 661.7151,586 662,586.39801 662,589.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 564.33399,344.93399 c -0.75468,-0.75468 0.2821,-2.48892 3.55,-5.93815 l 4.61601,-4.87213 2.67399,2.55242 c 1.73445,1.65558 4.194,2.7201 7,3.02968 4.15597,0.4585 4.55659,0.25136 10.19207,-5.26992 8.68343,-8.50747 10.22706,-13.33127 6.73006,-21.03135 -3.16121,-6.9607 -13.52832,-11.31705 -18.76558,-7.88546 -1.37724,0.9024 -2.62958,1.49227 -2.78299,1.31082 -0.1534,-0.18144 -1.09443,-2.07809 -2.09117,-4.21477 C 571.92144,295.03742 560.34527,290 546.46638,290 c -10.91223,0 -13.51361,1.73225 -19.18433,12.77476 -3.47152,6.76004 -4.38475,7.90186 -5.16056,6.45225 -1.46671,-2.74057 3.40881,-11.90476 9.51655,-17.88765 7.11288,-6.96747 14.27899,-9.69916 23.86196,-9.09607 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 9.33711,5.48878 12.16577,14.41168 7.79186,24.5791 -2.81177,6.53615 -11.12179,14.34707 -17.61915,16.56094 -6.48055,2.20815 -14.53861,2.06444 -19.25845,-0.34344 l -3.82141,-1.94954 -2.82584,2.94954 c -3.12864,3.26559 -3.57231,3.42889 -5.11767,1.88353 z m 36.22989,-9.97347 c 4.38149,-2.70791 9.19065,-10.14078 9.98394,-15.43085 1.14712,-7.64952 -4.31412,-14.31454 -13.54331,-16.52859 -6.45337,-1.54814 -7.37739,-0.74212 -2.18563,1.90652 4.7645,2.43067 7.55707,6.06113 9.11627,11.85157 1.52037,5.6462 0.11682,10.65184 -4.49859,16.04392 -4.00314,4.67676 -3.74583,5.1692 1.12732,2.15743 z M 568.4956,290.99289 c -2.13989,-3.46242 -20.21929,-6.86701 -21.91301,-4.12652 -0.4929,0.79752 1.16994,1.14661 5.60839,1.1774 5.00431,0.0347 11.10665,1.43841 16.61804,3.82255 0.16996,0.0735 0.0289,-0.31952 -0.31342,-0.87343 z M 426.76289,559.62451 c 6.19458,-3.10978 14.51958,-7.74046 18.5,-10.2904 8.01661,-5.13562 20.1386,-16.30333 22.37709,-20.6155 1.34825,-2.59723 1.22791,-3.19312 -1.81749,-9 -4.26345,-8.12944 -24.70814,-28.76424 -42.32249,-42.71604 -7.15,-5.6633 -16.21895,-13.15716 -20.15323,-16.65303 l -7.15322,-6.35611 -0.48374,47.75328 c -0.46038,45.44709 -1.37508,61.10281 -4.23595,72.50144 l -0.68262,2.71976 12.35438,-5.84463 c 6.79491,-3.21455 17.42268,-8.389 23.61727,-11.49877 z M 407.54367,512.65559 C 403.72206,509.86116 409.86164,500 415.42308,500 417.7151,500 418,500.39801 418,503.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.05633,2.05559 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.30348,-59.26346 c 0.7772,-6.62493 -0.88344,-13.54843 -3.59814,-15.00129 -1.0778,-0.57682 -3.47023,-0.94703 -5.31651,-0.82269 l -3.35688,0.22607 4.8361,10.05569 c 2.65986,5.53062 4.84257,10.70818 4.85047,11.50568 0.0354,3.57425 1.9969,-0.95083 2.58496,-5.96346 z m -493.11411,-0.0257 C 185.58253,447.78239 210.22003,446 211.20647,446 212.90671,446 213,443.45837 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -18.67586,-1.69347 -28.16069,-14.31599 -25.10946,-33.41595 2.93393,-18.36562 11.9257,-30.6913 25.5147,-34.97486 L 213,277.63476 l 0,-78.42867 0,-78.42867 3.25,0.55641 c 1.7875,0.30603 42.76307,4.9164 91.05682,10.24528 l 87.80682,9.68885 10.19318,-9.92893 C 410.91307,125.87811 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.29106 -105.5,0.29106 -10.5,2.28866 c -11.35512,2.47505 -12.71557,2.8907 -24,7.33244 -12.32857,4.85275 -23.60829,10.9727 -32.35883,17.55672 -10.35935,7.79449 -26.89589,24.81007 -32.14738,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.59297 c 3.182846,-0.32614 29.617396,-2.37537 58.743456,-4.55385 z M 97.543671,392.65559 C 93.722056,389.86116 99.861641,380 105.42308,380 107.7151,380 108,380.39801 108,383.6 c 0,2.76078 -0.79259,4.39259 -3.4,7 -3.79489,3.79489 -4.42619,3.9788 -7.056329,2.05559 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.85894 2.95336,-15.61065 8.89807,-23.35486 6.05356,-7.886 11.25241,-10.74011 19.50921,-10.71035 9.79353,0.0353 18.41088,5.42102 20.2224,12.63871 2.7107,10.80028 -8.78564,30.99138 -20.88023,36.67209 -5.2085,2.44638 -12.45735,2.98822 -17.06565,1.27563 z m 14.24314,-3.35994 c 2.61638,-1.3349 4.35894,-3.588 7.36735,-9.52584 9.06228,-17.88668 4.68667,-31.70838 -10.04141,-31.71887 -4.62449,-0.003 -5.72095,0.42434 -9.24031,3.60387 -2.19626,1.98419 -5.42651,6.51908 -7.17834,10.07754 -4.06406,8.25529 -4.62129,18.39472 -1.26315,22.9843 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 17.30648,-17.93356 c 5.67292,-12.12275 4.01862,-19.37901 -5.50748,-24.15753 -5.73982,-2.87923 -8.42255,-2.36904 -3.50945,0.66742 7.4835,4.62506 9.71945,16.75475 5.24021,28.42745 -0.36887,0.96127 -0.37389,1.74777 -0.0112,1.74777 0.36274,0 2.06728,-3.0083 3.78787,-6.68511 z m 487.49748,219.7162 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 213,315 l 0,-29 -5.85212,0 c -7.85262,0 -11.42839,2.50302 -16.20924,11.34641 -5.43821,10.05933 -7.51131,23.68321 -4.95834,32.58492 2.15484,7.51347 12.26281,14.04121 21.7697,14.0589 l 5.25,0.01 0,-29 z m 0,-32 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3448"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#756034"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.59573,-35.87188 c 30.06642,-15.57391 52.50867,-31.44354 72.67705,-51.39227 27.06071,-26.76599 43.75193,-57.12699 50.02803,-91 2.58597,-13.9569 2.59219,-41.17116 0.0126,-55 C 616.03497,449.03841 583.36918,403.21855 520,352.32775 493.23927,330.83663 480.66729,313.62329 480.59554,298.37587 480.50925,280.03681 506.89684,254.66034 556.25,225.62035 561.6125,222.46499 566,219.66502 566,219.3982 566,217.82323 497.33531,106 496.36821,106 c -1.12134,0 -15.60147,8.53451 -24.15808,14.23865 -22.64235,15.09417 -51.30795,40.76563 -67.84814,60.76135 -14.64141,17.70024 -31.29335,45.75109 -37.39896,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 3.60858,17.60787 13.62555,40.51795 25.35934,58 16.07933,23.95642 28.79688,37.15853 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.66038,11.52973 9.96625,18.00174 10.01864,28.11983 0.0399,7.70549 -0.2791,9.17755 -3.33288,15.38068 -7.57696,15.39098 -27.16507,31.49243 -56.21438,46.20829 -6.27475,3.17868 -11.56542,5.88608 -11.75705,6.01645 C 430.28387,595.2168 483.5457,707 484.69469,707 c 0.35158,0 8.5516,-4.09848 18.22227,-9.10773 z m -262.32414,-6.94016 c 53.97544,-5.49586 101.46748,-51.45564 116.81688,-113.04798 5.62637,-22.57688 5.87087,-26.27558 6.31832,-95.58466 l 0.41434,-64.18054 -5.44235,-7.81946 C 343.41329,388.35581 333.01869,364.14635 327.28379,337.14983 324.81474,325.527 324.59266,322.59211 324.54829,301 c -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.07104 363.53198,171 362.95209,171 c -0.57636,0 -26.33886,-2.92478 -57.25,-6.49952 -30.91115,-3.57474 -56.75563,-6.49974 -57.43218,-6.5 -0.9681,-3.8e-4 -1.29512,40.73232 -1.53544,191.24952 -0.34226,214.37002 0.25764,197.61148 -7.67357,214.36849 -4.63087,9.7841 -10.91874,16.72144 -16.5609,18.27147 -5.06022,1.39015 -11.32904,1.4142 -15.21836,0.0584 -6.76166,-2.35713 -13.1017,-15.84767 -16.33438,-34.75681 -1.94541,-11.37948 -3.92044,-40.22665 -3.9382,-57.52112 l -0.009,-8.8296 -6.25,0.60308 c -3.4375,0.3317 -24.475,1.99047 -46.75,3.68617 -57.933221,4.41021 -56.77257,4.30918 -57.465631,5.00224 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 124.74334,-4.56444 c 11.38187,-10.23328 19.28542,-13.96675 27.82894,-13.14583 7.55858,0.72629 10.36908,3.96585 10.22436,11.78531 L 403.27892,691 l 17.91956,0 c 9.85575,0 17.73825,-0.3375 17.51667,-0.75 -0.22159,-0.4125 -11.3616,-24.10965 -24.75558,-52.66032 l -24.35269,-51.91033 -1.17538,3.91033 c -12.46142,41.45733 -23.98665,61.99415 -48.91423,87.16032 l -14.1149,14.25 17.40188,0 17.40189,0 5.13002,-4.61233 z m 28.65826,2.86233 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.60104,-2.4624 -12.24328,0.58123 -19.16303,7.63194 L 366.58358,691 l 13.70821,0 c 12.3909,0 13.70767,-0.16817 13.70263,-1.75 z m 5.80822,-3.52553 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24233,-22.09789 6.78515,-9.90276 7.11532,-189.80047 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.52888,-9.65 -2.09124,-13.5 -0.56236,-3.85 -3.20271,-13.15394 -5.86745,-20.67543 -7.47323,-21.09394 -16.92237,-35.69752 -33.31215,-51.48371 -13.86328,-13.35273 -17.51378,-16.01372 -36.41128,-26.54155 -7.59589,-4.23169 -24.38823,-9.57632 -35.29703,-11.23427 -14.76482,-2.244 -16.13009,-2.34409 -15.66165,-1.14815 0.23334,0.59571 16.27747,27.18311 35.65362,59.08311 19.37615,31.9 35.40635,58.29742 35.62266,58.66093 0.21632,0.36351 -6.02098,4.15355 -13.86066,8.42232 -45.71425,24.89176 -77.81993,47.68837 -82.91694,58.87509 -2.01037,4.41227 4.96515,11.97209 28.16297,30.52207 39.04412,31.22137 69.30454,64.21314 87.61234,95.52034 3.74768,6.4087 3.99568,6.61968 6.88766,5.85966 1.65,-0.43362 5.77688,-0.80461 9.17084,-0.82441 5.17374,-0.0302 6.58512,0.35341 8.73469,2.37393 3.44098,3.23441 4.08782,7.61572 2.20778,14.95423 -1.71521,6.69514 -5.94071,15.74497 -7.61161,16.30194 -0.68186,0.22729 -0.3518,2.40977 0.92619,6.1243 7.50138,21.80316 10.67379,52.08455 8.01435,76.49901 -4.97114,45.63653 -23.57759,83.1845 -60.53455,122.15922 -9.76624,10.29945 -9.8363,10.4079 -4.90769,7.59601 2.75,-1.56893 6.35,-3.58693 8,-4.48442 z m 49.07143,-72.63165 c -1.90092,-1.90092 -1.89439,-1.71986 -0.20786,-5.75629 1.50691,-3.60654 5.45896,-6.67228 8.60125,-6.67228 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.78362,4.07352 -7.02857,1.82857 z M 656.2671,595.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 564.33399,344.93399 c -0.75468,-0.75468 0.2821,-2.48892 3.55,-5.93815 l 4.61601,-4.87213 2.67399,2.55242 c 1.73445,1.65558 4.194,2.7201 7,3.02968 4.15597,0.4585 4.55659,0.25136 10.19207,-5.26992 8.68343,-8.50747 10.22706,-13.33127 6.73006,-21.03135 -3.16121,-6.9607 -13.52832,-11.31705 -18.76558,-7.88546 -1.37724,0.9024 -2.62958,1.49227 -2.78299,1.31082 -0.1534,-0.18144 -1.09443,-2.07809 -2.09117,-4.21477 C 571.92144,295.03742 560.34527,290 546.46638,290 c -10.8925,0 -13.51776,1.74044 -19.14074,12.68957 -2.2959,4.4706 -4.4334,7.86933 -4.75,7.55273 -2.33798,-2.33798 2.81083,-12.80052 9.51105,-19.32673 6.7159,-6.5415 14.05807,-9.26104 23.41331,-8.67228 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 6.27233,3.68716 9.07537,7.83644 9.60452,14.21735 1.48246,17.87646 -21.53297,34.04388 -38.05786,26.73413 l -4.54418,-2.0101 -2.78066,2.90238 c -3.0822,3.21713 -3.52971,3.37914 -5.07248,1.83637 z m 42.35862,-16.36365 c 5.84497,-8.46217 5.29028,-16.04117 -1.59821,-21.83745 -2.85798,-2.40484 -12.61998,-5.54064 -13.74528,-4.41534 -0.29861,0.29861 1.26278,1.46413 3.46976,2.59005 4.7645,2.43067 7.55707,6.06113 9.11627,11.85157 1.58119,5.87209 0.0544,10.82594 -5.18606,16.82739 l -4.24909,4.86606 4.5,-2.63005 c 2.475,-1.44653 5.93668,-4.71003 7.69261,-7.25223 z M 568.4956,290.99289 c -2.13989,-3.46242 -20.21929,-6.86701 -21.91301,-4.12652 -0.4929,0.79752 1.16994,1.14661 5.60839,1.1774 5.00431,0.0347 11.10665,1.43841 16.61804,3.82255 0.16996,0.0735 0.0289,-0.31952 -0.31342,-0.87343 z M 426.76289,559.62451 c 6.19458,-3.10978 14.51958,-7.74046 18.5,-10.2904 8.01661,-5.13562 20.1386,-16.30333 22.37709,-20.6155 1.34825,-2.59723 1.22791,-3.19312 -1.81749,-9 -4.26345,-8.12944 -24.70814,-28.76424 -42.32249,-42.71604 -7.15,-5.6633 -16.21895,-13.15716 -20.15323,-16.65303 l -7.15322,-6.35611 -0.48374,47.75328 c -0.46038,45.44709 -1.37508,61.10281 -4.23595,72.50144 l -0.68262,2.71976 12.35438,-5.84463 c 6.79491,-3.21455 17.42268,-8.389 23.61727,-11.49877 z m -19.19146,-47.19594 c -1.90092,-1.90092 -1.89439,-1.71986 -0.20786,-5.75629 1.50691,-3.60654 5.45896,-6.67228 8.60125,-6.67228 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.78362,4.07352 -7.02857,1.82857 z M 412.2671,509.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 -1.55038,0 -5.18099,4.9998 -5.18099,7.13486 0,2.33853 1.22452,2.38169 3.2671,0.11514 z m 237.30348,-59.26346 c 0.7772,-6.62493 -0.88344,-13.54843 -3.59814,-15.00129 -1.0778,-0.57682 -3.47023,-0.94703 -5.31651,-0.82269 l -3.35688,0.22607 4.8361,10.05569 c 2.65986,5.53062 4.84257,10.70818 4.85047,11.50568 0.0354,3.57425 1.9969,-0.95083 2.58496,-5.96346 z m -493.11411,-0.0257 C 185.58253,447.78239 210.22003,446 211.20647,446 212.90671,446 213,443.45837 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -10.01317,-0.90796 -19.16961,-6.13847 -22.75187,-12.99672 -2.51795,-4.82065 -3.43082,-12.3734 -2.38596,-19.74062 2.58598,-18.23352 12.0427,-31.39785 25.63217,-35.68155 L 213,277.63476 l 0,-78.42867 0,-78.42867 3.25,0.55641 c 1.7875,0.30603 42.76307,4.9164 91.05682,10.24528 l 87.80682,9.68885 10.19318,-9.92893 C 410.91307,125.87811 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.29106 -105.5,0.29106 -10.5,2.28866 c -11.35512,2.47505 -12.71557,2.8907 -24,7.33244 -12.32857,4.85275 -23.60829,10.9727 -32.35883,17.55672 -10.35935,7.79449 -26.89589,24.81007 -32.14738,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.59297 c 3.182846,-0.32614 29.617396,-2.37537 58.743456,-4.55385 z M 97.571429,392.42857 c -1.900923,-1.90092 -1.894385,-1.71986 -0.207861,-5.75629 C 98.870478,383.06574 102.82253,380 105.96482,380 c 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.783625,4.07352 -7.028571,1.82857 z M 102.2671,389.25 c 1.99673,-2.21567 3.32571,-7.25 1.91389,-7.25 C 102.63061,382 99,386.9998 99,389.13486 c 0,2.33853 1.22452,2.38169 3.2671,0.11514 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.7747 2.70239,-14.82212 8.89429,-23.19493 6.02555,-8.14788 11.01016,-10.90233 19.67143,-10.87028 7.13663,0.0264 12.95479,2.43105 16.72594,6.91281 4.92566,5.85381 4.91966,12.78416 -0.0201,23.23478 -7.49758,15.86193 -22.71169,24.85237 -34.58775,20.43884 z m 14.24314,-3.35994 c 2.61638,-1.3349 4.35894,-3.588 7.36735,-9.52584 9.06228,-17.88668 4.68667,-31.70838 -10.04141,-31.71887 -4.62449,-0.003 -5.72095,0.42434 -9.24031,3.60387 -2.19626,1.98419 -5.42651,6.51908 -7.17834,10.07754 -4.06406,8.25529 -4.62129,18.39472 -1.26315,22.9843 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 17.30648,-17.93356 c 5.67292,-12.12275 4.01862,-19.37901 -5.50748,-24.15753 -5.73982,-2.87923 -8.42255,-2.36904 -3.50945,0.66742 7.4835,4.62506 9.71945,16.75475 5.24021,28.42745 -0.36887,0.96127 -0.37389,1.74777 -0.0112,1.74777 0.36274,0 2.06728,-3.0083 3.78787,-6.68511 z m 487.49748,219.7162 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 213,315 l 0,-29 -5.85212,0 c -7.85262,0 -11.42839,2.50302 -16.20924,11.34641 -5.43821,10.05933 -7.51131,23.68321 -4.95834,32.58492 2.15484,7.51347 12.26281,14.04121 21.7697,14.0589 l 5.25,0.01 0,-29 z m 0,-32 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3446"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#796529"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.59573,-35.87188 c 30.06642,-15.57391 52.50867,-31.44354 72.67705,-51.39227 27.06071,-26.76599 43.75193,-57.12699 50.02803,-91 2.58597,-13.9569 2.59219,-41.17116 0.0126,-55 C 616.03497,449.03841 583.36918,403.21855 520,352.32775 493.23927,330.83663 480.66729,313.62329 480.59554,298.37587 480.50925,280.03681 506.89684,254.66034 556.25,225.62035 561.6125,222.46499 566,219.66502 566,219.3982 566,217.82323 497.33531,106 496.36821,106 c -1.12134,0 -15.60147,8.53451 -24.15808,14.23865 -22.64235,15.09417 -51.30795,40.76563 -67.84814,60.76135 -14.64141,17.70024 -31.29335,45.75109 -37.39896,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 3.60858,17.60787 13.62555,40.51795 25.35934,58 16.07933,23.95642 28.79688,37.15853 59.6634,61.93665 21.85484,17.54398 40.47877,35.98617 48.43725,47.96455 7.66038,11.52973 9.96625,18.00174 10.01864,28.11983 0.0399,7.70549 -0.2791,9.17755 -3.33288,15.38068 -7.57696,15.39098 -27.16507,31.49243 -56.21438,46.20829 -6.27475,3.17868 -11.56542,5.88608 -11.75705,6.01645 C 430.28387,595.2168 483.5457,707 484.69469,707 c 0.35158,0 8.5516,-4.09848 18.22227,-9.10773 z m -262.32414,-6.94016 c 53.97544,-5.49586 101.46748,-51.45564 116.81688,-113.04798 5.62637,-22.57688 5.87087,-26.27558 6.31832,-95.58466 l 0.41434,-64.18054 -5.44235,-7.81946 C 343.41329,388.35581 333.01869,364.14635 327.28379,337.14983 324.81474,325.527 324.59266,322.59211 324.54829,301 c -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.07104 363.53198,171 362.95209,171 c -0.57636,0 -26.33886,-2.92478 -57.25,-6.49952 -30.91115,-3.57474 -56.75563,-6.49974 -57.43218,-6.5 -0.9681,-3.8e-4 -1.29512,40.73232 -1.53544,191.24952 -0.34226,214.37002 0.25764,197.61148 -7.67357,214.36849 -4.63087,9.7841 -10.91874,16.72144 -16.5609,18.27147 -5.06022,1.39015 -11.32904,1.4142 -15.21836,0.0584 -6.76166,-2.35713 -13.1017,-15.84767 -16.33438,-34.75681 -1.94541,-11.37948 -3.92044,-40.22665 -3.9382,-57.52112 l -0.009,-8.8296 -6.25,0.60308 c -3.4375,0.3317 -24.475,1.99047 -46.75,3.68617 -57.933221,4.41021 -56.77257,4.30918 -57.465631,5.00224 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 124.74334,-4.56444 c 11.38187,-10.23328 19.28542,-13.96675 27.82894,-13.14583 7.55858,0.72629 10.36908,3.96585 10.22436,11.78531 L 403.27892,691 l 17.91956,0 c 9.85575,0 17.73825,-0.3375 17.51667,-0.75 -0.22159,-0.4125 -11.3616,-24.10965 -24.75558,-52.66032 l -24.35269,-51.91033 -1.17538,3.91033 c -12.46142,41.45733 -23.98665,61.99415 -48.91423,87.16032 l -14.1149,14.25 17.40188,0 17.40189,0 5.13002,-4.61233 z m 28.65826,2.86233 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.24331,-2.27095 -10.77137,1e-4 -18.02199,6.26967 -6.5568,5.66963 -6.4845,5.71856 8.45031,5.71856 12.23992,0 13.54915,-0.16916 13.54411,-1.75 z m 5.80822,-3.52553 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24233,-22.09789 6.78515,-9.90276 7.11532,-189.80047 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.52888,-9.65 -2.09124,-13.5 -0.56236,-3.85 -3.20271,-13.15394 -5.86745,-20.67543 -7.47323,-21.09394 -16.92237,-35.69752 -33.31215,-51.48371 -13.86328,-13.35273 -17.51378,-16.01372 -36.41128,-26.54155 -7.59589,-4.23169 -24.38823,-9.57632 -35.29703,-11.23427 -14.76482,-2.244 -16.13009,-2.34409 -15.66165,-1.14815 0.23334,0.59571 16.27747,27.18311 35.65362,59.08311 19.37615,31.9 35.40635,58.29742 35.62266,58.66093 0.21632,0.36351 -6.02098,4.15355 -13.86066,8.42232 -45.71425,24.89176 -77.81993,47.68837 -82.91694,58.87509 -2.01037,4.41227 4.96515,11.97209 28.16297,30.52207 39.04412,31.22137 69.30454,64.21314 87.61234,95.52034 3.74768,6.4087 3.99568,6.61968 6.88766,5.85966 1.65,-0.43362 5.77688,-0.80461 9.17084,-0.82441 5.17374,-0.0302 6.58512,0.35341 8.73469,2.37393 3.44098,3.23441 4.08782,7.61572 2.20778,14.95423 -1.71521,6.69514 -5.94071,15.74497 -7.61161,16.30194 -0.68186,0.22729 -0.3518,2.40977 0.92619,6.1243 7.50138,21.80316 10.67379,52.08455 8.01435,76.49901 -4.97114,45.63653 -23.57759,83.1845 -60.53455,122.15922 -9.76624,10.29945 -9.8363,10.4079 -4.90769,7.59601 2.75,-1.56893 6.35,-3.58693 8,-4.48442 z m 49.07143,-72.63165 c -1.90092,-1.90092 -1.89439,-1.71986 -0.20786,-5.75629 1.50691,-3.60654 5.45896,-6.67228 8.60125,-6.67228 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.78362,4.07352 -7.02857,1.82857 z m 5.35599,-4.06343 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.33399,344.93399 c -0.75468,-0.75468 0.2821,-2.48892 3.55,-5.93815 l 4.61601,-4.87213 2.67399,2.55242 c 1.74439,1.66508 4.17791,2.71325 7,3.01508 4.08637,0.43703 4.61697,0.18254 9.57848,-4.59416 9.39074,-9.04095 10.97032,-13.7069 7.34365,-21.69251 -3.20153,-7.04948 -13.41872,-11.38886 -18.6873,-7.93676 -1.42029,0.93062 -2.70786,1.54357 -2.86127,1.36212 -0.1534,-0.18144 -1.07525,-2.03768 -2.04856,-4.12497 -3.59128,-7.70162 -14.99389,-12.70765 -28.93049,-12.70119 -6.11397,0.003 -8.81063,0.45629 -11.13207,1.87192 -3.35525,2.04606 -8.47575,9.51271 -10.50694,15.3211 -0.71102,2.03322 -1.66103,3.46916 -2.11113,3.19098 -2.87732,-1.77828 2.32601,-12.71015 9.26833,-19.47217 6.7159,-6.5415 14.05807,-9.26104 23.41331,-8.67228 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 6.27233,3.68716 9.07537,7.83644 9.60452,14.21735 1.48246,17.87646 -21.53297,34.04388 -38.05786,26.73413 l -4.54418,-2.0101 -2.78066,2.90238 c -3.0822,3.21713 -3.52971,3.37914 -5.07248,1.83637 z m 42.35862,-16.36365 c 5.84497,-8.46217 5.29028,-16.04117 -1.59821,-21.83745 -2.85798,-2.40484 -12.61998,-5.54064 -13.74528,-4.41534 -0.29861,0.29861 1.26278,1.46413 3.46976,2.59005 4.7645,2.43067 7.55707,6.06113 9.11627,11.85157 1.58119,5.87209 0.0544,10.82594 -5.18606,16.82739 l -4.24909,4.86606 4.5,-2.63005 c 2.475,-1.44653 5.93668,-4.71003 7.69261,-7.25223 z M 568.4956,290.99289 c -2.13989,-3.46242 -20.21929,-6.86701 -21.91301,-4.12652 -0.4929,0.79752 1.16994,1.14661 5.60839,1.1774 5.00431,0.0347 11.10665,1.43841 16.61804,3.82255 0.16996,0.0735 0.0289,-0.31952 -0.31342,-0.87343 z M 426.76289,559.62451 c 6.19458,-3.10978 14.51958,-7.74046 18.5,-10.2904 8.01661,-5.13562 20.1386,-16.30333 22.37709,-20.6155 1.34825,-2.59723 1.22791,-3.19312 -1.81749,-9 -4.26345,-8.12944 -24.70814,-28.76424 -42.32249,-42.71604 -7.15,-5.6633 -16.21895,-13.15716 -20.15323,-16.65303 l -7.15322,-6.35611 -0.48374,47.75328 c -0.46038,45.44709 -1.37508,61.10281 -4.23595,72.50144 l -0.68262,2.71976 12.35438,-5.84463 c 6.79491,-3.21455 17.42268,-8.389 23.61727,-11.49877 z m -19.19146,-47.19594 c -1.90092,-1.90092 -1.89439,-1.71986 -0.20786,-5.75629 1.50691,-3.60654 5.45896,-6.67228 8.60125,-6.67228 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.78362,4.07352 -7.02857,1.82857 z m 5.35599,-4.06343 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z m 236.62835,-56.88845 c 0.91789,-6.12094 -0.29582,-13.21674 -2.6661,-15.58702 -1.38044,-1.38044 -3.10293,-1.8991 -5.78195,-1.74103 l -3.81578,0.22515 4.83965,10.0631 c 2.66181,5.53471 4.84613,10.65217 4.85403,11.37213 0.0332,3.02403 1.95202,-0.21038 2.57015,-4.33233 z m -493.0993,-1.51583 C 185.58253,447.78239 210.22003,446 211.20647,446 212.90671,446 213,443.45837 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -10.01317,-0.90796 -19.16961,-6.13847 -22.75187,-12.99672 -2.51795,-4.82065 -3.43082,-12.3734 -2.38596,-19.74062 2.58598,-18.23352 12.0427,-31.39785 25.63217,-35.68155 L 213,277.63476 l 0,-78.42867 0,-78.42867 3.25,0.55641 c 1.7875,0.30603 42.76307,4.9164 91.05682,10.24528 l 87.80682,9.68885 10.19318,-9.92893 C 410.91307,125.87811 417.975,119.28151 421,116.67991 l 5.5,-4.73019 -105.5,0.29106 -105.5,0.29106 -10.5,2.28866 c -11.35512,2.47505 -12.71557,2.8907 -24,7.33244 -12.32857,4.85275 -23.60829,10.9727 -32.35883,17.55672 -10.35935,7.79449 -26.89589,24.81007 -32.14738,33.07863 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.59297 c 3.182846,-0.32614 29.617396,-2.37537 58.743456,-4.55385 z M 97.571429,392.42857 c -1.900923,-1.90092 -1.894385,-1.71986 -0.207861,-5.75629 C 98.870478,383.06574 102.82253,380 105.96482,380 c 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.783625,4.07352 -7.028571,1.82857 z m 5.355991,-4.06343 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.7747 2.70239,-14.82212 8.89429,-23.19493 6.02555,-8.14788 11.01016,-10.90233 19.67143,-10.87028 7.13663,0.0264 12.95479,2.43105 16.72594,6.91281 4.92566,5.85381 4.91966,12.78416 -0.0201,23.23478 -7.49758,15.86193 -22.71169,24.85237 -34.58775,20.43884 z m 14.24314,-3.35994 c 2.61949,-1.33649 4.36033,-3.59066 7.38843,-9.56714 9.1112,-17.98249 4.76426,-31.66701 -10.06249,-31.67757 -4.62449,-0.003 -5.72095,0.42434 -9.24031,3.60387 -2.19626,1.98419 -5.42651,6.51908 -7.17834,10.07754 -4.06406,8.25529 -4.62129,18.39472 -1.26315,22.9843 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 17.30648,-17.93356 c 5.67292,-12.12275 4.01862,-19.37901 -5.50748,-24.15753 -5.73982,-2.87923 -8.42255,-2.36904 -3.50945,0.66742 7.4835,4.62506 9.71945,16.75475 5.24021,28.42745 -0.36887,0.96127 -0.37389,1.74777 -0.0112,1.74777 0.36274,0 2.06728,-3.0083 3.78787,-6.68511 z m 487.49748,219.7162 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 213,315 l 0,-29 -5.54966,0 c -7.04231,0 -10.55266,1.83492 -14.50775,7.58344 -6.05028,8.79378 -9.16096,22.80624 -7.50873,33.82405 1.34871,8.99389 11.53438,16.56268 22.31614,16.58274 l 5.25,0.01 0,-29 z m 0,-32 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3444"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#6b6239"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.59573,-35.87188 c 30.06642,-15.57391 52.50867,-31.44354 72.67705,-51.39227 26.6551,-26.3648 43.0079,-55.64296 49.58217,-88.77224 3.00691,-15.15253 3.22514,-42.39596 0.45842,-57.22776 -4.22092,-22.62746 -14.24878,-46.6868 -28.34219,-68 -17.87958,-27.03895 -40.53405,-50.54133 -77.36028,-80.25572 -26.92802,-21.7277 -39.26485,-38.62203 -39.33659,-53.86841 -0.0186,-3.95875 0.84943,-6.89162 3.81685,-12.89578 8.05891,-16.30609 32.55791,-36.59783 73.0909,-60.53884 C 562.17648,222.181 566,219.68022 566,219.38395 566,217.74657 497.37486,106 496.36932,106 c -1.27216,0 -19.47172,10.8189 -26.92603,16.00644 -22.38577,15.5785 -49.79978,40.41814 -65.10761,58.99356 -14.69025,17.826 -31.28356,45.79776 -37.37265,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 3.60858,17.60787 13.62555,40.51795 25.35934,58 16.15345,24.06685 28.6546,37.04431 59.6634,61.93665 21.74299,17.4542 40.47403,35.97895 48.31939,47.78727 7.66467,11.53635 10.05851,18.24279 10.09302,28.27608 0.0262,7.61674 -0.31581,9.21201 -3.29135,15.35202 -7.40771,15.28571 -27.45472,31.76455 -56.19696,46.19444 -6.28326,3.15448 -11.58838,5.87377 -11.78917,6.04288 C 430.30408,595.28909 483.53042,707 484.69469,707 c 0.35158,0 8.5516,-4.09848 18.22227,-9.10773 z m -262.32414,-6.94016 c 40.60543,-4.1345 80.65086,-33.21295 101.80235,-73.92239 7.03646,-13.54279 11.71357,-25.71877 14.99234,-39.02972 5.74514,-23.32375 5.88166,-25.37321 6.34009,-95.1734 l 0.42475,-64.67341 -5.44735,-7.82659 C 343.41312,388.35565 333.01941,364.14978 327.28379,337.14983 324.81474,325.527 324.59266,322.59211 324.54829,301 c -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.07104 363.53198,171 362.95209,171 c -0.57636,0 -26.33886,-2.92478 -57.25,-6.49952 -30.91115,-3.57474 -56.75563,-6.49974 -57.43218,-6.5 -0.9681,-3.8e-4 -1.29512,40.73232 -1.53544,191.24952 -0.34226,214.37002 0.25764,197.61148 -7.67357,214.36849 -6.53038,13.79736 -13.61165,19.36091 -24.66168,19.37593 -6.34932,0.009 -9.85025,-1.70209 -13.29254,-6.4954 C 192.8683,565.02728 189.46338,547.7129 187.83282,509 c -0.63706,-15.125 -1.23221,-27.60966 -1.32257,-27.74368 -0.0904,-0.13403 -21.05462,1.37028 -46.58727,3.34291 -64.202194,4.96019 -62.683136,4.82759 -63.388611,5.53307 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 124.74334,-4.56444 c 11.38187,-10.23328 19.28542,-13.96675 27.82894,-13.14583 7.55858,0.72629 10.36908,3.96585 10.22436,11.78531 L 403.27892,691 l 17.825,0 17.82501,0 -1.86016,-4.25 c -3.56109,-8.13622 -46.87397,-99.88853 -47.4038,-100.41836 -0.29343,-0.29344 -1.0171,1.4244 -1.60813,3.81742 -2.82248,11.42776 -8.72549,27.68343 -13.96514,38.4571 -9.30755,19.13799 -18.44085,31.85584 -34.57443,48.14384 l -14.1149,14.25 17.40188,0 17.40189,0 5.13002,-4.61233 z m 28.65826,2.86233 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.24331,-2.27095 -10.77137,1e-4 -18.02199,6.26967 -6.5568,5.66963 -6.4845,5.71856 8.45031,5.71856 12.23992,0 13.54915,-0.16916 13.54411,-1.75 z m 5.80822,-3.52553 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24233,-22.09789 6.78515,-9.90276 7.11532,-189.80047 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.53622,-9.64008 -2.10755,-13.47795 -2.58061,-17.33517 -11.51256,-37.84393 -24.44061,-56.11843 -5.49251,-7.76396 -25.52209,-26.93338 -33.44982,-32.01334 -3.33913,-2.13965 -8.3965,-5.38669 -11.23862,-7.21563 -12.31541,-7.92516 -31.40127,-13.68119 -54.5355,-16.44716 -2.09294,-0.25024 -3.13834,9.9e-4 -2.8687,0.6894 0.23334,0.59571 16.24199,27.11357 35.57478,58.92858 19.33278,31.81501 35.2487,58.23843 35.36869,58.71871 0.12,0.48027 -8.55682,5.74987 -19.28182,11.7102 -43.11327,23.95988 -72.30068,45.01239 -77.14445,55.64331 -2.03122,4.45804 4.86733,11.94933 28.14445,30.56272 39.21566,31.35854 69.36416,64.32605 88.09693,96.33434 3.24592,5.54625 3.5416,5.7788 6.40307,5.03601 1.65,-0.42832 5.77688,-0.79496 9.17084,-0.81476 5.17374,-0.0302 6.58512,0.35341 8.73469,2.37393 3.44098,3.23441 4.08782,7.61572 2.20778,14.95423 -1.71521,6.69514 -5.94071,15.74497 -7.61161,16.30194 -0.68186,0.22729 -0.3518,2.40977 0.92619,6.1243 1.09206,3.17414 3.10824,10.81982 4.4804,16.99039 8.24329,37.07 4.96315,75.89868 -9.39213,111.1795 -9.87954,24.28082 -23.54516,44.63268 -46.33161,69.00044 -10.80882,11.55891 -11.01658,11.86448 -6.18455,9.09601 2.75,-1.57559 6.35,-3.59903 8,-4.49652 z m 49.07143,-72.63165 c -1.90092,-1.90092 -1.89439,-1.71986 -0.20786,-5.75629 1.50691,-3.60654 5.45896,-6.67228 8.60125,-6.67228 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.78362,4.07352 -7.02857,1.82857 z m 5.35599,-4.06343 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.33399,344.93399 c -0.75468,-0.75468 0.2821,-2.48892 3.55,-5.93815 l 4.61601,-4.87213 2.67399,2.55242 c 1.74439,1.66508 4.17791,2.71325 7,3.01508 4.08637,0.43703 4.61697,0.18254 9.57848,-4.59416 9.39074,-9.04095 10.97032,-13.7069 7.34365,-21.69251 -3.20153,-7.04948 -13.41872,-11.38886 -18.6873,-7.93676 -1.42029,0.93062 -2.70786,1.54357 -2.86127,1.36212 -0.1534,-0.18144 -1.07525,-2.03768 -2.04856,-4.12497 -3.59128,-7.70162 -14.99389,-12.70765 -28.93049,-12.70119 -6.11397,0.003 -8.81063,0.45629 -11.13207,1.87192 -3.35525,2.04606 -8.47575,9.51271 -10.50694,15.3211 -0.71102,2.03322 -1.66103,3.46916 -2.11113,3.19098 -2.87732,-1.77828 2.32601,-12.71015 9.26833,-19.47217 6.7159,-6.5415 14.05807,-9.26104 23.41331,-8.67228 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 6.27233,3.68716 9.07537,7.83644 9.60452,14.21735 1.48246,17.87646 -21.53297,34.04388 -38.05786,26.73413 l -4.54418,-2.0101 -2.78066,2.90238 c -3.0822,3.21713 -3.52971,3.37914 -5.07248,1.83637 z m 42.35862,-16.36365 c 5.84497,-8.46217 5.29028,-16.04117 -1.59821,-21.83745 -2.85798,-2.40484 -12.61998,-5.54064 -13.74528,-4.41534 -0.29861,0.29861 1.26278,1.46413 3.46976,2.59005 4.7645,2.43067 7.55707,6.06113 9.11627,11.85157 1.58119,5.87209 0.0544,10.82594 -5.18606,16.82739 l -4.24909,4.86606 4.5,-2.63005 c 2.475,-1.44653 5.93668,-4.71003 7.69261,-7.25223 z M 568.4956,290.99289 c -2.13989,-3.46242 -20.21929,-6.86701 -21.91301,-4.12652 -0.4929,0.79752 1.16994,1.14661 5.60839,1.1774 5.00431,0.0347 11.10665,1.43841 16.61804,3.82255 0.16996,0.0735 0.0289,-0.31952 -0.31342,-0.87343 z M 427,559.53327 c 19.74213,-9.86312 36.29651,-22.40462 40.62693,-30.77873 1.36666,-2.64282 1.253,-3.20227 -1.83502,-9.03247 -4.55169,-8.59364 -21.7874,-26.14146 -40.28935,-41.01895 -8.25141,-6.63499 -18.21874,-14.9065 -22.14963,-18.38114 l -7.14707,-6.31753 -0.49805,47.74778 c -0.47314,45.35962 -1.39807,61.19687 -4.23395,72.49592 l -0.68262,2.71976 12.35438,-5.84463 C 409.94053,567.90873 420.675,562.69323 427,559.53327 z m -19.42857,-47.1047 c -1.90092,-1.90092 -1.89439,-1.71986 -0.20786,-5.75629 1.50691,-3.60654 5.45896,-6.67228 8.60125,-6.67228 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.78362,4.07352 -7.02857,1.82857 z m 5.35599,-4.06343 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z m 236.62835,-56.88845 c 0.91789,-6.12094 -0.29582,-13.21674 -2.6661,-15.58702 -1.37848,-1.37848 -3.1033,-1.89908 -5.77051,-1.7417 l -3.80433,0.22447 4.84258,10.26628 c 2.66343,5.64645 4.84259,10.76421 4.84259,11.37279 0,2.90224 1.96276,-0.58039 2.55577,-4.53482 z m -493.1123,-1.50584 C 185.56238,447.78688 210.19988,446 211.19347,446 212.91086,446 213,443.58908 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -10.01317,-0.90796 -19.16961,-6.13847 -22.75187,-12.99672 -2.51795,-4.82065 -3.43082,-12.3734 -2.38596,-19.74062 2.58598,-18.23352 12.0427,-31.39785 25.63217,-35.68155 L 213,277.63476 l 0,-78.37866 0,-78.37865 4.25,0.59413 c 3.21266,0.44911 131.93497,14.74366 172.08336,19.10977 l 5.83337,0.63437 10.16663,-9.90281 C 410.92501,125.86636 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.31381 -106,0.3138 -11,2.63169 c -13.36319,3.19706 -15.58591,3.87857 -23.66524,7.25601 -12.1195,5.06638 -23.02066,11.07785 -31.15254,17.17915 -10.25356,7.69319 -26.92571,24.86298 -32.18843,33.14922 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.58299 c 3.182846,-0.32065 29.611546,-2.36988 58.730456,-4.55384 z M 97.571429,392.42857 c -1.900923,-1.90092 -1.894385,-1.71986 -0.207861,-5.75629 C 98.870478,383.06574 102.82253,380 105.96482,380 c 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.783625,4.07352 -7.028571,1.82857 z m 5.355991,-4.06343 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.7747 2.70239,-14.82212 8.89429,-23.19493 6.02555,-8.14788 11.01016,-10.90233 19.67143,-10.87028 7.13663,0.0264 12.95479,2.43105 16.72594,6.91281 4.92566,5.85381 4.91966,12.78416 -0.0201,23.23478 -7.49758,15.86193 -22.71169,24.85237 -34.58775,20.43884 z m 14.24314,-3.35994 c 2.61949,-1.33649 4.36033,-3.59066 7.38843,-9.56714 9.1112,-17.98249 4.76426,-31.66701 -10.06249,-31.67757 -4.62449,-0.003 -5.72095,0.42434 -9.24031,3.60387 -2.19626,1.98419 -5.42651,6.51908 -7.17834,10.07754 -4.06406,8.25529 -4.62129,18.39472 -1.26315,22.9843 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 17.30648,-17.93356 c 5.67292,-12.12275 4.01862,-19.37901 -5.50748,-24.15753 -5.73982,-2.87923 -8.42255,-2.36904 -3.50945,0.66742 7.4835,4.62506 9.71945,16.75475 5.24021,28.42745 -0.36887,0.96127 -0.37389,1.74777 -0.0112,1.74777 0.36274,0 2.06728,-3.0083 3.78787,-6.68511 z m 487.49748,219.7162 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 213,315 l 0,-29 -5.54966,0 c -7.04231,0 -10.55266,1.83492 -14.50775,7.58344 -6.05028,8.79378 -9.16096,22.80624 -7.50873,33.82405 1.34871,8.99389 11.53438,16.56268 22.31614,16.58274 l 5.25,0.01 0,-29 z m 0,-32 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3442"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#66613e"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.59573,-35.87188 c 30.06642,-15.57391 52.50867,-31.44354 72.67705,-51.39227 26.6551,-26.3648 43.0079,-55.64296 49.58217,-88.77224 3.00691,-15.15253 3.22514,-42.39596 0.45842,-57.22776 -4.22092,-22.62746 -14.24878,-46.6868 -28.34219,-68 -17.87958,-27.03895 -40.53405,-50.54133 -77.36028,-80.25572 -26.92802,-21.7277 -39.26485,-38.62203 -39.33659,-53.86841 -0.0186,-3.95875 0.84943,-6.89162 3.81685,-12.89578 8.05891,-16.30609 32.55791,-36.59783 73.0909,-60.53884 C 562.17648,222.181 566,219.68022 566,219.38395 566,217.74657 497.37486,106 496.36932,106 c -1.27216,0 -19.47172,10.8189 -26.92603,16.00644 -22.38577,15.5785 -49.79978,40.41814 -65.10761,58.99356 -14.69025,17.826 -31.28356,45.79776 -37.37265,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 3.60858,17.60787 13.62555,40.51795 25.35934,58 16.15345,24.06685 28.6546,37.04431 59.6634,61.93665 21.74299,17.4542 40.47403,35.97895 48.31939,47.78727 7.66467,11.53635 10.05851,18.24279 10.09302,28.27608 0.0262,7.61674 -0.31581,9.21201 -3.29135,15.35202 -7.40771,15.28571 -27.45472,31.76455 -56.19696,46.19444 -6.28326,3.15448 -11.58838,5.87377 -11.78917,6.04288 C 430.30408,595.28909 483.53042,707 484.69469,707 c 0.35158,0 8.5516,-4.09848 18.22227,-9.10773 z m -262.32414,-6.94016 c 40.60543,-4.1345 80.65086,-33.21295 101.80235,-73.92239 7.03646,-13.54279 11.71357,-25.71877 14.99234,-39.02972 5.74514,-23.32375 5.88166,-25.37321 6.34009,-95.1734 l 0.42475,-64.67341 -5.44735,-7.82659 C 343.41312,388.35565 333.01941,364.14978 327.28379,337.14983 324.81474,325.527 324.59266,322.59211 324.54829,301 c -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.07104 363.53198,171 362.95209,171 c -0.57636,0 -26.33886,-2.92478 -57.25,-6.49952 -30.91115,-3.57474 -56.75563,-6.49974 -57.43218,-6.5 -0.9681,-3.8e-4 -1.29512,40.73232 -1.53544,191.24952 -0.34226,214.37002 0.25764,197.61148 -7.67357,214.36849 -6.53038,13.79736 -13.61165,19.36091 -24.66168,19.37593 -6.34932,0.009 -9.85025,-1.70209 -13.29254,-6.4954 C 192.8683,565.02728 189.46338,547.7129 187.83282,509 c -0.63706,-15.125 -1.23221,-27.60966 -1.32257,-27.74368 -0.0904,-0.13403 -21.05462,1.37028 -46.58727,3.34291 -64.202194,4.96019 -62.683136,4.82759 -63.388611,5.53307 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 124.74334,-4.56444 c 11.38187,-10.23328 19.28542,-13.96675 27.82894,-13.14583 7.55858,0.72629 10.36908,3.96585 10.22436,11.78531 L 403.27892,691 l 17.825,0 17.82501,0 -1.86016,-4.25 c -3.56109,-8.13622 -46.87397,-99.88853 -47.4038,-100.41836 -0.29343,-0.29344 -1.0171,1.4244 -1.60813,3.81742 -2.82248,11.42776 -8.72549,27.68343 -13.96514,38.4571 -9.30755,19.13799 -18.44085,31.85584 -34.57443,48.14384 l -14.1149,14.25 17.40188,0 17.40189,0 5.13002,-4.61233 z m 28.65826,2.86233 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.24331,-2.27095 -10.77137,1e-4 -18.02199,6.26967 -6.5568,5.66963 -6.4845,5.71856 8.45031,5.71856 12.23992,0 13.54915,-0.16916 13.54411,-1.75 z m 5.80822,-3.52553 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24233,-22.09789 6.78515,-9.90276 7.11532,-189.80047 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.53622,-9.64008 -2.10755,-13.47795 -2.58061,-17.33517 -11.51256,-37.84393 -24.44061,-56.11843 -5.49251,-7.76396 -25.52209,-26.93338 -33.44982,-32.01334 -3.33913,-2.13965 -8.3965,-5.38669 -11.23862,-7.21563 -12.31541,-7.92516 -31.40127,-13.68119 -54.5355,-16.44716 -2.09294,-0.25024 -3.13834,9.9e-4 -2.8687,0.6894 0.23334,0.59571 16.24199,27.11357 35.57478,58.92858 19.33278,31.81501 35.2487,58.23843 35.36869,58.71871 0.12,0.48027 -8.55682,5.74987 -19.28182,11.7102 -43.11327,23.95988 -72.30068,45.01239 -77.14445,55.64331 -2.03122,4.45804 4.86733,11.94933 28.14445,30.56272 39.21566,31.35854 69.36416,64.32605 88.09693,96.33434 3.24592,5.54625 3.5416,5.7788 6.40307,5.03601 1.65,-0.42832 5.77688,-0.79496 9.17084,-0.81476 5.17374,-0.0302 6.58512,0.35341 8.73469,2.37393 3.44098,3.23441 4.08782,7.61572 2.20778,14.95423 -1.71521,6.69514 -5.94071,15.74497 -7.61161,16.30194 -0.68186,0.22729 -0.3518,2.40977 0.92619,6.1243 1.09206,3.17414 3.10824,10.81982 4.4804,16.99039 8.24329,37.07 4.96315,75.89868 -9.39213,111.1795 -9.87954,24.28082 -23.54516,44.63268 -46.33161,69.00044 -10.80882,11.55891 -11.01658,11.86448 -6.18455,9.09601 2.75,-1.57559 6.35,-3.59903 8,-4.49652 z m 49.07143,-72.63165 c -1.90092,-1.90092 -1.89439,-1.71986 -0.20786,-5.75629 1.50691,-3.60654 5.45896,-6.67228 8.60125,-6.67228 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.78362,4.07352 -7.02857,1.82857 z m 5.35599,-4.06343 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.33399,344.93399 c -0.75468,-0.75468 0.2821,-2.48892 3.55,-5.93815 l 4.61601,-4.87213 2.67399,2.55242 c 1.74439,1.66508 4.17791,2.71325 7,3.01508 4.08637,0.43703 4.61697,0.18254 9.57848,-4.59416 9.39074,-9.04095 10.97032,-13.7069 7.34365,-21.69251 -3.20153,-7.04948 -13.41872,-11.38886 -18.6873,-7.93676 -1.42029,0.93062 -2.70786,1.54357 -2.86127,1.36212 -0.1534,-0.18144 -1.07525,-2.03768 -2.04856,-4.12497 -3.59128,-7.70162 -14.99389,-12.70765 -28.93049,-12.70119 -6.11397,0.003 -8.81063,0.45629 -11.13207,1.87192 -3.35525,2.04606 -8.47575,9.51271 -10.50694,15.3211 -0.71102,2.03322 -1.66103,3.46916 -2.11113,3.19098 -2.87732,-1.77828 2.32601,-12.71015 9.26833,-19.47217 6.7159,-6.5415 14.05807,-9.26104 23.41331,-8.67228 4.37993,0.27565 8.52271,1.22119 11.06821,2.52621 5.13855,2.6344 10.83271,8.88523 12.38865,13.59979 0.65904,1.99689 1.40418,3.63071 1.65588,3.63071 0.25169,0 1.6595,-0.7875 3.12846,-1.75 1.90509,-1.24826 4.6904,-1.75 9.71482,-1.75 5.88598,0 7.81411,0.45272 11.72863,2.75386 6.27233,3.68716 9.07537,7.83644 9.60452,14.21735 1.48246,17.87646 -21.53297,34.04388 -38.05786,26.73413 l -4.54418,-2.0101 -2.78066,2.90238 c -3.0822,3.21713 -3.52971,3.37914 -5.07248,1.83637 z m 36.94057,-10.41746 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.7367,-5.49249 -5.57904,-10.44348 -12.11175,-12.38348 -8.61074,-2.55712 -10.42366,-1.4075 -3.2991,2.09205 5.65671,2.77855 8.66507,8.1335 8.68688,15.46284 0.0174,5.84936 -0.98019,8.01171 -6.33084,13.72251 -3.99899,4.26816 -2.11467,4.14669 3.62185,-0.23347 z m -34.10458,-44.52489 c -1.28152,-1.068 -3.98152,-2.40052 -6,-2.96115 C 556.45686,285.72142 547.30196,285.7024 546.5,287 c -0.38615,0.6248 1.74913,1.0156 5.69098,1.04159 3.61755,0.0239 8.44206,0.83997 11.30902,1.91306 6.34351,2.37435 6.47621,2.37568 3.66998,0.037 z M 427,559.53327 c 19.74213,-9.86312 36.29651,-22.40462 40.62693,-30.77873 1.36666,-2.64282 1.253,-3.20227 -1.83502,-9.03247 -4.55169,-8.59364 -21.7874,-26.14146 -40.28935,-41.01895 -8.25141,-6.63499 -18.21874,-14.9065 -22.14963,-18.38114 l -7.14707,-6.31753 -0.49805,47.74778 c -0.47314,45.35962 -1.39807,61.19687 -4.23395,72.49592 l -0.68262,2.71976 12.35438,-5.84463 C 409.94053,567.90873 420.675,562.69323 427,559.53327 z m -19.42857,-47.1047 c -1.90092,-1.90092 -1.89439,-1.71986 -0.20786,-5.75629 1.50691,-3.60654 5.45896,-6.67228 8.60125,-6.67228 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.78362,4.07352 -7.02857,1.82857 z m 5.35599,-4.06343 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z m 236.62835,-56.88845 c 0.91789,-6.12094 -0.29582,-13.21674 -2.6661,-15.58702 -1.37848,-1.37848 -3.1033,-1.89908 -5.77051,-1.7417 l -3.80433,0.22447 4.84258,10.26628 c 2.66343,5.64645 4.84259,10.76421 4.84259,11.37279 0,2.90224 1.96276,-0.58039 2.55577,-4.53482 z m -493.1123,-1.50584 C 185.56238,447.78688 210.19988,446 211.19347,446 212.91086,446 213,443.58908 213,397.13889 l 0,-48.86111 -5.86341,-0.53168 c -10.01317,-0.90796 -19.16961,-6.13847 -22.75187,-12.99672 -2.51795,-4.82065 -3.43082,-12.3734 -2.38596,-19.74062 2.58598,-18.23352 12.0427,-31.39785 25.63217,-35.68155 L 213,277.63476 l 0,-78.37866 0,-78.37865 4.25,0.59413 c 3.21266,0.44911 131.93497,14.74366 172.08336,19.10977 l 5.83337,0.63437 10.16663,-9.90281 C 410.92501,125.86636 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.31381 -106,0.3138 -11,2.63169 c -13.36319,3.19706 -15.58591,3.87857 -23.66524,7.25601 -12.1195,5.06638 -23.02066,11.07785 -31.15254,17.17915 -10.25356,7.69319 -26.92571,24.86298 -32.18843,33.14922 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.58299 c 3.182846,-0.32065 29.611546,-2.36988 58.730456,-4.55384 z M 97.571429,392.42857 c -1.900923,-1.90092 -1.894385,-1.71986 -0.207861,-5.75629 C 98.870478,383.06574 102.82253,380 105.96482,380 c 1.67002,0 2.03518,0.64592 2.03518,3.6 0,2.76078 -0.79259,4.39259 -3.4,7 -3.82381,3.82381 -4.783625,4.07352 -7.028571,1.82857 z m 5.355991,-4.06343 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 136.6838,244.60839 C 129.07106,241.77924 126,237.03021 126,228.08717 c 0,-7.7747 2.70239,-14.82212 8.89429,-23.19493 6.02555,-8.14788 11.01016,-10.90233 19.67143,-10.87028 7.13663,0.0264 12.95479,2.43105 16.72594,6.91281 4.92566,5.85381 4.91966,12.78416 -0.0201,23.23478 -7.49758,15.86193 -22.71169,24.85237 -34.58775,20.43884 z m 14.24314,-3.35994 c 2.61949,-1.33649 4.36033,-3.59066 7.38843,-9.56714 9.1112,-17.98249 4.76426,-31.66701 -10.06249,-31.67757 -4.62449,-0.003 -5.72095,0.42434 -9.24031,3.60387 -2.19626,1.98419 -5.42651,6.51908 -7.17834,10.07754 -4.06406,8.25529 -4.62129,18.39472 -1.26315,22.9843 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 17.11361,-17.52141 c 4.23395,-9.04774 4.73992,-14.32314 1.79613,-18.72704 -1.29677,-1.93997 -4.44366,-4.54416 -7.06021,-5.84264 -5.44448,-2.70185 -8.75667,-2.44016 -4.08009,0.32236 6.71118,3.96439 9.69582,14.21944 6.91873,23.77232 -1.77494,6.10557 -1.87609,6.74796 -1.06257,6.74796 0.3039,0 1.8735,-2.82283 3.48801,-6.27296 z M 655.7309,443.03109 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 213,315 l 0,-29 -5.54966,0 c -7.04231,0 -10.55266,1.83492 -14.50775,7.58344 -6.05028,8.79378 -9.16096,22.80624 -7.50873,33.82405 1.34871,8.99389 11.53438,16.56268 22.31614,16.58274 l 5.25,0.01 0,-29 z m 0,-32 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3440"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#735e34"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.59573,-35.87188 c 30.06642,-15.57391 52.50867,-31.44354 72.67705,-51.39227 26.6551,-26.3648 43.0079,-55.64296 49.58217,-88.77224 3.00691,-15.15253 3.22514,-42.39596 0.45842,-57.22776 -4.22092,-22.62746 -14.24878,-46.6868 -28.34219,-68 -17.87958,-27.03895 -40.53405,-50.54133 -77.36028,-80.25572 -26.92802,-21.7277 -39.26485,-38.62203 -39.33659,-53.86841 -0.0186,-3.95875 0.84943,-6.89162 3.81685,-12.89578 8.05891,-16.30609 32.55791,-36.59783 73.0909,-60.53884 C 562.17648,222.181 566,219.68022 566,219.38395 566,217.74657 497.37486,106 496.36932,106 c -1.27216,0 -19.47172,10.8189 -26.92603,16.00644 -22.38577,15.5785 -49.79978,40.41814 -65.10761,58.99356 -14.69025,17.826 -31.28356,45.79776 -37.37265,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 3.60858,17.60787 13.62555,40.51795 25.35934,58 16.15345,24.06685 28.6546,37.04431 59.6634,61.93665 21.74299,17.4542 40.47403,35.97895 48.31939,47.78727 7.66467,11.53635 10.05851,18.24279 10.09302,28.27608 0.0262,7.61674 -0.31581,9.21201 -3.29135,15.35202 -7.40771,15.28571 -27.45472,31.76455 -56.19696,46.19444 -6.28326,3.15448 -11.58838,5.87377 -11.78917,6.04288 C 430.30408,595.28909 483.53042,707 484.69469,707 c 0.35158,0 8.5516,-4.09848 18.22227,-9.10773 z m -262.32414,-6.94016 c 40.60543,-4.1345 80.65086,-33.21295 101.80235,-73.92239 7.03646,-13.54279 11.71357,-25.71877 14.99234,-39.02972 5.74514,-23.32375 5.88166,-25.37321 6.34009,-95.1734 l 0.42475,-64.67341 -5.44735,-7.82659 C 343.41312,388.35565 333.01941,364.14978 327.28379,337.14983 324.81474,325.527 324.59266,322.59211 324.54829,301 c -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.07104 363.53198,171 362.95209,171 c -0.57636,0 -26.33886,-2.92478 -57.25,-6.49952 -30.91115,-3.57474 -56.75563,-6.49974 -57.43218,-6.5 -0.9681,-3.8e-4 -1.29512,40.73232 -1.53544,191.24952 -0.34226,214.37002 0.25764,197.61148 -7.67357,214.36849 -6.53038,13.79736 -13.61165,19.36091 -24.66168,19.37593 -6.34932,0.009 -9.85025,-1.70209 -13.29254,-6.4954 C 192.8683,565.02728 189.46338,547.7129 187.83282,509 c -0.63706,-15.125 -1.23221,-27.60966 -1.32257,-27.74368 -0.0904,-0.13403 -21.05462,1.37028 -46.58727,3.34291 -64.202194,4.96019 -62.683136,4.82759 -63.388611,5.53307 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 124.74334,-4.56444 c 11.38187,-10.23328 19.28542,-13.96675 27.82894,-13.14583 7.54524,0.725 10.34022,3.93981 10.23382,11.77102 l -0.0813,5.98714 17.80567,0 17.80568,0 -1.86016,-4.25 c -3.56109,-8.13622 -46.87397,-99.88853 -47.4038,-100.41836 -0.29343,-0.29344 -1.0171,1.4244 -1.60813,3.81742 -2.82248,11.42776 -8.72549,27.68343 -13.96514,38.4571 -9.30755,19.13799 -18.44085,31.85584 -34.57443,48.14384 l -14.1149,14.25 17.40188,0 17.40189,0 5.13002,-4.61233 z m 28.65826,2.86233 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.24331,-2.27095 -10.77137,1e-4 -18.02199,6.26967 -6.5568,5.66963 -6.4845,5.71856 8.45031,5.71856 12.23992,0 13.54915,-0.16916 13.54411,-1.75 z m 5.80822,-3.52553 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24233,-22.09789 6.78515,-9.90276 7.11532,-189.80047 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.53622,-9.64008 -2.10755,-13.47795 -2.58061,-17.33517 -11.51256,-37.84393 -24.44061,-56.11843 -5.49251,-7.76396 -25.52209,-26.93338 -33.44982,-32.01334 -3.33913,-2.13965 -8.3965,-5.38669 -11.23862,-7.21563 -12.31541,-7.92516 -31.40127,-13.68119 -54.5355,-16.44716 -2.09294,-0.25024 -3.13834,9.9e-4 -2.8687,0.6894 0.23334,0.59571 16.24199,27.11357 35.57478,58.92858 19.33278,31.81501 35.2487,58.23843 35.36869,58.71871 0.12,0.48027 -8.55682,5.74987 -19.28182,11.7102 -43.11327,23.95988 -72.30068,45.01239 -77.14445,55.64331 -2.03122,4.45804 4.86733,11.94933 28.14445,30.56272 39.21566,31.35854 69.36416,64.32605 88.09693,96.33434 3.24592,5.54625 3.5416,5.7788 6.40307,5.03601 1.65,-0.42832 5.80285,-0.79496 9.22856,-0.81476 5.49372,-0.0317 6.55436,0.28996 8.99013,2.72686 2.40446,2.40557 2.74976,3.50476 2.6702,8.5 -0.0983,6.17243 -5.31109,20.53459 -7.99907,22.03886 -1.20406,0.67383 -1.11993,1.66962 0.55142,6.52749 1.08472,3.1528 3.09489,10.78101 4.46705,16.95158 8.24329,37.07 4.96315,75.89868 -9.39213,111.1795 -9.87954,24.28082 -23.54516,44.63268 -46.33161,69.00044 -10.80882,11.55891 -11.01658,11.86448 -6.18455,9.09601 2.75,-1.57559 6.35,-3.59903 8,-4.49652 z m 48.98241,-72.72067 c -1.80729,-1.80729 -1.80543,-1.63069 -0.0612,-5.80525 1.49521,-3.57853 6.72157,-7.07722 9.16904,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.03225,4.53321 -8.02944,2.53601 z m 5.44501,-3.97441 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.28718,344.88718 c -0.69227,-0.69227 0.46147,-2.58204 3.59681,-5.89134 l 4.61601,-4.87213 2.67399,2.55242 c 1.74439,1.66508 4.17791,2.71325 7,3.01508 4.08637,0.43703 4.61697,0.18254 9.57848,-4.59416 9.39074,-9.04095 10.97032,-13.7069 7.34365,-21.69251 -3.20153,-7.04948 -13.41872,-11.38886 -18.6873,-7.93676 -1.42029,0.93062 -2.70786,1.54357 -2.86127,1.36212 -0.1534,-0.18144 -1.07525,-2.03768 -2.04856,-4.12497 -3.59128,-7.70162 -14.99389,-12.70765 -28.93049,-12.70119 -6.11397,0.003 -8.81063,0.45629 -11.13207,1.87192 -3.35525,2.04606 -8.47575,9.51271 -10.50694,15.3211 -1.33205,3.80911 -2.92949,4.1968 -2.92949,0.71098 0,-3.31787 4.88637,-11.84675 9.33727,-16.29764 6.78737,-6.78737 12.58956,-9.11416 22.66273,-9.08817 6.79559,0.0175 9.33066,0.46179 12.64255,2.21551 4.94988,2.62108 10.87142,9.25985 12.40547,13.90805 0.6089,1.84498 1.22805,3.35451 1.37589,3.35451 0.14785,0 1.74575,-0.73679 3.55089,-1.63731 9.93398,-4.95573 24.25666,-0.70981 29.00545,8.59859 9.35342,18.33422 -16.91793,42.06062 -36.65144,33.10093 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.62602,2.90172 -4.86078,3.90242 -6.05282,2.71038 z m 36.98738,-10.37065 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.7367,-5.49249 -5.57904,-10.44348 -12.11175,-12.38348 -8.61074,-2.55712 -10.42366,-1.4075 -3.2991,2.09205 5.65671,2.77855 8.66507,8.1335 8.68688,15.46284 0.0174,5.84936 -0.98019,8.01171 -6.33084,13.72251 -3.99899,4.26816 -2.11467,4.14669 3.62185,-0.23347 z m -34.10458,-44.52489 c -1.28152,-1.068 -3.98152,-2.40052 -6,-2.96115 C 556.45686,285.72142 547.30196,285.7024 546.5,287 c -0.38615,0.6248 1.74913,1.0156 5.69098,1.04159 3.61755,0.0239 8.44206,0.83997 11.30902,1.91306 6.34351,2.37435 6.47621,2.37568 3.66998,0.037 z M 427,559.53327 c 19.74213,-9.86312 36.29651,-22.40462 40.62693,-30.77873 1.36666,-2.64282 1.253,-3.20227 -1.83502,-9.03247 -4.55169,-8.59364 -21.7874,-26.14146 -40.28935,-41.01895 -8.25141,-6.63499 -18.21874,-14.9065 -22.14963,-18.38114 l -7.14707,-6.31753 -0.49805,47.74778 c -0.47314,45.35962 -1.39807,61.19687 -4.23395,72.49592 l -0.68262,2.71976 12.35438,-5.84463 C 409.94053,567.90873 420.675,562.69323 427,559.53327 z m -19.51759,-47.19372 c -1.80729,-1.80729 -1.80543,-1.63069 -0.0612,-5.80525 1.49521,-3.57853 6.72157,-7.07722 9.16904,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.03225,4.53321 -8.02944,2.53601 z m 5.44501,-3.97441 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z m 236.62835,-56.88845 c 0.91789,-6.12094 -0.29582,-13.21674 -2.6661,-15.58702 -1.37848,-1.37848 -3.1033,-1.89908 -5.77051,-1.7417 l -3.80433,0.22447 4.84258,10.26628 c 2.66343,5.64645 4.84259,10.76421 4.84259,11.37279 0,2.90224 1.96276,-0.58039 2.55577,-4.53482 z m -493.1123,-1.50584 C 185.56238,447.78688 210.19988,446 211.19347,446 212.91086,446 213,443.58921 213,397.14246 l 0,-48.85755 -6.03828,-0.63112 c -11.75867,-1.22903 -21.11523,-7.52885 -23.95313,-16.12777 -1.86906,-5.6633 -0.83055,-21.71555 1.85232,-28.6313 4.75301,-12.25202 12.48441,-20.21248 22.88909,-23.56723 l 5.25,-1.69273 0,-78.37866 0,-78.37865 4.25,0.59413 c 3.21266,0.44911 131.93497,14.74366 172.08336,19.10977 l 5.83337,0.63437 10.16663,-9.90281 C 410.92501,125.86636 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.31381 -106,0.3138 -11,2.63169 c -13.36319,3.19706 -15.58591,3.87857 -23.66524,7.25601 -12.1195,5.06638 -23.02066,11.07785 -31.15254,17.17915 -10.25356,7.69319 -26.92571,24.86298 -32.18843,33.14922 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.58299 c 3.182846,-0.32065 29.611546,-2.36988 58.730456,-4.55384 z m -58.961061,-57.6313 c -1.807291,-1.80729 -1.80543,-1.63069 -0.06119,-5.80525 1.495204,-3.57853 6.721571,-7.07722 9.169041,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.032251,4.53321 -8.029444,2.53601 z m 5.445011,-3.97441 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 138.1228,245.04835 c -10.79569,-2.71005 -15.16797,-14.91399 -10.12494,-28.26084 2.94604,-7.79696 11.15163,-18.19737 16.338,-20.70805 5.50009,-2.66255 14.58599,-2.75239 20.20551,-0.1998 4.50999,2.04861 9.13513,6.98324 10.08227,10.75692 1.75309,6.98488 -3.0557,20.02844 -10.50315,28.48919 -7.0396,7.99741 -17.60417,12.02961 -25.99769,9.92258 z m 12.80414,-3.7999 c 2.61949,-1.33649 4.36033,-3.59066 7.38843,-9.56714 9.1112,-17.98249 4.76426,-31.66701 -10.06249,-31.67757 -4.62449,-0.003 -5.72095,0.42434 -9.24031,3.60387 -2.19626,1.98419 -5.42651,6.51908 -7.17834,10.07754 -4.06406,8.25529 -4.62129,18.39472 -1.26315,22.9843 2.74722,3.75462 8.00429,6.32744 12.92892,6.32744 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 17.11361,-17.52141 c 4.23395,-9.04774 4.73992,-14.32314 1.79613,-18.72704 -1.29677,-1.93997 -4.44366,-4.54416 -7.06021,-5.84264 -5.44448,-2.70185 -8.75667,-2.44016 -4.08009,0.32236 6.71118,3.96439 9.69582,14.21944 6.91873,23.77232 -1.77494,6.10557 -1.87609,6.74796 -1.06257,6.74796 0.3039,0 1.8735,-2.82283 3.48801,-6.27296 z M 655.7309,443.03109 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 213,315 l 0,-29 -5.54966,0 c -7.04231,0 -10.55266,1.83492 -14.50775,7.58344 -6.05028,8.79378 -9.16096,22.80624 -7.50873,33.82405 1.34871,8.99389 11.53438,16.56268 22.31614,16.58274 l 5.25,0.01 0,-29 z m 0,-32 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3438"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#766228"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.59573,-35.87188 c 30.06642,-15.57391 52.50867,-31.44354 72.67705,-51.39227 26.6551,-26.3648 43.0079,-55.64296 49.58217,-88.77224 3.00691,-15.15253 3.22514,-42.39596 0.45842,-57.22776 -4.22092,-22.62746 -14.24878,-46.6868 -28.34219,-68 -17.87958,-27.03895 -40.53405,-50.54133 -77.36028,-80.25572 -26.92802,-21.7277 -39.26485,-38.62203 -39.33659,-53.86841 -0.0186,-3.95875 0.84943,-6.89162 3.81685,-12.89578 8.05891,-16.30609 32.55791,-36.59783 73.0909,-60.53884 C 562.17648,222.181 566,219.68022 566,219.38395 566,217.74657 497.37486,106 496.36932,106 c -1.27216,0 -19.47172,10.8189 -26.92603,16.00644 -22.38577,15.5785 -49.79978,40.41814 -65.10761,58.99356 -14.69025,17.826 -31.28356,45.79776 -37.37265,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 3.60858,17.60787 13.62555,40.51795 25.35934,58 16.15345,24.06685 28.6546,37.04431 59.6634,61.93665 21.74299,17.4542 40.47403,35.97895 48.31939,47.78727 7.66467,11.53635 10.05851,18.24279 10.09302,28.27608 0.0262,7.61674 -0.31581,9.21201 -3.29135,15.35202 -7.40771,15.28571 -27.45472,31.76455 -56.19696,46.19444 -6.28326,3.15448 -11.58838,5.87377 -11.78917,6.04288 C 430.30408,595.28909 483.53042,707 484.69469,707 c 0.35158,0 8.5516,-4.09848 18.22227,-9.10773 z m -262.32414,-6.94016 c 40.60543,-4.1345 80.65086,-33.21295 101.80235,-73.92239 7.03646,-13.54279 11.71357,-25.71877 14.99234,-39.02972 5.74514,-23.32375 5.88166,-25.37321 6.34009,-95.1734 l 0.42475,-64.67341 -5.44735,-7.82659 C 343.41312,388.35565 333.01941,364.14978 327.28379,337.14983 324.81474,325.527 324.59266,322.59211 324.54829,301 c -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.07104 363.53198,171 362.95209,171 c -0.57636,0 -26.33886,-2.92478 -57.25,-6.49952 -30.91115,-3.57474 -56.75563,-6.49974 -57.43218,-6.5 -0.9681,-3.8e-4 -1.29512,40.73232 -1.53544,191.24952 -0.34226,214.37002 0.25764,197.61148 -7.67357,214.36849 -6.53038,13.79736 -13.61165,19.36091 -24.66168,19.37593 -6.34932,0.009 -9.85025,-1.70209 -13.29254,-6.4954 C 192.8683,565.02728 189.46338,547.7129 187.83282,509 c -0.63706,-15.125 -1.23221,-27.60966 -1.32257,-27.74368 -0.0904,-0.13403 -21.05462,1.37028 -46.58727,3.34291 -64.202194,4.96019 -62.683136,4.82759 -63.388611,5.53307 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 124.74334,-4.56444 c 11.38187,-10.23328 19.28542,-13.96675 27.82894,-13.14583 7.54524,0.725 10.34022,3.93981 10.23382,11.77102 l -0.0813,5.98714 17.80567,0 17.80568,0 -1.86016,-4.25 c -3.56109,-8.13622 -46.87397,-99.88853 -47.4038,-100.41836 -0.29343,-0.29344 -1.0171,1.4244 -1.60813,3.81742 -2.82248,11.42776 -8.72549,27.68343 -13.96514,38.4571 -9.30755,19.13799 -18.44085,31.85584 -34.57443,48.14384 l -14.1149,14.25 17.40188,0 17.40189,0 5.13002,-4.61233 z m 28.65826,2.86233 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.47352,-2.39415 -10.05724,-0.43431 -18.02199,6.32557 -6.58525,5.58907 -6.47543,5.66266 8.45031,5.66266 12.23992,0 13.54915,-0.16916 13.54411,-1.75 z m 5.80822,-3.52553 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z M 602.5,671.06022 c 17.90311,-9.73818 38.50019,-30.16752 48.95893,-48.56022 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24233,-22.09789 6.78515,-9.90276 7.11532,-189.80047 0.20478,-111.57903 -0.0353,-164.02306 -0.77145,-168.5 -0.58782,-3.575 -1.53622,-9.64008 -2.10755,-13.47795 -2.58061,-17.33517 -11.51256,-37.84393 -24.44061,-56.11843 -5.49251,-7.76396 -25.52209,-26.93338 -33.44982,-32.01334 -3.33913,-2.13965 -8.3965,-5.38669 -11.23862,-7.21563 -12.31541,-7.92516 -31.40127,-13.68119 -54.5355,-16.44716 -2.09294,-0.25024 -3.13834,9.9e-4 -2.8687,0.6894 0.23334,0.59571 16.24199,27.11357 35.57478,58.92858 19.33278,31.81501 35.2487,58.23843 35.36869,58.71871 0.12,0.48027 -8.55682,5.74987 -19.28182,11.7102 -43.11327,23.95988 -72.30068,45.01239 -77.14445,55.64331 -2.03122,4.45804 4.86733,11.94933 28.14445,30.56272 39.21566,31.35854 69.36416,64.32605 88.09693,96.33434 3.24592,5.54625 3.5416,5.7788 6.40307,5.03601 1.65,-0.42832 5.80285,-0.79496 9.22856,-0.81476 5.49372,-0.0317 6.55436,0.28996 8.99013,2.72686 2.40446,2.40557 2.74976,3.50476 2.6702,8.5 -0.0983,6.17243 -5.31109,20.53459 -7.99907,22.03886 -1.20406,0.67383 -1.11993,1.66962 0.55142,6.52749 1.08472,3.1528 3.09489,10.78101 4.46705,16.95158 8.24329,37.07 4.96315,75.89868 -9.39213,111.1795 -9.87954,24.28082 -23.54516,44.63268 -46.33161,69.00044 -10.80882,11.55891 -11.01658,11.86448 -6.18455,9.09601 2.75,-1.57559 6.35,-3.59903 8,-4.49652 z m 48.98241,-72.72067 c -1.80729,-1.80729 -1.80543,-1.63069 -0.0612,-5.80525 1.49521,-3.57853 6.72157,-7.07722 9.16904,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.03225,4.53321 -8.02944,2.53601 z m 5.44501,-3.97441 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.28718,344.88718 c -0.69227,-0.69227 0.46147,-2.58204 3.59681,-5.89134 l 4.61601,-4.87213 2.63842,2.51834 c 1.55564,1.48483 4.29112,2.74 6.66557,3.05849 3.58867,0.48134 4.53305,0.11874 8.67342,-3.3302 C 596.62421,331.25004 601,324.56255 601,320.28872 c 0,-4.63344 -3.44864,-10.98282 -7.20654,-13.26813 -4.7643,-2.89735 -10.35644,-3.53695 -13.41312,-1.53414 -1.40463,0.92034 -2.67938,1.5249 -2.83279,1.34345 -0.1534,-0.18144 -1.07525,-2.03768 -2.04856,-4.12497 -1.7231,-3.69525 -6.80174,-7.85288 -12.99899,-10.64162 -1.65,-0.74249 -7.80144,-1.5668 -13.66987,-1.8318 -9.69768,-0.43791 -10.94037,-0.2892 -13.63851,1.63204 -3.36301,2.39468 -8.33587,9.8249 -10.26213,15.33321 -1.33205,3.80911 -2.92949,4.1968 -2.92949,0.71098 0,-3.31787 4.88637,-11.84675 9.33727,-16.29764 6.78737,-6.78737 12.58956,-9.11416 22.66273,-9.08817 6.79559,0.0175 9.33066,0.46179 12.64255,2.21551 4.94988,2.62108 10.87142,9.25985 12.40547,13.90805 0.6089,1.84498 1.22805,3.35451 1.37589,3.35451 0.14785,0 1.74575,-0.73679 3.55089,-1.63731 9.93398,-4.95573 24.25666,-0.70981 29.00545,8.59859 9.35342,18.33422 -16.91793,42.06062 -36.65144,33.10093 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.62602,2.90172 -4.86078,3.90242 -6.05282,2.71038 z m 36.98738,-10.37065 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.7367,-5.49249 -5.57904,-10.44348 -12.11175,-12.38348 -8.61074,-2.55712 -10.42366,-1.4075 -3.2991,2.09205 5.65671,2.77855 8.66507,8.1335 8.68688,15.46284 0.0174,5.84936 -0.98019,8.01171 -6.33084,13.72251 -3.99899,4.26816 -2.11467,4.14669 3.62185,-0.23347 z m -34.10458,-44.52489 c -1.28152,-1.068 -3.98152,-2.40052 -6,-2.96115 C 556.45686,285.72142 547.30196,285.7024 546.5,287 c -0.38615,0.6248 1.74913,1.0156 5.69098,1.04159 3.61755,0.0239 8.44206,0.83997 11.30902,1.91306 6.34351,2.37435 6.47621,2.37568 3.66998,0.037 z M 427,559.53327 c 19.74213,-9.86312 36.29651,-22.40462 40.62693,-30.77873 1.36666,-2.64282 1.253,-3.20227 -1.83502,-9.03247 -4.55169,-8.59364 -21.7874,-26.14146 -40.28935,-41.01895 -8.25141,-6.63499 -18.21874,-14.9065 -22.14963,-18.38114 l -7.14707,-6.31753 -0.49805,47.74778 c -0.47314,45.35962 -1.39807,61.19687 -4.23395,72.49592 l -0.68262,2.71976 12.35438,-5.84463 C 409.94053,567.90873 420.675,562.69323 427,559.53327 z m -19.51759,-47.19372 c -1.80729,-1.80729 -1.80543,-1.63069 -0.0612,-5.80525 1.49521,-3.57853 6.72157,-7.07722 9.16904,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.03225,4.53321 -8.02944,2.53601 z m 5.44501,-3.97441 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z m 236.62835,-56.88845 c 0.91266,-6.08608 -0.29179,-13.21271 -2.62785,-15.54877 C 645.67804,434.67804 643.61768,434 641.06957,434 l -3.93042,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.95043 4.93043,11.55901 0,2.90224 1.96276,-0.58039 2.55577,-4.53482 z m -493.1123,-1.50584 C 185.56238,447.78688 210.19988,446 211.19347,446 212.91086,446 213,443.58921 213,397.14246 l 0,-48.85755 -6.03828,-0.63112 c -11.75867,-1.22903 -21.11523,-7.52885 -23.95313,-16.12777 -1.86906,-5.6633 -0.83055,-21.71555 1.85232,-28.6313 4.75301,-12.25202 12.48441,-20.21248 22.88909,-23.56723 l 5.25,-1.69273 0,-78.37866 0,-78.37865 4.25,0.59413 c 3.21266,0.44911 131.93497,14.74366 172.08336,19.10977 l 5.83337,0.63437 10.16663,-9.90281 C 410.92501,125.86636 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.31381 -106,0.3138 -11,2.63169 c -13.36319,3.19706 -15.58591,3.87857 -23.66524,7.25601 -12.1195,5.06638 -23.02066,11.07785 -31.15254,17.17915 -10.25356,7.69319 -26.92571,24.86298 -32.18843,33.14922 -2.19659,3.45855 -5.41186,8.44562 -7.14507,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998409,9.20917 -2.073388,12.90736 -2.449251,120.80384 l -0.387732,111.30384 5.786987,-0.58299 c 3.182846,-0.32065 29.611546,-2.36988 58.730456,-4.55384 z m -58.961061,-57.6313 c -1.807291,-1.80729 -1.80543,-1.63069 -0.06119,-5.80525 1.495204,-3.57853 6.721571,-7.07722 9.169041,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.032251,4.53321 -8.029444,2.53601 z m 5.445011,-3.97441 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 138.1228,245.04835 c -10.79569,-2.71005 -15.16797,-14.91399 -10.12494,-28.26084 2.94604,-7.79696 11.15163,-18.19737 16.338,-20.70805 5.50009,-2.66255 14.58599,-2.75239 20.20551,-0.1998 4.50999,2.04861 9.13513,6.98324 10.08227,10.75692 1.75309,6.98488 -3.0557,20.02844 -10.50315,28.48919 -7.0396,7.99741 -17.60417,12.02961 -25.99769,9.92258 z m 12.80414,-3.7999 c 2.63272,-1.34323 4.36655,-3.60251 7.48124,-9.74845 8.98897,-17.73713 4.652,-31.48542 -9.93567,-31.49626 -7.63177,-0.006 -11.5139,3.23544 -16.76437,13.99626 -4.01621,8.23121 -4.50962,18.06981 -1.13706,22.67312 2.74886,3.75198 8.00686,6.32377 12.92892,6.32377 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 17.11361,-17.52141 c 4.23395,-9.04774 4.73992,-14.32314 1.79613,-18.72704 -1.29677,-1.93997 -4.44366,-4.54416 -7.06021,-5.84264 -5.44448,-2.70185 -8.75667,-2.44016 -4.08009,0.32236 6.71118,3.96439 9.69582,14.21944 6.91873,23.77232 -1.77494,6.10557 -1.87609,6.74796 -1.06257,6.74796 0.3039,0 1.8735,-2.82283 3.48801,-6.27296 z M 655.7309,443.03109 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 213,315 l 0,-29 -6.5,0 c -6.20105,0 -6.67601,0.17601 -10.32709,3.82709 -8.81545,8.81545 -13.67848,27.94971 -10.19261,40.10424 2.15484,7.51347 12.26281,14.04121 21.7697,14.0589 l 5.25,0.01 0,-29 z m 0,-32 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3436"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#746027"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.50427,-35.8488 c 9.62036,-4.99655 20.45773,-10.94924 24.08304,-13.22819 55.91434,-35.14906 88.24828,-76.91291 98.29309,-126.9594 3.2312,-16.09889 3.2312,-43.35663 0,-59.45552 -7.38495,-36.7942 -27.3397,-71.70164 -60.66881,-106.12973 -12.103,-12.50209 -25.3346,-24.33674 -44.60069,-39.89189 -26.8662,-21.69137 -39.28807,-38.67015 -39.32459,-53.75062 -0.0454,-18.7657 25.49737,-43.20005 76.89575,-73.55875 C 562.17648,222.181 566,219.6779 566,219.3788 566,217.71763 497.38952,106 496.36932,106 c -1.30776,0 -19.46486,10.83047 -27.21573,16.23382 -25.31568,17.64828 -47.87037,38.35665 -67.27315,61.76618 -12.17912,14.69416 -29.28496,44.08782 -34.91741,60 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 5.62859,27.46441 22.3263,58.1273 46.51081,85.41028 6.77034,7.63774 31.52817,30.18519 34.43554,31.36113 0.78298,0.31669 2.16052,1.28518 3.06118,2.1522 0.90067,0.86701 6.14472,5.27269 11.65344,9.7904 13.16235,10.79442 31.67513,29.95826 37.68464,39.00991 7.66334,11.54271 10.05504,18.24547 10.08954,28.27608 0.0428,12.43066 -3.46268,19.31536 -16.29764,32.00861 -11.17011,11.04677 -22.25748,18.69618 -41.11477,28.36591 -7.425,3.80743 -13.66428,7.05753 -13.86507,7.22244 C 430.3,595.28271 483.533,707 484.69469,707 c 0.35158,0 8.51044,-4.08809 18.13081,-9.08465 z m -262.23268,-6.96324 c 26.63477,-2.71199 54.00993,-16.41424 74.87573,-37.478 25.01466,-25.25197 39.33067,-55.00672 46.17634,-95.97411 1.40538,-8.41036 1.73662,-20.28198 2.08379,-74.68117 l 0.41279,-64.68117 -5.44191,-7.81883 c -15.28625,-21.96301 -25.68094,-46.17279 -31.41577,-73.169 -2.46905,-11.62283 -2.69113,-14.55772 -2.7355,-36.14983 -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.07104 363.53198,171 362.95209,171 c -0.57636,0 -26.33886,-2.92478 -57.25,-6.49952 -30.91115,-3.57474 -56.75455,-6.49974 -57.42978,-6.5 -0.96489,-3.8e-4 -1.29411,40.938 -1.53797,191.24952 -0.34786,214.40609 0.26317,197.33864 -7.67334,214.33313 -6.4772,13.86964 -13.56995,19.39675 -24.90987,19.41129 -6.17889,0.008 -10.21177,-2.27434 -13.85636,-7.8415 C 192.58867,563.3817 189.41556,546.53664 187.83355,509 c -0.63746,-15.125 -1.23294,-27.60966 -1.3233,-27.74368 -0.0904,-0.13403 -21.05462,1.37028 -46.58727,3.34291 -64.202194,4.96019 -62.683136,4.82759 -63.388611,5.53307 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 124.74334,-4.56444 c 11.38187,-10.23328 19.28542,-13.96675 27.82894,-13.14583 7.54524,0.725 10.34022,3.93981 10.23382,11.77102 l -0.0813,5.98714 17.90023,0 c 9.84512,0 17.71885,-0.3375 17.49717,-0.75 -0.22168,-0.4125 -11.12492,-23.7 -24.22943,-51.75 -13.1045,-28.05 -24.16693,-51.39474 -24.58316,-51.8772 -0.41624,-0.48247 -1.24355,1.09253 -1.83848,3.5 -2.83237,11.46161 -8.72871,27.70179 -13.97221,38.48336 -9.21699,18.95179 -18.46672,31.83081 -34.57695,48.14384 L 325.4419,691 l 17.38212,0 17.38212,0 5.13002,-4.61233 z m 28.65826,2.86233 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.47352,-2.39415 -10.05724,-0.43431 -18.02199,6.32557 -6.58525,5.58907 -6.47543,5.66266 8.45031,5.66266 12.23992,0 13.54915,-0.16916 13.54411,-1.75 z m 5.80822,-3.52553 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z m 202.60625,-14.51396 c 16.80236,-8.75398 38.68834,-30.48847 49.05004,-48.71051 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24317,-22.10046 6.78634,-9.89589 7.1045,-189.80047 0.17842,-100.88931 -0.0788,-164.45197 -0.68183,-168.5 -2.3362,-15.68196 -3.41375,-20.93917 -5.68871,-27.75424 -4.12954,-12.37082 -8.21522,-22.40623 -10.64772,-26.15332 -11.83968,-18.23817 -14.66547,-21.79617 -25.72831,-32.39498 -6.52391,-6.25027 -14.6115,-13.12663 -17.97242,-15.28079 -3.36092,-2.15417 -8.43612,-5.41308 -11.27824,-7.24202 -12.31541,-7.92516 -31.40127,-13.68119 -54.5355,-16.44716 -2.09362,-0.25032 -3.13778,7.7e-4 -2.8669,0.6894 0.23432,0.59571 16.25456,27.14835 35.60053,59.00586 19.34597,31.85752 35.26108,58.26843 35.3669,58.69091 0.10583,0.42249 -8.58258,5.65857 -19.30758,11.63574 -43.36228,24.16631 -72.30829,45.05407 -77.14445,55.66829 -2.03122,4.45804 4.86733,11.94933 28.14445,30.56272 39.21566,31.35854 69.36416,64.32605 88.09693,96.33434 3.24592,5.54625 3.5416,5.7788 6.40307,5.03601 1.65,-0.42832 5.80285,-0.79496 9.22856,-0.81476 5.49372,-0.0317 6.55436,0.28996 8.99013,2.72686 2.40446,2.40557 2.74976,3.50476 2.6702,8.5 -0.0974,6.11848 -5.30252,20.52979 -7.95009,22.01145 -1.12785,0.63118 -0.93872,2.13155 1.06351,8.4366 6.06245,19.09079 9.03942,41.80716 8.16294,62.28909 -2.16325,50.55196 -21.40396,92.80219 -61.02759,134.00909 -5.28386,5.495 -9.61392,10.14188 -9.62234,10.3264 -0.008,0.18453 2.12218,-0.88962 4.73468,-2.38698 2.6125,-1.49736 6.059,-3.40446 7.65889,-4.238 z m 49.07352,-72.87096 c -1.80729,-1.80729 -1.80543,-1.63069 -0.0612,-5.80525 1.49521,-3.57853 6.72157,-7.07722 9.16904,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.03225,4.53321 -8.02944,2.53601 z m 5.44501,-3.97441 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.28718,344.88718 c -0.69227,-0.69227 0.46147,-2.58204 3.59681,-5.89134 l 4.61601,-4.87213 2.63842,2.51834 c 1.55564,1.48483 4.29112,2.74 6.66557,3.05849 3.58867,0.48134 4.53305,0.11874 8.67342,-3.3302 C 596.62421,331.25004 601,324.56255 601,320.28872 c 0,-4.63344 -3.44864,-10.98282 -7.20654,-13.26813 -4.7643,-2.89735 -10.35644,-3.53695 -13.41312,-1.53414 -1.40463,0.92034 -2.67938,1.5249 -2.83279,1.34345 -0.1534,-0.18144 -1.07525,-2.03768 -2.04856,-4.12497 -1.7231,-3.69525 -6.80174,-7.85288 -12.99899,-10.64162 -1.65,-0.74249 -7.80144,-1.5668 -13.66987,-1.8318 -9.69768,-0.43791 -10.94037,-0.2892 -13.63851,1.63204 -3.36301,2.39468 -8.33587,9.8249 -10.26213,15.33321 -1.33205,3.80911 -2.92949,4.1968 -2.92949,0.71098 0,-3.31787 4.88637,-11.84675 9.33727,-16.29764 6.78737,-6.78737 12.58956,-9.11416 22.66273,-9.08817 6.79559,0.0175 9.33066,0.46179 12.64255,2.21551 4.94988,2.62108 10.87142,9.25985 12.40547,13.90805 0.6089,1.84498 1.22805,3.35451 1.37589,3.35451 0.14785,0 1.74575,-0.73679 3.55089,-1.63731 9.93398,-4.95573 24.25666,-0.70981 29.00545,8.59859 9.35342,18.33422 -16.91793,42.06062 -36.65144,33.10093 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.62602,2.90172 -4.86078,3.90242 -6.05282,2.71038 z m 36.98738,-10.37065 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.7367,-5.49249 -5.57904,-10.44348 -12.11175,-12.38348 -8.61074,-2.55712 -10.42366,-1.4075 -3.2991,2.09205 5.65671,2.77855 8.66507,8.1335 8.68688,15.46284 0.0174,5.84936 -0.98019,8.01171 -6.33084,13.72251 -3.99899,4.26816 -2.11467,4.14669 3.62185,-0.23347 z m -34.10458,-44.52489 c -1.28152,-1.068 -3.98152,-2.40052 -6,-2.96115 C 556.45686,285.72142 547.30196,285.7024 546.5,287 c -0.38615,0.6248 1.74913,1.0156 5.69098,1.04159 3.61755,0.0239 8.44206,0.83997 11.30902,1.91306 6.34351,2.37435 6.47621,2.37568 3.66998,0.037 z M 427,559.53327 c 19.74213,-9.86312 36.29651,-22.40462 40.62693,-30.77873 1.36666,-2.64282 1.253,-3.20227 -1.83502,-9.03247 -4.55169,-8.59364 -21.7874,-26.14146 -40.28935,-41.01895 -8.25141,-6.63499 -18.21874,-14.9065 -22.14963,-18.38114 l -7.14707,-6.31753 -0.48695,47.74778 c -0.46525,45.61993 -1.22462,58.50441 -4.27095,72.46672 l -0.59323,2.71895 12.32263,-5.82963 c 6.77745,-3.20629 17.49764,-8.41504 23.82264,-11.575 z m -19.51759,-47.19372 c -1.80729,-1.80729 -1.80543,-1.63069 -0.0612,-5.80525 1.49521,-3.57853 6.72157,-7.07722 9.16904,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.03225,4.53321 -8.02944,2.53601 z m 5.44501,-3.97441 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z m 236.62835,-56.88845 c 0.91266,-6.08608 -0.29179,-13.21271 -2.62785,-15.54877 C 645.67804,434.67804 643.61768,434 641.06957,434 l -3.93042,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.95043 4.93043,11.55901 0,2.90224 1.96276,-0.58039 2.55577,-4.53482 z M 156.71291,449.98588 C 185.98001,447.79365 210.61751,446 211.46291,446 212.82472,446 213,440.42866 213,397.14246 l 0,-48.85755 -6.03828,-0.63112 c -11.75867,-1.22903 -21.11523,-7.52885 -23.95313,-16.12777 -1.86906,-5.6633 -0.83055,-21.71555 1.85232,-28.6313 4.75301,-12.25202 12.48441,-20.21248 22.88909,-23.56723 l 5.25,-1.69273 0,-78.42867 0,-78.42867 3.25,0.55018 c 1.7875,0.30261 42.744,4.93175 91.01444,10.28698 l 87.76445,9.73678 10.23555,-9.97063 C 410.894,125.89688 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.30336 c -105.43774,0.30176 -106.05039,0.31514 -115.5,2.52252 -24.27429,5.67034 -43.29936,14.37773 -59.21226,27.10028 -9.85424,7.87857 -24.40024,23.23402 -29.28774,30.91752 -2.2,3.45855 -5.41807,8.44562 -7.15128,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998444,9.20934 -2.073383,12.90695 -2.4493,120.85249 l -0.387782,111.35248 5.787036,-0.61661 c 3.182866,-0.33913 29.732846,-2.41025 58.999946,-4.60248 z M 97.482409,392.33955 c -1.807291,-1.80729 -1.80543,-1.63069 -0.06119,-5.80525 1.495204,-3.57853 6.721571,-7.07722 9.169041,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.032251,4.53321 -8.029444,2.53601 z m 5.445011,-3.97441 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 138.1228,245.04835 c -10.79569,-2.71005 -15.16797,-14.91399 -10.12494,-28.26084 2.94604,-7.79696 11.15163,-18.19737 16.338,-20.70805 5.50009,-2.66255 14.58599,-2.75239 20.20551,-0.1998 4.50999,2.04861 9.13513,6.98324 10.08227,10.75692 1.75309,6.98488 -3.0557,20.02844 -10.50315,28.48919 -7.0396,7.99741 -17.60417,12.02961 -25.99769,9.92258 z m 12.80414,-3.7999 c 2.63272,-1.34323 4.36655,-3.60251 7.48124,-9.74845 8.98897,-17.73713 4.652,-31.48542 -9.93567,-31.49626 -7.63177,-0.006 -11.5139,3.23544 -16.76437,13.99626 -4.01621,8.23121 -4.50962,18.06981 -1.13706,22.67312 2.74886,3.75198 8.00686,6.32377 12.92892,6.32377 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 17.11361,-17.52141 c 4.23395,-9.04774 4.73992,-14.32314 1.79613,-18.72704 -1.29677,-1.93997 -4.44366,-4.54416 -7.06021,-5.84264 -5.44448,-2.70185 -8.75667,-2.44016 -4.08009,0.32236 6.71118,3.96439 9.69582,14.21944 6.91873,23.77232 -1.77494,6.10557 -1.87609,6.74796 -1.06257,6.74796 0.3039,0 1.8735,-2.82283 3.48801,-6.27296 z M 655.7309,443.03109 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 213,315 l 0,-29 -6.5,0 c -6.20105,0 -6.67601,0.17601 -10.32709,3.82709 -8.81545,8.81545 -13.67848,27.94971 -10.19261,40.10424 2.15484,7.51347 12.26281,14.04121 21.7697,14.0589 l 5.25,0.01 0,-29 z m 0,-32 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3434"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#6c5a34"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.43106,-35.81077 c 9.58011,-4.97565 20.97359,-11.27473 25.31886,-13.99797 54.5522,-34.1886 87.16358,-76.5693 97.13048,-126.22765 3.2312,-16.09889 3.2312,-43.35663 0,-59.45552 -7.38495,-36.7942 -27.3397,-71.70164 -60.66881,-106.12973 -12.103,-12.50209 -25.3346,-24.33674 -44.60069,-39.89189 -33.63031,-27.15261 -44.81082,-46.85813 -36.64803,-64.59171 8.14394,-17.69265 31.72044,-37.61556 74.21919,-62.71766 C 562.17648,222.181 566,219.6779 566,219.3788 566,217.71763 497.38952,106 496.36932,106 c -0.20051,0 -4.52813,2.30821 -9.61694,5.12936 -25.70653,14.25128 -61.63124,44.71217 -82.40342,69.87064 -14.66536,17.76213 -31.2885,45.7742 -37.38593,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 6.19898,30.24757 26.50917,65.50885 53.00558,92.02499 9.93811,9.9455 27.02227,24.97501 28.38929,24.97501 0.34533,0 1.4429,0.7875 2.43905,1.75 0.99615,0.9625 6.31833,5.4463 11.82705,9.96401 13.16235,10.79442 31.67513,29.95826 37.68464,39.00991 16.00556,24.10795 13.72041,41.9162 -7.99444,62.30102 -9.98642,9.37477 -21.83806,17.31102 -39.29934,26.31615 -7.441,3.83747 -13.69337,7.10738 -13.89416,7.26647 C 430.27928,595.28549 483.51731,707 484.69604,707 c 0.35083,0 8.47615,-4.07098 18.05625,-9.04662 z m -262.15947,-7.00127 c 26.59333,-2.70777 53.90323,-16.36436 74.85393,-37.43145 24.92122,-25.05968 39.35274,-55.05493 46.19814,-96.02066 1.40538,-8.41036 1.73662,-20.28198 2.08379,-74.68117 l 0.41279,-64.68117 -5.44191,-7.81883 c -15.28625,-21.96301 -25.68094,-46.17279 -31.41577,-73.169 -2.46905,-11.62283 -2.69113,-14.55772 -2.7355,-36.14983 -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.08673 363.58102,171 363.06893,171 362.55684,171 336.87582,168.075 306,164.5 275.12418,160.925 249.2282,158 248.45338,158 c -1.20569,0 -1.45349,27.56847 -1.71904,191.25 -0.34786,214.40609 0.26317,197.33864 -7.67334,214.33313 -6.4772,13.86964 -13.56995,19.39675 -24.90987,19.41129 -6.17889,0.008 -10.21177,-2.27434 -13.85636,-7.8415 C 192.61039,563.41488 189.45391,546.6328 187.85232,509 c -0.6437,-15.125 -1.24596,-27.60966 -1.33836,-27.74368 -0.0924,-0.13403 -21.05833,1.37028 -46.59098,3.34291 -64.202194,4.96019 -62.683136,4.82759 -63.388611,5.53307 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 124.74334,-4.56444 c 11.38187,-10.23328 19.28542,-13.96675 27.82894,-13.14583 7.54524,0.725 10.34022,3.93981 10.23382,11.77102 l -0.0813,5.98714 17.79018,0 17.79019,0 -1.37706,-3.25 c -2.55746,-6.03589 -47.29497,-100.85742 -47.84461,-101.40705 -0.29966,-0.29966 -1.02841,1.41309 -1.61944,3.80611 -2.82248,11.42776 -8.72549,27.68343 -13.96514,38.4571 -9.21699,18.95179 -18.46672,31.83081 -34.57695,48.14384 L 325.4419,691 l 17.38212,0 17.38212,0 5.13002,-4.61233 z m 28.65826,2.86233 c -0.0118,-3.7168 -2.16733,-9.27217 -3.97243,-10.23823 -4.47352,-2.39415 -10.05724,-0.43431 -18.02199,6.32557 -6.58525,5.58907 -6.47543,5.66266 8.45031,5.66266 12.23992,0 13.54915,-0.16916 13.54411,-1.75 z m 5.80822,-3.52553 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z m 202.60625,-14.51396 c 9.12437,-4.75377 25.07096,-17.88543 34.25777,-28.21051 5.13852,-5.77521 11.18096,-14.14917 14.79227,-20.5 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24317,-22.10046 6.78634,-9.89589 7.1045,-189.80047 0.17842,-100.88931 -0.0788,-164.45197 -0.68183,-168.5 -2.3362,-15.68196 -3.41375,-20.93917 -5.68871,-27.75424 -4.12954,-12.37082 -8.21522,-22.40623 -10.64772,-26.15332 -11.83968,-18.23817 -14.66547,-21.79617 -25.72831,-32.39498 -6.52391,-6.25027 -14.6115,-13.12663 -17.97242,-15.28079 -3.36092,-2.15417 -8.43612,-5.41308 -11.27824,-7.24202 -12.31541,-7.92516 -31.40127,-13.68119 -54.5355,-16.44716 -2.08995,-0.24988 -3.14084,0.002 -2.87658,0.6894 0.32186,0.83724 28.38357,47.19413 71.26534,117.72762 0.21551,0.35449 -6.46788,4.3801 -14.85199,8.9458 -44.53676,24.25325 -76.85194,47.27384 -81.89363,58.33914 -2.07325,4.55028 5.06837,12.14025 30.64981,32.57406 36.46541,29.12764 69.26639,65.31008 85.52488,94.34166 3.16594,5.65318 3.3753,5.81859 6.37429,5.036 1.70546,-0.44504 5.90368,-0.82537 9.32939,-0.84517 5.49372,-0.0317 6.55436,0.28996 8.99013,2.72686 2.40446,2.40557 2.74976,3.50476 2.6702,8.5 -0.0974,6.11848 -5.30252,20.52979 -7.95009,22.01145 -1.12785,0.63118 -0.93872,2.13155 1.06351,8.4366 18.18221,57.25616 6.83804,119.96217 -30.84354,170.49057 -7.60209,10.19387 -24.66035,29.5814 -29.10027,33.07384 -4.13134,3.24972 -2.94153,3.6152 2.1915,0.67319 2.6125,-1.49736 6.059,-3.40446 7.65889,-4.238 z m 49.07352,-72.87096 c -1.80729,-1.80729 -1.80543,-1.63069 -0.0612,-5.80525 1.49521,-3.57853 6.72157,-7.07722 9.16904,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.03225,4.53321 -8.02944,2.53601 z m 5.44501,-3.97441 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.28718,344.88718 c -0.69227,-0.69227 0.46147,-2.58204 3.59681,-5.89134 l 4.61601,-4.87213 2.63842,2.51834 c 1.55564,1.48483 4.29112,2.74 6.66557,3.05849 3.58867,0.48134 4.53305,0.11874 8.67342,-3.3302 C 596.62421,331.25004 601,324.56255 601,320.28872 c 0,-4.63344 -3.44864,-10.98282 -7.20654,-13.26813 -4.7643,-2.89735 -10.35644,-3.53695 -13.41312,-1.53414 -1.40463,0.92034 -2.67938,1.5249 -2.83279,1.34345 -0.1534,-0.18144 -1.07525,-2.03768 -2.04856,-4.12497 -1.7231,-3.69525 -6.80174,-7.85288 -12.99899,-10.64162 -1.65,-0.74249 -7.80144,-1.5668 -13.66987,-1.8318 -9.69768,-0.43791 -10.94037,-0.2892 -13.63851,1.63204 -3.36301,2.39468 -8.33587,9.8249 -10.26213,15.33321 -1.33205,3.80911 -2.92949,4.1968 -2.92949,0.71098 0,-3.31787 4.88637,-11.84675 9.33727,-16.29764 6.78737,-6.78737 12.58956,-9.11416 22.66273,-9.08817 6.79559,0.0175 9.33066,0.46179 12.64255,2.21551 4.94988,2.62108 10.87142,9.25985 12.40547,13.90805 0.6089,1.84498 1.22805,3.35451 1.37589,3.35451 0.14785,0 1.74575,-0.73679 3.55089,-1.63731 9.93398,-4.95573 24.25666,-0.70981 29.00545,8.59859 9.35342,18.33422 -16.91793,42.06062 -36.65144,33.10093 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.62602,2.90172 -4.86078,3.90242 -6.05282,2.71038 z m 36.98738,-10.37065 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.7367,-5.49249 -5.57904,-10.44348 -12.11175,-12.38348 -8.61074,-2.55712 -10.42366,-1.4075 -3.2991,2.09205 5.65671,2.77855 8.66507,8.1335 8.68688,15.46284 0.0174,5.84936 -0.98019,8.01171 -6.33084,13.72251 -3.99899,4.26816 -2.11467,4.14669 3.62185,-0.23347 z m -34.10458,-44.52489 c -1.28152,-1.068 -3.98152,-2.40052 -6,-2.96115 C 556.45686,285.72142 547.30196,285.7024 546.5,287 c -0.38615,0.6248 1.74913,1.0156 5.69098,1.04159 3.61755,0.0239 8.44206,0.83997 11.30902,1.91306 6.34351,2.37435 6.47621,2.37568 3.66998,0.037 z M 427.5,559.33477 c 19.17554,-9.59937 35.84762,-22.30495 40.12693,-30.58023 1.36666,-2.64282 1.253,-3.20227 -1.83502,-9.03247 -4.54534,-8.58164 -21.76484,-26.11965 -40.28935,-41.03459 -8.25141,-6.64359 -18.21864,-14.92972 -22.1494,-18.41361 l -7.14684,-6.33435 -0.48718,47.78024 c -0.46549,45.65344 -1.22437,58.53471 -4.27118,72.49919 l -0.59323,2.71895 12.82263,-6.04824 C 410.72981,567.56313 421.45,562.36343 427.5,559.33477 z m -20.01759,-46.99522 c -1.80729,-1.80729 -1.80543,-1.63069 -0.0612,-5.80525 1.49521,-3.57853 6.72157,-7.07722 9.16904,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.03225,4.53321 -8.02944,2.53601 z m 5.44501,-3.97441 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z m 236.62835,-56.88845 c 0.91266,-6.08608 -0.29179,-13.21271 -2.62785,-15.54877 C 645.67804,434.67804 643.61768,434 641.06957,434 l -3.93042,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.95043 4.93043,11.55901 0,2.90224 1.96276,-0.58039 2.55577,-4.53482 z M 156.71291,449.98588 C 185.98001,447.79365 210.61751,446 211.46291,446 212.82472,446 213,440.42866 213,397.14246 l 0,-48.85755 -6.03828,-0.63112 c -11.75867,-1.22903 -21.11523,-7.52885 -23.95313,-16.12777 -1.86906,-5.6633 -0.83055,-21.71555 1.85232,-28.6313 4.75301,-12.25202 12.48441,-20.21248 22.88909,-23.56723 l 5.25,-1.69273 0,-78.42867 0,-78.42867 3.25,0.55078 c 1.7875,0.30293 42.74215,4.9339 91.01033,10.29103 l 87.76032,9.74024 10.23968,-9.97469 C 410.89215,125.8987 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.30336 c -105.43774,0.30176 -106.05039,0.31514 -115.5,2.52252 -24.27429,5.67034 -43.29936,14.37773 -59.21226,27.10028 -9.85424,7.87857 -24.40024,23.23402 -29.28774,30.91752 -2.2,3.45855 -5.41807,8.44562 -7.15128,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998444,9.20934 -2.073383,12.90695 -2.4493,120.85249 l -0.387782,111.35248 5.787036,-0.61661 c 3.182866,-0.33913 29.732846,-2.41025 58.999946,-4.60248 z M 97.482409,392.33955 c -1.807291,-1.80729 -1.80543,-1.63069 -0.06119,-5.80525 1.495204,-3.57853 6.721571,-7.07722 9.169041,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.032251,4.53321 -8.029444,2.53601 z m 5.445011,-3.97441 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 138.1228,245.04835 c -10.79569,-2.71005 -15.16797,-14.91399 -10.12494,-28.26084 2.94604,-7.79696 11.15163,-18.19737 16.338,-20.70805 5.50009,-2.66255 14.58599,-2.75239 20.20551,-0.1998 4.50999,2.04861 9.13513,6.98324 10.08227,10.75692 1.75309,6.98488 -3.0557,20.02844 -10.50315,28.48919 -7.0396,7.99741 -17.60417,12.02961 -25.99769,9.92258 z m 12.80414,-3.7999 c 2.63272,-1.34323 4.36655,-3.60251 7.48124,-9.74845 8.98897,-17.73713 4.652,-31.48542 -9.93567,-31.49626 -7.63177,-0.006 -11.5139,3.23544 -16.76437,13.99626 -4.01621,8.23121 -4.50962,18.06981 -1.13706,22.67312 2.74886,3.75198 8.00686,6.32377 12.92892,6.32377 2.2,0 5.54212,-0.7868 7.42694,-1.74844 z m 17.11361,-17.52141 c 4.23395,-9.04774 4.73992,-14.32314 1.79613,-18.72704 -1.29677,-1.93997 -4.44366,-4.54416 -7.06021,-5.84264 -5.44448,-2.70185 -8.75667,-2.44016 -4.08009,0.32236 6.71118,3.96439 9.69582,14.21944 6.91873,23.77232 -1.77494,6.10557 -1.87609,6.74796 -1.06257,6.74796 0.3039,0 1.8735,-2.82283 3.48801,-6.27296 z M 655.7309,443.03109 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 213,315 l 0,-29 -6.5,0 c -6.20105,0 -6.67601,0.17601 -10.32709,3.82709 -8.81545,8.81545 -13.67848,27.94971 -10.19261,40.10424 2.15484,7.51347 12.26281,14.04121 21.7697,14.0589 l 5.25,0.01 0,-29 z m 0,-32 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3432"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#625c3c"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.43106,-35.81077 c 9.58011,-4.97565 20.97359,-11.27473 25.31886,-13.99797 54.5522,-34.1886 87.16358,-76.5693 97.13048,-126.22765 3.2312,-16.09889 3.2312,-43.35663 0,-59.45552 -7.38495,-36.7942 -27.3397,-71.70164 -60.66881,-106.12973 -12.103,-12.50209 -25.3346,-24.33674 -44.60069,-39.89189 -33.63031,-27.15261 -44.81082,-46.85813 -36.64803,-64.59171 8.14394,-17.69265 31.72044,-37.61556 74.21919,-62.71766 C 562.17648,222.181 566,219.6779 566,219.3788 566,217.71763 497.38952,106 496.36932,106 c -0.20051,0 -4.52813,2.30821 -9.61694,5.12936 -25.70653,14.25128 -61.63124,44.71217 -82.40342,69.87064 -14.66536,17.76213 -31.2885,45.7742 -37.38593,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 6.19898,30.24757 26.50917,65.50885 53.00558,92.02499 9.93811,9.9455 27.02227,24.97501 28.38929,24.97501 0.34533,0 1.4429,0.7875 2.43905,1.75 0.99615,0.9625 6.31833,5.4463 11.82705,9.96401 13.16235,10.79442 31.67513,29.95826 37.68464,39.00991 16.00556,24.10795 13.72041,41.9162 -7.99444,62.30102 -9.98642,9.37477 -21.83806,17.31102 -39.29934,26.31615 -7.441,3.83747 -13.69337,7.10738 -13.89416,7.26647 C 430.27928,595.28549 483.51731,707 484.69604,707 c 0.35083,0 8.47615,-4.07098 18.05625,-9.04662 z m -262.15947,-7.00127 c 26.59333,-2.70777 53.90323,-16.36436 74.85393,-37.43145 24.92122,-25.05968 39.35274,-55.05493 46.19814,-96.02066 1.40538,-8.41036 1.73662,-20.28198 2.08379,-74.68117 l 0.41279,-64.68117 -5.44191,-7.81883 c -15.28625,-21.96301 -25.68094,-46.17279 -31.41577,-73.169 -2.46905,-11.62283 -2.69113,-14.55772 -2.7355,-36.14983 -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.08673 363.58102,171 363.06893,171 362.55684,171 336.87582,168.075 306,164.5 275.12418,160.925 249.2282,158 248.45338,158 c -1.20569,0 -1.45349,27.56847 -1.71904,191.25 -0.34786,214.40609 0.26317,197.33864 -7.67334,214.33313 -6.4772,13.86964 -13.56995,19.39675 -24.90987,19.41129 -6.17889,0.008 -10.21177,-2.27434 -13.85636,-7.8415 C 192.61039,563.41488 189.45391,546.6328 187.85232,509 c -0.6437,-15.125 -1.24596,-27.60966 -1.33836,-27.74368 -0.0924,-0.13403 -21.05833,1.37028 -46.59098,3.34291 -64.202194,4.96019 -62.683136,4.82759 -63.388611,5.53307 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 124.74334,-4.56444 c 11.38187,-10.23328 19.28542,-13.96675 27.82894,-13.14583 7.54524,0.725 10.34022,3.93981 10.23382,11.77102 l -0.0813,5.98714 17.79018,0 17.79019,0 -1.37706,-3.25 c -2.55746,-6.03589 -47.29497,-100.85742 -47.84461,-101.40705 -0.29966,-0.29966 -1.02841,1.41309 -1.61944,3.80611 -2.82248,11.42776 -8.72549,27.68343 -13.96514,38.4571 -9.21699,18.95179 -18.46672,31.83081 -34.57695,48.14384 L 325.4419,691 l 17.38212,0 17.38212,0 5.13002,-4.61233 z M 394,688.64922 c 0,-3.71455 -2.04108,-8.60084 -4.03944,-9.67033 -2.9569,-1.58248 -6.96886,-1.13374 -10.84253,1.21275 C 374.12973,683.21333 367,689.05502 367,690.12046 367,690.60421 373.075,691 380.5,691 l 13.5,0 0,-2.35078 z m 5.80264,-2.92475 C 400.13654,680.62816 397.73748,677 394.03373,677 c -1.94,0 -1.94098,0.0434 -0.0733,3.25 1.04112,1.7875 2.2047,4.95708 2.58573,7.04352 0.93397,5.11423 2.88007,4.17656 3.25651,-1.56905 z m 202.60625,-14.51396 c 9.12437,-4.75377 25.07096,-17.88543 34.25777,-28.21051 5.13852,-5.77521 11.18096,-14.14917 14.79227,-20.5 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24317,-22.10046 6.78634,-9.89589 7.1045,-189.80047 0.17842,-100.88931 -0.0788,-164.45197 -0.68183,-168.5 -2.3362,-15.68196 -3.41375,-20.93917 -5.68871,-27.75424 -4.12954,-12.37082 -8.21522,-22.40623 -10.64772,-26.15332 -11.83968,-18.23817 -14.66547,-21.79617 -25.72831,-32.39498 -6.52391,-6.25027 -14.6115,-13.12663 -17.97242,-15.28079 -3.36092,-2.15417 -8.43612,-5.41308 -11.27824,-7.24202 -12.31541,-7.92516 -31.40127,-13.68119 -54.5355,-16.44716 -2.08995,-0.24988 -3.14084,0.002 -2.87658,0.6894 0.32186,0.83724 28.38357,47.19413 71.26534,117.72762 0.21551,0.35449 -6.46788,4.3801 -14.85199,8.9458 -44.53676,24.25325 -76.85194,47.27384 -81.89363,58.33914 -2.07325,4.55028 5.06837,12.14025 30.64981,32.57406 36.46541,29.12764 69.26639,65.31008 85.52488,94.34166 3.16594,5.65318 3.3753,5.81859 6.37429,5.036 1.70546,-0.44504 5.90368,-0.82537 9.32939,-0.84517 5.49372,-0.0317 6.55436,0.28996 8.99013,2.72686 2.40446,2.40557 2.74976,3.50476 2.6702,8.5 -0.0974,6.11848 -5.30252,20.52979 -7.95009,22.01145 -1.12785,0.63118 -0.93872,2.13155 1.06351,8.4366 18.18221,57.25616 6.83804,119.96217 -30.84354,170.49057 -7.60209,10.19387 -24.66035,29.5814 -29.10027,33.07384 -4.13134,3.24972 -2.94153,3.6152 2.1915,0.67319 2.6125,-1.49736 6.059,-3.40446 7.65889,-4.238 z m 49.07352,-72.87096 c -1.80729,-1.80729 -1.80543,-1.63069 -0.0612,-5.80525 1.49521,-3.57853 6.72157,-7.07722 9.16904,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.03225,4.53321 -8.02944,2.53601 z m 5.44501,-3.97441 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.35718,344.95718 c -0.59896,-0.59896 0.71852,-2.77671 3.57039,-5.90176 4.49396,-4.92444 4.53024,-4.94114 6.39205,-2.94272 4.59809,4.93547 10.43614,5.04076 16.23049,0.29273 9.4811,-7.76906 12.51876,-16.04339 8.59828,-23.42103 -3.66601,-6.89876 -13.61587,-10.87379 -18.76805,-7.49795 -1.40463,0.92034 -2.67938,1.5249 -2.83279,1.34345 -0.1534,-0.18144 -1.06474,-2.01552 -2.02519,-4.07573 -2.15629,-4.62531 -8.40603,-9.34517 -14.94594,-11.28732 C 557.84877,290.65683 551.64543,290 546.72287,290 c -7.29434,0 -9.42162,0.36137 -11.707,1.9887 -3.20944,2.28532 -8.1972,9.80578 -10.08638,15.20806 -1.33205,3.80911 -2.92949,4.1968 -2.92949,0.71098 0,-3.31787 4.88637,-11.84675 9.33727,-16.29764 6.78737,-6.78737 12.58956,-9.11416 22.66273,-9.08817 6.79559,0.0175 9.33066,0.46179 12.64255,2.21551 4.94988,2.62108 10.87142,9.25985 12.40547,13.90805 0.6089,1.84498 1.22805,3.35451 1.37589,3.35451 0.14785,0 1.74575,-0.73679 3.55089,-1.63731 9.93398,-4.95573 24.25666,-0.70981 29.00545,8.59859 9.35342,18.33422 -16.91793,42.06062 -36.65144,33.10093 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56799,2.83759 -4.86031,3.90289 -5.98282,2.78038 z m 36.91738,-10.44065 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.7367,-5.49249 -5.57904,-10.44348 -12.11175,-12.38348 -8.61074,-2.55712 -10.42366,-1.4075 -3.2991,2.09205 5.65671,2.77855 8.66507,8.1335 8.68688,15.46284 0.0174,5.84936 -0.98019,8.01171 -6.33084,13.72251 -3.99899,4.26816 -2.11467,4.14669 3.62185,-0.23347 z m -34.10458,-44.52489 c -1.28152,-1.068 -3.98152,-2.40052 -6,-2.96115 C 556.45686,285.72142 547.30196,285.7024 546.5,287 c -0.38615,0.6248 1.74913,1.0156 5.69098,1.04159 3.61755,0.0239 8.44206,0.83997 11.30902,1.91306 6.34351,2.37435 6.47621,2.37568 3.66998,0.037 z M 427.5,559.33477 c 19.17554,-9.59937 35.84762,-22.30495 40.12693,-30.58023 1.36666,-2.64282 1.253,-3.20227 -1.83502,-9.03247 -4.54534,-8.58164 -21.76484,-26.11965 -40.28935,-41.03459 -8.25141,-6.64359 -18.21864,-14.92972 -22.1494,-18.41361 l -7.14684,-6.33435 -0.48718,47.78024 c -0.46549,45.65344 -1.22437,58.53471 -4.27118,72.49919 l -0.59323,2.71895 12.82263,-6.04824 C 410.72981,567.56313 421.45,562.36343 427.5,559.33477 z m -20.01759,-46.99522 c -1.80729,-1.80729 -1.80543,-1.63069 -0.0612,-5.80525 1.49521,-3.57853 6.72157,-7.07722 9.16904,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.03225,4.53321 -8.02944,2.53601 z m 5.44501,-3.97441 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 649.65503,450.26492 C 650.92336,439.55585 647.9907,434 641.06957,434 l -3.93042,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.8532 0.32447,0.92303 1.02658,0.22092 0.56461,-0.56461 1.29742,-3.31344 1.62845,-6.1085 z M 156.71291,449.98588 C 185.98001,447.79365 210.61751,446 211.46291,446 212.82472,446 213,440.42866 213,397.14246 l 0,-48.85755 -6.03828,-0.63112 c -11.75867,-1.22903 -21.11523,-7.52885 -23.95313,-16.12777 -1.86906,-5.6633 -0.83055,-21.71555 1.85232,-28.6313 4.75301,-12.25202 12.48441,-20.21248 22.88909,-23.56723 l 5.25,-1.69273 0,-78.42867 0,-78.42867 3.25,0.55078 c 1.7875,0.30293 42.74215,4.9339 91.01033,10.29103 l 87.76032,9.74024 10.23968,-9.97469 C 410.89215,125.8987 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.30336 c -105.43774,0.30176 -106.05039,0.31514 -115.5,2.52252 -24.27429,5.67034 -43.29936,14.37773 -59.21226,27.10028 -9.85424,7.87857 -24.40024,23.23402 -29.28774,30.91752 -2.2,3.45855 -5.41807,8.44562 -7.15128,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998444,9.20934 -2.073383,12.90695 -2.4493,120.85249 l -0.387782,111.35248 5.787036,-0.61661 c 3.182866,-0.33913 29.732846,-2.41025 58.999946,-4.60248 z M 97.482409,392.33955 c -1.807291,-1.80729 -1.80543,-1.63069 -0.06119,-5.80525 1.495204,-3.57853 6.721571,-7.07722 9.169041,-6.13804 2.26017,0.86731 1.65335,6.16077 -1.07841,9.40728 -3.01169,3.5792 -6.032251,4.53321 -8.029444,2.53601 z m 5.445011,-3.97441 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 138.1228,245.04835 c -10.79569,-2.71005 -15.16797,-14.91399 -10.12494,-28.26084 2.94604,-7.79696 11.15163,-18.19737 16.338,-20.70805 5.50009,-2.66255 14.58599,-2.75239 20.20551,-0.1998 4.50999,2.04861 9.13513,6.98324 10.08227,10.75692 1.75309,6.98488 -3.0557,20.02844 -10.50315,28.48919 -7.0396,7.99741 -17.60417,12.02961 -25.99769,9.92258 z m 13.41822,-3.9103 c 4.7126,-2.87384 10.76633,-15.60108 11.28343,-23.72208 C 163.55593,205.92841 158.97725,200 149.37361,200 c -3.01011,0 -6.71768,0.64369 -8.23905,1.43041 -5.71865,2.95723 -12.12261,15.40879 -12.86207,25.00839 -0.3993,5.18371 -0.1242,6.5679 1.90024,9.5612 4.48883,6.6371 14.83185,9.1241 21.36829,5.13805 z m 16.49953,-17.41101 c 4.23395,-9.04774 4.73992,-14.32314 1.79613,-18.72704 -1.29677,-1.93997 -4.44366,-4.54416 -7.06021,-5.84264 -5.44448,-2.70185 -8.75667,-2.44016 -4.08009,0.32236 6.71118,3.96439 9.69582,14.21944 6.91873,23.77232 -1.77494,6.10557 -1.87609,6.74796 -1.06257,6.74796 0.3039,0 1.8735,-2.82283 3.48801,-6.27296 z M 655.7309,443.03109 c 0.45068,-4.97018 0.22686,-6.07333 -1.60356,-7.90375 C 652.9573,433.9573 651.11518,433 650.03373,433 c -1.93707,0 -1.93567,0.0519 0.0941,3.49209 1.17306,1.9882 2.29928,6.1267 2.61511,9.60974 0.67117,7.4018 2.17883,5.85237 2.98795,-3.07074 z M 212.7651,315.23667 213.03021,286 l -6.51511,0 c -6.22887,0 -6.68478,0.16968 -10.37728,3.86218 -4.22343,4.22343 -8.49369,12.38048 -10.07728,19.2496 -1.33549,5.79294 -1.33374,18.03494 0.003,21.57312 2.36773,6.26671 10.26207,11.84102 18.85683,13.31508 8.21777,1.40941 7.54882,3.86218 7.84465,-28.76331 z M 213,283 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3430"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#535353"
+       d="M 459.32123,733.76415 451.30699,716.5 l -85.38308,-0.25566 -85.38309,-0.25566 -7.52041,2.49534 c -17.82762,5.91538 -43.56771,9.19816 -63.76066,8.13175 -31.79867,-1.67931 -58.05867,-9.75634 -81.06211,-24.93302 C 83.955528,672.49371 56.423169,624.63458 47.553426,561.5 45.024679,543.50045 44.020361,523.33694 44.009889,490.35699 43.998902,455.75764 43.518982,458 50.935096,458 c 2.074337,0 6.522896,-0.28758 9.885686,-0.63906 l 6.114165,-0.63905 0.305972,-112.61095 C 67.545433,232.03615 67.557578,231.44628 69.791614,220.21693 76.377247,187.11434 92.752908,156.85501 116.28411,134.30698 124.28929,126.63627 144.17944,111 145.9318,111 c 0.43401,0 2.5394,-1.191 4.67865,-2.64667 10.66701,-7.25844 42.33811,-17.44099 63.38955,-20.380322 3.58746,-0.500904 60.51828,-0.922231 127.05422,-0.940289 L 461.60844,87 l 4.64501,-2.945776 c 5.03601,-3.193744 40.78523,-23.114109 41.97102,-23.387309 0.39846,-0.0918 4.24652,5.683085 8.55123,12.833085 l 7.82676,13 12.94877,0.64851 c 7.12182,0.35668 18.15504,1.583419 24.51826,2.726086 11.84412,2.126892 31.50286,8.337779 40.43051,12.773414 9.26001,4.60077 27.72915,16.69374 33.30772,21.80877 18.64846,17.09893 28.30185,28.2236 36.29439,41.82607 7.04549,11.99069 9.84253,17.25958 9.86977,18.5921 0.0155,0.75623 1.11879,3.90623 2.45184,7 4.91549,11.40805 8.19944,24.93851 10.58815,43.62505 0.67091,5.24848 0.92312,64.40614 0.73329,172 l -0.28935,164 -2.21797,11.11004 c -3.57531,17.90902 -12.20745,41.02292 -18.63195,49.88996 -1.19549,1.65 -2.67424,4.15633 -3.28612,5.56961 -2.29966,5.31163 -16.50173,22.87624 -25.1555,31.11143 -17.073,16.24718 -33.37233,26.46059 -57.66427,36.13336 -9.96104,3.96636 -28.27728,8.2821 -41.79774,9.84852 -7.42562,0.8603 -9.7747,1.61279 -15.06184,4.82484 -14.0689,8.54715 -52.47921,27.2872 -62.35036,30.42018 -1.71044,0.54287 -2.95571,-1.53621 -9.96883,-16.64379 z m 43.43106,-35.81077 c 9.58011,-4.97565 20.97359,-11.27473 25.31886,-13.99797 54.5522,-34.1886 87.16358,-76.5693 97.13048,-126.22765 3.2312,-16.09889 3.2312,-43.35663 0,-59.45552 -7.38495,-36.7942 -27.3397,-71.70164 -60.66881,-106.12973 -12.103,-12.50209 -25.3346,-24.33674 -44.60069,-39.89189 -33.63031,-27.15261 -44.81082,-46.85813 -36.64803,-64.59171 8.14394,-17.69265 31.72044,-37.61556 74.21919,-62.71766 C 562.17648,222.181 566,219.6779 566,219.3788 566,217.71763 497.38952,106 496.36932,106 c -0.20051,0 -4.52813,2.30821 -9.61694,5.12936 -25.70653,14.25128 -61.63124,44.71217 -82.40342,69.87064 -14.66536,17.76213 -31.2885,45.7742 -37.38593,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.40381,1.86699 -5.689,21.5229 -6.93833,31.82577 -1.59146,13.12418 -0.67707,34.23638 2.06156,47.59938 6.19898,30.24757 26.50917,65.50885 53.00558,92.02499 9.93811,9.9455 27.02227,24.97501 28.38929,24.97501 0.34533,0 1.4429,0.7875 2.43905,1.75 0.99615,0.9625 6.31833,5.4463 11.82705,9.96401 13.16235,10.79442 31.67513,29.95826 37.68464,39.00991 16.00556,24.10795 13.72041,41.9162 -7.99444,62.30102 -9.98642,9.37477 -21.83806,17.31102 -39.29934,26.31615 -7.441,3.83747 -13.69337,7.10738 -13.89416,7.26647 C 430.27928,595.28549 483.51731,707 484.69604,707 c 0.35083,0 8.47615,-4.07098 18.05625,-9.04662 z m -262.15947,-7.00127 c 26.59333,-2.70777 53.90323,-16.36436 74.85393,-37.43145 24.92122,-25.05968 39.35274,-55.05493 46.19814,-96.02066 1.40538,-8.41036 1.73662,-20.28198 2.08379,-74.68117 l 0.41279,-64.68117 -5.44191,-7.81883 c -15.28625,-21.96301 -25.68094,-46.17279 -31.41577,-73.169 -2.46905,-11.62283 -2.69113,-14.55772 -2.7355,-36.14983 -0.0423,-20.58491 0.23267,-24.88563 2.21665,-34.67026 5.80211,-28.61485 16.60437,-54.71276 32.88229,-79.44257 C 363.20778,181.47791 364,179.43036 364,175.63717 364,173.08673 363.58102,171 363.06893,171 362.55684,171 336.87582,168.075 306,164.5 275.12418,160.925 249.2282,158 248.45338,158 c -1.20569,0 -1.45349,27.56847 -1.71904,191.25 -0.34786,214.40609 0.26317,197.33864 -7.67334,214.33313 -6.4772,13.86964 -13.56995,19.39675 -24.90987,19.41129 -6.17889,0.008 -10.21177,-2.27434 -13.85636,-7.8415 C 192.61039,563.41488 189.45391,546.6328 187.85232,509 c -0.6437,-15.125 -1.24596,-27.60966 -1.33836,-27.74368 -0.0924,-0.13403 -21.05833,1.37028 -46.59098,3.34291 -64.202194,4.96019 -62.683136,4.82759 -63.388611,5.53307 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.89204,37.57651 15.245476,68.28273 30.792162,91.32335 10.93774,16.21005 29.41861,32.48288 46.63865,41.0664 24.4014,12.16315 48.04874,15.52989 83.63133,11.90682 z m 127.05288,-6.41667 c 4.16704,-3.55551 9.65744,-7.47196 12.2009,-8.70323 5.49768,-2.66138 14.5955,-3.46829 18.1534,-1.61008 3.80172,1.98555 6.14762,7.43008 5.39793,12.52787 l -0.62502,4.25 18.06252,0 18.06252,0 -1.37706,-3.25 c -2.55746,-6.03589 -47.29497,-100.85742 -47.84461,-101.40705 -0.29966,-0.29966 -1.02841,1.41309 -1.61944,3.80611 -2.82248,11.42776 -8.72549,27.68343 -13.96514,38.4571 -9.21699,18.95179 -18.46672,31.83081 -34.57695,48.14384 L 325.4419,691 l 17.31369,0 17.31369,0 7.57642,-6.46456 z M 394,688.64922 c 0,-3.71455 -2.04108,-8.60084 -4.03944,-9.67033 -2.9569,-1.58248 -6.96886,-1.13374 -10.84253,1.21275 C 374.12973,683.21333 367,689.05502 367,690.12046 367,690.60421 373.075,691 380.5,691 l 13.5,0 0,-2.35078 z M 400,686 c 0,-5.46541 -2.34315,-9 -5.96627,-9 -1.93234,0 -1.93425,0.0561 -0.11065,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 C 397.45978,693.11041 400,692.21981 400,686 z m 202.40889,-14.78949 c 9.12437,-4.75377 25.07096,-17.88543 34.25777,-28.21051 5.13852,-5.77521 11.18096,-14.14917 14.79227,-20.5 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24317,-22.10046 6.78634,-9.89589 7.1045,-189.80047 0.17842,-100.88931 -0.0788,-164.45197 -0.68183,-168.5 -2.3362,-15.68196 -3.41375,-20.93917 -5.68871,-27.75424 -4.12954,-12.37082 -8.21522,-22.40623 -10.64772,-26.15332 -11.83968,-18.23817 -14.66547,-21.79617 -25.72831,-32.39498 -6.52391,-6.25027 -14.6115,-13.12663 -17.97242,-15.28079 -3.36092,-2.15417 -8.43612,-5.41308 -11.27824,-7.24202 -12.31541,-7.92516 -31.40127,-13.68119 -54.5355,-16.44716 -2.08995,-0.24988 -3.14084,0.002 -2.87658,0.6894 0.32186,0.83724 28.38357,47.19413 71.26534,117.72762 0.21551,0.35449 -6.46788,4.3801 -14.85199,8.9458 -44.53676,24.25325 -76.85194,47.27384 -81.89363,58.33914 -2.07325,4.55028 5.06837,12.14025 30.64981,32.57406 36.46196,29.12488 69.26686,65.31072 85.52126,94.33524 2.96748,5.29885 3.51067,5.77886 5.87429,5.19104 5.78435,-1.43853 13.65141,-1.58883 16.10445,-0.30766 3.86336,2.01774 6.14302,7.41627 5.39578,12.77787 -0.76998,5.52472 -6.08154,18.72476 -7.95698,19.77431 -1.12785,0.63118 -0.93872,2.13155 1.06351,8.4366 18.18221,57.25616 6.83804,119.96217 -30.84354,170.49057 -7.60209,10.19387 -24.66035,29.5814 -29.10027,33.07384 -4.13134,3.24972 -2.94153,3.6152 2.1915,0.67319 2.6125,-1.49736 6.059,-3.40446 7.65889,-4.238 z m 48.20803,-73.76641 c -1.6231,-4.22975 5.93188,-12.59869 9.97334,-11.04784 2.30104,0.88299 1.64686,6.16849 -1.17915,9.52701 -2.863,3.40248 -7.74796,4.24727 -8.79419,1.52083 z m 6.3105,-3.07896 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.35718,344.95718 c -0.59896,-0.59896 0.71852,-2.77671 3.57039,-5.90176 4.49396,-4.92444 4.53024,-4.94114 6.39205,-2.94272 4.59809,4.93547 10.43614,5.04076 16.23049,0.29273 9.4811,-7.76906 12.51876,-16.04339 8.59828,-23.42103 -3.66601,-6.89876 -13.61587,-10.87379 -18.76805,-7.49795 -1.40463,0.92034 -2.67938,1.5249 -2.83279,1.34345 -0.1534,-0.18144 -1.06474,-2.01552 -2.02519,-4.07573 -2.15629,-4.62531 -8.40603,-9.34517 -14.94594,-11.28732 C 557.84877,290.65683 551.64543,290 546.72287,290 c -7.29434,0 -9.42162,0.36137 -11.707,1.9887 -3.20944,2.28532 -8.1972,9.80578 -10.08638,15.20806 -1.33205,3.80911 -2.92949,4.1968 -2.92949,0.71098 0,-3.31152 4.88314,-11.84365 9.31119,-16.2691 6.7717,-6.76774 12.62445,-9.10873 22.68881,-9.07513 6.74386,0.0225 9.35587,0.47662 12.64255,2.19794 4.9379,2.58611 10.86671,9.22155 12.40547,13.88404 0.6089,1.84498 1.22805,3.35451 1.37589,3.35451 0.14785,0 1.67409,-0.70104 3.39164,-1.55787 10.01037,-4.99383 24.41791,-0.78532 29.1647,8.51915 9.35342,18.33422 -16.91793,42.06062 -36.65144,33.10093 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56799,2.83759 -4.86031,3.90289 -5.98282,2.78038 z m 36.91738,-10.44065 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.69926,-5.21337 -5.39124,-10.21957 -11.54252,-12.31553 -8.21098,-2.79776 -11.23849,-1.48152 -4.13071,1.79586 5.27789,2.43363 8.96571,8.62452 8.96571,15.05111 0,5.39901 -1.89382,9.71089 -6.30812,14.36248 -4.05348,4.27137 -2.15511,4.14766 3.58268,-0.23347 z m -34.10458,-44.52489 c -3.04537,-2.53799 -8.41833,-3.97914 -14.86096,-3.98606 -8.2149,-0.009 -7.08301,1.69186 1.46067,2.19468 4.43738,0.26116 9.00824,1.1503 10.73031,2.08731 4.08905,2.22493 5.50631,2.06784 2.66998,-0.29593 z M 427.5,559.33477 c 19.17554,-9.59937 35.84762,-22.30495 40.12693,-30.58023 1.36666,-2.64282 1.253,-3.20227 -1.83502,-9.03247 -4.54534,-8.58164 -21.76484,-26.11965 -40.28935,-41.03459 -8.25141,-6.64359 -18.21864,-14.92972 -22.1494,-18.41361 l -7.14684,-6.33435 -0.48718,47.78024 c -0.46549,45.65344 -1.22437,58.53471 -4.27118,72.49919 l -0.59323,2.71895 12.82263,-6.04824 C 410.72981,567.56313 421.45,562.36343 427.5,559.33477 z M 406.61692,511.4441 c -1.6231,-4.22975 5.93188,-12.59869 9.97334,-11.04784 2.30104,0.88299 1.64686,6.16849 -1.17915,9.52701 -2.863,3.40248 -7.74796,4.24727 -8.79419,1.52083 z m 6.3105,-3.07896 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 649.65503,450.26492 C 650.92336,439.55585 647.9907,434 641.06957,434 l -3.93042,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.8532 0.32447,0.92303 1.02658,0.22092 0.56461,-0.56461 1.29742,-3.31344 1.62845,-6.1085 z M 156.71291,449.98588 C 185.98001,447.79365 210.61751,446 211.46291,446 212.82472,446 213,440.42866 213,397.14246 l 0,-48.85755 -6.03828,-0.63112 c -11.75867,-1.22903 -21.11523,-7.52885 -23.95313,-16.12777 -1.86906,-5.6633 -0.83055,-21.71555 1.85232,-28.6313 4.76589,-12.28523 12.43645,-20.13629 22.88909,-23.4277 l 5.25,-1.65316 0,-78.51822 0,-78.51822 3.25,0.55078 c 1.7875,0.30293 42.74215,4.9339 91.01033,10.29103 l 87.76032,9.74024 10.23968,-9.97469 C 410.89215,125.8987 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.30336 c -105.43774,0.30176 -106.05039,0.31514 -115.5,2.52252 -24.27429,5.67034 -43.29936,14.37773 -59.21226,27.10028 -9.85424,7.87857 -24.40024,23.23402 -29.28774,30.91752 -2.2,3.45855 -5.41807,8.44562 -7.15128,11.08237 -5.38635,8.19435 -11.336893,24.15796 -14.58571,39.12934 -1.998444,9.20934 -2.073383,12.90695 -2.4493,120.85249 l -0.387782,111.35248 5.787036,-0.61661 c 3.182866,-0.33913 29.732846,-2.41025 58.999946,-4.60248 z M 96.616924,391.4441 c -1.623108,-4.22975 5.931876,-12.59869 9.973336,-11.04784 2.30104,0.88299 1.64686,6.16849 -1.17915,9.52701 -2.863,3.40248 -7.747955,4.24727 -8.794186,1.52083 z m 6.310496,-3.07896 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 138.36468,245.09782 C 130.42647,243.07661 126,236.84395 126,227.68785 c 0,-7.26177 2.95675,-14.72905 9.05807,-22.87618 6.00598,-8.01981 11.11798,-10.82235 19.68103,-10.78971 13.35207,0.0509 21.83422,8.89537 19.90896,20.75938 -1.58223,9.7501 -11.76522,23.79231 -20.39486,28.12423 -4.88523,2.45229 -11.35906,3.34553 -15.88852,2.19225 z m 13.17634,-3.95977 c 4.7126,-2.87384 10.76633,-15.60108 11.28343,-23.72208 C 163.55593,205.92841 158.97725,200 149.37361,200 c -3.01011,0 -6.71768,0.64369 -8.23905,1.43041 -5.71865,2.95723 -12.12261,15.40879 -12.86207,25.00839 -0.3993,5.18371 -0.1242,6.5679 1.90024,9.5612 4.48883,6.6371 14.83185,9.1241 21.36829,5.13805 z m 16.83181,-18.03404 c 3.93419,-8.76653 4.33967,-13.80406 1.45723,-18.10401 -2.39306,-3.5699 -9.6971,-8 -13.18983,-8 -1.49302,0 -1.16397,0.52027 1.43809,2.2738 8.01131,5.39882 10.45883,13.87183 7.2018,24.93177 -2.3943,8.13035 -0.79462,7.56058 3.09271,-1.10156 z M 654.90217,448.85078 C 656.69825,443.69856 656.28019,437.28019 654,435 c -1.1,-1.1 -2.88482,-2 -3.96627,-2 -1.9338,0 -1.93195,0.0582 0.1122,3.52276 1.41042,2.39048 2.12276,5.44132 2.21627,9.49189 0.15403,6.67213 0.9089,7.51502 2.53997,2.83613 z M 212.7651,315.23667 213.03021,286 l -6.51511,0 c -6.22887,0 -6.68478,0.16968 -10.37728,3.86218 -4.22343,4.22343 -8.49369,12.38048 -10.07728,19.2496 -1.33549,5.79294 -1.33374,18.03494 0.003,21.57312 2.36773,6.26671 10.26207,11.84102 18.85683,13.31508 8.21777,1.40941 7.54882,3.86218 7.84465,-28.76331 z M 213,283 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3428"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#715e26"
+       d="m 459.34349,733.75 -8.04113,-17.25 -85.22675,-0.25563 -85.22675,-0.25563 -9.67443,2.95841 c -27.02521,8.26424 -56.59348,9.99669 -85.78505,5.02627 C 121.12163,713.03064 71.981289,663.67909 53.481763,591.49887 46.520206,564.33673 44.02492,537.69174 44.009889,490.35699 c -0.0111,-34.94358 -0.637909,-32.34993 7.821898,-32.36568 2.567517,-0.005 7.016075,-0.29073 9.885683,-0.63544 l 5.21747,-0.62675 0.326656,-112.61456 c 0.322105,-111.04583 0.35705,-112.76779 2.50862,-123.61456 3.431599,-17.29982 12.259277,-41.13164 18.442804,-49.7895 1.257839,-1.76117 3.125388,-4.779 4.150109,-6.70631 3.535499,-6.6496 14.542941,-20.52692 22.328301,-28.14977 8.98461,-8.79706 25.41149,-21.78694 32.17793,-25.44533 2.54685,-1.37699 5.75564,-3.15598 7.13064,-3.9533 3.6162,-2.09692 25.7945,-11.086237 30.5,-12.362271 2.2,-0.596595 9.175,-2.311687 15.5,-3.811316 L 211.5,87.555604 337,87.027802 462.5,86.5 471,81.381488 c 4.675,-2.815182 13.675,-7.934592 20,-11.376466 6.325,-3.441874 12.88103,-7.087391 14.56895,-8.101149 l 3.06894,-1.843196 8.00577,13.219662 8.00577,13.219661 12.42529,0.679298 c 17.96747,0.982292 31.62253,3.432774 46.58182,8.359385 17.33626,5.709427 21.95763,8.049227 41.97836,21.253587 7.40091,4.88117 9.60905,6.80999 23.71405,20.71443 20.33743,20.04824 34.37972,45.10994 41.17892,73.4933 5.32549,22.23131 4.91129,7.35828 5.22967,187.78621 l 0.29342,166.2862 -2.51542,14.11709 c -3.60523,20.23335 -11.91032,43.62249 -18.92965,53.3105 -1.19549,1.65 -2.66657,4.125 -3.26907,5.5 -1.69996,3.8796 -13.94547,19.85104 -20.20356,26.35088 -12.93665,13.4364 -27.583,24.39434 -42.63326,31.89689 -22.02215,10.97803 -40.01005,16.47416 -61.68666,18.84811 -7.46117,0.81713 -9.61104,1.51292 -15.239,4.93202 -11.39704,6.92395 -30.52187,16.60204 -47.24399,23.90775 C 475.43704,747.82104 467.98608,751 467.77266,751 c -0.21342,0 -4.00655,-7.7625 -8.42917,-17.25 z m 43.4088,-35.79662 c 9.58011,-4.97565 20.97359,-11.27473 25.31886,-13.99797 54.5522,-34.1886 87.16358,-76.5693 97.13048,-126.22765 3.2312,-16.09889 3.2312,-43.35663 0,-59.45552 -7.38495,-36.7942 -27.3397,-71.70164 -60.66881,-106.12973 -12.103,-12.50209 -25.3346,-24.33674 -44.60069,-39.89189 -33.63031,-27.15261 -44.81082,-46.85813 -36.64803,-64.59171 8.14394,-17.69265 31.72044,-37.61556 74.21919,-62.71766 C 562.17648,222.181 566,219.6779 566,219.3788 c 0,-0.75964 -59.30646,-98.36732 -64.7877,-106.6288 -2.46313,-3.7125 -4.69439,-6.75 -4.95836,-6.75 -1.59178,0 -20.47096,11.4949 -29.88925,18.19857 -21.97664,15.64234 -46.81971,38.3966 -62.01573,56.80143 -14.66536,17.76213 -31.2885,45.7742 -37.38593,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 11.14033,26.07573 34.02834,55.23391 61.28481,78.07379 4.74217,3.97375 8.90467,7.22501 9.25,7.22501 0.34533,0 1.4429,0.7875 2.43905,1.75 0.99615,0.9625 6.31833,5.4463 11.82705,9.96401 13.16235,10.79442 31.67513,29.95826 37.68464,39.00991 16.00556,24.10795 13.72041,41.9162 -7.99444,62.30102 -9.98642,9.37477 -21.83806,17.31102 -39.29934,26.31615 -7.441,3.83747 -13.69337,7.10738 -13.89416,7.26647 C 430.27928,595.28549 483.51731,707 484.69604,707 c 0.35083,0 8.47615,-4.07098 18.05625,-9.04662 z m -262.15947,-7.00127 c 26.59333,-2.70777 53.90323,-16.36436 74.85393,-37.43145 24.92122,-25.05968 39.35274,-55.05493 46.19814,-96.02066 1.40508,-8.4086 1.73662,-20.27213 2.08333,-74.54793 l 0.41233,-64.54792 -6.97689,-10.45208 C 341.53832,384.54378 331.42682,359.77387 326.36284,332.5 c -1.47759,-7.9581 -1.84714,-14.69637 -1.80984,-33 0.0429,-21.04472 0.27511,-24.07507 2.73168,-35.6461 5.78758,-27.26082 17.04854,-54.01626 32.30884,-76.76403 C 363.26526,181.61659 364,179.72756 364,175.76068 364,173.1423 363.58102,171 363.06893,171 362.55684,171 336.87582,168.075 306,164.5 275.12418,160.925 249.2282,158 248.45338,158 c -1.20569,0 -1.45349,27.56847 -1.71904,191.25 -0.34786,214.40609 0.26317,197.33864 -7.67334,214.33313 -6.4772,13.86964 -13.56995,19.39675 -24.90987,19.41129 -6.17889,0.008 -10.21177,-2.27434 -13.85636,-7.8415 C 192.61039,563.41488 189.45391,546.6328 187.85232,509 c -0.6437,-15.125 -1.24596,-27.60966 -1.33836,-27.74368 -0.0924,-0.13403 -21.05833,1.37028 -46.59098,3.34291 -64.202194,4.96019 -62.683136,4.82759 -63.388611,5.53307 -0.975172,0.97517 1.264139,43.21817 2.996309,56.52324 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 127.05288,-6.41667 c 4.16704,-3.55551 9.65744,-7.47196 12.2009,-8.70323 5.49768,-2.66138 14.5955,-3.46829 18.1534,-1.61008 3.80172,1.98555 6.14762,7.43008 5.39793,12.52787 l -0.62502,4.25 18.06252,0 18.06252,0 -1.37706,-3.25 c -2.55746,-6.03589 -47.29497,-100.85742 -47.84461,-101.40705 -0.29966,-0.29966 -1.02841,1.41309 -1.61944,3.80611 -2.82248,11.42776 -8.72549,27.68343 -13.96514,38.4571 -9.21699,18.95179 -18.46672,31.83081 -34.57695,48.14384 L 325.4419,691 l 17.31369,0 17.31369,0 7.57642,-6.46456 z M 394,688.64922 c 0,-3.71455 -2.04108,-8.60084 -4.03944,-9.67033 -2.9569,-1.58248 -6.96886,-1.13374 -10.84253,1.21275 C 374.12973,683.21333 367,689.05502 367,690.12046 367,690.60421 373.075,691 380.5,691 l 13.5,0 0,-2.35078 z M 400,686 c 0,-5.46541 -2.34315,-9 -5.96627,-9 -1.93234,0 -1.93425,0.0561 -0.11065,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 C 397.45978,693.11041 400,692.21981 400,686 z m 202.40889,-14.78949 c 9.12437,-4.75377 25.07096,-17.88543 34.25777,-28.21051 5.13852,-5.77521 11.18096,-14.14917 14.79227,-20.5 7.54638,-13.27104 8.87875,-16.13787 12.17635,-26.19953 7.24317,-22.10046 6.78634,-9.89589 7.1045,-189.80047 0.17842,-100.88931 -0.0788,-164.45197 -0.68183,-168.5 -2.3362,-15.68196 -3.41375,-20.93917 -5.68871,-27.75424 -4.12954,-12.37082 -8.21522,-22.40623 -10.64772,-26.15332 -11.83968,-18.23817 -14.66547,-21.79617 -25.72831,-32.39498 -6.52391,-6.25027 -14.6115,-13.12663 -17.97242,-15.28079 -3.36092,-2.15417 -8.43612,-5.41308 -11.27824,-7.24202 -12.31541,-7.92516 -31.40127,-13.68119 -54.5355,-16.44716 -2.08995,-0.24988 -3.14084,0.002 -2.87658,0.6894 0.32186,0.83724 28.38357,47.19413 71.26534,117.72762 0.21551,0.35449 -6.46788,4.3801 -14.85199,8.9458 -44.53676,24.25325 -76.85194,47.27384 -81.89363,58.33914 -2.07325,4.55028 5.06837,12.14025 30.64981,32.57406 36.46196,29.12488 69.26686,65.31072 85.52126,94.33524 2.96748,5.29885 3.51067,5.77886 5.87429,5.19104 5.78435,-1.43853 13.65141,-1.58883 16.10445,-0.30766 3.86336,2.01774 6.14302,7.41627 5.39578,12.77787 -0.76998,5.52472 -6.08154,18.72476 -7.95698,19.77431 -1.12785,0.63118 -0.93872,2.13155 1.06351,8.4366 18.18221,57.25616 6.83804,119.96217 -30.84354,170.49057 -7.60209,10.19387 -24.66035,29.5814 -29.10027,33.07384 -4.13134,3.24972 -2.94153,3.6152 2.1915,0.67319 2.6125,-1.49736 6.059,-3.40446 7.65889,-4.238 z m 48.20803,-73.76641 c -1.6231,-4.22975 5.93188,-12.59869 9.97334,-11.04784 2.30104,0.88299 1.64686,6.16849 -1.17915,9.52701 -2.863,3.40248 -7.74796,4.24727 -8.79419,1.52083 z m 6.3105,-3.07896 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.35718,344.95718 c -0.59896,-0.59896 0.71852,-2.77671 3.57039,-5.90176 4.49396,-4.92444 4.53024,-4.94114 6.39205,-2.94272 4.59809,4.93547 10.43614,5.04076 16.23049,0.29273 9.4811,-7.76906 12.51876,-16.04339 8.59828,-23.42103 -3.66601,-6.89876 -13.61587,-10.87379 -18.76805,-7.49795 -1.40463,0.92034 -2.67938,1.5249 -2.83279,1.34345 -0.1534,-0.18144 -1.06474,-2.01552 -2.02519,-4.07573 -2.15629,-4.62531 -8.40603,-9.34517 -14.94594,-11.28732 C 557.84877,290.65683 551.64543,290 546.72287,290 c -7.29434,0 -9.42162,0.36137 -11.707,1.9887 -3.20944,2.28532 -8.1972,9.80578 -10.08638,15.20806 -1.33205,3.80911 -2.92949,4.1968 -2.92949,0.71098 0,-3.31152 4.88314,-11.84365 9.31119,-16.2691 6.7717,-6.76774 12.62445,-9.10873 22.68881,-9.07513 6.74386,0.0225 9.35587,0.47662 12.64255,2.19794 4.9379,2.58611 10.86671,9.22155 12.40547,13.88404 0.6089,1.84498 1.22805,3.35451 1.37589,3.35451 0.14785,0 1.67409,-0.70104 3.39164,-1.55787 10.01037,-4.99383 24.41791,-0.78532 29.1647,8.51915 9.35342,18.33422 -16.91793,42.06062 -36.65144,33.10093 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56799,2.83759 -4.86031,3.90289 -5.98282,2.78038 z m 36.91738,-10.44065 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.69926,-5.21337 -5.39124,-10.21957 -11.54252,-12.31553 -8.21098,-2.79776 -11.23849,-1.48152 -4.13071,1.79586 5.27789,2.43363 8.96571,8.62452 8.96571,15.05111 0,5.39901 -1.89382,9.71089 -6.30812,14.36248 -4.05348,4.27137 -2.15511,4.14766 3.58268,-0.23347 z m -34.10458,-44.52489 c -3.04537,-2.53799 -8.41833,-3.97914 -14.86096,-3.98606 -8.2149,-0.009 -7.08301,1.69186 1.46067,2.19468 4.43738,0.26116 9.00824,1.1503 10.73031,2.08731 4.08905,2.22493 5.50631,2.06784 2.66998,-0.29593 z M 427.5,559.33477 c 19.17554,-9.59937 35.84762,-22.30495 40.12693,-30.58023 1.36666,-2.64282 1.253,-3.20227 -1.83502,-9.03247 -4.54534,-8.58164 -21.76484,-26.11965 -40.28935,-41.03459 -8.25141,-6.64359 -18.21864,-14.92972 -22.1494,-18.41361 l -7.14684,-6.33435 -0.48718,47.78024 c -0.46549,45.65344 -1.22437,58.53471 -4.27118,72.49919 l -0.59323,2.71895 12.82263,-6.04824 C 410.72981,567.56313 421.45,562.36343 427.5,559.33477 z M 406.61692,511.4441 c -1.6231,-4.22975 5.93188,-12.59869 9.97334,-11.04784 2.30104,0.88299 1.64686,6.16849 -1.17915,9.52701 -2.863,3.40248 -7.74796,4.24727 -8.79419,1.52083 z m 6.3105,-3.07896 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 649.65503,450.26492 C 650.92336,439.55585 647.9907,434 641.06957,434 l -3.93042,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.8532 0.32447,0.92303 1.02658,0.22092 0.56461,-0.56461 1.29742,-3.31344 1.62845,-6.1085 z M 156.71291,449.98588 C 185.98001,447.79365 210.61751,446 211.46291,446 212.82472,446 213,440.42866 213,397.14246 l 0,-48.85755 -6.03828,-0.63112 c -11.75867,-1.22903 -21.11523,-7.52885 -23.95313,-16.12777 -1.86906,-5.6633 -0.83055,-21.71555 1.85232,-28.6313 4.76589,-12.28523 12.43645,-20.13629 22.88909,-23.4277 l 5.25,-1.65316 0,-78.51822 0,-78.51822 3.25,0.55078 c 1.7875,0.30293 42.74215,4.9339 91.01033,10.29103 l 87.76032,9.74024 10.23968,-9.97469 C 410.89215,125.8987 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.30336 c -105.43774,0.30176 -106.05039,0.31514 -115.5,2.52252 -24.27429,5.67034 -43.29936,14.37773 -59.21226,27.10028 -9.85424,7.87857 -24.40024,23.23402 -29.28774,30.91752 -2.2,3.45855 -5.42287,8.4526 -7.16194,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.6431,8.23926 -1.818238,18.15255 -2.125875,120.33101 l -0.335257,111.35204 5.783146,-0.61616 c 3.180726,-0.33888 29.728956,-2.4098 58.996056,-4.60203 z M 96.616924,391.4441 c -1.623108,-4.22975 5.931876,-12.59869 9.973336,-11.04784 2.30104,0.88299 1.64686,6.16849 -1.17915,9.52701 -2.863,3.40248 -7.747955,4.24727 -8.794186,1.52083 z m 6.310496,-3.07896 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 138.36468,245.09782 C 130.42647,243.07661 126,236.84395 126,227.68785 c 0,-7.26177 2.95675,-14.72905 9.05807,-22.87618 6.00598,-8.01981 11.11798,-10.82235 19.68103,-10.78971 13.35207,0.0509 21.83422,8.89537 19.90896,20.75938 -1.58223,9.7501 -11.76522,23.79231 -20.39486,28.12423 -4.88523,2.45229 -11.35906,3.34553 -15.88852,2.19225 z m 13.17634,-3.95977 c 4.7126,-2.87384 10.76633,-15.60108 11.28343,-23.72208 C 163.55593,205.92841 158.97725,200 149.37361,200 c -3.01011,0 -6.71768,0.64369 -8.23905,1.43041 -5.71865,2.95723 -12.12261,15.40879 -12.86207,25.00839 -0.3993,5.18371 -0.1242,6.5679 1.90024,9.5612 4.48883,6.6371 14.83185,9.1241 21.36829,5.13805 z m 16.83181,-18.03404 c 3.93419,-8.76653 4.33967,-13.80406 1.45723,-18.10401 -2.39306,-3.5699 -9.6971,-8 -13.18983,-8 -1.49302,0 -1.16397,0.52027 1.43809,2.2738 8.01131,5.39882 10.45883,13.87183 7.2018,24.93177 -2.3943,8.13035 -0.79462,7.56058 3.09271,-1.10156 z M 654.90217,448.85078 C 656.69825,443.69856 656.28019,437.28019 654,435 c -1.1,-1.1 -2.88482,-2 -3.96627,-2 -1.9338,0 -1.93195,0.0582 0.1122,3.52276 1.41042,2.39048 2.12276,5.44132 2.21627,9.49189 0.15403,6.67213 0.9089,7.51502 2.53997,2.83613 z M 212.7651,315.23667 213.03021,286 l -6.51511,0 c -6.22887,0 -6.68478,0.16968 -10.37728,3.86218 -4.22343,4.22343 -8.49369,12.38048 -10.07728,19.2496 -1.33549,5.79294 -1.33374,18.03494 0.003,21.57312 2.36773,6.26671 10.26207,11.84102 18.85683,13.31508 8.21777,1.40941 7.54882,3.86218 7.84465,-28.76331 z M 213,283 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3426"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#5b593c"
+       d="m 459.34349,733.75 -8.04113,-17.25 -85.22675,-0.25563 -85.22675,-0.25563 -9.67443,2.95841 c -27.02521,8.26424 -56.59348,9.99669 -85.78505,5.02627 C 121.12163,713.03064 71.981289,663.67909 53.481763,591.49887 46.520206,564.33673 44.02492,537.69174 44.009889,490.35699 c -0.0111,-34.94358 -0.637909,-32.34993 7.821898,-32.36568 2.567517,-0.005 7.016075,-0.29073 9.885683,-0.63544 l 5.21747,-0.62675 0.326656,-112.61456 c 0.322105,-111.04583 0.35705,-112.76779 2.50862,-123.61456 3.431599,-17.29982 12.259277,-41.13164 18.442804,-49.7895 1.257839,-1.76117 3.125388,-4.779 4.150109,-6.70631 3.535499,-6.6496 14.542941,-20.52692 22.328301,-28.14977 8.98461,-8.79706 25.41149,-21.78694 32.17793,-25.44533 2.54685,-1.37699 5.75564,-3.15598 7.13064,-3.9533 3.6162,-2.09692 25.7945,-11.086237 30.5,-12.362271 2.2,-0.596595 9.175,-2.311687 15.5,-3.811316 L 211.5,87.555604 337,87.027802 462.5,86.5 471,81.381488 c 4.675,-2.815182 13.675,-7.934592 20,-11.376466 6.325,-3.441874 12.88103,-7.087391 14.56895,-8.101149 l 3.06894,-1.843196 8.00577,13.219662 8.00577,13.219661 12.42529,0.679298 c 17.96747,0.982292 31.62253,3.432774 46.58182,8.359385 17.33626,5.709427 21.95763,8.049227 41.97836,21.253587 7.40091,4.88117 9.60905,6.80999 23.71405,20.71443 20.33743,20.04824 34.37972,45.10994 41.17892,73.4933 5.32549,22.23131 4.91129,7.35828 5.22967,187.78621 l 0.29342,166.2862 -2.51542,14.11709 c -3.60523,20.23335 -11.91032,43.62249 -18.92965,53.3105 -1.19549,1.65 -2.66657,4.125 -3.26907,5.5 -1.69996,3.8796 -13.94547,19.85104 -20.20356,26.35088 -12.93665,13.4364 -27.583,24.39434 -42.63326,31.89689 -22.02215,10.97803 -40.01005,16.47416 -61.68666,18.84811 -7.46117,0.81713 -9.61104,1.51292 -15.239,4.93202 -11.39704,6.92395 -30.52187,16.60204 -47.24399,23.90775 C 475.43704,747.82104 467.98608,751 467.77266,751 c -0.21342,0 -4.00655,-7.7625 -8.42917,-17.25 z m 43.4088,-35.79662 c 25.7493,-13.37348 40.55902,-23.05089 59.27979,-38.73635 C 615.74061,614.21656 638.44435,552.13511 623.55054,491 611.87087,443.05806 580.66243,401.28531 519.82708,352.1653 c -22.66047,-18.29665 -34.84926,-33.23566 -38.37613,-47.03517 -1.3245,-5.18234 -1.41608,-7.21152 -0.49124,-10.8844 4.60837,-18.30152 26.65862,-39.09471 67.70365,-63.84396 8.71015,-5.25203 16.22698,-9.92882 16.70405,-10.39287 C 566.50622,218.9012 498.07682,106 496.26664,106 c -0.25699,0 -4.90308,2.48965 -10.32466,5.53256 -25.52297,14.32501 -60.92716,44.47029 -81.5862,69.46744 -14.65278,17.72965 -31.29104,45.76211 -37.39275,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7062,22.71893 29.63611,49.8005 50.32192,68.37947 C 432.67167,442.31872 439.59399,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34787 12.33333,10.86687 6.6,5.519 16.73002,14.93475 22.51114,20.9239 31.79616,32.94024 33.9092,55.2854 7.5829,80.18827 -9.45137,8.94034 -24.30198,18.85216 -40.73349,27.18695 -6.7983,3.44841 -12.52411,6.41055 -12.72401,6.58255 C 430.2714,595.32524 483.47449,707 484.69426,707 c 0.35181,0 8.47793,-4.07098 18.05803,-9.04662 z m -262.15947,-7.00127 c 26.57525,-2.70593 53.87598,-16.35266 74.85393,-37.417 12.6548,-12.70692 21.00858,-24.47335 29.13361,-41.03511 7.48272,-15.25252 11.56922,-27.30454 14.89898,-43.94053 3.91886,-19.57926 4.51363,-31.78643 4.51724,-92.71266 L 364,418.19362 357.09338,407.84681 C 341.54133,384.54828 331.41834,359.72817 326.36284,332.5 c -1.47759,-7.9581 -1.84714,-14.69637 -1.80984,-33 0.0429,-21.04472 0.27511,-24.07507 2.73168,-35.6461 5.78758,-27.26082 17.04854,-54.01626 32.30884,-76.76403 C 363.26526,181.61659 364,179.72756 364,175.76068 364,173.1423 363.58102,171 363.06893,171 362.55684,171 336.87582,168.075 306,164.5 275.12418,160.925 249.21816,158 248.43107,158 247.19478,158 247,183.28527 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -1.9599,16.24939 -7.58891,30.41973 -15.23964,38.36394 -4.53709,4.71114 -9.22095,6.59466 -16.42321,6.60425 -7.96818,0.0106 -11.52208,-2.61656 -16.33354,-12.07438 -6.20817,-12.20332 -8.59761,-26.86895 -10.08853,-61.92004 -0.64335,-15.125 -1.26134,-27.61637 -1.37331,-27.75859 -0.16186,-0.2056 -54.09268,3.84992 -101.688362,7.64683 -4.217754,0.33647 -7.952282,0.89629 -8.298952,1.24404 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 127.05288,-6.41667 c 4.16704,-3.55551 9.65744,-7.47196 12.2009,-8.70323 5.49768,-2.66138 14.5955,-3.46829 18.1534,-1.61008 3.80172,1.98555 6.14762,7.43008 5.39793,12.52787 l -0.62502,4.25 18.0888,0 18.08879,0 -0.89914,-2.25 c -1.64247,-4.11013 -47.7973,-101.82927 -48.36361,-102.39558 -0.30596,-0.30597 -1.0515,1.40162 -1.65675,3.79464 -8.78903,34.74986 -23.83792,61.61196 -48.51625,86.60094 L 325.4419,691 l 17.31369,0 17.31369,0 7.57642,-6.46456 z M 394,688.64922 c 0,-3.71455 -2.04108,-8.60084 -4.03944,-9.67033 -2.9569,-1.58248 -6.96886,-1.13374 -10.84253,1.21275 C 374.12973,683.21333 367,689.05502 367,690.12046 367,690.60421 373.075,691 380.5,691 l 13.5,0 0,-2.35078 z M 400,686 c 0,-5.46541 -2.34315,-9 -5.96627,-9 -1.93234,0 -1.93425,0.0561 -0.11065,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 C 397.45978,693.11041 400,692.21981 400,686 z m 210.95566,-20.09476 c 14.83061,-9.97103 31.88229,-28.24442 40.50327,-43.40524 7.38778,-12.99214 8.65888,-15.69469 11.99589,-25.50523 7.41459,-21.79829 6.96272,-9.98019 7.28354,-190.49477 0.17932,-100.89695 -0.0773,-164.45167 -0.68041,-168.5 -2.3362,-15.68196 -3.41375,-20.93917 -5.68871,-27.75424 -4.12954,-12.37082 -8.21522,-22.40623 -10.64772,-26.15332 -11.83968,-18.23817 -14.66547,-21.79617 -25.72831,-32.39498 -6.52391,-6.25027 -14.60857,-13.12663 -17.9659,-15.28079 -3.35734,-2.15417 -8.83901,-5.67618 -12.18149,-7.82668 -8.00491,-5.15024 -28.37757,-12.17907 -40.60942,-14.01078 -15.13476,-2.26641 -16.36492,-2.3563 -15.90593,-1.16232 0.32186,0.83724 28.38357,47.19413 71.26534,117.72762 0.21551,0.35449 -6.46788,4.37481 -14.85199,8.93405 -43.06166,23.41675 -75.19802,46.06522 -81.21424,57.23665 l -1.89741,3.52328 4.18693,5.42703 c 4.03069,5.22452 10.58724,11.08401 27.6809,24.73799 35.53905,28.38768 66.31216,61.95955 83.66326,91.27229 4.83694,8.17147 5.45688,8.82689 7.79578,8.24186 5.70482,-1.42696 13.59624,-1.57235 16.04096,-0.29553 3.86336,2.01774 6.14302,7.41627 5.39578,12.77787 -0.76998,5.52472 -6.08154,18.72476 -7.95698,19.77431 -1.12785,0.63118 -0.93872,2.13155 1.06351,8.4366 18.16006,57.1864 6.81497,119.99208 -30.7822,170.40814 -7.65249,10.26165 -24.70682,29.65214 -29.16161,33.15627 -1.40717,1.10689 -2.5585,2.31678 -2.5585,2.68865 0,0.86969 13.75311,-6.71625 20.95566,-11.55873 z m 39.66126,-68.46114 c -1.6231,-4.22975 5.93188,-12.59869 9.97334,-11.04784 2.30104,0.88299 1.64686,6.16849 -1.17915,9.52701 -2.863,3.40248 -7.74796,4.24727 -8.79419,1.52083 z m 6.3105,-3.07896 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.35718,344.95718 c -0.59896,-0.59896 0.71852,-2.77671 3.57039,-5.90176 4.49396,-4.92444 4.53024,-4.94114 6.39205,-2.94272 4.59809,4.93547 10.43614,5.04076 16.23049,0.29273 9.4811,-7.76906 12.51876,-16.04339 8.59828,-23.42103 -3.66601,-6.89876 -13.61587,-10.87379 -18.76805,-7.49795 -1.40463,0.92034 -2.67938,1.5249 -2.83279,1.34345 -0.1534,-0.18144 -1.06474,-2.01552 -2.02519,-4.07573 -2.15629,-4.62531 -8.40603,-9.34517 -14.94594,-11.28732 C 557.84877,290.65683 551.64543,290 546.72287,290 c -7.29434,0 -9.42162,0.36137 -11.707,1.9887 -3.20944,2.28532 -8.1972,9.80578 -10.08638,15.20806 -1.33205,3.80911 -2.92949,4.1968 -2.92949,0.71098 0,-3.31152 4.88314,-11.84365 9.31119,-16.2691 6.7717,-6.76774 12.62445,-9.10873 22.68881,-9.07513 6.74386,0.0225 9.35587,0.47662 12.64255,2.19794 4.9379,2.58611 10.86671,9.22155 12.40547,13.88404 0.6089,1.84498 1.22805,3.35451 1.37589,3.35451 0.14785,0 1.67409,-0.70104 3.39164,-1.55787 10.01037,-4.99383 24.41791,-0.78532 29.1647,8.51915 9.35342,18.33422 -16.91793,42.06062 -36.65144,33.10093 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56799,2.83759 -4.86031,3.90289 -5.98282,2.78038 z m 36.91738,-10.44065 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.69926,-5.21337 -5.39124,-10.21957 -11.54252,-12.31553 -8.21098,-2.79776 -11.23849,-1.48152 -4.13071,1.79586 5.27789,2.43363 8.96571,8.62452 8.96571,15.05111 0,5.39901 -1.89382,9.71089 -6.30812,14.36248 -4.05348,4.27137 -2.15511,4.14766 3.58268,-0.23347 z m -34.10458,-44.52489 c -3.04537,-2.53799 -8.41833,-3.97914 -14.86096,-3.98606 -8.2149,-0.009 -7.08301,1.69186 1.46067,2.19468 4.43738,0.26116 9.00824,1.1503 10.73031,2.08731 4.08905,2.22493 5.50631,2.06784 2.66998,-0.29593 z M 426.5,559.85789 c 20.31867,-10.1816 36.71492,-22.57146 41.10513,-31.0612 1.38994,-2.68784 1.29367,-3.20661 -1.60394,-8.64307 C 460.2184,509.30399 446.9994,495.89686 423.5,477.04757 c -7.15,-5.73515 -16.21608,-13.28066 -20.14684,-16.7678 l -7.14684,-6.34025 -0.48718,47.78024 c -0.46555,45.65964 -1.22426,58.53437 -4.27276,72.50638 l -0.59481,2.72614 11.82422,-5.54062 C 409.1791,568.36432 419.9,563.16512 426.5,559.85789 z M 406.61692,511.4441 c -1.6231,-4.22975 5.93188,-12.59869 9.97334,-11.04784 2.30104,0.88299 1.64686,6.16849 -1.17915,9.52701 -2.863,3.40248 -7.74796,4.24727 -8.79419,1.52083 z m 6.3105,-3.07896 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 649.65503,450.26492 C 650.92336,439.55585 647.9907,434 641.06957,434 l -3.93042,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.8532 0.32447,0.92303 1.02658,0.22092 0.56461,-0.56461 1.29742,-3.31344 1.62845,-6.1085 z M 157.37784,449.95991 C 186.46065,447.78196 210.87315,446 211.62784,446 212.772,446 213,437.88172 213,397.14246 l 0,-48.85755 -6.03828,-0.63112 c -11.75867,-1.22903 -21.11523,-7.52885 -23.95313,-16.12777 -1.86906,-5.6633 -0.83055,-21.71555 1.85232,-28.6313 4.76589,-12.28523 12.43645,-20.13629 22.88909,-23.4277 l 5.25,-1.65316 0,-78.51822 0,-78.51822 3.25,0.55524 c 1.7875,0.30539 42.73875,4.9397 91.00277,10.29847 l 87.75277,9.74322 10.24723,-9.98213 C 410.88875,125.90205 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.31378 -106,0.31377 -11.70252,2.70309 c -20.21819,4.67005 -39.79562,13.53488 -54.66494,24.75274 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.62323 c 3.455719,-0.34278 30.078159,-2.40519 59.160969,-4.58314 z M 96.616924,391.4441 c -1.623108,-4.22975 5.931876,-12.59869 9.973336,-11.04784 2.30104,0.88299 1.64686,6.16849 -1.17915,9.52701 -2.863,3.40248 -7.747955,4.24727 -8.794186,1.52083 z m 6.310496,-3.07896 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 138.36468,245.09782 C 130.42647,243.07661 126,236.84395 126,227.68785 c 0,-7.26177 2.95675,-14.72905 9.05807,-22.87618 6.00598,-8.01981 11.11798,-10.82235 19.68103,-10.78971 13.35207,0.0509 21.83422,8.89537 19.90896,20.75938 -1.58223,9.7501 -11.76522,23.79231 -20.39486,28.12423 -4.88523,2.45229 -11.35906,3.34553 -15.88852,2.19225 z m 13.17634,-3.95977 c 4.7126,-2.87384 10.76633,-15.60108 11.28343,-23.72208 C 163.55593,205.92841 158.97725,200 149.37361,200 c -3.01011,0 -6.71768,0.64369 -8.23905,1.43041 -5.71865,2.95723 -12.12261,15.40879 -12.86207,25.00839 -0.3993,5.18371 -0.1242,6.5679 1.90024,9.5612 4.48883,6.6371 14.83185,9.1241 21.36829,5.13805 z m 16.83181,-18.03404 c 3.93419,-8.76653 4.33967,-13.80406 1.45723,-18.10401 -2.39306,-3.5699 -9.6971,-8 -13.18983,-8 -1.49302,0 -1.16397,0.52027 1.43809,2.2738 8.01131,5.39882 10.45883,13.87183 7.2018,24.93177 -2.3943,8.13035 -0.79462,7.56058 3.09271,-1.10156 z M 654.90217,448.85078 C 656.69825,443.69856 656.28019,437.28019 654,435 c -1.1,-1.1 -2.88482,-2 -3.96627,-2 -1.9338,0 -1.93195,0.0582 0.1122,3.52276 1.41042,2.39048 2.12276,5.44132 2.21627,9.49189 0.15403,6.67213 0.9089,7.51502 2.53997,2.83613 z M 212.7651,315.23667 213.03021,286 l -6.51511,0 c -6.22887,0 -6.68478,0.16968 -10.37728,3.86218 -4.22343,4.22343 -8.49369,12.38048 -10.07728,19.2496 -1.33549,5.79294 -1.33374,18.03494 0.003,21.57312 2.36773,6.26671 10.26207,11.84102 18.85683,13.31508 8.21777,1.40941 7.54882,3.86218 7.84465,-28.76331 z M 213,283 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3424"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#635534"
+       d="m 459.34349,733.75 -8.04113,-17.25 -85.22675,-0.25563 -85.22675,-0.25563 -9.67443,2.95841 c -27.02521,8.26424 -56.59348,9.99669 -85.78505,5.02627 C 121.12163,713.03064 71.981289,663.67909 53.481763,591.49887 46.520206,564.33673 44.02492,537.69174 44.009889,490.35699 c -0.0111,-34.94358 -0.637909,-32.34993 7.821898,-32.36568 2.567517,-0.005 7.016075,-0.29073 9.885683,-0.63544 l 5.21747,-0.62675 0.326656,-112.61456 c 0.322105,-111.04583 0.35705,-112.76779 2.50862,-123.61456 3.431599,-17.29982 12.259277,-41.13164 18.442804,-49.7895 1.257839,-1.76117 3.125388,-4.779 4.150109,-6.70631 3.535499,-6.6496 14.542941,-20.52692 22.328301,-28.14977 8.98461,-8.79706 25.41149,-21.78694 32.17793,-25.44533 2.54685,-1.37699 5.75564,-3.15598 7.13064,-3.9533 3.6162,-2.09692 25.7945,-11.086237 30.5,-12.362271 2.2,-0.596595 9.175,-2.311687 15.5,-3.811316 L 211.5,87.555604 337,87.027802 462.5,86.5 471,81.381488 c 4.675,-2.815182 13.675,-7.934592 20,-11.376466 6.325,-3.441874 12.88103,-7.087391 14.56895,-8.101149 l 3.06894,-1.843196 8.00577,13.219662 8.00577,13.219661 12.42529,0.679298 c 17.96747,0.982292 31.62253,3.432774 46.58182,8.359385 17.33626,5.709427 21.95763,8.049227 41.97836,21.253587 7.40091,4.88117 9.60905,6.80999 23.71405,20.71443 20.33743,20.04824 34.37972,45.10994 41.17892,73.4933 5.32549,22.23131 4.91129,7.35828 5.22967,187.78621 l 0.29342,166.2862 -2.51542,14.11709 c -3.60523,20.23335 -11.91032,43.62249 -18.92965,53.3105 -1.19549,1.65 -2.66657,4.125 -3.26907,5.5 -1.69996,3.8796 -13.94547,19.85104 -20.20356,26.35088 -12.93665,13.4364 -27.583,24.39434 -42.63326,31.89689 -22.02215,10.97803 -40.01005,16.47416 -61.68666,18.84811 -7.46117,0.81713 -9.61104,1.51292 -15.239,4.93202 -11.39704,6.92395 -30.52187,16.60204 -47.24399,23.90775 C 475.43704,747.82104 467.98608,751 467.77266,751 c -0.21342,0 -4.00655,-7.7625 -8.42917,-17.25 z m 43.4088,-35.79662 c 25.7493,-13.37348 40.55902,-23.05089 59.27979,-38.73635 C 615.74061,614.21656 638.44435,552.13511 623.55054,491 611.87087,443.05806 580.66243,401.28531 519.82708,352.1653 c -22.66047,-18.29665 -34.84926,-33.23566 -38.37613,-47.03517 -1.3245,-5.18234 -1.41608,-7.21152 -0.49124,-10.8844 4.60837,-18.30152 26.65862,-39.09471 67.70365,-63.84396 8.71015,-5.25203 16.22698,-9.92882 16.70405,-10.39287 C 566.50622,218.9012 498.07682,106 496.26664,106 c -0.25699,0 -4.90308,2.48965 -10.32466,5.53256 -25.52297,14.32501 -60.92716,44.47029 -81.5862,69.46744 -14.65278,17.72965 -31.29104,45.76211 -37.39275,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7062,22.71893 29.63611,49.8005 50.32192,68.37947 C 432.67167,442.31872 439.59399,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34787 12.33333,10.86687 6.6,5.519 16.73002,14.93475 22.51114,20.9239 31.79616,32.94024 33.9092,55.2854 7.5829,80.18827 -9.45137,8.94034 -24.30198,18.85216 -40.73349,27.18695 -6.7983,3.44841 -12.52411,6.41055 -12.72401,6.58255 C 430.2714,595.32524 483.47449,707 484.69426,707 c 0.35181,0 8.47793,-4.07098 18.05803,-9.04662 z m -262.15947,-7.00127 c 26.57525,-2.70593 53.87598,-16.35266 74.85393,-37.417 12.6548,-12.70692 21.00858,-24.47335 29.13361,-41.03511 7.48272,-15.25252 11.56922,-27.30454 14.89898,-43.94053 3.91886,-19.57926 4.51363,-31.78643 4.51724,-92.71266 L 364,418.19362 357.09338,407.84681 C 341.54133,384.54828 331.41834,359.72817 326.36284,332.5 c -1.47759,-7.9581 -1.84714,-14.69637 -1.80984,-33 0.0429,-21.04472 0.27511,-24.07507 2.73168,-35.6461 5.78758,-27.26082 17.04854,-54.01626 32.30884,-76.76403 C 363.26526,181.61659 364,179.72756 364,175.76068 364,173.1423 363.58102,171 363.06893,171 362.55684,171 336.87582,168.075 306,164.5 275.12418,160.925 249.21816,158 248.43107,158 247.19478,158 247,183.28527 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -1.9599,16.24939 -7.58891,30.41973 -15.23964,38.36394 -4.53709,4.71114 -9.22095,6.59466 -16.42321,6.60425 -7.96818,0.0106 -11.52208,-2.61656 -16.33354,-12.07438 -6.20817,-12.20332 -8.59761,-26.86895 -10.08853,-61.92004 -0.64335,-15.125 -1.26134,-27.61637 -1.37331,-27.75859 -0.16186,-0.2056 -54.09268,3.84992 -101.688362,7.64683 -4.217754,0.33647 -7.952282,0.89629 -8.298952,1.24404 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 125.03909,-4.53664 c 12.84336,-12.09524 25.06819,-16.3347 33.05672,-11.46375 3.62913,2.21283 5.22896,6.5456 4.54101,12.29828 l -0.44845,3.75 18.08465,0 18.08466,0 -0.89914,-2.25 c -1.64247,-4.11013 -47.7973,-101.82927 -48.36361,-102.39558 -0.30596,-0.30597 -1.0515,1.40162 -1.65675,3.79464 -8.78903,34.74986 -23.83792,61.61196 -48.51625,86.60094 L 325.4419,691 l 17.66096,0 17.66096,0 4.86809,-4.58453 z M 394,688.64922 c 0,-3.71455 -2.04108,-8.60084 -4.03944,-9.67033 -2.9569,-1.58248 -6.96886,-1.13374 -10.84253,1.21275 C 374.12973,683.21333 367,689.05502 367,690.12046 367,690.60421 373.075,691 380.5,691 l 13.5,0 0,-2.35078 z M 400,686 c 0,-5.46541 -2.34315,-9 -5.96627,-9 -1.93234,0 -1.93425,0.0561 -0.11065,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 C 397.45978,693.11041 400,692.21981 400,686 z m 210.95566,-20.09476 c 14.83061,-9.97103 31.88229,-28.24442 40.50327,-43.40524 7.38778,-12.99214 8.65888,-15.69469 11.99589,-25.50523 7.41459,-21.79829 6.96272,-9.98019 7.28354,-190.49477 0.17932,-100.89695 -0.0773,-164.45167 -0.68041,-168.5 -2.3362,-15.68196 -3.41375,-20.93917 -5.68871,-27.75424 -4.12954,-12.37082 -8.21522,-22.40623 -10.64772,-26.15332 -11.83968,-18.23817 -14.66547,-21.79617 -25.72831,-32.39498 -6.52391,-6.25027 -14.60857,-13.12663 -17.9659,-15.28079 -3.35734,-2.15417 -8.83901,-5.67618 -12.18149,-7.82668 -8.00491,-5.15024 -28.37757,-12.17907 -40.60942,-14.01078 -15.13476,-2.26641 -16.36492,-2.3563 -15.90593,-1.16232 0.32186,0.83724 28.38357,47.19413 71.26534,117.72762 0.21551,0.35449 -6.46788,4.37481 -14.85199,8.93405 -43.06166,23.41675 -75.19802,46.06522 -81.21424,57.23665 l -1.89741,3.52328 4.18693,5.42703 c 4.03069,5.22452 10.58724,11.08401 27.6809,24.73799 35.53905,28.38768 66.31216,61.95955 83.66326,91.27229 4.83694,8.17147 5.45688,8.82689 7.79578,8.24186 15.60217,-3.90261 23.06906,1.09793 21.01558,14.07403 -0.88905,5.61799 -5.35614,16.38814 -7.45825,17.98186 -1.20425,0.913 -1.0543,2.2126 1.00262,8.6899 4.93131,15.52878 8.48101,38.58704 8.48101,55.09118 0,41.02022 -13.53743,80.74497 -39.27989,115.26442 -7.65249,10.26165 -24.70682,29.65214 -29.16161,33.15627 -1.40717,1.10689 -2.5585,2.31678 -2.5585,2.68865 0,0.86969 13.75311,-6.71625 20.95566,-11.55873 z m 39.66126,-68.46114 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 6.3105,-3.07896 C 659.05971,591.65438 659.71717,588 658.07258,588 656.60851,588 653,593.07557 653,595.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 564.35718,344.95718 c -0.59896,-0.59896 0.71852,-2.77671 3.57039,-5.90176 4.49396,-4.92444 4.53024,-4.94114 6.39205,-2.94272 4.59809,4.93547 10.43614,5.04076 16.23049,0.29273 9.4811,-7.76906 12.51876,-16.04339 8.59828,-23.42103 -3.66601,-6.89876 -13.61587,-10.87379 -18.76805,-7.49795 -1.40463,0.92034 -2.67938,1.5249 -2.83279,1.34345 -0.1534,-0.18144 -1.06474,-2.01552 -2.02519,-4.07573 -2.15629,-4.62531 -8.40603,-9.34517 -14.94594,-11.28732 C 557.84877,290.65683 551.64543,290 546.72287,290 c -7.29434,0 -9.42162,0.36137 -11.707,1.9887 -3.20944,2.28532 -8.1972,9.80578 -10.08638,15.20806 -0.71102,2.03322 -1.66103,3.46916 -2.11113,3.19098 -2.7808,-1.71863 2.226,-12.56168 8.71037,-18.86377 14.88428,-14.46587 38.4852,-11.78545 46.57464,5.2896 1.22113,2.57754 2.29937,4.80088 2.3961,4.94077 0.0967,0.13988 1.71142,-0.52471 3.5882,-1.47686 5.10612,-2.59052 14.26182,-2.30403 20.27575,0.63443 9.98545,4.87899 13.27619,15.3984 8.07936,25.82708 -6.80474,13.65532 -23.85435,20.88951 -36.11397,15.32322 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56799,2.83759 -4.86031,3.90289 -5.98282,2.78038 z m 36.91738,-10.44065 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.69926,-5.21337 -5.39124,-10.21957 -11.54252,-12.31553 -8.21098,-2.79776 -11.23849,-1.48152 -4.13071,1.79586 5.27789,2.43363 8.96571,8.62452 8.96571,15.05111 0,5.39901 -1.89382,9.71089 -6.30812,14.36248 -4.05348,4.27137 -2.15511,4.14766 3.58268,-0.23347 z m -34.10458,-44.52489 c -3.04537,-2.53799 -8.41833,-3.97914 -14.86096,-3.98606 -8.2149,-0.009 -7.08301,1.69186 1.46067,2.19468 4.43738,0.26116 9.00824,1.1503 10.73031,2.08731 4.08905,2.22493 5.50631,2.06784 2.66998,-0.29593 z M 426.5,559.85789 c 20.31867,-10.1816 36.71492,-22.57146 41.10513,-31.0612 1.38994,-2.68784 1.29367,-3.20661 -1.60394,-8.64307 C 460.2184,509.30399 446.9994,495.89686 423.5,477.04757 c -7.15,-5.73515 -16.21608,-13.28066 -20.14684,-16.7678 l -7.14684,-6.34025 -0.48718,47.78024 c -0.46555,45.65964 -1.22426,58.53437 -4.27276,72.50638 l -0.59481,2.72614 11.82422,-5.54062 C 409.1791,568.36432 419.9,563.16512 426.5,559.85789 z M 406.61692,511.4441 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 6.3105,-3.07896 C 415.05971,505.65438 415.71717,502 414.07258,502 412.60851,502 409,507.07557 409,509.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z M 649.65503,450.26492 C 650.92336,439.55585 647.9907,434 641.06957,434 l -3.93042,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.8532 0.32447,0.92303 1.02658,0.22092 0.56461,-0.56461 1.29742,-3.31344 1.62845,-6.1085 z M 157.37784,449.95991 C 186.46065,447.78196 210.87315,446 211.62784,446 212.772,446 213,437.88172 213,397.14246 l 0,-48.85755 -6.09313,-0.63686 c -11.24576,-1.17541 -20.38122,-7.08634 -23.4759,-15.18962 -1.3397,-3.50796 -1.59116,-6.51067 -1.18948,-14.20341 1.03483,-19.81829 10.21579,-33.77216 25.50851,-38.7696 l 5.25,-1.71563 0,-78.49619 0,-78.49618 3.25,0.55524 c 1.7875,0.30539 42.73875,4.9397 91.00277,10.29847 l 87.75277,9.74322 10.24723,-9.98213 C 410.88875,125.90205 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.31378 -106,0.31377 -11.70252,2.70309 c -20.21819,4.67005 -39.79562,13.53488 -54.66494,24.75274 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.62323 c 3.455719,-0.34278 30.078159,-2.40519 59.160969,-4.58314 z M 96.616924,391.4441 c -1.654296,-4.31102 5.950556,-12.59152 10.101296,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.341252,3.1646 -8.248366,0.8007 z m 6.310496,-3.07896 C 105.05971,385.65438 105.71717,382 104.07258,382 102.60851,382 99,387.07557 99,389.13486 c 0,2.61448 1.49605,2.32127 3.92742,-0.76972 z m 35.10912,-143.50143 c -8.87446,-2.64308 -12.56438,-8.5266 -11.77422,-18.77385 0.92825,-12.03815 9.04296,-25.1351 18.41413,-29.71999 10.46794,-5.12149 23.84914,-1.54324 28.62893,7.65562 3.96012,7.62138 -0.66673,22.07887 -10.19733,31.86358 -7.82079,8.02931 -17.09677,11.34975 -25.07151,8.97464 z m 13.50448,-3.72566 c 4.7126,-2.87384 10.76633,-15.60108 11.28343,-23.72208 C 163.55593,205.92841 158.97725,200 149.37361,200 c -3.01011,0 -6.71768,0.64369 -8.23905,1.43041 -5.71865,2.95723 -12.12261,15.40879 -12.86207,25.00839 -0.3993,5.18371 -0.1242,6.5679 1.90024,9.5612 4.48883,6.6371 14.83185,9.1241 21.36829,5.13805 z m 16.83181,-18.03404 c 3.93419,-8.76653 4.33967,-13.80406 1.45723,-18.10401 -2.39306,-3.5699 -9.6971,-8 -13.18983,-8 -1.49302,0 -1.16397,0.52027 1.43809,2.2738 8.01131,5.39882 10.45883,13.87183 7.2018,24.93177 -2.3943,8.13035 -0.79462,7.56058 3.09271,-1.10156 z M 654.90217,448.85078 C 656.69825,443.69856 656.28019,437.28019 654,435 c -1.1,-1.1 -2.88482,-2 -3.96627,-2 -1.9338,0 -1.93195,0.0582 0.1122,3.52276 1.41042,2.39048 2.12276,5.44132 2.21627,9.49189 0.15403,6.67213 0.9089,7.51502 2.53997,2.83613 z M 212.7651,315.23667 213.03021,286 l -6.51511,0 c -6.22887,0 -6.68478,0.16968 -10.37728,3.86218 -4.22343,4.22343 -8.49369,12.38048 -10.07728,19.2496 -1.33549,5.79294 -1.33374,18.03494 0.003,21.57312 2.36773,6.26671 10.26207,11.84102 18.85683,13.31508 8.21777,1.40941 7.54882,3.86218 7.84465,-28.76331 z M 213,283 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3422"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#5a563a"
+       d="m 459.34349,733.75 -8.04113,-17.25 -85.22675,-0.25563 -85.22675,-0.25563 -9.67443,2.95841 c -27.02521,8.26424 -56.59348,9.99669 -85.78505,5.02627 C 121.12163,713.03064 71.981289,663.67909 53.481763,591.49887 46.520206,564.33673 44.02492,537.69174 44.009889,490.35699 c -0.0111,-34.94358 -0.637909,-32.34993 7.821898,-32.36568 2.567517,-0.005 7.016075,-0.29073 9.885683,-0.63544 l 5.21747,-0.62675 0.326656,-112.61456 c 0.322105,-111.04583 0.35705,-112.76779 2.50862,-123.61456 3.431599,-17.29982 12.259277,-41.13164 18.442804,-49.7895 1.257839,-1.76117 3.125388,-4.779 4.150109,-6.70631 3.535499,-6.6496 14.542941,-20.52692 22.328301,-28.14977 8.98461,-8.79706 25.41149,-21.78694 32.17793,-25.44533 2.54685,-1.37699 5.75564,-3.15598 7.13064,-3.9533 3.6162,-2.09692 25.7945,-11.086237 30.5,-12.362271 2.2,-0.596595 9.175,-2.311687 15.5,-3.811316 L 211.5,87.555604 337,87.027802 462.5,86.5 471,81.381488 c 4.675,-2.815182 13.675,-7.934592 20,-11.376466 6.325,-3.441874 12.88103,-7.087391 14.56895,-8.101149 l 3.06894,-1.843196 8.00577,13.219662 8.00577,13.219661 12.42529,0.679298 c 17.96747,0.982292 31.62253,3.432774 46.58182,8.359385 17.33626,5.709427 21.95763,8.049227 41.97836,21.253587 7.40091,4.88117 9.60905,6.80999 23.71405,20.71443 20.33743,20.04824 34.37972,45.10994 41.17892,73.4933 5.32549,22.23131 4.91129,7.35828 5.22967,187.78621 l 0.29342,166.2862 -2.51542,14.11709 c -3.60523,20.23335 -11.91032,43.62249 -18.92965,53.3105 -1.19549,1.65 -2.66657,4.125 -3.26907,5.5 -1.69996,3.8796 -13.94547,19.85104 -20.20356,26.35088 -12.93665,13.4364 -27.583,24.39434 -42.63326,31.89689 -22.02215,10.97803 -40.01005,16.47416 -61.68666,18.84811 -7.46117,0.81713 -9.61104,1.51292 -15.239,4.93202 -11.39704,6.92395 -30.52187,16.60204 -47.24399,23.90775 C 475.43704,747.82104 467.98608,751 467.77266,751 c -0.21342,0 -4.00655,-7.7625 -8.42917,-17.25 z m 43.4088,-35.79662 c 25.7493,-13.37348 40.55902,-23.05089 59.27979,-38.73635 C 615.74061,614.21656 638.44435,552.13511 623.55054,491 611.87087,443.05806 580.66243,401.28531 519.82708,352.1653 c -22.66047,-18.29665 -34.84926,-33.23566 -38.37613,-47.03517 -1.3245,-5.18234 -1.41608,-7.21152 -0.49124,-10.8844 4.60837,-18.30152 26.65862,-39.09471 67.70365,-63.84396 8.71015,-5.25203 16.22698,-9.92882 16.70405,-10.39287 C 566.50622,218.9012 498.07682,106 496.26664,106 c -0.25699,0 -4.90308,2.48965 -10.32466,5.53256 -25.52297,14.32501 -60.92716,44.47029 -81.5862,69.46744 -14.65278,17.72965 -31.29104,45.76211 -37.39275,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7062,22.71893 29.63611,49.8005 50.32192,68.37947 C 432.67167,442.31872 439.59399,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34787 12.33333,10.86687 6.6,5.519 16.73002,14.93475 22.51114,20.9239 31.79616,32.94024 33.9092,55.2854 7.5829,80.18827 -9.45137,8.94034 -24.30198,18.85216 -40.73349,27.18695 -6.7983,3.44841 -12.52411,6.41055 -12.72401,6.58255 C 430.2714,595.32524 483.47449,707 484.69426,707 c 0.35181,0 8.47793,-4.07098 18.05803,-9.04662 z m -262.15947,-7.00127 c 26.57525,-2.70593 53.87598,-16.35266 74.85393,-37.417 12.6548,-12.70692 21.00858,-24.47335 29.13361,-41.03511 7.48272,-15.25252 11.56922,-27.30454 14.89898,-43.94053 3.91886,-19.57926 4.51363,-31.78643 4.51724,-92.71266 L 364,418.19362 357.09338,407.84681 C 341.54133,384.54828 331.41834,359.72817 326.36284,332.5 c -1.47759,-7.9581 -1.84714,-14.69637 -1.80984,-33 0.0429,-21.04472 0.27511,-24.07507 2.73168,-35.6461 5.78758,-27.26082 17.04854,-54.01626 32.30884,-76.76403 C 363.26526,181.61659 364,179.72756 364,175.76068 364,173.1423 363.58102,171 363.06893,171 362.55684,171 336.87582,168.075 306,164.5 275.12418,160.925 249.21816,158 248.43107,158 247.19478,158 247,183.28527 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -1.9599,16.24939 -7.58891,30.41973 -15.23964,38.36394 -4.53709,4.71114 -9.22095,6.59466 -16.42321,6.60425 -7.96818,0.0106 -11.52208,-2.61656 -16.33354,-12.07438 -6.20817,-12.20332 -8.59761,-26.86895 -10.08853,-61.92004 -0.64335,-15.125 -1.26134,-27.61637 -1.37331,-27.75859 -0.16186,-0.2056 -54.09268,3.84992 -101.688362,7.64683 -4.217754,0.33647 -7.952282,0.89629 -8.298952,1.24404 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 125.03909,-4.53664 c 12.84336,-12.09524 25.06819,-16.3347 33.05672,-11.46375 3.62913,2.21283 5.22896,6.5456 4.54101,12.29828 l -0.44845,3.75 18.08465,0 18.08466,0 -0.89914,-2.25 c -1.64247,-4.11013 -47.7973,-101.82927 -48.36361,-102.39558 -0.30596,-0.30597 -1.0515,1.40162 -1.65675,3.79464 -8.78903,34.74986 -23.83792,61.61196 -48.51625,86.60094 L 325.4419,691 l 17.66096,0 17.66096,0 4.86809,-4.58453 z m 28.08981,0.54643 c -1.56815,-11.69142 -9.13002,-12.12264 -22.47172,-1.28146 -2.3375,1.8994 -4.25,3.87333 -4.25,4.38651 0,0.53177 5.86264,0.93305 13.63167,0.93305 l 13.63167,0 -0.54162,-4.0381 z M 400,686 c 0,-5.46541 -2.34315,-9 -5.96627,-9 -1.93234,0 -1.93425,0.0561 -0.11065,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 C 397.45978,693.11041 400,692.21981 400,686 z m 210.95566,-20.09476 c 14.83061,-9.97103 31.88229,-28.24442 40.50327,-43.40524 7.38778,-12.99214 8.65888,-15.69469 11.99589,-25.50523 7.41459,-21.79829 6.96272,-9.98019 7.28354,-190.49477 0.17932,-100.89695 -0.0773,-164.45167 -0.68041,-168.5 -2.3362,-15.68196 -3.41375,-20.93917 -5.68871,-27.75424 -4.12954,-12.37082 -8.21522,-22.40623 -10.64772,-26.15332 -11.83968,-18.23817 -14.66547,-21.79617 -25.72831,-32.39498 -6.52391,-6.25027 -14.60857,-13.12663 -17.9659,-15.28079 -3.35734,-2.15417 -8.83901,-5.67618 -12.18149,-7.82668 -8.00491,-5.15024 -28.37757,-12.17907 -40.60942,-14.01078 -15.13476,-2.26641 -16.36492,-2.3563 -15.90593,-1.16232 0.32186,0.83724 28.38357,47.19413 71.26534,117.72762 0.21551,0.35449 -6.46788,4.37481 -14.85199,8.93405 -43.06166,23.41675 -75.19802,46.06522 -81.21424,57.23665 l -1.89741,3.52328 4.18693,5.42703 c 4.03069,5.22452 10.58724,11.08401 27.6809,24.73799 35.53905,28.38768 66.31216,61.95955 83.66326,91.27229 4.83694,8.17147 5.45688,8.82689 7.79578,8.24186 15.60217,-3.90261 23.06906,1.09793 21.01558,14.07403 -0.88905,5.61799 -5.35614,16.38814 -7.45825,17.98186 -1.20425,0.913 -1.0543,2.2126 1.00262,8.6899 4.93131,15.52878 8.48101,38.58704 8.48101,55.09118 0,41.02022 -13.53743,80.74497 -39.27989,115.26442 -7.65249,10.26165 -24.70682,29.65214 -29.16161,33.15627 -1.40717,1.10689 -2.5585,2.31678 -2.5585,2.68865 0,0.86969 13.75311,-6.71625 20.95566,-11.55873 z m 39.66126,-68.46114 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 6.3105,-3.07896 C 659.2491,591.4136 659.6718,588 657.71561,588 656.22479,588 653,593.06346 653,595.40429 c 0,2.36046 1.58269,1.94169 3.92742,-1.03915 z M 564.35796,344.95796 c -0.59791,-0.59791 0.72814,-2.74684 3.58798,-5.8145 3.37963,-3.62523 4.79366,-4.55625 5.54523,-3.65107 2.21019,2.66189 6.13722,4.50761 9.59055,4.50761 4.42676,0 11.52998,-5.77491 15.55849,-12.64903 5.94806,-10.1496 -0.23063,-21.23657 -12.79471,-22.95867 -3.49134,-0.47854 -4.8628,-0.23214 -6.21076,1.11582 -0.95149,0.95149 -1.83439,1.5639 -1.96201,1.36093 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.77712,290.63555 551.66264,290 546.3185,290 l -9.3185,0 -4.08572,4.08572 c -3.81645,3.81645 -8.88241,12.76176 -8.90451,15.7233 -0.005,0.71996 -0.45977,1.0309 -1.00977,0.69098 -2.95632,-1.82711 1.82135,-12.45721 8.52873,-18.97603 14.88428,-14.46587 38.4852,-11.78545 46.57464,5.2896 1.22113,2.57754 2.29937,4.80088 2.3961,4.94077 0.0967,0.13988 1.71142,-0.52471 3.5882,-1.47686 5.10612,-2.59052 14.26182,-2.30403 20.27575,0.63443 9.98545,4.87899 13.27619,15.3984 8.07936,25.82708 -6.80474,13.65532 -23.85435,20.88951 -36.11397,15.32322 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56732,2.83685 -4.8603,3.9029 -5.98204,2.78116 z m 36.9166,-10.44143 c 6.04708,-4.61729 10.21156,-12.85554 9.43296,-18.66045 -0.69926,-5.21337 -5.39124,-10.21957 -11.54252,-12.31553 -8.21098,-2.79776 -11.23849,-1.48152 -4.13071,1.79586 5.27789,2.43363 8.96571,8.62452 8.96571,15.05111 0,5.39901 -1.89382,9.71089 -6.30812,14.36248 -4.05348,4.27137 -2.15511,4.14766 3.58268,-0.23347 z m -34.10458,-44.52489 c -3.04537,-2.53799 -8.41833,-3.97914 -14.86096,-3.98606 -8.2149,-0.009 -7.08301,1.69186 1.46067,2.19468 4.43738,0.26116 9.00824,1.1503 10.73031,2.08731 4.08905,2.22493 5.50631,2.06784 2.66998,-0.29593 z M 426.5,559.85789 c 20.31867,-10.1816 36.71492,-22.57146 41.10513,-31.0612 1.38994,-2.68784 1.29367,-3.20661 -1.60394,-8.64307 C 460.2184,509.30399 446.9994,495.89686 423.5,477.04757 c -7.15,-5.73515 -16.21608,-13.28066 -20.14684,-16.7678 l -7.14684,-6.34025 -0.48718,47.78024 c -0.46555,45.65964 -1.22426,58.53437 -4.27276,72.50638 l -0.59481,2.72614 11.82422,-5.54062 C 409.1791,568.36432 419.9,563.16512 426.5,559.85789 z M 406.61692,511.4441 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 6.3105,-3.07896 C 415.2491,505.4136 415.6718,502 413.71561,502 412.22479,502 409,507.06346 409,509.40429 c 0,2.36046 1.58269,1.94169 3.92742,-1.03915 z M 649.5,447.16068 C 649.5,436.83867 647.78449,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.99558 0.25242,0.99517 1.25,-0.002 0.78471,-0.78443 1.25,-4.13068 1.25,-8.98978 z m -492.12216,2.79923 C 186.46065,447.78196 210.87315,446 211.62784,446 212.772,446 213,437.88172 213,397.14246 l 0,-48.85755 -6.09313,-0.63686 c -11.24576,-1.17541 -20.38122,-7.08634 -23.4759,-15.18962 -1.3397,-3.50796 -1.59116,-6.51067 -1.18948,-14.20341 1.03483,-19.81829 10.21579,-33.77216 25.50851,-38.7696 l 5.25,-1.71563 0,-78.49619 0,-78.49618 3.25,0.55524 c 1.7875,0.30539 42.73875,4.9397 91.00277,10.29847 l 87.75277,9.74322 10.24723,-9.98213 C 410.88875,125.90205 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.31378 -106,0.31377 -11.70252,2.70309 c -20.21819,4.67005 -39.79562,13.53488 -54.66494,24.75274 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.62323 c 3.455719,-0.34278 30.078159,-2.40519 59.160969,-4.58314 z M 96.616924,391.4441 c -1.654296,-4.31102 5.950556,-12.59152 10.101296,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.341252,3.1646 -8.248366,0.8007 z m 6.310496,-3.07896 C 105.2491,385.4136 105.6718,382 103.71561,382 102.22479,382 99,387.06346 99,389.40429 c 0,2.36046 1.58269,1.94169 3.92742,-1.03915 z m 35.10912,-143.50143 c -8.87446,-2.64308 -12.56438,-8.5266 -11.77422,-18.77385 0.92825,-12.03815 9.04296,-25.1351 18.41413,-29.71999 10.46794,-5.12149 23.84914,-1.54324 28.62893,7.65562 3.96012,7.62138 -0.66673,22.07887 -10.19733,31.86358 -7.82079,8.02931 -17.09677,11.34975 -25.07151,8.97464 z m 12.65014,-2.90433 c 2.36559,-0.82465 3.89191,-2.8044 7.35432,-9.53913 C 167.31009,214.39099 163.46273,200 149.37361,200 c -6.72013,0 -10.20957,1.70868 -13.64267,6.68041 -7.08124,10.2549 -9.62751,23.01272 -5.80368,29.07873 4.0672,6.45208 12.66804,9.02091 20.75942,6.20024 z m 17.68615,-18.85537 c 3.93419,-8.76653 4.33967,-13.80406 1.45723,-18.10401 -2.39306,-3.5699 -9.6971,-8 -13.18983,-8 -1.49302,0 -1.16397,0.52027 1.43809,2.2738 8.01131,5.39882 10.45883,13.87183 7.2018,24.93177 -2.3943,8.13035 -0.79462,7.56058 3.09271,-1.10156 z M 654.90217,448.85078 C 656.69825,443.69856 656.28019,437.28019 654,435 c -1.1,-1.1 -2.88482,-2 -3.96627,-2 -1.9338,0 -1.93195,0.0582 0.1122,3.52276 1.41042,2.39048 2.12276,5.44132 2.21627,9.49189 0.15403,6.67213 0.9089,7.51502 2.53997,2.83613 z M 212.7651,315.25 213.03021,286 l -6.51511,0 c -6.25624,0 -6.67238,0.15728 -10.47361,3.95851 C 188.83016,297.16984 185,307.90111 185,320.89437 c 0,9.14201 2.39307,14.77869 7.7866,18.34074 5.08307,3.35701 12.82727,5.71608 17.7134,5.39593 1.94496,-0.12743 2.0073,-0.93602 2.2651,-29.38104 z M 213,283 c 0,-0.55 -0.64844,-1 -1.44098,-1 -0.79254,0 -1.7191,0.45 -2.05902,1 -0.33992,0.55 0.30852,1 1.44098,1 1.13246,0 2.05902,-0.45 2.05902,-1 z"
+       id="path3420"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#6c5924"
+       d="m 459.34349,733.75 -8.04113,-17.25 -85.22675,-0.25563 -85.22675,-0.25563 -9.67443,2.95841 c -27.02521,8.26424 -56.59348,9.99669 -85.78505,5.02627 C 121.12163,713.03064 71.981289,663.67909 53.481763,591.49887 46.520206,564.33673 44.02492,537.69174 44.009889,490.35699 c -0.0111,-34.94358 -0.637909,-32.34993 7.821898,-32.36568 2.567517,-0.005 7.016075,-0.29073 9.885683,-0.63544 l 5.21747,-0.62675 0.326656,-112.61456 c 0.322105,-111.04583 0.35705,-112.76779 2.50862,-123.61456 3.431599,-17.29982 12.259277,-41.13164 18.442804,-49.7895 1.257839,-1.76117 3.125388,-4.779 4.150109,-6.70631 3.535499,-6.6496 14.542941,-20.52692 22.328301,-28.14977 8.98461,-8.79706 25.41149,-21.78694 32.17793,-25.44533 2.54685,-1.37699 5.75564,-3.15598 7.13064,-3.9533 3.6162,-2.09692 25.7945,-11.086237 30.5,-12.362271 2.2,-0.596595 9.175,-2.311687 15.5,-3.811316 L 211.5,87.555604 337,87.027802 462.5,86.5 471,81.381488 c 4.675,-2.815182 13.675,-7.934592 20,-11.376466 6.325,-3.441874 12.88103,-7.087391 14.56895,-8.101149 l 3.06894,-1.843196 8.00577,13.219662 8.00577,13.219661 12.42529,0.679298 c 17.96747,0.982292 31.62253,3.432774 46.58182,8.359385 17.33626,5.709427 21.95763,8.049227 41.97836,21.253587 7.40091,4.88117 9.60905,6.80999 23.71405,20.71443 20.33743,20.04824 34.37972,45.10994 41.17892,73.4933 5.32549,22.23131 4.91129,7.35828 5.22967,187.78621 l 0.29342,166.2862 -2.51542,14.11709 c -3.60523,20.23335 -11.91032,43.62249 -18.92965,53.3105 -1.19549,1.65 -2.66657,4.125 -3.26907,5.5 -1.69996,3.8796 -13.94547,19.85104 -20.20356,26.35088 -12.93665,13.4364 -27.583,24.39434 -42.63326,31.89689 -22.02215,10.97803 -40.01005,16.47416 -61.68666,18.84811 -7.46117,0.81713 -9.61104,1.51292 -15.239,4.93202 -11.39704,6.92395 -30.52187,16.60204 -47.24399,23.90775 C 475.43704,747.82104 467.98608,751 467.77266,751 c -0.21342,0 -4.00655,-7.7625 -8.42917,-17.25 z m 43.4088,-35.79662 c 25.7493,-13.37348 40.55902,-23.05089 59.27979,-38.73635 C 615.74061,614.21656 638.44435,552.13511 623.55054,491 611.87087,443.05806 580.66243,401.28531 519.82708,352.1653 c -22.66047,-18.29665 -34.84926,-33.23566 -38.37613,-47.03517 -1.3245,-5.18234 -1.41608,-7.21152 -0.49124,-10.8844 4.60837,-18.30152 26.65862,-39.09471 67.70365,-63.84396 8.71015,-5.25203 16.22698,-9.92882 16.70405,-10.39287 C 566.50622,218.9012 498.07682,106 496.26664,106 c -0.25699,0 -4.90308,2.48965 -10.32466,5.53256 -25.52297,14.32501 -60.92716,44.47029 -81.5862,69.46744 -14.65278,17.72965 -31.29104,45.76211 -37.39275,63 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7062,22.71893 29.63611,49.8005 50.32192,68.37947 C 432.67167,442.31872 439.59399,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34787 12.33333,10.86687 6.6,5.519 16.73002,14.93475 22.51114,20.9239 31.79616,32.94024 33.9092,55.2854 7.5829,80.18827 -9.45137,8.94034 -24.30198,18.85216 -40.73349,27.18695 -6.7983,3.44841 -12.52411,6.41055 -12.72401,6.58255 C 430.2714,595.32524 483.47449,707 484.69426,707 c 0.35181,0 8.47793,-4.07098 18.05803,-9.04662 z m -262.15947,-7.00127 c 26.57525,-2.70593 53.87598,-16.35266 74.85393,-37.417 12.6548,-12.70692 21.00858,-24.47335 29.13361,-41.03511 7.48272,-15.25252 11.56922,-27.30454 14.89898,-43.94053 3.91886,-19.57926 4.51363,-31.78643 4.51724,-92.71266 L 364,418.19362 357.09338,407.84681 C 341.54133,384.54828 331.41834,359.72817 326.36284,332.5 c -1.47759,-7.9581 -1.84714,-14.69637 -1.80984,-33 0.0429,-21.04472 0.27511,-24.07507 2.73168,-35.6461 5.78758,-27.26082 17.04854,-54.01626 32.30884,-76.76403 C 363.26526,181.61659 364,179.72756 364,175.76068 364,173.1423 363.58102,171 363.06893,171 362.55684,171 336.87582,168.075 306,164.5 275.12418,160.925 249.21816,158 248.43107,158 247.19478,158 247,183.28527 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -1.9599,16.24939 -7.58891,30.41973 -15.23964,38.36394 -4.53709,4.71114 -9.22095,6.59466 -16.42321,6.60425 -7.96818,0.0106 -11.52208,-2.61656 -16.33354,-12.07438 -6.20817,-12.20332 -8.59761,-26.86895 -10.08853,-61.92004 -0.64335,-15.125 -1.26134,-27.61637 -1.37331,-27.75859 -0.16186,-0.2056 -54.09268,3.84992 -101.688362,7.64683 -4.217754,0.33647 -7.952282,0.89629 -8.298952,1.24404 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 126.06524,-5.46041 c 18.27587,-17.23212 38.72502,-16.24896 36.57158,1.7583 l -0.44845,3.75 18.08465,0 18.08466,0 -0.89914,-2.25 c -1.64247,-4.11013 -47.7973,-101.82927 -48.36361,-102.39558 -0.30596,-0.30597 -1.0515,1.40162 -1.65675,3.79464 -8.78903,34.74986 -23.83792,61.61196 -48.51625,86.60094 L 325.4419,691 l 17.68712,0 17.68711,0 5.84193,-5.5083 z m 27.06366,1.4702 c -1.56815,-11.69142 -9.13002,-12.12264 -22.47172,-1.28146 -2.3375,1.8994 -4.25,3.87333 -4.25,4.38651 0,0.53177 5.86264,0.93305 13.63167,0.93305 l 13.63167,0 -0.54162,-4.0381 z M 400,685.5567 c 0,-4.49133 -0.38869,-5.71554 -2.22251,-7 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.63541,0 -1.62846,0.20195 0.11186,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 0.40479,2.31413 1.21295,3.75 2.11064,3.75 1.09476,0 1.45469,-1.34684 1.45469,-5.4433 z m 210.95566,-19.65146 c 14.83061,-9.97103 31.88229,-28.24442 40.50327,-43.40524 7.38778,-12.99214 8.65888,-15.69469 11.99589,-25.50523 7.41459,-21.79829 6.96272,-9.98019 7.28354,-190.49477 0.17932,-100.89695 -0.0773,-164.45167 -0.68041,-168.5 -2.3362,-15.68196 -3.41375,-20.93917 -5.68871,-27.75424 -4.12954,-12.37082 -8.21522,-22.40623 -10.64772,-26.15332 -11.83968,-18.23817 -14.66547,-21.79617 -25.72831,-32.39498 -6.52391,-6.25027 -14.60857,-13.12663 -17.9659,-15.28079 -3.35734,-2.15417 -8.83901,-5.67618 -12.18149,-7.82668 -8.00491,-5.15024 -28.37757,-12.17907 -40.60942,-14.01078 -15.13476,-2.26641 -16.36492,-2.3563 -15.90593,-1.16232 0.32186,0.83724 28.38357,47.19413 71.26534,117.72762 0.21551,0.35449 -6.46788,4.37481 -14.85199,8.93405 -43.06166,23.41675 -75.19802,46.06522 -81.21424,57.23665 l -1.89741,3.52328 4.18693,5.42703 c 4.03069,5.22452 10.58724,11.08401 27.6809,24.73799 35.94995,28.7159 66.20299,61.82526 84.17276,92.11988 3.18196,5.36435 6.02896,9.35925 6.32666,8.87755 0.94882,-1.53522 5.9939,-3.00106 10.31568,-2.9972 8.90829,0.008 13.21409,5.7645 11.65952,15.58795 -0.88905,5.61799 -5.35614,16.38814 -7.45825,17.98186 -1.20425,0.913 -1.0543,2.2126 1.00262,8.6899 4.93131,15.52878 8.48101,38.58704 8.48101,55.09118 0,41.02022 -13.53743,80.74497 -39.27989,115.26442 -7.65249,10.26165 -24.70682,29.65214 -29.16161,33.15627 -1.40717,1.10689 -2.5585,2.31678 -2.5585,2.68865 0,0.86969 13.75311,-6.71625 20.95566,-11.55873 z m 39.66126,-68.46114 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 6.3105,-3.07896 C 659.2491,591.4136 659.6718,588 657.71561,588 656.22479,588 653,593.06346 653,595.40429 c 0,2.36046 1.58269,1.94169 3.92742,-1.03915 z M 564.35796,344.95796 c -0.59791,-0.59791 0.72814,-2.74684 3.58798,-5.8145 3.37963,-3.62523 4.79366,-4.55625 5.54523,-3.65107 2.21019,2.66189 6.13722,4.50761 9.59055,4.50761 4.42676,0 11.52998,-5.77491 15.55849,-12.64903 5.94806,-10.1496 -0.23063,-21.23657 -12.79471,-22.95867 -3.49134,-0.47854 -4.8628,-0.23214 -6.21076,1.11582 -0.95149,0.95149 -1.83439,1.5639 -1.96201,1.36093 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.77712,290.63555 551.66264,290 546.3185,290 l -9.3185,0 -4.08572,4.08572 c -3.81645,3.81645 -8.88241,12.76176 -8.90451,15.7233 -0.005,0.71996 -0.45977,1.0309 -1.00977,0.69098 -2.95632,-1.82711 1.82135,-12.45721 8.52873,-18.97603 14.88428,-14.46587 38.4852,-11.78545 46.57464,5.2896 1.22113,2.57754 2.29937,4.80088 2.3961,4.94077 0.0967,0.13988 1.71142,-0.52471 3.5882,-1.47686 5.10612,-2.59052 14.26182,-2.30403 20.27575,0.63443 9.98545,4.87899 13.27619,15.3984 8.07936,25.82708 -6.80474,13.65532 -23.85435,20.88951 -36.11397,15.32322 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56732,2.83685 -4.8603,3.9029 -5.98204,2.78116 z m 36.42514,-9.9158 c 4.82725,-3.49684 9.20105,-10.50508 9.92509,-15.90321 1.07212,-7.99327 -5.52524,-15.12706 -15.45819,-16.7151 -5.32994,-0.85212 -5.43067,0.50795 -0.21571,2.91256 5.35597,2.46964 8.96702,8.6149 8.96197,15.25145 -0.004,5.19532 -2.05755,9.63287 -6.78531,14.66214 -3.39752,3.6142 -1.55611,3.50706 3.57215,-0.20784 z M 570,291.52032 c 0,-0.26382 -1.9125,-1.46337 -4.25,-2.66567 -4.6415,-2.38736 -18.98747,-3.89746 -20.0893,-2.11467 -0.36939,0.59769 2.6399,1.18402 7.6958,1.49945 4.72168,0.29457 9.56198,1.19994 11.22294,2.09923 2.88385,1.56139 5.42056,2.11438 5.42056,1.18166 z M 426.5,559.85789 c 20.31867,-10.1816 36.71492,-22.57146 41.10513,-31.0612 1.38994,-2.68784 1.29367,-3.20661 -1.60394,-8.64307 C 460.2184,509.30399 446.9994,495.89686 423.5,477.04757 c -7.15,-5.73515 -16.21608,-13.28066 -20.14684,-16.7678 l -7.14684,-6.34025 -0.48718,47.78024 c -0.46555,45.65964 -1.22426,58.53437 -4.27276,72.50638 l -0.59481,2.72614 11.82422,-5.54062 C 409.1791,568.36432 419.9,563.16512 426.5,559.85789 z M 406.61692,511.4441 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 6.3105,-3.07896 C 415.2491,505.4136 415.6718,502 413.71561,502 412.22479,502 409,507.06346 409,509.40429 c 0,2.36046 1.58269,1.94169 3.92742,-1.03915 z M 649.5,447.16068 C 649.5,436.83867 647.78449,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.99558 0.25242,0.99517 1.25,-0.002 0.78471,-0.78443 1.25,-4.13068 1.25,-8.98978 z m -492.12216,2.79923 C 186.46065,447.78196 210.87315,446 211.62784,446 212.772,446 213,437.88172 213,397.14246 l 0,-48.85755 -6.09313,-0.63686 c -11.24576,-1.17541 -20.38122,-7.08634 -23.4759,-15.18962 -1.3397,-3.50796 -1.59116,-6.51067 -1.18948,-14.20341 1.03483,-19.81829 10.21579,-33.77216 25.50851,-38.7696 l 5.25,-1.71563 0,-78.49619 0,-78.49618 3.25,0.55524 c 1.7875,0.30539 42.73875,4.9397 91.00277,10.29847 l 87.75277,9.74322 10.24723,-9.98213 C 410.88875,125.90205 417.975,119.28036 421,116.67735 l 5.5,-4.73274 -106,0.31378 -106,0.31377 -11.70252,2.70309 c -20.21819,4.67005 -39.79562,13.53488 -54.66494,24.75274 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.62323 c 3.455719,-0.34278 30.078159,-2.40519 59.160969,-4.58314 z M 96.616924,391.4441 c -1.654296,-4.31102 5.950556,-12.59152 10.101296,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.341252,3.1646 -8.248366,0.8007 z m 6.310496,-3.07896 C 105.2491,385.4136 105.6718,382 103.71561,382 102.22479,382 99,387.06346 99,389.40429 c 0,2.36046 1.58269,1.94169 3.92742,-1.03915 z m 35.10912,-143.50143 c -8.87095,-2.64203 -12.54562,-8.50462 -11.80641,-18.83604 0.83136,-11.61928 9.28091,-25.17358 18.50664,-29.68731 10.40512,-5.09076 23.79103,-1.49061 28.57458,7.68513 5.26324,10.09592 -5.35133,31.85264 -18.91642,38.77303 -4.96284,2.53186 -11.86553,3.4033 -16.35839,2.06519 z m 12.65014,-2.90433 c 2.36559,-0.82465 3.89191,-2.8044 7.35432,-9.53913 C 167.31009,214.39099 163.46273,200 149.37361,200 c -6.72013,0 -10.20957,1.70868 -13.64267,6.68041 -7.08124,10.2549 -9.62751,23.01272 -5.80368,29.07873 4.0672,6.45208 12.66804,9.02091 20.75942,6.20024 z m 17.52003,-18.28223 c 4.21706,-8.2384 4.52816,-16.17023 0.79329,-20.22611 -2.71461,-2.94793 -9.35988,-6.39392 -12.39788,-6.42908 -1.41837,-0.0164 -1.0454,0.55253 1.4762,2.25184 7.99923,5.39068 10.45814,13.87418 7.21418,24.88973 -2.38223,8.08936 -1.39083,7.92389 2.91421,-0.48638 z M 654.90217,448.85078 C 655.50598,447.1187 656,443.54422 656,440.90748 c 0,-3.82044 -0.45137,-5.11022 -2.22251,-6.35078 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.5904,0 -1.55837,0.31423 0.36419,3.57273 1.45045,2.45832 2.14175,5.42087 2.21628,9.49776 0.12107,6.62315 0.87846,7.46193 2.51048,2.78029 z M 212.7651,315.25 213.03021,286 l -6.51511,0 c -6.25624,0 -6.67238,0.15728 -10.47361,3.95851 C 188.83016,297.16984 185,307.90111 185,320.89437 c 0,9.14201 2.39307,14.77869 7.7866,18.34074 5.08307,3.35701 12.82727,5.71608 17.7134,5.39593 1.94496,-0.12743 2.0073,-0.93602 2.2651,-29.38104 z M 213,283 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3418"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#5c5234"
+       d="m 459.34349,733.75 -8.04113,-17.25 -85.22675,-0.25563 -85.22675,-0.25563 -9.67443,2.95841 c -27.02521,8.26424 -56.59348,9.99669 -85.78505,5.02627 C 121.12163,713.03064 71.981289,663.67909 53.481763,591.49887 46.520206,564.33673 44.02492,537.69174 44.009889,490.35699 c -0.0111,-34.94358 -0.637909,-32.34993 7.821898,-32.36568 2.567517,-0.005 7.016075,-0.29073 9.885683,-0.63544 l 5.21747,-0.62675 0.326656,-112.61456 c 0.322105,-111.04583 0.35705,-112.76779 2.50862,-123.61456 3.431599,-17.29982 12.259277,-41.13164 18.442804,-49.7895 1.257839,-1.76117 3.125388,-4.779 4.150109,-6.70631 3.535499,-6.6496 14.542941,-20.52692 22.328301,-28.14977 8.98461,-8.79706 25.41149,-21.78694 32.17793,-25.44533 2.54685,-1.37699 5.75564,-3.15598 7.13064,-3.9533 3.6162,-2.09692 25.7945,-11.086237 30.5,-12.362271 2.2,-0.596595 9.175,-2.311687 15.5,-3.811316 L 211.5,87.555604 337,87.027802 462.5,86.5 471,81.381488 c 4.675,-2.815182 13.675,-7.934592 20,-11.376466 6.325,-3.441874 12.88103,-7.087391 14.56895,-8.101149 l 3.06894,-1.843196 8.00577,13.219662 8.00577,13.219661 12.42529,0.679298 c 17.96747,0.982292 31.62253,3.432774 46.58182,8.359385 17.33626,5.709427 21.95763,8.049227 41.97836,21.253587 7.40091,4.88117 9.60905,6.80999 23.71405,20.71443 20.33743,20.04824 34.37972,45.10994 41.17892,73.4933 5.32549,22.23131 4.91129,7.35828 5.22967,187.78621 l 0.29342,166.2862 -2.51542,14.11709 c -3.60523,20.23335 -11.91032,43.62249 -18.92965,53.3105 -1.19549,1.65 -2.66657,4.125 -3.26907,5.5 -1.69996,3.8796 -13.94547,19.85104 -20.20356,26.35088 -12.93665,13.4364 -27.583,24.39434 -42.63326,31.89689 -22.02215,10.97803 -40.01005,16.47416 -61.68666,18.84811 -7.46117,0.81713 -9.61104,1.51292 -15.239,4.93202 -11.39704,6.92395 -30.52187,16.60204 -47.24399,23.90775 C 475.43704,747.82104 467.98608,751 467.77266,751 c -0.21342,0 -4.00655,-7.7625 -8.42917,-17.25 z m 35.44133,-31.64202 c 34.33753,-17.23137 57.21213,-32.664 78.35271,-52.86158 27.81034,-26.56985 46.20268,-59.22954 52.51181,-93.2464 2.48979,-13.42415 2.48951,-44.02055 -5.2e-4,-56.5 -5.82328,-29.18496 -19.87608,-57.95926 -41.95708,-85.91072 -11.63175,-14.72416 -38.59718,-41.00866 -58.84186,-57.35599 -27.78073,-22.4326 -39.64054,-36.39777 -43.39893,-51.10316 -1.85052,-7.24047 -1.15174,-11.88114 3.0119,-20.00269 8.29893,-16.18773 37.84367,-40.31992 74.78712,-61.08621 3.16248,-1.77766 6.00341,-3.64219 6.31318,-4.14341 C 566.39261,218.55572 497.91265,106 496.26664,106 c -0.25699,0 -4.90308,2.48965 -10.32466,5.53256 -11.12627,6.24473 -28.9687,18.99216 -42.40758,30.29789 -11.54232,9.7102 -32.28634,30.4845 -40.11101,40.16955 -14.26587,17.65772 -30.59074,45.41777 -36.46036,62 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7062,22.71893 29.63611,49.8005 50.32192,68.37947 C 432.67167,442.31872 439.59399,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.74588,5.35481 12.36121,10.88229 14.77861,12.34835 31.35553,29.50618 37.80234,39.12706 15.94136,23.79002 13.7073,41.68563 -7.73618,61.96969 -9.45137,8.94034 -24.30198,18.85216 -40.73349,27.18695 -6.7983,3.44841 -12.53728,6.42373 -12.75329,6.61182 C 430.32838,595.2884 483.44408,707 484.54546,707 c 0.26998,0 4.8777,-2.20141 10.23936,-4.89202 z m -254.192,-11.15587 c 29.40566,-2.99413 59.69281,-19.34902 81.03122,-43.7564 21.23306,-24.28689 33.84373,-52.43655 39.96701,-89.21477 1.49857,-9.00084 1.8018,-19.59629 2.14725,-75.02887 l 0.40225,-64.54792 -6.97689,-10.45208 C 341.53832,384.54378 331.42682,359.77387 326.36284,332.5 c -1.47759,-7.9581 -1.84714,-14.69637 -1.80984,-33 0.0429,-21.04472 0.27511,-24.07507 2.73168,-35.6461 5.78758,-27.26082 17.04854,-54.01626 32.30884,-76.76403 3.67174,-5.47328 4.40648,-7.36231 4.40648,-11.32919 0,-2.61838 -0.3375,-4.7609 -0.75,-4.76116 -0.4125,-2.6e-4 -26.04094,-2.92526 -56.95209,-6.5 C 275.38677,160.92478 249.39927,158 248.54791,158 247.15625,158 247,176.75267 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -2.73515,22.67694 -12.70327,40.96619 -23.9701,43.97975 -7.17057,1.91792 -14.47431,0.87417 -18.12447,-2.59009 -10.1329,-9.61684 -14.99326,-32.4432 -16.37512,-76.90459 -0.35877,-11.54378 -0.77377,-21.11015 -0.92222,-21.25859 -0.21469,-0.21469 -53.01679,3.74751 -101.754682,7.63553 -4.217754,0.33647 -7.952282,0.89629 -8.298952,1.24404 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 126.06524,-5.46041 c 18.27587,-17.23212 38.72502,-16.24896 36.57158,1.7583 l -0.44845,3.75 18.07718,0 c 17.10789,0 18.03869,-0.0981 17.35941,-1.82874 C 437.823,688.16545 426.7,664.32644 413.5,636.1957 l -24,-51.14682 -1.28655,4.72556 c -6.48178,23.80795 -15.0658,43.30018 -26.9626,61.22556 -5.69052,8.57413 -11.23124,15.12553 -21.77757,25.75 l -14.1452,14.25 17.74402,0 17.74403,0 5.84193,-5.5083 z m 27.06366,1.4702 c -1.56815,-11.69142 -9.13002,-12.12264 -22.47172,-1.28146 -2.3375,1.8994 -4.25,3.87333 -4.25,4.38651 0,0.53177 5.86264,0.93305 13.63167,0.93305 l 13.63167,0 -0.54162,-4.0381 z M 400,685.5567 c 0,-4.49133 -0.38869,-5.71554 -2.22251,-7 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.63541,0 -1.62846,0.20195 0.11186,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 0.40479,2.31413 1.21295,3.75 2.11064,3.75 1.09476,0 1.45469,-1.34684 1.45469,-5.4433 z m 211,-19.63794 c 11.87512,-8.06734 27.44314,-23.61781 35.12813,-35.08854 9.09654,-13.57764 13.06548,-21.34868 17.53368,-34.33022 7.11934,-20.684 6.72627,-10.10857 7.06206,-190 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.64377,-10.07427 -25.73192,-29.08382 -35.47265,-35.32658 -3.43271,-2.2 -8.97606,-5.75951 -12.31854,-7.91001 -7.75241,-4.98779 -27.85337,-12.01206 -39.96641,-13.96624 -13.5107,-2.17966 -17.01535,-2.42039 -16.52205,-1.13487 0.3741,0.97488 66.965,110.93594 70.30468,116.09359 1.28943,1.99133 0.68084,2.44773 -13.9068,10.42918 -20.01731,10.95221 -43.79902,25.43651 -56.25524,34.26237 -11.18904,7.928 -26.5,22.51965 -26.5,25.25504 0,3.20524 8.00897,12.26586 18.30023,20.70321 36.52414,29.94452 46.74495,39.23669 63.39384,57.63406 11.92856,13.1813 26.28213,32.2817 33.86215,45.06058 3.24605,5.47241 6.1455,9.55573 6.4432,9.07403 0.94882,-1.53522 5.9939,-3.00106 10.31568,-2.9972 8.90829,0.008 13.21409,5.7645 11.65952,15.58795 -0.88905,5.61799 -5.35614,16.38814 -7.45825,17.98186 -1.20425,0.913 -1.0543,2.2126 1.00262,8.6899 3.0951,9.74652 6.07698,24.58802 7.42325,36.94714 5.00518,45.94913 -8.52378,93.45567 -37.84838,132.90344 -8.04473,10.82185 -28.33627,33.65802 -30.72048,34.57293 -0.75536,0.28986 -1.37338,0.96039 -1.37338,1.49007 0,1.13159 13.10001,-5.89144 21,-11.25827 z m 39.61692,-68.47466 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 6.3105,-3.07896 C 659.2491,591.4136 659.6718,588 657.71561,588 656.22479,588 653,593.06346 653,595.40429 c 0,2.36046 1.58269,1.94169 3.92742,-1.03915 z M 564.35796,344.95796 c -0.59791,-0.59791 0.72814,-2.74684 3.58798,-5.8145 3.37963,-3.62523 4.79366,-4.55625 5.54523,-3.65107 2.21019,2.66189 6.13722,4.50761 9.59055,4.50761 4.42676,0 11.52998,-5.77491 15.55849,-12.64903 5.94806,-10.1496 -0.23063,-21.23657 -12.79471,-22.95867 -3.49134,-0.47854 -4.8628,-0.23214 -6.21076,1.11582 -0.95149,0.95149 -1.83439,1.5639 -1.96201,1.36093 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.77712,290.63555 551.66264,290 546.3185,290 l -9.3185,0 -4.08572,4.08572 c -3.81645,3.81645 -8.88241,12.76176 -8.90451,15.7233 -0.005,0.71996 -0.45977,1.0309 -1.00977,0.69098 -2.95632,-1.82711 1.82135,-12.45721 8.52873,-18.97603 14.88428,-14.46587 38.4852,-11.78545 46.57464,5.2896 1.22113,2.57754 2.29937,4.80088 2.3961,4.94077 0.0967,0.13988 1.71142,-0.52471 3.5882,-1.47686 5.10612,-2.59052 14.26182,-2.30403 20.27575,0.63443 9.98545,4.87899 13.27619,15.3984 8.07936,25.82708 -6.80474,13.65532 -23.85435,20.88951 -36.11397,15.32322 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56732,2.83685 -4.8603,3.9029 -5.98204,2.78116 z m 36.42514,-9.9158 c 4.82725,-3.49684 9.20105,-10.50508 9.92509,-15.90321 1.07212,-7.99327 -5.52524,-15.12706 -15.45819,-16.7151 -5.32994,-0.85212 -5.43067,0.50795 -0.21571,2.91256 5.35597,2.46964 8.96702,8.6149 8.96197,15.25145 -0.004,5.19532 -2.05755,9.63287 -6.78531,14.66214 -3.39752,3.6142 -1.55611,3.50706 3.57215,-0.20784 z M 570,291.52032 c 0,-0.26382 -1.9125,-1.46337 -4.25,-2.66567 -4.6415,-2.38736 -18.98747,-3.89746 -20.0893,-2.11467 -0.36939,0.59769 2.6399,1.18402 7.6958,1.49945 4.72168,0.29457 9.56198,1.19994 11.22294,2.09923 2.88385,1.56139 5.42056,2.11438 5.42056,1.18166 z M 423,561.71224 c 19.83686,-9.53018 35.2836,-20.37788 42.50917,-29.85267 l 3.8886,-5.09906 -3.18007,-6.13026 c -5.74193,-11.06882 -18.83011,-24.42201 -42.7177,-43.58268 -7.15,-5.73515 -16.21343,-13.27829 -20.14097,-16.76254 l -7.14096,-6.335 -0.50107,47.77499 c -0.4779,45.56605 -1.24865,58.6507 -4.27062,72.50112 l -0.59481,2.72614 11.32422,-5.33799 C 408.4041,568.6784 417.775,564.22247 423,561.71224 z M 406.61692,511.4441 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 6.3105,-3.07896 C 415.2491,505.4136 415.6718,502 413.71561,502 412.22479,502 409,507.06346 409,509.40429 c 0,2.36046 1.58269,1.94169 3.92742,-1.03915 z M 649.5,447.16068 C 649.5,436.83867 647.78449,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.99558 0.25242,0.99517 1.25,-0.002 0.78471,-0.78443 1.25,-4.13068 1.25,-8.98978 z m -492.04353,2.80571 C 186.58253,447.78487 210.99503,446 211.70647,446 212.74686,446 213,436.43869 213,397.14246 l 0,-48.85755 -6.09313,-0.63686 c -11.24576,-1.17541 -20.38122,-7.08634 -23.4759,-15.18962 -1.3397,-3.50796 -1.59116,-6.51067 -1.18948,-14.20341 1.03483,-19.81829 10.21579,-33.77216 25.50851,-38.7696 l 5.25,-1.71563 0,-78.49619 0,-78.49618 3.25,0.5637 c 1.7875,0.31003 42.73858,4.9445 91.0024,10.29882 l 87.75241,9.73512 10.24759,-9.97698 c 5.63618,-5.48735 12.7226,-12.09573 15.7476,-14.6853 l 5.5,-4.70831 -106,0.28385 -106,0.28384 -11.70252,2.70309 c -20.21819,4.67005 -39.79562,13.53488 -54.66494,24.75274 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.61675 c 3.455719,-0.33922 30.113539,-2.40163 59.239599,-4.58314 z M 96.616924,391.4441 c -1.654296,-4.31102 5.950556,-12.59152 10.101296,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.341252,3.1646 -8.248366,0.8007 z m 6.310496,-3.07896 C 105.2491,385.4136 105.6718,382 103.71561,382 102.22479,382 99,387.06346 99,389.40429 c 0,2.36046 1.58269,1.94169 3.92742,-1.03915 z m 35.10912,-143.50143 c -8.87095,-2.64203 -12.54562,-8.50462 -11.80641,-18.83604 0.83136,-11.61928 9.28091,-25.17358 18.50664,-29.68731 10.40512,-5.09076 23.79103,-1.49061 28.57458,7.68513 5.26324,10.09592 -5.35133,31.85264 -18.91642,38.77303 -4.96284,2.53186 -11.86553,3.4033 -16.35839,2.06519 z m 12.65014,-2.90433 c 2.36559,-0.82465 3.89191,-2.8044 7.35432,-9.53913 C 167.31009,214.39099 163.46273,200 149.37361,200 c -6.72013,0 -10.20957,1.70868 -13.64267,6.68041 -7.08124,10.2549 -9.62751,23.01272 -5.80368,29.07873 4.0672,6.45208 12.66804,9.02091 20.75942,6.20024 z m 17.52003,-18.28223 c 4.21706,-8.2384 4.52816,-16.17023 0.79329,-20.22611 -2.71461,-2.94793 -9.35988,-6.39392 -12.39788,-6.42908 -1.41837,-0.0164 -1.0454,0.55253 1.4762,2.25184 7.99923,5.39068 10.45814,13.87418 7.21418,24.88973 -2.38223,8.08936 -1.39083,7.92389 2.91421,-0.48638 z M 654.90217,448.85078 C 655.50598,447.1187 656,443.54422 656,440.90748 c 0,-3.82044 -0.45137,-5.11022 -2.22251,-6.35078 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.5904,0 -1.55837,0.31423 0.36419,3.57273 1.45045,2.45832 2.14175,5.42087 2.21628,9.49776 0.12107,6.62315 0.87846,7.46193 2.51048,2.78029 z M 212.7651,315.25 213.03021,286 l -6.51511,0 c -6.25624,0 -6.67238,0.15728 -10.47361,3.95851 C 188.83016,297.16984 185,307.90111 185,320.89437 c 0,9.14201 2.39307,14.77869 7.7866,18.34074 5.08307,3.35701 12.82727,5.71608 17.7134,5.39593 1.94496,-0.12743 2.0073,-0.93602 2.2651,-29.38104 z M 213,283 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3416"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#4b4b4b"
+       d="m 459.34349,733.75 -8.04113,-17.25 -85.22675,-0.25563 -85.22675,-0.25563 -9.67443,2.95841 c -27.02521,8.26424 -56.59348,9.99669 -85.78505,5.02627 C 121.12163,713.03064 71.981289,663.67909 53.481763,591.49887 46.520206,564.33673 44.02492,537.69174 44.009889,490.35699 c -0.0111,-34.94358 -0.637909,-32.34993 7.821898,-32.36568 2.567517,-0.005 7.016075,-0.29073 9.885683,-0.63544 l 5.21747,-0.62675 0.326656,-112.61456 c 0.322105,-111.04583 0.35705,-112.76779 2.50862,-123.61456 3.431599,-17.29982 12.259277,-41.13164 18.442804,-49.7895 1.257839,-1.76117 3.125388,-4.779 4.150109,-6.70631 3.535499,-6.6496 14.542941,-20.52692 22.328301,-28.14977 8.98461,-8.79706 25.41149,-21.78694 32.17793,-25.44533 2.54685,-1.37699 5.75564,-3.15598 7.13064,-3.9533 3.6162,-2.09692 25.7945,-11.086237 30.5,-12.362271 2.2,-0.596595 9.175,-2.311687 15.5,-3.811316 L 211.5,87.555604 337,87.027802 462.5,86.5 471,81.381488 c 4.675,-2.815182 13.675,-7.934592 20,-11.376466 6.325,-3.441874 12.88103,-7.087391 14.56895,-8.101149 l 3.06894,-1.843196 8.00577,13.219662 8.00577,13.219661 12.42529,0.679298 c 17.96747,0.982292 31.62253,3.432774 46.58182,8.359385 17.33626,5.709427 21.95763,8.049227 41.97836,21.253587 7.40091,4.88117 9.60905,6.80999 23.71405,20.71443 20.33743,20.04824 34.37972,45.10994 41.17892,73.4933 5.32549,22.23131 4.91129,7.35828 5.22967,187.78621 l 0.29342,166.2862 -2.51542,14.11709 c -3.60523,20.23335 -11.91032,43.62249 -18.92965,53.3105 -1.19549,1.65 -2.66657,4.125 -3.26907,5.5 -1.69996,3.8796 -13.94547,19.85104 -20.20356,26.35088 -12.93665,13.4364 -27.583,24.39434 -42.63326,31.89689 -22.02215,10.97803 -40.01005,16.47416 -61.68666,18.84811 -7.46117,0.81713 -9.61104,1.51292 -15.239,4.93202 -11.39704,6.92395 -30.52187,16.60204 -47.24399,23.90775 C 475.43704,747.82104 467.98608,751 467.77266,751 c -0.21342,0 -4.00655,-7.7625 -8.42917,-17.25 z m 35.44133,-31.64202 c 34.33753,-17.23137 57.21213,-32.664 78.35271,-52.86158 27.81034,-26.56985 46.20268,-59.22954 52.51181,-93.2464 2.48979,-13.42415 2.48951,-44.02055 -5.2e-4,-56.5 -5.82328,-29.18496 -19.87608,-57.95926 -41.95708,-85.91072 -11.63175,-14.72416 -38.59718,-41.00866 -58.84186,-57.35599 -27.78073,-22.4326 -39.64054,-36.39777 -43.39893,-51.10316 -1.85052,-7.24047 -1.15174,-11.88114 3.0119,-20.00269 8.29893,-16.18773 37.84367,-40.31992 74.78712,-61.08621 3.16248,-1.77766 6.00341,-3.64219 6.31318,-4.14341 C 566.39261,218.55572 497.91265,106 496.26664,106 c -0.25699,0 -4.90308,2.48965 -10.32466,5.53256 -11.12627,6.24473 -28.9687,18.99216 -42.40758,30.29789 -11.54232,9.7102 -32.28634,30.4845 -40.11101,40.16955 -14.26587,17.65772 -30.59074,45.41777 -36.46036,62 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7062,22.71893 29.63611,49.8005 50.32192,68.37947 C 432.67167,442.31872 439.59399,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.74588,5.35481 12.36121,10.88229 14.77861,12.34835 31.35553,29.50618 37.80234,39.12706 15.94136,23.79002 13.7073,41.68563 -7.73618,61.96969 -9.45137,8.94034 -24.30198,18.85216 -40.73349,27.18695 -6.7983,3.44841 -12.53728,6.42373 -12.75329,6.61182 C 430.32838,595.2884 483.44408,707 484.54546,707 c 0.26998,0 4.8777,-2.20141 10.23936,-4.89202 z m -254.192,-11.15587 c 29.40566,-2.99413 59.69281,-19.34902 81.03122,-43.7564 21.23306,-24.28689 33.84373,-52.43655 39.96701,-89.21477 1.49857,-9.00084 1.8018,-19.59629 2.14725,-75.02887 l 0.40225,-64.54792 -6.97689,-10.45208 C 341.53832,384.54378 331.42682,359.77387 326.36284,332.5 c -1.47759,-7.9581 -1.84714,-14.69637 -1.80984,-33 0.0429,-21.04472 0.27511,-24.07507 2.73168,-35.6461 5.78758,-27.26082 17.04854,-54.01626 32.30884,-76.76403 3.67174,-5.47328 4.40648,-7.36231 4.40648,-11.32919 0,-2.61838 -0.3375,-4.7609 -0.75,-4.76116 -0.4125,-2.6e-4 -26.04094,-2.92526 -56.95209,-6.5 C 275.38677,160.92478 249.39927,158 248.54791,158 247.15625,158 247,176.75267 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -2.73515,22.67694 -12.70327,40.96619 -23.9701,43.97975 -7.17057,1.91792 -14.47431,0.87417 -18.12447,-2.59009 -10.1329,-9.61684 -14.99326,-32.4432 -16.37512,-76.90459 -0.35877,-11.54378 -0.77377,-21.11015 -0.92222,-21.25859 -0.21469,-0.21469 -53.01679,3.74751 -101.754682,7.63553 -4.217754,0.33647 -7.952282,0.89629 -8.298952,1.24404 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 126.06524,-5.46041 c 18.27587,-17.23212 38.72502,-16.24896 36.57158,1.7583 l -0.44845,3.75 18.07718,0 c 17.10789,0 18.03869,-0.0981 17.35941,-1.82874 C 437.823,688.16545 426.7,664.32644 413.5,636.1957 l -24,-51.14682 -1.28655,4.72556 c -6.48178,23.80795 -15.0658,43.30018 -26.9626,61.22556 -5.69052,8.57413 -11.23124,15.12553 -21.77757,25.75 l -14.1452,14.25 17.74402,0 17.74403,0 5.84193,-5.5083 z m 27.06366,1.4702 c -1.34507,-10.02819 -7.15709,-11.74133 -17.31668,-5.10423 -3.24777,2.12171 -6.99598,5.04671 -8.32935,6.5 L 365.65137,691 l 14.30599,0 14.30598,0 -0.54162,-4.0381 z M 400,685.5567 c 0,-4.49133 -0.38869,-5.71554 -2.22251,-7 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.63541,0 -1.62846,0.20195 0.11186,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 0.40479,2.31413 1.21295,3.75 2.11064,3.75 1.09476,0 1.45469,-1.34684 1.45469,-5.4433 z m 211,-19.63794 c 11.87512,-8.06734 27.44314,-23.61781 35.12813,-35.08854 9.09654,-13.57764 13.06548,-21.34868 17.53368,-34.33022 7.11934,-20.684 6.72627,-10.10857 7.06206,-190 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.64377,-10.07427 -25.73192,-29.08382 -35.47265,-35.32658 -3.43271,-2.2 -8.97606,-5.75951 -12.31854,-7.91001 -7.75241,-4.98779 -27.85337,-12.01206 -39.96641,-13.96624 -13.5107,-2.17966 -17.01535,-2.42039 -16.52205,-1.13487 0.3741,0.97488 66.965,110.93594 70.30468,116.09359 1.28943,1.99133 0.68084,2.44773 -13.9068,10.42918 -20.01731,10.95221 -43.79902,25.43651 -56.25524,34.26237 -11.18904,7.928 -26.5,22.51965 -26.5,25.25504 0,3.20524 8.00897,12.26586 18.30023,20.70321 36.52414,29.94452 46.74495,39.23669 63.39384,57.63406 11.92856,13.1813 26.28213,32.2817 33.86215,45.06058 3.24605,5.47241 6.1455,9.55573 6.4432,9.07403 0.94882,-1.53522 5.9939,-3.00106 10.31568,-2.9972 8.90829,0.008 13.21409,5.7645 11.65952,15.58795 -0.88905,5.61799 -5.35614,16.38814 -7.45825,17.98186 -1.20425,0.913 -1.0543,2.2126 1.00262,8.6899 3.0951,9.74652 6.07698,24.58802 7.42325,36.94714 5.00518,45.94913 -8.52378,93.45567 -37.84838,132.90344 -8.04473,10.82185 -28.33627,33.65802 -30.72048,34.57293 -0.75536,0.28986 -1.37338,0.96039 -1.37338,1.49007 0,1.13159 13.10001,-5.89144 21,-11.25827 z m 39.61692,-68.47466 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 4.98338,-1.20941 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 564.35796,344.95796 c -0.59791,-0.59791 0.72814,-2.74684 3.58798,-5.8145 3.37963,-3.62523 4.79366,-4.55625 5.54523,-3.65107 2.21019,2.66189 6.13722,4.50761 9.59055,4.50761 4.42676,0 11.52998,-5.77491 15.55849,-12.64903 4.7399,-8.08804 2.03481,-16.65781 -6.66064,-21.10097 -5.1781,-2.64588 -10.1871,-2.89961 -12.45576,-0.63095 -0.89048,0.89047 -1.72346,1.45297 -1.85108,1.25 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.783,290.63729 551.6666,290 546.3533,290 c -8.93136,0 -9.41609,0.11623 -12.77167,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -2.95632,-1.82711 1.82135,-12.45721 8.52873,-18.97603 14.88428,-14.46587 38.4852,-11.78545 46.57464,5.2896 1.22113,2.57754 2.29937,4.80088 2.3961,4.94077 0.0967,0.13988 1.71142,-0.52471 3.5882,-1.47686 5.10612,-2.59052 14.26182,-2.30403 20.27575,0.63443 9.98545,4.87899 13.27619,15.3984 8.07936,25.82708 -6.80474,13.65532 -23.85435,20.88951 -36.11397,15.32322 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56732,2.83685 -4.8603,3.9029 -5.98204,2.78116 z m 36.42514,-9.9158 c 4.82725,-3.49684 9.20105,-10.50508 9.92509,-15.90321 1.07212,-7.99327 -5.52524,-15.12706 -15.45819,-16.7151 -5.32994,-0.85212 -5.43067,0.50795 -0.21571,2.91256 5.35597,2.46964 8.96702,8.6149 8.96197,15.25145 -0.004,5.19532 -2.05755,9.63287 -6.78531,14.66214 -3.39752,3.6142 -1.55611,3.50706 3.57215,-0.20784 z M 570,291.52032 c 0,-0.26382 -1.9125,-1.46337 -4.25,-2.66567 -4.6415,-2.38736 -18.98747,-3.89746 -20.0893,-2.11467 -0.36939,0.59769 2.6399,1.18402 7.6958,1.49945 4.72168,0.29457 9.56198,1.19994 11.22294,2.09923 2.88385,1.56139 5.42056,2.11438 5.42056,1.18166 z M 423,561.71224 c 19.83686,-9.53018 35.2836,-20.37788 42.50917,-29.85267 l 3.8886,-5.09906 -3.18007,-6.13026 c -5.74193,-11.06882 -18.83011,-24.42201 -42.7177,-43.58268 -7.15,-5.73515 -16.21343,-13.27829 -20.14097,-16.76254 l -7.14096,-6.335 -0.50107,47.77499 c -0.4779,45.56605 -1.24865,58.6507 -4.27062,72.50112 l -0.59481,2.72614 11.32422,-5.33799 C 408.4041,568.6784 417.775,564.22247 423,561.71224 z M 406.61692,511.4441 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 4.98338,-1.20941 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 649.5,447.16068 C 649.5,436.83867 647.78449,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.99558 0.25242,0.99517 1.25,-0.002 0.78471,-0.78443 1.25,-4.13068 1.25,-8.98978 z m -492.04353,2.80571 C 186.58253,447.78487 210.99503,446 211.70647,446 212.74686,446 213,436.43869 213,397.14246 l 0,-48.85755 -6.09313,-0.63686 c -11.24576,-1.17541 -20.38122,-7.08634 -23.4759,-15.18962 -1.3397,-3.50796 -1.59116,-6.51067 -1.18948,-14.20341 1.03483,-19.81829 10.21579,-33.77216 25.50851,-38.7696 l 5.25,-1.71563 0,-78.49619 0,-78.49618 3.25,0.5637 c 1.7875,0.31003 42.73858,4.9445 91.0024,10.29882 l 87.75241,9.73512 10.24759,-9.97698 c 5.63618,-5.48735 12.7226,-12.09573 15.7476,-14.6853 l 5.5,-4.70831 -106,0.28385 -106,0.28384 -11.70252,2.70309 c -20.21819,4.67005 -39.79562,13.53488 -54.66494,24.75274 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.61675 c 3.455719,-0.33922 30.113539,-2.40163 59.239599,-4.58314 z M 96.616924,391.4441 c -1.654296,-4.31102 5.950556,-12.59152 10.101296,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.341252,3.1646 -8.248366,0.8007 z m 4.983376,-1.20941 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.413798,4.66777 -1.886354,7.26144 1.07462,5.28435 z m 36.43624,-145.37098 c -8.87095,-2.64203 -12.54562,-8.50462 -11.80641,-18.83604 0.83136,-11.61928 9.28091,-25.17358 18.50664,-29.68731 10.40512,-5.09076 23.79103,-1.49061 28.57458,7.68513 5.26324,10.09592 -5.35133,31.85264 -18.91642,38.77303 -4.96284,2.53186 -11.86553,3.4033 -16.35839,2.06519 z m 12.72147,-2.9292 c 2.46109,-0.85794 3.8937,-2.71669 7.35452,-9.54212 C 167.28082,214.31065 163.42005,200 149.37361,200 c -3.01011,0 -6.74564,0.65814 -8.30117,1.46254 -6.03271,3.11964 -13.07726,17.65697 -13.0687,26.96896 0.01,10.76863 11.3292,17.48582 22.75427,13.50301 z m 17.4487,-18.25736 c 4.21706,-8.2384 4.52816,-16.17023 0.79329,-20.22611 -2.71461,-2.94793 -9.35988,-6.39392 -12.39788,-6.42908 -1.41837,-0.0164 -1.0454,0.55253 1.4762,2.25184 7.99923,5.39068 10.45814,13.87418 7.21418,24.88973 -2.38223,8.08936 -1.39083,7.92389 2.91421,-0.48638 z M 654.90217,448.85078 C 655.50598,447.1187 656,443.54422 656,440.90748 c 0,-3.82044 -0.45137,-5.11022 -2.22251,-6.35078 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.5904,0 -1.55837,0.31423 0.36419,3.57273 1.45045,2.45832 2.14175,5.42087 2.21628,9.49776 0.12107,6.62315 0.87846,7.46193 2.51048,2.78029 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 -10.1022,8.50044 -15.57205,32.50225 -10.02051,43.97021 3.33037,6.87962 12.45241,11.60663 23.7134,12.28821 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3414"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#685623"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 35.41289,-31.64202 c 34.33753,-17.23137 57.21213,-32.664 78.35271,-52.86158 27.81034,-26.56985 46.20268,-59.22954 52.51181,-93.2464 2.48979,-13.42415 2.48951,-44.02055 -5.2e-4,-56.5 -5.82328,-29.18496 -19.87608,-57.95926 -41.95708,-85.91072 -11.63175,-14.72416 -38.59718,-41.00866 -58.84186,-57.35599 -27.78073,-22.4326 -39.64054,-36.39777 -43.39893,-51.10316 -1.85052,-7.24047 -1.15174,-11.88114 3.0119,-20.00269 8.29893,-16.18773 37.84367,-40.31992 74.78712,-61.08621 3.16248,-1.77766 6.00341,-3.64219 6.31318,-4.14341 C 566.39261,218.55572 497.91265,106 496.26664,106 c -0.25699,0 -4.90308,2.48965 -10.32466,5.53256 -11.12627,6.24473 -28.9687,18.99216 -42.40758,30.29789 -11.54232,9.7102 -32.28634,30.4845 -40.11101,40.16955 -14.26587,17.65772 -30.59074,45.41777 -36.46036,62 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7062,22.71893 29.63611,49.8005 50.32192,68.37947 C 432.67167,442.31872 439.59399,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.74588,5.35481 12.36121,10.88229 14.77861,12.34835 31.35553,29.50618 37.80234,39.12706 15.94136,23.79002 13.7073,41.68563 -7.73618,61.96969 -9.45137,8.94034 -24.30198,18.85216 -40.73349,27.18695 -6.7983,3.44841 -12.53728,6.42373 -12.75329,6.61182 C 430.32838,595.2884 483.44408,707 484.54546,707 c 0.26998,0 4.8777,-2.20141 10.23936,-4.89202 z m -254.192,-11.15587 c 29.40566,-2.99413 59.69281,-19.34902 81.03122,-43.7564 21.23306,-24.28689 33.84373,-52.43655 39.96701,-89.21477 1.49858,-9.00091 1.8018,-19.59657 2.14726,-75.03374 l 0.40227,-64.55279 -6.53686,-9.77709 c -13.48112,-20.16351 -24.85375,-46.31996 -29.45343,-67.74134 -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 2.98692,-4.42323 3.70502,-6.40988 3.70502,-10.25 0,-2.61984 -0.3375,-4.76357 -0.75,-4.76383 -0.4125,-2.6e-4 -26.04094,-2.92526 -56.95209,-6.5 C 275.38677,160.92478 249.39927,158 248.54791,158 247.15625,158 247,176.75267 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -2.73515,22.67694 -12.70327,40.96619 -23.9701,43.97975 -7.17057,1.91792 -14.47431,0.87417 -18.12447,-2.59009 -10.1329,-9.61684 -14.99326,-32.4432 -16.37512,-76.90459 -0.35877,-11.54378 -0.77377,-21.11015 -0.92222,-21.25859 -0.21469,-0.21469 -53.01679,3.74751 -101.754682,7.63553 -4.217754,0.33647 -7.952282,0.89629 -8.298952,1.24404 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 126.06524,-5.46041 c 18.27587,-17.23212 38.72502,-16.24896 36.57158,1.7583 l -0.44845,3.75 18.07718,0 c 17.10789,0 18.03869,-0.0981 17.35941,-1.82874 C 437.823,688.16545 426.7,664.32644 413.5,636.1957 l -24,-51.14682 -1.28655,4.72556 c -6.48178,23.80795 -15.0658,43.30018 -26.9626,61.22556 -5.69052,8.57413 -11.23124,15.12553 -21.77757,25.75 l -14.1452,14.25 17.74402,0 17.74403,0 5.84193,-5.5083 z m 27.06366,1.4702 c -1.34507,-10.02819 -7.15709,-11.74133 -17.31668,-5.10423 -3.24777,2.12171 -6.99598,5.04671 -8.32935,6.5 L 365.65137,691 l 14.30599,0 14.30598,0 -0.54162,-4.0381 z M 400,685.5567 c 0,-4.49133 -0.38869,-5.71554 -2.22251,-7 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.63541,0 -1.62846,0.20195 0.11186,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 0.40479,2.31413 1.21295,3.75 2.11064,3.75 1.09476,0 1.45469,-1.34684 1.45469,-5.4433 z m 211,-19.63794 c 11.87512,-8.06734 27.44314,-23.61781 35.12813,-35.08854 9.09654,-13.57764 13.06548,-21.34868 17.53368,-34.33022 7.11934,-20.684 6.72627,-10.10857 7.06206,-190 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.64377,-10.07427 -25.73192,-29.08382 -35.47265,-35.32658 -3.43271,-2.2 -8.97606,-5.75951 -12.31854,-7.91001 -7.77383,-5.00157 -27.88681,-12.02203 -39.96641,-13.95033 -16.24886,-2.59385 -17.10145,-2.66067 -16.57908,-1.29939 0.41263,1.07528 66.70751,110.59881 70.36171,116.2422 1.28943,1.99133 0.68084,2.44773 -13.9068,10.42918 -20.01731,10.95221 -43.79902,25.43651 -56.25524,34.26237 -11.18904,7.928 -26.5,22.51965 -26.5,25.25504 0,3.20524 8.00897,12.26586 18.30023,20.70321 36.52414,29.94452 46.74495,39.23669 63.39384,57.63406 11.92856,13.1813 26.28213,32.2817 33.86215,45.06058 3.24605,5.47241 6.1455,9.55573 6.4432,9.07403 0.94882,-1.53522 5.9939,-3.00106 10.31568,-2.9972 8.90829,0.008 13.21409,5.7645 11.65952,15.58795 -0.88905,5.61799 -5.35614,16.38814 -7.45825,17.98186 -1.20425,0.913 -1.0543,2.2126 1.00262,8.6899 3.0951,9.74652 6.07698,24.58802 7.42325,36.94714 5.00518,45.94913 -8.52378,93.45567 -37.84838,132.90344 -8.04473,10.82185 -28.33627,33.65802 -30.72048,34.57293 -0.75536,0.28986 -1.37338,0.96039 -1.37338,1.49007 0,1.13159 13.10001,-5.89144 21,-11.25827 z m 39.61692,-68.47466 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 4.98338,-1.20941 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 564.35796,344.95796 c -0.59791,-0.59791 0.72814,-2.74684 3.58798,-5.8145 3.37963,-3.62523 4.79366,-4.55625 5.54523,-3.65107 2.21019,2.66189 6.13722,4.50761 9.59055,4.50761 4.42676,0 11.52998,-5.77491 15.55849,-12.64903 4.7399,-8.08804 2.03481,-16.65781 -6.66064,-21.10097 -5.1781,-2.64588 -10.1871,-2.89961 -12.45576,-0.63095 -0.89048,0.89047 -1.72346,1.45297 -1.85108,1.25 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.783,290.63729 551.6666,290 546.3533,290 c -8.93136,0 -9.41609,0.11623 -12.77167,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -2.95632,-1.82711 1.82135,-12.45721 8.52873,-18.97603 14.88428,-14.46587 38.4852,-11.78545 46.57464,5.2896 1.22113,2.57754 2.29937,4.80088 2.3961,4.94077 0.0967,0.13988 1.71142,-0.52471 3.5882,-1.47686 5.10612,-2.59052 14.26182,-2.30403 20.27575,0.63443 9.98545,4.87899 13.27619,15.3984 8.07936,25.82708 -6.80474,13.65532 -23.85435,20.88951 -36.11397,15.32322 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56732,2.83685 -4.8603,3.9029 -5.98204,2.78116 z m 36.42514,-9.9158 c 4.82725,-3.49684 9.20105,-10.50508 9.92509,-15.90321 1.07212,-7.99327 -5.52524,-15.12706 -15.45819,-16.7151 -5.32994,-0.85212 -5.43067,0.50795 -0.21571,2.91256 5.35597,2.46964 8.96702,8.6149 8.96197,15.25145 -0.004,5.19532 -2.05755,9.63287 -6.78531,14.66214 -3.39752,3.6142 -1.55611,3.50706 3.57215,-0.20784 z M 570,291.52032 c 0,-0.26382 -1.9125,-1.46337 -4.25,-2.66567 -4.6415,-2.38736 -18.98747,-3.89746 -20.0893,-2.11467 -0.36939,0.59769 2.6399,1.18402 7.6958,1.49945 4.72168,0.29457 9.56198,1.19994 11.22294,2.09923 2.88385,1.56139 5.42056,2.11438 5.42056,1.18166 z M 423,561.71224 c 19.83686,-9.53018 35.2836,-20.37788 42.50917,-29.85267 l 3.8886,-5.09906 -3.18007,-6.13026 c -5.74193,-11.06882 -18.83011,-24.42201 -42.7177,-43.58268 -7.15,-5.73515 -16.21343,-13.27829 -20.14097,-16.76254 l -7.14096,-6.335 -0.50107,47.77499 c -0.4779,45.56605 -1.24865,58.6507 -4.27062,72.50112 l -0.59481,2.72614 11.32422,-5.33799 C 408.4041,568.6784 417.775,564.22247 423,561.71224 z M 406.61692,511.4441 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 4.98338,-1.20941 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 649.5,447.16068 C 649.5,436.83867 647.78449,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.99558 0.25242,0.99517 1.25,-0.002 0.78471,-0.78443 1.25,-4.13068 1.25,-8.98978 z m -492.04353,2.80571 C 186.58253,447.78487 210.99503,446 211.70647,446 212.74686,446 213,436.43869 213,397.14246 l 0,-48.85755 -6.09313,-0.63686 c -11.24576,-1.17541 -20.38122,-7.08634 -23.4759,-15.18962 -1.3397,-3.50796 -1.59116,-6.51067 -1.18948,-14.20341 1.03483,-19.81829 10.21579,-33.77216 25.50851,-38.7696 l 5.25,-1.71563 0,-78.49619 0,-78.49618 3.25,0.5637 c 1.7875,0.31003 42.73858,4.9445 91.0024,10.29882 l 87.75241,9.73512 10.24759,-9.97698 c 5.63618,-5.48735 12.7226,-12.09573 15.7476,-14.6853 l 5.5,-4.70831 -106,0.28385 -106,0.28384 -11.70252,2.70309 c -20.21819,4.67005 -39.79562,13.53488 -54.66494,24.75274 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.61675 c 3.455719,-0.33922 30.113539,-2.40163 59.239599,-4.58314 z M 96.616924,391.4441 c -1.654296,-4.31102 5.950556,-12.59152 10.101296,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.341252,3.1646 -8.248366,0.8007 z m 4.983376,-1.20941 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.413798,4.66777 -1.886354,7.26144 1.07462,5.28435 z m 36.43624,-145.37098 c -8.87095,-2.64203 -12.54562,-8.50462 -11.80641,-18.83604 0.83136,-11.61928 9.28091,-25.17358 18.50664,-29.68731 10.40512,-5.09076 23.79103,-1.49061 28.57458,7.68513 5.26324,10.09592 -5.35133,31.85264 -18.91642,38.77303 -4.96284,2.53186 -11.86553,3.4033 -16.35839,2.06519 z m 12.72147,-2.9292 c 2.46109,-0.85794 3.8937,-2.71669 7.35452,-9.54212 C 167.28082,214.31065 163.42005,200 149.37361,200 c -3.01011,0 -6.74564,0.65814 -8.30117,1.46254 -6.03271,3.11964 -13.07726,17.65697 -13.0687,26.96896 0.01,10.76863 11.3292,17.48582 22.75427,13.50301 z m 17.4487,-18.25736 c 4.21706,-8.2384 4.52816,-16.17023 0.79329,-20.22611 -2.71461,-2.94793 -9.35988,-6.39392 -12.39788,-6.42908 -1.41837,-0.0164 -1.0454,0.55253 1.4762,2.25184 7.99923,5.39068 10.45814,13.87418 7.21418,24.88973 -2.38223,8.08936 -1.39083,7.92389 2.91421,-0.48638 z M 654.90217,448.85078 C 655.50598,447.1187 656,443.54422 656,440.90748 c 0,-3.82044 -0.45137,-5.11022 -2.22251,-6.35078 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.5904,0 -1.55837,0.31423 0.36419,3.57273 1.45045,2.45832 2.14175,5.42087 2.21628,9.49776 0.12107,6.62315 0.87846,7.46193 2.51048,2.78029 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 -10.1022,8.50044 -15.57205,32.50225 -10.02051,43.97021 3.33037,6.87962 12.45241,11.60663 23.7134,12.28821 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3412"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#53533b"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 35.41289,-31.64202 c 34.38842,-17.25691 57.18416,-32.64364 78.45594,-52.95637 C 600.97373,622.669 619.31041,590.08145 625.65623,556 c 2.69053,-14.44999 2.46125,-45.08118 -0.43787,-58.5 C 618.88825,468.2006 605.15985,440.56195 583.24634,413 571.86244,398.68178 544.65455,372.22528 524.95502,356.31849 493.31339,330.7688 480.92156,314.73873 480.64571,299 c -0.19524,-11.13998 9.46881,-25.42292 27.14748,-40.12246 10.63981,-8.84684 33.44403,-24.44208 47.98448,-32.8154 5.10272,-2.93847 9.51865,-5.73258 9.81318,-6.20914 C 566.41555,218.51862 497.8695,106 496.2319,106 c -1.82523,0 -23.79301,13.54391 -32.82494,20.23774 -22.14274,16.41061 -46.71894,39.24809 -60.00773,55.76226 -14.33319,17.81206 -30.5818,45.46077 -36.4362,62 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7062,22.71893 29.63611,49.8005 50.32192,68.37947 C 432.67167,442.31872 439.59399,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34696 12.33333,10.86484 29.25201,24.45593 46.12701,46.7695 48.10632,63.61031 0.75211,6.39932 -1.531,16.15973 -5.30237,22.66787 -7.3142,12.62188 -28.82294,29.53438 -53.4434,42.02297 -6.7983,3.44841 -12.53728,6.42373 -12.75329,6.61182 C 430.32838,595.2884 483.44408,707 484.54546,707 c 0.26998,0 4.8777,-2.20141 10.23936,-4.89202 z m -254.192,-11.15587 c 29.40566,-2.99413 59.69281,-19.34902 81.03122,-43.7564 23.68002,-27.08578 37.32654,-60.65273 41.31298,-101.61939 C 363.55044,539.27259 364,510.02367 364,476.41839 l 0,-58.23425 -6.46657,-9.67195 C 344.1226,388.4538 332.74068,362.2541 328.15029,340.87598 c -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 2.98692,-4.42323 3.70502,-6.40988 3.70502,-10.25 0,-2.61984 -0.3375,-4.76357 -0.75,-4.76383 -0.4125,-2.6e-4 -26.04094,-2.92526 -56.95209,-6.5 C 275.38677,160.92478 249.39927,158 248.54791,158 247.15625,158 247,176.75267 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -1.82036,15.09248 -6.66003,28.09401 -13.67576,36.73929 -4.93952,6.08681 -8.36742,7.59059 -17.48096,7.66868 -7.20388,0.0617 -7.87457,-0.11974 -10.8445,-2.9342 -10.245,-9.70871 -15.11818,-32.54082 -16.42336,-76.94782 -0.33863,-11.52131 -0.76418,-21.09632 -0.94567,-21.27781 -0.18149,-0.1815 -21.42997,1.31481 -47.21884,3.32511 -64.182179,5.00316 -62.150164,4.8243 -62.856454,5.5328 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 126.06524,-5.46041 c 18.27587,-17.23212 38.72502,-16.24896 36.57158,1.7583 l -0.44845,3.75 18.07718,0 c 17.13806,0 18.03989,-0.0955 17.35941,-1.83751 C 437.823,688.15187 426.7,664.3042 413.5,636.16767 l -24,-51.15731 -1.28655,4.74482 c -8.00126,29.50886 -19.9687,53.87546 -36.2191,73.74482 -3.14877,3.85 -10.51692,11.6125 -16.37366,17.25 l -10.64863,10.25 17.92203,0 17.92204,0 5.84193,-5.5083 z m 27.06366,1.4702 c -1.34507,-10.02819 -7.15709,-11.74133 -17.31668,-5.10423 -3.24777,2.12171 -6.99598,5.04671 -8.32935,6.5 L 365.65137,691 l 14.30599,0 14.30598,0 -0.54162,-4.0381 z M 400,685.5567 c 0,-4.49133 -0.38869,-5.71554 -2.22251,-7 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.63541,0 -1.62846,0.20195 0.11186,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 0.40479,2.31413 1.21295,3.75 2.11064,3.75 1.09476,0 1.45469,-1.34684 1.45469,-5.4433 z m 211,-19.6513 c 23.70996,-16.16489 43.15963,-41.7985 52.66181,-69.4054 7.11934,-20.684 6.72627,-10.10857 7.06206,-190 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.69998,-0.33716 -2.22983,-0.0892 -1.8613,0.8712 0.43842,1.14252 66.53774,110.37711 70.39982,116.34153 1.28943,1.99133 0.68084,2.44773 -13.9068,10.42918 -20.01731,10.95221 -43.79902,25.43651 -56.25524,34.26237 -11.18904,7.928 -26.5,22.51965 -26.5,25.25504 0,3.20524 8.00897,12.26586 18.30023,20.70321 27.14839,22.25776 34.13977,28.28618 45.4439,39.18472 20.80065,20.05431 39.98571,43.57224 51.82018,63.52355 3.2416,5.46492 6.13741,9.5421 6.43511,9.0604 0.94882,-1.53522 5.9939,-3.00106 10.31568,-2.9972 8.90829,0.008 13.21409,5.7645 11.65952,15.58795 -0.88351,5.58299 -5.3514,16.38416 -7.42945,17.9608 -1.16208,0.88168 -0.90531,2.66683 1.58221,11 16.99704,56.93989 5.63454,118.27477 -31.04136,167.56154 -8.39869,11.28655 -27.03435,32.25276 -30.14946,33.91992 -1.06511,0.57003 -1.93656,1.50211 -1.93656,2.07128 0,1.1968 12.93809,-5.70341 21,-11.19983 z m 39.61692,-68.4613 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 4.98338,-1.20941 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 564.35796,344.95796 c -0.59791,-0.59791 0.72814,-2.74684 3.58798,-5.8145 3.37963,-3.62523 4.79366,-4.55625 5.54523,-3.65107 2.21019,2.66189 6.13722,4.50761 9.59055,4.50761 4.42676,0 11.52998,-5.77491 15.55849,-12.64903 4.7399,-8.08804 2.03481,-16.65781 -6.66064,-21.10097 -5.1781,-2.64588 -10.1871,-2.89961 -12.45576,-0.63095 -0.89048,0.89047 -1.72346,1.45297 -1.85108,1.25 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.783,290.63729 551.6666,290 546.3533,290 c -8.93136,0 -9.41609,0.11623 -12.77167,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -2.95632,-1.82711 1.82135,-12.45721 8.52873,-18.97603 14.88428,-14.46587 38.4852,-11.78545 46.57464,5.2896 1.22113,2.57754 2.29937,4.80088 2.3961,4.94077 0.0967,0.13988 1.71142,-0.52471 3.5882,-1.47686 5.10612,-2.59052 14.26182,-2.30403 20.27575,0.63443 9.98545,4.87899 13.27619,15.3984 8.07936,25.82708 -6.80474,13.65532 -23.85435,20.88951 -36.11397,15.32322 -4.12569,-1.8732 -4.19102,-1.87195 -5.98881,0.11459 -2.56732,2.83685 -4.8603,3.9029 -5.98204,2.78116 z m 36.42514,-9.9158 c 4.82725,-3.49684 9.20105,-10.50508 9.92509,-15.90321 1.07212,-7.99327 -5.52524,-15.12706 -15.45819,-16.7151 -5.32994,-0.85212 -5.43067,0.50795 -0.21571,2.91256 5.35597,2.46964 8.96702,8.6149 8.96197,15.25145 -0.004,5.19532 -2.05755,9.63287 -6.78531,14.66214 -3.39752,3.6142 -1.55611,3.50706 3.57215,-0.20784 z M 570,291.52032 c 0,-0.26382 -1.9125,-1.46337 -4.25,-2.66567 -4.6415,-2.38736 -18.98747,-3.89746 -20.0893,-2.11467 -0.36939,0.59769 2.6399,1.18402 7.6958,1.49945 4.72168,0.29457 9.56198,1.19994 11.22294,2.09923 2.88385,1.56139 5.42056,2.11438 5.42056,1.18166 z M 422,562.21637 c 20.84101,-10.02966 36.15665,-20.71554 43.50917,-30.3568 l 3.8886,-5.09906 -3.18213,-6.13026 C 460.62294,509.85612 447.6634,496.46147 426,479.06439 420.225,474.4267 411.1125,466.8652 405.75,462.26107 l -9.75,-8.37117 0,38.90983 c 0,42.77977 -1.4592,68.32675 -4.67991,81.93387 -0.57114,2.413 0.91982,1.8047 30.67991,-12.51723 z M 406.61692,511.4441 c -1.65429,-4.31102 5.95056,-12.59152 10.1013,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.34125,3.1646 -8.24837,0.8007 z m 4.98338,-1.20941 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z M 649.5,447.16068 C 649.5,436.83867 647.78449,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.99558 0.25242,0.99517 1.25,-0.002 0.78471,-0.78443 1.25,-4.13068 1.25,-8.98978 z m -492,2.80877 c 29.15,-2.1814 53.5625,-3.96692 54.25,-3.96781 0.98292,-0.001 1.25,-10.44069 1.25,-48.85918 l 0,-48.85755 -6.09313,-0.63686 c -11.24576,-1.17541 -20.38122,-7.08634 -23.4759,-15.18962 -1.3397,-3.50796 -1.59116,-6.51067 -1.18948,-14.20341 1.03483,-19.81829 10.21579,-33.77216 25.50851,-38.7696 l 5.25,-1.71563 0,-78.50989 0,-78.5099 2.75,0.52434 c 1.5125,0.28838 42.46194,4.92942 90.99875,10.31341 l 88.24875,9.78908 9.75125,-9.47826 C 410.11194,126.68552 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -11.77855,2.71919 c -20.5046,4.73367 -39.46088,13.3236 -54.58891,24.73664 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.61532 C 101.67259,454.21253 128.35,452.15085 157.5,449.96945 z M 96.616924,391.4441 c -1.654296,-4.31102 5.950556,-12.59152 10.101296,-10.99873 2.16229,0.82974 1.01474,7.14553 -1.85293,10.19803 -2.53465,2.69801 -7.341252,3.1646 -8.248366,0.8007 z m 4.983376,-1.20941 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.413798,4.66777 -1.886354,7.26144 1.07462,5.28435 z m 36.43624,-145.37098 c -8.87095,-2.64203 -12.54562,-8.50462 -11.80641,-18.83604 0.83136,-11.61928 9.28091,-25.17358 18.50664,-29.68731 10.40512,-5.09076 23.79103,-1.49061 28.57458,7.68513 5.26324,10.09592 -5.35133,31.85264 -18.91642,38.77303 -4.96284,2.53186 -11.86553,3.4033 -16.35839,2.06519 z m 12.72147,-2.9292 c 2.46109,-0.85794 3.8937,-2.71669 7.35452,-9.54212 C 167.28082,214.31065 163.42005,200 149.37361,200 c -3.01011,0 -6.74564,0.65814 -8.30117,1.46254 -6.03271,3.11964 -13.07726,17.65697 -13.0687,26.96896 0.01,10.76863 11.3292,17.48582 22.75427,13.50301 z m 17.4487,-18.25736 c 4.21706,-8.2384 4.52816,-16.17023 0.79329,-20.22611 -2.71461,-2.94793 -9.35988,-6.39392 -12.39788,-6.42908 -1.41837,-0.0164 -1.0454,0.55253 1.4762,2.25184 7.99923,5.39068 10.45814,13.87418 7.21418,24.88973 -2.38223,8.08936 -1.39083,7.92389 2.91421,-0.48638 z M 654.90217,448.85078 C 655.50598,447.1187 656,443.54422 656,440.90748 c 0,-3.82044 -0.45137,-5.11022 -2.22251,-6.35078 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.5904,0 -1.55837,0.31423 0.36419,3.57273 1.45045,2.45832 2.14175,5.42087 2.21628,9.49776 0.12107,6.62315 0.87846,7.46193 2.51048,2.78029 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 -10.1022,8.50044 -15.57205,32.50225 -10.02051,43.97021 3.33037,6.87962 12.45241,11.60663 23.7134,12.28821 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3410"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#555137"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 35.41289,-31.64202 c 34.38842,-17.25691 57.18416,-32.64364 78.45594,-52.95637 C 600.97373,622.669 619.31041,590.08145 625.65623,556 c 2.69053,-14.44999 2.46125,-45.08118 -0.43787,-58.5 C 618.88825,468.2006 605.15985,440.56195 583.24634,413 571.86244,398.68178 544.65455,372.22528 524.95502,356.31849 493.31339,330.7688 480.92156,314.73873 480.64571,299 c -0.19524,-11.13998 9.46881,-25.42292 27.14748,-40.12246 10.63981,-8.84684 33.44403,-24.44208 47.98448,-32.8154 5.10272,-2.93847 9.51865,-5.73258 9.81318,-6.20914 C 566.41555,218.51862 497.8695,106 496.2319,106 c -1.82523,0 -23.79301,13.54391 -32.82494,20.23774 -22.14274,16.41061 -46.71894,39.24809 -60.00773,55.76226 -14.33319,17.81206 -30.5818,45.46077 -36.4362,62 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7062,22.71893 29.63611,49.8005 50.32192,68.37947 C 432.67167,442.31872 439.59399,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34696 12.33333,10.86484 29.25201,24.45593 46.12701,46.7695 48.10632,63.61031 0.75211,6.39932 -1.531,16.15973 -5.30237,22.66787 -7.3142,12.62188 -28.82294,29.53438 -53.4434,42.02297 -6.7983,3.44841 -12.53728,6.42373 -12.75329,6.61182 C 430.32838,595.2884 483.44408,707 484.54546,707 c 0.26998,0 4.8777,-2.20141 10.23936,-4.89202 z m -254.192,-11.15587 c 29.40566,-2.99413 59.69281,-19.34902 81.03122,-43.7564 23.68002,-27.08578 37.32654,-60.65273 41.31298,-101.61939 C 363.55044,539.27259 364,510.02367 364,476.41839 l 0,-58.23425 -6.46657,-9.67195 C 344.1226,388.4538 332.74068,362.2541 328.15029,340.87598 c -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 2.98692,-4.42323 3.70502,-6.40988 3.70502,-10.25 0,-2.61984 -0.3375,-4.76357 -0.75,-4.76383 -0.4125,-2.6e-4 -26.04094,-2.92526 -56.95209,-6.5 C 275.38677,160.92478 249.39927,158 248.54791,158 247.15625,158 247,176.75267 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -1.82036,15.09248 -6.66003,28.09401 -13.67576,36.73929 -4.93952,6.08681 -8.36742,7.59059 -17.48096,7.66868 -7.20388,0.0617 -7.87457,-0.11974 -10.8445,-2.9342 -10.245,-9.70871 -15.11818,-32.54082 -16.42336,-76.94782 -0.33863,-11.52131 -0.76418,-21.09632 -0.94567,-21.27781 -0.18149,-0.1815 -21.42997,1.31481 -47.21884,3.32511 -64.182179,5.00316 -62.150164,4.8243 -62.856454,5.5328 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 126.15592,-5.42391 c 10.80775,-10.28257 23.72712,-14.91909 31.03748,-11.13875 4.17243,2.15765 5.21378,4.36363 5.21378,11.04481 l 0,5.56574 17.96778,0 c 17.03188,0 17.93038,-0.0957 17.25,-1.83751 C 437.823,688.15187 426.7,664.3042 413.5,636.16767 l -24,-51.15731 -1.28655,4.74482 c -8.00126,29.50886 -19.9687,53.87546 -36.2191,73.74482 -3.14877,3.85 -10.51692,11.6125 -16.37366,17.25 l -10.64863,10.25 18.01271,0 18.01271,0 5.75126,-5.4718 z m 26.97298,1.4337 c -1.34507,-10.02819 -7.15709,-11.74133 -17.31668,-5.10423 -3.24777,2.12171 -6.99598,5.04671 -8.32935,6.5 L 365.65137,691 l 14.30599,0 14.30598,0 -0.54162,-4.0381 z M 400,685.5567 c 0,-4.49133 -0.38869,-5.71554 -2.22251,-7 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.63541,0 -1.62846,0.20195 0.11186,3.25 1.0206,1.7875 2.15081,4.9375 2.51159,7 0.40479,2.31413 1.21295,3.75 2.11064,3.75 1.09476,0 1.45469,-1.34684 1.45469,-5.4433 z m 211,-19.6513 c 23.70996,-16.16489 43.15963,-41.7985 52.66181,-69.4054 7.11934,-20.684 6.72627,-10.10857 7.06206,-190 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.69998,-0.33716 -2.22983,-0.0892 -1.8613,0.8712 0.43842,1.14252 66.53774,110.37711 70.39982,116.34153 1.28943,1.99133 0.68084,2.44773 -13.9068,10.42918 -20.01731,10.95221 -43.79902,25.43651 -56.25524,34.26237 -11.18904,7.928 -26.5,22.51965 -26.5,25.25504 0,3.20524 8.00897,12.26586 18.30023,20.70321 27.14839,22.25776 34.13977,28.28618 45.4439,39.18472 20.80065,20.05431 39.98571,43.57224 51.82018,63.52355 3.2416,5.46492 6.15989,9.50572 6.48507,8.97956 0.82745,-1.33884 6.76401,-2.92082 10.94402,-2.91636 4.52968,0.005 9.77551,3.22733 10.59976,6.51143 1.60056,6.37712 -2.15591,21.49163 -6.50036,26.15485 -1.87442,2.01195 -1.85872,2.19038 1.05056,11.93623 16.98014,56.88204 5.60368,118.24101 -31.05734,167.50778 -8.39869,11.28655 -27.03435,32.25276 -30.14946,33.91992 -1.06511,0.57003 -1.93656,1.50211 -1.93656,2.07128 0,1.1968 12.93809,-5.70341 21,-11.19983 z m 39.62402,-68.44279 c -1.58202,-4.12269 6.03126,-12.57634 9.96624,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.28388,-0.20028 -3.72171,-1.34123 z m 4.97628,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 564.35796,344.95796 c -0.59791,-0.59791 0.72814,-2.74684 3.58798,-5.8145 3.37963,-3.62523 4.79366,-4.55625 5.54523,-3.65107 2.21019,2.66189 6.13722,4.50761 9.59055,4.50761 4.42676,0 11.52998,-5.77491 15.55849,-12.64903 4.7399,-8.08804 2.03481,-16.65781 -6.66064,-21.10097 -5.1781,-2.64588 -10.1871,-2.89961 -12.45576,-0.63095 -0.89048,0.89047 -1.72346,1.45297 -1.85108,1.25 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.783,290.63729 551.6666,290 546.3533,290 c -8.93136,0 -9.41609,0.11623 -12.77167,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -2.87274,-1.77545 1.86046,-12.29379 8.5362,-18.96953 14.53973,-14.53974 38.4005,-11.74594 46.44932,5.43862 1.79497,3.83233 2.77788,4.93235 3.95185,4.4227 7.40109,-3.21306 10.49145,-3.71471 15.89789,-2.5807 6.90311,1.44794 12.14105,5.02277 15.11645,10.31678 1.90362,3.38704 2.20699,5.04554 1.7438,9.53341 -1.81295,17.56583 -23.30904,30.54514 -38.44951,23.21576 l -4.38545,-2.12296 -1.48156,2.11522 c -1.99187,2.8438 -4.81678,4.29291 -6.02103,3.08866 z m 36.42514,-9.9158 c 4.82725,-3.49684 9.20105,-10.50508 9.92509,-15.90321 1.07212,-7.99327 -5.52524,-15.12706 -15.45819,-16.7151 -5.32994,-0.85212 -5.43067,0.50795 -0.21571,2.91256 5.35597,2.46964 8.96702,8.6149 8.96197,15.25145 -0.004,5.19532 -2.05755,9.63287 -6.78531,14.66214 -3.39752,3.6142 -1.55611,3.50706 3.57215,-0.20784 z M 570,291.52032 c 0,-0.26382 -1.9125,-1.46337 -4.25,-2.66567 -4.6415,-2.38736 -18.98747,-3.89746 -20.0893,-2.11467 -0.36939,0.59769 2.6399,1.18402 7.6958,1.49945 4.72168,0.29457 9.56198,1.19994 11.22294,2.09923 2.88385,1.56139 5.42056,2.11438 5.42056,1.18166 z M 422,562.21637 c 20.84101,-10.02966 36.15665,-20.71554 43.50917,-30.3568 l 3.8886,-5.09906 -3.18213,-6.13026 C 460.62294,509.85612 447.6634,496.46147 426,479.06439 420.225,474.4267 411.1125,466.8652 405.75,462.26107 l -9.75,-8.37117 0,38.90983 c 0,42.77977 -1.4592,68.32675 -4.67991,81.93387 -0.57114,2.413 0.91982,1.8047 30.67991,-12.51723 z m -15.37598,-50.75376 c -1.58202,-4.12269 6.03126,-12.57634 9.96624,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.28388,-0.20028 -3.72171,-1.34123 z m 4.97628,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z M 649.5,447.16068 C 649.5,436.83867 647.78449,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.99558 0.25242,0.99517 1.25,-0.002 0.78471,-0.78443 1.25,-4.13068 1.25,-8.98978 z m -492,2.80877 c 29.15,-2.1814 53.5625,-3.96692 54.25,-3.96781 C 212.73297,446.00035 213,435.53246 213,397 l 0,-49 -3.39466,0 c -5.48938,0 -15.80118,-3.68914 -19.98449,-7.14963 -5.58696,-4.62162 -7.57238,-9.68787 -7.59889,-19.39027 -0.0587,-21.47478 11.33824,-38.76959 28.22804,-42.83609 l 2.75,-0.66211 0,-78.60595 0,-78.60595 2.75,0.52434 c 1.5125,0.28838 42.46194,4.92942 90.99875,10.31341 l 88.24875,9.78908 9.75125,-9.47826 C 410.11194,126.68552 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -11.77855,2.71919 c -20.5046,4.73367 -39.46088,13.3236 -54.58891,24.73664 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.61532 C 101.67259,454.21253 128.35,452.15085 157.5,449.96945 z M 96.624024,391.46261 c -1.582021,-4.12269 6.031256,-12.57634 9.966236,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.283879,-0.20028 -3.721706,-1.34123 z m 4.976276,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.413798,4.66777 -1.886354,7.26144 1.07462,5.28435 z m 37.04566,-145.31958 c -9.13851,-2.19826 -13.17423,-8.31687 -12.41678,-18.82525 0.82836,-11.49208 9.44278,-25.3145 18.55495,-29.77267 10.27992,-5.0295 23.39833,-1.48443 28.43001,7.68281 4.07193,7.41867 -0.58539,22.11453 -10.10609,31.88907 -7.75419,7.96094 -16.09533,11.03865 -24.46209,9.02604 z m 12.11205,-2.9806 c 2.46109,-0.85794 3.8937,-2.71669 7.35452,-9.54212 C 167.28082,214.31065 163.42005,200 149.37361,200 c -3.01011,0 -6.74564,0.65814 -8.30117,1.46254 -6.03271,3.11964 -13.07726,17.65697 -13.0687,26.96896 0.01,10.76863 11.3292,17.48582 22.75427,13.50301 z m 17.4487,-18.25736 c 4.21706,-8.2384 4.52816,-16.17023 0.79329,-20.22611 -2.71461,-2.94793 -9.35988,-6.39392 -12.39788,-6.42908 -1.41837,-0.0164 -1.0454,0.55253 1.4762,2.25184 7.99923,5.39068 10.45814,13.87418 7.21418,24.88973 -2.38223,8.08936 -1.39083,7.92389 2.91421,-0.48638 z M 654.90217,448.85078 C 655.50598,447.1187 656,443.54422 656,440.90748 c 0,-3.82044 -0.45137,-5.11022 -2.22251,-6.35078 -1.22237,-0.85618 -3.0072,-1.5567 -3.96627,-1.5567 -1.5904,0 -1.55837,0.31423 0.36419,3.57273 1.45045,2.45832 2.14175,5.42087 2.21628,9.49776 0.12107,6.62315 0.87846,7.46193 2.51048,2.78029 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 -10.1022,8.50044 -15.57205,32.50225 -10.02051,43.97021 3.33037,6.87962 12.45241,11.60663 23.7134,12.28821 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3408"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#665422"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 35.41289,-31.64202 c 34.38842,-17.25691 57.18416,-32.64364 78.45594,-52.95637 C 600.97373,622.669 619.31041,590.08145 625.65623,556 c 2.69053,-14.44999 2.46125,-45.08118 -0.43787,-58.5 C 618.88825,468.2006 605.15985,440.56195 583.24634,413 571.86244,398.68178 544.65455,372.22528 524.95502,356.31849 493.31339,330.7688 480.92156,314.73873 480.64571,299 c -0.19524,-11.13998 9.46881,-25.42292 27.14748,-40.12246 10.63981,-8.84684 33.44403,-24.44208 47.98448,-32.8154 5.10272,-2.93847 9.51865,-5.73258 9.81318,-6.20914 C 566.41555,218.51862 497.8695,106 496.2319,106 c -1.82523,0 -23.79301,13.54391 -32.82494,20.23774 -22.14274,16.41061 -46.71894,39.24809 -60.00773,55.76226 -14.33319,17.81206 -30.5818,45.46077 -36.4362,62 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7062,22.71893 29.63611,49.8005 50.32192,68.37947 C 432.67167,442.31872 439.59399,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34696 12.33333,10.86484 29.25201,24.45593 46.12701,46.7695 48.10632,63.61031 0.75211,6.39932 -1.531,16.15973 -5.30237,22.66787 -7.3142,12.62188 -28.82294,29.53438 -53.4434,42.02297 -6.7983,3.44841 -12.53728,6.42373 -12.75329,6.61182 C 430.32838,595.2884 483.44408,707 484.54546,707 c 0.26998,0 4.8777,-2.20141 10.23936,-4.89202 z m -254.192,-11.15587 c 29.40566,-2.99413 59.69281,-19.34902 81.03122,-43.7564 23.68002,-27.08578 37.32654,-60.65273 41.31298,-101.61939 C 363.55044,539.27259 364,510.02367 364,476.41839 l 0,-58.23425 -6.46657,-9.67195 C 344.1226,388.4538 332.74068,362.2541 328.15029,340.87598 c -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 2.98692,-4.42323 3.70502,-6.40988 3.70502,-10.25 0,-2.61984 -0.3375,-4.76357 -0.75,-4.76383 -0.4125,-2.6e-4 -26.04094,-2.92526 -56.95209,-6.5 C 275.38677,160.92478 249.39927,158 248.54791,158 247.15625,158 247,176.75267 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -1.82036,15.09248 -6.66003,28.09401 -13.67576,36.73929 -4.93952,6.08681 -8.36742,7.59059 -17.48096,7.66868 -7.20388,0.0617 -7.87457,-0.11974 -10.8445,-2.9342 -10.245,-9.70871 -15.11818,-32.54082 -16.42336,-76.94782 -0.33863,-11.52131 -0.76418,-21.09632 -0.94567,-21.27781 -0.18149,-0.1815 -21.42997,1.31481 -47.21884,3.32511 -64.182179,5.00316 -62.150164,4.8243 -62.856454,5.5328 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 126.15592,-5.42391 c 10.80775,-10.28257 23.72712,-14.91909 31.03748,-11.13875 4.17243,2.15765 5.21378,4.36363 5.21378,11.04481 l 0,5.56574 17.96778,0 c 17.03188,0 17.93038,-0.0957 17.25,-1.83751 C 437.823,688.15187 426.7,664.3042 413.5,636.16767 l -24,-51.15731 -1.28655,4.74482 c -8.00126,29.50886 -19.9687,53.87546 -36.2191,73.74482 -3.14877,3.85 -10.51692,11.6125 -16.37366,17.25 l -10.64863,10.25 18.01271,0 18.01271,0 5.75126,-5.4718 z m 26.97298,1.4337 c -1.34507,-10.02819 -7.15709,-11.74133 -17.31668,-5.10423 -3.24777,2.12171 -6.99598,5.04671 -8.32935,6.5 L 365.65137,691 l 14.30599,0 14.30598,0 -0.54162,-4.0381 z M 400,685.65499 c 0,-5.69274 -1.39799,-7.86153 -5.75,-8.92034 -2.73986,-0.66659 -2.74507,-0.59497 -0.25374,3.49118 1.09795,1.80079 1.99795,4.24987 2,5.44238 0.006,3.21976 1.03972,5.33179 2.61073,5.33179 C 399.62392,691 400,689.55699 400,685.65499 z M 611,665.9054 c 23.70996,-16.16489 43.15963,-41.7985 52.66181,-69.4054 7.11934,-20.684 6.72627,-10.10857 7.06206,-190 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.69998,-0.33716 -2.22983,-0.0892 -1.8613,0.8712 0.43842,1.14252 66.53774,110.37711 70.39982,116.34153 1.28943,1.99133 0.68084,2.44773 -13.9068,10.42918 -20.01731,10.95221 -43.79902,25.43651 -56.25524,34.26237 -11.18904,7.928 -26.5,22.51965 -26.5,25.25504 0,3.20524 8.00897,12.26586 18.30023,20.70321 27.14839,22.25776 34.13977,28.28618 45.4439,39.18472 20.80065,20.05431 39.98571,43.57224 51.82018,63.52355 3.2416,5.46492 6.15989,9.50572 6.48507,8.97956 0.82745,-1.33884 6.76401,-2.92082 10.94402,-2.91636 4.52968,0.005 9.77551,3.22733 10.59976,6.51143 1.60056,6.37712 -2.15591,21.49163 -6.50036,26.15485 -1.87442,2.01195 -1.85872,2.19038 1.05056,11.93623 16.98014,56.88204 5.60368,118.24101 -31.05734,167.50778 -8.39869,11.28655 -27.03435,32.25276 -30.14946,33.91992 -1.06511,0.57003 -1.93656,1.50211 -1.93656,2.07128 0,1.1968 12.93809,-5.70341 21,-11.19983 z m 39.62402,-68.44279 c -1.58202,-4.12269 6.03126,-12.57634 9.96624,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.28388,-0.20028 -3.72171,-1.34123 z m 4.97628,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 564.35796,344.95796 c -0.59791,-0.59791 0.72814,-2.74684 3.58798,-5.8145 3.37963,-3.62523 4.79366,-4.55625 5.54523,-3.65107 2.21019,2.66189 6.13722,4.50761 9.59055,4.50761 4.42676,0 11.52998,-5.77491 15.55849,-12.64903 4.7399,-8.08804 2.03481,-16.65781 -6.66064,-21.10097 -5.1781,-2.64588 -10.1871,-2.89961 -12.45576,-0.63095 -0.89048,0.89047 -1.72346,1.45297 -1.85108,1.25 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.783,290.63729 551.6666,290 546.3533,290 c -8.93136,0 -9.41609,0.11623 -12.77167,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -2.87274,-1.77545 1.86046,-12.29379 8.5362,-18.96953 14.53973,-14.53974 38.4005,-11.74594 46.44932,5.43862 1.79497,3.83233 2.77788,4.93235 3.95185,4.4227 7.40109,-3.21306 10.49145,-3.71471 15.89789,-2.5807 6.90311,1.44794 12.14105,5.02277 15.11645,10.31678 1.90362,3.38704 2.20699,5.04554 1.7438,9.53341 -1.81295,17.56583 -23.30904,30.54514 -38.44951,23.21576 l -4.38545,-2.12296 -1.48156,2.11522 c -1.99187,2.8438 -4.81678,4.29291 -6.02103,3.08866 z m 36.8143,-10.21483 C 606.18861,330.96804 611,322.37389 611,317.18872 c 0,-4.63137 -3.04687,-9.28475 -7.84504,-11.98147 -4.48385,-2.52007 -13.93092,-4.2718 -12.7522,-2.36459 0.3934,0.63654 1.34806,1.15734 2.12146,1.15734 1.96737,0 8.28742,5.73506 10.02686,9.09878 3.35106,6.48024 1.26776,15.12192 -5.34013,22.15122 -3.52389,3.74863 -1.31842,3.46643 3.96131,-0.50687 z m -33.1145,-44.66468 c -1.34323,-1.03239 -4.09544,-2.37238 -6.11602,-2.97776 C 557.35336,285.72598 546.32911,285.65846 545.5,287 c -0.3861,0.62472 1.74963,1.01643 5.69098,1.04377 3.49915,0.0243 8.53589,0.85549 11.30902,1.86632 6.71941,2.4493 8.59957,2.50626 5.55776,0.16836 z M 422,562.21637 c 20.84101,-10.02966 36.15665,-20.71554 43.50917,-30.3568 l 3.8886,-5.09906 -3.18213,-6.13026 C 460.62294,509.85612 447.6634,496.46147 426,479.06439 420.225,474.4267 411.1125,466.8652 405.75,462.26107 l -9.75,-8.37117 0,38.90983 c 0,42.77977 -1.4592,68.32675 -4.67991,81.93387 -0.57114,2.413 0.91982,1.8047 30.67991,-12.51723 z m -15.37598,-50.75376 c -1.58202,-4.12269 6.03126,-12.57634 9.96624,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.28388,-0.20028 -3.72171,-1.34123 z m 4.97628,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z M 649.5,447.16068 C 649.5,436.83867 647.78449,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.99558 0.25242,0.99517 1.25,-0.002 0.78471,-0.78443 1.25,-4.13068 1.25,-8.98978 z m -492,2.80877 c 29.15,-2.1814 53.5625,-3.96692 54.25,-3.96781 C 212.73297,446.00035 213,435.53246 213,397 l 0,-49 -3.39466,0 c -5.48938,0 -15.80118,-3.68914 -19.98449,-7.14963 -5.58696,-4.62162 -7.57238,-9.68787 -7.59889,-19.39027 -0.0587,-21.47478 11.33824,-38.76959 28.22804,-42.83609 l 2.75,-0.66211 0,-78.60595 0,-78.60595 2.75,0.52434 c 1.5125,0.28838 42.46194,4.92942 90.99875,10.31341 l 88.24875,9.78908 9.75125,-9.47826 C 410.11194,126.68552 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -11.77855,2.71919 c -20.5046,4.73367 -39.46088,13.3236 -54.58891,24.73664 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.61532 C 101.67259,454.21253 128.35,452.15085 157.5,449.96945 z M 96.624024,391.46261 c -1.582021,-4.12269 6.031256,-12.57634 9.966236,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.283879,-0.20028 -3.721706,-1.34123 z m 4.976276,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.413798,4.66777 -1.886354,7.26144 1.07462,5.28435 z m 37.04566,-145.31958 c -9.13851,-2.19826 -13.17423,-8.31687 -12.41678,-18.82525 0.82836,-11.49208 9.44278,-25.3145 18.55495,-29.77267 10.27992,-5.0295 23.39833,-1.48443 28.43001,7.68281 4.07193,7.41867 -0.58539,22.11453 -10.10609,31.88907 -7.75419,7.96094 -16.09533,11.03865 -24.46209,9.02604 z m 12.11205,-2.9806 c 2.46109,-0.85794 3.8937,-2.71669 7.35452,-9.54212 C 167.28082,214.31065 163.42005,200 149.37361,200 c -3.01011,0 -6.74564,0.65814 -8.30117,1.46254 -6.03271,3.11964 -13.07726,17.65697 -13.0687,26.96896 0.01,10.76863 11.3292,17.48582 22.75427,13.50301 z m 17.90477,-18.78687 c 1.92097,-4.00155 2.72955,-7.30374 2.7742,-11.32962 0.0553,-4.98211 -0.30651,-6.07506 -2.93698,-8.87316 -3.27331,-3.4819 -8.13528,-5.94699 -11.71788,-5.94112 -2.0919,0.003 -2.02467,0.16073 0.80658,1.88721 8.89717,5.42544 11.34262,15.54936 6.83916,28.31351 -1.2533,3.55224 -1.24734,3.89061 0.0496,2.81426 0.81079,-0.6729 2.6942,-3.76489 4.18534,-6.87108 z m 485.88825,226.38448 c 2.06038,-4.93119 1.89897,-12.83284 -0.30103,-14.7361 -1.60913,-1.39209 -6.25,-3.0699 -6.25,-2.25956 0,0.19207 0.95178,1.96237 2.11507,3.934 1.506,2.55247 2.15393,5.4486 2.25,10.05699 0.0742,3.55972 0.27039,6.47228 0.43596,6.47238 0.16556,9e-5 0.95306,-1.56038 1.75,-3.46771 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 -10.1022,8.50044 -15.57205,32.50225 -10.02051,43.97021 3.33037,6.87962 12.45241,11.60663 23.7134,12.28821 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3406"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#594e34"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 35.41289,-31.64202 c 26.8203,-13.45905 43.06425,-23.49296 60.4299,-37.3276 43.05287,-34.29881 66.20084,-72.69349 71.86685,-119.20291 1.56959,-12.884 0.61379,-36.06733 -1.99724,-48.44406 C 619.06147,468.58412 605.16193,440.61814 583.26867,413 572.0353,398.8292 544.79123,372.35105 524.95502,356.32572 493.30296,330.75456 480.92151,314.73591 480.64571,299 c -0.19524,-11.13998 9.46881,-25.42292 27.14748,-40.12246 10.63981,-8.84684 33.44403,-24.44208 47.98448,-32.8154 5.10272,-2.93847 9.52183,-5.73772 9.82023,-6.22055 C 566.42839,218.49783 497.88116,106 496.2319,106 c -0.27609,0 -5.39865,2.77902 -11.38347,6.17559 -22.04935,12.51373 -53.30481,38.31431 -73.35705,60.55437 -17.71917,19.65244 -37.41705,51.17996 -44.52835,71.27004 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.72086,22.75325 29.65057,49.84997 50.26038,68.33476 C 432.73878,442.37366 439.5965,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34696 12.33333,10.86484 29.25201,24.45593 46.12701,46.7695 48.10632,63.61031 0.75211,6.39932 -1.531,16.15973 -5.30237,22.66787 -7.3142,12.62188 -28.82294,29.53438 -53.4434,42.02297 -6.7983,3.44841 -12.53728,6.42373 -12.75329,6.61182 C 430.31376,595.30113 483.42589,707 484.54795,707 c 0.26861,0 4.87521,-2.20141 10.23687,-4.89202 z m -254.192,-11.15587 c 29.40566,-2.99413 59.69281,-19.34902 81.03122,-43.7564 23.72793,-27.14058 37.31847,-60.56984 41.31298,-101.61939 C 363.55044,539.27259 364,510.02367 364,476.41839 l 0,-58.23425 -6.46657,-9.67195 C 344.1226,388.4538 332.74068,362.2541 328.15029,340.87598 c -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 2.98692,-4.42323 3.70502,-6.40988 3.70502,-10.25 0,-2.61984 -0.3375,-4.76357 -0.75,-4.76383 -0.4125,-2.6e-4 -26.04094,-2.92526 -56.95209,-6.5 C 275.38677,160.92478 249.39927,158 248.54791,158 247.15625,158 247,176.75267 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -1.82036,15.09248 -6.66003,28.09401 -13.67576,36.73929 -4.93952,6.08681 -8.36742,7.59059 -17.48096,7.66868 -7.20388,0.0617 -7.87457,-0.11974 -10.8445,-2.9342 C 193.42457,569.50021 188,543.27366 188,502.25613 c 0,-16.33839 -0.2892,-21.25607 -1.25,-21.25585 -1.08344,2.4e-4 -80.45147,6.13452 -101.918642,7.87719 -4.217754,0.34239 -7.952282,0.90706 -8.298952,1.25481 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 126.15592,-5.42391 c 10.80775,-10.28257 23.72712,-14.91909 31.03748,-11.13875 4.17243,2.15765 5.21378,4.36363 5.21378,11.04481 l 0,5.56574 18.05902,0 c 9.93246,0 17.88783,-0.3375 17.67859,-0.75 -0.20923,-0.4125 -11.37328,-24.25365 -24.80901,-52.98032 L 389.5,585.03935 l -1.28655,4.73033 c -8.04913,29.59471 -19.97102,53.8638 -36.2191,73.73032 -3.14877,3.85 -10.51692,11.6125 -16.37366,17.25 l -10.64863,10.25 18.01271,0 18.01271,0 5.75126,-5.4718 z m 26.97298,1.4337 c -1.34507,-10.02819 -7.15709,-11.74133 -17.31668,-5.10423 -3.24777,2.12171 -6.99598,5.04671 -8.32935,6.5 L 365.65137,691 l 14.30599,0 14.30598,0 -0.54162,-4.0381 z M 400,685.65499 c 0,-5.69274 -1.39799,-7.86153 -5.75,-8.92034 -2.73986,-0.66659 -2.74507,-0.59497 -0.25374,3.49118 1.09795,1.80079 1.99795,4.24987 2,5.44238 0.006,3.21976 1.03972,5.33179 2.61073,5.33179 1.01693,0 1.39301,-1.44301 1.39301,-5.34501 z m 197.87689,-11.82741 c 19.88191,-10.88212 38.1869,-27.37497 48.84722,-44.01148 2.07674,-3.24097 5.1495,-8.01294 6.82836,-10.60439 4.09065,-6.31421 5.7433,-10.01081 9.97171,-22.30446 7.27874,-21.16214 6.86326,-10.17408 7.19969,-190.40725 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.6672,-0.33066 -2.22743,-0.0831 -1.87707,0.82946 0.44378,1.15593 67.01208,111.20305 70.39622,116.37525 1.28917,1.97032 0.86789,2.34211 -8.39269,7.40693 -30.28231,16.56208 -51.81877,29.79608 -66.7409,41.01179 C 526.49633,285.51893 515,297.11866 515,299.69572 c 0,3.12942 7.83929,11.95704 18.06382,20.34119 27.47046,22.52589 34.35287,28.45907 45.68031,39.38008 20.7877,20.04183 39.64895,43.16772 51.73528,63.43295 3.28867,5.51415 6.24531,9.59547 6.57031,9.06962 0.82715,-1.33837 6.76437,-2.92028 10.94368,-2.91582 4.52968,0.005 9.77551,3.22733 10.59976,6.51143 1.60056,6.37712 -2.15591,21.49163 -6.50036,26.15485 -1.87442,2.01195 -1.85872,2.19038 1.05056,11.93623 6.42487,21.52276 9.01508,47.45078 6.93243,69.39375 -4.43988,46.77913 -24.22342,87.33675 -60.91976,124.88968 C 593.72219,673.45035 589.49625,678 589.76506,678 c 0.2688,0 3.91912,-1.87759 8.11183,-4.17242 z m 52.74713,-76.36497 c -1.58202,-4.12269 6.03126,-12.57634 9.96624,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.28388,-0.20028 -3.72171,-1.34123 z m 4.97628,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 564.35796,344.95796 c -0.59791,-0.59791 0.72814,-2.74684 3.58798,-5.8145 3.37963,-3.62523 4.79366,-4.55625 5.54523,-3.65107 2.21019,2.66189 6.13722,4.50761 9.59055,4.50761 4.42676,0 11.52998,-5.77491 15.55849,-12.64903 4.7399,-8.08804 2.03481,-16.65781 -6.66064,-21.10097 -5.1781,-2.64588 -10.1871,-2.89961 -12.45576,-0.63095 -0.89048,0.89047 -1.72346,1.45297 -1.85108,1.25 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.783,290.63729 551.6666,290 546.3533,290 c -8.93136,0 -9.41609,0.11623 -12.77167,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -2.87274,-1.77545 1.86046,-12.29379 8.5362,-18.96953 14.53973,-14.53974 38.4005,-11.74594 46.44932,5.43862 1.79497,3.83233 2.77788,4.93235 3.95185,4.4227 7.40109,-3.21306 10.49145,-3.71471 15.89789,-2.5807 6.90311,1.44794 12.14105,5.02277 15.11645,10.31678 1.90362,3.38704 2.20699,5.04554 1.7438,9.53341 -1.81295,17.56583 -23.30904,30.54514 -38.44951,23.21576 l -4.38545,-2.12296 -1.48156,2.11522 c -1.99187,2.8438 -4.81678,4.29291 -6.02103,3.08866 z m 36.8143,-10.21483 C 606.18861,330.96804 611,322.37389 611,317.18872 c 0,-4.63137 -3.04687,-9.28475 -7.84504,-11.98147 -4.48385,-2.52007 -13.93092,-4.2718 -12.7522,-2.36459 0.3934,0.63654 1.34806,1.15734 2.12146,1.15734 1.96737,0 8.28742,5.73506 10.02686,9.09878 3.35106,6.48024 1.26776,15.12192 -5.34013,22.15122 -3.52389,3.74863 -1.31842,3.46643 3.96131,-0.50687 z m -33.1145,-44.66468 c -1.34323,-1.03239 -4.09544,-2.37238 -6.11602,-2.97776 C 557.35336,285.72598 546.32911,285.65846 545.5,287 c -0.3861,0.62472 1.74963,1.01643 5.69098,1.04377 3.49915,0.0243 8.53589,0.85549 11.30902,1.86632 6.71941,2.4493 8.59957,2.50626 5.55776,0.16836 z M 421,562.71212 c 21.86089,-10.54968 37.03952,-21.0577 44.4457,-30.76932 l 3.82512,-5.01583 -1.88541,-4.18918 c -4.76666,-10.59103 -18.2405,-24.97815 -39.29801,-41.96171 -6.92307,-5.58368 -16.9749,-13.9173 -22.3374,-18.51916 l -9.75,-8.36702 0,38.90983 c 0,42.78921 -1.45928,68.32945 -4.68184,81.94158 -0.58232,2.45972 0.91874,1.85138 29.68184,-12.02919 z m -14.37598,-51.24951 c -1.58202,-4.12269 6.03126,-12.57634 9.96624,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.28388,-0.20028 -3.72171,-1.34123 z m 4.97628,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z M 649.5,447.16068 C 649.5,436.83867 647.78449,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,11.01387 4.93043,11.7 0,0.99558 0.25242,0.99517 1.25,-0.002 0.78471,-0.78443 1.25,-4.13068 1.25,-8.98978 z m -492.05653,2.81568 C 186.56238,447.78936 210.97488,446 211.69347,446 212.75107,446 213,436.66407 213,397 l 0,-49 -3.39466,0 c -5.48938,0 -15.80118,-3.68914 -19.98449,-7.14963 -5.58696,-4.62162 -7.57238,-9.68787 -7.59889,-19.39027 -0.0587,-21.47478 11.33824,-38.76959 28.22804,-42.83609 l 2.75,-0.66211 0,-78.60595 0,-78.60595 2.75,0.53474 c 1.5125,0.2941 42.4657,4.93145 91.0071,10.3052 l 88.25711,9.77047 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -11.77855,2.71919 c -20.5046,4.73367 -39.46088,13.3236 -54.58891,24.73664 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.60677 c 3.455719,-0.33373 30.107689,-2.39615 59.226599,-4.58315 z M 96.624024,391.46261 c -1.582021,-4.12269 6.031256,-12.57634 9.966236,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.283879,-0.20028 -3.721706,-1.34123 z m 4.976276,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.413798,4.66777 -1.886354,7.26144 1.07462,5.28435 z m 37.04566,-145.31958 c -9.13851,-2.19826 -13.17423,-8.31687 -12.41678,-18.82525 0.82836,-11.49208 9.44278,-25.3145 18.55495,-29.77267 10.27992,-5.0295 23.39833,-1.48443 28.43001,7.68281 4.07193,7.41867 -0.58539,22.11453 -10.10609,31.88907 -7.75419,7.96094 -16.09533,11.03865 -24.46209,9.02604 z m 12.11205,-2.9806 c 2.46109,-0.85794 3.8937,-2.71669 7.35452,-9.54212 C 167.28082,214.31065 163.42005,200 149.37361,200 c -3.01011,0 -6.74564,0.65814 -8.30117,1.46254 -6.03271,3.11964 -13.07726,17.65697 -13.0687,26.96896 0.01,10.76863 11.3292,17.48582 22.75427,13.50301 z m 17.90477,-18.78687 c 1.92097,-4.00155 2.72955,-7.30374 2.7742,-11.32962 0.0553,-4.98211 -0.30651,-6.07506 -2.93698,-8.87316 -3.27331,-3.4819 -8.13528,-5.94699 -11.71788,-5.94112 -2.0919,0.003 -2.02467,0.16073 0.80658,1.88721 8.89717,5.42544 11.34262,15.54936 6.83916,28.31351 -1.2533,3.55224 -1.24734,3.89061 0.0496,2.81426 0.81079,-0.6729 2.6942,-3.76489 4.18534,-6.87108 z m 485.88825,226.38448 c 2.06038,-4.93119 1.89897,-12.83284 -0.30103,-14.7361 -1.60913,-1.39209 -6.25,-3.0699 -6.25,-2.25956 0,0.19207 0.95178,1.96237 2.11507,3.934 1.506,2.55247 2.15393,5.4486 2.25,10.05699 0.0742,3.55972 0.27039,6.47228 0.43596,6.47238 0.16556,9e-5 0.95306,-1.56038 1.75,-3.46771 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 -10.1022,8.50044 -15.57205,32.50225 -10.02051,43.97021 3.33037,6.87962 12.45241,11.60663 23.7134,12.28821 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3404"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#4e503b"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 35.41289,-31.64202 c 26.8203,-13.45905 43.06425,-23.49296 60.4299,-37.3276 43.05287,-34.29881 66.20084,-72.69349 71.86685,-119.20291 1.56959,-12.884 0.61379,-36.06733 -1.99724,-48.44406 C 619.06147,468.58412 605.16193,440.61814 583.26867,413 572.0353,398.8292 544.79123,372.35105 524.95502,356.32572 493.30296,330.75456 480.92151,314.73591 480.64571,299 c -0.19524,-11.13998 9.46881,-25.42292 27.14748,-40.12246 10.63981,-8.84684 33.44403,-24.44208 47.98448,-32.8154 5.10272,-2.93847 9.52183,-5.73772 9.82023,-6.22055 C 566.42839,218.49783 497.88116,106 496.2319,106 c -0.27609,0 -5.39865,2.77902 -11.38347,6.17559 -22.04935,12.51373 -53.30481,38.31431 -73.35705,60.55437 -17.71917,19.65244 -37.41705,51.17996 -44.52835,71.27004 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.72086,22.75325 29.65057,49.84997 50.26038,68.33476 C 432.73878,442.37366 439.5965,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34696 12.33333,10.86484 29.25201,24.45593 46.12701,46.7695 48.10632,63.61031 0.75211,6.39932 -1.531,16.15973 -5.30237,22.66787 -7.3142,12.62188 -28.82294,29.53438 -53.4434,42.02297 -6.7983,3.44841 -12.53728,6.42373 -12.75329,6.61182 C 430.31376,595.30113 483.42589,707 484.54795,707 c 0.26861,0 4.87521,-2.20141 10.23687,-4.89202 z m -254.192,-11.15587 c 29.40566,-2.99413 59.69281,-19.34902 81.03122,-43.7564 23.72793,-27.14058 37.31847,-60.56984 41.31298,-101.61939 C 363.55044,539.27259 364,510.02367 364,476.41839 l 0,-58.23425 -6.46657,-9.67195 C 344.1226,388.4538 332.74068,362.2541 328.15029,340.87598 c -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 2.98692,-4.42323 3.70502,-6.40988 3.70502,-10.25 0,-2.61984 -0.3375,-4.76357 -0.75,-4.76383 -0.4125,-2.6e-4 -26.04094,-2.92526 -56.95209,-6.5 C 275.38677,160.92478 249.39927,158 248.54791,158 247.15625,158 247,176.75267 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -1.82036,15.09248 -6.66003,28.09401 -13.67576,36.73929 -4.93952,6.08681 -8.36742,7.59059 -17.48096,7.66868 -7.20388,0.0617 -7.87457,-0.11974 -10.8445,-2.9342 C 193.42457,569.50021 188,543.27366 188,502.25613 c 0,-16.33839 -0.2892,-21.25607 -1.25,-21.25585 -1.08344,2.4e-4 -80.45147,6.13452 -101.918642,7.87719 -4.217754,0.34239 -7.952282,0.90706 -8.298952,1.25481 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 126.15592,-5.42391 c 10.80775,-10.28257 23.72712,-14.91909 31.03748,-11.13875 4.17243,2.15765 5.21378,4.36363 5.21378,11.04481 l 0,5.56574 18.05902,0 c 9.93246,0 17.88783,-0.3375 17.67859,-0.75 -0.20923,-0.4125 -11.37328,-24.25365 -24.80901,-52.98032 L 389.5,585.03935 l -1.28655,4.73033 c -8.04913,29.59471 -19.97102,53.8638 -36.2191,73.73032 -3.14877,3.85 -10.51692,11.6125 -16.37366,17.25 l -10.64863,10.25 18.01271,0 18.01271,0 5.75126,-5.4718 z m 26.97298,1.4337 c -1.34507,-10.02819 -7.15709,-11.74133 -17.31668,-5.10423 -3.24777,2.12171 -6.99598,5.04671 -8.32935,6.5 L 365.65137,691 l 14.30599,0 14.30598,0 -0.54162,-4.0381 z M 400,685.65499 c 0,-5.69274 -1.39799,-7.86153 -5.75,-8.92034 -2.73986,-0.66659 -2.74507,-0.59497 -0.25374,3.49118 1.09795,1.80079 1.99795,4.24987 2,5.44238 0.006,3.21976 1.03972,5.33179 2.61073,5.33179 1.01693,0 1.39301,-1.44301 1.39301,-5.34501 z m 197.87689,-11.82741 c 19.88191,-10.88212 38.1869,-27.37497 48.84722,-44.01148 2.07674,-3.24097 5.1495,-8.01294 6.82836,-10.60439 4.09065,-6.31421 5.7433,-10.01081 9.97171,-22.30446 7.27874,-21.16214 6.86326,-10.17408 7.19969,-190.40725 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.6672,-0.33066 -2.22743,-0.0831 -1.87707,0.82946 0.44378,1.15593 67.01208,111.20305 70.39622,116.37525 1.28917,1.97032 0.86789,2.34211 -8.39269,7.40693 -30.28231,16.56208 -51.81877,29.79608 -66.7409,41.01179 C 526.49633,285.51893 515,297.11866 515,299.69572 c 0,3.12942 7.83929,11.95704 18.06382,20.34119 27.47046,22.52589 34.35287,28.45907 45.68031,39.38008 20.7877,20.04183 39.64895,43.16772 51.73528,63.43295 3.28867,5.51415 6.24531,9.59547 6.57031,9.06962 0.82715,-1.33837 6.76437,-2.92028 10.94368,-2.91582 4.52968,0.005 9.77551,3.22733 10.59976,6.51143 1.60056,6.37712 -2.15591,21.49163 -6.50036,26.15485 -1.87442,2.01195 -1.85872,2.19038 1.05056,11.93623 6.42487,21.52276 9.01508,47.45078 6.93243,69.39375 -4.43988,46.77913 -24.22342,87.33675 -60.91976,124.88968 C 593.72219,673.45035 589.49625,678 589.76506,678 c 0.2688,0 3.91912,-1.87759 8.11183,-4.17242 z m 52.74713,-76.36497 c -1.58202,-4.12269 6.03126,-12.57634 9.96624,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.28388,-0.20028 -3.72171,-1.34123 z m 4.97628,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 564.35796,344.95796 c -0.59791,-0.59791 0.7314,-2.75763 3.5968,-5.8437 3.4403,-3.70523 4.73965,-4.55723 5.34494,-3.50474 1.02601,1.78403 5.31606,3.93693 9.38457,4.70952 2.77292,0.52656 3.84201,0.0133 8.27569,-3.97295 7.35974,-6.61704 10.4225,-12.26053 9.7744,-18.01046 -0.64931,-5.76068 -3.16028,-9.22697 -8.75479,-12.08563 -5.1781,-2.64588 -10.1871,-2.89961 -12.45576,-0.63095 -0.89048,0.89047 -1.72346,1.45297 -1.85108,1.25 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.783,290.63729 551.6666,290 546.3533,290 c -8.93136,0 -9.41609,0.11623 -12.77167,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -2.87274,-1.77545 1.86046,-12.29379 8.5362,-18.96953 14.53973,-14.53974 38.4005,-11.74594 46.44932,5.43862 1.79497,3.83233 2.77788,4.93235 3.95185,4.4227 7.40109,-3.21306 10.49145,-3.71471 15.89789,-2.5807 6.90311,1.44794 12.14105,5.02277 15.11645,10.31678 1.90362,3.38704 2.20699,5.04554 1.7438,9.53341 -1.81295,17.56583 -23.30904,30.54514 -38.44951,23.21576 l -4.38545,-2.12296 -1.48156,2.11522 c -1.99187,2.8438 -4.81678,4.29291 -6.02103,3.08866 z m 36.8143,-10.21483 C 606.18861,330.96804 611,322.37389 611,317.18872 c 0,-4.63137 -3.04687,-9.28475 -7.84504,-11.98147 -4.48385,-2.52007 -13.93092,-4.2718 -12.7522,-2.36459 0.3934,0.63654 1.34806,1.15734 2.12146,1.15734 1.96737,0 8.28742,5.73506 10.02686,9.09878 3.35106,6.48024 1.26776,15.12192 -5.34013,22.15122 -3.52389,3.74863 -1.31842,3.46643 3.96131,-0.50687 z m -33.1145,-44.66468 c -1.34323,-1.03239 -4.09544,-2.37238 -6.11602,-2.97776 C 557.35336,285.72598 546.32911,285.65846 545.5,287 c -0.3861,0.62472 1.74963,1.01643 5.69098,1.04377 3.49915,0.0243 8.53589,0.85549 11.30902,1.86632 6.71941,2.4493 8.59957,2.50626 5.55776,0.16836 z M 421,562.71212 c 21.86089,-10.54968 37.03952,-21.0577 44.4457,-30.76932 l 3.82512,-5.01583 -1.88541,-4.18918 c -4.76666,-10.59103 -18.2405,-24.97815 -39.29801,-41.96171 -6.92307,-5.58368 -16.9749,-13.9173 -22.3374,-18.51916 l -9.75,-8.36702 0,38.90983 c 0,42.78921 -1.45928,68.32945 -4.68184,81.94158 -0.58232,2.45972 0.91874,1.85138 29.68184,-12.02919 z m -14.37598,-51.24951 c -1.58202,-4.12269 6.03126,-12.57634 9.96624,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.28388,-0.20028 -3.72171,-1.34123 z m 4.97628,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.43963,-6.88785 c 0.90701,-6.0484 0.0735,-12.81878 -1.96029,-15.92272 C 646.25403,434.45807 645.15098,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.92387 4.93043,11.5 0,0.57612 0.42243,1.0475 0.93873,1.0475 0.5163,0 1.24663,-2.05328 1.62297,-4.56285 z M 157.44347,449.97636 C 186.56238,447.78936 210.97488,446 211.69347,446 212.75107,446 213,436.66407 213,397 l 0,-49 -3.39466,0 c -5.48938,0 -15.80118,-3.68914 -19.98449,-7.14963 -5.58696,-4.62162 -7.57238,-9.68787 -7.59889,-19.39027 -0.0587,-21.47478 11.33824,-38.76959 28.22804,-42.83609 l 2.75,-0.66211 0,-78.60595 0,-78.60595 2.75,0.53474 c 1.5125,0.2941 42.4657,4.93145 91.0071,10.3052 l 88.25711,9.77047 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -11.77855,2.71919 c -20.5046,4.73367 -39.46088,13.3236 -54.58891,24.73664 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.60677 c 3.455719,-0.33373 30.107689,-2.39615 59.226599,-4.58315 z M 96.624024,391.46261 c -1.582021,-4.12269 6.031256,-12.57634 9.966236,-11.06635 4.13158,1.58544 -1.05842,11.8977 -6.24453,12.40758 -2.14341,0.21073 -3.283879,-0.20028 -3.721706,-1.34123 z m 4.976276,-1.22792 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.413798,4.66777 -1.886354,7.26144 1.07462,5.28435 z m 37.04566,-145.31958 c -9.13851,-2.19826 -13.17423,-8.31687 -12.41678,-18.82525 0.82836,-11.49208 9.44278,-25.3145 18.55495,-29.77267 10.27992,-5.0295 23.39833,-1.48443 28.43001,7.68281 4.07193,7.41867 -0.58539,22.11453 -10.10609,31.88907 -7.75419,7.96094 -16.09533,11.03865 -24.46209,9.02604 z m 12.11205,-2.9806 c 4.60153,-1.6041 11.49875,-15.60316 12.06442,-24.48673 0.48001,-7.53844 -0.82875,-11.43387 -5.02886,-14.96803 C 155.31012,200.39007 153.81181,200 148.26844,200 c -6.35462,0 -6.70519,0.13358 -10.31844,3.9319 -2.05718,2.16254 -5.00976,6.55004 -6.56129,9.75 -2.32889,4.80323 -2.82687,7.15804 -2.85483,13.49976 -0.0317,7.18535 0.15995,7.88662 2.96612,10.8539 1.65,1.74473 3.9,3.54696 5,4.00495 2.87423,1.19671 10.6877,1.13862 14.25801,-0.106 z m 17.90477,-18.78687 c 1.92097,-4.00155 2.72955,-7.30374 2.7742,-11.32962 0.0553,-4.98211 -0.30651,-6.07506 -2.93698,-8.87316 -3.27331,-3.4819 -8.13528,-5.94699 -11.71788,-5.94112 -2.0919,0.003 -2.02467,0.16073 0.80658,1.88721 8.89717,5.42544 11.34262,15.54936 6.83916,28.31351 -1.2533,3.55224 -1.24734,3.89061 0.0496,2.81426 0.81079,-0.6729 2.6942,-3.76489 4.18534,-6.87108 z m 485.88825,226.38448 c 2.06038,-4.93119 1.89897,-12.83284 -0.30103,-14.7361 -1.60913,-1.39209 -6.25,-3.0699 -6.25,-2.25956 0,0.19207 0.95178,1.96237 2.11507,3.934 1.506,2.55247 2.15393,5.4486 2.25,10.05699 0.0742,3.55972 0.27039,6.47228 0.43596,6.47238 0.16556,9e-5 0.95306,-1.56038 1.75,-3.46771 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 C 189.92376,294.60772 185,307.53996 185,320.27337 c 0,9.79503 2.38706,15.63407 7.87115,19.25378 3.82148,2.52233 12.73618,5.29593 17.37885,5.40704 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3402"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#615020"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 35.41289,-31.64202 c 26.8203,-13.45905 43.06425,-23.49296 60.4299,-37.3276 43.05287,-34.29881 66.20084,-72.69349 71.86685,-119.20291 1.56959,-12.884 0.61379,-36.06733 -1.99724,-48.44406 C 619.06147,468.58412 605.16193,440.61814 583.26867,413 572.0353,398.8292 544.79123,372.35105 524.95502,356.32572 493.30296,330.75456 480.92151,314.73591 480.64571,299 c -0.19524,-11.13998 9.46881,-25.42292 27.14748,-40.12246 10.63981,-8.84684 33.44403,-24.44208 47.98448,-32.8154 5.10272,-2.93847 9.52183,-5.73772 9.82023,-6.22055 C 566.42839,218.49783 497.88116,106 496.2319,106 c -0.27609,0 -5.39865,2.77902 -11.38347,6.17559 -22.04935,12.51373 -53.30481,38.31431 -73.35705,60.55437 -17.71917,19.65244 -37.41705,51.17996 -44.52835,71.27004 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.72086,22.75325 29.65057,49.84997 50.26038,68.33476 C 432.73878,442.37366 439.5965,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34696 12.33333,10.86484 29.25201,24.45593 46.12701,46.7695 48.10632,63.61031 0.75211,6.39932 -1.531,16.15973 -5.30237,22.66787 -7.3142,12.62188 -28.82294,29.53438 -53.4434,42.02297 -6.7983,3.44841 -12.53728,6.42373 -12.75329,6.61182 C 430.31376,595.30113 483.42589,707 484.54795,707 c 0.26861,0 4.87521,-2.20141 10.23687,-4.89202 z m -254.192,-11.15587 c 29.40566,-2.99413 59.69281,-19.34902 81.03122,-43.7564 23.72793,-27.14058 37.31847,-60.56984 41.31298,-101.61939 C 363.55044,539.27259 364,510.02367 364,476.41839 l 0,-58.23425 -6.46657,-9.67195 C 344.1226,388.4538 332.74068,362.2541 328.15029,340.87598 c -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 2.98692,-4.42323 3.70502,-6.40988 3.70502,-10.25 0,-2.61984 -0.3375,-4.76357 -0.75,-4.76383 -0.4125,-2.6e-4 -26.04094,-2.92526 -56.95209,-6.5 C 275.38677,160.92478 249.39927,158 248.54791,158 247.15625,158 247,176.75267 247,343.77623 c 0,120.32909 -0.36006,188.76146 -1.02205,194.25 -1.82036,15.09248 -6.66003,28.09401 -13.67576,36.73929 -4.93952,6.08681 -8.36742,7.59059 -17.48096,7.66868 -7.20388,0.0617 -7.87457,-0.11974 -10.8445,-2.9342 C 193.42457,569.50021 188,543.27366 188,502.25613 c 0,-16.33839 -0.2892,-21.25607 -1.25,-21.25585 -1.08344,2.4e-4 -80.45147,6.13452 -101.918642,7.87719 -4.217754,0.34239 -7.952282,0.90706 -8.298952,1.25481 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 127.21723,-6.09327 c 10.5286,-9.84898 22.86011,-14.14925 29.9947,-10.45981 4.15348,2.14785 5.19525,4.36067 5.19525,11.03523 l 0,5.56574 18.05902,0 c 9.93246,0 17.88783,-0.3375 17.67859,-0.75 -0.20923,-0.4125 -11.37328,-24.25365 -24.80901,-52.98032 L 389.5,585.03935 l -1.28655,4.73033 c -8.04913,29.59471 -19.97102,53.8638 -36.2191,73.73032 -3.14877,3.85 -10.51692,11.6125 -16.37366,17.25 l -10.64863,10.25 18.13654,0 18.13654,0 6.56491,-6.14116 z m 25.91167,2.10306 c -1.34507,-10.02819 -7.15709,-11.74133 -17.31668,-5.10423 -3.24777,2.12171 -6.99598,5.04671 -8.32935,6.5 L 365.65137,691 l 14.30599,0 14.30598,0 -0.54162,-4.0381 z M 400,685.65499 c 0,-5.69274 -1.39799,-7.86153 -5.75,-8.92034 -2.73986,-0.66659 -2.74507,-0.59497 -0.25374,3.49118 1.09795,1.80079 1.99795,4.24987 2,5.44238 0.006,3.21976 1.03972,5.33179 2.61073,5.33179 1.01693,0 1.39301,-1.44301 1.39301,-5.34501 z m 197.87689,-11.82741 c 19.88191,-10.88212 38.1869,-27.37497 48.84722,-44.01148 2.07674,-3.24097 5.1495,-8.01294 6.82836,-10.60439 4.09065,-6.31421 5.7433,-10.01081 9.97171,-22.30446 7.27874,-21.16214 6.86326,-10.17408 7.19969,-190.40725 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.6672,-0.33066 -2.22743,-0.0831 -1.87707,0.82946 0.44378,1.15593 67.01208,111.20305 70.39622,116.37525 1.28917,1.97032 0.86789,2.34211 -8.39269,7.40693 -30.28231,16.56208 -51.81877,29.79608 -66.7409,41.01179 C 526.49633,285.51893 515,297.11866 515,299.69572 c 0,3.12942 7.83929,11.95704 18.06382,20.34119 27.47046,22.52589 34.35287,28.45907 45.68031,39.38008 20.7877,20.04183 39.64895,43.16772 51.73528,63.43295 3.28867,5.51415 6.21367,9.67741 6.5,9.25169 0.89208,-1.32636 7.15036,-3.10181 10.91981,-3.09789 4.61298,0.005 9.86323,3.20161 10.69394,6.51143 1.60056,6.37712 -2.15591,21.49163 -6.50036,26.15485 -1.87442,2.01195 -1.85872,2.19038 1.05056,11.93623 6.42487,21.52276 9.01508,47.45078 6.93243,69.39375 -4.43988,46.77913 -24.22342,87.33675 -60.91976,124.88968 C 593.72219,673.45035 589.49625,678 589.76506,678 c 0.2688,0 3.91912,-1.87759 8.11183,-4.17242 z M 651,596.02818 c 0,-3.98995 2.33659,-7.51074 5.98839,-9.02337 3.46347,-1.43462 5.01161,-0.69128 5.01161,2.40632 0,4.01614 -4.16652,9.05018 -7.78192,9.40223 C 651.21894,599.1054 651,598.91591 651,596.02818 z m 4.6003,0.20651 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 564.33952,344.93952 c -0.57333,-0.57333 0.81318,-2.80741 3.61524,-5.82526 3.4403,-3.70523 4.73965,-4.55723 5.34494,-3.50474 1.02601,1.78403 5.31606,3.93693 9.38457,4.70952 2.77292,0.52656 3.84201,0.0133 8.27569,-3.97295 7.35974,-6.61704 10.4225,-12.26053 9.7744,-18.01046 -0.64931,-5.76068 -3.16028,-9.22697 -8.75479,-12.08563 -5.1781,-2.64588 -10.1871,-2.89961 -12.45576,-0.63095 -0.89048,0.89047 -1.72346,1.45297 -1.85108,1.25 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.783,290.63729 551.6666,290 546.3533,290 c -8.93136,0 -9.41609,0.11623 -12.77167,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -2.87274,-1.77545 1.86046,-12.29379 8.5362,-18.96953 14.53973,-14.53974 38.4005,-11.74594 46.44932,5.43862 1.79055,3.8229 2.78077,4.93326 3.95185,4.4313 9.58051,-4.10646 15.18309,-4.05502 23.06263,0.21173 12.6922,6.8728 12.93755,23.33342 0.51042,34.24459 -5.47891,4.81054 -11.32802,7.35895 -18.14648,7.90627 -5.07796,0.40761 -7.04421,0.0861 -10.90556,-1.78313 -4.09939,-1.98448 -4.82107,-2.08314 -5.56136,-0.76031 -1.35254,2.41684 -5.505,4.77248 -6.5575,3.71998 z m 36.83274,-10.19639 C 606.18861,330.96804 611,322.37389 611,317.18872 c 0,-4.63137 -3.04687,-9.28475 -7.84504,-11.98147 -4.48385,-2.52007 -13.93092,-4.2718 -12.7522,-2.36459 0.3934,0.63654 1.34806,1.15734 2.12146,1.15734 1.96737,0 8.28742,5.73506 10.02686,9.09878 3.35106,6.48024 1.26776,15.12192 -5.34013,22.15122 -3.52389,3.74863 -1.31842,3.46643 3.96131,-0.50687 z M 568.04282,290.0323 C 564.51966,287.37477 559.11582,286 552.193,286 c -8.88756,0 -8.45199,1.66761 0.57669,2.2079 4.69873,0.28118 9.49507,1.25397 12.23031,2.48056 5.16813,2.31759 6.58122,2.01286 3.04282,-0.65616 z M 421,562.71212 c 21.86089,-10.54968 37.03952,-21.0577 44.4457,-30.76932 l 3.82512,-5.01583 -1.88541,-4.18918 c -4.76666,-10.59103 -18.2405,-24.97815 -39.29801,-41.96171 -6.92307,-5.58368 -16.9749,-13.9173 -22.3374,-18.51916 l -9.75,-8.36702 0,38.90983 c 0,42.78921 -1.45928,68.32945 -4.68184,81.94158 -0.58232,2.45972 0.91874,1.85138 29.68184,-12.02919 z m -14,-52.68394 c 0,-3.98995 2.33659,-7.51074 5.98839,-9.02337 3.46347,-1.43462 5.01161,-0.69128 5.01161,2.40632 0,4.01614 -4.16652,9.05018 -7.78192,9.40223 C 407.21894,513.1054 407,512.91591 407,510.02818 z m 4.6003,0.20651 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.43963,-6.88785 c 0.90701,-6.0484 0.0735,-12.81878 -1.96029,-15.92272 C 646.25403,434.45807 645.15098,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.92387 4.93043,11.5 0,0.57612 0.42243,1.0475 0.93873,1.0475 0.5163,0 1.24663,-2.05328 1.62297,-4.56285 z M 157.44347,449.97636 C 186.56238,447.78936 210.97488,446 211.69347,446 212.75102,446 213,436.68842 213,397.13768 l 0,-48.86232 -5.2672,-0.61905 c -11.73492,-1.37921 -20.39205,-6.49417 -23.83999,-14.08557 -2.33826,-5.1482 -2.51274,-17.77047 -0.3599,-26.03578 3.82113,-14.6703 14.19503,-25.89605 26.71709,-28.91095 l 2.75,-0.66211 0,-78.60595 0,-78.60595 2.75,0.53474 c 1.5125,0.2941 42.4657,4.93145 91.0071,10.3052 l 88.25711,9.77047 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -11.77855,2.71919 c -20.5046,4.73367 -39.46088,13.3236 -54.58891,24.73664 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643088,8.2392 -1.818238,18.15178 -2.125858,120.31212 l -0.33524,111.33314 6.283129,-0.60677 c 3.455719,-0.33373 30.107689,-2.39615 59.226599,-4.58315 z M 97,390.02818 c 0,-3.98995 2.336588,-7.51074 5.98839,-9.02337 3.46347,-1.43462 5.01161,-0.69128 5.01161,2.40632 0,4.01614 -4.16652,9.05018 -7.78192,9.40223 C 97.218939,393.1054 97,392.91591 97,390.02818 z m 4.6003,0.20651 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.413798,4.66777 -1.886354,7.26144 1.07462,5.28435 z m 37.1331,-145.33846 c -5.41089,-1.25249 -8.55673,-3.62961 -10.91135,-8.24503 -5.74409,-11.25936 3.64955,-33.59072 16.93301,-40.25457 4.35152,-2.18301 6.24283,-2.56183 11,-2.20328 17.01754,1.28264 23.4744,13.74181 15.5079,29.92407 -3.68888,7.49318 -11.21142,15.81034 -16.86444,18.64588 -4.89814,2.45689 -10.79624,3.25996 -15.66512,2.13293 z m 12.02461,-2.96172 c 4.60153,-1.6041 11.49875,-15.60316 12.06442,-24.48673 0.48001,-7.53844 -0.82875,-11.43387 -5.02886,-14.96803 C 155.31012,200.39007 153.81181,200 148.26844,200 c -6.35462,0 -6.70519,0.13358 -10.31844,3.9319 -2.05718,2.16254 -5.00976,6.55004 -6.56129,9.75 -2.32889,4.80323 -2.82687,7.15804 -2.85483,13.49976 -0.0317,7.18535 0.15995,7.88662 2.96612,10.8539 1.65,1.74473 3.9,3.54696 5,4.00495 2.87423,1.19671 10.6877,1.13862 14.25801,-0.106 z m 17.90477,-18.78687 c 1.92097,-4.00155 2.72955,-7.30374 2.7742,-11.32962 0.0553,-4.98211 -0.30651,-6.07506 -2.93698,-8.87316 C 165.26262,199.50117 160.37554,197 156.88424,197 c -1.88991,0 -1.73101,0.30258 1.19408,2.2738 8.96724,6.04302 10.89581,16.88818 5.37504,30.2262 -1.90737,4.60816 2.56693,-0.8478 5.20942,-6.35236 z m 485.88825,226.38448 c 2.06038,-4.93119 1.89897,-12.83284 -0.30103,-14.7361 -1.60913,-1.39209 -6.25,-3.0699 -6.25,-2.25956 0,0.19207 0.95178,1.96237 2.11507,3.934 1.506,2.55247 2.15393,5.4486 2.25,10.05699 0.0742,3.55972 0.27039,6.47228 0.43596,6.47238 0.16556,9e-5 0.95306,-1.56038 1.75,-3.46771 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 C 189.92376,294.60772 185,307.53996 185,320.27337 c 0,9.79503 2.38706,15.63407 7.87115,19.25378 3.82148,2.52233 12.73618,5.29593 17.37885,5.40704 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3400"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#524b34"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 44.51286,-36.3468 C 588.08936,653.99277 630.72462,593.26317 627.67441,521.07747 626.12683,484.4528 612.78165,451.0453 585.74205,416.10662 573.81088,400.68999 545.55729,372.88614 524.95502,356.28717 493.2107,330.71122 480.92295,314.7334 480.74281,298.79784 c -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52203,-5.73805 9.82069,-6.22129 0.29865,-0.48323 -13.73561,-24.38261 -31.18725,-53.10973 -27.85546,-45.85284 -34.44321,-56.40356 -37.52724,-60.10242 -1.23146,-1.47696 -22.22657,11.19288 -37.17886,22.43619 -22.22762,16.71395 -41.43638,34.96832 -58.85956,55.93511 -2.51374,3.025 -4.74481,5.95 -4.95794,6.5 -0.21313,0.55 -3.69964,5.95 -7.74779,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.72086,22.75325 29.65057,49.84997 50.26038,68.33476 C 432.73878,442.37366 439.5965,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34696 12.33333,10.86484 29.46836,24.6368 46.11818,46.83991 48.18013,64.24986 0.67724,5.71822 -1.79518,15.8487 -5.37618,22.02832 -7.25054,12.51202 -29.1494,29.70201 -53.70301,42.15533 -6.65552,3.37561 -12.27734,6.29103 -12.49294,6.47873 C 430.22924,595.37442 483.41833,707 484.66161,707 c 0.33439,0 8.98482,-4.31856 19.22318,-9.5968 z m -263.29197,-6.45109 c 42.59837,-4.33743 82.20271,-34.14887 104.22321,-78.45211 8.03132,-16.1583 12.33836,-29.80028 16.41739,-52 1.86022,-10.12407 2.0568,-16.21944 2.46866,-76.54608 l 0.44748,-65.54608 -6.54135,-9.7838 c -13.48561,-20.17023 -24.85765,-46.32393 -29.45792,-67.74806 -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 C 363.2819,181.59012 364,179.60347 364,175.76335 364,173.14351 363.75344,171 363.45209,171 c -0.30136,0 -25.83886,-2.92478 -56.75,-6.49952 -30.91115,-3.57474 -56.98959,-6.49974 -57.95209,-6.5 -1.66034,-4.6e-4 -1.75042,9.49056 -1.7582,185.24952 -0.005,114.16095 -0.38339,188.51185 -0.98589,193.75 -1.88053,16.34944 -6.97498,29.9496 -14.51265,38.74297 -6.66867,7.7796 -21.26986,9.63606 -27.79833,3.5344 -6.66851,-6.23254 -12.32217,-24.14464 -14.67317,-46.48796 C 188.45979,527.44859 188,513.61109 188,502.03941 c 0,-16.16501 -0.2896,-21.03935 -1.25,-21.03913 -1.08344,2.4e-4 -80.45147,6.13452 -101.918642,7.87719 -4.217754,0.34239 -7.952282,0.90706 -8.298952,1.25481 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 127.21723,-6.09327 c 10.5286,-9.84898 22.86011,-14.14925 29.9947,-10.45981 4.15348,2.14785 5.19525,4.36067 5.19525,11.03523 l 0,5.56574 18.08333,0 c 9.94584,0 17.93334,-0.37945 17.75,-0.84321 C 438.65,689.69302 427.475,665.84604 414,637.1635 l -24.5,-52.15007 -1.28655,4.74329 c -8.0063,29.51788 -19.96895,53.87423 -36.2191,73.74328 -3.14877,3.85 -10.51692,11.6125 -16.37366,17.25 l -10.64863,10.25 18.13654,0 18.13654,0 6.56491,-6.14116 z m 25.91167,2.10306 c -1.34507,-10.02819 -7.15709,-11.74133 -17.31668,-5.10423 -3.24777,2.12171 -6.99598,5.04671 -8.32935,6.5 L 365.65137,691 l 14.30599,0 14.30598,0 -0.54162,-4.0381 z M 400,685.65499 c 0,-5.69274 -1.39799,-7.86153 -5.75,-8.92034 -2.73986,-0.66659 -2.74507,-0.59497 -0.25374,3.49118 1.09795,1.80079 1.99795,4.24987 2,5.44238 0.006,3.21976 1.03972,5.33179 2.61073,5.33179 1.01693,0 1.39301,-1.44301 1.39301,-5.34501 z m 197.87689,-11.82741 c 19.85873,-10.86943 38.1279,-27.32205 48.84722,-43.99019 2.07674,-3.22926 5.49261,-8.51755 7.59082,-11.75176 2.09822,-3.23422 5.84116,-11.66407 8.31765,-18.73301 8.29815,-23.68642 7.75118,-10.64957 8.09129,-192.85262 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.72287,-0.3417 -2.23155,-0.0936 -1.84952,0.9019 0.4621,1.20423 66.84509,110.92045 70.36837,116.30317 1.3014,1.98822 0.55467,2.51767 -17.89215,12.68616 -22.79098,12.56314 -44.11125,25.86356 -57.06171,35.59734 C 526.52314,285.49877 515,297.10102 515,299.69572 c 0,3.13162 7.84209,11.95929 18.07018,20.34119 35.88264,29.40578 51.12063,43.38451 66.33035,60.84887 11.56126,13.27507 23.9249,29.96904 31.07888,41.96416 3.28867,5.51415 6.21367,9.67741 6.5,9.25169 0.89208,-1.32636 7.15036,-3.10181 10.91981,-3.09789 4.61298,0.005 9.86323,3.20161 10.69394,6.51143 1.60056,6.37712 -2.15591,21.49163 -6.50036,26.15485 -1.87442,2.01195 -1.85872,2.19038 1.05056,11.93623 6.38009,21.37276 9.06734,48.26899 6.93324,69.39375 -4.79895,47.5033 -24.23476,87.34752 -60.92057,124.88968 C 593.72219,673.45035 589.49625,678 589.76506,678 c 0.2688,0 3.91912,-1.87759 8.11183,-4.17242 z M 651,596.02818 c 0,-3.98995 2.33659,-7.51074 5.98839,-9.02337 3.46347,-1.43462 5.01161,-0.69128 5.01161,2.40632 0,4.01614 -4.16652,9.05018 -7.78192,9.40223 C 651.21894,599.1054 651,598.91591 651,596.02818 z m 4.6003,0.20651 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 564.33952,344.93952 c -0.57333,-0.57333 0.81318,-2.80741 3.61524,-5.82526 3.4403,-3.70523 4.73965,-4.55723 5.34494,-3.50474 1.02601,1.78403 5.31606,3.93693 9.38457,4.70952 2.77292,0.52656 3.84201,0.0133 8.27569,-3.97295 7.35974,-6.61704 10.4225,-12.26053 9.7744,-18.01046 -0.64931,-5.76068 -3.16028,-9.22697 -8.75479,-12.08563 -5.1781,-2.64588 -10.1871,-2.89961 -12.45576,-0.63095 -0.89048,0.89047 -1.72346,1.45297 -1.85108,1.25 -0.12762,-0.20298 -0.99302,-2.04418 -1.9231,-4.09156 -2.07517,-4.56806 -8.40369,-9.30031 -15.09478,-11.28735 C 557.783,290.63729 551.6666,290 546.3533,290 c -8.93136,0 -9.41609,0.11623 -12.77167,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -2.87274,-1.77545 1.86046,-12.29379 8.5362,-18.96953 14.53973,-14.53974 38.4005,-11.74594 46.44932,5.43862 1.79055,3.8229 2.78077,4.93326 3.95185,4.4313 9.58051,-4.10646 15.18309,-4.05502 23.06263,0.21173 12.6922,6.8728 12.93755,23.33342 0.51042,34.24459 -5.47891,4.81054 -11.32802,7.35895 -18.14648,7.90627 -5.07796,0.40761 -7.04421,0.0861 -10.90556,-1.78313 -4.09939,-1.98448 -4.82107,-2.08314 -5.56136,-0.76031 -1.35254,2.41684 -5.505,4.77248 -6.5575,3.71998 z m 36.83274,-10.19639 C 606.18861,330.96804 611,322.37389 611,317.18872 c 0,-4.63137 -3.04687,-9.28475 -7.84504,-11.98147 -4.48385,-2.52007 -13.93092,-4.2718 -12.7522,-2.36459 0.3934,0.63654 1.34806,1.15734 2.12146,1.15734 1.96737,0 8.28742,5.73506 10.02686,9.09878 3.35106,6.48024 1.26776,15.12192 -5.34013,22.15122 -3.52389,3.74863 -1.31842,3.46643 3.96131,-0.50687 z M 568.04282,290.0323 C 564.51966,287.37477 559.11582,286 552.193,286 c -8.88756,0 -8.45199,1.66761 0.57669,2.2079 4.69873,0.28118 9.49507,1.25397 12.23031,2.48056 5.16813,2.31759 6.58122,2.01286 3.04282,-0.65616 z M 412,567.01942 c 28.96423,-13.58994 45.15413,-24.204 53.3881,-35.00109 l 3.88272,-5.09136 -1.88541,-4.18918 c -4.76666,-10.59103 -18.2405,-24.97815 -39.29801,-41.96171 -6.92307,-5.58368 -16.92834,-13.87698 -22.23393,-18.42956 l -9.64652,-8.27741 -0.49964,47.21544 c -0.47427,44.81907 -1.33979,59.57583 -4.28477,73.05351 -0.5514,2.52351 -0.41522,2.73023 1.22866,1.86519 1.01684,-0.53508 9.7238,-4.66781 19.3488,-9.18383 z m -5,-56.99124 c 0,-3.98995 2.33659,-7.51074 5.98839,-9.02337 3.46347,-1.43462 5.01161,-0.69128 5.01161,2.40632 0,4.01614 -4.16652,9.05018 -7.78192,9.40223 C 407.21894,513.1054 407,512.91591 407,510.02818 z m 4.6003,0.20651 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.4138,4.66777 -1.88635,7.26144 1.07462,5.28435 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.43963,-6.88785 c 0.90701,-6.0484 0.0735,-12.81878 -1.96029,-15.92272 C 646.25403,434.45807 645.15098,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.92387 4.93043,11.5 0,0.57612 0.42243,1.0475 0.93873,1.0475 0.5163,0 1.24663,-2.05328 1.62297,-4.56285 z M 151.5,450.50634 c 32.45,-2.47067 59.5625,-4.49532 60.25,-4.49923 0.98285,-0.006 1.25,-10.45003 1.25,-48.86943 l 0,-48.86232 -5.2672,-0.61905 c -11.73492,-1.37921 -20.39205,-6.49417 -23.83999,-14.08557 -2.33826,-5.1482 -2.51274,-17.77047 -0.3599,-26.03578 3.82113,-14.6703 14.19503,-25.89605 26.71709,-28.91095 l 2.75,-0.66211 0,-78.56041 0,-78.5604 2.75,0.53804 c 1.5125,0.29592 42.4657,4.91277 91.0071,10.25966 l 88.25711,9.72162 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -11.77855,2.71919 c -20.5046,4.73367 -39.46088,13.3236 -54.58891,24.73664 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643032,8.23892 -1.818243,18.14841 -2.125782,120.22898 -0.184341,61.1875 -0.207791,111.24965 -0.05211,111.24922 C 92.372626,454.9988 119.05,452.977 151.5,450.50634 z M 97,390.02818 c 0,-3.98995 2.336588,-7.51074 5.98839,-9.02337 3.46347,-1.43462 5.01161,-0.69128 5.01161,2.40632 0,4.01614 -4.16652,9.05018 -7.78192,9.40223 C 97.218939,393.1054 97,392.91591 97,390.02818 z m 4.6003,0.20651 c 1.4876,-0.9933 3.3997,-4.74413 3.3997,-6.66895 0,-2.62856 -2.85608,-1.74473 -4.47432,1.3846 -2.413798,4.66777 -1.886354,7.26144 1.07462,5.28435 z m 37.1331,-145.33846 c -5.41089,-1.25249 -8.55673,-3.62961 -10.91135,-8.24503 -5.74409,-11.25936 3.64955,-33.59072 16.93301,-40.25457 4.35152,-2.18301 6.24283,-2.56183 11,-2.20328 17.01754,1.28264 23.4744,13.74181 15.5079,29.92407 -3.68888,7.49318 -11.21142,15.81034 -16.86444,18.64588 -4.89814,2.45689 -10.79624,3.25996 -15.66512,2.13293 z m 12.02461,-2.96172 c 4.60153,-1.6041 11.49875,-15.60316 12.06442,-24.48673 0.48001,-7.53844 -0.82875,-11.43387 -5.02886,-14.96803 C 155.31012,200.39007 153.81181,200 148.26844,200 c -6.35462,0 -6.70519,0.13358 -10.31844,3.9319 -2.05718,2.16254 -5.00976,6.55004 -6.56129,9.75 -2.32889,4.80323 -2.82687,7.15804 -2.85483,13.49976 -0.0317,7.18535 0.15995,7.88662 2.96612,10.8539 1.65,1.74473 3.9,3.54696 5,4.00495 2.87423,1.19671 10.6877,1.13862 14.25801,-0.106 z m 17.90477,-18.78687 c 1.92097,-4.00155 2.72955,-7.30374 2.7742,-11.32962 0.0553,-4.98211 -0.30651,-6.07506 -2.93698,-8.87316 C 165.26262,199.50117 160.37554,197 156.88424,197 c -1.88991,0 -1.73101,0.30258 1.19408,2.2738 8.96724,6.04302 10.89581,16.88818 5.37504,30.2262 -1.90737,4.60816 2.56693,-0.8478 5.20942,-6.35236 z m 485.88825,226.38448 c 2.06038,-4.93119 1.89897,-12.83284 -0.30103,-14.7361 -1.60913,-1.39209 -6.25,-3.0699 -6.25,-2.25956 0,0.19207 0.95178,1.96237 2.11507,3.934 1.506,2.55247 2.15393,5.4486 2.25,10.05699 0.0742,3.55972 0.27039,6.47228 0.43596,6.47238 0.16556,9e-5 0.95306,-1.56038 1.75,-3.46771 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 C 189.92376,294.60772 185,307.53996 185,320.27337 c 0,9.79503 2.38706,15.63407 7.87115,19.25378 3.82148,2.52233 12.73618,5.29593 17.37885,5.40704 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3398"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#4b4c3a"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 44.51286,-36.3468 C 588.08936,653.99277 630.72462,593.26317 627.67441,521.07747 626.12683,484.4528 612.78165,451.0453 585.74205,416.10662 573.81088,400.68999 545.55729,372.88614 524.95502,356.28717 493.2107,330.71122 480.92295,314.7334 480.74281,298.79784 c -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52203,-5.73805 9.82069,-6.22129 0.29865,-0.48323 -13.73561,-24.38261 -31.18725,-53.10973 -27.85546,-45.85284 -34.44321,-56.40356 -37.52724,-60.10242 -1.23146,-1.47696 -22.22657,11.19288 -37.17886,22.43619 -22.22762,16.71395 -41.43638,34.96832 -58.85956,55.93511 -2.51374,3.025 -4.74481,5.95 -4.95794,6.5 -0.21313,0.55 -3.69964,5.95 -7.74779,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.72086,22.75325 29.65057,49.84997 50.26038,68.33476 C 432.73878,442.37366 439.5965,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34696 12.33333,10.86484 29.46836,24.6368 46.11818,46.83991 48.18013,64.24986 0.67724,5.71822 -1.79518,15.8487 -5.37618,22.02832 -7.25054,12.51202 -29.1494,29.70201 -53.70301,42.15533 -6.65552,3.37561 -12.27734,6.29103 -12.49294,6.47873 C 430.22924,595.37442 483.41833,707 484.66161,707 c 0.33439,0 8.98482,-4.31856 19.22318,-9.5968 z m -263.29197,-6.45109 c 42.59837,-4.33743 82.20271,-34.14887 104.22321,-78.45211 8.03132,-16.1583 12.33836,-29.80028 16.41739,-52 1.86022,-10.12407 2.0568,-16.21944 2.46866,-76.54608 l 0.44748,-65.54608 -6.54135,-9.7838 c -13.48561,-20.17023 -24.85765,-46.32393 -29.45792,-67.74806 -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 C 363.2819,181.59012 364,179.60347 364,175.76335 364,173.14351 363.75344,171 363.45209,171 c -0.30136,0 -25.83886,-2.92478 -56.75,-6.49952 -30.91115,-3.57474 -56.98959,-6.49974 -57.95209,-6.5 -1.66034,-4.6e-4 -1.75042,9.49056 -1.7582,185.24952 -0.005,114.16095 -0.38339,188.51185 -0.98589,193.75 -1.88053,16.34944 -6.97498,29.9496 -14.51265,38.74297 -6.66867,7.7796 -21.26986,9.63606 -27.79833,3.5344 -6.66851,-6.23254 -12.32217,-24.14464 -14.67317,-46.48796 C 188.45979,527.44859 188,513.61109 188,502.03941 c 0,-16.16501 -0.2896,-21.03935 -1.25,-21.03913 -1.08344,2.4e-4 -80.45147,6.13452 -101.918642,7.87719 -4.217754,0.34239 -7.952282,0.90706 -8.298952,1.25481 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 127.21723,-6.09327 c 10.5286,-9.84898 22.86011,-14.14925 29.9947,-10.45981 4.15348,2.14785 5.19525,4.36067 5.19525,11.03523 l 0,5.56574 18.08333,0 c 9.94584,0 17.93334,-0.37945 17.75,-0.84321 C 438.65,689.69302 427.475,665.84604 414,637.1635 l -24.5,-52.15007 -1.28655,4.74329 c -8.0063,29.51788 -19.96895,53.87423 -36.2191,73.74328 -3.14877,3.85 -10.51692,11.6125 -16.37366,17.25 l -10.64863,10.25 18.13654,0 18.13654,0 6.56491,-6.14116 z m 25.91167,2.10306 c -0.84481,-6.29853 -3.07596,-8.96364 -7.49477,-8.95252 -4.47444,0.0113 -12.2664,4.27374 -17.17312,9.39428 L 365.60767,691 l 14.32783,0 14.32784,0 -0.54162,-4.0381 z M 400,685.65499 c 0,-5.69274 -1.39799,-7.86153 -5.75,-8.92034 -2.73986,-0.66659 -2.74507,-0.59497 -0.25374,3.49118 1.09795,1.80079 1.99795,4.24987 2,5.44238 0.006,3.21976 1.03972,5.33179 2.61073,5.33179 1.01693,0 1.39301,-1.44301 1.39301,-5.34501 z m 197.87689,-11.82741 c 19.85873,-10.86943 38.1279,-27.32205 48.84722,-43.99019 2.07674,-3.22926 5.49261,-8.51755 7.59082,-11.75176 2.09822,-3.23422 5.84116,-11.66407 8.31765,-18.73301 8.29815,-23.68642 7.75118,-10.64957 8.09129,-192.85262 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.72287,-0.3417 -2.23155,-0.0936 -1.84952,0.9019 0.4621,1.20423 66.84509,110.92045 70.36837,116.30317 1.3014,1.98822 0.55467,2.51767 -17.89215,12.68616 -22.79098,12.56314 -44.11125,25.86356 -57.06171,35.59734 C 526.52314,285.49877 515,297.10102 515,299.69572 c 0,3.13162 7.84209,11.95929 18.07018,20.34119 35.88264,29.40578 51.12063,43.38451 66.33035,60.84887 11.56126,13.27507 23.9249,29.96904 31.07888,41.96416 3.28867,5.51415 6.21367,9.67741 6.5,9.25169 0.89208,-1.32636 7.15036,-3.10181 10.91981,-3.09789 4.61298,0.005 9.86323,3.20161 10.69394,6.51143 1.60056,6.37712 -2.15591,21.49163 -6.50036,26.15485 -1.87442,2.01195 -1.85872,2.19038 1.05056,11.93623 6.38009,21.37276 9.06734,48.26899 6.93324,69.39375 -4.79895,47.5033 -24.23476,87.34752 -60.92057,124.88968 C 593.72219,673.45035 589.49625,678 589.76506,678 c 0.2688,0 3.91912,-1.87759 8.11183,-4.17242 z M 651,596.02818 c 0,-3.98995 2.33659,-7.51074 5.98839,-9.02337 3.46347,-1.43462 5.01161,-0.69128 5.01161,2.40632 0,4.01614 -4.16652,9.05018 -7.78192,9.40223 C 651.21894,599.1054 651,598.91591 651,596.02818 z m 6.47432,-1.97852 C 659.37257,590.37885 659.42789,588 657.61501,588 655.85111,588 653,592.3028 653,594.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z m -93.1348,-249.11014 c -0.57333,-0.57333 0.81318,-2.80741 3.61524,-5.82526 3.4403,-3.70523 4.73965,-4.55723 5.34494,-3.50474 1.02793,1.78736 5.31799,3.93724 9.40662,4.71393 2.83923,0.53934 3.84766,0.0229 8.80784,-4.51038 C 597.71688,330.14413 601,324.67378 601,320.00772 c 0,-8.50667 -6.76114,-15.31015 -15.32003,-15.41598 -2.84899,-0.0352 -5.87761,0.28088 -6.73028,0.70246 -1.14711,0.56717 -1.97583,-0.1258 -3.18643,-2.66446 C 571.90462,294.53808 561.57814,290 547.02407,290 c -9.6797,0 -10.05076,0.0845 -13.44244,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -2.87274,-1.77545 1.86046,-12.29379 8.5362,-18.96953 14.53973,-14.53974 38.4005,-11.74594 46.44932,5.43862 1.79055,3.8229 2.78077,4.93326 3.95185,4.4313 9.58051,-4.10646 15.18309,-4.05502 23.06263,0.21173 12.6922,6.8728 12.93755,23.33342 0.51042,34.24459 -5.47891,4.81054 -11.32802,7.35895 -18.14648,7.90627 -5.07796,0.40761 -7.04421,0.0861 -10.90556,-1.78313 -4.09939,-1.98448 -4.82107,-2.08314 -5.56136,-0.76031 -1.35254,2.41684 -5.505,4.77248 -6.5575,3.71998 z m 36.37903,-9.8506 c 12.48378,-9.0432 13.66815,-23.56908 2.43641,-29.88167 -4.48385,-2.52007 -13.93092,-4.2718 -12.7522,-2.36459 0.3934,0.63654 1.34806,1.15734 2.12146,1.15734 1.96737,0 8.28742,5.73506 10.02686,9.09878 3.35106,6.48024 1.26776,15.12192 -5.34013,22.15122 -3.38083,3.59644 -1.56435,3.51302 3.5076,-0.16108 z M 568.04282,290.0323 C 564.51966,287.37477 559.11582,286 552.193,286 c -8.88756,0 -8.45199,1.66761 0.57669,2.2079 4.69873,0.28118 9.49507,1.25397 12.23031,2.48056 5.16813,2.31759 6.58122,2.01286 3.04282,-0.65616 z M 412,567.01942 c 28.96423,-13.58994 45.15413,-24.204 53.3881,-35.00109 l 3.88272,-5.09136 -1.88541,-4.18918 c -4.76666,-10.59103 -18.2405,-24.97815 -39.29801,-41.96171 -6.92307,-5.58368 -16.92834,-13.87698 -22.23393,-18.42956 l -9.64652,-8.27741 -0.49964,47.21544 c -0.47427,44.81907 -1.33979,59.57583 -4.28477,73.05351 -0.5514,2.52351 -0.41522,2.73023 1.22866,1.86519 1.01684,-0.53508 9.7238,-4.66781 19.3488,-9.18383 z m -5,-56.99124 c 0,-3.98995 2.33659,-7.51074 5.98839,-9.02337 3.46347,-1.43462 5.01161,-0.69128 5.01161,2.40632 0,4.01614 -4.16652,9.05018 -7.78192,9.40223 C 407.21894,513.1054 407,512.91591 407,510.02818 z m 6.47432,-1.97852 C 415.37257,504.37885 415.42789,502 413.61501,502 411.85111,502 409,506.3028 409,508.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.43963,-6.88785 c 0.90701,-6.0484 0.0735,-12.81878 -1.96029,-15.92272 C 646.25403,434.45807 645.15098,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.92387 4.93043,11.5 0,0.57612 0.42243,1.0475 0.93873,1.0475 0.5163,0 1.24663,-2.05328 1.62297,-4.56285 z M 151.5,450.50634 c 32.45,-2.47067 59.5625,-4.49532 60.25,-4.49923 0.98285,-0.006 1.25,-10.45003 1.25,-48.86943 l 0,-48.86232 -5.2672,-0.61905 c -11.73492,-1.37921 -20.39205,-6.49417 -23.83999,-14.08557 -2.33826,-5.1482 -2.51274,-17.77047 -0.3599,-26.03578 3.82113,-14.6703 14.19503,-25.89605 26.71709,-28.91095 l 2.75,-0.66211 0,-78.56041 0,-78.5604 2.75,0.53804 c 1.5125,0.29592 42.4657,4.91277 91.0071,10.25966 l 88.25711,9.72162 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -11.77855,2.71919 c -20.5046,4.73367 -39.46088,13.3236 -54.58891,24.73664 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643032,8.23892 -1.818243,18.14841 -2.125782,120.22898 -0.184341,61.1875 -0.207791,111.24965 -0.05211,111.24922 C 92.372626,454.9988 119.05,452.977 151.5,450.50634 z M 97,390.02818 c 0,-3.98995 2.336588,-7.51074 5.98839,-9.02337 3.46347,-1.43462 5.01161,-0.69128 5.01161,2.40632 0,4.01614 -4.16652,9.05018 -7.78192,9.40223 C 97.218939,393.1054 97,392.91591 97,390.02818 z m 6.47432,-1.97852 C 105.37257,384.37885 105.42789,382 103.61501,382 101.85111,382 99,386.3028 99,388.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 138.7334,244.89623 c -5.41089,-1.25249 -8.55673,-3.62961 -10.91135,-8.24503 -5.74409,-11.25936 3.64955,-33.59072 16.93301,-40.25457 4.35152,-2.18301 6.24283,-2.56183 11,-2.20328 17.01754,1.28264 23.4744,13.74181 15.5079,29.92407 -3.68888,7.49318 -11.21142,15.81034 -16.86444,18.64588 -4.89814,2.45689 -10.79624,3.25996 -15.66512,2.13293 z m 11.94485,-2.93391 c 2.29082,-0.79859 3.92004,-2.81474 7.07076,-8.75 6.78001,-12.77208 7.31659,-23.38411 1.49052,-29.47827 -5.73617,-6.00012 -16.43276,-5.58027 -22.00788,0.86385 -8.05461,9.31006 -11.55103,23.96522 -7.47347,31.32483 3.42116,6.17488 12.78074,8.87697 20.92007,6.03959 z m 17.98453,-18.81468 c 1.92097,-4.00155 2.72955,-7.30374 2.7742,-11.32962 0.0553,-4.98211 -0.30651,-6.07506 -2.93698,-8.87316 -3.45963,-3.68011 -8.22178,-5.97252 -12.21788,-5.88147 l -2.78212,0.0634 2.49949,0.99668 c 10.33892,4.12269 13.40042,17.00984 7.45387,31.37655 -1.90737,4.60816 2.56693,-0.8478 5.20942,-6.35236 z m 486.17893,225.98634 c 2.72964,-9.11071 1.07488,-15.02069 -4.59171,-16.39933 -2.74849,-0.66869 -2.7477,-0.69252 -0.12419,3.75401 1.54925,2.62578 2.14228,5.3535 2.18653,10.05716 0.0334,3.5498 0.35555,6.45418 0.7159,6.45418 0.36035,0 1.17641,-1.73971 1.81347,-3.86602 z M 213,315.5 l 0,-29.5 -6.42327,0 c -7.47079,0 -10.79801,2.10871 -15.21235,9.6412 -6.61665,11.29047 -8.61845,29.82099 -4.08596,37.82342 3.64446,6.43454 12.87026,11.02336 22.97158,11.42581 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3396"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#5e4e20"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 44.51286,-36.3468 C 588.08936,653.99277 630.72462,593.26317 627.67441,521.07747 626.12683,484.4528 612.78165,451.0453 585.74205,416.10662 573.81088,400.68999 545.55729,372.88614 524.95502,356.28717 493.2107,330.71122 480.92295,314.7334 480.74281,298.79784 c -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52203,-5.73805 9.82069,-6.22129 0.29865,-0.48323 -13.73561,-24.38261 -31.18725,-53.10973 -27.85546,-45.85284 -34.44321,-56.40356 -37.52724,-60.10242 -1.23146,-1.47696 -22.22657,11.19288 -37.17886,22.43619 -22.22762,16.71395 -41.43638,34.96832 -58.85956,55.93511 -2.51374,3.025 -4.74481,5.95 -4.95794,6.5 -0.21313,0.55 -3.69964,5.95 -7.74779,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.72086,22.75325 29.65057,49.84997 50.26038,68.33476 C 432.73878,442.37366 439.5965,448 440.77448,448 c 0.58237,0 1.20885,0.37455 1.39219,0.83233 0.18333,0.45778 5.73333,5.34696 12.33333,10.86484 29.46836,24.6368 46.11818,46.83991 48.18013,64.24986 0.67724,5.71822 -1.79518,15.8487 -5.37618,22.02832 -7.25054,12.51202 -29.1494,29.70201 -53.70301,42.15533 -6.65552,3.37561 -12.27734,6.29103 -12.49294,6.47873 C 430.22924,595.37442 483.41833,707 484.66161,707 c 0.33439,0 8.98482,-4.31856 19.22318,-9.5968 z m -263.29197,-6.45109 c 42.59837,-4.33743 82.20271,-34.14887 104.22321,-78.45211 8.03132,-16.1583 12.33836,-29.80028 16.41739,-52 1.86022,-10.12407 2.0568,-16.21944 2.46866,-76.54608 l 0.44748,-65.54608 -6.54135,-9.7838 c -13.48561,-20.17023 -24.85765,-46.32393 -29.45792,-67.74806 -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 C 363.2819,181.59012 364,179.60347 364,175.76335 364,173.14351 363.75344,171 363.45209,171 c -0.30136,0 -25.83886,-2.92478 -56.75,-6.49952 -30.91115,-3.57474 -56.98959,-6.49974 -57.95209,-6.5 -1.66034,-4.6e-4 -1.75042,9.49056 -1.7582,185.24952 -0.005,114.16095 -0.38339,188.51185 -0.98589,193.75 -1.88053,16.34944 -6.97498,29.9496 -14.51265,38.74297 -6.66867,7.7796 -21.26986,9.63606 -27.79833,3.5344 -6.66851,-6.23254 -12.32217,-24.14464 -14.67317,-46.48796 C 188.45979,527.44859 188,513.61109 188,502.03941 c 0,-16.16501 -0.2896,-21.03935 -1.25,-21.03913 -1.08344,2.4e-4 -80.45147,6.13452 -101.918642,7.87719 -4.217754,0.34239 -7.952282,0.90706 -8.298952,1.25481 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 27.40366,18.40106 56.21819,24.31298 97.84327,20.07466 z m 127.21723,-6.09327 c 10.5286,-9.84898 22.86011,-14.14925 29.9947,-10.45981 4.15348,2.14785 5.19525,4.36067 5.19525,11.03523 l 0,5.56574 18.08333,0 c 9.94584,0 17.93334,-0.37945 17.75,-0.84321 C 438.65,689.69302 427.475,665.84604 414,637.1635 l -24.5,-52.15007 -1.28655,4.74329 c -8.0063,29.51788 -19.96895,53.87423 -36.2191,73.74328 -3.14877,3.85 -10.51692,11.6125 -16.37366,17.25 l -10.64863,10.25 18.13654,0 18.13654,0 6.56491,-6.14116 z m 25.91167,2.10306 c -0.84481,-6.29853 -3.07596,-8.96364 -7.49477,-8.95252 -4.47444,0.0113 -12.2664,4.27374 -17.17312,9.39428 L 365.60767,691 l 14.32783,0 14.32784,0 -0.54162,-4.0381 z m 6.39343,0.7881 c 0.26232,-7.40334 -1.18262,-9.94103 -6.34441,-11.14245 l -2.72926,-0.63524 2.47926,3.65339 c 1.36359,2.00937 2.47926,4.67879 2.47926,5.93206 0,5.81784 3.91283,7.9023 4.11515,2.19224 z m 197.76174,-13.92242 c 19.85873,-10.86943 38.1279,-27.32205 48.84722,-43.99019 2.07674,-3.22926 5.49261,-8.51755 7.59082,-11.75176 2.09822,-3.23422 5.84116,-11.66407 8.31765,-18.73301 8.29815,-23.68642 7.75118,-10.64957 8.09129,-192.85262 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.72287,-0.3417 -2.23155,-0.0936 -1.84952,0.9019 0.4621,1.20423 66.84509,110.92045 70.36837,116.30317 1.3014,1.98822 0.55467,2.51767 -17.89215,12.68616 -22.79098,12.56314 -44.11125,25.86356 -57.06171,35.59734 C 526.52314,285.49877 515,297.10102 515,299.69572 c 0,3.13162 7.84209,11.95929 18.07018,20.34119 35.88264,29.40578 51.12063,43.38451 66.33035,60.84887 11.56126,13.27507 23.9249,29.96904 31.07888,41.96416 3.28867,5.51415 6.21367,9.67741 6.5,9.25169 0.87135,-1.29554 7.11333,-3.10163 10.71947,-3.10163 4.08198,0 8.85485,2.29763 10.27148,4.94461 2.70464,5.05367 -1.03589,22.52848 -5.95173,27.80502 -1.77581,1.9061 -1.74328,2.24903 1.12473,11.85662 6.38009,21.37276 9.06734,48.26899 6.93324,69.39375 -4.79895,47.5033 -24.23476,87.34752 -60.92057,124.88968 C 593.72219,673.45035 589.49625,678 589.76506,678 c 0.2688,0 3.91912,-1.87759 8.11183,-4.17242 z m 53.15491,-78.01422 c 0.036,-3.74718 1.25185,-5.67198 5.21048,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.04489,0.29649 -3.21637,0.13504 -3.18628,-3 z m 6.44252,-1.7637 C 659.37257,590.37885 659.42789,588 657.61501,588 655.85111,588 653,592.3028 653,594.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 564.38097,344.98097 c -0.62859,-0.62859 0.63271,-2.69913 3.57379,-5.86671 3.4403,-3.70523 4.73965,-4.55723 5.34494,-3.50474 1.02793,1.78736 5.31799,3.93724 9.40662,4.71393 2.83923,0.53934 3.84766,0.0229 8.80784,-4.51038 C 597.71688,330.14413 601,324.67378 601,320.00772 c 0,-8.50667 -6.76114,-15.31015 -15.32003,-15.41598 -2.84899,-0.0352 -5.87761,0.28088 -6.73028,0.70246 -1.14711,0.56717 -1.97583,-0.1258 -3.18643,-2.66446 C 571.90462,294.53808 561.57814,290 547.02407,290 c -9.6797,0 -10.05076,0.0845 -13.44244,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -1.61762,-0.99974 -1.16476,-3.77668 1.48209,-9.08822 7.24361,-14.53603 23.29397,-22.25212 37.58701,-18.06968 6.96008,2.03667 12.32322,6.51319 15.58563,13.00908 1.42223,2.83185 2.71492,5.2945 2.87264,5.47256 0.15772,0.17805 1.79109,-0.46237 3.6297,-1.42315 4.76155,-2.4882 14.22198,-2.32296 19.34293,0.33786 7.16195,3.72132 11.5,9.81289 11.5,16.14851 0,17.39358 -23.22166,32.50916 -38.54616,25.09069 -4.65754,-2.25467 -4.73502,-2.25879 -6.33453,-0.3369 -2.71796,3.26577 -4.67413,4.40443 -5.73834,3.34022 z m 36.44971,-9.97328 c 8.91786,-6.46006 12.57674,-17.37633 8.19856,-24.46039 -1.22693,-1.98521 -3.984,-4.50389 -6.12681,-5.59708 -4.66346,-2.37912 -13.5986,-3.88567 -12.49967,-2.10756 0.3934,0.63654 1.34806,1.15734 2.12146,1.15734 2.22367,0 8.63987,6.14847 10.12474,9.70226 2.9964,7.1714 1.13208,14.55865 -5.43801,21.54774 -3.40971,3.62716 -1.55007,3.50268 3.61973,-0.24231 z m -32.84562,-45.0659 c -3.46817,-2.68157 -8.43886,-3.92969 -15.67604,-3.93621 -8.97869,-0.008 -8.63012,1.65832 0.46067,2.20232 4.69873,0.28118 9.49507,1.25397 12.23031,2.48056 5.22089,2.34124 6.5491,2.00901 2.98506,-0.74667 z M 412,567.01942 c 28.96423,-13.58994 45.15413,-24.204 53.3881,-35.00109 l 3.88272,-5.09136 -1.88541,-4.18918 c -4.76666,-10.59103 -18.2405,-24.97815 -39.29801,-41.96171 -6.92307,-5.58368 -16.92834,-13.87698 -22.23393,-18.42956 l -9.64652,-8.27741 -0.49964,47.21544 c -0.47427,44.81907 -1.33979,59.57583 -4.28477,73.05351 -0.5514,2.52351 -0.41522,2.73023 1.22866,1.86519 1.01684,-0.53508 9.7238,-4.66781 19.3488,-9.18383 z m -4.9682,-57.20606 c 0.036,-3.74718 1.25185,-5.67198 5.21048,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.04489,0.29649 -3.21637,0.13504 -3.18628,-3 z m 6.44252,-1.7637 C 415.37257,504.37885 415.42789,502 413.61501,502 411.85111,502 409,506.3028 409,508.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.43963,-6.88785 c 0.90701,-6.0484 0.0735,-12.81878 -1.96029,-15.92272 C 646.25403,434.45807 645.15098,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.92387 4.93043,11.5 0,0.57612 0.42243,1.0475 0.93873,1.0475 0.5163,0 1.24663,-2.05328 1.62297,-4.56285 z M 151.5,450.50634 c 32.45,-2.47067 59.5625,-4.49532 60.25,-4.49923 0.98285,-0.006 1.25,-10.45003 1.25,-48.86943 l 0,-48.86232 -5.2672,-0.61905 c -8.63029,-1.01432 -14.7355,-3.60637 -19.34033,-8.21121 -4.96059,-4.96059 -6.38379,-9.19002 -6.37502,-18.9451 0.018,-20.04584 12.07704,-38.23581 27.48255,-41.45499 l 3,-0.62689 0.25608,-78.78718 0.25607,-78.78718 2.74393,0.5367 c 1.50915,0.29519 42.45962,4.91144 91.00102,10.25833 l 88.25711,9.72162 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -11.77855,2.71919 c -20.5046,4.73367 -39.46088,13.3236 -54.58891,24.73664 -9.8269,7.41371 -26.51595,24.69435 -31.63875,32.7603 -2.19659,3.45855 -5.41666,8.4526 -7.15573,11.09787 -3.58178,5.4482 -8.73896,17.07819 -9.841817,22.19435 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643032,8.23892 -1.818243,18.14841 -2.125782,120.22898 -0.184341,61.1875 -0.207791,111.24965 -0.05211,111.24922 C 92.372626,454.9988 119.05,452.977 151.5,450.50634 z M 97.031803,389.81336 c 0.03597,-3.74718 1.25185,-5.67198 5.210477,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.044894,0.29649 -3.216368,0.13504 -3.186277,-3 z m 6.442517,-1.7637 C 105.37257,384.37885 105.42789,382 103.61501,382 101.85111,382 99,386.3028 99,388.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 133.85853,242.8425 c -2.00281,-1.16136 -4.64033,-3.88879 -5.86115,-6.06095 -6.06994,-10.80001 3.43243,-33.70011 16.75768,-40.38492 4.35152,-2.18301 6.24283,-2.56183 11,-2.20328 17.1483,1.29249 23.45381,13.66904 15.31683,30.06409 -3.90845,7.87506 -11.1073,15.6131 -17.32564,18.62335 -5.93237,2.87181 -14.8989,2.85455 -19.88772,-0.0383 z m 16.81972,-0.88018 c 2.29082,-0.79859 3.92004,-2.81474 7.07076,-8.75 6.78001,-12.77208 7.31659,-23.38411 1.49052,-29.47827 -5.73617,-6.00012 -16.43276,-5.58027 -22.00788,0.86385 -8.05461,9.31006 -11.55103,23.96522 -7.47347,31.32483 3.42116,6.17488 12.78074,8.87697 20.92007,6.03959 z m 17.37047,-17.6752 c 4.64327,-9.37978 4.79844,-16.71808 0.45128,-21.34226 -3.45963,-3.68011 -8.22178,-5.97252 -12.21788,-5.88147 l -2.78212,0.0634 2.49949,0.99668 c 8.43285,3.36264 12.64288,14.01398 9.63503,24.37655 -0.79822,2.75 -1.78841,6.08287 -2.20044,7.40637 -1.38627,4.45301 1.16872,1.3418 4.61464,-5.61925 z m 486.85676,224.63402 c 2.84089,-9.48204 1.12728,-14.85437 -5.20953,-16.33236 l -2.80406,-0.65402 2.17066,2.93597 c 2.56446,3.46862 4.0753,10.32012 3.28105,14.87927 -0.80901,4.64386 1.10804,4.02363 2.56188,-0.82886 z M 213,315.5 l 0,-29.5 -6.42327,0 c -7.47079,0 -10.79801,2.10871 -15.21235,9.6412 -6.61665,11.29047 -8.61845,29.82099 -4.08596,37.82342 3.64446,6.43454 12.87026,11.02336 22.97158,11.42581 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3394"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#4b4936"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 44.12623,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 39.09864,-37.3297 57.40143,-79.96214 55.33404,-128.88877 C 626.66457,497.17869 621.85891,478.80988 610.51801,455.5 593.3682,420.25058 566.18295,389.30086 519.5,351.8783 c -25.86219,-20.73196 -38.58854,-38.16152 -38.75719,-53.08046 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52203,-5.73805 9.82069,-6.22129 0.29865,-0.48323 -13.73561,-24.38261 -31.18725,-53.10973 -27.85546,-45.85284 -34.44321,-56.40356 -37.52724,-60.10242 -1.23146,-1.47696 -22.22657,11.19288 -37.17886,22.43619 -22.22762,16.71395 -41.43638,34.96832 -58.85956,55.93511 -2.51374,3.025 -4.74481,5.95 -4.95794,6.5 -0.21313,0.55 -3.69964,5.95 -7.74779,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7125,22.73366 29.74405,49.97584 50.29201,68.39529 C 430.9023,440.75352 439.5547,448 440.31236,448 c 0.3282,0 1.66414,1.0125 2.96876,2.25 1.30461,1.2375 6.93762,6.0105 12.51779,10.60667 27.51249,22.66094 44.85747,46.00293 46.88122,63.09036 0.68008,5.74221 -1.72253,15.5322 -5.36674,21.86804 -7.30138,12.69417 -28.97505,29.76907 -53.71245,42.31561 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.21707,595.39118 483.41884,707 484.6601,707 c 0.33522,0 8.81234,-4.23268 18.83806,-9.40596 z M 229.5,691.98539 c 16.01485,-1.15132 25.40299,-2.95883 37.5,-7.21989 26.87627,-9.46693 50.11187,-28.14178 67.51814,-54.2655 13.57853,-20.37894 21.48528,-41.1259 26.6773,-70 2.03288,-11.30539 2.18055,-15.76554 2.55103,-77.05345 l 0.39324,-65.05344 -6.53642,-9.77644 c -13.48069,-20.16286 -24.85338,-46.31958 -29.453,-67.74069 -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 C 363.2819,181.59012 364,179.60347 364,175.76335 364,173.14351 363.75344,171 363.45209,171 c -0.30136,0 -25.83886,-2.92478 -56.75,-6.49952 -30.91115,-3.57474 -56.98959,-6.49974 -57.95209,-6.5 -1.66034,-4.6e-4 -1.75042,9.49056 -1.7582,185.24952 -0.005,114.16095 -0.38339,188.51185 -0.98589,193.75 -1.88053,16.34944 -6.97498,29.9496 -14.51265,38.74297 -6.66867,7.7796 -21.26986,9.63606 -27.79833,3.5344 -6.78345,-6.33998 -12.48683,-24.64778 -14.68332,-47.13332 C 188.45523,526.44827 188,512.61077 188,501.39405 c 0,-18.7605 -0.14017,-20.39315 -1.75,-20.38286 -1.50305,0.01 -79.08796,6.02092 -101.418642,7.85795 -4.217754,0.34697 -7.952282,0.91539 -8.298952,1.26314 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.45,0.81707 10,0.89321 0.55,0.0761 7.3,-0.31448 15,-0.86804 z m 138.31005,-7.12655 c 10.5286,-9.84898 22.86011,-14.14925 29.9947,-10.45981 4.15348,2.14785 5.19525,4.36067 5.19525,11.03523 l 0,5.56574 18.08333,0 c 9.94584,0 17.93334,-0.38299 17.75,-0.85109 C 438.65,689.68081 427.475,665.83232 414,637.15226 c -22.97818,-48.90653 -24.55441,-51.94389 -25.37588,-48.89891 -3.03338,11.24391 -10.43404,31.76164 -14.61033,40.50591 -9.36567,19.60976 -20.70412,34.96393 -38.3931,51.99074 l -10.64863,10.25 18.13654,0 18.13654,0 6.56491,-6.14116 z m 25.91167,2.10306 c -0.84481,-6.29853 -3.07596,-8.96364 -7.49477,-8.95252 -4.47444,0.0113 -12.2664,4.27374 -17.17312,9.39428 L 365.60767,691 l 14.32783,0 14.32784,0 -0.54162,-4.0381 z m 6.39343,0.7881 c 0.26232,-7.40334 -1.18262,-9.94103 -6.34441,-11.14245 l -2.72926,-0.63524 2.47926,3.65339 c 1.36359,2.00937 2.47926,4.67879 2.47926,5.93206 0,5.81784 3.91283,7.9023 4.11515,2.19224 z m 197.79954,-13.89867 c 19.77883,-10.81773 38.06582,-27.30804 48.80942,-44.01394 2.07674,-3.22926 5.49261,-8.51755 7.59082,-11.75176 2.09822,-3.23422 5.84116,-11.66407 8.31765,-18.73301 8.29815,-23.68642 7.75118,-10.64957 8.09129,-192.85262 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.72287,-0.3417 -2.23155,-0.0936 -1.84952,0.9019 0.46191,1.20372 66.84429,110.91922 70.36602,116.29958 1.29628,1.98041 0.6457,2.46028 -14.83725,10.94397 -20.88457,11.44346 -39.50053,22.73662 -53.30212,32.33515 -12.24956,8.51914 -28.501,23.76519 -28.50002,26.73687 10e-4,3.75569 8.95745,13.21159 24.10985,25.45501 31.89454,25.77137 52.04629,45.15386 69.61521,66.95778 8.19943,10.17591 20.50998,28.05811 25.30359,36.7558 1.29003,2.34069 2.59869,3.8769 2.90812,3.4138 0.90413,-1.35314 7.07142,-3.1696 10.76148,-3.1696 4.08198,0 8.85485,2.29763 10.27148,4.94461 2.70464,5.05367 -1.03589,22.52848 -5.95173,27.80502 -1.77581,1.9061 -1.74328,2.24903 1.12473,11.85662 6.38009,21.37276 9.06734,48.26899 6.93324,69.39375 -4.79559,47.47003 -24.07322,87.01088 -60.82024,124.75 -5.4893,5.6375 -9.7435,10.25 -9.45377,10.25 0.28974,0 3.94018,-1.8669 8.1121,-4.14867 z m 53.11711,-78.03797 c 0.036,-3.74718 1.25185,-5.67198 5.21048,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.04489,0.29649 -3.21637,0.13504 -3.18628,-3 z m 6.44252,-1.7637 C 659.37257,590.37885 659.42789,588 657.61501,588 655.85111,588 653,592.3028 653,594.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 564.38097,344.98097 c -0.62859,-0.62859 0.63271,-2.69913 3.57379,-5.86671 3.4403,-3.70523 4.73965,-4.55723 5.34494,-3.50474 1.02793,1.78736 5.31799,3.93724 9.40662,4.71393 2.83923,0.53934 3.84766,0.0229 8.80784,-4.51038 C 597.71688,330.14413 601,324.67378 601,320.00772 c 0,-8.50667 -6.76114,-15.31015 -15.32003,-15.41598 -2.84899,-0.0352 -5.87761,0.28088 -6.73028,0.70246 -1.14711,0.56717 -1.97583,-0.1258 -3.18643,-2.66446 C 571.90462,294.53808 561.57814,290 547.02407,290 c -9.6797,0 -10.05076,0.0845 -13.44244,3.06247 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -1.61762,-0.99974 -1.16476,-3.77668 1.48209,-9.08822 7.24361,-14.53603 23.29397,-22.25212 37.58701,-18.06968 6.96008,2.03667 12.32322,6.51319 15.58563,13.00908 1.42223,2.83185 2.71492,5.2945 2.87264,5.47256 0.15772,0.17805 1.79109,-0.46237 3.6297,-1.42315 4.76155,-2.4882 14.22198,-2.32296 19.34293,0.33786 7.16195,3.72132 11.5,9.81289 11.5,16.14851 0,17.39358 -23.22166,32.50916 -38.54616,25.09069 -4.65754,-2.25467 -4.73502,-2.25879 -6.33453,-0.3369 -2.71796,3.26577 -4.67413,4.40443 -5.73834,3.34022 z m 36.44971,-9.97328 c 8.91786,-6.46006 12.57674,-17.37633 8.19856,-24.46039 -1.22693,-1.98521 -3.984,-4.50389 -6.12681,-5.59708 -4.66346,-2.37912 -13.5986,-3.88567 -12.49967,-2.10756 0.3934,0.63654 1.34806,1.15734 2.12146,1.15734 2.22367,0 8.63987,6.14847 10.12474,9.70226 2.9964,7.1714 1.13208,14.55865 -5.43801,21.54774 -3.40971,3.62716 -1.55007,3.50268 3.61973,-0.24231 z m -32.84562,-45.0659 c -3.46817,-2.68157 -8.43886,-3.92969 -15.67604,-3.93621 -8.97869,-0.008 -8.63012,1.65832 0.46067,2.20232 4.69873,0.28118 9.49507,1.25397 12.23031,2.48056 5.22089,2.34124 6.5491,2.00901 2.98506,-0.74667 z M 412,567.01942 c 29.03977,-13.62539 45.15179,-24.20093 53.45157,-35.08432 l 3.9462,-5.17459 -3.19179,-6.13026 C 460.45037,509.57584 447.0921,495.82113 425,478.20141 c -5.225,-4.16724 -13.84094,-11.30179 -19.14653,-15.85455 l -9.64652,-8.27775 -0.49964,47.21544 c -0.47427,44.81907 -1.33979,59.57583 -4.28477,73.05351 -0.5514,2.52351 -0.41522,2.73023 1.22866,1.86519 1.01684,-0.53508 9.7238,-4.66781 19.3488,-9.18383 z m -4.9682,-57.20606 c 0.036,-3.74718 1.25185,-5.67198 5.21048,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.04489,0.29649 -3.21637,0.13504 -3.18628,-3 z m 6.44252,-1.7637 C 415.37257,504.37885 415.42789,502 413.61501,502 411.85111,502 409,506.3028 409,508.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.43963,-6.88785 c 0.90701,-6.0484 0.0735,-12.81878 -1.96029,-15.92272 C 646.25403,434.45807 645.15098,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.92387 4.93043,11.5 0,0.57612 0.42243,1.0475 0.93873,1.0475 0.5163,0 1.24663,-2.05328 1.62297,-4.56285 z M 151.88914,450.5 C 184.53492,448.025 211.63996,446 212.12256,446 212.61384,446 213,424.496 213,397.13768 l 0,-48.86232 -5.2672,-0.61905 c -8.63029,-1.01432 -14.7355,-3.60637 -19.34033,-8.21121 -4.96059,-4.96059 -6.38379,-9.19002 -6.37502,-18.9451 0.018,-20.04584 12.07704,-38.23581 27.48255,-41.45499 l 3,-0.62689 0.25608,-78.78718 0.25607,-78.78718 2.74393,0.5367 c 1.50915,0.29519 42.45962,4.91144 91.00102,10.25833 l 88.25711,9.72162 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -12,2.76488 c -20.37087,4.69357 -39.1468,13.21491 -54.33513,24.65966 -13.51381,10.18296 -30.24918,28.50329 -35.69615,39.07684 -0.97083,1.88455 -2.77618,4.77646 -4.0119,6.42646 -2.6099,3.48491 -7.88916,15.61023 -8.960577,20.58051 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643032,8.23892 -1.818243,18.14841 -2.125782,120.22898 -0.184341,61.1875 -0.200329,111.25 -0.03553,111.25 0.164799,0 27.009822,-2.025 59.655612,-4.5 z M 97.031803,389.81336 c 0.03597,-3.74718 1.25185,-5.67198 5.210477,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.044894,0.29649 -3.216368,0.13504 -3.186277,-3 z m 6.442517,-1.7637 C 105.37257,384.37885 105.42789,382 103.61501,382 101.85111,382 99,386.3028 99,388.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 133.85853,242.8425 c -2.00281,-1.16136 -4.64033,-3.88879 -5.86115,-6.06095 -6.06994,-10.80001 3.43243,-33.70011 16.75768,-40.38492 4.35152,-2.18301 6.24283,-2.56183 11,-2.20328 17.1483,1.29249 23.45381,13.66904 15.31683,30.06409 -3.90845,7.87506 -11.1073,15.6131 -17.32564,18.62335 -5.93237,2.87181 -14.8989,2.85455 -19.88772,-0.0383 z m 16.81972,-0.88018 c 2.29082,-0.79859 3.92004,-2.81474 7.07076,-8.75 6.78001,-12.77208 7.31659,-23.38411 1.49052,-29.47827 -5.73617,-6.00012 -16.43276,-5.58027 -22.00788,0.86385 -8.05461,9.31006 -11.55103,23.96522 -7.47347,31.32483 3.42116,6.17488 12.78074,8.87697 20.92007,6.03959 z m 17.37047,-17.6752 c 4.64327,-9.37978 4.79844,-16.71808 0.45128,-21.34226 -3.45963,-3.68011 -8.22178,-5.97252 -12.21788,-5.88147 l -2.78212,0.0634 2.49949,0.99668 c 8.43285,3.36264 12.64288,14.01398 9.63503,24.37655 -0.79822,2.75 -1.78841,6.08287 -2.20044,7.40637 -1.38627,4.45301 1.16872,1.3418 4.61464,-5.61925 z m 486.85676,224.63402 c 2.84089,-9.48204 1.12728,-14.85437 -5.20953,-16.33236 l -2.80406,-0.65402 2.17066,2.93597 c 2.56446,3.46862 4.0753,10.32012 3.28105,14.87927 -0.80901,4.64386 1.10804,4.02363 2.56188,-0.82886 z M 213,315.5 l 0,-29.5 -6.42327,0 c -7.47079,0 -10.79801,2.10871 -15.21235,9.6412 -6.61665,11.29047 -8.61845,29.82099 -4.08596,37.82342 3.64446,6.43454 12.87026,11.02336 22.97158,11.42581 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-0.55 -0.87344,-1 -1.94098,-1 -1.06754,0 -2.2191,0.45 -2.55902,1 -0.35052,0.56716 0.48962,1 1.94098,1 1.40746,0 2.55902,-0.45 2.55902,-1 z"
+       id="path3392"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#424242"
+       d="m 459.37193,733.75 -8.00105,-17.25 -86.43544,0 -86.43544,0 -9,2.80013 c -16.81307,5.23099 -29.83655,6.97885 -52,6.97885 -16.09922,0 -22.32065,-0.41892 -31.8984,-2.14787 -29.29823,-5.28885 -53.96332,-17.24916 -76.16113,-36.93117 C 75.965032,657.51845 54.828657,614.41918 47.550567,561 45.0207,542.43147 44.030634,522.51293 44.01483,489.86663 L 44,459.23326 l 2.25,-0.60297 c 1.2375,-0.33164 4.05,-0.61304 6.25,-0.62533 2.2,-0.0123 6.347862,-0.30438 9.21747,-0.64909 l 5.21747,-0.62675 0.327805,-112.61456 C 67.587552,232.53011 67.61079,231.39938 69.803204,220.5 76.427217,187.56934 91.269481,159.73595 114.5,136.68103 124.99269,126.26765 143.83775,111 146.19843,111 c 0.61203,0 2.50526,-1.05815 4.20718,-2.35144 6.43661,-4.89122 28.93466,-13.314911 47.6911,-17.856441 L 211.5,87.546756 336.36928,87.243549 461.23857,86.940341 476.86928,78.073334 C 507.99866,60.414232 508.47179,60.16971 509.21287,61.357463 509.60495,61.985858 513.24273,67.9 517.29682,74.5 l 7.37109,12 12.91604,0.716072 c 29.27387,1.622958 56.0679,9.276261 75.72948,21.630958 18.77671,11.79867 19.57019,12.43086 36.02448,28.70187 20.84894,20.6167 36.54224,49.15176 41.77051,75.9511 0.5365,2.75 1.74408,8.375 2.68351,12.5 1.56711,6.88104 1.73127,21.11719 1.98914,172.5 0.17829,104.66763 -0.0781,167.1939 -0.70122,171 -0.54025,3.3 -1.63954,9.90316 -2.44287,14.67369 -2.51735,14.94929 -11.85221,39.90758 -18.07493,48.32631 -1.2196,1.65 -2.92098,4.4334 -3.78085,6.18533 -2.68927,5.47927 -15.35971,21.54412 -21.96219,27.84586 -8.15357,7.78219 -17.96238,16.11578 -24.4914,20.80798 -6.75475,4.85442 -31.64361,16.77667 -41.82761,20.03624 -10.14049,3.24565 -28.96989,7.2671 -37.78349,8.06954 -5.57054,0.50718 -7.98323,1.35193 -13.49302,4.72429 -11.28649,6.9081 -29.90695,16.34533 -46.89314,23.76641 C 475.43704,747.82104 467.98346,751 467.76684,751 c -0.21663,0 -3.99434,-7.7625 -8.39491,-17.25 z m 44.12623,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 39.09864,-37.3297 57.40143,-79.96214 55.33404,-128.88877 C 626.66457,497.17869 621.85891,478.80988 610.51801,455.5 593.3682,420.25058 566.18295,389.30086 519.5,351.8783 c -25.86219,-20.73196 -38.58854,-38.16152 -38.75719,-53.08046 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52203,-5.73805 9.82069,-6.22129 0.29865,-0.48323 -13.73561,-24.38261 -31.18725,-53.10973 -27.85546,-45.85284 -34.44321,-56.40356 -37.52724,-60.10242 -1.23146,-1.47696 -22.22657,11.19288 -37.17886,22.43619 -22.22762,16.71395 -41.43638,34.96832 -58.85956,55.93511 -2.51374,3.025 -4.74481,5.95 -4.95794,6.5 -0.21313,0.55 -3.69964,5.95 -7.74779,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.6645,6.98368 -3.109,7.57485 -1.32358,1.76029 -5.70093,21.28026 -6.81694,30.39892 -2.72369,22.2545 0.78147,54.53268 7.44141,68.52623 0.78528,1.65 3.19675,7.14054 5.35882,12.2012 9.7125,22.73366 29.74405,49.97584 50.29201,68.39529 C 430.9023,440.75352 439.5547,448 440.31236,448 c 0.3282,0 1.66414,1.0125 2.96876,2.25 1.30461,1.2375 6.93762,6.0105 12.51779,10.60667 27.51249,22.66094 44.85747,46.00293 46.88122,63.09036 0.68008,5.74221 -1.72253,15.5322 -5.36674,21.86804 -7.30138,12.69417 -28.97505,29.76907 -53.71245,42.31561 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.21707,595.39118 483.41884,707 484.6601,707 c 0.33522,0 8.81234,-4.23268 18.83806,-9.40596 z M 229.5,691.98539 c 16.01485,-1.15132 25.40299,-2.95883 37.5,-7.21989 26.87627,-9.46693 50.11187,-28.14178 67.51814,-54.2655 13.57853,-20.37894 21.48528,-41.1259 26.6773,-70 2.03288,-11.30539 2.18055,-15.76554 2.55103,-77.05345 l 0.39324,-65.05344 -6.53642,-9.77644 c -13.48069,-20.16286 -24.85338,-46.31958 -29.453,-67.74069 -5.19116,-24.17599 -5.46658,-54.86641 -0.69678,-77.64482 5.473,-26.13656 17.59682,-54.64244 32.84147,-77.21781 C 363.2819,181.59012 364,179.60347 364,175.76335 364,173.14351 363.75344,171 363.45209,171 c -0.30136,0 -25.83886,-2.92478 -56.75,-6.49952 -30.91115,-3.57474 -56.98959,-6.49974 -57.95209,-6.5 -1.66034,-4.6e-4 -1.75042,9.49056 -1.7582,185.24952 -0.005,114.16095 -0.38339,188.51185 -0.98589,193.75 -1.88053,16.34944 -6.97498,29.9496 -14.51265,38.74297 -6.66867,7.7796 -21.26986,9.63606 -27.79833,3.5344 -6.78345,-6.33998 -12.48683,-24.64778 -14.68332,-47.13332 C 188.45523,526.44827 188,512.61077 188,501.39405 c 0,-18.7605 -0.14017,-20.39315 -1.75,-20.38286 -1.50305,0.01 -79.08796,6.02092 -101.418642,7.85795 -4.217754,0.34697 -7.952282,0.91539 -8.298952,1.26314 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.45,0.81707 10,0.89321 0.55,0.0761 7.3,-0.31448 15,-0.86804 z m 138.31005,-7.12655 c 10.5286,-9.84898 22.86011,-14.14925 29.9947,-10.45981 4.15348,2.14785 5.19525,4.36067 5.19525,11.03523 l 0,5.56574 18.08333,0 c 9.94584,0 17.93334,-0.38299 17.75,-0.85109 C 438.65,689.68081 427.475,665.83232 414,637.15226 c -22.97818,-48.90653 -24.55441,-51.94389 -25.37588,-48.89891 -3.03338,11.24391 -10.43404,31.76164 -14.61033,40.50591 -9.36567,19.60976 -20.70412,34.96393 -38.3931,51.99074 l -10.64863,10.25 18.13654,0 18.13654,0 6.56491,-6.14116 z m 25.91167,2.10306 c -0.84481,-6.29853 -3.07596,-8.96364 -7.49477,-8.95252 -4.47444,0.0113 -12.2664,4.27374 -17.17312,9.39428 L 365.60767,691 l 14.32783,0 14.32784,0 -0.54162,-4.0381 z m 6.4338,1.2881 c 0.41632,-7.36133 -1.16826,-10.53441 -5.84711,-11.70873 -3.47113,-0.8712 -3.90132,-0.0941 -1.42141,2.56782 1.14846,1.23272 2.35377,3.84998 2.67847,5.81611 0.88353,5.35003 1.22989,6.0748 2.90315,6.0748 0.96623,0 1.58878,-1.01488 1.6869,-2.75 z m 197.75917,-14.39867 c 19.77883,-10.81773 38.06582,-27.30804 48.80942,-44.01394 2.07674,-3.22926 5.49261,-8.51755 7.59082,-11.75176 2.09822,-3.23422 5.84116,-11.66407 8.31765,-18.73301 8.29815,-23.68642 7.75118,-10.64957 8.09129,-192.85262 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.72287,-0.3417 -2.23155,-0.0936 -1.84952,0.9019 0.46191,1.20372 66.84429,110.91922 70.36602,116.29958 1.29628,1.98041 0.6457,2.46028 -14.83725,10.94397 -20.88457,11.44346 -39.50053,22.73662 -53.30212,32.33515 -12.24956,8.51914 -28.501,23.76519 -28.50002,26.73687 10e-4,3.75569 8.95745,13.21159 24.10985,25.45501 31.89454,25.77137 52.04629,45.15386 69.61521,66.95778 8.19943,10.17591 20.50998,28.05811 25.30359,36.7558 1.29003,2.34069 2.59869,3.8769 2.90812,3.4138 0.90413,-1.35314 7.07142,-3.1696 10.76148,-3.1696 4.08198,0 8.85485,2.29763 10.27148,4.94461 2.70464,5.05367 -1.03589,22.52848 -5.95173,27.80502 -1.77581,1.9061 -1.74328,2.24903 1.12473,11.85662 6.38009,21.37276 9.06734,48.26899 6.93324,69.39375 -4.79559,47.47003 -24.07322,87.01088 -60.82024,124.75 -5.4893,5.6375 -9.7435,10.25 -9.45377,10.25 0.28974,0 3.94018,-1.8669 8.1121,-4.14867 z m 53.11711,-78.03797 c 0.036,-3.74718 1.25185,-5.67198 5.21048,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.04489,0.29649 -3.21637,0.13504 -3.18628,-3 z m 6.44252,-1.7637 C 659.37257,590.37885 659.42789,588 657.61501,588 655.85111,588 653,592.3028 653,594.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 564.53149,345.05095 c -0.35561,-0.57539 1.28123,-3.28421 3.63743,-6.01959 3.34683,-3.88543 4.46409,-4.65161 5.10724,-3.50237 1.03782,1.85447 5.26369,4.00298 9.43016,4.79446 2.83923,0.53934 3.84766,0.0229 8.80784,-4.51038 11.61476,-10.61525 12.67882,-20.98767 2.91686,-28.43348 -2.78234,-2.1222 -4.71519,-2.73795 -8.75105,-2.78785 -2.84899,-0.0352 -5.85497,0.26982 -6.67997,0.67789 -1.08479,0.53656 -2.05377,-0.29768 -3.50058,-3.01385 -2.23043,-4.18728 -9.70681,-9.66365 -15.32211,-11.22327 -2.02252,-0.56175 -8.04915,-1.02387 -13.39251,-1.02693 -9.41629,-0.005 -9.82253,0.0886 -13.20317,3.05689 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -1.61762,-0.99974 -1.16476,-3.77668 1.48209,-9.08822 7.24361,-14.53603 23.29397,-22.25212 37.58701,-18.06968 6.96008,2.03667 12.32322,6.51319 15.58563,13.00908 1.42223,2.83185 2.71492,5.2945 2.87264,5.47256 0.15772,0.17805 1.79109,-0.46237 3.6297,-1.42315 4.76155,-2.4882 14.22198,-2.32296 19.34293,0.33786 7.16195,3.72132 11.5,9.81289 11.5,16.14851 0,17.39358 -23.22166,32.50916 -38.54616,25.09069 -4.65754,-2.25467 -4.73502,-2.25879 -6.33453,-0.3369 -2.71142,3.25791 -4.86838,4.57429 -5.58782,3.4102 z m 36.29919,-10.04326 c 8.98729,-6.51036 12.67849,-17.68698 8.19873,-24.82503 -2.5547,-4.07068 -11.48566,-8.45992 -16.26072,-7.99156 l -3.26869,0.32061 4,2.14683 c 12.61496,6.77053 14.15666,19.47958 3.71095,30.59146 -3.40971,3.62716 -1.55007,3.50268 3.61973,-0.24231 z m -32.84562,-45.0659 c -3.45168,-2.66882 -8.44175,-3.93233 -15.48506,-3.9209 -9.54954,0.0155 -9.74428,1.61957 -0.2684,2.21075 5.15829,0.32181 10.08705,1.28222 12.82352,2.49876 5.17682,2.30143 6.47463,1.95211 2.92994,-0.78861 z M 412,567.01942 c 29.03977,-13.62539 45.15179,-24.20093 53.45157,-35.08432 l 3.9462,-5.17459 -3.19179,-6.13026 C 460.45037,509.57584 447.0921,495.82113 425,478.20141 c -5.225,-4.16724 -13.84094,-11.30179 -19.14653,-15.85455 l -9.64652,-8.27775 -0.49964,47.21544 c -0.47427,44.81907 -1.33979,59.57583 -4.28477,73.05351 -0.5514,2.52351 -0.41522,2.73023 1.22866,1.86519 1.01684,-0.53508 9.7238,-4.66781 19.3488,-9.18383 z m -4.9682,-57.20606 c 0.036,-3.74718 1.25185,-5.67198 5.21048,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.04489,0.29649 -3.21637,0.13504 -3.18628,-3 z m 6.44252,-1.7637 C 415.37257,504.37885 415.42789,502 413.61501,502 411.85111,502 409,506.3028 409,508.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.43963,-6.88785 c 0.90701,-6.0484 0.0735,-12.81878 -1.96029,-15.92272 C 646.25403,434.45807 645.15098,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.92387 4.93043,11.5 0,0.57612 0.42243,1.0475 0.93873,1.0475 0.5163,0 1.24663,-2.05328 1.62297,-4.56285 z M 151.88914,450.5 C 184.53492,448.025 211.63996,446 212.12256,446 212.61384,446 213,424.496 213,397.13768 l 0,-48.86232 -5.2672,-0.61905 c -8.63029,-1.01432 -14.7355,-3.60637 -19.34033,-8.21121 -4.96059,-4.96059 -6.38379,-9.19002 -6.37502,-18.9451 0.018,-20.04584 12.07704,-38.23581 27.48255,-41.45499 l 3,-0.62689 0.25608,-78.78718 0.25607,-78.78718 2.74393,0.5367 c 1.50915,0.29519 42.45962,4.91144 91.00102,10.25833 l 88.25711,9.72162 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -12,2.76488 c -20.37087,4.69357 -39.1468,13.21491 -54.33513,24.65966 -13.51381,10.18296 -30.24918,28.50329 -35.69615,39.07684 -0.97083,1.88455 -2.77618,4.77646 -4.0119,6.42646 -2.6099,3.48491 -7.88916,15.61023 -8.960577,20.58051 -0.405416,1.88072 -1.316194,4.55395 -2.023952,5.94051 -0.707758,1.38656 -2.092611,6.56156 -3.077451,11.5 -1.643032,8.23892 -1.818243,18.14841 -2.125782,120.22898 -0.184341,61.1875 -0.200329,111.25 -0.03553,111.25 0.164799,0 27.009822,-2.025 59.655612,-4.5 z M 97.031803,389.81336 c 0.03597,-3.74718 1.25185,-5.67198 5.210477,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.044894,0.29649 -3.216368,0.13504 -3.186277,-3 z m 6.442517,-1.7637 C 105.37257,384.37885 105.42789,382 103.61501,382 101.85111,382 99,386.3028 99,388.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 133.85853,242.8425 c -2.00281,-1.16136 -4.64033,-3.88879 -5.86115,-6.06095 -6.06994,-10.80001 3.43243,-33.70011 16.75768,-40.38492 4.35152,-2.18301 6.24283,-2.56183 11,-2.20328 17.1483,1.29249 23.45381,13.66904 15.31683,30.06409 -3.90845,7.87506 -11.1073,15.6131 -17.32564,18.62335 -5.93237,2.87181 -14.8989,2.85455 -19.88772,-0.0383 z m 16.81972,-0.88018 c 2.29582,-0.80033 3.90743,-2.80179 7.04563,-8.75 6.94154,-13.15711 7.46095,-23.25939 1.51565,-29.47827 -5.73617,-6.00012 -16.43276,-5.58027 -22.00788,0.86385 -8.05461,9.31006 -11.55103,23.96522 -7.47347,31.32483 3.42116,6.17488 12.78074,8.87697 20.92007,6.03959 z m 18.00761,-18.70935 c 1.35192,-2.88586 2.70554,-7.64519 3.00806,-10.57628 0.51401,-4.98027 0.33023,-5.57959 -2.80632,-9.15193 -3.655,-4.16282 -8.24773,-6.53408 -12.60548,-6.50831 -2.69624,0.0159 -2.65956,0.0859 1.18831,2.26523 7.81234,4.42477 10.97815,13.4375 8.15566,23.21832 -3.03475,10.51634 -3.00108,10.2684 -1.08639,8 0.92847,-1.1 2.79425,-4.36116 4.14616,-7.24703 z M 655.0831,448.75 c 1.75263,-6.42021 1.48919,-11.62776 -0.69674,-13.77281 -2.2918,-2.24895 -7.38636,-3.68744 -7.38636,-2.0856 0,0.60963 0.39873,1.10841 0.88606,1.10841 1.85214,0 4.32737,7.41491 4.38115,13.12437 0.0304,3.23159 0.41543,5.87563 0.85552,5.87563 0.4401,0 1.32227,-1.9125 1.96037,-4.25 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 -10.20449,8.58651 -15.8451,33.04919 -10.18068,44.15239 3.42512,6.71379 13.31192,11.97615 22.87357,12.17472 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-1.2702 -3.03451,-1.2702 -5,0 -1.13826,0.7356 -0.71622,0.97307 1.75,0.98469 C 211.5375,283.99311 213,283.55 213,283 z"
+       id="path3390"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#454839"
+       d="m 459.40089,733.75 -8.04454,-17.25 -86.42817,0 -86.42818,0 -9,2.80013 c -16.01745,4.98345 -29.92557,6.91119 -50.5,6.99958 -19.87358,0.0854 -29.7479,-0.97706 -45.5,-4.89565 -27.0332,-6.72494 -50.36455,-20.1896 -71.14151,-41.05616 C 70.001666,647.85153 52.620419,607.23188 45.940445,548.5 45.377448,543.55 44.65155,521.45541 44.327338,499.40091 l -0.589475,-40.0991 2.381068,-0.63725 c 1.309588,-0.35049 4.455762,-0.6434 6.991498,-0.65091 2.535736,-0.008 6.683596,-0.29781 9.217466,-0.64511 l 4.607038,-0.63147 0.327809,-112.61853 C 67.587552,232.52999 67.610787,231.3994 69.803204,220.5 76.574459,186.83734 91.503219,159.34232 116.07022,135.28778 126.2905,125.2807 144.00716,111 146.20169,111 c 0.61024,0 2.502,-1.05841 4.20392,-2.35203 3.04416,-2.31384 21.78237,-10.458686 30.59439,-13.298304 2.475,-0.797554 10.35,-2.87948 17.5,-4.626503 l 13,-3.176407 124.86928,-0.303207 124.86929,-0.303208 15.63071,-8.867007 C 507.95773,60.437452 508.47322,60.17089 509.19493,61.357463 509.57714,61.985858 513.21268,67.9 517.27391,74.5 l 7.38404,12 12.92103,0.716072 c 17.7383,0.983042 33.67226,3.989032 48.45284,9.140776 16.43851,5.729612 19.12901,7.104082 38.45116,19.643152 15.19015,9.85761 38.28307,34.09349 46.68917,49 1.39571,2.475 4.18847,7.19101 6.20614,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.18182,19.40842 -4.26871,24.17236 -8.09932,35.5 -4.41981,13.06997 -8.6546,22.4285 -12.44393,27.5 -1.23284,1.65 -2.9983,4.46929 -3.92323,6.26509 -6.12955,11.90081 -25.6121,32.79651 -42.11473,45.1695 -12.19923,9.14648 -34.22583,20.09918 -49.5,24.61381 -8.08623,2.39007 -27.35062,6.26535 -34.28349,6.89655 -5.47112,0.49813 -7.99615,1.35984 -13.05153,4.45407 -11.37093,6.95978 -30.91613,16.85678 -47.4615,24.03285 C 475.24039,747.81934 467.80312,751 467.67619,751 c -0.12692,0 -3.8508,-7.7625 -8.2753,-17.25 z m 44.09727,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 39.09864,-37.3297 57.40143,-79.96214 55.33404,-128.88877 C 626.66457,497.17869 621.85891,478.80988 610.51801,455.5 593.3682,420.25058 566.18295,389.30086 519.5,351.8783 c -25.86219,-20.73196 -38.58854,-38.16152 -38.75719,-53.08046 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52203,-5.73805 9.82069,-6.22129 0.29865,-0.48323 -13.73561,-24.38261 -31.18725,-53.10973 -27.85546,-45.85284 -34.44321,-56.40356 -37.52724,-60.10242 -1.23146,-1.47696 -22.22657,11.19288 -37.17886,22.43619 -22.22762,16.71395 -41.43638,34.96832 -58.85956,55.93511 -2.51374,3.025 -4.74481,5.95 -4.95794,6.5 -0.21313,0.55 -3.69964,5.95 -7.74779,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.40768,1.88465 -4.86914,16.69801 -6.51201,27.86821 -3.21318,21.84703 -0.005,55.81318 6.62258,70.1216 1.01907,2.2 3.62973,8.14054 5.80147,13.2012 9.79175,22.81708 29.78309,49.99506 50.3096,68.39529 C 430.9023,440.75352 439.5547,448 440.31236,448 c 0.3282,0 1.66414,1.0125 2.96876,2.25 1.30461,1.2375 6.93762,6.0105 12.51779,10.60667 27.51249,22.66094 44.85747,46.00293 46.88122,63.09036 0.68008,5.74221 -1.72253,15.5322 -5.36674,21.86804 -7.30138,12.69417 -28.97505,29.76907 -53.71245,42.31561 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.21707,595.39118 483.41884,707 484.6601,707 c 0.33522,0 8.81234,-4.23268 18.83806,-9.40596 z M 229.5,691.98539 c 16.01485,-1.15132 25.40299,-2.95883 37.5,-7.21989 26.87627,-9.46693 50.11187,-28.14178 67.51814,-54.2655 13.57853,-20.37894 21.48528,-41.1259 26.6773,-70 2.03307,-11.30641 2.18053,-15.76421 2.55127,-77.1254 l 0.39349,-65.12539 -6.54481,-9.72049 C 345.0495,389.89528 335.06682,367.77836 329.4355,346.1396 c -6.83657,-26.26996 -7.20557,-60.35968 -0.95103,-87.8598 4.59432,-20.20043 16.17275,-47.28374 28.84401,-67.46952 C 363.04517,181.70339 364,179.52522 364,175.59115 364,173.06602 363.75344,171 363.45209,171 c -0.30136,0 -25.83886,-2.92478 -56.75,-6.49952 -30.91115,-3.57474 -56.98959,-6.49974 -57.95209,-6.5 -1.66034,-4.6e-4 -1.75042,9.49056 -1.7582,185.24952 -0.005,114.16095 -0.38339,188.51185 -0.98589,193.75 -1.88053,16.34944 -6.97498,29.9496 -14.51265,38.74297 -6.66867,7.7796 -21.26986,9.63606 -27.79833,3.5344 -6.78345,-6.33998 -12.48683,-24.64778 -14.68332,-47.13332 C 188.45523,526.44827 188,512.61077 188,501.39405 c 0,-18.7605 -0.14017,-20.39315 -1.75,-20.38286 -1.50305,0.01 -79.08796,6.02092 -101.418642,7.85795 -4.217754,0.34697 -7.952282,0.91539 -8.298952,1.26314 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.45,0.81707 10,0.89321 0.55,0.0761 7.3,-0.31448 15,-0.86804 z m 138.31005,-7.12655 c 10.5286,-9.84898 22.86011,-14.14925 29.9947,-10.45981 4.15348,2.14785 5.19525,4.36067 5.19525,11.03523 l 0,5.56574 18.08333,0 c 9.94584,0 17.93334,-0.38299 17.75,-0.85109 C 438.65,689.68081 427.475,665.83232 414,637.15226 c -22.97818,-48.90653 -24.55441,-51.94389 -25.37588,-48.89891 -3.03338,11.24391 -10.43404,31.76164 -14.61033,40.50591 -9.36567,19.60976 -20.70412,34.96393 -38.3931,51.99074 l -10.64863,10.25 18.13654,0 18.13654,0 6.56491,-6.14116 z m 25.91167,2.10306 c -0.84481,-6.29853 -3.07596,-8.96364 -7.49477,-8.95252 -4.47444,0.0113 -12.2664,4.27374 -17.17312,9.39428 L 365.60767,691 l 14.32783,0 14.32784,0 -0.54162,-4.0381 z m 6.4338,1.2881 c 0.41632,-7.36133 -1.16826,-10.53441 -5.84711,-11.70873 -3.47113,-0.8712 -3.90132,-0.0941 -1.42141,2.56782 1.14846,1.23272 2.35377,3.84998 2.67847,5.81611 0.88353,5.35003 1.22989,6.0748 2.90315,6.0748 0.96623,0 1.58878,-1.01488 1.6869,-2.75 z m 197.75917,-14.39867 c 19.77883,-10.81773 38.06582,-27.30804 48.80942,-44.01394 2.07674,-3.22926 5.49261,-8.51755 7.59082,-11.75176 2.09822,-3.23422 5.84116,-11.66407 8.31765,-18.73301 8.29815,-23.68642 7.75118,-10.64957 8.09129,-192.85262 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.72287,-0.3417 -2.23155,-0.0936 -1.84952,0.9019 0.46191,1.20372 66.84429,110.91922 70.36602,116.29958 1.29628,1.98041 0.6457,2.46028 -14.83725,10.94397 -20.88457,11.44346 -39.50053,22.73662 -53.30212,32.33515 -12.24956,8.51914 -28.501,23.76519 -28.50002,26.73687 10e-4,3.75569 8.95745,13.21159 24.10985,25.45501 31.89454,25.77137 52.04629,45.15386 69.61521,66.95778 8.19943,10.17591 20.50998,28.05811 25.30359,36.7558 1.29003,2.34069 2.59869,3.8769 2.90812,3.4138 0.90413,-1.35314 7.07142,-3.1696 10.76148,-3.1696 4.08198,0 8.85485,2.29763 10.27148,4.94461 2.70464,5.05367 -1.03589,22.52848 -5.95173,27.80502 -1.77581,1.9061 -1.74328,2.24903 1.12473,11.85662 6.38009,21.37276 9.06734,48.26899 6.93324,69.39375 -4.79559,47.47003 -24.07322,87.01088 -60.82024,124.75 -5.4893,5.6375 -9.7435,10.25 -9.45377,10.25 0.28974,0 3.94018,-1.8669 8.1121,-4.14867 z m 53.11711,-78.03797 c 0.036,-3.74718 1.25185,-5.67198 5.21048,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.04489,0.29649 -3.21637,0.13504 -3.18628,-3 z m 6.44252,-1.7637 C 659.37257,590.37885 659.42789,588 657.61501,588 655.85111,588 653,592.3028 653,594.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 564.53149,345.05095 c -0.35561,-0.57539 1.28123,-3.28421 3.63743,-6.01959 3.34683,-3.88543 4.46409,-4.65161 5.10724,-3.50237 1.03782,1.85447 5.26369,4.00298 9.43016,4.79446 2.83923,0.53934 3.84766,0.0229 8.80784,-4.51038 11.61476,-10.61525 12.67882,-20.98767 2.91686,-28.43348 -2.78234,-2.1222 -4.71519,-2.73795 -8.75105,-2.78785 -2.84899,-0.0352 -5.85497,0.26982 -6.67997,0.67789 -1.08479,0.53656 -2.05377,-0.29768 -3.50058,-3.01385 -2.23043,-4.18728 -9.70681,-9.66365 -15.32211,-11.22327 -2.02252,-0.56175 -8.04915,-1.02387 -13.39251,-1.02693 -9.41629,-0.005 -9.82253,0.0886 -13.20317,3.05689 C 530.22432,296.01023 524,306.83031 524,309.71874 c 0,0.76961 -0.45,1.12118 -1,0.78126 -1.61762,-0.99974 -1.16476,-3.77668 1.48209,-9.08822 7.24361,-14.53603 23.29397,-22.25212 37.58701,-18.06968 6.96008,2.03667 12.32322,6.51319 15.58563,13.00908 1.42223,2.83185 2.71492,5.2945 2.87264,5.47256 0.15772,0.17805 1.79109,-0.46237 3.6297,-1.42315 4.76155,-2.4882 14.22198,-2.32296 19.34293,0.33786 7.16195,3.72132 11.5,9.81289 11.5,16.14851 0,17.39358 -23.22166,32.50916 -38.54616,25.09069 -4.65754,-2.25467 -4.73502,-2.25879 -6.33453,-0.3369 -2.71142,3.25791 -4.86838,4.57429 -5.58782,3.4102 z m 36.29919,-10.04326 c 8.98729,-6.51036 12.67849,-17.68698 8.19873,-24.82503 -2.5547,-4.07068 -11.48566,-8.45992 -16.26072,-7.99156 l -3.26869,0.32061 4,2.14683 c 12.61496,6.77053 14.15666,19.47958 3.71095,30.59146 -3.40971,3.62716 -1.55007,3.50268 3.61973,-0.24231 z m -32.84562,-45.0659 c -3.45168,-2.66882 -8.44175,-3.93233 -15.48506,-3.9209 -9.54954,0.0155 -9.74428,1.61957 -0.2684,2.21075 5.15829,0.32181 10.08705,1.28222 12.82352,2.49876 5.17682,2.30143 6.47463,1.95211 2.92994,-0.78861 z M 412,567.01942 c 29.03977,-13.62539 45.15179,-24.20093 53.45157,-35.08432 l 3.9462,-5.17459 -3.19179,-6.13026 C 460.45037,509.57584 447.0921,495.82113 425,478.20141 c -5.225,-4.16724 -13.84094,-11.30179 -19.14653,-15.85455 l -9.64652,-8.27775 -0.49964,47.21544 c -0.47427,44.81907 -1.33979,59.57583 -4.28477,73.05351 -0.5514,2.52351 -0.41522,2.73023 1.22866,1.86519 1.01684,-0.53508 9.7238,-4.66781 19.3488,-9.18383 z m -4.9682,-57.20606 c 0.036,-3.74718 1.25185,-5.67198 5.21048,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.04489,0.29649 -3.21637,0.13504 -3.18628,-3 z m 6.44252,-1.7637 C 415.37257,504.37885 415.42789,502 413.61501,502 411.85111,502 409,506.3028 409,508.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.43963,-6.88785 c 0.90701,-6.0484 0.0735,-12.81878 -1.96029,-15.92272 C 646.25403,434.45807 645.15098,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.92387 4.93043,11.5 0,0.57612 0.42243,1.0475 0.93873,1.0475 0.5163,0 1.24663,-2.05328 1.62297,-4.56285 z M 151.88914,450.5 C 184.53492,448.025 211.63996,446 212.12256,446 212.61384,446 213,424.496 213,397.13768 l 0,-48.86232 -5.2672,-0.61905 c -8.63029,-1.01432 -14.7355,-3.60637 -19.34033,-8.21121 -4.96059,-4.96059 -6.38379,-9.19002 -6.37502,-18.9451 0.018,-20.04584 12.07704,-38.23581 27.48255,-41.45499 l 3,-0.62689 0.25608,-78.78718 0.25607,-78.78718 2.74393,0.5367 c 1.50915,0.29519 42.45962,4.91144 91.00102,10.25833 l 88.25711,9.72162 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -12,2.76488 c -28.68996,6.61034 -50.69225,18.92236 -71.39704,39.95229 -8.34026,8.47124 -11.62657,12.7851 -21.97124,28.84114 -3.37777,5.24267 -8.54958,16.94256 -9.596705,21.71011 -0.384091,1.74875 -1.307039,4.41252 -2.050997,5.91949 -0.743957,1.50696 -2.154437,6.78993 -3.1344,11.73993 -1.631785,8.24249 -1.808431,18.36363 -2.098738,120.25 C 92.076538,404.9375 92.068729,455 92.23353,455 c 0.164799,0 27.00982,-2.025 59.65561,-4.5 z M 97.031803,389.81336 c 0.03597,-3.74718 1.25185,-5.67198 5.210477,-8.24845 5.54842,-3.61119 7.75269,1.16872 3.4758,7.53721 -1.67139,2.48876 -3.14294,3.48172 -5.5,3.71124 -3.044894,0.29649 -3.216368,0.13504 -3.186277,-3 z m 6.442517,-1.7637 C 105.37257,384.37885 105.42789,382 103.61501,382 101.85111,382 99,386.3028 99,388.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 133.85853,242.8425 c -2.00281,-1.16136 -4.64033,-3.88879 -5.86115,-6.06095 -6.06994,-10.80001 3.43243,-33.70011 16.75768,-40.38492 4.35152,-2.18301 6.24283,-2.56183 11,-2.20328 17.1483,1.29249 23.45381,13.66904 15.31683,30.06409 -3.90845,7.87506 -11.1073,15.6131 -17.32564,18.62335 -5.93237,2.87181 -14.8989,2.85455 -19.88772,-0.0383 z m 16.81972,-0.88018 c 2.29582,-0.80033 3.90743,-2.80179 7.04563,-8.75 6.94154,-13.15711 7.46095,-23.25939 1.51565,-29.47827 -5.73617,-6.00012 -16.43276,-5.58027 -22.00788,0.86385 -8.05461,9.31006 -11.55103,23.96522 -7.47347,31.32483 3.42116,6.17488 12.78074,8.87697 20.92007,6.03959 z m 18.00761,-18.70935 c 1.35192,-2.88586 2.70554,-7.64519 3.00806,-10.57628 0.51401,-4.98027 0.33023,-5.57959 -2.80632,-9.15193 -3.655,-4.16282 -8.24773,-6.53408 -12.60548,-6.50831 -2.69624,0.0159 -2.65956,0.0859 1.18831,2.26523 7.81234,4.42477 10.97815,13.4375 8.15566,23.21832 -3.03475,10.51634 -3.00108,10.2684 -1.08639,8 0.92847,-1.1 2.79425,-4.36116 4.14616,-7.24703 z M 655.0831,448.75 c 1.75263,-6.42021 1.48919,-11.62776 -0.69674,-13.77281 -2.2918,-2.24895 -7.38636,-3.68744 -7.38636,-2.0856 0,0.60963 0.39873,1.10841 0.88606,1.10841 1.85214,0 4.32737,7.41491 4.38115,13.12437 0.0304,3.23159 0.41543,5.87563 0.85552,5.87563 0.4401,0 1.32227,-1.9125 1.96037,-4.25 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 -10.20449,8.58651 -15.8451,33.04919 -10.18068,44.15239 3.42512,6.71379 13.31192,11.97615 22.87357,12.17472 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-1.2702 -3.03451,-1.2702 -5,0 -1.13826,0.7356 -0.71622,0.97307 1.75,0.98469 C 211.5375,283.99311 213,283.55 213,283 z"
+       id="path3388"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#4a4634"
+       d="m 459.40089,733.75 -8.04454,-17.25 -86.42817,0 -86.42818,0 -9,2.80013 c -16.01745,4.98345 -29.92557,6.91119 -50.5,6.99958 -19.87358,0.0854 -29.7479,-0.97706 -45.5,-4.89565 -27.0332,-6.72494 -50.36455,-20.1896 -71.14151,-41.05616 C 70.001666,647.85153 52.620419,607.23188 45.940445,548.5 45.377448,543.55 44.65155,521.45541 44.327338,499.40091 l -0.589475,-40.0991 2.381068,-0.63725 c 1.309588,-0.35049 4.455762,-0.6434 6.991498,-0.65091 2.535736,-0.008 6.683596,-0.29781 9.217466,-0.64511 l 4.607038,-0.63147 0.327809,-112.61853 C 67.587552,232.52999 67.610787,231.3994 69.803204,220.5 76.574459,186.83734 91.503219,159.34232 116.07022,135.28778 126.2905,125.2807 144.00716,111 146.20169,111 c 0.61024,0 2.502,-1.05841 4.20392,-2.35203 3.04416,-2.31384 21.78237,-10.458686 30.59439,-13.298304 2.475,-0.797554 10.35,-2.87948 17.5,-4.626503 l 13,-3.176407 124.86928,-0.303207 124.86929,-0.303208 15.63071,-8.867007 C 507.95773,60.437452 508.47322,60.17089 509.19493,61.357463 509.57714,61.985858 513.21268,67.9 517.27391,74.5 l 7.38404,12 12.92103,0.716072 c 17.7383,0.983042 33.67226,3.989032 48.45284,9.140776 16.43851,5.729612 19.12901,7.104082 38.45116,19.643152 15.19015,9.85761 38.28307,34.09349 46.68917,49 1.39571,2.475 4.18847,7.19101 6.20614,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.18182,19.40842 -4.26871,24.17236 -8.09932,35.5 -4.41981,13.06997 -8.6546,22.4285 -12.44393,27.5 -1.23284,1.65 -2.9983,4.46929 -3.92323,6.26509 -6.12955,11.90081 -25.6121,32.79651 -42.11473,45.1695 -12.19923,9.14648 -34.22583,20.09918 -49.5,24.61381 -8.08623,2.39007 -27.35062,6.26535 -34.28349,6.89655 -5.47112,0.49813 -7.99615,1.35984 -13.05153,4.45407 -11.37093,6.95978 -30.91613,16.85678 -47.4615,24.03285 C 475.24039,747.81934 467.80312,751 467.67619,751 c -0.12692,0 -3.8508,-7.7625 -8.2753,-17.25 z m 44.09727,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 39.09864,-37.3297 57.40143,-79.96214 55.33404,-128.88877 C 626.66457,497.17869 621.85891,478.80988 610.51801,455.5 593.3682,420.25058 566.18295,389.30086 519.5,351.8783 c -25.86219,-20.73196 -38.58854,-38.16152 -38.75719,-53.08046 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52203,-5.73805 9.82069,-6.22129 0.29865,-0.48323 -13.73561,-24.38261 -31.18725,-53.10973 -27.85546,-45.85284 -34.44321,-56.40356 -37.52724,-60.10242 -1.23146,-1.47696 -22.22657,11.19288 -37.17886,22.43619 -22.22762,16.71395 -41.43638,34.96832 -58.85956,55.93511 -2.51374,3.025 -4.74481,5.95 -4.95794,6.5 -0.21313,0.55 -3.69964,5.95 -7.74779,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.40768,1.88465 -4.86914,16.69801 -6.51201,27.86821 -3.21318,21.84703 -0.005,55.81318 6.62258,70.1216 1.01907,2.2 3.62973,8.14054 5.80147,13.2012 9.79175,22.81708 29.78309,49.99506 50.3096,68.39529 C 430.9023,440.75352 439.5547,448 440.31236,448 c 0.3282,0 1.66414,1.0125 2.96876,2.25 1.30461,1.2375 6.93762,6.0105 12.51779,10.60667 27.51249,22.66094 44.85747,46.00293 46.88122,63.09036 0.68008,5.74221 -1.72253,15.5322 -5.36674,21.86804 -7.30138,12.69417 -28.97505,29.76907 -53.71245,42.31561 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.21707,595.39118 483.41884,707 484.6601,707 c 0.33522,0 8.81234,-4.23268 18.83806,-9.40596 z M 229.5,691.98539 c 16.01485,-1.15132 25.40299,-2.95883 37.5,-7.21989 26.87627,-9.46693 50.11187,-28.14178 67.51814,-54.2655 13.57853,-20.37894 21.48528,-41.1259 26.6773,-70 2.03307,-11.30641 2.18053,-15.76421 2.55127,-77.1254 l 0.39349,-65.12539 -6.54481,-9.72049 C 345.0495,389.89528 335.06682,367.77836 329.4355,346.1396 c -6.83657,-26.26996 -7.20557,-60.35968 -0.95103,-87.8598 4.59432,-20.20043 16.17275,-47.28374 28.84401,-67.46952 C 363.04517,181.70339 364,179.52522 364,175.59115 364,173.06602 363.75344,171 363.45209,171 c -0.30136,0 -25.83886,-2.92478 -56.75,-6.49952 -30.91115,-3.57474 -56.98959,-6.49974 -57.95209,-6.5 -1.66034,-4.6e-4 -1.75042,9.49056 -1.7582,185.24952 -0.005,114.16095 -0.38339,188.51185 -0.98589,193.75 -1.88053,16.34944 -6.97498,29.9496 -14.51265,38.74297 -6.66867,7.7796 -21.26986,9.63606 -27.79833,3.5344 -6.78345,-6.33998 -12.48683,-24.64778 -14.68332,-47.13332 C 188.45523,526.44827 188,512.61077 188,501.39405 c 0,-18.7605 -0.14017,-20.39315 -1.75,-20.38286 -1.50305,0.01 -79.08796,6.02092 -101.418642,7.85795 -4.217754,0.34697 -7.952282,0.91539 -8.298952,1.26314 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.45,0.81707 10,0.89321 0.55,0.0761 7.3,-0.31448 15,-0.86804 z m 137.40959,-6.3054 c 12.84913,-12.22765 26.83323,-16.02808 33.70214,-9.15917 1.99096,1.99096 2.38827,3.39399 2.38827,8.43373 l 0,6.04545 18.08333,0 c 9.94584,0 17.93334,-0.38299 17.75,-0.85109 C 438.65,689.68081 427.475,665.83232 414,637.15226 c -22.97818,-48.90653 -24.55441,-51.94389 -25.37588,-48.89891 -3.03338,11.24391 -10.43404,31.76164 -14.61033,40.50591 -9.36567,19.60976 -20.70412,34.96393 -38.3931,51.99074 l -10.64863,10.25 18.17356,0 18.17355,0 5.59042,-5.32001 z m 26.81213,1.28191 c -0.84481,-6.29853 -3.07596,-8.96364 -7.49477,-8.95252 -4.47444,0.0113 -12.2664,4.27374 -17.17312,9.39428 L 365.60767,691 l 14.32783,0 14.32784,0 -0.54162,-4.0381 z m 6.59597,0.46783 c 0.96668,-5.95695 -1.22846,-9.61628 -6.57328,-10.95774 -3.29107,-0.82601 -3.47917,0.11699 -0.62859,3.15129 1.25284,1.3336 2.32556,4.11299 2.63005,6.81445 0.39116,3.47034 0.93047,4.56227 2.25334,4.56227 1.21922,0 1.9123,-1.0673 2.31848,-3.57027 z m 197.597,-13.5784 c 19.77883,-10.81773 38.06582,-27.30804 48.80942,-44.01394 2.07674,-3.22926 5.49261,-8.51755 7.59082,-11.75176 2.09822,-3.23422 5.84116,-11.66407 8.31765,-18.73301 8.29815,-23.68642 7.75118,-10.64957 8.09129,-192.85262 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.72287,-0.3417 -2.23155,-0.0936 -1.84952,0.9019 0.46191,1.20372 66.84429,110.91922 70.36602,116.29958 1.29628,1.98041 0.6457,2.46028 -14.83725,10.94397 -20.88457,11.44346 -39.50053,22.73662 -53.30212,32.33515 -12.24956,8.51914 -28.501,23.76519 -28.50002,26.73687 10e-4,3.75569 8.95745,13.21159 24.10985,25.45501 31.89454,25.77137 52.04629,45.15386 69.61521,66.95778 8.19943,10.17591 20.50998,28.05811 25.30359,36.7558 1.29003,2.34069 2.60951,3.82866 2.93216,3.3066 1.06933,-1.73022 9.48762,-3.38834 13.43908,-2.64704 2.10261,0.39445 4.94682,1.84107 6.32045,3.2147 2.26549,2.26549 2.46157,3.11868 2.11059,9.18373 -0.28312,4.89253 -1.26526,8.55683 -3.66106,13.65922 -1.80077,3.83515 -3.67006,7.2177 -4.15396,7.51677 -0.4839,0.29906 0.4612,5.03621 2.10022,10.52699 6.40708,21.46395 9.09748,48.32342 6.95984,69.48323 -4.79559,47.47003 -24.07322,87.01088 -60.82024,124.75 -5.4893,5.6375 -9.7435,10.25 -9.45377,10.25 0.28974,0 3.94018,-1.8669 8.1121,-4.14867 z M 651,595.96336 c 0,-3.74815 5.86762,-10.32493 8.72763,-9.78244 5.12472,0.97205 0.28522,12.06818 -5.50955,12.63244 -3.01195,0.29328 -3.21808,0.11073 -3.21808,-2.85 z m 6.47432,-1.9137 C 659.37257,590.37885 659.42789,588 657.61501,588 655.85111,588 653,592.3028 653,594.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 564.55519,345.0893 c -0.36865,-0.59649 1.25753,-3.32256 3.61373,-6.05794 3.34683,-3.88543 4.46409,-4.65161 5.10724,-3.50237 1.03782,1.85447 5.26369,4.00298 9.43016,4.79446 2.83923,0.53934 3.84766,0.0229 8.80784,-4.51038 11.61476,-10.61525 12.67882,-20.98767 2.91686,-28.43348 -2.78234,-2.1222 -4.71519,-2.73795 -8.75105,-2.78785 -2.84899,-0.0352 -5.85497,0.26982 -6.67997,0.67789 -1.08479,0.53656 -2.05377,-0.29768 -3.50058,-3.01385 -2.23043,-4.18728 -9.70681,-9.66365 -15.32211,-11.22327 -2.02252,-0.56175 -8.03028,-1.02387 -13.35058,-1.02693 -8.90625,-0.005 -9.91285,0.196 -12.69454,2.53664 -3.60589,3.03416 -6.72053,7.88117 -9.17041,14.27105 -1.40242,3.65784 -1.95142,4.29427 -2.50079,2.89902 -2.06871,-5.25391 8.54103,-19.61359 17.84892,-24.15751 14.45819,-7.05818 30.35634,-2.59953 36.92773,10.3564 1.5057,2.96859 2.92638,5.58618 3.15707,5.81686 0.23069,0.23069 1.92375,-0.36583 3.76236,-1.3256 4.68484,-2.44551 14.25345,-2.2586 19.38313,0.37862 4.75323,2.44368 8.9437,6.68972 10.39618,10.53404 5.51104,14.58618 -12.47454,33.9312 -30.1098,32.38566 -3.12038,-0.27347 -7.05228,-1.31172 -8.73754,-2.30723 l -3.06412,-1.81002 -3.39973,3.29515 c -2.11851,2.05334 -3.65233,2.88644 -4.07,2.21064 z m 34.34603,-8.53822 c 3.58467,-1.85371 8.95392,-7.96013 10.72388,-12.19623 4.46976,-10.69764 -2.37901,-20.67107 -15.18614,-22.11462 -4.74172,-0.53446 -6.26029,1.08583 -2.01603,2.15107 3.5404,0.88859 8.64483,5.52663 10.21304,9.27989 1.65763,3.96726 1.77158,10.67403 0.23184,13.64455 -0.62271,1.20134 -2.67784,4.09676 -4.56695,6.43426 -3.73289,4.61889 -3.65127,4.99969 0.60036,2.80108 z m -30.73124,-46.61225 c -3.19771,-2.59247 -8.54523,-3.9295 -15.66998,-3.91794 -9.54954,0.0155 -9.74428,1.61957 -0.2684,2.21075 5.15829,0.32181 10.08705,1.28222 12.82352,2.49876 5.12711,2.27933 6.47895,1.93579 3.11486,-0.79157 z M 412,567.01942 c 29.03977,-13.62539 45.15179,-24.20093 53.45157,-35.08432 l 3.9462,-5.17459 -3.19179,-6.13026 C 460.45037,509.57584 447.0921,495.82113 425,478.20141 c -5.225,-4.16724 -13.84094,-11.30179 -19.14653,-15.85455 l -9.64652,-8.27775 -0.49964,47.21544 c -0.47427,44.81907 -1.33979,59.57583 -4.28477,73.05351 -0.5514,2.52351 -0.41522,2.73023 1.22866,1.86519 1.01684,-0.53508 9.7238,-4.66781 19.3488,-9.18383 z m -5,-57.05606 c 0,-3.74815 5.86762,-10.32493 8.72763,-9.78244 5.12472,0.97205 0.28522,12.06818 -5.50955,12.63244 -3.01195,0.29328 -3.21808,0.11073 -3.21808,-2.85 z m 6.47432,-1.9137 C 415.37257,504.37885 415.42789,502 413.61501,502 411.85111,502 409,506.3028 409,508.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.43963,-6.88785 c 0.90701,-6.0484 0.0735,-12.81878 -1.96029,-15.92272 C 646.25403,434.45807 645.15098,434 641.54652,434 l -4.40737,0 4.93042,10.4525 c 2.71174,5.74887 4.93043,10.92387 4.93043,11.5 0,0.57612 0.42243,1.0475 0.93873,1.0475 0.5163,0 1.24663,-2.05328 1.62297,-4.56285 z M 151.88914,450.5 C 184.53492,448.025 211.63996,446 212.12256,446 212.61384,446 213,424.49237 213,397.12917 l 0,-48.87084 -5.92882,-0.67077 c -8.29014,-0.93792 -17.75263,-5.90856 -21.46597,-11.27607 -2.39246,-3.45822 -2.98224,-5.50596 -3.38261,-11.74463 -1.48007,-23.06257 9.6419,-40.44409 29.5274,-46.14569 0.98636,-0.28281 1.25,-16.93838 1.25,-78.96924 l 0,-78.61084 2.75,0.53804 c 1.5125,0.29592 42.4657,4.91277 91.0071,10.25966 l 88.25711,9.72162 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -12,2.76488 c -28.68996,6.61034 -50.69225,18.92236 -71.39704,39.95229 -8.34026,8.47124 -11.62657,12.7851 -21.97124,28.84114 -3.37777,5.24267 -8.54958,16.94256 -9.596705,21.71011 -0.384091,1.74875 -1.307039,4.41252 -2.050997,5.91949 -0.743957,1.50696 -2.154437,6.78993 -3.1344,11.73993 -1.631785,8.24249 -1.808431,18.36363 -2.098738,120.25 C 92.076538,404.9375 92.068729,455 92.23353,455 c 0.164799,0 27.00982,-2.025 59.65561,-4.5 z M 97,389.96336 c 0,-3.74815 5.86762,-10.32493 8.72763,-9.78244 5.12472,0.97205 0.28522,12.06818 -5.50955,12.63244 C 97.206133,393.10664 97,392.92409 97,389.96336 z m 6.47432,-1.9137 C 105.37257,384.37885 105.42789,382 103.61501,382 101.85111,382 99,386.3028 99,388.96482 c 0,3.02372 2.72575,2.46621 4.47432,-0.91516 z M 133.92168,242.7262 c -1.85575,-1.25058 -4.44095,-3.83808 -5.74488,-5.75 -5.26047,-7.71321 -0.49259,-24.56702 9.99078,-35.31604 8.09412,-8.29924 17.00218,-9.92507 26.90311,-4.91016 6.0939,3.08662 9.88486,8.45017 9.91286,14.02498 0.0534,10.63816 -10.96239,27.12692 -21.54927,32.25548 -5.85838,2.83795 -15.06286,2.69442 -19.5126,-0.30426 z m 16.75657,-0.76388 c 2.29582,-0.80033 3.90743,-2.80179 7.04563,-8.75 6.94154,-13.15711 7.46095,-23.25939 1.51565,-29.47827 -5.73617,-6.00012 -16.43276,-5.58027 -22.00788,0.86385 -8.05461,9.31006 -11.55103,23.96522 -7.47347,31.32483 3.42116,6.17488 12.78074,8.87697 20.92007,6.03959 z m 17.97364,-18.63514 c 3.3516,-7.15216 4.09294,-14.25769 1.87865,-18.0062 -2.44216,-4.13425 -7.69381,-7.41867 -12.7193,-7.95477 l -4.31124,-0.4599 3.65982,2.02447 c 7.89511,4.36727 11.23529,13.39685 8.54558,23.1015 -3.18215,11.48145 -3.07938,10.73492 -1.1657,8.46772 0.92847,-1.1 2.77896,-4.32777 4.11219,-7.17282 z m 486.34676,226.1769 c 0.63457,-1.92275 1.23173,-5.51049 1.32702,-7.97275 0.19543,-5.04958 -1.89389,-7.93355 -6.57567,-9.07669 -3.07393,-0.75055 -3.6439,0.5586 -1.14582,2.63182 2.42394,2.0117 3.49913,5.70298 3.52981,12.1184 0.0314,6.55732 1.16032,7.46344 2.86466,2.29922 z M 213,315.5 l 0,-29.5 -6.42327,0 c -5.46183,0 -6.88674,0.38998 -9.51962,2.6054 -10.20449,8.58651 -15.8451,33.04919 -10.18068,44.15239 3.42512,6.71379 13.31192,11.97615 22.87357,12.17472 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-1.2702 -3.03451,-1.2702 -5,0 -1.13826,0.7356 -0.71622,0.97307 1.75,0.98469 C 211.5375,283.99311 213,283.55 213,283 z"
+       id="path3386"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#5a4a1e"
+       d="m 459.40089,733.75 -8.04454,-17.25 -86.42817,0 -86.42818,0 -9,2.80013 c -16.01745,4.98345 -29.92557,6.91119 -50.5,6.99958 -19.87358,0.0854 -29.7479,-0.97706 -45.5,-4.89565 -27.0332,-6.72494 -50.36455,-20.1896 -71.14151,-41.05616 C 70.001666,647.85153 52.620419,607.23188 45.940445,548.5 45.377448,543.55 44.65155,521.45541 44.327338,499.40091 l -0.589475,-40.0991 2.381068,-0.63725 c 1.309588,-0.35049 4.455762,-0.6434 6.991498,-0.65091 2.535736,-0.008 6.683596,-0.29781 9.217466,-0.64511 l 4.607038,-0.63147 0.327809,-112.61853 C 67.587552,232.52999 67.610787,231.3994 69.803204,220.5 76.574459,186.83734 91.503219,159.34232 116.07022,135.28778 126.2905,125.2807 144.00716,111 146.20169,111 c 0.61024,0 2.502,-1.05841 4.20392,-2.35203 3.04416,-2.31384 21.78237,-10.458686 30.59439,-13.298304 2.475,-0.797554 10.35,-2.87948 17.5,-4.626503 l 13,-3.176407 124.86928,-0.303207 124.86929,-0.303208 15.63071,-8.867007 C 507.95773,60.437452 508.47322,60.17089 509.19493,61.357463 509.57714,61.985858 513.21268,67.9 517.27391,74.5 l 7.38404,12 12.92103,0.716072 c 17.7383,0.983042 33.67226,3.989032 48.45284,9.140776 16.43851,5.729612 19.12901,7.104082 38.45116,19.643152 15.19015,9.85761 38.28307,34.09349 46.68917,49 1.39571,2.475 4.18847,7.19101 6.20614,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.18182,19.40842 -4.26871,24.17236 -8.09932,35.5 -4.41981,13.06997 -8.6546,22.4285 -12.44393,27.5 -1.23284,1.65 -2.9983,4.46929 -3.92323,6.26509 -6.12955,11.90081 -25.6121,32.79651 -42.11473,45.1695 -12.19923,9.14648 -34.22583,20.09918 -49.5,24.61381 -8.08623,2.39007 -27.35062,6.26535 -34.28349,6.89655 -5.47112,0.49813 -7.99615,1.35984 -13.05153,4.45407 -11.37093,6.95978 -30.91613,16.85678 -47.4615,24.03285 C 475.24039,747.81934 467.80312,751 467.67619,751 c -0.12692,0 -3.8508,-7.7625 -8.2753,-17.25 z m 44.09727,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 39.09864,-37.3297 57.40143,-79.96214 55.33404,-128.88877 C 626.66457,497.17869 621.85891,478.80988 610.51801,455.5 593.3682,420.25058 566.18295,389.30086 519.5,351.8783 c -25.86219,-20.73196 -38.58854,-38.16152 -38.75719,-53.08046 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52203,-5.73805 9.82069,-6.22129 0.29865,-0.48323 -13.73561,-24.38261 -31.18725,-53.10973 -27.85546,-45.85284 -34.44321,-56.40356 -37.52724,-60.10242 -1.23146,-1.47696 -22.22657,11.19288 -37.17886,22.43619 -22.22762,16.71395 -41.43638,34.96832 -58.85956,55.93511 -2.51374,3.025 -4.74481,5.95 -4.95794,6.5 -0.21313,0.55 -3.69964,5.95 -7.74779,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.40768,1.88465 -4.86914,16.69801 -6.51201,27.86821 -3.21318,21.84703 -0.005,55.81318 6.62258,70.1216 1.01907,2.2 3.62973,8.14054 5.80147,13.2012 9.79175,22.81708 29.78309,49.99506 50.3096,68.39529 C 430.9023,440.75352 439.5547,448 440.31236,448 c 0.3282,0 1.66414,1.0125 2.96876,2.25 1.30461,1.2375 6.93762,6.0105 12.51779,10.60667 27.51249,22.66094 44.85747,46.00293 46.88122,63.09036 0.68008,5.74221 -1.72253,15.5322 -5.36674,21.86804 -7.30138,12.69417 -28.97505,29.76907 -53.71245,42.31561 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.21707,595.39118 483.41884,707 484.6601,707 c 0.33522,0 8.81234,-4.23268 18.83806,-9.40596 z M 229.5,691.98539 c 16.01485,-1.15132 25.40299,-2.95883 37.5,-7.21989 26.87627,-9.46693 50.11187,-28.14178 67.51814,-54.2655 13.57853,-20.37894 21.48528,-41.1259 26.6773,-70 2.03307,-11.30641 2.18053,-15.76421 2.55127,-77.1254 l 0.39349,-65.12539 -6.54481,-9.72049 C 345.0495,389.89528 335.06682,367.77836 329.4355,346.1396 c -6.83657,-26.26996 -7.20557,-60.35968 -0.95103,-87.8598 4.59432,-20.20043 16.17275,-47.28374 28.84401,-67.46952 C 363.04517,181.70339 364,179.52522 364,175.59115 364,173.06602 363.75344,171 363.45209,171 c -0.30136,0 -25.83886,-2.92478 -56.75,-6.49952 -30.91115,-3.57474 -56.98959,-6.49974 -57.95209,-6.5 -1.66034,-4.6e-4 -1.75042,9.49056 -1.7582,185.24952 -0.005,114.16095 -0.38339,188.51185 -0.98589,193.75 -1.88053,16.34944 -6.97498,29.9496 -14.51265,38.74297 -6.66867,7.7796 -21.26986,9.63606 -27.79833,3.5344 -6.78345,-6.33998 -12.48683,-24.64778 -14.68332,-47.13332 C 188.45523,526.44827 188,512.61077 188,501.39405 c 0,-18.7605 -0.14017,-20.39315 -1.75,-20.38286 -1.50305,0.01 -79.08796,6.02092 -101.418642,7.85795 -4.217754,0.34697 -7.952282,0.91539 -8.298952,1.26314 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.45,0.81707 10,0.89321 0.55,0.0761 7.3,-0.31448 15,-0.86804 z m 137.40959,-6.3054 c 12.84913,-12.22765 26.83323,-16.02808 33.70214,-9.15917 1.99096,1.99096 2.38827,3.39399 2.38827,8.43373 l 0,6.04545 18.08333,0 c 9.94584,0 17.93334,-0.38299 17.75,-0.85109 C 438.65,689.68081 427.475,665.83232 414,637.15226 c -22.97818,-48.90653 -24.55441,-51.94389 -25.37588,-48.89891 -3.03338,11.24391 -10.43404,31.76164 -14.61033,40.50591 -9.36567,19.60976 -20.70412,34.96393 -38.3931,51.99074 l -10.64863,10.25 18.17356,0 18.17355,0 5.59042,-5.32001 z m 27.07567,2.07001 c -0.0202,-4.44264 -1.99656,-7.98761 -5.34965,-9.59537 -2.55528,-1.22521 -3.35645,-1.07391 -8.97074,1.69421 -3.39068,1.67176 -7.9437,4.86467 -10.11782,7.09536 L 365.5941,691 l 14.20295,0 14.20295,0 -0.0147,-3.25 z m 6.33243,-0.32027 c 0.96668,-5.95695 -1.22846,-9.61628 -6.57328,-10.95774 -3.29107,-0.82601 -3.47917,0.11699 -0.62859,3.15129 1.25284,1.3336 2.32556,4.11299 2.63005,6.81445 0.39116,3.47034 0.93047,4.56227 2.25334,4.56227 1.21922,0 1.9123,-1.0673 2.31848,-3.57027 z m 197.597,-13.5784 c 19.77883,-10.81773 38.06582,-27.30804 48.80942,-44.01394 2.07674,-3.22926 5.49261,-8.51755 7.59082,-11.75176 2.09822,-3.23422 5.84116,-11.66407 8.31765,-18.73301 8.29815,-23.68642 7.75118,-10.64957 8.09129,-192.85262 0.18849,-100.97504 -0.0624,-164.44853 -0.66592,-168.5 -2.32174,-15.58491 -3.40674,-20.91811 -5.5947,-27.5 -5.52016,-16.60593 -7.74883,-21.96345 -11.43971,-27.5 -0.91663,-1.375 -4.24057,-6.40304 -7.38653,-11.17342 -6.55844,-9.94489 -25.68724,-29.05279 -35.18418,-35.14573 -3.27406,-2.10054 -8.97721,-5.74439 -12.67368,-8.09746 -8.52008,-5.42363 -30.89289,-12.95518 -43.27915,-14.56941 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.72287,-0.3417 -2.23155,-0.0936 -1.84952,0.9019 0.46191,1.20372 66.84429,110.91922 70.36602,116.29958 1.29628,1.98041 0.6457,2.46028 -14.83725,10.94397 -20.88457,11.44346 -39.50053,22.73662 -53.30212,32.33515 -12.24956,8.51914 -28.501,23.76519 -28.50002,26.73687 10e-4,3.75569 8.95745,13.21159 24.10985,25.45501 31.89454,25.77137 52.04629,45.15386 69.61521,66.95778 8.19943,10.17591 20.50998,28.05811 25.30359,36.7558 1.29003,2.34069 2.60951,3.82866 2.93216,3.3066 1.06933,-1.73022 9.48762,-3.38834 13.43908,-2.64704 2.10261,0.39445 4.94682,1.84107 6.32045,3.2147 2.26549,2.26549 2.46157,3.11868 2.11059,9.18373 -0.28312,4.89253 -1.26526,8.55683 -3.66106,13.65922 -1.80077,3.83515 -3.67006,7.2177 -4.15396,7.51677 -0.4839,0.29906 0.4612,5.03621 2.10022,10.52699 6.40708,21.46395 9.09748,48.32342 6.95984,69.48323 -4.79559,47.47003 -24.07322,87.01088 -60.82024,124.75 -5.4893,5.6375 -9.7435,10.25 -9.45377,10.25 0.28974,0 3.94018,-1.8669 8.1121,-4.14867 z M 651,595.96336 c 0,-3.74815 5.86762,-10.32493 8.72763,-9.78244 5.12472,0.97205 0.28522,12.06818 -5.50955,12.63244 -3.01195,0.29328 -3.21808,0.11073 -3.21808,-2.85 z m 6.38499,-1.42818 C 659.36498,591.51333 659.48864,588 657.61501,588 655.85111,588 653,592.3028 653,594.96482 c 0,2.79519 2.42786,2.55731 4.38499,-0.42964 z M 564.55519,345.0893 c -0.36865,-0.59649 1.25753,-3.32256 3.61373,-6.05794 3.34683,-3.88543 4.46409,-4.65161 5.10724,-3.50237 1.01156,1.80755 5.19257,4.00832 9.28892,4.88941 2.63969,0.56778 3.73647,0.0683 7.90259,-3.59886 2.66063,-2.34198 6.11884,-6.02697 7.68492,-8.18888 5.17883,-7.14917 3.32996,-16.25407 -4.47525,-22.03871 -2.94798,-2.18482 -11.43089,-2.89999 -14.837,-1.25086 -1.2135,0.58754 -1.83693,0.24501 -2.3191,-1.27416 -1.15746,-3.64685 -5.62796,-8.0854 -10.9015,-10.82358 -4.50251,-2.33785 -6.54457,-2.70654 -16.9383,-3.05819 l -11.81855,-0.39986 -4.21673,4.40082 c -2.3192,2.42045 -5.32585,6.96108 -6.68144,10.09028 -2.49456,5.75834 -3.96472,7.2119 -3.96472,3.91994 0,-6.413 10.94508,-19.51512 19.44215,-23.27378 14.06907,-6.22341 29.46214,-1.498 35.79549,10.98862 1.5057,2.96859 2.92638,5.58618 3.15707,5.81686 0.23069,0.23069 1.92375,-0.36583 3.76236,-1.3256 4.68484,-2.44551 14.25345,-2.2586 19.38313,0.37862 4.75323,2.44368 8.9437,6.68972 10.39618,10.53404 5.51104,14.58618 -12.47454,33.9312 -30.1098,32.38566 -3.12038,-0.27347 -7.05228,-1.31172 -8.73754,-2.30723 l -3.06412,-1.81002 -3.39973,3.29515 c -2.11851,2.05334 -3.65233,2.88644 -4.07,2.21064 z m 34.34603,-8.53822 c 3.58467,-1.85371 8.95392,-7.96013 10.72388,-12.19623 4.46976,-10.69764 -2.37901,-20.67107 -15.18614,-22.11462 -4.74172,-0.53446 -6.26029,1.08583 -2.01603,2.15107 3.5404,0.88859 8.64483,5.52663 10.21304,9.27989 1.65763,3.96726 1.77158,10.67403 0.23184,13.64455 -0.62271,1.20134 -2.67784,4.09676 -4.56695,6.43426 -3.73289,4.61889 -3.65127,4.99969 0.60036,2.80108 z m -30.73124,-46.61225 c -3.19771,-2.59247 -8.54523,-3.9295 -15.66998,-3.91794 -9.54954,0.0155 -9.74428,1.61957 -0.2684,2.21075 5.15829,0.32181 10.08705,1.28222 12.82352,2.49876 5.12711,2.27933 6.47895,1.93579 3.11486,-0.79157 z M 412,567.01942 c 29.03977,-13.62539 45.15179,-24.20093 53.45157,-35.08432 l 3.9462,-5.17459 -3.19179,-6.13026 C 460.45037,509.57584 447.0921,495.82113 425,478.20141 c -5.225,-4.16724 -13.84094,-11.30179 -19.14653,-15.85455 l -9.64652,-8.27775 -0.49964,47.21544 c -0.47427,44.81907 -1.33979,59.57583 -4.28477,73.05351 -0.5514,2.52351 -0.41522,2.73023 1.22866,1.86519 1.01684,-0.53508 9.7238,-4.66781 19.3488,-9.18383 z m -5,-57.05606 c 0,-3.74815 5.86762,-10.32493 8.72763,-9.78244 5.12472,0.97205 0.28522,12.06818 -5.50955,12.63244 -3.01195,0.29328 -3.21808,0.11073 -3.21808,-2.85 z m 6.38499,-1.42818 C 415.36498,505.51333 415.48864,502 413.61501,502 411.85111,502 409,506.3028 409,508.96482 c 0,2.79519 2.42786,2.55731 4.38499,-0.42964 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.25293,-5.45 c 1.02435,-5.12175 0.6839,-13.20025 -0.66901,-15.875 -1.58413,-3.13188 -5.40062,-4.99922 -8.84173,-4.3261 l -2.63574,0.51557 4.88574,10.35776 C 644.80142,450.244 647,455.37637 647,455.9525 c 0,2.38513 1.79682,0.81339 2.375,-2.0775 z M 151.88914,450.5 C 184.53492,448.025 211.63996,446 212.12256,446 212.61384,446 213,424.49237 213,397.12917 l 0,-48.87084 -5.92882,-0.67077 c -8.29014,-0.93792 -17.75263,-5.90856 -21.46597,-11.27607 -2.39246,-3.45822 -2.98224,-5.50596 -3.38261,-11.74463 -1.48007,-23.06257 9.6419,-40.44409 29.5274,-46.14569 0.98636,-0.28281 1.25,-16.93838 1.25,-78.96924 l 0,-78.61084 2.75,0.53804 c 1.5125,0.29592 42.4657,4.91277 91.0071,10.25966 l 88.25711,9.72162 9.74289,-9.47005 C 410.1157,126.68183 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -12,2.76488 c -28.68996,6.61034 -50.69225,18.92236 -71.39704,39.95229 -8.34026,8.47124 -11.62657,12.7851 -21.97124,28.84114 -3.37777,5.24267 -8.54958,16.94256 -9.596705,21.71011 -0.384091,1.74875 -1.307039,4.41252 -2.050997,5.91949 -0.743957,1.50696 -2.154437,6.78993 -3.1344,11.73993 -1.631785,8.24249 -1.808431,18.36363 -2.098738,120.25 C 92.076538,404.9375 92.068729,455 92.23353,455 c 0.164799,0 27.00982,-2.025 59.65561,-4.5 z M 97,389.96336 c 0,-3.74815 5.86762,-10.32493 8.72763,-9.78244 5.12472,0.97205 0.28522,12.06818 -5.50955,12.63244 C 97.206133,393.10664 97,392.92409 97,389.96336 z m 6.38499,-1.42818 C 105.36498,385.51333 105.48864,382 103.61501,382 101.85111,382 99,386.3028 99,388.96482 c 0,2.79519 2.42786,2.55731 4.38499,-0.42964 z M 133.92168,242.7262 c -1.85575,-1.25058 -4.44095,-3.83808 -5.74488,-5.75 -5.26047,-7.71321 -0.49259,-24.56702 9.99078,-35.31604 8.09412,-8.29924 17.00218,-9.92507 26.90311,-4.91016 6.0939,3.08662 9.88486,8.45017 9.91286,14.02498 0.0534,10.63816 -10.96239,27.12692 -21.54927,32.25548 -5.85838,2.83795 -15.06286,2.69442 -19.5126,-0.30426 z m 17.52197,-0.88248 c 3.18153,-1.4496 10.21458,-14.7686 11.56859,-21.90827 2.52391,-13.30852 -6.02583,-22.71574 -18.19441,-20.01917 -8.11625,1.79857 -15.74669,13.79452 -16.53159,25.9896 -0.50842,7.89947 1.50735,12.44156 6.77542,15.26685 3.89668,2.08982 12.49506,2.44199 16.38199,0.67099 z m 17.20824,-18.51654 c 3.3516,-7.15216 4.09294,-14.25769 1.87865,-18.0062 -2.44074,-4.13183 -7.69165,-7.41768 -12.7193,-7.95933 l -4.31124,-0.46446 3,1.673 c 5.25258,2.92919 7.52224,5.69849 9.08985,11.09088 1.57842,5.42958 0.87052,13.7417 -1.55655,18.27671 -0.56831,1.0619 -1.01899,2.52282 -1.0015,3.24648 0.0479,1.98269 2.83488,-1.91357 5.62009,-7.85708 z m 486.34676,226.1769 c 0.63457,-1.92275 1.23173,-5.51049 1.32702,-7.97275 0.19543,-5.04958 -1.89389,-7.93355 -6.57567,-9.07669 -3.07393,-0.75055 -3.6439,0.5586 -1.14582,2.63182 2.42394,2.0117 3.49913,5.70298 3.52981,12.1184 0.0314,6.55732 1.16032,7.46344 2.86466,2.29922 z M 213,315.5 l 0,-29.5 -6.4652,0 c -5.80318,0 -6.82655,0.31726 -9.99395,3.09828 -4.98976,4.38106 -10.30459,15.7583 -11.53984,24.70285 -1.74646,12.64625 0.89728,21.11788 8.07196,25.86585 4.38413,2.90129 11.53389,5.15872 16.67703,5.26553 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-1.2702 -3.03451,-1.2702 -5,0 -1.13826,0.7356 -0.71622,0.97307 1.75,0.98469 C 211.5375,283.99311 213,283.55 213,283 z"
+       id="path3384"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#414539"
+       d="m 459.40089,733.75 -8.04454,-17.25 -86.42817,0 -86.42818,0 -9,2.80013 c -16.01745,4.98345 -29.92557,6.91119 -50.5,6.99958 -19.87358,0.0854 -29.7479,-0.97706 -45.5,-4.89565 -27.0332,-6.72494 -50.36455,-20.1896 -71.14151,-41.05616 C 70.001666,647.85153 52.620419,607.23188 45.940445,548.5 45.377448,543.55 44.65155,521.45541 44.327338,499.40091 l -0.589475,-40.0991 2.381068,-0.63725 c 1.309588,-0.35049 4.455762,-0.6434 6.991498,-0.65091 2.535736,-0.008 6.683596,-0.29781 9.217466,-0.64511 l 4.607038,-0.63147 0.327809,-112.61853 C 67.587552,232.52999 67.610787,231.3994 69.803204,220.5 76.574459,186.83734 91.503219,159.34232 116.07022,135.28778 126.2905,125.2807 144.00716,111 146.20169,111 c 0.61024,0 2.502,-1.05841 4.20392,-2.35203 3.04416,-2.31384 21.78237,-10.458686 30.59439,-13.298304 2.475,-0.797554 10.35,-2.87948 17.5,-4.626503 l 13,-3.176407 124.86928,-0.303207 124.86929,-0.303208 15.63071,-8.867007 C 507.95773,60.437452 508.47322,60.17089 509.19493,61.357463 509.57714,61.985858 513.21268,67.9 517.27391,74.5 l 7.38404,12 12.92103,0.716072 c 17.7383,0.983042 33.67226,3.989032 48.45284,9.140776 16.43851,5.729612 19.12901,7.104082 38.45116,19.643152 15.19015,9.85761 38.28307,34.09349 46.68917,49 1.39571,2.475 4.18847,7.19101 6.20614,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.18182,19.40842 -4.26871,24.17236 -8.09932,35.5 -4.41981,13.06997 -8.6546,22.4285 -12.44393,27.5 -1.23284,1.65 -2.9983,4.46929 -3.92323,6.26509 -6.12955,11.90081 -25.6121,32.79651 -42.11473,45.1695 -12.19923,9.14648 -34.22583,20.09918 -49.5,24.61381 -8.08623,2.39007 -27.35062,6.26535 -34.28349,6.89655 -5.47112,0.49813 -7.99615,1.35984 -13.05153,4.45407 -11.37093,6.95978 -30.91613,16.85678 -47.4615,24.03285 C 475.24039,747.81934 467.80312,751 467.67619,751 c -0.12692,0 -3.8508,-7.7625 -8.2753,-17.25 z m 44.09727,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 28.57001,-27.27742 45.22759,-56.03352 52.83951,-91.21721 1.8844,-8.71003 2.21736,-13.32732 2.21736,-30.74903 0,-17.42171 -0.33296,-22.039 -2.21736,-30.74903 -3.20836,-14.82966 -7.47491,-26.97904 -14.66187,-41.75097 -17.16205,-35.27457 -44.37327,-66.24429 -91.09796,-103.68072 -25.63953,-20.54272 -38.50953,-38.18582 -38.67724,-53.02144 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52399,-5.74122 9.82504,-6.22832 C 566.42463,218.50392 497.96302,106 496.33182,106 c -0.23432,0 -3.89233,1.87467 -8.12892,4.16594 -18.81655,10.17651 -43.96911,29.68024 -64.26739,49.83406 -12.02944,11.94382 -26.94812,28.70101 -28.04399,31.5 -0.21533,0.55 -3.70365,5.95 -7.7518,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.40768,1.88465 -4.86914,16.69801 -6.51201,27.86821 -3.21318,21.84703 -0.005,55.81318 6.62258,70.1216 1.01907,2.2 3.62973,8.14054 5.80147,13.2012 9.79175,22.81708 29.78309,49.99506 50.3096,68.39529 C 430.9023,440.75352 439.5547,448 440.31236,448 c 0.3282,0 1.64593,1.0125 2.92828,2.25 1.28235,1.2375 6.8153,5.91803 12.29545,10.40117 12.12098,9.9158 28.38782,26.51393 34.72213,35.4293 17.72839,24.95219 16.71426,41.82343 -3.75789,62.51736 -10.34583,10.45791 -24.49416,20.19792 -42.89939,29.53285 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.21707,595.39118 483.41884,707 484.6601,707 c 0.33522,0 8.81234,-4.23268 18.83806,-9.40596 z m -273.68555,-5.63389 c 30.29358,-2.14475 52.57828,-10.59856 74.77333,-28.36565 25.31595,-20.26535 44.02619,-50.496 52.97584,-85.5945 5.52024,-21.64915 5.67608,-24.03743 6.14164,-94.12604 l 0.43591,-65.62604 -6.54437,-9.71985 C 345.0495,389.89528 335.06675,367.7781 329.4355,346.1396 c -6.83657,-26.26996 -7.20557,-60.35968 -0.95103,-87.8598 4.59432,-20.20043 16.17275,-47.28374 28.84401,-67.46952 C 363.04517,181.70339 364,179.52522 364,175.59115 364,173.06602 363.75344,171 363.45209,171 c -0.30136,0 -25.83886,-2.92478 -56.75,-6.49952 -30.91115,-3.57474 -56.98959,-6.49974 -57.95209,-6.5 -1.66034,-4.6e-4 -1.75042,9.49056 -1.7582,185.24952 -0.005,114.16095 -0.38339,188.51185 -0.98589,193.75 -1.34575,11.70005 -3.40473,19.20739 -7.65466,27.91004 -4.95472,10.14583 -10.49025,15.53005 -17.60298,17.12181 -11.6247,2.6015 -17.98573,-0.72286 -23.19404,-12.12152 -6.4001,-14.00698 -8.57715,-28.62232 -9.25919,-62.16033 -0.48425,-23.81232 -0.72251,-26.74877 -2.16952,-26.73881 -1.41237,0.01 -80.00351,6.10648 -101.294162,7.85795 -4.217754,0.34697 -7.952282,0.91539 -8.298952,1.26314 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.32543 15.5,-0.89735 z m 137.09698,-6.28016 c 12.84913,-12.22765 26.83323,-16.02808 33.70214,-9.15917 1.99096,1.99096 2.38827,3.39399 2.38827,8.43373 l 0,6.04545 18.08333,0 c 9.94584,0 17.93334,-0.38461 17.75,-0.8547 C 438.65,689.67522 427.475,665.81554 414,637.12379 c -23.02698,-49.03038 -24.55266,-51.97012 -25.37588,-48.8953 -3.53034,13.18625 -10.662,32.32158 -16.12711,43.27151 -8.86671,17.76539 -17.5072,29.53624 -33.58316,45.75 L 325.2807,691 l 18.01924,0 18.01923,0 5.59042,-5.32001 z m 27.07567,2.07001 c -0.0202,-4.44264 -1.99656,-7.98761 -5.34965,-9.59537 -2.55528,-1.22521 -3.35645,-1.07391 -8.97074,1.69421 -3.39068,1.67176 -7.9437,4.86467 -10.11782,7.09536 L 365.5941,691 l 14.20295,0 14.20295,0 -0.0147,-3.25 z m 6.33243,-0.32027 c 0.96668,-5.95695 -1.22846,-9.61628 -6.57328,-10.95774 -3.29107,-0.82601 -3.47917,0.11699 -0.62859,3.15129 1.25284,1.3336 2.32556,4.11299 2.63005,6.81445 0.39116,3.47034 0.93047,4.56227 2.25334,4.56227 1.21922,0 1.9123,-1.0673 2.31848,-3.57027 z m 199.12277,-14.45119 c 11.6673,-6.46687 20.18674,-12.89191 30.33367,-22.87652 7.72486,-7.6013 17.3994,-19.63475 20.18127,-25.10202 0.69963,-1.375 2.81099,-4.77584 4.69191,-7.55742 1.88092,-2.78158 5.46018,-10.88158 7.95391,-18 8.33099,-23.78098 7.77947,-10.75181 8.14595,-192.44258 0.22162,-109.8799 -0.0124,-163.89722 -0.73216,-169 -2.21466,-15.70081 -3.9885,-23.77697 -7.02846,-32 -1.72829,-4.675 -3.55956,-9.85 -4.06948,-11.5 -0.50992,-1.65 -2.02644,-4.8 -3.37005,-7 -1.34361,-2.2 -3.43241,-5.8 -4.64178,-8 -6.80016,-12.37032 -29.22479,-35.98759 -41.30332,-43.5 -3.09504,-1.925 -8.5335,-5.34385 -12.08548,-7.59745 -8.26052,-5.241 -30.87954,-12.80683 -43.01644,-14.38857 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.67647,-0.3325 -2.22814,-0.0847 -1.87286,0.84108 0.46725,1.21763 10.12304,17.23422 54.48985,90.38523 l 17.04053,28.09605 -20.31855,11.25584 c -23.39218,12.95853 -42.38075,24.8438 -55.77009,34.90745 C 526.59424,285.44533 515,297.0956 515,299.65261 c 0,2.49679 6.53939,10.75241 12.78444,16.13965 3.14356,2.71177 10.35275,8.61597 16.02042,13.12043 38.65181,30.71911 69.54119,64.40409 87.34076,95.2454 2.84206,4.92443 5.44527,8.50387 5.78492,7.9543 1.09534,-1.7723 9.46565,-3.44825 13.46998,-2.69703 2.10261,0.39445 4.94682,1.84107 6.32045,3.2147 2.26549,2.26549 2.46157,3.11868 2.11059,9.18373 -0.28312,4.89253 -1.26526,8.55683 -3.66106,13.65922 -1.80077,3.83515 -3.68206,7.22511 -4.18062,7.53325 -0.50058,0.30937 0.18305,4.09156 1.5267,8.44648 14.06949,45.60107 9.85526,96.26959 -11.54878,138.85328 -10.45246,20.79535 -23.74982,39.0826 -41.76972,57.44398 -5.53266,5.6375 -9.77988,10.25 -9.43827,10.25 0.34161,0 4.6979,-2.25966 9.68065,-5.02146 z M 651,595.96336 c 0,-3.74815 5.86762,-10.32493 8.72763,-9.78244 5.12472,0.97205 0.28522,12.06818 -5.50955,12.63244 -3.01195,0.29328 -3.21808,0.11073 -3.21808,-2.85 z m 6.38499,-1.42818 C 659.36498,591.51333 659.48864,588 657.61501,588 655.85111,588 653,592.3028 653,594.96482 c 0,2.79519 2.42786,2.55731 4.38499,-0.42964 z M 564.55519,345.0893 c -0.36865,-0.59649 1.25753,-3.32256 3.61373,-6.05794 3.34683,-3.88543 4.46409,-4.65161 5.10724,-3.50237 1.01156,1.80755 5.19257,4.00832 9.28892,4.88941 2.63969,0.56778 3.73647,0.0683 7.90259,-3.59886 2.66063,-2.34198 6.11884,-6.02697 7.68492,-8.18888 5.17883,-7.14917 3.32996,-16.25407 -4.47525,-22.03871 -2.94798,-2.18482 -11.43089,-2.89999 -14.837,-1.25086 -1.2135,0.58754 -1.83693,0.24501 -2.3191,-1.27416 -1.15746,-3.64685 -5.62796,-8.0854 -10.9015,-10.82358 -4.50251,-2.33785 -6.54457,-2.70654 -16.9383,-3.05819 l -11.81855,-0.39986 -4.21673,4.40082 c -2.3192,2.42045 -5.32585,6.96108 -6.68144,10.09028 -2.49456,5.75834 -3.96472,7.2119 -3.96472,3.91994 0,-6.413 10.94508,-19.51512 19.44215,-23.27378 14.06907,-6.22341 29.46214,-1.498 35.79549,10.98862 1.5057,2.96859 2.92638,5.58618 3.15707,5.81686 0.23069,0.23069 1.92375,-0.36583 3.76236,-1.3256 4.68484,-2.44551 14.25345,-2.2586 19.38313,0.37862 4.75323,2.44368 8.9437,6.68972 10.39618,10.53404 5.51104,14.58618 -12.47454,33.9312 -30.1098,32.38566 -3.12038,-0.27347 -7.05228,-1.31172 -8.73754,-2.30723 l -3.06412,-1.81002 -3.39973,3.29515 c -2.11851,2.05334 -3.65233,2.88644 -4.07,2.21064 z m 34.34603,-8.53822 c 3.58467,-1.85371 8.95392,-7.96013 10.72388,-12.19623 4.46976,-10.69764 -2.37901,-20.67107 -15.18614,-22.11462 -4.74172,-0.53446 -6.26029,1.08583 -2.01603,2.15107 3.5404,0.88859 8.64483,5.52663 10.21304,9.27989 1.65763,3.96726 1.77158,10.67403 0.23184,13.64455 -0.62271,1.20134 -2.67784,4.09676 -4.56695,6.43426 -3.73289,4.61889 -3.65127,4.99969 0.60036,2.80108 z m -30.73124,-46.61225 c -3.19771,-2.59247 -8.54523,-3.9295 -15.66998,-3.91794 -9.54954,0.0155 -9.74428,1.61957 -0.2684,2.21075 5.15829,0.32181 10.08705,1.28222 12.82352,2.49876 5.12711,2.27933 6.47895,1.93579 3.11486,-0.79157 z M 411.5,567.24477 c 29.89667,-14.09571 45.26978,-24.07688 53.48567,-34.72619 4.91872,-6.37558 4.86898,-6.83966 -1.819,-16.97107 -6.23476,-9.44486 -19.87858,-22.75574 -39.92428,-38.95005 -9.20831,-7.43911 -19.05557,-15.56483 -21.88278,-18.05716 l -5.1404,-4.5315 -0.51383,47.2456 c -0.49122,45.16549 -1.24986,57.95742 -4.30865,72.65109 -0.41019,1.97046 -0.32711,3.17203 0.19717,2.85145 0.49836,-0.30472 9.4561,-4.5852 19.9061,-9.51217 z M 407,509.96336 c 0,-3.74815 5.86762,-10.32493 8.72763,-9.78244 5.12472,0.97205 0.28522,12.06818 -5.50955,12.63244 -3.01195,0.29328 -3.21808,0.11073 -3.21808,-2.85 z m 6.38499,-1.42818 C 415.36498,505.51333 415.48864,502 413.61501,502 411.85111,502 409,506.3028 409,508.96482 c 0,2.79519 2.42786,2.55731 4.38499,-0.42964 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.25293,-5.45 c 1.02435,-5.12175 0.6839,-13.20025 -0.66901,-15.875 -1.58438,-3.13237 -5.40075,-4.99919 -8.84332,-4.3258 l -2.63733,0.51588 4.25842,9.15496 c 2.34212,5.03523 4.57175,10.16746 4.95471,11.40496 0.97845,3.1617 2.20211,2.79708 2.93653,-0.875 z M 151.88914,450.5 C 184.53492,448.025 211.63996,446 212.12256,446 212.61384,446 213,424.49237 213,397.12917 l 0,-48.87084 -5.92882,-0.67077 c -8.29014,-0.93792 -17.75263,-5.90856 -21.46597,-11.27607 -2.39246,-3.45822 -2.98224,-5.50596 -3.38261,-11.74463 -1.48007,-23.06257 9.6419,-40.44409 29.5274,-46.14569 0.98636,-0.28281 1.25,-16.93838 1.25,-78.96924 l 0,-78.61084 2.75,0.53183 c 1.5125,0.29251 42.44905,4.92572 90.97011,10.29601 l 88.22011,9.76417 9.77989,-9.5064 C 410.09905,126.69819 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -12,2.76488 c -28.61058,6.59205 -51.01745,19.09847 -71.31721,39.80578 -8.35987,8.5277 -11.68679,12.90117 -22.05107,28.98765 -3.37777,5.24267 -8.54958,16.94256 -9.596705,21.71011 -0.384091,1.74875 -1.307039,4.41252 -2.050997,5.91949 -0.743957,1.50696 -2.154437,6.78993 -3.1344,11.73993 -1.631785,8.24249 -1.808431,18.36363 -2.098738,120.25 C 92.076538,404.9375 92.068729,455 92.23353,455 c 0.164799,0 27.00982,-2.025 59.65561,-4.5 z M 97,389.96336 c 0,-3.74815 5.86762,-10.32493 8.72763,-9.78244 5.12472,0.97205 0.28522,12.06818 -5.50955,12.63244 C 97.206133,393.10664 97,392.92409 97,389.96336 z m 6.38499,-1.42818 C 105.36498,385.51333 105.48864,382 103.61501,382 101.85111,382 99,386.3028 99,388.96482 c 0,2.79519 2.42786,2.55731 4.38499,-0.42964 z M 133.92168,242.7262 c -1.85575,-1.25058 -4.44095,-3.83808 -5.74488,-5.75 -5.26047,-7.71321 -0.49259,-24.56702 9.99078,-35.31604 8.09412,-8.29924 17.00218,-9.92507 26.90311,-4.91016 6.0939,3.08662 9.88486,8.45017 9.91286,14.02498 0.0534,10.63816 -10.96239,27.12692 -21.54927,32.25548 -5.85838,2.83795 -15.06286,2.69442 -19.5126,-0.30426 z m 17.52197,-0.88248 c 3.18153,-1.4496 10.21458,-14.7686 11.56859,-21.90827 2.52391,-13.30852 -6.02583,-22.71574 -18.19441,-20.01917 -8.11625,1.79857 -15.74669,13.79452 -16.53159,25.9896 -0.50842,7.89947 1.50735,12.44156 6.77542,15.26685 3.89668,2.08982 12.49506,2.44199 16.38199,0.67099 z m 17.20824,-18.51654 c 3.3516,-7.15216 4.09294,-14.25769 1.87865,-18.0062 -2.44074,-4.13183 -7.69165,-7.41768 -12.7193,-7.95933 l -4.31124,-0.46446 3,1.673 c 5.25258,2.92919 7.52224,5.69849 9.08985,11.09088 1.57842,5.42958 0.87052,13.7417 -1.55655,18.27671 -0.56831,1.0619 -1.01899,2.52282 -1.0015,3.24648 0.0479,1.98269 2.83488,-1.91357 5.62009,-7.85708 z m 486.34676,226.1769 c 0.63457,-1.92275 1.23173,-5.51049 1.32702,-7.97275 0.19543,-5.04958 -1.89389,-7.93355 -6.57567,-9.07669 -3.07393,-0.75055 -3.6439,0.5586 -1.14582,2.63182 2.42394,2.0117 3.49913,5.70298 3.52981,12.1184 0.0314,6.55732 1.16032,7.46344 2.86466,2.29922 z M 213,315.5 l 0,-29.5 -6.4652,0 c -5.80318,0 -6.82655,0.31726 -9.99395,3.09828 -4.98976,4.38106 -10.30459,15.7583 -11.53984,24.70285 -1.74646,12.64625 0.89728,21.11788 8.07196,25.86585 4.38413,2.90129 11.53389,5.15872 16.67703,5.26553 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-1.2702 -3.03451,-1.2702 -5,0 -1.13826,0.7356 -0.71622,0.97307 1.75,0.98469 C 211.5375,283.99311 213,283.55 213,283 z"
+       id="path3382"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#57481d"
+       d="m 459.40089,733.75 -8.04454,-17.25 -86.42817,0 -86.42818,0 -9,2.80013 c -16.01745,4.98345 -29.92557,6.91119 -50.5,6.99958 -19.87358,0.0854 -29.7479,-0.97706 -45.5,-4.89565 -27.0332,-6.72494 -50.36455,-20.1896 -71.14151,-41.05616 C 70.001666,647.85153 52.620419,607.23188 45.940445,548.5 45.377448,543.55 44.65155,521.45541 44.327338,499.40091 l -0.589475,-40.0991 2.381068,-0.63725 c 1.309588,-0.35049 4.455762,-0.6434 6.991498,-0.65091 2.535736,-0.008 6.683596,-0.29781 9.217466,-0.64511 l 4.607038,-0.63147 0.327809,-112.61853 C 67.587552,232.52999 67.610787,231.3994 69.803204,220.5 76.574459,186.83734 91.503219,159.34232 116.07022,135.28778 126.2905,125.2807 144.00716,111 146.20169,111 c 0.61024,0 2.502,-1.05841 4.20392,-2.35203 3.04416,-2.31384 21.78237,-10.458686 30.59439,-13.298304 2.475,-0.797554 10.35,-2.87948 17.5,-4.626503 l 13,-3.176407 124.86928,-0.303207 124.86929,-0.303208 15.63071,-8.867007 C 507.95773,60.437452 508.47322,60.17089 509.19493,61.357463 509.57714,61.985858 513.21268,67.9 517.27391,74.5 l 7.38404,12 12.92103,0.716072 c 17.7383,0.983042 33.67226,3.989032 48.45284,9.140776 16.43851,5.729612 19.12901,7.104082 38.45116,19.643152 15.19015,9.85761 38.28307,34.09349 46.68917,49 1.39571,2.475 4.18847,7.19101 6.20614,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.18182,19.40842 -4.26871,24.17236 -8.09932,35.5 -4.41981,13.06997 -8.6546,22.4285 -12.44393,27.5 -1.23284,1.65 -2.9983,4.46929 -3.92323,6.26509 -6.12955,11.90081 -25.6121,32.79651 -42.11473,45.1695 -12.19923,9.14648 -34.22583,20.09918 -49.5,24.61381 -8.08623,2.39007 -27.35062,6.26535 -34.28349,6.89655 -5.47112,0.49813 -7.99615,1.35984 -13.05153,4.45407 -11.37093,6.95978 -30.91613,16.85678 -47.4615,24.03285 C 475.24039,747.81934 467.80312,751 467.67619,751 c -0.12692,0 -3.8508,-7.7625 -8.2753,-17.25 z m 44.09727,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 28.57001,-27.27742 45.22759,-56.03352 52.83951,-91.21721 1.8844,-8.71003 2.21736,-13.32732 2.21736,-30.74903 0,-17.42171 -0.33296,-22.039 -2.21736,-30.74903 -3.20836,-14.82966 -7.47491,-26.97904 -14.66187,-41.75097 -17.16205,-35.27457 -44.37327,-66.24429 -91.09796,-103.68072 -25.63953,-20.54272 -38.50953,-38.18582 -38.67724,-53.02144 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52399,-5.74122 9.82504,-6.22832 C 566.42463,218.50392 497.96302,106 496.33182,106 c -0.23432,0 -3.89233,1.87467 -8.12892,4.16594 -18.81655,10.17651 -43.96911,29.68024 -64.26739,49.83406 -12.02944,11.94382 -26.94812,28.70101 -28.04399,31.5 -0.21533,0.55 -3.70365,5.95 -7.7518,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.40768,1.88465 -4.86914,16.69801 -6.51201,27.86821 -3.21318,21.84703 -0.005,55.81318 6.62258,70.1216 1.01907,2.2 3.62973,8.14054 5.80147,13.2012 9.79175,22.81708 29.78309,49.99506 50.3096,68.39529 C 430.9023,440.75352 439.5547,448 440.31236,448 c 0.3282,0 1.64593,1.0125 2.92828,2.25 1.28235,1.2375 6.8153,5.91803 12.29545,10.40117 12.12098,9.9158 28.38782,26.51393 34.72213,35.4293 17.72839,24.95219 16.71426,41.82343 -3.75789,62.51736 -10.34583,10.45791 -24.49416,20.19792 -42.89939,29.53285 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.21707,595.39118 483.41884,707 484.6601,707 c 0.33522,0 8.81234,-4.23268 18.83806,-9.40596 z m -273.68555,-5.63389 c 30.29358,-2.14475 52.57828,-10.59856 74.77333,-28.36565 25.31595,-20.26535 44.02619,-50.496 52.97584,-85.5945 5.52024,-21.64915 5.67608,-24.03743 6.14164,-94.12604 l 0.43591,-65.62604 -6.54437,-9.71985 C 345.0495,389.89528 335.06675,367.7781 329.4355,346.1396 c -6.83657,-26.26996 -7.20557,-60.35968 -0.95103,-87.8598 4.59432,-20.20043 16.17275,-47.28374 28.84401,-67.46952 C 363.04517,181.70339 364,179.52522 364,175.59115 364,173.06602 363.75344,171 363.45209,171 c -0.30136,0 -25.83886,-2.92478 -56.75,-6.49952 -30.91115,-3.57474 -56.98959,-6.49974 -57.95209,-6.5 -1.66034,-4.6e-4 -1.75042,9.49056 -1.7582,185.24952 -0.005,114.16095 -0.38339,188.51185 -0.98589,193.75 -1.34575,11.70005 -3.40473,19.20739 -7.65466,27.91004 -4.95472,10.14583 -10.49025,15.53005 -17.60298,17.12181 -11.6247,2.6015 -17.98573,-0.72286 -23.19404,-12.12152 -6.4001,-14.00698 -8.57715,-28.62232 -9.25919,-62.16033 -0.48425,-23.81232 -0.72251,-26.74877 -2.16952,-26.73881 -1.41237,0.01 -80.00351,6.10648 -101.294162,7.85795 -4.217754,0.34697 -7.952282,0.91539 -8.298952,1.26314 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.32543 15.5,-0.89735 z m 137.09698,-6.28016 c 12.84913,-12.22765 26.83323,-16.02808 33.70214,-9.15917 1.99096,1.99096 2.38827,3.39399 2.38827,8.43373 l 0,6.04545 18.08333,0 c 9.94584,0 17.93334,-0.38461 17.75,-0.8547 C 438.65,689.67522 427.475,665.81554 414,637.12379 c -23.02698,-49.03038 -24.55266,-51.97012 -25.37588,-48.8953 -3.53034,13.18625 -10.662,32.32158 -16.12711,43.27151 -8.86671,17.76539 -17.5072,29.53624 -33.58316,45.75 L 325.2807,691 l 18.01924,0 18.01923,0 5.59042,-5.32001 z m 27.07567,2.07001 c -0.0202,-4.44264 -1.99656,-7.98761 -5.34965,-9.59537 -2.55528,-1.22521 -3.35645,-1.07391 -8.97074,1.69421 -3.39068,1.67176 -7.9437,4.86467 -10.11782,7.09536 L 365.5941,691 l 14.20295,0 14.20295,0 -0.0147,-3.25 z m 6.33243,-0.32027 c 0.96668,-5.95695 -1.22846,-9.61628 -6.57328,-10.95774 -3.29107,-0.82601 -3.47917,0.11699 -0.62859,3.15129 1.25284,1.3336 2.32556,4.11299 2.63005,6.81445 0.39116,3.47034 0.93047,4.56227 2.25334,4.56227 1.21922,0 1.9123,-1.0673 2.31848,-3.57027 z m 199.12277,-14.45119 c 11.6673,-6.46687 20.18674,-12.89191 30.33367,-22.87652 7.72486,-7.6013 17.3994,-19.63475 20.18127,-25.10202 0.69963,-1.375 2.81099,-4.77584 4.69191,-7.55742 1.88092,-2.78158 5.46018,-10.88158 7.95391,-18 8.33099,-23.78098 7.77947,-10.75181 8.14595,-192.44258 0.22162,-109.8799 -0.0124,-163.89722 -0.73216,-169 -2.21466,-15.70081 -3.9885,-23.77697 -7.02846,-32 -1.72829,-4.675 -3.55956,-9.85 -4.06948,-11.5 -0.50992,-1.65 -2.02644,-4.8 -3.37005,-7 -1.34361,-2.2 -3.43241,-5.8 -4.64178,-8 -6.80016,-12.37032 -29.22479,-35.98759 -41.30332,-43.5 -3.09504,-1.925 -8.5335,-5.34385 -12.08548,-7.59745 -8.26052,-5.241 -30.87954,-12.80683 -43.01644,-14.38857 -4.95,-0.6451 -10.06942,-1.38501 -11.37648,-1.64424 -1.67647,-0.3325 -2.22814,-0.0847 -1.87286,0.84108 0.46725,1.21763 10.12304,17.23422 54.48985,90.38523 l 17.04053,28.09605 -20.31855,11.25584 c -23.39218,12.95853 -42.38075,24.8438 -55.77009,34.90745 C 526.59424,285.44533 515,297.0956 515,299.65261 c 0,2.49679 6.53939,10.75241 12.78444,16.13965 3.14356,2.71177 10.35275,8.61597 16.02042,13.12043 38.65181,30.71911 69.54119,64.40409 87.34076,95.2454 2.84206,4.92443 5.44527,8.50387 5.78492,7.9543 1.09534,-1.7723 9.46565,-3.44825 13.46998,-2.69703 2.10261,0.39445 4.94682,1.84107 6.32045,3.2147 2.26549,2.26549 2.46157,3.11868 2.11059,9.18373 -0.28312,4.89253 -1.26526,8.55683 -3.66106,13.65922 -1.80077,3.83515 -3.68206,7.22511 -4.18062,7.53325 -0.50058,0.30937 0.18305,4.09156 1.5267,8.44648 14.06949,45.60107 9.85526,96.26959 -11.54878,138.85328 -10.45246,20.79535 -23.74982,39.0826 -41.76972,57.44398 -5.53266,5.6375 -9.77988,10.25 -9.43827,10.25 0.34161,0 4.6979,-2.25966 9.68065,-5.02146 z m 52.22621,-74.64521 c -1.47011,-1.4701 -0.52246,-5.37659 1.94735,-8.02757 l 2.61402,-2.80576 -1.61402,2.71482 c -3.30397,5.55735 -0.69987,9.61754 2.77097,4.32036 C 659.28221,591.63966 659.51334,588 657.8,588 c -0.89377,0 -0.91093,-0.28907 -0.0672,-1.13278 1.62601,-1.62601 4.26722,-0.2946 4.26722,2.15106 0,5.87955 -7.2412,12.40718 -10.33333,9.31505 z M 564.55519,345.0893 c -0.36865,-0.59649 1.25753,-3.32256 3.61373,-6.05794 3.34683,-3.88543 4.46409,-4.65161 5.10724,-3.50237 1.01156,1.80755 5.19257,4.00832 9.28892,4.88941 2.63969,0.56778 3.73647,0.0683 7.90259,-3.59886 2.66063,-2.34198 6.11884,-6.02697 7.68492,-8.18888 5.17883,-7.14917 3.32996,-16.25407 -4.47525,-22.03871 -2.94798,-2.18482 -11.43089,-2.89999 -14.837,-1.25086 -1.2135,0.58754 -1.83693,0.24501 -2.3191,-1.27416 -1.15746,-3.64685 -5.62796,-8.0854 -10.9015,-10.82358 -4.50251,-2.33785 -6.54457,-2.70654 -16.9383,-3.05819 l -11.81855,-0.39986 -4.21673,4.40082 c -2.3192,2.42045 -5.32585,6.96108 -6.68144,10.09028 -2.49456,5.75834 -3.96472,7.2119 -3.96472,3.91994 0,-3.53474 5.1588,-12.0712 10.07259,-16.66747 15.06737,-14.09376 36.57327,-11.95893 45.22543,4.48941 1.58593,3.01495 3.40516,5.38622 4.04274,5.2695 0.63758,-0.11672 3.44855,-0.8598 6.24659,-1.65128 8.60638,-2.43449 17.36415,0.12742 23.21488,6.79104 5.59043,6.36715 5.27639,15.23748 -0.85496,24.1491 -7.87625,11.44773 -23.02158,16.28959 -34.25422,10.95083 l -3.80695,-1.8094 -3.33032,3.22787 c -2.07851,2.01457 -3.58227,2.82022 -4.00059,2.14336 z m 34.34603,-8.53822 c 3.58467,-1.85371 8.95392,-7.96013 10.72388,-12.19623 4.46976,-10.69764 -2.37901,-20.67107 -15.18614,-22.11462 -4.74172,-0.53446 -6.26029,1.08583 -2.01603,2.15107 3.5404,0.88859 8.64483,5.52663 10.21304,9.27989 1.65763,3.96726 1.77158,10.67403 0.23184,13.64455 -0.62271,1.20134 -2.67784,4.09676 -4.56695,6.43426 -3.73289,4.61889 -3.65127,4.99969 0.60036,2.80108 z m -30.73124,-46.61225 c -3.19771,-2.59247 -8.54523,-3.9295 -15.66998,-3.91794 -9.54954,0.0155 -9.74428,1.61957 -0.2684,2.21075 5.15829,0.32181 10.08705,1.28222 12.82352,2.49876 5.12711,2.27933 6.47895,1.93579 3.11486,-0.79157 z M 411.5,567.24477 c 29.89667,-14.09571 45.26978,-24.07688 53.48567,-34.72619 4.91872,-6.37558 4.86898,-6.83966 -1.819,-16.97107 -6.23476,-9.44486 -19.87858,-22.75574 -39.92428,-38.95005 -9.20831,-7.43911 -19.05557,-15.56483 -21.88278,-18.05716 l -5.1404,-4.5315 -0.51383,47.2456 c -0.49122,45.16549 -1.24986,57.95742 -4.30865,72.65109 -0.41019,1.97046 -0.32711,3.17203 0.19717,2.85145 0.49836,-0.30472 9.4561,-4.5852 19.9061,-9.51217 z m -3.83333,-54.91144 c -1.47011,-1.4701 -0.52246,-5.37659 1.94735,-8.02757 l 2.61402,-2.80576 -1.61402,2.71482 c -3.30397,5.55735 -0.69987,9.61754 2.77097,4.32036 C 415.28221,505.63966 415.51334,502 413.8,502 c -0.89377,0 -0.91093,-0.28907 -0.0672,-1.13278 1.62601,-1.62601 4.26722,-0.2946 4.26722,2.15106 0,5.87955 -7.2412,12.40718 -10.33333,9.31505 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.25293,-5.45 c 1.02435,-5.12175 0.6839,-13.20025 -0.66901,-15.875 -1.58438,-3.13237 -5.40075,-4.99919 -8.84332,-4.3258 l -2.63733,0.51588 4.25842,9.15496 c 2.34212,5.03523 4.57175,10.16746 4.95471,11.40496 0.97845,3.1617 2.20211,2.79708 2.93653,-0.875 z M 151.88914,450.5 C 184.53492,448.025 211.63996,446 212.12256,446 212.61384,446 213,424.49237 213,397.12917 l 0,-48.87084 -5.80453,-0.6567 c -11.69664,-1.32333 -21.14568,-7.80438 -24.05737,-16.50085 -2.53292,-7.5652 -0.81613,-22.25822 3.82728,-32.75542 C 190.82878,289.6115 203.84592,279 210.69634,279 l 2.30366,0 0,-79.07946 0,-79.07945 2.75,0.53183 c 1.5125,0.29251 42.44905,4.92572 90.97011,10.29601 l 88.22011,9.76417 9.77989,-9.5064 C 410.09905,126.69819 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.29422 -106,0.29421 -12,2.76488 c -28.61058,6.59205 -51.01745,19.09847 -71.31721,39.80578 -8.35987,8.5277 -11.68679,12.90117 -22.05107,28.98765 -3.37777,5.24267 -8.54958,16.94256 -9.596705,21.71011 -0.384091,1.74875 -1.307039,4.41252 -2.050997,5.91949 -0.743957,1.50696 -2.154437,6.78993 -3.1344,11.73993 -1.631785,8.24249 -1.808431,18.36363 -2.098738,120.25 C 92.076538,404.9375 92.068729,455 92.23353,455 c 0.164799,0 27.00982,-2.025 59.65561,-4.5 z M 97.666667,392.33333 c -1.470107,-1.4701 -0.522461,-5.37659 1.947353,-8.02757 l 2.61402,-2.80576 -1.61402,2.71482 c -3.303973,5.55735 -0.699874,9.61754 2.77097,4.32036 C 105.28221,385.63966 105.51334,382 103.8,382 c -0.89377,0 -0.91093,-0.28907 -0.0672,-1.13278 1.62601,-1.62601 4.26722,-0.2946 4.26722,2.15106 0,5.87955 -7.2412,12.40718 -10.333333,9.31505 z M 133.98983,242.75 C 127.9824,238.66138 126.5,235.67303 126.5,227.65136 c 0,-6.16105 0.48832,-8.18662 3.3987,-14.09784 4.50456,-9.14915 12.14197,-16.98652 18.09403,-18.56777 14.48125,-3.84715 28.45783,5.85556 26.5699,18.44515 -1.57708,10.51673 -11.9998,25.18186 -20.99029,29.53408 -5.97906,2.89441 -15.16199,2.7936 -19.58251,-0.21498 z m 17.45382,-0.90628 c 3.18153,-1.4496 10.21458,-14.7686 11.56859,-21.90827 2.52391,-13.30852 -6.02583,-22.71574 -18.19441,-20.01917 -8.11625,1.79857 -15.74669,13.79452 -16.53159,25.9896 -0.50842,7.89947 1.50735,12.44156 6.77542,15.26685 3.89668,2.08982 12.49506,2.44199 16.38199,0.67099 z m 17.30928,-18.73724 c 3.35806,-7.1727 4.03298,-13.49251 1.86956,-17.50596 -2.28616,-4.24116 -7.63545,-7.68126 -12.81125,-8.23887 l -4.31124,-0.46446 3,1.673 c 5.19631,2.89781 7.48945,5.65538 9.04018,10.8711 1.61586,5.43477 1.19423,11.55677 -1.18872,17.25998 -3.55152,8.49999 0.15709,5.47107 4.40147,-3.59479 z m 486.24572,226.3976 c 0.63457,-1.92275 1.23173,-5.51049 1.32702,-7.97275 0.19543,-5.04958 -1.89389,-7.93355 -6.57567,-9.07669 -3.07393,-0.75055 -3.6439,0.5586 -1.14582,2.63182 2.42394,2.0117 3.49913,5.70298 3.52981,12.1184 0.0314,6.55732 1.16032,7.46344 2.86466,2.29922 z M 213,315.5 l 0,-29.5 -6.4652,0 c -5.80318,0 -6.82655,0.31726 -9.99395,3.09828 -4.98976,4.38106 -10.30459,15.7583 -11.53984,24.70285 -1.74646,12.64625 0.89728,21.11788 8.07196,25.86585 4.38413,2.90129 11.53389,5.15872 16.67703,5.26553 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-1.2702 -3.03451,-1.2702 -5,0 -1.13826,0.7356 -0.71622,0.97307 1.75,0.98469 C 211.5375,283.99311 213,283.55 213,283 z"
+       id="path3380"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#434234"
+       d="m 459.40089,733.75 -8.04454,-17.25 -86.42817,0 -86.42818,0 -9,2.80013 c -16.01745,4.98345 -29.92557,6.91119 -50.5,6.99958 -19.87358,0.0854 -29.7479,-0.97706 -45.5,-4.89565 -27.0332,-6.72494 -50.36455,-20.1896 -71.14151,-41.05616 C 70.001666,647.85153 52.620419,607.23188 45.940445,548.5 45.377448,543.55 44.65155,521.45541 44.327338,499.40091 l -0.589475,-40.0991 2.381068,-0.63725 c 1.309588,-0.35049 4.455762,-0.6434 6.991498,-0.65091 2.535736,-0.008 6.683596,-0.29781 9.217466,-0.64511 l 4.607038,-0.63147 0.327809,-112.61853 C 67.587552,232.52999 67.610787,231.3994 69.803204,220.5 76.574459,186.83734 91.503219,159.34232 116.07022,135.28778 126.2905,125.2807 144.00716,111 146.20169,111 c 0.61024,0 2.502,-1.05841 4.20392,-2.35203 3.04416,-2.31384 21.78237,-10.458686 30.59439,-13.298304 2.475,-0.797554 10.35,-2.87948 17.5,-4.626503 l 13,-3.176407 124.86928,-0.303207 124.86929,-0.303208 15.63071,-8.867007 C 507.95773,60.437452 508.47322,60.17089 509.19493,61.357463 509.57714,61.985858 513.21268,67.9 517.27391,74.5 l 7.38404,12 12.92103,0.716072 c 17.7383,0.983042 33.67226,3.989032 48.45284,9.140776 16.43851,5.729612 19.12901,7.104082 38.45116,19.643152 15.19015,9.85761 38.28307,34.09349 46.68917,49 1.39571,2.475 4.18847,7.19101 6.20614,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.18182,19.40842 -4.26871,24.17236 -8.09932,35.5 -4.41981,13.06997 -8.6546,22.4285 -12.44393,27.5 -1.23284,1.65 -2.9983,4.46929 -3.92323,6.26509 -6.12955,11.90081 -25.6121,32.79651 -42.11473,45.1695 -12.19923,9.14648 -34.22583,20.09918 -49.5,24.61381 -8.08623,2.39007 -27.35062,6.26535 -34.28349,6.89655 -5.47112,0.49813 -7.99615,1.35984 -13.05153,4.45407 -11.37093,6.95978 -30.91613,16.85678 -47.4615,24.03285 C 475.24039,747.81934 467.80312,751 467.67619,751 c -0.12692,0 -3.8508,-7.7625 -8.2753,-17.25 z m 44.09727,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 28.49098,-27.20196 45.36553,-56.27563 52.79742,-90.96624 1.91201,-8.92491 2.25264,-13.57517 2.27076,-31 0.0182,-17.54231 -0.30095,-21.97871 -2.21236,-30.74903 C 621.90844,482.16534 617.67323,470.10512 610.53444,455.5 593.55923,420.77071 565.143,388.18867 522,353.98642 509.16373,343.81028 493.73161,328.4423 488.76962,320.89415 c -5.25354,-7.99165 -7.95132,-15.41813 -8.02681,-22.09631 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52498,-5.74283 9.82725,-6.2319 C 566.45792,218.45005 498.00621,106 496.31305,106 c -0.24409,0 -4.47565,2.22429 -9.40346,4.94286 -25.60148,14.12384 -59.03767,42.22272 -80.90959,67.99426 -5.225,6.15659 -9.72633,11.72684 -10.00296,12.37834 -0.27663,0.65149 -3.81375,6.13454 -7.86028,12.18454 -7.98737,11.94198 -17.51739,30.17051 -21.17373,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.40768,1.88465 -4.86914,16.69801 -6.51201,27.86821 -3.21318,21.84703 -0.005,55.81318 6.62258,70.1216 1.01907,2.2 3.62973,8.14054 5.80147,13.2012 9.79175,22.81708 29.78309,49.99506 50.3096,68.39529 C 432.84828,442.49792 439.59539,448 440.85781,448 c 0.62821,0 1.14219,0.37736 1.14219,0.83858 0,0.46122 3.93534,3.94872 8.74521,7.75 20.66812,16.33421 39.54472,37.09413 46.76394,51.42958 4.93957,9.80868 6.24964,18.07159 4.18908,26.42155 -2.2788,9.23433 -5.78902,14.766 -15.63887,24.64492 -9.89895,9.92816 -24.6182,19.99769 -42.45842,29.04605 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.20466,595.40204 483.40225,707 484.66111,707 c 0.33466,0 8.81133,-4.23268 18.83705,-9.40596 z M 230.22958,691.9307 c 17.48074,-1.22407 30.53011,-4.17574 44.02666,-9.95848 C 314.62273,664.67676 345.1874,626.52953 357.56178,578 c 5.52024,-21.64915 5.67608,-24.03743 6.14164,-94.12604 l 0.43591,-65.62604 -6.54437,-9.71985 C 345.0495,389.89528 335.06675,367.7781 329.4355,346.1396 c -6.83657,-26.26996 -7.20557,-60.35968 -0.95103,-87.8598 4.59432,-20.20043 16.17275,-47.28374 28.84401,-67.46952 C 363.04517,181.70339 364,179.52522 364,175.59115 364,173.06602 363.80602,171 363.56893,171 363.33184,171 337.87582,168.075 307,164.5 276.12418,160.925 249.99316,158 248.93107,158 247.02992,158 247,160.87105 247,343.27623 c 0,121.57547 -0.35587,188.18965 -1.03505,193.75 -1.48107,12.1253 -3.47363,19.42733 -7.60887,27.88381 -4.84907,9.91626 -10.43,15.42842 -17.28623,17.0732 -16.79921,4.03007 -24.72812,-5.40675 -30.23347,-35.98324 -1.62347,-9.01667 -2.18016,-17.27645 -2.57797,-38.25 -0.45197,-23.8297 -0.68482,-26.74829 -2.13289,-26.73429 -1.52155,0.0147 -84.46936,6.43758 -101.294162,7.84349 -4.217754,0.35244 -7.952282,0.92533 -8.298952,1.27308 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.32831,0.8189 9.72958,0.89728 0.40128,0.0784 7.60128,-0.33868 16,-0.9268 z m 136.68001,-6.25071 c 12.84913,-12.22765 26.83323,-16.02808 33.70214,-9.15917 1.99096,1.99096 2.38827,3.39399 2.38827,8.43373 l 0,6.04545 18.08333,0 c 9.94584,0 17.93334,-0.39205 17.75,-0.87123 C 438.65,689.6496 427.475,665.7851 414,637.09654 c -23.0488,-49.07137 -24.55188,-51.96659 -25.37588,-48.87877 -3.53486,13.24638 -10.6554,32.3318 -16.14808,43.28223 -8.99369,17.93021 -17.56946,29.62019 -33.56219,45.75 L 325.2807,691 l 18.01924,0 18.01923,0 5.59042,-5.32001 z m 27.07567,2.07001 c -0.0202,-4.44264 -1.99656,-7.98761 -5.34965,-9.59537 -2.55528,-1.22521 -3.35645,-1.07391 -8.97074,1.69421 -3.39068,1.67176 -7.9437,4.86467 -10.11782,7.09536 L 365.5941,691 l 14.20295,0 14.20295,0 -0.0147,-3.25 z m 6.33243,-0.32027 c 0.96668,-5.95695 -1.22846,-9.61628 -6.57328,-10.95774 -3.29107,-0.82601 -3.47917,0.11699 -0.62859,3.15129 1.25284,1.3336 2.32556,4.11299 2.63005,6.81445 0.39116,3.47034 0.93047,4.56227 2.25334,4.56227 1.21922,0 1.9123,-1.0673 2.31848,-3.57027 z m 197.49482,-13.53671 c 11.67358,-6.40683 17.04413,-10.15866 25.85824,-18.06437 13.40199,-12.02076 17.04512,-16.50498 30.69543,-37.78222 2.1264,-3.31449 5.87354,-11.76837 8.32697,-18.78639 8.22364,-23.52359 7.68929,-10.75039 8.04288,-192.26004 0.20362,-104.5302 -0.0404,-164.14566 -0.69177,-169 -1.94929,-14.52714 -3.9474,-23.58667 -7.05771,-32 -1.72829,-4.675 -3.60336,-10.05273 -4.16682,-11.95051 -0.56345,-1.89778 -2.73987,-6.17278 -4.83647,-9.5 -2.09661,-3.32722 -5.50446,-8.74949 -7.57302,-12.04949 -4.76111,-7.59549 -29.19428,-31.87416 -36.73227,-36.5 -3.13686,-1.925 -8.62902,-5.35664 -12.2048,-7.62587 -7.47701,-4.74501 -30.91375,-12.73883 -41.97317,-14.31625 -14.32866,-2.04372 -14.71457,-2.05941 -14.14506,-0.57531 0.29242,0.76203 8.95232,15.25269 19.24423,32.20147 10.29191,16.94878 26.24315,43.23418 35.44721,58.41201 l 16.73466,27.59605 -20.31855,11.25584 c -23.71457,13.13712 -43.25734,25.37386 -56.11159,35.13436 -10.20326,7.74756 -21.35123,19.08037 -21.35027,21.70429 10e-4,3.08499 8.44754,12.55861 18.46749,20.71341 33.68568,27.41532 47.16535,39.64297 62.83634,57 12.61339,13.97045 26.22249,32.09954 33.98819,45.27666 3.331,5.65216 6.32616,9.84013 6.6559,9.30659 1.08018,-1.74776 9.47834,-3.41335 13.45197,-2.66789 2.10261,0.39445 4.94682,1.84107 6.32045,3.2147 2.26549,2.26549 2.46157,3.11868 2.11059,9.18373 -0.28312,4.89253 -1.26526,8.55683 -3.66106,13.65922 -1.80077,3.83515 -3.68368,7.22612 -4.18423,7.53547 -0.50936,0.31481 -0.009,3.40891 1.1359,7.02699 6.84581,21.63015 9.87463,48.13161 8.03681,70.32016 -4.04541,48.84138 -23.59969,89.49833 -61.5821,128.04053 -5.2054,5.28211 -9.19056,9.60384 -8.85593,9.60384 0.33464,0 3.97584,-1.84814 8.09156,-4.10698 z m 53.85416,-75.55969 c -1.47011,-1.4701 -0.52246,-5.37659 1.94735,-8.02757 l 2.61402,-2.80576 -1.61402,2.71482 c -3.30397,5.55735 -0.69987,9.61754 2.77097,4.32036 C 659.28221,591.63966 659.51334,588 657.8,588 c -0.89377,0 -0.91093,-0.28907 -0.0672,-1.13278 1.62601,-1.62601 4.26722,-0.2946 4.26722,2.15106 0,5.87955 -7.2412,12.40718 -10.33333,9.31505 z M 564.55519,345.0893 c -0.36865,-0.59649 1.25753,-3.32256 3.61373,-6.05794 3.34683,-3.88543 4.46409,-4.65161 5.10724,-3.50237 1.01156,1.80755 5.19257,4.00832 9.28892,4.88941 2.63969,0.56778 3.73647,0.0683 7.90259,-3.59886 2.66063,-2.34198 6.11884,-6.02697 7.68492,-8.18888 5.17883,-7.14917 3.32996,-16.25407 -4.47525,-22.03871 -2.94798,-2.18482 -11.43089,-2.89999 -14.837,-1.25086 -1.2135,0.58754 -1.83693,0.24501 -2.3191,-1.27416 -1.15746,-3.64685 -5.62796,-8.0854 -10.9015,-10.82358 -4.50251,-2.33785 -6.54457,-2.70654 -16.9383,-3.05819 l -11.81855,-0.39986 -4.21673,4.40082 c -2.3192,2.42045 -5.32585,6.96108 -6.68144,10.09028 -2.49456,5.75834 -3.96472,7.2119 -3.96472,3.91994 0,-3.53474 5.1588,-12.0712 10.07259,-16.66747 15.06737,-14.09376 36.57327,-11.95893 45.22543,4.48941 1.58593,3.01495 3.40516,5.38622 4.04274,5.2695 0.63758,-0.11672 3.44855,-0.8598 6.24659,-1.65128 8.60638,-2.43449 17.36415,0.12742 23.21488,6.79104 5.59043,6.36715 5.27639,15.23748 -0.85496,24.1491 -7.87625,11.44773 -23.02158,16.28959 -34.25422,10.95083 l -3.80695,-1.8094 -3.33032,3.22787 c -2.07851,2.01457 -3.58227,2.82022 -4.00059,2.14336 z m 34.34603,-8.53822 c 3.58467,-1.85371 8.95392,-7.96013 10.72388,-12.19623 4.46976,-10.69764 -2.37901,-20.67107 -15.18614,-22.11462 -4.74172,-0.53446 -6.26029,1.08583 -2.01603,2.15107 3.5404,0.88859 8.64483,5.52663 10.21304,9.27989 1.65763,3.96726 1.77158,10.67403 0.23184,13.64455 -0.62271,1.20134 -2.67784,4.09676 -4.56695,6.43426 -3.73289,4.61889 -3.65127,4.99969 0.60036,2.80108 z m -30.73124,-46.61225 c -3.19771,-2.59247 -8.54523,-3.9295 -15.66998,-3.91794 -9.54954,0.0155 -9.74428,1.61957 -0.2684,2.21075 5.15829,0.32181 10.08705,1.28222 12.82352,2.49876 5.12711,2.27933 6.47895,1.93579 3.11486,-0.79157 z M 418.33103,564.12527 c 22.32309,-10.51946 40.2898,-22.75397 47.16113,-32.11459 3.35419,-4.56932 3.59602,-5.31898 2.61946,-8.12034 -3.43575,-9.8558 -19.58442,-26.86398 -45.01044,-47.40614 -9.13065,-7.37682 -18.91436,-15.45157 -21.74157,-17.9439 l -5.1404,-4.5315 -0.51383,47.2456 c -0.48999,45.05232 -1.25411,57.99715 -4.28013,72.50848 l -0.6804,3.26288 8.37757,-3.89826 c 4.60767,-2.14404 13.25154,-6.19504 19.20861,-9.00223 z m -10.66436,-51.79194 c -1.47011,-1.4701 -0.52246,-5.37659 1.94735,-8.02757 l 2.61402,-2.80576 -1.61402,2.71482 c -3.30397,5.55735 -0.69987,9.61754 2.77097,4.32036 C 415.28221,505.63966 415.51334,502 413.8,502 c -0.89377,0 -0.91093,-0.28907 -0.0672,-1.13278 1.62601,-1.62601 4.26722,-0.2946 4.26722,2.15106 0,5.87955 -7.2412,12.40718 -10.33333,9.31505 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.25293,-5.45 c 1.02435,-5.12175 0.6839,-13.20025 -0.66901,-15.875 -1.58438,-3.13237 -5.40075,-4.99919 -8.84332,-4.3258 l -2.63733,0.51588 4.25842,9.15496 c 2.34212,5.03523 4.57175,10.16746 4.95471,11.40496 0.97845,3.1617 2.20211,2.79708 2.93653,-0.875 z M 152.11086,450.5 C 184.75665,448.025 211.8118,446 212.23342,446 212.65504,446 213,424.00812 213,397.12917 l 0,-48.87084 -5.80453,-0.6567 c -11.69664,-1.32333 -21.14568,-7.80438 -24.05737,-16.50085 -2.53292,-7.5652 -0.81613,-22.25822 3.82728,-32.75542 C 190.82878,289.6115 203.84592,279 210.69634,279 l 2.30366,0 0,-79.10841 0,-79.10841 2.25,0.50179 c 1.2375,0.27599 42.16916,4.92702 90.95925,10.33563 l 88.70925,9.83384 9.79075,-9.51707 C 410.09416,126.70299 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.27093 -106,0.27093 -12,2.79108 c -28.73501,6.68347 -51.03471,19.13644 -71.31721,39.82615 -8.35987,8.5277 -11.68679,12.90117 -22.05107,28.98765 -3.37777,5.24267 -8.54958,16.94256 -9.596705,21.71011 -0.384091,1.74875 -1.307039,4.41252 -2.050997,5.91949 -0.743957,1.50696 -2.154437,6.78993 -3.1344,11.73993 -1.631785,8.24249 -1.808431,18.36363 -2.098738,120.25 -0.174342,61.1875 -0.132263,111.25 0.09351,111.25 0.225773,0 27.12069,-2.025 59.76647,-4.5 z M 97.666667,392.33333 c -1.470107,-1.4701 -0.522461,-5.37659 1.947353,-8.02757 l 2.61402,-2.80576 -1.61402,2.71482 c -3.303973,5.55735 -0.699874,9.61754 2.77097,4.32036 C 105.28221,385.63966 105.51334,382 103.8,382 c -0.89377,0 -0.91093,-0.28907 -0.0672,-1.13278 1.62601,-1.62601 4.26722,-0.2946 4.26722,2.15106 0,5.87955 -7.2412,12.40718 -10.333333,9.31505 z M 133.98983,242.75 C 127.9824,238.66138 126.5,235.67303 126.5,227.65136 c 0,-6.16105 0.48832,-8.18662 3.3987,-14.09784 4.50456,-9.14915 12.14197,-16.98652 18.09403,-18.56777 14.48125,-3.84715 28.45783,5.85556 26.5699,18.44515 -1.57708,10.51673 -11.9998,25.18186 -20.99029,29.53408 -5.97906,2.89441 -15.16199,2.7936 -19.58251,-0.21498 z m 17.45382,-0.90628 c 3.18153,-1.4496 10.21458,-14.7686 11.56859,-21.90827 2.52391,-13.30852 -6.02583,-22.71574 -18.19441,-20.01917 -8.11625,1.79857 -15.74669,13.79452 -16.53159,25.9896 -0.50842,7.89947 1.50735,12.44156 6.77542,15.26685 3.89668,2.08982 12.49506,2.44199 16.38199,0.67099 z m 17.30928,-18.73724 c 3.35806,-7.1727 4.03298,-13.49251 1.86956,-17.50596 -2.28616,-4.24116 -7.63545,-7.68126 -12.81125,-8.23887 l -4.31124,-0.46446 3,1.673 c 5.19631,2.89781 7.48945,5.65538 9.04018,10.8711 1.61586,5.43477 1.19423,11.55677 -1.18872,17.25998 -3.55152,8.49999 0.15709,5.47107 4.40147,-3.59479 z m 486.24572,226.3976 c 0.63457,-1.92275 1.23173,-5.51049 1.32702,-7.97275 0.19543,-5.04958 -1.89389,-7.93355 -6.57567,-9.07669 -3.07393,-0.75055 -3.6439,0.5586 -1.14582,2.63182 2.42394,2.0117 3.49913,5.70298 3.52981,12.1184 0.0314,6.55732 1.16032,7.46344 2.86466,2.29922 z M 213,315.5 l 0,-29.5 -6.4652,0 c -5.80318,0 -6.82655,0.31726 -9.99395,3.09828 -4.98976,4.38106 -10.30459,15.7583 -11.53984,24.70285 -1.74646,12.64625 0.89728,21.11788 8.07196,25.86585 4.38413,2.90129 11.53389,5.15872 16.67703,5.26553 L 213,345 l 0,-29.5 z m 0,-32.5 c 0,-1.2702 -3.03451,-1.2702 -5,0 -1.13826,0.7356 -0.71622,0.97307 1.75,0.98469 C 211.5375,283.99311 213,283.55 213,283 z"
+       id="path3378"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#3c4238"
+       d="m 459.40089,733.75 -8.04454,-17.25 -86.42817,0 -86.42818,0 -9,2.80013 c -16.01745,4.98345 -29.92557,6.91119 -50.5,6.99958 -19.87358,0.0854 -29.7479,-0.97706 -45.5,-4.89565 -27.0332,-6.72494 -50.36455,-20.1896 -71.14151,-41.05616 C 70.001666,647.85153 52.620419,607.23188 45.940445,548.5 45.377448,543.55 44.65155,521.45541 44.327338,499.40091 l -0.589475,-40.0991 2.381068,-0.63725 c 1.309588,-0.35049 4.455762,-0.6434 6.991498,-0.65091 2.535736,-0.008 6.683596,-0.29781 9.217466,-0.64511 l 4.607038,-0.63147 0.327809,-112.61853 C 67.587552,232.52999 67.610787,231.3994 69.803204,220.5 76.574459,186.83734 91.503219,159.34232 116.07022,135.28778 126.2905,125.2807 144.00716,111 146.20169,111 c 0.61024,0 2.502,-1.05841 4.20392,-2.35203 3.04416,-2.31384 21.78237,-10.458686 30.59439,-13.298304 2.475,-0.797554 10.35,-2.87948 17.5,-4.626503 l 13,-3.176407 124.86928,-0.303207 124.86929,-0.303208 15.63071,-8.867007 C 507.95773,60.437452 508.47322,60.17089 509.19493,61.357463 509.57714,61.985858 513.21268,67.9 517.27391,74.5 l 7.38404,12 12.92103,0.716072 c 17.7383,0.983042 33.67226,3.989032 48.45284,9.140776 16.43851,5.729612 19.12901,7.104082 38.45116,19.643152 15.19015,9.85761 38.28307,34.09349 46.68917,49 1.39571,2.475 4.18847,7.19101 6.20614,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.18182,19.40842 -4.26871,24.17236 -8.09932,35.5 -4.41981,13.06997 -8.6546,22.4285 -12.44393,27.5 -1.23284,1.65 -2.9983,4.46929 -3.92323,6.26509 -6.12955,11.90081 -25.6121,32.79651 -42.11473,45.1695 -12.19923,9.14648 -34.22583,20.09918 -49.5,24.61381 -8.08623,2.39007 -27.35062,6.26535 -34.28349,6.89655 -5.47112,0.49813 -7.99615,1.35984 -13.05153,4.45407 -11.37093,6.95978 -30.91613,16.85678 -47.4615,24.03285 C 475.24039,747.81934 467.80312,751 467.67619,751 c -0.12692,0 -3.8508,-7.7625 -8.2753,-17.25 z m 44.09727,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 28.49098,-27.20196 45.36553,-56.27563 52.79742,-90.96624 1.91201,-8.92491 2.25264,-13.57517 2.27076,-31 0.0182,-17.54231 -0.30095,-21.97871 -2.21236,-30.74903 C 621.90844,482.16534 617.67323,470.10512 610.53444,455.5 593.55923,420.77071 565.143,388.18867 522,353.98642 509.16373,343.81028 493.73161,328.4423 488.76962,320.89415 c -5.25354,-7.99165 -7.95132,-15.41813 -8.02681,-22.09631 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52498,-5.74283 9.82725,-6.2319 C 566.45792,218.45005 498.00621,106 496.31305,106 c -0.24409,0 -4.47565,2.22429 -9.40346,4.94286 -25.60148,14.12384 -59.03767,42.22272 -80.90959,67.99426 -5.225,6.15659 -9.72633,11.72684 -10.00296,12.37834 -0.27663,0.65149 -3.81375,6.13454 -7.86028,12.18454 -7.98737,11.94198 -17.51739,30.17051 -21.17373,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.40768,1.88465 -4.86914,16.69801 -6.51201,27.86821 -3.21318,21.84703 -0.005,55.81318 6.62258,70.1216 1.01907,2.2 3.62973,8.14054 5.80147,13.2012 9.79175,22.81708 29.78309,49.99506 50.3096,68.39529 C 432.84828,442.49792 439.59539,448 440.85781,448 c 0.62821,0 1.14219,0.37736 1.14219,0.83858 0,0.46122 3.93534,3.94872 8.74521,7.75 20.66812,16.33421 39.54472,37.09413 46.76394,51.42958 4.93957,9.80868 6.24964,18.07159 4.18908,26.42155 -2.2788,9.23433 -5.78902,14.766 -15.63887,24.64492 -9.89895,9.92816 -24.6182,19.99769 -42.45842,29.04605 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.20466,595.40204 483.40225,707 484.66111,707 c 0.33466,0 8.81133,-4.23268 18.83705,-9.40596 z M 230.22958,691.9307 c 17.48074,-1.22407 30.53011,-4.17574 44.02666,-9.95848 C 314.62273,664.67676 345.1874,626.52953 357.56178,578 c 5.52024,-21.64915 5.67608,-24.03743 6.14164,-94.12604 l 0.43591,-65.62604 -6.54437,-9.71985 C 345.0495,389.89528 335.06675,367.7781 329.4355,346.1396 c -6.83657,-26.26996 -7.20557,-60.35968 -0.95103,-87.8598 4.59432,-20.20043 16.17275,-47.28374 28.84401,-67.46952 C 363.04517,181.70339 364,179.52522 364,175.59115 364,173.06602 363.80602,171 363.56893,171 363.33184,171 337.87582,168.075 307,164.5 276.12418,160.925 249.99316,158 248.93107,158 247.02992,158 247,160.87105 247,343.27623 c 0,121.57547 -0.35587,188.18965 -1.03505,193.75 -1.48107,12.1253 -3.47363,19.42733 -7.60887,27.88381 -4.84907,9.91626 -10.43,15.42842 -17.28623,17.0732 -16.79921,4.03007 -24.72812,-5.40675 -30.23347,-35.98324 -1.62347,-9.01667 -2.18016,-17.27645 -2.57797,-38.25 -0.45197,-23.8297 -0.68482,-26.74829 -2.13289,-26.73429 -1.52155,0.0147 -84.46936,6.43758 -101.294162,7.84349 -4.217754,0.35244 -7.952282,0.92533 -8.298952,1.27308 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.32831,0.8189 9.72958,0.89728 0.40128,0.0784 7.60128,-0.33868 16,-0.9268 z m 136.68001,-6.25071 c 12.84913,-12.22765 26.83323,-16.02808 33.70214,-9.15917 1.99096,1.99096 2.38827,3.39399 2.38827,8.43373 l 0,6.04545 18.08333,0 c 9.94584,0 17.93334,-0.39205 17.75,-0.87123 C 438.65,689.6496 427.475,665.7851 414,637.09654 c -23.0488,-49.07137 -24.55188,-51.96659 -25.37588,-48.87877 -3.53486,13.24638 -10.6554,32.3318 -16.14808,43.28223 -8.99369,17.93021 -17.56946,29.62019 -33.56219,45.75 L 325.2807,691 l 18.01924,0 18.01923,0 5.59042,-5.32001 z m 26.83873,0.77943 c -1.32035,-11.71404 -10.74925,-11.81472 -23.18331,-0.24754 l -5.06501,4.71188 14.38005,0.0381 14.38005,0.0381 -0.51178,-4.54058 z m 6.56937,0.97031 c 0.96668,-5.95695 -1.22846,-9.61628 -6.57328,-10.95774 -3.29107,-0.82601 -3.47917,0.11699 -0.62859,3.15129 1.25284,1.3336 2.32556,4.11299 2.63005,6.81445 0.39116,3.47034 0.93047,4.56227 2.25334,4.56227 1.21922,0 1.9123,-1.0673 2.31848,-3.57027 z m 197.49482,-13.53671 c 11.67358,-6.40683 17.04413,-10.15866 25.85824,-18.06437 13.40199,-12.02076 17.04512,-16.50498 30.69543,-37.78222 2.1264,-3.31449 5.87354,-11.76837 8.32697,-18.78639 8.22364,-23.52359 7.68929,-10.75039 8.04288,-192.26004 0.20362,-104.5302 -0.0404,-164.14566 -0.69177,-169 -1.94929,-14.52714 -3.9474,-23.58667 -7.05771,-32 -1.72829,-4.675 -3.60336,-10.05273 -4.16682,-11.95051 -0.56345,-1.89778 -2.73987,-6.17278 -4.83647,-9.5 -2.09661,-3.32722 -5.50446,-8.74949 -7.57302,-12.04949 -4.76111,-7.59549 -29.19428,-31.87416 -36.73227,-36.5 -3.13686,-1.925 -8.62902,-5.35664 -12.2048,-7.62587 -7.4663,-4.73821 -30.88805,-12.73095 -41.97317,-14.32347 -3.85,-0.55311 -8.74781,-1.27248 -10.88403,-1.59861 -3.19321,-0.4875 -3.78134,-0.32537 -3.30669,0.91153 0.31753,0.82747 8.99798,15.37168 19.28989,32.32046 10.29191,16.94878 26.24315,43.23418 35.44721,58.41201 l 16.73466,27.59605 -20.31855,11.25584 c -23.71457,13.13712 -43.25734,25.37386 -56.11159,35.13436 -10.20326,7.74756 -21.35123,19.08037 -21.35027,21.70429 10e-4,3.08499 8.44754,12.55861 18.46749,20.71341 33.68568,27.41532 47.16535,39.64297 62.83634,57 12.61339,13.97045 26.22249,32.09954 33.98819,45.27666 3.331,5.65216 6.32616,9.84013 6.6559,9.30659 1.08018,-1.74776 9.47834,-3.41335 13.45197,-2.66789 2.10261,0.39445 4.94682,1.84107 6.32045,3.2147 2.26549,2.26549 2.46157,3.11868 2.11059,9.18373 -0.28312,4.89253 -1.26526,8.55683 -3.66106,13.65922 -1.80077,3.83515 -3.68368,7.22612 -4.18423,7.53547 -0.50936,0.31481 -0.009,3.40891 1.1359,7.02699 6.84581,21.63015 9.87463,48.13161 8.03681,70.32016 -4.04541,48.84138 -23.59969,89.49833 -61.5821,128.04053 -5.2054,5.28211 -9.19056,9.60384 -8.85593,9.60384 0.33464,0 3.97584,-1.84814 8.09156,-4.10698 z m 53.85416,-75.55969 c -1.46237,-1.46236 -0.52808,-5.37223 1.91823,-8.02757 2.26486,-2.45838 2.38867,-2.49964 1,-0.33325 -2.01146,3.13795 -2.07121,7.02749 -0.10795,7.02749 2.4248,0 4.84373,-4.64661 4.17071,-8.01168 C 658.19571,586.72857 658.41727,586 659.55638,586 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.45673,3.12861 -6.83812,1.74721 z M 564.50031,345.0005 c -0.41948,-0.67874 0.69101,-2.71759 2.6345,-4.83691 1.8478,-2.01497 3.68776,-4.08046 4.08879,-4.58996 0.4218,-0.5359 1.49217,-0.23585 2.53937,0.71186 2.11622,1.91515 8.48579,4.71451 10.72725,4.71451 1.93983,0 9.88118,-7.20496 13.6674,-12.40004 5.17751,-7.10407 3.32036,-16.22675 -4.48028,-22.00801 -2.94798,-2.18482 -11.43089,-2.89999 -14.837,-1.25086 -1.2135,0.58754 -1.83693,0.24501 -2.3191,-1.27416 -2.20675,-6.95287 -11.61094,-12.63274 -23.35405,-14.1052 -15.04715,-1.88675 -21.32411,1.29977 -26.82415,13.61737 -2.85426,6.39226 -4.34304,7.97504 -4.34304,4.61724 0,-3.53474 5.1588,-12.0712 10.07259,-16.66747 15.06737,-14.09376 36.57327,-11.95893 45.22543,4.48941 1.58593,3.01495 3.40516,5.38622 4.04274,5.2695 0.63758,-0.11672 3.44855,-0.8598 6.24659,-1.65128 8.60638,-2.43449 17.36415,0.12742 23.21488,6.79104 5.59043,6.36715 5.27639,15.23748 -0.85496,24.1491 -7.87625,11.44773 -23.02158,16.28959 -34.25422,10.95083 l -3.80695,-1.8094 -3.33032,3.22787 c -2.26931,2.1995 -3.56135,2.85406 -4.05547,2.05456 z m 34.40091,-8.44942 c 3.58467,-1.85371 8.95392,-7.96013 10.72388,-12.19623 4.46976,-10.69764 -2.37901,-20.67107 -15.18614,-22.11462 -4.74172,-0.53446 -6.26029,1.08583 -2.01603,2.15107 3.5404,0.88859 8.64483,5.52663 10.21304,9.27989 1.65763,3.96726 1.77158,10.67403 0.23184,13.64455 -0.62271,1.20134 -2.67784,4.09676 -4.56695,6.43426 -3.73289,4.61889 -3.65127,4.99969 0.60036,2.80108 z m -30.73124,-46.61225 c -3.19771,-2.59247 -8.54523,-3.9295 -15.66998,-3.91794 -9.54954,0.0155 -9.74428,1.61957 -0.2684,2.21075 5.15829,0.32181 10.08705,1.28222 12.82352,2.49876 5.12711,2.27933 6.47895,1.93579 3.11486,-0.79157 z M 418.33103,564.12527 c 22.32309,-10.51946 40.2898,-22.75397 47.16113,-32.11459 3.35419,-4.56932 3.59602,-5.31898 2.61946,-8.12034 -3.43575,-9.8558 -19.58442,-26.86398 -45.01044,-47.40614 -9.13065,-7.37682 -18.91436,-15.45157 -21.74157,-17.9439 l -5.1404,-4.5315 -0.51383,47.2456 c -0.48999,45.05232 -1.25411,57.99715 -4.28013,72.50848 l -0.6804,3.26288 8.37757,-3.89826 c 4.60767,-2.14404 13.25154,-6.19504 19.20861,-9.00223 z m -10.66436,-51.79194 c -1.46237,-1.46236 -0.52808,-5.37223 1.91823,-8.02757 2.26486,-2.45838 2.38867,-2.49964 1,-0.33325 -2.01146,3.13795 -2.07121,7.02749 -0.10795,7.02749 2.4248,0 4.84373,-4.64661 4.17071,-8.01168 C 414.19571,500.72857 414.41727,500 415.55638,500 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.45673,3.12861 -6.83812,1.74721 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.24764,-4.575 c 1.05331,-3.93041 0.6481,-14.15649 -0.66372,-16.75 -1.59251,-3.14844 -5.86543,-5.24907 -9.05092,-4.44956 l -2.4422,0.61295 4.26465,9.1683 c 2.34556,5.04257 4.57799,10.18081 4.96095,11.41831 0.38297,1.2375 1.0635,2.25 1.51229,2.25 0.44879,0 1.08732,-1.0125 1.41895,-2.25 z M 152.11086,450.5 C 184.75665,448.025 211.8118,446 212.23342,446 212.65504,446 213,424.00812 213,397.12917 l 0,-48.87084 -5.80453,-0.6567 c -11.69664,-1.32333 -21.14568,-7.80438 -24.05737,-16.50085 -2.53292,-7.5652 -0.81613,-22.25822 3.82728,-32.75542 C 190.82878,289.6115 203.84592,279 210.69634,279 l 2.30366,0 0,-79.10841 0,-79.10841 2.25,0.50179 c 1.2375,0.27599 42.16916,4.92702 90.95925,10.33563 l 88.70925,9.83384 9.79075,-9.51707 C 410.09416,126.70299 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.27093 -106,0.27093 -12,2.79108 c -28.73501,6.68347 -51.03471,19.13644 -71.31721,39.82615 -8.35987,8.5277 -11.68679,12.90117 -22.05107,28.98765 -3.37777,5.24267 -8.54958,16.94256 -9.596705,21.71011 -0.384091,1.74875 -1.307039,4.41252 -2.050997,5.91949 -0.743957,1.50696 -2.154437,6.78993 -3.1344,11.73993 -1.631785,8.24249 -1.808431,18.36363 -2.098738,120.25 -0.174342,61.1875 -0.132263,111.25 0.09351,111.25 0.225773,0 27.12069,-2.025 59.76647,-4.5 z M 97.666667,392.33333 c -1.462364,-1.46236 -0.528078,-5.37223 1.918231,-8.02757 2.264862,-2.45838 2.388672,-2.49964 1.000002,-0.33325 C 98.573442,387.11046 98.513693,391 100.47695,391 c 2.4248,0 4.84373,-4.64661 4.17071,-8.01168 C 104.19571,380.72857 104.41727,380 105.55638,380 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.456727,3.12861 -6.838123,1.74721 z M 133.98983,242.75 C 127.9824,238.66138 126.5,235.67303 126.5,227.65136 c 0,-6.16105 0.48832,-8.18662 3.3987,-14.09784 4.50456,-9.14915 12.14197,-16.98652 18.09403,-18.56777 14.48125,-3.84715 28.45783,5.85556 26.5699,18.44515 -1.57708,10.51673 -11.9998,25.18186 -20.99029,29.53408 -5.97906,2.89441 -15.16199,2.7936 -19.58251,-0.21498 z m 17.8378,-1.16086 c 3.1903,-1.64977 9.48156,-13.46927 11.14533,-20.93891 2.03216,-9.12356 -0.79773,-16.41881 -7.65706,-19.73935 -5.65029,-2.73526 -12.18279,-1.84466 -16.90935,2.30531 -5.04071,4.42581 -9.74548,14.74279 -10.236,22.44632 -0.49944,7.84355 0.97136,11.6823 5.70965,14.90205 4.19503,2.8506 13.4001,3.37609 17.94743,1.02458 z m 16.9526,-18.54229 c 3.59962,-7.69053 4.04451,-13.97633 1.30315,-18.41195 -2.42232,-3.91938 -9.1458,-7.65853 -13.6491,-7.5907 l -2.93428,0.0442 3.50105,1.85197 c 5.02894,2.6602 7.10628,5.34397 8.60319,11.11472 1.34218,5.17423 0.81699,11.08982 -1.53237,17.26002 -2.95689,7.7658 0.57383,4.56511 4.70836,-4.26825 z m 485.81296,227.38437 c 3.60231,-8.62155 1.74491,-16.37659 -4.28478,-17.88995 -3.62141,-0.90892 -4.01967,0.0727 -1.23297,3.03904 2.04879,2.18083 2.47144,3.77858 2.7765,10.49605 0.19791,4.358 0.56014,7.92364 0.80497,7.92364 0.24483,0 1.11615,-1.60595 1.93628,-3.56878 z M 213,315.55902 c 0,-18.88461 -0.36481,-29.66645 -1.01742,-30.06978 -0.55957,-0.34584 -3.54967,-0.31242 -6.64466,0.0743 -7.31529,0.91398 -11.88643,4.92507 -16.13338,14.1567 -5.79522,12.59715 -6.32598,28.08738 -1.20863,35.27404 3.76057,5.28123 13.42204,9.79913 21.25409,9.93884 L 213,345 213,315.55902 z M 213,283 c 0,-1.2702 -3.03451,-1.2702 -5,0 -1.13826,0.7356 -0.71622,0.97307 1.75,0.98469 C 211.5375,283.99311 213,283.55 213,283 z"
+       id="path3376"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#3d4035"
+       d="m 459.40089,733.75 -8.04454,-17.25 -86.42817,0 -86.42818,0 -9,2.80013 c -16.01745,4.98345 -29.92557,6.91119 -50.5,6.99958 -19.87358,0.0854 -29.7479,-0.97706 -45.5,-4.89565 -27.0332,-6.72494 -50.36455,-20.1896 -71.14151,-41.05616 C 70.001666,647.85153 52.620419,607.23188 45.940445,548.5 45.377448,543.55 44.65155,521.45541 44.327338,499.40091 l -0.589475,-40.0991 2.381068,-0.63725 c 1.309588,-0.35049 4.455762,-0.6434 6.991498,-0.65091 2.535736,-0.008 6.683596,-0.29781 9.217466,-0.64511 l 4.607038,-0.63147 0.327809,-112.61853 C 67.587552,232.52999 67.610787,231.3994 69.803204,220.5 76.574459,186.83734 91.503219,159.34232 116.07022,135.28778 126.2905,125.2807 144.00716,111 146.20169,111 c 0.61024,0 2.502,-1.05841 4.20392,-2.35203 3.04416,-2.31384 21.78237,-10.458686 30.59439,-13.298304 2.475,-0.797554 10.35,-2.87948 17.5,-4.626503 l 13,-3.176407 124.86928,-0.303207 124.86929,-0.303208 15.63071,-8.867007 C 507.95773,60.437452 508.47322,60.17089 509.19493,61.357463 509.57714,61.985858 513.21268,67.9 517.27391,74.5 l 7.38404,12 12.92103,0.716072 c 17.7383,0.983042 33.67226,3.989032 48.45284,9.140776 16.43851,5.729612 19.12901,7.104082 38.45116,19.643152 15.19015,9.85761 38.28307,34.09349 46.68917,49 1.39571,2.475 4.18847,7.19101 6.20614,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.18182,19.40842 -4.26871,24.17236 -8.09932,35.5 -4.41981,13.06997 -8.6546,22.4285 -12.44393,27.5 -1.23284,1.65 -2.9983,4.46929 -3.92323,6.26509 -6.12955,11.90081 -25.6121,32.79651 -42.11473,45.1695 -12.19923,9.14648 -34.22583,20.09918 -49.5,24.61381 -8.08623,2.39007 -27.35062,6.26535 -34.28349,6.89655 -5.47112,0.49813 -7.99615,1.35984 -13.05153,4.45407 -11.37093,6.95978 -30.91613,16.85678 -47.4615,24.03285 C 475.24039,747.81934 467.80312,751 467.67619,751 c -0.12692,0 -3.8508,-7.7625 -8.2753,-17.25 z m 44.09727,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 28.49098,-27.20196 45.36553,-56.27563 52.79742,-90.96624 1.91201,-8.92491 2.25264,-13.57517 2.27076,-31 0.0182,-17.54231 -0.30095,-21.97871 -2.21236,-30.74903 C 621.90844,482.16534 617.67323,470.10512 610.53444,455.5 593.55923,420.77071 565.143,388.18867 522,353.98642 509.16373,343.81028 493.73161,328.4423 488.76962,320.89415 c -5.25354,-7.99165 -7.95132,-15.41813 -8.02681,-22.09631 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52498,-5.74283 9.82725,-6.2319 C 566.45792,218.45005 498.00621,106 496.31305,106 c -0.24409,0 -4.47565,2.22429 -9.40346,4.94286 -25.60148,14.12384 -59.03767,42.22272 -80.90959,67.99426 -5.225,6.15659 -9.72633,11.72684 -10.00296,12.37834 -0.27663,0.65149 -3.81375,6.13454 -7.86028,12.18454 -7.98737,11.94198 -17.51739,30.17051 -21.17373,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.40768,1.88465 -4.86914,16.69801 -6.51201,27.86821 -3.21318,21.84703 -0.005,55.81318 6.62258,70.1216 1.01907,2.2 3.62973,8.14054 5.80147,13.2012 9.79175,22.81708 29.78309,49.99506 50.3096,68.39529 C 432.84828,442.49792 439.59539,448 440.85781,448 c 0.62821,0 1.14219,0.37736 1.14219,0.83858 0,0.46122 3.93534,3.94872 8.74521,7.75 20.66812,16.33421 39.54472,37.09413 46.76394,51.42958 4.93957,9.80868 6.24964,18.07159 4.18908,26.42155 -2.2788,9.23433 -5.78902,14.766 -15.63887,24.64492 -9.89895,9.92816 -24.6182,19.99769 -42.45842,29.04605 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.20466,595.40204 483.40225,707 484.66111,707 c 0.33466,0 8.81133,-4.23268 18.83705,-9.40596 z M 230.22958,691.9307 c 17.48074,-1.22407 30.53011,-4.17574 44.02666,-9.95848 C 314.62273,664.67676 345.1874,626.52953 357.56178,578 c 5.52024,-21.64915 5.67608,-24.03743 6.14164,-94.12604 l 0.43591,-65.62604 -6.54437,-9.71985 C 345.0495,389.89528 335.06675,367.7781 329.4355,346.1396 c -6.83657,-26.26996 -7.20557,-60.35968 -0.95103,-87.8598 4.59432,-20.20043 16.17275,-47.28374 28.84401,-67.46952 C 363.04517,181.70339 364,179.52522 364,175.59115 364,173.06602 363.80602,171 363.56893,171 363.33184,171 337.87582,168.075 307,164.5 276.12418,160.925 249.99316,158 248.93107,158 247.02992,158 247,160.87105 247,343.27623 c 0,121.57547 -0.35587,188.18965 -1.03505,193.75 -1.48107,12.1253 -3.47363,19.42733 -7.60887,27.88381 -4.84907,9.91626 -10.43,15.42842 -17.28623,17.0732 -16.79921,4.03007 -24.72812,-5.40675 -30.23347,-35.98324 -1.62347,-9.01667 -2.18016,-17.27645 -2.57797,-38.25 -0.45197,-23.8297 -0.68482,-26.74829 -2.13289,-26.73429 -1.52155,0.0147 -84.46936,6.43758 -101.294162,7.84349 -4.217754,0.35244 -7.952282,0.92533 -8.298952,1.27308 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.32831,0.8189 9.72958,0.89728 0.40128,0.0784 7.60128,-0.33868 16,-0.9268 z m 135.31747,-5 c 9.84348,-10.13321 22.32956,-15.48267 30.45538,-13.04812 5.47681,1.64089 7.27182,4.68086 6.84195,11.58729 l -0.34438,5.53286 18.33333,-0.001 c 10.08334,-7.5e-4 18.18334,-0.39341 18,-0.87259 C 438.65,689.6496 427.475,665.7851 414,637.09654 c -23.0488,-49.07137 -24.55188,-51.96659 -25.37588,-48.87877 -3.53486,13.24638 -10.6554,32.3318 -16.14808,43.28223 -8.99369,17.93021 -17.56946,29.62019 -33.56219,45.75 L 325.2807,691 l 18.1567,0 18.1567,0 3.95295,-4.0693 z m 28.20127,-0.47128 c -1.32035,-11.71404 -10.74925,-11.81472 -23.18331,-0.24754 l -5.06501,4.71188 14.38005,0.0381 14.38005,0.0381 -0.51178,-4.54058 z m 6.56937,0.97031 c 0.96668,-5.95695 -1.22846,-9.61628 -6.57328,-10.95774 -3.29107,-0.82601 -3.47917,0.11699 -0.62859,3.15129 1.25284,1.3336 2.32556,4.11299 2.63005,6.81445 0.39116,3.47034 0.93047,4.56227 2.25334,4.56227 1.21922,0 1.9123,-1.0673 2.31848,-3.57027 z m 197.49482,-13.53671 c 11.67358,-6.40683 17.04413,-10.15866 25.85824,-18.06437 13.40199,-12.02076 17.04512,-16.50498 30.69543,-37.78222 2.1264,-3.31449 5.87354,-11.76837 8.32697,-18.78639 8.22364,-23.52359 7.68929,-10.75039 8.04288,-192.26004 0.20362,-104.5302 -0.0404,-164.14566 -0.69177,-169 -1.94929,-14.52714 -3.9474,-23.58667 -7.05771,-32 -1.72829,-4.675 -3.60336,-10.05273 -4.16682,-11.95051 -0.56345,-1.89778 -2.73987,-6.17278 -4.83647,-9.5 -2.09661,-3.32722 -5.50446,-8.74949 -7.57302,-12.04949 -4.76111,-7.59549 -29.19428,-31.87416 -36.73227,-36.5 -3.13686,-1.925 -8.62902,-5.35664 -12.2048,-7.62587 -7.4663,-4.73821 -30.88805,-12.73095 -41.97317,-14.32347 -3.85,-0.55311 -8.74781,-1.27248 -10.88403,-1.59861 -3.19321,-0.4875 -3.78134,-0.32537 -3.30669,0.91153 0.31753,0.82747 8.99798,15.37168 19.28989,32.32046 10.29191,16.94878 26.24315,43.23418 35.44721,58.41201 l 16.73466,27.59605 -20.31855,11.25584 c -23.71457,13.13712 -43.25734,25.37386 -56.11159,35.13436 -10.20326,7.74756 -21.35123,19.08037 -21.35027,21.70429 10e-4,3.08499 8.44754,12.55861 18.46749,20.71341 33.68568,27.41532 47.16535,39.64297 62.83634,57 12.63608,13.99558 26.22573,32.10499 34.03071,45.34892 3.35438,5.69191 6.25512,9.88022 6.44607,9.30735 0.19096,-0.57287 2.79257,-1.58883 5.78137,-2.25769 6.70684,-1.50093 12.63189,-0.0576 15.07595,3.67255 2.50806,3.82778 1.35969,13.6985 -2.5709,22.09798 -1.74421,3.7273 -3.58084,7.03002 -4.08139,7.33937 -0.50936,0.31481 -0.009,3.40891 1.1359,7.02699 6.84581,21.63015 9.87463,48.13161 8.03681,70.32016 -4.04541,48.84138 -23.59969,89.49833 -61.5821,128.04053 -5.2054,5.28211 -9.19056,9.60384 -8.85593,9.60384 0.33464,0 3.97584,-1.84814 8.09156,-4.10698 z m 53.85416,-75.55969 c -1.46237,-1.46236 -0.52808,-5.37223 1.91823,-8.02757 2.26486,-2.45838 2.38867,-2.49964 1,-0.33325 -2.01146,3.13795 -2.07121,7.02749 -0.10795,7.02749 2.4248,0 4.84373,-4.64661 4.17071,-8.01168 C 658.19571,586.72857 658.41727,586 659.55638,586 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.45673,3.12861 -6.83812,1.74721 z M 564.50031,345.0005 c -0.41948,-0.67874 0.69101,-2.71759 2.6345,-4.83691 1.8478,-2.01497 3.68776,-4.08046 4.08879,-4.58996 0.4218,-0.5359 1.49217,-0.23585 2.53937,0.71186 2.11622,1.91515 8.48579,4.71451 10.72725,4.71451 1.93983,0 9.88118,-7.20496 13.6674,-12.40004 5.17751,-7.10407 3.32036,-16.22675 -4.48028,-22.00801 -2.94798,-2.18482 -11.43089,-2.89999 -14.837,-1.25086 -1.2135,0.58754 -1.83693,0.24501 -2.3191,-1.27416 -2.20675,-6.95287 -11.61094,-12.63274 -23.35405,-14.1052 -15.04715,-1.88675 -21.32411,1.29977 -26.82415,13.61737 -2.78365,6.23413 -4.34304,7.9784 -4.34304,4.85795 0,-3.37955 5.60017,-12.72475 10.20853,-17.03534 8.79125,-8.22318 18.80256,-10.90501 29.50186,-7.90293 7.69116,2.15803 12.43652,6.05822 15.8434,13.02163 1.4745,3.01377 2.79815,5.47959 2.94144,5.47959 0.14329,0 1.87602,-0.675 3.85053,-1.5 4.65174,-1.94362 13.71459,-1.91871 18.43636,0.0507 4.92567,2.05444 9.91424,6.99925 11.30134,11.20221 3.5455,10.74295 -6.39965,26.00764 -20.0116,30.71556 -6.08717,2.10536 -11.30015,1.91913 -17.18866,-0.61404 l -4.98756,-2.14559 -3.33509,3.23249 c -2.27233,2.20243 -3.56617,2.85861 -4.06024,2.05919 z m 40.46947,-13.61886 c 11.19619,-12.75176 5.94454,-27.2844 -10.53082,-29.14141 -4.74172,-0.53446 -6.26029,1.08583 -2.01603,2.15107 3.5404,0.88859 8.64483,5.52663 10.21304,9.27989 3.15751,7.55697 1.21326,14.35835 -6.48784,22.69575 l -2.64813,2.86694 4.09468,-2.05803 c 2.25207,-1.13191 5.57087,-3.73931 7.3751,-5.79421 z m -36.7998,-41.44281 c -3.19771,-2.59247 -8.54523,-3.9295 -15.66998,-3.91794 -9.54954,0.0155 -9.74428,1.61957 -0.2684,2.21075 5.15829,0.32181 10.08705,1.28222 12.82352,2.49876 5.12711,2.27933 6.47895,1.93579 3.11486,-0.79157 z M 418.33103,564.12527 c 22.32309,-10.51946 40.2898,-22.75397 47.16113,-32.11459 3.35419,-4.56932 3.59602,-5.31898 2.61946,-8.12034 -3.43575,-9.8558 -19.58442,-26.86398 -45.01044,-47.40614 -9.13065,-7.37682 -18.91436,-15.45157 -21.74157,-17.9439 l -5.1404,-4.5315 -0.51383,47.2456 c -0.48999,45.05232 -1.25411,57.99715 -4.28013,72.50848 l -0.6804,3.26288 8.37757,-3.89826 c 4.60767,-2.14404 13.25154,-6.19504 19.20861,-9.00223 z m -10.66436,-51.79194 c -1.46237,-1.46236 -0.52808,-5.37223 1.91823,-8.02757 2.26486,-2.45838 2.38867,-2.49964 1,-0.33325 -2.01146,3.13795 -2.07121,7.02749 -0.10795,7.02749 2.4248,0 4.84373,-4.64661 4.17071,-8.01168 C 414.19571,500.72857 414.41727,500 415.55638,500 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.45673,3.12861 -6.83812,1.74721 z M 649.12207,459.325 c -1.17884,-2.02721 -1.46351,-1.37835 -0.49853,1.13634 0.34294,0.8937 0.83419,1.41426 1.09166,1.15679 0.25747,-0.25747 -0.009,-1.28938 -0.59313,-2.29313 z m 0.24764,-4.575 c 1.05331,-3.93041 0.6481,-14.15649 -0.66372,-16.75 -1.59251,-3.14844 -5.86543,-5.24907 -9.05092,-4.44956 l -2.4422,0.61295 4.26465,9.1683 c 2.34556,5.04257 4.57799,10.18081 4.96095,11.41831 0.38297,1.2375 1.0635,2.25 1.51229,2.25 0.44879,0 1.08732,-1.0125 1.41895,-2.25 z M 152.11086,450.5 C 184.75665,448.025 211.8118,446 212.23342,446 212.65504,446 213,424.00185 213,397.11522 l 0,-48.88477 -5.75,-0.66562 c -3.1625,-0.36608 -8.56027,-2.02003 -11.99504,-3.67544 C 185.55597,339.21491 182,333.09059 182,321.06088 c 0,-12.95693 5.1695,-26.1396 13.19384,-33.64543 5.08412,-4.7556 11.75773,-8.35641 15.55616,-8.39349 L 213,279 l 0,-79.10841 0,-79.10841 2.25,0.50179 c 1.2375,0.27599 42.16916,4.92702 90.95925,10.33563 l 88.70925,9.83384 9.79075,-9.51707 C 410.09416,126.70299 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.27093 -106,0.27093 -12,2.79108 c -28.73501,6.68347 -51.03471,19.13644 -71.31721,39.82615 -8.35987,8.5277 -11.68679,12.90117 -22.05107,28.98765 -3.37777,5.24267 -8.54958,16.94256 -9.596705,21.71011 -0.384091,1.74875 -1.307039,4.41252 -2.050997,5.91949 -0.743957,1.50696 -2.154437,6.78993 -3.1344,11.73993 -1.631785,8.24249 -1.808431,18.36363 -2.098738,120.25 -0.174342,61.1875 -0.132263,111.25 0.09351,111.25 0.225773,0 27.12069,-2.025 59.76647,-4.5 z M 97.666667,392.33333 c -1.462364,-1.46236 -0.528078,-5.37223 1.918231,-8.02757 2.264862,-2.45838 2.388672,-2.49964 1.000002,-0.33325 C 98.573442,387.11046 98.513693,391 100.47695,391 c 2.4248,0 4.84373,-4.64661 4.17071,-8.01168 C 104.19571,380.72857 104.41727,380 105.55638,380 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.456727,3.12861 -6.838123,1.74721 z M 133.98983,242.75 C 127.9824,238.66138 126.5,235.67303 126.5,227.65136 c 0,-6.11322 0.49417,-8.19849 3.28727,-13.8715 4.49966,-9.13917 12.36007,-17.25486 18.21273,-18.80423 14.27657,-3.77942 28.42896,6.00972 26.57378,18.38096 -1.58791,10.58889 -11.98134,25.24184 -21.00144,29.60839 -5.97906,2.89441 -15.16199,2.7936 -19.58251,-0.21498 z m 17.8378,-1.16086 c 3.1903,-1.64977 9.48156,-13.46927 11.14533,-20.93891 2.03216,-9.12356 -0.79773,-16.41881 -7.65706,-19.73935 -5.65029,-2.73526 -12.18279,-1.84466 -16.90935,2.30531 -5.04071,4.42581 -9.74548,14.74279 -10.236,22.44632 -0.49944,7.84355 0.97136,11.6823 5.70965,14.90205 4.19503,2.8506 13.4001,3.37609 17.94743,1.02458 z m 16.9526,-18.54229 c 3.59962,-7.69053 4.04451,-13.97633 1.30315,-18.41195 -2.42232,-3.91938 -9.1458,-7.65853 -13.6491,-7.5907 l -2.93428,0.0442 3.50105,1.85197 c 5.02894,2.6602 7.10628,5.34397 8.60319,11.11472 1.34218,5.17423 0.81699,11.08982 -1.53237,17.26002 -2.95689,7.7658 0.57383,4.56511 4.70836,-4.26825 z m 485.81296,227.38437 c 3.60231,-8.62155 1.74491,-16.37659 -4.28478,-17.88995 -3.62141,-0.90892 -4.01967,0.0727 -1.23297,3.03904 2.04879,2.18083 2.47144,3.77858 2.7765,10.49605 0.19791,4.358 0.56014,7.92364 0.80497,7.92364 0.24483,0 1.11615,-1.60595 1.93628,-3.56878 z M 213,315.55902 c 0,-18.88461 -0.36481,-29.66645 -1.01742,-30.06978 -0.55957,-0.34584 -3.54967,-0.31242 -6.64466,0.0743 -7.31529,0.91398 -11.88643,4.92507 -16.13338,14.1567 -5.79522,12.59715 -6.32598,28.08738 -1.20863,35.27404 3.76057,5.28123 13.42204,9.79913 21.25409,9.93884 L 213,345 213,315.55902 z M 213,283 c 0,-1.2702 -3.03451,-1.2702 -5,0 -1.13826,0.7356 -0.71622,0.97307 1.75,0.98469 C 211.5375,283.99311 213,283.55 213,283 z"
+       id="path3374"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#3b3c3b"
+       d="m 459.40089,733.75 -8.04454,-17.25 -86.42817,0 -86.42818,0 -9,2.80013 c -16.01745,4.98345 -29.92557,6.91119 -50.5,6.99958 -19.87358,0.0854 -29.7479,-0.97706 -45.5,-4.89565 -27.0332,-6.72494 -50.36455,-20.1896 -71.14151,-41.05616 C 70.001666,647.85153 52.620419,607.23188 45.940445,548.5 45.377448,543.55 44.65155,521.45541 44.327338,499.40091 l -0.589475,-40.0991 2.381068,-0.63725 c 1.309588,-0.35049 4.455762,-0.6434 6.991498,-0.65091 2.535736,-0.008 6.683596,-0.29781 9.217466,-0.64511 l 4.607038,-0.63147 0.327809,-112.61853 C 67.587552,232.52999 67.610787,231.3994 69.803204,220.5 76.574459,186.83734 91.503219,159.34232 116.07022,135.28778 126.2905,125.2807 144.00716,111 146.20169,111 c 0.61024,0 2.502,-1.05841 4.20392,-2.35203 3.04416,-2.31384 21.78237,-10.458686 30.59439,-13.298304 2.475,-0.797554 10.35,-2.87948 17.5,-4.626503 l 13,-3.176407 124.86928,-0.303207 124.86929,-0.303208 15.63071,-8.867007 C 507.95773,60.437452 508.47322,60.17089 509.19493,61.357463 509.57714,61.985858 513.21268,67.9 517.27391,74.5 l 7.38404,12 12.92103,0.716072 c 17.7383,0.983042 33.67226,3.989032 48.45284,9.140776 16.43851,5.729612 19.12901,7.104082 38.45116,19.643152 15.19015,9.85761 38.28307,34.09349 46.68917,49 1.39571,2.475 4.18847,7.19101 6.20614,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.18182,19.40842 -4.26871,24.17236 -8.09932,35.5 -4.41981,13.06997 -8.6546,22.4285 -12.44393,27.5 -1.23284,1.65 -2.9983,4.46929 -3.92323,6.26509 -6.12955,11.90081 -25.6121,32.79651 -42.11473,45.1695 -12.19923,9.14648 -34.22583,20.09918 -49.5,24.61381 -8.08623,2.39007 -27.35062,6.26535 -34.28349,6.89655 -5.47112,0.49813 -7.99615,1.35984 -13.05153,4.45407 -11.37093,6.95978 -30.91613,16.85678 -47.4615,24.03285 C 475.24039,747.81934 467.80312,751 467.67619,751 c -0.12692,0 -3.8508,-7.7625 -8.2753,-17.25 z m 44.09727,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 28.49098,-27.20196 45.36553,-56.27563 52.79742,-90.96624 1.91201,-8.92491 2.25264,-13.57517 2.27076,-31 0.0182,-17.54231 -0.30095,-21.97871 -2.21236,-30.74903 C 621.90844,482.16534 617.67323,470.10512 610.53444,455.5 593.55923,420.77071 565.143,388.18867 522,353.98642 509.16373,343.81028 493.73161,328.4423 488.76962,320.89415 c -5.25354,-7.99165 -7.95132,-15.41813 -8.02681,-22.09631 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52498,-5.74283 9.82725,-6.2319 C 566.45792,218.45005 498.00621,106 496.31305,106 c -0.24409,0 -4.47565,2.22429 -9.40346,4.94286 -25.60148,14.12384 -59.03767,42.22272 -80.90959,67.99426 -5.225,6.15659 -9.72633,11.72684 -10.00296,12.37834 -0.27663,0.65149 -3.81375,6.13454 -7.86028,12.18454 -7.98737,11.94198 -17.51739,30.17051 -21.17373,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.40768,1.88465 -4.86914,16.69801 -6.51201,27.86821 -3.21318,21.84703 -0.005,55.81318 6.62258,70.1216 1.01907,2.2 3.62973,8.14054 5.80147,13.2012 9.79175,22.81708 29.78309,49.99506 50.3096,68.39529 C 432.84828,442.49792 439.59539,448 440.85781,448 c 0.62821,0 1.14219,0.37736 1.14219,0.83858 0,0.46122 3.93534,3.94872 8.74521,7.75 20.66812,16.33421 39.54472,37.09413 46.76394,51.42958 4.93957,9.80868 6.24964,18.07159 4.18908,26.42155 -2.2788,9.23433 -5.78902,14.766 -15.63887,24.64492 -9.89895,9.92816 -24.6182,19.99769 -42.45842,29.04605 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.20466,595.40204 483.40225,707 484.66111,707 c 0.33466,0 8.81133,-4.23268 18.83705,-9.40596 z M 230.22958,691.9307 c 17.48074,-1.22407 30.53011,-4.17574 44.02666,-9.95848 C 314.62273,664.67676 345.1874,626.52953 357.56178,578 c 5.52024,-21.64915 5.67608,-24.03743 6.14164,-94.12604 l 0.43591,-65.62604 -6.54437,-9.71985 C 345.0495,389.89528 335.06675,367.7781 329.4355,346.1396 c -6.83657,-26.26996 -7.20557,-60.35968 -0.95103,-87.8598 4.59432,-20.20043 16.17275,-47.28374 28.84401,-67.46952 C 363.04517,181.70339 364,179.52522 364,175.59115 364,173.06602 363.80602,171 363.56893,171 363.33184,171 337.87582,168.075 307,164.5 276.12418,160.925 249.99316,158 248.93107,158 247.02992,158 247,160.87105 247,343.27623 c 0,121.57547 -0.35587,188.18965 -1.03505,193.75 -1.48107,12.1253 -3.47363,19.42733 -7.60887,27.88381 -4.84907,9.91626 -10.43,15.42842 -17.28623,17.0732 -16.79921,4.03007 -24.72812,-5.40675 -30.23347,-35.98324 -1.62347,-9.01667 -2.18016,-17.27645 -2.57797,-38.25 -0.45197,-23.8297 -0.68482,-26.74829 -2.13289,-26.73429 -1.52155,0.0147 -84.46936,6.43758 -101.294162,7.84349 -4.217754,0.35244 -7.952282,0.92533 -8.298952,1.27308 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.32831,0.8189 9.72958,0.89728 0.40128,0.0784 7.60128,-0.33868 16,-0.9268 z m 135.31747,-5 c 9.84348,-10.13321 22.32956,-15.48267 30.45538,-13.04812 5.47681,1.64089 7.27182,4.68086 6.84195,11.58729 l -0.34438,5.53286 18.33333,-0.001 c 10.08334,-7.5e-4 18.18334,-0.39341 18,-0.87259 C 438.65,689.6496 427.475,665.7851 414,637.09654 c -23.0488,-49.07137 -24.55188,-51.96659 -25.37588,-48.87877 -3.53486,13.24638 -10.6554,32.3318 -16.14808,43.28223 -8.99369,17.93021 -17.56946,29.62019 -33.56219,45.75 L 325.2807,691 l 18.1567,0 18.1567,0 3.95295,-4.0693 z m 28.20127,-0.47128 c -1.32035,-11.71404 -10.74925,-11.81472 -23.18331,-0.24754 l -5.06501,4.71188 14.38005,0.0381 14.38005,0.0381 -0.51178,-4.54058 z m 6.66255,1.16398 c 1.08245,-5.76992 -1.3347,-9.81323 -6.66646,-11.15141 -3.29107,-0.82601 -3.47917,0.11699 -0.62859,3.15129 1.25284,1.3336 2.32556,4.11299 2.63005,6.81445 0.3936,3.49197 0.92681,4.56227 2.27289,4.56227 1.20592,0 1.95775,-1.06125 2.39211,-3.3766 z m 197.40164,-13.73038 c 11.67358,-6.40683 17.04413,-10.15866 25.85824,-18.06437 13.40199,-12.02076 17.04512,-16.50498 30.69543,-37.78222 2.1264,-3.31449 5.87354,-11.76837 8.32697,-18.78639 8.22364,-23.52359 7.68929,-10.75039 8.04288,-192.26004 0.20362,-104.5302 -0.0404,-164.14566 -0.69177,-169 -1.94929,-14.52714 -3.9474,-23.58667 -7.05771,-32 -1.72829,-4.675 -3.60336,-10.05273 -4.16682,-11.95051 -0.56345,-1.89778 -2.73987,-6.17278 -4.83647,-9.5 -2.09661,-3.32722 -5.50446,-8.74949 -7.57302,-12.04949 -4.76111,-7.59549 -29.19428,-31.87416 -36.73227,-36.5 -3.13686,-1.925 -8.62902,-5.35664 -12.2048,-7.62587 -7.4663,-4.73821 -30.88805,-12.73095 -41.97317,-14.32347 -3.85,-0.55311 -8.74781,-1.27248 -10.88403,-1.59861 -3.19321,-0.4875 -3.78134,-0.32537 -3.30669,0.91153 0.31753,0.82747 8.99798,15.37168 19.28989,32.32046 10.29191,16.94878 26.24315,43.23418 35.44721,58.41201 l 16.73466,27.59605 -20.31855,11.25584 c -23.71457,13.13712 -43.25734,25.37386 -56.11159,35.13436 -10.20326,7.74756 -21.35123,19.08037 -21.35027,21.70429 10e-4,3.08499 8.44754,12.55861 18.46749,20.71341 33.68568,27.41532 47.16535,39.64297 62.83634,57 12.63608,13.99558 26.22573,32.10499 34.03071,45.34892 3.35438,5.69191 6.25512,9.88022 6.44607,9.30735 0.19096,-0.57287 2.79257,-1.58883 5.78137,-2.25769 6.70684,-1.50093 12.63189,-0.0576 15.07595,3.67255 2.50806,3.82778 1.35969,13.6985 -2.5709,22.09798 -1.74421,3.7273 -3.58084,7.03002 -4.08139,7.33937 -0.50936,0.31481 -0.009,3.40891 1.1359,7.02699 6.84581,21.63015 9.87463,48.13161 8.03681,70.32016 -4.04541,48.84138 -23.59969,89.49833 -61.5821,128.04053 -5.2054,5.28211 -9.19056,9.60384 -8.85593,9.60384 0.33464,0 3.97584,-1.84814 8.09156,-4.10698 z m 53.85416,-75.55969 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.94264,3.8979 c -2.02251,4.05817 -1.87685,5.6021 0.52853,5.6021 2.37429,0 4.7775,-4.68268 4.1117,-8.01168 C 658.19571,586.72857 658.41727,586 659.55638,586 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.45673,3.12861 -6.83812,1.74721 z M 564.50031,345.0005 c -0.41948,-0.67874 0.69101,-2.71759 2.6345,-4.83691 1.8478,-2.01497 3.68776,-4.08046 4.08879,-4.58996 0.4218,-0.5359 1.49217,-0.23585 2.53937,0.71186 2.11622,1.91515 8.48579,4.71451 10.72725,4.71451 1.93983,0 9.88118,-7.20496 13.6674,-12.40004 5.17751,-7.10407 3.32036,-16.22675 -4.48028,-22.00801 -2.97598,-2.20557 -11.42465,-2.89392 -14.92734,-1.21619 -1.28004,0.61311 -1.75,0.41601 -1.75,-0.73397 0,-2.62087 -6.01326,-8.61482 -11.36142,-11.32493 -5.81499,-2.94668 -16.90886,-4.67414 -24.0077,-3.73831 -3.55795,0.46904 -5.86333,1.5401 -8.56119,3.97745 C 529.73017,296.57306 524,306.29071 524,308.93705 524,309.52167 523.55,310 523,310 c -3.44107,0 2.79897,-12.60289 9.20853,-18.59829 8.79125,-8.22318 18.80256,-10.90501 29.50186,-7.90293 7.69116,2.15803 12.43652,6.05822 15.8434,13.02163 1.4745,3.01377 2.79815,5.47959 2.94144,5.47959 0.14329,0 1.87602,-0.675 3.85053,-1.5 4.65174,-1.94362 13.71459,-1.91871 18.43636,0.0507 4.92567,2.05444 9.91424,6.99925 11.30134,11.20221 3.5455,10.74295 -6.39965,26.00764 -20.0116,30.71556 -6.08717,2.10536 -11.30015,1.91913 -17.18866,-0.61404 l -4.98756,-2.14559 -3.33509,3.23249 c -2.27233,2.20243 -3.56617,2.85861 -4.06024,2.05919 z m 38.13139,-11.32534 c 14.02192,-12.34259 9.56771,-29.43307 -8.19274,-31.43493 -4.74172,-0.53446 -6.26029,1.08583 -2.01603,2.15107 3.5404,0.88859 8.64483,5.52663 10.21304,9.27989 2.8975,6.93469 1.47459,13.16779 -4.67493,20.47868 -4.92899,5.85984 -2.21206,5.5837 4.67066,-0.47471 z M 569.47676,290.9624 c -1.69987,-2.75045 -9.01459,-4.91858 -16.66774,-4.94044 -10.49267,-0.03 -10.70512,1.54717 -0.30726,2.28095 4.91881,0.34713 10.2241,1.38976 12.71858,2.49953 4.53764,2.01876 5.42585,2.05214 4.25642,0.15996 z M 418.33103,564.12527 c 22.32309,-10.51946 40.2898,-22.75397 47.16113,-32.11459 3.35419,-4.56932 3.59602,-5.31898 2.61946,-8.12034 -3.43575,-9.8558 -19.58442,-26.86398 -45.01044,-47.40614 -9.13065,-7.37682 -18.91436,-15.45157 -21.74157,-17.9439 l -5.1404,-4.5315 -0.51383,47.2456 c -0.48999,45.05232 -1.25411,57.99715 -4.28013,72.50848 l -0.6804,3.26288 8.37757,-3.89826 c 4.60767,-2.14404 13.25154,-6.19504 19.20861,-9.00223 z m -10.66436,-51.79194 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.94264,3.8979 c -2.02251,4.05817 -1.87685,5.6021 0.52853,5.6021 2.37429,0 4.7775,-4.68268 4.1117,-8.01168 C 414.19571,500.72857 414.41727,500 415.55638,500 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.45673,3.12861 -6.83812,1.74721 z m 242.09864,-61.08601 c 0.29348,-11.88881 -0.5954,-14.91854 -4.99594,-17.02858 -1.46966,-0.70469 -3.7711,-1.00543 -5.1143,-0.6683 l -2.4422,0.61295 4.24882,9.1683 c 2.33685,5.04257 5.05009,11.30581 6.02942,13.91831 0.97933,2.6125 1.83197,4.74879 1.89475,4.74732 0.0628,-10e-4 0.23353,-4.83898 0.37945,-10.75 z M 152.11086,450.5 C 184.75665,448.025 211.8118,446 212.23342,446 212.65504,446 213,424.00185 213,397.11522 l 0,-48.88477 -5.75,-0.66562 c -3.1625,-0.36608 -8.56027,-2.02003 -11.99504,-3.67544 C 185.55597,339.21491 182,333.09059 182,321.06088 c 0,-12.95693 5.1695,-26.1396 13.19384,-33.64543 5.08412,-4.7556 11.75773,-8.35641 15.55616,-8.39349 L 213,279 l 0,-79.10841 0,-79.10841 2.25,0.50179 c 1.2375,0.27599 42.16916,4.92702 90.95925,10.33563 l 88.70925,9.83384 9.79075,-9.51707 C 410.09416,126.70299 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.27093 -106,0.27093 -12,2.79108 c -28.73501,6.68347 -51.03471,19.13644 -71.31721,39.82615 -8.35987,8.5277 -11.68679,12.90117 -22.05107,28.98765 -3.37777,5.24267 -8.54958,16.94256 -9.596705,21.71011 -0.384091,1.74875 -1.307039,4.41252 -2.050997,5.91949 -0.743957,1.50696 -2.154437,6.78993 -3.1344,11.73993 -1.631785,8.24249 -1.808431,18.36363 -2.098738,120.25 -0.174342,61.1875 -0.132263,111.25 0.09351,111.25 0.225773,0 27.12069,-2.025 59.76647,-4.5 z M 97.666667,392.33333 c -1.432793,-1.43279 -0.549259,-5.3549 1.808369,-8.02757 l 2.475034,-2.80576 -1.94264,3.8979 c -2.022513,4.05817 -1.87685,5.6021 0.52853,5.6021 2.37429,0 4.7775,-4.68268 4.1117,-8.01168 C 104.19571,380.72857 104.41727,380 105.55638,380 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.456727,3.12861 -6.838123,1.74721 z M 133.98983,242.75 C 127.9824,238.66138 126.5,235.67303 126.5,227.65136 c 0,-6.11322 0.49417,-8.19849 3.28727,-13.8715 4.49966,-9.13917 12.36007,-17.25486 18.21273,-18.80423 14.27657,-3.77942 28.42896,6.00972 26.57378,18.38096 -1.58791,10.58889 -11.98134,25.24184 -21.00144,29.60839 -5.97906,2.89441 -15.16199,2.7936 -19.58251,-0.21498 z m 17.8378,-1.16086 c 3.21599,-1.66306 9.48395,-13.48535 11.18108,-21.08914 2.08454,-9.33958 -1.13281,-17.13213 -8.24904,-19.97949 -9.26413,-3.70676 -17.19398,0.52239 -22.96681,12.2487 -5.96587,12.11839 -4.93642,23.73356 2.50569,28.27127 3.86858,2.35882 13.44876,2.65867 17.52908,0.54866 z M 168.80206,223 c 3.42266,-7.31274 3.9438,-14.491 1.35132,-18.61349 -2.24705,-3.57321 -9.41087,-7.4072 -13.7191,-7.34231 l -2.93428,0.0442 3.66951,1.9384 c 5.79409,3.0607 8.22787,7.31404 8.67083,15.15339 0.25219,4.46315 -0.16155,8.31429 -1.23017,11.45052 -0.8856,2.59907 -1.59586,5.20792 -1.57837,5.79744 0.0527,1.77482 3.03079,-2.57509 5.77026,-8.42814 z m 487.19146,222.53122 c 1.58383,-7.62926 -0.30004,-11.56611 -6.24911,-13.05923 -3.33174,-0.83622 -3.47655,0.11977 -0.49836,3.28992 1.86269,1.98274 2.30905,3.7779 2.6151,10.51729 0.32199,7.09042 0.54005,7.89261 1.71035,6.29213 0.73772,-1.00889 1.82763,-4.17694 2.42202,-7.04011 z M 213,315 l 0,-30 -3.25,0.0239 c -11.42726,0.0839 -18.016,5.809 -22.6112,19.64743 -5.49786,16.5568 -2.64685,30.8848 7.16289,35.99783 4.77607,2.48938 10.73376,4.1888 14.94831,4.26398 L 213,345 l 0,-30 z m 0,-32 c 0,-0.55 -1.09844,-1 -2.44098,-1 -1.34254,0 -2.7191,0.45 -3.05902,1 -0.36058,0.58342 0.65628,1 2.44098,1 1.68246,0 3.05902,-0.45 3.05902,-1 z"
+       id="path3372"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#52441b"
+       d="m 459.42954,733.75 -8.01422,-17.25 -85.32753,-0.25564 -85.32753,-0.25564 -7.85669,2.48193 c -34.91683,11.03022 -77.23789,10.84 -111.17399,-0.49971 C 115.57788,702.54942 76.584834,661.69087 59.165484,610.5 48.189373,578.24411 45.068467,554.82324 44.294475,498.90036 l -0.548072,-39.59964 3.251798,-0.65036 C 48.786691,458.29266 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.493516,238.35 67.98936,234.5 c 4.274559,-33.18996 12.470232,-54.35194 31.059966,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.26271 5.60465,-3.45103 2.79531,-2.01315 25.26813,-11.558081 32,-13.591423 1.65,-0.498378 9.075,-2.35589 16.5,-4.127804 L 212.5,87.5 l 125,-0.5 125,-0.5 9.5,-5.62177 c 5.225,-3.091974 15.60633,-8.981649 23.06963,-13.088166 l 13.56963,-7.466396 7.97236,13.088166 7.97237,13.088166 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.27421,8.87692 39.35367,35.00691 47.59947,49.59331 1.39913,2.475 4.1947,7.19101 6.21237,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.12962,19.09004 -4.23052,24.03021 -7.57677,34 -4.26476,12.70636 -9.52026,24.51607 -12.87354,28.92831 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -1.90379,3.69603 -8.77964,13.05266 -15.19653,20.67938 -4.91775,5.84493 -21.49689,20.6915 -29.98221,26.84898 -9.13192,6.6267 -32.80081,18.11425 -44.90728,21.79548 -6.73564,2.04811 -29.43603,6.67689 -35.59058,7.25717 -5.77976,0.54495 -8.1036,1.48823 -18.88871,7.66717 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.8119,2.91514 -38.66794,17.56936 -39.392,17.56936 -0.15154,0 -3.88192,-7.7625 -8.28975,-17.25 z m 44.06862,-36.15596 c 28.82533,-14.8739 49.56381,-29.22162 68.84221,-47.6278 28.49098,-27.20196 45.36553,-56.27563 52.79742,-90.96624 1.91201,-8.92491 2.25264,-13.57517 2.27076,-31 0.0182,-17.54231 -0.30095,-21.97871 -2.21236,-30.74903 C 621.90844,482.16534 617.67323,470.10512 610.53444,455.5 593.55923,420.77071 565.143,388.18867 522,353.98642 509.16373,343.81028 493.73161,328.4423 488.76962,320.89415 c -5.25354,-7.99165 -7.95132,-15.41813 -8.02681,-22.09631 -0.12553,-11.10404 9.25544,-24.96306 26.90124,-39.74268 10.67817,-8.94373 33.30996,-24.45661 48.13362,-32.99302 5.10272,-2.93847 9.52498,-5.74283 9.82725,-6.2319 C 566.45792,218.45005 498.00621,106 496.31305,106 c -0.24409,0 -4.47565,2.22429 -9.40346,4.94286 -25.60148,14.12384 -59.03767,42.22272 -80.90959,67.99426 -5.225,6.15659 -9.72633,11.72684 -10.00296,12.37834 -0.27663,0.65149 -3.81375,6.13454 -7.86028,12.18454 -7.98737,11.94198 -17.51739,30.17051 -21.17373,40.5 -1.26545,3.575 -2.64529,6.96054 -3.06632,7.52342 -1.32181,1.76715 -4.82234,16.55656 -6.38513,26.97658 -3.4539,23.02921 -0.43979,55.83794 6.52271,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 9.79175,22.81708 29.78309,49.99506 50.3096,68.39529 C 432.84828,442.49792 439.59539,448 440.85781,448 c 0.62821,0 1.14219,0.37736 1.14219,0.83858 0,0.46122 3.93534,3.94872 8.74521,7.75 20.66812,16.33421 39.54472,37.09413 46.76394,51.42958 4.93957,9.80868 6.24964,18.07159 4.18908,26.42155 -2.2788,9.23433 -5.78902,14.766 -15.63887,24.64492 -9.89895,9.92816 -24.6182,19.99769 -42.45842,29.04605 -6.65552,3.37561 -12.28414,6.29783 -12.50805,6.49384 C 430.20466,595.40204 483.40225,707 484.66111,707 c 0.33466,0 8.81133,-4.23268 18.83705,-9.40596 z M 230.22958,691.9307 c 17.48074,-1.22407 30.53011,-4.17574 44.02666,-9.95848 C 314.62273,664.67676 345.1874,626.52953 357.56178,578 c 5.52017,-21.64885 5.67608,-24.03819 6.14161,-94.11884 l 0.4359,-65.61884 -7.20849,-10.88116 c -17.57729,-26.53278 -28.37472,-55.8021 -32.02671,-86.81693 -1.46274,-12.42242 -0.6599,-39.82488 1.52539,-52.06423 4.62699,-25.91492 15.46887,-53.07516 31.1996,-78.15885 C 363.05674,181.6864 364,179.50255 364,175.59115 364,173.06602 363.80602,171 363.56893,171 363.33184,171 337.87582,168.075 307,164.5 276.12418,160.925 249.99316,158 248.93107,158 247.02992,158 247,160.87105 247,343.27623 c 0,121.57547 -0.35587,188.18965 -1.03505,193.75 -1.48107,12.1253 -3.47363,19.42733 -7.60887,27.88381 -4.84907,9.91626 -10.43,15.42842 -17.28623,17.0732 -16.79921,4.03007 -24.72812,-5.40675 -30.23347,-35.98324 -1.62347,-9.01667 -2.18016,-17.27645 -2.57797,-38.25 -0.45197,-23.8297 -0.68482,-26.74829 -2.13289,-26.73429 -1.52155,0.0147 -84.46936,6.43758 -101.294162,7.84349 -4.217754,0.35244 -7.952282,0.92533 -8.298952,1.27308 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.32831,0.8189 9.72958,0.89728 0.40128,0.0784 7.60128,-0.33868 16,-0.9268 z m 135.31747,-5 c 9.84348,-10.13321 22.32956,-15.48267 30.45538,-13.04812 5.47681,1.64089 7.27182,4.68086 6.84195,11.58729 l -0.34438,5.53286 18.33333,-0.001 c 10.08334,-7.5e-4 18.18334,-0.39341 18,-0.87259 C 438.65,689.6496 427.475,665.7851 414,637.09654 c -23.0488,-49.07137 -24.55188,-51.96659 -25.37588,-48.87877 -3.53486,13.24638 -10.6554,32.3318 -16.14808,43.28223 -8.99369,17.93021 -17.56946,29.62019 -33.56219,45.75 L 325.2807,691 l 18.1567,0 18.1567,0 3.95295,-4.0693 z m 28.20127,-0.47128 c -1.32035,-11.71404 -10.74925,-11.81472 -23.18331,-0.24754 l -5.06501,4.71188 14.38005,0.0381 14.38005,0.0381 -0.51178,-4.54058 z m 6.66255,1.16398 c 1.08245,-5.76992 -1.3347,-9.81323 -6.66646,-11.15141 -3.29107,-0.82601 -3.47917,0.11699 -0.62859,3.15129 1.25284,1.3336 2.32556,4.11299 2.63005,6.81445 0.3936,3.49197 0.92681,4.56227 2.27289,4.56227 1.20592,0 1.95775,-1.06125 2.39211,-3.3766 z m 197.40164,-13.73038 c 11.67358,-6.40683 17.04413,-10.15866 25.85824,-18.06437 13.40199,-12.02076 17.04512,-16.50498 30.69543,-37.78222 2.1264,-3.31449 5.87354,-11.76837 8.32697,-18.78639 8.22364,-23.52359 7.68929,-10.75039 8.04288,-192.26004 0.20362,-104.5302 -0.0404,-164.14566 -0.69177,-169 -1.94929,-14.52714 -3.9474,-23.58667 -7.05771,-32 -1.72829,-4.675 -3.60336,-10.05273 -4.16682,-11.95051 -0.56345,-1.89778 -2.73987,-6.17278 -4.83647,-9.5 -2.09661,-3.32722 -5.50446,-8.74949 -7.57302,-12.04949 -4.76111,-7.59549 -29.19428,-31.87416 -36.73227,-36.5 -3.13686,-1.925 -8.62902,-5.35664 -12.2048,-7.62587 -7.4663,-4.73821 -30.88805,-12.73095 -41.97317,-14.32347 -3.85,-0.55311 -8.74781,-1.27248 -10.88403,-1.59861 -3.19321,-0.4875 -3.78134,-0.32537 -3.30669,0.91153 0.31753,0.82747 8.99798,15.37168 19.28989,32.32046 10.29191,16.94878 26.24315,43.23418 35.44721,58.41201 l 16.73466,27.59605 -20.31855,11.25584 c -23.71457,13.13712 -43.25734,25.37386 -56.11159,35.13436 -10.20326,7.74756 -21.35123,19.08037 -21.35027,21.70429 10e-4,3.08499 8.44754,12.55861 18.46749,20.71341 33.68568,27.41532 47.16535,39.64297 62.83634,57 12.63608,13.99558 26.22573,32.10499 34.03071,45.34892 3.35438,5.69191 6.25512,9.88022 6.44607,9.30735 0.19096,-0.57287 2.79257,-1.58883 5.78137,-2.25769 6.70684,-1.50093 12.63189,-0.0576 15.07595,3.67255 2.50806,3.82778 1.35969,13.6985 -2.5709,22.09798 -1.74421,3.7273 -3.58084,7.03002 -4.08139,7.33937 -0.50936,0.31481 -0.009,3.40891 1.1359,7.02699 6.84581,21.63015 9.87463,48.13161 8.03681,70.32016 -4.04541,48.84138 -23.59969,89.49833 -61.5821,128.04053 -5.2054,5.28211 -9.19056,9.60384 -8.85593,9.60384 0.33464,0 3.97584,-1.84814 8.09156,-4.10698 z m 53.85416,-75.55969 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.94264,3.8979 c -2.02251,4.05817 -1.87685,5.6021 0.52853,5.6021 2.37429,0 4.7775,-4.68268 4.1117,-8.01168 C 658.19571,586.72857 658.41727,586 659.55638,586 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.45673,3.12861 -6.83812,1.74721 z M 564.50031,345.0005 c -0.41948,-0.67874 0.69101,-2.71759 2.6345,-4.83691 1.8478,-2.01497 3.68776,-4.08046 4.08879,-4.58996 0.4218,-0.5359 1.49217,-0.23585 2.53937,0.71186 2.11622,1.91515 8.48579,4.71451 10.72725,4.71451 1.93983,0 9.88118,-7.20496 13.6674,-12.40004 5.17751,-7.10407 3.32036,-16.22675 -4.48028,-22.00801 -2.97598,-2.20557 -11.42465,-2.89392 -14.92734,-1.21619 -1.28004,0.61311 -1.75,0.41601 -1.75,-0.73397 0,-2.62087 -6.01326,-8.61482 -11.36142,-11.32493 -5.81499,-2.94668 -16.90886,-4.67414 -24.0077,-3.73831 -3.55795,0.46904 -5.86333,1.5401 -8.56119,3.97745 C 529.73017,296.57306 524,306.29071 524,308.93705 524,309.52167 523.55,310 523,310 c -3.44107,0 2.79897,-12.60289 9.20853,-18.59829 8.79125,-8.22318 18.80256,-10.90501 29.50186,-7.90293 7.69116,2.15803 12.43652,6.05822 15.8434,13.02163 1.4745,3.01377 2.79815,5.47959 2.94144,5.47959 0.14329,0 1.87602,-0.675 3.85053,-1.5 4.65174,-1.94362 13.71459,-1.91871 18.43636,0.0507 4.92567,2.05444 9.91424,6.99925 11.30134,11.20221 3.5455,10.74295 -6.39965,26.00764 -20.0116,30.71556 -6.08717,2.10536 -11.30015,1.91913 -17.18866,-0.61404 l -4.98756,-2.14559 -3.33509,3.23249 c -2.27233,2.20243 -3.56617,2.85861 -4.06024,2.05919 z m 38.13139,-11.32534 c 14.02192,-12.34259 9.56771,-29.43307 -8.19274,-31.43493 -4.74172,-0.53446 -6.26029,1.08583 -2.01603,2.15107 3.5404,0.88859 8.64483,5.52663 10.21304,9.27989 2.8975,6.93469 1.47459,13.16779 -4.67493,20.47868 -4.92899,5.85984 -2.21206,5.5837 4.67066,-0.47471 z M 569.47676,290.9624 c -1.69987,-2.75045 -9.01459,-4.91858 -16.66774,-4.94044 -10.49267,-0.03 -10.70512,1.54717 -0.30726,2.28095 4.91881,0.34713 10.2241,1.38976 12.71858,2.49953 4.53764,2.01876 5.42585,2.05214 4.25642,0.15996 z M 418.33103,564.12527 c 22.32309,-10.51946 40.2898,-22.75397 47.16113,-32.11459 3.35419,-4.56932 3.59602,-5.31898 2.61946,-8.12034 -3.43575,-9.8558 -19.58442,-26.86398 -45.01044,-47.40614 -9.13065,-7.37682 -18.91436,-15.45157 -21.74157,-17.9439 l -5.1404,-4.5315 -0.51383,47.2456 c -0.48999,45.05232 -1.25411,57.99715 -4.28013,72.50848 l -0.6804,3.26288 8.37757,-3.89826 c 4.60767,-2.14404 13.25154,-6.19504 19.20861,-9.00223 z m -10.66436,-51.79194 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.94264,3.8979 c -2.02251,4.05817 -1.87685,5.6021 0.52853,5.6021 2.37429,0 4.7775,-4.68268 4.1117,-8.01168 C 414.19571,500.72857 414.41727,500 415.55638,500 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.45673,3.12861 -6.83812,1.74721 z m 242.09864,-61.08601 c 0.29348,-11.88881 -0.5954,-14.91854 -4.99594,-17.02858 -1.46966,-0.70469 -3.7711,-1.00543 -5.1143,-0.6683 l -2.4422,0.61295 4.24882,9.1683 c 2.33685,5.04257 5.05009,11.30581 6.02942,13.91831 0.97933,2.6125 1.83197,4.74879 1.89475,4.74732 0.0628,-10e-4 0.23353,-4.83898 0.37945,-10.75 z M 152.11086,450.5 C 184.75665,448.025 211.8118,446 212.23342,446 212.65504,446 213,424.00185 213,397.11522 l 0,-48.88477 -5.75,-0.66562 c -3.1625,-0.36608 -8.56027,-2.02003 -11.99504,-3.67544 C 185.55597,339.21491 182,333.09059 182,321.06088 c 0,-12.95693 5.1695,-26.1396 13.19384,-33.64543 5.08412,-4.7556 11.75773,-8.35641 15.55616,-8.39349 L 213,279 l 0,-79.10841 0,-79.10841 2.25,0.50179 c 1.2375,0.27599 42.16916,4.92702 90.95925,10.33563 l 88.70925,9.83384 9.79075,-9.51707 C 410.09416,126.70299 417.2,120.07208 420.5,117.20202 l 6,-5.21829 -106,0.27093 -106,0.27093 -12,2.79108 c -28.73501,6.68347 -51.03471,19.13644 -71.31721,39.82615 -14.05219,14.33431 -27.82667,36.02239 -31.213237,49.14563 -0.597756,2.31635 -1.701778,5.56155 -2.453383,7.21155 -0.751605,1.65 -2.172447,7.05 -3.157428,12 -1.64395,8.26164 -1.81688,18.12701 -2.107862,120.25 -0.174342,61.1875 -0.132263,111.25 0.09351,111.25 0.225773,0 27.12069,-2.025 59.76647,-4.5 z M 97.666667,392.33333 c -1.432793,-1.43279 -0.549259,-5.3549 1.808369,-8.02757 l 2.475034,-2.80576 -1.94264,3.8979 c -2.022513,4.05817 -1.87685,5.6021 0.52853,5.6021 2.37429,0 4.7775,-4.68268 4.1117,-8.01168 C 104.19571,380.72857 104.41727,380 105.55638,380 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.456727,3.12861 -6.838123,1.74721 z M 133.98983,242.75 C 127.9824,238.66138 126.5,235.67303 126.5,227.65136 c 0,-6.11322 0.49417,-8.19849 3.28727,-13.8715 4.49966,-9.13917 12.36007,-17.25486 18.21273,-18.80423 14.27657,-3.77942 28.42896,6.00972 26.57378,18.38096 -1.58791,10.58889 -11.98134,25.24184 -21.00144,29.60839 -5.97906,2.89441 -15.16199,2.7936 -19.58251,-0.21498 z m 17.8378,-1.16086 c 3.21599,-1.66306 9.48395,-13.48535 11.18108,-21.08914 2.08454,-9.33958 -1.13281,-17.13213 -8.24904,-19.97949 -9.26413,-3.70676 -17.19398,0.52239 -22.96681,12.2487 -5.96587,12.11839 -4.93642,23.73356 2.50569,28.27127 3.86858,2.35882 13.44876,2.65867 17.52908,0.54866 z M 168.80206,223 c 3.42266,-7.31274 3.9438,-14.491 1.35132,-18.61349 -2.24705,-3.57321 -9.41087,-7.4072 -13.7191,-7.34231 l -2.93428,0.0442 3.66951,1.9384 c 5.79409,3.0607 8.22787,7.31404 8.67083,15.15339 0.25219,4.46315 -0.16155,8.31429 -1.23017,11.45052 -0.8856,2.59907 -1.59586,5.20792 -1.57837,5.79744 0.0527,1.77482 3.03079,-2.57509 5.77026,-8.42814 z m 487.19146,222.53122 c 1.58383,-7.62926 -0.30004,-11.56611 -6.24911,-13.05923 -3.33174,-0.83622 -3.47655,0.11977 -0.49836,3.28992 1.86269,1.98274 2.30905,3.7779 2.6151,10.51729 0.32199,7.09042 0.54005,7.89261 1.71035,6.29213 0.73772,-1.00889 1.82763,-4.17694 2.42202,-7.04011 z M 213,315 l 0,-30 -3.25,0.0239 c -11.42726,0.0839 -18.016,5.809 -22.6112,19.64743 -5.49786,16.5568 -2.64685,30.8848 7.16289,35.99783 4.77607,2.48938 10.73376,4.1888 14.94831,4.26398 L 213,345 l 0,-30 z m 0,-32 c 0,-0.55 -1.09844,-1 -2.44098,-1 -1.34254,0 -2.7191,0.45 -3.05902,1 -0.36058,0.58342 0.65628,1 2.44098,1 1.68246,0 3.05902,-0.45 3.05902,-1 z"
+       id="path3370"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#3a3d34"
+       d="m 459.42954,733.75 -8.01422,-17.25 -85.32753,-0.25564 -85.32753,-0.25564 -7.85669,2.48193 c -34.91683,11.03022 -77.23789,10.84 -111.17399,-0.49971 C 115.57788,702.54942 76.584834,661.69087 59.165484,610.5 48.189373,578.24411 45.068467,554.82324 44.294475,498.90036 l -0.548072,-39.59964 3.251798,-0.65036 C 48.786691,458.29266 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.493516,238.35 67.98936,234.5 c 4.274559,-33.18996 12.470232,-54.35194 31.059966,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.26271 5.60465,-3.45103 2.79531,-2.01315 25.26813,-11.558081 32,-13.591423 1.65,-0.498378 9.075,-2.35589 16.5,-4.127804 L 212.5,87.5 l 125,-0.5 125,-0.5 9.5,-5.62177 c 5.225,-3.091974 15.60633,-8.981649 23.06963,-13.088166 l 13.56963,-7.466396 7.97236,13.088166 7.97237,13.088166 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.27421,8.87692 39.35367,35.00691 47.59947,49.59331 1.39913,2.475 4.1947,7.19101 6.21237,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.12962,19.09004 -4.23052,24.03021 -7.57677,34 -4.26476,12.70636 -9.52026,24.51607 -12.87354,28.92831 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -1.90379,3.69603 -8.77964,13.05266 -15.19653,20.67938 -4.91775,5.84493 -21.49689,20.6915 -29.98221,26.84898 -9.13192,6.6267 -32.80081,18.11425 -44.90728,21.79548 -6.73564,2.04811 -29.43603,6.67689 -35.59058,7.25717 -5.77976,0.54495 -8.1036,1.48823 -18.88871,7.66717 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.8119,2.91514 -38.66794,17.56936 -39.392,17.56936 -0.15154,0 -3.88192,-7.7625 -8.28975,-17.25 z m 44.1704,-36.20848 C 535.40628,681.12941 554.732,667.34083 576.5,645.52851 613.29383,608.65976 629.62463,568.92752 627.68387,521 626.7158,497.09336 621.85683,478.50461 610.56262,455.5 593.5091,420.76453 563.81644,386.75683 521.5,353.49449 c -26.46453,-20.80213 -40.48748,-39.63913 -40.70064,-54.67311 -0.15787,-11.13395 9.22295,-24.99554 27.01702,-39.92176 10.03938,-8.42134 34.58429,-25.15392 48.92597,-33.35345 4.53329,-2.59181 8.50677,-5.14024 8.82997,-5.66318 0.81145,-1.31296 -63.09437,-106.73048 -68.64026,-113.22734 -0.39642,-0.4644 -4.82957,1.42239 -9.85144,4.19286 -25.77728,14.22082 -59.1445,42.24142 -81.08062,68.08861 -5.225,6.15659 -9.72633,11.72684 -10.00296,12.37834 -0.27663,0.65149 -3.81375,6.13454 -7.86028,12.18454 -7.98737,11.94198 -17.51739,30.17051 -21.17373,40.5 -1.26545,3.575 -2.64529,6.96054 -3.06632,7.52342 -1.32181,1.76715 -4.82234,16.55656 -6.38513,26.97658 -3.4539,23.02921 -0.43979,55.83794 6.52271,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 9.07618,21.14965 28.19166,47.89462 46.3542,64.85539 9.86957,9.21652 23.43305,20.44341 24.6982,20.44341 0.62033,0 1.12787,0.37736 1.12787,0.83858 0,0.46122 3.87066,3.90601 8.60146,7.65509 12.65454,10.02851 30.60591,27.6541 37.58841,36.90626 19.76135,26.18477 19.30029,44.00516 -1.68659,65.187 -10.35468,10.45088 -22.90399,19.11676 -42.00328,29.00523 -7.15,3.70184 -13.18294,6.87843 -13.40654,7.0591 C 430.16833,595.39877 483.37719,707 484.65872,707 c 0.33597,0 8.85952,-4.25632 18.94122,-9.45848 z m -273.78733,-5.56845 c 16.10469,-1.12603 20.73569,-1.92133 32.68739,-5.61353 44.50755,-13.74956 80.961,-54.696 94.536,-106.1878 1.11239,-4.21946 2.99179,-13.07174 4.17645,-19.67174 2.02894,-11.30371 2.17605,-15.77894 2.53525,-77.12662 l 0.38133,-65.12662 -7.20336,-10.87338 c -17.57193,-26.52459 -28.36998,-55.79767 -32.02158,-86.80915 -1.46274,-12.42242 -0.6599,-39.82488 1.52539,-52.06423 4.62699,-25.91492 15.46887,-53.07516 31.1996,-78.15885 C 363.05674,181.6864 364,179.50255 364,175.59115 364,173.06602 363.80602,171 363.56893,171 363.33184,171 337.87582,168.075 307,164.5 276.12418,160.925 249.99316,158 248.93107,158 c -1.9011,0 -1.9312,2.86762 -1.93927,184.75 -0.005,118.34169 -0.37302,187.98505 -1.02312,193.75 -1.38733,12.30252 -3.35824,19.7095 -7.49773,28.17763 -4.85554,9.93291 -10.63431,15.68229 -17.39188,17.3034 -16.80931,4.03249 -24.73626,-5.39853 -30.24269,-35.98103 -1.62347,-9.01667 -2.18016,-17.27645 -2.57797,-38.25 -0.50184,-26.45859 -0.53052,-26.74979 -2.63289,-26.73026 -1.85032,0.0172 -79.62775,6.06536 -100.794162,7.83802 -4.217754,0.35323 -7.952282,0.92677 -8.298952,1.27452 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.31962 15.5,-0.88443 z m 135.73444,-5.04237 c 9.84348,-10.13321 22.32956,-15.48267 30.45538,-13.04812 5.47681,1.64089 7.27182,4.68086 6.84195,11.58729 l -0.34438,5.53286 18.35699,-0.001 c 14.29487,-10e-4 18.24232,-0.27797 17.83882,-1.25136 -0.6894,-1.66306 -48.88049,-104.19407 -49.09146,-104.44661 -0.0903,-0.10814 -1.86129,5.51148 -3.93546,12.48804 -10.10618,33.99254 -25.00465,58.74578 -49.74307,82.64618 L 324.99309,691 l 18.3005,0 18.30051,0 3.95295,-4.0693 z m 28.20127,-0.47128 c -1.32035,-11.71404 -10.74925,-11.81472 -23.18331,-0.24754 l -5.06501,4.71188 14.38005,0.0381 14.38005,0.0381 -0.51178,-4.54058 z m 6.66255,1.16398 c 1.08245,-5.76992 -1.3347,-9.81323 -6.66646,-11.15141 -3.29107,-0.82601 -3.47917,0.11699 -0.62859,3.15129 1.25284,1.3336 2.32556,4.11299 2.63005,6.81445 0.3936,3.49197 0.92681,4.56227 2.27289,4.56227 1.20592,0 1.95775,-1.06125 2.39211,-3.3766 z m 197.40164,-13.73038 c 11.67358,-6.40683 17.04413,-10.15866 25.85824,-18.06437 13.5172,-12.12409 17.28615,-16.75988 30.69543,-37.75518 2.1264,-3.32937 5.87306,-11.79541 8.32592,-18.81343 C 671.01556,575.44525 670.5,588.47051 670.5,402 c 0,-184.07654 0.4104,-172.24753 -6.71333,-193.5 -5.75975,-17.18327 -6.63809,-19.33335 -9.95355,-24.36499 -1.83322,-2.78214 -5.09954,-7.88817 -7.2585,-11.34672 -4.9042,-7.85631 -29.15912,-32.04 -36.89665,-36.78829 -3.13686,-1.925 -8.62902,-5.35664 -12.2048,-7.62587 -7.4663,-4.73821 -30.88805,-12.73095 -41.97317,-14.32347 -3.85,-0.55311 -8.74781,-1.27248 -10.88403,-1.59861 -3.22341,-0.49211 -3.78387,-0.33199 -3.29521,0.94145 0.52664,1.37241 13.10446,22.22038 57.71978,95.67164 l 13.70638,22.56513 -18.62346,10.32349 c -36.82278,20.41188 -61.19036,36.94887 -72.91763,49.48536 -3.41321,3.64873 -6.20583,7.49423 -6.20583,8.54555 0,3.02775 8.88602,12.84978 19.01263,21.01533 31.12991,25.10149 46.66626,39.19328 62.29183,56.5 12.63608,13.99558 26.22573,32.10499 34.03071,45.34892 3.35438,5.69191 6.25512,9.88022 6.44607,9.30735 0.19096,-0.57287 2.79257,-1.58883 5.78137,-2.25769 6.70684,-1.50093 12.63189,-0.0576 15.07595,3.67255 2.50806,3.82778 1.35969,13.6985 -2.5709,22.09798 -1.74421,3.7273 -3.58953,7.03539 -4.10069,7.35131 -0.5315,0.32848 0.12937,4.022 1.54366,8.62725 13.12599,42.74138 10.27154,90.65026 -7.79628,130.85233 -10.60582,23.59864 -25.42681,44.76826 -46.032,65.75 -5.26626,5.3625 -9.30006,9.75 -8.96399,9.75 0.33606,0 3.97843,-1.84814 8.09415,-4.10698 z m 53.85416,-75.55969 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.94264,3.8979 c -2.02251,4.05817 -1.87685,5.6021 0.52853,5.6021 2.37429,0 4.7775,-4.68268 4.1117,-8.01168 C 658.19571,586.72857 658.41727,586 659.55638,586 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.45673,3.12861 -6.83812,1.74721 z M 564.50031,345.0005 c -0.41948,-0.67874 0.69101,-2.71759 2.6345,-4.83691 1.8478,-2.01497 3.68776,-4.08046 4.08879,-4.58996 0.4218,-0.5359 1.49217,-0.23585 2.53937,0.71186 2.11622,1.91515 8.48579,4.71451 10.72725,4.71451 1.93983,0 9.88118,-7.20496 13.6674,-12.40004 5.17751,-7.10407 3.32036,-16.22675 -4.48028,-22.00801 -2.97598,-2.20557 -11.42465,-2.89392 -14.92734,-1.21619 -1.28004,0.61311 -1.75,0.41601 -1.75,-0.73397 0,-2.62087 -6.01326,-8.61482 -11.36142,-11.32493 -5.81499,-2.94668 -16.90886,-4.67414 -24.0077,-3.73831 -3.55795,0.46904 -5.86333,1.5401 -8.56119,3.97745 C 529.73017,296.57306 524,306.29071 524,308.93705 524,309.52167 523.55,310 523,310 c -3.44107,0 2.79897,-12.60289 9.20853,-18.59829 8.79125,-8.22318 18.80256,-10.90501 29.50186,-7.90293 7.69116,2.15803 12.43652,6.05822 15.8434,13.02163 1.4745,3.01377 2.79815,5.47959 2.94144,5.47959 0.14329,0 1.87602,-0.675 3.85053,-1.5 4.65174,-1.94362 13.71459,-1.91871 18.43636,0.0507 4.92567,2.05444 9.91424,6.99925 11.30134,11.20221 3.5455,10.74295 -6.39965,26.00764 -20.0116,30.71556 -6.08717,2.10536 -11.30015,1.91913 -17.18866,-0.61404 l -4.98756,-2.14559 -3.33509,3.23249 c -2.27233,2.20243 -3.56617,2.85861 -4.06024,2.05919 z m 38.13139,-11.32534 c 14.02192,-12.34259 9.56771,-29.43307 -8.19274,-31.43493 -4.74172,-0.53446 -6.26029,1.08583 -2.01603,2.15107 3.5404,0.88859 8.64483,5.52663 10.21304,9.27989 2.8975,6.93469 1.47459,13.16779 -4.67493,20.47868 -4.92899,5.85984 -2.21206,5.5837 4.67066,-0.47471 z M 569.47676,290.9624 c -1.69987,-2.75045 -9.01459,-4.91858 -16.66774,-4.94044 -10.49267,-0.03 -10.70512,1.54717 -0.30726,2.28095 4.91881,0.34713 10.2241,1.38976 12.71858,2.49953 4.53764,2.01876 5.42585,2.05214 4.25642,0.15996 z M 421.15915,562.63999 c 22.99511,-11.23207 37.4153,-21.2055 44.38179,-30.69576 3.30603,-4.50371 3.54609,-5.25582 2.57068,-8.05389 C 464.65317,513.96943 448.67705,497.14714 423,476.38938 413.925,469.053 404.18682,461.01612 401.35961,458.52965 l -5.1404,-4.52085 -0.50274,47.2456 c -0.48302,45.39138 -1.05303,55.0313 -4.267,72.16327 l -0.66952,3.56882 7.51918,-3.42659 c 4.13554,-1.88463 14.42255,-6.79859 22.86002,-10.91991 z m -13.49248,-50.30666 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.94264,3.8979 c -2.02251,4.05817 -1.87685,5.6021 0.52853,5.6021 2.37429,0 4.7775,-4.68268 4.1117,-8.01168 C 414.19571,500.72857 414.41727,500 415.55638,500 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.45673,3.12861 -6.83812,1.74721 z m 242.09864,-61.08601 c 0.29348,-11.88881 -0.5954,-14.91854 -4.99594,-17.02858 -1.46966,-0.70469 -3.7711,-1.00543 -5.1143,-0.6683 l -2.4422,0.61295 4.24882,9.1683 c 2.33685,5.04257 5.05009,11.30581 6.02942,13.91831 0.97933,2.6125 1.83197,4.74879 1.89475,4.74732 0.0628,-10e-4 0.23353,-4.83898 0.37945,-10.75 z M 152.5,450.49366 c 32.45,-2.47066 59.3375,-4.49246 59.75,-4.49288 0.4125,-4.3e-4 0.75,-21.99893 0.75,-48.88556 l 0,-48.88477 -5.75,-0.66562 c -3.1625,-0.36608 -8.56027,-2.02003 -11.99504,-3.67544 C 185.55597,339.21491 182,333.09059 182,321.06088 c 0,-12.95693 5.1695,-26.1396 13.19384,-33.64543 5.08412,-4.7556 11.75773,-8.35641 15.55616,-8.39349 L 213,279 l 0,-79.10841 0,-79.10841 2.25,0.5104 c 1.2375,0.28072 42.16553,4.93395 90.95117,10.34051 l 88.70117,9.83012 9.29883,-9.02004 c 5.11436,-4.96102 12.22383,-11.59852 15.79883,-14.75 l 6.5,-5.72996 -106,0.28069 -106,0.28069 -11.85725,2.76406 c -29.11487,6.78703 -51.4635,19.26527 -71.65218,40.00663 -13.96897,14.35138 -27.6626,35.97803 -31.021017,48.99217 -0.597756,2.31635 -1.701778,5.56155 -2.453383,7.21155 -0.751605,1.65 -2.172447,7.05 -3.157428,12 -1.64395,8.26164 -1.81688,18.12701 -2.107862,120.25 -0.174342,61.1875 0.03539,111.2468 0.466067,111.24289 0.430679,-0.004 27.333053,-2.02856 59.783053,-4.49923 z M 97.666667,392.33333 c -1.432793,-1.43279 -0.549259,-5.3549 1.808369,-8.02757 l 2.475034,-2.80576 -1.94264,3.8979 c -2.022513,4.05817 -1.87685,5.6021 0.52853,5.6021 2.37429,0 4.7775,-4.68268 4.1117,-8.01168 C 104.19571,380.72857 104.41727,380 105.55638,380 c 3.57257,0 2.91501,6.61952 -1.05159,10.58612 -2.32959,2.32959 -5.456727,3.12861 -6.838123,1.74721 z M 133.98983,242.75 C 127.9824,238.66138 126.5,235.67303 126.5,227.65136 c 0,-6.11322 0.49417,-8.19849 3.28727,-13.8715 4.49966,-9.13917 12.36007,-17.25486 18.21273,-18.80423 14.27657,-3.77942 28.42896,6.00972 26.57378,18.38096 -1.58791,10.58889 -11.98134,25.24184 -21.00144,29.60839 -5.97906,2.89441 -15.16199,2.7936 -19.58251,-0.21498 z m 17.8378,-1.16086 c 3.21599,-1.66306 9.48395,-13.48535 11.18108,-21.08914 2.08454,-9.33958 -1.13281,-17.13213 -8.24904,-19.97949 -9.26413,-3.70676 -17.19398,0.52239 -22.96681,12.2487 -5.96587,12.11839 -4.93642,23.73356 2.50569,28.27127 3.86858,2.35882 13.44876,2.65867 17.52908,0.54866 z M 168.80206,223 c 3.42266,-7.31274 3.9438,-14.491 1.35132,-18.61349 -2.24705,-3.57321 -9.41087,-7.4072 -13.7191,-7.34231 l -2.93428,0.0442 3.66951,1.9384 c 5.79409,3.0607 8.22787,7.31404 8.67083,15.15339 0.25219,4.46315 -0.16155,8.31429 -1.23017,11.45052 -0.8856,2.59907 -1.59586,5.20792 -1.57837,5.79744 0.0527,1.77482 3.03079,-2.57509 5.77026,-8.42814 z m 487.19146,222.53122 c 1.58383,-7.62926 -0.30004,-11.56611 -6.24911,-13.05923 -3.33174,-0.83622 -3.47655,0.11977 -0.49836,3.28992 1.86269,1.98274 2.30905,3.7779 2.6151,10.51729 0.32199,7.09042 0.54005,7.89261 1.71035,6.29213 0.73772,-1.00889 1.82763,-4.17694 2.42202,-7.04011 z M 213,315 l 0,-30 -3.25,0.0239 c -11.42726,0.0839 -18.016,5.809 -22.6112,19.64743 -5.49786,16.5568 -2.64685,30.8848 7.16289,35.99783 4.77607,2.48938 10.73376,4.1888 14.94831,4.26398 L 213,345 l 0,-30 z m 0,-32 c 0,-0.55 -1.09844,-1 -2.44098,-1 -1.34254,0 -2.7191,0.45 -3.05902,1 -0.36058,0.58342 0.65628,1 2.44098,1 1.68246,0 3.05902,-0.45 3.05902,-1 z"
+       id="path3368"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#363d38"
+       d="m 459.42954,733.75 -8.01422,-17.25 -85.32753,-0.25564 -85.32753,-0.25564 -7.85669,2.48193 c -34.91683,11.03022 -77.23789,10.84 -111.17399,-0.49971 C 115.57788,702.54942 76.584834,661.69087 59.165484,610.5 48.189373,578.24411 45.068467,554.82324 44.294475,498.90036 l -0.548072,-39.59964 3.251798,-0.65036 C 48.786691,458.29266 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.493516,238.35 67.98936,234.5 c 4.274559,-33.18996 12.470232,-54.35194 31.059966,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.26271 5.60465,-3.45103 2.79531,-2.01315 25.26813,-11.558081 32,-13.591423 1.65,-0.498378 9.075,-2.35589 16.5,-4.127804 L 212.5,87.5 l 125,-0.5 125,-0.5 9.5,-5.62177 c 5.225,-3.091974 15.60633,-8.981649 23.06963,-13.088166 l 13.56963,-7.466396 7.97236,13.088166 7.97237,13.088166 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.27421,8.87692 39.35367,35.00691 47.59947,49.59331 1.39913,2.475 4.1947,7.19101 6.21237,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.12962,19.09004 -4.23052,24.03021 -7.57677,34 -4.26476,12.70636 -9.52026,24.51607 -12.87354,28.92831 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -1.90379,3.69603 -8.77964,13.05266 -15.19653,20.67938 -4.91775,5.84493 -21.49689,20.6915 -29.98221,26.84898 -9.13192,6.6267 -32.80081,18.11425 -44.90728,21.79548 -6.73564,2.04811 -29.43603,6.67689 -35.59058,7.25717 -5.77976,0.54495 -8.1036,1.48823 -18.88871,7.66717 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.8119,2.91514 -38.66794,17.56936 -39.392,17.56936 -0.15154,0 -3.88192,-7.7625 -8.28975,-17.25 z m 44.1704,-36.20848 C 535.40628,681.12941 554.732,667.34083 576.5,645.52851 613.29383,608.65976 629.62463,568.92752 627.68387,521 626.7158,497.09336 621.85683,478.50461 610.56262,455.5 593.5091,420.76453 563.81644,386.75683 521.5,353.49449 c -26.46453,-20.80213 -40.48748,-39.63913 -40.70064,-54.67311 -0.15787,-11.13395 9.22295,-24.99554 27.01702,-39.92176 10.03938,-8.42134 34.58429,-25.15392 48.92597,-33.35345 4.53329,-2.59181 8.50677,-5.14024 8.82997,-5.66318 0.81145,-1.31296 -63.09437,-106.73048 -68.64026,-113.22734 -0.39642,-0.4644 -4.82957,1.42239 -9.85144,4.19286 -25.77728,14.22082 -59.1445,42.24142 -81.08062,68.08861 -5.225,6.15659 -9.72633,11.72684 -10.00296,12.37834 -0.27663,0.65149 -3.81375,6.13454 -7.86028,12.18454 -7.98737,11.94198 -17.51739,30.17051 -21.17373,40.5 -1.26545,3.575 -2.64529,6.96054 -3.06632,7.52342 -1.32181,1.76715 -4.82234,16.55656 -6.38513,26.97658 -3.4539,23.02921 -0.43979,55.83794 6.52271,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 9.07618,21.14965 28.19166,47.89462 46.3542,64.85539 9.86957,9.21652 23.43305,20.44341 24.6982,20.44341 0.62033,0 1.12787,0.37736 1.12787,0.83858 0,0.46122 3.87066,3.90601 8.60146,7.65509 12.65454,10.02851 30.60591,27.6541 37.58841,36.90626 19.76135,26.18477 19.30029,44.00516 -1.68659,65.187 -10.35468,10.45088 -22.90399,19.11676 -42.00328,29.00523 -7.15,3.70184 -13.18294,6.87843 -13.40654,7.0591 C 430.16833,595.39877 483.37719,707 484.65872,707 c 0.33597,0 8.85952,-4.25632 18.94122,-9.45848 z m -273.78733,-5.56845 c 16.10469,-1.12603 20.73569,-1.92133 32.68739,-5.61353 44.50755,-13.74956 80.961,-54.696 94.536,-106.1878 1.11239,-4.21946 2.99179,-13.07174 4.17645,-19.67174 2.02894,-11.30371 2.17605,-15.77894 2.53525,-77.12662 l 0.38133,-65.12662 -7.20336,-10.87338 c -17.57193,-26.52459 -28.36998,-55.79767 -32.02158,-86.80915 -1.46274,-12.42242 -0.6599,-39.82488 1.52539,-52.06423 4.62699,-25.91492 15.46887,-53.07516 31.1996,-78.15885 C 363.05674,181.6864 364,179.50255 364,175.59115 364,173.06602 363.80602,171 363.56893,171 363.33184,171 337.87582,168.075 307,164.5 276.12418,160.925 249.99316,158 248.93107,158 c -1.9011,0 -1.9312,2.86762 -1.93927,184.75 -0.005,118.34169 -0.37302,187.98505 -1.02312,193.75 -1.38733,12.30252 -3.35824,19.7095 -7.49773,28.17763 -4.85554,9.93291 -10.63431,15.68229 -17.39188,17.3034 -16.80931,4.03249 -24.73626,-5.39853 -30.24269,-35.98103 -1.62347,-9.01667 -2.18016,-17.27645 -2.57797,-38.25 -0.50184,-26.45859 -0.53052,-26.74979 -2.63289,-26.73026 -1.85032,0.0172 -79.62775,6.06536 -100.794162,7.83802 -4.217754,0.35323 -7.952282,0.92677 -8.298952,1.27452 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.31962 15.5,-0.88443 z m 135.73444,-5.04237 c 9.84348,-10.13321 22.32956,-15.48267 30.45538,-13.04812 5.47681,1.64089 7.27182,4.68086 6.84195,11.58729 l -0.34438,5.53286 18.35699,-0.001 c 14.29487,-10e-4 18.24232,-0.27797 17.83882,-1.25136 -0.6894,-1.66306 -48.88049,-104.19407 -49.09146,-104.44661 -0.0903,-0.10814 -1.86129,5.51148 -3.93546,12.48804 -10.10618,33.99254 -25.00465,58.74578 -49.74307,82.64618 L 324.99309,691 l 18.3005,0 18.30051,0 3.95295,-4.0693 z m 28.18138,-0.6477 c -0.55875,-4.95724 -4.0629,-9.283 -7.51984,-9.283 -3.14746,0 -12.00795,5.21986 -16.322,9.61556 L 365.58358,691 l 14.33826,0 14.33826,0 -0.53167,-4.717 z m 6.79138,0.59975 c 0.80879,-4.78719 -1.43649,-8.74603 -5.85245,-10.31893 -3.66138,-1.30413 -4.43555,-0.0104 -1.72215,2.87786 1.42184,1.51348 2.48088,4.15896 2.80066,6.99605 0.39644,3.51723 0.92243,4.56227 2.29628,4.56227 1.30822,0 1.96701,-1.09474 2.47766,-4.11725 z m 197.2927,-12.98973 c 11.67358,-6.40683 17.04413,-10.15866 25.85824,-18.06437 13.5172,-12.12409 17.28615,-16.75988 30.69543,-37.75518 2.1264,-3.32937 5.87306,-11.79541 8.32592,-18.81343 C 671.01556,575.44525 670.5,588.47051 670.5,402 c 0,-184.07654 0.4104,-172.24753 -6.71333,-193.5 -5.75975,-17.18327 -6.63809,-19.33335 -9.95355,-24.36499 -1.83322,-2.78214 -5.09954,-7.88817 -7.2585,-11.34672 -4.9042,-7.85631 -29.15912,-32.04 -36.89665,-36.78829 -3.13686,-1.925 -8.62902,-5.35664 -12.2048,-7.62587 -7.4663,-4.73821 -30.88805,-12.73095 -41.97317,-14.32347 -3.85,-0.55311 -8.74781,-1.27248 -10.88403,-1.59861 -3.22341,-0.49211 -3.78387,-0.33199 -3.29521,0.94145 0.52664,1.37241 13.10446,22.22038 57.71978,95.67164 l 13.70638,22.56513 -18.62346,10.32349 c -36.82278,20.41188 -61.19036,36.94887 -72.91763,49.48536 -3.41321,3.64873 -6.20583,7.49423 -6.20583,8.54555 0,3.02775 8.88602,12.84978 19.01263,21.01533 31.12991,25.10149 46.66626,39.19328 62.29183,56.5 12.63608,13.99558 26.22573,32.10499 34.03071,45.34892 3.35438,5.69191 6.25512,9.88022 6.44607,9.30735 0.19096,-0.57287 2.79257,-1.58883 5.78137,-2.25769 6.70684,-1.50093 12.63189,-0.0576 15.07595,3.67255 2.50806,3.82778 1.35969,13.6985 -2.5709,22.09798 -1.74421,3.7273 -3.58953,7.03539 -4.10069,7.35131 -0.5315,0.32848 0.12937,4.022 1.54366,8.62725 13.12599,42.74138 10.27154,90.65026 -7.79628,130.85233 -10.60582,23.59864 -25.42681,44.76826 -46.032,65.75 -5.26626,5.3625 -9.30006,9.75 -8.96399,9.75 0.33606,0 3.97843,-1.84814 8.09415,-4.10698 z m 53.85416,-75.55969 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.97117,3.95386 c -2.06168,4.13541 -1.43314,6.31816 1.49571,5.19426 2.3236,-0.89165 4.63926,-6.80572 3.29775,-8.42229 -1.32305,-1.59433 -0.36285,-2.6664 1.68451,-1.88075 1.95936,0.75187 1.97291,3.92314 0.0328,7.67494 -2.07342,4.00956 -6.81078,6.32552 -8.82298,4.31331 z M 564.50031,345.0005 c -0.41948,-0.67874 0.69101,-2.71759 2.6345,-4.83691 1.8478,-2.01497 3.69243,-4.08513 4.09917,-4.60035 0.42529,-0.53871 1.73941,0.003 3.09265,1.27389 2.19935,2.06618 7.47606,4.16287 10.47663,4.16287 1.7904,0 11.74065,-9.52596 14.33504,-13.72378 3.08764,-4.9959 2.27684,-13.18092 -1.72241,-17.38762 -4.25364,-4.4743 -8.01688,-6.13632 -12.79161,-5.64939 -2.26836,0.23133 -4.85626,0.74898 -5.7509,1.15034 -1.20185,0.53918 -1.78865,0.0842 -2.24708,-1.74234 -0.90994,-3.62551 -9.00873,-10.2773 -14.95578,-12.28365 -3.458,-1.16663 -8.43482,-1.76412 -15.02627,-1.80397 l -9.85575,-0.0596 -4.86761,5.29078 c -2.79438,3.0373 -5.61782,7.40303 -6.62897,10.25 -1.72927,4.86886 -3.29192,6.48105 -3.29192,3.39627 0,-3.37955 5.60017,-12.72475 10.20853,-17.03534 8.79125,-8.22318 18.80256,-10.90501 29.50186,-7.90293 7.69116,2.15803 12.43652,6.05822 15.8434,13.02163 1.4745,3.01377 2.79815,5.47959 2.94144,5.47959 0.14329,0 1.87602,-0.675 3.85053,-1.5 4.65174,-1.94362 13.71459,-1.91871 18.43636,0.0507 4.92567,2.05444 9.91424,6.99925 11.30134,11.20221 3.5455,10.74295 -6.39965,26.00764 -20.0116,30.71556 -6.08717,2.10536 -11.30015,1.91913 -17.18866,-0.61404 l -4.98756,-2.14559 -3.33509,3.23249 c -2.27233,2.20243 -3.56617,2.85861 -4.06024,2.05919 z m 38.13139,-11.32534 c 14.05886,-12.37511 9.61749,-29.55544 -8.11362,-31.38545 C 591.48313,301.97648 589,301.98709 589,302.3133 c 0,0.32621 1.96131,1.46069 4.35847,2.52107 2.39715,1.06038 5.65965,3.6339 7.25,5.71895 2.47161,3.24045 2.89153,4.69321 2.89153,10.00354 0,5.86899 -0.25756,6.54421 -4.65746,12.21002 -5.45401,7.0232 -3.64923,7.45581 3.78916,0.90828 z M 569.47676,290.9624 c -1.69987,-2.75045 -9.01459,-4.91858 -16.66774,-4.94044 -10.13654,-0.0289 -10.86099,1.54693 -1.03091,2.24251 4.24704,0.30053 9.97189,1.41264 12.72189,2.47136 5.32517,2.05014 6.12633,2.08661 4.97676,0.22657 z M 421.15915,562.63999 c 22.99511,-11.23207 37.4153,-21.2055 44.38179,-30.69576 3.30603,-4.50371 3.54609,-5.25582 2.57068,-8.05389 C 464.65317,513.96943 448.67705,497.14714 423,476.38938 413.925,469.053 404.18682,461.01612 401.35961,458.52965 l -5.1404,-4.52085 -0.50274,47.2456 c -0.48302,45.39138 -1.05303,55.0313 -4.267,72.16327 l -0.66952,3.56882 7.51918,-3.42659 c 4.13554,-1.88463 14.42255,-6.79859 22.86002,-10.91991 z m -13.49248,-50.30666 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.97117,3.95386 c -2.06168,4.13541 -1.43314,6.31816 1.49571,5.19426 2.3236,-0.89165 4.63926,-6.80572 3.29775,-8.42229 -1.32305,-1.59433 -0.36285,-2.6664 1.68451,-1.88075 1.95936,0.75187 1.97291,3.92314 0.0328,7.67494 -2.07342,4.00956 -6.81078,6.32552 -8.82298,4.31331 z m 242.13271,-60.64135 c 0.16466,-5.66611 -0.15276,-11.49123 -0.70537,-12.9447 -1.43158,-3.76534 -5.34486,-6.07073 -8.95779,-5.2772 l -2.94506,0.64684 4.25967,9.19154 c 2.34283,5.05535 5.06095,11.32904 6.04028,13.94154 0.97933,2.6125 1.83197,4.74865 1.89475,4.747 0.0628,-0.002 0.24886,-4.6389 0.41352,-10.30502 z M 152.5,450.49366 c 32.45,-2.47066 59.3375,-4.49246 59.75,-4.49288 0.4125,-4.3e-4 0.75,-21.99893 0.75,-48.88556 l 0,-48.88477 -5.75,-0.66562 c -3.1625,-0.36608 -8.56027,-2.02003 -11.99504,-3.67544 C 185.55597,339.21491 182,333.09059 182,321.06088 c 0,-12.95693 5.1695,-26.1396 13.19384,-33.64543 5.08412,-4.7556 11.75773,-8.35641 15.55616,-8.39349 L 213,279 l 0,-79.10841 0,-79.10841 2.25,0.5104 c 1.2375,0.28072 42.16553,4.93395 90.95117,10.34051 l 88.70117,9.83012 9.29883,-9.02004 c 5.11436,-4.96102 12.22383,-11.59852 15.79883,-14.75 l 6.5,-5.72996 -106,0.28069 -106,0.28069 -11.85725,2.76406 c -29.11487,6.78703 -51.4635,19.26527 -71.65218,40.00663 -13.96897,14.35138 -27.6626,35.97803 -31.021017,48.99217 -0.597756,2.31635 -1.701778,5.56155 -2.453383,7.21155 -0.751605,1.65 -2.172447,7.05 -3.157428,12 -1.64395,8.26164 -1.81688,18.12701 -2.107862,120.25 -0.174342,61.1875 0.03539,111.2468 0.466067,111.24289 0.430679,-0.004 27.333053,-2.02856 59.783053,-4.49923 z M 97.666667,392.33333 c -1.432793,-1.43279 -0.549259,-5.3549 1.808369,-8.02757 L 101.95007,381.5 99.9789,385.45386 c -2.061678,4.13541 -1.433143,6.31816 1.49571,5.19426 2.3236,-0.89165 4.63926,-6.80572 3.29775,-8.42229 -1.32305,-1.59433 -0.36285,-2.6664 1.68451,-1.88075 1.95936,0.75187 1.97291,3.92314 0.0328,7.67494 -2.07342,4.00956 -6.810778,6.32552 -8.822983,4.31331 z M 133.98983,242.75 C 127.9824,238.66138 126.5,235.67303 126.5,227.65136 c 0,-6.11322 0.49417,-8.19849 3.28727,-13.8715 4.49966,-9.13917 12.36007,-17.25486 18.21273,-18.80423 14.27657,-3.77942 28.42896,6.00972 26.57378,18.38096 -1.58791,10.58889 -11.98134,25.24184 -21.00144,29.60839 -5.97906,2.89441 -15.16199,2.7936 -19.58251,-0.21498 z m 18.51525,-1.47902 c 2.7398,-1.47464 9.27726,-14.54309 10.64077,-21.27098 2.79709,-13.80156 -6.31944,-23.45379 -18.94188,-20.05492 -7.86344,2.1174 -15.21079,13.89843 -15.97994,25.62287 -0.52264,7.96666 0.99349,12.21802 5.38286,15.09404 4.76827,3.12429 13.6907,3.41181 18.89819,0.60899 z m 16.24785,-18.1645 c 3.11347,-6.65027 3.92958,-13.04455 2.19834,-17.22413 -1.71772,-4.14693 -9.18627,-8.89673 -13.89705,-8.83815 l -3.55422,0.0442 3.66951,1.9384 c 5.79409,3.0607 8.22787,7.31404 8.67083,15.15339 0.25219,4.46315 -0.16155,8.31429 -1.23017,11.45052 -0.8856,2.59907 -1.59586,5.20792 -1.57837,5.79744 0.0523,1.76238 3.02317,-2.5589 5.72113,-8.32166 z m 487.18782,222.7342 C 656.52334,443.12416 657,440.21409 657,439.37386 657,437.13043 651.48745,432 649.07692,432 c -2.65312,0 -2.61734,0.79584 0.16913,3.76191 1.86269,1.98274 2.30905,3.7779 2.6151,10.51729 0.31986,7.04347 0.54571,7.88487 1.69469,6.31354 0.72911,-0.99711 1.80232,-4.03554 2.38491,-6.75206 z M 213,314.86309 l 0,-30.13691 -6.75,0.54151 c -6.58546,0.52831 -6.86391,0.66537 -11.42286,5.62277 -10.7496,11.68909 -14.02289,35.7813 -6.13505,45.15546 4.06952,4.83634 13.13359,8.75474 20.55791,8.88718 L 213,345 213,314.86309 z M 213,283 c 0,-0.55 -1.09844,-1 -2.44098,-1 -1.34254,0 -2.7191,0.45 -3.05902,1 -0.36058,0.58342 0.65628,1 2.44098,1 1.68246,0 3.05902,-0.45 3.05902,-1 z"
+       id="path3366"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#4e401a"
+       d="m 459.42954,733.75 -8.01422,-17.25 -85.32753,-0.25564 -85.32753,-0.25564 -7.85669,2.48193 c -34.91683,11.03022 -77.23789,10.84 -111.17399,-0.49971 C 115.57788,702.54942 76.584834,661.69087 59.165484,610.5 48.189373,578.24411 45.068467,554.82324 44.294475,498.90036 l -0.548072,-39.59964 3.251798,-0.65036 C 48.786691,458.29266 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.493516,238.35 67.98936,234.5 c 4.274559,-33.18996 12.470232,-54.35194 31.059966,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.26271 5.60465,-3.45103 2.79531,-2.01315 25.26813,-11.558081 32,-13.591423 1.65,-0.498378 9.075,-2.35589 16.5,-4.127804 L 212.5,87.5 l 125,-0.5 125,-0.5 9.5,-5.62177 c 5.225,-3.091974 15.60633,-8.981649 23.06963,-13.088166 l 13.56963,-7.466396 7.97236,13.088166 7.97237,13.088166 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.27421,8.87692 39.35367,35.00691 47.59947,49.59331 1.39913,2.475 4.1947,7.19101 6.21237,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.12962,19.09004 -4.23052,24.03021 -7.57677,34 -4.26476,12.70636 -9.52026,24.51607 -12.87354,28.92831 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -1.90379,3.69603 -8.77964,13.05266 -15.19653,20.67938 -4.91775,5.84493 -21.49689,20.6915 -29.98221,26.84898 -9.13192,6.6267 -32.80081,18.11425 -44.90728,21.79548 -6.73564,2.04811 -29.43603,6.67689 -35.59058,7.25717 -5.77976,0.54495 -8.1036,1.48823 -18.88871,7.66717 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.8119,2.91514 -38.66794,17.56936 -39.392,17.56936 -0.15154,0 -3.88192,-7.7625 -8.28975,-17.25 z m 44.1704,-36.20848 C 535.40628,681.12941 554.732,667.34083 576.5,645.52851 613.29383,608.65976 629.62463,568.92752 627.68387,521 626.7158,497.09336 621.85683,478.50461 610.56262,455.5 593.5091,420.76453 563.81644,386.75683 521.5,353.49449 c -26.46453,-20.80213 -40.48748,-39.63913 -40.70064,-54.67311 -0.15787,-11.13395 9.22295,-24.99554 27.01702,-39.92176 10.03938,-8.42134 34.58429,-25.15392 48.92597,-33.35345 4.53329,-2.59181 8.50677,-5.14024 8.82997,-5.66318 0.81145,-1.31296 -63.09437,-106.73048 -68.64026,-113.22734 -0.39642,-0.4644 -4.82957,1.42239 -9.85144,4.19286 -25.77728,14.22082 -59.1445,42.24142 -81.08062,68.08861 -5.225,6.15659 -9.72633,11.72684 -10.00296,12.37834 -0.27663,0.65149 -3.81375,6.13454 -7.86028,12.18454 -7.98737,11.94198 -17.51739,30.17051 -21.17373,40.5 -1.26545,3.575 -2.64529,6.96054 -3.06632,7.52342 -1.32181,1.76715 -4.82234,16.55656 -6.38513,26.97658 -3.4539,23.02921 -0.43979,55.83794 6.52271,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 9.07618,21.14965 28.19166,47.89462 46.3542,64.85539 9.86957,9.21652 23.43305,20.44341 24.6982,20.44341 0.62033,0 1.12787,0.37736 1.12787,0.83858 0,0.46122 3.87066,3.90601 8.60146,7.65509 12.65454,10.02851 30.60591,27.6541 37.58841,36.90626 19.76135,26.18477 19.30029,44.00516 -1.68659,65.187 -10.35468,10.45088 -22.90399,19.11676 -42.00328,29.00523 -7.15,3.70184 -13.18294,6.87843 -13.40654,7.0591 C 430.16833,595.39877 483.37719,707 484.65872,707 c 0.33597,0 8.85952,-4.25632 18.94122,-9.45848 z m -273.78733,-5.56845 c 16.10469,-1.12603 20.73569,-1.92133 32.68739,-5.61353 44.50755,-13.74956 80.961,-54.696 94.536,-106.1878 1.11239,-4.21946 2.99179,-13.07174 4.17645,-19.67174 2.02894,-11.30371 2.17605,-15.77894 2.53525,-77.12662 l 0.38133,-65.12662 -7.20336,-10.87338 c -17.57193,-26.52459 -28.36998,-55.79767 -32.02158,-86.80915 -1.46274,-12.42242 -0.6599,-39.82488 1.52539,-52.06423 4.62699,-25.91492 15.46887,-53.07516 31.1996,-78.15885 C 363.05674,181.6864 364,179.50255 364,175.59115 364,173.06602 363.80602,171 363.56893,171 363.33184,171 337.87582,168.075 307,164.5 276.12418,160.925 249.99316,158 248.93107,158 c -1.9011,0 -1.9312,2.86762 -1.93927,184.75 -0.005,118.34169 -0.37302,187.98505 -1.02312,193.75 -1.38733,12.30252 -3.35824,19.7095 -7.49773,28.17763 -4.85554,9.93291 -10.63431,15.68229 -17.39188,17.3034 -16.80931,4.03249 -24.73626,-5.39853 -30.24269,-35.98103 -1.62347,-9.01667 -2.18016,-17.27645 -2.57797,-38.25 -0.50184,-26.45859 -0.53052,-26.74979 -2.63289,-26.73026 -1.85032,0.0172 -79.62775,6.06536 -100.794162,7.83802 -4.217754,0.35323 -7.952282,0.92677 -8.298952,1.27452 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.31962 15.5,-0.88443 z m 137.92216,-6.96708 c 17.88758,-16.39072 36.47002,-15.62215 35.11204,1.45223 L 402.48559,691 l 18.36419,0 c 14.30105,0 18.24955,-0.27657 17.84603,-1.25 -0.6894,-1.66306 -48.88049,-104.19407 -49.09146,-104.44661 -0.0903,-0.10814 -1.86129,5.51148 -3.93546,12.48804 -10.10618,33.99254 -25.00465,58.74578 -49.74307,82.64618 L 324.99309,691 l 18.10013,0 18.10014,0 6.54141,-5.99401 z m 25.99366,1.27701 c -0.55875,-4.95724 -4.0629,-9.283 -7.51984,-9.283 -3.14746,0 -12.00795,5.21986 -16.322,9.61556 L 365.58358,691 l 14.33826,0 14.33826,0 -0.53167,-4.717 z m 6.79138,0.59975 c 0.80879,-4.78719 -1.43649,-8.74603 -5.85245,-10.31893 -3.66138,-1.30413 -4.43555,-0.0104 -1.72215,2.87786 1.42184,1.51348 2.48088,4.15896 2.80066,6.99605 0.39644,3.51723 0.92243,4.56227 2.29628,4.56227 1.30822,0 1.96701,-1.09474 2.47766,-4.11725 z m 197.2927,-12.98973 c 11.67358,-6.40683 17.04413,-10.15866 25.85824,-18.06437 13.5172,-12.12409 17.28615,-16.75988 30.69543,-37.75518 2.1264,-3.32937 5.87306,-11.79541 8.32592,-18.81343 C 671.01556,575.44525 670.5,588.47051 670.5,402 c 0,-184.07654 0.4104,-172.24753 -6.71333,-193.5 -5.75975,-17.18327 -6.63809,-19.33335 -9.95355,-24.36499 -1.83322,-2.78214 -5.09954,-7.88817 -7.2585,-11.34672 -4.9042,-7.85631 -29.15912,-32.04 -36.89665,-36.78829 -3.13686,-1.925 -8.62902,-5.35664 -12.2048,-7.62587 -7.4663,-4.73821 -30.88805,-12.73095 -41.97317,-14.32347 -3.85,-0.55311 -8.74781,-1.27248 -10.88403,-1.59861 -3.22341,-0.49211 -3.78387,-0.33199 -3.29521,0.94145 0.52664,1.37241 13.10446,22.22038 57.71978,95.67164 l 13.70638,22.56513 -18.62346,10.32349 c -36.82278,20.41188 -61.19036,36.94887 -72.91763,49.48536 -3.41321,3.64873 -6.20583,7.49423 -6.20583,8.54555 0,3.02775 8.88602,12.84978 19.01263,21.01533 31.12991,25.10149 46.66626,39.19328 62.29183,56.5 12.61339,13.97045 26.22249,32.09954 33.98819,45.27666 3.331,5.65216 6.31534,9.86475 6.63186,9.36132 0.7029,-1.11798 7.70157,-3.12475 10.92436,-3.1324 3.94697,-0.009 8.88925,2.94797 10.19507,6.1005 1.8035,4.35404 0.61473,12.48517 -2.98651,20.42753 -1.71808,3.78915 -3.5504,7.15303 -4.07182,7.47528 -0.55685,0.34416 0.0724,3.90875 1.52502,8.63878 13.12599,42.74138 10.27154,90.65026 -7.79628,130.85233 -10.60582,23.59864 -25.42681,44.76826 -46.032,65.75 -5.26626,5.3625 -9.30006,9.75 -8.96399,9.75 0.33606,0 3.97843,-1.84814 8.09415,-4.10698 z m 53.85416,-75.55969 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.97117,3.95386 c -2.06168,4.13541 -1.43314,6.31816 1.49571,5.19426 2.11213,-0.8105 4.68287,-6.83911 3.45323,-8.09812 -1.38827,-1.42143 -1.12116,-2.55 0.60354,-2.55 2.2477,0 2.8084,2.44041 1.48325,6.45566 -1.61669,4.89864 -6.96449,8.26115 -9.34796,5.87767 z M 564.50031,345.0005 c -0.41948,-0.67874 0.69101,-2.71759 2.6345,-4.83691 1.8478,-2.01497 3.69243,-4.08513 4.09917,-4.60035 0.42529,-0.53871 1.73941,0.003 3.09265,1.27389 2.19935,2.06618 7.47606,4.16287 10.47663,4.16287 1.7904,0 11.74065,-9.52596 14.33504,-13.72378 3.08764,-4.9959 2.27684,-13.18092 -1.72241,-17.38762 -4.25364,-4.4743 -8.01688,-6.13632 -12.79161,-5.64939 -2.26836,0.23133 -4.85626,0.74898 -5.7509,1.15034 -1.20185,0.53918 -1.78865,0.0842 -2.24708,-1.74234 -0.90994,-3.62551 -9.00873,-10.2773 -14.95578,-12.28365 -3.458,-1.16663 -8.43482,-1.76412 -15.02627,-1.80397 l -9.85575,-0.0596 -4.86761,5.29078 c -2.79438,3.0373 -5.61782,7.40303 -6.62897,10.25 -0.96875,2.72757 -2.10573,4.95922 -2.52664,4.95922 -2.80567,0 2.57245,-11.24133 8.40577,-17.56974 14.7542,-16.00642 41.51007,-12.07665 47.81338,7.02257 l 1.08743,3.29494 3.67551,-1.87389 c 8.63683,-4.4033 21.41163,-1.42706 27.678,6.44835 2.58921,3.25406 3.03904,4.66623 3.02612,9.5 -0.0471,17.61651 -21.37364,31.99893 -37.2935,25.15039 l -5.26235,-2.2638 -3.33509,3.23249 c -2.27233,2.20243 -3.56617,2.85861 -4.06024,2.05919 z m 35.09965,-8.86497 c 5.37211,-3.94566 8.03527,-7.01826 9.85231,-11.36706 4.69136,-11.228 -1.88879,-21.13236 -14.93419,-22.47876 C 591.48313,301.97648 589,301.98709 589,302.3133 c 0,0.32621 1.96131,1.46069 4.35847,2.52107 5.86773,2.59557 9.81676,7.93392 10.40608,14.06704 0.54329,5.65411 -1.10358,9.73805 -6.26265,15.53024 -1.92605,2.16241 -3.5019,4.07491 -3.5019,4.25 0,0.96511 2.15074,-0.0128 5.59996,-2.54612 z m -30.1232,-45.17313 c -1.69987,-2.75045 -9.01459,-4.91858 -16.66774,-4.94044 -10.13654,-0.0289 -10.86099,1.54693 -1.03091,2.24251 4.24704,0.30053 9.97189,1.41264 12.72189,2.47136 5.32517,2.05014 6.12633,2.08661 4.97676,0.22657 z M 421.15915,562.63999 c 22.99511,-11.23207 37.4153,-21.2055 44.38179,-30.69576 3.30603,-4.50371 3.54609,-5.25582 2.57068,-8.05389 C 464.65317,513.96943 448.67705,497.14714 423,476.38938 413.925,469.053 404.18682,461.01612 401.35961,458.52965 l -5.1404,-4.52085 -0.50274,47.2456 c -0.48302,45.39138 -1.05303,55.0313 -4.267,72.16327 l -0.66952,3.56882 7.51918,-3.42659 c 4.13554,-1.88463 14.42255,-6.79859 22.86002,-10.91991 z m -13.49248,-50.30666 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.97117,3.95386 c -2.06168,4.13541 -1.43314,6.31816 1.49571,5.19426 2.11213,-0.8105 4.68287,-6.83911 3.45323,-8.09812 -1.38827,-1.42143 -1.12116,-2.55 0.60354,-2.55 2.2477,0 2.8084,2.44041 1.48325,6.45566 -1.61669,4.89864 -6.96449,8.26115 -9.34796,5.87767 z m 242.13271,-60.64135 c 0.16466,-5.66611 -0.15276,-11.49123 -0.70537,-12.9447 -1.43158,-3.76534 -5.34486,-6.07073 -8.95779,-5.2772 l -2.94506,0.64684 4.25967,9.19154 c 2.34283,5.05535 5.06095,11.32904 6.04028,13.94154 0.97933,2.6125 1.83197,4.74865 1.89475,4.747 0.0628,-0.002 0.24886,-4.6389 0.41352,-10.30502 z M 152.5,450.49366 c 32.45,-2.47066 59.3375,-4.49246 59.75,-4.49288 0.4125,-4.3e-4 0.74687,-22.16328 0.74304,-49.25078 l -0.007,-49.25 -4.45317,-0.20072 c -11.32641,-0.51052 -20.37021,-5.60437 -24.07385,-13.55941 -5.77824,-12.41108 -1.29516,-33.36827 9.68655,-45.28203 C 198.41195,283.82942 206.86319,279 210.69634,279 l 2.30366,0 0,-79.10841 0,-79.10841 2.25,0.5104 c 1.2375,0.28072 42.16553,4.93395 90.95117,10.34051 l 88.70117,9.83012 9.29883,-9.02004 c 5.11436,-4.96102 12.22383,-11.59852 15.79883,-14.75 l 6.5,-5.72996 -106,0.28069 -106,0.28069 -11.85725,2.76406 c -29.11487,6.78703 -51.4635,19.26527 -71.65218,40.00663 -13.96897,14.35138 -27.6626,35.97803 -31.021017,48.99217 -0.597756,2.31635 -1.701778,5.56155 -2.453383,7.21155 -0.751605,1.65 -2.172447,7.05 -3.157428,12 -1.64395,8.26164 -1.81688,18.12701 -2.107862,120.25 -0.174342,61.1875 0.03539,111.2468 0.466067,111.24289 0.430679,-0.004 27.333053,-2.02856 59.783053,-4.49923 z M 97.666667,392.33333 c -1.432793,-1.43279 -0.549259,-5.3549 1.808369,-8.02757 L 101.95007,381.5 99.9789,385.45386 c -2.061678,4.13541 -1.433143,6.31816 1.49571,5.19426 2.11213,-0.8105 4.68287,-6.83911 3.45323,-8.09812 -1.38827,-1.42143 -1.12116,-2.55 0.60354,-2.55 2.2477,0 2.8084,2.44041 1.48325,6.45566 -1.61669,4.89864 -6.96449,8.26115 -9.347963,5.87767 z M 135.45042,243.5934 c -4.12201,-1.79543 -8.22634,-6.88202 -9.03615,-11.19871 -1.70648,-9.09627 3.25196,-21.8906 11.92744,-30.77657 4.17231,-4.27353 6.20894,-5.55074 10.48822,-6.57732 14.31395,-3.43386 27.58908,6.0109 25.74385,18.31579 -1.60807,10.72335 -11.38363,24.48641 -20.77073,29.24321 -5.39021,2.73143 -13.37092,3.1635 -18.35263,0.9936 z m 17.05466,-2.32242 c 2.7398,-1.47464 9.27726,-14.54309 10.64077,-21.27098 2.79709,-13.80156 -6.31944,-23.45379 -18.94188,-20.05492 -7.86344,2.1174 -15.21079,13.89843 -15.97994,25.62287 -0.52264,7.96666 0.99349,12.21802 5.38286,15.09404 4.76827,3.12429 13.6907,3.41181 18.89819,0.60899 z m 15.36279,-16.51267 c 3.88779,-7.69982 4.96958,-14.32232 3.0834,-18.87596 -1.71772,-4.14693 -9.18627,-8.89673 -13.89705,-8.83815 l -3.55422,0.0442 3.66951,1.9384 c 5.90112,3.11724 8.25938,7.32603 8.66745,15.4688 0.2637,5.26202 -0.15153,8.32499 -1.66922,12.31316 -2.85715,7.50797 -0.45358,6.17603 3.70013,-2.05044 z M 655.94075,445.84068 C 656.52334,443.12416 657,440.21409 657,439.37386 657,437.13043 651.48745,432 649.07692,432 c -2.65312,0 -2.61734,0.79584 0.16913,3.76191 1.86269,1.98274 2.30905,3.7779 2.6151,10.51729 0.31986,7.04347 0.54571,7.88487 1.69469,6.31354 0.72911,-0.99711 1.80232,-4.03554 2.38491,-6.75206 z M 213,314.86309 l 0,-30.13691 -6.75,0.54151 c -6.58546,0.52831 -6.86391,0.66537 -11.42286,5.62277 -10.7496,11.68909 -14.02289,35.7813 -6.13505,45.15546 4.06952,4.83634 13.13359,8.75474 20.55791,8.88718 L 213,345 213,314.86309 z M 213,283 c 0,-0.55 -1.09844,-1 -2.44098,-1 -1.34254,0 -2.7191,0.45 -3.05902,1 -0.36058,0.58342 0.65628,1 2.44098,1 1.68246,0 3.05902,-0.45 3.05902,-1 z"
+       id="path3364"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#353c36"
+       d="m 459.42954,733.75 -8.01422,-17.25 -85.32753,-0.25564 -85.32753,-0.25564 -7.85669,2.48193 c -34.91683,11.03022 -77.23789,10.84 -111.17399,-0.49971 C 115.57788,702.54942 76.584834,661.69087 59.165484,610.5 48.189373,578.24411 45.068467,554.82324 44.294475,498.90036 l -0.548072,-39.59964 3.251798,-0.65036 C 48.786691,458.29266 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.493516,238.35 67.98936,234.5 c 4.274559,-33.18996 12.470232,-54.35194 31.059966,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.26271 5.60465,-3.45103 2.79531,-2.01315 25.26813,-11.558081 32,-13.591423 1.65,-0.498378 9.075,-2.35589 16.5,-4.127804 L 212.5,87.5 l 125,-0.5 125,-0.5 9.5,-5.62177 c 5.225,-3.091974 15.60633,-8.981649 23.06963,-13.088166 l 13.56963,-7.466396 7.97236,13.088166 7.97237,13.088166 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.27421,8.87692 39.35367,35.00691 47.59947,49.59331 1.39913,2.475 4.1947,7.19101 6.21237,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.12962,19.09004 -4.23052,24.03021 -7.57677,34 -4.26476,12.70636 -9.52026,24.51607 -12.87354,28.92831 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -1.90379,3.69603 -8.77964,13.05266 -15.19653,20.67938 -4.91775,5.84493 -21.49689,20.6915 -29.98221,26.84898 -9.13192,6.6267 -32.80081,18.11425 -44.90728,21.79548 -6.73564,2.04811 -29.43603,6.67689 -35.59058,7.25717 -5.77976,0.54495 -8.1036,1.48823 -18.88871,7.66717 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.8119,2.91514 -38.66794,17.56936 -39.392,17.56936 -0.15154,0 -3.88192,-7.7625 -8.28975,-17.25 z m 44.45525,-36.34777 C 535.41149,681.14747 554.71548,667.35738 576.5,645.52851 613.29383,608.65976 629.62463,568.92752 627.68387,521 c -0.91859,-22.68475 -5.70194,-41.81896 -15.69817,-62.79532 -17.4159,-36.546 -44.65328,-67.84516 -93.10567,-106.99007 -14.70455,-11.87988 -24.38365,-21.80648 -30.31709,-31.0923 -5.68565,-8.89804 -7.66464,-14.32298 -7.7633,-21.28121 -0.15827,-11.16225 9.23111,-25.03729 27.01674,-39.92362 10.61875,-8.88775 37.08387,-26.83483 50.01539,-33.91748 5.62121,-3.07876 8.09838,-4.98319 7.84335,-6.0299 C 565.28352,217.36292 502.436,113.59455 500.28281,111 c -0.68466,-0.825 -1.85237,-2.34566 -2.59492,-3.37925 -1.28762,-1.79231 -1.77541,-1.6446 -10.54402,3.19286 -20.13507,11.10813 -43.37773,29.30117 -64.68387,50.63087 -12.31118,12.3248 -25.34456,27.07682 -26.55398,30.05552 -0.22331,0.55 -3.71815,5.95 -7.7663,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64529,6.96054 -3.06632,7.52342 -1.32181,1.76715 -4.82234,16.55656 -6.38513,26.97658 -3.4539,23.02921 -0.43979,55.83794 6.52271,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 6.80727,15.86254 19.17241,34.87375 33.35097,51.2766 9.7979,11.33496 34.97887,34.0222 37.76185,34.0222 0.5871,0 1.06745,0.37736 1.06745,0.83858 0,0.46122 3.87066,3.90601 8.60146,7.65509 12.65454,10.02851 30.60591,27.6541 37.58841,36.90626 19.76209,26.18575 19.30202,44.06406 -1.67693,65.16572 -10.4297,10.49071 -24.15818,19.93664 -42.83664,29.47392 -6.9589,3.55324 -12.65789,6.73984 -12.66442,7.08135 -0.0144,0.75307 40.79578,87.21928 47.96674,101.62908 2.80547,5.6375 5.36863,10.25 5.69591,10.25 0.32728,0 8.9719,-4.31899 19.21026,-9.59777 z M 237,691.39469 c 5.225,-0.35105 13.63574,-1.70004 18.69053,-2.99778 50.76766,-13.03374 90.23325,-57.44277 103.27594,-116.21225 C 363.41111,552.15742 364,541.11294 364,477.78162 l 0,-59.73064 -7.13885,-10.77549 c -17.50452,-26.42162 -28.31044,-55.74205 -31.95706,-86.71126 -1.46274,-12.42242 -0.6599,-39.82488 1.52539,-52.06423 4.62699,-25.91492 15.46887,-53.07516 31.1996,-78.15885 C 362.99587,181.78345 364,179.47658 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.80913,24.88867 -12.44424,42.49565 -24.88871,45.48103 -14.07768,3.37719 -21.20097,-2.29973 -26.98564,-21.50625 -3.84178,-12.75567 -5.26047,-25.74038 -5.81525,-53.22478 -0.52353,-25.93639 -0.55523,-26.24976 -2.65402,-26.23026 -1.84934,0.0172 -79.63544,6.06611 -100.792802,7.83802 -4.217754,0.35323 -7.952282,0.92677 -8.298952,1.27452 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.23696,12.24578 38.02768,19.01755 61.75045,21.12908 8.7764,0.78117 12.92982,0.70298 32.5,-0.61184 z m 130.73477,-6.3887 c 17.88758,-16.39072 36.47002,-15.62215 35.11204,1.45223 L 402.48559,691 l 18.36419,0 c 14.30134,0 18.24944,-0.27655 17.84549,-1.25 -0.75701,-1.82424 -48.86861,-104.21391 -49.07813,-104.44661 -0.0974,-0.10814 -1.87408,5.51148 -3.94825,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.16837,0 18.16837,0 6.54141,-5.99401 z m 25.99366,1.27701 c -0.55875,-4.95724 -4.0629,-9.283 -7.51984,-9.283 -3.14746,0 -12.00795,5.21986 -16.322,9.61556 L 365.58358,691 l 14.33826,0 14.33826,0 -0.53167,-4.717 z m 6.79138,0.59975 c 0.80879,-4.78719 -1.43649,-8.74603 -5.85245,-10.31893 -3.66138,-1.30413 -4.43555,-0.0104 -1.72215,2.87786 1.42184,1.51348 2.48088,4.15896 2.80066,6.99605 0.39644,3.51723 0.92243,4.56227 2.29628,4.56227 1.30822,0 1.96701,-1.09474 2.47766,-4.11725 z m 197.2927,-12.98973 c 11.46927,-6.2947 16.98506,-10.1164 25.52778,-17.6873 9.46776,-8.3907 18.91667,-19.00779 23.65971,-26.5848 1.925,-3.07519 5.33963,-8.4787 7.58806,-12.00779 2.67455,-4.19793 5.68918,-11.37769 8.71872,-20.76484 8.34865,-25.86864 7.87456,-13.38446 7.51336,-197.84829 -0.35577,-181.69686 0.10815,-169.14098 -7.03875,-190.5 -5.7905,-17.30531 -6.79886,-19.8342 -9.1334,-22.9059 -1.29336,-1.70176 -3.15844,-4.6691 -4.14461,-6.5941 -5.85923,-11.43711 -27.86299,-34.56997 -40.73438,-42.82461 -3.15205,-2.02146 -8.50352,-5.43904 -11.89214,-7.59461 -10.95133,-6.96636 -32.73531,-13.63333 -52.23204,-15.98558 -4.13378,-0.49874 -4.76604,-0.35348 -4.25527,0.97758 0.32996,0.85984 10.21791,17.39522 21.97324,36.74528 11.75533,19.35007 27.67576,45.56125 35.37873,58.24708 l 14.0054,23.06513 -18.62346,10.32349 c -36.82278,20.41188 -61.19036,36.94887 -72.91763,49.48536 -3.41321,3.64873 -6.20583,7.49423 -6.20583,8.54555 0,3.01653 8.86667,12.83206 18.98381,21.01533 20.72575,16.76408 30.0146,24.63126 39.94903,33.83476 21.86946,20.26042 43.93796,46.86405 56.35981,67.9419 3.331,5.65216 6.31534,9.86475 6.63186,9.36132 0.7029,-1.11798 7.70157,-3.12475 10.92436,-3.1324 3.94697,-0.009 8.88925,2.94797 10.19507,6.1005 1.81363,4.37848 0.61808,12.39575 -3.08271,20.6724 -1.77595,3.97183 -3.56627,7.22152 -3.97849,7.22152 -1.41407,0 -1.84087,-4.1857 -1.30904,-12.83791 0.31208,-5.07707 0.0944,-9.7786 -0.52599,-11.35979 -1.5165,-3.8652 -5.38528,-6.12867 -9.086,-5.31585 l -3.01957,0.6632 2.6057,5.14209 c 8.26112,16.30254 16.83428,43.4117 19.24676,60.86016 4.75507,34.3913 0.17551,69.04353 -13.19568,99.8481 -10.81647,24.91897 -26.13276,47.13294 -47.05765,68.25 -5.3137,5.3625 -9.35766,9.75 -8.98658,9.75 0.37108,0 4.0421,-1.84814 8.15782,-4.10698 z m 53.85416,-75.55969 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.97117,3.95386 c -2.06168,4.13541 -1.43314,6.31816 1.49571,5.19426 2.11213,-0.8105 4.68287,-6.83911 3.45323,-8.09812 -1.38827,-1.42143 -1.12116,-2.55 0.60354,-2.55 2.2477,0 2.8084,2.44041 1.48325,6.45566 -1.61669,4.89864 -6.96449,8.26115 -9.34796,5.87767 z M 564.50031,345.0005 c -0.41948,-0.67874 0.69101,-2.71759 2.6345,-4.83691 1.8478,-2.01497 3.69243,-4.08513 4.09917,-4.60035 0.42529,-0.53871 1.73941,0.003 3.09265,1.27389 2.19935,2.06618 7.47606,4.16287 10.47663,4.16287 1.7904,0 11.74065,-9.52596 14.33504,-13.72378 3.08764,-4.9959 2.27684,-13.18092 -1.72241,-17.38762 -4.25364,-4.4743 -8.01688,-6.13632 -12.79161,-5.64939 -2.26836,0.23133 -4.85626,0.74898 -5.7509,1.15034 -1.20185,0.53918 -1.78865,0.0842 -2.24708,-1.74234 -0.90994,-3.62551 -9.00873,-10.2773 -14.95578,-12.28365 -3.458,-1.16663 -8.43482,-1.76412 -15.02627,-1.80397 l -9.85575,-0.0596 -4.86761,5.29078 c -2.79438,3.0373 -5.61782,7.40303 -6.62897,10.25 -0.96875,2.72757 -2.10573,4.95922 -2.52664,4.95922 -2.80567,0 2.57245,-11.24133 8.40577,-17.56974 14.7542,-16.00642 41.51007,-12.07665 47.81338,7.02257 l 1.08743,3.29494 3.67551,-1.87389 c 8.63683,-4.4033 21.41163,-1.42706 27.678,6.44835 2.58921,3.25406 3.03904,4.66623 3.02612,9.5 -0.0471,17.61651 -21.37364,31.99893 -37.2935,25.15039 l -5.26235,-2.2638 -3.33509,3.23249 c -2.27233,2.20243 -3.56617,2.85861 -4.06024,2.05919 z m 35.09965,-8.86497 c 5.37211,-3.94566 8.03527,-7.01826 9.85231,-11.36706 4.69136,-11.228 -1.88879,-21.13236 -14.93419,-22.47876 C 591.48313,301.97648 589,301.98709 589,302.3133 c 0,0.32621 1.96131,1.46069 4.35847,2.52107 5.86773,2.59557 9.81676,7.93392 10.40608,14.06704 0.54329,5.65411 -1.10358,9.73805 -6.26265,15.53024 -1.92605,2.16241 -3.5019,4.07491 -3.5019,4.25 0,0.96511 2.15074,-0.0128 5.59996,-2.54612 z m -30.1232,-45.17313 c -1.69987,-2.75045 -9.01459,-4.91858 -16.66774,-4.94044 -10.13654,-0.0289 -10.86099,1.54693 -1.03091,2.24251 4.24704,0.30053 9.97189,1.41264 12.72189,2.47136 5.32517,2.05014 6.12633,2.08661 4.97676,0.22657 z M 421,562.74005 c 23.13802,-11.22993 37.47602,-21.17147 44.6718,-30.97409 3.11789,-4.24741 3.39959,-5.12243 2.48954,-7.73299 -3.54582,-10.17154 -18.99893,-26.5132 -44.73304,-47.30517 -9.31056,-7.52251 -19.2908,-15.75417 -22.1783,-18.29258 l -5.25,-4.61529 -0.004,37.84004 c -0.004,38.68727 -0.94734,58.72174 -3.53458,75.07926 -0.80374,5.08158 -1.46135,9.44348 -1.46135,9.69311 0,0.57351 10.18012,-4.07279 30,-13.69229 z m -13.33333,-50.40672 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.97117,3.95386 c -2.06168,4.13541 -1.43314,6.31816 1.49571,5.19426 2.11213,-0.8105 4.68287,-6.83911 3.45323,-8.09812 -1.38827,-1.42143 -1.12116,-2.55 0.60354,-2.55 2.2477,0 2.8084,2.44041 1.48325,6.45566 -1.61669,4.89864 -6.96449,8.26115 -9.34796,5.87767 z M 152.5,450.50634 c 32.45,-2.47067 59.3375,-4.49532 59.75,-4.49923 0.4125,-0.004 0.74687,-22.16961 0.74304,-49.25711 l -0.007,-49.25 -4.45317,-0.20072 c -11.32641,-0.51052 -20.37021,-5.60437 -24.07385,-13.55941 -5.77824,-12.41108 -1.29516,-33.36827 9.68655,-45.28203 C 198.41195,283.82942 206.86319,279 210.69634,279 l 2.30366,0 0,-79.10841 0,-79.10841 2.25,0.51531 c 1.2375,0.28341 42.1625,4.93962 90.94444,10.34711 l 88.69444,9.83181 9.30556,-9.02664 C 409.3125,127.48612 416.425,120.84685 420,117.69683 l 6.5,-5.7273 -106,0.27358 -106,0.27358 -12,2.79045 c -13.25864,3.08314 -30.96964,9.76088 -40.08644,15.11417 -17.7117,10.40012 -35.67728,26.88814 -45.50077,41.75862 -10.81105,16.36541 -14.86132,24.04093 -16.943237,32.10852 -0.597756,2.31635 -1.701778,5.56155 -2.453383,7.21155 -0.751605,1.65 -2.172447,7.05 -3.157428,12 -1.64395,8.26164 -1.81688,18.12701 -2.107862,120.25 -0.174342,61.1875 0.03539,111.24965 0.466067,111.24922 C 93.147626,454.9988 120.05,452.977 152.5,450.50634 z M 97.666667,392.33333 c -1.432793,-1.43279 -0.549259,-5.3549 1.808369,-8.02757 L 101.95007,381.5 99.9789,385.45386 c -2.061678,4.13541 -1.433143,6.31816 1.49571,5.19426 2.11213,-0.8105 4.68287,-6.83911 3.45323,-8.09812 -1.38827,-1.42143 -1.12116,-2.55 0.60354,-2.55 2.2477,0 2.8084,2.44041 1.48325,6.45566 -1.61669,4.89864 -6.96449,8.26115 -9.347963,5.87767 z M 135.45042,243.5934 c -4.12201,-1.79543 -8.22634,-6.88202 -9.03615,-11.19871 -1.70648,-9.09627 3.25196,-21.8906 11.92744,-30.77657 4.17231,-4.27353 6.20894,-5.55074 10.48822,-6.57732 14.31395,-3.43386 27.58908,6.0109 25.74385,18.31579 -1.60807,10.72335 -11.38363,24.48641 -20.77073,29.24321 -5.39021,2.73143 -13.37092,3.1635 -18.35263,0.9936 z m 17.05466,-2.32242 c 2.7398,-1.47464 9.27726,-14.54309 10.64077,-21.27098 2.79709,-13.80156 -6.31944,-23.45379 -18.94188,-20.05492 -7.86344,2.1174 -15.21079,13.89843 -15.97994,25.62287 -0.52264,7.96666 0.99349,12.21802 5.38286,15.09404 4.76827,3.12429 13.6907,3.41181 18.89819,0.60899 z m 15.36279,-16.51267 c 3.88779,-7.69982 4.96958,-14.32232 3.0834,-18.87596 -1.71772,-4.14693 -9.18627,-8.89673 -13.89705,-8.83815 l -3.55422,0.0442 3.66951,1.9384 c 5.90112,3.11724 8.25938,7.32603 8.66745,15.4688 0.2637,5.26202 -0.15153,8.32499 -1.66922,12.31316 -2.85715,7.50797 -0.45358,6.17603 3.70013,-2.05044 z M 655.94075,445.84068 C 656.52334,443.12416 657,440.21409 657,439.37386 657,437.13043 651.48745,432 649.07692,432 c -2.65312,0 -2.61734,0.79584 0.16913,3.76191 1.86269,1.98274 2.30905,3.7779 2.6151,10.51729 0.31986,7.04347 0.54571,7.88487 1.69469,6.31354 0.72911,-0.99711 1.80232,-4.03554 2.38491,-6.75206 z M 213,314.86309 l 0,-30.13691 -6.75,0.54151 c -6.58546,0.52831 -6.86391,0.66537 -11.42286,5.62277 -10.7496,11.68909 -14.02289,35.7813 -6.13505,45.15546 4.06952,4.83634 13.13359,8.75474 20.55791,8.88718 L 213,345 213,314.86309 z M 213,283 c 0,-0.55 -1.09844,-1 -2.44098,-1 -1.34254,0 -2.7191,0.45 -3.05902,1 -0.36058,0.58342 0.65628,1 2.44098,1 1.68246,0 3.05902,-0.45 3.05902,-1 z"
+       id="path3362"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#353a34"
+       d="m 459.42954,733.75 -8.01422,-17.25 -85.32753,-0.25564 -85.32753,-0.25564 -7.85669,2.48193 c -34.91683,11.03022 -77.23789,10.84 -111.17399,-0.49971 C 115.57788,702.54942 76.584834,661.69087 59.165484,610.5 48.189373,578.24411 45.068467,554.82324 44.294475,498.90036 l -0.548072,-39.59964 3.251798,-0.65036 C 48.786691,458.29266 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.493516,238.35 67.98936,234.5 c 4.274559,-33.18996 12.470232,-54.35194 31.059966,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.26271 5.60465,-3.45103 2.79531,-2.01315 25.26813,-11.558081 32,-13.591423 1.65,-0.498378 9.075,-2.35589 16.5,-4.127804 L 212.5,87.5 l 125,-0.5 125,-0.5 9.5,-5.62177 c 5.225,-3.091974 15.60633,-8.981649 23.06963,-13.088166 l 13.56963,-7.466396 7.97236,13.088166 7.97237,13.088166 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.27421,8.87692 39.35367,35.00691 47.59947,49.59331 1.39913,2.475 4.1947,7.19101 6.21237,10.48002 2.01768,3.28901 4.15167,7.77438 4.74221,9.96748 0.59054,2.19311 1.87979,5.8021 2.865,8.01998 2.6631,5.99513 5.86142,17.17342 7.0192,24.53252 0.56245,3.575 1.55898,8.3 2.21451,10.5 1.54727,5.19267 2.37284,331.78417 0.862,341 -3.12962,19.09004 -4.23052,24.03021 -7.57677,34 -4.26476,12.70636 -9.52026,24.51607 -12.87354,28.92831 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -1.90379,3.69603 -8.77964,13.05266 -15.19653,20.67938 -4.91775,5.84493 -21.49689,20.6915 -29.98221,26.84898 -9.13192,6.6267 -32.80081,18.11425 -44.90728,21.79548 -6.73564,2.04811 -29.43603,6.67689 -35.59058,7.25717 -5.77976,0.54495 -8.1036,1.48823 -18.88871,7.66717 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.8119,2.91514 -38.66794,17.56936 -39.392,17.56936 -0.15154,0 -3.88192,-7.7625 -8.28975,-17.25 z m 44.45525,-36.34777 C 535.41149,681.14747 554.71548,667.35738 576.5,645.52851 613.29383,608.65976 629.62463,568.92752 627.68387,521 c -0.91859,-22.68475 -5.70194,-41.81896 -15.69817,-62.79532 -17.4159,-36.546 -44.65328,-67.84516 -93.10567,-106.99007 -14.70455,-11.87988 -24.38365,-21.80648 -30.31709,-31.0923 -5.68565,-8.89804 -7.66464,-14.32298 -7.7633,-21.28121 -0.15827,-11.16225 9.23111,-25.03729 27.01674,-39.92362 10.61875,-8.88775 37.08387,-26.83483 50.01539,-33.91748 5.62121,-3.07876 8.09838,-4.98319 7.84335,-6.0299 C 565.28352,217.36292 502.436,113.59455 500.28281,111 c -0.68466,-0.825 -1.85237,-2.34566 -2.59492,-3.37925 -1.28762,-1.79231 -1.77541,-1.6446 -10.54402,3.19286 -20.13507,11.10813 -43.37773,29.30117 -64.68387,50.63087 -12.31118,12.3248 -25.34456,27.07682 -26.55398,30.05552 -0.22331,0.55 -3.71815,5.95 -7.7663,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64529,6.96054 -3.06632,7.52342 -1.32181,1.76715 -4.82234,16.55656 -6.38513,26.97658 -3.4539,23.02921 -0.43979,55.83794 6.52271,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 6.80727,15.86254 19.17241,34.87375 33.35097,51.2766 9.7979,11.33496 34.97887,34.0222 37.76185,34.0222 0.5871,0 1.06745,0.37736 1.06745,0.83858 0,0.46122 3.87066,3.90601 8.60146,7.65509 12.65454,10.02851 30.60591,27.6541 37.58841,36.90626 19.76209,26.18575 19.30202,44.06406 -1.67693,65.16572 -10.4297,10.49071 -24.15818,19.93664 -42.83664,29.47392 -6.9589,3.55324 -12.65789,6.73984 -12.66442,7.08135 -0.0144,0.75307 40.79578,87.21928 47.96674,101.62908 2.80547,5.6375 5.36863,10.25 5.69591,10.25 0.32728,0 8.9719,-4.31899 19.21026,-9.59777 z M 237,691.39469 c 5.225,-0.35105 13.63574,-1.70004 18.69053,-2.99778 50.76766,-13.03374 90.23325,-57.44277 103.27594,-116.21225 C 363.41111,552.15742 364,541.11294 364,477.78162 l 0,-59.73064 -7.13885,-10.77549 c -17.50452,-26.42162 -28.31044,-55.74205 -31.95706,-86.71126 -1.46274,-12.42242 -0.6599,-39.82488 1.52539,-52.06423 4.62699,-25.91492 15.46887,-53.07516 31.1996,-78.15885 C 362.99587,181.78345 364,179.47658 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.80913,24.88867 -12.44424,42.49565 -24.88871,45.48103 -14.07768,3.37719 -21.20097,-2.29973 -26.98564,-21.50625 -3.84178,-12.75567 -5.26047,-25.74038 -5.81525,-53.22478 -0.52353,-25.93639 -0.55523,-26.24976 -2.65402,-26.23026 -1.84934,0.0172 -79.63544,6.06611 -100.792802,7.83802 -4.217754,0.35323 -7.952282,0.92677 -8.298952,1.27452 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.23696,12.24578 38.02768,19.01755 61.75045,21.12908 8.7764,0.78117 12.92982,0.70298 32.5,-0.61184 z m 130.52115,-6.19295 c 8.28675,-7.59331 16.16287,-11.58628 22.98324,-11.65188 9.20868,-0.0886 13.05608,3.93525 12.34242,12.90836 L 402.48559,691 l 18.36419,0 c 14.30134,0 18.24944,-0.27655 17.84549,-1.25 -0.75701,-1.82424 -48.86861,-104.21391 -49.07813,-104.44661 -0.0974,-0.10814 -1.87408,5.51148 -3.94825,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.16837,0 18.16837,0 6.32779,-5.79826 z m 26.20728,1.08126 c -0.55875,-4.95724 -4.0629,-9.283 -7.51984,-9.283 -3.14746,0 -12.00795,5.21986 -16.322,9.61556 L 365.58358,691 l 14.33826,0 14.33826,0 -0.53167,-4.717 z m 6.72929,1.0907 C 401.60827,681.2407 397.91989,676 392.45295,676 c -1.93526,0 -1.86649,0.3018 1.04705,4.59514 1.43986,2.12175 2.5,5.10898 2.5,7.04441 0,2.62778 0.41179,3.36045 1.88871,3.36045 1.37932,0 2.07219,-0.97802 2.56901,-3.6263 z m 197.35479,-13.48068 c 11.46927,-6.2947 16.98506,-10.1164 25.52778,-17.6873 9.46776,-8.3907 18.91667,-19.00779 23.65971,-26.5848 1.925,-3.07519 5.33963,-8.4787 7.58806,-12.00779 2.67455,-4.19793 5.68918,-11.37769 8.71872,-20.76484 8.34865,-25.86864 7.87456,-13.38446 7.51336,-197.84829 -0.35577,-181.69686 0.10815,-169.14098 -7.03875,-190.5 -5.7905,-17.30531 -6.79886,-19.8342 -9.1334,-22.9059 -1.29336,-1.70176 -3.15844,-4.6691 -4.14461,-6.5941 -5.85923,-11.43711 -27.86299,-34.56997 -40.73438,-42.82461 -3.15205,-2.02146 -8.50352,-5.43904 -11.89214,-7.59461 -10.95133,-6.96636 -32.73531,-13.63333 -52.23204,-15.98558 -4.13378,-0.49874 -4.76604,-0.35348 -4.25527,0.97758 0.32996,0.85984 10.21791,17.39522 21.97324,36.74528 11.75533,19.35007 27.67576,45.56125 35.37873,58.24708 l 14.0054,23.06513 -18.62346,10.32349 c -36.82278,20.41188 -61.19036,36.94887 -72.91763,49.48536 -3.41321,3.64873 -6.20583,7.49423 -6.20583,8.54555 0,3.01653 8.86667,12.83206 18.98381,21.01533 20.72575,16.76408 30.0146,24.63126 39.94903,33.83476 21.86946,20.26042 43.93796,46.86405 56.35981,67.9419 3.331,5.65216 6.31534,9.86123 6.63186,9.35349 1.02349,-1.64182 9.19407,-3.28591 13.07303,-2.63057 7.00809,1.18401 9.731,5.70125 8.69736,14.42871 -0.571,4.82116 -6.33358,19.07171 -7.71216,19.07171 -1.41407,0 -1.84087,-4.1857 -1.30904,-12.83791 0.31208,-5.07707 0.0944,-9.7786 -0.52599,-11.35979 -1.5165,-3.8652 -5.38528,-6.12867 -9.086,-5.31585 l -3.01957,0.6632 2.6057,5.14209 c 8.26112,16.30254 16.83428,43.4117 19.24676,60.86016 4.75507,34.3913 0.17551,69.04353 -13.19568,99.8481 -10.81647,24.91897 -26.13276,47.13294 -47.05765,68.25 -5.3137,5.3625 -9.35766,9.75 -8.98658,9.75 0.37108,0 4.0421,-1.84814 8.15782,-4.10698 z m 53.85416,-75.55969 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.97117,3.95386 c -2.06168,4.13541 -1.43314,6.31816 1.49571,5.19426 2.11213,-0.8105 4.68287,-6.83911 3.45323,-8.09812 -1.36332,-1.39588 -1.13107,-2.55 0.51314,-2.55 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 564.50031,345.0005 c -0.41948,-0.67874 0.69101,-2.71759 2.6345,-4.83691 1.8478,-2.01497 3.69243,-4.08513 4.09917,-4.60035 0.42529,-0.53871 1.73941,0.003 3.09265,1.27389 2.19935,2.06618 7.47606,4.16287 10.47663,4.16287 1.7904,0 11.74065,-9.52596 14.33504,-13.72378 3.08764,-4.9959 2.27684,-13.18092 -1.72241,-17.38762 -4.25364,-4.4743 -8.01688,-6.13632 -12.79161,-5.64939 -2.26836,0.23133 -4.85626,0.74898 -5.7509,1.15034 -1.20185,0.53918 -1.78865,0.0842 -2.24708,-1.74234 -0.90994,-3.62551 -9.00873,-10.2773 -14.95578,-12.28365 -3.458,-1.16663 -8.43482,-1.76412 -15.02627,-1.80397 l -9.85575,-0.0596 -4.86761,5.29078 c -2.79438,3.0373 -5.61782,7.40303 -6.62897,10.25 -0.96875,2.72757 -2.10573,4.95922 -2.52664,4.95922 -2.80534,0 2.57226,-11.24113 8.40442,-17.56828 14.62536,-15.86664 41.56671,-11.91058 47.81473,7.02111 l 1.08743,3.29494 3.67551,-1.87389 c 4.8407,-2.46793 14.35426,-2.46515 19.794,0.006 7.49537,3.40468 12.31198,11.7159 10.97372,18.93552 -3.13831,16.93047 -23.44539,28.46605 -38.32164,21.76888 l -4.25583,-1.91594 -3.35608,3.25285 c -2.28563,2.21532 -3.58738,2.8786 -4.08123,2.07953 z m 35.09965,-8.86497 c 5.37211,-3.94566 8.03527,-7.01826 9.85231,-11.36706 4.42933,-10.60087 -1.40772,-20.58953 -13.05228,-22.33574 -6.73084,-1.00935 -8.59743,-0.0967 -3.93659,1.92464 5.06466,2.19652 7.28714,4.23687 9.64301,8.85279 3.58027,7.01491 1.96221,14.32338 -4.68687,21.16972 -5.34501,5.50358 -4.18937,6.43408 2.18042,1.75565 z m -29.72752,-44.79805 c -2.67089,-3.23539 -9.72807,-5.51395 -17.07789,-5.51395 -3.85994,0 -7.50779,0.48971 -8.10631,1.08823 -0.78432,0.78432 0.44498,1.08824 4.40166,1.08824 5.74618,0 16.72957,2.42373 18.3601,4.05157 0.5225,0.52164 1.5901,0.94843 2.37244,0.94843 1.20988,0 1.21735,-0.24844 0.05,-1.66252 z M 421,562.74005 c 23.13802,-11.22993 37.47602,-21.17147 44.6718,-30.97409 3.11789,-4.24741 3.39959,-5.12243 2.48954,-7.73299 -3.54582,-10.17154 -18.99893,-26.5132 -44.73304,-47.30517 -9.31056,-7.52251 -19.2908,-15.75417 -22.1783,-18.29258 l -5.25,-4.61529 -0.004,37.84004 c -0.004,38.68727 -0.94734,58.72174 -3.53458,75.07926 -0.80374,5.08158 -1.46135,9.44348 -1.46135,9.69311 0,0.57351 10.18012,-4.07279 30,-13.69229 z m -13.33333,-50.40672 c -1.4328,-1.43279 -0.54926,-5.3549 1.80837,-8.02757 l 2.47503,-2.80576 -1.97117,3.95386 c -2.06168,4.13541 -1.43314,6.31816 1.49571,5.19426 2.11213,-0.8105 4.68287,-6.83911 3.45323,-8.09812 -1.36332,-1.39588 -1.13107,-2.55 0.51314,-2.55 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 152.5,450.50634 c 32.45,-2.47067 59.3375,-4.49532 59.75,-4.49923 0.4125,-0.004 0.75,-22.22164 0.75,-49.37274 l 0,-49.36564 -6.92502,-0.49548 c -9.13997,-0.65396 -16.39711,-4.59533 -20.45714,-11.11031 -7.19058,-11.53847 -3.06895,-34.62412 8.40382,-47.07061 C 198.2329,284.02367 207.09232,279 210.93807,279 l 2.06193,0 0,-79.10841 0,-79.10841 2.25,0.51531 c 1.2375,0.28341 42.1625,4.93962 90.94444,10.34711 l 88.69444,9.83181 9.30556,-9.02664 C 409.3125,127.48612 416.425,120.84685 420,117.69683 l 6.5,-5.7273 -106,0.27358 -106,0.27358 -12,2.79045 c -13.25864,3.08314 -30.96964,9.76088 -40.08644,15.11417 -17.7117,10.40012 -35.67728,26.88814 -45.50077,41.75862 -10.81105,16.36541 -14.86132,24.04093 -16.943237,32.10852 -0.597756,2.31635 -1.701778,5.56155 -2.453383,7.21155 -0.751605,1.65 -2.172447,7.05 -3.157428,12 -1.64395,8.26164 -1.81688,18.12701 -2.107862,120.25 -0.174342,61.1875 0.03539,111.24965 0.466067,111.24922 C 93.147626,454.9988 120.05,452.977 152.5,450.50634 z M 97.666667,392.33333 c -1.432793,-1.43279 -0.549259,-5.3549 1.808369,-8.02757 L 101.95007,381.5 99.9789,385.45386 c -2.061678,4.13541 -1.433143,6.31816 1.49571,5.19426 2.11213,-0.8105 4.68287,-6.83911 3.45323,-8.09812 -1.36332,-1.39588 -1.13107,-2.55 0.51314,-2.55 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.845333,7.38795 z M 135.45042,243.5934 c -3.91395,-1.70481 -8.08971,-6.6746 -8.96796,-10.67325 -2.84658,-12.9604 9.67249,-34.72476 21.71036,-37.74338 2.58105,-0.64722 5.73105,-1.17426 7,-1.17119 7.9448,0.0192 17.00252,6.29241 18.81747,13.03264 2.84533,10.56672 -7.77887,29.26365 -20.20724,35.56158 -5.39021,2.73143 -13.37092,3.1635 -18.35263,0.9936 z m 17.05466,-2.32242 c 2.7398,-1.47464 9.27726,-14.54309 10.64077,-21.27098 2.79709,-13.80156 -6.31944,-23.45379 -18.94188,-20.05492 -7.86344,2.1174 -15.21079,13.89843 -15.97994,25.62287 -0.52264,7.96666 0.99349,12.21802 5.38286,15.09404 4.76827,3.12429 13.6907,3.41181 18.89819,0.60899 z m 15.68896,-16.65537 c 4.00039,-7.92473 4.74268,-15.83054 1.90838,-20.32527 C 167.603,200.32668 161.31752,197 156.32795,197 l -3.75173,0 4.45777,2.25 c 8.62911,4.35542 11.52584,15.99358 6.96651,27.98927 -2.4064,6.33131 -2.40748,6.34338 -0.4189,4.69301 0.86988,-0.72194 2.94548,-4.01444 4.61244,-7.31667 z M 656.04413,445.2874 c 1.3457,-6.48218 0.16153,-10.41703 -3.65877,-12.15768 C 649.87012,431.9837 647,431.62442 647,432.45559 c 0,0.25058 1.125,2.11337 2.5,4.13955 2.0756,3.05856 2.5054,4.89104 2.5318,10.79441 0.0285,6.37045 0.18007,6.91464 1.45641,5.22894 0.78353,-1.03483 1.93369,-4.33382 2.55592,-7.33109 z M 213,314.86309 l 0,-30.13691 -6.75,0.54151 c -6.58546,0.52831 -6.86391,0.66537 -11.42286,5.62277 -10.7496,11.68909 -14.02289,35.7813 -6.13505,45.15546 4.06952,4.83634 13.13359,8.75474 20.55791,8.88718 L 213,345 213,314.86309 z M 213,283 c 0,-0.55 -1.09844,-1 -2.44098,-1 -1.34254,0 -2.7191,0.45 -3.05902,1 -0.36058,0.58342 0.65628,1 2.44098,1 1.68246,0 3.05902,-0.45 3.05902,-1 z"
+       id="path3360"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#4a3d18"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 c -33.42239,10.55813 -71.71912,10.89934 -106.75019,0.9511 C 154.13331,716.00825 131.37959,704.48342 120.5,696.29818 82.936695,668.03746 59.302147,626.79738 49.551692,572.5 45.558818,550.26488 44.894861,540.96355 44.297999,498.90139 l -0.561905,-39.59861 3.256953,-0.65139 C 48.784371,458.29313 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.494146,238.35 67.990761,234.5 c 4.276468,-33.15327 12.505987,-54.4036 31.058565,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.2564 5.60465,-3.437 2.81685,-2.0155 25.41273,-11.60854 32,-13.585544 1.65,-0.495206 9.075,-2.3559 16.5,-4.134875 L 212.5,87.5 l 124.77153,-0.276196 124.77154,-0.276197 5.22846,-3.326708 c 2.87566,-1.829689 13.36414,-7.812957 23.30774,-13.296151 l 18.07927,-9.969444 7.96272,13.072348 7.96273,13.072348 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.29464,8.88963 39.45466,35.11365 47.58114,49.59331 1.38905,2.475 3.96676,6.78272 5.72824,9.57271 2.97884,4.71814 5.66457,11.45995 11.52372,28.92729 2.15874,6.43564 4.68088,18.77142 6.64487,32.5 1.22598,8.56985 1.14148,327.3526 -0.0887,334.5 -0.56797,3.3 -1.64615,9.6 -2.39597,14 -2.42416,14.22523 -12.22343,40.42112 -17.92887,47.92831 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.52766,12.67374 -26.14564,33.45064 -44.11473,46.72078 -9.68797,7.15454 -34.03563,19.1506 -46,22.66413 -7.24815,2.12854 -29.57515,6.67439 -35.59058,7.24637 -5.77413,0.54903 -8.11409,1.4995 -18.88871,7.67243 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.7261,2.8721 -38.68028,17.57698 -39.36389,17.56504 -0.13607,-0.002 -3.87196,-7.76488 -8.30198,-17.25 z m 44.43937,-36.34345 C 535.41149,681.14747 554.71548,667.35738 576.5,645.52851 613.29383,608.65976 629.62463,568.92752 627.68387,521 c -0.91859,-22.68475 -5.70194,-41.81896 -15.69817,-62.79532 -17.4159,-36.546 -44.65328,-67.84516 -93.10567,-106.99007 -14.70455,-11.87988 -24.38365,-21.80648 -30.31709,-31.0923 -5.68565,-8.89804 -7.66464,-14.32298 -7.7633,-21.28121 -0.15827,-11.16225 9.23111,-25.03729 27.01674,-39.92362 10.61875,-8.88775 37.08387,-26.83483 50.01539,-33.91748 5.62121,-3.07876 8.09838,-4.98319 7.84335,-6.0299 C 565.28352,217.36292 502.436,113.59455 500.28281,111 c -0.68466,-0.825 -1.85237,-2.34566 -2.59492,-3.37925 -1.28762,-1.79231 -1.77541,-1.6446 -10.54402,3.19286 -20.13507,11.10813 -43.37773,29.30117 -64.68387,50.63087 -12.31118,12.3248 -25.34456,27.07682 -26.55398,30.05552 -0.22331,0.55 -3.71815,5.95 -7.7663,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.39109,1.86244 -4.97028,16.89122 -6.42778,26.98981 -3.38112,23.42684 -0.38429,55.88983 6.55438,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 6.80727,15.86254 19.17241,34.87375 33.35097,51.2766 9.7979,11.33496 34.97887,34.0222 37.76185,34.0222 0.5871,0 1.06745,0.37736 1.06745,0.83858 0,0.46122 3.87066,3.90601 8.60146,7.65509 12.65454,10.02851 30.60591,27.6541 37.58841,36.90626 19.76209,26.18575 19.30202,44.06406 -1.67693,65.16572 -10.4297,10.49071 -24.15818,19.93664 -42.83664,29.47392 -6.9589,3.55324 -12.65789,6.73984 -12.66442,7.08135 -0.0144,0.75307 40.79578,87.21928 47.96674,101.62908 2.80547,5.6375 5.36863,10.25 5.69591,10.25 0.32728,0 8.9719,-4.31899 19.21026,-9.59777 z M 237,691.39469 c 5.225,-0.35105 13.63574,-1.70004 18.69053,-2.99778 50.76766,-13.03374 90.23325,-57.44277 103.27594,-116.21225 C 363.41111,552.15742 364,541.11294 364,477.78162 l 0,-59.73064 -7.13885,-10.77549 c -17.50452,-26.42162 -28.31044,-55.74205 -31.95706,-86.71126 -1.6247,-13.79787 -0.63408,-40.04839 2.0591,-54.56423 4.35897,-23.49424 16.01095,-52.32273 30.43575,-75.30196 C 362.98519,181.79894 364,179.49394 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.80913,24.88867 -12.44424,42.49565 -24.88871,45.48103 -14.07768,3.37719 -21.20097,-2.29973 -26.98564,-21.50625 -3.84178,-12.75567 -5.26047,-25.74038 -5.81525,-53.22478 -0.52353,-25.93639 -0.55523,-26.24976 -2.65402,-26.23026 -1.84934,0.0172 -79.63544,6.06611 -100.792802,7.83802 -4.217754,0.35323 -7.952282,0.92677 -8.298952,1.27452 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.23696,12.24578 38.02768,19.01755 61.75045,21.12908 8.7764,0.78117 12.92982,0.70298 32.5,-0.61184 z m 130.52115,-6.19295 c 8.28675,-7.59331 16.16287,-11.58628 22.98324,-11.65188 9.20868,-0.0886 13.05608,3.93525 12.34242,12.90836 L 402.48559,691 l 18.36419,0 c 14.30134,0 18.24944,-0.27655 17.84549,-1.25 -0.75701,-1.82424 -48.86861,-104.21391 -49.07813,-104.44661 -0.0974,-0.10814 -1.87408,5.51148 -3.94825,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.16837,0 18.16837,0 6.32779,-5.79826 z M 394,687.54705 c 0,-6.99429 -4.76632,-11.68281 -10.17628,-10.01019 -4.19586,1.29726 -10.25452,5.29188 -14.27667,9.41296 L 365.5941,691 l 14.20295,0 14.20295,0 0,-3.45295 z m 6.5691,-0.0637 C 401.7092,681.40611 397.88829,676 392.45295,676 c -1.92823,0 -1.83882,0.55906 0.62162,3.88699 1.14101,1.5433 2.32526,4.67508 2.63167,6.9595 0.42233,3.1487 0.99812,4.15351 2.38012,4.15351 1.29336,0 2.01469,-1.02173 2.48274,-3.51667 z m 197.24341,-13.59031 c 11.46927,-6.2947 16.98506,-10.1164 25.52778,-17.6873 9.46776,-8.3907 18.91667,-19.00779 23.65971,-26.5848 1.925,-3.07519 5.33963,-8.4787 7.58806,-12.00779 2.67455,-4.19793 5.68918,-11.37769 8.71872,-20.76484 8.34865,-25.86864 7.87456,-13.38446 7.51336,-197.84829 -0.35577,-181.69686 0.10815,-169.14098 -7.03875,-190.5 -5.7905,-17.30531 -6.79886,-19.8342 -9.1334,-22.9059 -1.29336,-1.70176 -3.15844,-4.6691 -4.14461,-6.5941 -5.85923,-11.43711 -27.86299,-34.56997 -40.73438,-42.82461 -3.15205,-2.02146 -8.50352,-5.43904 -11.89214,-7.59461 -10.95133,-6.96636 -32.73531,-13.63333 -52.23204,-15.98558 -4.13378,-0.49874 -4.76604,-0.35348 -4.25527,0.97758 0.32996,0.85984 10.21791,17.39522 21.97324,36.74528 11.75533,19.35007 27.67576,45.56125 35.37873,58.24708 l 14.0054,23.06513 -18.62346,10.32349 c -36.82278,20.41188 -61.19036,36.94887 -72.91763,49.48536 -3.41321,3.64873 -6.20583,7.49423 -6.20583,8.54555 0,3.01653 8.86667,12.83206 18.98381,21.01533 20.72575,16.76408 30.0146,24.63126 39.94903,33.83476 21.86946,20.26042 43.93796,46.86405 56.35981,67.9419 3.331,5.65216 6.31534,9.86123 6.63186,9.35349 1.02349,-1.64182 9.19407,-3.28591 13.07303,-2.63057 7.00809,1.18401 9.731,5.70125 8.69736,14.42871 -0.571,4.82116 -6.33358,19.07171 -7.71216,19.07171 -1.42842,0 -1.83874,-4.21812 -1.2677,-13.03216 0.66525,-10.26824 -0.48568,-14.21598 -4.64709,-15.93969 -1.51825,-0.62889 -3.93945,-0.84752 -5.38042,-0.48586 l -2.61995,0.65756 2.59297,5.11699 c 8.24843,16.27749 16.82321,43.39852 19.23405,60.83506 4.75507,34.3913 0.17551,69.04353 -13.19568,99.8481 -10.81647,24.91897 -26.13276,47.13294 -47.05765,68.25 -5.3137,5.3625 -9.35766,9.75 -8.98658,9.75 0.37108,0 4.0421,-1.84814 8.15782,-4.10698 z m 53.85416,-75.55969 c -1.45666,-1.45665 -0.5322,-5.36898 1.89687,-8.02757 2.37679,-2.60138 2.45722,-2.62365 1.10412,-0.30576 -0.80267,1.375 -1.77327,3.5493 -2.15688,4.83178 -0.60599,2.02595 -0.39012,2.28827 1.64588,2 2.75244,-0.3897 6.41756,-6.65756 4.82452,-8.2506 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 564.49792,344.99664 c -0.42769,-0.69203 0.86527,-2.88519 3.13728,-5.32155 2.12564,-2.27941 3.97907,-4.34056 4.11874,-4.58035 0.13967,-0.23978 1.26467,0.51084 2.5,1.66804 2.60876,2.44375 6.90367,4.23722 10.1471,4.23722 2.85226,0 15.18896,-12.51825 16.16358,-16.40146 1.02937,-4.10133 -0.0577,-11.04407 -2.1784,-13.91216 C 595.47901,306.75452 589.82965,304 584.67286,304 c -2.50515,0 -4.83294,0.45 -5.17286,1 -1.05057,1.69986 -2.25538,1.11076 -2.88867,-1.41244 -0.89449,-3.56393 -9.02364,-10.22504 -14.94081,-12.24264 -3.51381,-1.19813 -8.32787,-1.77614 -15.02443,-1.80397 l -9.85391,-0.041 -4.86945,5.29078 c -2.7973,3.03934 -5.61898,7.40112 -6.63081,10.25 -0.96875,2.72757 -2.10573,4.95922 -2.52664,4.95922 -2.80534,0 2.57226,-11.24113 8.40442,-17.56828 14.62536,-15.86664 41.56671,-11.91058 47.81473,7.02111 l 1.08743,3.29494 3.67551,-1.87389 c 4.8407,-2.46793 14.35426,-2.46515 19.794,0.006 7.49537,3.40468 12.31198,11.7159 10.97372,18.93552 -3.13831,16.93047 -23.44539,28.46605 -38.32164,21.76888 l -4.25583,-1.91594 -3.35608,3.25285 c -2.29333,2.22278 -3.58647,2.88007 -4.08362,2.07567 z m 35.10204,-8.86111 c 5.37211,-3.94566 8.03527,-7.01826 9.85231,-11.36706 4.42933,-10.60087 -1.40772,-20.58953 -13.05228,-22.33574 -6.73084,-1.00935 -8.59743,-0.0967 -3.93659,1.92464 5.27905,2.2895 7.45498,4.34977 9.65587,9.14263 3.42105,7.45 1.93614,14.04715 -4.69973,20.87988 -5.34501,5.50358 -4.18937,6.43408 2.18042,1.75565 z m -29.72752,-44.79805 c -3.81725,-4.62404 -20.25152,-7.53236 -25.46396,-4.50627 -1.57914,0.91677 -1.02605,1.11322 3.20503,1.13838 6.46398,0.0384 14.79702,1.6 18.23551,3.41723 1.45804,0.77056 3.26858,1.44876 4.02342,1.5071 1.16326,0.0899 1.16326,-0.14732 0,-1.55644 z M 421,562.74005 c 23.13802,-11.22993 37.47602,-21.17147 44.6718,-30.97409 3.11789,-4.24741 3.39959,-5.12243 2.48954,-7.73299 -3.54582,-10.17154 -18.99893,-26.5132 -44.73304,-47.30517 -9.31056,-7.52251 -19.2908,-15.75417 -22.1783,-18.29258 l -5.25,-4.61529 -0.004,37.84004 c -0.004,38.68727 -0.94734,58.72174 -3.53458,75.07926 -0.80374,5.08158 -1.46135,9.44348 -1.46135,9.69311 0,0.57351 10.18012,-4.07279 30,-13.69229 z m -13.33333,-50.40672 c -1.45666,-1.45665 -0.5322,-5.36898 1.89687,-8.02757 2.37679,-2.60138 2.45722,-2.62365 1.10412,-0.30576 -0.80267,1.375 -1.77327,3.5493 -2.15688,4.83178 -0.60599,2.02595 -0.39012,2.28827 1.64588,2 2.75244,-0.3897 6.41756,-6.65756 4.82452,-8.2506 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 152.5,450.50634 c 32.45,-2.47067 59.3375,-4.49532 59.75,-4.49923 0.4125,-0.004 0.75,-22.22164 0.75,-49.37274 l 0,-49.36564 -6.92502,-0.49548 c -9.13997,-0.65396 -16.39711,-4.59533 -20.45714,-11.11031 -7.19058,-11.53847 -3.06895,-34.62412 8.40382,-47.07061 C 198.2329,284.02367 207.09232,279 210.93807,279 l 2.06193,0 0,-79.10841 0,-79.10841 2.25,0.51531 c 1.2375,0.28341 42.1625,4.93962 90.94444,10.34711 l 88.69444,9.83181 9.30556,-9.02664 C 409.3125,127.48612 416.425,120.84685 420,117.69683 l 6.5,-5.7273 -106,0.27358 -106,0.27358 -12,2.79045 c -13.25864,3.08314 -30.96964,9.76088 -40.08644,15.11417 -17.71944,10.40466 -35.691,26.9008 -45.50077,41.76526 -12.09205,18.32273 -12.83387,19.76644 -18.144881,35.31343 -6.250652,18.2976 -6.02461,13.54116 -6.451299,135.75 -0.214595,61.4625 -0.03612,111.74965 0.396609,111.74922 C 93.145948,454.9988 120.05,452.977 152.5,450.50634 z M 97.666667,392.33333 c -1.456658,-1.45665 -0.532199,-5.36898 1.896869,-8.02757 2.376794,-2.60138 2.457224,-2.62365 1.104124,-0.30576 -0.802675,1.375 -1.773271,3.5493 -2.156879,4.83178 -0.60599,2.02595 -0.390117,2.28827 1.645879,2 2.75244,-0.3897 6.41756,-6.65756 4.82452,-8.2506 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.845333,7.38795 z M 135.45042,243.5934 c -3.91395,-1.70481 -8.08971,-6.6746 -8.96796,-10.67325 -2.84658,-12.9604 9.67249,-34.72476 21.71036,-37.74338 2.58105,-0.64722 5.73105,-1.17426 7,-1.17119 7.9448,0.0192 17.00252,6.29241 18.81747,13.03264 2.84533,10.56672 -7.77887,29.26365 -20.20724,35.56158 -5.39021,2.73143 -13.37092,3.1635 -18.35263,0.9936 z m 16.48703,-1.92329 c 3.13097,-1.50304 9.7399,-14.29072 11.27989,-21.82558 2.79371,-13.66909 -6.40351,-23.29494 -19.01337,-19.89945 -4.68109,1.26048 -8.98242,5.7223 -12.86198,13.34184 -3.43759,6.7515 -4.38877,17.78815 -1.941,22.52161 3.69897,7.15303 14.17197,9.87699 22.53646,5.86158 z m 16.25659,-17.0545 c 4.00039,-7.92473 4.74268,-15.83054 1.90838,-20.32527 C 167.603,200.32668 161.31752,197 156.32795,197 l -3.75173,0 4.45777,2.25 c 8.62911,4.35542 11.52584,15.99358 6.96651,27.98927 -2.4064,6.33131 -2.40748,6.34338 -0.4189,4.69301 0.86988,-0.72194 2.94548,-4.01444 4.61244,-7.31667 z m 487.91012,220.80956 c 0.92393,-4.12857 0.91819,-5.95701 -0.0259,-8.23619 C 654.90443,434.35507 651.44361,432 648.45295,432 c -1.94829,0 -1.84295,0.55348 0.78073,4.1022 1.73412,2.34553 2.31992,4.72889 2.61926,10.65666 0.33704,6.67436 0.55412,7.40494 1.72461,5.8042 0.73647,-1.00718 1.87344,-4.21923 2.52661,-7.13789 z M 213,314.8835 l 0,-30.11649 -6.66151,0.42417 c -6.55378,0.41731 -6.73851,0.50792 -11.42286,5.60235 -10.90442,11.85905 -14.18999,35.7848 -6.21553,45.26191 4.21133,5.00488 12.5922,8.70778 20.0499,8.85861 L 213,345 213,314.8835 z M 213,283 c 0,-1.27369 -4.02911,-1.27369 -6,0 -1.11575,0.72105 -0.53938,0.9733 2.25,0.98469 C 211.3125,283.99311 213,283.55 213,283 z"
+       id="path3358"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#313935"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 c -33.42239,10.55813 -71.71912,10.89934 -106.75019,0.9511 C 154.13331,716.00825 131.37959,704.48342 120.5,696.29818 82.936695,668.03746 59.302147,626.79738 49.551692,572.5 45.558818,550.26488 44.894861,540.96355 44.297999,498.90139 l -0.561905,-39.59861 3.256953,-0.65139 C 48.784371,458.29313 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.494146,238.35 67.990761,234.5 c 4.276468,-33.15327 12.505987,-54.4036 31.058565,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.2564 5.60465,-3.437 2.81685,-2.0155 25.41273,-11.60854 32,-13.585544 1.65,-0.495206 9.075,-2.3559 16.5,-4.134875 L 212.5,87.5 l 124.77153,-0.276196 124.77154,-0.276197 5.22846,-3.326708 c 2.87566,-1.829689 13.36414,-7.812957 23.30774,-13.296151 l 18.07927,-9.969444 7.96272,13.072348 7.96273,13.072348 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.29464,8.88963 39.45466,35.11365 47.58114,49.59331 1.38905,2.475 3.96676,6.78272 5.72824,9.57271 2.97884,4.71814 5.66457,11.45995 11.52372,28.92729 2.15874,6.43564 4.68088,18.77142 6.64487,32.5 1.22598,8.56985 1.14148,327.3526 -0.0887,334.5 -0.56797,3.3 -1.64615,9.6 -2.39597,14 -2.42416,14.22523 -12.22343,40.42112 -17.92887,47.92831 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.52766,12.67374 -26.14564,33.45064 -44.11473,46.72078 -9.68797,7.15454 -34.03563,19.1506 -46,22.66413 -7.24815,2.12854 -29.57515,6.67439 -35.59058,7.24637 -5.77413,0.54903 -8.11409,1.4995 -18.88871,7.67243 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.7261,2.8721 -38.68028,17.57698 -39.36389,17.56504 -0.13607,-0.002 -3.87196,-7.76488 -8.30198,-17.25 z m 44.43937,-36.34345 c 31.51453,-16.24849 50.7838,-30.01562 72.61521,-51.88066 30.08563,-30.13199 45.7772,-60.83617 50.54226,-98.89763 1.67406,-13.37175 0.70367,-37.09386 -2.05039,-50.12394 -10.65784,-50.42452 -42.27047,-93.70766 -106.11184,-145.28539 -25.86925,-20.89989 -37.93766,-37.68451 -38.09066,-52.97607 -0.13282,-13.27529 14.76123,-31.3988 41.53732,-50.5438 9.95862,-7.12045 28.92543,-19.16911 37.45177,-23.79121 4.20675,-2.28046 6.15397,-3.90835 5.90118,-4.93343 C 565.28212,217.35813 502.42543,113.58181 500.28281,111 c -0.68466,-0.825 -1.85237,-2.34566 -2.59492,-3.37925 -1.28762,-1.79231 -1.77541,-1.6446 -10.54402,3.19286 -20.13507,11.10813 -43.37773,29.30117 -64.68387,50.63087 -12.31118,12.3248 -25.34456,27.07682 -26.55398,30.05552 -0.22331,0.55 -3.71815,5.95 -7.7663,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.39109,1.86244 -4.97028,16.89122 -6.42778,26.98981 -3.38112,23.42684 -0.38429,55.88983 6.55438,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 9.36864,21.83113 28.18419,47.90313 47.76655,66.18829 C 426.48506,437.19878 439.4704,448 440.56115,448 c 0.3951,0 1.21797,0.62265 1.82861,1.38366 0.61063,0.76102 6.51024,5.87854 13.11024,11.37228 33.9808,28.28509 50.12224,52.95954 46.7054,71.39572 -1.79748,9.69859 -5.84122,16.50513 -15.69246,26.41399 -10.4297,10.49071 -24.15818,19.93664 -42.83664,29.47392 -6.9589,3.55324 -12.65789,6.73984 -12.66442,7.08135 -0.0144,0.75307 40.79578,87.21928 47.96674,101.62908 2.80547,5.6375 5.36863,10.25 5.69591,10.25 0.32728,0 8.9719,-4.31899 19.21026,-9.59777 z M 230.22958,691.94228 C 238.62831,691.36054 249.325,689.95704 254,688.8234 299.53499,677.78164 336.92998,641.31607 353.44329,591.8517 362.9101,563.49458 364,551.71769 364,477.78162 l 0,-59.73064 -7.13885,-10.77549 c -17.50452,-26.42162 -28.31044,-55.74205 -31.95706,-86.71126 -1.6247,-13.79787 -0.63408,-40.04839 2.0591,-54.56423 4.35897,-23.49424 16.01095,-52.32273 30.43575,-75.30196 C 362.98519,181.79894 364,179.49394 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.80913,24.88867 -12.44424,42.49565 -24.88871,45.48103 -14.07768,3.37719 -21.20097,-2.29973 -26.98564,-21.50625 -3.84178,-12.75567 -5.26047,-25.74038 -5.81525,-53.22478 -0.52346,-25.93321 -0.55549,-26.24986 -2.65402,-26.23822 -1.89709,0.0105 -81.48268,6.19899 -100.792802,7.83751 -4.217754,0.35789 -7.952282,0.93524 -8.298952,1.28299 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.32831,0.8189 9.72958,0.89728 0.40128,0.0784 7.60128,-0.33347 16,-0.91522 z m 137.29157,-6.74054 c 8.28675,-7.59331 16.16287,-11.58628 22.98324,-11.65188 9.20868,-0.0886 13.05608,3.93525 12.34242,12.90836 L 402.48559,691 l 18.36419,0 c 14.29843,0 18.25056,-0.27675 17.85094,-1.25 -0.71381,-1.73844 -48.86745,-104.20422 -49.08453,-104.44661 -0.0969,-0.10814 -1.87313,5.51148 -3.9473,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.16837,0 18.16837,0 6.32779,-5.79826 z M 394,687.54705 c 0,-6.99429 -4.76632,-11.68281 -10.17628,-10.01019 -4.19586,1.29726 -10.25452,5.29188 -14.27667,9.41296 L 365.5941,691 l 14.20295,0 14.20295,0 0,-3.45295 z m 6.5691,-0.0637 C 401.7092,681.40611 397.88829,676 392.45295,676 c -1.92823,0 -1.83882,0.55906 0.62162,3.88699 1.14101,1.5433 2.32526,4.67508 2.63167,6.9595 0.42233,3.1487 0.99812,4.15351 2.38012,4.15351 1.29336,0 2.01469,-1.02173 2.48274,-3.51667 z m 193.72074,-11.62811 c 9.05748,-4.61414 19.50337,-11.41041 25.71016,-16.72746 10.24821,-8.77912 21.11322,-20.48283 25.85956,-27.8557 12.55677,-19.50547 13.09442,-20.56529 17.55475,-34.60402 8.23319,-25.91371 7.76653,-13.45816 7.40583,-197.66804 -0.30266,-154.57264 -0.42135,-163.99141 -2.17371,-172.5 -1.65869,-8.05376 -4.20236,-16.50772 -9.63414,-32.01925 -5.77946,-16.50442 -31.44114,-46.88853 -49.24329,-58.30536 -3.15205,-2.02146 -8.45968,-5.40995 -11.79474,-7.52996 -11.25725,-7.15597 -32.39273,-13.63799 -52.32944,-16.04888 -4.06408,-0.49146 -4.76089,-0.34141 -4.2765,0.92089 0.47965,1.24995 17.10189,28.77193 66.17704,109.57147 l 5.21664,8.58891 -18.01043,9.90343 c -19.73911,10.85399 -41.36618,24.10564 -54.05613,33.12204 C 530.20721,282.15534 515,296.97708 515,299.74741 c 0,3.36003 7.17518,11.4692 18.05574,20.40607 5.589,4.59058 14.72537,12.08561 20.30304,16.65561 31.71627,25.98634 60.4448,58.0953 76.91689,85.96757 3.34034,5.65216 6.33232,9.86123 6.64884,9.35349 1.02349,-1.64182 9.19407,-3.28591 13.07303,-2.63057 7.00809,1.18401 9.731,5.70125 8.69736,14.42871 -0.571,4.82116 -6.33358,19.07171 -7.71216,19.07171 -1.42842,0 -1.83874,-4.21812 -1.2677,-13.03216 0.66525,-10.26824 -0.48568,-14.21598 -4.64709,-15.93969 -1.51825,-0.62889 -3.9084,-0.85531 -5.31143,-0.50318 l -2.55097,0.64026 4.01516,8.66738 c 18.77221,40.52298 23.98833,80.81652 15.72086,121.44083 -7.66013,37.64003 -27.27351,72.5729 -58.45308,104.10927 -5.22967,5.28951 -9.26106,9.61729 -8.95865,9.61729 0.30241,0 2.44441,-0.96515 4.76,-2.14478 z m 57.37683,-77.52189 c -1.45666,-1.45665 -0.5322,-5.36898 1.89687,-8.02757 2.37679,-2.60138 2.45722,-2.62365 1.10412,-0.30576 -0.80267,1.375 -1.77327,3.5493 -2.15688,4.83178 -0.60599,2.02595 -0.39012,2.28827 1.64588,2 2.75244,-0.3897 6.41756,-6.65756 4.82452,-8.2506 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 564.49792,344.99664 c -0.42769,-0.69203 0.86527,-2.88519 3.13728,-5.32155 2.12564,-2.27941 3.97907,-4.34056 4.11874,-4.58035 0.13967,-0.23978 1.26467,0.51084 2.5,1.66804 2.60876,2.44375 6.90367,4.23722 10.1471,4.23722 2.85226,0 15.18896,-12.51825 16.16358,-16.40146 1.02937,-4.10133 -0.0577,-11.04407 -2.1784,-13.91216 C 595.47901,306.75452 589.82965,304 584.67286,304 c -2.50515,0 -4.83294,0.45 -5.17286,1 -1.05057,1.69986 -2.25538,1.11076 -2.88867,-1.41244 -0.89449,-3.56393 -9.02364,-10.22504 -14.94081,-12.24264 -3.51381,-1.19813 -8.32787,-1.77614 -15.02443,-1.80397 l -9.85391,-0.041 -4.86945,5.29078 c -2.7973,3.03934 -5.61898,7.40112 -6.63081,10.25 -0.96875,2.72757 -2.10573,4.95922 -2.52664,4.95922 -2.80534,0 2.57226,-11.24113 8.40442,-17.56828 14.62536,-15.86664 41.56671,-11.91058 47.81473,7.02111 l 1.08743,3.29494 3.67551,-1.87389 c 4.8407,-2.46793 14.35426,-2.46515 19.794,0.006 7.49537,3.40468 12.31198,11.7159 10.97372,18.93552 -3.13831,16.93047 -23.44539,28.46605 -38.32164,21.76888 l -4.25583,-1.91594 -3.35608,3.25285 c -2.29333,2.22278 -3.58647,2.88007 -4.08362,2.07567 z m 35.10204,-8.86111 c 5.37211,-3.94566 8.03527,-7.01826 9.85231,-11.36706 4.42933,-10.60087 -1.40772,-20.58953 -13.05228,-22.33574 -6.73084,-1.00935 -8.59743,-0.0967 -3.93659,1.92464 5.27905,2.2895 7.45498,4.34977 9.65587,9.14263 3.42105,7.45 1.93614,14.04715 -4.69973,20.87988 -5.34501,5.50358 -4.18937,6.43408 2.18042,1.75565 z m -29.72752,-44.79805 c -3.81725,-4.62404 -20.25152,-7.53236 -25.46396,-4.50627 -1.57914,0.91677 -1.02605,1.11322 3.20503,1.13838 6.46398,0.0384 14.79702,1.6 18.23551,3.41723 1.45804,0.77056 3.26858,1.44876 4.02342,1.5071 1.16326,0.0899 1.16326,-0.14732 0,-1.55644 z M 420,563.2398 c 24.18282,-11.76002 38.38492,-21.54713 45.6718,-31.47384 3.11789,-4.24741 3.39959,-5.12243 2.48954,-7.73299 -3.55775,-10.20575 -18.79588,-26.29469 -45.18858,-47.71163 -9.61002,-7.79826 -19.61026,-16.04577 -22.22276,-18.3278 l -4.75,-4.14915 -0.004,37.8278 c -0.004,38.67582 -0.94751,58.71058 -3.53458,75.06704 -0.80374,5.08158 -1.46135,9.45026 -1.46135,9.70818 0,0.62058 8.89141,-3.42888 29,-13.20761 z m -12.33333,-50.90647 c -1.45666,-1.45665 -0.5322,-5.36898 1.89687,-8.02757 2.37679,-2.60138 2.45722,-2.62365 1.10412,-0.30576 -0.80267,1.375 -1.77327,3.5493 -2.15688,4.83178 -0.60599,2.02595 -0.39012,2.28827 1.64588,2 2.75244,-0.3897 6.41756,-6.65756 4.82452,-8.2506 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 152.88914,450.5 C 185.53492,448.025 212.41496,446 212.62256,446 212.83015,446 213,423.78547 213,396.63437 l 0,-49.36564 -6.92502,-0.49548 c -9.13997,-0.65396 -16.39711,-4.59533 -20.45714,-11.11031 -7.19058,-11.53847 -3.06895,-34.62412 8.40382,-47.07061 C 198.2329,284.02367 207.09232,279 210.93807,279 l 2.06193,0 0,-79.10841 0,-79.10841 2.25,0.52903 c 1.2375,0.29096 42.16654,4.9432 90.95342,10.33831 l 88.70341,9.80929 9.29659,-9.01784 C 409.31654,127.48216 416.425,120.84685 420,117.69683 l 6.5,-5.7273 -106,0.27358 -106,0.27358 -12,2.79045 c -13.25864,3.08314 -30.96964,9.76088 -40.08644,15.11417 C 144.54553,140.91322 126.88533,157.11153 117,172.07558 104.79957,190.54415 104.08773,191.92722 98.767909,207.5 92.517257,225.7976 92.743299,221.04116 92.31661,343.25 92.102015,404.7125 92.287951,455 92.729801,455 c 0.44185,0 27.513549,-2.025 60.159339,-4.5 z M 97.666667,392.33333 c -1.456658,-1.45665 -0.532199,-5.36898 1.896869,-8.02757 2.376794,-2.60138 2.457224,-2.62365 1.104124,-0.30576 -0.802675,1.375 -1.773271,3.5493 -2.156879,4.83178 -0.60599,2.02595 -0.390117,2.28827 1.645879,2 2.75244,-0.3897 6.41756,-6.65756 4.82452,-8.2506 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.845333,7.38795 z M 135.45042,243.5934 c -3.91395,-1.70481 -8.08971,-6.6746 -8.96796,-10.67325 -2.84658,-12.9604 9.67249,-34.72476 21.71036,-37.74338 2.58105,-0.64722 5.73105,-1.17426 7,-1.17119 7.9448,0.0192 17.00252,6.29241 18.81747,13.03264 2.84533,10.56672 -7.77887,29.26365 -20.20724,35.56158 -5.39021,2.73143 -13.37092,3.1635 -18.35263,0.9936 z m 16.48703,-1.92329 c 3.13097,-1.50304 9.7399,-14.29072 11.27989,-21.82558 2.79371,-13.66909 -6.40351,-23.29494 -19.01337,-19.89945 -4.68109,1.26048 -8.98242,5.7223 -12.86198,13.34184 -3.43759,6.7515 -4.38877,17.78815 -1.941,22.52161 3.69897,7.15303 14.17197,9.87699 22.53646,5.86158 z m 16.25659,-17.0545 c 4.00039,-7.92473 4.74268,-15.83054 1.90838,-20.32527 C 167.603,200.32668 161.31752,197 156.32795,197 l -3.75173,0 4.45777,2.25 c 8.62911,4.35542 11.52584,15.99358 6.96651,27.98927 -2.4064,6.33131 -2.40748,6.34338 -0.4189,4.69301 0.86988,-0.72194 2.94548,-4.01444 4.61244,-7.31667 z m 487.91012,220.80956 c 0.92393,-4.12857 0.91819,-5.95701 -0.0259,-8.23619 C 654.90443,434.35507 651.44361,432 648.45295,432 c -1.94829,0 -1.84295,0.55348 0.78073,4.1022 1.73412,2.34553 2.31992,4.72889 2.61926,10.65666 0.33704,6.67436 0.55412,7.40494 1.72461,5.8042 0.73647,-1.00718 1.87344,-4.21923 2.52661,-7.13789 z M 213,314.8835 l 0,-30.11649 -6.66151,0.42417 c -6.55378,0.41731 -6.73851,0.50792 -11.42286,5.60235 -10.90442,11.85905 -14.18999,35.7848 -6.21553,45.26191 4.21133,5.00488 12.5922,8.70778 20.0499,8.85861 L 213,345 213,314.8835 z M 213,283 c 0,-1.27369 -4.02911,-1.27369 -6,0 -1.11575,0.72105 -0.53938,0.9733 2.25,0.98469 C 211.3125,283.99311 213,283.55 213,283 z"
+       id="path3356"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#2f3836"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 c -33.42239,10.55813 -71.71912,10.89934 -106.75019,0.9511 C 154.13331,716.00825 131.37959,704.48342 120.5,696.29818 82.936695,668.03746 59.302147,626.79738 49.551692,572.5 45.558818,550.26488 44.894861,540.96355 44.297999,498.90139 l -0.561905,-39.59861 3.256953,-0.65139 C 48.784371,458.29313 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.494146,238.35 67.990761,234.5 c 4.276468,-33.15327 12.505987,-54.4036 31.058565,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.2564 5.60465,-3.437 2.81685,-2.0155 25.41273,-11.60854 32,-13.585544 1.65,-0.495206 9.075,-2.3559 16.5,-4.134875 L 212.5,87.5 l 124.77153,-0.276196 124.77154,-0.276197 5.22846,-3.326708 c 2.87566,-1.829689 13.36414,-7.812957 23.30774,-13.296151 l 18.07927,-9.969444 7.96272,13.072348 7.96273,13.072348 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.29464,8.88963 39.45466,35.11365 47.58114,49.59331 1.38905,2.475 3.96676,6.78272 5.72824,9.57271 2.97884,4.71814 5.66457,11.45995 11.52372,28.92729 2.15874,6.43564 4.68088,18.77142 6.64487,32.5 1.22598,8.56985 1.14148,327.3526 -0.0887,334.5 -0.56797,3.3 -1.64615,9.6 -2.39597,14 -2.42416,14.22523 -12.22343,40.42112 -17.92887,47.92831 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.52766,12.67374 -26.14564,33.45064 -44.11473,46.72078 -9.68797,7.15454 -34.03563,19.1506 -46,22.66413 -7.24815,2.12854 -29.57515,6.67439 -35.59058,7.24637 -5.77413,0.54903 -8.11409,1.4995 -18.88871,7.67243 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.7261,2.8721 -38.68028,17.57698 -39.36389,17.56504 -0.13607,-0.002 -3.87196,-7.76488 -8.30198,-17.25 z m 44.43937,-36.34345 c 31.51453,-16.24849 50.7838,-30.01562 72.61521,-51.88066 30.08563,-30.13199 45.7772,-60.83617 50.54226,-98.89763 1.67406,-13.37175 0.70367,-37.09386 -2.05039,-50.12394 -10.65784,-50.42452 -42.27047,-93.70766 -106.11184,-145.28539 -25.86925,-20.89989 -37.93766,-37.68451 -38.09066,-52.97607 -0.13282,-13.27529 14.76123,-31.3988 41.53732,-50.5438 9.95862,-7.12045 28.92543,-19.16911 37.45177,-23.79121 4.20675,-2.28046 6.15397,-3.90835 5.90118,-4.93343 C 565.28212,217.35813 502.42543,113.58181 500.28281,111 c -0.68466,-0.825 -1.85237,-2.34566 -2.59492,-3.37925 -1.28762,-1.79231 -1.77541,-1.6446 -10.54402,3.19286 -20.13507,11.10813 -43.37773,29.30117 -64.68387,50.63087 -12.31118,12.3248 -25.34456,27.07682 -26.55398,30.05552 -0.22331,0.55 -3.71815,5.95 -7.7663,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.39109,1.86244 -4.97028,16.89122 -6.42778,26.98981 -3.38112,23.42684 -0.38429,55.88983 6.55438,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 9.36864,21.83113 28.18419,47.90313 47.76655,66.18829 C 426.48506,437.19878 439.4704,448 440.56115,448 c 0.3951,0 1.21797,0.62265 1.82861,1.38366 0.61063,0.76102 6.51024,5.87854 13.11024,11.37228 33.9808,28.28509 50.12224,52.95954 46.7054,71.39572 -1.79748,9.69859 -5.84122,16.50513 -15.69246,26.41399 -10.4297,10.49071 -24.15818,19.93664 -42.83664,29.47392 -6.9589,3.55324 -12.65789,6.73984 -12.66442,7.08135 -0.0144,0.75307 40.79578,87.21928 47.96674,101.62908 2.80547,5.6375 5.36863,10.25 5.69591,10.25 0.32728,0 8.9719,-4.31899 19.21026,-9.59777 z M 230.22958,691.94228 C 238.62831,691.36054 249.325,689.95704 254,688.8234 299.53499,677.78164 336.92998,641.31607 353.44329,591.8517 362.9101,563.49458 364,551.71769 364,477.78162 l 0,-59.73064 -7.13885,-10.77549 c -17.50452,-26.42162 -28.31044,-55.74205 -31.95706,-86.71126 -1.6247,-13.79787 -0.63408,-40.04839 2.0591,-54.56423 4.35897,-23.49424 16.01095,-52.32273 30.43575,-75.30196 C 362.98519,181.79894 364,179.49394 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.80913,24.88867 -12.44424,42.49565 -24.88871,45.48103 -14.07768,3.37719 -21.20097,-2.29973 -26.98564,-21.50625 -3.84178,-12.75567 -5.26047,-25.74038 -5.81525,-53.22478 -0.52346,-25.93321 -0.55549,-26.24986 -2.65402,-26.23822 -1.89709,0.0105 -81.48268,6.19899 -100.792802,7.83751 -4.217754,0.35789 -7.952282,0.93524 -8.298952,1.28299 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.32831,0.8189 9.72958,0.89728 0.40128,0.0784 7.60128,-0.33347 16,-0.91522 z m 137.2974,-6.74588 c 8.09782,-7.42019 16.25812,-11.53316 23.06749,-11.62654 9.10182,-0.12481 12.96419,3.93805 12.25234,12.88836 L 402.48559,691 l 18.36419,0 c 14.29843,0 18.25056,-0.27675 17.85094,-1.25 -0.71381,-1.73844 -48.86745,-104.20422 -49.08453,-104.44661 -0.0969,-0.10814 -1.87313,5.51148 -3.9473,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.16837,0 18.16837,0 6.33362,-5.8036 z M 394,687.54705 c 0,-6.99429 -4.76632,-11.68281 -10.17628,-10.01019 -4.19586,1.29726 -10.25452,5.29188 -14.27667,9.41296 L 365.5941,691 l 14.20295,0 14.20295,0 0,-3.45295 z m 6.5691,-0.0637 C 401.7092,681.40611 397.88829,676 392.45295,676 c -1.92823,0 -1.83882,0.55906 0.62162,3.88699 1.14101,1.5433 2.32526,4.67508 2.63167,6.9595 0.42233,3.1487 0.99812,4.15351 2.38012,4.15351 1.29336,0 2.01469,-1.02173 2.48274,-3.51667 z m 193.72074,-11.62811 c 9.05748,-4.61414 19.50337,-11.41041 25.71016,-16.72746 10.24821,-8.77912 21.11322,-20.48283 25.85956,-27.8557 12.55677,-19.50547 13.09442,-20.56529 17.55475,-34.60402 8.23319,-25.91371 7.76653,-13.45816 7.40583,-197.66804 -0.30266,-154.57264 -0.42135,-163.99141 -2.17371,-172.5 -1.65869,-8.05376 -4.20236,-16.50772 -9.63414,-32.01925 -5.77946,-16.50442 -31.44114,-46.88853 -49.24329,-58.30536 -3.15205,-2.02146 -8.45968,-5.40995 -11.79474,-7.52996 -11.25725,-7.15597 -32.39273,-13.63799 -52.32944,-16.04888 -4.06408,-0.49146 -4.76089,-0.34141 -4.2765,0.92089 0.47965,1.24995 17.10189,28.77193 66.17704,109.57147 l 5.21664,8.58891 -18.01043,9.90343 c -19.73911,10.85399 -41.36618,24.10564 -54.05613,33.12204 C 530.20721,282.15534 515,296.97708 515,299.74741 c 0,3.36003 7.17518,11.4692 18.05574,20.40607 5.589,4.59058 14.72537,12.08561 20.30304,16.65561 31.67578,25.95317 60.44568,58.09746 76.8668,85.88244 l 6.02327,10.19152 2.5046,-1.64107 c 3.09866,-2.03032 11.98531,-2.24968 15.48056,-0.38212 5.30435,2.83418 6.1642,10.19714 2.40141,20.56349 -1.30051,3.58289 -3.17357,7.74902 -4.16234,9.25808 -1.68203,2.56709 -1.84569,2.61739 -2.54217,0.78115 -0.40941,-1.07942 -0.49531,-6.09742 -0.19087,-11.1511 0.63959,-10.61705 -0.48906,-14.55067 -4.67209,-16.28333 -1.51825,-0.62889 -3.9084,-0.85531 -5.31143,-0.50318 l -2.55097,0.64026 4.01516,8.66738 c 18.77221,40.52298 23.98833,80.81652 15.72086,121.44083 -7.66013,37.64003 -27.27351,72.5729 -58.45308,104.10927 -5.22967,5.28951 -9.26106,9.61729 -8.95865,9.61729 0.30241,0 2.44441,-0.96515 4.76,-2.14478 z m 57.37683,-77.52189 c -1.45,-1.44999 -0.53699,-5.36512 1.87203,-8.02757 l 2.5387,-2.80576 -2.03496,3.5 c -2.66711,4.58725 -2.60889,6.21955 0.20756,5.81955 2.66492,-0.37848 6.28589,-6.68366 4.73118,-8.23837 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 564.49792,344.99664 c -0.42769,-0.69203 0.86527,-2.88519 3.13728,-5.32155 2.12564,-2.27941 3.97907,-4.34056 4.11874,-4.58035 0.13967,-0.23978 1.26467,0.51084 2.5,1.66804 2.59253,2.42855 6.89949,4.23722 10.09005,4.23722 2.3531,0 13.42884,-10.54445 15.66655,-14.91504 1.82372,-3.562 1.36335,-10.74392 -0.92615,-14.44841 C 596.34766,307.20843 590.29279,304 584.67286,304 c -2.50515,0 -4.83294,0.45 -5.17286,1 -1.06535,1.72377 -1.9441,1.06904 -3.72558,-2.7758 -2.14074,-4.62023 -9.48212,-9.7209 -16.27442,-11.30721 -7.71242,-1.8012 -9.76704,-2.97797 -4,-2.29098 2.75,0.3276 6.9697,1.44576 9.37712,2.48481 5.39263,2.32748 6.78163,2.39051 4.99532,0.22666 -2.62446,-3.17916 -9.99499,-5.6316 -16.92512,-5.6316 -7.31175,0 -13.37083,2.09362 -6.94732,2.40054 2.1889,0.10458 1.07757,0.44102 -2.96671,0.89811 -6.15904,0.69611 -6.69301,0.977 -11.22336,5.90396 -2.69521,2.93116 -5.51999,7.32229 -6.51801,10.13229 -0.96875,2.72757 -2.10573,4.95922 -2.52664,4.95922 -2.80534,0 2.57226,-11.24113 8.40442,-17.56828 14.66142,-15.90576 41.58195,-11.86442 47.86921,7.18618 l 1.08439,3.28573 3.95891,-2.0635 c 6.00802,-3.13155 16.3077,-2.33852 22.12469,1.7035 5.90002,4.09972 9.1055,10.4861 8.24806,16.4329 -1.30513,9.05182 -7.31686,16.85195 -16.73839,21.71782 -6.56522,3.3907 -15.17699,3.74669 -21.52312,0.88971 l -4.25583,-1.91594 -3.35608,3.25285 c -2.29333,2.22278 -3.58647,2.88007 -4.08362,2.07567 z m 33.52957,-7.64776 C 606.5893,331.63136 611,324.73804 611,317.07463 c 0,-4.15221 -0.51912,-5.59629 -3.0466,-8.47492 -3.66583,-4.17515 -10.18227,-6.86279 -15.53242,-6.4062 l -3.92098,0.33462 3.9634,1.77407 c 5.31152,2.37751 7.46669,4.43044 9.65587,9.1978 3.38773,7.37744 1.65649,14.58693 -5.02769,20.93709 -4.57393,4.34537 -3.97963,6.19435 0.93591,2.91179 z M 420,563.2398 c 24.18282,-11.76002 38.38492,-21.54713 45.6718,-31.47384 3.11789,-4.24741 3.39959,-5.12243 2.48954,-7.73299 -3.55775,-10.20575 -18.79588,-26.29469 -45.18858,-47.71163 -9.61002,-7.79826 -19.61026,-16.04577 -22.22276,-18.3278 l -4.75,-4.14915 -0.004,37.8278 c -0.004,38.67582 -0.94751,58.71058 -3.53458,75.06704 -0.80374,5.08158 -1.46135,9.45026 -1.46135,9.70818 0,0.62058 8.89141,-3.42888 29,-13.20761 z m -12.33333,-50.90647 c -1.45,-1.44999 -0.53699,-5.36512 1.87203,-8.02757 l 2.5387,-2.80576 -2.03496,3.5 c -2.66711,4.58725 -2.60889,6.21955 0.20756,5.81955 2.66492,-0.37848 6.28589,-6.68366 4.73118,-8.23837 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 152.88914,450.5 C 185.53492,448.025 212.41496,446 212.62256,446 212.83015,446 213,423.77742 213,396.6165 l 0,-49.38351 -6.40106,-0.40759 c -9.11168,-0.58019 -17.06512,-4.79162 -20.96654,-11.10203 -7.23695,-11.70548 -3.08991,-34.67761 8.5373,-47.29165 C 198.25612,283.99849 207.14277,279 210.93807,279 l 2.06193,0 0,-79.10841 0,-79.10841 2.25,0.52903 c 1.2375,0.29096 42.16654,4.9432 90.95342,10.33831 l 88.70341,9.80929 9.29659,-9.01784 C 409.31654,127.48216 416.425,120.84685 420,117.69683 l 6.5,-5.7273 -106,0.27358 -106,0.27358 -12,2.79045 c -13.25864,3.08314 -30.96964,9.76088 -40.08644,15.11417 C 144.54553,140.91322 126.88533,157.11153 117,172.07558 104.79957,190.54415 104.08773,191.92722 98.767909,207.5 92.517257,225.7976 92.743299,221.04116 92.31661,343.25 92.102015,404.7125 92.287951,455 92.729801,455 c 0.44185,0 27.513549,-2.025 60.159339,-4.5 z M 97.666667,392.33333 c -1.449998,-1.44999 -0.536988,-5.36512 1.872032,-8.02757 L 102.0774,381.5 100.04244,385 c -2.667109,4.58725 -2.60889,6.21955 0.20756,5.81955 2.66492,-0.37848 6.28589,-6.68366 4.73118,-8.23837 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.845333,7.38795 z M 135.45042,243.5934 c -4.09866,-1.78526 -8.22499,-6.87483 -9.02317,-11.12951 -1.66213,-8.85988 3.40684,-21.90043 11.98193,-30.825 4.12159,-4.28957 6.1305,-5.56888 10.32506,-6.57514 5.26378,-1.26276 11.89696,-0.7695 15.76576,1.17237 3.93752,1.97637 8.55602,7.25822 9.53914,10.90923 2.85986,10.62072 -8.18178,29.70083 -20.53914,35.49193 -5.66528,2.65495 -13.22944,3.05564 -18.04958,0.95612 z m 16.44488,-1.88845 c 3.17562,-1.54318 9.773,-14.28131 11.32204,-21.86042 2.67267,-13.07683 -5.24351,-22.3675 -17.31994,-20.3272 -5.59737,0.94567 -10.16892,5.30307 -14.36646,13.69346 -2.94088,5.87846 -3.53094,8.13 -3.53094,13.47323 0,6.42562 1.45728,10.79074 4.42459,13.25339 4.67101,3.8766 13.48419,4.67665 19.47071,1.76754 z m 16.76183,-18.17674 c 3.93572,-8.20823 4.37397,-14.32488 1.37836,-19.23787 -2.83336,-4.64691 -9.80062,-7.87024 -15.99738,-7.40103 -0.80404,0.0609 0.54411,1.12319 2.99588,2.36069 8.60915,4.34535 11.55916,16.0971 6.96601,27.75 -2.42705,6.15749 -2.46001,6.62587 -0.34287,4.87244 0.91143,-0.75484 3.16143,-4.50974 5,-8.34423 z m 486.85636,224.06004 c 2.43483,-8.99503 0.84521,-13.70717 -5.12999,-15.20684 -3.56388,-0.89448 -3.87745,0.0315 -1.2254,3.61856 1.87694,2.53869 2.40462,4.70777 2.69366,11.07236 0.19769,4.35335 0.71054,7.69818 1.13967,7.43297 0.42912,-0.26522 1.56405,-3.37789 2.52206,-6.91705 z M 213,313.5 l 0,-31.5 -2.25,0.0153 c -1.2375,0.008 -2.925,0.45153 -3.75,0.98469 -1.13795,0.7354 -0.65521,1.0061 2,1.12151 2.13055,0.0926 0.96977,0.43811 -2.96671,0.88302 -6.14794,0.69486 -6.69869,0.98318 -11.17286,5.84904 -9.77652,10.6324 -13.89556,32.98206 -7.89661,42.84654 3.80835,6.26233 13.28465,11.15666 21.78618,11.25215 L 213,345 l 0,-31.5 z"
+       id="path3354"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#473b18"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 c -33.42239,10.55813 -71.71912,10.89934 -106.75019,0.9511 C 154.13331,716.00825 131.37959,704.48342 120.5,696.29818 82.936695,668.03746 59.302147,626.79738 49.551692,572.5 45.558818,550.26488 44.894861,540.96355 44.297999,498.90139 l -0.561905,-39.59861 3.256953,-0.65139 C 48.784371,458.29313 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.494146,238.35 67.990761,234.5 c 4.276468,-33.15327 12.505987,-54.4036 31.058565,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.2564 5.60465,-3.437 2.81685,-2.0155 25.41273,-11.60854 32,-13.585544 1.65,-0.495206 9.075,-2.3559 16.5,-4.134875 L 212.5,87.5 l 124.77153,-0.276196 124.77154,-0.276197 5.22846,-3.326708 c 2.87566,-1.829689 13.36414,-7.812957 23.30774,-13.296151 l 18.07927,-9.969444 7.96272,13.072348 7.96273,13.072348 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.29464,8.88963 39.45466,35.11365 47.58114,49.59331 1.38905,2.475 3.96676,6.78272 5.72824,9.57271 2.97884,4.71814 5.66457,11.45995 11.52372,28.92729 2.15874,6.43564 4.68088,18.77142 6.64487,32.5 1.22598,8.56985 1.14148,327.3526 -0.0887,334.5 -0.56797,3.3 -1.64615,9.6 -2.39597,14 -2.42416,14.22523 -12.22343,40.42112 -17.92887,47.92831 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.52766,12.67374 -26.14564,33.45064 -44.11473,46.72078 -9.68797,7.15454 -34.03563,19.1506 -46,22.66413 -7.24815,2.12854 -29.57515,6.67439 -35.59058,7.24637 -5.77413,0.54903 -8.11409,1.4995 -18.88871,7.67243 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.7261,2.8721 -38.68028,17.57698 -39.36389,17.56504 -0.13607,-0.002 -3.87196,-7.76488 -8.30198,-17.25 z m 44.43937,-36.34345 c 31.51453,-16.24849 50.7838,-30.01562 72.61521,-51.88066 30.08563,-30.13199 45.7772,-60.83617 50.54226,-98.89763 1.67406,-13.37175 0.70367,-37.09386 -2.05039,-50.12394 -10.65784,-50.42452 -42.27047,-93.70766 -106.11184,-145.28539 -25.86925,-20.89989 -37.93766,-37.68451 -38.09066,-52.97607 -0.13282,-13.27529 14.76123,-31.3988 41.53732,-50.5438 9.95862,-7.12045 28.92543,-19.16911 37.45177,-23.79121 4.20675,-2.28046 6.15397,-3.90835 5.90118,-4.93343 C 565.28212,217.35813 502.42543,113.58181 500.28281,111 c -0.68466,-0.825 -1.85237,-2.34566 -2.59492,-3.37925 -1.28762,-1.79231 -1.77541,-1.6446 -10.54402,3.19286 -20.13507,11.10813 -43.37773,29.30117 -64.68387,50.63087 -12.31118,12.3248 -25.34456,27.07682 -26.55398,30.05552 -0.22331,0.55 -3.71815,5.95 -7.7663,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.39109,1.86244 -4.97028,16.89122 -6.42778,26.98981 -3.38112,23.42684 -0.38429,55.88983 6.55438,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 9.36488,21.82237 28.15644,47.86451 47.76655,66.19689 4.35255,4.06895 15.77864,13.74395 25.39131,21.5 30.01399,24.21698 46.146,41.19052 53.99127,56.80773 9.95612,19.81918 7.13771,33.66329 -10.45592,51.35983 -10.4297,10.49071 -24.15818,19.93664 -42.83664,29.47392 -6.9589,3.55324 -12.65789,6.73984 -12.66442,7.08135 -0.0144,0.75307 40.79578,87.21928 47.96674,101.62908 2.80547,5.6375 5.36863,10.25 5.69591,10.25 0.32728,0 8.9719,-4.31899 19.21026,-9.59777 z M 230.22958,691.94228 C 238.62831,691.36054 249.325,689.95704 254,688.8234 299.53499,677.78164 336.92998,641.31607 353.44329,591.8517 362.9101,563.49458 364,551.71769 364,477.78162 l 0,-59.73064 -7.13885,-10.77549 c -17.50452,-26.42162 -28.31044,-55.74205 -31.95706,-86.71126 -1.6247,-13.79787 -0.63408,-40.04839 2.0591,-54.56423 4.35897,-23.49424 16.01095,-52.32273 30.43575,-75.30196 C 362.98519,181.79894 364,179.49394 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.80913,24.88867 -12.44424,42.49565 -24.88871,45.48103 -14.07768,3.37719 -21.20097,-2.29973 -26.98564,-21.50625 -3.84178,-12.75567 -5.26047,-25.74038 -5.81525,-53.22478 -0.52346,-25.93321 -0.55549,-26.24986 -2.65402,-26.23822 -1.89709,0.0105 -81.48268,6.19899 -100.792802,7.83751 -4.217754,0.35789 -7.952282,0.93524 -8.298952,1.28299 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.32831,0.8189 9.72958,0.89728 0.40128,0.0784 7.60128,-0.33347 16,-0.91522 z m 137.085,-6.48884 c 8.2789,-7.49197 17.31456,-11.88201 24.45579,-11.88201 4.93007,0 5.74727,0.32429 8.45569,3.35554 2.71479,3.03838 2.95617,3.86204 2.55378,8.71429 L 402.33545,691 l 18.43927,0 c 14.35847,0 18.32567,-0.27664 17.926,-1.25 -0.71381,-1.73844 -48.86745,-104.20422 -49.08453,-104.44661 -0.0969,-0.10814 -1.87313,5.51148 -3.9473,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.16441,0 18.1644,0 6.12915,-5.54656 z M 394,687.54705 c 0,-6.99429 -4.76632,-11.68281 -10.17628,-10.01019 -4.19586,1.29726 -10.25452,5.29188 -14.27667,9.41296 L 365.5941,691 l 14.20295,0 14.20295,0 0,-3.45295 z m 6.5691,-0.0637 C 401.7092,681.40611 397.88829,676 392.45295,676 c -1.92823,0 -1.83882,0.55906 0.62162,3.88699 1.14101,1.5433 2.32526,4.67508 2.63167,6.9595 0.42233,3.1487 0.99812,4.15351 2.38012,4.15351 1.29336,0 2.01469,-1.02173 2.48274,-3.51667 z m 193.72074,-11.62811 c 9.05748,-4.61414 19.50337,-11.41041 25.71016,-16.72746 10.24821,-8.77912 21.11322,-20.48283 25.85956,-27.8557 12.55677,-19.50547 13.09442,-20.56529 17.55475,-34.60402 8.23319,-25.91371 7.76653,-13.45816 7.40583,-197.66804 -0.30266,-154.57264 -0.42135,-163.99141 -2.17371,-172.5 -1.65869,-8.05376 -4.20236,-16.50772 -9.63414,-32.01925 -5.77946,-16.50442 -31.44114,-46.88853 -49.24329,-58.30536 -3.15205,-2.02146 -8.45968,-5.40995 -11.79474,-7.52996 -11.25725,-7.15597 -32.39273,-13.63799 -52.32944,-16.04888 -4.06408,-0.49146 -4.76089,-0.34141 -4.2765,0.92089 0.47965,1.24995 17.10189,28.77193 66.17704,109.57147 l 5.21664,8.58891 -18.01043,9.90343 c -19.73911,10.85399 -41.36618,24.10564 -54.05613,33.12204 C 530.20721,282.15534 515,296.97708 515,299.74741 c 0,3.36003 7.17518,11.4692 18.05574,20.40607 5.589,4.59058 14.72537,12.08561 20.30304,16.65561 31.64619,25.92892 60.44631,58.09901 76.8303,85.8204 l 5.98677,10.12949 3.16208,-1.58651 c 1.73914,-0.87259 5.57584,-1.58979 8.52601,-1.59378 4.78686,-0.006 5.67444,0.34025 8.25,3.2228 2.13023,2.38414 2.88606,4.2459 2.88606,7.10895 0,4.79659 -3.23554,15.40506 -6.12722,20.08956 -1.96935,3.19032 -2.22801,3.32304 -2.92339,1.5 -0.41958,-1.1 -0.51379,-6.13484 -0.20935,-11.18852 0.63959,-10.61705 -0.48906,-14.55067 -4.67209,-16.28333 -1.51825,-0.62889 -3.9084,-0.85531 -5.31143,-0.50318 l -2.55097,0.64026 4.01516,8.66738 c 18.77221,40.52298 23.98833,80.81652 15.72086,121.44083 -7.66013,37.64003 -27.27351,72.5729 -58.45308,104.10927 -5.22967,5.28951 -9.26106,9.61729 -8.95865,9.61729 0.30241,0 2.44441,-0.96515 4.76,-2.14478 z m 57.37683,-77.52189 c -1.45,-1.44999 -0.53699,-5.36512 1.87203,-8.02757 l 2.5387,-2.80576 -2.03496,3.5 c -2.66711,4.58725 -2.60889,6.21955 0.20756,5.81955 2.66492,-0.37848 6.28589,-6.68366 4.73118,-8.23837 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 564.49792,344.99664 c -0.42769,-0.69203 0.86527,-2.88519 3.13728,-5.32155 2.12564,-2.27941 3.97907,-4.34056 4.11874,-4.58035 0.13967,-0.23978 1.26467,0.51084 2.5,1.66804 2.59253,2.42855 6.89949,4.23722 10.09005,4.23722 2.3531,0 13.42884,-10.54445 15.66655,-14.91504 1.82372,-3.562 1.36335,-10.74392 -0.92615,-14.44841 C 596.34766,307.20843 590.29279,304 584.67286,304 c -2.50515,0 -4.83294,0.45 -5.17286,1 -1.04477,1.69047 -2.25414,1.11574 -2.87737,-1.36744 -1.32355,-5.27344 -10.8393,-11.80291 -19.75437,-13.55495 l -4.36826,-0.85848 4,-0.0876 c 2.2,-0.0482 5.96164,0.80251 8.3592,1.89043 5.51769,2.50372 6.93033,2.50794 4.67332,0.014 -4.20545,-4.64697 -19.79899,-7.29049 -25.04934,-4.24653 -1.82771,1.05963 -1.74799,1.16244 1.01682,1.3113 1.65,0.0888 0.30446,0.50444 -2.9901,0.92355 -5.54731,0.7057 -6.33998,1.14255 -10.72336,5.90966 -2.67472,2.90889 -5.49929,7.30445 -6.49462,10.10686 -0.96875,2.72757 -2.10573,4.95922 -2.52664,4.95922 -3.20304,0 3.99936,-13.74262 9.9455,-18.97662 6.74711,-5.93905 12.60301,-8.30001 20.81878,-8.39366 12.16874,-0.1387 20.83372,5.68301 25.38457,17.05507 l 1.27449,3.18479 3.92625,-2.04647 c 5.97441,-3.11404 16.29072,-2.31061 22.09203,1.72052 5.90002,4.09972 9.1055,10.4861 8.24806,16.4329 -1.29719,8.99671 -7.4893,16.95173 -16.95496,21.78207 -6.39444,3.26309 -15.12407,3.6014 -21.29987,0.82546 l -4.26251,-1.91594 -3.35608,3.25285 c -2.29333,2.22278 -3.58647,2.88007 -4.08362,2.07567 z m 33.30174,-7.41422 c 3.52889,-1.85254 9.55607,-8.23988 11.59016,-12.28276 0.8856,-1.76019 1.61018,-5.45703 1.61018,-8.2152 0,-4.16316 -0.51742,-5.60418 -3.0466,-8.48475 -3.66583,-4.17515 -10.18227,-6.86279 -15.53242,-6.4062 l -3.92098,0.33462 3.9634,1.77407 c 5.31152,2.37751 7.46669,4.43044 9.65587,9.1978 3.38773,7.37744 1.65649,14.58693 -5.02769,20.93709 -4.5345,4.30791 -4.21448,5.72949 0.70808,3.14533 z M 420,563.2398 c 24.18282,-11.76002 38.38492,-21.54713 45.6718,-31.47384 3.11789,-4.24741 3.39959,-5.12243 2.48954,-7.73299 -3.55775,-10.20575 -18.79588,-26.29469 -45.18858,-47.71163 -9.61002,-7.79826 -19.61026,-16.04577 -22.22276,-18.3278 l -4.75,-4.14915 -0.004,37.8278 c -0.004,38.67582 -0.94751,58.71058 -3.53458,75.06704 -0.80374,5.08158 -1.46135,9.45026 -1.46135,9.70818 0,0.62058 8.89141,-3.42888 29,-13.20761 z m -12.33333,-50.90647 c -1.45,-1.44999 -0.53699,-5.36512 1.87203,-8.02757 l 2.5387,-2.80576 -2.03496,3.5 c -2.66711,4.58725 -2.60889,6.21955 0.20756,5.81955 2.66492,-0.37848 6.28589,-6.68366 4.73118,-8.23837 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 152.88914,450.5 C 185.53492,448.025 212.41496,446 212.62256,446 212.83015,446 213,423.725 213,396.5 l 0,-49.5 -4.87427,0 c -9.49437,0 -19.11147,-5.07138 -23.11061,-12.18689 -6.81233,-12.1209 -1.16623,-37.34848 10.69566,-47.78973 C 200.44404,282.85699 207.78863,279 210.9891,279 212.98669,279 213,278.47625 213,199.89159 l 0,-79.10841 2.25,0.52903 c 1.2375,0.29096 42.16654,4.9432 90.95342,10.33831 l 88.70341,9.80929 9.29659,-9.01784 C 409.31654,127.48216 416.425,120.84685 420,117.69683 l 6.5,-5.7273 -106,0.27358 -106,0.27358 -12,2.79045 c -13.25864,3.08314 -30.96964,9.76088 -40.08644,15.11417 C 144.54553,140.91322 126.88533,157.11153 117,172.07558 104.79957,190.54415 104.08773,191.92722 98.767909,207.5 92.517257,225.7976 92.743299,221.04116 92.31661,343.25 92.102015,404.7125 92.287951,455 92.729801,455 c 0.44185,0 27.513549,-2.025 60.159339,-4.5 z M 97.666667,392.33333 c -1.449998,-1.44999 -0.536988,-5.36512 1.872032,-8.02757 L 102.0774,381.5 100.04244,385 c -2.667109,4.58725 -2.60889,6.21955 0.20756,5.81955 2.66492,-0.37848 6.28589,-6.68366 4.73118,-8.23837 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.845333,7.38795 z M 135.45042,243.5934 c -4.11967,-1.79442 -8.2262,-6.88129 -9.03485,-11.19173 -1.446,-7.70785 2.55277,-19.33281 9.76669,-28.39311 6.78093,-8.51649 15.28787,-11.46735 24.95615,-8.6567 6.1681,1.79312 11.38124,6.48645 12.83493,11.55516 2.9671,10.34571 -7.8444,29.36158 -20.19187,35.51459 -5.8235,2.90197 -13.26653,3.37776 -18.33105,1.17179 z m 16.44488,-1.88845 c 3.17562,-1.54318 9.773,-14.28131 11.32204,-21.86042 2.67267,-13.07683 -5.24351,-22.3675 -17.31994,-20.3272 -5.59737,0.94567 -10.16892,5.30307 -14.36646,13.69346 -2.94088,5.87846 -3.53094,8.13 -3.53094,13.47323 0,6.42562 1.45728,10.79074 4.42459,13.25339 4.67101,3.8766 13.48419,4.67665 19.47071,1.76754 z m 16.76183,-18.17674 c 6.7885,-14.15789 2.56388,-24.20021 -11.28907,-26.83525 -4.74407,-0.90239 -4.78034,0.30644 -0.0805,2.68201 8.34476,4.2179 11.01785,15.11563 6.71242,27.36535 -2.41538,6.8722 -2.41371,6.84721 -0.34287,5.13212 0.91143,-0.75484 3.16143,-4.50974 5,-8.34423 z M 654.37365,451.64815 C 658.91876,440.77017 656.27599,432 648.45295,432 c -1.94978,0 -1.84329,0.55303 0.7932,4.11907 1.7785,2.40554 2.32106,4.68736 2.60589,10.95951 0.19785,4.35678 0.53104,7.92142 0.74043,7.92142 0.20938,0 1.01091,-1.50833 1.78118,-3.35185 z M 213,313.5 l 0,-31.5 -2.25,0.0153 c -1.2375,0.008 -2.925,0.45153 -3.75,0.98469 -1.16368,0.75203 -0.82737,1.00221 1.5,1.1158 1.65,0.0805 0.30446,0.48935 -2.9901,0.90846 -5.53663,0.70434 -6.3446,1.14757 -10.67286,5.85474 -9.75295,10.60677 -13.86456,32.96914 -7.87322,42.82111 3.80835,6.26233 13.28465,11.15666 21.78618,11.25215 L 213,345 l 0,-31.5 z"
+       id="path3352"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#303634"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 c -33.42239,10.55813 -71.71912,10.89934 -106.75019,0.9511 C 154.13331,716.00825 131.37959,704.48342 120.5,696.29818 82.936695,668.03746 59.302147,626.79738 49.551692,572.5 45.558818,550.26488 44.894861,540.96355 44.297999,498.90139 l -0.561905,-39.59861 3.256953,-0.65139 C 48.784371,458.29313 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.494146,238.35 67.990761,234.5 c 4.276468,-33.15327 12.505987,-54.4036 31.058565,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.2564 5.60465,-3.437 2.81685,-2.0155 25.41273,-11.60854 32,-13.585544 1.65,-0.495206 9.075,-2.3559 16.5,-4.134875 L 212.5,87.5 l 124.77153,-0.276196 124.77154,-0.276197 5.22846,-3.326708 c 2.87566,-1.829689 13.36414,-7.812957 23.30774,-13.296151 l 18.07927,-9.969444 7.96272,13.072348 7.96273,13.072348 12.458,0.707514 c 29.29772,1.663873 58.89884,10.108571 76.68955,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.29464,8.88963 39.45466,35.11365 47.58114,49.59331 1.38905,2.475 3.96676,6.78272 5.72824,9.57271 2.97884,4.71814 5.66457,11.45995 11.52372,28.92729 2.15874,6.43564 4.68088,18.77142 6.64487,32.5 1.22598,8.56985 1.14148,327.3526 -0.0887,334.5 -0.56797,3.3 -1.64615,9.6 -2.39597,14 -2.42416,14.22523 -12.22343,40.42112 -17.92887,47.92831 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.52766,12.67374 -26.14564,33.45064 -44.11473,46.72078 -9.68797,7.15454 -34.03563,19.1506 -46,22.66413 -7.24815,2.12854 -29.57515,6.67439 -35.59058,7.24637 -5.77413,0.54903 -8.11409,1.4995 -18.88871,7.67243 -6.76397,3.87517 -15.2732,8.538 -18.90942,10.36184 -5.7261,2.8721 -38.68028,17.57698 -39.36389,17.56504 -0.13607,-0.002 -3.87196,-7.76488 -8.30198,-17.25 z m 44.43937,-36.34345 c 31.51453,-16.24849 50.7838,-30.01562 72.61521,-51.88066 24.89217,-24.93052 39.20067,-48.92104 46.53388,-78.02157 4.06757,-16.1414 5.32731,-28.40077 4.71411,-45.87606 C 626.4883,485.7247 614.14049,454.00834 587.59979,418.5 575.32134,402.07287 546.47351,373.424 523.9021,355.24163 492.75425,330.15052 481.05194,314.6655 480.85624,298.28146 c -0.15991,-13.38792 14.56396,-31.34848 41.47045,-50.58672 9.95862,-7.12045 28.92543,-19.16911 37.45177,-23.79121 4.25814,-2.30832 6.15527,-3.90265 5.89563,-4.95463 -0.4043,-1.63812 -63.23898,-105.377 -65.38469,-107.9489 -0.68828,-0.825 -1.85896,-2.34566 -2.60151,-3.37925 -1.28762,-1.79231 -1.77541,-1.6446 -10.54402,3.19286 -20.19052,11.13872 -43.58645,29.44546 -64.67521,50.60678 -12.33206,12.37448 -25.36733,27.13566 -26.56264,30.07961 -0.22331,0.55 -3.71815,5.95 -7.7663,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.39109,1.86244 -4.97028,16.89122 -6.42778,26.98981 -3.38112,23.42684 -0.38429,55.88983 6.55438,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.22253 5.85092,8.72485 0,2.35959 31.18791,31.90518 46.97309,44.49952 36.41337,29.05276 53.67666,49.22525 58.61182,68.48905 2.11868,8.27001 1.2479,14.79368 -3.21874,24.11399 -6.84842,14.29024 -26.76579,30.64249 -54.68987,44.90061 -6.9589,3.55324 -12.65789,6.73984 -12.66442,7.08135 -0.0144,0.75307 40.79578,87.21928 47.96674,101.62908 2.80547,5.6375 5.36863,10.25 5.69591,10.25 0.32728,0 8.9719,-4.31899 19.21026,-9.59777 z m -274.07218,-5.43891 c 17.29308,-1.22059 22.60784,-2.16713 34.68739,-6.17769 46.52885,-15.44815 82.2047,-58.35026 94.46647,-113.60097 C 363.41111,552.15742 364,541.11294 364,477.78162 l 0,-59.73064 -7.13885,-10.77549 c -17.50452,-26.42162 -28.31044,-55.74205 -31.95706,-86.71126 -1.6247,-13.79787 -0.63408,-40.04839 2.0591,-54.56423 4.35897,-23.49424 16.01095,-52.32273 30.43575,-75.30196 C 362.98519,181.79894 364,179.49394 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.38253,3.48036 -5.24937,4.51201 -9.91907,5.48144 -14.15319,2.93819 -20.64519,-2.34785 -26.41636,-21.50924 -3.84588,-12.76905 -5.2643,-25.74566 -5.81924,-53.2379 -0.52346,-25.93321 -0.55549,-26.24986 -2.65402,-26.23822 -1.89709,0.0105 -81.48268,6.19899 -100.792802,7.83751 -4.217754,0.35789 -7.952282,0.93524 -8.298952,1.28299 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.324 15.5,-0.89418 z m 137.50197,-6.50988 c 8.2789,-7.49197 17.31456,-11.88201 24.45579,-11.88201 4.93007,0 5.74727,0.32429 8.45569,3.35554 2.71479,3.03838 2.95617,3.86204 2.55378,8.71429 L 402.33545,691 l 18.43927,0 c 14.35917,0 18.3254,-0.27659 17.9247,-1.25 -0.75875,-1.8432 -48.85978,-104.21583 -49.07552,-104.44661 -0.10109,-0.10814 -1.88084,5.51148 -3.95501,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.16441,0 18.1644,0 6.12915,-5.54656 z M 394,687.54705 c 0,-6.99429 -4.76632,-11.68281 -10.17628,-10.01019 -4.19586,1.29726 -10.25452,5.29188 -14.27667,9.41296 L 365.5941,691 l 14.20295,0 14.20295,0 0,-3.45295 z m 6.5691,-0.0637 C 401.7092,681.40611 397.88829,676 392.45295,676 c -1.92823,0 -1.83882,0.55906 0.62162,3.88699 1.14101,1.5433 2.32526,4.67508 2.63167,6.9595 0.42233,3.1487 0.99812,4.15351 2.38012,4.15351 1.29336,0 2.01469,-1.02173 2.48274,-3.51667 z m 193.72074,-11.62811 c 15.26949,-7.77872 25.87719,-15.70037 38.80414,-28.97828 6.96825,-7.15743 10.24708,-11.59948 21.2739,-28.82113 6.03464,-9.42489 11.98848,-27.08741 15.04834,-44.64207 1.40166,-8.04144 1.58002,-27.53214 1.55106,-169.5 -0.0187,-91.62169 -0.42581,-163.20121 -0.94935,-166.91374 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.78274,-5.10301 -6.1399,-12.46374 -14.7318,-24.88703 -8.1023,-11.71537 -29.73324,-31.77156 -39.61946,-36.73512 -2.28629,-1.14787 -5.50689,-3.09395 -7.15689,-4.32461 -9.15373,-6.82736 -30.78552,-13.4432 -52.26121,-15.98351 l -5.26121,-0.62234 4.16031,6.78593 c 2.28817,3.73226 16.17631,26.58593 30.86253,50.78593 14.68623,24.2 29.19058,48.09001 32.2319,53.08891 l 5.52968,9.08891 -18.01043,9.90343 c -19.73911,10.85399 -41.36618,24.10564 -54.05613,33.12204 C 530.08094,282.24506 515,296.97445 515,299.79975 c 0,3.45772 7.82319,12.06221 20.05201,22.05462 6.2964,5.14491 15.94799,13.07578 21.44799,17.62416 29.87665,24.70733 57.28057,55.63567 73.66167,83.1353 l 6.03664,10.13395 3.15084,-1.58091 c 1.73297,-0.86951 5.56462,-1.58419 8.51479,-1.58818 4.78686,-0.006 5.67444,0.34025 8.25,3.2228 2.13023,2.38414 2.88606,4.2459 2.88606,7.10895 0,4.79659 -3.23554,15.40506 -6.12722,20.08956 -1.96935,3.19032 -2.22801,3.32304 -2.92339,1.5 -0.41958,-1.1 -0.51379,-6.13484 -0.20935,-11.18852 0.63959,-10.61705 -0.48906,-14.55067 -4.67209,-16.28333 -1.51825,-0.62889 -3.9084,-0.85531 -5.31143,-0.50318 l -2.55097,0.64026 4.01516,8.66738 c 18.80158,40.58637 23.95032,80.4176 15.69793,121.44083 -7.53849,37.47434 -27.06139,72.26867 -58.34067,103.97656 -5.29002,5.3625 -9.36623,9.75 -9.05825,9.75 0.30798,0 2.45453,-0.96515 4.77012,-2.14478 z m 57.37683,-77.52189 c -1.45,-1.44999 -0.53699,-5.36512 1.87203,-8.02757 l 2.5387,-2.80576 -2.03496,3.5 c -2.66711,4.58725 -2.60889,6.21955 0.20756,5.81955 2.66492,-0.37848 6.28589,-6.68366 4.73118,-8.23837 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 564.49792,344.99664 c -0.42769,-0.69203 0.86527,-2.88519 3.13728,-5.32155 2.12564,-2.27941 3.97907,-4.34056 4.11874,-4.58035 0.13967,-0.23978 1.26467,0.51084 2.5,1.66804 2.59253,2.42855 6.89949,4.23722 10.09005,4.23722 2.3531,0 13.42884,-10.54445 15.66655,-14.91504 1.82372,-3.562 1.36335,-10.74392 -0.92615,-14.44841 C 596.34766,307.20843 590.29279,304 584.67286,304 c -2.50515,0 -4.83294,0.45 -5.17286,1 -1.04477,1.69047 -2.25414,1.11574 -2.87737,-1.36744 -1.32355,-5.27344 -10.8393,-11.80291 -19.75437,-13.55495 l -4.36826,-0.85848 4,-0.0876 c 2.2,-0.0482 5.96164,0.80251 8.3592,1.89043 5.51769,2.50372 6.93033,2.50794 4.67332,0.014 -4.20545,-4.64697 -19.79899,-7.29049 -25.04934,-4.24653 -1.82771,1.05963 -1.74799,1.16244 1.01682,1.3113 1.65,0.0888 0.30446,0.50444 -2.9901,0.92355 -5.54731,0.7057 -6.33998,1.14255 -10.72336,5.90966 -2.67472,2.90889 -5.49929,7.30445 -6.49462,10.10686 -0.96875,2.72757 -2.10573,4.95922 -2.52664,4.95922 -3.20304,0 3.99936,-13.74262 9.9455,-18.97662 6.74711,-5.93905 12.60301,-8.30001 20.81878,-8.39366 12.16874,-0.1387 20.83372,5.68301 25.38457,17.05507 l 1.27449,3.18479 3.92625,-2.04647 c 5.97441,-3.11404 16.29072,-2.31061 22.09203,1.72052 5.90002,4.09972 9.1055,10.4861 8.24806,16.4329 -1.29719,8.99671 -7.4893,16.95173 -16.95496,21.78207 -6.39444,3.26309 -15.12407,3.6014 -21.29987,0.82546 l -4.26251,-1.91594 -3.35608,3.25285 c -2.29333,2.22278 -3.58647,2.88007 -4.08362,2.07567 z m 33.30174,-7.41422 c 3.52889,-1.85254 9.55607,-8.23988 11.59016,-12.28276 0.8856,-1.76019 1.61018,-5.45703 1.61018,-8.2152 0,-4.16316 -0.51742,-5.60418 -3.0466,-8.48475 -3.66583,-4.17515 -10.18227,-6.86279 -15.53242,-6.4062 l -3.92098,0.33462 3.9634,1.77407 c 5.31152,2.37751 7.46669,4.43044 9.65587,9.1978 3.38773,7.37744 1.65649,14.58693 -5.02769,20.93709 -4.5345,4.30791 -4.21448,5.72949 0.70808,3.14533 z M 419,563.73163 c 25.16774,-12.23618 39.2884,-21.90747 46.6718,-31.96567 3.11789,-4.24741 3.39959,-5.12243 2.48954,-7.73299 -3.55775,-10.20575 -18.79588,-26.29469 -45.18858,-47.71163 -9.61002,-7.79826 -19.61026,-16.04577 -22.22276,-18.3278 l -4.75,-4.14915 -0.004,37.8278 c -0.004,38.67582 -0.94751,58.71058 -3.53458,75.06704 -0.80374,5.08158 -1.46135,9.44432 -1.46135,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.33333,-51.3983 c -1.45,-1.44999 -0.53699,-5.36512 1.87203,-8.02757 l 2.5387,-2.80576 -2.03496,3.5 c -2.66711,4.58725 -2.60889,6.21955 0.20756,5.81955 2.66492,-0.37848 6.28589,-6.68366 4.73118,-8.23837 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 152.88914,450.5 C 185.53492,448.025 212.41496,446 212.62256,446 212.83015,446 213,423.725 213,396.5 l 0,-49.5 -4.87427,0 c -9.49437,0 -19.11147,-5.07138 -23.11061,-12.18689 -6.81233,-12.1209 -1.16623,-37.34848 10.69566,-47.78973 C 200.44404,282.85699 207.78863,279 210.9891,279 212.98669,279 213,278.47626 213,199.88337 c 0,-75.25232 0.0866,-79.09398 1.77327,-78.65291 0.9753,0.25504 41.90692,4.90844 90.95917,10.34089 l 89.18591,9.87716 9.29082,-9.01219 C 409.31913,127.47962 416.425,120.84688 420,117.69692 l 6.5,-5.72722 -106.5,0.31784 -106.5,0.31784 -11.23726,2.6311 c -12.56915,2.94294 -30.89072,9.92452 -39.84918,15.18483 C 144.42045,140.98667 126.91457,157.04016 117,172.06712 104.76649,190.60875 104.08707,191.92917 98.767909,207.5 92.517257,225.7976 92.743299,221.04116 92.31661,343.25 92.102015,404.7125 92.287951,455 92.729801,455 c 0.44185,0 27.513549,-2.025 60.159339,-4.5 z M 97.666667,392.33333 c -1.449998,-1.44999 -0.536988,-5.36512 1.872032,-8.02757 L 102.0774,381.5 100.04244,385 c -2.667109,4.58725 -2.60889,6.21955 0.20756,5.81955 2.66492,-0.37848 6.28589,-6.68366 4.73118,-8.23837 -1.41452,-1.41452 -1.20669,-2.58118 0.4598,-2.58118 2.10021,0 2.79356,1.65565 2.07102,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.845333,7.38795 z M 135.45042,243.5934 c -4.11967,-1.79442 -8.2262,-6.88129 -9.03485,-11.19173 -1.446,-7.70785 2.55277,-19.33281 9.76669,-28.39311 6.78093,-8.51649 15.28787,-11.46735 24.95615,-8.6567 6.1681,1.79312 11.38124,6.48645 12.83493,11.55516 2.9671,10.34571 -7.8444,29.36158 -20.19187,35.51459 -5.8235,2.90197 -13.26653,3.37776 -18.33105,1.17179 z m 16.44488,-1.88845 c 3.17562,-1.54318 9.773,-14.28131 11.32204,-21.86042 2.67267,-13.07683 -5.24351,-22.3675 -17.31994,-20.3272 -5.59737,0.94567 -10.16892,5.30307 -14.36646,13.69346 -2.94088,5.87846 -3.53094,8.13 -3.53094,13.47323 0,6.42562 1.45728,10.79074 4.42459,13.25339 4.67101,3.8766 13.48419,4.67665 19.47071,1.76754 z m 16.76183,-18.17674 c 6.7885,-14.15789 2.56388,-24.20021 -11.28907,-26.83525 -4.74407,-0.90239 -4.78034,0.30644 -0.0805,2.68201 8.34476,4.2179 11.01785,15.11563 6.71242,27.36535 -2.41538,6.8722 -2.41371,6.84721 -0.34287,5.13212 0.91143,-0.75484 3.16143,-4.50974 5,-8.34423 z M 654.37365,451.64815 C 658.91876,440.77017 656.27599,432 648.45295,432 c -1.94978,0 -1.84329,0.55303 0.7932,4.11907 1.7785,2.40554 2.32106,4.68736 2.60589,10.95951 0.19785,4.35678 0.53104,7.92142 0.74043,7.92142 0.20938,0 1.01091,-1.50833 1.78118,-3.35185 z M 213,313.5 l 0,-31.5 -2.25,0.0153 c -1.2375,0.008 -2.925,0.45153 -3.75,0.98469 -1.16368,0.75203 -0.82737,1.00221 1.5,1.1158 1.65,0.0805 0.30446,0.48935 -2.9901,0.90846 -5.53663,0.70434 -6.3446,1.14757 -10.67286,5.85474 -9.75295,10.60677 -13.86456,32.96914 -7.87322,42.82111 3.80835,6.26233 13.28465,11.15666 21.78618,11.25215 L 213,345 l 0,-31.5 z"
+       id="path3350"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#2d3534"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 c -20.92203,6.60926 -47.4528,9.52338 -69.53372,7.63751 -15.01666,-1.28254 -32.64283,-4.82556 -43.83003,-8.81025 -11.14831,-3.97084 -29.35944,-13.78836 -39.09667,-21.0768 C 83.056458,668.23666 59.297654,626.77235 49.551692,572.5 45.558818,550.26488 44.894861,540.96355 44.297999,498.90139 l -0.561905,-39.59861 3.256953,-0.65139 C 48.784371,458.29313 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.493516,238.35 67.98936,234.5 c 4.241638,-32.93434 12.613403,-54.55101 31.059966,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.2564 5.60465,-3.437 2.81685,-2.0155 25.41273,-11.60854 32,-13.585544 1.65,-0.495206 9.075,-2.355873 16.5,-4.134816 l 13.5,-3.23444 125,-0.50006 125,-0.50006 8.5,-5.072797 c 18.34039,-10.945538 37.15113,-20.67607 38.11227,-19.714937 0.53126,0.531261 4.21083,6.325836 8.17683,12.876832 L 524.5,86.5 537,87.207514 c 29.32705,1.659943 58.9277,10.099887 76.73154,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.29464,8.88963 39.45466,35.11365 47.58114,49.59331 1.38905,2.475 3.96676,6.78272 5.72824,9.57271 2.97884,4.71814 5.66457,11.45995 11.52372,28.92729 2.15874,6.43564 4.68088,18.77142 6.64487,32.5 1.13146,7.90911 1.11948,326.1802 -0.0126,333.5 -2.69177,17.40516 -4.15199,23.97905 -7.5522,34 -4.39395,12.94963 -9.58163,24.62943 -12.84876,28.92831 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.52766,12.67374 -26.14564,33.45064 -44.11473,46.72078 -9.68797,7.15454 -34.03563,19.1506 -46,22.66413 -7.30309,2.14467 -29.59804,6.67665 -35.70703,7.2583 -5.49003,0.52272 -8.07046,1.44467 -14.221,5.08097 -13.9255,8.23299 -27.97915,15.33899 -45.37895,22.94515 -9.51884,4.16107 -17.39384,7.56364 -17.5,7.56126 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.34345 c 31.51453,-16.24849 50.7838,-30.01562 72.61521,-51.88066 24.89217,-24.93052 39.20067,-48.92104 46.53388,-78.02157 4.06757,-16.1414 5.32731,-28.40077 4.71411,-45.87606 C 626.4883,485.7247 614.14049,454.00834 587.59979,418.5 575.32134,402.07287 546.47351,373.424 523.9021,355.24163 492.75425,330.15052 481.05194,314.6655 480.85624,298.28146 c -0.15991,-13.38792 14.56396,-31.34848 41.47045,-50.58672 9.95862,-7.12045 28.92543,-19.16911 37.45177,-23.79121 4.25814,-2.30832 6.15527,-3.90265 5.89563,-4.95463 -0.4043,-1.63812 -63.23898,-105.377 -65.38469,-107.9489 -0.68828,-0.825 -1.85896,-2.34566 -2.60151,-3.37925 -1.28762,-1.79231 -1.77541,-1.6446 -10.54402,3.19286 -20.19052,11.13872 -43.58645,29.44546 -64.67521,50.60678 -12.33206,12.37448 -25.36733,27.13566 -26.56264,30.07961 -0.22331,0.55 -3.71815,5.95 -7.7663,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.39109,1.86244 -4.97028,16.89122 -6.42778,26.98981 -3.38112,23.42684 -0.38429,55.88983 6.55438,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.22253 5.85092,8.72485 0,2.35959 31.18791,31.90518 46.97309,44.49952 36.41337,29.05276 53.67666,49.22525 58.61182,68.48905 2.11868,8.27001 1.2479,14.79368 -3.21874,24.11399 -6.84842,14.29024 -26.76579,30.64249 -54.68987,44.90061 -6.9589,3.55324 -12.65789,6.73984 -12.66442,7.08135 -0.0144,0.75307 40.79578,87.21928 47.96674,101.62908 2.80547,5.6375 5.36863,10.25 5.69591,10.25 0.32728,0 8.9719,-4.31899 19.21026,-9.59777 z m -274.07218,-5.43891 c 17.29308,-1.22059 22.60784,-2.16713 34.68739,-6.17769 46.52885,-15.44815 82.2047,-58.35026 94.46647,-113.60097 C 363.41111,552.15742 364,541.11294 364,477.78162 l 0,-59.73064 -7.10997,-10.77549 C 344.23539,388.09679 334.7537,366.92729 329.66907,346.5 c -4.53028,-18.20021 -5.17049,-23.99349 -5.13871,-46.5 0.0255,-18.05565 0.39337,-23.42243 2.29631,-33.5 4.56302,-24.16488 16.07411,-52.70587 30.57227,-75.80196 C 362.98519,181.79894 364,179.49394 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.38253,3.48036 -5.24937,4.51201 -9.91907,5.48144 -14.15319,2.93819 -20.64519,-2.34785 -26.41636,-21.50924 -3.84588,-12.76905 -5.2643,-25.74566 -5.81924,-53.2379 -0.52346,-25.93321 -0.55549,-26.24986 -2.65402,-26.23822 -1.89709,0.0105 -81.48268,6.19899 -100.792802,7.83751 -4.217754,0.35789 -7.952282,0.93524 -8.298952,1.28299 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.324 15.5,-0.89418 z m 137.50197,-6.50988 c 8.2789,-7.49197 17.31456,-11.88201 24.45579,-11.88201 4.93007,0 5.74727,0.32429 8.45569,3.35554 2.71479,3.03838 2.95617,3.86204 2.55378,8.71429 L 402.33545,691 l 18.43927,0 c 14.35917,0 18.3254,-0.27659 17.9247,-1.25 -0.75875,-1.8432 -48.85978,-104.21583 -49.07552,-104.44661 -0.10109,-0.10814 -1.88084,5.51148 -3.95501,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.16441,0 18.1644,0 6.12915,-5.54656 z M 394,687.45034 c 0,-5.49716 -2.41406,-9.24979 -6.4357,-10.00426 -4.36652,-0.81916 -11.50528,2.88023 -17.66039,9.15182 l -4.32033,4.4021 14.20821,0 14.20821,0 0,-3.54966 z M 400.5,688 c 1.41665,-6.44997 -2.2604,-12 -7.95034,-12 -2.02978,0 -1.95848,0.52803 0.52491,3.88699 1.14101,1.5433 2.32526,4.67508 2.63167,6.9595 0.69344,5.17002 3.75004,5.90551 4.79376,1.15351 z m 193.78984,-12.14478 c 15.26949,-7.77872 25.87719,-15.70037 38.80414,-28.97828 6.96825,-7.15743 10.24708,-11.59948 21.2739,-28.82113 6.03464,-9.42489 11.98848,-27.08741 15.04834,-44.64207 1.40166,-8.04144 1.58002,-27.53214 1.55106,-169.5 -0.0187,-91.62169 -0.42581,-163.20121 -0.94935,-166.91374 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.78274,-5.10301 -6.1399,-12.46374 -14.7318,-24.88703 -8.1023,-11.71537 -29.73324,-31.77156 -39.61946,-36.73512 -2.28629,-1.14787 -5.50689,-3.09395 -7.15689,-4.32461 -9.15373,-6.82736 -30.78552,-13.4432 -52.26121,-15.98351 l -5.26121,-0.62234 4.16031,6.78593 c 2.28817,3.73226 16.17631,26.58593 30.86253,50.78593 14.68623,24.2 29.19058,48.09001 32.2319,53.08891 l 5.52968,9.08891 -18.01043,9.90343 c -19.73911,10.85399 -41.36618,24.10564 -54.05613,33.12204 C 530.08094,282.24506 515,296.97445 515,299.79975 c 0,3.45772 7.82319,12.06221 20.05201,22.05462 6.2964,5.14491 15.94799,13.07578 21.44799,17.62416 29.87665,24.70733 57.28057,55.63567 73.66167,83.1353 l 6.03664,10.13395 3.15084,-1.58091 c 1.73297,-0.86951 5.56462,-1.58419 8.51479,-1.58818 4.78686,-0.006 5.67444,0.34025 8.25,3.2228 2.13023,2.38414 2.88606,4.2459 2.88606,7.10895 0,4.79659 -3.23554,15.40506 -6.12722,20.08956 -1.96063,3.17619 -2.22792,3.31497 -2.88912,1.5 -0.40073,-1.1 -0.50074,-6.29334 -0.22225,-11.54076 0.40166,-7.56809 0.17213,-10.18709 -1.11014,-12.66672 -1.70355,-3.2943 -5.90936,-4.98016 -9.5453,-3.82615 -1.82317,0.57865 -1.69802,1.13554 2.09546,9.32452 18.82241,40.63184 23.97302,80.44234 15.71721,121.48255 -7.53849,37.47434 -27.06139,72.26867 -58.34067,103.97656 -5.29002,5.3625 -9.36623,9.75 -9.05825,9.75 0.30798,0 2.45453,-0.96515 4.77012,-2.14478 z m 57.37683,-77.52189 c -1.44667,-1.44666 -0.53938,-5.36317 1.85964,-8.02757 l 2.5263,-2.80576 -2.13006,3.75843 c -2.54444,4.48962 -2.01311,7.39559 1.05226,5.75505 3.12905,-1.67462 5.52061,-6.99054 4.13972,-9.20169 C 658.21764,586.37564 658.28357,586 659.43251,586 c 2.10844,0 2.80292,1.6516 2.07949,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 564.57334,345.11867 c -0.35866,-0.58033 1.25857,-3.08555 3.59385,-5.56715 4.21085,-4.47469 4.26286,-4.49618 6.28939,-2.59838 2.41051,2.2574 6.78256,4.04686 9.88741,4.04686 2.87231,0 14.0422,-11.23082 16.09998,-16.18781 2.74313,-6.60796 -0.61667,-15.26771 -7.29178,-18.79428 -2.0087,-1.06124 -2.93124,-1.94941 -2.05007,-1.97371 2.98134,-0.0822 8.38589,4.44821 10.64788,8.92576 3.90343,7.72674 2.60574,13.79707 -4.54521,21.26168 -1.96616,2.05241 -3.30839,3.99809 -2.98274,4.32374 1.00121,1.00121 6.08798,-2.19051 9.91777,-6.22296 C 609.155,327.05185 611,322.96229 611,317.12639 c 0,-5.97027 -3.14925,-10.38078 -9.45863,-13.24673 C 597.2228,301.91801 589,301.34125 589,303 c 0,0.55 -1.99844,1 -4.44098,1 -2.44254,0 -4.7191,0.45 -5.05902,1 -1.05189,1.70199 -2.25567,1.10963 -2.89125,-1.42274 -1.32122,-5.26416 -9.14808,-10.95709 -18.10875,-13.17153 -4.65616,-1.15067 -4.75931,-1.23998 -1.5,-1.29872 1.925,-0.0347 5.46164,0.82703 7.8592,1.91495 5.51769,2.50372 6.93033,2.50794 4.67332,0.014 -4.02527,-4.44788 -16.54888,-6.84998 -24.03252,-4.60958 l -3,0.89811 3,0.71945 c 2.69391,0.64605 2.53928,0.73152 -1.5156,0.83777 -8.17924,0.2143 -15.19354,6.30761 -18.73307,16.27336 -0.94642,2.66472 -2.06514,4.84495 -2.48605,4.84495 -3.20304,0 3.99936,-13.74262 9.9455,-18.97662 6.74711,-5.93905 12.60301,-8.30001 20.81878,-8.39366 12.16874,-0.1387 20.83372,5.68301 25.38457,17.05507 l 1.27449,3.18479 3.92625,-2.04647 c 5.97441,-3.11404 16.29072,-2.31061 22.09203,1.72052 5.90002,4.09972 9.1055,10.4861 8.24806,16.4329 -1.29719,8.99671 -7.4893,16.95173 -16.95496,21.78207 -6.39444,3.26309 -15.12407,3.6014 -21.29987,0.82546 l -4.26251,-1.91594 -3.35608,3.25285 c -2.02263,1.9604 -3.61519,2.83361 -4.0082,2.1977 z M 419,563.73163 c 25.16774,-12.23618 39.2884,-21.90747 46.6718,-31.96567 3.11789,-4.24741 3.39959,-5.12243 2.48954,-7.73299 -3.55775,-10.20575 -18.79588,-26.29469 -45.18858,-47.71163 -9.61002,-7.79826 -19.61026,-16.04577 -22.22276,-18.3278 l -4.75,-4.14915 -0.004,37.8278 c -0.004,38.67582 -0.94751,58.71058 -3.53458,75.06704 -0.80374,5.08158 -1.46135,9.44432 -1.46135,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.33333,-51.3983 c -1.44667,-1.44666 -0.53938,-5.36317 1.85964,-8.02757 l 2.5263,-2.80576 -2.13006,3.75843 c -2.54444,4.48962 -2.01311,7.39559 1.05226,5.75505 3.12905,-1.67462 5.52061,-6.99054 4.13972,-9.20169 C 414.21764,500.37564 414.28357,500 415.43251,500 c 2.10844,0 2.80292,1.6516 2.07949,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.84533,7.38795 z M 152.88914,450.5 C 185.53492,448.025 212.41496,446 212.62256,446 212.83015,446 213,423.725 213,396.5 l 0,-49.5 -4.87427,0 c -9.49437,0 -19.11147,-5.07138 -23.11061,-12.18689 -6.81233,-12.1209 -1.16623,-37.34848 10.69566,-47.78973 C 200.44404,282.85699 207.78863,279 210.9891,279 212.98669,279 213,278.47626 213,199.88337 c 0,-75.25232 0.0866,-79.09398 1.77327,-78.65291 0.9753,0.25504 41.90692,4.90844 90.95917,10.34089 l 89.18591,9.87716 9.29082,-9.01219 C 409.31913,127.47962 416.425,120.84688 420,117.69692 l 6.5,-5.72722 -106.5,0.31784 -106.5,0.31784 -11.23726,2.6311 c -12.56915,2.94294 -30.89072,9.92452 -39.84918,15.18483 C 144.42045,140.98667 126.91457,157.04016 117,172.06712 104.76649,190.60875 104.08707,191.92917 98.767909,207.5 92.517257,225.7976 92.743299,221.04116 92.31661,343.25 92.102015,404.7125 92.287951,455 92.729801,455 c 0.44185,0 27.513549,-2.025 60.159339,-4.5 z M 97.666667,392.33333 c -1.446664,-1.44666 -0.539378,-5.36317 1.85964,-8.02757 l 2.526303,-2.80576 -2.130055,3.75843 c -2.544448,4.48962 -2.013117,7.39559 1.052255,5.75505 3.12905,-1.67462 5.52061,-6.99054 4.13972,-9.20169 C 104.21764,380.37564 104.28357,380 105.43251,380 c 2.10844,0 2.80292,1.6516 2.07949,4.94538 -1.1657,5.30739 -7.31298,9.92031 -9.845333,7.38795 z M 135.45042,243.5934 c -4.11967,-1.79442 -8.2262,-6.88129 -9.03485,-11.19173 -1.446,-7.70785 2.55277,-19.33281 9.76669,-28.39311 6.78093,-8.51649 15.28787,-11.46735 24.95615,-8.6567 6.1681,1.79312 11.38124,6.48645 12.83493,11.55516 2.9671,10.34571 -7.8444,29.36158 -20.19187,35.51459 -5.8235,2.90197 -13.26653,3.37776 -18.33105,1.17179 z m 17.06348,-2.01055 c 1.17911,-0.77258 4.05478,-5.17348 6.39039,-9.77977 5.50753,-10.86199 6.36264,-18.12965 2.91829,-24.80308 -3.11026,-6.02613 -7.4924,-8.2937 -14.72224,-7.61815 -4.51909,0.42226 -6.01141,1.10189 -9.15091,4.16753 -10.40422,10.15945 -13.39485,29.85651 -5.52484,36.38803 4.79463,3.9792 15.22385,4.83341 20.08931,1.64544 z m 16.14323,-18.05464 c 6.7885,-14.15789 2.56388,-24.20021 -11.28907,-26.83525 -4.74407,-0.90239 -4.78034,0.30644 -0.0805,2.68201 8.34476,4.2179 11.01785,15.11563 6.71242,27.36535 -2.41538,6.8722 -2.41371,6.84721 -0.34287,5.13212 0.91143,-0.75484 3.16143,-4.50974 5,-8.34423 z M 654.59059,451.25 c 0.88959,-2.0625 1.68313,-6.37218 1.76342,-9.57707 0.15586,-6.22116 -1.05321,-8.05651 -6.15058,-9.33646 -3.38253,-0.84935 -3.6608,0.12588 -1.04533,3.6635 1.87733,2.53922 2.40462,4.70767 2.69394,11.07861 0.19785,4.35678 0.53104,7.92142 0.74043,7.92142 0.20938,0 1.10853,-1.6875 1.99812,-3.75 z M 213,313.5 c 0,-30.38564 -0.0679,-31.5 -1.91821,-31.5 -1.05502,0 -2.74252,0.32515 -3.75,0.72255 -1.51976,0.59948 -1.32076,0.83484 1.16821,1.38169 2.62334,0.57637 2.43305,0.67399 -1.5156,0.77745 -5.62015,0.14725 -9.97991,2.48827 -13.88798,7.4573 -8.33648,10.59966 -11.57143,32.41768 -6.1326,41.36112 3.80835,6.26233 13.28465,11.15666 21.78618,11.25215 L 213,345 l 0,-31.5 z"
+       id="path3348"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#453917"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 c -20.92203,6.60926 -47.4528,9.52338 -69.53372,7.63751 -15.01666,-1.28254 -32.64283,-4.82556 -43.83003,-8.81025 -11.14831,-3.97084 -29.35944,-13.78836 -39.09667,-21.0768 C 83.056458,668.23666 59.297654,626.77235 49.551692,572.5 45.558818,550.26488 44.894861,540.96355 44.297999,498.90139 l -0.561905,-39.59861 3.256953,-0.65139 C 48.784371,458.29313 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.493516,238.35 67.98936,234.5 c 4.241638,-32.93434 12.613403,-54.55101 31.059966,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.2564 5.60465,-3.437 2.81685,-2.0155 25.41273,-11.60854 32,-13.585544 1.65,-0.495206 9.075,-2.355873 16.5,-4.134816 l 13.5,-3.23444 125,-0.50006 125,-0.50006 8.5,-5.072797 c 18.34039,-10.945538 37.15113,-20.67607 38.11227,-19.714937 0.53126,0.531261 4.21083,6.325836 8.17683,12.876832 L 524.5,86.5 537,87.207514 c 29.32705,1.659943 58.9277,10.099887 76.73154,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.29464,8.88963 39.45466,35.11365 47.58114,49.59331 1.38905,2.475 3.96676,6.78272 5.72824,9.57271 2.97884,4.71814 5.66457,11.45995 11.52372,28.92729 2.15874,6.43564 4.68088,18.77142 6.64487,32.5 1.13146,7.90911 1.11948,326.1802 -0.0126,333.5 -2.69177,17.40516 -4.15199,23.97905 -7.5522,34 -4.39395,12.94963 -9.58163,24.62943 -12.84876,28.92831 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.52766,12.67374 -26.14564,33.45064 -44.11473,46.72078 -9.68797,7.15454 -34.03563,19.1506 -46,22.66413 -7.30309,2.14467 -29.59804,6.67665 -35.70703,7.2583 -5.49003,0.52272 -8.07046,1.44467 -14.221,5.08097 -13.9255,8.23299 -27.97915,15.33899 -45.37895,22.94515 -9.51884,4.16107 -17.39384,7.56364 -17.5,7.56126 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.34345 c 31.51453,-16.24849 50.7838,-30.01562 72.61521,-51.88066 24.89217,-24.93052 39.20067,-48.92104 46.53388,-78.02157 4.06757,-16.1414 5.32731,-28.40077 4.71411,-45.87606 C 626.4883,485.7247 614.14049,454.00834 587.59979,418.5 575.32134,402.07287 546.47351,373.424 523.9021,355.24163 492.75425,330.15052 481.05194,314.6655 480.85624,298.28146 c -0.15991,-13.38792 14.56396,-31.34848 41.47045,-50.58672 9.95862,-7.12045 28.92543,-19.16911 37.45177,-23.79121 4.25814,-2.30832 6.15527,-3.90265 5.89563,-4.95463 -0.4043,-1.63812 -63.23898,-105.377 -65.38469,-107.9489 -0.68828,-0.825 -1.85896,-2.34566 -2.60151,-3.37925 -1.28762,-1.79231 -1.77541,-1.6446 -10.54402,3.19286 -20.19052,11.13872 -43.58645,29.44546 -64.67521,50.60678 -12.33206,12.37448 -25.36733,27.13566 -26.56264,30.07961 -0.22331,0.55 -3.71815,5.95 -7.7663,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.39109,1.86244 -4.97028,16.89122 -6.42778,26.98981 -3.38112,23.42684 -0.38429,55.88983 6.55438,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.22253 5.85092,8.72485 0,2.35959 31.18791,31.90518 46.97309,44.49952 36.41337,29.05276 53.67666,49.22525 58.61182,68.48905 2.11868,8.27001 1.2479,14.79368 -3.21874,24.11399 -6.84842,14.29024 -26.76579,30.64249 -54.68987,44.90061 -6.9589,3.55324 -12.65789,6.73984 -12.66442,7.08135 -0.0144,0.75307 40.79578,87.21928 47.96674,101.62908 2.80547,5.6375 5.36863,10.25 5.69591,10.25 0.32728,0 8.9719,-4.31899 19.21026,-9.59777 z m -274.07218,-5.43891 c 17.29308,-1.22059 22.60784,-2.16713 34.68739,-6.17769 46.52885,-15.44815 82.2047,-58.35026 94.46647,-113.60097 C 363.41111,552.15742 364,541.11294 364,477.78162 l 0,-59.73064 -7.10997,-10.77549 C 344.23539,388.09679 334.7537,366.92729 329.66907,346.5 c -4.53028,-18.20021 -5.17049,-23.99349 -5.13871,-46.5 0.0255,-18.05565 0.39337,-23.42243 2.29631,-33.5 4.56302,-24.16488 16.07411,-52.70587 30.57227,-75.80196 C 362.98519,181.79894 364,179.49394 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.38253,3.48036 -5.24937,4.51201 -9.91907,5.48144 -14.15319,2.93819 -20.64519,-2.34785 -26.41636,-21.50924 -3.84588,-12.76905 -5.2643,-25.74566 -5.81924,-53.2379 -0.52346,-25.93321 -0.55549,-26.24986 -2.65402,-26.23822 -1.89709,0.0105 -81.48268,6.19899 -100.792802,7.83751 -4.217754,0.35789 -7.952282,0.93524 -8.298952,1.28299 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.324 15.5,-0.89418 z m 135.24122,-4.53572 c 5.17373,-5.36324 14.51484,-11.24634 20.72183,-13.05076 6.7241,-1.95475 11.96437,-0.78883 15.26899,3.39723 1.75374,2.22152 2.07226,3.6974 1.72137,7.97593 l -0.43057,5.25 18.43927,0 c 14.35917,0 18.3254,-0.27659 17.9247,-1.25 -0.75875,-1.8432 -48.85978,-104.21583 -49.07552,-104.44661 -0.10109,-0.10814 -1.88084,5.51148 -3.95501,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.37552,0 18.37553,0 3.44616,-3.5724 z m 29.33682,0.3224 c -1.88983,-10.9805 -6.47887,-13.34243 -15.52751,-7.99184 -4.81046,2.84449 -9.36723,6.5397 -11.73558,9.51669 -1.28675,1.61742 -0.46092,1.72515 13.225,1.72515 l 14.59744,0 -0.55935,-3.25 z m 6.20036,0.74343 c 1.14487,-4.56156 -0.41846,-9.35284 -3.5862,-10.99094 C 395.40679,676.67612 393.09853,676 391.87535,676 l -2.22398,0 2.1077,2.25 c 2.48937,2.65743 4.24093,6.91771 4.24093,10.3151 0,3.42414 3.72822,3.36593 4.59101,-0.0717 z m 193.69883,-12.63821 c 15.26949,-7.77872 25.87719,-15.70037 38.80414,-28.97828 6.96825,-7.15743 10.24708,-11.59948 21.2739,-28.82113 6.03464,-9.42489 11.98848,-27.08741 15.04834,-44.64207 1.40166,-8.04144 1.58002,-27.53214 1.55106,-169.5 -0.0187,-91.62169 -0.42581,-163.20121 -0.94935,-166.91374 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.78274,-5.10301 -6.1399,-12.46374 -14.7318,-24.88703 -8.1023,-11.71537 -29.73324,-31.77156 -39.61946,-36.73512 -2.28629,-1.14787 -5.50689,-3.09395 -7.15689,-4.32461 -9.15373,-6.82736 -30.78552,-13.4432 -52.26121,-15.98351 l -5.26121,-0.62234 4.16031,6.78593 c 2.28817,3.73226 16.17631,26.58593 30.86253,50.78593 14.68623,24.2 29.19058,48.09001 32.2319,53.08891 l 5.52968,9.08891 -18.01043,9.90343 c -19.73911,10.85399 -41.36618,24.10564 -54.05613,33.12204 C 530.08094,282.24506 515,296.97445 515,299.79975 c 0,3.45772 7.82319,12.06221 20.05201,22.05462 6.2964,5.14491 15.94799,13.07578 21.44799,17.62416 29.92637,24.74844 57.2779,55.63118 73.72795,83.24656 4.13486,6.94137 6.45695,9.95139 7.20078,9.33406 0.60383,-0.50113 3.19755,-1.43985 5.76382,-2.08605 8.87368,-2.23442 15.82767,2.35203 15.78636,10.41176 -0.0229,4.46559 -3.77785,16.13315 -6.55733,20.37518 l -1.72958,2.63966 -0.8915,-2.40996 c -0.52941,-1.43113 -0.50647,-4.88303 0.0565,-8.49892 2.06324,-13.25259 -2.18284,-21.13175 -10.29119,-19.09669 l -2.43421,0.61095 4.05215,8.74746 c 18.84154,40.67364 23.99387,80.4651 15.73492,121.5209 -7.53849,37.47434 -27.06139,72.26867 -58.34067,103.97656 -5.29002,5.3625 -9.36623,9.75 -9.05825,9.75 0.30798,0 2.45453,-0.96515 4.77012,-2.14478 z m 57.37683,-77.52189 c -1.44667,-1.44666 -0.53938,-5.36317 1.85964,-8.02757 l 2.5263,-2.80576 -2.13006,3.75843 c -1.17153,2.06714 -1.86504,4.44905 -1.54114,5.29313 1.4711,3.83361 8.39009,-4.54542 7.10273,-8.60154 -0.3404,-1.07251 -0.16892,-1.95002 0.38108,-1.95002 1.60369,0 2.27012,3.51382 1.20018,6.32798 -1.89111,4.97401 -7.10112,8.30296 -9.39873,6.00535 z M 564,344.67323 c 0,-0.17973 1.9513,-2.45215 4.33622,-5.04982 3.98,-4.33505 4.45235,-4.58299 5.75,-3.01832 1.7052,2.0561 7.0324,4.39491 10.01046,4.39491 2.48463,0 8.83883,-5.40224 13.84563,-11.77134 2.84467,-3.61868 3.44231,-5.21836 3.44231,-9.214 0,-5.8963 -3.55852,-11.86682 -8.53386,-14.31819 -1.84292,-0.90801 -2.63078,-1.66118 -1.7508,-1.6737 3.06223,-0.0436 9.56088,5.67231 11.25068,9.89554 3.07739,7.69116 1.68665,13.18114 -5.14585,20.31333 -4.01228,4.18828 -3.81776,5.66266 0.45228,3.42809 11.53369,-6.03574 17.09224,-21.05047 10.6343,-28.7253 -1.48975,-1.77047 -4.52725,-4.04511 -6.75,-5.05477 C 597.24278,301.92709 587.42774,301.26504 588.5,303 c 0.37705,0.61008 -1.13661,1 -3.88197,1 -2.475,0 -4.77811,0.45 -5.11803,1 -1.05189,1.70199 -2.25567,1.10963 -2.89125,-1.42274 -1.323,-5.27125 -10.57384,-11.87819 -18.9525,-13.53584 l -4.15625,-0.82229 3.5,-0.0876 c 1.925,-0.0482 5.46164,0.80251 7.8592,1.89043 5.26278,2.38805 6.82962,2.51294 5.08014,0.40495 -2.23533,-2.6934 -8.22587,-5.19721 -13.94979,-5.83045 -6.20125,-0.68604 -12.61512,0.48665 -12.23955,2.23784 0.14061,0.65566 -0.9016,1.1657 -2.38197,1.1657 -5.78829,0 -11.80987,6.01394 -16.52096,16.5 -1.45793,3.2451 -2.37615,4.39289 -2.61614,3.27024 -0.60005,-2.80693 5.77304,-13.60376 10.47082,-17.73891 10.63128,-9.35803 24.60113,-11.14615 35.80116,-4.58249 3.37417,1.97739 9.49709,9.04645 9.49709,10.96462 0,0.25099 0.44358,1.62305 0.98574,3.04904 l 0.98574,2.5927 3.97442,-2.0276 c 5.36757,-2.73833 13.99998,-2.7163 19.71504,0.0503 12.87062,6.23056 14.44524,20.47977 3.55026,32.12738 -8.99768,9.61926 -21.05005,12.87599 -31.01809,8.38156 l -4.2431,-1.91314 -2.77972,2.66314 C 566.8306,344.57842 564,345.85752 564,344.67323 z m -145,219.0584 c 25.16774,-12.23618 39.2884,-21.90747 46.6718,-31.96567 3.11789,-4.24741 3.39959,-5.12243 2.48954,-7.73299 -3.55775,-10.20575 -18.79588,-26.29469 -45.18858,-47.71163 -9.61002,-7.79826 -19.61026,-16.04577 -22.22276,-18.3278 l -4.75,-4.14915 -0.004,37.8278 c -0.004,38.67582 -0.94751,58.71058 -3.53458,75.06704 -0.80374,5.08158 -1.46135,9.44432 -1.46135,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.33333,-51.3983 c -1.44667,-1.44666 -0.53938,-5.36317 1.85964,-8.02757 l 2.5263,-2.80576 -2.13006,3.75843 c -1.17153,2.06714 -1.86504,4.44905 -1.54114,5.29313 1.4711,3.83361 8.39009,-4.54542 7.10273,-8.60154 -0.3404,-1.07251 -0.16892,-1.95002 0.38108,-1.95002 1.60369,0 2.27012,3.51382 1.20018,6.32798 -1.89111,4.97401 -7.10112,8.30296 -9.39873,6.00535 z M 152.88914,450.5 C 185.53492,448.025 212.41496,446 212.62256,446 212.83015,446 213,423.725 213,396.5 l 0,-49.5 -4.96249,0 c -9.67585,0 -19.74628,-5.66857 -23.71921,-13.35136 -5.14574,-9.95077 -0.87097,-32.75165 8.14233,-43.4298 3.90787,-4.62968 10.54014,-8.95926 15.93427,-10.40197 l 4.6051,-1.23168 0,-78.90923 c 0,-75.05375 0.0866,-78.88657 1.77327,-78.4455 0.9753,0.25504 41.90692,4.90844 90.95917,10.34089 l 89.18591,9.87716 9.29082,-9.01219 C 409.31913,127.47962 416.425,120.84688 420,117.69692 l 6.5,-5.72722 -106.5,0.31784 -106.5,0.31784 -11.23726,2.6311 c -12.56915,2.94294 -30.89072,9.92452 -39.84918,15.18483 C 144.42045,140.98667 126.91457,157.04016 117,172.06712 104.76649,190.60875 104.08707,191.92917 98.767909,207.5 92.517257,225.7976 92.743299,221.04116 92.31661,343.25 92.102015,404.7125 92.287951,455 92.729801,455 c 0.44185,0 27.513549,-2.025 60.159339,-4.5 z M 97.666667,392.33333 c -1.446664,-1.44666 -0.539378,-5.36317 1.85964,-8.02757 l 2.526303,-2.80576 -2.130055,3.75843 c -1.171533,2.06714 -1.865047,4.44905 -1.541144,5.29313 1.471096,3.83361 8.390089,-4.54542 7.102729,-8.60154 -0.3404,-1.07251 -0.16892,-1.95002 0.38108,-1.95002 1.60369,0 2.27012,3.51382 1.20018,6.32798 -1.89111,4.97401 -7.101124,8.30296 -9.398733,6.00535 z M 135.37912,243.56342 c -1.71648,-0.74706 -4.41648,-3.05691 -6,-5.13301 -2.45903,-3.22396 -2.87313,-4.66154 -2.83809,-9.85257 0.0453,-6.70642 2.41794,-14.71963 5.50077,-18.57784 1.55586,-1.94719 1.43673,-1.3925 -0.53878,2.50849 -1.395,2.75467 -2.98162,7.77328 -3.52582,11.15249 -1.28371,7.97107 0.19078,12.57187 5.36562,16.74217 3.37074,2.71641 4.60463,3.09685 10.04398,3.09685 8.30139,0 10.38171,-1.56812 15.51749,-11.69692 5.50753,-10.86199 6.36264,-18.12965 2.91829,-24.80308 -3.11026,-6.02613 -7.4924,-8.2937 -14.72224,-7.61815 -4.5293,0.42321 -6.04907,1.11815 -9.42852,4.31134 l -4.02885,3.80681 3.29251,-4.28783 c 8.33115,-10.84965 24.66375,-11.93258 33.44094,-2.21728 3.58001,3.96265 3.99923,5.44535 3.67705,13.00511 -0.21059,4.94154 -5.29584,14.94102 -10.59648,20.83661 -8.0275,8.92852 -19.45427,12.48004 -28.07787,8.72681 z m 34.51459,-22.23731 C 171.05217,218.29887 172,213.61207 172,210.91102 c 0,-4.36238 -0.42914,-5.34016 -3.84133,-8.75235 -2.55298,-2.55298 -5.42102,-4.2391 -8.5513,-5.02732 -6.42343,-1.61744 -7.79744,-0.34393 -2.47358,2.29265 7.95339,3.93882 11.21701,15.66639 7.25659,26.076 -2.84373,7.4745 -2.76966,8.27078 0.43399,4.66509 1.62968,-1.8342 3.91088,-5.81174 5.06934,-8.83898 z M 656.02602,446.89154 C 658.22694,437.71706 655.09779,432 647.87535,432 l -2.22398,0 2.1077,2.25 c 3.12952,3.3408 4.2373,7.11705 4.27273,14.5651 0.0282,5.9189 0.19085,6.47504 1.4198,4.85345 0.7634,-1.00729 1.92189,-4.05695 2.57442,-6.77701 z M 213,313.1263 l 0,-31.8737 -3.25,0.708 c -1.7875,0.38941 -3.1375,1.23257 -3,1.8737 0.14061,0.65566 -0.9016,1.1657 -2.38197,1.1657 -12.26839,0 -24.0219,27.15917 -19.25799,44.5 2.28335,8.31147 12.92063,15.25467 23.63996,15.43035 L 213,345 l 0,-31.8737 z"
+       id="path3346"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#313131"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 c -20.92203,6.60926 -47.4528,9.52338 -69.53372,7.63751 -15.01666,-1.28254 -32.64283,-4.82556 -43.83003,-8.81025 -11.14831,-3.97084 -29.35944,-13.78836 -39.09667,-21.0768 C 83.056458,668.23666 59.297654,626.77235 49.551692,572.5 45.558818,550.26488 44.894861,540.96355 44.297999,498.90139 l -0.561905,-39.59861 3.256953,-0.65139 C 48.784371,458.29313 51.930943,458 53.985429,458 c 2.054486,0 5.823236,-0.28617 8.375,-0.63592 L 67,456.72815 67.043912,349.11408 C 67.068064,289.92633 67.493516,238.35 67.98936,234.5 c 4.241638,-32.93434 12.613403,-54.55101 31.059966,-80.19968 9.193614,-12.78308 35.885404,-37.47346 45.846024,-42.4084 1.43256,-0.70975 3.95465,-2.2564 5.60465,-3.437 2.81685,-2.0155 25.41273,-11.60854 32,-13.585544 1.65,-0.495206 9.075,-2.355873 16.5,-4.134816 l 13.5,-3.23444 125,-0.50006 125,-0.50006 8.5,-5.072797 c 18.34039,-10.945538 37.15113,-20.67607 38.11227,-19.714937 0.53126,0.531261 4.21083,6.325836 8.17683,12.876832 L 524.5,86.5 537,87.207514 c 29.32705,1.659943 58.9277,10.099887 76.73154,21.878226 2.8385,1.87784 7.26421,4.72227 9.83491,6.32095 14.29464,8.88963 39.45466,35.11365 47.58114,49.59331 1.38905,2.475 3.96676,6.78272 5.72824,9.57271 2.97884,4.71814 5.66457,11.45995 11.52372,28.92729 2.15874,6.43564 4.68088,18.77142 6.64487,32.5 1.13146,7.90911 1.11948,326.1802 -0.0126,333.5 -2.69177,17.40516 -4.15199,23.97905 -7.5522,34 -4.39395,12.94963 -9.58163,24.62943 -12.84876,28.92831 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.52766,12.67374 -26.14564,33.45064 -44.11473,46.72078 -9.68797,7.15454 -34.03563,19.1506 -46,22.66413 -7.30309,2.14467 -29.59804,6.67665 -35.70703,7.2583 -5.49003,0.52272 -8.07046,1.44467 -14.221,5.08097 -13.9255,8.23299 -27.97915,15.33899 -45.37895,22.94515 -9.51884,4.16107 -17.39384,7.56364 -17.5,7.56126 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 C 568.93985,663.94472 610.01743,619.15347 623.03388,567.5 c 4.06757,-16.1414 5.32731,-28.40077 4.71411,-45.87606 C 626.45375,484.74009 613.18992,451.65879 584.99751,415 574.14965,400.89444 544.24396,371.6477 523.9021,355.25077 493.24694,330.54062 482.27103,316.397 481.21168,300.23963 c -0.43322,-6.60756 -0.19856,-7.8214 2.60988,-13.5 8.16394,-16.50732 31.12351,-36.21052 67.17844,-57.65048 7.425,-4.41526 14.00341,-8.37906 14.6187,-8.80845 0.74179,-0.51767 -9.73961,-18.5966 -31.10989,-53.66018 -17.72572,-29.08372 -33.02428,-53.93904 -33.99678,-55.23404 -0.97251,-1.29501 -2.30956,-3.0949 -2.97121,-3.99977 -1.08173,-1.47936 -2.12985,-1.13389 -10.39695,3.4269 -20.14323,11.11263 -43.46483,29.35755 -64.69928,50.61546 -12.3023,12.31588 -25.31743,27.06337 -26.53857,30.07093 -0.22331,0.55 -3.71815,5.95 -7.7663,12 -7.98791,11.93799 -17.51825,30.16458 -21.17669,40.5 -1.26545,3.575 -2.64035,6.95459 -3.05534,7.51019 -1.39109,1.86244 -4.97028,16.89122 -6.42778,26.98981 -3.38112,23.42684 -0.38429,55.88983 6.55438,71 1.01026,2.2 3.6137,8.14054 5.78544,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.22253 5.85092,8.72485 0,2.35959 31.18791,31.90518 46.97309,44.49952 62.44964,49.82604 73.78932,78.30488 43.20293,108.50117 -10.10357,9.9747 -24.57399,19.84954 -42.49972,29.00248 -6.9589,3.55324 -12.65789,6.73055 -12.66442,7.0607 -0.0167,0.8445 40.62043,87.00969 47.46833,100.64973 3.10639,6.1875 5.9048,11.25 6.21868,11.25 0.31388,0 8.94754,-4.31058 19.1859,-9.57906 z m -274.07218,-5.45762 c 17.32224,-1.22265 22.63423,-2.17093 34.68739,-6.1923 47.7222,-15.92185 83.346,-59.63009 95.02047,-116.58436 C 363.51085,549.71945 364,539.69886 364,477.41954 l 0,-59.36856 -7.10997,-10.77549 C 344.23539,388.09679 334.7537,366.92729 329.66907,346.5 c -4.53028,-18.20021 -5.17049,-23.99349 -5.13871,-46.5 0.0255,-18.05565 0.39337,-23.42243 2.29631,-33.5 4.56302,-24.16488 16.07411,-52.70587 30.57227,-75.80196 C 362.98519,181.79894 364,179.49394 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.6176,-12.00926 -10.89124,-30.86328 -11.62212,-66.93587 -0.52543,-25.93258 -0.55755,-26.24986 -2.65603,-26.23822 -1.89709,0.0105 -81.48268,6.19899 -100.792802,7.83751 -4.217754,0.35789 -7.952282,0.93524 -8.298952,1.28299 -0.97357,0.97663 1.267837,43.23152 2.998272,56.52326 4.882644,37.50435 15.154256,68.01127 30.748362,91.32335 6.09125,9.10598 23.88279,27.13207 32.47051,32.89856 18.28863,12.28048 38.31318,19.11724 61.75045,21.08277 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.324 15.5,-0.89418 z m 135.24122,-4.53572 c 5.17373,-5.36324 14.51484,-11.24634 20.72183,-13.05076 6.7241,-1.95475 11.96437,-0.78883 15.26899,3.39723 1.75374,2.22152 2.07226,3.6974 1.72137,7.97593 l -0.43057,5.25 18.43927,0 c 14.35445,0 18.32723,-0.27691 17.93355,-1.25 -0.70319,-1.73811 -48.85607,-104.20418 -49.08362,-104.44661 -0.1015,-0.10814 -1.88159,5.51148 -3.95576,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.37552,0 18.37553,0 3.44616,-3.5724 z m 29.33682,0.3224 c -1.88983,-10.9805 -6.47887,-13.34243 -15.52751,-7.99184 -4.81046,2.84449 -9.36723,6.5397 -11.73558,9.51669 -1.28675,1.61742 -0.46092,1.72515 13.225,1.72515 l 14.59744,0 -0.55935,-3.25 z m 6.20036,0.74343 c 1.14487,-4.56156 -0.41846,-9.35284 -3.5862,-10.99094 C 395.40679,676.67612 393.09853,676 391.87535,676 l -2.22398,0 2.1077,2.25 c 2.48937,2.65743 4.24093,6.91771 4.24093,10.3151 0,3.42414 3.72822,3.36593 4.59101,-0.0717 z m 193.69883,-12.63821 c 15.26949,-7.77872 25.87719,-15.70037 38.80414,-28.97828 6.96825,-7.15743 10.24708,-11.59948 21.2739,-28.82113 6.03464,-9.42489 11.98848,-27.08741 15.04834,-44.64207 1.40166,-8.04144 1.58002,-27.53214 1.55106,-169.5 -0.0187,-91.62169 -0.42581,-163.20121 -0.94935,-166.91374 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.78274,-5.10301 -6.1399,-12.46374 -14.7318,-24.88703 -8.1023,-11.71537 -29.73324,-31.77156 -39.61946,-36.73512 -2.28629,-1.14787 -5.50689,-3.09395 -7.15689,-4.32461 -9.15158,-6.82575 -30.78886,-13.44411 -52.24953,-15.98196 l -5.24952,-0.62079 5.34269,8.78438 C 548.28213,125.54703 562.30249,148.625 576.5,172 c 14.19751,23.375 28.16006,46.35762 31.02788,51.0725 l 5.21422,8.5725 -17.92464,9.87246 c -19.70479,10.85293 -41.49325,24.21289 -54.12202,33.18583 C 530.20721,282.15534 515,296.97708 515,299.74741 c 0,3.42687 7.49659,11.84117 18.7605,21.0571 28.31138,23.16387 35.80534,29.72699 49.30432,43.18013 63.03498,62.82095 87.96669,130.42815 73.86111,200.2888 -4.67971,23.17718 -13.71937,44.82882 -27.64992,66.22656 -8.97788,13.79031 -15.70262,22.03821 -29.14795,35.75 -6.33692,6.4625 -11.19018,11.75 -10.78502,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z m 57.37683,-77.52189 c -1.44667,-1.44666 -0.53938,-5.36317 1.85964,-8.02757 l 2.5263,-2.80576 -2.13006,3.75843 c -1.17153,2.06714 -1.86504,4.44905 -1.54114,5.29313 1.4711,3.83361 8.39009,-4.54542 7.10273,-8.60154 -0.3404,-1.07251 -0.16892,-1.95002 0.38108,-1.95002 1.60369,0 2.27012,3.51382 1.20018,6.32798 -1.89111,4.97401 -7.10112,8.30296 -9.39873,6.00535 z m -2.08293,-138.03554 c -0.32789,-1.53878 -0.18431,-5.27872 0.31908,-8.31097 0.96059,-5.78637 0.27156,-11.95458 -1.7566,-15.72501 -1.39309,-2.58982 -5.01832,-3.76171 -8.74409,-2.8266 -4.59271,1.15269 -2.14799,-1.77352 2.67388,-3.20052 5.8317,-1.72585 10.54783,-0.76469 14.20819,2.89566 2.7843,2.78431 2.94817,3.36298 2.45698,8.67646 -0.55238,5.97538 -4.97446,18.31198 -7.23707,20.18978 -1.03281,0.85716 -1.45539,0.48333 -1.92037,-1.6988 z m 6.44228,-13.40625 C 658.22694,437.71706 655.09779,432 647.87535,432 l -2.22398,0 2.1077,2.25 c 3.12952,3.3408 4.2373,7.11705 4.27273,14.5651 0.0282,5.9189 0.19085,6.47504 1.4198,4.85345 0.7634,-1.00729 1.92189,-4.05695 2.57442,-6.77701 z M 564,344.67323 c 0,-0.17973 1.9513,-2.45215 4.33622,-5.04982 3.98,-4.33505 4.45235,-4.58299 5.75,-3.01832 1.7052,2.0561 7.0324,4.39491 10.01046,4.39491 2.48463,0 8.83883,-5.40224 13.84563,-11.77134 2.84467,-3.61868 3.44231,-5.21836 3.44231,-9.214 0,-5.8963 -3.55852,-11.86682 -8.53386,-14.31819 -1.84292,-0.90801 -2.63078,-1.66118 -1.7508,-1.6737 3.06223,-0.0436 9.56088,5.67231 11.25068,9.89554 3.07739,7.69116 1.68665,13.18114 -5.14585,20.31333 -4.01228,4.18828 -3.81776,5.66266 0.45228,3.42809 11.53369,-6.03574 17.09224,-21.05047 10.6343,-28.7253 -1.48975,-1.77047 -4.52725,-4.04511 -6.75,-5.05477 C 597.24278,301.92709 587.42774,301.26504 588.5,303 c 0.37705,0.61008 -1.13661,1 -3.88197,1 -2.475,0 -4.77811,0.45 -5.11803,1 -1.05189,1.70199 -2.25567,1.10963 -2.89125,-1.42274 -1.323,-5.27125 -10.57384,-11.87819 -18.9525,-13.53584 l -4.15625,-0.82229 3.5,-0.0876 c 1.925,-0.0482 5.46164,0.80251 7.8592,1.89043 5.26278,2.38805 6.82962,2.51294 5.08014,0.40495 -2.23533,-2.6934 -8.22587,-5.19721 -13.94979,-5.83045 -6.20125,-0.68604 -12.61512,0.48665 -12.23955,2.23784 0.14061,0.65566 -0.9016,1.1657 -2.38197,1.1657 -5.78829,0 -11.80987,6.01394 -16.52096,16.5 -1.45793,3.2451 -2.37615,4.39289 -2.61614,3.27024 -0.60005,-2.80693 5.77304,-13.60376 10.47082,-17.73891 10.63128,-9.35803 24.60113,-11.14615 35.80116,-4.58249 3.37417,1.97739 9.49709,9.04645 9.49709,10.96462 0,0.25099 0.44358,1.62305 0.98574,3.04904 l 0.98574,2.5927 3.97442,-2.0276 c 5.36757,-2.73833 13.99998,-2.7163 19.71504,0.0503 12.87062,6.23056 14.44524,20.47977 3.55026,32.12738 -8.99768,9.61926 -21.05005,12.87599 -31.01809,8.38156 l -4.2431,-1.91314 -2.77972,2.66314 C 566.8306,344.57842 564,345.85752 564,344.67323 z m -145,219.0584 c 25.30736,-12.30406 39.2111,-21.80216 46.55012,-31.79991 3.23599,-4.40829 3.52414,-5.27994 2.61122,-7.89875 C 464.619,513.87141 449.53078,497.92381 422.96317,476.26044 413.35843,468.42868 403.3625,460.16935 400.75,457.90637 l -4.75,-4.1145 -0.004,37.85406 c -0.004,38.70043 -0.94715,58.73456 -3.53458,75.0933 -0.80374,5.08158 -1.46135,9.44432 -1.46135,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.33333,-51.3983 c -1.44667,-1.44666 -0.53938,-5.36317 1.85964,-8.02757 l 2.5263,-2.80576 -2.13006,3.75843 c -1.17153,2.06714 -1.86504,4.44905 -1.54114,5.29313 1.4711,3.83361 8.39009,-4.54542 7.10273,-8.60154 -0.3404,-1.07251 -0.16892,-1.95002 0.38108,-1.95002 1.60369,0 2.27012,3.51382 1.20018,6.32798 -1.89111,4.97401 -7.10112,8.30296 -9.39873,6.00535 z M 153.11086,450.5 C 185.75665,448.025 212.5868,446 212.73342,446 212.88004,446 213,423.725 213,396.5 l 0,-49.5 -4.96249,0 c -9.67585,0 -19.74628,-5.66857 -23.71921,-13.35136 -5.14574,-9.95077 -0.87097,-32.75165 8.14233,-43.4298 3.90787,-4.62968 10.54014,-8.95926 15.93427,-10.40197 l 4.6051,-1.23168 0,-78.85998 c 0,-74.62119 0.0941,-78.83415 1.75,-78.37933 0.9625,0.26437 41.89275,4.89545 90.95611,10.29131 l 89.20611,9.81064 8.79389,-8.50521 C 408.54275,128.26475 415.65,121.63992 419.5,118.22078 l 7,-6.21662 -106,0.24792 -106,0.24792 -12.17888,2.77199 c -11.27338,2.5659 -24.02393,7.02411 -33.08032,11.56648 C 148.3989,137.29204 128.72444,154.32898 117,172.07598 104.80112,190.54111 104.08777,191.92713 98.767909,207.5 92.517257,225.7976 92.743299,221.04116 92.31661,343.25 92.082234,410.37801 92.291489,455 92.840662,455 c 0.502823,0 27.624418,-2.025 60.270198,-4.5 z M 97.666667,392.33333 c -1.446664,-1.44666 -0.539378,-5.36317 1.85964,-8.02757 l 2.526303,-2.80576 -2.130055,3.75843 c -1.171533,2.06714 -1.865047,4.44905 -1.541144,5.29313 1.471096,3.83361 8.390089,-4.54542 7.102729,-8.60154 -0.3404,-1.07251 -0.16892,-1.95002 0.38108,-1.95002 1.60369,0 2.27012,3.51382 1.20018,6.32798 -1.89111,4.97401 -7.101124,8.30296 -9.398733,6.00535 z M 135.37912,243.56342 c -1.71648,-0.74706 -4.41648,-3.05691 -6,-5.13301 -2.45903,-3.22396 -2.87313,-4.66154 -2.83809,-9.85257 0.0453,-6.70642 2.41794,-14.71963 5.50077,-18.57784 1.55586,-1.94719 1.43673,-1.3925 -0.53878,2.50849 -1.395,2.75467 -2.98162,7.77328 -3.52582,11.15249 -1.28371,7.97107 0.19078,12.57187 5.36562,16.74217 3.37074,2.71641 4.60463,3.09685 10.04398,3.09685 8.30139,0 10.38171,-1.56812 15.51749,-11.69692 5.50753,-10.86199 6.36264,-18.12965 2.91829,-24.80308 -3.11026,-6.02613 -7.4924,-8.2937 -14.72224,-7.61815 -4.5293,0.42321 -6.04907,1.11815 -9.42852,4.31134 l -4.02885,3.80681 3.29251,-4.28783 c 8.33115,-10.84965 24.66375,-11.93258 33.44094,-2.21728 3.58001,3.96265 3.99923,5.44535 3.67705,13.00511 -0.21059,4.94154 -5.29584,14.94102 -10.59648,20.83661 -8.0275,8.92852 -19.45427,12.48004 -28.07787,8.72681 z m 34.51459,-22.23731 C 171.05217,218.29887 172,213.61207 172,210.91102 c 0,-4.36238 -0.42914,-5.34016 -3.84133,-8.75235 -2.55298,-2.55298 -5.42102,-4.2391 -8.5513,-5.02732 -6.42343,-1.61744 -7.79744,-0.34393 -2.47358,2.29265 7.95339,3.93882 11.21701,15.66639 7.25659,26.076 -2.84373,7.4745 -2.76966,8.27078 0.43399,4.66509 1.62968,-1.8342 3.91088,-5.81174 5.06934,-8.83898 z M 213,313.1263 l 0,-31.8737 -3.25,0.708 c -1.7875,0.38941 -3.1375,1.23257 -3,1.8737 0.14061,0.65566 -0.9016,1.1657 -2.38197,1.1657 -12.26839,0 -24.0219,27.15917 -19.25799,44.5 2.28335,8.31147 12.92063,15.25467 23.63996,15.43035 L 213,345 l 0,-31.8737 z"
+       id="path3344"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#2a3435"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 C 230.77077,731.78039 180.24956,728.57821 143.5,710.26865 93.66427,685.43925 59.944546,635.27417 49.091119,569.81589 45.564448,548.54613 44.896177,538.57996 44.302569,498.40251 l -0.577652,-39.09749 3.262542,-0.65251 C 48.781856,458.29363 51.930943,458 53.985429,458 c 2.054486,0 5.80681,-0.28391 8.338499,-0.63092 l 4.60307,-0.63092 0.351946,-112.11908 c 0.344628,-109.788 0.396572,-112.35056 2.49836,-123.25247 3.620731,-18.78063 11.532895,-40.09048 19.333743,-52.07163 1.863924,-2.86275 5.188953,-8.03775 7.388953,-11.5 7.79959,-12.27457 36.2445,-39.28079 48.23634,-45.79663 1.52001,-0.82591 4.53711,-2.60324 6.70466,-3.94961 3.8264,-2.37677 20.61369,-9.567247 29.39316,-12.589943 2.38379,-0.820716 10.70879,-2.943341 18.5,-4.716943 L 213.5,87.517124 337.76602,87.23589 l 124.26603,-0.281233 5.23397,-3.308105 c 13.20871,-8.348491 40.90108,-22.879449 41.83076,-21.949767 0.53978,0.539776 4.22632,6.341317 8.19232,12.892313 L 524.5,86.5 l 12,0.686992 c 29.27474,1.675958 60.37169,10.419819 76.73855,21.577398 2.3438,1.59781 7.41145,4.93531 11.26145,7.41668 14.27043,9.19743 39.73244,35.97587 46.90128,49.32615 1.47457,2.74603 4.03295,7.05859 5.6853,9.58347 2.76021,4.21775 5.78435,11.74376 11.01376,27.40931 2.03257,6.08892 5.25119,21.67484 6.91801,33.5 0.52301,3.71048 0.93025,75.41061 0.94893,167.07191 L 696,563.64383 l -2.48256,14.65461 c -3.41235,20.14321 -12.20172,45.334 -18.88654,54.12987 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -6.19973,12.03624 -26.99616,34.05014 -44.08602,46.66691 -9.67257,7.14088 -33.84993,19.05836 -46,22.67429 -5.87476,1.74835 -30.10373,6.60429 -36.25168,7.2655 -4.81574,0.51794 -7.91655,1.65388 -13.5,4.94557 -14.08047,8.30104 -28.44463,15.57092 -45.5553,23.05608 -9.51884,4.16406 -17.39384,7.56909 -17.5,7.56671 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 C 568.93985,663.94472 610.01743,619.15347 623.03388,567.5 c 4.06757,-16.1414 5.32731,-28.40077 4.71411,-45.87606 C 626.45375,484.74009 613.18992,451.65879 584.99751,415 574.14965,400.89444 544.24396,371.6477 523.9021,355.25077 493.24694,330.54062 482.27103,316.397 481.21168,300.23963 c -0.43322,-6.60756 -0.19856,-7.8214 2.60988,-13.5 8.16394,-16.50732 31.12351,-36.21052 67.17844,-57.65048 7.425,-4.41526 14.00341,-8.37906 14.6187,-8.80845 0.74179,-0.51767 -9.73961,-18.5966 -31.10989,-53.66018 -17.72572,-29.08372 -33.02428,-53.93904 -33.99678,-55.23404 -0.97251,-1.29501 -2.30956,-3.0949 -2.97121,-3.99977 -1.08173,-1.47936 -2.12985,-1.13389 -10.39695,3.4269 -20.14323,11.11263 -43.46483,29.35755 -64.69928,50.61546 -12.30199,12.31557 -25.31708,27.06297 -26.53866,30.07093 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.05163,7.89186 -3.83587,9.59302 -1.98421,4.30408 -5.16352,18.37183 -6.42412,28.42529 -2.87589,22.9357 0.73982,56.71057 7.4671,69.75126 0.7747,1.50174 3.17159,6.87097 5.32643,11.93163 4.64575,10.9106 12.21854,23.82266 20.29862,34.61035 3.21801,4.29635 5.85092,8.22253 5.85092,8.72485 0,2.35959 31.18791,31.90518 46.97309,44.49952 62.44964,49.82604 73.78932,78.30488 43.20293,108.50117 -10.10357,9.9747 -24.57399,19.84954 -42.49972,29.00248 -6.9589,3.55324 -12.65789,6.73055 -12.66442,7.0607 -0.0167,0.8445 40.62043,87.00969 47.46833,100.64973 3.10639,6.1875 5.9048,11.25 6.21868,11.25 0.31388,0 8.94754,-4.31058 19.1859,-9.57906 z m -274.07218,-5.45762 c 17.32224,-1.22265 22.63423,-2.17093 34.68739,-6.1923 47.7222,-15.92185 83.346,-59.63009 95.02047,-116.58436 C 363.51085,549.71945 364,539.69886 364,477.41954 l 0,-59.36856 -7.10997,-10.77549 C 340.9684,383.14552 330.96787,357.92346 325.85384,329 c -1.77802,-10.05602 -1.79531,-47.00522 -0.0267,-57 5.07912,-28.70254 15.71159,-56.00428 31.80146,-81.65885 C 362.99595,181.78321 364,179.47669 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.6176,-12.00926 -10.89124,-30.86328 -11.62212,-66.93587 -0.52543,-25.93258 -0.55755,-26.24986 -2.65603,-26.23822 -1.89709,0.0105 -81.48268,6.19899 -100.792802,7.83751 -4.217754,0.35789 -7.963823,0.94678 -8.324599,1.30864 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 18.20693,12.2292 38.0906,18.99977 61.58445,20.97004 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.324 15.5,-0.89418 z m 135.24122,-4.53572 c 5.17373,-5.36324 14.51484,-11.24634 20.72183,-13.05076 6.7241,-1.95475 11.96437,-0.78883 15.26899,3.39723 1.75374,2.22152 2.07226,3.6974 1.72137,7.97593 l -0.43057,5.25 18.43927,0 c 14.35445,0 18.32723,-0.27691 17.93355,-1.25 -0.70319,-1.73811 -48.85607,-104.20418 -49.08362,-104.44661 -0.1015,-0.10814 -1.88159,5.51148 -3.95576,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.37552,0 18.37553,0 3.44616,-3.5724 z m 29.33682,0.3224 c -1.88983,-10.9805 -6.47887,-13.34243 -15.52751,-7.99184 -4.81046,2.84449 -9.36723,6.5397 -11.73558,9.51669 -1.28675,1.61742 -0.46092,1.72515 13.225,1.72515 l 14.59744,0 -0.55935,-3.25 z m 6.20036,0.74343 c 1.14487,-4.56156 -0.41846,-9.35284 -3.5862,-10.99094 C 395.40679,676.67612 393.09853,676 391.87535,676 l -2.22398,0 2.1077,2.25 c 2.48937,2.65743 4.24093,6.91771 4.24093,10.3151 0,3.42414 3.72822,3.36593 4.59101,-0.0717 z m 193.69883,-12.63821 c 15.26949,-7.77872 25.87719,-15.70037 38.80414,-28.97828 6.96825,-7.15743 10.24708,-11.59948 21.2739,-28.82113 6.03464,-9.42489 11.98848,-27.08741 15.04834,-44.64207 1.40166,-8.04144 1.58002,-27.53214 1.55106,-169.5 -0.0187,-91.62169 -0.42581,-163.20121 -0.94935,-166.91374 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.78274,-5.10301 -6.1399,-12.46374 -14.7318,-24.88703 -8.1023,-11.71537 -29.73324,-31.77156 -39.61946,-36.73512 -2.28629,-1.14787 -5.50689,-3.09395 -7.15689,-4.32461 -9.15158,-6.82575 -30.78886,-13.44411 -52.24953,-15.98196 l -5.24952,-0.62079 5.34269,8.78438 C 548.28213,125.54703 562.30249,148.625 576.5,172 c 14.19751,23.375 28.16006,46.35762 31.02788,51.0725 l 5.21422,8.5725 -17.92464,9.87246 c -19.70479,10.85293 -41.49325,24.21289 -54.12202,33.18583 C 530.20721,282.15534 515,296.97708 515,299.74741 c 0,3.42687 7.49659,11.84117 18.7605,21.0571 28.31138,23.16387 35.80534,29.72699 49.30432,43.18013 63.03498,62.82095 87.96669,130.42815 73.86111,200.2888 -4.67971,23.17718 -13.71937,44.82882 -27.64992,66.22656 -8.97788,13.79031 -15.70262,22.03821 -29.14795,35.75 -6.33692,6.4625 -11.19018,11.75 -10.78502,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z m 57.37683,-77.52189 c -1.44667,-1.44666 -0.53938,-5.36317 1.85964,-8.02757 l 2.5263,-2.80576 -2.13006,3.75843 c -1.17153,2.06714 -1.86504,4.44905 -1.54114,5.29313 1.4711,3.83361 8.39009,-4.54542 7.10273,-8.60154 -0.3404,-1.07251 -0.16892,-1.95002 0.38108,-1.95002 1.60369,0 2.27012,3.51382 1.20018,6.32798 -1.89111,4.97401 -7.10112,8.30296 -9.39873,6.00535 z m -2.08293,-138.03554 c -0.32789,-1.53878 -0.18431,-5.27872 0.31908,-8.31097 0.96059,-5.78637 0.27156,-11.95458 -1.7566,-15.72501 -1.39309,-2.58982 -5.01832,-3.76171 -8.74409,-2.8266 -4.59271,1.15269 -2.14799,-1.77352 2.67388,-3.20052 5.8317,-1.72585 10.54783,-0.76469 14.20819,2.89566 2.7843,2.78431 2.94817,3.36298 2.45698,8.67646 -0.55238,5.97538 -4.97446,18.31198 -7.23707,20.18978 -1.03281,0.85716 -1.45539,0.48333 -1.92037,-1.6988 z m 6.44228,-13.40625 C 658.22694,437.71706 655.09779,432 647.87535,432 l -2.22398,0 2.1077,2.25 c 3.12952,3.3408 4.2373,7.11705 4.27273,14.5651 0.0282,5.9189 0.19085,6.47504 1.4198,4.85345 0.7634,-1.00729 1.92189,-4.05695 2.57442,-6.77701 z M 564,344.67323 c 0,-0.17973 1.9513,-2.45215 4.33622,-5.04982 3.98,-4.33505 4.45235,-4.58299 5.75,-3.01832 1.7052,2.0561 7.0324,4.39491 10.01046,4.39491 2.48463,0 8.83883,-5.40224 13.84563,-11.77134 2.84467,-3.61868 3.44231,-5.21836 3.44231,-9.214 0,-5.8963 -3.55852,-11.86682 -8.53386,-14.31819 -1.84292,-0.90801 -2.63078,-1.66118 -1.7508,-1.6737 3.06223,-0.0436 9.56088,5.67231 11.25068,9.89554 3.07739,7.69116 1.68665,13.18114 -5.14585,20.31333 -4.01228,4.18828 -3.81776,5.66266 0.45228,3.42809 11.53369,-6.03574 17.09224,-21.05047 10.6343,-28.7253 -1.48975,-1.77047 -4.52725,-4.04511 -6.75,-5.05477 C 597.24278,301.92709 587.42774,301.26504 588.5,303 c 0.37705,0.61008 -1.13661,1 -3.88197,1 -2.475,0 -4.77811,0.45 -5.11803,1 -1.05189,1.70199 -2.25567,1.10963 -2.89125,-1.42274 -1.323,-5.27125 -10.57384,-11.87819 -18.9525,-13.53584 l -4.15625,-0.82229 3.5,-0.0876 c 1.925,-0.0482 5.46164,0.80251 7.8592,1.89043 5.26278,2.38805 6.82962,2.51294 5.08014,0.40495 -2.23533,-2.6934 -8.22587,-5.19721 -13.94979,-5.83045 -6.20125,-0.68604 -12.61512,0.48665 -12.23955,2.23784 0.14061,0.65566 -0.9016,1.1657 -2.38197,1.1657 -5.78829,0 -11.80987,6.01394 -16.52096,16.5 -1.45793,3.2451 -2.37615,4.39289 -2.61614,3.27024 -0.60005,-2.80693 5.77304,-13.60376 10.47082,-17.73891 10.63128,-9.35803 24.60113,-11.14615 35.80116,-4.58249 3.37417,1.97739 9.49709,9.04645 9.49709,10.96462 0,0.25099 0.44358,1.62305 0.98574,3.04904 l 0.98574,2.5927 3.97442,-2.0276 c 5.36757,-2.73833 13.99998,-2.7163 19.71504,0.0503 12.87062,6.23056 14.44524,20.47977 3.55026,32.12738 -8.99768,9.61926 -21.05005,12.87599 -31.01809,8.38156 l -4.2431,-1.91314 -2.77972,2.66314 C 566.8306,344.57842 564,345.85752 564,344.67323 z m -145,219.0584 c 25.30736,-12.30406 39.2111,-21.80216 46.55012,-31.79991 3.23599,-4.40829 3.52414,-5.27994 2.61122,-7.89875 C 464.619,513.87141 449.53078,497.92381 422.96317,476.26044 413.35843,468.42868 403.3625,460.16935 400.75,457.90637 l -4.75,-4.1145 -0.004,37.85406 c -0.004,38.70043 -0.94715,58.73456 -3.53458,75.0933 -0.80374,5.08158 -1.46135,9.44432 -1.46135,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.33333,-51.3983 c -1.44667,-1.44666 -0.53938,-5.36317 1.85964,-8.02757 l 2.5263,-2.80576 -2.13006,3.75843 c -1.17153,2.06714 -1.86504,4.44905 -1.54114,5.29313 1.4711,3.83361 8.39009,-4.54542 7.10273,-8.60154 -0.3404,-1.07251 -0.16892,-1.95002 0.38108,-1.95002 1.60369,0 2.27012,3.51382 1.20018,6.32798 -1.89111,4.97401 -7.10112,8.30296 -9.39873,6.00535 z M 153.11086,450.5 C 185.75665,448.025 212.5868,446 212.73342,446 212.88004,446 213,423.725 213,396.5 l 0,-49.5 -4.96249,0 c -9.67585,0 -19.74628,-5.66857 -23.71921,-13.35136 -5.14574,-9.95077 -0.87097,-32.75165 8.14233,-43.4298 3.90787,-4.62968 10.54014,-8.95926 15.93427,-10.40197 l 4.6051,-1.23168 0,-78.85998 c 0,-74.62119 0.0941,-78.83415 1.75,-78.37933 0.9625,0.26437 41.89275,4.89545 90.95611,10.29131 l 89.20611,9.81064 8.79389,-8.50521 C 408.54275,128.26475 415.65,121.63992 419.5,118.22078 l 7,-6.21662 -106,0.24792 -106,0.24792 -12.17888,2.77199 c -15.16197,3.45097 -28.06337,8.47318 -41.82112,16.27997 -15.31187,8.68867 -34.7248,26.75023 -43.7881,40.73994 -2.21207,3.41445 -5.49921,8.4581 -7.30475,11.2081 -3.88376,5.91532 -6.48578,11.78004 -10.648151,24 -6.241641,18.32432 -6.015784,13.56522 -6.442389,135.75 -0.234376,67.12801 -0.02512,111.75 0.524052,111.75 0.502823,0 27.624418,-2.025 60.270198,-4.5 z M 97.666667,392.33333 c -1.446664,-1.44666 -0.539378,-5.36317 1.85964,-8.02757 l 2.526303,-2.80576 -2.130055,3.75843 c -1.171533,2.06714 -1.865047,4.44905 -1.541144,5.29313 1.471096,3.83361 8.390089,-4.54542 7.102729,-8.60154 -0.3404,-1.07251 -0.16892,-1.95002 0.38108,-1.95002 1.60369,0 2.27012,3.51382 1.20018,6.32798 -1.89111,4.97401 -7.101124,8.30296 -9.398733,6.00535 z M 135.37912,243.56342 c -1.71648,-0.74706 -4.41648,-3.05691 -6,-5.13301 -2.45903,-3.22396 -2.87313,-4.66154 -2.83809,-9.85257 0.0453,-6.70642 2.41794,-14.71963 5.50077,-18.57784 1.55586,-1.94719 1.43673,-1.3925 -0.53878,2.50849 -1.395,2.75467 -2.98162,7.77328 -3.52582,11.15249 -1.28371,7.97107 0.19078,12.57187 5.36562,16.74217 3.37074,2.71641 4.60463,3.09685 10.04398,3.09685 8.30139,0 10.38171,-1.56812 15.51749,-11.69692 5.50753,-10.86199 6.36264,-18.12965 2.91829,-24.80308 -3.11026,-6.02613 -7.4924,-8.2937 -14.72224,-7.61815 -4.5293,0.42321 -6.04907,1.11815 -9.42852,4.31134 l -4.02885,3.80681 3.29251,-4.28783 c 8.33115,-10.84965 24.66375,-11.93258 33.44094,-2.21728 3.58001,3.96265 3.99923,5.44535 3.67705,13.00511 -0.21059,4.94154 -5.29584,14.94102 -10.59648,20.83661 -8.0275,8.92852 -19.45427,12.48004 -28.07787,8.72681 z m 34.51459,-22.23731 C 171.05217,218.29887 172,213.61207 172,210.91102 c 0,-4.36238 -0.42914,-5.34016 -3.84133,-8.75235 -2.55298,-2.55298 -5.42102,-4.2391 -8.5513,-5.02732 -6.42343,-1.61744 -7.79744,-0.34393 -2.47358,2.29265 7.95339,3.93882 11.21701,15.66639 7.25659,26.076 -2.84373,7.4745 -2.76966,8.27078 0.43399,4.66509 1.62968,-1.8342 3.91088,-5.81174 5.06934,-8.83898 z M 213,313.1263 l 0,-31.8737 -3.25,0.708 c -1.7875,0.38941 -3.1375,1.23257 -3,1.8737 0.14061,0.65566 -0.9016,1.1657 -2.38197,1.1657 -12.26839,0 -24.0219,27.15917 -19.25799,44.5 2.28335,8.31147 12.92063,15.25467 23.63996,15.43035 L 213,345 l 0,-31.8737 z"
+       id="path3342"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#283234"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 C 230.77077,731.78039 180.24956,728.57821 143.5,710.26865 93.66427,685.43925 59.944546,635.27417 49.091119,569.81589 45.564448,548.54613 44.896177,538.57996 44.302569,498.40251 l -0.577652,-39.09749 3.262542,-0.65251 C 48.781856,458.29363 51.930943,458 53.985429,458 c 2.054486,0 5.80681,-0.28391 8.338499,-0.63092 l 4.60307,-0.63092 0.351946,-112.11908 c 0.344628,-109.788 0.396572,-112.35056 2.49836,-123.25247 3.620731,-18.78063 11.532895,-40.09048 19.333743,-52.07163 1.863924,-2.86275 5.188953,-8.03775 7.388953,-11.5 7.79959,-12.27457 36.2445,-39.28079 48.23634,-45.79663 1.52001,-0.82591 4.53711,-2.60324 6.70466,-3.94961 3.8264,-2.37677 20.61369,-9.567247 29.39316,-12.589943 2.38379,-0.820716 10.70879,-2.943341 18.5,-4.716943 L 213.5,87.517124 337.76602,87.23589 l 124.26603,-0.281233 5.23397,-3.308105 c 13.20871,-8.348491 40.90108,-22.879449 41.83076,-21.949767 0.53978,0.539776 4.22632,6.341317 8.19232,12.892313 L 524.5,86.5 l 12,0.686992 c 29.27474,1.675958 60.37169,10.419819 76.73855,21.577398 2.3438,1.59781 7.41145,4.93531 11.26145,7.41668 14.27043,9.19743 39.73244,35.97587 46.90128,49.32615 1.47457,2.74603 4.03295,7.05859 5.6853,9.58347 2.76021,4.21775 5.78435,11.74376 11.01376,27.40931 2.03257,6.08892 5.25119,21.67484 6.91801,33.5 0.52301,3.71048 0.93025,75.41061 0.94893,167.07191 L 696,563.64383 l -2.48256,14.65461 c -3.41235,20.14321 -12.20172,45.334 -18.88654,54.12987 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -6.19973,12.03624 -26.99616,34.05014 -44.08602,46.66691 -9.67257,7.14088 -33.84993,19.05836 -46,22.67429 -5.87476,1.74835 -30.10373,6.60429 -36.25168,7.2655 -4.81574,0.51794 -7.91655,1.65388 -13.5,4.94557 -14.08047,8.30104 -28.44463,15.57092 -45.5553,23.05608 -9.51884,4.16406 -17.39384,7.56909 -17.5,7.56671 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 C 568.93985,663.94472 610.01743,619.15347 623.03388,567.5 c 4.06757,-16.1414 5.32731,-28.40077 4.71411,-45.87606 C 626.45375,484.74009 613.18992,451.65879 584.99751,415 574.14965,400.89444 544.24396,371.6477 523.9021,355.25077 493.24694,330.54062 482.27103,316.397 481.21168,300.23963 c -0.43322,-6.60756 -0.19856,-7.8214 2.60988,-13.5 8.16394,-16.50732 31.12351,-36.21052 67.17844,-57.65048 7.425,-4.41526 14.00341,-8.37906 14.6187,-8.80845 0.74179,-0.51767 -9.73961,-18.5966 -31.10989,-53.66018 -17.72572,-29.08372 -33.02428,-53.93904 -33.99678,-55.23404 -0.97251,-1.29501 -2.30956,-3.0949 -2.97121,-3.99977 -1.08173,-1.47936 -2.12985,-1.13389 -10.39695,3.4269 -20.14323,11.11263 -43.46483,29.35755 -64.69928,50.61546 -12.30199,12.31557 -25.31708,27.06297 -26.53866,30.07093 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.05163,7.89186 -3.83587,9.59302 -1.98421,4.30408 -5.16352,18.37183 -6.42412,28.42529 -2.87589,22.9357 0.73982,56.71057 7.4671,69.75126 0.7747,1.50174 3.17159,6.87097 5.32643,11.93163 4.64575,10.9106 12.21854,23.82266 20.29862,34.61035 3.21801,4.29635 5.85092,8.22253 5.85092,8.72485 0,2.35959 31.18791,31.90518 46.97309,44.49952 62.44964,49.82604 73.78932,78.30488 43.20293,108.50117 -10.10357,9.9747 -24.57399,19.84954 -42.49972,29.00248 -6.9589,3.55324 -12.65789,6.73055 -12.66442,7.0607 -0.0167,0.8445 40.62043,87.00969 47.46833,100.64973 3.10639,6.1875 5.9048,11.25 6.21868,11.25 0.31388,0 8.94754,-4.31058 19.1859,-9.57906 z m -274.07218,-5.45762 c 17.32224,-1.22265 22.63423,-2.17093 34.68739,-6.1923 47.7222,-15.92185 83.346,-59.63009 95.02047,-116.58436 C 363.51085,549.71945 364,539.69886 364,477.41954 l 0,-59.36856 -7.10997,-10.77549 C 340.9684,383.14552 330.96787,357.92346 325.85384,329 c -1.77802,-10.05602 -1.79531,-47.00522 -0.0267,-57 5.07912,-28.70254 15.71159,-56.00428 31.80146,-81.65885 C 362.99595,181.78321 364,179.47669 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.6176,-12.00926 -10.89124,-30.86328 -11.62212,-66.93587 -0.52543,-25.93258 -0.55755,-26.24986 -2.65603,-26.23822 -1.89709,0.0105 -81.48268,6.19899 -100.792802,7.83751 -4.217754,0.35789 -7.963823,0.94678 -8.324599,1.30864 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 18.20693,12.2292 38.0906,18.99977 61.58445,20.97004 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.324 15.5,-0.89418 z m 135.24122,-4.53572 c 9.10116,-9.43452 22.4365,-15.44974 29.83467,-13.45762 5.96695,1.60673 8.412,5.26304 7.87752,11.78002 l -0.43057,5.25 18.43927,0 c 14.35445,0 18.32723,-0.27691 17.93355,-1.25 -0.70319,-1.73811 -48.85607,-104.20418 -49.08362,-104.44661 -0.1015,-0.10814 -1.88159,5.51148 -3.95576,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.37552,0 18.37553,0 3.44616,-3.5724 z m 29.33682,0.3224 c -2.26898,-13.18348 -8.1948,-14.14446 -22.05496,-3.5766 -8.63629,6.58486 -8.34696,6.8266 8.17069,6.8266 l 14.44362,0 -0.55935,-3.25 z m 6.00236,1.66821 c 1.16561,-3.03753 0.59334,-8.21334 -1.14301,-10.33784 -1.00976,-1.23548 -3.44198,-2.39985 -5.75,-2.75268 l -4,-0.61149 2.18339,2.3919 c 2.56946,2.81485 4.31661,7.04731 4.31661,10.457 0,2.81846 3.38647,3.4761 4.39301,0.85311 z m 193.89683,-13.56299 c 15.26949,-7.77872 25.87719,-15.70037 38.80414,-28.97828 6.96825,-7.15743 10.24708,-11.59948 21.2739,-28.82113 6.03464,-9.42489 11.98848,-27.08741 15.04834,-44.64207 1.40166,-8.04144 1.58002,-27.53214 1.55106,-169.5 -0.0187,-91.62169 -0.42581,-163.20121 -0.94935,-166.91374 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.78274,-5.10301 -6.1399,-12.46374 -14.7318,-24.88703 -8.1023,-11.71537 -29.73324,-31.77156 -39.61946,-36.73512 -2.28629,-1.14787 -5.50689,-3.09395 -7.15689,-4.32461 -9.15158,-6.82575 -30.78886,-13.44411 -52.24953,-15.98196 l -5.24952,-0.62079 5.34269,8.78438 C 548.28213,125.54703 562.30249,148.625 576.5,172 c 14.19751,23.375 28.16006,46.35762 31.02788,51.0725 l 5.21422,8.5725 -17.92464,9.87246 c -19.70479,10.85293 -41.49325,24.21289 -54.12202,33.18583 C 530.20721,282.15534 515,296.97708 515,299.74741 c 0,3.42687 7.49659,11.84117 18.7605,21.0571 28.31138,23.16387 35.80534,29.72699 49.30432,43.18013 63.03498,62.82095 87.96669,130.42815 73.86111,200.2888 -4.67971,23.17718 -13.71937,44.82882 -27.64992,66.22656 -8.97788,13.79031 -15.70262,22.03821 -29.14795,35.75 -6.33692,6.4625 -11.19018,11.75 -10.78502,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z m 57.37683,-77.52189 c -1.43789,-1.43788 -0.54565,-5.35797 1.82713,-8.02757 l 2.4938,-2.80576 -2.24167,4.20213 c -1.7492,3.27895 -1.97684,4.46696 -1.03618,5.40762 0.94065,0.94065 1.55882,0.91225 2.8138,-0.1293 2.64118,-2.19198 4.63213,-6.90468 3.92065,-9.28043 -0.60471,-2.01925 -0.5234,-2.07045 0.98957,-0.62321 1.35414,1.29532 1.45067,2.09866 0.54071,4.5 -2.06798,5.45732 -7.01557,9.04876 -9.30781,6.75652 z m -2.09975,-138.03554 c -0.33713,-1.53878 -0.17323,-5.113 0.36424,-7.94269 1.70535,-8.97847 -0.82845,-17.78925 -5.44935,-18.94902 -1.36499,-0.34259 -3.65085,-0.32949 -5.07968,0.0291 -4.76424,1.19575 -2.05235,-1.82586 2.89206,-3.22235 5.91841,-1.67159 11.7217,-0.27126 14.75857,3.56125 1.80467,2.27748 2.07792,3.63063 1.66106,8.22589 -0.52702,5.80953 -4.97276,18.14008 -7.20971,19.99659 -1.03251,0.85691 -1.45923,0.4827 -1.93719,-1.6988 z m 5.9071,-11.52225 c 3.07159,-10.34317 1.25573,-15.34263 -5.97402,-16.44785 l -4,-0.61149 2.18339,2.3919 c 3.17872,3.48228 4.45856,7.61381 4.29619,13.8687 -0.18438,7.10257 -0.16141,7.25361 0.99444,6.53926 0.53571,-0.33109 1.66071,-2.91432 2.5,-5.74052 z M 564,344.67323 c 0,-0.17973 1.9513,-2.45215 4.33622,-5.04982 3.98,-4.33505 4.45235,-4.58299 5.75,-3.01832 1.69768,2.04704 7.02829,4.39491 9.97821,4.39491 4.23144,0 15.88573,-12.30315 17.323,-18.28747 1.053,-4.3843 -1.19163,-10.79171 -5.05791,-14.43809 C 594.41996,306.4735 593.3076,305 593.8576,305 c 0.55,0 2.55627,1.46776 4.45839,3.26169 3.2001,3.01808 5.66482,8.66958 5.67843,13.02043 0.0103,3.27891 -3.05654,9.18141 -6.72827,12.94952 -1.99991,2.05241 -3.36975,3.99809 -3.0441,4.32374 0.97212,0.97212 6.4927,-2.3368 10.37367,-6.21777 C 609.16923,327.7641 611,323.4107 611,317.10884 c 0,-5.95141 -3.15683,-10.36666 -9.45863,-13.22918 C 597.24278,301.92709 587.42774,301.26504 588.5,303 c 0.37592,0.60825 -1.08962,1 -3.74098,1 -2.39746,0 -4.89152,0.5325 -5.54235,1.18333 -0.65084,0.65084 -1.30334,0.98834 -1.45,0.75 C 577.62,305.695 576.6,303.70389 575.5,301.50865 c -2.24721,-4.4847 -10.05776,-9.77668 -16.91035,-11.45748 l -4.08965,-1.00311 4.35497,0.50457 c 2.39524,0.27752 5.63539,1.16671 7.20034,1.97597 5.68476,2.9397 6.98311,0.89433 1.5599,-2.4574 -4.87968,-3.01581 -13.41942,-4.51592 -19.28732,-3.38806 -2.84213,0.54628 -4.72506,1.41925 -4.57789,2.12241 0.14373,0.68671 -0.86881,1.19445 -2.38197,1.19445 -5.80301,0 -11.8827,6.08577 -16.48351,16.5 -1.2149,2.75 -2.39652,4.4432 -2.62582,3.76267 -0.66046,-1.9601 4.14192,-11.36082 8.15866,-15.97067 2.12617,-2.44012 6.3706,-5.53919 10.10282,-7.37655 6.01308,-2.96023 6.98004,-3.13891 14.70802,-2.71785 12.04462,0.65625 17.79361,4.37558 22.49373,14.5524 1.33357,2.8875 2.60582,5.25 2.82721,5.25 0.22139,0 1.8759,-0.89832 3.67669,-1.99626 6.89983,-4.20683 21.30063,-1.23508 26.58798,5.48669 6.49135,8.25241 4.08941,19.94364 -5.96324,29.02561 -8.60191,7.7713 -21.40183,10.30633 -29.10131,5.76353 l -3.55149,-2.09543 -2.78598,2.90793 C 567.10905,344.49561 564,345.97847 564,344.67323 z m -145,219.0584 c 25.30736,-12.30406 39.2111,-21.80216 46.55012,-31.79991 3.23599,-4.40829 3.52414,-5.27994 2.61122,-7.89875 C 464.619,513.87141 449.53078,497.92381 422.96317,476.26044 413.35843,468.42868 403.3625,460.16935 400.75,457.90637 l -4.75,-4.1145 -0.004,37.85406 c -0.004,38.70043 -0.94715,58.73456 -3.53458,75.0933 -0.80374,5.08158 -1.46135,9.44432 -1.46135,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.33333,-51.3983 c -1.43789,-1.43788 -0.54565,-5.35797 1.82713,-8.02757 l 2.4938,-2.80576 -2.24167,4.20213 c -1.7492,3.27895 -1.97684,4.46696 -1.03618,5.40762 0.94065,0.94065 1.55882,0.91225 2.8138,-0.1293 2.64118,-2.19198 4.63213,-6.90468 3.92065,-9.28043 -0.60471,-2.01925 -0.5234,-2.07045 0.98957,-0.62321 1.35414,1.29532 1.45067,2.09866 0.54071,4.5 -2.06798,5.45732 -7.01557,9.04876 -9.30781,6.75652 z M 153.11086,450.5 C 185.75665,448.025 212.5868,446 212.73342,446 212.88004,446 213,423.725 213,396.5 l 0,-49.5 -4.3185,0 c -9.62338,0 -20.47932,-5.84078 -24.18886,-13.01424 -5.466,-10.57006 -0.91419,-33.4189 8.89837,-44.66742 C 197.01255,285.16683 207.63215,279 211.15972,279 212.93124,279 213,276.04585 213,199.93261 c 0,-74.81871 0.094,-79.04156 1.75,-78.58673 0.9625,0.26437 41.89275,4.89545 90.95611,10.29131 l 89.20611,9.81064 8.79389,-8.50521 C 408.54275,128.26475 415.65,121.63992 419.5,118.22078 l 7,-6.21662 -106,0.24792 -106,0.24792 -12.17888,2.77199 c -15.16197,3.45097 -28.06337,8.47318 -41.82112,16.27997 -15.31187,8.68867 -34.7248,26.75023 -43.7881,40.73994 -2.21207,3.41445 -5.49921,8.4581 -7.30475,11.2081 -3.88376,5.91532 -6.48578,11.78004 -10.648151,24 -6.241641,18.32432 -6.015784,13.56522 -6.442389,135.75 -0.234376,67.12801 -0.02512,111.75 0.524052,111.75 0.502823,0 27.624418,-2.025 60.270198,-4.5 z M 97.666667,392.33333 c -1.437883,-1.43788 -0.545644,-5.35797 1.827131,-8.02757 L 101.9876,381.5 l -2.241674,4.20213 c -1.749195,3.27895 -1.976835,4.46696 -1.03618,5.40762 0.940654,0.94065 1.558824,0.91225 2.813804,-0.1293 2.64118,-2.19198 4.63213,-6.90468 3.92065,-9.28043 -0.60471,-2.01925 -0.5234,-2.07045 0.98957,-0.62321 1.35414,1.29532 1.45067,2.09866 0.54071,4.5 -2.06798,5.45732 -7.015573,9.04876 -9.307813,6.75652 z M 137.5,244.26724 c -7.13744,-1.78708 -12.0453,-10.08679 -10.97603,-18.56159 0.36125,-2.86311 1.29792,-6.55565 2.0815,-8.20565 0.78358,-1.65 1.16016,-2.1 0.83685,-1 -1.89569,6.44964 -2.45998,12.72069 -1.47411,16.38193 2.17968,8.09474 11.53831,12.6744 20.8026,10.17978 4.72076,-1.27116 6.73256,-3.67629 11.4997,-13.74799 2.68661,-5.67607 3.22545,-7.99547 3.22728,-13.89156 0.002,-6.17553 -0.34697,-7.53564 -2.73675,-10.66881 -5.46136,-7.16021 -16.14249,-7.61795 -23.15854,-0.99247 l -3.95953,3.73912 3.29251,-4.28783 c 8.18916,-10.66475 23.15345,-11.88415 32.76956,-2.6703 l 4.52744,4.33805 -0.38588,6.82905 c -0.93316,16.51471 -16.20585,33.52115 -29.79294,33.17503 -2.50451,-0.0638 -5.45366,-0.34135 -6.55366,-0.61676 z m 28.73451,-15.5994 C 170.06989,222.59663 172,216.58806 172,210.71944 c 0,-4.5422 -0.37639,-5.38716 -3.88754,-8.72724 -4.20922,-4.00413 -11.99087,-6.71925 -14.78159,-5.15749 -1.29059,0.72225 -1.0791,1.01166 1.14765,1.57054 9.67736,2.42887 14.39246,15.31791 9.91186,27.09475 -0.83701,2.2 -1.76974,4.7875 -2.07274,5.75 -1.014,3.22108 1.15343,1.79222 3.91687,-2.58216 z M 213,313.1263 l 0,-31.8737 -3.25,0.708 c -1.7875,0.38941 -3.1375,1.23257 -3,1.8737 0.14061,0.65566 -0.9016,1.1657 -2.38197,1.1657 -12.26727,0 -24.0635,27.15056 -19.2805,44.37658 2.35823,8.49318 13.00618,15.50892 23.66247,15.59077 L 213,345 l 0,-31.8737 z"
+       id="path3340"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#413515"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 C 230.77077,731.78039 180.24956,728.57821 143.5,710.26865 93.66427,685.43925 59.944546,635.27417 49.091119,569.81589 45.564448,548.54613 44.896177,538.57996 44.302569,498.40251 l -0.577652,-39.09749 3.262542,-0.65251 C 48.781856,458.29363 51.930943,458 53.985429,458 c 2.054486,0 5.80681,-0.28391 8.338499,-0.63092 l 4.60307,-0.63092 0.351946,-112.11908 c 0.344628,-109.788 0.396572,-112.35056 2.49836,-123.25247 3.620731,-18.78063 11.532895,-40.09048 19.333743,-52.07163 1.863924,-2.86275 5.188953,-8.03775 7.388953,-11.5 7.79959,-12.27457 36.2445,-39.28079 48.23634,-45.79663 1.52001,-0.82591 4.53711,-2.60324 6.70466,-3.94961 3.8264,-2.37677 20.61369,-9.567247 29.39316,-12.589943 2.38379,-0.820716 10.70879,-2.943341 18.5,-4.716943 L 213.5,87.517124 337.76602,87.23589 l 124.26603,-0.281233 5.23397,-3.308105 c 13.20871,-8.348491 40.90108,-22.879449 41.83076,-21.949767 0.53978,0.539776 4.22632,6.341317 8.19232,12.892313 L 524.5,86.5 l 12,0.686992 c 29.27474,1.675958 60.37169,10.419819 76.73855,21.577398 2.3438,1.59781 7.41145,4.93531 11.26145,7.41668 14.27043,9.19743 39.73244,35.97587 46.90128,49.32615 1.47457,2.74603 4.03295,7.05859 5.6853,9.58347 2.76021,4.21775 5.78435,11.74376 11.01376,27.40931 2.03257,6.08892 5.25119,21.67484 6.91801,33.5 0.52301,3.71048 0.93025,75.41061 0.94893,167.07191 L 696,563.64383 l -2.48256,14.65461 c -3.41235,20.14321 -12.20172,45.334 -18.88654,54.12987 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -6.19973,12.03624 -26.99616,34.05014 -44.08602,46.66691 -9.67257,7.14088 -33.84993,19.05836 -46,22.67429 -5.87476,1.74835 -30.10373,6.60429 -36.25168,7.2655 -4.81574,0.51794 -7.91655,1.65388 -13.5,4.94557 -14.08047,8.30104 -28.44463,15.57092 -45.5553,23.05608 -9.51884,4.16406 -17.39384,7.56909 -17.5,7.56671 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 C 568.93985,663.94472 610.01743,619.15347 623.03388,567.5 c 4.06757,-16.1414 5.32731,-28.40077 4.71411,-45.87606 C 626.45375,484.74009 613.18992,451.65879 584.99751,415 574.14965,400.89444 544.24396,371.6477 523.9021,355.25077 493.24694,330.54062 482.27103,316.397 481.21168,300.23963 c -0.43322,-6.60756 -0.19856,-7.8214 2.60988,-13.5 8.16394,-16.50732 31.12351,-36.21052 67.17844,-57.65048 7.425,-4.41526 14.00341,-8.37906 14.6187,-8.80845 0.74179,-0.51767 -9.73961,-18.5966 -31.10989,-53.66018 -17.72572,-29.08372 -33.02428,-53.93904 -33.99678,-55.23404 -0.97251,-1.29501 -2.30956,-3.0949 -2.97121,-3.99977 -1.08173,-1.47936 -2.12985,-1.13389 -10.39695,3.4269 -20.14323,11.11263 -43.46483,29.35755 -64.69928,50.61546 -12.30199,12.31557 -25.31708,27.06297 -26.53866,30.07093 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.05163,7.89186 -3.83587,9.59302 -1.98421,4.30408 -5.16352,18.37183 -6.42412,28.42529 -2.87589,22.9357 0.73982,56.71057 7.4671,69.75126 0.7747,1.50174 3.17159,6.87097 5.32643,11.93163 4.64575,10.9106 12.21854,23.82266 20.29862,34.61035 3.21801,4.29635 5.85092,8.22253 5.85092,8.72485 0,2.35959 31.18791,31.90518 46.97309,44.49952 62.44964,49.82604 73.78932,78.30488 43.20293,108.50117 -10.10357,9.9747 -24.57399,19.84954 -42.49972,29.00248 -6.9589,3.55324 -12.65789,6.73055 -12.66442,7.0607 -0.0167,0.8445 40.62043,87.00969 47.46833,100.64973 3.10639,6.1875 5.9048,11.25 6.21868,11.25 0.31388,0 8.94754,-4.31058 19.1859,-9.57906 z m -274.07218,-5.45762 c 17.32224,-1.22265 22.63423,-2.17093 34.68739,-6.1923 47.7222,-15.92185 83.346,-59.63009 95.02047,-116.58436 C 363.51085,549.71945 364,539.69886 364,477.41954 l 0,-59.36856 -7.10997,-10.77549 C 340.9684,383.14552 330.96787,357.92346 325.85384,329 c -1.77802,-10.05602 -1.79531,-47.00522 -0.0267,-57 5.07912,-28.70254 15.71159,-56.00428 31.80146,-81.65885 C 362.99595,181.78321 364,179.47669 364,175.7047 l 0,-4.47761 -4.25,-0.60959 C 351.86291,169.48623 251.06288,158 249.02225,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.6176,-12.00926 -10.89124,-30.86328 -11.62212,-66.93587 -0.52543,-25.93258 -0.55755,-26.24986 -2.65603,-26.23822 -1.89709,0.0105 -81.48268,6.19899 -100.792802,7.83751 -4.217754,0.35789 -7.963823,0.94678 -8.324599,1.30864 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 18.20693,12.2292 38.0906,18.99977 61.58445,20.97004 4.95,0.41513 9.36567,0.8189 9.81261,0.89728 0.44693,0.0784 7.42193,-0.324 15.5,-0.89418 z m 137.02713,-6.04222 c 14.14842,-12.69526 28.00832,-15.99644 34.20494,-8.14699 1.7537,2.22147 2.07223,3.69738 1.72134,7.97589 l -0.43057,5.25 18.43927,0 c 14.35445,0 18.32723,-0.27691 17.93355,-1.25 -0.70319,-1.73811 -48.85607,-104.20418 -49.08362,-104.44661 -0.1015,-0.10814 -1.88159,5.51148 -3.95576,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.16143,0 18.16144,0 5.66025,-5.0789 z m 27.554,0.8289 c -1.14801,-7.74586 -4.35934,-10.54271 -10.73068,-9.34571 -3.28061,0.61634 -16.74162,10.14794 -17.43523,12.34571 -0.30326,0.96092 2.9808,1.25 14.20065,1.25 l 14.59516,0 -0.6299,-4.25 z m 6.41068,-0.99103 c 0.25433,-3.96075 -0.1085,-5.15396 -2.20454,-7.25 C 396.98855,676.89764 394.96952,676 392.95656,676 l -3.13435,0 2.52834,3.00475 c 1.45144,1.72495 2.81887,4.94225 3.21047,7.55362 0.58506,3.90141 0.9851,4.50565 2.81056,4.24525 1.77671,-0.25345 2.17872,-1.08704 2.43284,-5.04465 z m 193.48542,-9.90375 c 15.26949,-7.77872 25.87719,-15.70037 38.80414,-28.97828 6.96825,-7.15743 10.24708,-11.59948 21.2739,-28.82113 6.03464,-9.42489 11.98848,-27.08741 15.04834,-44.64207 1.40166,-8.04144 1.58002,-27.53214 1.55106,-169.5 -0.0187,-91.62169 -0.42581,-163.20121 -0.94935,-166.91374 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.78274,-5.10301 -6.1399,-12.46374 -14.7318,-24.88703 -8.1023,-11.71537 -29.73324,-31.77156 -39.61946,-36.73512 -2.28629,-1.14787 -5.50689,-3.09395 -7.15689,-4.32461 -9.15158,-6.82575 -30.78886,-13.44411 -52.24953,-15.98196 l -5.24952,-0.62079 5.34269,8.78438 C 548.28213,125.54703 562.30249,148.625 576.5,172 c 14.19751,23.375 28.16006,46.35762 31.02788,51.0725 l 5.21422,8.5725 -17.92464,9.87246 c -19.70479,10.85293 -41.49325,24.21289 -54.12202,33.18583 C 530.20721,282.15534 515,296.97708 515,299.74741 c 0,3.42687 7.49659,11.84117 18.7605,21.0571 28.31138,23.16387 35.80534,29.72699 49.30432,43.18013 63.03498,62.82095 87.96669,130.42815 73.86111,200.2888 -4.67971,23.17718 -13.71937,44.82882 -27.64992,66.22656 -8.97788,13.79031 -15.70262,22.03821 -29.14795,35.75 -6.33692,6.4625 -11.19018,11.75 -10.78502,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z m 57.0506,-78.41043 c -0.32824,-0.85537 -0.10108,-2.54287 0.5048,-3.75 1.03776,-2.0676 1.06947,-2.04174 0.54715,0.44612 -0.80525,3.83554 1.34864,4.57261 4.4116,1.50965 1.81733,-1.81733 2.59601,-3.65832 2.59601,-6.13757 0,-2.96155 0.21963,-3.32193 1.3411,-2.20047 1.04426,1.04427 1.09591,1.98811 0.23338,4.26429 -2.30267,6.07663 -8.18022,9.65658 -9.63404,5.86798 z M 649.57472,460.3402 c -0.36254,-1.65064 -0.17972,-5.14056 0.40627,-7.75536 1.49792,-6.68403 0.29573,-14.39903 -2.71249,-17.40725 -2.00305,-2.00305 -3.10666,-2.32851 -6.39855,-1.88697 -5.71939,0.76713 -4.46866,-1.47663 1.68256,-3.01844 6.19456,-1.55268 11.51273,-0.2683 14.50025,3.50193 1.80997,2.28417 2.07653,3.61715 1.64496,8.22589 -0.56424,6.02561 -3.7515,15.12169 -6.6298,18.92069 l -1.83403,2.42069 -0.65917,-3.00118 z m 7.2125,-18.01783 c 0.39395,-4.5485 0.13587,-5.49019 -2.12394,-7.75 C 652.99439,432.90348 650.99005,432 648.95656,432 l -3.13435,0 2.52834,3.00475 c 2.7948,3.32144 4.18973,9.93048 3.37618,15.996 -0.28573,2.13023 -0.22863,4.16582 0.12688,4.52354 1.12467,1.13165 4.46674,-7.81145 4.93361,-13.20192 z M 564,344.69341 c 0,-0.16862 2.025,-2.4811 4.5,-5.13884 2.475,-2.65773 4.5,-4.29777 4.5,-3.64451 0,1.46187 7.64308,5.03794 10.8317,5.06798 4.96472,0.0468 16.4589,-12.18104 17.81259,-18.94949 0.85417,-4.27083 -2.10481,-11.45746 -5.97278,-14.50641 -1.74433,-1.37498 -2.62401,-2.50495 -1.95484,-2.51105 0.66916,-0.006 2.78317,1.55541 4.69778,3.47002 3.23447,3.23447 5.56678,8.58502 5.57997,12.80101 0.0103,3.29441 -2.81148,8.5641 -7.04552,13.15749 -4.88909,5.30403 -3.45163,5.99101 3.24897,1.55271 6.86282,-4.54574 10.13874,-9.91489 10.61523,-17.39812 0.35814,-5.62444 0.13575,-6.50153 -2.41797,-9.53646 -1.54681,-1.83829 -4.63101,-4.16842 -6.85376,-5.17808 -4.50046,-2.04427 -15.12409,-2.63153 -13.97516,-0.77253 0.4608,0.74559 -0.0121,0.88612 -1.44815,0.43034 -1.24223,-0.39427 -3.44954,-0.0197 -5.28756,0.8972 -1.73534,0.8657 -3.19461,1.45955 -3.24283,1.31967 -0.0482,-0.13989 -0.98767,-2.05045 -2.08767,-4.24569 -2.24721,-4.4847 -10.05776,-9.77668 -16.91035,-11.45748 l -4.08965,-1.00311 4.34177,0.50246 c 2.38797,0.27635 6.13901,1.41935 8.33565,2.53999 3.66749,1.87102 3.96625,1.89403 3.65572,0.28157 -0.18599,-0.96578 -2.5526,-2.89555 -5.25914,-4.28838 -6.31492,-3.24978 -19.87056,-3.76314 -22.01402,-0.8337 -0.70426,0.9625 -2.0407,1.75 -2.96988,1.75 -5.20185,0 -10.6768,5.57912 -15.22584,15.51553 -1.49345,3.26213 -2.90507,5.36203 -3.13693,4.66645 -0.23186,-0.69558 0.73189,-3.62227 2.14167,-6.50375 6.11324,-12.49502 16.54115,-19.68281 28.54072,-19.67265 3.62466,0.003 8.32489,0.48722 10.44498,1.07591 5.22866,1.45184 11.95949,7.89681 14.55983,13.94146 1.17759,2.73738 2.25841,4.97705 2.40183,4.97705 0.14341,0 2.02605,-0.9 4.18364,-2 7.0096,-3.5737 18.65379,-1.79075 24.8344,3.80262 5.19125,4.69802 6.34876,14.08899 2.67259,21.68295 -2.63987,5.45324 -9.7182,12.05524 -15.83132,14.76598 -6.16076,2.73186 -14.55699,2.75831 -20.00464,0.063 l -4.08027,-2.01875 -2.73247,2.85208 C 567.11473,344.48969 564,345.96936 564,344.69341 z M 419,563.73163 c 25.30736,-12.30406 39.2111,-21.80216 46.55012,-31.79991 3.23599,-4.40829 3.52414,-5.27994 2.61122,-7.89875 C 464.619,513.87141 449.53078,497.92381 422.96317,476.26044 413.35843,468.42868 403.3625,460.16935 400.75,457.90637 l -4.75,-4.1145 -0.004,37.85406 c -0.004,38.70043 -0.94715,58.73456 -3.53458,75.0933 -0.80374,5.08158 -1.46135,9.44432 -1.46135,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.65956,-52.28684 c -0.32824,-0.85537 -0.10108,-2.54287 0.5048,-3.75 1.03776,-2.0676 1.06947,-2.04174 0.54715,0.44612 -0.80525,3.83554 1.34864,4.57261 4.4116,1.50965 1.81733,-1.81733 2.59601,-3.65832 2.59601,-6.13757 0,-2.96155 0.21963,-3.32193 1.3411,-2.20047 1.04426,1.04427 1.09591,1.98811 0.23338,4.26429 -2.30267,6.07663 -8.18022,9.65658 -9.63404,5.86798 z M 153.11086,450.5 C 185.75665,448.025 212.5868,446 212.73342,446 212.88004,446 213,423.725 213,396.5 l 0,-49.5 -4.3185,0 c -7.62391,0 -14.35531,-2.67595 -19.6397,-7.80742 -6.21373,-6.03392 -7.91453,-12.6159 -6.25757,-24.2165 2.65734,-18.60447 12.15469,-31.49343 25.96577,-35.23846 l 4.25,-1.15243 0,-78.85998 c 0,-74.62119 0.0941,-78.83415 1.75,-78.37933 0.9625,0.26437 41.89275,4.89545 90.95611,10.29131 l 89.20611,9.81064 8.79389,-8.50521 C 408.54275,128.26475 415.65,121.63992 419.5,118.22078 l 7,-6.21662 -106,0.24792 -106,0.24792 -12.17888,2.77199 c -15.16197,3.45097 -28.06337,8.47318 -41.82112,16.27997 -15.31187,8.68867 -34.7248,26.75023 -43.7881,40.73994 -2.21207,3.41445 -5.49921,8.4581 -7.30475,11.2081 -3.88376,5.91532 -6.48578,11.78004 -10.648151,24 -6.241641,18.32432 -6.015784,13.56522 -6.442389,135.75 -0.234376,67.12801 -0.02512,111.75 0.524052,111.75 0.502823,0 27.624418,-2.025 60.270198,-4.5 z M 97.340438,391.44479 c -0.328235,-0.85537 -0.101073,-2.54287 0.504805,-3.75 1.037757,-2.0676 1.069465,-2.04174 0.54715,0.44612 -0.805257,3.83554 1.348635,4.57261 4.411597,1.50965 1.81733,-1.81733 2.59601,-3.65832 2.59601,-6.13757 0,-2.96155 0.21963,-3.32193 1.3411,-2.20047 1.04426,1.04427 1.09591,1.98811 0.23338,4.26429 -2.30267,6.07663 -8.180218,9.65658 -9.634042,5.86798 z M 135.27066,243.09925 c -4.13414,-1.93833 -8.29972,-7.0514 -8.22778,-10.09925 0.0195,-0.825 0.63542,-0.15 1.36876,1.5 3.59669,8.09238 13.3442,11.5821 22.31983,7.99077 3.30566,-1.32267 4.31069,-2.61237 8.13,-10.43287 7.25624,-14.85799 6.66763,-25.15838 -1.75935,-30.78797 -4.0296,-2.69194 -11.11546,-3.0329 -15.5009,-0.74588 -3.84309,2.00418 -4.38044,1.23404 -0.9963,-1.42792 3.91564,-3.08005 12.50339,-5.3493 17.09146,-4.5163 5.03668,0.91445 10.22679,3.60766 13.30362,6.90342 2.18519,2.34067 2.5,3.58068 2.5,9.84731 0,5.96594 -0.49806,8.15242 -2.96704,13.02522 -3.75583,7.41255 -9.48517,13.94587 -15.13147,17.25482 -6.05712,3.5497 -14.41649,4.16787 -20.13083,1.48865 z m 32.59705,-17.39987 c 2.69949,-5.18016 3.64182,-8.33764 3.95468,-13.25108 0.40585,-6.37376 0.36449,-6.49671 -3.47837,-10.33958 -3.56645,-3.56645 -9.16011,-6.08871 -13.535,-6.10314 -2.96052,-0.01 -2.93771,1.80724 0.0309,2.45925 3.35349,0.73655 8.58752,5.84179 10.09878,9.85027 1.78172,4.72588 1.20319,12.72446 -1.37362,18.99113 -3.47676,8.45527 -0.32817,7.27942 4.30266,-1.60685 z M 126.19495,228.5 c 0.0204,-1.65 0.2445,-2.20394 0.49804,-1.23097 0.25354,0.97297 0.23687,2.32297 -0.037,3 -0.27393,0.67703 -0.48137,-0.11903 -0.46099,-1.76903 z m 0.87254,-5.10078 c -0.0685,-2.13209 1.91721,-8.75208 2.45972,-8.20027 0.16278,0.16558 -0.30887,2.55105 -1.04813,5.30105 -0.73925,2.75 -1.37446,4.05465 -1.41159,2.89922 z M 134,206.62244 c 0,-0.20765 0.7875,-0.99515 1.75,-1.75 1.58606,-1.24387 1.62143,-1.2085 0.37756,0.37756 C 134.82119,206.91575 134,207.44548 134,206.62244 z m 79,106.35851 0,-32.01905 -2.75,0.63899 c -1.5125,0.35144 -3.24961,1.26002 -3.86024,2.01905 -0.61064,0.75903 -2.00659,1.38006 -3.10212,1.38006 -5.51602,0 -13.6223,9.84542 -16.87878,20.5 -2.16539,7.08476 -2.86527,18.17352 -1.47102,23.30667 2.44468,9.00047 12.5879,16.02358 23.31216,16.14122 L 213,345 l 0,-32.01905 z"
+       id="path3338"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#253034"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 C 230.77077,731.78039 180.24956,728.57821 143.5,710.26865 93.66427,685.43925 59.944546,635.27417 49.091119,569.81589 45.564448,548.54613 44.896177,538.57996 44.302569,498.40251 l -0.577652,-39.09749 3.262542,-0.65251 C 48.781856,458.29363 51.930943,458 53.985429,458 c 2.054486,0 5.80681,-0.28391 8.338499,-0.63092 l 4.60307,-0.63092 0.351946,-112.11908 c 0.344628,-109.788 0.396572,-112.35056 2.49836,-123.25247 3.620731,-18.78063 11.532895,-40.09048 19.333743,-52.07163 1.863924,-2.86275 5.188953,-8.03775 7.388953,-11.5 7.79959,-12.27457 36.2445,-39.28079 48.23634,-45.79663 1.52001,-0.82591 4.53711,-2.60324 6.70466,-3.94961 3.8264,-2.37677 20.61369,-9.567247 29.39316,-12.589943 2.38379,-0.820716 10.70879,-2.943341 18.5,-4.716943 L 213.5,87.517124 337.76602,87.23589 l 124.26603,-0.281233 5.23397,-3.308105 c 13.20871,-8.348491 40.90108,-22.879449 41.83076,-21.949767 0.53978,0.539776 4.22632,6.341317 8.19232,12.892313 L 524.5,86.5 l 12,0.686992 c 29.27474,1.675958 60.37169,10.419819 76.73855,21.577398 2.3438,1.59781 7.41145,4.93531 11.26145,7.41668 14.27043,9.19743 39.73244,35.97587 46.90128,49.32615 1.47457,2.74603 4.03295,7.05859 5.6853,9.58347 2.76021,4.21775 5.78435,11.74376 11.01376,27.40931 2.03257,6.08892 5.25119,21.67484 6.91801,33.5 0.52301,3.71048 0.93025,75.41061 0.94893,167.07191 L 696,563.64383 l -2.48256,14.65461 c -3.41235,20.14321 -12.20172,45.334 -18.88654,54.12987 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -6.19973,12.03624 -26.99616,34.05014 -44.08602,46.66691 -9.67257,7.14088 -33.84993,19.05836 -46,22.67429 -5.87476,1.74835 -30.10373,6.60429 -36.25168,7.2655 -4.81574,0.51794 -7.91655,1.65388 -13.5,4.94557 -14.08047,8.30104 -28.44463,15.57092 -45.5553,23.05608 -9.51884,4.16406 -17.39384,7.56909 -17.5,7.56671 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 c 81.41129,-41.89285 124.07704,-100.1967 124.10931,-169.59858 0.007,-14.80396 -1.16659,-24.49345 -4.64006,-38.31344 -11.46466,-45.61467 -43.73754,-89.16559 -99.4666,-134.22609 -30.69665,-24.82019 -41.61775,-38.90622 -42.67576,-55.0432 -0.43291,-6.60278 -0.19716,-7.8255 2.60296,-13.5 8.19418,-16.60567 32.17133,-36.97244 69.34754,-58.90549 l 13.66219,-8.06035 -9.24378,-15.1369 C 552.49651,196.3116 537.80791,172.175 524.93926,151 512.0706,129.825 500.97837,111.825 500.28984,111 c -0.68853,-0.825 -1.85689,-2.34223 -2.59637,-3.37162 -1.28403,-1.78744 -1.70088,-1.6783 -9.26898,2.42691 -20.4464,11.09084 -43.35668,28.86483 -64.99861,50.4265 -13.09405,13.04549 -26.23701,27.85914 -27.51995,31.01821 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.05163,7.89186 -3.83587,9.59302 -1.98421,4.30408 -5.16352,18.37183 -6.42412,28.42529 -2.87589,22.9357 0.73982,56.71057 7.4671,69.75126 0.7747,1.50174 3.17159,6.87097 5.32643,11.93163 4.64575,10.9106 12.21854,23.82266 20.29862,34.61035 3.21801,4.29635 5.85092,8.24217 5.85092,8.76849 0,2.37078 31.06193,31.77521 46.98159,44.47459 62.447,49.81506 73.78263,78.28439 43.19443,108.48246 -10.10357,9.9747 -24.57399,19.84954 -42.49972,29.00248 -6.9589,3.55324 -12.65789,6.76233 -12.66442,7.13131 -0.0168,0.95027 39.55594,84.82288 46.98341,99.57912 3.39128,6.7375 6.41534,12.25 6.72013,12.25 0.30479,0 8.93101,-4.31058 19.16937,-9.57906 z M 241,690.95621 c 26.57591,-2.53536 52.9647,-15.79258 74.57472,-37.4649 23.84518,-23.91392 38.54897,-53.46596 45.52203,-91.49131 2.20963,-12.04951 2.30556,-14.86516 2.66185,-78.12724 l 0.36962,-65.62723 -7.17408,-10.87277 C 340.96551,383.141 330.97536,357.96582 325.85384,329 c -1.77802,-10.05602 -1.79531,-47.00522 -0.0267,-57 5.07912,-28.70254 15.71159,-56.00428 31.80146,-81.65885 5.39575,-8.60322 6.3714,-10.8525 6.3714,-14.68872 l 0,-4.52988 -4.25,-0.58798 C 350.16424,169.20841 251.37811,158 249.27569,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.59413,-11.97227 -10.8557,-30.76511 -11.61695,-66.93587 l -0.55245,-26.25 -2.61646,0.0206 c -2.3354,0.0184 -80.91762,6.14357 -100.285092,7.81688 -4.217754,0.3644 -7.963823,0.95862 -8.324599,1.32048 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.41306,2.82689 29.47154,3.07983 51.95582,0.93481 z m 125.83974,-5.03511 c 14.14842,-12.69526 28.00832,-15.99644 34.20494,-8.14699 1.7537,2.22147 2.07223,3.69738 1.72134,7.97589 l -0.43057,5.25 18.43927,0 c 14.35264,0 18.32793,-0.27703 17.93694,-1.25 -0.69017,-1.71745 -48.85319,-104.20156 -49.08531,-104.44661 -0.10244,-0.10814 -1.88329,5.51148 -3.95746,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.16143,0 18.16144,0 5.66025,-5.0789 z m 27.554,0.8289 c -1.14801,-7.74586 -4.35934,-10.54271 -10.73068,-9.34571 -3.28061,0.61634 -16.74162,10.14794 -17.43523,12.34571 -0.30326,0.96092 2.9808,1.25 14.20065,1.25 l 14.59516,0 -0.6299,-4.25 z m 6.41068,-0.99103 c 0.25433,-3.96075 -0.1085,-5.15396 -2.20454,-7.25 C 396.98855,676.89764 394.96952,676 392.95656,676 l -3.13435,0 2.52834,3.00475 c 1.45144,1.72495 2.81887,4.94225 3.21047,7.55362 0.58506,3.90141 0.9851,4.50565 2.81056,4.24525 1.77671,-0.25345 2.17872,-1.08704 2.43284,-5.04465 z m 193.48542,-9.90375 c 21.39443,-10.89894 41.08683,-28.05169 52.16324,-45.43596 2.42474,-3.80559 6.06778,-9.50339 8.09565,-12.66178 5.8205,-9.06537 11.86774,-27.044 14.8863,-44.25748 1.39488,-7.95434 1.57367,-27.64766 1.53889,-169.5 -0.0225,-91.6332 -0.43266,-163.289 -0.95599,-167 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.76906,-5.06383 -5.96921,-12.17399 -14.7318,-24.93847 -8.02805,-11.69448 -27.09265,-29.4385 -39.46861,-36.73468 -3.08574,-1.81918 -7.63237,-4.56004 -10.10362,-6.09081 -9.36945,-5.80372 -30.90044,-11.97074 -49.45365,-14.16476 l -5.24952,-0.62079 5.64798,9.28438 c 3.10639,5.10641 17.66167,29.08438 32.34506,53.28438 14.68339,24.2 28.5123,46.95672 30.7309,50.5705 l 4.03382,6.5705 -16.12936,8.86762 c -38.989,21.43544 -62.98705,37.6347 -75.37935,50.88289 -3.4375,3.67491 -6.25,7.52479 -6.25,8.55528 0,3.2376 7.7335,11.83562 18.7605,20.85772 28.31138,23.16387 35.80534,29.72699 49.30432,43.18013 62.92851,62.71484 87.96118,130.68852 73.84379,200.51536 -5.6127,27.76131 -20.4186,58.71502 -39.70089,83 -3.0569,3.85 -10.74275,12.2875 -17.07966,18.75 -6.33692,6.4625 -11.19018,11.75 -10.78502,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z m 57.0506,-78.41043 c -0.32824,-0.85537 -0.10108,-2.54287 0.5048,-3.75 1.03776,-2.0676 1.06947,-2.04174 0.54715,0.44612 -0.80525,3.83554 1.34864,4.57261 4.4116,1.50965 1.81733,-1.81733 2.59601,-3.65832 2.59601,-6.13757 0,-2.96155 0.21963,-3.32193 1.3411,-2.20047 1.04426,1.04427 1.09591,1.98811 0.23338,4.26429 -2.30267,6.07663 -8.18022,9.65658 -9.63404,5.86798 z M 649.57472,460.3402 c -0.36254,-1.65064 -0.17972,-5.14056 0.40627,-7.75536 1.49792,-6.68403 0.29573,-14.39903 -2.71249,-17.40725 -2.00305,-2.00305 -3.10666,-2.32851 -6.39855,-1.88697 -5.71939,0.76713 -4.46866,-1.47663 1.68256,-3.01844 6.19456,-1.55268 11.51273,-0.2683 14.50025,3.50193 1.80997,2.28417 2.07653,3.61715 1.64496,8.22589 -0.56424,6.02561 -3.7515,15.12169 -6.6298,18.92069 l -1.83403,2.42069 -0.65917,-3.00118 z m 7.2125,-18.01783 c 0.39395,-4.5485 0.13587,-5.49019 -2.12394,-7.75 C 652.99439,432.90348 650.99005,432 648.95656,432 l -3.13435,0 2.52834,3.00475 c 2.7948,3.32144 4.18973,9.93048 3.37618,15.996 -0.28573,2.13023 -0.22863,4.16582 0.12688,4.52354 1.12467,1.13165 4.46674,-7.81145 4.93361,-13.20192 z M 564,344.69341 c 0,-0.16862 2.025,-2.4811 4.5,-5.13884 2.475,-2.65773 4.5,-4.29777 4.5,-3.64451 0,1.46187 7.64308,5.03794 10.8317,5.06798 4.96472,0.0468 16.4589,-12.18104 17.81259,-18.94949 0.85417,-4.27083 -2.10481,-11.45746 -5.97278,-14.50641 -1.74433,-1.37498 -2.62401,-2.50495 -1.95484,-2.51105 0.66916,-0.006 2.78317,1.55541 4.69778,3.47002 3.23447,3.23447 5.56678,8.58502 5.57997,12.80101 0.0103,3.29441 -2.81148,8.5641 -7.04552,13.15749 -4.88909,5.30403 -3.45163,5.99101 3.24897,1.55271 6.86282,-4.54574 10.13874,-9.91489 10.61523,-17.39812 0.35814,-5.62444 0.13575,-6.50153 -2.41797,-9.53646 -1.54681,-1.83829 -4.63101,-4.16842 -6.85376,-5.17808 -4.50046,-2.04427 -15.12409,-2.63153 -13.97516,-0.77253 0.4608,0.74559 -0.0121,0.88612 -1.44815,0.43034 -1.24223,-0.39427 -3.44954,-0.0197 -5.28756,0.8972 -1.73534,0.8657 -3.19461,1.45955 -3.24283,1.31967 -0.0482,-0.13989 -0.98767,-2.05045 -2.08767,-4.24569 -2.24721,-4.4847 -10.05776,-9.77668 -16.91035,-11.45748 l -4.08965,-1.00311 4.34177,0.50246 c 2.38797,0.27635 6.13901,1.41935 8.33565,2.53999 3.66749,1.87102 3.96625,1.89403 3.65572,0.28157 -0.18599,-0.96578 -2.5526,-2.89555 -5.25914,-4.28838 -6.31492,-3.24978 -19.87056,-3.76314 -22.01402,-0.8337 -0.70426,0.9625 -2.0407,1.75 -2.96988,1.75 -5.20185,0 -10.6768,5.57912 -15.22584,15.51553 -1.49345,3.26213 -2.90507,5.36203 -3.13693,4.66645 -0.23186,-0.69558 0.73189,-3.62227 2.14167,-6.50375 6.11324,-12.49502 16.54115,-19.68281 28.54072,-19.67265 3.62466,0.003 8.32489,0.48722 10.44498,1.07591 5.22866,1.45184 11.95949,7.89681 14.55983,13.94146 1.17759,2.73738 2.25841,4.97705 2.40183,4.97705 0.14341,0 2.02605,-0.9 4.18364,-2 7.0096,-3.5737 18.65379,-1.79075 24.8344,3.80262 5.19125,4.69802 6.34876,14.08899 2.67259,21.68295 -2.63987,5.45324 -9.7182,12.05524 -15.83132,14.76598 -6.16076,2.73186 -14.55699,2.75831 -20.00464,0.063 l -4.08027,-2.01875 -2.73247,2.85208 C 567.11473,344.48969 564,345.96936 564,344.69341 z M 419,563.73163 c 25.31787,-12.30917 39.21066,-21.80156 46.55886,-31.81181 4.31302,-5.87551 4.21103,-6.80845 -1.73372,-15.85948 C 457.8325,506.93639 443.31415,492.78122 423,476.25645 c -9.625,-7.82956 -19.6375,-16.0871 -22.25,-18.35008 l -4.75,-4.1145 -0.01,37.35406 c -0.0102,38.62782 -0.99044,59.66907 -3.52156,75.5933 -0.8077,5.08158 -1.46855,9.44432 -1.46855,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.65956,-52.28684 c -0.32824,-0.85537 -0.10108,-2.54287 0.5048,-3.75 1.03776,-2.0676 1.06947,-2.04174 0.54715,0.44612 -0.80525,3.83554 1.34864,4.57261 4.4116,1.50965 1.81733,-1.81733 2.59601,-3.65832 2.59601,-6.13757 0,-2.96155 0.21963,-3.32193 1.3411,-2.20047 1.04426,1.04427 1.09591,1.98811 0.23338,4.26429 -2.30267,6.07663 -8.18022,9.65658 -9.63404,5.86798 z M 153.5,450.49366 c 32.45,-2.47066 59.1125,-4.49246 59.25,-4.49288 C 212.8875,446.00035 213,423.725 213,396.5 l 0,-49.5 -4.3185,0 c -7.62391,0 -14.35531,-2.67595 -19.6397,-7.80742 -6.21373,-6.03392 -7.91453,-12.6159 -6.25757,-24.2165 2.65734,-18.60447 12.15469,-31.49343 25.96577,-35.23846 l 4.25,-1.15243 0,-78.72972 0,-78.72973 3.25,0.47587 C 223.59967,122.67775 390.2813,141 392.7215,141 c 1.96178,0 4.86887,-2.14693 11.21343,-8.2813 4.71079,-4.55472 11.71507,-11.07878 15.56507,-14.49792 l 7,-6.21662 -106,0.24792 -106,0.24792 -12.17888,2.77199 C 191.03894,117.83989 180.03879,121.6936 169,126.94545 149.80162,136.07935 127.87612,155.0389 116.89735,172 c -2.31407,3.575 -5.68466,8.75 -7.4902,11.5 -5.63522,8.58294 -12.48361,26.82184 -15.207052,40.5 -2.086783,10.48062 -3.028934,231.00417 -0.986879,230.99289 0.707729,-0.004 27.836781,-2.02856 60.286781,-4.49923 z M 97.340438,391.44479 c -0.328235,-0.85537 -0.101073,-2.54287 0.504805,-3.75 1.037757,-2.0676 1.069465,-2.04174 0.54715,0.44612 -0.805257,3.83554 1.348635,4.57261 4.411597,1.50965 1.81733,-1.81733 2.59601,-3.65832 2.59601,-6.13757 0,-2.96155 0.21963,-3.32193 1.3411,-2.20047 1.04426,1.04427 1.09591,1.98811 0.23338,4.26429 -2.30267,6.07663 -8.180218,9.65658 -9.634042,5.86798 z M 135.27066,243.09925 c -4.13414,-1.93833 -8.29972,-7.0514 -8.22778,-10.09925 0.0195,-0.825 0.63542,-0.15 1.36876,1.5 3.59669,8.09238 13.3442,11.5821 22.31983,7.99077 3.30566,-1.32267 4.31069,-2.61237 8.13,-10.43287 7.25624,-14.85799 6.66763,-25.15838 -1.75935,-30.78797 -4.0296,-2.69194 -11.11546,-3.0329 -15.5009,-0.74588 -3.84309,2.00418 -4.38044,1.23404 -0.9963,-1.42792 3.91564,-3.08005 12.50339,-5.3493 17.09146,-4.5163 5.03668,0.91445 10.22679,3.60766 13.30362,6.90342 2.18519,2.34067 2.5,3.58068 2.5,9.84731 0,5.96594 -0.49806,8.15242 -2.96704,13.02522 -3.75583,7.41255 -9.48517,13.94587 -15.13147,17.25482 -6.05712,3.5497 -14.41649,4.16787 -20.13083,1.48865 z m 32.59705,-17.39987 c 2.69949,-5.18016 3.64182,-8.33764 3.95468,-13.25108 0.40585,-6.37376 0.36449,-6.49671 -3.47837,-10.33958 -3.56645,-3.56645 -9.16011,-6.08871 -13.535,-6.10314 -2.96052,-0.01 -2.93771,1.80724 0.0309,2.45925 3.35349,0.73655 8.58752,5.84179 10.09878,9.85027 1.78172,4.72588 1.20319,12.72446 -1.37362,18.99113 -3.47676,8.45527 -0.32817,7.27942 4.30266,-1.60685 z M 126.19495,228.5 c 0.0204,-1.65 0.2445,-2.20394 0.49804,-1.23097 0.25354,0.97297 0.23687,2.32297 -0.037,3 -0.27393,0.67703 -0.48137,-0.11903 -0.46099,-1.76903 z m 0.87254,-5.10078 c -0.0685,-2.13209 1.91721,-8.75208 2.45972,-8.20027 0.16278,0.16558 -0.30887,2.55105 -1.04813,5.30105 -0.73925,2.75 -1.37446,4.05465 -1.41159,2.89922 z M 134,206.62244 c 0,-0.20765 0.7875,-0.99515 1.75,-1.75 1.58606,-1.24387 1.62143,-1.2085 0.37756,0.37756 C 134.82119,206.91575 134,207.44548 134,206.62244 z m 79,106.35851 0,-32.01905 -2.75,0.63899 c -1.5125,0.35144 -3.24961,1.26002 -3.86024,2.01905 -0.61064,0.75903 -2.00659,1.38006 -3.10212,1.38006 -5.51602,0 -13.6223,9.84542 -16.87878,20.5 -2.16539,7.08476 -2.86527,18.17352 -1.47102,23.30667 2.44468,9.00047 12.5879,16.02358 23.31216,16.14122 L 213,345 l 0,-32.01905 z"
+       id="path3336"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#242e34"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 C 230.77077,731.78039 180.24956,728.57821 143.5,710.26865 93.66427,685.43925 59.944546,635.27417 49.091119,569.81589 45.564448,548.54613 44.896177,538.57996 44.302569,498.40251 l -0.577652,-39.09749 3.262542,-0.65251 C 48.781856,458.29363 51.930943,458 53.985429,458 c 2.054486,0 5.80681,-0.28391 8.338499,-0.63092 l 4.60307,-0.63092 0.351946,-112.11908 c 0.344628,-109.788 0.396572,-112.35056 2.49836,-123.25247 3.620731,-18.78063 11.532895,-40.09048 19.333743,-52.07163 1.863924,-2.86275 5.188953,-8.03775 7.388953,-11.5 7.79959,-12.27457 36.2445,-39.28079 48.23634,-45.79663 1.52001,-0.82591 4.53711,-2.60324 6.70466,-3.94961 3.8264,-2.37677 20.61369,-9.567247 29.39316,-12.589943 2.38379,-0.820716 10.70879,-2.943341 18.5,-4.716943 L 213.5,87.517124 337.76602,87.23589 l 124.26603,-0.281233 5.23397,-3.308105 c 13.20871,-8.348491 40.90108,-22.879449 41.83076,-21.949767 0.53978,0.539776 4.22632,6.341317 8.19232,12.892313 L 524.5,86.5 l 12,0.686992 c 29.27474,1.675958 60.37169,10.419819 76.73855,21.577398 2.3438,1.59781 7.41145,4.93531 11.26145,7.41668 14.27043,9.19743 39.73244,35.97587 46.90128,49.32615 1.47457,2.74603 4.03295,7.05859 5.6853,9.58347 2.76021,4.21775 5.78435,11.74376 11.01376,27.40931 2.03257,6.08892 5.25119,21.67484 6.91801,33.5 0.52301,3.71048 0.93025,75.41061 0.94893,167.07191 L 696,563.64383 l -2.48256,14.65461 c -3.41235,20.14321 -12.20172,45.334 -18.88654,54.12987 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -6.19973,12.03624 -26.99616,34.05014 -44.08602,46.66691 -9.67257,7.14088 -33.84993,19.05836 -46,22.67429 -5.87476,1.74835 -30.10373,6.60429 -36.25168,7.2655 -4.81574,0.51794 -7.91655,1.65388 -13.5,4.94557 -14.08047,8.30104 -28.44463,15.57092 -45.5553,23.05608 -9.51884,4.16406 -17.39384,7.56909 -17.5,7.56671 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 c 81.41129,-41.89285 124.07704,-100.1967 124.10931,-169.59858 0.007,-14.80396 -1.16659,-24.49345 -4.64006,-38.31344 -11.46466,-45.61467 -43.73754,-89.16559 -99.4666,-134.22609 -30.69665,-24.82019 -41.61775,-38.90622 -42.67576,-55.0432 -0.43291,-6.60278 -0.19716,-7.8255 2.60296,-13.5 8.19418,-16.60567 32.17133,-36.97244 69.34754,-58.90549 l 13.66219,-8.06035 -9.24378,-15.1369 C 552.49651,196.3116 537.80791,172.175 524.93926,151 512.0706,129.825 500.97837,111.825 500.28984,111 c -0.68853,-0.825 -1.85689,-2.34223 -2.59637,-3.37162 -1.28403,-1.78744 -1.70088,-1.6783 -9.26898,2.42691 -20.4464,11.09084 -43.35668,28.86483 -64.99861,50.4265 -13.09405,13.04549 -26.23701,27.85914 -27.51995,31.01821 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.05163,7.89186 -3.83587,9.59302 -1.98421,4.30408 -5.16352,18.37183 -6.42412,28.42529 -2.87589,22.9357 0.73982,56.71057 7.4671,69.75126 0.7747,1.50174 3.17159,6.87097 5.32643,11.93163 4.64575,10.9106 12.21854,23.82266 20.29862,34.61035 3.21801,4.29635 5.85092,8.24217 5.85092,8.76849 0,2.37078 31.06193,31.77521 46.98159,44.47459 62.447,49.81506 73.78263,78.28439 43.19443,108.48246 -10.10357,9.9747 -24.57399,19.84954 -42.49972,29.00248 -6.9589,3.55324 -12.65789,6.76233 -12.66442,7.13131 -0.0168,0.95027 39.55594,84.82288 46.98341,99.57912 3.39128,6.7375 6.41534,12.25 6.72013,12.25 0.30479,0 8.93101,-4.31058 19.16937,-9.57906 z M 241,690.95621 c 26.57591,-2.53536 52.9647,-15.79258 74.57472,-37.4649 23.84518,-23.91392 38.54897,-53.46596 45.52203,-91.49131 2.20963,-12.04951 2.30556,-14.86516 2.66185,-78.12724 l 0.36962,-65.62723 -7.17408,-10.87277 C 340.96551,383.141 330.97536,357.96582 325.85384,329 c -1.77802,-10.05602 -1.79531,-47.00522 -0.0267,-57 5.07912,-28.70254 15.71159,-56.00428 31.80146,-81.65885 5.39575,-8.60322 6.3714,-10.8525 6.3714,-14.68872 l 0,-4.52988 -4.25,-0.58798 C 350.16424,169.20841 251.37811,158 249.27569,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.59413,-11.97227 -10.8557,-30.76511 -11.61695,-66.93587 l -0.55245,-26.25 -2.61646,0.0206 c -2.3354,0.0184 -80.91762,6.14357 -100.285092,7.81688 -4.217754,0.3644 -7.963823,0.95862 -8.324599,1.32048 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.41306,2.82689 29.47154,3.07983 51.95582,0.93481 z m 127.03765,-5.8507 c 8.82138,-7.61121 16.36525,-11.33628 22.95776,-11.33628 8.64715,0 12.73428,4.56945 11.61061,12.98077 l -0.56776,4.25 18.58786,0 c 14.47152,0 18.47662,-0.27682 18.08554,-1.25 -0.69017,-1.71745 -48.85319,-104.20156 -49.08531,-104.44661 -0.10244,-0.10814 -1.88329,5.51148 -3.95746,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.17465,0 18.17465,0 6.83173,-5.89449 z M 394.4918,686.75 c -0.3762,-2.3375 -1.34246,-5.375 -2.14725,-6.75 l -1.46325,-2.5 2.00454,2.2931 c 1.1025,1.2612 2.30892,4.32283 2.68093,6.80361 0.57942,3.86381 0.98157,4.46699 2.80481,4.20691 1.77671,-0.25345 2.17872,-1.08704 2.43284,-5.04465 0.25433,-3.96075 -0.1085,-5.15396 -2.20454,-7.25 -2.3999,-2.3999 -8.59988,-3.61264 -8.59988,-1.68216 0,0.45474 -1.31981,0.6331 -2.93292,0.39634 -1.81515,-0.2664 -4.72686,0.46547 -7.64004,1.92039 C 374.47928,681.61457 366,688.52418 366,690.08499 366,690.59652 372.43258,691 380.5879,691 l 14.5879,0 -0.684,-4.25 z m 199.79804,-10.89478 c 21.39443,-10.89894 41.08683,-28.05169 52.16324,-45.43596 2.42474,-3.80559 6.06778,-9.50339 8.09565,-12.66178 5.8205,-9.06537 11.86774,-27.044 14.8863,-44.25748 1.39488,-7.95434 1.57367,-27.64766 1.53889,-169.5 -0.0225,-91.6332 -0.43266,-163.289 -0.95599,-167 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.76906,-5.06383 -5.96921,-12.17399 -14.7318,-24.93847 -8.02805,-11.69448 -27.09265,-29.4385 -39.46861,-36.73468 -3.08574,-1.81918 -7.63237,-4.56004 -10.10362,-6.09081 -9.36945,-5.80372 -30.90044,-11.97074 -49.45365,-14.16476 l -5.24952,-0.62079 5.64798,9.28438 c 3.10639,5.10641 17.66167,29.08438 32.34506,53.28438 14.68339,24.2 28.5123,46.95672 30.7309,50.5705 l 4.03382,6.5705 -16.12936,8.86762 c -38.989,21.43544 -62.98705,37.6347 -75.37935,50.88289 -3.4375,3.67491 -6.25,7.52479 -6.25,8.55528 0,3.2376 7.7335,11.83562 18.7605,20.85772 28.31138,23.16387 35.80534,29.72699 49.30432,43.18013 62.92851,62.71484 87.96118,130.68852 73.84379,200.51536 -5.6127,27.76131 -20.4186,58.71502 -39.70089,83 -3.0569,3.85 -10.74275,12.2875 -17.07966,18.75 -6.33692,6.4625 -11.19018,11.75 -10.78502,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z m 57.0506,-78.41043 c -0.32824,-0.85537 -0.10108,-2.54287 0.5048,-3.75 1.03776,-2.0676 1.06947,-2.04174 0.54715,0.44612 -0.60508,2.88207 0.56967,4.19461 2.94013,3.28498 2.2116,-0.84866 4.90353,-7.1068 4.11953,-9.57697 -0.44716,-1.40889 -0.30218,-1.87433 0.44082,-1.41513 2.19699,1.35782 1.20578,6.6214 -1.81595,9.64313 -3.2269,3.22691 -5.82097,3.75364 -6.73648,1.36787 z m -1.72056,-136.82318 c -0.32832,-1.30811 -0.12054,-4.95545 0.46172,-8.10519 1.17056,-6.33213 0.50175,-12.69139 -1.73705,-16.51642 l -1.46325,-2.5 2.00454,2.2931 c 2.39834,2.74358 3.59717,9.66631 2.74747,15.86551 -0.82963,6.05286 1.15943,5.35421 3.47341,-1.22002 2.61773,-7.4372 2.42238,-13.0004 -0.56127,-15.98404 -2.30241,-2.30242 -8.54081,-3.54632 -8.54864,-1.70455 -0.002,0.4125 -2.03076,0.76203 -4.50891,0.77674 -2.64433,0.0157 -4.36696,-0.39742 -4.16982,-1 0.57392,-1.75425 9.25034,-3.41346 13.19616,-2.52353 7.63528,1.72204 9.87867,7.16615 7.08849,17.20189 -1.51559,5.45128 -6.107,15.7949 -7.01117,15.7949 -0.20611,0 -0.64337,-1.07028 -0.97168,-2.37839 z m -81.55843,-120.46549 4.17242,-4.84388 2.4784,2.2969 c 1.38839,1.28672 4.41807,2.58778 6.8887,2.95827 3.81866,0.57265 4.88481,0.29944 7.94741,-2.03652 5.20353,-3.96892 11.28199,-12.10975 12.03368,-16.1166 0.86718,-4.6225 -1.81576,-11.59171 -5.73063,-14.88585 C 594.19874,306.1378 593.31608,305 593.88994,305 c 0.57387,0 2.6099,1.5665 4.52451,3.48111 3.23447,3.23447 5.56678,8.58502 5.57997,12.80101 0.0103,3.29441 -2.81148,8.5641 -7.04552,13.15749 -3.57619,3.87971 -3.89949,4.56039 -2.16606,4.56039 3.27814,0 11.7422,-7.38742 14.14063,-12.3419 6.18226,-12.77086 -0.22657,-23.57321 -14.52575,-24.48372 -4.26041,-0.27128 -8.09521,0.15063 -11.50444,1.26574 -2.81262,0.91995 -5.17672,1.53478 -5.25356,1.36626 -2.91199,-6.38564 -9.56182,-11.79422 -17.50989,-14.24151 -2.54641,-0.78406 -3.72983,-1.44623 -2.62983,-1.47148 1.1,-0.0253 4.7,1.06632 8,2.42571 3.3,1.3594 6.12833,2.47372 6.28518,2.47627 0.15685,0.003 -0.21913,-0.9377 -0.83552,-2.08943 -2.02055,-3.77543 -9.52067,-6.31687 -18.78027,-6.36376 -6.47845,-0.0328 -8.59061,0.31007 -9.5,1.54218 -0.64317,0.87139 -2.50913,1.91813 -4.1466,2.32607 -5.16099,1.28578 -11.36359,9.1696 -15.01872,19.08957 -0.48788,1.3241 -0.89937,1.56359 -1.21761,0.70865 -0.81931,-2.20102 4.83083,-12.37857 9.41944,-16.96718 6.21959,-6.21959 13.17976,-9.21955 21.41837,-9.2317 12.13739,-0.0179 20.52107,5.08919 24.84173,15.13283 1.14928,2.67157 2.20694,4.8574 2.35036,4.8574 0.14341,0 2.02605,-0.9 4.18364,-2 8.47354,-4.32006 21.7333,-0.96546 27.03739,6.84022 5.1684,7.60598 2.55393,19.13381 -6.16147,27.16739 -8.77226,8.08598 -20.65886,10.65299 -29.05774,6.27525 l -3.90912,-2.03755 -3.22031,2.87735 c -5.05972,4.52085 -5.72129,3.36676 -1.1273,-1.96654 z M 419,563.73163 c 25.31787,-12.30917 39.21066,-21.80156 46.55886,-31.81181 4.31302,-5.87551 4.21103,-6.80845 -1.73372,-15.85948 C 457.8325,506.93639 443.31415,492.78122 423,476.25645 c -9.625,-7.82956 -19.6375,-16.0871 -22.25,-18.35008 l -4.75,-4.1145 -0.01,37.35406 c -0.0102,38.62782 -0.99044,59.66907 -3.52156,75.5933 -0.8077,5.08158 -1.46855,9.44432 -1.46855,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.65956,-52.28684 c -0.32824,-0.85537 -0.10108,-2.54287 0.5048,-3.75 1.03776,-2.0676 1.06947,-2.04174 0.54715,0.44612 -0.60508,2.88207 0.56967,4.19461 2.94013,3.28498 2.2116,-0.84866 4.90353,-7.1068 4.11953,-9.57697 -0.44716,-1.40889 -0.30218,-1.87433 0.44082,-1.41513 2.19699,1.35782 1.20578,6.6214 -1.81595,9.64313 -3.2269,3.22691 -5.82097,3.75364 -6.73648,1.36787 z M 153.5,450.49366 c 32.45,-2.47066 59.1125,-4.49246 59.25,-4.49288 0.1375,-4.3e-4 0.25,-22.21417 0.25,-49.36387 l 0,-49.36309 -6.26949,-0.50325 c -11.28028,-0.90548 -21.67795,-8.22705 -23.43119,-16.49919 -1.36225,-6.4274 -0.67128,-17.68813 1.53008,-24.93563 3.79804,-12.50423 13.3925,-22.79802 23.85815,-25.59716 l 4.31245,-1.1534 0,-78.72972 0,-78.72973 3.25,0.47587 C 223.59967,122.67775 390.2813,141 392.7215,141 c 1.96178,0 4.86887,-2.14693 11.21343,-8.2813 4.71079,-4.55472 11.71507,-11.07878 15.56507,-14.49792 l 7,-6.21662 -106,0.24792 -106,0.24792 -12.17888,2.77199 C 191.03894,117.83989 180.03879,121.6936 169,126.94545 149.80162,136.07935 127.87612,155.0389 116.89735,172 c -2.31407,3.575 -5.68466,8.75 -7.4902,11.5 -5.63522,8.58294 -12.48361,26.82184 -15.207052,40.5 -2.086783,10.48062 -3.028934,231.00417 -0.986879,230.99289 0.707729,-0.004 27.836781,-2.02856 60.286781,-4.49923 z M 97.340438,391.44479 c -0.328235,-0.85537 -0.101073,-2.54287 0.504805,-3.75 1.037757,-2.0676 1.069465,-2.04174 0.54715,0.44612 -0.60508,2.88207 0.569671,4.19461 2.940127,3.28498 2.2116,-0.84866 4.90353,-7.1068 4.11953,-9.57697 -0.44716,-1.40889 -0.30218,-1.87433 0.44082,-1.41513 2.19699,1.35782 1.20578,6.6214 -1.81595,9.64313 -3.2269,3.22691 -5.820973,3.75364 -6.736482,1.36787 z M 135.27066,243.03618 c -4.1445,-1.88138 -8.3006,-6.95096 -8.22778,-10.03618 0.0195,-0.825 0.63542,-0.15 1.36876,1.5 3.65951,8.23372 13.21399,11.6342 22.38205,7.96587 3.33191,-1.33316 4.40099,-2.657 8.16134,-10.1061 7.27153,-14.40458 6.61422,-25.43342 -1.85291,-31.08984 -4.02261,-2.68727 -10.41961,-2.99977 -15.75685,-0.76972 -5.33997,2.23118 -2.56477,-0.73145 3.38169,-3.61008 6.27412,-3.03725 14.65571,-2.9328 20.42931,0.25459 11.2593,6.21584 11.864,17.86965 1.71165,32.98731 -8.624,12.84184 -20.78966,17.81023 -31.59726,12.90415 z m 29.83078,-12.17864 c 3.86395,-5.42642 6.84947,-13.99245 6.87482,-19.72519 0.0216,-4.8892 -0.31252,-5.70391 -3.74881,-9.14019 -3.59737,-3.59738 -9.12376,-5.97438 -13.91843,-5.98658 -3.55499,-0.009 -3.60294,1.77341 -0.0678,2.51845 10.44771,2.20186 14.73296,15.64065 9.23963,28.97597 -2.85418,6.92865 -2.75204,6.5 -1.54899,6.5 0.51254,0 1.93883,-1.41411 3.16953,-3.14246 z M 127.15789,222 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z M 213,313.025 l 0,-31.975 -3.25,0.59858 c -1.7875,0.32921 -3.7,1.14342 -4.25,1.80935 -0.55,0.66593 -2.33974,1.54456 -3.97721,1.9525 C 192.58398,287.63739 184,305.07856 184,321.01375 c 0,14.28801 9.54108,23.69759 24.25,23.91579 L 213,345 l 0,-31.975 z"
+       id="path3334"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#222e34"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 C 230.77077,731.78039 180.24956,728.57821 143.5,710.26865 93.66427,685.43925 59.944546,635.27417 49.091119,569.81589 45.564448,548.54613 44.896177,538.57996 44.302569,498.40251 l -0.577652,-39.09749 3.262542,-0.65251 C 48.781856,458.29363 51.930943,458 53.985429,458 c 2.054486,0 5.80681,-0.28391 8.338499,-0.63092 l 4.60307,-0.63092 0.351946,-112.11908 c 0.344628,-109.788 0.396572,-112.35056 2.49836,-123.25247 3.620731,-18.78063 11.532895,-40.09048 19.333743,-52.07163 1.863924,-2.86275 5.188953,-8.03775 7.388953,-11.5 7.79959,-12.27457 36.2445,-39.28079 48.23634,-45.79663 1.52001,-0.82591 4.53711,-2.60324 6.70466,-3.94961 3.8264,-2.37677 20.61369,-9.567247 29.39316,-12.589943 2.38379,-0.820716 10.70879,-2.943341 18.5,-4.716943 L 213.5,87.517124 337.76602,87.23589 l 124.26603,-0.281233 5.23397,-3.308105 c 13.20871,-8.348491 40.90108,-22.879449 41.83076,-21.949767 0.53978,0.539776 4.22632,6.341317 8.19232,12.892313 L 524.5,86.5 l 12,0.686992 c 29.27474,1.675958 60.37169,10.419819 76.73855,21.577398 2.3438,1.59781 7.41145,4.93531 11.26145,7.41668 14.27043,9.19743 39.73244,35.97587 46.90128,49.32615 1.47457,2.74603 4.03295,7.05859 5.6853,9.58347 2.76021,4.21775 5.78435,11.74376 11.01376,27.40931 2.03257,6.08892 5.25119,21.67484 6.91801,33.5 0.52301,3.71048 0.93025,75.41061 0.94893,167.07191 L 696,563.64383 l -2.48256,14.65461 c -3.41235,20.14321 -12.20172,45.334 -18.88654,54.12987 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -6.19973,12.03624 -26.99616,34.05014 -44.08602,46.66691 -9.67257,7.14088 -33.84993,19.05836 -46,22.67429 -5.87476,1.74835 -30.10373,6.60429 -36.25168,7.2655 -4.81574,0.51794 -7.91655,1.65388 -13.5,4.94557 -14.08047,8.30104 -28.44463,15.57092 -45.5553,23.05608 -9.51884,4.16406 -17.39384,7.56909 -17.5,7.56671 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 c 81.41129,-41.89285 124.07704,-100.1967 124.10931,-169.59858 0.007,-14.80396 -1.16659,-24.49345 -4.64006,-38.31344 -11.46466,-45.61467 -43.73754,-89.16559 -99.4666,-134.22609 -30.69665,-24.82019 -41.61775,-38.90622 -42.67576,-55.0432 -0.43291,-6.60278 -0.19716,-7.8255 2.60296,-13.5 8.19418,-16.60567 32.17133,-36.97244 69.34754,-58.90549 l 13.66219,-8.06035 -9.24378,-15.1369 C 552.49651,196.3116 537.80791,172.175 524.93926,151 512.0706,129.825 500.97837,111.825 500.28984,111 c -0.68853,-0.825 -1.85689,-2.34223 -2.59637,-3.37162 -1.28403,-1.78744 -1.70088,-1.6783 -9.26898,2.42691 -20.4464,11.09084 -43.35668,28.86483 -64.99861,50.4265 -13.09405,13.04549 -26.23701,27.85914 -27.51995,31.01821 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.05163,7.89186 -3.83587,9.59302 -1.98421,4.30408 -5.16352,18.37183 -6.42412,28.42529 -2.87589,22.9357 0.73982,56.71057 7.4671,69.75126 0.7747,1.50174 3.17159,6.87097 5.32643,11.93163 4.64575,10.9106 12.21854,23.82266 20.29862,34.61035 3.21801,4.29635 5.85092,8.24217 5.85092,8.76849 0,2.37078 31.06193,31.77521 46.98159,44.47459 62.447,49.81506 73.78263,78.28439 43.19443,108.48246 -10.10357,9.9747 -24.57399,19.84954 -42.49972,29.00248 -6.9589,3.55324 -12.65789,6.76233 -12.66442,7.13131 -0.0168,0.95027 39.55594,84.82288 46.98341,99.57912 3.39128,6.7375 6.41534,12.25 6.72013,12.25 0.30479,0 8.93101,-4.31058 19.16937,-9.57906 z M 241,690.95621 c 26.57591,-2.53536 52.9647,-15.79258 74.57472,-37.4649 23.84518,-23.91392 38.54897,-53.46596 45.52203,-91.49131 2.20963,-12.04951 2.30556,-14.86516 2.66185,-78.12724 l 0.36962,-65.62723 -7.17408,-10.87277 C 340.96551,383.141 330.97536,357.96582 325.85384,329 c -1.77802,-10.05602 -1.79531,-47.00522 -0.0267,-57 5.07912,-28.70254 15.71159,-56.00428 31.80146,-81.65885 5.39575,-8.60322 6.3714,-10.8525 6.3714,-14.68872 l 0,-4.52988 -4.25,-0.58798 C 350.16424,169.20841 251.37811,158 249.27569,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.59413,-11.97227 -10.8557,-30.76511 -11.61695,-66.93587 l -0.55245,-26.25 -2.61646,0.0206 c -2.3354,0.0184 -80.91762,6.14357 -100.285092,7.81688 -4.217754,0.3644 -7.963823,0.95862 -8.324599,1.32048 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.41306,2.82689 29.47154,3.07983 51.95582,0.93481 z m 127.18978,-5.87058 c 8.59414,-7.55333 16.17775,-11.3164 22.80563,-11.3164 8.64715,0 12.73428,4.56945 11.61061,12.98077 l -0.56776,4.25 18.58786,0 c 14.47152,0 18.47662,-0.27682 18.08554,-1.25 -0.69017,-1.71745 -48.85319,-104.20156 -49.08531,-104.44661 -0.10244,-0.10814 -1.88329,5.51148 -3.95746,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.32169,-0.0174 18.32169,-0.0174 6.68978,-5.87961 z m 26.48218,1.66437 c -0.39576,-2.88181 -0.29857,-3.60615 0.30191,-2.25 0.48706,1.1 0.91719,3.0438 0.95584,4.31955 0.0551,1.81814 0.55667,2.25047 2.32029,2 1.91935,-0.27259 2.29474,-1.01627 2.55442,-5.06058 0.25433,-3.96075 -0.1085,-5.15396 -2.20454,-7.25 C 396.21785,676.12694 390,674.89075 390,676.7992 c 0,0.43956 -1.55201,0.61801 -3.44891,0.39656 -4.05313,-0.47318 -12.87025,4.40523 -18.49726,10.23431 L 364.60767,691 l 15.32397,0 15.32398,0 -0.58366,-4.25 z m -2.57157,-7.04548 c -1.26492,-2.10631 -1.24361,-2.12762 0.47833,-0.47833 0.99123,0.94941 1.58698,1.94144 1.3239,2.20452 -0.26308,0.26308 -1.07408,-0.5137 -1.80223,-1.72619 z m 202.18945,-3.8493 c 21.39443,-10.89894 41.08683,-28.05169 52.16324,-45.43596 2.42474,-3.80559 6.06778,-9.50339 8.09565,-12.66178 5.8205,-9.06537 11.86774,-27.044 14.8863,-44.25748 1.39488,-7.95434 1.57367,-27.64766 1.53889,-169.5 -0.0225,-91.6332 -0.43266,-163.289 -0.95599,-167 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.76906,-5.06383 -5.96921,-12.17399 -14.7318,-24.93847 -8.02805,-11.69448 -27.09265,-29.4385 -39.46861,-36.73468 -3.08574,-1.81918 -7.63237,-4.56004 -10.10362,-6.09081 -9.36945,-5.80372 -30.90044,-11.97074 -49.45365,-14.16476 l -5.24952,-0.62079 5.64798,9.28438 c 3.10639,5.10641 17.66167,29.08438 32.34506,53.28438 14.68339,24.2 28.5123,46.95672 30.7309,50.5705 l 4.03382,6.5705 -16.12936,8.86762 c -38.989,21.43544 -62.98705,37.6347 -75.37935,50.88289 -3.4375,3.67491 -6.25,7.52479 -6.25,8.55528 0,3.2376 7.7335,11.83562 18.7605,20.85772 28.31138,23.16387 35.80534,29.72699 49.30432,43.18013 62.92851,62.71484 87.96118,130.68852 73.84379,200.51536 -5.6127,27.76131 -20.4186,58.71502 -39.70089,83 -3.0569,3.85 -10.74275,12.2875 -17.07966,18.75 -6.33692,6.4625 -11.19018,11.75 -10.78502,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z m 57.37683,-77.52189 c -0.36667,-0.36666 -0.63815,-1.60416 -0.60328,-2.75 0.0609,-2.00037 0.0994,-1.99373 0.96777,0.16667 1.0663,2.65282 2.24353,2.83246 4.40396,0.67202 2.67953,-2.67953 3.76229,-5.49935 3.10983,-8.09895 -0.40262,-1.60417 -0.25492,-2.26186 0.41497,-1.84784 0.57204,0.35354 1.04008,2.00086 1.04008,3.66071 0,4.70782 -6.8269,10.70383 -9.33333,8.19739 z m -2.06135,-137.76972 c -0.33632,-1.34001 -0.10825,-4.78293 0.50683,-7.65094 0.61508,-2.868 0.86668,-7.28413 0.55912,-9.81361 -0.46052,-3.78746 -0.37628,-4.15788 0.47734,-2.09906 0.57475,1.38621 0.78627,5.31703 0.47477,8.82307 -0.68331,7.69104 0.89477,7.9699 3.48334,0.61552 2.61773,-7.4372 2.42238,-13.0004 -0.56127,-15.98404 C 652.24353,432.15262 646,430.90723 646,432.75 c 0,0.4125 -2.025,0.75 -4.5,0.75 -2.55133,0 -4.3584,-0.43304 -4.173,-1 0.56644,-1.73225 9.27034,-3.38019 13.18724,-2.49679 7.63528,1.72204 9.87867,7.16615 7.08849,17.20189 -1.51559,5.45128 -6.107,15.7949 -7.01117,15.7949 -0.20611,0 -0.64992,-1.09637 -0.98624,-2.43639 z m -1.50493,-24.85909 c -1.26492,-2.10631 -1.24361,-2.12762 0.47833,-0.47833 0.99123,0.94941 1.58698,1.94144 1.3239,2.20452 -0.26308,0.26308 -1.07408,-0.5137 -1.80223,-1.72619 z m -80.0208,-95.56945 c 4.12079,-4.78394 4.22226,-4.83322 6.09541,-2.96007 2.3709,2.3709 6.08957,3.825 9.78195,3.825 3.54509,0 11.99841,-7.36132 15.69314,-13.6659 3.50006,-5.9724 2.92703,-11.76903 -1.74466,-17.64855 -1.82914,-2.30205 -2.44365,-3.51055 -1.36557,-2.68555 4.10169,3.13883 7.23495,9.08568 7.38406,14.01481 0.10003,3.30653 -3.28048,9.61048 -7.52221,14.02735 -4.11147,4.28123 -4.28114,5.2427 -0.6838,3.87499 4.62572,-1.7587 10.99181,-7.68607 13.23768,-12.32542 6.03655,-12.46983 -0.25218,-23.4069 -14.0319,-24.40363 -5.24551,-0.37943 -11.42057,0.5304 -16.29494,2.40087 -0.97501,0.37415 -1.62875,0.11824 -1.62875,-0.63759 0,-2.65743 -5.35882,-8.10633 -10.81294,-10.99468 -3.12788,-1.65645 -4.56206,-2.71733 -3.18706,-2.35753 1.375,0.35981 3.71515,1.27219 5.20034,2.02752 3.63832,1.85034 4.06541,1.73838 2.74932,-0.72075 -2.02055,-3.77543 -9.52067,-6.31687 -18.78027,-6.36376 -6.81175,-0.0345 -8.56392,0.27689 -9.61024,1.70782 -0.7038,0.9625 -2.25437,1.75 -3.44571,1.75 -4.25945,0 -11.97655,9.64059 -15.60937,19.5 -0.42701,1.15891 -0.92433,1.50115 -1.18256,0.8138 -0.78157,-2.08037 5.03078,-12.66358 9.33328,-16.99413 2.28513,-2.30003 6.11013,-5.1803 8.5,-6.40061 5.41371,-2.76432 16.05924,-3.67902 22.34273,-1.91976 6.06745,1.69879 12.70578,7.72124 15.39093,13.96302 1.19193,2.77073 2.28449,5.03768 2.42791,5.03768 0.14341,0 2.02605,-0.9 4.18364,-2 8.47354,-4.32006 21.7333,-0.96546 27.03739,6.84022 3.19163,4.6969 3.36686,12.66039 0.41286,18.76256 -2.55345,5.27472 -9.68897,11.95175 -15.53684,14.53855 -6.06678,2.68362 -15.23828,2.67312 -20.41163,-0.0234 l -3.92175,-2.04413 -2.96309,2.96309 c -4.81026,4.81026 -5.58908,3.38239 -1.03735,-1.90184 z M 556.75,289.33772 c 0.6875,-0.27741 1.8125,-0.27741 2.5,0 0.6875,0.27741 0.125,0.50439 -1.25,0.50439 -1.375,0 -1.9375,-0.22698 -1.25,-0.50439 z M 419,563.73163 c 25.31787,-12.30917 39.21066,-21.80156 46.55886,-31.81181 4.31302,-5.87551 4.21103,-6.80845 -1.73372,-15.85948 C 457.8325,506.93639 443.31415,492.78122 423,476.25645 c -9.625,-7.82956 -19.6375,-16.0871 -22.25,-18.35008 l -4.75,-4.1145 -0.01,37.35406 c -0.0102,38.62782 -0.99044,59.66907 -3.52156,75.5933 -0.8077,5.08158 -1.46855,9.44432 -1.46855,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.33333,-51.3983 c -0.36667,-0.36666 -0.63815,-1.60416 -0.60328,-2.75 0.0609,-2.00037 0.0994,-1.99373 0.96777,0.16667 1.0663,2.65282 2.24353,2.83246 4.40396,0.67202 2.67953,-2.67953 3.76229,-5.49935 3.10983,-8.09895 -0.40262,-1.60417 -0.25492,-2.26186 0.41497,-1.84784 0.57204,0.35354 1.04008,2.00086 1.04008,3.66071 0,4.70782 -6.8269,10.70383 -9.33333,8.19739 z M 153.5,450.49366 c 32.45,-2.47066 59.1125,-4.49246 59.25,-4.49288 0.1375,-4.3e-4 0.25,-22.21417 0.25,-49.36387 l 0,-49.36309 -6.26949,-0.50325 c -11.28028,-0.90548 -21.67795,-8.22705 -23.43119,-16.49919 -0.43962,-2.07426 -0.7437,-7.03247 -0.67573,-11.01825 0.31735,-18.60766 11.65613,-35.77674 26.01555,-39.39248 L 213,278.76257 l 0,-78.81841 0,-78.81842 3.25,0.47587 C 223.59967,122.67775 390.2813,141 392.7215,141 c 1.96178,0 4.86887,-2.14693 11.21343,-8.2813 4.71079,-4.55472 11.71507,-11.07878 15.56507,-14.49792 l 7,-6.21662 -106,0.24792 -106,0.24792 -12.17888,2.77199 C 191.03894,117.83989 180.03879,121.6936 169,126.94545 149.80162,136.07935 127.87612,155.0389 116.89735,172 c -2.31407,3.575 -5.68466,8.75 -7.4902,11.5 -5.63522,8.58294 -12.48361,26.82184 -15.207052,40.5 -2.086783,10.48062 -3.028934,231.00417 -0.986879,230.99289 0.707729,-0.004 27.836781,-2.02856 60.286781,-4.49923 z M 97.666667,392.33333 c -0.366667,-0.36666 -0.638143,-1.60416 -0.603281,-2.75 0.06086,-2.00037 0.0994,-1.99373 0.967776,0.16667 1.066302,2.65282 2.243528,2.83246 4.403958,0.67202 2.67953,-2.67953 3.76229,-5.49935 3.10983,-8.09895 -0.40262,-1.60417 -0.25492,-2.26186 0.41497,-1.84784 0.57204,0.35354 1.04008,2.00086 1.04008,3.66071 0,4.70782 -6.8269,10.70383 -9.333333,8.19739 z M 144.5,243.99336 c 8.29523,-1.2561 9.75319,-2.41659 14.44318,-11.49629 7.31414,-14.15995 6.64202,-25.56007 -1.84106,-31.22714 -4.02261,-2.68727 -10.41961,-2.99977 -15.75685,-0.76972 -5.32245,2.22385 -2.57417,-0.7269 3.34648,-3.59303 6.19469,-2.9988 13.68179,-2.92387 19.98053,0.19996 11.8068,5.85554 12.53488,17.63282 2.05447,33.23277 -6.04972,9.00494 -14.97267,14.5597 -23.22675,14.45926 -3.86156,-0.047 -3.82695,-0.0749 1,-0.80581 z m 22.26824,-16.04797 c 6.11683,-10.14024 7.07168,-19.60532 2.52313,-25.01096 -4.503,-5.35151 -14.15967,-8.57157 -18.14029,-6.04897 -0.94694,0.6001 -0.2852,1.0544 2.22056,1.52448 4.44506,0.8339 9.46903,4.96448 11.26433,9.26125 2.11383,5.05909 1.65014,13.01903 -1.15507,19.82881 -2.88439,7.00198 -2.84126,6.78246 -1.2309,6.265 0.6875,-0.22092 2.72071,-2.83974 4.51824,-5.81961 z m -33.46969,14.09509 c -3.38268,-2.06254 -6.74929,-7.3681 -5.93823,-9.35827 0.2668,-0.65469 0.51701,-0.43557 0.56073,0.49106 0.11652,2.46962 5.0295,7.89569 8.52937,9.42013 1.67727,0.73058 2.37458,1.34425 1.54958,1.36372 -0.825,0.0195 -2.94065,-0.84301 -4.70145,-1.91664 z m -6.2196,-19.62381 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58437 -0.0789,1.91667 -0.33229,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z M 213,313.025 l 0,-31.975 -3.25,0.59858 c -1.7875,0.32921 -3.74961,1.21796 -4.36024,1.975 -0.61064,0.75703 -2.08498,1.37642 -3.27632,1.37642 -2.86174,0 -10.15245,7.37742 -12.87298,13.02608 -4.87728,10.12674 -6.57987,23.77134 -4.02872,32.28631 2.39776,8.00299 12.659,14.52165 23.03826,14.6355 L 213,345 l 0,-31.975 z"
+       id="path3332"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#202e34"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 C 230.77077,731.78039 180.24956,728.57821 143.5,710.26865 93.66427,685.43925 59.944546,635.27417 49.091119,569.81589 45.564448,548.54613 44.896177,538.57996 44.302569,498.40251 l -0.577652,-39.09749 3.262542,-0.65251 C 48.781856,458.29363 51.930943,458 53.985429,458 c 2.054486,0 5.80681,-0.28391 8.338499,-0.63092 l 4.60307,-0.63092 0.351946,-112.11908 c 0.344628,-109.788 0.396572,-112.35056 2.49836,-123.25247 3.620731,-18.78063 11.532895,-40.09048 19.333743,-52.07163 1.863924,-2.86275 5.188953,-8.03775 7.388953,-11.5 7.79959,-12.27457 36.2445,-39.28079 48.23634,-45.79663 1.52001,-0.82591 4.53711,-2.60324 6.70466,-3.94961 3.8264,-2.37677 20.61369,-9.567247 29.39316,-12.589943 2.38379,-0.820716 10.70879,-2.943341 18.5,-4.716943 L 213.5,87.517124 337.76602,87.23589 l 124.26603,-0.281233 5.23397,-3.308105 c 13.20871,-8.348491 40.90108,-22.879449 41.83076,-21.949767 0.53978,0.539776 4.22632,6.341317 8.19232,12.892313 L 524.5,86.5 l 12,0.686992 c 29.27474,1.675958 60.37169,10.419819 76.73855,21.577398 2.3438,1.59781 7.41145,4.93531 11.26145,7.41668 14.27043,9.19743 39.73244,35.97587 46.90128,49.32615 1.47457,2.74603 4.03295,7.05859 5.6853,9.58347 2.76021,4.21775 5.78435,11.74376 11.01376,27.40931 2.03257,6.08892 5.25119,21.67484 6.91801,33.5 0.52301,3.71048 0.93025,75.41061 0.94893,167.07191 L 696,563.64383 l -2.48256,14.65461 c -3.41235,20.14321 -12.20172,45.334 -18.88654,54.12987 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -6.19973,12.03624 -26.99616,34.05014 -44.08602,46.66691 -9.67257,7.14088 -33.84993,19.05836 -46,22.67429 -5.87476,1.74835 -30.10373,6.60429 -36.25168,7.2655 -4.81574,0.51794 -7.91655,1.65388 -13.5,4.94557 -14.08047,8.30104 -28.44463,15.57092 -45.5553,23.05608 -9.51884,4.16406 -17.39384,7.56909 -17.5,7.56671 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 c 81.41129,-41.89285 124.07704,-100.1967 124.10931,-169.59858 0.007,-14.80396 -1.16659,-24.49345 -4.64006,-38.31344 -11.46466,-45.61467 -43.73754,-89.16559 -99.4666,-134.22609 -30.69665,-24.82019 -41.61775,-38.90622 -42.67576,-55.0432 -0.43291,-6.60278 -0.19716,-7.8255 2.60296,-13.5 8.19418,-16.60567 32.17133,-36.97244 69.34754,-58.90549 l 13.66219,-8.06035 -9.24378,-15.1369 C 552.49651,196.3116 537.80791,172.175 524.93926,151 512.0706,129.825 500.97837,111.825 500.28984,111 c -0.68853,-0.825 -1.85689,-2.34223 -2.59637,-3.37162 -1.28403,-1.78744 -1.70088,-1.6783 -9.26898,2.42691 -20.4464,11.09084 -43.35668,28.86483 -64.99861,50.4265 -13.09405,13.04549 -26.23701,27.85914 -27.51995,31.01821 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.05163,7.89186 -3.83587,9.59302 -1.98421,4.30408 -5.16352,18.37183 -6.42412,28.42529 -2.87589,22.9357 0.73982,56.71057 7.4671,69.75126 0.7747,1.50174 3.17159,6.87097 5.32643,11.93163 4.64575,10.9106 12.21854,23.82266 20.29862,34.61035 3.21801,4.29635 5.85092,8.24217 5.85092,8.76849 0,2.37078 31.06193,31.77521 46.98159,44.47459 62.447,49.81506 73.78263,78.28439 43.19443,108.48246 -10.10357,9.9747 -24.57399,19.84954 -42.49972,29.00248 -6.9589,3.55324 -12.65789,6.76233 -12.66442,7.13131 -0.0168,0.95027 39.55594,84.82288 46.98341,99.57912 3.39128,6.7375 6.41534,12.25 6.72013,12.25 0.30479,0 8.93101,-4.31058 19.16937,-9.57906 z M 241,690.95621 c 26.57591,-2.53536 52.9647,-15.79258 74.57472,-37.4649 23.84518,-23.91392 38.54897,-53.46596 45.52203,-91.49131 2.20963,-12.04951 2.30556,-14.86516 2.66185,-78.12724 l 0.36962,-65.62723 -7.17408,-10.87277 C 340.96551,383.141 330.97536,357.96582 325.85384,329 c -1.77802,-10.05602 -1.79531,-47.00522 -0.0267,-57 5.07912,-28.70254 15.71159,-56.00428 31.80146,-81.65885 5.39575,-8.60322 6.3714,-10.8525 6.3714,-14.68872 l 0,-4.52988 -4.25,-0.58798 C 350.16424,169.20841 251.37811,158 249.27569,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.59413,-11.97227 -10.8557,-30.76511 -11.61695,-66.93587 l -0.55245,-26.25 -2.61646,0.0206 c -2.3354,0.0184 -80.91762,6.14357 -100.285092,7.81688 -4.217754,0.3644 -7.963823,0.95862 -8.324599,1.32048 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.41306,2.82689 29.47154,3.07983 51.95582,0.93481 z m 127.84571,-5.96552 c 3.47334,-3.30511 6.72896,-5.75356 7.23473,-5.44098 0.50576,0.31258 0.91956,0.0665 0.91956,-0.54692 0,-1.60064 8.66706,-5.21136 11.28969,-4.70332 1.80738,0.35011 1.69824,0.45299 -0.59871,0.56435 -1.94188,0.0941 -2.58695,0.52205 -2.08967,1.38618 0.39564,0.6875 0.34925,0.91456 -0.10307,0.50458 -1.21068,-1.09734 -12.33373,5.43726 -17.29035,10.15777 l -4.2921,4.08765 15.66991,0 15.66992,0 -0.58366,-4.25 c -0.39576,-2.88181 -0.29857,-3.60615 0.30191,-2.25 0.48706,1.1 0.91719,3.0125 0.95584,4.25 0.0527,1.68745 0.66908,2.25 2.46525,2.25 2.07646,0 2.44735,-0.54927 2.78884,-4.13008 0.21662,-2.27155 -0.16508,-5.20746 -0.84824,-6.52424 -0.68316,-1.31679 -1.37563,-2.72075 -1.53883,-3.11992 -0.32739,-0.80076 -0.97035,-0.94059 -5.10575,-1.11041 C 390.34021,675.97775 391.0482,674 394.44823,674 c 2.09615,0 8.20112,3.88691 6.23034,3.96673 -0.45178,0.0183 -0.0616,0.79305 0.86698,1.72168 1.3074,1.3074 1.55981,2.77417 1.11854,6.5 L 402.09423,691 l 18.55987,0 c 14.44914,0 18.44862,-0.27686 18.05756,-1.25 -0.69017,-1.71745 -48.85319,-104.20156 -49.08531,-104.44661 -0.10244,-0.10814 -1.88329,5.51148 -3.95746,12.48804 -10.13032,34.07376 -25.22031,59.10296 -49.8782,82.73112 L 324.85662,691 l 18.83696,0 18.83696,0 6.31517,-6.00931 z m 225.44413,-9.13547 c 21.39443,-10.89894 41.08683,-28.05169 52.16324,-45.43596 2.42474,-3.80559 6.06778,-9.50339 8.09565,-12.66178 5.8205,-9.06537 11.86774,-27.044 14.8863,-44.25748 1.39488,-7.95434 1.57367,-27.64766 1.53889,-169.5 -0.0225,-91.6332 -0.43266,-163.289 -0.95599,-167 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.76906,-5.06383 -5.96921,-12.17399 -14.7318,-24.93847 -8.02805,-11.69448 -27.09265,-29.4385 -39.46861,-36.73468 -3.08574,-1.81918 -7.63237,-4.56004 -10.10362,-6.09081 -9.36945,-5.80372 -30.90044,-11.97074 -49.45365,-14.16476 l -5.24952,-0.62079 5.64798,9.28438 c 3.10639,5.10641 17.66167,29.08438 32.34506,53.28438 14.68339,24.2 28.5123,46.95672 30.7309,50.5705 l 4.03382,6.5705 -16.12936,8.86762 c -38.989,21.43544 -62.98705,37.6347 -75.37935,50.88289 -3.4375,3.67491 -6.25,7.52479 -6.25,8.55528 0,3.2376 7.7335,11.83562 18.7605,20.85772 28.31138,23.16387 35.80534,29.72699 49.30432,43.18013 62.92851,62.71484 87.96118,130.68852 73.84379,200.51536 -5.6127,27.76131 -20.4186,58.71502 -39.70089,83 -3.0569,3.85 -10.74275,12.2875 -17.07966,18.75 -6.33692,6.4625 -11.19018,11.75 -10.78502,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z m 57.08445,-78.32223 c -0.30962,-0.80686 -0.33103,-2.04436 -0.0476,-2.75 0.28346,-0.70564 0.55091,-0.30349 0.59433,0.89369 0.0434,1.19717 0.86645,2.38247 1.82895,2.63399 1.64009,0.4286 1.63812,0.46461 -0.0314,0.57333 -0.97977,0.0638 -2.03471,-0.54415 -2.34433,-1.35101 z m 6.62747,-2.80578 c 1.37442,-2.33294 2.03643,-4.74713 1.73464,-6.32582 -0.32573,-1.70394 -0.15509,-2.22008 0.51308,-1.55191 1.49661,1.49661 0.007,7.60929 -2.3795,9.76323 -2.02658,1.82923 -2.02252,1.77123 0.13178,-1.8855 z m -6.2125,-135.37267 c 4.61873,-9.19311 6.80231,-20.73189 4.45784,-23.5568 -0.59236,-0.71376 -1.22779,-1.74774 -1.41206,-2.29774 -0.36101,-1.07751 -0.84644,-1.20817 -5.14406,-1.38465 C 646.34021,431.97775 647.0482,430 650.44823,430 c 2.09615,0 8.20112,3.88691 6.23034,3.96673 -0.45178,0.0183 -0.0616,0.79305 0.86698,1.72168 1.30203,1.30203 1.55965,2.77552 1.12577,6.43898 -0.58534,4.9423 -6.12623,19.41769 -7.83754,20.47534 -0.5396,0.33349 -0.10964,-1.1282 0.95548,-3.24819 z m -2.71031,-0.93787 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58438 -0.0789,1.91667 -0.33229,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z m 1.40494,-10.74664 c 0.009,-4.72147 0.32198,-7.81625 0.69582,-6.87727 0.85883,2.15712 0.83171,9.95535 -0.0455,13.08451 -0.36654,1.3075 -0.65918,-1.48576 -0.65032,-6.20724 z M 637,433.01043 c 0,-1.43324 4.87602,-3.19883 7.43446,-2.69199 1.51358,0.29985 1.31491,0.44559 -0.74348,0.54538 -1.94188,0.0941 -2.58695,0.52205 -2.08967,1.38618 0.39564,0.6875 0.36303,0.92833 -0.0725,0.53518 -0.43549,-0.39315 -1.63264,-0.26481 -2.66032,0.28519 C 637.5901,433.75456 637,433.73563 637,433.01043 z M 565.05694,344.5 c 0.0493,-1.87247 6.81188,-8.69911 7.93184,-8.00693 1.08852,0.67274 -3.54893,5.93311 -5.27525,5.98382 -0.43257,0.0127 -1.21317,0.69811 -1.73469,1.52311 -0.52152,0.825 -0.93637,1.05 -0.9219,0.5 z m 14.57801,-2.71836 c 0.37252,-0.60274 -0.16775,-0.74731 -1.36854,-0.3662 -1.15273,0.36587 -2.45555,0.0616 -3.10935,-0.7262 -0.86116,-1.03762 -0.77693,-1.35591 0.35882,-1.35591 0.81626,0 1.48412,0.30215 1.48412,0.67145 0,0.36929 2.45263,0.63179 5.45028,0.58333 6.0039,-0.0971 6.1935,0.9491 0.30944,1.70741 -2.34051,0.30164 -3.50993,0.10932 -3.12477,-0.51388 z m 14.12128,-0.36107 c 2.68276,-1.00307 4.00981,-2.02192 3.58968,-2.75598 -0.36661,-0.64052 -0.30141,-0.83408 0.14489,-0.43013 0.44629,0.40395 1.34975,-0.002 2.00768,-0.90149 0.77315,-1.05735 1.42926,-1.2589 1.85511,-0.56987 0.80753,1.30661 -4.75813,4.86777 -8.85359,5.66493 -2.02196,0.39356 -1.61242,0.0651 1.25623,-1.00746 z m 1.07646,-7.73026 c 2.3752,-2.64533 5.14265,-6.65041 6.1499,-8.90017 1.6368,-3.6559 1.68794,-4.56702 0.48139,-8.57609 -0.74249,-2.46709 -2.38812,-5.68285 -3.65698,-7.14613 -1.26885,-1.46328 -0.87158,-1.21334 0.88282,0.55543 4.09193,4.12544 5.84393,10.22935 4.2887,14.94174 -0.62349,1.8892 -1.57528,3.43491 -2.11509,3.43491 -0.5398,0 -0.66038,0.51953 -0.26794,1.15451 0.44208,0.7153 0.27432,0.88306 -0.44098,0.44098 -0.71828,-0.44392 -1.15451,0.006 -1.15451,1.19051 0,1.04721 -0.9,2.71851 -2,3.714 -1.1,0.99549 -2,1.44549 -2,1 0,-0.44549 -1.00932,0.0473 -2.24293,1.09501 -1.23361,1.04775 -0.29958,-0.25937 2.07562,-2.9047 z m 2.29487,-0.44031 c 1.24387,-1.58606 1.2085,-1.62143 -0.37756,-0.37756 -0.9625,0.75485 -1.75,1.54235 -1.75,1.75 0,0.82304 0.82119,0.29331 2.12756,-1.37244 z m 5.51769,2.98502 c -0.31577,-0.51093 0.7105,-2.15973 2.28061,-3.66399 1.57011,-1.50426 3.11311,-2.31699 3.42889,-1.80605 0.31577,0.51093 -0.7105,2.15973 -2.28061,3.66399 -1.57011,1.50426 -3.11311,2.31699 -3.42889,1.80605 z M 606,333.5 c 1.29175,-1.375 2.12363,-2.5 1.84863,-2.5 -0.275,0 -1.55688,1.125 -2.84863,2.5 -1.29175,1.375 -2.12363,2.5 -1.84863,2.5 0.275,0 1.55688,-1.125 2.84863,-2.5 z m 2.40451,-4.65451 c -0.44208,-0.7153 -0.27432,-0.88306 0.44098,-0.44098 1.12718,0.69663 1.58058,-0.52693 1.20611,-3.25486 -0.10195,-0.7427 0.22173,-1.09876 0.71928,-0.79125 0.51265,0.31683 0.81355,-2.3479 0.6944,-6.14965 -0.12723,-4.0598 0.0956,-5.89036 0.56441,-4.6361 1.06303,2.84425 0.49097,11.58598 -0.93223,14.24525 -1.33552,2.49544 -1.69985,2.63446 -2.69295,1.02759 z m 2.73835,-19.98835 c -0.70479,-1.12854 -1.53696,-1.79637 -1.84927,-1.48406 -0.31231,0.3123 -1.80895,-0.31592 -3.32587,-1.39607 -1.51692,-1.08014 -3.81772,-2.38832 -5.11288,-2.90706 -2.11867,-0.84859 -2.15426,-0.95658 -0.35484,-1.07685 2,-0.13367 2,-0.13367 0,-0.9931 -2.69533,-1.15822 -12.76395,-1.2361 -12.05764,-0.0933 0.30822,0.49871 -0.34022,0.67122 -1.44098,0.38337 -1.10076,-0.28786 -2.00138,-0.0697 -2.00138,0.48485 0,0.55452 -1.08319,1.28009 -2.4071,1.61237 -1.3239,0.33228 -3.1239,0.8792 -4,1.21539 -0.89594,0.34381 -1.5929,0.10108 -1.5929,-0.55475 0,-0.6413 0.34801,-0.95092 0.77335,-0.68805 0.42534,0.26288 3.01284,-0.60645 5.75,-1.93184 6.13662,-2.97147 13.30883,-3.14121 19.22665,-0.45501 4.22368,1.9172 5.84633,3.47654 2.5,2.40246 -1.14607,-0.36786 -0.89689,0.13363 0.72204,1.45317 1.35962,1.10818 2.76198,1.83568 3.11635,1.61667 0.78039,-0.4823 4.42005,3.37953 3.78429,4.01528 -0.24661,0.24662 -1.02503,-0.47496 -1.72982,-1.60351 z m -89.08525,0.35302 c -0.069,-1.5444 3.26689,-8.2323 6.67495,-13.38221 3.14745,-4.75612 12.26971,-11.08182 15.95759,-11.06556 1.54542,0.007 3.25985,-0.26146 3.80985,-0.59617 0.55,-0.33471 3.25,-0.70366 6,-0.8199 7.63476,-0.32271 3.20453,1.30644 -5.77058,2.12204 -6.99296,0.63547 -8.25708,1.0907 -12.63211,4.54895 -5.66118,4.47491 -8.25606,7.8795 -11.57756,15.19022 -1.3225,2.91086 -2.43046,4.71204 -2.46214,4.00263 z m 72.21142,-7.90315 c 0.97297,-0.25354 2.32297,-0.23687 3,0.0371 0.67703,0.27393 -0.11903,0.48137 -1.76903,0.46099 -1.65,-0.0204 -2.20394,-0.2445 -1.23097,-0.49804 z m -18.54628,-5.43138 c -1.52422,-2.73001 -3.1594,-4.7238 -3.63372,-4.43065 -1.16993,0.72305 -3.2608,-1.92049 -2.33035,-2.94632 0.40772,-0.44952 -0.0408,-0.53682 -0.99668,-0.19398 -1.01166,0.36284 -1.63854,0.16822 -1.5,-0.46567 0.1309,-0.59895 -0.38714,-1.31614 -1.1512,-1.59374 -0.76405,-0.2776 -1.11602,-0.0627 -0.78215,0.47749 0.3784,0.61226 -0.91448,0.5761 -3.43252,-0.096 -3.90599,-1.04257 -3.95137,-1.1018 -1.37253,-1.79149 3.26874,-0.8742 6.09828,0.13425 10.30238,3.67177 3.05708,2.57236 8.83591,11.16442 8.04254,11.95778 -0.20596,0.20596 -1.62155,-1.85917 -3.14577,-4.58918 z m -2.73351,1.61292 c -1.29767,-1.38131 -4.63861,-3.64879 -7.42432,-5.03886 -2.7857,-1.39007 -3.93992,-2.23361 -2.56492,-1.87453 3.43851,0.89797 8.06279,3.79832 10.94137,6.86243 1.32399,1.40933 2.18226,2.56241 1.90726,2.56241 -0.275,0 -1.56173,-1.13015 -2.85939,-2.51145 z M 419,563.73163 c 25.31787,-12.30917 39.21066,-21.80156 46.55886,-31.81181 4.31302,-5.87551 4.21103,-6.80845 -1.73372,-15.85948 C 457.8325,506.93639 443.31415,492.78122 423,476.25645 c -9.625,-7.82956 -19.6375,-16.0871 -22.25,-18.35008 l -4.75,-4.1145 -0.01,37.35406 c -0.0102,38.62782 -0.99044,59.66907 -3.52156,75.5933 -0.8077,5.08158 -1.46855,9.44432 -1.46855,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z m -11.62571,-52.19864 c -0.30962,-0.80686 -0.33103,-2.04436 -0.0476,-2.75 0.28346,-0.70564 0.55091,-0.30349 0.59433,0.89369 0.0434,1.19717 0.86645,2.38247 1.82895,2.63399 1.64009,0.4286 1.63812,0.46461 -0.0314,0.57333 -0.97977,0.0638 -2.03471,-0.54415 -2.34433,-1.35101 z m 6.62747,-2.80578 c 1.37442,-2.33294 2.03643,-4.74713 1.73464,-6.32582 -0.32573,-1.70394 -0.15509,-2.22008 0.51308,-1.55191 1.49661,1.49661 0.007,7.60929 -2.3795,9.76323 -2.02658,1.82923 -2.02252,1.77123 0.13178,-1.8855 z M 153.5,450.49366 c 32.45,-2.47066 59.1125,-4.49246 59.25,-4.49288 0.1375,-4.3e-4 0.25,-22.21781 0.25,-49.37195 l 0,-49.37117 -5.25,-0.82173 c -2.8875,-0.45195 -5.8125,-0.78492 -6.5,-0.73994 -0.6875,0.045 -1.25,-0.26639 -1.25,-0.69195 0,-0.42555 2.925,-0.53894 6.5,-0.25198 l 6.5,0.52176 0,-32.04175 0,-32.04176 -4.25,0.51791 c -7.10347,0.86563 -15.35237,7.67172 -19.75331,16.29826 -3.32816,6.52374 -5.23815,16.65416 -4.7594,25.24352 0.25491,4.57346 0.0393,7.75 -0.52592,7.75 -0.58114,0 -0.7847,-4.62131 -0.51755,-11.75 0.47337,-12.63181 1.70275,-16.73863 7.90326,-26.40129 3.54985,-5.53195 12.57583,-12.1051 16.59307,-12.08385 1.54542,0.008 3.37235,-0.44067 4.05985,-0.99744 0.98086,-0.79435 1.25,-17.98181 1.25,-79.82699 l 0,-78.81469 3.25,0.47587 C 223.59967,122.67775 390.2813,141 392.7215,141 c 1.96178,0 4.86887,-2.14693 11.21343,-8.2813 4.71079,-4.55472 11.71507,-11.07878 15.56507,-14.49792 l 7,-6.21662 -106,0.24792 -106,0.24792 -12.17888,2.77199 C 191.03894,117.83989 180.03879,121.6936 169,126.94545 149.80162,136.07935 127.87612,155.0389 116.89735,172 c -2.31407,3.575 -5.68466,8.75 -7.4902,11.5 -5.63522,8.58294 -12.48361,26.82184 -15.207052,40.5 -2.086783,10.48062 -3.028934,231.00417 -0.986879,230.99289 0.707729,-0.004 27.836781,-2.02856 60.286781,-4.49923 z M 97.374286,391.53299 c -0.30962,-0.80686 -0.331023,-2.04436 -0.04756,-2.75 0.28346,-0.70564 0.550909,-0.30349 0.59433,0.89369 0.04342,1.19717 0.866447,2.38247 1.828947,2.63399 1.640087,0.4286 1.638117,0.46461 -0.03139,0.57333 -0.979761,0.0638 -2.03471,-0.54415 -2.344329,-1.35101 z m 6.627474,-2.80578 c 1.37442,-2.33294 2.03643,-4.74713 1.73464,-6.32582 -0.32573,-1.70394 -0.15509,-2.22008 0.51308,-1.55191 1.49661,1.49661 0.007,7.60929 -2.3795,9.76323 -2.02658,1.82923 -2.02252,1.77123 0.13178,-1.8855 z M 192.44658,341.75 c -4.91381,-3.34137 -8.65037,-7.75 -6.56855,-7.75 0.61708,0 1.12197,0.675 1.12197,1.5 0,0.825 0.3421,1.5 0.76022,1.5 0.41812,0 1.89405,1.05135 3.27985,2.33634 1.3858,1.28499 3.74371,2.64356 5.23979,3.01905 1.49607,0.37549 2.72014,1.12414 2.72014,1.66366 0,1.65999 -1.57975,1.11302 -6.55342,-2.26905 z m -50.68492,-97.45726 c 1.24391,-0.23919 3.04391,-0.23011 4,0.0202 0.95609,0.25029 -0.0617,0.446 -2.26166,0.4349 -2.2,-0.0111 -2.98225,-0.21589 -1.73834,-0.45508 z m -8.54898,-2.43142 c -2.94784,-1.8876 -6.92915,-7.47818 -5.99256,-8.41477 0.20218,-0.20218 1.19743,1.17333 2.21168,3.05668 1.0998,2.04219 3.50377,4.2458 5.95615,5.45973 2.26163,1.1195 3.43705,2.02824 2.61205,2.0194 -0.825,-0.009 -2.97929,-0.9633 -4.78732,-2.12104 z M 150,243 c 0.825,-0.53316 1.95,-0.96937 2.5,-0.96937 0.55,0 0.325,0.43621 -0.5,0.96937 -0.825,0.53316 -1.95,0.96937 -2.5,0.96937 -0.55,0 -0.325,-0.43621 0.5,-0.96937 z m 4,-1.27676 c 0,-0.19092 1.4625,-1.41777 3.25,-2.72633 2.0111,-1.47225 2.70955,-1.71373 1.83224,-0.63346 -1.3317,1.63978 -5.08224,4.1192 -5.08224,3.35979 z m 3.24046,-5.97324 c 3.23994,-4.95748 6.13548,-11.34642 5.89176,-13 -0.14187,-0.9625 0.12527,-1.75 0.59363,-1.75 0.46835,0 0.56092,-3.17078 0.2057,-7.04618 -0.54204,-5.91364 -1.11082,-7.53765 -3.5387,-10.1039 -1.59107,-1.68175 -3.79285,-3.43244 -4.89285,-3.89043 -1.59411,-0.66372 -1.66041,-0.84558 -0.32673,-0.8961 0.92031,-0.0349 3.00405,1.05638 4.63055,2.42499 8.1431,6.85197 8.32453,19.69464 0.44162,31.26162 -3.43422,5.0392 -6.03386,7.63454 -3.00498,3 z m 5.31997,-0.75 c 0.42896,-0.825 2.07156,-3.40756 3.65023,-5.73902 5.39286,-7.96445 7.6078,-18.99465 4.84928,-24.14898 -0.62167,-1.1616 -0.79947,-2.112 -0.39512,-2.112 0.91126,0 -1.49738,-2.48399 -2.46482,-2.54192 -0.385,-0.023 -2.275,-0.88532 -4.2,-1.91616 -1.925,-1.03084 -6.2,-2.21645 -9.5,-2.63469 l -6,-0.76045 7.30873,0.21262 c 4.0198,0.11694 7.6198,0.64641 8,1.17661 0.3802,0.53019 1.36627,1.11193 2.19127,1.29274 4.81322,1.05492 7.78211,6.93319 7.47773,14.80561 -0.25172,6.51032 -3.80952,14.63902 -9.13257,20.86564 -1.41056,1.65 -2.21369,2.325 -1.78473,1.5 z m -22.35584,-35.2454 c 1.00335,-0.82917 4.08872,-1.43855 7.5,-1.48131 l 5.79541,-0.0726 -5.5,0.78526 c -3.025,0.43189 -6.4,1.09848 -7.5,1.4813 -1.84254,0.64125 -1.86579,0.58514 -0.29541,-0.71262 z"
+       id="path3330"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#3c3213"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 C 230.77077,731.78039 180.24956,728.57821 143.5,710.26865 93.66427,685.43925 59.944546,635.27417 49.091119,569.81589 45.564448,548.54613 44.896177,538.57996 44.302569,498.40251 l -0.577652,-39.09749 3.262542,-0.65251 C 48.781856,458.29363 51.930943,458 53.985429,458 c 2.054486,0 5.80681,-0.28391 8.338499,-0.63092 l 4.60307,-0.63092 0.351946,-112.11908 c 0.344628,-109.788 0.396572,-112.35056 2.49836,-123.25247 3.620731,-18.78063 11.532895,-40.09048 19.333743,-52.07163 1.863924,-2.86275 5.188953,-8.03775 7.388953,-11.5 7.79959,-12.27457 36.2445,-39.28079 48.23634,-45.79663 1.52001,-0.82591 4.53711,-2.60324 6.70466,-3.94961 3.8264,-2.37677 20.61369,-9.567247 29.39316,-12.589943 2.38379,-0.820716 10.70879,-2.943341 18.5,-4.716943 L 213.5,87.517124 337.76602,87.23589 l 124.26603,-0.281233 5.23397,-3.308105 c 13.20871,-8.348491 40.90108,-22.879449 41.83076,-21.949767 0.53978,0.539776 4.22632,6.341317 8.19232,12.892313 L 524.5,86.5 l 12,0.686992 c 29.27474,1.675958 60.37169,10.419819 76.73855,21.577398 2.3438,1.59781 7.41145,4.93531 11.26145,7.41668 14.27043,9.19743 39.73244,35.97587 46.90128,49.32615 1.47457,2.74603 4.03295,7.05859 5.6853,9.58347 2.76021,4.21775 5.78435,11.74376 11.01376,27.40931 2.03257,6.08892 5.25119,21.67484 6.91801,33.5 0.52301,3.71048 0.93025,75.41061 0.94893,167.07191 L 696,563.64383 l -2.48256,14.65461 c -3.41235,20.14321 -12.20172,45.334 -18.88654,54.12987 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -6.19973,12.03624 -26.99616,34.05014 -44.08602,46.66691 -9.67257,7.14088 -33.84993,19.05836 -46,22.67429 -5.87476,1.74835 -30.10373,6.60429 -36.25168,7.2655 -4.81574,0.51794 -7.91655,1.65388 -13.5,4.94557 -14.08047,8.30104 -28.44463,15.57092 -45.5553,23.05608 -9.51884,4.16406 -17.39384,7.56909 -17.5,7.56671 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 c 81.41129,-41.89285 124.07704,-100.1967 124.10931,-169.59858 0.007,-14.80396 -1.16659,-24.49345 -4.64006,-38.31344 -11.46466,-45.61467 -43.73754,-89.16559 -99.4666,-134.22609 -30.69665,-24.82019 -41.61775,-38.90622 -42.67576,-55.0432 -0.43291,-6.60278 -0.19716,-7.8255 2.60296,-13.5 8.19418,-16.60567 32.17133,-36.97244 69.34754,-58.90549 l 13.66219,-8.06035 -9.24378,-15.1369 C 552.49651,196.3116 537.80791,172.175 524.93926,151 512.0706,129.825 500.97837,111.825 500.28984,111 c -0.68853,-0.825 -1.85689,-2.34223 -2.59637,-3.37162 -1.28403,-1.78744 -1.70088,-1.6783 -9.26898,2.42691 -20.4464,11.09084 -43.35668,28.86483 -64.99861,50.4265 -13.09405,13.04549 -26.23701,27.85914 -27.51995,31.01821 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.05163,7.89186 -3.83587,9.59302 -1.98421,4.30408 -5.16352,18.37183 -6.42412,28.42529 -2.87589,22.9357 0.73982,56.71057 7.4671,69.75126 0.7747,1.50174 3.17159,6.87097 5.32643,11.93163 4.64575,10.9106 12.21854,23.82266 20.29862,34.61035 3.21801,4.29635 5.85092,8.24217 5.85092,8.76849 0,2.37078 31.06193,31.77521 46.98159,44.47459 62.447,49.81506 73.78263,78.28439 43.19443,108.48246 -10.10357,9.9747 -24.57399,19.84954 -42.49972,29.00248 -6.9589,3.55324 -12.65789,6.76233 -12.66442,7.13131 -0.0168,0.95027 39.55594,84.82288 46.98341,99.57912 3.39128,6.7375 6.41534,12.25 6.72013,12.25 0.30479,0 8.93101,-4.31058 19.16937,-9.57906 z M 241,690.95621 c 26.57591,-2.53536 52.9647,-15.79258 74.57472,-37.4649 23.84518,-23.91392 38.54897,-53.46596 45.52203,-91.49131 2.20963,-12.04951 2.30556,-14.86516 2.66185,-78.12724 l 0.36962,-65.62723 -7.17408,-10.87277 C 340.96551,383.141 330.97536,357.96582 325.85384,329 c -1.77802,-10.05602 -1.79531,-47.00522 -0.0267,-57 5.07912,-28.70254 15.71159,-56.00428 31.80146,-81.65885 5.39575,-8.60322 6.3714,-10.8525 6.3714,-14.68872 l 0,-4.52988 -4.25,-0.58798 C 350.16424,169.20841 251.37811,158 249.27569,158 L 247,158 246.992,342.75 c -0.005,118.45458 -0.37272,187.97955 -1.02402,193.75 -2.02074,17.90366 -7.32607,31.5694 -15.53493,40.0157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.59413,-11.97227 -10.8557,-30.76511 -11.61695,-66.93587 l -0.55245,-26.25 -2.61646,0.0206 c -2.3354,0.0184 -80.91762,6.14357 -100.285092,7.81688 -4.217754,0.3644 -7.963823,0.95862 -8.324599,1.32048 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.41306,2.82689 29.47154,3.07983 51.95582,0.93481 z m 154.14983,-2.72389 0.14983,-2.73232 0.41659,2.75 c 0.32306,2.13253 0.96302,2.75 2.85017,2.75 1.33847,0 2.4821,-0.5625 2.54141,-1.25 0.52093,-6.03887 0.42094,-8.42931 -0.39737,-9.5 -0.62822,-0.82197 -0.57753,-1.25 0.14804,-1.25 1.58287,0 2.47122,4.42891 1.70624,8.50657 L 401.90937,691 l 18.65231,0 c 14.52307,0 18.54109,-0.27672 18.14998,-1.25 -0.69017,-1.71745 -48.85319,-104.20156 -49.08531,-104.44661 -0.10244,-0.10814 -1.88329,5.51148 -3.95746,12.48804 -10.12881,34.06866 -25.22094,59.10356 -49.8681,82.72144 l -10.92396,10.46777 35.06158,-0.008 35.06159,-0.008 0.14983,-2.73232 z M 366.5,687.26316 c 1.1,-0.96974 3.07872,-2.88816 4.39716,-4.26316 2.04367,-2.13134 1.99907,-1.95983 -0.30243,1.16313 -1.48478,2.01472 -3.4635,3.93314 -4.39716,4.26316 -1.3384,0.47307 -1.27442,0.22698 0.30243,-1.16313 z m 7.5,-6.11134 c 0,-0.50521 0.9,-1.15391 2,-1.44157 1.1,-0.28766 2,-0.35597 2,-0.15181 0,0.20415 -0.9,0.85286 -2,1.44156 -1.10492,0.59134 -2,0.65928 -2,0.15182 z m 5.07895,-2.95285 c -0.10178,-1.67718 6.47749,-4.438 9.27332,-3.8913 1.75712,0.34359 1.65832,0.44473 -0.54325,0.55615 -1.48004,0.0749 -2.9691,0.58618 -3.30902,1.13618 -0.33992,0.55 -1.45398,1 -2.47568,1 -1.02171,0 -2.08463,0.5625 -2.36204,1.25 -0.38995,0.9664 -0.5223,0.95482 -0.58333,-0.051 z m 20.37892,-1.26714 c -0.3631,-0.5875 -1.31303,-0.81765 -2.11096,-0.51146 -0.79794,0.3062 -1.18005,0.11866 -0.84914,-0.41677 0.37155,-0.60118 -0.62417,-0.72832 -2.60355,-0.33244 -2.29587,0.45917 -3.00249,0.31304 -2.49069,-0.51506 1.10547,-1.78869 5.12062,-1.36794 7.73569,0.81063 1.29843,1.0817 2.04984,1.9817 1.6698,2 -0.38004,0.0183 -0.98806,-0.44741 -1.35115,-1.0349 z m 194.83197,-1.07661 c 21.39443,-10.89894 41.08683,-28.05169 52.16324,-45.43596 2.42474,-3.80559 6.06778,-9.50339 8.09565,-12.66178 5.8205,-9.06537 11.86774,-27.044 14.8863,-44.25748 1.39488,-7.95434 1.57367,-27.64766 1.53889,-169.5 -0.0225,-91.6332 -0.43266,-163.289 -0.95599,-167 -2.06812,-14.66536 -3.34617,-20.58185 -6.22796,-28.83117 -1.66559,-4.76786 -3.81741,-10.92749 -4.78182,-13.68808 -1.76906,-5.06383 -5.96921,-12.17399 -14.7318,-24.93847 -8.02805,-11.69448 -27.09265,-29.4385 -39.46861,-36.73468 -3.08574,-1.81918 -7.63237,-4.56004 -10.10362,-6.09081 -9.36945,-5.80372 -30.90044,-11.97074 -49.45365,-14.16476 l -5.24952,-0.62079 5.64798,9.28438 c 3.10639,5.10641 17.66167,29.08438 32.34506,53.28438 14.68339,24.2 28.5123,46.95672 30.7309,50.5705 l 4.03382,6.5705 -16.12936,8.86762 c -38.989,21.43544 -62.98705,37.6347 -75.37935,50.88289 -3.4375,3.67491 -6.25,7.52479 -6.25,8.55528 0,3.2376 7.7335,11.83562 18.7605,20.85772 28.31138,23.16387 35.80534,29.72699 49.30432,43.18013 62.92851,62.71484 87.96118,130.68852 73.84379,200.51536 -5.6127,27.76131 -20.4186,58.71502 -39.70089,83 -3.0569,3.85 -10.74275,12.2875 -17.07966,18.75 -6.33692,6.4625 -11.19018,11.75 -10.78502,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z M 651.15789,596 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z m 6.98806,-1.52279 c 1.21144,-2.05324 1.88336,-4.54354 1.61073,-5.96974 -0.25727,-1.34582 -0.0828,-2.20901 0.38778,-1.91819 1.46924,0.90804 0.93252,4.77219 -1.1335,8.16072 -1.08986,1.7875 -2.198,3.25 -2.46254,3.25 -0.26453,0 0.45435,-1.58525 1.59753,-3.52279 z M 651.5,460 c 0.85325,-1.65 1.77636,-3 2.05136,-3 0.275,0 -0.19811,1.35 -1.05136,3 -0.85325,1.65 -1.77636,3 -2.05136,3 -0.275,0 0.19811,-1.35 1.05136,-3 z m -0.75605,-11 c 0.2897,-3.575 0.69083,-6.6875 0.89139,-6.91667 0.73723,-0.84237 0.19735,9.48181 -0.59701,11.41667 -0.48215,1.17438 -0.60367,-0.68325 -0.29438,-4.5 z m 4.84123,1 c 1.92563,-5.5277 2.4754,-12.07385 1.15479,-13.75 -0.66167,-0.8398 -0.62277,-1.25 0.11853,-1.25 3.02319,0 1.97766,13.23672 -1.39142,17.61591 -1.19248,1.54999 -1.17153,1.08612 0.1181,-2.61591 z m -0.12731,-17.06817 c -0.3631,-0.5875 -1.31303,-0.81765 -2.11096,-0.51146 -0.79794,0.3062 -1.18005,0.11866 -0.84914,-0.41677 0.37155,-0.60118 -0.62417,-0.72832 -2.60355,-0.33244 -2.29587,0.45917 -3.00249,0.31304 -2.49069,-0.51506 1.10547,-1.78869 5.12062,-1.36794 7.73569,0.81063 1.29843,1.0817 2.04984,1.9817 1.6698,2 -0.38004,0.0183 -0.98806,-0.44741 -1.35115,-1.0349 z m -17.82156,-0.96814 c 0.56997,-0.56997 2.57247,-1.18829 4.45,-1.37406 1.87753,-0.18576 2.51369,-0.13132 1.41369,0.12099 -1.1,0.2523 -2.4275,0.87063 -2.95,1.37406 -1.37451,1.32434 -4.24003,1.20535 -2.91369,-0.12099 z m -72.621,-87.6248 c -0.017,-1.28914 5.60833,-6.33889 7.06142,-6.33889 0.5078,0 -0.0892,1.0125 -1.32673,2.25 -1.2375,1.2375 -2.60391,2.25 -3.03647,2.25 -0.43257,0 -1.21317,0.675 -1.73469,1.5 -0.53176,0.84121 -0.95494,0.99005 -0.96353,0.33889 z M 581,341.82681 C 581,341.37206 582.35,341 584,341 c 1.65,0 3,0.17393 3,0.3865 0,0.21258 -1.35,0.58464 -3,0.82681 -1.65,0.24217 -3,0.0682 -3,-0.3865 z m -3.26667,-0.9509 c 0.67834,-0.68342 1.48524,-0.99067 1.79313,-0.68278 0.30789,0.30789 -0.24711,0.86705 -1.23333,1.24258 -1.4252,0.54268 -1.54006,0.42782 -0.5598,-0.5598 z M 595,340.89228 c 1.375,-0.53952 3.22311,-1.92221 4.10691,-3.07264 0.98306,-1.27964 1.859,-1.68382 2.25623,-1.04108 0.70974,1.14838 -5.25401,5.26021 -7.48117,5.15805 -0.76009,-0.0349 -0.25697,-0.50481 1.11803,-1.04433 z m -2.07939,-5.14549 c 1.33134,-1.5064 2.63993,-2.51958 2.90799,-2.25152 0.26806,0.26806 1.20379,-0.0635 2.07939,-0.73671 0.96812,-0.74438 0.84329,-0.34669 -0.31853,1.0148 -1.05079,1.2314 -2.13927,2.01016 -2.41884,1.73059 -0.27958,-0.27957 -1.44484,0.27695 -2.58947,1.23671 -1.52157,1.27583 -1.4303,1.0086 0.33946,-0.99387 z m 9.72464,0.48823 c -0.31577,-0.51093 0.7105,-2.15973 2.28061,-3.66399 1.57011,-1.50426 3.11311,-2.31699 3.42889,-1.80605 0.31577,0.51093 -0.7105,2.15973 -2.28061,3.66399 -1.57011,1.50426 -3.11311,2.31699 -3.42889,1.80605 z M 606,333.5 c 1.29175,-1.375 2.12363,-2.5 1.84863,-2.5 -0.275,0 -1.55688,1.125 -2.84863,2.5 -1.29175,1.375 -2.12363,2.5 -1.84863,2.5 0.275,0 1.55688,-1.125 2.84863,-2.5 z m -5.4228,-7.3988 c 1.33254,-1.96101 2.42029,-4.02351 2.41722,-4.58333 -0.0173,-3.15669 -2.49885,-9.05154 -5.17592,-12.2952 l -3.07239,-3.72267 3.56676,3.66965 c 4.45029,4.57865 6.26226,10.55767 4.66565,15.39544 -0.62349,1.8892 -1.57528,3.43491 -2.11509,3.43491 -0.5398,0 -0.7497,0.375 -0.46644,0.83333 0.28327,0.45834 -0.10543,0.83334 -0.86378,0.83334 -0.97654,0 -0.67196,-1.04023 1.04399,-3.56547 z m 9.25249,2.1488 c 0.49503,-0.9625 0.7016,-2.425 0.45905,-3.25 -0.37917,-1.2897 -0.29991,-1.29725 0.56535,-0.0539 0.93643,1.34564 -0.10875,5.05388 -1.42446,5.05388 -0.275,0 -0.095,-0.7875 0.40006,-1.75 z m 1.79385,-4.78866 c -0.34295,-0.8937 -0.58486,-2.37561 -0.53759,-3.29313 0.0473,-0.91751 0.4824,-0.34083 0.96694,1.28152 0.94266,3.15626 0.60928,4.71823 -0.42935,2.01161 z m -0.54459,-10.04467 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58438 -0.0789,1.91667 -0.33229,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z m -0.473,-5.26461 -1.89405,-2.65206 2.3385,2.22222 c 1.28617,1.22222 2.13849,2.41565 1.89404,2.65206 -0.24444,0.23641 -1.29676,-0.76359 -2.33849,-2.22222 z m -88.58927,0.98792 c -0.051,-4.15655 12.99638,-22.46026 14.75596,-20.70068 0.22287,0.22287 -1.44451,2.07634 -3.70528,4.11881 -2.40373,2.17162 -5.54788,6.66752 -7.57225,10.82773 -1.90397,3.91279 -3.46926,6.50215 -3.47843,5.75414 z m 81.54219,-4.67178 c -1.39898,-1.05814 -1.53863,-1.47669 -0.5,-1.49861 3.78883,-0.0799 -3.23205,-2.41862 -9.05887,-3.01753 l -6.5,-0.66811 5.5,-0.12001 c 3.52199,-0.0769 7.02846,0.57378 9.75,1.80913 4.12342,1.87169 6.02848,3.63068 2.5,2.30831 -1.53249,-0.57433 -1.57942,-0.44613 -0.37756,1.03139 1.67076,2.05397 1.26068,2.10249 -1.31357,0.15543 z M 577,303.94098 c 0,-0.58246 0.45,-0.7809 1,-0.44098 0.55,0.33992 1,0.81648 1,1.05902 0,0.24254 -0.45,0.44098 -1,0.44098 -0.55,0 -1,-0.47656 -1,-1.05902 z M 582.5,302 c 1.65,-1.09275 3.45,-1.98682 4,-1.98682 0.55,0 -0.35,0.89407 -2,1.98682 -1.65,1.09275 -3.45,1.98682 -4,1.98682 -0.55,0 0.35,-0.89407 2,-1.98682 z m 11.25,-0.66228 c 0.6875,-0.27741 1.8125,-0.27741 2.5,0 0.6875,0.27741 0.125,0.50439 -1.25,0.50439 -1.375,0 -1.9375,-0.22698 -1.25,-0.50439 z m -17.0546,-3.85028 C 575.78073,295.56935 575.23852,294 575.4905,294 c 0.68426,0 3.71992,6.12291 3.26246,6.58037 -0.21698,0.21698 -1.14288,-1.17483 -2.05756,-3.09293 z M 572.92431,297.25 570.5,294.5 l 2.75,2.42431 c 2.57029,2.26589 3.20859,3.07569 2.42431,3.07569 -0.17912,0 -1.41662,-1.2375 -2.75,-2.75 z M 566,292.5 c -1.375,-0.78602 -2.02351,-1.44508 -1.44113,-1.46456 0.58238,-0.0195 1.93238,0.62525 3,1.43276 2.46898,1.86744 1.68038,1.88353 -1.55887,0.0318 z m 3.70803,-3.83661 c 0.3686,-0.5964 -0.0499,-0.74617 -1.03199,-0.36932 -1.0186,0.39088 -1.56079,0.16846 -1.41404,-0.58006 0.13152,-0.67089 -0.88044,-1.26252 -2.262,-1.32244 -1.375,-0.0596 -3.625,-0.21082 -5,-0.33595 -2.43866,-0.22194 -2.42811,-0.24901 0.42979,-1.10317 2.09458,-0.62603 3.86319,-0.43272 6.20401,0.67806 3.94312,1.87114 6.03206,4.03616 3.89431,4.03616 -0.79207,0 -1.16111,-0.45148 -0.82008,-1.00328 z m -30.2669,-2.10822 C 540.50875,285.69982 541.82125,285 542.3578,285 c 1.27054,0 0.70323,0.4619 -2.3578,1.91971 -2.35727,1.12265 -2.38918,1.10183 -0.55887,-0.36454 z M 544,285.15638 c 0,-0.60148 0.68073,-0.83239 1.51273,-0.51312 0.83201,0.31927 2.06951,0.17481 2.75,-0.32101 0.6805,-0.49583 3.03727,-0.61003 5.23727,-0.25378 l 4,0.64772 -3.625,0.1419 c -1.99375,0.0781 -5.03125,0.42316 -6.75,0.76691 -1.976,0.3952 -3.125,0.2229 -3.125,-0.46862 z M 419,563.73163 c 25.31787,-12.30917 39.21066,-21.80156 46.55886,-31.81181 4.31302,-5.87551 4.21103,-6.80845 -1.73372,-15.85948 C 457.8325,506.93639 443.31415,492.78122 423,476.25645 c -9.625,-7.82956 -19.6375,-16.0871 -22.25,-18.35008 l -4.75,-4.1145 -0.01,37.35406 c -0.0102,38.62782 -0.99044,59.66907 -3.52156,75.5933 -0.8077,5.08158 -1.46855,9.44432 -1.46855,9.69498 0,0.65153 7.96603,-2.96237 28,-12.70258 z M 407.15789,510 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z m 6.98806,-1.52279 c 1.21144,-2.05324 1.88336,-4.54354 1.61073,-5.96974 -0.25727,-1.34582 -0.0828,-2.20901 0.38778,-1.91819 1.46924,0.90804 0.93252,4.77219 -1.1335,8.16072 -1.08986,1.7875 -2.198,3.25 -2.46254,3.25 -0.26453,0 0.45435,-1.58525 1.59753,-3.52279 z M 153.5,450.49366 c 32.45,-2.47066 59.1125,-4.49246 59.25,-4.49288 C 212.8875,446.00035 213,423.725 213,396.5 l 0,-49.5 -2.75,-0.0768 c -1.5125,-0.0423 -4.55,-0.68142 -6.75,-1.42033 l -4,-1.34347 4.5,0.60305 c 9.49572,1.27253 8.46531,4.97497 8.76382,-31.49016 l 0.26383,-32.22777 -3.01383,0.60277 c -1.88198,0.37634 -3.01382,0.192 -3.01382,-0.49091 0,-0.60148 0.68073,-0.83239 1.51273,-0.51312 0.83201,0.31927 2.18201,0.0251 3,-0.65383 1.29334,-1.07337 1.48727,-11.5114 1.48727,-80.049 l 0,-78.81469 3.25,0.47587 C 223.59967,122.67775 390.2813,141 392.7215,141 c 1.96178,0 4.86887,-2.14693 11.21343,-8.2813 4.71079,-4.55472 11.71507,-11.07878 15.56507,-14.49792 l 7,-6.21662 -106,0.24792 -106,0.24792 -12.17888,2.77199 C 191.03894,117.83989 180.03879,121.6936 169,126.94545 149.80162,136.07935 127.87612,155.0389 116.89735,172 c -2.31407,3.575 -5.68466,8.75 -7.4902,11.5 -5.63522,8.58294 -12.48361,26.82184 -15.207052,40.5 -2.086783,10.48062 -3.028934,231.00417 -0.986879,230.99289 0.707729,-0.004 27.836781,-2.02856 60.286781,-4.49923 z M 97.157895,390 c 0,-1.375 0.226973,-1.9375 0.504386,-1.25 0.277412,0.6875 0.277412,1.8125 0,2.5 -0.277413,0.6875 -0.504386,0.125 -0.504386,-1.25 z m 6.988055,-1.52279 c 1.21144,-2.05324 1.88336,-4.54354 1.61073,-5.96974 -0.25727,-1.34582 -0.0828,-2.20901 0.38778,-1.91819 1.46924,0.90804 0.93252,4.77219 -1.1335,8.16072 -1.08986,1.7875 -2.198,3.25 -2.46254,3.25 -0.26453,0 0.45435,-1.58525 1.59753,-3.52279 z M 197.5,344 c 0.33992,-0.55 0.81648,-1 1.05902,-1 0.24254,0 0.44098,0.45 0.44098,1 0,0.55 -0.47656,1 -1.05902,1 -0.58246,0 -0.7809,-0.45 -0.44098,-1 z m -5.06238,-2.05035 c -2.11787,-1.3961 -2.44928,-1.93831 -1.18762,-1.94306 0.9625,-0.004 1.75,0.41211 1.75,0.92386 0,0.51175 1.0125,1.0748 2.25,1.25123 1.26061,0.17973 1.78284,0.62501 1.18762,1.01262 -0.58431,0.3805 -2.38431,-0.17959 -4,-1.24465 z M 187.27814,337.75 c -1.79396,-2.31959 -2.40065,-3.75004 -1.58716,-3.7422 0.44496,0.004 1.32918,1.12929 1.96493,2.5 1.26466,2.72664 1.12513,3.18544 -0.37777,1.2422 z m -3.86638,-10.36867 c -0.37338,-1.99027 -0.44087,-7.43343 -0.14999,-12.0959 0.44456,-7.12579 1.11455,-9.66226 4.20264,-15.91059 3.1953,-6.46525 11.13907,-16.10469 12.30823,-14.93554 0.22287,0.22287 -1.35017,1.99111 -3.49564,3.92941 -8.1442,7.3578 -12.76877,20.54308 -12.0588,34.38129 0.2328,4.5375 0.29933,8.25 0.14785,8.25 -0.15148,0 -0.58091,-1.6284 -0.95429,-3.61867 z m 19.02937,-44.82616 C 203.50875,281.69982 204.82125,281 205.3578,281 c 1.27054,0 0.70323,0.4619 -2.3578,1.91971 -2.35727,1.12265 -2.38918,1.10183 -0.55887,-0.36454 z M 142.25,244.31067 c 0.9625,-0.25152 2.5375,-0.25152 3.5,0 0.9625,0.25153 0.175,0.45733 -1.75,0.45733 -1.925,0 -2.7125,-0.2058 -1.75,-0.45733 z M 150,243 c 0.825,-0.53316 1.95,-0.96937 2.5,-0.96937 0.55,0 0.325,0.43621 -0.5,0.96937 -0.825,0.53316 -1.95,0.96937 -2.5,0.96937 -0.55,0 -0.325,-0.43621 0.5,-0.96937 z m -18,-2.08935 c -1.66051,-1.35822 -1.82841,-1.69779 -0.5,-1.01125 3.26177,1.68572 5.07007,3.07046 4,3.06305 -0.55,-0.004 -2.125,-0.92712 -3.5,-2.0518 z m 22,0.73954 c 0,-0.23109 1.18041,-1.1936 2.62312,-2.13891 1.44272,-0.9453 2.31766,-1.22448 1.94431,-0.62038 C 157.85397,240.04529 154,242.37357 154,241.65019 z m -26.04584,-5.73584 c -0.61391,-1.1471 -0.92784,-2.274 -0.69762,-2.50422 0.23022,-0.23022 0.93203,0.70832 1.55958,2.08564 1.37807,3.02454 0.70709,3.35038 -0.86196,0.41858 z M 163.48566,233.5 c 1.01891,-1.65 2.87407,-4.575 4.12258,-6.5 1.24851,-1.925 2.5712,-4.7375 2.9393,-6.25 0.3681,-1.5125 1.07049,-2.75 1.56087,-2.75 0.49037,0 0.89159,0.24293 0.89159,0.53984 0,1.10694 -4.37727,9.08188 -6.83911,12.46016 -3.50378,4.80807 -4.91472,6.12661 -2.67523,2.5 z m -2.77873,-3.5 c 1.6015,-3.025 2.73961,-6.2875 2.52912,-7.25 -0.21048,-0.9625 -0.0122,-1.74972 0.44063,-1.74938 0.45282,3.4e-4 0.66739,-2.24966 0.47681,-5 -0.24151,-3.48528 0.0272,-5.00062 0.88691,-5.00062 0.90144,0 1.09673,1.7029 0.72556,6.32693 -0.5282,6.58015 -2.34323,11.40921 -5.89082,15.67307 -1.49629,1.79839 -1.26286,0.95647 0.83179,-3 z M 172,214.60765 c 0,-1.49913 0.40992,-2.47234 0.91093,-2.1627 1.00387,0.62043 0.87649,3.10097 -0.21532,4.19277 C 172.31302,217.02031 172,216.10678 172,214.60765 z M 163.875,209.5 c -0.0687,-0.275 -0.18125,-0.88413 -0.25,-1.35362 -0.30289,-2.06842 -4.38066,-6.48669 -7.125,-7.71995 -2.15117,-0.9667 -2.46104,-1.35922 -1.09516,-1.38729 2.17597,-0.0447 9.59516,7.30319 9.59516,9.50297 0,1.35731 -0.84523,2.07699 -1.125,0.95789 z m 7.65093,-2.54681 c -0.44294,-1.89925 -0.85497,-3.75319 -0.91564,-4.11986 -0.14819,-0.89575 -1.6168,-2.32326 -2.44362,-2.37525 -0.36667,-0.023 -2.24167,-0.88532 -4.16667,-1.91616 -1.925,-1.03084 -6.2,-2.18791 -9.5,-2.57126 l -6,-0.69701 6.02749,-0.13683 c 4.02548,-0.0914 6.7657,0.38023 8.25,1.41988 1.22238,0.85619 2.22251,1.22018 2.22251,0.80887 0,-0.4113 0.66069,0.12568 1.4682,1.1933 0.8075,1.06762 1.4825,1.54853 1.5,1.06869 0.0507,-1.39202 3.04014,1.48346 4.46995,4.29961 0.72009,1.41828 0.9892,3.44932 0.5997,4.52602 -0.58855,1.62694 -0.84109,1.37639 -1.51192,-1.5 z M 139,200.44156 c 0,-0.20415 0.9,-0.85286 2,-1.44156 1.10492,-0.59134 2,-0.65928 2,-0.15182 0,0.50521 -0.9,1.15391 -2,1.44157 -1.1,0.28766 -2,0.35597 -2,0.15181 z m 7.26375,-2.15914 c 1.52006,-0.22986 3.77006,-0.22371 5,0.0136 1.22994,0.23736 -0.0137,0.42542 -2.76375,0.41792 -2.75,-0.008 -3.75631,-0.20172 -2.23625,-0.43157 z"
+       id="path3328"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#202c34"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 C 230.77077,731.78039 180.24956,728.57821 143.5,710.26865 93.66427,685.43925 59.944546,635.27417 49.091119,569.81589 45.564448,548.54613 44.896177,538.57996 44.302569,498.40251 l -0.577652,-39.09749 3.262542,-0.65251 C 48.781856,458.29363 51.930943,458 53.985429,458 c 2.054486,0 5.80681,-0.28391 8.338499,-0.63092 l 4.60307,-0.63092 0.351946,-112.11908 c 0.344628,-109.788 0.396572,-112.35056 2.49836,-123.25247 3.620731,-18.78063 11.532895,-40.09048 19.333743,-52.07163 1.863924,-2.86275 5.188953,-8.03775 7.388953,-11.5 7.79959,-12.27457 36.2445,-39.28079 48.23634,-45.79663 1.52001,-0.82591 4.53711,-2.60324 6.70466,-3.94961 3.8264,-2.37677 20.61369,-9.567247 29.39316,-12.589943 2.38379,-0.820716 10.70879,-2.943341 18.5,-4.716943 L 213.5,87.517124 337.76602,87.23589 l 124.26603,-0.281233 5.23397,-3.308105 c 13.20871,-8.348491 40.90108,-22.879449 41.83076,-21.949767 0.53978,0.539776 4.22632,6.341317 8.19232,12.892313 L 524.5,86.5 l 12,0.686992 c 29.27474,1.675958 60.37169,10.419819 76.73855,21.577398 2.3438,1.59781 7.41145,4.93531 11.26145,7.41668 14.27043,9.19743 39.73244,35.97587 46.90128,49.32615 1.47457,2.74603 4.03295,7.05859 5.6853,9.58347 2.76021,4.21775 5.78435,11.74376 11.01376,27.40931 2.03257,6.08892 5.25119,21.67484 6.91801,33.5 0.52301,3.71048 0.93025,75.41061 0.94893,167.07191 L 696,563.64383 l -2.48256,14.65461 c -3.41235,20.14321 -12.20172,45.334 -18.88654,54.12987 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -6.19973,12.03624 -26.99616,34.05014 -44.08602,46.66691 -9.67257,7.14088 -33.84993,19.05836 -46,22.67429 -5.87476,1.74835 -30.10373,6.60429 -36.25168,7.2655 -4.81574,0.51794 -7.91655,1.65388 -13.5,4.94557 -14.08047,8.30104 -28.44463,15.57092 -45.5553,23.05608 -9.51884,4.16406 -17.39384,7.56909 -17.5,7.56671 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 C 573.60791,661.54263 614.93424,613.70722 625.6303,556.5 c 2.5878,-13.84071 2.63886,-45.2747 0.0934,-57.5 -6.4355,-30.90836 -21.66561,-60.9827 -45.4366,-89.72198 -11.54341,-13.95605 -36.04194,-37.54494 -54.29299,-52.27703 -25.56495,-20.63583 -34.39861,-29.95031 -41.24916,-43.49434 -3.499,-6.91778 -4.73966,-16.96263 -2.81528,-22.79355 5.50622,-16.68401 32.27746,-40.109 73.23976,-64.08523 l 11.66942,-6.83039 -9.2419,-15.14874 C 552.5139,196.31693 537.82404,172.175 524.9528,151 c -12.87123,-21.175 -23.96757,-39.175 -24.65853,-40 -0.69096,-0.825 -1.86132,-2.34223 -2.6008,-3.37162 -1.28403,-1.78744 -1.70088,-1.6783 -9.26898,2.42691 -20.4464,11.09084 -43.35668,28.86483 -64.99861,50.4265 -13.09405,13.04549 -26.23701,27.85914 -27.51995,31.01821 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.05163,7.89186 -3.83587,9.59302 -1.98421,4.30408 -5.16352,18.37183 -6.42412,28.42529 -2.87589,22.9357 0.73982,56.71057 7.4671,69.75126 0.7747,1.50174 3.17159,6.87097 5.32643,11.93163 4.64575,10.9106 12.21854,23.82266 20.29862,34.61035 3.21801,4.29635 5.85092,8.24217 5.85092,8.76849 0,2.334 31.03302,31.75229 46.57721,44.15367 37.80091,30.15811 56.03372,51.92548 59.48473,71.01629 3.98873,22.0654 -16.45859,45.38479 -58.70905,66.95545 -6.78102,3.462 -12.33448,6.59645 -12.34101,6.96543 -0.0168,0.95027 39.55594,84.82288 46.98341,99.57912 3.39128,6.7375 6.41534,12.25 6.72013,12.25 0.30479,0 8.93101,-4.31058 19.16937,-9.57906 z m -262.86608,-6.45507 c 26.44467,-2.49106 52.83244,-15.74023 74.5336,-37.42295 26.96037,-26.93746 42.63162,-61.90641 47.39317,-105.75351 C 363.56525,542.08222 364,513.33686 364,478.06491 l 0,-60.01393 -7.10997,-10.77549 C 340.9684,383.14552 330.96787,357.92346 325.85384,329 c -1.77802,-10.05602 -1.79531,-47.00522 -0.0267,-57 5.07912,-28.70254 15.71159,-56.00428 31.80146,-81.65885 5.39575,-8.60322 6.3714,-10.8525 6.3714,-14.68872 l 0,-4.52988 -4.25,-0.58798 C 350.16424,169.20841 251.37811,158 249.27569,158 L 247,158 246.9827,342.25 c -0.0108,115.13874 -0.39079,187.8134 -1.01297,193.75 -1.89813,18.11123 -7.20044,31.93817 -15.53685,40.5157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.59413,-11.97227 -10.8557,-30.76511 -11.61695,-66.93587 l -0.55245,-26.25 -2.61646,0.0206 c -2.3354,0.0184 -80.91762,6.14357 -100.285092,7.81688 -4.217754,0.3644 -7.963823,0.95862 -8.324599,1.32048 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z m 154.13112,-2.73355 0.14983,-2.73232 0.41659,2.75 c 0.32306,2.13253 0.96302,2.75 2.85017,2.75 1.33847,0 2.4821,-0.5625 2.54141,-1.25 0.52093,-6.03887 0.42094,-8.42931 -0.39737,-9.5 -0.62822,-0.82197 -0.57753,-1.25 0.14804,-1.25 1.58287,0 2.47122,4.42891 1.70624,8.50657 L 401.90937,691 l 18.62865,0 c 10.97733,0 18.49174,-0.37968 18.29531,-0.92441 -0.18333,-0.50843 -11.34863,-24.39063 -24.81178,-53.07157 -16.91339,-36.03107 -24.67826,-51.5842 -25.12497,-50.32559 -0.35557,1.00186 -2.08598,6.77157 -3.84535,12.82157 -9.29007,31.94617 -24.98172,57.75763 -49.25044,81.01287 l -10.92396,10.46777 35.06158,-0.008 35.06159,-0.008 0.14983,-2.73232 z M 366.5,687.26316 c 1.1,-0.96974 3.07872,-2.88816 4.39716,-4.26316 2.04367,-2.13134 1.99907,-1.95983 -0.30243,1.16313 -1.48478,2.01472 -3.4635,3.93314 -4.39716,4.26316 -1.3384,0.47307 -1.27442,0.22698 0.30243,-1.16313 z m 7.5,-6.11134 c 0,-0.50521 0.9,-1.15391 2,-1.44157 1.1,-0.28766 2,-0.35597 2,-0.15181 0,0.20415 -0.9,0.85286 -2,1.44156 -1.10492,0.59134 -2,0.65928 -2,0.15182 z m 5.07895,-2.95285 c -0.10178,-1.67718 6.47749,-4.438 9.27332,-3.8913 1.75712,0.34359 1.65832,0.44473 -0.54325,0.55615 -1.48004,0.0749 -2.9691,0.58618 -3.30902,1.13618 -0.33992,0.55 -1.45398,1 -2.47568,1 -1.02171,0 -2.08463,0.5625 -2.36204,1.25 -0.38995,0.9664 -0.5223,0.95482 -0.58333,-0.051 z m 20.37892,-1.26714 c -0.3631,-0.5875 -1.31303,-0.81765 -2.11096,-0.51146 -0.79794,0.3062 -1.18005,0.11866 -0.84914,-0.41677 0.37155,-0.60118 -0.62417,-0.72832 -2.60355,-0.33244 -2.29587,0.45917 -3.00249,0.31304 -2.49069,-0.51506 1.10547,-1.78869 5.12062,-1.36794 7.73569,0.81063 1.29843,1.0817 2.04984,1.9817 1.6698,2 -0.38004,0.0183 -0.98806,-0.44741 -1.35115,-1.0349 z m 194.83197,-1.07661 c 24.93584,-12.70304 42.88425,-29.45669 57.31982,-53.50425 1.03969,-1.73197 3.10797,-5.11259 4.59618,-7.5125 4.13398,-6.66651 10.55675,-26.23956 12.78027,-38.94719 1.93578,-11.06322 1.9929,-16.02798 1.98343,-172.39128 -0.006,-92.04982 -0.40091,-163.56957 -0.92311,-167 -2.30834,-15.16378 -4.17319,-22.89469 -8.32921,-34.52935 -4.31369,-12.07606 -7.17269,-17.40238 -17.4292,-32.47065 -7.80615,-11.46834 -27.08208,-29.38311 -39.48028,-36.6924 -3.08574,-1.81918 -7.6249,-4.55567 -10.08702,-6.08109 -9.55852,-5.92202 -30.51787,-11.92726 -49.46358,-14.17225 l -5.24286,-0.62125 6.83329,11.28349 c 12.6654,20.91379 57.81266,95.22661 61.87936,101.854 l 4.03178,6.5705 -16.12936,8.86762 c -36.52093,20.07853 -59.22498,35.15812 -72.37935,48.07292 -5.78738,5.68199 -9.25,9.85967 -9.25,11.16021 0,3.43225 7.49007,11.84149 18.7605,21.06276 28.53941,23.35044 35.81361,29.72288 49.2822,43.17287 17.46548,17.44136 30.29614,32.94095 42.01948,50.76003 40.73333,61.91329 46.80024,131.18782 16.91276,193.11702 -10.56342,21.88823 -22.82737,39.0026 -41.8456,58.39557 -6.33762,6.4625 -11.19146,11.75 -10.7863,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z M 651.15789,596 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z m 6.98806,-1.52279 c 1.21144,-2.05324 1.88336,-4.54354 1.61073,-5.96974 -0.25727,-1.34582 -0.0828,-2.20901 0.38778,-1.91819 1.46924,0.90804 0.93252,4.77219 -1.1335,8.16072 -1.08986,1.7875 -2.198,3.25 -2.46254,3.25 -0.26453,0 0.45435,-1.58525 1.59753,-3.52279 z M 651.5,460 c 0.85325,-1.65 1.77636,-3 2.05136,-3 0.275,0 -0.19811,1.35 -1.05136,3 -0.85325,1.65 -1.77636,3 -2.05136,3 -0.275,0 0.19811,-1.35 1.05136,-3 z m -0.75605,-11 c 0.2897,-3.575 0.69083,-6.6875 0.89139,-6.91667 0.73723,-0.84237 0.19735,9.48181 -0.59701,11.41667 -0.48215,1.17438 -0.60367,-0.68325 -0.29438,-4.5 z m 4.84123,1 c 1.92563,-5.5277 2.4754,-12.07385 1.15479,-13.75 -0.66167,-0.8398 -0.62277,-1.25 0.11853,-1.25 3.02319,0 1.97766,13.23672 -1.39142,17.61591 -1.19248,1.54999 -1.17153,1.08612 0.1181,-2.61591 z m -0.12731,-17.06817 c -0.3631,-0.5875 -1.31303,-0.81765 -2.11096,-0.51146 -0.79794,0.3062 -1.18005,0.11866 -0.84914,-0.41677 0.37155,-0.60118 -0.62417,-0.72832 -2.60355,-0.33244 -2.29587,0.45917 -3.00249,0.31304 -2.49069,-0.51506 1.10547,-1.78869 5.12062,-1.36794 7.73569,0.81063 1.29843,1.0817 2.04984,1.9817 1.6698,2 -0.38004,0.0183 -0.98806,-0.44741 -1.35115,-1.0349 z m -17.82156,-0.96814 c 0.56997,-0.56997 2.57247,-1.18829 4.45,-1.37406 1.87753,-0.18576 2.51369,-0.13132 1.41369,0.12099 -1.1,0.2523 -2.4275,0.87063 -2.95,1.37406 -1.37451,1.32434 -4.24003,1.20535 -2.91369,-0.12099 z m -72.621,-87.6248 c -0.017,-1.28914 5.60833,-6.33889 7.06142,-6.33889 0.5078,0 -0.0892,1.0125 -1.32673,2.25 -1.2375,1.2375 -2.60391,2.25 -3.03647,2.25 -0.43257,0 -1.21317,0.675 -1.73469,1.5 -0.53176,0.84121 -0.95494,0.99005 -0.96353,0.33889 z M 581,341.82681 C 581,341.37206 582.35,341 584,341 c 1.65,0 3,0.17393 3,0.3865 0,0.21258 -1.35,0.58464 -3,0.82681 -1.65,0.24217 -3,0.0682 -3,-0.3865 z m -3.26667,-0.9509 c 0.67834,-0.68342 1.48524,-0.99067 1.79313,-0.68278 0.30789,0.30789 -0.24711,0.86705 -1.23333,1.24258 -1.4252,0.54268 -1.54006,0.42782 -0.5598,-0.5598 z M 595,340.89228 c 1.375,-0.53952 3.22311,-1.92221 4.10691,-3.07264 0.98306,-1.27964 1.859,-1.68382 2.25623,-1.04108 0.70974,1.14838 -5.25401,5.26021 -7.48117,5.15805 -0.76009,-0.0349 -0.25697,-0.50481 1.11803,-1.04433 z m -2.07939,-5.14549 c 1.33134,-1.5064 2.63993,-2.51958 2.90799,-2.25152 0.26806,0.26806 1.20379,-0.0635 2.07939,-0.73671 0.96812,-0.74438 0.84329,-0.34669 -0.31853,1.0148 -1.05079,1.2314 -2.13927,2.01016 -2.41884,1.73059 -0.27958,-0.27957 -1.44484,0.27695 -2.58947,1.23671 -1.52157,1.27583 -1.4303,1.0086 0.33946,-0.99387 z m 9.72464,0.48823 c -0.31577,-0.51093 0.7105,-2.15973 2.28061,-3.66399 1.57011,-1.50426 3.11311,-2.31699 3.42889,-1.80605 0.31577,0.51093 -0.7105,2.15973 -2.28061,3.66399 -1.57011,1.50426 -3.11311,2.31699 -3.42889,1.80605 z M 606,333.5 c 1.29175,-1.375 2.12363,-2.5 1.84863,-2.5 -0.275,0 -1.55688,1.125 -2.84863,2.5 -1.29175,1.375 -2.12363,2.5 -1.84863,2.5 0.275,0 1.55688,-1.125 2.84863,-2.5 z m -5.4228,-7.3988 c 1.33254,-1.96101 2.42029,-4.02351 2.41722,-4.58333 -0.0173,-3.15669 -2.49885,-9.05154 -5.17592,-12.2952 l -3.07239,-3.72267 3.56676,3.66965 c 4.45029,4.57865 6.26226,10.55767 4.66565,15.39544 -0.62349,1.8892 -1.57528,3.43491 -2.11509,3.43491 -0.5398,0 -0.7497,0.375 -0.46644,0.83333 0.28327,0.45834 -0.10543,0.83334 -0.86378,0.83334 -0.97654,0 -0.67196,-1.04023 1.04399,-3.56547 z m 9.25249,2.1488 c 0.49503,-0.9625 0.7016,-2.425 0.45905,-3.25 -0.37917,-1.2897 -0.29991,-1.29725 0.56535,-0.0539 0.93643,1.34564 -0.10875,5.05388 -1.42446,5.05388 -0.275,0 -0.095,-0.7875 0.40006,-1.75 z m 1.79385,-4.78866 c -0.34295,-0.8937 -0.58486,-2.37561 -0.53759,-3.29313 0.0473,-0.91751 0.4824,-0.34083 0.96694,1.28152 0.94266,3.15626 0.60928,4.71823 -0.42935,2.01161 z m -0.54459,-10.04467 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58438 -0.0789,1.91667 -0.33229,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z m -0.473,-5.26461 -1.89405,-2.65206 2.3385,2.22222 c 1.28617,1.22222 2.13849,2.41565 1.89404,2.65206 -0.24444,0.23641 -1.29676,-0.76359 -2.33849,-2.22222 z m -88.58927,0.98792 c -0.051,-4.15655 12.99638,-22.46026 14.75596,-20.70068 0.22287,0.22287 -1.44451,2.07634 -3.70528,4.11881 -2.40373,2.17162 -5.54788,6.66752 -7.57225,10.82773 -1.90397,3.91279 -3.46926,6.50215 -3.47843,5.75414 z m 81.54219,-4.67178 c -1.39898,-1.05814 -1.53863,-1.47669 -0.5,-1.49861 3.78883,-0.0799 -3.23205,-2.41862 -9.05887,-3.01753 l -6.5,-0.66811 5.5,-0.12001 c 3.52199,-0.0769 7.02846,0.57378 9.75,1.80913 4.12342,1.87169 6.02848,3.63068 2.5,2.30831 -1.53249,-0.57433 -1.57942,-0.44613 -0.37756,1.03139 1.67076,2.05397 1.26068,2.10249 -1.31357,0.15543 z M 577,303.94098 c 0,-0.58246 0.45,-0.7809 1,-0.44098 0.55,0.33992 1,0.81648 1,1.05902 0,0.24254 -0.45,0.44098 -1,0.44098 -0.55,0 -1,-0.47656 -1,-1.05902 z M 582.5,302 c 1.65,-1.09275 3.45,-1.98682 4,-1.98682 0.55,0 -0.35,0.89407 -2,1.98682 -1.65,1.09275 -3.45,1.98682 -4,1.98682 -0.55,0 0.35,-0.89407 2,-1.98682 z m 11.25,-0.66228 c 0.6875,-0.27741 1.8125,-0.27741 2.5,0 0.6875,0.27741 0.125,0.50439 -1.25,0.50439 -1.375,0 -1.9375,-0.22698 -1.25,-0.50439 z m -17.0546,-3.85028 C 575.78073,295.56935 575.23852,294 575.4905,294 c 0.68426,0 3.71992,6.12291 3.26246,6.58037 -0.21698,0.21698 -1.14288,-1.17483 -2.05756,-3.09293 z M 572.92431,297.25 570.5,294.5 l 2.75,2.42431 c 2.57029,2.26589 3.20859,3.07569 2.42431,3.07569 -0.17912,0 -1.41662,-1.2375 -2.75,-2.75 z M 566,292.5 c -1.375,-0.78602 -2.02351,-1.44508 -1.44113,-1.46456 0.58238,-0.0195 1.93238,0.62525 3,1.43276 2.46898,1.86744 1.68038,1.88353 -1.55887,0.0318 z m 3.70803,-3.83661 c 0.3686,-0.5964 -0.0499,-0.74617 -1.03199,-0.36932 -1.0186,0.39088 -1.56079,0.16846 -1.41404,-0.58006 0.13152,-0.67089 -0.88044,-1.26252 -2.262,-1.32244 -1.375,-0.0596 -3.625,-0.21082 -5,-0.33595 -2.43866,-0.22194 -2.42811,-0.24901 0.42979,-1.10317 2.09458,-0.62603 3.86319,-0.43272 6.20401,0.67806 3.94312,1.87114 6.03206,4.03616 3.89431,4.03616 -0.79207,0 -1.16111,-0.45148 -0.82008,-1.00328 z m -30.2669,-2.10822 C 540.50875,285.69982 541.82125,285 542.3578,285 c 1.27054,0 0.70323,0.4619 -2.3578,1.91971 -2.35727,1.12265 -2.38918,1.10183 -0.55887,-0.36454 z M 544,285.15638 c 0,-0.60148 0.68073,-0.83239 1.51273,-0.51312 0.83201,0.31927 2.06951,0.17481 2.75,-0.32101 0.6805,-0.49583 3.03727,-0.61003 5.23727,-0.25378 l 4,0.64772 -3.625,0.1419 c -1.99375,0.0781 -5.03125,0.42316 -6.75,0.76691 -1.976,0.3952 -3.125,0.2229 -3.125,-0.46862 z M 418,564.24075 c 27.27425,-13.27906 44.94568,-25.85917 49.95881,-35.56517 1.34464,-2.60337 1.26638,-3.18925 -1,-7.48633 -6.29421,-11.93388 -17.95643,-23.71686 -46.45881,-46.93993 -8.25,-6.7219 -17.08525,-14.03059 -19.63388,-16.24153 l -4.63388,-4.01989 -0.52946,46.75605 c -0.50289,44.40919 -1.20775,56.43945 -4.26012,72.71 l -0.67021,3.57251 4.36378,-1.88929 C 397.5363,574.09806 407.825,569.19467 418,564.24075 z M 407.15789,510 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z m 6.98806,-1.52279 c 1.21144,-2.05324 1.88336,-4.54354 1.61073,-5.96974 -0.25727,-1.34582 -0.0828,-2.20901 0.38778,-1.91819 1.46924,0.90804 0.93252,4.77219 -1.1335,8.16072 -1.08986,1.7875 -2.198,3.25 -2.46254,3.25 -0.26453,0 0.45435,-1.58525 1.59753,-3.52279 z M 147.55653,451.02364 c 29.11891,-2.187 55.75597,-4.24782 59.19347,-4.5796 l 6.25,-0.60323 0,-49.4204 0,-49.42041 -2.75,-0.0768 c -1.5125,-0.0423 -4.55,-0.68142 -6.75,-1.42033 l -4,-1.34347 4.5,0.60305 c 9.49572,1.27253 8.46531,4.97497 8.76382,-31.49016 l 0.26383,-32.22777 -3.01383,0.60277 c -1.88198,0.37634 -3.01382,0.192 -3.01382,-0.49091 0,-0.60148 0.68073,-0.83239 1.51273,-0.51312 0.83201,0.31927 2.18201,0.0251 3,-0.65383 C 212.80608,278.91605 213,268.47368 213,199.90256 l 0,-78.85256 2.75,0.47744 C 220.79351,122.40307 389.59936,141 392.50398,141 c 2.20957,0 4.69327,-1.76826 10.92775,-7.77992 C 407.86928,128.94112 414.875,122.4134 419,118.71404 l 7.5,-6.72612 -106,0.25604 -106,0.25604 -12.17888,2.77199 c -11.28218,2.5679 -22.28233,6.42161 -33.32112,11.67346 -19.2219,9.14508 -40.75151,27.68214 -51.74728,44.55455 -2.50905,3.85 -6.03936,9.25 -7.84514,12 -5.63525,8.58186 -12.483818,26.82073 -15.207482,40.5 -2.136708,10.73136 -3.023836,231 -0.930348,231 0.738821,0 25.16787,-1.78936 54.28678,-3.97636 z M 97.157895,390 c 0,-1.375 0.226973,-1.9375 0.504386,-1.25 0.277412,0.6875 0.277412,1.8125 0,2.5 -0.277413,0.6875 -0.504386,0.125 -0.504386,-1.25 z m 6.988055,-1.52279 c 1.21144,-2.05324 1.88336,-4.54354 1.61073,-5.96974 -0.25727,-1.34582 -0.0828,-2.20901 0.38778,-1.91819 1.46924,0.90804 0.93252,4.77219 -1.1335,8.16072 -1.08986,1.7875 -2.198,3.25 -2.46254,3.25 -0.26453,0 0.45435,-1.58525 1.59753,-3.52279 z M 197.5,344 c 0.33992,-0.55 0.81648,-1 1.05902,-1 0.24254,0 0.44098,0.45 0.44098,1 0,0.55 -0.47656,1 -1.05902,1 -0.58246,0 -0.7809,-0.45 -0.44098,-1 z m -5.06238,-2.05035 c -2.11787,-1.3961 -2.44928,-1.93831 -1.18762,-1.94306 0.9625,-0.004 1.75,0.41211 1.75,0.92386 0,0.51175 1.0125,1.0748 2.25,1.25123 1.26061,0.17973 1.78284,0.62501 1.18762,1.01262 -0.58431,0.3805 -2.38431,-0.17959 -4,-1.24465 z M 187.27814,337.75 c -1.79396,-2.31959 -2.40065,-3.75004 -1.58716,-3.7422 0.44496,0.004 1.32918,1.12929 1.96493,2.5 1.26466,2.72664 1.12513,3.18544 -0.37777,1.2422 z m -3.86638,-10.36867 c -0.37338,-1.99027 -0.44087,-7.43343 -0.14999,-12.0959 0.44456,-7.12579 1.11455,-9.66226 4.20264,-15.91059 3.1953,-6.46525 11.13907,-16.10469 12.30823,-14.93554 0.22287,0.22287 -1.35017,1.99111 -3.49564,3.92941 -8.1442,7.3578 -12.76877,20.54308 -12.0588,34.38129 0.2328,4.5375 0.29933,8.25 0.14785,8.25 -0.15148,0 -0.58091,-1.6284 -0.95429,-3.61867 z m 19.02937,-44.82616 C 203.50875,281.69982 204.82125,281 205.3578,281 c 1.27054,0 0.70323,0.4619 -2.3578,1.91971 -2.35727,1.12265 -2.38918,1.10183 -0.55887,-0.36454 z M 142.25,244.31067 c 0.9625,-0.25152 2.5375,-0.25152 3.5,0 0.9625,0.25153 0.175,0.45733 -1.75,0.45733 -1.925,0 -2.7125,-0.2058 -1.75,-0.45733 z M 150,243 c 0.825,-0.53316 1.95,-0.96937 2.5,-0.96937 0.55,0 0.325,0.43621 -0.5,0.96937 -0.825,0.53316 -1.95,0.96937 -2.5,0.96937 -0.55,0 -0.325,-0.43621 0.5,-0.96937 z m -18,-2.08935 c -1.66051,-1.35822 -1.82841,-1.69779 -0.5,-1.01125 3.26177,1.68572 5.07007,3.07046 4,3.06305 -0.55,-0.004 -2.125,-0.92712 -3.5,-2.0518 z m 22,0.73954 c 0,-0.23109 1.18041,-1.1936 2.62312,-2.13891 1.44272,-0.9453 2.31766,-1.22448 1.94431,-0.62038 C 157.85397,240.04529 154,242.37357 154,241.65019 z m -26.04584,-5.73584 c -0.61391,-1.1471 -0.92784,-2.274 -0.69762,-2.50422 0.23022,-0.23022 0.93203,0.70832 1.55958,2.08564 1.37807,3.02454 0.70709,3.35038 -0.86196,0.41858 z M 163.48566,233.5 c 1.01891,-1.65 2.87407,-4.575 4.12258,-6.5 1.24851,-1.925 2.5712,-4.7375 2.9393,-6.25 0.3681,-1.5125 1.07049,-2.75 1.56087,-2.75 0.49037,0 0.89159,0.24293 0.89159,0.53984 0,1.10694 -4.37727,9.08188 -6.83911,12.46016 -3.50378,4.80807 -4.91472,6.12661 -2.67523,2.5 z m -2.77873,-3.5 c 1.6015,-3.025 2.73961,-6.2875 2.52912,-7.25 -0.21048,-0.9625 -0.0122,-1.74972 0.44063,-1.74938 0.45282,3.4e-4 0.66739,-2.24966 0.47681,-5 -0.24151,-3.48528 0.0272,-5.00062 0.88691,-5.00062 0.90144,0 1.09673,1.7029 0.72556,6.32693 -0.5282,6.58015 -2.34323,11.40921 -5.89082,15.67307 -1.49629,1.79839 -1.26286,0.95647 0.83179,-3 z M 172,214.60765 c 0,-1.49913 0.40992,-2.47234 0.91093,-2.1627 1.00387,0.62043 0.87649,3.10097 -0.21532,4.19277 C 172.31302,217.02031 172,216.10678 172,214.60765 z M 163.875,209.5 c -0.0687,-0.275 -0.18125,-0.88413 -0.25,-1.35362 -0.30289,-2.06842 -4.38066,-6.48669 -7.125,-7.71995 -2.15117,-0.9667 -2.46104,-1.35922 -1.09516,-1.38729 2.17597,-0.0447 9.59516,7.30319 9.59516,9.50297 0,1.35731 -0.84523,2.07699 -1.125,0.95789 z m 7.65093,-2.54681 c -0.44294,-1.89925 -0.85497,-3.75319 -0.91564,-4.11986 -0.14819,-0.89575 -1.6168,-2.32326 -2.44362,-2.37525 -0.36667,-0.023 -2.24167,-0.88532 -4.16667,-1.91616 -1.925,-1.03084 -6.2,-2.18791 -9.5,-2.57126 l -6,-0.69701 6.02749,-0.13683 c 4.02548,-0.0914 6.7657,0.38023 8.25,1.41988 1.22238,0.85619 2.22251,1.22018 2.22251,0.80887 0,-0.4113 0.66069,0.12568 1.4682,1.1933 0.8075,1.06762 1.4825,1.54853 1.5,1.06869 0.0507,-1.39202 3.04014,1.48346 4.46995,4.29961 0.72009,1.41828 0.9892,3.44932 0.5997,4.52602 -0.58855,1.62694 -0.84109,1.37639 -1.51192,-1.5 z M 139,200.44156 c 0,-0.20415 0.9,-0.85286 2,-1.44156 1.10492,-0.59134 2,-0.65928 2,-0.15182 0,0.50521 -0.9,1.15391 -2,1.44157 -1.1,0.28766 -2,0.35597 -2,0.15181 z m 7.26375,-2.15914 c 1.52006,-0.22986 3.77006,-0.22371 5,0.0136 1.22994,0.23736 -0.0137,0.42542 -2.76375,0.41792 -2.75,-0.008 -3.75631,-0.20172 -2.23625,-0.43157 z"
+       id="path3326"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#2a2a2a"
+       d="M 459.44542,733.74568 451.39084,716.5 l -85.31529,-0.25564 -85.31529,-0.25564 -7.85669,2.48193 C 230.77077,731.78039 180.24956,728.57821 143.5,710.26865 93.66427,685.43925 59.944546,635.27417 49.091119,569.81589 45.564448,548.54613 44.896177,538.57996 44.302569,498.40251 l -0.577652,-39.09749 3.262542,-0.65251 C 48.781856,458.29363 51.930943,458 53.985429,458 c 2.054486,0 5.80681,-0.28391 8.338499,-0.63092 l 4.60307,-0.63092 0.351946,-112.11908 c 0.344628,-109.788 0.396572,-112.35056 2.49836,-123.25247 3.620731,-18.78063 11.532895,-40.09048 19.333743,-52.07163 1.863924,-2.86275 5.188953,-8.03775 7.388953,-11.5 7.79959,-12.27457 36.2445,-39.28079 48.23634,-45.79663 1.52001,-0.82591 4.53711,-2.60324 6.70466,-3.94961 3.8264,-2.37677 20.61369,-9.567247 29.39316,-12.589943 2.38379,-0.820716 10.70879,-2.943341 18.5,-4.716943 L 213.5,87.517124 337.76602,87.23589 l 124.26603,-0.281233 5.23397,-3.308105 c 13.20871,-8.348491 40.90108,-22.879449 41.83076,-21.949767 0.53978,0.539776 4.22632,6.341317 8.19232,12.892313 L 524.5,86.5 l 12,0.686992 c 29.27474,1.675958 60.37169,10.419819 76.73855,21.577398 2.3438,1.59781 7.41145,4.93531 11.26145,7.41668 14.27043,9.19743 39.73244,35.97587 46.90128,49.32615 1.47457,2.74603 4.03295,7.05859 5.6853,9.58347 2.76021,4.21775 5.78435,11.74376 11.01376,27.40931 2.03257,6.08892 5.25119,21.67484 6.91801,33.5 0.52301,3.71048 0.93025,75.41061 0.94893,167.07191 L 696,563.64383 l -2.48256,14.65461 c -3.41235,20.14321 -12.20172,45.334 -18.88654,54.12987 -1.28396,1.68943 -3.10416,4.56597 -4.04488,6.39231 -6.19973,12.03624 -26.99616,34.05014 -44.08602,46.66691 -9.67257,7.14088 -33.84993,19.05836 -46,22.67429 -5.87476,1.74835 -30.10373,6.60429 -36.25168,7.2655 -4.81574,0.51794 -7.91655,1.65388 -13.5,4.94557 -14.08047,8.30104 -28.44463,15.57092 -45.5553,23.05608 -9.51884,4.16406 -17.39384,7.56909 -17.5,7.56671 -0.10616,-0.002 -3.81758,-7.76488 -8.2476,-17.25 z m 44.43937,-36.32474 C 573.60791,661.54263 614.93424,613.70722 625.6303,556.5 c 2.5878,-13.84071 2.63886,-45.2747 0.0934,-57.5 -6.4355,-30.90836 -21.66561,-60.9827 -45.4366,-89.72198 -11.54341,-13.95605 -36.04194,-37.54494 -54.29299,-52.27703 -25.56495,-20.63583 -34.39861,-29.95031 -41.24916,-43.49434 -3.499,-6.91778 -4.73966,-16.96263 -2.81528,-22.79355 5.50622,-16.68401 32.27746,-40.109 73.23976,-64.08523 l 11.66942,-6.83039 -9.2419,-15.14874 C 552.5139,196.31693 537.82404,172.175 524.9528,151 c -12.87123,-21.175 -23.96757,-39.175 -24.65853,-40 -0.69096,-0.825 -1.86132,-2.34223 -2.6008,-3.37162 -1.28403,-1.78744 -1.70088,-1.6783 -9.26898,2.42691 -20.4464,11.09084 -43.35668,28.86483 -64.99861,50.4265 -13.09405,13.04549 -26.23701,27.85914 -27.51995,31.01821 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.05163,7.89186 -3.83587,9.59302 -1.98421,4.30408 -5.16352,18.37183 -6.42412,28.42529 -2.87589,22.9357 0.73982,56.71057 7.4671,69.75126 0.7747,1.50174 3.17159,6.87097 5.32643,11.93163 4.64575,10.9106 12.21854,23.82266 20.29862,34.61035 3.21801,4.29635 5.85092,8.24217 5.85092,8.76849 0,2.334 31.03302,31.75229 46.57721,44.15367 37.80091,30.15811 56.03372,51.92548 59.48473,71.01629 3.98873,22.0654 -16.45859,45.38479 -58.70905,66.95545 -6.78102,3.462 -12.33448,6.59645 -12.34101,6.96543 -0.0168,0.95027 39.55594,84.82288 46.98341,99.57912 3.39128,6.7375 6.41534,12.25 6.72013,12.25 0.30479,0 8.93101,-4.31058 19.16937,-9.57906 z m -262.86608,-6.45507 c 26.44467,-2.49106 52.83244,-15.74023 74.5336,-37.42295 26.96037,-26.93746 42.63162,-61.90641 47.39317,-105.75351 C 363.56525,542.08222 364,513.33686 364,478.06491 l 0,-60.01393 -7.10997,-10.77549 C 340.9684,383.14552 330.96787,357.92346 325.85384,329 c -1.77802,-10.05602 -1.79531,-47.00522 -0.0267,-57 5.07912,-28.70254 15.71159,-56.00428 31.80146,-81.65885 5.39575,-8.60322 6.3714,-10.8525 6.3714,-14.68872 l 0,-4.52988 -4.25,-0.58798 C 350.16424,169.20841 251.37811,158 249.27569,158 L 247,158 246.9827,342.25 c -0.0108,115.13874 -0.39079,187.8134 -1.01297,193.75 -1.89813,18.11123 -7.20044,31.93817 -15.53685,40.5157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.59413,-11.97227 -10.8557,-30.76511 -11.61695,-66.93587 l -0.55245,-26.25 -2.61646,0.0206 c -2.3354,0.0184 -80.91762,6.14357 -100.285092,7.81688 -4.217754,0.3644 -7.963823,0.95862 -8.324599,1.32048 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z m 154.11747,-2.21587 0.13618,-2.25 0.43337,2.25 c 0.30765,1.59729 1.13843,2.25 2.86382,2.25 1.33675,0 2.46598,-0.5625 2.5094,-1.25 0.0632,-1 0.17982,-1 0.58333,0 0.61292,1.51898 37.71858,1.844 37.17105,0.32559 -0.18333,-0.50843 -11.34863,-24.39063 -24.81178,-53.07157 -16.91339,-36.03107 -24.67826,-51.5842 -25.12497,-50.32559 -0.35557,1.00186 -2.08598,6.77157 -3.84535,12.82157 -9.29152,31.95117 -24.98115,57.75708 -49.26054,81.02255 L 324.85662,691 l 35.07169,0 35.07169,0 0.13618,-2.25 z M 402.232,684 c 0,-1.925 0.2058,-2.7125 0.45733,-1.75 0.25152,0.9625 0.25152,2.5375 0,3.5 -0.25153,0.9625 -0.45733,0.175 -0.45733,-1.75 z m 192.05784,-8.14478 c 24.93584,-12.70304 42.88425,-29.45669 57.31982,-53.50425 1.03969,-1.73197 3.10797,-5.11259 4.59618,-7.5125 4.13398,-6.66651 10.55675,-26.23956 12.78027,-38.94719 1.93578,-11.06322 1.9929,-16.02798 1.98343,-172.39128 -0.006,-92.04982 -0.40091,-163.56957 -0.92311,-167 -2.30834,-15.16378 -4.17319,-22.89469 -8.32921,-34.52935 -4.31369,-12.07606 -7.17269,-17.40238 -17.4292,-32.47065 -7.80615,-11.46834 -27.08208,-29.38311 -39.48028,-36.6924 -3.08574,-1.81918 -7.6249,-4.55567 -10.08702,-6.08109 -9.55852,-5.92202 -30.51787,-11.92726 -49.46358,-14.17225 l -5.24286,-0.62125 6.83329,11.28349 c 12.6654,20.91379 57.81266,95.22661 61.87936,101.854 l 4.03178,6.5705 -16.12936,8.86762 c -36.52093,20.07853 -59.22498,35.15812 -72.37935,48.07292 -5.78738,5.68199 -9.25,9.85967 -9.25,11.16021 0,3.43225 7.49007,11.84149 18.7605,21.06276 28.53941,23.35044 35.81361,29.72288 49.2822,43.17287 17.46548,17.44136 30.29614,32.94095 42.01948,50.76003 40.73333,61.91329 46.80024,131.18782 16.91276,193.11702 -10.56342,21.88823 -22.82737,39.0026 -41.8456,58.39557 -6.33762,6.4625 -11.19146,11.75 -10.7863,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z M 651.15789,596 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z m 0.11447,-149 c 0,-2.475 0.19502,-3.4875 0.43337,-2.25 0.23836,1.2375 0.23836,3.2625 0,4.5 -0.23835,1.2375 -0.43337,0.225 -0.43337,-2.25 z m 6.95964,-7 c 0,-1.925 0.2058,-2.7125 0.45733,-1.75 0.25152,0.9625 0.25152,2.5375 0,3.5 -0.25153,0.9625 -0.45733,0.175 -0.45733,-1.75 z m -75.96297,-98.69299 c 0.97297,-0.25354 2.32297,-0.23687 3,0.0371 0.67703,0.27393 -0.11903,0.48137 -1.76903,0.46099 -1.65,-0.0204 -2.20394,-0.2445 -1.23097,-0.49804 z M 603.15789,321 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z M 589.8125,299.31689 c 0.72187,-0.28887 1.58438,-0.25335 1.91667,0.0789 0.33229,0.33229 -0.25834,0.56864 -1.3125,0.52522 -1.16495,-0.048 -1.4019,-0.28494 -0.60417,-0.60416 z m 4.45653,-0.01 c 0.97297,-0.25354 2.32297,-0.23687 3,0.0371 0.67703,0.27393 -0.11903,0.48137 -1.76903,0.46099 -1.65,-0.0204 -2.20394,-0.2445 -1.23097,-0.49804 z m -35.45653,-13.99 c 0.72187,-0.28887 1.58438,-0.25335 1.91667,0.0789 0.33229,0.33229 -0.25834,0.56864 -1.3125,0.52522 -1.16495,-0.048 -1.4019,-0.28494 -0.60417,-0.60416 z m -7.54347,-1.00988 c 0.97297,-0.25354 2.32297,-0.23687 3,0.0371 0.67703,0.27393 -0.11903,0.48137 -1.76903,0.46099 -1.65,-0.0204 -2.20394,-0.2445 -1.23097,-0.49804 z M 418,564.24075 c 27.27425,-13.27906 44.94568,-25.85917 49.95881,-35.56517 1.34464,-2.60337 1.26638,-3.18925 -1,-7.48633 -6.29421,-11.93388 -17.95643,-23.71686 -46.45881,-46.93993 -8.25,-6.7219 -17.08525,-14.03059 -19.63388,-16.24153 l -4.63388,-4.01989 -0.52946,46.75605 c -0.50289,44.40919 -1.20775,56.43945 -4.26012,72.71 l -0.67021,3.57251 4.36378,-1.88929 C 397.5363,574.09806 407.825,569.19467 418,564.24075 z M 407.15789,510 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z M 147.55653,451.02364 c 29.11891,-2.187 55.75597,-4.24782 59.19347,-4.5796 l 6.25,-0.60323 0,-162.3954 0,-162.39541 2.75,0.47744 C 220.79351,122.40307 389.59936,141 392.50398,141 c 2.20957,0 4.69327,-1.76826 10.92775,-7.77992 C 407.86928,128.94112 414.875,122.4134 419,118.71404 l 7.5,-6.72612 -106,0.25604 -106,0.25604 -12.17888,2.77199 c -11.28218,2.5679 -22.28233,6.42161 -33.32112,11.67346 -19.2219,9.14508 -40.75151,27.68214 -51.74728,44.55455 -2.50905,3.85 -6.03936,9.25 -7.84514,12 -5.63525,8.58186 -12.483818,26.82073 -15.207482,40.5 -2.136708,10.73136 -3.023836,231 -0.930348,231 0.738821,0 25.16787,-1.78936 54.28678,-3.97636 z M 97.157895,390 c 0,-1.375 0.226973,-1.9375 0.504386,-1.25 0.277412,0.6875 0.277412,1.8125 0,2.5 -0.277413,0.6875 -0.504386,0.125 -0.504386,-1.25 z M 204.8125,345.31689 c 0.72187,-0.28887 1.58437,-0.25335 1.91667,0.0789 0.33229,0.33229 -0.25834,0.56864 -1.3125,0.52522 -1.16495,-0.048 -1.4019,-0.28494 -0.60417,-0.60416 z M 183.28601,320.5 c 0.008,-2.75 0.20172,-3.75631 0.43157,-2.23625 0.22986,1.52006 0.22371,3.77006 -0.0136,5 -0.23736,1.22994 -0.42542,-0.0138 -0.41792,-2.76375 z m 0.79294,-10.08333 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58438 -0.0789,1.91667 -0.3323,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z m -41.80992,-66.10966 c 0.97297,-0.25354 2.32297,-0.23687 3,0.0371 0.67703,0.27393 -0.11903,0.48137 -1.76903,0.46099 -1.65,-0.0204 -2.20394,-0.2445 -1.23097,-0.49804 z m 21.80992,-28.89034 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58437 -0.0789,1.91667 -0.3323,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z m 8,-1 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58437 -0.0789,1.91667 -0.3323,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z M 148.75,198.33772 c 0.6875,-0.27741 1.8125,-0.27741 2.5,0 0.6875,0.27741 0.125,0.50439 -1.25,0.50439 -1.375,0 -1.9375,-0.22698 -1.25,-0.50439 z"
+       id="path3324"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#1e2c34"
+       d="M 459.45256,733.72908 451.40512,716.5 l -85.10314,-0.2556 -85.10315,-0.25559 -11.97012,3.44536 C 234.41148,729.45562 194.05114,728.85922 161.5,717.84229 149.5171,713.78667 131.36674,704.32107 121.5,696.98187 111.04552,689.20549 94.366468,672.62202 86.589496,662.27142 67.582133,636.97399 55.139838,606.29642 49.091119,569.81589 45.584575,548.66752 44.914468,538.66564 44.306645,498.40385 L 43.716419,459.3077 47.60821,458.66486 C 49.748694,458.31129 53.3,458.01211 55.5,458 c 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 l 3.713493,-0.61392 0.338198,-112.12508 c 0.33805,-112.07576 0.339202,-112.13011 2.620383,-123.55771 5.000606,-25.0506 13.380092,-44.46902 28.293797,-65.56737 9.532036,-13.48492 36.049716,-38.01146 47.282176,-43.73188 2.22115,-1.13118 5.38846,-3.02124 7.03846,-4.20013 1.65,-1.17889 4.35,-2.63491 6,-3.23561 1.65,-0.60069 7.56804,-2.95283 13.15119,-5.226959 5.58316,-2.274133 17.05816,-5.796178 25.5,-7.826766 L 212.5,87.586676 l 124.70101,-0.319489 124.70101,-0.31949 9.79899,-5.795423 c 17.85751,-10.56148 36.21449,-20.322533 37.14164,-19.749521 0.50268,0.31067 4.22116,6.133753 8.26331,12.940184 l 7.34935,12.37533 12.52235,0.605959 c 27.95699,1.352845 58.50499,9.873483 75.52234,21.065154 2.75,1.80857 8.15,5.31668 12,7.79579 14.33528,9.23083 38.48989,34.65325 47,49.46688 1.65,2.87218 4.28568,7.28469 5.85706,9.80559 2.75515,4.41996 5.98378,12.731 11.08797,28.54236 2.26858,7.02744 4.80293,19.30531 6.60532,32 0.42949,3.025 0.81886,77.99154 0.86527,166.59231 L 696,563.68462 l -2.49432,14.49057 c -3.53331,20.52645 -12.221,45.4981 -18.87478,54.25312 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.60355,12.8211 -27.14906,34.15967 -47.12707,48.9462 -4.50642,3.33538 -22.80777,12.53323 -33.16338,16.66718 -9.5113,3.79689 -35.02945,9.91398 -46.26081,11.08942 -5.08479,0.53216 -7.91994,1.5665 -13.5,4.92518 -12.71182,7.65134 -27.7651,15.28491 -45.37804,23.01137 -9.52302,4.17756 -17.39802,7.58615 -17.5,7.57464 -0.10199,-0.0115 -3.80678,-7.774 -8.23287,-17.25 z m 44.43223,-36.30814 C 573.60791,661.54263 614.93424,613.70722 625.6303,556.5 c 2.5878,-13.84071 2.63886,-45.2747 0.0934,-57.5 -6.4355,-30.90836 -21.66561,-60.9827 -45.4366,-89.72198 -11.54341,-13.95605 -36.04194,-37.54494 -54.29299,-52.27703 -25.56495,-20.63583 -34.39861,-29.95031 -41.24916,-43.49434 -3.499,-6.91778 -4.73966,-16.96263 -2.81528,-22.79355 5.50622,-16.68401 32.27746,-40.109 73.23976,-64.08523 l 11.66942,-6.83039 -9.2419,-15.14874 C 552.5139,196.31693 537.82404,172.175 524.9528,151 c -12.87123,-21.175 -23.96757,-39.175 -24.65853,-40 -0.69096,-0.825 -1.86132,-2.34223 -2.6008,-3.37162 -1.28403,-1.78744 -1.70088,-1.6783 -9.26898,2.42691 -20.4464,11.09084 -43.35668,28.86483 -64.99861,50.4265 -13.09405,13.04549 -26.23701,27.85914 -27.51995,31.01821 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.02684,7.85 -3.7808,9.5 -4.23862,9.27601 -7.5237,30.44554 -7.5262,48.5 -0.003,18.16184 3.3544,38.5118 8.00054,48.5 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.24217 5.85092,8.76849 0,2.334 31.03302,31.75229 46.57721,44.15367 37.80091,30.15811 56.03372,51.92548 59.48473,71.01629 3.98873,22.0654 -16.45859,45.38479 -58.70905,66.95545 -6.78102,3.462 -12.33448,6.59645 -12.34101,6.96543 -0.0168,0.95027 39.55594,84.82288 46.98341,99.57912 3.39128,6.7375 6.41534,12.25 6.72013,12.25 0.30479,0 8.93101,-4.31058 19.16937,-9.57906 z m -262.86608,-6.45507 c 26.44467,-2.49106 52.83244,-15.74023 74.5336,-37.42295 26.96037,-26.93746 42.63162,-61.90641 47.39317,-105.75351 C 363.56525,542.08222 364,513.33686 364,478.06491 l 0,-60.01393 -6.8359,-10.37193 C 339.53137,380.92541 329.49936,354.3585 325.37696,323.5 c -2.29335,-17.16702 -1.38355,-42.543 2.13323,-59.5 5.19072,-25.02832 15.50856,-50.32828 29.82049,-73.12165 C 363.03244,181.79765 364,179.59412 364,175.68962 l 0,-4.56707 -4.25,-0.58798 C 350.16424,169.20841 251.37811,158 249.27569,158 L 247,158 246.9827,342.25 c -0.0108,115.13874 -0.39079,187.8134 -1.01297,193.75 -1.89813,18.11123 -7.20044,31.93817 -15.53685,40.5157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.59413,-11.97227 -10.8557,-30.76511 -11.61695,-66.93587 l -0.55245,-26.25 -2.61646,0.0206 c -2.3354,0.0184 -80.91762,6.14357 -100.285092,7.81688 -4.217754,0.3644 -7.963823,0.95862 -8.324599,1.32048 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z m 154.11747,-2.21587 0.13618,-2.25 0.43337,2.25 c 0.30765,1.59729 1.13843,2.25 2.86382,2.25 1.33675,0 2.46598,-0.5625 2.5094,-1.25 0.0632,-1 0.17982,-1 0.58333,0 0.61292,1.51898 37.71858,1.844 37.17105,0.32559 -0.18333,-0.50843 -11.34863,-24.39063 -24.81178,-53.07157 -16.91339,-36.03107 -24.67826,-51.5842 -25.12497,-50.32559 -0.35557,1.00186 -2.08598,6.77157 -3.84535,12.82157 -9.29152,31.95117 -24.98115,57.75708 -49.26054,81.02255 L 324.85662,691 l 35.07169,0 35.07169,0 0.13618,-2.25 z M 402.232,684 c 0,-1.925 0.2058,-2.7125 0.45733,-1.75 0.25152,0.9625 0.25152,2.5375 0,3.5 -0.25153,0.9625 -0.45733,0.175 -0.45733,-1.75 z m 192.05784,-8.14478 c 24.93584,-12.70304 42.88425,-29.45669 57.31982,-53.50425 1.03969,-1.73197 3.10797,-5.11259 4.59618,-7.5125 4.13398,-6.66651 10.55675,-26.23956 12.78027,-38.94719 1.93578,-11.06322 1.9929,-16.02798 1.98343,-172.39128 -0.006,-92.04982 -0.40091,-163.56957 -0.92311,-167 -2.30834,-15.16378 -4.17319,-22.89469 -8.32921,-34.52935 -4.31369,-12.07606 -7.17269,-17.40238 -17.4292,-32.47065 -7.80615,-11.46834 -27.08208,-29.38311 -39.48028,-36.6924 -3.08574,-1.81918 -7.6249,-4.55567 -10.08702,-6.08109 -9.55852,-5.92202 -30.51787,-11.92726 -49.46358,-14.17225 l -5.24286,-0.62125 6.83329,11.28349 c 12.6654,20.91379 57.81266,95.22661 61.87936,101.854 l 4.03178,6.5705 -16.12936,8.86762 c -36.52093,20.07853 -59.22498,35.15812 -72.37935,48.07292 -5.78738,5.68199 -9.25,9.85967 -9.25,11.16021 0,3.43225 7.49007,11.84149 18.7605,21.06276 28.53941,23.35044 35.81361,29.72288 49.2822,43.17287 17.46548,17.44136 30.29614,32.94095 42.01948,50.76003 40.73333,61.91329 46.80024,131.18782 16.91276,193.11702 -10.56342,21.88823 -22.82737,39.0026 -41.8456,58.39557 -6.33762,6.4625 -11.19146,11.75 -10.7863,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z M 651.15789,596 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z m 0.11447,-149 c 0,-2.475 0.19502,-3.4875 0.43337,-2.25 0.23836,1.2375 0.23836,3.2625 0,4.5 -0.23835,1.2375 -0.43337,0.225 -0.43337,-2.25 z m 6.95964,-7 c 0,-1.925 0.2058,-2.7125 0.45733,-1.75 0.25152,0.9625 0.25152,2.5375 0,3.5 -0.25153,0.9625 -0.45733,0.175 -0.45733,-1.75 z m -75.96297,-98.69299 c 0.97297,-0.25354 2.32297,-0.23687 3,0.0371 0.67703,0.27393 -0.11903,0.48137 -1.76903,0.46099 -1.65,-0.0204 -2.20394,-0.2445 -1.23097,-0.49804 z M 603.15789,321 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z M 589.8125,299.31689 c 0.72187,-0.28887 1.58438,-0.25335 1.91667,0.0789 0.33229,0.33229 -0.25834,0.56864 -1.3125,0.52522 -1.16495,-0.048 -1.4019,-0.28494 -0.60417,-0.60416 z m 4.45653,-0.01 c 0.97297,-0.25354 2.32297,-0.23687 3,0.0371 0.67703,0.27393 -0.11903,0.48137 -1.76903,0.46099 -1.65,-0.0204 -2.20394,-0.2445 -1.23097,-0.49804 z m -35.45653,-13.99 c 0.72187,-0.28887 1.58438,-0.25335 1.91667,0.0789 0.33229,0.33229 -0.25834,0.56864 -1.3125,0.52522 -1.16495,-0.048 -1.4019,-0.28494 -0.60417,-0.60416 z m -7.54347,-1.00988 c 0.97297,-0.25354 2.32297,-0.23687 3,0.0371 0.67703,0.27393 -0.11903,0.48137 -1.76903,0.46099 -1.65,-0.0204 -2.20394,-0.2445 -1.23097,-0.49804 z M 418,564.24075 c 27.27425,-13.27906 44.94568,-25.85917 49.95881,-35.56517 1.34464,-2.60337 1.26638,-3.18925 -1,-7.48633 -6.29421,-11.93388 -17.95643,-23.71686 -46.45881,-46.93993 -8.25,-6.7219 -17.08525,-14.03059 -19.63388,-16.24153 l -4.63388,-4.01989 -0.52946,46.75605 c -0.50289,44.40919 -1.20775,56.43945 -4.26012,72.71 l -0.67021,3.57251 4.36378,-1.88929 C 397.5363,574.09806 407.825,569.19467 418,564.24075 z M 407.15789,510 c 0,-1.375 0.22698,-1.9375 0.50439,-1.25 0.27741,0.6875 0.27741,1.8125 0,2.5 -0.27741,0.6875 -0.50439,0.125 -0.50439,-1.25 z M 147.55653,451.02364 c 29.11891,-2.187 55.75597,-4.24782 59.19347,-4.5796 l 6.25,-0.60323 0,-162.3954 0,-162.39541 2.75,0.47744 C 220.79351,122.40307 389.59936,141 392.50398,141 c 2.20957,0 4.69327,-1.76826 10.92775,-7.77992 C 407.86928,128.94112 414.875,122.4134 419,118.71404 l 7.5,-6.72612 -106,0.25604 -106,0.25604 -12.17888,2.77199 C 191.03894,117.83989 180.03879,121.6936 169,126.94545 149.83563,136.06316 128.33021,154.48646 117.57537,171 c -2.68651,4.125 -6.50249,9.94099 -8.47997,12.92442 -3.81072,5.74928 -5.43739,9.43011 -10.197805,23.07558 -6.470732,18.54802 -6.267054,14.34823 -6.632003,136.75 -0.275694,92.4663 -0.10552,111.25 1.007885,111.25 0.736772,0 25.164143,-1.78936 54.283053,-3.97636 z M 97.157895,390 c 0,-1.375 0.226973,-1.9375 0.504386,-1.25 0.277412,0.6875 0.277412,1.8125 0,2.5 -0.277413,0.6875 -0.504386,0.125 -0.504386,-1.25 z M 204.8125,345.31689 c 0.72187,-0.28887 1.58437,-0.25335 1.91667,0.0789 0.33229,0.33229 -0.25834,0.56864 -1.3125,0.52522 -1.16495,-0.048 -1.4019,-0.28494 -0.60417,-0.60416 z M 183.28601,320.5 c 0.008,-2.75 0.20172,-3.75631 0.43157,-2.23625 0.22986,1.52006 0.22371,3.77006 -0.0136,5 -0.23736,1.22994 -0.42542,-0.0138 -0.41792,-2.76375 z m 0.79294,-10.08333 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58438 -0.0789,1.91667 -0.3323,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z m -41.80992,-66.10966 c 0.97297,-0.25354 2.32297,-0.23687 3,0.0371 0.67703,0.27393 -0.11903,0.48137 -1.76903,0.46099 -1.65,-0.0204 -2.20394,-0.2445 -1.23097,-0.49804 z m 21.80992,-28.89034 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58437 -0.0789,1.91667 -0.3323,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z m 8,-1 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58437 -0.0789,1.91667 -0.3323,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z M 148.75,198.33772 c 0.6875,-0.27741 1.8125,-0.27741 2.5,0 0.6875,0.27741 0.125,0.50439 -1.25,0.50439 -1.375,0 -1.9375,-0.22698 -1.25,-0.50439 z"
+       id="path3322"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#1d2a34"
+       d="M 459.45256,733.72908 451.40512,716.5 l -85.10314,-0.2556 -85.10315,-0.25559 -11.97012,3.44536 C 234.41148,729.45562 194.05114,728.85922 161.5,717.84229 149.5171,713.78667 131.36674,704.32107 121.5,696.98187 111.04552,689.20549 94.366468,672.62202 86.589496,662.27142 67.582133,636.97399 55.139838,606.29642 49.091119,569.81589 45.584575,548.66752 44.914468,538.66564 44.306645,498.40385 L 43.716419,459.3077 47.60821,458.66486 C 49.748694,458.31129 53.3,458.01211 55.5,458 c 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 l 3.713493,-0.61392 0.338198,-112.12508 c 0.33805,-112.07576 0.339202,-112.13011 2.620383,-123.55771 5.000606,-25.0506 13.380092,-44.46902 28.293797,-65.56737 9.532036,-13.48492 36.049716,-38.01146 47.282176,-43.73188 2.22115,-1.13118 5.38846,-3.02124 7.03846,-4.20013 1.65,-1.17889 4.35,-2.63491 6,-3.23561 1.65,-0.60069 7.56804,-2.95283 13.15119,-5.226959 5.58316,-2.274133 17.05816,-5.796178 25.5,-7.826766 L 212.5,87.586676 l 124.70101,-0.319489 124.70101,-0.31949 9.79899,-5.795423 c 17.85751,-10.56148 36.21449,-20.322533 37.14164,-19.749521 0.50268,0.31067 4.22116,6.133753 8.26331,12.940184 l 7.34935,12.37533 12.52235,0.605959 c 27.95699,1.352845 58.50499,9.873483 75.52234,21.065154 2.75,1.80857 8.15,5.31668 12,7.79579 14.33528,9.23083 38.48989,34.65325 47,49.46688 1.65,2.87218 4.28568,7.28469 5.85706,9.80559 2.75515,4.41996 5.98378,12.731 11.08797,28.54236 2.26858,7.02744 4.80293,19.30531 6.60532,32 0.42949,3.025 0.81886,77.99154 0.86527,166.59231 L 696,563.68462 l -2.49432,14.49057 c -3.53331,20.52645 -12.221,45.4981 -18.87478,54.25312 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.60355,12.8211 -27.14906,34.15967 -47.12707,48.9462 -4.50642,3.33538 -22.80777,12.53323 -33.16338,16.66718 -9.5113,3.79689 -35.02945,9.91398 -46.26081,11.08942 -5.08479,0.53216 -7.91994,1.5665 -13.5,4.92518 -12.71182,7.65134 -27.7651,15.28491 -45.37804,23.01137 -9.52302,4.17756 -17.39802,7.58615 -17.5,7.57464 -0.10199,-0.0115 -3.80678,-7.774 -8.23287,-17.25 z m 44.43223,-36.30814 C 573.60791,661.54263 614.93424,613.70722 625.6303,556.5 c 2.5878,-13.84071 2.63886,-45.2747 0.0934,-57.5 -6.4355,-30.90836 -21.66561,-60.9827 -45.4366,-89.72198 -11.54341,-13.95605 -36.04194,-37.54494 -54.29299,-52.27703 -25.56495,-20.63583 -34.39861,-29.95031 -41.24916,-43.49434 -3.499,-6.91778 -4.73966,-16.96263 -2.81528,-22.79355 5.50622,-16.68401 32.27746,-40.109 73.23976,-64.08523 l 11.66942,-6.83039 -9.2419,-15.14874 C 552.5139,196.31693 537.82404,172.175 524.9528,151 c -12.87123,-21.175 -23.96757,-39.175 -24.65853,-40 -0.69096,-0.825 -1.86132,-2.34223 -2.6008,-3.37162 -1.28403,-1.78744 -1.70088,-1.6783 -9.26898,2.42691 -20.4464,11.09084 -43.35668,28.86483 -64.99861,50.4265 -13.09405,13.04549 -26.23701,27.85914 -27.51995,31.01821 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.02684,7.85 -3.7808,9.5 -4.23862,9.27601 -7.5237,30.44554 -7.5262,48.5 -0.003,18.16184 3.3544,38.5118 8.00054,48.5 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.24217 5.85092,8.76849 0,2.334 31.03302,31.75229 46.57721,44.15367 37.80091,30.15811 56.03372,51.92548 59.48473,71.01629 3.98873,22.0654 -16.45859,45.38479 -58.70905,66.95545 -6.78102,3.462 -12.33448,6.59645 -12.34101,6.96543 -0.0168,0.95027 39.55594,84.82288 46.98341,99.57912 3.39128,6.7375 6.41534,12.25 6.72013,12.25 0.30479,0 8.93101,-4.31058 19.16937,-9.57906 z m -262.86608,-6.45507 c 26.44467,-2.49106 52.83244,-15.74023 74.5336,-37.42295 26.96037,-26.93746 42.63162,-61.90641 47.39317,-105.75351 C 363.56525,542.08222 364,513.33686 364,478.06491 l 0,-60.01393 -6.8359,-10.37193 C 339.53137,380.92541 329.49936,354.3585 325.37696,323.5 c -2.29335,-17.16702 -1.38355,-42.543 2.13323,-59.5 5.19072,-25.02832 15.50856,-50.32828 29.82049,-73.12165 C 363.03244,181.79765 364,179.59412 364,175.68962 l 0,-4.56707 -4.25,-0.58798 C 350.16424,169.20841 251.37811,158 249.27569,158 L 247,158 246.9827,342.25 c -0.0108,115.13874 -0.39079,187.8134 -1.01297,193.75 -1.89813,18.11123 -7.20044,31.93817 -15.53685,40.5157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.59413,-11.97227 -10.8557,-30.76511 -11.61695,-66.93587 l -0.55245,-26.25 -2.61646,0.0206 c -2.3354,0.0184 -80.91762,6.14357 -100.285092,7.81688 -4.217754,0.3644 -7.963823,0.95862 -8.324599,1.32048 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z m 197.81462,-0.89028 c -0.18333,-0.50843 -11.34863,-24.39063 -24.81178,-53.07157 -16.91339,-36.03107 -24.67826,-51.5842 -25.12497,-50.32559 -0.35557,1.00186 -2.08598,6.77157 -3.84535,12.82157 -9.29152,31.95117 -24.98115,57.75708 -49.26054,81.02255 L 324.85662,691 l 57.15502,0 c 34.56141,0 57.02326,-0.36542 56.82169,-0.92441 z m 155.45651,-14.22037 c 24.93584,-12.70304 42.88425,-29.45669 57.31982,-53.50425 1.03969,-1.73197 3.10797,-5.11259 4.59618,-7.5125 4.13398,-6.66651 10.55675,-26.23956 12.78027,-38.94719 1.93578,-11.06322 1.9929,-16.02798 1.98343,-172.39128 -0.006,-92.04982 -0.40091,-163.56957 -0.92311,-167 -2.30834,-15.16378 -4.17319,-22.89469 -8.32921,-34.52935 -4.31369,-12.07606 -7.17269,-17.40238 -17.4292,-32.47065 -7.80615,-11.46834 -27.08208,-29.38311 -39.48028,-36.6924 -3.08574,-1.81918 -7.6249,-4.55567 -10.08702,-6.08109 -9.55852,-5.92202 -30.51787,-11.92726 -49.46358,-14.17225 l -5.24286,-0.62125 6.83329,11.28349 c 12.6654,20.91379 57.81266,95.22661 61.87936,101.854 l 4.03178,6.5705 -16.12936,8.86762 c -36.52093,20.07853 -59.22498,35.15812 -72.37935,48.07292 -5.78738,5.68199 -9.25,9.85967 -9.25,11.16021 0,3.43225 7.49007,11.84149 18.7605,21.06276 28.53941,23.35044 35.81361,29.72288 49.2822,43.17287 17.46548,17.44136 30.29614,32.94095 42.01948,50.76003 40.73333,61.91329 46.80024,131.18782 16.91276,193.11702 -10.56342,21.88823 -22.82737,39.0026 -41.8456,58.39557 -6.33762,6.4625 -11.19146,11.75 -10.7863,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z m 56.78911,-80.43855 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58438 -0.0789,1.91667 -0.33229,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z M 418,564.24075 c 27.27425,-13.27906 44.94568,-25.85917 49.95881,-35.56517 1.34464,-2.60337 1.26638,-3.18925 -1,-7.48633 -6.29421,-11.93388 -17.95643,-23.71686 -46.45881,-46.93993 -8.25,-6.7219 -17.08525,-14.03059 -19.63388,-16.24153 l -4.63388,-4.01989 -0.52946,46.75605 c -0.50289,44.40919 -1.20775,56.43945 -4.26012,72.71 l -0.67021,3.57251 4.36378,-1.88929 C 397.5363,574.09806 407.825,569.19467 418,564.24075 z m -10.92105,-54.82408 c 0.048,-1.16495 0.28494,-1.4019 0.60416,-0.60417 0.28887,0.72187 0.25335,1.58438 -0.0789,1.91667 -0.33229,0.33229 -0.56864,-0.25834 -0.52522,-1.3125 z M 147.55653,451.02364 c 29.11891,-2.187 55.75597,-4.24782 59.19347,-4.5796 l 6.25,-0.60323 0,-162.3954 0,-162.39541 2.75,0.47744 C 220.79351,122.40307 389.59936,141 392.50398,141 c 2.20957,0 4.69327,-1.76826 10.92775,-7.77992 C 407.86928,128.94112 414.875,122.4134 419,118.71404 l 7.5,-6.72612 -106,0.25604 -106,0.25604 -12.17888,2.77199 C 191.03894,117.83989 180.03879,121.6936 169,126.94545 149.83563,136.06316 128.33021,154.48646 117.57537,171 c -2.68651,4.125 -6.50249,9.94099 -8.47997,12.92442 -3.81072,5.74928 -5.43739,9.43011 -10.197805,23.07558 -6.470732,18.54802 -6.267054,14.34823 -6.632003,136.75 -0.275694,92.4663 -0.10552,111.25 1.007885,111.25 0.736772,0 25.164143,-1.78936 54.283053,-3.97636 z M 97.078947,389.41667 c 0.04798,-1.16495 0.284941,-1.4019 0.604167,-0.60417 0.288871,0.72187 0.253344,1.58438 -0.07895,1.91667 -0.332292,0.33229 -0.568641,-0.25834 -0.52522,-1.3125 z"
+       id="path3320"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#382e12"
+       d="M 459.45256,733.72908 451.40512,716.5 l -85.10314,-0.2556 -85.10315,-0.25559 -11.97012,3.44536 C 234.41148,729.45562 194.05114,728.85922 161.5,717.84229 149.5171,713.78667 131.36674,704.32107 121.5,696.98187 111.04552,689.20549 94.366468,672.62202 86.589496,662.27142 67.582133,636.97399 55.139838,606.29642 49.091119,569.81589 45.584575,548.66752 44.914468,538.66564 44.306645,498.40385 L 43.716419,459.3077 47.60821,458.66486 C 49.748694,458.31129 53.3,458.01211 55.5,458 c 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 l 3.713493,-0.61392 0.338198,-112.12508 c 0.33805,-112.07576 0.339202,-112.13011 2.620383,-123.55771 5.000606,-25.0506 13.380092,-44.46902 28.293797,-65.56737 9.532036,-13.48492 36.049716,-38.01146 47.282176,-43.73188 2.22115,-1.13118 5.38846,-3.02124 7.03846,-4.20013 1.65,-1.17889 4.35,-2.63491 6,-3.23561 1.65,-0.60069 7.56804,-2.95283 13.15119,-5.226959 5.58316,-2.274133 17.05816,-5.796178 25.5,-7.826766 L 212.5,87.586676 l 124.70101,-0.319489 124.70101,-0.31949 9.79899,-5.795423 c 17.85751,-10.56148 36.21449,-20.322533 37.14164,-19.749521 0.50268,0.31067 4.22116,6.133753 8.26331,12.940184 l 7.34935,12.37533 12.52235,0.605959 c 27.95699,1.352845 58.50499,9.873483 75.52234,21.065154 2.75,1.80857 8.15,5.31668 12,7.79579 14.33528,9.23083 38.48989,34.65325 47,49.46688 1.65,2.87218 4.28568,7.28469 5.85706,9.80559 2.75515,4.41996 5.98378,12.731 11.08797,28.54236 2.26858,7.02744 4.80293,19.30531 6.60532,32 0.42949,3.025 0.81886,77.99154 0.86527,166.59231 L 696,563.68462 l -2.49432,14.49057 c -3.53331,20.52645 -12.221,45.4981 -18.87478,54.25312 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.60355,12.8211 -27.14906,34.15967 -47.12707,48.9462 -4.50642,3.33538 -22.80777,12.53323 -33.16338,16.66718 -9.5113,3.79689 -35.02945,9.91398 -46.26081,11.08942 -5.08479,0.53216 -7.91994,1.5665 -13.5,4.92518 -12.71182,7.65134 -27.7651,15.28491 -45.37804,23.01137 -9.52302,4.17756 -17.39802,7.58615 -17.5,7.57464 -0.10199,-0.0115 -3.80678,-7.774 -8.23287,-17.25 z m 44.43223,-36.30814 C 573.60791,661.54263 614.93424,613.70722 625.6303,556.5 c 2.5878,-13.84071 2.63886,-45.2747 0.0934,-57.5 -6.4355,-30.90836 -21.66561,-60.9827 -45.4366,-89.72198 -11.54341,-13.95605 -36.04194,-37.54494 -54.29299,-52.27703 -25.56495,-20.63583 -34.39861,-29.95031 -41.24916,-43.49434 -3.499,-6.91778 -4.73966,-16.96263 -2.81528,-22.79355 5.50622,-16.68401 32.27746,-40.109 73.23976,-64.08523 l 11.66942,-6.83039 -9.2419,-15.14874 C 552.5139,196.31693 537.82404,172.175 524.9528,151 c -12.87123,-21.175 -23.96757,-39.175 -24.65853,-40 -0.69096,-0.825 -1.86132,-2.34223 -2.6008,-3.37162 -1.28403,-1.78744 -1.70088,-1.6783 -9.26898,2.42691 -20.4464,11.09084 -43.35668,28.86483 -64.99861,50.4265 -13.09405,13.04549 -26.23701,27.85914 -27.51995,31.01821 -0.22336,0.55 -3.85617,6.175 -8.0729,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.02684,7.85 -3.7808,9.5 -4.23862,9.27601 -7.5237,30.44554 -7.5262,48.5 -0.003,18.16184 3.3544,38.5118 8.00054,48.5 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.24217 5.85092,8.76849 0,2.334 31.03302,31.75229 46.57721,44.15367 37.80091,30.15811 56.03372,51.92548 59.48473,71.01629 3.98873,22.0654 -16.45859,45.38479 -58.70905,66.95545 -6.78102,3.462 -12.33448,6.59645 -12.34101,6.96543 -0.0168,0.95027 39.55594,84.82288 46.98341,99.57912 3.39128,6.7375 6.41534,12.25 6.72013,12.25 0.30479,0 8.93101,-4.31058 19.16937,-9.57906 z m -262.86608,-6.45507 c 26.44467,-2.49106 52.83244,-15.74023 74.5336,-37.42295 26.96037,-26.93746 42.63162,-61.90641 47.39317,-105.75351 C 363.56525,542.08222 364,513.33686 364,478.06491 l 0,-60.01393 -6.8359,-10.37193 C 339.53137,380.92541 329.49936,354.3585 325.37696,323.5 c -2.29335,-17.16702 -1.38355,-42.543 2.13323,-59.5 5.19072,-25.02832 15.50856,-50.32828 29.82049,-73.12165 C 363.03244,181.79765 364,179.59412 364,175.68962 l 0,-4.56707 -4.25,-0.58798 C 350.16424,169.20841 251.37811,158 249.27569,158 L 247,158 246.9827,342.25 c -0.0108,115.13874 -0.39079,187.8134 -1.01297,193.75 -1.89813,18.11123 -7.20044,31.93817 -15.53685,40.5157 -3.39134,3.48943 -5.24517,4.51114 -9.96186,5.49032 -10.27199,2.13246 -15.52165,0.13655 -20.56868,-7.82015 -7.59413,-11.97227 -10.8557,-30.76511 -11.61695,-66.93587 l -0.55245,-26.25 -2.61646,0.0206 c -2.3354,0.0184 -80.91762,6.14357 -100.285092,7.81688 -4.217754,0.3644 -7.963823,0.95862 -8.324599,1.32048 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z m 197.81462,-0.89028 c -0.18333,-0.50843 -11.34863,-24.39063 -24.81178,-53.07157 -16.91339,-36.03107 -24.67826,-51.5842 -25.12497,-50.32559 -0.35557,1.00186 -2.08598,6.77157 -3.84535,12.82157 -9.29152,31.95117 -24.98115,57.75708 -49.26054,81.02255 L 324.85662,691 l 57.15502,0 c 34.56141,0 57.02326,-0.36542 56.82169,-0.92441 z m 155.45651,-14.22037 c 24.93584,-12.70304 42.88425,-29.45669 57.31982,-53.50425 1.03969,-1.73197 3.10797,-5.11259 4.59618,-7.5125 4.13398,-6.66651 10.55675,-26.23956 12.78027,-38.94719 1.93578,-11.06322 1.9929,-16.02798 1.98343,-172.39128 -0.006,-92.04982 -0.40091,-163.56957 -0.92311,-167 -2.30834,-15.16378 -4.17319,-22.89469 -8.32921,-34.52935 -4.31369,-12.07606 -7.17269,-17.40238 -17.4292,-32.47065 -7.80615,-11.46834 -27.08208,-29.38311 -39.48028,-36.6924 -3.08574,-1.81918 -7.6249,-4.55567 -10.08702,-6.08109 -9.55852,-5.92202 -30.51787,-11.92726 -49.46358,-14.17225 l -5.24286,-0.62125 6.83329,11.28349 c 12.6654,20.91379 57.81266,95.22661 61.87936,101.854 l 4.03178,6.5705 -16.12936,8.86762 c -36.52093,20.07853 -59.22498,35.15812 -72.37935,48.07292 -5.78738,5.68199 -9.25,9.85967 -9.25,11.16021 0,3.43225 7.49007,11.84149 18.7605,21.06276 28.53941,23.35044 35.81361,29.72288 49.2822,43.17287 17.46548,17.44136 30.29614,32.94095 42.01948,50.76003 40.73333,61.91329 46.80024,131.18782 16.91276,193.11702 -10.56342,21.88823 -22.82737,39.0026 -41.8456,58.39557 -6.33762,6.4625 -11.19146,11.75 -10.7863,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z M 418,564.24075 c 27.27425,-13.27906 44.94568,-25.85917 49.95881,-35.56517 1.34464,-2.60337 1.26638,-3.18925 -1,-7.48633 -6.29421,-11.93388 -17.95643,-23.71686 -46.45881,-46.93993 -8.25,-6.7219 -17.08525,-14.03059 -19.63388,-16.24153 l -4.63388,-4.01989 -0.52946,46.75605 c -0.50289,44.40919 -1.20775,56.43945 -4.26012,72.71 l -0.67021,3.57251 4.36378,-1.88929 C 397.5363,574.09806 407.825,569.19467 418,564.24075 z M 147.55653,451.02364 c 29.11891,-2.187 55.75597,-4.24782 59.19347,-4.5796 l 6.25,-0.60323 0,-162.3954 0,-162.39541 2.75,0.47744 C 220.79351,122.40307 389.59936,141 392.50398,141 c 2.20957,0 4.69327,-1.76826 10.92775,-7.77992 C 407.86928,128.94112 414.875,122.4134 419,118.71404 l 7.5,-6.72612 -106,0.25604 -106,0.25604 -12.17888,2.77199 C 191.03894,117.83989 180.03879,121.6936 169,126.94545 149.83563,136.06316 128.33021,154.48646 117.57537,171 c -2.68651,4.125 -6.50249,9.94099 -8.47997,12.92442 -3.81072,5.74928 -5.43739,9.43011 -10.197805,23.07558 -6.470732,18.54802 -6.267054,14.34823 -6.632003,136.75 -0.275694,92.4663 -0.10552,111.25 1.007885,111.25 0.736772,0 25.164143,-1.78936 54.283053,-3.97636 z"
+       id="path3318"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#352c11"
+       d="M 459.45256,733.72908 451.40512,716.5 l -85.10314,-0.2556 -85.10315,-0.25559 -11.97012,3.44536 C 234.41148,729.45562 194.05114,728.85922 161.5,717.84229 149.5171,713.78667 131.36674,704.32107 121.5,696.98187 111.04552,689.20549 94.366468,672.62202 86.589496,662.27142 67.582133,636.97399 55.139838,606.29642 49.091119,569.81589 45.584575,548.66752 44.914468,538.66564 44.306645,498.40385 L 43.716419,459.3077 47.60821,458.66486 C 49.748694,458.31129 53.3,458.01211 55.5,458 c 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 l 3.713493,-0.61392 0.338198,-112.12508 c 0.33805,-112.07576 0.339202,-112.13011 2.620383,-123.55771 5.000606,-25.0506 13.380092,-44.46902 28.293797,-65.56737 9.532036,-13.48492 36.049716,-38.01146 47.282176,-43.73188 2.22115,-1.13118 5.38846,-3.02124 7.03846,-4.20013 1.65,-1.17889 4.35,-2.63491 6,-3.23561 1.65,-0.60069 7.56804,-2.95283 13.15119,-5.226959 5.58316,-2.274133 17.05816,-5.796178 25.5,-7.826766 L 212.5,87.586676 l 124.70101,-0.319489 124.70101,-0.31949 9.79899,-5.795423 c 17.85751,-10.56148 36.21449,-20.322533 37.14164,-19.749521 0.50268,0.31067 4.22116,6.133753 8.26331,12.940184 l 7.34935,12.37533 12.52235,0.605959 c 27.95699,1.352845 58.50499,9.873483 75.52234,21.065154 2.75,1.80857 8.15,5.31668 12,7.79579 14.33528,9.23083 38.48989,34.65325 47,49.46688 1.65,2.87218 4.28568,7.28469 5.85706,9.80559 2.75515,4.41996 5.98378,12.731 11.08797,28.54236 2.26858,7.02744 4.80293,19.30531 6.60532,32 0.42949,3.025 0.81886,77.99154 0.86527,166.59231 L 696,563.68462 l -2.49432,14.49057 c -3.53331,20.52645 -12.221,45.4981 -18.87478,54.25312 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.60355,12.8211 -27.14906,34.15967 -47.12707,48.9462 -4.50642,3.33538 -22.80777,12.53323 -33.16338,16.66718 -9.5113,3.79689 -35.02945,9.91398 -46.26081,11.08942 -5.08479,0.53216 -7.91994,1.5665 -13.5,4.92518 -12.71182,7.65134 -27.7651,15.28491 -45.37804,23.01137 -9.52302,4.17756 -17.39802,7.58615 -17.5,7.57464 -0.10199,-0.0115 -3.80678,-7.774 -8.23287,-17.25 z m 44.43223,-36.30814 c 68.70975,-35.35685 109.7472,-82.17119 121.24999,-138.31848 2.90683,-14.18879 3.57948,-39.42819 1.43809,-53.96062 C 621.86926,473.22102 605.08207,438.62634 579.67708,408.5 568.0858,394.75456 544.12291,371.60347 528.5,359.05667 501.91096,337.70293 492.30927,327.8261 485.45021,314.7733 c -3.06854,-5.83944 -3.86366,-8.53532 -4.23806,-14.36917 -0.56814,-8.85283 1.68624,-14.41876 10.08698,-24.90413 11.66211,-14.55606 38.79388,-34.90444 69.89923,-52.42326 l 5.69836,-3.20937 -10.77444,-17.68368 c -5.92593,-9.72603 -20.62111,-33.87514 -32.65594,-53.6647 -12.03483,-19.78955 -22.45455,-36.66455 -23.15494,-37.5 -0.70038,-0.83544 -1.87129,-2.35142 -2.602,-3.36883 -1.26342,-1.75912 -1.71801,-1.64258 -9.26899,2.37613 -17.57834,9.35537 -40.78438,26.92695 -60.87061,46.09115 -11.20607,10.69167 -30.0143,31.55781 -31.44229,34.88256 -0.35434,0.825 -4.09058,6.675 -8.30276,13 -8.05259,12.09176 -16.45719,28.0749 -20.50783,39 -1.32548,3.575 -3.02684,7.85 -3.7808,9.5 -4.23862,9.27601 -7.5237,30.44554 -7.5262,48.5 -0.003,18.16184 3.3544,38.5118 8.00054,48.5 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.23306 5.85092,8.74826 0,2.36506 31.06342,31.84118 46.57721,44.19717 37.73365,30.05303 56.03172,51.89116 59.48473,70.99302 3.98125,22.02402 -16.23207,45.11458 -58.4325,66.75 -8.94638,4.58665 -12.56379,6.94154 -12.28901,8 0.62761,2.41762 44.00921,94.44985 44.78329,95.00586 0.38734,0.27822 2.29236,3.99072 4.23338,8.25 1.94101,4.25928 3.84037,7.74414 4.2208,7.74414 0.38043,0 9.06853,-4.31058 19.30689,-9.57906 z m -262.86608,-6.45507 c 12.21224,-1.15038 24.83184,-4.81576 37.72404,-10.95699 14.42331,-6.87058 24.05584,-13.80647 36.80956,-26.50468 26.92084,-26.80365 42.6288,-61.84169 47.39317,-105.71479 C 363.56525,542.08222 364,513.33686 364,478.06491 l 0,-60.01393 -6.8359,-10.37193 C 339.53137,380.92541 329.49936,354.3585 325.37696,323.5 c -2.29335,-17.16702 -1.38355,-42.543 2.13323,-59.5 5.19072,-25.02832 15.50856,-50.32828 29.82049,-73.12165 5.68696,-9.05713 6.66932,-11.29044 6.66932,-15.1621 0,-4.47689 -0.0525,-4.54858 -3.75,-5.12088 C 353.44128,169.54151 251.92496,158 249.46423,158 l -2.40999,0 -0.32021,190.75 c -0.30071,179.13425 -0.42911,191.20322 -2.10845,198.19263 -3.84574,16.00597 -11.74168,29.98646 -18.8376,33.35369 -5.40074,2.56282 -13.66105,3.20138 -17.99387,1.39101 C 195.0136,576.3473 188.01181,547.53541 188.00342,500.25 L 188,481 l -3.25,0.0323 c -2.86202,0.0284 -79.58911,6.01486 -99.918642,7.79587 -4.217754,0.36951 -7.963823,0.9679 -8.324599,1.32976 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z m 197.81462,-0.88757 c -0.18333,-0.50693 -11.34609,-24.39484 -24.80613,-53.08423 -17.02929,-36.29705 -24.67117,-51.60464 -25.12497,-50.3283 -0.35868,1.00883 -2.09071,6.78423 -3.84896,12.83423 -9.023,31.04757 -23.12493,54.69898 -46.65582,78.25 l -13.23868,13.25 57.00395,0 c 34.34861,0 56.87147,-0.36631 56.67061,-0.9217 z m 155.45651,-14.22308 c 15.70112,-7.9986 29.44132,-18.35937 40.53412,-30.56465 8.23312,-9.05881 10.25164,-11.94116 22.26369,-31.79144 3.38991,-5.60194 9.89691,-26.16884 11.89846,-37.60785 1.93578,-11.06322 1.9929,-16.02798 1.98343,-172.39128 -0.006,-96.04114 -0.39073,-163.42083 -0.95401,-167 -0.51934,-3.3 -1.40108,-8.9854 -1.95943,-12.63422 -1.46086,-9.54681 -10.08061,-33.26255 -14.85312,-40.86578 -2.244,-3.575 -6.24146,-9.65 -8.88323,-13.5 -8.0331,-11.70709 -28.88895,-31.03324 -39.81975,-36.89912 -2.75,-1.47576 -7.025,-4.00731 -9.5,-5.62568 -9.09764,-5.94881 -30.42645,-12.13176 -49.75005,-14.42189 l -5.25005,-0.62221 15.64838,25.78445 c 46.2132,76.14728 55.53121,91.58861 55.98957,92.78309 0.32598,0.84949 -3.12477,3.31505 -9.8176,7.01466 -40.33433,22.29575 -64.59161,38.25644 -77.57025,51.03931 -5.7781,5.69095 -9.25,9.89068 -9.25,11.18914 0,3.43225 7.49007,11.84149 18.7605,21.06276 28.55145,23.36029 35.81326,29.72341 49.27038,43.17287 17.48119,17.47125 29.19794,31.58625 41.39393,49.86666 50.75173,76.07109 48.06008,163.48157 -7.19261,233.57708 -3.06895,3.89338 -10.76524,12.36638 -17.10286,18.82888 -6.33762,6.4625 -11.19146,11.75 -10.7863,11.75 0.40515,0 2.63121,-0.96515 4.9468,-2.14478 z M 417.29581,564.58763 c 10.5623,-5.14098 23.44739,-12.14603 28.63353,-15.56677 9.75281,-6.4329 19.48712,-15.42299 22.02947,-20.34528 1.34464,-2.60337 1.26638,-3.18925 -1,-7.48633 -6.25339,-11.85649 -18.74279,-24.48749 -46.45881,-46.98555 -8.25,-6.69681 -17.0874,-13.98679 -19.63867,-16.19995 l -4.63866,-4.02393 -0.51864,46.26009 c -0.4893,43.64379 -1.28875,57.48014 -4.21812,73.00518 l -0.70665,3.74509 3.65618,-1.52765 c 2.01089,-0.84021 12.29806,-5.73391 22.86037,-10.8749 z M 147.5,451.03055 c 29.15,-2.1814 55.8125,-4.24148 59.25,-4.57796 l 6.25,-0.61178 0,-162.35753 0,-162.35754 3.25,0.47773 c 7.85538,1.15468 173.54715,19.39614 176.18173,19.39632 2.29984,1.7e-4 4.67071,-1.67662 11,-7.77971 C 407.86928,128.94112 414.875,122.4134 419,118.71404 l 7.5,-6.72612 -106,0.25604 -106,0.25604 -12.17888,2.77199 C 191.04874,117.83766 180.086,121.67695 169,126.94148 149.80957,136.05464 128.37323,154.42042 117.57537,171 c -2.68651,4.125 -6.50249,9.94099 -8.47997,12.92442 -3.81072,5.74928 -5.43739,9.43011 -10.197805,23.07558 -6.470732,18.54802 -6.267054,14.34823 -6.632003,136.75 -0.268444,90.03482 -0.08702,111.24969 0.951355,111.24836 0.705679,-8.9e-4 25.133053,-1.78641 54.283053,-3.96781 z"
+       id="path3316"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#232323"
+       d="M 459.45256,733.72908 451.40512,716.5 l -85.10314,-0.2556 -85.10315,-0.25559 -11.97012,3.44536 C 234.41148,729.45562 194.05114,728.85922 161.5,717.84229 149.5171,713.78667 131.36674,704.32107 121.5,696.98187 111.04552,689.20549 94.366468,672.62202 86.589496,662.27142 67.582133,636.97399 55.139838,606.29642 49.091119,569.81589 45.584575,548.66752 44.914468,538.66564 44.306645,498.40385 L 43.716419,459.3077 47.60821,458.66486 C 49.748694,458.31129 53.3,458.01211 55.5,458 c 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 l 3.713493,-0.61392 0.338198,-112.12508 c 0.33805,-112.07576 0.339202,-112.13011 2.620383,-123.55771 5.000606,-25.0506 13.380092,-44.46902 28.293797,-65.56737 9.532036,-13.48492 36.049716,-38.01146 47.282176,-43.73188 2.22115,-1.13118 5.38846,-3.02124 7.03846,-4.20013 1.65,-1.17889 4.35,-2.63491 6,-3.23561 1.65,-0.60069 7.56804,-2.95283 13.15119,-5.226959 5.58316,-2.274133 17.05816,-5.796178 25.5,-7.826766 L 212.5,87.586676 l 124.70101,-0.319489 124.70101,-0.31949 9.79899,-5.795423 c 17.85751,-10.56148 36.21449,-20.322533 37.14164,-19.749521 0.50268,0.31067 4.22116,6.133753 8.26331,12.940184 l 7.34935,12.37533 12.52235,0.605959 c 27.95699,1.352845 58.50499,9.873483 75.52234,21.065154 2.75,1.80857 8.15,5.31668 12,7.79579 14.33528,9.23083 38.48989,34.65325 47,49.46688 1.65,2.87218 4.28568,7.28469 5.85706,9.80559 2.75515,4.41996 5.98378,12.731 11.08797,28.54236 2.26858,7.02744 4.80293,19.30531 6.60532,32 0.42949,3.025 0.81886,77.99154 0.86527,166.59231 L 696,563.68462 l -2.49432,14.49057 c -3.53331,20.52645 -12.221,45.4981 -18.87478,54.25312 -1.28396,1.68943 -3.09124,4.54098 -4.01617,6.33678 -6.60355,12.8211 -27.14906,34.15967 -47.12707,48.9462 -4.50642,3.33538 -22.80777,12.53323 -33.16338,16.66718 -9.5113,3.79689 -35.02945,9.91398 -46.26081,11.08942 -5.08479,0.53216 -7.91994,1.5665 -13.5,4.92518 -12.71182,7.65134 -27.7651,15.28491 -45.37804,23.01137 -9.52302,4.17756 -17.39802,7.58615 -17.5,7.57464 -0.10199,-0.0115 -3.80678,-7.774 -8.23287,-17.25 z m 44.43223,-36.29987 c 56.8561,-29.23189 96.2435,-67.89764 113.11172,-111.03928 C 633.69543,543.68129 631.65355,498.73127 611.09619,456.5 592.93628,419.19383 567.46397,390.42665 515.02334,348 c -27.41139,-22.17695 -38.41445,-42.4221 -32.09503,-59.05346 6.46782,-17.02191 36.67154,-42.44118 78.26359,-65.86615 l 5.6919,-3.20573 -12.57813,-20.68733 c -6.91797,-11.37803 -21.58972,-35.50483 -32.6039,-53.61511 -11.01418,-18.11027 -20.61933,-33.63527 -21.34479,-34.5 -0.72545,-0.86472 -1.91687,-2.40465 -2.64758,-3.42206 -1.26342,-1.75912 -1.71801,-1.64258 -9.26899,2.37613 -17.59972,9.36675 -41.46526,27.44155 -61.12716,46.29527 -11.04889,10.59473 -29.79494,31.44028 -31.18574,34.67844 -0.35434,0.825 -4.09058,6.675 -8.30276,13 -8.05259,12.09176 -16.45719,28.0749 -20.50783,39 -1.32548,3.575 -3.02684,7.85 -3.7808,9.5 -4.23862,9.27601 -7.5237,30.44554 -7.5262,48.5 -0.003,18.16184 3.3544,38.5118 8.00054,48.5 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.23306 5.85092,8.74826 0,2.36506 31.06342,31.84118 46.57721,44.19717 37.73365,30.05303 56.03172,51.89116 59.48473,70.99302 3.97572,21.99339 -16.18726,45.04257 -58.39161,66.75 -6.95064,3.575 -12.64491,6.80879 -12.65393,7.1862 -0.0257,1.07721 44.29843,95.25313 45.09781,95.81966 0.39257,0.27822 2.30187,3.99072 4.24289,8.25 1.94101,4.25928 3.84037,7.74414 4.2208,7.74414 0.38043,0 9.06853,-4.30685 19.30689,-9.57079 z m -262.86608,-6.46334 c 12.21224,-1.15038 24.83184,-4.81576 37.72404,-10.95699 14.42331,-6.87058 24.05584,-13.80647 36.80956,-26.50468 27.03543,-26.91775 42.49047,-61.45713 47.43277,-106.0042 0.55295,-4.98401 1.00217,-35.87345 1.00672,-69.22451 L 364,418.05098 357.1641,407.67905 C 339.53137,380.92541 329.49936,354.3585 325.37696,323.5 c -2.29335,-17.16702 -1.38355,-42.543 2.13323,-59.5 5.19072,-25.02832 15.50856,-50.32828 29.82049,-73.12165 5.68696,-9.05713 6.66932,-11.29044 6.66932,-15.1621 0,-4.47689 -0.0525,-4.54858 -3.75,-5.12088 C 353.39587,169.53449 251.91654,158 249.43711,158 L 247,158 l 0,183.39405 c 0,184.56972 -0.20863,196.74036 -3.59868,209.9366 -3.41564,13.29581 -10.80493,25.24009 -17.90132,28.93625 -5.6731,2.95484 -16.26446,3.03443 -20.17584,0.1516 -6.58801,-4.85558 -11.76682,-17.93215 -15.00017,-37.87558 -0.86258,-5.32044 -1.69764,-19.84862 -2.02859,-35.29292 l -0.56249,-26.25 -3.11646,0.0323 c -2.76588,0.0287 -80.01585,6.06395 -99.785092,7.79587 -4.217754,0.36951 -7.963823,0.9679 -8.324599,1.32976 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z M 439,690.59039 c 0,-0.53861 -49.02504,-104.94876 -49.50179,-105.42551 -0.20172,-0.20172 -0.85835,1.59116 -1.45917,3.98418 -9.16362,36.49754 -23.95654,62.87362 -49.69149,88.60094 l -13.25393,13.25 56.95319,0 C 413.37106,691 439,690.81567 439,690.59039 z M 595.28324,675.357 c 21.95233,-11.12185 44.49439,-31.5963 53.79084,-48.857 1.1849,-2.2 3.16303,-5.35 4.39586,-7 3.66111,-4.90002 6.02552,-10.29315 10.30264,-23.5 7.68196,-23.72026 7.22979,-11.66923 7.20731,-192.08626 -0.012,-96.24487 -0.40133,-163.83617 -0.96436,-167.41374 -0.51934,-3.3 -1.40108,-8.9854 -1.95943,-12.63422 -1.4353,-9.3798 -10.28182,-33.88232 -14.77367,-40.91918 -8.50869,-13.32959 -15.68141,-22.64532 -22.63828,-29.40198 -9.28914,-9.02181 -19.47139,-17.18501 -26.24969,-21.04462 -2.89776,-1.65 -7.26702,-4.24807 -9.70949,-5.77349 -9.44908,-5.90133 -30.45572,-11.92368 -49.44006,-14.17387 l -5.25509,-0.62288 16.84922,27.78512 c 9.26708,15.28182 25.26988,41.6523 35.56179,58.60108 10.29191,16.94878 18.94366,31.4182 19.22612,32.15427 0.34003,0.88611 -2.97357,3.27018 -9.8067,7.05573 -41.485,22.9827 -64.62534,38.19325 -77.55978,50.9814 -5.77419,5.70888 -9.26047,9.93828 -9.26047,11.23439 0,4.69997 8.17967,12.87477 32,31.98097 45.94542,36.85265 78.79175,76.44624 96.4401,116.25071 23.38238,52.73709 22.87403,109.44795 -1.43254,159.81353 -10.37576,21.49958 -22.92392,39.01533 -41.88251,58.46304 -6.29996,6.4625 -11.1404,11.75 -10.75652,11.75 0.38388,0 3.0455,-1.18935 5.91471,-2.643 z M 418.39008,564.02227 c 23.37667,-11.43128 33.50677,-17.85851 42.82293,-27.16982 7.88265,-7.87853 8.72046,-10.10238 5.89353,-15.64362 -5.65616,-11.08698 -19.25911,-24.80626 -46.60654,-47.00513 -8.25,-6.69681 -17.08488,-13.98466 -19.63306,-16.19522 l -4.63306,-4.0192 -0.53229,46.25536 c -0.50107,43.54324 -1.31416,57.62301 -4.21568,73.00045 l -0.70665,3.74509 3.75046,-1.56704 c 2.06275,-0.86187 12.79991,-5.99227 23.86036,-11.40087 z M 147.54353,451.03361 c 29.12606,-2.18151 55.76897,-4.24233 59.20647,-4.57959 l 6.25,-0.61321 0,-162.3954 0,-162.39541 2.75,0.48714 c 4.95896,0.87843 173.67573,19.46481 176.68173,19.46382 2.29908,-7.5e-4 4.67282,-1.67983 11,-7.78088 C 407.86928,128.94112 414.875,122.41222 419,118.71142 l 7.5,-6.72875 -106.5,0.27653 -106.5,0.27653 -11.83823,2.81837 c -10.86275,2.58614 -21.0345,6.17357 -32.66177,11.51935 -18.20789,8.3713 -40.71767,27.68653 -51.42463,44.12655 -2.68651,4.125 -6.50249,9.94099 -8.47997,12.92442 -3.81072,5.74928 -5.43739,9.43011 -10.197805,23.07558 -6.470732,18.54802 -6.267054,14.34823 -6.632003,136.75 -0.274081,91.92529 -0.101264,111.25 0.994884,111.25 0.72962,0 25.156994,-1.78487 54.283054,-3.96639 z"
+       id="path3314"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#312810"
+       d="M 459.45256,733.72908 451.40512,716.5 l -85.28948,-0.25563 -85.28948,-0.25564 -8.16308,2.45727 C 228.73727,731.66864 180.01908,728.57704 143.5,710.24946 127.27413,702.1063 118.40897,695.50441 102.94478,680.04794 86.488491,663.59989 77.452322,651.14683 68.497854,632.57543 50.365571,594.96941 44.033884,556.91159 44.009063,485.38084 L 44,459.26168 l 3.75,-0.61983 c 2.0625,-0.34091 5.55,-0.62974 7.75,-0.64185 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 L 66.926986,456.75016 67.265184,344.62508 67.603382,232.5 69.896601,221 c 3.557085,-17.83802 12.024683,-41.26654 17.527098,-48.49474 1.258252,-1.65289 3.260085,-4.91439 4.448518,-7.24777 C 99.708771,149.87113 130.1302,119.65922 146,111.5025 c 1.925,-0.98941 4.89248,-2.85723 6.59439,-4.15071 1.70192,-1.29349 3.51889,-2.35179 4.03773,-2.35179 0.51883,0 4.75136,-1.6089 9.40561,-3.57534 C 179.29675,95.822669 181.5226,95.109833 198,91.188618 L 213.5,87.5 l 124.19508,-0.272632 124.19509,-0.272632 9.80491,-5.799362 c 5.39271,-3.189648 15.83058,-9.092308 23.19528,-13.117022 l 13.39035,-7.317661 1.72338,2.284734 c 0.94786,1.256603 4.58816,7.106103 8.08957,12.998888 l 6.36619,10.714156 12.52007,0.604864 c 27.58982,1.332908 58.65276,10.004962 75.52008,21.083467 2.75,1.8062 8.375,5.48142 12.5,8.16715 10.28823,6.69853 35.14679,31.58947 41.57127,41.62544 9.06105,14.15466 9.74895,15.27599 12.59551,20.53171 1.55827,2.87711 2.83322,5.88495 2.83322,6.68409 0,0.79914 1.0789,4.07014 2.39756,7.2689 3.45527,8.38165 6.43352,18.12566 7.12649,23.31591 0.33046,2.475 1.36023,7.65 2.28839,11.5 1.54873,6.42415 1.68756,20.73817 1.68756,174 l 0,167 -2.23259,12 c -7.77024,41.7644 -29.76256,76.83027 -64.76741,103.26901 -20.6893,15.62639 -52.76788,27.80981 -82.40881,31.29881 -7.36151,0.86651 -9.41655,1.5894 -16.5,5.80415 -13.89861,8.26985 -25.34213,14.06645 -43.89572,22.23493 -9.86046,4.3412 -17.98827,7.88369 -18.06179,7.87218 -0.0735,-0.0115 -3.75503,-7.774 -8.18112,-17.25 z m 44.43223,-36.29987 c 56.8561,-29.23189 96.2435,-67.89764 113.11172,-111.03928 C 633.69543,543.68129 631.65355,498.73127 611.09619,456.5 592.93628,419.19383 567.46397,390.42665 515.02334,348 c -27.41139,-22.17695 -38.41445,-42.4221 -32.09503,-59.05346 6.46782,-17.02191 36.67154,-42.44118 78.26359,-65.86615 l 5.6919,-3.20573 -12.57813,-20.68733 c -6.91797,-11.37803 -21.58972,-35.50483 -32.6039,-53.61511 -11.01418,-18.11027 -20.61933,-33.63527 -21.34479,-34.5 -0.72545,-0.86472 -1.91687,-2.40465 -2.64758,-3.42206 -1.26342,-1.75912 -1.71801,-1.64258 -9.26899,2.37613 -17.59972,9.36675 -41.46526,27.44155 -61.12716,46.29527 -11.04889,10.59473 -29.79494,31.44028 -31.18574,34.67844 -0.35434,0.825 -4.09058,6.675 -8.30276,13 -8.05259,12.09176 -16.45719,28.0749 -20.50783,39 -1.32548,3.575 -3.02684,7.85 -3.7808,9.5 -4.23862,9.27601 -7.5237,30.44554 -7.5262,48.5 -0.003,18.16184 3.3544,38.5118 8.00054,48.5 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.23306 5.85092,8.74826 0,2.36506 31.06342,31.84118 46.57721,44.19717 37.73365,30.05303 56.03172,51.89116 59.48473,70.99302 3.97572,21.99339 -16.18726,45.04257 -58.39161,66.75 -6.95064,3.575 -12.64491,6.80879 -12.65393,7.1862 -0.0257,1.07721 44.29843,95.25313 45.09781,95.81966 0.39257,0.27822 2.30187,3.99072 4.24289,8.25 1.94101,4.25928 3.84037,7.74414 4.2208,7.74414 0.38043,0 9.06853,-4.30685 19.30689,-9.57079 z m -262.86608,-6.46334 c 12.21224,-1.15038 24.83184,-4.81576 37.72404,-10.95699 14.42331,-6.87058 24.05584,-13.80647 36.80956,-26.50468 27.03543,-26.91775 42.49047,-61.45713 47.43277,-106.0042 0.5531,-4.98536 1.00217,-35.90046 1.00672,-69.30532 L 364,417.88937 357.0296,407.33531 C 333.41251,371.57607 322.99147,335.43973 324.34582,294 c 0.66332,-20.29578 3.33218,-35.22858 9.74052,-54.5 4.69037,-14.10505 15.27094,-36.1104 23.80051,-49.5 5.14389,-8.07482 6.05637,-10.1994 6.08246,-14.1621 0.0304,-4.62454 4.8e-4,-4.66678 -3.71931,-5.24253 C 353.39587,169.53449 251.91654,158 249.43711,158 L 247,158 l 0,183.39405 c 0,184.56972 -0.20863,196.74036 -3.59868,209.9366 -3.41564,13.29581 -10.80493,25.24009 -17.90132,28.93625 -5.6731,2.95484 -16.26446,3.03443 -20.17584,0.1516 -6.58801,-4.85558 -11.76682,-17.93215 -15.00017,-37.87558 -0.86258,-5.32044 -1.69764,-19.84862 -2.02859,-35.29292 l -0.56249,-26.25 -3.11646,0.0323 c -2.76588,0.0287 -80.01585,6.06395 -99.785092,7.79587 -4.217754,0.36951 -7.963823,0.9679 -8.324599,1.32976 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z M 439,690.59039 c 0,-0.53861 -49.02504,-104.94876 -49.50179,-105.42551 -0.20172,-0.20172 -0.85835,1.59116 -1.45917,3.98418 -9.16362,36.49754 -23.95654,62.87362 -49.69149,88.60094 l -13.25393,13.25 56.95319,0 C 413.37106,691 439,690.81567 439,690.59039 z M 595.28324,675.357 c 21.95233,-11.12185 44.49439,-31.5963 53.79084,-48.857 1.1849,-2.2 3.16303,-5.35 4.39586,-7 3.66111,-4.90002 6.02552,-10.29315 10.30264,-23.5 7.68196,-23.72026 7.22979,-11.66923 7.20731,-192.08626 -0.012,-96.24487 -0.40133,-163.83617 -0.96436,-167.41374 -0.51934,-3.3 -1.40108,-8.9854 -1.95943,-12.63422 -1.4353,-9.3798 -10.28182,-33.88232 -14.77367,-40.91918 -8.50869,-13.32959 -15.68141,-22.64532 -22.63828,-29.40198 -9.28914,-9.02181 -19.47139,-17.18501 -26.24969,-21.04462 -2.89776,-1.65 -7.26702,-4.24807 -9.70949,-5.77349 -9.44908,-5.90133 -30.45572,-11.92368 -49.44006,-14.17387 l -5.25509,-0.62288 16.84922,27.78512 c 9.26708,15.28182 25.26988,41.6523 35.56179,58.60108 10.29191,16.94878 18.94366,31.4182 19.22612,32.15427 0.34003,0.88611 -2.97357,3.27018 -9.8067,7.05573 -41.485,22.9827 -64.62534,38.19325 -77.55978,50.9814 -5.77419,5.70888 -9.26047,9.93828 -9.26047,11.23439 0,4.69997 8.17967,12.87477 32,31.98097 45.94542,36.85265 78.79175,76.44624 96.4401,116.25071 23.38238,52.73709 22.87403,109.44795 -1.43254,159.81353 -10.37576,21.49958 -22.92392,39.01533 -41.88251,58.46304 -6.29996,6.4625 -11.1404,11.75 -10.75652,11.75 0.38388,0 3.0455,-1.18935 5.91471,-2.643 z M 418.39008,564.02227 c 23.37667,-11.43128 33.50677,-17.85851 42.82293,-27.16982 7.88265,-7.87853 8.72046,-10.10238 5.89353,-15.64362 -5.65616,-11.08698 -19.25911,-24.80626 -46.60654,-47.00513 -8.25,-6.69681 -17.08488,-13.98466 -19.63306,-16.19522 l -4.63306,-4.0192 -0.53229,46.25536 c -0.50107,43.54324 -1.31416,57.62301 -4.21568,73.00045 l -0.70665,3.74509 3.75046,-1.56704 c 2.06275,-0.86187 12.79991,-5.99227 23.86036,-11.40087 z M 147.54353,451.03361 c 29.12606,-2.18151 55.76897,-4.24233 59.20647,-4.57959 l 6.25,-0.61321 0,-162.3954 0,-162.39541 2.75,0.48714 c 4.95896,0.87843 173.67573,19.46481 176.68173,19.46382 2.29908,-7.5e-4 4.67282,-1.67983 11,-7.78088 C 407.86928,128.94112 414.875,122.41222 419,118.71142 l 7.5,-6.72875 -106.5,0.27653 -106.5,0.27653 -11.83823,2.81837 c -10.86275,2.58614 -21.0345,6.17357 -32.66177,11.51935 -20.1536,9.26586 -43.09303,29.72696 -54.3775,48.50266 -1.03263,1.71814 -3.48421,5.53616 -5.44795,8.48449 -3.87443,5.81699 -7.58622,14.00227 -9.607036,21.18553 -0.70341,2.50037 -1.76959,5.46293 -2.369287,6.58348 -0.599698,1.12055 -1.879603,6.27479 -2.844235,11.45387 -1.590879,8.5414 -1.784832,19.75547 -2.086987,120.66652 -0.27525,91.926 -0.102686,111.25 0.993471,111.25 0.72962,0 25.156994,-1.78487 54.283054,-3.96639 z"
+       id="path3312"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#302710"
+       d="M 459.45256,733.72908 451.40512,716.5 l -85.28948,-0.25563 -85.28948,-0.25564 -8.16308,2.45727 C 228.73727,731.66864 180.01908,728.57704 143.5,710.24946 127.27413,702.1063 118.40897,695.50441 102.94478,680.04794 86.488491,663.59989 77.452322,651.14683 68.497854,632.57543 50.365571,594.96941 44.033884,556.91159 44.009063,485.38084 L 44,459.26168 l 3.75,-0.61983 c 2.0625,-0.34091 5.55,-0.62974 7.75,-0.64185 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 L 66.926986,456.75016 67.265184,344.62508 67.603382,232.5 69.896601,221 c 3.557085,-17.83802 12.024683,-41.26654 17.527098,-48.49474 1.258252,-1.65289 3.260085,-4.91439 4.448518,-7.24777 C 99.708771,149.87113 130.1302,119.65922 146,111.5025 c 1.925,-0.98941 4.89248,-2.85723 6.59439,-4.15071 1.70192,-1.29349 3.51889,-2.35179 4.03773,-2.35179 0.51883,0 4.75136,-1.6089 9.40561,-3.57534 C 179.29675,95.822669 181.5226,95.109833 198,91.188618 L 213.5,87.5 l 124.19508,-0.272632 124.19509,-0.272632 9.80491,-5.799362 c 5.39271,-3.189648 15.83058,-9.092308 23.19528,-13.117022 l 13.39035,-7.317661 1.72338,2.284734 c 0.94786,1.256603 4.58816,7.106103 8.08957,12.998888 l 6.36619,10.714156 12.52007,0.604864 c 27.58982,1.332908 58.65276,10.004962 75.52008,21.083467 2.75,1.8062 8.375,5.48142 12.5,8.16715 10.28823,6.69853 35.14679,31.58947 41.57127,41.62544 9.06105,14.15466 9.74895,15.27599 12.59551,20.53171 1.55827,2.87711 2.83322,5.88495 2.83322,6.68409 0,0.79914 1.0789,4.07014 2.39756,7.2689 3.45527,8.38165 6.43352,18.12566 7.12649,23.31591 0.33046,2.475 1.36023,7.65 2.28839,11.5 1.54873,6.42415 1.68756,20.73817 1.68756,174 l 0,167 -2.23259,12 c -7.77024,41.7644 -29.76256,76.83027 -64.76741,103.26901 -20.6893,15.62639 -52.76788,27.80981 -82.40881,31.29881 -7.36151,0.86651 -9.41655,1.5894 -16.5,5.80415 -13.89861,8.26985 -25.34213,14.06645 -43.89572,22.23493 -9.86046,4.3412 -17.98827,7.88369 -18.06179,7.87218 -0.0735,-0.0115 -3.75503,-7.774 -8.18112,-17.25 z M 503.8467,697.44841 C 576.49732,660.24699 619.63946,608.02483 626.89704,548.5 c 3.88913,-31.89766 -1.3264,-62.26494 -15.80085,-92 -18.15991,-37.30617 -43.63222,-66.07335 -96.07285,-108.5 -16.14521,-13.06214 -27.58539,-26.90007 -32.04761,-38.76446 -2.87083,-7.63314 -2.41623,-15.79863 1.29637,-23.28521 7.69509,-15.51739 31.30753,-35.57598 67.10278,-57.00332 l 15.42322,-9.23247 -13.73887,-22.60727 c -42.80247,-70.43131 -51.43427,-84.5254 -52.66405,-85.99044 -0.74646,-0.88926 -1.95507,-2.44926 -2.68578,-3.46667 -1.26342,-1.75912 -1.71801,-1.64258 -9.26899,2.37613 -19.78985,10.53236 -43.48578,28.95214 -65.52108,50.93214 -13.55904,13.52502 -25.8081,27.36343 -27.03384,30.54157 -0.21212,0.55 -3.83573,6.175 -8.05246,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.02684,7.85 -3.7808,9.5 -4.23862,9.27601 -7.5237,30.44554 -7.5262,48.5 -0.003,18.16184 3.3544,38.5118 8.00054,48.5 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.23306 5.85092,8.74826 0,2.47719 31.0353,31.86269 47,44.50154 19.14887,15.15966 39.95321,35.19726 47.28799,45.54519 9.66389,13.63385 13.69689,26.11405 11.78353,36.46438 -2.16534,11.71344 -11.97203,24.90873 -26.81366,36.07886 -8.23584,6.19848 -27.9125,17.97666 -38.06314,22.78409 -3.4071,1.61363 -6.19472,3.28399 -6.19472,3.71193 0,1.16746 44.29027,95.27429 45.1154,95.86006 0.39192,0.27822 2.30068,3.99072 4.2417,8.25 1.94101,4.25928 3.82323,7.74414 4.18271,7.74414 0.35948,0 9.04758,-4.29822 19.30689,-9.55159 z M 241.01871,690.96587 C 253.56706,689.78383 266.01878,686.09864 279.5,679.57703 317.81061,661.04406 345.65759,624.68479 358.06207,577 c 0.64383,-2.475 2.08159,-9.45 3.19502,-15.5 1.86829,-10.15165 2.05705,-16.10619 2.44762,-77.20848 l 0.4232,-66.20849 -7.03436,-10.65089 C 333.40821,371.56957 322.99005,335.48297 324.34582,294 c 0.66332,-20.29578 3.33218,-35.22858 9.74052,-54.5 4.69037,-14.10505 15.27094,-36.1104 23.80051,-49.5 5.14389,-8.07482 6.05637,-10.1994 6.08246,-14.1621 0.0304,-4.62454 4.8e-4,-4.66678 -3.71931,-5.24253 C 353.39587,169.53449 251.91654,158 249.43711,158 L 247,158 l 0,183.39405 c 0,120.89058 -0.35799,186.92351 -1.05041,193.75 -1.75558,17.30826 -5.53198,28.6257 -12.71708,38.11168 -5.01818,6.62514 -9.93531,9.07443 -18.40835,9.16942 -8.04528,0.0902 -10.79628,-1.56256 -15.47565,-9.29756 -7.01405,-11.59422 -10.34867,-31.59022 -11.06943,-66.37759 l -0.53352,-25.75 -3.12278,0.0323 c -2.77042,0.0287 -79.99535,6.0616 -99.791422,7.79587 -4.217754,0.36951 -7.963823,0.9679 -8.324599,1.32976 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z M 439,690.59039 c 0,-0.53861 -49.02504,-104.94876 -49.50179,-105.42551 -0.20172,-0.20172 -0.84387,1.59116 -1.427,3.98418 -2.60709,10.6988 -9.69163,30.2749 -14.6029,40.35094 -9.55263,19.59832 -22.16235,36.47198 -39.21761,52.4789 L 324.63879,691 381.8194,691 C 413.26873,691 439,690.81567 439,690.59039 z m 158.35377,-16.33657 c 19.05128,-9.987 38.53191,-27.07678 48.35341,-42.419 2.08605,-3.25863 5.30131,-8.26705 7.14503,-11.1298 1.84371,-2.86276 4.01058,-6.47697 4.81526,-8.03157 3.31593,-6.40619 9.49016,-26.20303 11.33166,-36.33342 1.90759,-10.49398 1.97089,-16.01155 1.98282,-172.84003 0.0118,-155.84325 -0.0616,-162.44561 -1.93347,-173.72517 C 666.18381,212.5125 659.35781,192.28694 653.26227,183 c -1.98548,-3.025 -5.66923,-8.63999 -8.18611,-12.47775 -7.76039,-11.83307 -28.14136,-30.88169 -40.6817,-38.02225 -2.89776,-1.65 -7.22734,-4.22481 -9.6213,-5.7218 -9.82901,-6.14629 -29.52525,-11.79885 -49.52825,-14.21395 l -5.25509,-0.63449 17.15915,28.28512 c 44.01216,72.54955 54.10125,89.27361 54.53011,90.3912 0.27217,0.70926 -3.77158,3.55043 -9.85883,6.92691 -25.82533,14.32481 -34.43208,19.44659 -50.32025,29.94499 -23.00373,15.20014 -37.42639,28.69483 -36.14112,33.81577 1.02242,4.07364 10.51785,13.43022 27.39509,26.99449 37.03644,29.76627 61.17618,54.94307 81.26175,84.75284 41.48569,61.5705 48.03752,132.48829 17.99184,194.74588 -10.37576,21.49958 -22.92392,39.01533 -41.88251,58.46304 -6.29996,6.4625 -11.10866,11.75 -10.686,11.75 0.42267,0 3.98429,-1.68578 7.91472,-3.74618 z M 417,564.70697 c 24.75213,-12.11115 34.78635,-18.43277 44.21301,-27.85452 7.88265,-7.87853 8.72046,-10.10238 5.89353,-15.64362 -5.65366,-11.08208 -19.67939,-25.3254 -44.6289,-45.32127 C 414.78994,469.72622 405.8,462.24771 402.5,459.26863 l -6,-5.4165 -0.61337,45.32393 c -0.56382,41.66297 -1.23079,53.66676 -3.90739,70.32394 -0.53027,3.3 -0.96753,6.32636 -0.97169,6.72525 -0.0113,1.08629 2.56667,-0.0561 25.99245,-11.51828 z M 147.62216,451.04009 c 29.08281,-2.17795 55.69034,-4.23877 59.12784,-4.57959 l 6.25,-0.61969 0,-162.3954 0,-162.39541 2.75,0.48802 C 220.80653,122.43535 389.23775,141 392.32243,141 c 2.43608,0 4.64606,-1.54766 11.1093,-7.77992 C 407.86928,128.94112 414.875,122.41222 419,118.71142 l 7.5,-6.72875 -106.5,0.27653 -106.5,0.27653 -11.83823,2.81837 c -10.86275,2.58614 -21.0345,6.17357 -32.66177,11.51935 -20.25116,9.31071 -43.0384,29.63607 -54.3775,48.50266 -1.03263,1.71814 -3.48421,5.53616 -5.44795,8.48449 -3.87443,5.81699 -7.58622,14.00227 -9.607036,21.18553 -0.70341,2.50037 -1.76959,5.46293 -2.369287,6.58348 -0.599698,1.12055 -1.879603,6.27479 -2.844235,11.45387 -1.590879,8.5414 -1.784832,19.75547 -2.086987,120.66652 -0.28459,95.04521 -0.128426,111.25 1.072106,111.25 0.772869,0 25.200239,-1.78196 54.283049,-3.95991 z"
+       id="path3310"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#2d250e"
+       d="M 459.45256,733.72908 451.40512,716.5 l -85.28948,-0.25563 -85.28948,-0.25564 -8.16308,2.45727 C 228.73727,731.66864 180.01908,728.57704 143.5,710.24946 127.27413,702.1063 118.40897,695.50441 102.94478,680.04794 86.488491,663.59989 77.452322,651.14683 68.497854,632.57543 50.365571,594.96941 44.033884,556.91159 44.009063,485.38084 L 44,459.26168 l 3.75,-0.61983 c 2.0625,-0.34091 5.55,-0.62974 7.75,-0.64185 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 L 66.926986,456.75016 67.265184,344.62508 67.603382,232.5 69.896601,221 c 3.557085,-17.83802 12.024683,-41.26654 17.527098,-48.49474 1.258252,-1.65289 3.260085,-4.91439 4.448518,-7.24777 C 99.708771,149.87113 130.1302,119.65922 146,111.5025 c 1.925,-0.98941 4.89248,-2.85723 6.59439,-4.15071 1.70192,-1.29349 3.51889,-2.35179 4.03773,-2.35179 0.51883,0 4.75136,-1.6089 9.40561,-3.57534 C 179.29675,95.822669 181.5226,95.109833 198,91.188618 L 213.5,87.5 l 124.19508,-0.272632 124.19509,-0.272632 9.80491,-5.799362 c 5.39271,-3.189648 15.83058,-9.092308 23.19528,-13.117022 l 13.39035,-7.317661 1.72338,2.284734 c 0.94786,1.256603 4.58816,7.106103 8.08957,12.998888 l 6.36619,10.714156 12.52007,0.604864 c 27.58982,1.332908 58.65276,10.004962 75.52008,21.083467 2.75,1.8062 8.375,5.48142 12.5,8.16715 10.28823,6.69853 35.14679,31.58947 41.57127,41.62544 9.06105,14.15466 9.74895,15.27599 12.59551,20.53171 1.55827,2.87711 2.83322,5.88495 2.83322,6.68409 0,0.79914 1.0789,4.07014 2.39756,7.2689 3.45527,8.38165 6.43352,18.12566 7.12649,23.31591 0.33046,2.475 1.36023,7.65 2.28839,11.5 1.54873,6.42415 1.68756,20.73817 1.68756,174 l 0,167 -2.23259,12 c -7.77024,41.7644 -29.76256,76.83027 -64.76741,103.26901 -20.6893,15.62639 -52.76788,27.80981 -82.40881,31.29881 -7.36151,0.86651 -9.41655,1.5894 -16.5,5.80415 -13.89861,8.26985 -25.34213,14.06645 -43.89572,22.23493 -9.86046,4.3412 -17.98827,7.88369 -18.06179,7.87218 -0.0735,-0.0115 -3.75503,-7.774 -8.18112,-17.25 z m 45.13695,-36.67414 c 31.01338,-15.91998 54.00416,-32.54096 74.94788,-54.18292 C 612.01647,609.31014 627.97497,571.521 627.9941,528.12834 628.00541,502.4832 622.87823,480.72858 611.11256,456.5 593.01662,419.23572 567.6012,390.53767 515.02334,348 c -16.14521,-13.06214 -27.58539,-26.90007 -32.04761,-38.76446 -2.87083,-7.63314 -2.41623,-15.79863 1.29637,-23.28521 7.66683,-15.4604 31.43898,-35.65468 67.10278,-57.00332 l 15.42322,-9.23247 -13.73887,-22.60727 c -42.80247,-70.43131 -51.43427,-84.5254 -52.66405,-85.99044 -0.74646,-0.88926 -1.95507,-2.44926 -2.68578,-3.46667 -1.26342,-1.75912 -1.71801,-1.64258 -9.26899,2.37613 -19.78985,10.53236 -43.48578,28.95214 -65.52108,50.93214 -13.55904,13.52502 -25.8081,27.36343 -27.03384,30.54157 -0.21212,0.55 -3.83573,6.175 -8.05246,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.02684,7.85 -3.7808,9.5 -4.23862,9.27601 -7.5237,30.44554 -7.5262,48.5 -0.003,18.16184 3.3544,38.5118 8.00054,48.5 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.23306 5.85092,8.74826 0,2.47179 31.11171,31.92108 47.5,44.96189 19.57572,15.57718 39.36027,34.64605 46.77693,45.08484 6.00848,8.4568 10.42644,17.9215 11.77785,25.23195 2.81935,15.25129 -6.8261,32.28082 -26.79692,47.31129 -8.23584,6.19848 -27.9125,17.97666 -38.06314,22.78409 -3.4071,1.61363 -6.19472,3.30099 -6.19472,3.74969 0,1.18397 44.28017,95.22083 45.12089,95.8223 0.3889,0.27822 2.29519,3.99072 4.23621,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.38296,-4.47528 20.03853,-9.94506 z m -263.5708,-6.08907 C 253.56706,689.78383 266.01878,686.09864 279.5,679.57703 317.81061,661.04406 345.65759,624.68479 358.06207,577 c 0.64383,-2.475 2.08159,-9.45 3.19502,-15.5 1.86829,-10.15165 2.05705,-16.10619 2.44762,-77.20848 l 0.4232,-66.20849 -7.03436,-10.65089 C 333.40821,371.56957 322.99005,335.48297 324.34582,294 c 0.66332,-20.29578 3.33218,-35.22858 9.74052,-54.5 4.69037,-14.10505 15.27094,-36.1104 23.80051,-49.5 5.18611,-8.1411 6.05616,-10.17945 6.08246,-14.25 0.0169,-2.6125 -0.30681,-4.7718 -0.71931,-4.79845 -0.4125,-0.0266 -26.72534,-3.07584 -58.47298,-6.776 l -57.72297,-6.72755 -0.31332,190.526 c -0.31154,189.44194 -0.32526,190.57721 -2.41234,199.526 -3.76871,16.15912 -10.95555,28.66632 -18.82839,32.7669 -5.6731,2.95484 -16.26446,3.03443 -20.17584,0.1516 -4.20037,-3.09581 -8.85863,-11.50521 -11.21921,-20.25364 -3.90462,-14.47073 -5.24756,-26.79494 -5.8205,-53.41486 l -0.55422,-25.75 -3.11511,0.0372 c -2.9411,0.0351 -83.30682,6.29705 -99.783762,7.77498 -4.217754,0.37832 -7.963823,0.98393 -8.324599,1.34579 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z M 439,690.5753 c 0,-0.55182 -49.00864,-104.91728 -49.49718,-105.40581 -0.20425,-0.20426 -0.84848,1.58655 -1.43161,3.97957 -2.60709,10.6988 -9.69163,30.2749 -14.6029,40.35094 -9.55263,19.59832 -22.16235,36.47198 -39.21761,52.4789 L 324.63879,691 381.8194,691 C 413.26873,691 439,690.80888 439,690.5753 z m 158.35377,-16.32148 c 19.05128,-9.987 38.53191,-27.07678 48.35341,-42.419 2.08605,-3.25863 5.30131,-8.26705 7.14503,-11.1298 1.84371,-2.86276 4.01058,-6.47697 4.81526,-8.03157 3.31593,-6.40619 9.49016,-26.20303 11.33166,-36.33342 1.90759,-10.49398 1.97089,-16.01155 1.98282,-172.84003 0.0118,-155.84325 -0.0616,-162.44561 -1.93347,-173.72517 C 666.18381,212.5125 659.35781,192.28694 653.26227,183 c -1.98548,-3.025 -5.66923,-8.64626 -8.18611,-12.49169 -7.74974,-11.84045 -28.07481,-30.82986 -40.6817,-38.00831 -2.89776,-1.65 -7.31813,-4.27802 -9.82305,-5.84004 -9.83909,-6.13546 -29.1845,-11.66402 -49.32075,-14.09495 l -5.24934,-0.63372 18.34933,30.28435 c 10.09213,16.6564 26.11792,43.09319 35.61287,58.74842 9.49494,15.65523 17.46906,28.99965 17.72026,29.65427 0.26605,0.69332 -3.85175,3.58004 -9.86353,6.91466 -25.82533,14.32481 -34.43208,19.44659 -50.32025,29.94499 -23.00373,15.20014 -37.42639,28.69483 -36.14112,33.81577 1.01997,4.06389 10.50214,13.41734 27.39509,27.02319 37.29639,30.03913 61.23894,55.00609 81.20843,84.68306 41.72973,62.0152 48.1575,133.30721 17.62652,195.5 -10.8326,22.06641 -22.93608,38.876 -41.94201,58.25 -6.06995,6.1875 -10.67697,11.25 -10.23783,11.25 0.43915,0 4.01426,-1.68578 7.94469,-3.74618 z M 417,564.70697 c 24.75213,-12.11115 34.78635,-18.43277 44.21301,-27.85452 7.88265,-7.87853 8.72046,-10.10238 5.89353,-15.64362 -5.65366,-11.08208 -19.67939,-25.3254 -44.6289,-45.32127 C 414.78994,469.72622 405.8,462.24771 402.5,459.26863 l -6,-5.4165 -0.61337,45.32393 c -0.56382,41.66297 -1.23079,53.66676 -3.90739,70.32394 -0.53027,3.3 -0.96753,6.32636 -0.97169,6.72525 -0.0113,1.08629 2.56667,-0.0561 25.99245,-11.51828 z M 147.62216,451.04009 c 29.08281,-2.17795 55.69034,-4.23877 59.12784,-4.57959 l 6.25,-0.61969 0,-162.3954 0,-162.39541 2.75,0.49609 C 220.62576,122.42565 389.2508,141 392.36005,141 c 2.38914,0 4.65356,-1.59118 11.07168,-7.77992 C 407.86928,128.94112 414.875,122.41222 419,118.71142 l 7.5,-6.72875 -106.5,0.27653 -106.5,0.27653 -11.83823,2.81837 c -10.86275,2.58614 -21.0345,6.17357 -32.66177,11.51935 -20.25116,9.31071 -43.0384,29.63607 -54.3775,48.50266 -1.03263,1.71814 -3.48421,5.53616 -5.44795,8.48449 -3.87443,5.81699 -7.58622,14.00227 -9.607036,21.18553 -0.70341,2.50037 -1.76959,5.46293 -2.369287,6.58348 -0.599698,1.12055 -1.879603,6.27479 -2.844235,11.45387 -1.590879,8.5414 -1.784832,19.75547 -2.086987,120.66652 -0.28459,95.04521 -0.128426,111.25 1.072106,111.25 0.772869,0 25.200239,-1.78196 54.283049,-3.95991 z"
+       id="path3308"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#29210d"
+       d="M 459.45256,733.72908 451.40512,716.5 l -85.28948,-0.25563 -85.28948,-0.25564 -8.16308,2.45727 C 228.73727,731.66864 180.01908,728.57704 143.5,710.24946 127.27413,702.1063 118.40897,695.50441 102.94478,680.04794 86.488491,663.59989 77.452322,651.14683 68.497854,632.57543 50.365571,594.96941 44.033884,556.91159 44.009063,485.38084 L 44,459.26168 l 3.75,-0.61983 c 2.0625,-0.34091 5.55,-0.62974 7.75,-0.64185 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 L 66.926986,456.75016 67.265184,344.62508 67.603382,232.5 69.896601,221 c 3.557085,-17.83802 12.024683,-41.26654 17.527098,-48.49474 1.258252,-1.65289 3.260085,-4.91439 4.448518,-7.24777 C 99.708771,149.87113 130.1302,119.65922 146,111.5025 c 1.925,-0.98941 4.89248,-2.85723 6.59439,-4.15071 1.70192,-1.29349 3.51889,-2.35179 4.03773,-2.35179 0.51883,0 4.75136,-1.6089 9.40561,-3.57534 C 179.29675,95.822669 181.5226,95.109833 198,91.188618 L 213.5,87.5 l 124.19508,-0.272632 124.19509,-0.272632 9.80491,-5.799362 c 5.39271,-3.189648 15.83058,-9.092308 23.19528,-13.117022 l 13.39035,-7.317661 1.72338,2.284734 c 0.94786,1.256603 4.58816,7.106103 8.08957,12.998888 l 6.36619,10.714156 12.52007,0.604864 c 27.58982,1.332908 58.65276,10.004962 75.52008,21.083467 2.75,1.8062 8.375,5.48142 12.5,8.16715 10.28823,6.69853 35.14679,31.58947 41.57127,41.62544 9.06105,14.15466 9.74895,15.27599 12.59551,20.53171 1.55827,2.87711 2.83322,5.88495 2.83322,6.68409 0,0.79914 1.0789,4.07014 2.39756,7.2689 3.45527,8.38165 6.43352,18.12566 7.12649,23.31591 0.33046,2.475 1.36023,7.65 2.28839,11.5 1.54873,6.42415 1.68756,20.73817 1.68756,174 l 0,167 -2.23259,12 c -7.77024,41.7644 -29.76256,76.83027 -64.76741,103.26901 -20.6893,15.62639 -52.76788,27.80981 -82.40881,31.29881 -7.36151,0.86651 -9.41655,1.5894 -16.5,5.80415 -13.89861,8.26985 -25.34213,14.06645 -43.89572,22.23493 -9.86046,4.3412 -17.98827,7.88369 -18.06179,7.87218 -0.0735,-0.0115 -3.75503,-7.774 -8.18112,-17.25 z m 45.13695,-36.67414 c 68.57323,-35.20044 109.47118,-82.3493 121.08448,-139.59122 2.79431,-13.77317 2.53883,-47.27769 -0.466,-61.11148 C 614.59079,447.47221 581.772,401.56436 525,356.17849 c -45.70729,-36.5403 -54.04816,-57.43356 -32.66922,-81.83407 12.48295,-14.24721 32.20959,-29.39767 59.15164,-45.42966 l 15.33557,-9.1255 -6.7446,-11.14463 c -29.90837,-49.41996 -58.42348,-96.0361 -59.60669,-97.44427 -0.7858,-0.9352 -2.02659,-2.53279 -2.7573,-3.5502 -1.26342,-1.75912 -1.71801,-1.64258 -9.26899,2.37613 -19.78985,10.53236 -43.48578,28.95214 -65.52108,50.93214 -13.55904,13.52502 -25.8081,27.36343 -27.03384,30.54157 -0.21212,0.55 -3.83573,6.175 -8.05246,12.5 -8.05524,12.08268 -16.4594,28.05852 -20.51611,39 -1.32548,3.575 -3.02684,7.85 -3.7808,9.5 -4.23862,9.27601 -7.5237,30.44554 -7.5262,48.5 -0.003,18.16184 3.3544,38.5118 8.00054,48.5 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.25412 5.85092,8.79506 0,2.42096 31.02687,31.7818 47.5,44.94942 44.29822,35.40932 62.21533,60.36583 58.42707,81.38236 -2.1699,12.03822 -10.38332,23.34332 -25.58162,35.21101 -8.61548,6.72746 -27.9973,18.50211 -39.15073,23.78447 -3.4071,1.61363 -6.19472,3.29151 -6.19472,3.72863 0,1.19226 44.26862,95.2575 45.10543,95.84336 0.3974,0.27822 2.31065,3.99072 4.25167,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.38296,-4.47528 20.03853,-9.94506 z m -263.5708,-6.08907 c 12.54835,-1.18204 25.00007,-4.86723 38.48129,-11.38884 13.01867,-6.29785 22.9053,-13.1181 33.22312,-22.91882 25.54496,-24.26472 41.09951,-54.76178 48.53397,-95.15821 1.86829,-10.15165 2.05705,-16.10619 2.44762,-77.20848 l 0.4232,-66.20849 -7.03436,-10.65089 C 333.40821,371.56957 322.99005,335.48297 324.34582,294 c 0.66332,-20.29578 3.33218,-35.22858 9.74052,-54.5 4.69037,-14.10505 15.27094,-36.1104 23.80051,-49.5 5.18611,-8.1411 6.05616,-10.17945 6.08246,-14.25 0.0169,-2.6125 -0.0818,-4.7637 -0.21931,-4.78044 -0.1375,-0.0167 -26.45034,-3.07111 -58.47297,-6.7875 l -58.22297,-6.75706 -0.31333,190.5375 c -0.31154,189.45361 -0.32526,190.5887 -2.41234,199.5375 -2.54029,10.89202 -6.1052,19.16689 -11.09588,25.75573 -4.96341,6.55284 -9.86259,8.98593 -18.38501,9.13058 -8.0708,0.137 -10.80196,-1.49454 -15.49899,-9.25872 -6.99094,-11.55602 -10.31312,-31.48705 -11.06406,-66.37759 l -0.55422,-25.75 -3.61511,0.0417 c -3.21628,0.0371 -79.65704,6.02243 -99.283762,7.77394 -4.217754,0.3764 -7.963823,0.98043 -8.324599,1.34229 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z M 439,690.56792 c 0,-0.47381 -47.5996,-102.03003 -48.96641,-104.47238 -0.61837,-1.10496 -1.13692,-0.31463 -1.93378,2.94731 -2.57202,10.52853 -9.65465,30.22556 -14.29698,39.76038 -9.73228,19.989 -22.54236,37.21144 -39.55213,53.17567 L 324.63879,691 381.8194,691 C 413.26873,691 439,690.80556 439,690.56792 z m 170.40051,-23.34045 c 14.10655,-9.48435 28.91693,-23.88114 36.11804,-35.1094 2.1898,-3.41442 5.48994,-8.5503 7.33366,-11.41305 1.84371,-2.86276 4.01058,-6.47697 4.81526,-8.03157 3.31593,-6.40619 9.49016,-26.20303 11.33166,-36.33342 1.90759,-10.49398 1.97089,-16.01155 1.98282,-172.84003 0.0118,-155.64544 -0.0637,-162.45829 -1.92655,-173.68345 -2.91343,-17.55601 -9.60242,-37.38462 -15.79313,-46.81655 -1.98548,-3.025 -5.66923,-8.65 -8.18611,-12.5 -7.7706,-11.88644 -27.99074,-30.77368 -40.6817,-38 -2.89776,-1.65 -7.31813,-4.27802 -9.82305,-5.84004 C 588.08225,122.61345 568.98588,116.104 559,114.5346 c -16.33905,-2.56786 -19.23427,-2.76532 -18.3245,-1.24974 0.45348,0.75543 16.74695,27.58042 36.20772,59.6111 19.71819,32.45436 34.9922,58.59959 34.5,59.05525 -0.48577,0.44971 -9.20822,5.43428 -19.38322,11.07683 -31.71742,17.58888 -54.14198,32.42452 -66.18983,43.78984 -8.72219,8.22808 -11.16885,11.6169 -10.45129,14.47587 1.0208,4.06721 10.50751,13.42174 27.39509,27.01341 59.00695,47.49071 93.05995,91.76385 109.07664,141.81323 11.70626,36.58005 11.54008,78.429 -0.45606,114.84917 -9.55664,29.01385 -26.60692,55.96286 -51.83224,81.92404 L 587.5,679.28721 596,674.90473 c 4.675,-2.41035 10.70523,-5.86512 13.40051,-7.67726 z M 417.04246,564.70007 c 24.7065,-12.09819 34.74511,-18.4271 44.17055,-27.84762 7.88265,-7.87853 8.72046,-10.10238 5.89353,-15.64362 C 461.5265,510.27105 448.3417,496.75139 424.5,477.5202 c -7.7,-6.21097 -17.15,-14.04045 -21,-17.39884 l -7,-6.10615 -0.62438,45.24239 c -0.57235,41.47178 -1.43545,56.7809 -3.95372,70.12889 -1.37296,7.2773 -1.2859,7.7024 1.37056,6.69241 1.26086,-0.47937 11.94836,-5.59985 23.75,-11.37883 z M 148.28709,451.01412 c 29.2671,-2.19223 55.80041,-4.26142 58.96291,-4.59819 l 5.75,-0.6123 0,-162.42087 0,-162.42086 2.25,0.51299 C 218.41906,122.19743 389.00159,141 392.38763,141 c 2.16275,0 5.47965,-2.52215 14.94599,-11.36485 6.69151,-6.25066 13.74138,-12.77247 15.66638,-14.4929 l 3.5,-3.12806 -107,0.29231 c -76.56819,0.20916 -108.13764,0.61794 -111,1.43726 -2.2,0.62973 -7.375,1.89805 -11.5,2.81847 -6.67794,1.49008 -29.91775,10.3785 -32.5,12.43013 -0.55,0.43698 -2.8,1.79681 -5,3.02185 -7.64979,4.25966 -22.08143,15.82543 -29.70981,23.80997 -7.16125,7.4956 -10.53693,11.84701 -15.16769,19.55193 -1.03263,1.71814 -3.48421,5.53616 -5.44795,8.48449 -3.87443,5.81699 -7.58622,14.00227 -9.607036,21.18553 -0.70341,2.50037 -1.76959,5.46293 -2.369287,6.58348 -0.599698,1.12055 -1.879603,6.27479 -2.844235,11.45387 -1.590879,8.5414 -1.784832,19.75547 -2.086987,120.66652 -0.30114,100.57243 -0.182412,111.25 1.23703,111.25 0.863577,0 25.515955,-1.79365 54.783055,-3.98588 z"
+       id="path3306"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#1d1d1d"
+       d="M 459.45256,733.72908 451.40512,716.5 l -85.28948,-0.25563 -85.28948,-0.25564 -8.16308,2.45727 C 228.73727,731.66864 180.01908,728.57704 143.5,710.24946 127.27413,702.1063 118.40897,695.50441 102.94478,680.04794 86.488491,663.59989 77.452322,651.14683 68.497854,632.57543 50.365571,594.96941 44.033884,556.91159 44.009063,485.38084 L 44,459.26168 l 3.75,-0.61983 c 2.0625,-0.34091 5.55,-0.62974 7.75,-0.64185 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 L 66.926986,456.75016 67.265184,344.62508 67.603382,232.5 69.896601,221 c 3.557085,-17.83802 12.024683,-41.26654 17.527098,-48.49474 1.258252,-1.65289 3.260085,-4.91439 4.448518,-7.24777 C 99.708771,149.87113 130.1302,119.65922 146,111.5025 c 1.925,-0.98941 4.89248,-2.85723 6.59439,-4.15071 1.70192,-1.29349 3.51889,-2.35179 4.03773,-2.35179 0.51883,0 4.75136,-1.6089 9.40561,-3.57534 C 179.29675,95.822669 181.5226,95.109833 198,91.188618 L 213.5,87.5 l 124.19508,-0.272632 124.19509,-0.272632 9.80491,-5.799362 c 5.39271,-3.189648 15.83058,-9.092308 23.19528,-13.117022 l 13.39035,-7.317661 1.72338,2.284734 c 0.94786,1.256603 4.58816,7.106103 8.08957,12.998888 l 6.36619,10.714156 12.52007,0.604864 c 27.58982,1.332908 58.65276,10.004962 75.52008,21.083467 2.75,1.8062 8.375,5.48142 12.5,8.16715 10.28823,6.69853 35.14679,31.58947 41.57127,41.62544 9.06105,14.15466 9.74895,15.27599 12.59551,20.53171 1.55827,2.87711 2.83322,5.88495 2.83322,6.68409 0,0.79914 1.0789,4.07014 2.39756,7.2689 3.45527,8.38165 6.43352,18.12566 7.12649,23.31591 0.33046,2.475 1.36023,7.65 2.28839,11.5 1.54873,6.42415 1.68756,20.73817 1.68756,174 l 0,167 -2.23259,12 c -7.77024,41.7644 -29.76256,76.83027 -64.76741,103.26901 -20.6893,15.62639 -52.76788,27.80981 -82.40881,31.29881 -7.36151,0.86651 -9.41655,1.5894 -16.5,5.80415 -13.89861,8.26985 -25.34213,14.06645 -43.89572,22.23493 -9.86046,4.3412 -17.98827,7.88369 -18.06179,7.87218 -0.0735,-0.0115 -3.75503,-7.774 -8.18112,-17.25 z m 44.9908,-36.59912 C 557.49258,669.8984 594.68681,634.90448 613.52637,594.5 c 9.71323,-20.83159 13.41885,-37.05161 14.1645,-62 0.46134,-15.43613 0.23612,-19.76669 -1.58121,-30.40334 C 617.44925,451.40813 584.6437,404.06208 525,356.17188 c -39.30819,-31.56205 -50.59844,-51.26154 -40.45963,-70.59491 8.24702,-15.72599 32.13754,-35.95163 66.89936,-56.63681 l 15.40166,-9.16483 -15.25919,-25.13766 c -39.93895,-65.79457 -49.7541,-81.81793 -51.09527,-83.41368 -0.79693,-0.94819 -2.04682,-2.55642 -2.77753,-3.57383 -1.26352,-1.75925 -1.71744,-1.64333 -9.26899,2.36702 -18.38522,9.76373 -42.22992,28.01875 -63.31868,48.47551 -11.53672,11.19097 -27.4871,29.08063 -28.98346,32.50731 -0.36026,0.825 -4.10134,6.675 -8.31352,13 -8.05259,12.09176 -16.45719,28.0749 -20.50783,39 -1.32548,3.575 -3.02684,7.85 -3.7808,9.5 -4.23862,9.27601 -7.5237,30.44554 -7.5262,48.5 -0.003,18.16184 3.3544,38.5118 8.00054,48.5 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.25412 5.85092,8.79506 0,2.34549 30.99059,31.75759 47,44.60608 30.5572,24.52393 45.77534,40.53147 53.9869,56.78731 7.06577,13.98762 7.2631,24.50049 0.69451,37 -6.94898,13.22335 -28.44466,30.44011 -54.93545,44 -6.44692,3.3 -11.72714,6.32519 -11.73382,6.72265 -0.0193,1.14626 44.25191,95.22081 45.07526,95.78321 0.40732,0.27822 2.32868,3.99072 4.2697,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.3172,-4.44152 19.89238,-9.87004 z m -263.42465,-6.16409 c 12.54835,-1.18204 25.00007,-4.86723 38.48129,-11.38884 46.77154,-22.62599 76.80165,-70.04862 83.45373,-131.78762 C 363.56276,542.13694 364,512.96487 364,477.9841 l 0,-60.09473 -6.9704,-10.55406 C 333.41251,371.57607 322.99147,335.43973 324.34582,294 c 0.66332,-20.29578 3.33218,-35.22858 9.74052,-54.5 4.69037,-14.10505 15.27094,-36.1104 23.80051,-49.5 5.18611,-8.1411 6.05616,-10.17945 6.08246,-14.25 0.0169,-2.6125 -0.0818,-4.7637 -0.21931,-4.78044 -0.1375,-0.0167 -26.44929,-3.07099 -58.47063,-6.78723 l -58.22064,-6.75679 -0.31817,190.53723 c -0.31622,189.36748 -0.33105,190.59248 -2.41468,199.53723 -2.53653,10.88894 -6.10101,19.16467 -11.09337,25.75573 -4.96341,6.55284 -9.86259,8.98593 -18.38501,9.13058 -8.0708,0.137 -10.80196,-1.49454 -15.49899,-9.25872 -6.99094,-11.55602 -10.31312,-31.48705 -11.06406,-66.37759 l -0.55422,-25.75 -3.61511,0.0417 c -3.21628,0.0371 -79.65704,6.02243 -99.283762,7.77394 -4.217754,0.3764 -7.963823,0.98043 -8.324599,1.34229 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z m 197.70411,-1.2458 c -1.56325,-4.07378 -49.10885,-104.66738 -49.35481,-104.42142 -0.16386,0.16387 -1.8482,5.67621 -3.74296,12.24965 -9.26759,32.1517 -23.60164,56.45341 -47.30596,80.2017 l -13.22547,13.25 57.06018,0 c 45.94903,0 56.96454,-0.24924 56.56902,-1.27993 z m 170.17769,-22.14564 c 14.68169,-9.90038 29.3155,-24.06993 36.61804,-35.45636 2.1898,-3.41442 5.48994,-8.5503 7.33366,-11.41305 1.84371,-2.86276 4.01058,-6.47697 4.81526,-8.03157 3.31593,-6.40619 9.49016,-26.20303 11.33166,-36.33342 1.90759,-10.49398 1.97089,-16.01155 1.98282,-172.84003 0.0118,-155.64544 -0.0637,-162.45829 -1.92655,-173.68345 -2.91704,-17.57777 -9.58202,-37.43014 -15.65856,-46.64074 -2.05949,-3.1217 -5.8038,-8.82581 -8.32068,-12.67581 -7.74592,-11.84868 -29.11221,-31.81639 -40.57616,-37.92015 -2.75,-1.46419 -7.0519,-4.00548 -9.55977,-5.64732 -9.44936,-6.18623 -29.20708,-11.8897 -49.8409,-14.38759 l -5.40068,-0.6538 1.50799,2.30443 c 3.22599,4.92979 70.07303,115.37091 70.49306,116.46488 0.24505,0.63824 -2.62463,2.84677 -6.37708,4.90784 -32.40383,17.79818 -58.06631,33.59906 -70.82262,43.60684 -7.83741,6.14872 -18.51503,17.03658 -19.13669,19.51348 -1.10241,4.39234 6.49305,13.05738 22.63669,25.82432 51.50013,40.72808 82.21004,75.99337 102.56119,117.77468 26.96804,55.36595 26.70868,116.52851 -0.7206,169.92767 -10.19446,19.84653 -22.01003,35.8705 -40.29828,54.65149 L 587.5,679.23354 l 8,-4.00868 c 4.4,-2.20477 10.43023,-5.64747 13.40051,-7.65043 z M 417.04246,564.70007 C 428.84411,558.92108 442.1,551.81826 446.5,548.91601 c 9.04638,-5.967 21.13868,-17.62822 22.05157,-21.26544 0.8045,-3.20542 -2.02167,-8.59452 -9.32898,-17.78902 C 452.18943,501.012 443.18478,492.6204 424.5,477.5029 c -7.7,-6.22993 -17.15,-14.06326 -21,-17.40742 l -7,-6.08029 -0.63234,45.24241 c -0.58022,41.51375 -1.44421,56.86951 -3.94576,70.12889 -1.37296,7.2773 -1.2859,7.7024 1.37056,6.69241 1.26086,-0.47937 11.94836,-5.59985 23.75,-11.37883 z M 149,451.00398 c 29.425,-2.19919 55.8625,-4.25714 58.75,-4.57321 l 5.25,-0.57468 0,-162.22885 0,-162.22884 87.75,9.76911 c 48.2625,5.37302 89.24804,9.78337 91.07898,9.8008 2.8691,0.0273 4.9413,-1.46846 15,-10.82742 C 413.24804,124.16837 420.3,117.64547 422.5,115.64555 l 4,-3.63623 -107,0.31016 c -114.85623,0.33293 -107.68651,0.0367 -126.81696,5.23955 -5.63499,1.53253 -26.15739,9.86891 -28.18304,11.4482 -0.55,0.4288 -2.8,1.78194 -5,3.00698 -7.64979,4.25966 -22.08143,15.82543 -29.70981,23.80997 -7.16125,7.4956 -10.53693,11.84701 -15.16769,19.55193 -1.03263,1.71814 -3.48421,5.53616 -5.44795,8.48449 -3.87443,5.81699 -7.58622,14.00227 -9.607036,21.18553 -0.70341,2.50037 -1.76959,5.46293 -2.369287,6.58348 -0.599698,1.12055 -1.879603,6.27479 -2.844235,11.45387 -1.590879,8.5414 -1.784832,19.75547 -2.086987,120.66652 -0.317977,106.19552 -0.252101,111.25006 1.449942,111.25125 0.980679,6.9e-4 25.858053,-1.79809 55.283053,-3.99727 z"
+       id="path3304"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#27200c"
+       d="M 459.47202,733.72608 451.44404,716.5 l -85.75044,-0.25559 -85.75045,-0.25559 -7.72157,2.46742 c -27.24948,8.70754 -62.26042,10.44567 -91.28088,4.53167 -31.17807,-6.35368 -54.14909,-19.07057 -78.46102,-43.43647 C 81.747344,658.77309 69.07717,638.55795 59.513937,611 48.060778,577.99594 44.045658,545.32676 44.013591,484.88084 L 44,459.26168 l 3.75,-0.61983 c 2.0625,-0.34091 5.55,-0.62974 7.75,-0.64185 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 l 3.713493,-0.61392 0.35009,-112.12508 L 67.627166,232.5 70.189473,220 c 6.717361,-32.77008 19.830308,-57.69449 42.801277,-81.35445 11.05141,-11.38289 25.63743,-23.38522 33.00925,-27.16218 1.925,-0.98628 4.625,-2.60125 6,-3.58884 5.49526,-3.94692 30.5398,-13.063588 45.83895,-16.686212 L 213.5,87.5 337.77535,87.223703 462.0507,86.947406 l 6.22465,-3.803712 c 3.42356,-2.092042 13.83072,-7.998537 23.12704,-13.125546 16.11532,-8.88776 16.96722,-9.233274 18.29482,-7.419991 0.76584,1.046014 4.40976,6.899112 8.09761,13.006885 L 524.5,86.710084 537,87.340074 c 16.77111,0.845252 33.07893,3.805008 47,8.530176 18.45676,6.2647 21.32703,7.72017 41.46627,21.02689 9.8898,6.53454 34.97904,31.73591 41.105,41.28869 10.97149,17.10888 15.32858,24.89018 15.39746,27.49826 0.0172,0.65124 1.11017,3.80124 2.42883,7 3.43452,8.33132 6.42785,18.10246 7.14269,23.31591 0.33937,2.475 1.36914,7.875 2.28839,12 1.52509,6.84364 1.67136,22.0711 1.67136,174 l 0,166.5 -2.25937,12.16602 c -4.53345,24.41122 -13.85277,46.3002 -28.45482,66.83398 -6.47535,9.1058 -25.15706,27.86196 -35.53045,35.67205 -21.59809,16.26112 -53.12397,28.35906 -83.0969,31.88812 -7.44575,0.87668 -9.33523,1.56697 -17.59476,6.42796 -12.10523,7.12431 -29.70083,15.91002 -46.95505,23.44526 -7.64024,3.33663 -13.94024,6.05584 -14,6.04269 -0.0598,-0.0132 -3.72124,-7.77566 -8.13663,-17.25 z m 44.97134,-36.59612 C 557.49258,669.8984 594.68681,634.90448 613.52637,594.5 c 9.71323,-20.83159 13.41885,-37.05161 14.1645,-62 0.46134,-15.43613 0.23612,-19.76669 -1.58121,-30.40334 C 617.44925,451.40813 584.6437,404.06208 525,356.17188 c -39.30819,-31.56205 -50.59844,-51.26154 -40.45963,-70.59491 8.24702,-15.72599 32.13754,-35.95163 66.89936,-56.63681 l 15.40166,-9.16483 -15.25919,-25.13766 c -39.93895,-65.79457 -49.7541,-81.81793 -51.09527,-83.41368 -0.79693,-0.94819 -2.04682,-2.55642 -2.77753,-3.57383 -1.26352,-1.75925 -1.71744,-1.64333 -9.26899,2.36702 -18.38522,9.76373 -42.22992,28.01875 -63.31868,48.47551 -11.53672,11.19097 -27.4871,29.08063 -28.98346,32.50731 -0.36026,0.825 -4.10145,6.675 -8.31375,13 -8.14125,12.22454 -17.05242,29.29075 -20.88611,40 -1.27978,3.575 -2.6182,6.725 -2.97427,7 -1.15908,0.89517 -4.91501,16.34792 -6.45181,26.54424 -3.51982,23.35321 -0.4867,56.93989 6.49813,71.95576 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.25412 5.85092,8.79506 0,2.34549 30.99059,31.75759 47,44.60608 30.5572,24.52393 45.77534,40.53147 53.9869,56.78731 7.06577,13.98762 7.2631,24.50049 0.69451,37 -6.94898,13.22335 -28.44466,30.44011 -54.93545,44 -6.44692,3.3 -11.72714,6.32519 -11.73382,6.72265 -0.0193,1.14626 44.25191,95.22081 45.07526,95.78321 0.40732,0.27822 2.32868,3.99072 4.2697,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.3172,-4.44152 19.89238,-9.87004 z m -263.42465,-6.16409 c 12.54835,-1.18204 25.00007,-4.86723 38.48129,-11.38884 46.77154,-22.62599 76.80165,-70.04862 83.45373,-131.78762 C 363.56276,542.13694 364,512.96487 364,477.9841 l 0,-60.09473 -7.09658,-10.69469 c -8.0465,-12.12624 -18.30573,-32.55386 -22.73732,-45.27331 -16.24893,-46.63735 -12.91159,-98.65246 9.34354,-145.62656 5.30148,-11.18988 17.72894,-32.70619 19.53538,-33.82264 0.79818,-0.4933 1.46724,-11.40981 0.70498,-11.50261 -0.1375,-0.0167 -26.44929,-3.07099 -58.47063,-6.78723 l -58.22064,-6.75679 -0.31817,190.53723 c -0.31622,189.36748 -0.33105,190.59248 -2.41468,199.53723 -2.53653,10.88894 -6.10101,19.16467 -11.09337,25.75573 -4.96341,6.55284 -9.86259,8.98593 -18.38501,9.13058 -8.0708,0.137 -10.80196,-1.49454 -15.49899,-9.25872 -6.99094,-11.55602 -10.31312,-31.48705 -11.06406,-66.37759 l -0.55422,-25.75 -3.61511,0.0417 c -3.21628,0.0371 -79.65704,6.02243 -99.283762,7.77394 -4.217754,0.3764 -7.963823,0.98043 -8.324599,1.34229 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z m 197.70411,-1.2458 c -1.56325,-4.07378 -49.10885,-104.66738 -49.35481,-104.42142 -0.16386,0.16387 -1.8482,5.67621 -3.74296,12.24965 -9.26759,32.1517 -23.60164,56.45341 -47.30596,80.2017 l -13.22547,13.25 57.06018,0 c 45.94903,0 56.96454,-0.24924 56.56902,-1.27993 z m 170.17769,-22.14564 c 14.68169,-9.90038 29.3155,-24.06993 36.61804,-35.45636 2.1898,-3.41442 5.48994,-8.5503 7.33366,-11.41305 1.84371,-2.86276 4.01058,-6.47697 4.81526,-8.03157 3.31593,-6.40619 9.49016,-26.20303 11.33166,-36.33342 1.90759,-10.49398 1.97089,-16.01155 1.98282,-172.84003 0.0118,-155.64544 -0.0637,-162.45829 -1.92655,-173.68345 -2.91704,-17.57777 -9.58202,-37.43014 -15.65856,-46.64074 -2.05949,-3.1217 -5.8038,-8.82581 -8.32068,-12.67581 -7.74592,-11.84868 -29.11221,-31.81639 -40.57616,-37.92015 -2.75,-1.46419 -7.0519,-4.00548 -9.55977,-5.64732 -9.44936,-6.18623 -29.20708,-11.8897 -49.8409,-14.38759 l -5.40068,-0.6538 1.50799,2.30443 c 3.22599,4.92979 70.07303,115.37091 70.49306,116.46488 0.24505,0.63824 -2.62463,2.84677 -6.37708,4.90784 -32.40383,17.79818 -58.06631,33.59906 -70.82262,43.60684 -7.83741,6.14872 -18.51503,17.03658 -19.13669,19.51348 -1.10241,4.39234 6.49305,13.05738 22.63669,25.82432 51.50013,40.72808 82.21004,75.99337 102.56119,117.77468 26.96804,55.36595 26.70868,116.52851 -0.7206,169.92767 -10.19446,19.84653 -22.01003,35.8705 -40.29828,54.65149 L 587.5,679.23354 l 8,-4.00868 c 4.4,-2.20477 10.43023,-5.64747 13.40051,-7.65043 z M 417.04246,564.70007 C 428.84411,558.92108 442.1,551.81826 446.5,548.91601 c 9.04638,-5.967 21.13868,-17.62822 22.05157,-21.26544 0.8045,-3.20542 -2.02167,-8.59452 -9.32898,-17.78902 C 452.18943,501.012 443.18478,492.6204 424.5,477.5029 c -7.7,-6.22993 -17.15,-14.06326 -21,-17.40742 l -7,-6.08029 -0.63234,45.24241 c -0.58022,41.51375 -1.44421,56.86951 -3.94576,70.12889 -1.37296,7.2773 -1.2859,7.7024 1.37056,6.69241 1.26086,-0.47937 11.94836,-5.59985 23.75,-11.37883 z M 149,451.00398 c 29.425,-2.19919 55.8625,-4.25714 58.75,-4.57321 l 5.25,-0.57468 0,-162.22885 0,-162.22884 87.75,9.76911 c 48.2625,5.37302 89.24804,9.78337 91.07898,9.8008 2.8691,0.0273 4.9413,-1.46846 15,-10.82742 C 413.24804,124.16837 420.3,117.64547 422.5,115.64555 l 4,-3.63623 -107,0.31016 c -114.85623,0.33293 -107.68651,0.0367 -126.81696,5.23955 -5.63499,1.53253 -26.15739,9.86891 -28.18304,11.4482 -0.55,0.4288 -2.8,1.78194 -5,3.00698 -13.66952,7.61165 -34.07097,26.47292 -42,38.82926 -2.2,3.42841 -5.8,9.0272 -8,12.44175 -4.32658,6.71516 -7.90583,14.55688 -9.932486,21.76091 -0.70341,2.50037 -1.783286,5.48853 -2.399724,6.64035 -0.616438,1.15183 -2.002033,7.65607 -3.0791,14.45387 -1.852505,11.69191 -1.962295,18.20793 -2.032169,120.60965 -0.07005,102.65946 0.01696,108.25006 1.684807,108.25125 0.96727,6.9e-4 25.833672,-1.79809 55.258672,-3.99727 z"
+       id="path3302"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#251e0c"
+       d="M 459.47202,733.72608 451.44404,716.5 l -85.75044,-0.25559 -85.75045,-0.25559 -7.72157,2.46742 c -27.24948,8.70754 -62.26042,10.44567 -91.28088,4.53167 -31.17807,-6.35368 -54.14909,-19.07057 -78.46102,-43.43647 C 81.747344,658.77309 69.07717,638.55795 59.513937,611 48.060778,577.99594 44.045658,545.32676 44.013591,484.88084 L 44,459.26168 l 3.75,-0.61983 c 2.0625,-0.34091 5.55,-0.62974 7.75,-0.64185 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 l 3.713493,-0.61392 0.35009,-112.12508 L 67.627166,232.5 70.189473,220 c 6.717361,-32.77008 19.830308,-57.69449 42.801277,-81.35445 11.05141,-11.38289 25.63743,-23.38522 33.00925,-27.16218 1.925,-0.98628 4.625,-2.60125 6,-3.58884 5.49526,-3.94692 30.5398,-13.063588 45.83895,-16.686212 L 213.5,87.5 337.77535,87.223703 462.0507,86.947406 l 6.22465,-3.803712 c 3.42356,-2.092042 13.83072,-7.998537 23.12704,-13.125546 16.11532,-8.88776 16.96722,-9.233274 18.29482,-7.419991 0.76584,1.046014 4.40976,6.899112 8.09761,13.006885 L 524.5,86.710084 537,87.340074 c 16.77111,0.845252 33.07893,3.805008 47,8.530176 18.45676,6.2647 21.32703,7.72017 41.46627,21.02689 9.8898,6.53454 34.97904,31.73591 41.105,41.28869 10.97149,17.10888 15.32858,24.89018 15.39746,27.49826 0.0172,0.65124 1.11017,3.80124 2.42883,7 3.43452,8.33132 6.42785,18.10246 7.14269,23.31591 0.33937,2.475 1.36914,7.875 2.28839,12 1.52509,6.84364 1.67136,22.0711 1.67136,174 l 0,166.5 -2.25937,12.16602 c -4.53345,24.41122 -13.85277,46.3002 -28.45482,66.83398 -6.47535,9.1058 -25.15706,27.86196 -35.53045,35.67205 -21.59809,16.26112 -53.12397,28.35906 -83.0969,31.88812 -7.44575,0.87668 -9.33523,1.56697 -17.59476,6.42796 -12.10523,7.12431 -29.70083,15.91002 -46.95505,23.44526 -7.64024,3.33663 -13.94024,6.05584 -14,6.04269 -0.0598,-0.0132 -3.72124,-7.77566 -8.13663,-17.25 z m 44.97134,-36.59612 c 67.72475,-34.76489 108.59055,-81.26486 120.70407,-137.34552 1.3918,-6.44346 2.17008,-14.79233 2.54344,-27.28444 0.46134,-15.43613 0.23612,-19.76669 -1.58121,-30.40334 C 617.44925,451.40813 584.6437,404.06208 525,356.17188 c -39.38,-31.61971 -50.4101,-50.89137 -40.46461,-70.69929 7.82458,-15.58381 36.98146,-39.51742 74.16701,-60.88046 l 8.2024,-4.71226 -15.2909,-25.18993 c -39.96918,-65.84448 -49.78549,-81.86984 -51.12697,-83.46595 -0.79693,-0.94819 -2.04682,-2.55642 -2.77753,-3.57383 -1.26358,-1.75934 -1.71339,-1.64478 -9.19413,2.3417 -19.30022,10.28507 -41.53007,27.29257 -63.39354,48.50083 -11.53672,11.19097 -27.4871,29.08063 -28.98346,32.50731 -0.36026,0.825 -4.10145,6.675 -8.31375,13 -8.14125,12.22454 -17.05242,29.29075 -20.88611,40 -1.27978,3.575 -2.6182,6.725 -2.97427,7 -1.15908,0.89517 -4.91501,16.34792 -6.45181,26.54424 -3.51982,23.35321 -0.4867,56.93989 6.49813,71.95576 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.25412 5.85092,8.79506 0,2.34549 30.99059,31.75759 47,44.60608 30.5572,24.52393 45.77534,40.53147 53.9869,56.78731 7.06577,13.98762 7.2631,24.50049 0.69451,37 -6.94898,13.22335 -28.44466,30.44011 -54.93545,44 -6.44692,3.3 -11.72714,6.32519 -11.73382,6.72265 -0.0193,1.14626 44.25191,95.22081 45.07526,95.78321 0.40732,0.27822 2.32868,3.99072 4.2697,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.3172,-4.44152 19.89238,-9.87004 z M 241.01871,690.96587 C 253.56706,689.78383 266.01878,686.09864 279.5,679.57703 316.86119,661.50335 344.74591,626.00688 356.9385,581 363.33749,557.37923 364,547.78447 364,478.73269 l 0,-60.84332 -7.09658,-10.69469 c -8.0465,-12.12624 -18.30573,-32.55386 -22.73732,-45.27331 -16.24893,-46.63735 -12.91159,-98.65246 9.34354,-145.62656 5.30148,-11.18988 17.72894,-32.70619 19.53538,-33.82264 0.79818,-0.4933 1.46724,-11.40981 0.70498,-11.50261 -0.1375,-0.0167 -26.44929,-3.07099 -58.47063,-6.78723 l -58.22064,-6.75679 -0.31817,190.53723 c -0.31696,189.81089 -0.32623,190.57211 -2.43104,199.68824 -3.68536,15.96161 -11.59061,29.36825 -19.3912,32.88582 -5.87009,2.64704 -15.92573,2.58632 -19.59469,-0.11833 -4.20006,-3.09616 -8.85827,-11.50587 -11.21868,-20.25364 -3.90462,-14.47073 -5.24756,-26.79494 -5.8205,-53.41486 l -0.55422,-25.75 -3.61511,0.0417 c -3.21628,0.0371 -79.65704,6.02243 -99.283762,7.77394 -4.217754,0.3764 -7.963823,0.98043 -8.324599,1.34229 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z m 197.70411,-1.2458 c -1.56325,-4.07378 -49.10885,-104.66738 -49.35481,-104.42142 -0.16386,0.16387 -1.85227,5.67621 -3.75201,12.24965 -9.41935,32.59253 -24.1745,57.42794 -48.24336,81.2017 l -12.40206,12.25 57.1217,0 c 45.99901,0 57.02606,-0.24923 56.63054,-1.27993 z m 170.17769,-22.14564 c 14.68169,-9.90038 29.3155,-24.06993 36.61804,-35.45636 2.1898,-3.41442 5.49082,-8.5503 7.3356,-11.41305 1.84478,-2.86276 4.15182,-6.78002 5.12674,-8.70502 3.53866,-6.98711 9.03789,-24.74976 10.99063,-35.5 1.94363,-10.70011 1.99844,-15.41655 2.01043,-173 0.0118,-155.64544 -0.0637,-162.45829 -1.92655,-173.68345 -2.91704,-17.57777 -9.58202,-37.43014 -15.65856,-46.64074 -2.05949,-3.1217 -5.8038,-8.82581 -8.32068,-12.67581 -7.7319,-11.82724 -29.05501,-31.76359 -40.57616,-37.93729 -2.75,-1.4736 -7.31815,-4.14622 -10.15145,-5.93915 -6.51733,-4.1242 -27.52111,-11.14425 -37.34855,-12.48293 -4.125,-0.5619 -9.71493,-1.31259 -12.42206,-1.66821 l -4.92207,-0.64657 1.51618,2.33707 c 12.3714,19.06967 70.85628,117.19141 70.20856,117.79091 -0.48434,0.44827 -9.20561,5.42882 -19.38061,11.0679 -34.31136,19.01566 -57.2031,34.45466 -69.77818,47.06089 -3.453,3.46156 -6.53579,7.32015 -6.85065,8.57466 -1.111,4.42658 6.43611,13.04989 22.62883,25.85565 51.50013,40.72808 82.21004,75.99337 102.56119,117.77468 26.96804,55.36595 26.70868,116.52851 -0.7206,169.92767 -10.19446,19.84653 -22.01003,35.8705 -40.29828,54.65149 L 587.5,679.23354 l 8,-4.00868 c 4.4,-2.20477 10.43023,-5.64747 13.40051,-7.65043 z M 417.04246,564.70007 C 428.84411,558.92108 442.1,551.81826 446.5,548.91601 c 9.04638,-5.967 21.13868,-17.62822 22.05157,-21.26544 0.8045,-3.20542 -2.02167,-8.59452 -9.32898,-17.78902 -7.14032,-8.98438 -15.56794,-16.79053 -37.72259,-34.94083 -9.35,-7.66003 -18.9125,-15.55911 -21.25,-17.55351 l -4.25,-3.62618 -0.009,34.87949 c -0.01,37.57646 -1.13788,62.41265 -3.50291,77.10997 -0.81848,5.08639 -1.48815,9.69169 -1.48815,10.23399 0,1.39013 1.71226,0.64951 26.04246,-11.26441 z M 149,451.00398 c 29.425,-2.19919 55.8625,-4.25714 58.75,-4.57321 l 5.25,-0.57468 0,-162.22885 0,-162.22884 87.75,9.76911 c 48.2625,5.37302 89.24804,9.78337 91.07898,9.8008 2.8691,0.0273 4.9413,-1.46846 15,-10.82742 C 413.24804,124.16837 420.3,117.64547 422.5,115.64555 l 4,-3.63623 -107,0.31016 c -114.95624,0.33322 -107.5049,0.0238 -127,5.2731 -5.6406,1.51879 -25.81416,9.75233 -28,11.42779 -0.55,0.42157 -2.8,1.7688 -5,2.99384 -13.66952,7.61165 -34.07097,26.47292 -42,38.82926 -2.2,3.42841 -5.8,9.0272 -8,12.44175 -4.32658,6.71516 -7.90583,14.55688 -9.932486,21.76091 -0.70341,2.50037 -1.783286,5.48853 -2.399724,6.64035 -0.616438,1.15183 -2.002033,7.65607 -3.0791,14.45387 -1.852505,11.69191 -1.962295,18.20793 -2.032169,120.60965 -0.07005,102.65946 0.01696,108.25006 1.684807,108.25125 0.96727,6.9e-4 25.833672,-1.79809 55.258672,-3.99727 z"
+       id="path3300"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#191919"
+       d="M 459.47202,733.72608 451.44404,716.5 l -85.75044,-0.25559 -85.75045,-0.25559 -7.72157,2.46742 c -27.24948,8.70754 -62.26042,10.44567 -91.28088,4.53167 -31.17807,-6.35368 -54.14909,-19.07057 -78.46102,-43.43647 C 81.747344,658.77309 69.07717,638.55795 59.513937,611 48.060778,577.99594 44.045658,545.32676 44.013591,484.88084 L 44,459.26168 l 3.75,-0.61983 c 2.0625,-0.34091 5.55,-0.62974 7.75,-0.64185 2.2,-0.0121 5.671072,-0.29827 7.713493,-0.63592 l 3.713493,-0.61392 0.35009,-112.12508 L 67.627166,232.5 70.189473,220 c 6.717361,-32.77008 19.830308,-57.69449 42.801277,-81.35445 11.05141,-11.38289 25.63743,-23.38522 33.00925,-27.16218 1.925,-0.98628 4.625,-2.60125 6,-3.58884 5.49526,-3.94692 30.5398,-13.063588 45.83895,-16.686212 L 213.5,87.5 337.77535,87.223703 462.0507,86.947406 l 6.22465,-3.803712 c 3.42356,-2.092042 13.83072,-7.998537 23.12704,-13.125546 16.11532,-8.88776 16.96722,-9.233274 18.29482,-7.419991 0.76584,1.046014 4.40976,6.899112 8.09761,13.006885 L 524.5,86.710084 537,87.340074 c 16.77111,0.845252 33.07893,3.805008 47,8.530176 18.45676,6.2647 21.32703,7.72017 41.46627,21.02689 9.8898,6.53454 34.97904,31.73591 41.105,41.28869 10.97149,17.10888 15.32858,24.89018 15.39746,27.49826 0.0172,0.65124 1.11017,3.80124 2.42883,7 3.43452,8.33132 6.42785,18.10246 7.14269,23.31591 0.33937,2.475 1.36914,7.875 2.28839,12 1.52509,6.84364 1.67136,22.0711 1.67136,174 l 0,166.5 -2.25937,12.16602 c -4.53345,24.41122 -13.85277,46.3002 -28.45482,66.83398 -6.47535,9.1058 -25.15706,27.86196 -35.53045,35.67205 -21.59809,16.26112 -53.12397,28.35906 -83.0969,31.88812 -7.44575,0.87668 -9.33523,1.56697 -17.59476,6.42796 -12.10523,7.12431 -29.70083,15.91002 -46.95505,23.44526 -7.64024,3.33663 -13.94024,6.05584 -14,6.04269 -0.0598,-0.0132 -3.72124,-7.77566 -8.13663,-17.25 z m 45.25069,-36.73951 c 31.71686,-16.2811 53.38793,-31.97528 74.77729,-54.15366 14.87938,-15.42826 23.59551,-27.54314 31.8956,-44.33291 11.63373,-23.5332 15.49324,-39.16518 16.29527,-66 0.64422,-21.55489 -1.33075,-35.72656 -7.58166,-54.40334 -14.29534,-42.7123 -43.9311,-80.63377 -95.60921,-122.3401 -39.04109,-31.50775 -49.87664,-50.56157 -39.96461,-70.27592 3.58215,-7.12466 17.64251,-22.17059 28.96461,-30.99492 10.21994,-7.96532 28.9761,-20.44862 42.78148,-28.47353 10.40224,-6.0467 10.73165,-6.34321 9.36473,-8.42939 -0.77922,-1.18924 -15.40255,-25.18323 -32.49628,-53.31998 -17.09374,-28.13676 -31.76183,-51.96888 -32.59574,-52.96028 -0.83392,-0.9914 -2.11345,-2.63411 -2.8434,-3.65047 -1.25933,-1.75347 -1.78428,-1.60657 -10.26898,2.87369 -17.41279,9.19464 -41.31753,27.5938 -62.32008,47.96693 -11.53672,11.19097 -27.4871,29.08063 -28.98346,32.50731 -0.36026,0.825 -4.10145,6.675 -8.31375,13 -8.14125,12.22454 -17.05242,29.29075 -20.88611,40 -1.27978,3.575 -2.6182,6.725 -2.97427,7 -1.15908,0.89517 -4.91501,16.34792 -6.45181,26.54424 -3.51982,23.35321 -0.4867,56.93989 6.49813,71.95576 1.02336,2.2 3.63753,8.14054 5.80927,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.25667 5.85092,8.80073 0,2.36239 31.88071,32.61305 47.5,45.07134 29.76669,23.74258 45.28733,40.08426 53.4869,56.31638 7.06577,13.98762 7.2631,24.50049 0.69451,37 -6.9477,13.22092 -28.22413,30.24954 -54.97586,44 -6.4202,3.3 -11.68039,6.34422 -11.68932,6.76494 -0.0248,1.16862 44.22335,95.16308 45.0703,95.74092 0.40779,0.27822 2.32955,3.99072 4.27057,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.4429,-4.50605 20.17173,-10.01343 z m -263.704,-6.0207 c 12.21224,-1.15038 24.83184,-4.81576 37.72404,-10.95699 37.20708,-17.72369 65.73705,-53.57841 77.86306,-97.85356 6.65758,-24.3085 6.65844,-24.32021 7.10942,-97.36441 l 0.41188,-66.70908 -7.16013,-10.79092 c -8.10323,-12.21223 -18.35761,-32.61656 -22.80088,-45.36954 -16.24893,-46.63735 -12.91159,-98.65246 9.34354,-145.62656 5.30148,-11.18988 17.72894,-32.70619 19.53538,-33.82264 0.79893,-0.49376 1.46541,-11.38149 0.70498,-11.51658 -0.1375,-0.0244 -26.35,-3.07247 -58.25,-6.77344 l -58,-6.72903 -0.54002,190.52344 c -0.53885,190.10875 -0.54468,190.54364 -2.67807,199.80326 -3.59456,15.6016 -11.34266,28.61464 -19.57095,32.86965 -1.88262,0.97354 -5.82244,1.66817 -9.84948,1.73655 -8.08627,0.13732 -10.81363,-1.49042 -15.51297,-9.25843 -6.99094,-11.55602 -10.31312,-31.48705 -11.06406,-66.37759 l -0.55422,-25.75 -3.61511,0.0338 c -3.26983,0.0305 -80.69085,6.09179 -99.283762,7.77287 -4.217754,0.38135 -7.963823,0.98943 -8.324599,1.35129 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z M 438.7076,689.6804 c -1.5913,-4.14687 -49.08502,-104.63631 -49.33533,-104.38601 -0.16621,0.16621 -1.85179,5.68047 -3.74574,12.25391 -9.21739,31.99127 -23.63587,56.42385 -47.32972,80.2017 l -13.20319,13.25 57.06018,0 c 46.84229,0 56.9695,-0.2363 56.5538,-1.3196 z m 172.04177,-23.41077 c 15.44151,-10.31746 30.93315,-26.67393 40.32291,-42.57391 1.88524,-3.19236 4.47963,-7.59018 5.76529,-9.77293 3.95619,-6.71667 10.13096,-25.83851 12.19728,-37.77216 1.89874,-10.96586 1.96501,-16.81184 1.96112,-173 -0.004,-157.2805 -0.0584,-161.97945 -2.01656,-173.81378 -2.87136,-17.35355 -9.4664,-36.89037 -15.58257,-46.16104 -2.05949,-3.1217 -5.8038,-8.82581 -8.32068,-12.67581 -7.38622,-11.29845 -29.2493,-32.02748 -39.028,-37.00357 -1.89852,-0.9661 -5.94852,-3.45895 -9,-5.53966 -9.96684,-6.79607 -30.08752,-12.76534 -51.94883,-15.41183 l -5.40068,-0.6538 1.49479,2.30443 c 12.43661,19.17289 70.83526,117.16109 70.18717,117.76839 -0.48434,0.45384 -9.14429,5.3901 -19.24435,10.96946 -33.78099,18.66092 -57.06724,34.30989 -69.41116,46.64611 -3.72619,3.72387 -7.03398,7.80297 -7.35065,9.06467 -1.11459,4.44088 6.41246,13.04686 22.62555,25.86873 50.83484,40.20195 81.61329,75.35391 101.55624,115.98707 8.65189,17.62795 13.41747,30.98981 16.84863,47.24063 8.99772,42.61549 3.23334,85.93275 -16.56428,124.47465 -10.19388,19.84539 -22.00864,35.86855 -40.29828,54.65248 L 587.5,679.23552 595,675.50855 c 4.125,-2.04984 11.21222,-6.20735 15.74937,-9.23892 z M 415.21096,565.59524 c 12.80897,-6.27262 26.88904,-13.7788 31.28904,-16.6804 9.04534,-5.96499 21.13852,-17.62643 22.05157,-21.26427 0.8045,-3.20542 -2.02167,-8.59452 -9.32898,-17.78902 -7.14032,-8.98438 -15.56794,-16.79053 -37.72259,-34.94083 -9.35,-7.66003 -18.9125,-15.55911 -21.25,-17.55351 l -4.25,-3.62618 -0.009,34.87949 c -0.01,37.57646 -1.13788,62.41265 -3.50291,77.10997 C 390.87509,575.75432 390.76155,577 391.4609,577 c 0.25353,0 10.94103,-5.13214 23.75,-11.40476 z M 149,451.00398 c 29.425,-2.19919 55.8625,-4.25714 58.75,-4.57321 l 5.25,-0.57468 0,-162.2369 0,-162.23689 87.25,9.75884 c 47.9875,5.36736 88.97679,9.78134 91.08731,9.80885 3.52216,0.0459 4.79515,-0.84049 15.5,-10.7928 C 413.25179,124.19365 420.3,117.67075 422.5,115.66185 l 4,-3.65253 -107,0.31016 c -114.94162,0.33318 -107.40068,0.0207 -127,5.26209 -7.29557,1.95102 -24.55201,9.32238 -31.74018,13.55832 -15.89465,9.3666 -35.10869,27.00112 -43.25982,39.70358 -2.2,3.42841 -5.8,9.0272 -8,12.44175 -4.32658,6.71516 -7.90583,14.55688 -9.932486,21.76091 -0.70341,2.50037 -1.783286,5.48853 -2.399724,6.64035 -0.616438,1.15183 -2.002033,7.65607 -3.0791,14.45387 -1.852505,11.69191 -1.962295,18.20793 -2.032169,120.60965 -0.07005,102.65946 0.01696,108.25006 1.684807,108.25125 0.96727,6.9e-4 25.833672,-1.79809 55.258672,-3.99727 z"
+       id="path3298"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#221c0b"
+       d="M 459.44963,733.70893 451.39925,716.5 l -85.75036,-0.25559 -85.75037,-0.2556 -7.69926,2.51626 C 240.22841,728.9537 195.74952,728.92721 163.5,718.44033 140.34032,710.90928 122.09373,699.29072 102.47968,679.5855 86.545986,663.57774 77.243975,650.71409 68.522775,632.62688 50.342637,594.92242 44.053786,556.88335 44.01384,484.38084 L 44,459.26168 l 3.75,-0.61983 c 2.0625,-0.34091 5.83125,-0.62479 8.375,-0.63084 2.54375,-0.006 6.016424,-0.28929 7.717054,-0.62942 L 66.934108,456.76318 67.237526,345.63159 67.540944,234.5 69.86749,222 C 73.243051,203.86389 80.700549,182.9868 87.834537,171.70167 98.965252,154.0942 102.49239,149.4603 112.95289,138.70155 123.99696,127.3426 138.68847,115.2446 146,111.48827 c 1.925,-0.98897 4.625,-2.60615 6,-3.59374 4.88278,-3.50701 30.62938,-13.147171 41.5,-15.538621 25.4192,-5.592019 18.66086,-5.348001 148.23239,-5.352103 L 461.96477,87 l 6.26762,-3.808432 c 3.44718,-2.094638 13.87088,-8.016798 23.16377,-13.160357 15.25999,-8.446312 17.01543,-9.188818 18.12778,-7.667581 0.67739,0.926388 4.32238,6.784717 8.09996,13.018508 l 6.86834,11.334165 12.27813,0.622286 c 16.89346,0.856203 33.93648,3.946366 47.39565,8.593564 18.81921,6.497917 21.34654,7.780847 41.30025,20.964987 9.8898,6.53454 34.97904,31.73591 41.105,41.28869 11.21402,17.48708 15.33393,24.89588 15.39746,27.68912 0.0172,0.75623 1.1237,3.90623 2.4589,7 3.21475,7.44889 6.50648,18.66658 7.58008,25.83174 0.47743,3.18632 1.45851,8.49331 2.18017,11.79331 1.05346,4.81721 1.31212,38.72378 1.31212,172 l 0,166 -2.25937,12.16602 c -4.65046,25.04131 -15.38964,49.55168 -30.39347,69.36799 -7.14268,9.4337 -24.94061,26.81934 -35.25155,34.43493 -14.73055,10.8799 -41.12529,22.79595 -57.59561,26.00185 -4.675,0.90998 -9.85,2.06604 -11.5,2.56902 -1.65,0.50299 -6.92593,1.35327 -11.72429,1.88951 -7.93767,0.88708 -9.56063,1.46571 -18,6.41743 -12.19205,7.15358 -28.84077,15.46926 -46.65692,23.30415 -7.94064,3.492 -14.47832,6.33062 -14.52816,6.30803 -0.0498,-0.0226 -3.7133,-7.78508 -8.141,-17.25 z m 45.27308,-36.72236 c 31.71686,-16.2811 53.38793,-31.97528 74.77729,-54.15366 14.87938,-15.42826 23.59551,-27.54314 31.8956,-44.33291 11.63373,-23.5332 15.49324,-39.16518 16.29527,-66 0.64422,-21.55489 -1.33075,-35.72656 -7.58166,-54.40334 -14.29534,-42.7123 -43.9311,-80.63377 -95.60921,-122.3401 -39.04109,-31.50775 -49.87664,-50.56157 -39.96461,-70.27592 3.58215,-7.12466 17.64251,-22.17059 28.96461,-30.99492 10.21994,-7.96532 28.9761,-20.44862 42.78148,-28.47353 10.40224,-6.0467 10.73165,-6.34321 9.36473,-8.42939 -0.77922,-1.18924 -15.40255,-25.18323 -32.49628,-53.31998 -17.09374,-28.13676 -31.76183,-51.96888 -32.59574,-52.96028 -0.83392,-0.9914 -2.11345,-2.63411 -2.8434,-3.65047 -1.25933,-1.75347 -1.78428,-1.60657 -10.26898,2.87369 -17.41279,9.19464 -41.31753,27.5938 -62.32008,47.96693 -11.53672,11.19097 -27.4871,29.08063 -28.98346,32.50731 -0.36026,0.825 -4.10145,6.675 -8.31375,13 -8.14125,12.22454 -17.05242,29.29075 -20.88611,40 -1.27978,3.575 -2.63951,6.725 -3.02163,7 -1.16224,0.83641 -5.7844,20.92848 -7.01651,30.5 -1.81469,14.0973 -0.61367,39.55298 2.49186,52.81504 1.39289,5.94827 3.42048,12.69827 4.50576,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.25667 5.85092,8.80073 0,2.36239 31.88071,32.61305 47.5,45.07134 29.76669,23.74258 45.28733,40.08426 53.4869,56.31638 7.06577,13.98762 7.2631,24.50049 0.69451,37 -6.9477,13.22092 -28.22413,30.24954 -54.97586,44 -6.4202,3.3 -11.68039,6.34422 -11.68932,6.76494 -0.0248,1.16862 44.22335,95.16308 45.0703,95.74092 0.40779,0.27822 2.32955,3.99072 4.27057,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.4429,-4.50605 20.17173,-10.01343 z m -263.704,-6.0207 c 12.21224,-1.15038 24.83184,-4.81576 37.72404,-10.95699 37.20708,-17.72369 65.73705,-53.57841 77.86306,-97.85356 6.65758,-24.3085 6.65844,-24.32021 7.10942,-97.36441 l 0.41188,-66.70908 -7.16013,-10.79092 c -38.65734,-58.25982 -43.52475,-127.64335 -13.40732,-191.11777 5.15481,-10.86411 17.79493,-32.65622 19.58243,-33.76095 0.73349,-0.45333 1.31073,-11.33175 0.60791,-11.4566 -0.1375,-0.0244 -26.35,-3.07247 -58.25,-6.77344 l -58,-6.72903 -0.54002,190.52344 c -0.53885,190.10875 -0.54468,190.54364 -2.67807,199.80326 -3.59456,15.6016 -11.34266,28.61464 -19.57095,32.86965 -1.88262,0.97354 -5.82244,1.66817 -9.84948,1.73655 -8.08627,0.13732 -10.81363,-1.49042 -15.51297,-9.25843 -6.99094,-11.55602 -10.31312,-31.48705 -11.06406,-66.37759 l -0.55422,-25.75 -3.61511,0.0338 c -3.26983,0.0305 -80.69085,6.09179 -99.283762,7.77287 -4.217754,0.38135 -7.963823,0.98943 -8.324599,1.35129 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.39574,2.82371 29.33569,3.07702 51.97453,0.94447 z M 438.7076,689.6804 c -1.5913,-4.14687 -49.08502,-104.63631 -49.33533,-104.38601 -0.16621,0.16621 -1.85179,5.68047 -3.74574,12.25391 -9.21739,31.99127 -23.63587,56.42385 -47.32972,80.2017 l -13.20319,13.25 57.06018,0 c 46.84229,0 56.9695,-0.2363 56.5538,-1.3196 z m 172.04177,-23.41077 c 15.44151,-10.31746 30.93315,-26.67393 40.32291,-42.57391 1.88524,-3.19236 4.47963,-7.59018 5.76529,-9.77293 3.95619,-6.71667 10.13096,-25.83851 12.19728,-37.77216 1.89874,-10.96586 1.96501,-16.81184 1.96112,-173 -0.004,-157.2805 -0.0584,-161.97945 -2.01656,-173.81378 -2.87136,-17.35355 -9.4664,-36.89037 -15.58257,-46.16104 -2.05949,-3.1217 -5.8038,-8.82581 -8.32068,-12.67581 -7.38622,-11.29845 -29.2493,-32.02748 -39.028,-37.00357 -1.89852,-0.9661 -5.94852,-3.45895 -9,-5.53966 -9.96684,-6.79607 -30.08752,-12.76534 -51.94883,-15.41183 l -5.40068,-0.6538 1.49479,2.30443 c 12.43661,19.17289 70.83526,117.16109 70.18717,117.76839 -0.48434,0.45384 -9.14429,5.3901 -19.24435,10.96946 -33.78099,18.66092 -57.06724,34.30989 -69.41116,46.64611 -3.72619,3.72387 -7.03398,7.80297 -7.35065,9.06467 -1.11459,4.44088 6.41246,13.04686 22.62555,25.86873 50.83484,40.20195 81.61329,75.35391 101.55624,115.98707 8.65189,17.62795 13.41747,30.98981 16.84863,47.24063 8.99772,42.61549 3.23334,85.93275 -16.56428,124.47465 -10.19388,19.84539 -22.00864,35.86855 -40.29828,54.65248 L 587.5,679.23552 595,675.50855 c 4.125,-2.04984 11.21222,-6.20735 15.74937,-9.23892 z M 415.21096,565.59524 c 12.80897,-6.27262 26.88904,-13.7788 31.28904,-16.6804 9.04534,-5.96499 21.13852,-17.62643 22.05157,-21.26427 0.8045,-3.20542 -2.02167,-8.59452 -9.32898,-17.78902 -7.14032,-8.98438 -15.56794,-16.79053 -37.72259,-34.94083 -9.35,-7.66003 -18.9125,-15.55911 -21.25,-17.55351 l -4.25,-3.62618 -0.009,34.87949 c -0.01,37.57646 -1.13788,62.41265 -3.50291,77.10997 C 390.87509,575.75432 390.76155,577 391.4609,577 c 0.25353,0 10.94103,-5.13214 23.75,-11.40476 z M 149,451.00398 c 29.425,-2.19919 55.8625,-4.25714 58.75,-4.57321 l 5.25,-0.57468 0,-162.2369 0,-162.23689 87.25,9.75884 c 47.9875,5.36736 88.97679,9.78134 91.08731,9.80885 3.52216,0.0459 4.79515,-0.84049 15.5,-10.7928 C 413.25179,124.19365 420.3,117.67075 422.5,115.66185 l 4,-3.65253 -107,0.31016 c -114.94162,0.33318 -107.40068,0.0207 -127,5.26209 -7.29557,1.95102 -24.55201,9.32238 -31.74018,13.55832 -15.89465,9.3666 -35.10869,27.00112 -43.25982,39.70358 -2.2,3.42841 -5.8,9.0272 -8,12.44175 -4.32658,6.71516 -7.90583,14.55688 -9.932486,21.76091 -0.70341,2.50037 -1.780796,5.48387 -2.394189,6.63001 -0.613394,1.14614 -2.028326,7.95783 -3.144293,15.13709 C 92.083798,239.32735 92,244.3089 92,347.43322 c 0,101.77741 0.09419,107.56685 1.75,107.56803 0.9625,6.9e-4 25.825,-1.79809 55.25,-3.99727 z"
+       id="path3296"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#151515"
+       d="M 459.44963,733.70893 451.39925,716.5 l -85.75036,-0.25559 -85.75037,-0.2556 -7.69926,2.51626 C 240.22841,728.9537 195.74952,728.92721 163.5,718.44033 140.34032,710.90928 122.09373,699.29072 102.47968,679.5855 86.545986,663.57774 77.243975,650.71409 68.522775,632.62688 50.342637,594.92242 44.053786,556.88335 44.01384,484.38084 L 44,459.26168 l 3.75,-0.61983 c 2.0625,-0.34091 5.83125,-0.62479 8.375,-0.63084 2.54375,-0.006 6.016424,-0.28929 7.717054,-0.62942 L 66.934108,456.76318 67.237526,345.63159 67.540944,234.5 69.86749,222 C 73.243051,203.86389 80.700549,182.9868 87.834537,171.70167 98.965252,154.0942 102.49239,149.4603 112.95289,138.70155 123.99696,127.3426 138.68847,115.2446 146,111.48827 c 1.925,-0.98897 4.625,-2.60615 6,-3.59374 4.88278,-3.50701 30.62938,-13.147171 41.5,-15.538621 25.4192,-5.592019 18.66086,-5.348001 148.23239,-5.352103 L 461.96477,87 l 6.26762,-3.808432 c 3.44718,-2.094638 13.87088,-8.016798 23.16377,-13.160357 15.25999,-8.446312 17.01543,-9.188818 18.12778,-7.667581 0.67739,0.926388 4.32238,6.784717 8.09996,13.018508 l 6.86834,11.334165 12.27813,0.622286 c 16.89346,0.856203 33.93648,3.946366 47.39565,8.593564 18.81921,6.497917 21.34654,7.780847 41.30025,20.964987 9.8898,6.53454 34.97904,31.73591 41.105,41.28869 11.21402,17.48708 15.33393,24.89588 15.39746,27.68912 0.0172,0.75623 1.1237,3.90623 2.4589,7 3.21475,7.44889 6.50648,18.66658 7.58008,25.83174 0.47743,3.18632 1.45851,8.49331 2.18017,11.79331 1.05346,4.81721 1.31212,38.72378 1.31212,172 l 0,166 -2.25937,12.16602 c -4.65046,25.04131 -15.38964,49.55168 -30.39347,69.36799 -7.14268,9.4337 -24.94061,26.81934 -35.25155,34.43493 -14.73055,10.8799 -41.12529,22.79595 -57.59561,26.00185 -4.675,0.90998 -9.85,2.06604 -11.5,2.56902 -1.65,0.50299 -6.92593,1.35327 -11.72429,1.88951 -7.93767,0.88708 -9.56063,1.46571 -18,6.41743 -12.19205,7.15358 -28.84077,15.46926 -46.65692,23.30415 -7.94064,3.492 -14.47832,6.33062 -14.52816,6.30803 -0.0498,-0.0226 -3.7133,-7.78508 -8.141,-17.25 z m 45.30879,-36.74069 c 31.84681,-16.34781 53.2474,-31.84826 74.74158,-54.13533 14.87938,-15.42826 23.59551,-27.54314 31.8956,-44.33291 11.63373,-23.5332 15.49324,-39.16518 16.29527,-66 0.45767,-15.31329 0.22978,-19.80354 -1.52682,-30.0831 C 617.36224,450.90886 585.32153,404.6767 524.5,355.72386 c -38.98724,-31.37929 -49.87931,-50.52357 -39.96461,-70.24322 3.55697,-7.07457 17.09415,-21.5861 28.56634,-30.62242 10.43039,-8.21573 25.15725,-18.08565 41.16282,-27.58727 12.19231,-7.2379 12.70314,-7.6716 11.39476,-9.67428 -0.75338,-1.15317 -15.354,-25.1179 -32.44581,-53.25495 -17.09181,-28.13706 -31.77341,-51.98706 -32.62577,-53 -0.85237,-1.01295 -2.14699,-2.67329 -2.87694,-3.68965 -1.25927,-1.75338 -1.7847,-1.60599 -10.26898,2.88059 -17.96236,9.49868 -40.43882,26.71633 -61.31264,46.96734 -12.37017,12.00108 -28.44235,29.95379 -29.9909,33.5 -0.36026,0.825 -4.10145,6.675 -8.31375,13 -8.14125,12.22454 -17.05242,29.29075 -20.88611,40 -1.27978,3.575 -2.63951,6.725 -3.02163,7 -1.16224,0.83641 -5.7844,20.92848 -7.01651,30.5 -1.81469,14.0973 -0.61367,39.55298 2.49186,52.81504 1.39289,5.94827 3.42048,12.69827 4.50576,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.25667 5.85092,8.80073 0,2.36239 31.88071,32.61305 47.5,45.07134 29.74141,23.72242 45.24826,40.04405 53.50503,56.31638 9.61521,18.94955 6.5366,33.93383 -10.49085,51.06122 -9.2298,9.28399 -26.23834,20.90761 -43.80863,29.93878 -6.4202,3.3 -11.68039,6.36185 -11.68932,6.80412 -0.024,1.18708 44.21378,95.10848 45.07629,95.70174 0.4045,0.27822 2.32356,3.99072 4.26458,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.45897,-4.51429 20.20744,-10.03176 z M 237,691.42186 c 34.79321,-2.23804 68.87703,-22.10056 92.95666,-54.17096 12.55635,-16.72314 21.30125,-35.01844 26.99543,-56.47739 6.38668,-24.06872 6.38678,-24.07017 6.79301,-96.4906 l 0.37143,-66.2171 -7.15484,-10.7829 C 318.30999,349.03179 313.444,279.64384 343.55966,216.17314 c 5.15481,-10.86411 17.79493,-32.65622 19.58243,-33.76095 0.73349,-0.45333 1.31073,-11.33175 0.60791,-11.4566 -0.1375,-0.0244 -26.35,-3.07247 -58.25,-6.77344 l -58,-6.72903 -0.56114,190.52344 c -0.60318,204.79818 -0.3307,194.3275 -5.45254,209.52344 -3.37622,10.01688 -10.40464,19.88603 -16.28797,22.87117 -4.11546,2.08815 -11.62116,2.86134 -16.0914,1.65763 -13.44237,-3.61966 -21.09463,-33.45442 -21.10353,-82.2788 L 188,481 l -3.75,0.0338 c -3.36677,0.0303 -80.3775,6.05126 -99.418642,7.77287 -4.217754,0.38135 -7.963823,0.98943 -8.324599,1.35129 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 18.15565,12.19476 37.80289,18.89959 61.58445,21.01635 8.72322,0.77644 12.35588,0.71109 32.5,-0.58467 z m 201.69593,-1.77188 c -1.64848,-4.29587 -49.05335,-104.62589 -49.31228,-104.36696 -0.17247,0.17246 -1.86317,5.69184 -3.75712,12.26528 -9.2354,32.05378 -23.69382,56.53006 -47.37606,80.2017 l -13.25594,13.25 57.10972,0 c 47.53351,0 57.02286,-0.22637 56.59168,-1.35002 z m 173.04685,-23.94695 c 9.82449,-6.76198 24.00567,-20.20217 30.42594,-28.83614 15.07291,-20.26999 22.95013,-38.07105 26.86781,-60.71626 1.89651,-10.96233 1.96333,-16.86211 1.95944,-173 -0.005,-189.8975 0.89527,-173.51536 -11.40038,-207.5153 -1.36538,-3.77556 -3.56541,-8.50056 -4.88894,-10.5 C 653.38311,183.1359 649.64824,177.45 646.40694,172.5 637.61208,159.06881 616.66051,138.84525 606,133.49709 c -1.925,-0.96573 -5.67778,-3.34054 -8.33952,-5.27736 -6.09783,-4.43711 -27.19531,-11.9119 -38.66048,-13.69733 -13.68887,-2.13171 -19.20802,-2.66871 -18.68946,-1.81845 23.99113,39.33744 71.0652,117.11496 71.38288,117.94142 0.25019,0.65089 -6.81981,5.14333 -16.37658,10.40605 -21.84617,12.03024 -42.85789,24.98123 -55.6263,34.28636 -11.53398,8.40553 -23.43708,19.80417 -24.30919,23.27896 -1.23225,4.90965 5.63298,12.30592 28.61865,30.83234 28.43536,22.91888 47.25055,41.26535 65.17761,63.55396 36.87108,45.84157 54.58995,96.86109 50.83233,146.36605 -3.7114,48.89595 -22.4206,88.33825 -60.4827,127.50822 L 587.5,679.25462 l 8.39702,-4.21239 c 4.61836,-2.31682 11.74896,-6.51946 15.84576,-9.3392 z M 417.32196,564.55842 c 18.5902,-9.18624 27.52486,-14.223 34.14733,-19.25 C 460.70167,538.30029 469,529.2503 469,526.18979 c 0,-7.34159 -19.72965,-28.93666 -44.95295,-49.20321 -8.49912,-6.82892 -18.17412,-14.84513 -21.5,-17.81382 l -6.04705,-5.3976 -0.61113,44.86242 c -0.56098,41.18131 -1.48279,57.63197 -3.96439,70.74891 -1.06647,5.63702 -1.15799,7.61351 -0.35252,7.61351 0.31459,0 11.90209,-5.59871 25.75,-12.44158 z M 149,451.0134 c 29.425,-2.19366 55.8625,-4.25146 58.75,-4.57289 l 5.25,-0.58442 0,-162.24242 0,-162.24241 87.25,9.77565 c 47.9875,5.37661 89.05,9.78897 91.25,9.80525 3.68057,0.0273 4.71788,-0.66118 12.98952,-8.62061 4.94424,-4.75763 12.0612,-11.29393 15.81547,-14.52513 l 6.82594,-5.87491 -107.31547,0.34104 -107.31546,0.34104 -11.09035,2.59588 c -19.76932,4.62733 -37.96916,13.0522 -53.68166,24.84972 -11.80895,8.86659 -24.37635,21.66527 -30.22799,30.78428 -2.2,3.42841 -5.8,9.0272 -8,12.44175 -4.32658,6.71516 -7.90583,14.55688 -9.932486,21.76091 -0.70341,2.50037 -1.780796,5.48387 -2.394189,6.63001 -0.613394,1.14614 -2.028326,7.95783 -3.144293,15.13709 C 92.083798,239.32735 92,244.3089 92,347.43322 c 0,101.77753 0.09418,107.56683 1.75,107.56771 0.9625,5.1e-4 25.825,-1.79388 55.25,-3.98753 z"
+       id="path3294"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#1d1809"
+       d="m 459.5,733.48621 -8,-17.44119 -87,0.22749 -87,0.22749 -8.5,2.68245 c -31.1972,9.84527 -73.86436,9.54514 -105.5,-0.74212 C 142.62449,711.65205 122.63811,699.4291 105.68586,683.08328 74.736385,653.24097 57.325776,618.30134 49.086683,569.5 45.766884,549.83635 45.010539,538.44256 44.334193,497.90715 l -0.643934,-38.59285 4.794442,-0.65715 C 51.121644,458.29572 54.960085,458 57.014571,458 c 2.054486,0 5.126853,-0.27828 6.827483,-0.61841 L 66.934108,456.76318 67.237526,345.63159 67.540944,234.5 69.86749,222 C 73.168586,204.26397 80.619751,183.41494 87.797486,171.83025 98.040151,155.29883 102.40608,149.54906 112.95289,138.70155 123.99696,127.3426 138.68847,115.2446 146,111.48827 c 1.925,-0.98897 4.625,-2.60615 6,-3.59374 4.85768,-3.48898 30.63496,-13.148555 41.5,-15.55138 24.92167,-5.511473 19.82067,-5.328465 148.73239,-5.336078 L 461.96477,87 l 6.26762,-3.808432 c 3.44718,-2.094638 13.87088,-8.016798 23.16377,-13.160357 15.10795,-8.362162 17.02388,-9.177253 18.10297,-7.701509 0.66375,0.907729 4.29064,6.765141 8.05975,13.016471 l 6.85294,11.366054 12.04409,0.616489 c 28.30365,1.44875 58.70234,9.917166 75.72759,21.096064 2.57593,1.69137 8.10413,5.2695 12.28489,7.95139 4.18076,2.6819 13.28583,10.3319 20.23349,17 12.56914,12.06339 19.8164,20.84453 26.36444,31.94444 1.88852,3.20134 4.90245,8.32297 6.69761,11.38142 1.79516,3.05844 3.53538,6.73917 3.86715,8.17939 0.33177,1.44022 1.64294,5.09358 2.9137,8.11858 2.71472,6.46227 6.10199,17.83376 7.00005,23.5 0.34868,2.2 1.38124,7.6 2.29457,12 1.50867,7.26807 1.6606,23.18759 1.6606,174 l 0,166 -2.37753,12.5 c -4.80892,25.28317 -15.27006,49.06403 -30.45398,69.22977 -6.84406,9.08958 -24.75084,26.61548 -34.70618,33.96799 -14.95858,11.04763 -41.46295,23.06148 -57.96231,26.27303 -4.675,0.90998 -9.85,2.06604 -11.5,2.56902 -1.65,0.50299 -6.93162,1.35391 -11.73693,1.89095 -7.86799,0.87931 -9.5952,1.48336 -17.36651,6.07353 -11.47386,6.77709 -29.6482,15.8609 -47.30593,23.64423 -7.92516,3.49331 -14.45016,6.33514 -14.5,6.31518 -0.0498,-0.02 -3.69063,-7.88484 -8.09063,-17.47749 z m 45.25842,-36.51797 c 31.84681,-16.34781 53.2474,-31.84826 74.74158,-54.13533 14.87938,-15.42826 23.59551,-27.54314 31.8956,-44.33291 11.63373,-23.5332 15.49324,-39.16518 16.29527,-66 0.45767,-15.31329 0.22978,-19.80354 -1.52682,-30.0831 C 617.36224,450.90886 585.32153,404.6767 524.5,355.72386 c -38.98724,-31.37929 -49.87931,-50.52357 -39.96461,-70.24322 3.55697,-7.07457 17.09415,-21.5861 28.56634,-30.62242 10.43039,-8.21573 25.15725,-18.08565 41.16282,-27.58727 12.19231,-7.2379 12.70314,-7.6716 11.39476,-9.67428 -0.75338,-1.15317 -15.354,-25.1179 -32.44581,-53.25495 -17.09181,-28.13706 -31.77341,-51.98706 -32.62577,-53 -0.85237,-1.01295 -2.14699,-2.67329 -2.87694,-3.68965 -1.25927,-1.75338 -1.7847,-1.60599 -10.26898,2.88059 -17.96236,9.49868 -40.43882,26.71633 -61.31264,46.96734 -12.37017,12.00108 -28.44235,29.95379 -29.9909,33.5 -0.36026,0.825 -4.10145,6.675 -8.31375,13 -8.14125,12.22454 -17.05242,29.29075 -20.88611,40 -1.27978,3.575 -2.67315,6.74148 -3.09639,7.03662 -1.24787,0.87017 -5.57793,20.014 -6.89672,30.4914 -1.85214,14.71464 -0.71273,39.25698 2.45071,52.78702 1.39076,5.94827 3.4166,12.69827 4.50188,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.25667 5.85092,8.80073 0,2.36239 31.88071,32.61305 47.5,45.07134 29.74141,23.72242 45.24826,40.04405 53.50503,56.31638 9.61521,18.94955 6.5366,33.93383 -10.49085,51.06122 -9.2298,9.28399 -26.23834,20.90761 -43.80863,29.93878 -6.4202,3.3 -11.68039,6.36185 -11.68932,6.80412 -0.024,1.18708 44.21378,95.10848 45.07629,95.70174 0.4045,0.27822 2.32356,3.99072 4.26458,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.45897,-4.51429 20.20744,-10.03176 z M 237,691.42186 c 34.79321,-2.23804 68.87703,-22.10056 92.95666,-54.17096 12.55635,-16.72314 21.30125,-35.01844 26.99543,-56.47739 6.38668,-24.06872 6.38678,-24.07017 6.79301,-96.4906 l 0.37143,-66.2171 -7.15484,-10.7829 C 318.32805,349.05899 313.45806,279.6142 343.55966,216.17314 c 5.15481,-10.86411 17.79493,-32.65622 19.58243,-33.76095 0.73349,-0.45333 1.31073,-11.33175 0.60791,-11.4566 -0.1375,-0.0244 -26.35,-3.07247 -58.25,-6.77344 l -58,-6.72903 -0.56114,190.52344 c -0.60318,204.79818 -0.3307,194.3275 -5.45254,209.52344 -3.37622,10.01688 -10.40464,19.88603 -16.28797,22.87117 -4.11546,2.08815 -11.62116,2.86134 -16.0914,1.65763 -13.44237,-3.61966 -21.09463,-33.45442 -21.10353,-82.2788 L 188,481 l -3.75,0.0338 c -3.36677,0.0303 -80.3775,6.05126 -99.418642,7.77287 -4.217754,0.38135 -7.963823,0.98943 -8.324599,1.35129 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 18.15565,12.19476 37.80289,18.89959 61.58445,21.01635 8.72322,0.77644 12.35588,0.71109 32.5,-0.58467 z m 201.69593,-1.77188 c -1.64848,-4.29587 -49.05335,-104.62589 -49.31228,-104.36696 -0.17247,0.17246 -1.86317,5.69184 -3.75712,12.26528 -9.2354,32.05378 -23.69382,56.53006 -47.37606,80.2017 l -13.25594,13.25 57.10972,0 c 47.53351,0 57.02286,-0.22637 56.59168,-1.35002 z m 173.04685,-23.94695 c 9.82449,-6.76198 24.00567,-20.20217 30.42594,-28.83614 15.07291,-20.26999 22.95013,-38.07105 26.86781,-60.71626 1.89651,-10.96233 1.96333,-16.86211 1.95944,-173 -0.005,-189.8975 0.89527,-173.51536 -11.40038,-207.5153 -1.36538,-3.77556 -3.56541,-8.50056 -4.88894,-10.5 C 653.38311,183.1359 649.64824,177.45 646.40694,172.5 637.61208,159.06881 616.66051,138.84525 606,133.49709 c -1.925,-0.96573 -5.67778,-3.34054 -8.33952,-5.27736 -6.09783,-4.43711 -27.19531,-11.9119 -38.66048,-13.69733 -13.68887,-2.13171 -19.20802,-2.66871 -18.68946,-1.81845 23.99113,39.33744 71.0652,117.11496 71.38288,117.94142 0.25019,0.65089 -6.81981,5.14333 -16.37658,10.40605 -21.84617,12.03024 -42.85789,24.98123 -55.6263,34.28636 -11.53398,8.40553 -23.43708,19.80417 -24.30919,23.27896 -1.23225,4.90965 5.63298,12.30592 28.61865,30.83234 28.43536,22.91888 47.25055,41.26535 65.17761,63.55396 36.87108,45.84157 54.58995,96.86109 50.83233,146.36605 -3.7114,48.89595 -22.4206,88.33825 -60.4827,127.50822 L 587.5,679.25462 l 8.39702,-4.21239 c 4.61836,-2.31682 11.74896,-6.51946 15.84576,-9.3392 z M 417.32196,564.55842 c 18.5902,-9.18624 27.52486,-14.223 34.14733,-19.25 C 460.70167,538.30029 469,529.2503 469,526.18979 c 0,-7.34159 -19.72965,-28.93666 -44.95295,-49.20321 -8.49912,-6.82892 -18.17412,-14.84513 -21.5,-17.81382 l -6.04705,-5.3976 -0.61113,44.86242 c -0.56098,41.18131 -1.48279,57.63197 -3.96439,70.74891 -1.06647,5.63702 -1.15799,7.61351 -0.35252,7.61351 0.31459,0 11.90209,-5.59871 25.75,-12.44158 z M 149,451.0134 c 29.425,-2.19366 55.8625,-4.25146 58.75,-4.57289 l 5.25,-0.58442 0,-162.24242 0,-162.24241 87.25,9.77565 c 47.9875,5.37661 89.05,9.78897 91.25,9.80525 3.68057,0.0273 4.71788,-0.66118 12.98952,-8.62061 4.94424,-4.75763 12.0612,-11.29393 15.81547,-14.52513 l 6.82594,-5.87491 -107.31547,0.34104 -107.31546,0.34104 -11.08146,2.594 c -26.0457,6.09688 -47.8058,17.90332 -67.63779,36.6984 -8.54434,8.09761 -18.60951,20.7995 -22.26213,28.09401 -0.96391,1.925 -2.55038,4.4 -3.52548,5.5 -1.9946,2.25007 -6.48446,12.66903 -8.423045,19.54613 -0.70483,2.50037 -1.841999,5.59341 -2.527043,6.87343 -0.685043,1.28001 -2.089633,8.00925 -3.12131,14.95387 -1.743411,11.73556 -1.877399,20.23005 -1.89876,120.37657 -0.02175,101.96079 0.07104,107.75005 1.727018,107.75093 0.9625,5.1e-4 25.825,-1.79388 55.25,-3.98753 z"
+       id="path3292"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#1a1508"
+       d="m 459.5,733.48621 -8,-17.44119 -87,0.22749 -87,0.22749 -8.5,2.68245 c -31.1972,9.84527 -73.86436,9.54514 -105.5,-0.74212 C 142.62449,711.65205 122.63811,699.4291 105.68586,683.08328 74.736385,653.24097 57.325776,618.30134 49.086683,569.5 45.766884,549.83635 45.010539,538.44256 44.334193,497.90715 l -0.643934,-38.59285 4.794442,-0.65715 C 51.121644,458.29572 54.960085,458 57.014571,458 c 2.054486,0 5.126853,-0.27828 6.827483,-0.61841 L 66.934108,456.76318 67.237526,345.63159 67.540944,234.5 69.86749,222 C 73.168586,204.26397 80.619751,183.41494 87.797486,171.83025 98.040151,155.29883 102.40608,149.54906 112.95289,138.70155 123.99696,127.3426 138.68847,115.2446 146,111.48827 c 1.925,-0.98897 4.625,-2.60615 6,-3.59374 4.85768,-3.48898 30.63496,-13.148555 41.5,-15.55138 24.92167,-5.511473 19.82067,-5.328465 148.73239,-5.336078 L 461.96477,87 l 6.26762,-3.808432 c 3.44718,-2.094638 13.87088,-8.016798 23.16377,-13.160357 15.10795,-8.362162 17.02388,-9.177253 18.10297,-7.701509 0.66375,0.907729 4.29064,6.765141 8.05975,13.016471 l 6.85294,11.366054 12.04409,0.616489 c 28.30365,1.44875 58.70234,9.917166 75.72759,21.096064 2.57593,1.69137 8.10413,5.2695 12.28489,7.95139 4.18076,2.6819 13.28583,10.3319 20.23349,17 12.56914,12.06339 19.8164,20.84453 26.36444,31.94444 1.88852,3.20134 4.90245,8.32297 6.69761,11.38142 1.79516,3.05844 3.53538,6.73917 3.86715,8.17939 0.33177,1.44022 1.64294,5.09358 2.9137,8.11858 2.71472,6.46227 6.10199,17.83376 7.00005,23.5 0.34868,2.2 1.38124,7.6 2.29457,12 1.50867,7.26807 1.6606,23.18759 1.6606,174 l 0,166 -2.37753,12.5 c -4.80892,25.28317 -15.27006,49.06403 -30.45398,69.22977 -6.84406,9.08958 -24.75084,26.61548 -34.70618,33.96799 -14.95858,11.04763 -41.46295,23.06148 -57.96231,26.27303 -4.675,0.90998 -9.85,2.06604 -11.5,2.56902 -1.65,0.50299 -6.93162,1.35391 -11.73693,1.89095 -7.86799,0.87931 -9.5952,1.48336 -17.36651,6.07353 -11.47386,6.77709 -29.6482,15.8609 -47.30593,23.64423 -7.92516,3.49331 -14.45016,6.33514 -14.5,6.31518 -0.0498,-0.02 -3.69063,-7.88484 -8.09063,-17.47749 z m 45.25842,-36.51797 c 31.84681,-16.34781 53.2474,-31.84826 74.74158,-54.13533 24.58341,-25.49026 38.78713,-51.33903 45.70966,-83.18515 1.88053,-8.65112 2.2121,-13.31869 2.2481,-31.64776 0.0372,-18.93248 -0.23437,-22.73524 -2.27407,-31.84372 C 613.89967,445.76629 582.8616,402.6331 523.5,354.84777 488.50185,326.67471 476.32919,307.48993 482.44797,290.14748 485.73552,280.82956 498.9567,265.88185 515,253.34454 c 8.28366,-6.47341 28.26574,-19.65569 41.67801,-27.49519 9.96513,-5.82464 10.34321,-6.16903 9.01805,-8.21444 -0.76073,-1.1742 -15.37764,-25.16201 -32.48203,-53.30624 -17.10439,-28.14423 -31.79125,-51.99423 -32.63747,-53 -0.84622,-1.00577 -2.13582,-2.66024 -2.86577,-3.6766 -1.25927,-1.75338 -1.7847,-1.60599 -10.26898,2.88059 -17.96236,9.49868 -40.43882,26.71633 -61.31264,46.96734 -12.37017,12.00108 -28.44235,29.95379 -29.9909,33.5 -0.36026,0.825 -4.10145,6.675 -8.31375,13 -8.14125,12.22454 -17.05242,29.29075 -20.88611,40 -1.27978,3.575 -2.67315,6.74148 -3.09639,7.03662 -1.24787,0.87017 -5.57793,20.014 -6.89672,30.4914 -1.85214,14.71464 -0.71273,39.25698 2.45071,52.78702 1.39076,5.94827 3.4166,12.69827 4.50188,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.25667 5.85092,8.80073 0,2.42489 31.90255,32.62834 48,45.44356 9.625,7.66249 22.70606,19.10958 29.06901,25.43798 28.02246,27.87026 35.15742,47.43984 24.6124,67.50618 -6.9477,13.22092 -28.22413,30.24954 -54.97586,44 -6.4202,3.3 -11.68039,6.35168 -11.68932,6.78151 -0.0252,1.21496 44.17898,95.15388 45.04437,95.72435 0.42206,0.27822 2.35548,3.99072 4.2965,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.45897,-4.51429 20.20744,-10.03176 z M 241,690.9943 c 25.2471,-2.26285 51.41029,-14.79614 71.86479,-34.42631 21.8049,-20.92616 36.00653,-45.34147 44.0873,-75.79448 6.38668,-24.06872 6.38678,-24.07017 6.79301,-96.4906 l 0.37143,-66.2171 -7.15484,-10.7829 C 318.32805,349.05899 313.45806,279.6142 343.55966,216.17314 c 5.15481,-10.86411 17.79493,-32.65622 19.58243,-33.76095 0.73349,-0.45333 1.31073,-11.33175 0.60791,-11.4566 -0.1375,-0.0244 -26.35,-3.07248 -58.25,-6.77345 l -58,-6.72903 -0.56363,190.52344 c -0.60564,204.72363 -0.33486,194.29827 -5.44198,209.52345 -3.18482,9.49452 -10.74913,20.06056 -16.41924,22.93488 -4.00512,2.0303 -11.55054,2.78347 -15.9682,1.59392 -13.48207,-3.63034 -21.06872,-33.39878 -21.09663,-82.7788 L 188,481 l -4.25,0.0593 c -3.93557,0.0549 -81.55635,6.12047 -98.918642,7.72987 -4.217754,0.39096 -7.963823,1.00691 -8.324599,1.36877 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.3245,2.81064 28.66469,3.06045 51.95582,0.9729 z m 197.56273,-1.69142 c -1.72774,-4.50242 -48.90739,-104.29155 -49.17964,-104.0193 -0.17216,0.17216 -1.86133,5.69128 -3.75372,12.26472 -9.1482,31.7774 -23.8519,56.67736 -47.36,80.2017 l -13.24085,13.25 57.09273,0 c 53.28548,0 57.0493,-0.11317 56.44148,-1.69712 z m 174.03642,-24.13031 c 9.67707,-6.83308 23.23875,-19.85117 29.70007,-28.5096 4.92178,-6.5954 7.40932,-10.50299 14.9332,-23.45811 3.50501,-6.03515 10.24269,-27.18409 12.22861,-38.38446 1.34344,-7.57683 1.53846,-29.30278 1.53494,-171 -0.005,-190.66548 0.89819,-174.17704 -11.40038,-208.18507 -1.36538,-3.77556 -3.57264,-8.50056 -4.90502,-10.5 -1.33237,-1.99943 -5.0297,-7.68533 -8.21628,-12.63533 -8.84398,-13.73816 -28.43915,-32.45681 -41.64279,-39.78005 -2.56767,-1.42413 -6.46548,-3.89105 -8.66179,-5.48206 -6.09442,-4.41477 -29.52294,-11.8278 -43.50311,-13.76484 -6.50837,-0.90177 -11.98099,-1.48962 -12.16138,-1.30632 -0.18039,0.1833 15.65972,26.65827 35.20025,58.83327 19.54053,32.175 35.73073,59.01542 35.97822,59.64537 0.25717,0.65458 -6.75598,5.11354 -16.36685,10.40605 -34.79416,19.16044 -60.68963,36.43248 -72.84234,48.58519 -3.55347,3.55347 -6.73422,7.55003 -7.06833,8.88123 -1.26091,5.02387 5.71604,12.59286 28.3628,30.76959 46.47703,37.30334 76.31878,71.87799 95.68498,110.86059 22.10912,44.50391 26.82904,90.52331 14.08298,137.30983 -8.53613,31.33328 -26.21467,60.69789 -53.50254,88.86941 L 587.5,679.26754 l 9,-4.54109 c 4.95,-2.49761 12.19462,-6.79685 16.09915,-9.55388 z M 415.24317,565.6208 C 428.03443,559.36224 442.1,551.8768 446.5,548.98649 c 9.03295,-5.93364 21.12934,-17.66149 22.06609,-21.39381 1.33945,-5.33676 -9.87876,-20.50576 -25.63756,-34.6665 -4.63569,-4.1656 -14.19797,-12.19677 -21.24951,-17.84706 -7.05154,-5.65028 -15.60154,-12.75516 -19,-15.78862 l -6.17902,-5.51538 -0.62163,44.36244 c -0.57748,41.21174 -1.5301,58.48008 -3.92183,71.09158 -1.06768,5.62987 -1.19534,7.77086 -0.46337,7.77086 0.27125,0 10.95875,-5.12064 23.75,-11.3792 z M 149.1158,451.01858 c 29.36131,-2.18978 55.7467,-4.24716 58.6342,-4.57196 l 5.25,-0.59053 0,-162.24012 0,-162.24011 87.25,9.78073 c 47.9875,5.3794 89.08201,9.79483 91.32113,9.81207 3.76879,0.029 4.707,-0.58897 12.63308,-8.32122 4.70907,-4.5939 11.79402,-11.13431 15.74433,-14.53424 l 7.18239,-6.18169 -107.31547,0.30366 -107.31546,0.30365 -11.24038,2.69496 c -26.87597,6.4437 -48.95246,18.56516 -68.58376,37.65706 -7.77412,7.56051 -17.80325,20.41102 -21.15724,27.10916 -0.96391,1.925 -2.55038,4.4 -3.52548,5.5 -1.9946,2.25007 -6.48446,12.66903 -8.423045,19.54613 -0.70483,2.50037 -1.841999,5.59341 -2.527043,6.87343 -0.685043,1.28001 -2.089633,8.00925 -3.12131,14.95387 -1.743411,11.73556 -1.877399,20.23005 -1.89876,120.37657 -0.02229,104.50828 0.03315,107.75 1.842822,107.75 1.026192,0 25.888696,-1.79164 55.249996,-3.98142 z"
+       id="path3290"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#121212"
+       d="m 459.5,733.48621 -8,-17.44119 -87,0.22749 -87,0.22749 -8.5,2.68245 c -31.1972,9.84527 -73.86436,9.54514 -105.5,-0.74212 C 142.62449,711.65205 122.63811,699.4291 105.68586,683.08328 74.736385,653.24097 57.325776,618.30134 49.086683,569.5 45.766884,549.83635 45.010539,538.44256 44.334193,497.90715 l -0.643934,-38.59285 4.794442,-0.65715 C 51.121644,458.29572 54.960085,458 57.014571,458 c 2.054486,0 5.126853,-0.27828 6.827483,-0.61841 L 66.934108,456.76318 67.237526,345.63159 67.540944,234.5 69.86749,222 C 73.168586,204.26397 80.619751,183.41494 87.797486,171.83025 98.040151,155.29883 102.40608,149.54906 112.95289,138.70155 123.99696,127.3426 138.68847,115.2446 146,111.48827 c 1.925,-0.98897 4.625,-2.60615 6,-3.59374 4.85768,-3.48898 30.63496,-13.148555 41.5,-15.55138 24.92167,-5.511473 19.82067,-5.328465 148.73239,-5.336078 L 461.96477,87 l 6.26762,-3.808432 c 3.44718,-2.094638 13.87088,-8.016798 23.16377,-13.160357 15.10795,-8.362162 17.02388,-9.177253 18.10297,-7.701509 0.66375,0.907729 4.29064,6.765141 8.05975,13.016471 l 6.85294,11.366054 12.04409,0.616489 c 28.30365,1.44875 58.70234,9.917166 75.72759,21.096064 2.57593,1.69137 8.10413,5.2695 12.28489,7.95139 4.18076,2.6819 13.28583,10.3319 20.23349,17 12.56914,12.06339 19.8164,20.84453 26.36444,31.94444 1.88852,3.20134 4.90245,8.32297 6.69761,11.38142 1.79516,3.05844 3.53538,6.73917 3.86715,8.17939 0.33177,1.44022 1.64294,5.09358 2.9137,8.11858 2.71472,6.46227 6.10199,17.83376 7.00005,23.5 0.34868,2.2 1.38124,7.6 2.29457,12 1.50867,7.26807 1.6606,23.18759 1.6606,174 l 0,166 -2.37753,12.5 c -4.80892,25.28317 -15.27006,49.06403 -30.45398,69.22977 -6.84406,9.08958 -24.75084,26.61548 -34.70618,33.96799 -14.95858,11.04763 -41.46295,23.06148 -57.96231,26.27303 -4.675,0.90998 -9.85,2.06604 -11.5,2.56902 -1.65,0.50299 -6.93162,1.35391 -11.73693,1.89095 -7.86799,0.87931 -9.5952,1.48336 -17.36651,6.07353 -11.47386,6.77709 -29.6482,15.8609 -47.30593,23.64423 -7.92516,3.49331 -14.45016,6.33514 -14.5,6.31518 -0.0498,-0.02 -3.69063,-7.88484 -8.09063,-17.47749 z m 45.18984,-36.48277 c 30.22222,-15.51386 50.39225,-29.76473 71.16236,-50.27884 26.56248,-26.23508 42.08469,-53.61949 49.35746,-87.07684 1.88053,-8.65112 2.2121,-13.31869 2.2481,-31.64776 0.0372,-18.93248 -0.23437,-22.73524 -2.27407,-31.84372 C 613.8857,445.70391 582.95812,402.72683 523.5,354.85625 c -34.89653,-28.0957 -47.15338,-47.41571 -41.05203,-64.70877 5.87662,-16.65613 33.20836,-40.32087 74.32699,-64.3548 9.86716,-5.76737 10.24572,-6.11341 8.92462,-8.15777 -0.75879,-1.1742 -15.35622,-25.13926 -32.43874,-53.25568 -17.08251,-28.11643 -31.77096,-51.96643 -32.64099,-53 -0.87003,-1.03358 -2.17911,-2.7108 -2.90906,-3.72716 -1.25927,-1.75338 -1.7847,-1.60599 -10.26898,2.88059 -18.15817,9.60223 -40.16175,26.45889 -61.3081,46.96734 -12.37081,11.99764 -28.44535,29.95027 -29.99544,33.5 -0.36026,0.825 -4.10145,6.675 -8.31375,13 -8.14125,12.22454 -17.05242,29.29075 -20.88611,40 -1.27978,3.575 -2.67315,6.74148 -3.09639,7.03662 -1.24787,0.87017 -5.57793,20.014 -6.89672,30.4914 -1.85214,14.71464 -0.71273,39.25698 2.45071,52.78702 1.39076,5.94827 3.4166,12.69827 4.50188,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.27857 5.85092,8.84939 0,2.47492 31.73368,32.50269 48,45.41966 42.97648,34.1273 61.77908,60.25262 57.98752,80.57088 -3.50997,18.80924 -23.27485,37.69791 -58.48752,55.89466 -6.6,3.41066 -12.14116,6.56904 -12.3137,7.01862 -0.36133,0.94156 43.71522,95.17679 44.87445,95.9411 0.42197,0.27822 2.35533,3.99072 4.29635,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.42811,-4.49845 20.13886,-9.99656 z M 237,691.43296 c 26.99694,-1.70501 54.46666,-14.3292 75.86479,-34.86497 26.27503,-25.21615 41.13286,-54.63411 48.77964,-96.58193 1.49746,-8.21461 1.77902,-18.36138 2.10067,-75.70315 l 0.37143,-66.2171 -7.15484,-10.7829 C 318.32805,349.05899 313.45806,279.6142 343.55966,216.17314 c 5.15481,-10.86411 17.79493,-32.65622 19.58243,-33.76095 0.73385,-0.45355 1.30989,-11.31719 0.60791,-11.46473 -0.1375,-0.0289 -26.35,-3.08503 -58.25,-6.79139 l -58,-6.73884 -0.56363,190.54139 c -0.61113,206.59757 -0.27328,194.4495 -5.85113,210.39247 -3.33503,9.5324 -10.3568,19.218 -16.01009,22.08379 -3.79109,1.9218 -11.01317,2.67097 -15.57515,1.61566 C 195.75426,578.87079 188.03852,549.14177 188.01032,499.25 L 188,481 l -4.25,0.0435 c -3.82421,0.0391 -79.99637,6.00707 -98.918642,7.75014 -4.217754,0.38852 -7.963823,1.00248 -8.324599,1.36434 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 18.15565,12.19476 37.80289,18.89959 61.58445,21.01635 8.70251,0.7746 12.10389,0.71457 32.5,-0.57357 z m 201.54494,-2.17643 c -1.75564,-4.57514 -48.88138,-104.25343 -49.15798,-103.97682 -0.17429,0.17428 -1.8652,5.69515 -3.75759,12.26859 -9.1482,31.7774 -23.8519,56.67736 -47.36,80.2017 l -13.24085,13.25 57.09273,0 c 53.88175,0 57.0551,-0.0981 56.42369,-1.74347 z m 162.98415,-17.04472 c 14.75511,-7.96595 35.32049,-26.62289 43.82549,-39.75856 12.96439,-20.02302 13.52837,-21.11614 18.03363,-34.95325 8.1385,-24.99601 7.61228,-11.59942 7.60776,-193.6796 -0.005,-190.66548 0.89819,-174.17704 -11.40038,-208.18507 -1.36538,-3.77556 -3.57264,-8.50056 -4.90502,-10.5 -1.33237,-1.99943 -5.00558,-7.62176 -8.16269,-12.49407 -9.13721,-14.1013 -27.30839,-31.72464 -40.52788,-39.306 -2.475,-1.41941 -6.75,-4.0787 -9.5,-5.90953 -7.70932,-5.13251 -28.81354,-11.88011 -43.37452,-13.86801 -6.78306,-0.92604 -12.47693,-1.5396 -12.65306,-1.36347 -0.17613,0.17613 15.67382,26.64197 35.22212,58.81299 19.5483,32.17102 35.73916,58.99522 35.97969,59.60933 0.24177,0.61724 -7.97255,5.78978 -18.36844,11.56657 -35.59403,19.7789 -59.30024,35.70409 -71.31689,47.90876 -3.2981,3.3497 -6.26512,7.16045 -6.59337,8.46834 -1.24904,4.97654 5.79637,12.6064 28.37344,30.72719 73.98669,59.38311 111.19665,118.40399 116.24189,184.37797 0.96088,12.56489 0.0242,32.99883 -2.04727,44.66244 -7.10343,39.99633 -25.74156,74.77418 -57.8133,107.87679 -13.35197,13.78114 -13.31544,13.94027 1.3788,6.00718 z M 414.39125,566.09635 c 12.37855,-5.99701 26.24198,-13.3399 30.80761,-16.31753 9.94059,-6.48309 19.68705,-15.2949 22.31538,-20.17541 1.89367,-3.51633 1.89207,-3.58722 -0.17644,-7.82594 -5.59728,-11.46971 -18.64092,-24.91374 -43.79474,-45.13904 C 415.26938,469.98585 405.8,462.0628 402.5,459.03165 l -6,-5.51117 -0.63778,44.98976 c -0.59537,41.99854 -1.51652,57.35268 -4.48391,74.73976 -0.352,2.0625 -0.38204,3.75 -0.0668,3.75 0.31528,0 10.70114,-4.90664 23.0797,-10.90365 z M 149.28709,451.02144 c 29.2671,-2.18822 55.57541,-4.2456 58.46291,-4.57196 l 5.25,-0.59339 0,-162.23424 0,-162.23424 87.25,9.7776 c 47.9875,5.37768 89.09832,9.79047 91.35737,9.80619 3.76705,0.0262 4.71997,-0.57211 11.50081,-7.2214 4.0664,-3.9875 11.12591,-10.5279 15.68782,-14.53422 l 8.29437,-7.28423 -107.29518,0.30364 -107.29519,0.30363 -11.24038,2.69496 c -26.87597,6.4437 -48.95246,18.56516 -68.58376,37.65706 -7.77412,7.56051 -17.80325,20.41102 -21.15724,27.10916 -0.96391,1.925 -2.55038,4.4 -3.52548,5.5 -1.9946,2.25007 -6.48446,12.66903 -8.423045,19.54613 -0.70483,2.50037 -1.841999,5.59341 -2.527043,6.87343 -0.685043,1.28001 -2.089633,8.00925 -3.12131,14.95387 -1.743411,11.73556 -1.877399,20.23005 -1.89876,120.37657 -0.02298,107.74476 -0.02288,107.75 2.014106,107.75 1.120398,0 25.982902,-1.79035 55.250002,-3.97856 z"
+       id="path3288"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#181307"
+       d="m 459.55781,733.70878 c -4.36821,-9.46483 -8.07667,-17.39224 -8.24102,-17.61646 -0.16435,-0.22423 -38.67577,-0.38154 -85.58094,-0.34959 l -85.28212,0.0581 -9.97686,3.0589 c -20.06874,6.15306 -42.93497,8.58413 -66.25419,7.04395 C 164.82553,723.30159 133.08579,709.5028 105.65144,683.05004 66.874631,645.66062 48.408091,598.53179 44.994898,528.24725 43.54786,498.44982 43.693084,459.00876 45.25,458.96433 c 4.77325,-0.13623 21.009593,-1.89059 21.435101,-2.3161 0.288215,-0.28821 0.627035,-50.38947 0.752934,-111.33613 C 67.665822,235.04252 67.678024,234.4388 69.93049,222 74.39676,197.33589 85.06113,173.05079 100.33151,152.77023 110.35141,139.46282 135.09434,117.0973 146,111.48978 c 1.925,-0.9898 4.625,-2.60766 6,-3.59525 4.88736,-3.5103 30.62837,-13.146922 41.5,-15.536291 23.87409,-5.24705 19.73962,-5.104171 148,-5.114617 l 120,-0.0098 7.5,-4.445207 C 479.2667,76.703629 507.55711,61 508.25268,61 c 0.31078,0 4.04561,5.7375 8.29964,12.75 4.25403,7.0125 7.81371,12.856161 7.91039,12.985914 0.0967,0.129753 5.04835,0.454866 11.0037,0.722474 36.64371,1.646608 63.06099,10.586661 93.07339,31.497602 6.5992,4.59795 31.48207,29.38523 35.09668,34.96184 C 674.6703,170.9408 682,183.78283 682,186.09171 c 0,0.63701 1.09243,3.68947 2.42763,6.78324 3.10192,7.18745 6.20835,17.83394 7.62274,26.12505 3.60283,21.11952 3.61032,21.52583 3.4568,187.5 l -0.15077,163 -2.24471,11.5 c -5.01021,25.66807 -15.35329,49.18889 -30.4432,69.22977 -6.86133,9.11252 -24.78854,26.65085 -34.66849,33.91645 -15.04396,11.06317 -41.6623,23.14448 -58,26.32457 -4.675,0.90998 -9.85,2.05696 -11.5,2.54886 -1.65,0.4919 -6.86492,1.30342 -11.5887,1.80339 -7.77642,0.82307 -9.41887,1.39938 -17.36651,6.0937 -11.38098,6.72223 -28.82867,15.44758 -47.15915,23.58365 -8.05395,3.57479 -14.69802,6.48106 -14.76459,6.45839 -0.0666,-0.0227 -3.69504,-7.78517 -8.06324,-17.25 z m 45.13203,-36.70534 c 30.22222,-15.51386 50.39225,-29.76473 71.16236,-50.27884 26.56248,-26.23508 42.08469,-53.61949 49.35746,-87.07684 1.88053,-8.65112 2.2121,-13.31869 2.2481,-31.64776 0.0372,-18.93248 -0.23437,-22.73524 -2.27407,-31.84372 C 613.8857,445.70391 582.95812,402.72683 523.5,354.85625 c -34.89653,-28.0957 -47.15338,-47.41571 -41.05203,-64.70877 5.87662,-16.65613 33.20836,-40.32087 74.32699,-64.3548 9.86716,-5.76737 10.24572,-6.11341 8.92462,-8.15777 -0.75879,-1.1742 -15.35622,-25.13926 -32.43874,-53.25568 -17.08251,-28.11643 -31.77096,-51.96643 -32.64099,-53 -0.87003,-1.03358 -2.17911,-2.7108 -2.90906,-3.72716 -1.25927,-1.75338 -1.7847,-1.60599 -10.26898,2.88059 -18.15817,9.60223 -40.16175,26.45889 -61.3081,46.96734 -12.37081,11.99764 -28.44535,29.95027 -29.99544,33.5 -0.36026,0.825 -4.10145,6.675 -8.31375,13 -8.14125,12.22454 -17.05242,29.29075 -20.88611,40 -1.27978,3.575 -2.67315,6.74148 -3.09639,7.03662 -1.24787,0.87017 -5.57793,20.014 -6.89672,30.4914 -1.85214,14.71464 -0.71273,39.25698 2.45071,52.78702 1.39076,5.94827 3.4166,12.69827 4.50188,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.27857 5.85092,8.84939 0,2.47492 31.73368,32.50269 48,45.41966 42.97648,34.1273 61.77908,60.25262 57.98752,80.57088 -3.50997,18.80924 -23.27485,37.69791 -58.48752,55.89466 -6.6,3.41066 -12.14116,6.56904 -12.3137,7.01862 -0.36133,0.94156 43.71522,95.17679 44.87445,95.9411 0.42197,0.27822 2.35533,3.99072 4.29635,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.42811,-4.49845 20.13886,-9.99656 z M 237,691.43296 c 26.99694,-1.70501 54.46666,-14.3292 75.86479,-34.86497 26.27503,-25.21615 41.13286,-54.63411 48.77964,-96.58193 1.49746,-8.21461 1.77902,-18.36138 2.10067,-75.70315 l 0.37143,-66.2171 -7.15484,-10.7829 C 327.65632,363.11744 317.44208,311.23857 328.16056,261 c 4.77926,-22.40082 16.61711,-50.53708 29.79077,-70.80684 5.32728,-8.19687 6.04867,-9.89638 6.04867,-14.25 0,-2.71874 -0.1125,-4.96681 -0.25,-4.9957 -0.1375,-0.0289 -26.35,-3.08503 -58.25,-6.79139 l -58,-6.73884 -0.56363,190.54139 c -0.61113,206.59757 -0.27328,194.4495 -5.85113,210.39247 -3.33503,9.5324 -10.3568,19.218 -16.01009,22.08379 -3.79109,1.9218 -11.01317,2.67097 -15.57515,1.61566 C 195.75426,578.87079 188.03852,549.14177 188.01032,499.25 L 188,481 l -4.25,0.0435 c -3.82421,0.0391 -79.99637,6.00707 -98.918642,7.75014 -4.217754,0.38852 -7.963823,1.00248 -8.324599,1.36434 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 18.15565,12.19476 37.80289,18.89959 61.58445,21.01635 8.70251,0.7746 12.10389,0.71457 32.5,-0.57357 z m 201.61972,-0.71935 c 0.28246,-0.28246 -10.60771,-24.19229 -24.20037,-53.13296 -13.59266,-28.94068 -24.85688,-52.47646 -25.0316,-52.30173 -0.17472,0.17472 -1.86599,5.69594 -3.75838,12.26938 -9.13925,31.7463 -23.85592,56.68114 -47.30059,80.14256 -8.83827,8.84459 -12.65317,13.29272 -11.57816,13.5 2.74389,0.52907 111.32602,0.0658 111.8691,-0.47725 z m 162.90937,-18.5018 c 14.75511,-7.96595 35.32049,-26.62289 43.82549,-39.75856 12.95897,-20.01464 13.53015,-21.12138 18.03886,-34.95325 8.42878,-25.85783 7.89012,-12.52292 7.83606,-193.98919 -0.0476,-159.69165 -0.0655,-161.11732 -2.188,-174.01081 -1.17702,-7.15 -3.22529,-16.15 -4.55171,-20 -5.4562,-15.83684 -7.49574,-20.90795 -9.79922,-24.36467 -1.33237,-1.99943 -5.00558,-7.62176 -8.16269,-12.49407 -9.13721,-14.1013 -27.30839,-31.72464 -40.52788,-39.306 -2.475,-1.41941 -6.75,-4.0787 -9.5,-5.90953 -7.70932,-5.13251 -28.81354,-11.88011 -43.37452,-13.86801 -6.78306,-0.92604 -12.47693,-1.5396 -12.65306,-1.36347 -0.17613,0.17613 15.67382,26.64197 35.22212,58.81299 19.5483,32.17102 35.73916,58.99522 35.97969,59.60933 0.24177,0.61724 -7.97255,5.78978 -18.36844,11.56657 -35.59403,19.7789 -59.30024,35.70409 -71.31689,47.90876 -3.2981,3.3497 -6.26512,7.16045 -6.59337,8.46834 -1.24904,4.97654 5.79637,12.6064 28.37344,30.72719 73.98669,59.38311 111.19665,118.40399 116.24189,184.37797 0.96088,12.56489 0.0242,32.99883 -2.04727,44.66244 -7.10343,39.99633 -25.74156,74.77418 -57.8133,107.87679 -13.35197,13.78114 -13.31544,13.94027 1.3788,6.00718 z M 414.39125,566.09635 c 12.37855,-5.99701 26.24198,-13.3399 30.80761,-16.31753 9.94059,-6.48309 19.68705,-15.2949 22.31538,-20.17541 1.89367,-3.51633 1.89207,-3.58722 -0.17644,-7.82594 -5.59728,-11.46971 -18.64092,-24.91374 -43.79474,-45.13904 C 415.26938,469.98585 405.8,462.0628 402.5,459.03165 l -6,-5.51117 -0.63778,44.98976 c -0.59537,41.99854 -1.51652,57.35268 -4.48391,74.73976 -0.352,2.0625 -0.38204,3.75 -0.0668,3.75 0.31528,0 10.70114,-4.90664 23.0797,-10.90365 z M 149.28709,451.02144 c 29.2671,-2.18822 55.57541,-4.2456 58.46291,-4.57196 l 5.25,-0.59339 0,-162.23424 0,-162.23424 87.25,9.7776 c 47.9875,5.37768 89.09832,9.79047 91.35737,9.80619 3.76705,0.0262 4.71997,-0.57211 11.50081,-7.2214 4.0664,-3.9875 11.10843,-10.5125 15.64898,-14.5 4.54054,-3.9875 7.69018,-7.29127 6.99919,-7.3417 -6.39603,-0.46687 -201.96145,0.13955 -207.25635,0.64267 -31.87086,3.02836 -62.03901,17.20827 -85.82414,40.33987 -7.77412,7.56051 -17.80325,20.41102 -21.15724,27.10916 -0.96391,1.925 -2.55038,4.4 -3.52548,5.5 -1.9946,2.25007 -6.48446,12.66903 -8.423045,19.54613 -0.70483,2.50037 -1.846216,5.60129 -2.536414,6.89094 -0.690197,1.28964 -2.125813,8.01888 -3.190258,14.95387 -1.814414,11.82112 -1.936938,18.79555 -1.960707,111.60906 -0.0334,130.41361 -0.290696,116.5 2.154372,116.5 1.120398,0 25.982902,-1.79035 55.250002,-3.97856 z"
+       id="path3286"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#101010"
+       d="m 459.55781,733.70878 c -4.36821,-9.46483 -8.07667,-17.39224 -8.24102,-17.61646 -0.16435,-0.22423 -38.67577,-0.38154 -85.58094,-0.34959 l -85.28212,0.0581 -9.97686,3.0589 c -20.06874,6.15306 -42.93497,8.58413 -66.25419,7.04395 C 164.82553,723.30159 133.08579,709.5028 105.65144,683.05004 66.874631,645.66062 48.408091,598.53179 44.994898,528.24725 43.54786,498.44982 43.693084,459.00876 45.25,458.96433 c 4.77325,-0.13623 21.009593,-1.89059 21.435101,-2.3161 0.288215,-0.28821 0.627035,-50.38947 0.752934,-111.33613 C 67.665822,235.04252 67.678024,234.4388 69.93049,222 74.39676,197.33589 85.06113,173.05079 100.33151,152.77023 110.35141,139.46282 135.09434,117.0973 146,111.48978 c 1.925,-0.9898 4.625,-2.60766 6,-3.59525 4.88736,-3.5103 30.62837,-13.146922 41.5,-15.536291 23.87409,-5.24705 19.73962,-5.104171 148,-5.114617 l 120,-0.0098 7.5,-4.445207 C 479.2667,76.703629 507.55711,61 508.25268,61 c 0.31078,0 4.04561,5.7375 8.29964,12.75 4.25403,7.0125 7.81371,12.856161 7.91039,12.985914 0.0967,0.129753 5.04835,0.454866 11.0037,0.722474 36.64371,1.646608 63.06099,10.586661 93.07339,31.497602 6.5992,4.59795 31.48207,29.38523 35.09668,34.96184 C 674.6703,170.9408 682,183.78283 682,186.09171 c 0,0.63701 1.09243,3.68947 2.42763,6.78324 3.10192,7.18745 6.20835,17.83394 7.62274,26.12505 3.60283,21.11952 3.61032,21.52583 3.4568,187.5 l -0.15077,163 -2.24471,11.5 c -5.01021,25.66807 -15.35329,49.18889 -30.4432,69.22977 -6.86133,9.11252 -24.78854,26.65085 -34.66849,33.91645 -15.04396,11.06317 -41.6623,23.14448 -58,26.32457 -4.675,0.90998 -9.85,2.05696 -11.5,2.54886 -1.65,0.4919 -6.86492,1.30342 -11.5887,1.80339 -7.77642,0.82307 -9.41887,1.39938 -17.36651,6.0937 -11.38098,6.72223 -28.82867,15.44758 -47.15915,23.58365 -8.05395,3.57479 -14.69802,6.48106 -14.76459,6.45839 -0.0666,-0.0227 -3.69504,-7.78517 -8.06324,-17.25 z m 45.30007,-36.77872 c 29.97748,-15.36857 50.23483,-29.68903 71.00725,-50.19692 26.50772,-26.17016 42.07537,-53.64463 49.34453,-87.08538 1.88053,-8.65112 2.2121,-13.31869 2.2481,-31.64776 0.0372,-18.93248 -0.23437,-22.73524 -2.27407,-31.84372 C 613.85575,445.57017 583.12482,402.86668 523.5,354.85732 488.39489,326.591 475.98988,306.81379 482.67493,289.77024 c 6.73294,-17.16563 30.88367,-38.18599 72.06009,-62.71979 6.72927,-4.00944 12.06343,-7.57352 11.85371,-7.92017 -26.45085,-43.7198 -64.81203,-106.37663 -65.97206,-107.75476 -0.86828,-1.03154 -2.17593,-2.70709 -2.90588,-3.72345 -1.25927,-1.75338 -1.7847,-1.60599 -10.26898,2.88059 -18.10787,9.57563 -40.18355,26.47555 -61.10784,46.78079 -13.39706,13.0007 -26.56777,27.56211 -29.37977,32.48201 -0.85019,1.4875 -4.97539,7.87954 -9.16711,14.20454 -8.13125,12.26948 -17.04124,29.36405 -20.84868,40 -1.27978,3.575 -2.67315,6.74148 -3.09639,7.03662 -1.24787,0.87017 -5.57793,20.014 -6.89672,30.4914 -1.85214,14.71464 -0.71273,39.25698 2.45071,52.78702 1.39076,5.94827 3.4166,12.69827 4.50188,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.26835 5.85092,8.82666 0,2.50638 31.7772,32.60628 48,45.46641 42.88597,33.99656 61.314,59.51515 57.94495,80.24046 -3.03632,18.67852 -22.88021,37.75233 -58.44495,56.17689 -6.6,3.41917 -12.14474,6.59721 -12.32165,7.0623 -0.36379,0.95641 43.71097,95.13831 44.8889,95.92159 0.4184,0.27822 2.34883,3.99072 4.28985,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.50373,-4.53147 20.3069,-10.06994 z M 237,691.43296 c 29.67374,-1.87407 58.11686,-16.0459 81.44466,-40.57993 22.88861,-24.07213 36.08264,-51.82462 43.19977,-90.86697 1.49746,-8.21461 1.77902,-18.36138 2.10067,-75.70315 l 0.37143,-66.2171 -7.15484,-10.7829 C 327.65632,363.11744 317.44208,311.23857 328.16056,261 c 4.77926,-22.40082 16.61711,-50.53708 29.79077,-70.80684 5.32728,-8.19687 6.04867,-9.89638 6.04867,-14.25 0,-2.71874 -0.1125,-4.96681 -0.25,-4.9957 -0.1375,-0.0289 -26.35,-3.08503 -58.25,-6.79139 l -58,-6.73884 -0.56363,190.54139 c -0.61576,208.16369 -0.22914,195.20379 -6.30357,211.30174 -6.57363,17.42087 -17.74086,25.72163 -30.73045,22.84235 C 195.7501,578.96572 188.03888,549.7818 188.01032,499.25 L 188,481 l -4.25,0.0435 c -3.82421,0.0391 -79.99637,6.00707 -98.918642,7.75014 -4.217754,0.38852 -7.963823,1.00248 -8.324599,1.36434 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.875364,37.44956 15.155874,67.97243 30.741634,91.27203 6.13845,9.17654 23.90326,27.14536 32.63651,33.01129 18.15565,12.19476 37.80289,18.89959 61.58445,21.01635 8.70251,0.7746 12.10389,0.71457 32.5,-0.57357 z m 201.62532,-0.72494 c 0.28553,-0.28554 -10.60425,-24.19576 -24.19951,-53.13383 -13.59527,-28.93807 -24.86201,-52.47133 -25.0372,-52.29613 -0.17519,0.17519 -1.86807,5.6968 -3.76195,12.27024 -9.91705,34.42097 -29.53843,65.79001 -54.6947,87.44135 -5.84565,5.03119 -6.51716,5.92918 -4.63411,6.19707 3.74487,0.53275 111.77641,0.0723 112.32747,-0.4787 z M 600.5,672.79888 c 17.74434,-9.29729 40.41839,-30.98419 49.49957,-47.34454 1.20722,-2.17489 3.70512,-6.24887 5.55088,-9.05329 3.90771,-5.93731 11.87309,-28.41168 12.90127,-36.40105 0.38931,-3.025 1.17652,-7.3 1.74938,-9.5 1.50631,-5.78488 1.39877,-324.31826 -0.11294,-334.5 -2.01915,-13.5995 -3.89714,-22.4237 -5.95905,-28 -1.11853,-3.025 -3.11838,-8.48512 -4.44412,-12.13359 -2.27269,-6.25453 -4.62501,-10.42791 -14.18499,-25.16635 -7.54872,-11.63772 -27.4256,-30.44015 -39.5,-37.3648 -2.475,-1.41941 -6.75,-4.0787 -9.5,-5.90953 -7.56474,-5.03626 -28.73695,-11.83437 -43.30337,-13.90412 -6.76686,-0.96151 -12.46839,-1.58318 -12.67008,-1.3815 -0.20168,0.20169 15.62085,26.69017 35.16119,58.8633 19.54034,32.17312 35.72947,58.99905 35.97586,59.61316 0.24928,0.62132 -7.8932,5.75159 -18.35781,11.56657 -35.59403,19.7789 -59.30024,35.70409 -71.31689,47.90876 -3.2981,3.3497 -6.26512,7.16045 -6.59337,8.46834 -1.25043,4.98207 5.79213,12.60284 28.46097,30.7977 46.24231,37.11581 76.30526,71.95645 95.59745,110.79008 27.34521,55.04373 28.07773,114.76002 2.06512,168.35198 -10.52409,21.68205 -22.44727,38.18678 -42.47352,58.79424 -12.26705,12.62308 -12.25056,12.68548 1.45445,5.50464 z M 414.40524,566.11149 c 12.34531,-5.98869 26.19199,-13.33157 30.77039,-16.31753 9.96154,-6.49674 19.7082,-15.30617 22.33861,-20.19055 1.89367,-3.51633 1.89207,-3.58722 -0.17644,-7.82594 C 461.73604,510.29859 448.77535,496.90678 424,476.99812 415.475,470.14771 405.8,462.0628 402.5,459.03165 l -6,-5.51117 -0.63778,44.98976 c -0.59537,41.99854 -1.51652,57.35268 -4.48391,74.73976 -0.352,2.0625 -0.36529,3.75 -0.0295,3.75 0.33575,0 10.71116,-4.89983 23.05647,-10.88851 z M 149.28709,451.02144 c 29.2671,-2.18822 55.57541,-4.2456 58.46291,-4.57196 l 5.25,-0.59339 0,-162.23446 0,-162.23445 87.25,9.78361 c 47.9875,5.38099 89.14073,9.79387 91.45161,9.80641 3.8908,0.0211 4.74151,-0.51421 11.5,-7.23652 4.01412,-3.99262 11.01375,-10.51762 15.55474,-14.5 4.54099,-3.98237 7.69099,-7.28221 7,-7.33297 -6.31511,-0.46388 -205.47191,0.15971 -209.25635,0.65522 -32.50693,4.25622 -60.66093,17.80114 -83.82414,40.32791 -7.77412,7.56051 -17.80325,20.41102 -21.15724,27.10916 -0.96391,1.925 -2.55038,4.4 -3.52548,5.5 -1.9946,2.25007 -6.48446,12.66903 -8.423045,19.54613 -0.70483,2.50037 -1.846216,5.60129 -2.536414,6.89094 -0.690197,1.28964 -2.125813,8.01888 -3.190258,14.95387 -1.814414,11.82112 -1.936938,18.79555 -1.960707,111.60906 -0.0334,130.41361 -0.290696,116.5 2.154372,116.5 1.120398,0 25.982902,-1.79035 55.250002,-3.97856 z"
+       id="path3284"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#151106"
+       d="M 459.9341,734.36226 C 455.57035,725.24099 452,717.38662 452,716.90811 c 0,-0.4785 -1.0125,-1.09021 -2.25,-1.35936 -1.2375,-0.26914 -39.825,-0.39022 -85.75,-0.26905 l -83.5,0.2203 -10,3.20931 c -13.07642,4.19662 -24.66515,6.2567 -40.654,7.22688 -50.31182,3.05286 -91.19079,-11.06324 -124.19456,-42.88616 C 66.815681,645.60378 48.279913,598.12588 44.986667,527.66202 43.556044,497.05174 43.701872,459.00851 45.25,458.96433 c 4.887839,-0.1395 20.803325,-1.87925 21.579394,-2.35889 0.600096,-0.37088 0.955125,-41.02555 0.95168,-108.97768 -0.003,-59.61236 0.320053,-111.25298 0.717945,-114.75693 3.376821,-29.73729 13.889397,-56.06165 32.143251,-80.48934 9.5778,-12.81722 34.56017,-35.33977 45.35773,-40.89171 1.925,-0.9898 4.625,-2.61424 6,-3.60986 1.375,-0.99562 9.25,-4.49023 17.5,-7.76581 11.39375,-4.523777 18.81231,-6.724132 30.8571,-9.152257 L 216.2142,87.765199 338.8571,87.6326 461.5,87.5 469,82.91573 C 477.3077,77.837763 507.54367,61 508.35459,61 c 0.28289,0 3.96932,5.7375 8.19206,12.75 4.22275,7.0125 8.09278,13.011167 8.60008,13.33037 0.50731,0.319204 5.74432,0.674344 11.63782,0.789202 33.46627,0.652219 61.42616,10.128596 91.71994,31.086418 6.58409,4.555 31.48509,29.3354 35.13199,34.96184 C 674.6703,170.9408 682,183.78283 682,186.09171 c 0,0.63701 1.06837,3.68947 2.37414,6.78324 3.20962,7.60452 6.38296,18.3493 7.56804,25.62505 0.53752,3.3 1.48274,8.925 2.1005,12.5 0.80026,4.63118 1.12276,54.08313 1.12168,172 l -0.002,165.5 -2.17489,12 c -4.64922,25.65204 -14.92476,49.28411 -30.31946,69.72977 -6.86133,9.11252 -24.78854,26.65085 -34.66849,33.91645 -11.53456,8.48239 -29.82551,17.68291 -46.5,23.38995 -5.57199,1.90708 -26.48477,6.20456 -35.53802,7.3029 -6.60245,0.80101 -8.88995,1.6933 -18.43055,7.18918 -11.17121,6.4352 -33.80545,17.60304 -50.34733,24.8416 l -9.31589,4.07655 -7.93411,-16.58414 z m 44.92378,-37.4322 c 29.97748,-15.36857 50.23483,-29.68903 71.00725,-50.19692 26.50772,-26.17016 42.07537,-53.64463 49.34453,-87.08538 1.88053,-8.65112 2.2121,-13.31869 2.2481,-31.64776 0.0372,-18.93248 -0.23437,-22.73524 -2.27407,-31.84372 C 613.85575,445.57017 583.12482,402.86668 523.5,354.85732 488.39489,326.591 475.98988,306.81379 482.67493,289.77024 c 6.73294,-17.16563 30.88367,-38.18599 72.06009,-62.71979 6.72927,-4.00944 12.06343,-7.57352 11.85371,-7.92017 -26.45085,-43.7198 -64.81203,-106.37663 -65.97206,-107.75476 -0.86828,-1.03154 -2.17593,-2.70709 -2.90588,-3.72345 -1.25927,-1.75338 -1.7847,-1.60599 -10.26898,2.88059 -18.10787,9.57563 -40.18355,26.47555 -61.10784,46.78079 -13.37525,12.97953 -26.55137,27.54348 -29.38673,32.48201 -0.85402,1.4875 -5.22129,8.26613 -9.70505,15.06363 -8.45707,12.82116 -16.29241,27.92483 -20.30516,39.14091 -1.27902,3.575 -2.67177,6.74148 -3.09501,7.03662 -1.24787,0.87017 -5.57793,20.014 -6.89672,30.4914 -1.85214,14.71464 -0.71273,39.25698 2.45071,52.78702 1.39076,5.94827 3.4166,12.69827 4.50188,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.26835 5.85092,8.82666 0,2.50638 31.7772,32.60628 48,45.46641 42.88597,33.99656 61.314,59.51515 57.94495,80.24046 -3.03632,18.67852 -22.88021,37.75233 -58.44495,56.17689 -6.6,3.41917 -12.14474,6.59721 -12.32165,7.0623 -0.36379,0.95641 43.71097,95.13831 44.8889,95.92159 0.4184,0.27822 2.34883,3.99072 4.28985,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.50373,-4.53147 20.3069,-10.06994 z M 237,691.43296 c 29.67374,-1.87407 58.11686,-16.0459 81.44466,-40.57993 22.88861,-24.07213 36.08264,-51.82462 43.19977,-90.86697 1.49763,-8.21551 1.77902,-18.36617 2.1009,-75.786 l 0.37166,-66.29994 -7.11833,-10.67994 C 333.90965,372.5787 322.77212,333.83059 324.31158,293.5 c 0.31492,-8.25 1.28271,-19.05 2.15066,-24 4.75586,-27.12305 16.26865,-55.87396 32.14847,-80.28441 4.68326,-7.1991 5.38929,-8.93494 5.38929,-13.25 0,-2.73107 -0.1125,-4.98924 -0.25,-5.01813 -0.1375,-0.0289 -26.35,-3.08503 -58.25,-6.79139 l -58,-6.73884 -0.56363,190.54139 c -0.61576,208.16369 -0.22914,195.20379 -6.30357,211.30174 -6.57363,17.42087 -17.74086,25.72163 -30.73045,22.84235 C 195.7501,578.96572 188.03888,549.7818 188.01032,499.25 L 188,481 l -4.25,0.0435 c -3.82421,0.0391 -79.99637,6.00707 -98.918642,7.75014 -4.217754,0.38852 -7.963823,1.00248 -8.324599,1.36434 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 18.15565,12.19476 37.80289,18.89959 61.58445,21.01635 8.70251,0.7746 12.10389,0.71457 32.5,-0.57357 z m 202,-0.61487 c 0,-1.26355 -49.20736,-105.94407 -49.61139,-105.54003 -0.17519,0.17519 -1.86807,5.6968 -3.76195,12.27024 -9.91221,34.40418 -29.53998,65.79134 -54.66486,87.41566 -3.74352,3.22195 -6.57848,6.08602 -6.29991,6.3646 C 325.62247,692.28914 439,691.78296 439,690.81809 z m 161.5,-18.01921 c 17.74434,-9.29729 40.41839,-30.98419 49.49957,-47.34454 1.20722,-2.17489 3.69671,-6.23621 5.5322,-9.02515 6.82803,-10.37487 13.49798,-33.86832 15.45283,-54.42919 1.13286,-11.91535 0.39409,-320.25937 -0.78228,-326.5 -0.51837,-2.75 -1.4922,-8.30494 -2.16406,-12.34432 -0.67186,-4.03937 -2.28273,-10.33937 -3.57972,-14 -7.31629,-20.64959 -7.0233,-20.05529 -18.95854,-38.45562 -7.54872,-11.63772 -27.4256,-30.44015 -39.5,-37.3648 -2.475,-1.41941 -6.75,-4.0787 -9.5,-5.90953 -7.56474,-5.03626 -28.73695,-11.83437 -43.30337,-13.90412 -6.76686,-0.96151 -12.46839,-1.58318 -12.67008,-1.3815 -0.20168,0.20169 15.62085,26.69017 35.16119,58.8633 19.54034,32.17312 35.72947,58.99905 35.97586,59.61316 0.24928,0.62132 -7.8932,5.75159 -18.35781,11.56657 -35.59403,19.7789 -59.30024,35.70409 -71.31689,47.90876 -3.2981,3.3497 -6.26512,7.16045 -6.59337,8.46834 -1.25043,4.98207 5.79213,12.60284 28.46097,30.7977 46.24231,37.11581 76.30526,71.95645 95.59745,110.79008 27.34521,55.04373 28.07773,114.76002 2.06512,168.35198 -10.52409,21.68205 -22.44727,38.18678 -42.47352,58.79424 -12.26705,12.62308 -12.25056,12.68548 1.45445,5.50464 z M 414.40524,566.11149 c 12.34531,-5.98869 26.19199,-13.33157 30.77039,-16.31753 9.96154,-6.49674 19.7082,-15.30617 22.33861,-20.19055 1.89367,-3.51633 1.89207,-3.58722 -0.17644,-7.82594 C 461.73604,510.29859 448.77535,496.90678 424,476.99812 415.475,470.14771 405.8,462.0628 402.5,459.03165 l -6,-5.51117 -0.63778,44.98976 c -0.59537,41.99854 -1.51652,57.35268 -4.48391,74.73976 -0.352,2.0625 -0.36529,3.75 -0.0295,3.75 0.33575,0 10.71116,-4.89983 23.05647,-10.88851 z M 149.28709,451.02144 c 29.2671,-2.18822 55.57541,-4.2456 58.46291,-4.57196 l 5.25,-0.59339 0,-162.23446 0,-162.23445 87.25,9.78361 c 47.9875,5.38099 89.14073,9.79387 91.45161,9.80641 3.8908,0.0211 4.74151,-0.51421 11.5,-7.23652 4.01412,-3.99262 10.99485,-10.50097 15.51276,-14.463 4.5179,-3.96203 7.81554,-7.45018 7.32808,-7.75144 -1.55243,-0.95946 -206.2497,0.35479 -212.04245,1.36141 -34.56486,6.0064 -58.44562,17.75329 -81.32414,40.00319 -7.77412,7.56051 -17.80325,20.41102 -21.15724,27.10916 -0.96391,1.925 -2.61348,4.44343 -3.66571,5.59651 -1.82409,1.99892 -4.25281,7.55768 -7.6039,17.40349 -0.842377,2.475 -2.189657,6.075 -2.99395,8 -0.804294,1.925 -2.372391,8.9 -3.48466,15.5 -1.928689,11.44449 -2.035722,16.97564 -2.312085,119.48184 -0.159378,59.11501 -0.07614,107.82751 0.18497,108.25 0.668828,1.08219 -1.048225,1.17782 57.643805,-3.2104 z"
+       id="path3282"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#0e0d0d"
+       d="M 459.9341,734.36226 C 455.57035,725.24099 452,717.38662 452,716.90811 c 0,-0.4785 -1.0125,-1.09021 -2.25,-1.35936 -1.2375,-0.26914 -39.825,-0.39022 -85.75,-0.26905 l -83.5,0.2203 -10,3.20931 c -13.07642,4.19662 -24.66515,6.2567 -40.654,7.22688 -50.31182,3.05286 -91.19079,-11.06324 -124.19456,-42.88616 C 66.815681,645.60378 48.279913,598.12588 44.986667,527.66202 43.556044,497.05174 43.701872,459.00851 45.25,458.96433 c 4.887839,-0.1395 20.803325,-1.87925 21.579394,-2.35889 0.600096,-0.37088 0.955125,-41.02555 0.95168,-108.97768 -0.003,-59.61236 0.320053,-111.25298 0.717945,-114.75693 3.376821,-29.73729 13.889397,-56.06165 32.143251,-80.48934 9.5778,-12.81722 34.56017,-35.33977 45.35773,-40.89171 1.925,-0.9898 4.625,-2.61424 6,-3.60986 1.375,-0.99562 9.25,-4.49023 17.5,-7.76581 11.39375,-4.523777 18.81231,-6.724132 30.8571,-9.152257 L 216.2142,87.765199 338.8571,87.6326 461.5,87.5 469,82.91573 C 477.3077,77.837763 507.54367,61 508.35459,61 c 0.28289,0 3.96932,5.7375 8.19206,12.75 4.22275,7.0125 8.09278,13.011167 8.60008,13.33037 0.50731,0.319204 5.74432,0.674344 11.63782,0.789202 33.46627,0.652219 61.42616,10.128596 91.71994,31.086418 6.58409,4.555 31.48509,29.3354 35.13199,34.96184 C 674.6703,170.9408 682,183.78283 682,186.09171 c 0,0.63701 1.06837,3.68947 2.37414,6.78324 3.20962,7.60452 6.38296,18.3493 7.56804,25.62505 0.53752,3.3 1.48274,8.925 2.1005,12.5 0.80026,4.63118 1.12276,54.08313 1.12168,172 l -0.002,165.5 -2.17489,12 c -4.64922,25.65204 -14.92476,49.28411 -30.31946,69.72977 -6.86133,9.11252 -24.78854,26.65085 -34.66849,33.91645 -11.53456,8.48239 -29.82551,17.68291 -46.5,23.38995 -5.57199,1.90708 -26.48477,6.20456 -35.53802,7.3029 -6.60245,0.80101 -8.88995,1.6933 -18.43055,7.18918 -11.17121,6.4352 -33.80545,17.60304 -50.34733,24.8416 l -9.31589,4.07655 -7.93411,-16.58414 z m 44.8001,-37.38159 c 21.0203,-10.79027 31.07492,-16.97628 46.14959,-28.39305 27.58789,-20.89363 47.7122,-44.17577 60.58142,-70.08762 7.05609,-14.20725 10.40657,-23.68986 13.77986,-39 1.88615,-8.56053 2.20702,-13.09487 2.22912,-31.5 0.0227,-18.89475 -0.25487,-22.7534 -2.2905,-31.84372 C 613.85393,445.56206 582.43912,401.98156 523,354.40094 c -28.78884,-23.04527 -41.91238,-40.40208 -41.97626,-55.51658 -0.0776,-18.361 25.2473,-43.04707 73.71128,-71.85186 6.72927,-3.99957 12.06417,-7.55557 11.85535,-7.90222 -19.84008,-32.93476 -64.7494,-106.30213 -65.91997,-107.69201 -0.89783,-1.06605 -2.22966,-2.76984 -2.95961,-3.7862 -1.25927,-1.75338 -1.7847,-1.60599 -10.26898,2.88059 -18.32121,9.68845 -40.26859,26.53726 -61.68748,47.35693 -13.52425,13.14588 -26.43931,27.47579 -29.0319,32.21234 -0.72194,1.31894 -4.98459,7.95966 -9.47256,14.75716 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.67177,6.74148 -3.09501,7.03662 -1.24787,0.87017 -5.57793,20.014 -6.89672,30.4914 -1.85214,14.71464 -0.71273,39.25698 2.45071,52.78702 1.39076,5.94827 3.4166,12.69827 4.50188,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.26835 5.85092,8.82666 0,2.24323 31.41923,32.32423 45.10678,43.18557 33.26442,26.39596 49.89076,44.11591 57.46686,61.24682 11.41689,25.81562 -3.73704,48.96739 -48.32307,73.8267 -5.63719,3.14306 -12.27469,6.61053 -14.75,7.70547 -2.47532,1.09495 -4.50057,2.46439 -4.50057,3.04319 0,1.43489 44.08011,95.22509 45.05284,95.8599 0.42632,0.27822 2.36324,3.99072 4.30426,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.44807,-4.5087 20.18322,-10.01933 z M 241.5,690.96235 c 17.29447,-1.53137 37.1416,-8.97615 54.5,-20.44329 10.90441,-7.20357 30.15302,-26.85269 38.25122,-39.04711 15.74245,-23.70529 25.24333,-51.13121 28.74313,-82.97195 0.54408,-4.95 0.99293,-36.39947 0.99745,-69.8877 L 364,417.7246 356.94017,407.13242 C 333.91272,372.5833 322.77365,333.79036 324.31158,293.5 c 0.31492,-8.25 1.28271,-19.05 2.15066,-24 4.75586,-27.12305 16.26865,-55.87396 32.14847,-80.28441 4.68326,-7.1991 5.38929,-8.93494 5.38929,-13.25 0,-2.73107 -0.1125,-4.98924 -0.25,-5.01813 -0.1375,-0.0289 -26.35,-3.08503 -58.25,-6.79139 l -58,-6.73884 -0.56363,190.54139 c -0.61599,208.24203 -0.22548,195.19388 -6.32578,211.36074 -3.42439,9.07522 -9.83871,18.06234 -14.83368,20.7835 -3.42455,1.86562 -11.86504,2.88722 -16.10154,1.94885 C 195.79926,578.97821 188,549.12248 188,499.07791 L 188,481 l -4.25,0.0435 c -3.82421,0.0391 -79.99637,6.00707 -98.918642,7.75014 -4.217754,0.38852 -7.963823,1.00248 -8.324599,1.36434 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.40984,2.8263 28.50982,3.06128 52.45582,0.94095 z M 439,690.81937 c 0,-0.87202 -42.46989,-91.89838 -47.50512,-101.81845 l -2.28365,-4.49908 -1.14034,4.49908 c -5.62374,22.18779 -17.74364,49.13585 -29.32139,65.19483 -7.82763,10.85736 -18.90589,23.12387 -27.7877,30.76821 -3.74352,3.22195 -6.57848,6.08602 -6.29991,6.3646 C 325.62131,692.28797 439,691.78306 439,690.81937 z m 159,-16.67066 c 20.51779,-10.92989 42.42442,-31.44409 51.99957,-48.69437 1.20722,-2.17489 3.76372,-6.33716 5.68111,-9.24949 6.75139,-10.25471 13.34606,-33.61232 15.30392,-54.20485 1.25736,-13.22482 0.51816,-320.37215 -0.78698,-327 -0.59568,-3.025 -1.73086,-9.1 -2.52262,-13.5 -1.43916,-7.99778 -6.96633,-24.45769 -10.74546,-32 -10.23246,-20.42173 -29.1368,-42.00435 -46.6559,-53.26588 -4.05057,-2.60377 -9.93169,-6.39444 -13.06916,-8.42372 -8.40413,-5.43572 -29.28881,-12.23027 -44.03984,-14.32778 -6.73206,-0.95726 -12.41731,-1.56328 -12.63387,-1.34672 -0.21657,0.21657 15.5992,26.71208 35.14614,58.87893 19.54695,32.16684 35.74122,58.98763 35.98728,59.60174 0.24886,0.62109 -7.89761,5.75371 -18.3584,11.56657 -50.85079,28.25678 -80.1079,50.50054 -77.91502,59.23766 0.96456,3.84314 10.71671,13.72021 24.0098,24.31736 50.97444,40.63642 81.59201,75.98061 101.31137,116.95141 26.33932,54.72506 26.27843,115.54282 -0.16803,167.81043 -10.68455,21.11648 -22.57398,37.34606 -41.97599,57.29903 -11.38523,11.70854 -11.42313,12.13229 -0.56792,6.34968 z M 414.40524,566.11149 c 12.34531,-5.98869 26.19199,-13.33157 30.77039,-16.31753 9.96154,-6.49674 19.7082,-15.30617 22.33861,-20.19055 1.89367,-3.51633 1.89207,-3.58722 -0.17644,-7.82594 -5.43047,-11.1279 -19.42307,-25.73642 -41.42041,-43.24366 C 419.08783,473.0983 409.675,465.26694 405,461.1308 l -8.5,-7.52026 -0.64532,44.94473 c -0.60118,41.87138 -1.53561,57.46368 -4.47637,74.69473 -0.352,2.0625 -0.36529,3.75 -0.0295,3.75 0.33575,0 10.71116,-4.89983 23.05647,-10.88851 z M 150.5,450.98141 c 29.7,-2.21072 55.9125,-4.26349 58.25,-4.56172 l 4.25,-0.54224 0,-162.22643 0,-162.22644 86.75,9.71679 c 47.7125,5.34423 88.81753,9.82592 91.34451,9.95932 4.48778,0.23691 4.76707,0.0701 12.02205,-7.17907 4.08514,-4.08189 11.11407,-10.66747 15.61985,-14.63463 4.50578,-3.96715 7.794,-7.45918 7.30716,-7.76006 -1.76273,-1.08943 -205.30994,0.29377 -212.43196,1.44358 -33.0359,5.33344 -58.16751,17.72504 -80.93575,39.90687 -7.77996,7.57957 -17.80954,20.43704 -21.15724,27.12262 -0.96391,1.925 -2.61348,4.44343 -3.66571,5.59651 -1.82409,1.99892 -4.25281,7.55768 -7.6039,17.40349 -0.842377,2.475 -2.189657,6.075 -2.99395,8 -0.804294,1.925 -2.372975,8.9 -3.485959,15.5 -1.930486,11.44779 -2.036882,16.94603 -2.312082,119.48185 -0.158662,59.11501 -0.07484,107.82751 0.18627,108.25 0.679603,1.09962 -0.342872,1.15609 58.856711,-3.25044 z"
+       id="path3280"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#110d04"
+       d="m 460.51081,735.48972 c -4.03992,-8.46611 -7.63755,-16.31367 -7.99471,-17.43901 -0.35717,-1.12533 -1.63191,-2.28849 -2.83275,-2.58478 C 448.48251,715.16963 409.7,715.06966 363.5,715.24378 l -84,0.31657 -8,2.80555 c -17.54816,6.15401 -42.71713,8.97908 -67.03976,7.52481 -38.84675,-2.32269 -71.44611,-16.42574 -98.59305,-42.65307 C 87.56678,665.55715 74.398578,646.80474 65.410682,625.62481 49.19036,587.40172 44.104579,553.44124 44.026255,482.82959 L 44,459.15919 l 6.75,-0.60947 c 3.7125,-0.33521 9.098069,-0.8516 11.967932,-1.14754 l 5.217931,-0.53808 0.311013,-114.68205 C 68.552916,229.33338 68.592145,227.34013 70.700727,217.5 c 4.702596,-21.94563 12.504608,-39.22707 28.710726,-63.59418 7.573827,-11.38782 35.862737,-36.92376 47.457127,-42.83877 2.19765,-1.12116 4.23069,-2.41865 4.51787,-2.88332 0.28718,-0.46466 3.58021,-2.08968 7.31785,-3.61115 C 182.84719,94.74482 181.25438,95.283942 198,91.272083 l 11.5,-2.755131 126,-0.508476 L 461.5,87.5 469,82.912418 C 477.06872,77.97696 507.58145,61 508.38324,61 c 0.26713,0 3.94067,5.7375 8.16341,12.75 4.22275,7.0125 8.10845,13.020849 8.6349,13.351886 0.52645,0.331037 7.78846,0.888131 16.13781,1.237988 32.16095,1.347615 57.98834,10.417216 87.18513,30.616116 6.58091,4.5528 31.48338,29.3333 35.13199,34.95991 7.3187,11.28634 15.41423,24.90916 16.68933,28.0841 0.77311,1.925 2.39893,5.975 3.61293,9 2.93474,7.31269 4.91169,14.01351 6.63819,22.5 0.78324,3.85 1.96397,8.8 2.62384,11 0.90682,3.02335 1.28058,45.50765 1.5308,174 0.32922,169.06238 0.31945,170.06564 -1.77147,181.90192 -4.00908,22.69457 -14.20817,47.56914 -26.52988,64.70371 -9.4762,13.1776 -25.21918,29.15437 -38.43022,39.00092 -11.5225,8.58804 -35.92541,20.45902 -50,24.32289 -8.82319,2.42221 -23.88511,5.43693 -32.10327,6.42563 -6.63435,0.79815 -8.92818,1.67806 -18,6.90474 -13.71314,7.90075 -26.06913,14.07189 -44.71866,22.33452 l -15.32194,6.78834 -7.34532,-15.39295 z m 44.22339,-38.50905 c 21.0203,-10.79027 31.07492,-16.97628 46.14959,-28.39305 27.58789,-20.89363 47.7122,-44.17577 60.58142,-70.08762 7.05609,-14.20725 10.40657,-23.68986 13.77986,-39 1.88615,-8.56053 2.20702,-13.09487 2.22912,-31.5 0.0227,-18.89475 -0.25487,-22.7534 -2.2905,-31.84372 C 613.85393,445.56206 582.43912,401.98156 523,354.40094 c -28.78884,-23.04527 -41.91238,-40.40208 -41.97626,-55.51658 -0.0776,-18.361 25.2473,-43.04707 73.71128,-71.85186 6.72927,-3.99957 12.06417,-7.55557 11.85535,-7.90222 -19.84008,-32.93476 -64.7494,-106.30213 -65.91997,-107.69201 -0.89783,-1.06605 -2.22966,-2.76984 -2.95961,-3.7862 -1.25927,-1.75338 -1.7847,-1.60599 -10.26898,2.88059 -18.32121,9.68845 -40.26859,26.53726 -61.68748,47.35693 -13.52425,13.14588 -26.43931,27.47579 -29.0319,32.21234 -0.72194,1.31894 -4.98459,7.95966 -9.47256,14.75716 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.67395,6.74282 -3.09984,7.0396 -1.08412,0.75546 -5.49635,19.78145 -6.91864,29.83386 -1.88807,13.34449 -0.64973,40.13897 2.46987,53.44158 1.39493,5.94827 3.42419,12.69827 4.50947,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.26835 5.85092,8.82666 0,2.24323 31.41923,32.32423 45.10678,43.18557 33.26442,26.39596 49.89076,44.11591 57.46686,61.24682 11.41689,25.81562 -3.73704,48.96739 -48.32307,73.8267 -5.63719,3.14306 -12.27469,6.61053 -14.75,7.70547 -2.47532,1.09495 -4.50057,2.46439 -4.50057,3.04319 0,1.43489 44.08011,95.22509 45.05284,95.8599 0.42632,0.27822 2.36324,3.99072 4.30426,8.25 1.94101,4.25928 3.82826,7.74414 4.19388,7.74414 0.36563,0 9.44807,-4.5087 20.18322,-10.01933 z M 241.5,690.96235 c 17.29447,-1.53137 37.1416,-8.97615 54.5,-20.44329 10.90441,-7.20357 30.15302,-26.85269 38.25122,-39.04711 15.74245,-23.70529 25.24333,-51.13121 28.74313,-82.97195 0.54546,-4.96253 0.98104,-36.36508 0.97095,-70 l -0.0183,-61 -7.02504,-10.5 c -36.51987,-54.58461 -42.88352,-120.78185 -17.44732,-181.49413 5.40201,-12.89377 11.6731,-24.78003 19.14645,-36.29028 4.67079,-7.19381 5.37889,-8.9381 5.37889,-13.25 0,-2.73107 -0.1125,-4.98924 -0.25,-5.01813 -0.1375,-0.0289 -26.35,-3.08503 -58.25,-6.79139 l -58,-6.73884 -0.56363,190.54139 c -0.61599,208.24203 -0.22548,195.19388 -6.32578,211.36074 -3.42439,9.07522 -9.83871,18.06234 -14.83368,20.7835 -3.42455,1.86562 -11.86504,2.88722 -16.10154,1.94885 C 195.79926,578.97821 188,549.12248 188,499.07791 L 188,481 l -4.25,0.0435 c -3.82421,0.0391 -79.99637,6.00707 -98.918642,7.75014 -4.217754,0.38852 -7.963823,1.00248 -8.324599,1.36434 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.40984,2.8263 28.50982,3.06128 52.45582,0.94095 z m 197.5,-0.0204 c 0,-0.95758 -42.05702,-91.20756 -47.50512,-101.94104 l -2.28365,-4.49908 -1.14034,4.49908 c -5.62374,22.18779 -17.74364,49.13585 -29.32139,65.19483 -7.82763,10.85736 -18.90589,23.12387 -27.7877,30.76821 -3.74352,3.22195 -6.54137,6.12314 -6.21744,6.44707 C 325.86979,692.53645 439,692.072 439,690.94196 z M 598,674.1487 c 20.51779,-10.92989 42.42442,-31.44409 51.99957,-48.69437 1.20722,-2.17489 3.76372,-6.33716 5.68111,-9.24949 4.14042,-6.28889 10.88191,-25.48006 12.89372,-36.70485 0.78861,-4.4 1.9162,-12.71605 2.50575,-18.48012 1.45092,-14.1856 0.60607,-319.36286 -0.90393,-326.51988 -0.5802,-2.75 -1.70423,-8.6 -2.49785,-13 -1.44313,-8.00109 -6.97339,-24.46506 -10.74883,-32 -10.23246,-20.42173 -29.1368,-42.00435 -46.6559,-53.26588 -4.05057,-2.60377 -9.93169,-6.39444 -13.06916,-8.42372 -8.40413,-5.43572 -29.28881,-12.23027 -44.03984,-14.32778 -6.73206,-0.95726 -12.41731,-1.56328 -12.63387,-1.34672 -0.21657,0.21657 15.5992,26.71208 35.14614,58.87893 19.54695,32.16684 35.74122,58.98763 35.98728,59.60174 0.24886,0.62109 -7.89761,5.75371 -18.3584,11.56657 -50.85079,28.25678 -80.1079,50.50054 -77.91502,59.23766 0.96456,3.84314 10.71671,13.72021 24.0098,24.31736 50.97444,40.63642 81.59201,75.98061 101.31137,116.95141 26.33932,54.72506 26.27843,115.54282 -0.16803,167.81043 -10.68455,21.11648 -22.57398,37.34606 -41.97599,57.29903 C 587.18269,679.50756 587.14479,679.93131 598,674.1487 z M 414.40524,566.11149 c 12.34531,-5.98869 26.19199,-13.33157 30.77039,-16.31753 9.96154,-6.49674 19.7082,-15.30617 22.33861,-20.19055 1.89367,-3.51633 1.89207,-3.58722 -0.17644,-7.82594 -5.43047,-11.1279 -19.42307,-25.73642 -41.42041,-43.24366 C 419.08783,473.0983 409.675,465.26694 405,461.1308 l -8.5,-7.52026 -0.64532,44.94473 c -0.60118,41.87138 -1.53561,57.46368 -4.47637,74.69473 -0.352,2.0625 -0.36529,3.75 -0.0295,3.75 0.33575,0 10.71116,-4.89983 23.05647,-10.88851 z M 150.5,450.98141 c 29.7,-2.21072 55.9125,-4.26349 58.25,-4.56172 l 4.25,-0.54224 0,-162.22643 0,-162.22644 86.75,9.71679 c 47.7125,5.34423 88.81753,9.82592 91.34451,9.95932 4.48778,0.23691 4.76707,0.0701 12.02205,-7.17907 4.08514,-4.08189 11.09158,-10.64765 15.56986,-14.59058 4.47828,-3.94292 7.88086,-7.43042 7.56129,-7.75 -0.85633,-0.85633 -136.9235,-0.54821 -178.74771,0.40476 -33.66391,0.76704 -36.70152,0.98778 -46.81062,3.4016 -26.46489,6.3192 -48.46739,18.44728 -68.01352,37.48998 -7.77996,7.57957 -17.80954,20.43704 -21.15724,27.12262 -0.96391,1.925 -2.61348,4.44343 -3.66571,5.59651 -1.82409,1.99892 -4.25281,7.55768 -7.6039,17.40349 -0.842377,2.475 -2.192836,6.075 -3.001016,8 -0.80818,1.925 -2.401742,8.675 -3.54125,15 -1.995499,11.07631 -2.084747,15.45848 -2.422385,118.94256 -0.192805,59.0934 -0.124783,108.0309 0.151159,108.75 0.662575,1.72664 -2.514076,1.87245 59.064482,-2.71115 z"
+       id="path3278"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#0f0c04"
+       d="m 460.51081,735.48972 c -4.03992,-8.46611 -7.63755,-16.31367 -7.99471,-17.43901 -0.35717,-1.12533 -1.63191,-2.28849 -2.83275,-2.58478 C 448.48251,715.16963 409.7,715.06966 363.5,715.24378 l -84,0.31657 -8,2.80555 c -17.54816,6.15401 -42.71713,8.97908 -67.03976,7.52481 -38.84675,-2.32269 -71.44611,-16.42574 -98.59305,-42.65307 C 87.56678,665.55715 74.398578,646.80474 65.410682,625.62481 49.19036,587.40172 44.104579,553.44124 44.026255,482.82959 L 44,459.15919 l 6.75,-0.60947 c 3.7125,-0.33521 9.098069,-0.8516 11.967932,-1.14754 l 5.217931,-0.53808 0.311013,-114.68205 C 68.552916,229.33338 68.592145,227.34013 70.700727,217.5 c 4.702596,-21.94563 12.504608,-39.22707 28.710726,-63.59418 7.573827,-11.38782 35.862737,-36.92376 47.457127,-42.83877 2.19765,-1.12116 4.23069,-2.41865 4.51787,-2.88332 0.28718,-0.46466 3.58021,-2.08968 7.31785,-3.61115 C 182.84719,94.74482 181.25438,95.283942 198,91.272083 l 11.5,-2.755131 126,-0.508476 L 461.5,87.5 469,82.912418 C 477.06872,77.97696 507.58145,61 508.38324,61 c 0.26713,0 3.94067,5.7375 8.16341,12.75 4.22275,7.0125 8.10845,13.020849 8.6349,13.351886 0.52645,0.331037 7.78846,0.888131 16.13781,1.237988 32.16095,1.347615 57.98834,10.417216 87.18513,30.616116 6.58091,4.5528 31.48338,29.3333 35.13199,34.95991 7.3187,11.28634 15.41423,24.90916 16.68933,28.0841 0.77311,1.925 2.39893,5.975 3.61293,9 2.93474,7.31269 4.91169,14.01351 6.63819,22.5 0.78324,3.85 1.96397,8.8 2.62384,11 0.90682,3.02335 1.28058,45.50765 1.5308,174 0.32922,169.06238 0.31945,170.06564 -1.77147,181.90192 -4.00908,22.69457 -14.20817,47.56914 -26.52988,64.70371 -9.4762,13.1776 -25.21918,29.15437 -38.43022,39.00092 -11.5225,8.58804 -35.92541,20.45902 -50,24.32289 -8.82319,2.42221 -23.88511,5.43693 -32.10327,6.42563 -6.63435,0.79815 -8.92818,1.67806 -18,6.90474 -13.71314,7.90075 -26.06913,14.07189 -44.71866,22.33452 l -15.32194,6.78834 -7.34532,-15.39295 z m 42.80805,-37.68091 C 571.50388,663.33892 612.94824,616.58014 625.02168,560.5 c 2.71322,-12.60267 3.76816,-39.97589 2.04087,-52.95571 -7.06902,-53.1205 -39.86341,-101.62659 -103.04063,-152.40711 -30.21572,-24.28676 -42.9334,-40.9248 -42.99818,-56.25282 -0.0776,-18.37112 25.62857,-43.40009 73.75389,-71.8108 l 12.27763,-7.24808 -1.93339,-3.16274 C 564.0585,214.92323 549.51407,191 532.80092,163.5 516.08776,136 501.6539,112.6 500.72567,111.5 c -0.92823,-1.1 -2.28493,-2.83157 -3.01488,-3.84793 -1.2592,-1.75328 -1.78516,-1.60536 -10.26898,2.88815 -18.69691,9.90294 -40.39525,26.56169 -61.79484,47.44255 -13.65286,13.32192 -26.35813,27.43044 -28.92454,32.11916 -0.72194,1.31894 -4.98459,7.95966 -9.47256,14.75716 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.67395,6.74282 -3.09984,7.0396 -1.08412,0.75546 -5.49635,19.78145 -6.91864,29.83386 -1.88807,13.34449 -0.64973,40.13897 2.46987,53.44158 1.39493,5.94827 3.42419,12.69827 4.50947,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.26835 5.85092,8.82666 0,2.27487 31.54203,32.41162 46,43.95059 27.95988,22.3149 43.87046,38.33416 52.76166,53.12207 18.5695,30.88489 2.28767,57.26301 -52.75091,85.46154 -6.05591,3.1027 -11.01075,6.08687 -11.01075,6.6315 0,1.41344 44.08593,95.09222 45.03805,95.70195 0.43446,0.27822 2.37803,3.99072 4.31905,8.25 1.94101,4.25928 3.8107,7.74414 4.15487,7.74414 0.34417,0 8.80727,-4.13604 18.80689,-9.19119 z m -261.69829,-6.84727 c 16.97087,-1.48617 36.76727,-8.86354 53.87943,-20.07884 11.38697,-7.46301 30.47284,-26.86136 38.77589,-39.41075 15.75264,-23.80884 25.22291,-51.16987 28.71846,-82.97195 0.54546,-4.96253 0.98104,-36.36508 0.97095,-70 l -0.0183,-61 -7.02504,-10.5 c -36.51985,-54.58461 -42.8835,-120.78185 -17.4473,-181.49413 5.40201,-12.89377 11.6731,-24.78003 19.14645,-36.29028 C 363.275,182.0478 364,180.268 364,176.0109 c 0,-4.76928 -0.0997,-4.9375 -3.25,-5.48155 -1.7875,-0.3087 -26.875,-3.2446 -55.75,-6.52423 -28.875,-3.27962 -53.72216,-6.18312 -55.21592,-6.45221 l -2.71591,-0.48928 -0.349,190.71819 c -0.38152,208.49308 -0.004,195.35822 -6.08637,211.47854 -4.53778,12.02564 -12.26366,20.96636 -19.36142,22.40587 -5.86882,1.19027 -13.07656,0.69144 -15.80077,-1.09353 -10.90424,-7.14473 -17.46778,-37.69834 -17.46977,-81.3227 L 188,481 l -4.75,0.0561 c -4.26744,0.0504 -79.38031,5.94774 -98.418642,7.72715 -4.217754,0.39421 -7.963823,1.01282 -8.324599,1.37468 -0.982773,0.98574 1.270404,43.02783 3.030647,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.41711,2.82763 28.37653,3.05936 52.57639,0.94014 z M 439,690.87901 c 0,-1.48648 -49.16118,-106.05117 -49.63655,-105.57579 -0.2028,0.2028 -1.70178,5.11616 -3.33107,10.91857 -9.68636,34.49619 -28.69453,65.39014 -53.8964,87.5977 -4.3806,3.86013 -7.70326,7.27989 -7.38369,7.59947 C 325.07186,691.73853 350.90833,692 382.16667,692 423.47839,692 439,691.69385 439,690.87901 z m 160.88512,-17.59462 c 9.55163,-5.28831 20.45975,-13.50148 29.4839,-22.19964 8.01061,-7.72122 18.23962,-20.418 21.20412,-26.31966 0.90207,-1.7958 3.16194,-5.51509 5.02196,-8.26509 4.01592,-5.93749 10.96633,-25.75814 12.97461,-37 3.45419,-19.33576 3.57173,-26.1583 3.16522,-183.71403 L 671.3317,239.5 669.11169,227.76591 c -2.10769,-11.1404 -3.7129,-16.59334 -9.3966,-31.92057 -2.30681,-6.22075 -4.01276,-9.25255 -14.15827,-25.16195 -5.51427,-8.64703 -25.35795,-28.1073 -34.86247,-34.18887 -4.2931,-2.74698 -10.3681,-6.68098 -13.5,-8.74221 -7.44879,-4.90236 -29.52705,-12.16455 -43.41145,-14.2793 -5.89441,-0.89778 -11.3885,-1.48398 -12.20909,-1.30267 -1.05603,0.23334 8.89713,17.42305 34.06347,58.82966 19.5555,32.175 35.7641,59.00743 36.01912,59.62763 0.26172,0.6365 -5.76897,4.53188 -13.84637,8.94372 -51.90584,28.35079 -84.65817,52.92894 -82.41926,61.84945 0.96021,3.82579 10.68174,13.68822 24.0098,24.35779 19.43316,15.55691 31.59999,26.30093 44.65081,39.42925 55.07929,55.40641 79.97233,112.69183 75.85815,174.56948 -3.10171,46.64994 -22.80498,88.17374 -60.19204,126.85218 -12.69279,13.13121 -12.67679,13.76628 0.16763,6.65489 z M 414.67124,566.00419 c 25.68216,-12.48104 39.49453,-21.17558 47.67214,-30.00836 6.7612,-7.30291 7.47551,-9.47035 4.83004,-14.65589 -5.81914,-11.40646 -19.35306,-25.3019 -43.72442,-44.89239 -8.17478,-6.57115 -17.41768,-14.31005 -20.53978,-17.19755 -3.12209,-2.8875 -5.88724,-5.25 -6.14477,-5.25 -0.25752,0 -0.74588,20.5875 -1.08524,45.75 -0.57472,42.61405 -1.31587,55.40196 -4.23085,73 -0.38719,2.3375 -0.41128,4.25 -0.0535,4.25 0.35774,0 10.83213,-4.94811 23.27643,-10.99581 z M 150.5,450.99079 c 29.7,-2.2054 55.9125,-4.2581 58.25,-4.56157 l 4.25,-0.55177 0,-162.21009 0,-162.21009 86.75,9.69797 c 47.7125,5.33388 88.84732,9.80958 91.41072,9.946 l 4.66072,0.24804 10.83928,-10.57691 c 5.9616,-5.81729 12.97485,-12.39552 15.58498,-14.61827 2.75697,-2.3478 4.29953,-4.31713 3.68101,-4.6994 -1.37311,-0.84862 -190.21629,-0.17347 -203.43512,0.72732 -25.7948,1.75779 -52.85697,11.57483 -73.49159,26.65972 -14.62905,10.69452 -31.50828,29.22959 -37.48138,41.15826 -0.96391,1.925 -2.61348,4.44343 -3.66571,5.59651 -1.82409,1.99892 -4.25281,7.55768 -7.6039,17.40349 -0.842377,2.475 -2.192836,6.075 -3.001016,8 -0.80818,1.925 -2.402974,8.675 -3.543987,15 -1.999279,11.08264 -2.087192,15.39931 -2.422381,118.94257 -0.191296,59.09341 -0.122043,108.03091 0.153896,108.75 0.662282,1.72588 -2.528262,1.87182 59.064478,-2.70178 z"
+       id="path3276"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#090909"
+       d="m 460.51081,735.48972 c -4.03992,-8.46611 -7.63755,-16.31367 -7.99471,-17.43901 -0.35717,-1.12533 -1.63191,-2.28849 -2.83275,-2.58478 C 448.48251,715.16963 409.7,715.06966 363.5,715.24378 l -84,0.31657 -8,2.80555 c -17.54816,6.15401 -42.71713,8.97908 -67.03976,7.52481 -38.84675,-2.32269 -71.44611,-16.42574 -98.59305,-42.65307 C 87.56678,665.55715 74.398578,646.80474 65.410682,625.62481 49.19036,587.40172 44.104579,553.44124 44.026255,482.82959 L 44,459.15919 l 6.75,-0.60947 c 3.7125,-0.33521 9.098069,-0.8516 11.967932,-1.14754 l 5.217931,-0.53808 0.311013,-114.68205 C 68.552916,229.33338 68.592145,227.34013 70.700727,217.5 c 4.702596,-21.94563 12.504608,-39.22707 28.710726,-63.59418 7.573827,-11.38782 35.862737,-36.92376 47.457127,-42.83877 2.19765,-1.12116 4.23069,-2.41865 4.51787,-2.88332 0.28718,-0.46466 3.58021,-2.08968 7.31785,-3.61115 C 182.84719,94.74482 181.25438,95.283942 198,91.272083 l 11.5,-2.755131 126,-0.508476 L 461.5,87.5 469,82.912418 C 477.06872,77.97696 507.58145,61 508.38324,61 c 0.26713,0 3.94067,5.7375 8.16341,12.75 4.22275,7.0125 8.10845,13.020849 8.6349,13.351886 0.52645,0.331037 7.78846,0.888131 16.13781,1.237988 32.16095,1.347615 57.98834,10.417216 87.18513,30.616116 6.58091,4.5528 31.48338,29.3333 35.13199,34.95991 7.3187,11.28634 15.41423,24.90916 16.68933,28.0841 0.77311,1.925 2.39893,5.975 3.61293,9 2.93474,7.31269 4.91169,14.01351 6.63819,22.5 0.78324,3.85 1.96397,8.8 2.62384,11 0.90682,3.02335 1.28058,45.50765 1.5308,174 0.32922,169.06238 0.31945,170.06564 -1.77147,181.90192 -4.00908,22.69457 -14.20817,47.56914 -26.52988,64.70371 -9.4762,13.1776 -25.21918,29.15437 -38.43022,39.00092 -11.5225,8.58804 -35.92541,20.45902 -50,24.32289 -8.82319,2.42221 -23.88511,5.43693 -32.10327,6.42563 -6.63435,0.79815 -8.92818,1.67806 -18,6.90474 -13.71314,7.90075 -26.06913,14.07189 -44.71866,22.33452 l -15.32194,6.78834 -7.34532,-15.39295 z m 42.80805,-37.68091 C 570.77517,663.70731 611.92367,617.78125 624.55191,562.5 c 2.24948,-9.84731 2.82666,-15.17468 3.21746,-29.69696 0.53077,-19.72383 -0.36431,-28.19648 -4.78598,-45.30304 -11.7269,-45.36907 -43.34612,-87.66038 -98.96147,-132.36282 -30.21572,-24.28676 -42.9334,-40.9248 -42.99818,-56.25282 -0.0776,-18.37112 25.62857,-43.40009 73.75389,-71.8108 l 12.27763,-7.24808 -1.93339,-3.16274 C 564.0585,214.92323 549.51407,191 532.80092,163.5 516.08776,136 501.6539,112.6 500.72567,111.5 c -0.92823,-1.1 -2.27787,-2.82192 -2.9992,-3.8265 -1.23966,-1.72642 -1.78714,-1.57975 -9.99292,2.67721 -18.01552,9.34603 -40.62992,26.69552 -62.08658,47.63206 -13.65286,13.32192 -26.35813,27.43044 -28.92454,32.11916 -0.72194,1.31894 -4.98459,7.95966 -9.47256,14.75716 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.67395,6.74282 -3.09984,7.0396 -1.08412,0.75546 -5.49635,19.78145 -6.91864,29.83386 -1.88807,13.34449 -0.64973,40.13897 2.46987,53.44158 1.39493,5.94827 3.42419,12.69827 4.50947,15 1.08527,2.30173 3.7501,8.3255 5.92184,13.38616 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.26835 5.85092,8.82666 0,2.27487 31.54203,32.41162 46,43.95059 27.95988,22.3149 43.87046,38.33416 52.76166,53.12207 18.5695,30.88489 2.28767,57.26301 -52.75091,85.46154 -6.05591,3.1027 -11.01075,6.10575 -11.01075,6.67345 0,1.43043 44.07694,95.03446 45.04507,95.66 0.4306,0.27822 2.37101,3.99072 4.31203,8.25 1.94101,4.25928 3.8107,7.74414 4.15487,7.74414 0.34417,0 8.80727,-4.13604 18.80689,-9.19119 z m -261.69829,-6.84727 c 16.97087,-1.48617 36.76727,-8.86354 53.87943,-20.07884 11.38697,-7.46301 30.47284,-26.86136 38.77589,-39.41075 15.75264,-23.80884 25.22291,-51.16987 28.71846,-82.97195 0.54546,-4.96253 0.98104,-36.36508 0.97095,-70 l -0.0183,-61 -7.02504,-10.5 c -36.51985,-54.58461 -42.8835,-120.78185 -17.4473,-181.49413 5.40201,-12.89377 11.6731,-24.78003 19.14645,-36.29028 C 363.275,182.0478 364,180.268 364,176.0109 c 0,-4.76928 -0.0997,-4.9375 -3.25,-5.48155 -1.7875,-0.3087 -26.875,-3.2446 -55.75,-6.52423 -28.875,-3.27962 -53.7375,-6.18618 -55.25,-6.45903 L 247,157.05 246.9842,339.275 c -0.009,108.38516 -0.40706,186.88494 -0.98133,193.725 -1.59741,19.02668 -6.43934,32.82022 -14.77549,42.09203 -4.91261,5.46401 -9.16627,7.23362 -17.39851,7.23817 -6.77071,0.004 -9.75752,-1.67767 -13.51016,-7.6055 -8.02003,-12.66874 -12.31617,-38.99235 -12.31784,-75.4747 L 188,481 l -4.25,0.0338 c -4.07073,0.0323 -84.549498,6.32089 -99.417572,7.76841 -3.942165,0.3838 -7.463234,0.99389 -7.824599,1.35575 -0.983645,0.985 1.268385,43.02054 3.029577,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.41711,2.82763 28.37653,3.05936 52.57639,0.94014 z M 439,690.88861 c 0,-1.20219 -47.86901,-103.81714 -49.10561,-105.26581 -0.41184,-0.48247 -1.24509,1.09253 -1.85166,3.5 -9.42244,37.39698 -29.17126,70.90318 -55.6941,94.49159 -4.48326,3.98724 -7.89576,7.50515 -7.58334,7.81757 C 325.07771,691.74438 350.90833,692 382.16667,692 423.18635,692 439,691.69076 439,690.88861 z m 160.88512,-17.60422 c 19.79618,-10.96026 42.98546,-33.34941 51.18204,-49.41603 1.15508,-2.26416 3.38507,-5.89043 4.95553,-8.05838 3.36528,-4.64563 11.37077,-28.28288 12.97487,-38.30998 2.92695,-18.29609 3.06668,-27.50484 2.74084,-180.62623 L 671.40351,239.5 669.10518,227.52059 c -1.26408,-6.58868 -3.86419,-16.26368 -5.77801,-21.5 -1.91382,-5.23633 -3.88679,-10.87542 -4.38436,-12.53132 -0.98401,-3.27472 -8.05718,-14.97111 -15.64198,-25.86601 -2.63309,-3.7822 -9.3232,-11.20729 -14.86693,-16.5002 -9.2216,-8.80439 -13.87138,-12.28667 -31.27586,-23.42286 -8.2154,-5.2566 -28.94792,-12.05035 -43.31201,-14.19272 -6.40968,-0.95599 -12.12673,-1.57376 -12.70455,-1.37282 -0.57782,0.20094 14.94733,26.69034 34.50034,58.86534 19.553,32.175 35.75956,59.00743 36.01458,59.62763 0.2617,0.63645 -5.76963,4.53352 -13.84637,8.94666 -42.45275,23.19625 -72.94351,44.36315 -80.6377,55.97925 l -3.10374,4.6858 2.85059,4.13033 c 3.77302,5.46688 11.94933,13.08618 26.6184,24.80504 83.48969,66.6984 121.22214,134.97414 116.31151,210.46219 -3.04784,46.85248 -22.61831,88.18357 -60.1316,126.9926 -12.69279,13.13121 -12.67679,13.76628 0.16763,6.65489 z M 414.67124,566.00419 c 25.68216,-12.48104 39.49453,-21.17558 47.67214,-30.00836 6.7612,-7.30291 7.47551,-9.47035 4.83004,-14.65589 -5.81914,-11.40646 -19.35306,-25.3019 -43.72442,-44.89239 -8.17478,-6.57115 -17.41768,-14.31005 -20.53978,-17.19755 -3.12209,-2.8875 -5.88724,-5.25 -6.14477,-5.25 -0.25752,0 -0.74588,20.5875 -1.08524,45.75 -0.57472,42.61405 -1.31587,55.40196 -4.23085,73 -0.38719,2.3375 -0.41128,4.25 -0.0535,4.25 0.35774,0 10.83213,-4.94811 23.27643,-10.99581 z M 150.5,450.99079 c 29.7,-2.2054 55.9125,-4.2581 58.25,-4.56157 l 4.25,-0.55177 0,-162.2006 0,-162.20061 86.75,9.68659 c 47.7125,5.32762 88.86593,9.79991 91.45208,9.9384 l 4.70207,0.25182 10.79793,-10.57704 c 5.93885,-5.81737 12.93349,-12.39645 15.54362,-14.62017 2.61014,-2.22371 4.30434,-4.31589 3.76491,-4.64929 -1.58418,-0.97907 -197.73517,-0.31214 -206.51061,0.70216 -13.28756,1.53583 -29.24983,5.55973 -41.4518,10.44952 -6.35151,2.54528 -12.2232,5.18417 -13.0482,5.86419 -0.825,0.68002 -3.075,2.03349 -5,3.0077 -15.45838,7.82326 -40.82929,33.18815 -48.48138,48.46988 -0.96391,1.925 -2.61348,4.44343 -3.66571,5.59651 -1.82409,1.99892 -4.25281,7.55768 -7.6039,17.40349 -0.842377,2.475 -2.192836,6.075 -3.001016,8 -0.80818,1.925 -2.407717,8.675 -3.554527,15 -2.015034,11.11351 -2.096452,15.15483 -2.422611,120.25 L 90.933354,455 l 2.783323,2.9e-4 C 95.247505,455.00046 120.8,453.19618 150.5,450.99079 z"
+       id="path3274"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#0d0a04"
+       d="m 461.30006,737.18638 c -3.5866,-7.52751 -7.35537,-15.59888 -8.37504,-17.93638 l -1.85395,-4.25 -83.98391,0 -83.98392,0 -7.80162,2.43576 c -21.13674,6.59914 -34.3489,8.58987 -57.30162,8.63386 -9.625,0.0184 -20.875,-0.46091 -25,-1.06523 -35.42293,-5.18951 -62.61363,-18.24475 -87.25113,-41.89242 C 89.317663,667.3409 79.132273,653.56167 69.446077,634 50.459501,595.65583 44.128634,557.8761 44.030192,482.32959 L 44,459.15919 l 6.75,-0.60947 c 3.7125,-0.33521 9.099739,-0.85181 11.971641,-1.14801 l 5.221641,-0.53854 0.325502,-114.18158 c 0.36192,-126.95621 0.03702,-120.59792 7.272673,-142.3266 8.706798,-26.14653 22.018129,-47.14489 42.133063,-66.46406 15.51587,-14.90204 31.06517,-25.34306 47.82548,-32.11377 14.93326,-6.032624 16.87635,-6.665909 30.99901,-10.103067 L 209.5,88.509928 335.5,88.004964 461.5,87.5 470,82.387001 c 17.5705,-10.569173 38.22186,-21.562094 38.9618,-20.739754 0.42203,0.469014 4.03958,6.252753 8.03902,12.852753 3.99943,6.6 7.69456,12.272684 8.2114,12.605966 0.51684,0.333281 7.31802,0.871323 15.11374,1.195649 17.68063,0.735569 28.69369,2.703408 43.55547,7.782587 13.58362,4.642348 22.65323,8.729198 29.61857,13.346388 2.75,1.82292 6.40575,4.15928 8.12389,5.19191 7.8107,4.69434 11.70051,7.87635 23.38306,19.12818 12.08972,11.644 19.07235,20.21599 26.67717,32.74932 6.02686,9.93274 10.2691,17.91795 10.29317,19.37495 0.0125,0.75623 1.09313,3.90623 2.40142,7 3.03143,7.16858 6.34573,18.7913 7.73489,27.12505 0.59593,3.575 1.4563,8.75 1.91195,11.5 0.45564,2.75 0.8613,79.5311 0.90145,170.62467 0.072,163.23398 0.043,165.80113 -2.00328,177.84943 -1.16387,6.85265 -4.02523,17.91467 -6.51131,25.17275 -11.47153,33.49092 -29.50092,56.9953 -63.41241,82.66886 -3.8051,2.88075 -23.37352,12.53149 -33.59931,16.57049 -10.43369,4.12111 -31.40675,9.1306 -42.40069,10.12755 -6.8522,0.62137 -8.53648,1.2677 -19.5,7.48297 -15.31887,8.68433 -25.25682,13.63404 -44.33942,22.08378 l -15.33941,6.79226 -6.52111,-13.68638 z m 42.0188,-39.37757 C 570.77517,663.70731 611.92367,617.78125 624.55191,562.5 c 2.24948,-9.84731 2.82666,-15.17468 3.21746,-29.69696 0.53077,-19.72383 -0.36431,-28.19648 -4.78598,-45.30304 -11.7269,-45.36907 -43.34612,-87.66038 -98.96147,-132.36282 -30.21572,-24.28676 -42.9334,-40.9248 -42.99818,-56.25282 -0.0776,-18.37112 25.62857,-43.40009 73.75389,-71.8108 l 12.27763,-7.24808 -1.93339,-3.16274 C 564.0585,214.92323 549.51407,191 532.80092,163.5 516.08776,136 501.6539,112.6 500.72567,111.5 c -0.92823,-1.1 -2.27787,-2.82192 -2.9992,-3.8265 -1.23966,-1.72642 -1.78714,-1.57975 -9.99292,2.67721 -18.01552,9.34603 -40.62992,26.69552 -62.08658,47.63206 -13.65286,13.32192 -26.35813,27.43044 -28.92454,32.11916 -0.72194,1.31894 -4.98459,7.95966 -9.47256,14.75716 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.65065,6.72842 -3.04808,7.00761 -1.07208,0.75312 -4.58357,15.14633 -6.34131,25.99239 -1.79247,11.06032 -2.03807,34.85087 -0.46775,45.30845 1.46996,9.78916 4.66925,22.34817 6.92679,27.19155 1.02544,2.2 3.64131,8.14054 5.81305,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.26835 5.85092,8.82666 0,2.27487 31.54203,32.41162 46,43.95059 27.95988,22.3149 43.87046,38.33416 52.76166,53.12207 18.5695,30.88489 2.28767,57.26301 -52.75091,85.46154 -6.05591,3.1027 -11.01075,6.10575 -11.01075,6.67345 0,1.43043 44.07694,95.03446 45.04507,95.66 0.4306,0.27822 2.37101,3.99072 4.31203,8.25 1.94101,4.25928 3.8107,7.74414 4.15487,7.74414 0.34417,0 8.80727,-4.13604 18.80689,-9.19119 z m -261.69829,-6.84727 c 16.97087,-1.48617 36.76727,-8.86354 53.87943,-20.07884 11.38697,-7.46301 30.47284,-26.86136 38.77589,-39.41075 15.75264,-23.80884 25.22291,-51.16987 28.71846,-82.97195 0.54408,-4.95 0.99293,-36.4169 0.99745,-69.92645 L 364,417.64711 357.61232,408.02179 C 341.34021,383.50204 330.98549,357.8454 326.32546,330.5 c -2.47811,-14.54172 -2.44792,-46.41845 0.0573,-60.5 5.00942,-28.15737 15.99335,-55.66822 32.25383,-80.78441 C 363.27194,182.05575 364,180.26328 364,176.0109 c 0,-4.76928 -0.0997,-4.9375 -3.25,-5.48155 -1.7875,-0.3087 -26.875,-3.2446 -55.75,-6.52423 -28.875,-3.27962 -53.7375,-6.18618 -55.25,-6.45903 L 247,157.05 246.9842,339.275 c -0.009,108.38516 -0.40706,186.88494 -0.98133,193.725 -1.59741,19.02668 -6.43934,32.82022 -14.77549,42.09203 -4.91261,5.46401 -9.16627,7.23362 -17.39851,7.23817 -6.77071,0.004 -9.75752,-1.67767 -13.51016,-7.6055 -8.02003,-12.66874 -12.31617,-38.99235 -12.31784,-75.4747 L 188,481 l -4.25,0.0338 c -4.07073,0.0323 -84.549498,6.32089 -99.417572,7.76841 -3.942165,0.3838 -7.463234,0.99389 -7.824599,1.35575 -0.983645,0.985 1.268385,43.02054 3.029577,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.41711,2.82763 28.37653,3.05936 52.57639,0.94014 z M 439,690.88861 c 0,-1.20219 -47.86901,-103.81714 -49.10561,-105.26581 -0.41184,-0.48247 -1.24509,1.09253 -1.85166,3.5 -9.42244,37.39698 -29.17126,70.90318 -55.6941,94.49159 -4.48326,3.98724 -7.89576,7.50515 -7.58334,7.81757 C 325.07771,691.74438 350.90833,692 382.16667,692 423.18635,692 439,691.69076 439,690.88861 z m 160.88512,-17.60422 c 19.79618,-10.96026 42.98546,-33.34941 51.18204,-49.41603 1.15508,-2.26416 3.38507,-5.89043 4.95553,-8.05838 3.36528,-4.64563 11.37077,-28.28288 12.97487,-38.30998 2.92695,-18.29609 3.06668,-27.50484 2.74084,-180.62623 L 671.40351,239.5 669.10518,227.52059 c -1.26408,-6.58868 -3.86419,-16.26368 -5.77801,-21.5 -1.91382,-5.23633 -3.88679,-10.87542 -4.38436,-12.53132 -0.98401,-3.27472 -8.05718,-14.97111 -15.64198,-25.86601 -2.63309,-3.7822 -9.3232,-11.20729 -14.86693,-16.5002 -9.2216,-8.80439 -13.87138,-12.28667 -31.27586,-23.42286 -8.2154,-5.2566 -28.94792,-12.05035 -43.31201,-14.19272 -6.40968,-0.95599 -12.12673,-1.57376 -12.70455,-1.37282 -0.57782,0.20094 14.94733,26.69034 34.50034,58.86534 19.553,32.175 35.75956,59.00743 36.01458,59.62763 0.2617,0.63645 -5.76963,4.53352 -13.84637,8.94666 -42.45275,23.19625 -72.94351,44.36315 -80.6377,55.97925 l -3.10374,4.6858 2.85059,4.13033 c 3.77302,5.46688 11.94933,13.08618 26.6184,24.80504 83.48969,66.6984 121.22214,134.97414 116.31151,210.46219 -3.04784,46.85248 -22.61831,88.18357 -60.1316,126.9926 -12.69279,13.13121 -12.67679,13.76628 0.16763,6.65489 z M 414.67124,566.00419 c 25.68216,-12.48104 39.49453,-21.17558 47.67214,-30.00836 6.7612,-7.30291 7.47551,-9.47035 4.83004,-14.65589 -5.81914,-11.40646 -19.35306,-25.3019 -43.72442,-44.89239 -8.17478,-6.57115 -17.41768,-14.31005 -20.53978,-17.19755 -3.12209,-2.8875 -5.88724,-5.25 -6.14477,-5.25 -0.25752,0 -0.74588,20.5875 -1.08524,45.75 -0.57472,42.61405 -1.31587,55.40196 -4.23085,73 -0.38719,2.3375 -0.41128,4.25 -0.0535,4.25 0.35774,0 10.83213,-4.94811 23.27643,-10.99581 z M 150.5,450.99079 c 29.7,-2.2054 55.9125,-4.2581 58.25,-4.56157 l 4.25,-0.55177 0,-162.2006 0,-162.20061 86.75,9.68659 c 47.7125,5.32762 88.86593,9.79991 91.45208,9.9384 l 4.70207,0.25182 10.79793,-10.57704 c 5.93885,-5.81737 12.93349,-12.39645 15.54362,-14.62017 2.61014,-2.22371 4.30434,-4.31589 3.76491,-4.64929 -1.58418,-0.97907 -197.73517,-0.31214 -206.51061,0.70216 -13.28756,1.53583 -29.24983,5.55973 -41.4518,10.44952 -6.35151,2.54528 -12.2232,5.18417 -13.0482,5.86419 -0.825,0.68002 -3.075,2.0279 -5,2.99529 -12.36203,6.2124 -34.67488,27.00912 -43.43357,40.48229 -2.68159,4.125 -6.33745,9.75 -8.12412,12.5 C 105.12784,189.60154 99,203.9603 99,206.62522 c 0,0.81075 -0.707211,2.84169 -1.571579,4.5132 -0.864369,1.6715 -2.531055,8.06166 -3.703747,14.20034 C 91.643773,236.23164 91.584493,239.12684 91.2592,345.75 L 90.925893,455 l 2.787053,2.9e-4 c 1.53288,1.7e-4 27.087054,-1.80411 56.787054,-4.0095 z"
+       id="path3272"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#0c0903"
+       d="m 461.30006,737.18638 c -3.5866,-7.52751 -7.35537,-15.59888 -8.37504,-17.93638 l -1.85395,-4.25 -83.98391,0 -83.98392,0 -7.80162,2.43576 c -21.13674,6.59914 -34.3489,8.58987 -57.30162,8.63386 -9.625,0.0184 -20.875,-0.46091 -25,-1.06523 -35.42293,-5.18951 -62.61363,-18.24475 -87.25113,-41.89242 C 89.317663,667.3409 79.132273,653.56167 69.446077,634 50.459501,595.65583 44.128634,557.8761 44.030192,482.32959 L 44,459.15919 l 6.75,-0.60947 c 3.7125,-0.33521 9.099739,-0.85181 11.971641,-1.14801 l 5.221641,-0.53854 0.325502,-114.18158 c 0.36192,-126.95621 0.03702,-120.59792 7.272673,-142.3266 8.706798,-26.14653 22.018129,-47.14489 42.133063,-66.46406 15.51587,-14.90204 31.06517,-25.34306 47.82548,-32.11377 14.93326,-6.032624 16.87635,-6.665909 30.99901,-10.103067 L 209.5,88.509928 335.5,88.004964 461.5,87.5 470,82.387001 c 17.5705,-10.569173 38.22186,-21.562094 38.9618,-20.739754 0.42203,0.469014 4.03958,6.252753 8.03902,12.852753 3.99943,6.6 7.69456,12.272684 8.2114,12.605966 0.51684,0.333281 7.31802,0.871323 15.11374,1.195649 17.68063,0.735569 28.69369,2.703408 43.55547,7.782587 13.58362,4.642348 22.65323,8.729198 29.61857,13.346388 2.75,1.82292 6.40575,4.15928 8.12389,5.19191 7.8107,4.69434 11.70051,7.87635 23.38306,19.12818 12.08972,11.644 19.07235,20.21599 26.67717,32.74932 6.02686,9.93274 10.2691,17.91795 10.29317,19.37495 0.0125,0.75623 1.09313,3.90623 2.40142,7 3.03143,7.16858 6.34573,18.7913 7.73489,27.12505 0.59593,3.575 1.4563,8.75 1.91195,11.5 0.45564,2.75 0.8613,79.5311 0.90145,170.62467 0.072,163.23398 0.043,165.80113 -2.00328,177.84943 -1.16387,6.85265 -4.02523,17.91467 -6.51131,25.17275 -11.47153,33.49092 -29.50092,56.9953 -63.41241,82.66886 -3.8051,2.88075 -23.37352,12.53149 -33.59931,16.57049 -10.43369,4.12111 -31.40675,9.1306 -42.40069,10.12755 -6.8522,0.62137 -8.53648,1.2677 -19.5,7.48297 -15.31887,8.68433 -25.25682,13.63404 -44.33942,22.08378 l -15.33941,6.79226 -6.52111,-13.68638 z m 42.0188,-39.37757 C 570.83174,663.67871 611.91308,617.82762 624.55191,562.5 c 2.24948,-9.84731 2.82666,-15.17468 3.21746,-29.69696 0.29632,-11.01174 0.026,-20.83352 -0.71564,-26 C 619.39834,453.47238 587.11471,405.92551 524.10488,355.18145 493.54076,330.56708 481,313.91722 481,297.95286 c 0,-10.45924 11.74842,-26.53249 30.40225,-41.59397 9.2391,-7.45983 31.45417,-22.37284 45.88112,-30.80007 l 9.78337,-5.71477 -1.93147,-3.17202 C 564.07297,214.92741 549.52714,191 532.8112,163.5 c -16.71593,-27.5 -31.15324,-50.9 -32.08292,-52 -0.92967,-1.1 -2.28048,-2.82192 -3.00181,-3.8265 -1.23966,-1.72642 -1.78714,-1.57975 -9.99292,2.67721 -18.02504,9.35096 -40.9502,26.92553 -62.0703,47.58348 -13.69539,13.3957 -26.38758,27.50308 -28.94082,32.16774 -0.72194,1.31894 -4.98459,7.95966 -9.47256,14.75716 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.65065,6.72842 -3.04808,7.00761 -1.07208,0.75312 -4.58357,15.14633 -6.34131,25.99239 -1.79247,11.06032 -2.03807,34.85087 -0.46775,45.30845 1.46996,9.78916 4.66925,22.34817 6.92679,27.19155 1.02544,2.2 3.64131,8.14054 5.81305,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.26835 5.85092,8.82666 0,2.27487 31.54203,32.41162 46,43.95059 21.26674,16.97308 32.61312,27.4044 41.74577,38.37904 13.46843,16.18494 18.40954,26.55764 18.37158,38.56688 -0.0661,20.92985 -20.04269,41.3198 -60.47448,61.72598 l -11.49014,5.79915 22.5532,47.97007 c 12.40425,26.38355 22.90618,48.19772 23.33762,48.47594 0.43143,0.27822 2.37253,3.99072 4.31355,8.25 1.94101,4.25928 3.8107,7.74414 4.15487,7.74414 0.34417,0 8.80727,-4.13604 18.80689,-9.19119 z m -261.65371,-6.8515 c 18.2368,-1.5976 40.41892,-10.33917 57.56771,-22.6864 10.62284,-7.64851 26.92825,-24.71261 34.66233,-36.27519 15.649,-23.3955 24.42651,-47.78167 28.56685,-79.36593 C 363.70243,543.16757 364,528.97404 364,479.27234 l 0,-61.62523 -6.38768,-9.62532 C 341.34021,383.50204 330.98549,357.8454 326.32546,330.5 c -2.47811,-14.54172 -2.44792,-46.41845 0.0573,-60.5 5.00942,-28.15737 15.99335,-55.66822 32.25383,-80.78441 C 363.27194,182.05575 364,180.26328 364,176.0109 c 0,-4.76928 -0.0997,-4.9375 -3.25,-5.48155 -1.7875,-0.3087 -26.875,-3.2446 -55.75,-6.52423 -28.875,-3.27962 -53.7375,-6.18618 -55.25,-6.45903 L 247,157.05 246.9842,338.775 c -0.01,111.43585 -0.39994,186.36646 -1.00891,193.725 -1.59519,19.2755 -6.24406,32.97956 -14.28771,42.11762 -4.66576,5.30059 -6.10018,6.13311 -12.73527,7.39143 -10.46203,1.98408 -16.05306,-1.28587 -21.24512,-12.42538 -6.08887,-13.06361 -8.62806,-30.16642 -9.40292,-63.33367 l -0.58989,-25.25 -4.10717,0.0338 c -3.97025,0.0326 -84.722408,6.35163 -99.274752,7.76841 -3.942165,0.3838 -7.463234,0.99389 -7.824599,1.35575 -0.983645,0.985 1.268385,43.02054 3.029577,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 15.42682,2.82941 28.37722,3.05974 52.62097,0.93591 z m 197.0575,-0.90988 c -0.28083,-1.07392 -11.47082,-25.33428 -24.86663,-53.91192 -18.42951,-39.31616 -24.51442,-51.43329 -25.00699,-49.79743 -9.41584,31.27065 -16.40253,47.48946 -27.63951,64.16192 -7.70639,11.43406 -19.81319,25.27211 -29.50746,33.72694 -4.15458,3.6234 -7.28714,6.85464 -6.96125,7.18053 0.32589,0.32589 26.22001,0.59253 57.54249,0.59253 55.99653,0 56.94141,-0.0327 56.43935,-1.95257 z M 599,673.79305 c 10.87581,-6.06467 19.25536,-12.24883 28.66906,-21.15793 9.28006,-8.78263 19.49653,-21.18708 22.94954,-27.86447 0.92707,-1.79275 3.17926,-5.51204 5.00489,-8.26509 6.29909,-9.4991 12.09892,-29.27456 15.39904,-52.50556 0.72931,-5.13391 0.9621,-57.50341 0.73791,-166 l -0.32752,-158.5 -2.27062,-11.73409 c -2.15424,-11.13267 -3.79607,-16.68388 -9.41257,-31.82504 -7.43063,-20.03178 -29.25864,-46.48193 -49.10518,-59.50334 -4.13904,-2.71564 -9.0148,-5.92732 -10.83504,-7.13706 -6.52728,-4.33809 -10.48651,-6.13275 -22.30951,-10.11257 -10.93642,-3.68138 -32.27612,-7.83334 -35.9951,-7.00338 -0.9524,0.21254 10.31772,19.65581 34.54072,59.58982 C 595.82053,204.37523 612,231.22248 612,231.4349 c 0,0.21242 -6.4125,3.88996 -14.25,8.17232 -42.38845,23.16074 -72.88801,44.33706 -80.57767,55.94632 l -3.10374,4.6858 2.85059,4.13033 c 3.81101,5.52193 12.05264,13.2064 26.71353,24.90762 C 612.0355,383.87126 649.39615,439.36411 658.57205,500 c 2.03506,13.44806 2.04363,39.05577 0.0178,53.22265 -5.94687,41.5873 -25.08392,78.45132 -58.87237,113.40685 C 587.17841,679.6017 587.0953,680.43146 599,673.79305 z M 414.67124,566.00419 c 25.68216,-12.48104 39.49453,-21.17558 47.67214,-30.00836 6.7612,-7.30291 7.47551,-9.47035 4.83004,-14.65589 -5.81914,-11.40646 -19.35306,-25.3019 -43.72442,-44.89239 -8.17478,-6.57115 -17.41768,-14.31005 -20.53978,-17.19755 -3.12209,-2.8875 -5.95389,-5.25 -6.29288,-5.25 -0.33899,0 -0.62915,14.5125 -0.6448,32.25 -0.0326,36.99071 -1.20084,63.76483 -3.42481,78.49342 C 390.84134,576.03757 390.76093,577 391.52262,577 c 0.28744,0 10.70432,-4.94811 23.14862,-10.99581 z M 150.5,450.99079 c 29.7,-2.2054 55.9125,-4.2581 58.25,-4.56157 l 4.25,-0.55177 0,-162.19025 0,-162.19026 86.75,9.67391 c 47.7125,5.32065 88.88643,9.78921 91.49762,9.93013 l 4.74762,0.25623 10.25238,-10.08041 c 5.63881,-5.54422 12.50238,-11.9873 15.25238,-14.31796 2.75,-2.33066 5.15069,-4.62692 5.33487,-5.10281 0.18714,-0.48354 -43.63844,-0.85687 -99.34094,-0.84625 -106.17744,0.0202 -108.70035,0.11818 -129.37843,5.02248 -8.7478,2.07475 -30.37637,10.23239 -33.1155,12.49016 -0.825,0.68002 -3.075,2.0279 -5,2.99529 -12.36203,6.2124 -34.67488,27.00912 -43.43357,40.48229 -2.68159,4.125 -6.33745,9.75 -8.12412,12.5 C 105.12784,189.60154 99,203.9603 99,206.62522 c 0,0.81075 -0.707211,2.84169 -1.571579,4.5132 -0.864369,1.6715 -2.532821,8.06166 -3.707672,14.20034 -2.08628,10.90097 -2.143784,13.70884 -2.465966,120.41124 L 90.924908,455 l 2.787546,2.9e-4 c 1.53315,1.7e-4 27.087546,-1.80411 56.787546,-4.0095 z"
+       id="path3270"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#0a0802"
+       d="m 461.30006,737.18638 c -3.5866,-7.52751 -7.35537,-15.59888 -8.37504,-17.93638 l -1.85395,-4.25 -83.98391,0 -83.98392,0 -7.80162,2.43576 c -21.13674,6.59914 -34.3489,8.58987 -57.30162,8.63386 -9.625,0.0184 -20.875,-0.46091 -25,-1.06523 -35.42293,-5.18951 -62.61363,-18.24475 -87.25113,-41.89242 C 89.317663,667.3409 79.132273,653.56167 69.446077,634 50.459501,595.65583 44.128634,557.8761 44.030192,482.32959 L 44,459.15919 l 6.75,-0.60947 c 3.7125,-0.33521 9.099739,-0.85181 11.971641,-1.14801 l 5.221641,-0.53854 0.325502,-114.18158 c 0.36192,-126.95621 0.03702,-120.59792 7.272673,-142.3266 8.706798,-26.14653 22.018129,-47.14489 42.133063,-66.46406 15.51587,-14.90204 31.06517,-25.34306 47.82548,-32.11377 14.93326,-6.032624 16.87635,-6.665909 30.99901,-10.103067 L 209.5,88.509928 335.5,88.004964 461.5,87.5 470,82.387001 c 17.5705,-10.569173 38.22186,-21.562094 38.9618,-20.739754 0.42203,0.469014 4.03958,6.252753 8.03902,12.852753 3.99943,6.6 7.69456,12.272684 8.2114,12.605966 0.51684,0.333281 7.31802,0.871323 15.11374,1.195649 17.68063,0.735569 28.69369,2.703408 43.55547,7.782587 13.58362,4.642348 22.65323,8.729198 29.61857,13.346388 2.75,1.82292 6.40575,4.15928 8.12389,5.19191 7.8107,4.69434 11.70051,7.87635 23.38306,19.12818 12.08972,11.644 19.07235,20.21599 26.67717,32.74932 6.02686,9.93274 10.2691,17.91795 10.29317,19.37495 0.0125,0.75623 1.09313,3.90623 2.40142,7 3.03143,7.16858 6.34573,18.7913 7.73489,27.12505 0.59593,3.575 1.4563,8.75 1.91195,11.5 0.45564,2.75 0.8613,79.5311 0.90145,170.62467 0.072,163.23398 0.043,165.80113 -2.00328,177.84943 -1.16387,6.85265 -4.02523,17.91467 -6.51131,25.17275 -11.47153,33.49092 -29.50092,56.9953 -63.41241,82.66886 -3.8051,2.88075 -23.37352,12.53149 -33.59931,16.57049 -10.43369,4.12111 -31.40675,9.1306 -42.40069,10.12755 -6.8522,0.62137 -8.53648,1.2677 -19.5,7.48297 -15.31887,8.68433 -25.25682,13.63404 -44.33942,22.08378 l -15.33941,6.79226 -6.52111,-13.68638 z M 505.625,696.54405 C 571.77114,662.73146 612.01788,617.36884 624.55191,562.5 c 2.24948,-9.84731 2.82666,-15.17468 3.21746,-29.69696 0.67536,-25.09702 -2.26504,-42.453 -10.87953,-64.21737 -15.48039,-39.11099 -44.0743,-74.00524 -93.33255,-113.8973 C 493.09202,330.0159 481,313.89536 481,297.95286 c 0,-10.45924 11.74842,-26.53249 30.40225,-41.59397 9.2391,-7.45983 31.45417,-22.37284 45.88112,-30.80007 l 9.78337,-5.71477 -1.93213,-3.17202 C 564.07195,214.92741 549.53138,191 532.82224,163.5 c -16.70913,-27.5 -31.14615,-50.9 -32.08226,-52 -0.9361,-1.1 -2.29218,-2.82192 -3.01351,-3.8265 -1.23992,-1.7268 -1.7793,-1.58382 -9.88173,2.61953 -20.56222,10.66719 -44.94292,29.87003 -68.39844,53.8723 -12.79164,13.08981 -20.5208,21.90656 -22.70456,25.89937 -0.73255,1.33942 -5.0039,7.99689 -9.49187,14.79439 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.65065,6.72842 -3.04808,7.00761 -1.07208,0.75312 -4.58357,15.14633 -6.34131,25.99239 -1.79247,11.06032 -2.03807,34.85087 -0.46775,45.30845 1.46996,9.78916 4.66925,22.34817 6.92679,27.19155 1.02544,2.2 3.64131,8.14054 5.81305,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.29313 5.85092,8.88173 0,2.45101 32.61298,33.3358 48.89377,46.30286 28.13172,22.40589 44.67912,40.10934 52.80106,56.48992 3.21339,6.48088 3.76451,8.62926 4.10441,16 0.31812,6.89848 -0.006,9.55753 -1.70716,14.01394 -6.20241,16.24619 -25.04964,32.50414 -56.2214,48.49758 l -13.71066,7.03458 22.51439,47.98392 c 12.38292,26.39116 23.10076,48.65892 23.81743,49.48392 0.71667,0.825 2.67096,4.5375 4.34288,8.25 1.67192,3.7125 3.33142,6.75 3.68779,6.75 0.35637,0 9.85249,-4.70518 21.10249,-10.45595 z m -262.64656,-5.64084 c 11.68057,-1.18667 30.04124,-7.11667 41.68251,-13.46233 36.416,-19.85038 64.21682,-58.7936 74.25065,-104.00988 C 363.57327,552.42376 364,544.52726 364,479.27234 l 0,-61.62523 -6.38768,-9.62532 C 341.34021,383.50204 330.98549,357.8454 326.32546,330.5 c -2.47811,-14.54172 -2.44792,-46.41845 0.0573,-60.5 5.00942,-28.15737 15.99335,-55.66822 32.25383,-80.78441 C 363.27194,182.05575 364,180.26328 364,176.0109 c 0,-4.76928 -0.0997,-4.9375 -3.25,-5.48155 -1.7875,-0.3087 -26.875,-3.2446 -55.75,-6.52423 -28.875,-3.27962 -53.7375,-6.18618 -55.25,-6.45903 L 247,157.05 246.9842,338.775 c -0.01,111.43585 -0.39994,186.36646 -1.00891,193.725 -1.62159,19.59458 -6.6155,33.81491 -15.11232,43.03287 -4.61491,5.00658 -9.04753,6.79288 -16.86726,6.79733 -6.83726,0.004 -9.11057,-1.18338 -12.94951,-6.7631 -8.07451,-11.73589 -11.97588,-33.04904 -12.78003,-69.8171 l -0.5413,-24.75 -4.11242,0.0338 c -3.97393,0.0326 -84.715988,6.3505 -99.279992,7.76841 -3.942165,0.3838 -7.463234,0.99389 -7.824599,1.35575 -0.983645,0.985 1.268385,43.02054 3.029577,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 27.51939,18.48418 56.79026,24.30923 100.06289,19.91303 z m 195.72599,-0.92548 c -0.29086,-1.11226 -11.48085,-25.37553 -24.86664,-53.91838 -18.4446,-39.32991 -24.49542,-51.37105 -24.98876,-49.72773 -9.34913,31.14182 -16.36094,47.37725 -27.8216,64.41922 -7.51917,11.18098 -19.68315,25.06666 -29.32537,33.4761 -4.15458,3.6234 -7.28714,6.85464 -6.96125,7.18053 0.32589,0.32589 26.22001,0.59253 57.54249,0.59253 56.66673,0 56.94733,-0.0101 56.42113,-2.02227 z m 158.21026,-15.08731 c 12.40981,-6.7234 20.62237,-12.6664 30.75437,-22.2553 9.28006,-8.78263 19.49653,-21.18708 22.94954,-27.86447 0.92707,-1.79275 3.18681,-5.52056 5.02165,-8.28403 C 660.08369,609.79431 667.29274,588.1462 669.62223,574.5 671.4061,564.05008 671.5,555.42376 671.5,402 l 0,-161.5 -2.31534,-12.36887 c -5.8612,-31.31127 -19.30268,-56.6299 -41.03436,-77.29313 -5.43595,-5.1687 -13.29179,-11.63421 -17.45741,-14.36781 -4.16563,-2.73361 -9.06314,-5.95998 -10.88338,-7.16972 -6.53258,-4.34161 -10.4892,-6.13352 -22.30951,-10.10374 -11.11828,-3.73441 -32.09587,-7.85745 -35.8469,-7.04552 -1.21408,0.26279 7.25956,14.95966 34.36776,59.60817 C 595.80939,204.35204 612,231.20043 612,231.42247 c 0,0.22204 -6.4125,3.88851 -14.25,8.1477 -40.72348,22.1307 -71.30062,43.23834 -80.20146,55.36371 -3.24529,4.42096 -3.52197,5.24735 -2.43636,7.27674 2.31076,4.31957 12.39886,14.08168 24.88782,24.08357 19.92255,15.95514 30.46709,25.4417 46.51926,41.85172 17.4291,17.81765 25.28626,27.3573 37.35509,45.35409 18.84709,28.10439 30.15326,56.30127 34.68412,86.5 1.87742,12.51325 2.09273,37.76493 0.4306,50.5 -5.62897,43.12844 -25.2594,81.27197 -60.34227,117.25 -6.03355,6.1875 -10.59824,11.25 -10.14375,11.25 0.45448,0 4.23972,-1.84931 8.41164,-4.10958 z M 414.67124,566.00419 c 25.68216,-12.48104 39.49453,-21.17558 47.67214,-30.00836 6.88832,-7.44021 7.49286,-9.42718 4.60338,-15.1301 -5.56776,-10.989 -19.64724,-25.3555 -43.94676,-44.84262 -8.525,-6.83667 -18.0875,-14.88219 -21.25,-17.87893 l -5.75,-5.44862 -0.018,31.90222 c -0.0206,36.52309 -1.31839,66.64255 -3.46446,80.40222 -1.63752,10.49898 -1.76197,12 -0.99496,12 0.28744,0 10.70432,-4.94811 23.14862,-10.99581 z M 150.5,451.00005 c 29.7,-2.20368 55.9125,-4.25778 58.25,-4.56465 L 213,445.87745 213,283.93873 213,122 l 2.2481,0 c 1.23646,0 40.72396,4.26278 87.75,9.47284 47.02605,5.21006 87.15419,9.57466 89.17365,9.69912 3.4517,0.21271 4.45652,-0.53405 16.76624,-12.46043 7.20197,-6.97769 14.21218,-13.41905 15.57825,-14.31413 1.36607,-0.89508 2.48376,-2.04145 2.48376,-2.54749 0,-0.55608 -41.24169,-0.80379 -104.25,-0.62614 l -104.25,0.29392 -13.24861,2.77695 c -12.54369,2.6292 -36.59225,11.11249 -40.25139,14.19894 -0.825,0.69588 -3.075,2.05674 -5,3.02413 -12.36203,6.2124 -34.67488,27.00912 -43.43357,40.48229 -2.68159,4.125 -6.33745,9.75 -8.12412,12.5 C 105.12784,189.60154 99,203.9603 99,206.62522 c 0,0.81075 -0.707211,2.84169 -1.571579,4.5132 -0.864369,1.6715 -2.532821,8.06166 -3.707672,14.20034 -2.08628,10.90097 -2.143784,13.70884 -2.465966,120.41124 L 90.924908,455 l 2.787546,0.003 C 95.245604,455.005 120.8,453.20336 150.5,450.99967 z"
+       id="path3268"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#080602"
+       d="m 461.30006,737.18638 c -3.5866,-7.52751 -7.35537,-15.59888 -8.37504,-17.93638 l -1.85395,-4.25 -83.98391,0 -83.98392,0 -7.80162,2.43576 c -21.13674,6.59914 -34.3489,8.58987 -57.30162,8.63386 -9.625,0.0184 -20.875,-0.46091 -25,-1.06523 -35.42293,-5.18951 -62.61363,-18.24475 -87.25113,-41.89242 C 89.317663,667.3409 79.132273,653.56167 69.446077,634 50.459501,595.65583 44.128634,557.8761 44.030192,482.32959 L 44,459.15919 l 6.75,-0.60947 c 3.7125,-0.33521 9.099739,-0.85181 11.971641,-1.14801 l 5.221641,-0.53854 0.325502,-114.18158 c 0.36192,-126.95621 0.03702,-120.59792 7.272673,-142.3266 8.706798,-26.14653 22.018129,-47.14489 42.133063,-66.46406 15.51587,-14.90204 31.06517,-25.34306 47.82548,-32.11377 14.93326,-6.032624 16.87635,-6.665909 30.99901,-10.103067 L 209.5,88.509928 335.5,88.004964 461.5,87.5 470,82.387001 c 17.5705,-10.569173 38.22186,-21.562094 38.9618,-20.739754 0.42203,0.469014 4.03958,6.252753 8.03902,12.852753 3.99943,6.6 7.69456,12.272684 8.2114,12.605966 0.51684,0.333281 7.31802,0.871323 15.11374,1.195649 17.68063,0.735569 28.69369,2.703408 43.55547,7.782587 13.58362,4.642348 22.65323,8.729198 29.61857,13.346388 2.75,1.82292 6.40575,4.15928 8.12389,5.19191 7.8107,4.69434 11.70051,7.87635 23.38306,19.12818 12.08972,11.644 19.07235,20.21599 26.67717,32.74932 6.02686,9.93274 10.2691,17.91795 10.29317,19.37495 0.0125,0.75623 1.09313,3.90623 2.40142,7 3.03143,7.16858 6.34573,18.7913 7.73489,27.12505 0.59593,3.575 1.4563,8.75 1.91195,11.5 0.45564,2.75 0.8613,79.5311 0.90145,170.62467 0.072,163.23398 0.043,165.80113 -2.00328,177.84943 -1.16387,6.85265 -4.02523,17.91467 -6.51131,25.17275 -11.47153,33.49092 -29.50092,56.9953 -63.41241,82.66886 -3.8051,2.88075 -23.37352,12.53149 -33.59931,16.57049 -10.43369,4.12111 -31.40675,9.1306 -42.40069,10.12755 -6.8522,0.62137 -8.53648,1.2677 -19.5,7.48297 -15.31887,8.68433 -25.25682,13.63404 -44.33942,22.08378 l -15.33941,6.79226 -6.52111,-13.68638 z M 505.625,696.54405 C 571.77114,662.73146 612.01788,617.36884 624.55191,562.5 c 2.24948,-9.84731 2.82666,-15.17468 3.21746,-29.69696 0.67536,-25.09702 -2.26504,-42.453 -10.87953,-64.21737 -15.48039,-39.11099 -44.0743,-74.00524 -93.33255,-113.8973 C 493.09202,330.0159 481,313.89536 481,297.95286 c 0,-10.45924 11.74842,-26.53249 30.40225,-41.59397 9.2391,-7.45983 31.45417,-22.37284 45.88112,-30.80007 l 9.78337,-5.71477 -1.93213,-3.17202 C 564.07195,214.92741 549.53138,191 532.82224,163.5 c -16.70913,-27.5 -31.14615,-50.9 -32.08226,-52 -0.9361,-1.1 -2.29218,-2.82192 -3.01351,-3.8265 -1.23935,-1.726 -1.79629,-1.575 -10.12261,2.74449 -10.26988,5.32777 -24.19809,14.77398 -37.58631,25.49128 -17.16974,13.74443 -48.71,45.81585 -53.29512,54.19266 -0.72194,1.31894 -4.98459,7.95966 -9.47256,14.75716 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.65065,6.72842 -3.04808,7.00761 -1.07208,0.75312 -4.58357,15.14633 -6.34131,25.99239 -1.79247,11.06032 -2.03807,34.85087 -0.46775,45.30845 1.46996,9.78916 4.66925,22.34817 6.92679,27.19155 1.02544,2.2 3.64131,8.14054 5.81305,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.29313 5.85092,8.88173 0,2.45101 32.61298,33.3358 48.89377,46.30286 28.13172,22.40589 44.67912,40.10934 52.80106,56.48992 3.21339,6.48088 3.76451,8.62926 4.10441,16 0.31812,6.89848 -0.006,9.55753 -1.70716,14.01394 -6.20261,16.24671 -25.04952,32.50408 -56.224,48.49891 l -13.71325,7.03592 22.51267,47.98258 c 12.38197,26.39043 23.10098,48.65759 23.82002,49.48259 0.71905,0.825 2.67528,4.5375 4.3472,8.25 1.67192,3.7125 3.33142,6.75 3.68779,6.75 0.35637,0 9.85249,-4.70518 21.10249,-10.45595 z m -262.64656,-5.64084 c 6.32225,-0.6423 13.47187,-2.29813 21.47123,-4.97268 21.30133,-7.12202 37.0728,-17.30672 53.67881,-34.66401 22.15687,-23.15929 36.34702,-52.29977 42.98196,-88.26652 2.23195,-12.09898 2.31698,-14.6285 2.65046,-78.84701 l 0.34454,-66.347 -6.4404,-9.70476 c -16.3278,-24.60365 -26.67371,-50.2216 -31.33958,-77.60123 -2.47811,-14.54172 -2.44792,-46.41845 0.0573,-60.5 5.00942,-28.15737 15.99335,-55.66822 32.25383,-80.78441 C 363.27194,182.05575 364,180.26328 364,176.0109 c 0,-4.76928 -0.0997,-4.9375 -3.25,-5.48155 -1.7875,-0.3087 -26.875,-3.2446 -55.75,-6.52423 -28.875,-3.27962 -53.7375,-6.18618 -55.25,-6.45903 L 247,157.05 246.9842,338.775 c -0.01,111.43585 -0.39994,186.36646 -1.00891,193.725 -1.62159,19.59458 -6.6155,33.81491 -15.11232,43.03287 -4.62506,5.0176 -8.69407,6.65622 -16.71627,6.73179 -7.00128,0.0659 -9.23159,-1.07429 -13.1005,-6.69756 -8.07451,-11.73589 -11.97588,-33.04904 -12.78003,-69.8171 l -0.5413,-24.75 -4.11242,0.0338 c -3.97393,0.0326 -84.715988,6.3505 -99.279992,7.76841 -3.942165,0.3838 -7.463234,0.99389 -7.824599,1.35575 -0.983645,0.985 1.268385,43.02054 3.029577,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 27.51939,18.48418 56.79026,24.30923 100.06289,19.91303 z M 439,690.8306 c 0,-0.64317 -11.1375,-24.90302 -24.75,-53.91077 -18.72298,-39.89801 -24.90852,-52.21519 -25.40097,-50.5806 -8.93887,29.67083 -15.84376,46.11495 -25.84397,61.54792 -8.54607,13.18883 -22.9746,29.66869 -33.36877,38.11285 -3.04655,2.475 -5.56103,4.8375 -5.58774,5.25 -0.0267,0.4125 25.82645,0.75 57.45145,0.75 43.21968,0 57.5,-0.29042 57.5,-1.1694 z m 157.91469,-15.94018 c 25.73563,-13.94309 44.20044,-32.62159 60.66696,-61.36902 3.26569,-5.70128 10.17513,-28.09357 12.04058,-39.0214 1.78403,-10.45088 1.87777,-19.08709 1.87777,-173 l 0,-162 -2.23065,-11.31745 C 664.27637,202.85015 657.0184,186.116 642.51626,166.5 c -6.70373,-9.06767 -22.31336,-23.7912 -31.87171,-30.06247 -4.13904,-2.71564 -9.0148,-5.92732 -10.83504,-7.13706 -6.5287,-4.33903 -10.48724,-6.13296 -22.30951,-10.1102 -11.38474,-3.83006 -31.0358,-7.72252 -35.42406,-7.01677 -1.74829,0.28117 2.96456,8.55606 33.94696,59.60452 19.78741,32.60291 35.9771,59.4513 35.9771,59.66309 0,0.21179 -6.4125,3.86987 -14.25,8.12906 -41.26089,22.42274 -71.82528,43.58871 -80.54669,55.77892 -2.89079,4.04056 -3.14708,4.88758 -2.08156,6.87941 2.30159,4.30245 12.40804,14.07881 24.87825,24.06569 19.92255,15.95514 30.46709,25.4417 46.51926,41.85172 17.61161,18.00424 25.44316,27.53058 37.47165,45.58078 18.98064,28.48273 30.04833,56.10817 34.56404,86.27331 1.86682,12.47048 2.07827,37.70071 0.42323,50.5 -5.56235,43.01663 -25.24482,81.26819 -60.33138,117.25 -6.03355,6.1875 -10.59824,11.25 -10.14375,11.25 0.45448,0 4.23972,-1.84931 8.41164,-4.10958 z M 402.41149,571.99556 c 34.36597,-16.08799 50.43152,-25.7382 59.93189,-35.99973 6.88832,-7.44021 7.49286,-9.42718 4.60338,-15.1301 -5.56776,-10.989 -19.64724,-25.3555 -43.94676,-44.84262 -8.525,-6.83667 -18.0875,-14.88219 -21.25,-17.87893 l -5.75,-5.44862 -0.018,31.90222 c -0.0206,36.52309 -1.31839,66.64255 -3.46446,80.40222 -1.55443,9.96625 -1.7505,12 -1.1569,12 0.19838,0 5.17124,-2.252 11.05081,-5.00444 z M 150.5,451.00005 c 29.7,-2.20368 55.9125,-4.25778 58.25,-4.56465 L 213,445.87745 213,283.93873 213,122 l 2.2481,0 c 1.23646,0 40.72396,4.26278 87.75,9.47284 47.02605,5.21006 87.15419,9.57466 89.17365,9.69912 3.4517,0.21271 4.45652,-0.53405 16.76624,-12.46043 7.20197,-6.97769 14.21218,-13.41905 15.57825,-14.31413 1.36607,-0.89508 2.48376,-2.04322 2.48376,-2.55141 0,-0.56158 -41.08672,-0.79305 -104.75,-0.59013 l -104.75,0.33386 -14.00743,3.05344 c -14.41079,3.14137 -32.03946,9.76248 -41.99257,15.7719 -17.12848,10.34172 -35.94142,27.75264 -44.93357,41.58494 -2.68159,4.125 -6.33745,9.75 -8.12412,12.5 C 105.12784,189.60154 99,203.9603 99,206.62522 c 0,0.81075 -0.707211,2.84169 -1.571579,4.5132 -0.864369,1.6715 -2.532821,8.06166 -3.707672,14.20034 -2.08628,10.90097 -2.143784,13.70884 -2.465966,120.41124 L 90.924908,455 l 2.787546,0.003 C 95.245604,455.005 120.8,453.20336 150.5,450.99967 z"
+       id="path3266"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#050505"
+       d="m 461.30006,737.18638 c -3.5866,-7.52751 -7.35537,-15.59888 -8.37504,-17.93638 l -1.85395,-4.25 -83.98391,0 -83.98392,0 -7.80162,2.43576 c -21.13674,6.59914 -34.3489,8.58987 -57.30162,8.63386 -9.625,0.0184 -20.875,-0.46091 -25,-1.06523 -35.42293,-5.18951 -62.61363,-18.24475 -87.25113,-41.89242 C 89.317663,667.3409 79.132273,653.56167 69.446077,634 50.459501,595.65583 44.128634,557.8761 44.030192,482.32959 L 44,459.15919 l 6.75,-0.60947 c 3.7125,-0.33521 9.099739,-0.85181 11.971641,-1.14801 l 5.221641,-0.53854 0.325502,-114.18158 c 0.36192,-126.95621 0.03702,-120.59792 7.272673,-142.3266 8.706798,-26.14653 22.018129,-47.14489 42.133063,-66.46406 15.51587,-14.90204 31.06517,-25.34306 47.82548,-32.11377 14.93326,-6.032624 16.87635,-6.665909 30.99901,-10.103067 L 209.5,88.509928 335.5,88.004964 461.5,87.5 470,82.387001 c 17.5705,-10.569173 38.22186,-21.562094 38.9618,-20.739754 0.42203,0.469014 4.03958,6.252753 8.03902,12.852753 3.99943,6.6 7.69456,12.272684 8.2114,12.605966 0.51684,0.333281 7.31802,0.871323 15.11374,1.195649 17.68063,0.735569 28.69369,2.703408 43.55547,7.782587 13.58362,4.642348 22.65323,8.729198 29.61857,13.346388 2.75,1.82292 6.40575,4.15928 8.12389,5.19191 7.8107,4.69434 11.70051,7.87635 23.38306,19.12818 12.08972,11.644 19.07235,20.21599 26.67717,32.74932 6.02686,9.93274 10.2691,17.91795 10.29317,19.37495 0.0125,0.75623 1.09313,3.90623 2.40142,7 3.03143,7.16858 6.34573,18.7913 7.73489,27.12505 0.59593,3.575 1.4563,8.75 1.91195,11.5 0.45564,2.75 0.8613,79.5311 0.90145,170.62467 0.072,163.23398 0.043,165.80113 -2.00328,177.84943 -1.16387,6.85265 -4.02523,17.91467 -6.51131,25.17275 -11.47153,33.49092 -29.50092,56.9953 -63.41241,82.66886 -3.8051,2.88075 -23.37352,12.53149 -33.59931,16.57049 -10.43369,4.12111 -31.40675,9.1306 -42.40069,10.12755 -6.8522,0.62137 -8.53648,1.2677 -19.5,7.48297 -15.31887,8.68433 -25.25682,13.63404 -44.33942,22.08378 l -15.33941,6.79226 -6.52111,-13.68638 z m 44.03517,-40.49517 c 21.791,-11.14017 35.74337,-19.99751 51.88068,-32.93524 36.81775,-29.51782 59.4246,-63.92924 67.89193,-103.3429 2.67905,-12.4704 3.72295,-41.23028 1.94589,-53.61003 C 621.58211,468.68545 603.81694,434.46692 570.09171,397.0852 560.39128,386.33305 542.46752,369.98448 523.94348,354.99262 493.32192,330.20999 481,313.84338 481,297.95286 c 0,-16.87337 25.6563,-41.90821 70.67202,-68.96018 14.72853,-8.85103 15.33271,-9.33993 14.0519,-11.37069 C 564.98783,216.4549 550.3131,192.325 533.1134,164 515.91371,135.675 500.59075,111.01842 499.06239,109.20759 l -2.77885,-3.29241 -8.74539,4.5369 C 477.37434,115.72482 463.46564,125.1538 450,135.89992 c -17.07558,13.627 -48.65494,45.77178 -53.30998,54.26448 -0.70411,1.28458 -4.95218,7.89719 -9.44015,14.69469 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.65065,6.72842 -3.04808,7.00761 -1.07208,0.75312 -4.58357,15.14633 -6.34131,25.99239 -1.79247,11.06032 -2.03807,34.85087 -0.46775,45.30845 1.46996,9.78916 4.66925,22.34817 6.92679,27.19155 1.02544,2.2 3.64131,8.14054 5.81305,13.2012 4.70285,10.95875 12.29354,23.88176 20.32935,34.61035 3.21801,4.29635 5.85092,8.29313 5.85092,8.88173 0,2.12035 31.77458,32.68182 44,42.32015 32.58994,25.69338 49.77024,43.80636 58.19292,61.35206 4.29304,8.94303 5.06979,20.82155 1.90515,29.13451 -6.1234,16.08508 -25.32447,32.64208 -56.26452,48.51663 l -13.74779,7.05364 22.55422,47.96486 C 465.0448,668.91581 475.77936,691.175 476.49454,692 c 0.71518,0.825 2.66826,4.5375 4.34018,8.25 1.67192,3.7125 3.33142,6.75 3.68779,6.75 0.35637,0 9.72209,-4.63896 20.81272,-10.30879 z m -274.81816,-4.72303 c 17.6333,-1.13837 28.43879,-3.36887 41.28234,-8.52163 17.60151,-7.06163 31.59152,-16.76912 46.20059,-32.05802 22.41571,-23.4588 36.43501,-52.20231 43.11044,-88.38853 2.23195,-12.09898 2.31698,-14.6285 2.65046,-78.84701 l 0.34454,-66.347 -6.4404,-9.70476 c -16.3278,-24.60365 -26.67371,-50.2216 -31.33958,-77.60123 -2.47811,-14.54172 -2.44792,-46.41845 0.0573,-60.5 5.00942,-28.15737 15.99335,-55.66822 32.25383,-80.78441 C 363.27194,182.05575 364,180.26328 364,176.0109 c 0,-4.76928 -0.0997,-4.9375 -3.25,-5.48155 -1.7875,-0.3087 -26.875,-3.2446 -55.75,-6.52423 -28.875,-3.27962 -53.7375,-6.18618 -55.25,-6.45903 L 247,157.05 246.9773,338.275 c -0.0134,107.14791 -0.41773,186.30647 -0.98914,193.6565 -1.54945,19.93068 -6.52364,34.26974 -15.12523,43.60137 -4.66598,5.06199 -8.71302,6.66713 -16.80985,6.66713 -7.14657,0 -9.14427,-1.01873 -13.00692,-6.6329 -8.07451,-11.73589 -11.97588,-33.04904 -12.78003,-69.8171 l -0.5413,-24.75 -4.61242,0.0435 c -4.43503,0.0418 -84.044668,6.28424 -98.779992,7.74568 -3.942165,0.39098 -7.463234,1.00694 -7.824599,1.3688 -0.983645,0.985 1.268385,43.02054 3.029577,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 18.20693,12.2292 38.0906,18.99977 61.58445,20.97004 4.95,0.41513 9.23268,0.8189 9.51707,0.89728 0.28438,0.0784 7.70938,-0.32182 16.5,-0.88932 z M 439,690.8296 c 0,-0.95655 -48.58845,-105.4852 -49.59665,-106.6976 -0.16831,-0.2024 -0.5791,0.9226 -0.91287,2.5 -1.77533,8.39014 -10.32441,32.74924 -14.45461,41.18586 -11.20086,22.87965 -27.99337,44.89056 -44.38814,58.18214 -3.05284,2.475 -5.57247,4.8375 -5.59918,5.25 -0.0267,0.4125 25.82645,0.75 57.45145,0.75 43.2477,0 57.5,-0.2901 57.5,-1.1704 z M 596.91469,674.89042 C 622.73294,660.90257 642.80622,640.49368 657.78736,613 c 3.87519,-7.11182 10.06515,-27.74579 12.14955,-40.5 2.11312,-12.92992 2.12289,-13.8652 1.81286,-173.5 -0.31146,-160.36646 -0.31353,-160.50931 -2.49856,-171.68601 -6.1602,-31.5103 -19.44712,-56.03074 -41.82714,-77.19023 -5.4544,-5.15693 -13.16415,-11.45693 -17.13277,-14 -3.96863,-2.54307 -8.6952,-5.61355 -10.5035,-6.82329 -9.80772,-6.56134 -28.32717,-13.13693 -44.45011,-15.78264 -18.16977,-2.98159 -20.46085,-9.44228 20.65918,58.25757 C 595.79859,204.37687 612,231.22526 612,231.43849 c 0,0.21323 -6.4125,3.87249 -14.25,8.13168 -41.10101,22.33586 -71.20871,43.11313 -80.17644,55.32962 -3.26869,4.45285 -3.5474,5.28068 -2.46138,7.31083 2.50528,4.6832 12.88503,14.45462 29.88782,28.13618 20.3874,16.40503 51.72765,47.05789 64.0582,62.6532 27.7717,35.12482 43.95931,70.11911 49.49606,107.00033 1.8711,12.46372 2.08271,37.67142 0.42392,50.49967 -5.50033,42.53697 -24.60144,80.01896 -59.04696,115.8675 C 593.25527,673.31538 588.13879,679 588.56126,679 c 0.42246,0 4.18151,-1.84931 8.35343,-4.10958 z M 409.96664,568.40669 c 29.56534,-13.97214 43.04996,-22.33683 52.54885,-32.59676 6.71443,-7.25239 7.31053,-9.26685 4.42217,-14.9442 -5.64154,-11.089 -19.3473,-25.11607 -43.52877,-44.54926 -8.30011,-6.67029 -17.86261,-14.69373 -21.25,-17.82985 L 396,452.78457 l -0.018,31.85772 c -0.0206,36.48219 -1.31917,66.60308 -3.46446,80.35771 -1.57274,10.08369 -1.75257,12 -1.12608,12 0.21532,0 8.57414,-3.86699 18.57514,-8.59331 z M 150.5,451.00005 c 29.7,-2.20368 55.9125,-4.25778 58.25,-4.56465 L 213,445.87745 213,283.93873 213,122 l 2.30435,0 c 1.26739,0 40.52989,4.25141 87.25,9.44757 46.72011,5.19616 86.82654,9.55727 89.1254,9.69136 4.09997,0.23914 4.42956,0.002 17.26624,-12.43516 7.19757,-6.97342 14.20418,-13.41129 15.57025,-14.30637 1.36607,-0.89508 2.48376,-2.04314 2.48376,-2.55125 0,-0.56149 -41.27986,-0.7849 -105.25,-0.56961 l -105.25,0.35421 -13.61985,3.08038 C 188.88396,117.87662 170.96211,124.6859 161.5,130.43321 143.89487,141.12662 125.66136,157.99248 116.56255,172 c -2.67946,4.125 -6.33357,9.75 -8.12024,12.5 C 105.12784,189.60154 99,203.9603 99,206.62522 c 0,0.81075 -0.707211,2.84169 -1.571579,4.5132 -0.864369,1.6715 -2.532821,8.06166 -3.707672,14.20034 -2.08628,10.90097 -2.143784,13.70884 -2.465966,120.41124 L 90.924908,455 l 2.787546,0.003 C 95.245604,455.005 120.8,453.20336 150.5,450.99967 z"
+       id="path3264"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#060401"
+       d="m 459.28602,732.75 -8.05795,-17.25 -84.2428,-0.25571 -84.24279,-0.2557 -9.24163,2.96036 C 246.90282,726.46906 212.24099,728.60915 184,723.47491 134.40314,714.45816 91.912671,680.55062 68.117147,631 50.109991,593.50279 44.074734,556.0357 44.017079,481.38592 L 44,459.27185 48.639571,458.63592 C 51.191335,458.28617 55.185085,458 57.514571,458 c 2.329486,0 5.62721,-0.27836 7.328276,-0.61857 l 3.092846,-0.61857 0.311237,-114.13143 C 68.55264,230.52664 68.59606,228.32169 70.692148,218.45822 77.484307,186.49666 93.526893,157.19424 116.17903,135.37463 125.32044,126.56919 145.0954,111 147.13807,111 c 0.54746,0 2.42785,-1.0725 4.17865,-2.38333 7.99439,-5.98544 37.14547,-15.598777 59.68328,-19.682144 2.475,-0.448417 59.625,-0.843286 127,-0.877486 l 122.5,-0.06218 5.9092,-3.563164 c 15.6008,-9.407058 41.93127,-23.479728 42.56674,-22.75036 0.39229,0.450266 4.16009,6.490141 8.37288,13.421945 l 7.65962,12.60328 14.24578,0.59237 c 17.43898,0.725149 28.85928,2.674165 43.24578,7.380427 11.15142,3.647968 26.29156,10.482942 32.2878,14.576242 1.8083,1.23442 6.5333,4.32671 10.5,6.87176 9.05166,5.80755 29.05894,24.87648 36.59789,34.88142 7.91085,10.4985 20.03821,31.21018 20.08619,34.30417 0.0155,0.99712 1.0992,4.14712 2.40829,7 3.21902,7.01514 5.6406,15.48715 7.3422,25.68705 0.77991,4.675 1.80358,10.75 2.27482,13.5 0.47124,2.75 0.88966,79.20001 0.92981,169.88891 0.0718,162.22093 0.0396,165.08475 -1.99211,176.99272 -5.86285,34.36272 -20.04154,61.73154 -44.90824,86.68544 -14.00924,14.05836 -24.9163,22.35385 -38.07046,28.95492 -21.92057,11.00025 -38.92423,16.29747 -61.95619,19.30146 -8.89598,1.16028 -10.23118,1.65859 -21,7.83752 -6.325,3.62915 -15.17974,8.44114 -19.6772,10.6933 C 496.18229,738.43303 470.02042,750 468.54303,750 c -0.65948,0 -4.82514,-7.7625 -9.25701,-17.25 z m 46.04921,-36.05879 c 21.791,-11.14017 35.74337,-19.99751 51.88068,-32.93524 36.81775,-29.51782 59.4246,-63.92924 67.89193,-103.3429 2.67905,-12.4704 3.72295,-41.23028 1.94589,-53.61003 C 621.58211,468.68545 603.81694,434.46692 570.09171,397.0852 560.39128,386.33305 542.46752,369.98448 523.94348,354.99262 493.32192,330.20999 481,313.84338 481,297.95286 c 0,-16.87337 25.6563,-41.90821 70.67202,-68.96018 14.72853,-8.85103 15.33271,-9.33993 14.0519,-11.37069 C 564.98783,216.4549 550.3131,192.325 533.1134,164 515.91371,135.675 500.59075,111.01842 499.06239,109.20759 l -2.77885,-3.29241 -8.74539,4.5369 C 477.37434,115.72482 463.46564,125.1538 450,135.89992 c -17.07558,13.627 -48.65494,45.77178 -53.30998,54.26448 -0.70411,1.28458 -4.95218,7.89719 -9.44015,14.69469 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.66774,6.73898 -3.08604,7.03107 -1.22151,0.85294 -5.65056,19.67436 -6.92359,29.42206 -1.49683,11.4614 -0.64587,40.57516 1.46281,50.04687 2.34119,10.51612 4.99939,19.5 5.76975,19.5 0.37671,0 1.23409,1.6875 1.90527,3.75 3.77638,11.60451 13.95783,30.01429 24.09153,43.56155 3.21378,4.29635 5.84324,8.29313 5.84324,8.88173 0,2.12035 31.77458,32.68182 44,42.32015 32.58994,25.69338 49.77024,43.80636 58.19292,61.35206 4.29304,8.94303 5.06979,20.82155 1.90515,29.13451 -6.1234,16.08508 -25.32447,32.64208 -56.26452,48.51663 l -13.74779,7.05364 22.55422,47.96486 C 465.0448,668.91581 475.77936,691.175 476.49454,692 c 0.71518,0.825 2.66826,4.5375 4.34018,8.25 1.67192,3.7125 3.33142,6.75 3.68779,6.75 0.35637,0 9.72209,-4.63896 20.81272,-10.30879 z m -274.81816,-4.72303 c 17.6333,-1.13837 28.43879,-3.36887 41.28234,-8.52163 C 289.40092,676.38492 303.39093,666.67743 318,651.38853 340.41545,627.93 354.43385,599.18859 361.11082,563 c 2.23385,-12.10724 2.31676,-14.58951 2.63889,-79 l 0.33258,-66.5 -7.55533,-11.41563 C 333.7884,371.72787 322.66575,332.82665 324.33679,293.5 325.902,256.66417 336.24771,225.0234 358.13093,190.14585 363.19739,182.07092 364,180.12838 364,175.94117 c 0,-4.69061 -0.10716,-4.86905 -3.25,-5.41182 -1.7875,-0.3087 -26.875,-3.2446 -55.75,-6.52423 -28.875,-3.27962 -53.7375,-6.18618 -55.25,-6.45903 L 247,157.05 246.9773,338.275 c -0.0134,107.14791 -0.41773,186.30647 -0.98914,193.6565 -1.54945,19.93068 -6.52364,34.26974 -15.12523,43.60137 -4.66598,5.06199 -8.71302,6.66713 -16.80985,6.66713 -7.14657,0 -9.14427,-1.01873 -13.00692,-6.6329 -8.07451,-11.73589 -11.97588,-33.04904 -12.78003,-69.8171 l -0.5413,-24.75 -4.61242,0.0435 c -4.43503,0.0418 -84.044668,6.28424 -98.779992,7.74568 -3.942165,0.39098 -7.463234,1.00694 -7.824599,1.3688 -0.983645,0.985 1.268385,43.02054 3.029577,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 18.20693,12.2292 38.0906,18.99977 61.58445,20.97004 4.95,0.41513 9.23268,0.8189 9.51707,0.89728 0.28438,0.0784 7.70938,-0.32182 16.5,-0.88932 z M 439,690.8296 c 0,-0.95655 -48.58845,-105.4852 -49.59665,-106.6976 -0.16831,-0.2024 -0.5791,0.9226 -0.91287,2.5 -1.77533,8.39014 -10.32441,32.74924 -14.45461,41.18586 -11.20086,22.87965 -27.99337,44.89056 -44.38814,58.18214 -3.05284,2.475 -5.57247,4.8375 -5.59918,5.25 -0.0267,0.4125 25.82645,0.75 57.45145,0.75 43.2477,0 57.5,-0.2901 57.5,-1.1704 z M 596.91469,674.89042 C 622.73294,660.90257 642.80622,640.49368 657.78736,613 c 3.87519,-7.11182 10.06515,-27.74579 12.14955,-40.5 2.11312,-12.92992 2.12289,-13.8652 1.81286,-173.5 -0.31146,-160.36646 -0.31353,-160.50931 -2.49856,-171.68601 -6.1602,-31.5103 -19.44712,-56.03074 -41.82714,-77.19023 -5.4544,-5.15693 -13.16415,-11.45693 -17.13277,-14 -3.96863,-2.54307 -8.6952,-5.61355 -10.5035,-6.82329 -9.80772,-6.56134 -28.32717,-13.13693 -44.45011,-15.78264 -18.16977,-2.98159 -20.46085,-9.44228 20.65918,58.25757 C 595.79859,204.37687 612,231.22526 612,231.43849 c 0,0.21323 -6.4125,3.87249 -14.25,8.13168 -41.10101,22.33586 -71.20871,43.11313 -80.17644,55.32962 -3.26869,4.45285 -3.5474,5.28068 -2.46138,7.31083 2.50528,4.6832 12.88503,14.45462 29.88782,28.13618 20.3874,16.40503 51.72765,47.05789 64.0582,62.6532 27.7717,35.12482 43.95931,70.11911 49.49606,107.00033 1.8711,12.46372 2.08271,37.67142 0.42392,50.49967 -5.50033,42.53697 -24.60144,80.01896 -59.04696,115.8675 C 593.25527,673.31538 588.13879,679 588.56126,679 c 0.42246,0 4.18151,-1.84931 8.35343,-4.10958 z M 409.96664,568.40669 c 29.56534,-13.97214 43.04996,-22.33683 52.54885,-32.59676 6.71443,-7.25239 7.31053,-9.26685 4.42217,-14.9442 -5.64154,-11.089 -19.3473,-25.11607 -43.52877,-44.54926 -8.30011,-6.67029 -17.86261,-14.69373 -21.25,-17.82985 L 396,452.78457 l -0.018,31.85772 c -0.0206,36.48219 -1.31917,66.60308 -3.46446,80.35771 -1.57274,10.08369 -1.75257,12 -1.12608,12 0.21532,0 8.57414,-3.86699 18.57514,-8.59331 z M 150.5,451.00005 c 29.7,-2.20368 55.9125,-4.25778 58.25,-4.56465 L 213,445.87745 213,283.93873 213,122 l 2.30435,0 c 1.26739,0 40.52989,4.25141 87.25,9.44757 46.72011,5.19616 86.82654,9.55727 89.1254,9.69136 4.09997,0.23914 4.42956,0.002 17.26624,-12.43516 7.19757,-6.97342 14.20418,-13.41129 15.57025,-14.30637 1.36607,-0.89508 2.48376,-2.04314 2.48376,-2.55125 0,-0.56149 -41.27986,-0.7849 -105.25,-0.56961 l -105.25,0.35421 -13.61985,3.08038 c -13.97225,3.16008 -31.87652,9.95841 -41.38015,15.71224 -20.10055,12.16955 -40.28151,31.71056 -48.61837,47.07663 -1.19361,2.2 -3.24518,5.41202 -4.55904,7.13782 C 105.78358,187.97289 99,203.90651 99,206.53519 c 0,0.86027 -0.736603,2.98856 -1.636895,4.72954 -0.900293,1.74097 -2.548626,7.90612 -3.662963,13.70034 -1.942722,10.10156 -2.04147,15.04964 -2.400495,120.28493 L 90.925219,455 93.71261,455.003 C 95.245674,455.005 120.8,453.20336 150.5,450.99967 z"
+       id="path3262"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#040300"
+       d="m 459.28602,732.75 -8.05795,-17.25 -84.2428,-0.25571 -84.24279,-0.2557 -9.24163,2.96036 C 246.90282,726.46906 212.24099,728.60915 184,723.47491 134.40314,714.45816 91.912671,680.55062 68.117147,631 50.109991,593.50279 44.074734,556.0357 44.017079,481.38592 L 44,459.27185 48.639571,458.63592 C 51.191335,458.28617 55.185085,458 57.514571,458 c 2.329486,0 5.62721,-0.27836 7.328276,-0.61857 l 3.092846,-0.61857 0.311237,-114.13143 C 68.55264,230.52664 68.59606,228.32169 70.692148,218.45822 77.484307,186.49666 93.526893,157.19424 116.17903,135.37463 125.32044,126.56919 145.0954,111 147.13807,111 c 0.54746,0 2.42785,-1.0725 4.17865,-2.38333 7.99439,-5.98544 37.14547,-15.598777 59.68328,-19.682144 2.475,-0.448417 59.625,-0.843286 127,-0.877486 l 122.5,-0.06218 5.9092,-3.563164 c 15.6008,-9.407058 41.93127,-23.479728 42.56674,-22.75036 0.39229,0.450266 4.16009,6.490141 8.37288,13.421945 l 7.65962,12.60328 14.24578,0.59237 c 17.43898,0.725149 28.85928,2.674165 43.24578,7.380427 11.15142,3.647968 26.29156,10.482942 32.2878,14.576242 1.8083,1.23442 6.5333,4.32671 10.5,6.87176 9.05166,5.80755 29.05894,24.87648 36.59789,34.88142 7.91085,10.4985 20.03821,31.21018 20.08619,34.30417 0.0155,0.99712 1.0992,4.14712 2.40829,7 3.21902,7.01514 5.6406,15.48715 7.3422,25.68705 0.77991,4.675 1.80358,10.75 2.27482,13.5 0.47124,2.75 0.88966,79.20001 0.92981,169.88891 0.0718,162.22093 0.0396,165.08475 -1.99211,176.99272 -5.86285,34.36272 -20.04154,61.73154 -44.90824,86.68544 -14.00924,14.05836 -24.9163,22.35385 -38.07046,28.95492 -21.92057,11.00025 -38.92423,16.29747 -61.95619,19.30146 -8.89598,1.16028 -10.23118,1.65859 -21,7.83752 -6.325,3.62915 -15.17974,8.44114 -19.6772,10.6933 C 496.18229,738.43303 470.02042,750 468.54303,750 c -0.65948,0 -4.82514,-7.7625 -9.25701,-17.25 z m 44.94842,-35.44631 C 571.70757,663.21201 612.67103,616.96195 625.09141,560.84933 628.337,546.18647 628.866,517.24845 626.17634,501.5 617.59535,451.25659 584.32897,403.26524 525.5046,356.2671 494.80769,331.74159 481,313.71348 481,298.15934 c 0,-17.42536 25.71155,-42.37468 72.24792,-70.10609 11.53065,-6.87122 13.60024,-8.46352 12.83226,-9.87288 -4.69907,-8.62346 -64.31908,-105.64843 -66.6743,-108.50503 l -3.09412,-3.75281 -7.40588,3.70554 c -14.79758,7.40398 -38.5188,24.87236 -56.40588,41.53746 -15.23663,14.19571 -32.54554,33.02499 -35.75826,38.89917 -0.73255,1.33942 -5.0039,7.99689 -9.49187,14.79439 -8.46021,12.81384 -16.29518,27.91109 -20.31284,39.14091 -1.27902,3.575 -2.66774,6.73898 -3.08604,7.03107 -1.22151,0.85294 -5.65056,19.67436 -6.92359,29.42206 -1.49683,11.4614 -0.64587,40.57516 1.46281,50.04687 2.34119,10.51612 4.99939,19.5 5.76975,19.5 0.37671,0 1.23409,1.6875 1.90527,3.75 3.77638,11.60451 13.95783,30.01429 24.09153,43.56155 3.21378,4.29635 5.84324,8.17191 5.84324,8.61237 0,1.21522 13.44226,15.5508 23.1779,24.71821 4.75575,4.47817 15.09875,13.30809 22.98445,19.62206 26.78303,21.44476 40.68037,35.21459 50.60694,50.14259 9.06264,13.62879 11.60068,27.24586 7.23285,38.80571 -5.97869,15.82317 -25.37551,32.50499 -56.16148,48.30049 l -13.74067,7.04998 22.52929,47.96852 c 12.39111,26.38269 23.12246,48.64352 23.84744,49.46852 0.72498,0.825 2.68608,4.5375 4.358,8.25 1.67192,3.7125 3.30293,6.75 3.62447,6.75 0.32154,0 9.22041,-4.36334 19.77525,-9.69631 z m -273.64045,-5.30054 c 18.41758,-1.12031 30.04548,-3.70598 44.29739,-9.85031 15.7473,-6.78903 26.33097,-14.06137 39.95092,-27.45138 C 337.33998,632.58361 352.51893,604.15372 359.5312,571 363.53978,552.04763 364,542.57283 364,478.99831 l 0,-61.57771 -7.51419,-11.37592 C 333.76734,371.65058 322.66721,332.79217 324.33679,293.5 325.902,256.66417 336.24771,225.0234 358.13093,190.14585 363.20865,182.05296 364,180.13415 364,175.91491 c 0,-4.2502 -0.2891,-4.93776 -2.25,-5.3512 -1.2375,-0.26092 -26.55,-3.21031 -56.25,-6.55419 -29.7,-3.34389 -54.99506,-6.29318 -56.21124,-6.55398 l -2.21125,-0.47419 -0.33762,190.25933 -0.33762,190.25932 -2.14811,9.37214 c -3.8938,16.98847 -12.7633,31.49064 -20.90248,34.17681 -1.91824,0.63308 -6.21452,1.15105 -9.54728,1.15105 -7.87842,0 -10.25019,-1.77678 -15.05777,-11.28037 -7.05131,-13.93895 -9.66452,-30.10315 -10.45491,-64.66963 l -0.57737,-25.25 -4.60717,0.0435 c -4.43136,0.0418 -84.050088,6.28529 -98.774752,7.74568 -3.942165,0.39098 -7.463234,1.00694 -7.824599,1.3688 -0.983645,0.985 1.268385,43.02054 3.029577,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 18.20693,12.2292 38.0906,18.99977 61.58445,20.97004 4.95,0.41513 9.225,0.81488 9.5,0.88834 0.275,0.0735 7.74229,-0.30698 16.59399,-0.84541 z M 439,690.78849 c 0,-0.99129 -48.56897,-105.44963 -49.59102,-106.65649 -0.1714,-0.2024 -0.58473,0.9226 -0.9185,2.5 -1.65422,7.81777 -10.05549,31.94299 -14.00615,40.22025 C 363.81518,649.2058 347.478,670.88568 330.66624,685 c -3.60311,3.025 -6.57702,5.8375 -6.60868,6.25 -0.0317,0.4125 25.81744,0.75 57.44244,0.75 44.35908,0 57.5,-0.27688 57.5,-1.21151 z m 158.6939,-16.36557 c 13.66641,-7.44957 19.89516,-12.03258 31.20861,-22.96279 11.79748,-11.39784 19.91048,-22.20929 29.07816,-38.74979 2.91585,-5.26084 9.77922,-25.80105 10.52579,-31.50086 0.33927,-2.59021 1.28879,-8.08448 2.11005,-12.20948 1.295,-6.50448 1.45273,-28.93686 1.18834,-169 -0.2885,-152.8367 -0.4049,-162.00961 -2.17003,-171 -2.02405,-10.30917 -4.92229,-20.2561 -9.32385,-32 -8.8288,-23.55628 -36.00992,-54.70594 -57.03163,-65.35845 -2.82579,-1.43193 -5.42649,-3.07063 -5.77934,-3.64155 -2.20828,-3.57308 -27.2718,-12.19802 -42.23965,-14.53565 -18.07815,-2.82338 -20.39088,-9.33545 20.71703,58.334 C 595.78982,204.41244 612,231.24708 612,231.43089 c 0,0.1838 -6.4125,3.83862 -14.25,8.12182 -42.38357,23.16264 -72.58529,44.08029 -80.72372,55.90909 -2.70432,3.9306 -2.95087,4.81072 -1.89864,6.77769 2.2763,4.25519 12.37202,14.03161 24.87236,24.0857 56.08705,45.11113 90.09905,86.84545 107.31033,131.67481 9.047,23.56425 12.69943,42.90277 12.77207,67.62425 0.0914,31.10399 -5.49221,55.9474 -18.62652,82.87575 -10.10151,20.71041 -23.48344,39.21504 -42.84033,59.23993 C 592.6291,673.93297 588.08345,679 588.51411,679 c 0.43066,0 4.56157,-2.05969 9.17979,-4.57708 z M 410.67173,568.10874 c 27.85994,-13.15628 38.31542,-19.42389 48.86582,-29.29294 3.34216,-3.12632 6.94848,-7.3031 8.01405,-9.28176 l 1.93741,-3.59755 -3.47025,-6.71824 c -4.58476,-8.87588 -22.36267,-26.80707 -42.60987,-42.97725 -8.30011,-6.62879 -17.86261,-14.61826 -21.25,-17.75438 L 396,452.78457 l -0.018,31.35772 c -0.021,36.60303 -1.28939,66.25926 -3.44891,80.63714 C 390.88556,575.74878 390.77177,577 391.42173,577 c 0.23195,0 8.89445,-4.00107 19.25,-8.89126 z M 150.7739,450.99918 c 29.54936,-2.20045 55.6386,-4.25302 57.9761,-4.56127 L 213,445.87745 213,283.93873 213,122 l 2.37316,0 c 1.74831,0 148.4845,16.06824 176.76173,19.35616 3.40329,0.39572 4.10415,-0.0545 11,-7.06633 4.05081,-4.11894 10.96511,-10.67622 15.36511,-14.57172 4.4,-3.89551 8.15523,-7.46639 8.34496,-7.93529 0.18972,-0.46891 -47.06028,-0.69694 -105,-0.50674 L 216.5,111.62189 202.88015,114.7067 c -15.41087,3.49046 -32.20555,10.12924 -44.1168,17.43897 -18.55215,11.38512 -37.74525,30.3576 -45.88172,45.35433 -1.19361,2.2 -3.24518,5.41202 -4.55904,7.13782 C 105.78358,187.97289 99,203.90651 99,206.53519 c 0,0.86027 -0.736603,2.98856 -1.636895,4.72954 -0.900293,1.74097 -2.548626,7.90612 -3.662963,13.70034 -1.942722,10.10156 -2.04147,15.04964 -2.400495,120.28493 L 90.925219,455 l 3.061293,0 c 1.68371,0 27.238038,-1.80037 56.787388,-4.00082 z"
+       id="path3260"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#000000"
+       d="m 459.31466,732.75 -8.00766,-17.25 -84.3829,-0.25573 -84.38289,-0.25572 -7.52061,2.45816 c -19.17266,6.26673 -35.06401,8.62045 -57.99034,8.58917 -49.0564,-0.0669 -85.8767,-15.67885 -118.473287,-50.23299 C 73.060087,648.77481 56.396174,612.78075 49.1112,569 45.81379,549.18344 45.006081,537.01541 44.321935,496.85028 l -0.6413,-37.64971 7.909682,-0.63345 c 4.350326,-0.34839 9.805986,-0.86867 12.12369,-1.15616 L 67.928014,456.88825 68.235767,342.69412 68.543519,228.5 70.868345,218 c 3.767804,-17.01716 12.173208,-39.17829 17.616585,-46.44672 1.257645,-1.6793 3.228788,-4.92974 4.380317,-7.2232 9.123113,-18.17012 35.087803,-42.30353 62.478163,-58.07158 6.05481,-3.48563 29.30955,-11.61086 41.42128,-14.472646 L 210.5,88.540444 336,88.020222 461.5,87.5 l 6,-3.642515 c 14.9405,-9.070165 40.83011,-22.916236 41.46465,-22.175782 0.38568,0.450064 4.14255,6.486661 8.3486,13.414661 l 7.64735,12.596363 14.2697,0.618567 c 7.84834,0.340211 18.3197,1.335451 23.2697,2.211644 15.98974,2.830323 41.9401,12.630762 52.25566,19.734932 1.79062,1.23317 6.29062,4.17236 10,6.53152 14.01786,8.91534 39.27591,35.38353 45.39285,47.56766 1.14396,2.27862 3.08969,5.49295 4.32384,7.14295 3.00761,4.02105 7.52765,13.04575 7.52765,15.02971 0,0.8779 1.06733,3.93036 2.37185,6.78324 2.48143,5.4267 4.10132,10.79364 5.79117,19.18705 0.55366,2.75 1.75481,7.925 2.66923,11.5 1.51222,5.91219 1.6872,21.71727 1.93493,174.77305 0.26889,166.13406 0.24609,168.42697 -1.79376,180.38271 -1.13636,6.66032 -3.44907,16.43745 -5.13935,21.72696 -3.77301,11.8071 -11.10418,28.6904 -13.68728,31.52109 -1.05206,1.1529 -2.70272,3.67119 -3.66811,5.59619 -5.91595,11.79635 -24.60774,32.08489 -41.58386,45.13615 -20.08655,15.44257 -54.68858,28.54349 -82.89482,31.3854 -5.56497,0.56069 -8.22621,1.63084 -18.5,7.43924 -6.6,3.73138 -15.375,8.48616 -19.5,10.56618 C 497.93728,737.60106 469.87702,750 468.45648,750 c -0.62379,0 -4.73761,-7.7625 -9.14182,-17.25 z m 44.95725,-35.45486 c 29.54487,-14.91197 52.21679,-30.85182 72.24806,-50.79514 25.79445,-25.68119 41.38001,-53.18066 48.58796,-85.72958 3.22854,-14.5791 3.75101,-43.5633 1.06841,-59.27042 -5.15794,-30.20075 -19.32568,-59.63225 -42.84284,-89 C 567.65838,392.92523 550.22379,376.09231 522,353.28313 c -27.9725,-22.6061 -41,-40.12135 -41,-55.12379 0,-15.49136 21.66884,-38.20075 59.09402,-61.93176 6.82329,-4.32659 15.43947,-9.55926 19.14708,-11.62814 3.7076,-2.06889 6.94831,-4.09689 7.20157,-4.50668 0.57128,-0.92435 -62.77299,-105.2689 -67.03679,-110.42708 l -3.09412,-3.74315 -7.40588,3.71117 c -17.74762,8.89351 -45.65928,30.35719 -66.5202,51.15309 C 411.61497,171.52394 396,189.29493 396,190.81566 c 0,0.41123 -3.76657,6.44144 -8.37017,13.40046 -8.63173,13.04817 -16.62737,28.42054 -20.6928,39.78388 -1.27902,3.575 -2.65383,6.73039 -3.05515,7.01198 -1.17032,0.82117 -4.83542,15.66767 -6.41555,25.98802 -1.87466,12.24396 -1.86901,35.98468 0.0113,47.5 1.72392,10.55755 5.33037,24.75566 6.4742,25.48802 0.43978,0.28159 2.23208,4.11198 3.98288,8.51198 5.25639,13.21003 15.76114,31.15305 24.68746,42.1683 1.8578,2.29256 3.37782,4.61704 3.37782,5.1655 0,1.49477 14.09599,16.58908 23.88458,25.57617 4.73848,4.35049 14.91542,12.95734 22.61542,19.12633 33.65289,26.96163 50.46512,45.50588 57.00307,62.87564 3.18208,8.454 3.37029,18.20274 0.4981,25.80055 -5.94475,15.72565 -25.0909,32.17324 -56.21812,48.29443 l -13.71695,7.10418 22.54446,47.94445 C 465.01002,668.925 475.74899,691.175 476.47495,692 c 0.72596,0.825 2.68785,4.5375 4.35977,8.25 1.67192,3.7125 3.30293,6.75 3.62447,6.75 0.32154,0 9.23727,-4.36719 19.81272,-9.70486 z M 247,690.462 C 296.23875,682.47536 338.94516,641.71401 355.399,587 363.19865,561.0638 364,550.97819 364,478.74972 l 0,-61.32912 -7.51229,-11.37306 C 319.52128,350.0831 313.9691,283.50608 341.11594,221.72245 c 4.4185,-10.0561 11.67028,-23.37306 18.51674,-34.00363 3.65487,-5.67496 4.36732,-7.58865 4.36732,-11.73095 0,-4.32586 -0.28361,-5.00956 -2.25,-5.42416 -1.2375,-0.26092 -26.55,-3.21031 -56.25,-6.55419 -29.7,-3.34389 -54.99506,-6.29318 -56.21124,-6.55398 l -2.21125,-0.47419 -0.33762,190.25933 -0.33762,190.25932 -2.14811,9.37214 c -3.8938,16.98847 -12.7633,31.49064 -20.90248,34.17681 -1.91824,0.63308 -6.21452,1.15105 -9.54728,1.15105 -7.87842,0 -10.25019,-1.77678 -15.05777,-11.28037 -7.05131,-13.93895 -9.66452,-30.10315 -10.45491,-64.66963 l -0.57737,-25.25 -4.60717,0.0435 c -4.43136,0.0418 -84.050088,6.28529 -98.774752,7.74568 -3.942165,0.39098 -7.463234,1.00694 -7.824599,1.3688 -0.983645,0.985 1.268385,43.02054 3.029577,56.54893 4.882919,37.50759 15.107784,67.90472 30.662044,91.15408 6.20746,9.27846 23.93883,27.23374 32.7161,33.12924 13.37052,8.98069 31.01066,16.25846 46.12863,19.03122 16.03524,2.941 41.35381,3.13348 57.95582,0.4406 z m 191.61976,-1.712 c -2.01177,-4.64671 -48.82308,-104.17564 -49.20484,-104.618 -0.17467,-0.2024 -0.59067,0.9226 -0.92444,2.5 -1.83434,8.66904 -10.22446,32.32418 -14.84994,41.868 -10.09618,20.8316 -28.202,44.45941 -44.0147,57.4385 -3.64421,2.99117 -6.62584,5.57867 -6.62584,5.75 0,0.17132 26.33104,0.3115 58.51342,0.3115 l 58.51342,0 -1.40708,-3.25 z m 157.73401,-13.47046 c 22.45217,-11.68901 44.01535,-31.82219 54.71469,-51.08619 1.12822,-2.03134 3.61337,-6.16835 5.52256,-9.19335 4.00493,-6.3456 11.57631,-29.48919 13.57663,-41.5 1.07163,-6.43453 1.33235,-39.89647 1.33235,-171 l 0,-163 -2.27755,-12.15584 c -1.25265,-6.68572 -3.36484,-15.23572 -4.69375,-19 -5.36458,-15.19579 -7.782,-20.98441 -9.95771,-23.84416 -1.25533,-1.65 -3.25901,-4.8 -4.45262,-7 -8.1413,-15.00563 -31.6639,-38.20341 -46.15675,-45.51937 -3.19876,-1.61473 -6.10424,-3.40237 -6.45662,-3.97254 -2.22117,-3.59393 -27.89479,-12.43208 -42.35863,-14.58198 -17.91831,-2.66336 -20.25372,-9.2093 20.86548,58.4841 26.90693,44.29614 35.75705,59.62586 34.78794,60.25787 -0.71489,0.4662 -7.59979,4.30163 -15.29979,8.52318 -40.99754,22.47699 -70.38514,43.01419 -78.56642,54.90527 -2.61846,3.80581 -2.85608,4.67989 -1.80594,6.64296 2.2763,4.25519 12.37202,14.03161 24.87236,24.0857 55.3538,44.52137 88.56049,84.94207 106.48526,129.61872 9.50958,23.70218 13.51682,44.42283 13.54838,70.05609 0.0385,31.22368 -5.44512,55.57507 -18.57776,82.5 -10.10151,20.71041 -23.48344,39.21504 -42.84033,59.23993 C 592.6291,673.93297 588.06329,679 588.46931,679 c 0.40602,0 3.95403,-1.67421 7.88446,-3.72046 z M 410.17069,568.37122 c 21.48144,-10.1127 31.85635,-15.81017 40.8935,-22.45705 8.17137,-6.01008 16.63274,-14.85847 17.49541,-18.29563 1.96905,-7.84531 -15.48754,-27.64185 -45.57997,-51.68967 -7.9638,-6.36412 -17.29213,-14.1751 -20.72963,-17.35772 l -6.25,-5.78658 -0.022,30.85772 c -0.026,36.5028 -1.38692,68.35605 -3.45458,80.85771 -1.5426,9.32705 -1.82252,12.5 -1.10274,12.5 0.23137,0 8.66887,-3.88295 18.75,-8.62878 z M 150.7739,450.99918 c 29.54936,-2.20045 55.6386,-4.25302 57.9761,-4.56127 L 213,445.87745 213,283.93873 213,122 l 2.36755,0 c 1.30216,0 40.78966,4.26782 87.75,9.48405 46.96035,5.21623 86.95745,9.65728 88.88245,9.86899 3.27564,0.36025 4.20512,-0.29889 14.5,-10.28276 6.05,-5.86722 13.475,-12.79685 16.5,-15.39917 l 5.5,-4.73149 -106.5,0.3417 -106.5,0.3417 -11.39002,2.65463 c -30.55166,7.12056 -50.34822,17.8621 -71.96944,39.05032 -8.86034,8.68291 -13.417,14.41074 -19.14054,24.06014 -1.375,2.31813 -3.625,5.76663 -5,7.66333 -2.87902,3.97139 -6.74229,12.63632 -8.225312,18.44856 -0.56134,2.2 -1.832418,5.8 -2.824619,8 -1.652833,3.66482 -2.42761,7.77625 -4.993779,26.5 -0.489969,3.575 -0.905576,53.8625 -0.923571,111.75 L 91,455 l 3.023902,0 c 1.663146,0 27.200648,-1.80037 56.749998,-4.00082 z"
+       id="path3258"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
diff --git a/deps/jerry/README.md b/deps/jerry/README.md
new file mode 100644 (file)
index 0000000..7ae0609
--- /dev/null
@@ -0,0 +1,62 @@
+![](https://github.com/jerryscript-project/jerryscript/blob/master/LOGO.png)
+# JerryScript: JavaScript engine for the Internet of Things
+[![License](https://img.shields.io/badge/licence-Apache%202.0-brightgreen.svg?style=flat)](LICENSE)
+[![Build Status](https://travis-ci.org/jerryscript-project/jerryscript.svg?branch=master)](https://travis-ci.org/jerryscript-project/jerryscript)
+[![Coverity Scan Build Status](https://scan.coverity.com/projects/12127/badge.svg)](https://scan.coverity.com/projects/jerryscript-project)
+[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjerryscript-project%2Fjerryscript.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjerryscript-project%2Fjerryscript?ref=badge_shield)
+[![IRC Channel](https://img.shields.io/badge/chat-on%20freenode-brightgreen.svg)](https://kiwiirc.com/client/irc.freenode.net/#jerryscript)
+
+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](http://jerryscript.net) and [Wiki](https://github.com/jerryscript-project/jerryscript/wiki).
+
+Memory usage and Binary footprint are measured at [here](https://jerryscript-project.github.io/jerryscript-test-results) with real target daily.
+
+The following table shows the latest results on the devices:
+
+|  STM32F4-Discovery  | [![Remote Testrunner](https://jerryscript-project.github.io/jerryscript-test-results/status/stm32f4dis.svg)](https://jerryscript-project.github.io/jerryscript-test-results/) |
+|        :---:        |                                             :---:                                                                                         |
+|  **Raspberry Pi 2** | [![Remote Testrunner](https://jerryscript-project.github.io/jerryscript-test-results/status/rpi2.svg)](https://jerryscript-project.github.io/jerryscript-test-results/)       |
+
+IRC channel: #jerryscript on [freenode](https://freenode.net)  
+Mailing list: jerryscript-dev@groups.io, you can subscribe [here](https://groups.io/g/jerryscript-dev) and access the mailing list archive [here](https://groups.io/g/jerryscript-dev/topics).
+
+## Quick Start
+### Getting the sources
+```bash
+git clone https://github.com/jerryscript-project/jerryscript.git
+cd jerryscript
+```
+
+### Building JerryScript
+```bash
+python tools/build.py
+```
+
+For additional information see [Getting Started](docs/01.GETTING-STARTED.md).
+
+## Documentation
+- [Getting Started](docs/01.GETTING-STARTED.md)
+- [API Reference](docs/02.API-REFERENCE.md)
+- [API Example](docs/03.API-EXAMPLE.md)
+- [Internals](docs/04.INTERNALS.md)
+
+## Contributing
+The project can only accept contributions which are licensed under the [Apache License 2.0](LICENSE) and are signed according to the JerryScript [Developer's Certificate of Origin](DCO.md). For further information please see our [Contribution Guidelines](CONTRIBUTING.md).
+
+## License
+JerryScript is open source software under the [Apache License 2.0](LICENSE). Complete license and copyright information can be found in the source code.
+
+[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjerryscript-project%2Fjerryscript.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjerryscript-project%2Fjerryscript?ref=badge_large)
+
+> 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.
diff --git a/deps/jerry/cmake/toolchain_external.cmake b/deps/jerry/cmake/toolchain_external.cmake
new file mode 100644 (file)
index 0000000..e481b7e
--- /dev/null
@@ -0,0 +1,20 @@
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME EXTERNAL)
+set(CMAKE_SYSTEM_PROCESSOR "${EXTERNAL_CMAKE_SYSTEM_PROCESSOR}")
+
+CMAKE_FORCE_C_COMPILER(${EXTERNAL_CMAKE_C_COMPILER} ${EXTERNAL_CMAKE_C_COMPILER_ID})
diff --git a/deps/jerry/cmake/toolchain_linux_armv7l-el.cmake b/deps/jerry/cmake/toolchain_linux_armv7l-el.cmake
new file mode 100644 (file)
index 0000000..78fd37d
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR armv7l-el)
+
+set(FLAGS_COMMON_ARCH -mlittle-endian -mthumb)
diff --git a/deps/jerry/cmake/toolchain_linux_armv7l.cmake b/deps/jerry/cmake/toolchain_linux_armv7l.cmake
new file mode 100644 (file)
index 0000000..0e3248e
--- /dev/null
@@ -0,0 +1,24 @@
+# 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.
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR armv7l)
+
+set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
+#
+# Limit fpu to VFPv3 with d0-d15 registers
+#
+# If this is changed, setjmp / longjmp for ARMv7 should be updated accordingly
+#
+set(FLAGS_COMMON_ARCH -mthumb -mfpu=vfp -march=armv7)
diff --git a/deps/jerry/cmake/toolchain_linux_i686.cmake b/deps/jerry/cmake/toolchain_linux_i686.cmake
new file mode 100644 (file)
index 0000000..f2a9b61
--- /dev/null
@@ -0,0 +1,15 @@
+# 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.
+
+set(FLAGS_COMMON_ARCH -mfpmath=sse -msse2)
diff --git a/deps/jerry/cmake/toolchain_mcu_stm32f3.cmake b/deps/jerry/cmake/toolchain_mcu_stm32f3.cmake
new file mode 100644 (file)
index 0000000..0398535
--- /dev/null
@@ -0,0 +1,23 @@
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME MCU)
+set(CMAKE_SYSTEM_PROCESSOR armv7l)
+set(CMAKE_SYSTEM_VERSION STM32F3)
+
+set(FLAGS_COMMON_ARCH -mlittle-endian -mthumb -mcpu=cortex-m4 -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard)
+
+CMAKE_FORCE_C_COMPILER(arm-none-eabi-gcc GNU)
diff --git a/deps/jerry/cmake/toolchain_mcu_stm32f4.cmake b/deps/jerry/cmake/toolchain_mcu_stm32f4.cmake
new file mode 100644 (file)
index 0000000..e058f7c
--- /dev/null
@@ -0,0 +1,23 @@
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME MCU)
+set(CMAKE_SYSTEM_PROCESSOR armv7l)
+set(CMAKE_SYSTEM_VERSION STM32F4)
+
+set(FLAGS_COMMON_ARCH -mlittle-endian -mthumb -mcpu=cortex-m4 -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard)
+
+CMAKE_FORCE_C_COMPILER(arm-none-eabi-gcc GNU)
diff --git a/deps/jerry/cmake/toolchain_mcu_tim4f.cmake b/deps/jerry/cmake/toolchain_mcu_tim4f.cmake
new file mode 100644 (file)
index 0000000..e03592e
--- /dev/null
@@ -0,0 +1,33 @@
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME MCU)
+set(CMAKE_SYSTEM_PROCESSOR armv7l)
+set(CMAKE_SYSTEM_VERSION TIM4F)
+
+set(FLAGS_COMMON_ARCH --little_endian --silicon_version=7M4 --float_support=FPv4SPD16)
+
+CMAKE_FORCE_C_COMPILER(armcl TI)
+
+SET (CMAKE_C_FLAGS_DEBUG_INIT          "-g")
+SET (CMAKE_C_FLAGS_MINSIZEREL_INIT     "-o4 -mf0 -DNDEBUG")
+SET (CMAKE_C_FLAGS_RELEASE_INIT        "-o4 -DNDEBUG")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-o2 -g")
+
+SET (CMAKE_CXX_FLAGS_DEBUG_INIT          "-g")
+SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT     "-o4 -mf0 -DNDEBUG")
+SET (CMAKE_CXX_FLAGS_RELEASE_INIT        "-o4 -DNDEBUG")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-o2 -g")
diff --git a/deps/jerry/cmake/toolchain_openwrt_mips.cmake b/deps/jerry/cmake/toolchain_openwrt_mips.cmake
new file mode 100644 (file)
index 0000000..b0b99f7
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+set(CMAKE_SYSTEM_NAME Openwrt)
+set(CMAKE_SYSTEM_PROCESSOR mips)
+
+set(CMAKE_C_COMPILER mipsel-openwrt-linux-gcc)
diff --git a/deps/jerry/docs/01.GETTING-STARTED.md b/deps/jerry/docs/01.GETTING-STARTED.md
new file mode 100644 (file)
index 0000000..f416259
--- /dev/null
@@ -0,0 +1,175 @@
+## Setting up prerequisites
+
+Currently, only Ubuntu 14.04+ is officially supported as primary development environment.
+
+There are several dependencies, that should be installed manually. The following list is the absolute minimum for building:
+
+- `gcc` or any C99-compliant compiler (native or cross, e.g., arm-none-eabi)
+- `cmake` >= `2.8.12.2`
+
+Several scripts and tools help the building and development process, thus it is recommended to have the following installed as well:
+
+- `bash` >= `4.3.11`
+- `cppcheck` >= `1.61`
+- `vera++` >= `1.2.1`
+- `python` >= `2.7.6`
+
+```bash
+sudo apt-get install gcc gcc-arm-none-eabi cmake cppcheck vera++ python
+```
+
+To make our scripts run correctly, several shell utilities should be available on the system:
+
+- `awk`
+- `bc`
+- `find`
+- `sed`
+
+## Building JerryScript
+
+**To build debug version for Linux**
+
+```bash
+python tools/build.py --debug
+```
+
+**To build debug version for Linux without LTO (Link Time Optimization)**
+
+```bash
+python tools/build.py --debug --lto=off
+```
+
+**Add custom arguments to CMake**
+
+```bash
+python tools/build.py --cmake-param=CMAKE_PARAM
+```
+
+**Set a profile mode (ES5.1, subset of ES2015, minimal)**
+
+```bash
+python tools/build.py --profile=es5.1|es2015-subset|minimal
+```
+
+**Use (jerry, compiler-default, external) libc**
+
+The default libc is jerry-libc, but you can use compiler-default libc or an external libc:
+
+- compiler-default libc:
+
+```bash
+python tools/build.py --jerry-libc=off
+```
+
+- external libc:
+
+```bash
+python tools/build.py --jerry-libc=off --compile-flag="-nostdlib -I/path/to/ext-libc/include" --link-lib="ext-c"
+```
+
+**Add toolchain file**
+
+The ```cmake``` dir already contains some usable toolchain files, which you can use in the following format:
+
+```bash
+python tools/build.py --toolchain=TOOLCHAIN
+```
+
+For example the cross-compile to RaspberryPi 2 is something like this:
+
+```bash
+python tools/build.py --toolchain=cmake/toolchain_linux_armv7l.cmake
+```
+
+**Use system memory allocator**
+
+```bash
+python tools/build.py --system-allocator=on --jerry-libc=off
+```
+
+*Note*: System allocator is only supported on 32 bit systems.
+
+**Enable 32bit compressed pointers**
+
+```bash
+python tools/build.py --cpointer-32bit=on
+```
+
+*Note*: There is no compression/decompression on 32 bit systems, if enabled.
+
+**Change default heap size (512K)**
+
+```bash
+python tools/build.py --mem-heap=256
+```
+
+If you would like to use more than 512K, then you must enable the 32 bit compressed pointers.
+
+```bash
+python tools/build.py --cpointer-32bit=on --mem-heap=1024
+```
+
+*Note*: The heap size will be allocated statically at compile time, when JerryScript memory
+allocator is used.
+
+**To get a list of all the available buildoptions for Linux**
+
+```bash
+python tools/build.py --help
+```
+
+## Checking patch
+
+```bash
+python tools/run-tests.py --precommit
+```
+
+### Running only one type of test
+
+**To run build option tests**
+
+```bash
+python tools/run-tests.py --buildoption-test
+```
+
+**To run unittests**
+
+```bash
+python tools/run-tests.py --unittests
+```
+
+**To run jerry-tests**
+
+```bash
+python tools/run-tests.py --jerry-tests
+```
+
+**To run jerry-test-suite**
+
+```bash
+python tools/run-tests.py --jerry-test-suite
+```
+
+**To run signed-off check**
+
+```bash
+python tools/run-tests.py --check-signed-off
+```
+
+**To run cppcheck**
+
+```bash
+python tools/run-tests.py --check-cppcheck
+```
+
+**To run vera check**
+
+```bash
+python tools/run-tests.py --check-vera
+```
+
+**To get a list of all the available test options**
+
+```bash
+python tools/run-tests.py --help
+```
diff --git a/deps/jerry/docs/02.API-REFERENCE.md b/deps/jerry/docs/02.API-REFERENCE.md
new file mode 100644 (file)
index 0000000..e94d2aa
--- /dev/null
@@ -0,0 +1,4258 @@
+# JerryScript types
+
+## jerry_init_flag_t
+
+Enum that contains the following elements:
+
+ - JERRY_INIT_EMPTY - empty flag set
+ - JERRY_INIT_SHOW_OPCODES - dump byte-code to log after parse
+ - JERRY_INIT_SHOW_REGEXP_OPCODES - dump regexp byte-code to log after compilation
+ - JERRY_INIT_MEM_STATS - dump memory statistics
+ - JERRY_INIT_MEM_STATS_SEPARATE - dump memory statistics and reset peak values after parse
+ - JERRY_INIT_DEBUGGER - enable all features required by debugging
+
+## jerry_error_t
+
+Possible types of an error:
+
+ - JERRY_ERROR_COMMON - common error
+ - JERRY_ERROR_EVAL - eval error
+ - JERRY_ERROR_RANGE - range error
+ - JERRY_ERROR_REFERENCE - reference error
+ - JERRY_ERROR_SYNTAX - syntax error
+ - JERRY_ERROR_TYPE - type error
+ - JERRY_ERROR_URI - URI error
+
+## jerry_feature_t
+
+Possible compile time enabled feature types:
+
+ - JERRY_FEATURE_CPOINTER_32_BIT - 32 bit compressed pointers
+ - JERRY_FEATURE_ERROR_MESSAGES - error messages
+ - JERRY_FEATURE_JS_PARSER - js-parser
+ - JERRY_FEATURE_MEM_STATS - memory statistics
+ - JERRY_FEATURE_PARSER_DUMP - parser byte-code dumps
+ - JERRY_FEATURE_REGEXP_DUMP - regexp byte-code dumps
+ - JERRY_FEATURE_SNAPSHOT_SAVE - saving snapshot files
+ - JERRY_FEATURE_SNAPSHOT_EXEC - executing snapshot files
+ - JERRY_FEATURE_DEBUGGER - debugging
+ - JERRY_FEATURE_VM_EXEC_STOP - stopping ECMAScript execution
+
+## jerry_char_t
+
+**Summary**
+
+Jerry's char value
+
+**Prototype**
+
+```c
+typedef uint8_t jerry_char_t;
+```
+
+## jerry_char_ptr_t
+
+**Summary**
+
+Pointer to an array of character values
+
+**Prototype**
+
+```c
+typedef jerry_char_t *jerry_char_ptr_t;
+```
+
+## jerry_size_t
+
+**Summary**
+
+Jerry's size
+
+**Prototype**
+
+```c
+typedef uint32_t jerry_size_t;
+```
+
+## jerry_length_t
+
+**Summary**
+
+Jerry's length
+
+**Prototype**
+
+```c
+typedef uint32_t jerry_length_t;
+```
+
+## jerry_value_t
+
+**Summary**
+
+JerryScript value can be a boolean, number, null, object, string or undefined. The value has an error flag,
+that indicates whether is an error or not. Every type has an error flag not only objects. The error flag should
+be cleared before the value is passed as an argument, otherwise it can lead to a type error. The error objects
+created by API functions has the error flag set.
+
+**Prototype**
+
+```c
+typedef uint32_t jerry_value_t;
+```
+
+## jerry_context_data_manager_t
+
+**Summary**
+
+Structure that defines how a context data item will be initialized and deinitialized. JerryScript zeroes out the memory
+for the item by default, and if the `init_cb` field is not NULL, it will be called with the pointer to the memory  as
+an additional custom initializer.
+
+**Prototype**
+
+```c
+typedef struct
+{
+  void (*init_cb) (void *); /**< callback responsible for initializing a context item, or NULL */
+  void (*deinit_cb) (void *); /**< callback responsible for deinitializing a context item */
+  size_t bytes_needed; /**< number of bytes to allocate for this manager */
+} jerry_context_data_manager_t;
+```
+
+## jerry_property_descriptor_t
+
+**Summary**
+
+Description of ECMA property descriptor
+
+**Prototype**
+
+```c
+typedef struct
+{
+  /** Is [[Value]] defined? */
+  bool is_value_defined;
+
+  /** Is [[Get]] defined? */
+  bool is_get_defined;
+
+  /** Is [[Set]] defined? */
+  bool is_set_defined;
+
+  /** Is [[Writable]] defined? */
+  bool is_writable_defined;
+
+  /** [[Writable]] */
+  bool is_writable;
+
+  /** Is [[Enumerable]] defined? */
+  bool is_enumerable_defined;
+
+  /** [[Enumerable]] */
+  bool is_enumerable;
+
+  /** Is [[Configurable]] defined? */
+  bool is_configurable_defined;
+
+  /** [[Configurable]] */
+  bool is_configurable;
+
+  /** [[Value]] */
+  jerry_value_t value;
+
+  /** [[Get]] */
+  jerry_value_t getter;
+
+  /** [[Set]] */
+  jerry_value_t setter;
+} jerry_property_descriptor_t;
+```
+
+## jerry_external_handler_t
+
+**Summary**
+
+Type of an external function handler
+
+**Prototype**
+
+```c
+typedef jerry_value_t (*jerry_external_handler_t) (const jerry_value_t function_obj,
+                                                   const jerry_value_t this_val,
+                                                   const jerry_value_t args_p[],
+                                                   const jerry_length_t args_count);
+```
+
+## jerry_object_free_callback_t
+
+**Summary**
+
+**Deprecated: Please use jerry_object_native_free_callback_t instead.**
+
+Native free callback of an object.
+
+**Prototype**
+
+```c
+typedef void (*jerry_object_free_callback_t) (const uintptr_t native_p);
+```
+
+## jerry_object_native_free_callback_t
+
+**Summary**
+
+Native free callback of an object. It is used in jerry_object_native_info_t.
+
+**Prototype**
+
+```c
+typedef void (*jerry_object_native_free_callback_t) (void *native_p);
+```
+
+## jerry_object_native_info_t
+
+**Summary**
+
+The type infomation of the native pointer.
+It includes the free callback that will be called when associated JavaScript object is garbage collected. It can be left NULL in case it is not needed.
+
+Typically, one would create a `static const jerry_object_native_info_t` for
+each distinct C type for which a pointer is used with
+`jerry_set_object_native_pointer ()` and `jerry_get_object_native_pointer ()`.
+This way, each `const jerry_object_native_info_t *` pointer address value itself
+uniquely identifies the C type of the native pointer.
+
+See [jerry_get_object_native_pointer](#jerry_get_object_native_pointer)
+for a best-practice code example.
+
+**Prototype**
+
+```c
+typedef struct
+{
+  jerry_object_native_free_callback_t free_cb;
+} jerry_object_native_info_t;
+```
+
+**See also**
+
+- [jerry_set_object_native_pointer](#jerry_set_object_native_pointer)
+- [jerry_get_object_native_pointer](#jerry_get_object_native_pointer)
+
+## jerry_object_property_foreach_t
+
+**Summary**
+
+Function type applied for each data property of an object
+
+**Prototype**
+
+```c
+typedef bool (*jerry_object_property_foreach_t) (const jerry_value_t property_name,
+                                                 const jerry_value_t property_value,
+                                                 void *user_data_p);
+```
+
+## jerry_vm_exec_stop_callback_t
+
+**Summary**
+
+Callback which tells whether the ECMAScript execution should be stopped.
+If it returns with undefined value the ECMAScript execution continues.
+Otherwise the result is thrown by the engine (if the error flag is not
+set for the returned value the engine automatically sets it). The
+callback function might be called again even if it threw an error.
+In this case the function must throw the same error again.
+
+**Prototype**
+
+```c
+typedef jerry_value_t (*jerry_vm_exec_stop_callback_t) (void *user_p);
+```
+
+**See also**
+
+- [jerry_set_vm_exec_stop_callback](#jerry_set_vm_exec_stop_callback)
+
+
+# General engine functions
+
+## jerry_init
+
+**Summary**
+
+Initializes the JerryScript engine, making it possible to run JavaScript code and perform operations
+on JavaScript values.
+
+**Prototype**
+
+```c
+void
+jerry_init (jerry_init_flag_t flags)
+```
+
+`flags` - combination of various engine configuration flags:
+
+- `JERRY_INIT_EMPTY` - no flags, just initialize in default configuration.
+- `JERRY_INIT_SHOW_OPCODES` - print compiled byte-code.
+- `JERRY_INIT_SHOW_REGEXP_OPCODES` - print compiled regexp byte-code.
+- `JERRY_INIT_MEM_STATS` - dump memory statistics.
+- `JERRY_INIT_MEM_STATS_SEPARATE` - dump memory statistics and reset peak values after parse.
+- `JERRY_INIT_DEBUGGER` - enable all features required by debugging.
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_SHOW_OPCODES | JERRY_INIT_SHOW_REGEXP_OPCODES);
+
+  // ...
+
+  jerry_cleanup ();
+}
+```
+
+**See also**
+
+- [jerry_cleanup](#jerry_cleanup)
+
+
+## jerry_cleanup
+
+**Summary**
+
+Finish JavaScript engine execution, freeing memory and JavaScript values.
+
+*Note*: JavaScript values, received from engine, will be inaccessible after the cleanup.
+
+**Prototype**
+
+```c
+void
+jerry_cleanup (void);
+```
+
+**See also**
+
+- [jerry_init](#jerry_init)
+
+
+## jerry_get_context_data
+
+**Summary**
+
+Retrieve a pointer to the item stored within the current context by the given manager.
+
+*Note*: Since internally the pointer to a manager's context data item is linked to the next such pointer in a linked
+        list, it is inadvisable to invoke too many different managers, because doing so will increase the time it takes
+        to retrieve a manager's context data item, degrading performance. For example, try to keep the number of
+        managers below five.
+
+**Prototype**
+
+```c
+void *
+jerry_get_context_data (const jerry_context_data_manager *manager_p);
+```
+
+- `manager_p`: the manager of this context data item.
+- return value: the item created by `manager_p` when `jerry_get_context_data ()` was first called, or a new item created
+  by `manager_p`, which will be stored for future identical calls to `jerry_get_context_data ()`, and which will be
+  deinitialized using the `deinit_cb` callback provided by `manager_p` when the context will be destroyed.
+
+**Example**
+
+[doctest]: # (test="compile")
+
+```c
+#include "jerryscript.h"
+
+typedef struct
+{
+  int my_data1;
+  double my_data2;
+  char *my_data3;
+} my_context_data_t;
+
+/* Define how context items will be initialized. */
+static void
+my_context_data_new (void *user_data_p)
+{
+  my_context_data_t *my_data_p = (my_context_data_t *) user_data_p;
+
+  /*
+   * Initialize my_data_p. JerryScript will store it on the current context and return it whenever
+   * jerry_get_context_data () is called with a pointer to my_manager as defined below.
+   */
+}
+
+/* Define how context items will be deinitialized */
+static void
+my_context_data_free (void *user_data_p)
+{
+  my_context_data_t *my_data_p = ((my_context_data_t *) user_data_p);
+
+  /* Perform any necessary cleanup on my_data. JerryScript will free the pointer after this function completes. */
+}
+
+/* Wrap the creation and destruction functions into a manager */
+static const jerry_context_data_manager_t my_manager =
+{
+  .init_cb = my_context_data_new,
+  .deinit_cb = my_context_data_free,
+  .bytes_needed = sizeof (my_context_data_t)
+};
+
+/*
+ * Then, in some function in your code, you can retrieve an item of type my_context_data_t from the currently active
+ * context such that JerryScript will create and store such an item if one was not previously created
+ */
+static void
+someplace_in_the_code (void)
+{
+  my_context_data_t *my_data = (my_context_data_t *) jerry_get_context_data (&my_manager);
+  /* Perform useful things using the data found in my_data */
+}
+```
+
+
+## jerry_register_magic_strings
+
+**Summary**
+
+Registers an external magic string array.
+
+*Note*: The strings in the array must be sorted by size at first, then lexicographically.
+
+**Prototype**
+
+```c
+void
+jerry_register_magic_strings  (const jerry_char_ptr_t *ex_str_items_p,
+                               uint32_t count,
+                               const jerry_length_t *str_lengths_p);
+```
+
+- `ex_str_items_p` - character arrays, representing external magic strings' contents
+- `count` - number of the strings
+- `str_lengths_p` - lengths of the strings
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  // must be static, because 'jerry_register_magic_strings' does not copy
+  // the items must be sorted by size at first, then lexicographically
+  static const jerry_char_ptr_t magic_string_items[] = {
+                                                         (const jerry_char_ptr_t) "magicstring1",
+                                                         (const jerry_char_ptr_t) "magicstring2",
+                                                         (const jerry_char_ptr_t) "magicstring3"
+                                                       };
+  uint32_t num_magic_string_items = (uint32_t) (sizeof (magic_string_items) / sizeof (jerry_char_ptr_t));
+
+  // must be static, because 'jerry_register_magic_strings' does not copy
+  static const jerry_length_t magic_string_lengths[] = {
+                                                         12,
+                                                         12,
+                                                         12
+                                                       };
+  jerry_register_magic_strings (magic_string_items, num_magic_string_items, magic_string_lengths);
+}
+```
+
+**See also**
+
+- [jerry_init](#jerry_init)
+- [jerry_cleanup](#jerry_cleanup)
+- [jerry_parse_and_save_literals](#jerry_parse_and_save_literals)
+
+
+## jerry_get_memory_limits
+
+**Summary**
+
+Gets configured memory limits of JerryScript.
+
+**Prototype**
+
+```c
+void
+jerry_get_memory_limits (size_t *out_data_bss_brk_limit_p,
+                         size_t *out_stack_limit_p);
+```
+
+- `out_data_bss_brk_limit_p` - out parameter, that gives the maximum size of data + bss + brk sections.
+- `out_stack_limit_p` - out parameter, that gives the maximum size of the stack.
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  size_t stack_limit;
+  size_t data_bss_brk_limit;
+  jerry_get_memory_limits (&stack_limit, &data_bss_brk_limit);
+}
+```
+
+**See also**
+
+- [jerry_init](#jerry_init)
+- [jerry_cleanup](#jerry_cleanup)
+
+
+## jerry_gc
+
+**Summary**
+
+Performs garbage collection.
+
+**Prototype**
+
+```c
+void
+jerry_gc (void);
+```
+
+**Example**
+
+```c
+jerry_gc ();
+```
+
+**See also**
+
+- [jerry_init](#jerry_init)
+- [jerry_cleanup](#jerry_cleanup)
+
+# Parser and executor functions
+
+Functions to parse and run JavaScript source code.
+
+## jerry_run_simple
+
+**Summary**
+
+The simplest way to run JavaScript.
+
+**Prototype**
+
+```c
+bool
+jerry_run_simple (const jerry_char_t *script_source_p,
+                  size_t script_source_size,
+                  jerry_init_flag_t flags);
+```
+
+- `script_source_p` - source code, it must be a valid utf8 string.
+- `script_source_size` - size of source code buffer, in bytes.
+- `jerry_init_flag_t` - combination of various engine configuration flags
+- return value
+  - true, if run was successful
+  - false, otherwise
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  const jerry_char_t *script = (const jerry_char_t *) "print ('Hello, World!');";
+
+  jerry_run_simple (script, strlen ((const char *) script), JERRY_INIT_EMPTY);
+}
+```
+
+**See also**
+
+- [jerry_init](#jerry_init)
+- [jerry_cleanup](#jerry_cleanup)
+- [jerry_parse](#jerry_parse)
+- [jerry_run](#jerry_run)
+
+
+## jerry_parse
+
+**Summary**
+
+Parse script and construct an EcmaScript function. The
+lexical environment is set to the global lexical environment.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_parse (const jerry_char_t *source_p,
+             size_t source_size,
+             bool is_strict);
+```
+
+- `source_p` - string, containing source code to parse. It must be a valid utf8 string.
+- `source_size` - size of the string, in bytes.
+- `is_strict` - defines strict mode.
+- return value
+  - function object value, if script was parsed successfully,
+  - thrown error, otherwise
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  const jerry_char_t script[] = "print ('Hello, World!');";
+  size_t script_size = strlen ((const char *) script);
+
+  jerry_value_t parsed_code = jerry_parse (script, script_size, false);
+  jerry_release_value (parsed_code);
+
+  jerry_cleanup ();
+}
+```
+
+**See also**
+
+- [jerry_run](#jerry_run)
+
+## jerry_parse_named_resource
+
+**Summary**
+
+Parse script and construct an ECMAScript function. The lexical
+environment is set to the global lexical environment. The name
+(usually a file name) is also passed to this function which is
+used by the debugger to find the source code.
+
+*Note*: The returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_parse_named_resource (const jerry_char_t *name_p, /**< name (usually a file name) */
+                            size_t name_length, /**< length of name */
+                            const jerry_char_t *source_p, /**< script source */
+                            size_t source_size, /**< script source size */
+                            bool is_strict) /**< strict mode */
+{
+```
+
+- `name_p` - name, usually a file name
+- `name_length` - size of the file name, in bytes
+- `source_p` - string, containing source code to parse. It must be a valid UTF8 string
+- `source_size` - size of the string, in bytes
+- `is_strict` - defines strict mode
+- return value
+  - function object value, if script was parsed successfully,
+  - thrown error, otherwise
+
+This function is identical to [jerry_parse](#jerry_parse), except that an additional filename parameter has been added.
+
+## jerry_run
+
+**Summary**
+
+Run an EcmaScript function created by `jerry_parse`.
+
+*Note*: The code should be previously parsed with `jerry_parse`.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_run (const jerry_value_t func_val);
+```
+
+- `func_val` - function to run
+- return value
+  - result of bytecode, if run was successful
+  - thrown error, otherwise
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  const jerry_char_t script[] = "print ('Hello, World!');";
+  size_t script_size = strlen ((const char *) script);
+
+  /* Initialize engine */
+  jerry_init (JERRY_INIT_EMPTY);
+
+  /* Setup Global scope code */
+  jerry_value_t parsed_code = jerry_parse (script, script_size, false);
+
+  if (!jerry_value_has_error_flag (parsed_code))
+  {
+    /* Execute the parsed source code in the Global scope */
+    jerry_value_t ret_value = jerry_run (parsed_code);
+
+    /* Returned value must be freed */
+    jerry_release_value (ret_value);
+  }
+
+  /* Parsed source code must be freed */
+  jerry_release_value (parsed_code);
+
+  /* Cleanup engine */
+  jerry_cleanup ();
+}
+```
+
+**See also**
+
+- [jerry_parse](#jerry_parse)
+
+
+## jerry_eval
+
+**Summary**
+
+Perform JavaScript `eval`.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_eval (const jerry_char_t *source_p,
+            size_t source_size,
+            bool is_strict);
+```
+
+- `source_p` - source code to evaluate, it must be a valid utf8 string.
+- `source_size` - length of the source code
+- `is_strict` - perform `eval` as it is called from "strict mode" code.
+- return value - result of eval, may be error value.
+
+**Example**
+
+```c
+{
+  jerry_value_t ret_val = jerry_eval (str_to_eval,
+                                      strlen (str_to_eval),
+                                      false);
+}
+```
+
+**See also**
+
+- [jerry_create_external_function](#jerry_create_external_function)
+- [jerry_external_handler_t](#jerry_external_handler_t)
+
+## jerry_run_all_enqueued_jobs
+
+**Summary**
+
+Run enqueued Promise jobs until the first thrown error or until all get executed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_run_all_enqueued_jobs (void)
+```
+
+- return value - result of last executed job, may be error value.
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  const jerry_char_t script[] = "new Promise(function(f,r) { f('Hello, World!'); }).then(function(x) { print(x); });";
+  size_t script_size = strlen ((const char *) script);
+
+  jerry_value_t parsed_code = jerry_parse (script, script_size, false);
+  jerry_value_t script_value = jerry_run (parsed_code);
+  jerry_value_t job_value = jerry_run_all_enqueued_jobs ();
+
+  jerry_release_value (job_value);
+  jerry_release_value (script_value);
+  jerry_release_value (parsed_code);
+
+  jerry_cleanup ();
+}
+```
+
+
+# Get the global context
+
+## jerry_get_global_object
+
+**Summary**
+
+Get the Global object.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_get_global_object (void);
+```
+
+- return value - api value of global object
+
+**Example**
+
+```c
+{
+  jerry_value_t glob_obj_val = jerry_get_global_object ();
+
+  ... // Do something with global object, ex: add properties
+
+  jerry_release_value (glob_obj_val);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+- [jerry_define_own_property](#jerry_define_own_property)
+
+# Checker functions
+
+Functions to check the type of an API value ([jerry_value_t](#jerry_value_t)).
+
+## jerry_value_is_array
+
+**Summary**
+
+Returns whether the given `jerry_value_t` is an array.
+
+**Prototype**
+
+```c
+bool
+jerry_value_is_array (const jerry_value_t value)
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` is an array
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_array (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_value_is_boolean
+
+**Summary**
+
+Returns whether the given `jerry_value_t` is a boolean value.
+
+**Prototype**
+
+```c
+bool
+jerry_value_is_boolean (const jerry_value_t value)
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` is a boolean value
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_boolean (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_value_is_constructor
+
+**Summary**
+
+Returns whether the given `jerry_value_t` is a constructor function.
+
+**Prototype**
+
+```c
+bool
+jerry_value_is_constructor (const jerry_value_t value)
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` is a constructor
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_constructor (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_value_is_function
+
+**Summary**
+
+Returns whether the given `jerry_value_t` is a function.
+
+**Prototype**
+
+```c
+bool
+jerry_value_is_function (const jerry_value_t value)
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` is a function
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_function (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_value_is_number
+
+**Summary**
+
+Returns whether the given `jerry_value_t` is a number.
+
+**Prototype**
+
+```c
+bool
+jerry_value_is_function (const jerry_value_t value)
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` is a number
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_number (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_value_is_null
+
+**Summary**
+
+Returns whether the given `jerry_value_t` is a null value.
+
+**Prototype**
+
+```c
+bool
+jerry_value_is_null (const jerry_value_t value)
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` is a null
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_null (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_value_is_object
+
+**Summary**
+
+Returns whether the given `jerry_value_t` is an object value.
+
+**Prototype**
+
+```c
+bool
+jerry_value_is_object (const jerry_value_t value)
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` is an object
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_object (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_value_is_promise
+
+**Summary**
+
+Returns whether the given `jerry_value_t` is a promise value.
+
+*Note*: This API depends on the ES2015-subset profile.
+
+**Prototype**
+
+```c
+bool
+jerry_value_is_promise (const jerry_value_t value)
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` is a promise
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_promise (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_value_is_string
+
+**Summary**
+
+Returns whether the given `jerry_value_t` is a string value.
+
+**Prototype**
+
+```c
+bool
+jerry_value_is_string (const jerry_value_t value)
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` is a string
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_string (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_value_is_undefined
+
+**Summary**
+
+Returns whether the given `jerry_value_t` is an undefined value.
+
+**Prototype**
+
+```c
+bool
+jerry_value_is_undefined (const jerry_value_t value)
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` is an undefined value
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_undefined (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+## jerry_is_feature_enabled
+
+**Summary**
+
+Returns whether the specified compile time feature is enabled.
+
+**Prototype**
+
+```c
+bool
+jerry_is_feature_enabled (const jerry_feature_t feature);
+```
+
+- `feature` - jerry feature
+- return value
+  - true, if the given `jerry_feature_t` is enabled
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  ...
+  jerry_feature_t feature = JERRY_FEATURE_SNAPSHOT_SAVE;
+
+  if (jerry_is_feature_enabled (feature))
+  {
+    ...
+  }
+
+}
+```
+
+# Error flag manipulation functions
+
+## jerry_value_has_error_flag
+
+**Summary**
+
+Returns whether the given `jerry_value_t` has the error flag set.
+
+**Prototype**
+
+```c
+bool
+jerry_value_has_error_flag (const jerry_value_t value);
+```
+
+- `value` - api value
+- return value
+  - true, if the given `jerry_value_t` has the error flag set
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_has_error_flag (value))
+  {
+    ...
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_value_t](#jerry_value_t)
+
+
+## jerry_value_clear_error_flag
+
+**Summary**
+
+Clear the error flag.
+
+**Prototype**
+
+```c
+void
+jerry_value_clear_error_flag (jerry_value_t *value_p);
+```
+
+- `value_p` - pointer to an api value
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  jerry_value_clear_error_flag (&value);
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_value_t](#jerry_value_t)
+
+
+## jerry_value_set_error_flag
+
+**Summary**
+
+Set the error flag.
+
+**Prototype**
+
+```c
+void
+jerry_value_set_error_flag (jerry_value_t *value_p);
+```
+
+- `value_p` - pointer to an api value
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  jerry_value_set_error_flag (&value);
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_value_t](#jerry_value_t)
+
+
+# Getter functions of 'jerry_value_t'
+
+Get raw data from API values.
+
+## jerry_get_boolean_value
+
+**Summary**
+
+Gets the raw bool value from a `jerry_value_t`.
+
+**Prototype**
+
+```c
+bool
+jerry_get_boolean_value (const jerry_value_t value);
+```
+
+- `value` - api value
+- return value - boolean value represented by the argument.
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_boolean (value))
+  {
+    bool raw_value = jerry_get_boolean_value (value);
+
+    ... // usage of raw value
+
+  }
+
+  jerry_release_value (value);
+}
+
+```
+
+**See also**
+
+- [jerry_value_is_boolean](#jerry_value_is_boolean)
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_get_number_value
+
+**Summary**
+
+Gets the number value of the given `jerry_value_t` parameter as a raw double.
+
+**Prototype**
+
+```c
+double
+jerry_get_number_value (const jerry_value_t value);
+```
+
+- `value` - api value
+- return value - the number value of the given `jerry_value_t` parameter as a raw double.
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  if (jerry_value_is_number (value))
+  {
+    double raw_value = jerry_get_number_value (value);
+
+    ... // usage of raw value
+
+  }
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_value_is_number](#jerry_value_is_number)
+- [jerry_release_value](#jerry_release_value)
+
+
+# Functions for string values
+
+## jerry_get_string_size
+
+**Summary**
+
+Get the size of a string. Returns zero, if the value parameter is not a string.
+
+**Prototype**
+
+```c
+jerry_size_t
+jerry_get_string_size (const jerry_value_t value);
+```
+- `value` - api value
+- return value - number of bytes in the buffer needed to represent the string.
+
+**Example**
+
+```c
+{
+  const jerry_char_t char_array[] = "a string";
+  jerry_value_t string = jerry_create_string (char_array);
+
+  jerry_size_t string_size = jerry_get_string_size (string);
+
+  ... // usage of string_size
+
+  jerry_release_value (string);
+}
+```
+
+**See also**
+
+- [jerry_create_string](#jerry_create_string)
+- [jerry_get_string_length](#jerry_get_string_length)
+- [jerry_is_valid_cesu8_string](#jerry_is_valid_cesu8_string)
+
+
+## jerry_get_utf8_string_size
+
+**Summary**
+
+Get the size of an utf8-encoded string. Returns zero, if the value parameter is not a string.
+
+*Note*: The difference from [jerry_get_string_size](#jerry_get_string_size) is that it returns with utf-8 string size
+instead of the cesu-8 string size.
+
+**Prototype**
+
+```c
+jerry_size_t
+jerry_get_utf8_string_size (const jerry_value_t value);
+```
+- `value` - api value
+- return value - number of bytes in the buffer needed to represent the utf8-encoded string.
+
+**Example**
+
+```c
+{
+  const jerry_char_t char_array[] = "a string";
+  jerry_value_t string = jerry_create_string (char_array);
+
+  jerry_size_t string_size = jerry_get_utf8_string_size (string);
+
+  ... // usage of string_size
+
+  jerry_release_value (string);
+}
+```
+
+**See also**
+
+- [jerry_create_string_from_utf8](#jerry_create_string_from_utf8)
+- [jerry_get_utf8_string_length](#jerry_get_utf8_string_length)
+- [jerry_is_valid_utf8_string](#jerry_is_valid_utf8_string)
+
+
+## jerry_get_string_length
+
+**Summary**
+
+Get the length of a string. Returns zero, if the value parameter is not a string.
+
+**Prototype**
+
+```c
+jerry_length_t
+jerry_get_string_length (const jerry_value_t value);
+```
+
+- `value` - api value
+- return value - number of characters in the string
+
+**Example**
+
+```c
+{
+  const jerry_char_t char_array[] = "a string";
+  jerry_value_t string = jerry_create_string (char_array);
+
+  jerry_length_t string_length = jerry_get_string_length (string);
+
+  ... // usage of string_length
+
+  jerry_release_value (string);
+}
+```
+
+**See also**
+
+- [jerry_create_string](#jerry_create_string)
+- [jerry_get_string_size](#jerry_get_string_size)
+- [jerry_is_valid_cesu8_string](#jerry_is_valid_cesu8_string)
+
+
+## jerry_get_utf8_string_length
+
+**Summary**
+
+Get the length of an UTF-8 encoded string. Returns zero, if the value parameter is not a string.
+
+*Note*: The difference from [jerry_get_string_length](#jerry_get_string_length) is that it
+returns with utf-8 string length instead of the cesu-8 string length.
+
+**Prototype**
+
+```c
+jerry_length_t
+jerry_get_utf8_string_length (const jerry_value_t value);
+```
+
+- `value` - input string value
+- return value - number of characters in the string
+
+**Example**
+
+```c
+{
+  const jerry_char_t char_array[] = "a string";
+  jerry_value_t string = jerry_create_string_from_utf8 (char_array);
+
+  jerry_length_t string_length = jerry_get_utf8_string_length (string);
+
+  ... // usage of string_length
+
+  jerry_release_value (string);
+}
+```
+
+**See also**
+
+- [jerry_create_string_from_utf8](#jerry_create_string_from_utf8)
+- [jerry_get_utf8_string_size](#jerry_get_utf8_string_size)
+- [jerry_is_valid_utf8_string](#jerry_is_valid_utf8_string)
+
+
+## jerry_string_to_char_buffer
+
+**Summary**
+
+Copy the characters of a string into a specified cesu-8 buffer.
+The '\0' character could occur in the character buffer. Returns 0,
+if the value parameter is not a string or the buffer is not large
+enough for the whole string.
+
+*Note*: Does not put '\0' to the end of string, the return value identifies
+the number of valid bytes in the output buffer.
+
+**Prototype**
+
+```c
+jerry_size_t
+jerry_string_to_char_buffer (const jerry_value_t value,
+                             jerry_char_t *buffer_p,
+                             jerry_size_t buffer_size);
+```
+
+- `value` - input string value
+- `buffer_p` - pointer to output buffer
+- `buffer_size` - size of the buffer
+- return value - number of bytes, actually copied to the buffer
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  jerry_size_t req_sz = jerry_get_string_size (value);
+  jerry_char_t str_buf_p[req_sz];
+
+  jerry_string_to_char_buffer (value, str_buf_p, req_sz);
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_create_string](#jerry_create_string)
+- [jerry_get_string_size](#jerry_get_string_size)
+- [jerry_is_valid_cesu8_string](#jerry_is_valid_cesu8_string)
+
+
+## jerry_string_to_utf8_char_buffer
+
+**Summary**
+
+Copy the characters of a string into a specified utf-8 buffer.
+The '\0' character could occur in character buffer. Returns 0,
+if the value parameter is not a string or the buffer is not
+large enough for the whole string.
+
+*Note*: Does not put '\0' to the end of string, the return value identifies
+the number of valid bytes in the output buffer.
+
+**Prototype**
+
+```c
+jerry_size_t
+jerry_string_to_utf8_char_buffer (const jerry_value_t value,
+                                  jerry_char_t *buffer_p,
+                                  jerry_size_t buffer_size);
+```
+
+- `value` - input string value
+- `buffer_p` - pointer to output buffer
+- `buffer_size` - size of the buffer
+- return value - number of bytes, actually copied to the buffer
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  jerry_size_t req_sz = jerry_get_utf8_string_size (value);
+  jerry_char_t str_buf_p[req_sz];
+
+  jerry_string_to_utf8_char_buffer (value, str_buf_p, req_sz);
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_create_string_from_utf8](#jerry_create_string_from_utf8)
+- [jerry_get_utf8_string_size](#jerry_get_utf8_string_size)
+- [jerry_is_valid_utf8_string](#jerry_is_valid_utf8_string)
+
+
+## jerry_substring_to_char_buffer
+
+**Summary**
+
+Copy the characters of a cesu-8 encoded substring into a specified buffer.
+The '\0' character could occur in character buffer. Returns 0, if the value
+parameter is not a string. It will extract the substring between the
+specified start position and the end position (or the end of the string,
+whichever comes first).
+
+*Note*: Does not put '\0' to the end of string, the return value identifies
+the number of valid bytes in the output buffer.
+
+**Prototype**
+
+```c
+jerry_size_t
+jerry_substring_to_char_buffer (const jerry_value_t value,
+                                jerry_length_t start_pos,
+                                jerry_length_t end_pos,
+                                jerry_char_t *buffer_p,
+                                jerry_size_t buffer_size);
+```
+
+- `value` - input string value
+- `start_pos` - position of the first character
+- `end_pos` - position of the last character
+- `buffer_p` - pointer to output buffer
+- `buffer_size` - size of the buffer
+- return value - number of bytes, actually copied to the buffer
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  jerry_size_t req_sz = jerry_get_string_size (value);
+  jerry_char_t str_buf_p[req_sz];
+  jerry_length_t start_pos = 0;
+  jerry_length_t end_pos = jerry_get_string_length (value);
+
+  jerry_substring_to_char_buffer (value, start_pos, end_pos, str_buf_p, req_sz);
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_create_string](#jerry_create_string)
+- [jerry_get_string_size](#jerry_get_string_size)
+- [jerry_get_string_length](#jerry_get_string_length)
+- [jerry_is_valid_cesu8_string](#jerry_is_valid_cesu8_string)
+
+
+## jerry_substring_to_utf8_char_buffer
+
+**Summary**
+
+Copy the characters of an utf-8 encoded substring into a specified buffer.
+The '\0' character could occur in character buffer. Returns 0, if the value
+parameter is not a string. It will extract the substring between the specified
+start position and the end position (or the end of the string, whichever
+comes first).
+
+*Note*: Does not put '\0' to the end of string, the return value identifies
+the number of valid bytes in the output buffer.
+
+**Prototype**
+
+```c
+jerry_size_t
+jerry_substring_to_utf8_char_buffer (const jerry_value_t value,
+                                     jerry_length_t start_pos,
+                                     jerry_length_t end_pos,
+                                     jerry_char_t *buffer_p,
+                                     jerry_size_t buffer_size);
+```
+
+- `value` - input string value
+- `start_pos` - position of the first character
+- `end_pos` - position of the last character
+- `buffer_p` - pointer to output buffer
+- `buffer_size` - size of the buffer
+- return value - number of bytes, actually copied to the buffer
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  jerry_size_t req_sz = jerry_get_utf8_string_size (value);
+  jerry_char_t str_buf_p[req_sz];
+  jerry_length_t start_pos = 0;
+  jerry_length_t end_pos = jerry_get_utf8_string_length (value);
+
+  jerry_substring_to_utf8_char_buffer (value, start_pos, end_pos, str_buf_p, req_sz);
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_create_string_from_utf8](#jerry_create_string_from_utf8)
+- [jerry_get_utf8_string_size](#jerry_get_utf8_string_size)
+- [jerry_get_utf8_string_length](#jerry_get_utf8_string_length)
+- [jerry_is_valid_utf8_string](#jerry_is_valid_utf8_string)
+
+
+# Functions for array object values
+
+## jerry_get_array_length
+
+**Summary**
+
+Get length of an array object. Returns zero, if the given parameter is not an array object.
+
+**Prototype**
+
+```c
+uint32_t
+jerry_get_array_length (const jerry_value_t value);
+```
+
+- `value` - input array value
+- return value - length of the given array
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  uint32_t len = jerry_get_array_length (value);
+
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_create_array](#jerry_create_array)
+
+
+# Converters of 'jerry_value_t'
+
+Functions for converting API values to another value type.
+
+## jerry_value_to_boolean
+
+**Summary**
+
+Call ToBoolean operation on the api value.
+
+**Prototype**
+
+```c
+bool
+jerry_value_to_boolean (const jerry_value_t value);
+```
+
+- `value` - api value
+- return value
+  - true, if the logical value is true
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  bool b = jerry_value_to_boolean (value);
+
+  jerry_release_value (value);
+}
+
+```
+
+**See also**
+
+- [jerry_value_to_primitive](#jerry_value_to_primitive)
+
+## jerry_value_to_number
+
+**Summary**
+
+Call ToNumber operation on the api value.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_value_to_number (const jerry_value_t value);
+```
+
+- `value` - api value
+- return value
+  - converted number value, if success
+  - thrown error, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  jerry_value_t number_value = jerry_value_to_number (value);
+
+  jerry_release_value (number_value);
+  jerry_release_value (value);
+}
+
+```
+
+**See also**
+
+- [jerry_value_to_primitive](#jerry_value_to_primitive)
+
+## jerry_value_to_object
+
+**Summary**
+
+Call ToObject operation on the api value.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_value_to_object (const jerry_value_t value);
+```
+
+- `value` - api value
+- return value
+  - converted object value, if success
+  - thrown error, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  jerry_value_t object_value = jerry_value_to_object (value);
+
+  jerry_release_value (object_value);
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_value_to_primitive](#jerry_value_to_primitive)
+
+## jerry_value_to_primitive
+
+**Summary**
+
+Call ToPrimitive operation on the api value.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_value_to_primitive (const jerry_value_t value);
+```
+
+- `value` - api value
+- return value
+  - converted primitive value, if success
+  - thrown error, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  jerry_value_t prim_value = jerry_value_to_primitive (value);
+
+  jerry_release_value (prim_value);
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_value_t](#jerry_value_t)
+
+## jerry_value_to_string
+
+**Summary**
+
+Call the ToString ecma builtin operation on the api value.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_value_to_string (const jerry_value_t value);
+```
+
+- `value` - api value
+- return value
+  - converted string value, if success
+  - thrown error, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value;
+  ... // create or acquire value
+
+  jerry_value_t string_value = jerry_value_to_string (value);
+
+  jerry_release_value (string_value);
+  jerry_release_value (value);
+}
+```
+
+**See also**
+
+- [jerry_value_to_primitive](#jerry_value_to_primitive)
+
+
+# Functions for promise objects
+
+These APIs all depends on the ES2015-subset profile.
+
+## jerry_resolve_or_reject_promise
+
+**Summary**
+
+Resolve or reject the promise with an argument.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_resolve_or_reject_promise (jerry_value_t promise,
+                                 jerry_value_t argument,
+                                 bool is_resolve)
+```
+
+- `promise` - the promise value
+- `argument` - the argument for resolve or reject
+- `is_resolve` - whether the promise should be resolved or rejected
+- return value
+  - undefined jerry value - resolve or reject successed
+  - jerry value with error flag - otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t promise = ... // acquire/create a promise object.
+
+  ...
+
+  bool is_resolve = ... // whether the promise should be resolved or rejected
+  jerry_value_t argument = ... // prepare the argumnent for the resolve or reject.
+
+  jerry_value_t is_ok = jerry_resolve_or_reject_promise (promise,
+                                                         argument,
+                                                         is_resolve);
+
+  if (jerry_value_has_error_flag (is_ok))
+  {
+    // handle the error.
+  }
+
+  jerry_release_value (is_ok);
+  jerry_release_value (argument);
+  jerry_release_value (promise);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+- [jerry_value_has_error_flag](#jerry_value_has_error_flag)
+
+
+# Acquire and release API values
+
+## jerry_acquire_value
+
+**Summary**
+
+Acquires the specified Jerry API value.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_acquire_value (jerry_value_t value);
+```
+
+- `value` - api value
+- return value - acquired value that may be used outside of the engine
+
+**Example**
+
+```c
+{
+  jerry_value_t object_value = jerry_create_object ();
+
+  jerry_value_t acquired_object = jerry_acquire_value (object_value);
+
+  jerry_release_value (object_value);
+
+  // acquired_object refers to the created object and makes it
+  // available after the release of 'object_value'
+
+  jerry_release_value (acquired_object);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+- [jerry_value_t](#jerry_value_t)
+
+
+## jerry_release_value
+
+**Summary**
+
+Release specified Jerry API value.
+
+**Prototype**
+
+```c
+void
+jerry_release_value (jerry_value_t value);
+```
+
+- `value` - api value
+
+**Example**
+
+```c
+{
+  jerry_value_t object_value = jerry_create_object ();
+
+  ...
+
+  jerry_release_value (object_value);
+}
+```
+
+
+# Create API values
+
+Function for creating [API values](#jerry_value_t).
+
+*Note*: Every created API value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+## jerry_create_array
+
+**Summary**
+
+Create an array object value.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_array (uint32_t size);
+```
+
+ - `size` - size of array;
+ - return value - value of the constructed array object
+
+ **Example**
+
+```c
+{
+    jerry_value_t array = jerry_create_array (10);
+
+    ...
+
+    jerry_release_value (array);
+}
+```
+
+**See also**
+
+- [jerry_set_property_by_index](#jerry_set_property_by_index)
+- [jerry_get_property_by_index](#jerry_get_property_by_index)
+
+
+## jerry_create_boolean
+
+**Summary**
+
+Create a jerry_value_t representing a boolean value from the given boolean parameter.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_boolean (bool value);
+```
+
+- `value` - raw boolean value.
+- return value - a `jerry_value_t` created from the given boolean argument.
+
+**Example**
+
+```c
+{
+  jerry_value_t boolean_value = jerry_create_boolean (true);
+
+  ... // usage of the value
+
+  jerry_release_value (boolean_value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_create_error
+
+**Summary**
+
+Create new JavaScript error object.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_error (jerry_error_t error_type,
+                    const jerry_char_t *message_p);
+```
+
+- `error_type` - type of error
+- `message_p` - value of 'message' property of constructed error object
+- return value - value of the constructed error object
+
+**Example**
+
+```c
+{
+  jerry_value_t error_obj = jerry_create_error (JERRY_ERROR_TYPE,
+                                                (const jerry_char_t *) "error");
+
+  ... // usage of error_obj
+
+
+  jerry_release_value (error_obj);
+}
+```
+
+**See also**
+
+- [jerry_value_has_error_flag](#jerry_value_has_error_flag)
+- [jerry_value_clear_error_flag](#jerry_value_clear_error_flag)
+- [jerry_value_set_error_flag](#jerry_value_set_error_flag)
+
+
+## jerry_create_error_sz
+
+**Summary**
+
+Create new JavaScript error object.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_error_sz (jerry_error_t error_type,
+                       const jerry_char_t *message_p,
+                       jerry_size_t message_size);
+```
+
+- `error_type` - type of the error
+- `message_p` - value of 'message' property of the constructed error object
+- `message_size` - size of the message in bytes
+- return value - value of the constructed error object
+
+**Example**
+
+```c
+{
+  const jerry_char_t *message = "error";
+  jerry_value_t error_obj = jerry_create_error_sz (JERRY_ERROR_COMMON,
+                                                   message,
+                                                   strlen ((const char *) message));
+
+  ... // usage of error_obj
+
+  jerry_release_value (error_obj);
+}
+```
+
+**See also**
+
+- [jerry_create_error](#jerry_create_error)
+
+
+## jerry_create_external_function
+
+**Summary**
+
+Create an external function object.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_external_function (jerry_external_handler_t handler_p);
+```
+
+- `handler_p` - pointer to native handler of the function object
+- return value - value of the constructed function object
+
+**Example**
+
+```c
+static jerry_value_t
+handler (const jerry_value_t function_obj,
+         const jerry_value_t this_val,
+         const jerry_value_t args_p[],
+         const jerry_length_t args_cnt)
+{
+  printf ("native handler called!\n");
+
+  return jerry_create_boolean (true);
+}
+
+{
+  jerry_value_t func_val = jerry_create_external_function (handler);
+  jerry_value_t glob_obj = jerry_get_global_object ();
+
+  // after this, script can invoke the native handler through "handler_field (1, 2, 3);"
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "handler_field");
+  // set property and release the return value without any check
+  jerry_release_value (jerry_set_property (glob_obj, prop_name, func_val));
+  jerry_release_value (prop_name);
+
+  jerry_release_value (func_val);
+  jerry_release_value (glob_obj);
+}
+```
+
+**See also**
+
+- [jerry_external_handler_t](#jerry_external_handler_t)
+- [jerry_set_property](#jerry_set_property)
+- [jerry_call_function](#jerry_call_function)
+
+
+## jerry_create_number
+
+**Summary**
+
+Creates a `jerry_value_t` representing a number value.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_number (double value);
+```
+
+- `value` - double value from which a `jerry_value_t` will be created
+- return value - a `jerry_value_t` created from the given double argument
+
+**Example**
+
+```c
+{
+  jerry_value_t number_value = jerry_create_number (3.14);
+
+  ... // usage of the value
+
+  jerry_release_value (number_value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+- [jerry_create_number_infinity](#jerry_create_number_infinity)
+- [jerry_create_number_nan](#jerry_create_number_nan)
+
+
+## jerry_create_number_infinity
+
+**Summary**
+
+Creates a `jerry_value_t` representing a positive or negative infinity value.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_number_infinity (bool sign);
+```
+
+- `sign` - true for negative Infinity and false for positive Infinity
+- return value - a `jerry_value_t` representing the infinity value
+
+**Example**
+
+```c
+{
+  jerry_value_t positive_inf_value = jerry_create_number_infinity (false);
+
+  ... // usage of the positive_inf_value
+
+  jerry_release_value (positive_inf_value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+- [jerry_create_number](#jerry_create_number)
+- [jerry_create_number_nan](#jerry_create_number_nan)
+
+
+## jerry_create_number_nan
+
+**Summary**
+
+Creates a `jerry_value_t` representing a not-a-number value.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_number_nan (void);
+```
+
+- return value - a `jerry_value_t` representing the not-a-number value
+
+**Example**
+
+```c
+{
+  jerry_value_t nan_value = jerry_create_number_nan ();
+
+  ... // usage of the nan_value
+
+  jerry_release_value (nan_value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+- [jerry_create_number](#jerry_create_number)
+- [jerry_create_number_infinity](#jerry_create_number_infinity)
+
+
+## jerry_create_null
+
+**Summary**
+
+Creates and returns a `jerry_value_t` with type null object.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_null (void);
+```
+
+- return value - a `jerry_value_t` representing null.
+
+**Example**
+
+```c
+{
+  jerry_value_t null_value = jerry_create_null ();
+
+  ... // usage of the value
+
+  jerry_release_value (null_value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_create_object
+
+**Summary**
+
+Create new JavaScript object, like with new Object().
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_object (void);
+```
+
+- return value - value of the created object
+
+**Example**
+
+```c
+{
+  jerry_value_t object_value = jerry_create_object ();
+
+  ... // usage of object_value
+
+  jerry_release_value (object_value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_create_promise
+
+**Summary**
+
+Create an empty promise object which can be resolved or rejected later
+by calling jerry_resolve_or_reject_promise.
+
+*Note*: This API depends on the ES2015-subset profile.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_promise (void)
+```
+
+- return value - value of the newly created promise
+
+**Example**
+
+```c
+{
+  jerry_value_t p = jerry_create_promise ();
+
+  ...// usage of the promise
+
+  jerry_release_value (p);
+}
+
+**See also**
+
+- [jerry_resolve_or_reject_promise](#jerry_resolve_or_reject_promise)
+- [jerry_release_value](#jerry_release_value)
+
+
+## jerry_create_string
+
+**Summary**
+
+Create string from a valid CESU8 string.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_string (const jerry_char_t *str_p);
+```
+
+- `str_p` - pointer to string
+- return value - value of the created string
+
+**Example**
+
+```c
+{
+  const jerry_char_t char_array[] = "a string";
+  jerry_value_t string_value  = jerry_create_string (char_array);
+
+  ... // usage of string_value
+
+  jerry_release_value (string_value);
+}
+```
+
+**See also**
+
+- [jerry_is_valid_cesu8_string](#jerry_is_valid_cesu8_string)
+- [jerry_create_string_sz](#jerry_create_string_sz)
+
+
+## jerry_create_string_sz
+
+**Summary**
+
+Create string from a valid CESU8 string.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_string_sz (const jerry_char_t *str_p,
+                        jerry_size_t str_size)
+```
+
+- `str_p` - pointer to string
+- `str_size` - size of the string
+- return value - value of the created string
+
+**Example**
+
+```c
+{
+  const jerry_char_t char_array[] = "a string";
+  jerry_value_t string_value  = jerry_create_string_sz (char_array,
+                                                        strlen ((const char *) char_array));
+
+  ... // usage of string_value
+
+  jerry_release_value (string_value);
+}
+
+```
+
+**See also**
+
+- [jerry_is_valid_cesu8_string](#jerry_is_valid_cesu8_string)
+- [jerry_create_string](#jerry_create_string)
+
+
+## jerry_create_string_from_utf8
+
+**Summary**
+
+Create string from a valid UTF8 string.
+
+*Note*: The difference from [jerry_create_string](#jerry_create_string) is that it accepts utf-8 string instead of cesu-8 string.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_string_from_utf8 (const jerry_char_t *str_p);
+```
+
+- `str_p` - pointer to string
+- return value - value of the created string
+
+**Example**
+
+```c
+{
+  const jerry_char_t char_array[] = "a string";
+  jerry_value_t string_value  = jerry_create_string_from_utf8 (char_array);
+
+  ... // usage of string_value
+
+  jerry_release_value (string_value);
+}
+```
+
+**See also**
+
+- [jerry_is_valid_utf8_string](#jerry_is_valid_utf8_string)
+- [jerry_create_string_sz_from_utf8](#jerry_create_string_sz_from_utf8)
+
+
+## jerry_create_string_sz_from_utf8
+
+**Summary**
+
+Create string from a valid UTF8 string.
+
+*Note*: The difference from [jerry_create_string_sz](#jerry_create_string_sz) is that it accepts utf-8 string instead of cesu-8 string.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_string_sz (const jerry_char_t *str_p,
+                        jerry_size_t str_size)
+```
+
+- `str_p` - pointer to string
+- `str_size` - size of the string
+- return value - value of the created string
+
+**Example**
+
+```c
+{
+  const jerry_char_t char_array[] = "a string";
+  jerry_value_t string_value  = jerry_create_string_sz_from_utf8 (char_array,
+                                                                  strlen ((const char *) char_array));
+
+  ... // usage of string_value
+
+  jerry_release_value (string_value);
+}
+
+```
+
+**See also**
+
+- [jerry_is_valid_utf8_string](#jerry_is_valid_utf8_string)
+- [jerry_create_string_from_utf8](#jerry_create_string_from_utf8)
+
+
+## jerry_create_undefined
+
+**Summary**
+
+Creates a `jerry_value_t` representing an undefined value.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_create_undefined (void);
+```
+
+- return value - value of undefined
+
+**Example**
+
+```c
+{
+  jerry_value_t undefined_value = jerry_create_undefined ();
+
+  ... // usage of the value
+
+  jerry_release_value (undefined_value);
+}
+```
+
+**See also**
+
+- [jerry_release_value](#jerry_release_value)
+
+
+# General API functions of JS objects
+
+## jerry_has_property
+
+**Summary**
+
+Checks whether the object or its prototype objects have the given property.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_has_property (const jerry_value_t obj_val,
+                    const jerry_value_t prop_name_val);
+```
+
+- `obj_val` - object value
+- `prop_name_val` - property name
+- return value - JavaScript boolean value that evaluates to
+  - true, if the property exists
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t global_object = jerry_get_global_object ();
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "handler_field");
+
+  jerry_value_t has_prop_js = jerry_has_property (global_object, prop_name);
+  bool has_prop = jerry_get_boolean_value (has_prop_js);
+
+  jerry_release_value (has_prop_js);
+  jerry_release_value (prop_name);
+  jerry_release_value (global_object);
+}
+```
+
+**See also**
+
+- [jerry_has_own_property](#jerry_has_own_property)
+- [jerry_delete_property](#jerry_delete_property)
+
+
+## jerry_has_own_property
+
+**Summary**
+
+Checks whether the object has the given property.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_has_own_property (const jerry_value_t obj_val,
+                        const jerry_value_t prop_name_val);
+```
+
+- `obj_val` - object value
+- `prop_name_val` - property name
+- return value - JavaScript boolean value that evaluates to
+  - true, if the property exists
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t global_object = jerry_get_global_object ();
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "handler_field");
+
+  jerry_value_t has_prop_js = jerry_has_own_property (global_object, prop_name);
+  bool has_prop = jerry_get_boolean_value (has_prop_js);
+
+  jerry_release_value (jas_prop_js);
+  jerry_release_value (prop_name);
+  jerry_release_value (global_object);
+}
+```
+
+**See also**
+
+- [jerry_has_property](#jerry_has_property)
+- [jerry_delete_property](#jerry_delete_property)
+
+
+## jerry_delete_property
+
+**Summary**
+
+Delete a property from an object.
+
+**Prototype**
+
+```c
+bool
+jerry_delete_property (const jerry_value_t obj_val,
+                       const jerry_value_t prop_name_val);
+```
+
+- `obj_val` - object value
+- `prop_name_val` - property name
+- return value
+  - true, if property was deleted successfully
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t global_object = jerry_get_global_object ();
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
+
+  jerry_delete_property (global_object, prop_name);
+
+  jerry_release_value (prop_name);
+  jerry_release_value (global_object);
+}
+```
+
+**See also**
+
+- [jerry_has_property](#jerry_has_property)
+- [jerry_has_own_property](#jerry_has_own_property)
+- [jerry_get_property](#jerry_get_property)
+
+
+## jerry_get_property
+
+**Summary**
+
+Get value of a property to the specified object with the given name.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_get_property (const jerry_value_t obj_val,
+                    const jerry_value_t prop_name_val);
+```
+
+- `obj_val` - object value
+- `prop_name_val` - property name
+- return value
+  - value of property, if success
+  - thrown error, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t global_object = jerry_get_global_object ();
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
+
+  jerry_value_t prop_value = jerry_get_property (obj_val, prop_name);
+
+  jerry_release_value (prop_name);
+  jerry_release_value (global_object);
+}
+```
+
+**See also**
+
+- [jerry_has_property](#jerry_has_property)
+- [jerry_has_own_property](#jerry_has_own_property)
+- [jerry_delete_property](#jerry_delete_property)
+- [jerry_set_property](#jerry_set_property)
+- [jerry_get_property_by_index](#jerry_get_property_by_index)
+- [jerry_set_property_by_index](#jerry_set_property_by_index)
+
+
+## jerry_get_property_by_index
+
+**Summary**
+
+Get value by an index from the specified object.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_get_property_by_index (const jerry_value_t obj_val,
+                             uint32_t index);
+```
+
+- `obj_val` - object value
+- `index` - index number
+- return value
+  - stored value on the specified index, if success
+  - thrown exception, otherwise.
+
+**Example**
+
+```c
+{
+  jerry_value_t object;
+
+  ... // create or acquire object
+
+  jerry_value_t value = jerry_get_property_by_index (object, 5);
+
+  ...
+
+  jerry_release_value (value);
+  jerry_release_value (object);
+}
+```
+
+**See also**
+
+- [jerry_has_property](#jerry_has_property)
+- [jerry_has_own_property](#jerry_has_own_property)
+- [jerry_delete_property](#jerry_delete_property)
+- [jerry_get_property](#jerry_get_property)
+- [jerry_set_property](#jerry_set_property)
+- [jerry_set_property_by_index](#jerry_set_property_by_index)
+
+
+## jerry_set_property
+
+**Summary**
+
+Set a property to the specified object with the given name.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_set_property (const jerry_value_t obj_val,
+                    const jerry_value_t prop_name_val,
+                    const jerry_value_t value_to_set)
+```
+
+- `obj_val` - object value
+- `prop_name_val` - property name
+- `value_to_set` - value to set
+- return value
+  - true, if success
+  - thrown error, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t value_to_set;
+
+  ... // create or acquire value to set
+
+  jerry_value_t glob_obj = jerry_get_global_object ();
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
+
+  jerry_value_t set_result = jerry_set_property (glob_obj, prop_name, value_to_set);
+
+  ... // check result of property set call
+
+  jerry_release_value (set_result);
+  jerry_release_value (prop_name);
+
+  ...
+
+  jerry_release_value (value_to_set);
+  jerry_release_value (glob_obj);
+}
+```
+
+**See also**
+
+- [jerry_has_property](#jerry_has_property)
+- [jerry_has_own_property](#jerry_has_own_property)
+- [jerry_delete_property](#jerry_delete_property)
+- [jerry_get_property](#jerry_get_property)
+- [jerry_get_property_by_index](#jerry_get_property_by_index)
+- [jerry_set_property_by_index](#jerry_set_property_by_index)
+
+
+## jerry_set_property_by_index
+
+**Summary**
+
+Set indexed value in the specified object
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_set_property_by_index (const jerry_value_t obj_val,
+                             uint32_t index,
+                             const jerry_value_t value_to_set);
+```
+
+- `obj_val` - object value
+- `index` - index number
+- `value_to_set` - value to set
+- return value
+  - true, if field value was set successfully
+  - thrown exception, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t object;
+  jerry_value_t value_to_set;
+
+  ... // create or acquire object and value to set
+
+  jerry_value_t ret_val = jerry_set_property_by_index (object, 5, value_to_set);
+
+  ...
+
+  jerry_release_value (value_to_set);
+  jerry_release_value (ret_val);
+  jerry_release_value (object);
+}
+```
+
+**See also**
+
+- [jerry_has_property](#jerry_has_property)
+- [jerry_has_own_property](#jerry_has_own_property)
+- [jerry_delete_property](#jerry_delete_property)
+- [jerry_get_property](#jerry_get_property)
+- [jerry_set_property](#jerry_set_property)
+- [jerry_get_property_by_index](#jerry_get_property_by_index)
+
+
+## jerry_init_property_descriptor_fields
+
+**Summary**
+
+Initialize property descriptor.
+
+**Prototype**
+
+```c
+void
+jerry_init_property_descriptor_fields (jerry_property_descriptor_t *prop_desc_p);
+```
+
+- `prop_desc_p` - pointer to property descriptor
+
+**Example**
+
+```c
+{
+  jerry_property_descriptor_t prop_desc;
+  jerry_init_property_descriptor_fields (&prop_desc);
+
+  ... // usage of prop_desc
+
+  jerry_free_property_descriptor_fields (&prop_desc);
+}
+```
+
+**See also**
+
+- [jerry_define_own_property](#jerry_define_own_property)
+- [jerry_get_own_property_descriptor](#jerry_get_own_property_descriptor)
+- [jerry_free_property_descriptor_fields](#jerry_free_property_descriptor_fields)
+
+
+## jerry_define_own_property
+
+**Summary**
+
+Define a property to the specified object with the given name.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_define_own_property (const jerry_value_t obj_val,
+                           const jerry_value_t prop_name_val,
+                           const jerry_property_descriptor_t *prop_desc_p);
+```
+
+- `obj_val` - object value
+- `prop_name_val` - property name
+- `prop_desc_p` - pointer to property descriptor
+- return value
+  - true, if success
+  - thrown error, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t global_obj_val = jerry_get_global_object ();
+
+  jerry_property_descriptor_t prop_desc;
+  jerry_init_property_descriptor_fields (&prop_desc);
+
+  jerry_value_t value_to_set;
+
+  ... // create or acquire value to set
+
+  prop_desc.is_value_defined = true;
+  prop_desc.value = value_to_set;
+
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
+  jerry_value_t return_value = jerry_define_own_property (global_obj_val, prop_name, &prop_desc);
+  jerry_release_value (return_value);
+  jerry_release_value (prop_name);
+
+  jerry_free_property_descriptor_fields (&prop_desc);
+  jerry_release_value (global_obj_val);
+}
+```
+
+**See also**
+
+- [jerry_init_property_descriptor_fields](#jerry_init_property_descriptor_fields)
+- [jerry_get_own_property_descriptor](#jerry_get_own_property_descriptor)
+- [jerry_free_property_descriptor_fields](#jerry_free_property_descriptor_fields)
+
+
+## jerry_get_own_property_descriptor
+
+**Summary**
+
+Construct property descriptor from specified property.
+
+**Prototype**
+
+```c
+bool
+jerry_get_own_property_descriptor (const jerry_value_t  obj_val,
+                                   const jerry_value_t prop_name_val,
+                                   jerry_property_descriptor_t *prop_desc_p);
+```
+
+- `obj_val` - object value
+- `prop_name_val` - property name
+- `prop_desc_p` - pointer to property descriptor
+- return value
+
+**Example**
+
+```c
+{
+  jerry_value_t global_obj_val = jerry_get_global_object ();
+
+  jerry_property_descriptor_t prop_desc;
+  jerry_init_property_descriptor_fields (&prop_desc);
+
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
+  jerry_get_own_property_descriptor (global_obj_val, prop_name, &prop_desc);
+  jerry_release_value (prop_name);
+
+  ... // usage of property descriptor
+
+  jerry_free_property_descriptor_fields (&prop_desc);
+  jerry_release_value (global_obj_val);
+}
+```
+
+**See also**
+
+- [jerry_init_property_descriptor_fields](#jerry_init_property_descriptor_fields)
+- [jerry_define_own_property](#jerry_define_own_property)
+- [jerry_free_property_descriptor_fields](#jerry_free_property_descriptor_fields)
+
+
+## jerry_free_property_descriptor_fields
+
+**Summary**
+
+Free fields of property descriptor (setter, getter and value).
+
+**Prototype**
+
+```c
+void
+jerry_free_property_descriptor_fields (const jerry_property_descriptor_t *prop_desc_p);
+```
+
+- `prop_desc_p` - pointer to property descriptor
+
+**Example**
+
+```c
+{
+  jerry_property_descriptor_t prop_desc;
+  jerry_init_property_descriptor_fields (&prop_desc);
+
+  ... // usage of property descriptor
+
+  jerry_free_property_descriptor_fields (&prop_desc);
+}
+```
+
+**See also**
+
+- [jerry_init_property_descriptor_fields](#jerry_init_property_descriptor_fields)
+- [jerry_define_own_property](#jerry_define_own_property)
+- [jerry_get_own_property_descriptor](#jerry_get_own_property_descriptor)
+
+
+## jerry_call_function
+
+**Summary**
+
+Call function specified by a function value. Error flag must
+not be set for any arguments of this function. Value of `this`
+parameter should be set to `undefined` for non-method calls.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_call_function (const jerry_value_t func_obj_val,
+                     const jerry_value_t this_val,
+                     const jerry_value_t args_p[],
+                     jerry_size_t args_count);
+```
+
+- `func_obj_val` - the function object to call
+- `this_val` - object for 'this' binding
+- `args_p` - function's call arguments
+- `args_count` - number of arguments
+- return value - returned jerry value of the called function
+
+**Example**
+
+```c
+{
+  jerry_value_t val;
+
+  ... // receiving val
+
+  if (jerry_value_is_function (val))
+  {
+    jerry_value_t this_val = jerry_create_undefined ();
+    jerry_value_t ret_val = jerry_call_function (val, this_val, NULL, 0);
+
+    if (!jerry_value_has_error_flag (ret_val))
+    {
+      ... // handle return value
+    }
+
+    jerry_release_value (ret_val);
+    jerry_release_value (this_val);
+  }
+
+  jerry_release_value (val);
+}
+```
+
+**See also**
+
+- [jerry_is_function](#jerry_is_function)
+- [jerry_create_external_function](#jerry_create_external_function)
+
+
+## jerry_construct_object
+
+**Summary**
+
+Construct object, invoking specified function object as constructor.
+Error flag must not be set for any arguments of this function.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_construct_object (const jerry_value_t func_obj_val,
+                        const jerry_value_t args_p[],
+                        jerry_size_t args_count);
+```
+
+- `func_obj_val` - function object to call
+- `args_p` - function's call arguments
+- `args_count` - number of arguments
+- return value - returned value of the invoked constructor
+
+**Example**
+
+```c
+{
+  jerry_value_t val;
+
+  ... // receiving val
+
+  if (jerry_is_constructor (val))
+  {
+    jerry_value_t ret_val = jerry_construct_object (val, NULL, 0);
+
+    if (!jerry_value_has_error_flag (ret_val))
+    {
+      ... // handle return value
+    }
+
+    jerry_release_value (ret_val);
+  }
+}
+```
+
+**See also**
+
+ - [jerry_is_constructor](#jerry_is_constructor)
+
+
+## jerry_get_object_keys
+
+**Summary**
+
+Get keys of the specified object value.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_get_object_keys (const jerry_value_t obj_val);
+```
+
+- `obj_val` - object value
+- return value
+  - array object value, if success
+  - thrown error, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t object;
+  ... // create or acquire object
+
+  jerry_value_t keys_array = jerry_get_object_keys (object);
+
+  ... // usage of keys_array
+
+  jerry_release_value (keys_array);
+}
+```
+
+**See also**
+
+- [jerry_get_property](#jerry_get_property)
+- [jerry_set_property](#jerry_set_property)
+
+
+## jerry_get_prototype
+
+**Summary**
+
+Get the prototype of the specified object.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_get_prototype (const jerry_value_t obj_val);
+```
+
+- `obj_val` - object value
+- return value
+  - object value, if success
+  - null or thrown error, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t object;
+  ... // create or acquire object
+
+  jerry_value_t prototype = jerry_get_prototype (object);
+
+  ... // usage of prototype object
+
+  jerry_release_value (prototype);
+  jerry_release_value (object);
+}
+```
+
+**See also**
+
+- [jerry_set_prototype](#jerry_set_prototype)
+
+
+## jerry_set_prototype
+
+**Summary**
+
+Set the prototype of the specified object.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_set_prototype (const jerry_value_t obj_val,
+                     const jerry_value_t proto_obj_val);
+```
+
+- `obj_val` - object value
+- `proto_obj_val` - prototype object value
+- return value
+  - true, if success
+  - thrown error, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t object;
+  jerry_value_t prototype;
+
+  ... // create or acquire object and prototype
+
+  jerry_value_t ret_val = jerry_set_prototype (object, prototype);
+
+  jerry_release_value (ret_val);
+  jerry_release_value (prototype);
+  jerry_release_value (object);
+}
+```
+
+**See also**
+
+- [jerry_get_prototype](#jerry_get_prototype)
+
+
+## jerry_get_object_native_handle
+
+**Summary**
+
+**Deprecated: Please use jerry_get_object_native_pointer instead.**
+
+Get native handle, previously associated with specified object.
+
+**Prototype**
+
+```c
+bool
+jerry_get_object_native_handle (const jerry_value_t obj_val,
+                                uintptr_t *out_handle_p);
+```
+
+- `obj_val` - object value
+- `out_handle_p` - handle value (output parameter).
+- return value
+  - true, if there is handle associated with the object
+  - false, otherwise
+
+**Example**
+
+```c
+{
+  jerry_value_t object;
+  uintptr_t handle_set;
+
+  ... // receive or construct object and handle_set value
+
+  jerry_set_object_native_handle (object, handle_set, NULL);
+
+  ...
+
+  uintptr_t handle_get;
+  bool is_there_associated_handle = jerry_get_object_native_handle (object, &handle_get);
+}
+```
+
+**See also**
+
+- [jerry_create_object](#jerry_create_object)
+- [jerry_set_object_native_handle](#jerry_set_object_native_handle)
+- [jerry_get_object_native_pointer](#jerry_get_object_native_pointer)
+
+
+## jerry_set_object_native_handle
+
+**Summary**
+
+**Deprecated: Please use jerry_set_object_native_pointer instead.**
+
+Set native handle and an optional free callback for the specified object.
+
+*Note*: If native handle was already set for the object, its value is updated.
+
+*Note*: If a non-NULL free callback is specified, it will be called
+        by the garbage collector when the object is freed. The free
+        callback always overwrites the previous value, so passing
+        a NULL value deletes the current free callback.
+
+**Prototype**
+
+```c
+void
+jerry_set_object_native_handle (const jerry_value_t obj_val,
+                                uintptr_t handle_p,
+                                jerry_object_free_callback_t freecb_p);
+```
+
+- `obj_val` - object value to set handle in
+- `handle_p` - handle value
+- `freecb_p` - pointer to "free" callback or NULL
+
+**Example**
+
+```c
+{
+  jerry_value_t object;
+  uintptr_t handle_set;
+
+  ... // receive or construct object and handle_set value
+
+  jerry_set_object_native_handle (object, handle_set, NULL);
+
+  ...
+
+  uintptr_t handle_get;
+  bool is_there_associated_handle = jerry_get_object_native_handle (object, &handle_get);
+}
+```
+
+**See also**
+
+- [jerry_create_object](#jerry_create_object)
+- [jerry_get_object_native_handle](#jerry_get_object_native_handle)
+- [jerry_set_object_native_pointer](#jerry_set_object_native_pointer)
+
+
+## jerry_get_object_native_pointer
+
+**Summary**
+
+Get native pointer and its type information.
+The pointer and the type information are previously associated with the object by jerry_set_object_native_pointer.
+
+*Note*: It is recommended to ensure that the `out_native_info_p` value pointer
+        is equal to the native info pointer that is expected, before casting
+        and accessing the `out_native_pointer_p`.
+        An example of when this is important: external functions that expect
+        `this` to have a native pointer of a certain C type.
+        It is possible in JavaScript to change `this` at will – using `call()`,
+        `apply()` or `bind()`. Therefore, it is possible that the native pointer
+        of `this` is not of the expected C type. To handle this safely and
+        securely, one must always add type checks to make sure that the
+        `out_native_pointer_p` is of the expected type, before casting
+        and dereferencing `out_native_pointer_p`.
+
+*Note*: `out_native_pointer_p` and `out_native_info_p` can be NULL, and it means the
+        caller doesn't want to get the native_pointer or type infomation.
+
+**Prototype**
+
+```c
+bool
+jerry_get_object_native_pointer (const jerry_value_t obj_val,
+                                 void **out_native_pointer_p,
+                                 const jerry_object_native_info_t **out_native_info_p)
+```
+
+- `obj_val` - object value to get native pointer from.
+- `out_native_pointer_p` - native pointer (output parameter).
+- `out_native_info_p` - native pointer's type infomation (output parameter).
+- return value
+  - true, if there is native pointer associated with the object
+  - false, otherwise
+
+**Example**
+
+```c
+typedef struct {
+  int foo;
+  bool bar;
+} native_obj_t;
+
+static void native_freecb (void *native_p)
+{
+  ... // free the native pointer
+}
+
+// NOTE: The address (!) of type_info acts as a way to uniquely "identify" the
+// C type `native_obj_t *`.
+static const jerry_object_native_info_t native_obj_type_info =
+{
+  .free_cb = native_freecb
+};
+
+// Function creating JS object that is "backed" by a native_obj_t *:
+{
+  ...
+
+  // construct object and native_set value:
+  jerry_value_t object = ...;
+  native_obj_t *native_obj = malloc(sizeof(*native_obj));
+  jerry_set_object_native_pointer (object, native_obj, &native_obj_type_info);
+
+  ...
+}
+
+// Native method, `this` is expected to be "backed" by a native_obj_t *:
+{
+  void *native_p;
+  const jerry_object_native_info_t *type_p;
+  bool has_p = jerry_get_object_native_pointer (this_val, &native_p, &type_p);
+
+  if (has_p)
+  {
+    // The type_p pointer address itself is used to identify the type:
+    if (type_p == &native_obj_type_info)
+    {
+      // The type of this's native pointer matches what is expected.
+      // Only now is it safe to cast to native_obj_t * and dereference the
+      // pointer:
+      native_obj_t *native_obj = native_p;
+      native_obj->bar = ...; // Safe to access now!
+    }
+    else
+    {
+      // The type of this's native pointer is NOT what we expected!
+      // We should not cast to native_obj_t * and dereference because it's unsafe.
+      // Handle the error here, for example throw an error.
+    }
+  }
+  ...
+}
+```
+
+**See also**
+
+- [jerry_create_object](#jerry_create_object)
+- [jerry_set_object_native_pointer](#jerry_set_object_native_pointer)
+- [jerry_object_native_info_t](#jerry_object_native_info_t)
+
+
+## jerry_set_object_native_pointer
+
+**Summary**
+
+Set native pointer and an optional type information for the specified object.
+You can get them by calling jerry_get_object_native_pointer later.
+
+*Note*: If native pointer was already set for the object, its value is updated.
+
+*Note*: If a non-NULL free callback is specified in the native type information,
+        it will be called by the garbage collector when the object is freed.
+        The type info is always overwrites the previous value, so passing
+        a NULL value deletes the current type info.
+
+**Prototype**
+
+```c
+bool
+jerry_set_object_native_pointer (const jerry_value_t obj_val,
+                                 void *native_p,
+                                 const jerry_object_native_info_t *info_p)
+```
+
+- `obj_val` - object to set native pointer in.
+- `native_p` - native pointer.
+- `info_p` - native pointer's type infomation or NULL. When used, this should
+             be a long-lived pointer, usually a pointer to a
+             `static const jerry_object_native_info_t` makes most sense.
+
+**Example**
+
+See [jerry_get_object_native_pointer](#jerry_get_object_native_pointer) for a
+best-practice example.
+
+**See also**
+
+- [jerry_create_object](#jerry_create_object)
+- [jerry_get_object_native_pointer](#jerry_get_object_native_pointer)
+- [jerry_object_native_info_t](#jerry_object_native_info_t)
+
+
+## jerry_foreach_object_property
+
+**Summary**
+
+Applies the given function to every property in the given object.
+
+**Prototype**
+
+```c
+bool
+jerry_foreach_object_property (jerry_value_t obj_val,
+                               jerry_object_property_foreach_t foreach_p,
+                               void *user_data_p);
+```
+
+- `obj_val` - object value
+- `foreach_p` - foreach function, that will be applied for each property
+- `user_data_p` - user data for foreach function
+- return value
+  - true, if object fields traversal was performed successfully, i.e.:
+    - no unhandled exceptions were thrown in object fields traversal
+    - object fields traversal was stopped on callback that returned false
+  - false, otherwise
+
+**Example**
+
+```c
+bool foreach_function (const jerry_value_t prop_name,
+                       const jerry_value_t prop_value,
+                       void *user_data_p)
+{
+
+  ... // implementation of the foreach function
+
+}
+
+{
+  jerry_value_t object;
+  ... // receive or construct object
+
+  double data = 3.14; // example data
+
+  jerry_foreach_object_property (object, foreach_function, &data);
+
+}
+```
+
+**See also**
+
+- [jerry_object_property_foreach_t](#jerry_object_property_foreach_t)
+
+
+# Input validator functions
+
+## jerry_is_valid_utf8_string
+
+**Summary**
+
+Validate UTF-8 string.
+
+**Prototype**
+
+```c
+bool
+jerry_is_valid_utf8_string (const jerry_char_t *utf8_buf_p, /**< UTF-8 string */
+                            jerry_size_t buf_size) /**< string size */
+```
+
+- `utf8_buf_p` - UTF-8 input string
+- `buf_size` - input string size
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  const jerry_char_t script[] = "print ('Hello, World!');";
+  size_t script_size = strlen ((const char *) script);
+
+  if (jerry_is_valid_utf8_string (script, (jerry_size_t) script_size))
+  {
+    jerry_run_simple (script, script_size, JERRY_INIT_EMPTY);
+  }
+}
+```
+
+**See also**
+
+- [jerry_run_simple](#jerry_run_simple)
+- [jerry_create_string_from_utf8](#jerry_create_string_from_utf8)
+- [jerry_create_string_sz_from_utf8](#jerry_create_string_sz_from_utf8)
+- [jerry_get_utf8_string_size](#jerry_get_utf8_string_size)
+- [jerry_get_utf8_string_length](#jerry_get_utf8_string_length)
+- [jerry_string_to_utf8_char_buffer](#jerry_string_to_utf8_char_buffer)
+- [jerry_substring_to_utf8_char_buffer](#jerry_substring_to_utf8_char_buffer)
+
+## jerry_is_valid_cesu8_string
+
+**Summary**
+
+Validate CESU-8 string.
+
+**Prototype**
+
+```c
+bool
+jerry_is_valid_cesu8_string (const jerry_char_t *cesu8_buf_p, /**< CESU-8 string */
+                             jerry_size_t buf_size) /**< string size */
+```
+
+- `cesu8_buf_p` - CESU-8 input string
+- `buf_size` - input string size
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  const jerry_char_t script[] = "Hello, World!";
+  size_t script_size = strlen ((const char *) script);
+
+  if (jerry_is_valid_cesu8_string (script, (jerry_size_t) script_size))
+  {
+    jerry_value_t string_value = jerry_create_string_sz (script,
+                                                         (jerry_size_t) script_size);
+
+    // usage of string_value
+
+    jerry_release_value (string_value);
+  }
+
+  jerry_cleanup ();
+}
+```
+
+**See also**
+
+- [jerry_create_string](#jerry_create_string)
+- [jerry_create_string_sz](#jerry_create_string_sz)
+- [jerry_get_string_size](#jerry_get_string_size)
+- [jerry_get_string_length](#jerry_get_string_length)
+- [jerry_string_to_char_buffer](#jerry_string_to_char_buffer)
+- [jerry_substring_to_char_buffer](#jerry_substring_to_char_buffer)
+
+
+# Snapshot functions
+
+## jerry_parse_and_save_snapshot
+
+**Summary**
+
+Generate snapshot from the specified source code.
+
+**Prototype**
+
+```c
+size_t
+jerry_parse_and_save_snapshot (const jerry_char_t *source_p,
+                               size_t source_size,
+                               bool is_for_global,
+                               bool is_strict,
+                               uint32_t *buffer_p,
+                               size_t buffer_size);
+```
+
+- `source_p` - script source, it must be a valid utf8 string.
+- `source_size` - script source size, in bytes.
+- `is_for_global` - snapshot would be executed as global (true) or eval (false).
+- `is_strict` - strict mode
+- `buffer_p` - buffer to save snapshot to.
+- `buffer_size` - the buffer's size.
+- return value
+  - the size of snapshot, if it was generated succesfully (i.e. there are no syntax errors in source
+    code, buffer size is sufficient, and snapshot support is enabled in current configuration through
+    JERRY_ENABLE_SNAPSHOT_SAVE)
+  - 0 otherwise.
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  static uint32_t global_mode_snapshot_buffer[256];
+  const jerry_char_t *code_to_snapshot_p = (const jerry_char_t *) "(function () { return 'string from snapshot'; }) ();";
+
+  size_t global_mode_snapshot_size = jerry_parse_and_save_snapshot (code_to_snapshot_p,
+                                                                    strlen ((const char *) code_to_snapshot_p),
+                                                                    true,
+                                                                    false,
+                                                                    global_mode_snapshot_buffer,
+                                                                    sizeof (global_mode_snapshot_buffer) / sizeof (uint32_t));
+
+  jerry_cleanup ();
+}
+```
+
+**See also**
+
+- [jerry_init](#jerry_init)
+- [jerry_cleanup](#jerry_cleanup)
+- [jerry_exec_snapshot](#jerry_exec_snapshot)
+
+
+## jerry_exec_snapshot
+
+**Summary**
+
+Execute snapshot from the specified buffer.
+
+*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
+is no longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerry_exec_snapshot (const uint32_t *snapshot_p,
+                     size_t snapshot_size,
+                     bool copy_bytecode);
+```
+
+- `snapshot_p` - pointer to snapshot
+- `snapshot_size` - size of snapshot
+- `copy_bytecode` - flag, indicating whether the passed snapshot buffer should be copied to the
+   engine's memory. If set the engine should not reference the buffer after the function returns
+   (in this case, the passed buffer could be freed after the call). Otherwise (if the flag is not
+   set) - the buffer could only be freed after the engine stops (i.e. after call to jerry_cleanup).
+- return value
+  - result of bytecode, if run was successful
+  - thrown error, otherwise
+
+**Example**
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  static uint32_t global_mode_snapshot_buffer[256];
+  const jerry_char_t *code_to_snapshot_p = (const jerry_char_t *) "(function () { return 'string from snapshot'; }) ();";
+
+  jerry_init (JERRY_INIT_EMPTY);
+  size_t global_mode_snapshot_size = jerry_parse_and_save_snapshot (code_to_snapshot_p,
+                                                                    strlen ((const char *) code_to_snapshot_p),
+                                                                    true,
+                                                                    false,
+                                                                    global_mode_snapshot_buffer,
+                                                                    sizeof (global_mode_snapshot_buffer) / sizeof (uint32_t));
+  jerry_cleanup ();
+
+  jerry_init (JERRY_INIT_EMPTY);
+
+  jerry_value_t res = jerry_exec_snapshot (global_mode_snapshot_buffer,
+                                           global_mode_snapshot_size,
+                                           false);
+  jerry_release_value (res);
+
+  jerry_cleanup ();
+}
+```
+
+**See also**
+
+- [jerry_init](#jerry_init)
+- [jerry_cleanup](#jerry_cleanup)
+- [jerry_parse_and_save_snapshot](#jerry_parse_and_save_snapshot)
+
+
+## jerry_parse_and_save_literals
+
+**Summary**
+
+Collect the used literals from the given source code and save them into a specific file in a list or C format.
+These literals are generated by the parser, they are valid identifiers and none of them are magic string.
+
+**Prototype**
+
+```c
+size_t
+jerry_parse_and_save_literals (const jerry_char_t *source_p,
+                               size_t source_size,
+                               bool is_strict,
+                               uint32_t *buffer_p,
+                               size_t buffer_size,
+                               bool is_c_format);
+```
+
+- `source_p` - script source, it must be a valid utf8 string.
+- `source_size` - script source size, in bytes.
+- `is_strict` - strict mode.
+- `buffer_p` - buffer to save literals to.
+- `buffer_size` - the buffer's size.
+- `is_c_format` - the output format would be C-style (true) or a simple list (false).
+- return value
+  - the size of the literal-list, if it was generated succesfully (i.e. the list of literals isn't empty,
+    and literal-save support is enabled in current configuration through JERRY_ENABLE_SNAPSHOT_SAVE)
+  - 0 otherwise.
+
+**Example**
+
+[doctest]: # (test="link")
+
+```c
+#include <stdio.h>
+#include <string.h>
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  static uint32_t save_literal_buffer[256];
+  const jerry_char_t *code_for_literal_save_p = (const jerry_char_t *) "var obj = { a:'aa', bb:'Bb' }";
+
+  size_t literal_sizes = jerry_parse_and_save_literals (code_for_literal_save_p,
+                                                        strlen ((const char *) code_for_literal_save_p),
+                                                        false,
+                                                        save_literal_buffer,
+                                                        sizeof (save_literal_buffer) / sizeof (uint32_t),
+                                                        true);
+
+  if (literal_sizes != 0)
+  {
+    FILE *literal_file_p = fopen ("literals.txt", "w");
+    fwrite (save_literal_buffer, sizeof (uint8_t), literal_sizes, literal_file_p);
+    fclose (literal_file_p);
+  }
+
+  jerry_cleanup ();
+}
+```
+
+**See also**
+
+- [jerry_init](#jerry_init)
+- [jerry_cleanup](#jerry_cleanup)
+- [jerry_register_magic_strings](#jerry_register_magic_strings)
+
+
+# Miscellaneous functions
+
+## jerry_set_vm_exec_stop_callback
+
+**Summary**
+
+When JERRY_FEATURE_VM_EXEC_STOP is enabled a callback function can be
+specified by this function. This callback is periodically called when
+JerryScript executes an ECMAScript program.
+
+If the callback returns with undefined value the ECMAScript execution
+continues. Otherwise the result is thrown by the engine (if the error
+flag is not set for the returned value the engine automatically sets
+it). The callback function might be called again even if it threw
+an error. In this case the function must throw the same error again.
+
+To reduce the CPU overhead of constantly checking the termination
+condition the callback is called when a backward jump is executed
+or an exception is caught. Setting the `frequency` to a greater
+than `1` value reduces this overhead further. If its value is N
+only every Nth event (backward jump, etc.) trigger the next check.
+
+
+**Prototype**
+
+```c
+void
+jerry_set_vm_exec_stop_callback (jerry_vm_exec_stop_callback_t stop_cb,
+                                 void *user_p,
+                                 uint32_t frequency);
+```
+
+- `stop_cb` - periodically called callback (passing NULL disables this feature)
+- `user_p` - user pointer passed to the `stop_cb` function
+- `frequency` - frequency of calling the `stop_cb` function
+
+**Example**
+
+[doctest]: # (test="link")
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+
+static int countdown = 10;
+
+static jerry_value_t
+vm_exec_stop_callback (void *user_p)
+{
+  while (countdown > 0)
+  {
+    countdown--;
+    return jerry_create_undefined ();
+  }
+
+  // The error flag is added automatically.
+  return jerry_create_string ((const jerry_char_t *) "Abort script");
+}
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  jerry_set_vm_exec_stop_callback (vm_exec_stop_callback, &countdown, 16);
+
+  // Inifinte loop.
+  const char *src_p = "while(true) {}";
+
+  jerry_value_t src = jerry_parse ((jerry_char_t *) src_p, strlen (src_p), false);
+  jerry_release_value (jerry_run (src));
+  jerry_release_value (src);
+  jerry_cleanup ();
+}
+```
+
+**See also**
+
+- [jerry_init](#jerry_init)
+- [jerry_cleanup](#jerry_cleanup)
+- [jerry_parse](#jerry_parse)
+- [jerry_run](#jerry_run)
+- [jerry_vm_exec_stop_callback_t](#jerry_vm_exec_stop_callback_t)
diff --git a/deps/jerry/docs/03.API-EXAMPLE.md b/deps/jerry/docs/03.API-EXAMPLE.md
new file mode 100644 (file)
index 0000000..1ffe2e8
--- /dev/null
@@ -0,0 +1,556 @@
+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.
+
+## Step 1. Execute JavaScript from your application
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+
+int
+main (void)
+{
+  const jerry_char_t script[] = "var str = 'Hello, World!';";
+  size_t script_size = strlen ((const char *) script);
+
+  bool ret_value = jerry_run_simple (script, script_size, JERRY_INIT_EMPTY);
+
+  return (ret_value ? 0 : 1);
+}
+```
+
+The application will return with zero exit code.
+
+## Step 2. Split engine initialization and script execution
+
+Here we perform the same actions, as `jerry_run_simple`, while splitting into several steps:
+
+- engine initialization
+- script code setup
+- script execution
+- engine cleanup
+
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+
+int
+main (void)
+{
+  const jerry_char_t script[] = "print ('Hello, World!');";
+  size_t script_size = strlen ((const char *) script);
+
+  /* Initialize engine */
+  jerry_init (JERRY_INIT_EMPTY);
+
+  /* Register 'print' function from the extensions */
+  jerryx_handler_register_global ((const jerry_char_t *) "print",
+                                  jerryx_handler_print);
+
+  /* Setup Global scope code */
+  jerry_value_t parsed_code = jerry_parse (script, script_size, false);
+
+  if (!jerry_value_has_error_flag (parsed_code))
+  {
+    /* Execute the parsed source code in the Global scope */
+    jerry_value_t ret_value = jerry_run (parsed_code);
+
+    /* Returned value must be freed */
+    jerry_release_value (ret_value);
+  }
+
+  /* Parsed source code must be freed */
+  jerry_release_value (parsed_code);
+
+  /* Cleanup engine */
+  jerry_cleanup ();
+
+  return 0;
+}
+```
+
+Our code is more complex now, but it introduces possibilities to interact with JerryScript step-by-step: setup native objects, call JavaScript functions, etc.
+
+## Step 3. Execution in 'eval'-mode
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+
+int
+main (void)
+{
+  const jerry_char_t script_1[] = "var s = 'Hello, World!';";
+  const jerry_char_t script_2[] = "print (s);";
+
+  /* Initialize engine */
+  jerry_init (JERRY_INIT_EMPTY);
+
+  /* Register 'print' function from the extensions */
+  jerryx_handler_register_global ((const jerry_char_t *) "print",
+                                  jerryx_handler_print);
+
+  jerry_value_t eval_ret;
+
+  /* Evaluate script1 */
+  eval_ret = jerry_eval (script_1,
+                         strlen ((const char *) script_1),
+                         false);
+
+  /* Free JavaScript value, returned by eval */
+  jerry_release_value (eval_ret);
+
+  /* Evaluate script2 */
+  eval_ret = jerry_eval (script_2,
+                         strlen ((const char *) script_2),
+                         false);
+
+  /* Free JavaScript value, returned by eval */
+  jerry_release_value (eval_ret);
+
+  /* Cleanup engine */
+  jerry_cleanup ();
+
+  return 0;
+}
+```
+
+This way, we execute two independent script parts in one execution environment. The first part initializes string variable, and the second outputs the variable.
+
+## Step 4. Interaction with JavaScript environment
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+
+int
+main (void)
+{
+  const jerry_char_t str[] = "Hello, World!";
+  const jerry_char_t script[] = "print (s);";
+
+  /* Initializing JavaScript environment */
+  jerry_init (JERRY_INIT_EMPTY);
+
+  /* Register 'print' function from the extensions */
+  jerryx_handler_register_global ((const jerry_char_t *) "print",
+                                  jerryx_handler_print);
+
+  /* Getting pointer to the Global object */
+  jerry_value_t global_object = jerry_get_global_object ();
+
+  /* Constructing strings */
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "s");
+  jerry_value_t prop_value = jerry_create_string (str);
+
+  /* Setting the string value as a property of the Global object */
+  jerry_set_property (global_object, prop_name, prop_value);
+
+  /* Releasing string values, as it is no longer necessary outside of engine */
+  jerry_release_value (prop_name);
+  jerry_release_value (prop_value);
+
+  /* Releasing the Global object */
+  jerry_release_value (global_object);
+
+  /* Now starting script that would output value of just initialized field */
+  jerry_value_t eval_ret = jerry_eval (script,
+                                       strlen ((const char *) script),
+                                       false);
+
+  /* Free JavaScript value, returned by eval */
+  jerry_release_value (eval_ret);
+
+  /* Freeing engine */
+  jerry_cleanup ();
+
+  return 0;
+}
+```
+
+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 JerryScript value descriptors
+
+JerryScript value can be a boolean, number, null, object, string or undefined. The value has an error flag,
+that indicates whether is an error or not. Every type has an error flag not only objects. The error flag should
+be cleared before the value is passed as an argument, otherwise it can lead to a type error. The error objects
+created by API functions has the error flag set.
+
+The following example function will output a JavaScript value:
+
+[doctest]: # (test="compile")
+
+```c
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "jerryscript.h"
+
+static void
+print_value (const jerry_value_t value)
+{
+  if (jerry_value_is_undefined (value))
+  {
+    printf ("undefined");
+  }
+  else if (jerry_value_is_null (value))
+  {
+    printf ("null");
+  }
+  else if (jerry_value_is_boolean (value))
+  {
+    if (jerry_get_boolean_value (value))
+    {
+      printf ("true");
+    }
+    else
+    {
+      printf ("false");
+    }
+  }
+  /* Float value */
+  else if (jerry_value_is_number (value))
+  {
+    printf ("number");
+  }
+  /* String value */
+  else if (jerry_value_is_string (value))
+  {
+    /* Determining required buffer size */
+    jerry_size_t req_sz = jerry_get_string_size (value);
+    jerry_char_t str_buf_p[req_sz + 1];
+
+    jerry_string_to_char_buffer (value, str_buf_p, req_sz);
+    str_buf_p[req_sz] = '\0';
+
+    printf ("%s", (const char *) str_buf_p);
+  }
+  /* Object reference */
+  else if (jerry_value_is_object (value))
+  {
+    printf ("[JS object]");
+  }
+
+  printf ("\n");
+}
+```
+
+## Simple JavaScript shell
+
+Now all building blocks, necessary to construct JavaScript shell, are ready.
+
+Shell operation can be described with the following loop:
+
+- read command;
+- if command is 'quit'
+  - exit loop;
+- else
+  - eval (command);
+  - print result of eval;
+  - loop.
+
+[doctest]: # (test="compile")
+
+```c
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+
+void print_value (const jerry_value_t);
+
+int
+main (void)
+{
+  bool is_done = false;
+
+  /* Initialize engine */
+  jerry_init (JERRY_INIT_EMPTY);
+
+  /* Register 'print' function from the extensions */
+  jerryx_handler_register_global ((const jerry_char_t *) "print",
+                                  jerryx_handler_print);
+
+  while (!is_done)
+  {
+    char cmd[256];
+    char *cmd_tail = cmd;
+    size_t len = 0;
+
+    printf ("> ");
+
+    /* Read next command */
+    while (true)
+    {
+      if (fread (cmd_tail, 1, 1, stdin) != 1 && len == 0)
+      {
+        is_done = true;
+        break;
+      }
+      if (*cmd_tail == '\n')
+      {
+        break;
+      }
+
+      cmd_tail++;
+      len++;
+    }
+
+    /* If the command is "quit", break the loop */
+    if (!strncmp (cmd, "quit\n", strlen ("quit\n")))
+    {
+      break;
+    }
+
+    jerry_value_t ret_val;
+
+    /* Evaluate entered command */
+    ret_val = jerry_eval ((const jerry_char_t *) cmd,
+                          len,
+                          false);
+
+    /* If command evaluated successfully, print value, returned by eval */
+    if (jerry_value_has_error_flag (ret_val))
+    {
+      /* Evaluated JS code thrown an exception
+       *  and didn't handle it with try-catch-finally */
+      printf ("Unhandled JS exception occurred: ");
+    }
+
+    print_value (ret_val);
+    jerry_release_value (ret_val);
+  }
+
+  /* Cleanup engine */
+  jerry_cleanup ();
+
+  return 0;
+}
+```
+
+The application inputs commands and evaluates them, one after another.
+
+## Step 6. Creating JS object in global context
+
+In this example we demonstrate how to use native function and structures in JavaScript.
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+
+struct my_struct
+{
+  const char *msg;
+} my_struct;
+
+/**
+ * Get a string from a native object
+ */
+static jerry_value_t
+get_msg_handler (const jerry_value_t func_value, /**< function object */
+                 const jerry_value_t this_value, /**< this arg */
+                 const jerry_value_t *args_p, /**< function arguments */
+                 const jerry_length_t args_cnt) /**< number of function arguments */
+{
+  return jerry_create_string ((const jerry_char_t *) my_struct.msg);
+} /* get_msg_handler */
+
+int
+main (void)
+{
+  /* Initialize engine */
+  jerry_init (JERRY_INIT_EMPTY);
+
+  /* Register 'print' function from the extensions */
+  jerryx_handler_register_global ((const jerry_char_t *) "print",
+                                  jerryx_handler_print);
+
+  /* Do something with the native object */
+  my_struct.msg = "Hello, World!";
+
+  /* Create an empty JS object */
+  jerry_value_t object = jerry_create_object ();
+
+  /* Create a JS function object and wrap into a jerry value */
+  jerry_value_t func_obj = jerry_create_external_function (get_msg_handler);
+
+  /* Set the native function as a property of the empty JS object */
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "myFunc");
+  jerry_set_property (object, prop_name, func_obj);
+  jerry_release_value (prop_name);
+  jerry_release_value (func_obj);
+
+  /* Wrap the JS object (not empty anymore) into a jerry api value */
+  jerry_value_t global_object = jerry_get_global_object ();
+
+  /* Add the JS object to the global context */
+  prop_name = jerry_create_string ((const jerry_char_t *) "MyObject");
+  jerry_set_property (global_object, prop_name, object);
+  jerry_release_value (prop_name);
+  jerry_release_value (object);
+  jerry_release_value (global_object);
+
+  /* Now we have a "builtin" object called MyObject with a function called myFunc()
+   *
+   * Equivalent JS code:
+   *                    var MyObject = { myFunc : function () { return "some string value"; } }
+   */
+  const jerry_char_t script[] = " \
+    var str = MyObject.myFunc (); \
+    print (str); \
+  ";
+  size_t script_size = strlen ((const char *) script);
+
+  /* Evaluate script */
+  jerry_value_t eval_ret = jerry_eval (script, script_size, false);
+
+  /* Free JavaScript value, returned by eval */
+  jerry_release_value (eval_ret);
+
+  /* Cleanup engine */
+  jerry_cleanup ();
+
+  return 0;
+}
+```
+
+The application will generate the following output:
+
+```bash
+Hello World
+```
+
+## Step 7. Extending JS Objects with native functions
+
+Here we create a JS Object with `jerry_eval`, then extend it with a native function. This function shows how to get a property value from the object and how to manipulate it.
+
+[doctest]: # ()
+
+```c
+#include <string.h>
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+
+/**
+ * Add param to 'this.x'
+ */
+static jerry_value_t
+add_handler (const jerry_value_t func_value, /**< function object */
+             const jerry_value_t this_val, /**< this arg */
+             const jerry_value_t *args_p, /**< function arguments */
+             const jerry_length_t args_cnt) /**< number of function arguments */
+{
+  /* Get 'this.x' */
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "x");
+  jerry_value_t x_val = jerry_get_property (this_val, prop_name);
+
+  if (!jerry_value_has_error_flag (x_val))
+  {
+    /* Convert Jerry API values to double */
+    double x = jerry_get_number_value (x_val);
+    double d = jerry_get_number_value (*args_p);
+
+    /* Add the parameter to 'x' */
+    jerry_value_t res_val = jerry_create_number (x + d);
+
+    /* Set the new value of 'this.x' */
+    jerry_set_property (this_val, prop_name, res_val);
+    jerry_release_value (res_val);
+  }
+
+  jerry_release_value (x_val);
+  jerry_release_value (prop_name);
+
+  return jerry_create_undefined ();
+} /* add_handler */
+
+int
+main (void)
+{
+  /* Initialize engine */
+  jerry_init (JERRY_INIT_EMPTY);
+
+  /* Register 'print' function from the extensions */
+  jerryx_handler_register_global ((const jerry_char_t *) "print",
+                                  jerryx_handler_print);
+
+  /* Create a JS object */
+  const jerry_char_t my_js_object[] = " \
+    MyObject = \
+    { x : 12, \
+      y : 'Value of x is ', \
+      foo: function () \
+      { \
+        return this.y + this.x; \
+      } \
+    } \
+  ";
+
+  jerry_value_t my_js_obj_val;
+
+  /* Evaluate script */
+  my_js_obj_val = jerry_eval (my_js_object,
+                              strlen ((const char *) my_js_object),
+                              false);
+
+  /* Create a JS function object and wrap into a jerry value */
+  jerry_value_t add_func_obj = jerry_create_external_function (add_handler);
+
+  /* Set the native function as a property of previously created MyObject */
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "add2x");
+  jerry_set_property (my_js_obj_val, prop_name, add_func_obj);
+  jerry_release_value (add_func_obj);
+  jerry_release_value (prop_name);
+
+  /* Free JavaScript value, returned by eval (my_js_object) */
+  jerry_release_value (my_js_obj_val);
+
+  const jerry_char_t script[] = " \
+    var str = MyObject.foo (); \
+    print (str); \
+    MyObject.add2x (5); \
+    print (MyObject.foo ()); \
+  ";
+  size_t script_size = strlen ((const char *) script);
+
+  /* Evaluate script */
+  jerry_value_t eval_ret = jerry_eval (script, script_size, false);
+
+  /* Free JavaScript value, returned by eval */
+  jerry_release_value (eval_ret);
+
+  /* Cleanup engine */
+  jerry_cleanup ();
+
+  return 0;
+}
+```
+
+The application will generate the following output:
+
+```bash
+Value of x is 12
+Value of x is 17
+```
+
+## Further steps
+
+For further API description, please visit [API Reference page](https://jerryscript-project.github.io/jerryscript/api-reference/) on [JerryScript home page](https://jerryscript-project.github.io/jerryscript/).
diff --git a/deps/jerry/docs/04.INTERNALS.md b/deps/jerry/docs/04.INTERNALS.md
new file mode 100644 (file)
index 0000000..45d3a26
--- /dev/null
@@ -0,0 +1,332 @@
+# High-Level Design
+![High-Level Design](img/engines_high_level_design.png)
+
+The diagram above shows the interactions between the major components of JerryScript: Parser and Virtual Machine (VM). Parser performs translation of input ECMAScript application into the byte-code with the specified format (refer to [Bytecode](#byte-code) and [Parser](#parser) page for details). Prepared bytecode is executed by the Virtual Machine that performs interpretation (refer to [Virtual Machine](#virtual-machine) and [ECMA](#ecma) pages for details).
+
+# Parser
+
+The parser is implemented as a recursive descent parser. The parser converts the JavaScript source code directly into byte-code without building an Abstract Syntax Tree. The parser depends on the following subcomponents.
+
+## Lexer
+
+The lexer splits input string (ECMAScript program) into sequence of tokens. It is able to scan the input string not only forward, but it is possible to move to an arbitrary position. The token structure described by structure `lexer_token_t` in `./jerry-core/parser/js/js-lexer.h`.
+
+## Scanner
+
+Scanner (`./jerry-core/parser/js/js-parser-scanner.c`) pre-scans the input string to find certain tokens. For example, scanner determines whether the keyword `for` defines a general for or a for-in loop. Reading tokens in a while loop is not enough because a slash (`/`) can indicate the start of a regular expression or can be a division operator.
+
+## Expression Parser
+
+Expression parser is responsible for parsing JavaScript expressions. It is implemented in `./jerry-core/parser/js/js-parser-expr.c`.
+
+## Statement Parser
+
+JavaScript statements are parsed by this component. It uses the [Expression parser](#expression-parser) to parse the constituent expressions. The implementation of Statement parser is located in `./jerry-core/parser/js/js-parser-statm.c`.
+
+Function `parser_parse_source` carries out the parsing and compiling of the input EcmaScript source code. When a function appears in the source `parser_parse_source` calls `parser_parse_function` which is responsible for processing the source code of functions recursively including argument parsing and context handling. After the parsing, function `parser_post_processing` dumps the created opcodes and returns an `ecma_compiled_code_t*` that points to the compiled bytecode sequence.
+
+The interactions between the major components shown on the following figure.
+
+![Parser dependency](img/parser_dependency.png)
+
+# Byte-code
+
+This section describes the compact byte-code (CBC) byte-code representation. The key focus is reducing memory consumption of the byte-code representation without sacrificing considerable performance. Other byte-code representations often focus on performance only so inventing this representation is an original research.
+
+CBC is a CISC like instruction set which assigns shorter instructions for frequent operations. Many instructions represent multiple atomic tasks which reduces the byte code size. This technique is basically a data compression method.
+
+## Compiled Code Format
+
+The memory layout of the compiled byte code is the following.
+
+![CBC layout](img/CBC_layout.png)
+
+The header is a `cbc_compiled_code` structure with several fields. These fields contain the key properties of the compiled code.
+
+The literals part is an array of ecma values. These values can contain any EcmaScript value types, e.g. strings, numbers, function and regexp templates. The number of literals is stored in the `literal_end` field of the header.
+
+CBC instruction list is a sequence of byte code instructions which represents the compiled code.
+
+## Byte-code Format
+
+The memory layout of a byte-code is the following:
+
+![byte-code layout](img/opcode_layout.png)
+
+Each byte-code starts with an opcode. The opcode is one byte long for frequent and two byte long for rare instructions. The first byte of the rare instructions is always zero (`CBC_EXT_OPCODE`), and the second byte represents the extended opcode. The name of common and rare instructions start with `CBC_` and `CBC_EXT_` prefix respectively.
+
+The maximum number of opcodes is 511, since 255 common (zero value excluded) and 256 rare instructions can be defined. Currently around 230 frequent and 120 rare instructions are available.
+
+There are three types of bytecode arguments in CBC:
+
+ * __byte argument__: A value between 0 and 255, which often represents the argument count of call like opcodes (function call, new, eval, etc.).
+
+ * __literal argument__: An integer index which is greater or equal than zero and less than the `literal_end` field of the header. For further information see next section Literals (next).
+
+ * __relative branch__: An 1-3 byte long offset. The branch argument might also represent the end of an instruction range. For example the branch argument of `CBC_EXT_WITH_CREATE_CONTEXT` shows the end of a `with` statement. More precisely the position after the last instruction.
+
+Argument combinations are limited to the following seven forms:
+
+* no arguments
+* a literal argument
+* a byte argument
+* a branch argument
+* a byte and a literal arguments
+* two literal arguments
+* three literal arguments
+
+## Literals
+
+Literals are organized into groups whose represent various literal types. Having these groups consuming less space than assigning flag bits to each literal.
+(In the followings, the mentioned ranges represent those indicies which are greater than or equal to the left side and less than the right side of the range. For example a range between `ident_end` and `literal_end` fields of the byte-code header contains those indicies, which are greater than or equal to `ident_end`
+and less than `literal_end`. If `ident_end` equals to `literal_end` the range is empty.)
+
+The two major group of literals are _identifiers_ and _values_.
+
+  * __identifier__: A named reference to a variable. Literals between zero and `ident_end` of the header belongs to here. All of these literals must be a string or undefined. Undefined can only be used for those literals which cannot be accessed by a literal name. For example `function (arg,arg)` has two arguments, but the `arg` identifier only refers to the second argument. In such cases the name of the first argument is undefined. Furthermore optimizations such as *CSE* may also introduce literals without name.
+
+  * __value__: A reference to an immediate value. Literals between `ident_end` and `const_literal_end` are constant values such as numbers or strings. These literals can be used directly by the Virtual Machine. Literals between `const_literal_end` and `literal_end` are template literals. A new object needs to be constructed each time when their value is accessed. These literals are functions and regular expressions.
+
+There are two other sub-groups of identifiers. *Registers* are those identifiers which are stored in the function call stack. *Arguments* are those registers which are passed by a caller function.
+
+There are two types of literal encoding in CBC. Both are variable length, where the length is one or two byte long.
+
+  * __small__: maximum 511 literals can be encoded.
+
+One byte encoding for literals 0 - 254.
+
+```c
+byte[0] = literal_index
+```
+
+Two byte encoding for literals 255 - 510.
+
+```c
+byte[0] = 0xff
+byte[1] = literal_index - 0xff
+```
+
+  * __full__: maximum 32767 literal can be encoded.
+
+One byte encoding for literals 0 - 127.
+
+```c
+byte[0] = literal_index
+```
+
+Two byte encoding for literals 128 - 32767.
+
+```c
+byte[0] = (literal_index >> 8) | 0x80
+byte[1] = (literal_index & 0xff)
+```
+
+Since most functions require less than 255 literal, small encoding provides a single byte literal index for all literals. Small encoding consumes less space than full encoding, but it has a limited range.
+
+## Literal Store
+
+JerryScript does not have a global string table for literals, but stores them into the Literal Store. During the parsing phase, when a new literal appears with the same identifier that has already occurred before, the string won't be stored once again, but the identifier in the Literal Store will be used. If a new literal is not in the Literal Store yet, it will be inserted.
+
+## Byte-code Categories
+
+Byte-codes can be placed into four main categories.
+
+### Push Byte-codes
+
+Byte-codes of this category serve for placing objects onto the stack. As there are many instructions representing multiple atomic tasks in CBC, there are also many instructions for pushing objects onto the stack according to the number and the type of the arguments. The following table list a few of these opcodes with a brief description.
+
+<span class="CSSTableGenerator" markdown="block">
+
+| byte-code             | description                                          |
+| --------------------- | ---------------------------------------------------- |
+| CBC_PUSH_LITERAL      | Pushes the value of the given literal argument.      |
+| CBC_PUSH_TWO_LITERALS | Pushes the value of the given two literal arguments. |
+| CBC_PUSH_UNDEFINED    | Pushes an undefined value.                           |
+| CBC_PUSH_TRUE         | Pushes a logical true.                               |
+| CBC_PUSH_PROP_LITERAL | Pushes a property whose base object is popped from the stack, and the property name is passed as a literal argument. |
+
+</span>
+
+### Call Byte-codes
+
+The byte-codes of this category perform calls in different ways.
+
+<span class="CSSTableGenerator" markdown="block">
+
+| byte-code             | description                                                                          |
+| --------------------- | ------------------------------------------------------------------------------------ |
+| CBC_CALL0             | Calls a function without arguments. The return value won't be pushed onto the stack. |
+| CBC_CALL1             | Calls a function with one argument. The return value won't be pushed onto the stack. |
+| CBC_CALL              | Calls a function with n arguments. n is passed as a byte argument. The return value won't be pushed onto the stack. |
+| CBC_CALL0_PUSH_RESULT | Calls a function without arguments. The return value will be pushed onto the stack.  |
+| CBC_CALL1_PUSH_RESULT | Calls a function with one argument. The return value will be pushed onto the stack.  |
+| CBC_CALL2_PROP        | Calls a property function with two arguments. The base object, the property name, and the two arguments are on the stack. |
+
+</span>
+
+### Arithmetic, Logical, Bitwise and Assignment Byte-codes
+
+The opcodes of this category perform arithmetic, logical, bitwise and assignment operations.
+
+<span class="CSSTableGenerator" markdown="block">
+
+| byte-code               | description                                                                                         |
+| ----------------------- | --------------------------------------------------------------------------------------------------- |
+| CBC_LOGICAL_NOT         | Negates the logical value that popped from the stack. The result is pushed onto the stack.          |
+| CBC_LOGICAL_NOT_LITERAL | Negates the logical value that given in literal argument. The result is pushed onto the stack.      |
+| CBC_ADD                 | Adds two values that are popped from the stack. The result is pushed onto the stack.                |
+| CBC_ADD_RIGHT_LITERAL   | Adds two values. The left one popped from the stack, the right one is given as literal argument.    |
+| CBC_ADD_TWO_LITERALS    | Adds two values. Both are given as literal arguments.                                               |
+| CBC_ASSIGN              | Assigns a value to a property. It has three arguments: base object, property name, value to assign. |
+| CBC_ASSIGN_PUSH_RESULT  | Assigns a value to a property. It has three arguments: base object, property name, value to assign. The result will be pushed onto the stack. |
+
+</span>
+
+### Branch Byte-codes
+
+Branch byte-codes are used to perform conditional and unconditional jumps in the byte-code. The arguments of these instructions are 1-3 byte long relative offsets. The number of bytes is part of the opcode, so each byte-code with a branch argument has three forms. The direction (forward, backward) is also defined by the opcode since the offset is an unsigned value. Thus, certain branch instructions has six forms. Some examples can be found in the following table.
+
+<span class="CSSTableGenerator" markdown="block">
+
+| byte-code                  | description                                                 |
+| -------------------------- | ----------------------------------------------------------- |
+| CBC_JUMP_FORWARD           | Jumps forward by the 1 byte long relative offset argument.  |
+| CBC_JUMP_FORWARD_2         | Jumps forward by the 2 byte long relative offset argument.  |
+| CBC_JUMP_FORWARD_3         | Jumps forward by the 3 byte long relative offset argument.  |
+| CBC_JUMP_BACKWARD          | Jumps backward by the 1 byte long relative offset argument. |
+| CBC_JUMP_BACKWARD_2        | Jumps backward by the 2 byte long relative offset argument. |
+| CBC_JUMP_BACKWARD_3        | Jumps backward by the 3 byte long relative offset argument. |
+| CBC_BRANCH_IF_TRUE_FORWARD | Jumps if the value on the top of the stack is true by the 1 byte long relative offset argument. |
+
+</span>
+
+## Snapshot
+
+The compiled byte-code can be saved into a snapshot, which also can be loaded back for execution. Directly executing the snapshot saves the costs of parsing the source in terms of memory consumption and performance. The snapshot can also be executed from ROM, in which case the overhead of loading it into the memory can also be saved.
+
+
+# Virtual Machine
+
+Virtual machine is an interpreter which executes byte-code instructions one by one. The function that starts the interpretation is `vm_run` in `./jerry-core/vm/vm.c`. `vm_loop` is the main loop of the virtual machine, which has the peculiarity that it is *non-recursive*. This means that in case of function calls it does not calls itself recursively but returns, which has the benefit that it does not burdens the stack as a recursive implementation.
+
+# ECMA
+
+ECMA component of the engine is responsible for the following notions:
+
+* Data representation
+* Runtime representation
+* Garbage collection (GC)
+
+## Data Representation
+
+The major structure for data representation is `ECMA_value`. The lower two bits of this structure encode value tag, which determines the type of the value:
+
+* simple
+* number
+* string
+* object
+
+![ECMA value representation](img/ecma_value.png)
+
+In case of number, string and object the value contains an encoded pointer, and
+simple value is a pre-defined constant which can be:
+
+* undefined
+* null
+* true
+* false
+* empty (uninitialized value)
+
+### Compressed Pointers
+
+Compressed pointers were introduced to save heap space.
+
+![Compressed Pointer](img/ecma_compressed.png)
+
+These pointers are 8 byte aligned 16 bit long pointers which can address 512 Kb of
+memory which is also the maximum size of the JerryScript heap. To support even more
+memory the size of compressed pointers can be extended to 32 bit to cover the entire
+address space of a 32 bit system by passing "--cpointer_32_bit on" to the build
+system. These "uncompressed pointers" increases the memory consumption by around 20%.
+
+### Number
+
+There are two possible representation of numbers according to standard IEEE 754:
+The default is 8-byte (double),
+but the engine supports the 4-byte (single precision) representation by setting CONFIG_ECMA_NUMBER_TYPE as well.
+
+![Number](img/number.png)
+
+Several references to single allocated number are not supported. Each reference holds its own copy of a number.
+
+### String
+
+Strings in JerryScript are not just character sequences, but can hold numbers and so-called magic ids too. For common character sequences (defined in `./jerry-core/lit/lit-magic-strings.ini`) there is a table in the read only memory that contains magic id and character sequence pairs. If a string is already in this table, the magic id of its string is stored, not the character sequence itself. Using numbers speeds up the property access. These techniques save memory.
+
+### Object / Lexical Environment
+
+An object can be a conventional data object or a lexical environment object. Unlike other data types, object can have references (called properties) to other data types. Because of circular references, reference counting is not always enough to determine dead objects. Hence a chain list is formed from all existing objects, which can be used to find unreferenced objects during garbage collection. The `gc-next` pointer of each object shows the next allocated object in the chain list.
+
+[Lexical environments](http://www.ecma-international.org/ecma-262/5.1/#sec-10.2) are implemented as objects in JerryScript, since lexical environments contains key-value pairs (called bindings) like objects. This simplifies the implementation and reduces code size.
+
+![Object/Lexicat environment structures](img/ecma_object.png)
+
+The objects are represented as following structure:
+
+  * Reference counter - number of hard (non-property) references
+  * Next object pointer for the garbage collector
+  * GC's visited flag
+  * type (function object, lexical environment, etc.)
+
+### Properties of Objects
+
+![Object properties](img/ecma_object_property.png)
+
+Objects have a linked list that contains their properties. This list actually contains property pairs, in order to save memory described in the followings:
+A property is 7 bit long and its type field is 2 bit long which consumes 9 bit which does not fit into 1 byte but consumes 2 bytes. Hence, placing together two properties (14 bit) with the 2 bit long type field fits into 2 bytes.
+
+#### Property Hashmap
+
+If the number of property pairs reach a limit (currently this limit is defined to 16), a hash map (called [Property Hashmap](#property-hashmap)) is inserted at the first position of the property pair list, in order to find a property using it, instead of finding it by iterating linearly over the property pairs.
+
+Property hashmap contains 2<sup>n</sup> elements, where 2<sup>n</sup> is larger than the number of properties of the object. Each element can have tree types of value:
+
+* null, indicating an empty element
+* deleted, indicating a deleted property, or
+* reference to the existing property
+
+This hashmap is a must-return type cache, meaning that every property that the object have, can be found using it.
+
+#### Internal Properties
+
+Internal properties are special properties that carry meta-information that cannot be accessed by the JavaScript code, but important for the engine itself. Some examples of internal properties are listed below:
+
+* [[Class]] - class (type) of the object (ECMA-defined)
+* [[Code]] - points where to find bytecode of the function
+* native code - points where to find the code of a native function
+* [[PrimitiveValue]] for Boolean - stores the boolean value of a Boolean object
+* [[PrimitiveValue]] for Number - stores the numeric value of a Number object
+
+### LCache
+
+LCache is a hashmap for finding a property specified by an object and by a property name. The object-name-property layout of the LCache presents multiple times in a row as it is shown in the figure below.
+
+![LCache](img/ecma_lcache.png)
+
+When a property access occurs, a hash value is extracted from the demanded property name and than this hash is used to index the LCache. After that, in the indexed row the specified object and property name will be searched.
+
+It is important to note, that if the specified property is not found in the LCache, it does not mean that it does not exist (i.e. LCache is a may-return cache). If the property is not found, it will be searched in the property-list of the object, and if it is found there, the property will be placed into the LCache.
+
+### Collections
+
+Collections are array-like data structures, which are optimized to save memory. Actually, a collection is a linked list whose elements are not single elements, but arrays which can contain multiple elements.
+
+### Exception Handling
+
+In order to implement a sense of exception handling, the return values of JerryScript functions are able to indicate their faulty or "exceptional" operation. The return values are actually ECMA values (see section [Data Representation](#data-representation)) in which the error bit is set if an erroneous operation is occurred.
+
+### Value Management and Ownership
+
+Every ECMA value stored by the engine is associated with a virtual "ownership", that defines how to manage the value: when to free it when it is not needed anymore and how to pass the value to an other function.
+
+Initially, value is allocated by its owner (i.e. with ownership). The owner has the responsibility for freeing the allocated value. When the value is passed to a function as an argument, the ownership of it will not pass, the called function have to make an own copy of the value. However, as long as a function returns a value, the ownership will pass, thus the caller will be responsible for freeing it.
diff --git a/deps/jerry/docs/05.PORT-API.md b/deps/jerry/docs/05.PORT-API.md
new file mode 100644 (file)
index 0000000..f358197
--- /dev/null
@@ -0,0 +1,233 @@
+# Reference
+
+## Termination
+
+It is questionable whether a library should be able to terminate an application. Any API function can signal an error (ex.: cannot allocate memory), so the engine use the termination approach with this port function.
+
+```c
+/**
+ * Signal the port that jerry experienced a fatal failure from which it cannot
+ * recover.
+ *
+ * @param code gives the cause of the error.
+ *
+ * Note: jerry expects the function not to return.
+ *
+ * Example: a libc-based port may implement this with exit() or abort(), or both.
+ */
+void jerry_port_fatal (jerry_fatal_code_t code);
+```
+
+Error codes
+
+```c
+typedef enum
+{
+  ERR_OUT_OF_MEMORY = 10,
+  ERR_SYSCALL = 11,
+  ERR_REF_COUNT_LIMIT = 12,
+  ERR_FAILED_INTERNAL_ASSERTION = 120
+} jerry_fatal_code_t;
+```
+
+## I/O
+
+These are the only I/O functions jerry calls.
+
+```c
+/**
+ * Jerry log levels. The levels are in severity order
+ * where the most serious levels come first.
+ */
+typedef enum
+{
+  JERRY_LOG_LEVEL_ERROR,    /**< the engine will terminate after the message is printed */
+  JERRY_LOG_LEVEL_WARNING,  /**< a request is aborted, but the engine continues its operation */
+  JERRY_LOG_LEVEL_DEBUG,    /**< debug messages from the engine, low volume */
+  JERRY_LOG_LEVEL_TRACE     /**< detailed info about engine internals, potentially high volume */
+} jerry_log_level_t;
+
+/**
+ * Display or log a debug/error message. The function should implement a printf-like
+ * interface, where the first argument specifies the log level
+ * and the second argument specifies a format string on how to stringify the rest
+ * of the parameter list.
+ *
+ * This function is only called with messages coming from the jerry engine as
+ * the result of some abnormal operation or describing its internal operations
+ * (e.g., data structure dumps or tracing info).
+ *
+ * It should be the port that decides whether error and debug messages are logged to
+ * the console, or saved to a database or to a file.
+ *
+ * Example: a libc-based port may implement this with vfprintf(stderr) or
+ * vfprintf(logfile), or both, depending on log level.
+ */
+void jerry_port_log (jerry_log_level_t level, const char *fmt, ...);
+```
+
+## Date
+
+```c
+/**
+ * Jerry time zone structure
+ */
+typedef struct
+{
+  int offset;                /**< minutes from west */
+  int daylight_saving_time;  /**< daylight saving time (1 - DST applies, 0 - not on DST) */
+} jerry_time_zone_t;
+
+/**
+ * Get timezone and daylight saving data
+ *
+ * @return true  - if success
+ *         false - otherwise
+ */
+bool jerry_port_get_time_zone (jerry_time_zone_t *);
+
+/**
+ * Get system time
+ *
+ * @return milliseconds since Unix epoch
+ */
+double jerry_port_get_current_time (void);
+```
+
+## External instance
+
+Allow user to provide external buffer for jerry instance (which includes an isolated context and heap with other instances), so that user can config the heap size in runtime and run multiple JS apps simultaneously.
+
+```c
+/**
+ * Get the current instance, which contains the current context, heap and other infomation.
+ * Each port should provide its own implementation of this interface.
+ *
+ *Note:
+ *    This port function will be called automatically by jerry-core
+ *    wnen JERRY_ENABLE_EXTERNAL_CONTEXT is defined. If not, this function will never be called.
+ *
+ * @return the pointer to the jerry instance.
+ */
+struct jerry_instance_t *jerry_port_get_current_instance (void);
+```
+
+# How to port JerryScript
+
+This section describes a basic port implementation which was created for Unix based systems.
+
+## Termination
+
+```c
+#include <stdlib.h>
+#include "jerryscript-port.h"
+
+/**
+ * Default implementation of jerry_port_fatal.
+ */
+void jerry_port_fatal (jerry_fatal_code_t code)
+{
+  exit (code);
+} /* jerry_port_fatal */
+```
+
+## I/O
+
+```c
+#include <stdarg.h>
+#include "jerryscript-port.h"
+
+/**
+ * Provide log message implementation for the engine.
+ *
+ * Note:
+ *      This example ignores the log level.
+ */
+void
+jerry_port_log (jerry_log_level_t level, /**< log level */
+                const char *format, /**< format string */
+                ...)  /**< parameters */
+{
+  va_list args;
+  va_start (args, format);
+  vfprintf (stderr, format, args);
+  va_end (args);
+} /* jerry_port_log */
+```
+
+## Date
+
+```c
+#include <sys/time.h>
+#include "jerryscript-port.h"
+
+/**
+ * Default implementation of jerry_port_get_time_zone.
+ */
+bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
+{
+  struct timeval tv;
+  struct timezone tz;
+
+  /* gettimeofday may not fill tz, so zero-initializing */
+  tz.tz_minuteswest = 0;
+  tz.tz_dsttime = 0;
+
+  if (gettimeofday (&tv, &tz) != 0)
+  {
+    return false;
+  }
+
+  tz_p->offset = tz.tz_minuteswest;
+  tz_p->daylight_saving_time = tz.tz_dsttime > 0 ? 1 : 0;
+
+  return true;
+} /* jerry_port_get_time_zone */
+
+/**
+ * Default implementation of jerry_port_get_current_time.
+ */
+double jerry_port_get_current_time (void)
+{
+  struct timeval tv;
+
+  if (gettimeofday (&tv, NULL) != 0)
+  {
+    return 0;
+  }
+
+  return ((double) tv.tv_sec) * 1000.0 + ((double) tv.tv_usec) / 1000.0;
+} /* jerry_port_get_current_time */
+```
+## External instance
+
+```c
+#include "jerryscript-port.h"
+#include "jerryscript-port-default.h"
+
+/**
+ * Pointer to the current instance.
+ * Note that it is a global variable, and is not a thread safe implementation.
+ */
+static jerry_instance_t *current_instance_p = NULL;
+
+/**
+ * Set the current_instance_p as the passed pointer.
+ */
+void
+jerry_port_default_set_instance (jerry_instance_t *instance_p) /**< points to the created instance */
+{
+  current_instance_p = instance_p;
+} /* jerry_port_default_set_instance */
+
+/**
+ * Get the current instance.
+ *
+ * @return the pointer to the current instance
+ */
+jerry_instance_t *
+jerry_port_get_current_instance (void)
+{
+  return current_instance_p;
+} /* jerry_port_get_current_instance */
+```
\ No newline at end of file
diff --git a/deps/jerry/docs/06.REFERENCE-COUNTING.md b/deps/jerry/docs/06.REFERENCE-COUNTING.md
new file mode 100644 (file)
index 0000000..5758adc
--- /dev/null
@@ -0,0 +1,176 @@
+## Reference counting in JerryScript
+
+In JerryScript all `jerry_value_t` values are independent
+references to internal objects. Values returned by JerryScript
+API functions are always live references and must be released
+by `jerry_release_value`.
+
+```c
+  jerry_value_t global = jerry_get_global_object ();
+
+  /* The value stored in the 'global' variable contains a live
+   * reference to the global object. The system also keeps its
+   * own live reference to the global object. These two references
+   * are independent, and both must be destroyed before the global
+   * object can be freed. */
+
+  jerry_release_value (global);
+
+  /* Without jerry_release_value() the global object will not
+   * be freed even by jerry_cleanup(). After the reference
+   * is released it becomes a dead reference and cannot be
+   * used anymore. */
+```
+
+Multiple references might refer to the same internal object
+even though their `jerry_value_t` representation might be different.
+
+```c
+  jerry_value_t pi_ref1 = jerry_create_number (3.14);
+  jerry_value_t pi_ref2 = jerry_acquire_value (pi_ref1);
+
+  /* Both pi_ref1 and pi_ref2 refer to the same 3.14 value
+   * although they might not be equal in C (pi_ref1 != pi_ref2). */
+
+  /* Both references must be released. */
+  jerry_release_value (pi_ref1);
+  jerry_release_value (pi_ref2);
+```
+
+Releasing the same `jerry_value_t` twice to release two live
+references is not allowed and it might cause crashes. Hence the
+following code is an **INCORRECT WAY** of releasing the 3.14 value.
+
+```c
+  jerry_release_value (pi_ref1);
+  jerry_release_value (pi_ref1);
+```
+
+JerryScript API functions returning with a `jerry_value_t` always
+return with a new live reference. Passing a `jerry_value_t` to
+an API function never releases its reference (unless explicitly
+stated in the documentation). The next example shows this
+behaviour through property getting and setting.
+
+```c
+  jerry_value_t prop_value = jerry_get_property (...);
+
+  /* The prop_value must be released later because both the base
+   * object and the prop_value have an independent reference to
+   * the same JavaScript value. When the operation fails, the
+   * prop_value contains a live reference to an error object.
+   * This reference must be released as well. */
+
+  if (jerry_value_has_error_flag (prop_value))
+  {
+    /* Errors can be handled here. */
+  }
+  else
+  {
+    /* The application has a live reference to the property
+     * value even if the base object is freed by the garbage
+     * collector. */
+  }
+
+  /* The prop_value must be released. */
+  jerry_release_value (prop_value);
+
+  /* Property setting is the same. */
+
+  jerry_value_t new_prop_value = jerry_create_number (2.718);
+  jerry_value_t result = jerry_set_property (..., new_prop_value);
+
+  /* If the property set is successful, a new reference is created
+   * for the value referenced by new_prop_value. The new_prop_value
+   * reference must be released regardless of whether the operation
+   * is successful. */
+
+  /* The new_prop_value can be passed to other JerryScript API
+   * functions before the jerry_release_value () call. */
+
+  jerry_release_value (new_prop_value);
+
+  /* The reference stored in the 'result' variable is live whether
+   * the operation is successful or not, and must also be freed. */
+
+  if (jerry_value_has_error_flag (result))
+  {
+    /* Errors can be handled here. */
+  }
+  else
+  {
+    /* A reference to a true primitive value is returned. */
+  }
+
+  jerry_release_value (result);
+```
+
+The simplest form of setting a property without error checking
+is the following:
+
+```c
+  /* There are no 'ifs' in this snippet. */
+  jerry_release_value (jerry_set_property (..., new_prop_value));
+  jerry_release_value (new_prop_value);
+```
+
+The reference returned by a `jerry_external_handler_t` callback
+transfers the ownership of the live reference. Otherwise the
+referenced object could be freed by the garbage collector.
+
+```c
+jerry_value_t my_external_handler (const jerry_value_t function_obj,
+                                   const jerry_value_t this_val,
+                                   const jerry_value_t args_p[],
+                                   const jerry_length_t args_count
+{
+  /* Do not release function_obj, this_val, and args_p because
+   * these references are automatically released after the handler
+   * is returned. This approach reduces code size which is useful
+   * on embedded systems. However you can create other references
+   * to them by calling jerry_acquire_value () if needed. */
+
+  /* Since the ownership of the reference is transferred to the
+   * caller the following snippet is valid. */
+
+  /* If the value to be returned is needed for other purposes the
+   * jerry_acquire_value () can be used to create new references. */
+  return jerry_create_string (...);
+}
+```
+
+Duplicating a `jerry_value_t` in C does not create another live reference.
+
+```c
+  jerry_value_t undef = jerry_create_undefined ();
+  jerry_value_t undef2 = undef;
+
+  /* Releasing either undef or undef2 is valid but not both.
+   * After the release both references become dead (invalid). */
+  jerry_release_value (undef2);
+
+  /* Dead references can be reassigned again. */
+  undef = jerry_create_boolean (true);
+```
+
+References can be duplicated in C as long as only one of them is freed.
+
+```c
+  jerry_value_t a = jerry_create_boolean (true);
+
+  jerry_value_t b = a;
+  jerry_value_t c = a;
+
+  /* A new reference is assigned to 'a'. */
+  a = jerry_create_boolean (false);
+
+  [...]
+
+  jerry_release_value (a);
+  /* The 'a' (boolean false) reference becomes dead (invalid). */
+
+  jerry_release_value (c);
+  /* Both 'b' and 'c' (boolean true) references become dead. */
+
+  /* Since all references are released, no memory leak occurs. */
+```
diff --git a/deps/jerry/docs/07.DEBUGGER.md b/deps/jerry/docs/07.DEBUGGER.md
new file mode 100644 (file)
index 0000000..99ab673
--- /dev/null
@@ -0,0 +1,196 @@
+## JerryScript debugger interface
+
+JerryScript provides a remote debugger which allows debugging
+JavaScript programs. The debugger has two main components:
+a server which is part of the JerryScript binary and a
+separate client application. Currently two debugger clients
+are available in the /jerry-debugger subdirectory: an HTML
+and a Python application. These simple applications demonstrate
+the communication protocol between the client and server and can
+be reused by integrated development environments.
+
+## Setting up the debugger server
+
+The following arguments must be passed to `tools/build.py`:
+
+`--jerry-debugger=on --jerry-libc=off`
+
+At the moment only a Websocket-based implementation is provided
+by JerryScript which transmits messages over TCP/IP networks.
+This implementation requires a socket API which is not yet
+supported by jerry-libc so the standard libc is used instead.
+In the future any reliable stream or datagram based protocol
+can be used for transmitting debugger messages.
+
+## Debugging JavaScript applications
+
+The debugger client must be connected to the server before the
+JavaScript application runs. On-the-fly attachment is not supported
+because the debugging information (e.g. line index of each possible
+breakpoint location) is not preserved by JerryScript. The client is
+expected to be run on a system with much more resources and it should
+be capable of storing this information. JerryScript frees all debug
+information after it is transmitted to the client to save memory.
+
+The following argument makes JerryScript wait for a client
+connection:
+
+`--start-debug-server`
+
+It is also recommended to increase the log level to see
+the *Waiting for client connection* message:
+
+`--log-level 2`
+
+The HTML client can connect to the IP address of the server with
+the `connect` command. The IP address can be localhost
+if the server and the client are running on the same machine.
+
+After the connection is established the execution can be
+controlled by the debugger. The debugger always stops at
+the first possible breakpoint location. The effect is the
+same as using the `stop` command. This allows inserting
+breakpoints right before the meaningful part of the execution
+starts.
+
+All available commands of the client can be queried by the
+`help` command.
+
+## Integrating debugger support into applications using JerryScript
+
+The debugger can be enabled by passing the `JERRY_INIT_DEBUGGER` flag
+to the `jerry_init ()` function which then initializes the debugger
+and blocks until a client connects.
+
+When the debugger is enabled it is recommended to use
+`jerry_parse_named_resource ()` instead of `jerry_parse ()` because
+the resource name (usually a file name) is also passed to this
+function. This resource name is used by the client to identify
+the corresponding resource. In general it is always recommended to
+use `jerry_parse_named_resource ()` when the resource name is
+available because it silently ignores the resource name if the
+debugger is disabled.
+
+## JerryScript debugger C-API interface
+
+The following section describes the debugger functions
+available for the host application.
+
+### jerry_debugger_is_connected
+
+**Summary**
+
+Returns true if a remote debugger client is connected.
+
+**Prototype**
+
+```c
+bool
+jerry_debugger_is_connected (void);
+```
+
+**Example**
+
+```c
+{
+  jerry_init (JERRY_INIT_DEBUGGER);
+
+  if (jerry_debugger_is_connected ())
+  {
+    printf ("A remote debugger client is connected.");
+  }
+}
+```
+
+### jerry_debugger_stop
+
+**Summary**
+
+Stops execution at the next available breakpoint if a remote
+debugger client is connected and the engine is not waiting at
+a breakpoint. The engine will stop regardless the breakpoint
+is enabled or not.
+
+**Prototype**
+
+```c
+void
+jerry_debugger_stop (void)
+```
+
+**Example**
+
+```c
+{
+  jerry_init (JERRY_INIT_DEBUGGER);
+
+  jerry_debugger_stop ();
+}
+```
+
+**See also**
+
+- [jerry_debugger_continue](#jerry_debugger_continue)
+
+### jerry_debugger_continue
+
+**Summary**
+
+If the engine would stop at the next available breakpoint it
+cancels this effect. The engine will still stop at enabled
+breakpoints. This function effectively negates the effect of
+[jerry_debugger_stop ()](#jerry_debugger_stop) calls or stop
+requests issued by the debugger client.
+
+**Prototype**
+
+```c
+void
+jerry_debugger_continue (void)
+```
+
+**Example**
+
+```c
+{
+  jerry_init (JERRY_INIT_DEBUGGER);
+
+  jerry_debugger_continue ();
+}
+```
+
+**See also**
+
+- [jerry_debugger_stop](#jerry_debugger_stop)
+
+### jerry_debugger_disable_stop_at_breakpoint
+
+**Summary**
+
+Enables or disables stopping at breakpoints. When stopping is
+disabled all breakpoints are ignored including user enabled
+breakpoints. This allows hidden execution of ECMAScript code.
+
+**Prototype**
+
+```c
+void
+jerry_debugger_stop_at_breakpoint (bool enable_stop_at_breakpoint)
+```
+
+- `enable_stop_at_breakpoint` - enable (=`true`) or disable (=`false`) stopping at breakpoints
+
+**Example**
+
+```c
+{
+  jerry_init (JERRY_INIT_DEBUGGER);
+
+  jerry_debugger_stop_at_breakpoint (true);
+
+  // Protected execution of JavaScript code.
+  jerry_eval (...);
+
+  jerry_debugger_stop_at_breakpoint (false);
+}
+```
diff --git a/deps/jerry/docs/08.CODING-STANDARDS.md b/deps/jerry/docs/08.CODING-STANDARDS.md
new file mode 100644 (file)
index 0000000..46fa983
--- /dev/null
@@ -0,0 +1,797 @@
+# JerryScript Coding Standards
+
+This text is a brief overview of JerryScript Coding Standards.
+Each rule starts with a short description followed by several
+examples. We believe examples are better than long explanations.
+Please follow these guidelines when you submit a patch for
+review.
+
+## General rules
+
+* Indentation is two spaces.
+* Tab characters are not allowed.
+* Maximum line length is 120 characters (excluding newline).
+* No trailing white space is allowed.
+* Run `tools/run-tests.py --check-vera` to check several
+  of the coding conventions automatically.
+
+## Comments
+
+Only block comments (`/* */`) are allowed in JerryScript.
+Comments should be complete sentences (e.g. start with an
+upper case letter), except for return value, field and
+argument descriptions (see the exceptions below). The
+text part of a comment should focus on explaining *why*
+the code is doing something rather than *what* the code
+is doing.
+
+```diff
++++ Good +++
+```
+
+```c
+  /* A perfect comment. */
+
+  /* A perfect multiline
+   * comment. Each line should
+   * start with an asterisk. */
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+  // Double slash comments are not allowed.
+
+  /* not a complete sentence */
+
+  /* A bad mulitiline
+     comment. */
+```
+
+All types, constants and functions require a description in
+JerryScript. These comments should start with `/**`. The starting
+`/**` and ending `*/` must be on separate lines.
+
+```diff
++++ Good +++
+```
+
+```c
+/**
+ * A correct description.
+ */
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+/** An incorrect description. */
+```
+
+## Preprocessor defines
+
+The name of a preprocessor macro must be an uppercase string
+and these macros must be preceded by a description.
+Abbreviations are allowed but not preferred in new code.
+
+```diff
++++ Good +++
+```
+
+```c
+/**
+ * Short description about the constant.
+ */
+#define JERRY_VALUE_SEVEN 7
+
+/**
+ * Short description about the macro function.
+ */
+#define JERRY_ADD_TWO_NUMBERS(arg1, arg2) \
+  ((arg1) + (arg2))
+
+/**
+ * Although this is correct, a reviewer might request
+ * to change NUMS to NUMBERS. Hence it is recommended
+ * to use NUMBERS in the first place.
+ */
+#define JERRY_ADD_TWO_NUMS(arg1, arg2) \
+  ((arg1) + (arg2))
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+#define JERRY_CONSTANT_WITHOUT_DESCRIPTION 5
+
+#define JeRrY_mIxEd_CaSe_NaMe "str"
+```
+
+## Conditional preprocessor directives
+
+A comment is required after `#else` and `#endif` in JerryScript.
+The defined keyword should be omitted from these comments.
+
+```diff
++++ Good +++
+```
+
+```c
+#ifdef JERRY_A
+
+#else /* !JERRY_A */
+
+#endif /* JERRY_A */
+
+#ifdef JERRY_A
+#if defined JERRY_B && defined JERRY_C && (JERRY_C > 6)
+
+#else /* !(JERRY_B && JERRY_C && (JERRY_C > 6)) */
+
+#endif /* JERRY_B && JERRY_C && (JERRY_C > 6) */
+#endif /* JERRY_A */
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+#ifdef JERRY_A
+
+#endif
+
+#ifdef JERRY_A
+
+#endif /* defined JERRY_A */
+
+#ifdef JERRY_B
+  /* Missing comment after else. */
+#else
+
+#endif /* JERRY_B */
+```
+
+## Code blocks
+
+Each code block must be enclosed in curly braces even
+if it is a single line statement. These braces must
+be on separate lines. There must be a single space
+before the opening parenthesis of the expression
+after if/while/switch keywords.
+
+```diff
++++ Good +++
+```
+
+```c
+if (value > 6)
+{
+  function_call ();
+}
+
+if (value > 1)
+{
+  function_call_a ();
+}
+else
+{
+  function_call_b ();
+}
+
+do
+{
+  function_call ();
+  value++;
+}
+while (value < 6);
+
+switch (value)
+{
+  case A:
+  {
+    /* FALLTHRU comment is allowed if a
+     * switch-case is not terminated by
+     * break/continue/return. */
+
+    /* FALLTHRU */
+  }
+  case B:
+  case C:
+  {
+    break;
+  }
+  case D:
+  {
+    /* We can use continue if we are in a loop. */
+    continue;
+  }
+  default:
+  {
+    return;
+  }
+}
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+if (value > 6)
+  function_call_a ();
+else
+  function_call_b ();
+
+if (value > 6) {
+  function_call_a ();
+}
+
+if (value > 6) function_call_a ();
+else { function_call_b (); }
+
+if
+(value > 6)
+{
+}
+
+switch (value) {
+  case 0: break;
+  default: {
+    return 5;
+  }
+}
+
+switch (value)
+{
+  case A:
+  {
+    if (value > 6)
+    {
+      CASE B:
+      {
+        /* This is allowed in C but
+         * not in JerryScript. */
+        break;
+      }
+    }
+  }
+}
+
+do
+  value++;
+while (value < 5);
+
+do {
+  value++;
+} while (value < 5);
+
+do
+{
+  value++;
+} while (value < 5);
+```
+
+## Newlines
+
+A newline in JerryScript is a separator which separates different
+parts of the source code. Its primary purpose is to improve
+readability. Unlike other rules developers have some freedom
+to add newlines to their code. However there are some rules.
+
+* Only a single newline separator is allowed.
+* Source files must be terminated by a newline.
+* Global declarations must be separated by a newline.
+* Newlines are not allowed after an opening curly brace or before
+  a closing curly brace
+* No newlines are allowed between control statements (if-else, while,
+  for, switch, etc.) and their code blocks.
+* There should be a newline after the variable declarations
+  if they are the first statements of a block.
+
+```diff
++++ Good +++
+```
+
+```c
+if (a > 5)
+{
+  /* Newline must be present after the first
+   * variable declarations of a code block. */
+  int j = a - 1;
+  int k = a * 2;
+
+  return j + k;
+}
+
+while (a < 5)
+{
+  a++;
+
+  /* It is recommended to put a newline after
+   * intermediate variable declarations. */
+  int i = a * 2;
+
+  b = i - 3;
+}
+
+/* It is a recommended to put newlines around asserts. */
+a = b + 5;
+
+JERRY_ASSERT (a < 20);
+
+c = a + 7;
+
+/* It is a good practice to put a newline after a multiline
+ * function call (see Function calls later). */
+f (a,
+   b,
+   c);
+
+a = 6;
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+/* No newlines are allowed after an opening curly
+ * brace or before a closing curly brace */
+
+while (a > 0)
+{
+
+  a = 6;
+
+}
+
+if (a > 5)
+{
+  while (b < 6)
+  {
+
+    b++;
+  }
+
+}
+
+
+/* Two or more newlines are not allowed. */
+a = 6;
+
+
+b = 7;
+
+/* No newlines are allowed between control staments
+ * and their code blocks. */
+
+if (a > 6)
+
+{
+}
+
+else
+
+{
+}
+
+do
+
+{
+}
+
+while (a < 6);
+```
+
+## Expressions
+
+Spaces are required around binary operators. No space is
+needed otherwise.
+
+```diff
++++ Good +++
+```
+
+```c
+a = b + c;
+a = (b + c) << 3;
+a = b = c + ~d;
+a += ++c + d++;
+call_function (a * (b + !!c) - d + (e % f));
+if (a)
+{
+}
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+a=b+c;
+a = b+c;
+a  +=  c  +  ( d );
+/* Introduce temporary variables or macros
+ * if the expression is too long. Occures rarely.. */
+a = b
+  + c;
+if ( a + b > 0 )
+{
+}
+```
+
+## Logical operators
+
+All expressions with && and || logical operators must be
+enclosed in parentheses. A single and multiline form is
+allowed for these expressions. In the latter case each
+line must start with the logical operator and each line
+must be aligned to the column right after the opening
+parenthesis.
+
+```diff
++++ Good +++
+```
+
+```c
+/* Single line form. */
+a = ((c && d) || (e && f));
+
+a = (c
+     && d);
+
+a = (c
+     && (d || e)
+     && f);
+
+do
+{
+}
+while (a
+       && b);
+
+/* This form is rarely used but it is ok. */
+if (a
+    && (b
+        || c
+        || d)
+    && e)
+{
+}
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+if (a || b ||
+    c)
+{
+}
+
+/* Parentheses are missing. */
+a = b || c;
+
+/* Misaligned &&. */
+if (a
+  && b)
+{
+}
+```
+
+## Ternary conditional operators
+
+A special form of ternary conditional operators are allowed
+in JerryScript where the ? and : operators are on separate
+lines in the same column.
+
+```diff
++++ Good +++
+```
+
+```c
+a = (b ? c
+       : d);
+
+/* Single line form is accepted as well. */
+a = (b ? c : d);
+
+/* This form is rarely used but it is ok. */
+if (a ? b
+      : (c ? d
+           : e))
+{
+}
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+a = b ?
+    c : d;
+
+while (a ? b
+       : c)
+{
+}
+
+if (a
+    ? b
+    : c)
+{
+}
+```
+
+## Function calls
+
+There must be a space after the function name. Each argument
+must be in the same or separated lines. In the former case
+there must be a space before the next argument and in the
+latter case all arguments must be aligned to the same column.
+
+```diff
++++ Good +++
+```
+
+```c
+function_a ();
+function_b (a);
+function_c (a, b, c);
+
+function_c (a,
+            b,
+            c);
+
+function_c (a,
+            b,
+            function_c (a,
+                        b,
+                        c);
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+/* No space before the opening parenthesis. */
+function_f();
+
+function_f (
+);
+
+function_g(a);
+
+function_g
+  (a
+  );
+
+/* Two arguments on the same line. */
+function_h (a, b,
+            c);
+
+function_h (a,
+            b, c);
+
+/* Misaligned arguments. */
+function_h (a,
+     b,
+     c);
+```
+
+## Variable declarations
+
+JerryScript is a pure C99 codebase so variable
+declarations can be anywhere in the code including
+inside for-loops. It is recommended to declare a
+variable before the first use.
+
+```diff
++++ Good +++
+```
+
+```c
+for (int i = 0; i < 10; i++)
+{
+  int j = i + 1;
+  while (j < 10)
+  {
+    ++j;
+  }
+}
+
+/* Multiline form of for loops. */
+for (int i = 0;
+     i < 10;
+     i++)
+{
+}
+```
+
+## Type casting
+
+There must be a space after the closing parenthesis
+of the type cast. Type casting has no multiline form
+in JerryScript.
+
+```diff
++++ Good +++
+```
+
+```c
+int a = (int) double_variable;
+
+int a = (int) (long) (float) double_variable;
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+/* Wrong spaces. */
+int a = ( int )double_variable;
+
+/* No multiline form. */
+int a = (int)
+        double_variable;
+```
+
+## Pointers and asterisk character
+
+Each pointer in JerryScript must be a lowercase string
+which is ending with a `_p` suffix. Furthermore there
+must be a space before the asterisk character.
+
+```diff
++++ Good +++
+```
+
+```c
+  int *int_p;
+
+  /* No need to add multiple _p-s for multiple indirections.
+   * It is recommended to avoid these constructs using typedef
+   * declarations. A reviewer might request such a change. */
+  int ***int_p;
+
+  /* This rule applies for type casting as well. */
+  char = *(char *) type_p;
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+  /* No _p after the name. */
+  int *ptr;
+
+  /* Wrong asterisk position. */
+  int* ptr_p;
+
+  char_p = * (char*)type_p;
+```
+
+## Types
+
+Each type in JerryScript must be a lowercase string
+which ends with a `_t` suffix. Furthermore each type
+declaration must be preceded by a short description
+of the type and each field must have a short description
+as well.
+
+```diff
++++ Good +++
+```
+
+```c
+/**
+ * Short description of the following structure.
+ */
+typedef struct
+{
+  /* Field descriptions do not start with capital letters
+   * and there is no full stop at the end. */
+  field1_t field1; /**< description of field 1 */
+  field2_t field2; /**< description of field 1 */
+
+  field_n_t field_n; /**< description of field n */
+} structure_name_t;
+
+/**
+ * Another integer type.
+ */
+typedef int jerry_int;
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+typedef struct
+{
+  field_t field_without_description;
+} structure_without_description_t;
+
+typedef struct { int a; } single_line_struct;
+
+typedef
+union {
+}
+wrong_newlines_t;
+
+/*
+  * Bad comment format.
+   */
+typedef
+char wrong_newlines_again_t;
+```
+
+## Function declarations
+
+Function declarations in JerryScript are verbose but this format
+reduces the maintenance cost and allows faster understanding of
+the code.
+
+```diff
++++ Good +++
+```
+
+```c
+/**
+ * Short overview about the purpose of this function.
+ *
+ * A more detailed explanation if needed.
+ *
+ * Note:
+ *   Extra notes if needed.
+ *
+ * @return short description about the value
+ *         returned by the function
+ */
+return_value_type_t
+function_name (argument1, /**< description of argument1 */
+               argument2, /**< description of argument2 */
+               ...
+               argument_n, /**< description of argument n */
+{
+
+  /* Function body. */
+
+} /* function_name */
+```
+
+```diff
+--- Bad ---
+```
+
+```c
+static int
+print (char *text) /**< description of text argument */
+{
+  /* Missing comment before the function. */
+} /* print */
+
+/**
+ * Prints the text received by the function.
+ *
+ * @return number of characters printed by the function
+ */
+int print(char *text)
+{
+  /* No description of text argument. */
+  /* Missing comment at the end of the function. */
+}
+```
diff --git a/deps/jerry/docs/09.EXT-REFERENCE-ARG.md b/deps/jerry/docs/09.EXT-REFERENCE-ARG.md
new file mode 100644 (file)
index 0000000..bd17f9c
--- /dev/null
@@ -0,0 +1,657 @@
+# jerryx_arg types
+
+## jerryx_arg_t
+
+**Summary**
+
+The structure defining a single validation/transformation step.
+
+*Note*: For commonly used validators, `arg.h` provides helpers to create the `jerryx_arg_t`s.
+For example, `jerryx_arg_number ()`, `jerryx_arg_boolean ()`, etc.
+
+**Prototype**
+
+```c
+typedef struct
+{
+  /** the transform function */
+  jerryx_arg_transform_func_t func;
+  /** pointer to destination where func should store the result */
+  void *dest;
+  /** extra information, specific to func */
+  uintptr_t extra_info;
+} jerryx_arg_t;
+```
+
+**See also**
+
+- [jerryx_arg_number](#jerryx_arg_number)
+- [jerryx_arg_boolean](#jerryx_arg_boolean)
+- [jerryx_arg_string](#jerryx_arg_string)
+- [jerryx_arg_function](#jerryx_arg_function)
+- [jerryx_arg_native_pointer](#jerryx_arg_native_pointer)
+- [jerryx_arg_ignore](#jerryx_arg_ignore)
+- [jerryx_arg_object_properties](#jerryx_arg_object_properties)
+
+## jerryx_arg_object_props_t
+
+**Summary**
+
+The structure is used in `jerryx_arg_object_properties`. It provides the properties' names,
+its corresponding JS-to-C mapping and other related information.
+
+**Prototype**
+
+```c
+typedef struct
+{
+  const jerry_char_t **name_p; /**< property name list of the JS object */
+  jerry_length_t name_cnt; /**< count of the name list */
+  const jerryx_arg_t *c_arg_p; /**< points to the array of transformation steps */
+  jerry_length_t c_arg_cnt; /**< the count of the `c_arg_p` array */
+} jerryx_arg_object_props_t;
+```
+
+**See also**
+
+- [jerryx_arg_object_properties](#jerryx_arg_object_properties)
+
+## jerryx_arg_transform_func_t
+
+**Summary**
+
+Signature of the transform function.
+
+Users can create custom transformations by implementing a transform function
+and using `jerryx_arg_custom ()`.
+
+The function is expected to return `undefined` if it ran successfully or
+return an `Error` in case it failed. The function can use the iterator and the
+helpers `jerryx_arg_js_iterator_pop ()` and `jerryx_arg_js_iterator_peek ()` to
+get the next input value.
+
+*Note*: A transform function is allowed to consume any number of input values!
+This enables complex validation like handling different JS function signatures,
+mapping multiple input arguments to a C struct, etc.
+
+The function is expected to store the result of
+a successful transformation into `c_arg_p->dest`. In case the validation did
+not pass, the transform should not modify `c_arg_p->dest`.
+
+Additional parameters can be provided to the function through `c_arg_p->extra_info`.
+
+**Prototype**
+
+```c
+typedef jerry_value_t (*jerryx_arg_transform_func_t) (jerryx_arg_js_iterator_t *js_arg_iter_p,
+                                                      const jerryx_arg_t *c_arg_p);
+```
+
+**See also**
+
+- [jerryx_arg_custom](#jerryx_arg_custom)
+- [jerryx_arg_js_iterator_pop](#jerryx_arg_js_iterator_pop)
+- [jerryx_arg_js_iterator_peek](#jerryx_arg_js_iterator_peek)
+
+
+## jerryx_arg_coerce_t
+
+Enum that indicates whether an argument is allowed to be coerced into the expected JS type.
+
+ - JERRYX_ARG_COERCE - the transform will invoke toNumber, toBoolean, toString, etc.
+ - JERRYX_ARG_NO_COERCE - the type coercion is not allowed. The transform will fail if the type does not match the expectation.
+
+**See also**
+
+- [jerryx_arg_number](#jerryx_arg_number)
+- [jerryx_arg_boolean](#jerryx_arg_boolean)
+- [jerryx_arg_string](#jerryx_arg_string)
+
+## jerryx_arg_optional_t
+
+Enum that indicates whether an argument is optional or required.
+
+ - JERRYX_ARG_OPTIONAL - The argument is optional. If the argument is `undefined` the transform is successful and `c_arg_p->dest` remains untouched.
+ - JERRYX_ARG_REQUIRED - The argument is required. If the argument is `undefined` the transform will fail and `c_arg_p->dest` remains untouched.
+
+**See also**
+
+- [jerryx_arg_number](#jerryx_arg_number)
+- [jerryx_arg_boolean](#jerryx_arg_boolean)
+- [jerryx_arg_string](#jerryx_arg_string)
+- [jerryx_arg_function](#jerryx_arg_function)
+- [jerryx_arg_native_pointer](#jerryx_arg_native_pointer)
+
+## jerryx_arg_round_t
+
+Enum that indicates the rounding policy which will be chosen to transform an integer.
+
+ - JERRYX_ARG_ROUND - use round() method.
+ - JERRYX_ARG_FLOOR - use floor() method.
+ - JERRYX_ARG_CEIL - use ceil() method.
+
+**See also**
+
+- [jerryx_arg_uint8](#jerryx_arg_uint8)
+- [jerryx_arg_uint16](#jerryx_arg_uint16)
+- [jerryx_arg_uint32](#jerryx_arg_uint32)
+- [jerryx_arg_int8](#jerryx_arg_int8)
+- [jerryx_arg_int16](#jerryx_arg_int16)
+- [jerryx_arg_int32](#jerryx_arg_int32)
+
+
+## jerryx_arg_clamp_t
+
+ Indicates the clamping policy which will be chosen to transform an integer.
+ If the policy is NO_CLAMP, and the number is out of range,
+ then the transformer will throw a range error.
+
+ - JERRYX_ARG_CLAMP - clamp the number when it is out of range
+ - JERRYX_ARG_NO_CLAMP - throw a range error
+
+**See also**
+
+- [jerryx_arg_uint8](#jerryx_arg_uint8)
+- [jerryx_arg_uint16](#jerryx_arg_uint16)
+- [jerryx_arg_uint32](#jerryx_arg_uint32)
+- [jerryx_arg_int8](#jerryx_arg_int8)
+- [jerryx_arg_int16](#jerryx_arg_int16)
+- [jerryx_arg_int32](#jerryx_arg_int32)
+
+# Main functions
+
+## jerryx_arg_transform_this_and_args
+
+**Summary**
+
+Validate the this value and the JS arguments, and assign them to the native arguments.
+This function is useful to perform input validation inside external function handlers (see `jerry_external_handler_t`).
+
+**Prototype**
+
+```c
+jerry_value_t
+jerryx_arg_transform_this_and_args (const jerry_value_t this_val,
+                                    const jerry_value_t *js_arg_p,
+                                    const jerry_length_t js_arg_cnt,
+                                    const jerryx_arg_t *c_arg_p,
+                                    jerry_length_t c_arg_cnt)
+```
+
+ - `this_val` - `this` value. Note this is processed as the first value, before the array of arguments.
+ - `js_arg_p` - points to the array with JS arguments.
+ - `js_arg_cnt` - the count of the `js_arg_p` array.
+ - `c_arg_p` - points to the array of validation/transformation steps
+ - `c_arg_cnt` - the count of the `c_arg_p` array.
+ - return value - a `jerry_value_t` representing `undefined` if all validators passed or an `Error` if a validator failed.
+
+**Example**
+
+[doctest]: # (test="compile")
+
+```c
+#include "jerryscript.h"
+#include "jerryscript-ext/arg.h"
+
+/* JS signature: function (requiredBool, requiredString, optionalNumber) */
+static jerry_value_t
+my_external_handler (const jerry_value_t function_obj,
+                     const jerry_value_t this_val,
+                     const jerry_value_t args_p[],
+                     const jerry_length_t args_count)
+{
+  bool required_bool;
+  char required_str[16];
+  double optional_num = 1234.567;  // default value
+
+  /* "mapping" defines the steps to transform input arguments to C variables. */
+  const jerryx_arg_t mapping[] =
+  {
+    /* `this` is the first value. No checking needed on `this` for this function. */
+    jerryx_arg_ignore (),
+
+    jerryx_arg_boolean (&required_bool, JERRYX_ARG_NO_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_string (required_str, sizeof (required_str), JERRYX_ARG_NO_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_number (&optional_num, JERRYX_ARG_NO_COERCE, JERRYX_ARG_OPTIONAL),
+  };
+
+  /* Validate and transform. */
+  const jerry_value_t rv = jerryx_arg_transform_this_and_args (this_val,
+                                                               args_p,
+                                                               args_count,
+                                                               mapping,
+                                                               4);
+
+  if (jerry_value_has_error_flag (rv))
+  {
+    /* Handle error. */
+    return rv;
+  }
+
+  /*
+   * Validated and transformed successfully!
+   * required_bool, required_str and optional_num can now be used.
+   */
+
+  return jerry_create_undefined (); /* Or return something more meaningful. */
+}
+```
+
+**See also**
+
+- [jerryx_arg_ignore](#jerryx_arg_ignore)
+- [jerryx_arg_number](#jerryx_arg_number)
+- [jerryx_arg_boolean](#jerryx_arg_boolean)
+- [jerryx_arg_string](#jerryx_arg_string)
+- [jerryx_arg_function](#jerryx_arg_function)
+- [jerryx_arg_native_pointer](#jerryx_arg_native_pointer)
+- [jerryx_arg_custom](#jerryx_arg_custom)
+- [jerryx_arg_object_properties](#jerryx_arg_object_properties)
+
+
+## jerryx_arg_transform_args
+
+**Summary**
+
+Validate an array of `jerry_value_t` and assign them to the native arguments.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerryx_arg_transform_args (const jerry_value_t *js_arg_p,
+                           const jerry_length_t js_arg_cnt,
+                           const jerryx_arg_t *c_arg_p,
+                           jerry_length_t c_arg_cnt)
+```
+
+ - `js_arg_p` - points to the array with JS arguments.
+ - `js_arg_cnt` - the count of the `js_arg_p` array.
+ - `c_arg_p` - points to the array of validation/transformation steps
+ - `c_arg_cnt` - the count of the `c_arg_p` array.
+ - return value - a `jerry_value_t` representing `undefined` if all validators passed or an `Error` if a validator failed.
+
+**See also**
+
+- [jerryx_arg_transform_this_and_args](#jerryx_arg_transform_this_and_args)
+
+
+## jerryx_arg_transform_object_properties
+
+**Summary**
+
+Validate the properties of a JS object and assign them to the native arguments.
+
+*Note*: This function transforms properties of a single JS object into native C values.
+To transform multiple objects in one pass (for example when converting multiple arguments
+to an external handler), please use `jerryx_arg_object_properties` together with
+`jerryx_arg_transform_this_and_args` or `jerryx_arg_transform_args`.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerryx_arg_transform_object_properties (const jerry_value_t obj_val,
+                                        const jerry_char_t **name_p,
+                                        const jerry_length_t name_cnt,
+                                        const jerryx_arg_t *c_arg_p,
+                                        jerry_length_t c_arg_cnt);
+
+```
+
+ - `obj_val` - the JS object.
+ - `name_p` - points to the array of property names.
+ - `name_cnt` - the count of the `name_p` array.
+ - `c_arg_p` - points to the array of validation/transformation steps
+ - `c_arg_cnt` - the count of the `c_arg_p` array.
+ - return value - a `jerry_value_t` representing `undefined` if all validators passed or an `Error` if a validator failed.
+
+**See also**
+
+- [jerryx_arg_object_properties](#jerryx_arg_object_properties)
+
+
+# Helpers for commonly used validations
+
+## jerryx_arg_uint8
+
+## jerryx_arg_uint16
+
+## jerryx_arg_uint32
+
+## jerryx_arg_int8
+
+## jerryx_arg_int16
+
+## jerryx_arg_int32
+
+**Summary**
+
+All above jerryx_arg_[u]intX functions are used to create a validation/transformation step
+(`jerryx_arg_t`) that expects to consume one `number` JS argument
+and stores it into a C integer (uint8, int8, uint16, ...)
+
+**Prototype**
+
+Take jerryx_arg_int32 as an example
+
+```c
+static inline jerryx_arg_t
+jerryx_arg_int32 (int32_t *dest,
+                  jerryx_arg_round_t round_flag,
+                  jerryx_arg_clamp_t clamp_flag,
+                  jerryx_arg_coerce_t coerce_flag,
+                  jerryx_arg_optional_t opt_flag);
+```
+
+ - return value - the created `jerryx_arg_t` instance.
+ - `dest` - pointer to the `int32_t` where the result should be stored.
+ - `round_flag` - the rounding policy.
+ - `clamp_flag` - the clamping policy.
+ - `coerce_flag` - whether type coercion is allowed.
+ - `opt_flag` - whether the argument is optional.
+
+**See also**
+
+- [jerryx_arg_transform_this_and_args](#jerryx_arg_transform_this_and_args)
+
+
+## jerryx_arg_number
+
+**Summary**
+
+Create a validation/transformation step (`jerryx_arg_t`) that expects to consume
+one `number` JS argument and stores it into a C `double`.
+
+**Prototype**
+
+```c
+static inline jerryx_arg_t
+jerryx_arg_number (double *dest,
+                   jerryx_arg_coerce_t coerce_flag,
+                   jerryx_arg_optional_t opt_flag)
+```
+
+ - return value - the created `jerryx_arg_t` instance.
+ - `dest` - pointer to the `double` where the result should be stored.
+ - `coerce_flag` - whether type coercion is allowed.
+ - `opt_flag` - whether the argument is optional.
+
+**See also**
+
+- [jerryx_arg_transform_this_and_args](#jerryx_arg_transform_this_and_args)
+
+## jerryx_arg_boolean
+
+**Summary**
+
+Create a validation/transformation step (`jerryx_arg_t`) that expects to
+consume one `boolean` JS argument and stores it into a C `bool`.
+
+**Prototype**
+
+```c
+static inline jerryx_arg_t
+jerryx_arg_boolean (bool *dest,
+                    jerryx_arg_coerce_t coerce_flag,
+                    jerryx_arg_optional_t opt_flag)
+```
+ - return value - the created `jerryx_arg_t` instance.
+ - `dest` - pointer to the `bool` where the result should be stored.
+ - `coerce_flag` - whether type coercion is allowed.
+ - `opt_flag` - whether the argument is optional.
+
+**See also**
+
+- [jerryx_arg_transform_this_and_args](#jerryx_arg_transform_this_and_args)
+
+
+## jerryx_arg_string
+
+**Summary**
+
+Create a validation/transformation step (`jerryx_arg_t`) that expects to
+consume one `string` JS argument and stores it into a C `char` array.
+
+**Prototype**
+
+```c
+static inline jerryx_arg_t
+jerryx_arg_string (char *dest,
+                   uint32_t size,
+                   jerryx_arg_coerce_t coerce_flag,
+                   jerryx_arg_optional_t opt_flag)
+```
+
+ - return value - the created `jerryx_arg_t` instance.
+ - `dest` - pointer to the native char array where the result should be stored.
+ - `size` - the size of native char array.
+ - `coerce_flag` - whether type coercion is allowed.
+ - `opt_flag` - whether the argument is optional.
+
+**See also**
+
+- [jerryx_arg_transform_this_and_args](#jerryx_arg_transform_this_and_args)
+
+
+## jerryx_arg_function
+
+**Summary**
+
+Create a validation/transformation step (`jerryx_arg_t`) that expects to
+consume one `function` JS argument and stores it into a C `jerry_value_t`.
+
+**Prototype**
+
+```c
+static inline jerryx_arg_t
+jerryx_arg_function (jerry_value_t *dest,
+                     jerryx_arg_optional_t opt_flag)
+
+```
+ - return value - the created `jerryx_arg_t` instance.
+ - `dest` - pointer to the `jerry_value_t` where the result should be stored.
+ - `opt_flag` - whether the argument is optional.
+
+**See also**
+
+- [jerryx_arg_transform_this_and_args](#jerryx_arg_transform_this_and_args)
+
+## jerryx_arg_native_pointer
+
+**Summary**
+
+Create a validation/transformation step (`jerryx_arg_t`) that expects to
+consume one `object` JS argument that is 'backed' with a native pointer with
+a given type info. In case the native pointer info matches, the transform
+will succeed and the object's native pointer will be assigned to `*dest`.
+
+**Prototype**
+
+```c
+static inline jerryx_arg_t
+jerryx_arg_native_pointer (void **dest,
+                           const jerry_object_native_info_t *info_p,
+                           jerryx_arg_optional_t opt_flag)
+```
+ - return value - the created `jerryx_arg_t` instance.
+ - `dest` - pointer to where the resulting native pointer should be stored.
+ - `info_p` - expected the type info.
+ - `opt_flag` - whether the argument is optional.
+
+**See also**
+
+- [jerryx_arg_transform_this_and_args](#jerryx_arg_transform_this_and_args)
+
+## jerryx_arg_object_properties
+
+**Summary**
+
+Create a validation/transformation step (`jerryx_arg_t`) that expects to
+consume one `object` JS argument and call `jerryx_arg_transform_object_properties` inside
+to transform its properties to native arguments.
+User should prepare the `jerryx_arg_object_props_t` instance, and pass it to this function.
+
+**Prototype**
+
+```c
+static inline jerryx_arg_t
+jerryx_arg_object_properties (const jerryx_arg_object_props_t *object_props_p,
+                              jerryx_arg_optional_t opt_flag);
+```
+ - return value - the created `jerryx_arg_t` instance.
+ - `object_props_p` - provides information for properties transform.
+ - `opt_flag` - whether the argument is optional.
+
+**Example**
+
+[doctest]: # (test="compile")
+
+```c
+#include "jerryscript.h"
+#include "jerryscript-ext/arg.h"
+
+/**
+ * The binding function expects args_p[0] is an object, which has 3 properties:
+ *     "enable": boolean
+ *     "data": number
+ *     "extra_data": number, optional
+ */
+static jerry_value_t
+my_external_handler (const jerry_value_t function_obj,
+                     const jerry_value_t this_val,
+                     const jerry_value_t args_p[],
+                     const jerry_length_t args_count)
+{
+  bool required_bool;
+  double required_num;
+  double optional_num = 1234.567;  // default value
+
+  /* "prop_name_p" defines the name list of the expected properties' names. */
+  const char *prop_name_p[] = { "enable", "data", "extra_data" };
+
+  /* "prop_mapping" defines the steps to transform properties to C variables. */
+  const jerryx_arg_t prop_mapping[] =
+  {
+    jerryx_arg_boolean (&required_bool, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_number (&required_num, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_number (&optional_num, JERRYX_ARG_COERCE, JERRYX_ARG_OPTIONAL)
+  };
+
+  /* Prepare the jerryx_arg_object_props_t instance. */
+  const jerryx_arg_object_props_t prop_info =
+  {
+    .name_p = (const jerry_char_t **) prop_name_p,
+    .name_cnt = 3,
+    .c_arg_p = prop_mapping,
+    .c_arg_cnt = 3
+  };
+
+  /* It is the mapping used in the jerryx_arg_transform_args. */
+  const jerryx_arg_t mapping[] =
+  {
+    jerryx_arg_object_properties (&prop_info, JERRYX_ARG_REQUIRED)
+  };
+
+  /* Validate and transform. */
+  const jerry_value_t rv = jerryx_arg_transform_args (args_p,
+                                                      args_count,
+                                                      mapping,
+                                                      1);
+
+  if (jerry_value_has_error_flag (rv))
+  {
+    /* Handle error. */
+    return rv;
+  }
+
+  /*
+   * Validated and transformed successfully!
+   * required_bool, required_num and optional_num can now be used.
+   */
+
+   return jerry_create_undefined (); /* Or return something more meaningful. */
+}
+
+```
+
+ **See also**
+
+- [jerryx_arg_transform_this_and_args](#jerryx_arg_transform_this_and_args)
+- [jerryx_arg_transform_object_properties](#jerryx_arg_transform_object_properties)
+
+# Functions to create custom validations
+
+## jerryx_arg_custom
+
+**Summary**
+
+Create a jerryx_arg_t instance with custom transform.
+
+**Prototype**
+
+```c
+static inline jerryx_arg_t
+jerryx_arg_custom (void *dest,
+                   uintptr_t extra_info,
+                   jerryx_arg_transform_func_t func)
+
+```
+ - return value - the created `jerryx_arg_t` instance.
+ - `dest` - pointer to the native argument where the result should be stored.
+ - `extra_info` - the extra parameter data, specific to the transform function.
+ - `func` - the custom transform function.
+
+**See also**
+
+- [jerryx_arg_transform_this_and_args](#jerryx_arg_transform_this_and_args)
+
+
+
+## jerryx_arg_js_iterator_pop
+
+**Summary**
+
+Pop the current `jerry_value_t` argument from the iterator.
+It will change the `js_arg_idx` and `js_arg_p` value in the iterator.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerryx_arg_js_iterator_pop (jerryx_arg_js_iterator_t *js_arg_iter_p)
+```
+ - return value - the `jerry_value_t` argument that was popped.
+ - `js_arg_iter_p` - the JS arg iterator from which to pop.
+
+## jerryx_arg_js_iterator_peek
+
+**Summary**
+
+Get the current JS argument from the iterator, without moving the iterator forward.
+*Note:* Unlike `jerryx_arg_js_iterator_pop ()`, it will not change `js_arg_idx` and
+`js_arg_p` value in the iterator.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerryx_arg_js_iterator_peek (jerryx_arg_js_iterator_t *js_arg_iter_p)
+```
+ - return value - the current `jerry_value_t` argument.
+ - `js_arg_iter_p` - the JS arg iterator from which to peek.
+
+## jerryx_arg_js_iterator_index
+
+**Summary**
+
+Get the index of the current JS argument from the iterator.
+
+**Prototype**
+
+```c
+jerry_length_t
+jerryx_arg_js_iterator_index (jerryx_arg_js_iterator_t *js_arg_iter_p)
+```
+ - return value - the index of current JS argument.
+ - `js_arg_iter_p` - the JS arg iterator from which to peek.
diff --git a/deps/jerry/docs/10.EXT-REFERENCE-HANDLER.md b/deps/jerry/docs/10.EXT-REFERENCE-HANDLER.md
new file mode 100644 (file)
index 0000000..431ab8b
--- /dev/null
@@ -0,0 +1,182 @@
+#  Common external function handlers
+
+## jerryx_handler_assert
+
+**Summary**
+
+Assert for scripts. The routine calls `jerry_port_fatal` on assertion failure.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerryx_handler_assert (const jerry_value_t func_obj_val, const jerry_value_t this_p,
+                       const jerry_value_t args_p[], const jerry_length_t args_cnt);
+```
+
+- `func_obj_val` - the function object that was called (unused).
+- `this_p` - the `this` value of the call (unused).
+- `args_p` - the array of function arguments.
+- `args_cnt` - the number of function arguments.
+- return value - `jerry_value_t` representing boolean true, if only one argument
+  was passed and that argument was a boolean true. Note that the function does
+  not return otherwise.
+
+**See also**
+
+- [jerryx_handler_register_global](#jerryx_handler_register_global)
+
+
+## jerryx_handler_gc
+
+**Summary**
+
+Expose garbage collector to scripts.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerryx_handler_gc (const jerry_value_t func_obj_val, const jerry_value_t this_p,
+                   const jerry_value_t args_p[], const jerry_length_t args_cnt);
+```
+
+- `func_obj_val` - the function object that was called (unused).
+- `this_p` - the `this` value of the call (unused).
+- `args_p` - the array of function arguments (unused).
+- `args_cnt` - the number of function arguments (unused).
+- return value - `jerry_value_t` representing `undefined`.
+
+**See also**
+
+- [jerryx_handler_register_global](#jerryx_handler_register_global)
+
+
+## jerryx_handler_print
+
+**Summary**
+
+Provide a `print` implementation for scripts. The routine converts all of its
+arguments to strings and outputs them char-by-char using
+`jerryx_port_handler_print_char`. The NUL character is output as "\u0000",
+other characters are output bytewise.
+
+*Note*: This implementation does not use standard C `printf` to print its
+output. This allows more flexibility but also extends the core JerryScript
+engine port API. Applications that want to use `jerryx_handler_print` must
+ensure that their port implementation also provides
+`jerryx_port_handler_print_char`.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerryx_handler_print (const jerry_value_t func_obj_val, const jerry_value_t this_p,
+                      const jerry_value_t args_p[], const jerry_length_t args_cnt);
+```
+
+- `func_obj_val` - the function object that was called (unused).
+- `this_p` - the `this` value of the call (unused).
+- `args_p` - the array of function arguments.
+- `args_cnt` - the number of function arguments.
+- return value - `jerry_value_t` representing `undefined` if all arguments could
+  be converted to strings, an `Error` otherwise.
+
+**See also**
+
+- [jerryx_handler_register_global](#jerryx_handler_register_global)
+- [jerryx_port_handler_print_char](#jerryx_port_handler_print_char)
+
+
+# Handler registration helper
+
+## jerryx_handler_register_global
+
+**Summary**
+
+Register a JavaScript function in the global object.
+
+*Note*: Returned value must be freed with `jerry_release_value`, when it is no
+longer needed.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerryx_handler_register_global (const jerry_char_t *name_p,
+                                jerry_external_handler_t handler_p);
+```
+
+- `name_p` - the name of the function to be registered.
+- `handler_p` - the address of the external function handler.
+- return value - `jerry_value_t` representing boolean true, if the operation was
+  successful, an `Error` otherwise.
+
+**Example**
+
+[doctest]: # (test="compile")
+
+```c
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+
+static const struct {
+  const char *name_p;
+  jerry_external_handler_t handler_p;
+} common_functions[] =
+{
+  { "assert", jerryx_handler_assert },
+  { "gc", jerryx_handler_gc },
+  { "print", jerryx_handler_print },
+  { NULL, NULL }
+};
+
+static void
+register_common_functions (void)
+{
+  jerry_value_t ret = jerry_create_undefined ();
+
+  for (int i = 0; common_functions[i].name_p != NULL && !jerry_value_has_error_flag (ret); i++)
+  {
+    ret = jerryx_handler_register_global ((const jerry_char_t *) common_functions[i].name_p,
+                                          common_functions[i].handler_p);
+  }
+
+  jerry_release_value (ret);
+}
+```
+
+
+# Port API extension
+
+## jerryx_port_handler_print_char
+
+**Summary**
+
+Print a single character.
+
+**Prototype**
+
+```c
+void
+jerryx_port_handler_print_char (char c);
+```
+
+- `c` - the character to print.
+
+**Example**
+
+```c
+/**
+ * Print a character to stdout with printf.
+ */
+void
+jerryx_port_handler_print_char (char c)
+{
+  printf ("%c", c);
+} /* jerryx_port_handler_print_char */
+```
+
+**See also**
+
+- [jerryx_handler_print](#jerryx_handler_print)
diff --git a/deps/jerry/docs/11.EXT-REFERENCE-AUTORELEASE.md b/deps/jerry/docs/11.EXT-REFERENCE-AUTORELEASE.md
new file mode 100644 (file)
index 0000000..b2cc6b6
--- /dev/null
@@ -0,0 +1,50 @@
+#  Autorelease values
+
+## JERRYX_AR_VALUE_T
+
+**Summary**
+
+Macro for `const jerry_value_t` for which jerry_release_value() is
+automatically called when the variable goes out of scope.
+
+*Note*: The macro depends on compiler support. For GCC and LLVM/clang, the macro is implemented
+using the `__cleanup__` variable attribute. For other compilers, no support has been added yet.
+
+**Example**
+
+[doctest]: # (test="compile")
+
+```c
+#include "jerryscript.h"
+#include "jerryscript-ext/autorelease.h"
+
+static void
+foo (bool enable)
+{
+  JERRYX_AR_VALUE_T bar = jerry_create_string ((const jerry_char_t *) "...");
+
+  if (enable)
+  {
+    JERRYX_AR_VALUE_T baz = jerry_get_global_object ();
+
+    /* bar and baz can now be used. */
+
+    /*
+     * jerry_release_value (baz) and jerry_release_value (bar) is called automatically before
+     * returning, because `baz` and `bar` go out of scope.
+     */
+    return;
+  }
+
+  /*
+   * jerry_release_value (bar) is called automatically when the function returns,
+   * because `bar` goes out of scope.
+   */
+}
+```
+
+**See also**
+
+- [jerry_value_t](../docs/02.API-REFERENCE.md#jerry_value_t)
+- [jerry_acquire_value](../docs/02.API-REFERENCE.md#jerry_acquire_value)
+- [jerry_release_value](../docs/02.API-REFERENCE.md#jerry_release_value)
diff --git a/deps/jerry/docs/12.EXT-REFERENCE-MODULE.md b/deps/jerry/docs/12.EXT-REFERENCE-MODULE.md
new file mode 100644 (file)
index 0000000..f28679f
--- /dev/null
@@ -0,0 +1,186 @@
+#  Module API
+
+This is a JerryScript extension that provides a means of loading modules. Fundamentally, a module is a name (stored as
+a string) that resolves to a `jerry_value_t`. This extension provides the function `jerryx_module_resolve()` which
+accepts the name of the module being requested as well as an array of so-called "resolvers" - functions which satisfy
+the signature `jerryx_module_resolver_t`. The resolvers in the list are called in sequence until one of them returns
+`true` and a `jerry_value_t` in its out parameter. The value is cached if it is not an error, so subsequent requests
+for the same name will not result in additional calls to the resolvers.
+
+The purpose of having resolvers is to be able to account for the fact that different types of modules may be structured
+differently and thus, for each type of module a module resolver must be supplied at the point where an instance of that
+type of module is requested.
+
+Additionally, this extension provides a means of easily defining so-called "native" JerryScript modules which can be
+resolved using the JerryScript native module resolver `jerryx_module_native_resolver()`, which can be passed to
+`jerryx_module_resolve()`. Note, however, that native JerryScript modules are only supported and
+`jerryx_module_native_resolver()` is only compiled in if compiler support for `__attribute__` extensions is present. In
+effect this means that native JerryScript modules are available only when this extension is built with GCC or
+LLVM/clang. In the absence of such support, you may construct alternative module systems and provide your own resolver
+to `jerryx_module_resolve()`.
+
+`jerryscript-ext/module.h` defines the preprocessor directive `JERRYX_NATIVE_MODULES_SUPPORTED` only if support for
+native JerryScript modules is available.
+
+## jerryx_module_resolve
+
+**Summary**
+
+Load a copy of a module into the current context or return one that was already loaded if it is found.
+
+Each function in `resolvers_p` will be called in sequence until one returns `true` and fills out its out-parameter with
+the `jerry_value_t` representing the requested module. If the `jerry_value_t` does not have the error flag set it will
+be cached. Thus, on subsequent calls with the same value for `name`, none of the functions in `resolvers_p` will be
+called.
+
+**Prototype**
+
+```c
+jerry_value_t
+jerryx_module_resolve (const jerry_char_t *name,
+                       jerryx_module_resolver_t *resolvers_p,
+                       size_t resolver_count);
+```
+
+- `name` - the name of the module to load
+- `resolvers_p` - the list of resolvers to call in sequence
+- `resolver_count` - the number of resolvers in `resolvers_p`
+- return value - `jerry_value_t` representing the module that was loaded, or the error that occurred in the process.
+
+
+## jerryx_module_native_resolver
+
+**Summary**
+
+The resolver for JerryScript modules. A pointer to this function can be passed in the second parameter to
+`jerryx_module_resolve` to search for the module among the JerryScript modules built into the binary. This function is
+available only if the preprocessor directive `JERRYX_NATIVE_MODULES_SUPPORTED` is defined.
+
+**Prototype**
+
+```c
+bool
+jerryx_module_native_resolver (const jerry_char_t *name,
+                               jerry_value_t *result)
+```
+- `name` - the name of the module to find
+- `result` - out - place where to store the resulting module instance
+- return value - `true` if the module was found and stored in `result`, and `false` otherwise
+
+
+# Module data types
+
+## jerryx_native_module_on_resolve_t
+
+**Summary**
+
+Function pointer type for a function that will create an instance of a native module. This type is only defined if the
+preprocessor directive `JERRYX_NATIVE_MODULES_SUPPORTED` is defined.
+
+**Prototype**
+
+```c
+typedef jerry_value_t (*jerryx_native_module_on_resolve_t) (void);
+```
+
+## jerryx_module_resolver_t
+
+**Summary**
+
+Function pointer type for a module resolver
+
+**Prototype**
+
+```c
+typedef bool (*jerryx_module_resolver_t) (const jerry_char_t *name, jerry_value_t *result);
+```
+
+**Example**
+```c
+bool
+load_and_evaluate_js_file (const jerry_char_t *name, jerry_value_t *result)
+{
+  bool return_value = false;
+  char *js_file_contents = NULL;
+  int file_size = 0;
+  FILE *js_file = fopen (name, "r");
+
+  if (js_file)
+  {
+    /* We have successfully opened the file. Now, we establish its size. */
+    file_size = fseek (js_file, 0, SEEK_END);
+    fseek (js_file, 0, SEEK_SET);
+
+    /* We allocate enough memory to store the contents of the file. */
+    js_file_contents = malloc (file_size);
+    if (js_file_contents)
+    {
+      /* We read the file into memory and call jerry_eval (), assigning the result to the out-parameter. */
+      fread (js_file_contents, file_size, 1, js_file);
+      (*result) = jerry_eval (js_file_contents, file_size, false);
+
+      /* We release the memory holding the contents of the file. */
+      free (js_file_contents);
+      return_value = true;
+    }
+
+    /* We close the file. */
+    fclose (js_file);
+  }
+
+  return return_value;
+}
+```
+
+We can now load JavaScript files:
+```c
+static const jerryx_module_resolver_t resolvers =
+{
+  /* Consult the JerryScript module resolver first, in case the requested module is a compiled-in JerryScript module. */
+  jerryx_module_native_resolver,
+
+  /*
+   * If the requested module is not a JerryScript module, assume it is a JavaScript file on disk and use the above-
+   * defined JavaScript file loader to load it.
+   */
+  load_and_evaluate_js_file
+};
+jerry_value_t js_module = jerryx_module_resolve (requested_module, resolvers, 2);
+```
+
+# Module helper macros
+
+## JERRYX_NATIVE_MODULE
+
+**Summary**
+
+Helper macro to define a JerryScript module. Currently stores the name of the module and its initializer in an
+executable linker section. This macro is available only if the preprocessor directive `JERRYX_NATIVE_MODULES_SUPPORTED`
+is defined.
+
+**Note**: The helper macro must appear at the bottom of a source file, and no semicolon must follow it.
+
+**Prototype**
+```c
+#define JERRYX_NATIVE_MODULE(module_name, on_resolve_cb)
+```
+
+- `module_name` - the name of the module without quotes
+- `on_resolve_cb` - the function of type `jerryx_native_module_on_resolve_t` that will be called when the module needs to be
+loaded.
+
+**Example**
+
+```c
+#include "jerryscript.h"
+#include "jerryscript-ext/module.h"
+
+static jerry_value_t
+my_module_on_resolve (void)
+{
+  return jerry_create_external_function (very_useful_function);
+} /* my_module_on_resolve */
+
+/* Note that there is no semicolon at the end of the next line. This is how it must be. */
+JERRYX_NATIVE_MODULE (my_module, my_module_on_resolve)
+```
diff --git a/deps/jerry/docs/img/CBC_layout.png b/deps/jerry/docs/img/CBC_layout.png
new file mode 100644 (file)
index 0000000..fed1c77
Binary files /dev/null and b/deps/jerry/docs/img/CBC_layout.png differ
diff --git a/deps/jerry/docs/img/bytecode-layout.png b/deps/jerry/docs/img/bytecode-layout.png
new file mode 100644 (file)
index 0000000..3d8bbaf
Binary files /dev/null and b/deps/jerry/docs/img/bytecode-layout.png differ
diff --git a/deps/jerry/docs/img/ecma_compressed.png b/deps/jerry/docs/img/ecma_compressed.png
new file mode 100644 (file)
index 0000000..4163c6e
Binary files /dev/null and b/deps/jerry/docs/img/ecma_compressed.png differ
diff --git a/deps/jerry/docs/img/ecma_lcache.png b/deps/jerry/docs/img/ecma_lcache.png
new file mode 100644 (file)
index 0000000..909f2cb
Binary files /dev/null and b/deps/jerry/docs/img/ecma_lcache.png differ
diff --git a/deps/jerry/docs/img/ecma_object.png b/deps/jerry/docs/img/ecma_object.png
new file mode 100644 (file)
index 0000000..b0d4545
Binary files /dev/null and b/deps/jerry/docs/img/ecma_object.png differ
diff --git a/deps/jerry/docs/img/ecma_object_property.png b/deps/jerry/docs/img/ecma_object_property.png
new file mode 100644 (file)
index 0000000..10fcdb1
Binary files /dev/null and b/deps/jerry/docs/img/ecma_object_property.png differ
diff --git a/deps/jerry/docs/img/ecma_value.png b/deps/jerry/docs/img/ecma_value.png
new file mode 100644 (file)
index 0000000..5894243
Binary files /dev/null and b/deps/jerry/docs/img/ecma_value.png differ
diff --git a/deps/jerry/docs/img/engines_high_level_design.png b/deps/jerry/docs/img/engines_high_level_design.png
new file mode 100644 (file)
index 0000000..303e518
Binary files /dev/null and b/deps/jerry/docs/img/engines_high_level_design.png differ
diff --git a/deps/jerry/docs/img/number.png b/deps/jerry/docs/img/number.png
new file mode 100644 (file)
index 0000000..aaac199
Binary files /dev/null and b/deps/jerry/docs/img/number.png differ
diff --git a/deps/jerry/docs/img/opcode_layout.png b/deps/jerry/docs/img/opcode_layout.png
new file mode 100644 (file)
index 0000000..06d8c66
Binary files /dev/null and b/deps/jerry/docs/img/opcode_layout.png differ
diff --git a/deps/jerry/docs/img/parser_dependency.png b/deps/jerry/docs/img/parser_dependency.png
new file mode 100644 (file)
index 0000000..1465e82
Binary files /dev/null and b/deps/jerry/docs/img/parser_dependency.png differ
diff --git a/deps/jerry/jerry-core/CMakeLists.txt b/deps/jerry/jerry-core/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8294148
--- /dev/null
@@ -0,0 +1,283 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+set(JERRY_CORE_NAME jerry-core)
+project (${JERRY_CORE_NAME} C)
+
+# Optional features
+set(FEATURE_CPOINTER_32_BIT  OFF     CACHE BOOL   "Enable 32 bit compressed pointers?")
+set(FEATURE_DEBUGGER         OFF     CACHE BOOL   "Enable JerryScript debugger?")
+set(FEATURE_ERROR_MESSAGES   OFF     CACHE BOOL   "Enable error messages?")
+set(FEATURE_EXTERNAL_CONTEXT OFF     CACHE BOOL   "Enable external context?")
+set(FEATURE_JS_PARSER        ON      CACHE BOOL   "Enable js-parser?")
+set(FEATURE_MEM_STATS        OFF     CACHE BOOL   "Enable memory statistics?")
+set(FEATURE_MEM_STRESS_TEST  OFF     CACHE BOOL   "Enable mem-stress test?")
+set(FEATURE_PARSER_DUMP      OFF     CACHE BOOL   "Enable parser byte-code dumps?")
+set(FEATURE_PROFILE          "es5.1" CACHE STRING "Use default or other profile?")
+set(FEATURE_REGEXP_DUMP      OFF     CACHE BOOL   "Enable regexp byte-code dumps?")
+set(FEATURE_SNAPSHOT_EXEC    OFF     CACHE BOOL   "Enable executing snapshot files?")
+set(FEATURE_SNAPSHOT_SAVE    OFF     CACHE BOOL   "Enable saving snapshot files?")
+set(FEATURE_SYSTEM_ALLOCATOR OFF     CACHE BOOL   "Enable system allocator?")
+set(FEATURE_VALGRIND         OFF     CACHE BOOL   "Enable Valgrind support?")
+set(FEATURE_VALGRIND_FREYA   OFF     CACHE BOOL   "Enable Valgrind-Freya support?")
+set(FEATURE_VM_EXEC_STOP     OFF     CACHE BOOL   "Enable VM execution stopping?")
+set(MEM_HEAP_SIZE_KB         "512"   CACHE STRING "Size of memory heap, in kilobytes")
+
+# Option overrides
+if(FEATURE_SYSTEM_ALLOCATOR)
+  set(FEATURE_CPOINTER_32_BIT ON)
+
+  set(FEATURE_CPOINTER_32_BIT_MESSAGE " (FORCED BY SYSTEM ALLOCATOR)")
+endif()
+
+if(NOT FEATURE_JS_PARSER)
+  set(FEATURE_SNAPSHOT_EXEC ON)
+  set(FEATURE_PARSER_DUMP   OFF)
+
+  set(FEATURE_SNAPSHOT_EXEC_MESSAGE " (FORCED BY DISABLED JS PARSER)")
+  set(FEATURE_PARSER_DUMP_MESSAGE   " (FORCED BY DISABLED JS PARSER)")
+endif()
+
+# Status messages
+message(STATUS "FEATURE_CPOINTER_32_BIT   " ${FEATURE_CPOINTER_32_BIT} ${FEATURE_CPOINTER_32_BIT_MESSAGE})
+message(STATUS "FEATURE_DEBUGGER          " ${FEATURE_DEBUGGER})
+message(STATUS "FEATURE_ERROR_MESSAGES    " ${FEATURE_ERROR_MESSAGES})
+message(STATUS "FEATURE_EXTERNAL_CONTEXT  " ${FEATURE_EXTERNAL_CONTEXT})
+message(STATUS "FEATURE_JS_PARSER         " ${FEATURE_JS_PARSER})
+message(STATUS "FEATURE_MEM_STATS         " ${FEATURE_MEM_STATS})
+message(STATUS "FEATURE_MEM_STRESS_TEST   " ${FEATURE_MEM_STRESS_TEST})
+message(STATUS "FEATURE_PARSER_DUMP       " ${FEATURE_PARSER_DUMP} ${FEATURE_PARSER_DUMP_MESSAGE})
+message(STATUS "FEATURE_PROFILE           " ${FEATURE_PROFILE})
+message(STATUS "FEATURE_REGEXP_DUMP       " ${FEATURE_REGEXP_DUMP})
+message(STATUS "FEATURE_SNAPSHOT_EXEC     " ${FEATURE_SNAPSHOT_EXEC} ${FEATURE_SNAPSHOT_EXEC_MESSAGE})
+message(STATUS "FEATURE_SNAPSHOT_SAVE     " ${FEATURE_SNAPSHOT_SAVE})
+message(STATUS "FEATURE_SYSTEM_ALLOCATOR  " ${FEATURE_SYSTEM_ALLOCATOR})
+message(STATUS "FEATURE_VALGRIND          " ${FEATURE_VALGRIND})
+message(STATUS "FEATURE_VALGRIND_FREYA    " ${FEATURE_VALGRIND_FREYA})
+message(STATUS "FEATURE_VM_EXEC_STOP      " ${FEATURE_VM_EXEC_STOP})
+message(STATUS "MEM_HEAP_SIZE_KB          " ${MEM_HEAP_SIZE_KB})
+
+# Include directories
+set(INCLUDE_CORE
+    "${CMAKE_CURRENT_SOURCE_DIR}"
+    "${CMAKE_CURRENT_SOURCE_DIR}/api"
+    "${CMAKE_CURRENT_SOURCE_DIR}/debugger"
+    "${CMAKE_CURRENT_SOURCE_DIR}/ecma/base"
+    "${CMAKE_CURRENT_SOURCE_DIR}/ecma/builtin-objects"
+    "${CMAKE_CURRENT_SOURCE_DIR}/ecma/builtin-objects/typedarray"
+    "${CMAKE_CURRENT_SOURCE_DIR}/ecma/operations"
+    "${CMAKE_CURRENT_SOURCE_DIR}/include"
+    "${CMAKE_CURRENT_SOURCE_DIR}/jcontext"
+    "${CMAKE_CURRENT_SOURCE_DIR}/jmem"
+    "${CMAKE_CURRENT_SOURCE_DIR}/jrt"
+    "${CMAKE_CURRENT_SOURCE_DIR}/lit"
+    "${CMAKE_CURRENT_SOURCE_DIR}/parser/js"
+    "${CMAKE_CURRENT_SOURCE_DIR}/parser/regexp"
+    "${CMAKE_CURRENT_SOURCE_DIR}/vm")
+
+# Sources
+# Jerry core
+file(GLOB SOURCE_CORE_API                       api/*.c)
+file(GLOB SOURCE_CORE_DEBUGGER                  debugger/*.c)
+file(GLOB SOURCE_CORE_ECMA_BASE                 ecma/base/*.c)
+file(GLOB SOURCE_CORE_ECMA_BUILTINS             ecma/builtin-objects/*.c)
+file(GLOB SOURCE_CORE_ECMA_BUILTINS_TYPEDARRAY  ecma/builtin-objects/typedarray/*.c)
+file(GLOB SOURCE_CORE_ECMA_OPERATIONS           ecma/operations/*.c)
+file(GLOB SOURCE_CORE_JCONTEXT                  jcontext/*.c)
+file(GLOB SOURCE_CORE_JMEM                      jmem/*.c)
+file(GLOB SOURCE_CORE_JRT                       jrt/*.c)
+file(GLOB SOURCE_CORE_LIT                       lit/*.c)
+file(GLOB SOURCE_CORE_PARSER_JS                 parser/js/*.c)
+file(GLOB SOURCE_CORE_PARSER_REGEXP             parser/regexp/*.c)
+file(GLOB SOURCE_CORE_VM                        vm/*.c)
+
+set(SOURCE_CORE_FILES
+    ${SOURCE_CORE_API}
+    ${SOURCE_CORE_DEBUGGER}
+    ${SOURCE_CORE_ECMA_BASE}
+    ${SOURCE_CORE_ECMA_BUILTINS}
+    ${SOURCE_CORE_ECMA_BUILTINS_TYPEDARRAY}
+    ${SOURCE_CORE_ECMA_OPERATIONS}
+    ${SOURCE_CORE_JCONTEXT}
+    ${SOURCE_CORE_JMEM}
+    ${SOURCE_CORE_JRT}
+    ${SOURCE_CORE_LIT}
+    ${SOURCE_CORE_PARSER_JS}
+    ${SOURCE_CORE_PARSER_REGEXP}
+    ${SOURCE_CORE_VM})
+
+# All-in-one build
+if(ENABLE_ALL_IN_ONE)
+  set(ALL_IN_FILE "${CMAKE_BINARY_DIR}/jerry-all-in.c")
+  list(SORT SOURCE_CORE_FILES)
+  file(REMOVE ${ALL_IN_FILE})
+
+  foreach(FILE ${SOURCE_CORE_FILES})
+    file(APPEND ${ALL_IN_FILE} "#include \"${FILE}\"\n")
+  endforeach()
+
+  set(SOURCE_CORE_FILES ${ALL_IN_FILE})
+endif()
+
+# Third-party
+# Valgrind
+set(INCLUDE_THIRD_PARTY_VALGRIND "${CMAKE_SOURCE_DIR}/third-party/valgrind")
+
+# build mode specific compile/link flags
+if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_NDEBUG)
+endif()
+
+# Jerry heap-section
+if(DEFINED JERRY_HEAP_SECTION_ATTR)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_HEAP_SECTION_ATTR=${JERRY_HEAP_SECTION_ATTR})
+endif()
+
+# Checks the optional features
+# Enable 32 bit cpointers
+if(FEATURE_CPOINTER_32_BIT)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_CPOINTER_32_BIT)
+endif()
+
+# Fill error messages for builtin error objects
+if(FEATURE_ERROR_MESSAGES)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_ENABLE_ERROR_MESSAGES)
+endif()
+
+# Use external context instead of static one
+if(FEATURE_EXTERNAL_CONTEXT)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_ENABLE_EXTERNAL_CONTEXT)
+endif()
+
+# JS-Parser
+if(FEATURE_JS_PARSER)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_JS_PARSER=1)
+else()
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_JS_PARSER=0)
+endif()
+
+# Memory statistics
+if(FEATURE_MEM_STATS)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JMEM_STATS)
+endif()
+
+# Enable debugger
+if(FEATURE_DEBUGGER)
+  if(JERRY_LIBC)
+    message(FATAL_ERROR "This configuration is not supported. Please build against your system libc to enable the JerryScript debugger.")
+  endif()
+
+  # Sleep function availability check
+  INCLUDE (CheckIncludeFiles)
+  CHECK_INCLUDE_FILES (time.h HAVE_TIME_H)
+  CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
+  if(HAVE_TIME_H)
+    set(DEFINES_JERRY ${DEFINES_JERRY} HAVE_TIME_H)
+  elseif(HAVE_UNISTD_H)
+    set(DEFINES_JERRY ${DEFINES_JERRY} HAVE_UNISTD_H)
+  endif()
+
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_DEBUGGER)
+endif()
+
+# Memory management stress-test mode
+if(FEATURE_MEM_STRESS_TEST)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JMEM_GC_BEFORE_EACH_ALLOC)
+endif()
+
+# Parser byte-code dumps
+if(FEATURE_PARSER_DUMP)
+  set(DEFINES_JERRY ${DEFINES_JERRY} PARSER_DUMP_BYTE_CODE)
+endif()
+
+# Profile
+if (NOT IS_ABSOLUTE ${FEATURE_PROFILE})
+  set(FEATURE_PROFILE "${CMAKE_CURRENT_SOURCE_DIR}/profiles/${FEATURE_PROFILE}.profile")
+endif()
+
+if(EXISTS ${FEATURE_PROFILE})
+  file(READ "${FEATURE_PROFILE}" PROFILE_SETTINGS)
+  string(REGEX REPLACE "^#.*$" "" PROFILE_SETTINGS "${PROFILE_SETTINGS}")
+  string(REGEX REPLACE "[\r|\n]" ";" PROFILE_SETTINGS "${PROFILE_SETTINGS}")
+  set(DEFINES_JERRY ${DEFINES_JERRY} ${PROFILE_SETTINGS})
+else()
+  message(FATAL_ERROR "Profile file: '${FEATURE_PROFILE}' doesn't exist!")
+endif()
+
+if(JERRY_LIBC AND FEATURE_SYSTEM_ALLOCATOR)
+  MESSAGE(FATAL_ERROR "This configuration is not supported. Please build against your system libc to enable the system allocator.")
+endif()
+
+# RegExp byte-code dumps
+if(FEATURE_REGEXP_DUMP)
+  set(DEFINES_JERRY ${DEFINES_JERRY} REGEXP_DUMP_BYTE_CODE)
+endif()
+
+# Snapshot exec
+if(FEATURE_SNAPSHOT_EXEC)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_ENABLE_SNAPSHOT_EXEC)
+endif()
+
+# Snapshot save
+if(FEATURE_SNAPSHOT_SAVE)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_ENABLE_SNAPSHOT_SAVE)
+endif()
+
+# Enable system allocator
+if(FEATURE_SYSTEM_ALLOCATOR)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_SYSTEM_ALLOCATOR)
+endif()
+
+# Valgrind
+if(FEATURE_VALGRIND)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_VALGRIND)
+  set(INCLUDE_CORE ${INCLUDE_CORE} ${INCLUDE_THIRD_PARTY_VALGRIND})
+endif()
+
+# Valgrind Freya
+if(FEATURE_VALGRIND_FREYA)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_VALGRIND_FREYA)
+  set(INCLUDE_CORE ${INCLUDE_CORE} ${INCLUDE_THIRD_PARTY_VALGRIND})
+endif()
+
+# Enable VM execution stopping
+if (FEATURE_VM_EXEC_STOP)
+  set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_VM_EXEC_STOP)
+endif()
+
+# Size of heap
+math(EXPR MEM_HEAP_AREA_SIZE "${MEM_HEAP_SIZE_KB} * 1024")
+set(DEFINES_JERRY ${DEFINES_JERRY} CONFIG_MEM_HEAP_AREA_SIZE=${MEM_HEAP_AREA_SIZE})
+
+add_library(${JERRY_CORE_NAME} STATIC ${SOURCE_CORE_FILES})
+
+target_compile_definitions(${JERRY_CORE_NAME} PUBLIC ${DEFINES_JERRY})
+target_include_directories(${JERRY_CORE_NAME} PUBLIC ${INCLUDE_CORE})
+
+if(JERRY_LIBM)
+  target_link_libraries(${JERRY_CORE_NAME} jerry-libm)
+endif()
+
+if(JERRY_LIBC)
+  target_link_libraries(${JERRY_CORE_NAME} jerry-libc)
+endif()
+
+separate_arguments(EXTERNAL_LINK_LIBS)
+foreach(EXT_LIB ${EXTERNAL_LINK_LIBS})
+  target_link_libraries(${JERRY_CORE_NAME} ${EXT_LIB})
+endforeach()
+
+install(TARGETS ${JERRY_CORE_NAME} DESTINATION lib)
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include)
diff --git a/deps/jerry/jerry-core/api/jerry-debugger.c b/deps/jerry/jerry-core/api/jerry-debugger.c
new file mode 100644 (file)
index 0000000..0338c3c
--- /dev/null
@@ -0,0 +1,118 @@
+/* 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.
+ */
+
+#include "debugger.h"
+#include "jcontext.h"
+#include "jerryscript.h"
+
+/**
+ * Checks whether the debugger is connected.
+ *
+ * @return true - if the debugger is connected
+ *         false - otherwise
+ */
+bool
+jerry_debugger_is_connected (void)
+{
+#ifdef JERRY_DEBUGGER
+  return JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED;
+#else
+  return false;
+#endif /* JERRY_DEBUGGER */
+} /* jerry_debugger_is_connected */
+
+/**
+ * Stop execution at the next available breakpoint.
+ */
+void
+jerry_debugger_stop (void)
+{
+#ifdef JERRY_DEBUGGER
+  if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+      && !(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_BREAKPOINT_MODE))
+  {
+    JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) | JERRY_DEBUGGER_VM_STOP);
+    JERRY_CONTEXT (debugger_stop_context) = NULL;
+  }
+#endif /* JERRY_DEBUGGER */
+} /* jerry_debugger_stop */
+
+/**
+ * Continue execution.
+ */
+void
+jerry_debugger_continue (void)
+{
+#ifdef JERRY_DEBUGGER
+  if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+      && !(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_BREAKPOINT_MODE))
+  {
+    JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) & ~JERRY_DEBUGGER_VM_STOP);
+    JERRY_CONTEXT (debugger_stop_context) = NULL;
+  }
+#endif /* JERRY_DEBUGGER */
+} /* jerry_debugger_continue */
+
+/**
+ * Sets whether the engine should stop at breakpoints.
+ */
+void
+jerry_debugger_stop_at_breakpoint (bool enable_stop_at_breakpoint) /**< enable/disable stop at breakpoint */
+{
+#ifdef JERRY_DEBUGGER
+  if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED
+      && !(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_BREAKPOINT_MODE))
+  {
+    if (enable_stop_at_breakpoint)
+    {
+      JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) | JERRY_DEBUGGER_VM_IGNORE);
+    }
+    else
+    {
+      JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) & ~JERRY_DEBUGGER_VM_IGNORE);
+    }
+  }
+#else /* !JERRY_DEBUGGER */
+  JERRY_UNUSED (enable_stop_at_breakpoint);
+#endif /* JERRY_DEBUGGER */
+} /* jerry_debugger_stop_at_breakpoint */
+
+/**
+ * Debugger server initialization. Must be called after jerry_init.
+ */
+void
+jerry_debugger_init (uint16_t port) /**< server port number */
+{
+#ifdef JERRY_DEBUGGER
+  JERRY_CONTEXT (debugger_port) = port;
+  jerry_debugger_accept_connection ();
+#else /* !JERRY_DEBUGGER */
+  JERRY_UNUSED (port);
+#endif /* JERRY_DEBUGGER */
+} /* jerry_debugger_init */
+
+/**
+ * Debugger server shutdown. Must be called before jerry_cleanup.
+ */
+void
+jerry_debugger_cleanup (void)
+{
+#ifdef JERRY_DEBUGGER
+  if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+  {
+    jerry_debugger_close_connection ();
+  }
+#endif /* JERRY_DEBUGGER */
+} /* jerry_debugger_cleanup */
diff --git a/deps/jerry/jerry-core/api/jerry-snapshot.c b/deps/jerry/jerry-core/api/jerry-snapshot.c
new file mode 100644 (file)
index 0000000..fd1d3bd
--- /dev/null
@@ -0,0 +1,1074 @@
+/* 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.
+ */
+
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-helpers.h"
+#include "ecma-literal-storage.h"
+#include "jcontext.h"
+#include "jerryscript.h"
+#include "jerry-snapshot.h"
+#include "js-parser.h"
+#include "lit-char-helpers.h"
+#include "re-compiler.h"
+
+#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
+
+/**
+ * Variables required to take a snapshot.
+ */
+typedef struct
+{
+  bool snapshot_error_occured;
+  size_t snapshot_buffer_write_offset;
+} snapshot_globals_t;
+
+/** \addtogroup jerrysnapshot Jerry snapshot operations
+ * @{
+ */
+
+/**
+ * Write data into the specified buffer.
+ *
+ * Note:
+ *      Offset is in-out and is incremented if the write operation completes successfully.
+ *
+ * @return true - if write was successful, i.e. offset + data_size doesn't exceed buffer size,
+ *         false - otherwise
+ */
+static inline bool __attr_always_inline___
+snapshot_write_to_buffer_by_offset (uint8_t *buffer_p, /**< buffer */
+                                    size_t buffer_size, /**< size of buffer */
+                                    size_t *in_out_buffer_offset_p,  /**< [in,out] offset to write to
+                                                                      * incremented with data_size */
+                                    const void *data_p, /**< data */
+                                    size_t data_size) /**< size of the writable data */
+{
+  if (*in_out_buffer_offset_p + data_size > buffer_size)
+  {
+    return false;
+  }
+
+  memcpy (buffer_p + *in_out_buffer_offset_p, data_p, data_size);
+  *in_out_buffer_offset_p += data_size;
+
+  return true;
+} /* snapshot_write_to_buffer_by_offset */
+
+/**
+ * Snapshot callback for byte codes.
+ *
+ * @return start offset
+ */
+static uint16_t
+snapshot_add_compiled_code (ecma_compiled_code_t *compiled_code_p, /**< compiled code */
+                            uint8_t *snapshot_buffer_p, /**< snapshot buffer */
+                            size_t snapshot_buffer_size, /**< snapshot buffer size */
+                            snapshot_globals_t *globals_p) /**< snapshot globals */
+{
+  if (globals_p->snapshot_error_occured)
+  {
+    return 0;
+  }
+
+  JERRY_ASSERT ((globals_p->snapshot_buffer_write_offset & (JMEM_ALIGNMENT - 1)) == 0);
+
+  if ((globals_p->snapshot_buffer_write_offset >> JMEM_ALIGNMENT_LOG) > 0xffffu)
+  {
+    globals_p->snapshot_error_occured = true;
+    return 0;
+  }
+
+  uint16_t start_offset = (uint16_t) (globals_p->snapshot_buffer_write_offset >> JMEM_ALIGNMENT_LOG);
+
+  uint8_t *copied_code_start_p = snapshot_buffer_p + globals_p->snapshot_buffer_write_offset;
+  ecma_compiled_code_t *copied_code_p = (ecma_compiled_code_t *) copied_code_start_p;
+
+  if (!(compiled_code_p->status_flags & CBC_CODE_FLAGS_FUNCTION))
+  {
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+    /* Regular expression. */
+    if (globals_p->snapshot_buffer_write_offset + sizeof (ecma_compiled_code_t) > snapshot_buffer_size)
+    {
+      globals_p->snapshot_error_occured = true;
+      return 0;
+    }
+
+    globals_p->snapshot_buffer_write_offset += sizeof (ecma_compiled_code_t);
+
+    jmem_cpointer_t pattern_cp = ((re_compiled_code_t *) compiled_code_p)->pattern_cp;
+    ecma_string_t *pattern_string_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                 pattern_cp);
+
+    ecma_length_t pattern_size = 0;
+
+    ECMA_STRING_TO_UTF8_STRING (pattern_string_p, buffer_p, buffer_size);
+
+    pattern_size = buffer_size;
+
+    if (!snapshot_write_to_buffer_by_offset (snapshot_buffer_p,
+                                             snapshot_buffer_size,
+                                             &globals_p->snapshot_buffer_write_offset,
+                                             buffer_p,
+                                             buffer_size))
+    {
+      globals_p->snapshot_error_occured = true;
+    }
+
+    ECMA_FINALIZE_UTF8_STRING (buffer_p, buffer_size);
+
+    globals_p->snapshot_buffer_write_offset = JERRY_ALIGNUP (globals_p->snapshot_buffer_write_offset,
+                                                             JMEM_ALIGNMENT);
+
+    /* Regexp character size is stored in refs. */
+    copied_code_p->refs = (uint16_t) pattern_size;
+
+    pattern_size += (ecma_length_t) sizeof (ecma_compiled_code_t);
+    copied_code_p->size = (uint16_t) ((pattern_size + JMEM_ALIGNMENT - 1) >> JMEM_ALIGNMENT_LOG);
+
+    copied_code_p->status_flags = compiled_code_p->status_flags;
+
+#else /* CONFIG_DISABLE_REGEXP_BUILTIN */
+    JERRY_UNREACHABLE (); /* RegExp is not supported in the selected profile. */
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+    return start_offset;
+  }
+
+  if (!snapshot_write_to_buffer_by_offset (snapshot_buffer_p,
+                                           snapshot_buffer_size,
+                                           &globals_p->snapshot_buffer_write_offset,
+                                           compiled_code_p,
+                                           ((size_t) compiled_code_p->size) << JMEM_ALIGNMENT_LOG))
+  {
+    globals_p->snapshot_error_occured = true;
+    return 0;
+  }
+
+  /* Sub-functions and regular expressions are stored recursively. */
+  uint8_t *src_buffer_p = (uint8_t *) compiled_code_p;
+  uint8_t *dst_buffer_p = (uint8_t *) copied_code_p;
+  jmem_cpointer_t *src_literal_start_p;
+  jmem_cpointer_t *dst_literal_start_p;
+  uint32_t const_literal_end;
+  uint32_t literal_end;
+
+  if (compiled_code_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    src_literal_start_p = (jmem_cpointer_t *) (src_buffer_p + sizeof (cbc_uint16_arguments_t));
+    dst_literal_start_p = (jmem_cpointer_t *) (dst_buffer_p + sizeof (cbc_uint16_arguments_t));
+
+    cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) src_buffer_p;
+    literal_end = args_p->literal_end;
+    const_literal_end = args_p->const_literal_end;
+  }
+  else
+  {
+    src_literal_start_p = (jmem_cpointer_t *) (src_buffer_p + sizeof (cbc_uint8_arguments_t));
+    dst_literal_start_p = (jmem_cpointer_t *) (dst_buffer_p + sizeof (cbc_uint8_arguments_t));
+
+    cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) src_buffer_p;
+    literal_end = args_p->literal_end;
+    const_literal_end = args_p->const_literal_end;
+  }
+
+  for (uint32_t i = const_literal_end; i < literal_end; i++)
+  {
+    ecma_compiled_code_t *bytecode_p = ECMA_GET_NON_NULL_POINTER (ecma_compiled_code_t,
+                                                                  src_literal_start_p[i]);
+
+    if (bytecode_p == compiled_code_p)
+    {
+      dst_literal_start_p[i] = start_offset;
+    }
+    else
+    {
+      dst_literal_start_p[i] = snapshot_add_compiled_code (bytecode_p,
+                                                           snapshot_buffer_p,
+                                                           snapshot_buffer_size,
+                                                           globals_p);
+    }
+  }
+
+  return start_offset;
+} /* snapshot_add_compiled_code */
+
+/**
+ * Set the uint16_t offsets in the code area.
+ */
+static void
+jerry_snapshot_set_offsets (uint32_t *buffer_p, /**< buffer */
+                            uint32_t size, /**< buffer size */
+                            lit_mem_to_snapshot_id_map_entry_t *lit_map_p) /**< literal map */
+{
+  JERRY_ASSERT (size > 0);
+
+  do
+  {
+    ecma_compiled_code_t *bytecode_p = (ecma_compiled_code_t *) buffer_p;
+    uint32_t code_size = ((uint32_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG;
+
+    if (bytecode_p->status_flags & CBC_CODE_FLAGS_FUNCTION)
+    {
+      jmem_cpointer_t *literal_start_p;
+      uint32_t argument_end;
+      uint32_t register_end;
+      uint32_t const_literal_end;
+
+      if (bytecode_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+      {
+        literal_start_p = (jmem_cpointer_t *) (((uint8_t *) buffer_p) + sizeof (cbc_uint16_arguments_t));
+
+        cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) buffer_p;
+        argument_end = args_p->argument_end;
+        register_end = args_p->register_end;
+        const_literal_end = args_p->const_literal_end;
+      }
+      else
+      {
+        literal_start_p = (jmem_cpointer_t *) (((uint8_t *) buffer_p) + sizeof (cbc_uint8_arguments_t));
+
+        cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) buffer_p;
+        argument_end = args_p->argument_end;
+        register_end = args_p->register_end;
+        const_literal_end = args_p->const_literal_end;
+      }
+
+      uint32_t register_clear_start = 0;
+
+      if ((bytecode_p->status_flags & CBC_CODE_FLAGS_ARGUMENTS_NEEDED)
+          && !(bytecode_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE))
+      {
+        for (uint32_t i = 0; i < argument_end; i++)
+        {
+          lit_mem_to_snapshot_id_map_entry_t *current_p = lit_map_p;
+
+          if (literal_start_p[i] != JMEM_CP_NULL)
+          {
+            while (current_p->literal_id != literal_start_p[i])
+            {
+              current_p++;
+            }
+
+            literal_start_p[i] = current_p->literal_offset;
+          }
+        }
+
+        register_clear_start = argument_end;
+      }
+
+      for (uint32_t i = register_clear_start; i < register_end; i++)
+      {
+        literal_start_p[i] = JMEM_CP_NULL;
+      }
+
+      for (uint32_t i = register_end; i < const_literal_end; i++)
+      {
+        lit_mem_to_snapshot_id_map_entry_t *current_p = lit_map_p;
+
+        if (literal_start_p[i] != JMEM_CP_NULL)
+        {
+          while (current_p->literal_id != literal_start_p[i])
+          {
+            current_p++;
+          }
+
+          literal_start_p[i] = current_p->literal_offset;
+        }
+      }
+
+      /* Set reference counter to 1. */
+      bytecode_p->refs = 1;
+    }
+
+    JERRY_ASSERT ((code_size % sizeof (uint32_t)) == 0);
+    buffer_p += code_size / sizeof (uint32_t);
+    size -= code_size;
+  }
+  while (size > 0);
+} /* jerry_snapshot_set_offsets */
+
+#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
+
+#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
+
+/**
+ * Byte code blocks shorter than this threshold are always copied into the memory.
+ * The memory / performance trade-of of byte code redirection does not worth
+ * in such cases.
+ */
+#define BYTECODE_NO_COPY_THRESHOLD 8
+
+/**
+ * Load byte code from snapshot.
+ *
+ * @return byte code
+ */
+static ecma_compiled_code_t *
+snapshot_load_compiled_code (const uint8_t *snapshot_data_p, /**< snapshot data */
+                             size_t offset, /**< byte code offset */
+                             lit_mem_to_snapshot_id_map_entry_t *lit_map_p, /**< literal map */
+                             bool copy_bytecode) /**< byte code should be copied to memory */
+{
+  ecma_compiled_code_t *bytecode_p = (ecma_compiled_code_t *) (snapshot_data_p + offset);
+  uint32_t code_size = ((uint32_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG;
+
+  if (!(bytecode_p->status_flags & CBC_CODE_FLAGS_FUNCTION))
+  {
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+    const re_compiled_code_t *re_bytecode_p = NULL;
+
+    const uint8_t *regex_start_p = ((const uint8_t *) bytecode_p) + sizeof (ecma_compiled_code_t);
+
+    /* Real size is stored in refs. */
+    ecma_string_t *pattern_str_p = ecma_new_ecma_string_from_utf8 (regex_start_p,
+                                                                   bytecode_p->refs);
+
+    re_compile_bytecode (&re_bytecode_p,
+                         pattern_str_p,
+                         bytecode_p->status_flags);
+
+    ecma_deref_ecma_string (pattern_str_p);
+
+    return (ecma_compiled_code_t *) re_bytecode_p;
+#else /* CONFIG_DISABLE_REGEXP_BUILTIN */
+    JERRY_UNREACHABLE (); /* RegExp is not supported in the selected profile. */
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+  }
+
+  size_t header_size;
+  uint32_t literal_end;
+  uint32_t const_literal_end;
+
+  if (bytecode_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    uint8_t *byte_p = (uint8_t *) bytecode_p;
+    cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) byte_p;
+    literal_end = args_p->literal_end;
+    const_literal_end = args_p->const_literal_end;
+    header_size = sizeof (cbc_uint16_arguments_t);
+  }
+  else
+  {
+    uint8_t *byte_p = (uint8_t *) bytecode_p;
+    cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) byte_p;
+    literal_end = args_p->literal_end;
+    const_literal_end = args_p->const_literal_end;
+    header_size = sizeof (cbc_uint8_arguments_t);
+  }
+
+  if (copy_bytecode
+      || (header_size + (literal_end * sizeof (uint16_t)) + BYTECODE_NO_COPY_THRESHOLD > code_size))
+  {
+    bytecode_p = (ecma_compiled_code_t *) jmem_heap_alloc_block (code_size);
+
+#ifdef JMEM_STATS
+    jmem_stats_allocate_byte_code_bytes (code_size);
+#endif /* JMEM_STATS */
+
+    memcpy (bytecode_p, snapshot_data_p + offset, code_size);
+  }
+  else
+  {
+    code_size = (uint32_t) (header_size + literal_end * sizeof (jmem_cpointer_t));
+
+    uint8_t *real_bytecode_p = ((uint8_t *) bytecode_p) + code_size;
+    uint32_t total_size = JERRY_ALIGNUP (code_size + 1 + sizeof (uint8_t *), JMEM_ALIGNMENT);
+
+    bytecode_p = (ecma_compiled_code_t *) jmem_heap_alloc_block (total_size);
+
+#ifdef JMEM_STATS
+    jmem_stats_allocate_byte_code_bytes (total_size);
+#endif /* JMEM_STATS */
+
+    memcpy (bytecode_p, snapshot_data_p + offset, code_size);
+
+    bytecode_p->size = (uint16_t) (total_size >> JMEM_ALIGNMENT_LOG);
+
+    uint8_t *instructions_p = ((uint8_t *) bytecode_p);
+
+    instructions_p[code_size] = CBC_SET_BYTECODE_PTR;
+    memcpy (instructions_p + code_size + 1, &real_bytecode_p, sizeof (uint8_t *));
+  }
+
+  JERRY_ASSERT (bytecode_p->refs == 1);
+
+#ifdef JERRY_DEBUGGER
+  bytecode_p->status_flags = (uint16_t) (bytecode_p->status_flags | CBC_CODE_FLAGS_DEBUGGER_IGNORE);
+#endif /* JERRY_DEBUGGER */
+
+  jmem_cpointer_t *literal_start_p = (jmem_cpointer_t *) (((uint8_t *) bytecode_p) + header_size);
+
+  for (uint32_t i = 0; i < const_literal_end; i++)
+  {
+    lit_mem_to_snapshot_id_map_entry_t *current_p = lit_map_p;
+
+    if (literal_start_p[i] != 0)
+    {
+      while (current_p->literal_offset != literal_start_p[i])
+      {
+        current_p++;
+      }
+
+      literal_start_p[i] = current_p->literal_id;
+    }
+  }
+
+  for (uint32_t i = const_literal_end; i < literal_end; i++)
+  {
+    size_t literal_offset = ((size_t) literal_start_p[i]) << JMEM_ALIGNMENT_LOG;
+
+    if (literal_offset == offset)
+    {
+      /* Self reference */
+      ECMA_SET_NON_NULL_POINTER (literal_start_p[i],
+                                 bytecode_p);
+    }
+    else
+    {
+      ecma_compiled_code_t *literal_bytecode_p;
+      literal_bytecode_p = snapshot_load_compiled_code (snapshot_data_p,
+                                                        literal_offset,
+                                                        lit_map_p,
+                                                        copy_bytecode);
+
+      ECMA_SET_NON_NULL_POINTER (literal_start_p[i],
+                                 literal_bytecode_p);
+    }
+  }
+
+  return bytecode_p;
+} /* snapshot_load_compiled_code */
+
+#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
+
+/**
+ * Generate snapshot from specified source
+ *
+ * @return size of snapshot, if it was generated succesfully
+ *          (i.e. there are no syntax errors in source code, buffer size is sufficient,
+ *           and snapshot support is enabled in current configuration through JERRY_ENABLE_SNAPSHOT_SAVE),
+ *         0 - otherwise.
+ */
+size_t
+jerry_parse_and_save_snapshot (const jerry_char_t *source_p, /**< script source */
+                               size_t source_size, /**< script source size */
+                               bool is_for_global, /**< snapshot would be executed as global (true)
+                                                    *   or eval (false) */
+                               bool is_strict, /**< strict mode */
+                               uint32_t *buffer_p, /**< buffer to save snapshot to */
+                               size_t buffer_size) /**< the buffer's size */
+{
+#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
+  snapshot_globals_t globals;
+  ecma_value_t parse_status;
+  ecma_compiled_code_t *bytecode_data_p;
+
+  globals.snapshot_buffer_write_offset = JERRY_ALIGNUP (sizeof (jerry_snapshot_header_t),
+                                                        JMEM_ALIGNMENT);
+  globals.snapshot_error_occured = false;
+
+  parse_status = parser_parse_script (source_p,
+                                      source_size,
+                                      is_strict,
+                                      &bytecode_data_p);
+
+  if (ECMA_IS_VALUE_ERROR (parse_status))
+  {
+    ecma_free_value (parse_status);
+    return 0;
+  }
+
+  snapshot_add_compiled_code (bytecode_data_p, (uint8_t *) buffer_p, buffer_size, &globals);
+
+  if (globals.snapshot_error_occured)
+  {
+    return 0;
+  }
+
+  jerry_snapshot_header_t header;
+  header.version = JERRY_SNAPSHOT_VERSION;
+  header.lit_table_offset = (uint32_t) globals.snapshot_buffer_write_offset;
+  header.is_run_global = is_for_global;
+
+  lit_mem_to_snapshot_id_map_entry_t *lit_map_p = NULL;
+  uint32_t literals_num;
+
+  if (!ecma_save_literals_for_snapshot (buffer_p,
+                                        buffer_size,
+                                        &globals.snapshot_buffer_write_offset,
+                                        &lit_map_p,
+                                        &literals_num,
+                                        &header.lit_table_size))
+  {
+    JERRY_ASSERT (lit_map_p == NULL);
+    return 0;
+  }
+
+  jerry_snapshot_set_offsets (buffer_p + (JERRY_ALIGNUP (sizeof (jerry_snapshot_header_t),
+                                                         JMEM_ALIGNMENT) / sizeof (uint32_t)),
+                              (uint32_t) (header.lit_table_offset - sizeof (jerry_snapshot_header_t)),
+                              lit_map_p);
+
+  size_t header_offset = 0;
+
+  snapshot_write_to_buffer_by_offset ((uint8_t *) buffer_p,
+                                      buffer_size,
+                                      &header_offset,
+                                      &header,
+                                      sizeof (header));
+
+  if (lit_map_p != NULL)
+  {
+    jmem_heap_free_block (lit_map_p, literals_num * sizeof (lit_mem_to_snapshot_id_map_entry_t));
+  }
+
+  ecma_bytecode_deref (bytecode_data_p);
+
+  return globals.snapshot_buffer_write_offset;
+#else /* !JERRY_ENABLE_SNAPSHOT_SAVE */
+  JERRY_UNUSED (source_p);
+  JERRY_UNUSED (source_size);
+  JERRY_UNUSED (is_for_global);
+  JERRY_UNUSED (is_strict);
+  JERRY_UNUSED (buffer_p);
+  JERRY_UNUSED (buffer_size);
+
+  return 0;
+#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
+} /* jerry_parse_and_save_snapshot */
+
+/**
+ * Execute snapshot from specified buffer
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return result of bytecode - if run was successful
+ *         thrown error - otherwise
+ */
+jerry_value_t
+jerry_exec_snapshot (const uint32_t *snapshot_p, /**< snapshot */
+                     size_t snapshot_size, /**< size of snapshot */
+                     bool copy_bytecode) /**< flag, indicating whether the passed snapshot
+                                          *   buffer should be copied to the engine's memory.
+                                          *   If set the engine should not reference the buffer
+                                          *   after the function returns (in this case, the passed
+                                          *   buffer could be freed after the call).
+                                          *   Otherwise (if the flag is not set) - the buffer could only be
+                                          *   freed after the engine stops (i.e. after call to jerry_cleanup). */
+{
+#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
+  JERRY_ASSERT (snapshot_p != NULL);
+
+  static const char * const invalid_version_error_p = "Invalid snapshot version";
+  static const char * const invalid_format_error_p = "Invalid snapshot format";
+  const uint8_t *snapshot_data_p = (uint8_t *) snapshot_p;
+
+  if (snapshot_size <= sizeof (jerry_snapshot_header_t))
+  {
+    return ecma_raise_type_error (invalid_format_error_p);
+  }
+
+  const jerry_snapshot_header_t *header_p = (const jerry_snapshot_header_t *) snapshot_data_p;
+
+  if (header_p->version != JERRY_SNAPSHOT_VERSION)
+  {
+    return ecma_raise_type_error (invalid_version_error_p);
+  }
+
+  lit_mem_to_snapshot_id_map_entry_t *lit_map_p = NULL;
+  uint32_t literals_num;
+
+  if (header_p->lit_table_offset >= snapshot_size)
+  {
+    return ecma_raise_type_error (invalid_version_error_p);
+  }
+
+  JERRY_ASSERT ((header_p->lit_table_offset % sizeof (uint32_t)) == 0);
+  if (!ecma_load_literals_from_snapshot ((uint32_t *) (snapshot_data_p + header_p->lit_table_offset),
+                                         header_p->lit_table_size,
+                                         &lit_map_p,
+                                         &literals_num))
+  {
+    JERRY_ASSERT (lit_map_p == NULL);
+    return ecma_raise_type_error (invalid_format_error_p);
+  }
+
+  ecma_compiled_code_t *bytecode_p;
+  bytecode_p = snapshot_load_compiled_code (snapshot_data_p,
+                                            sizeof (jerry_snapshot_header_t),
+                                            lit_map_p,
+                                            copy_bytecode);
+
+  if (lit_map_p != NULL)
+  {
+    jmem_heap_free_block (lit_map_p, literals_num * sizeof (lit_mem_to_snapshot_id_map_entry_t));
+  }
+
+  if (bytecode_p == NULL)
+  {
+    return ecma_raise_type_error (invalid_format_error_p);
+  }
+
+  ecma_value_t ret_val;
+
+  if (header_p->is_run_global)
+  {
+    ret_val = vm_run_global (bytecode_p);
+    ecma_bytecode_deref (bytecode_p);
+  }
+  else
+  {
+    ret_val = vm_run_eval (bytecode_p, false);
+  }
+
+  return ret_val;
+#else /* !JERRY_ENABLE_SNAPSHOT_EXEC */
+  JERRY_UNUSED (snapshot_p);
+  JERRY_UNUSED (snapshot_size);
+  JERRY_UNUSED (copy_bytecode);
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
+} /* jerry_exec_snapshot */
+
+/**
+ * @}
+ */
+
+#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
+
+/**
+ * ====================== Functions for literal saving ==========================
+ */
+
+/**
+ * Compare two ecma_strings by size, then lexicographically.
+ *
+ * @return true - if the first string is less than the second one,
+ *         false - otherwise
+ */
+static bool
+jerry_save_literals_compare (ecma_string_t *literal1, /**< first literal */
+                             ecma_string_t *literal2) /**< second literal */
+{
+  const lit_utf8_size_t lit1_size = ecma_string_get_size (literal1);
+  const lit_utf8_size_t lit2_size = ecma_string_get_size (literal2);
+
+  if (lit1_size == lit2_size)
+  {
+    return ecma_compare_ecma_strings_relational (literal1, literal2);
+  }
+
+  return (lit1_size < lit2_size);
+} /* jerry_save_literals_compare */
+
+/**
+ * Helper function for the heapsort algorithm.
+ *
+ * @return index of the maximum value
+ */
+static lit_utf8_size_t
+jerry_save_literals_heap_max (ecma_string_t *literals[], /**< array of literals */
+                              lit_utf8_size_t num_of_nodes, /**< number of nodes */
+                              lit_utf8_size_t node_idx, /**< index of parent node */
+                              lit_utf8_size_t child_idx1, /**< index of the first child */
+                              lit_utf8_size_t child_idx2) /**< index of the second child */
+{
+  lit_utf8_size_t max_idx = node_idx;
+
+  if (child_idx1 < num_of_nodes
+      && jerry_save_literals_compare (literals[max_idx], literals[child_idx1]))
+  {
+    max_idx = child_idx1;
+  }
+
+  if (child_idx2 < num_of_nodes
+      && jerry_save_literals_compare (literals[max_idx], literals[child_idx2]))
+  {
+    max_idx = child_idx2;
+  }
+
+  return max_idx;
+} /* jerry_save_literals_heap_max */
+
+/**
+ * Helper function for the heapsort algorithm.
+ */
+static void
+jerry_save_literals_down_heap (ecma_string_t *literals[], /**< array of literals */
+                               lit_utf8_size_t num_of_nodes, /**< number of nodes */
+                               lit_utf8_size_t node_idx) /**< index of parent node */
+{
+  while (true)
+  {
+    lit_utf8_size_t max_idx = jerry_save_literals_heap_max (literals,
+                                                            num_of_nodes,
+                                                            node_idx,
+                                                            2 * node_idx + 1,
+                                                            2 * node_idx + 2);
+    if (max_idx == node_idx)
+    {
+      break;
+    }
+
+    ecma_string_t *tmp_str_p  = literals[node_idx];
+    literals[node_idx] = literals[max_idx];
+    literals[max_idx] = tmp_str_p;
+
+    node_idx = max_idx;
+  }
+} /* jerry_save_literals_down_heap */
+
+/**
+ * Helper function for a heapsort algorithm.
+ */
+static void
+jerry_save_literals_sort (ecma_string_t *literals[], /**< array of literals */
+                          lit_utf8_size_t num_of_literals) /**< number of literals */
+{
+  if (num_of_literals < 2)
+  {
+    return;
+  }
+
+  lit_utf8_size_t lit_idx = (num_of_literals - 2) / 2;
+
+  while (lit_idx <= (num_of_literals - 2) / 2)
+  {
+    jerry_save_literals_down_heap (literals, num_of_literals, lit_idx--);
+  }
+
+  for (lit_idx = 0; lit_idx < num_of_literals; lit_idx++)
+  {
+    const lit_utf8_size_t last_idx = num_of_literals - lit_idx - 1;
+
+    ecma_string_t *tmp_str_p = literals[last_idx];
+    literals[last_idx] = literals[0];
+    literals[0] = tmp_str_p;
+
+    jerry_save_literals_down_heap (literals, last_idx, 0);
+  }
+} /* jerry_save_literals_sort */
+
+/**
+ * Append characters to the specified buffer.
+ *
+ * @return the position of the buffer pointer after copy.
+ */
+static uint8_t *
+jerry_append_chars_to_buffer (uint8_t *buffer_p, /**< buffer */
+                              uint8_t *buffer_end_p, /**< the end of the buffer */
+                              const char *chars, /**< string */
+                              lit_utf8_size_t string_size) /**< string size */
+{
+  if (buffer_p > buffer_end_p)
+  {
+    return buffer_p;
+  }
+
+  if (string_size == 0)
+  {
+    string_size = (lit_utf8_size_t) strlen (chars);
+  }
+
+  if (buffer_p + string_size <= buffer_end_p)
+  {
+    memcpy ((char *) buffer_p, chars, string_size);
+
+    return buffer_p + string_size;
+  }
+
+  /* Move the pointer behind the buffer to prevent further writes. */
+  return buffer_end_p + 1;
+} /* jerry_append_chars_to_buffer */
+
+/**
+ * Append an ecma-string to the specified buffer.
+ *
+ * @return the position of the buffer pointer after copy.
+ */
+static uint8_t *
+jerry_append_ecma_string_to_buffer (uint8_t *buffer_p, /**< buffer */
+                                    uint8_t *buffer_end_p, /**< the end of the buffer */
+                                    ecma_string_t *string_p) /**< ecma-string */
+{
+  uint8_t *new_buffer_p = NULL;
+
+  ECMA_STRING_TO_UTF8_STRING (string_p, str_buffer_p, str_buffer_size);
+
+  /* Append the string to the buffer. */
+  new_buffer_p = jerry_append_chars_to_buffer (buffer_p,
+                                               buffer_end_p,
+                                               (const char *) str_buffer_p,
+                                               str_buffer_size);
+
+  ECMA_FINALIZE_UTF8_STRING (str_buffer_p, str_buffer_size);
+
+  return new_buffer_p;
+} /* jerry_append_ecma_string_to_buffer */
+
+/**
+ * Append an unsigned number to the specified buffer.
+ *
+ * @return the position of the buffer pointer after copy.
+ */
+static uint8_t *
+jerry_append_number_to_buffer (uint8_t *buffer_p, /**< buffer */
+                               uint8_t *buffer_end_p, /**< the end of the buffer */
+                               lit_utf8_size_t number) /**< number */
+{
+  lit_utf8_byte_t uint32_to_str_buffer[ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32];
+  lit_utf8_size_t utf8_str_size = ecma_uint32_to_utf8_string (number,
+                                                              uint32_to_str_buffer,
+                                                              ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32);
+
+  JERRY_ASSERT (utf8_str_size <= ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32);
+
+  return jerry_append_chars_to_buffer (buffer_p,
+                                       buffer_end_p,
+                                       (const char *) uint32_to_str_buffer,
+                                       utf8_str_size);
+} /* jerry_append_number_to_buffer */
+
+/**
+ * Check whether the passed ecma-string is a valid identifier.
+ *
+ * @return true - if the ecma-string is a valid identifier,
+ *         false - otherwise
+ */
+static bool
+ecma_string_is_valid_identifier (const ecma_string_t *string_p)
+{
+  bool result = false;
+
+  ECMA_STRING_TO_UTF8_STRING (string_p, str_buffer_p, str_buffer_size);
+
+  if (lit_char_is_identifier_start (str_buffer_p))
+  {
+    const uint8_t *str_start_p = str_buffer_p;
+    const uint8_t *str_end_p = str_buffer_p + str_buffer_size;
+
+    result = true;
+
+    while (str_start_p < str_end_p)
+    {
+      if (!lit_char_is_identifier_part (str_start_p))
+      {
+        result = false;
+        break;
+      }
+      lit_utf8_incr (&str_start_p);
+    }
+  }
+
+  ECMA_FINALIZE_UTF8_STRING (str_buffer_p, str_buffer_size);
+
+  return result;
+} /* ecma_string_is_valid_identifier */
+
+#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
+
+/**
+ * Copy certain string literals into the given buffer in a specified format,
+ * which are valid identifiers and none of them are magic string.
+ *
+ * @return size of the literal-list in bytes, at most equal to the buffer size,
+ *         if the source parsed successfully and the list of the literals isn't empty,
+ *         0 - otherwise.
+ */
+size_t
+jerry_parse_and_save_literals (const jerry_char_t *source_p, /**< script source */
+                               size_t source_size, /**< script source size */
+                               bool is_strict, /**< strict mode */
+                               uint32_t *buffer_p, /**< [out] buffer to save literals to */
+                               size_t buffer_size, /**< the buffer's size */
+                               bool is_c_format) /**< format-flag */
+{
+#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
+  ecma_value_t parse_status;
+  ecma_compiled_code_t *bytecode_data_p;
+  parse_status = parser_parse_script (source_p,
+                                      source_size,
+                                      is_strict,
+                                      &bytecode_data_p);
+
+  const bool error = ECMA_IS_VALUE_ERROR (parse_status);
+  ecma_free_value (parse_status);
+
+  if (error)
+  {
+    return 0;
+  }
+
+  ecma_bytecode_deref (bytecode_data_p);
+
+  ecma_lit_storage_item_t *string_list_p = JERRY_CONTEXT (string_list_first_p);
+  lit_utf8_size_t literal_count = 0;
+
+  /* Count the valid and non-magic identifiers in the list. */
+  while (string_list_p != NULL)
+  {
+    for (int i = 0; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+    {
+      if (string_list_p->values[i] != JMEM_CP_NULL)
+      {
+        ecma_string_t *literal_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                 string_list_p->values[i]);
+        /* We don't save a literal which isn't a valid identifier
+           or it's a magic string. */
+        if (ecma_get_string_magic (literal_p) == LIT_MAGIC_STRING__COUNT
+            && ecma_string_is_valid_identifier (literal_p))
+        {
+          literal_count++;
+        }
+      }
+    }
+
+    string_list_p = JMEM_CP_GET_POINTER (ecma_lit_storage_item_t, string_list_p->next_cp);
+  }
+
+  if (literal_count == 0)
+  {
+    return 0;
+  }
+
+  uint8_t *destination_p = (uint8_t *) buffer_p;
+
+  uint8_t *const buffer_start_p = destination_p;
+  uint8_t *const buffer_end_p = destination_p + buffer_size;
+
+  JMEM_DEFINE_LOCAL_ARRAY (literal_array, literal_count, ecma_string_t *);
+  lit_utf8_size_t literal_idx = 0;
+
+  string_list_p = JERRY_CONTEXT (string_list_first_p);
+
+  while (string_list_p != NULL)
+  {
+    for (int i = 0; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+    {
+      if (string_list_p->values[i] != JMEM_CP_NULL)
+      {
+        ecma_string_t *literal_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                 string_list_p->values[i]);
+
+        if (ecma_get_string_magic (literal_p) == LIT_MAGIC_STRING__COUNT
+            && ecma_string_is_valid_identifier (literal_p))
+        {
+          literal_array[literal_idx++] = literal_p;
+        }
+      }
+    }
+
+    string_list_p = JMEM_CP_GET_POINTER (ecma_lit_storage_item_t, string_list_p->next_cp);
+  }
+
+  /* Sort the strings by size at first, then lexicographically. */
+  jerry_save_literals_sort (literal_array, literal_count);
+
+  if (is_c_format)
+  {
+    /* Save literal count. */
+    destination_p = jerry_append_chars_to_buffer (destination_p,
+                                                  buffer_end_p,
+                                                  (const char *) "jerry_length_t literal_count = ",
+                                                  0);
+
+    destination_p = jerry_append_number_to_buffer (destination_p, buffer_end_p, literal_count);
+
+    /* Save the array of literals. */
+    destination_p = jerry_append_chars_to_buffer (destination_p,
+                                                  buffer_end_p,
+                                                  ";\n\njerry_char_ptr_t literals[",
+                                                  0);
+
+    destination_p = jerry_append_number_to_buffer (destination_p, buffer_end_p, literal_count);
+    destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, "] =\n{\n", 0);
+
+    for (lit_utf8_size_t i = 0; i < literal_count; i++)
+    {
+      destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, "  \"", 0);
+      destination_p = jerry_append_ecma_string_to_buffer (destination_p, buffer_end_p, literal_array[i]);
+      destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, "\"", 0);
+
+      if (i < literal_count - 1)
+      {
+        destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, ",", 0);
+      }
+
+      destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, "\n", 0);
+    }
+
+    destination_p = jerry_append_chars_to_buffer (destination_p,
+                                                  buffer_end_p,
+                                                  (const char *) "};\n\njerry_length_t literal_sizes[",
+                                                  0);
+
+    destination_p = jerry_append_number_to_buffer (destination_p, buffer_end_p, literal_count);
+    destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, "] =\n{\n", 0);
+  }
+
+  /* Save the literal sizes respectively. */
+  for (lit_utf8_size_t i = 0; i < literal_count; i++)
+  {
+    lit_utf8_size_t str_size = ecma_string_get_size (literal_array[i]);
+
+    if (is_c_format)
+    {
+      destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, "  ", 0);
+    }
+
+    destination_p = jerry_append_number_to_buffer (destination_p, buffer_end_p, str_size);
+    destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, " ", 0);
+
+    if (is_c_format)
+    {
+      /* Show the given string as a comment. */
+      destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, "/* ", 0);
+      destination_p = jerry_append_ecma_string_to_buffer (destination_p, buffer_end_p, literal_array[i]);
+      destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, " */", 0);
+
+      if (i < literal_count - 1)
+      {
+        destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, ",", 0);
+      }
+    }
+    else
+    {
+      destination_p = jerry_append_ecma_string_to_buffer (destination_p, buffer_end_p, literal_array[i]);
+    }
+
+    destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, "\n", 0);
+  }
+
+  if (is_c_format)
+  {
+    destination_p = jerry_append_chars_to_buffer (destination_p, buffer_end_p, (const char *) "};\n", 0);
+  }
+
+  JMEM_FINALIZE_LOCAL_ARRAY (literal_array);
+
+  return destination_p <= buffer_end_p ? (size_t) (destination_p - buffer_start_p) : 0;
+#else /* !JERRY_ENABLE_SNAPSHOT_SAVE */
+  JERRY_UNUSED (source_p);
+  JERRY_UNUSED (source_size);
+  JERRY_UNUSED (is_strict);
+  JERRY_UNUSED (buffer_p);
+  JERRY_UNUSED (buffer_size);
+  JERRY_UNUSED (is_c_format);
+
+  return 0;
+#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
+} /* jerry_parse_and_save_literals */
diff --git a/deps/jerry/jerry-core/api/jerry-snapshot.h b/deps/jerry/jerry-core/api/jerry-snapshot.h
new file mode 100644 (file)
index 0000000..58555dd
--- /dev/null
@@ -0,0 +1,41 @@
+/* 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.
+ */
+
+#ifndef JERRY_SNAPSHOT_H
+#define JERRY_SNAPSHOT_H
+
+#include "ecma-globals.h"
+
+/**
+ * Snapshot header
+ */
+typedef struct
+{
+  /* The size of this structure is recommended to be divisible by
+   * JMEM_ALIGNMENT. Otherwise some bytes after the header are wasted. */
+  uint32_t version; /**< version number */
+  uint32_t lit_table_offset; /**< offset of the literal table */
+  uint32_t lit_table_size; /**< size of literal table */
+  uint32_t is_run_global; /**< flag, indicating whether the snapshot
+                            *   was saved as 'Global scope'-mode code (true)
+                            *   or as eval-mode code (false) */
+} jerry_snapshot_header_t;
+
+/**
+ * Jerry snapshot format version
+ */
+#define JERRY_SNAPSHOT_VERSION (7u)
+
+#endif /* !JERRY_SNAPSHOT_H */
diff --git a/deps/jerry/jerry-core/api/jerry.c b/deps/jerry/jerry-core/api/jerry.c
new file mode 100644 (file)
index 0000000..cccfc23
--- /dev/null
@@ -0,0 +1,2355 @@
+/* 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.
+ */
+
+#include <stdio.h>
+
+#include "debugger.h"
+#include "ecma-alloc.h"
+#include "ecma-array-object.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-eval.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-helpers.h"
+#include "ecma-init-finalize.h"
+#include "ecma-lex-env.h"
+#include "ecma-literal-storage.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+#include "ecma-promise-object.h"
+#include "jcontext.h"
+#include "jerryscript.h"
+#include "js-parser.h"
+#include "re-compiler.h"
+
+JERRY_STATIC_ASSERT (sizeof (jerry_value_t) == sizeof (ecma_value_t),
+                     size_of_jerry_value_t_must_be_equal_to_size_of_ecma_value_t);
+
+JERRY_STATIC_ASSERT ((int) ECMA_ERROR_COMMON == (int) JERRY_ERROR_COMMON
+                     && (int) ECMA_ERROR_EVAL == (int) JERRY_ERROR_EVAL
+                     && (int) ECMA_ERROR_RANGE == (int) JERRY_ERROR_RANGE
+                     && (int) ECMA_ERROR_REFERENCE == (int) JERRY_ERROR_REFERENCE
+                     && (int) ECMA_ERROR_SYNTAX == (int) JERRY_ERROR_SYNTAX
+                     && (int) ECMA_ERROR_TYPE == (int) JERRY_ERROR_TYPE
+                     && (int) ECMA_ERROR_URI == (int) JERRY_ERROR_URI,
+                     ecma_standard_error_t_must_be_equal_to_jerry_error_t);
+
+JERRY_STATIC_ASSERT ((int) ECMA_INIT_EMPTY == (int) JERRY_INIT_EMPTY
+                     && (int) ECMA_INIT_SHOW_OPCODES == (int) JERRY_INIT_SHOW_OPCODES
+                     && (int) ECMA_INIT_SHOW_REGEXP_OPCODES == (int) JERRY_INIT_SHOW_REGEXP_OPCODES
+                     && (int) ECMA_INIT_MEM_STATS == (int) JERRY_INIT_MEM_STATS,
+                     ecma_init_flag_t_must_be_equal_to_jerry_init_flag_t);
+
+#ifndef JERRY_JS_PARSER
+#error JERRY_JS_PARSER must be defined with 0 (disabled) or 1 (enabled)
+#elif !JERRY_JS_PARSER && !defined (JERRY_ENABLE_SNAPSHOT_EXEC)
+#error JERRY_JS_PARSER or JERRY_ENABLE_SNAPSHOT_EXEC must be defined!
+#endif /* !JERRY_JS_PARSER */
+
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+
+/**
+ * Error message, if an argument is has an error flag
+ */
+static const char * const error_value_msg_p = "argument cannot have an error flag";
+
+/**
+ * Error message, if types of arguments are incorrect
+ */
+static const char * const wrong_args_msg_p = "wrong type of argument";
+
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+
+/** \addtogroup jerry Jerry engine interface
+ * @{
+ */
+
+/**
+ * Assert that it is correct to call API in current state.
+ *
+ * Note:
+ *         By convention, there can be some states when API could not be invoked.
+ *
+ *         While, API can be invoked jerry_api_available flag is set,
+ *         and while it is incorrect to invoke API - it is not set.
+ *
+ *         This procedure checks whether the API is available, and terminates
+ *         the engine if it is unavailable. Otherwise it is a no-op.
+ *
+ * Note:
+ *         The API could not be invoked in the following cases:
+ *           - before jerry_init and after jerry_cleanup
+ *           - between enter to and return from a native free callback
+ */
+static inline void __attr_always_inline___
+jerry_assert_api_available (void)
+{
+  if (unlikely (!JERRY_CONTEXT (jerry_api_available)))
+  {
+    /* Terminates the execution. */
+    JERRY_UNREACHABLE ();
+  }
+} /* jerry_assert_api_available */
+
+/**
+ * Turn on API availability
+ */
+static inline void __attr_always_inline___
+jerry_make_api_available (void)
+{
+  JERRY_CONTEXT (jerry_api_available) = true;
+} /* jerry_make_api_available */
+
+/**
+ * Turn off API availability
+ */
+static inline void __attr_always_inline___
+jerry_make_api_unavailable (void)
+{
+  JERRY_CONTEXT (jerry_api_available) = false;
+} /* jerry_make_api_unavailable */
+
+/**
+ * Construct new TypeError object
+ *
+ * @return TypeError object value
+ */
+static jerry_value_t
+jerry_create_type_error (void)
+{
+  ecma_object_t *type_error_obj_p = ecma_new_standard_error (ECMA_ERROR_TYPE);
+  return ecma_make_error_obj_value (type_error_obj_p);
+} /* jerry_create_type_error */
+
+/**
+ * Jerry engine initialization
+ */
+void
+jerry_init (jerry_init_flag_t flags) /**< combination of Jerry flags */
+{
+  if (unlikely (JERRY_CONTEXT (jerry_api_available)))
+  {
+    /* This function cannot be called twice unless jerry_cleanup is called. */
+    JERRY_UNREACHABLE ();
+  }
+
+  /* Zero out all members. */
+  memset (&JERRY_CONTEXT (JERRY_CONTEXT_FIRST_MEMBER), 0, sizeof (jerry_context_t));
+
+  JERRY_CONTEXT (jerry_init_flags) = flags;
+
+  jerry_make_api_available ();
+
+  jmem_init ();
+  ecma_init ();
+} /* jerry_init */
+
+/**
+ * Terminate Jerry engine
+ */
+void
+jerry_cleanup (void)
+{
+  jerry_assert_api_available ();
+
+  for (jerry_context_data_header_t *this_p = JERRY_CONTEXT (context_data_p), *next_p = NULL;
+       this_p != NULL;
+       this_p = next_p)
+  {
+    next_p = this_p->next_p;
+    this_p->manager_p->deinit_cb (JERRY_CONTEXT_DATA_HEADER_USER_DATA (this_p));
+    jmem_heap_free_block (this_p, sizeof (jerry_context_data_header_t) + this_p->manager_p->bytes_needed);
+  }
+
+  ecma_finalize ();
+  jmem_finalize ();
+  jerry_make_api_unavailable ();
+} /* jerry_cleanup */
+
+/**
+ * Retrieve a context data item, or create a new one.
+ *
+ * @param manager_p pointer to the manager whose context data item should be returned.
+ *
+ * @return a pointer to the user-provided context-specific data item for the given manager, creating such a pointer if
+ * none was found.
+ */
+void *
+jerry_get_context_data (const jerry_context_data_manager_t *manager_p)
+{
+  void *ret = NULL;
+  jerry_context_data_header_t *item_p;
+
+  for (item_p = JERRY_CONTEXT (context_data_p); item_p != NULL; item_p = item_p->next_p)
+  {
+    if (item_p->manager_p == manager_p)
+    {
+      return JERRY_CONTEXT_DATA_HEADER_USER_DATA (item_p);
+    }
+  }
+
+  item_p = jmem_heap_alloc_block (sizeof (jerry_context_data_header_t) + manager_p->bytes_needed);
+  item_p->manager_p = manager_p;
+  item_p->next_p = JERRY_CONTEXT (context_data_p);
+  JERRY_CONTEXT (context_data_p) = item_p;
+  ret = JERRY_CONTEXT_DATA_HEADER_USER_DATA (item_p);
+
+  memset (ret, 0, manager_p->bytes_needed);
+  if (manager_p->init_cb)
+  {
+    manager_p->init_cb (ret);
+  }
+
+  return ret;
+} /* jerry_get_context_data */
+
+/**
+ * Register external magic string array
+ */
+void
+jerry_register_magic_strings (const jerry_char_ptr_t *ex_str_items_p, /**< character arrays, representing
+                                                                       *   external magic strings' contents */
+                              uint32_t count, /**< number of the strings */
+                              const jerry_length_t *str_lengths_p) /**< lengths of all strings */
+{
+  jerry_assert_api_available ();
+
+  lit_magic_strings_ex_set ((const lit_utf8_byte_t **) ex_str_items_p, count, (const lit_utf8_size_t *) str_lengths_p);
+} /* jerry_register_magic_strings */
+
+/**
+ * Get Jerry configured memory limits
+ */
+void
+jerry_get_memory_limits (size_t *out_data_bss_brk_limit_p, /**< [out] Jerry's maximum usage of
+                                                            *         data + bss + brk sections */
+                         size_t *out_stack_limit_p) /**< [out] Jerry's maximum usage of stack */
+{
+  *out_data_bss_brk_limit_p = CONFIG_MEM_HEAP_AREA_SIZE + CONFIG_MEM_DATA_LIMIT_MINUS_HEAP_SIZE;
+  *out_stack_limit_p = CONFIG_MEM_STACK_LIMIT;
+} /* jerry_get_memory_limits */
+
+/**
+ * Run garbage collection
+ */
+void
+jerry_gc (void)
+{
+  jerry_assert_api_available ();
+
+  ecma_gc_run (JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW);
+} /* jerry_gc */
+
+/**
+ * Simple Jerry runner
+ *
+ * @return true  - if run was successful
+ *         false - otherwise
+ */
+bool
+jerry_run_simple (const jerry_char_t *script_source_p, /**< script source */
+                  size_t script_source_size, /**< script source size */
+                  jerry_init_flag_t flags) /**< combination of Jerry flags */
+{
+  bool result = false;
+
+  jerry_init (flags);
+
+  jerry_value_t parse_ret_val = jerry_parse (script_source_p, script_source_size, false);
+
+  if (!ECMA_IS_VALUE_ERROR (parse_ret_val))
+  {
+    jerry_value_t run_ret_val = jerry_run (parse_ret_val);
+
+    if (!ECMA_IS_VALUE_ERROR (run_ret_val))
+    {
+      result = true;
+    }
+
+    jerry_release_value (run_ret_val);
+  }
+
+  jerry_release_value (parse_ret_val);
+  jerry_cleanup ();
+
+  return result;
+} /* jerry_run_simple */
+
+/**
+ * Parse script and construct an EcmaScript function. The lexical
+ * environment is set to the global lexical environment.
+ *
+ * @return function object value - if script was parsed successfully,
+ *         thrown error - otherwise
+ */
+jerry_value_t
+jerry_parse (const jerry_char_t *source_p, /**< script source */
+             size_t source_size, /**< script source size */
+             bool is_strict) /**< strict mode */
+{
+#if JERRY_JS_PARSER
+  jerry_assert_api_available ();
+
+  ecma_compiled_code_t *bytecode_data_p;
+  ecma_value_t parse_status;
+
+  parse_status = parser_parse_script (source_p,
+                                      source_size,
+                                      is_strict,
+                                      &bytecode_data_p);
+
+  if (ECMA_IS_VALUE_ERROR (parse_status))
+  {
+    return parse_status;
+  }
+
+  ecma_free_value (parse_status);
+
+  is_strict = ((bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) != 0);
+  ecma_object_t *lex_env_p = ecma_get_global_environment ();
+  ecma_object_t *func_obj_p = ecma_op_create_function_object (lex_env_p,
+                                                              is_strict,
+                                                              bytecode_data_p);
+  ecma_bytecode_deref (bytecode_data_p);
+
+  return ecma_make_object_value (func_obj_p);
+#else /* !JERRY_JS_PARSER */
+  JERRY_UNUSED (source_p);
+  JERRY_UNUSED (source_size);
+  JERRY_UNUSED (is_strict);
+
+  return ecma_raise_syntax_error (ECMA_ERR_MSG ("The parser has been disabled."));
+#endif /* JERRY_JS_PARSER */
+} /* jerry_parse */
+
+/**
+ * Parse script and construct an ECMAScript function. The lexical
+ * environment is set to the global lexical environment. The name
+ * (usually a file name) is also passed to this function which is
+ * used by the debugger to find the source code.
+ *
+ * @return function object value - if script was parsed successfully,
+ *         thrown error - otherwise
+ */
+jerry_value_t
+jerry_parse_named_resource (const jerry_char_t *name_p, /**< name (usually a file name) */
+                            size_t name_length, /**< length of name */
+                            const jerry_char_t *source_p, /**< script source */
+                            size_t source_size, /**< script source size */
+                            bool is_strict) /**< strict mode */
+{
+#ifdef JERRY_DEBUGGER
+  if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+  {
+    jerry_debugger_send_string (JERRY_DEBUGGER_SOURCE_CODE_NAME, name_p, name_length);
+  }
+#else /* JERRY_DEBUGGER */
+  JERRY_UNUSED (name_p);
+  JERRY_UNUSED (name_length);
+#endif /* JERRY_DEBUGGER */
+
+  return jerry_parse (source_p, source_size, is_strict);
+} /* jerry_parse_named_resource */
+
+/**
+ * Run an EcmaScript function created by jerry_parse.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return result of bytecode - if run was successful
+ *         thrown error - otherwise
+ */
+jerry_value_t
+jerry_run (const jerry_value_t func_val) /**< function to run */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (func_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  ecma_object_t *func_obj_p = ecma_get_object_from_value (func_val);
+
+  if (ecma_get_object_type (func_obj_p) != ECMA_OBJECT_TYPE_FUNCTION
+      || ecma_get_object_is_builtin (func_obj_p))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) func_obj_p;
+
+  ecma_object_t *scope_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                            ext_func_p->u.function.scope_cp);
+
+  if (scope_p != ecma_get_global_environment ())
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  const ecma_compiled_code_t *bytecode_data_p;
+  bytecode_data_p = ECMA_GET_INTERNAL_VALUE_POINTER (const ecma_compiled_code_t,
+                                                     ext_func_p->u.function.bytecode_cp);
+
+  return vm_run_global (bytecode_data_p);
+} /* jerry_run */
+
+/**
+ * Perform eval
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return result of eval, may be error value.
+ */
+jerry_value_t
+jerry_eval (const jerry_char_t *source_p, /**< source code */
+            size_t source_size, /**< length of source code */
+            bool is_strict) /**< source must conform with strict mode */
+{
+  jerry_assert_api_available ();
+
+  return ecma_op_eval_chars_buffer ((const lit_utf8_byte_t *) source_p,
+                                    source_size,
+                                    false,
+                                    is_strict);
+} /* jerry_eval */
+
+/**
+ * Run enqueued Promise jobs until the first thrown error or until all get executed.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return result of last executed job, may be error value.
+ */
+jerry_value_t
+jerry_run_all_enqueued_jobs (void)
+{
+  jerry_assert_api_available ();
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+  return ecma_process_all_enqueued_jobs ();
+#else /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+#endif /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+} /* jerry_run_all_enqueued_jobs */
+
+/**
+ * Get global object
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return api value of global object
+ */
+jerry_value_t
+jerry_get_global_object (void)
+{
+  jerry_assert_api_available ();
+
+  return ecma_make_object_value (ecma_builtin_get (ECMA_BUILTIN_ID_GLOBAL));
+} /* jerry_get_global_object */
+
+/**
+ * Check if the specified value is an array object value.
+ *
+ * @return true  - if the specified value is an array object,
+ *         false - otherwise
+ */
+bool
+jerry_value_is_array (const jerry_value_t value) /**< jerry api value */
+{
+  jerry_assert_api_available ();
+
+  return (ecma_is_value_object (value)
+          && ecma_get_object_type (ecma_get_object_from_value (value)) == ECMA_OBJECT_TYPE_ARRAY);
+} /* jerry_value_is_array */
+
+/**
+ * Check if the specified value is boolean.
+ *
+ * @return true  - if the specified value is boolean,
+ *         false - otherwise
+ */
+bool
+jerry_value_is_boolean (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  return ecma_is_value_boolean (value);
+} /* jerry_value_is_boolean */
+
+/**
+ * Check if the specified value is a constructor function object value.
+ *
+ * @return true - if the specified value is a function value that implements [[Construct]],
+ *         false - otherwise
+ */
+bool
+jerry_value_is_constructor (const jerry_value_t value) /**< jerry api value */
+{
+  jerry_assert_api_available ();
+
+  return ecma_is_constructor (value);
+} /* jerry_value_is_constructor */
+
+/**
+ * Check if the specified value is a function object value.
+ *
+ * @return true - if the specified value is callable,
+ *         false - otherwise
+ */
+bool
+jerry_value_is_function (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  return ecma_op_is_callable (value);
+} /* jerry_value_is_function */
+
+/**
+ * Check if the specified value is number.
+ *
+ * @return true  - if the specified value is number,
+ *         false - otherwise
+ */
+bool
+jerry_value_is_number (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  return ecma_is_value_number (value);
+} /* jerry_value_is_number */
+
+/**
+ * Check if the specified value is null.
+ *
+ * @return true  - if the specified value is null,
+ *         false - otherwise
+ */
+bool
+jerry_value_is_null (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  return ecma_is_value_null (value);
+} /* jerry_value_is_null */
+
+/**
+ * Check if the specified value is object.
+ *
+ * @return true  - if the specified value is object,
+ *         false - otherwise
+ */
+bool
+jerry_value_is_object (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  return ecma_is_value_object (value);
+} /* jerry_value_is_object */
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+/**
+ * Check if the specified value is promise.
+ *
+ * @return true  - if the specified value is promise,
+ *         false - otherwise
+ */
+bool
+jerry_value_is_promise (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  return (ecma_is_value_object (value)
+          && ecma_is_promise (ecma_get_object_from_value (value)));
+} /* jerry_value_is_promise */
+
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+
+/**
+ * Check if the specified value is string.
+ *
+ * @return true  - if the specified value is string,
+ *         false - otherwise
+ */
+bool
+jerry_value_is_string (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  return ecma_is_value_string (value);
+} /* jerry_value_is_string */
+
+/**
+ * Check if the specified value is undefined.
+ *
+ * @return true  - if the specified value is undefined,
+ *         false - otherwise
+ */
+bool
+jerry_value_is_undefined (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  return ecma_is_value_undefined (value);
+} /* jerry_value_is_undefined */
+
+/**
+ * Check if the specified feature is enabled.
+ *
+ * @return true  - if the specified feature is enabled,
+ *         false - otherwise
+ */
+bool jerry_is_feature_enabled (const jerry_feature_t feature)
+{
+  JERRY_ASSERT (feature < JERRY_FEATURE__COUNT);
+
+  return (false
+#ifdef JERRY_CPOINTER_32_BIT
+          || feature == JERRY_FEATURE_CPOINTER_32_BIT
+#endif /* JERRY_CPOINTER_32_BIT */
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+          || feature == JERRY_FEATURE_ERROR_MESSAGES
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+#if JERRY_JS_PARSER
+          || feature == JERRY_FEATURE_JS_PARSER
+#endif /* JERRY_JS_PARSER */
+#ifdef JMEM_STATS
+          || feature == JERRY_FEATURE_MEM_STATS
+#endif /* JMEM_STATS */
+#ifdef PARSER_DUMP_BYTE_CODE
+          || feature == JERRY_FEATURE_PARSER_DUMP
+#endif /* PARSER_DUMP_BYTE_CODE */
+#ifdef REGEXP_DUMP_BYTE_CODE
+          || feature == JERRY_FEATURE_REGEXP_DUMP
+#endif /* REGEXP_DUMP_BYTE_CODE */
+#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
+          || feature == JERRY_FEATURE_SNAPSHOT_SAVE
+#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
+#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
+          || feature == JERRY_FEATURE_SNAPSHOT_EXEC
+#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
+#ifdef JERRY_DEBUGGER
+          || feature == JERRY_FEATURE_DEBUGGER
+#endif /* JERRY_DEBUGGER */
+#ifdef JERRY_VM_EXEC_STOP
+          || feature == JERRY_FEATURE_VM_EXEC_STOP
+#endif /* JERRY_VM_EXEC_STOP */
+          );
+} /* jerry_is_feature_enabled */
+
+/**
+ * Check if the specified value is an error value.
+ *
+ * @return true  - if the error flag of the specified value is true,
+ *         false - otherwise
+ */
+bool
+jerry_value_has_error_flag (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  return ECMA_IS_VALUE_ERROR (value);
+} /* jerry_value_has_error_flag */
+
+/**
+ * Clear the error flag
+ */
+void
+jerry_value_clear_error_flag (jerry_value_t *value_p)
+{
+  jerry_assert_api_available ();
+
+  *value_p = (*value_p) & ~ECMA_VALUE_ERROR_FLAG;
+} /* jerry_value_clear_error_flag */
+
+/**
+ * Set the error flag.
+ */
+void
+jerry_value_set_error_flag (jerry_value_t *value_p)
+{
+  jerry_assert_api_available ();
+
+  *value_p = (*value_p) | ECMA_VALUE_ERROR_FLAG;
+} /* jerry_value_set_error_flag */
+
+/**
+ * Get boolean from the specified value.
+ *
+ * @return true or false.
+ */
+bool
+jerry_get_boolean_value (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  if (!jerry_value_is_boolean (value))
+  {
+    return false;
+  }
+
+  return ecma_is_value_true (value);
+} /* jerry_get_boolean_value */
+
+/**
+ * Get number from the specified value as a double.
+ *
+ * @return stored number as double
+ */
+double
+jerry_get_number_value (const jerry_value_t value) /**< api value */
+{
+  jerry_assert_api_available ();
+
+  if (!jerry_value_is_number (value))
+  {
+    return 0;
+  }
+
+  return (double) ecma_get_number_from_value (value);
+} /* jerry_get_number_value */
+
+/**
+ * Call ToBoolean operation on the api value.
+ *
+ * @return true  - if the logical value is true
+ *         false - otherwise
+ */
+bool
+jerry_value_to_boolean (const jerry_value_t value) /**< input value */
+{
+  jerry_assert_api_available ();
+
+  if (ECMA_IS_VALUE_ERROR (value))
+  {
+    return false;
+  }
+
+  return ecma_op_to_boolean (value);
+} /* jerry_value_to_boolean */
+
+/**
+ * Call ToNumber operation on the api value.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return converted number value - if success
+ *         thrown error - otherwise
+ */
+jerry_value_t
+jerry_value_to_number (const jerry_value_t value) /**< input value */
+{
+  jerry_assert_api_available ();
+
+  if (ECMA_IS_VALUE_ERROR (value))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (error_value_msg_p));
+  }
+
+  return ecma_op_to_number (value);
+} /* jerry_value_to_number */
+
+/**
+ * Call ToObject operation on the api value.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return converted object value - if success
+ *         thrown error - otherwise
+ */
+jerry_value_t
+jerry_value_to_object (const jerry_value_t value) /**< input value */
+{
+  jerry_assert_api_available ();
+
+  if (ECMA_IS_VALUE_ERROR (value))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (error_value_msg_p));
+  }
+
+  return ecma_op_to_object (value);
+} /* jerry_value_to_object */
+
+/**
+ * Call ToPrimitive operation on the api value.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return converted primitive value - if success
+ *         thrown error - otherwise
+ */
+jerry_value_t
+jerry_value_to_primitive (const jerry_value_t value) /**< input value */
+{
+  jerry_assert_api_available ();
+
+  if (ECMA_IS_VALUE_ERROR (value))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (error_value_msg_p));
+  }
+
+  return ecma_op_to_primitive (value, ECMA_PREFERRED_TYPE_NO);
+} /* jerry_value_to_primitive */
+
+/**
+ * Call the ToString ecma builtin operation on the api value.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return converted string value - if success
+ *         thrown error - otherwise
+ */
+jerry_value_t
+jerry_value_to_string (const jerry_value_t value) /**< input value */
+{
+
+  jerry_assert_api_available ();
+
+  if (ECMA_IS_VALUE_ERROR (value))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (error_value_msg_p));
+  }
+
+  return ecma_op_to_string (value);
+} /* jerry_value_to_string */
+
+/**
+ * Acquire specified Jerry API value.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return acquired api value
+ */
+jerry_value_t
+jerry_acquire_value (jerry_value_t value) /**< API value */
+{
+  jerry_assert_api_available ();
+
+  return ecma_copy_value (value);
+} /* jerry_acquire_value */
+
+/**
+ * Release specified Jerry API value
+ */
+void
+jerry_release_value (jerry_value_t value) /**< API value */
+{
+  jerry_assert_api_available ();
+
+  ecma_free_value (value);
+} /* jerry_release_value */
+
+/**
+ * Create an array object value
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return value of the constructed array object
+ */
+jerry_value_t
+jerry_create_array (uint32_t size) /**< size of array */
+{
+  jerry_assert_api_available ();
+
+  ecma_value_t array_length = ecma_make_uint32_value (size);
+
+  jerry_length_t argument_size = 1;
+  ecma_value_t array_value = ecma_op_create_array_object (&array_length, argument_size, true);
+  ecma_free_value (array_length);
+
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (array_value));
+
+  return array_value;
+} /* jerry_create_array */
+
+/**
+ * Create a jerry_value_t representing a boolean value from the given boolean parameter.
+ *
+ * @return value of the created boolean
+ */
+jerry_value_t
+jerry_create_boolean (bool value) /**< bool value from which a jerry_value_t will be created */
+{
+  jerry_assert_api_available ();
+
+  return ecma_make_boolean_value (value);
+} /* jerry_create_boolean */
+
+/**
+ * Create an error object
+ *
+ * Note:
+ *      - returned value must be freed with jerry_release_value, when it is no longer needed
+ *      - the error flag is set for the returned value
+ *
+ * @return value of the constructed error object
+ */
+jerry_value_t
+jerry_create_error (jerry_error_t error_type, /**< type of error */
+                    const jerry_char_t *message_p) /**< value of 'message' property
+                                                    *   of constructed error object */
+{
+  return jerry_create_error_sz (error_type,
+                                (lit_utf8_byte_t *) message_p,
+                                lit_zt_utf8_string_size (message_p));
+} /* jerry_create_error */
+
+/**
+ * Create an error object
+ *
+ * Note:
+ *      - returned value must be freed with jerry_release_value, when it is no longer needed
+ *      - the error flag is set for the returned value
+ *
+ * @return value of the constructed error object
+ */
+jerry_value_t
+jerry_create_error_sz (jerry_error_t error_type, /**< type of error */
+                       const jerry_char_t *message_p, /**< value of 'message' property
+                                                       *   of constructed error object */
+                       jerry_size_t message_size) /**< size of the message in bytes */
+{
+  jerry_assert_api_available ();
+
+  if (message_p == NULL || message_size == 0)
+  {
+    return ecma_make_error_obj_value (ecma_new_standard_error ((ecma_standard_error_t) error_type));
+  }
+  else
+  {
+    ecma_string_t *message_string_p = ecma_new_ecma_string_from_utf8 ((lit_utf8_byte_t *) message_p,
+                                                                      (lit_utf8_size_t) message_size);
+
+    ecma_object_t *error_object_p = ecma_new_standard_error_with_message ((ecma_standard_error_t) error_type,
+                                                                          message_string_p);
+
+    ecma_deref_ecma_string (message_string_p);
+
+    return ecma_make_error_obj_value (error_object_p);
+  }
+} /* jerry_create_error_sz */
+
+/**
+ * Create an external function object
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return value of the constructed function object
+ */
+jerry_value_t
+jerry_create_external_function (jerry_external_handler_t handler_p) /**< pointer to native handler
+                                                                     *   for the function */
+{
+  jerry_assert_api_available ();
+
+  ecma_object_t *func_obj_p = ecma_op_create_external_function_object (handler_p);
+  return ecma_make_object_value (func_obj_p);
+} /* jerry_create_external_function */
+
+/**
+ * Creates a jerry_value_t representing a number value.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return jerry_value_t created from the given double argument.
+ */
+jerry_value_t
+jerry_create_number (double value) /**< double value from which a jerry_value_t will be created */
+{
+  jerry_assert_api_available ();
+
+  return ecma_make_number_value ((ecma_number_t) value);
+} /* jerry_create_number */
+
+/**
+ * Creates a jerry_value_t representing a positive or negative infinity value.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return jerry_value_t representing an infinity value.
+ */
+jerry_value_t
+jerry_create_number_infinity (bool sign) /**< true for negative Infinity
+                                          *   false for positive Infinity */
+{
+  jerry_assert_api_available ();
+
+  return ecma_make_number_value (ecma_number_make_infinity (sign));
+} /* jerry_create_number_infinity */
+
+/**
+ * Creates a jerry_value_t representing a not-a-number value.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return jerry_value_t representing a not-a-number value.
+ */
+jerry_value_t
+jerry_create_number_nan (void)
+{
+  jerry_assert_api_available ();
+
+  return ecma_make_nan_value ();
+} /* jerry_create_number_nan */
+
+/**
+ * Creates and returns a jerry_value_t with type null object.
+ *
+ * @return jerry_value_t representing null
+ */
+jerry_value_t
+jerry_create_null (void)
+{
+  jerry_assert_api_available ();
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+} /* jerry_create_null */
+
+/**
+ * Create new JavaScript object, like with new Object().
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return value of the created object
+ */
+jerry_value_t
+jerry_create_object (void)
+{
+  jerry_assert_api_available ();
+
+  return ecma_make_object_value (ecma_op_create_object_object_noarg ());
+} /* jerry_create_object */
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+/**
+ * Create an empty Promise object which can be resolve/reject later
+ * by calling jerry_resolve_or_reject_promise.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return value of the created object
+ */
+jerry_value_t
+jerry_create_promise (void)
+{
+  jerry_assert_api_available ();
+
+  return ecma_op_create_promise_object (ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY), ECMA_PROMISE_EXECUTOR_EMPTY);
+} /* jerry_create_promise */
+
+#endif /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+
+/**
+ * Create string from a valid UTF-8 string
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value when it is no longer needed.
+ *
+ * @return value of the created string
+ */
+jerry_value_t
+jerry_create_string_from_utf8 (const jerry_char_t *str_p) /**< pointer to string */
+{
+  return jerry_create_string_sz_from_utf8 (str_p, lit_zt_utf8_string_size ((lit_utf8_byte_t *) str_p));
+} /* jerry_create_string_from_utf8 */
+
+/**
+ * Create string from a valid UTF-8 string
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value when it is no longer needed.
+ *
+ * @return value of the created string
+ */
+jerry_value_t
+jerry_create_string_sz_from_utf8 (const jerry_char_t *str_p, /**< pointer to string */
+                                  jerry_size_t str_size) /**< string size */
+{
+  jerry_assert_api_available ();
+
+  ecma_string_t *ecma_str_p = ecma_new_ecma_string_from_utf8_converted_to_cesu8 ((lit_utf8_byte_t *) str_p,
+                                                                                 (lit_utf8_size_t) str_size);
+
+  return ecma_make_string_value (ecma_str_p);
+} /* jerry_create_string_sz_from_utf8 */
+
+/**
+ * Create string from a valid CESU-8 string
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return value of the created string
+ */
+jerry_value_t
+jerry_create_string (const jerry_char_t *str_p) /**< pointer to string */
+{
+  return jerry_create_string_sz (str_p, lit_zt_utf8_string_size ((lit_utf8_byte_t *) str_p));
+} /* jerry_create_string */
+
+/**
+ * Create string from a valid CESU-8 string
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value when it is no longer needed.
+ *
+ * @return value of the created string
+ */
+jerry_value_t
+jerry_create_string_sz (const jerry_char_t *str_p, /**< pointer to string */
+                        jerry_size_t str_size) /**< string size */
+{
+  jerry_assert_api_available ();
+
+  ecma_string_t *ecma_str_p = ecma_new_ecma_string_from_utf8 ((lit_utf8_byte_t *) str_p,
+                                                              (lit_utf8_size_t) str_size);
+  return ecma_make_string_value (ecma_str_p);
+} /* jerry_create_string_sz */
+
+/**
+ * Creates a jerry_value_t representing an undefined value.
+ *
+ * @return value of undefined
+ */
+jerry_value_t
+jerry_create_undefined (void)
+{
+  jerry_assert_api_available ();
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+} /* jerry_create_undefined */
+
+/**
+ * Get length of an array object
+ *
+ * Note:
+ *      Returns 0, if the value parameter is not an array object.
+ *
+ * @return length of the given array
+ */
+uint32_t
+jerry_get_array_length (const jerry_value_t value)
+{
+  jerry_assert_api_available ();
+
+  if (!jerry_value_is_array (value))
+  {
+    return 0;
+  }
+
+  jerry_length_t length = 0;
+  ecma_string_t magic_string_length;
+  ecma_init_ecma_length_string (&magic_string_length);
+
+  ecma_value_t len_value = ecma_op_object_get (ecma_get_object_from_value (value),
+                                               &magic_string_length);
+
+  length = ecma_number_to_uint32 (ecma_get_number_from_value (len_value));
+  ecma_free_value (len_value);
+
+  return length;
+} /* jerry_get_array_length */
+
+/**
+ * Get size of Jerry string
+ *
+ * Note:
+ *      Returns 0, if the value parameter is not a string.
+ *
+ * @return number of bytes in the buffer needed to represent the string
+ */
+jerry_size_t
+jerry_get_string_size (const jerry_value_t value) /**< input string */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_string (value))
+  {
+    return 0;
+  }
+
+  return ecma_string_get_size (ecma_get_string_from_value (value));
+} /* jerry_get_string_size */
+
+/**
+ * Get UTF-8 encoded string size from Jerry string
+ *
+ * Note:
+ *      Returns 0, if the value parameter is not a string.
+ *
+ * @return number of bytes in the buffer needed to represent the UTF-8 encoded string
+ */
+jerry_size_t
+jerry_get_utf8_string_size (const jerry_value_t value)
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_string (value))
+  {
+    return 0;
+  }
+
+  return ecma_string_get_utf8_size (ecma_get_string_from_value (value));
+} /* jerry_get_utf8_string_size */
+
+/**
+ * Get length of Jerry string
+ *
+ * Note:
+ *      Returns 0, if the value parameter is not a string.
+ *
+ * @return number of characters in the string
+ */
+jerry_length_t
+jerry_get_string_length (const jerry_value_t value) /**< input string */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_string (value))
+  {
+    return 0;
+  }
+
+  return ecma_string_get_length (ecma_get_string_from_value (value));
+} /* jerry_get_string_length */
+
+/**
+ * Get UTF-8 string length from Jerry string
+ *
+ * Note:
+ *      Returns 0, if the value parameter is not a string.
+ *
+ * @return number of characters in the string
+ */
+jerry_length_t
+jerry_get_utf8_string_length (const jerry_value_t value) /**< input string */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_string (value))
+  {
+    return 0;
+  }
+
+  return ecma_string_get_utf8_length (ecma_get_string_from_value (value));
+} /* jerry_get_utf8_string_length */
+
+/**
+ * Copy the characters of a string into a specified buffer.
+ *
+ * Note:
+ *      The '\0' character could occur in character buffer.
+ *      Returns 0, if the value parameter is not a string or
+ *      the buffer is not large enough for the whole string.
+ *
+ * @return number of bytes, actually copied to the buffer.
+ */
+jerry_size_t
+jerry_string_to_char_buffer (const jerry_value_t value, /**< input string value */
+                             jerry_char_t *buffer_p, /**< [out] output characters buffer */
+                             jerry_size_t buffer_size) /**< size of output buffer */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_string (value) || buffer_p == NULL)
+  {
+    return 0;
+  }
+
+  ecma_string_t *str_p = ecma_get_string_from_value (value);
+
+  if (ecma_string_get_size (str_p) > buffer_size)
+  {
+    return 0;
+  }
+
+  return ecma_string_copy_to_cesu8_buffer (str_p,
+                                           (lit_utf8_byte_t *) buffer_p,
+                                           buffer_size);
+} /* jerry_string_to_char_buffer */
+
+/**
+ * Copy the characters of an utf-8 encoded string into a specified buffer.
+ *
+ * Note:
+ *      The '\0' character could occur anywhere in the returned string
+ *      Returns 0, if the value parameter is not a string or the buffer
+ *      is not large enough for the whole string.
+ *
+ * @return number of bytes copied to the buffer.
+ */
+jerry_size_t
+jerry_string_to_utf8_char_buffer (const jerry_value_t value, /**< input string value */
+                                  jerry_char_t *buffer_p, /**< [out] output characters buffer */
+                                  jerry_size_t buffer_size) /**< size of output buffer */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_string (value) || buffer_p == NULL)
+  {
+    return 0;
+  }
+
+  ecma_string_t *str_p = ecma_get_string_from_value (value);
+
+  if (ecma_string_get_utf8_size (str_p) > buffer_size)
+  {
+    return 0;
+  }
+
+  return ecma_string_copy_to_utf8_buffer (str_p,
+                                          (lit_utf8_byte_t *) buffer_p,
+                                          buffer_size);
+} /* jerry_string_to_utf8_char_buffer */
+
+/**
+ * Copy the characters of an cesu-8 encoded substring into a specified buffer.
+ *
+ * Note:
+ *      The '\0' character could occur anywhere in the returned string
+ *      Returns 0, if the value parameter is not a string.
+ *      It will extract the substring beetween the specified start position
+ *      and the end position (or the end of the string, whichever comes first).
+ *
+ * @return number of bytes copied to the buffer.
+ */
+jerry_size_t
+jerry_substring_to_char_buffer (const jerry_value_t value, /**< input string value */
+                                jerry_length_t start_pos, /**< position of the first character */
+                                jerry_length_t end_pos, /**< position of the last character */
+                                jerry_char_t *buffer_p, /**< [out] output characters buffer */
+                                jerry_size_t buffer_size) /**< size of output buffer */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_string (value) || buffer_p == NULL)
+  {
+    return 0;
+  }
+
+  ecma_string_t *str_p = ecma_get_string_from_value (value);
+
+  return ecma_substring_copy_to_cesu8_buffer (str_p,
+                                              start_pos,
+                                              end_pos,
+                                              (lit_utf8_byte_t *) buffer_p,
+                                              buffer_size);
+} /* jerry_substring_to_char_buffer */
+
+/**
+ * Copy the characters of an utf-8 encoded substring into a specified buffer.
+ *
+ * Note:
+ *      The '\0' character could occur anywhere in the returned string
+ *      Returns 0, if the value parameter is not a string.
+ *      It will extract the substring beetween the specified start position
+ *      and the end position (or the end of the string, whichever comes first).
+ *
+ * @return number of bytes copied to the buffer.
+ */
+jerry_size_t
+jerry_substring_to_utf8_char_buffer (const jerry_value_t value, /**< input string value */
+                                     jerry_length_t start_pos, /**< position of the first character */
+                                     jerry_length_t end_pos, /**< position of the last character */
+                                     jerry_char_t *buffer_p, /**< [out] output characters buffer */
+                                     jerry_size_t buffer_size) /**< size of output buffer */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_string (value) || buffer_p == NULL)
+  {
+    return 0;
+  }
+
+  ecma_string_t *str_p = ecma_get_string_from_value (value);
+
+  return ecma_substring_copy_to_utf8_buffer (str_p,
+                                             start_pos,
+                                             end_pos,
+                                             (lit_utf8_byte_t *) buffer_p,
+                                             buffer_size);
+} /* jerry_substring_to_utf8_char_buffer */
+
+/**
+ * Checks whether the object or it's prototype objects have the given property.
+ *
+ * @return true  - if the property exists
+ *         false - otherwise
+ */
+jerry_value_t
+jerry_has_property (const jerry_value_t obj_val, /**< object value */
+                    const jerry_value_t prop_name_val) /**< property name (string value) */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val)
+      || !ecma_is_value_string (prop_name_val))
+  {
+    return false;
+  }
+
+  bool has_property = ecma_op_object_has_property (ecma_get_object_from_value (obj_val),
+                                                   ecma_get_string_from_value (prop_name_val));
+
+  return ecma_make_boolean_value (has_property);
+} /* jerry_has_property */
+
+/**
+ * Checks whether the object has the given property.
+ *
+ * @return true  - if the property exists
+ *         false - otherwise
+ */
+jerry_value_t
+jerry_has_own_property (const jerry_value_t obj_val, /**< object value */
+                        const jerry_value_t prop_name_val) /**< property name (string value) */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val)
+      || !ecma_is_value_string (prop_name_val))
+  {
+    return false;
+  }
+
+  bool has_property = ecma_op_object_has_own_property (ecma_get_object_from_value (obj_val),
+                                                       ecma_get_string_from_value (prop_name_val));
+
+  return ecma_make_boolean_value (has_property);
+} /* jerry_has_own_property */
+
+/**
+ * Delete a property from an object.
+ *
+ * @return true  - if property was deleted successfully
+ *         false - otherwise
+ */
+bool
+jerry_delete_property (const jerry_value_t obj_val, /**< object value */
+                       const jerry_value_t prop_name_val) /**< property name (string value) */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val)
+      || !ecma_is_value_string (prop_name_val))
+  {
+    return false;
+  }
+
+  ecma_value_t ret_value = ecma_op_object_delete (ecma_get_object_from_value (obj_val),
+                                                  ecma_get_string_from_value (prop_name_val),
+                                                  false);
+  return ecma_is_value_true (ret_value);
+} /* jerry_delete_property */
+
+/**
+ * Get value of a property to the specified object with the given name.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return value of the property - if success
+ *         value marked with error flag - otherwise
+ */
+jerry_value_t
+jerry_get_property (const jerry_value_t obj_val, /**< object value */
+                    const jerry_value_t prop_name_val) /**< property name (string value) */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val)
+      || !ecma_is_value_string (prop_name_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  return ecma_op_object_get (ecma_get_object_from_value (obj_val),
+                             ecma_get_string_from_value (prop_name_val));
+} /* jerry_get_property */
+
+/**
+ * Get value by an index from the specified object.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return value of the property specified by the index - if success
+ *         value marked with error flag - otherwise
+ */
+jerry_value_t
+jerry_get_property_by_index (const jerry_value_t obj_val, /**< object value */
+                             uint32_t index) /**< index to be written */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val))
+  {
+    return jerry_create_type_error ();
+  }
+
+  ecma_string_t str_idx;
+  ecma_init_ecma_string_from_uint32 (&str_idx, index);
+  ecma_value_t ret_value = ecma_op_object_get (ecma_get_object_from_value (obj_val), &str_idx);
+
+  return ret_value;
+} /* jerry_get_property_by_index */
+
+/**
+ * Set a property to the specified object with the given name.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return true value - if the operation was successful
+ *         value marked with error flag - otherwise
+ */
+jerry_value_t
+jerry_set_property (const jerry_value_t obj_val, /**< object value */
+                    const jerry_value_t prop_name_val, /**< property name (string value) */
+                    const jerry_value_t value_to_set) /**< value to set */
+{
+  jerry_assert_api_available ();
+
+  if (ECMA_IS_VALUE_ERROR (value_to_set)
+      || !ecma_is_value_object (obj_val)
+      || !ecma_is_value_string (prop_name_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  return ecma_op_object_put (ecma_get_object_from_value (obj_val),
+                             ecma_get_string_from_value (prop_name_val),
+                             value_to_set,
+                             true);
+} /* jerry_set_property */
+
+/**
+ * Set indexed value in the specified object
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return true value - if the operation was successful
+ *         value marked with error flag - otherwise
+ */
+jerry_value_t
+jerry_set_property_by_index (const jerry_value_t obj_val, /**< object value */
+                             uint32_t index, /**< index to be written */
+                             const jerry_value_t value_to_set) /**< value to set */
+{
+  jerry_assert_api_available ();
+
+  if (ECMA_IS_VALUE_ERROR (value_to_set)
+      || !ecma_is_value_object (obj_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  ecma_string_t *str_idx_p = ecma_new_ecma_string_from_uint32 ((uint32_t) index);
+  ecma_value_t ret_value = ecma_op_object_put (ecma_get_object_from_value (obj_val),
+                                               str_idx_p,
+                                               value_to_set,
+                                               true);
+  ecma_deref_ecma_string (str_idx_p);
+
+  return ret_value;
+} /* jerry_set_property_by_index */
+
+/**
+ * Initialize property descriptor.
+ */
+void
+jerry_init_property_descriptor_fields (jerry_property_descriptor_t *prop_desc_p) /**< [out] property descriptor */
+{
+  prop_desc_p->is_value_defined = false;
+  prop_desc_p->value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  prop_desc_p->is_writable_defined = false;
+  prop_desc_p->is_writable = false;
+  prop_desc_p->is_enumerable_defined = false;
+  prop_desc_p->is_enumerable = false;
+  prop_desc_p->is_configurable_defined = false;
+  prop_desc_p->is_configurable = false;
+  prop_desc_p->is_get_defined = false;
+  prop_desc_p->getter = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  prop_desc_p->is_set_defined = false;
+  prop_desc_p->setter = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+} /* jerry_init_property_descriptor_fields */
+
+/**
+ * Define a property to the specified object with the given name.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return true value - if the operation was successful
+ *         value marked with error flag - otherwise
+ */
+jerry_value_t
+jerry_define_own_property (const jerry_value_t obj_val, /**< object value */
+                           const jerry_value_t prop_name_val, /**< property name (string value) */
+                           const jerry_property_descriptor_t *prop_desc_p) /**< property descriptor */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val)
+      || !ecma_is_value_string (prop_name_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  if ((prop_desc_p->is_writable_defined || prop_desc_p->is_value_defined)
+      && (prop_desc_p->is_get_defined || prop_desc_p->is_set_defined))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
+
+  prop_desc.is_enumerable_defined = prop_desc_p->is_enumerable_defined;
+  prop_desc.is_enumerable = prop_desc_p->is_enumerable_defined ? prop_desc_p->is_enumerable : false;
+
+  prop_desc.is_configurable_defined = prop_desc_p->is_configurable_defined;
+  prop_desc.is_configurable = prop_desc_p->is_configurable_defined ? prop_desc_p->is_configurable : false;
+
+  /* Copy data property info. */
+  prop_desc.is_value_defined = prop_desc_p->is_value_defined;
+
+  if (prop_desc_p->is_value_defined)
+  {
+    if (ECMA_IS_VALUE_ERROR (prop_desc_p->value))
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+    }
+
+    prop_desc.value = prop_desc_p->value;
+  }
+
+  prop_desc.is_writable_defined = prop_desc_p->is_writable_defined;
+  prop_desc.is_writable = prop_desc_p->is_writable_defined ? prop_desc_p->is_writable : false;
+
+  /* Copy accessor property info. */
+  if (prop_desc_p->is_get_defined)
+  {
+    ecma_value_t getter = prop_desc_p->getter;
+    prop_desc.is_get_defined = true;
+
+    if (ECMA_IS_VALUE_ERROR (getter))
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+    }
+
+    if (ecma_op_is_callable (getter))
+    {
+      prop_desc.get_p = ecma_get_object_from_value (getter);
+    }
+    else if (!ecma_is_value_null (getter))
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+    }
+  }
+
+  if (prop_desc_p->is_set_defined)
+  {
+    ecma_value_t setter = prop_desc_p->setter;
+    prop_desc.is_set_defined = true;
+
+    if (ECMA_IS_VALUE_ERROR (setter))
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+    }
+
+    if (ecma_op_is_callable (setter))
+    {
+      prop_desc.set_p = ecma_get_object_from_value (setter);
+    }
+    else if (!ecma_is_value_null (setter))
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+    }
+  }
+
+  return ecma_op_object_define_own_property (ecma_get_object_from_value (obj_val),
+                                             ecma_get_string_from_value (prop_name_val),
+                                             &prop_desc,
+                                             true);
+} /* jerry_define_own_property */
+
+/**
+ * Construct property descriptor from specified property.
+ *
+ * @return true - if success, the prop_desc_p fields contains the property info
+ *         false - otherwise, the prop_desc_p is unchanged
+ */
+bool
+jerry_get_own_property_descriptor (const jerry_value_t  obj_val, /**< object value */
+                                   const jerry_value_t prop_name_val, /**< property name (string value) */
+                                   jerry_property_descriptor_t *prop_desc_p) /**< property descriptor */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val)
+      || !ecma_is_value_string (prop_name_val))
+  {
+    return false;
+  }
+
+  ecma_property_descriptor_t prop_desc;
+
+  if (!ecma_op_object_get_own_property_descriptor (ecma_get_object_from_value (obj_val),
+                                                   ecma_get_string_from_value (prop_name_val),
+                                                   &prop_desc))
+  {
+    return false;
+  }
+
+  prop_desc_p->is_configurable_defined = true;
+  prop_desc_p->is_configurable = prop_desc.is_configurable;
+  prop_desc_p->is_enumerable_defined = true;
+  prop_desc_p->is_enumerable = prop_desc.is_enumerable;
+
+  prop_desc_p->is_writable_defined = prop_desc.is_writable_defined;
+  prop_desc_p->is_writable = prop_desc.is_writable_defined ? prop_desc.is_writable : false;
+
+  prop_desc_p->is_value_defined = prop_desc.is_value_defined;
+  prop_desc_p->is_get_defined = prop_desc.is_get_defined;
+  prop_desc_p->is_set_defined = prop_desc.is_set_defined;
+
+  prop_desc_p->value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  prop_desc_p->getter = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  prop_desc_p->setter = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+  if (prop_desc.is_value_defined)
+  {
+    prop_desc_p->value = prop_desc.value;
+  }
+
+  if (prop_desc.is_get_defined)
+  {
+    if (prop_desc.get_p != NULL)
+    {
+      prop_desc_p->getter = ecma_make_object_value (prop_desc.get_p);
+    }
+    else
+    {
+      prop_desc_p->getter = ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+    }
+  }
+
+  if (prop_desc.is_set_defined)
+  {
+    if (prop_desc.set_p != NULL)
+    {
+      prop_desc_p->setter = ecma_make_object_value (prop_desc.set_p);
+    }
+    else
+    {
+      prop_desc_p->setter = ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+    }
+  }
+
+  return true;
+} /* jerry_get_own_property_descriptor */
+
+/**
+ * Free fields of property descriptor (setter, getter and value).
+ */
+void
+jerry_free_property_descriptor_fields (const jerry_property_descriptor_t *prop_desc_p) /**< property descriptor */
+{
+  if (prop_desc_p->is_value_defined)
+  {
+    ecma_free_value (prop_desc_p->value);
+  }
+
+  if (prop_desc_p->is_get_defined)
+  {
+    ecma_free_value (prop_desc_p->getter);
+  }
+
+  if (prop_desc_p->is_set_defined)
+  {
+    ecma_free_value (prop_desc_p->setter);
+  }
+} /* jerry_free_property_descriptor_fields */
+
+/**
+ * Invoke function specified by a function value
+ *
+ * Note:
+ *      - returned value must be freed with jerry_release_value, when it is no longer needed.
+ *      - If function is invoked as constructor, it should support [[Construct]] method,
+ *        otherwise, if function is simply called - it should support [[Call]] method.
+ *
+ * @return returned jerry value of the invoked function
+ */
+static jerry_value_t
+jerry_invoke_function (bool is_invoke_as_constructor, /**< true - invoke function as constructor
+                                                       *          (this_arg_p should be NULL, as it is ignored),
+                                                       *   false - perform function call */
+                       const jerry_value_t func_obj_val, /**< function object to call */
+                       const jerry_value_t this_val, /**< object value of 'this' binding */
+                       const jerry_value_t args_p[], /**< function's call arguments */
+                       const jerry_size_t args_count) /**< number of the arguments */
+{
+  JERRY_ASSERT (args_count == 0 || args_p != NULL);
+
+  if (ECMA_IS_VALUE_ERROR (func_obj_val)
+      || ECMA_IS_VALUE_ERROR (this_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (error_value_msg_p));
+  }
+
+  for (uint32_t i = 0; i < args_count; i++)
+  {
+    if (ECMA_IS_VALUE_ERROR (args_p[i]))
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG (error_value_msg_p));
+    }
+  }
+
+  if (is_invoke_as_constructor)
+  {
+    JERRY_ASSERT (jerry_value_is_constructor (func_obj_val));
+
+    return ecma_op_function_construct (ecma_get_object_from_value (func_obj_val),
+                                       args_p,
+                                       args_count);
+  }
+  else
+  {
+    JERRY_ASSERT (jerry_value_is_function (func_obj_val));
+
+    return ecma_op_function_call (ecma_get_object_from_value (func_obj_val),
+                                  this_val,
+                                  args_p,
+                                  args_count);
+  }
+} /* jerry_invoke_function */
+
+/**
+ * Call function specified by a function value
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *      error flag must not be set for any arguments of this function.
+ *
+ * @return returned jerry value of the called function
+ */
+jerry_value_t
+jerry_call_function (const jerry_value_t func_obj_val, /**< function object to call */
+                     const jerry_value_t this_val, /**< object for 'this' binding */
+                     const jerry_value_t args_p[], /**< function's call arguments */
+                     jerry_size_t args_count) /**< number of the arguments */
+{
+  jerry_assert_api_available ();
+
+  if (jerry_value_is_function (func_obj_val))
+  {
+    return jerry_invoke_function (false, func_obj_val, this_val, args_p, args_count);
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+} /* jerry_call_function */
+
+/**
+ * Construct object value invoking specified function value as a constructor
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *      error flag must not be set for any arguments of this function.
+ *
+ * @return returned jerry value of the invoked constructor
+ */
+jerry_value_t
+jerry_construct_object (const jerry_value_t func_obj_val, /**< function object to call */
+                        const jerry_value_t args_p[], /**< function's call arguments
+                                                       *   (NULL if arguments number is zero) */
+                        jerry_size_t args_count) /**< number of the arguments */
+{
+  jerry_assert_api_available ();
+
+  if (jerry_value_is_constructor (func_obj_val))
+  {
+    ecma_value_t this_val = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    return jerry_invoke_function (true, func_obj_val, this_val, args_p, args_count);
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+} /* jerry_construct_object */
+
+/**
+ * Get keys of the specified object value
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return array object value - if success
+ *         value marked with error flag - otherwise
+ */
+jerry_value_t
+jerry_get_object_keys (const jerry_value_t obj_val) /**< object value */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  return ecma_builtin_helper_object_get_properties (ecma_get_object_from_value (obj_val), true);
+} /* jerry_get_object_keys */
+
+/**
+ * Get the prototype of the specified object
+ *
+ * @return prototype object or null value - if success
+ *         value marked with error flag - otherwise
+ */
+jerry_value_t
+jerry_get_prototype (const jerry_value_t obj_val) /**< object value */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  ecma_object_t *proto_obj_p = ecma_get_object_prototype (ecma_get_object_from_value (obj_val));
+
+  if (proto_obj_p == NULL)
+  {
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+  }
+
+  return ecma_make_object_value (proto_obj_p);
+} /* jerry_get_prototype */
+
+/**
+ * Set the prototype of the specified object
+ *
+ * @return true value - if success
+ *         value marked with error flag - otherwise
+ */
+jerry_value_t
+jerry_set_prototype (const jerry_value_t obj_val, /**< object value */
+                     const jerry_value_t proto_obj_val) /**< prototype object value */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val)
+      || ECMA_IS_VALUE_ERROR (proto_obj_val)
+      || (!ecma_is_value_object (proto_obj_val) && !ecma_is_value_null (proto_obj_val)))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  if (ecma_is_value_null (proto_obj_val))
+  {
+    ECMA_SET_POINTER (ecma_get_object_from_value (obj_val)->prototype_or_outer_reference_cp, NULL);
+  }
+  else
+  {
+    ECMA_SET_POINTER (ecma_get_object_from_value (obj_val)->prototype_or_outer_reference_cp,
+                      ecma_get_object_from_value (proto_obj_val));
+  }
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+} /* jerry_set_prototype */
+
+/**
+ * Get native handle, associated with specified object.
+ *
+ * Note: This API is deprecated, please use jerry_get_object_native_pointer instaed.
+ *
+ * @return true - if there is an associated handle (handle is returned through out_handle_p),
+ *         false - otherwise
+ */
+bool
+jerry_get_object_native_handle (const jerry_value_t obj_val, /**< object to get handle from */
+                                uintptr_t *out_handle_p) /**< [out] handle value */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val))
+  {
+    return false;
+  }
+
+  ecma_native_pointer_t *native_pointer_p;
+  native_pointer_p = ecma_get_native_pointer_value (ecma_get_object_from_value (obj_val),
+                                                    LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE);
+
+  if (native_pointer_p == NULL)
+  {
+    return false;
+  }
+
+  *out_handle_p = (uintptr_t) native_pointer_p->data_p;
+  return true;
+} /* jerry_get_object_native_handle */
+
+/**
+ * Set native handle and an optional free callback for the specified object.
+ *
+ * Note: This API is deprecated, please use jerry_set_object_native_pointer instaed.
+ *
+ * Note:
+ *      If native handle was already set for the object, its value is updated.
+ *
+ * Note:
+ *      If a non-NULL free callback is specified, it will be called
+ *      by the garbage collector when the object is freed. The free
+ *      callback always overwrites the previous value, so passing
+ *      a NULL value deletes the current free callback.
+ */
+void
+jerry_set_object_native_handle (const jerry_value_t obj_val, /**< object to set handle in */
+                                uintptr_t handle_p, /**< handle value */
+                                jerry_object_free_callback_t freecb_p) /**< object free callback or NULL */
+{
+  jerry_assert_api_available ();
+
+  if (ecma_is_value_object (obj_val))
+  {
+    ecma_object_t *object_p = ecma_get_object_from_value (obj_val);
+
+    ecma_create_native_handle_property (object_p,
+                                        (void *) handle_p,
+                                        (void *) (ecma_external_pointer_t) freecb_p);
+  }
+} /* jerry_set_object_native_handle */
+
+/**
+ * Get native pointer and its type information, associated with specified object.
+ *
+ * Note:
+ *  If native pointer is present, its type information is returned
+ *  in out_native_pointer_p and out_native_info_p.
+ *
+ * @return true - if there is an associated pointer,
+ *         false - otherwise
+ */
+bool
+jerry_get_object_native_pointer (const jerry_value_t obj_val, /**< object to get native pointer from */
+                                 void **out_native_pointer_p, /**< [out] native pointer */
+                                 const jerry_object_native_info_t **out_native_info_p) /**< [out] the type info
+                                                                                        *   of the native pointer */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (obj_val))
+  {
+    return false;
+  }
+
+  ecma_native_pointer_t *native_pointer_p;
+  native_pointer_p = ecma_get_native_pointer_value (ecma_get_object_from_value (obj_val),
+                                                    LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER);
+
+  if (native_pointer_p == NULL)
+  {
+    return false;
+  }
+
+  if (out_native_pointer_p != NULL)
+  {
+    *out_native_pointer_p = native_pointer_p->data_p;
+  }
+
+  if (out_native_info_p != NULL)
+  {
+    *out_native_info_p = (const jerry_object_native_info_t *) native_pointer_p->u.info_p;
+  }
+
+  return true;
+} /* jerry_get_object_native_pointer */
+
+/**
+ * Set native pointer and an optional type info for the specified object.
+ *
+ *
+ * Note:
+ *      If native pointer was already set for the object, its value is updated.
+ *
+ * Note:
+ *      If a non-NULL free callback is specified in the native type info,
+ *      it will be called by the garbage collector when the object is freed.
+ *      The type info is always overwrites the previous value, so passing
+ *      a NULL value deletes the current type info.
+ */
+void
+jerry_set_object_native_pointer (const jerry_value_t obj_val, /**< object to set native pointer in */
+                                 void *native_pointer_p, /**< native pointer */
+                                 const jerry_object_native_info_t *native_info_p) /**< object's native type info */
+{
+  jerry_assert_api_available ();
+
+  if (ecma_is_value_object (obj_val))
+  {
+    ecma_object_t *object_p = ecma_get_object_from_value (obj_val);
+
+    ecma_create_native_pointer_property (object_p, native_pointer_p, (void *) native_info_p);
+  }
+} /* jerry_set_object_native_pointer */
+
+/**
+ * Applies the given function to the every property in the object.
+ *
+ * @return true - if object fields traversal was performed successfully, i.e.:
+ *                - no unhandled exceptions were thrown in object fields traversal;
+ *                - object fields traversal was stopped on callback that returned false;
+ *         false - otherwise,
+ *                 if getter of field threw a exception or unhandled exceptions were thrown during traversal;
+ */
+bool
+jerry_foreach_object_property (const jerry_value_t obj_val, /**< object value */
+                               jerry_object_property_foreach_t foreach_p, /**< foreach function */
+                               void *user_data_p) /**< user data for foreach function */
+{
+  jerry_assert_api_available ();
+
+  ecma_collection_iterator_t names_iter;
+  ecma_object_t *object_p = ecma_get_object_from_value (obj_val);
+  ecma_collection_header_t *names_p = ecma_op_object_get_property_names (object_p, false, true, true);
+  ecma_collection_iterator_init (&names_iter, names_p);
+
+  ecma_value_t property_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  bool continuous = true;
+
+  while (continuous
+         && ecma_collection_iterator_next (&names_iter))
+  {
+    ecma_string_t *property_name_p = ecma_get_string_from_value (*names_iter.current_value_p);
+    property_value = ecma_op_object_get (object_p, property_name_p);
+
+    if (ECMA_IS_VALUE_ERROR (property_value))
+    {
+      break;
+    }
+
+    continuous = foreach_p (*names_iter.current_value_p, property_value, user_data_p);
+    ecma_free_value (property_value);
+  }
+
+  ecma_free_values_collection (names_p, true);
+
+  if (!ECMA_IS_VALUE_ERROR (property_value))
+  {
+    return true;
+  }
+
+  ecma_free_value (property_value);
+  return false;
+} /* jerry_foreach_object_property */
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+/**
+ * Resolve or reject the promise with an argument.
+ *
+ * @return undefined value - if success
+ *         value marked with error flag - otherwise
+ */
+jerry_value_t
+jerry_resolve_or_reject_promise (jerry_value_t promise, /**< the promise value */
+                                 jerry_value_t argument, /**< the argument */
+                                 bool is_resolve) /**< whether the promise should be resolved or rejected */
+{
+  jerry_assert_api_available ();
+
+  if (!ecma_is_value_object (promise) || !ecma_is_promise (ecma_get_object_from_value (promise)))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG (wrong_args_msg_p));
+  }
+
+  ecma_string_t str;
+
+  if (is_resolve)
+  {
+    ecma_init_ecma_magic_string (&str, LIT_INTERNAL_MAGIC_STRING_RESOLVE_FUNCTION);
+  }
+  else
+  {
+    ecma_init_ecma_magic_string (&str, LIT_INTERNAL_MAGIC_STRING_REJECT_FUNCTION);
+  }
+
+  ecma_value_t function = ecma_op_object_get (ecma_get_object_from_value (promise), &str);
+
+  ecma_value_t ret = ecma_op_function_call (ecma_get_object_from_value (function),
+                                            ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                            &argument,
+                                            1);
+
+  ecma_free_value (function);
+
+  return ret;
+} /* jerry_resolve_or_reject_promise */
+
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+
+/**
+ * Validate UTF-8 string
+ *
+ * @return true - if UTF-8 string is well-formed
+ *         false - otherwise
+ */
+bool
+jerry_is_valid_utf8_string (const jerry_char_t *utf8_buf_p, /**< UTF-8 string */
+                            jerry_size_t buf_size) /**< string size */
+{
+  return lit_is_valid_utf8_string ((lit_utf8_byte_t *) utf8_buf_p,
+                                   (lit_utf8_size_t) buf_size);
+} /* jerry_is_valid_utf8_string */
+
+/**
+ * Validate CESU-8 string
+ *
+ * @return true - if CESU-8 string is well-formed
+ *         false - otherwise
+ */
+bool
+jerry_is_valid_cesu8_string (const jerry_char_t *cesu8_buf_p, /**< CESU-8 string */
+                             jerry_size_t buf_size) /**< string size */
+{
+  return lit_is_valid_cesu8_string ((lit_utf8_byte_t *) cesu8_buf_p,
+                                    (lit_utf8_size_t) buf_size);
+} /* jerry_is_valid_cesu8_string */
+
+/*
+ * Create a jerry instance for external context.
+ *
+ * @return the pointer to the instance.
+ */
+jerry_instance_t *
+jerry_create_instance (uint32_t heap_size, /**< the size of heap */
+                       jerry_instance_alloc_t alloc, /**< the alloc function */
+                       void *cb_data_p) /**< the cb_data for alloc function */
+{
+  JERRY_UNUSED (heap_size);
+
+#ifdef JERRY_ENABLE_EXTERNAL_CONTEXT
+
+  size_t total_size = sizeof (jerry_instance_t) + JMEM_ALIGNMENT;
+
+#ifndef JERRY_SYSTEM_ALLOCATOR
+  heap_size = JERRY_ALIGNUP (heap_size, JMEM_ALIGNMENT);
+
+  /* Minimum heap size is 1Kbyte. */
+  if (heap_size < 1024)
+  {
+    return NULL;
+  }
+
+  total_size += heap_size;
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+  total_size += sizeof (jerry_hash_table_t);
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+
+  total_size = JERRY_ALIGNUP (total_size, JMEM_ALIGNMENT);
+
+  jerry_instance_t *instance_p = (jerry_instance_t *) alloc (total_size, cb_data_p);
+
+  if (instance_p == NULL)
+  {
+    return NULL;
+  }
+
+  memset (instance_p, 0, total_size);
+
+  uintptr_t instance_ptr = ((uintptr_t) instance_p) + sizeof (jerry_instance_t);
+  instance_ptr = JERRY_ALIGNUP (instance_ptr, (uintptr_t) JMEM_ALIGNMENT);
+
+  uint8_t *byte_p = (uint8_t *) instance_ptr;
+
+#ifndef JERRY_SYSTEM_ALLOCATOR
+  instance_p->heap_p = (jmem_heap_t *) byte_p;
+  instance_p->heap_size = heap_size;
+  byte_p += heap_size;
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+  instance_p->lcache_p = byte_p;
+  byte_p += sizeof (jerry_hash_table_t);
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+
+  JERRY_ASSERT (byte_p <= ((uint8_t *) instance_p) + total_size);
+
+  JERRY_UNUSED (byte_p);
+  return instance_p;
+
+#else /* !JERRY_ENABLE_EXTERNAL_CONTEXT */
+
+  JERRY_UNUSED (alloc);
+  JERRY_UNUSED (cb_data_p);
+
+  return NULL;
+
+#endif /* JERRY_ENABLE_EXTERNAL_CONTEXT */
+} /* jerry_create_instance */
+
+/**
+ * If JERRY_VM_EXEC_STOP is defined the callback passed to this function is
+ * periodically called with the user_p argument. If frequency is greater
+ * than 1, the callback is only called at every frequency ticks.
+ */
+void
+jerry_set_vm_exec_stop_callback (jerry_vm_exec_stop_callback_t stop_cb, /**< periodically called user function */
+                                 void *user_p, /**< pointer passed to the function */
+                                 uint32_t frequency) /**< frequency of the function call */
+{
+#ifdef JERRY_VM_EXEC_STOP
+  if (frequency == 0)
+  {
+    frequency = 1;
+  }
+
+  JERRY_CONTEXT (vm_exec_stop_frequency) = frequency;
+  JERRY_CONTEXT (vm_exec_stop_counter) = frequency;
+  JERRY_CONTEXT (vm_exec_stop_user_p) = user_p;
+  JERRY_CONTEXT (vm_exec_stop_cb) = stop_cb;
+#else /* !JERRY_VM_EXEC_STOP */
+  JERRY_UNUSED (stop_cb);
+  JERRY_UNUSED (user_p);
+  JERRY_UNUSED (frequency);
+#endif /* JERRY_VM_EXEC_STOP */
+} /* jerry_set_vm_exec_stop_callback */
+
+/**
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/config.h b/deps/jerry/jerry-core/config.h
new file mode 100644 (file)
index 0000000..8e10ae0
--- /dev/null
@@ -0,0 +1,96 @@
+/* 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.
+ */
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+/**
+ * Limit of data (system heap, engine's data except engine's own heap)
+ */
+#define CONFIG_MEM_DATA_LIMIT_MINUS_HEAP_SIZE (1024)
+
+/**
+ * Limit of stack size
+ */
+#define CONFIG_MEM_STACK_LIMIT (4096)
+
+/**
+ * Size of heap
+ */
+#ifndef CONFIG_MEM_HEAP_AREA_SIZE
+# define CONFIG_MEM_HEAP_AREA_SIZE (512 * 1024)
+#endif /* !CONFIG_MEM_HEAP_AREA_SIZE */
+
+/**
+ * Max heap usage limit
+ */
+#define CONFIG_MEM_HEAP_MAX_LIMIT 8192
+
+/**
+ * Desired limit of heap usage
+ */
+#define CONFIG_MEM_HEAP_DESIRED_LIMIT (JERRY_MIN (CONFIG_MEM_HEAP_AREA_SIZE / 32, CONFIG_MEM_HEAP_MAX_LIMIT))
+
+/**
+ * Use 32-bit/64-bit float for ecma-numbers
+ */
+#define CONFIG_ECMA_NUMBER_FLOAT32 (1u) /* 32-bit float */
+#define CONFIG_ECMA_NUMBER_FLOAT64 (2u) /* 64-bit float */
+
+#ifndef CONFIG_ECMA_NUMBER_TYPE
+# define CONFIG_ECMA_NUMBER_TYPE CONFIG_ECMA_NUMBER_FLOAT64
+#else /* CONFIG_ECMA_NUMBER_TYPE */
+# if (CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 \
+      && CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT64)
+#  error "ECMA-number storage is configured incorrectly"
+# endif /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32
+           && CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT64 */
+#endif /* !CONFIG_ECMA_NUMBER_TYPE */
+
+#if (!defined (CONFIG_DISABLE_DATE_BUILTIN) && (CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32))
+#  error "Date does not support float32"
+#endif
+
+/**
+ * Disable ECMA lookup cache
+ */
+// #define CONFIG_ECMA_LCACHE_DISABLE
+
+/**
+ * Disable ECMA property hashmap
+ */
+// #define CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+
+/**
+ * Share of newly allocated since last GC objects among all currently allocated objects,
+ * after achieving which, GC is started upon low severity try-give-memory-back requests.
+ *
+ * Share is calculated as the following:
+ *                1.0 / CONFIG_ECMA_GC_NEW_OBJECTS_SHARE_TO_START_GC
+ */
+#define CONFIG_ECMA_GC_NEW_OBJECTS_SHARE_TO_START_GC (16)
+
+/**
+ * Link Global Environment to an empty declarative lexical environment
+ * instead of lexical environment bound to Global Object.
+ */
+// #define CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE
+
+/**
+ * Number of ecma values inlined into VM stack frame
+ */
+#define CONFIG_VM_STACK_FRAME_INLINED_VALUES_NUMBER (16)
+
+#endif /* !CONFIG_H */
diff --git a/deps/jerry/jerry-core/debugger/debugger-sha1.c b/deps/jerry/jerry-core/debugger/debugger-sha1.c
new file mode 100644 (file)
index 0000000..7078424
--- /dev/null
@@ -0,0 +1,370 @@
+/* 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.
+ */
+
+/*
+ *  FIPS-180-1 compliant SHA-1 implementation
+ *
+ *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  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.
+ *
+ *  This file is part of mbed TLS (https://tls.mbed.org)
+ */
+
+/*
+ *  The SHA-1 standard was published by NIST in 1993.
+ *
+ *  http://www.itl.nist.gov/fipspubs/fip180-1.htm
+ */
+
+#include "debugger.h"
+
+#ifdef JERRY_DEBUGGER
+
+/**
+ * SHA-1 context structure.
+ */
+typedef struct
+{
+  uint32_t total[2]; /**< number of bytes processed */
+  uint32_t state[5]; /**< intermediate digest state */
+  uint8_t buffer[64]; /**< data block being processed */
+} jerry_sha1_context;
+
+/* 32-bit integer manipulation macros (big endian). */
+
+#define JERRY_SHA1_GET_UINT32_BE(n, b, i) \
+{ \
+  (n) = (((uint32_t) (b)[(i) + 0]) << 24) \
+        | (((uint32_t) (b)[(i) + 1]) << 16) \
+        | (((uint32_t) (b)[(i) + 2]) << 8) \
+        | ((uint32_t) (b)[(i) + 3]); \
+}
+
+#define JERRY_SHA1_PUT_UINT32_BE(n, b, i) \
+{ \
+  (b)[(i) + 0] = (uint8_t) ((n) >> 24); \
+  (b)[(i) + 1] = (uint8_t) ((n) >> 16); \
+  (b)[(i) + 2] = (uint8_t) ((n) >> 8); \
+  (b)[(i) + 3] = (uint8_t) ((n)); \
+}
+
+/**
+ * Initialize SHA-1 context.
+ */
+static void
+jerry_sha1_init (jerry_sha1_context *sha1_context_p) /**< SHA-1 context */
+{
+  memset (sha1_context_p, 0, sizeof (jerry_sha1_context));
+
+  sha1_context_p->total[0] = 0;
+  sha1_context_p->total[1] = 0;
+
+  sha1_context_p->state[0] = 0x67452301;
+  sha1_context_p->state[1] = 0xEFCDAB89;
+  sha1_context_p->state[2] = 0x98BADCFE;
+  sha1_context_p->state[3] = 0x10325476;
+  sha1_context_p->state[4] = 0xC3D2E1F0;
+} /* jerry_sha1_init */
+
+#define JERRY_SHA1_P(a, b, c, d, e, x) \
+do { \
+  e += JERRY_SHA1_SHIFT (a, 5) + JERRY_SHA1_F (b, c, d) + K + x; \
+  b = JERRY_SHA1_SHIFT (b, 30); \
+} while (0)
+
+/**
+ * Update SHA-1 internal buffer status.
+ */
+static void
+jerry_sha1_process (jerry_sha1_context *sha1_context_p, /**< SHA-1 context */
+                    const uint8_t data[64]) /**< data buffer */
+{
+  uint32_t temp, W[16], A, B, C, D, E;
+
+  JERRY_SHA1_GET_UINT32_BE (W[0], data, 0);
+  JERRY_SHA1_GET_UINT32_BE (W[1], data, 4);
+  JERRY_SHA1_GET_UINT32_BE (W[2], data, 8);
+  JERRY_SHA1_GET_UINT32_BE (W[3], data, 12);
+  JERRY_SHA1_GET_UINT32_BE (W[4], data, 16);
+  JERRY_SHA1_GET_UINT32_BE (W[5], data, 20);
+  JERRY_SHA1_GET_UINT32_BE (W[6], data, 24);
+  JERRY_SHA1_GET_UINT32_BE (W[7], data, 28);
+  JERRY_SHA1_GET_UINT32_BE (W[8], data, 32);
+  JERRY_SHA1_GET_UINT32_BE (W[9], data, 36);
+  JERRY_SHA1_GET_UINT32_BE (W[10], data, 40);
+  JERRY_SHA1_GET_UINT32_BE (W[11], data, 44);
+  JERRY_SHA1_GET_UINT32_BE (W[12], data, 48);
+  JERRY_SHA1_GET_UINT32_BE (W[13], data, 52);
+  JERRY_SHA1_GET_UINT32_BE (W[14], data, 56);
+  JERRY_SHA1_GET_UINT32_BE (W[15], data, 60);
+
+#define JERRY_SHA1_SHIFT(x, n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
+
+#define JERRY_SHA1_R(t) \
+( \
+  temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ W[(t - 14) & 0x0F] ^ W[t & 0x0F], \
+  W[t & 0x0F] = JERRY_SHA1_SHIFT (temp, 1) \
+)
+
+  A = sha1_context_p->state[0];
+  B = sha1_context_p->state[1];
+  C = sha1_context_p->state[2];
+  D = sha1_context_p->state[3];
+  E = sha1_context_p->state[4];
+
+  uint32_t K = 0x5A827999;
+
+#define JERRY_SHA1_F(x, y, z) (z ^ (x & (y ^ z)))
+
+  JERRY_SHA1_P (A, B, C, D, E, W[0]);
+  JERRY_SHA1_P (E, A, B, C, D, W[1]);
+  JERRY_SHA1_P (D, E, A, B, C, W[2]);
+  JERRY_SHA1_P (C, D, E, A, B, W[3]);
+  JERRY_SHA1_P (B, C, D, E, A, W[4]);
+  JERRY_SHA1_P (A, B, C, D, E, W[5]);
+  JERRY_SHA1_P (E, A, B, C, D, W[6]);
+  JERRY_SHA1_P (D, E, A, B, C, W[7]);
+  JERRY_SHA1_P (C, D, E, A, B, W[8]);
+  JERRY_SHA1_P (B, C, D, E, A, W[9]);
+  JERRY_SHA1_P (A, B, C, D, E, W[10]);
+  JERRY_SHA1_P (E, A, B, C, D, W[11]);
+  JERRY_SHA1_P (D, E, A, B, C, W[12]);
+  JERRY_SHA1_P (C, D, E, A, B, W[13]);
+  JERRY_SHA1_P (B, C, D, E, A, W[14]);
+  JERRY_SHA1_P (A, B, C, D, E, W[15]);
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (16));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (17));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (18));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (19));
+
+#undef JERRY_SHA1_F
+
+  K = 0x6ED9EBA1;
+
+#define JERRY_SHA1_F(x, y, z) (x ^ y ^ z)
+
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (20));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (21));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (22));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (23));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (24));
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (25));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (26));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (27));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (28));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (29));
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (30));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (31));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (32));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (33));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (34));
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (35));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (36));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (37));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (38));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (39));
+
+#undef JERRY_SHA1_F
+
+  K = 0x8F1BBCDC;
+
+#define JERRY_SHA1_F(x, y, z) ((x & y) | (z & (x | y)))
+
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (40));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (41));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (42));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (43));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (44));
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (45));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (46));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (47));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (48));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (49));
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (50));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (51));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (52));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (53));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (54));
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (55));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (56));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (57));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (58));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (59));
+
+#undef JERRY_SHA1_F
+
+  K = 0xCA62C1D6;
+
+#define JERRY_SHA1_F(x, y, z) (x ^ y ^ z)
+
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (60));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (61));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (62));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (63));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (64));
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (65));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (66));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (67));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (68));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (69));
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (70));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (71));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (72));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (73));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (74));
+  JERRY_SHA1_P (A, B, C, D, E, JERRY_SHA1_R (75));
+  JERRY_SHA1_P (E, A, B, C, D, JERRY_SHA1_R (76));
+  JERRY_SHA1_P (D, E, A, B, C, JERRY_SHA1_R (77));
+  JERRY_SHA1_P (C, D, E, A, B, JERRY_SHA1_R (78));
+  JERRY_SHA1_P (B, C, D, E, A, JERRY_SHA1_R (79));
+
+#undef JERRY_SHA1_F
+
+  sha1_context_p->state[0] += A;
+  sha1_context_p->state[1] += B;
+  sha1_context_p->state[2] += C;
+  sha1_context_p->state[3] += D;
+  sha1_context_p->state[4] += E;
+
+#undef JERRY_SHA1_SHIFT
+#undef JERRY_SHA1_R
+} /* jerry_sha1_process */
+
+#undef JERRY_SHA1_P
+
+/**
+ * SHA-1 update buffer.
+ */
+static void
+jerry_sha1_update (jerry_sha1_context *sha1_context_p, /**< SHA-1 context */
+                   const uint8_t *source_p, /**< source buffer */
+                   size_t source_length) /**< length of source buffer */
+{
+  size_t fill;
+  uint32_t left;
+
+  if (source_length == 0)
+  {
+    return;
+  }
+
+  left = sha1_context_p->total[0] & 0x3F;
+  fill = 64 - left;
+
+  sha1_context_p->total[0] += (uint32_t) source_length;
+
+  /* Check overflow. */
+  if (sha1_context_p->total[0] < (uint32_t) source_length)
+  {
+    sha1_context_p->total[1]++;
+  }
+
+  if (left && source_length >= fill)
+  {
+    memcpy ((void *) (sha1_context_p->buffer + left), source_p, fill);
+    jerry_sha1_process (sha1_context_p, sha1_context_p->buffer);
+    source_p += fill;
+    source_length -= fill;
+    left = 0;
+  }
+
+  while (source_length >= 64)
+  {
+    jerry_sha1_process (sha1_context_p, source_p);
+    source_p += 64;
+    source_length -= 64;
+  }
+
+  if (source_length > 0)
+  {
+    memcpy ((void *) (sha1_context_p->buffer + left), source_p, source_length);
+  }
+} /* jerry_sha1_update */
+
+/**
+ * SHA-1 final digest.
+ */
+static void
+jerry_sha1_finish (jerry_sha1_context *sha1_context_p, /**< SHA-1 context */
+                   uint8_t destination_p[20]) /**< result */
+{
+  uint8_t buffer[16];
+
+  uint32_t high = (sha1_context_p->total[0] >> 29) | (sha1_context_p->total[1] << 3);
+  uint32_t low = (sha1_context_p->total[0] << 3);
+
+  uint32_t last = sha1_context_p->total[0] & 0x3F;
+  uint32_t padn = (last < 56) ? (56 - last) : (120 - last);
+
+  memset (buffer, 0, sizeof (buffer));
+  buffer[0] = 0x80;
+
+  while (padn > sizeof (buffer))
+  {
+    jerry_sha1_update (sha1_context_p, buffer, sizeof (buffer));
+    buffer[0] = 0;
+    padn -= (uint32_t) sizeof (buffer);
+  }
+
+  jerry_sha1_update (sha1_context_p, buffer, padn);
+
+  JERRY_SHA1_PUT_UINT32_BE (high, buffer, 0);
+  JERRY_SHA1_PUT_UINT32_BE (low, buffer, 4);
+
+  jerry_sha1_update (sha1_context_p, buffer, 8);
+
+  JERRY_SHA1_PUT_UINT32_BE (sha1_context_p->state[0], destination_p, 0);
+  JERRY_SHA1_PUT_UINT32_BE (sha1_context_p->state[1], destination_p, 4);
+  JERRY_SHA1_PUT_UINT32_BE (sha1_context_p->state[2], destination_p, 8);
+  JERRY_SHA1_PUT_UINT32_BE (sha1_context_p->state[3], destination_p, 12);
+  JERRY_SHA1_PUT_UINT32_BE (sha1_context_p->state[4], destination_p, 16);
+} /* jerry_sha1_finish */
+
+#undef JERRY_SHA1_GET_UINT32_BE
+#undef JERRY_SHA1_PUT_UINT32_BE
+
+/**
+ * Computes the SHA-1 value of the combination of the two input buffers.
+ */
+void
+jerry_debugger_compute_sha1 (const uint8_t *source1_p, /**< first part of the input */
+                             size_t source1_length, /**< length of the first part */
+                             const uint8_t *source2_p, /**< second part of the input */
+                             size_t source2_length, /**< length of the second part */
+                             uint8_t destination_p[20]) /**< result */
+{
+  JMEM_DEFINE_LOCAL_ARRAY (sha1_context_p, 1, jerry_sha1_context);
+
+  jerry_sha1_init (sha1_context_p);
+  jerry_sha1_update (sha1_context_p, source1_p, source1_length);
+  jerry_sha1_update (sha1_context_p, source2_p, source2_length);
+  jerry_sha1_finish (sha1_context_p, destination_p);
+
+  JMEM_FINALIZE_LOCAL_ARRAY (sha1_context_p);
+} /* jerry_debugger_compute_sha1 */
+
+#endif /* JERRY_DEBUGGER */
diff --git a/deps/jerry/jerry-core/debugger/debugger-ws.c b/deps/jerry/jerry-core/debugger/debugger-ws.c
new file mode 100644 (file)
index 0000000..3b2255f
--- /dev/null
@@ -0,0 +1,551 @@
+/* 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.
+ */
+
+#include "debugger.h"
+#include "jcontext.h"
+#include "jerryscript-port.h"
+
+#ifdef JERRY_DEBUGGER
+
+#include <arpa/inet.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+/**
+ * Masking-key is available.
+ */
+#define JERRY_DEBUGGER_WEBSOCKET_MASK_BIT 0x80
+
+/**
+ * Opcode type mask.
+ */
+#define JERRY_DEBUGGER_WEBSOCKET_OPCODE_MASK 0x0fu
+
+/**
+ * Packet length mask.
+ */
+#define JERRY_DEBUGGER_WEBSOCKET_LENGTH_MASK 0x7fu
+
+/**
+ * Payload mask size in bytes of a websocket package.
+ */
+#define JERRY_DEBUGGER_WEBSOCKET_MASK_SIZE 4
+
+/**
+ * Header for incoming packets.
+ */
+typedef struct
+{
+  uint8_t ws_opcode; /**< websocket opcode */
+  uint8_t size; /**< size of the message */
+  uint8_t mask[4]; /**< mask bytes */
+} jerry_debugger_receive_header_t;
+
+/**
+ * Close the socket connection to the client.
+ */
+static void
+jerry_debugger_close_connection_tcp (bool log_error) /**< log error */
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+  JERRY_CONTEXT (debugger_flags) = (uint8_t) JERRY_DEBUGGER_VM_IGNORE;
+
+  if (log_error)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: %s\n", strerror (errno));
+  }
+
+  jerry_port_log (JERRY_LOG_LEVEL_DEBUG, "Debugger client connection closed.\n");
+
+  close (JERRY_CONTEXT (debugger_connection));
+  JERRY_CONTEXT (debugger_connection) = -1;
+
+  jerry_debugger_free_unreferenced_byte_code ();
+} /* jerry_debugger_close_connection_tcp */
+
+/**
+ * Send message to the client side.
+ *
+ * @return true - if the data was sent successfully to the client side
+ *         false - otherwise
+ */
+static bool
+jerry_debugger_send_tcp (const uint8_t *data_p, /**< data pointer */
+                         size_t data_size) /**< data size */
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+  do
+  {
+    ssize_t sent_bytes = send (JERRY_CONTEXT (debugger_connection), data_p, data_size, 0);
+
+    if (sent_bytes < 0)
+    {
+      if (errno == EWOULDBLOCK)
+      {
+        continue;
+      }
+
+      jerry_debugger_close_connection_tcp (true);
+      return false;
+    }
+
+    data_size -= (size_t) sent_bytes;
+    data_p += sent_bytes;
+  }
+  while (data_size > 0);
+
+  return true;
+} /* jerry_debugger_send_tcp */
+
+/**
+ * Convert a 6-bit value to a Base64 character.
+ *
+ * @return Base64 character
+ */
+static uint8_t
+jerry_to_base64_character (uint8_t value) /**< 6-bit value */
+{
+  if (value < 26)
+  {
+    return (uint8_t) (value + 'A');
+  }
+
+  if (value < 52)
+  {
+    return (uint8_t) (value - 26 + 'a');
+  }
+
+  if (value < 62)
+  {
+    return (uint8_t) (value - 52 + '0');
+  }
+
+  if (value == 62)
+  {
+    return (uint8_t) '+';
+  }
+
+  return (uint8_t) '/';
+} /* jerry_to_base64_character */
+
+/**
+ * Encode a byte sequence into Base64 string.
+ */
+static void
+jerry_to_base64 (const uint8_t *source_p, /**< source data */
+                 uint8_t *destination_p, /**< destination buffer */
+                 size_t length) /**< length of source, must be divisible by 3 */
+{
+  while (length >= 3)
+  {
+    uint8_t value = (source_p[0] >> 2);
+    destination_p[0] = jerry_to_base64_character (value);
+
+    value = (uint8_t) (((source_p[0] << 4) | (source_p[1] >> 4)) & 0x3f);
+    destination_p[1] = jerry_to_base64_character (value);
+
+    value = (uint8_t) (((source_p[1] << 2) | (source_p[2] >> 6)) & 0x3f);
+    destination_p[2] = jerry_to_base64_character (value);
+
+    value = (uint8_t) (source_p[2] & 0x3f);
+    destination_p[3] = jerry_to_base64_character (value);
+
+    source_p += 3;
+    destination_p += 4;
+    length -= 3;
+  }
+} /* jerry_to_base64 */
+
+/**
+ * Process WebSocket handshake.
+ *
+ * @return true - if the handshake was completed successfully
+ *         false - otherwise
+ */
+static bool
+jerry_process_handshake (int client_socket, /**< client socket */
+                         uint8_t *request_buffer_p) /**< temporary buffer */
+{
+  size_t request_buffer_size = 1024;
+  uint8_t *request_end_p = request_buffer_p;
+
+  /* Buffer request text until the double newlines are received. */
+  while (true)
+  {
+    size_t length = request_buffer_size - 1u - (size_t) (request_end_p - request_buffer_p);
+
+    if (length == 0)
+    {
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Handshake buffer too small.\n");
+      return false;
+    }
+
+    ssize_t size = recv (client_socket, request_end_p, length, 0);
+
+    if (size < 0)
+    {
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: %s\n", strerror (errno));
+      return false;
+    }
+
+    request_end_p += (size_t) size;
+    *request_end_p = 0;
+
+    if (request_end_p > request_buffer_p + 4
+        && memcmp (request_end_p - 4, "\r\n\r\n", 4) == 0)
+    {
+      break;
+    }
+  }
+
+  /* Check protocol. */
+  const char *text_p = "GET /jerry-debugger";
+  size_t text_len = strlen (text_p);
+
+  if ((size_t) (request_end_p - request_buffer_p) < text_len
+      || memcmp (request_buffer_p, text_p, text_len) != 0)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Invalid handshake format.\n");
+    return false;
+  }
+
+  uint8_t *websocket_key_p = request_buffer_p + text_len;
+
+  text_p = "Sec-WebSocket-Key:";
+  text_len = strlen (text_p);
+
+  while (true)
+  {
+    if ((size_t) (request_end_p - websocket_key_p) < text_len)
+    {
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Sec-WebSocket-Key not found.\n");
+      return false;
+    }
+
+    if (websocket_key_p[0] == 'S'
+        && websocket_key_p[-1] == '\n'
+        && websocket_key_p[-2] == '\r'
+        && memcmp (websocket_key_p, text_p, text_len) == 0)
+    {
+      websocket_key_p += text_len;
+      break;
+    }
+
+    websocket_key_p++;
+  }
+
+  /* String terminated by double newlines. */
+
+  while (*websocket_key_p == ' ')
+  {
+    websocket_key_p++;
+  }
+
+  uint8_t *websocket_key_end_p = websocket_key_p;
+
+  while (*websocket_key_end_p > ' ')
+  {
+    websocket_key_end_p++;
+  }
+
+  /* Since the request_buffer_p is not needed anymore it can
+   * be reused for storing the SHA-1 key and Base64 string. */
+
+  const size_t sha1_length = 20;
+
+  jerry_debugger_compute_sha1 (websocket_key_p,
+                               (size_t) (websocket_key_end_p - websocket_key_p),
+                               (const uint8_t *) "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
+                               36,
+                               request_buffer_p);
+
+  /* The SHA-1 key is 20 bytes long but jerry_to_base64 expects
+   * a length divisible by 3 so an extra 0 is appended at the end. */
+  request_buffer_p[sha1_length] = 0;
+
+  jerry_to_base64 (request_buffer_p, request_buffer_p + sha1_length + 1, sha1_length + 1);
+
+  /* Last value must be replaced by equal sign. */
+
+  text_p = "HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: ";
+
+  if (!jerry_debugger_send_tcp ((const uint8_t *) text_p, strlen (text_p))
+      || !jerry_debugger_send_tcp (request_buffer_p + sha1_length + 1, 27))
+  {
+    return false;
+  }
+
+  text_p = "=\r\n\r\n";
+  return jerry_debugger_send_tcp ((const uint8_t *) text_p, strlen (text_p));
+} /* jerry_process_handshake */
+
+/**
+ * Initialize the socket connection.
+ *
+ * @return true - if the connection succeeded
+ *         false - otherwise
+ */
+bool
+jerry_debugger_accept_connection (void)
+{
+  int server_socket;
+  struct sockaddr_in addr;
+  socklen_t sin_size = sizeof (struct sockaddr_in);
+
+  addr.sin_family = AF_INET;
+  addr.sin_port = htons (JERRY_CONTEXT (debugger_port));
+  addr.sin_addr.s_addr = INADDR_ANY;
+
+  if ((server_socket = socket (AF_INET, SOCK_STREAM, 0)) == -1)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: %s\n", strerror (errno));
+    return false;
+  }
+
+  int opt_value = 1;
+
+  if (setsockopt (server_socket, SOL_SOCKET, SO_REUSEADDR, &opt_value, sizeof (int)) == -1)
+  {
+    close (server_socket);
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: %s\n", strerror (errno));
+    return false;
+  }
+
+  if (bind (server_socket, (struct sockaddr *)&addr, sizeof (struct sockaddr)) == -1)
+  {
+    close (server_socket);
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: %s\n", strerror (errno));
+    return false;
+  }
+
+  if (listen (server_socket, 1) == -1)
+  {
+    close (server_socket);
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: %s\n", strerror (errno));
+    return false;
+  }
+
+  jerry_port_log (JERRY_LOG_LEVEL_DEBUG, "Waiting for client connection\n");
+
+  JERRY_CONTEXT (debugger_connection) = accept (server_socket, (struct sockaddr *)&addr, &sin_size);
+
+  if (JERRY_CONTEXT (debugger_connection) == -1)
+  {
+    close (server_socket);
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: %s\n", strerror (errno));
+    return false;
+  }
+
+  close (server_socket);
+
+  JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) | JERRY_DEBUGGER_CONNECTED);
+
+  bool is_handshake_ok = false;
+
+  JMEM_DEFINE_LOCAL_ARRAY (request_buffer_p, 1024, uint8_t);
+
+  is_handshake_ok = jerry_process_handshake (JERRY_CONTEXT (debugger_connection),
+                                             request_buffer_p);
+
+  JMEM_FINALIZE_LOCAL_ARRAY (request_buffer_p);
+
+  if (!is_handshake_ok)
+  {
+    jerry_debugger_close_connection ();
+    return false;
+  }
+
+  if (!jerry_debugger_send_configuration (JERRY_DEBUGGER_MAX_RECEIVE_SIZE))
+  {
+    return false;
+  }
+
+  /* Set non-blocking mode. */
+  int socket_flags = fcntl (JERRY_CONTEXT (debugger_connection), F_GETFL, 0);
+
+  if (socket_flags < 0)
+  {
+    jerry_debugger_close_connection_tcp (true);
+    return false;
+  }
+
+  if (fcntl (JERRY_CONTEXT (debugger_connection), F_SETFL, socket_flags | O_NONBLOCK) == -1)
+  {
+    jerry_debugger_close_connection_tcp (true);
+    return false;
+  }
+
+  jerry_port_log (JERRY_LOG_LEVEL_DEBUG, "Connected from: %s\n", inet_ntoa (addr.sin_addr));
+
+  JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) | JERRY_DEBUGGER_VM_STOP);
+  JERRY_CONTEXT (debugger_stop_context) = NULL;
+
+  return true;
+} /* jerry_debugger_accept_connection */
+
+/**
+ * Close the socket connection to the client.
+ */
+inline void __attr_always_inline___
+jerry_debugger_close_connection (void)
+{
+  jerry_debugger_close_connection_tcp (false);
+} /* jerry_debugger_close_connection */
+
+/**
+ * Send message to the client side
+ *
+ * @return true - if the data was sent successfully to the debugger client,
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+jerry_debugger_send (size_t data_size) /**< data size */
+{
+  return jerry_debugger_send_tcp (JERRY_CONTEXT (debugger_send_buffer), data_size);
+} /* jerry_debugger_send */
+
+JERRY_STATIC_ASSERT (JERRY_DEBUGGER_MAX_RECEIVE_SIZE < 126,
+                     maximum_debug_message_receive_size_must_be_smaller_than_126);
+
+/**
+ * Receive message from the client.
+ *
+ * Note:
+ *   If the function returns with true, the value of
+ *   JERRY_DEBUGGER_VM_STOP flag should be ignored.
+ *
+ * @return true - if execution should be resumed,
+ *         false - otherwise
+ */
+bool
+jerry_debugger_receive (void)
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+  JERRY_CONTEXT (debugger_message_delay) = JERRY_DEBUGGER_MESSAGE_FREQUENCY;
+
+  uint8_t *recv_buffer_p = JERRY_CONTEXT (debugger_receive_buffer);
+  bool resume_exec = false;
+  uint8_t expected_message_type = 0;
+  void *message_data = NULL;
+
+  while (true)
+  {
+    uint32_t offset = JERRY_CONTEXT (debugger_receive_buffer_offset);
+
+    ssize_t byte_recv = recv (JERRY_CONTEXT (debugger_connection),
+                              recv_buffer_p + offset,
+                              JERRY_DEBUGGER_MAX_BUFFER_SIZE - offset,
+                              0);
+
+    if (byte_recv < 0)
+    {
+      if (errno != EWOULDBLOCK)
+      {
+        jerry_debugger_close_connection_tcp (true);
+        return true;
+      }
+
+      byte_recv = 0;
+    }
+
+    offset += (uint32_t) byte_recv;
+    JERRY_CONTEXT (debugger_receive_buffer_offset) = (uint16_t) offset;
+
+    if (offset < sizeof (jerry_debugger_receive_header_t))
+    {
+      if (expected_message_type != 0)
+      {
+        continue;
+      }
+
+      return resume_exec;
+    }
+
+    if ((recv_buffer_p[0] & ~JERRY_DEBUGGER_WEBSOCKET_OPCODE_MASK) != JERRY_DEBUGGER_WEBSOCKET_FIN_BIT
+        || (recv_buffer_p[1] & JERRY_DEBUGGER_WEBSOCKET_LENGTH_MASK) > JERRY_DEBUGGER_MAX_RECEIVE_SIZE
+        || !(recv_buffer_p[1] & JERRY_DEBUGGER_WEBSOCKET_MASK_BIT))
+    {
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Unsupported Websocket message.\n");
+      jerry_debugger_close_connection ();
+      return true;
+    }
+
+    if ((recv_buffer_p[0] & JERRY_DEBUGGER_WEBSOCKET_OPCODE_MASK) != JERRY_DEBUGGER_WEBSOCKET_BINARY_FRAME)
+    {
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Unsupported Websocket opcode.\n");
+      jerry_debugger_close_connection ();
+      return true;
+    }
+
+    uint32_t message_size = (uint32_t) (recv_buffer_p[1] & JERRY_DEBUGGER_WEBSOCKET_LENGTH_MASK);
+    uint32_t message_total_size = (uint32_t) (message_size + sizeof (jerry_debugger_receive_header_t));
+
+    if (offset < message_total_size)
+    {
+      if (expected_message_type != 0)
+      {
+        continue;
+      }
+
+      return resume_exec;
+    }
+
+    /* Unmask data bytes. */
+    uint8_t *data_p = recv_buffer_p + sizeof (jerry_debugger_receive_header_t);
+    const uint8_t *mask_p = data_p - JERRY_DEBUGGER_WEBSOCKET_MASK_SIZE;
+    const uint8_t *mask_end_p = data_p;
+    const uint8_t *data_end_p = data_p + message_size;
+
+    while (data_p < data_end_p)
+    {
+      /* Invert certain bits with xor operation. */
+      *data_p = *data_p ^ *mask_p;
+
+      data_p++;
+      mask_p++;
+
+      if (mask_p >= mask_end_p)
+      {
+        mask_p -= JERRY_DEBUGGER_WEBSOCKET_MASK_SIZE;
+      }
+    }
+
+    /* The jerry_debugger_process_message function is inlined
+     * so passing these arguments is essentially free. */
+    if (!jerry_debugger_process_message (recv_buffer_p + sizeof (jerry_debugger_receive_header_t),
+                                         message_size,
+                                         &resume_exec,
+                                         &expected_message_type,
+                                         &message_data))
+    {
+      return true;
+    }
+
+    if (message_total_size < offset)
+    {
+      memmove (recv_buffer_p,
+               recv_buffer_p + message_total_size,
+               offset - message_total_size);
+    }
+
+    JERRY_CONTEXT (debugger_receive_buffer_offset) = (uint16_t) (offset - message_total_size);
+  }
+} /* jerry_debugger_receive */
+
+#endif /* JERRY_DEBUGGER */
diff --git a/deps/jerry/jerry-core/debugger/debugger-ws.h b/deps/jerry/jerry-core/debugger/debugger-ws.h
new file mode 100644 (file)
index 0000000..20b55c6
--- /dev/null
@@ -0,0 +1,96 @@
+/* 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.
+ */
+
+#ifndef DEBUGGER_WS_H
+#define DEBUGGER_WS_H
+
+#include "ecma-globals.h"
+
+#ifdef JERRY_DEBUGGER
+
+/* JerryScript debugger protocol is a simplified version of RFC-6455 (WebSockets). */
+
+/**
+ * Maximum number of bytes transmitted or received.
+ */
+#define JERRY_DEBUGGER_MAX_BUFFER_SIZE 128
+
+/**
+ * Maximum number of bytes can be received in a single message.
+ */
+#define JERRY_DEBUGGER_MAX_SEND_SIZE (JERRY_DEBUGGER_MAX_BUFFER_SIZE - 1)
+
+/**
+ * Maximum number of bytes can be received in a single message.
+ */
+#define JERRY_DEBUGGER_MAX_RECEIVE_SIZE (JERRY_DEBUGGER_MAX_BUFFER_SIZE - 6)
+
+/**
+ * Last fragment of a Websocket package.
+ */
+#define JERRY_DEBUGGER_WEBSOCKET_FIN_BIT 0x80
+
+/**
+ * WebSocket opcode types.
+ */
+typedef enum
+{
+  JERRY_DEBUGGER_WEBSOCKET_TEXT_FRAME = 1, /**< text frame */
+  JERRY_DEBUGGER_WEBSOCKET_BINARY_FRAME = 2, /**< binary frame */
+  JERRY_DEBUGGER_WEBSOCKET_CLOSE_CONNECTION = 8, /**< close connection */
+  JERRY_DEBUGGER_WEBSOCKET_PING = 9, /**< ping (keep alive) frame */
+  JERRY_DEBUGGER_WEBSOCKET_PONG = 10, /**< reply to ping frame */
+} jerry_websocket_opcode_type_t;
+
+/**
+ * Header for outgoing packets.
+ */
+typedef struct
+{
+  uint8_t ws_opcode; /**< Websocket opcode */
+  uint8_t size; /**< size of the message */
+} jerry_debugger_send_header_t;
+
+/**
+ * Initialize the header of an outgoing message.
+ */
+#define JERRY_DEBUGGER_INIT_SEND_MESSAGE(message_p) \
+  (message_p)->header.ws_opcode = JERRY_DEBUGGER_WEBSOCKET_FIN_BIT | JERRY_DEBUGGER_WEBSOCKET_BINARY_FRAME
+
+/**
+ * Set the size of an outgoing message from type.
+ */
+#define JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE_FROM_TYPE(message_p, type) \
+  (message_p)->header.size = (uint8_t) (sizeof (type) - sizeof (jerry_debugger_send_header_t))
+
+/**
+ * Set the size of an outgoing message.
+ */
+#define JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE(message_p, byte_size) \
+  (message_p)->header.size = (uint8_t) (byte_size)
+
+bool jerry_debugger_accept_connection (void);
+void jerry_debugger_close_connection (void);
+
+bool jerry_debugger_send (size_t data_size);
+bool jerry_debugger_receive (void);
+
+void jerry_debugger_compute_sha1 (const uint8_t *input1, size_t input1_len,
+                                  const uint8_t *input2, size_t input2_len,
+                                  uint8_t output[20]);
+
+#endif /* JERRY_DEBUGGER */
+
+#endif /* DEBUGGER_WS_H */
diff --git a/deps/jerry/jerry-core/debugger/debugger.c b/deps/jerry/jerry-core/debugger/debugger.c
new file mode 100644 (file)
index 0000000..64436ea
--- /dev/null
@@ -0,0 +1,901 @@
+/* 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.
+ */
+
+#define _XOPEN_SOURCE 500 /* Required macro for sleep functions */
+
+#include "byte-code.h"
+#include "debugger.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-conversion.h"
+#include "ecma-eval.h"
+#include "ecma-objects.h"
+#include "jcontext.h"
+#include "jerryscript-port.h"
+#include "lit-char-helpers.h"
+
+#ifdef JERRY_DEBUGGER
+
+#ifdef HAVE_TIME_H
+#include <time.h>
+#elif defined (HAVE_UNISTD_H)
+#include <unistd.h>
+#endif /* HAVE_TIME_H */
+
+/**
+ * Type cast the debugger send buffer into a specific type.
+ */
+#define JERRY_DEBUGGER_SEND_BUFFER_AS(type, name_p) \
+  type *name_p = (type *) (&JERRY_CONTEXT (debugger_send_buffer))
+
+/**
+ * Type cast the debugger receive buffer into a specific type.
+ */
+#define JERRY_DEBUGGER_RECEIVE_BUFFER_AS(type, name_p) \
+  type *name_p = ((type *) recv_buffer_p)
+
+/**
+ * Sleep time in milliseconds between each jerry_debugger_receive call
+ */
+#define JERRY_DEBUGGER_TIMEOUT 100
+
+/**
+ * Free all unreferenced byte code structures which
+ * were not acknowledged by the debugger client.
+ */
+void
+jerry_debugger_free_unreferenced_byte_code (void)
+{
+  jerry_debugger_byte_code_free_t *byte_code_free_p;
+
+  byte_code_free_p = JMEM_CP_GET_POINTER (jerry_debugger_byte_code_free_t,
+                                          JERRY_CONTEXT (debugger_byte_code_free_tail));
+
+  while (byte_code_free_p != NULL)
+  {
+    jerry_debugger_byte_code_free_t *prev_byte_code_free_p;
+    prev_byte_code_free_p = JMEM_CP_GET_POINTER (jerry_debugger_byte_code_free_t,
+                                                 byte_code_free_p->prev_cp);
+
+    jmem_heap_free_block (byte_code_free_p,
+                          ((size_t) byte_code_free_p->size) << JMEM_ALIGNMENT_LOG);
+
+    byte_code_free_p = prev_byte_code_free_p;
+  }
+} /* jerry_debugger_free_unreferenced_byte_code */
+
+/**
+ * Send backtrace.
+ */
+static void
+jerry_debugger_send_backtrace (uint8_t *recv_buffer_p) /**< pointer the the received data */
+{
+  JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_get_backtrace_t, get_backtrace_p);
+
+  uint32_t max_depth;
+  memcpy (&max_depth, get_backtrace_p->max_depth, sizeof (uint32_t));
+
+  if (max_depth == 0)
+  {
+    max_depth = UINT32_MAX;
+  }
+
+  JERRY_DEBUGGER_SEND_BUFFER_AS (jerry_debugger_send_backtrace_t, backtrace_p);
+
+  JERRY_DEBUGGER_INIT_SEND_MESSAGE (backtrace_p);
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE_FROM_TYPE (backtrace_p, jerry_debugger_send_backtrace_t);
+  backtrace_p->type = JERRY_DEBUGGER_BACKTRACE;
+
+  vm_frame_ctx_t *frame_ctx_p = JERRY_CONTEXT (vm_top_context_p);
+
+  uint32_t current_frame = 0;
+
+  while (frame_ctx_p != NULL && max_depth > 0)
+  {
+    if (frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_DEBUGGER_IGNORE)
+    {
+      frame_ctx_p = frame_ctx_p->prev_context_p;
+      continue;
+    }
+
+    if (current_frame >= JERRY_DEBUGGER_SEND_MAX (jerry_debugger_frame_t))
+    {
+      if (!jerry_debugger_send (sizeof (jerry_debugger_send_backtrace_t)))
+      {
+        return;
+      }
+      current_frame = 0;
+    }
+
+    jerry_debugger_frame_t *frame_p = backtrace_p->frames + current_frame;
+
+    jmem_cpointer_t byte_code_cp;
+    JMEM_CP_SET_NON_NULL_POINTER (byte_code_cp, frame_ctx_p->bytecode_header_p);
+    memcpy (frame_p->byte_code_cp, &byte_code_cp, sizeof (jmem_cpointer_t));
+
+    uint32_t offset = (uint32_t) (frame_ctx_p->byte_code_p - (uint8_t *) frame_ctx_p->bytecode_header_p);
+    memcpy (frame_p->offset, &offset, sizeof (uint32_t));
+
+    frame_ctx_p = frame_ctx_p->prev_context_p;
+    current_frame++;
+    max_depth--;
+  }
+
+  size_t message_size = current_frame * sizeof (jerry_debugger_frame_t);
+
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE (backtrace_p, 1 + message_size);
+  backtrace_p->type = JERRY_DEBUGGER_BACKTRACE_END;
+
+  jerry_debugger_send (sizeof (jerry_debugger_send_type_t) + message_size);
+} /* jerry_debugger_send_backtrace */
+
+/**
+ * Send result of evaluated expression.
+ *
+ * @return true - if no error is occured
+ *         false - otherwise
+ */
+static bool
+jerry_debugger_send_eval (const lit_utf8_byte_t *eval_string_p, /**< evaluated string */
+                          size_t eval_string_size) /**< evaluated string size */
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+  JERRY_ASSERT (!(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_IGNORE));
+
+  JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) | JERRY_DEBUGGER_VM_IGNORE);
+  ecma_value_t result = ecma_op_eval_chars_buffer (eval_string_p, eval_string_size, true, false);
+  JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) & ~JERRY_DEBUGGER_VM_IGNORE);
+
+  if (!ECMA_IS_VALUE_ERROR (result))
+  {
+    ecma_value_t to_string_value = ecma_op_to_string (result);
+    ecma_free_value (result);
+    result = to_string_value;
+  }
+
+  ecma_value_t message = result;
+  uint8_t type = JERRY_DEBUGGER_EVAL_RESULT;
+
+  if (ECMA_IS_VALUE_ERROR (result))
+  {
+    type = JERRY_DEBUGGER_EVAL_ERROR;
+
+    if (ecma_is_value_object (result))
+    {
+      ecma_string_t *message_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_MESSAGE);
+
+      message = ecma_op_object_find (ecma_get_object_from_value (result),
+                                     message_string_p);
+
+      ecma_deref_ecma_string (message_string_p);
+
+      if (!ecma_is_value_string (message)
+          || ecma_string_is_empty (ecma_get_string_from_value (message)))
+      {
+        ecma_free_value (message);
+        lit_magic_string_id_t id = ecma_object_get_class_name (ecma_get_object_from_value (result));
+        ecma_free_value (result);
+
+        const lit_utf8_byte_t *string_p = lit_get_magic_string_utf8 (id);
+        return jerry_debugger_send_string (JERRY_DEBUGGER_EVAL_ERROR,
+                                           string_p,
+                                           strlen ((const char *) string_p));
+      }
+    }
+    else
+    {
+      /* Primitve type. */
+      message = ecma_op_to_string (result);
+      JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (message));
+    }
+
+    ecma_free_value (result);
+  }
+
+  ecma_string_t *string_p = ecma_get_string_from_value (message);
+
+  ECMA_STRING_TO_UTF8_STRING (string_p, buffer_p, buffer_size);
+  bool success = jerry_debugger_send_string (type, buffer_p, buffer_size);
+  ECMA_FINALIZE_UTF8_STRING (buffer_p, buffer_size);
+
+  ecma_free_value (message);
+
+  return success;
+} /* jerry_debugger_send_eval */
+
+/**
+ * Suspend execution for a given time.
+ * Note: If the platform does not have nanosleep or usleep, this function does not sleep at all.
+ */
+static void
+jerry_debugger_sleep (unsigned milliseconds) /**< suspending time */
+{
+#ifdef HAVE_TIME_H
+  nanosleep (&(const struct timespec)
+  {
+    milliseconds / 1000, (milliseconds % 1000) * 1000000L /* Seconds, nanoseconds */
+  }
+  , NULL);
+#elif defined (HAVE_UNISTD_H)
+  usleep ((useconds_t) milliseconds * 1000);
+#else /* If neither of the libs found */
+  JERRY_UNUSED (milliseconds);
+#endif /* HAVE_TIME_H */
+} /* jerry_debugger_sleep */
+
+/**
+ * Check received packet size.
+ */
+#define JERRY_DEBUGGER_CHECK_PACKET_SIZE(type) \
+  if (message_size != sizeof (type)) \
+  { \
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Invalid message size\n"); \
+    jerry_debugger_close_connection (); \
+    return false; \
+  }
+
+/**
+ * Receive message from the client.
+ *
+ * @return true - if message is processed successfully
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the received data */
+                                uint32_t message_size, /**< message size */
+                                bool *resume_exec_p, /**< pointer to the resume exec flag */
+                                uint8_t *expected_message_type_p, /**< expected message type */
+                                void **message_data_p) /**< custom message data */
+{
+  /* Process the received message. */
+
+  if (recv_buffer_p[0] >= JERRY_DEBUGGER_CONTINUE
+      && !(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_BREAKPOINT_MODE))
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Message requires breakpoint mode\n");
+    jerry_debugger_close_connection ();
+    return false;
+  }
+
+  if (*expected_message_type_p != 0)
+  {
+    JERRY_ASSERT (*expected_message_type_p == JERRY_DEBUGGER_EVAL_PART);
+
+    jerry_debugger_eval_data_t *eval_data_p = (jerry_debugger_eval_data_t *) *message_data_p;
+
+    if (recv_buffer_p[0] != JERRY_DEBUGGER_EVAL_PART)
+    {
+      jmem_heap_free_block (eval_data_p, eval_data_p->eval_size + sizeof (jerry_debugger_eval_data_t));
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Unexpected message\n");
+      jerry_debugger_close_connection ();
+      return false;
+    }
+
+    JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_eval_part_t, eval_part_p);
+
+    if (message_size < sizeof (jerry_debugger_receive_eval_part_t) + 1)
+    {
+      jmem_heap_free_block (eval_data_p, eval_data_p->eval_size + sizeof (jerry_debugger_eval_data_t));
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Invalid message size\n");
+      jerry_debugger_close_connection ();
+      return false;
+    }
+
+    uint32_t expected_data = eval_data_p->eval_size - eval_data_p->eval_offset;
+
+    message_size -= (uint32_t) sizeof (jerry_debugger_receive_eval_part_t);
+
+    if (message_size > expected_data)
+    {
+      jmem_heap_free_block (eval_data_p, eval_data_p->eval_size + sizeof (jerry_debugger_eval_data_t));
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Invalid message size\n");
+      jerry_debugger_close_connection ();
+      return false;
+    }
+
+    lit_utf8_byte_t *eval_string_p = (lit_utf8_byte_t *) (eval_data_p + 1);
+    memcpy (eval_string_p + eval_data_p->eval_offset,
+            (lit_utf8_byte_t *) (eval_part_p + 1),
+            message_size);
+
+    if (message_size < expected_data)
+    {
+      eval_data_p->eval_offset += message_size;
+      return true;
+    }
+
+    bool result = jerry_debugger_send_eval (eval_string_p, eval_data_p->eval_size);
+    jmem_heap_free_block (eval_data_p, eval_data_p->eval_size + sizeof (jerry_debugger_eval_data_t));
+    *expected_message_type_p = 0;
+    return result;
+  }
+
+  switch (recv_buffer_p[0])
+  {
+    case JERRY_DEBUGGER_FREE_BYTE_CODE_CP:
+    {
+      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_byte_code_cp_t);
+
+      JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_byte_code_cp_t, byte_code_p);
+
+      jmem_cpointer_t byte_code_free_cp;
+      memcpy (&byte_code_free_cp, byte_code_p->byte_code_cp, sizeof (jmem_cpointer_t));
+
+      if (byte_code_free_cp != JERRY_CONTEXT (debugger_byte_code_free_tail))
+      {
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Invalid byte code free order\n");
+        jerry_debugger_close_connection ();
+        return false;
+      }
+
+      jerry_debugger_byte_code_free_t *byte_code_free_p;
+      byte_code_free_p = JMEM_CP_GET_NON_NULL_POINTER (jerry_debugger_byte_code_free_t,
+                                                       byte_code_free_cp);
+
+      if (byte_code_free_p->prev_cp != ECMA_NULL_POINTER)
+      {
+        JERRY_CONTEXT (debugger_byte_code_free_tail) = byte_code_free_p->prev_cp;
+      }
+      else
+      {
+        JERRY_CONTEXT (debugger_byte_code_free_head) = ECMA_NULL_POINTER;
+        JERRY_CONTEXT (debugger_byte_code_free_tail) = ECMA_NULL_POINTER;
+      }
+
+#ifdef JMEM_STATS
+      jmem_stats_free_byte_code_bytes (((size_t) byte_code_free_p->size) << JMEM_ALIGNMENT_LOG);
+#endif /* JMEM_STATS */
+
+      jmem_heap_free_block (byte_code_free_p,
+                            ((size_t) byte_code_free_p->size) << JMEM_ALIGNMENT_LOG);
+      return true;
+    }
+
+    case JERRY_DEBUGGER_UPDATE_BREAKPOINT:
+    {
+      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_update_breakpoint_t);
+
+      JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_update_breakpoint_t, update_breakpoint_p);
+
+      jmem_cpointer_t byte_code_cp;
+      memcpy (&byte_code_cp, update_breakpoint_p->byte_code_cp, sizeof (jmem_cpointer_t));
+      uint8_t *byte_code_p = JMEM_CP_GET_NON_NULL_POINTER (uint8_t, byte_code_cp);
+
+      uint32_t offset;
+      memcpy (&offset, update_breakpoint_p->offset, sizeof (uint32_t));
+      byte_code_p += offset;
+
+      JERRY_ASSERT (*byte_code_p == CBC_BREAKPOINT_ENABLED || *byte_code_p == CBC_BREAKPOINT_DISABLED);
+
+      *byte_code_p = update_breakpoint_p->is_set_breakpoint ? CBC_BREAKPOINT_ENABLED : CBC_BREAKPOINT_DISABLED;
+      return true;
+    }
+
+    case JERRY_DEBUGGER_MEMSTATS:
+    {
+      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);
+
+      jerry_debugger_send_memstats ();
+      return true;
+    }
+
+    case JERRY_DEBUGGER_STOP:
+    {
+      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);
+
+      JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) | JERRY_DEBUGGER_VM_STOP);
+      JERRY_CONTEXT (debugger_stop_context) = NULL;
+      *resume_exec_p = false;
+      return true;
+    }
+
+    case JERRY_DEBUGGER_CONTINUE:
+    {
+      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);
+
+      JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) & ~JERRY_DEBUGGER_VM_STOP);
+      JERRY_CONTEXT (debugger_stop_context) = NULL;
+      *resume_exec_p = true;
+      return true;
+    }
+
+    case JERRY_DEBUGGER_STEP:
+    {
+      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);
+
+      JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) | JERRY_DEBUGGER_VM_STOP);
+      JERRY_CONTEXT (debugger_stop_context) = NULL;
+      *resume_exec_p = true;
+      return true;
+    }
+
+    case JERRY_DEBUGGER_NEXT:
+    {
+      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);
+
+      JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) | JERRY_DEBUGGER_VM_STOP);
+      JERRY_CONTEXT (debugger_stop_context) = JERRY_CONTEXT (vm_top_context_p);
+      *resume_exec_p = true;
+      return true;
+    }
+
+    case JERRY_DEBUGGER_GET_BACKTRACE:
+    {
+      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_get_backtrace_t);
+
+      jerry_debugger_send_backtrace (recv_buffer_p);
+      return true;
+    }
+
+    case JERRY_DEBUGGER_EXCEPTION_CONFIG:
+    {
+      JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_exception_config_t);
+      JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_exception_config_t, exception_config_p);
+
+      uint8_t debugger_flags = JERRY_CONTEXT (debugger_flags);
+
+      if (exception_config_p->enable == 0)
+      {
+        debugger_flags = (uint8_t) (debugger_flags | JERRY_DEBUGGER_VM_IGNORE_EXCEPTION);
+        jerry_port_log (JERRY_LOG_LEVEL_DEBUG, "Stop at exception disabled\n");
+      }
+      else
+      {
+        debugger_flags = (uint8_t) (debugger_flags & ~JERRY_DEBUGGER_VM_IGNORE_EXCEPTION);
+        jerry_port_log (JERRY_LOG_LEVEL_DEBUG, "Stop at exception enabled\n");
+      }
+
+      JERRY_CONTEXT (debugger_flags)  = debugger_flags;
+      return true;
+    }
+
+    case JERRY_DEBUGGER_EVAL:
+    {
+      if (message_size < sizeof (jerry_debugger_receive_eval_first_t) + 1)
+      {
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Invalid message size\n");
+        jerry_debugger_close_connection ();
+        return false;
+      }
+
+      JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_eval_first_t, eval_first_p);
+
+      uint32_t eval_size;
+      memcpy (&eval_size, eval_first_p->eval_size, sizeof (uint32_t));
+
+      if (eval_size <= JERRY_DEBUGGER_MAX_RECEIVE_SIZE - sizeof (jerry_debugger_receive_eval_first_t))
+      {
+        if (eval_size != message_size - sizeof (jerry_debugger_receive_eval_first_t))
+        {
+          jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Invalid message size\n");
+          jerry_debugger_close_connection ();
+          return false;
+        }
+
+        return jerry_debugger_send_eval ((lit_utf8_byte_t *) (eval_first_p + 1), eval_size);
+      }
+
+      jerry_debugger_eval_data_t *eval_data_p;
+      size_t eval_data_size = sizeof (jerry_debugger_eval_data_t) + eval_size;
+
+      eval_data_p = (jerry_debugger_eval_data_t *) jmem_heap_alloc_block (eval_data_size);
+
+      eval_data_p->eval_size = eval_size;
+      eval_data_p->eval_offset = (uint32_t) (message_size - sizeof (jerry_debugger_receive_eval_first_t));
+
+      lit_utf8_byte_t *eval_string_p = (lit_utf8_byte_t *) (eval_data_p + 1);
+      memcpy (eval_string_p,
+              (lit_utf8_byte_t *) (eval_first_p + 1),
+              message_size - sizeof (jerry_debugger_receive_eval_first_t));
+
+      *message_data_p = eval_data_p;
+      *expected_message_type_p = JERRY_DEBUGGER_EVAL_PART;
+      return true;
+    }
+
+    default:
+    {
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Unexpected message.");
+      jerry_debugger_close_connection ();
+      return false;
+    }
+  }
+} /* jerry_debugger_process_message */
+
+#undef JERRY_DEBUGGER_CHECK_PACKET_SIZE
+
+/**
+ * Tell the client that a breakpoint has been hit and wait for further debugger commands.
+ */
+void
+jerry_debugger_breakpoint_hit (uint8_t message_type) /**< message type */
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+  JERRY_DEBUGGER_SEND_BUFFER_AS (jerry_debugger_send_breakpoint_hit_t, breakpoint_hit_p);
+
+  JERRY_DEBUGGER_INIT_SEND_MESSAGE (breakpoint_hit_p);
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE_FROM_TYPE (breakpoint_hit_p, jerry_debugger_send_breakpoint_hit_t);
+  breakpoint_hit_p->type = message_type;
+
+  vm_frame_ctx_t *frame_ctx_p = JERRY_CONTEXT (vm_top_context_p);
+
+  jmem_cpointer_t byte_code_header_cp;
+  JMEM_CP_SET_NON_NULL_POINTER (byte_code_header_cp, frame_ctx_p->bytecode_header_p);
+  memcpy (breakpoint_hit_p->byte_code_cp, &byte_code_header_cp, sizeof (jmem_cpointer_t));
+
+  uint32_t offset = (uint32_t) (frame_ctx_p->byte_code_p - (uint8_t *) frame_ctx_p->bytecode_header_p);
+  memcpy (breakpoint_hit_p->offset, &offset, sizeof (uint32_t));
+
+  if (!jerry_debugger_send (sizeof (jerry_debugger_send_breakpoint_hit_t)))
+  {
+    return;
+  }
+
+  JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) | JERRY_DEBUGGER_BREAKPOINT_MODE);
+
+  while (!jerry_debugger_receive ())
+  {
+    jerry_debugger_sleep (JERRY_DEBUGGER_TIMEOUT);
+  }
+
+  JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) & ~JERRY_DEBUGGER_BREAKPOINT_MODE);
+
+  JERRY_CONTEXT (debugger_message_delay) = JERRY_DEBUGGER_MESSAGE_FREQUENCY;
+} /* jerry_debugger_breakpoint_hit */
+
+/**
+ * Send the type signal to the client.
+ */
+void
+jerry_debugger_send_type (jerry_debugger_header_type_t type) /**< message type */
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+  JERRY_DEBUGGER_SEND_BUFFER_AS (jerry_debugger_send_type_t, message_type_p);
+
+  JERRY_DEBUGGER_INIT_SEND_MESSAGE (message_type_p);
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE_FROM_TYPE (message_type_p, jerry_debugger_send_type_t);
+  message_type_p->type = (uint8_t) type;
+
+  jerry_debugger_send (sizeof (jerry_debugger_send_type_t));
+} /* jerry_debugger_send_type */
+
+
+/**
+ * Send the type signal to the client.
+ *
+ * @return true - if the data sent successfully to the debugger client,
+ *         false - otherwise
+ */
+bool
+jerry_debugger_send_configuration (uint8_t max_message_size) /**< maximum message size */
+{
+  JERRY_DEBUGGER_SEND_BUFFER_AS (jerry_debugger_send_configuration_t, configuration_p);
+
+  /* Helper structure for endianness check. */
+  union
+  {
+    uint16_t uint16_value; /**< a 16-bit value */
+    uint8_t uint8_value[2]; /**< lower and upper byte of a 16-bit value */
+  } endian_data;
+
+  endian_data.uint16_value = 1;
+
+  JERRY_DEBUGGER_INIT_SEND_MESSAGE (configuration_p);
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE_FROM_TYPE (configuration_p, jerry_debugger_send_configuration_t);
+  configuration_p->type = JERRY_DEBUGGER_CONFIGURATION;
+  configuration_p->max_message_size = max_message_size;
+  configuration_p->cpointer_size = sizeof (jmem_cpointer_t);
+  configuration_p->little_endian = (endian_data.uint8_value[0] == 1);
+
+  return jerry_debugger_send (sizeof (jerry_debugger_send_configuration_t));
+} /* jerry_debugger_send_configuration */
+
+/**
+ * Send raw data to the debugger client.
+ */
+void
+jerry_debugger_send_data (jerry_debugger_header_type_t type, /**< message type */
+                          const void *data, /**< raw data */
+                          size_t size) /**< size of data */
+{
+  JERRY_ASSERT (size <= JERRY_DEBUGGER_SEND_MAX (uint8_t));
+
+  JERRY_DEBUGGER_SEND_BUFFER_AS (jerry_debugger_send_type_t, message_type_p);
+
+  JERRY_DEBUGGER_INIT_SEND_MESSAGE (message_type_p);
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE (message_type_p, 1 + size);
+  message_type_p->type = type;
+  memcpy (message_type_p + 1, data, size);
+
+  jerry_debugger_send (sizeof (jerry_debugger_send_type_t) + size);
+} /* jerry_debugger_send_data */
+
+/**
+ * Send string to the debugger client.
+ *
+ * @return true - if the data sent successfully to the debugger client,
+ *         false - otherwise
+ */
+bool
+jerry_debugger_send_string (uint8_t message_type, /**< message type */
+                            const uint8_t *string_p, /**< string data */
+                            size_t string_length) /**< length of string */
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+  const size_t max_fragment_len = JERRY_DEBUGGER_SEND_MAX (uint8_t);
+
+  JERRY_DEBUGGER_SEND_BUFFER_AS (jerry_debugger_send_string_t, message_string_p);
+
+  JERRY_DEBUGGER_INIT_SEND_MESSAGE (message_string_p);
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE_FROM_TYPE (message_string_p, jerry_debugger_send_string_t);
+  message_string_p->type = message_type;
+
+  while (string_length > max_fragment_len)
+  {
+    memcpy (message_string_p->string, string_p, max_fragment_len);
+
+    if (!jerry_debugger_send (sizeof (jerry_debugger_send_string_t)))
+    {
+      return false;
+    }
+
+    string_length -= max_fragment_len;
+    string_p += max_fragment_len;
+  }
+
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE (message_string_p, 1 + string_length);
+  message_string_p->type = (uint8_t) (message_type + 1);
+
+  memcpy (message_string_p->string, string_p, string_length);
+
+  return jerry_debugger_send (sizeof (jerry_debugger_send_type_t) + string_length);
+} /* jerry_debugger_send_string */
+
+/**
+ * Send the function compressed pointer to the debugger client.
+ *
+ * @return true - if the data was sent successfully to the debugger client,
+ *         false - otherwise
+ */
+bool
+jerry_debugger_send_function_cp (jerry_debugger_header_type_t type, /**< message type */
+                                 ecma_compiled_code_t *compiled_code_p) /**< byte code pointer */
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+  JERRY_DEBUGGER_SEND_BUFFER_AS (jerry_debugger_send_byte_code_cp_t, byte_code_cp_p);
+
+  JERRY_DEBUGGER_INIT_SEND_MESSAGE (byte_code_cp_p);
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE_FROM_TYPE (byte_code_cp_p, jerry_debugger_send_byte_code_cp_t);
+  byte_code_cp_p->type = (uint8_t) type;
+
+  jmem_cpointer_t compiled_code_cp;
+  JMEM_CP_SET_NON_NULL_POINTER (compiled_code_cp, compiled_code_p);
+  memcpy (byte_code_cp_p->byte_code_cp, &compiled_code_cp, sizeof (jmem_cpointer_t));
+
+  return jerry_debugger_send (sizeof (jerry_debugger_send_byte_code_cp_t));
+} /* jerry_debugger_send_function_cp */
+
+/**
+ * Send function data to the debugger client.
+ *
+ * @return true - if the data sent successfully to the debugger client,
+ *         false - otherwise
+ */
+bool
+jerry_debugger_send_parse_function (uint32_t line, /**< line */
+                                    uint32_t column) /**< column */
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+  JERRY_DEBUGGER_SEND_BUFFER_AS (jerry_debugger_send_parse_function_t, message_parse_function_p);
+
+  JERRY_DEBUGGER_INIT_SEND_MESSAGE (message_parse_function_p);
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE_FROM_TYPE (message_parse_function_p, jerry_debugger_send_parse_function_t);
+  message_parse_function_p->type = JERRY_DEBUGGER_PARSE_FUNCTION;
+  memcpy (message_parse_function_p->line, &line, sizeof (uint32_t));
+  memcpy (message_parse_function_p->column, &column, sizeof (uint32_t));
+
+  return jerry_debugger_send (sizeof (jerry_debugger_send_parse_function_t));
+} /* jerry_debugger_send_parse_function */
+
+/**
+ * Send memory statistics to the debugger client.
+ */
+void
+jerry_debugger_send_memstats (void)
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+  JERRY_DEBUGGER_SEND_BUFFER_AS (jerry_debugger_send_memstats_t, memstats_p);
+  JERRY_DEBUGGER_INIT_SEND_MESSAGE (memstats_p);
+  JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE_FROM_TYPE (memstats_p, jerry_debugger_send_memstats_t);
+
+  memstats_p->type = JERRY_DEBUGGER_MEMSTATS_RECEIVE;
+
+#ifdef JMEM_STATS /* if jmem_stats are defined */
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  uint32_t allocated_bytes = (uint32_t) heap_stats->allocated_bytes;
+  memcpy (memstats_p->allocated_bytes, &allocated_bytes, sizeof (uint32_t));
+  uint32_t byte_code_bytes = (uint32_t) heap_stats->byte_code_bytes;
+  memcpy (memstats_p->byte_code_bytes, &byte_code_bytes, sizeof (uint32_t));
+  uint32_t string_bytes = (uint32_t) heap_stats->string_bytes;
+  memcpy (memstats_p->string_bytes, &string_bytes, sizeof (uint32_t));
+  uint32_t object_bytes = (uint32_t) heap_stats->object_bytes;
+  memcpy (memstats_p->object_bytes, &object_bytes, sizeof (uint32_t));
+  uint32_t property_bytes = (uint32_t) heap_stats->property_bytes;
+  memcpy (memstats_p->property_bytes, &property_bytes, sizeof (uint32_t));
+#else /* if not, just put zeros */
+  memset (memstats_p->allocated_bytes, 0, sizeof (uint32_t));
+  memset (memstats_p->byte_code_bytes, 0, sizeof (uint32_t));
+  memset (memstats_p->string_bytes, 0, sizeof (uint32_t));
+  memset (memstats_p->object_bytes, 0, sizeof (uint32_t));
+  memset (memstats_p->property_bytes, 0, sizeof (uint32_t));
+#endif
+
+  jerry_debugger_send (sizeof (jerry_debugger_send_memstats_t));
+} /* jerry_debugger_send_memstats */
+
+/*
+ * Converts an standard error into a string.
+ *
+ * @return standard error string
+ */
+static ecma_string_t *
+jerry_debugger_exception_object_to_string (ecma_value_t exception_obj_value) /**< exception object */
+{
+  ecma_object_t *object_p = ecma_get_object_from_value (exception_obj_value);
+
+  ecma_object_t *prototype_p = ecma_get_object_prototype (object_p);
+
+  if (prototype_p == NULL
+      || ecma_get_object_type (prototype_p) != ECMA_OBJECT_TYPE_GENERAL
+      || !ecma_get_object_is_builtin (prototype_p))
+  {
+    return NULL;
+  }
+
+  lit_magic_string_id_t string_id;
+
+  switch (((ecma_extended_object_t *) prototype_p)->u.built_in.id)
+  {
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+    case ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE:
+    {
+      string_id = LIT_MAGIC_STRING_EVAL_ERROR_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE:
+    {
+      string_id = LIT_MAGIC_STRING_RANGE_ERROR_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE:
+    {
+      string_id = LIT_MAGIC_STRING_REFERENCE_ERROR_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE:
+    {
+      string_id = LIT_MAGIC_STRING_SYNTAX_ERROR_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE:
+    {
+      string_id = LIT_MAGIC_STRING_TYPE_ERROR_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE:
+    {
+      string_id = LIT_MAGIC_STRING_URI_ERROR_UL;
+      break;
+    }
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+    case ECMA_BUILTIN_ID_ERROR_PROTOTYPE:
+    {
+      string_id = LIT_MAGIC_STRING_ERROR_UL;
+      break;
+    }
+    default:
+    {
+      return NULL;
+    }
+  }
+
+  lit_utf8_size_t size = lit_get_magic_string_size (string_id);
+  JERRY_ASSERT (size <= 14);
+
+  lit_utf8_byte_t data[16];
+  memcpy (data, lit_get_magic_string_utf8 (string_id), size);
+
+  ecma_string_t message_string;
+  ecma_init_ecma_magic_string (&message_string, LIT_MAGIC_STRING_MESSAGE);
+
+  ecma_property_t *property_p;
+  property_p = ecma_find_named_property (ecma_get_object_from_value (exception_obj_value),
+                                         &message_string);
+
+  if (property_p == NULL
+      || ECMA_PROPERTY_GET_TYPE (*property_p) != ECMA_PROPERTY_TYPE_NAMEDDATA)
+  {
+    return ecma_new_ecma_string_from_utf8 (data, size);
+  }
+
+  ecma_property_value_t *prop_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
+
+  if (!ecma_is_value_string (prop_value_p->value))
+  {
+    return ecma_new_ecma_string_from_utf8 (data, size);
+  }
+
+  data[size] = LIT_CHAR_COLON;
+  data[size + 1] = LIT_CHAR_SP;
+
+  ecma_string_t *type_string_p = ecma_new_ecma_string_from_utf8 (data, size + 2);
+
+  ecma_string_t *string_p = ecma_concat_ecma_strings (type_string_p,
+                                                      ecma_get_string_from_value (prop_value_p->value));
+  ecma_deref_ecma_string (type_string_p);
+  return string_p;
+} /* jerry_debugger_exception_object_to_string */
+
+/**
+ * Send string representation of exception to the client.
+ *
+ * @return true - if the data sent successfully to the debugger client,
+ *         false - otherwise
+ */
+bool
+jerry_debugger_send_exception_string (ecma_value_t exception_value) /**< error value */
+{
+  ecma_string_t *string_p = NULL;
+
+  if (ecma_is_value_object (exception_value))
+  {
+    ecma_value_t object_value = ecma_get_value_from_error_value (exception_value);
+
+    string_p = jerry_debugger_exception_object_to_string (object_value);
+    if (string_p == NULL)
+    {
+      string_p = ecma_get_string_from_value (ecma_builtin_helper_object_to_string (object_value));
+    }
+  }
+  else if (ecma_is_value_string (exception_value))
+  {
+    string_p = ecma_get_string_from_value (exception_value);
+    ecma_ref_ecma_string (string_p);
+  }
+  else
+  {
+    exception_value = ecma_op_to_string (exception_value);
+    string_p = ecma_get_string_from_value (exception_value);
+  }
+
+  ECMA_STRING_TO_UTF8_STRING (string_p, string_data_p, string_size);
+
+  bool result = jerry_debugger_send_string (JERRY_DEBUGGER_EXCEPTION_STR,
+                                            string_data_p,
+                                            string_size);
+
+  ECMA_FINALIZE_UTF8_STRING (string_data_p, string_size);
+
+  ecma_deref_ecma_string (string_p);
+  return result;
+} /* jerry_debugger_send_exception_string */
+
+#endif /* JERRY_DEBUGGER */
diff --git a/deps/jerry/jerry-core/debugger/debugger.h b/deps/jerry/jerry-core/debugger/debugger.h
new file mode 100644 (file)
index 0000000..2072c8f
--- /dev/null
@@ -0,0 +1,325 @@
+/* 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.
+ */
+
+#ifndef DEBUGGER_H
+#define DEBUGGER_H
+
+#include "debugger-ws.h"
+#include "ecma-globals.h"
+
+#ifdef JERRY_DEBUGGER
+
+/* JerryScript debugger protocol is a simplified version of RFC-6455 (WebSockets). */
+
+/**
+ * Frequency of calling jerry_debugger_receive() by the VM.
+ */
+#define JERRY_DEBUGGER_MESSAGE_FREQUENCY 5
+
+/**
+ * Limited resources available for the engine, so it is important to
+ * check the maximum buffer size. It needs to be between 64 and 256 bytes.
+ */
+#if JERRY_DEBUGGER_MAX_BUFFER_SIZE < 64 || JERRY_DEBUGGER_MAX_BUFFER_SIZE > 256
+#error Please define the MAX_BUFFER_SIZE between 64 and 256 bytes.
+#endif /* JERRY_DEBUGGER_MAX_BUFFER_SIZE < 64 || JERRY_DEBUGGER_MAX_BUFFER_SIZE > 256 */
+
+/**
+ * Calculate the maximum number of items for a given type
+ * which can be transmitted by one message.
+ */
+#define JERRY_DEBUGGER_SEND_MAX(type) \
+ ((JERRY_DEBUGGER_MAX_SEND_SIZE - sizeof (jerry_debugger_send_header_t) - 1) / sizeof (type))
+
+/**
+ * Debugger operation modes:
+ *
+ * The debugger has two operation modes: run mode and breakpoint mode.
+ *
+ * In run mode the debugger server accepts only a limited number of message
+ * types from the debugger client (e.g. stop execution, set breakpoint).
+ *
+ * In breakpoint mode the JavaScript execution is stopped at a breakpoint and
+ * more message types are accepted (e.g. get backtrace, evaluate expression).
+ *
+ * Switching between modes:
+ *
+ * When the JavaScript execution stops at a breakpoint the server sends a
+ * JERRY_DEBUGGER_BREAKPOINT_HIT message to the client. The client can only
+ * issue breakpoint mode commands after this message is received.
+ *
+ * Certain breakpoint mode commands (e.g. continue) resumes the JavaScript
+ * execution and the client must not send any breakpoint mode messages
+ * until the JERRY_DEBUGGER_BREAKPOINT_HIT is received again.
+ *
+ * The debugger server starts in run mode but stops at the first available
+ * breakpoint.
+ */
+
+/**
+ * Debugger option flags.
+ */
+typedef enum
+{
+  JERRY_DEBUGGER_CONNECTED = 1u << 0, /**< debugger is connected */
+  JERRY_DEBUGGER_BREAKPOINT_MODE = 1u << 1, /**< debugger waiting at a breakpoint */
+  JERRY_DEBUGGER_VM_STOP = 1u << 2, /**< stop at the next breakpoint regardless it is enabled */
+  JERRY_DEBUGGER_VM_IGNORE = 1u << 3, /**< ignore all breakpoints */
+  JERRY_DEBUGGER_VM_IGNORE_EXCEPTION = 1u << 4, /**< debugger stop at an exception */
+} jerry_debugger_flags_t;
+
+/**
+ * Types for the package.
+ */
+typedef enum
+{
+  /* Messages sent by the server to client. */
+  JERRY_DEBUGGER_CONFIGURATION = 1, /**< debugger configuration */
+  JERRY_DEBUGGER_PARSE_ERROR = 2, /**< parse error */
+  JERRY_DEBUGGER_BYTE_CODE_CP = 3, /**< byte code compressed pointer */
+  JERRY_DEBUGGER_PARSE_FUNCTION = 4, /**< parsing a new function */
+  JERRY_DEBUGGER_BREAKPOINT_LIST = 5, /**< list of line offsets */
+  JERRY_DEBUGGER_BREAKPOINT_OFFSET_LIST = 6, /**< list of byte code offsets */
+  JERRY_DEBUGGER_SOURCE_CODE = 7, /**< source code fragment */
+  JERRY_DEBUGGER_SOURCE_CODE_END = 8, /**< source code last fragment */
+  JERRY_DEBUGGER_SOURCE_CODE_NAME = 9, /**< source code name fragment */
+  JERRY_DEBUGGER_SOURCE_CODE_NAME_END = 10, /**< source code name last fragment */
+  JERRY_DEBUGGER_FUNCTION_NAME = 11, /**< function name fragment */
+  JERRY_DEBUGGER_FUNCTION_NAME_END = 12, /**< function name last fragment */
+  JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP = 13, /**< invalidate byte code compressed pointer */
+  JERRY_DEBUGGER_MEMSTATS_RECEIVE = 14, /**< memstats sent to the client*/
+  JERRY_DEBUGGER_BREAKPOINT_HIT = 15, /**< notify breakpoint hit */
+  JERRY_DEBUGGER_EXCEPTION_HIT = 16, /**< notify exception hit */
+  JERRY_DEBUGGER_EXCEPTION_STR = 17, /**< exception string fragment */
+  JERRY_DEBUGGER_EXCEPTION_STR_END = 18, /**< exception string last fragment */
+  JERRY_DEBUGGER_BACKTRACE = 19, /**< backtrace data */
+  JERRY_DEBUGGER_BACKTRACE_END = 20, /**< last backtrace data */
+  JERRY_DEBUGGER_EVAL_RESULT = 21, /**< eval result */
+  JERRY_DEBUGGER_EVAL_RESULT_END = 22, /**< last part of eval result */
+  JERRY_DEBUGGER_EVAL_ERROR = 23, /**< eval result when an error is occured */
+  JERRY_DEBUGGER_EVAL_ERROR_END = 24, /**< last part of eval result when an error is occured */
+
+  /* Messages sent by the client to server. */
+
+  /* The following messages are accepted in both run and breakpoint modes. */
+  JERRY_DEBUGGER_FREE_BYTE_CODE_CP = 1, /**< free byte code compressed pointer */
+  JERRY_DEBUGGER_UPDATE_BREAKPOINT = 2, /**< update breakpoint status */
+  JERRY_DEBUGGER_EXCEPTION_CONFIG = 3, /**< exception handler config */
+  JERRY_DEBUGGER_MEMSTATS = 4, /**< list memory statistics */
+  JERRY_DEBUGGER_STOP = 5, /**< stop execution */
+  /* The following messages are only available in breakpoint
+   * mode and they switch the engine to run mode. */
+  JERRY_DEBUGGER_CONTINUE = 6, /**< continue execution */
+  JERRY_DEBUGGER_STEP = 7, /**< next breakpoint, step into functions */
+  JERRY_DEBUGGER_NEXT = 8, /**< next breakpoint in the same context */
+  /* The following messages are only available in breakpoint
+   * mode and this mode is kept after the message is processed. */
+  JERRY_DEBUGGER_GET_BACKTRACE = 9, /**< get backtrace */
+  JERRY_DEBUGGER_EVAL = 10, /**< first message of evaluating a string */
+  JERRY_DEBUGGER_EVAL_PART = 11, /**< next message of evaluating a string */
+} jerry_debugger_header_type_t;
+
+/**
+ * Delayed free of byte code data.
+ */
+typedef struct
+{
+  uint16_t size; /**< size of the byte code header divided by JMEM_ALIGNMENT */
+  jmem_cpointer_t prev_cp; /**< previous byte code data to be freed */
+} jerry_debugger_byte_code_free_t;
+
+/**
+ * Outgoing message: JerryScript configuration.
+ */
+typedef struct
+{
+  jerry_debugger_send_header_t header; /**< message header */
+  uint8_t type; /**< type of the message */
+  uint8_t max_message_size; /**< maximum incoming message size */
+  uint8_t cpointer_size; /**< size of compressed pointers */
+  uint8_t little_endian; /**< little endian machine */
+} jerry_debugger_send_configuration_t;
+
+/**
+ * Outgoing message: message without arguments.
+ */
+typedef struct
+{
+  jerry_debugger_send_header_t header; /**< message header */
+  uint8_t type; /**< type of the message */
+} jerry_debugger_send_type_t;
+
+/**
+ * Incoming message: message without arguments.
+ */
+typedef struct
+{
+  uint8_t type; /**< type of the message */
+} jerry_debugger_receive_type_t;
+
+/**
+ * Outgoing message: string (Source file name or function name).
+ */
+typedef struct
+{
+  jerry_debugger_send_header_t header; /**< message header */
+  uint8_t type; /**< type of the message */
+  uint8_t string[JERRY_DEBUGGER_SEND_MAX (uint8_t)]; /**< string data */
+} jerry_debugger_send_string_t;
+
+/**
+ * Outgoing message: uint32 value.
+ */
+typedef struct
+{
+  jerry_debugger_send_header_t header; /**< message header */
+  uint8_t type; /**< type of the message */
+  uint8_t line[sizeof (uint32_t)]; /**< value data */
+  uint8_t column[sizeof (uint32_t)]; /**< value data */
+} jerry_debugger_send_parse_function_t;
+
+/**
+ * Outgoing message: byte code compressed pointer.
+ */
+typedef struct
+{
+  jerry_debugger_send_header_t header; /**< message header */
+  uint8_t type; /**< type of the message */
+  uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */
+} jerry_debugger_send_byte_code_cp_t;
+
+/**
+ * Incoming message: byte code compressed pointer.
+ */
+typedef struct
+{
+  uint8_t type; /**< type of the message */
+  uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */
+} jerry_debugger_receive_byte_code_cp_t;
+
+/**
+ * Incoming message: update (enable/disable) breakpoint status.
+ */
+typedef struct
+{
+  uint8_t type; /**< type of the message */
+  uint8_t is_set_breakpoint; /**< set or clear breakpoint */
+  uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */
+  uint8_t offset[sizeof (uint32_t)]; /**< breakpoint offset */
+} jerry_debugger_receive_update_breakpoint_t;
+
+/**
+ * Outgoing message: send memory statistics
+ */
+typedef struct
+{
+  jerry_debugger_send_header_t header; /**< message header */
+  uint8_t type; /**< type of the message */
+  uint8_t allocated_bytes[sizeof (uint32_t)]; /**< allocated bytes */
+  uint8_t byte_code_bytes[sizeof (uint32_t)]; /**< byte code bytes */
+  uint8_t string_bytes[sizeof (uint32_t)]; /**< string bytes */
+  uint8_t object_bytes[sizeof (uint32_t)]; /**< object bytes */
+  uint8_t property_bytes[sizeof (uint32_t)]; /**< property bytes */
+} jerry_debugger_send_memstats_t;
+
+/**
+ * Outgoing message: notify breakpoint hit.
+ */
+typedef struct
+{
+  jerry_debugger_send_header_t header; /**< message header */
+  uint8_t type; /**< type of the message */
+  uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */
+  uint8_t offset[sizeof (uint32_t)]; /**< breakpoint offset */
+} jerry_debugger_send_breakpoint_hit_t;
+
+/**
+ * Stack frame descriptor for sending backtrace information.
+ */
+typedef struct
+{
+  uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */
+  uint8_t offset[sizeof (uint32_t)]; /**< last breakpoint offset */
+} jerry_debugger_frame_t;
+
+/**
+ * Outgoing message: backtrace information.
+ */
+typedef struct
+{
+  jerry_debugger_send_header_t header; /**< message header */
+  uint8_t type; /**< type of the message */
+  jerry_debugger_frame_t frames[JERRY_DEBUGGER_SEND_MAX (jerry_debugger_frame_t)]; /**< frames */
+} jerry_debugger_send_backtrace_t;
+
+typedef struct
+{
+  uint8_t type; /**< type of the message */
+  uint8_t enable; /**< non-zero: enable stop at exception */
+} jerry_debugger_receive_exception_config_t;
+
+/**
+ * Incoming message: get backtrace.
+ */
+typedef struct
+{
+  uint8_t type; /**< type of the message */
+  uint8_t max_depth[sizeof (uint32_t)]; /**< maximum depth (0 - unlimited) */
+} jerry_debugger_receive_get_backtrace_t;
+
+/**
+ * Incoming message: first message of evaluating expression.
+ */
+typedef struct
+{
+  uint8_t type; /**< type of the message */
+  uint8_t eval_size[sizeof (uint32_t)]; /**< total size of the message */
+} jerry_debugger_receive_eval_first_t;
+
+/**
+ * Incoming message: next message of evaluating expression.
+ */
+typedef struct
+{
+  uint8_t type; /**< type of the message */
+} jerry_debugger_receive_eval_part_t;
+
+/**
+ * Data for evaluating expressions
+ */
+typedef struct
+{
+  uint32_t eval_size; /**< total size of the eval string */
+  uint32_t eval_offset; /**< current offset in the eval string */
+} jerry_debugger_eval_data_t;
+
+void jerry_debugger_free_unreferenced_byte_code (void);
+
+bool jerry_debugger_process_message (uint8_t *recv_buffer_p, uint32_t message_size,
+                                     bool *resume_exec_p, uint8_t *expected_message_p, void **message_data_p);
+void jerry_debugger_breakpoint_hit (uint8_t message_type);
+
+void jerry_debugger_send_type (jerry_debugger_header_type_t type);
+bool jerry_debugger_send_configuration (uint8_t max_message_size);
+void jerry_debugger_send_data (jerry_debugger_header_type_t type, const void *data, size_t size);
+bool jerry_debugger_send_string (uint8_t message_type, const uint8_t *string_p, size_t string_length);
+bool jerry_debugger_send_function_cp (jerry_debugger_header_type_t type, ecma_compiled_code_t *compiled_code_p);
+bool jerry_debugger_send_parse_function (uint32_t line, uint32_t column);
+void jerry_debugger_send_memstats (void);
+bool jerry_debugger_send_exception_string (ecma_value_t exception_value);
+
+#endif /* JERRY_DEBUGGER */
+
+#endif /* DEBUGGER_H */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-alloc.c b/deps/jerry/jerry-core/ecma/base/ecma-alloc.c
new file mode 100644 (file)
index 0000000..cdff7c6
--- /dev/null
@@ -0,0 +1,261 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-globals.h"
+#include "ecma-gc.h"
+#include "ecma-lcache.h"
+#include "jrt.h"
+#include "jmem.h"
+
+JERRY_STATIC_ASSERT (sizeof (ecma_property_value_t) == sizeof (ecma_value_t),
+                     size_of_ecma_property_value_t_must_be_equal_to_size_of_ecma_value_t);
+JERRY_STATIC_ASSERT (((sizeof (ecma_property_value_t) - 1) & sizeof (ecma_property_value_t)) == 0,
+                     size_of_ecma_property_value_t_must_be_power_of_2);
+
+JERRY_STATIC_ASSERT (sizeof (ecma_string_t) == sizeof (uint64_t),
+                     size_of_ecma_string_t_must_be_less_than_or_equal_to_8_bytes);
+
+JERRY_STATIC_ASSERT (sizeof (ecma_extended_object_t) - sizeof (ecma_object_t) <= sizeof (uint64_t),
+                     size_of_ecma_extended_object_part_must_be_less_than_or_equal_to_8_bytes);
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaalloc Routines for allocation/freeing memory for ECMA data types
+ * @{
+ */
+
+/**
+ * Implementation of routines for allocation/freeing memory for ECMA data types.
+ *
+ * All allocation routines from this module have the same structure:
+ *  1. Try to allocate memory.
+ *  2. If allocation was successful, return pointer to the allocated block.
+ *  3. Run garbage collection.
+ *  4. Try to allocate memory.
+ *  5. If allocation was successful, return pointer to the allocated block;
+ *     else - shutdown engine.
+ */
+
+/**
+ * Template of an allocation routine.
+ */
+#define ALLOC(ecma_type) ecma_ ## ecma_type ## _t * \
+  ecma_alloc_ ## ecma_type (void) \
+{ \
+  ecma_ ## ecma_type ## _t *ecma_type ## _p; \
+  ecma_type ## _p = (ecma_ ## ecma_type ## _t *) jmem_pools_alloc (sizeof (ecma_ ## ecma_type ## _t)); \
+  \
+  JERRY_ASSERT (ecma_type ## _p != NULL); \
+  \
+  return ecma_type ## _p; \
+}
+
+/**
+ * Deallocation routine template
+ */
+#define DEALLOC(ecma_type) void \
+  ecma_dealloc_ ## ecma_type (ecma_ ## ecma_type ## _t *ecma_type ## _p) \
+{ \
+  jmem_pools_free ((uint8_t *) ecma_type ## _p, sizeof (ecma_ ## ecma_type ## _t)); \
+}
+
+/**
+ * Declaration of alloc/free routine for specified ecma-type.
+ */
+#define DECLARE_ROUTINES_FOR(ecma_type) \
+  ALLOC (ecma_type) \
+  DEALLOC (ecma_type)
+
+DECLARE_ROUTINES_FOR (number)
+DECLARE_ROUTINES_FOR (collection_header)
+DECLARE_ROUTINES_FOR (collection_chunk)
+
+/**
+ * Allocate memory for ecma-object
+ *
+ * @return pointer to allocated memory
+ */
+inline ecma_object_t * __attr_always_inline___
+ecma_alloc_object (void)
+{
+#ifdef JMEM_STATS
+  jmem_stats_allocate_object_bytes (sizeof (ecma_object_t));
+#endif /* JMEM_STATS */
+
+  return (ecma_object_t *) jmem_pools_alloc (sizeof (ecma_object_t));
+} /* ecma_alloc_object */
+
+/**
+ * Dealloc memory from an ecma-object
+ */
+inline void __attr_always_inline___
+ecma_dealloc_object (ecma_object_t *object_p) /**< object to be freed */
+{
+#ifdef JMEM_STATS
+  jmem_stats_free_object_bytes (sizeof (ecma_object_t));
+#endif /* JMEM_STATS */
+
+  jmem_pools_free (object_p, sizeof (ecma_object_t));
+} /* ecma_dealloc_object */
+
+/**
+ * Allocate memory for extended object
+ *
+ * @return pointer to allocated memory
+ */
+inline ecma_extended_object_t * __attr_always_inline___
+ecma_alloc_extended_object (size_t size) /**< size of object */
+{
+#ifdef JMEM_STATS
+  jmem_stats_allocate_object_bytes (size);
+#endif /* JMEM_STATS */
+
+  return jmem_heap_alloc_block (size);
+} /* ecma_alloc_extended_object */
+
+/**
+ * Dealloc memory of an extended object
+ */
+inline void __attr_always_inline___
+ecma_dealloc_extended_object (ecma_extended_object_t *ext_object_p, /**< property pair to be freed */
+                              size_t size) /**< size of object */
+{
+#ifdef JMEM_STATS
+  jmem_stats_free_object_bytes (size);
+#endif /* JMEM_STATS */
+
+  jmem_heap_free_block (ext_object_p, size);
+} /* ecma_dealloc_extended_object */
+
+/**
+ * Allocate memory for ecma-string descriptor
+ *
+ * @return pointer to allocated memory
+ */
+inline ecma_string_t * __attr_always_inline___
+ecma_alloc_string (void)
+{
+#ifdef JMEM_STATS
+  jmem_stats_allocate_string_bytes (sizeof (ecma_string_t));
+#endif /* JMEM_STATS */
+
+  return (ecma_string_t *) jmem_pools_alloc (sizeof (ecma_string_t));
+} /* ecma_alloc_string */
+
+/**
+ * Dealloc memory from ecma-string descriptor
+ */
+inline void __attr_always_inline___
+ecma_dealloc_string (ecma_string_t *string_p) /**< string to be freed */
+{
+#ifdef JMEM_STATS
+  jmem_stats_free_string_bytes (sizeof (ecma_string_t));
+#endif /* JMEM_STATS */
+
+  jmem_pools_free (string_p, sizeof (ecma_string_t));
+} /* ecma_dealloc_string */
+
+/**
+ * Allocate memory for string with character data
+ *
+ * @return pointer to allocated memory
+ */
+inline ecma_string_t * __attr_always_inline___
+ecma_alloc_string_buffer (size_t size) /**< size of string */
+{
+#ifdef JMEM_STATS
+  jmem_stats_allocate_string_bytes (size);
+#endif /* JMEM_STATS */
+
+  return jmem_heap_alloc_block (size);
+} /* ecma_alloc_string_buffer */
+
+/**
+ * Dealloc memory of a string with character data
+ */
+inline void __attr_always_inline___
+ecma_dealloc_string_buffer (ecma_string_t *string_p, /**< string with data */
+                            size_t size) /**< size of string */
+{
+#ifdef JMEM_STATS
+  jmem_stats_free_string_bytes (size);
+#endif /* JMEM_STATS */
+
+  jmem_heap_free_block (string_p, size);
+} /* ecma_dealloc_string_buffer */
+
+/**
+ * Allocate memory for getter-setter pointer pair
+ *
+ * @return pointer to allocated memory
+ */
+inline ecma_getter_setter_pointers_t * __attr_always_inline___
+ecma_alloc_getter_setter_pointers (void)
+{
+#ifdef JMEM_STATS
+  jmem_stats_allocate_property_bytes (sizeof (ecma_property_pair_t));
+#endif /* JMEM_STATS */
+
+  return (ecma_getter_setter_pointers_t *) jmem_pools_alloc (sizeof (ecma_getter_setter_pointers_t));
+} /* ecma_alloc_getter_setter_pointers */
+
+/**
+ * Dealloc memory from getter-setter pointer pair
+ */
+inline void __attr_always_inline___
+ecma_dealloc_getter_setter_pointers (ecma_getter_setter_pointers_t *getter_setter_pointers_p) /**< pointer pair
+                                                                                                * to be freed */
+{
+#ifdef JMEM_STATS
+  jmem_stats_free_property_bytes (sizeof (ecma_property_pair_t));
+#endif /* JMEM_STATS */
+
+  jmem_pools_free (getter_setter_pointers_p, sizeof (ecma_getter_setter_pointers_t));
+} /* ecma_dealloc_getter_setter_pointers */
+
+/**
+ * Allocate memory for ecma-property pair
+ *
+ * @return pointer to allocated memory
+ */
+inline ecma_property_pair_t * __attr_always_inline___
+ecma_alloc_property_pair (void)
+{
+#ifdef JMEM_STATS
+  jmem_stats_allocate_property_bytes (sizeof (ecma_property_pair_t));
+#endif /* JMEM_STATS */
+
+  return jmem_heap_alloc_block (sizeof (ecma_property_pair_t));
+} /* ecma_alloc_property_pair */
+
+/**
+ * Dealloc memory of an ecma-property
+ */
+inline void __attr_always_inline___
+ecma_dealloc_property_pair (ecma_property_pair_t *property_pair_p) /**< property pair to be freed */
+{
+#ifdef JMEM_STATS
+  jmem_stats_free_property_bytes (sizeof (ecma_property_pair_t));
+#endif /* JMEM_STATS */
+
+  jmem_heap_free_block (property_pair_p, sizeof (ecma_property_pair_t));
+} /* ecma_dealloc_property_pair */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-alloc.h b/deps/jerry/jerry-core/ecma/base/ecma-alloc.h
new file mode 100644 (file)
index 0000000..16ebf83
--- /dev/null
@@ -0,0 +1,141 @@
+/* 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.
+ */
+
+#ifndef ECMA_ALLOC_H
+#define ECMA_ALLOC_H
+
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaalloc Routines for allocation/freeing memory for ECMA data types
+ * @{
+ */
+
+/**
+ * Allocate memory for ecma-object
+ *
+ * @return pointer to allocated memory
+ */
+ecma_object_t *ecma_alloc_object (void);
+
+/**
+ * Dealloc memory from an ecma-object
+ */
+void ecma_dealloc_object (ecma_object_t *object_p);
+
+/**
+ * Allocate memory for extended object
+ *
+ * @return pointer to allocated memory
+ */
+ecma_extended_object_t *ecma_alloc_extended_object (size_t size);
+
+/**
+ * Dealloc memory of an extended object
+ */
+void ecma_dealloc_extended_object (ecma_extended_object_t *ext_object_p, size_t size);
+
+/**
+ * Allocate memory for ecma-number
+ *
+ * @return pointer to allocated memory
+ */
+ecma_number_t *ecma_alloc_number (void);
+
+/**
+ * Dealloc memory from an ecma-number
+ */
+void ecma_dealloc_number (ecma_number_t *number_p);
+
+/**
+ * Allocate memory for header of a collection
+ *
+ * @return pointer to allocated memory
+ */
+ecma_collection_header_t *ecma_alloc_collection_header (void);
+
+/**
+ * Dealloc memory from the collection's header
+ */
+void ecma_dealloc_collection_header (ecma_collection_header_t *collection_header_p);
+
+/**
+ * Allocate memory for non-first chunk of a collection
+ *
+ * @return pointer to allocated memory
+ */
+ecma_collection_chunk_t *ecma_alloc_collection_chunk (void);
+
+/**
+ * Dealloc memory from non-first chunk of a collection
+ */
+void ecma_dealloc_collection_chunk (ecma_collection_chunk_t *collection_chunk_p);
+
+/**
+ * Allocate memory for ecma-string descriptor
+ *
+ * @return pointer to allocated memory
+ */
+ecma_string_t *ecma_alloc_string (void);
+
+/**
+ * Dealloc memory from ecma-string descriptor
+ */
+void ecma_dealloc_string (ecma_string_t *string_p);
+
+/**
+ * Allocate memory for string with character data
+ *
+ * @return pointer to allocated memory
+ */
+ecma_string_t *ecma_alloc_string_buffer (size_t size);
+
+/**
+ * Dealloc memory of a string with character data
+ */
+void ecma_dealloc_string_buffer (ecma_string_t *string_p, size_t size);
+
+/**
+ * Allocate memory for getter-setter pointer pair
+ *
+ * @return pointer to allocated memory
+ */
+ecma_getter_setter_pointers_t *ecma_alloc_getter_setter_pointers (void);
+
+/**
+ * Dealloc memory from getter-setter pointer pair
+ */
+void ecma_dealloc_getter_setter_pointers (ecma_getter_setter_pointers_t *getter_setter_pointers_p);
+
+/**
+ * Allocate memory for ecma-property pair
+ *
+ * @return pointer to allocated memory
+ */
+ecma_property_pair_t *ecma_alloc_property_pair (void);
+
+/**
+ * Dealloc memory from an ecma-property pair
+ */
+void ecma_dealloc_property_pair (ecma_property_pair_t *property_pair_p);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_ALLOC_H */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-gc.c b/deps/jerry/jerry-core/ecma/base/ecma-gc.c
new file mode 100644 (file)
index 0000000..3160dd3
--- /dev/null
@@ -0,0 +1,855 @@
+/* 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.
+ */
+
+/**
+ * Garbage collector implementation
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-globals.h"
+#include "ecma-gc.h"
+#include "ecma-helpers.h"
+#include "ecma-lcache.h"
+#include "ecma-property-hashmap.h"
+#include "jcontext.h"
+#include "jrt.h"
+#include "jrt-libc-includes.h"
+#include "jrt-bit-fields.h"
+#include "re-compiler.h"
+#include "vm-defines.h"
+#include "vm-stack.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+#include "ecma-typedarray-object.h"
+#endif
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+#include "ecma-promise-object.h"
+#endif
+
+/* TODO: Extract GC to a separate component */
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmagc Garbage collector
+ * @{
+ */
+
+/**
+ * Current state of an object's visited flag that
+ * indicates whether the object is in visited state:
+ *
+ *  visited_field | visited_flip_flag | real_value
+ *         false  |            false  |     false
+ *         false  |             true  |      true
+ *          true  |            false  |      true
+ *          true  |             true  |     false
+ */
+
+static void ecma_gc_mark (ecma_object_t *object_p);
+static void ecma_gc_sweep (ecma_object_t *object_p);
+
+/**
+ * Get next object in list of objects with same generation.
+ */
+static inline ecma_object_t *
+ecma_gc_get_object_next (ecma_object_t *object_p) /**< object */
+{
+  JERRY_ASSERT (object_p != NULL);
+
+  return ECMA_GET_POINTER (ecma_object_t, object_p->gc_next_cp);
+} /* ecma_gc_get_object_next */
+
+/**
+ * Set next object in list of objects with same generation.
+ */
+static inline void
+ecma_gc_set_object_next (ecma_object_t *object_p, /**< object */
+                         ecma_object_t *next_object_p) /**< next object */
+{
+  JERRY_ASSERT (object_p != NULL);
+
+  ECMA_SET_POINTER (object_p->gc_next_cp, next_object_p);
+} /* ecma_gc_set_object_next */
+
+/**
+ * Get visited flag of the object.
+ */
+static inline bool
+ecma_gc_is_object_visited (ecma_object_t *object_p) /**< object */
+{
+  JERRY_ASSERT (object_p != NULL);
+
+  bool flag_value = (object_p->type_flags_refs & ECMA_OBJECT_FLAG_GC_VISITED) != 0;
+
+  return flag_value != JERRY_CONTEXT (ecma_gc_visited_flip_flag);
+} /* ecma_gc_is_object_visited */
+
+/**
+ * Set visited flag of the object.
+ */
+static inline void
+ecma_gc_set_object_visited (ecma_object_t *object_p, /**< object */
+                            bool is_visited) /**< flag value */
+{
+  JERRY_ASSERT (object_p != NULL);
+
+  if (is_visited != JERRY_CONTEXT (ecma_gc_visited_flip_flag))
+  {
+    object_p->type_flags_refs = (uint16_t) (object_p->type_flags_refs | ECMA_OBJECT_FLAG_GC_VISITED);
+  }
+  else
+  {
+    object_p->type_flags_refs = (uint16_t) (object_p->type_flags_refs & ~ECMA_OBJECT_FLAG_GC_VISITED);
+  }
+} /* ecma_gc_set_object_visited */
+
+/**
+ * Initialize GC information for the object
+ */
+inline void
+ecma_init_gc_info (ecma_object_t *object_p) /**< object */
+{
+  JERRY_CONTEXT (ecma_gc_objects_number)++;
+  JERRY_CONTEXT (ecma_gc_new_objects)++;
+
+  JERRY_ASSERT (JERRY_CONTEXT (ecma_gc_new_objects) <= JERRY_CONTEXT (ecma_gc_objects_number));
+
+  JERRY_ASSERT (object_p->type_flags_refs < ECMA_OBJECT_REF_ONE);
+  object_p->type_flags_refs = (uint16_t) (object_p->type_flags_refs | ECMA_OBJECT_REF_ONE);
+
+  ecma_gc_set_object_next (object_p, JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_WHITE_GRAY]);
+  JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_WHITE_GRAY] = object_p;
+
+  /* Should be set to false at the beginning of garbage collection */
+  ecma_gc_set_object_visited (object_p, false);
+} /* ecma_init_gc_info */
+
+/**
+ * Increase reference counter of an object
+ */
+void
+ecma_ref_object (ecma_object_t *object_p) /**< object */
+{
+  if (likely (object_p->type_flags_refs < ECMA_OBJECT_MAX_REF))
+  {
+    object_p->type_flags_refs = (uint16_t) (object_p->type_flags_refs + ECMA_OBJECT_REF_ONE);
+  }
+  else
+  {
+    jerry_fatal (ERR_REF_COUNT_LIMIT);
+  }
+} /* ecma_ref_object */
+
+/**
+ * Decrease reference counter of an object
+ */
+void
+ecma_deref_object (ecma_object_t *object_p) /**< object */
+{
+  JERRY_ASSERT (object_p->type_flags_refs >= ECMA_OBJECT_REF_ONE);
+  object_p->type_flags_refs = (uint16_t) (object_p->type_flags_refs - ECMA_OBJECT_REF_ONE);
+} /* ecma_deref_object */
+
+/**
+ * Mark referenced object from property
+ */
+static void
+ecma_gc_mark_property (ecma_property_pair_t *property_pair_p, /**< property pair */
+                       uint32_t index) /**< property index */
+{
+  uint8_t property = property_pair_p->header.types[index];
+
+  switch (ECMA_PROPERTY_GET_TYPE (property))
+  {
+    case ECMA_PROPERTY_TYPE_NAMEDDATA:
+    {
+      if (ECMA_PROPERTY_GET_NAME_TYPE (property) == ECMA_STRING_CONTAINER_MAGIC_STRING
+          && property_pair_p->names_cp[index] >= LIT_NEED_MARK_MAGIC_STRING__COUNT)
+      {
+        break;
+      }
+
+      ecma_value_t value = property_pair_p->values[index].value;
+
+      if (ecma_is_value_object (value))
+      {
+        ecma_object_t *value_obj_p = ecma_get_object_from_value (value);
+
+        ecma_gc_set_object_visited (value_obj_p, true);
+      }
+      break;
+    }
+    case ECMA_PROPERTY_TYPE_NAMEDACCESSOR:
+    {
+      ecma_property_value_t *accessor_objs_p = property_pair_p->values + index;
+      ecma_object_t *getter_obj_p = ecma_get_named_accessor_property_getter (accessor_objs_p);
+      ecma_object_t *setter_obj_p = ecma_get_named_accessor_property_setter (accessor_objs_p);
+
+      if (getter_obj_p != NULL)
+      {
+        ecma_gc_set_object_visited (getter_obj_p, true);
+      }
+
+      if (setter_obj_p != NULL)
+      {
+        ecma_gc_set_object_visited (setter_obj_p, true);
+      }
+      break;
+    }
+    case ECMA_PROPERTY_TYPE_SPECIAL:
+    {
+      JERRY_ASSERT (ECMA_PROPERTY_GET_SPECIAL_PROPERTY_TYPE (&property) == ECMA_SPECIAL_PROPERTY_DELETED
+                    || ECMA_PROPERTY_GET_SPECIAL_PROPERTY_TYPE (&property) == ECMA_SPECIAL_PROPERTY_HASHMAP);
+      break;
+    }
+    default:
+    {
+      JERRY_UNREACHABLE ();
+      break;
+    }
+  }
+} /* ecma_gc_mark_property */
+
+/**
+ * Mark objects as visited starting from specified object as root
+ */
+void
+ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (ecma_gc_is_object_visited (object_p));
+
+  bool traverse_properties = true;
+
+  if (ecma_is_lexical_environment (object_p))
+  {
+    ecma_object_t *lex_env_p = ecma_get_lex_env_outer_reference (object_p);
+    if (lex_env_p != NULL)
+    {
+      ecma_gc_set_object_visited (lex_env_p, true);
+    }
+
+    if (ecma_get_lex_env_type (object_p) != ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
+    {
+      ecma_object_t *binding_object_p = ecma_get_lex_env_binding_object (object_p);
+      ecma_gc_set_object_visited (binding_object_p, true);
+
+      traverse_properties = false;
+    }
+  }
+  else
+  {
+    ecma_object_t *proto_p = ecma_get_object_prototype (object_p);
+    if (proto_p != NULL)
+    {
+      ecma_gc_set_object_visited (proto_p, true);
+    }
+
+    switch (ecma_get_object_type (object_p))
+    {
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+      case ECMA_OBJECT_TYPE_CLASS:
+      {
+        ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+        if (ext_object_p->u.class_prop.class_id == LIT_MAGIC_STRING_PROMISE_UL)
+        {
+          /* Mark promise result. */
+          ecma_value_t result = ext_object_p->u.class_prop.u.value;
+
+          if (ecma_is_value_object (result))
+          {
+            ecma_gc_set_object_visited (ecma_get_object_from_value (result), true);
+          }
+
+          /* Mark all reactions. */
+          ecma_collection_iterator_t iter;
+          ecma_collection_iterator_init (&iter, ((ecma_promise_object_t *) ext_object_p)->fulfill_reactions);
+
+          while (ecma_collection_iterator_next (&iter))
+          {
+            ecma_gc_set_object_visited (ecma_get_object_from_value (*iter.current_value_p), true);
+          }
+
+          ecma_collection_iterator_init (&iter, ((ecma_promise_object_t *) ext_object_p)->reject_reactions);
+
+          while (ecma_collection_iterator_next (&iter))
+          {
+            ecma_gc_set_object_visited (ecma_get_object_from_value (*iter.current_value_p), true);
+          }
+        }
+
+        break;
+      }
+#endif /*! CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+      case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
+      {
+        ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+        switch (ext_object_p->u.pseudo_array.type)
+        {
+          case ECMA_PSEUDO_ARRAY_ARGUMENTS:
+          {
+            ecma_object_t *lex_env_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                                        ext_object_p->u.pseudo_array.u2.lex_env_cp);
+
+            ecma_gc_set_object_visited (lex_env_p, true);
+            break;
+          }
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+          case ECMA_PSEUDO_ARRAY_TYPEDARRAY:
+          case ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO:
+          {
+            ecma_gc_set_object_visited (ecma_typedarray_get_arraybuffer (object_p), true);
+            break;
+          }
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+          default:
+          {
+            JERRY_UNREACHABLE ();
+            break;
+          }
+        }
+
+        break;
+      }
+      case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
+      {
+        ecma_extended_object_t *ext_function_p = (ecma_extended_object_t *) object_p;
+
+        ecma_object_t *target_func_obj_p;
+        target_func_obj_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                             ext_function_p->u.bound_function.target_function);
+
+        ecma_gc_set_object_visited (target_func_obj_p, true);
+
+        ecma_length_t args_length = ext_function_p->u.bound_function.args_length;
+        ecma_value_t *args_p = (ecma_value_t *) (ext_function_p + 1);
+
+        JERRY_ASSERT (args_length > 0);
+
+        for (ecma_length_t i = 0; i < args_length; i++)
+        {
+          if (ecma_is_value_object (args_p[i]))
+          {
+            ecma_gc_set_object_visited (ecma_get_object_from_value (args_p[i]), true);
+          }
+        }
+        break;
+      }
+      case ECMA_OBJECT_TYPE_FUNCTION:
+      {
+        if (!ecma_get_object_is_builtin (object_p))
+        {
+          ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
+
+          ecma_object_t *scope_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                                    ext_func_p->u.function.scope_cp);
+
+          ecma_gc_set_object_visited (scope_p, true);
+        }
+        break;
+      }
+      default:
+      {
+        break;
+      }
+    }
+  }
+
+  if (traverse_properties)
+  {
+    ecma_property_header_t *prop_iter_p = ecma_get_property_list (object_p);
+
+    while (prop_iter_p != NULL)
+    {
+      JERRY_ASSERT (prop_iter_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP
+                    || ECMA_PROPERTY_IS_PROPERTY_PAIR (prop_iter_p));
+
+      ecma_gc_mark_property ((ecma_property_pair_t *) prop_iter_p, 0);
+      ecma_gc_mark_property ((ecma_property_pair_t *) prop_iter_p, 1);
+
+      prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                      prop_iter_p->next_property_cp);
+    }
+  }
+} /* ecma_gc_mark */
+
+/**
+ * Free the native handle/pointer by calling its free callback.
+ */
+static void
+ecma_gc_free_native_pointer (ecma_property_t *property_p, /**< property */
+                             lit_magic_string_id_t id) /**< identifier of internal property */
+{
+  JERRY_ASSERT (property_p != NULL);
+
+  JERRY_ASSERT (id == LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE
+                || id == LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER);
+
+  ecma_property_value_t *value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
+  ecma_native_pointer_t *native_pointer_p;
+
+  native_pointer_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_native_pointer_t,
+                                                      value_p->value);
+
+  if (id == LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE)
+  {
+    if (native_pointer_p->u.callback_p != NULL)
+    {
+      native_pointer_p->u.callback_p ((uintptr_t) native_pointer_p->data_p);
+    }
+  }
+  else
+  {
+    if (native_pointer_p->u.info_p != NULL)
+    {
+      ecma_object_native_free_callback_t free_cb = native_pointer_p->u.info_p->free_cb;
+
+      if (free_cb != NULL)
+      {
+        free_cb (native_pointer_p->data_p);
+      }
+    }
+  }
+} /* ecma_gc_free_native_pointer */
+
+/**
+ * Free specified object.
+ */
+void
+ecma_gc_sweep (ecma_object_t *object_p) /**< object to free */
+{
+  JERRY_ASSERT (object_p != NULL
+                && !ecma_gc_is_object_visited (object_p)
+                && object_p->type_flags_refs < ECMA_OBJECT_REF_ONE);
+
+  bool obj_is_not_lex_env = !ecma_is_lexical_environment (object_p);
+
+  if (obj_is_not_lex_env
+      || ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
+  {
+    ecma_property_header_t *prop_iter_p = ecma_get_property_list (object_p);
+
+    if (prop_iter_p != NULL && prop_iter_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
+    {
+      ecma_property_hashmap_free (object_p);
+      prop_iter_p = ecma_get_property_list (object_p);
+    }
+
+    while (prop_iter_p != NULL)
+    {
+      JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (prop_iter_p));
+
+      /* Both cannot be deleted. */
+      JERRY_ASSERT (prop_iter_p->types[0] != ECMA_PROPERTY_TYPE_DELETED
+                    || prop_iter_p->types[1] != ECMA_PROPERTY_TYPE_DELETED);
+
+      ecma_property_pair_t *prop_pair_p = (ecma_property_pair_t *) prop_iter_p;
+
+      for (int i = 0; i < ECMA_PROPERTY_PAIR_ITEM_COUNT; i++)
+      {
+        ecma_property_t *property_p = (ecma_property_t *) (prop_iter_p->types + i);
+        jmem_cpointer_t name_cp = prop_pair_p->names_cp[i];
+
+        /* Call the native's free callback. */
+        if (ECMA_PROPERTY_GET_NAME_TYPE (*property_p) == ECMA_STRING_CONTAINER_MAGIC_STRING
+            && (name_cp == LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE
+                || name_cp == LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER))
+        {
+          ecma_gc_free_native_pointer (property_p, (lit_magic_string_id_t) name_cp);
+        }
+
+        if (prop_iter_p->types[i] != ECMA_PROPERTY_TYPE_DELETED)
+        {
+          ecma_free_property (object_p, name_cp, property_p);
+        }
+      }
+
+      /* Both must be deleted. */
+      JERRY_ASSERT (prop_iter_p->types[0] == ECMA_PROPERTY_TYPE_DELETED
+                    && prop_iter_p->types[1] == ECMA_PROPERTY_TYPE_DELETED);
+
+      prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                      prop_iter_p->next_property_cp);
+
+      ecma_dealloc_property_pair (prop_pair_p);
+    }
+  }
+
+  JERRY_ASSERT (JERRY_CONTEXT (ecma_gc_objects_number) > 0);
+  JERRY_CONTEXT (ecma_gc_objects_number)--;
+
+  if (obj_is_not_lex_env)
+  {
+    ecma_object_type_t object_type = ecma_get_object_type (object_p);
+
+    size_t ext_object_size = sizeof (ecma_extended_object_t);
+
+    if (ecma_get_object_is_builtin (object_p))
+    {
+      uint8_t length_and_bitset_size;
+
+      if (object_type == ECMA_OBJECT_TYPE_CLASS
+          || object_type == ECMA_OBJECT_TYPE_ARRAY)
+      {
+        ext_object_size = sizeof (ecma_extended_built_in_object_t);
+        length_and_bitset_size = ((ecma_extended_built_in_object_t *) object_p)->built_in.length_and_bitset_size;
+      }
+      else
+      {
+        length_and_bitset_size = ((ecma_extended_object_t *) object_p)->u.built_in.length_and_bitset_size;
+      }
+
+      ext_object_size += (2 * sizeof (uint32_t)) * (length_and_bitset_size >> ECMA_BUILT_IN_BITSET_SHIFT);
+    }
+
+    if (object_type == ECMA_OBJECT_TYPE_CLASS)
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      switch (ext_object_p->u.class_prop.class_id)
+      {
+        /* The undefined id represents an uninitialized class. */
+        case LIT_MAGIC_STRING_UNDEFINED:
+        case LIT_MAGIC_STRING_ARGUMENTS_UL:
+        case LIT_MAGIC_STRING_BOOLEAN_UL:
+        case LIT_MAGIC_STRING_ERROR_UL:
+        {
+          break;
+        }
+
+        case LIT_MAGIC_STRING_STRING_UL:
+        case LIT_MAGIC_STRING_NUMBER_UL:
+        {
+          ecma_free_value (ext_object_p->u.class_prop.u.value);
+          break;
+        }
+
+        case LIT_MAGIC_STRING_DATE_UL:
+        {
+          ecma_number_t *num_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t,
+                                                                  ext_object_p->u.class_prop.u.value);
+          ecma_dealloc_number (num_p);
+          break;
+        }
+
+        case LIT_MAGIC_STRING_REGEXP_UL:
+        {
+          ecma_compiled_code_t *bytecode_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_compiled_code_t,
+                                                                              ext_object_p->u.class_prop.u.value);
+          if (bytecode_p != NULL)
+          {
+            ecma_bytecode_deref (bytecode_p);
+          }
+          break;
+        }
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+        case LIT_MAGIC_STRING_ARRAY_BUFFER_UL:
+        {
+          ecma_length_t arraybuffer_length = ext_object_p->u.class_prop.u.length;
+          size_t size = sizeof (ecma_extended_object_t) + arraybuffer_length;
+          ecma_dealloc_extended_object ((ecma_extended_object_t *) object_p, size);
+          return;
+        }
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+        case LIT_MAGIC_STRING_PROMISE_UL:
+        {
+          ecma_free_value_if_not_object (ext_object_p->u.class_prop.u.value);
+          ecma_free_values_collection (((ecma_promise_object_t *) object_p)->fulfill_reactions, false);
+          ecma_free_values_collection (((ecma_promise_object_t *) object_p)->reject_reactions, false);
+          ecma_dealloc_extended_object ((ecma_extended_object_t *) object_p, sizeof (ecma_promise_object_t));
+          return;
+        }
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+        default:
+        {
+          JERRY_UNREACHABLE ();
+          break;
+        }
+      }
+
+      ecma_dealloc_extended_object ((ecma_extended_object_t *) object_p, ext_object_size);
+      return;
+    }
+
+    if (ecma_get_object_is_builtin (object_p)
+        || object_type == ECMA_OBJECT_TYPE_ARRAY
+        || object_type == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION)
+    {
+      ecma_dealloc_extended_object ((ecma_extended_object_t *) object_p, ext_object_size);
+      return;
+    }
+
+    if (object_type == ECMA_OBJECT_TYPE_FUNCTION)
+    {
+      /* Function with byte-code (not a built-in function). */
+      ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
+
+      ecma_bytecode_deref (ECMA_GET_INTERNAL_VALUE_POINTER (ecma_compiled_code_t,
+                                                            ext_func_p->u.function.bytecode_cp));
+
+      ecma_dealloc_extended_object (ext_func_p, sizeof (ecma_extended_object_t));
+      return;
+    }
+
+    if (object_type == ECMA_OBJECT_TYPE_PSEUDO_ARRAY)
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      switch (ext_object_p->u.pseudo_array.type)
+      {
+        case ECMA_PSEUDO_ARRAY_ARGUMENTS:
+        {
+          ecma_length_t formal_params_number = ext_object_p->u.pseudo_array.u1.length;
+          jmem_cpointer_t *arg_Literal_p = (jmem_cpointer_t *) (ext_object_p + 1);
+
+          for (ecma_length_t i = 0; i < formal_params_number; i++)
+          {
+            if (arg_Literal_p[i] != JMEM_CP_NULL)
+            {
+              ecma_string_t *name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t, arg_Literal_p[i]);
+              ecma_deref_ecma_string (name_p);
+            }
+          }
+
+          size_t formal_params_size = formal_params_number * sizeof (jmem_cpointer_t);
+          ecma_dealloc_extended_object (ext_object_p, sizeof (ecma_extended_object_t) + formal_params_size);
+          return;
+        }
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+        case ECMA_PSEUDO_ARRAY_TYPEDARRAY:
+        {
+          ecma_dealloc_extended_object ((ecma_extended_object_t *) object_p,
+                                        sizeof (ecma_extended_object_t));
+          return;
+        }
+        case ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO:
+        {
+          ecma_dealloc_extended_object ((ecma_extended_object_t *) object_p,
+                                        sizeof (ecma_extended_typedarray_object_t));
+          return;
+        }
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+        default:
+        {
+          JERRY_UNREACHABLE ();
+          break;
+        }
+      }
+
+      JERRY_UNREACHABLE ();
+    }
+
+    if (object_type == ECMA_OBJECT_TYPE_BOUND_FUNCTION)
+    {
+      ecma_extended_object_t *ext_function_p = (ecma_extended_object_t *) object_p;
+      ecma_length_t args_length = ext_function_p->u.bound_function.args_length;
+      ecma_value_t *args_p = (ecma_value_t *) (ext_function_p + 1);
+
+      for (ecma_length_t i = 0; i < args_length; i++)
+      {
+        ecma_free_value_if_not_object (args_p[i]);
+      }
+
+      size_t args_size = args_length * sizeof (ecma_value_t);
+      ecma_dealloc_extended_object (ext_function_p, sizeof (ecma_extended_object_t) + args_size);
+      return;
+    }
+  }
+
+  ecma_dealloc_object (object_p);
+} /* ecma_gc_sweep */
+
+/**
+ * Run garbage collection
+ */
+void
+ecma_gc_run (jmem_free_unused_memory_severity_t severity) /**< gc severity */
+{
+  JERRY_CONTEXT (ecma_gc_new_objects) = 0;
+
+  JERRY_ASSERT (JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_BLACK] == NULL);
+
+  /* if some object is referenced from stack or globals (i.e. it is root), mark it */
+  for (ecma_object_t *obj_iter_p = JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_WHITE_GRAY];
+       obj_iter_p != NULL;
+       obj_iter_p = ecma_gc_get_object_next (obj_iter_p))
+  {
+    JERRY_ASSERT (!ecma_gc_is_object_visited (obj_iter_p));
+
+    if (obj_iter_p->type_flags_refs >= ECMA_OBJECT_REF_ONE)
+    {
+      ecma_gc_set_object_visited (obj_iter_p, true);
+    }
+  }
+
+  bool marked_anything_during_current_iteration = false;
+
+  do
+  {
+    marked_anything_during_current_iteration = false;
+
+    ecma_object_t *obj_prev_p = NULL;
+    ecma_object_t *obj_iter_p = JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_WHITE_GRAY];
+
+    while (obj_iter_p != NULL)
+    {
+      ecma_object_t *obj_next_p = ecma_gc_get_object_next (obj_iter_p);
+
+      if (ecma_gc_is_object_visited (obj_iter_p))
+      {
+        /* Moving the object to list of marked objects */
+        ecma_gc_set_object_next (obj_iter_p, JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_BLACK]);
+        JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_BLACK] = obj_iter_p;
+
+        if (likely (obj_prev_p != NULL))
+        {
+          JERRY_ASSERT (ecma_gc_get_object_next (obj_prev_p) == obj_iter_p);
+
+          ecma_gc_set_object_next (obj_prev_p, obj_next_p);
+        }
+        else
+        {
+          JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_WHITE_GRAY] = obj_next_p;
+        }
+
+        ecma_gc_mark (obj_iter_p);
+        marked_anything_during_current_iteration = true;
+      }
+      else
+      {
+        obj_prev_p = obj_iter_p;
+      }
+
+      obj_iter_p = obj_next_p;
+    }
+  }
+  while (marked_anything_during_current_iteration);
+
+  /* Sweeping objects that are currently unmarked */
+  ecma_object_t *obj_iter_p = JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_WHITE_GRAY];
+
+  while (obj_iter_p != NULL)
+  {
+    ecma_object_t *obj_next_p = ecma_gc_get_object_next (obj_iter_p);
+
+    JERRY_ASSERT (!ecma_gc_is_object_visited (obj_iter_p));
+
+    ecma_gc_sweep (obj_iter_p);
+    obj_iter_p = obj_next_p;
+  }
+
+  if (severity == JMEM_FREE_UNUSED_MEMORY_SEVERITY_HIGH)
+  {
+    /* Remove the property hashmap of BLACK objects */
+    obj_iter_p = JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_BLACK];
+
+    while (obj_iter_p != NULL)
+    {
+      JERRY_ASSERT (ecma_gc_is_object_visited (obj_iter_p));
+
+      if (!ecma_is_lexical_environment (obj_iter_p)
+          || ecma_get_lex_env_type (obj_iter_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
+      {
+        ecma_property_header_t *prop_iter_p = ecma_get_property_list (obj_iter_p);
+
+        if (prop_iter_p != NULL && prop_iter_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
+        {
+          ecma_property_hashmap_free (obj_iter_p);
+        }
+      }
+
+      obj_iter_p = ecma_gc_get_object_next (obj_iter_p);
+    }
+  }
+
+  /* Unmarking all objects */
+  ecma_object_t *black_objects = JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_BLACK];
+  JERRY_CONTEXT (ecma_gc_objects_lists)[ECMA_GC_COLOR_WHITE_GRAY] = black_objects;
+  JERRY_CONTEXT (ecma_gc_objects_lists) [ECMA_GC_COLOR_BLACK] = NULL;
+
+  JERRY_CONTEXT (ecma_gc_visited_flip_flag) = !JERRY_CONTEXT (ecma_gc_visited_flip_flag);
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+  /* Free RegExp bytecodes stored in cache */
+  re_cache_gc_run ();
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+} /* ecma_gc_run */
+
+/**
+ * Try to free some memory (depending on severity).
+ */
+void
+ecma_free_unused_memory (jmem_free_unused_memory_severity_t severity) /**< severity of the request */
+{
+#ifdef JERRY_DEBUGGER
+  while ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+         && JERRY_CONTEXT (debugger_byte_code_free_tail) != ECMA_NULL_POINTER)
+  {
+    /* Wait until all byte code is freed or the connection is aborted. */
+    jerry_debugger_receive ();
+  }
+#endif /* JERRY_DEBUGGER */
+
+  if (severity == JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW)
+  {
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+    if (JERRY_CONTEXT (ecma_prop_hashmap_alloc_state) > ECMA_PROP_HASHMAP_ALLOC_ON)
+    {
+      --JERRY_CONTEXT (ecma_prop_hashmap_alloc_state);
+    }
+    JERRY_CONTEXT (ecma_prop_hashmap_alloc_last_is_hs_gc) = false;
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+
+    /*
+     * If there is enough newly allocated objects since last GC, probably it is worthwhile to start GC now.
+     * Otherwise, probability to free sufficient space is considered to be low.
+     */
+    size_t new_objects_share = CONFIG_ECMA_GC_NEW_OBJECTS_SHARE_TO_START_GC;
+
+    if (JERRY_CONTEXT (ecma_gc_new_objects) * new_objects_share > JERRY_CONTEXT (ecma_gc_objects_number))
+    {
+      ecma_gc_run (severity);
+    }
+  }
+  else
+  {
+    JERRY_ASSERT (severity == JMEM_FREE_UNUSED_MEMORY_SEVERITY_HIGH);
+
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+    if (JERRY_CONTEXT (ecma_prop_hashmap_alloc_last_is_hs_gc))
+    {
+      JERRY_CONTEXT (ecma_prop_hashmap_alloc_state) = ECMA_PROP_HASHMAP_ALLOC_MAX;
+    }
+    else if (JERRY_CONTEXT (ecma_prop_hashmap_alloc_state) < ECMA_PROP_HASHMAP_ALLOC_MAX)
+    {
+      ++JERRY_CONTEXT (ecma_prop_hashmap_alloc_state);
+      JERRY_CONTEXT (ecma_prop_hashmap_alloc_last_is_hs_gc) = true;
+    }
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+
+    /* Freeing as much memory as we currently can */
+    ecma_gc_run (severity);
+  }
+} /* ecma_free_unused_memory */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-gc.h b/deps/jerry/jerry-core/ecma/base/ecma-gc.h
new file mode 100644 (file)
index 0000000..f50c888
--- /dev/null
@@ -0,0 +1,40 @@
+/* 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.
+ */
+
+#ifndef ECMA_GC_H
+#define ECMA_GC_H
+
+#include "ecma-globals.h"
+#include "jmem.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmagc Garbage collector
+ * @{
+ */
+
+void ecma_init_gc_info (ecma_object_t *object_p);
+void ecma_ref_object (ecma_object_t *object_p);
+void ecma_deref_object (ecma_object_t *object_p);
+void ecma_gc_run (jmem_free_unused_memory_severity_t severity);
+void ecma_free_unused_memory (jmem_free_unused_memory_severity_t severity);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_GC_H */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-globals.h b/deps/jerry/jerry-core/ecma/base/ecma-globals.h
new file mode 100644 (file)
index 0000000..83ac92e
--- /dev/null
@@ -0,0 +1,1240 @@
+/* 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.
+ */
+
+#ifndef ECMA_GLOBALS_H
+#define ECMA_GLOBALS_H
+
+#include "config.h"
+#include "jrt.h"
+#include "lit-magic-strings.h"
+#include "jmem.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmatypes ECMA types
+ * @{
+ *
+ * \addtogroup compressedpointer Compressed pointer
+ * @{
+ */
+
+/**
+ * Ecma-pointer field is used to calculate ecma value's address.
+ *
+ * Ecma-pointer contains value's shifted offset from common Ecma-pointers' base.
+ * The offset is shifted right by JMEM_ALIGNMENT_LOG.
+ * Least significant JMEM_ALIGNMENT_LOG bits of non-shifted offset are zeroes.
+ */
+#ifdef JERRY_CPOINTER_32_BIT
+#define ECMA_POINTER_FIELD_WIDTH 32
+#else /* !JERRY_CPOINTER_32_BIT */
+#define ECMA_POINTER_FIELD_WIDTH 16
+#endif /* JERRY_CPOINTER_32_BIT */
+
+/**
+ * The NULL value for compressed pointers
+ */
+#define ECMA_NULL_POINTER JMEM_CP_NULL
+
+/**
+ * @}
+ */
+
+/**
+ * JerryScript init flags.
+ */
+typedef enum
+{
+  ECMA_INIT_EMPTY               = (0u),      /**< empty flag set */
+  ECMA_INIT_SHOW_OPCODES        = (1u << 0), /**< dump byte-code to log after parse */
+  ECMA_INIT_SHOW_REGEXP_OPCODES = (1u << 1), /**< dump regexp byte-code to log after compilation */
+  ECMA_INIT_MEM_STATS           = (1u << 2), /**< dump memory statistics */
+} ecma_init_flag_t;
+
+/**
+ * Type of ecma value
+ */
+typedef enum
+{
+  ECMA_TYPE_DIRECT, /**< directly encoded value, a 28 bit signed integer or a simple value */
+  ECMA_TYPE_FLOAT, /**< pointer to a 64 or 32 bit floating point number */
+  ECMA_TYPE_STRING, /**< pointer to description of a string */
+  ECMA_TYPE_OBJECT, /**< pointer to description of an object */
+  ECMA_TYPE___MAX = ECMA_TYPE_OBJECT /** highest value for ecma types */
+} ecma_type_t;
+
+/**
+ * Simple ecma values
+ */
+typedef enum
+{
+  /**
+   * Empty value is implementation defined value, used for representing:
+   *   - empty (uninitialized) values
+   *   - immutable binding values
+   *   - special register or stack values for vm
+   */
+  ECMA_SIMPLE_VALUE_EMPTY, /**< uninitialized value */
+  ECMA_SIMPLE_VALUE_ARRAY_HOLE, /**< array hole, used for initialization of an array literal */
+  ECMA_SIMPLE_VALUE_FALSE, /**< boolean false */
+  ECMA_SIMPLE_VALUE_TRUE, /**< boolean true */
+  ECMA_SIMPLE_VALUE_UNDEFINED, /**< undefined value */
+  ECMA_SIMPLE_VALUE_NULL, /**< null value */
+  ECMA_SIMPLE_VALUE_NOT_FOUND, /**< a special value returned by ecma_op_object_find */
+  ECMA_SIMPLE_VALUE_REGISTER_REF, /**< register reference, a special "base" value for vm */
+  ECMA_SIMPLE_VALUE__COUNT /** count of simple ecma values */
+} ecma_simple_value_t;
+
+/**
+ * Description of an ecma value
+ *
+ * Bit-field structure: type (2) | error (1) | value (29)
+ */
+typedef uint32_t ecma_value_t;
+
+/**
+ * Type for directly encoded integer numbers in JerryScript.
+ */
+typedef int32_t ecma_integer_value_t;
+
+#if UINTPTR_MAX <= UINT32_MAX
+
+/**
+ * JMEM_ALIGNMENT_LOG aligned pointers can be stored directly in ecma_value_t
+ */
+#define ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY
+
+#endif /* UINTPTR_MAX <= UINT32_MAX */
+
+/**
+ * Mask for ecma types in ecma_type_t
+ */
+#define ECMA_VALUE_TYPE_MASK 0x3u
+
+/**
+ * Error flag in ecma_type_t
+ */
+#define ECMA_VALUE_ERROR_FLAG 0x4u
+
+/**
+ * Shift for value part in ecma_type_t
+ */
+#define ECMA_VALUE_SHIFT 3
+
+/**
+ * Mask for directly encoded values
+ */
+#define ECMA_DIRECT_TYPE_MASK ((1u << ECMA_VALUE_SHIFT) | ECMA_VALUE_TYPE_MASK)
+
+/**
+ * Ecma integer value type
+ */
+#define ECMA_DIRECT_TYPE_INTEGER_VALUE ((0u << ECMA_VALUE_SHIFT) | ECMA_TYPE_DIRECT)
+
+/**
+ * Ecma simple value type
+ */
+#define ECMA_DIRECT_TYPE_SIMPLE_VALUE ((1u << ECMA_VALUE_SHIFT) | ECMA_TYPE_DIRECT)
+
+/**
+ * Shift for directly encoded values in ecma_value_t
+ */
+#define ECMA_DIRECT_SHIFT 4
+
+/**
+ * Maximum integer number for an ecma value
+ */
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
+#define ECMA_INTEGER_NUMBER_MAX         0x7fffff
+#define ECMA_INTEGER_NUMBER_MAX_SHIFTED 0x7fffff0
+#else /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 */
+#define ECMA_INTEGER_NUMBER_MAX         0x7ffffff
+#define ECMA_INTEGER_NUMBER_MAX_SHIFTED 0x7ffffff0
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
+
+/**
+ * Minimum integer number for an ecma value
+ */
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
+#define ECMA_INTEGER_NUMBER_MIN         -0x7fffff
+#define ECMA_INTEGER_NUMBER_MIN_SHIFTED -0x7fffff0
+#else /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 */
+#define ECMA_INTEGER_NUMBER_MIN         -0x8000000
+#define ECMA_INTEGER_NUMBER_MIN_SHIFTED (-0x7fffffff - 1) /* -0x80000000 */
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
+
+#if ECMA_DIRECT_SHIFT != 4
+#error "Please update ECMA_INTEGER_NUMBER_MIN/MAX_SHIFTED according to the new value of ECMA_DIRECT_SHIFT."
+#endif
+
+/**
+ * Checks whether the integer number is in the integer number range.
+ */
+#define ECMA_IS_INTEGER_NUMBER(num) \
+  (ECMA_INTEGER_NUMBER_MIN <= (num) && (num) <= ECMA_INTEGER_NUMBER_MAX)
+
+/**
+ * Maximum integer number, which if squared, still fits in ecma_integer_value_t
+ */
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
+#define ECMA_INTEGER_MULTIPLY_MAX 0xb50
+#else /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 */
+#define ECMA_INTEGER_MULTIPLY_MAX 0x2d41
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
+
+/**
+ * Checks whether the error flag is set.
+ */
+#define ECMA_IS_VALUE_ERROR(value) \
+  (unlikely ((value & ECMA_VALUE_ERROR_FLAG) != 0))
+
+/**
+ * Representation for native external pointer
+ */
+typedef uintptr_t ecma_external_pointer_t;
+
+/**
+ * Callback which tells whether the ECMAScript execution should be stopped.
+ */
+typedef ecma_value_t (*ecma_vm_exec_stop_callback_t) (void *user_p);
+
+/**
+ * Function type for user context deallocation
+ */
+typedef void (*ecma_user_context_deinit_t) (void *user_context_p);
+
+/**
+ * Type of an external function handler.
+ */
+typedef ecma_value_t (*ecma_external_handler_t) (const ecma_value_t function_obj,
+                                                 const ecma_value_t this_val,
+                                                 const ecma_value_t args_p[],
+                                                 const ecma_length_t args_count);
+
+/**
+ * Native free callback of an object (deprecated).
+ */
+typedef void (*ecma_object_free_callback_t) (const uintptr_t native_p);
+
+/**
+ * Native free callback of an object.
+ */
+typedef void (*ecma_object_native_free_callback_t) (void *native_p);
+
+/**
+ * Type information of a native pointer.
+ */
+typedef struct
+{
+  ecma_object_native_free_callback_t free_cb; /**< the free callback of the native pointer */
+} ecma_object_native_info_t;
+
+/**
+ * Representation for native pointer data.
+ */
+typedef struct
+{
+  void *data_p; /**< points to the data of the object */
+  union
+  {
+    ecma_object_free_callback_t callback_p; /**< callback */
+    ecma_object_native_info_t *info_p; /**< native info */
+  } u;
+} ecma_native_pointer_t;
+
+/**
+ * Special property identifiers.
+ */
+typedef enum
+{
+  ECMA_SPECIAL_PROPERTY_DELETED, /**< deleted property */
+
+  /* Note: when new special types are added
+   * ECMA_PROPERTY_IS_PROPERTY_PAIR must be updated as well. */
+  ECMA_SPECIAL_PROPERTY_HASHMAP, /**< hashmap property */
+
+  ECMA_SPECIAL_PROPERTY__COUNT /**< Number of special property types */
+} ecma_internal_property_id_t;
+
+/**
+ * Property's 'Writable' attribute's values description.
+ */
+typedef enum
+{
+  ECMA_PROPERTY_NOT_WRITABLE, /**< property's 'Writable' attribute is false */
+  ECMA_PROPERTY_WRITABLE /**< property's 'Writable' attribute is true */
+} ecma_property_writable_value_t;
+
+/**
+ * Property's 'Enumerable' attribute's values description.
+ */
+typedef enum
+{
+  ECMA_PROPERTY_NOT_ENUMERABLE, /**< property's 'Enumerable' attribute is false */
+  ECMA_PROPERTY_ENUMERABLE /**< property's 'Enumerable' attribute is true */
+} ecma_property_enumerable_value_t;
+
+/**
+ * Property's 'Configurable' attribute's values description.
+ */
+typedef enum
+{
+  ECMA_PROPERTY_NOT_CONFIGURABLE, /**< property's 'Configurable' attribute is false */
+  ECMA_PROPERTY_CONFIGURABLE /**< property's 'Configurable' attribute is true */
+} ecma_property_configurable_value_t;
+
+/**
+ * Property list:
+ *   The property list of an object is a chain list of various items.
+ *   The type of each item is stored in the first byte of the item.
+ *
+ *   The most common item is the property pair, which contains two
+ *   ecmascript properties. It is also important, that after the
+ *   first property pair, only property pair items are allowed.
+ *
+ *   Example for other items is property name hash map, or array of items.
+ */
+
+/**
+ * Property type list.
+ */
+typedef enum
+{
+  ECMA_PROPERTY_TYPE_SPECIAL, /**< internal property */
+  ECMA_PROPERTY_TYPE_NAMEDDATA, /**< property is named data */
+  ECMA_PROPERTY_TYPE_NAMEDACCESSOR, /**< property is named accessor */
+  ECMA_PROPERTY_TYPE_VIRTUAL, /**< property is virtual */
+
+  ECMA_PROPERTY_TYPE__MAX = ECMA_PROPERTY_TYPE_VIRTUAL, /**< highest value for property types. */
+} ecma_property_types_t;
+
+/**
+ * Property type mask.
+ */
+#define ECMA_PROPERTY_TYPE_MASK 0x3
+
+/**
+ * Property flags base shift.
+ */
+#define ECMA_PROPERTY_FLAG_SHIFT 2
+
+/**
+ * Define special property type.
+ */
+#define ECMA_SPECIAL_PROPERTY_VALUE(type) \
+  ((uint8_t) (ECMA_PROPERTY_TYPE_SPECIAL | ((type) << ECMA_PROPERTY_FLAG_SHIFT)))
+
+/**
+ * Type of deleted property.
+ */
+#define ECMA_PROPERTY_TYPE_DELETED ECMA_SPECIAL_PROPERTY_VALUE (ECMA_SPECIAL_PROPERTY_DELETED)
+
+/**
+ * Type of hash-map property.
+ */
+#define ECMA_PROPERTY_TYPE_HASHMAP ECMA_SPECIAL_PROPERTY_VALUE (ECMA_SPECIAL_PROPERTY_HASHMAP)
+
+/**
+ * Type of property not found.
+ */
+#define ECMA_PROPERTY_TYPE_NOT_FOUND ECMA_PROPERTY_TYPE_DELETED
+
+/**
+ * Type of property not found and no more searching in the proto chain.
+ */
+#define ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP ECMA_PROPERTY_TYPE_HASHMAP
+
+/**
+ * Property flag list (for ECMA_PROPERTY_TYPE_NAMEDDATA
+ * and ECMA_PROPERTY_TYPE_NAMEDACCESSOR).
+ */
+typedef enum
+{
+  ECMA_PROPERTY_FLAG_CONFIGURABLE = 1u << (ECMA_PROPERTY_FLAG_SHIFT + 0), /**< property is configurable */
+  ECMA_PROPERTY_FLAG_ENUMERABLE = 1u << (ECMA_PROPERTY_FLAG_SHIFT + 1), /**< property is enumerable */
+  ECMA_PROPERTY_FLAG_WRITABLE = 1u << (ECMA_PROPERTY_FLAG_SHIFT + 2), /**< property is writable */
+  ECMA_PROPERTY_FLAG_LCACHED = 1u << (ECMA_PROPERTY_FLAG_SHIFT + 3), /**< property is lcached */
+} ecma_property_flags_t;
+
+/**
+ * Property flags configurable, enumerable, writable.
+ */
+#define ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE \
+  (ECMA_PROPERTY_FLAG_CONFIGURABLE | ECMA_PROPERTY_FLAG_ENUMERABLE | ECMA_PROPERTY_FLAG_WRITABLE)
+
+/**
+ * Property flags configurable, enumerable.
+ */
+#define ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE \
+  (ECMA_PROPERTY_FLAG_CONFIGURABLE | ECMA_PROPERTY_FLAG_ENUMERABLE)
+
+/**
+ * Property flags configurable, enumerable.
+ */
+#define ECMA_PROPERTY_CONFIGURABLE_WRITABLE \
+  (ECMA_PROPERTY_FLAG_CONFIGURABLE | ECMA_PROPERTY_FLAG_WRITABLE)
+
+/**
+ * Property flags enumerable, writable.
+ */
+#define ECMA_PROPERTY_ENUMERABLE_WRITABLE \
+  (ECMA_PROPERTY_FLAG_ENUMERABLE | ECMA_PROPERTY_FLAG_WRITABLE)
+
+/**
+ * No attributes can be changed for this property.
+ */
+#define ECMA_PROPERTY_FIXED 0
+
+/**
+ * Shift for property name part.
+ */
+#define ECMA_PROPERTY_NAME_TYPE_SHIFT (ECMA_PROPERTY_FLAG_SHIFT + 4)
+
+/**
+ * Property name is a generic string.
+ */
+#define ECMA_PROPERTY_NAME_TYPE_STRING 3
+
+/**
+ * Abstract property representation.
+ *
+ * A property is a type_and_flags byte and an ecma_value_t value pair.
+ * This pair is represented by a single pointer in JerryScript. Although
+ * a packed struct would only consume sizeof(ecma_value_t)+1 memory
+ * bytes, accessing such structure is inefficient from the CPU viewpoint
+ * because the value is not naturally aligned. To improve performance,
+ * two type bytes and values are packed together. The memory layout is
+ * the following:
+ *
+ *  [type 1, type 2, unused byte 1, unused byte 2][value 1][value 2]
+ *
+ * The unused two bytes are used to store a compressed pointer for the
+ * next property pair.
+ *
+ * The advantage of this layout is that the value reference can be computed
+ * from the property address. However, property pointers cannot be compressed
+ * anymore.
+ */
+typedef uint8_t ecma_property_t; /**< ecma_property_types_t (3 bit) and ecma_property_flags_t */
+
+/**
+ * Number of items in a property pair.
+ */
+#define ECMA_PROPERTY_PAIR_ITEM_COUNT 2
+
+/**
+ * Property header for all items in a property list.
+ */
+typedef struct
+{
+#ifdef JERRY_CPOINTER_32_BIT
+  jmem_cpointer_t next_property_cp; /**< next cpointer */
+#endif /* JERRY_CPOINTER_32_BIT */
+  ecma_property_t types[ECMA_PROPERTY_PAIR_ITEM_COUNT]; /**< two property type slot. The first represent
+                                                         *   the type of this property (e.g. property pair) */
+#ifdef JERRY_CPOINTER_32_BIT
+  uint16_t padding; /**< an unused value */
+#else /* !JERRY_CPOINTER_32_BIT */
+  jmem_cpointer_t next_property_cp; /**< next cpointer */
+#endif /* JERRY_CPOINTER_32_BIT */
+} ecma_property_header_t;
+
+/**
+ * Pair of pointers - to property's getter and setter
+ */
+typedef struct
+{
+  jmem_cpointer_t getter_p; /**< pointer to getter object */
+  jmem_cpointer_t setter_p; /**< pointer to setter object */
+} ecma_getter_setter_pointers_t;
+
+/**
+ * Property data.
+ */
+typedef union
+{
+  ecma_value_t value; /**< value of a property */
+#ifdef JERRY_CPOINTER_32_BIT
+  jmem_cpointer_t getter_setter_pair_cp; /**< cpointer to getter setter pair */
+#else /* !JERRY_CPOINTER_32_BIT */
+  ecma_getter_setter_pointers_t getter_setter_pair; /**< getter setter pair */
+#endif /* JERRY_CPOINTER_32_BIT */
+} ecma_property_value_t;
+
+/**
+ * Property pair.
+ */
+typedef struct
+{
+  ecma_property_header_t header; /**< header of the property */
+  ecma_property_value_t values[ECMA_PROPERTY_PAIR_ITEM_COUNT]; /**< property value slots */
+  jmem_cpointer_t names_cp[ECMA_PROPERTY_PAIR_ITEM_COUNT]; /**< property name slots */
+} ecma_property_pair_t;
+
+/**
+ * Get property type.
+ */
+#define ECMA_PROPERTY_GET_TYPE(property) \
+  ((ecma_property_types_t) ((property) & ECMA_PROPERTY_TYPE_MASK))
+
+/**
+ * Get property name type.
+ */
+#define ECMA_PROPERTY_GET_NAME_TYPE(property) \
+  ((property) >> ECMA_PROPERTY_NAME_TYPE_SHIFT)
+
+/**
+ * Returns true if the property pointer is a property pair.
+ */
+#define ECMA_PROPERTY_IS_PROPERTY_PAIR(property_header_p) \
+  (ECMA_PROPERTY_GET_TYPE ((property_header_p)->types[0]) != ECMA_PROPERTY_TYPE_VIRTUAL \
+   && (property_header_p)->types[0] != ECMA_PROPERTY_TYPE_HASHMAP)
+
+/**
+ * Returns true if the property is named property.
+ */
+#define ECMA_PROPERTY_IS_NAMED_PROPERTY(property) \
+  (ECMA_PROPERTY_GET_TYPE (property) != ECMA_PROPERTY_TYPE_SPECIAL)
+
+/**
+ * Returns the internal property type
+ */
+#define ECMA_PROPERTY_GET_SPECIAL_PROPERTY_TYPE(property_p) \
+  ((ecma_internal_property_id_t) (*(property_p) >> ECMA_PROPERTY_FLAG_SHIFT))
+
+/**
+ * Add the offset part to a property for computing its property data pointer.
+ */
+#define ECMA_PROPERTY_VALUE_ADD_OFFSET(property_p) \
+  ((uintptr_t) ((((uint8_t *) (property_p)) + (sizeof (ecma_property_value_t) * 2 - 1))))
+
+/**
+ * Align the property for computing its property data pointer.
+ */
+#define ECMA_PROPERTY_VALUE_DATA_PTR(property_p) \
+  (ECMA_PROPERTY_VALUE_ADD_OFFSET (property_p) & ~(sizeof (ecma_property_value_t) - 1))
+
+/**
+ * Compute the property data pointer of a property.
+ * The property must be part of a property pair.
+ */
+#define ECMA_PROPERTY_VALUE_PTR(property_p) \
+  ((ecma_property_value_t *) ECMA_PROPERTY_VALUE_DATA_PTR (property_p))
+
+/**
+ * Depth limit for property search (maximum prototype chain depth).
+ */
+#define ECMA_PROPERTY_SEARCH_DEPTH_LIMIT 128
+
+/**
+ * Property reference. It contains the value pointer
+ * for real, and the value itself for virtual properties.
+ */
+typedef union
+{
+  ecma_property_value_t *value_p; /**< property value pointer for real properties */
+  ecma_value_t virtual_value; /**< property value for virtual properties */
+} ecma_property_ref_t;
+
+/**
+ * Extended property reference, which also contains the
+ * property descriptor pointer for real properties.
+ */
+typedef struct
+{
+  ecma_property_ref_t property_ref; /**< property reference */
+  ecma_property_t *property_p; /**< property descriptor pointer for real properties */
+} ecma_extended_property_ref_t;
+
+/**
+ * Option flags for ecma_op_object_get_property.
+ */
+typedef enum
+{
+  ECMA_PROPERTY_GET_NO_OPTIONS = 0, /**< no option flags for ecma_op_object_get_property */
+  ECMA_PROPERTY_GET_VALUE = 1u << 0, /**< fill virtual_value field for virtual properties */
+  ECMA_PROPERTY_GET_EXT_REFERENCE = 1u << 1, /**< get extended reference to the property */
+} ecma_property_get_option_bits_t;
+
+/**
+ * Internal object types.
+ */
+typedef enum
+{
+  ECMA_OBJECT_TYPE_GENERAL = 0, /**< all objects that are not String (15.5),
+                                 *   Function (15.3), Arguments (10.6), Array (15.4) objects */
+  ECMA_OBJECT_TYPE_CLASS = 1, /**< Objects with class property */
+  ECMA_OBJECT_TYPE_FUNCTION = 2, /**< Function objects (15.3), created through 13.2 routine */
+  ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION = 3, /**< External (host) function object */
+  ECMA_OBJECT_TYPE_ARRAY = 4, /**< Array object (15.4) */
+  ECMA_OBJECT_TYPE_BOUND_FUNCTION = 5, /**< Function objects (15.3), created through 15.3.4.5 routine */
+  ECMA_OBJECT_TYPE_PSEUDO_ARRAY  = 6, /**< Array-like object, such as Arguments object (10.6) */
+
+  ECMA_OBJECT_TYPE__MAX = ECMA_OBJECT_TYPE_PSEUDO_ARRAY /**< maximum value */
+} ecma_object_type_t;
+
+/**
+ * Types of objects with class property.
+ */
+typedef enum
+{
+  ECMA_PSEUDO_ARRAY_ARGUMENTS = 0, /**< Arguments object (10.6) */
+  ECMA_PSEUDO_ARRAY_TYPEDARRAY = 1, /**< TypedArray which does NOT need extra space to store length and offset */
+  ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO = 2, /**< TypedArray which NEEDS extra space to store length and offset */
+
+  ECMA_PSEUDO_ARRAY__MAX = ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO /**< maximum value */
+} ecma_pseudo_array_type_t;
+
+/**
+ * Types of lexical environments.
+ */
+typedef enum
+{
+  /* ECMA_OBJECT_TYPE_GENERAL (0) with built-in flag. */
+  /* ECMA_OBJECT_TYPE_CLASS (1) with built-in flag. */
+  /* ECMA_OBJECT_TYPE_FUNCTION (2) with built-in flag. */
+  /* ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION (3) with built-in flag. */
+  /* ECMA_OBJECT_TYPE_ARRAY (4) with built-in flag. */
+  ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE = 5, /**< declarative lexical environment */
+  ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND = 6, /**< object-bound lexical environment */
+  ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND = 7, /**< object-bound lexical environment
+                                                   *   with provideThis flag */
+
+  ECMA_LEXICAL_ENVIRONMENT_TYPE_START = ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE, /**< first lexical
+                                                                               *    environment type */
+  ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND /**< maximum value */
+} ecma_lexical_environment_type_t;
+
+/**
+ * Ecma object type mask for getting the object type.
+ */
+#define ECMA_OBJECT_TYPE_MASK 0x07u
+
+/**
+ * Ecma object is built-in or lexical environment.
+ *   - built-in, if object type is less than ECMA_LEXICAL_ENVIRONMENT_TYPES_START
+ *   - lexical environment, if object type is greater or equal than ECMA_LEXICAL_ENVIRONMENT_TYPES_START
+ */
+#define ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV 0x08
+
+/**
+ * This object is visited by the garbage collector.
+ */
+#define ECMA_OBJECT_FLAG_GC_VISITED 0x10
+
+/**
+ * Extensible object.
+ */
+#define ECMA_OBJECT_FLAG_EXTENSIBLE 0x20
+
+/**
+ * Value for increasing or decreasing the object reference counter.
+ */
+#define ECMA_OBJECT_REF_ONE (1u << 6)
+
+/**
+ * Maximum value of the object reference counter (1023).
+ */
+#define ECMA_OBJECT_MAX_REF (0x3ffu << 6)
+
+/**
+ * Description of ECMA-object or lexical environment
+ * (depending on is_lexical_environment).
+ */
+typedef struct
+{
+  /** type : 3 bit : ecma_object_type_t or ecma_lexical_environment_type_t
+                     depending on ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV
+      flags : 3 bit : ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV,
+                      ECMA_OBJECT_FLAG_GC_VISITED,
+                      ECMA_OBJECT_FLAG_EXTENSIBLE
+      refs : 10 bit (max 1023) */
+  uint16_t type_flags_refs;
+
+  /** next in the object chain maintained by the garbage collector */
+  jmem_cpointer_t gc_next_cp;
+
+  /** compressed pointer to property list or bound object */
+  jmem_cpointer_t property_list_or_bound_object_cp;
+
+  /** object prototype or outer reference */
+  jmem_cpointer_t prototype_or_outer_reference_cp;
+} ecma_object_t;
+
+/**
+ * Description of built-in properties of an object.
+ */
+typedef struct
+{
+  uint8_t id; /**< built-in id */
+  uint8_t length_and_bitset_size; /**< length for built-in functions and
+                                   *   bit set size for all built-ins */
+  uint16_t routine_id; /**< routine id for built-in functions */
+  uint32_t instantiated_bitset[1]; /**< bit set for instantiated properties */
+} ecma_built_in_props_t;
+
+/**
+ * Start position of bit set size in length_and_bitset_size field.
+ */
+#define ECMA_BUILT_IN_BITSET_SHIFT 5
+
+/**
+ * Description of extended ECMA-object.
+ *
+ * The extended object is an object with extra fields.
+ */
+typedef struct
+{
+  ecma_object_t object; /**< object header */
+
+  /*
+   * Description of extra fields. These extra fields depends on the object type.
+   */
+  union
+  {
+    ecma_built_in_props_t built_in; /**< built-in object part */
+
+    /*
+     * Description of objects with class.
+     */
+    struct
+    {
+      uint16_t class_id; /**< class id of the object */
+
+      /*
+       * Description of extra fields. These extra fields depends on the class_id.
+       */
+      union
+      {
+        ecma_value_t value; /**< value of the object (e.g. boolean, number, string, etc.) */
+        uint32_t length; /**< length related property  (e.g. length of ArrayBuffer) */
+      } u;
+    } class_prop;
+
+    /*
+     * Description of function objects.
+     */
+    struct
+    {
+      ecma_value_t scope_cp; /**< function scope */
+      ecma_value_t bytecode_cp; /**< function byte code */
+    } function;
+
+    /*
+     * Description of array objects.
+     */
+    struct
+    {
+      uint32_t length; /**< length property value */
+      ecma_property_t length_prop; /**< length property */
+    } array;
+
+    /*
+     * Description of pseudo array objects.
+     */
+    struct
+    {
+      uint8_t type; /**< pseudo array type, e.g. Arguments, TypedArray*/
+      uint8_t extra_info; /**< extra infomations about the object.
+                            *  e.g. element_width_shift for typed arrays */
+      union
+      {
+        uint16_t length; /**< for arguments: length of names */
+        uint16_t class_id; /**< for typedarray: the specific class name */
+      } u1;
+      union
+      {
+        ecma_value_t lex_env_cp; /**< for arguments: lexical environment */
+        ecma_value_t arraybuffer; /**< for typedarray: internal arraybuffer */
+      } u2;
+    } pseudo_array;
+
+    /*
+     * Description of bound function object.
+     */
+    struct
+    {
+      ecma_value_t target_function; /**< target function */
+      ecma_length_t args_length; /**< length of arguments */
+    } bound_function;
+
+    ecma_external_handler_t external_handler_cb; /**< external function */
+  } u;
+} ecma_extended_object_t;
+
+/**
+ * Description of built-in extended ECMA-object.
+ */
+typedef struct
+{
+  ecma_extended_object_t extended_object; /**< extended object part */
+  ecma_built_in_props_t built_in; /**< built-in object part */
+} ecma_extended_built_in_object_t;
+
+/**
+ * Description of ECMA property descriptor
+ *
+ * See also: ECMA-262 v5, 8.10.
+ *
+ * Note:
+ *      If a component of descriptor is undefined then corresponding
+ *      field should contain it's default value.
+ */
+typedef struct
+{
+  /** Is [[Value]] defined? */
+  unsigned int is_value_defined : 1;
+
+  /** Is [[Get]] defined? */
+  unsigned int is_get_defined : 1;
+
+  /** Is [[Set]] defined? */
+  unsigned int is_set_defined : 1;
+
+  /** Is [[Writable]] defined? */
+  unsigned int is_writable_defined : 1;
+
+  /** [[Writable]] */
+  unsigned int is_writable : 1;
+
+  /** Is [[Enumerable]] defined? */
+  unsigned int is_enumerable_defined : 1;
+
+  /** [[Enumerable]] */
+  unsigned int is_enumerable : 1;
+
+  /** Is [[Configurable]] defined? */
+  unsigned int is_configurable_defined : 1;
+
+  /** [[Configurable]] */
+  unsigned int is_configurable : 1;
+
+  /** [[Value]] */
+  ecma_value_t value;
+
+  /** [[Get]] */
+  ecma_object_t *get_p;
+
+  /** [[Set]] */
+  ecma_object_t *set_p;
+} ecma_property_descriptor_t;
+
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
+/**
+ * Description of an ecma-number
+ */
+typedef float ecma_number_t;
+#define DOUBLE_TO_ECMA_NUMBER_T(value) (ecma_number_t) (value)
+
+/**
+ * Maximum number of significant digits that ecma-number can store
+ */
+#define ECMA_NUMBER_MAX_DIGITS  (9)
+
+/**
+ * Width of sign field
+ *
+ * See also:
+ *          IEEE-754 2008, 3.6, Table 3.5
+ */
+#define ECMA_NUMBER_SIGN_WIDTH       (1)
+
+/**
+ * Width of biased exponent field
+ *
+ * See also:
+ *          IEEE-754 2008, 3.6, Table 3.5
+ */
+#define ECMA_NUMBER_BIASED_EXP_WIDTH (8)
+
+/**
+ * Width of fraction field
+ *
+ * See also:
+ *          IEEE-754 2008, 3.6, Table 3.5
+ */
+#define ECMA_NUMBER_FRACTION_WIDTH   (23)
+#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+/**
+ * Description of an ecma-number
+ */
+typedef double ecma_number_t;
+#define DOUBLE_TO_ECMA_NUMBER_T(value) value
+
+/**
+ * Maximum number of significant digits that ecma-number can store
+ */
+#define ECMA_NUMBER_MAX_DIGITS  (19)
+
+/**
+ * Width of sign field
+ *
+ * See also:
+ *          IEEE-754 2008, 3.6, Table 3.5
+ */
+#define ECMA_NUMBER_SIGN_WIDTH       (1)
+
+/**
+ * Width of biased exponent field
+ *
+ * See also:
+ *          IEEE-754 2008, 3.6, Table 3.5
+ */
+#define ECMA_NUMBER_BIASED_EXP_WIDTH (11)
+
+/**
+ * Width of fraction field
+ *
+ * See also:
+ *          IEEE-754 2008, 3.6, Table 3.5
+ */
+#define ECMA_NUMBER_FRACTION_WIDTH   (52)
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
+
+/**
+ * Value '0' of ecma_number_t
+ */
+#define ECMA_NUMBER_ZERO ((ecma_number_t) 0)
+
+/**
+ * Value '1' of ecma_number_t
+ */
+#define ECMA_NUMBER_ONE  ((ecma_number_t) 1)
+
+/**
+ * Value '2' of ecma_number_t
+ */
+#define ECMA_NUMBER_TWO  ((ecma_number_t) 2)
+
+/**
+ * Value '0.5' of ecma_number_t
+ */
+#define ECMA_NUMBER_HALF ((ecma_number_t) 0.5f)
+
+/**
+ * Value '-1' of ecma_number_t
+ */
+#define ECMA_NUMBER_MINUS_ONE ((ecma_number_t) -1)
+
+/**
+ * Minimum positive and maximum value of ecma-number
+ */
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
+# define ECMA_NUMBER_MIN_VALUE (FLT_MIN)
+# define ECMA_NUMBER_MAX_VALUE (FLT_MAX)
+#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+/**
+ * Number.MAX_VALUE
+ *
+ * See also: ECMA_262 v5, 15.7.3.2
+ */
+# define ECMA_NUMBER_MAX_VALUE ((ecma_number_t) 1.7976931348623157e+308)
+/**
+ * Number.MIN_VALUE
+ *
+ * See also: ECMA_262 v5, 15.7.3.3
+ */
+# define ECMA_NUMBER_MIN_VALUE ((ecma_number_t) 5e-324)
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
+
+/**
+ * Euler number
+ */
+#define ECMA_NUMBER_E  ((ecma_number_t) 2.7182818284590452354)
+
+/**
+ * Natural logarithm of 10
+ */
+#define ECMA_NUMBER_LN10 ((ecma_number_t) 2.302585092994046)
+
+/**
+ * Natural logarithm of 2
+ */
+#define ECMA_NUMBER_LN2 ((ecma_number_t) 0.6931471805599453)
+
+/**
+ * Logarithm base 2 of the Euler number
+ */
+#define ECMA_NUMBER_LOG2E ((ecma_number_t) 1.4426950408889634)
+
+/**
+ * Logarithm base 10 of the Euler number
+ */
+#define ECMA_NUMBER_LOG10E ((ecma_number_t) 0.4342944819032518)
+
+/**
+ * Pi number
+ */
+#define ECMA_NUMBER_PI  ((ecma_number_t) 3.1415926535897932)
+
+/**
+ * Square root of 0.5
+ */
+#define ECMA_NUMBER_SQRT_1_2  ((ecma_number_t) 0.7071067811865476)
+
+/**
+ * Square root of 2
+ */
+#define ECMA_NUMBER_SQRT2  ((ecma_number_t) 1.4142135623730951)
+
+/**
+ * Maximum number of characters in string representation of ecma-number
+ */
+#define ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER 64
+
+/**
+ * Maximum number of characters in string representation of ecma-uint32
+ */
+#define ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32 10
+
+/**
+ * String is not a valid array index.
+ */
+#define ECMA_STRING_NOT_ARRAY_INDEX UINT32_MAX
+
+/**
+ * Description of a collection's header.
+ */
+typedef struct
+{
+  /** Number of elements in the collection */
+  ecma_length_t unit_number;
+
+  /** Compressed pointer to first chunk with collection's data */
+  jmem_cpointer_t first_chunk_cp;
+
+  /** Compressed pointer to last chunk with collection's data */
+  jmem_cpointer_t last_chunk_cp;
+} ecma_collection_header_t;
+
+/**
+ * Description of non-first chunk in a collection's chain of chunks
+ */
+typedef struct
+{
+  /** Characters */
+  lit_utf8_byte_t data[ sizeof (uint64_t) - sizeof (jmem_cpointer_t) ];
+
+  /** Compressed pointer to next chunk */
+  jmem_cpointer_t next_chunk_cp;
+} ecma_collection_chunk_t;
+
+/**
+ * Identifier for ecma-string's actual data container
+ */
+typedef enum
+{
+  ECMA_STRING_CONTAINER_UINT32_IN_DESC, /**< actual data is UInt32-represeneted Number
+                                             stored locally in the string's descriptor */
+  ECMA_STRING_CONTAINER_MAGIC_STRING, /**< the ecma-string is equal to one of ECMA magic strings */
+  ECMA_STRING_CONTAINER_MAGIC_STRING_EX, /**< the ecma-string is equal to one of external magic strings */
+  ECMA_STRING_CONTAINER_HEAP_UTF8_STRING, /**< actual data is on the heap as an utf-8 (cesu8) string
+                                           *   maximum size is 2^16. */
+  ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING, /**< actual data is on the heap as an utf-8 (cesu8) string
+                                                *   maximum size is 2^32. */
+
+  ECMA_STRING_LITERAL_NUMBER, /**< a literal number which is used solely by the literal storage
+                               *   so no string processing function supports this type except
+                               *   the ecma_deref_ecma_string function. */
+
+  ECMA_STRING_CONTAINER__MAX = ECMA_STRING_LITERAL_NUMBER /**< maximum value */
+} ecma_string_container_t;
+
+/**
+ * Mask for getting the container of a string.
+ */
+#define ECMA_STRING_CONTAINER_MASK 0x7u
+
+/**
+ * Value for increasing or decreasing the reference counter.
+ */
+#define ECMA_STRING_REF_ONE (1u << 3)
+
+/**
+ * Maximum value of the reference counter (8191).
+ */
+#define ECMA_STRING_MAX_REF (0x1fffu << 3)
+
+/**
+ * Set reference counter to zero (for refs_and_container member below).
+ */
+#define ECMA_STRING_SET_REF_TO_ONE(refs_and_container) \
+  ((uint16_t) (((refs_and_container) & ECMA_STRING_CONTAINER_MASK) | ECMA_STRING_REF_ONE))
+
+/**
+ * Returns with the container type of a string.
+ */
+#define ECMA_STRING_GET_CONTAINER(string_desc_p) \
+  ((ecma_string_container_t) ((string_desc_p)->refs_and_container & ECMA_STRING_CONTAINER_MASK))
+
+/**
+ * Checks whether the reference counter is 1.
+ */
+#define ECMA_STRING_IS_REF_EQUALS_TO_ONE(string_desc_p) \
+  (((string_desc_p)->refs_and_container >> 3) == 1)
+
+/**
+ * ECMA string-value descriptor
+ */
+typedef struct
+{
+  /** Reference counter for the string */
+  uint16_t refs_and_container;
+
+  /** Hash of the string (calculated from two last characters of the string) */
+  lit_string_hash_t hash;
+
+  /**
+   * Actual data or identifier of it's place in container (depending on 'container' field)
+   */
+  union
+  {
+    /**
+     * Actual data of an utf-8 string type
+     */
+    struct
+    {
+      uint16_t size; /**< size of this utf-8 string in bytes */
+      uint16_t length; /**< length of this utf-8 string in characters */
+    } utf8_string;
+
+    lit_utf8_size_t long_utf8_string_size; /**< size of this long utf-8 string in bytes */
+    uint32_t uint32_number; /**< uint32-represented number placed locally in the descriptor */
+    uint32_t magic_string_id; /**< identifier of a magic string (lit_magic_string_id_t) */
+    uint32_t magic_string_ex_id; /**< identifier of an external magic string (lit_magic_string_ex_id_t) */
+    ecma_value_t lit_number; /**< literal number (note: not a regular string type) */
+    uint32_t common_uint32_field; /**< for zeroing and comparison in some cases */
+  } u;
+} ecma_string_t;
+
+/**
+ * Long ECMA string-value descriptor
+ */
+typedef struct
+{
+  ecma_string_t header; /**< string header */
+  lit_utf8_size_t long_utf8_string_length; /**< length of this long utf-8 string in bytes */
+} ecma_long_string_t;
+
+/**
+ * Compiled byte code data.
+ */
+typedef struct
+{
+  uint16_t size;                    /**< real size >> JMEM_ALIGNMENT_LOG */
+  uint16_t refs;                    /**< reference counter for the byte code */
+  uint16_t status_flags;            /**< various status flags:
+                                      *    CBC_CODE_FLAGS_FUNCTION flag tells whether
+                                      *    the byte code is function or regular expression.
+                                      *    If function, the other flags must be CBC_CODE_FLAGS...
+                                      *    If regexp, the other flags must be RE_FLAG... */
+} ecma_compiled_code_t;
+
+/**
+ * An object's GC color
+ *
+ * Tri-color marking:
+ *   WHITE_GRAY, unvisited -> WHITE: not referenced by a live object or the reference not found yet
+ *   WHITE_GRAY, visited   -> GRAY: referenced by some live object
+ *   BLACK                 -> BLACK: all referenced objects are gray or black
+ */
+typedef enum
+{
+  ECMA_GC_COLOR_WHITE_GRAY, /**< white or gray */
+  ECMA_GC_COLOR_BLACK, /**< black */
+  ECMA_GC_COLOR__COUNT /**< number of colors */
+} ecma_gc_color_t;
+
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+
+/**
+ * The lowest state of the ecma_prop_hashmap_alloc_state counter.
+ * If ecma_prop_hashmap_alloc_state other other than this value, it is
+ * disabled.
+ */
+#define ECMA_PROP_HASHMAP_ALLOC_ON 0
+
+/**
+ * The highest state of the ecma_prop_hashmap_alloc_state counter.
+ */
+#define ECMA_PROP_HASHMAP_ALLOC_MAX 4
+
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+
+/**
+ * Number of values in a literal storage item
+ */
+#define ECMA_LIT_STORAGE_VALUE_COUNT 3
+
+/**
+ * Literal storage item
+ */
+typedef struct
+{
+  jmem_cpointer_t next_cp; /**< cpointer ot next item */
+  jmem_cpointer_t values[ECMA_LIT_STORAGE_VALUE_COUNT]; /**< list of values */
+} ecma_lit_storage_item_t;
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+
+/**
+ * Entry of LCache hash table
+ */
+typedef struct
+{
+  /** Pointer to a property of the object */
+  ecma_property_t *prop_p;
+
+  /** Compressed pointer to object (ECMA_NULL_POINTER marks record empty) */
+  jmem_cpointer_t object_cp;
+
+  /** Compressed pointer to property's name */
+  jmem_cpointer_t prop_name_cp;
+} ecma_lcache_hash_entry_t;
+
+/**
+ * Number of rows in LCache's hash table
+ */
+#define ECMA_LCACHE_HASH_ROWS_COUNT 128
+
+/**
+ * Number of entries in a row of LCache's hash table
+ */
+#define ECMA_LCACHE_HASH_ROW_LENGTH 2
+
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/**
+ * Some internal properties of TypedArray object.
+ * It is only used when the offset is not 0, and
+ * the array-length is not buffer-length / element_size.
+ */
+typedef struct
+{
+  ecma_extended_object_t extended_object; /**< extended object part */
+  ecma_length_t byte_offset; /**< the byteoffset of the above arraybuffer */
+  ecma_length_t array_length; /**< the array length */
+} ecma_extended_typedarray_object_t;
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+/**
+ * @}
+ * @}
+ */
+
+#endif  /* !ECMA_GLOBALS_H */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-helpers-conversion.c b/deps/jerry/jerry-core/ecma/base/ecma-helpers-conversion.c
new file mode 100644 (file)
index 0000000..234528d
--- /dev/null
@@ -0,0 +1,1065 @@
+/* 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.
+ */
+
+#include <math.h>
+
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "jrt-libc-includes.h"
+#include "lit-char-helpers.h"
+#include "lit-magic-strings.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmahelpers Helpers for operations with ECMA data types
+ * @{
+ *
+ * \addtogroup ecmahelpersbigintegers Helpers for operations intermediate 128-bit integers
+ * @{
+ */
+
+/**
+ * Check that parts of 128-bit integer are 32-bit.
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT(name) \
+{ \
+  JERRY_ASSERT (name[0] <= UINT32_MAX); \
+  JERRY_ASSERT (name[1] <= UINT32_MAX); \
+  JERRY_ASSERT (name[2] <= UINT32_MAX); \
+  JERRY_ASSERT (name[3] <= UINT32_MAX); \
+}
+
+/**
+ * Declare 128-bit integer.
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER(name) uint64_t name[4] = { 0, 0, 0, 0 }
+
+/**
+ * Declare 128-bit in-out argument integer.
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_ARG(name) uint64_t name[4]
+
+/**
+ * Initialize 128-bit integer with given 32-bit parts
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_INIT(name, high, mid_high, mid_low, low) \
+{ \
+  name[3] = high; \
+  name[2] = mid_high; \
+  name[1] = mid_low; \
+  name[0] = low; \
+ \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+}
+
+/**
+ * Copy specified 128-bit integer
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_COPY(name_copy_to, name_copy_from) \
+{ \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_copy_to); \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_copy_from); \
+  \
+  name_copy_to[0] = name_copy_from[0]; \
+  name_copy_to[1] = name_copy_from[1]; \
+  name_copy_to[2] = name_copy_from[2]; \
+  name_copy_to[3] = name_copy_from[3]; \
+}
+
+/**
+ * Copy high and middle parts of 128-bit integer to specified uint64_t variable
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_ROUND_HIGH_AND_MIDDLE_TO_UINT64(name, uint64_var) \
+{ \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+  uint64_var = ((name[3] << 32u) | (name[2])) + (((name[1] >> 31u) != 0 ? 1 : 0)); \
+}
+
+/**
+ * Copy middle and low parts of 128-bit integer to specified uint64_t variable
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_ROUND_MIDDLE_AND_LOW_TO_UINT64(name, uint64_var) \
+{ \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+  uint64_var = (name[1] << 32u) | (name[0]); \
+}
+
+/**
+ * Check if specified 128-bit integers are equal
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_ARE_EQUAL(name1, name2) \
+  ((name1)[0] == (name2[0]) \
+   && (name1)[1] == (name2[1]) \
+   && (name1)[2] == (name2[2]) \
+   && (name1)[3] == (name2[3]))
+
+/**
+ * Check if bits [lowest_bit, 128) are zero
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO(name, lowest_bit) \
+  ((lowest_bit) >= 96 ? ((name[3] >> ((lowest_bit) - 96)) == 0) : \
+   ((lowest_bit) >= 64 ? (name[3] == 0 \
+                          && ((name[2] >> ((lowest_bit) - 64)) == 0)) : \
+   ((lowest_bit) >= 32 ? (name[3] == 0 \
+                          && name[2] == 0 && ((name[1] >> ((lowest_bit) - 32)) == 0)) : \
+   (name[3] == 0 && name[2] == 0 && name[1] == 0 && ((name[0] >> (lowest_bit)) == 0)))))
+
+/**
+ * Check if bits [0, highest_bit] are zero
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_LOW_BIT_MASK_ZERO(name, highest_bit) \
+  ((highest_bit >= 96) ? (name[2] == 0 && name[1] == 0 && name[0] == 0 \
+                          && (((uint32_t) name[3] << (127 - (highest_bit))) == 0)) : \
+   ((highest_bit >= 64) ? (name[1] == 0 && name[0] == 0 \
+                           && (((uint32_t) name[2] << (95 - (highest_bit))) == 0)) : \
+   ((highest_bit >= 32) ? (name[0] == 0 \
+                           && (((uint32_t) name[1] << (63 - (highest_bit))) == 0)) : \
+    (((uint32_t) name[0] << (31 - (highest_bit))) == 0))))
+
+/**
+ * Check if 128-bit integer is zero
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_ZERO(name) \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (name, 0)
+
+/**
+ * Shift 128-bit integer one bit left
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_LEFT_SHIFT(name) \
+{ \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+  \
+  name[3] = (uint32_t) (name[3] << 1u); \
+  name[3] |= name[2] >> 31u; \
+  name[2] = (uint32_t) (name[2] << 1u); \
+  name[2] |= name[1] >> 31u; \
+  name[1] = (uint32_t) (name[1] << 1u); \
+  name[1] |= name[0] >> 31u; \
+  name[0] = (uint32_t) (name[0] << 1u); \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+}
+
+/**
+ * Shift 128-bit integer one bit right
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_RIGHT_SHIFT(name) \
+{ \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+  \
+  name[0] >>= 1u; \
+  name[0] |= (uint32_t) (name[1] << 31u); \
+  name[1] >>= 1u; \
+  name[1] |= (uint32_t) (name[2] << 31u); \
+  name[2] >>= 1u; \
+  name[2] |= (uint32_t) (name[3] << 31u); \
+  name[3] >>= 1u; \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+}
+
+/**
+ * Increment 128-bit integer
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_INC(name) \
+{ \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+  \
+  name[0] += 1ull; \
+  name[1] += (name[0] >> 32u); \
+  name[0] = (uint32_t) name[0]; \
+  name[2] += (name[1] >> 32u); \
+  name[1] = (uint32_t) name[1]; \
+  name[3] += (name[2] >> 32u); \
+  name[2] = (uint32_t) name[2]; \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+}
+
+/**
+ * Add 128-bit integer
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_ADD(name_add_to, name_to_add) \
+{ \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_add_to); \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_to_add); \
+  \
+  name_add_to[0] += name_to_add[0]; \
+  name_add_to[1] += name_to_add[1]; \
+  name_add_to[2] += name_to_add[2]; \
+  name_add_to[3] += name_to_add[3]; \
+  \
+  name_add_to[1] += (name_add_to[0] >> 32u); \
+  name_add_to[0] = (uint32_t) name_add_to[0]; \
+  name_add_to[2] += (name_add_to[1] >> 32u); \
+  name_add_to[1] = (uint32_t) name_add_to[1]; \
+  name_add_to[3] += (name_add_to[2] >> 32u); \
+  name_add_to[2] = (uint32_t) name_add_to[2]; \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_add_to); \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_to_add); \
+}
+
+/**
+ * Multiply 128-bit integer by 10
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_MUL_10(name) \
+{ \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_LEFT_SHIFT (name); \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER (name ## _tmp); \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_COPY (name ## _tmp, name); \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_LEFT_SHIFT (name ## _tmp); \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_LEFT_SHIFT (name ## _tmp); \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_ADD (name, name ## _tmp); \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+}
+
+/**
+ * Divide 128-bit integer by 10
+ */
+#define ECMA_NUMBER_CONVERSION_128BIT_INTEGER_DIV_10(name) \
+{ \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+  \
+  /* estimation of reciprocal of 10 */ \
+  const uint64_t div10_p_low = 0x9999999aul; \
+  const uint64_t div10_p_mid = 0x99999999ul; \
+  const uint64_t div10_p_high = 0x19999999ul; \
+  \
+  uint64_t intermediate[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; \
+  uint64_t l0, l1, l2, l3, m0, m1, m2, m3, h0, h1, h2, h3; \
+  l0 = name[0] * div10_p_low; \
+  l1 = name[1] * div10_p_low; \
+  l2 = name[2] * div10_p_low; \
+  l3 = name[3] * div10_p_low; \
+  m0 = name[0] * div10_p_mid; \
+  m1 = name[1] * div10_p_mid; \
+  m2 = name[2] * div10_p_mid; \
+  m3 = name[3] * div10_p_mid; \
+  h0 = name[0] * div10_p_high; \
+  h1 = name[1] * div10_p_high; \
+  h2 = name[2] * div10_p_high; \
+  h3 = name[3] * div10_p_high; \
+  intermediate[0] += (uint32_t) l0; \
+  intermediate[1] += l0 >> 32u; \
+  \
+  intermediate[1] += (uint32_t) l1; \
+  intermediate[2] += l1 >> 32u; \
+  intermediate[1] += (uint32_t) m0; \
+  intermediate[2] += m0 >> 32u; \
+  \
+  intermediate[2] += (uint32_t) l2; \
+  intermediate[3] += l2 >> 32u; \
+  intermediate[2] += (uint32_t) m1; \
+  intermediate[3] += m1 >> 32u; \
+  intermediate[2] += (uint32_t) m0; \
+  intermediate[3] += m0 >> 32u; \
+  \
+  intermediate[3] += (uint32_t) l3; \
+  intermediate[4] += l3 >> 32u; \
+  intermediate[3] += (uint32_t) m2; \
+  intermediate[4] += m2 >> 32u; \
+  intermediate[3] += (uint32_t) m1; \
+  intermediate[4] += m1 >> 32u; \
+  intermediate[3] += (uint32_t) h0; \
+  intermediate[4] += h0 >> 32u; \
+  \
+  intermediate[4] += (uint32_t) m3; \
+  intermediate[5] += m3 >> 32u; \
+  intermediate[4] += (uint32_t) m2; \
+  intermediate[5] += m2 >> 32u; \
+  intermediate[4] += (uint32_t) h1; \
+  intermediate[5] += h1 >> 32u; \
+  \
+  intermediate[5] += (uint32_t) m3; \
+  intermediate[6] += m3 >> 32u; \
+  intermediate[5] += (uint32_t) h2; \
+  intermediate[6] += h2 >> 32u; \
+  \
+  intermediate[6] += (uint32_t) h3; \
+  intermediate[7] += h3 >> 32u; \
+  \
+  intermediate[1] += intermediate[0] >> 32u; \
+  intermediate[0] = (uint32_t) intermediate[0]; \
+  intermediate[2] += intermediate[1] >> 32u; \
+  intermediate[1] = (uint32_t) intermediate[1]; \
+  intermediate[3] += intermediate[2] >> 32u; \
+  intermediate[2] = (uint32_t) intermediate[2]; \
+  intermediate[4] += intermediate[3] >> 32u; \
+  intermediate[3] = (uint32_t) intermediate[3]; \
+  intermediate[5] += intermediate[4] >> 32u; \
+  intermediate[4] = (uint32_t) intermediate[4]; \
+  intermediate[6] += intermediate[5] >> 32u; \
+  intermediate[5] = (uint32_t) intermediate[5]; \
+  intermediate[7] += intermediate[6] >> 32u; \
+  intermediate[6] = (uint32_t) intermediate[6]; \
+  \
+  name[0] = intermediate[4]; \
+  name[1] = intermediate[5]; \
+  name[2] = intermediate[6]; \
+  name[3] = intermediate[7]; \
+  \
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
+}
+
+/**
+ * @}
+ */
+
+/**
+ * ECMA-defined conversion of string to Number.
+ *
+ * See also:
+ *          ECMA-262 v5, 9.3.1
+ *
+ * @return ecma-number
+ */
+ecma_number_t
+ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
+                            lit_utf8_size_t str_size) /**< string size */
+{
+  /* TODO: Check license issues */
+
+  if (str_size == 0)
+  {
+    return ECMA_NUMBER_ZERO;
+  }
+
+  const lit_utf8_byte_t *str_curr_p = str_p;
+  const lit_utf8_byte_t *str_end_p = str_p + str_size;
+  ecma_char_t code_unit;
+
+  while (str_curr_p < str_end_p)
+  {
+    code_unit = lit_utf8_peek_next (str_curr_p);
+    if (lit_char_is_white_space (code_unit) || lit_char_is_line_terminator (code_unit))
+    {
+      lit_utf8_incr (&str_curr_p);
+    }
+    else
+    {
+      break;
+    }
+  }
+
+  const lit_utf8_byte_t *begin_p = str_curr_p;
+  str_curr_p = (lit_utf8_byte_t *) str_end_p;
+
+  while (str_curr_p > str_p)
+  {
+    code_unit = lit_utf8_peek_prev (str_curr_p);
+    if (lit_char_is_white_space (code_unit) || lit_char_is_line_terminator (code_unit))
+    {
+      lit_utf8_decr (&str_curr_p);
+    }
+    else
+    {
+      break;
+    }
+  }
+
+  const lit_utf8_byte_t *end_p = str_curr_p - 1;
+
+  if (begin_p > end_p)
+  {
+    return ECMA_NUMBER_ZERO;
+  }
+
+  if ((end_p >= begin_p + 2)
+      && begin_p[0] == LIT_CHAR_0
+      && (begin_p[1] == LIT_CHAR_LOWERCASE_X
+          || begin_p[1] == LIT_CHAR_UPPERCASE_X))
+  {
+    /* Hex literal handling */
+    begin_p += 2;
+
+    ecma_number_t num = ECMA_NUMBER_ZERO;
+
+    for (const lit_utf8_byte_t * iter_p = begin_p;
+         iter_p <= end_p;
+         iter_p++)
+    {
+      int32_t digit_value;
+
+      if (*iter_p >= LIT_CHAR_0
+          && *iter_p <= LIT_CHAR_9)
+      {
+        digit_value = (*iter_p - LIT_CHAR_0);
+      }
+      else if (*iter_p >= LIT_CHAR_LOWERCASE_A
+               && *iter_p <= LIT_CHAR_LOWERCASE_F)
+      {
+        digit_value = 10 + (*iter_p - LIT_CHAR_LOWERCASE_A);
+      }
+      else if (*iter_p >= LIT_CHAR_UPPERCASE_A
+               && *iter_p <= LIT_CHAR_UPPERCASE_F)
+      {
+        digit_value = 10 + (*iter_p - LIT_CHAR_UPPERCASE_A);
+      }
+      else
+      {
+        return ecma_number_make_nan ();
+      }
+
+      num = num * 16 + (ecma_number_t) digit_value;
+    }
+
+    return num;
+  }
+
+  bool sign = false; /* positive */
+
+  if (*begin_p == LIT_CHAR_PLUS)
+  {
+    begin_p++;
+  }
+  else if (*begin_p == LIT_CHAR_MINUS)
+  {
+    sign = true; /* negative */
+
+    begin_p++;
+  }
+
+  if (begin_p > end_p)
+  {
+    return ecma_number_make_nan ();
+  }
+
+  /* Checking if significant part of parse string is equal to "Infinity" */
+  const lit_utf8_byte_t *infinity_zt_str_p = lit_get_magic_string_utf8 (LIT_MAGIC_STRING_INFINITY_UL);
+
+  JERRY_ASSERT (strlen ((const char *) infinity_zt_str_p) == 8);
+
+  if ((end_p - begin_p) == (8 - 1) && memcmp (infinity_zt_str_p, begin_p, 8) == 0)
+  {
+    return ecma_number_make_infinity (sign);
+  }
+
+  uint64_t fraction_uint64 = 0;
+  uint32_t digits = 0;
+  int32_t e = 0;
+  bool digit_seen = false;
+
+  /* Parsing digits before dot (or before end of digits part if there is no dot in number) */
+  while (begin_p <= end_p)
+  {
+    int32_t digit_value;
+
+    if (*begin_p >= LIT_CHAR_0
+        && *begin_p <= LIT_CHAR_9)
+    {
+      digit_seen = true;
+      digit_value = (*begin_p - LIT_CHAR_0);
+    }
+    else
+    {
+      break;
+    }
+
+    if (digits != 0 || digit_value != 0)
+    {
+      if (digits < ECMA_NUMBER_MAX_DIGITS)
+      {
+        fraction_uint64 = fraction_uint64 * 10 + (uint32_t) digit_value;
+        digits++;
+      }
+      else if (e <= 100000) /* Limit the exponent, since large
+                             * exponent is rounded to infinity anyway. */
+      {
+        e++;
+      }
+    }
+
+    begin_p++;
+  }
+
+  if (begin_p <= end_p
+      && *begin_p == LIT_CHAR_DOT)
+  {
+    begin_p++;
+
+    if (!digit_seen && begin_p > end_p)
+    {
+      return ecma_number_make_nan ();
+    }
+
+    /* Parsing number's part that is placed after dot */
+    while (begin_p <= end_p)
+    {
+      int32_t digit_value;
+
+      if (*begin_p >= LIT_CHAR_0
+          && *begin_p <= LIT_CHAR_9)
+      {
+        digit_seen = true;
+        digit_value = (*begin_p - LIT_CHAR_0);
+      }
+      else
+      {
+        break;
+      }
+
+      if (digits < ECMA_NUMBER_MAX_DIGITS)
+      {
+        if (digits != 0 || digit_value != 0)
+        {
+          fraction_uint64 = fraction_uint64 * 10 + (uint32_t) digit_value;
+          digits++;
+        }
+
+        e--;
+      }
+
+      begin_p++;
+    }
+  }
+
+  /* Parsing exponent literal */
+  int32_t e_in_lit = 0;
+  bool e_in_lit_sign = false;
+
+  if (begin_p <= end_p
+      && (*begin_p == LIT_CHAR_LOWERCASE_E
+          || *begin_p == LIT_CHAR_UPPERCASE_E))
+  {
+    begin_p++;
+
+    if (!digit_seen || begin_p > end_p)
+    {
+      return ecma_number_make_nan ();
+    }
+
+    if (*begin_p == LIT_CHAR_PLUS)
+    {
+      begin_p++;
+    }
+    else if (*begin_p == LIT_CHAR_MINUS)
+    {
+      e_in_lit_sign = true;
+      begin_p++;
+    }
+
+    if (begin_p > end_p)
+    {
+      return ecma_number_make_nan ();
+    }
+
+    while (begin_p <= end_p)
+    {
+      int32_t digit_value;
+
+      if (*begin_p >= LIT_CHAR_0
+          && *begin_p <= LIT_CHAR_9)
+      {
+        digit_value = (*begin_p - LIT_CHAR_0);
+      }
+      else
+      {
+        return ecma_number_make_nan ();
+      }
+
+      e_in_lit = e_in_lit * 10 + digit_value;
+
+      begin_p++;
+    }
+  }
+
+  /* Adding value of exponent literal to exponent value */
+  if (e_in_lit_sign)
+  {
+    e -= e_in_lit;
+  }
+  else
+  {
+    e += e_in_lit;
+  }
+
+  bool e_sign;
+
+  if (e < 0)
+  {
+    e_sign = true;
+    e = -e;
+  }
+  else
+  {
+    e_sign = false;
+  }
+
+  if (begin_p <= end_p)
+  {
+    return ecma_number_make_nan ();
+  }
+
+  JERRY_ASSERT (begin_p == end_p + 1);
+
+  if (fraction_uint64 == 0)
+  {
+    return sign ? -ECMA_NUMBER_ZERO : ECMA_NUMBER_ZERO;
+  }
+
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+  int32_t binary_exponent = 33;
+
+  /*
+   * 128-bit mantissa storage
+   *
+   * Normalized: |4 bits zero|124-bit mantissa with highest bit set to 1 if mantissa is non-zero|
+   */
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER (fraction_uint128);
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_INIT (fraction_uint128,
+                                              0ull,
+                                              fraction_uint64 >> 32u,
+                                              (uint32_t) fraction_uint64,
+                                              0ull);
+
+  /* Normalizing mantissa */
+  JERRY_ASSERT (ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 124));
+
+  while (ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 123))
+  {
+    ECMA_NUMBER_CONVERSION_128BIT_INTEGER_LEFT_SHIFT (fraction_uint128);
+    binary_exponent--;
+
+    JERRY_ASSERT (!ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_ZERO (fraction_uint128));
+  }
+
+  if (!e_sign)
+  {
+    /* positive or zero decimal exponent */
+    JERRY_ASSERT (e >= 0);
+
+    while (e > 0)
+    {
+      JERRY_ASSERT (ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 124));
+
+      ECMA_NUMBER_CONVERSION_128BIT_INTEGER_MUL_10 (fraction_uint128);
+
+      e--;
+
+      /* Normalizing mantissa */
+      while (!ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 124))
+      {
+        ECMA_NUMBER_CONVERSION_128BIT_INTEGER_RIGHT_SHIFT (fraction_uint128);
+
+        binary_exponent++;
+      }
+      while (ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 123))
+      {
+        ECMA_NUMBER_CONVERSION_128BIT_INTEGER_LEFT_SHIFT (fraction_uint128);
+
+        binary_exponent--;
+
+        JERRY_ASSERT (!ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_ZERO (fraction_uint128));
+      }
+    }
+  }
+  else
+  {
+    /* negative decimal exponent */
+    JERRY_ASSERT (e != 0);
+
+    while (e > 0)
+    {
+      /* Denormalizing mantissa, moving highest 1 to 95-bit */
+      while (ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 127))
+      {
+        ECMA_NUMBER_CONVERSION_128BIT_INTEGER_LEFT_SHIFT (fraction_uint128);
+
+        binary_exponent--;
+
+        JERRY_ASSERT (!ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_ZERO (fraction_uint128));
+      }
+
+      ECMA_NUMBER_CONVERSION_128BIT_INTEGER_DIV_10 (fraction_uint128);
+
+      e--;
+    }
+
+    /* Normalizing mantissa */
+    while (!ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 124))
+    {
+      ECMA_NUMBER_CONVERSION_128BIT_INTEGER_RIGHT_SHIFT (fraction_uint128);
+
+      binary_exponent++;
+    }
+    while (ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 123))
+    {
+      ECMA_NUMBER_CONVERSION_128BIT_INTEGER_LEFT_SHIFT (fraction_uint128);
+
+      binary_exponent--;
+
+      JERRY_ASSERT (!ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_ZERO (fraction_uint128));
+    }
+  }
+
+  JERRY_ASSERT (!ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_ZERO (fraction_uint128));
+  JERRY_ASSERT (ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 124));
+
+  /*
+   * Preparing mantissa for conversion to 52-bit representation, converting it to:
+   *
+   * |12 zero bits|116 mantissa bits|
+   */
+  while (!ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 116 + 1))
+  {
+    ECMA_NUMBER_CONVERSION_128BIT_INTEGER_RIGHT_SHIFT (fraction_uint128);
+
+    binary_exponent++;
+  }
+  while (ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 116))
+  {
+    ECMA_NUMBER_CONVERSION_128BIT_INTEGER_LEFT_SHIFT (fraction_uint128);
+
+    binary_exponent--;
+
+    JERRY_ASSERT (!ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_ZERO (fraction_uint128));
+  }
+
+  JERRY_ASSERT (ECMA_NUMBER_CONVERSION_128BIT_INTEGER_IS_HIGH_BIT_MASK_ZERO (fraction_uint128, 116 + 1));
+
+  ECMA_NUMBER_CONVERSION_128BIT_INTEGER_ROUND_HIGH_AND_MIDDLE_TO_UINT64 (fraction_uint128, fraction_uint64);
+
+  return ecma_number_make_from_sign_mantissa_and_exponent (sign,
+                                                           fraction_uint64,
+                                                           binary_exponent);
+#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
+  /* Less precise conversion */
+  ecma_number_t num = (ecma_number_t) (uint32_t) fraction_uint64;
+
+  ecma_number_t m = e_sign ? (ecma_number_t) 0.1 : (ecma_number_t) 10.0;
+
+  while (e)
+  {
+    if (e % 2)
+    {
+      num *= m;
+    }
+
+    m *= m;
+    e /= 2;
+  }
+
+  return num;
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+} /* ecma_utf8_string_to_number */
+
+/**
+ * ECMA-defined conversion of UInt32 to String (zero-terminated).
+ *
+ * See also:
+ *          ECMA-262 v5, 9.8.1
+ *
+ * @return number of bytes copied to buffer
+ */
+lit_utf8_size_t
+ecma_uint32_to_utf8_string (uint32_t value, /**< value to convert */
+                            lit_utf8_byte_t *out_buffer_p, /**< buffer for string */
+                            lit_utf8_size_t buffer_size) /**< size of buffer */
+{
+  lit_utf8_byte_t *buf_p = out_buffer_p + buffer_size;
+
+  do
+  {
+    JERRY_ASSERT (buf_p >= out_buffer_p);
+
+    buf_p--;
+    *buf_p = (lit_utf8_byte_t) ((value % 10) + LIT_CHAR_0);
+    value /= 10;
+  }
+  while (value != 0);
+
+  JERRY_ASSERT (buf_p >= out_buffer_p);
+
+  lit_utf8_size_t bytes_copied = (lit_utf8_size_t) (out_buffer_p + buffer_size - buf_p);
+
+  if (likely (buf_p != out_buffer_p))
+  {
+    memmove (out_buffer_p, buf_p, bytes_copied);
+  }
+
+  return bytes_copied;
+} /* ecma_uint32_to_utf8_string */
+
+/**
+ * ECMA-defined conversion of Number value to UInt32 value
+ *
+ * See also:
+ *          ECMA-262 v5, 9.6
+ *
+ * @return 32-bit unsigned integer - result of conversion.
+ */
+uint32_t
+ecma_number_to_uint32 (ecma_number_t num) /**< ecma-number */
+{
+  if (ecma_number_is_nan (num)
+      || ecma_number_is_zero (num)
+      || ecma_number_is_infinity (num))
+  {
+    return 0;
+  }
+
+  const bool sign = ecma_number_is_negative (num);
+  const ecma_number_t abs_num = sign ? ecma_number_negate (num) : num;
+
+  /* 2 ^ 32 */
+  const uint64_t uint64_2_pow_32 = (1ull << 32);
+
+  const ecma_number_t num_2_pow_32 = (float) uint64_2_pow_32;
+
+  ecma_number_t num_in_uint32_range;
+
+  if (abs_num >= num_2_pow_32)
+  {
+    num_in_uint32_range = ecma_number_calc_remainder (abs_num,
+                                                      num_2_pow_32);
+  }
+  else
+  {
+    num_in_uint32_range = abs_num;
+  }
+
+  /* Check that the floating point value can be represented with uint32_t. */
+  JERRY_ASSERT (num_in_uint32_range < uint64_2_pow_32);
+  uint32_t uint32_num = (uint32_t) num_in_uint32_range;
+
+  const uint32_t ret = sign ? -uint32_num : uint32_num;
+
+#ifndef JERRY_NDEBUG
+  if (sign
+      && uint32_num != 0)
+  {
+    JERRY_ASSERT (ret == uint64_2_pow_32 - uint32_num);
+  }
+  else
+  {
+    JERRY_ASSERT (ret == uint32_num);
+  }
+#endif /* !JERRY_NDEBUG */
+
+  return ret;
+} /* ecma_number_to_uint32 */
+
+/**
+ * ECMA-defined conversion of Number value to Int32 value
+ *
+ * See also:
+ *          ECMA-262 v5, 9.5
+ *
+ * @return 32-bit signed integer - result of conversion.
+ */
+int32_t
+ecma_number_to_int32 (ecma_number_t num) /**< ecma-number */
+{
+  uint32_t uint32_num = ecma_number_to_uint32 (num);
+
+  /* 2 ^ 32 */
+  const int64_t int64_2_pow_32 = (1ll << 32);
+
+  /* 2 ^ 31 */
+  const uint32_t uint32_2_pow_31 = (1ull << 31);
+
+  int32_t ret;
+
+  if (uint32_num >= uint32_2_pow_31)
+  {
+    ret = (int32_t) (uint32_num - int64_2_pow_32);
+  }
+  else
+  {
+    ret = (int32_t) uint32_num;
+  }
+
+#ifndef JERRY_NDEBUG
+  int64_t int64_num = uint32_num;
+
+  JERRY_ASSERT (int64_num >= 0);
+
+  if (int64_num >= uint32_2_pow_31)
+  {
+    JERRY_ASSERT (ret == int64_num - int64_2_pow_32);
+  }
+  else
+  {
+    JERRY_ASSERT (ret == int64_num);
+  }
+#endif /* !JERRY_NDEBUG */
+
+  return ret;
+} /* ecma_number_to_int32 */
+
+/**
+  * Perform conversion of ecma-number to decimal representation with decimal exponent
+  *
+  * Note:
+  *      The calculated values correspond to s, n, k parameters in ECMA-262 v5, 9.8.1, item 5:
+  *         - parameter out_digits_p corresponds to s, the digits of the number;
+  *         - parameter out_decimal_exp_p corresponds to n, the decimal exponent;
+  *         - return value corresponds to k, the number of digits.
+  */
+lit_utf8_size_t
+ecma_number_to_decimal (ecma_number_t num, /**< ecma-number */
+                        lit_utf8_byte_t *out_digits_p, /**< [out] buffer to fill with digits */
+                        int32_t *out_decimal_exp_p) /**< [out] decimal exponent */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (num));
+  JERRY_ASSERT (!ecma_number_is_zero (num));
+  JERRY_ASSERT (!ecma_number_is_infinity (num));
+  JERRY_ASSERT (!ecma_number_is_negative (num));
+
+  return ecma_errol0_dtoa ((double) num, out_digits_p, out_decimal_exp_p);
+} /* ecma_number_to_decimal */
+
+/**
+ * Convert ecma-number to zero-terminated string
+ *
+ * See also:
+ *          ECMA-262 v5, 9.8.1
+ *
+ *
+ * @return size of utf-8 string
+ */
+lit_utf8_size_t
+ecma_number_to_utf8_string (ecma_number_t num, /**< ecma-number */
+                            lit_utf8_byte_t *buffer_p, /**< buffer for utf-8 string */
+                            lit_utf8_size_t buffer_size) /**< size of buffer */
+{
+  lit_utf8_byte_t *dst_p;
+
+  if (ecma_number_is_nan (num))
+  {
+    /* 1. */
+    dst_p = lit_copy_magic_string_to_buffer (LIT_MAGIC_STRING_NAN, buffer_p, buffer_size);
+    return (lit_utf8_size_t) (dst_p - buffer_p);
+  }
+
+  if (ecma_number_is_zero (num))
+  {
+    /* 2. */
+    *buffer_p = LIT_CHAR_0;
+    JERRY_ASSERT (1 <= buffer_size);
+    return 1;
+  }
+
+  dst_p = buffer_p;
+
+  if (ecma_number_is_negative (num))
+  {
+    /* 3. */
+    *dst_p++ = LIT_CHAR_MINUS;
+    num = ecma_number_negate (num);
+  }
+
+  if (ecma_number_is_infinity (num))
+  {
+    /* 4. */
+    dst_p = lit_copy_magic_string_to_buffer (LIT_MAGIC_STRING_INFINITY_UL, dst_p,
+                                             (lit_utf8_size_t) (buffer_p + buffer_size - dst_p));
+    JERRY_ASSERT (dst_p <= buffer_p + buffer_size);
+    return (lit_utf8_size_t) (dst_p - buffer_p);
+  }
+
+  JERRY_ASSERT (ecma_number_get_next (ecma_number_get_prev (num)) == num);
+
+  /* 5. */
+  uint32_t num_uint32 = ecma_number_to_uint32 (num);
+
+  if (((ecma_number_t) num_uint32) == num)
+  {
+    dst_p += ecma_uint32_to_utf8_string (num_uint32, dst_p, (lit_utf8_size_t) (buffer_p + buffer_size - dst_p));
+    JERRY_ASSERT (dst_p <= buffer_p + buffer_size);
+    return (lit_utf8_size_t) (dst_p - buffer_p);
+  }
+
+  /* decimal exponent */
+  int32_t n;
+  /* number of digits in mantissa */
+  int32_t k;
+
+  k = (int32_t) ecma_number_to_decimal (num, dst_p, &n);
+
+  if (k <= n && n <= 21)
+  {
+    /* 6. */
+    dst_p += k;
+
+    memset (dst_p, LIT_CHAR_0, (size_t) (n - k));
+    dst_p += n - k;
+
+    JERRY_ASSERT (dst_p <= buffer_p + buffer_size);
+    return (lit_utf8_size_t) (dst_p - buffer_p);
+  }
+
+  if (0 < n && n <= 21)
+  {
+    /* 7. */
+    memmove (dst_p + n + 1, dst_p + n, (size_t) (k - n));
+    *(dst_p + n) = LIT_CHAR_DOT;
+    dst_p += k + 1;
+
+    JERRY_ASSERT (dst_p <= buffer_p + buffer_size);
+    return (lit_utf8_size_t) (dst_p - buffer_p);
+  }
+
+  if (-6 < n && n <= 0)
+  {
+    /* 8. */
+    memmove (dst_p + 2 - n, dst_p, (size_t) k);
+    memset (dst_p + 2, LIT_CHAR_0, (size_t) -n);
+    *dst_p = LIT_CHAR_0;
+    *(dst_p + 1) = LIT_CHAR_DOT;
+    dst_p += k - n + 2;
+
+    JERRY_ASSERT (dst_p <= buffer_p + buffer_size);
+    return (lit_utf8_size_t) (dst_p - buffer_p);
+  }
+
+  if (k == 1)
+  {
+    /* 9. */
+    dst_p++;
+  }
+  else
+  {
+    /* 10. */
+    memmove (dst_p + 2, dst_p + 1, (size_t) (k - 1));
+    *(dst_p + 1) = LIT_CHAR_DOT;
+    dst_p += k + 1;
+  }
+
+  /* 9., 10. */
+  *dst_p++ = LIT_CHAR_LOWERCASE_E;
+  *dst_p++ = (n >= 1) ? LIT_CHAR_PLUS : LIT_CHAR_MINUS;
+  uint32_t t = (uint32_t) (n >= 1 ? (n - 1) : -(n - 1));
+
+  dst_p += ecma_uint32_to_utf8_string (t, dst_p, (lit_utf8_size_t) (buffer_p + buffer_size - dst_p));
+
+  JERRY_ASSERT (dst_p <= buffer_p + buffer_size);
+
+  return (lit_utf8_size_t) (dst_p - buffer_p);
+} /* ecma_number_to_utf8_string */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-helpers-errol.c b/deps/jerry/jerry-core/ecma/base/ecma-helpers-errol.c
new file mode 100644 (file)
index 0000000..5da8848
--- /dev/null
@@ -0,0 +1,235 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *   Copyright (c) 2016 Marc Andrysco
+ *
+ *   Permission is hereby granted, free of charge, to any person obtaining a copy
+ *   of this software and associated documentation files (the "Software"), to deal
+ *   in the Software without restriction, including without limitation the rights
+ *   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ *   copies of the Software, and to permit persons to whom the Software is
+ *   furnished to do so, subject to the following conditions:
+ *
+ *   The above copyright notice and this permission notice shall be included in all
+ *   copies or substantial portions of the Software.
+ *
+ *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ *   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ *   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ *   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ *   SOFTWARE.
+ */
+
+#include <math.h>
+
+#include "ecma-helpers.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmahelpers Helpers for operations with ECMA data types
+ * @{
+ */
+
+/**
+ * Printing Floating-Point Numbers
+ *
+ * available at http://cseweb.ucsd.edu/~mandrysc/pub/dtoa.pdf
+ */
+
+/**
+ * Floating point format definitions
+ */
+#define ECMA_NEXT_FLOAT(value) (nextafter ((value), INFINITY))
+#define ECMA_PREV_FLOAT(value) (nextafter ((value), -INFINITY))
+
+#define ERROL0_EPSILON 0.0000001
+
+/**
+ * High-precision data structure.
+ */
+typedef struct
+{
+  double value; /**< value */
+  double offset; /**< offset */
+} ecma_high_prec_t;
+
+/**
+ * Normalize the number by factoring in the error.
+ */
+static inline void __attr_always_inline___
+ecma_normalize_high_prec_data (ecma_high_prec_t *hp_data_p) /**< [in, out] float pair */
+{
+  double val = hp_data_p->value;
+
+  hp_data_p->value += hp_data_p->offset;
+  hp_data_p->offset += val - hp_data_p->value;
+} /* ecma_normalize_high_prec_data */
+
+/**
+ * Multiply the high-precision number by ten.
+ */
+static inline void __attr_always_inline___
+ecma_multiply_high_prec_by_10 (ecma_high_prec_t *hp_data_p) /**< [in, out] high-precision number */
+{
+  double value = hp_data_p->value;
+
+  hp_data_p->value *= 10.0;
+  hp_data_p->offset *= 10.0;
+
+  double offset = hp_data_p->value;
+
+  offset -= value * 8.0;
+  offset -= value * 2.0;
+
+  hp_data_p->offset -= offset;
+
+  ecma_normalize_high_prec_data (hp_data_p);
+} /* ecma_multiply_high_prec_by_10 */
+
+/**
+ * Divide the high-precision number by ten.
+ */
+static void
+ecma_divide_high_prec_by_10 (ecma_high_prec_t *hp_data_p) /**< [in, out] high-precision number */
+{
+  double value = hp_data_p->value;
+
+  hp_data_p->value /= 10.0;
+  hp_data_p->offset /= 10.0;
+
+  value -= hp_data_p->value * 8.0;
+  value -= hp_data_p->value * 2.0;
+
+  hp_data_p->offset += value / 10.0;
+
+  ecma_normalize_high_prec_data (hp_data_p);
+} /* ecma_divide_high_prec_by_10 */
+
+/**
+ * Errol0 double to ASCII conversion, guaranteed correct but possibly not optimal.
+ *
+ * @return number of generated digits
+ */
+inline lit_utf8_size_t __attr_always_inline___
+ecma_errol0_dtoa (double val, /**< ecma number */
+                  lit_utf8_byte_t *buffer_p, /**< buffer to generate digits into */
+                  int32_t *exp_p) /**< [out] exponent */
+{
+  double power_of_10 = 1.0;
+  int32_t exp = 1;
+
+  /* normalize the midpoint */
+  ecma_high_prec_t mid;
+
+  mid.value = val;
+  mid.offset = 0.0;
+
+  while (((mid.value > 10.0) || ((mid.value == 10.0) && (mid.offset >= 0.0))) && (exp < 308))
+  {
+    exp++;
+    ecma_divide_high_prec_by_10 (&mid);
+    power_of_10 /= 10.0;
+  }
+
+  while (((mid.value < 1.0) || ((mid.value == 1.0) && (mid.offset < 0.0))) && (exp > -307))
+  {
+    exp--;
+    ecma_multiply_high_prec_by_10 (&mid);
+    power_of_10 *= 10.0;
+  }
+
+  ecma_high_prec_t high_bound, low_bound;
+
+  high_bound.value = mid.value;
+  high_bound.offset = mid.offset;
+
+  if (ECMA_NEXT_FLOAT (val) != INFINITY)
+  {
+    high_bound.offset += (ECMA_NEXT_FLOAT (val) - val) * power_of_10 / (2.0 + ERROL0_EPSILON);
+  }
+
+  low_bound.value = mid.value;
+  low_bound.offset = mid.offset + (ECMA_PREV_FLOAT (val) - val) * power_of_10 / (2.0 + ERROL0_EPSILON);
+
+  ecma_normalize_high_prec_data (&high_bound);
+  ecma_normalize_high_prec_data (&low_bound);
+
+  /* normalized boundaries */
+
+  while (high_bound.value > 10.0 || (high_bound.value == 10.0 && (high_bound.offset >= 0.0)))
+  {
+    exp++;
+    ecma_divide_high_prec_by_10 (&high_bound);
+    ecma_divide_high_prec_by_10 (&low_bound);
+  }
+
+  while (high_bound.value < 1.0 || (high_bound.value == 1.0 && (high_bound.offset < 0.0)))
+  {
+    exp--;
+    ecma_multiply_high_prec_by_10 (&high_bound);
+    ecma_multiply_high_prec_by_10 (&low_bound);
+  }
+
+  /* digit generation */
+
+  lit_utf8_byte_t *dst_p = buffer_p;
+
+  while (high_bound.value != 0.0 || high_bound.offset != 0.0)
+  {
+    uint8_t high_digit = (uint8_t) high_bound.value;
+
+    if ((high_bound.value == high_digit) && (high_bound.offset < 0))
+    {
+      high_digit = (uint8_t) (high_digit - 1u);
+    }
+
+    uint8_t low_digit = (uint8_t) low_bound.value;
+
+    if ((low_bound.value == low_digit) && (low_bound.offset < 0))
+    {
+      low_digit = (uint8_t) (low_digit - 1u);
+    }
+
+    if (low_digit != high_digit)
+    {
+      break;
+    }
+
+    *dst_p++ = (lit_utf8_byte_t) ('0' + high_digit);
+
+    high_bound.value -= high_digit;
+    ecma_multiply_high_prec_by_10 (&high_bound);
+
+    low_bound.value -= low_digit;
+    ecma_multiply_high_prec_by_10 (&low_bound);
+  }
+
+  double mdig = (high_bound.value + low_bound.value) / 2.0 + 0.5;
+  *dst_p++ = (lit_utf8_byte_t) ('0' + (uint8_t) mdig);
+
+  *exp_p = exp;
+
+  return (lit_utf8_size_t) (dst_p - buffer_p);
+} /* ecma_errol0_dtoa */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-helpers-external-pointers.c b/deps/jerry/jerry-core/ecma/base/ecma-helpers-external-pointers.c
new file mode 100644 (file)
index 0000000..6a5ad2b
--- /dev/null
@@ -0,0 +1,167 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmahelpers Helpers for operations with ECMA data types
+ * @{
+ */
+
+/**
+ * Create internal property with specified identifier and store native handle/pointer of the object.
+ *
+ * Note:
+ *      property identifier should be one of the following:
+ *        - LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE
+ *        - LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER
+ *
+ * @return true - if property was just created with specified value,
+ *         false - otherwise, if property existed before the call, it's value was updated
+ */
+static bool
+ecma_create_native_property (ecma_object_t *obj_p, /**< object to create property in */
+                             lit_magic_string_id_t id, /**< identifier of internal
+                                                        *   property to create */
+                             void *data_p, /**< native pointer data */
+                             void *info_p) /**< native pointer's info */
+{
+  JERRY_ASSERT (id == LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE
+                || id == LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER);
+
+  ecma_string_t name;
+  ecma_init_ecma_magic_string (&name, id);
+
+  ecma_property_t *property_p = ecma_find_named_property (obj_p, &name);
+  bool is_new = (property_p == NULL);
+
+  ecma_native_pointer_t *native_pointer_p;
+
+  if (is_new)
+  {
+    ecma_property_value_t *value_p;
+    value_p = ecma_create_named_data_property (obj_p, &name, ECMA_PROPERTY_FLAG_WRITABLE, NULL);
+
+    native_pointer_p = jmem_heap_alloc_block (sizeof (ecma_native_pointer_t));
+
+    ECMA_SET_INTERNAL_VALUE_POINTER (value_p->value, native_pointer_p);
+  }
+  else
+  {
+    ecma_property_value_t *value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
+
+    native_pointer_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_native_pointer_t, value_p->value);
+  }
+
+  JERRY_ASSERT (ECMA_STRING_IS_REF_EQUALS_TO_ONE (&name));
+
+  native_pointer_p->data_p = data_p;
+  native_pointer_p->u.info_p = info_p;
+
+  return is_new;
+} /* ecma_create_native_property */
+
+/**
+ * Create a native handle property to store the native handle and its free callback.
+ *
+ * @return true - if property was just created with specified value,
+ *         false - otherwise, if property existed before the call, it's value was updated
+ */
+bool
+ecma_create_native_handle_property (ecma_object_t *obj_p, /**< object to create property in */
+                                    void *handle_p, /**< native handle */
+                                    void *free_cb) /**< native handle's free callback*/
+{
+  return ecma_create_native_property (obj_p,
+                                      LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE,
+                                      handle_p,
+                                      free_cb);
+} /* ecma_create_native_handle_property */
+
+/**
+ * Create a native pointer property to store the native pointer and its type info.
+ *
+ * @return true - if property was just created with specified value,
+ *         false - otherwise, if property existed before the call, it's value was updated
+ */
+bool
+ecma_create_native_pointer_property (ecma_object_t *obj_p, /**< object to create property in */
+                                     void *native_p, /**< native pointer */
+                                     void *info_p) /**< native pointer's type info */
+{
+  return ecma_create_native_property (obj_p,
+                                      LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER,
+                                      native_p,
+                                      info_p);
+} /* ecma_create_native_pointer_property */
+
+/**
+ * Get value of native package stored in the object's property with specified identifier
+ *
+ * Note:
+ *      property identifier should be one of the following:
+ *        - LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE
+ *        - LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER
+ *
+ * @return native pointer data if property exists
+ *         NULL otherwise
+ */
+ecma_native_pointer_t *
+ecma_get_native_pointer_value (ecma_object_t *obj_p, /**< object to get property value from */
+                               lit_magic_string_id_t id) /**< identifier of internal property
+                                                          *   to get value from */
+{
+  JERRY_ASSERT (id == LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE
+                || id == LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER);
+
+  ecma_string_t name;
+  ecma_init_ecma_magic_string (&name, id);
+
+  ecma_property_t *property_p = ecma_find_named_property (obj_p, &name);
+
+  JERRY_ASSERT (ECMA_STRING_IS_REF_EQUALS_TO_ONE (&name));
+
+  if (property_p == NULL)
+  {
+    return NULL;
+  }
+
+  ecma_property_value_t *value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
+
+  return ECMA_GET_INTERNAL_VALUE_POINTER (ecma_native_pointer_t, value_p->value);
+} /* ecma_get_native_pointer_value */
+
+/**
+ * Free the allocated native package struct.
+ */
+void
+ecma_free_native_pointer (ecma_property_t *prop_p) /**< native property */
+{
+  ecma_property_value_t *value_p = ECMA_PROPERTY_VALUE_PTR (prop_p);
+
+  ecma_native_pointer_t *native_pointer_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_native_pointer_t,
+                                                                             value_p->value);
+
+  jmem_heap_free_block (native_pointer_p, sizeof (ecma_native_pointer_t));
+} /* ecma_free_native_pointer */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-helpers-number.c b/deps/jerry/jerry-core/ecma/base/ecma-helpers-number.c
new file mode 100644 (file)
index 0000000..b1988b1
--- /dev/null
@@ -0,0 +1,736 @@
+/* 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.
+ */
+
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmahelpers Helpers for operations with ECMA data types
+ * @{
+ */
+
+JERRY_STATIC_ASSERT (sizeof (ecma_value_t) == sizeof (ecma_integer_value_t),
+                     size_of_ecma_value_t_must_be_equal_to_the_size_of_ecma_integer_value_t);
+
+JERRY_STATIC_ASSERT (ECMA_DIRECT_SHIFT == ECMA_VALUE_SHIFT + 1,
+                     currently_directly_encoded_values_has_one_extra_flag);
+
+JERRY_STATIC_ASSERT (((1 << (ECMA_DIRECT_SHIFT - 1)) | ECMA_TYPE_DIRECT) == ECMA_DIRECT_TYPE_SIMPLE_VALUE,
+                     currently_directly_encoded_values_start_after_direct_type_simple_value);
+
+#define ECMA_NUMBER_SIGN_POS (ECMA_NUMBER_FRACTION_WIDTH + \
+                              ECMA_NUMBER_BIASED_EXP_WIDTH)
+
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
+JERRY_STATIC_ASSERT (sizeof (ecma_number_t) == sizeof (uint32_t),
+                     size_of_ecma_number_t_must_be_equal_to_4_bytes);
+
+/**
+ * Packing sign, fraction and biased exponent to ecma-number
+ *
+ * @return ecma-number with specified sign, biased_exponent and fraction
+ */
+static ecma_number_t
+ecma_number_pack (bool sign, /**< sign */
+                  uint32_t biased_exp, /**< biased exponent */
+                  uint64_t fraction) /**< fraction */
+{
+  JERRY_ASSERT ((biased_exp & ~((1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1)) == 0);
+  JERRY_ASSERT ((fraction & ~((1ull << ECMA_NUMBER_FRACTION_WIDTH) - 1)) == 0);
+
+  uint32_t packed_value = (((sign ? 1u : 0u) << ECMA_NUMBER_SIGN_POS) |
+                           (biased_exp << ECMA_NUMBER_FRACTION_WIDTH) |
+                           ((uint32_t) fraction));
+
+  union
+  {
+    uint32_t u32_value;
+    ecma_number_t float_value;
+  } u;
+
+  u.u32_value = packed_value;
+
+  return u.float_value;
+} /* ecma_number_pack */
+
+/**
+ * Unpacking sign, fraction and biased exponent from ecma-number
+ */
+static void
+ecma_number_unpack (ecma_number_t num, /**< ecma-number */
+                    bool *sign_p, /**< [out] sign (optional) */
+                    uint32_t *biased_exp_p, /**< [out] biased exponent (optional) */
+                    uint64_t *fraction_p) /**< [out] fraction (optional) */
+{
+  union
+  {
+    uint32_t u32_value;
+    ecma_number_t float_value;
+  } u;
+
+  u.float_value = num;
+
+  uint32_t packed_value = u.u32_value;
+
+  if (sign_p != NULL)
+  {
+    *sign_p = ((packed_value >> ECMA_NUMBER_SIGN_POS) != 0);
+  }
+
+  if (biased_exp_p != NULL)
+  {
+    *biased_exp_p = (((packed_value) & ~(1u << ECMA_NUMBER_SIGN_POS)) >> ECMA_NUMBER_FRACTION_WIDTH);
+  }
+
+  if (fraction_p != NULL)
+  {
+    *fraction_p = (packed_value & ((1u << ECMA_NUMBER_FRACTION_WIDTH) - 1));
+  }
+} /* ecma_number_unpack */
+
+/**
+ * Value used to calculate exponent from biased exponent
+ *
+ * See also:
+ *          IEEE-754 2008, 3.6, Table 3.5
+ */
+const int32_t ecma_number_exponent_bias = 127;
+
+#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+JERRY_STATIC_ASSERT (sizeof (ecma_number_t) == sizeof (uint64_t),
+                     size_of_ecma_number_t_must_be_equal_to_8_bytes);
+
+/**
+ * Packing sign, fraction and biased exponent to ecma-number
+ *
+ * @return ecma-number with specified sign, biased_exponent and fraction
+ */
+static ecma_number_t
+ecma_number_pack (bool sign, /**< sign */
+                  uint32_t biased_exp, /**< biased exponent */
+                  uint64_t fraction) /**< fraction */
+{
+  uint64_t packed_value = (((sign ? 1ull : 0ull) << ECMA_NUMBER_SIGN_POS) |
+                           (((uint64_t) biased_exp) << ECMA_NUMBER_FRACTION_WIDTH) |
+                           fraction);
+
+  JERRY_ASSERT ((biased_exp & ~((1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1)) == 0);
+  JERRY_ASSERT ((fraction & ~((1ull << ECMA_NUMBER_FRACTION_WIDTH) - 1)) == 0);
+
+  union
+  {
+    uint64_t u64_value;
+    ecma_number_t float_value;
+  } u;
+
+  u.u64_value = packed_value;
+
+  return u.float_value;
+} /* ecma_number_pack */
+
+/**
+ * Unpacking sign, fraction and biased exponent from ecma-number
+ */
+static void
+ecma_number_unpack (ecma_number_t num, /**< ecma-number */
+                    bool *sign_p, /**< [out] sign (optional) */
+                    uint32_t *biased_exp_p, /**< [out] biased exponent (optional) */
+                    uint64_t *fraction_p) /**< [out] fraction (optional) */
+{
+  union
+  {
+    uint64_t u64_value;
+    ecma_number_t float_value;
+  } u;
+  u.float_value = num;
+
+  uint64_t packed_value = u.u64_value;
+
+  if (sign_p != NULL)
+  {
+    *sign_p = ((packed_value >> ECMA_NUMBER_SIGN_POS) != 0);
+  }
+
+  if (biased_exp_p != NULL)
+  {
+    *biased_exp_p = (uint32_t) (((packed_value) & ~(1ull << ECMA_NUMBER_SIGN_POS)) >> ECMA_NUMBER_FRACTION_WIDTH);
+  }
+
+  if (fraction_p != NULL)
+  {
+    *fraction_p = (packed_value & ((1ull << ECMA_NUMBER_FRACTION_WIDTH) - 1));
+  }
+} /* ecma_number_unpack */
+
+/**
+ * Value used to calculate exponent from biased exponent
+ *
+ * See also:
+ *          IEEE-754 2008, 3.6, Table 3.5
+ */
+const int32_t ecma_number_exponent_bias = 1023;
+
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
+
+/**
+ * Get fraction of number
+ *
+ * @return normalized fraction field of number
+ */
+static uint64_t
+ecma_number_get_fraction_field (ecma_number_t num) /**< ecma-number */
+{
+  uint64_t fraction;
+
+  ecma_number_unpack (num, NULL, NULL, &fraction);
+
+  return fraction;
+} /* ecma_number_get_fraction_field */
+
+/**
+ * Get exponent of number
+ *
+ * @return exponent corresponding to normalized fraction of number
+ */
+static uint32_t
+ecma_number_get_biased_exponent_field (ecma_number_t num) /**< ecma-number */
+{
+  uint32_t biased_exp;
+
+  ecma_number_unpack (num, NULL, &biased_exp, NULL);
+
+  return biased_exp;
+} /* ecma_number_get_biased_exponent_field */
+
+/**
+ * Get sign bit of number
+ *
+ * @return 0 or 1 - value of sign bit
+ */
+static uint32_t
+ecma_number_get_sign_field (ecma_number_t num) /**< ecma-number */
+{
+  bool sign;
+
+  ecma_number_unpack (num, &sign, NULL, NULL);
+
+  return sign;
+} /* ecma_number_get_sign_field */
+
+/**
+ * Check if ecma-number is NaN
+ *
+ * @return true - if biased exponent is filled with 1 bits and
+                  fraction is filled with anything but not all zero bits,
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+ecma_number_is_nan (ecma_number_t num) /**< ecma-number */
+{
+  bool is_nan = (num != num);
+
+#ifndef JERRY_NDEBUG
+  uint32_t biased_exp = ecma_number_get_biased_exponent_field (num);
+  uint64_t fraction = ecma_number_get_fraction_field (num);
+
+   /* IEEE-754 2008, 3.4, a */
+  bool is_nan_ieee754 = ((biased_exp == (1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1)
+                         && (fraction != 0));
+
+  JERRY_ASSERT (is_nan == is_nan_ieee754);
+#endif /* !JERRY_NDEBUG */
+
+  return is_nan;
+} /* ecma_number_is_nan */
+
+/**
+ * Make a NaN.
+ *
+ * @return NaN value
+ */
+ecma_number_t
+ecma_number_make_nan (void)
+{
+  return ecma_number_pack (false,
+                           (1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1u,
+                           1u);
+} /* ecma_number_make_nan */
+
+/**
+ * Make an Infinity.
+ *
+ * @return if !sign - +Infinity value,
+ *         else - -Infinity value.
+ */
+ecma_number_t
+ecma_number_make_infinity (bool sign) /**< true - for negative Infinity,
+                                           false - for positive Infinity */
+{
+  return ecma_number_pack (sign,
+                           (1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1u,
+                           0u);
+} /* ecma_number_make_infinity */
+
+/**
+ * Check if ecma-number is negative
+ *
+ * @return true - if sign bit of ecma-number is set
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+ecma_number_is_negative (ecma_number_t num) /**< ecma-number */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (num));
+
+  /* IEEE-754 2008, 3.4 */
+  return (ecma_number_get_sign_field (num) != 0);
+} /* ecma_number_is_negative */
+
+/**
+ * Check if ecma-number is zero
+ *
+ * @return true - if fraction is zero and biased exponent is zero,
+ *         false - otherwise
+ */
+bool
+ecma_number_is_zero (ecma_number_t num) /**< ecma-number */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (num));
+
+  bool is_zero = (num == ECMA_NUMBER_ZERO);
+
+#ifndef JERRY_NDEBUG
+  /* IEEE-754 2008, 3.4, e */
+  bool is_zero_ieee754 = (ecma_number_get_fraction_field (num) == 0
+                          && ecma_number_get_biased_exponent_field (num) == 0);
+
+  JERRY_ASSERT (is_zero == is_zero_ieee754);
+#endif /* !JERRY_NDEBUG */
+
+  return is_zero;
+} /* ecma_number_is_zero */
+
+/**
+ * Check if number is infinity
+ *
+ * @return true - if biased exponent is filled with 1 bits and
+ *                fraction is filled with zero bits,
+ *         false - otherwise
+ */
+bool
+ecma_number_is_infinity (ecma_number_t num) /**< ecma-number */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (num));
+
+  uint32_t biased_exp = ecma_number_get_biased_exponent_field (num);
+  uint64_t fraction = ecma_number_get_fraction_field (num);
+
+  /* IEEE-754 2008, 3.4, b */
+  return ((biased_exp  == (1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1)
+          && (fraction == 0));
+} /* ecma_number_is_infinity */
+
+/**
+ * Get fraction and exponent of the number
+ *
+ * @return shift of dot in the fraction
+ */
+int32_t
+ecma_number_get_fraction_and_exponent (ecma_number_t num, /**< ecma-number */
+                                       uint64_t *out_fraction_p, /**< [out] fraction of the number */
+                                       int32_t *out_exponent_p) /**< [out] exponent of the number */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (num));
+
+  uint32_t biased_exp = ecma_number_get_biased_exponent_field (num);
+  uint64_t fraction = ecma_number_get_fraction_field (num);
+  int32_t exponent;
+
+  if (unlikely (biased_exp == 0))
+  {
+    /* IEEE-754 2008, 3.4, d */
+    if (ecma_number_is_zero (num))
+    {
+      exponent = -ecma_number_exponent_bias;
+    }
+    else
+    {
+      exponent = 1 - ecma_number_exponent_bias;
+
+      while (!(fraction & (1ull << ECMA_NUMBER_FRACTION_WIDTH)))
+      {
+        JERRY_ASSERT (fraction != 0);
+
+        fraction <<= 1;
+        exponent--;
+      }
+    }
+  }
+  else if (ecma_number_is_infinity (num))
+  {
+    /* The fraction and exponent should round to infinity */
+    exponent = (int32_t) biased_exp - ecma_number_exponent_bias;
+
+    JERRY_ASSERT ((fraction & (1ull << ECMA_NUMBER_FRACTION_WIDTH)) == 0);
+    fraction |= 1ull << ECMA_NUMBER_FRACTION_WIDTH;
+  }
+  else
+  {
+    /* IEEE-754 2008, 3.4, c */
+    exponent = (int32_t) biased_exp - ecma_number_exponent_bias;
+
+    JERRY_ASSERT (biased_exp > 0 && biased_exp < (1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1);
+    JERRY_ASSERT ((fraction & (1ull << ECMA_NUMBER_FRACTION_WIDTH)) == 0);
+    fraction |= 1ull << ECMA_NUMBER_FRACTION_WIDTH;
+  }
+
+  *out_fraction_p = fraction;
+  *out_exponent_p = exponent;
+  return ECMA_NUMBER_FRACTION_WIDTH;
+} /* ecma_number_get_fraction_and_exponent */
+
+/**
+ * Make normalised positive Number from given fraction and exponent
+ *
+ * @return ecma-number
+ */
+ecma_number_t
+ecma_number_make_normal_positive_from_fraction_and_exponent (uint64_t fraction, /**< fraction */
+                                                             int32_t exponent) /**< exponent */
+{
+  uint32_t biased_exp = (uint32_t) (exponent + ecma_number_exponent_bias);
+  JERRY_ASSERT (biased_exp > 0 && biased_exp < (1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1);
+  JERRY_ASSERT ((fraction & ~((1ull << (ECMA_NUMBER_FRACTION_WIDTH + 1)) - 1)) == 0);
+  JERRY_ASSERT ((fraction & (1ull << ECMA_NUMBER_FRACTION_WIDTH)) != 0);
+
+  return ecma_number_pack (false,
+                           biased_exp,
+                           fraction & ~(1ull << ECMA_NUMBER_FRACTION_WIDTH));
+} /* ecma_number_make_normal_positive_from_fraction_and_exponent */
+
+/**
+ * Make Number of given sign from given mantissa value and binary exponent
+ *
+ * @return ecma-number (possibly Infinity of specified sign)
+ */
+ecma_number_t
+ecma_number_make_from_sign_mantissa_and_exponent (bool sign, /**< true - for negative sign,
+                                                                  false - for positive sign */
+                                                  uint64_t mantissa, /**< mantissa */
+                                                  int32_t exponent) /**< binary exponent */
+{
+  /* Rounding mantissa to fit into fraction field width */
+  if (mantissa & ~((1ull << (ECMA_NUMBER_FRACTION_WIDTH + 1)) - 1))
+  {
+    /* Rounded mantissa looks like the following: |00...0|1|fraction_width mantissa bits| */
+    while ((mantissa & ~((1ull << (ECMA_NUMBER_FRACTION_WIDTH + 1)) - 1)) != 0)
+    {
+      uint64_t rightmost_bit = (mantissa & 1);
+
+      exponent++;
+      mantissa >>= 1;
+
+      if ((mantissa & ~((1ull << (ECMA_NUMBER_FRACTION_WIDTH + 1)) - 1)) == 0)
+      {
+        /* Rounding to nearest value */
+        mantissa += rightmost_bit;
+
+        /* In the first case loop is finished,
+           and in the second - just one shift follows and then loop finishes */
+        JERRY_ASSERT (((mantissa & ~((1ull << (ECMA_NUMBER_FRACTION_WIDTH + 1)) - 1)) == 0)
+                      || (mantissa == (1ull << (ECMA_NUMBER_FRACTION_WIDTH + 1))));
+      }
+    }
+  }
+
+  /* Normalizing mantissa */
+  while (mantissa != 0
+         && ((mantissa & (1ull << ECMA_NUMBER_FRACTION_WIDTH)) == 0))
+  {
+    exponent--;
+    mantissa <<= 1;
+  }
+
+  /* Moving floating point */
+  exponent += ECMA_NUMBER_FRACTION_WIDTH - 1;
+
+  int32_t biased_exp_signed = exponent + ecma_number_exponent_bias;
+
+  if (biased_exp_signed < 1)
+  {
+    /* Denormalizing mantissa if biased_exponent is less than zero */
+    while (biased_exp_signed < 0)
+    {
+      biased_exp_signed++;
+      mantissa >>= 1;
+    }
+
+    /* Rounding to nearest value */
+    mantissa += 1;
+    mantissa >>= 1;
+
+    /* Encoding denormalized exponent */
+    biased_exp_signed = 0;
+  }
+  else
+  {
+    /* Clearing highest mantissa bit that should have been non-zero if mantissa is non-zero */
+    mantissa &= ~(1ull << ECMA_NUMBER_FRACTION_WIDTH);
+  }
+
+  uint32_t biased_exp = (uint32_t) biased_exp_signed;
+
+  if (biased_exp >= ((1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1))
+  {
+    return ecma_number_make_infinity (sign);
+  }
+
+  JERRY_ASSERT (biased_exp < (1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1);
+  JERRY_ASSERT ((mantissa & ~((1ull << ECMA_NUMBER_FRACTION_WIDTH) - 1)) == 0);
+
+  return ecma_number_pack (sign,
+                           biased_exp,
+                           mantissa);
+} /* ecma_number_make_from_sign_mantissa_and_exponent */
+
+/**
+ * Get previous representable ecma-number
+ *
+ * @return maximum ecma-number that is less compared to passed argument
+ */
+ecma_number_t
+ecma_number_get_prev (ecma_number_t num) /**< ecma-number */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (num));
+  JERRY_ASSERT (!ecma_number_is_zero (num));
+
+  if (ecma_number_is_negative (num))
+  {
+    return ecma_number_negate (ecma_number_get_next (num));
+  }
+
+  uint32_t biased_exp = ecma_number_get_biased_exponent_field (num);
+  uint64_t fraction = ecma_number_get_fraction_field (num);
+
+  if (fraction == 0 && biased_exp != 0)
+  {
+    fraction = (1ull << ECMA_NUMBER_FRACTION_WIDTH) - 1;
+
+    biased_exp--;
+  }
+  else
+  {
+    fraction--;
+  }
+
+  return ecma_number_pack (false,
+                           biased_exp,
+                           fraction);
+} /* ecma_number_get_prev */
+
+/**
+ * Get next representable ecma-number
+ *
+ * @return minimum ecma-number that is greater compared to passed argument
+ */
+ecma_number_t
+ecma_number_get_next (ecma_number_t num) /**< ecma-number */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (num));
+  JERRY_ASSERT (!ecma_number_is_infinity (num));
+
+  if (ecma_number_is_negative (num))
+  {
+    return ecma_number_negate (ecma_number_get_prev (num));
+  }
+
+  uint32_t biased_exp = ecma_number_get_biased_exponent_field (num);
+  uint64_t fraction = ecma_number_get_fraction_field (num);
+
+  fraction |= (1ull << ECMA_NUMBER_FRACTION_WIDTH);
+
+  fraction++;
+
+  if ((fraction & (1ull << ECMA_NUMBER_FRACTION_WIDTH)) == 0)
+  {
+    fraction >>= 1;
+
+    biased_exp++;
+  }
+
+  JERRY_ASSERT (fraction & (1ull << ECMA_NUMBER_FRACTION_WIDTH));
+
+  fraction &= ~(1ull << ECMA_NUMBER_FRACTION_WIDTH);
+
+  return ecma_number_pack (false,
+                           biased_exp,
+                           fraction);
+} /* ecma_number_get_next */
+
+/**
+ * Negate ecma-number
+ *
+ * @return negated number
+ */
+ecma_number_t
+ecma_number_negate (ecma_number_t num) /**< ecma-number */
+{
+  ecma_number_t negated = -num;
+
+#ifndef JERRY_NDEBUG
+  bool sign;
+  uint32_t biased_exp;
+  uint64_t fraction;
+
+  ecma_number_unpack (num, &sign, &biased_exp, &fraction);
+
+  sign = !sign;
+
+  ecma_number_t negated_ieee754 = ecma_number_pack (sign, biased_exp, fraction);
+
+  JERRY_ASSERT (negated == negated_ieee754
+                || (ecma_number_is_nan (negated)
+                    && ecma_number_is_nan (negated_ieee754)));
+#endif /* !JERRY_NDEBUG */
+
+  return negated;
+} /* ecma_number_negate */
+
+/**
+ * Truncate fractional part of the number
+ *
+ * @return integer part of the number
+ */
+ecma_number_t
+ecma_number_trunc (ecma_number_t num) /**< ecma-number */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (num));
+
+  uint64_t fraction;
+  int32_t exponent;
+  const int32_t dot_shift = ecma_number_get_fraction_and_exponent (num, &fraction, &exponent);
+  const bool sign = ecma_number_is_negative (num);
+
+  if (exponent < 0)
+  {
+    return ECMA_NUMBER_ZERO;
+  }
+  else if (exponent < dot_shift)
+  {
+    fraction &= ~((1ull << (dot_shift - exponent)) - 1);
+
+    ecma_number_t tmp = ecma_number_make_normal_positive_from_fraction_and_exponent (fraction,
+                                                                                     exponent);
+    if (sign)
+    {
+      return ecma_number_negate (tmp);
+    }
+    else
+    {
+      return tmp;
+    }
+  }
+  else
+  {
+    return num;
+  }
+} /* ecma_number_trunc */
+
+/**
+ * Calculate remainder of division of two numbers,
+ * as specified in ECMA-262 v5, 11.5.3, item 6.
+ *
+ * Note:
+ *      operands shouldn't contain NaN, Infinity, or zero.
+ *
+ * @return number - calculated remainder.
+ */
+ecma_number_t
+ecma_number_calc_remainder (ecma_number_t left_num, /**< left operand */
+                            ecma_number_t right_num) /**< right operand */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (left_num)
+                && !ecma_number_is_zero (left_num)
+                && !ecma_number_is_infinity (left_num));
+  JERRY_ASSERT (!ecma_number_is_nan (right_num)
+                && !ecma_number_is_zero (right_num)
+                && !ecma_number_is_infinity (right_num));
+
+  const ecma_number_t q = ecma_number_trunc (ecma_number_divide (left_num, right_num));
+  ecma_number_t r = ecma_number_substract (left_num, ecma_number_multiply (right_num, q));
+
+  if (ecma_number_is_zero (r)
+      && ecma_number_is_negative (left_num))
+  {
+    r = ecma_number_negate (r);
+  }
+
+  return r;
+} /* ecma_number_calc_remainder */
+
+/**
+ * ECMA-number addition.
+ *
+ * @return number - result of addition.
+ */
+ecma_number_t
+ecma_number_add (ecma_number_t left_num, /**< left operand */
+                 ecma_number_t right_num) /**< right operand */
+{
+  return left_num + right_num;
+} /* ecma_number_add */
+
+/**
+ * ECMA-number substraction.
+ *
+ * @return number - result of substraction.
+ */
+ecma_number_t
+ecma_number_substract (ecma_number_t left_num, /**< left operand */
+                       ecma_number_t right_num) /**< right operand */
+{
+  return ecma_number_add (left_num, ecma_number_negate (right_num));
+} /* ecma_number_substract */
+
+/**
+ * ECMA-number multiplication.
+ *
+ * @return number - result of multiplication.
+ */
+ecma_number_t
+ecma_number_multiply (ecma_number_t left_num, /**< left operand */
+                      ecma_number_t right_num) /**< right operand */
+{
+  return left_num * right_num;
+} /* ecma_number_multiply */
+
+/**
+ * ECMA-number division.
+ *
+ * @return number - result of division.
+ */
+ecma_number_t
+ecma_number_divide (ecma_number_t left_num, /**< left operand */
+                    ecma_number_t right_num) /**< right operand */
+{
+  return left_num / right_num;
+} /* ecma_number_divide */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-helpers-string.c b/deps/jerry/jerry-core/ecma/base/ecma-helpers-string.c
new file mode 100644 (file)
index 0000000..1308f13
--- /dev/null
@@ -0,0 +1,2118 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-lcache.h"
+#include "jrt.h"
+#include "jrt-libc-includes.h"
+#include "lit-char-helpers.h"
+#include "lit-magic-strings.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmahelpers Helpers for operations with ECMA data types
+ * @{
+ */
+
+JERRY_STATIC_ASSERT (ECMA_STRING_CONTAINER_MASK + 1 == ECMA_STRING_REF_ONE,
+                     ecma_string_ref_counter_should_start_after_the_container_field);
+
+JERRY_STATIC_ASSERT (ECMA_STRING_CONTAINER_MASK >= ECMA_STRING_CONTAINER__MAX,
+                     ecma_string_container_types_must_be_lower_than_the_container_mask);
+
+JERRY_STATIC_ASSERT ((ECMA_STRING_MAX_REF | ECMA_STRING_CONTAINER_MASK) == UINT16_MAX,
+                     ecma_string_ref_and_container_fields_should_fill_the_16_bit_field);
+
+JERRY_STATIC_ASSERT (ECMA_STRING_NOT_ARRAY_INDEX == UINT32_MAX,
+                     ecma_string_not_array_index_must_be_equal_to_uint32_max);
+
+static void
+ecma_init_ecma_string_from_magic_string_id (ecma_string_t *string_p,
+                                            lit_magic_string_id_t magic_string_id);
+
+static void
+ecma_init_ecma_string_from_magic_string_ex_id (ecma_string_t *string_p,
+                                               lit_magic_string_ex_id_t magic_string_ex_id);
+
+/**
+ * Initialize ecma-string descriptor with specified magic string
+ */
+static void
+ecma_init_ecma_string_from_magic_string_id (ecma_string_t *string_p, /**< descriptor to initialize */
+                                            lit_magic_string_id_t magic_string_id) /**< identifier of
+                                                                                         the magic string */
+{
+  string_p->refs_and_container = ECMA_STRING_CONTAINER_MAGIC_STRING | ECMA_STRING_REF_ONE;
+  string_p->hash = (lit_string_hash_t) magic_string_id;
+
+  string_p->u.magic_string_id = magic_string_id;
+} /* ecma_init_ecma_string_from_magic_string_id */
+
+/**
+ * Initialize external ecma-string descriptor with specified magic string
+ */
+static void
+ecma_init_ecma_string_from_magic_string_ex_id (ecma_string_t *string_p, /**< descriptor to initialize */
+                                               lit_magic_string_ex_id_t magic_string_ex_id) /**< identifier of
+                                                                                           the external magic string */
+{
+  string_p->refs_and_container = ECMA_STRING_CONTAINER_MAGIC_STRING_EX | ECMA_STRING_REF_ONE;
+  string_p->hash = (lit_string_hash_t) (LIT_MAGIC_STRING__COUNT + magic_string_ex_id);
+
+  string_p->u.magic_string_ex_id = magic_string_ex_id;
+} /* ecma_init_ecma_string_from_magic_string_ex_id */
+
+/**
+ * Convert a string to an unsigned 32 bit value if possible
+ *
+ * @return true if the conversion is successful
+ *         false otherwise
+ */
+static bool
+ecma_string_to_array_index (const lit_utf8_byte_t *string_p, /**< utf-8 string */
+                            lit_utf8_size_t string_size, /**< string size */
+                            uint32_t *result_p) /**< [out] converted value */
+{
+  JERRY_ASSERT (string_size > 0 && *string_p >= LIT_CHAR_0 && *string_p <= LIT_CHAR_9);
+
+  if (*string_p == LIT_CHAR_0)
+  {
+    *result_p = 0;
+    return (string_size == 1);
+  }
+
+  if (string_size > ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32)
+  {
+    return false;
+  }
+
+  uint32_t index = 0;
+  const lit_utf8_byte_t *string_end_p = string_p + string_size;
+
+  if (string_size == ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32)
+  {
+    string_end_p--;
+  }
+
+  do
+  {
+    if (*string_p > LIT_CHAR_9 || *string_p < LIT_CHAR_0)
+    {
+      return false;
+    }
+
+    index = (index * 10) + (uint32_t) (*string_p++ - LIT_CHAR_0);
+  }
+  while (string_p < string_end_p);
+
+  if (string_size < ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32)
+  {
+    *result_p = index;
+    return true;
+  }
+
+  /* Overflow must be checked as well when size is
+   * equal to ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32. */
+  if (*string_p > LIT_CHAR_9
+      || *string_p < LIT_CHAR_0
+      || index > (UINT32_MAX / 10)
+      || (index == (UINT32_MAX / 10) && *string_p > LIT_CHAR_5))
+  {
+    return false;
+  }
+
+  *result_p = (index * 10) + (uint32_t) (*string_p - LIT_CHAR_0);
+  return true;
+} /* ecma_string_to_array_index */
+
+/**
+ * Allocate new ecma-string and fill it with characters from the utf8 string
+ *
+ * @return pointer to ecma-string descriptor
+ */
+ecma_string_t *
+ecma_new_ecma_string_from_utf8 (const lit_utf8_byte_t *string_p, /**< utf-8 string */
+                                lit_utf8_size_t string_size) /**< string size */
+{
+  JERRY_ASSERT (string_p != NULL || string_size == 0);
+  JERRY_ASSERT (lit_is_valid_cesu8_string (string_p, string_size));
+
+  lit_magic_string_id_t magic_string_id = lit_is_utf8_string_magic (string_p, string_size);
+
+  if (magic_string_id != LIT_MAGIC_STRING__COUNT)
+  {
+    return ecma_get_magic_string (magic_string_id);
+  }
+
+  JERRY_ASSERT (string_size > 0);
+
+  if (*string_p >= LIT_CHAR_0 && *string_p <= LIT_CHAR_9)
+  {
+    uint32_t array_index;
+
+    if (ecma_string_to_array_index (string_p, string_size, &array_index))
+    {
+      return ecma_new_ecma_string_from_uint32 (array_index);
+    }
+  }
+
+  if (lit_get_magic_string_ex_count () > 0)
+  {
+    lit_magic_string_ex_id_t magic_string_ex_id = lit_is_ex_utf8_string_magic (string_p, string_size);
+
+    if (magic_string_ex_id < lit_get_magic_string_ex_count ())
+    {
+      return ecma_get_magic_string_ex (magic_string_ex_id);
+    }
+  }
+
+  ecma_string_t *string_desc_p;
+  lit_utf8_byte_t *data_p;
+
+  if (likely (string_size <= UINT16_MAX))
+  {
+    string_desc_p = ecma_alloc_string_buffer (sizeof (ecma_string_t) + string_size);
+
+    string_desc_p->refs_and_container = ECMA_STRING_CONTAINER_HEAP_UTF8_STRING | ECMA_STRING_REF_ONE;
+    string_desc_p->u.common_uint32_field = 0;
+    string_desc_p->u.utf8_string.size = (uint16_t) string_size;
+    string_desc_p->u.utf8_string.length = (uint16_t) lit_utf8_string_length (string_p, string_size);
+
+    data_p = (lit_utf8_byte_t *) (string_desc_p + 1);
+  }
+  else
+  {
+    string_desc_p = ecma_alloc_string_buffer (sizeof (ecma_long_string_t) + string_size);
+
+    string_desc_p->refs_and_container = ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING | ECMA_STRING_REF_ONE;
+    string_desc_p->u.common_uint32_field = 0;
+    string_desc_p->u.long_utf8_string_size = string_size;
+
+    ecma_long_string_t *long_string_desc_p = (ecma_long_string_t *) string_desc_p;
+    long_string_desc_p->long_utf8_string_length = lit_utf8_string_length (string_p, string_size);
+
+    data_p = (lit_utf8_byte_t *) (long_string_desc_p + 1);
+  }
+
+  string_desc_p->hash = lit_utf8_string_calc_hash (string_p, string_size);
+  memcpy (data_p, string_p, string_size);
+  return string_desc_p;
+} /* ecma_new_ecma_string_from_utf8 */
+
+/**
+ * Allocate a new ecma-string and initialize it from the utf8 string argument.
+ * All 4-bytes long unicode sequences are converted into two 3-bytes long sequences.
+ *
+ * @return pointer to ecma-string descriptor
+ */
+ecma_string_t *
+ecma_new_ecma_string_from_utf8_converted_to_cesu8 (const lit_utf8_byte_t *string_p, /**< utf-8 string */
+                                                   lit_utf8_size_t string_size) /**< utf-8 string size */
+{
+  JERRY_ASSERT (string_p != NULL || string_size == 0);
+
+  ecma_string_t *string_desc_p = NULL;
+
+  ecma_length_t converted_string_length = 0;
+  lit_utf8_size_t converted_string_size = 0;
+  lit_utf8_size_t pos = 0;
+
+  /* Calculate the required length and size information of the converted cesu-8 encoded string */
+  while (pos < string_size)
+  {
+    if ((string_p[pos] & LIT_UTF8_1_BYTE_MASK) == LIT_UTF8_1_BYTE_MARKER)
+    {
+      pos++;
+    }
+    else if ((string_p[pos] & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER)
+    {
+      pos += 2;
+    }
+    else if ((string_p[pos] & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER)
+    {
+      pos += 3;
+    }
+    else
+    {
+      JERRY_ASSERT ((string_p[pos] & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER);
+      pos += 4;
+      converted_string_size += 2;
+      converted_string_length++;
+    }
+
+    converted_string_length++;
+  }
+
+  JERRY_ASSERT (pos == string_size);
+
+  if (converted_string_size == 0)
+  {
+    return ecma_new_ecma_string_from_utf8 (string_p, string_size);
+  }
+  else
+  {
+    converted_string_size += string_size;
+
+    JERRY_ASSERT (lit_is_valid_utf8_string (string_p, string_size));
+
+    lit_utf8_byte_t *data_p;
+
+    if (likely (string_size <= UINT16_MAX))
+    {
+      string_desc_p = ecma_alloc_string_buffer (sizeof (ecma_string_t) + converted_string_size);
+
+      string_desc_p->refs_and_container = ECMA_STRING_CONTAINER_HEAP_UTF8_STRING | ECMA_STRING_REF_ONE;
+      string_desc_p->u.common_uint32_field = 0;
+      string_desc_p->u.utf8_string.size = (uint16_t) converted_string_size;
+      string_desc_p->u.utf8_string.length = (uint16_t) converted_string_length;
+
+      data_p = (lit_utf8_byte_t *) (string_desc_p + 1);
+    }
+    else
+    {
+      string_desc_p = ecma_alloc_string_buffer (sizeof (ecma_long_string_t) + converted_string_size);
+
+      string_desc_p->refs_and_container = ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING | ECMA_STRING_REF_ONE;
+      string_desc_p->u.common_uint32_field = 0;
+      string_desc_p->u.long_utf8_string_size = converted_string_size;
+
+      ecma_long_string_t *long_string_desc_p = (ecma_long_string_t *) string_desc_p;
+      long_string_desc_p->long_utf8_string_length = converted_string_length;
+
+      data_p = (lit_utf8_byte_t *) (long_string_desc_p + 1);
+    }
+
+    const lit_utf8_byte_t *const begin_data_p = data_p;
+    pos = 0;
+
+    while (pos < string_size)
+    {
+      if ((string_p[pos] & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER)
+      {
+        /* Processing 4 byte unicode sequence. Always converted to two 3 byte long sequence. */
+        uint32_t character = ((((uint32_t) string_p[pos++]) & 0x7) << 18);
+        character |= ((((uint32_t) string_p[pos++]) & LIT_UTF8_LAST_6_BITS_MASK) << 12);
+        character |= ((((uint32_t) string_p[pos++]) & LIT_UTF8_LAST_6_BITS_MASK) << 6);
+        character |= (((uint32_t) string_p[pos++]) & LIT_UTF8_LAST_6_BITS_MASK);
+
+        JERRY_ASSERT (character >= 0x10000);
+        character -= 0x10000;
+
+        data_p += lit_char_to_utf8_bytes (data_p, (ecma_char_t) (0xd800 | (character >> 10)));
+        data_p += lit_char_to_utf8_bytes (data_p, (ecma_char_t) (0xdc00 | (character & LIT_UTF16_LAST_10_BITS_MASK)));
+      }
+      else
+      {
+        *data_p++ = string_p[pos++];
+      }
+    }
+
+    JERRY_ASSERT (pos == string_size);
+
+    string_desc_p->hash = lit_utf8_string_calc_hash (begin_data_p, converted_string_size);
+  }
+
+  return string_desc_p;
+} /* ecma_new_ecma_string_from_utf8_converted_to_cesu8 */
+
+/**
+ * Allocate new ecma-string and fill it with cesu-8 character which represents specified code unit
+ *
+ * @return pointer to ecma-string descriptor
+ */
+ecma_string_t *
+ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit) /**< code unit */
+{
+  lit_utf8_byte_t lit_utf8_bytes[LIT_UTF8_MAX_BYTES_IN_CODE_UNIT];
+  lit_utf8_size_t bytes_size = lit_code_unit_to_utf8 (code_unit, lit_utf8_bytes);
+
+  return ecma_new_ecma_string_from_utf8 (lit_utf8_bytes, bytes_size);
+} /* ecma_new_ecma_string_from_code_unit */
+
+/**
+ * Initialize an ecma-string with an ecma-number
+ */
+inline void __attr_always_inline___
+ecma_init_ecma_string_from_uint32 (ecma_string_t *string_desc_p, /**< ecma-string */
+                                   uint32_t uint32_number) /**< uint32 value of the string */
+{
+  string_desc_p->refs_and_container = ECMA_STRING_CONTAINER_UINT32_IN_DESC | ECMA_STRING_REF_ONE;
+  string_desc_p->hash = (lit_string_hash_t) uint32_number;
+
+  string_desc_p->u.uint32_number = uint32_number;
+} /* ecma_init_ecma_string_from_uint32 */
+
+/**
+ * Initialize a magic ecma-string
+ */
+void
+ecma_init_ecma_magic_string (ecma_string_t *string_desc_p, /**< ecma-string */
+                             lit_magic_string_id_t id) /**< literal id */
+{
+  string_desc_p->refs_and_container = ECMA_STRING_CONTAINER_MAGIC_STRING | ECMA_STRING_REF_ONE;
+  string_desc_p->hash = (lit_string_hash_t) id;
+
+  string_desc_p->u.magic_string_id = (uint32_t) id;
+} /* ecma_init_ecma_magic_string */
+
+/**
+ * Initialize a length ecma-string
+ */
+inline void __attr_always_inline___
+ecma_init_ecma_length_string (ecma_string_t *string_desc_p) /**< ecma-string */
+{
+  ecma_init_ecma_magic_string (string_desc_p, LIT_MAGIC_STRING_LENGTH);
+} /* ecma_init_ecma_length_string */
+
+/**
+ * Allocate new ecma-string and fill it with ecma-number
+ *
+ * @return pointer to ecma-string descriptor
+ */
+ecma_string_t *
+ecma_new_ecma_string_from_uint32 (uint32_t uint32_number) /**< uint32 value of the string */
+{
+  ecma_string_t *string_desc_p = ecma_alloc_string ();
+
+  ecma_init_ecma_string_from_uint32 (string_desc_p, uint32_number);
+  return string_desc_p;
+} /* ecma_new_ecma_string_from_uint32 */
+
+/**
+ * Allocate new ecma-string and fill it with ecma-number
+ *
+ * @return pointer to ecma-string descriptor
+ */
+ecma_string_t *
+ecma_new_ecma_string_from_number (ecma_number_t num) /**< ecma-number */
+{
+  uint32_t uint32_num = ecma_number_to_uint32 (num);
+  if (num == ((ecma_number_t) uint32_num))
+  {
+    return ecma_new_ecma_string_from_uint32 (uint32_num);
+  }
+
+  if (ecma_number_is_nan (num))
+  {
+    return ecma_get_magic_string (LIT_MAGIC_STRING_NAN);
+  }
+
+  if (ecma_number_is_infinity (num))
+  {
+    lit_magic_string_id_t id = (ecma_number_is_negative (num) ? LIT_MAGIC_STRING_NEGATIVE_INFINITY_UL
+                                                              : LIT_MAGIC_STRING_INFINITY_UL);
+    return ecma_get_magic_string (id);
+  }
+
+  lit_utf8_byte_t str_buf[ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER];
+  lit_utf8_size_t str_size = ecma_number_to_utf8_string (num, str_buf, sizeof (str_buf));
+
+  JERRY_ASSERT (str_size > 0);
+#ifndef JERRY_NDEBUG
+  JERRY_ASSERT (lit_is_utf8_string_magic (str_buf, str_size) == LIT_MAGIC_STRING__COUNT
+                && lit_is_ex_utf8_string_magic (str_buf, str_size) == lit_get_magic_string_ex_count ());
+#endif /* !JERRY_NDEBUG */
+
+  ecma_string_t *string_desc_p = ecma_alloc_string_buffer (sizeof (ecma_string_t) + str_size);
+
+  string_desc_p->refs_and_container = ECMA_STRING_CONTAINER_HEAP_UTF8_STRING | ECMA_STRING_REF_ONE;
+  string_desc_p->hash = lit_utf8_string_calc_hash (str_buf, str_size);
+  string_desc_p->u.common_uint32_field = 0;
+  string_desc_p->u.utf8_string.size = (uint16_t) str_size;
+  string_desc_p->u.utf8_string.length = (uint16_t) str_size;
+
+  lit_utf8_byte_t *data_p = (lit_utf8_byte_t *) (string_desc_p + 1);
+  memcpy (data_p, str_buf, str_size);
+  return string_desc_p;
+} /* ecma_new_ecma_string_from_number */
+
+/**
+ * Allocate new ecma-string and fill it with reference to ECMA magic string
+ *
+ * @return pointer to ecma-string descriptor
+ */
+ecma_string_t *
+ecma_new_ecma_string_from_magic_string_id (lit_magic_string_id_t id) /**< identifier of magic string */
+{
+  JERRY_ASSERT (id < LIT_MAGIC_STRING__COUNT);
+
+  ecma_string_t *string_desc_p = ecma_alloc_string ();
+  ecma_init_ecma_string_from_magic_string_id (string_desc_p, id);
+
+  return string_desc_p;
+} /* ecma_new_ecma_string_from_magic_string_id */
+
+/**
+ * Allocate new ecma-string and fill it with reference to ECMA magic string
+ *
+ * @return pointer to ecma-string descriptor
+ */
+ecma_string_t *
+ecma_new_ecma_string_from_magic_string_ex_id (lit_magic_string_ex_id_t id) /**< identifier of externl magic string */
+{
+  JERRY_ASSERT (id < lit_get_magic_string_ex_count ());
+
+  ecma_string_t *string_desc_p = ecma_alloc_string ();
+  ecma_init_ecma_string_from_magic_string_ex_id (string_desc_p, id);
+
+  return string_desc_p;
+} /* ecma_new_ecma_string_from_magic_string_ex_id */
+
+/**
+ * Allocate new ecma-string and fill it with reference to length magic string
+ *
+ * @return pointer to ecma-string descriptor
+ */
+ecma_string_t *
+ecma_new_ecma_length_string (void)
+{
+  ecma_string_t *string_desc_p = ecma_alloc_string ();
+  ecma_init_ecma_length_string (string_desc_p);
+
+  return string_desc_p;
+} /* ecma_new_ecma_length_string */
+
+/**
+ * Concatenate ecma-strings
+ *
+ * @return concatenation of two ecma-strings
+ */
+ecma_string_t *
+ecma_concat_ecma_strings (ecma_string_t *string1_p, /**< first ecma-string */
+                          ecma_string_t *string2_p) /**< second ecma-string */
+{
+  JERRY_ASSERT (string1_p != NULL
+                && string2_p != NULL);
+
+  if (ecma_string_is_empty (string1_p))
+  {
+    ecma_ref_ecma_string (string2_p);
+    return string2_p;
+  }
+  else if (ecma_string_is_empty (string2_p))
+  {
+    ecma_ref_ecma_string (string1_p);
+    return string1_p;
+  }
+
+  const lit_utf8_byte_t *utf8_string1_p, *utf8_string2_p;
+  lit_utf8_size_t utf8_string1_size, utf8_string2_size;
+  lit_utf8_size_t utf8_string1_length, utf8_string2_length;
+
+  lit_utf8_byte_t uint32_to_string_buffer1[ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32];
+  lit_utf8_byte_t uint32_to_string_buffer2[ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32];
+
+  bool string1_is_uint32 = false;
+  bool string1_rehash_needed = false;
+
+  switch (ECMA_STRING_GET_CONTAINER (string1_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      utf8_string1_p = (lit_utf8_byte_t *) (string1_p + 1);
+      utf8_string1_size = string1_p->u.utf8_string.size;
+      utf8_string1_length = string1_p->u.utf8_string.length;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      ecma_long_string_t *long_string_desc_p = (ecma_long_string_t *) string1_p;
+
+      utf8_string1_p = (lit_utf8_byte_t *) (long_string_desc_p + 1);
+      utf8_string1_size = string1_p->u.long_utf8_string_size;
+      utf8_string1_length = long_string_desc_p->long_utf8_string_length;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      utf8_string1_size = ecma_uint32_to_utf8_string (string1_p->u.uint32_number,
+                                                      uint32_to_string_buffer1,
+                                                      ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32);
+      utf8_string1_p = uint32_to_string_buffer1;
+      utf8_string1_length = utf8_string1_size;
+      string1_is_uint32 = true;
+      string1_rehash_needed = true;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      utf8_string1_p = lit_get_magic_string_utf8 (string1_p->u.magic_string_id);
+      utf8_string1_size = lit_get_magic_string_size (string1_p->u.magic_string_id);
+      utf8_string1_length = utf8_string1_size;
+      string1_rehash_needed = true;
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string1_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+
+      utf8_string1_p = lit_get_magic_string_ex_utf8 (string1_p->u.magic_string_id);
+      utf8_string1_size = lit_get_magic_string_ex_size (string1_p->u.magic_string_id);
+      utf8_string1_length = lit_utf8_string_length (utf8_string1_p, utf8_string1_size);
+      string1_rehash_needed = true;
+      break;
+    }
+  }
+
+  switch (ECMA_STRING_GET_CONTAINER (string2_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      utf8_string2_p = (lit_utf8_byte_t *) (string2_p + 1);
+      utf8_string2_size = string2_p->u.utf8_string.size;
+      utf8_string2_length = string2_p->u.utf8_string.length;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      ecma_long_string_t *long_string_desc_p = (ecma_long_string_t *) string2_p;
+
+      utf8_string2_p = (lit_utf8_byte_t *) (long_string_desc_p + 1);
+      utf8_string2_size = string2_p->u.long_utf8_string_size;
+      utf8_string2_length = long_string_desc_p->long_utf8_string_length;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      utf8_string2_size = ecma_uint32_to_utf8_string (string2_p->u.uint32_number,
+                                                      uint32_to_string_buffer2,
+                                                      ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32);
+      utf8_string2_p = uint32_to_string_buffer2;
+      utf8_string2_length = utf8_string2_size;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      utf8_string2_p = lit_get_magic_string_utf8 (string2_p->u.magic_string_id);
+      utf8_string2_size = lit_get_magic_string_size (string2_p->u.magic_string_id);
+      utf8_string2_length = utf8_string2_size;
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string2_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+
+      utf8_string2_p = lit_get_magic_string_ex_utf8 (string2_p->u.magic_string_id);
+      utf8_string2_size = lit_get_magic_string_ex_size (string2_p->u.magic_string_id);
+      utf8_string2_length = lit_utf8_string_length (utf8_string2_p, utf8_string2_size);
+      break;
+    }
+  }
+
+  JERRY_ASSERT (utf8_string1_size > 0);
+  JERRY_ASSERT (utf8_string2_size > 0);
+  JERRY_ASSERT (utf8_string1_length <= utf8_string1_size);
+  JERRY_ASSERT (utf8_string2_length <= utf8_string2_size);
+
+  lit_utf8_size_t new_size = utf8_string1_size + utf8_string2_size;
+
+  /* It is impossible to allocate this large string. */
+  if (new_size < (utf8_string1_size | utf8_string2_size))
+  {
+    jerry_fatal (ERR_OUT_OF_MEMORY);
+  }
+
+  lit_magic_string_id_t magic_string_id;
+  magic_string_id = lit_is_utf8_string_pair_magic (utf8_string1_p,
+                                                   utf8_string1_size,
+                                                   utf8_string2_p,
+                                                   utf8_string2_size);
+
+  if (magic_string_id != LIT_MAGIC_STRING__COUNT)
+  {
+    return ecma_get_magic_string (magic_string_id);
+  }
+
+  if (string1_is_uint32 && new_size <= ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32)
+  {
+    memcpy (uint32_to_string_buffer1 + utf8_string1_size,
+            utf8_string2_p,
+            utf8_string2_size);
+
+    uint32_t array_index;
+
+    if (ecma_string_to_array_index (uint32_to_string_buffer1, new_size, &array_index))
+    {
+      return ecma_new_ecma_string_from_uint32 (array_index);
+    }
+  }
+
+  if (lit_get_magic_string_ex_count () > 0)
+  {
+    lit_magic_string_ex_id_t magic_string_ex_id;
+    magic_string_ex_id = lit_is_ex_utf8_string_pair_magic (utf8_string1_p,
+                                                           utf8_string1_size,
+                                                           utf8_string2_p,
+                                                           utf8_string2_size);
+
+    if (magic_string_ex_id < lit_get_magic_string_ex_count ())
+    {
+      return ecma_get_magic_string_ex (magic_string_ex_id);
+    }
+  }
+
+  ecma_string_t *string_desc_p;
+  lit_utf8_byte_t *data_p;
+
+  if (likely (new_size <= UINT16_MAX))
+  {
+    string_desc_p = ecma_alloc_string_buffer (sizeof (ecma_string_t) + new_size);
+
+    string_desc_p->refs_and_container = ECMA_STRING_CONTAINER_HEAP_UTF8_STRING | ECMA_STRING_REF_ONE;
+    string_desc_p->u.common_uint32_field = 0;
+    string_desc_p->u.utf8_string.size = (uint16_t) new_size;
+    string_desc_p->u.utf8_string.length = (uint16_t) (utf8_string1_length + utf8_string2_length);
+
+    data_p = (lit_utf8_byte_t *) (string_desc_p + 1);
+  }
+  else
+  {
+    string_desc_p = ecma_alloc_string_buffer (sizeof (ecma_long_string_t) + new_size);
+
+    string_desc_p->refs_and_container = ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING | ECMA_STRING_REF_ONE;
+    string_desc_p->u.common_uint32_field = 0;
+    string_desc_p->u.long_utf8_string_size = new_size;
+
+    ecma_long_string_t *long_string_desc_p = (ecma_long_string_t *) string_desc_p;
+    long_string_desc_p->long_utf8_string_length = utf8_string1_length + utf8_string2_length;
+
+    data_p = (lit_utf8_byte_t *) (long_string_desc_p + 1);
+  }
+
+  lit_string_hash_t hash_start = string1_p->hash;
+
+  if (string1_rehash_needed)
+  {
+    hash_start = lit_utf8_string_calc_hash (utf8_string1_p, utf8_string1_size);
+  }
+
+  string_desc_p->hash = lit_utf8_string_hash_combine (hash_start, utf8_string2_p, utf8_string2_size);
+
+  memcpy (data_p, utf8_string1_p, utf8_string1_size);
+  memcpy (data_p + utf8_string1_size, utf8_string2_p, utf8_string2_size);
+  return string_desc_p;
+} /* ecma_concat_ecma_strings */
+
+/**
+ * Increase reference counter of ecma-string.
+ */
+void
+ecma_ref_ecma_string (ecma_string_t *string_p) /**< string descriptor */
+{
+  JERRY_ASSERT (string_p != NULL);
+  JERRY_ASSERT (string_p->refs_and_container >= ECMA_STRING_REF_ONE);
+
+  if (likely (string_p->refs_and_container < ECMA_STRING_MAX_REF))
+  {
+    /* Increase reference counter. */
+    string_p->refs_and_container = (uint16_t) (string_p->refs_and_container + ECMA_STRING_REF_ONE);
+  }
+  else
+  {
+    jerry_fatal (ERR_REF_COUNT_LIMIT);
+  }
+} /* ecma_ref_ecma_string */
+
+/**
+ * Decrease reference counter and deallocate ecma-string
+ * if the counter becomes zero.
+ */
+void
+ecma_deref_ecma_string (ecma_string_t *string_p) /**< ecma-string */
+{
+  JERRY_ASSERT (string_p != NULL);
+  JERRY_ASSERT (string_p->refs_and_container >= ECMA_STRING_REF_ONE);
+
+  /* Decrease reference counter. */
+  string_p->refs_and_container = (uint16_t) (string_p->refs_and_container - ECMA_STRING_REF_ONE);
+
+  if (string_p->refs_and_container >= ECMA_STRING_REF_ONE)
+  {
+    return;
+  }
+
+  switch (ECMA_STRING_GET_CONTAINER (string_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+#ifndef JERRY_NDEBUG
+      const lit_utf8_byte_t *chars_p = (const lit_utf8_byte_t *) (string_p + 1);
+
+      if (*chars_p >= LIT_CHAR_0 && *chars_p <= LIT_CHAR_9)
+      {
+        uint32_t array_index;
+
+        JERRY_ASSERT (!ecma_string_to_array_index (chars_p,
+                                                   string_p->u.utf8_string.size,
+                                                   &array_index));
+      }
+#endif /* !JERRY_NDEBUG */
+
+      ecma_dealloc_string_buffer (string_p, string_p->u.utf8_string.size + sizeof (ecma_string_t));
+      return;
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      JERRY_ASSERT (string_p->u.long_utf8_string_size > UINT16_MAX);
+
+      ecma_dealloc_string_buffer (string_p, string_p->u.long_utf8_string_size + sizeof (ecma_long_string_t));
+      return;
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    case ECMA_STRING_CONTAINER_MAGIC_STRING_EX:
+    {
+      /* only the string descriptor itself should be freed */
+      break;
+    }
+    case ECMA_STRING_LITERAL_NUMBER:
+    {
+      ecma_fast_free_value (string_p->u.lit_number);
+      break;
+    }
+    default:
+    {
+      JERRY_UNREACHABLE ();
+      break;
+    }
+  }
+
+  ecma_dealloc_string (string_p);
+} /* ecma_deref_ecma_string */
+
+/**
+ * Convert ecma-string to number
+ */
+ecma_number_t
+ecma_string_to_number (const ecma_string_t *str_p) /**< ecma-string */
+{
+  JERRY_ASSERT (str_p != NULL);
+
+  switch (ECMA_STRING_GET_CONTAINER (str_p))
+  {
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      return ((ecma_number_t) str_p->u.uint32_number);
+    }
+
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    case ECMA_STRING_CONTAINER_MAGIC_STRING_EX:
+    {
+      ecma_number_t num;
+
+      ECMA_STRING_TO_UTF8_STRING (str_p, str_buffer_p, str_buffer_size);
+
+      if (str_buffer_size == 0)
+      {
+        return ECMA_NUMBER_ZERO;
+      }
+
+      num = ecma_utf8_string_to_number (str_buffer_p, str_buffer_size);
+
+      ECMA_FINALIZE_UTF8_STRING (str_buffer_p, str_buffer_size);
+
+      return num;
+    }
+
+    default:
+    {
+      JERRY_UNREACHABLE ();
+    }
+  }
+} /* ecma_string_to_number */
+
+/**
+ * Check if string is array index.
+ *
+ * @return ECMA_STRING_NOT_ARRAY_INDEX if string is not array index
+ *         the array index otherwise
+ */
+inline uint32_t __attr_always_inline___
+ecma_string_get_array_index (const ecma_string_t *str_p) /**< ecma-string */
+{
+  const ecma_string_container_t type = ECMA_STRING_GET_CONTAINER (str_p);
+
+  if (type == ECMA_STRING_CONTAINER_UINT32_IN_DESC)
+  {
+    /* When the uint32_number is equal to the maximum value of 32 bit
+     * unsigned integer number, it is also an invalid array index.
+     * The comparison to ECMA_STRING_NOT_ARRAY_INDEX will be true
+     * in this case. */
+    return str_p->u.uint32_number;
+  }
+
+  return ECMA_STRING_NOT_ARRAY_INDEX;
+} /* ecma_string_get_array_index */
+
+/**
+ * Convert ecma-string's contents to a cesu-8 string and put it to the buffer.
+ * It is the caller's responsibility to make sure that the string fits in the buffer.
+ *
+ * @return number of bytes, actually copied to the buffer.
+ */
+lit_utf8_size_t __attr_return_value_should_be_checked___
+ecma_string_copy_to_cesu8_buffer (const ecma_string_t *string_desc_p, /**< ecma-string descriptor */
+                                  lit_utf8_byte_t *buffer_p, /**< destination buffer pointer
+                                                              * (can be NULL if buffer_size == 0) */
+                                  lit_utf8_size_t buffer_size) /**< size of buffer */
+{
+  JERRY_ASSERT (string_desc_p != NULL);
+  JERRY_ASSERT (string_desc_p->refs_and_container >= ECMA_STRING_REF_ONE);
+  JERRY_ASSERT (buffer_p != NULL || buffer_size == 0);
+  JERRY_ASSERT (ecma_string_get_size (string_desc_p) <= buffer_size);
+
+  lit_utf8_size_t size;
+
+  switch (ECMA_STRING_GET_CONTAINER (string_desc_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      size = string_desc_p->u.utf8_string.size;
+      memcpy (buffer_p, string_desc_p + 1, size);
+      break;
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      size = string_desc_p->u.long_utf8_string_size;
+      memcpy (buffer_p, ((ecma_long_string_t *) string_desc_p) + 1, size);
+      break;
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      const uint32_t uint32_number = string_desc_p->u.uint32_number;
+      size = ecma_uint32_to_utf8_string (uint32_number, buffer_p, buffer_size);
+      break;
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      const lit_magic_string_id_t id = string_desc_p->u.magic_string_id;
+      size = lit_get_magic_string_size (id);
+      memcpy (buffer_p, lit_get_magic_string_utf8 (id), size);
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_desc_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+
+      const lit_magic_string_ex_id_t id = string_desc_p->u.magic_string_ex_id;
+      size = lit_get_magic_string_ex_size (id);
+      memcpy (buffer_p, lit_get_magic_string_ex_utf8 (id), size);
+      break;
+    }
+  }
+
+  JERRY_ASSERT (size <= buffer_size);
+  return size;
+} /* ecma_string_copy_to_cesu8_buffer */
+
+/**
+ * Convert ecma-string's contents to an utf-8 string and put it to the buffer.
+ * It is the caller's responsibility to make sure that the string fits in the buffer.
+ *
+ * @return number of bytes, actually copied to the buffer.
+ */
+lit_utf8_size_t __attr_return_value_should_be_checked___
+ecma_string_copy_to_utf8_buffer (const ecma_string_t *string_desc_p, /**< ecma-string descriptor */
+                                 lit_utf8_byte_t *buffer_p, /**< destination buffer pointer
+                                                             * (can be NULL if buffer_size == 0) */
+                                 lit_utf8_size_t buffer_size) /**< size of buffer */
+{
+  JERRY_ASSERT (string_desc_p != NULL);
+  JERRY_ASSERT (string_desc_p->refs_and_container >= ECMA_STRING_REF_ONE);
+  JERRY_ASSERT (buffer_p != NULL || buffer_size == 0);
+  JERRY_ASSERT (ecma_string_get_utf8_size (string_desc_p) <= buffer_size);
+
+  lit_utf8_size_t size;
+
+  switch (ECMA_STRING_GET_CONTAINER (string_desc_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      size = lit_convert_cesu8_string_to_utf8_string ((lit_utf8_byte_t *) (string_desc_p + 1),
+                                                      string_desc_p->u.utf8_string.size,
+                                                      buffer_p,
+                                                      buffer_size);
+      break;
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      size = lit_convert_cesu8_string_to_utf8_string ((lit_utf8_byte_t *) (((ecma_long_string_t *) string_desc_p) + 1),
+                                                      string_desc_p->u.long_utf8_string_size,
+                                                      buffer_p,
+                                                      buffer_size);
+      break;
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      const uint32_t uint32_number = string_desc_p->u.uint32_number;
+      size = ecma_uint32_to_utf8_string (uint32_number, buffer_p, buffer_size);
+      break;
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      const lit_magic_string_id_t id = string_desc_p->u.magic_string_id;
+      size = lit_get_magic_string_size (id);
+      memcpy (buffer_p, lit_get_magic_string_utf8 (id), size);
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_desc_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+
+      const lit_magic_string_ex_id_t id = string_desc_p->u.magic_string_ex_id;
+      size = lit_convert_cesu8_string_to_utf8_string (lit_get_magic_string_ex_utf8 (id),
+                                                      lit_get_magic_string_ex_size (id),
+                                                      buffer_p,
+                                                      buffer_size);
+      break;
+    }
+  }
+
+  JERRY_ASSERT (size <= buffer_size);
+  return size;
+} /* ecma_string_copy_to_utf8_buffer */
+
+/**
+ * Convert ecma-string's contents to a cesu-8 string, extract the parts of the converted string between the specified
+ * start position and the end position (or the end of the string, whichever comes first), and copy these characters
+ * into the buffer.
+ *
+ * @return number of bytes, actually copied to the buffer.
+ */
+lit_utf8_size_t
+ecma_substring_copy_to_cesu8_buffer (const ecma_string_t *string_desc_p, /**< ecma-string descriptor */
+                                     ecma_length_t start_pos, /**< position of the first character */
+                                     ecma_length_t end_pos, /**< position of the last character */
+                                     lit_utf8_byte_t *buffer_p, /**< destination buffer pointer
+                                                                 * (can be NULL if buffer_size == 0) */
+                                     lit_utf8_size_t buffer_size) /**< size of buffer */
+{
+  JERRY_ASSERT (string_desc_p != NULL);
+  JERRY_ASSERT (string_desc_p->refs_and_container >= ECMA_STRING_REF_ONE);
+  JERRY_ASSERT (buffer_p != NULL || buffer_size == 0);
+
+  ecma_length_t string_length = ecma_string_get_length (string_desc_p);
+  lit_utf8_size_t size = 0;
+
+  if (start_pos >= string_length || start_pos >= end_pos)
+  {
+    return 0;
+  }
+
+  if (end_pos > string_length)
+  {
+    end_pos = string_length;
+  }
+
+  ECMA_STRING_TO_UTF8_STRING (string_desc_p, utf8_str_p, utf8_str_size);
+
+  const lit_utf8_byte_t *start_p = utf8_str_p;
+
+  if (string_length == utf8_str_size)
+  {
+    start_p += start_pos;
+    size = end_pos - start_pos;
+
+    if (size > buffer_size)
+    {
+      size = buffer_size;
+    }
+
+    memcpy (buffer_p, start_p, size);
+  }
+  else
+  {
+    end_pos -= start_pos;
+    while (start_pos--)
+    {
+      start_p += lit_get_unicode_char_size_by_utf8_first_byte (*start_p);
+    }
+
+    const lit_utf8_byte_t *end_p = start_p;
+
+    while (end_pos--)
+    {
+      lit_utf8_size_t code_unit_size = lit_get_unicode_char_size_by_utf8_first_byte (*end_p);
+
+      if ((size + code_unit_size) > buffer_size)
+      {
+        break;
+      }
+
+      end_p += code_unit_size;
+      size += code_unit_size;
+    }
+
+    memcpy (buffer_p, start_p, size);
+  }
+
+  ECMA_FINALIZE_UTF8_STRING (utf8_str_p, utf8_str_size);
+
+  JERRY_ASSERT (size <= buffer_size);
+  return size;
+} /* ecma_substring_copy_to_cesu8_buffer */
+
+/**
+ * Convert ecma-string's contents to an utf-8 string, extract the parts of the converted string between the specified
+ * start position and the end position (or the end of the string, whichever comes first), and copy these characters
+ * into the buffer.
+ *
+ * @return number of bytes, actually copied to the buffer.
+ */
+lit_utf8_size_t
+ecma_substring_copy_to_utf8_buffer (const ecma_string_t *string_desc_p, /**< ecma-string descriptor */
+                                    ecma_length_t start_pos, /**< position of the first character */
+                                    ecma_length_t end_pos, /**< position of the last character */
+                                    lit_utf8_byte_t *buffer_p, /**< destination buffer pointer
+                                                                * (can be NULL if buffer_size == 0) */
+                                    lit_utf8_size_t buffer_size) /**< size of buffer */
+{
+  JERRY_ASSERT (string_desc_p != NULL);
+  JERRY_ASSERT (string_desc_p->refs_and_container >= ECMA_STRING_REF_ONE);
+  JERRY_ASSERT (buffer_p != NULL || buffer_size == 0);
+
+  lit_utf8_size_t size = 0;
+
+  ecma_length_t utf8_str_length = ecma_string_get_utf8_length (string_desc_p);
+
+  if (start_pos >= utf8_str_length || start_pos >= end_pos)
+  {
+    return 0;
+  }
+
+  if (end_pos > utf8_str_length)
+  {
+    end_pos = utf8_str_length;
+  }
+
+  ECMA_STRING_TO_UTF8_STRING (string_desc_p, cesu8_str_p, cesu8_str_size);
+  ecma_length_t cesu8_str_length = ecma_string_get_length (string_desc_p);
+
+  if (cesu8_str_length == cesu8_str_size)
+  {
+    cesu8_str_p += start_pos;
+    size = end_pos - start_pos;
+
+    if (size > buffer_size)
+    {
+      size = buffer_size;
+    }
+
+    memcpy (buffer_p, cesu8_str_p, size);
+  }
+  else
+  {
+    const lit_utf8_byte_t *cesu8_end_pos = cesu8_str_p + cesu8_str_size;
+    end_pos -= start_pos;
+
+    while (start_pos--)
+    {
+      ecma_char_t ch;
+      lit_utf8_size_t code_unit_size = lit_read_code_unit_from_utf8 (cesu8_str_p, &ch);
+
+      cesu8_str_p += code_unit_size;
+      if ((cesu8_str_p != cesu8_end_pos) && lit_is_code_point_utf16_high_surrogate (ch))
+      {
+        ecma_char_t next_ch;
+        lit_utf8_size_t next_ch_size = lit_read_code_unit_from_utf8 (cesu8_str_p, &next_ch);
+        if (lit_is_code_point_utf16_low_surrogate (next_ch))
+        {
+          JERRY_ASSERT (code_unit_size == next_ch_size);
+          cesu8_str_p += code_unit_size;
+        }
+      }
+    }
+
+    const lit_utf8_byte_t *cesu8_pos = cesu8_str_p;
+
+    lit_utf8_byte_t *utf8_pos = buffer_p;
+    lit_utf8_byte_t *utf8_end_pos = buffer_p + buffer_size;
+
+    while (end_pos--)
+    {
+      ecma_char_t ch;
+      lit_utf8_size_t code_unit_size = lit_read_code_unit_from_utf8 (cesu8_pos, &ch);
+
+      if ((size + code_unit_size) > buffer_size)
+      {
+        break;
+      }
+
+      if (((cesu8_pos + code_unit_size) != cesu8_end_pos) && lit_is_code_point_utf16_high_surrogate (ch))
+      {
+        ecma_char_t next_ch;
+        lit_utf8_size_t next_ch_size = lit_read_code_unit_from_utf8 (cesu8_pos + code_unit_size, &next_ch);
+
+        if (lit_is_code_point_utf16_low_surrogate (next_ch))
+        {
+          JERRY_ASSERT (code_unit_size == next_ch_size);
+
+          if ((size + code_unit_size + 1) > buffer_size)
+          {
+            break;
+          }
+
+          cesu8_pos += next_ch_size;
+
+          lit_code_point_t code_point = lit_convert_surrogate_pair_to_code_point (ch, next_ch);
+          lit_code_point_to_utf8 (code_point, utf8_pos);
+          size += (code_unit_size + 1);
+        }
+        else
+        {
+          memcpy (utf8_pos, cesu8_pos, code_unit_size);
+          size += code_unit_size;
+        }
+      }
+      else
+      {
+        memcpy (utf8_pos, cesu8_pos, code_unit_size);
+        size += code_unit_size;
+      }
+
+      utf8_pos = buffer_p + size;
+      cesu8_pos += code_unit_size;
+    }
+
+    JERRY_ASSERT (utf8_pos <= utf8_end_pos);
+  }
+
+  ECMA_FINALIZE_UTF8_STRING (cesu8_str_p, cesu8_str_size);
+  JERRY_ASSERT (size <= buffer_size);
+
+  return size;
+} /* ecma_substring_copy_to_utf8_buffer */
+
+/**
+ * Convert ecma-string's contents to a cesu-8 string and put it to the buffer.
+ * It is the caller's responsibility to make sure that the string fits in the buffer.
+ * Check if the size of the string is equal with the size of the buffer.
+ */
+inline void __attr_always_inline___
+ecma_string_to_utf8_bytes (const ecma_string_t *string_desc_p, /**< ecma-string descriptor */
+                           lit_utf8_byte_t *buffer_p, /**< destination buffer pointer
+                                                       * (can be NULL if buffer_size == 0) */
+                           lit_utf8_size_t buffer_size) /**< size of buffer */
+{
+  const lit_utf8_size_t size = ecma_string_copy_to_cesu8_buffer (string_desc_p, buffer_p, buffer_size);
+  JERRY_ASSERT (size == buffer_size);
+} /* ecma_string_to_utf8_bytes */
+
+/**
+ * Lengths for numeric string values
+ */
+static const uint32_t nums_with_ascending_length[] =
+{
+  1u,
+  10u,
+  100u,
+  1000u,
+  10000u,
+  100000u,
+  1000000u,
+  10000000u,
+  100000000u,
+  1000000000u
+};
+
+/**
+ * Maximum length of numeric strings
+ */
+static const uint32_t max_uint32_len = (uint32_t) (sizeof (nums_with_ascending_length) / sizeof (uint32_t));
+
+/**
+ * Get size of the number stored locally in the string's descriptor
+ *
+ * Note: the represented number size and length are equal
+ *
+ * @return size in bytes
+ */
+static inline ecma_length_t __attr_always_inline___
+ecma_string_get_number_in_desc_size (const uint32_t uint32_number) /**< number in the string-descriptor */
+{
+  ecma_length_t size = 1;
+
+  while (size < max_uint32_len && uint32_number >= nums_with_ascending_length[size])
+  {
+    size++;
+  }
+  return size;
+} /* ecma_string_get_number_in_desc_size */
+
+/**
+ * Checks whether the given string is a sequence of ascii characters.
+ */
+#define ECMA_STRING_IS_ASCII(char_p, size) ((size) == lit_utf8_string_length ((char_p), (size)))
+
+/**
+ * Returns with the raw byte array of the string, if it is available.
+ *
+ * @return byte array start - if the byte array of a string is available
+ *         NULL - otherwise
+ */
+const lit_utf8_byte_t *
+ecma_string_raw_chars (const ecma_string_t *string_p, /**< ecma-string */
+                       lit_utf8_size_t *size_p, /**< [out] size of the ecma string */
+                       bool *is_ascii_p) /**< [out] true, if the string is an ascii
+                                          *               character sequence (size == length)
+                                          *         false, otherwise */
+{
+  ecma_length_t length;
+  lit_utf8_size_t size;
+  const lit_utf8_byte_t *result_p;
+
+  switch (ECMA_STRING_GET_CONTAINER (string_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      size = string_p->u.utf8_string.size;
+      length = string_p->u.utf8_string.length;
+      result_p = (const lit_utf8_byte_t *) (string_p + 1);
+      break;
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      size = string_p->u.long_utf8_string_size;
+      ecma_long_string_t *long_string_p = (ecma_long_string_t *) string_p;
+      length = long_string_p->long_utf8_string_length;
+      result_p = (const lit_utf8_byte_t *) (long_string_p + 1);
+      break;
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      size = (lit_utf8_size_t) ecma_string_get_number_in_desc_size (string_p->u.uint32_number);
+
+      /* All numbers must be ascii strings. */
+      JERRY_ASSERT (ecma_string_get_length (string_p) == size);
+
+      length = size;
+      result_p = NULL;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      size = lit_get_magic_string_size (string_p->u.magic_string_id);
+
+      length = size;
+      result_p = lit_get_magic_string_utf8 (string_p->u.magic_string_id);
+
+      /* All magic strings must be ascii strings. */
+      JERRY_ASSERT (ECMA_STRING_IS_ASCII (result_p, size));
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+
+      size = lit_get_magic_string_ex_size (string_p->u.magic_string_ex_id);
+      length = lit_utf8_string_length (lit_get_magic_string_ex_utf8 (string_p->u.magic_string_ex_id),
+                                       lit_get_magic_string_ex_size (string_p->u.magic_string_ex_id));
+
+      result_p = lit_get_magic_string_ex_utf8 (string_p->u.magic_string_ex_id);
+      break;
+    }
+  }
+
+  *size_p = size;
+  *is_ascii_p = (length == size);
+  return result_p;
+} /* ecma_string_raw_chars */
+
+/**
+ * Checks whether ecma string is empty or not
+ *
+ * @return true  - if empty
+ *         false - otherwise
+ */
+bool
+ecma_string_is_empty (const ecma_string_t *str_p) /**< ecma-string */
+{
+  return (ECMA_STRING_GET_CONTAINER (str_p) == ECMA_STRING_CONTAINER_MAGIC_STRING
+          && str_p->u.magic_string_id == LIT_MAGIC_STRING__EMPTY);
+} /* ecma_string_is_empty */
+
+/**
+ * Checks whether the string equals to "length".
+ *
+ * @return true if the string equals to "length"
+ *         false otherwise
+ */
+inline bool __attr_always_inline___
+ecma_string_is_length (const ecma_string_t *string_p) /**< property name */
+{
+  return (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_MAGIC_STRING
+          && string_p->u.magic_string_id == LIT_MAGIC_STRING_LENGTH);
+} /* ecma_string_is_length */
+
+/**
+ * Converts a string into a property name
+ *
+ * @return the compressed pointer part of the name
+ */
+inline jmem_cpointer_t __attr_always_inline___
+ecma_string_to_property_name (ecma_string_t *prop_name_p, /**< property name */
+                              ecma_property_t *name_type_p) /**< [out] property name type */
+{
+  ecma_string_container_t container = ECMA_STRING_GET_CONTAINER (prop_name_p);
+
+  switch (container)
+  {
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    case ECMA_STRING_CONTAINER_MAGIC_STRING_EX:
+    {
+#ifdef JERRY_CPOINTER_32_BIT
+
+      *name_type_p = (ecma_property_t) (container << ECMA_PROPERTY_NAME_TYPE_SHIFT);
+      return (jmem_cpointer_t) prop_name_p->u.common_uint32_field;
+
+#else /* !JERRY_CPOINTER_32_BIT */
+
+      if (prop_name_p->u.common_uint32_field < (UINT16_MAX + 1))
+      {
+        *name_type_p = (ecma_property_t) (container << ECMA_PROPERTY_NAME_TYPE_SHIFT);
+        return (jmem_cpointer_t) prop_name_p->u.common_uint32_field;
+      }
+
+#endif /* JERRY_CPOINTER_32_BIT */
+
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  *name_type_p = ECMA_PROPERTY_NAME_TYPE_STRING << ECMA_PROPERTY_NAME_TYPE_SHIFT;
+
+  ecma_ref_ecma_string (prop_name_p);
+
+  jmem_cpointer_t prop_name_cp;
+  ECMA_SET_NON_NULL_POINTER (prop_name_cp, prop_name_p);
+  return prop_name_cp;
+} /* ecma_string_to_property_name */
+
+/**
+ * Converts a property name into a string
+ *
+ * @return the string pointer
+ */
+ecma_string_t *
+ecma_string_from_property_name (ecma_property_t property, /**< property name type */
+                                jmem_cpointer_t prop_name_cp) /**< property name compressed pointer */
+{
+  /* If string_buf_p is NULL this function returns with a new string
+   * instance which needs to be released with ecma_deref_ecma_string. */
+
+  switch (ECMA_PROPERTY_GET_NAME_TYPE (property))
+  {
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      return ecma_new_ecma_string_from_uint32 ((uint32_t) prop_name_cp);
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      return ecma_new_ecma_string_from_magic_string_id ((lit_magic_string_id_t) prop_name_cp);
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING_EX:
+    {
+      return ecma_new_ecma_string_from_magic_string_ex_id ((lit_magic_string_ex_id_t) prop_name_cp);
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_PROPERTY_GET_NAME_TYPE (property) == ECMA_PROPERTY_NAME_TYPE_STRING);
+
+      ecma_string_t *prop_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t, prop_name_cp);
+      ecma_ref_ecma_string (prop_name_p);
+      return prop_name_p;
+    }
+  }
+} /* ecma_string_from_property_name */
+
+/**
+ * Get hash code of property name
+ *
+ * @return hash code of property name
+ */
+inline lit_string_hash_t __attr_always_inline___
+ecma_string_get_property_name_hash (ecma_property_t property, /**< property name type */
+                                    jmem_cpointer_t prop_name_cp) /**< property name compressed pointer */
+{
+  switch (ECMA_PROPERTY_GET_NAME_TYPE (property))
+  {
+    case ECMA_STRING_CONTAINER_MAGIC_STRING_EX:
+    {
+      return (lit_string_hash_t) (LIT_MAGIC_STRING__COUNT + prop_name_cp);
+    }
+    case ECMA_PROPERTY_NAME_TYPE_STRING:
+    {
+      ecma_string_t *prop_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t, prop_name_cp);
+      return ecma_string_hash (prop_name_p);
+    }
+    default:
+    {
+      return (lit_string_hash_t) prop_name_cp;
+    }
+  }
+} /* ecma_string_get_property_name_hash */
+
+/**
+ * Check if property name is array index.
+ *
+ * @return ECMA_STRING_NOT_ARRAY_INDEX if string is not array index
+ *         the array index otherwise
+ */
+uint32_t
+ecma_string_get_property_index (ecma_property_t property, /**< property name type */
+                                jmem_cpointer_t prop_name_cp) /**< property name compressed pointer */
+{
+  switch (ECMA_PROPERTY_GET_NAME_TYPE (property))
+  {
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      return (uint32_t) prop_name_cp;
+    }
+#ifndef JERRY_CPOINTER_32_BIT
+    case ECMA_PROPERTY_NAME_TYPE_STRING:
+    {
+      ecma_string_t *prop_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t, prop_name_cp);
+      return ecma_string_get_array_index (prop_name_p);
+    }
+#endif /* !JERRY_CPOINTER_32_BIT */
+    default:
+    {
+      return ECMA_STRING_NOT_ARRAY_INDEX;
+    }
+  }
+} /* ecma_string_get_property_index */
+
+/**
+ * Compare a property name to a string
+ *
+ * @return true if they are equals
+ *         false otherwise
+ */
+inline bool __attr_always_inline___
+ecma_string_compare_to_property_name (ecma_property_t property, /**< property name type */
+                                      jmem_cpointer_t prop_name_cp, /**< property name compressed pointer */
+                                      const ecma_string_t *string_p) /**< other string */
+{
+  uint32_t property_name_type = ECMA_PROPERTY_GET_NAME_TYPE (property);
+
+  switch (property_name_type)
+  {
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    case ECMA_STRING_CONTAINER_MAGIC_STRING_EX:
+    {
+      return (ECMA_STRING_GET_CONTAINER (string_p) == property_name_type
+              && string_p->u.common_uint32_field == (uint32_t) prop_name_cp);
+    }
+    default:
+    {
+      JERRY_ASSERT (property_name_type == ECMA_PROPERTY_NAME_TYPE_STRING);
+
+      ecma_string_t *prop_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t, prop_name_cp);
+      return ecma_compare_ecma_strings (prop_name_p, string_p);
+    }
+  }
+} /* ecma_string_compare_to_property_name */
+
+/**
+ * Long path part of ecma-string to ecma-string comparison routine
+ *
+ * See also:
+ *          ecma_compare_ecma_strings
+ *
+ * @return true - if strings are equal;
+ *         false - otherwise
+ */
+static bool __attr_noinline___
+ecma_compare_ecma_strings_longpath (const ecma_string_t *string1_p, /* ecma-string */
+                                    const ecma_string_t *string2_p) /* ecma-string */
+{
+  JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string1_p) == ECMA_STRING_GET_CONTAINER (string2_p));
+
+  const lit_utf8_byte_t *utf8_string1_p, *utf8_string2_p;
+  lit_utf8_size_t utf8_string1_size, utf8_string2_size;
+
+  if (ECMA_STRING_GET_CONTAINER (string1_p) == ECMA_STRING_CONTAINER_HEAP_UTF8_STRING)
+  {
+    utf8_string1_p = (lit_utf8_byte_t *) (string1_p + 1);
+    utf8_string1_size = string1_p->u.utf8_string.size;
+    utf8_string2_p = (lit_utf8_byte_t *) (string2_p + 1);
+    utf8_string2_size = string2_p->u.utf8_string.size;
+  }
+  else
+  {
+    JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string1_p) == ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING);
+
+    utf8_string1_p = (lit_utf8_byte_t *) (((ecma_long_string_t *) string1_p) + 1);
+    utf8_string1_size = string1_p->u.long_utf8_string_size;
+    utf8_string2_p = (lit_utf8_byte_t *) (((ecma_long_string_t *) string2_p) + 1);
+    utf8_string2_size = string2_p->u.long_utf8_string_size;
+  }
+
+  if (utf8_string1_size != utf8_string2_size)
+  {
+    return false;
+  }
+
+  return !memcmp ((char *) utf8_string1_p, (char *) utf8_string2_p, utf8_string1_size);
+} /* ecma_compare_ecma_strings_longpath */
+
+/**
+ * Compare ecma-string to ecma-string
+ *
+ * @return true - if strings are equal;
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+ecma_compare_ecma_strings (const ecma_string_t *string1_p, /* ecma-string */
+                           const ecma_string_t *string2_p) /* ecma-string */
+{
+  JERRY_ASSERT (string1_p != NULL && string2_p != NULL);
+
+  /* Fast paths first. */
+  if (string1_p == string2_p)
+  {
+    return true;
+  }
+
+  if (string1_p->hash != string2_p->hash)
+  {
+    return false;
+  }
+
+  ecma_string_container_t string1_container = ECMA_STRING_GET_CONTAINER (string1_p);
+
+  if (string1_container != ECMA_STRING_GET_CONTAINER (string2_p))
+  {
+    return false;
+  }
+
+  if (string1_container < ECMA_STRING_CONTAINER_HEAP_UTF8_STRING)
+  {
+    return string1_p->u.common_uint32_field == string2_p->u.common_uint32_field;
+  }
+
+  return ecma_compare_ecma_strings_longpath (string1_p, string2_p);
+} /* ecma_compare_ecma_strings */
+
+/**
+ * Relational compare of ecma-strings.
+ *
+ * First string is less than second string if:
+ *  - strings are not equal;
+ *  - first string is prefix of second or is lexicographically less than second.
+ *
+ * @return true - if first string is less than second string,
+ *         false - otherwise
+ */
+bool
+ecma_compare_ecma_strings_relational (const ecma_string_t *string1_p, /**< ecma-string */
+                                      const ecma_string_t *string2_p) /**< ecma-string */
+{
+  if (ecma_compare_ecma_strings (string1_p,
+                                 string2_p))
+  {
+    return false;
+  }
+
+  const lit_utf8_byte_t *utf8_string1_p, *utf8_string2_p;
+  lit_utf8_size_t utf8_string1_size, utf8_string2_size;
+
+  lit_utf8_byte_t uint32_to_string_buffer1[ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32];
+  lit_utf8_byte_t uint32_to_string_buffer2[ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32];
+
+  switch (ECMA_STRING_GET_CONTAINER (string1_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      utf8_string1_p = (lit_utf8_byte_t *) (string1_p + 1);
+      utf8_string1_size = string1_p->u.utf8_string.size;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      utf8_string1_p = (lit_utf8_byte_t *) (((ecma_long_string_t *) string1_p) + 1);
+      utf8_string1_size = string1_p->u.long_utf8_string_size;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      utf8_string1_size = ecma_uint32_to_utf8_string (string1_p->u.uint32_number,
+                                                      uint32_to_string_buffer1,
+                                                      ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32);
+      utf8_string1_p = uint32_to_string_buffer1;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      utf8_string1_p = lit_get_magic_string_utf8 (string1_p->u.magic_string_id);
+      utf8_string1_size = lit_get_magic_string_size (string1_p->u.magic_string_id);
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string1_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+
+      utf8_string1_p = lit_get_magic_string_ex_utf8 (string1_p->u.magic_string_id);
+      utf8_string1_size = lit_get_magic_string_ex_size (string1_p->u.magic_string_id);
+      break;
+    }
+  }
+
+  switch (ECMA_STRING_GET_CONTAINER (string2_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      utf8_string2_p = (lit_utf8_byte_t *) (string2_p + 1);
+      utf8_string2_size = string2_p->u.utf8_string.size;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      utf8_string2_p = (lit_utf8_byte_t *) (((ecma_long_string_t *) string2_p) + 1);
+      utf8_string2_size = string2_p->u.long_utf8_string_size;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      utf8_string2_size = ecma_uint32_to_utf8_string (string2_p->u.uint32_number,
+                                                      uint32_to_string_buffer2,
+                                                      ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32);
+      utf8_string2_p = uint32_to_string_buffer2;
+      break;
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      utf8_string2_p = lit_get_magic_string_utf8 (string2_p->u.magic_string_id);
+      utf8_string2_size = lit_get_magic_string_size (string2_p->u.magic_string_id);
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string2_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+
+      utf8_string2_p = lit_get_magic_string_ex_utf8 (string2_p->u.magic_string_id);
+      utf8_string2_size = lit_get_magic_string_ex_size (string2_p->u.magic_string_id);
+      break;
+    }
+  }
+
+  return lit_compare_utf8_strings_relational (utf8_string1_p,
+                                              utf8_string1_size,
+                                              utf8_string2_p,
+                                              utf8_string2_size);
+} /* ecma_compare_ecma_strings_relational */
+
+/**
+ * Get length of ecma-string
+ *
+ * @return number of characters in the string
+ */
+ecma_length_t
+ecma_string_get_length (const ecma_string_t *string_p) /**< ecma-string */
+{
+  switch (ECMA_STRING_GET_CONTAINER (string_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      return (ecma_length_t) (string_p->u.utf8_string.length);
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      return (ecma_length_t) (((ecma_long_string_t *) string_p)->long_utf8_string_length);
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      return ecma_string_get_number_in_desc_size (string_p->u.uint32_number);
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      JERRY_ASSERT (ECMA_STRING_IS_ASCII (lit_get_magic_string_utf8 (string_p->u.magic_string_id),
+                                          lit_get_magic_string_size (string_p->u.magic_string_id)));
+      return lit_get_magic_string_size (string_p->u.magic_string_id);
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+
+      return lit_utf8_string_length (lit_get_magic_string_ex_utf8 (string_p->u.magic_string_ex_id),
+                                     lit_get_magic_string_ex_size (string_p->u.magic_string_ex_id));
+    }
+  }
+} /* ecma_string_get_length */
+
+/**
+ * Get length of UTF-8 encoded string length from ecma-string
+ *
+ * @return number of characters in the UTF-8 encoded string
+ */
+ecma_length_t
+ecma_string_get_utf8_length (const ecma_string_t *string_p) /**< ecma-string */
+{
+  switch (ECMA_STRING_GET_CONTAINER (string_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      if (string_p->u.utf8_string.size == (lit_utf8_size_t) string_p->u.utf8_string.length)
+      {
+        return (ecma_length_t) (string_p->u.utf8_string.length);
+      }
+
+      return lit_get_utf8_length_of_cesu8_string ((const lit_utf8_byte_t *) (string_p + 1),
+                                                  (lit_utf8_size_t) string_p->u.utf8_string.size);
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      ecma_long_string_t *long_string_p = (ecma_long_string_t *) string_p;
+      if (string_p->u.long_utf8_string_size == (lit_utf8_size_t) long_string_p->long_utf8_string_length)
+      {
+        return (ecma_length_t) (long_string_p->long_utf8_string_length);
+      }
+
+      return lit_get_utf8_length_of_cesu8_string ((const lit_utf8_byte_t *) (string_p + 1),
+                                                  (lit_utf8_size_t) string_p->u.long_utf8_string_size);
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      return ecma_string_get_number_in_desc_size (string_p->u.uint32_number);
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      JERRY_ASSERT (ECMA_STRING_IS_ASCII (lit_get_magic_string_utf8 (string_p->u.magic_string_id),
+                                          lit_get_magic_string_size (string_p->u.magic_string_id)));
+      return lit_get_magic_string_size (string_p->u.magic_string_id);
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+
+      return lit_get_utf8_length_of_cesu8_string (lit_get_magic_string_ex_utf8 (string_p->u.magic_string_ex_id),
+                                                  lit_get_magic_string_ex_size (string_p->u.magic_string_ex_id));
+    }
+  }
+} /* ecma_string_get_utf8_length */
+
+/**
+ * Get size of ecma-string
+ *
+ * @return number of bytes in the buffer needed to represent the string
+ */
+lit_utf8_size_t
+ecma_string_get_size (const ecma_string_t *string_p) /**< ecma-string */
+{
+  switch (ECMA_STRING_GET_CONTAINER (string_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      return (lit_utf8_size_t) string_p->u.utf8_string.size;
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      return (lit_utf8_size_t) string_p->u.long_utf8_string_size;
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      return (lit_utf8_size_t) ecma_string_get_number_in_desc_size (string_p->u.uint32_number);
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      return lit_get_magic_string_size (string_p->u.magic_string_id);
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+      return lit_get_magic_string_ex_size (string_p->u.magic_string_ex_id);
+    }
+  }
+} /* ecma_string_get_size */
+
+/**
+ * Get the UTF-8 encoded string size from ecma-string
+ *
+ * @return number of bytes in the buffer needed to represent an UTF-8 encoded string
+ */
+lit_utf8_size_t
+ecma_string_get_utf8_size (const ecma_string_t *string_p) /**< ecma-string */
+{
+  switch (ECMA_STRING_GET_CONTAINER (string_p))
+  {
+    case ECMA_STRING_CONTAINER_HEAP_UTF8_STRING:
+    {
+      if (string_p->u.utf8_string.size == (lit_utf8_size_t) string_p->u.utf8_string.length)
+      {
+        return (lit_utf8_size_t) string_p->u.utf8_string.size;
+      }
+
+      return lit_get_utf8_size_of_cesu8_string ((const lit_utf8_byte_t *) (string_p + 1),
+                                                (lit_utf8_size_t) string_p->u.utf8_string.size);
+    }
+    case ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING:
+    {
+      ecma_long_string_t *long_string_p = (ecma_long_string_t *) string_p;
+      if (string_p->u.long_utf8_string_size == (lit_utf8_size_t) long_string_p->long_utf8_string_length)
+      {
+        return (lit_utf8_size_t) string_p->u.long_utf8_string_size;
+      }
+
+      return lit_get_utf8_size_of_cesu8_string ((const lit_utf8_byte_t *) (string_p + 1),
+                                                (lit_utf8_size_t) string_p->u.long_utf8_string_size);
+    }
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    {
+      return (lit_utf8_size_t) ecma_string_get_number_in_desc_size (string_p->u.uint32_number);
+    }
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    {
+      return lit_get_magic_string_size (string_p->u.magic_string_id);
+    }
+    default:
+    {
+      JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
+
+      return lit_get_utf8_size_of_cesu8_string (lit_get_magic_string_ex_utf8 (string_p->u.magic_string_ex_id),
+                                                lit_get_magic_string_ex_size (string_p->u.magic_string_ex_id));
+    }
+  }
+} /* ecma_string_get_utf8_size */
+
+/**
+ * Get character from specified position in the ecma-string.
+ *
+ * @return character value
+ */
+ecma_char_t
+ecma_string_get_char_at_pos (const ecma_string_t *string_p, /**< ecma-string */
+                             ecma_length_t index) /**< index of character */
+{
+  JERRY_ASSERT (index < ecma_string_get_length (string_p));
+
+  lit_utf8_size_t buffer_size;
+  bool is_ascii;
+  const lit_utf8_byte_t *chars_p = ecma_string_raw_chars (string_p, &buffer_size, &is_ascii);
+
+  if (chars_p != NULL)
+  {
+    if (is_ascii)
+    {
+      return chars_p[index];
+    }
+
+    return lit_utf8_string_code_unit_at (chars_p, buffer_size, index);
+  }
+
+  ecma_char_t ch;
+
+  JMEM_DEFINE_LOCAL_ARRAY (utf8_str_p, buffer_size, lit_utf8_byte_t);
+
+  ecma_string_to_utf8_bytes (string_p, utf8_str_p, buffer_size);
+
+  JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_UINT32_IN_DESC);
+  /* Both above must be ascii strings. */
+  JERRY_ASSERT (is_ascii);
+
+  ch = utf8_str_p[index];
+
+  JMEM_FINALIZE_LOCAL_ARRAY (utf8_str_p);
+
+  return ch;
+} /* ecma_string_get_char_at_pos */
+
+/**
+ * Get specified magic string
+ *
+ * @return ecma-string containing specified magic string
+ */
+ecma_string_t *
+ecma_get_magic_string (lit_magic_string_id_t id) /**< magic string id */
+{
+  return ecma_new_ecma_string_from_magic_string_id (id);
+} /* ecma_get_magic_string */
+
+/**
+ * Get specified external magic string
+ *
+ * @return ecma-string containing specified external magic string
+ */
+ecma_string_t *
+ecma_get_magic_string_ex (lit_magic_string_ex_id_t id) /**< external magic string id */
+{
+  return ecma_new_ecma_string_from_magic_string_ex_id (id);
+} /* ecma_get_magic_string_ex */
+
+/**
+ * Check if passed string equals to one of magic strings
+ * and if equal magic string was found, return it's id in 'out_id_p' argument.
+ *
+ * @return id - if magic string equal to passed string was found,
+ *         LIT_MAGIC_STRING__COUNT - otherwise.
+ */
+lit_magic_string_id_t
+ecma_get_string_magic (const ecma_string_t *string_p) /**< ecma-string */
+{
+  if (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_MAGIC_STRING)
+  {
+    return (lit_magic_string_id_t) string_p->u.magic_string_id;
+  }
+
+  return LIT_MAGIC_STRING__COUNT;
+} /* ecma_get_string_magic */
+
+/**
+ * Try to calculate hash of the ecma-string
+ *
+ * @return calculated hash
+ */
+lit_string_hash_t
+ecma_string_hash (const ecma_string_t *string_p) /**< ecma-string to calculate hash for */
+{
+  return (string_p->hash);
+} /* ecma_string_hash */
+
+/**
+ * Create a substring from an ecma string
+ *
+ * @return a newly consturcted ecma string with its value initialized to a copy of a substring of the first argument
+ */
+ecma_string_t *
+ecma_string_substr (const ecma_string_t *string_p, /**< pointer to an ecma string */
+                    ecma_length_t start_pos, /**< start position, should be less or equal than string length */
+                    ecma_length_t end_pos) /**< end position, should be less or equal than string length */
+{
+  const ecma_length_t string_length = ecma_string_get_length (string_p);
+  JERRY_ASSERT (start_pos <= string_length);
+  JERRY_ASSERT (end_pos <= string_length);
+
+  if (start_pos >= end_pos)
+  {
+    return ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+  }
+
+  ecma_string_t *ecma_string_p = NULL;
+  end_pos -= start_pos;
+
+  ECMA_STRING_TO_UTF8_STRING (string_p, start_p, buffer_size);
+
+  if (string_length == buffer_size)
+  {
+    ecma_string_p = ecma_new_ecma_string_from_utf8 (start_p + start_pos,
+                                                    (lit_utf8_size_t) end_pos);
+  }
+  else
+  {
+    while (start_pos--)
+    {
+      start_p += lit_get_unicode_char_size_by_utf8_first_byte (*start_p);
+    }
+
+    const lit_utf8_byte_t *end_p = start_p;
+    while (end_pos--)
+    {
+      end_p += lit_get_unicode_char_size_by_utf8_first_byte (*end_p);
+    }
+
+    ecma_string_p = ecma_new_ecma_string_from_utf8 (start_p, (lit_utf8_size_t) (end_p - start_p));
+  }
+
+  ECMA_FINALIZE_UTF8_STRING (start_p, buffer_size);
+
+  return ecma_string_p;
+} /* ecma_string_substr */
+
+/**
+ * Trim leading and trailing whitespace characters from string.
+ *
+ * @return trimmed ecma string
+ */
+ecma_string_t *
+ecma_string_trim (const ecma_string_t *string_p) /**< pointer to an ecma string */
+{
+  ecma_string_t *ret_string_p;
+
+  ECMA_STRING_TO_UTF8_STRING (string_p, utf8_str_p, utf8_str_size);
+
+  if (utf8_str_size > 0)
+  {
+    ecma_char_t ch;
+    lit_utf8_size_t read_size;
+    const lit_utf8_byte_t *nonws_start_p = utf8_str_p + utf8_str_size;
+    const lit_utf8_byte_t *current_p = utf8_str_p;
+
+    /* Trim front. */
+    while (current_p < nonws_start_p)
+    {
+      read_size = lit_read_code_unit_from_utf8 (current_p, &ch);
+
+      if (!lit_char_is_white_space (ch)
+          && !lit_char_is_line_terminator (ch))
+      {
+        nonws_start_p = current_p;
+        break;
+      }
+
+      current_p += read_size;
+    }
+
+    current_p = utf8_str_p + utf8_str_size;
+
+    /* Trim back. */
+    while (current_p > utf8_str_p)
+    {
+      read_size = lit_read_prev_code_unit_from_utf8 (current_p, &ch);
+
+      if (!lit_char_is_white_space (ch)
+          && !lit_char_is_line_terminator (ch))
+      {
+        break;
+      }
+
+      current_p -= read_size;
+    }
+
+    /* Construct new string. */
+    if (current_p > nonws_start_p)
+    {
+      ret_string_p = ecma_new_ecma_string_from_utf8 (nonws_start_p,
+                                                     (lit_utf8_size_t) (current_p - nonws_start_p));
+    }
+    else
+    {
+      ret_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+    }
+  }
+  else
+  {
+    ret_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+  }
+
+  ECMA_FINALIZE_UTF8_STRING (utf8_str_p, utf8_str_size);
+
+  return ret_string_p;
+} /* ecma_string_trim */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-helpers-value.c b/deps/jerry/jerry-core/ecma/base/ecma-helpers-value.c
new file mode 100644 (file)
index 0000000..a6626d8
--- /dev/null
@@ -0,0 +1,879 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "jrt.h"
+#include "jrt-bit-fields.h"
+#include "vm-defines.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmahelpers Helpers for operations with ECMA data types
+ * @{
+ */
+
+/**
+ * Masking the type and flags
+ */
+#define ECMA_VALUE_FULL_MASK (ECMA_VALUE_TYPE_MASK | ECMA_VALUE_ERROR_FLAG)
+
+JERRY_STATIC_ASSERT (ECMA_TYPE___MAX <= ECMA_VALUE_TYPE_MASK,
+                     ecma_types_must_be_less_than_mask);
+
+JERRY_STATIC_ASSERT ((ECMA_VALUE_FULL_MASK + 1) == (1 << ECMA_VALUE_SHIFT),
+                     ecma_value_part_must_start_after_flags);
+
+JERRY_STATIC_ASSERT (ECMA_VALUE_SHIFT <= JMEM_ALIGNMENT_LOG,
+                     ecma_value_shift_must_be_less_than_or_equal_than_mem_alignment_log);
+
+JERRY_STATIC_ASSERT (sizeof (jmem_cpointer_t) <= sizeof (ecma_value_t),
+                     size_of_jmem_cpointer_t_must_be_less_or_equal_to_the_size_of_ecma_value_t);
+
+#ifdef ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY
+
+JERRY_STATIC_ASSERT (sizeof (uintptr_t) <= sizeof (ecma_value_t),
+                     uintptr_t_must_fit_in_ecma_value_t);
+
+#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
+
+JERRY_STATIC_ASSERT (sizeof (uintptr_t) > sizeof (ecma_value_t),
+                     uintptr_t_must_not_fit_in_ecma_value_t);
+
+#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
+
+JERRY_STATIC_ASSERT ((ECMA_SIMPLE_VALUE_FALSE | 0x1) == ECMA_SIMPLE_VALUE_TRUE
+                     && ECMA_SIMPLE_VALUE_FALSE != ECMA_SIMPLE_VALUE_TRUE,
+                     only_the_lowest_bit_must_be_different_for_simple_value_true_and_false);
+
+/**
+ * Get type field of ecma value
+ *
+ * @return type field
+ */
+static inline ecma_type_t __attr_const___ __attr_always_inline___
+ecma_get_value_type_field (ecma_value_t value) /**< ecma value */
+{
+  return value & ECMA_VALUE_TYPE_MASK;
+} /* ecma_get_value_type_field */
+
+/**
+ * Convert a pointer into an ecma value.
+ *
+ * @return ecma value
+ */
+static inline ecma_value_t __attr_pure___ __attr_always_inline___
+ecma_pointer_to_ecma_value (const void *ptr) /**< pointer */
+{
+#ifdef ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY
+
+  uintptr_t uint_ptr = (uintptr_t) ptr;
+  JERRY_ASSERT ((uint_ptr & ECMA_VALUE_FULL_MASK) == 0);
+  return (ecma_value_t) uint_ptr;
+
+#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
+
+  jmem_cpointer_t ptr_cp;
+  ECMA_SET_NON_NULL_POINTER (ptr_cp, ptr);
+  return ((ecma_value_t) ptr_cp) << ECMA_VALUE_SHIFT;
+
+#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
+} /* ecma_pointer_to_ecma_value */
+
+/**
+ * Get a pointer from an ecma value
+ *
+ * @return pointer
+ */
+static inline void * __attr_pure___ __attr_always_inline___
+ecma_get_pointer_from_ecma_value (ecma_value_t value) /**< value */
+{
+#ifdef ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY
+  return (void *) (uintptr_t) ((value) & ~ECMA_VALUE_FULL_MASK);
+#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
+  return ECMA_GET_NON_NULL_POINTER (ecma_number_t,
+                                    value >> ECMA_VALUE_SHIFT);
+#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
+} /* ecma_get_pointer_from_ecma_value */
+
+/**
+ * Check if the value is direct ecma-value.
+ *
+ * @return true - if the value is a direct value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_direct (ecma_value_t value) /**< ecma value */
+{
+  return (ecma_get_value_type_field (value) == ECMA_TYPE_DIRECT);
+} /* ecma_is_value_direct */
+
+/**
+ * Check if the value is simple ecma-value.
+ *
+ * @return true - if the value is a simple value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_simple (ecma_value_t value) /**< ecma value */
+{
+  return (value & ECMA_DIRECT_TYPE_MASK) == ECMA_DIRECT_TYPE_SIMPLE_VALUE;
+} /* ecma_is_value_simple */
+
+/**
+ * Check whether the value is a given simple value.
+ *
+ * @return true - if the value is equal to the given simple value,
+ *         false - otherwise
+ */
+static inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_equal_to_simple_value (ecma_value_t value, /**< ecma value */
+                                     ecma_simple_value_t simple_value) /**< simple value */
+{
+  return (value | ECMA_VALUE_ERROR_FLAG) == (ecma_make_simple_value (simple_value) | ECMA_VALUE_ERROR_FLAG);
+} /* ecma_is_value_equal_to_simple_value */
+
+/**
+ * Check if the value is empty.
+ *
+ * @return true - if the value contains implementation-defined empty simple value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_empty (ecma_value_t value) /**< ecma value */
+{
+  return ecma_is_value_equal_to_simple_value (value, ECMA_SIMPLE_VALUE_EMPTY);
+} /* ecma_is_value_empty */
+
+/**
+ * Check if the value is undefined.
+ *
+ * @return true - if the value contains ecma-undefined simple value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_undefined (ecma_value_t value) /**< ecma value */
+{
+  return ecma_is_value_equal_to_simple_value (value, ECMA_SIMPLE_VALUE_UNDEFINED);
+} /* ecma_is_value_undefined */
+
+/**
+ * Check if the value is null.
+ *
+ * @return true - if the value contains ecma-null simple value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_null (ecma_value_t value) /**< ecma value */
+{
+  return ecma_is_value_equal_to_simple_value (value, ECMA_SIMPLE_VALUE_NULL);
+} /* ecma_is_value_null */
+
+/**
+ * Check if the value is boolean.
+ *
+ * @return true - if the value contains ecma-true or ecma-false simple values,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_boolean (ecma_value_t value) /**< ecma value */
+{
+  return ecma_is_value_true (value | (1 << ECMA_DIRECT_SHIFT));
+} /* ecma_is_value_boolean */
+
+/**
+ * Check if the value is true.
+ *
+ * @return true - if the value contains ecma-true simple value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_true (ecma_value_t value) /**< ecma value */
+{
+  return ecma_is_value_equal_to_simple_value (value, ECMA_SIMPLE_VALUE_TRUE);
+} /* ecma_is_value_true */
+
+/**
+ * Check if the value is false.
+ *
+ * @return true - if the value contains ecma-false simple value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_false (ecma_value_t value) /**< ecma value */
+{
+  return ecma_is_value_equal_to_simple_value (value, ECMA_SIMPLE_VALUE_FALSE);
+} /* ecma_is_value_false */
+
+/**
+ * Check if the value is not found.
+ *
+ * @return true - if the value contains ecma-not-found simple value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_found (ecma_value_t value) /**< ecma value */
+{
+  return value != ecma_make_simple_value (ECMA_SIMPLE_VALUE_NOT_FOUND);
+} /* ecma_is_value_found */
+
+/**
+ * Check if the value is array hole.
+ *
+ * @return true - if the value contains ecma-array-hole simple value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_array_hole (ecma_value_t value) /**< ecma value */
+{
+  return ecma_is_value_equal_to_simple_value (value, ECMA_SIMPLE_VALUE_ARRAY_HOLE);
+} /* ecma_is_value_array_hole */
+
+/**
+ * Check if the value is integer ecma-number.
+ *
+ * @return true - if the value contains an integer ecma-number value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_integer_number (ecma_value_t value) /**< ecma value */
+{
+  return (value & ECMA_DIRECT_TYPE_MASK) == ECMA_DIRECT_TYPE_INTEGER_VALUE;
+} /* ecma_is_value_integer_number */
+
+/**
+ * Check if both values are integer ecma-numbers.
+ *
+ * @return true - if both values contain integer ecma-number values,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_are_values_integer_numbers (ecma_value_t first_value, /**< first ecma value */
+                                 ecma_value_t second_value) /**< second ecma value */
+{
+  JERRY_STATIC_ASSERT (ECMA_DIRECT_TYPE_INTEGER_VALUE == 0,
+                       ecma_direct_type_integer_value_must_be_zero);
+
+  return ((first_value | second_value) & ECMA_DIRECT_TYPE_MASK) == ECMA_DIRECT_TYPE_INTEGER_VALUE;
+} /* ecma_are_values_integer_numbers */
+
+/**
+ * Check if the value is floating-point ecma-number.
+ *
+ * @return true - if the value contains a floating-point ecma-number value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_float_number (ecma_value_t value) /**< ecma value */
+{
+  return (ecma_get_value_type_field (value) == ECMA_TYPE_FLOAT);
+} /* ecma_is_value_float_number */
+
+/**
+ * Check if the value is ecma-number.
+ *
+ * @return true - if the value contains ecma-number value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_number (ecma_value_t value) /**< ecma value */
+{
+  return (ecma_is_value_integer_number (value)
+          || ecma_is_value_float_number (value));
+} /* ecma_is_value_number */
+
+/**
+ * Check if the value is ecma-string.
+ *
+ * @return true - if the value contains ecma-string value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_string (ecma_value_t value) /**< ecma value */
+{
+  return (ecma_get_value_type_field (value) == ECMA_TYPE_STRING);
+} /* ecma_is_value_string */
+
+/**
+ * Check if the value is object.
+ *
+ * @return true - if the value contains object value,
+ *         false - otherwise
+ */
+inline bool __attr_const___ __attr_always_inline___
+ecma_is_value_object (ecma_value_t value) /**< ecma value */
+{
+  return (ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT);
+} /* ecma_is_value_object */
+
+/**
+ * Debug assertion that specified value's type is one of ECMA-defined
+ * script-visible types, i.e.: undefined, null, boolean, number, string, object.
+ */
+void
+ecma_check_value_type_is_spec_defined (ecma_value_t value) /**< ecma value */
+{
+  JERRY_ASSERT (ecma_is_value_undefined (value)
+                || ecma_is_value_null (value)
+                || ecma_is_value_boolean (value)
+                || ecma_is_value_number (value)
+                || ecma_is_value_string (value)
+                || ecma_is_value_object (value));
+} /* ecma_check_value_type_is_spec_defined */
+
+/**
+ * Simple value constructor
+ */
+inline ecma_value_t __attr_const___ __attr_always_inline___
+ecma_make_simple_value (const ecma_simple_value_t simple_value) /**< simple value */
+{
+  return (((ecma_value_t) (simple_value)) << ECMA_DIRECT_SHIFT) | ECMA_DIRECT_TYPE_SIMPLE_VALUE;
+} /* ecma_make_simple_value */
+
+/**
+ * Creates an ecma value from the given raw boolean.
+ *
+ * @return boolean ecma_value
+ */
+inline ecma_value_t __attr_const___ __attr_always_inline___
+ecma_make_boolean_value (bool boolean_value) /**< raw bool value from which the ecma value will be created */
+{
+  return ecma_make_simple_value (boolean_value ? ECMA_SIMPLE_VALUE_TRUE
+                                               : ECMA_SIMPLE_VALUE_FALSE);
+} /* ecma_make_boolean_value */
+
+/**
+ * Encode an integer number into an ecma-value without allocating memory
+ *
+ * Note:
+ *   The value must fit into the range of allowed ecma integer values
+ *
+ * @return ecma-value
+ */
+inline ecma_value_t __attr_const___ __attr_always_inline___
+ecma_make_integer_value (ecma_integer_value_t integer_value) /**< integer number to be encoded */
+{
+  JERRY_ASSERT (ECMA_IS_INTEGER_NUMBER (integer_value));
+
+  return (((ecma_value_t) integer_value) << ECMA_DIRECT_SHIFT) | ECMA_DIRECT_TYPE_INTEGER_VALUE;
+} /* ecma_make_integer_value */
+
+/**
+ * Allocate and initialize a new float number without checks.
+ *
+ * @return ecma-value
+ */
+static ecma_value_t
+ecma_create_float_number (ecma_number_t ecma_number) /**< value of the float number */
+{
+  ecma_number_t *ecma_num_p = ecma_alloc_number ();
+
+  *ecma_num_p = ecma_number;
+
+  return ecma_pointer_to_ecma_value (ecma_num_p) | ECMA_TYPE_FLOAT;
+} /* ecma_create_float_number */
+
+/**
+ * Create a new NaN value.
+ *
+ * @return ecma-value
+ */
+inline ecma_value_t __attr_always_inline___
+ecma_make_nan_value (void)
+{
+  return ecma_create_float_number (ecma_number_make_nan ());
+} /* ecma_make_nan_value */
+
+/**
+ * Checks whether the passed number is +0.0
+ *
+ * @return true, if it is +0.0, false otherwise
+ */
+static inline bool __attr_const___ __attr_always_inline___
+ecma_is_number_equal_to_positive_zero (ecma_number_t ecma_number) /**< number */
+{
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
+  union
+  {
+    uint32_t u32_value;
+    ecma_number_t float_value;
+  } u;
+
+  u.float_value = ecma_number;
+
+  return u.u32_value == 0;
+#else /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 */
+  union
+  {
+    uint64_t u64_value;
+    ecma_number_t float_value;
+  } u;
+
+  u.float_value = ecma_number;
+
+  return u.u64_value == 0;
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
+} /* ecma_is_number_equal_to_positive_zero */
+
+/**
+ * Encode a number into an ecma-value
+ *
+ * @return ecma-value
+ */
+ecma_value_t
+ecma_make_number_value (ecma_number_t ecma_number) /**< number to be encoded */
+{
+  ecma_integer_value_t integer_value = (ecma_integer_value_t) ecma_number;
+
+  if ((ecma_number_t) integer_value == ecma_number
+      && ((integer_value == 0) ? ecma_is_number_equal_to_positive_zero (ecma_number)
+                               : ECMA_IS_INTEGER_NUMBER (integer_value)))
+  {
+    return ecma_make_integer_value (integer_value);
+  }
+
+  return ecma_create_float_number (ecma_number);
+} /* ecma_make_number_value */
+
+/**
+ * Encode an int32 number into an ecma-value
+ *
+ * @return ecma-value
+ */
+ecma_value_t
+ecma_make_int32_value (int32_t int32_number) /**< int32 number to be encoded */
+{
+  if (ECMA_IS_INTEGER_NUMBER (int32_number))
+  {
+    return ecma_make_integer_value ((ecma_integer_value_t) int32_number);
+  }
+
+  return ecma_create_float_number ((ecma_number_t) int32_number);
+} /* ecma_make_int32_value */
+
+/**
+ * Encode an unsigned int32 number into an ecma-value
+ *
+ * @return ecma-value
+ */
+ecma_value_t
+ecma_make_uint32_value (uint32_t uint32_number) /**< uint32 number to be encoded */
+{
+  if (uint32_number <= ECMA_INTEGER_NUMBER_MAX)
+  {
+    return ecma_make_integer_value ((ecma_integer_value_t) uint32_number);
+  }
+
+  return ecma_create_float_number ((ecma_number_t) uint32_number);
+} /* ecma_make_uint32_value */
+
+/**
+ * String value constructor
+ */
+ecma_value_t __attr_pure___
+ecma_make_string_value (const ecma_string_t *ecma_string_p) /**< string to reference in value */
+{
+  JERRY_ASSERT (ecma_string_p != NULL);
+
+  return ecma_pointer_to_ecma_value (ecma_string_p) | ECMA_TYPE_STRING;
+} /* ecma_make_string_value */
+
+/**
+ * Object value constructor
+ */
+ecma_value_t __attr_pure___
+ecma_make_object_value (const ecma_object_t *object_p) /**< object to reference in value */
+{
+  JERRY_ASSERT (object_p != NULL);
+
+  return ecma_pointer_to_ecma_value (object_p) | ECMA_TYPE_OBJECT;
+} /* ecma_make_object_value */
+
+/**
+ * Error value constructor
+ */
+ecma_value_t __attr_const___
+ecma_make_error_value (ecma_value_t value) /**< original ecma value */
+{
+  /* Error values cannot be converted. */
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (value));
+
+  return value | ECMA_VALUE_ERROR_FLAG;
+} /* ecma_make_error_value */
+
+/**
+ * Error value constructor
+ */
+ecma_value_t __attr_pure___
+ecma_make_error_obj_value (const ecma_object_t *object_p) /**< object to reference in value */
+{
+  return ecma_make_error_value (ecma_make_object_value (object_p));
+} /* ecma_make_error_obj_value */
+
+/**
+ * Get integer value from an integer ecma value
+ *
+ * @return floating point value
+ */
+inline ecma_integer_value_t __attr_const___ __attr_always_inline___
+ecma_get_integer_from_value (ecma_value_t value) /**< ecma value */
+{
+  JERRY_ASSERT (ecma_is_value_integer_number (value));
+
+  return ((ecma_integer_value_t) value) >> ECMA_DIRECT_SHIFT;
+} /* ecma_get_integer_from_value */
+
+inline ecma_number_t __attr_pure___ __attr_always_inline___
+ecma_get_float_from_value (ecma_value_t value) /**< ecma value */
+{
+  JERRY_ASSERT (ecma_get_value_type_field (value) == ECMA_TYPE_FLOAT);
+
+  return *(ecma_number_t *) ecma_get_pointer_from_ecma_value (value);
+} /* ecma_get_float_from_value */
+
+/**
+ * Get floating point value from an ecma value
+ *
+ * @return floating point value
+ */
+ecma_number_t __attr_pure___
+ecma_get_number_from_value (ecma_value_t value) /**< ecma value */
+{
+  if (ecma_is_value_integer_number (value))
+  {
+    return (ecma_number_t) ecma_get_integer_from_value (value);
+  }
+
+  return ecma_get_float_from_value (value);
+} /* ecma_get_number_from_value */
+
+/**
+ * Get pointer to ecma-string from ecma value
+ *
+ * @return the pointer
+ */
+inline ecma_string_t *__attr_pure___ __attr_always_inline___
+ecma_get_string_from_value (ecma_value_t value) /**< ecma value */
+{
+  JERRY_ASSERT (ecma_get_value_type_field (value) == ECMA_TYPE_STRING);
+
+  return (ecma_string_t *) ecma_get_pointer_from_ecma_value (value);
+} /* ecma_get_string_from_value */
+
+/**
+ * Get pointer to ecma-object from ecma value
+ *
+ * @return the pointer
+ */
+inline ecma_object_t *__attr_pure___ __attr_always_inline___
+ecma_get_object_from_value (ecma_value_t value) /**< ecma value */
+{
+  JERRY_ASSERT (ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT);
+
+  return (ecma_object_t *) ecma_get_pointer_from_ecma_value (value);
+} /* ecma_get_object_from_value */
+
+/**
+ * Invert a boolean value
+ *
+ * @return ecma value
+ */
+inline ecma_value_t __attr_const___ __attr_always_inline___
+ecma_invert_boolean_value (ecma_value_t value) /**< ecma value */
+{
+  JERRY_ASSERT (ecma_is_value_boolean (value));
+
+  return (value ^ (1 << ECMA_DIRECT_SHIFT));
+} /* ecma_invert_boolean_value */
+
+/**
+ * Get the value from an error ecma value
+ *
+ * @return ecma value
+ */
+ecma_value_t __attr_const___
+ecma_get_value_from_error_value (ecma_value_t value) /**< ecma value */
+{
+  JERRY_ASSERT (ECMA_IS_VALUE_ERROR (value));
+
+  value = (ecma_value_t) (value & ~ECMA_VALUE_ERROR_FLAG);
+
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (value));
+
+  return value;
+} /* ecma_get_value_from_error_value */
+
+/**
+ * Copy ecma value.
+ *
+ * @return copy of the given value
+ */
+ecma_value_t
+ecma_copy_value (ecma_value_t value)  /**< value description */
+{
+  switch (ecma_get_value_type_field (value))
+  {
+    case ECMA_TYPE_DIRECT:
+    {
+      return value;
+    }
+    case ECMA_TYPE_FLOAT:
+    {
+      ecma_number_t *num_p = (ecma_number_t *) ecma_get_pointer_from_ecma_value (value);
+
+      return ecma_create_float_number (*num_p);
+    }
+    case ECMA_TYPE_STRING:
+    {
+      ecma_ref_ecma_string (ecma_get_string_from_value (value));
+      return value;
+    }
+    case ECMA_TYPE_OBJECT:
+    {
+      ecma_ref_object (ecma_get_object_from_value (value));
+      return value;
+    }
+  }
+
+  JERRY_UNREACHABLE ();
+} /* ecma_copy_value */
+
+/**
+ * Copy ecma value.
+ *
+ * Note:
+ *   this function is similar to ecma_copy_value, but it is
+ *   faster for direct values since no function call is performed.
+ *   It also increases the binary size so it is recommended for
+ *   critical code paths only.
+ *
+ * @return copy of the given value
+ */
+inline ecma_value_t __attr_always_inline___
+ecma_fast_copy_value (ecma_value_t value)  /**< value description */
+{
+  return (ecma_get_value_type_field (value) == ECMA_TYPE_DIRECT) ? value : ecma_copy_value (value);
+} /* ecma_fast_copy_value */
+
+/**
+ * Copy the ecma value if not an object
+ *
+ * @return copy of the given value
+ */
+ecma_value_t
+ecma_copy_value_if_not_object (ecma_value_t value) /**< value description */
+{
+  if (ecma_get_value_type_field (value) != ECMA_TYPE_OBJECT)
+  {
+    return ecma_copy_value (value);
+  }
+
+  return value;
+} /* ecma_copy_value_if_not_object */
+
+/**
+ * Assign a new value to an ecma-value
+ *
+ * Note:
+ *      value previously stored in the property is freed
+ */
+void
+ecma_value_assign_value (ecma_value_t *value_p, /**< [in, out] ecma value */
+                         ecma_value_t ecma_value) /**< value to assign */
+{
+  JERRY_STATIC_ASSERT (ECMA_TYPE_DIRECT == 0,
+                       ecma_type_direct_must_be_zero_for_the_next_check);
+
+  if (*value_p == ecma_value)
+  {
+    return;
+  }
+
+  if (ecma_get_value_type_field (ecma_value || *value_p) == ECMA_TYPE_DIRECT)
+  {
+    *value_p = ecma_value;
+  }
+  else if (ecma_is_value_float_number (ecma_value)
+           && ecma_is_value_float_number (*value_p))
+  {
+    const ecma_number_t *num_src_p = (ecma_number_t *) ecma_get_pointer_from_ecma_value (ecma_value);
+    ecma_number_t *num_dst_p = (ecma_number_t *) ecma_get_pointer_from_ecma_value (*value_p);
+
+    *num_dst_p = *num_src_p;
+  }
+  else
+  {
+    ecma_free_value_if_not_object (*value_p);
+    *value_p = ecma_copy_value_if_not_object (ecma_value);
+  }
+} /* ecma_value_assign_value */
+
+/**
+ * Update the value of a float number to a new value
+ *
+ * Note:
+ *   The original value is destroyed.
+ *
+ * @return updated ecma value
+ */
+ecma_value_t
+ecma_update_float_number (ecma_value_t float_value, /**< original float value */
+                          ecma_number_t new_number) /**< updated number value */
+{
+  JERRY_ASSERT (ecma_is_value_float_number (float_value));
+
+  ecma_integer_value_t integer_number = (ecma_integer_value_t) new_number;
+  ecma_number_t *number_p = (ecma_number_t *) ecma_get_pointer_from_ecma_value (float_value);
+
+  if ((ecma_number_t) integer_number == new_number
+      && ((integer_number == 0) ? ecma_is_number_equal_to_positive_zero (new_number)
+                                : ECMA_IS_INTEGER_NUMBER (integer_number)))
+  {
+    ecma_dealloc_number (number_p);
+    return ecma_make_integer_value (integer_number);
+  }
+
+  *number_p = new_number;
+  return float_value;
+} /* ecma_update_float_number */
+
+/**
+ * Assign a float number to an ecma-value
+ *
+ * Note:
+ *      value previously stored in the property is freed
+ */
+static void
+ecma_value_assign_float_number (ecma_value_t *value_p, /**< [in, out] ecma value */
+                                ecma_number_t ecma_number) /**< number to assign */
+{
+  if (ecma_is_value_float_number (*value_p))
+  {
+    ecma_number_t *num_dst_p = (ecma_number_t *) ecma_get_pointer_from_ecma_value (*value_p);
+
+    *num_dst_p = ecma_number;
+    return;
+  }
+
+  if (ecma_get_value_type_field (*value_p) != ECMA_TYPE_DIRECT
+      && ecma_get_value_type_field (*value_p) != ECMA_TYPE_OBJECT)
+  {
+    ecma_free_value (*value_p);
+  }
+
+  *value_p = ecma_create_float_number (ecma_number);
+} /* ecma_value_assign_float_number */
+
+/**
+ * Assign a number to an ecma-value
+ *
+ * Note:
+ *      value previously stored in the property is freed
+ */
+void
+ecma_value_assign_number (ecma_value_t *value_p, /**< [in, out] ecma value */
+                          ecma_number_t ecma_number) /**< number to assign */
+{
+  ecma_integer_value_t integer_value = (ecma_integer_value_t) ecma_number;
+
+  if ((ecma_number_t) integer_value == ecma_number
+      && ((integer_value == 0) ? ecma_is_number_equal_to_positive_zero (ecma_number)
+                               : ECMA_IS_INTEGER_NUMBER (integer_value)))
+  {
+    if (ecma_get_value_type_field (*value_p) != ECMA_TYPE_DIRECT
+        && ecma_get_value_type_field (*value_p) != ECMA_TYPE_OBJECT)
+    {
+      ecma_free_value (*value_p);
+    }
+    *value_p = ecma_make_integer_value (integer_value);
+    return;
+  }
+
+  ecma_value_assign_float_number (value_p, ecma_number);
+} /* ecma_value_assign_number */
+
+/**
+ * Free the ecma value
+ */
+void
+ecma_free_value (ecma_value_t value) /**< value description */
+{
+  switch (ecma_get_value_type_field (value))
+  {
+    case ECMA_TYPE_DIRECT:
+    {
+      /* no memory is allocated */
+      break;
+    }
+
+    case ECMA_TYPE_FLOAT:
+    {
+      ecma_number_t *number_p = (ecma_number_t *) ecma_get_pointer_from_ecma_value (value);
+      ecma_dealloc_number (number_p);
+      break;
+    }
+
+    case ECMA_TYPE_STRING:
+    {
+      ecma_string_t *string_p = ecma_get_string_from_value (value);
+      ecma_deref_ecma_string (string_p);
+      break;
+    }
+
+    case ECMA_TYPE_OBJECT:
+    {
+      ecma_deref_object (ecma_get_object_from_value (value));
+      break;
+    }
+  }
+} /* ecma_free_value */
+
+/**
+ * Free the ecma value
+ *
+ * Note:
+ *   this function is similar to ecma_free_value, but it is
+ *   faster for direct values since no function call is performed.
+ *   It also increases the binary size so it is recommended for
+ *   critical code paths only.
+ */
+inline void __attr_always_inline___
+ecma_fast_free_value (ecma_value_t value) /**< value description */
+{
+  if (ecma_get_value_type_field (value) != ECMA_TYPE_DIRECT)
+  {
+    ecma_free_value (value);
+  }
+} /* ecma_fast_free_value */
+
+/**
+ * Free the ecma value if not an object
+ */
+void
+ecma_free_value_if_not_object (ecma_value_t value) /**< value description */
+{
+  if (ecma_get_value_type_field (value) != ECMA_TYPE_OBJECT)
+  {
+    ecma_free_value (value);
+  }
+} /* ecma_free_value_if_not_object */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-helpers-values-collection.c b/deps/jerry/jerry-core/ecma/base/ecma-helpers-values-collection.c
new file mode 100644 (file)
index 0000000..afc564e
--- /dev/null
@@ -0,0 +1,373 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "jrt.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmahelpers Helpers for operations with ECMA data types
+ * @{
+ */
+
+/**
+ * Allocate a collection of ecma values.
+ *
+ * @return pointer to the collection's header
+ */
+ecma_collection_header_t *
+ecma_new_values_collection (const ecma_value_t values_buffer[], /**< ecma values */
+                            ecma_length_t values_number, /**< number of ecma values */
+                            bool do_ref_if_object) /**< if the value is object value,
+                                                        increase reference counter of the object */
+{
+  JERRY_ASSERT (values_buffer != NULL || values_number == 0);
+
+  const size_t values_in_chunk = JERRY_SIZE_OF_STRUCT_MEMBER (ecma_collection_chunk_t, data) / sizeof (ecma_value_t);
+
+  ecma_collection_header_t *header_p = ecma_alloc_collection_header ();
+
+  header_p->unit_number = values_number;
+
+  jmem_cpointer_t *next_chunk_cp_p = &header_p->first_chunk_cp;
+  ecma_collection_chunk_t *last_chunk_p = NULL;
+  ecma_value_t *cur_value_buf_iter_p = NULL;
+  ecma_value_t *cur_value_buf_end_p = NULL;
+
+  for (ecma_length_t value_index = 0;
+       value_index < values_number;
+       value_index++)
+  {
+    if (cur_value_buf_iter_p == cur_value_buf_end_p)
+    {
+      ecma_collection_chunk_t *chunk_p = ecma_alloc_collection_chunk ();
+      ECMA_SET_POINTER (*next_chunk_cp_p, chunk_p);
+      next_chunk_cp_p = &chunk_p->next_chunk_cp;
+
+      cur_value_buf_iter_p = (ecma_value_t *) chunk_p->data;
+      cur_value_buf_end_p = cur_value_buf_iter_p + values_in_chunk;
+
+      last_chunk_p = chunk_p;
+    }
+
+    JERRY_ASSERT (cur_value_buf_iter_p + 1 <= cur_value_buf_end_p);
+
+    if (do_ref_if_object)
+    {
+      *cur_value_buf_iter_p++ = ecma_copy_value (values_buffer[value_index]);
+    }
+    else
+    {
+      *cur_value_buf_iter_p++ = ecma_copy_value_if_not_object (values_buffer[value_index]);
+    }
+  }
+
+  *next_chunk_cp_p = ECMA_NULL_POINTER;
+  ECMA_SET_POINTER (header_p->last_chunk_cp, last_chunk_p);
+
+  return header_p;
+} /* ecma_new_values_collection */
+
+/**
+ * Free the collection of ecma values.
+ */
+void
+ecma_free_values_collection (ecma_collection_header_t *header_p, /**< collection's header */
+                             bool do_deref_if_object) /**< if the value is object value,
+                                                           decrement reference counter of the object */
+{
+  JERRY_ASSERT (header_p != NULL);
+
+  const size_t values_in_chunk = JERRY_SIZE_OF_STRUCT_MEMBER (ecma_collection_chunk_t, data) / sizeof (ecma_value_t);
+
+  ecma_collection_chunk_t *chunk_p = ECMA_GET_POINTER (ecma_collection_chunk_t,
+                                                       header_p->first_chunk_cp);
+  ecma_length_t value_index = 0;
+
+  while (chunk_p != NULL)
+  {
+    JERRY_ASSERT (value_index < header_p->unit_number);
+
+    ecma_value_t *cur_value_buf_iter_p = (ecma_value_t *) chunk_p->data;
+    ecma_value_t *cur_value_buf_end_p = cur_value_buf_iter_p + values_in_chunk;
+
+    while (cur_value_buf_iter_p != cur_value_buf_end_p
+           && value_index < header_p->unit_number)
+    {
+      JERRY_ASSERT (cur_value_buf_iter_p < cur_value_buf_end_p);
+
+      if (do_deref_if_object)
+      {
+        ecma_free_value (*cur_value_buf_iter_p);
+      }
+      else
+      {
+        ecma_free_value_if_not_object (*cur_value_buf_iter_p);
+      }
+
+      cur_value_buf_iter_p++;
+      value_index++;
+    }
+
+    ecma_collection_chunk_t *next_chunk_p = ECMA_GET_POINTER (ecma_collection_chunk_t,
+                                                              chunk_p->next_chunk_cp);
+    ecma_dealloc_collection_chunk (chunk_p);
+    chunk_p = next_chunk_p;
+  }
+
+  ecma_dealloc_collection_header (header_p);
+} /* ecma_free_values_collection */
+
+/**
+ * Append new value to ecma values collection
+ */
+void
+ecma_append_to_values_collection (ecma_collection_header_t *header_p, /**< collection's header */
+                                  ecma_value_t v, /**< ecma value to append */
+                                  bool do_ref_if_object) /**< if the value is object value,
+                                                              increase reference counter of the object */
+{
+  const size_t values_in_chunk = JERRY_SIZE_OF_STRUCT_MEMBER (ecma_collection_chunk_t, data) / sizeof (ecma_value_t);
+
+  size_t values_number = header_p->unit_number;
+  size_t pos_of_new_value_in_chunk = values_number % values_in_chunk;
+
+  values_number++;
+
+  if ((ecma_length_t) values_number == values_number)
+  {
+    header_p->unit_number = (ecma_length_t) values_number;
+  }
+  else
+  {
+    jerry_fatal (ERR_OUT_OF_MEMORY);
+  }
+
+  ecma_collection_chunk_t *chunk_p = ECMA_GET_POINTER (ecma_collection_chunk_t,
+                                                       header_p->last_chunk_cp);
+
+  if (pos_of_new_value_in_chunk == 0)
+  {
+    /* all chunks are currently filled with values */
+
+    chunk_p = ecma_alloc_collection_chunk ();
+    chunk_p->next_chunk_cp = ECMA_NULL_POINTER;
+
+    if (header_p->last_chunk_cp == ECMA_NULL_POINTER)
+    {
+      JERRY_ASSERT (header_p->first_chunk_cp == ECMA_NULL_POINTER);
+
+      ECMA_SET_NON_NULL_POINTER (header_p->first_chunk_cp, chunk_p);
+    }
+    else
+    {
+      ecma_collection_chunk_t *last_chunk_p = ECMA_GET_NON_NULL_POINTER (ecma_collection_chunk_t,
+                                                                         header_p->last_chunk_cp);
+
+      JERRY_ASSERT (last_chunk_p->next_chunk_cp == ECMA_NULL_POINTER);
+
+      ECMA_SET_NON_NULL_POINTER (last_chunk_p->next_chunk_cp, chunk_p);
+    }
+
+    ECMA_SET_NON_NULL_POINTER (header_p->last_chunk_cp, chunk_p);
+  }
+  else
+  {
+    /* last chunk can be appended with the new value */
+    JERRY_ASSERT (chunk_p != NULL);
+  }
+
+  ecma_value_t *values_p = (ecma_value_t *) chunk_p->data;
+
+  JERRY_ASSERT ((uint8_t *) (values_p + pos_of_new_value_in_chunk + 1) <= (uint8_t *) (chunk_p + 1));
+
+  if (do_ref_if_object)
+  {
+    values_p[pos_of_new_value_in_chunk] = ecma_copy_value (v);
+  }
+  else
+  {
+    values_p[pos_of_new_value_in_chunk] = ecma_copy_value_if_not_object (v);
+  }
+} /* ecma_append_to_values_collection */
+
+/**
+ * Remove last element of the collection
+ *
+ * Warning:
+ *         the function invalidates all iterators that are configured to access the passed collection
+ */
+void
+ecma_remove_last_value_from_values_collection (ecma_collection_header_t *header_p) /**< collection's header */
+{
+  JERRY_ASSERT (header_p != NULL && header_p->unit_number > 0);
+
+  const size_t values_in_chunk = JERRY_SIZE_OF_STRUCT_MEMBER (ecma_collection_chunk_t, data) / sizeof (ecma_value_t);
+  size_t values_number = header_p->unit_number;
+  size_t pos_of_value_to_remove_in_chunk = (values_number - 1u) % values_in_chunk;
+
+  ecma_collection_chunk_t *last_chunk_p = ECMA_GET_NON_NULL_POINTER (ecma_collection_chunk_t,
+                                                                     header_p->last_chunk_cp);
+
+  ecma_value_t *values_p = (ecma_value_t *) last_chunk_p->data;
+  JERRY_ASSERT ((uint8_t *) (values_p + pos_of_value_to_remove_in_chunk + 1) <= (uint8_t *) (last_chunk_p + 1));
+
+  ecma_value_t value_to_remove = values_p[pos_of_value_to_remove_in_chunk];
+
+  ecma_free_value (value_to_remove);
+
+  header_p->unit_number--;
+
+  if (pos_of_value_to_remove_in_chunk == 0)
+  {
+    ecma_collection_chunk_t *chunk_to_remove_p = last_chunk_p;
+
+    /* free last chunk */
+    if (header_p->first_chunk_cp == header_p->last_chunk_cp)
+    {
+      header_p->first_chunk_cp = ECMA_NULL_POINTER;
+      header_p->last_chunk_cp = ECMA_NULL_POINTER;
+    }
+    else
+    {
+      ecma_collection_chunk_t *chunk_iter_p = ECMA_GET_NON_NULL_POINTER (ecma_collection_chunk_t,
+                                                                         header_p->first_chunk_cp);
+
+      while (chunk_iter_p->next_chunk_cp != header_p->last_chunk_cp)
+      {
+        chunk_iter_p = ECMA_GET_NON_NULL_POINTER (ecma_collection_chunk_t,
+                                                  chunk_iter_p->next_chunk_cp);
+      }
+
+      ecma_collection_chunk_t *new_last_chunk_p = chunk_iter_p;
+
+      JERRY_ASSERT (ECMA_GET_NON_NULL_POINTER (ecma_collection_chunk_t,
+                                               new_last_chunk_p->next_chunk_cp) == chunk_to_remove_p);
+
+      ECMA_SET_NON_NULL_POINTER (header_p->last_chunk_cp, new_last_chunk_p);
+      new_last_chunk_p->next_chunk_cp = ECMA_NULL_POINTER;
+    }
+
+    ecma_dealloc_collection_chunk (chunk_to_remove_p);
+  }
+} /* ecma_remove_last_value_from_values_collection */
+
+/**
+ * Allocate a collection of ecma-strings.
+ *
+ * @return pointer to the collection's header
+ */
+ecma_collection_header_t *
+ecma_new_strings_collection (ecma_string_t *string_ptrs_buffer[], /**< pointers to ecma-strings */
+                             ecma_length_t strings_number) /**< number of ecma-strings */
+{
+  JERRY_ASSERT (string_ptrs_buffer != NULL || strings_number == 0);
+
+  ecma_collection_header_t *new_collection_p;
+
+  new_collection_p = ecma_new_values_collection (NULL, 0, false);
+
+  for (ecma_length_t string_index = 0;
+       string_index < strings_number;
+       string_index++)
+  {
+    ecma_append_to_values_collection (new_collection_p,
+                                      ecma_make_string_value (string_ptrs_buffer[string_index]),
+                                      false);
+  }
+
+  return new_collection_p;
+} /* ecma_new_strings_collection */
+
+/**
+ * Initialize new collection iterator for the collection
+ */
+void
+ecma_collection_iterator_init (ecma_collection_iterator_t *iterator_p, /**< context of iterator */
+                               ecma_collection_header_t *collection_p) /**< header of collection */
+{
+  iterator_p->header_p = collection_p;
+  iterator_p->next_chunk_cp = (collection_p != NULL ? collection_p->first_chunk_cp : JMEM_CP_NULL);
+  iterator_p->current_index = 0;
+  iterator_p->current_value_p = NULL;
+  iterator_p->current_chunk_end_p = NULL;
+} /* ecma_collection_iterator_init */
+
+/**
+ * Move collection iterator to next element if there is any.
+ *
+ * @return true - if iterator moved,
+ *         false - otherwise (current element is last element in the collection)
+ */
+bool
+ecma_collection_iterator_next (ecma_collection_iterator_t *iterator_p) /**< context of iterator */
+{
+  if (iterator_p->header_p == NULL
+      || unlikely (iterator_p->header_p->unit_number == 0))
+  {
+    return false;
+  }
+
+  const size_t values_in_chunk = JERRY_SIZE_OF_STRUCT_MEMBER (ecma_collection_chunk_t, data) / sizeof (ecma_value_t);
+
+  if (iterator_p->current_value_p == NULL)
+  {
+    JERRY_ASSERT (iterator_p->current_index == 0);
+
+    ecma_collection_chunk_t *first_chunk_p = ECMA_GET_NON_NULL_POINTER (ecma_collection_chunk_t,
+                                                                        iterator_p->header_p->first_chunk_cp);
+
+    iterator_p->next_chunk_cp = first_chunk_p->next_chunk_cp;
+    iterator_p->current_value_p = (ecma_value_t *) &first_chunk_p->data;
+    iterator_p->current_chunk_end_p = (iterator_p->current_value_p + values_in_chunk);
+  }
+  else
+  {
+    if (iterator_p->current_index + 1 == iterator_p->header_p->unit_number)
+    {
+      return false;
+    }
+
+    JERRY_ASSERT (iterator_p->current_index + 1 < iterator_p->header_p->unit_number);
+
+    iterator_p->current_index++;
+    iterator_p->current_value_p++;
+  }
+
+  if (iterator_p->current_value_p == iterator_p->current_chunk_end_p)
+  {
+    ecma_collection_chunk_t *next_chunk_p = ECMA_GET_POINTER (ecma_collection_chunk_t,
+                                                              iterator_p->next_chunk_cp);
+    JERRY_ASSERT (next_chunk_p != NULL);
+
+    iterator_p->next_chunk_cp = next_chunk_p->next_chunk_cp;
+    iterator_p->current_value_p = (ecma_value_t *) &next_chunk_p->data;
+    iterator_p->current_chunk_end_p = iterator_p->current_value_p + values_in_chunk;
+  }
+  else
+  {
+    JERRY_ASSERT (iterator_p->current_value_p < iterator_p->current_chunk_end_p);
+  }
+
+  return true;
+} /* ecma_collection_iterator_next */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-helpers.c b/deps/jerry/jerry-core/ecma/base/ecma-helpers.c
new file mode 100644 (file)
index 0000000..cf5dd8b
--- /dev/null
@@ -0,0 +1,1449 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-lcache.h"
+#include "ecma-property-hashmap.h"
+#include "jrt-bit-fields.h"
+#include "byte-code.h"
+#include "re-compiler.h"
+#include "ecma-builtins.h"
+
+#ifdef JERRY_DEBUGGER
+#include "debugger.h"
+#include "jcontext.h"
+#endif /* JERRY_DEBUGGER */
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmahelpers Helpers for operations with ECMA data types
+ * @{
+ */
+
+/**
+ * The ecma property types must be lower than the container mask.
+ */
+JERRY_STATIC_ASSERT (ECMA_PROPERTY_TYPE_MASK >= ECMA_PROPERTY_TYPE__MAX,
+                     ecma_property_types_must_be_lower_than_the_container_mask);
+
+/**
+ * The ecma object types must be lower than the container mask.
+ */
+JERRY_STATIC_ASSERT (ECMA_OBJECT_TYPE_MASK >= ECMA_OBJECT_TYPE__MAX,
+                     ecma_object_types_must_be_lower_than_the_container_mask);
+
+/**
+ * The ecma lexical environment types must be lower than the container mask.
+ */
+JERRY_STATIC_ASSERT (ECMA_OBJECT_TYPE_MASK >= ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX,
+                     ecma_lexical_environment_types_must_be_lower_than_the_container_mask);
+
+/**
+ * The ecma built in flag must follow the object type.
+ */
+JERRY_STATIC_ASSERT (ECMA_OBJECT_TYPE_MASK + 1 == ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV,
+                     ecma_built_in_flag_must_follow_the_object_type);
+
+/**
+ * The ecma gc visited flag must follow the built in flag.
+ */
+JERRY_STATIC_ASSERT (ECMA_OBJECT_FLAG_GC_VISITED == (ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV << 1),
+                     ecma_gc_visited_flag_must_follow_the_built_in_flag);
+
+/**
+ * The ecma extensible flag must follow the gc visited flag.
+ */
+JERRY_STATIC_ASSERT (ECMA_OBJECT_FLAG_EXTENSIBLE == (ECMA_OBJECT_FLAG_GC_VISITED << 1),
+                     ecma_extensible_flag_must_follow_the_gc_visited_flag);
+
+/**
+ * The ecma object ref one must follow the extensible flag.
+ */
+JERRY_STATIC_ASSERT (ECMA_OBJECT_REF_ONE == (ECMA_OBJECT_FLAG_EXTENSIBLE << 1),
+                     ecma_object_ref_one_must_follow_the_extensible_flag);
+
+/**
+ * The ecma object max ref does not fill the remaining bits.
+ */
+JERRY_STATIC_ASSERT ((ECMA_OBJECT_MAX_REF | (ECMA_OBJECT_REF_ONE - 1)) == UINT16_MAX,
+                     ecma_object_max_ref_does_not_fill_the_remaining_bits);
+
+/**
+ * Create an object with specified prototype object
+ * (or NULL prototype if there is not prototype for the object)
+ * and value of 'Extensible' attribute.
+ *
+ * Reference counter's value will be set to one.
+ *
+ * @return pointer to the object's descriptor
+ */
+ecma_object_t *
+ecma_create_object (ecma_object_t *prototype_object_p, /**< pointer to prototybe of the object (or NULL) */
+                    size_t ext_object_size, /**< size of extended objects */
+                    ecma_object_type_t type) /**< object type */
+{
+  ecma_object_t *new_object_p;
+
+  if (ext_object_size > 0)
+  {
+    new_object_p = (ecma_object_t *) ecma_alloc_extended_object (ext_object_size);
+  }
+  else
+  {
+    new_object_p = ecma_alloc_object ();
+  }
+
+  new_object_p->type_flags_refs = (uint16_t) (type | ECMA_OBJECT_FLAG_EXTENSIBLE);
+
+  ecma_init_gc_info (new_object_p);
+
+  new_object_p->property_list_or_bound_object_cp = JMEM_CP_NULL;
+
+  ECMA_SET_POINTER (new_object_p->prototype_or_outer_reference_cp,
+                    prototype_object_p);
+
+  return new_object_p;
+} /* ecma_create_object */
+
+/**
+ * Create a declarative lexical environment with specified outer lexical environment
+ * (or NULL if the environment is not nested).
+ *
+ * See also: ECMA-262 v5, 10.2.1.1
+ *
+ * Reference counter's value will be set to one.
+ *
+ * @return pointer to the descriptor of lexical environment
+ */
+ecma_object_t *
+ecma_create_decl_lex_env (ecma_object_t *outer_lexical_environment_p) /**< outer lexical environment */
+{
+  ecma_object_t *new_lexical_environment_p = ecma_alloc_object ();
+
+  uint16_t type = ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV | ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE;
+  new_lexical_environment_p->type_flags_refs = type;
+
+  ecma_init_gc_info (new_lexical_environment_p);
+
+  new_lexical_environment_p->property_list_or_bound_object_cp = JMEM_CP_NULL;
+
+  ECMA_SET_POINTER (new_lexical_environment_p->prototype_or_outer_reference_cp,
+                    outer_lexical_environment_p);
+
+  return new_lexical_environment_p;
+} /* ecma_create_decl_lex_env */
+
+/**
+ * Create a object lexical environment with specified outer lexical environment
+ * (or NULL if the environment is not nested), binding object and provideThis flag.
+ *
+ * See also: ECMA-262 v5, 10.2.1.2
+ *
+ * Reference counter's value will be set to one.
+ *
+ * @return pointer to the descriptor of lexical environment
+ */
+ecma_object_t *
+ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, /**< outer lexical environment */
+                            ecma_object_t *binding_obj_p, /**< binding object */
+                            bool provide_this) /**< provideThis flag */
+{
+  JERRY_ASSERT (binding_obj_p != NULL
+                && !ecma_is_lexical_environment (binding_obj_p));
+
+  ecma_object_t *new_lexical_environment_p = ecma_alloc_object ();
+
+  uint16_t type;
+
+  if (provide_this)
+  {
+    type = ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV | ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND;
+  }
+  else
+  {
+    type = ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV | ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND;
+  }
+
+  new_lexical_environment_p->type_flags_refs = type;
+
+  ecma_init_gc_info (new_lexical_environment_p);
+
+  ECMA_SET_NON_NULL_POINTER (new_lexical_environment_p->property_list_or_bound_object_cp,
+                             binding_obj_p);
+
+  ECMA_SET_POINTER (new_lexical_environment_p->prototype_or_outer_reference_cp,
+                    outer_lexical_environment_p);
+
+  return new_lexical_environment_p;
+} /* ecma_create_object_lex_env */
+
+/**
+ * Check if the object is lexical environment.
+ */
+inline bool __attr_pure___
+ecma_is_lexical_environment (const ecma_object_t *object_p) /**< object or lexical environment */
+{
+  JERRY_ASSERT (object_p != NULL);
+
+  uint32_t full_type = object_p->type_flags_refs & (ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV | ECMA_OBJECT_TYPE_MASK);
+
+  return full_type >= (ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV | ECMA_LEXICAL_ENVIRONMENT_TYPE_START);
+} /* ecma_is_lexical_environment */
+
+/**
+ * Get value of [[Extensible]] object's internal property.
+ */
+inline bool __attr_pure___
+ecma_get_object_extensible (const ecma_object_t *object_p) /**< object */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (!ecma_is_lexical_environment (object_p));
+
+  return (object_p->type_flags_refs & ECMA_OBJECT_FLAG_EXTENSIBLE) != 0;
+} /* ecma_get_object_extensible */
+
+/**
+ * Set value of [[Extensible]] object's internal property.
+ */
+inline void
+ecma_set_object_extensible (ecma_object_t *object_p, /**< object */
+                            bool is_extensible) /**< value of [[Extensible]] */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (!ecma_is_lexical_environment (object_p));
+
+  if (is_extensible)
+  {
+    object_p->type_flags_refs = (uint16_t) (object_p->type_flags_refs | ECMA_OBJECT_FLAG_EXTENSIBLE);
+  }
+  else
+  {
+    object_p->type_flags_refs = (uint16_t) (object_p->type_flags_refs & ~ECMA_OBJECT_FLAG_EXTENSIBLE);
+  }
+} /* ecma_set_object_extensible */
+
+/**
+ * Get object's internal implementation-defined type.
+ */
+inline ecma_object_type_t __attr_pure___
+ecma_get_object_type (const ecma_object_t *object_p) /**< object */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (!ecma_is_lexical_environment (object_p));
+
+  return (ecma_object_type_t) (object_p->type_flags_refs & ECMA_OBJECT_TYPE_MASK);
+} /* ecma_get_object_type */
+
+/**
+ * Get object's prototype.
+ */
+inline ecma_object_t *__attr_pure___
+ecma_get_object_prototype (const ecma_object_t *object_p) /**< object */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (!ecma_is_lexical_environment (object_p));
+
+  return ECMA_GET_POINTER (ecma_object_t,
+                           object_p->prototype_or_outer_reference_cp);
+} /* ecma_get_object_prototype */
+
+/**
+ * Check if the object is a built-in object
+ *
+ * @return true / false
+ */
+inline bool __attr_pure___
+ecma_get_object_is_builtin (const ecma_object_t *object_p) /**< object */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (!ecma_is_lexical_environment (object_p));
+
+  return (object_p->type_flags_refs & ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV) != 0;
+} /* ecma_get_object_is_builtin */
+
+/**
+ * Set flag indicating whether the object is a built-in object
+ */
+inline void
+ecma_set_object_is_builtin (ecma_object_t *object_p) /**< object */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (!(object_p->type_flags_refs & ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV));
+  JERRY_ASSERT ((object_p->type_flags_refs & ECMA_OBJECT_TYPE_MASK) < ECMA_LEXICAL_ENVIRONMENT_TYPE_START);
+
+  object_p->type_flags_refs = (uint16_t) (object_p->type_flags_refs | ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV);
+} /* ecma_set_object_is_builtin */
+
+/**
+ * Get the builtin id of the object.
+ * If the object is not builtin, return ECMA_BUILTIN_ID__COUNT
+ */
+inline uint8_t
+ecma_get_object_builtin_id (ecma_object_t *object_p) /**< object */
+{
+  if (!ecma_get_object_is_builtin (object_p))
+  {
+    return ECMA_BUILTIN_ID__COUNT;
+  }
+
+  ecma_built_in_props_t *built_in_props_p;
+  ecma_object_type_t object_type = ecma_get_object_type (object_p);
+
+  if (object_type == ECMA_OBJECT_TYPE_CLASS || object_type == ECMA_OBJECT_TYPE_ARRAY)
+  {
+    built_in_props_p = &((ecma_extended_built_in_object_t *) object_p)->built_in;
+  }
+  else
+  {
+    built_in_props_p = &((ecma_extended_object_t *) object_p)->u.built_in;
+  }
+
+  return built_in_props_p->id;
+} /* ecma_get_object_builtin_id */
+
+/**
+ * Get type of lexical environment.
+ */
+inline ecma_lexical_environment_type_t __attr_pure___
+ecma_get_lex_env_type (const ecma_object_t *object_p) /**< lexical environment */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (ecma_is_lexical_environment (object_p));
+
+  return (ecma_lexical_environment_type_t) (object_p->type_flags_refs & ECMA_OBJECT_TYPE_MASK);
+} /* ecma_get_lex_env_type */
+
+/**
+ * Get outer reference of lexical environment.
+ */
+inline ecma_object_t *__attr_pure___
+ecma_get_lex_env_outer_reference (const ecma_object_t *object_p) /**< lexical environment */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (ecma_is_lexical_environment (object_p));
+
+  return ECMA_GET_POINTER (ecma_object_t,
+                           object_p->prototype_or_outer_reference_cp);
+} /* ecma_get_lex_env_outer_reference */
+
+/**
+ * Get object's/lexical environment's property list.
+ *
+ * See also:
+ *          ecma_op_object_get_property_names
+ */
+inline ecma_property_header_t *__attr_pure___
+ecma_get_property_list (const ecma_object_t *object_p) /**< object or lexical environment */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (!ecma_is_lexical_environment (object_p)
+                || ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
+
+  return ECMA_GET_POINTER (ecma_property_header_t,
+                           object_p->property_list_or_bound_object_cp);
+} /* ecma_get_property_list */
+
+/**
+ * Get lexical environment's 'provideThis' property
+ */
+inline bool __attr_pure___
+ecma_get_lex_env_provide_this (const ecma_object_t *object_p) /**< object-bound lexical environment */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (ecma_is_lexical_environment (object_p));
+  JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND
+                || ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
+
+  return ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND;
+} /* ecma_get_lex_env_provide_this */
+
+/**
+ * Get lexical environment's bound object.
+ */
+inline ecma_object_t *__attr_pure___
+ecma_get_lex_env_binding_object (const ecma_object_t *object_p) /**< object-bound lexical environment */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (ecma_is_lexical_environment (object_p));
+  JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND
+                || ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
+
+  return ECMA_GET_NON_NULL_POINTER (ecma_object_t,
+                                    object_p->property_list_or_bound_object_cp);
+} /* ecma_get_lex_env_binding_object */
+
+/**
+ * Create a property in an object and link it into
+ * the object's properties' linked-list (at start of the list).
+ *
+ * @return pointer to the newly created property value
+ */
+static ecma_property_value_t *
+ecma_create_property (ecma_object_t *object_p, /**< the object */
+                      ecma_string_t *name_p, /**< property name */
+                      uint8_t type_and_flags, /**< type and flags, see ecma_property_info_t */
+                      ecma_property_value_t value, /**< property value */
+                      ecma_property_t **out_prop_p) /**< [out] the property is also returned
+                                                     *         if this field is non-NULL */
+{
+  JERRY_ASSERT (ECMA_PROPERTY_PAIR_ITEM_COUNT == 2);
+
+  jmem_cpointer_t *property_list_head_p = &object_p->property_list_or_bound_object_cp;
+
+  if (*property_list_head_p != ECMA_NULL_POINTER)
+  {
+    /* If the first entry is free (deleted), it is reused. */
+    ecma_property_header_t *first_property_p = ECMA_GET_NON_NULL_POINTER (ecma_property_header_t,
+                                                                          *property_list_head_p);
+    bool has_hashmap = false;
+
+    if (first_property_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
+    {
+      property_list_head_p = &first_property_p->next_property_cp;
+      first_property_p = ECMA_GET_NON_NULL_POINTER (ecma_property_header_t,
+                                                    *property_list_head_p);
+      has_hashmap = true;
+    }
+
+    JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (first_property_p));
+
+    if (first_property_p->types[0] == ECMA_PROPERTY_TYPE_DELETED)
+    {
+      ecma_property_pair_t *first_property_pair_p = (ecma_property_pair_t *) first_property_p;
+
+      if (name_p == NULL)
+      {
+        first_property_pair_p->names_cp[0] = ECMA_NULL_POINTER;
+      }
+      else
+      {
+        ecma_property_t name_type;
+        first_property_pair_p->names_cp[0] = ecma_string_to_property_name (name_p,
+                                                                           &name_type);
+        type_and_flags = (ecma_property_t) (type_and_flags | name_type);
+      }
+
+      first_property_p->types[0] = type_and_flags;
+
+      ecma_property_t *property_p = first_property_p->types + 0;
+
+      JERRY_ASSERT (ECMA_PROPERTY_VALUE_PTR (property_p) == first_property_pair_p->values + 0);
+
+      if (out_prop_p != NULL)
+      {
+        *out_prop_p = property_p;
+      }
+
+      first_property_pair_p->values[0] = value;
+
+      /* The property must be fully initialized before ecma_property_hashmap_insert
+       * is called, because the insert operation may reallocate the hashmap, and
+       * that triggers garbage collection which scans all properties of all objects.
+       * A not fully initialized but queued property may cause a crash. */
+
+      if (has_hashmap && name_p != NULL)
+      {
+        ecma_property_hashmap_insert (object_p,
+                                      name_p,
+                                      first_property_pair_p,
+                                      0);
+      }
+
+      return first_property_pair_p->values + 0;
+    }
+  }
+
+  /* Otherwise we create a new property pair and use its second value. */
+  ecma_property_pair_t *first_property_pair_p = ecma_alloc_property_pair ();
+
+  /* Need to query property_list_head_p again and recheck the existennce
+   * of property hasmap, because ecma_alloc_property_pair may delete them. */
+  property_list_head_p = &object_p->property_list_or_bound_object_cp;
+  bool has_hashmap = false;
+
+  if (*property_list_head_p != ECMA_NULL_POINTER)
+  {
+    ecma_property_header_t *first_property_p = ECMA_GET_NON_NULL_POINTER (ecma_property_header_t,
+                                                                          *property_list_head_p);
+
+    if (first_property_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
+    {
+      property_list_head_p = &first_property_p->next_property_cp;
+      has_hashmap = true;
+    }
+  }
+
+  /* Just copy the previous value (no need to decompress, compress). */
+  first_property_pair_p->header.next_property_cp = *property_list_head_p;
+  first_property_pair_p->header.types[0] = ECMA_PROPERTY_TYPE_DELETED;
+  first_property_pair_p->names_cp[0] = ECMA_NULL_POINTER;
+
+  if (name_p == NULL)
+  {
+    first_property_pair_p->names_cp[1] = ECMA_NULL_POINTER;
+  }
+  else
+  {
+    ecma_property_t name_type;
+    first_property_pair_p->names_cp[1] = ecma_string_to_property_name (name_p,
+                                                                       &name_type);
+    type_and_flags = (ecma_property_t) (type_and_flags | name_type);
+  }
+
+  first_property_pair_p->header.types[1] = type_and_flags;
+
+  ECMA_SET_NON_NULL_POINTER (*property_list_head_p, &first_property_pair_p->header);
+
+  ecma_property_t *property_p = first_property_pair_p->header.types + 1;
+
+  JERRY_ASSERT (ECMA_PROPERTY_VALUE_PTR (property_p) == first_property_pair_p->values + 1);
+
+  if (out_prop_p != NULL)
+  {
+    *out_prop_p = property_p;
+  }
+
+  first_property_pair_p->values[1] = value;
+
+  /* See the comment before the other ecma_property_hashmap_insert above. */
+
+  if (has_hashmap && name_p != NULL)
+  {
+    ecma_property_hashmap_insert (object_p,
+                                  name_p,
+                                  first_property_pair_p,
+                                  1);
+  }
+
+  return first_property_pair_p->values + 1;
+} /* ecma_create_property */
+
+/**
+ * Create named data property with given name, attributes and undefined value
+ * in the specified object.
+ *
+ * @return pointer to the newly created property value
+ */
+ecma_property_value_t *
+ecma_create_named_data_property (ecma_object_t *object_p, /**< object */
+                                 ecma_string_t *name_p, /**< property name */
+                                 uint8_t prop_attributes, /**< property attributes (See: ecma_property_flags_t) */
+                                 ecma_property_t **out_prop_p) /**< [out] the property is also returned
+                                                                *         if this field is non-NULL */
+{
+  JERRY_ASSERT (object_p != NULL && name_p != NULL);
+  JERRY_ASSERT (ecma_find_named_property (object_p, name_p) == NULL);
+  JERRY_ASSERT ((prop_attributes & ~ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE) == 0);
+
+  uint8_t type_and_flags = ECMA_PROPERTY_TYPE_NAMEDDATA | prop_attributes;
+
+  ecma_property_value_t value;
+  value.value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+  return ecma_create_property (object_p, name_p, type_and_flags, value, out_prop_p);
+} /* ecma_create_named_data_property */
+
+/**
+ * Create named accessor property with given name, attributes, getter and setter.
+ *
+ * @return pointer to the newly created property value
+ */
+ecma_property_value_t *
+ecma_create_named_accessor_property (ecma_object_t *object_p, /**< object */
+                                     ecma_string_t *name_p, /**< property name */
+                                     ecma_object_t *get_p, /**< getter */
+                                     ecma_object_t *set_p, /**< setter */
+                                     uint8_t prop_attributes, /**< property attributes */
+                                     ecma_property_t **out_prop_p) /**< [out] the property is also returned
+                                                                    *         if this field is non-NULL */
+{
+  JERRY_ASSERT (object_p != NULL && name_p != NULL);
+  JERRY_ASSERT (ecma_find_named_property (object_p, name_p) == NULL);
+  JERRY_ASSERT ((prop_attributes & ~ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE) == 0);
+
+  uint8_t type_and_flags = ECMA_PROPERTY_TYPE_NAMEDACCESSOR | prop_attributes;
+
+  ecma_property_value_t value;
+#ifdef JERRY_CPOINTER_32_BIT
+  ecma_getter_setter_pointers_t *getter_setter_pair_p;
+  getter_setter_pair_p = jmem_pools_alloc (sizeof (ecma_getter_setter_pointers_t));
+  ECMA_SET_POINTER (getter_setter_pair_p->getter_p, get_p);
+  ECMA_SET_POINTER (getter_setter_pair_p->setter_p, set_p);
+  ECMA_SET_POINTER (value.getter_setter_pair_cp, getter_setter_pair_p);
+#else /* !JERRY_CPOINTER_32_BIT */
+  ECMA_SET_POINTER (value.getter_setter_pair.getter_p, get_p);
+  ECMA_SET_POINTER (value.getter_setter_pair.setter_p, set_p);
+#endif /* JERRY_CPOINTER_32_BIT */
+
+  return ecma_create_property (object_p, name_p, type_and_flags, value, out_prop_p);
+} /* ecma_create_named_accessor_property */
+
+/**
+ * Find named data property or named access property in specified object.
+ *
+ * @return pointer to the property, if it is found,
+ *         NULL - otherwise.
+ */
+ecma_property_t *
+ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in */
+                          ecma_string_t *name_p) /**< property's name */
+{
+  JERRY_ASSERT (obj_p != NULL);
+  JERRY_ASSERT (name_p != NULL);
+
+  ecma_property_t *property_p = ecma_lcache_lookup (obj_p, name_p);
+
+  if (property_p != NULL)
+  {
+    return property_p;
+  }
+
+  ecma_property_header_t *prop_iter_p = ecma_get_property_list (obj_p);
+
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+  if (prop_iter_p != NULL && prop_iter_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
+  {
+    jmem_cpointer_t property_real_name_cp;
+    property_p = ecma_property_hashmap_find ((ecma_property_hashmap_t *) prop_iter_p,
+                                             name_p,
+                                             &property_real_name_cp);
+
+    if (property_p != NULL
+        && !ecma_is_property_lcached (property_p))
+    {
+      ecma_lcache_insert (obj_p, property_real_name_cp, property_p);
+    }
+
+    return property_p;
+  }
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+
+  property_p = NULL;
+  jmem_cpointer_t property_name_cp = ECMA_NULL_POINTER;
+
+  uint32_t steps = 0;
+
+  while (prop_iter_p != NULL)
+  {
+    JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (prop_iter_p));
+
+    ecma_property_pair_t *prop_pair_p = (ecma_property_pair_t *) prop_iter_p;
+
+    JERRY_ASSERT (ECMA_PROPERTY_PAIR_ITEM_COUNT == 2);
+
+    if (ECMA_PROPERTY_IS_NAMED_PROPERTY (prop_iter_p->types[0]))
+    {
+      if (ecma_string_compare_to_property_name (prop_iter_p->types[0],
+                                                prop_pair_p->names_cp[0],
+                                                name_p))
+      {
+        property_name_cp = prop_pair_p->names_cp[0];
+        property_p = prop_iter_p->types + 0;
+        break;
+      }
+    }
+
+    if (ECMA_PROPERTY_IS_NAMED_PROPERTY (prop_iter_p->types[1]))
+    {
+      if (ecma_string_compare_to_property_name (prop_iter_p->types[1],
+                                                prop_pair_p->names_cp[1],
+                                                name_p))
+      {
+        property_name_cp = prop_pair_p->names_cp[1];
+        property_p = prop_iter_p->types + 1;
+        break;
+      }
+    }
+
+    steps++;
+
+    prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                    prop_iter_p->next_property_cp);
+  }
+
+  if (steps >= (ECMA_PROPERTY_HASMAP_MINIMUM_SIZE / 2))
+  {
+    ecma_property_hashmap_create (obj_p);
+  }
+
+  if (property_p != NULL
+      && !ecma_is_property_lcached (property_p))
+  {
+    ecma_lcache_insert (obj_p, property_name_cp, property_p);
+  }
+
+  return property_p;
+} /* ecma_find_named_property */
+
+/**
+ * Get named data property or named access property in specified object.
+ *
+ * Warning:
+ *         the property must exist
+ *
+ * @return pointer to the property, if it is found,
+ *         NULL - otherwise.
+ */
+ecma_property_value_t *
+ecma_get_named_data_property (ecma_object_t *obj_p, /**< object to find property in */
+                              ecma_string_t *name_p) /**< property's name */
+{
+  JERRY_ASSERT (obj_p != NULL);
+  JERRY_ASSERT (name_p != NULL);
+
+  ecma_property_t *property_p = ecma_find_named_property (obj_p, name_p);
+
+  JERRY_ASSERT (property_p != NULL
+                && ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA);
+
+  return ECMA_PROPERTY_VALUE_PTR (property_p);
+} /* ecma_get_named_data_property */
+
+/**
+ * Free property values and change their type to deleted.
+ */
+void
+ecma_free_property (ecma_object_t *object_p, /**< object the property belongs to */
+                    jmem_cpointer_t name_cp, /**< name of the property or ECMA_NULL_POINTER */
+                    ecma_property_t *property_p) /**< property */
+{
+  JERRY_ASSERT (object_p != NULL && property_p != NULL);
+
+  switch (ECMA_PROPERTY_GET_TYPE (*property_p))
+  {
+    case ECMA_PROPERTY_TYPE_NAMEDDATA:
+    {
+      if (ECMA_PROPERTY_GET_NAME_TYPE (*property_p) == ECMA_STRING_CONTAINER_MAGIC_STRING)
+      {
+        if (name_cp == LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE
+            || name_cp == LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER)
+        {
+          ecma_free_native_pointer (property_p);
+          break;
+        }
+      }
+
+      ecma_free_value_if_not_object (ECMA_PROPERTY_VALUE_PTR (property_p)->value);
+      break;
+    }
+    case ECMA_PROPERTY_TYPE_NAMEDACCESSOR:
+    {
+#ifdef JERRY_CPOINTER_32_BIT
+      ecma_getter_setter_pointers_t *getter_setter_pair_p;
+      getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
+                                               ECMA_PROPERTY_VALUE_PTR (property_p)->getter_setter_pair_cp);
+      jmem_pools_free (getter_setter_pair_p, sizeof (ecma_getter_setter_pointers_t));
+#endif /* JERRY_CPOINTER_32_BIT */
+      break;
+    }
+    default:
+    {
+      JERRY_UNREACHABLE ();
+      return;
+    }
+  }
+
+  if (ecma_is_property_lcached (property_p))
+  {
+    ecma_lcache_invalidate (object_p, name_cp, property_p);
+  }
+
+  if (ECMA_PROPERTY_GET_NAME_TYPE (*property_p) == ECMA_PROPERTY_NAME_TYPE_STRING)
+  {
+    ecma_string_t *prop_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t, name_cp);
+    ecma_deref_ecma_string (prop_name_p);
+  }
+
+  *property_p = ECMA_PROPERTY_TYPE_DELETED;
+} /* ecma_free_property */
+
+/**
+ * Delete the object's property referenced by its value pointer.
+ *
+ * Note: specified property must be owned by specified object.
+ */
+void
+ecma_delete_property (ecma_object_t *object_p, /**< object */
+                      ecma_property_value_t *prop_value_p) /**< property value reference */
+{
+  ecma_property_header_t *cur_prop_p = ecma_get_property_list (object_p);
+  ecma_property_header_t *prev_prop_p = NULL;
+  ecma_property_hashmap_delete_status hashmap_status = ECMA_PROPERTY_HASHMAP_DELETE_NO_HASHMAP;
+
+  if (cur_prop_p != NULL && cur_prop_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
+  {
+    prev_prop_p = cur_prop_p;
+    cur_prop_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                   cur_prop_p->next_property_cp);
+    hashmap_status = ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP;
+  }
+
+  while (true)
+  {
+    JERRY_ASSERT (cur_prop_p != NULL);
+    JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (cur_prop_p));
+
+    ecma_property_pair_t *prop_pair_p = (ecma_property_pair_t *) cur_prop_p;
+
+    for (int i = 0; i < ECMA_PROPERTY_PAIR_ITEM_COUNT; i++)
+    {
+      if ((prop_pair_p->values + i) == prop_value_p)
+      {
+        JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (cur_prop_p->types[i]) != ECMA_PROPERTY_TYPE_SPECIAL);
+
+        if (hashmap_status == ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP)
+        {
+          hashmap_status = ecma_property_hashmap_delete (object_p,
+                                                         prop_pair_p->names_cp[i],
+                                                         cur_prop_p->types + i);
+        }
+
+        ecma_free_property (object_p, prop_pair_p->names_cp[i], cur_prop_p->types + i);
+
+        JERRY_ASSERT (ECMA_PROPERTY_PAIR_ITEM_COUNT == 2);
+
+        if (cur_prop_p->types[1 - i] != ECMA_PROPERTY_TYPE_DELETED)
+        {
+          /* The other property is still valid. */
+          return;
+        }
+
+        JERRY_ASSERT (cur_prop_p->types[i] == ECMA_PROPERTY_TYPE_DELETED);
+
+        if (prev_prop_p == NULL)
+        {
+          object_p->property_list_or_bound_object_cp = cur_prop_p->next_property_cp;
+        }
+        else
+        {
+          prev_prop_p->next_property_cp = cur_prop_p->next_property_cp;
+        }
+
+        ecma_dealloc_property_pair ((ecma_property_pair_t *) cur_prop_p);
+
+        if (hashmap_status == ECMA_PROPERTY_HASHMAP_DELETE_RECREATE_HASHMAP)
+        {
+          ecma_property_hashmap_free (object_p);
+          ecma_property_hashmap_create (object_p);
+        }
+        return;
+      }
+    }
+
+    prev_prop_p = cur_prop_p;
+    cur_prop_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                   cur_prop_p->next_property_cp);
+  }
+} /* ecma_delete_property */
+
+/**
+ * Low level delete of array items from new_length to old_length
+ *
+ * Note: new_length must be less than old_length
+ *
+ * @return the updated value of new_length
+ */
+uint32_t
+ecma_delete_array_properties (ecma_object_t *object_p, /**< object */
+                              uint32_t new_length, /**< new length */
+                              uint32_t old_length) /**< old length */
+{
+  JERRY_ASSERT (new_length < old_length);
+
+  /* First the minimum value of new_length is updated. */
+  ecma_property_header_t *current_prop_p = ecma_get_property_list (object_p);
+
+  if (current_prop_p == NULL)
+  {
+    return new_length;
+  }
+
+  if (current_prop_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
+  {
+    current_prop_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                       current_prop_p->next_property_cp);
+  }
+
+  while (current_prop_p != NULL)
+  {
+    JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (current_prop_p));
+
+    ecma_property_pair_t *prop_pair_p = (ecma_property_pair_t *) current_prop_p;
+
+    for (int i = 0; i < ECMA_PROPERTY_PAIR_ITEM_COUNT; i++)
+    {
+      if (ECMA_PROPERTY_IS_NAMED_PROPERTY (current_prop_p->types[i])
+          && !ecma_is_property_configurable (current_prop_p->types[i]))
+      {
+        uint32_t index = ecma_string_get_property_index (current_prop_p->types[i],
+                                                         prop_pair_p->names_cp[i]);
+
+        if (index < old_length && index >= new_length)
+        {
+          JERRY_ASSERT (index != ECMA_STRING_NOT_ARRAY_INDEX);
+
+          new_length = index + 1;
+
+          if (new_length == old_length)
+          {
+            /* Early return. */
+            return new_length;
+          }
+        }
+      }
+    }
+
+    current_prop_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                       current_prop_p->next_property_cp);
+  }
+
+  /* Second all properties between new_length and old_length are deleted. */
+  current_prop_p = ecma_get_property_list (object_p);
+  ecma_property_header_t *prev_prop_p = NULL;
+  ecma_property_hashmap_delete_status hashmap_status = ECMA_PROPERTY_HASHMAP_DELETE_NO_HASHMAP;
+
+  if (current_prop_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
+  {
+    prev_prop_p = current_prop_p;
+    current_prop_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                       current_prop_p->next_property_cp);
+    hashmap_status = ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP;
+  }
+
+  while (current_prop_p != NULL)
+  {
+    ecma_property_pair_t *prop_pair_p = (ecma_property_pair_t *) current_prop_p;
+
+    for (int i = 0; i < ECMA_PROPERTY_PAIR_ITEM_COUNT; i++)
+    {
+      if (ECMA_PROPERTY_IS_NAMED_PROPERTY (current_prop_p->types[i])
+          && ecma_is_property_configurable (current_prop_p->types[i]))
+      {
+        uint32_t index = ecma_string_get_property_index (current_prop_p->types[i],
+                                                         prop_pair_p->names_cp[i]);
+
+        if (index < old_length && index >= new_length)
+        {
+          JERRY_ASSERT (index != ECMA_STRING_NOT_ARRAY_INDEX);
+
+          if (hashmap_status == ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP)
+          {
+            hashmap_status = ecma_property_hashmap_delete (object_p,
+                                                           prop_pair_p->names_cp[i],
+                                                           current_prop_p->types + i);
+          }
+
+          ecma_free_property (object_p, prop_pair_p->names_cp[i], current_prop_p->types + i);
+
+          JERRY_ASSERT (current_prop_p->types[i] == ECMA_PROPERTY_TYPE_DELETED);
+        }
+      }
+    }
+
+    if (current_prop_p->types[0] == ECMA_PROPERTY_TYPE_DELETED
+        && current_prop_p->types[1] == ECMA_PROPERTY_TYPE_DELETED)
+    {
+      if (prev_prop_p == NULL)
+      {
+        object_p->property_list_or_bound_object_cp = current_prop_p->next_property_cp;
+      }
+      else
+      {
+        prev_prop_p->next_property_cp = current_prop_p->next_property_cp;
+      }
+
+      ecma_property_header_t *next_prop_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                                              current_prop_p->next_property_cp);
+      ecma_dealloc_property_pair ((ecma_property_pair_t *) current_prop_p);
+      current_prop_p = next_prop_p;
+    }
+    else
+    {
+      prev_prop_p = current_prop_p;
+      current_prop_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                         current_prop_p->next_property_cp);
+    }
+  }
+
+  if (hashmap_status == ECMA_PROPERTY_HASHMAP_DELETE_RECREATE_HASHMAP)
+  {
+    ecma_property_hashmap_free (object_p);
+    ecma_property_hashmap_create (object_p);
+  }
+
+  return new_length;
+} /* ecma_delete_array_properties */
+
+/**
+ * Check whether the object contains a property
+ */
+static void
+ecma_assert_object_contains_the_property (const ecma_object_t *object_p, /**< ecma-object */
+                                          const ecma_property_value_t *prop_value_p, /**< property value */
+                                          ecma_property_types_t type) /**< expected property type */
+{
+#ifndef JERRY_NDEBUG
+  ecma_property_header_t *prop_iter_p = ecma_get_property_list (object_p);
+
+  JERRY_ASSERT (prop_iter_p != NULL);
+
+  if (prop_iter_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
+  {
+    prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                    prop_iter_p->next_property_cp);
+  }
+
+  while (prop_iter_p != NULL)
+  {
+    JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (prop_iter_p));
+
+    ecma_property_pair_t *prop_pair_p = (ecma_property_pair_t *) prop_iter_p;
+
+    for (int i = 0; i < ECMA_PROPERTY_PAIR_ITEM_COUNT; i++)
+    {
+      if ((prop_pair_p->values + i) == prop_value_p)
+      {
+        JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (prop_pair_p->header.types[i]) == type);
+        return;
+      }
+    }
+
+    prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                    prop_iter_p->next_property_cp);
+  }
+
+  JERRY_UNREACHABLE ();
+
+#else /* JERRY_NDEBUG */
+  JERRY_UNUSED (object_p);
+  JERRY_UNUSED (prop_value_p);
+  JERRY_UNUSED (type);
+#endif /* !JERRY_NDEBUG */
+} /* ecma_assert_object_contains_the_property */
+
+/**
+ * Assign value to named data property
+ *
+ * Note:
+ *      value previously stored in the property is freed
+ */
+inline void __attr_always_inline___
+ecma_named_data_property_assign_value (ecma_object_t *obj_p, /**< object */
+                                       ecma_property_value_t *prop_value_p, /**< property value reference */
+                                       ecma_value_t value) /**< value to assign */
+{
+  ecma_assert_object_contains_the_property (obj_p, prop_value_p, ECMA_PROPERTY_TYPE_NAMEDDATA);
+
+  ecma_value_assign_value (&prop_value_p->value, value);
+} /* ecma_named_data_property_assign_value */
+
+/**
+ * Get getter of named accessor property
+ *
+ * @return pointer to object - getter of the property
+ */
+ecma_object_t *
+ecma_get_named_accessor_property_getter (const ecma_property_value_t *prop_value_p) /**< property value reference */
+{
+#ifdef JERRY_CPOINTER_32_BIT
+  ecma_getter_setter_pointers_t *getter_setter_pair_p;
+  getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
+                                           prop_value_p->getter_setter_pair_cp);
+  return ECMA_GET_POINTER (ecma_object_t, getter_setter_pair_p->getter_p);
+#else /* !JERRY_CPOINTER_32_BIT */
+  return ECMA_GET_POINTER (ecma_object_t, prop_value_p->getter_setter_pair.getter_p);
+#endif /* JERRY_CPOINTER_32_BIT */
+} /* ecma_get_named_accessor_property_getter */
+
+/**
+ * Get setter of named accessor property
+ *
+ * @return pointer to object - setter of the property
+ */
+ecma_object_t *
+ecma_get_named_accessor_property_setter (const ecma_property_value_t *prop_value_p) /**< property value reference */
+{
+#ifdef JERRY_CPOINTER_32_BIT
+  ecma_getter_setter_pointers_t *getter_setter_pair_p;
+  getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
+                                           prop_value_p->getter_setter_pair_cp);
+  return ECMA_GET_POINTER (ecma_object_t, getter_setter_pair_p->setter_p);
+#else /* !JERRY_CPOINTER_32_BIT */
+  return ECMA_GET_POINTER (ecma_object_t, prop_value_p->getter_setter_pair.setter_p);
+#endif /* JERRY_CPOINTER_32_BIT */
+} /* ecma_get_named_accessor_property_setter */
+
+/**
+ * Set getter of named accessor property
+ */
+void
+ecma_set_named_accessor_property_getter (ecma_object_t *object_p, /**< the property's container */
+                                         ecma_property_value_t *prop_value_p, /**< property value reference */
+                                         ecma_object_t *getter_p) /**< getter object */
+{
+  ecma_assert_object_contains_the_property (object_p, prop_value_p, ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+#ifdef JERRY_CPOINTER_32_BIT
+  ecma_getter_setter_pointers_t *getter_setter_pair_p;
+  getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
+                                           prop_value_p->getter_setter_pair_cp);
+  ECMA_SET_POINTER (getter_setter_pair_p->getter_p, getter_p);
+#else /* !JERRY_CPOINTER_32_BIT */
+  ECMA_SET_POINTER (prop_value_p->getter_setter_pair.getter_p, getter_p);
+#endif /* JERRY_CPOINTER_32_BIT */
+} /* ecma_set_named_accessor_property_getter */
+
+/**
+ * Set setter of named accessor property
+ */
+void
+ecma_set_named_accessor_property_setter (ecma_object_t *object_p, /**< the property's container */
+                                         ecma_property_value_t *prop_value_p, /**< property value reference */
+                                         ecma_object_t *setter_p) /**< setter object */
+{
+  ecma_assert_object_contains_the_property (object_p, prop_value_p, ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+#ifdef JERRY_CPOINTER_32_BIT
+  ecma_getter_setter_pointers_t *getter_setter_pair_p;
+  getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
+                                           prop_value_p->getter_setter_pair_cp);
+  ECMA_SET_POINTER (getter_setter_pair_p->setter_p, setter_p);
+#else /* !JERRY_CPOINTER_32_BIT */
+  ECMA_SET_POINTER (prop_value_p->getter_setter_pair.setter_p, setter_p);
+#endif /* JERRY_CPOINTER_32_BIT */
+} /* ecma_set_named_accessor_property_setter */
+
+/**
+ * Get property's 'Writable' attribute value
+ *
+ * @return true - property is writable,
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+ecma_is_property_writable (ecma_property_t property) /**< property */
+{
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_VIRTUAL);
+
+  return (property & ECMA_PROPERTY_FLAG_WRITABLE) != 0;
+} /* ecma_is_property_writable */
+
+/**
+ * Set property's 'Writable' attribute value
+ */
+void
+ecma_set_property_writable_attr (ecma_property_t *property_p, /**< [in,out] property */
+                                 bool is_writable) /**< new value for writable flag */
+{
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA);
+
+  if (is_writable)
+  {
+    *property_p = (uint8_t) (*property_p | ECMA_PROPERTY_FLAG_WRITABLE);
+  }
+  else
+  {
+    *property_p = (uint8_t) (*property_p & ~ECMA_PROPERTY_FLAG_WRITABLE);
+  }
+} /* ecma_set_property_writable_attr */
+
+/**
+ * Get property's 'Enumerable' attribute value
+ *
+ * @return true - property is enumerable,
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+ecma_is_property_enumerable (ecma_property_t property) /**< property */
+{
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR
+                || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_VIRTUAL);
+
+  return (property & ECMA_PROPERTY_FLAG_ENUMERABLE) != 0;
+} /* ecma_is_property_enumerable */
+
+/**
+ * Set property's 'Enumerable' attribute value
+ */
+void
+ecma_set_property_enumerable_attr (ecma_property_t *property_p, /**< [in,out] property */
+                                   bool is_enumerable) /**< new value for enumerable flag */
+{
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                || ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+  if (is_enumerable)
+  {
+    *property_p = (uint8_t) (*property_p | ECMA_PROPERTY_FLAG_ENUMERABLE);
+  }
+  else
+  {
+    *property_p = (uint8_t) (*property_p & ~ECMA_PROPERTY_FLAG_ENUMERABLE);
+  }
+} /* ecma_set_property_enumerable_attr */
+
+/**
+ * Get property's 'Configurable' attribute value
+ *
+ * @return true - property is configurable,
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+ecma_is_property_configurable (ecma_property_t property) /**< property */
+{
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR
+                || ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_VIRTUAL);
+
+  return (property & ECMA_PROPERTY_FLAG_CONFIGURABLE) != 0;
+} /* ecma_is_property_configurable */
+
+/**
+ * Set property's 'Configurable' attribute value
+ */
+void
+ecma_set_property_configurable_attr (ecma_property_t *property_p, /**< [in,out] property */
+                                     bool is_configurable) /**< new value for configurable flag */
+{
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                || ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+  if (is_configurable)
+  {
+    *property_p = (uint8_t) (*property_p | ECMA_PROPERTY_FLAG_CONFIGURABLE);
+  }
+  else
+  {
+    *property_p = (uint8_t) (*property_p & ~ECMA_PROPERTY_FLAG_CONFIGURABLE);
+  }
+} /* ecma_set_property_configurable_attr */
+
+/**
+ * Check whether the property is registered in LCache
+ *
+ * @return true / false
+ */
+inline bool __attr_always_inline___
+ecma_is_property_lcached (ecma_property_t *property_p) /**< property */
+{
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                || ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+  return (*property_p & ECMA_PROPERTY_FLAG_LCACHED) != 0;
+} /* ecma_is_property_lcached */
+
+/**
+ * Set value of flag indicating whether the property is registered in LCache
+ */
+inline void __attr_always_inline___
+ecma_set_property_lcached (ecma_property_t *property_p, /**< property */
+                           bool is_lcached) /**< new value for lcached flag */
+{
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                || ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+  if (is_lcached)
+  {
+    *property_p = (uint8_t) (*property_p | ECMA_PROPERTY_FLAG_LCACHED);
+  }
+  else
+  {
+    *property_p = (uint8_t) (*property_p & ~ECMA_PROPERTY_FLAG_LCACHED);
+  }
+} /* ecma_set_property_lcached */
+
+/**
+ * Construct empty property descriptor, i.e.:
+ *  property descriptor with all is_defined flags set to false and the rest - to default value.
+ */
+ecma_property_descriptor_t
+ecma_make_empty_property_descriptor (void)
+{
+  ecma_property_descriptor_t prop_desc;
+
+  prop_desc.is_value_defined = false;
+  prop_desc.value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  prop_desc.is_writable_defined = false;
+  prop_desc.is_writable = false;
+  prop_desc.is_enumerable_defined = false;
+  prop_desc.is_enumerable = false;
+  prop_desc.is_configurable_defined = false;
+  prop_desc.is_configurable = false;
+  prop_desc.is_get_defined = false;
+  prop_desc.get_p = NULL;
+  prop_desc.is_set_defined = false;
+  prop_desc.set_p = NULL;
+
+  return prop_desc;
+} /* ecma_make_empty_property_descriptor */
+
+/**
+ * Free values contained in the property descriptor
+ * and make it empty property descriptor
+ */
+void
+ecma_free_property_descriptor (ecma_property_descriptor_t *prop_desc_p) /**< property descriptor */
+{
+  if (prop_desc_p->is_value_defined)
+  {
+    ecma_free_value (prop_desc_p->value);
+  }
+
+  if (prop_desc_p->is_get_defined
+      && prop_desc_p->get_p != NULL)
+  {
+    ecma_deref_object (prop_desc_p->get_p);
+  }
+
+  if (prop_desc_p->is_set_defined
+      && prop_desc_p->set_p != NULL)
+  {
+    ecma_deref_object (prop_desc_p->set_p);
+  }
+
+  *prop_desc_p = ecma_make_empty_property_descriptor ();
+} /* ecma_free_property_descriptor */
+
+/**
+ * Increase reference counter of Compact
+ * Byte Code or regexp byte code.
+ */
+void
+ecma_bytecode_ref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
+{
+  /* Abort program if maximum reference number is reached. */
+  if (bytecode_p->refs >= UINT16_MAX)
+  {
+    jerry_fatal (ERR_REF_COUNT_LIMIT);
+  }
+
+  bytecode_p->refs++;
+} /* ecma_bytecode_ref */
+
+/**
+ * Decrease reference counter of Compact
+ * Byte Code or regexp byte code.
+ */
+void
+ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
+{
+  JERRY_ASSERT (bytecode_p->refs > 0);
+
+  bytecode_p->refs--;
+
+  if (bytecode_p->refs > 0)
+  {
+    /* Non-zero reference counter. */
+    return;
+  }
+
+  if (bytecode_p->status_flags & CBC_CODE_FLAGS_FUNCTION)
+  {
+    jmem_cpointer_t *literal_start_p = NULL;
+    uint32_t literal_end;
+    uint32_t const_literal_end;
+
+    if (bytecode_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+    {
+      uint8_t *byte_p = (uint8_t *) bytecode_p;
+      literal_start_p = (jmem_cpointer_t *) (byte_p + sizeof (cbc_uint16_arguments_t));
+
+      cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_p;
+      literal_end = args_p->literal_end;
+      const_literal_end = args_p->const_literal_end;
+    }
+    else
+    {
+      uint8_t *byte_p = (uint8_t *) bytecode_p;
+      literal_start_p = (jmem_cpointer_t *) (byte_p + sizeof (cbc_uint8_arguments_t));
+
+      cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_p;
+      literal_end = args_p->literal_end;
+      const_literal_end = args_p->const_literal_end;
+    }
+
+    for (uint32_t i = const_literal_end; i < literal_end; i++)
+    {
+      jmem_cpointer_t bytecode_cpointer = literal_start_p[i];
+      ecma_compiled_code_t *bytecode_literal_p = ECMA_GET_NON_NULL_POINTER (ecma_compiled_code_t,
+                                                                            bytecode_cpointer);
+
+      /* Self references are ignored. */
+      if (bytecode_literal_p != bytecode_p)
+      {
+        ecma_bytecode_deref (bytecode_literal_p);
+      }
+    }
+
+#ifdef JERRY_DEBUGGER
+    if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+        && !(bytecode_p->status_flags & CBC_CODE_FLAGS_DEBUGGER_IGNORE)
+        && jerry_debugger_send_function_cp (JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP, bytecode_p))
+    {
+      /* Delay the byte code free until the debugger client is notified.
+       * If the connection is aborted the pointer is still freed by
+       * jerry_debugger_close_connection(). */
+      jerry_debugger_byte_code_free_t *byte_code_free_p = (jerry_debugger_byte_code_free_t *) bytecode_p;
+      jmem_cpointer_t byte_code_free_head = JERRY_CONTEXT (debugger_byte_code_free_head);
+
+      byte_code_free_p->prev_cp = ECMA_NULL_POINTER;
+
+      jmem_cpointer_t byte_code_free_cp;
+      JMEM_CP_SET_NON_NULL_POINTER (byte_code_free_cp, byte_code_free_p);
+
+      if (byte_code_free_head == ECMA_NULL_POINTER)
+      {
+        JERRY_CONTEXT (debugger_byte_code_free_tail) = byte_code_free_cp;
+      }
+      else
+      {
+        jerry_debugger_byte_code_free_t *first_byte_code_free_p;
+
+        first_byte_code_free_p = JMEM_CP_GET_NON_NULL_POINTER (jerry_debugger_byte_code_free_t,
+                                                               byte_code_free_head);
+        first_byte_code_free_p->prev_cp = byte_code_free_cp;
+      }
+
+      JERRY_CONTEXT (debugger_byte_code_free_head) = byte_code_free_cp;
+      return;
+    }
+#endif /* JERRY_DEBUGGER */
+
+#ifdef JMEM_STATS
+    jmem_stats_free_byte_code_bytes (((size_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG);
+#endif /* JMEM_STATS */
+  }
+  else
+  {
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+    re_compiled_code_t *re_bytecode_p = (re_compiled_code_t *) bytecode_p;
+
+    ecma_deref_ecma_string (ECMA_GET_NON_NULL_POINTER (ecma_string_t, re_bytecode_p->pattern_cp));
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+  }
+
+  jmem_heap_free_block (bytecode_p,
+                        ((size_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG);
+} /* ecma_bytecode_deref */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-helpers.h b/deps/jerry/jerry-core/ecma/base/ecma-helpers.h
new file mode 100644 (file)
index 0000000..1731a59
--- /dev/null
@@ -0,0 +1,364 @@
+/* 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.
+ */
+
+#ifndef ECMA_HELPERS_H
+#define ECMA_HELPERS_H
+
+#include "ecma-globals.h"
+#include "jmem.h"
+#include "lit-strings.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmahelpers Helpers for operations with ECMA data types
+ * @{
+ */
+
+/**
+ * Get value of pointer from specified non-null compressed pointer.
+ */
+#define ECMA_GET_NON_NULL_POINTER(type, field) JMEM_CP_GET_NON_NULL_POINTER (type, field)
+
+/**
+ * Get value of pointer from specified compressed pointer.
+ */
+#define ECMA_GET_POINTER(type, field) JMEM_CP_GET_POINTER (type, field)
+
+/**
+ * Set value of non-null compressed pointer so that it will correspond
+ * to specified non_compressed_pointer.
+ */
+#define ECMA_SET_NON_NULL_POINTER(field, non_compressed_pointer) JMEM_CP_SET_NON_NULL_POINTER (field, \
+                                                                                               non_compressed_pointer)
+
+/**
+ * Set value of compressed pointer so that it will correspond
+ * to specified non_compressed_pointer.
+ */
+#define ECMA_SET_POINTER(field, non_compressed_pointer) JMEM_CP_SET_POINTER (field, non_compressed_pointer)
+
+/**
+ * Convert ecma-string's contents to a cesu-8 string and put it into a buffer.
+ */
+#define ECMA_STRING_TO_UTF8_STRING(ecma_str_ptr, /**< ecma string pointer */ \
+                                   utf8_ptr, /**< [out] output buffer pointer */ \
+                                   utf8_str_size) /**< [out] output buffer size */ \
+  lit_utf8_size_t utf8_str_size; \
+  bool utf8_ptr ## must_be_freed; \
+  const lit_utf8_byte_t *utf8_ptr = ecma_string_raw_chars (ecma_str_ptr, &utf8_str_size, &utf8_ptr ## must_be_freed); \
+  utf8_ptr ## must_be_freed = false; /* it was used as 'is_ascii' in  'ecma_string_raw_chars', so we must reset it */ \
+  \
+  if (utf8_ptr == NULL) \
+  { \
+    utf8_ptr = (const lit_utf8_byte_t *) jmem_heap_alloc_block (utf8_str_size); \
+    ecma_string_to_utf8_bytes (ecma_str_ptr, (lit_utf8_byte_t *) utf8_ptr, utf8_str_size); \
+    utf8_ptr ## must_be_freed = true; \
+  }
+
+#ifdef ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY
+
+/**
+ * Set an internal property value of pointer
+ */
+#define ECMA_SET_INTERNAL_VALUE_POINTER(field, pointer) \
+  (field) = ((ecma_value_t) pointer)
+
+/**
+ * Get an internal property value of pointer
+ */
+#define ECMA_GET_INTERNAL_VALUE_POINTER(type, field) \
+  ((type *) field)
+
+#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
+
+/**
+ * Set an internal property value of non-null pointer so that it will correspond
+ * to specified non_compressed_pointer.
+ */
+#define ECMA_SET_INTERNAL_VALUE_POINTER(field, non_compressed_pointer) \
+  ECMA_SET_NON_NULL_POINTER (field, non_compressed_pointer)
+
+/**
+ * Get an internal property value of pointer from specified compressed pointer.
+ */
+#define ECMA_GET_INTERNAL_VALUE_POINTER(type, field) \
+  ECMA_GET_POINTER (type, field)
+
+#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
+
+/**
+ * Free the cesu-8 string buffer allocated by 'ECMA_STRING_TO_UTF8_STRING'
+ */
+#define ECMA_FINALIZE_UTF8_STRING(utf8_ptr, /**< pointer to character buffer */ \
+                                  utf8_str_size) /**< buffer size */ \
+  if (utf8_ptr ## must_be_freed) \
+  { \
+    JERRY_ASSERT (utf8_ptr != NULL); \
+    jmem_heap_free_block ((void *) utf8_ptr, utf8_str_size); \
+  }
+
+/* ecma-helpers-value.c */
+bool ecma_is_value_direct (ecma_value_t value) __attr_const___;
+bool ecma_is_value_simple (ecma_value_t value) __attr_const___;
+bool ecma_is_value_empty (ecma_value_t value) __attr_const___;
+bool ecma_is_value_undefined (ecma_value_t value) __attr_const___;
+bool ecma_is_value_null (ecma_value_t value) __attr_const___;
+bool ecma_is_value_boolean (ecma_value_t value) __attr_const___;
+bool ecma_is_value_true (ecma_value_t value) __attr_const___;
+bool ecma_is_value_false (ecma_value_t value) __attr_const___;
+bool ecma_is_value_found (ecma_value_t value) __attr_const___;
+bool ecma_is_value_array_hole (ecma_value_t value) __attr_const___;
+
+bool ecma_is_value_integer_number (ecma_value_t value) __attr_const___;
+bool ecma_are_values_integer_numbers (ecma_value_t first_value, ecma_value_t second_value) __attr_const___;
+bool ecma_is_value_float_number (ecma_value_t value) __attr_const___;
+bool ecma_is_value_number (ecma_value_t value) __attr_const___;
+bool ecma_is_value_string (ecma_value_t value) __attr_const___;
+bool ecma_is_value_object (ecma_value_t value) __attr_const___;
+
+void ecma_check_value_type_is_spec_defined (ecma_value_t value);
+
+ecma_value_t ecma_make_simple_value (const ecma_simple_value_t value) __attr_const___;
+ecma_value_t ecma_make_boolean_value (bool boolean_value) __attr_const___;
+ecma_value_t ecma_make_integer_value (ecma_integer_value_t integer_value) __attr_const___;
+ecma_value_t ecma_make_nan_value (void);
+ecma_value_t ecma_make_number_value (ecma_number_t ecma_number);
+ecma_value_t ecma_make_int32_value (int32_t int32_number);
+ecma_value_t ecma_make_uint32_value (uint32_t uint32_number);
+ecma_value_t ecma_make_string_value (const ecma_string_t *ecma_string_p) __attr_pure___;
+ecma_value_t ecma_make_object_value (const ecma_object_t *object_p) __attr_pure___;
+ecma_value_t ecma_make_error_value (ecma_value_t value) __attr_const___;
+ecma_value_t ecma_make_error_obj_value (const ecma_object_t *object_p) __attr_pure___;
+ecma_integer_value_t ecma_get_integer_from_value (ecma_value_t value) __attr_const___;
+ecma_number_t ecma_get_float_from_value (ecma_value_t value) __attr_pure___;
+ecma_number_t ecma_get_number_from_value (ecma_value_t value) __attr_pure___;
+ecma_string_t *ecma_get_string_from_value (ecma_value_t value) __attr_pure___;
+ecma_object_t *ecma_get_object_from_value (ecma_value_t value) __attr_pure___;
+ecma_value_t ecma_get_value_from_error_value (ecma_value_t value) __attr_const___;
+ecma_value_t ecma_invert_boolean_value (ecma_value_t value) __attr_const___;
+ecma_value_t ecma_copy_value (ecma_value_t value);
+ecma_value_t ecma_fast_copy_value (ecma_value_t value);
+ecma_value_t ecma_copy_value_if_not_object (ecma_value_t value);
+ecma_value_t ecma_update_float_number (ecma_value_t float_value, ecma_number_t new_number);
+void ecma_value_assign_value (ecma_value_t *value_p, ecma_value_t ecma_value);
+void ecma_value_assign_number (ecma_value_t *value_p, ecma_number_t ecma_number);
+void ecma_free_value (ecma_value_t value);
+void ecma_fast_free_value (ecma_value_t value);
+void ecma_free_value_if_not_object (ecma_value_t value);
+
+/* ecma-helpers-string.c */
+ecma_string_t *ecma_new_ecma_string_from_utf8 (const lit_utf8_byte_t *string_p, lit_utf8_size_t string_size);
+ecma_string_t *ecma_new_ecma_string_from_utf8_converted_to_cesu8 (const lit_utf8_byte_t *string_p,
+                                                                  lit_utf8_size_t string_size);
+ecma_string_t *ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit);
+ecma_string_t *ecma_new_ecma_string_from_uint32 (uint32_t uint32_number);
+ecma_string_t *ecma_new_ecma_string_from_number (ecma_number_t num);
+ecma_string_t *ecma_new_ecma_string_from_magic_string_id (lit_magic_string_id_t id);
+ecma_string_t *ecma_new_ecma_string_from_magic_string_ex_id (lit_magic_string_ex_id_t id);
+ecma_string_t *ecma_new_ecma_length_string (void);
+ecma_string_t *ecma_concat_ecma_strings (ecma_string_t *string1_p, ecma_string_t *string2_p);
+void ecma_ref_ecma_string (ecma_string_t *string_p);
+void ecma_deref_ecma_string (ecma_string_t *string_p);
+ecma_number_t ecma_string_to_number (const ecma_string_t *str_p);
+uint32_t ecma_string_get_array_index (const ecma_string_t *str_p);
+
+lit_utf8_size_t __attr_return_value_should_be_checked___
+ecma_string_copy_to_cesu8_buffer (const ecma_string_t *string_desc_p,
+                                  lit_utf8_byte_t *buffer_p,
+                                  lit_utf8_size_t buffer_size);
+lit_utf8_size_t __attr_return_value_should_be_checked___
+ecma_string_copy_to_utf8_buffer (const ecma_string_t *string_desc_p,
+                                 lit_utf8_byte_t *buffer_p,
+                                 lit_utf8_size_t buffer_size);
+lit_utf8_size_t
+ecma_substring_copy_to_cesu8_buffer (const ecma_string_t *string_desc_p,
+                                     ecma_length_t start_pos,
+                                     ecma_length_t end_pos,
+                                     lit_utf8_byte_t *buffer_p,
+                                     lit_utf8_size_t buffer_size);
+lit_utf8_size_t
+ecma_substring_copy_to_utf8_buffer (const ecma_string_t *string_desc_p,
+                                    ecma_length_t start_pos,
+                                    ecma_length_t end_pos,
+                                    lit_utf8_byte_t *buffer_p,
+                                    lit_utf8_size_t buffer_size);
+void ecma_string_to_utf8_bytes (const ecma_string_t *string_desc_p, lit_utf8_byte_t *buffer_p,
+                                lit_utf8_size_t buffer_size);
+const lit_utf8_byte_t *ecma_string_raw_chars (const ecma_string_t *string_p, lit_utf8_size_t *size_p, bool *is_ascii_p);
+void ecma_init_ecma_string_from_uint32 (ecma_string_t *string_desc_p, uint32_t uint32_number);
+void ecma_init_ecma_length_string (ecma_string_t *string_desc_p);
+void ecma_init_ecma_magic_string (ecma_string_t *string_desc_p, lit_magic_string_id_t id);
+bool ecma_string_is_empty (const ecma_string_t *str_p);
+bool ecma_string_is_length (const ecma_string_t *string_p);
+
+jmem_cpointer_t ecma_string_to_property_name (ecma_string_t *prop_name_p, ecma_property_t *name_type_p);
+ecma_string_t *ecma_string_from_property_name (ecma_property_t property, jmem_cpointer_t prop_name_cp);
+lit_string_hash_t ecma_string_get_property_name_hash (ecma_property_t property, jmem_cpointer_t prop_name_cp);
+uint32_t ecma_string_get_property_index (ecma_property_t property, jmem_cpointer_t prop_name_cp);
+bool ecma_string_compare_to_property_name (ecma_property_t property, jmem_cpointer_t prop_name_cp,
+                                           const ecma_string_t *string_p);
+
+bool ecma_compare_ecma_strings (const ecma_string_t *string1_p, const ecma_string_t *string2_p);
+bool ecma_compare_ecma_strings_relational (const ecma_string_t *string1_p, const ecma_string_t *string2_p);
+ecma_length_t ecma_string_get_length (const ecma_string_t *string_p);
+ecma_length_t ecma_string_get_utf8_length (const ecma_string_t *string_p);
+lit_utf8_size_t ecma_string_get_size (const ecma_string_t *string_p);
+lit_utf8_size_t ecma_string_get_utf8_size (const ecma_string_t *string_p);
+ecma_char_t ecma_string_get_char_at_pos (const ecma_string_t *string_p, ecma_length_t index);
+
+ecma_string_t *ecma_get_magic_string (lit_magic_string_id_t id);
+ecma_string_t *ecma_get_magic_string_ex (lit_magic_string_ex_id_t id);
+lit_magic_string_id_t ecma_get_string_magic (const ecma_string_t *string_p);
+
+lit_string_hash_t ecma_string_hash (const ecma_string_t *string_p);
+ecma_string_t *ecma_string_substr (const ecma_string_t *string_p, ecma_length_t start_pos, ecma_length_t end_pos);
+ecma_string_t *ecma_string_trim (const ecma_string_t *string_p);
+
+/* ecma-helpers-number.c */
+ecma_number_t ecma_number_make_nan (void);
+ecma_number_t ecma_number_make_infinity (bool sign);
+bool ecma_number_is_nan (ecma_number_t num);
+bool ecma_number_is_negative (ecma_number_t num);
+bool ecma_number_is_zero (ecma_number_t num);
+bool ecma_number_is_infinity (ecma_number_t num);
+int32_t
+ecma_number_get_fraction_and_exponent (ecma_number_t num, uint64_t *out_fraction_p, int32_t *out_exponent_p);
+ecma_number_t
+ecma_number_make_normal_positive_from_fraction_and_exponent (uint64_t fraction, int32_t exponent);
+ecma_number_t
+ecma_number_make_from_sign_mantissa_and_exponent (bool sign, uint64_t mantissa, int32_t exponent);
+ecma_number_t ecma_number_get_prev (ecma_number_t num);
+ecma_number_t ecma_number_get_next (ecma_number_t num);
+ecma_number_t ecma_number_negate (ecma_number_t num);
+ecma_number_t ecma_number_trunc (ecma_number_t num);
+ecma_number_t ecma_number_calc_remainder (ecma_number_t left_num, ecma_number_t right_num);
+ecma_number_t ecma_number_add (ecma_number_t left_num, ecma_number_t right_num);
+ecma_number_t ecma_number_substract (ecma_number_t left_num, ecma_number_t right_num);
+ecma_number_t ecma_number_multiply (ecma_number_t left_num, ecma_number_t right_num);
+ecma_number_t ecma_number_divide (ecma_number_t left_num, ecma_number_t right_num);
+lit_utf8_size_t ecma_number_to_decimal (ecma_number_t num, lit_utf8_byte_t *out_digits_p, int32_t *out_decimal_exp_p);
+
+/* ecma-helpers-values-collection.c */
+ecma_collection_header_t *ecma_new_values_collection (const ecma_value_t values_buffer[], ecma_length_t values_number,
+                                                      bool do_ref_if_object);
+void ecma_free_values_collection (ecma_collection_header_t *header_p, bool do_deref_if_object);
+void ecma_append_to_values_collection (ecma_collection_header_t *header_p, ecma_value_t v, bool do_ref_if_object);
+void ecma_remove_last_value_from_values_collection (ecma_collection_header_t *header_p);
+ecma_collection_header_t *ecma_new_strings_collection (ecma_string_t *string_ptrs_buffer[],
+                                                       ecma_length_t strings_number);
+
+/**
+ * Context of ecma values' collection iterator
+ */
+typedef struct
+{
+  ecma_collection_header_t *header_p; /**< collection header */
+  jmem_cpointer_t next_chunk_cp; /**< compressed pointer to next chunk */
+  ecma_length_t current_index; /**< index of current element */
+  const ecma_value_t *current_value_p; /**< pointer to current element */
+  const ecma_value_t *current_chunk_beg_p; /**< pointer to beginning of current chunk's data */
+  const ecma_value_t *current_chunk_end_p; /**< pointer to place right after the end of current chunk's data */
+} ecma_collection_iterator_t;
+
+void
+ecma_collection_iterator_init (ecma_collection_iterator_t *iterator_p, ecma_collection_header_t *collection_p);
+bool
+ecma_collection_iterator_next (ecma_collection_iterator_t *iterator_p);
+
+/* ecma-helpers.c */
+ecma_object_t *ecma_create_object (ecma_object_t *prototype_object_p, size_t ext_object_size, ecma_object_type_t type);
+ecma_object_t *ecma_create_decl_lex_env (ecma_object_t *outer_lexical_environment_p);
+ecma_object_t *ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, ecma_object_t *binding_obj_p,
+                                           bool provide_this);
+bool ecma_is_lexical_environment (const ecma_object_t *object_p) __attr_pure___;
+bool ecma_get_object_extensible (const ecma_object_t *object_p) __attr_pure___;
+void ecma_set_object_extensible (ecma_object_t *object_p, bool is_extensible);
+ecma_object_type_t ecma_get_object_type (const ecma_object_t *object_p) __attr_pure___;
+ecma_object_t *ecma_get_object_prototype (const ecma_object_t *object_p) __attr_pure___;
+bool ecma_get_object_is_builtin (const ecma_object_t *object_p) __attr_pure___;
+void ecma_set_object_is_builtin (ecma_object_t *object_p);
+uint8_t ecma_get_object_builtin_id (ecma_object_t *object_p);
+ecma_lexical_environment_type_t ecma_get_lex_env_type (const ecma_object_t *object_p) __attr_pure___;
+ecma_object_t *ecma_get_lex_env_outer_reference (const ecma_object_t *object_p) __attr_pure___;
+ecma_property_header_t *ecma_get_property_list (const ecma_object_t *object_p) __attr_pure___;
+ecma_object_t *ecma_get_lex_env_binding_object (const ecma_object_t *object_p) __attr_pure___;
+bool ecma_get_lex_env_provide_this (const ecma_object_t *object_p) __attr_pure___;
+
+ecma_property_value_t *
+ecma_create_named_data_property (ecma_object_t *object_p, ecma_string_t *name_p, uint8_t prop_attributes,
+                                 ecma_property_t **out_prop_p);
+ecma_property_value_t *
+ecma_create_named_accessor_property (ecma_object_t *object_p, ecma_string_t *name_p, ecma_object_t *get_p,
+                                     ecma_object_t *set_p, uint8_t prop_attributes, ecma_property_t **out_prop_p);
+ecma_property_t *
+ecma_find_named_property (ecma_object_t *obj_p, ecma_string_t *name_p);
+ecma_property_value_t *
+ecma_get_named_data_property (ecma_object_t *obj_p, ecma_string_t *name_p);
+
+void ecma_free_property (ecma_object_t *object_p, jmem_cpointer_t name_cp, ecma_property_t *property_p);
+
+void ecma_delete_property (ecma_object_t *object_p, ecma_property_value_t *prop_value_p);
+uint32_t ecma_delete_array_properties (ecma_object_t *object_p, uint32_t new_length, uint32_t old_length);
+
+void ecma_named_data_property_assign_value (ecma_object_t *obj_p, ecma_property_value_t *prop_value_p,
+                                            ecma_value_t value);
+
+ecma_object_t *ecma_get_named_accessor_property_getter (const ecma_property_value_t *prop_value_p);
+ecma_object_t *ecma_get_named_accessor_property_setter (const ecma_property_value_t *prop_value_p);
+void ecma_set_named_accessor_property_getter (ecma_object_t *object_p, ecma_property_value_t *prop_value_p,
+                                              ecma_object_t *getter_p);
+void ecma_set_named_accessor_property_setter (ecma_object_t *object_p, ecma_property_value_t *prop_value_p,
+                                              ecma_object_t *setter_p);
+bool ecma_is_property_writable (ecma_property_t property);
+void ecma_set_property_writable_attr (ecma_property_t *property_p, bool is_writable);
+bool ecma_is_property_enumerable (ecma_property_t property);
+void ecma_set_property_enumerable_attr (ecma_property_t *property_p, bool is_enumerable);
+bool ecma_is_property_configurable (ecma_property_t property);
+void ecma_set_property_configurable_attr (ecma_property_t *property_p, bool is_configurable);
+
+bool ecma_is_property_lcached (ecma_property_t *property_p);
+void ecma_set_property_lcached (ecma_property_t *property_p, bool is_lcached);
+
+ecma_property_descriptor_t ecma_make_empty_property_descriptor (void);
+void ecma_free_property_descriptor (ecma_property_descriptor_t *prop_desc_p);
+
+ecma_property_t *ecma_get_next_property_pair (ecma_property_pair_t *);
+
+void ecma_bytecode_ref (ecma_compiled_code_t *bytecode_p);
+void ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p);
+
+/* ecma-helpers-external-pointers.c */
+bool ecma_create_native_handle_property (ecma_object_t *obj_p, void *handle_p, void *free_cb);
+bool ecma_create_native_pointer_property (ecma_object_t *obj_p, void *native_p, void *info_p);
+ecma_native_pointer_t *ecma_get_native_pointer_value (ecma_object_t *obj_p, lit_magic_string_id_t id);
+void ecma_free_native_pointer (ecma_property_t *prop_p);
+
+/* ecma-helpers-conversion.c */
+ecma_number_t ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, lit_utf8_size_t str_size);
+lit_utf8_size_t ecma_uint32_to_utf8_string (uint32_t value, lit_utf8_byte_t *out_buffer_p, lit_utf8_size_t buffer_size);
+uint32_t ecma_number_to_uint32 (ecma_number_t num);
+int32_t ecma_number_to_int32 (ecma_number_t num);
+lit_utf8_size_t ecma_number_to_utf8_string (ecma_number_t num, lit_utf8_byte_t *buffer_p, lit_utf8_size_t buffer_size);
+
+/* ecma-helpers-errol.c */
+lit_utf8_size_t ecma_errol0_dtoa (double val, lit_utf8_byte_t *buffer_p, int32_t *exp_p);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_HELPERS_H */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-init-finalize.c b/deps/jerry/jerry-core/ecma/base/ecma-init-finalize.c
new file mode 100644 (file)
index 0000000..95b08d4
--- /dev/null
@@ -0,0 +1,71 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-gc.h"
+#include "ecma-helpers.h"
+#include "ecma-init-finalize.h"
+#include "ecma-lcache.h"
+#include "ecma-lex-env.h"
+#include "ecma-literal-storage.h"
+#include "jmem.h"
+#include "jcontext.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmainitfinalize Initialization and finalization of ECMA components
+ * @{
+ */
+
+/**
+ * Initialize ECMA components
+ */
+void
+ecma_init (void)
+{
+  ecma_lcache_init ();
+  ecma_init_global_lex_env ();
+
+  jmem_register_free_unused_memory_callback (ecma_free_unused_memory);
+
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+  JERRY_CONTEXT (ecma_prop_hashmap_alloc_state) = ECMA_PROP_HASHMAP_ALLOC_ON;
+  JERRY_CONTEXT (ecma_prop_hashmap_alloc_last_is_hs_gc) = false;
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+  ecma_job_queue_init ();
+#endif /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+} /* ecma_init */
+
+/**
+ * Finalize ECMA components
+ */
+void
+ecma_finalize (void)
+{
+  jmem_unregister_free_unused_memory_callback (ecma_free_unused_memory);
+
+  ecma_finalize_global_lex_env ();
+  ecma_finalize_builtins ();
+  ecma_gc_run (JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW);
+  ecma_finalize_lit_storage ();
+} /* ecma_finalize */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-init-finalize.h b/deps/jerry/jerry-core/ecma/base/ecma-init-finalize.h
new file mode 100644 (file)
index 0000000..0e4fda2
--- /dev/null
@@ -0,0 +1,34 @@
+/* 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.
+ */
+
+#ifndef ECMA_INIT_FINALIZE_H
+#define ECMA_INIT_FINALIZE_H
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmainitfinalize Initialization and finalization of ECMA components
+ * @{
+ */
+
+void ecma_init (void);
+void ecma_finalize (void);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_INIT_FINALIZE_H */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-lcache.c b/deps/jerry/jerry-core/ecma/base/ecma-lcache.c
new file mode 100644 (file)
index 0000000..6982883
--- /dev/null
@@ -0,0 +1,279 @@
+/* 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.
+ */
+
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-lcache.h"
+#include "jcontext.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmalcache Property lookup cache
+ * @{
+ */
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+
+/**
+ * Mask for hash bits
+ */
+#define ECMA_LCACHE_HASH_MASK (ECMA_LCACHE_HASH_ROWS_COUNT - 1)
+
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+
+/**
+ * Initialize LCache
+ */
+void
+ecma_lcache_init (void)
+{
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+  memset (JERRY_HASH_TABLE_CONTEXT (table), 0, sizeof (jerry_hash_table_t));
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+} /* ecma_lcache_init */
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+/**
+ * Invalidate specified LCache entry
+ */
+static inline void __attr_always_inline___
+ecma_lcache_invalidate_entry (ecma_lcache_hash_entry_t *entry_p) /**< entry to invalidate */
+{
+  JERRY_ASSERT (entry_p != NULL);
+  JERRY_ASSERT (entry_p->object_cp != ECMA_NULL_POINTER);
+  JERRY_ASSERT (entry_p->prop_p != NULL);
+
+  entry_p->object_cp = ECMA_NULL_POINTER;
+  ecma_set_property_lcached (entry_p->prop_p, false);
+} /* ecma_lcache_invalidate_entry */
+
+/**
+ * Compute the row index of object / property name pair
+ *
+ * @return row index
+ */
+static inline size_t __attr_always_inline___
+ecma_lcache_row_index (jmem_cpointer_t object_cp, /**< compressed pointer to object */
+                       lit_string_hash_t name_hash) /**< property name hash */
+{
+  /* Randomize the hash of the property name with the object pointer using a xor operation,
+   * so properties of different objects with the same name can be cached effectively. */
+  return (size_t) ((name_hash ^ object_cp) & ECMA_LCACHE_HASH_MASK);
+} /* ecma_lcache_row_index */
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+
+/**
+ * Insert an entry into LCache
+ */
+void
+ecma_lcache_insert (ecma_object_t *object_p, /**< object */
+                    jmem_cpointer_t name_cp, /**< property name */
+                    ecma_property_t *prop_p) /**< property */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (prop_p != NULL && !ecma_is_property_lcached (prop_p));
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*prop_p) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                || ECMA_PROPERTY_GET_TYPE (*prop_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+  jmem_cpointer_t object_cp;
+
+  ECMA_SET_NON_NULL_POINTER (object_cp, object_p);
+
+  lit_string_hash_t name_hash = ecma_string_get_property_name_hash (*prop_p, name_cp);
+  size_t row_index = ecma_lcache_row_index (object_cp, name_hash);
+  ecma_lcache_hash_entry_t *entries_p = JERRY_HASH_TABLE_CONTEXT (table)[row_index];
+
+  uint32_t entry_index;
+  for (entry_index = 0; entry_index < ECMA_LCACHE_HASH_ROW_LENGTH; entry_index++)
+  {
+    if (entries_p[entry_index].object_cp == ECMA_NULL_POINTER)
+    {
+      break;
+    }
+  }
+
+  if (entry_index == ECMA_LCACHE_HASH_ROW_LENGTH)
+  {
+    /* Invalidate the last entry. */
+    ecma_lcache_invalidate_entry (entries_p + ECMA_LCACHE_HASH_ROW_LENGTH - 1);
+
+    /* Shift other entries towards the end. */
+    for (uint32_t i = ECMA_LCACHE_HASH_ROW_LENGTH - 1; i > 0; i--)
+    {
+      entries_p[i] = entries_p[i - 1];
+    }
+
+    entry_index = 0;
+  }
+
+  ecma_lcache_hash_entry_t *entry_p = entries_p + entry_index;
+  ECMA_SET_NON_NULL_POINTER (entry_p->object_cp, object_p);
+  entry_p->prop_name_cp = name_cp;
+  entry_p->prop_p = prop_p;
+
+  ecma_set_property_lcached (entry_p->prop_p, true);
+#else  /* CONFIG_ECMA_LCACHE_DISABLE */
+  JERRY_UNUSED (name_cp);
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+} /* ecma_lcache_insert */
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+
+/**
+ * Converts a string into a property name
+ *
+ * @return the compressed pointer part of the name
+ */
+static inline jmem_cpointer_t __attr_always_inline___
+ecma_string_to_lcache_property_name (const ecma_string_t *prop_name_p, /**< property name */
+                                     ecma_property_t *name_type_p) /**< [out] property name type */
+{
+  ecma_string_container_t container = ECMA_STRING_GET_CONTAINER (prop_name_p);
+
+  switch (container)
+  {
+    case ECMA_STRING_CONTAINER_UINT32_IN_DESC:
+    case ECMA_STRING_CONTAINER_MAGIC_STRING:
+    case ECMA_STRING_CONTAINER_MAGIC_STRING_EX:
+    {
+#ifdef JERRY_CPOINTER_32_BIT
+
+      *name_type_p = (ecma_property_t) container;
+      return (jmem_cpointer_t) prop_name_p->u.uint32_number;
+
+#else /* !JERRY_CPOINTER_32_BIT */
+
+      if (prop_name_p->u.uint32_number < (UINT16_MAX + 1))
+      {
+        *name_type_p = (ecma_property_t) container;
+        return (jmem_cpointer_t) prop_name_p->u.uint32_number;
+      }
+
+#endif /* JERRY_CPOINTER_32_BIT */
+
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  *name_type_p = ECMA_PROPERTY_NAME_TYPE_STRING;
+
+  jmem_cpointer_t prop_name_cp;
+  ECMA_SET_NON_NULL_POINTER (prop_name_cp, prop_name_p);
+  return prop_name_cp;
+} /* ecma_string_to_lcache_property_name */
+
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+
+/**
+ * Lookup property in the LCache
+ *
+ * @return a pointer to an ecma_property_t if the lookup is successful
+ *         NULL otherwise
+ */
+inline ecma_property_t * __attr_always_inline___
+ecma_lcache_lookup (ecma_object_t *object_p, /**< object */
+                    const ecma_string_t *prop_name_p) /**< property's name */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (prop_name_p != NULL);
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+  jmem_cpointer_t object_cp;
+  ECMA_SET_NON_NULL_POINTER (object_cp, object_p);
+
+  size_t row_index = ecma_lcache_row_index (object_cp, ecma_string_hash (prop_name_p));
+  ecma_lcache_hash_entry_t *entry_p = JERRY_HASH_TABLE_CONTEXT (table) [row_index];
+  ecma_lcache_hash_entry_t *entry_end_p = entry_p + ECMA_LCACHE_HASH_ROW_LENGTH;
+
+  ecma_property_t prop_name_type;
+  jmem_cpointer_t prop_name_cp = ecma_string_to_lcache_property_name (prop_name_p, &prop_name_type);
+
+  while (entry_p < entry_end_p)
+  {
+    if (entry_p->object_cp == object_cp
+        && entry_p->prop_name_cp == prop_name_cp)
+    {
+      ecma_property_t *prop_p = entry_p->prop_p;
+
+      JERRY_ASSERT (prop_p != NULL && ecma_is_property_lcached (prop_p));
+
+      if (ECMA_PROPERTY_GET_NAME_TYPE (*prop_p) == prop_name_type)
+      {
+        return prop_p;
+      }
+    }
+    else
+    {
+      /* They can be equal, but generic string comparison is too costly. */
+    }
+
+    entry_p++;
+  }
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+
+  return NULL;
+} /* ecma_lcache_lookup */
+
+/**
+ * Invalidate LCache entries associated with given object and property name / property
+ */
+void
+ecma_lcache_invalidate (ecma_object_t *object_p, /**< object */
+                        jmem_cpointer_t name_cp, /**< property name */
+                        ecma_property_t *prop_p) /**< property */
+{
+  JERRY_ASSERT (object_p != NULL);
+  JERRY_ASSERT (prop_p != NULL && ecma_is_property_lcached (prop_p));
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*prop_p) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                || ECMA_PROPERTY_GET_TYPE (*prop_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+  jmem_cpointer_t object_cp;
+  ECMA_SET_NON_NULL_POINTER (object_cp, object_p);
+
+  lit_string_hash_t name_hash = ecma_string_get_property_name_hash (*prop_p, name_cp);
+  size_t row_index = ecma_lcache_row_index (object_cp, name_hash);
+  ecma_lcache_hash_entry_t *entry_p = JERRY_HASH_TABLE_CONTEXT (table) [row_index];
+
+  for (uint32_t entry_index = 0; entry_index < ECMA_LCACHE_HASH_ROW_LENGTH; entry_index++)
+  {
+    if (entry_p->object_cp != ECMA_NULL_POINTER && entry_p->prop_p == prop_p)
+    {
+      JERRY_ASSERT (entry_p->object_cp == object_cp);
+
+      ecma_lcache_invalidate_entry (entry_p);
+      return;
+    }
+    entry_p++;
+  }
+
+  /* The property must be present. */
+  JERRY_UNREACHABLE ();
+#else  /* CONFIG_ECMA_LCACHE_DISABLE */
+  JERRY_UNUSED (name_cp);
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+} /* ecma_lcache_invalidate */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-lcache.h b/deps/jerry/jerry-core/ecma/base/ecma-lcache.h
new file mode 100644 (file)
index 0000000..d37f7e8
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+#ifndef ECMA_LCACHE_H
+#define ECMA_LCACHE_H
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmalcache Property lookup cache
+ * @{
+ */
+
+void ecma_lcache_init (void);
+void ecma_lcache_insert (ecma_object_t *object_p, jmem_cpointer_t name_cp, ecma_property_t *prop_p);
+ecma_property_t *ecma_lcache_lookup (ecma_object_t *object_p, const ecma_string_t *prop_name_p);
+void ecma_lcache_invalidate (ecma_object_t *object_p, jmem_cpointer_t name_cp, ecma_property_t *prop_p);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_LCACHE_H */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-literal-storage.c b/deps/jerry/jerry-core/ecma/base/ecma-literal-storage.c
new file mode 100644 (file)
index 0000000..c0d40e2
--- /dev/null
@@ -0,0 +1,521 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-literal-storage.h"
+#include "ecma-helpers.h"
+#include "jcontext.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmalitstorage Literal storage
+ * @{
+ */
+
+/**
+ * Free string list
+ */
+static void
+ecma_free_string_list (ecma_lit_storage_item_t *string_list_p) /**< string list */
+{
+  while (string_list_p != NULL)
+  {
+    for (int i = 0; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+    {
+      if (string_list_p->values[i] != JMEM_CP_NULL)
+      {
+        ecma_string_t *string_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                string_list_p->values[i]);
+
+        JERRY_ASSERT (ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p));
+        ecma_deref_ecma_string (string_p);
+      }
+    }
+
+    ecma_lit_storage_item_t *prev_item = string_list_p;
+    string_list_p = JMEM_CP_GET_POINTER (ecma_lit_storage_item_t, string_list_p->next_cp);
+    jmem_pools_free (prev_item, sizeof (ecma_lit_storage_item_t));
+  }
+} /* ecma_free_string_list */
+
+/**
+ * Finalize literal storage
+ */
+void
+ecma_finalize_lit_storage (void)
+{
+  ecma_free_string_list (JERRY_CONTEXT (string_list_first_p));
+  ecma_free_string_list (JERRY_CONTEXT (number_list_first_p));
+} /* ecma_finalize_lit_storage */
+
+/**
+ * Find or create a literal string.
+ *
+ * @return ecma_string_t compressed pointer
+ */
+jmem_cpointer_t
+ecma_find_or_create_literal_string (const lit_utf8_byte_t *chars_p, /**< string to be searched */
+                                    lit_utf8_size_t size) /**< size of the string */
+{
+  ecma_string_t *string_p = ecma_new_ecma_string_from_utf8 (chars_p, size);
+
+  ecma_lit_storage_item_t *string_list_p = JERRY_CONTEXT (string_list_first_p);
+  jmem_cpointer_t *empty_cpointer_p = NULL;
+
+  while (string_list_p != NULL)
+  {
+    for (int i = 0; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+    {
+      if (string_list_p->values[i] == JMEM_CP_NULL)
+      {
+        if (empty_cpointer_p == NULL)
+        {
+          empty_cpointer_p = string_list_p->values + i;
+        }
+      }
+      else
+      {
+        ecma_string_t *value_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                               string_list_p->values[i]);
+
+        if (ecma_compare_ecma_strings (string_p, value_p))
+        {
+          /* Return with string if found in the list. */
+          ecma_deref_ecma_string (string_p);
+          return string_list_p->values[i];
+        }
+      }
+    }
+
+    string_list_p = JMEM_CP_GET_POINTER (ecma_lit_storage_item_t, string_list_p->next_cp);
+  }
+
+  jmem_cpointer_t result;
+  JMEM_CP_SET_NON_NULL_POINTER (result, string_p);
+
+  if (empty_cpointer_p != NULL)
+  {
+    *empty_cpointer_p = result;
+    return result;
+  }
+
+  ecma_lit_storage_item_t *new_item_p;
+  new_item_p = (ecma_lit_storage_item_t *) jmem_pools_alloc (sizeof (ecma_lit_storage_item_t));
+
+  new_item_p->values[0] = result;
+  for (int i = 1; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+  {
+    new_item_p->values[i] = JMEM_CP_NULL;
+  }
+
+  JMEM_CP_SET_POINTER (new_item_p->next_cp, JERRY_CONTEXT (string_list_first_p));
+  JERRY_CONTEXT (string_list_first_p) = new_item_p;
+
+  return result;
+} /* ecma_find_or_create_literal_string */
+
+/**
+ * Find or create a literal number.
+ *
+ * @return ecma_string_t compressed pointer
+ */
+jmem_cpointer_t
+ecma_find_or_create_literal_number (ecma_number_t number_arg) /**< number to be searched */
+{
+  ecma_value_t num = ecma_make_number_value (number_arg);
+
+  ecma_lit_storage_item_t *number_list_p = JERRY_CONTEXT (number_list_first_p);
+  jmem_cpointer_t *empty_cpointer_p = NULL;
+
+  while (number_list_p != NULL)
+  {
+    for (int i = 0; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+    {
+      if (number_list_p->values[i] == JMEM_CP_NULL)
+      {
+        if (empty_cpointer_p == NULL)
+        {
+          empty_cpointer_p = number_list_p->values + i;
+        }
+      }
+      else
+      {
+        ecma_string_t *value_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                               number_list_p->values[i]);
+
+        JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (value_p) == ECMA_STRING_LITERAL_NUMBER);
+
+        if (ecma_is_value_integer_number (num))
+        {
+          if (value_p->u.lit_number == num)
+          {
+            return number_list_p->values[i];
+          }
+        }
+        else
+        {
+          if (ecma_is_value_float_number (value_p->u.lit_number)
+              && ecma_get_float_from_value (value_p->u.lit_number) == ecma_get_float_from_value (num))
+          {
+            ecma_free_value (num);
+            return number_list_p->values[i];
+          }
+        }
+      }
+    }
+
+    number_list_p = JMEM_CP_GET_POINTER (ecma_lit_storage_item_t, number_list_p->next_cp);
+  }
+
+  ecma_string_t *string_p = ecma_alloc_string ();
+  string_p->refs_and_container = ECMA_STRING_REF_ONE | ECMA_STRING_LITERAL_NUMBER;
+  string_p->u.lit_number = num;
+
+  jmem_cpointer_t result;
+  JMEM_CP_SET_NON_NULL_POINTER (result, string_p);
+
+  if (empty_cpointer_p != NULL)
+  {
+    *empty_cpointer_p = result;
+    return result;
+  }
+
+  ecma_lit_storage_item_t *new_item_p;
+  new_item_p = (ecma_lit_storage_item_t *) jmem_pools_alloc (sizeof (ecma_lit_storage_item_t));
+
+  new_item_p->values[0] = result;
+  for (int i = 1; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+  {
+    new_item_p->values[i] = JMEM_CP_NULL;
+  }
+
+  JMEM_CP_SET_POINTER (new_item_p->next_cp, JERRY_CONTEXT (number_list_first_p));
+  JERRY_CONTEXT (number_list_first_p) = new_item_p;
+
+  return result;
+} /* ecma_find_or_create_literal_number */
+
+/**
+ * Log2 of snapshot literal alignment.
+ */
+#define JERRY_SNAPSHOT_LITERAL_ALIGNMENT_LOG 2
+
+/**
+ * Snapshot literal alignment.
+ */
+#define JERRY_SNAPSHOT_LITERAL_ALIGNMENT (1u << JERRY_SNAPSHOT_LITERAL_ALIGNMENT_LOG)
+
+#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
+
+/**
+ * Save literals to specified snapshot buffer.
+ *
+ * @return true - if save was performed successfully (i.e. buffer size is sufficient),
+ *         false - otherwise
+ */
+bool
+ecma_save_literals_for_snapshot (uint32_t *buffer_p, /**< [out] output snapshot buffer */
+                                 size_t buffer_size, /**< size of the buffer */
+                                 size_t *in_out_buffer_offset_p, /**< [in,out] write position in the buffer */
+                                 lit_mem_to_snapshot_id_map_entry_t **out_map_p, /**< [out] map from literal identifiers
+                                                                                  *   to the literal offsets
+                                                                                  *   in snapshot */
+                                 uint32_t *out_map_len_p, /**< [out] number of literals */
+                                 uint32_t *out_lit_table_size_p) /**< [out] number of bytes, saved to snapshot buffer */
+{
+  /* Count literals and literal space. */
+  uint32_t string_count = 0;
+  uint32_t number_count = 0;
+  uint32_t lit_table_size = 2 * sizeof (uint32_t);
+
+  ecma_lit_storage_item_t *string_list_p = JERRY_CONTEXT (string_list_first_p);
+
+  while (string_list_p != NULL)
+  {
+    for (int i = 0; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+    {
+      if (string_list_p->values[i] != JMEM_CP_NULL)
+      {
+        ecma_string_t *string_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                string_list_p->values[i]);
+
+        lit_table_size += (uint32_t) JERRY_ALIGNUP (sizeof (uint16_t) + ecma_string_get_size (string_p),
+                                                    JERRY_SNAPSHOT_LITERAL_ALIGNMENT);
+        string_count++;
+      }
+    }
+
+    string_list_p = JMEM_CP_GET_POINTER (ecma_lit_storage_item_t, string_list_p->next_cp);
+  }
+
+  ecma_lit_storage_item_t *number_list_p = JERRY_CONTEXT (number_list_first_p);
+
+  while (number_list_p != NULL)
+  {
+    for (int i = 0; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+    {
+      if (number_list_p->values[i] != JMEM_CP_NULL)
+      {
+        lit_table_size += (uint32_t) sizeof (ecma_number_t);
+        number_count++;
+      }
+    }
+
+    number_list_p = JMEM_CP_GET_POINTER (ecma_lit_storage_item_t, number_list_p->next_cp);
+  }
+
+  /* Check whether enough space is available. */
+  if (*in_out_buffer_offset_p + lit_table_size > buffer_size)
+  {
+    return false;
+  }
+
+  /* Check whether the maximum literal table size is reached. */
+  if ((lit_table_size >> JERRY_SNAPSHOT_LITERAL_ALIGNMENT_LOG) > UINT16_MAX)
+  {
+    return false;
+  }
+
+  uint32_t total_count = string_count + number_count;
+  lit_mem_to_snapshot_id_map_entry_t *map_p;
+
+  map_p = jmem_heap_alloc_block (total_count * sizeof (lit_mem_to_snapshot_id_map_entry_t));
+
+  /* Set return values (no error is possible from here). */
+  JERRY_ASSERT ((*in_out_buffer_offset_p % sizeof (uint32_t)) == 0);
+  buffer_p += *in_out_buffer_offset_p / sizeof (uint32_t);
+  *in_out_buffer_offset_p += lit_table_size;
+  *out_map_p = map_p;
+  *out_map_len_p = total_count;
+  *out_lit_table_size_p = lit_table_size;
+
+  /* Write data into the buffer. */
+
+  /* The zero value is reserved for NULL (no literal)
+   * constant so the first literal must have offset one. */
+  uint32_t literal_offset = JERRY_SNAPSHOT_LITERAL_ALIGNMENT;
+
+  buffer_p[0] = string_count;
+  buffer_p[1] = number_count;
+  buffer_p += 2;
+
+  string_list_p = JERRY_CONTEXT (string_list_first_p);
+
+  uint16_t *destination_p = (uint16_t *) buffer_p;
+
+  while (string_list_p != NULL)
+  {
+    for (int i = 0; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+    {
+      if (string_list_p->values[i] != JMEM_CP_NULL)
+      {
+        map_p->literal_id = string_list_p->values[i];
+        map_p->literal_offset = (jmem_cpointer_t) (literal_offset >> JERRY_SNAPSHOT_LITERAL_ALIGNMENT_LOG);
+        map_p++;
+
+        ecma_string_t *string_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                string_list_p->values[i]);
+
+        ecma_length_t length = ecma_string_get_size (string_p);
+
+        *destination_p = (uint16_t) length;
+        ecma_string_to_utf8_bytes (string_p, ((lit_utf8_byte_t *) destination_p) + sizeof (uint16_t), length);
+
+        length = JERRY_ALIGNUP (sizeof (uint16_t) + length,
+                                JERRY_SNAPSHOT_LITERAL_ALIGNMENT);
+
+        JERRY_ASSERT ((length % sizeof (uint16_t)) == 0);
+        destination_p += length / sizeof (uint16_t);
+        literal_offset += length;
+      }
+    }
+
+    string_list_p = JMEM_CP_GET_POINTER (ecma_lit_storage_item_t, string_list_p->next_cp);
+  }
+
+  number_list_p = JERRY_CONTEXT (number_list_first_p);
+
+  while (number_list_p != NULL)
+  {
+    for (int i = 0; i < ECMA_LIT_STORAGE_VALUE_COUNT; i++)
+    {
+      if (number_list_p->values[i] != JMEM_CP_NULL)
+      {
+        map_p->literal_id = number_list_p->values[i];
+        map_p->literal_offset = (jmem_cpointer_t) (literal_offset >> JERRY_SNAPSHOT_LITERAL_ALIGNMENT_LOG);
+        map_p++;
+
+        ecma_string_t *value_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                               number_list_p->values[i]);
+
+        JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (value_p) == ECMA_STRING_LITERAL_NUMBER);
+
+        ecma_number_t num = ecma_get_number_from_value (value_p->u.lit_number);
+        memcpy (destination_p, &num, sizeof (ecma_number_t));
+
+        ecma_length_t length = JERRY_ALIGNUP (sizeof (ecma_number_t),
+                                              JERRY_SNAPSHOT_LITERAL_ALIGNMENT);
+
+        JERRY_ASSERT ((length % sizeof (uint16_t)) == 0);
+        destination_p += length / sizeof (uint16_t);
+        literal_offset += length;
+      }
+    }
+
+    number_list_p = JMEM_CP_GET_POINTER (ecma_lit_storage_item_t, number_list_p->next_cp);
+  }
+
+  return true;
+} /* ecma_save_literals_for_snapshot */
+
+#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
+
+#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
+
+/**
+ * Helper function for ecma_load_literals_from_snapshot.
+ *
+ * Note: always inline because it is used only once.
+ *
+ * @return true - if load was performed successfully
+ *         false - otherwise (i.e. buffer length is incorrect)
+ */
+static inline bool __attr_always_inline___
+ecma_load_literals_from_buffer (const uint16_t *buffer_p, /**< buffer with literal table in snapshot */
+                                uint32_t lit_table_size, /**< size of literal table in snapshot */
+                                lit_mem_to_snapshot_id_map_entry_t *map_p, /**< literal map */
+                                uint32_t string_count, /**< number of strings */
+                                uint32_t number_count) /**< number of numbers */
+{
+  /* The zero value is reserved for NULL (no literal)
+   * constant so the first literal must have offset one. */
+  uint32_t literal_offset = JERRY_SNAPSHOT_LITERAL_ALIGNMENT;
+
+  /* Load strings first. */
+  while (string_count > 0)
+  {
+    if (lit_table_size < literal_offset + sizeof (uint32_t))
+    {
+      /* Buffer is not sufficent. */
+      return false;
+    }
+
+    lit_utf8_size_t length = *buffer_p;
+    lit_utf8_size_t aligned_length = JERRY_ALIGNUP (sizeof (uint16_t) + length,
+                                                    JERRY_SNAPSHOT_LITERAL_ALIGNMENT);
+
+    if (lit_table_size < literal_offset + aligned_length)
+    {
+      /* Buffer is not sufficent. */
+      return false;
+    }
+
+    map_p->literal_id = ecma_find_or_create_literal_string (((lit_utf8_byte_t *) buffer_p) + sizeof (uint16_t), length);
+    map_p->literal_offset = (jmem_cpointer_t) (literal_offset >> JERRY_SNAPSHOT_LITERAL_ALIGNMENT_LOG);
+    map_p++;
+
+    JERRY_ASSERT ((aligned_length % sizeof (uint16_t)) == 0);
+    buffer_p += aligned_length / sizeof (uint16_t);
+    literal_offset += aligned_length;
+
+    string_count--;
+  }
+
+  /* Load numbers. */
+  while (number_count > 0)
+  {
+    if (lit_table_size < literal_offset + sizeof (ecma_number_t))
+    {
+      /* Buffer is not sufficent. */
+      return false;
+    }
+
+    ecma_number_t num;
+    memcpy (&num, buffer_p, sizeof (ecma_number_t));
+
+    map_p->literal_id = ecma_find_or_create_literal_number (num);
+    map_p->literal_offset = (jmem_cpointer_t) (literal_offset >> JERRY_SNAPSHOT_LITERAL_ALIGNMENT_LOG);
+    map_p++;
+
+    ecma_length_t length = JERRY_ALIGNUP (sizeof (ecma_number_t),
+                                          JERRY_SNAPSHOT_LITERAL_ALIGNMENT);
+
+    JERRY_ASSERT ((length % sizeof (uint16_t)) == 0);
+    buffer_p += length / sizeof (uint16_t);
+    literal_offset += length;
+
+    number_count--;
+  }
+
+  return (lit_table_size == (literal_offset + 2 * sizeof (uint32_t) - JERRY_SNAPSHOT_LITERAL_ALIGNMENT));
+} /* ecma_load_literals_from_buffer */
+
+/**
+ * Load literals from snapshot.
+ *
+ * @return true - if load was performed successfully (i.e. literals saved in the snapshot are consistent),
+ *         false - otherwise (i.e. snapshot is incorrect)
+ */
+bool
+ecma_load_literals_from_snapshot (const uint32_t *buffer_p, /**< buffer with literal table in snapshot */
+                                  uint32_t lit_table_size, /**< size of literal table in snapshot */
+                                  lit_mem_to_snapshot_id_map_entry_t **out_map_p, /**< [out] map from literal offsets
+                                                                                   *   in snapshot to identifiers
+                                                                                   *   of loaded literals in literal
+                                                                                   *   storage */
+                                  uint32_t *out_map_len_p) /**< [out] literals number */
+{
+  *out_map_p = NULL;
+
+  if (lit_table_size < 2 * sizeof (uint32_t))
+  {
+    /* Buffer is not sufficent. */
+    return false;
+  }
+
+  uint32_t string_count = buffer_p[0];
+  uint32_t number_count = buffer_p[1];
+  buffer_p += 2;
+
+  uint32_t total_count = string_count + number_count;
+  lit_mem_to_snapshot_id_map_entry_t *map_p;
+
+  *out_map_len_p = total_count;
+
+  if (total_count == 0)
+  {
+    return true;
+  }
+
+  map_p = jmem_heap_alloc_block (total_count * sizeof (lit_mem_to_snapshot_id_map_entry_t));
+  *out_map_p = map_p;
+
+  if (ecma_load_literals_from_buffer ((uint16_t *) buffer_p, lit_table_size, map_p, string_count, number_count))
+  {
+    return true;
+  }
+
+  jmem_heap_free_block (map_p, total_count * sizeof (lit_mem_to_snapshot_id_map_entry_t));
+  *out_map_p = NULL;
+  return false;
+} /* ecma_load_literals_from_snapshot */
+
+#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-literal-storage.h b/deps/jerry/jerry-core/ecma/base/ecma-literal-storage.h
new file mode 100644 (file)
index 0000000..e9e1ec6
--- /dev/null
@@ -0,0 +1,61 @@
+/* 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.
+ */
+
+#ifndef ECMA_LIT_STORAGE_H
+#define ECMA_LIT_STORAGE_H
+
+#include "ecma-globals.h"
+#include "jmem.h"
+#include "lit-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmalitstorage Literal storage
+ * @{
+ */
+
+/**
+ * Snapshot literal - offset map
+ */
+typedef struct
+{
+  jmem_cpointer_t literal_id; /**< literal id */
+  jmem_cpointer_t literal_offset; /**< literal offset */
+} lit_mem_to_snapshot_id_map_entry_t;
+
+void ecma_finalize_lit_storage (void);
+
+jmem_cpointer_t ecma_find_or_create_literal_string (const lit_utf8_byte_t *chars_p, lit_utf8_size_t size);
+jmem_cpointer_t ecma_find_or_create_literal_number (ecma_number_t number_arg);
+
+#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
+bool
+ecma_save_literals_for_snapshot (uint32_t *, size_t, size_t *,
+                                 lit_mem_to_snapshot_id_map_entry_t **, uint32_t *, uint32_t *);
+#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
+
+#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
+bool
+ecma_load_literals_from_snapshot (const uint32_t *, uint32_t,
+                                  lit_mem_to_snapshot_id_map_entry_t **, uint32_t *);
+#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_LIT_STORAGE_H */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-property-hashmap.c b/deps/jerry/jerry-core/ecma/base/ecma-property-hashmap.c
new file mode 100644 (file)
index 0000000..d9c0047
--- /dev/null
@@ -0,0 +1,547 @@
+/* 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.
+ */
+
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-property-hashmap.h"
+#include "jrt-libc-includes.h"
+#include "jcontext.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmapropertyhashmap Property hashmap
+ * @{
+ */
+
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+
+/**
+ * Compute the total size of the property hashmap.
+ */
+#define ECMA_PROPERTY_HASHMAP_GET_TOTAL_SIZE(max_property_count) \
+  (sizeof (ecma_property_hashmap_t) + (max_property_count * sizeof (jmem_cpointer_t)) + (max_property_count >> 3))
+
+/**
+ * Number of items in the stepping table.
+ */
+#define ECMA_PROPERTY_HASHMAP_NUMBER_OF_STEPS 8
+
+/**
+ * Stepping values for searching items in the hashmap.
+ */
+static const uint8_t ecma_property_hashmap_steps[ECMA_PROPERTY_HASHMAP_NUMBER_OF_STEPS] JERRY_CONST_DATA =
+{
+  3, 5, 7, 11, 13, 17, 19, 23
+};
+
+/**
+ * Get the value of a bit in a bitmap.
+ */
+#define ECMA_PROPERTY_HASHMAP_GET_BIT(byte_p, index) \
+  ((byte_p)[(index) >> 3] & (1 << ((index) & 0x7)))
+
+/**
+ * Clear the value of a bit in a bitmap.
+ */
+#define ECMA_PROPERTY_HASHMAP_CLEAR_BIT(byte_p, index) \
+  ((byte_p)[(index) >> 3] = (uint8_t) ((byte_p)[(index) >> 3] & ~(1 << ((index) & 0x7))))
+
+/**
+ * Set the value of a bit in a bitmap.
+ */
+#define ECMA_PROPERTY_HASHMAP_SET_BIT(byte_p, index) \
+  ((byte_p)[(index) >> 3] = (uint8_t) ((byte_p)[(index) >> 3] | (1 << ((index) & 0x7))))
+
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+
+/**
+ * Create a new property hashmap for the object.
+ * The object must not have a property hashmap.
+ */
+void
+ecma_property_hashmap_create (ecma_object_t *object_p) /**< object */
+{
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+  if (JERRY_CONTEXT (ecma_prop_hashmap_alloc_state) != ECMA_PROP_HASHMAP_ALLOC_ON)
+  {
+    return;
+  }
+
+  ecma_property_header_t *prop_iter_p = ecma_get_property_list (object_p);
+
+  if (prop_iter_p == NULL)
+  {
+    return;
+  }
+
+  JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (prop_iter_p));
+
+  uint32_t named_property_count = 0;
+
+  while (prop_iter_p != NULL)
+  {
+    JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (prop_iter_p));
+
+    for (int i = 0; i < ECMA_PROPERTY_PAIR_ITEM_COUNT; i++)
+    {
+      ecma_property_types_t type = ECMA_PROPERTY_GET_TYPE (prop_iter_p->types[i]);
+
+      if (type == ECMA_PROPERTY_TYPE_NAMEDDATA || type == ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
+      {
+        named_property_count++;
+      }
+    }
+    prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                    prop_iter_p->next_property_cp);
+  }
+
+  if (named_property_count < (ECMA_PROPERTY_HASMAP_MINIMUM_SIZE / 2))
+  {
+    return;
+  }
+
+  /* The max_property_count must be power of 2. */
+  uint32_t max_property_count = ECMA_PROPERTY_HASMAP_MINIMUM_SIZE;
+
+  /* At least 1/3 items must be NULL. */
+  while (max_property_count < (named_property_count + (named_property_count >> 1)))
+  {
+    max_property_count <<= 1;
+  }
+
+  size_t total_size = ECMA_PROPERTY_HASHMAP_GET_TOTAL_SIZE (max_property_count);
+
+  ecma_property_hashmap_t *hashmap_p = (ecma_property_hashmap_t *) jmem_heap_alloc_block_null_on_error (total_size);
+
+  if (hashmap_p == NULL)
+  {
+    return;
+  }
+
+  memset (hashmap_p, 0, total_size);
+
+  hashmap_p->header.types[0] = ECMA_PROPERTY_TYPE_HASHMAP;
+  hashmap_p->header.types[1] = ECMA_PROPERTY_TYPE_DELETED;
+  hashmap_p->header.next_property_cp = object_p->property_list_or_bound_object_cp;
+  hashmap_p->max_property_count = max_property_count;
+  hashmap_p->null_count = max_property_count - named_property_count;
+  hashmap_p->unused_count = max_property_count - named_property_count;
+
+  jmem_cpointer_t *pair_list_p = (jmem_cpointer_t *) (hashmap_p + 1);
+  uint8_t *bits_p = (uint8_t *) (pair_list_p + max_property_count);
+  uint32_t mask = max_property_count - 1;
+
+  uint8_t shift_counter = 0;
+
+  if (max_property_count <= LIT_STRING_HASH_LIMIT)
+  {
+    hashmap_p->header.types[1] = 0;
+  }
+  else
+  {
+    while (max_property_count > LIT_STRING_HASH_LIMIT)
+    {
+      shift_counter++;
+      max_property_count >>= 1;
+    }
+  }
+
+  hashmap_p->header.types[1] = shift_counter;
+
+  prop_iter_p = ecma_get_property_list (object_p);
+  ECMA_SET_POINTER (object_p->property_list_or_bound_object_cp, hashmap_p);
+
+  while (prop_iter_p != NULL)
+  {
+    JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (prop_iter_p));
+
+    for (int i = 0; i < ECMA_PROPERTY_PAIR_ITEM_COUNT; i++)
+    {
+      if (!ECMA_PROPERTY_IS_NAMED_PROPERTY (prop_iter_p->types[i]))
+      {
+        continue;
+      }
+
+      ecma_property_pair_t *property_pair_p = (ecma_property_pair_t *) prop_iter_p;
+
+      uint32_t entry_index = ecma_string_get_property_name_hash (prop_iter_p->types[i],
+                                                                 property_pair_p->names_cp[i]);
+      uint32_t step = ecma_property_hashmap_steps[entry_index & (ECMA_PROPERTY_HASHMAP_NUMBER_OF_STEPS - 1)];
+
+      if (mask < LIT_STRING_HASH_LIMIT)
+      {
+        entry_index &= mask;
+      }
+      else
+      {
+        entry_index <<= shift_counter;
+        JERRY_ASSERT (entry_index <= mask);
+      }
+
+#ifndef JERRY_NDEBUG
+      /* Because max_property_count (power of 2) and step (a prime
+       * number) are relative primes, all entries of the hasmap are
+       * visited exactly once before the start entry index is reached
+       * again. Furthermore because at least one NULL is present in
+       * the hashmap, the while loop must be terminated before the
+       * the starting index is reached again. */
+      uint32_t start_entry_index = entry_index;
+#endif /* !JERRY_NDEBUG */
+
+      while (pair_list_p[entry_index] != ECMA_NULL_POINTER)
+      {
+        entry_index = (entry_index + step) & mask;
+
+#ifndef JERRY_NDEBUG
+        JERRY_ASSERT (entry_index != start_entry_index);
+#endif /* !JERRY_NDEBUG */
+      }
+
+      ECMA_SET_POINTER (pair_list_p[entry_index], property_pair_p);
+
+      if (i != 0)
+      {
+        ECMA_PROPERTY_HASHMAP_SET_BIT (bits_p, entry_index);
+      }
+    }
+
+    prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                    prop_iter_p->next_property_cp);
+  }
+#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+  JERRY_UNUSED (object_p);
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+} /* ecma_property_hashmap_create */
+
+/**
+ * Free the hashmap of the object.
+ * The object must have a property hashmap.
+ */
+void
+ecma_property_hashmap_free (ecma_object_t *object_p) /**< object */
+{
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+  /* Property hash must be exists and must be the first property. */
+  ecma_property_header_t *property_p = ecma_get_property_list (object_p);
+
+  JERRY_ASSERT (property_p != NULL && property_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP);
+
+  ecma_property_hashmap_t *hashmap_p = (ecma_property_hashmap_t *) property_p;
+
+  object_p->property_list_or_bound_object_cp = property_p->next_property_cp;
+
+  jmem_heap_free_block (hashmap_p,
+                        ECMA_PROPERTY_HASHMAP_GET_TOTAL_SIZE (hashmap_p->max_property_count));
+#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+  JERRY_UNUSED (object_p);
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+} /* ecma_property_hashmap_free */
+
+/**
+ * Insert named property into the hashmap.
+ */
+void
+ecma_property_hashmap_insert (ecma_object_t *object_p, /**< object */
+                              ecma_string_t *name_p, /**< name of the property */
+                              ecma_property_pair_t *property_pair_p, /**< property pair */
+                              int property_index) /**< property index in the pair (0 or 1) */
+{
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+  ecma_property_hashmap_t *hashmap_p = ECMA_GET_NON_NULL_POINTER (ecma_property_hashmap_t,
+                                                                  object_p->property_list_or_bound_object_cp);
+
+  JERRY_ASSERT (hashmap_p->header.types[0] == ECMA_PROPERTY_TYPE_HASHMAP);
+
+  /* The NULLs are reduced below 1/8 of the hashmap. */
+  if (hashmap_p->null_count < (hashmap_p->max_property_count >> 3))
+  {
+    ecma_property_hashmap_free (object_p);
+    ecma_property_hashmap_create (object_p);
+    return;
+  }
+
+  JERRY_ASSERT (property_index < ECMA_PROPERTY_PAIR_ITEM_COUNT);
+
+  uint32_t entry_index = name_p->hash;
+  uint32_t step = ecma_property_hashmap_steps[entry_index & (ECMA_PROPERTY_HASHMAP_NUMBER_OF_STEPS - 1)];
+  uint32_t mask = hashmap_p->max_property_count - 1;
+
+  if (mask < LIT_STRING_HASH_LIMIT)
+  {
+    entry_index &= mask;
+  }
+  else
+  {
+    entry_index <<= hashmap_p->header.types[1];
+  }
+
+#ifndef JERRY_NDEBUG
+  /* See the comment for this variable in ecma_property_hashmap_create. */
+  uint32_t start_entry_index = entry_index;
+#endif /* !JERRY_NDEBUG */
+
+  jmem_cpointer_t *pair_list_p = (jmem_cpointer_t *) (hashmap_p + 1);
+
+  while (pair_list_p[entry_index] != ECMA_NULL_POINTER)
+  {
+    entry_index = (entry_index + step) & mask;
+
+#ifndef JERRY_NDEBUG
+    JERRY_ASSERT (entry_index != start_entry_index);
+#endif /* !JERRY_NDEBUG */
+  }
+
+  ECMA_SET_POINTER (pair_list_p[entry_index], property_pair_p);
+
+  uint8_t *bits_p = (uint8_t *) (pair_list_p + hashmap_p->max_property_count);
+  bits_p += (entry_index >> 3);
+  mask = (uint32_t) (1 << (entry_index & 0x7));
+
+  if (!(*bits_p & mask))
+  {
+    /* Deleted entries also has ECMA_NULL_POINTER
+     * value, but they are not NULL values. */
+    hashmap_p->null_count--;
+    JERRY_ASSERT (hashmap_p->null_count > 0);
+  }
+
+  hashmap_p->unused_count--;
+  JERRY_ASSERT (hashmap_p->unused_count > 0);
+
+  if (property_index == 0)
+  {
+    *bits_p = (uint8_t) ((*bits_p) & ~mask);
+  }
+  else
+  {
+    *bits_p = (uint8_t) ((*bits_p) | mask);
+  }
+#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+  JERRY_UNUSED (object_p);
+  JERRY_UNUSED (name_p);
+  JERRY_UNUSED (property_pair_p);
+  JERRY_UNUSED (property_index);
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+} /* ecma_property_hashmap_insert */
+
+/**
+ * Delete named property from the hashmap.
+ *
+ * @return ECMA_PROPERTY_HASHMAP_DELETE_RECREATE_HASHMAP if hashmap should be recreated
+ *         ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP otherwise
+ */
+ecma_property_hashmap_delete_status
+ecma_property_hashmap_delete (ecma_object_t *object_p, /**< object */
+                              jmem_cpointer_t name_cp, /**< property name */
+                              ecma_property_t *property_p) /**< property */
+{
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+  ecma_property_hashmap_t *hashmap_p = ECMA_GET_NON_NULL_POINTER (ecma_property_hashmap_t,
+                                                                  object_p->property_list_or_bound_object_cp);
+
+  JERRY_ASSERT (hashmap_p->header.types[0] == ECMA_PROPERTY_TYPE_HASHMAP);
+
+  hashmap_p->unused_count++;
+
+  /* The NULLs are above 3/4 of the hashmap. */
+  if (hashmap_p->unused_count > ((hashmap_p->max_property_count * 3) >> 2))
+  {
+    return ECMA_PROPERTY_HASHMAP_DELETE_RECREATE_HASHMAP;
+  }
+
+  uint32_t entry_index = ecma_string_get_property_name_hash (*property_p, name_cp);
+  uint32_t step = ecma_property_hashmap_steps[entry_index & (ECMA_PROPERTY_HASHMAP_NUMBER_OF_STEPS - 1)];
+  uint32_t mask = hashmap_p->max_property_count - 1;
+  jmem_cpointer_t *pair_list_p = (jmem_cpointer_t *) (hashmap_p + 1);
+  uint8_t *bits_p = (uint8_t *) (pair_list_p + hashmap_p->max_property_count);
+
+  if (mask < LIT_STRING_HASH_LIMIT)
+  {
+    entry_index &= mask;
+  }
+  else
+  {
+    entry_index <<= hashmap_p->header.types[1];
+    JERRY_ASSERT (entry_index <= mask);
+  }
+
+#ifndef JERRY_NDEBUG
+  /* See the comment for this variable in ecma_property_hashmap_create. */
+  uint32_t start_entry_index = entry_index;
+#endif /* !JERRY_NDEBUG */
+
+  while (true)
+  {
+    if (pair_list_p[entry_index] != ECMA_NULL_POINTER)
+    {
+      size_t offset = 0;
+
+      if (ECMA_PROPERTY_HASHMAP_GET_BIT (bits_p, entry_index))
+      {
+        offset = 1;
+      }
+
+      ecma_property_pair_t *property_pair_p = ECMA_GET_NON_NULL_POINTER (ecma_property_pair_t,
+                                                                         pair_list_p[entry_index]);
+
+      if ((property_pair_p->header.types + offset) == property_p)
+      {
+        JERRY_ASSERT (property_pair_p->names_cp[offset] == name_cp);
+
+        pair_list_p[entry_index] = ECMA_NULL_POINTER;
+        ECMA_PROPERTY_HASHMAP_SET_BIT (bits_p, entry_index);
+        return ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP;
+      }
+    }
+    else
+    {
+      /* Must be a deleted entry. */
+      JERRY_ASSERT (ECMA_PROPERTY_HASHMAP_GET_BIT (bits_p, entry_index));
+    }
+
+    entry_index = (entry_index + step) & mask;
+
+#ifndef JERRY_NDEBUG
+    JERRY_ASSERT (entry_index != start_entry_index);
+#endif /* !JERRY_NDEBUG */
+  }
+#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+  JERRY_UNUSED (object_p);
+  JERRY_UNUSED (name_cp);
+  JERRY_UNUSED (property_p);
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+  return ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP;
+} /* ecma_property_hashmap_delete */
+
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+/**
+ * Find a named property.
+ *
+ * @return pointer to the property if found or NULL otherwise
+ */
+ecma_property_t *
+ecma_property_hashmap_find (ecma_property_hashmap_t *hashmap_p, /**< hashmap */
+                            ecma_string_t *name_p, /**< property name */
+                            jmem_cpointer_t *property_real_name_cp) /**< [out] property real name */
+{
+#ifndef JERRY_NDEBUG
+  /* A sanity check in debug mode: a named property must be present
+   * in both the property hashmap and in the property chain, or missing
+   * from both data collection. The following code checks the property
+   * chain, and sets the property_found variable. */
+  bool property_found = false;
+  ecma_property_header_t *prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                                          hashmap_p->header.next_property_cp);
+
+  while (prop_iter_p != NULL && !property_found)
+  {
+    JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (prop_iter_p));
+
+    ecma_property_pair_t *prop_pair_p = (ecma_property_pair_t *) prop_iter_p;
+
+    for (int i = 0; i < ECMA_PROPERTY_PAIR_ITEM_COUNT; i++)
+    {
+      if (ECMA_PROPERTY_IS_NAMED_PROPERTY (prop_iter_p->types[i]))
+      {
+        if (ecma_string_compare_to_property_name (prop_iter_p->types[i],
+                                                  prop_pair_p->names_cp[i],
+                                                  name_p))
+        {
+          property_found = true;
+          break;
+        }
+      }
+    }
+
+    prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                    prop_iter_p->next_property_cp);
+  }
+#endif /* !JERRY_NDEBUG */
+
+  uint32_t entry_index = name_p->hash;
+  uint32_t step = ecma_property_hashmap_steps[entry_index & (ECMA_PROPERTY_HASHMAP_NUMBER_OF_STEPS - 1)];
+  uint32_t mask = hashmap_p->max_property_count - 1;
+  jmem_cpointer_t *pair_list_p = (jmem_cpointer_t *) (hashmap_p + 1);
+  uint8_t *bits_p = (uint8_t *) (pair_list_p + hashmap_p->max_property_count);
+
+  if (mask < LIT_STRING_HASH_LIMIT)
+  {
+    entry_index &= mask;
+  }
+  else
+  {
+    entry_index <<= hashmap_p->header.types[1];
+    JERRY_ASSERT (entry_index <= mask);
+  }
+
+#ifndef JERRY_NDEBUG
+  /* See the comment for this variable in ecma_property_hashmap_create. */
+  uint32_t start_entry_index = entry_index;
+#endif /* !JERRY_NDEBUG */
+
+  while (true)
+  {
+    if (pair_list_p[entry_index] != ECMA_NULL_POINTER)
+    {
+      size_t offset = 0;
+      if (ECMA_PROPERTY_HASHMAP_GET_BIT (bits_p, entry_index))
+      {
+        offset = 1;
+      }
+
+      ecma_property_pair_t *property_pair_p = ECMA_GET_NON_NULL_POINTER (ecma_property_pair_t,
+                                                                         pair_list_p[entry_index]);
+
+      ecma_property_t *property_p = property_pair_p->header.types + offset;
+
+      JERRY_ASSERT (ECMA_PROPERTY_IS_NAMED_PROPERTY (*property_p));
+
+      if (ecma_string_compare_to_property_name (*property_p,
+                                                property_pair_p->names_cp[offset],
+                                                name_p))
+      {
+#ifndef JERRY_NDEBUG
+        JERRY_ASSERT (property_found);
+#endif /* !JERRY_NDEBUG */
+        *property_real_name_cp = property_pair_p->names_cp[offset];
+        return property_p;
+      }
+    }
+    else
+    {
+      if (!ECMA_PROPERTY_HASHMAP_GET_BIT (bits_p, entry_index))
+      {
+#ifndef JERRY_NDEBUG
+        JERRY_ASSERT (!property_found);
+#endif /* !JERRY_NDEBUG */
+        return NULL;
+      }
+      /* Otherwise it is a deleted entry. */
+    }
+
+    entry_index = (entry_index + step) & mask;
+
+#ifndef JERRY_NDEBUG
+    JERRY_ASSERT (entry_index != start_entry_index);
+#endif /* !JERRY_NDEBUG */
+  }
+} /* ecma_property_hashmap_find */
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/base/ecma-property-hashmap.h b/deps/jerry/jerry-core/ecma/base/ecma-property-hashmap.h
new file mode 100644 (file)
index 0000000..02d11a2
--- /dev/null
@@ -0,0 +1,83 @@
+/* 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.
+ */
+
+#ifndef ECMA_PROPERTY_HASHMAP_H
+#define ECMA_PROPERTY_HASHMAP_H
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmapropertyhashmap Property hashmap
+ * @{
+ */
+
+/**
+ * Recommended minimum number of items in a property cache.
+ */
+#define ECMA_PROPERTY_HASMAP_MINIMUM_SIZE 32
+
+/**
+ * Property hash.
+ */
+typedef struct
+{
+  ecma_property_header_t header; /**< header of the property */
+  uint32_t max_property_count; /**< maximum property count (power of 2) */
+  uint32_t null_count; /**< number of NULLs in the map */
+  uint32_t unused_count; /**< number of unused entires in the map */
+
+  /*
+   * The hash is followed by max_property_count ecma_cpointer_t
+   * compressed pointers and (max_property_count + 7) / 8 bytes
+   * which stores a flag for each compressed pointer.
+   *
+   * If the compressed pointer is equal to ECMA_NULL_POINTER
+   *   - flag is cleared if the entry is NULL
+   *   - flag is set if the entry is deleted
+   *
+   * If the compressed pointer is not equal to ECMA_NULL_POINTER
+   *   - flag is cleared if the first entry of a property pair is referenced
+   *   - flag is set if the second entry of a property pair is referenced
+   */
+} ecma_property_hashmap_t;
+
+/**
+ * Simple ecma values
+ */
+typedef enum
+{
+  ECMA_PROPERTY_HASHMAP_DELETE_NO_HASHMAP, /**< object has no hashmap */
+  ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP, /**< object has hashmap */
+  ECMA_PROPERTY_HASHMAP_DELETE_RECREATE_HASHMAP, /**< hashmap should be recreated */
+} ecma_property_hashmap_delete_status;
+
+void ecma_property_hashmap_create (ecma_object_t *object_p);
+void ecma_property_hashmap_free (ecma_object_t *object_p);
+void ecma_property_hashmap_insert (ecma_object_t *object_p, ecma_string_t *name_p,
+                                   ecma_property_pair_t *property_pair_p, int property_index);
+ecma_property_hashmap_delete_status ecma_property_hashmap_delete (ecma_object_t *object_p, jmem_cpointer_t name_cp,
+                                                                  ecma_property_t *property_p);
+
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+ecma_property_t *ecma_property_hashmap_find (ecma_property_hashmap_t *hashmap_p, ecma_string_t *name_p,
+                                             jmem_cpointer_t *property_real_name_cp);
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_PROPERTY_HASHMAP_H */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c
new file mode 100644 (file)
index 0000000..d499769
--- /dev/null
@@ -0,0 +1,2795 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-array-object.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-comparison.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-array-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID array_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup arrayprototype ECMA Array.prototype object built-in
+ * @{
+ */
+
+/**
+ * Helper function to set an object's length property
+ *
+ * @return ecma value (return value of the [[Put]] method)
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_helper_set_length (ecma_object_t *object, /**< object*/
+                                                ecma_number_t length) /**< new length */
+{
+  ecma_value_t ret_value;
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  ecma_value_t length_value = ecma_make_number_value (length);
+  ret_value = ecma_op_object_put (object,
+                                  magic_string_length_p,
+                                  length_value,
+                                  true),
+
+  ecma_free_value (length_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_helper_set_length */
+
+/**
+ * The Array.prototype object's 'toString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this_value,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this_value);
+
+  ecma_string_t *join_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_JOIN);
+
+  /* 2. */
+  ECMA_TRY_CATCH (join_value,
+                  ecma_op_object_get (obj_p, join_magic_string_p),
+                  ret_value);
+
+  if (!ecma_op_is_callable (join_value))
+  {
+    /* 3. */
+    ret_value = ecma_builtin_helper_object_to_string (this_arg);
+  }
+  else
+  {
+    /* 4. */
+    ecma_object_t *join_func_obj_p = ecma_get_object_from_value (join_value);
+
+    ret_value = ecma_op_function_call (join_func_obj_p, this_arg, NULL, 0);
+  }
+
+  ECMA_FINALIZE (join_value);
+
+  ecma_deref_ecma_string (join_magic_string_p);
+
+  ECMA_FINALIZE (obj_this_value);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_to_string */
+
+/**
+ * The Array.prototype object's 'toLocaleString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_to_locale_string (const ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_value,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_value);
+
+  ecma_string_t *length_magic_string_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (length_value,
+                  ecma_op_object_get (obj_p, length_magic_string_p),
+                  ret_value);
+
+  /* 3. */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (length_number,
+                               length_value,
+                               ret_value);
+
+  uint32_t length = ecma_number_to_uint32 (length_number);
+
+  /* 4. Implementation-defined: set the separator to a single comma character */
+  ecma_string_t *separator_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_COMMA_CHAR);
+
+  /* 5. */
+  if (length == 0)
+  {
+    ecma_string_t *empty_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+    ret_value = ecma_make_string_value (empty_string_p);
+  }
+  else
+  {
+    /* 7-8. */
+    ECMA_TRY_CATCH (first_value,
+                    ecma_builtin_helper_get_to_locale_string_at_index (obj_p, 0),
+                    ret_value);
+
+    ecma_string_t *return_string_p = ecma_get_string_from_value (first_value);
+    ecma_ref_ecma_string (return_string_p);
+
+    /* 9-10. */
+    for (uint32_t k = 1; ecma_is_value_empty (ret_value) && (k < length); k++)
+    {
+      ecma_string_t *part_string_p = ecma_concat_ecma_strings (return_string_p, separator_string_p);
+
+      ECMA_TRY_CATCH (next_string_value,
+                      ecma_builtin_helper_get_to_locale_string_at_index (obj_p, k),
+                      ret_value);
+
+      ecma_string_t *next_string_p = ecma_get_string_from_value (next_string_value);
+
+      ecma_deref_ecma_string (return_string_p);
+
+      return_string_p = ecma_concat_ecma_strings (part_string_p, next_string_p);
+
+      ECMA_FINALIZE (next_string_value);
+
+      ecma_deref_ecma_string (part_string_p);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      ret_value = ecma_make_string_value (return_string_p);
+    }
+    else
+    {
+      ecma_deref_ecma_string (return_string_p);
+    }
+
+    ECMA_FINALIZE (first_value);
+  }
+
+  ecma_deref_ecma_string (separator_string_p);
+
+  ECMA_OP_TO_NUMBER_FINALIZE (length_number);
+
+  ECMA_FINALIZE (length_value);
+
+  ecma_deref_ecma_string (length_magic_string_p);
+
+  ECMA_FINALIZE (obj_value);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_to_locale_string */
+
+/**
+ * The Array.prototype object's 'concat' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_concat (ecma_value_t this_arg, /**< this argument */
+                                            const ecma_value_t args[], /**< arguments list */
+                                            ecma_length_t args_number) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  /* 2. */
+  ecma_value_t new_array = ecma_op_create_array_object (0, 0, false);
+  ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
+  uint32_t new_length = 0;
+
+  /* 5.b - 5.c for this_arg */
+  ECMA_TRY_CATCH (concat_this_value,
+                  ecma_builtin_helper_array_concat_value (new_array_p, &new_length, obj_this),
+                  ret_value);
+
+  /* 5. */
+  for (uint32_t arg_index = 0;
+       arg_index < args_number && ecma_is_value_empty (ret_value);
+       arg_index++)
+  {
+    ECMA_TRY_CATCH (concat_value,
+                    ecma_builtin_helper_array_concat_value (new_array_p, &new_length, args[arg_index]),
+                    ret_value);
+    ECMA_FINALIZE (concat_value);
+  }
+
+  ECMA_FINALIZE (concat_this_value);
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ECMA_TRY_CATCH (set_length_value,
+                    ecma_builtin_array_prototype_helper_set_length (new_array_p, ((ecma_number_t) new_length)),
+                    ret_value);
+    ret_value = new_array;
+    ECMA_FINALIZE (set_length_value);
+  }
+  else
+  {
+    ecma_free_value (new_array);
+  }
+
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_concat */
+
+/**
+ * The Array.prototype.toString's separator creation routine
+ *
+ * See also:
+ *          ECMA-262 v5.1, 15.4.4.2 4th step
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+
+static ecma_value_t
+ecma_op_array_get_separator_string (ecma_value_t separator) /**< possible separator */
+{
+  if (ecma_is_value_undefined (separator))
+  {
+    ecma_string_t *comma_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_COMMA_CHAR);
+    return ecma_make_string_value (comma_string_p);
+  }
+  else
+  {
+    return ecma_op_to_string (separator);
+  }
+} /* ecma_op_array_get_separator_string */
+
+/**
+ * The Array.prototype's 'toString' single element operation routine
+ *
+ * See also:
+ *          ECMA-262 v5.1, 15.4.4.2
+ *
+ * @return ecma_value_t value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_op_array_get_to_string_at_index (ecma_object_t *obj_p, /**< this object */
+                                      uint32_t index) /**< array index */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_string_t *index_string_p = ecma_new_ecma_string_from_uint32 (index);
+
+  ECMA_TRY_CATCH (index_value,
+                  ecma_op_object_get (obj_p, index_string_p),
+                  ret_value);
+
+  if (ecma_is_value_undefined (index_value)
+      || ecma_is_value_null (index_value))
+  {
+    ecma_string_t *empty_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+    ret_value = ecma_make_string_value (empty_string_p);
+  }
+  else
+  {
+    ret_value = ecma_op_to_string (index_value);
+  }
+
+  ECMA_FINALIZE (index_value);
+
+  ecma_deref_ecma_string (index_string_p);
+
+  return ret_value;
+} /* ecma_op_array_get_to_string_at_index */
+
+/**
+ * The Array.prototype object's 'join' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_join (const ecma_value_t this_arg, /**< this argument */
+                                   const ecma_value_t separator_arg) /**< separator argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_value,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_value);
+
+  ecma_string_t *length_magic_string_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (length_value,
+                  ecma_op_object_get (obj_p, length_magic_string_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (length_number,
+                               length_value,
+                               ret_value);
+
+  /* 3. */
+  uint32_t length = ecma_number_to_uint32 (length_number);
+
+  /* 4-5. */
+  ECMA_TRY_CATCH (separator_value,
+                  ecma_op_array_get_separator_string (separator_arg),
+                  ret_value);
+
+  if (length == 0)
+  {
+    /* 6. */
+    ecma_string_t *empty_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+    ret_value = ecma_make_string_value (empty_string_p);
+  }
+  else
+  {
+    ecma_string_t *separator_string_p = ecma_get_string_from_value (separator_value);
+
+    /* 7-8. */
+    ECMA_TRY_CATCH (first_value,
+                    ecma_op_array_get_to_string_at_index (obj_p, 0),
+                    ret_value);
+
+    ecma_string_t *return_string_p = ecma_get_string_from_value (first_value);
+    ecma_ref_ecma_string (return_string_p);
+
+    /* 9-10. */
+    for (uint32_t k = 1; ecma_is_value_empty (ret_value) && (k < length); k++)
+    {
+      /* 10.a */
+      ecma_string_t *part_string_p = ecma_concat_ecma_strings (return_string_p, separator_string_p);
+
+      /* 10.b, 10.c */
+      ECMA_TRY_CATCH (next_string_value,
+                      ecma_op_array_get_to_string_at_index (obj_p, k),
+                      ret_value);
+
+      ecma_string_t *next_string_p = ecma_get_string_from_value (next_string_value);
+
+      ecma_deref_ecma_string (return_string_p);
+
+      /* 10.d */
+      return_string_p = ecma_concat_ecma_strings (part_string_p, next_string_p);
+
+      ECMA_FINALIZE (next_string_value);
+
+      ecma_deref_ecma_string (part_string_p);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      ret_value = ecma_make_string_value (return_string_p);
+    }
+    else
+    {
+      ecma_deref_ecma_string (return_string_p);
+    }
+
+    ECMA_FINALIZE (first_value);
+  }
+
+  ECMA_FINALIZE (separator_value);
+
+  ECMA_OP_TO_NUMBER_FINALIZE (length_number);
+
+  ECMA_FINALIZE (length_value);
+
+  ecma_deref_ecma_string (length_magic_string_p);
+
+  ECMA_FINALIZE (obj_value);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_join */
+
+/**
+ * The Array.prototype object's 'pop' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.6
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_pop (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  if (len == 0)
+  {
+    /* 4.a */
+    ECMA_TRY_CATCH (set_length_value,
+                    ecma_builtin_array_prototype_helper_set_length (obj_p, ECMA_NUMBER_ZERO),
+                    ret_value);
+
+    /* 4.b */
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+    ECMA_FINALIZE (set_length_value)
+  }
+  else
+  {
+    len--;
+    /* 5.a */
+    ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (len);
+
+    /* 5.b */
+    ECMA_TRY_CATCH (get_value, ecma_op_object_get (obj_p, index_str_p), ret_value);
+
+    /* 5.c */
+    ECMA_TRY_CATCH (del_value, ecma_op_object_delete (obj_p, index_str_p, true), ret_value);
+
+    /* 5.d */
+    ECMA_TRY_CATCH (set_length_value,
+                    ecma_builtin_array_prototype_helper_set_length (obj_p, ((ecma_number_t) len)),
+                    ret_value);
+
+    ret_value = ecma_copy_value (get_value);
+
+    ECMA_FINALIZE (set_length_value);
+    ECMA_FINALIZE (del_value);
+    ECMA_FINALIZE (get_value);
+
+    ecma_deref_ecma_string (index_str_p);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_pop */
+
+/**
+ * The Array.prototype object's 'push' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.7
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_push (ecma_value_t this_arg, /**< this argument */
+                                          const ecma_value_t *argument_list_p, /**< arguments list */
+                                          ecma_length_t arguments_number) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this_value, ecma_op_to_object (this_arg), ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this_value);
+
+  /* 2. */
+  ecma_string_t *length_str_p = ecma_new_ecma_length_string ();
+
+  ECMA_TRY_CATCH (length_value, ecma_op_object_get (obj_p, length_str_p), ret_value);
+
+  /* 3. */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (length_var, length_value, ret_value);
+
+  ecma_number_t n = ((ecma_number_t) ecma_number_to_uint32 (length_var));
+
+  /* 5. */
+  for (uint32_t index = 0;
+       index < arguments_number && ecma_is_value_empty (ret_value);
+       index++, n++)
+  {
+    /* 5.a */
+    ecma_value_t e_value = argument_list_p[index];
+
+    /* 5.b */
+    ecma_string_t *n_str_p = ecma_new_ecma_string_from_number (n);
+
+    ECMA_TRY_CATCH (put_value, ecma_op_object_put (obj_p, n_str_p, e_value, true), ret_value);
+    ECMA_FINALIZE (put_value);
+
+    ecma_deref_ecma_string (n_str_p);
+  }
+
+  /* 6. */
+  if (ecma_is_value_empty (ret_value))
+  {
+    ECMA_TRY_CATCH (set_length_value,
+                    ecma_builtin_array_prototype_helper_set_length (obj_p, n),
+                    ret_value);
+
+    ret_value = ecma_make_number_value (n);
+
+    ECMA_FINALIZE (set_length_value)
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (length_var);
+
+  ECMA_FINALIZE (length_value);
+
+  ecma_deref_ecma_string (length_str_p);
+
+  ECMA_FINALIZE (obj_this_value);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_push */
+
+/**
+ * The Array.prototype object's 'reverse' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.8
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_reverse (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  /* 3. */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  uint32_t middle = len / 2;
+
+  /* 5-6. */
+  for (uint32_t lower = 0; lower < middle && ecma_is_value_empty (ret_value); lower++)
+  {
+    /* 6.a */
+    uint32_t upper = len - lower - 1;
+    /* 6.b and 6.c */
+    ecma_string_t *upper_str_p = ecma_new_ecma_string_from_uint32 (upper);
+    ecma_string_t *lower_str_p = ecma_new_ecma_string_from_uint32 (lower);
+
+    /* 6.d and 6.e */
+    ECMA_TRY_CATCH (lower_value, ecma_op_object_get (obj_p, lower_str_p), ret_value);
+    ECMA_TRY_CATCH (upper_value, ecma_op_object_get (obj_p, upper_str_p), ret_value);
+
+    /* 6.f and 6.g */
+    bool lower_exist = ecma_op_object_has_property (obj_p, lower_str_p);
+    bool upper_exist = ecma_op_object_has_property (obj_p, upper_str_p);
+
+    /* 6.h */
+    if (lower_exist && upper_exist)
+    {
+      ECMA_TRY_CATCH (outer_put_value, ecma_op_object_put (obj_p, lower_str_p, upper_value, true), ret_value);
+      ECMA_TRY_CATCH (inner_put_value, ecma_op_object_put (obj_p, upper_str_p, lower_value, true), ret_value);
+      ECMA_FINALIZE (inner_put_value);
+      ECMA_FINALIZE (outer_put_value);
+    }
+    /* 6.i */
+    else if (!lower_exist && upper_exist)
+    {
+      ECMA_TRY_CATCH (put_value, ecma_op_object_put (obj_p, lower_str_p, upper_value, true), ret_value);
+      ECMA_TRY_CATCH (del_value, ecma_op_object_delete (obj_p, upper_str_p, true), ret_value);
+      ECMA_FINALIZE (del_value);
+      ECMA_FINALIZE (put_value);
+    }
+    /* 6.j */
+    else if (lower_exist && !upper_exist)
+    {
+      ECMA_TRY_CATCH (del_value, ecma_op_object_delete (obj_p, lower_str_p, true), ret_value);
+      ECMA_TRY_CATCH (put_value, ecma_op_object_put (obj_p, upper_str_p, lower_value, true), ret_value);
+      ECMA_FINALIZE (put_value);
+      ECMA_FINALIZE (del_value);
+    }
+
+    ECMA_FINALIZE (upper_value);
+    ECMA_FINALIZE (lower_value);
+    ecma_deref_ecma_string (lower_str_p);
+    ecma_deref_ecma_string (upper_str_p);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    /* 7. */
+    ret_value = ecma_copy_value (obj_this);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_reverse */
+
+/**
+ * The Array.prototype object's 'shift' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.9
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_shift (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  if (len == 0)
+  {
+    ECMA_TRY_CATCH (set_length_value,
+                    ecma_builtin_array_prototype_helper_set_length (obj_p, ECMA_NUMBER_ZERO),
+                    ret_value);
+
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+    ECMA_FINALIZE (set_length_value);
+  }
+  else
+  {
+    ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (0);
+
+    /* 5. */
+    ECMA_TRY_CATCH (first_value, ecma_op_object_get (obj_p, index_str_p), ret_value);
+
+    /* 6. and 7. */
+    for (uint32_t k = 1; k < len && ecma_is_value_empty (ret_value); k++)
+    {
+      /* 7.a */
+      ecma_string_t *from_str_p = ecma_new_ecma_string_from_uint32 (k);
+      /* 7.b */
+      ecma_string_t *to_str_p = ecma_new_ecma_string_from_uint32 (k - 1);
+
+      /* 7.c */
+      ECMA_TRY_CATCH (curr_value, ecma_op_object_find (obj_p, from_str_p), ret_value);
+
+      if (ecma_is_value_found (curr_value))
+      {
+        /* 7.d.i, 7.d.ii */
+        ECMA_TRY_CATCH (put_value, ecma_op_object_put (obj_p, to_str_p, curr_value, true), ret_value);
+
+        ECMA_FINALIZE (put_value);
+      }
+      else
+      {
+        /* 7.e.i */
+        ECMA_TRY_CATCH (del_value, ecma_op_object_delete (obj_p, to_str_p, true), ret_value);
+        ECMA_FINALIZE (del_value);
+      }
+
+      ECMA_FINALIZE (curr_value);
+
+      ecma_deref_ecma_string (to_str_p);
+      ecma_deref_ecma_string (from_str_p);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      len--;
+      ecma_string_t *len_str_p = ecma_new_ecma_string_from_uint32 (len);
+
+      /* 8. */
+      ECMA_TRY_CATCH (del_value, ecma_op_object_delete (obj_p, len_str_p, true), ret_value);
+
+      /* 9. */
+      ECMA_TRY_CATCH (set_length_value,
+                      ecma_builtin_array_prototype_helper_set_length (obj_p, ((ecma_number_t) len)),
+                      ret_value);
+      /* 10. */
+      ret_value = ecma_copy_value (first_value);
+
+      ECMA_FINALIZE (set_length_value);
+      ECMA_FINALIZE (del_value);
+      ecma_deref_ecma_string (len_str_p);
+    }
+
+    ECMA_FINALIZE (first_value);
+    ecma_deref_ecma_string (index_str_p);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_shift */
+
+/**
+ * The Array.prototype object's 'slice' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.10
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_slice (ecma_value_t this_arg, /**< 'this' argument */
+                                           ecma_value_t arg1, /**< start */
+                                           ecma_value_t arg2) /**< end */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *length_magic_string_p = ecma_new_ecma_length_string ();
+
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, length_magic_string_p),
+                  ret_value);
+
+  /* 3. */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 4. */
+  const uint32_t len = ecma_number_to_uint32 (len_number);
+
+  uint32_t start = 0, end = len;
+
+  /* 5. */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (start_num, arg1, ret_value);
+
+  start = ecma_builtin_helper_array_index_normalize (start_num, len);
+
+  /* 7. */
+  if (ecma_is_value_undefined (arg2))
+  {
+    end = len;
+  }
+  else
+  {
+    /* 7. part 2 */
+    ECMA_OP_TO_NUMBER_TRY_CATCH (end_num, arg2, ret_value);
+
+    end = ecma_builtin_helper_array_index_normalize (end_num, len);
+
+    ECMA_OP_TO_NUMBER_FINALIZE (end_num);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (start_num);
+
+  JERRY_ASSERT (start <= len && end <= len);
+
+  ecma_value_t new_array = ecma_op_create_array_object (0, 0, false);
+  ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
+
+  /* 9. */
+  uint32_t n = 0;
+
+  /* 10. */
+  for (uint32_t k = start; k < end && ecma_is_value_empty (ret_value); k++, n++)
+  {
+    /* 10.a */
+    ecma_string_t *curr_idx_str_p = ecma_new_ecma_string_from_uint32 (k);
+
+    /* 10.c */
+    ECMA_TRY_CATCH (get_value, ecma_op_object_find (obj_p, curr_idx_str_p), ret_value);
+
+    if (ecma_is_value_found (get_value))
+    {
+      /* 10.c.i */
+      ecma_string_t *to_idx_str_p = ecma_new_ecma_string_from_uint32 (n);
+
+      /* 10.c.ii */
+      /* This will always be a simple value since 'is_throw' is false, so no need to free. */
+      ecma_value_t put_comp = ecma_builtin_helper_def_prop (new_array_p,
+                                                            to_idx_str_p,
+                                                            get_value,
+                                                            true, /* Writable */
+                                                            true, /* Enumerable */
+                                                            true, /* Configurable */
+                                                            false);
+      JERRY_ASSERT (ecma_is_value_true (put_comp));
+
+      ecma_deref_ecma_string (to_idx_str_p);
+    }
+
+    ECMA_FINALIZE (get_value);
+
+    ecma_deref_ecma_string (curr_idx_str_p);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = new_array;
+  }
+  else
+  {
+    ecma_free_value (new_array);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (length_magic_string_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_slice */
+
+/**
+ * SortCompare abstract method
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.11
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_sort_compare_helper (ecma_value_t j, /**< left value */
+                                                         ecma_value_t k, /**< right value */
+                                                         ecma_value_t comparefn) /**< compare function */
+{
+  /*
+   * ECMA-262 v5, 15.4.4.11 NOTE1: Because non-existent property values always
+   * compare greater than undefined property values, and undefined always
+   * compares greater than any other value, undefined property values always
+   * sort to the end of the result, followed by non-existent property values.
+   */
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_number_t result = ECMA_NUMBER_ZERO;
+
+  bool j_is_undef = ecma_is_value_undefined (j);
+  bool k_is_undef = ecma_is_value_undefined (k);
+
+  if (j_is_undef)
+  {
+    if (k_is_undef)
+    {
+      result = ECMA_NUMBER_ZERO;
+    }
+    else
+    {
+      result = ECMA_NUMBER_ONE;
+    }
+  }
+  else
+  {
+    if (k_is_undef)
+    {
+      result = ECMA_NUMBER_MINUS_ONE;
+    }
+    else
+    {
+      if (ecma_is_value_undefined (comparefn))
+      {
+        /* Default comparison when no comparefn is passed. */
+        ECMA_TRY_CATCH (j_value, ecma_op_to_string (j), ret_value);
+        ECMA_TRY_CATCH (k_value, ecma_op_to_string (k), ret_value);
+        ecma_string_t *j_str_p = ecma_get_string_from_value (j_value);
+        ecma_string_t *k_str_p = ecma_get_string_from_value (k_value);
+
+        if (ecma_compare_ecma_strings_relational (j_str_p, k_str_p))
+        {
+          result = ECMA_NUMBER_MINUS_ONE;
+        }
+        else if (!ecma_compare_ecma_strings (j_str_p, k_str_p))
+        {
+          result = ECMA_NUMBER_ONE;
+        }
+        else
+        {
+          result = ECMA_NUMBER_ZERO;
+        }
+
+        ECMA_FINALIZE (k_value);
+        ECMA_FINALIZE (j_value);
+      }
+      else
+      {
+        /*
+         * comparefn, if not undefined, will always contain a callable function object.
+         * We checked this previously, before this function was called.
+         */
+        JERRY_ASSERT (ecma_op_is_callable (comparefn));
+        ecma_object_t *comparefn_obj_p = ecma_get_object_from_value (comparefn);
+
+        ecma_value_t compare_args[] = {j, k};
+
+        ECMA_TRY_CATCH (call_value,
+                        ecma_op_function_call (comparefn_obj_p,
+                                               ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                               compare_args,
+                                               2),
+                        ret_value);
+
+        if (!ecma_is_value_number (call_value))
+        {
+          ECMA_OP_TO_NUMBER_TRY_CATCH (ret_num, call_value, ret_value);
+          result = ret_num;
+          ECMA_OP_TO_NUMBER_FINALIZE (ret_num);
+        }
+        else
+        {
+          result = ecma_get_number_from_value (call_value);
+        }
+
+        ECMA_FINALIZE (call_value);
+      }
+    }
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = ecma_make_number_value (result);
+  }
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_sort_compare_helper */
+
+/**
+ * Function used to reconstruct the ordered binary tree.
+ * Shifts 'index' down in the tree until it is in the correct position.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_array_to_heap_helper (ecma_value_t array[], /**< heap data array */
+                                                          int index, /**< current item index */
+                                                          int right, /**< right index is a maximum index */
+                                                          ecma_value_t comparefn) /**< compare function */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* Left child of the current index. */
+  int child = index * 2 + 1;
+  ecma_value_t swap = array[index];
+  bool should_break = false;
+
+  while (child <= right && ecma_is_value_empty (ret_value) && !should_break)
+  {
+    if (child < right)
+    {
+      /* Compare the two child nodes. */
+      ECMA_TRY_CATCH (child_compare_value,
+                      ecma_builtin_array_prototype_object_sort_compare_helper (array[child],
+                                                                               array[child + 1],
+                                                                               comparefn),
+                      ret_value);
+
+      JERRY_ASSERT (ecma_is_value_number (child_compare_value));
+
+      /* Use the child that is greater. */
+      if (ecma_get_number_from_value (child_compare_value) < ECMA_NUMBER_ZERO)
+      {
+        child++;
+      }
+
+      ECMA_FINALIZE (child_compare_value);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      JERRY_ASSERT (child <= right);
+
+      /* Compare current child node with the swap (tree top). */
+      ECMA_TRY_CATCH (swap_compare_value,
+                      ecma_builtin_array_prototype_object_sort_compare_helper (array[child],
+                                                                               swap,
+                                                                               comparefn),
+                      ret_value);
+      JERRY_ASSERT (ecma_is_value_number (swap_compare_value));
+
+      if (ecma_get_number_from_value (swap_compare_value) <= ECMA_NUMBER_ZERO)
+      {
+        /* Break from loop if current child is less than swap (tree top) */
+        should_break = true;
+      }
+      else
+      {
+        /* We have to move 'swap' lower in the tree, so shift current child up in the hierarchy. */
+        int parent = (child - 1) / 2;
+        JERRY_ASSERT (parent >= 0 && parent <= right);
+        array[parent] = array[child];
+
+        /* Update child to be the left child of the current node. */
+        child = child * 2 + 1;
+      }
+
+      ECMA_FINALIZE (swap_compare_value);
+    }
+  }
+
+  /*
+   * Loop ended, either current child does not exist, or is less than swap.
+   * This means that 'swap' should be placed in the parent node.
+   */
+  int parent = (child - 1) / 2;
+  JERRY_ASSERT (parent >= 0 && parent <= right);
+  array[parent] = swap;
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  }
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_array_to_heap_helper */
+
+/**
+ * Heapsort function
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_array_heap_sort_helper (ecma_value_t array[], /**< array to sort */
+                                                            int right, /**< right index */
+                                                            ecma_value_t comparefn) /**< compare function */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* First, construct the ordered binary tree from the array. */
+  for (int i = right / 2; i >= 0 && ecma_is_value_empty (ret_value); i--)
+  {
+    ECMA_TRY_CATCH (value,
+                    ecma_builtin_array_prototype_object_array_to_heap_helper (array,
+                                                                              i,
+                                                                              right,
+                                                                              comparefn),
+                    ret_value);
+    ECMA_FINALIZE (value);
+  }
+
+  /* Sorting elements. */
+  for (int i = right; i > 0 && ecma_is_value_empty (ret_value); i--)
+  {
+    /*
+     * The top element will always contain the largest value.
+     * Move top to the end, and remove it from the tree.
+     */
+    ecma_value_t swap = array[0];
+    array[0] = array[i];
+    array[i] = swap;
+
+    /* Rebuild binary tree from the remaining elements. */
+    ECMA_TRY_CATCH (value,
+                    ecma_builtin_array_prototype_object_array_to_heap_helper (array,
+                                                                              0,
+                                                                              i - 1,
+                                                                              comparefn),
+                    ret_value);
+    ECMA_FINALIZE (value);
+  }
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_array_heap_sort_helper */
+
+/**
+ * The Array.prototype object's 'sort' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.11
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_sort (ecma_value_t this_arg, /**< this argument */
+                                          ecma_value_t arg1) /**< comparefn */
+{
+  /* Check if the provided compare function is callable. */
+  if (!ecma_is_value_undefined (arg1) && !ecma_op_is_callable (arg1))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Compare function is not callable."));
+  }
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  ecma_collection_header_t *array_index_props_p = ecma_op_object_get_property_names (obj_p, true, false, false);
+
+  uint32_t defined_prop_count = 0;
+  uint32_t copied_num = 0;
+
+  ecma_collection_iterator_t iter;
+  ecma_collection_iterator_init (&iter, array_index_props_p);
+
+  /* Count properties with name that is array index less than len */
+  while (ecma_collection_iterator_next (&iter)
+         && ecma_is_value_empty (ret_value))
+  {
+    ecma_string_t *property_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+    uint32_t index = ecma_string_get_array_index (property_name_p);
+    JERRY_ASSERT (index != ECMA_STRING_NOT_ARRAY_INDEX);
+
+    if (index < len)
+    {
+      defined_prop_count++;
+    }
+  }
+
+  JMEM_DEFINE_LOCAL_ARRAY (values_buffer, defined_prop_count, ecma_value_t);
+
+  ecma_collection_iterator_init (&iter, array_index_props_p);
+
+  /* Copy unsorted array into a native c array. */
+  while (ecma_collection_iterator_next (&iter)
+         && ecma_is_value_empty (ret_value))
+  {
+    ecma_string_t *property_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+    uint32_t index = ecma_string_get_array_index (property_name_p);
+    JERRY_ASSERT (index != ECMA_STRING_NOT_ARRAY_INDEX);
+
+    if (index >= len)
+    {
+      break;
+    }
+
+    ECMA_TRY_CATCH (index_value, ecma_op_object_get (obj_p, property_name_p), ret_value);
+
+    values_buffer[copied_num++] = ecma_copy_value (index_value);
+
+    ECMA_FINALIZE (index_value);
+  }
+
+  JERRY_ASSERT (copied_num == defined_prop_count
+                || !ecma_is_value_empty (ret_value));
+
+  /* Sorting. */
+  if (copied_num > 1 && ecma_is_value_empty (ret_value))
+  {
+    ECMA_TRY_CATCH (sort_value,
+                    ecma_builtin_array_prototype_object_array_heap_sort_helper (values_buffer,
+                                                                                (int)(copied_num - 1),
+                                                                                arg1),
+                    ret_value);
+    ECMA_FINALIZE (sort_value);
+  }
+
+  /* Put sorted values to the front of the array. */
+  for (uint32_t index = 0;
+       index < copied_num && ecma_is_value_empty (ret_value);
+       index++)
+  {
+    ecma_string_t *index_string_p = ecma_new_ecma_string_from_uint32 (index);
+    ECMA_TRY_CATCH (put_value,
+                    ecma_op_object_put (obj_p, index_string_p, values_buffer[index], true),
+                    ret_value);
+    ECMA_FINALIZE (put_value);
+    ecma_deref_ecma_string (index_string_p);
+  }
+
+  /* Free values that were copied to the local array. */
+  for (uint32_t index = 0; index < copied_num; index++)
+  {
+    ecma_free_value (values_buffer[index]);
+  }
+
+  JMEM_FINALIZE_LOCAL_ARRAY (values_buffer);
+
+  /* Undefined properties should be in the back of the array. */
+
+  ecma_collection_iterator_init (&iter, array_index_props_p);
+
+  while (ecma_collection_iterator_next (&iter)
+         && ecma_is_value_empty (ret_value))
+  {
+    ecma_string_t *property_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+    uint32_t index = ecma_string_get_array_index (property_name_p);
+    JERRY_ASSERT (index != ECMA_STRING_NOT_ARRAY_INDEX);
+
+    if (index >= copied_num && index < len)
+    {
+      ECMA_TRY_CATCH (del_value, ecma_op_object_delete (obj_p, property_name_p, true), ret_value);
+      ECMA_FINALIZE (del_value);
+    }
+  }
+
+  ecma_free_values_collection (array_index_props_p, true);
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = ecma_copy_value (this_arg);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_sort */
+
+/**
+ * The Array.prototype object's 'splice' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.12
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_splice (ecma_value_t this_arg, /**< this argument */
+                                            const ecma_value_t args[], /**< arguments list */
+                                            ecma_length_t args_number) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+
+  /* 3. */
+  ecma_string_t *length_magic_string_p = ecma_new_ecma_length_string ();
+
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, length_magic_string_p),
+                  ret_value);
+
+  /* 4. */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number,
+                               len_value,
+                               ret_value);
+
+  const uint32_t len = ecma_number_to_uint32 (len_number);
+
+  ecma_value_t new_array = ecma_op_create_array_object (0, 0, false);
+  ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
+
+  uint32_t start = 0;
+  uint32_t delete_count = 0;
+
+  if (args_number > 0)
+  {
+    /* 5. */
+    ECMA_OP_TO_NUMBER_TRY_CATCH (start_num,
+                                 args[0],
+                                 ret_value);
+
+    start = ecma_builtin_helper_array_index_normalize (start_num, len);
+
+    /*
+     * If there is only one argument, that will be the start argument,
+     * and we must delete the additional elements.
+     */
+    if (args_number == 1)
+    {
+      delete_count = len - start;
+    }
+    else
+    {
+      /* 7. */
+      ECMA_OP_TO_NUMBER_TRY_CATCH (delete_num,
+                                   args[1],
+                                   ret_value);
+
+      if (!ecma_number_is_nan (delete_num))
+      {
+        if (ecma_number_is_negative (delete_num))
+        {
+          delete_count = 0;
+        }
+        else
+        {
+          delete_count = ecma_number_is_infinity (delete_num) ? len : ecma_number_to_uint32 (delete_num);
+
+          if (delete_count > len - start)
+          {
+            delete_count = len - start;
+          }
+        }
+      }
+      else
+      {
+        delete_count = 0;
+      }
+
+      ECMA_OP_TO_NUMBER_FINALIZE (delete_num);
+    }
+
+    ECMA_OP_TO_NUMBER_FINALIZE (start_num);
+  }
+
+  /* 8-9. */
+  uint32_t k = 0;
+
+  for (uint32_t del_item_idx; k < delete_count && ecma_is_value_empty (ret_value); k++)
+  {
+    /* 9.a */
+    del_item_idx = k + start;
+    ecma_string_t *idx_str_p = ecma_new_ecma_string_from_uint32 (del_item_idx);
+
+    /* 9.b */
+    ECMA_TRY_CATCH (get_value, ecma_op_object_find (obj_p, idx_str_p), ret_value);
+
+    if (ecma_is_value_found (get_value))
+    {
+      /* 9.c.i */
+
+      ecma_string_t *idx_str_new_p = ecma_new_ecma_string_from_uint32 (k);
+
+      /* 9.c.ii */
+      /* This will always be a simple value since 'is_throw' is false, so no need to free. */
+      ecma_value_t put_comp = ecma_builtin_helper_def_prop (new_array_p,
+                                                            idx_str_new_p,
+                                                            get_value,
+                                                            true, /* Writable */
+                                                            true, /* Enumerable */
+                                                            true, /* Configurable */
+                                                            false);
+      JERRY_ASSERT (ecma_is_value_true (put_comp));
+
+      ecma_deref_ecma_string (idx_str_new_p);
+    }
+
+    ECMA_FINALIZE (get_value);
+
+    ecma_deref_ecma_string (idx_str_p);
+  }
+
+  /* 11. */
+  ecma_length_t item_count;
+
+  if (args_number > 2)
+  {
+    item_count = (ecma_length_t) (args_number - 2);
+  }
+  else
+  {
+    item_count = 0;
+  }
+
+  const uint32_t new_len = len - delete_count + item_count;
+
+  if (item_count != delete_count)
+  {
+    uint32_t from, to;
+
+    /* 12. */
+    if (item_count < delete_count)
+    {
+      /* 12.b */
+      for (k = start; k < (len - delete_count) && ecma_is_value_empty (ret_value); k++)
+      {
+        from = k + delete_count;
+        ecma_string_t *from_str_p = ecma_new_ecma_string_from_uint32 (from);
+
+        to = k + item_count;
+        ecma_string_t *to_str_p = ecma_new_ecma_string_from_uint32 (to);
+
+        /* 12.b.iii */
+        ECMA_TRY_CATCH (get_value, ecma_op_object_find (obj_p, from_str_p), ret_value);
+
+        if (ecma_is_value_found (get_value))
+        {
+          /* 12.b.iv */
+          ECMA_TRY_CATCH (put_value,
+                          ecma_op_object_put (obj_p, to_str_p, get_value, true),
+                          ret_value);
+
+          ECMA_FINALIZE (put_value);
+        }
+        else
+        {
+          /* 12.b.v */
+          ECMA_TRY_CATCH (del_value,
+                          ecma_op_object_delete (obj_p, to_str_p, true),
+                          ret_value);
+
+          ECMA_FINALIZE (del_value);
+        }
+
+        ECMA_FINALIZE (get_value);
+
+        ecma_deref_ecma_string (to_str_p);
+        ecma_deref_ecma_string (from_str_p);
+      }
+
+      /* 12.d */
+      for (k = len; k > new_len && ecma_is_value_empty (ret_value); k--)
+      {
+        ecma_string_t *str_idx_p = ecma_new_ecma_string_from_uint32 (k - 1);
+        ECMA_TRY_CATCH (del_value,
+                        ecma_op_object_delete (obj_p, str_idx_p, true),
+                        ret_value);
+
+        ECMA_FINALIZE (del_value);
+        ecma_deref_ecma_string (str_idx_p);
+      }
+    }
+    /* 13. */
+    else if (item_count > delete_count)
+    {
+      /* 13.b */
+      for (k = len - delete_count; k > start  && ecma_is_value_empty (ret_value); k--)
+      {
+        from = k + delete_count - 1;
+        ecma_string_t *from_str_p = ecma_new_ecma_string_from_uint32 (from);
+
+        to = k + item_count - 1;
+        ecma_string_t *to_str_p = ecma_new_ecma_string_from_uint32 (to);
+
+        /* 13.b.iii */
+        ECMA_TRY_CATCH (get_value, ecma_op_object_find (obj_p, from_str_p), ret_value);
+
+        if (ecma_is_value_found (get_value))
+        {
+          /* 13.b.iv */
+          ECMA_TRY_CATCH (put_value,
+                          ecma_op_object_put (obj_p, to_str_p, get_value, true),
+                          ret_value);
+
+          ECMA_FINALIZE (put_value);
+        }
+        else
+        {
+          /* 13.b.v */
+          ECMA_TRY_CATCH (del_value,
+                          ecma_op_object_delete (obj_p, to_str_p, true),
+                          ret_value);
+
+          ECMA_FINALIZE (del_value);
+        }
+
+        ECMA_FINALIZE (get_value);
+
+        ecma_deref_ecma_string (to_str_p);
+        ecma_deref_ecma_string (from_str_p);
+      }
+    }
+  }
+
+  /* 15. */
+  ecma_length_t idx = 0;
+  for (ecma_length_t arg_index = 2;
+       arg_index < args_number && ecma_is_value_empty (ret_value);
+       arg_index++, idx++)
+  {
+    ecma_string_t *str_idx_p = ecma_new_ecma_string_from_uint32 ((uint32_t) (start + idx));
+    ECMA_TRY_CATCH (put_value,
+                    ecma_op_object_put (obj_p, str_idx_p, args[arg_index], true),
+                    ret_value);
+
+    ECMA_FINALIZE (put_value);
+    ecma_deref_ecma_string (str_idx_p);
+  }
+
+  /* 16. */
+  if (ecma_is_value_empty (ret_value))
+  {
+    ECMA_TRY_CATCH (set_length_value,
+                    ecma_builtin_array_prototype_helper_set_length (obj_p, ((ecma_number_t) new_len)),
+                    ret_value);
+
+    ECMA_FINALIZE (set_length_value);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = new_array;
+  }
+  else
+  {
+    ecma_free_value (new_array);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (length_magic_string_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_splice */
+
+/**
+ * The Array.prototype object's 'unshift' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.13
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_unshift (ecma_value_t this_arg, /**< this argument */
+                                             const ecma_value_t args[], /**< arguments list */
+                                             ecma_length_t args_number) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 5. and 6. */
+  for (uint32_t k = len; k > 0 && ecma_is_value_empty (ret_value); k--)
+  {
+    /* 6.a */
+    ecma_string_t *from_str_p = ecma_new_ecma_string_from_uint32 (k - 1);
+    /* 6.b */
+    ecma_number_t new_idx = ((ecma_number_t) k) + ((ecma_number_t) args_number) - 1;
+    ecma_string_t *to_str_p = ecma_new_ecma_string_from_number (new_idx);
+
+    /* 6.c */
+    ECMA_TRY_CATCH (get_value, ecma_op_object_find (obj_p, from_str_p), ret_value);
+
+    if (ecma_is_value_found (get_value))
+    {
+      /* 6.d.i, 6.d.ii */
+      ECMA_TRY_CATCH (put_value, ecma_op_object_put (obj_p, to_str_p, get_value, true), ret_value);
+
+      ECMA_FINALIZE (put_value);
+    }
+    else
+    {
+      /* 6.e.i */
+      ECMA_TRY_CATCH (del_value, ecma_op_object_delete (obj_p, to_str_p, true), ret_value);
+      ECMA_FINALIZE (del_value);
+    }
+
+    ECMA_FINALIZE (get_value);
+
+    ecma_deref_ecma_string (to_str_p);
+    ecma_deref_ecma_string (from_str_p);
+  }
+
+  for (uint32_t arg_index = 0;
+       arg_index < args_number && ecma_is_value_empty (ret_value);
+       arg_index++)
+  {
+    ecma_string_t *to_str_p = ecma_new_ecma_string_from_uint32 (arg_index);
+    /* 9.b */
+    ECMA_TRY_CATCH (put_value, ecma_op_object_put (obj_p, to_str_p, args[arg_index], true), ret_value);
+    ECMA_FINALIZE (put_value);
+    ecma_deref_ecma_string (to_str_p);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ecma_number_t new_len = ((ecma_number_t) len) + ((ecma_number_t) args_number);
+    /* 10. */
+    ECMA_TRY_CATCH (set_length_value,
+                    ecma_builtin_array_prototype_helper_set_length (obj_p, new_len),
+                    ret_value);
+    ret_value = ecma_make_number_value (new_len);
+
+    ECMA_FINALIZE (set_length_value);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_unshift */
+
+/**
+ * The Array.prototype object's 'indexOf' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.14
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_index_of (ecma_value_t this_arg, /**< this argument */
+                                              ecma_value_t arg1, /**< searchElement */
+                                              ecma_value_t arg2) /**< fromIndex */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  if (len == 0)
+  {
+    ret_value = ecma_make_integer_value (-1);
+  }
+  else
+  {
+    /* 5. */
+    ECMA_OP_TO_NUMBER_TRY_CATCH (arg_from_idx, arg2, ret_value);
+
+    ecma_number_t found_index = ECMA_NUMBER_MINUS_ONE;
+
+    uint32_t from_idx = ecma_builtin_helper_array_index_normalize (arg_from_idx, len);
+
+    /* 6. */
+    if (from_idx < len)
+    {
+      JERRY_ASSERT (from_idx < len);
+
+      for (; from_idx < len && found_index < 0 && ecma_is_value_empty (ret_value); from_idx++)
+      {
+        ecma_string_t *idx_str_p = ecma_new_ecma_string_from_uint32 (from_idx);
+
+        /* 9.a */
+        ECMA_TRY_CATCH (get_value, ecma_op_object_find (obj_p, idx_str_p), ret_value);
+
+        if (ecma_is_value_found (get_value))
+        {
+          /* 9.b.i, 9.b.ii */
+          if (ecma_op_strict_equality_compare (arg1, get_value))
+          {
+            found_index = ((ecma_number_t) from_idx);
+          }
+        }
+
+        ECMA_FINALIZE (get_value);
+
+        ecma_deref_ecma_string (idx_str_p);
+      }
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      ret_value = ecma_make_number_value (found_index);
+    }
+
+    ECMA_OP_TO_NUMBER_FINALIZE (arg_from_idx);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+
+  ECMA_FINALIZE (len_value);
+
+  ecma_deref_ecma_string (magic_string_length_p);
+
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_index_of */
+
+/**
+ * The Array.prototype object's 'lastIndexOf' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.15
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_last_index_of (ecma_value_t this_arg, /**< this argument */
+                                                   const ecma_value_t args[], /**< arguments list */
+                                                   ecma_length_t args_number) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_value_t search_element = (args_number > 0) ? args[0] : ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  ecma_number_t num = ECMA_NUMBER_MINUS_ONE;
+
+  /* 4. */
+  if (len == 0)
+  {
+    ret_value = ecma_make_number_value (num);
+  }
+  else
+  {
+    uint32_t from_idx = len - 1;
+
+    /* 5. */
+    if (args_number > 1)
+    {
+      ECMA_OP_TO_NUMBER_TRY_CATCH (arg_from_idx, args[1], ret_value);
+
+      if (!ecma_number_is_nan (arg_from_idx))
+      {
+
+        if (ecma_number_is_infinity (arg_from_idx))
+        {
+          from_idx = ecma_number_is_negative (arg_from_idx) ? (uint32_t) -1 : len - 1;
+        }
+        else
+        {
+          int32_t int_from_idx = ecma_number_to_int32 (arg_from_idx);
+
+          /* 6. */
+          if (int_from_idx >= 0)
+          {
+            /* min(int_from_idx, len - 1) */
+            if ((uint32_t) int_from_idx > len - 1)
+            {
+              from_idx = len - 1;
+            }
+            else
+            {
+              from_idx = (uint32_t) int_from_idx;
+            }
+          }
+          /* 7. */
+          else
+          {
+            int_from_idx = -int_from_idx;
+
+            /* We prevent from_idx from being negative, so that we can use an uint32. */
+            if ((uint32_t) int_from_idx <= len)
+            {
+              from_idx = len - (uint32_t) int_from_idx;
+            }
+            else
+            {
+              /*
+               * If from_idx would be negative, we set it to UINT_MAX. See reasoning for this in the comment
+               * at the for loop below.
+               */
+              from_idx = (uint32_t) -1;
+            }
+          }
+        }
+      }
+      else
+      {
+        from_idx = 0;
+      }
+
+      ECMA_OP_TO_NUMBER_FINALIZE (arg_from_idx);
+    }
+
+    /* 8.
+     * We should break from the loop when from_idx < 0. We can still use an uint32_t for from_idx, and check
+     * for an underflow instead. This is safe, because from_idx will always start in [0, len - 1],
+     * and len is in [0, UINT_MAX], so from_idx >= len means we've had an underflow, and should stop.
+     */
+    for (; from_idx < len && num < 0 && ecma_is_value_empty (ret_value); from_idx--)
+    {
+      /* 8.a */
+      ecma_string_t *idx_str_p = ecma_new_ecma_string_from_uint32 (from_idx);
+
+      /* 8.a */
+      ECMA_TRY_CATCH (get_value, ecma_op_object_find (obj_p, idx_str_p), ret_value);
+
+      if (ecma_is_value_found (get_value))
+      {
+        /* 8.b.i, 8.b.ii */
+        if (ecma_op_strict_equality_compare (search_element, get_value))
+        {
+          num = ((ecma_number_t) from_idx);
+        }
+      }
+
+      ECMA_FINALIZE (get_value);
+
+      ecma_deref_ecma_string (idx_str_p);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      ret_value = ecma_make_number_value (num);
+    }
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_last_index_of */
+
+/**
+ * The Array.prototype object's 'every' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.16
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_every (ecma_value_t this_arg, /**< this argument */
+                                           ecma_value_t arg1, /**< callbackfn */
+                                           ecma_value_t arg2) /**< thisArg */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  if (!ecma_op_is_callable (arg1))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+  else
+  {
+    ecma_value_t current_index;
+    ecma_object_t *func_object_p;
+
+    /* We already checked that arg1 is callable, so it will always coerce to an object. */
+    ecma_value_t to_object_comp = ecma_op_to_object (arg1);
+    JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (to_object_comp));
+
+    func_object_p = ecma_get_object_from_value (to_object_comp);
+
+    /* 7. */
+    for (uint32_t index = 0; index < len && ecma_is_value_empty (ret_value); index++)
+    {
+      /* 7.a */
+      ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (index);
+
+      /* 7.c */
+      ECMA_TRY_CATCH (get_value, ecma_op_object_find (obj_p, index_str_p), ret_value);
+
+      if (ecma_is_value_found (get_value))
+      {
+        /* 7.c.i */
+        current_index = ecma_make_uint32_value (index);
+
+        ecma_value_t call_args[] = { get_value, current_index, obj_this };
+        /* 7.c.ii */
+        ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
+
+        /* 7.c.iii */
+        if (!ecma_op_to_boolean (call_value))
+        {
+          ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+        }
+
+        ECMA_FINALIZE (call_value);
+      }
+
+      ECMA_FINALIZE (get_value);
+
+      ecma_deref_ecma_string (index_str_p);
+    }
+
+    ecma_free_value (to_object_comp);
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      /* 8. */
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+    }
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_every */
+
+/**
+ * The Array.prototype object's 'some' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.17
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_some (ecma_value_t this_arg, /**< this argument */
+                                          ecma_value_t arg1, /**< callbackfn */
+                                          ecma_value_t arg2) /**< thisArg */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  if (!ecma_op_is_callable (arg1))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+  else
+  {
+    ecma_value_t current_index;
+    ecma_object_t *func_object_p;
+
+    /* We already checked that arg1 is callable, so it will always coerce to an object. */
+    ecma_value_t to_object_comp = ecma_op_to_object (arg1);
+    JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (to_object_comp));
+
+    func_object_p = ecma_get_object_from_value (to_object_comp);
+
+    /* 7. */
+    for (uint32_t index = 0; index < len && ecma_is_value_empty (ret_value); index++)
+    {
+      /* 7.a */
+      ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (index);
+
+      /* 7.c */
+      ECMA_TRY_CATCH (get_value, ecma_op_object_find (obj_p, index_str_p), ret_value);
+
+      if (ecma_is_value_found (get_value))
+      {
+        /* 7.c.i */
+        current_index = ecma_make_uint32_value (index);
+
+        ecma_value_t call_args[] = { get_value, current_index, obj_this };
+
+        /* 7.c.ii */
+        ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
+
+        /* 7.c.iii */
+        if (ecma_op_to_boolean (call_value))
+        {
+          ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+        }
+
+        ECMA_FINALIZE (call_value);
+      }
+
+      ECMA_FINALIZE (get_value);
+
+      ecma_deref_ecma_string (index_str_p);
+    }
+
+    ecma_free_value (to_object_comp);
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      /* 8. */
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+    }
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_some */
+
+/**
+ * The Array.prototype object's 'forEach' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.18
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_for_each (ecma_value_t this_arg, /**< this argument */
+                                              ecma_value_t arg1, /**< callbackfn */
+                                              ecma_value_t arg2) /**< thisArg */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  if (!ecma_op_is_callable (arg1))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+  else
+  {
+    ecma_value_t current_index;
+    ecma_object_t *func_object_p;
+
+    /* We already checked that arg1 is callable, so it will always coerce to an object. */
+    ecma_value_t to_object_comp = ecma_op_to_object (arg1);
+    JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (to_object_comp));
+
+    func_object_p = ecma_get_object_from_value (to_object_comp);
+
+    /* Iterate over array and call callbackfn on every element */
+    for (uint32_t index = 0; index < len && ecma_is_value_empty (ret_value); index++)
+    {
+      /* 7.a */
+      ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (index);
+
+      /* 7.b */
+      ECMA_TRY_CATCH (current_value, ecma_op_object_find (obj_p, index_str_p), ret_value);
+
+      if (ecma_is_value_found (current_value))
+      {
+        /* 7.c.i */
+        current_index = ecma_make_uint32_value (index);
+
+        /* 7.c.ii */
+        ecma_value_t call_args[] = {current_value, current_index, obj_this};
+        ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
+
+        ECMA_FINALIZE (call_value);
+      }
+
+      ECMA_FINALIZE (current_value);
+
+      ecma_deref_ecma_string (index_str_p);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      /* 8. */
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+
+    ecma_free_value (to_object_comp);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_for_each */
+
+/**
+ * The Array.prototype object's 'map' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.19
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_map (ecma_value_t this_arg, /**< this argument */
+                                         ecma_value_t arg1, /**< callbackfn */
+                                         ecma_value_t arg2) /**< thisArg */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  if (!ecma_op_is_callable (arg1))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+  else
+  {
+    ecma_object_t *func_object_p;
+    JERRY_ASSERT (ecma_is_value_object (arg1));
+    func_object_p = ecma_get_object_from_value (arg1);
+
+    /* 5. arg2 is simply used as T */
+
+    /* 6. */
+    ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
+    JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
+    ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
+
+    /* 7-8. */
+    ecma_value_t current_index;
+
+    for (uint32_t index = 0; index < len && ecma_is_value_empty (ret_value); index++)
+    {
+      /* 8.a */
+      ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (index);
+
+      /* 8.b */
+      ECMA_TRY_CATCH (current_value, ecma_op_object_find (obj_p, index_str_p), ret_value);
+
+      if (ecma_is_value_found (current_value))
+      {
+        /* 8.c.i, 8.c.ii */
+        current_index = ecma_make_uint32_value (index);
+        ecma_value_t call_args[] = { current_value, current_index, obj_this };
+
+        ECMA_TRY_CATCH (mapped_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
+
+        /* 8.c.iii */
+        /* This will always be a simple value since 'is_throw' is false, so no need to free. */
+        ecma_value_t put_comp = ecma_builtin_helper_def_prop (new_array_p,
+                                                              index_str_p,
+                                                              mapped_value,
+                                                              true, /* Writable */
+                                                              true, /* Enumerable */
+                                                              true, /* Configurable */
+                                                              false);
+        JERRY_ASSERT (ecma_is_value_true (put_comp));
+
+        ECMA_FINALIZE (mapped_value);
+      }
+
+      ECMA_FINALIZE (current_value);
+
+      ecma_deref_ecma_string (index_str_p);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      ECMA_TRY_CATCH (set_length_value,
+                      ecma_builtin_array_prototype_helper_set_length (new_array_p, ((ecma_number_t) len)),
+                      ret_value);
+      ret_value = new_array;
+      ECMA_FINALIZE (set_length_value);
+    }
+    else
+    {
+      ecma_free_value (new_array);
+    }
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_map */
+
+/**
+ * The Array.prototype object's 'filter' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.20
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_filter (ecma_value_t this_arg, /**< this argument */
+                                            ecma_value_t arg1, /**< callbackfn */
+                                            ecma_value_t arg2) /**< thisArg */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  /* 3. */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  if (!ecma_op_is_callable (arg1))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+  else
+  {
+    ecma_value_t current_index;
+    ecma_object_t *func_object_p;
+
+    /* 6. */
+    ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
+    JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
+    ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
+
+    /* We already checked that arg1 is callable, so it will always be an object. */
+    JERRY_ASSERT (ecma_is_value_object (arg1));
+    func_object_p = ecma_get_object_from_value (arg1);
+
+    /* 8. */
+    uint32_t new_array_index = 0;
+
+    /* 9. */
+    for (uint32_t index = 0; index < len && ecma_is_value_empty (ret_value); index++)
+    {
+      /* 9.a */
+      ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (index);
+
+      /* 9.c */
+      ECMA_TRY_CATCH (get_value, ecma_op_object_find (obj_p, index_str_p), ret_value);
+
+      if (ecma_is_value_found (get_value))
+      {
+        /* 9.c.i */
+        current_index = ecma_make_uint32_value (index);
+
+        ecma_value_t call_args[] = { get_value, current_index, obj_this };
+        /* 9.c.ii */
+        ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
+
+        /* 9.c.iii */
+        if (ecma_op_to_boolean (call_value))
+        {
+          ecma_string_t *to_index_string_p = ecma_new_ecma_string_from_uint32 (new_array_index);
+
+          /* This will always be a simple value since 'is_throw' is false, so no need to free. */
+          ecma_value_t put_comp = ecma_builtin_helper_def_prop (new_array_p,
+                                                                to_index_string_p,
+                                                                get_value,
+                                                                true, /* Writable */
+                                                                true, /* Enumerable */
+                                                                true, /* Configurable */
+                                                                false);
+          JERRY_ASSERT (ecma_is_value_true (put_comp));
+
+          ecma_deref_ecma_string (to_index_string_p);
+          new_array_index++;
+        }
+
+        ECMA_FINALIZE (call_value);
+      }
+
+      ECMA_FINALIZE (get_value);
+
+      ecma_deref_ecma_string (index_str_p);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      /* 10. */
+      ret_value = new_array;
+    }
+    else
+    {
+      ecma_free_value (new_array);
+    }
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_filter */
+
+/**
+ * The Array.prototype object's 'reduce' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.21
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_reduce (ecma_value_t this_arg, /**< this argument */
+                                            const ecma_value_t args[], /**< arguments list */
+                                            ecma_length_t args_number) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_value_t callbackfn = (args_number > 0) ? args[0] : ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  ecma_value_t initial_value = (args_number > 1) ? args[1] : ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  if (!ecma_op_is_callable (callbackfn))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+  else
+  {
+    ecma_object_t *func_object_p;
+
+    JERRY_ASSERT (ecma_is_value_object (callbackfn));
+    func_object_p = ecma_get_object_from_value (callbackfn);
+    ecma_value_t accumulator = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+    /* 5. */
+    if (len_number == ECMA_NUMBER_ZERO && ecma_is_value_undefined (initial_value))
+    {
+      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Initial value cannot be undefined."));
+    }
+    else
+    {
+      /* 6. */
+      uint32_t index = 0;
+
+      /* 7.a */
+      if (args_number > 1)
+      {
+        accumulator = ecma_copy_value (initial_value);
+      }
+      else
+      {
+        /* 8.a */
+        bool k_present = false;
+
+        /* 8.b */
+        while (!k_present && index < len && ecma_is_value_empty (ret_value))
+        {
+          /* 8.b.i */
+          ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (index);
+          k_present = true;
+
+          /* 8.b.ii-iii */
+          ECMA_TRY_CATCH (current_value, ecma_op_object_find (obj_p, index_str_p), ret_value);
+
+          if (ecma_is_value_found (current_value))
+          {
+            accumulator = ecma_copy_value (current_value);
+          }
+          else
+          {
+            k_present = false;
+          }
+
+          ECMA_FINALIZE (current_value);
+
+          /* 8.b.iv */
+          index++;
+
+          ecma_deref_ecma_string (index_str_p);
+        }
+
+        /* 8.c */
+        if (!k_present)
+        {
+          ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Missing array element."));
+        }
+      }
+      /* 9. */
+      ecma_value_t current_index;
+
+      for (; index < len && ecma_is_value_empty (ret_value); index++)
+      {
+        /* 9.a */
+        ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (index);
+
+        /* 9.b */
+        ECMA_TRY_CATCH (current_value, ecma_op_object_find (obj_p, index_str_p), ret_value);
+
+        if (ecma_is_value_found (current_value))
+        {
+          /* 9.c.i, 9.c.ii */
+          current_index = ecma_make_uint32_value (index);
+          ecma_value_t call_args[] = {accumulator, current_value, current_index, obj_this};
+
+          ECMA_TRY_CATCH (call_value,
+                          ecma_op_function_call (func_object_p,
+                                                 ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                                 call_args,
+                                                 4),
+                          ret_value);
+
+          ecma_free_value (accumulator);
+          accumulator = ecma_copy_value (call_value);
+
+          ECMA_FINALIZE (call_value);
+        }
+
+        ECMA_FINALIZE (current_value);
+
+        ecma_deref_ecma_string (index_str_p);
+        /* 9.d in for loop */
+      }
+
+      if (ecma_is_value_empty (ret_value))
+      {
+        ret_value = ecma_copy_value (accumulator);
+      }
+    }
+
+    ecma_free_value (accumulator);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_reduce */
+
+/**
+ * The Array.prototype object's 'reduceRight' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.22
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_prototype_object_reduce_right (ecma_value_t this_arg, /**< this argument */
+                                                  const ecma_value_t args[], /**< arguments list */
+                                                  ecma_length_t args_number) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_value_t callbackfn = (args_number > 0) ? args[0] : ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  ecma_value_t initial_value = (args_number > 1) ? args[1] : ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj_this,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+  /* 2. */
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (obj_p, magic_string_length_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  /* 3. */
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 4. */
+  if (!ecma_op_is_callable (callbackfn))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+  else
+  {
+    ecma_object_t *func_object_p;
+
+    JERRY_ASSERT (ecma_is_value_object (callbackfn));
+    func_object_p = ecma_get_object_from_value (callbackfn);
+
+    /* 5. */
+    if (len_number == ECMA_NUMBER_ZERO && ecma_is_value_undefined (initial_value))
+    {
+      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Initial value cannot be undefined."));
+    }
+    else
+    {
+      ecma_value_t accumulator = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+      /* 6. */
+      int64_t index = (int64_t) len - 1;
+
+      /* 7.a */
+      if (args_number > 1)
+      {
+        accumulator = ecma_copy_value (initial_value);
+      }
+      else
+      {
+        /* 8.a */
+        bool k_present = false;
+
+        /* 8.b */
+        while (!k_present && index >= 0 && ecma_is_value_empty (ret_value))
+        {
+          /* 8.b.i */
+          ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 ((uint32_t) index);
+          k_present = true;
+
+          /* 8.b.ii-iii */
+          ECMA_TRY_CATCH (current_value, ecma_op_object_find (obj_p, index_str_p), ret_value);
+
+          if (ecma_is_value_found (current_value))
+          {
+            accumulator = ecma_copy_value (current_value);
+          }
+          else
+          {
+            k_present = false;
+          }
+
+          ECMA_FINALIZE (current_value);
+
+          /* 8.b.iv */
+          index--;
+
+          ecma_deref_ecma_string (index_str_p);
+        }
+
+        /* 8.c */
+        if (!k_present)
+        {
+          ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Missing array element."));
+        }
+      }
+      /* 9. */
+      ecma_value_t current_index;
+
+      for (; index >= 0 && ecma_is_value_empty (ret_value); index--)
+      {
+        /* 9.a */
+        ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 ((uint32_t) index);
+
+        /* 9.b */
+        ECMA_TRY_CATCH (current_value, ecma_op_object_find (obj_p, index_str_p), ret_value);
+
+        if (ecma_is_value_found (current_value))
+        {
+          /* 9.c.i, 9.c.ii */
+          current_index = ecma_make_uint32_value ((uint32_t) index);
+          ecma_value_t call_args[] = {accumulator, current_value, current_index, obj_this};
+
+          ECMA_TRY_CATCH (call_value,
+                          ecma_op_function_call (func_object_p,
+                                                 ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                                 call_args,
+                                                 4),
+                          ret_value);
+
+          ecma_free_value (accumulator);
+          accumulator = ecma_copy_value (call_value);
+
+          ECMA_FINALIZE (call_value);
+        }
+
+        ECMA_FINALIZE (current_value);
+
+        ecma_deref_ecma_string (index_str_p);
+        /* 9.d in for loop */
+      }
+
+      if (ecma_is_value_empty (ret_value))
+      {
+        ret_value = ecma_copy_value (accumulator);
+      }
+
+      ecma_free_value (accumulator);
+    }
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ECMA_FINALIZE (obj_this);
+
+  return ret_value;
+} /* ecma_builtin_array_prototype_object_reduce_right */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h
new file mode 100644 (file)
index 0000000..0da3c05
--- /dev/null
@@ -0,0 +1,66 @@
+/* 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.
+ */
+
+/*
+ * Array.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.4.4.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* Number properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.4.4 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              0,
+              ECMA_PROPERTY_FLAG_WRITABLE)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_array_prototype_object_to_string, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ecma_builtin_array_prototype_object_to_locale_string, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_CONCAT, ecma_builtin_array_prototype_object_concat, NON_FIXED, 1)
+ROUTINE (LIT_MAGIC_STRING_JOIN, ecma_builtin_array_prototype_join, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_POP, ecma_builtin_array_prototype_object_pop, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_PUSH, ecma_builtin_array_prototype_object_push, NON_FIXED, 1)
+ROUTINE (LIT_MAGIC_STRING_REVERSE, ecma_builtin_array_prototype_object_reverse, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_SHIFT, ecma_builtin_array_prototype_object_shift, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_SLICE, ecma_builtin_array_prototype_object_slice, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_SORT, ecma_builtin_array_prototype_object_sort, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_SPLICE, ecma_builtin_array_prototype_object_splice, NON_FIXED, 2)
+ROUTINE (LIT_MAGIC_STRING_UNSHIFT, ecma_builtin_array_prototype_object_unshift, NON_FIXED, 1)
+ROUTINE (LIT_MAGIC_STRING_INDEX_OF_UL, ecma_builtin_array_prototype_object_index_of, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_LAST_INDEX_OF_UL, ecma_builtin_array_prototype_object_last_index_of, NON_FIXED, 1)
+ROUTINE (LIT_MAGIC_STRING_EVERY, ecma_builtin_array_prototype_object_every, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_SOME, ecma_builtin_array_prototype_object_some, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_FOR_EACH_UL, ecma_builtin_array_prototype_object_for_each, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_MAP, ecma_builtin_array_prototype_object_map, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_FILTER, ecma_builtin_array_prototype_object_filter, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_REDUCE, ecma_builtin_array_prototype_object_reduce, NON_FIXED, 1)
+ROUTINE (LIT_MAGIC_STRING_REDUCE_RIGHT_UL, ecma_builtin_array_prototype_object_reduce_right, NON_FIXED, 1)
+
+#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array.c
new file mode 100644 (file)
index 0000000..95cd875
--- /dev/null
@@ -0,0 +1,110 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-array-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-array.inc.h"
+#define BUILTIN_UNDERSCORED_ID array
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup array ECMA Array object built-in
+ * @{
+ */
+
+/**
+ * The Array object's 'isArray' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.3.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_array_object_is_array (ecma_value_t this_arg, /**< 'this' argument */
+                                    ecma_value_t arg) /**< first argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_simple_value_t is_array = ECMA_SIMPLE_VALUE_FALSE;
+
+  if (ecma_is_value_object (arg))
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg);
+
+    if (ecma_object_get_class_name (obj_p) == LIT_MAGIC_STRING_ARRAY_UL)
+    {
+      is_array = ECMA_SIMPLE_VALUE_TRUE;
+    }
+  }
+
+  return ecma_make_simple_value (is_array);
+} /* ecma_builtin_array_object_is_array */
+
+/**
+ * Handle calling [[Call]] of built-in Array object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                  ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_builtin_array_dispatch_construct (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_array_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in Array object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                       ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_op_create_array_object (arguments_list_p, arguments_list_len, true);
+} /* ecma_builtin_array_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-array.inc.h
new file mode 100644 (file)
index 0000000..0279c13
--- /dev/null
@@ -0,0 +1,46 @@
+/* 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.
+ */
+
+/*
+ * Array description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.4.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_ARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+/* Number properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.4.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_IS_ARRAY_UL, ecma_builtin_array_object_is_array, 1, 1)
+
+#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer-prototype.c
new file mode 100644 (file)
index 0000000..e9c5b1a
--- /dev/null
@@ -0,0 +1,141 @@
+/* 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.
+ */
+
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-arraybuffer-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+#include "jrt-libc-includes.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-arraybuffer-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID arraybuffer_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup arraybufferprototype ECMA ArrayBuffer.prototype object built-in
+ * @{
+ */
+
+/**
+ * The ArrayBuffer.prototype.bytelength accessor
+ *
+ * See also:
+ *          ES2015, 24.1.4.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_arraybuffer_prototype_bytelength_getter (ecma_value_t this_arg) /**< this argument */
+{
+  if (ecma_is_value_object (this_arg))
+  {
+    ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
+
+    if (ecma_object_class_is (object_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL))
+    {
+      ecma_length_t len = ecma_arraybuffer_get_length (object_p);
+
+      return ecma_make_uint32_value (len);
+    }
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a ArrayBuffer object."));
+} /* ecma_builtin_arraybuffer_prototype_bytelength_getter */
+
+/**
+ * The ArrayBuffer.prototype object's 'slice' routine
+ *
+ * See also:
+ *          ES2015, 24.1.4.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< this argument */
+                                                 ecma_value_t arg1, /**< routine's first argument */
+                                                 ecma_value_t arg2) /**< routine's second argument */
+{
+  if (!ecma_is_value_object (this_arg))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not object."));
+  }
+
+  ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
+
+  if (!ecma_object_class_is (object_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an ArrayBuffer object."));
+  }
+
+  ecma_length_t len = ecma_arraybuffer_get_length (object_p);
+
+  ecma_length_t start = 0, end = len;
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (start_num,
+                               arg1,
+                               ret_value);
+
+  start = ecma_builtin_helper_array_index_normalize (start_num, len);
+
+  if (!ecma_is_value_undefined (arg2))
+  {
+    ECMA_OP_TO_NUMBER_TRY_CATCH (end_num,
+                                 arg2,
+                                 ret_value);
+
+    end = ecma_builtin_helper_array_index_normalize (end_num, len);
+
+    ECMA_OP_TO_NUMBER_FINALIZE (end_num);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (start_num);
+
+  JERRY_ASSERT (start <= len && end <= len);
+  ecma_length_t new_len = (end >= start) ? (end - start) : 0;
+  ecma_object_t *new_arraybuffer_p = ecma_arraybuffer_new_object (new_len);
+  lit_utf8_byte_t *old_buf = ecma_arraybuffer_get_buffer (object_p);
+  lit_utf8_byte_t *new_buf = ecma_arraybuffer_get_buffer (new_arraybuffer_p);
+
+  memcpy (new_buf, old_buf + start, new_len);
+
+  return ecma_make_object_value (new_arraybuffer_p);
+} /* ecma_builtin_arraybuffer_prototype_object_slice */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer-prototype.inc.h
new file mode 100644 (file)
index 0000000..c73c527
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/*
+ * ArrayBuffer.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_ARRAYBUFFER,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* Readonly accessor properties */
+ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BYTE_LENGTH_UL,
+                    ecma_builtin_arraybuffer_prototype_bytelength_getter,
+                    ECMA_PROPERTY_FIXED)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_SLICE, ecma_builtin_arraybuffer_prototype_object_slice, 2, 2)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer.c
new file mode 100644 (file)
index 0000000..138c8d6
--- /dev/null
@@ -0,0 +1,103 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-arraybuffer-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-arraybuffer.inc.h"
+#define BUILTIN_UNDERSCORED_ID arraybuffer
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup arraybuffer ECMA ArrayBuffer object built-in
+ * @{
+ */
+
+/**
+ * The ArrayBuffer object's 'isView' routine
+ *
+ * See also:
+ *         ES2015 24.1.3.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_arraybuffer_object_is_view (ecma_value_t this_arg, /**< 'this' argument */
+                                         ecma_value_t arg) /**< argument 1 */
+{
+  JERRY_UNUSED (this_arg);
+  JERRY_UNUSED (arg);
+
+  /* TODO: if arg has [[ViewArrayBuffer]], return true */
+
+  return ecma_make_boolean_value (false);
+} /* ecma_builtin_arraybuffer_object_is_view */
+
+/**
+ * Handle calling [[Call]] of built-in ArrayBuffer object
+ *
+ * ES2015 24.1.2 ArrayBuffer is not intended to be called as
+ * a function and will throw an exception when called in
+ * that manner.
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_arraybuffer_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                        ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor ArrayBuffer requires 'new'"));
+} /* ecma_builtin_arraybuffer_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in ArrayBuffer object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_arraybuffer_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                             ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_op_create_arraybuffer_object (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_arraybuffer_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer.inc.h
new file mode 100644 (file)
index 0000000..f94419d
--- /dev/null
@@ -0,0 +1,46 @@
+/* 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.
+ */
+
+/*
+ * ArrayBuffer built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+
+/* ES2015 24.1.3.1 */
+ROUTINE (LIT_MAGIC_STRING_IS_VIEW_UL, ecma_builtin_arraybuffer_object_is_view, 1, 1)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean-prototype.c
new file mode 100644 (file)
index 0000000..1e02446
--- /dev/null
@@ -0,0 +1,124 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-boolean-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID boolean_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup booleanprototype ECMA Boolean.prototype object built-in
+ * @{
+ */
+
+/**
+ * The Boolean.prototype object's 'toString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.6.4.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_boolean_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (value_of_ret,
+                  ecma_builtin_boolean_prototype_object_value_of (this_arg),
+                  ret_value);
+
+  ecma_string_t *ret_str_p;
+
+  if (ecma_is_value_true (value_of_ret))
+  {
+    ret_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_TRUE);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_is_value_boolean (value_of_ret));
+
+    ret_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_FALSE);
+  }
+
+  ret_value = ecma_make_string_value (ret_str_p);
+
+  ECMA_FINALIZE (value_of_ret);
+
+  return ret_value;
+} /* ecma_builtin_boolean_prototype_object_to_string */
+
+/**
+ * The Boolean.prototype object's 'valueOf' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.6.4.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_boolean_prototype_object_value_of (ecma_value_t this_arg) /**< this argument */
+{
+  if (ecma_is_value_boolean (this_arg))
+  {
+    return this_arg;
+  }
+  else if (ecma_is_value_object (this_arg))
+  {
+    ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
+
+    if (ecma_object_class_is (object_p, LIT_MAGIC_STRING_BOOLEAN_UL))
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      JERRY_ASSERT (ecma_is_value_boolean (ext_object_p->u.class_prop.u.value));
+
+      return ext_object_p->u.class_prop.u.value;
+    }
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Boolean object."));
+} /* ecma_builtin_boolean_prototype_object_value_of */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean-prototype.inc.h
new file mode 100644 (file)
index 0000000..fe92469
--- /dev/null
@@ -0,0 +1,39 @@
+/* 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.
+ */
+
+/*
+ * Boolean.prototype description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.6.4.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_BOOLEAN,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_boolean_prototype_object_to_string, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL,  ecma_builtin_boolean_prototype_object_value_of,  0, 0)
+
+#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.c
new file mode 100644 (file)
index 0000000..06833ce
--- /dev/null
@@ -0,0 +1,100 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-boolean-object.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-boolean.inc.h"
+#define BUILTIN_UNDERSCORED_ID boolean
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup boolean ECMA Boolean object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in Boolean object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_boolean_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                    ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_value_t arg_value;
+
+  if (arguments_list_len == 0)
+  {
+    arg_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  }
+  else
+  {
+    arg_value = arguments_list_p[0];
+  }
+
+  return ecma_make_simple_value (ecma_op_to_boolean (arg_value) ? ECMA_SIMPLE_VALUE_TRUE
+                                                                : ECMA_SIMPLE_VALUE_FALSE);
+} /* ecma_builtin_boolean_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in Boolean object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_boolean_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                         ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  if (arguments_list_len == 0)
+  {
+    return ecma_op_create_boolean_object (ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE));
+  }
+  else
+  {
+    return ecma_op_create_boolean_object (arguments_list_p[0]);
+  }
+} /* ecma_builtin_boolean_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.inc.h
new file mode 100644 (file)
index 0000000..031c6a6
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/*
+ * Boolean description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.6.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+/* Number properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.6.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c
new file mode 100644 (file)
index 0000000..9cd10c9
--- /dev/null
@@ -0,0 +1,662 @@
+/* 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.
+ */
+
+#include <math.h>
+
+#include "ecma-alloc.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+
+#ifndef CONFIG_DISABLE_DATE_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+/**
+ * This object has a custom dispatch function.
+ */
+#define BUILTIN_CUSTOM_DISPATCH
+
+/**
+ * Checks whether the function uses UTC time zone.
+ */
+#define BUILTIN_DATE_FUNCTION_IS_UTC(builtin_routine_id) \
+  (((builtin_routine_id) - ECMA_DATE_PROTOTYPE_GET_FULL_YEAR) & 0x1)
+
+/**
+ * List of built-in routine identifiers.
+ */
+enum
+{
+  ECMA_DATE_PROTOTYPE_ROUTINE_START = ECMA_BUILTIN_ID__COUNT - 1,
+
+  ECMA_DATE_PROTOTYPE_GET_FULL_YEAR, /* ECMA-262 v5 15.9.5.10 */
+  ECMA_DATE_PROTOTYPE_GET_UTC_FULL_YEAR, /* ECMA-262 v5 15.9.5.11 */
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+  ECMA_DATE_PROTOTYPE_GET_YEAR, /* ECMA-262 v5, AnnexB.B.2.4 */
+  ECMA_DATE_PROTOTYPE_GET_UTC_YEAR, /* has no UTC variant */
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+  ECMA_DATE_PROTOTYPE_GET_MONTH, /* ECMA-262 v5 15.9.5.12 */
+  ECMA_DATE_PROTOTYPE_GET_UTC_MONTH, /* ECMA-262 v5 15.9.5.13 */
+  ECMA_DATE_PROTOTYPE_GET_DATE, /* ECMA-262 v5 15.9.5.14 */
+  ECMA_DATE_PROTOTYPE_GET_UTC_DATE, /* ECMA-262 v5 15.9.5.15 */
+  ECMA_DATE_PROTOTYPE_GET_DAY, /* ECMA-262 v5 15.9.5.16 */
+  ECMA_DATE_PROTOTYPE_GET_UTC_DAY, /* ECMA-262 v5 15.9.5.17 */
+  ECMA_DATE_PROTOTYPE_GET_HOURS, /* ECMA-262 v5 15.9.5.18 */
+  ECMA_DATE_PROTOTYPE_GET_UTC_HOURS, /* ECMA-262 v5 15.9.5.19 */
+  ECMA_DATE_PROTOTYPE_GET_MINUTES, /* ECMA-262 v5 15.9.5.20 */
+  ECMA_DATE_PROTOTYPE_GET_UTC_MINUTES, /* ECMA-262 v5 15.9.5.21 */
+  ECMA_DATE_PROTOTYPE_GET_SECONDS, /* ECMA-262 v5 15.9.5.22 */
+  ECMA_DATE_PROTOTYPE_GET_UTC_SECONDS, /* ECMA-262 v5 15.9.5.23 */
+  ECMA_DATE_PROTOTYPE_GET_MILLISECONDS, /* ECMA-262 v5 15.9.5.24 */
+  ECMA_DATE_PROTOTYPE_GET_UTC_MILLISECONDS, /* ECMA-262 v5 15.9.5.25 */
+  ECMA_DATE_PROTOTYPE_GET_TIMEZONE_OFFSET, /* has no local time zone variant */
+  ECMA_DATE_PROTOTYPE_GET_UTC_TIMEZONE_OFFSET, /* ECMA-262 v5 15.9.5.26 */
+
+  ECMA_DATE_PROTOTYPE_SET_FULL_YEAR, /* ECMA-262 v5, 15.9.5.40 */
+  ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR, /* ECMA-262 v5, 15.9.5.41 */
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+  ECMA_DATE_PROTOTYPE_SET_YEAR, /* ECMA-262 v5, ECMA-262 v5, AnnexB.B.2.5 */
+  ECMA_DATE_PROTOTYPE_SET_UTC_YEAR, /* has no UTC variant */
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+  ECMA_DATE_PROTOTYPE_SET_MONTH, /* ECMA-262 v5, 15.9.5.38 */
+  ECMA_DATE_PROTOTYPE_SET_UTC_MONTH, /* ECMA-262 v5, 15.9.5.39 */
+  ECMA_DATE_PROTOTYPE_SET_DATE, /* ECMA-262 v5, 15.9.5.36 */
+  ECMA_DATE_PROTOTYPE_SET_UTC_DATE, /* ECMA-262 v5, 15.9.5.37 */
+  ECMA_DATE_PROTOTYPE_SET_HOURS, /* ECMA-262 v5, 15.9.5.34 */
+  ECMA_DATE_PROTOTYPE_SET_UTC_HOURS, /* ECMA-262 v5, 15.9.5.35 */
+  ECMA_DATE_PROTOTYPE_SET_MINUTES, /* ECMA-262 v5, 15.9.5.32 */
+  ECMA_DATE_PROTOTYPE_SET_UTC_MINUTES, /* ECMA-262 v5, 15.9.5.33 */
+  ECMA_DATE_PROTOTYPE_SET_SECONDS, /* ECMA-262 v5, 15.9.5.30 */
+  ECMA_DATE_PROTOTYPE_SET_UTC_SECONDS, /* ECMA-262 v5, 15.9.5.31 */
+  ECMA_DATE_PROTOTYPE_SET_MILLISECONDS, /* ECMA-262 v5, 15.9.5.28 */
+  ECMA_DATE_PROTOTYPE_SET_UTC_MILLISECONDS, /* ECMA-262 v5, 15.9.5.29 */
+
+  ECMA_DATE_PROTOTYPE_TO_STRING, /* ECMA-262 v5, 15.9.5.2 */
+  ECMA_DATE_PROTOTYPE_TO_DATE_STRING, /* ECMA-262 v5, 15.9.5.3 */
+  ECMA_DATE_PROTOTYPE_TO_TIME_STRING, /* ECMA-262 v5, 15.9.5.4 */
+  ECMA_DATE_PROTOTYPE_TO_UTC_STRING, /* ECMA-262 v5, 15.9.5.42 */
+  ECMA_DATE_PROTOTYPE_TO_ISO_STRING, /* ECMA-262 v5, 15.9.5.43 */
+
+  ECMA_DATE_PROTOTYPE_GET_TIME, /* ECMA-262 v5, 15.9.5.9 */
+  ECMA_DATE_PROTOTYPE_SET_TIME, /* ECMA-262 v5, 15.9.5.27 */
+  ECMA_DATE_PROTOTYPE_TO_JSON, /* ECMA-262 v5, 15.9.5.44 */
+};
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-date-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID date_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup dateprototype ECMA Date.prototype object built-in
+ * @{
+ */
+
+/**
+ * The Date.prototype object's 'toJSON' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.5.44
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_date_prototype_to_json (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (obj,
+                  ecma_op_to_object (this_arg),
+                  ret_value);
+
+  /* 2. */
+  ECMA_TRY_CATCH (tv,
+                  ecma_op_to_primitive (obj, ECMA_PREFERRED_TYPE_NUMBER),
+                  ret_value);
+
+  /* 3. */
+  if (ecma_is_value_number (tv))
+  {
+    ecma_number_t num_value = ecma_get_number_from_value (tv);
+
+    if (ecma_number_is_nan (num_value) || ecma_number_is_infinity (num_value))
+    {
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+    }
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ecma_string_t *to_iso_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_TO_ISO_STRING_UL);
+    ecma_object_t *value_obj_p = ecma_get_object_from_value (obj);
+
+    /* 4. */
+    ECMA_TRY_CATCH (to_iso,
+                    ecma_op_object_get (value_obj_p, to_iso_str_p),
+                    ret_value);
+
+    /* 5. */
+    if (!ecma_op_is_callable (to_iso))
+    {
+      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("'toISOString' is missing or not a function."));
+    }
+    /* 6. */
+    else
+    {
+      ecma_object_t *to_iso_obj_p = ecma_get_object_from_value (to_iso);
+      ret_value = ecma_op_function_call (to_iso_obj_p, this_arg, NULL, 0);
+    }
+
+    ECMA_FINALIZE (to_iso);
+
+    ecma_deref_ecma_string (to_iso_str_p);
+  }
+
+  ECMA_FINALIZE (tv);
+  ECMA_FINALIZE (obj);
+
+  return ret_value;
+} /* ecma_builtin_date_prototype_to_json */
+
+/**
+ * Dispatch get date functions
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_date_prototype_dispatch_get (uint16_t builtin_routine_id, /**< built-in wide routine
+                                                                        *   identifier */
+                                          ecma_number_t date_num) /**< date converted to number */
+{
+  if (ecma_number_is_nan (date_num))
+  {
+    ecma_string_t *nan_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_NAN);
+    return ecma_make_string_value (nan_str_p);
+  }
+
+  switch (builtin_routine_id)
+  {
+    case ECMA_DATE_PROTOTYPE_GET_FULL_YEAR:
+    case ECMA_DATE_PROTOTYPE_GET_UTC_FULL_YEAR:
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+    case ECMA_DATE_PROTOTYPE_GET_YEAR:
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+    {
+      date_num = ecma_date_year_from_time (date_num);
+
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+      if (builtin_routine_id == ECMA_DATE_PROTOTYPE_GET_YEAR)
+      {
+        date_num -= 1900;
+      }
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+
+      break;
+    }
+    case ECMA_DATE_PROTOTYPE_GET_MONTH:
+    case ECMA_DATE_PROTOTYPE_GET_UTC_MONTH:
+    {
+      date_num = ecma_date_month_from_time (date_num);
+      break;
+    }
+    case ECMA_DATE_PROTOTYPE_GET_DATE:
+    case ECMA_DATE_PROTOTYPE_GET_UTC_DATE:
+    {
+      date_num = ecma_date_date_from_time (date_num);
+      break;
+    }
+    case ECMA_DATE_PROTOTYPE_GET_DAY:
+    case ECMA_DATE_PROTOTYPE_GET_UTC_DAY:
+    {
+      date_num = ecma_date_week_day (date_num);
+      break;
+    }
+    case ECMA_DATE_PROTOTYPE_GET_HOURS:
+    case ECMA_DATE_PROTOTYPE_GET_UTC_HOURS:
+    {
+      date_num = ecma_date_hour_from_time (date_num);
+      break;
+    }
+    case ECMA_DATE_PROTOTYPE_GET_MINUTES:
+    case ECMA_DATE_PROTOTYPE_GET_UTC_MINUTES:
+    {
+      date_num = ecma_date_min_from_time (date_num);
+      break;
+    }
+    case ECMA_DATE_PROTOTYPE_GET_SECONDS:
+    case ECMA_DATE_PROTOTYPE_GET_UTC_SECONDS:
+    {
+      date_num = ecma_date_sec_from_time (date_num);
+      break;
+    }
+    case ECMA_DATE_PROTOTYPE_GET_MILLISECONDS:
+    case ECMA_DATE_PROTOTYPE_GET_UTC_MILLISECONDS:
+    {
+      date_num = ecma_date_ms_from_time (date_num);
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (builtin_routine_id == ECMA_DATE_PROTOTYPE_GET_UTC_TIMEZONE_OFFSET);
+      date_num = ecma_date_timezone_offset (date_num);
+      break;
+    }
+  }
+
+  return ecma_make_number_value (date_num);
+} /* ecma_builtin_date_prototype_dispatch_get */
+
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+
+/**
+ * Returns true, if the built-in id sets a year.
+ */
+#define ECMA_DATE_PROTOTYPE_IS_SET_YEAR_ROUTINE(builtin_routine_id) \
+  ((builtin_routine_id) == ECMA_DATE_PROTOTYPE_SET_FULL_YEAR \
+   || (builtin_routine_id) == ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR \
+   || (builtin_routine_id) == ECMA_DATE_PROTOTYPE_SET_YEAR)
+
+#else /* CONFIG_DISABLE_ANNEXB_BUILTIN */
+
+/**
+ * Returns true, if the built-in id sets a year.
+ */
+#define ECMA_DATE_PROTOTYPE_IS_SET_YEAR_ROUTINE(builtin_routine_id) \
+  ((builtin_routine_id) == ECMA_DATE_PROTOTYPE_SET_FULL_YEAR \
+   || (builtin_routine_id) == ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR)
+
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+
+/**
+ * Dispatch set date functions
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< built-in wide routine
+                                                                        *   identifier */
+                                          ecma_extended_object_t *ext_object_p, /**< date extended object */
+                                          ecma_number_t date_num, /**< date converted to number */
+                                          const ecma_value_t arguments_list[], /**< list of arguments
+                                                                                *   passed to routine */
+                                          ecma_length_t arguments_number) /**< length of arguments' list */
+{
+  ecma_number_t converted_number[4];
+  ecma_length_t conversions = 0;
+
+  /* If the first argument is not specified, it is always converted to NaN. */
+  converted_number[0] = ecma_number_make_nan ();
+
+  switch (builtin_routine_id)
+  {
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+    case ECMA_DATE_PROTOTYPE_SET_YEAR:
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+    case ECMA_DATE_PROTOTYPE_SET_DATE:
+    case ECMA_DATE_PROTOTYPE_SET_UTC_DATE:
+    case ECMA_DATE_PROTOTYPE_SET_UTC_MILLISECONDS:
+    case ECMA_DATE_PROTOTYPE_SET_MILLISECONDS:
+    {
+      conversions = 1;
+      break;
+    }
+    case ECMA_DATE_PROTOTYPE_SET_MONTH:
+    case ECMA_DATE_PROTOTYPE_SET_UTC_MONTH:
+    case ECMA_DATE_PROTOTYPE_SET_UTC_SECONDS:
+    case ECMA_DATE_PROTOTYPE_SET_SECONDS:
+    {
+      conversions = 2;
+      break;
+    }
+    case ECMA_DATE_PROTOTYPE_SET_FULL_YEAR:
+    case ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR:
+    case ECMA_DATE_PROTOTYPE_SET_MINUTES:
+    case ECMA_DATE_PROTOTYPE_SET_UTC_MINUTES:
+    {
+      conversions = 3;
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_HOURS
+                    || builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_UTC_HOURS);
+      conversions = 4;
+      break;
+    }
+  }
+
+  if (conversions > arguments_number)
+  {
+    conversions = arguments_number;
+  }
+
+  for (ecma_length_t i = 0; i < conversions; i++)
+  {
+    ecma_value_t value = ecma_op_to_number (arguments_list[i]);
+
+    if (ECMA_IS_VALUE_ERROR (value))
+    {
+      return value;
+    }
+
+    converted_number[i] = ecma_get_number_from_value (value);
+    ecma_free_value (value);
+  }
+
+  ecma_number_t day_part;
+  ecma_number_t time_part;
+
+  if (builtin_routine_id <= ECMA_DATE_PROTOTYPE_SET_UTC_DATE)
+  {
+    if (ecma_number_is_nan (date_num))
+    {
+      if (ECMA_DATE_PROTOTYPE_IS_SET_YEAR_ROUTINE (builtin_routine_id))
+      {
+        date_num = ECMA_NUMBER_ZERO;
+      }
+      else
+      {
+        return ecma_make_number_value (date_num);
+      }
+    }
+
+    time_part = ecma_date_time_within_day (date_num);
+
+    ecma_number_t year = ecma_date_year_from_time (date_num);
+    ecma_number_t month = ecma_date_month_from_time (date_num);
+    ecma_number_t day = ecma_date_date_from_time (date_num);
+
+    switch (builtin_routine_id)
+    {
+      case ECMA_DATE_PROTOTYPE_SET_FULL_YEAR:
+      case ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR:
+      {
+        year = converted_number[0];
+        if (conversions >= 2)
+        {
+          month = converted_number[1];
+        }
+        if (conversions >= 3)
+        {
+          day = converted_number[2];
+        }
+        break;
+      }
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+      case ECMA_DATE_PROTOTYPE_SET_YEAR:
+      {
+        year = converted_number[0];
+        if (year >= 0 && year <= 99)
+        {
+          year += 1900;
+        }
+        break;
+      }
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+      case ECMA_DATE_PROTOTYPE_SET_MONTH:
+      case ECMA_DATE_PROTOTYPE_SET_UTC_MONTH:
+      {
+        month = converted_number[0];
+        if (conversions >= 2)
+        {
+          day = converted_number[1];
+        }
+        break;
+      }
+      default:
+      {
+        JERRY_ASSERT (builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_DATE
+                      || builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_UTC_DATE);
+        day = converted_number[0];
+        break;
+      }
+    }
+
+    day_part = ecma_date_make_day (year, month, day);
+
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+    if (builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_YEAR)
+    {
+      builtin_routine_id = ECMA_DATE_PROTOTYPE_SET_UTC_YEAR;
+
+      if (ecma_number_is_nan (converted_number[0]))
+      {
+        day_part = 0;
+        time_part = converted_number[0];
+      }
+    }
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+  }
+  else
+  {
+    if (ecma_number_is_nan (date_num))
+    {
+      return ecma_make_number_value (date_num);
+    }
+
+    day_part = ecma_date_day (date_num);
+
+    ecma_number_t hour = ecma_date_hour_from_time (date_num);
+    ecma_number_t min = ecma_date_min_from_time (date_num);
+    ecma_number_t sec = ecma_date_sec_from_time (date_num);
+    ecma_number_t ms = ecma_date_ms_from_time (date_num);
+
+    switch (builtin_routine_id)
+    {
+      case ECMA_DATE_PROTOTYPE_SET_HOURS:
+      case ECMA_DATE_PROTOTYPE_SET_UTC_HOURS:
+      {
+        hour = converted_number[0];
+        if (conversions >= 2)
+        {
+          min = converted_number[1];
+        }
+        if (conversions >= 3)
+        {
+          sec = converted_number[2];
+        }
+        if (conversions >= 4)
+        {
+          ms = converted_number[3];
+        }
+        break;
+      }
+      case ECMA_DATE_PROTOTYPE_SET_MINUTES:
+      case ECMA_DATE_PROTOTYPE_SET_UTC_MINUTES:
+      {
+        min = converted_number[0];
+        if (conversions >= 2)
+        {
+          sec = converted_number[1];
+        }
+        if (conversions >= 3)
+        {
+          ms = converted_number[2];
+        }
+        break;
+      }
+      case ECMA_DATE_PROTOTYPE_SET_UTC_SECONDS:
+      case ECMA_DATE_PROTOTYPE_SET_SECONDS:
+      {
+        sec = converted_number[0];
+        if (conversions >= 2)
+        {
+          ms = converted_number[1];
+        }
+        break;
+      }
+      default:
+      {
+        JERRY_ASSERT (builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_UTC_MILLISECONDS
+                      || builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_MILLISECONDS);
+        ms = converted_number[0];
+        break;
+      }
+    }
+
+    time_part = ecma_date_make_time (hour, min, sec, ms);
+  }
+
+  bool is_utc = BUILTIN_DATE_FUNCTION_IS_UTC (builtin_routine_id);
+
+  ecma_number_t full_date = ecma_date_make_date (day_part, time_part);
+
+  if (!is_utc)
+  {
+    full_date = ecma_date_utc (full_date);
+  }
+
+  full_date = ecma_date_time_clip (full_date);
+
+  *ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, ext_object_p->u.class_prop.u.value) = full_date;
+
+  return ecma_make_number_value (full_date);
+} /* ecma_builtin_date_prototype_dispatch_set */
+
+#undef ECMA_DATE_PROTOTYPE_IS_SET_YEAR_ROUTINE
+
+/**
+ * Dispatcher of the built-in's routines
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_date_prototype_dispatch_routine (uint16_t builtin_routine_id, /**< built-in wide routine
+                                                                            *   identifier */
+                                              ecma_value_t this_arg, /**< 'this' argument value */
+                                              const ecma_value_t arguments_list[], /**< list of arguments
+                                                                                    *   passed to routine */
+                                              ecma_length_t arguments_number) /**< length of arguments' list */
+{
+  if (unlikely (builtin_routine_id == ECMA_DATE_PROTOTYPE_TO_JSON))
+  {
+    return ecma_builtin_date_prototype_to_json (this_arg);
+  }
+
+  if (!ecma_is_value_object (this_arg)
+      || !ecma_object_class_is (ecma_get_object_from_value (this_arg), LIT_MAGIC_STRING_DATE_UL))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Date object expected"));
+  }
+
+  ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  ecma_number_t *prim_value_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t,
+                                                                 ext_object_p->u.class_prop.u.value);
+
+  if (builtin_routine_id == ECMA_DATE_PROTOTYPE_GET_TIME)
+  {
+    return ecma_make_number_value (*prim_value_p);
+  }
+
+  if (builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_TIME)
+  {
+    ecma_value_t time = (arguments_number >= 1 ? arguments_list[0]
+                                               : ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED));
+
+    ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+    /* 1. */
+    ECMA_OP_TO_NUMBER_TRY_CATCH (time_num, time, ret_value);
+    *prim_value_p = ecma_date_time_clip (time_num);
+
+    ret_value = ecma_make_number_value (time_num);
+    ECMA_OP_TO_NUMBER_FINALIZE (time_num);
+
+    return ret_value;
+  }
+
+  if (builtin_routine_id <= ECMA_DATE_PROTOTYPE_SET_UTC_MILLISECONDS)
+  {
+    ecma_number_t this_num = *prim_value_p;
+
+    if (!BUILTIN_DATE_FUNCTION_IS_UTC (builtin_routine_id))
+    {
+      this_num += ecma_date_local_time_zone (this_num);
+    }
+
+    if (builtin_routine_id <= ECMA_DATE_PROTOTYPE_GET_UTC_TIMEZONE_OFFSET)
+    {
+      return ecma_builtin_date_prototype_dispatch_get (builtin_routine_id, this_num);
+    }
+
+    return ecma_builtin_date_prototype_dispatch_set (builtin_routine_id,
+                                                     ext_object_p,
+                                                     this_num,
+                                                     arguments_list,
+                                                     arguments_number);
+  }
+
+  if (builtin_routine_id == ECMA_DATE_PROTOTYPE_TO_ISO_STRING)
+  {
+    if (ecma_number_is_nan (*prim_value_p) || ecma_number_is_infinity (*prim_value_p))
+    {
+      return ecma_raise_range_error (ECMA_ERR_MSG ("Date must be a finite number."));
+    }
+
+    return ecma_date_value_to_iso_string (*prim_value_p);
+  }
+
+  if (ecma_number_is_nan (*prim_value_p))
+  {
+    ecma_string_t *magic_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_INVALID_DATE_UL);
+    return ecma_make_string_value (magic_str_p);
+  }
+
+  switch (builtin_routine_id)
+  {
+    case ECMA_DATE_PROTOTYPE_TO_STRING:
+    {
+      return ecma_date_value_to_string (*prim_value_p);
+    }
+    case ECMA_DATE_PROTOTYPE_TO_DATE_STRING:
+    {
+      return ecma_date_value_to_date_string (*prim_value_p);
+    }
+    case ECMA_DATE_PROTOTYPE_TO_TIME_STRING:
+    {
+      return ecma_date_value_to_time_string (*prim_value_p);
+    }
+    default:
+    {
+      JERRY_ASSERT (builtin_routine_id == ECMA_DATE_PROTOTYPE_TO_UTC_STRING);
+      return ecma_date_value_to_utc_string (*prim_value_p);
+    }
+  }
+} /* ecma_builtin_date_prototype_dispatch_routine */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h
new file mode 100644 (file)
index 0000000..f6a4266
--- /dev/null
@@ -0,0 +1,82 @@
+/* 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.
+ */
+
+/*
+ * Date.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_DATE_BUILTIN
+
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_DATE,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_DATE_PROTOTYPE_TO_STRING, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_DATE_STRING_UL, ECMA_DATE_PROTOTYPE_TO_DATE_STRING, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_TIME_STRING_UL, ECMA_DATE_PROTOTYPE_TO_TIME_STRING, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ECMA_DATE_PROTOTYPE_TO_STRING, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_DATE_STRING_UL, ECMA_DATE_PROTOTYPE_TO_DATE_STRING, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_TIME_STRING_UL, ECMA_DATE_PROTOTYPE_TO_TIME_STRING, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ECMA_DATE_PROTOTYPE_GET_TIME, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_TIME_UL, ECMA_DATE_PROTOTYPE_GET_TIME, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_GET_FULL_YEAR, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_UTC_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_GET_UTC_FULL_YEAR, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_MONTH_UL, ECMA_DATE_PROTOTYPE_GET_MONTH, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_UTC_MONTH_UL, ECMA_DATE_PROTOTYPE_GET_UTC_MONTH, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_DATE_UL, ECMA_DATE_PROTOTYPE_GET_DATE, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_UTC_DATE_UL, ECMA_DATE_PROTOTYPE_GET_UTC_DATE, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_DAY_UL, ECMA_DATE_PROTOTYPE_GET_DAY, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_UTC_DAY_UL, ECMA_DATE_PROTOTYPE_GET_UTC_DAY, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_HOURS_UL, ECMA_DATE_PROTOTYPE_GET_HOURS, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_UTC_HOURS_UL, ECMA_DATE_PROTOTYPE_GET_UTC_HOURS, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_MINUTES_UL, ECMA_DATE_PROTOTYPE_GET_MINUTES, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_UTC_MINUTES_UL, ECMA_DATE_PROTOTYPE_GET_UTC_MINUTES, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_SECONDS_UL, ECMA_DATE_PROTOTYPE_GET_SECONDS, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_UTC_SECONDS_UL, ECMA_DATE_PROTOTYPE_GET_UTC_SECONDS, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_MILLISECONDS_UL, ECMA_DATE_PROTOTYPE_GET_MILLISECONDS, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_UTC_MILLISECONDS_UL, ECMA_DATE_PROTOTYPE_GET_UTC_MILLISECONDS, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_GET_TIMEZONE_OFFSET_UL, ECMA_DATE_PROTOTYPE_GET_UTC_TIMEZONE_OFFSET, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_SET_TIME_UL, ECMA_DATE_PROTOTYPE_SET_TIME, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_SET_MILLISECONDS_UL, ECMA_DATE_PROTOTYPE_SET_MILLISECONDS, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_SET_UTC_MILLISECONDS_UL, ECMA_DATE_PROTOTYPE_SET_UTC_MILLISECONDS, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_SET_SECONDS_UL, ECMA_DATE_PROTOTYPE_SET_SECONDS, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_SET_UTC_SECONDS_UL, ECMA_DATE_PROTOTYPE_SET_UTC_SECONDS, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_SET_MINUTES_UL, ECMA_DATE_PROTOTYPE_SET_MINUTES, NON_FIXED, 3)
+ROUTINE (LIT_MAGIC_STRING_SET_UTC_MINUTES_UL, ECMA_DATE_PROTOTYPE_SET_UTC_MINUTES, NON_FIXED, 3)
+ROUTINE (LIT_MAGIC_STRING_SET_HOURS_UL, ECMA_DATE_PROTOTYPE_SET_HOURS, NON_FIXED, 4)
+ROUTINE (LIT_MAGIC_STRING_SET_UTC_HOURS_UL, ECMA_DATE_PROTOTYPE_SET_UTC_HOURS, NON_FIXED, 4)
+ROUTINE (LIT_MAGIC_STRING_SET_DATE_UL, ECMA_DATE_PROTOTYPE_SET_DATE, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_SET_UTC_DATE_UL, ECMA_DATE_PROTOTYPE_SET_UTC_DATE, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_SET_MONTH_UL, ECMA_DATE_PROTOTYPE_SET_MONTH, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_SET_UTC_MONTH_UL, ECMA_DATE_PROTOTYPE_SET_UTC_MONTH, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_SET_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_FULL_YEAR, NON_FIXED, 3)
+ROUTINE (LIT_MAGIC_STRING_SET_UTC_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR, NON_FIXED, 3)
+ROUTINE (LIT_MAGIC_STRING_TO_UTC_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_ISO_STRING_UL, ECMA_DATE_PROTOTYPE_TO_ISO_STRING, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_JSON_UL, ECMA_DATE_PROTOTYPE_TO_JSON, 1, 1)
+
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+
+ROUTINE (LIT_MAGIC_STRING_GET_YEAR_UL, ECMA_DATE_PROTOTYPE_GET_YEAR, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_SET_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_YEAR, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_TO_GMT_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 0, 0)
+
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+
+#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date.c
new file mode 100644 (file)
index 0000000..aaa3413
--- /dev/null
@@ -0,0 +1,570 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-try-catch-macro.h"
+#include "lit-char-helpers.h"
+
+#ifndef CONFIG_DISABLE_DATE_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-date.inc.h"
+#define BUILTIN_UNDERSCORED_ID date
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup date ECMA Date object built-in
+ * @{
+ */
+
+/**
+ * Helper function to try to parse a part of a date string
+ *
+ * @return NaN if cannot read from string, ToNumber() otherwise
+ */
+static ecma_number_t
+ecma_date_parse_date_chars (const lit_utf8_byte_t **str_p, /**< pointer to the cesu8 string */
+                            const lit_utf8_byte_t *str_end_p, /**< pointer to the end of the string */
+                            uint32_t num_of_chars) /**< number of characters to read and convert */
+{
+  JERRY_ASSERT (num_of_chars > 0);
+  const lit_utf8_byte_t *str_start_p = *str_p;
+
+  while (num_of_chars--)
+  {
+    if (*str_p >= str_end_p || !lit_char_is_decimal_digit (lit_utf8_read_next (str_p)))
+    {
+      return ecma_number_make_nan ();
+    }
+  }
+
+  return ecma_utf8_string_to_number (str_start_p, (lit_utf8_size_t) (*str_p - str_start_p));
+} /* ecma_date_parse_date_chars */
+
+/**
+  * Calculate MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli)) for Date constructor and UTC
+  *
+  * See also:
+  *          ECMA-262 v5, 15.9.3.1
+  *          ECMA-262 v5, 15.9.4.3
+  *
+  * @return result of MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))
+  */
+static ecma_value_t
+ecma_date_construct_helper (const ecma_value_t *args, /**< arguments passed to the Date constructor */
+                            ecma_length_t args_len) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_number_t prim_value = ecma_number_make_nan ();
+
+  ECMA_TRY_CATCH (year_value, ecma_op_to_number (args[0]), ret_value);
+  ECMA_TRY_CATCH (month_value, ecma_op_to_number (args[1]), ret_value);
+
+  ecma_number_t year = ecma_get_number_from_value (year_value);
+  ecma_number_t month = ecma_get_number_from_value (month_value);
+  ecma_number_t date = ECMA_NUMBER_ONE;
+  ecma_number_t hours = ECMA_NUMBER_ZERO;
+  ecma_number_t minutes = ECMA_NUMBER_ZERO;
+  ecma_number_t seconds = ECMA_NUMBER_ZERO;
+  ecma_number_t milliseconds = ECMA_NUMBER_ZERO;
+
+  /* 3. */
+  if (args_len >= 3 && ecma_is_value_empty (ret_value))
+  {
+    ECMA_TRY_CATCH (date_value, ecma_op_to_number (args[2]), ret_value);
+    date = ecma_get_number_from_value (date_value);
+    ECMA_FINALIZE (date_value);
+  }
+
+  /* 4. */
+  if (args_len >= 4 && ecma_is_value_empty (ret_value))
+  {
+    ECMA_TRY_CATCH (hours_value, ecma_op_to_number (args[3]), ret_value);
+    hours = ecma_get_number_from_value (hours_value);
+    ECMA_FINALIZE (hours_value);
+  }
+
+  /* 5. */
+  if (args_len >= 5 && ecma_is_value_empty (ret_value))
+  {
+    ECMA_TRY_CATCH (minutes_value, ecma_op_to_number (args[4]), ret_value);
+    minutes = ecma_get_number_from_value (minutes_value);
+    ECMA_FINALIZE (minutes_value);
+  }
+
+  /* 6. */
+  if (args_len >= 6 && ecma_is_value_empty (ret_value))
+  {
+    ECMA_TRY_CATCH (seconds_value, ecma_op_to_number (args[5]), ret_value);
+    seconds = ecma_get_number_from_value (seconds_value);
+    ECMA_FINALIZE (seconds_value);
+  }
+
+  /* 7. */
+  if (args_len >= 7 && ecma_is_value_empty (ret_value))
+  {
+    ECMA_TRY_CATCH (milliseconds_value, ecma_op_to_number (args[6]), ret_value);
+    milliseconds = ecma_get_number_from_value (milliseconds_value);
+    ECMA_FINALIZE (milliseconds_value);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    if (!ecma_number_is_nan (year))
+    {
+      /* 8. */
+      ecma_number_t y = ecma_number_trunc (year);
+
+      if (y >= 0 && y <= 99)
+      {
+        year = 1900 + y;
+      }
+    }
+
+    prim_value = ecma_date_make_date (ecma_date_make_day (year,
+                                                          month,
+                                                          date),
+                                      ecma_date_make_time (hours,
+                                                           minutes,
+                                                           seconds,
+                                                           milliseconds));
+  }
+
+  ECMA_FINALIZE (month_value);
+  ECMA_FINALIZE (year_value);
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = ecma_make_number_value (prim_value);
+  }
+
+  return ret_value;
+} /* ecma_date_construct_helper */
+
+/**
+ * The Date object's 'parse' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.4.2
+ *          ECMA-262 v5, 15.9.1.15
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_date_parse (ecma_value_t this_arg, /**< this argument */
+                         ecma_value_t arg) /**< string */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_number_t date_num = ecma_number_make_nan ();
+
+  /* Date Time String fromat (ECMA-262 v5, 15.9.1.15) */
+  ECMA_TRY_CATCH (date_str_value,
+                  ecma_op_to_string (arg),
+                  ret_value);
+
+  ecma_string_t *date_str_p = ecma_get_string_from_value (date_str_value);
+
+  ECMA_STRING_TO_UTF8_STRING (date_str_p, date_start_p, date_start_size);
+
+  const lit_utf8_byte_t *date_str_curr_p = date_start_p;
+  const lit_utf8_byte_t *date_str_end_p = date_start_p + date_start_size;
+
+  /* 1. read year */
+  ecma_number_t year = ecma_date_parse_date_chars (&date_str_curr_p, date_str_end_p, 4);
+
+  if (!ecma_number_is_nan (year)
+      && year >= 0)
+  {
+    ecma_number_t month = ECMA_NUMBER_ONE;
+    ecma_number_t day = ECMA_NUMBER_ONE;
+    ecma_number_t time = ECMA_NUMBER_ZERO;
+
+    /* 2. read month if any */
+    if (date_str_curr_p < date_str_end_p
+        && *date_str_curr_p == '-')
+    {
+      /* eat up '-' */
+      date_str_curr_p++;
+      month = ecma_date_parse_date_chars (&date_str_curr_p, date_str_end_p, 2);
+
+      if (month > 12 || month < 1)
+      {
+        month = ecma_number_make_nan ();
+      }
+    }
+
+    /* 3. read day if any */
+    if (date_str_curr_p < date_str_end_p
+        && *date_str_curr_p == '-')
+    {
+      /* eat up '-' */
+      date_str_curr_p++;
+      day = ecma_date_parse_date_chars (&date_str_curr_p, date_str_end_p, 2);
+
+      if (day < 1 || day > 31)
+      {
+        day = ecma_number_make_nan ();
+      }
+    }
+
+    /* 4. read time if any */
+    if (date_str_curr_p < date_str_end_p
+        && *date_str_curr_p == 'T')
+    {
+      /* eat up 'T' */
+      date_str_curr_p++;
+
+      ecma_number_t hours = ECMA_NUMBER_ZERO;
+      ecma_number_t minutes = ECMA_NUMBER_ZERO;
+      ecma_number_t seconds = ECMA_NUMBER_ZERO;
+      ecma_number_t milliseconds = ECMA_NUMBER_ZERO;
+
+      ecma_length_t remaining_length = lit_utf8_string_length (date_str_curr_p,
+                                                               (lit_utf8_size_t) (date_str_end_p - date_str_curr_p));
+
+      if (remaining_length >= 5)
+      {
+        /* 4.1 read hours and minutes */
+        hours = ecma_date_parse_date_chars (&date_str_curr_p, date_str_end_p, 2);
+
+        if (hours < 0 || hours > 24)
+        {
+          hours = ecma_number_make_nan ();
+        }
+        else if (hours == 24)
+        {
+          hours = ECMA_NUMBER_ZERO;
+        }
+
+        /* eat up ':' */
+        date_str_curr_p++;
+
+        minutes = ecma_date_parse_date_chars (&date_str_curr_p, date_str_end_p, 2);
+
+        if (minutes < 0 || minutes > 59)
+        {
+          minutes = ecma_number_make_nan ();
+        }
+
+        /* 4.2 read seconds if any */
+        if (date_str_curr_p < date_str_end_p
+            && *date_str_curr_p == ':')
+        {
+          /* eat up ':' */
+          date_str_curr_p++;
+          seconds = ecma_date_parse_date_chars (&date_str_curr_p, date_str_end_p, 2);
+
+          if (seconds < 0 || seconds > 59)
+          {
+            seconds = ecma_number_make_nan ();
+          }
+
+          /* 4.3 read milliseconds if any */
+          if (date_str_curr_p < date_str_end_p
+              && *date_str_curr_p == '.')
+          {
+            /* eat up '.' */
+            date_str_curr_p++;
+            milliseconds = ecma_date_parse_date_chars (&date_str_curr_p, date_str_end_p, 3);
+
+            if (milliseconds < 0)
+            {
+              milliseconds = ecma_number_make_nan ();
+            }
+          }
+        }
+
+        time = ecma_date_make_time (hours, minutes, seconds, milliseconds);
+      }
+      else
+      {
+        time = ecma_number_make_nan ();
+      }
+
+      /* 4.4 read timezone if any */
+      if (date_str_curr_p < date_str_end_p
+          && *date_str_curr_p == 'Z'
+          && !ecma_number_is_nan (time))
+      {
+        date_str_curr_p++;
+        time = ecma_date_make_time (hours, minutes, seconds, milliseconds);
+      }
+      else if (date_str_curr_p < date_str_end_p
+               && (*date_str_curr_p == '+' || *date_str_curr_p == '-'))
+      {
+        ecma_length_t remaining_date_length;
+        remaining_date_length = lit_utf8_string_length (date_str_curr_p,
+                                                        (lit_utf8_size_t) (date_str_end_p - date_str_curr_p)) - 1;
+
+        if (remaining_date_length == 5)
+        {
+          bool is_negative = false;
+
+          if (*date_str_curr_p == '-')
+          {
+            is_negative = true;
+          }
+
+          /* eat up '+/-' */
+          date_str_curr_p++;
+
+          /* read hours and minutes */
+          hours = ecma_date_parse_date_chars (&date_str_curr_p, date_str_end_p, 2);
+
+          if (hours < 0 || hours > 24)
+          {
+            hours = ecma_number_make_nan ();
+          }
+          else if (hours == 24)
+          {
+            hours = ECMA_NUMBER_ZERO;
+          }
+
+          /* eat up ':' */
+          date_str_curr_p++;
+
+          minutes = ecma_date_parse_date_chars (&date_str_curr_p, date_str_end_p, 2);
+
+          if (minutes < 0 || minutes > 59)
+          {
+            minutes = ecma_number_make_nan ();
+          }
+
+          if (is_negative)
+          {
+            time += ecma_date_make_time (hours, minutes, ECMA_NUMBER_ZERO, ECMA_NUMBER_ZERO);
+          }
+          else
+          {
+            time -= ecma_date_make_time (hours, minutes, ECMA_NUMBER_ZERO, ECMA_NUMBER_ZERO);
+          }
+        }
+      }
+    }
+
+    if (date_str_curr_p >= date_str_end_p)
+    {
+      ecma_number_t date = ecma_date_make_day (year, month - 1, day);
+      date_num = ecma_date_make_date (date, time);
+    }
+  }
+
+  ret_value = ecma_make_number_value (date_num);
+
+  ECMA_FINALIZE_UTF8_STRING (date_start_p, date_start_size);
+  ECMA_FINALIZE (date_str_value);
+
+  return ret_value;
+} /* ecma_builtin_date_parse */
+
+/**
+ * The Date object's 'UTC' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.4.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_date_utc (ecma_value_t this_arg, /**< this argument */
+                       const ecma_value_t args[], /**< arguments list */
+                       ecma_length_t args_number) /**< number of arguments */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (args_number < 2)
+  {
+    /* Note:
+     *      When the UTC function is called with fewer than two arguments,
+     *      the behaviour is implementation-dependent, so just return NaN.
+     */
+    return ecma_make_number_value (ecma_number_make_nan ());
+  }
+
+  ECMA_TRY_CATCH (time_value, ecma_date_construct_helper (args, args_number), ret_value);
+
+  ecma_number_t time = ecma_get_number_from_value (time_value);
+  ret_value = ecma_make_number_value (ecma_date_time_clip (time));
+
+  ECMA_FINALIZE (time_value);
+
+  return ret_value;
+} /* ecma_builtin_date_utc */
+
+/**
+ * The Date object's 'now' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.4.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_date_now (ecma_value_t this_arg) /**< this argument */
+{
+  JERRY_UNUSED (this_arg);
+  return ecma_make_number_value (DOUBLE_TO_ECMA_NUMBER_T (jerry_port_get_current_time ()));
+} /* ecma_builtin_date_now */
+
+/**
+ * Handle calling [[Call]] of built-in Date object
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.2.1
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_date_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                 ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_UNUSED (arguments_list_p);
+  JERRY_UNUSED (arguments_list_len);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (now_val,
+                  ecma_builtin_date_now (ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED)),
+                  ret_value);
+
+  ret_value = ecma_date_value_to_string (ecma_get_number_from_value (now_val));
+
+  ECMA_FINALIZE (now_val);
+
+  return ret_value;
+} /* ecma_builtin_date_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in Date object
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.3.1
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                      ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_number_t prim_value_num = ECMA_NUMBER_ZERO;
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_DATE_PROTOTYPE);
+  ecma_object_t *obj_p = ecma_create_object (prototype_obj_p,
+                                             sizeof (ecma_extended_object_t),
+                                             ECMA_OBJECT_TYPE_CLASS);
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+  ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_UNDEFINED;
+
+  ecma_deref_object (prototype_obj_p);
+
+  if (arguments_list_len == 0)
+  {
+    ECMA_TRY_CATCH (parse_res_value,
+                    ecma_builtin_date_now (ecma_make_object_value (obj_p)),
+                    ret_value);
+
+    prim_value_num = ecma_get_number_from_value (parse_res_value);
+
+    ECMA_FINALIZE (parse_res_value)
+  }
+  else if (arguments_list_len == 1)
+  {
+    ECMA_TRY_CATCH (prim_comp_value,
+                    ecma_op_to_primitive (arguments_list_p[0], ECMA_PREFERRED_TYPE_NUMBER),
+                    ret_value);
+
+    if (ecma_is_value_string (prim_comp_value))
+    {
+      ECMA_TRY_CATCH (parse_res_value,
+                      ecma_builtin_date_parse (ecma_make_object_value (obj_p), prim_comp_value),
+                      ret_value);
+
+      prim_value_num = ecma_get_number_from_value (parse_res_value);
+
+      ECMA_FINALIZE (parse_res_value);
+    }
+    else
+    {
+      ECMA_TRY_CATCH (prim_value, ecma_op_to_number (arguments_list_p[0]), ret_value);
+
+      prim_value_num = ecma_date_time_clip (ecma_get_number_from_value (prim_value));
+
+      ECMA_FINALIZE (prim_value);
+    }
+
+    ECMA_FINALIZE (prim_comp_value);
+  }
+  else
+  {
+    ECMA_TRY_CATCH (time_value,
+                    ecma_date_construct_helper (arguments_list_p, arguments_list_len),
+                    ret_value);
+
+    ecma_number_t time = ecma_get_number_from_value (time_value);
+    prim_value_num = ecma_date_time_clip (ecma_date_utc (time));
+
+    ECMA_FINALIZE (time_value);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    if (!ecma_number_is_nan (prim_value_num) && ecma_number_is_infinity (prim_value_num))
+    {
+      prim_value_num = ecma_number_make_nan ();
+    }
+
+    ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_DATE_UL;
+
+    ecma_number_t *date_num_p = ecma_alloc_number ();
+    *date_num_p = prim_value_num;
+    ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.class_prop.u.value, date_num_p);
+
+    ret_value = ecma_make_object_value (obj_p);
+  }
+  else
+  {
+    JERRY_ASSERT (ECMA_IS_VALUE_ERROR (ret_value));
+    ecma_deref_object (obj_p);
+  }
+
+  return ret_value;
+} /* ecma_builtin_date_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-date.inc.h
new file mode 100644 (file)
index 0000000..c1d07bc
--- /dev/null
@@ -0,0 +1,39 @@
+/* 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.
+ */
+
+/*
+ * Date built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_DATE_BUILTIN
+
+/* ECMA-262 v5, 15.9.4.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_DATE_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              7,
+              ECMA_PROPERTY_FIXED)
+
+ROUTINE (LIT_MAGIC_STRING_PARSE, ecma_builtin_date_parse, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_UTC_U, ecma_builtin_date_utc, NON_FIXED, 7)
+ROUTINE (LIT_MAGIC_STRING_NOW, ecma_builtin_date_now, 0, 0)
+
+#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error-prototype.c
new file mode 100644 (file)
index 0000000..c037bbf
--- /dev/null
@@ -0,0 +1,194 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+#include "lit-magic-strings.h"
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-error-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID error_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup errorprototype ECMA Error.prototype object built-in
+ * @{
+ */
+
+/**
+ * The Error.prototype object's 'toString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.11.4.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_error_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 2. */
+  if (!ecma_is_value_object (this_arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);
+    ecma_string_t *name_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_NAME);
+
+    ECMA_TRY_CATCH (name_get_ret_value,
+                    ecma_op_object_get (obj_p, name_magic_string_p),
+                    ret_value);
+
+    ecma_value_t name_to_str_completion;
+
+    if (ecma_is_value_undefined (name_get_ret_value))
+    {
+      ecma_string_t *error_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_ERROR_UL);
+
+      name_to_str_completion = ecma_make_string_value (error_magic_string_p);
+    }
+    else
+    {
+      name_to_str_completion = ecma_op_to_string (name_get_ret_value);
+    }
+
+    if (unlikely (ECMA_IS_VALUE_ERROR (name_to_str_completion)))
+    {
+      ret_value = ecma_copy_value (name_to_str_completion);
+    }
+    else
+    {
+      ecma_string_t *message_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_MESSAGE);
+
+      ECMA_TRY_CATCH (msg_get_ret_value,
+                      ecma_op_object_get (obj_p, message_magic_string_p),
+                      ret_value);
+
+      ecma_value_t msg_to_str_completion;
+
+      if (ecma_is_value_undefined (msg_get_ret_value))
+      {
+        ecma_string_t *empty_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+
+        msg_to_str_completion = ecma_make_string_value (empty_magic_string_p);
+      }
+      else
+      {
+        msg_to_str_completion = ecma_op_to_string (msg_get_ret_value);
+      }
+
+      if (unlikely (ECMA_IS_VALUE_ERROR (msg_to_str_completion)))
+      {
+        ret_value = ecma_copy_value (msg_to_str_completion);
+      }
+      else
+      {
+        ecma_string_t *name_string_p = ecma_get_string_from_value (name_to_str_completion);
+        ecma_string_t *msg_string_p = ecma_get_string_from_value (msg_to_str_completion);
+
+        ecma_string_t *ret_str_p;
+
+        if (ecma_string_is_empty (name_string_p))
+        {
+          ret_str_p = msg_string_p;
+          ecma_ref_ecma_string (ret_str_p);
+        }
+        else if (ecma_string_is_empty (msg_string_p))
+        {
+          ret_str_p = name_string_p;
+          ecma_ref_ecma_string (ret_str_p);
+        }
+        else
+        {
+          const lit_utf8_size_t name_size = ecma_string_get_size (name_string_p);
+          const lit_utf8_size_t msg_size = ecma_string_get_size (msg_string_p);
+          const lit_utf8_size_t colon_size = lit_get_magic_string_size (LIT_MAGIC_STRING_COLON_CHAR);
+          const lit_utf8_size_t space_size = lit_get_magic_string_size (LIT_MAGIC_STRING_SPACE_CHAR);
+          const lit_utf8_size_t size = name_size + msg_size + colon_size + space_size;
+
+          JMEM_DEFINE_LOCAL_ARRAY (ret_str_buffer, size, lit_utf8_byte_t);
+          lit_utf8_byte_t *ret_str_buffer_p = ret_str_buffer;
+
+          lit_utf8_size_t bytes = ecma_string_copy_to_cesu8_buffer (name_string_p, ret_str_buffer_p, name_size);
+          JERRY_ASSERT (bytes == name_size);
+          ret_str_buffer_p = ret_str_buffer_p + bytes;
+          JERRY_ASSERT (ret_str_buffer_p <= ret_str_buffer + size);
+
+          ret_str_buffer_p = lit_copy_magic_string_to_buffer (LIT_MAGIC_STRING_COLON_CHAR,
+                                                              ret_str_buffer_p,
+                                                              colon_size);
+          JERRY_ASSERT (ret_str_buffer_p <= ret_str_buffer + size);
+
+          ret_str_buffer_p = lit_copy_magic_string_to_buffer (LIT_MAGIC_STRING_SPACE_CHAR,
+                                                              ret_str_buffer_p,
+                                                              space_size);
+          JERRY_ASSERT (ret_str_buffer_p <= ret_str_buffer + size);
+
+          bytes = ecma_string_copy_to_cesu8_buffer (msg_string_p, ret_str_buffer_p, msg_size);
+          JERRY_ASSERT (bytes == msg_size);
+          ret_str_buffer_p = ret_str_buffer_p + bytes;
+          JERRY_ASSERT (ret_str_buffer_p == ret_str_buffer + size);
+
+          ret_str_p = ecma_new_ecma_string_from_utf8 (ret_str_buffer,
+                                                      size);
+
+          JMEM_FINALIZE_LOCAL_ARRAY (ret_str_buffer);
+        }
+
+        ret_value = ecma_make_string_value (ret_str_p);
+      }
+
+      ecma_free_value (msg_to_str_completion);
+
+      ECMA_FINALIZE (msg_get_ret_value);
+
+      ecma_deref_ecma_string (message_magic_string_p);
+    }
+
+    ecma_free_value (name_to_str_completion);
+
+    ECMA_FINALIZE (name_get_ret_value);
+
+    ecma_deref_ecma_string (name_magic_string_p);
+  }
+
+  return ret_value;
+} /* ecma_builtin_error_prototype_object_to_string */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error-prototype.inc.h
new file mode 100644 (file)
index 0000000..2cb3444
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+/*
+ * Error.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.4.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.4.2 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_ERROR_UL,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.4.3 */
+STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
+              LIT_MAGIC_STRING__EMPTY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_error_prototype_object_to_string, 0, 0)
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error.c
new file mode 100644 (file)
index 0000000..6fdd66f
--- /dev/null
@@ -0,0 +1,73 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-error.inc.h"
+#define BUILTIN_UNDERSCORED_ID error
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup error ECMA Error object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in Error object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                  ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_COMMON, arguments_list_p, arguments_list_len);
+} /* ecma_builtin_error_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in Error object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                       ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_error_dispatch_call (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_error_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-error.inc.h
new file mode 100644 (file)
index 0000000..3fbddac
--- /dev/null
@@ -0,0 +1,38 @@
+/* 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.
+ */
+
+/*
+ * Error built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.11.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.7.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror-prototype.c
new file mode 100644 (file)
index 0000000..9a093cd
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-evalerror-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID eval_error_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror-prototype.inc.h
new file mode 100644 (file)
index 0000000..74d6230
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+/*
+ * EvalError.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.7.8 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_EVAL_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.9 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_EVAL_ERROR_UL,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.10 */
+STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
+              LIT_MAGIC_STRING__EMPTY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c
new file mode 100644 (file)
index 0000000..46719c2
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-evalerror.inc.h"
+#define BUILTIN_UNDERSCORED_ID eval_error
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup evalerror ECMA EvalError object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in EvalError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_eval_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                       ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_EVAL, arguments_list_p, arguments_list_len);
+} /* ecma_builtin_eval_error_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in EvalError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_eval_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                            ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_eval_error_dispatch_call (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_eval_error_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.inc.h
new file mode 100644 (file)
index 0000000..32c10ab
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/*
+ * EvalError built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.11.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c
new file mode 100644 (file)
index 0000000..32dc90a
--- /dev/null
@@ -0,0 +1,396 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-function-object.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-function-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID function_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup functionprototype ECMA Function.prototype object built-in
+ * @{
+ */
+
+/**
+ * The Function.prototype object's 'toString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.3.4.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_function_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_op_is_callable (this_arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function."));
+  }
+  else
+  {
+    ecma_string_t *function_to_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__FUNCTION_TO_STRING);
+    ret_value = ecma_make_string_value (function_to_string_p);
+  }
+  return ret_value;
+} /* ecma_builtin_function_prototype_object_to_string */
+
+/**
+ * The Function.prototype object's 'apply' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.3.4.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_function_prototype_object_apply (ecma_value_t this_arg, /**< this argument */
+                                              ecma_value_t arg1, /**< first argument */
+                                              ecma_value_t arg2) /**< second argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  if (!ecma_op_is_callable (this_arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function."));
+  }
+  else
+  {
+    ecma_object_t *func_obj_p = ecma_get_object_from_value (this_arg);
+
+    /* 2. */
+    if (ecma_is_value_null (arg2) || ecma_is_value_undefined (arg2))
+    {
+      ret_value = ecma_op_function_call (func_obj_p, arg1, NULL, 0);
+    }
+    else
+    {
+      /* 3. */
+      if (!ecma_is_value_object (arg2))
+      {
+        ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+      }
+      else
+      {
+        ecma_object_t *obj_p = ecma_get_object_from_value (arg2);
+        ecma_string_t *length_magic_string_p = ecma_new_ecma_length_string ();
+
+        /* 4. */
+        ECMA_TRY_CATCH (length_value,
+                        ecma_op_object_get (obj_p, length_magic_string_p),
+                        ret_value);
+
+        ECMA_OP_TO_NUMBER_TRY_CATCH (length_number,
+                                     length_value,
+                                     ret_value);
+
+        /* 5. */
+        const uint32_t length = ecma_number_to_uint32 (length_number);
+
+        /* 6. */
+        JMEM_DEFINE_LOCAL_ARRAY (arguments_list_p, length, ecma_value_t);
+        uint32_t last_index = 0;
+
+        /* 7. */
+        for (uint32_t index = 0;
+             index < length && ecma_is_value_empty (ret_value);
+             index++)
+        {
+          ecma_string_t *curr_idx_str_p = ecma_new_ecma_string_from_uint32 (index);
+
+          ECMA_TRY_CATCH (get_value,
+                          ecma_op_object_get (obj_p, curr_idx_str_p),
+                          ret_value);
+
+          arguments_list_p[index] = ecma_copy_value (get_value);
+          last_index = index + 1;
+
+          ECMA_FINALIZE (get_value);
+          ecma_deref_ecma_string (curr_idx_str_p);
+        }
+
+        if (ecma_is_value_empty (ret_value))
+        {
+          JERRY_ASSERT (last_index == length);
+          ret_value = ecma_op_function_call (func_obj_p,
+                                             arg1,
+                                             arguments_list_p,
+                                             length);
+        }
+
+        for (uint32_t index = 0; index < last_index; index++)
+        {
+          ecma_free_value (arguments_list_p[index]);
+        }
+
+        JMEM_FINALIZE_LOCAL_ARRAY (arguments_list_p);
+
+        ECMA_OP_TO_NUMBER_FINALIZE (length_number);
+        ECMA_FINALIZE (length_value);
+        ecma_deref_ecma_string (length_magic_string_p);
+      }
+    }
+  }
+
+  return ret_value;
+} /* ecma_builtin_function_prototype_object_apply */
+
+/**
+ * The Function.prototype object's 'call' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.3.4.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_function_prototype_object_call (ecma_value_t this_arg, /**< this argument */
+                                             const ecma_value_t *arguments_list_p, /**< list of arguments */
+                                             ecma_length_t arguments_number) /**< number of arguments */
+{
+  if (!ecma_op_is_callable (this_arg))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function."));
+  }
+  else
+  {
+    ecma_object_t *func_obj_p = ecma_get_object_from_value (this_arg);
+
+    if (arguments_number == 0)
+    {
+      /* Even a 'this' argument is missing. */
+      return ecma_op_function_call (func_obj_p,
+                                    ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                    NULL,
+                                    0);
+    }
+    else
+    {
+      return ecma_op_function_call (func_obj_p,
+                                    arguments_list_p[0],
+                                    arguments_list_p + 1,
+                                    (ecma_length_t) (arguments_number - 1u));
+    }
+  }
+} /* ecma_builtin_function_prototype_object_call */
+
+/**
+ * The Function.prototype object's 'bind' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.3.4.5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_function_prototype_object_bind (ecma_value_t this_arg, /**< this argument */
+                                             const ecma_value_t *arguments_list_p, /**< list of arguments */
+                                             ecma_length_t arguments_number) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 2. */
+  if (!ecma_op_is_callable (this_arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function."));
+  }
+  else
+  {
+    /* 4. 11. 18. */
+    ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE);
+
+    ecma_length_t args_length = (arguments_number >= 1) ? arguments_number : 1;
+
+    size_t obj_size = sizeof (ecma_extended_object_t) + (args_length * sizeof (ecma_value_t));
+
+    ecma_object_t *function_p = ecma_create_object (prototype_obj_p,
+                                                    obj_size,
+                                                    ECMA_OBJECT_TYPE_BOUND_FUNCTION);
+
+    ecma_deref_object (prototype_obj_p);
+
+    ecma_extended_object_t *ext_function_p = (ecma_extended_object_t *) function_p;
+
+    /* 7. */
+    ecma_object_t *this_arg_obj_p = ecma_get_object_from_value (this_arg);
+    ECMA_SET_INTERNAL_VALUE_POINTER (ext_function_p->u.bound_function.target_function,
+                                     this_arg_obj_p);
+
+    /* 8. */
+    ext_function_p->u.bound_function.args_length = args_length;
+    ecma_value_t *args_p = (ecma_value_t *) (ext_function_p + 1);
+
+    *args_p = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+    if (arguments_number > 0)
+    {
+      *args_p = ecma_copy_value_if_not_object (arguments_list_p[0]);
+    }
+
+    if (arguments_number > 1)
+    {
+      for (ecma_length_t i = 1; i < arguments_number; i++)
+      {
+        ++args_p;
+        *args_p = ecma_copy_value_if_not_object (arguments_list_p[i]);
+      }
+    }
+
+    /*
+     * [[Class]] property is not stored explicitly for objects of ECMA_OBJECT_TYPE_FUNCTION type.
+     *
+     * See also: ecma_object_get_class_name
+     */
+
+    /* 16. */
+    ecma_number_t length = ECMA_NUMBER_ZERO;
+    ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+
+    /* 15. */
+    if (ecma_object_get_class_name (this_arg_obj_p) == LIT_MAGIC_STRING_FUNCTION_UL)
+    {
+      ecma_value_t get_len_value = ecma_op_object_get (this_arg_obj_p, magic_string_length_p);
+      JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (get_len_value));
+      JERRY_ASSERT (ecma_is_value_number (get_len_value));
+
+      /* 15.a */
+      length = ecma_get_number_from_value (get_len_value) - ((ecma_number_t) (args_length - 1));
+      ecma_free_value (get_len_value);
+
+      /* 15.b */
+      if (ecma_number_is_negative (length))
+      {
+        length = ECMA_NUMBER_ZERO;
+      }
+    }
+
+    /* 17. */
+    ecma_value_t completion = ecma_builtin_helper_def_prop (function_p,
+                                                            magic_string_length_p,
+                                                            ecma_make_number_value (length),
+                                                            false, /* Writable */
+                                                            false, /* Enumerable */
+                                                            false, /* Configurable */
+                                                            false); /* Failure handling */
+
+    JERRY_ASSERT (ecma_is_value_boolean (completion));
+
+    ecma_deref_ecma_string (magic_string_length_p);
+
+    /* 19-21. */
+    ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER);
+
+    ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
+    {
+      prop_desc.is_enumerable_defined = true;
+      prop_desc.is_enumerable = false;
+
+      prop_desc.is_configurable_defined = true;
+      prop_desc.is_configurable = false;
+
+      prop_desc.is_get_defined = true;
+      prop_desc.get_p = thrower_p;
+
+      prop_desc.is_set_defined = true;
+      prop_desc.set_p = thrower_p;
+    }
+
+    ecma_string_t *magic_string_caller_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLER);
+    completion = ecma_op_object_define_own_property (function_p,
+                                                     magic_string_caller_p,
+                                                     &prop_desc,
+                                                     false);
+
+    JERRY_ASSERT (ecma_is_value_boolean (completion));
+
+    ecma_deref_ecma_string (magic_string_caller_p);
+
+    ecma_string_t *magic_string_arguments_p = ecma_get_magic_string (LIT_MAGIC_STRING_ARGUMENTS);
+    completion = ecma_op_object_define_own_property (function_p,
+                                                     magic_string_arguments_p,
+                                                     &prop_desc,
+                                                     false);
+
+    JERRY_ASSERT (ecma_is_value_boolean (completion));
+
+    ecma_deref_ecma_string (magic_string_arguments_p);
+    ecma_deref_object (thrower_p);
+
+    /* 22. */
+    ret_value = ecma_make_object_value (function_p);
+  }
+
+  return ret_value;
+} /* ecma_builtin_function_prototype_object_bind */
+
+/**
+ * Handle calling [[Call]] of built-in Function.prototype object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_function_prototype_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                               ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+} /* ecma_builtin_function_prototype_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in Function.prototype object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_function_prototype_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                                    ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("'Function.prototype' is not a constructor."));
+} /* ecma_builtin_function_prototype_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.inc.h
new file mode 100644 (file)
index 0000000..9d38567
--- /dev/null
@@ -0,0 +1,45 @@
+/* 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.
+ */
+
+/*
+ * Function.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.3.4.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_FUNCTION,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* Number properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.3.4 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              0,
+              ECMA_PROPERTY_FIXED)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_function_prototype_object_to_string, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_APPLY, ecma_builtin_function_prototype_object_apply, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_CALL, ecma_builtin_function_prototype_object_call, NON_FIXED, 1)
+ROUTINE (LIT_MAGIC_STRING_BIND, ecma_builtin_function_prototype_object_bind, NON_FIXED, 1)
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function.c
new file mode 100644 (file)
index 0000000..e87a8a1
--- /dev/null
@@ -0,0 +1,213 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-eval.h"
+#include "ecma-gc.h"
+#include "ecma-function-object.h"
+#include "ecma-lex-env.h"
+#include "ecma-try-catch-macro.h"
+#include "lit-magic-strings.h"
+#include "js-parser.h"
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-function.inc.h"
+#define BUILTIN_UNDERSCORED_ID function
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup function ECMA Function object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in Function object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_function_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                     ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_builtin_function_dispatch_construct (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_function_dispatch_call */
+
+/**
+ * Helper method to count and convert the arguments for the Function constructor call.
+ *
+ * Performs the operation described in ECMA 262 v5.1 15.3.2.1 steps 5.a-d
+ *
+ *
+ * @return ecma value - concatenated arguments as a string.
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_function_helper_get_function_expression (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                                      ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ecma_string_t *left_parenthesis_str_p, *right_parenthesis_str_p;
+  ecma_string_t *left_brace_str_p, *right_brace_str_p;
+  ecma_string_t *comma_str_p;
+  ecma_string_t *function_kw_str_p, *empty_str_p;
+  ecma_string_t *expr_str_p, *concated_str_p;
+
+  left_parenthesis_str_p = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING_LEFT_PARENTHESIS_CHAR);
+  right_parenthesis_str_p = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING_RIGHT_PARENTHESIS_CHAR);
+
+  left_brace_str_p = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING_LEFT_BRACE_CHAR);
+  right_brace_str_p = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING_RIGHT_BRACE_CHAR);
+
+  comma_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_COMMA_CHAR);
+
+  function_kw_str_p = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING_FUNCTION);
+  empty_str_p = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING__EMPTY);
+
+  /* First, we only process the function arguments skipping the function body */
+  ecma_length_t number_of_function_args = (arguments_list_len == 0 ? 0 : arguments_list_len - 1);
+
+  expr_str_p = ecma_concat_ecma_strings (left_parenthesis_str_p, function_kw_str_p);
+
+  concated_str_p = ecma_concat_ecma_strings (expr_str_p, left_parenthesis_str_p);
+  ecma_deref_ecma_string (expr_str_p);
+  expr_str_p = concated_str_p;
+
+  for (ecma_length_t idx = 0;
+       idx < number_of_function_args && ecma_is_value_empty (ret_value);
+       idx++)
+  {
+    ECMA_TRY_CATCH (str_arg_value,
+                    ecma_op_to_string (arguments_list_p[idx]),
+                    ret_value);
+
+    ecma_string_t *str_p = ecma_get_string_from_value (str_arg_value);
+
+    concated_str_p = ecma_concat_ecma_strings (expr_str_p, str_p);
+    ecma_deref_ecma_string (expr_str_p);
+    expr_str_p = concated_str_p;
+
+    if (idx < number_of_function_args - 1)
+    {
+      concated_str_p = ecma_concat_ecma_strings (expr_str_p, comma_str_p);
+      ecma_deref_ecma_string (expr_str_p);
+      expr_str_p = concated_str_p;
+    }
+
+    ECMA_FINALIZE (str_arg_value);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    concated_str_p = ecma_concat_ecma_strings (expr_str_p, right_parenthesis_str_p);
+    ecma_deref_ecma_string (expr_str_p);
+    expr_str_p = concated_str_p;
+
+    concated_str_p = ecma_concat_ecma_strings (expr_str_p, left_brace_str_p);
+    ecma_deref_ecma_string (expr_str_p);
+    expr_str_p = concated_str_p;
+
+    if (arguments_list_len != 0)
+    {
+      ECMA_TRY_CATCH (str_arg_value,
+                      ecma_op_to_string (arguments_list_p[arguments_list_len - 1]),
+                      ret_value);
+
+      ecma_string_t *body_str_p = ecma_get_string_from_value (str_arg_value);
+
+      concated_str_p = ecma_concat_ecma_strings (expr_str_p, body_str_p);
+      ecma_deref_ecma_string (expr_str_p);
+      expr_str_p = concated_str_p;
+
+      ECMA_FINALIZE (str_arg_value);
+    }
+
+    concated_str_p = ecma_concat_ecma_strings (expr_str_p, right_brace_str_p);
+    ecma_deref_ecma_string (expr_str_p);
+    expr_str_p = concated_str_p;
+
+    concated_str_p = ecma_concat_ecma_strings (expr_str_p, right_parenthesis_str_p);
+    ecma_deref_ecma_string (expr_str_p);
+    expr_str_p = concated_str_p;
+  }
+
+  ecma_deref_ecma_string (left_parenthesis_str_p);
+  ecma_deref_ecma_string (right_parenthesis_str_p);
+  ecma_deref_ecma_string (left_brace_str_p);
+  ecma_deref_ecma_string (right_brace_str_p);
+  ecma_deref_ecma_string (comma_str_p);
+  ecma_deref_ecma_string (function_kw_str_p);
+  ecma_deref_ecma_string (empty_str_p);
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = ecma_make_string_value (expr_str_p);
+  }
+  else
+  {
+    ecma_deref_ecma_string (expr_str_p);
+  }
+
+  return ret_value;
+} /* ecma_builtin_function_helper_get_function_expression */
+
+/**
+ * Handle calling [[Construct]] of built-in Function object
+ *
+ * See also:
+ *          ECMA-262 v5, 15.3.
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_function_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                          ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (arguments_value,
+                  ecma_builtin_function_helper_get_function_expression (arguments_list_p,
+                                                                        arguments_list_len),
+                  ret_value);
+
+  ecma_string_t *function_expression_p = ecma_get_string_from_value (arguments_value);
+
+  ret_value = ecma_op_eval (function_expression_p, false, false);
+
+  ECMA_FINALIZE (arguments_value);
+
+  return ret_value;
+} /* ecma_builtin_function_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-function.inc.h
new file mode 100644 (file)
index 0000000..c6a4a7b
--- /dev/null
@@ -0,0 +1,38 @@
+/* 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.
+ */
+
+/*
+ * Function built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.3.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+/* Number properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.3.3.2 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-global.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-global.c
new file mode 100644 (file)
index 0000000..08aa144
--- /dev/null
@@ -0,0 +1,1351 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-eval.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+#include "lit-char-helpers.h"
+#include "lit-magic-strings.h"
+#include "lit-strings.h"
+#include "vm.h"
+#include "jrt-libc-includes.h"
+#include "jrt-bit-fields.h"
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-global.inc.h"
+#define BUILTIN_UNDERSCORED_ID global
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup global ECMA Global object built-in
+ * @{
+ */
+
+/**
+ * The Global object's 'eval' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.1.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_eval (ecma_value_t this_arg, /**< this argument */
+                                 ecma_value_t x) /**< routine's first argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  bool is_direct_eval = vm_is_direct_eval_form_call ();
+
+  /* See also: ECMA-262 v5, 10.1.1 */
+  bool is_called_from_strict_mode_code;
+  if (is_direct_eval)
+  {
+    is_called_from_strict_mode_code = vm_is_strict_mode ();
+  }
+  else
+  {
+    is_called_from_strict_mode_code = false;
+  }
+
+  if (!ecma_is_value_string (x))
+  {
+    /* step 1 */
+    ret_value = ecma_copy_value (x);
+  }
+  else
+  {
+    /* steps 2 to 8 */
+    ret_value = ecma_op_eval (ecma_get_string_from_value (x),
+                              is_direct_eval,
+                              is_called_from_strict_mode_code);
+  }
+
+  return ret_value;
+} /* ecma_builtin_global_object_eval */
+
+/**
+ * The Global object's 'parseInt' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.1.2.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_parse_int (ecma_value_t this_arg, /**< this argument */
+                                      ecma_value_t string, /**< routine's first argument */
+                                      ecma_value_t radix) /**< routine's second argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (string_var, ecma_op_to_string (string), ret_value);
+
+  ecma_string_t *number_str_p = ecma_get_string_from_value (string_var);
+  ECMA_STRING_TO_UTF8_STRING (number_str_p, string_buff, string_buff_size);
+
+  if (string_buff_size > 0)
+  {
+    const lit_utf8_byte_t *string_curr_p = (lit_utf8_byte_t *) string_buff;
+    const lit_utf8_byte_t *string_end_p = string_buff + string_buff_size;
+
+    /* 2. Remove leading whitespace. */
+
+    const lit_utf8_byte_t *start_p = string_end_p;
+    const lit_utf8_byte_t *end_p = start_p;
+
+    while (string_curr_p < string_end_p)
+    {
+      ecma_char_t current_char = lit_utf8_read_next (&string_curr_p);
+
+      if (!lit_char_is_white_space (current_char)
+          && !lit_char_is_line_terminator (current_char))
+      {
+        lit_utf8_decr (&string_curr_p);
+        start_p = string_curr_p;
+        break;
+      }
+    }
+
+    if (string_curr_p < string_end_p)
+    {
+      /* 3. */
+      int sign = 1;
+
+      /* 4. */
+      ecma_char_t current = lit_utf8_read_next (&string_curr_p);
+      if (current == LIT_CHAR_MINUS)
+      {
+        sign = -1;
+      }
+
+      /* 5. */
+      if (current == LIT_CHAR_MINUS || current == LIT_CHAR_PLUS)
+      {
+        start_p = string_curr_p;
+        if (string_curr_p < string_end_p)
+        {
+          current = lit_utf8_read_next (&string_curr_p);
+        }
+      }
+
+      /* 6. */
+      ECMA_OP_TO_NUMBER_TRY_CATCH (radix_num, radix, ret_value);
+      int32_t rad = ecma_number_to_int32 (radix_num);
+
+      /* 7.*/
+      bool strip_prefix = true;
+
+      /* 8. */
+      if (rad != 0)
+      {
+        /* 8.a */
+        if (rad < 2 || rad > 36)
+        {
+          ret_value = ecma_make_nan_value ();
+        }
+        /* 8.b */
+        else if (rad != 16)
+        {
+          strip_prefix = false;
+        }
+      }
+      /* 9. */
+      else
+      {
+        rad = 10;
+      }
+
+      if (ecma_is_value_empty (ret_value))
+      {
+        /* 10. */
+        if (strip_prefix)
+        {
+          if (end_p - start_p >= 2 && current == LIT_CHAR_0)
+          {
+            ecma_char_t next = *string_curr_p;
+            if (next == LIT_CHAR_LOWERCASE_X || next == LIT_CHAR_UPPERCASE_X)
+            {
+              /* Skip the 'x' or 'X' characters. */
+              start_p = ++string_curr_p;
+              rad = 16;
+            }
+          }
+        }
+
+        /* 11. Check if characters are in [0, Radix - 1]. We also convert them to number values in the process. */
+        string_curr_p = start_p;
+        while (string_curr_p < string_end_p)
+        {
+          ecma_char_t current_char = *string_curr_p++;
+          int32_t current_number;
+
+          if ((current_char >= LIT_CHAR_LOWERCASE_A && current_char <= LIT_CHAR_LOWERCASE_Z))
+          {
+            current_number = current_char - LIT_CHAR_LOWERCASE_A + 10;
+          }
+          else if ((current_char >= LIT_CHAR_UPPERCASE_A && current_char <= LIT_CHAR_UPPERCASE_Z))
+          {
+            current_number = current_char - LIT_CHAR_UPPERCASE_A + 10;
+          }
+          else if (lit_char_is_decimal_digit (current_char))
+          {
+            current_number = current_char - LIT_CHAR_0;
+          }
+          else
+          {
+            /* Not a valid number char, set value to radix so it fails to pass as a valid character. */
+            current_number = rad;
+          }
+
+          if (!(current_number < rad))
+          {
+            end_p = --string_curr_p;
+            break;
+          }
+        }
+
+        /* 12. */
+        if (end_p == start_p)
+        {
+          ret_value = ecma_make_nan_value ();
+        }
+      }
+
+      if (ecma_is_value_empty (ret_value))
+      {
+        ecma_number_t value = ECMA_NUMBER_ZERO;
+        ecma_number_t multiplier = 1.0f;
+
+        /* 13. and 14. */
+        string_curr_p = end_p;
+
+        while (string_curr_p > start_p)
+        {
+          ecma_char_t current_char = *(--string_curr_p);
+          ecma_number_t current_number = ECMA_NUMBER_MINUS_ONE;
+
+          if ((current_char >= LIT_CHAR_LOWERCASE_A && current_char <= LIT_CHAR_LOWERCASE_Z))
+          {
+            current_number =  (ecma_number_t) current_char - LIT_CHAR_LOWERCASE_A + 10;
+          }
+          else if ((current_char >= LIT_CHAR_UPPERCASE_A && current_char <= LIT_CHAR_UPPERCASE_Z))
+          {
+            current_number =  (ecma_number_t) current_char - LIT_CHAR_UPPERCASE_A + 10;
+          }
+          else if (lit_char_is_decimal_digit (current_char))
+          {
+            current_number =  (ecma_number_t) current_char - LIT_CHAR_0;
+          }
+          else
+          {
+            JERRY_UNREACHABLE ();
+          }
+
+          value += current_number * multiplier;
+          multiplier *= (ecma_number_t) rad;
+        }
+
+        /* 15. */
+        if (sign < 0)
+        {
+          value *= (ecma_number_t) sign;
+        }
+
+        ret_value = ecma_make_number_value (value);
+      }
+
+      ECMA_OP_TO_NUMBER_FINALIZE (radix_num);
+    }
+    else
+    {
+      ret_value = ecma_make_nan_value ();
+    }
+
+  }
+  else
+  {
+    ret_value = ecma_make_nan_value ();
+  }
+
+  ECMA_FINALIZE_UTF8_STRING (string_buff, string_buff_size);
+  ECMA_FINALIZE (string_var);
+  return ret_value;
+} /* ecma_builtin_global_object_parse_int */
+
+/**
+ * The Global object's 'parseFloat' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.1.2.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_parse_float (ecma_value_t this_arg, /**< this argument */
+                                        ecma_value_t string) /**< routine's first argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (string_var, ecma_op_to_string (string), ret_value);
+
+  ecma_string_t *number_str_p = ecma_get_string_from_value (string_var);
+  ECMA_STRING_TO_UTF8_STRING (number_str_p, string_buff, string_buff_size);
+
+  if (string_buff_size > 0)
+  {
+    const lit_utf8_byte_t *str_curr_p = string_buff;
+    const lit_utf8_byte_t *str_end_p = string_buff + string_buff_size;
+
+    const lit_utf8_byte_t *start_p = str_end_p;
+    const lit_utf8_byte_t *end_p = str_end_p;
+
+    /* 2. Find first non whitespace char and set starting position. */
+    while (str_curr_p < str_end_p)
+    {
+      ecma_char_t current_char = lit_utf8_read_next (&str_curr_p);
+
+      if (!lit_char_is_white_space (current_char)
+          && !lit_char_is_line_terminator (current_char))
+      {
+        lit_utf8_decr (&str_curr_p);
+        start_p = str_curr_p;
+        break;
+      }
+    }
+
+    bool sign = false;
+    ecma_char_t current;
+
+    if (str_curr_p < str_end_p)
+    {
+      /* Check if sign is present. */
+      current = *str_curr_p;
+      if (current == LIT_CHAR_MINUS)
+      {
+        sign = true;
+      }
+
+      if (current == LIT_CHAR_MINUS || current == LIT_CHAR_PLUS)
+      {
+        /* Set starting position to be after the sign character. */
+        start_p = ++str_curr_p;
+      }
+    }
+
+    const lit_utf8_byte_t *infinity_str_p = lit_get_magic_string_utf8 (LIT_MAGIC_STRING_INFINITY_UL);
+    lit_utf8_byte_t *infinity_str_curr_p = (lit_utf8_byte_t *) infinity_str_p;
+    lit_utf8_byte_t *infinity_str_end_p = infinity_str_curr_p + sizeof (*infinity_str_p);
+
+    /* Check if string is equal to "Infinity". */
+    while (str_curr_p < str_end_p
+           && *str_curr_p++ == *infinity_str_curr_p++)
+    {
+      if (infinity_str_curr_p == infinity_str_end_p)
+      {
+        /* String matched Infinity. */
+        ret_value = ecma_make_number_value (ecma_number_make_infinity (sign));
+        break;
+      }
+    }
+
+    /* Reset to starting position. */
+    str_curr_p = start_p;
+
+    if (ecma_is_value_empty (ret_value) && str_curr_p < str_end_p)
+    {
+      current = *str_curr_p;
+
+      bool has_whole_part = false;
+      bool has_fraction_part = false;
+
+      /* Check digits of whole part. */
+      if (lit_char_is_decimal_digit (current))
+      {
+        has_whole_part = true;
+        str_curr_p++;
+
+        while (str_curr_p < str_end_p)
+        {
+          current = *str_curr_p++;
+          if (!lit_char_is_decimal_digit (current))
+          {
+            str_curr_p--;
+            break;
+          }
+        }
+      }
+
+
+      /* Set end position to the end of whole part. */
+      end_p = str_curr_p;
+      if (str_curr_p < str_end_p)
+      {
+        current = *str_curr_p;
+
+        /* Check decimal point. */
+        if (current == LIT_CHAR_DOT)
+        {
+          str_curr_p++;
+
+          if (str_curr_p < str_end_p)
+          {
+            current = *str_curr_p;
+
+            if (lit_char_is_decimal_digit (current))
+            {
+              has_fraction_part = true;
+
+              /* Check digits of fractional part. */
+              while (str_curr_p < str_end_p)
+              {
+                current = *str_curr_p++;
+                if (!lit_char_is_decimal_digit (current))
+                {
+                  str_curr_p--;
+                  break;
+                }
+              }
+
+              /* Set end position to end of fraction part. */
+              end_p = str_curr_p;
+            }
+          }
+        }
+      }
+
+
+      if (str_curr_p < str_end_p)
+      {
+        current = *str_curr_p++;
+      }
+
+      /* Check exponent. */
+      if ((current == LIT_CHAR_LOWERCASE_E || current == LIT_CHAR_UPPERCASE_E)
+          && (has_whole_part || has_fraction_part)
+          && str_curr_p < str_end_p)
+      {
+        current = *str_curr_p++;
+
+        /* Check sign of exponent. */
+        if ((current == LIT_CHAR_PLUS || current == LIT_CHAR_MINUS)
+             && str_curr_p < str_end_p)
+        {
+          current = *str_curr_p++;
+        }
+
+        if (lit_char_is_decimal_digit (current))
+        {
+          /* Check digits of exponent part. */
+          while (str_curr_p < str_end_p)
+          {
+            current = *str_curr_p++;
+            if (!lit_char_is_decimal_digit (current))
+            {
+              str_curr_p--;
+              break;
+            }
+          }
+
+          /* Set end position to end of exponent part. */
+          end_p = str_curr_p;
+        }
+      }
+
+      /* String did not contain a valid number. */
+      if (start_p == end_p)
+      {
+        ret_value = ecma_make_nan_value ();
+      }
+      else
+      {
+        /* 5. */
+        ecma_number_t ret_num = ecma_utf8_string_to_number (start_p,
+                                                            (lit_utf8_size_t) (end_p - start_p));
+
+        if (sign)
+        {
+          ret_num *= ECMA_NUMBER_MINUS_ONE;
+        }
+
+        ret_value = ecma_make_number_value (ret_num);
+      }
+    }
+    /* String ended after sign character, or was empty after removing leading whitespace. */
+    else if (ecma_is_value_empty (ret_value))
+    {
+      ret_value = ecma_make_nan_value ();
+    }
+  }
+  /* String length is zero. */
+  else
+  {
+    ret_value = ecma_make_nan_value ();
+  }
+
+  ECMA_FINALIZE_UTF8_STRING (string_buff, string_buff_size);
+  ECMA_FINALIZE (string_var);
+
+  return ret_value;
+} /* ecma_builtin_global_object_parse_float */
+
+/**
+ * The Global object's 'isNaN' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.1.2.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_is_nan (ecma_value_t this_arg, /**< this argument */
+                                   ecma_value_t arg) /**< routine's first argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value);
+
+  bool is_nan = ecma_number_is_nan (arg_num);
+
+  ret_value = ecma_make_simple_value (is_nan ? ECMA_SIMPLE_VALUE_TRUE
+                                             : ECMA_SIMPLE_VALUE_FALSE);
+
+  ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
+
+  return ret_value;
+} /* ecma_builtin_global_object_is_nan */
+
+/**
+ * The Global object's 'isFinite' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.1.2.5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_is_finite (ecma_value_t this_arg, /**< this argument */
+                                      ecma_value_t arg) /**< routine's first argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value);
+
+  bool is_finite = !(ecma_number_is_nan (arg_num)
+                     || ecma_number_is_infinity (arg_num));
+
+  ret_value = ecma_make_simple_value (is_finite ? ECMA_SIMPLE_VALUE_TRUE
+                                                : ECMA_SIMPLE_VALUE_FALSE);
+
+  ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
+
+  return ret_value;
+} /* ecma_builtin_global_object_is_finite */
+
+/**
+ * Helper function to check whether a character is in a character bitset.
+ *
+ * @return true if the character is in the character bitset.
+ */
+static bool
+ecma_builtin_global_object_character_is_in (uint32_t character, /**< character */
+                                            const uint8_t *bitset) /**< character set */
+{
+  JERRY_ASSERT (character < 128);
+  return (bitset[character >> 3] & (1u << (character & 0x7))) != 0;
+} /* ecma_builtin_global_object_character_is_in */
+
+/*
+ * Unescaped URI characters bitset:
+ *   One bit for each character between 0 - 127.
+ *   Bit is set if the character is in the unescaped URI set.
+ */
+static const uint8_t unescaped_uri_set[16] =
+{
+  0x0, 0x0, 0x0, 0x0, 0xda, 0xff, 0xff, 0xaf,
+  0xff, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x47
+};
+
+/*
+ * Unescaped URI component characters bitset:
+ *   One bit for each character between 0 - 127.
+ *   Bit is set if the character is in the unescaped component URI set.
+ */
+static const uint8_t unescaped_uri_component_set[16] =
+{
+  0x0, 0x0, 0x0, 0x0, 0x82, 0x67, 0xff, 0x3,
+  0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x47
+};
+
+/*
+ * Format is a percent sign followed by two hex digits.
+ */
+#define URI_ENCODED_BYTE_SIZE (3)
+
+/*
+ * These two types shows whether the byte is present in
+ * the original stream or decoded from a %xx sequence.
+ */
+#define URI_DECODE_ORIGINAL_BYTE 0
+#define URI_DECODE_DECODED_BYTE 1
+
+/**
+ * Helper function to decode URI.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri, /**< uri argument */
+                                              const uint8_t *reserved_uri_bitset) /**< reserved characters bitset */
+{
+  JERRY_UNUSED (uri);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (string,
+                  ecma_op_to_string (uri),
+                  ret_value);
+
+  JERRY_ASSERT (ecma_is_value_string (string));
+
+  ecma_string_t *input_string_p = ecma_get_string_from_value (string);
+  lit_utf8_size_t input_size = ecma_string_get_size (input_string_p);
+
+  JMEM_DEFINE_LOCAL_ARRAY (input_start_p,
+                           input_size + 1,
+                           lit_utf8_byte_t);
+
+  ecma_string_to_utf8_bytes (input_string_p, input_start_p, input_size);
+
+  input_start_p[input_size] = LIT_BYTE_NULL;
+
+  lit_utf8_byte_t *input_char_p = input_start_p;
+  lit_utf8_byte_t *input_end_p = input_start_p + input_size;
+  lit_utf8_size_t output_size = 0;
+
+  /*
+   * The URI decoding has two major phases: first we validate the input,
+   * and compute the length of the output, then we decode the input.
+   */
+
+  while (input_char_p < input_end_p)
+  {
+    /*
+     * We expect that the input is a valid UTF-8 sequence,
+     * so characters >= 0x80 can be let through.
+     */
+
+    if (*input_char_p != '%')
+    {
+      output_size++;
+      input_char_p++;
+      continue;
+    }
+
+    ecma_char_t decoded_byte;
+
+    if (!lit_read_code_unit_from_hex (input_char_p + 1, 2, &decoded_byte))
+    {
+      ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid hexadecimal value."));
+      break;
+    }
+
+    input_char_p += URI_ENCODED_BYTE_SIZE;
+
+    if (decoded_byte <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+    {
+      /*
+       * We don't decode those bytes, which are part of reserved_uri_bitset
+       * but not part of unescaped_uri_component_set.
+       */
+      if (ecma_builtin_global_object_character_is_in (decoded_byte, reserved_uri_bitset)
+          && !ecma_builtin_global_object_character_is_in (decoded_byte, unescaped_uri_component_set))
+      {
+        output_size += URI_ENCODED_BYTE_SIZE;
+      }
+      else
+      {
+        output_size++;
+      }
+    }
+    else if ((decoded_byte & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER)
+    {
+      output_size += 3;
+    }
+    else
+    {
+      output_size++;
+    }
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    JMEM_DEFINE_LOCAL_ARRAY (output_start_p,
+                            output_size,
+                            lit_utf8_byte_t);
+
+    input_char_p = input_start_p;
+    lit_utf8_byte_t *output_char_p = output_start_p;
+
+    while (input_char_p < input_end_p)
+    {
+      /* Input decode. */
+      if (*input_char_p != '%')
+      {
+        *output_char_p = *input_char_p;
+        output_char_p++;
+        input_char_p++;
+        continue;
+      }
+
+      ecma_char_t decoded_byte;
+
+      if (!lit_read_code_unit_from_hex (input_char_p + 1, 2, &decoded_byte))
+      {
+        ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid hexadecimal value."));
+        break;
+      }
+
+      input_char_p += URI_ENCODED_BYTE_SIZE;
+
+      if (decoded_byte <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+      {
+        if (ecma_builtin_global_object_character_is_in (decoded_byte, reserved_uri_bitset)
+            && !ecma_builtin_global_object_character_is_in (decoded_byte, unescaped_uri_component_set))
+        {
+          *output_char_p = '%';
+          output_char_p++;
+          input_char_p -= 2;
+        }
+        else
+        {
+          *output_char_p++ = (lit_utf8_byte_t) decoded_byte;
+        }
+      }
+      else
+      {
+        uint32_t bytes_count;
+
+        if ((decoded_byte & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER)
+        {
+          bytes_count = 2;
+        }
+        else if ((decoded_byte & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER)
+        {
+          bytes_count = 3;
+        }
+        else if ((decoded_byte & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER)
+        {
+          bytes_count = 4;
+        }
+        else
+        {
+          ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 character."));
+          break;
+        }
+
+        lit_utf8_byte_t octets[LIT_UTF8_MAX_BYTES_IN_CODE_POINT];
+        octets[0] = (lit_utf8_byte_t) decoded_byte;
+        bool is_valid = true;
+
+        for (uint32_t i = 1; i < bytes_count; i++)
+        {
+          if (input_char_p >= input_end_p || *input_char_p != '%')
+          {
+            is_valid = false;
+            break;
+          }
+          else
+          {
+            ecma_char_t chr;
+
+            if (!lit_read_code_unit_from_hex (input_char_p + 1, 2, &chr)
+                || ((chr & LIT_UTF8_EXTRA_BYTE_MASK) != LIT_UTF8_EXTRA_BYTE_MARKER))
+            {
+              is_valid = false;
+              break;
+            }
+
+            octets[i] = (lit_utf8_byte_t) chr;
+            input_char_p += URI_ENCODED_BYTE_SIZE;
+          }
+        }
+
+        if (!is_valid
+            || !lit_is_valid_utf8_string (octets, bytes_count))
+        {
+          ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 string."));
+          break;
+        }
+
+        lit_code_point_t cp;
+        lit_read_code_point_from_utf8 (octets, bytes_count, &cp);
+
+        if (lit_is_code_point_utf16_high_surrogate (cp)
+            || lit_is_code_point_utf16_low_surrogate (cp))
+        {
+          ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 codepoint."));
+          break;
+        }
+
+        output_char_p += lit_code_point_to_cesu8 (cp, output_char_p);
+      }
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      JERRY_ASSERT (output_start_p + output_size == output_char_p);
+
+      if (lit_is_valid_cesu8_string (output_start_p, output_size))
+      {
+        ecma_string_t *output_string_p = ecma_new_ecma_string_from_utf8 (output_start_p, output_size);
+        ret_value = ecma_make_string_value (output_string_p);
+      }
+      else
+      {
+        ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid CESU8 string."));
+      }
+    }
+
+    JMEM_FINALIZE_LOCAL_ARRAY (output_start_p);
+  }
+
+  JMEM_FINALIZE_LOCAL_ARRAY (input_start_p);
+
+  ECMA_FINALIZE (string);
+  return ret_value;
+} /* ecma_builtin_global_object_decode_uri_helper */
+
+/**
+ * The Global object's 'decodeURI' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.1.3.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_decode_uri (ecma_value_t this_arg, /**< this argument */
+                                       ecma_value_t encoded_uri) /**< routine's first argument */
+{
+  JERRY_UNUSED (this_arg);
+  return ecma_builtin_global_object_decode_uri_helper (encoded_uri, unescaped_uri_set);
+} /* ecma_builtin_global_object_decode_uri */
+
+/**
+ * The Global object's 'decodeURIComponent' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.1.3.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_decode_uri_component (ecma_value_t this_arg, /**< this argument */
+                                                 ecma_value_t encoded_uri_component) /**< routine's
+                                                                                      *   first argument */
+{
+  JERRY_UNUSED (this_arg);
+  return ecma_builtin_global_object_decode_uri_helper (encoded_uri_component, unescaped_uri_component_set);
+} /* ecma_builtin_global_object_decode_uri_component */
+
+/**
+ * Helper function to encode byte as hexadecimal values.
+ */
+static void
+ecma_builtin_global_object_byte_to_hex (lit_utf8_byte_t *dest_p, /**< destination pointer */
+                                        uint32_t byte) /**< value */
+{
+  JERRY_ASSERT (byte < 256);
+
+  dest_p[0] = LIT_CHAR_PERCENT;
+  ecma_char_t hex_digit = (ecma_char_t) (byte >> 4);
+  dest_p[1] = (lit_utf8_byte_t) ((hex_digit > 9) ? (hex_digit + ('A' - 10)) : (hex_digit + '0'));
+  hex_digit = (lit_utf8_byte_t) (byte & 0xf);
+  dest_p[2] = (lit_utf8_byte_t) ((hex_digit > 9) ? (hex_digit + ('A' - 10)) : (hex_digit + '0'));
+} /* ecma_builtin_global_object_byte_to_hex */
+
+/**
+ * Helper function to encode URI.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_encode_uri_helper (ecma_value_t uri, /**< uri argument */
+                                              const uint8_t *unescaped_uri_bitset_p) /**< unescaped bitset */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (string,
+                  ecma_op_to_string (uri),
+                  ret_value);
+
+  JERRY_ASSERT (ecma_is_value_string (string));
+
+  ecma_string_t *input_string_p = ecma_get_string_from_value (string);
+  lit_utf8_size_t input_size = ecma_string_get_size (input_string_p);
+
+  JMEM_DEFINE_LOCAL_ARRAY (input_start_p,
+                           input_size,
+                           lit_utf8_byte_t);
+
+  ecma_string_to_utf8_bytes (input_string_p, input_start_p, input_size);
+
+  /*
+   * The URI encoding has two major phases: first we validate the input,
+   * and compute the length of the output, then we encode the input.
+   */
+
+  lit_utf8_byte_t *input_char_p = input_start_p;
+  const lit_utf8_byte_t *input_end_p = input_start_p + input_size;
+  lit_utf8_size_t output_length = 0;
+  lit_code_point_t cp;
+  ecma_char_t ch;
+  lit_utf8_byte_t octets[LIT_UTF8_MAX_BYTES_IN_CODE_POINT];
+  memset (octets, LIT_BYTE_NULL, LIT_UTF8_MAX_BYTES_IN_CODE_POINT);
+
+  while (input_char_p < input_end_p)
+  {
+    /* Input validation, we need to reject stray surrogates. */
+    input_char_p += lit_read_code_unit_from_utf8 (input_char_p, &ch);
+
+    if (lit_is_code_point_utf16_low_surrogate (ch))
+    {
+      ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Unicode surrogate pair missing."));
+      break;
+    }
+
+    cp = ch;
+
+    if (lit_is_code_point_utf16_high_surrogate (ch))
+    {
+      if (input_char_p == input_end_p)
+      {
+        ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Unicode surrogate pair missing."));
+        break;
+      }
+
+      ecma_char_t next_ch;
+      lit_utf8_size_t read_size = lit_read_code_unit_from_utf8 (input_char_p, &next_ch);
+
+      if (lit_is_code_point_utf16_low_surrogate (next_ch))
+      {
+        cp = lit_convert_surrogate_pair_to_code_point (ch, next_ch);
+        input_char_p += read_size;
+      }
+      else
+      {
+        ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Unicode surrogate pair missing."));
+        break;
+      }
+    }
+
+    lit_utf8_size_t utf_size = lit_code_point_to_utf8 (cp, octets);
+
+    if (utf_size == 1)
+    {
+      if (ecma_builtin_global_object_character_is_in (octets[0], unescaped_uri_bitset_p))
+      {
+        output_length++;
+      }
+      else
+      {
+        output_length += URI_ENCODED_BYTE_SIZE;
+      }
+    }
+    else
+    {
+      output_length += utf_size * URI_ENCODED_BYTE_SIZE;
+    }
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    JMEM_DEFINE_LOCAL_ARRAY (output_start_p,
+                             output_length,
+                             lit_utf8_byte_t);
+
+    lit_utf8_byte_t *output_char_p = output_start_p;
+    input_char_p = input_start_p;
+
+    while (input_char_p < input_end_p)
+    {
+      /* Input decode. */
+      input_char_p += lit_read_code_unit_from_utf8 (input_char_p, &ch);
+      cp = ch;
+
+      if (lit_is_code_point_utf16_high_surrogate (ch))
+      {
+        ecma_char_t next_ch;
+        lit_utf8_size_t read_size = lit_read_code_unit_from_utf8 (input_char_p, &next_ch);
+
+        if (lit_is_code_point_utf16_low_surrogate (next_ch))
+        {
+          cp = lit_convert_surrogate_pair_to_code_point (ch, next_ch);
+          input_char_p += read_size;
+        }
+      }
+
+      lit_utf8_size_t utf_size = lit_code_point_to_utf8 (cp, octets);
+
+      if (utf_size == 1)
+      {
+        if (ecma_builtin_global_object_character_is_in (octets[0], unescaped_uri_bitset_p))
+        {
+          *output_char_p++ = octets[0];
+        }
+        else
+        {
+          ecma_builtin_global_object_byte_to_hex (output_char_p, octets[0]);
+          output_char_p += URI_ENCODED_BYTE_SIZE;
+        }
+      }
+      else
+      {
+        for (uint32_t i = 0; i < utf_size; i++)
+        {
+          ecma_builtin_global_object_byte_to_hex (output_char_p, octets[i]);
+          output_char_p += URI_ENCODED_BYTE_SIZE;
+        }
+      }
+    }
+
+    JERRY_ASSERT (output_start_p + output_length == output_char_p);
+
+    ecma_string_t *output_string_p = ecma_new_ecma_string_from_utf8 (output_start_p, output_length);
+
+    ret_value = ecma_make_string_value (output_string_p);
+
+    JMEM_FINALIZE_LOCAL_ARRAY (output_start_p);
+  }
+
+  JMEM_FINALIZE_LOCAL_ARRAY (input_start_p);
+
+  ECMA_FINALIZE (string);
+  return ret_value;
+} /* ecma_builtin_global_object_encode_uri_helper */
+
+/**
+ * The Global object's 'encodeURI' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.1.3.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_encode_uri (ecma_value_t this_arg, /**< this argument */
+                                       ecma_value_t uri) /**< routine's first argument */
+{
+  JERRY_UNUSED (this_arg);
+  return ecma_builtin_global_object_encode_uri_helper (uri, unescaped_uri_set);
+} /* ecma_builtin_global_object_encode_uri */
+
+/**
+ * The Global object's 'encodeURIComponent' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.1.3.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_encode_uri_component (ecma_value_t this_arg, /**< this argument */
+                                                 ecma_value_t uri_component) /**< routine's first argument */
+{
+  JERRY_UNUSED (this_arg);
+  return ecma_builtin_global_object_encode_uri_helper (uri_component, unescaped_uri_component_set);
+} /* ecma_builtin_global_object_encode_uri_component */
+
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+
+/*
+ * Maximum value of a byte.
+ */
+#define ECMA_ESCAPE_MAXIMUM_BYTE_VALUE (255)
+
+/*
+ * Format is a percent sign followed by lowercase u and four hex digits.
+ */
+#define ECMA_ESCAPE_ENCODED_UNICODE_CHARACTER_SIZE (6)
+
+/*
+ * Escape characters bitset:
+ *   One bit for each character between 0 - 127.
+ *   Bit is set if the character does not need to be converted to %xx form.
+ *   These characters are: a-z A-Z 0-9 @ * _ + - . /
+ */
+static const uint8_t ecma_escape_set[16] =
+{
+  0x0, 0x0, 0x0, 0x0, 0x0, 0xec, 0xff, 0x3,
+  0xff, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x7
+};
+
+/**
+ * The Global object's 'escape' routine
+ *
+ * See also:
+ *          ECMA-262 v5, B.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_escape (ecma_value_t this_arg, /**< this argument */
+                                   ecma_value_t arg) /**< routine's first argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (string,
+                  ecma_op_to_string (arg),
+                  ret_value);
+
+  ecma_string_t *input_string_p = ecma_get_string_from_value (string);
+  lit_utf8_size_t input_size = ecma_string_get_size (input_string_p);
+
+  JMEM_DEFINE_LOCAL_ARRAY (input_start_p,
+                           input_size,
+                           lit_utf8_byte_t);
+
+  ecma_string_to_utf8_bytes (input_string_p, input_start_p, input_size);
+
+  /*
+   * The escape routine has two major phases: first we compute
+   * the length of the output, then we encode the input.
+   */
+  const lit_utf8_byte_t *input_curr_p = input_start_p;
+  const lit_utf8_byte_t *input_end_p = input_start_p + input_size;
+  lit_utf8_size_t output_length = 0;
+
+  while (input_curr_p < input_end_p)
+  {
+    ecma_char_t chr = lit_utf8_read_next (&input_curr_p);
+
+    if (chr <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+    {
+      if (ecma_builtin_global_object_character_is_in ((uint32_t) chr, ecma_escape_set))
+      {
+        output_length++;
+      }
+      else
+      {
+        output_length += URI_ENCODED_BYTE_SIZE;
+      }
+    }
+    else if (chr > ECMA_ESCAPE_MAXIMUM_BYTE_VALUE)
+    {
+      output_length += ECMA_ESCAPE_ENCODED_UNICODE_CHARACTER_SIZE;
+    }
+    else
+    {
+      output_length += URI_ENCODED_BYTE_SIZE;
+    }
+  }
+
+  JMEM_DEFINE_LOCAL_ARRAY (output_start_p,
+                           output_length,
+                           lit_utf8_byte_t);
+
+  lit_utf8_byte_t *output_char_p = output_start_p;
+
+  input_curr_p = input_start_p;
+
+  while (input_curr_p < input_end_p)
+  {
+    ecma_char_t chr = lit_utf8_read_next (&input_curr_p);
+
+    if (chr <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+    {
+      if (ecma_builtin_global_object_character_is_in ((uint32_t) chr, ecma_escape_set))
+      {
+        *output_char_p = (lit_utf8_byte_t) chr;
+        output_char_p++;
+      }
+      else
+      {
+        ecma_builtin_global_object_byte_to_hex (output_char_p, (lit_utf8_byte_t) chr);
+        output_char_p += URI_ENCODED_BYTE_SIZE;
+      }
+    }
+    else if (chr > ECMA_ESCAPE_MAXIMUM_BYTE_VALUE)
+    {
+      /*
+       * Although ecma_builtin_global_object_byte_to_hex inserts a percent (%) sign
+       * the follow-up changes overwrites it. We call this function twice to
+       * produce four hexadecimal characters (%uxxxx format).
+       */
+      ecma_builtin_global_object_byte_to_hex (output_char_p + 3, (lit_utf8_byte_t) (chr & 0xff));
+      ecma_builtin_global_object_byte_to_hex (output_char_p + 1, (lit_utf8_byte_t) (chr >> JERRY_BITSINBYTE));
+      output_char_p[0] = LIT_CHAR_PERCENT;
+      output_char_p[1] = LIT_CHAR_LOWERCASE_U;
+      output_char_p += ECMA_ESCAPE_ENCODED_UNICODE_CHARACTER_SIZE;
+    }
+    else
+    {
+      ecma_builtin_global_object_byte_to_hex (output_char_p, (lit_utf8_byte_t) chr);
+      output_char_p += URI_ENCODED_BYTE_SIZE;
+    }
+  }
+
+  JERRY_ASSERT (output_start_p + output_length == output_char_p);
+
+  ecma_string_t *output_string_p = ecma_new_ecma_string_from_utf8 (output_start_p, output_length);
+
+  ret_value = ecma_make_string_value (output_string_p);
+
+  JMEM_FINALIZE_LOCAL_ARRAY (output_start_p);
+
+  JMEM_FINALIZE_LOCAL_ARRAY (input_start_p);
+
+  ECMA_FINALIZE (string);
+  return ret_value;
+} /* ecma_builtin_global_object_escape */
+
+/**
+ * The Global object's 'unescape' routine
+ *
+ * See also:
+ *          ECMA-262 v5, B.2.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_global_object_unescape (ecma_value_t this_arg, /**< this argument */
+                                     ecma_value_t arg) /**< routine's first argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (string, ecma_op_to_string (arg), ret_value);
+  ecma_string_t *input_string_p = ecma_get_string_from_value (string);
+  /* 2. */
+  lit_utf8_size_t input_size = ecma_string_get_size (input_string_p);
+
+  /* 3. */
+  JMEM_DEFINE_LOCAL_ARRAY (input_start_p, input_size, lit_utf8_byte_t);
+  ecma_string_to_utf8_bytes (input_string_p, input_start_p, input_size);
+
+  const lit_utf8_byte_t *input_curr_p = input_start_p;
+  const lit_utf8_byte_t *input_end_p = input_start_p + input_size;
+  /* 4. */
+  /* The length of input string is always greater than output string
+   * so we re-use the input string buffer.
+   * The %xx is three byte long, and the maximum encoded value is 0xff,
+   * which maximum encoded length is two byte. Similar to this, the maximum
+   * encoded length of %uxxxx is four byte. */
+  lit_utf8_byte_t *output_char_p = input_start_p;
+
+  /* The state of parsing that tells us where we are in an escape pattern.
+   * 0    we are outside of pattern,
+   * 1    found '%', start of pattern,
+   * 2    found first hex digit of '%xy' pattern
+   * 3    found valid '%xy' pattern
+   * 4    found 'u', start of '%uwxyz' pattern
+   * 5-7  found hex digits of '%uwxyz' pattern
+   * 8    found valid '%uwxyz' pattern
+   */
+  uint8_t status = 0;
+  ecma_char_t hex_digits = 0;
+  /* 5. */
+  while (input_curr_p < input_end_p)
+  {
+    /* 6. */
+    ecma_char_t chr = lit_utf8_read_next (&input_curr_p);
+
+    /* 7-8. */
+    if (status == 0 && chr == LIT_CHAR_PERCENT)
+    {
+      /* Found '%' char, start of escape sequence. */
+      status = 1;
+    }
+    /* 9-10. */
+    else if (status == 1 && chr == LIT_CHAR_LOWERCASE_U)
+    {
+      /* Found 'u' char after '%'. */
+      status = 4;
+    }
+    else if (status > 0 && lit_char_is_hex_digit (chr))
+    {
+      /* Found hexadecimal digit in escape sequence. */
+      hex_digits = (ecma_char_t) (hex_digits * 16 + (ecma_char_t) lit_char_hex_to_int (chr));
+      status++;
+    }
+
+    /* 11-17. Found valid '%uwxyz' or '%xy' escape. */
+    if (status == 8 || status == 3)
+    {
+      output_char_p -= (status == 3) ? 2 : 5;
+      status = 0;
+      chr = hex_digits;
+      hex_digits = 0;
+    }
+
+    /* Copying character. */
+    lit_utf8_size_t lit_size = lit_code_unit_to_utf8 (chr, output_char_p);
+    output_char_p += lit_size;
+    JERRY_ASSERT (output_char_p <= input_curr_p);
+  }
+
+  lit_utf8_size_t output_length = (lit_utf8_size_t) (output_char_p - input_start_p);
+  ecma_string_t *output_string_p = ecma_new_ecma_string_from_utf8 (input_start_p, output_length);
+  ret_value = ecma_make_string_value (output_string_p);
+
+  JMEM_FINALIZE_LOCAL_ARRAY (input_start_p);
+
+  ECMA_FINALIZE (string);
+  return ret_value;
+} /* ecma_builtin_global_object_unescape */
+
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h
new file mode 100644 (file)
index 0000000..f5b233c
--- /dev/null
@@ -0,0 +1,218 @@
+/* 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.
+ */
+
+/*
+ * Global built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+/* Simple value properties:
+ * (property name, simple value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.1.1.3 */
+SIMPLE_VALUE (LIT_MAGIC_STRING_UNDEFINED,
+              ECMA_SIMPLE_VALUE_UNDEFINED,
+              ECMA_PROPERTY_FIXED)
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.1.1.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_NAN,
+              ECMA_BUILTIN_NUMBER_NAN,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.1.1.2 */
+NUMBER_VALUE (LIT_MAGIC_STRING_INFINITY_UL,
+              ECMA_BUILTIN_NUMBER_POSITIVE_INFINITY,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.1.4.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_OBJECT_UL,
+              ECMA_BUILTIN_ID_OBJECT,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.1.4.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_FUNCTION_UL,
+              ECMA_BUILTIN_ID_FUNCTION,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.1.4.3 */
+#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
+OBJECT_VALUE (LIT_MAGIC_STRING_ARRAY_UL,
+              ECMA_BUILTIN_ID_ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN*/
+
+#ifndef CONFIG_DISABLE_STRING_BUILTIN
+/* ECMA-262 v5, 15.1.4.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_STRING_UL,
+              ECMA_BUILTIN_ID_STRING,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
+
+#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
+/* ECMA-262 v5, 15.1.4.5 */
+OBJECT_VALUE (LIT_MAGIC_STRING_BOOLEAN_UL,
+              ECMA_BUILTIN_ID_BOOLEAN,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
+
+#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
+/* ECMA-262 v5, 15.1.4.6 */
+OBJECT_VALUE (LIT_MAGIC_STRING_NUMBER_UL,
+              ECMA_BUILTIN_ID_NUMBER,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
+
+#ifndef CONFIG_DISABLE_DATE_BUILTIN
+/* ECMA-262 v5, 15.1.4.7 */
+OBJECT_VALUE (LIT_MAGIC_STRING_DATE_UL,
+              ECMA_BUILTIN_ID_DATE,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+/* ECMA-262 v5, 15.1.4.8 */
+OBJECT_VALUE (LIT_MAGIC_STRING_REGEXP_UL,
+              ECMA_BUILTIN_ID_REGEXP,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+
+/* ECMA-262 v5, 15.1.4.9 */
+OBJECT_VALUE (LIT_MAGIC_STRING_ERROR_UL,
+              ECMA_BUILTIN_ID_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* ECMA-262 v5, 15.1.4.10 */
+OBJECT_VALUE (LIT_MAGIC_STRING_EVAL_ERROR_UL,
+              ECMA_BUILTIN_ID_EVAL_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.1.4.11 */
+OBJECT_VALUE (LIT_MAGIC_STRING_RANGE_ERROR_UL,
+              ECMA_BUILTIN_ID_RANGE_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.1.4.12 */
+OBJECT_VALUE (LIT_MAGIC_STRING_REFERENCE_ERROR_UL,
+              ECMA_BUILTIN_ID_REFERENCE_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.1.4.13 */
+OBJECT_VALUE (LIT_MAGIC_STRING_SYNTAX_ERROR_UL,
+              ECMA_BUILTIN_ID_SYNTAX_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.1.4.14 */
+OBJECT_VALUE (LIT_MAGIC_STRING_TYPE_ERROR_UL,
+              ECMA_BUILTIN_ID_TYPE_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.1.4.15 */
+OBJECT_VALUE (LIT_MAGIC_STRING_URI_ERROR_UL,
+              ECMA_BUILTIN_ID_URI_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#ifndef CONFIG_DISABLE_MATH_BUILTIN
+/* ECMA-262 v5, 15.1.5.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_MATH_UL,
+              ECMA_BUILTIN_ID_MATH,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* !CONFIG_DISABLE_MATH_BUILTIN */
+
+#ifndef CONFIG_DISABLE_JSON_BUILTIN
+/* ECMA-262 v5, 15.1.5.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_JSON_U,
+              ECMA_BUILTIN_ID_JSON,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+OBJECT_VALUE (LIT_MAGIC_STRING_ARRAY_BUFFER_UL,
+              ECMA_BUILTIN_ID_ARRAYBUFFER,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+OBJECT_VALUE (LIT_MAGIC_STRING_INT8_ARRAY_UL,
+              ECMA_BUILTIN_ID_INT8ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+OBJECT_VALUE (LIT_MAGIC_STRING_UINT8_ARRAY_UL,
+              ECMA_BUILTIN_ID_UINT8ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+OBJECT_VALUE (LIT_MAGIC_STRING_INT16_ARRAY_UL,
+              ECMA_BUILTIN_ID_INT16ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+OBJECT_VALUE (LIT_MAGIC_STRING_UINT16_ARRAY_UL,
+              ECMA_BUILTIN_ID_UINT16ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+OBJECT_VALUE (LIT_MAGIC_STRING_INT32_ARRAY_UL,
+              ECMA_BUILTIN_ID_INT32ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+OBJECT_VALUE (LIT_MAGIC_STRING_UINT32_ARRAY_UL,
+              ECMA_BUILTIN_ID_UINT32ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+OBJECT_VALUE (LIT_MAGIC_STRING_FLOAT32_ARRAY_UL,
+              ECMA_BUILTIN_ID_FLOAT32ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+OBJECT_VALUE (LIT_MAGIC_STRING_FLOAT64_ARRAY_UL,
+              ECMA_BUILTIN_ID_FLOAT64ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+
+OBJECT_VALUE (LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL,
+              ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+OBJECT_VALUE (LIT_MAGIC_STRING_PROMISE_UL,
+              ECMA_BUILTIN_ID_PROMISE,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+
+ROUTINE (LIT_MAGIC_STRING_EVAL, ecma_builtin_global_object_eval, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_PARSE_FLOAT, ecma_builtin_global_object_parse_float, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_IS_NAN, ecma_builtin_global_object_is_nan, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_IS_FINITE, ecma_builtin_global_object_is_finite, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_DECODE_URI, ecma_builtin_global_object_decode_uri, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_DECODE_URI_COMPONENT, ecma_builtin_global_object_decode_uri_component, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_ENCODE_URI, ecma_builtin_global_object_encode_uri, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_ENCODE_URI_COMPONENT, ecma_builtin_global_object_encode_uri_component, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ecma_builtin_global_object_parse_int, 2, 2)
+
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+ROUTINE (LIT_MAGIC_STRING_ESCAPE, ecma_builtin_global_object_escape, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_UNESCAPE, ecma_builtin_global_object_unescape, 1, 1)
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c
new file mode 100644 (file)
index 0000000..5907270
--- /dev/null
@@ -0,0 +1,880 @@
+/* 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.
+ */
+
+#include <math.h>
+
+#include "ecma-alloc.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-exceptions.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "lit-char-helpers.h"
+
+#ifndef CONFIG_DISABLE_DATE_BUILTIN
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltinhelpers ECMA builtin helper operations
+ * @{
+ */
+
+/**
+ * Helper function to get day number from time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.2
+ *
+ * @return time value for day number
+ */
+inline ecma_number_t __attr_always_inline___
+ecma_date_day (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  return (ecma_number_t) floor (time / ECMA_DATE_MS_PER_DAY);
+} /* ecma_date_day */
+
+/**
+ * Helper function to get time within day from time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.2
+ *
+ * @return time value within the day
+ */
+inline ecma_number_t __attr_always_inline___
+ecma_date_time_within_day (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  return (ecma_number_t) fmod (time, ECMA_DATE_MS_PER_DAY);
+} /* ecma_date_time_within_day */
+
+/**
+ * Helper function to get the day number of the first day of a year.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.3
+ *
+ * @return day number of the first day of a year
+ */
+static ecma_number_t
+ecma_date_day_from_year (ecma_number_t year) /**< year value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (year));
+
+  return (ecma_number_t) (365 * (year - 1970)
+                          + floor ((year - 1969) / 4)
+                          - floor ((year - 1901) / 100)
+                          + floor ((year - 1601) / 400));
+} /* ecma_date_day_from_year */
+
+/**
+ * Helper function to get the time value of the start of a year.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.3
+ *
+ * @return  time value of the start of a year
+ */
+static inline ecma_number_t __attr_always_inline___
+ecma_date_time_from_year (ecma_number_t year) /**< year value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (year));
+
+  return ECMA_DATE_MS_PER_DAY * ecma_date_day_from_year (year);
+} /* ecma_date_time_from_year */
+
+/**
+ * Helper function to determine a year value from the time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.3
+ *
+ * @return year value
+ */
+ecma_number_t
+ecma_date_year_from_time (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  /* ECMA-262 v5, 15.9.1.1 define the largest year that is
+   * representable (285616) forward from 01 January, 1970 UTC.
+   */
+  ecma_number_t year = (ecma_number_t) (1970 + 285616);
+  ecma_number_t lower_year_boundary = (ecma_number_t) (1970 - 285616);
+
+  if (ecma_date_time_from_year (year) < time || ecma_date_time_from_year (lower_year_boundary) > time)
+  {
+    return ecma_number_make_nan ();
+  }
+
+  while (ecma_date_time_from_year (year) > time)
+  {
+    ecma_number_t year_boundary = (ecma_number_t) floor (lower_year_boundary + (year - lower_year_boundary) / 2);
+    if (ecma_date_time_from_year (year_boundary) > time)
+    {
+      year = year_boundary;
+    }
+    else
+    {
+      lower_year_boundary = year_boundary;
+    }
+
+    year--;
+  }
+
+  return year;
+} /* ecma_date_year_from_time */
+
+/**
+ * Helper function to decide if time value is in a leap-year.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.3
+ *
+ * @return 1 if time within a leap year
+ *         0 otherwise
+ */
+static int
+ecma_date_in_leap_year (ecma_number_t year) /**< time value */
+{
+  int mod_400 = (int) fmod (floor (year), 400);
+
+  JERRY_ASSERT (mod_400 >= -399 && mod_400 <= 399);
+
+  if ((mod_400 % 4) != 0)
+  {
+    return 0;
+  }
+
+  if ((mod_400 % 100) != 0)
+  {
+    return 1;
+  }
+
+  if (mod_400 != 0)
+  {
+    return 0;
+  }
+
+  return 1;
+} /* ecma_date_in_leap_year */
+
+/**
+ * End day for the first 11 months.
+ */
+static const int16_t ecma_date_month_end_day[10] =
+{
+  58, 89, 119, 150, 180, 211, 242, 272, 303, 333
+};
+
+/**
+ * Helper function to get month from time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.4
+ *
+ * @return month number
+ */
+ecma_number_t
+ecma_date_month_from_time (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  ecma_number_t year = ecma_date_year_from_time (time);
+
+  if (ecma_number_is_nan (year))
+  {
+    return ecma_number_make_nan ();
+  }
+
+  int day_within_year = (int) (ecma_date_day (time) - ecma_date_day_from_year (year));
+
+  JERRY_ASSERT (day_within_year >= 0);
+
+  if (day_within_year <= 30)
+  {
+    return 0;
+  }
+
+  day_within_year -= ecma_date_in_leap_year (year);
+
+  JERRY_ASSERT (day_within_year < 365);
+
+  for (int i = 0; i < 10; i++)
+  {
+    if (day_within_year <= ecma_date_month_end_day[i])
+    {
+      return i + 1;
+    }
+  }
+
+  return 11;
+} /* ecma_date_month_from_time */
+
+/**
+ * Helper function to get date number from time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.5
+ *
+ * @return date number
+ */
+ecma_number_t
+ecma_date_date_from_time (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  ecma_number_t year = ecma_date_year_from_time (time);
+
+  if (ecma_number_is_nan (year))
+  {
+    return ecma_number_make_nan ();
+  }
+
+  int day_within_year = (int) (ecma_date_day (time) - ecma_date_day_from_year (year));
+
+  JERRY_ASSERT (day_within_year >= 0);
+
+  if (day_within_year <= 30)
+  {
+    return day_within_year + 1;
+  }
+
+  int leap_year = ecma_date_in_leap_year (year);
+
+  if (day_within_year <= 58 + leap_year)
+  {
+    return day_within_year - 30;
+  }
+
+  day_within_year -= leap_year;
+
+  JERRY_ASSERT (day_within_year < 365);
+
+  for (int i = 1; i < 10; i++)
+  {
+    if (day_within_year <= ecma_date_month_end_day[i])
+    {
+      return day_within_year - ecma_date_month_end_day[i - 1];
+    }
+  }
+
+  return day_within_year - 333;
+} /* ecma_date_date_from_time */
+
+/**
+ * Helper function to get weekday from time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.6
+ *
+ * Used by:
+ *         - The Date.prototype.getDay routine. (Generated.)
+ *         - The Date.prototype.getUTCDay routine. (Generated.)
+ *
+ * @return  weekday number
+ */
+ecma_number_t
+ecma_date_week_day (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  ecma_number_t week_day = (ecma_number_t) fmod ((ecma_date_day (time) + 4), 7);
+
+  return (week_day < 0) ? (7 + week_day) : week_day;
+} /* ecma_date_week_day */
+
+/**
+ * Helper function to get local time zone adjustment.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.7
+ *
+ * @return local time zone adjustment
+ */
+static inline ecma_number_t __attr_always_inline___
+ecma_date_local_tza (jerry_time_zone_t *tz) /**< time zone information */
+{
+  return tz->offset * -ECMA_DATE_MS_PER_MINUTE;
+} /* ecma_date_local_tza */
+
+/**
+ * Helper function to get the daylight saving time adjustment.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.8
+ *
+ * @return daylight saving time adjustment
+ */
+static inline ecma_number_t __attr_always_inline___
+ecma_date_daylight_saving_ta (jerry_time_zone_t *tz, /**< time zone information */
+                              ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  /*
+   * TODO: Fix daylight saving calculation.
+   *       https://github.com/jerryscript-project/jerryscript/issues/1661
+   */
+  return tz->daylight_saving_time * ECMA_DATE_MS_PER_HOUR;
+} /* ecma_date_daylight_saving_ta */
+
+/**
+ * Helper function to get local time from UTC.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.9
+ *
+ * @return local time
+ */
+inline ecma_number_t __attr_always_inline___
+ecma_date_local_time_zone (ecma_number_t time) /**< time value */
+{
+  jerry_time_zone_t tz;
+
+  if (ecma_number_is_nan (time)
+      || !jerry_port_get_time_zone (&tz))
+  {
+    return ecma_number_make_nan ();
+  }
+
+  return ecma_date_local_tza (&tz) + ecma_date_daylight_saving_ta (&tz, time);
+} /* ecma_date_local_time_zone */
+
+/**
+ * Helper function to get utc from local time.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.9
+ *
+ * @return utc time
+ */
+ecma_number_t
+ecma_date_utc (ecma_number_t time) /**< time value */
+{
+  jerry_time_zone_t tz;
+
+  if (ecma_number_is_nan (time)
+      || !jerry_port_get_time_zone (&tz))
+  {
+    return ecma_number_make_nan ();
+  }
+
+  ecma_number_t simple_utc_time = time - ecma_date_local_tza (&tz);
+  return simple_utc_time - ecma_date_daylight_saving_ta (&tz, simple_utc_time);
+} /* ecma_date_utc */
+
+/**
+ * Helper function to get hour from time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.10
+ *
+ * @return hour value
+ */
+ecma_number_t
+ecma_date_hour_from_time (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  ecma_number_t hour = (ecma_number_t) fmod (floor (time / ECMA_DATE_MS_PER_HOUR),
+                                             ECMA_DATE_HOURS_PER_DAY);
+  return (hour < 0) ? ECMA_DATE_HOURS_PER_DAY + hour : hour;
+} /* ecma_date_hour_from_time */
+
+/**
+ * Helper function to get minute from time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.10
+ *
+ * @return minute value
+ */
+ecma_number_t
+ecma_date_min_from_time (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  ecma_number_t min = (ecma_number_t) fmod (floor (time / ECMA_DATE_MS_PER_MINUTE),
+                                            ECMA_DATE_MINUTES_PER_HOUR);
+  return (min < 0) ? ECMA_DATE_MINUTES_PER_HOUR + min : min;
+} /* ecma_date_min_from_time */
+
+/**
+ * Helper function to get second from time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.10
+ *
+ * @return second value
+ */
+ecma_number_t
+ecma_date_sec_from_time (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  ecma_number_t sec = (ecma_number_t) fmod (floor (time / ECMA_DATE_MS_PER_SECOND),
+                                            ECMA_DATE_SECONDS_PER_MINUTE);
+  return (sec < 0) ? ECMA_DATE_SECONDS_PER_MINUTE + sec : sec;
+} /* ecma_date_sec_from_time */
+
+/**
+ * Helper function to get millisecond from time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.10
+ *
+ * @return millisecond value
+ */
+ecma_number_t
+ecma_date_ms_from_time (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  ecma_number_t milli = (ecma_number_t) fmod (time, ECMA_DATE_MS_PER_SECOND);
+  return (milli < 0) ? ECMA_DATE_MS_PER_SECOND + milli : milli;
+} /* ecma_date_ms_from_time */
+
+/**
+ * Helper function to make time value from hour, min, sec and ms.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.11
+ *
+ * @return time value
+ */
+ecma_number_t
+ecma_date_make_time (ecma_number_t hour, /**< hour value */
+                     ecma_number_t min, /**< minute value */
+                     ecma_number_t sec, /**< second value */
+                     ecma_number_t ms) /**< millisecond value */
+{
+  if (ecma_number_is_nan (hour)
+      || ecma_number_is_nan (min)
+      || ecma_number_is_nan (sec)
+      || ecma_number_is_nan (ms)
+      || ecma_number_is_infinity (hour)
+      || ecma_number_is_infinity (min)
+      || ecma_number_is_infinity (sec)
+      || ecma_number_is_infinity (ms))
+  {
+    return ecma_number_make_nan ();
+  }
+
+  /* Replaced toInteger to ecma_number_trunc because it does the same thing. */
+  ecma_number_t h = ecma_number_trunc (hour);
+  ecma_number_t m = ecma_number_trunc (min);
+  ecma_number_t s = ecma_number_trunc (sec);
+  ecma_number_t milli = ecma_number_trunc (ms);
+
+  return (h * ECMA_DATE_MS_PER_HOUR
+          + m * ECMA_DATE_MS_PER_MINUTE
+          + s * ECMA_DATE_MS_PER_SECOND
+          + milli);
+} /* ecma_date_make_time */
+
+/**
+ * Helper function to make day value from year, month and date.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.12
+ *
+ * @return day value
+ */
+ecma_number_t
+ecma_date_make_day (ecma_number_t year, /**< year value */
+                    ecma_number_t month, /**< month value */
+                    ecma_number_t date) /**< date value */
+{
+  /* 1. */
+  if (ecma_number_is_nan (year)
+      || ecma_number_is_nan (month)
+      || ecma_number_is_nan (date)
+      || ecma_number_is_infinity (year)
+      || ecma_number_is_infinity (month)
+      || ecma_number_is_infinity (date))
+  {
+    return ecma_number_make_nan ();
+  }
+
+  /* 2., 3., 4. */
+  ecma_number_t y = ecma_number_trunc (year);
+  ecma_number_t m = ecma_number_trunc (month);
+  ecma_number_t dt = ecma_number_trunc (date);
+  /* 5. */
+  ecma_number_t ym = y + (ecma_number_t) floor (m / 12);
+  /* 6. */
+  ecma_number_t mn = (ecma_number_t) fmod (m, 12);
+  mn = (mn < 0) ? 12 + mn : mn;
+
+  /* 7. */
+  ecma_number_t time = ecma_date_time_from_year (ym);
+
+  /**
+   * The algorithm below searches the following date: ym-mn-1
+   * To find this time it starts from the beginning of the year (ym)
+   * then find the first day of the month.
+   */
+  if (!ecma_number_is_nan (time)
+      && ecma_date_year_from_time (time) == ym)
+  {
+    /* Get the month */
+    time += 31 * mn * ECMA_DATE_MS_PER_DAY;
+
+    /* Get the month's first day */
+    time += ((ecma_number_t) 1.0 - ecma_date_date_from_time (time)) * ECMA_DATE_MS_PER_DAY;
+
+    if (!ecma_number_is_nan (time)
+        && ecma_date_month_from_time (time) == mn
+        && ecma_date_date_from_time (time) == 1)
+    {
+      /* 8. */
+      return ecma_date_day (time) + dt - ((ecma_number_t) 1.0);
+    }
+  }
+
+  return ecma_number_make_nan ();
+} /* ecma_date_make_day */
+
+/**
+ * Helper function to make date value from day and time.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.13
+ *
+ * @return date value
+ */
+ecma_number_t
+ecma_date_make_date (ecma_number_t day, /**< day value */
+                     ecma_number_t time) /**< time value */
+{
+  if (ecma_number_is_nan (day)
+      || ecma_number_is_nan (time))
+  {
+    return ecma_number_make_nan ();
+  }
+
+  ecma_number_t result = day * ECMA_DATE_MS_PER_DAY + time;
+
+  if (ecma_number_is_infinity (result))
+  {
+    return ecma_number_make_nan ();
+  }
+
+  return result;
+} /* ecma_date_make_date */
+
+/**
+ * Helper function to calculate number of milliseconds from time value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.14
+ *
+ * @return number of milliseconds
+ */
+ecma_number_t
+ecma_date_time_clip (ecma_number_t time) /**< time value */
+{
+  if (ecma_number_is_nan (time)
+      || ecma_number_is_infinity (time)
+      || fabs (time) > ECMA_DATE_MAX_VALUE)
+  {
+    return ecma_number_make_nan ();
+  }
+
+  return ecma_number_trunc (time);
+} /* ecma_date_time_clip */
+
+/**
+ * Helper function to calculate timezone offset.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.5.26
+ *
+ * @return timezone offset
+ */
+inline ecma_number_t __attr_always_inline___
+ecma_date_timezone_offset (ecma_number_t time) /**< time value */
+{
+  JERRY_ASSERT (!ecma_number_is_nan (time));
+
+  return (-ecma_date_local_time_zone (time)) / ECMA_DATE_MS_PER_MINUTE;
+} /* ecma_date_timezone_offset */
+
+/**
+ * Common function to convert date to string.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_date_to_string_format (ecma_number_t datetime_number, /**< datetime */
+                            const char *format_p) /**< format buffer */
+{
+  const char *day_names_p[8] =
+  {
+    "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+  };
+
+  const char *month_names_p[13] =
+  {
+    "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+  };
+
+  const uint32_t date_buffer_length = 34;
+  lit_utf8_byte_t date_buffer[date_buffer_length];
+
+  lit_utf8_byte_t *dest_p = date_buffer;
+
+  while (*format_p != LIT_CHAR_NULL)
+  {
+    if (*format_p != LIT_CHAR_DOLLAR_SIGN)
+    {
+      *dest_p++ = (lit_utf8_byte_t) *format_p++;
+      continue;
+    }
+
+    format_p++;
+
+    const char *str_p = NULL;
+    int32_t number = 0;
+    int32_t number_length = 0;
+
+    switch (*format_p)
+    {
+      case LIT_CHAR_UPPERCASE_Y: /* Year. */
+      {
+        number = (int32_t) ecma_date_year_from_time (datetime_number);
+        number_length = 4;
+        break;
+      }
+      case LIT_CHAR_UPPERCASE_M: /* Month. */
+      {
+        int32_t month = (int32_t) ecma_date_month_from_time (datetime_number);
+
+        JERRY_ASSERT (month >= 0 && month <= 11);
+
+        str_p = month_names_p[month];
+        break;
+      }
+      case LIT_CHAR_UPPERCASE_O: /* Month as number. */
+      {
+        /* The 'ecma_date_month_from_time' (ECMA 262 v5, 15.9.1.4) returns a
+         * number from 0 to 11, but we have to print the month from 1 to 12
+         * for ISO 8601 standard (ECMA 262 v5, 15.9.1.15). */
+        number = ((int32_t) ecma_date_month_from_time (datetime_number)) + 1;
+        number_length = 2;
+        break;
+      }
+      case LIT_CHAR_UPPERCASE_D: /* Day. */
+      {
+        number = (int32_t) ecma_date_date_from_time (datetime_number);
+        number_length = 2;
+        break;
+      }
+      case LIT_CHAR_UPPERCASE_W: /* Day of week. */
+      {
+        int32_t day = (int32_t) ecma_date_week_day (datetime_number);
+
+        JERRY_ASSERT (day >= 0 && day <= 6);
+
+        str_p = day_names_p[day];
+        break;
+      }
+      case LIT_CHAR_LOWERCASE_H: /* Hour. */
+      {
+        number = (int32_t) ecma_date_hour_from_time (datetime_number);
+        number_length = 2;
+        break;
+      }
+      case LIT_CHAR_LOWERCASE_M: /* Minutes. */
+      {
+        number = (int32_t) ecma_date_min_from_time (datetime_number);
+        number_length = 2;
+        break;
+      }
+      case LIT_CHAR_LOWERCASE_S: /* Seconds. */
+      {
+        number = (int32_t) ecma_date_sec_from_time (datetime_number);
+        number_length = 2;
+        break;
+      }
+      case LIT_CHAR_LOWERCASE_I: /* Milliseconds. */
+      {
+        number = (int32_t) ecma_date_ms_from_time (datetime_number);
+        number_length = 3;
+        break;
+      }
+      case LIT_CHAR_LOWERCASE_Z: /* Time zone minutes part. */
+      {
+        int32_t time_zone = (int32_t) ecma_date_local_time_zone (datetime_number);
+
+        if (time_zone >= 0)
+        {
+          *dest_p++ = LIT_CHAR_PLUS;
+        }
+        else
+        {
+          *dest_p++ = LIT_CHAR_MINUS;
+          time_zone = -time_zone;
+        }
+
+        number = time_zone / (int32_t) ECMA_DATE_MS_PER_HOUR;
+        number_length = 2;
+        break;
+      }
+      case LIT_CHAR_UPPERCASE_Z: /* Time zone seconds part. */
+      {
+        int32_t time_zone = (int32_t) ecma_date_local_time_zone (datetime_number);
+
+        if (time_zone < 0)
+        {
+          time_zone = -time_zone;
+        }
+
+        number = time_zone % (int32_t) ECMA_DATE_MS_PER_HOUR;
+        number_length = 2;
+        break;
+      }
+      default:
+      {
+        JERRY_UNREACHABLE ();
+        break;
+      }
+    }
+
+    format_p++;
+
+    if (str_p != NULL)
+    {
+      /* Print string values. */
+      do
+      {
+        *dest_p++ = (lit_utf8_byte_t) *str_p++;
+      }
+      while (*str_p != LIT_CHAR_NULL);
+
+      continue;
+    }
+
+    /* Print right aligned number values. */
+    JERRY_ASSERT (number_length > 0);
+
+    dest_p += number_length;
+    lit_utf8_byte_t *buffer_p = dest_p;
+
+    do
+    {
+      buffer_p--;
+      *buffer_p = (lit_utf8_byte_t) ((number % 10) + (int32_t) LIT_CHAR_0);
+      number /= 10;
+    }
+    while (--number_length);
+  }
+
+  JERRY_ASSERT (dest_p <= date_buffer + date_buffer_length);
+
+  return ecma_make_string_value (ecma_new_ecma_string_from_utf8 (date_buffer,
+                                                                 (lit_utf8_size_t) (dest_p - date_buffer)));
+} /* ecma_date_to_string_format */
+
+/**
+ * Common function to create a time zone specific string from a numeric value.
+ *
+ * Used by:
+ *        - The Date routine.
+ *        - The Date.prototype.toString routine.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_date_value_to_string (ecma_number_t datetime_number) /**< datetime */
+{
+  datetime_number += ecma_date_local_time_zone (datetime_number);
+  return ecma_date_to_string_format (datetime_number, "$W $M $D $Y $h:$m:$s GMT$z:$Z");
+} /* ecma_date_value_to_string */
+
+/**
+ * Common function to create a time zone specific string from a numeric value.
+ *
+ * Used by:
+ *        - The Date.prototype.toUTCString routine.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_date_value_to_utc_string (ecma_number_t datetime_number) /**< datetime */
+{
+  return ecma_date_to_string_format (datetime_number, "$W, $D $M $Y $h:$m:$s GMT");
+} /* ecma_date_value_to_utc_string */
+
+/**
+ * Common function to create a ISO specific string from a numeric value.
+ *
+ * Used by:
+ *        - The Date.prototype.toISOString routine.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_date_value_to_iso_string (ecma_number_t datetime_number) /**<datetime */
+{
+  return ecma_date_to_string_format (datetime_number, "$Y-$O-$DT$h:$m:$s.$iZ");
+} /* ecma_date_value_to_iso_string */
+
+/**
+ * Common function to create a date string from a numeric value.
+ *
+ * Used by:
+ *        - The Date.prototype.toDateString routine.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_date_value_to_date_string (ecma_number_t datetime_number) /**<datetime */
+{
+  return ecma_date_to_string_format (datetime_number, "$Y-$O-$D");
+} /* ecma_date_value_to_date_string */
+
+/**
+ * Common function to create a time string from a numeric value.
+ *
+ * Used by:
+ *        - The Date.prototype.toTimeString routine.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_date_value_to_time_string (ecma_number_t datetime_number) /**<datetime */
+{
+  return ecma_date_to_string_format (datetime_number, "$h:$m:$s.$i");
+} /* ecma_date_value_to_time_string */
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-error.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-error.c
new file mode 100644 (file)
index 0000000..80428c3
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltinhelpers ECMA builtin helper operations
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of a built-in error object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_helper_error_dispatch_call (ecma_standard_error_t error_type, /**< native error type */
+                                         const ecma_value_t *arguments_list_p, /**< arguments list */
+                                         ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  if (arguments_list_len != 0
+      && !ecma_is_value_undefined (arguments_list_p[0]))
+  {
+    ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+    ECMA_TRY_CATCH (msg_str_value,
+                    ecma_op_to_string (arguments_list_p[0]),
+                    ret_value);
+
+    ecma_string_t *message_string_p = ecma_get_string_from_value (msg_str_value);
+    ecma_object_t *new_error_object_p = ecma_new_standard_error_with_message (error_type,
+                                                                              message_string_p);
+    ret_value = ecma_make_object_value (new_error_object_p);
+
+    ECMA_FINALIZE (msg_str_value);
+
+    return ret_value;
+  }
+  else
+  {
+    ecma_object_t *new_error_object_p = ecma_new_standard_error (error_type);
+
+    return ecma_make_object_value (new_error_object_p);
+  }
+} /* ecma_builtin_helper_error_dispatch_call */
+
+/**
+ * @}
+ * @}
+ */
+
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-json.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-json.c
new file mode 100644 (file)
index 0000000..862ed13
--- /dev/null
@@ -0,0 +1,309 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-helpers.h"
+#include "ecma-builtin-helpers.h"
+#include "lit-char-helpers.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltinhelpers ECMA builtin helper operations
+ * @{
+ */
+
+/**
+ * Check the object value existance in the collection.
+ *
+ * Used by:
+ *         - ecma_builtin_json_object step 1
+ *         - ecma_builtin_json_array step 1
+ *
+ * @return true, if the object is already in the collection.
+ */
+bool
+ecma_has_object_value_in_collection (ecma_collection_header_t *collection_p, /**< collection */
+                                     ecma_value_t object_value) /**< object value */
+{
+  JERRY_ASSERT (ecma_is_value_object (object_value));
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (object_value);
+
+  ecma_collection_iterator_t iterator;
+  ecma_collection_iterator_init (&iterator, collection_p);
+
+  while (ecma_collection_iterator_next (&iterator))
+  {
+    ecma_value_t value = *iterator.current_value_p;
+    ecma_object_t *current_p = ecma_get_object_from_value (value);
+
+    if (current_p == obj_p)
+    {
+      return true;
+    }
+  }
+
+  return false;
+} /* ecma_has_object_value_in_collection */
+
+/**
+ * Check the string value existance in the collection.
+ *
+ * Used by:
+ *         - ecma_builtin_json_stringify step 4.b.ii.5
+ *
+ * @return true, if the string is already in the collection.
+ */
+bool
+ecma_has_string_value_in_collection (ecma_collection_header_t *collection_p, /**< collection */
+                                     ecma_value_t string_value) /**< string value */
+{
+  JERRY_ASSERT (ecma_is_value_string (string_value));
+
+  ecma_string_t *string_p = ecma_get_string_from_value (string_value);
+
+  ecma_collection_iterator_t iterator;
+  ecma_collection_iterator_init (&iterator, collection_p);
+
+  while (ecma_collection_iterator_next (&iterator))
+  {
+    ecma_value_t value = *iterator.current_value_p;
+    ecma_string_t *current_p = ecma_get_string_from_value (value);
+
+    if (ecma_compare_ecma_strings (current_p, string_p))
+    {
+      return true;
+    }
+  }
+
+  return false;
+} /* ecma_has_string_value_in_collection*/
+
+/**
+ * Common function to concatenate key-value pairs into an ecma-string.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.3
+ *
+ * Used by:
+ *         - ecma_builtin_helper_json_create_formatted_json step 10.b.ii
+ *         - ecma_builtin_helper_json_create_non_formatted_json step 10.a.i
+ *
+ * @return pointer to ecma-string
+ *         Returned value must be freed with ecma_deref_ecma_string.
+ */
+ecma_string_t *
+ecma_builtin_helper_json_create_separated_properties (ecma_collection_header_t *partial_p, /**< key-value pairs*/
+                                                      ecma_string_t *separator_p) /**< separator*/
+{
+  ecma_string_t *properties_str_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+  ecma_string_t *tmp_str_p;
+
+  ecma_collection_iterator_t iterator;
+  ecma_collection_iterator_init (&iterator, partial_p);
+
+  uint32_t index = 0;
+
+  while (ecma_collection_iterator_next (&iterator))
+  {
+    ecma_value_t name_value = *iterator.current_value_p;
+    ecma_string_t *current_p = ecma_get_string_from_value (name_value);
+
+    if (index == 0)
+    {
+      index++;
+
+      tmp_str_p = ecma_concat_ecma_strings (properties_str_p, current_p);
+      ecma_deref_ecma_string (properties_str_p);
+      properties_str_p = tmp_str_p;
+      continue;
+    }
+
+    tmp_str_p = ecma_concat_ecma_strings (properties_str_p, separator_p);
+    ecma_deref_ecma_string (properties_str_p);
+    properties_str_p = tmp_str_p;
+
+    tmp_str_p = ecma_concat_ecma_strings (properties_str_p, current_p);
+    ecma_deref_ecma_string (properties_str_p);
+    properties_str_p = tmp_str_p;
+  }
+
+  return properties_str_p;
+} /* ecma_builtin_helper_json_create_separated_properties */
+
+/**
+ * Common function to create a formatted JSON string.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.3
+ *
+ * Used by:
+ *         - ecma_builtin_json_object step 10.b
+ *         - ecma_builtin_json_array step 10.b
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_helper_json_create_formatted_json (ecma_string_t *left_bracket_p, /**< left bracket*/
+                                                ecma_string_t *right_bracket_p, /**< right bracket*/
+                                                ecma_string_t *stepback_p, /**< stepback*/
+                                                ecma_collection_header_t *partial_p, /**< key-value pairs*/
+                                                ecma_json_stringify_context_t *context_p) /**< context*/
+{
+  /* 10.b */
+  ecma_string_t *comma_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_COMMA_CHAR);
+  ecma_string_t *line_feed_p = ecma_get_magic_string (LIT_MAGIC_STRING_NEW_LINE_CHAR);
+  ecma_string_t *properties_str_p;
+  ecma_string_t *separator_p;
+
+  /* 10.b.i */
+  ecma_string_t *tmp_str_p = ecma_concat_ecma_strings (comma_str_p, line_feed_p);
+  ecma_deref_ecma_string (comma_str_p);
+  separator_p = tmp_str_p;
+
+  tmp_str_p = ecma_concat_ecma_strings (separator_p, context_p->indent_str_p);
+  ecma_deref_ecma_string (separator_p);
+  separator_p = tmp_str_p;
+
+  /* 10.b.ii */
+  properties_str_p = ecma_builtin_helper_json_create_separated_properties (partial_p, separator_p);
+  ecma_deref_ecma_string (separator_p);
+
+  /* 10.b.iii */
+  ecma_string_t *final_str_p;
+
+  tmp_str_p = ecma_concat_ecma_strings (left_bracket_p, line_feed_p);
+  final_str_p = tmp_str_p;
+
+  tmp_str_p = ecma_concat_ecma_strings (final_str_p, context_p->indent_str_p);
+  ecma_deref_ecma_string (final_str_p);
+  final_str_p = tmp_str_p;
+
+  tmp_str_p = ecma_concat_ecma_strings (final_str_p, properties_str_p);
+  ecma_deref_ecma_string (final_str_p);
+  ecma_deref_ecma_string (properties_str_p);
+  final_str_p = tmp_str_p;
+
+  tmp_str_p = ecma_concat_ecma_strings (final_str_p, line_feed_p);
+  ecma_deref_ecma_string (line_feed_p);
+  ecma_deref_ecma_string (final_str_p);
+  final_str_p = tmp_str_p;
+
+  tmp_str_p = ecma_concat_ecma_strings (final_str_p, stepback_p);
+  ecma_deref_ecma_string (final_str_p);
+  final_str_p = tmp_str_p;
+
+  tmp_str_p = ecma_concat_ecma_strings (final_str_p, right_bracket_p);
+  ecma_deref_ecma_string (final_str_p);
+  final_str_p = tmp_str_p;
+
+  return ecma_make_string_value (final_str_p);
+} /* ecma_builtin_helper_json_create_formatted_json */
+
+/**
+ * Common function to create a non-formatted JSON string.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.3
+ *
+ * Used by:
+ *         - ecma_builtin_json_object step 10.a
+ *         - ecma_builtin_json_array step 10.a
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_helper_json_create_non_formatted_json (ecma_string_t *left_bracket_p, /**< left bracket*/
+                                                    ecma_string_t *right_bracket_p, /**< right bracket*/
+                                                    ecma_collection_header_t *partial_p) /**< key-value pairs*/
+{
+  /* 10.a */
+  ecma_string_t *comma_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_COMMA_CHAR);
+  ecma_string_t *properties_str_p;
+  ecma_string_t *tmp_str_p;
+
+  /* 10.a.i */
+  properties_str_p = ecma_builtin_helper_json_create_separated_properties (partial_p, comma_str_p);
+  ecma_deref_ecma_string (comma_str_p);
+
+  /* 10.a.ii */
+  tmp_str_p = ecma_concat_ecma_strings (left_bracket_p, properties_str_p);
+  ecma_deref_ecma_string (properties_str_p);
+  properties_str_p = tmp_str_p;
+
+  tmp_str_p = ecma_concat_ecma_strings (properties_str_p, right_bracket_p);
+  ecma_deref_ecma_string (properties_str_p);
+  properties_str_p = tmp_str_p;
+
+  return ecma_make_string_value (properties_str_p);
+} /* ecma_builtin_helper_json_create_non_formatted_json */
+
+/**
+ * Convert decimal value to 4 digit hexadecimal string value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.3
+ *
+ * Used by:
+ *         - ecma_builtin_json_quote step 2.c.iii
+ *
+ * @return pointer to ecma-string
+ *         Returned value must be freed with ecma_deref_ecma_string.
+ */
+ecma_string_t *
+ecma_builtin_helper_json_create_hex_digit_ecma_string (uint8_t value) /**< value in decimal*/
+{
+  /* 2.c.iii */
+  ecma_string_t *hex_str_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+
+  JMEM_DEFINE_LOCAL_ARRAY (hex_buff, 4, lit_utf8_byte_t);
+
+  for (uint32_t i = 0; i < 4; i++)
+  {
+    uint8_t remainder = value % 16;
+    lit_utf8_byte_t ch = ' ';
+
+    if (remainder < 10)
+    {
+      ch = (lit_utf8_byte_t) (LIT_CHAR_0 + remainder);
+    }
+    else
+    {
+      uint8_t a = (uint8_t) (remainder - 10);
+      ch = (lit_utf8_byte_t) (LIT_CHAR_LOWERCASE_A + a);
+    }
+
+    hex_buff[3 - i] = ch;
+
+    value = value / 16;
+  }
+
+  ecma_deref_ecma_string (hex_str_p);
+  hex_str_p = ecma_new_ecma_string_from_utf8 ((lit_utf8_byte_t *) hex_buff, 4);
+
+  JMEM_FINALIZE_LOCAL_ARRAY (hex_buff);
+
+  JERRY_ASSERT (ecma_string_get_length (hex_str_p));
+
+  return hex_str_p;
+} /* ecma_builtin_helper_json_create_hex_digit_ecma_string */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-defines.inc.h
new file mode 100644 (file)
index 0000000..fef4ea0
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+#ifndef SIMPLE_VALUE
+#define SIMPLE_VALUE(name, simple_value, prop_attributes)
+#endif /* !SIMPLE_VALUE */
+
+#ifndef NUMBER_VALUE
+#define NUMBER_VALUE(name, number_value, prop_attributes)
+#endif /* !NUMBER_VALUE */
+
+#ifndef STRING_VALUE
+#define STRING_VALUE(name, magic_string_id, prop_attributes)
+#endif /* !STRING_VALUE */
+
+#ifndef OBJECT_VALUE
+#define OBJECT_VALUE(name, obj_builtin_id, prop_attributes)
+#endif /* !OBJECT_VALUE */
+
+#ifndef ROUTINE
+#define ROUTINE(name, c_function_name, args_number, length_prop_value)
+#endif /* !ROUTINE */
+
+#ifndef ACCESSOR_READ_WRITE
+#define ACCESSOR_READ_WRITE(name, c_getter_func_name, c_setter_func_name, prop_attributes)
+#endif /* !ACCESSOR_READ_WRITE */
+
+#ifndef ACCESSOR_READ_ONLY
+#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes)
+#endif /* !ACCESSOR_READ_ONLY */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-macro-undefs.inc.h
new file mode 100644 (file)
index 0000000..f2c1906
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+#undef SIMPLE_VALUE
+#undef NUMBER_VALUE
+#undef STRING_VALUE
+#undef OBJECT_VALUE
+#undef ROUTINE
+#undef ACCESSOR_READ_WRITE
+#undef ACCESSOR_READ_ONLY
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c
new file mode 100644 (file)
index 0000000..4ec9126
--- /dev/null
@@ -0,0 +1,697 @@
+/* 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.
+ */
+
+#include "ecma-builtin-helpers.h"
+
+#include "ecma-alloc.h"
+#include "ecma-array-object.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-function-object.h"
+#include "ecma-exceptions.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "lit-magic-strings.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltinhelpers ECMA builtin helper operations
+ * @{
+ */
+
+/**
+ * Common implementation of the Object.prototype.toString routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.4.2
+ *
+ * Used by:
+ *         - The Object.prototype.toString routine.
+ *         - The Array.prototype.toString routine as fallback.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+
+ecma_value_t
+ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this argument */
+{
+  lit_magic_string_id_t type_string;
+
+  if (ecma_is_value_undefined (this_arg))
+  {
+    type_string = LIT_MAGIC_STRING_UNDEFINED_UL;
+  }
+  else if (ecma_is_value_null (this_arg))
+  {
+    type_string = LIT_MAGIC_STRING_NULL_UL;
+  }
+  else
+  {
+    ecma_value_t obj_this = ecma_op_to_object (this_arg);
+
+    if (ECMA_IS_VALUE_ERROR (obj_this))
+    {
+      return obj_this;
+    }
+
+    JERRY_ASSERT (ecma_is_value_object (obj_this));
+
+    ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+
+    type_string = ecma_object_get_class_name (obj_p);
+
+    ecma_free_value (obj_this);
+  }
+
+  ecma_string_t *ret_string_p;
+
+  /* Building string "[object #type#]" where type is 'Undefined',
+     'Null' or one of possible object's classes.
+     The string with null character is maximum 27 characters long. */
+  const lit_utf8_size_t buffer_size = 27;
+  lit_utf8_byte_t str_buffer[buffer_size];
+
+  lit_utf8_byte_t *buffer_ptr = str_buffer;
+
+  const lit_magic_string_id_t magic_string_ids[] =
+  {
+    LIT_MAGIC_STRING_LEFT_SQUARE_CHAR,
+    LIT_MAGIC_STRING_OBJECT,
+    LIT_MAGIC_STRING_SPACE_CHAR,
+    type_string,
+    LIT_MAGIC_STRING_RIGHT_SQUARE_CHAR
+  };
+
+  for (uint32_t i = 0; i < sizeof (magic_string_ids) / sizeof (lit_magic_string_id_t); ++i)
+  {
+    buffer_ptr = lit_copy_magic_string_to_buffer (magic_string_ids[i], buffer_ptr,
+                                                  (lit_utf8_size_t) ((str_buffer + buffer_size) - buffer_ptr));
+    JERRY_ASSERT (buffer_ptr <= str_buffer + buffer_size);
+  }
+
+  ret_string_p = ecma_new_ecma_string_from_utf8 (str_buffer, (lit_utf8_size_t) (buffer_ptr - str_buffer));
+
+  return ecma_make_string_value (ret_string_p);
+} /* ecma_builtin_helper_object_to_string */
+
+/**
+ * The Array.prototype's 'toLocaleString' single element operation routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.3 steps 6-8 and 10.b-d
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_helper_get_to_locale_string_at_index (ecma_object_t *obj_p, /**< this object */
+                                                   uint32_t index) /**< array index */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_string_t *index_string_p = ecma_new_ecma_string_from_uint32 (index);
+
+  ECMA_TRY_CATCH (index_value,
+                  ecma_op_object_get (obj_p, index_string_p),
+                  ret_value);
+
+  if (ecma_is_value_undefined (index_value) || ecma_is_value_null (index_value))
+  {
+    ecma_string_t *return_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+    ret_value = ecma_make_string_value (return_string_p);
+  }
+  else
+  {
+    ECMA_TRY_CATCH (index_obj_value,
+                    ecma_op_to_object (index_value),
+                    ret_value);
+
+    ecma_object_t *index_obj_p = ecma_get_object_from_value (index_obj_value);
+    ecma_string_t *locale_string_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL);
+
+    ECMA_TRY_CATCH (to_locale_value,
+                    ecma_op_object_get (index_obj_p, locale_string_magic_string_p),
+                    ret_value);
+
+    if (ecma_op_is_callable (to_locale_value))
+    {
+      ecma_object_t *locale_func_obj_p = ecma_get_object_from_value (to_locale_value);
+      ECMA_TRY_CATCH (call_value,
+                      ecma_op_function_call (locale_func_obj_p,
+                                             ecma_make_object_value (index_obj_p),
+                                             NULL,
+                                             0),
+                      ret_value);
+      ret_value = ecma_op_to_string (call_value);
+      ECMA_FINALIZE (call_value);
+
+    }
+    else
+    {
+      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("'toLocaleString' is missing or not a function."));
+    }
+
+    ECMA_FINALIZE (to_locale_value);
+
+    ecma_deref_ecma_string (locale_string_magic_string_p);
+
+    ECMA_FINALIZE (index_obj_value);
+  }
+
+  ECMA_FINALIZE (index_value);
+
+  ecma_deref_ecma_string (index_string_p);
+
+  return ret_value;
+} /* ecma_builtin_helper_get_to_locale_string_at_index */
+
+
+/**
+ * The Object.keys and Object.getOwnPropertyNames routine's common part.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.4 steps 2-5
+ *          ECMA-262 v5, 15.2.3.14 steps 3-6
+ *
+ * @return ecma value - Array of property names.
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_helper_object_get_properties (ecma_object_t *obj_p, /**< object */
+                                           bool only_enumerable_properties) /**< list enumerable properties? */
+{
+  JERRY_ASSERT (obj_p != NULL);
+
+  ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
+  ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
+
+  uint32_t index = 0;
+
+  ecma_collection_header_t *props_p = ecma_op_object_get_property_names (obj_p,
+                                                                         false,
+                                                                         only_enumerable_properties,
+                                                                         false);
+
+  ecma_collection_iterator_t iter;
+  ecma_collection_iterator_init (&iter, props_p);
+
+  while (ecma_collection_iterator_next (&iter))
+  {
+    ecma_string_t *index_string_p = ecma_new_ecma_string_from_uint32 (index);
+
+    ecma_value_t completion = ecma_builtin_helper_def_prop (new_array_p,
+                                                            index_string_p,
+                                                            *iter.current_value_p,
+                                                            true, /* Writable */
+                                                            true, /* Enumerable */
+                                                            true, /* Configurable */
+                                                            false); /* Failure handling */
+
+    JERRY_ASSERT (ecma_is_value_true (completion));
+
+    ecma_deref_ecma_string (index_string_p);
+
+    index++;
+  }
+
+  ecma_free_values_collection (props_p, true);
+
+  return new_array;
+} /* ecma_builtin_helper_object_get_properties */
+
+/**
+ * Helper function to normalizing an array index
+ *
+ * This function clamps the given index to the [0, length] range.
+ * If the index is negative, it is used as the offset from the end of the array,
+ * to compute normalized index.
+ * If the index is greater than the length of the array, the normalized index will be the length of the array.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.10 steps 5-6, 7 (part 2) and 8
+ *          ECMA-262 v5, 15.4.4.12 steps 5-6
+ *          ECMA-262 v5, 15.4.4.14 steps 5
+ *          ECMA-262 v5, 15.5.4.13 steps 4, 5 (part 2) and 6-7
+ *
+ * Used by:
+ *         - The Array.prototype.slice routine.
+ *         - The Array.prototype.splice routine.
+ *         - The Array.prototype.indexOf routine.
+ *         - The String.prototype.slice routine.
+ *
+ * @return uint32_t - the normalized value of the index
+ */
+uint32_t
+ecma_builtin_helper_array_index_normalize (ecma_number_t index, /**< index */
+                                           uint32_t length) /**< array's length */
+{
+  uint32_t norm_index;
+
+  if (!ecma_number_is_nan (index))
+  {
+
+    if (ecma_number_is_zero (index))
+    {
+      norm_index = 0;
+    }
+    else if (ecma_number_is_infinity (index))
+    {
+      norm_index = ecma_number_is_negative (index) ? 0 : length;
+    }
+    else
+    {
+      if (ecma_number_is_negative (index))
+      {
+        ecma_number_t index_neg = ecma_number_negate (index);
+
+        if (index_neg > length)
+        {
+          norm_index = 0;
+        }
+        else
+        {
+          norm_index = length - ecma_number_to_uint32 (index_neg);
+        }
+      }
+      else
+      {
+        if (index > length)
+        {
+          norm_index = length;
+        }
+        else
+        {
+          norm_index = ecma_number_to_uint32 (index);
+        }
+      }
+    }
+  }
+  else
+  {
+    norm_index = 0;
+  }
+
+  return norm_index;
+} /* ecma_builtin_helper_array_index_normalize */
+
+/**
+ * Helper function for concatenating an ecma_value_t to an Array.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.4.4.4 steps 5.b - 5.c
+ *
+ * Used by:
+ *         - The Array.prototype.concat routine.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_helper_array_concat_value (ecma_object_t *obj_p, /**< array */
+                                        uint32_t *length_p, /**< [in,out] array's length */
+                                        ecma_value_t value) /**< value to concat */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 5.b */
+  if (ecma_is_value_object (value)
+      && (ecma_object_get_class_name (ecma_get_object_from_value (value)) == LIT_MAGIC_STRING_ARRAY_UL))
+  {
+    ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+    /* 5.b.ii */
+    ECMA_TRY_CATCH (arg_len_value,
+                    ecma_op_object_get (ecma_get_object_from_value (value),
+                                        magic_string_length_p),
+                    ret_value);
+    ECMA_OP_TO_NUMBER_TRY_CATCH (arg_len_number, arg_len_value, ret_value);
+
+    uint32_t arg_len = ecma_number_to_uint32 (arg_len_number);
+
+    /* 5.b.iii */
+    for (uint32_t array_index = 0;
+         array_index < arg_len && ecma_is_value_empty (ret_value);
+         array_index++)
+    {
+      ecma_string_t *array_index_string_p = ecma_new_ecma_string_from_uint32 (array_index);
+
+      /* 5.b.iii.2 */
+      ECMA_TRY_CATCH (get_value,
+                      ecma_op_object_find (ecma_get_object_from_value (value),
+                                           array_index_string_p),
+                      ret_value);
+
+      if (ecma_is_value_found (get_value))
+      {
+        /* 5.b.iii.3.a */
+        ecma_string_t *new_array_index_string_p = ecma_new_ecma_string_from_uint32 (*length_p + array_index);
+
+        /* 5.b.iii.3.b */
+        /* This will always be a simple value since 'is_throw' is false, so no need to free. */
+        ecma_value_t put_comp = ecma_builtin_helper_def_prop (obj_p,
+                                                              new_array_index_string_p,
+                                                              get_value,
+                                                              true, /* Writable */
+                                                              true, /* Enumerable */
+                                                              true, /* Configurable */
+                                                              false); /* Failure handling */
+
+        JERRY_ASSERT (ecma_is_value_true (put_comp));
+        ecma_deref_ecma_string (new_array_index_string_p);
+      }
+
+      ECMA_FINALIZE (get_value);
+
+      ecma_deref_ecma_string (array_index_string_p);
+    }
+
+    *length_p += arg_len;
+
+    ECMA_OP_TO_NUMBER_FINALIZE (arg_len_number);
+    ECMA_FINALIZE (arg_len_value);
+    ecma_deref_ecma_string (magic_string_length_p);
+  }
+  else
+  {
+    ecma_string_t *new_array_index_string_p = ecma_new_ecma_string_from_uint32 ((*length_p)++);
+
+    /* 5.c.i */
+    /* This will always be a simple value since 'is_throw' is false, so no need to free. */
+    ecma_value_t put_comp = ecma_builtin_helper_def_prop (obj_p,
+                                                          new_array_index_string_p,
+                                                          value,
+                                                          true, /* Writable */
+                                                          true, /* Enumerable */
+                                                          true, /* Configurable */
+                                                          false); /* Failure handling */
+
+    JERRY_ASSERT (ecma_is_value_true (put_comp));
+
+    ecma_deref_ecma_string (new_array_index_string_p);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+
+  return ret_value;
+} /* ecma_builtin_helper_array_concat_value */
+
+/**
+ * Helper function to normalizing a string index
+ *
+ * This function clamps the given index to the [0, length] range.
+ * If the index is negative, 0 value is used.
+ * If the index is greater than the length of the string, the normalized index will be the length of the string.
+ * NaN is mapped to zero or length depending on the nan_to_zero parameter.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.15
+ *
+ * Used by:
+ *         - The String.prototype.substring routine.
+ *         - The ecma_builtin_helper_string_prototype_object_index_of helper routine.
+ *
+ * @return uint32_t - the normalized value of the index
+ */
+uint32_t
+ecma_builtin_helper_string_index_normalize (ecma_number_t index, /**< index */
+                                            uint32_t length, /**< string's length */
+                                            bool nan_to_zero) /**< whether NaN is mapped to zero (t) or length (f) */
+{
+  uint32_t norm_index = 0;
+
+  if (ecma_number_is_nan (index))
+  {
+    if (!nan_to_zero)
+    {
+      norm_index = length;
+    }
+  }
+  else if (!ecma_number_is_negative (index))
+  {
+    if (ecma_number_is_infinity (index))
+    {
+      norm_index = length;
+    }
+    else
+    {
+      norm_index = ecma_number_to_uint32 (index);
+
+      if (norm_index > length)
+      {
+        norm_index = length;
+      }
+    }
+  }
+
+  return norm_index;
+} /* ecma_builtin_helper_string_index_normalize */
+
+/**
+ * Helper function for string indexOf and lastIndexOf functions
+ *
+ * This function implements string indexOf and lastIndexOf with required checks and conversions.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.7
+ *          ECMA-262 v5, 15.5.4.8
+ *
+ * Used by:
+ *         - The String.prototype.indexOf routine.
+ *         - The String.prototype.lastIndexOf routine.
+ *
+ * @return uint32_t - (last) index of search string
+ */
+ecma_value_t
+ecma_builtin_helper_string_prototype_object_index_of (ecma_value_t this_arg, /**< this argument */
+                                                      ecma_value_t arg1, /**< routine's first argument */
+                                                      ecma_value_t arg2, /**< routine's second argument */
+                                                      bool first_index) /**< routine's third argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1 */
+  ECMA_TRY_CATCH (check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2 */
+  ECMA_TRY_CATCH (to_str_val,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  /* 3 */
+  ECMA_TRY_CATCH (search_str_val,
+                  ecma_op_to_string (arg1),
+                  ret_value);
+
+  /* 4 */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (pos_num,
+                               arg2,
+                               ret_value);
+
+  /* 5 (indexOf) -- 6 (lastIndexOf) */
+  ecma_string_t *original_str_p = ecma_get_string_from_value (to_str_val);
+  const ecma_length_t original_len = ecma_string_get_length (original_str_p);
+
+  /* 4b, 6 (indexOf) - 4b, 5, 7 (lastIndexOf) */
+  ecma_length_t start = ecma_builtin_helper_string_index_normalize (pos_num, original_len, first_index);
+
+  /* 7 (indexOf) -- 8 (lastIndexOf) */
+  ecma_string_t *search_str_p = ecma_get_string_from_value (search_str_val);
+
+  ecma_number_t ret_num = ECMA_NUMBER_MINUS_ONE;
+
+  /* 8 (indexOf) -- 9 (lastIndexOf) */
+  ecma_length_t index_of = 0;
+  if (ecma_builtin_helper_string_find_index (original_str_p, search_str_p, first_index, start, &index_of))
+  {
+    ret_num = ((ecma_number_t) index_of);
+  }
+
+  ret_value = ecma_make_number_value (ret_num);
+
+  ECMA_OP_TO_NUMBER_FINALIZE (pos_num);
+  ECMA_FINALIZE (search_str_val);
+  ECMA_FINALIZE (to_str_val);
+  ECMA_FINALIZE (check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_helper_string_prototype_object_index_of */
+
+/**
+ * Helper function for finding index of a search string
+ *
+ * This function clamps the given index to the [0, length] range.
+ * If the index is negative, 0 value is used.
+ * If the index is greater than the length of the string, the normalized index will be the length of the string.
+ * NaN is mapped to zero or length depending on the nan_to_zero parameter.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.7,8,11
+ *
+ * Used by:
+ *         - The ecma_builtin_helper_string_prototype_object_index_of helper routine.
+ *         - The ecma_builtin_string_prototype_object_replace_match helper routine.
+ *
+ * @return uint32_t - the normalized value of the index
+ */
+bool
+ecma_builtin_helper_string_find_index (ecma_string_t *original_str_p, /**< index */
+                                       ecma_string_t *search_str_p, /**< string's length */
+                                       bool first_index, /**< whether search for first (t) or last (f) index */
+                                       ecma_length_t start_pos, /**< start position */
+                                       ecma_length_t *ret_index_p) /**< position found in original string */
+{
+  bool match_found = false;
+  const ecma_length_t original_len = ecma_string_get_length (original_str_p);
+  const ecma_length_t search_len = ecma_string_get_length (search_str_p);
+
+  if (search_len <= original_len)
+  {
+    if (!search_len)
+    {
+      match_found = true;
+      *ret_index_p = first_index ? 0 : original_len;
+    }
+    else
+    {
+      /* create utf8 string from original string and advance to position */
+      ECMA_STRING_TO_UTF8_STRING (original_str_p, original_str_utf8_p, original_str_size);
+
+      ecma_length_t index = start_pos;
+
+      const lit_utf8_byte_t *original_str_curr_p = original_str_utf8_p;
+      for (ecma_length_t idx = 0; idx < index; idx++)
+      {
+        lit_utf8_incr (&original_str_curr_p);
+      }
+
+      /* create utf8 string from search string */
+      ECMA_STRING_TO_UTF8_STRING (search_str_p, search_str_utf8_p, search_str_size);
+
+      const lit_utf8_byte_t *search_str_curr_p = search_str_utf8_p;
+
+      /* iterate original string and try to match at each position */
+      bool searching = true;
+      ecma_char_t first_char = lit_utf8_read_next (&search_str_curr_p);
+      while (searching)
+      {
+        /* match as long as possible */
+        ecma_length_t match_len = 0;
+        const lit_utf8_byte_t *stored_original_str_curr_p = original_str_curr_p;
+
+        if (match_len < search_len &&
+            index + match_len < original_len &&
+            lit_utf8_read_next (&original_str_curr_p) == first_char)
+        {
+          const lit_utf8_byte_t *nested_search_str_curr_p = search_str_curr_p;
+          match_len++;
+
+          while (match_len < search_len &&
+                 index + match_len < original_len &&
+                 lit_utf8_read_next (&original_str_curr_p) == lit_utf8_read_next (&nested_search_str_curr_p))
+          {
+            match_len++;
+          }
+        }
+
+        /* check for match */
+        if (match_len == search_len)
+        {
+          match_found = true;
+          *ret_index_p = index;
+
+          break;
+        }
+        else
+        {
+          /* inc/dec index and update iterators and search condition */
+          original_str_curr_p = stored_original_str_curr_p;
+
+          if (first_index)
+          {
+            if ((searching = (index <= original_len - search_len)))
+            {
+              lit_utf8_incr (&original_str_curr_p);
+              index++;
+            }
+          }
+          else
+          {
+            if ((searching = (index > 0)))
+            {
+              lit_utf8_decr (&original_str_curr_p);
+              index--;
+            }
+          }
+        }
+      }
+
+      ECMA_FINALIZE_UTF8_STRING (search_str_utf8_p, search_str_size);
+      ECMA_FINALIZE_UTF8_STRING (original_str_utf8_p, original_str_size);
+    }
+  }
+
+  return match_found;
+} /* ecma_builtin_helper_string_find_index */
+
+/**
+ * Helper function for using [[DefineOwnProperty]].
+ *
+ * See also:
+ *          ECMA-262 v5, 8.12.9
+ *          ECMA-262 v5, 15.4.5.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_helper_def_prop (ecma_object_t *obj_p, /**< object */
+                              ecma_string_t *index_p, /**< index string */
+                              ecma_value_t value, /**< value */
+                              bool writable, /**< writable */
+                              bool enumerable, /**< enumerable */
+                              bool configurable, /**< configurable */
+                              bool is_throw) /**< is_throw */
+{
+  ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
+
+  prop_desc.is_value_defined = true;
+  prop_desc.value = value;
+
+  prop_desc.is_writable_defined = true;
+  prop_desc.is_writable = writable;
+
+  prop_desc.is_enumerable_defined = true;
+  prop_desc.is_enumerable = enumerable;
+
+  prop_desc.is_configurable_defined = true;
+  prop_desc.is_configurable = configurable;
+
+  return ecma_op_object_define_own_property (obj_p,
+                                             index_p,
+                                             &prop_desc,
+                                             is_throw);
+} /* ecma_builtin_helper_def_prop */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h
new file mode 100644 (file)
index 0000000..b2f80c8
--- /dev/null
@@ -0,0 +1,172 @@
+/* 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.
+ */
+
+#ifndef ECMA_BUILTIN_HELPERS_H
+#define ECMA_BUILTIN_HELPERS_H
+
+#include "ecma-globals.h"
+#include "ecma-exceptions.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltinhelpers ECMA builtin helper operations
+ * @{
+ */
+
+ecma_value_t
+ecma_builtin_helper_object_to_string (const ecma_value_t this_arg);
+ecma_value_t
+ecma_builtin_helper_get_to_locale_string_at_index (ecma_object_t *obj_p, uint32_t index);
+ecma_value_t
+ecma_builtin_helper_object_get_properties (ecma_object_t *obj_p, bool only_enumerable_properties);
+ecma_value_t
+ecma_builtin_helper_array_concat_value (ecma_object_t *obj_p, uint32_t *length_p, ecma_value_t value);
+uint32_t
+ecma_builtin_helper_array_index_normalize (ecma_number_t index, uint32_t length);
+uint32_t
+ecma_builtin_helper_string_index_normalize (ecma_number_t index, uint32_t length, bool nan_to_zero);
+ecma_value_t
+ecma_builtin_helper_string_prototype_object_index_of (ecma_value_t this_arg, ecma_value_t arg1,
+                                                      ecma_value_t arg2, bool first_index);
+bool
+ecma_builtin_helper_string_find_index (ecma_string_t *original_str_p, ecma_string_t *search_str_p, bool first_index,
+                                       ecma_length_t start_pos, ecma_length_t *ret_index_p);
+ecma_value_t
+ecma_builtin_helper_def_prop (ecma_object_t *obj_p, ecma_string_t *index_p, ecma_value_t value,
+                              bool writable, bool enumerable, bool configurable, bool is_throw);
+
+#ifndef CONFIG_DISABLE_DATE_BUILTIN
+
+/**
+ * Time range defines for helper functions.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.9.1.1, 15.9.1.10
+ */
+
+/** Hours in a day. */
+#define ECMA_DATE_HOURS_PER_DAY         ((ecma_number_t) 24)
+
+/** Minutes in an hour. */
+#define ECMA_DATE_MINUTES_PER_HOUR      ((ecma_number_t) 60)
+
+/** Seconds in a minute. */
+#define ECMA_DATE_SECONDS_PER_MINUTE    ((ecma_number_t) 60)
+
+/** Milliseconds in a second. */
+#define ECMA_DATE_MS_PER_SECOND         ((ecma_number_t) 1000)
+
+/** ECMA_DATE_MS_PER_MINUTE == 60000 */
+#define ECMA_DATE_MS_PER_MINUTE         (ECMA_DATE_MS_PER_SECOND * ECMA_DATE_SECONDS_PER_MINUTE)
+
+/** ECMA_DATE_MS_PER_HOUR == 3600000 */
+#define ECMA_DATE_MS_PER_HOUR           (ECMA_DATE_MS_PER_MINUTE * ECMA_DATE_MINUTES_PER_HOUR)
+
+/** ECMA_DATE_MS_PER_DAY == 86400000 */
+#define ECMA_DATE_MS_PER_DAY            (ECMA_DATE_MS_PER_HOUR * ECMA_DATE_HOURS_PER_DAY)
+
+/**
+ * This gives a range of 8,640,000,000,000,000 milliseconds
+ * to either side of 01 January, 1970 UTC.
+ */
+#define ECMA_DATE_MAX_VALUE             8.64e15
+
+/**
+ * Timezone type.
+ */
+typedef enum
+{
+  ECMA_DATE_UTC, /**< date vaule is in UTC */
+  ECMA_DATE_LOCAL /**< date vaule is in local time */
+} ecma_date_timezone_t;
+
+/* ecma-builtin-helpers-date.c */
+ecma_number_t ecma_date_day (ecma_number_t time);
+ecma_number_t ecma_date_time_within_day (ecma_number_t time);
+ecma_number_t ecma_date_year_from_time (ecma_number_t time);
+ecma_number_t ecma_date_month_from_time (ecma_number_t time);
+ecma_number_t ecma_date_date_from_time (ecma_number_t time);
+ecma_number_t ecma_date_week_day (ecma_number_t time);
+ecma_number_t ecma_date_local_time_zone (ecma_number_t time);
+ecma_number_t ecma_date_utc (ecma_number_t time);
+ecma_number_t ecma_date_hour_from_time (ecma_number_t time);
+ecma_number_t ecma_date_min_from_time (ecma_number_t time);
+ecma_number_t ecma_date_sec_from_time (ecma_number_t time);
+ecma_number_t ecma_date_ms_from_time (ecma_number_t time);
+ecma_number_t ecma_date_make_time (ecma_number_t hour, ecma_number_t min, ecma_number_t sec, ecma_number_t ms);
+ecma_number_t ecma_date_make_day (ecma_number_t year, ecma_number_t month, ecma_number_t date);
+ecma_number_t ecma_date_make_date (ecma_number_t day, ecma_number_t time);
+ecma_number_t ecma_date_time_clip (ecma_number_t time);
+ecma_number_t ecma_date_timezone_offset (ecma_number_t time);
+
+ecma_value_t ecma_date_value_to_string (ecma_number_t datetime_number);
+ecma_value_t ecma_date_value_to_utc_string (ecma_number_t datetime_number);
+ecma_value_t ecma_date_value_to_iso_string (ecma_number_t datetime_number);
+ecma_value_t ecma_date_value_to_date_string (ecma_number_t datetime_number);
+ecma_value_t ecma_date_value_to_time_string (ecma_number_t datetime_number);
+
+#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
+
+/* ecma-builtin-helper-json.c */
+
+/**
+ * Context for JSON.stringify()
+ */
+typedef struct
+{
+  /** Collection for property keys. */
+  ecma_collection_header_t *property_list_p;
+
+  /** Collection for traversing objects. */
+  ecma_collection_header_t *occurence_stack_p;
+
+  /** The actual indentation text. */
+  ecma_string_t *indent_str_p;
+
+  /** The indentation text. */
+  ecma_string_t *gap_str_p;
+
+  /** The replacer function. */
+  ecma_object_t *replacer_function_p;
+} ecma_json_stringify_context_t;
+
+bool ecma_has_object_value_in_collection (ecma_collection_header_t *collection_p, ecma_value_t object_value);
+bool ecma_has_string_value_in_collection (ecma_collection_header_t *collection_p, ecma_value_t string_value);
+
+ecma_string_t *
+ecma_builtin_helper_json_create_hex_digit_ecma_string (uint8_t value);
+ecma_string_t *
+ecma_builtin_helper_json_create_separated_properties (ecma_collection_header_t *partial_p, ecma_string_t *separator_p);
+ecma_value_t
+ecma_builtin_helper_json_create_formatted_json (ecma_string_t *left_bracket_p, ecma_string_t *right_bracket_p,
+                                                ecma_string_t *stepback_p, ecma_collection_header_t *partial_p,
+                                                ecma_json_stringify_context_t *context_p);
+ecma_value_t
+ecma_builtin_helper_json_create_non_formatted_json (ecma_string_t *left_bracket_p, ecma_string_t *right_bracket_p,
+                                                    ecma_collection_header_t *partial_p);
+
+/* ecma-builtin-helper-error.c */
+
+ecma_value_t
+ecma_builtin_helper_error_dispatch_call (ecma_standard_error_t error_type, const ecma_value_t *arguments_list_p,
+                                         ecma_length_t arguments_list_len);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_BUILTIN_HELPERS_H */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-internal-routines-template.inc.h
new file mode 100644 (file)
index 0000000..211d4b1
--- /dev/null
@@ -0,0 +1,226 @@
+/* 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.
+ */
+
+#ifndef BUILTIN_UNDERSCORED_ID
+# error "Please, define BUILTIN_UNDERSCORED_ID"
+#endif /* !BUILTIN_UNDERSCORED_ID */
+
+#ifndef BUILTIN_INC_HEADER_NAME
+# error "Please, define BUILTIN_INC_HEADER_NAME"
+#endif /* !BUILTIN_INC_HEADER_NAME */
+
+#include "ecma-objects.h"
+
+#define PASTE__(x, y) x ## y
+#define PASTE_(x, y) PASTE__ (x, y)
+#define PASTE(x, y) PASTE_ (x, y)
+
+#define PROPERTY_DESCRIPTOR_LIST_NAME \
+  PASTE (PASTE (ecma_builtin_, BUILTIN_UNDERSCORED_ID), _property_descriptor_list)
+#define DISPATCH_ROUTINE_ROUTINE_NAME \
+  PASTE (PASTE (ecma_builtin_, BUILTIN_UNDERSCORED_ID), _dispatch_routine)
+
+#ifndef BUILTIN_CUSTOM_DISPATCH
+
+#define ROUTINE_ARG(n) , ecma_value_t arg ## n
+#define ROUTINE_ARG_LIST_0 ecma_value_t this_arg
+#define ROUTINE_ARG_LIST_1 ROUTINE_ARG_LIST_0 ROUTINE_ARG(1)
+#define ROUTINE_ARG_LIST_2 ROUTINE_ARG_LIST_1 ROUTINE_ARG(2)
+#define ROUTINE_ARG_LIST_3 ROUTINE_ARG_LIST_2 ROUTINE_ARG(3)
+#define ROUTINE_ARG_LIST_NON_FIXED ROUTINE_ARG_LIST_0, \
+  const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len
+#define ROUTINE(name, c_function_name, args_number, length_prop_value) \
+  static ecma_value_t c_function_name (ROUTINE_ARG_LIST_ ## args_number);
+#define ACCESSOR_READ_WRITE(name, c_getter_func_name, c_setter_func_name, prop_attributes) \
+  static ecma_value_t c_getter_func_name (ROUTINE_ARG_LIST_0); \
+  static ecma_value_t c_setter_func_name (ROUTINE_ARG_LIST_1);
+#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes) \
+  static ecma_value_t c_getter_func_name (ROUTINE_ARG_LIST_0);
+#include BUILTIN_INC_HEADER_NAME
+#undef ROUTINE_ARG_LIST_NON_FIXED
+#undef ROUTINE_ARG_LIST_3
+#undef ROUTINE_ARG_LIST_2
+#undef ROUTINE_ARG_LIST_1
+#undef ROUTINE_ARG_LIST_0
+#undef ROUTINE_ARG
+
+/**
+ * List of built-in routine identifiers.
+ */
+enum
+{
+  PASTE (ECMA_ROUTINE_START_, BUILTIN_UNDERSCORED_ID) = ECMA_BUILTIN_ID__COUNT - 1,
+#define ROUTINE(name, c_function_name, args_number, length_prop_value) \
+  ECMA_ROUTINE_ ## name ## c_function_name,
+#define ACCESSOR_READ_WRITE(name, c_getter_func_name, c_setter_func_name, prop_attributes) \
+  ECMA_ACCESSOR_ ## name ## c_getter_func_name, \
+  ECMA_ACCESSOR_ ## name ## c_setter_func_name,
+#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes) \
+  ECMA_ACCESSOR_ ## name ## c_getter_func_name,
+#include BUILTIN_INC_HEADER_NAME
+};
+
+#endif /* !BUILTIN_CUSTOM_DISPATCH */
+
+/**
+ * Built-in property list of the built-in object.
+ */
+const ecma_builtin_property_descriptor_t PROPERTY_DESCRIPTOR_LIST_NAME[] =
+{
+#ifndef BUILTIN_CUSTOM_DISPATCH
+#define ROUTINE(name, c_function_name, args_number, length_prop_value) \
+  { \
+    name, \
+    ECMA_BUILTIN_PROPERTY_ROUTINE, \
+    ECMA_PROPERTY_CONFIGURABLE_WRITABLE, \
+    ECMA_ROUTINE_VALUE (ECMA_ROUTINE_ ## name ## c_function_name, length_prop_value) \
+  },
+#else /* BUILTIN_CUSTOM_DISPATCH */
+#define ROUTINE(name, c_function_name, args_number, length_prop_value) \
+  { \
+    name, \
+    ECMA_BUILTIN_PROPERTY_ROUTINE, \
+    ECMA_PROPERTY_CONFIGURABLE_WRITABLE, \
+    ECMA_ROUTINE_VALUE (c_function_name, length_prop_value) \
+  },
+#endif /* !BUILTIN_CUSTOM_DISPATCH */
+#define OBJECT_VALUE(name, obj_builtin_id, prop_attributes) \
+  { \
+    name, \
+    ECMA_BUILTIN_PROPERTY_OBJECT, \
+    prop_attributes, \
+    obj_builtin_id \
+  },
+#define SIMPLE_VALUE(name, simple_value, prop_attributes) \
+  { \
+    name, \
+    ECMA_BUILTIN_PROPERTY_SIMPLE, \
+    prop_attributes, \
+    simple_value \
+  },
+#define NUMBER_VALUE(name, number_value, prop_attributes) \
+  { \
+    name, \
+    ECMA_BUILTIN_PROPERTY_NUMBER, \
+    prop_attributes, \
+    number_value \
+  },
+#define STRING_VALUE(name, magic_string_id, prop_attributes) \
+  { \
+    name, \
+    ECMA_BUILTIN_PROPERTY_STRING, \
+    prop_attributes, \
+    magic_string_id \
+  },
+#define ACCESSOR_READ_WRITE(name, c_getter_name, c_setter_name, prop_attributes) \
+  { \
+    name, \
+    ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_WRITE, \
+    prop_attributes, \
+    ECMA_ACCESSOR_READ_WRITE (ECMA_ACCESSOR_ ## name ## c_getter_name, ECMA_ACCESSOR_ ## name ## c_setter_name) \
+  },
+#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes) \
+  { \
+    name, \
+    ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_ONLY, \
+    prop_attributes, \
+    ECMA_ACCESSOR_ ## name ## c_getter_func_name \
+  },
+#include BUILTIN_INC_HEADER_NAME
+  {
+    LIT_MAGIC_STRING__COUNT,
+    ECMA_BUILTIN_PROPERTY_END,
+    0,
+    0
+  }
+};
+
+#ifndef BUILTIN_CUSTOM_DISPATCH
+
+/**
+ * Dispatcher of the built-in's routines
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+DISPATCH_ROUTINE_ROUTINE_NAME (uint16_t builtin_routine_id, /**< built-in wide routine
+                                                                 identifier */
+                               ecma_value_t this_arg_value, /**< 'this' argument
+                                                                 value */
+                               const ecma_value_t arguments_list[], /**< list of arguments
+                                                                         passed to routine */
+                               ecma_length_t arguments_number) /**< length of
+                                                                    arguments' list */
+{
+  /* the arguments may be unused for some built-ins */
+  JERRY_UNUSED (this_arg_value);
+  JERRY_UNUSED (arguments_list);
+  JERRY_UNUSED (arguments_number);
+
+  switch (builtin_routine_id)
+  {
+#define ROUTINE_ARG(n) (arguments_number >= n ? arguments_list[n - 1] \
+                                              : ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED))
+#define ROUTINE_ARG_LIST_0
+#define ROUTINE_ARG_LIST_1 , ROUTINE_ARG(1)
+#define ROUTINE_ARG_LIST_2 ROUTINE_ARG_LIST_1, ROUTINE_ARG(2)
+#define ROUTINE_ARG_LIST_3 ROUTINE_ARG_LIST_2, ROUTINE_ARG(3)
+#define ROUTINE_ARG_LIST_NON_FIXED , arguments_list, arguments_number
+#define ROUTINE(name, c_function_name, args_number, length_prop_value) \
+       case ECMA_ROUTINE_ ## name ## c_function_name: \
+       { \
+         return c_function_name (this_arg_value ROUTINE_ARG_LIST_ ## args_number); \
+       }
+#define ACCESSOR_READ_WRITE(name, c_getter_func_name, c_setter_func_name, prop_attributes) \
+       case ECMA_ACCESSOR_ ## name ## c_getter_func_name: \
+       { \
+         return c_getter_func_name(this_arg_value); \
+       } \
+       case ECMA_ACCESSOR_ ## name ## c_setter_func_name: \
+       { \
+         return c_setter_func_name(this_arg_value ROUTINE_ARG_LIST_1); \
+       }
+#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes) \
+       case ECMA_ACCESSOR_ ## name ## c_getter_func_name: \
+       { \
+         return c_getter_func_name(this_arg_value); \
+       }
+#include BUILTIN_INC_HEADER_NAME
+#undef ROUTINE_ARG
+#undef ROUTINE_ARG_LIST_0
+#undef ROUTINE_ARG_LIST_1
+#undef ROUTINE_ARG_LIST_2
+#undef ROUTINE_ARG_LIST_3
+#undef ROUTINE_ARG_LIST_NON_FIXED
+
+    default:
+    {
+      JERRY_UNREACHABLE ();
+    }
+  }
+} /* DISPATCH_ROUTINE_ROUTINE_NAME */
+
+#endif /* !BUILTIN_CUSTOM_DISPATCH */
+
+#undef BUILTIN_INC_HEADER_NAME
+#undef BUILTIN_CUSTOM_DISPATCH
+#undef BUILTIN_UNDERSCORED_ID
+#undef DISPATCH_ROUTINE_ROUTINE_NAME
+#undef ECMA_BUILTIN_PROPERTY_NAME_INDEX
+#undef PASTE__
+#undef PASTE_
+#undef PASTE
+#undef PROPERTY_DESCRIPTOR_LIST_NAME
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-json.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-json.c
new file mode 100644 (file)
index 0000000..47748ba
--- /dev/null
@@ -0,0 +1,1842 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-array-object.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+#include "jrt-libc-includes.h"
+#include "lit-char-helpers.h"
+#include "lit-globals.h"
+
+#ifndef CONFIG_DISABLE_JSON_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-json.inc.h"
+#define BUILTIN_UNDERSCORED_ID json
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup json ECMA JSON object built-in
+ * @{
+ */
+
+/**
+ * JSON token type
+ */
+typedef enum
+{
+  invalid_token, /**< error token */
+  end_token, /**< end of stream reached */
+  number_token, /**< JSON number */
+  string_token, /**< JSON string */
+  null_token, /**< JSON null primitive value */
+  true_token, /**< JSON true primitive value */
+  false_token, /**< JSON false primitive value */
+  left_brace_token, /**< JSON left brace */
+  right_brace_token, /**< JSON right brace */
+  left_square_token, /**< JSON left square bracket */
+  comma_token, /**< JSON comma */
+  colon_token /**< JSON colon */
+} ecma_json_token_type_t;
+
+/**
+ * JSON token
+ */
+typedef struct
+{
+  ecma_json_token_type_t type; /**< type of the current token */
+  const lit_utf8_byte_t *current_p; /**< current position of the string processed by the parser */
+  const lit_utf8_byte_t *end_p; /**< end of the string processed by the parser */
+
+  /**
+   * Fields depending on type.
+   */
+  union
+  {
+    ecma_string_t *string_p; /**< when type is string_token it contains the string */
+    ecma_number_t number; /**< when type is number_token, it contains the value of the number */
+  } u;
+} ecma_json_token_t;
+
+/**
+ * Compare the string with an ID.
+ *
+ * @return true if the match is successful
+ */
+static bool
+ecma_builtin_json_check_id (const lit_utf8_byte_t *string_p, /**< start position */
+                            const lit_utf8_byte_t *end_p, /**< input end */
+                            const char *string_id_p) /**< string identifier */
+{
+  /*
+   * String comparison must not depend on lit_utf8_byte_t definition.
+   */
+  JERRY_ASSERT (*string_p == *string_id_p);
+
+  string_p++;
+  string_id_p++;
+
+  while (string_p < end_p)
+  {
+    if (*string_id_p == LIT_CHAR_NULL)
+    {
+      /* JSON lexer accepts input strings such as falsenull and
+       * returns with multiple tokens (false and null in this case).
+       * This is different from normal lexers, whose return with a
+       * single identifier. The falsenull input will still cause an
+       * error eventually, since a separator must always be present
+       * between two JSON values regardless of the current expression
+       * type. */
+      return true;
+    }
+
+    if (*string_p != *string_id_p)
+    {
+      return false;
+    }
+
+    string_p++;
+    string_id_p++;
+  }
+
+  return (*string_id_p == LIT_CHAR_NULL);
+} /* ecma_builtin_json_check_id */
+
+/**
+ * Parse and extract string token.
+ */
+static void
+ecma_builtin_json_parse_string (ecma_json_token_t *token_p) /**< token argument */
+{
+  const lit_utf8_byte_t *current_p = token_p->current_p;
+  const lit_utf8_byte_t *end_p = token_p->end_p;
+  bool has_escape_sequence = false;
+  lit_utf8_size_t buffer_size = 0;
+
+  /* First step: syntax checking. */
+  while (true)
+  {
+    if (current_p >= end_p || *current_p <= 0x1f)
+    {
+      return;
+    }
+
+    if (*current_p == LIT_CHAR_DOUBLE_QUOTE)
+    {
+      break;
+    }
+
+    if (*current_p == LIT_CHAR_BACKSLASH)
+    {
+      current_p++;
+      has_escape_sequence = true;
+
+      switch (*current_p)
+      {
+        case LIT_CHAR_DOUBLE_QUOTE:
+        case LIT_CHAR_SLASH:
+        case LIT_CHAR_BACKSLASH:
+        case LIT_CHAR_LOWERCASE_B:
+        case LIT_CHAR_LOWERCASE_F:
+        case LIT_CHAR_LOWERCASE_N:
+        case LIT_CHAR_LOWERCASE_R:
+        case LIT_CHAR_LOWERCASE_T:
+        {
+          break;
+        }
+        case LIT_CHAR_LOWERCASE_U:
+        {
+          ecma_char_t code_unit;
+
+          if (!(lit_read_code_unit_from_hex (current_p + 1, 4, &code_unit)))
+          {
+            return;
+          }
+
+          current_p += 5;
+
+          lit_utf8_byte_t char_buffer[LIT_UTF8_MAX_BYTES_IN_CODE_UNIT];
+          buffer_size += lit_code_unit_to_utf8 (code_unit, char_buffer);
+          continue;
+        }
+        default:
+        {
+          return;
+        }
+      }
+    }
+
+    buffer_size++;
+    current_p++;
+  }
+
+  token_p->type = string_token;
+
+  if (!has_escape_sequence)
+  {
+    token_p->u.string_p = ecma_new_ecma_string_from_utf8 (token_p->current_p, buffer_size);
+    token_p->current_p = current_p + 1;
+    return;
+  }
+
+  JMEM_DEFINE_LOCAL_ARRAY (buffer_p, buffer_size, lit_utf8_byte_t);
+
+  lit_utf8_byte_t *write_p = buffer_p;
+  current_p = token_p->current_p;
+
+  while (*current_p != LIT_CHAR_DOUBLE_QUOTE)
+  {
+    if (*current_p == LIT_CHAR_BACKSLASH)
+    {
+      current_p++;
+
+      lit_utf8_byte_t special_character;
+
+      switch (*current_p)
+      {
+        case LIT_CHAR_LOWERCASE_B:
+        {
+          special_character = LIT_CHAR_BS;
+          break;
+        }
+        case LIT_CHAR_LOWERCASE_F:
+        {
+          special_character = LIT_CHAR_FF;
+          break;
+        }
+        case LIT_CHAR_LOWERCASE_N:
+        {
+          special_character = LIT_CHAR_LF;
+          break;
+        }
+        case LIT_CHAR_LOWERCASE_R:
+        {
+          special_character = LIT_CHAR_CR;
+          break;
+        }
+        case LIT_CHAR_LOWERCASE_T:
+        {
+          special_character = LIT_CHAR_TAB;
+          break;
+        }
+        case LIT_CHAR_LOWERCASE_U:
+        {
+          ecma_char_t code_unit;
+
+          lit_read_code_unit_from_hex (current_p + 1, 4, &code_unit);
+
+          current_p += 5;
+          write_p += lit_code_unit_to_utf8 (code_unit, write_p);
+          continue;
+        }
+        default:
+        {
+          special_character = *current_p;
+          break;
+        }
+      }
+
+      *write_p++ = special_character;
+      current_p++;
+      continue;
+    }
+
+    *write_p++ = *current_p++;
+  }
+
+  JERRY_ASSERT (write_p == buffer_p + buffer_size);
+
+  token_p->u.string_p = ecma_new_ecma_string_from_utf8 (buffer_p, buffer_size);
+
+  JMEM_FINALIZE_LOCAL_ARRAY (buffer_p);
+
+  token_p->current_p = current_p + 1;
+} /* ecma_builtin_json_parse_string */
+
+/**
+ * Parse and extract string token.
+ */
+static void
+ecma_builtin_json_parse_number (ecma_json_token_t *token_p) /**< token argument */
+{
+  const lit_utf8_byte_t *current_p = token_p->current_p;
+  const lit_utf8_byte_t *end_p = token_p->end_p;
+  const lit_utf8_byte_t *start_p = current_p;
+
+  JERRY_ASSERT (current_p < end_p);
+
+  if (*current_p == LIT_CHAR_MINUS)
+  {
+    current_p++;
+  }
+
+  if (current_p >= end_p)
+  {
+    return;
+  }
+
+  if (*current_p == LIT_CHAR_0)
+  {
+    current_p++;
+
+    if (current_p < end_p && lit_char_is_decimal_digit (*current_p))
+    {
+      return;
+    }
+  }
+  else if (lit_char_is_decimal_digit (*current_p))
+  {
+    do
+    {
+      current_p++;
+    }
+    while (current_p < end_p && lit_char_is_decimal_digit (*current_p));
+  }
+
+  if (current_p < end_p && *current_p == LIT_CHAR_DOT)
+  {
+    current_p++;
+
+    if (current_p >= end_p || !lit_char_is_decimal_digit (*current_p))
+    {
+      return;
+    }
+
+    do
+    {
+      current_p++;
+    }
+    while (current_p < end_p && lit_char_is_decimal_digit (*current_p));
+  }
+
+  if (current_p < end_p && (*current_p == LIT_CHAR_LOWERCASE_E || *current_p == LIT_CHAR_UPPERCASE_E))
+  {
+    current_p++;
+
+    if (current_p < end_p && (*current_p == LIT_CHAR_PLUS || *current_p == LIT_CHAR_MINUS))
+    {
+      current_p++;
+    }
+
+    if (current_p >= end_p || !lit_char_is_decimal_digit (*current_p))
+    {
+      return;
+    }
+
+    do
+    {
+      current_p++;
+    }
+    while (current_p < end_p && lit_char_is_decimal_digit (*current_p));
+  }
+
+  token_p->type = number_token;
+  token_p->u.number = ecma_utf8_string_to_number (start_p, (lit_utf8_size_t) (current_p - start_p));
+
+  token_p->current_p = current_p;
+} /* ecma_builtin_json_parse_number */
+
+/**
+ * Parse next token.
+ *
+ * The function fills the fields of the ecma_json_token_t
+ * argument and advances the string pointer.
+ */
+static void
+ecma_builtin_json_parse_next_token (ecma_json_token_t *token_p, /**< token argument */
+                                    bool parse_string) /**< strings are allowed to parse */
+{
+  const lit_utf8_byte_t *current_p = token_p->current_p;
+  const lit_utf8_byte_t *end_p = token_p->end_p;
+  token_p->type = invalid_token;
+
+  while (current_p < end_p
+         && (*current_p == LIT_CHAR_SP
+             || *current_p == LIT_CHAR_CR
+             || *current_p == LIT_CHAR_LF
+             || *current_p == LIT_CHAR_TAB))
+  {
+    current_p++;
+  }
+
+  if (current_p == end_p)
+  {
+    token_p->type = end_token;
+    return;
+  }
+
+  switch (*current_p)
+  {
+    case LIT_CHAR_LEFT_BRACE:
+    {
+      token_p->type = left_brace_token;
+      token_p->current_p = current_p + 1;
+      return;
+    }
+    case LIT_CHAR_RIGHT_BRACE:
+    {
+      token_p->type = right_brace_token;
+      token_p->current_p = current_p + 1;
+      return;
+    }
+    case LIT_CHAR_LEFT_SQUARE:
+    {
+      token_p->type = left_square_token;
+      token_p->current_p = current_p + 1;
+      return;
+    }
+    case LIT_CHAR_COMMA:
+    {
+      token_p->type = comma_token;
+      token_p->current_p = current_p + 1;
+      return;
+    }
+    case LIT_CHAR_COLON:
+    {
+      token_p->type = colon_token;
+      token_p->current_p = current_p + 1;
+      return;
+    }
+    case LIT_CHAR_DOUBLE_QUOTE:
+    {
+      if (parse_string)
+      {
+        token_p->current_p = current_p + 1;
+        ecma_builtin_json_parse_string (token_p);
+      }
+      return;
+    }
+    case LIT_CHAR_LOWERCASE_N:
+    {
+      if (ecma_builtin_json_check_id (current_p, token_p->end_p, "null"))
+      {
+        token_p->type = null_token;
+        token_p->current_p = current_p + 4;
+        return;
+      }
+      break;
+    }
+    case LIT_CHAR_LOWERCASE_T:
+    {
+      if (ecma_builtin_json_check_id (current_p, token_p->end_p, "true"))
+      {
+        token_p->type = true_token;
+        token_p->current_p = current_p + 4;
+        return;
+      }
+      break;
+    }
+    case LIT_CHAR_LOWERCASE_F:
+    {
+      if (ecma_builtin_json_check_id (current_p, token_p->end_p, "false"))
+      {
+        token_p->type = false_token;
+        token_p->current_p = current_p + 5;
+        return;
+      }
+      break;
+    }
+    default:
+    {
+      if (*current_p == LIT_CHAR_MINUS || lit_char_is_decimal_digit (*current_p))
+      {
+        token_p->current_p = current_p;
+        ecma_builtin_json_parse_number (token_p);
+        return;
+      }
+      break;
+    }
+  }
+} /* ecma_builtin_json_parse_next_token */
+
+/**
+ * Checks whether the next token is right square token.
+ *
+ * @return true if it is.
+ *
+ * Always skips white spaces regardless the next token.
+ */
+static bool
+ecma_builtin_json_check_right_square_token (ecma_json_token_t *token_p) /**< token argument */
+{
+  const lit_utf8_byte_t *current_p = token_p->current_p;
+  const lit_utf8_byte_t *end_p = token_p->end_p;
+
+  /*
+   * No need for end check since the string is zero terminated.
+   */
+  while (current_p < end_p
+         && (*current_p == LIT_CHAR_SP
+             || *current_p == LIT_CHAR_CR
+             || *current_p == LIT_CHAR_LF
+             || *current_p == LIT_CHAR_TAB))
+  {
+    current_p++;
+  }
+
+  token_p->current_p = current_p;
+
+  if (current_p < end_p && *current_p == LIT_CHAR_RIGHT_SQUARE)
+  {
+    token_p->current_p = current_p + 1;
+    return true;
+  }
+
+  return false;
+} /* ecma_builtin_json_check_right_square_token */
+
+/**
+ * Utility for defining properties.
+ *
+ * It silently ignores all errors.
+ */
+static void
+ecma_builtin_json_define_value_property (ecma_object_t *obj_p, /**< this object */
+                                         ecma_string_t *property_name_p, /**< property name */
+                                         ecma_value_t value) /**< value */
+{
+  ecma_value_t completion_value = ecma_builtin_helper_def_prop (obj_p,
+                                                                property_name_p,
+                                                                value,
+                                                                true, /* Writable */
+                                                                true, /* Enumerable */
+                                                                true, /* Configurable */
+                                                                false); /* Failure handling */
+
+  JERRY_ASSERT (ecma_is_value_boolean (completion_value));
+} /* ecma_builtin_json_define_value_property */
+
+/**
+ * Parse next value.
+ *
+ * The function fills the fields of the ecma_json_token_t
+ * argument and advances the string pointer.
+ *
+ * @return ecma_value with the property value
+ */
+static ecma_value_t
+ecma_builtin_json_parse_value (ecma_json_token_t *token_p) /**< token argument */
+{
+  ecma_builtin_json_parse_next_token (token_p, true);
+
+  switch (token_p->type)
+  {
+    case number_token:
+    {
+      return ecma_make_number_value (token_p->u.number);
+    }
+    case string_token:
+    {
+      return ecma_make_string_value (token_p->u.string_p);
+    }
+    case null_token:
+    {
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+    }
+    case true_token:
+    {
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+    }
+    case false_token:
+    {
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+    }
+    case left_brace_token:
+    {
+      bool parse_comma = false;
+      ecma_object_t *object_p = ecma_op_create_object_object_noarg ();
+
+      while (true)
+      {
+        ecma_builtin_json_parse_next_token (token_p, !parse_comma);
+
+        if (token_p->type == right_brace_token)
+        {
+          return ecma_make_object_value (object_p);
+        }
+
+        if (parse_comma)
+        {
+          if (token_p->type != comma_token)
+          {
+            break;
+          }
+
+          ecma_builtin_json_parse_next_token (token_p, true);
+        }
+
+        if (token_p->type != string_token)
+        {
+          break;
+        }
+
+        ecma_string_t *name_p = token_p->u.string_p;
+
+        ecma_builtin_json_parse_next_token (token_p, false);
+
+        if (token_p->type != colon_token)
+        {
+          ecma_deref_ecma_string (name_p);
+          break;
+        }
+
+        ecma_value_t value = ecma_builtin_json_parse_value (token_p);
+
+        if (ecma_is_value_undefined (value))
+        {
+          ecma_deref_ecma_string (name_p);
+          break;
+        }
+
+        ecma_builtin_json_define_value_property (object_p, name_p, value);
+        ecma_deref_ecma_string (name_p);
+        ecma_free_value (value);
+
+        parse_comma = true;
+      }
+
+      /*
+       * Parse error occured.
+       */
+      ecma_deref_object (object_p);
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+    case left_square_token:
+    {
+      bool parse_comma = false;
+      uint32_t length = 0;
+
+      ecma_value_t array_construction = ecma_op_create_array_object (NULL, 0, false);
+      JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (array_construction));
+
+      ecma_object_t *array_p = ecma_get_object_from_value (array_construction);
+
+      while (true)
+      {
+        if (ecma_builtin_json_check_right_square_token (token_p))
+        {
+          return ecma_make_object_value (array_p);
+        }
+
+        if (parse_comma)
+        {
+          ecma_builtin_json_parse_next_token (token_p, false);
+
+          if (token_p->type != comma_token)
+          {
+            break;
+          }
+        }
+
+        ecma_value_t value = ecma_builtin_json_parse_value (token_p);
+
+        if (ecma_is_value_undefined (value))
+        {
+          break;
+        }
+
+        ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (length);
+
+        ecma_value_t completion = ecma_builtin_helper_def_prop (array_p,
+                                                                index_str_p,
+                                                                value,
+                                                                true, /* Writable */
+                                                                true, /* Enumerable */
+                                                                true, /* Configurable */
+                                                                false); /* Failure handling */
+
+        JERRY_ASSERT (ecma_is_value_true (completion));
+
+        ecma_deref_ecma_string (index_str_p);
+
+        ecma_free_value (value);
+
+        length++;
+        parse_comma = true;
+      }
+
+      /*
+       * Parse error occured.
+       */
+      ecma_deref_object (array_p);
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+    default:
+    {
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+  }
+} /* ecma_builtin_json_parse_value */
+
+/**
+ * Abstract operation Walk defined in 15.12.2
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_json_walk (ecma_object_t *reviver_p, /**< reviver function */
+                        ecma_object_t *holder_p, /**< holder object */
+                        ecma_string_t *name_p) /**< property name */
+{
+  JERRY_ASSERT (reviver_p);
+  JERRY_ASSERT (holder_p);
+  JERRY_ASSERT (name_p);
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (value_get,
+                  ecma_op_object_get (holder_p, name_p),
+                  ret_value);
+
+  if (ecma_is_value_object (value_get))
+  {
+    ecma_object_t *object_p = ecma_get_object_from_value (value_get);
+
+    ecma_collection_header_t *props_p = ecma_op_object_get_property_names (object_p, false, true, false);
+
+    ecma_collection_iterator_t iter;
+    ecma_collection_iterator_init (&iter, props_p);
+
+    while (ecma_collection_iterator_next (&iter)
+           && ecma_is_value_empty (ret_value))
+    {
+      ecma_string_t *property_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+      ECMA_TRY_CATCH (value_walk,
+                      ecma_builtin_json_walk (reviver_p,
+                                              object_p,
+                                              property_name_p),
+                      ret_value);
+
+      /*
+       * We cannot optimize this function since any members
+       * can be changed (deleted) by the reviver function.
+       */
+      if (ecma_is_value_undefined (value_walk))
+      {
+        ecma_value_t delete_val = ecma_op_general_object_delete (object_p,
+                                                                 property_name_p,
+                                                                 false);
+        JERRY_ASSERT (ecma_is_value_boolean (delete_val));
+      }
+      else
+      {
+        ecma_builtin_json_define_value_property (object_p,
+                                                 property_name_p,
+                                                 value_walk);
+      }
+
+      ECMA_FINALIZE (value_walk);
+    }
+
+    ecma_free_values_collection (props_p, true);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ecma_value_t arguments_list[2];
+
+    arguments_list[0] = ecma_make_string_value (name_p);
+    arguments_list[1] = value_get;
+
+    /*
+     * The completion value can be anything including exceptions.
+     */
+    ret_value = ecma_op_function_call (reviver_p,
+                                       ecma_make_object_value (holder_p),
+                                       arguments_list,
+                                       2);
+  }
+  else
+  {
+    JERRY_ASSERT (ECMA_IS_VALUE_ERROR (ret_value));
+  }
+
+  ECMA_FINALIZE (value_get);
+
+  return ret_value;
+} /* ecma_builtin_json_walk */
+
+/**
+ * The JSON object's 'parse' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_json_parse (ecma_value_t this_arg, /**< 'this' argument */
+                         ecma_value_t arg1, /**< string argument */
+                         ecma_value_t arg2) /**< reviver argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (string,
+                  ecma_op_to_string (arg1),
+                  ret_value);
+
+  const ecma_string_t *string_p = ecma_get_string_from_value (string);
+
+  ECMA_STRING_TO_UTF8_STRING (string_p, str_start_p, string_size);
+
+  ecma_json_token_t token;
+  token.current_p = str_start_p;
+  token.end_p = str_start_p + string_size;
+
+  ecma_value_t final_result = ecma_builtin_json_parse_value (&token);
+
+  if (!ecma_is_value_undefined (final_result))
+  {
+    ecma_builtin_json_parse_next_token (&token, false);
+
+    if (token.type != end_token)
+    {
+      ecma_free_value (final_result);
+      final_result = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+  }
+
+  if (ecma_is_value_undefined (final_result))
+  {
+    ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("JSON string parse error."));
+  }
+  else
+  {
+    if (ecma_op_is_callable (arg2))
+    {
+      ecma_object_t *object_p = ecma_op_create_object_object_noarg ();
+      ecma_string_t *name_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+
+      ecma_property_value_t *prop_value_p;
+      prop_value_p = ecma_create_named_data_property (object_p,
+                                                      name_p,
+                                                      ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
+                                                      NULL);
+
+      ecma_named_data_property_assign_value (object_p, prop_value_p, final_result);
+      ecma_free_value (final_result);
+
+      ret_value = ecma_builtin_json_walk (ecma_get_object_from_value (arg2),
+                                          object_p,
+                                          name_p);
+      ecma_deref_object (object_p);
+      ecma_deref_ecma_string (name_p);
+    }
+    else
+    {
+      ret_value = final_result;
+    }
+  }
+
+  ECMA_FINALIZE_UTF8_STRING (str_start_p, string_size);
+
+  ECMA_FINALIZE (string);
+  return ret_value;
+} /* ecma_builtin_json_parse */
+
+static ecma_value_t
+ecma_builtin_json_str (ecma_string_t *key_p, ecma_object_t *holder_p, ecma_json_stringify_context_t *context_p);
+
+static ecma_value_t
+ecma_builtin_json_object (ecma_object_t *obj_p, ecma_json_stringify_context_t *context_p);
+
+static ecma_value_t
+ecma_builtin_json_array (ecma_object_t *obj_p, ecma_json_stringify_context_t *context_p);
+
+/**
+ * The JSON object's 'stringify' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_json_stringify (ecma_value_t this_arg, /**< 'this' argument */
+                             ecma_value_t arg1,  /**< value */
+                             ecma_value_t arg2,  /**< replacer */
+                             ecma_value_t arg3)  /**< space */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ecma_json_stringify_context_t context;
+
+  /* 1. */
+  context.occurence_stack_p = ecma_new_values_collection (NULL, 0, false);
+
+  /* 2. */
+  context.indent_str_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+
+  /* 3. */
+  context.property_list_p = ecma_new_values_collection (NULL, 0, false);
+
+  context.replacer_function_p = NULL;
+
+  /* 4. */
+  if (ecma_is_value_object (arg2))
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg2);
+
+    /* 4.a */
+    if (ecma_op_is_callable (arg2))
+    {
+      context.replacer_function_p = obj_p;
+    }
+    /* 4.b */
+    else if (ecma_object_get_class_name (obj_p) == LIT_MAGIC_STRING_ARRAY_UL)
+    {
+      ecma_string_t *length_str_p = ecma_new_ecma_length_string ();
+
+      ECMA_TRY_CATCH (array_length,
+                      ecma_op_object_get (obj_p, length_str_p),
+                      ret_value);
+
+      ECMA_OP_TO_NUMBER_TRY_CATCH (array_length_num,
+                                   array_length,
+                                   ret_value);
+
+      uint32_t index = 0;
+
+      /* 4.b.ii */
+      while ((index < ecma_number_to_uint32 (array_length_num)) && ecma_is_value_empty (ret_value))
+      {
+        ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (index);
+
+        ECMA_TRY_CATCH (value,
+                        ecma_op_object_get (obj_p, index_str_p),
+                        ret_value);
+
+        /* 4.b.ii.1 */
+        ecma_value_t item = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+        /* 4.b.ii.2 */
+        if (ecma_is_value_string (value))
+        {
+          item = ecma_copy_value (value);
+        }
+        /* 4.b.ii.3 */
+        else if (ecma_is_value_number (value))
+        {
+          ECMA_TRY_CATCH (str_val,
+                          ecma_op_to_string (value),
+                          ret_value);
+
+          item = ecma_copy_value (str_val);
+
+          ECMA_FINALIZE (str_val);
+        }
+        /* 4.b.ii.4 */
+        else if (ecma_is_value_object (value))
+        {
+          ecma_object_t *obj_val_p = ecma_get_object_from_value (value);
+          lit_magic_string_id_t class_name = ecma_object_get_class_name (obj_val_p);
+
+          /* 4.b.ii.4.a */
+          if (class_name == LIT_MAGIC_STRING_NUMBER_UL
+              || class_name == LIT_MAGIC_STRING_STRING_UL)
+          {
+            ECMA_TRY_CATCH (val,
+                            ecma_op_to_string (value),
+                            ret_value);
+
+            item = ecma_copy_value (val);
+
+            ECMA_FINALIZE (val);
+          }
+        }
+
+        /* 4.b.ii.5 */
+        if (!ecma_is_value_undefined (item))
+        {
+          if (!ecma_has_string_value_in_collection (context.property_list_p, item))
+          {
+            ecma_append_to_values_collection (context.property_list_p, item, true);
+            ecma_deref_ecma_string (ecma_get_string_from_value (item));
+          }
+          else
+          {
+            ecma_free_value (item);
+          }
+        }
+
+        ECMA_FINALIZE (value);
+
+        ecma_deref_ecma_string (index_str_p);
+
+        index++;
+      }
+
+      ECMA_OP_TO_NUMBER_FINALIZE (array_length_num);
+      ECMA_FINALIZE (array_length);
+
+      ecma_deref_ecma_string (length_str_p);
+    }
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ecma_value_t space = ecma_copy_value (arg3);
+
+    /* 5. */
+    if (ecma_is_value_object (arg3))
+    {
+      ecma_object_t *obj_p = ecma_get_object_from_value (arg3);
+      lit_magic_string_id_t class_name = ecma_object_get_class_name (obj_p);
+
+      /* 5.a */
+      if (class_name == LIT_MAGIC_STRING_NUMBER_UL)
+      {
+        ECMA_TRY_CATCH (val,
+                        ecma_op_to_number (arg3),
+                        ret_value);
+
+        ecma_free_value (space);
+        space = ecma_copy_value (val);
+
+        ECMA_FINALIZE (val);
+      }
+      /* 5.b */
+      else if (class_name == LIT_MAGIC_STRING_STRING_UL)
+      {
+        ECMA_TRY_CATCH (val,
+                        ecma_op_to_string (arg3),
+                        ret_value);
+
+        ecma_free_value (space);
+        space = ecma_copy_value (val);
+
+        ECMA_FINALIZE (val);
+      }
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      /* 6. */
+      if (ecma_is_value_number (space))
+      {
+        ECMA_OP_TO_NUMBER_TRY_CATCH (array_length_num,
+                                     arg3,
+                                     ret_value);
+
+        /* 6.a */
+        int32_t num_of_spaces = ecma_number_to_int32 (array_length_num);
+        num_of_spaces = (num_of_spaces > 10) ? 10 : num_of_spaces;
+
+        /* 6.b */
+        if (num_of_spaces < 1)
+        {
+          context.gap_str_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+        }
+        else
+        {
+          JMEM_DEFINE_LOCAL_ARRAY (space_buff, num_of_spaces, char);
+
+          for (int32_t i = 0; i < num_of_spaces; i++)
+          {
+            space_buff[i] = LIT_CHAR_SP;
+          }
+
+          context.gap_str_p = ecma_new_ecma_string_from_utf8 ((lit_utf8_byte_t *) space_buff,
+                                                              (lit_utf8_size_t) num_of_spaces);
+
+          JMEM_FINALIZE_LOCAL_ARRAY (space_buff);
+        }
+
+        ECMA_OP_TO_NUMBER_FINALIZE (array_length_num);
+      }
+      /* 7. */
+      else if (ecma_is_value_string (space))
+      {
+        ecma_string_t *space_str_p = ecma_get_string_from_value (space);
+        ecma_length_t num_of_chars = ecma_string_get_length (space_str_p);
+
+        if (num_of_chars < 10)
+        {
+          ecma_ref_ecma_string (space_str_p);
+          context.gap_str_p = space_str_p;
+        }
+        else
+        {
+          context.gap_str_p = ecma_string_substr (space_str_p, 0, 10);
+        }
+      }
+      /* 8. */
+      else
+      {
+        context.gap_str_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+      }
+    }
+
+    ecma_free_value (space);
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      /* 9. */
+      ecma_object_t *obj_wrapper_p = ecma_op_create_object_object_noarg ();
+      ecma_string_t *empty_str_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+
+      /* 10. */
+      ecma_value_t put_comp_val = ecma_op_object_put (obj_wrapper_p,
+                                                      empty_str_p,
+                                                      arg1,
+                                                      false);
+
+      JERRY_ASSERT (ecma_is_value_true (put_comp_val));
+      ecma_free_value (put_comp_val);
+
+      /* 11. */
+      ECMA_TRY_CATCH (str_val,
+                      ecma_builtin_json_str (empty_str_p, obj_wrapper_p, &context),
+                      ret_value);
+
+      ret_value = ecma_copy_value (str_val);
+
+      ECMA_FINALIZE (str_val);
+
+      ecma_deref_object (obj_wrapper_p);
+      ecma_deref_ecma_string (empty_str_p);
+    }
+
+    ecma_deref_ecma_string (context.gap_str_p);
+  }
+
+  ecma_deref_ecma_string (context.indent_str_p);
+
+  ecma_free_values_collection (context.property_list_p, true);
+  ecma_free_values_collection (context.occurence_stack_p, true);
+
+  return ret_value;
+} /* ecma_builtin_json_stringify */
+
+/**
+ * Abstract operation 'Quote' defined in 15.12.3
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_json_quote (ecma_string_t *string_p) /**< string that should be quoted*/
+{
+  /* 1. */
+  ecma_string_t *quote_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_DOUBLE_QUOTE_CHAR);
+  ecma_ref_ecma_string (quote_str_p);
+  ecma_string_t *product_str_p = quote_str_p;
+  ecma_string_t *tmp_str_p;
+
+  ECMA_STRING_TO_UTF8_STRING (string_p, string_buff, string_buff_size);
+
+  const lit_utf8_byte_t *str_p = string_buff;
+  const lit_utf8_byte_t *str_end_p = string_buff + string_buff_size;
+
+  while (str_p < str_end_p)
+  {
+    ecma_char_t current_char = lit_utf8_read_next (&str_p);
+
+    /* 2.a */
+    if (current_char == LIT_CHAR_BACKSLASH || current_char == LIT_CHAR_DOUBLE_QUOTE)
+    {
+      ecma_string_t *backslash_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_BACKSLASH_CHAR);
+
+      /* 2.a.i */
+      tmp_str_p = ecma_concat_ecma_strings (product_str_p, backslash_str_p);
+      ecma_deref_ecma_string (product_str_p);
+      ecma_deref_ecma_string (backslash_str_p);
+      product_str_p = tmp_str_p;
+
+      /* 2.a.ii */
+      ecma_string_t *current_char_str_p = ecma_new_ecma_string_from_code_unit (current_char);
+
+      tmp_str_p = ecma_concat_ecma_strings (product_str_p, current_char_str_p);
+      ecma_deref_ecma_string (product_str_p);
+      ecma_deref_ecma_string (current_char_str_p);
+      product_str_p = tmp_str_p;
+    }
+    /* 2.b */
+    else if (current_char == LIT_CHAR_BS
+             || current_char == LIT_CHAR_FF
+             || current_char == LIT_CHAR_LF
+             || current_char == LIT_CHAR_CR
+             || current_char == LIT_CHAR_TAB)
+    {
+      ecma_string_t *backslash_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_BACKSLASH_CHAR);
+
+      /* 2.b.i */
+      tmp_str_p = ecma_concat_ecma_strings (product_str_p, backslash_str_p);
+      ecma_deref_ecma_string (product_str_p);
+      ecma_deref_ecma_string (backslash_str_p);
+      product_str_p = tmp_str_p;
+
+      /* 2.b.ii */
+      lit_utf8_byte_t abbrev = LIT_CHAR_SP;
+
+      switch (current_char)
+      {
+        case LIT_CHAR_BS:
+        {
+          abbrev = LIT_CHAR_LOWERCASE_B;
+          break;
+        }
+        case LIT_CHAR_FF:
+        {
+          abbrev = LIT_CHAR_LOWERCASE_F;
+          break;
+        }
+        case LIT_CHAR_LF:
+        {
+          abbrev = LIT_CHAR_LOWERCASE_N;
+          break;
+        }
+        case LIT_CHAR_CR:
+        {
+          abbrev = LIT_CHAR_LOWERCASE_R;
+          break;
+        }
+        case LIT_CHAR_TAB:
+        {
+          abbrev = LIT_CHAR_LOWERCASE_T;
+          break;
+        }
+      }
+
+      /* 2.b.iii */
+      ecma_string_t *abbrev_str_p = ecma_new_ecma_string_from_utf8 (&abbrev, 1);
+
+      tmp_str_p = ecma_concat_ecma_strings (product_str_p, abbrev_str_p);
+      ecma_deref_ecma_string (product_str_p);
+      ecma_deref_ecma_string (abbrev_str_p);
+      product_str_p = tmp_str_p;
+    }
+    /* 2.c */
+    else if (current_char < LIT_CHAR_SP)
+    {
+      ecma_string_t *backslash_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_BACKSLASH_CHAR);
+
+      /* 2.c.i */
+      tmp_str_p = ecma_concat_ecma_strings (product_str_p, backslash_str_p);
+      ecma_deref_ecma_string (product_str_p);
+      ecma_deref_ecma_string (backslash_str_p);
+      product_str_p = tmp_str_p;
+
+      /* 2.c.ii */
+      lit_utf8_byte_t u_ch = LIT_CHAR_LOWERCASE_U;
+      ecma_string_t *u_ch_str_p = ecma_new_ecma_string_from_utf8 (&u_ch, 1);
+
+      tmp_str_p = ecma_concat_ecma_strings (product_str_p, u_ch_str_p);
+      ecma_deref_ecma_string (product_str_p);
+      ecma_deref_ecma_string (u_ch_str_p);
+      product_str_p = tmp_str_p;
+
+      /* 2.c.iii */
+      ecma_string_t *hex_str_p = ecma_builtin_helper_json_create_hex_digit_ecma_string ((uint8_t) current_char);
+
+      /* 2.c.iv */
+      tmp_str_p = ecma_concat_ecma_strings (product_str_p, hex_str_p);
+      ecma_deref_ecma_string (product_str_p);
+      ecma_deref_ecma_string (hex_str_p);
+      product_str_p = tmp_str_p;
+    }
+    /* 2.d */
+    else
+    {
+      ecma_string_t *current_char_str_p = ecma_new_ecma_string_from_code_unit (current_char);
+
+      tmp_str_p = ecma_concat_ecma_strings (product_str_p, current_char_str_p);
+      ecma_deref_ecma_string (product_str_p);
+      ecma_deref_ecma_string (current_char_str_p);
+      product_str_p = tmp_str_p;
+    }
+  }
+
+  ECMA_FINALIZE_UTF8_STRING (string_buff, string_buff_size);
+
+  /* 3. */
+  tmp_str_p = ecma_concat_ecma_strings (product_str_p, quote_str_p);
+  ecma_deref_ecma_string (product_str_p);
+  ecma_deref_ecma_string (quote_str_p);
+  product_str_p = tmp_str_p;
+
+  /* 4. */
+  return ecma_make_string_value (product_str_p);
+} /* ecma_builtin_json_quote */
+
+/**
+ * Abstract operation 'Str' defined in 15.12.3
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_json_str (ecma_string_t *key_p, /**< property key*/
+                       ecma_object_t *holder_p, /**< the object*/
+                       ecma_json_stringify_context_t *context_p) /**< context*/
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (value,
+                  ecma_op_object_get (holder_p, key_p),
+                  ret_value);
+
+  ecma_value_t my_val = ecma_copy_value (value);
+
+  /* 2. */
+  if (ecma_is_value_object (my_val))
+  {
+    ecma_object_t *value_obj_p = ecma_get_object_from_value (my_val);
+    ecma_string_t *to_json_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_TO_JSON_UL);
+
+    /* 2.a */
+    ECMA_TRY_CATCH (toJSON,
+                    ecma_op_object_get (value_obj_p, to_json_str_p),
+                    ret_value);
+
+    /* 2.b */
+    if (ecma_op_is_callable (toJSON))
+    {
+      ecma_value_t key_value = ecma_make_string_value (key_p);
+      ecma_value_t call_args[] = { key_value };
+      ecma_object_t *toJSON_obj_p = ecma_get_object_from_value (toJSON);
+
+      ECMA_TRY_CATCH (func_ret_val,
+                      ecma_op_function_call (toJSON_obj_p, my_val, call_args, 1),
+                      ret_value);
+
+      ecma_free_value (my_val);
+      my_val = ecma_copy_value (func_ret_val);
+
+      ECMA_FINALIZE (func_ret_val);
+    }
+
+    ECMA_FINALIZE (toJSON);
+
+    ecma_deref_ecma_string (to_json_str_p);
+  }
+
+  /* 3. */
+  if (context_p->replacer_function_p && ecma_is_value_empty (ret_value))
+  {
+    ecma_value_t holder_value = ecma_make_object_value (holder_p);
+    ecma_value_t key_value = ecma_make_string_value (key_p);
+    ecma_value_t call_args[] = { key_value, my_val };
+
+    ECMA_TRY_CATCH (func_ret_val,
+                    ecma_op_function_call (context_p->replacer_function_p, holder_value, call_args, 2),
+                    ret_value);
+
+    ecma_free_value (my_val);
+    my_val = ecma_copy_value (func_ret_val);
+
+    ECMA_FINALIZE (func_ret_val);
+  }
+
+  /* 4. */
+  if (ecma_is_value_object (my_val) && ecma_is_value_empty (ret_value))
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (my_val);
+    lit_magic_string_id_t class_name = ecma_object_get_class_name (obj_p);
+
+    /* 4.a */
+    if (class_name == LIT_MAGIC_STRING_NUMBER_UL)
+    {
+      ECMA_TRY_CATCH (val,
+                      ecma_op_to_number (my_val),
+                      ret_value);
+
+      ecma_free_value (my_val);
+      my_val = ecma_copy_value (val);
+
+      ECMA_FINALIZE (val);
+    }
+    /* 4.b */
+    else if (class_name == LIT_MAGIC_STRING_STRING_UL)
+    {
+      ECMA_TRY_CATCH (val,
+                      ecma_op_to_string (my_val),
+                      ret_value);
+
+      ecma_free_value (my_val);
+      my_val = ecma_copy_value (val);
+
+      ECMA_FINALIZE (val);
+    }
+    /* 4.c */
+    else if (class_name == LIT_MAGIC_STRING_BOOLEAN_UL)
+    {
+      ECMA_TRY_CATCH (val,
+                      ecma_op_to_primitive (my_val, ECMA_PREFERRED_TYPE_NO),
+                      ret_value);
+
+      ecma_free_value (my_val);
+      my_val = ecma_copy_value (val);
+
+      ECMA_FINALIZE (val);
+    }
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    /* 5. - 7. */
+    if (ecma_is_value_null (my_val) || ecma_is_value_boolean (my_val))
+    {
+      ret_value = ecma_op_to_string (my_val);
+      JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (ret_value));
+    }
+    /* 8. */
+    else if (ecma_is_value_string (my_val))
+    {
+      ecma_string_t *value_str_p = ecma_get_string_from_value (my_val);
+      ret_value = ecma_builtin_json_quote (value_str_p);
+    }
+    /* 9. */
+    else if (ecma_is_value_number (my_val))
+    {
+      ecma_number_t num_value_p = ecma_get_number_from_value (my_val);
+
+      /* 9.a */
+      if (!ecma_number_is_nan (num_value_p) && !ecma_number_is_infinity (num_value_p))
+      {
+        ret_value = ecma_op_to_string (my_val);
+        JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (ret_value));
+      }
+      else
+      {
+        /* 9.b */
+        ecma_string_t *null_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_NULL);
+        ret_value = ecma_make_string_value (null_str_p);
+      }
+    }
+    /* 10. */
+    else if (ecma_is_value_object (my_val) && !ecma_op_is_callable (my_val))
+    {
+      ecma_object_t *obj_p = ecma_get_object_from_value (my_val);
+      lit_magic_string_id_t class_name = ecma_object_get_class_name (obj_p);
+
+      /* 10.a */
+      if (class_name == LIT_MAGIC_STRING_ARRAY_UL)
+      {
+        ECMA_TRY_CATCH (val,
+                        ecma_builtin_json_array (obj_p, context_p),
+                        ret_value);
+
+        ret_value = ecma_copy_value (val);
+
+        ECMA_FINALIZE (val);
+      }
+      /* 10.b */
+      else
+      {
+        ECMA_TRY_CATCH (val,
+                        ecma_builtin_json_object (obj_p, context_p),
+                        ret_value);
+
+        ret_value = ecma_copy_value (val);
+
+        ECMA_FINALIZE (val);
+      }
+    }
+    else
+    {
+      /* 11. */
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+  }
+
+  ecma_free_value (my_val);
+  ECMA_FINALIZE (value);
+
+  return ret_value;
+} /* ecma_builtin_json_str */
+
+/**
+ * Abstract operation 'JO' defined in 15.12.3
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_json_object (ecma_object_t *obj_p, /**< the object*/
+                          ecma_json_stringify_context_t *context_p) /**< context*/
+{
+  ecma_value_t obj_value = ecma_make_object_value (obj_p);
+
+  /* 1. */
+  if (ecma_has_object_value_in_collection (context_p->occurence_stack_p, obj_value))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("The structure is cyclical."));
+  }
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 2. */
+  ecma_append_to_values_collection (context_p->occurence_stack_p, obj_value, true);
+
+  /* 3. */
+  ecma_string_t *stepback_p = context_p->indent_str_p;
+
+  /* 4. */
+  context_p->indent_str_p = ecma_concat_ecma_strings (context_p->indent_str_p, context_p->gap_str_p);
+
+  ecma_collection_header_t *property_keys_p;
+
+  /* 5. */
+  if (context_p->property_list_p->unit_number > 0)
+  {
+    property_keys_p = context_p->property_list_p;
+  }
+  /* 6. */
+  else
+  {
+    property_keys_p = ecma_new_values_collection (NULL, 0, true);
+
+    ecma_collection_header_t *props_p = ecma_op_object_get_property_names (obj_p, false, true, false);
+
+    ecma_collection_iterator_t iter;
+    ecma_collection_iterator_init (&iter, props_p);
+
+    while (ecma_collection_iterator_next (&iter))
+    {
+      ecma_string_t *property_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+      ecma_property_t property = ecma_op_object_get_own_property (obj_p,
+                                                                  property_name_p,
+                                                                  NULL,
+                                                                  ECMA_PROPERTY_GET_NO_OPTIONS);
+
+      JERRY_ASSERT (ecma_is_property_enumerable (property));
+
+      if (ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDDATA)
+      {
+        ecma_append_to_values_collection (property_keys_p, *iter.current_value_p, true);
+      }
+    }
+
+    ecma_free_values_collection (props_p, true);
+  }
+
+  /* 7. */
+  ecma_collection_header_t *partial_p = ecma_new_values_collection (NULL, 0, true);
+
+  /* 8. */
+  ecma_collection_iterator_t iterator;
+  ecma_collection_iterator_init (&iterator, property_keys_p);
+
+  while (ecma_collection_iterator_next (&iterator) && ecma_is_value_empty (ret_value))
+  {
+    ecma_value_t value = *iterator.current_value_p;
+    ecma_string_t *key_p = ecma_get_string_from_value (value);
+
+    /* 8.a */
+    ECMA_TRY_CATCH (str_val,
+                    ecma_builtin_json_str (key_p, obj_p, context_p),
+                    ret_value);
+
+    /* 8.b */
+    if (!ecma_is_value_undefined (str_val))
+    {
+      ecma_string_t *colon_p = ecma_get_magic_string (LIT_MAGIC_STRING_COLON_CHAR);
+      ecma_string_t *value_str_p = ecma_get_string_from_value (str_val);
+      ecma_string_t *tmp_str_p;
+
+      /* 8.b.i */
+      ecma_value_t str_comp_val = ecma_builtin_json_quote (key_p);
+      JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (str_comp_val));
+
+      ecma_string_t *member_str_p = ecma_get_string_from_value (str_comp_val);
+
+      /* 8.b.ii */
+      tmp_str_p = ecma_concat_ecma_strings (member_str_p, colon_p);
+      ecma_free_value (str_comp_val);
+      ecma_deref_ecma_string (colon_p);
+      member_str_p = tmp_str_p;
+
+      /* 8.b.iii */
+      if (!ecma_string_is_empty (context_p->gap_str_p))
+      {
+        ecma_string_t *space_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_SPACE_CHAR);
+
+        tmp_str_p = ecma_concat_ecma_strings (member_str_p, space_str_p);
+        ecma_deref_ecma_string (member_str_p);
+        ecma_deref_ecma_string (space_str_p);
+        member_str_p = tmp_str_p;
+      }
+
+      /* 8.b.iv */
+      tmp_str_p = ecma_concat_ecma_strings (member_str_p, value_str_p);
+      ecma_deref_ecma_string (member_str_p);
+      member_str_p = tmp_str_p;
+
+      /* 8.b.v */
+      ecma_value_t member_value = ecma_make_string_value (member_str_p);
+      ecma_append_to_values_collection (partial_p, member_value, true);
+      ecma_deref_ecma_string (member_str_p);
+    }
+
+    ECMA_FINALIZE (str_val);
+  }
+
+  if (context_p->property_list_p->unit_number == 0)
+  {
+    ecma_free_values_collection (property_keys_p, true);
+  }
+
+  if (!ecma_is_value_empty (ret_value))
+  {
+    ecma_free_values_collection (partial_p, true);
+    ecma_deref_ecma_string (stepback_p);
+    return ret_value;
+  }
+
+  /* 9. */
+  if (partial_p->unit_number == 0)
+  {
+    ecma_string_t *left_brace_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LEFT_BRACE_CHAR);
+    ecma_string_t *right_brace_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_RIGHT_BRACE_CHAR);
+
+    ecma_string_t *final_str_p = ecma_concat_ecma_strings (left_brace_str_p, right_brace_str_p);
+    ret_value = ecma_make_string_value (final_str_p);
+
+    ecma_deref_ecma_string (left_brace_str_p);
+    ecma_deref_ecma_string (right_brace_str_p);
+  }
+  /* 10. */
+  else
+  {
+    /* 10.a */
+    if (ecma_string_is_empty (context_p->gap_str_p))
+    {
+      ecma_string_t *left_brace_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LEFT_BRACE_CHAR);
+      ecma_string_t *right_brace_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_RIGHT_BRACE_CHAR);
+
+      ret_value = ecma_builtin_helper_json_create_non_formatted_json (left_brace_str_p,
+                                                                      right_brace_str_p,
+                                                                      partial_p);
+
+      ecma_deref_ecma_string (left_brace_str_p);
+      ecma_deref_ecma_string (right_brace_str_p);
+    }
+    /* 10.b */
+    else
+    {
+      ecma_string_t *left_brace_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LEFT_BRACE_CHAR);
+      ecma_string_t *right_brace_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_RIGHT_BRACE_CHAR);
+
+      ret_value = ecma_builtin_helper_json_create_formatted_json (left_brace_str_p,
+                                                                  right_brace_str_p,
+                                                                  stepback_p,
+                                                                  partial_p,
+                                                                  context_p);
+
+      ecma_deref_ecma_string (left_brace_str_p);
+      ecma_deref_ecma_string (right_brace_str_p);
+    }
+  }
+
+  ecma_free_values_collection (partial_p, true);
+
+  /* 11. */
+  ecma_remove_last_value_from_values_collection (context_p->occurence_stack_p);
+
+  /* 12. */
+  ecma_deref_ecma_string (context_p->indent_str_p);
+  context_p->indent_str_p = stepback_p;
+
+  /* 13. */
+  return ret_value;
+} /* ecma_builtin_json_object */
+
+/**
+ * Abstract operation 'JA' defined in 15.12.3
+ *
+ * See also:
+ *          ECMA-262 v5, 15.12.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_json_array (ecma_object_t *obj_p, /**< the array object*/
+                         ecma_json_stringify_context_t *context_p) /**< context*/
+{
+  ecma_value_t obj_value = ecma_make_object_value (obj_p);
+
+  /* 1. */
+  if (ecma_has_object_value_in_collection (context_p->occurence_stack_p, obj_value))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("The structure is cyclical."));
+  }
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 2. */
+  ecma_append_to_values_collection (context_p->occurence_stack_p, obj_value, true);
+
+  /* 3. */
+  ecma_string_t *stepback_p = context_p->indent_str_p;
+
+  /* 4. */
+  context_p->indent_str_p = ecma_concat_ecma_strings (context_p->indent_str_p, context_p->gap_str_p);
+
+  /* 5. */
+  ecma_collection_header_t *partial_p = ecma_new_values_collection (NULL, 0, true);
+
+  ecma_string_t *length_str_p = ecma_new_ecma_length_string ();
+
+  /* 6. */
+  ECMA_TRY_CATCH (array_length,
+                  ecma_op_object_get (obj_p, length_str_p),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (array_length_num,
+                               array_length,
+                               ret_value);
+
+  /* 7. - 8. */
+  for (uint32_t index = 0;
+       index < ecma_number_to_uint32 (array_length_num) && ecma_is_value_empty (ret_value);
+       index++)
+  {
+
+    /* 8.a */
+    ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (index);
+
+    ECMA_TRY_CATCH (str_val,
+                    ecma_builtin_json_str (index_str_p, obj_p, context_p),
+                    ret_value);
+
+    /* 8.b */
+    if (ecma_is_value_undefined (str_val))
+    {
+      ecma_string_t *null_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_NULL);
+      ecma_append_to_values_collection (partial_p, ecma_make_string_value (null_str_p), true);
+      ecma_deref_ecma_string (null_str_p);
+    }
+    /* 8.c */
+    else
+    {
+      ecma_append_to_values_collection (partial_p, str_val, true);
+    }
+
+    ECMA_FINALIZE (str_val);
+    ecma_deref_ecma_string (index_str_p);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    /* 9. */
+    if (partial_p->unit_number == 0)
+    {
+      ecma_string_t *left_square_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LEFT_SQUARE_CHAR);
+      ecma_string_t *right_square_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_RIGHT_SQUARE_CHAR);
+
+      ecma_string_t *final_str_p = ecma_concat_ecma_strings (left_square_str_p, right_square_str_p);
+      ret_value = ecma_make_string_value (final_str_p);
+
+      ecma_deref_ecma_string (left_square_str_p);
+      ecma_deref_ecma_string (right_square_str_p);
+    }
+    /* 10. */
+    else
+    {
+      /* 10.a */
+      if (ecma_string_is_empty (context_p->gap_str_p))
+      {
+        ecma_string_t *left_square_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LEFT_SQUARE_CHAR);
+        ecma_string_t *right_square_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_RIGHT_SQUARE_CHAR);
+
+        ret_value = ecma_builtin_helper_json_create_non_formatted_json (left_square_str_p,
+                                                                        right_square_str_p,
+                                                                        partial_p);
+
+        ecma_deref_ecma_string (left_square_str_p);
+        ecma_deref_ecma_string (right_square_str_p);
+      }
+      /* 10.b */
+      else
+      {
+        ecma_string_t *left_square_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LEFT_SQUARE_CHAR);
+        ecma_string_t *right_square_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_RIGHT_SQUARE_CHAR);
+
+        ret_value = ecma_builtin_helper_json_create_formatted_json (left_square_str_p,
+                                                                    right_square_str_p,
+                                                                    stepback_p,
+                                                                    partial_p,
+                                                                    context_p);
+
+        ecma_deref_ecma_string (left_square_str_p);
+        ecma_deref_ecma_string (right_square_str_p);
+      }
+    }
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (array_length_num);
+  ECMA_FINALIZE (array_length);
+
+  ecma_deref_ecma_string (length_str_p);
+  ecma_free_values_collection (partial_p, true);
+
+  /* 11. */
+  ecma_remove_last_value_from_values_collection (context_p->occurence_stack_p);
+
+  /* 12. */
+  ecma_deref_ecma_string (context_p->indent_str_p);
+  context_p->indent_str_p = stepback_p;
+
+  /* 13. */
+  return ret_value;
+} /* ecma_builtin_json_array */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-json.inc.h
new file mode 100644 (file)
index 0000000..8a3a802
--- /dev/null
@@ -0,0 +1,31 @@
+/* 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.
+ */
+
+/*
+ * JSON built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_JSON_BUILTIN
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_PARSE, ecma_builtin_json_parse, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_STRINGIFY, ecma_builtin_json_stringify, 3, 3)
+
+#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-math.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-math.c
new file mode 100644 (file)
index 0000000..afe62d5
--- /dev/null
@@ -0,0 +1,376 @@
+/* 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.
+ */
+
+#include <math.h>
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-number-arithmetic.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+#include "jrt-libc-includes.h"
+
+#ifndef CONFIG_DISABLE_MATH_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+/**
+ * This object has a custom dispatch function.
+ */
+#define BUILTIN_CUSTOM_DISPATCH
+
+/**
+ * List of built-in routine identifiers.
+ */
+enum
+{
+  ECMA_MATH_OBJECT_ROUTINE_START = ECMA_BUILTIN_ID__COUNT - 1,
+
+  ECMA_MATH_OBJECT_ABS, /* ECMA-262 v5, 15.8.2.1 */
+  ECMA_MATH_OBJECT_ACOS, /* ECMA-262 v5, 15.8.2.2 */
+  ECMA_MATH_OBJECT_ASIN, /* ECMA-262 v5, 15.8.2.3 */
+  ECMA_MATH_OBJECT_ATAN, /* ECMA-262 v5, 15.8.2.4 */
+  ECMA_MATH_OBJECT_CEIL, /* ECMA-262 v5, 15.8.2.6 */
+  ECMA_MATH_OBJECT_COS, /* ECMA-262 v5, 15.8.2.7 */
+  ECMA_MATH_OBJECT_EXP, /* ECMA-262 v5, 15.8.2.8 */
+  ECMA_MATH_OBJECT_FLOOR, /* ECMA-262 v5, 15.8.2.9 */
+  ECMA_MATH_OBJECT_LOG, /* ECMA-262 v5, 15.8.2.10 */
+  ECMA_MATH_OBJECT_ROUND, /* ECMA-262 v5, 15.8.2.15 */
+  ECMA_MATH_OBJECT_SIN, /* ECMA-262 v5, 15.8.2.16 */
+  ECMA_MATH_OBJECT_SQRT, /* ECMA-262 v5, 15.8.2.17 */
+  ECMA_MATH_OBJECT_TAN, /* ECMA-262 v5, 15.8.2.18 */
+
+  ECMA_MATH_OBJECT_ATAN2, /* ECMA-262 v5, 15.8.2.5 */
+  ECMA_MATH_OBJECT_POW, /* ECMA-262 v5, 15.8.2.13 */
+
+  ECMA_MATH_OBJECT_MAX, /* ECMA-262 v5, 15.8.2.11 */
+  ECMA_MATH_OBJECT_MIN, /* ECMA-262 v5, 15.8.2.12 */
+
+  ECMA_MATH_OBJECT_RANDOM, /* ECMA-262 v5, 15.8.2.14 */
+};
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-math.inc.h"
+#define BUILTIN_UNDERSCORED_ID math
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup object ECMA Object object built-in
+ * @{
+ */
+
+/**
+ * The Math object's 'max' 'min' routines.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.8.2.11
+ *          ECMA-262 v5, 15.8.2.12
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_math_object_max_min (bool is_max, /**< 'max' or 'min' operation */
+                                  const ecma_value_t *arg, /**< arguments list */
+                                  ecma_length_t args_number) /**< number of arguments */
+{
+  ecma_number_t result_num = ecma_number_make_infinity (is_max);
+
+  while (args_number > 0)
+  {
+    ecma_number_t arg_num;
+
+    if (ecma_is_value_number (*arg))
+    {
+      arg_num = ecma_get_number_from_value (*arg);
+    }
+    else
+    {
+      ecma_value_t value = ecma_op_to_number (*arg);
+
+      if (ECMA_IS_VALUE_ERROR (value))
+      {
+        return value;
+      }
+
+      arg_num = ecma_get_number_from_value (value);
+
+      ecma_fast_free_value (value);
+    }
+
+    if (unlikely (ecma_number_is_nan (arg_num)))
+    {
+      result_num = arg_num;
+      break;
+    }
+
+    if (ecma_number_is_zero (arg_num)
+        && ecma_number_is_zero (result_num))
+    {
+      bool is_negative = ecma_number_is_negative (arg_num);
+
+      if (is_max ? !is_negative : is_negative)
+      {
+        result_num = arg_num;
+      }
+    }
+    else
+    {
+      if (is_max ? (arg_num > result_num) : (arg_num < result_num))
+      {
+        result_num = arg_num;
+      }
+    }
+
+    arg++;
+    args_number--;
+  }
+
+  return ecma_make_number_value (result_num);
+} /* ecma_builtin_math_object_max_min */
+
+/**
+ * The Math object's 'random' routine.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.8.2.14
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_math_object_random (void)
+{
+  const ecma_number_t rand_max = (ecma_number_t) RAND_MAX;
+  const ecma_number_t rand_max_min_1 = (ecma_number_t) (RAND_MAX - 1);
+
+  return ecma_make_number_value (((ecma_number_t) rand ()) / rand_max * rand_max_min_1 / rand_max);
+} /* ecma_builtin_math_object_random */
+
+/**
+ * Dispatcher for the built-in's routines.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_math_dispatch_routine (uint16_t builtin_routine_id, /**< built-in wide routine
+                                                                  *   identifier */
+                                    ecma_value_t this_arg, /**< 'this' argument value */
+                                    const ecma_value_t arguments_list[], /**< list of arguments
+                                                                          *   passed to routine */
+                                    ecma_length_t arguments_number) /**< length of arguments' list */
+{
+  JERRY_UNUSED (this_arg);
+
+  if (builtin_routine_id <= ECMA_MATH_OBJECT_POW)
+  {
+    ecma_number_t x = ecma_number_make_nan ();
+    ecma_number_t y = ecma_number_make_nan ();
+
+    if (arguments_number >= 1)
+    {
+      if (ecma_is_value_number (arguments_list[0]))
+      {
+        x = ecma_get_number_from_value (arguments_list[0]);
+      }
+      else
+      {
+        ecma_value_t value = ecma_op_to_number (arguments_list[0]);
+
+        if (ECMA_IS_VALUE_ERROR (value))
+        {
+          return value;
+        }
+
+        x = ecma_get_number_from_value (value);
+
+        ecma_fast_free_value (value);
+      }
+    }
+
+    if (builtin_routine_id >= ECMA_MATH_OBJECT_ATAN2)
+    {
+      if (arguments_number >= 2)
+      {
+        if (ecma_is_value_number (arguments_list[1]))
+        {
+          y = ecma_get_number_from_value (arguments_list[1]);
+        }
+        else
+        {
+          ecma_value_t value = ecma_op_to_number (arguments_list[1]);
+
+          if (ECMA_IS_VALUE_ERROR (value))
+          {
+            return value;
+          }
+
+          y = ecma_get_number_from_value (value);
+
+          ecma_fast_free_value (value);
+        }
+      }
+    }
+
+    switch (builtin_routine_id)
+    {
+      case ECMA_MATH_OBJECT_ABS:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (fabs (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_ACOS:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (acos (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_ASIN:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (asin (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_ATAN:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (atan (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_CEIL:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (ceil (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_COS:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (cos (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_EXP:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (exp (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_FLOOR:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (floor (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_LOG:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (log (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_ROUND:
+      {
+        if (ecma_number_is_nan (x)
+            || ecma_number_is_zero (x)
+            || ecma_number_is_infinity (x))
+        {
+          /* Do nothing. */
+        }
+        else if (ecma_number_is_negative (x)
+                 && x >= -ECMA_NUMBER_HALF)
+        {
+          x = ecma_number_negate (ECMA_NUMBER_ZERO);
+        }
+        else
+        {
+          const ecma_number_t up_half = x + ECMA_NUMBER_HALF;
+          const ecma_number_t down_half = x - ECMA_NUMBER_HALF;
+          const ecma_number_t up_rounded = up_half - ecma_op_number_remainder (up_half, ECMA_NUMBER_ONE);
+          const ecma_number_t down_rounded = down_half - ecma_op_number_remainder (down_half, ECMA_NUMBER_ONE);
+
+          if (up_rounded - x <= x - down_rounded)
+          {
+            x = up_rounded;
+          }
+          else
+          {
+            x = down_rounded;
+          }
+        }
+        break;
+      }
+      case ECMA_MATH_OBJECT_SIN:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (sin (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_SQRT:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (sqrt (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_TAN:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (tan (x));
+        break;
+      }
+      case ECMA_MATH_OBJECT_ATAN2:
+      {
+        x = DOUBLE_TO_ECMA_NUMBER_T (atan2 (x, y));
+        break;
+      }
+      case ECMA_MATH_OBJECT_POW:
+      {
+        if (ecma_number_is_nan (y) ||
+            (ecma_number_is_infinity (y) && (x == 1.0 || x == -1.0)))
+        {
+          /* Handle differences between ES5.1 and ISO C standards for pow. */
+          x = ecma_number_make_nan ();
+        }
+        else
+        {
+          x = DOUBLE_TO_ECMA_NUMBER_T (pow (x, y));
+        }
+        break;
+      }
+    }
+
+    return ecma_make_number_value (x);
+  }
+
+  if (builtin_routine_id <= ECMA_MATH_OBJECT_MIN)
+  {
+    return ecma_builtin_math_object_max_min (builtin_routine_id == ECMA_MATH_OBJECT_MAX,
+                                             arguments_list,
+                                             arguments_number);
+  }
+
+
+  JERRY_ASSERT (builtin_routine_id == ECMA_MATH_OBJECT_RANDOM);
+
+  return ecma_builtin_math_object_random ();
+} /* ecma_builtin_math_dispatch_routine */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_MATH_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-math.inc.h
new file mode 100644 (file)
index 0000000..63f7f64
--- /dev/null
@@ -0,0 +1,90 @@
+/* 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.
+ */
+
+/*
+ * Math built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_MATH_BUILTIN
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.8.1.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_E_U,
+              ECMA_BUILTIN_NUMBER_E,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.8.1.2 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LN10_U,
+              ECMA_BUILTIN_NUMBER_LN10,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.8.1.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LN2_U,
+              ECMA_BUILTIN_NUMBER_LN2,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.8.1.4 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LOG2E_U,
+              ECMA_BUILTIN_NUMBER_LOG2E,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.8.1.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LOG10E_U,
+              ECMA_BUILTIN_NUMBER_LOG10E,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.8.1.6 */
+NUMBER_VALUE (LIT_MAGIC_STRING_PI_U,
+              ECMA_BUILTIN_NUMBER_PI,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.8.1.7 */
+NUMBER_VALUE (LIT_MAGIC_STRING_SQRT1_2_U,
+              ECMA_BUILTIN_NUMBER_SQRT_1_2,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.8.1.8 */
+NUMBER_VALUE (LIT_MAGIC_STRING_SQRT2_U,
+              ECMA_BUILTIN_NUMBER_SQRT2,
+              ECMA_PROPERTY_FIXED)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_ABS, ECMA_MATH_OBJECT_ABS, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_ACOS, ECMA_MATH_OBJECT_ACOS, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_ASIN, ECMA_MATH_OBJECT_ASIN, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_ATAN, ECMA_MATH_OBJECT_ATAN, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_ATAN2, ECMA_MATH_OBJECT_ATAN2, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_CEIL, ECMA_MATH_OBJECT_CEIL, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_COS, ECMA_MATH_OBJECT_COS, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_EXP, ECMA_MATH_OBJECT_EXP, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_FLOOR, ECMA_MATH_OBJECT_FLOOR, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_LOG, ECMA_MATH_OBJECT_LOG, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_MAX, ECMA_MATH_OBJECT_MAX, NON_FIXED, 2)
+ROUTINE (LIT_MAGIC_STRING_MIN, ECMA_MATH_OBJECT_MIN, NON_FIXED, 2)
+ROUTINE (LIT_MAGIC_STRING_POW, ECMA_MATH_OBJECT_POW, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_RANDOM, ECMA_MATH_OBJECT_RANDOM, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_ROUND, ECMA_MATH_OBJECT_ROUND, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_SIN, ECMA_MATH_OBJECT_SIN, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_SQRT, ECMA_MATH_OBJECT_SQRT, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_TAN, ECMA_MATH_OBJECT_TAN, 1, 1)
+
+#endif /* !CONFIG_DISABLE_MATH_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c
new file mode 100644 (file)
index 0000000..e5ba6b0
--- /dev/null
@@ -0,0 +1,936 @@
+/* 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.
+ */
+
+#include <math.h>
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+#include "jrt-libc-includes.h"
+
+#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-number-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID number_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup numberprototype ECMA Number.prototype object built-in
+ * @{
+ */
+
+/**
+ * Helper for stringifying numbers
+ *
+ * @return the length of the generated string representation
+ */
+static lit_utf8_size_t
+ecma_builtin_number_prototype_helper_to_string (lit_utf8_byte_t *digits_p, /**< number as string in decimal form */
+                                                lit_utf8_size_t num_digits, /**< length of the string representation */
+                                                int32_t exponent, /**< decimal exponent */
+                                                lit_utf8_byte_t *to_digits_p, /**< [out] buffer to write */
+                                                lit_utf8_size_t to_num_digits) /**< requested number of digits */
+{
+  lit_utf8_byte_t *p = to_digits_p;
+
+  if (exponent <= 0)
+  {
+    /* Add zero to the integer part. */
+    *p++ = '0';
+    to_num_digits--;
+
+    if (to_num_digits > 0)
+    {
+      *p++ = '.';
+
+      /* Add leading zeros to the fraction part. */
+      for (int i = 0; i < -exponent && to_num_digits > 0; i++)
+      {
+        *p++ = '0';
+        to_num_digits--;
+      }
+    }
+  }
+  else
+  {
+    /* Add significant digits of the integer part. */
+    lit_utf8_size_t to_copy = JERRY_MIN (num_digits, to_num_digits);
+    to_copy = JERRY_MIN (to_copy, (lit_utf8_size_t) exponent);
+    memmove (p, digits_p, (size_t) to_copy);
+    p += to_copy;
+    to_num_digits -= to_copy;
+    digits_p += to_copy;
+    num_digits -= to_copy;
+    exponent -= (int32_t) to_copy;
+
+    /* Add zeros before decimal point. */
+    while (exponent > 0 && to_num_digits > 0)
+    {
+      JERRY_ASSERT (num_digits == 0);
+      *p++ = '0';
+      to_num_digits--;
+      exponent--;
+    }
+
+    if (to_num_digits > 0)
+    {
+      *p++ = '.';
+    }
+  }
+
+  if (to_num_digits > 0)
+  {
+    /* Add significant digits of the fraction part. */
+    lit_utf8_size_t to_copy = JERRY_MIN (num_digits, to_num_digits);
+    memmove (p, digits_p, (size_t) to_copy);
+    p += to_copy;
+    to_num_digits -= to_copy;
+
+    /* Add trailing zeros. */
+    while (to_num_digits > 0)
+    {
+      *p++ = '0';
+      to_num_digits--;
+    }
+  }
+
+  return (lit_utf8_size_t) (p - to_digits_p);
+} /* ecma_builtin_number_prototype_helper_to_string */
+
+/**
+ * Helper for rounding numbers
+ *
+ * @return rounded number
+ */
+static inline lit_utf8_size_t __attr_always_inline___
+ecma_builtin_number_prototype_helper_round (lit_utf8_byte_t *digits_p, /**< [in,out] number as a string in decimal
+                                                                        *   form */
+                                            lit_utf8_size_t num_digits, /**< length of the string representation */
+                                            int32_t round_num, /**< number of digits to keep */
+                                            int32_t *exponent_p) /**< [in, out] decimal exponent */
+{
+  if (round_num < 1)
+  {
+    return 0;
+  }
+
+  if ((lit_utf8_size_t) round_num >= num_digits)
+  {
+    return num_digits;
+  }
+
+  if (digits_p[round_num] >= '5')
+  {
+    digits_p[round_num] = '0';
+
+    int i = 1;
+
+    /* Handle carry number. */
+    for (; i <= round_num; i++)
+    {
+      if (++digits_p[round_num - i] <= '9')
+      {
+        break;
+      }
+      digits_p[round_num - i] = '0';
+    }
+
+    /* Prepend highest digit */
+    if (i > round_num)
+    {
+      memmove (digits_p + 1, digits_p, num_digits);
+      digits_p[0] = '1';
+      *exponent_p += 1;
+    }
+  }
+
+  return (lit_utf8_size_t) round_num;
+} /* ecma_builtin_number_prototype_helper_round */
+
+/**
+ * The Number.prototype object's 'toString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.7.4.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_number_prototype_object_to_string (ecma_value_t this_arg, /**< this argument */
+                                                const ecma_value_t *arguments_list_p, /**< arguments list */
+                                                ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (this_value, ecma_builtin_number_prototype_object_value_of (this_arg), ret_value);
+  ecma_number_t this_arg_number = ecma_get_number_from_value (this_value);
+
+  if (arguments_list_len == 0
+      || ecma_number_is_nan (this_arg_number)
+      || ecma_number_is_infinity (this_arg_number)
+      || ecma_number_is_zero (this_arg_number)
+      || (arguments_list_len > 0 && ecma_is_value_undefined (arguments_list_p[0])))
+  {
+    ecma_string_t *ret_str_p = ecma_new_ecma_string_from_number (this_arg_number);
+
+    ret_value = ecma_make_string_value (ret_str_p);
+  }
+  else
+  {
+    static const lit_utf8_byte_t digit_chars[36] =
+    {
+      '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+      'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+      'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
+      'u', 'v', 'w', 'x', 'y', 'z'
+    };
+
+    ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arguments_list_p[0], ret_value);
+
+    uint32_t radix = ecma_number_to_uint32 (arg_num);
+
+    if (radix < 2 || radix > 36)
+    {
+      ret_value = ecma_raise_range_error (ECMA_ERR_MSG ("Radix must be between 2 and 36."));
+    }
+    else if (radix == 10)
+    {
+      ecma_string_t *ret_str_p = ecma_new_ecma_string_from_number (this_arg_number);
+
+      ret_value = ecma_make_string_value (ret_str_p);
+    }
+    else
+    {
+      bool is_negative = false;
+      if (ecma_number_is_negative (this_arg_number))
+      {
+        this_arg_number = -this_arg_number;
+        is_negative = true;
+      }
+
+      lit_utf8_byte_t digits[ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER];
+      int32_t exponent;
+      lit_utf8_size_t num_digits = ecma_number_to_decimal (this_arg_number, digits, &exponent);
+
+      exponent = exponent - (int32_t) num_digits;
+
+      /* Calculate the scale of the number in the specified radix. */
+      int scale = (int) -floor ((log (10) / log (radix)) * exponent);
+
+      bool is_scale_negative = false;
+      if (scale < 0)
+      {
+        is_scale_negative = true;
+        scale = -scale;
+      }
+
+      int buff_size = 1;
+      if (is_scale_negative)
+      {
+        double counter = this_arg_number;
+        while (counter > radix)
+        {
+          counter /= radix;
+          buff_size++;
+        }
+      }
+      else
+      {
+        buff_size = scale + ECMA_NUMBER_FRACTION_WIDTH + 2;
+      }
+
+      if (is_negative)
+      {
+        buff_size++;
+      }
+
+      /* Normalize the number, so that it is as close to 0 exponent as possible. */
+      if (is_scale_negative)
+      {
+        for (int i = 0; i < scale; i++)
+        {
+          this_arg_number /= (ecma_number_t) radix;
+        }
+      }
+      else
+      {
+        for (int i = 0; i < scale; i++)
+        {
+          this_arg_number *= (ecma_number_t) radix;
+        }
+      }
+
+      uint64_t whole = (uint64_t) this_arg_number;
+      ecma_number_t fraction = this_arg_number - (ecma_number_t) whole;
+
+      bool should_round = false;
+      if (!ecma_number_is_zero (fraction) && is_scale_negative)
+      {
+        /* Add one extra digit for rounding. */
+        buff_size++;
+        should_round = true;
+      }
+
+      JMEM_DEFINE_LOCAL_ARRAY (buff, buff_size, lit_utf8_byte_t);
+      int buff_index = 0;
+
+      /* Calculate digits for whole part. */
+      while (whole > 0)
+      {
+        buff[buff_index++] = (lit_utf8_byte_t) (whole % radix);
+        whole /= radix;
+      }
+
+      /* Calculate where we have to put the radix point. */
+      int point = is_scale_negative ? buff_index + scale : buff_index - scale;
+
+      /* Reverse the digits, since they are backwards. */
+      for (int i = 0; i < buff_index / 2; i++)
+      {
+        lit_utf8_byte_t swap = buff[i];
+        buff[i] = buff[buff_index - i - 1];
+        buff[buff_index - i - 1] = swap;
+      }
+
+      int required_digits = buff_size;
+      if (is_negative)
+      {
+        required_digits--;
+      }
+
+      if (!is_scale_negative)
+      {
+        /* Leave space for leading zeros / radix point. */
+        required_digits -= scale + 1;
+      }
+
+      /* Calculate digits for fractional part. */
+      while (buff_index < required_digits && (fraction != 0 || is_scale_negative))
+      {
+        fraction *= (ecma_number_t) radix;
+        lit_utf8_byte_t digit = (lit_utf8_byte_t) floor (fraction);
+
+        buff[buff_index++] = digit;
+        fraction -= (ecma_number_t) floor (fraction);
+      }
+
+      if (should_round)
+      {
+        /* Round off last digit. */
+        if (buff[buff_index - 1] > radix / 2)
+        {
+          buff[buff_index - 2]++;
+        }
+
+        buff_index--;
+
+        /* Propagate carry. */
+        for (int i = buff_index - 1; i > 0 && buff[i] >= radix; i--)
+        {
+          buff[i] = (lit_utf8_byte_t) (buff[i] - radix);
+          buff[i - 1]++;
+        }
+
+        /* Carry propagated over the whole number, need to add a leading digit. */
+        if (buff[0] >= radix)
+        {
+          memmove (buff + 1, buff, (size_t) buff_index);
+          buff_index++;
+          buff[0] = 1;
+        }
+      }
+
+      /* Remove trailing zeros from fraction. */
+      while (buff_index - 1 > point && buff[buff_index - 1] == 0)
+      {
+        buff_index--;
+      }
+
+      /* Add leading zeros in case place of radix point is negative. */
+      if (point <= 0)
+      {
+        memmove (buff - point + 1, buff, (size_t) buff_index);
+        buff_index += -point + 1;
+
+        for (int i = 0; i < -point + 1; i++)
+        {
+          buff[i] = 0;
+        }
+
+        point = 1;
+      }
+
+      /* Convert digits to characters. */
+      for (int i = 0; i < buff_index; i++)
+      {
+        buff[i] = digit_chars[buff[i]];
+      }
+
+      /* Place radix point to the required position. */
+      if (point < buff_index)
+      {
+        memmove (buff + point + 1, buff + point, (size_t) (buff_index - point));
+        buff[point] = '.';
+        buff_index++;
+      }
+
+      /* Add negative sign if necessary. */
+      if (is_negative)
+      {
+        memmove (buff + 1, buff, (size_t) buff_index);
+        buff_index++;
+        buff[0] = '-';
+      }
+
+      JERRY_ASSERT (buff_index <= buff_size);
+      ecma_string_t *str_p = ecma_new_ecma_string_from_utf8 (buff, (lit_utf8_size_t) buff_index);
+      ret_value = ecma_make_string_value (str_p);
+      JMEM_FINALIZE_LOCAL_ARRAY (buff);
+    }
+    ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
+  }
+  ECMA_FINALIZE (this_value);
+  return ret_value;
+} /* ecma_builtin_number_prototype_object_to_string */
+
+/**
+ * The Number.prototype object's 'toLocaleString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.7.4.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_number_prototype_object_to_locale_string (ecma_value_t this_arg) /**< this argument */
+{
+  return ecma_builtin_number_prototype_object_to_string (this_arg, NULL, 0);
+} /* ecma_builtin_number_prototype_object_to_locale_string */
+
+/**
+ * The Number.prototype object's 'valueOf' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.7.4.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_number_prototype_object_value_of (ecma_value_t this_arg) /**< this argument */
+{
+  if (ecma_is_value_number (this_arg))
+  {
+    return ecma_copy_value (this_arg);
+  }
+  else if (ecma_is_value_object (this_arg))
+  {
+    ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
+
+    if (ecma_object_class_is (object_p, LIT_MAGIC_STRING_NUMBER_UL))
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      JERRY_ASSERT (ecma_is_value_number (ext_object_p->u.class_prop.u.value));
+
+      return ecma_copy_value (ext_object_p->u.class_prop.u.value);
+    }
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Number or a Number object."));
+} /* ecma_builtin_number_prototype_object_value_of */
+
+/**
+ * The Number.prototype object's 'toFixed' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.7.4.5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_number_prototype_object_to_fixed (ecma_value_t this_arg, /**< this argument */
+                                               ecma_value_t arg) /**< routine's argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (this_value, ecma_builtin_number_prototype_object_value_of (this_arg), ret_value);
+  ecma_number_t this_num = ecma_get_number_from_value (this_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value);
+
+  /* 2. */
+  if (arg_num <= -1 || arg_num >= 21)
+  {
+    ret_value = ecma_raise_range_error (ECMA_ERR_MSG ("Fraction digits must be between 0 and 20."));
+  }
+  else
+  {
+    /* 4. */
+    if (ecma_number_is_nan (this_num))
+    {
+      ecma_string_t *nan_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_NAN);
+      ret_value = ecma_make_string_value (nan_str_p);
+    }
+    else
+    {
+      /* 6. */
+      bool is_negative = false;
+      if (ecma_number_is_negative (this_num))
+      {
+        is_negative = true;
+        this_num *= -1;
+      }
+
+      /* We handle infinities separately. */
+      if (ecma_number_is_infinity (this_num))
+      {
+        ecma_string_t *infinity_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_INFINITY_UL);
+
+        if (is_negative)
+        {
+          ecma_string_t *neg_str_p = ecma_new_ecma_string_from_utf8 ((const lit_utf8_byte_t *) "-", 1);
+          ecma_string_t *neg_inf_str_p = ecma_concat_ecma_strings (neg_str_p, infinity_str_p);
+          ecma_deref_ecma_string (infinity_str_p);
+          ecma_deref_ecma_string (neg_str_p);
+          ret_value = ecma_make_string_value (neg_inf_str_p);
+        }
+        else
+        {
+          ret_value = ecma_make_string_value (infinity_str_p);
+        }
+      }
+      else
+      {
+        /* Get the parameters of the number if non-zero. */
+        lit_utf8_byte_t digits[ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER];
+        lit_utf8_size_t num_digits;
+        int32_t exponent;
+
+        if (!ecma_number_is_zero (this_num))
+        {
+          num_digits = ecma_number_to_decimal (this_num, digits, &exponent);
+        }
+        else
+        {
+          digits[0] = '0';
+          num_digits = 1;
+          exponent = 1;
+        }
+
+        /* 7. */
+        if (exponent > 21)
+        {
+          ret_value = ecma_builtin_number_prototype_object_to_string (this_arg, NULL, 0);
+        }
+        /* 8. */
+        else
+        {
+          /* 1. */
+          int32_t frac_digits = ecma_number_to_int32 (arg_num);
+
+          num_digits = ecma_builtin_number_prototype_helper_round (digits,
+                                                                   num_digits,
+                                                                   exponent + frac_digits,
+                                                                   &exponent);
+
+          /* Buffer that is used to construct the string. */
+          int buffer_size = (exponent > 0) ? exponent + frac_digits + 2 : frac_digits + 3;
+
+          if (is_negative)
+          {
+            buffer_size++;
+          }
+
+          JERRY_ASSERT (buffer_size > 0);
+          JMEM_DEFINE_LOCAL_ARRAY (buff, buffer_size, lit_utf8_byte_t);
+
+          lit_utf8_byte_t *p = buff;
+
+          if (is_negative)
+          {
+            *p++ = '-';
+          }
+
+          lit_utf8_size_t to_num_digits = ((exponent > 0) ? (lit_utf8_size_t) (exponent + frac_digits)
+                                                          : (lit_utf8_size_t) (frac_digits + 1));
+          p += ecma_builtin_number_prototype_helper_to_string (digits,
+                                                               num_digits,
+                                                               exponent,
+                                                               p,
+                                                               to_num_digits);
+
+          JERRY_ASSERT (p - buff < buffer_size);
+          /* String terminator. */
+          *p = 0;
+          ecma_string_t *str = ecma_new_ecma_string_from_utf8 (buff, (lit_utf8_size_t) (p - buff));
+
+          ret_value = ecma_make_string_value (str);
+          JMEM_FINALIZE_LOCAL_ARRAY (buff);
+        }
+      }
+    }
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
+  ECMA_FINALIZE (this_value);
+  return ret_value;
+} /* ecma_builtin_number_prototype_object_to_fixed */
+
+/**
+ * The Number.prototype object's 'toExponential' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.7.4.6
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_number_prototype_object_to_exponential (ecma_value_t this_arg, /**< this argument */
+                                                     ecma_value_t arg) /**< routine's argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (this_value, ecma_builtin_number_prototype_object_value_of (this_arg), ret_value);
+  ecma_number_t this_num = ecma_get_number_from_value (this_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value);
+
+  /* 7. */
+  if (arg_num <= -1.0 || arg_num >= 21.0)
+  {
+    ret_value = ecma_raise_range_error (ECMA_ERR_MSG ("Fraction digits must be between 0 and 20."));
+  }
+  else
+  {
+    /* 3. */
+    if (ecma_number_is_nan (this_num))
+    {
+      ecma_string_t *nan_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_NAN);
+      ret_value = ecma_make_string_value (nan_str_p);
+    }
+    else
+    {
+      /* 5. */
+      bool is_negative = false;
+      if (ecma_number_is_negative (this_num) && !ecma_number_is_zero (this_num))
+      {
+        is_negative = true;
+        this_num *= -1;
+      }
+
+      /* 6. */
+      if (ecma_number_is_infinity (this_num))
+      {
+        ecma_string_t *infinity_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_INFINITY_UL);
+
+        if (is_negative)
+        {
+          ecma_string_t *neg_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_MINUS_CHAR);
+          ecma_string_t *neg_inf_str_p = ecma_concat_ecma_strings (neg_str_p, infinity_str_p);
+          ecma_deref_ecma_string (infinity_str_p);
+          ecma_deref_ecma_string (neg_str_p);
+          ret_value = ecma_make_string_value (neg_inf_str_p);
+        }
+        else
+        {
+          ret_value = ecma_make_string_value (infinity_str_p);
+        }
+      }
+      else
+      {
+        /* Get the parameters of the number if non zero. */
+        lit_utf8_byte_t digits[ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER];
+        lit_utf8_size_t num_digits;
+        int32_t exponent;
+
+        if (!ecma_number_is_zero (this_num))
+        {
+          num_digits = ecma_number_to_decimal (this_num, digits, &exponent);
+        }
+        else
+        {
+          digits[0] = '0';
+          num_digits = 1;
+          exponent = 1;
+        }
+
+        int32_t frac_digits;
+        if (ecma_is_value_undefined (arg))
+        {
+          frac_digits = (int32_t) num_digits - 1;
+        }
+        else
+        {
+          frac_digits = ecma_number_to_int32 (arg_num);
+        }
+
+        num_digits = ecma_builtin_number_prototype_helper_round (digits, num_digits, frac_digits + 1, &exponent);
+
+        /* frac_digits + 2 characters for number, 5 characters for exponent, 1 for \0. */
+        int buffer_size = frac_digits + 2 + 5 + 1;
+
+        if (is_negative)
+        {
+          /* +1 character for sign. */
+          buffer_size++;
+        }
+
+        JMEM_DEFINE_LOCAL_ARRAY (buff, buffer_size, lit_utf8_byte_t);
+
+        lit_utf8_byte_t *actual_char_p = buff;
+
+        if (is_negative)
+        {
+          *actual_char_p++ = '-';
+        }
+
+        actual_char_p += ecma_builtin_number_prototype_helper_to_string (digits,
+                                                                         num_digits,
+                                                                         1,
+                                                                         actual_char_p,
+                                                                         (lit_utf8_size_t) (frac_digits + 1));
+
+        *actual_char_p++ = 'e';
+
+        exponent--;
+        if (exponent < 0)
+        {
+          exponent *= -1;
+          *actual_char_p++ = '-';
+        }
+        else
+        {
+          *actual_char_p++ = '+';
+        }
+
+        /* Add exponent digits. */
+        actual_char_p += ecma_uint32_to_utf8_string ((uint32_t) exponent, actual_char_p, 3);
+
+        JERRY_ASSERT (actual_char_p - buff < buffer_size);
+        *actual_char_p = '\0';
+        ecma_string_t *str = ecma_new_ecma_string_from_utf8 (buff, (lit_utf8_size_t) (actual_char_p - buff));
+        ret_value = ecma_make_string_value (str);
+        JMEM_FINALIZE_LOCAL_ARRAY (buff);
+      }
+    }
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
+  ECMA_FINALIZE (this_value);
+  return ret_value;
+} /* ecma_builtin_number_prototype_object_to_exponential */
+
+/**
+ * The Number.prototype object's 'toPrecision' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.7.4.7
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_number_prototype_object_to_precision (ecma_value_t this_arg, /**< this argument */
+                                                   ecma_value_t arg) /**< routine's argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (this_value, ecma_builtin_number_prototype_object_value_of (this_arg), ret_value);
+  ecma_number_t this_num = ecma_get_number_from_value (this_value);
+
+  /* 2. */
+  if (ecma_is_value_undefined (arg))
+  {
+    ret_value = ecma_builtin_number_prototype_object_to_string (this_arg, NULL, 0);
+  }
+  else
+  {
+    /* 3. */
+    ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value);
+
+    /* 4. */
+    if (ecma_number_is_nan (this_num))
+    {
+      ecma_string_t *nan_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_NAN);
+      ret_value = ecma_make_string_value (nan_str_p);
+    }
+    else
+    {
+      /* 6. */
+      bool is_negative = false;
+      if (ecma_number_is_negative (this_num) && !ecma_number_is_zero (this_num))
+      {
+        is_negative = true;
+        this_num *= -1;
+      }
+
+      /* 7. */
+      if (ecma_number_is_infinity (this_num))
+      {
+        ecma_string_t *infinity_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_INFINITY_UL);
+
+        if (is_negative)
+        {
+          ecma_string_t *neg_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_MINUS_CHAR);
+          ecma_string_t *neg_inf_str_p = ecma_concat_ecma_strings (neg_str_p, infinity_str_p);
+          ecma_deref_ecma_string (infinity_str_p);
+          ecma_deref_ecma_string (neg_str_p);
+          ret_value = ecma_make_string_value (neg_inf_str_p);
+        }
+        else
+        {
+          ret_value = ecma_make_string_value (infinity_str_p);
+        }
+      }
+      /* 8. */
+      else if (arg_num < 1.0 || arg_num >= 22.0)
+      {
+        ret_value = ecma_raise_range_error (ECMA_ERR_MSG ("Precision must be between 1 and 21."));
+      }
+      else
+      {
+        /* Get the parameters of the number if non-zero. */
+        lit_utf8_byte_t digits[ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER];
+        lit_utf8_size_t num_digits;
+        int32_t exponent;
+
+        if (!ecma_number_is_zero (this_num))
+        {
+          num_digits = ecma_number_to_decimal (this_num, digits, &exponent);
+        }
+        else
+        {
+          digits[0] = '0';
+          num_digits = 1;
+          exponent = 1;
+        }
+
+        int32_t precision = ecma_number_to_int32 (arg_num);
+
+        num_digits = ecma_builtin_number_prototype_helper_round (digits, num_digits, precision, &exponent);
+
+        int buffer_size;
+        if (exponent  < -5 || exponent > precision)
+        {
+          /* Exponential notation, precision + 1 digits for number, 5 for exponent, 1 for \0 */
+          buffer_size = precision + 1 + 5 + 1;
+        }
+        else if (exponent <= 0)
+        {
+          /* Fixed notation, -exponent + 2 digits for leading zeros, precision digits, 1 for \0 */
+          buffer_size = -exponent + 2 + precision + 1;
+        }
+        else
+        {
+          /* Fixed notation, precision + 1 digits for number, 1 for \0 */
+          buffer_size = precision + 1 + 1;
+        }
+
+        if (is_negative)
+        {
+          buffer_size++;
+        }
+
+        JMEM_DEFINE_LOCAL_ARRAY (buff, buffer_size, lit_utf8_byte_t);
+        lit_utf8_byte_t *actual_char_p = buff;
+
+        if (is_negative)
+        {
+          *actual_char_p++ = '-';
+        }
+
+        /* 10.c, Exponential notation.*/
+        if (exponent < -5 || exponent > precision)
+        {
+          actual_char_p  += ecma_builtin_number_prototype_helper_to_string (digits,
+                                                                            num_digits,
+                                                                            1,
+                                                                            actual_char_p,
+                                                                            (lit_utf8_size_t) precision);
+
+          *actual_char_p++ = 'e';
+
+          exponent--;
+          if (exponent < 0)
+          {
+            exponent *= -1;
+            *actual_char_p++ = '-';
+          }
+          else
+          {
+            *actual_char_p++ = '+';
+          }
+
+          /* Add exponent digits. */
+          actual_char_p += ecma_uint32_to_utf8_string ((uint32_t) exponent, actual_char_p, 3);
+        }
+        /* Fixed notation. */
+        else
+        {
+          lit_utf8_size_t to_num_digits = ((exponent <= 0) ? (lit_utf8_size_t) (1 - exponent + precision)
+                                                           : (lit_utf8_size_t) precision);
+          actual_char_p += ecma_builtin_number_prototype_helper_to_string (digits,
+                                                                           num_digits,
+                                                                           exponent,
+                                                                           actual_char_p,
+                                                                           to_num_digits);
+
+        }
+
+        JERRY_ASSERT (actual_char_p - buff < buffer_size);
+        *actual_char_p = '\0';
+        ecma_string_t *str_p = ecma_new_ecma_string_from_utf8 (buff, (lit_utf8_size_t) (actual_char_p - buff));
+
+        ret_value = ecma_make_string_value (str_p);
+        JMEM_FINALIZE_LOCAL_ARRAY (buff);
+      }
+    }
+    ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
+  }
+  ECMA_FINALIZE (this_value);
+
+  return ret_value;
+} /* ecma_builtin_number_prototype_object_to_precision */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.inc.h
new file mode 100644 (file)
index 0000000..1e64071
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+/*
+ * Number.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.7.4.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_NUMBER,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_number_prototype_object_to_string, NON_FIXED, 1)
+ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ecma_builtin_number_prototype_object_value_of, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ecma_builtin_number_prototype_object_to_locale_string, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_FIXED_UL, ecma_builtin_number_prototype_object_to_fixed, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_TO_EXPONENTIAL_UL, ecma_builtin_number_prototype_object_to_exponential, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_TO_PRECISION_UL, ecma_builtin_number_prototype_object_to_precision, 1, 1)
+
+#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number.c
new file mode 100644 (file)
index 0000000..136fe6f
--- /dev/null
@@ -0,0 +1,100 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-number-object.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-number.inc.h"
+#define BUILTIN_UNDERSCORED_ID number
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup number ECMA Number object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in Number object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_number_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                   ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (arguments_list_len == 0)
+  {
+    ret_value = ecma_make_integer_value (0);
+  }
+  else
+  {
+    ret_value = ecma_op_to_number (arguments_list_p[0]);
+  }
+
+  return ret_value;
+} /* ecma_builtin_number_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in Number object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_number_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                        ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  if (arguments_list_len == 0)
+  {
+    ecma_value_t completion = ecma_op_create_number_object (ecma_make_integer_value (0));
+    return completion;
+  }
+  else
+  {
+    return ecma_op_create_number_object (arguments_list_p[0]);
+  }
+} /* ecma_builtin_number_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-number.inc.h
new file mode 100644 (file)
index 0000000..1b48f1c
--- /dev/null
@@ -0,0 +1,67 @@
+/* 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.
+ */
+
+/*
+ * Number built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.7.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.7.3.4 */
+NUMBER_VALUE (LIT_MAGIC_STRING_NAN,
+              ECMA_BUILTIN_NUMBER_NAN,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.7.3.2 */
+NUMBER_VALUE (LIT_MAGIC_STRING_MAX_VALUE_U,
+              ECMA_BUILTIN_NUMBER_MAX,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.7.3.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_MIN_VALUE_U,
+              ECMA_BUILTIN_NUMBER_MIN,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.7.3.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_POSITIVE_INFINITY_U,
+              ECMA_BUILTIN_NUMBER_POSITIVE_INFINITY,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.7.3.6 */
+NUMBER_VALUE (LIT_MAGIC_STRING_NEGATIVE_INFINITY_U,
+              ECMA_BUILTIN_NUMBER_NEGATIVE_INFINITY,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.7.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_NUMBER_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c
new file mode 100644 (file)
index 0000000..8af852c
--- /dev/null
@@ -0,0 +1,265 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-object-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID object_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup objectprototype ECMA Object.prototype object built-in
+ * @{
+ */
+
+/**
+ * The Object.prototype object's 'toString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.4.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */
+{
+  return ecma_builtin_helper_object_to_string (this_arg);
+} /* ecma_builtin_object_prototype_object_to_string */
+
+/**
+ * The Object.prototype object's 'valueOf' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.4.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_prototype_object_value_of (ecma_value_t this_arg) /**< this argument */
+{
+  return ecma_op_to_object (this_arg);
+} /* ecma_builtin_object_prototype_object_value_of */
+
+/**
+ * The Object.prototype object's 'toLocaleString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.4.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_prototype_object_to_locale_string (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  /* 1. */
+  ECMA_TRY_CATCH (obj_val,
+                  ecma_op_to_object (this_arg),
+                  return_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_val);
+  ecma_string_t *to_string_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_TO_STRING_UL);
+
+  /* 2. */
+  ECMA_TRY_CATCH (to_string_val,
+                  ecma_op_object_get (obj_p, to_string_magic_string_p),
+                  return_value);
+
+  /* 3. */
+  if (!ecma_op_is_callable (to_string_val))
+  {
+    return_value = ecma_raise_type_error (ECMA_ERR_MSG ("'toString is missing or not a function.'"));
+  }
+  else
+  {
+    /* 4. */
+    ecma_object_t *to_string_func_obj_p = ecma_get_object_from_value (to_string_val);
+    return_value = ecma_op_function_call (to_string_func_obj_p, this_arg, NULL, 0);
+  }
+  ECMA_FINALIZE (to_string_val);
+
+  ecma_deref_ecma_string (to_string_magic_string_p);
+
+  ECMA_FINALIZE (obj_val);
+
+  return return_value;
+} /* ecma_builtin_object_prototype_object_to_locale_string */
+
+/**
+ * The Object.prototype object's 'hasOwnProperty' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.4.5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_prototype_object_has_own_property (ecma_value_t this_arg, /**< this argument */
+                                                       ecma_value_t arg) /**< first argument */
+{
+  ecma_value_t return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (to_string_val,
+                  ecma_op_to_string (arg),
+                  return_value);
+
+  /* 2. */
+  ECMA_TRY_CATCH (obj_val,
+                  ecma_op_to_object (this_arg),
+                  return_value);
+
+  ecma_string_t *property_name_string_p = ecma_get_string_from_value (to_string_val);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_val);
+
+  /* 3. */
+  return_value = ecma_make_boolean_value (ecma_op_object_has_own_property (obj_p, property_name_string_p));
+
+  ECMA_FINALIZE (obj_val);
+
+  ECMA_FINALIZE (to_string_val);
+
+  return return_value;
+} /* ecma_builtin_object_prototype_object_has_own_property */
+
+/**
+ * The Object.prototype object's 'isPrototypeOf' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.4.6
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_prototype_object_is_prototype_of (ecma_value_t this_arg, /**< this argument */
+                                                      ecma_value_t arg) /**< routine's first argument */
+{
+  /* 1. Is the argument an object? */
+  if (!ecma_is_value_object (arg))
+  {
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+  }
+
+  ecma_value_t return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 2. ToObject(this) */
+  ECMA_TRY_CATCH (obj_value,
+                  ecma_op_to_object (this_arg),
+                  return_value);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_value);
+
+  /* 3. Compare prototype to object */
+  ECMA_TRY_CATCH (v_obj_value,
+                  ecma_op_to_object (arg),
+                  return_value);
+
+  ecma_object_t *v_obj_p = ecma_get_object_from_value (v_obj_value);
+
+  bool is_prototype_of = ecma_op_object_is_prototype_of (obj_p, v_obj_p);
+  return_value = ecma_make_simple_value (is_prototype_of ? ECMA_SIMPLE_VALUE_TRUE
+                                                         : ECMA_SIMPLE_VALUE_FALSE);
+  ECMA_FINALIZE (v_obj_value);
+
+  ECMA_FINALIZE (obj_value);
+
+  return return_value;
+} /* ecma_builtin_object_prototype_object_is_prototype_of */
+
+/**
+ * The Object.prototype object's 'propertyIsEnumerable' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.4.7
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_prototype_object_property_is_enumerable (ecma_value_t this_arg, /**< this argument */
+                                                             ecma_value_t arg) /**< routine's first argument */
+{
+  ecma_value_t return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (to_string_val,
+                  ecma_op_to_string (arg),
+                  return_value);
+
+  /* 2. */
+  ECMA_TRY_CATCH (obj_val,
+                  ecma_op_to_object (this_arg),
+                  return_value);
+
+  ecma_string_t *property_name_string_p = ecma_get_string_from_value (to_string_val);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (obj_val);
+
+  /* 3. */
+  ecma_property_t property = ecma_op_object_get_own_property (obj_p,
+                                                              property_name_string_p,
+                                                              NULL,
+                                                              ECMA_PROPERTY_GET_NO_OPTIONS);
+
+  /* 4. */
+  if (property != ECMA_PROPERTY_TYPE_NOT_FOUND && property != ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP)
+  {
+    bool is_enumerable = ecma_is_property_enumerable (property);
+
+    return_value = ecma_make_boolean_value (is_enumerable);
+  }
+  else
+  {
+    return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+  }
+
+  ECMA_FINALIZE (obj_val);
+
+  ECMA_FINALIZE (to_string_val);
+
+  return return_value;
+} /* ecma_builtin_object_prototype_object_property_is_enumerable */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.inc.h
new file mode 100644 (file)
index 0000000..66f0c74
--- /dev/null
@@ -0,0 +1,39 @@
+/* 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.
+ */
+
+/*
+ * Object.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.2.4.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_OBJECT,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_object_prototype_object_to_string, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ecma_builtin_object_prototype_object_value_of, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ecma_builtin_object_prototype_object_to_locale_string, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_HAS_OWN_PROPERTY_UL, ecma_builtin_object_prototype_object_has_own_property, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL, ecma_builtin_object_prototype_object_is_prototype_of, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL, ecma_builtin_object_prototype_object_property_is_enumerable, 1, 1)
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object.c
new file mode 100644 (file)
index 0000000..29d45f8
--- /dev/null
@@ -0,0 +1,968 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-array-object.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-object.inc.h"
+#define BUILTIN_UNDERSCORED_ID object
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup object ECMA Object object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in Object object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_object_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                   ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (arguments_list_len == 0
+      || ecma_is_value_undefined (arguments_list_p[0])
+      || ecma_is_value_null (arguments_list_p[0]))
+  {
+    ret_value = ecma_builtin_object_dispatch_construct (arguments_list_p, arguments_list_len);
+  }
+  else
+  {
+    ret_value = ecma_op_to_object (arguments_list_p[0]);
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in Object object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_object_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                        ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  if (arguments_list_len == 0)
+  {
+    ecma_object_t *obj_p = ecma_op_create_object_object_noarg ();
+
+    return ecma_make_object_value (obj_p);
+  }
+  else
+  {
+    return ecma_op_create_object_object_arg (arguments_list_p[0]);
+  }
+} /* ecma_builtin_object_dispatch_construct */
+
+/**
+ * The Object object's 'getPrototypeOf' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_get_prototype_of (ecma_value_t this_arg, /**< 'this' argument */
+                                             ecma_value_t arg) /**< routine's argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  if (!ecma_is_value_object (arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    /* 2. */
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg);
+    ecma_object_t *prototype_p = ecma_get_object_prototype (obj_p);
+
+    if (prototype_p)
+    {
+      ret_value = ecma_make_object_value (prototype_p);
+      ecma_ref_object (prototype_p);
+    }
+    else
+    {
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+    }
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_get_prototype_of */
+
+#ifndef CONFIG_DISABLE_ES2015_BUILTIN
+/**
+ * [[SetPrototypeOf]]
+ *
+ * See also:
+ *          ES2015 9.1.2
+ */
+static bool
+ecma_set_prototype_of (ecma_value_t o_value, /**< O */
+                       ecma_value_t v_value) /**< V */
+{
+  /* 1. */
+  JERRY_ASSERT (ecma_is_value_object (o_value));
+  JERRY_ASSERT (ecma_is_value_object (v_value) || ecma_is_value_null (v_value));
+
+  ecma_object_t *o_p = ecma_get_object_from_value (o_value);
+  ecma_object_t *v_p = ecma_is_value_null (v_value) ? NULL : ecma_get_object_from_value (v_value);
+
+  /* 3., 4. */
+  if (v_p == ecma_get_object_prototype (o_p))
+  {
+    return true;
+  }
+
+  /* 2., 5. */
+  if (!ecma_get_object_extensible (o_p))
+  {
+    return false;
+  }
+
+  /* 6., 7., 8. */
+  ecma_object_t *p_p = v_p;
+  while (true)
+  {
+    /* a. */
+    if (p_p == NULL)
+    {
+      break;
+    }
+
+    /* b. */
+    if (p_p == o_p)
+    {
+      return false;
+    }
+
+    /* c.i. TODO: es2015-subset profile does not support having a different
+     * [[GetPrototypeOf]] internal method */
+
+    /* c.ii. */
+    p_p = ecma_get_object_prototype (p_p);
+  }
+
+  /* 9. */
+  ECMA_SET_POINTER (o_p->prototype_or_outer_reference_cp, v_p);
+
+  /* 10. */
+  return true;
+} /* ecma_set_prototype_of */
+
+/**
+ * The Object object's 'setPrototypeOf' routine
+ *
+ * See also:
+ *          ES2015 19.1.2.18
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_set_prototype_of (ecma_value_t this_arg, /**< 'this' argument */
+                                             ecma_value_t arg1, /**< routine's first argument */
+                                             ecma_value_t arg2) /**< routine's second argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1., 2. */
+  ECMA_TRY_CATCH (unused_value,
+                  ecma_op_check_object_coercible (arg1),
+                  ret_value);
+
+  /* 3. */
+  if (!ecma_is_value_object (arg2) && !ecma_is_value_null (arg2))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("proto is neither Object nor Null."));
+  }
+  else
+  {
+    /* 4. */
+    if (!ecma_is_value_object (arg1))
+    {
+      ret_value = ecma_copy_value (arg1);
+    }
+    else
+    {
+      /* 5. */
+      bool status = ecma_set_prototype_of (arg1, arg2);
+
+      /* 6. TODO: es2015-subset profile does not support having a different
+       * [[SetPrototypeOf]] internal method */
+
+      /* 7. */
+      if (!status)
+      {
+        ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("cannot set prototype."));
+      }
+      else
+      {
+        /* 8. */
+        ret_value = ecma_copy_value (arg1);
+      }
+    }
+  }
+
+  ECMA_FINALIZE (unused_value);
+
+  return ret_value;
+} /* ecma_builtin_object_object_set_prototype_of */
+#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
+
+/**
+ * The Object object's 'getOwnPropertyNames' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_get_own_property_names (ecma_value_t this_arg, /**< 'this' argument */
+                                                   ecma_value_t arg) /**< routine's argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (arg))
+  {
+    /* 1. */
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg);
+    /* 2-5. */
+    ret_value = ecma_builtin_helper_object_get_properties (obj_p, false);
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_get_own_property_names */
+
+/**
+ * The Object object's 'seal' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.8
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_seal (ecma_value_t this_arg, /**< 'this' argument */
+                                 ecma_value_t arg) /**< routine's argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  if (!ecma_is_value_object (arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    /* 2. */
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg);
+
+    ecma_collection_header_t *props_p = ecma_op_object_get_property_names (obj_p, false, false, false);
+
+    ecma_collection_iterator_t iter;
+    ecma_collection_iterator_init (&iter, props_p);
+
+    while (ecma_collection_iterator_next (&iter)
+           && ecma_is_value_empty (ret_value))
+    {
+      ecma_string_t *property_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+      /* 2.a */
+      ecma_property_descriptor_t prop_desc;
+
+      if (!ecma_op_object_get_own_property_descriptor (obj_p, property_name_p, &prop_desc))
+      {
+        continue;
+      }
+
+      /* 2.b */
+      prop_desc.is_configurable = false;
+
+      /* 2.c */
+      ECMA_TRY_CATCH (define_own_prop_ret,
+                      ecma_op_object_define_own_property (obj_p,
+                                                          property_name_p,
+                                                          &prop_desc,
+                                                          true),
+                      ret_value);
+      ECMA_FINALIZE (define_own_prop_ret);
+
+      ecma_free_property_descriptor (&prop_desc);
+    }
+
+    ecma_free_values_collection (props_p, true);
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      /* 3. */
+      ecma_set_object_extensible (obj_p, false);
+
+      /* 4. */
+      ret_value = ecma_copy_value (arg);
+    }
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_seal */
+
+/**
+ * The Object object's 'freeze' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.9
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_freeze (ecma_value_t this_arg, /**< 'this' argument */
+                                   ecma_value_t arg) /**< routine's argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  if (!ecma_is_value_object (arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    /* 2. */
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg);
+
+    ecma_collection_header_t *props_p = ecma_op_object_get_property_names (obj_p, false, false, false);
+
+
+    ecma_collection_iterator_t iter;
+    ecma_collection_iterator_init (&iter, props_p);
+
+    while (ecma_collection_iterator_next (&iter)
+           && ecma_is_value_empty (ret_value))
+    {
+      ecma_string_t *property_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+      /* 2.a */
+      ecma_property_descriptor_t prop_desc;
+
+      if (!ecma_op_object_get_own_property_descriptor (obj_p, property_name_p, &prop_desc))
+      {
+        continue;
+      }
+
+      /* 2.b */
+      if (prop_desc.is_writable_defined && prop_desc.is_writable)
+      {
+        prop_desc.is_writable = false;
+      }
+
+      /* 2.c */
+      prop_desc.is_configurable = false;
+
+      /* 2.d */
+      ECMA_TRY_CATCH (define_own_prop_ret,
+                      ecma_op_object_define_own_property (obj_p,
+                                                          property_name_p,
+                                                          &prop_desc,
+                                                          true),
+                      ret_value);
+      ECMA_FINALIZE (define_own_prop_ret);
+
+      ecma_free_property_descriptor (&prop_desc);
+    }
+
+    ecma_free_values_collection (props_p, true);
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      /* 3. */
+      ecma_set_object_extensible (obj_p, false);
+
+      /* 4. */
+      ret_value = ecma_copy_value (arg);
+    }
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_freeze */
+
+/**
+ * The Object object's 'preventExtensions' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.10
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_prevent_extensions (ecma_value_t this_arg, /**< 'this' argument */
+                                               ecma_value_t arg) /**< routine's argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg);
+    ecma_set_object_extensible (obj_p, false);
+
+    ret_value = ecma_copy_value (arg);
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_prevent_extensions */
+
+/**
+ * The Object object's 'isSealed' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.11
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_is_sealed (ecma_value_t this_arg, /**< 'this' argument */
+                                      ecma_value_t arg) /**< routine's argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  if (!ecma_is_value_object (arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg);
+
+    bool is_sealed;
+
+    /* 3. */
+    if (ecma_get_object_extensible (obj_p))
+    {
+      is_sealed = false;
+    }
+    else
+    {
+      /* the value can be updated in the loop below */
+      is_sealed = true;
+
+      /* 2. */
+      ecma_collection_header_t *props_p = ecma_op_object_get_property_names (obj_p, false, false, false);
+
+      ecma_collection_iterator_t iter;
+      ecma_collection_iterator_init (&iter, props_p);
+
+      while (ecma_collection_iterator_next (&iter))
+      {
+        ecma_string_t *property_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+        /* 2.a */
+        ecma_property_t property = ecma_op_object_get_own_property (obj_p,
+                                                                    property_name_p,
+                                                                    NULL,
+                                                                    ECMA_PROPERTY_GET_NO_OPTIONS);
+
+        /* 2.b */
+        if (ecma_is_property_configurable (property))
+        {
+          is_sealed = false;
+          break;
+        }
+      }
+
+      ecma_free_values_collection (props_p, true);
+    }
+
+    /* 4. */
+    ret_value = ecma_make_simple_value (is_sealed ? ECMA_SIMPLE_VALUE_TRUE
+                                                  : ECMA_SIMPLE_VALUE_FALSE);
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_is_sealed */
+
+/**
+ * The Object object's 'isFrozen' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.12
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_is_frozen (ecma_value_t this_arg, /**< 'this' argument */
+                                      ecma_value_t arg) /**< routine's argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  if (!ecma_is_value_object (arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg);
+
+    bool is_frozen;
+
+    /* 3. */
+    if (ecma_get_object_extensible (obj_p))
+    {
+      is_frozen = false;
+    }
+    else
+    {
+      is_frozen = true;
+
+      /* 2. */
+      ecma_collection_header_t *props_p = ecma_op_object_get_property_names (obj_p, false, false, false);
+
+      ecma_collection_iterator_t iter;
+      ecma_collection_iterator_init (&iter, props_p);
+
+      while (ecma_collection_iterator_next (&iter))
+      {
+        ecma_string_t *property_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+        /* 2.a */
+        ecma_property_t property = ecma_op_object_get_own_property (obj_p,
+                                                                    property_name_p,
+                                                                    NULL,
+                                                                    ECMA_PROPERTY_GET_NO_OPTIONS);
+
+        /* 2.b */
+        if (ECMA_PROPERTY_GET_TYPE (property) != ECMA_PROPERTY_TYPE_NAMEDACCESSOR
+            && ecma_is_property_writable (property))
+        {
+          is_frozen = false;
+          break;
+        }
+
+        /* 2.c */
+        if (ecma_is_property_configurable (property))
+        {
+          is_frozen = false;
+          break;
+        }
+      }
+
+      ecma_free_values_collection (props_p, true);
+    }
+
+    /* 4 */
+    ret_value = ecma_make_simple_value (is_frozen ? ECMA_SIMPLE_VALUE_TRUE
+                                                  : ECMA_SIMPLE_VALUE_FALSE);
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_is_frozen */
+
+/**
+ * The Object object's 'isExtensible' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.13
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_is_extensible (ecma_value_t this_arg, /**< 'this' argument */
+                                          ecma_value_t arg) /**< routine's argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (arg))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg);
+
+    bool extensible = ecma_get_object_extensible (obj_p);
+
+    ret_value = ecma_make_simple_value (extensible ? ECMA_SIMPLE_VALUE_TRUE
+                                                   : ECMA_SIMPLE_VALUE_FALSE);
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_is_extensible */
+
+/**
+ * The Object object's 'keys' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.14
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_keys (ecma_value_t this_arg, /**< 'this' argument */
+                                 ecma_value_t arg) /**< routine's argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (arg))
+  {
+    /* 1. */
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg);
+    /* 3-6. */
+    ret_value = ecma_builtin_helper_object_get_properties (obj_p, true);
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_keys */
+
+/**
+ * The Object object's 'getOwnPropertyDescriptor' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_get_own_property_descriptor (ecma_value_t this_arg, /**< 'this' argument */
+                                                        ecma_value_t arg1, /**< routine's first argument */
+                                                        ecma_value_t arg2) /**< routine's second argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  if (!ecma_is_value_object (arg1))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+    return ret_value;
+  }
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (arg1);
+
+  /* 2. */
+  ECMA_TRY_CATCH (name_str_value,
+                  ecma_op_to_string (arg2),
+                  ret_value);
+
+  ecma_string_t *name_str_p = ecma_get_string_from_value (name_str_value);
+
+  /* 3. */
+  ecma_property_descriptor_t prop_desc;
+
+  if (ecma_op_object_get_own_property_descriptor (obj_p, name_str_p, &prop_desc))
+  {
+    /* 4. */
+    ecma_object_t *desc_obj_p = ecma_op_from_property_descriptor (&prop_desc);
+
+    ecma_free_property_descriptor (&prop_desc);
+
+    ret_value = ecma_make_object_value (desc_obj_p);
+  }
+  else
+  {
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  }
+
+  ECMA_FINALIZE (name_str_value);
+
+  return ret_value;
+} /* ecma_builtin_object_object_get_own_property_descriptor */
+
+/**
+ * The Object object's 'create' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_create (ecma_value_t this_arg, /**< 'this' argument */
+                                   ecma_value_t arg1, /**< routine's first argument */
+                                   ecma_value_t arg2) /**< routine's second argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  if (!ecma_is_value_object (arg1) && !ecma_is_value_null (arg1))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = NULL;
+
+    if (!ecma_is_value_null (arg1))
+    {
+      obj_p = ecma_get_object_from_value (arg1);
+    }
+    /* 2-3. */
+    ecma_object_t *result_obj_p = ecma_op_create_object_object_noarg_and_set_prototype (obj_p);
+
+    /* 4. */
+    if (!ecma_is_value_undefined (arg2))
+    {
+      ECMA_TRY_CATCH (obj,
+                      ecma_builtin_object_object_define_properties (this_arg,
+                                                                    ecma_make_object_value (result_obj_p),
+                                                                    arg2),
+                      ret_value);
+      ECMA_FINALIZE (obj);
+    }
+
+    /* 5. */
+    if (ecma_is_value_empty (ret_value))
+    {
+      ret_value = ecma_copy_value (ecma_make_object_value (result_obj_p));
+    }
+
+    ecma_deref_object (result_obj_p);
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_create */
+
+/**
+ * The Object object's 'defineProperties' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.7
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_define_properties (ecma_value_t this_arg, /**< 'this' argument */
+                                              ecma_value_t arg1, /**< routine's first argument */
+                                              ecma_value_t arg2) /**< routine's second argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  if (!ecma_is_value_object (arg1))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg1);
+
+    /* 2. */
+    ECMA_TRY_CATCH (props,
+                    ecma_op_to_object (arg2),
+                    ret_value);
+
+    ecma_object_t *props_p = ecma_get_object_from_value (props);
+    /* 3. */
+    ecma_collection_header_t *prop_names_p = ecma_op_object_get_property_names (props_p, false, true, false);
+    uint32_t property_number = prop_names_p->unit_number;
+
+    ecma_collection_iterator_t iter;
+    ecma_collection_iterator_init (&iter, prop_names_p);
+
+    /* 4. */
+    JMEM_DEFINE_LOCAL_ARRAY (property_descriptors, property_number, ecma_property_descriptor_t);
+
+    uint32_t property_descriptor_number = 0;
+
+    while (ecma_collection_iterator_next (&iter)
+           && ecma_is_value_empty (ret_value))
+    {
+      /* 5.a */
+      ECMA_TRY_CATCH (desc_obj,
+                      ecma_op_object_get (props_p, ecma_get_string_from_value (*iter.current_value_p)),
+                      ret_value);
+
+      /* 5.b */
+      ECMA_TRY_CATCH (conv_result,
+                      ecma_op_to_property_descriptor (desc_obj,
+                                                      &property_descriptors[property_descriptor_number]),
+                      ret_value);
+
+      property_descriptor_number++;
+
+      ECMA_FINALIZE (conv_result);
+      ECMA_FINALIZE (desc_obj);
+    }
+
+    /* 6. */
+    ecma_collection_iterator_init (&iter, prop_names_p);
+    for (uint32_t index = 0;
+         index < property_number && ecma_is_value_empty (ret_value);
+         index++)
+    {
+      bool is_next = ecma_collection_iterator_next (&iter);
+      JERRY_ASSERT (is_next);
+
+      ECMA_TRY_CATCH (define_own_prop_ret,
+                      ecma_op_object_define_own_property (obj_p,
+                                                          ecma_get_string_from_value (*iter.current_value_p),
+                                                          &property_descriptors[index],
+                                                          true),
+                      ret_value);
+
+      ECMA_FINALIZE (define_own_prop_ret);
+    }
+
+    /* Clean up. */
+    for (uint32_t index = 0;
+         index < property_descriptor_number;
+         index++)
+    {
+      ecma_free_property_descriptor (&property_descriptors[index]);
+    }
+
+    JMEM_FINALIZE_LOCAL_ARRAY (property_descriptors);
+
+    ecma_free_values_collection (prop_names_p, true);
+
+    /* 7. */
+    if (ecma_is_value_empty (ret_value))
+    {
+      ret_value = ecma_copy_value (arg1);
+    }
+
+    ECMA_FINALIZE (props);
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_define_properties */
+
+/**
+ * The Object object's 'defineProperty' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.3.6
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_object_object_define_property (ecma_value_t this_arg, /**< 'this' argument */
+                                            ecma_value_t arg1, /**< routine's first argument */
+                                            ecma_value_t arg2, /**< routine's second argument */
+                                            ecma_value_t arg3) /**< routine's third argument */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (arg1))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (arg1);
+
+    ECMA_TRY_CATCH (name_str_value,
+                    ecma_op_to_string (arg2),
+                    ret_value);
+
+    ecma_string_t *name_str_p = ecma_get_string_from_value (name_str_value);
+
+    ecma_property_descriptor_t prop_desc;
+
+    ECMA_TRY_CATCH (conv_result,
+                    ecma_op_to_property_descriptor (arg3, &prop_desc),
+                    ret_value);
+
+    ECMA_TRY_CATCH (define_own_prop_ret,
+                    ecma_op_object_define_own_property (obj_p,
+                                                        name_str_p,
+                                                        &prop_desc,
+                                                        true),
+                    ret_value);
+
+    ret_value = ecma_copy_value (arg1);
+
+    ECMA_FINALIZE (define_own_prop_ret);
+    ecma_free_property_descriptor (&prop_desc);
+    ECMA_FINALIZE (conv_result);
+    ECMA_FINALIZE (name_str_value);
+  }
+
+  return ret_value;
+} /* ecma_builtin_object_object_define_property */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-object.inc.h
new file mode 100644 (file)
index 0000000..8de27d4
--- /dev/null
@@ -0,0 +1,58 @@
+/* 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.
+ */
+
+/*
+ * Object built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.2.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.2.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_GET_PROTOTYPE_OF_UL, ecma_builtin_object_object_get_prototype_of, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL, ecma_builtin_object_object_get_own_property_names, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_SEAL, ecma_builtin_object_object_seal, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_FREEZE, ecma_builtin_object_object_freeze, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_PREVENT_EXTENSIONS_UL, ecma_builtin_object_object_prevent_extensions, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_IS_SEALED_UL, ecma_builtin_object_object_is_sealed, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_IS_FROZEN_UL, ecma_builtin_object_object_is_frozen, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_IS_EXTENSIBLE, ecma_builtin_object_object_is_extensible, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_KEYS, ecma_builtin_object_object_keys, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL, ecma_builtin_object_object_get_own_property_descriptor, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_CREATE, ecma_builtin_object_object_create, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL, ecma_builtin_object_object_define_properties, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTY_UL, ecma_builtin_object_object_define_property, 3, 3)
+
+#ifndef CONFIG_DISABLE_ES2015_BUILTIN
+ROUTINE (LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL, ecma_builtin_object_object_set_prototype_of, 2, 2)
+#endif /* !CONFIG_DISABLE_ES2015_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c
new file mode 100644 (file)
index 0000000..d915a21
--- /dev/null
@@ -0,0 +1,79 @@
+/* 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.
+ */
+
+#include "ecma-globals.h"
+#include "ecma-promise-object.h"
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-promise-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID promise_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup promiseprototype ECMA Promise.prototype object built-in
+ * @{
+ */
+
+/**
+ * Promise routine: then.
+ *
+ * See also: 25.4.5.3
+ *
+ * @return ecma value of a new promise object.
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_promise_prototype_then (ecma_value_t this_arg, /**< this argument */
+                                     ecma_value_t on_fulfilled, /**< on_fulfilled function */
+                                     ecma_value_t on_rejected) /**< on_rejected function */
+{
+  return ecma_promise_then (this_arg,
+                            on_fulfilled,
+                            on_rejected);
+} /* ecma_builtin_promise_prototype_then */
+
+/**
+ * Promise routine: catch.
+ *
+ * See also: 25.4.5.1
+ *
+ * @return ecma value of a new promise object.
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_promise_prototype_catch (ecma_value_t this_arg, /**< this argument */
+                                      ecma_value_t on_rejected) /**< on_rejected function */
+{
+  return ecma_promise_then (this_arg,
+                            ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                            on_rejected);
+} /* ecma_builtin_promise_prototype_catch */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.inc.h
new file mode 100644 (file)
index 0000000..9e70297
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_PROMISE,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FLAG_WRITABLE)
+
+ROUTINE (LIT_MAGIC_STRING_THEN, ecma_builtin_promise_prototype_then, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_CATCH, ecma_builtin_promise_prototype_catch, 1, 1)
+
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c
new file mode 100644 (file)
index 0000000..3438bde
--- /dev/null
@@ -0,0 +1,695 @@
+/* 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.
+ */
+
+#include "ecma-array-object.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-number-object.h"
+#include "ecma-promise-object.h"
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-promise.inc.h"
+#define BUILTIN_UNDERSCORED_ID promise
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup promise ECMA Promise object built-in
+ * @{
+ */
+
+/**
+ * The common function for 'reject' and 'resolve'.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_promise_reject_or_resolve (ecma_value_t this_arg, /**< "this" argument */
+                                        ecma_value_t argument, /**< argument for reject or resolve */
+                                        bool is_resolve) /**< whether it is for resolve routine */
+{
+  if (!ecma_is_value_object (this_arg))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not an object."));
+  }
+
+  uint8_t builtin_id = ecma_get_object_builtin_id (ecma_get_object_from_value (this_arg));
+
+  if (builtin_id != ECMA_BUILTIN_ID_PROMISE)
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not the Promise constructor."));
+  }
+
+  if (is_resolve
+      && ecma_is_value_object (argument)
+      && ecma_is_promise (ecma_get_object_from_value (argument)))
+  {
+    return ecma_copy_value (argument);
+  }
+
+
+  ecma_value_t capability = ecma_promise_new_capability ();
+
+  if (ECMA_IS_VALUE_ERROR (capability))
+  {
+    return capability;
+  }
+
+  ecma_string_t *str;
+
+  if (is_resolve)
+  {
+    str = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
+  }
+  else
+  {
+    str = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
+  }
+
+  ecma_value_t func = ecma_op_object_get (ecma_get_object_from_value (capability), str);
+  ecma_deref_ecma_string (str);
+
+  ecma_value_t call_ret = ecma_op_function_call (ecma_get_object_from_value (func),
+                                                 ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                                 &argument,
+                                                 1);
+
+  ecma_free_value (func);
+
+  if (ECMA_IS_VALUE_ERROR (call_ret))
+  {
+    return call_ret;
+  }
+
+  ecma_free_value (call_ret);
+
+  ecma_string_t *str_promise = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_PROMISE);
+  ecma_value_t promise_new = ecma_op_object_get (ecma_get_object_from_value (capability), str_promise);
+  ecma_deref_ecma_string (str_promise);
+  ecma_free_value (capability);
+
+  return promise_new;
+} /* ecma_builtin_promise_reject_or_resolve */
+
+/**
+ * Reject the promise if the value is error.
+ *
+ * See also:
+ *         ES2015 25.4.1.1.1
+ *
+ * @return ecma value of the new promise.
+ *         Returned value must be freed with ecma_free_value.
+ */
+inline static ecma_value_t
+ecma_builtin_promise_reject_abrupt (ecma_value_t abrupt_value,
+                                    ecma_value_t capability)
+{
+  ecma_value_t reason = ecma_get_value_from_error_value (abrupt_value);
+  ecma_string_t *str_reject = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
+  ecma_value_t reject = ecma_op_object_get (ecma_get_object_from_value (capability), str_reject);
+  ecma_deref_ecma_string (str_reject);
+
+  ecma_value_t call_ret = ecma_op_function_call (ecma_get_object_from_value (reject),
+                                                 ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                                 &reason,
+                                                 1);
+  ecma_free_value (reject);
+
+  if (ECMA_IS_VALUE_ERROR (call_ret))
+  {
+    return call_ret;
+  }
+
+  ecma_free_value (call_ret);
+
+  ecma_string_t *str_promise = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_PROMISE);
+  ecma_value_t promise_new = ecma_op_object_get (ecma_get_object_from_value (capability), str_promise);
+  ecma_deref_ecma_string (str_promise);
+
+  return promise_new;
+} /* ecma_builtin_promise_reject_abrupt */
+
+/**
+ * The Promise.reject routine.
+ *
+ * See also:
+ *         ES2015 25.4.4.4
+ *
+ * @return ecma value of the new promise.
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_promise_reject (ecma_value_t this_arg, /**< 'this' argument */
+                             ecma_value_t reason) /**< the reason for reject */
+{
+  return ecma_builtin_promise_reject_or_resolve (this_arg, reason, false);
+} /* ecma_builtin_promise_reject */
+
+/**
+ * The Promise.resolve routine.
+ *
+ * See also:
+ *         ES2015 25.4.4.5
+ *
+ * @return ecma value of the new promise.
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_promise_resolve (ecma_value_t this_arg, /**< 'this' argument */
+                              ecma_value_t argument) /**< the argument for resolve */
+{
+  return ecma_builtin_promise_reject_or_resolve (this_arg, argument, true);
+} /* ecma_builtin_promise_resolve */
+
+/**
+ * Runtime Semantics: PerformPromiseRace.
+ *
+ * See also:
+ *         ES2015 25.4.4.3.1
+ *
+ * @return ecma value of the new promise.
+ *         Returned value must be freed with ecma_free_value.
+ */
+inline static ecma_value_t
+ecma_builtin_promise_do_race (ecma_value_t array, /**< the array for race */
+                              ecma_value_t capability, /**< PromiseCapability record */
+                              ecma_value_t ctor) /**< the caller of Promise.race */
+{
+  JERRY_ASSERT (ecma_is_value_object (capability)
+                && ecma_is_value_object (array)
+                && ecma_is_value_object (ctor));
+  JERRY_ASSERT (ecma_get_object_builtin_id (ecma_get_object_from_value (ctor)) == ECMA_BUILTIN_ID_PROMISE);
+  JERRY_ASSERT (ecma_get_object_type (ecma_get_object_from_value (array)) == ECMA_OBJECT_TYPE_ARRAY);
+
+  ecma_value_t ret = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+  ecma_object_t *array_p = ecma_get_object_from_value (array);
+  ecma_value_t len_value = ecma_op_object_get (array_p, magic_string_length_p);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ecma_length_t len = (ecma_length_t) ecma_get_integer_from_value (len_value);
+  ecma_fast_free_value (len_value);
+
+  ecma_string_t *str_promise = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_PROMISE);
+  ecma_string_t *str_resolve = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
+  ecma_string_t *str_reject = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
+
+  ecma_value_t resolve = ecma_op_object_get (ecma_get_object_from_value (capability),
+                                             str_resolve);
+  ecma_value_t reject = ecma_op_object_get (ecma_get_object_from_value (capability),
+                                            str_reject);
+
+  for (ecma_length_t index = 0; index <= len; index++)
+  {
+    /* b-d. */
+    if (index == len)
+    {
+      ret = ecma_op_object_get (ecma_get_object_from_value (capability), str_promise);
+      break;
+    }
+
+    /* e. */
+    ecma_string_t *str_index = ecma_new_ecma_string_from_uint32 (index);
+    ecma_value_t array_item = ecma_op_object_get (array_p, str_index);
+    ecma_deref_ecma_string (str_index);
+
+    /* h. */
+    ecma_value_t next_promise = ecma_builtin_promise_resolve (ctor, array_item);
+    ecma_free_value (array_item);
+
+    /* i. */
+    if (ECMA_IS_VALUE_ERROR (next_promise))
+    {
+      ret = next_promise;
+      break;
+    }
+
+    /* j. */
+    ecma_value_t then_result = ecma_promise_then (next_promise, resolve, reject);
+    ecma_free_value (next_promise);
+
+    /* k. */
+    if (ECMA_IS_VALUE_ERROR (then_result))
+    {
+      ret = then_result;
+      break;
+    }
+
+    ecma_free_value (then_result);
+  }
+
+  ecma_free_value (reject);
+  ecma_free_value (resolve);
+  ecma_deref_ecma_string (str_promise);
+  ecma_deref_ecma_string (str_resolve);
+  ecma_deref_ecma_string (str_reject);
+
+  JERRY_ASSERT (!ecma_is_value_empty (ret));
+
+  return ret;
+} /* ecma_builtin_promise_do_race */
+
+/**
+ * Helper function for increase or decrease the remaining count.
+ *
+ * @return the current remaining count after increase or decrease.
+ */
+static ecma_length_t
+ecma_builtin_promise_remaining_inc_or_dec (ecma_value_t remaining, /**< the remaining count */
+                                           bool is_inc) /**< whether to increase the count */
+{
+  JERRY_ASSERT (ecma_is_value_object (remaining));
+
+  ecma_object_t *remaining_p = ecma_get_object_from_value (remaining);
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) remaining_p;
+
+  JERRY_ASSERT (ext_object_p->u.class_prop.class_id == LIT_MAGIC_STRING_NUMBER_UL);
+
+  JERRY_ASSERT (ecma_is_value_integer_number (ext_object_p->u.class_prop.u.value));
+
+  ecma_length_t current = (ecma_length_t) ecma_get_integer_from_value (ext_object_p->u.class_prop.u.value);
+
+  if (is_inc)
+  {
+    current++;
+  }
+  else
+  {
+    current--;
+  }
+
+  ext_object_p->u.class_prop.u.value = ecma_make_uint32_value (current);
+
+  return current;
+} /* ecma_builtin_promise_remaining_inc_or_dec */
+
+/**
+ * Native handler for Promise.all Resolve Element Function.
+ *
+ * See also:
+ *         ES2015 25.4.4.1.2
+ *
+ * @return ecma value of undefined.
+ */
+static ecma_value_t
+ecma_builtin_promise_all_handler (const ecma_value_t function, /**< the function itself */
+                                  const ecma_value_t this, /**< this_arg of the function */
+                                  const ecma_value_t argv[], /**< argument list */
+                                  const ecma_length_t argc) /**< argument number */
+{
+  JERRY_UNUSED (this);
+  JERRY_UNUSED (argc);
+
+  ecma_value_t ret = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  /* 1. */
+  ecma_object_t *function_p = ecma_get_object_from_value (function);
+  ecma_string_t *str_already_called = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_ALREADY_CALLED);
+  ecma_value_t already_called =  ecma_op_object_get (function_p, str_already_called);
+
+  JERRY_ASSERT (ecma_is_value_boolean (already_called));
+
+  /* 2. */
+  if (ecma_is_value_true (already_called))
+  {
+    ecma_fast_free_value (already_called);
+    ecma_deref_ecma_string (str_already_called);
+
+    return ret;
+  }
+
+  /* 3. */
+  ecma_op_object_put (function_p,
+                      str_already_called,
+                      ecma_make_boolean_value (true),
+                      false);
+
+  ecma_string_t *str_index = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_INDEX);
+  ecma_string_t *str_value = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_VALUE);
+  ecma_string_t *str_capability = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
+  ecma_string_t *str_remaining = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REMAINING_ELEMENT);
+
+  /* 4-7. */
+  ecma_value_t index_val = ecma_op_object_get (function_p, str_index);
+  ecma_value_t value_array = ecma_op_object_get (function_p, str_value);
+  ecma_value_t capability = ecma_op_object_get (function_p, str_capability);
+  ecma_value_t remaining = ecma_op_object_get (function_p, str_remaining);
+
+  JERRY_ASSERT (ecma_is_value_integer_number (index_val));
+
+  /* 8. */
+  ecma_string_t *index_str = ecma_new_ecma_string_from_uint32 ((uint32_t) ecma_get_integer_from_value (index_val));
+
+  ecma_op_object_put (ecma_get_object_from_value (value_array),
+                      index_str,
+                      argv[0],
+                      false);
+  ecma_deref_ecma_string (index_str);
+
+  /* 9-10. */
+  if (ecma_builtin_promise_remaining_inc_or_dec (remaining, false) == 0)
+  {
+    ecma_string_t *str_resolve = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
+    ecma_value_t resolve = ecma_op_object_get (ecma_get_object_from_value (capability),
+                                               str_resolve);
+    ecma_deref_ecma_string (str_resolve);
+    ret = ecma_op_function_call (ecma_get_object_from_value (resolve),
+                                 ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                 &value_array,
+                                 1);
+    ecma_free_value (resolve);
+  }
+
+  ecma_free_value (remaining);
+  ecma_free_value (capability);
+  ecma_free_value (value_array);
+  ecma_fast_free_value (index_val);
+  ecma_fast_free_value (already_called);
+  ecma_deref_ecma_string (str_already_called);
+  ecma_deref_ecma_string (str_index);
+  ecma_deref_ecma_string (str_value);
+  ecma_deref_ecma_string (str_capability);
+  ecma_deref_ecma_string (str_remaining);
+
+  return ret;
+} /* ecma_builtin_promise_all_handler */
+
+/**
+ * Runtime Semantics: PerformPromiseAll.
+ *
+ * See also:
+ *         ES2015 25.4.4.1.1
+ *
+ * @return ecma value of the new promise.
+ *         Returned value must be freed with ecma_free_value.
+ */
+inline static ecma_value_t
+ecma_builtin_promise_do_all (ecma_value_t array, /**< the array for all */
+                             ecma_value_t capability, /**< PromiseCapability record */
+                             ecma_value_t ctor) /**< the caller of Promise.race */
+{
+  JERRY_ASSERT (ecma_is_value_object (capability)
+                && ecma_is_value_object (array)
+                && ecma_is_value_object (ctor));
+  JERRY_ASSERT (ecma_get_object_builtin_id (ecma_get_object_from_value (ctor)) == ECMA_BUILTIN_ID_PROMISE);
+  JERRY_ASSERT (ecma_get_object_type (ecma_get_object_from_value (array)) == ECMA_OBJECT_TYPE_ARRAY);
+
+  ecma_value_t ret = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_string_t *magic_string_length_p = ecma_new_ecma_length_string ();
+  ecma_object_t *array_p = ecma_get_object_from_value (array);
+  ecma_value_t len_value = ecma_op_object_get (array_p, magic_string_length_p);
+  ecma_deref_ecma_string (magic_string_length_p);
+  ecma_length_t len = (ecma_length_t) ecma_get_integer_from_value (len_value);
+  ecma_fast_free_value (len_value);
+
+  ecma_string_t *str_promise = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_PROMISE);
+  ecma_string_t *str_resolve = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
+  ecma_string_t *str_reject = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
+  ecma_string_t *str_already_called = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_ALREADY_CALLED);
+  ecma_string_t *str_index = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_INDEX);
+  ecma_string_t *str_value = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_VALUE);
+  ecma_string_t *str_capability = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
+  ecma_string_t *str_remaining = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REMAINING_ELEMENT);
+
+  ecma_value_t undefined_val = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  /* String '1' indicates [[Resolve]] and '2' indicates [[Reject]]. */
+  ecma_value_t resolve = ecma_op_object_get (ecma_get_object_from_value (capability),
+                                             str_resolve);
+  ecma_value_t reject = ecma_op_object_get (ecma_get_object_from_value (capability),
+                                            str_reject);
+  /* 3. */
+  ecma_value_t result_array_length_val = ecma_make_uint32_value (0);
+  ecma_value_t value_array = ecma_op_create_array_object (&result_array_length_val, 1, true);
+  ecma_free_value (result_array_length_val);
+  /* 4. */
+  ecma_value_t remaining = ecma_op_create_number_object (ecma_make_integer_value (1));
+  /* 5. */
+  ecma_length_t index = 0;
+
+  /* 6 */
+  while (true)
+  {
+    JERRY_ASSERT (index <= len);
+    /* d. */
+    if (index == len)
+    {
+      /* ii. */
+      if (ecma_builtin_promise_remaining_inc_or_dec (remaining, false) == 0)
+      {
+        /* iii. */
+        ecma_value_t resolve_ret = ecma_op_function_call (ecma_get_object_from_value (resolve),
+                                                          ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                                          &value_array,
+                                                          1);
+
+        if (ECMA_IS_VALUE_ERROR (resolve_ret))
+        {
+          ret = resolve_ret;
+          break;
+        }
+      }
+
+      /* iv. */
+      ret = ecma_op_object_get (ecma_get_object_from_value (capability), str_promise);
+      break;
+    }
+
+    /* e. h. */
+    ecma_string_t *index_str = ecma_new_ecma_string_from_uint32 (index);
+    ecma_value_t array_item = ecma_op_object_get (array_p, index_str);
+    ecma_op_object_put (ecma_get_object_from_value (value_array),
+                        index_str,
+                        undefined_val,
+                        false);
+    ecma_deref_ecma_string (index_str);
+    /* i. */
+    ecma_value_t next_promise = ecma_builtin_promise_resolve (ctor, array_item);
+    ecma_free_value (array_item);
+
+    /* j. */
+    if (ECMA_IS_VALUE_ERROR (next_promise))
+    {
+      ret = next_promise;
+      break;
+    }
+
+    /* k. */
+    ecma_object_t *res_ele_p;
+    res_ele_p = ecma_op_create_external_function_object (ecma_builtin_promise_all_handler);
+    /* l. */
+    ecma_op_object_put (res_ele_p,
+                        str_already_called,
+                        ecma_make_boolean_value (false),
+                        false);
+    /* m. */
+    ecma_op_object_put (res_ele_p,
+                        str_index,
+                        ecma_make_uint32_value (index),
+                        false);
+    /* n. */
+    ecma_op_object_put (res_ele_p,
+                        str_value,
+                        value_array,
+                        false);
+    /* o. */
+    ecma_op_object_put (res_ele_p,
+                        str_capability,
+                        capability,
+                        false);
+    /* p. */
+    ecma_op_object_put (res_ele_p,
+                        str_remaining,
+                        remaining,
+                        false);
+
+    /* q. */
+    ecma_builtin_promise_remaining_inc_or_dec (remaining, true);
+    /* r. */
+    ecma_value_t then_result = ecma_promise_then (next_promise,
+                                                  ecma_make_object_value (res_ele_p),
+                                                  reject);
+    ecma_deref_object (res_ele_p);
+    ecma_free_value (next_promise);
+
+    /* s. */
+    if (ECMA_IS_VALUE_ERROR (then_result))
+    {
+      ret = then_result;
+      break;
+    }
+
+    ecma_free_value (then_result);
+    index ++;
+  }
+
+  ecma_free_value (reject);
+  ecma_free_value (resolve);
+  ecma_free_value (remaining);
+  ecma_free_value (value_array);
+  ecma_deref_ecma_string (str_already_called);
+  ecma_deref_ecma_string (str_index);
+  ecma_deref_ecma_string (str_value);
+  ecma_deref_ecma_string (str_capability);
+  ecma_deref_ecma_string (str_remaining);
+  ecma_deref_ecma_string (str_resolve);
+  ecma_deref_ecma_string (str_reject);
+  ecma_deref_ecma_string (str_promise);
+
+  JERRY_ASSERT (!ecma_is_value_empty (ret));
+
+  return ret;
+} /* ecma_builtin_promise_do_all */
+
+/**
+ * The common function for both Promise.race and Promise.all.
+ *
+ * @return ecma value of the new promise.
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_promise_race_or_all (ecma_value_t this_arg, /**< 'this' argument */
+                                  ecma_value_t array, /**< the items to be resolved */
+                                  bool is_race) /**< indicates whether it is race function */
+{
+  if (!ecma_is_value_object (this_arg))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not an object."));
+  }
+
+  uint8_t builtin_id = ecma_get_object_builtin_id (ecma_get_object_from_value (this_arg));
+
+  if (builtin_id != ECMA_BUILTIN_ID_PROMISE)
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not the Promise constructor."));
+  }
+
+  ecma_value_t capability = ecma_promise_new_capability ();
+  ecma_value_t ret = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (array)
+      || ecma_get_object_type (ecma_get_object_from_value (array)) != ECMA_OBJECT_TYPE_ARRAY)
+  {
+    ecma_value_t error = ecma_raise_type_error (ECMA_ERR_MSG ("Second argument is not an array."));
+    ret = ecma_builtin_promise_reject_abrupt (error, capability);
+    ecma_free_value (error);
+    ecma_free_value (capability);
+
+    return ret;
+  }
+
+  if (is_race)
+  {
+    ret = ecma_builtin_promise_do_race (array, capability, this_arg);
+  }
+  else
+  {
+    ret = ecma_builtin_promise_do_all (array, capability, this_arg);
+  }
+
+  if (ECMA_IS_VALUE_ERROR (ret))
+  {
+    ret = ecma_get_value_from_error_value (ret);
+  }
+
+  ecma_free_value (capability);
+
+  return ret;
+} /* ecma_builtin_promise_race_or_all */
+
+/**
+ * The Promise.race routine.
+ *
+ * See also:
+ *         ES2015 25.4.4.3
+ *
+ * @return ecma value of the new promise.
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_promise_race (ecma_value_t this_arg, /**< 'this' argument */
+                           ecma_value_t array) /**< the items to be resolved */
+{
+  return ecma_builtin_promise_race_or_all (this_arg, array, true);
+} /* ecma_builtin_promise_race */
+
+/**
+ * The Promise.all routine.
+ *
+ * See also:
+ *         ES2015 25.4.4.1
+ *
+ * @return ecma value of the new promise.
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_promise_all (ecma_value_t this_arg, /**< 'this' argument */
+                           ecma_value_t array) /**< the items to be resolved */
+{
+  return ecma_builtin_promise_race_or_all (this_arg, array, false);
+} /* ecma_builtin_promise_all */
+
+/**
+ * Handle calling [[Call]] of built-in Promise object.
+ *
+ * ES2015 25.4.3 Promise is not intended to be called
+ * as a function and will throw an exception when called
+ * in that manner.
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_promise_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                    ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Promise requires 'new'."));
+} /* ecma_builtin_promise_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in Promise object.
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_promise_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                         ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  if (arguments_list_len == 0 || !ecma_op_is_callable (arguments_list_p[0]))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("First parameter must be callable."));
+  }
+
+  return ecma_op_create_promise_object (arguments_list_p[0], ECMA_PROMISE_EXECUTOR_FUNCTION);
+} /* ecma_builtin_promise_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-promise.inc.h
new file mode 100644 (file)
index 0000000..ade0a8f
--- /dev/null
@@ -0,0 +1,47 @@
+/* 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.
+ */
+
+/*
+ * Promose built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_PROMISE_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_REJECT, ecma_builtin_promise_reject, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_RESOLVE, ecma_builtin_promise_resolve, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_RACE, ecma_builtin_promise_race, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_ALL, ecma_builtin_promise_all, 1, 1)
+
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror-prototype.c
new file mode 100644 (file)
index 0000000..57e3f1b
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-rangeerror-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID range_error_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror-prototype.inc.h
new file mode 100644 (file)
index 0000000..9b0651e
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+/*
+ * RangeError.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.7.8 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_RANGE_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.9 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_RANGE_ERROR_UL,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.10 */
+STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
+              LIT_MAGIC_STRING__EMPTY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c
new file mode 100644 (file)
index 0000000..f0a29dd
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-rangeerror.inc.h"
+#define BUILTIN_UNDERSCORED_ID range_error
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup rangeerror ECMA RangeError object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in RangeError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_range_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                        ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_RANGE, arguments_list_p, arguments_list_len);
+} /* ecma_builtin_range_error_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in RangeError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_range_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                             ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_range_error_dispatch_call (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_range_error_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.inc.h
new file mode 100644 (file)
index 0000000..a309571
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/*
+ * RangeError built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.11.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror-prototype.c
new file mode 100644 (file)
index 0000000..3b9bb82
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-referenceerror-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID reference_error_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror-prototype.inc.h
new file mode 100644 (file)
index 0000000..44ad7ef
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+/*
+ * ReferenceError.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.7.8 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_REFERENCE_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.9 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_REFERENCE_ERROR_UL,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.10 */
+STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
+              LIT_MAGIC_STRING__EMPTY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c
new file mode 100644 (file)
index 0000000..950a040
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-referenceerror.inc.h"
+#define BUILTIN_UNDERSCORED_ID reference_error
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup referenceerror ECMA ReferenceError object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in ReferenceError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_reference_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                            ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_REFERENCE, arguments_list_p, arguments_list_len);
+} /* ecma_builtin_reference_error_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in ReferenceError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_reference_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                                 ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_reference_error_dispatch_call (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_reference_error_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.inc.h
new file mode 100644 (file)
index 0000000..bf7729f
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/*
+ * ReferenceError built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.11.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c
new file mode 100644 (file)
index 0000000..74fa0ff
--- /dev/null
@@ -0,0 +1,440 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-array-object.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+#include "ecma-regexp-object.h"
+#include "re-compiler.h"
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-regexp-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID regexp_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup regexpprototype ECMA RegExp.prototype object built-in
+ * @{
+ */
+
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+
+/**
+ * The RegExp.prototype object's 'compile' routine
+ *
+ * See also:
+ *          ECMA-262 v5, B.2.5.1
+ *
+ * @return undefined        - if compiled successfully
+ *         error ecma value - otherwise
+ *
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this argument */
+                                       ecma_value_t pattern_arg, /**< pattern or RegExp object */
+                                       ecma_value_t flags_arg) /**< flags */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (this_arg)
+      || !ecma_object_class_is (ecma_get_object_from_value (this_arg), LIT_MAGIC_STRING_REGEXP_UL))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Incomplete RegExp type"));
+  }
+  else
+  {
+    uint16_t flags = 0;
+
+    if (ecma_is_value_object (pattern_arg)
+        && ecma_object_class_is (ecma_get_object_from_value (pattern_arg), LIT_MAGIC_STRING_REGEXP_UL))
+    {
+      if (!ecma_is_value_undefined (flags_arg))
+      {
+        ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument of RegExp compile."));
+      }
+      else
+      {
+        /* Compile from existing RegExp pbject. */
+        ecma_object_t *target_p = ecma_get_object_from_value (pattern_arg);
+
+        /* Get source. */
+        ecma_string_t *magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE);
+        ecma_value_t source_value = ecma_op_object_get_own_data_prop (target_p, magic_string_p);
+        ecma_deref_ecma_string (magic_string_p);
+        ecma_string_t *pattern_string_p = ecma_get_string_from_value (source_value);
+
+        /* Get flags. */
+        magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL);
+        ecma_value_t global_value = ecma_op_object_get_own_data_prop (target_p, magic_string_p);
+        ecma_deref_ecma_string (magic_string_p);
+
+        JERRY_ASSERT (ecma_is_value_boolean (global_value));
+
+        if (ecma_is_value_true (global_value))
+        {
+          flags |= RE_FLAG_GLOBAL;
+        }
+
+        magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL);
+        ecma_value_t ignore_case_value = ecma_op_object_get_own_data_prop (target_p, magic_string_p);
+        ecma_deref_ecma_string (magic_string_p);
+
+        JERRY_ASSERT (ecma_is_value_boolean (ignore_case_value));
+
+        if (ecma_is_value_true (ignore_case_value))
+        {
+          flags |= RE_FLAG_IGNORE_CASE;
+        }
+
+        magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE);
+        ecma_value_t multiline_value = ecma_op_object_get_own_data_prop (target_p, magic_string_p);
+        ecma_deref_ecma_string (magic_string_p);
+
+        JERRY_ASSERT (ecma_is_value_boolean (multiline_value));
+
+        if (ecma_is_value_true (multiline_value))
+        {
+          flags |= RE_FLAG_MULTILINE;
+        }
+
+        ECMA_TRY_CATCH (obj_this, ecma_op_to_object (this_arg), ret_value);
+        ecma_object_t *this_obj_p = ecma_get_object_from_value (obj_this);
+
+        /* Get bytecode property. */
+        ecma_value_t *bc_prop_p = &(((ecma_extended_object_t *) this_obj_p)->u.class_prop.u.value);
+
+        /* TODO: We currently have to re-compile the bytecode, because
+         * we can't copy it without knowing its length. */
+        const re_compiled_code_t *new_bc_p = NULL;
+        ecma_value_t bc_comp = re_compile_bytecode (&new_bc_p, pattern_string_p, flags);
+        /* Should always succeed, since we're compiling from a source that has been compiled previously. */
+        JERRY_ASSERT (ecma_is_value_empty (bc_comp));
+
+        ecma_deref_ecma_string (pattern_string_p);
+
+        re_compiled_code_t *old_bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t, *bc_prop_p);
+
+        if (old_bc_p != NULL)
+        {
+          /* Free the old bytecode */
+          ecma_bytecode_deref ((ecma_compiled_code_t *) old_bc_p);
+        }
+
+        ECMA_SET_INTERNAL_VALUE_POINTER (*bc_prop_p, new_bc_p);
+
+        re_initialize_props (this_obj_p, pattern_string_p, flags);
+
+        ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+        ECMA_FINALIZE (obj_this);
+      }
+    }
+    else
+    {
+      ecma_string_t *pattern_string_p = NULL;
+
+      /* Get source string. */
+      if (!ecma_is_value_undefined (pattern_arg))
+      {
+        ECMA_TRY_CATCH (regexp_str_value,
+                        ecma_op_to_string (pattern_arg),
+                        ret_value);
+
+        if (ecma_string_is_empty (ecma_get_string_from_value (regexp_str_value)))
+        {
+          pattern_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP);
+        }
+        else
+        {
+          pattern_string_p = ecma_get_string_from_value (regexp_str_value);
+          ecma_ref_ecma_string (pattern_string_p);
+        }
+
+        ECMA_FINALIZE (regexp_str_value);
+      }
+      else
+      {
+        pattern_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP);
+      }
+
+      /* Parse flags. */
+      if (ecma_is_value_empty (ret_value) && !ecma_is_value_undefined (flags_arg))
+      {
+        ECMA_TRY_CATCH (flags_str_value,
+                        ecma_op_to_string (flags_arg),
+                        ret_value);
+
+        ECMA_TRY_CATCH (flags_dummy,
+                        re_parse_regexp_flags (ecma_get_string_from_value (flags_str_value), &flags),
+                        ret_value);
+        ECMA_FINALIZE (flags_dummy);
+        ECMA_FINALIZE (flags_str_value);
+      }
+
+      if (ecma_is_value_empty (ret_value))
+      {
+        ECMA_TRY_CATCH (obj_this, ecma_op_to_object (this_arg), ret_value);
+        ecma_object_t *this_obj_p = ecma_get_object_from_value (obj_this);
+
+        ecma_value_t *bc_prop_p = &(((ecma_extended_object_t *) this_obj_p)->u.class_prop.u.value);
+
+        /* Try to compile bytecode from new source. */
+        const re_compiled_code_t *new_bc_p = NULL;
+        ECMA_TRY_CATCH (bc_dummy,
+                        re_compile_bytecode (&new_bc_p, pattern_string_p, flags),
+                        ret_value);
+
+        re_compiled_code_t *old_bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t, *bc_prop_p);
+
+        if (old_bc_p != NULL)
+        {
+          /* Free the old bytecode */
+          ecma_bytecode_deref ((ecma_compiled_code_t *) old_bc_p);
+        }
+
+        ECMA_SET_INTERNAL_VALUE_POINTER (*bc_prop_p, new_bc_p);
+        re_initialize_props (this_obj_p, pattern_string_p, flags);
+        ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+        ECMA_FINALIZE (bc_dummy);
+
+        ECMA_FINALIZE (obj_this);
+      }
+
+      if (pattern_string_p != NULL)
+      {
+        ecma_deref_ecma_string (pattern_string_p);
+      }
+    }
+  }
+
+  return ret_value;
+} /* ecma_builtin_regexp_prototype_compile */
+
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+
+/**
+ * The RegExp.prototype object's 'exec' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.10.6.2
+ *
+ * @return array object containing the results - if the matched
+ *         null                                - otherwise
+ *
+ *         May raise error, so returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_regexp_prototype_exec (ecma_value_t this_arg, /**< this argument */
+                                    ecma_value_t arg) /**< routine's argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (this_arg)
+      || !ecma_object_class_is (ecma_get_object_from_value (this_arg), LIT_MAGIC_STRING_REGEXP_UL))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Incomplete RegExp type"));
+  }
+  else
+  {
+    ECMA_TRY_CATCH (obj_this, ecma_op_to_object (this_arg), ret_value);
+
+    ECMA_TRY_CATCH (input_str_value,
+                    ecma_op_to_string (arg),
+                    ret_value);
+
+    ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+    ecma_value_t *bytecode_prop_p = &(((ecma_extended_object_t *) obj_p)->u.class_prop.u.value);
+
+    void *bytecode_p = ECMA_GET_INTERNAL_VALUE_POINTER (void, *bytecode_prop_p);
+
+    if (bytecode_p == NULL)
+    {
+      /* Missing bytecode means empty RegExp: '/(?:)/', so always return empty string. */
+      ecma_string_t *capture_str_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+
+      ecma_value_t arguments_list[1];
+      arguments_list[0] = ecma_make_string_value (capture_str_p);
+
+      ret_value = ecma_op_create_array_object (arguments_list, 1, false);
+
+      ecma_deref_ecma_string (capture_str_p);
+
+      re_set_result_array_properties (ecma_get_object_from_value (ret_value),
+                                      ecma_get_string_from_value (input_str_value),
+                                      1,
+                                      0);
+    }
+    else
+    {
+      ret_value = ecma_regexp_exec_helper (obj_this, input_str_value, false);
+    }
+
+    ECMA_FINALIZE (input_str_value);
+    ECMA_FINALIZE (obj_this);
+  }
+
+  return ret_value;
+} /* ecma_builtin_regexp_prototype_exec */
+
+/**
+ * The RegExp.prototype object's 'test' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.10.6.3
+ *
+ * @return true  - if match is not null
+ *         false - otherwise
+ *
+ *         May raise error, so returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_regexp_prototype_test (ecma_value_t this_arg, /**< this argument */
+                                    ecma_value_t arg) /**< routine's argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (match_value,
+                  ecma_builtin_regexp_prototype_exec (this_arg, arg),
+                  ret_value);
+
+  ret_value = ecma_make_boolean_value (!ecma_is_value_null (match_value));
+
+  ECMA_FINALIZE (match_value);
+
+  return ret_value;
+} /* ecma_builtin_regexp_prototype_test */
+
+/**
+ * The RegExp.prototype object's 'toString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.10.6.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_regexp_prototype_to_string (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (this_arg)
+      || !ecma_object_class_is (ecma_get_object_from_value (this_arg), LIT_MAGIC_STRING_REGEXP_UL))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Incomplete RegExp type"));
+  }
+  else
+  {
+    ECMA_TRY_CATCH (obj_this,
+                    ecma_op_to_object (this_arg),
+                    ret_value);
+
+    ecma_object_t *obj_p = ecma_get_object_from_value (obj_this);
+
+    /* Get RegExp source from the source property */
+    ecma_string_t *magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE);
+    ecma_value_t source_value = ecma_op_object_get_own_data_prop (obj_p, magic_string_p);
+    ecma_deref_ecma_string (magic_string_p);
+
+    ecma_string_t *src_sep_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_SLASH_CHAR);
+    ecma_string_t *source_str_p = ecma_get_string_from_value (source_value);
+    ecma_string_t *output_str_p = ecma_concat_ecma_strings (src_sep_str_p, source_str_p);
+    ecma_deref_ecma_string (source_str_p);
+
+    ecma_string_t *concat_p = ecma_concat_ecma_strings (output_str_p, src_sep_str_p);
+    ecma_deref_ecma_string (src_sep_str_p);
+    ecma_deref_ecma_string (output_str_p);
+    output_str_p = concat_p;
+
+    /* Check the global flag */
+    magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL);
+    ecma_value_t global_value = ecma_op_object_get_own_data_prop (obj_p, magic_string_p);
+    ecma_deref_ecma_string (magic_string_p);
+
+    JERRY_ASSERT (ecma_is_value_boolean (global_value));
+
+    if (ecma_is_value_true (global_value))
+    {
+      ecma_string_t *g_flag_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_G_CHAR);
+      concat_p = ecma_concat_ecma_strings (output_str_p, g_flag_str_p);
+      ecma_deref_ecma_string (output_str_p);
+      ecma_deref_ecma_string (g_flag_str_p);
+      output_str_p = concat_p;
+    }
+
+    /* Check the ignoreCase flag */
+    magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL);
+    ecma_value_t ignore_case_value = ecma_op_object_get_own_data_prop (obj_p, magic_string_p);
+    ecma_deref_ecma_string (magic_string_p);
+
+    JERRY_ASSERT (ecma_is_value_boolean (ignore_case_value));
+
+    if (ecma_is_value_true (ignore_case_value))
+    {
+      ecma_string_t *ic_flag_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_I_CHAR);
+      concat_p = ecma_concat_ecma_strings (output_str_p, ic_flag_str_p);
+      ecma_deref_ecma_string (output_str_p);
+      ecma_deref_ecma_string (ic_flag_str_p);
+      output_str_p = concat_p;
+    }
+
+    /* Check the multiline flag */
+    magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE);
+    ecma_value_t multiline_value = ecma_op_object_get_own_data_prop (obj_p, magic_string_p);
+    ecma_deref_ecma_string (magic_string_p);
+
+    JERRY_ASSERT (ecma_is_value_boolean (multiline_value));
+
+    if (ecma_is_value_true (multiline_value))
+    {
+      ecma_string_t *m_flag_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_M_CHAR);
+      concat_p = ecma_concat_ecma_strings (output_str_p, m_flag_str_p);
+      ecma_deref_ecma_string (output_str_p);
+      ecma_deref_ecma_string (m_flag_str_p);
+      output_str_p = concat_p;
+    }
+
+    ret_value = ecma_make_string_value (output_str_p);
+
+    ECMA_FINALIZE (obj_this);
+  }
+
+  return ret_value;
+} /* ecma_builtin_regexp_prototype_to_string */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.inc.h
new file mode 100644 (file)
index 0000000..9c2c305
--- /dev/null
@@ -0,0 +1,63 @@
+/* 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.
+ */
+
+/*
+ * RegExp.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+/* ECMA-262 v5, 15.10.6.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_REGEXP,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.10.7.1 */
+STRING_VALUE (LIT_MAGIC_STRING_SOURCE,
+              LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.10.7.2 */
+SIMPLE_VALUE (LIT_MAGIC_STRING_GLOBAL,
+              ECMA_SIMPLE_VALUE_FALSE,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.10.7.3 */
+SIMPLE_VALUE (LIT_MAGIC_STRING_IGNORECASE_UL,
+              ECMA_SIMPLE_VALUE_FALSE,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.10.7.4 */
+SIMPLE_VALUE (LIT_MAGIC_STRING_MULTILINE,
+              ECMA_SIMPLE_VALUE_FALSE,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.10.7.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LASTINDEX_UL,
+              0,
+              ECMA_PROPERTY_FLAG_WRITABLE)
+
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+ROUTINE (LIT_MAGIC_STRING_COMPILE, ecma_builtin_regexp_prototype_compile, 2, 1)
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+ROUTINE (LIT_MAGIC_STRING_EXEC, ecma_builtin_regexp_prototype_exec, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_TEST, ecma_builtin_regexp_prototype_test, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_regexp_prototype_to_string, 0, 0)
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c
new file mode 100644 (file)
index 0000000..0c0967f
--- /dev/null
@@ -0,0 +1,159 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-regexp-object.h"
+#include "ecma-try-catch-macro.h"
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-regexp.inc.h"
+#define BUILTIN_UNDERSCORED_ID regexp
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup regexp ECMA RegExp object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in RegExp object
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_regexp_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                   ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_regexp_dispatch_construct (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_regexp_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in RegExp object
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_regexp_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                        ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_value_t pattern_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  ecma_value_t flags_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+  if (arguments_list_len > 0)
+  {
+    /* pattern string or RegExp object */
+    pattern_value = arguments_list_p[0];
+
+    if (arguments_list_len > 1)
+    {
+      flags_value = arguments_list_p[1];
+    }
+  }
+
+  if (ecma_is_value_object (pattern_value)
+      && ecma_object_class_is (ecma_get_object_from_value (pattern_value), LIT_MAGIC_STRING_REGEXP_UL))
+  {
+    if (ecma_is_value_undefined (flags_value))
+    {
+      ret_value = ecma_copy_value (pattern_value);
+    }
+    else
+    {
+      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument of RegExp call."));
+    }
+  }
+  else
+  {
+    ecma_string_t *pattern_string_p = NULL;
+    ecma_string_t *flags_string_p = NULL;
+
+    if (!ecma_is_value_undefined (pattern_value))
+    {
+      ECMA_TRY_CATCH (regexp_str_value,
+                      ecma_op_to_string (pattern_value),
+                      ret_value);
+
+      if (ecma_string_is_empty (ecma_get_string_from_value (regexp_str_value)))
+      {
+        pattern_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP);
+      }
+      else
+      {
+        pattern_string_p = ecma_get_string_from_value (regexp_str_value);
+        ecma_ref_ecma_string (pattern_string_p);
+      }
+
+      ECMA_FINALIZE (regexp_str_value);
+    }
+    else
+    {
+      pattern_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP);
+    }
+
+    if (ecma_is_value_empty (ret_value) && !ecma_is_value_undefined (flags_value))
+    {
+      ECMA_TRY_CATCH (flags_str_value,
+                      ecma_op_to_string (flags_value),
+                      ret_value);
+
+      flags_string_p = ecma_get_string_from_value (flags_str_value);
+      ecma_ref_ecma_string (flags_string_p);
+
+      ECMA_FINALIZE (flags_str_value);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      ret_value = ecma_op_create_regexp_object (pattern_string_p, flags_string_p);
+    }
+
+    if (pattern_string_p != NULL)
+    {
+      ecma_deref_ecma_string (pattern_string_p);
+    }
+
+    if (flags_string_p != NULL)
+    {
+      ecma_deref_ecma_string (flags_string_p);
+    }
+  }
+
+  return ret_value;
+} /* ecma_builtin_regexp_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.inc.h
new file mode 100644 (file)
index 0000000..60ae51d
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * RegExp built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+/* ECMA-262 v5, 15.10.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              2,
+              ECMA_PROPERTY_FIXED)
+
+/* ECMA-262 v5, 15.10.5.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_REGEXP_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c
new file mode 100644 (file)
index 0000000..fc238c9
--- /dev/null
@@ -0,0 +1,2254 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-array-object.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+#include "jrt-libc-includes.h"
+#include "lit-char-helpers.h"
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+#include "ecma-regexp-object.h"
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+
+#ifndef CONFIG_DISABLE_STRING_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-string-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID string_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup stringprototype ECMA String.prototype object built-in
+ * @{
+ */
+
+/**
+ * The String.prototype object's 'toString' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_to_string (ecma_value_t this_arg) /**< this argument */
+{
+  if (ecma_is_value_string (this_arg))
+  {
+    return ecma_copy_value (this_arg);
+  }
+  else if (ecma_is_value_object (this_arg))
+  {
+    ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
+
+    if (ecma_object_class_is (object_p, LIT_MAGIC_STRING_STRING_UL))
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      JERRY_ASSERT (ecma_is_value_string (ext_object_p->u.class_prop.u.value));
+
+      return ecma_copy_value (ext_object_p->u.class_prop.u.value);
+    }
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a String or a String object."));
+} /* ecma_builtin_string_prototype_object_to_string */
+
+/**
+ * The String.prototype object's 'valueOf' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_value_of (ecma_value_t this_arg) /**< this argument */
+{
+  return ecma_builtin_string_prototype_object_to_string (this_arg);
+} /* ecma_builtin_string_prototype_object_value_of */
+
+/**
+ * The String.prototype object's 'charAt' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_char_at (ecma_value_t this_arg, /**< this argument */
+                                              ecma_value_t arg) /**< routine's argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1 */
+  ECMA_TRY_CATCH (check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2 */
+  ECMA_TRY_CATCH (to_string_val,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  /* 3 */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (index_num,
+                               arg,
+                               ret_value);
+
+  /* 4 */
+  ecma_string_t *original_string_p = ecma_get_string_from_value (to_string_val);
+  const ecma_length_t len = ecma_string_get_length (original_string_p);
+
+  /* 5 */
+  if (index_num < 0 || index_num >= len || !len)
+  {
+    ret_value = ecma_make_string_value (ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY));
+  }
+  else
+  {
+    /* 6 */
+    ecma_char_t new_ecma_char = ecma_string_get_char_at_pos (original_string_p, ecma_number_to_uint32 (index_num));
+    ret_value = ecma_make_string_value (ecma_new_ecma_string_from_code_unit (new_ecma_char));
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (index_num);
+
+  ECMA_FINALIZE (to_string_val);
+  ECMA_FINALIZE (check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_char_at */
+
+/**
+ * The String.prototype object's 'charCodeAt' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_char_code_at (ecma_value_t this_arg, /**< this argument */
+                                                   ecma_value_t arg) /**< routine's argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1 */
+  ECMA_TRY_CATCH (check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2 */
+  ECMA_TRY_CATCH (to_string_val,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  /* 3 */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (index_num,
+                               arg,
+                               ret_value);
+
+  /* 4 */
+  ecma_string_t *original_string_p = ecma_get_string_from_value (to_string_val);
+  const ecma_length_t len = ecma_string_get_length (original_string_p);
+
+  /* 5 */
+  // When index_num is NaN, then the first two comparisons are false
+  if (index_num < 0 || index_num >= len || (ecma_number_is_nan (index_num) && !len))
+  {
+    ret_value = ecma_make_nan_value ();
+  }
+  else
+  {
+    /* 6 */
+    /*
+     * String length is currently uit32_t, but index_num may be bigger,
+     * ToInteger performs floor, while ToUInt32 performs modulo 2^32,
+     * hence after the check 0 <= index_num < len we assume to_uint32 can be used.
+     * We assume to_uint32 (NaN) is 0.
+     */
+    JERRY_ASSERT (ecma_number_is_nan (index_num) || ecma_number_to_uint32 (index_num) == ecma_number_trunc (index_num));
+
+    ecma_char_t new_ecma_char = ecma_string_get_char_at_pos (original_string_p, ecma_number_to_uint32 (index_num));
+    ret_value = ecma_make_uint32_value (new_ecma_char);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (index_num);
+
+  ECMA_FINALIZE (to_string_val);
+  ECMA_FINALIZE (check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_char_code_at */
+
+/**
+ * The String.prototype object's 'concat' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.6
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_concat (ecma_value_t this_arg, /**< this argument */
+                                             const ecma_value_t *argument_list_p, /**< arguments list */
+                                             ecma_length_t arguments_number) /**< number of arguments */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1 */
+  ECMA_TRY_CATCH (check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2 */
+  ECMA_TRY_CATCH (to_string_val,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  /* 3 */
+  /* No copy performed */
+
+  /* 4 */
+  ecma_string_t *string_to_return = ecma_get_string_from_value (to_string_val);
+  ecma_ref_ecma_string (string_to_return);
+
+  /* 5 */
+  for (uint32_t arg_index = 0;
+       arg_index < arguments_number && ecma_is_value_empty (ret_value);
+       ++arg_index)
+  {
+    /* 5a */
+    /* 5b */
+    ecma_string_t *string_temp = string_to_return;
+
+    ECMA_TRY_CATCH (get_arg_string,
+                    ecma_op_to_string (argument_list_p[arg_index]),
+                    ret_value);
+
+    string_to_return = ecma_concat_ecma_strings (string_to_return, ecma_get_string_from_value (get_arg_string));
+
+    ecma_deref_ecma_string (string_temp);
+
+    ECMA_FINALIZE (get_arg_string);
+  }
+
+  /* 6 */
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = ecma_make_string_value (string_to_return);
+  }
+  else
+  {
+    ecma_deref_ecma_string (string_to_return);
+  }
+
+  ECMA_FINALIZE (to_string_val);
+  ECMA_FINALIZE (check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_concat */
+
+/**
+ * The String.prototype object's 'indexOf' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.7
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_index_of (ecma_value_t this_arg, /**< this argument */
+                                               ecma_value_t arg1, /**< routine's first argument */
+                                               ecma_value_t arg2) /**< routine's second argument */
+{
+  return ecma_builtin_helper_string_prototype_object_index_of (this_arg, arg1, arg2, true);
+} /* ecma_builtin_string_prototype_object_index_of */
+
+/**
+ * The String.prototype object's 'lastIndexOf' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.8
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_last_index_of (ecma_value_t this_arg, /**< this argument */
+                                                    ecma_value_t arg1, /**< routine's first argument */
+                                                    ecma_value_t arg2) /**< routine's second argument */
+{
+  return ecma_builtin_helper_string_prototype_object_index_of (this_arg, arg1, arg2, false);
+} /* ecma_builtin_string_prototype_object_last_index_of */
+
+/**
+ * The String.prototype object's 'localeCompare' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.9
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_locale_compare (ecma_value_t this_arg, /**< this argument */
+                                                     ecma_value_t arg) /**< routine's argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (this_check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2. */
+  ECMA_TRY_CATCH (this_to_string_val,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  /* 3. */
+  ECMA_TRY_CATCH (arg_to_string_val,
+                  ecma_op_to_string (arg),
+                  ret_value);
+
+  ecma_string_t *this_string_p = ecma_get_string_from_value (this_to_string_val);
+  ecma_string_t *arg_string_p = ecma_get_string_from_value (arg_to_string_val);
+
+  ecma_number_t result = ECMA_NUMBER_ZERO;
+
+  if (ecma_compare_ecma_strings_relational (this_string_p, arg_string_p))
+  {
+    result = ECMA_NUMBER_MINUS_ONE;
+  }
+  else if (!ecma_compare_ecma_strings (this_string_p, arg_string_p))
+  {
+    result = ECMA_NUMBER_ONE;
+  }
+  else
+  {
+    result = ECMA_NUMBER_ZERO;
+  }
+
+  ret_value = ecma_make_number_value (result);
+
+  ECMA_FINALIZE (arg_to_string_val);
+  ECMA_FINALIZE (this_to_string_val);
+  ECMA_FINALIZE (this_check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_locale_compare */
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+/**
+ * The String.prototype object's 'match' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.10
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_match (ecma_value_t this_arg, /**< this argument */
+                                            ecma_value_t arg) /**< routine's argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (this_check_coercible_value,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2. */
+  ECMA_TRY_CATCH (this_to_string_value,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  ecma_value_t regexp_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  /* 3. */
+  if (ecma_is_value_object (arg)
+      && ecma_object_class_is (ecma_get_object_from_value (arg), LIT_MAGIC_STRING_REGEXP_UL))
+  {
+    regexp_value = ecma_copy_value (arg);
+  }
+  else
+  {
+    /* 4. */
+    ecma_value_t regexp_arguments[1] = { arg };
+    ECMA_TRY_CATCH (new_regexp_value,
+                    ecma_builtin_regexp_dispatch_construct (regexp_arguments, 1),
+                    ret_value);
+
+    regexp_value = ecma_copy_value (new_regexp_value);
+
+    ECMA_FINALIZE (new_regexp_value);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    JERRY_ASSERT (!ecma_is_value_empty (regexp_value));
+    ecma_object_t *regexp_obj_p = ecma_get_object_from_value (regexp_value);
+    ecma_string_t *global_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL);
+
+    /* 5. */
+    ECMA_TRY_CATCH (global_value,
+                    ecma_op_object_get (regexp_obj_p, global_string_p),
+                    ret_value);
+
+    JERRY_ASSERT (ecma_is_value_boolean (global_value));
+
+    if (ecma_is_value_false (global_value))
+    {
+      /* 7. */
+      ret_value = ecma_regexp_exec_helper (regexp_value, this_to_string_value, false);
+    }
+    else
+    {
+      /* 8.a. */
+      ecma_string_t *index_zero_string_p = ecma_new_ecma_string_from_uint32 (0);
+
+      ecma_string_t *last_index_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL);
+
+      ECMA_TRY_CATCH (put_value,
+                      ecma_op_object_put (regexp_obj_p,
+                                          last_index_string_p,
+                                          ecma_make_integer_value (0),
+                                          true),
+                      ret_value);
+
+      /* 8.b. */
+      ECMA_TRY_CATCH (new_array_value,
+                      ecma_op_create_array_object (NULL, 0, false),
+                      ret_value);
+
+      ecma_object_t *new_array_obj_p = ecma_get_object_from_value (new_array_value);
+
+      /* 8.c. */
+      ecma_number_t previous_last_index = 0;
+      /* 8.d. */
+      uint32_t n = 0;
+      /* 8.e. */
+      bool last_match = true;
+
+      /* 8.f. */
+      while (last_match && ecma_is_value_empty (ret_value))
+      {
+        /* 8.f.i. */
+        ECMA_TRY_CATCH (exec_value,
+                        ecma_regexp_exec_helper (regexp_value, this_to_string_value, false),
+                        ret_value);
+
+        if (ecma_is_value_null (exec_value))
+        {
+          /* 8.f.ii. */
+          last_match = false;
+        }
+        else
+        {
+          /* 8.f.iii. */
+          ECMA_TRY_CATCH (this_index_value,
+                          ecma_op_object_get (regexp_obj_p, last_index_string_p),
+                          ret_value);
+
+          ECMA_TRY_CATCH (this_index_number,
+                          ecma_op_to_number (this_index_value),
+                          ret_value);
+
+          ecma_number_t this_index = ecma_get_number_from_value (this_index_number);
+
+          /* 8.f.iii.2. */
+          if (this_index == previous_last_index)
+          {
+            /* 8.f.iii.2.a. */
+            ECMA_TRY_CATCH (index_put_value,
+                            ecma_op_object_put (regexp_obj_p,
+                                                last_index_string_p,
+                                                ecma_make_number_value (this_index + 1),
+                                                true),
+                            ret_value);
+
+            /* 8.f.iii.2.b. */
+            previous_last_index = this_index + 1;
+
+            ECMA_FINALIZE (index_put_value);
+          }
+          else
+          {
+            /* 8.f.iii.3. */
+            previous_last_index = this_index;
+          }
+
+          if (ecma_is_value_empty (ret_value))
+          {
+            /* 8.f.iii.4. */
+            JERRY_ASSERT (ecma_is_value_object (exec_value));
+            ecma_object_t *exec_obj_p = ecma_get_object_from_value (exec_value);
+
+            ECMA_TRY_CATCH (match_string_value,
+                            ecma_op_object_get (exec_obj_p, index_zero_string_p),
+                            ret_value);
+
+            ecma_string_t *current_index_str_p = ecma_new_ecma_string_from_uint32 (n);
+
+            /* 8.f.iii.5. */
+            ecma_value_t completion = ecma_builtin_helper_def_prop (new_array_obj_p,
+                                                                    current_index_str_p,
+                                                                    match_string_value,
+                                                                    true, /* Writable */
+                                                                    true, /* Enumerable */
+                                                                    true, /* Configurable */
+                                                                    false); /* Failure handling */
+
+            JERRY_ASSERT (ecma_is_value_true (completion));
+
+            ecma_deref_ecma_string (current_index_str_p);
+
+            /* 8.f.iii.6. */
+            n++;
+
+            ECMA_FINALIZE (match_string_value);
+          }
+
+          ECMA_FINALIZE (this_index_number);
+
+          ECMA_FINALIZE (this_index_value);
+        }
+
+        ECMA_FINALIZE (exec_value);
+      }
+
+      if (ecma_is_value_empty (ret_value))
+      {
+        if (n == 0)
+        {
+          /* 8.g. */
+          ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+        }
+        else
+        {
+          /* 8.h. */
+          ret_value = ecma_copy_value (new_array_value);
+        }
+      }
+
+      ECMA_FINALIZE (new_array_value);
+
+      ECMA_FINALIZE (put_value);
+
+      ecma_deref_ecma_string (last_index_string_p);
+      ecma_deref_ecma_string (index_zero_string_p);
+    }
+
+    ECMA_FINALIZE (global_value);
+
+    ecma_deref_ecma_string (global_string_p);
+
+    ecma_free_value (regexp_value);
+  }
+
+  ECMA_FINALIZE (this_to_string_value);
+
+  ECMA_FINALIZE (this_check_coercible_value);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_match */
+
+/**
+ * This structure is the context which represents
+ * the state of the ongoing string replace.
+ */
+typedef struct
+{
+  /* General part. */
+  bool is_regexp; /**< whether we search a regexp or string */
+  bool is_global; /**< global search or not */
+  bool is_replace_callable; /**< replace part is callable or not */
+  ecma_value_t input_string; /**< input string */
+  ecma_length_t input_length; /**< input string length */
+  ecma_value_t regexp_or_search_string; /**< regular expression or search string
+                                         * depending on the value of is_regexp */
+  ecma_length_t match_start; /**< starting position of the match */
+  ecma_length_t match_end; /**< end position of the match */
+
+  /* Replace value callable part. */
+  ecma_object_t *replace_function_p;
+
+  /* Replace value string part. */
+  ecma_string_t *replace_string_p; /**< replace string */
+  lit_utf8_byte_t *replace_str_curr_p; /**< replace string iterator */
+} ecma_builtin_replace_search_ctx_t;
+
+/**
+ * Generic helper function to append a substring at the end of a base string
+ *
+ * The base string can be kept or freed
+ *
+ * @return the constructed string
+ */
+static ecma_string_t *
+ecma_builtin_string_prototype_object_replace_append_substr (ecma_string_t *base_string_p, /**< base string */
+                                                            ecma_string_t *appended_string_p, /**< appended string */
+                                                            ecma_length_t start, /**< start position */
+                                                            ecma_length_t end, /**< end position */
+                                                            bool free_base_string) /**< free base string or not */
+{
+  ecma_string_t *ret_string_p;
+
+  JERRY_ASSERT (start <= end);
+  JERRY_ASSERT (end <= ecma_string_get_length (appended_string_p));
+
+  if (start < end)
+  {
+    ecma_string_t *substring_p = ecma_string_substr (appended_string_p, start, end);
+    ret_string_p = ecma_concat_ecma_strings (base_string_p, substring_p);
+
+    ecma_deref_ecma_string (substring_p);
+    if (free_base_string)
+    {
+      ecma_deref_ecma_string (base_string_p);
+    }
+  }
+  else if (free_base_string)
+  {
+    ret_string_p = base_string_p;
+  }
+  else
+  {
+    ret_string_p = base_string_p;
+    ecma_ref_ecma_string (ret_string_p);
+  }
+
+  return ret_string_p;
+} /* ecma_builtin_string_prototype_object_replace_append_substr */
+
+/**
+ * Generic helper function to perform the find the next match
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_replace_match (ecma_builtin_replace_search_ctx_t *context_p) /**< search
+                                                                                                   * context */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  context_p->match_start = 0;
+  context_p->match_end = 0;
+
+  if (context_p->is_regexp)
+  {
+    ECMA_TRY_CATCH (match_value,
+                    ecma_regexp_exec_helper (context_p->regexp_or_search_string,
+                                             context_p->input_string,
+                                             false),
+                    ret_value);
+
+    if (!ecma_is_value_null (match_value))
+    {
+      JERRY_ASSERT (ecma_is_value_object (match_value));
+
+      ecma_object_t *match_object_p = ecma_get_object_from_value (match_value);
+      ecma_string_t *index_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_INDEX);
+      ecma_string_t *zero_string_p = ecma_new_ecma_string_from_uint32 (0);
+
+      ECMA_TRY_CATCH (index_value,
+                      ecma_op_object_get (match_object_p, index_string_p),
+                      ret_value);
+
+      ECMA_TRY_CATCH (result_string_value,
+                      ecma_op_object_get (match_object_p, zero_string_p),
+                      ret_value);
+
+      /* We directly call the built-in exec, so
+       * we can trust in the returned value. */
+
+      JERRY_ASSERT (ecma_is_value_number (index_value));
+      JERRY_ASSERT (ecma_is_value_string (result_string_value));
+
+      /* We use the length of the result string to determine the
+       * match end. This works regardless the global flag is set. */
+      ecma_string_t *result_string_p = ecma_get_string_from_value (result_string_value);
+      ecma_number_t index_number = ecma_get_number_from_value (index_value);
+
+      context_p->match_start = (ecma_length_t) (index_number);
+      context_p->match_end = context_p->match_start + (ecma_length_t) ecma_string_get_length (result_string_p);
+
+      JERRY_ASSERT ((ecma_length_t) ecma_number_to_uint32 (index_number) == context_p->match_start);
+
+      ret_value = ecma_copy_value (match_value);
+
+      ECMA_FINALIZE (result_string_value);
+      ECMA_FINALIZE (index_value);
+      ecma_deref_ecma_string (index_string_p);
+      ecma_deref_ecma_string (zero_string_p);
+    }
+    else
+    {
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+    }
+
+    ECMA_FINALIZE (match_value);
+  }
+  else
+  {
+    JERRY_ASSERT (!context_p->is_global);
+
+    ecma_string_t *search_string_p = ecma_get_string_from_value (context_p->regexp_or_search_string);
+    ecma_string_t *input_string_p = ecma_get_string_from_value (context_p->input_string);
+
+    ecma_length_t index_of = 0;
+    if (ecma_builtin_helper_string_find_index (input_string_p, search_string_p, true, 0, &index_of))
+    {
+      ecma_value_t arguments_list_p[1] = { context_p->regexp_or_search_string };
+      ECMA_TRY_CATCH (new_array_value,
+                      ecma_op_create_array_object (arguments_list_p, 1, false),
+                      ret_value);
+
+      context_p->match_start = index_of;
+      context_p->match_end = index_of + ecma_string_get_length (search_string_p);
+
+      ret_value = ecma_copy_value (new_array_value);
+
+      ECMA_FINALIZE (new_array_value);
+    }
+    else
+    {
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+    }
+  }
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_replace_match */
+
+/**
+ * Generic helper function to construct the string which replaces the matched part
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_replace_get_string (ecma_builtin_replace_search_ctx_t *context_p, /**< search
+                                                                                                        * context */
+                                                         ecma_value_t match_value) /**< returned match value */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_string_t *length_string_p = ecma_new_ecma_length_string ();
+  ecma_object_t *match_object_p = ecma_get_object_from_value (match_value);
+
+  ECMA_TRY_CATCH (match_length_value,
+                  ecma_op_object_get (match_object_p, length_string_p),
+                  ret_value);
+
+  JERRY_ASSERT (ecma_is_value_number (match_length_value));
+
+  ecma_number_t match_length_number = ecma_get_number_from_value (match_length_value);
+  ecma_length_t match_length = (ecma_length_t) (match_length_number);
+
+  JERRY_ASSERT ((ecma_length_t) ecma_number_to_uint32 (match_length_number) == match_length);
+  JERRY_ASSERT (match_length >= 1);
+
+  if (context_p->is_replace_callable)
+  {
+    JMEM_DEFINE_LOCAL_ARRAY (arguments_list,
+                             match_length + 2,
+                             ecma_value_t);
+
+    /* An error might occure during the array copy and
+     * uninitalized elements must not be freed. */
+    ecma_length_t values_copied = 0;
+
+    for (ecma_length_t i = 0;
+         (i < match_length) && ecma_is_value_empty (ret_value);
+         i++)
+    {
+      ecma_string_t *index_p = ecma_new_ecma_string_from_uint32 (i);
+      ECMA_TRY_CATCH (current_value,
+                      ecma_op_object_get (match_object_p, index_p),
+                      ret_value);
+
+      arguments_list[i] = ecma_copy_value (current_value);
+      values_copied++;
+
+      ECMA_FINALIZE (current_value);
+      ecma_deref_ecma_string (index_p);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      arguments_list[match_length] = ecma_make_uint32_value (context_p->match_start);
+      arguments_list[match_length + 1] = ecma_copy_value (context_p->input_string);
+
+      ECMA_TRY_CATCH (result_value,
+                      ecma_op_function_call (context_p->replace_function_p,
+                                             ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                             arguments_list,
+                                             match_length + 2),
+                      ret_value);
+
+      ECMA_TRY_CATCH (to_string_value,
+                      ecma_op_to_string (result_value),
+                      ret_value);
+
+      ret_value = ecma_copy_value (to_string_value);
+
+      ECMA_FINALIZE (to_string_value);
+      ECMA_FINALIZE (result_value);
+
+      ecma_free_value (arguments_list[match_length + 1]);
+    }
+
+    for (ecma_length_t i = 0; i < values_copied; i++)
+    {
+      ecma_free_value (arguments_list[i]);
+    }
+
+    JMEM_FINALIZE_LOCAL_ARRAY (arguments_list);
+  }
+  else
+  {
+    /* Although the ECMA standard does not specify how $nn (n is a decimal
+     * number) captures should be replaced if nn is greater than the maximum
+     * capture index, we follow the test-262 expected behaviour:
+     *
+     * if maximum capture index is < 10
+     *   we replace only those $n and $0n captures, where n < maximum capture index
+     * otherwise
+     *   we replace only those $nn captures, where nn < maximum capture index
+     *
+     * other $n $nn sequences left unchanged
+     *
+     * example: "<xy>".replace(/(x)y/, "$1,$2,$01,$12") === "<x,$2,x,x2>"
+     */
+
+    ecma_string_t *result_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+
+    ecma_length_t previous_start = 0;
+    ecma_length_t current_position = 0;
+
+    lit_utf8_byte_t *replace_str_curr_p = context_p->replace_str_curr_p;
+    lit_utf8_byte_t *replace_str_end_p = replace_str_curr_p + ecma_string_get_size (context_p->replace_string_p);
+
+    while (replace_str_curr_p < replace_str_end_p)
+    {
+      ecma_char_t action = LIT_CHAR_NULL;
+
+      if (*replace_str_curr_p != LIT_CHAR_DOLLAR_SIGN)
+      {
+        /* if not a continuation byte */
+        if ((*replace_str_curr_p & LIT_UTF8_EXTRA_BYTE_MASK) != LIT_UTF8_EXTRA_BYTE_MARKER)
+        {
+          current_position++;
+        }
+        replace_str_curr_p++;
+        continue;
+      }
+
+      replace_str_curr_p++;
+
+      if (replace_str_curr_p < replace_str_end_p)
+      {
+        action = *replace_str_curr_p;
+
+        if (action == LIT_CHAR_DOLLAR_SIGN)
+        {
+          current_position++;
+        }
+        else if (action >= LIT_CHAR_0 && action <= LIT_CHAR_9)
+        {
+          uint32_t index = 0;
+
+          index = (uint32_t) (action - LIT_CHAR_0);
+
+          if (index >= match_length)
+          {
+            action = LIT_CHAR_NULL;
+          }
+          else if (index == 0 || match_length > 10)
+          {
+            replace_str_curr_p++;
+
+            ecma_char_t next_character = *replace_str_curr_p;
+
+            if (next_character >= LIT_CHAR_0 && next_character <= LIT_CHAR_9)
+            {
+              uint32_t full_index = index * 10 + (uint32_t) (next_character - LIT_CHAR_0);
+              if (full_index > 0 && full_index < match_length)
+              {
+                index = match_length;
+              }
+            }
+
+            replace_str_curr_p--;
+
+            if (index == 0)
+            {
+              action = LIT_CHAR_NULL;
+            }
+          }
+        }
+        else if (action != LIT_CHAR_AMPERSAND
+                 && action != LIT_CHAR_GRAVE_ACCENT
+                 && action != LIT_CHAR_SINGLE_QUOTE)
+        {
+          action = LIT_CHAR_NULL;
+        }
+      }
+
+      if (action != LIT_CHAR_NULL)
+      {
+        result_string_p = ecma_builtin_string_prototype_object_replace_append_substr (result_string_p,
+                                                                                      context_p->replace_string_p,
+                                                                                      previous_start,
+                                                                                      current_position,
+                                                                                      true);
+        replace_str_curr_p++;
+        current_position++;
+
+        if (action == LIT_CHAR_DOLLAR_SIGN)
+        {
+          current_position--;
+        }
+        else if (action == LIT_CHAR_GRAVE_ACCENT)
+        {
+          ecma_string_t *input_string_p = ecma_get_string_from_value (context_p->input_string);
+          result_string_p = ecma_builtin_string_prototype_object_replace_append_substr (result_string_p,
+                                                                                        input_string_p,
+                                                                                        0,
+                                                                                        context_p->match_start,
+                                                                                        true);
+        }
+        else if (action == LIT_CHAR_SINGLE_QUOTE)
+        {
+          ecma_string_t *input_string_p = ecma_get_string_from_value (context_p->input_string);
+          result_string_p = ecma_builtin_string_prototype_object_replace_append_substr (result_string_p,
+                                                                                        input_string_p,
+                                                                                        context_p->match_end,
+                                                                                        context_p->input_length,
+                                                                                        true);
+        }
+        else
+        {
+          /* Everything else is submatch reading. */
+          uint32_t index = 0;
+
+          JERRY_ASSERT (action == LIT_CHAR_AMPERSAND || (action >= LIT_CHAR_0 && action <= LIT_CHAR_9));
+
+          if (action >= LIT_CHAR_0 && action <= LIT_CHAR_9)
+          {
+            index = (uint32_t) (action - LIT_CHAR_0);
+
+            if ((match_length > 10 || index == 0)
+                && replace_str_curr_p < replace_str_end_p)
+            {
+              action = *replace_str_curr_p;
+              if (action >= LIT_CHAR_0 && action <= LIT_CHAR_9)
+              {
+                uint32_t full_index = index * 10 + (uint32_t) (action - LIT_CHAR_0);
+                if (full_index < match_length)
+                {
+                  index = full_index;
+                  replace_str_curr_p++;
+                  current_position++;
+                }
+              }
+            }
+            JERRY_ASSERT (index > 0 && index < match_length);
+          }
+
+          ecma_string_t *index_string_p = ecma_new_ecma_string_from_uint32 (index);
+
+          ECMA_TRY_CATCH (submatch_value,
+                          ecma_op_object_get (match_object_p, index_string_p),
+                          ret_value);
+
+          /* Undefined values are converted to empty string. */
+          if (!ecma_is_value_undefined (submatch_value))
+          {
+            JERRY_ASSERT (ecma_is_value_string (submatch_value));
+            ecma_string_t *submatch_string_p = ecma_get_string_from_value (submatch_value);
+
+            ecma_string_t *appended_string_p = ecma_concat_ecma_strings (result_string_p, submatch_string_p);
+            ecma_deref_ecma_string (result_string_p);
+            result_string_p = appended_string_p;
+          }
+
+          ECMA_FINALIZE (submatch_value);
+          ecma_deref_ecma_string (index_string_p);
+
+          if (!ecma_is_value_empty (ret_value))
+          {
+            break;
+          }
+        }
+
+        current_position++;
+        previous_start = current_position;
+      }
+      else
+      {
+        current_position++;
+      }
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      result_string_p = ecma_builtin_string_prototype_object_replace_append_substr (result_string_p,
+                                                                                    context_p->replace_string_p,
+                                                                                    previous_start,
+                                                                                    current_position,
+                                                                                    true);
+
+      ret_value = ecma_make_string_value (result_string_p);
+    }
+  }
+
+  ECMA_FINALIZE (match_length_value);
+  ecma_deref_ecma_string (length_string_p);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_replace_get_string */
+
+/**
+ * Generic helper function to do the string replace
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_replace_loop (ecma_builtin_replace_search_ctx_t *context_p) /**< search
+                                                                                                  * context */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_length_t previous_start = 0;
+  bool continue_match = true;
+
+  ecma_string_t *result_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+  ecma_string_t *input_string_p = ecma_get_string_from_value (context_p->input_string);
+
+  while (continue_match)
+  {
+    continue_match = false;
+    ECMA_TRY_CATCH (match_value,
+                    ecma_builtin_string_prototype_object_replace_match (context_p),
+                    ret_value);
+
+    if (!ecma_is_value_null (match_value))
+    {
+      result_string_p = ecma_builtin_string_prototype_object_replace_append_substr (result_string_p,
+                                                                                    input_string_p,
+                                                                                    previous_start,
+                                                                                    context_p->match_start,
+                                                                                    true);
+
+      ECMA_TRY_CATCH (string_value,
+                      ecma_builtin_string_prototype_object_replace_get_string (context_p, match_value),
+                      ret_value);
+
+      JERRY_ASSERT (ecma_is_value_string (string_value));
+
+      ecma_string_t *appended_string_p = ecma_concat_ecma_strings (result_string_p,
+                                                                   ecma_get_string_from_value (string_value));
+
+      ecma_deref_ecma_string (result_string_p);
+      result_string_p = appended_string_p;
+
+      ECMA_FINALIZE (string_value);
+
+      previous_start = context_p->match_end;
+
+      if (context_p->is_global
+          && ecma_is_value_empty (ret_value)
+          && context_p->match_start == context_p->match_end)
+      {
+        JERRY_ASSERT (context_p->is_regexp);
+
+        if (context_p->match_end == context_p->input_length)
+        {
+          /* Aborts the match. */
+          context_p->is_global = false;
+        }
+        else
+        {
+          ecma_string_t *last_index_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL);
+          ecma_object_t *regexp_obj_p = ecma_get_object_from_value (context_p->regexp_or_search_string);
+
+          ECMA_TRY_CATCH (put_value,
+                          ecma_op_object_put (regexp_obj_p,
+                                              last_index_string_p,
+                                              ecma_make_uint32_value (context_p->match_end + 1),
+                                              true),
+                          ret_value);
+
+          ECMA_FINALIZE (put_value);
+          ecma_deref_ecma_string (last_index_string_p);
+        }
+      }
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      if (!context_p->is_global || ecma_is_value_null (match_value))
+      {
+        /* No more matches */
+        ecma_string_t *appended_string_p;
+        appended_string_p = ecma_builtin_string_prototype_object_replace_append_substr (result_string_p,
+                                                                                        input_string_p,
+                                                                                        previous_start,
+                                                                                        context_p->input_length,
+                                                                                        false);
+
+        ret_value = ecma_make_string_value (appended_string_p);
+      }
+      else
+      {
+        continue_match = true;
+      }
+    }
+
+    ECMA_FINALIZE (match_value);
+  }
+
+  ecma_deref_ecma_string (result_string_p);
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_replace_loop */
+
+/**
+ * Generic helper function to check whether the search value is callable.
+ * If it is not, the function converts the search value to string. The
+ * appropriate fields of the context were filled as well and the search
+ * loop is run afterwards.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_replace_main (ecma_builtin_replace_search_ctx_t *context_p, /**< search
+                                                                                                  * context */
+                                                   ecma_value_t replace_value) /**< replacement for a match */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (ecma_op_is_callable (replace_value))
+  {
+    context_p->is_replace_callable = true;
+    context_p->replace_function_p = ecma_get_object_from_value (replace_value);
+
+    ret_value = ecma_builtin_string_prototype_object_replace_loop (context_p);
+  }
+  else
+  {
+    context_p->is_replace_callable = false;
+
+    ECMA_TRY_CATCH (to_string_replace_val,
+                    ecma_op_to_string (replace_value),
+                    ret_value);
+
+    ecma_string_t *replace_string_p = ecma_get_string_from_value (to_string_replace_val);
+
+    ECMA_STRING_TO_UTF8_STRING (replace_string_p, replace_start_p, replace_start_size);
+
+    context_p->replace_string_p = replace_string_p;
+    context_p->replace_str_curr_p = (lit_utf8_byte_t *) replace_start_p;
+
+    ret_value = ecma_builtin_string_prototype_object_replace_loop (context_p);
+
+    ECMA_FINALIZE_UTF8_STRING (replace_start_p, replace_start_size);
+    ECMA_FINALIZE (to_string_replace_val);
+  }
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_replace_main */
+
+/**
+ * The String.prototype object's 'replace' routine
+ *
+ * The replace algorithm is splitted into several helper functions.
+ * This allows using ECMA_TRY_CATCH macros and avoiding early returns.
+ *
+ * To share data between these helper functions, we created a
+ * structure called ecma_builtin_replace_search_ctx_t, which
+ * represents the current state of the replace.
+ *
+ * The helper functions are called in the following order:
+ *
+ *  1) ecma_builtin_string_prototype_object_replace is called
+ *       it initialise the context depending on search_value (regexp or string)
+ *  2) ecma_builtin_string_prototype_object_replace_main is called
+ *       it initialise the context depending on replace_value (callable or string)
+ *  3) ecma_builtin_string_prototype_object_replace_loop is called
+ *       this function has a loop which repeatedly calls
+ *        - ecma_builtin_string_prototype_object_replace_match
+ *          which performs a match
+ *        - ecma_builtin_string_prototype_object_replace_get_string
+ *          which computes the replacement string
+ *
+ *  The final string is created from several string fragments appended
+ *  together by ecma_builtin_string_prototype_object_replace_append_substr.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.11
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_replace (ecma_value_t this_arg, /**< this argument */
+                                              ecma_value_t search_value, /**< routine's first argument */
+                                              ecma_value_t replace_value) /**< routine's second argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2. */
+  ECMA_TRY_CATCH (to_string_value,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  ecma_builtin_replace_search_ctx_t context;
+
+  if (ecma_is_value_object (search_value)
+      && ecma_object_class_is (ecma_get_object_from_value (search_value), LIT_MAGIC_STRING_REGEXP_UL))
+  {
+    ecma_object_t *regexp_obj_p = ecma_get_object_from_value (search_value);
+    ecma_string_t *global_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL);
+
+    ECMA_TRY_CATCH (global_value,
+                    ecma_op_object_get (regexp_obj_p, global_string_p),
+                    ret_value);
+
+    JERRY_ASSERT (ecma_is_value_boolean (global_value));
+
+    context.is_regexp = true;
+    context.is_global = ecma_is_value_true (global_value);
+    context.input_string = to_string_value;
+    context.input_length = ecma_string_get_length (ecma_get_string_from_value (to_string_value));
+    context.regexp_or_search_string = search_value;
+
+    if (context.is_global)
+    {
+      ecma_string_t *last_index_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL);
+
+      ECMA_TRY_CATCH (put_value,
+                      ecma_op_object_put (regexp_obj_p,
+                                          last_index_string_p,
+                                          ecma_make_integer_value (0),
+                                          true),
+                      ret_value);
+
+      ECMA_FINALIZE (put_value);
+      ecma_deref_ecma_string (last_index_string_p);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      ret_value = ecma_builtin_string_prototype_object_replace_main (&context, replace_value);
+    }
+
+    ECMA_FINALIZE (global_value);
+    ecma_deref_ecma_string (global_string_p);
+  }
+  else
+  {
+    ECMA_TRY_CATCH (to_string_search_val,
+                    ecma_op_to_string (search_value),
+                    ret_value);
+
+    context.is_regexp = false;
+    context.is_global = false;
+    context.input_string = to_string_value;
+    context.input_length = ecma_string_get_length (ecma_get_string_from_value (to_string_value));
+    context.regexp_or_search_string = to_string_search_val;
+
+    ret_value = ecma_builtin_string_prototype_object_replace_main (&context, replace_value);
+
+    ECMA_FINALIZE (to_string_search_val);
+  }
+
+  ECMA_FINALIZE (to_string_value);
+  ECMA_FINALIZE (check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_replace */
+
+/**
+ * The String.prototype object's 'search' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.12
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_search (ecma_value_t this_arg, /**< this argument */
+                                             ecma_value_t regexp_arg) /**< routine's argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (check_coercible_value,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2. */
+  ECMA_TRY_CATCH (to_string_value,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  ecma_value_t regexp_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 3. */
+  if (ecma_is_value_object (regexp_arg)
+      && ecma_object_class_is (ecma_get_object_from_value (regexp_arg), LIT_MAGIC_STRING_REGEXP_UL))
+  {
+    regexp_value = ecma_copy_value (regexp_arg);
+  }
+  else
+  {
+    /* 4. */
+    ecma_value_t regexp_arguments[1] = { regexp_arg };
+
+    ECMA_TRY_CATCH (new_regexp_value,
+                    ecma_builtin_regexp_dispatch_construct (regexp_arguments, 1),
+                    ret_value);
+
+    regexp_value = ecma_copy_value (new_regexp_value);
+
+    ECMA_FINALIZE (new_regexp_value);
+  }
+
+  /* 5. */
+  if (ecma_is_value_empty (ret_value))
+  {
+    ECMA_TRY_CATCH (match_result,
+                    ecma_regexp_exec_helper (regexp_value, to_string_value, true),
+                    ret_value);
+
+    ecma_number_t offset = -1;
+
+    if (!ecma_is_value_null (match_result))
+    {
+      JERRY_ASSERT (ecma_is_value_object (match_result));
+
+      ecma_object_t *match_object_p = ecma_get_object_from_value (match_result);
+      ecma_string_t *index_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_INDEX);
+
+      ECMA_TRY_CATCH (index_value,
+                      ecma_op_object_get (match_object_p, index_string_p),
+                      ret_value);
+
+      JERRY_ASSERT (ecma_is_value_number (index_value));
+
+      offset = ecma_get_number_from_value (index_value);
+
+      ECMA_FINALIZE (index_value);
+      ecma_deref_ecma_string (index_string_p);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      ret_value = ecma_make_number_value (offset);
+    }
+
+    ECMA_FINALIZE (match_result);
+    ecma_free_value (regexp_value);
+  }
+
+  ECMA_FINALIZE (to_string_value);
+  ECMA_FINALIZE (check_coercible_value);
+
+  /* 6. */
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_search */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+
+/**
+ * The String.prototype object's 'slice' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.13
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_slice (ecma_value_t this_arg, /**< this argument */
+                                            ecma_value_t arg1, /**< routine's first argument */
+                                            ecma_value_t arg2) /**< routine's second argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2. */
+  ECMA_TRY_CATCH (to_string_val,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  /* 3. */
+  ecma_string_t *get_string_val = ecma_get_string_from_value (to_string_val);
+
+  const ecma_length_t len = ecma_string_get_length (get_string_val);
+
+  /* 4. */
+  ecma_length_t start = 0, end = len;
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (start_num,
+                               arg1,
+                               ret_value);
+
+  start = ecma_builtin_helper_array_index_normalize (start_num, len);
+
+  /* 5. 7. */
+  if (ecma_is_value_undefined (arg2))
+  {
+    end = len;
+  }
+  else
+  {
+    ECMA_OP_TO_NUMBER_TRY_CATCH (end_num,
+                                 arg2,
+                                 ret_value);
+
+    end = ecma_builtin_helper_array_index_normalize (end_num, len);
+
+    ECMA_OP_TO_NUMBER_FINALIZE (end_num);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (start_num);
+
+  JERRY_ASSERT (start <= len && end <= len);
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    /* 8-9. */
+    ecma_string_t *new_str_p = ecma_string_substr (get_string_val, start, end);
+    ret_value = ecma_make_string_value (new_str_p);
+  }
+
+  ECMA_FINALIZE (to_string_val);
+  ECMA_FINALIZE (check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_slice */
+
+
+/**
+ * The String.prototype object's 'split' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.14
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_split (ecma_value_t this_arg, /**< this argument */
+                                            ecma_value_t arg1, /**< separator */
+                                            ecma_value_t arg2) /**< limit */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (this_check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2. */
+  ECMA_TRY_CATCH (this_to_string_val,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  /* 3. */
+  ecma_value_t new_array = ecma_op_create_array_object (0, 0, false);
+
+  /* 5. */
+  ecma_length_t limit = 0;
+
+  if (ecma_is_value_undefined (arg2))
+  {
+    limit = (uint32_t) -1;
+  }
+  else
+  {
+    ECMA_OP_TO_NUMBER_TRY_CATCH (limit_num, arg2, ret_value);
+
+    limit = ecma_number_to_uint32 (limit_num);
+
+    ECMA_OP_TO_NUMBER_FINALIZE (limit_num);
+  }
+
+  if (ecma_is_value_empty (ret_value) && limit != 0)
+  {
+
+    ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
+
+    /* 10. */
+    if (ecma_is_value_undefined (arg1))
+    {
+      ecma_string_t *zero_str_p = ecma_new_ecma_string_from_number (ECMA_NUMBER_ZERO);
+
+      ecma_value_t put_comp = ecma_builtin_helper_def_prop (new_array_p,
+                                                            zero_str_p,
+                                                            this_to_string_val,
+                                                            true,
+                                                            true,
+                                                            true,
+                                                            false);
+
+      JERRY_ASSERT (ecma_is_value_true (put_comp));
+
+      ecma_deref_ecma_string (zero_str_p);
+    }
+    else /* if (!ecma_is_value_undefined (arg1)) */
+    {
+      /* 8. */
+      ecma_value_t separator = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+      bool separator_is_regexp = false;
+
+      if (ecma_is_value_object (arg1)
+          && ecma_object_class_is (ecma_get_object_from_value (arg1), LIT_MAGIC_STRING_REGEXP_UL))
+      {
+        separator_is_regexp = true;
+        separator = ecma_copy_value (arg1);
+      }
+      else
+      {
+        ECMA_TRY_CATCH (separator_to_string_val,
+                        ecma_op_to_string (arg1),
+                        ret_value);
+
+        separator = ecma_copy_value (separator_to_string_val);
+
+        ECMA_FINALIZE (separator_to_string_val);
+      }
+
+      const ecma_string_t *this_to_string_p = ecma_get_string_from_value (this_to_string_val);
+
+      /* 11. */
+      if (ecma_string_is_empty (this_to_string_p) && ecma_is_value_empty (ret_value))
+      {
+        bool should_return = false;
+
+        if (separator_is_regexp)
+        {
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+          ecma_value_t regexp_value = ecma_copy_value_if_not_object (separator);
+          ecma_string_t *substr_str_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+          ecma_value_t match_result;
+          match_result = ecma_regexp_exec_helper (regexp_value, ecma_make_string_value (substr_str_p), true);
+          should_return = !ecma_is_value_null (match_result);
+
+          ecma_deref_ecma_string (substr_str_p);
+          ecma_free_value (match_result);
+#else
+          return ecma_raise_type_error (ECMA_ERR_MSG ("REGEXP separator is disabled in split method."));
+#endif
+        }
+        else
+        {
+          ecma_string_t *separator_str_p = ecma_get_string_from_value (separator);
+
+          if (ecma_string_get_length (separator_str_p) == 0)
+          {
+            should_return = true;
+          }
+        }
+
+        if (!should_return)
+        {
+          /* 11.c */
+          ecma_string_t *zero_str_p = ecma_new_ecma_string_from_number (ECMA_NUMBER_ZERO);
+
+          ecma_value_t put_comp = ecma_builtin_helper_def_prop (new_array_p,
+                                                                zero_str_p,
+                                                                this_to_string_val,
+                                                                true,
+                                                                true,
+                                                                true,
+                                                                false);
+
+          JERRY_ASSERT (ecma_is_value_true (put_comp));
+          ecma_deref_ecma_string (zero_str_p);
+        }
+      }
+      else
+      {
+        /* 4. */
+        ecma_length_t new_array_length = 0;
+
+        /* 7. */
+        ecma_length_t start_pos = 0;
+
+        /* 12. */
+        ecma_length_t curr_pos = start_pos;
+
+        bool separator_is_empty = false;
+        bool should_return = false;
+
+        /* 6. */
+        const ecma_length_t string_length = ecma_string_get_length (this_to_string_p);
+
+        while (curr_pos < string_length && !should_return && ecma_is_value_empty (ret_value))
+        {
+          ecma_value_t match_result = ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+
+          if (separator_is_regexp)
+          {
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+            ecma_value_t regexp_value = ecma_copy_value_if_not_object (separator);
+            ecma_string_t *substr_str_p = ecma_string_substr (this_to_string_p, curr_pos, string_length);
+            match_result = ecma_regexp_exec_helper (regexp_value, ecma_make_string_value (substr_str_p), true);
+            ecma_deref_ecma_string (substr_str_p);
+#else
+            return ecma_raise_type_error (ECMA_ERR_MSG ("REGEXP separator is disabled in split method."));
+#endif
+          }
+          else
+          {
+            ecma_string_t *separator_str_p = ecma_get_string_from_value (separator);
+            ecma_length_t separator_length = ecma_string_get_length (separator_str_p);
+
+            if (curr_pos + separator_length <= string_length)
+            {
+              bool is_different = false;
+              for (ecma_length_t i = 0; i < separator_length && !is_different; i++)
+              {
+                ecma_char_t char_from_string = ecma_string_get_char_at_pos (this_to_string_p, curr_pos + i);
+                ecma_char_t char_from_separator = ecma_string_get_char_at_pos (separator_str_p, i);
+                is_different = (char_from_string != char_from_separator);
+              }
+
+              if (!is_different)
+              {
+                /* 6-7. */
+                match_result = ecma_op_create_array_object (0, 0, false);
+              }
+            }
+          }
+
+          if (ecma_is_value_null (match_result) || ECMA_IS_VALUE_ERROR (match_result))
+          {
+            curr_pos++;
+          }
+          else
+          {
+            ecma_object_t *match_obj_p = ecma_get_object_from_value (match_result);
+            ecma_string_t *zero_str_p = ecma_new_ecma_string_from_number (ECMA_NUMBER_ZERO);
+            ecma_string_t *magic_index_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_INDEX);
+            ecma_property_value_t *index_prop_value_p;
+
+
+            if (separator_is_regexp)
+            {
+              index_prop_value_p = ecma_get_named_data_property (match_obj_p, magic_index_str_p);
+              ecma_number_t index_num = ecma_get_number_from_value (index_prop_value_p->value);
+              ecma_value_assign_number (&index_prop_value_p->value, index_num + (ecma_number_t) curr_pos);
+            }
+            else
+            {
+              ecma_string_t *separator_str_p = ecma_get_string_from_value (separator);
+
+              ecma_value_t put_comp = ecma_builtin_helper_def_prop (match_obj_p,
+                                                                    zero_str_p,
+                                                                    ecma_make_string_value (separator_str_p),
+                                                                    true,
+                                                                    true,
+                                                                    true,
+                                                                    true);
+              JERRY_ASSERT (ecma_is_value_true (put_comp));
+
+              index_prop_value_p = ecma_create_named_data_property (match_obj_p,
+                                                                    magic_index_str_p,
+                                                                    ECMA_PROPERTY_FLAG_WRITABLE,
+                                                                    NULL);
+              ecma_named_data_property_assign_value (match_obj_p,
+                                                     index_prop_value_p,
+                                                     ecma_make_uint32_value (curr_pos));
+
+            }
+
+            ecma_deref_ecma_string (magic_index_str_p);
+
+            ecma_value_t match_comp_value = ecma_op_object_get (match_obj_p, zero_str_p);
+            JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (match_comp_value));
+
+            ecma_string_t *match_str_p = ecma_get_string_from_value (match_comp_value);
+            ecma_length_t match_str_length = ecma_string_get_length (match_str_p);
+
+            ecma_string_t *magic_empty_str_p = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING__EMPTY);
+            separator_is_empty = ecma_compare_ecma_strings (magic_empty_str_p, match_str_p);
+
+            ecma_deref_ecma_string (magic_empty_str_p);
+            ecma_free_value (match_comp_value);
+            ecma_deref_ecma_string (zero_str_p);
+
+            ecma_number_t index_num = ecma_get_number_from_value (index_prop_value_p->value);
+            JERRY_ASSERT (index_num >= 0);
+
+
+            uint32_t end_pos = ecma_number_to_uint32 (index_num);
+
+            if (separator_is_empty)
+            {
+              end_pos = curr_pos + 1;
+            }
+
+            /* 13.c.iii.1-2 */
+            ecma_string_t *substr_str_p = ecma_string_substr (this_to_string_p,
+                                                              start_pos,
+                                                              end_pos);
+
+            ecma_string_t *array_length_str_p = ecma_new_ecma_string_from_uint32 (new_array_length);
+
+            ecma_value_t put_comp = ecma_builtin_helper_def_prop (new_array_p,
+                                                                  array_length_str_p,
+                                                                  ecma_make_string_value (substr_str_p),
+                                                                  true,
+                                                                  true,
+                                                                  true,
+                                                                  false);
+
+            JERRY_ASSERT (ecma_is_value_true (put_comp));
+
+            /* 13.c.iii.3 */
+            new_array_length++;
+
+            /* 13.c.iii.4 */
+            if (new_array_length == limit && ecma_is_value_empty (ret_value))
+            {
+              should_return = true;
+            }
+
+            /* 13.c.iii.5 */
+            start_pos = end_pos + match_str_length;
+            ecma_string_t *magic_length_str_p = ecma_new_ecma_length_string ();
+
+            ECMA_TRY_CATCH (array_length_val,
+                            ecma_op_object_get (match_obj_p, magic_length_str_p),
+                            ret_value);
+
+            ECMA_OP_TO_NUMBER_TRY_CATCH (array_length_num, array_length_val, ret_value);
+
+            /* The first item is the match object, thus we should skip it. */
+            const uint32_t match_result_array_length = ecma_number_to_uint32 (array_length_num) - 1;
+
+            /* 13.c.iii.6 */
+            uint32_t i = 0;
+
+            /* 13.c.iii.7 */
+            while (i < match_result_array_length && ecma_is_value_empty (ret_value))
+            {
+              /* 13.c.iii.7.a */
+              i++;
+              ecma_string_t *idx_str_p = ecma_new_ecma_string_from_uint32 (i);
+              ecma_string_t *new_array_idx_str_p = ecma_new_ecma_string_from_uint32 (new_array_length);
+
+              match_comp_value = ecma_op_object_get (match_obj_p, idx_str_p);
+
+              JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (match_comp_value));
+
+              /* 13.c.iii.7.b */
+              put_comp = ecma_builtin_helper_def_prop (new_array_p,
+                                                       new_array_idx_str_p,
+                                                       match_comp_value,
+                                                       true,
+                                                       true,
+                                                       true,
+                                                       false);
+
+              JERRY_ASSERT (ecma_is_value_true (put_comp));
+
+              /* 13.c.iii.7.c */
+              new_array_length++;
+
+              /* 13.c.iii.7.d */
+              if (new_array_length == limit && ecma_is_value_empty (ret_value))
+              {
+                should_return = true;
+              }
+
+              ecma_free_value (match_comp_value);
+              ecma_deref_ecma_string (new_array_idx_str_p);
+              ecma_deref_ecma_string (idx_str_p);
+            }
+
+            /* 13.c.iii.8 */
+            curr_pos = start_pos;
+
+            ECMA_OP_TO_NUMBER_FINALIZE (array_length_num);
+            ECMA_FINALIZE (array_length_val);
+            ecma_deref_ecma_string (magic_length_str_p);
+            ecma_deref_ecma_string (array_length_str_p);
+            ecma_deref_ecma_string (substr_str_p);
+          }
+
+          ecma_free_value (match_result);
+
+        }
+
+        if (!should_return && !separator_is_empty && ecma_is_value_empty (ret_value))
+        {
+          /* 14. */
+          ecma_string_t *substr_str_p;
+          substr_str_p = ecma_string_substr (this_to_string_p,
+                                             start_pos,
+                                             string_length);
+
+          /* 15. */
+          ecma_string_t *array_length_string_p = ecma_new_ecma_string_from_uint32 (new_array_length);
+
+          ecma_value_t put_comp = ecma_builtin_helper_def_prop (new_array_p,
+                                                                array_length_string_p,
+                                                                ecma_make_string_value (substr_str_p),
+                                                                true,
+                                                                true,
+                                                                true,
+                                                                false);
+
+          JERRY_ASSERT (ecma_is_value_true (put_comp));
+
+          ecma_deref_ecma_string (array_length_string_p);
+          ecma_deref_ecma_string (substr_str_p);
+        }
+      }
+
+      ecma_free_value (separator);
+    }
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = new_array;
+  }
+  else
+  {
+    ecma_free_value (new_array);
+  }
+
+  ECMA_FINALIZE (this_to_string_val);
+  ECMA_FINALIZE (this_check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_split */
+
+/**
+ * The String.prototype object's 'substring' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.15
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_substring (ecma_value_t this_arg, /**< this argument */
+                                                ecma_value_t arg1, /**< routine's first argument */
+                                                ecma_value_t arg2) /**< routine's second argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1 */
+  ECMA_TRY_CATCH (check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2 */
+  ECMA_TRY_CATCH (to_string_val,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  /* 3 */
+  ecma_string_t *original_string_p = ecma_get_string_from_value (to_string_val);
+
+  const ecma_length_t len = ecma_string_get_length (original_string_p);
+
+  /* 4, 6 */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (start_num,
+                               arg1,
+                               ret_value);
+
+  ecma_length_t start = 0, end = len;
+
+  start = ecma_builtin_helper_string_index_normalize (start_num, len, true);
+
+  /* 5, 7 */
+  if (ecma_is_value_undefined (arg2))
+  {
+    end = len;
+  }
+  else
+  {
+    ECMA_OP_TO_NUMBER_TRY_CATCH (end_num,
+                                 arg2,
+                                 ret_value);
+
+    end = ecma_builtin_helper_string_index_normalize (end_num, len, true);
+
+    ECMA_OP_TO_NUMBER_FINALIZE (end_num);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    JERRY_ASSERT (start <= len && end <= len);
+
+    /* 8 */
+    uint32_t from = start < end ? start : end;
+
+    /* 9 */
+    uint32_t to = start > end ? start : end;
+
+    /* 10 */
+    ecma_string_t *new_str_p = ecma_string_substr (original_string_p, from, to);
+    ret_value = ecma_make_string_value (new_str_p);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (start_num);
+
+  ECMA_FINALIZE (to_string_val);
+  ECMA_FINALIZE (check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_substring */
+
+/**
+ * Helper function to convert a string to upper or lower case.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_conversion_helper (ecma_value_t this_arg, /**< this argument */
+                                                        bool lower_case) /**< convert to lower (true)
+                                                                          *   or upper (false) case */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  ECMA_TRY_CATCH (check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2. */
+  ECMA_TRY_CATCH (to_string_val,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  /* 3. */
+  ecma_string_t *input_string_p = ecma_get_string_from_value (to_string_val);
+
+  ECMA_STRING_TO_UTF8_STRING (input_string_p, input_start_p, input_start_size);
+
+  /*
+   * The URI encoding has two major phases: first we compute
+   * the length of the lower case string, then we encode it.
+   */
+
+  lit_utf8_size_t output_length = 0;
+  const lit_utf8_byte_t *input_str_curr_p = input_start_p;
+  const lit_utf8_byte_t *input_str_end_p = input_start_p + input_start_size;
+
+  while (input_str_curr_p < input_str_end_p)
+  {
+    ecma_char_t character = lit_utf8_read_next (&input_str_curr_p);
+    ecma_char_t character_buffer[LIT_MAXIMUM_OTHER_CASE_LENGTH];
+    ecma_length_t character_length;
+    lit_utf8_byte_t utf8_byte_buffer[LIT_CESU8_MAX_BYTES_IN_CODE_POINT];
+
+    if (lower_case)
+    {
+      character_length = lit_char_to_lower_case (character,
+                                                 character_buffer,
+                                                 LIT_MAXIMUM_OTHER_CASE_LENGTH);
+    }
+    else
+    {
+      character_length = lit_char_to_upper_case (character,
+                                                 character_buffer,
+                                                 LIT_MAXIMUM_OTHER_CASE_LENGTH);
+    }
+
+    JERRY_ASSERT (character_length >= 1 && character_length <= LIT_MAXIMUM_OTHER_CASE_LENGTH);
+
+    for (ecma_length_t i = 0; i < character_length; i++)
+    {
+      output_length += lit_code_unit_to_utf8 (character_buffer[i], utf8_byte_buffer);
+    }
+  }
+
+  /* Second phase. */
+
+  JMEM_DEFINE_LOCAL_ARRAY (output_start_p,
+                           output_length,
+                           lit_utf8_byte_t);
+
+  lit_utf8_byte_t *output_char_p = output_start_p;
+
+  /* Encoding the output. */
+  input_str_curr_p = input_start_p;
+
+  while (input_str_curr_p < input_str_end_p)
+  {
+    ecma_char_t character = lit_utf8_read_next (&input_str_curr_p);
+    ecma_char_t character_buffer[LIT_MAXIMUM_OTHER_CASE_LENGTH];
+    ecma_length_t character_length;
+
+    if (lower_case)
+    {
+      character_length = lit_char_to_lower_case (character,
+                                                 character_buffer,
+                                                 LIT_MAXIMUM_OTHER_CASE_LENGTH);
+    }
+    else
+    {
+      character_length = lit_char_to_upper_case (character,
+                                                 character_buffer,
+                                                 LIT_MAXIMUM_OTHER_CASE_LENGTH);
+    }
+
+    JERRY_ASSERT (character_length >= 1 && character_length <= LIT_MAXIMUM_OTHER_CASE_LENGTH);
+
+    for (ecma_length_t i = 0; i < character_length; i++)
+    {
+      output_char_p += lit_code_unit_to_utf8 (character_buffer[i], output_char_p);
+    }
+  }
+
+  JERRY_ASSERT (output_start_p + output_length == output_char_p);
+
+  ecma_string_t *output_string_p = ecma_new_ecma_string_from_utf8 (output_start_p, output_length);
+
+  ret_value = ecma_make_string_value (output_string_p);
+
+  JMEM_FINALIZE_LOCAL_ARRAY (output_start_p);
+  ECMA_FINALIZE_UTF8_STRING (input_start_p, input_start_size);
+
+  ECMA_FINALIZE (to_string_val);
+  ECMA_FINALIZE (check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_conversion_helper */
+
+/**
+ * The String.prototype object's 'toLowerCase' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.16
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_to_lower_case (ecma_value_t this_arg) /**< this argument */
+{
+  return ecma_builtin_string_prototype_object_conversion_helper (this_arg, true);
+} /* ecma_builtin_string_prototype_object_to_lower_case */
+
+/**
+ * The String.prototype object's 'toLocaleLowerCase' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.17
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_to_locale_lower_case (ecma_value_t this_arg) /**< this argument */
+{
+  return ecma_builtin_string_prototype_object_conversion_helper (this_arg, true);
+} /* ecma_builtin_string_prototype_object_to_locale_lower_case */
+
+/**
+ * The String.prototype object's 'toUpperCase' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.18
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_to_upper_case (ecma_value_t this_arg) /**< this argument */
+{
+  return ecma_builtin_string_prototype_object_conversion_helper (this_arg, false);
+} /* ecma_builtin_string_prototype_object_to_upper_case */
+
+/**
+ * The String.prototype object's 'toLocaleUpperCase' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.19
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_to_locale_upper_case (ecma_value_t this_arg) /**< this argument */
+{
+  return ecma_builtin_string_prototype_object_conversion_helper (this_arg, false);
+} /* ecma_builtin_string_prototype_object_to_locale_upper_case */
+
+/**
+ * The String.prototype object's 'trim' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.4.20
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_trim (ecma_value_t this_arg) /**< this argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1 */
+  ECMA_TRY_CATCH (check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 2 */
+  ECMA_TRY_CATCH (to_string_val,
+                  ecma_op_to_string (this_arg),
+                  ret_value);
+
+  ecma_string_t *original_string_p = ecma_get_string_from_value (to_string_val);
+
+  ecma_string_t *trimmed_string_p = ecma_string_trim (original_string_p);
+  ret_value = ecma_make_string_value (trimmed_string_p);
+
+  ECMA_FINALIZE (to_string_val);
+  ECMA_FINALIZE (check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_trim */
+
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+
+/**
+ * The String.prototype object's 'substr' routine
+ *
+ * See also:
+ *          ECMA-262 v5, B.2.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_prototype_object_substr (ecma_value_t this_arg, /**< this argument */
+                                             ecma_value_t start, /**< routine's first argument */
+                                             ecma_value_t length) /**< routine's second argument */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (check_coercible_val,
+                  ecma_op_check_object_coercible (this_arg),
+                  ret_value);
+
+  /* 1. */
+  ECMA_TRY_CATCH (to_string_val, ecma_op_to_string (this_arg), ret_value);
+  ecma_string_t *this_string_p = ecma_get_string_from_value (to_string_val);
+
+  /* 2. */
+  ECMA_OP_TO_NUMBER_TRY_CATCH (start_num, start, ret_value);
+  if (ecma_number_is_nan (start_num))
+  {
+    start_num = 0;
+  }
+
+  /* 3. */
+  ecma_number_t length_num = ecma_number_make_infinity (false);
+  if (!ecma_is_value_undefined (length))
+  {
+    ECMA_OP_TO_NUMBER_TRY_CATCH (len, length, ret_value);
+    length_num = ecma_number_is_nan (len) ? 0 : len;
+
+    ECMA_OP_TO_NUMBER_FINALIZE (len);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    /* 4. */
+    ecma_number_t this_len = (ecma_number_t) ecma_string_get_length (this_string_p);
+
+    /* 5. */
+    ecma_number_t from_num = (start_num < 0) ? JERRY_MAX (this_len + start_num, 0) : start_num;
+    uint32_t from = ecma_builtin_helper_string_index_normalize (from_num, ecma_number_to_uint32 (this_len), true);
+
+    /* 6-7. */
+    ecma_number_t to_num = JERRY_MAX (JERRY_MIN (JERRY_MAX (length_num, 0), this_len - from_num), 0);
+    uint32_t to = from + ecma_builtin_helper_string_index_normalize (to_num, ecma_number_to_uint32 (this_len), true);
+
+    /* 8. */
+    ecma_string_t *new_str_p = ecma_string_substr (this_string_p, from, to);
+    ret_value = ecma_make_string_value (new_str_p);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (start_num);
+  ECMA_FINALIZE (to_string_val);
+  ECMA_FINALIZE (check_coercible_val);
+
+  return ret_value;
+} /* ecma_builtin_string_prototype_object_substr */
+
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.inc.h
new file mode 100644 (file)
index 0000000..1ba4f42
--- /dev/null
@@ -0,0 +1,72 @@
+/* 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.
+ */
+
+/*
+ * String.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_STRING_BUILTIN
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.5.4.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_STRING,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* Number properties:
+ *  (property name, number value) */
+
+/* ECMA-262 v5, 15.5.4 (String.prototype is itself a String object whose value is an empty String), 15.5.5.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              0,
+              ECMA_PROPERTY_FIXED)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_string_prototype_object_to_string, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ecma_builtin_string_prototype_object_value_of, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_CONCAT, ecma_builtin_string_prototype_object_concat, NON_FIXED, 1)
+ROUTINE (LIT_MAGIC_STRING_SLICE, ecma_builtin_string_prototype_object_slice, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_INDEX_OF_UL, ecma_builtin_string_prototype_object_index_of, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_LAST_INDEX_OF_UL, ecma_builtin_string_prototype_object_last_index_of, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_CHAR_AT_UL, ecma_builtin_string_prototype_object_char_at, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_CHAR_CODE_AT_UL, ecma_builtin_string_prototype_object_char_code_at, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_LOCALE_COMPARE_UL, ecma_builtin_string_prototype_object_locale_compare, 1, 1)
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+ROUTINE (LIT_MAGIC_STRING_MATCH, ecma_builtin_string_prototype_object_match, 1, 1)
+ROUTINE (LIT_MAGIC_STRING_REPLACE, ecma_builtin_string_prototype_object_replace, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_SEARCH, ecma_builtin_string_prototype_object_search, 1, 1)
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+
+ROUTINE (LIT_MAGIC_STRING_SPLIT, ecma_builtin_string_prototype_object_split, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_SUBSTRING, ecma_builtin_string_prototype_object_substring, 2, 2)
+ROUTINE (LIT_MAGIC_STRING_TO_LOWER_CASE_UL, ecma_builtin_string_prototype_object_to_lower_case, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_LOWER_CASE_UL, ecma_builtin_string_prototype_object_to_locale_lower_case, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_UPPER_CASE_UL, ecma_builtin_string_prototype_object_to_upper_case, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_UPPER_CASE_UL, ecma_builtin_string_prototype_object_to_locale_upper_case, 0, 0)
+ROUTINE (LIT_MAGIC_STRING_TRIM, ecma_builtin_string_prototype_object_trim, 0, 0)
+
+#ifndef CONFIG_DISABLE_ANNEXB_BUILTIN
+ROUTINE (LIT_MAGIC_STRING_SUBSTR, ecma_builtin_string_prototype_object_substr, 2, 2)
+#endif /* !CONFIG_DISABLE_ANNEXB_BUILTIN */
+
+#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string.c
new file mode 100644 (file)
index 0000000..29e1b4f
--- /dev/null
@@ -0,0 +1,159 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_STRING_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-string.inc.h"
+#define BUILTIN_UNDERSCORED_ID string
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup string ECMA String object built-in
+ * @{
+ */
+
+/**
+ * The String object's 'fromCharCode' routine
+ *
+ * See also:
+ *          ECMA-262 v5, 15.5.3.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_string_object_from_char_code (ecma_value_t this_arg, /**< 'this' argument */
+                                           const ecma_value_t args[], /**< arguments list */
+                                           ecma_length_t args_number) /**< number of arguments */
+{
+  JERRY_UNUSED (this_arg);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_string_t *ret_string_p = NULL;
+
+  if (args_number == 0)
+  {
+    ret_string_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+  }
+  else
+  {
+    lit_utf8_size_t utf8_buf_size = args_number * LIT_CESU8_MAX_BYTES_IN_CODE_UNIT;
+
+    JMEM_DEFINE_LOCAL_ARRAY (utf8_buf_p,
+                             utf8_buf_size,
+                             lit_utf8_byte_t);
+
+    lit_utf8_size_t utf8_buf_used = 0;
+
+    for (ecma_length_t arg_index = 0;
+         arg_index < args_number && ecma_is_value_empty (ret_value);
+         arg_index++)
+    {
+      ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, args[arg_index], ret_value);
+
+      uint32_t uint32_char_code = ecma_number_to_uint32 (arg_num);
+      ecma_char_t code_unit = (uint16_t) uint32_char_code;
+
+      JERRY_ASSERT (utf8_buf_used <= utf8_buf_size - LIT_UTF8_MAX_BYTES_IN_CODE_UNIT);
+      utf8_buf_used += lit_code_unit_to_utf8 (code_unit, utf8_buf_p + utf8_buf_used);
+      JERRY_ASSERT (utf8_buf_used <= utf8_buf_size);
+
+      ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
+    }
+
+    if (ecma_is_value_empty (ret_value))
+    {
+      ret_string_p = ecma_new_ecma_string_from_utf8 (utf8_buf_p, utf8_buf_used);
+    }
+
+    JMEM_FINALIZE_LOCAL_ARRAY (utf8_buf_p);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = ecma_make_string_value (ret_string_p);
+  }
+
+  return ret_value;
+} /* ecma_builtin_string_object_from_char_code */
+
+/**
+ * Handle calling [[Call]] of built-in String object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_string_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                   ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (arguments_list_len == 0)
+  {
+    ecma_string_t *str_p = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING__EMPTY);
+    ecma_value_t str_value = ecma_make_string_value (str_p);
+
+    ret_value = str_value;
+  }
+  else
+  {
+    ret_value = ecma_op_to_string (arguments_list_p[0]);
+  }
+
+  return ret_value;
+} /* ecma_builtin_string_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in String object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_string_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                        ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_op_create_string_object (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_string_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-string.inc.h
new file mode 100644 (file)
index 0000000..2dcbaf3
--- /dev/null
@@ -0,0 +1,46 @@
+/* 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.
+ */
+
+/*
+ * String built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_STRING_BUILTIN
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.5.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.7.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_STRING_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+ROUTINE (LIT_MAGIC_STRING_FROM_CHAR_CODE_UL, ecma_builtin_string_object_from_char_code, NON_FIXED, 1)
+
+#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror-prototype.c
new file mode 100644 (file)
index 0000000..ab3717d
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-syntaxerror-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID syntax_error_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror-prototype.inc.h
new file mode 100644 (file)
index 0000000..cd56ddb
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+/*
+ * SyntaxError.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.7.8 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_SYNTAX_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.9 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_SYNTAX_ERROR_UL,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.10 */
+STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
+              LIT_MAGIC_STRING__EMPTY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+#endif /* CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c
new file mode 100644 (file)
index 0000000..fe927d0
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-syntaxerror.inc.h"
+#define BUILTIN_UNDERSCORED_ID syntax_error
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup syntaxerror ECMA SyntaxError object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in SyntaxError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_syntax_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                         ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_SYNTAX, arguments_list_p, arguments_list_len);
+} /* ecma_builtin_syntax_error_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in SyntaxError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_syntax_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                              ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_syntax_error_dispatch_call (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_syntax_error_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.inc.h
new file mode 100644 (file)
index 0000000..54dc5ea
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/*
+ * SyntaxError built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.11.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-type-error-thrower.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-type-error-thrower.c
new file mode 100644 (file)
index 0000000..fe58158
--- /dev/null
@@ -0,0 +1,84 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-type-error-thrower.inc.h"
+#define BUILTIN_UNDERSCORED_ID type_error_thrower
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup type_error_thrower ECMA [[ThrowTypeError]] object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in [[ThrowTypeError]] object
+ *
+ * See also:
+ *          ECMA-262 v5, 13.2.3
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_type_error_thrower_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                               ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  /* The object should throw TypeError */
+  return ecma_raise_type_error (ECMA_ERR_MSG (""));
+} /* ecma_builtin_type_error_thrower_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in [[ThrowTypeError]] object
+ *
+ * See also:
+ *          ECMA-262 v5, 13.2.3
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_type_error_thrower_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                                    ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  /* The object is not a constructor */
+  return ecma_raise_type_error (ECMA_ERR_MSG (""));
+} /* ecma_builtin_type_error_thrower_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-type-error-thrower.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-type-error-thrower.inc.h
new file mode 100644 (file)
index 0000000..640f40f
--- /dev/null
@@ -0,0 +1,31 @@
+/* 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.
+ */
+
+/*
+ * [[ThrowTypeError]] description
+ *
+ * See also: ECMA-262 v5, 13.2.3
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              0,
+              ECMA_PROPERTY_FIXED)
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror-prototype.c
new file mode 100644 (file)
index 0000000..169c3d5
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-typeerror-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID type_error_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror-prototype.inc.h
new file mode 100644 (file)
index 0000000..5a6b391
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+/*
+ * TypeError.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.7.8 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_TYPE_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.9 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_TYPE_ERROR_UL,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.10 */
+STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
+              LIT_MAGIC_STRING__EMPTY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c
new file mode 100644 (file)
index 0000000..59bac07
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-typeerror.inc.h"
+#define BUILTIN_UNDERSCORED_ID type_error
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup typeerror ECMA TypeError object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in TypeError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_type_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                       ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_TYPE, arguments_list_p, arguments_list_len);
+} /* ecma_builtin_type_error_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in TypeError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_type_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                            ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_type_error_dispatch_call (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_type_error_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.inc.h
new file mode 100644 (file)
index 0000000..93910dd
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/*
+ * TypeError built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.11.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror-prototype.c
new file mode 100644 (file)
index 0000000..5c6c851
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-urierror-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID uri_error_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror-prototype.inc.h
new file mode 100644 (file)
index 0000000..8fe6ff2
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+/*
+ * UriError.prototype built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.7.8 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_URI_ERROR,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.9 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_URI_ERROR_UL,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ECMA-262 v5, 15.11.7.10 */
+STRING_VALUE (LIT_MAGIC_STRING_MESSAGE,
+              LIT_MAGIC_STRING__EMPTY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c
new file mode 100644 (file)
index 0000000..ae3783d
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-urierror.inc.h"
+#define BUILTIN_UNDERSCORED_ID uri_error
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup urierror ECMA UriError object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of built-in UriError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_uri_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                      ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_URI, arguments_list_p, arguments_list_len);
+} /* ecma_builtin_uri_error_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in UriError object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_uri_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                           ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  return ecma_builtin_uri_error_dispatch_call (arguments_list_p, arguments_list_len);
+} /* ecma_builtin_uri_error_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.inc.h
new file mode 100644 (file)
index 0000000..966c950
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+/*
+ * UriError built-in description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+
+/* Number properties:
+ *  (property name, number value, writable, enumerable, configurable) */
+
+/* ECMA-262 v5, 15.11.3 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* Object properties:
+ *  (property name, object pointer getter) */
+
+/* ECMA-262 v5, 15.11.3.1 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins-internal.h
new file mode 100644 (file)
index 0000000..4ccec71
--- /dev/null
@@ -0,0 +1,93 @@
+/* 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.
+ */
+
+#ifndef ECMA_BUILTINS_INTERNAL_H
+#define ECMA_BUILTINS_INTERNAL_H
+
+#ifndef ECMA_BUILTINS_INTERNAL
+# error "!ECMA_BUILTINS_INTERNAL"
+#endif /* !ECMA_BUILTINS_INTERNAL */
+
+#include "ecma-builtins.h"
+#include "ecma-globals.h"
+
+/**
+ * Type of built-in properties.
+ */
+typedef enum
+{
+  ECMA_BUILTIN_PROPERTY_SIMPLE, /**< simple value property */
+  ECMA_BUILTIN_PROPERTY_NUMBER, /**< number value property */
+  ECMA_BUILTIN_PROPERTY_STRING, /**< string value property */
+  ECMA_BUILTIN_PROPERTY_OBJECT, /**< builtin object property */
+  ECMA_BUILTIN_PROPERTY_ROUTINE, /**< routine property */
+  ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_WRITE, /**< full accessor property */
+  ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_ONLY, /**< read-only accessor property */
+  ECMA_BUILTIN_PROPERTY_END, /**< last property */
+} ecma_builtin_property_type_t;
+
+/**
+ * Type of symbolic built-in number types (starting from 256).
+ */
+typedef enum
+{
+  ECMA_BUILTIN_NUMBER_MAX = 256, /**< value of ECMA_NUMBER_MAX_VALUE */
+  ECMA_BUILTIN_NUMBER_MIN, /**< value of ECMA_NUMBER_MIN_VALUE */
+  ECMA_BUILTIN_NUMBER_E, /**< value of ECMA_NUMBER_E */
+  ECMA_BUILTIN_NUMBER_PI, /**< value of ECMA_NUMBER_PI */
+  ECMA_BUILTIN_NUMBER_LN10, /**< value of ECMA_NUMBER_LN10 */
+  ECMA_BUILTIN_NUMBER_LN2, /**< value of ECMA_NUMBER_LN2 */
+  ECMA_BUILTIN_NUMBER_LOG2E, /**< value of ECMA_NUMBER_LOG2E */
+  ECMA_BUILTIN_NUMBER_LOG10E, /**< value of ECMA_NUMBER_LOG10E */
+  ECMA_BUILTIN_NUMBER_SQRT2, /**< value of ECMA_NUMBER_SQRT2 */
+  ECMA_BUILTIN_NUMBER_SQRT_1_2, /**< value of ECMA_NUMBER_SQRT_1_2 */
+  ECMA_BUILTIN_NUMBER_NAN, /**< result of ecma_number_make_nan () */
+  ECMA_BUILTIN_NUMBER_POSITIVE_INFINITY, /**< result of ecma_number_make_infinity (false) */
+  ECMA_BUILTIN_NUMBER_NEGATIVE_INFINITY, /**< result of ecma_number_make_infinity (true) */
+} ecma_builtin_number_type_t;
+
+/**
+ * Description of built-in properties.
+ */
+typedef struct
+{
+  uint16_t magic_string_id; /**< name of the property */
+  uint8_t type; /**< type of the property */
+  uint8_t attributes; /**< attributes of the property */
+  uint16_t value; /**< value of the property */
+} ecma_builtin_property_descriptor_t;
+
+#define BUILTIN(builtin_id, \
+                object_type, \
+                object_prototype_builtin_id, \
+                is_extensible, \
+                is_static, \
+                lowercase_name) \
+extern const ecma_builtin_property_descriptor_t \
+ecma_builtin_ ## lowercase_name ## _property_descriptor_list[]; \
+ecma_value_t \
+ecma_builtin_ ## lowercase_name ## _dispatch_call (const ecma_value_t *, \
+                                                   ecma_length_t); \
+ecma_value_t \
+ecma_builtin_ ## lowercase_name ## _dispatch_construct (const ecma_value_t *, \
+                                                        ecma_length_t); \
+ecma_value_t \
+ecma_builtin_ ## lowercase_name ## _dispatch_routine (uint16_t builtin_routine_id, \
+                                                      ecma_value_t this_arg_value, \
+                                                      const ecma_value_t [], \
+                                                      ecma_length_t);
+#include "ecma-builtins.inc.h"
+
+#endif /* !ECMA_BUILTINS_INTERNAL_H */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.c b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.c
new file mode 100644 (file)
index 0000000..94e6e99
--- /dev/null
@@ -0,0 +1,943 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "jcontext.h"
+#include "jrt-bit-fields.h"
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ */
+
+static void ecma_instantiate_builtin (ecma_builtin_id_t id);
+
+/**
+ * Helper definition for ecma_builtin_property_list_references.
+ */
+typedef const ecma_builtin_property_descriptor_t *ecma_builtin_property_list_reference_t;
+
+/**
+ * Property descriptor lists for all built-ins.
+ */
+static const ecma_builtin_property_list_reference_t ecma_builtin_property_list_references[] =
+{
+#define BUILTIN(builtin_id, \
+                object_type, \
+                object_prototype_builtin_id, \
+                is_extensible, \
+                is_static, \
+                lowercase_name) \
+  ecma_builtin_ ## lowercase_name ## _property_descriptor_list,
+#include "ecma-builtins.inc.h"
+};
+
+/**
+ * Get the number of properties of a built-in object.
+ *
+ * @return the number of properties
+ */
+static size_t
+ecma_builtin_get_property_count (ecma_builtin_id_t builtin_id)
+{
+  const ecma_builtin_property_descriptor_t *property_list_p = ecma_builtin_property_list_references[builtin_id];
+
+  const ecma_builtin_property_descriptor_t *curr_property_p = property_list_p;
+
+  while (curr_property_p->magic_string_id != LIT_MAGIC_STRING__COUNT)
+  {
+    curr_property_p++;
+  }
+
+  return (size_t) (curr_property_p - property_list_p);
+} /* ecma_builtin_get_property_count */
+
+/**
+ * Check if passed object is the instance of specified built-in.
+ */
+bool
+ecma_builtin_is (ecma_object_t *obj_p, /**< pointer to an object */
+                 ecma_builtin_id_t builtin_id) /**< id of built-in to check on */
+{
+  JERRY_ASSERT (obj_p != NULL && !ecma_is_lexical_environment (obj_p));
+  JERRY_ASSERT (builtin_id < ECMA_BUILTIN_ID__COUNT);
+
+  if (JERRY_CONTEXT (ecma_builtin_objects)[builtin_id] == NULL)
+  {
+    /* If a built-in object is not instantiated,
+     * the specified object cannot be the built-in object */
+    return false;
+  }
+  else
+  {
+    return (obj_p == JERRY_CONTEXT (ecma_builtin_objects)[builtin_id]);
+  }
+} /* ecma_builtin_is */
+
+/**
+ * Get reference to specified built-in object
+ *
+ * @return pointer to the object's instance
+ */
+ecma_object_t *
+ecma_builtin_get (ecma_builtin_id_t builtin_id) /**< id of built-in to check on */
+{
+  JERRY_ASSERT (builtin_id < ECMA_BUILTIN_ID__COUNT);
+
+  if (unlikely (JERRY_CONTEXT (ecma_builtin_objects)[builtin_id] == NULL))
+  {
+    ecma_instantiate_builtin (builtin_id);
+  }
+
+  ecma_ref_object (JERRY_CONTEXT (ecma_builtin_objects)[builtin_id]);
+
+  return JERRY_CONTEXT (ecma_builtin_objects)[builtin_id];
+} /* ecma_builtin_get */
+
+/**
+ * Checks whether the given function is a built-in routine
+ *
+ * @return true - if the function object is a built-in routine
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+ecma_builtin_function_is_routine (ecma_object_t *func_obj_p) /**< function object */
+{
+  JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_FUNCTION);
+  JERRY_ASSERT (ecma_get_object_is_builtin (func_obj_p));
+
+  ecma_extended_object_t *ext_func_obj_p = (ecma_extended_object_t *) func_obj_p;
+  return (ext_func_obj_p->u.built_in.routine_id >= ECMA_BUILTIN_ID__COUNT);
+} /* ecma_builtin_function_is_routine */
+
+/**
+ * Initialize specified built-in object.
+ *
+ * @return pointer to the object
+ */
+static ecma_object_t *
+ecma_builtin_init_object (ecma_builtin_id_t obj_builtin_id, /**< built-in ID */
+                          ecma_object_t *prototype_obj_p, /**< prototype object */
+                          ecma_object_type_t obj_type, /**< object's type */
+                          bool is_extensible) /**< value of object's [[Extensible]] property */
+{
+  bool is_extended_built_in = (obj_type == ECMA_OBJECT_TYPE_CLASS
+                               || obj_type == ECMA_OBJECT_TYPE_ARRAY);
+
+  size_t ext_object_size = (is_extended_built_in ? sizeof (ecma_extended_built_in_object_t)
+                                                 : sizeof (ecma_extended_object_t));
+
+  size_t property_count = ecma_builtin_get_property_count (obj_builtin_id);
+
+  if (property_count > 32)
+  {
+    /* Only 64 extra properties supported at the moment.
+     * This can be extended to 256 later. */
+    JERRY_ASSERT (property_count <= (32 + 64));
+
+    ext_object_size += sizeof (uint32_t) * 2;
+  }
+
+  ecma_object_t *obj_p = ecma_create_object (prototype_obj_p, ext_object_size, obj_type);
+
+  if (!is_extensible)
+  {
+    ecma_set_object_extensible (obj_p, false);
+  }
+
+  /*
+   * [[Class]] property of built-in object is not stored explicitly.
+   *
+   * See also: ecma_object_get_class_name
+   */
+
+  ecma_set_object_is_builtin (obj_p);
+  ecma_built_in_props_t *built_in_props_p;
+
+  if (is_extended_built_in)
+  {
+    built_in_props_p = &((ecma_extended_built_in_object_t *) obj_p)->built_in;
+  }
+  else
+  {
+    built_in_props_p = &((ecma_extended_object_t *) obj_p)->u.built_in;
+  }
+
+  built_in_props_p->id = obj_builtin_id;
+  built_in_props_p->routine_id = obj_builtin_id;
+  built_in_props_p->instantiated_bitset[0] = 0;
+
+  if (property_count > 32)
+  {
+    built_in_props_p->length_and_bitset_size = 1 << ECMA_BUILT_IN_BITSET_SHIFT;
+
+    uint32_t *instantiated_bitset_p = built_in_props_p->instantiated_bitset;
+    instantiated_bitset_p[1] = 0;
+    instantiated_bitset_p[2] = 0;
+  }
+  else
+  {
+    built_in_props_p->length_and_bitset_size = 0;
+  }
+
+  /** Initializing [[PrimitiveValue]] properties of built-in prototype objects */
+  switch (obj_builtin_id)
+  {
+#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
+    case ECMA_BUILTIN_ID_ARRAY_PROTOTYPE:
+    {
+      JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_ARRAY);
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+      ext_object_p->u.array.length = 0;
+      ext_object_p->u.array.length_prop = ECMA_PROPERTY_FLAG_WRITABLE | ECMA_PROPERTY_TYPE_VIRTUAL;
+      break;
+    }
+#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
+
+#ifndef CONFIG_DISABLE_STRING_BUILTIN
+    case ECMA_BUILTIN_ID_STRING_PROTOTYPE:
+    {
+      JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_CLASS);
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+      ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_STRING_UL;
+      ecma_string_t *prim_prop_str_value_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+      ext_object_p->u.class_prop.u.value = ecma_make_string_value (prim_prop_str_value_p);
+      break;
+    }
+#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
+
+#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
+    case ECMA_BUILTIN_ID_NUMBER_PROTOTYPE:
+    {
+      JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_CLASS);
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+      ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_NUMBER_UL;
+      ext_object_p->u.class_prop.u.value = ecma_make_integer_value (0);
+      break;
+    }
+#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
+
+#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
+    case ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE:
+    {
+      JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_CLASS);
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+      ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_BOOLEAN_UL;
+      ext_object_p->u.class_prop.u.value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+      break;
+    }
+#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
+
+#ifndef CONFIG_DISABLE_DATE_BUILTIN
+    case ECMA_BUILTIN_ID_DATE_PROTOTYPE:
+    {
+      JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_CLASS);
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+      ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_DATE_UL;
+
+      ecma_number_t *prim_prop_num_value_p = ecma_alloc_number ();
+      *prim_prop_num_value_p = ecma_number_make_nan ();
+      ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.class_prop.u.value, prim_prop_num_value_p);
+      break;
+    }
+#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+    case ECMA_BUILTIN_ID_REGEXP_PROTOTYPE:
+    {
+      JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_CLASS);
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+      ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_REGEXP_UL;
+      ext_object_p->u.class_prop.u.value = ECMA_NULL_POINTER;
+      break;
+    }
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+    default:
+    {
+      JERRY_ASSERT (obj_type != ECMA_OBJECT_TYPE_CLASS);
+      break;
+    }
+  }
+
+  return obj_p;
+} /* ecma_builtin_init_object */
+
+/**
+ * Instantiate specified ECMA built-in object
+ */
+static void
+ecma_instantiate_builtin (ecma_builtin_id_t id) /**< built-in id */
+{
+  switch (id)
+  {
+#define BUILTIN(builtin_id, \
+                object_type, \
+                object_prototype_builtin_id, \
+                is_extensible, \
+                is_static, \
+                lowercase_name) \
+    case builtin_id: \
+    { \
+      JERRY_ASSERT (JERRY_CONTEXT (ecma_builtin_objects)[builtin_id] == NULL); \
+      \
+      ecma_object_t *prototype_obj_p; \
+      if (object_prototype_builtin_id == ECMA_BUILTIN_ID__COUNT) \
+      { \
+        prototype_obj_p = NULL; \
+      } \
+      else \
+      { \
+        if (JERRY_CONTEXT (ecma_builtin_objects)[object_prototype_builtin_id] == NULL) \
+        { \
+          ecma_instantiate_builtin (object_prototype_builtin_id); \
+        } \
+        prototype_obj_p = JERRY_CONTEXT (ecma_builtin_objects)[object_prototype_builtin_id]; \
+        JERRY_ASSERT (prototype_obj_p != NULL); \
+      } \
+      \
+      ecma_object_t *builtin_obj_p = ecma_builtin_init_object (builtin_id, \
+                                                               prototype_obj_p, \
+                                                               object_type, \
+                                                               is_extensible); \
+      JERRY_CONTEXT (ecma_builtin_objects)[builtin_id] = builtin_obj_p; \
+      \
+      break; \
+    }
+#include "ecma-builtins.inc.h"
+
+    default:
+    {
+      JERRY_ASSERT (id < ECMA_BUILTIN_ID__COUNT);
+
+      JERRY_UNREACHABLE (); /* The built-in is not implemented. */
+    }
+  }
+} /* ecma_instantiate_builtin */
+
+/**
+ * Finalize ECMA built-in objects
+ */
+void
+ecma_finalize_builtins (void)
+{
+  for (ecma_builtin_id_t id = (ecma_builtin_id_t) 0;
+       id < ECMA_BUILTIN_ID__COUNT;
+       id = (ecma_builtin_id_t) (id + 1))
+  {
+    if (JERRY_CONTEXT (ecma_builtin_objects)[id] != NULL)
+    {
+      ecma_deref_object (JERRY_CONTEXT (ecma_builtin_objects)[id]);
+      JERRY_CONTEXT (ecma_builtin_objects)[id] = NULL;
+    }
+  }
+} /* ecma_finalize_builtins */
+
+/**
+ * Construct a Function object for specified built-in routine
+ *
+ * See also: ECMA-262 v5, 15
+ *
+ * @return pointer to constructed Function object
+ */
+static ecma_object_t *
+ecma_builtin_make_function_object_for_routine (ecma_builtin_id_t builtin_id, /**< identifier of built-in object */
+                                               uint16_t routine_id, /**< builtin-wide identifier of the built-in
+                                                                     *   object's routine property */
+                                               uint8_t length_prop_value) /**< value of 'length' property */
+{
+  JERRY_ASSERT (length_prop_value < (1 << ECMA_BUILT_IN_BITSET_SHIFT));
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE);
+
+  size_t ext_object_size = sizeof (ecma_extended_object_t);
+
+  size_t property_count = ecma_builtin_get_property_count (builtin_id);
+
+  if (property_count > 32)
+  {
+    /* Only 64 extra properties supported at the moment.
+     * This can be extended to 256 later. */
+    JERRY_ASSERT (property_count <= (32 + 64));
+
+    ext_object_size += sizeof (uint32_t) * 2;
+  }
+
+  ecma_object_t *func_obj_p = ecma_create_object (prototype_obj_p,
+                                                  ext_object_size,
+                                                  ECMA_OBJECT_TYPE_FUNCTION);
+
+  ecma_deref_object (prototype_obj_p);
+
+  ecma_set_object_is_builtin (func_obj_p);
+
+  JERRY_ASSERT (routine_id >= ECMA_BUILTIN_ID__COUNT);
+
+  ecma_extended_object_t *ext_func_obj_p = (ecma_extended_object_t *) func_obj_p;
+  ext_func_obj_p->u.built_in.id = builtin_id;
+  ext_func_obj_p->u.built_in.routine_id = routine_id;
+  ext_func_obj_p->u.built_in.instantiated_bitset[0] = 0;
+
+  if (property_count > 32)
+  {
+    length_prop_value = (uint8_t) (length_prop_value | (1 << ECMA_BUILT_IN_BITSET_SHIFT));
+
+    uint32_t *instantiated_bitset_p = ext_func_obj_p->u.built_in.instantiated_bitset;
+    instantiated_bitset_p[1] = 0;
+    instantiated_bitset_p[2] = 0;
+  }
+
+  ext_func_obj_p->u.built_in.length_and_bitset_size = length_prop_value;
+
+  return func_obj_p;
+} /* ecma_builtin_make_function_object_for_routine */
+
+/**
+ * Construct a Function object for specified built-in accessor getter
+ *
+ * @return pointer to constructed accessor getter Function object
+ */
+static ecma_object_t *
+ecma_builtin_make_function_object_for_getter_accessor (ecma_builtin_id_t builtin_id, /**< id of built-in object */
+                                                       uint16_t routine_id) /**< builtin-wide id of the built-in
+                                                                            *   object's routine property */
+{
+  return ecma_builtin_make_function_object_for_routine (builtin_id, routine_id, 0);
+} /* ecma_builtin_make_function_object_for_getter_accessor */
+
+/**
+ * Construct a Function object for specified built-in accessor setter
+ *
+ * @return pointer to constructed accessor getter Function object
+ */
+static ecma_object_t *
+ecma_builtin_make_function_object_for_setter_accessor (ecma_builtin_id_t builtin_id, /**< id of built-in object */
+                                                       uint16_t routine_id) /**< builtin-wide id of the built-in
+                                                                            *   object's routine property */
+{
+  return ecma_builtin_make_function_object_for_routine (builtin_id, routine_id, 1);
+} /* ecma_builtin_make_function_object_for_setter_accessor */
+
+/**
+ * If the property's name is one of built-in properties of the object
+ * that is not instantiated yet, instantiate the property and
+ * return pointer to the instantiated property.
+ *
+ * @return pointer property, if one was instantiated,
+ *         NULL - otherwise.
+ */
+ecma_property_t *
+ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object */
+                                          ecma_string_t *string_p) /**< property's name */
+{
+  JERRY_ASSERT (ecma_get_object_is_builtin (object_p));
+
+  if (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_FUNCTION
+      && ecma_builtin_function_is_routine (object_p))
+  {
+    if (ecma_string_is_length (string_p))
+    {
+      /*
+       * Lazy instantiation of 'length' property
+       *
+       * Note:
+       *      We don't need to mark that the property was already lazy instantiated,
+       *      as it is non-configurable and so can't be deleted
+       */
+
+      ecma_property_t *len_prop_p;
+      ecma_property_value_t *len_prop_value_p = ecma_create_named_data_property (object_p,
+                                                                                 string_p,
+                                                                                 ECMA_PROPERTY_FIXED,
+                                                                                 &len_prop_p);
+
+      ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) object_p;
+
+      uint8_t length = ext_obj_p->u.built_in.length_and_bitset_size & ((1 << ECMA_BUILT_IN_BITSET_SHIFT) - 1);
+
+      len_prop_value_p->value = ecma_make_integer_value (length);
+
+      return len_prop_p;
+    }
+
+    return NULL;
+  }
+
+  lit_magic_string_id_t magic_string_id = ecma_get_string_magic (string_p);
+
+  if (magic_string_id == LIT_MAGIC_STRING__COUNT)
+  {
+    return NULL;
+  }
+
+  ecma_built_in_props_t *built_in_props_p;
+  ecma_object_type_t object_type = ecma_get_object_type (object_p);
+
+  if (object_type == ECMA_OBJECT_TYPE_CLASS || object_type == ECMA_OBJECT_TYPE_ARRAY)
+  {
+    built_in_props_p = &((ecma_extended_built_in_object_t *) object_p)->built_in;
+  }
+  else
+  {
+    built_in_props_p = &((ecma_extended_object_t *) object_p)->u.built_in;
+  }
+
+  ecma_builtin_id_t builtin_id = (ecma_builtin_id_t) built_in_props_p->id;
+
+  JERRY_ASSERT (builtin_id < ECMA_BUILTIN_ID__COUNT);
+  JERRY_ASSERT (ecma_builtin_is (object_p, builtin_id));
+
+  const ecma_builtin_property_descriptor_t *property_list_p = ecma_builtin_property_list_references[builtin_id];
+
+  const ecma_builtin_property_descriptor_t *curr_property_p = property_list_p;
+
+  while (curr_property_p->magic_string_id != magic_string_id)
+  {
+    if (curr_property_p->magic_string_id == LIT_MAGIC_STRING__COUNT)
+    {
+      return NULL;
+    }
+    curr_property_p++;
+  }
+
+  uint32_t index = (uint32_t) (curr_property_p - property_list_p);
+
+  uint32_t *bitset_p = built_in_props_p->instantiated_bitset + (index >> 5);
+
+  uint32_t bit_for_index = (uint32_t) (1u << (index & 0x1f));
+
+  if (*bitset_p & bit_for_index)
+  {
+    /* This property was instantiated before. */
+    return NULL;
+  }
+
+  *bitset_p |= bit_for_index;
+
+  ecma_value_t value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  bool is_accessor = false;
+  ecma_object_t *getter_p = NULL;
+  ecma_object_t *setter_p = NULL;
+
+  switch (curr_property_p->type)
+  {
+    case ECMA_BUILTIN_PROPERTY_SIMPLE:
+    {
+      value = ecma_make_simple_value (curr_property_p->value);
+      break;
+    }
+    case ECMA_BUILTIN_PROPERTY_NUMBER:
+    {
+      ecma_number_t num = 0.0;
+
+      if (curr_property_p->value < ECMA_BUILTIN_NUMBER_MAX)
+      {
+        num = curr_property_p->value;
+      }
+      else if (curr_property_p->value < ECMA_BUILTIN_NUMBER_NAN)
+      {
+        static const ecma_number_t builtin_number_list[] =
+        {
+          ECMA_NUMBER_MAX_VALUE,
+          ECMA_NUMBER_MIN_VALUE,
+          ECMA_NUMBER_E,
+          ECMA_NUMBER_PI,
+          ECMA_NUMBER_LN10,
+          ECMA_NUMBER_LN2,
+          ECMA_NUMBER_LOG2E,
+          ECMA_NUMBER_LOG10E,
+          ECMA_NUMBER_SQRT2,
+          ECMA_NUMBER_SQRT_1_2
+        };
+
+        num = builtin_number_list[curr_property_p->value - ECMA_BUILTIN_NUMBER_MAX];
+      }
+      else
+      {
+        switch (curr_property_p->value)
+        {
+          case ECMA_BUILTIN_NUMBER_NAN:
+          {
+            num = ecma_number_make_nan ();
+            break;
+          }
+          case ECMA_BUILTIN_NUMBER_POSITIVE_INFINITY:
+          {
+            num = ecma_number_make_infinity (false);
+            break;
+          }
+          case ECMA_BUILTIN_NUMBER_NEGATIVE_INFINITY:
+          {
+            num = ecma_number_make_infinity (true);
+            break;
+          }
+          default:
+          {
+            JERRY_UNREACHABLE ();
+            break;
+          }
+        }
+      }
+
+      value = ecma_make_number_value (num);
+      break;
+    }
+    case ECMA_BUILTIN_PROPERTY_STRING:
+    {
+      value = ecma_make_string_value (ecma_get_magic_string (curr_property_p->value));
+      break;
+    }
+    case ECMA_BUILTIN_PROPERTY_OBJECT:
+    {
+      value = ecma_make_object_value (ecma_builtin_get (curr_property_p->value));
+      break;
+    }
+    case ECMA_BUILTIN_PROPERTY_ROUTINE:
+    {
+      ecma_object_t *func_obj_p;
+      func_obj_p = ecma_builtin_make_function_object_for_routine (builtin_id,
+                                                                  ECMA_GET_ROUTINE_ID (curr_property_p->value),
+                                                                  ECMA_GET_ROUTINE_LENGTH (curr_property_p->value));
+      value = ecma_make_object_value (func_obj_p);
+      break;
+    }
+    case ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_WRITE:
+    {
+      is_accessor = true;
+      uint16_t getter_id = ECMA_ACCESSOR_READ_WRITE_GET_GETTER_ID (curr_property_p->value);
+      uint16_t setter_id = ECMA_ACCESSOR_READ_WRITE_GET_SETTER_ID (curr_property_p->value);
+      getter_p = ecma_builtin_make_function_object_for_getter_accessor (builtin_id, getter_id);
+      setter_p = ecma_builtin_make_function_object_for_setter_accessor (builtin_id, setter_id);
+      break;
+    }
+    case ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_ONLY:
+    {
+      is_accessor = true;
+      getter_p = ecma_builtin_make_function_object_for_getter_accessor (builtin_id,
+                                                                        curr_property_p->value);
+      break;
+    }
+    default:
+    {
+      JERRY_UNREACHABLE ();
+      return NULL;
+    }
+  }
+
+  ecma_property_t *prop_p;
+
+  if (is_accessor)
+  {
+    ecma_create_named_accessor_property (object_p,
+                                         string_p,
+                                         getter_p,
+                                         setter_p,
+                                         curr_property_p->attributes,
+                                         &prop_p);
+
+    if (setter_p)
+    {
+      ecma_deref_object (setter_p);
+    }
+    if (getter_p)
+    {
+      ecma_deref_object (getter_p);
+    }
+  }
+  else
+  {
+    ecma_property_value_t *prop_value_p = ecma_create_named_data_property (object_p,
+                                                                           string_p,
+                                                                           curr_property_p->attributes,
+                                                                           &prop_p);
+    prop_value_p->value = value;
+
+    /* Reference count of objects must be decreased. */
+    if (ecma_is_value_object (value))
+    {
+      ecma_free_value (value);
+    }
+  }
+
+  return prop_p;
+} /* ecma_builtin_try_to_instantiate_property */
+
+/**
+ * List names of a built-in object's lazy instantiated properties
+ *
+ * See also:
+ *          ecma_builtin_try_to_instantiate_property
+ */
+void
+ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in object */
+                                       bool separate_enumerable, /**< true -  list enumerable properties into
+                                                                  *           main collection, and non-enumerable
+                                                                  *           to collection of 'skipped non-enumerable'
+                                                                  *           properties,
+                                                                  *   false - list all properties into main collection.
+                                                                  */
+                                       ecma_collection_header_t *main_collection_p, /**< 'main' collection */
+                                       ecma_collection_header_t *non_enum_collection_p) /**< skipped 'non-enumerable'
+                                                                                         *   collection */
+{
+  JERRY_ASSERT (ecma_get_object_is_builtin (object_p));
+
+  if (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_FUNCTION
+      && ecma_builtin_function_is_routine (object_p))
+  {
+    ecma_collection_header_t *for_enumerable_p = main_collection_p;
+    JERRY_UNUSED (for_enumerable_p);
+
+    ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? non_enum_collection_p : main_collection_p;
+
+    /* 'length' property is non-enumerable (ECMA-262 v5, 15) */
+    ecma_string_t *name_p = ecma_new_ecma_length_string ();
+    ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), true);
+    ecma_deref_ecma_string (name_p);
+  }
+  else
+  {
+    ecma_built_in_props_t *built_in_props_p;
+    ecma_object_type_t object_type = ecma_get_object_type (object_p);
+
+    if (object_type == ECMA_OBJECT_TYPE_CLASS || object_type == ECMA_OBJECT_TYPE_ARRAY)
+    {
+      built_in_props_p = &((ecma_extended_built_in_object_t *) object_p)->built_in;
+    }
+    else
+    {
+      built_in_props_p = &((ecma_extended_object_t *) object_p)->u.built_in;
+    }
+
+    ecma_builtin_id_t builtin_id = (ecma_builtin_id_t) built_in_props_p->id;
+
+    JERRY_ASSERT (builtin_id < ECMA_BUILTIN_ID__COUNT);
+    JERRY_ASSERT (ecma_builtin_is (object_p, builtin_id));
+
+    const ecma_builtin_property_descriptor_t *curr_property_p = ecma_builtin_property_list_references[builtin_id];
+
+    ecma_length_t index = 0;
+    uint32_t *bitset_p = built_in_props_p->instantiated_bitset;
+
+    ecma_collection_header_t *for_non_enumerable_p = (separate_enumerable ? non_enum_collection_p
+                                                                          : main_collection_p);
+
+    while (curr_property_p->magic_string_id != LIT_MAGIC_STRING__COUNT)
+    {
+      if (index == 32)
+      {
+        bitset_p++;
+        index = 0;
+      }
+
+      ecma_string_t *name_p = ecma_get_magic_string (curr_property_p->magic_string_id);
+
+      uint32_t bit_for_index = (uint32_t) 1u << index;
+
+      if (!(*bitset_p & bit_for_index) || ecma_op_object_has_own_property (object_p, name_p))
+      {
+        ecma_append_to_values_collection (for_non_enumerable_p,
+                                          ecma_make_string_value (name_p),
+                                          true);
+      }
+
+      ecma_deref_ecma_string (name_p);
+
+      curr_property_p++;
+      index++;
+    }
+  }
+} /* ecma_builtin_list_lazy_property_names */
+
+/**
+ * Dispatcher of built-in routines
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_dispatch_routine (ecma_builtin_id_t builtin_object_id, /**< built-in object' identifier */
+                               uint16_t builtin_routine_id, /**< builtin-wide identifier
+                                                             *   of the built-in object's
+                                                             *   routine property */
+                               ecma_value_t this_arg_value, /**< 'this' argument value */
+                               const ecma_value_t arguments_list[], /**< list of arguments passed to routine */
+                               ecma_length_t arguments_number) /**< length of arguments' list */
+{
+  switch (builtin_object_id)
+  {
+#define BUILTIN(builtin_id, \
+                object_type, \
+                object_prototype_builtin_id, \
+                is_extensible, \
+                is_static, \
+                lowercase_name) \
+    case builtin_id: \
+      { \
+        return ecma_builtin_ ## lowercase_name ## _dispatch_routine (builtin_routine_id, \
+                                                                     this_arg_value, \
+                                                                     arguments_list, \
+                                                                     arguments_number); \
+      }
+#include "ecma-builtins.inc.h"
+
+    case ECMA_BUILTIN_ID__COUNT:
+    {
+      JERRY_UNREACHABLE ();
+    }
+
+    default:
+    {
+      JERRY_UNREACHABLE (); /* The built-in is not implemented. */
+    }
+  }
+
+  JERRY_UNREACHABLE ();
+} /* ecma_builtin_dispatch_routine */
+
+/**
+ * Handle calling [[Call]] of built-in object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */
+                            ecma_value_t this_arg_value, /**< 'this' argument value */
+                            const ecma_value_t *arguments_list_p, /**< arguments list */
+                            ecma_length_t arguments_list_len) /**< arguments list length */
+{
+  JERRY_ASSERT (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_FUNCTION);
+  JERRY_ASSERT (ecma_get_object_is_builtin (obj_p));
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) obj_p;
+
+  if (ecma_builtin_function_is_routine (obj_p))
+  {
+    ret_value = ecma_builtin_dispatch_routine (ext_obj_p->u.built_in.id,
+                                               ext_obj_p->u.built_in.routine_id,
+                                               this_arg_value,
+                                               arguments_list_p,
+                                               arguments_list_len);
+  }
+  else
+  {
+    switch ((ecma_builtin_id_t) ext_obj_p->u.built_in.id)
+    {
+#define BUILTIN(builtin_id, \
+                object_type, \
+                object_prototype_builtin_id, \
+                is_extensible, \
+                is_static, \
+                lowercase_name) \
+      case builtin_id: \
+      { \
+        if (object_type == ECMA_OBJECT_TYPE_FUNCTION) \
+        { \
+          ret_value = ecma_builtin_ ## lowercase_name ## _dispatch_call (arguments_list_p, \
+                                                                         arguments_list_len); \
+        } \
+        break; \
+      }
+#include "ecma-builtins.inc.h"
+
+      case ECMA_BUILTIN_ID__COUNT:
+      {
+        JERRY_UNREACHABLE ();
+      }
+
+      default:
+      {
+        JERRY_UNREACHABLE (); /* The built-in is not implemented. */
+      }
+    }
+  }
+
+  JERRY_ASSERT (!ecma_is_value_empty (ret_value));
+
+  return ret_value;
+} /* ecma_builtin_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in object
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_dispatch_construct (ecma_object_t *obj_p, /**< built-in object */
+                                 const ecma_value_t *arguments_list_p, /**< arguments list */
+                                 ecma_length_t arguments_list_len) /**< arguments list length */
+{
+  JERRY_ASSERT (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_FUNCTION);
+  JERRY_ASSERT (ecma_get_object_is_builtin (obj_p));
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) obj_p;
+
+  switch (ext_obj_p->u.built_in.id)
+  {
+#define BUILTIN(builtin_id, \
+                object_type, \
+                object_prototype_builtin_id, \
+                is_extensible, \
+                is_static, \
+                lowercase_name) \
+    case builtin_id: \
+      { \
+        if (object_type == ECMA_OBJECT_TYPE_FUNCTION) \
+        { \
+          ret_value = ecma_builtin_ ## lowercase_name ## _dispatch_construct (arguments_list_p, \
+                                                                              arguments_list_len); \
+        } \
+        break; \
+      }
+#include "ecma-builtins.inc.h"
+
+    case ECMA_BUILTIN_ID__COUNT:
+    {
+      JERRY_UNREACHABLE ();
+    }
+
+    default:
+    {
+      JERRY_UNREACHABLE (); /* The built-in is not implemented. */
+    }
+  }
+
+  JERRY_ASSERT (!ecma_is_value_empty (ret_value));
+
+  return ret_value;
+} /* ecma_builtin_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.h
new file mode 100644 (file)
index 0000000..2468018
--- /dev/null
@@ -0,0 +1,90 @@
+/* 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.
+ */
+
+#ifndef ECMA_BUILTINS_H
+#define ECMA_BUILTINS_H
+
+#include "ecma-globals.h"
+
+/**
+ * A built-in object's identifier
+ */
+typedef enum
+{
+#define BUILTIN(builtin_id, \
+                object_type, \
+                object_prototype_builtin_id, \
+                is_extensible, \
+                is_static, \
+                lowercase_name) \
+  builtin_id,
+#include "ecma-builtins.inc.h"
+  ECMA_BUILTIN_ID__COUNT /**< number of built-in objects */
+} ecma_builtin_id_t;
+
+/**
+ * Construct a routine value
+ */
+#define ECMA_ROUTINE_VALUE(id, length) (((id) << 4) | length)
+
+/**
+ * Get routine length
+ */
+#define ECMA_GET_ROUTINE_LENGTH(value) ((uint8_t) ((value) & 0xf))
+
+/**
+ * Get routine ID
+ */
+#define ECMA_GET_ROUTINE_ID(value) ((uint16_t) ((value) >> 4))
+
+/**
+ * Construct a fully accessor value
+ */
+#define ECMA_ACCESSOR_READ_WRITE(getter, setter) (((getter) << 8) | (setter))
+
+/**
+ * Get accessor setter ID
+ */
+#define ECMA_ACCESSOR_READ_WRITE_GET_SETTER_ID(value) ((uint16_t) ((value) & 0xff))
+
+/**
+ * Get accessor getter ID
+ */
+#define ECMA_ACCESSOR_READ_WRITE_GET_GETTER_ID(value) ((uint16_t) ((value) >> 8))
+
+/* ecma-builtins.c */
+void ecma_finalize_builtins (void);
+
+ecma_value_t
+ecma_builtin_dispatch_call (ecma_object_t *obj_p, ecma_value_t this_arg_value,
+                            const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
+ecma_value_t
+ecma_builtin_dispatch_construct (ecma_object_t *obj_p,
+                                 const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
+ecma_property_t *
+ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, ecma_string_t *string_p);
+void
+ecma_builtin_list_lazy_property_names (ecma_object_t *object_p,
+                                       bool separate_enumerable,
+                                       ecma_collection_header_t *main_collection_p,
+                                       ecma_collection_header_t *non_enum_collection_p);
+bool
+ecma_builtin_is (ecma_object_t *obj_p, ecma_builtin_id_t builtin_id);
+ecma_object_t *
+ecma_builtin_get (ecma_builtin_id_t builtin_id);
+bool
+ecma_builtin_function_is_routine (ecma_object_t *func_obj_p);
+
+#endif /* !ECMA_BUILTINS_H */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h
new file mode 100644 (file)
index 0000000..fdc68eb
--- /dev/null
@@ -0,0 +1,491 @@
+/* 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.
+ */
+
+/* Description of built-in objects
+   in format (ECMA_BUILTIN_ID_id, object_type, prototype_id, is_extensible, is_static, underscored_id) */
+
+/* The Object.prototype object (15.2.4) */
+BUILTIN (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID__COUNT /* no prototype */,
+         true,
+         true,
+         object_prototype)
+
+/* The Object object (15.2.1) */
+BUILTIN (ECMA_BUILTIN_ID_OBJECT,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         object)
+
+#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
+/* The Array.prototype object (15.4.4) */
+BUILTIN (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_ARRAY,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         array_prototype)
+
+/* The Array object (15.4.1) */
+BUILTIN (ECMA_BUILTIN_ID_ARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         array)
+#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN*/
+
+#ifndef CONFIG_DISABLE_STRING_BUILTIN
+/* The String.prototype object (15.5.4) */
+BUILTIN (ECMA_BUILTIN_ID_STRING_PROTOTYPE,
+         ECMA_OBJECT_TYPE_CLASS,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         string_prototype)
+
+/* The String object (15.5.1) */
+BUILTIN (ECMA_BUILTIN_ID_STRING,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         string)
+#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
+
+#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
+/* The Boolean.prototype object (15.6.4) */
+BUILTIN (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE,
+         ECMA_OBJECT_TYPE_CLASS,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         boolean_prototype)
+
+/* The Boolean object (15.6.1) */
+BUILTIN (ECMA_BUILTIN_ID_BOOLEAN,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         boolean)
+#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
+
+#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
+/* The Number.prototype object (15.7.4) */
+BUILTIN (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE,
+         ECMA_OBJECT_TYPE_CLASS,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         number_prototype)
+
+/* The Number object (15.7.1) */
+BUILTIN (ECMA_BUILTIN_ID_NUMBER,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         number)
+#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
+
+/* The Function.prototype object (15.3.4) */
+BUILTIN (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         function_prototype)
+
+/* The Function object (15.3.1) */
+BUILTIN (ECMA_BUILTIN_ID_FUNCTION,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         function)
+
+#ifndef CONFIG_DISABLE_MATH_BUILTIN
+/* The Math object (15.8) */
+BUILTIN (ECMA_BUILTIN_ID_MATH,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         math)
+#endif /* !CONFIG_DISABLE_MATH_BUILTIN */
+
+#ifndef CONFIG_DISABLE_JSON_BUILTIN
+/* The JSON object (15.12) */
+BUILTIN (ECMA_BUILTIN_ID_JSON,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         json)
+#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
+
+#ifndef CONFIG_DISABLE_DATE_BUILTIN
+/* The Date.prototype object (15.9.4) */
+BUILTIN (ECMA_BUILTIN_ID_DATE_PROTOTYPE,
+         ECMA_OBJECT_TYPE_CLASS,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         date_prototype)
+
+/* The Date object (15.9.3) */
+BUILTIN (ECMA_BUILTIN_ID_DATE,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         date)
+#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+/* The RegExp.prototype object (15.10.6) */
+BUILTIN (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE,
+         ECMA_OBJECT_TYPE_CLASS,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         regexp_prototype)
+
+/* The RegExp object (15.10) */
+BUILTIN (ECMA_BUILTIN_ID_REGEXP,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         regexp)
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+
+/* The Error object (15.11.1) */
+BUILTIN (ECMA_BUILTIN_ID_ERROR,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         error)
+
+/* The Error.prototype object (15.11.4) */
+BUILTIN (ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         error_prototype)
+
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+/* The EvalError.prototype object (15.11.6.1) */
+BUILTIN (ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
+         true,
+         true,
+         eval_error_prototype)
+
+/* The EvalError object (15.11.6.1) */
+BUILTIN (ECMA_BUILTIN_ID_EVAL_ERROR,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         eval_error)
+
+/* The RangeError.prototype object (15.11.6.2) */
+BUILTIN (ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
+         true,
+         true,
+         range_error_prototype)
+
+/* The RangeError object (15.11.6.2) */
+BUILTIN (ECMA_BUILTIN_ID_RANGE_ERROR,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         range_error)
+
+/* The ReferenceError.prototype object (15.11.6.3) */
+BUILTIN (ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
+         true,
+         true,
+         reference_error_prototype)
+
+/* The ReferenceError object (15.11.6.3) */
+BUILTIN (ECMA_BUILTIN_ID_REFERENCE_ERROR,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         reference_error)
+
+/* The SyntaxError.prototype object (15.11.6.4) */
+BUILTIN (ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
+         true,
+         true,
+         syntax_error_prototype)
+
+/* The SyntaxError object (15.11.6.4) */
+BUILTIN (ECMA_BUILTIN_ID_SYNTAX_ERROR,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         syntax_error)
+
+/* The TypeError.prototype object (15.11.6.5) */
+BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
+         true,
+         true,
+         type_error_prototype)
+
+/* The TypeError object (15.11.6.5) */
+BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         type_error)
+
+/* The URIError.prototype object (15.11.6.6) */
+BUILTIN (ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
+         true,
+         true,
+         uri_error_prototype)
+
+/* The URIError object (15.11.6.6) */
+BUILTIN (ECMA_BUILTIN_ID_URI_ERROR,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         uri_error)
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+/**< The [[ThrowTypeError]] object (13.2.3) */
+BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         false,
+         true,
+         type_error_thrower)
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* The ArrayBuffer.prototype object (ES2015 24.1.4) */
+BUILTIN (ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         arraybuffer_prototype)
+
+/* The ArrayBuffer object (ES2015 24.1.2) */
+BUILTIN (ECMA_BUILTIN_ID_ARRAYBUFFER,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         arraybuffer)
+
+ /* The %TypedArrayPrototype% object (ES2015 24.2.3) */
+BUILTIN (ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         typedarray_prototype)
+
+/* The %TypedArray% intrinsic object (ES2015 22.2.1) */
+BUILTIN (ECMA_BUILTIN_ID_TYPEDARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         typedarray)
+
+BUILTIN (ECMA_BUILTIN_ID_INT8ARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+         true,
+         true,
+         int8array_prototype)
+
+BUILTIN (ECMA_BUILTIN_ID_INT8ARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_TYPEDARRAY,
+         true,
+         true,
+         int8array)
+
+BUILTIN (ECMA_BUILTIN_ID_UINT8ARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+         true,
+         true,
+         uint8array_prototype)
+
+BUILTIN (ECMA_BUILTIN_ID_UINT8ARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_TYPEDARRAY,
+         true,
+         true,
+         uint8array)
+
+BUILTIN (ECMA_BUILTIN_ID_INT16ARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+         true,
+         true,
+         int16array_prototype)
+
+BUILTIN (ECMA_BUILTIN_ID_INT16ARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_TYPEDARRAY,
+         true,
+         true,
+         int16array)
+
+BUILTIN (ECMA_BUILTIN_ID_UINT16ARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+         true,
+         true,
+         uint16array_prototype)
+
+BUILTIN (ECMA_BUILTIN_ID_UINT16ARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_TYPEDARRAY,
+         true,
+         true,
+         uint16array)
+
+BUILTIN (ECMA_BUILTIN_ID_INT32ARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+         true,
+         true,
+         int32array_prototype)
+
+BUILTIN (ECMA_BUILTIN_ID_INT32ARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_TYPEDARRAY,
+         true,
+         true,
+         int32array)
+
+BUILTIN (ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+         true,
+         true,
+         uint32array_prototype)
+
+BUILTIN (ECMA_BUILTIN_ID_UINT32ARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_TYPEDARRAY,
+         true,
+         true,
+         uint32array)
+
+BUILTIN (ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+         true,
+         true,
+         float32array_prototype)
+
+BUILTIN (ECMA_BUILTIN_ID_FLOAT32ARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_TYPEDARRAY,
+         true,
+         true,
+         float32array)
+
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+BUILTIN (ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+         true,
+         true,
+         float64array_prototype)
+
+BUILTIN (ECMA_BUILTIN_ID_FLOAT64ARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_TYPEDARRAY,
+         true,
+         true,
+         float64array)
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+
+BUILTIN (ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+         true,
+         true,
+         uint8clampedarray_prototype)
+
+BUILTIN (ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_TYPEDARRAY,
+         true,
+         true,
+         uint8clampedarray)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+BUILTIN (ECMA_BUILTIN_ID_PROMISE_PROTOTYPE,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
+         true,
+         true,
+         promise_prototype)
+
+BUILTIN (ECMA_BUILTIN_ID_PROMISE,
+         ECMA_OBJECT_TYPE_FUNCTION,
+         ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
+         true,
+         true,
+         promise)
+
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+
+/* The Global object (15.1) */
+BUILTIN (ECMA_BUILTIN_ID_GLOBAL,
+         ECMA_OBJECT_TYPE_GENERAL,
+         ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, /* Implementation-dependent */
+         true,
+         true,
+         global)
+
+#undef BUILTIN
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array-prototype.c
new file mode 100644 (file)
index 0000000..7a97d29
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-float32array-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID float32array_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup float32arrayprototype ECMA Float32Array.prototype object built-in
+ * @{
+ */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array-prototype.inc.h
new file mode 100644 (file)
index 0000000..23149f3
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * Float32Array prototype description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.3.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_FLOAT32ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ES2015 22.2.6.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              4,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array.c
new file mode 100644 (file)
index 0000000..dca9a87
--- /dev/null
@@ -0,0 +1,86 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-typedarray-object.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-float32array.inc.h"
+#define BUILTIN_UNDERSCORED_ID float32array
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup float32array ECMA Float32Array object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of Float32Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_float32array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                         ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Float32Array cannot be directly called"));
+} /* ecma_builtin_float32array_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of Float32Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_float32array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                              ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE);
+  ecma_value_t val = ecma_op_create_typedarray (arguments_list_p,
+                                                arguments_list_len,
+                                                prototype_obj_p,
+                                                2,
+                                                LIT_MAGIC_STRING_FLOAT32_ARRAY_UL);
+
+  ecma_deref_object (prototype_obj_p);
+
+  return val;
+} /* ecma_builtin_float32array_dispatch_construct */
+
+/**
+  * @}
+  * @}
+  * @}
+  */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array.inc.h
new file mode 100644 (file)
index 0000000..259bf6a
--- /dev/null
@@ -0,0 +1,51 @@
+/* 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.
+ */
+
+/*
+ * Float32Array description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              4,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_FLOAT32_ARRAY_UL,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.c
new file mode 100644 (file)
index 0000000..fba6bd7
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-float64array-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID float64array_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup float64arrayprototype ECMA Float64Array.prototype object built-in
+ * @{
+ */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.inc.h
new file mode 100644 (file)
index 0000000..52fccbd
--- /dev/null
@@ -0,0 +1,38 @@
+/* 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.
+ */
+
+/*
+ * Float64Array prototype description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+
+/* ES2015 22.2.3.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_FLOAT64ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ES2015 22.2.6.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              8,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.c
new file mode 100644 (file)
index 0000000..b825991
--- /dev/null
@@ -0,0 +1,88 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-typedarray-object.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-float64array.inc.h"
+#define BUILTIN_UNDERSCORED_ID float64array
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup float64array ECMA Float64Array object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of Float64Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_float64array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                         ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Float64Array cannot be directly called"));
+} /* ecma_builtin_float64array_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of Float64Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_float64array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                              ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE);
+  ecma_value_t val = ecma_op_create_typedarray (arguments_list_p,
+                                                arguments_list_len,
+                                                prototype_obj_p,
+                                                3,
+                                                LIT_MAGIC_STRING_FLOAT64_ARRAY_UL);
+
+  ecma_deref_object (prototype_obj_p);
+
+  return val;
+} /* ecma_builtin_float64array_dispatch_construct */
+
+/**
+  * @}
+  * @}
+  * @}
+  */
+
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.inc.h
new file mode 100644 (file)
index 0000000..4e42997
--- /dev/null
@@ -0,0 +1,53 @@
+/* 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.
+ */
+
+/*
+ * Float64Array description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              8,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_FLOAT64_ARRAY_UL,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array-prototype.c
new file mode 100644 (file)
index 0000000..1e2756e
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-int16array-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID int16array_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup int16arrayprototype ECMA Int16Array.prototype object built-in
+ * @{
+ */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array-prototype.inc.h
new file mode 100644 (file)
index 0000000..3455e12
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * Int16Array prototype description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.3.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_INT16ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ES2015 22.2.6.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              2,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array.c
new file mode 100644 (file)
index 0000000..302a759
--- /dev/null
@@ -0,0 +1,86 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-typedarray-object.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-int16array.inc.h"
+#define BUILTIN_UNDERSCORED_ID int16array
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup int64array ECMA Int16Array object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of Int16Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_int16array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                       ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Int16Array cannot be directly called"));
+} /* ecma_builtin_int16array_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of Int16Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_int16array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                            ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_INT16ARRAY_PROTOTYPE);
+  ecma_value_t val = ecma_op_create_typedarray (arguments_list_p,
+                                                arguments_list_len,
+                                                prototype_obj_p,
+                                                1,
+                                                LIT_MAGIC_STRING_INT16_ARRAY_UL);
+
+  ecma_deref_object (prototype_obj_p);
+
+  return val;
+} /* ecma_builtin_int16array_dispatch_construct */
+
+/**
+  * @}
+  * @}
+  * @}
+  */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array.inc.h
new file mode 100644 (file)
index 0000000..887b446
--- /dev/null
@@ -0,0 +1,51 @@
+/* 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.
+ */
+
+/*
+ * Int16Array description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              2,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_INT16_ARRAY_UL,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_INT16ARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array-prototype.c
new file mode 100644 (file)
index 0000000..796518d
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-int32array-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID int32array_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup int32arrayprototype ECMA Int32Array.prototype object built-in
+ * @{
+ */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array-prototype.inc.h
new file mode 100644 (file)
index 0000000..5867495
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * Int32Array prototype description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.3.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_INT32ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ES2015 22.2.6.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              4,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array.c
new file mode 100644 (file)
index 0000000..af4b420
--- /dev/null
@@ -0,0 +1,86 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-typedarray-object.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-int32array.inc.h"
+#define BUILTIN_UNDERSCORED_ID int32array
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup int32array ECMA Int32Array object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of Int32Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_int32array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                       ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Int32Array cannot be directly called"));
+} /* ecma_builtin_int32array_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of Int32Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_int32array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                            ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_INT32ARRAY_PROTOTYPE);
+  ecma_value_t val = ecma_op_create_typedarray (arguments_list_p,
+                                                arguments_list_len,
+                                                prototype_obj_p,
+                                                2,
+                                                LIT_MAGIC_STRING_INT32_ARRAY_UL);
+
+  ecma_deref_object (prototype_obj_p);
+
+  return val;
+} /* ecma_builtin_int32array_dispatch_construct */
+
+/**
+  * @}
+  * @}
+  * @}
+  */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array.inc.h
new file mode 100644 (file)
index 0000000..f45d486
--- /dev/null
@@ -0,0 +1,51 @@
+/* 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.
+ */
+
+/*
+ * Int32Array description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              4,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_INT32_ARRAY_UL,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_INT32ARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array-prototype.c
new file mode 100644 (file)
index 0000000..64936bf
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-int8array-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID int8array_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup int8arrayprototype ECMA Int8Array.prototype object built-in
+ * @{
+ */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array-prototype.inc.h
new file mode 100644 (file)
index 0000000..29a0842
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * Int8Array prototype description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.3.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_INT8ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ES2015 22.2.6.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array.c
new file mode 100644 (file)
index 0000000..d076a15
--- /dev/null
@@ -0,0 +1,86 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-typedarray-object.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-int8array.inc.h"
+#define BUILTIN_UNDERSCORED_ID int8array
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup int8array ECMA Int8Array object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of Int8Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_int8array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                      ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Int8Array cannot be directly called"));
+} /* ecma_builtin_int8array_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of Int8Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_int8array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                           ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_INT8ARRAY_PROTOTYPE);
+  ecma_value_t val = ecma_op_create_typedarray (arguments_list_p,
+                                                arguments_list_len,
+                                                prototype_obj_p,
+                                                0,
+                                                LIT_MAGIC_STRING_INT8_ARRAY_UL);
+
+  ecma_deref_object (prototype_obj_p);
+
+  return val;
+} /* ecma_builtin_int8array_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array.inc.h
new file mode 100644 (file)
index 0000000..d88bb0a
--- /dev/null
@@ -0,0 +1,51 @@
+/* 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.
+ */
+
+/*
+ * Int8Array description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_INT8_ARRAY_UL,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_INT8ARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-prototype.c
new file mode 100644 (file)
index 0000000..ea8e8d9
--- /dev/null
@@ -0,0 +1,656 @@
+/* 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.
+ */
+
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-conversion.h"
+#include "ecma-function-object.h"
+#include "ecma-typedarray-object.h"
+#include "ecma-arraybuffer-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+#include "jrt-libc-includes.h"
+#include "ecma-gc.h"
+#include "jmem.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-typedarray-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID typedarray_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup typedarrayprototype ECMA %TypedArray%.prototype object built-in
+ * @{
+ */
+
+/**
+ * The %TypedArray%.prototype.buffer accessor
+ *
+ * See also:
+ *          ES2015, 22.2.3.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_buffer_getter (ecma_value_t this_arg) /**< this argument */
+{
+  if (ecma_is_typedarray (this_arg))
+  {
+    ecma_object_t *typedarray_p = ecma_get_object_from_value (this_arg);
+    ecma_object_t *obj_p = ecma_typedarray_get_arraybuffer (typedarray_p);
+    ecma_ref_object (obj_p);
+
+    return ecma_make_object_value (obj_p);
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray."));
+} /* ecma_builtin_typedarray_prototype_buffer_getter */
+
+/**
+ * The %TypedArray%.prototype.byteLength accessor
+ *
+ * See also:
+ *          ES2015, 22.2.3.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_bytelength_getter (ecma_value_t this_arg) /**< this argument */
+{
+  if (ecma_is_typedarray (this_arg))
+  {
+    ecma_object_t *typedarray_p = ecma_get_object_from_value (this_arg);
+    uint8_t shift = ecma_typedarray_get_element_size_shift (typedarray_p);
+
+    return ecma_make_uint32_value (ecma_typedarray_get_length (typedarray_p) << shift);
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray."));
+} /* ecma_builtin_typedarray_prototype_bytelength_getter */
+
+/**
+ * The %TypedArray%.prototype.byteOffset accessor
+ *
+ * See also:
+ *          ES2015, 22.2.3.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_byteoffset_getter (ecma_value_t this_arg) /**< this argument */
+{
+  if (ecma_is_typedarray (this_arg))
+  {
+    ecma_object_t *typedarray_p = ecma_get_object_from_value (this_arg);
+
+    return ecma_make_uint32_value (ecma_typedarray_get_offset (typedarray_p));
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray."));
+} /* ecma_builtin_typedarray_prototype_byteoffset_getter */
+
+/**
+ * The %TypedArray%.prototype.length accessor
+ *
+ * See also:
+ *          ES2015, 22.2.3.17
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_length_getter (ecma_value_t this_arg) /**< this argument */
+{
+  if (ecma_is_typedarray (this_arg))
+  {
+    ecma_object_t *typedarray_p = ecma_get_object_from_value (this_arg);
+
+    return ecma_make_uint32_value (ecma_typedarray_get_length (typedarray_p));
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray."));
+} /* ecma_builtin_typedarray_prototype_length_getter */
+
+/**
+ * Type of routine.
+ */
+typedef enum
+{
+  TYPEDARRAY_ROUTINE_EVERY, /**< routine: every ES2015, 22.2.3.7 */
+  TYPEDARRAY_ROUTINE_SOME, /**< routine: some ES2015, 22.2.3.9 */
+  TYPEDARRAY_ROUTINE_FOREACH, /**< routine: forEach ES2015, 15.4.4.18 */
+  TYPEDARRAY_ROUTINE__COUNT /**< count of the modes */
+} typedarray_routine_mode;
+
+/**
+ * The common function for 'every', 'some' and 'forEach'
+ * because they have a similar structure.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_exec_routine (ecma_value_t this_arg, /**< this argument */
+                                                ecma_value_t cb_func_val, /**< callback function */
+                                                ecma_value_t cb_this_arg, /**< 'this' of the callback function */
+                                                typedarray_routine_mode mode) /**< mode: which routine */
+{
+  JERRY_ASSERT (mode < TYPEDARRAY_ROUTINE__COUNT);
+
+  if (!ecma_is_typedarray (this_arg))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray."));
+  }
+
+  if (!ecma_op_is_callable (cb_func_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);
+  uint32_t len = ecma_typedarray_get_length (obj_p);
+  ecma_object_t *func_object_p = ecma_get_object_from_value (cb_func_val);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  for (uint32_t index = 0; index < len && ecma_is_value_empty (ret_value); index++)
+  {
+    ecma_value_t current_index =  ecma_make_uint32_value (index);
+    ecma_value_t get_value = ecma_op_typedarray_get_index_prop (obj_p, index);
+
+    JERRY_ASSERT (ecma_is_value_number (get_value));
+
+    ecma_value_t call_args[] = { get_value, current_index, this_arg };
+
+    ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, cb_this_arg, call_args, 3), ret_value);
+
+    if (mode == TYPEDARRAY_ROUTINE_EVERY)
+    {
+      if (!ecma_op_to_boolean (call_value))
+      {
+        ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+      }
+    }
+    else if (mode == TYPEDARRAY_ROUTINE_SOME)
+    {
+      if (ecma_op_to_boolean (call_value))
+      {
+        ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+      }
+    }
+
+    ECMA_FINALIZE (call_value);
+
+    ecma_fast_free_value (current_index);
+    ecma_fast_free_value (get_value);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    if (mode == TYPEDARRAY_ROUTINE_EVERY)
+    {
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+    }
+    else if (mode == TYPEDARRAY_ROUTINE_SOME)
+    {
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+    }
+    else
+    {
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+  }
+
+  return ret_value;
+} /* ecma_builtin_typedarray_prototype_exec_routine */
+
+/**
+ * The %TypedArray%.prototype object's 'every' routine
+ *
+ * See also:
+ *          ES2015, 22.2.3.7
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_every (ecma_value_t this_arg, /**< this argument */
+                                         ecma_value_t cb_func_val, /**< callback function */
+                                         ecma_value_t cb_this_arg) /**< this' of the callback function */
+{
+  return ecma_builtin_typedarray_prototype_exec_routine (this_arg,
+                                                         cb_func_val,
+                                                         cb_this_arg,
+                                                         TYPEDARRAY_ROUTINE_EVERY);
+} /* ecma_builtin_typedarray_prototype_every */
+
+/**
+ * The %TypedArray%.prototype object's 'some' routine
+ *
+ * See also:
+ *          ES2015, 22.2.3.9
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_some (ecma_value_t this_arg, /**< this argument */
+                                        ecma_value_t cb_func_val, /**< callback function */
+                                        ecma_value_t cb_this_arg) /**< this' of the callback function */
+{
+  return ecma_builtin_typedarray_prototype_exec_routine (this_arg,
+                                                         cb_func_val,
+                                                         cb_this_arg,
+                                                         TYPEDARRAY_ROUTINE_SOME);
+} /* ecma_builtin_typedarray_prototype_some */
+
+/**
+ * The %TypedArray%.prototype object's 'forEach' routine
+ *
+ * See also:
+ *          ES2015, 15.4.4.18
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_for_each (ecma_value_t this_arg, /**< this argument */
+                                            ecma_value_t cb_func_val, /**< callback function */
+                                            ecma_value_t cb_this_arg) /**< this' of the callback function */
+{
+  return ecma_builtin_typedarray_prototype_exec_routine (this_arg,
+                                                         cb_func_val,
+                                                         cb_this_arg,
+                                                         TYPEDARRAY_ROUTINE_FOREACH);
+} /* ecma_builtin_typedarray_prototype_for_each */
+
+/**
+ * The %TypedArray%.prototype object's 'map' routine
+ *
+ * See also:
+ *          ES2015, 22.2.3.8
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_map (ecma_value_t this_arg, /**< this argument */
+                                       ecma_value_t cb_func_val, /**< callback function */
+                                       ecma_value_t cb_this_arg) /**< this' of the callback function */
+{
+  if (!ecma_is_typedarray (this_arg))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray."));
+  }
+
+  if (!ecma_op_is_callable (cb_func_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);
+  uint32_t len = ecma_typedarray_get_length (obj_p);
+  ecma_object_t *func_object_p = ecma_get_object_from_value (cb_func_val);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ecma_value_t new_typedarray = ecma_op_create_typedarray_with_type_and_length (obj_p, len);
+
+  if (ECMA_IS_VALUE_ERROR (new_typedarray))
+  {
+    return new_typedarray;
+  }
+
+  ecma_object_t *new_obj_p = ecma_get_object_from_value (new_typedarray);
+
+  for (uint32_t index = 0; index < len && ecma_is_value_empty (ret_value); index++)
+  {
+    ecma_value_t current_index =  ecma_make_uint32_value (index);
+    ecma_value_t get_value = ecma_op_typedarray_get_index_prop (obj_p, index);
+    ecma_value_t call_args[] = { get_value, current_index, this_arg };
+
+    ECMA_TRY_CATCH (mapped_value, ecma_op_function_call (func_object_p, cb_this_arg, call_args, 3), ret_value);
+
+    bool set_status = ecma_op_typedarray_set_index_prop (new_obj_p, index, mapped_value);
+
+    if (!set_status)
+    {
+      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("error in typedarray set"));
+    }
+
+    ECMA_FINALIZE (mapped_value);
+
+    ecma_fast_free_value (current_index);
+    ecma_fast_free_value (get_value);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = new_typedarray;
+  }
+  else
+  {
+    ecma_free_value (new_typedarray);
+  }
+
+  return ret_value;
+} /* ecma_builtin_typedarray_prototype_map */
+
+/**
+ * Reduce and reduceRight routines share a similar structure.
+ * And we use 'is_right' to distinguish between them.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_reduce_with_direction (ecma_value_t this_arg, /**< this argument */
+                                                         ecma_value_t cb_func_val, /**< callback function */
+                                                         ecma_value_t initial_val, /**< initial value */
+                                                         bool is_right) /**< choose order, true is reduceRight */
+{
+  if (!ecma_is_typedarray (this_arg))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray."));
+  }
+
+  if (!ecma_op_is_callable (cb_func_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);
+  uint32_t len = ecma_typedarray_get_length (obj_p);
+
+  if (len == 0)
+  {
+    if (ecma_is_value_undefined (initial_val))
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG ("Initial value cannot be undefined."));
+    }
+
+    return ecma_copy_value (initial_val);
+  }
+
+  JERRY_ASSERT (len > 0);
+
+  ecma_value_t accumulator = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  uint32_t index = is_right ? (len - 1) : 0;
+
+  if (ecma_is_value_undefined (initial_val))
+  {
+    accumulator = ecma_op_typedarray_get_index_prop (obj_p, index);
+
+    JERRY_ASSERT (ecma_is_value_number (accumulator));
+
+    if (is_right)
+    {
+      if (index == 0)
+      {
+        return accumulator;
+      }
+
+      index--;
+    }
+    else
+    {
+      index++;
+
+      if (index == len)
+      {
+        return accumulator;
+      }
+    }
+  }
+  else
+  {
+    accumulator = ecma_copy_value (initial_val);
+  }
+
+  ecma_object_t *func_object_p = ecma_get_object_from_value (cb_func_val);
+
+  while (true)
+  {
+    ecma_value_t current_index =  ecma_make_uint32_value (index);
+    ecma_value_t get_value = ecma_op_typedarray_get_index_prop (obj_p, index);
+    ecma_value_t call_args[] = { accumulator, get_value, current_index, this_arg };
+
+    JERRY_ASSERT (ecma_is_value_number (get_value));
+
+    ecma_value_t call_value = ecma_op_function_call (func_object_p,
+                                                     ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                                     call_args,
+                                                     4);
+
+    ecma_fast_free_value (accumulator);
+    ecma_fast_free_value (get_value);
+    ecma_fast_free_value (current_index);
+
+    if (ECMA_IS_VALUE_ERROR (call_value))
+    {
+      return call_value;
+    }
+
+    accumulator = call_value;
+
+    if (is_right)
+    {
+      if (index == 0)
+      {
+        break;
+      }
+
+      index--;
+    }
+    else
+    {
+      index++;
+
+      if (index == len)
+      {
+        break;
+      }
+    }
+  }
+
+  return accumulator;
+} /* ecma_builtin_typedarray_prototype_reduce_with_direction */
+
+/**
+ * The %TypedArray%.prototype object's 'reduce' routine
+ *
+ * See also:
+ *          ES2015, 22.2.3.19
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_reduce (ecma_value_t this_arg, /**< this argument */
+                                          ecma_value_t cb_func_val, /**< callback function */
+                                          ecma_value_t initial_val) /**< initial value */
+{
+  return ecma_builtin_typedarray_prototype_reduce_with_direction (this_arg,
+                                                                  cb_func_val,
+                                                                  initial_val,
+                                                                  false);
+} /* ecma_builtin_typedarray_prototype_reduce */
+
+/**
+ * The %TypedArray%.prototype object's 'reduceRight' routine
+ *
+ * See also:
+ *          ES2015, 22.2.3.20
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_reduce_right (ecma_value_t this_arg, /**< this argument */
+                                                ecma_value_t cb_func_val, /**< callback function */
+                                                ecma_value_t initial_val) /**< initial value */
+{
+  return ecma_builtin_typedarray_prototype_reduce_with_direction (this_arg,
+                                                                  cb_func_val,
+                                                                  initial_val,
+                                                                  true);
+} /* ecma_builtin_typedarray_prototype_reduce_right */
+
+/**
+ * The %TypedArray%.prototype object's 'filter' routine
+ *
+ * See also:
+ *          ES2015, 22.2.3.9
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_prototype_filter (ecma_value_t this_arg, /**< this argument */
+                                          ecma_value_t cb_func_val, /**< callback function */
+                                          ecma_value_t cb_this_arg) /**< 'this' of the callback function */
+{
+  if (!ecma_is_typedarray (this_arg))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray."));
+  }
+
+  if (!ecma_op_is_callable (cb_func_val))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
+  }
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);
+  uint32_t len = ecma_typedarray_get_length (obj_p);
+  lit_utf8_byte_t *buffer_p = ecma_typedarray_get_buffer (obj_p);
+  uint8_t shift = ecma_typedarray_get_element_size_shift (obj_p);
+  uint8_t element_size = (uint8_t) (1 << shift);
+  ecma_object_t *func_object_p = ecma_get_object_from_value (cb_func_val);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  JMEM_DEFINE_LOCAL_ARRAY (pass_value_list_p, len * element_size, lit_utf8_byte_t);
+
+  lit_utf8_byte_t *pass_value_p = pass_value_list_p;
+
+  for (uint32_t index = 0; index < len && ecma_is_value_empty (ret_value); index++)
+  {
+    ecma_value_t current_index = ecma_make_uint32_value (index);
+    ecma_value_t get_value = ecma_op_typedarray_get_index_prop (obj_p, index);
+
+    JERRY_ASSERT (ecma_is_value_number (get_value));
+
+    ecma_value_t call_args[] = { get_value, current_index, this_arg };
+
+    ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, cb_this_arg, call_args, 3), ret_value);
+
+    if (ecma_op_to_boolean (call_value))
+    {
+      memcpy (pass_value_p, buffer_p, element_size);
+      pass_value_p += element_size;
+    }
+
+    buffer_p += element_size;
+
+    ECMA_FINALIZE (call_value);
+
+    ecma_fast_free_value (current_index);
+    ecma_fast_free_value (get_value);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    uint32_t pass_num = (uint32_t) ((pass_value_p - pass_value_list_p) >> shift);
+
+    ret_value = ecma_op_create_typedarray_with_type_and_length (obj_p, pass_num);
+
+
+    if (!ECMA_IS_VALUE_ERROR (ret_value))
+    {
+      obj_p = ecma_get_object_from_value (ret_value);
+
+      JERRY_ASSERT (ecma_typedarray_get_offset (obj_p) == 0);
+
+      memcpy (ecma_typedarray_get_buffer (obj_p),
+              pass_value_list_p,
+              (size_t) (pass_value_p - pass_value_list_p));
+    }
+  }
+
+  JMEM_FINALIZE_LOCAL_ARRAY (pass_value_list_p);
+
+  return ret_value;
+} /* ecma_builtin_typedarray_prototype_filter */
+
+/**
+ * The %TypedArray%.prototype object's 'reverse' routine
+ *
+ * See also:
+ *          ES2015, 22.2.3.21
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_builtin_typedarray_prototype_reverse (ecma_value_t this_arg) /**< this argument */
+{
+  if (!ecma_is_typedarray (this_arg))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray."));
+  }
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);
+  uint32_t len = ecma_typedarray_get_length (obj_p);
+  lit_utf8_byte_t *buffer_p = ecma_typedarray_get_buffer (obj_p);
+  uint8_t shift = ecma_typedarray_get_element_size_shift (obj_p);
+  uint8_t element_size = (uint8_t) (1 << shift);
+  uint32_t middle = (len / 2) << shift;
+  uint32_t buffer_last = (len << shift) - element_size;
+
+  for (uint32_t lower = 0; lower < middle; lower += element_size)
+  {
+    uint32_t upper = buffer_last - lower;
+    lit_utf8_byte_t *lower_p = buffer_p + lower;
+    lit_utf8_byte_t *upper_p = buffer_p + upper;
+
+    lit_utf8_byte_t tmp[8];
+    memcpy (&tmp[0], lower_p, element_size);
+    memcpy (lower_p, upper_p, element_size);
+    memcpy (upper_p, &tmp[0], element_size);
+  }
+
+  return ecma_copy_value (this_arg);
+} /* ecma_builtin_typedarray_prototype_reverse */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-prototype.inc.h
new file mode 100644 (file)
index 0000000..47a9794
--- /dev/null
@@ -0,0 +1,59 @@
+/* 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.
+ */
+
+/*
+ * %TypedArrayPrototype% description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.3.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_TYPEDARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* Readonly accessor properties */
+/* ES2015 22.2.3.1 */
+ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BUFFER,
+                    ecma_builtin_typedarray_prototype_buffer_getter,
+                    ECMA_PROPERTY_FIXED)
+/* ES2015 22.2.3.2 */
+ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BYTE_LENGTH_UL,
+                    ecma_builtin_typedarray_prototype_bytelength_getter,
+                    ECMA_PROPERTY_FIXED)
+/* ES2015 22.2.3.3 */
+ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BYTE_OFFSET_UL,
+                    ecma_builtin_typedarray_prototype_byteoffset_getter,
+                    ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.3.17 */
+ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_LENGTH,
+                    ecma_builtin_typedarray_prototype_length_getter,
+                    ECMA_PROPERTY_FIXED)
+
+ROUTINE (LIT_MAGIC_STRING_EVERY, ecma_builtin_typedarray_prototype_every, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_SOME, ecma_builtin_typedarray_prototype_some, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_FOR_EACH_UL, ecma_builtin_typedarray_prototype_for_each, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_MAP, ecma_builtin_typedarray_prototype_map, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_REDUCE, ecma_builtin_typedarray_prototype_reduce, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_REDUCE_RIGHT_UL, ecma_builtin_typedarray_prototype_reduce_right, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_FILTER, ecma_builtin_typedarray_prototype_filter, 2, 1)
+ROUTINE (LIT_MAGIC_STRING_REVERSE, ecma_builtin_typedarray_prototype_reverse, 0, 0)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray.c
new file mode 100644 (file)
index 0000000..e02f253
--- /dev/null
@@ -0,0 +1,246 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-typedarray-object.h"
+#include "ecma-try-catch-macro.h"
+#include "ecma-function-object.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-typedarray.inc.h"
+#define BUILTIN_UNDERSCORED_ID typedarray
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup typedarray ECMA %TypedArray% object built-in
+ * @{
+ */
+
+/**
+ * The %TypedArray%.from routine
+ *
+ * See also:
+ *         ES2015 22.2.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_from (ecma_value_t this_arg, /**< 'this' argument */
+                              const ecma_value_t *arguments_list_p, /**< arguments list */
+                              ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  if (!ecma_is_constructor (this_arg))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a constructor."));
+  }
+
+  ecma_value_t source;
+  ecma_value_t map_fn = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  ecma_value_t this_in_fn = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+  if (arguments_list_len == 0)
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("no source argument"));
+  }
+
+  source = arguments_list_p[0];
+
+  if (arguments_list_len > 1)
+  {
+    map_fn = arguments_list_p[1];
+
+    if (!ecma_op_is_callable (map_fn))
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG ("mapfn argument is not callable"));
+    }
+
+    if (arguments_list_len > 2)
+    {
+      this_in_fn = arguments_list_p[2];
+    }
+  }
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);
+
+  uint8_t builtin_id = ecma_get_object_builtin_id (obj_p);
+  ecma_object_t *proto_p;
+  uint8_t element_size_shift;
+  lit_magic_string_id_t class_id;
+
+  switch (builtin_id)
+  {
+    case ECMA_BUILTIN_ID_INT8ARRAY:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_INT8ARRAY_PROTOTYPE);
+      element_size_shift = 0;
+      class_id = LIT_MAGIC_STRING_INT8_ARRAY_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_UINT8ARRAY:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT8ARRAY_PROTOTYPE);
+      element_size_shift = 0;
+      class_id = LIT_MAGIC_STRING_UINT8_ARRAY_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE);
+      element_size_shift = 0;
+      class_id = LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_INT16ARRAY:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_INT16ARRAY_PROTOTYPE);
+      element_size_shift = 1;
+      class_id = LIT_MAGIC_STRING_INT16_ARRAY_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_UINT16ARRAY:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT16ARRAY_PROTOTYPE);
+      element_size_shift = 1;
+      class_id = LIT_MAGIC_STRING_UINT16_ARRAY_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_INT32ARRAY:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_INT32ARRAY_PROTOTYPE);
+      element_size_shift = 2;
+      class_id = LIT_MAGIC_STRING_INT32_ARRAY_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_UINT32ARRAY:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE);
+      element_size_shift = 2;
+      class_id = LIT_MAGIC_STRING_UINT32_ARRAY_UL;
+      break;
+    }
+    case ECMA_BUILTIN_ID_FLOAT32ARRAY:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE);
+      element_size_shift = 2;
+      class_id = LIT_MAGIC_STRING_FLOAT32_ARRAY_UL;
+      break;
+    }
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+    case ECMA_BUILTIN_ID_FLOAT64ARRAY:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE);
+      element_size_shift = 3;
+      class_id = LIT_MAGIC_STRING_FLOAT64_ARRAY_UL;
+      break;
+    }
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+    default:
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a typedarray constructor"));
+    }
+  }
+
+  ecma_deref_object (proto_p);
+
+  return ecma_op_typedarray_from (source,
+                                  map_fn,
+                                  this_in_fn,
+                                  proto_p,
+                                  element_size_shift,
+                                  class_id);
+
+} /* ecma_builtin_typedarray_from */
+
+/**
+ * The %TypedArray%.of routine
+ *
+ * See also:
+ *         ES2015 22.2.2.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+static ecma_value_t
+ecma_builtin_typedarray_of (ecma_value_t this_arg, /**< 'this' argument */
+                            const ecma_value_t *arguments_list_p, /**< arguments list */
+                            ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_UNUSED (this_arg);
+  JERRY_UNUSED (arguments_list_p);
+  JERRY_UNUSED (arguments_list_len);
+
+  /* TODO: implement 'of' */
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+} /* ecma_builtin_typedarray_of */
+
+/**
+ * Handle calling [[Call]] of built-in %TypedArray% object
+ *
+ * ES2015 22.2.1 If %TypedArray% is directly called or
+ * called as part of a new expression an exception is thrown
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_typedarray_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                       ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray intrinstic cannot be directly called"));
+} /* ecma_builtin_typedarray_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of built-in %TypedArray% object
+ *
+ * ES2015 22.2.1 If %TypedArray% is directly called or
+ * called as part of a new expression an exception is thrown
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_typedarray_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                            ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray intrinstic cannot be called by a 'new' expression"));
+} /* ecma_builtin_typedarray_dispatch_construct */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray.inc.h
new file mode 100644 (file)
index 0000000..39a8757
--- /dev/null
@@ -0,0 +1,50 @@
+/* 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.
+ */
+
+/*
+ * %TypedArray% description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.2 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.2 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_TYPED_ARRAY_UL,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.2.3 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+/* Routine properties:
+ *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
+
+/* ES2015 22.2.2.1 */
+ROUTINE (LIT_MAGIC_STRING_FROM, ecma_builtin_typedarray_from, NON_FIXED, 1)
+
+/* ES2015 22.2.2.2 */
+ROUTINE (LIT_MAGIC_STRING_OF, ecma_builtin_typedarray_of, NON_FIXED, 0)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array-prototype.c
new file mode 100644 (file)
index 0000000..8323d6d
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-uint16array-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID uint16array_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup uint16arrayprototype ECMA Uint16Array.prototype object built-in
+ * @{
+ */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array-prototype.inc.h
new file mode 100644 (file)
index 0000000..f77cbfd
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * Uint16Array prototype description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.3.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_UINT16ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ES2015 22.2.6.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              2,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array.c
new file mode 100644 (file)
index 0000000..5f29a4e
--- /dev/null
@@ -0,0 +1,86 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-typedarray-object.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-uint16array.inc.h"
+#define BUILTIN_UNDERSCORED_ID uint16array
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup uint16array ECMA Uint16Array object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of Uint16Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_uint16array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                        ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Uint16Array cannot be directly called"));
+} /* ecma_builtin_uint16array_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of Uint16Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_uint16array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                             ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT16ARRAY_PROTOTYPE);
+  ecma_value_t val = ecma_op_create_typedarray (arguments_list_p,
+                                                arguments_list_len,
+                                                prototype_obj_p,
+                                                1,
+                                                LIT_MAGIC_STRING_UINT16_ARRAY_UL);
+
+  ecma_deref_object (prototype_obj_p);
+
+  return val;
+} /* ecma_builtin_uint16array_dispatch_construct */
+
+/**
+  * @}
+  * @}
+  * @}
+  */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array.inc.h
new file mode 100644 (file)
index 0000000..d25cc9c
--- /dev/null
@@ -0,0 +1,51 @@
+/* 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.
+ */
+
+/*
+ * Uint16Array description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              2,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_UINT16_ARRAY_UL,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_UINT16ARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array-prototype.c
new file mode 100644 (file)
index 0000000..e000650
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-uint32array-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID uint32array_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup uint32arrayprototype ECMA Uint32Array.prototype object built-in
+ * @{
+ */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array-prototype.inc.h
new file mode 100644 (file)
index 0000000..9d730d2
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * Uint32Array prototype description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.3.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_UINT32ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ES2015 22.2.6.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              4,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array.c
new file mode 100644 (file)
index 0000000..f8f702d
--- /dev/null
@@ -0,0 +1,86 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-typedarray-object.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-uint32array.inc.h"
+#define BUILTIN_UNDERSCORED_ID uint32array
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup uint32array ECMA Uint32Array object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of Uint32Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_uint32array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                        ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Uint32Array cannot be directly called"));
+} /* ecma_builtin_uint32array_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of Uint32Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_uint32array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                             ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE);
+  ecma_value_t val = ecma_op_create_typedarray (arguments_list_p,
+                                                arguments_list_len,
+                                                prototype_obj_p,
+                                                2,
+                                                LIT_MAGIC_STRING_UINT32_ARRAY_UL);
+
+  ecma_deref_object (prototype_obj_p);
+
+  return val;
+} /* ecma_builtin_uint32array_dispatch_construct */
+
+/**
+  * @}
+  * @}
+  * @}
+  */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array.inc.h
new file mode 100644 (file)
index 0000000..ba1eab9
--- /dev/null
@@ -0,0 +1,51 @@
+/* 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.
+ */
+
+/*
+ * Uint32Array description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              4,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_UINT32_ARRAY_UL,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array-prototype.c
new file mode 100644 (file)
index 0000000..79c90b9
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-uint8array-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID uint8array_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup uint8arrayprototype ECMA Uint8Array.prototype object built-in
+ * @{
+ */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array-prototype.inc.h
new file mode 100644 (file)
index 0000000..d55b450
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * Uint8Array prototype description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.3.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_UINT8ARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ES2015 22.2.6.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array.c
new file mode 100644 (file)
index 0000000..71c89cd
--- /dev/null
@@ -0,0 +1,86 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-typedarray-object.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-uint8array.inc.h"
+#define BUILTIN_UNDERSCORED_ID uint8array
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup uint8array ECMA Uint8Array object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of Uint8Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_uint8array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                       ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Uint8Array cannot be directly called"));
+} /* ecma_builtin_uint8array_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of Uint8Array
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_uint8array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                            ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT8ARRAY_PROTOTYPE);
+  ecma_value_t val = ecma_op_create_typedarray (arguments_list_p,
+                                                arguments_list_len,
+                                                prototype_obj_p,
+                                                0,
+                                                LIT_MAGIC_STRING_UINT8_ARRAY_UL);
+
+  ecma_deref_object (prototype_obj_p);
+
+  return val;
+} /* ecma_builtin_uint8array_dispatch_construct */
+
+/**
+  * @}
+  * @}
+  * @}
+  */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array.inc.h
new file mode 100644 (file)
index 0000000..ed36f15
--- /dev/null
@@ -0,0 +1,51 @@
+/* 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.
+ */
+
+/*
+ * Uint8Array description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_UINT8_ARRAY_UL,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_UINT8ARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray-prototype.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray-prototype.c
new file mode 100644 (file)
index 0000000..4f1d106
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-uint8clampedarray-prototype.inc.h"
+#define BUILTIN_UNDERSCORED_ID uint8clampedarray_prototype
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup uint8clampedarrayprototype ECMA Uint8ClampedArray.prototype object built-in
+ * @{
+ */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray-prototype.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray-prototype.inc.h
new file mode 100644 (file)
index 0000000..014922b
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * Uint8ClampedArray prototype description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.3.4 */
+OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR,
+              ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY,
+              ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
+
+/* ES2015 22.2.6.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray.c b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray.c
new file mode 100644 (file)
index 0000000..e5f7a8b
--- /dev/null
@@ -0,0 +1,86 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-typedarray-object.h"
+#include "jrt.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+#define BUILTIN_INC_HEADER_NAME "ecma-builtin-uint8clampedarray.inc.h"
+#define BUILTIN_UNDERSCORED_ID uint8clampedarray
+#include "ecma-builtin-internal-routines-template.inc.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabuiltins
+ * @{
+ *
+ * \addtogroup uint8clampedarray ECMA Uint8ClampedArray object built-in
+ * @{
+ */
+
+/**
+ * Handle calling [[Call]] of Uint8ClampedArray
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_uint8clampedarray_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                              ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Uint8ClampedArray cannot be directly called"));
+} /* ecma_builtin_uint8clampedarray_dispatch_call */
+
+/**
+ * Handle calling [[Construct]] of Uint8ClampedArray
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_builtin_uint8clampedarray_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
+                                                   ecma_length_t arguments_list_len) /**< number of arguments */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE);
+  ecma_value_t val = ecma_op_create_typedarray (arguments_list_p,
+                                                arguments_list_len,
+                                                prototype_obj_p,
+                                                0,
+                                                LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL);
+
+  ecma_deref_object (prototype_obj_p);
+
+  return val;
+} /* ecma_builtin_uint8clampedarray_dispatch_construct */
+
+/**
+  * @}
+  * @}
+  * @}
+  */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray.inc.h b/deps/jerry/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray.inc.h
new file mode 100644 (file)
index 0000000..fe02d87
--- /dev/null
@@ -0,0 +1,51 @@
+/* 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.
+ */
+
+/*
+ * Uint8ClampedArray description
+ */
+
+#include "ecma-builtin-helpers-macro-defines.inc.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.1 */
+NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
+              1,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
+              3,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5 */
+STRING_VALUE (LIT_MAGIC_STRING_NAME,
+              LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL,
+              ECMA_PROPERTY_FIXED)
+
+/* ES2015 22.2.5.2 */
+OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
+              ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE,
+              ECMA_PROPERTY_FIXED)
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+#include "ecma-builtin-helpers-macro-undefs.inc.h"
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-array-object.c b/deps/jerry/jerry-core/ecma/operations/ecma-array-object.c
new file mode 100644 (file)
index 0000000..768b415
--- /dev/null
@@ -0,0 +1,364 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-array-object.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-number-arithmetic.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaarrayobject ECMA Array object related routines
+ * @{
+ */
+
+/**
+ * Array object creation operation.
+ *
+ * See also: ECMA-262 v5, 15.4.2.1
+ *           ECMA-262 v5, 15.4.2.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of arguments that
+                                                                        are passed to Array constructor */
+                             ecma_length_t arguments_list_len, /**< length of the arguments' list */
+                             bool is_treat_single_arg_as_length) /**< if the value is true,
+                                                                      arguments_list_len is 1
+                                                                      and single argument is Number,
+                                                                      then treat the single argument
+                                                                      as new Array's length rather
+                                                                      than as single item of the Array */
+{
+  JERRY_ASSERT (arguments_list_len == 0
+                || arguments_list_p != NULL);
+
+  uint32_t length;
+  const ecma_value_t *array_items_p;
+  ecma_length_t array_items_count;
+
+  if (is_treat_single_arg_as_length
+      && arguments_list_len == 1
+      && ecma_is_value_number (arguments_list_p[0]))
+  {
+    ecma_number_t num = ecma_get_number_from_value (arguments_list_p[0]);
+    uint32_t num_uint32 = ecma_number_to_uint32 (num);
+
+    if (num != ((ecma_number_t) num_uint32))
+    {
+      return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid array length."));
+    }
+    else
+    {
+      length = num_uint32;
+      array_items_p = NULL;
+      array_items_count = 0;
+    }
+  }
+  else
+  {
+    length = arguments_list_len;
+    array_items_p = arguments_list_p;
+    array_items_count = arguments_list_len;
+  }
+
+#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
+  ecma_object_t *array_prototype_object_p = ecma_builtin_get (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE);
+#else /* CONFIG_DISABLE_ARRAY_BUILTIN */
+  ecma_object_t *array_prototype_object_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
+#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
+
+  ecma_object_t *object_p = ecma_create_object (array_prototype_object_p,
+                                                sizeof (ecma_extended_object_t),
+                                                ECMA_OBJECT_TYPE_ARRAY);
+
+  ecma_deref_object (array_prototype_object_p);
+
+  /*
+   * [[Class]] property is not stored explicitly for objects of ECMA_OBJECT_TYPE_ARRAY type.
+   *
+   * See also: ecma_object_get_class_name
+   */
+
+  ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) object_p;
+  ext_obj_p->u.array.length = length;
+  ext_obj_p->u.array.length_prop = ECMA_PROPERTY_FLAG_WRITABLE | ECMA_PROPERTY_TYPE_VIRTUAL;
+
+  for (uint32_t index = 0;
+       index < array_items_count;
+       index++)
+  {
+    if (ecma_is_value_array_hole (array_items_p[index]))
+    {
+      continue;
+    }
+
+    ecma_string_t *item_name_string_p = ecma_new_ecma_string_from_uint32 (index);
+
+    ecma_builtin_helper_def_prop (object_p,
+                                  item_name_string_p,
+                                  array_items_p[index],
+                                  true, /* Writable */
+                                  true, /* Enumerable */
+                                  true, /* Configurable */
+                                  false); /* Failure handling */
+
+    ecma_deref_ecma_string (item_name_string_p);
+  }
+
+  return ecma_make_object_value (object_p);
+} /* ecma_op_create_array_object */
+
+/**
+ * Update the length of an array to a new length
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_array_object_set_length (ecma_object_t *object_p, /**< the array object */
+                                 ecma_value_t new_value, /**< new length value */
+                                 uint32_t flags) /**< configuration options */
+{
+  bool is_throw = (flags & ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_IS_THROW);
+
+  ecma_value_t completion = ecma_op_to_number (new_value);
+
+  if (ECMA_IS_VALUE_ERROR (completion))
+  {
+    return completion;
+  }
+
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (completion)
+                && ecma_is_value_number (completion));
+
+  ecma_number_t new_len_num = ecma_get_number_from_value (completion);
+
+  ecma_free_value (completion);
+
+  if (ecma_is_value_object (new_value))
+  {
+    ecma_value_t compared_num_val = ecma_op_to_number (new_value);
+
+    if (ECMA_IS_VALUE_ERROR (completion))
+    {
+      return compared_num_val;
+    }
+
+    new_len_num = ecma_get_number_from_value (compared_num_val);
+    ecma_free_value (compared_num_val);
+  }
+
+  uint32_t new_len_uint32 = ecma_number_to_uint32 (new_len_num);
+
+  if (((ecma_number_t) new_len_uint32) != new_len_num)
+  {
+    return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid array length."));
+  }
+
+  if (flags & ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_REJECT)
+  {
+    return ecma_reject (is_throw);
+  }
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+  uint32_t old_len_uint32 = ext_object_p->u.array.length;
+
+  if (new_len_num == old_len_uint32)
+  {
+    /* Only the writable flag must be updated. */
+    if (flags & ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_WRITABLE_DEFINED)
+    {
+      if (!(flags & ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_WRITABLE))
+      {
+        uint8_t new_prop_value = (uint8_t) (ext_object_p->u.array.length_prop & ~ECMA_PROPERTY_FLAG_WRITABLE);
+        ext_object_p->u.array.length_prop = new_prop_value;
+      }
+      else if (!ecma_is_property_writable (ext_object_p->u.array.length_prop))
+      {
+        return ecma_reject (is_throw);
+      }
+    }
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+  else if (!ecma_is_property_writable (ext_object_p->u.array.length_prop))
+  {
+    return ecma_reject (is_throw);
+  }
+
+  uint32_t current_len_uint32 = new_len_uint32;
+
+  if (new_len_uint32 < old_len_uint32)
+  {
+    current_len_uint32 = ecma_delete_array_properties (object_p, new_len_uint32, old_len_uint32);
+  }
+
+  ext_object_p->u.array.length = current_len_uint32;
+
+  if ((flags & ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_WRITABLE_DEFINED)
+      && !(flags & ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_WRITABLE))
+  {
+    uint8_t new_prop_value = (uint8_t) (ext_object_p->u.array.length_prop & ~ECMA_PROPERTY_FLAG_WRITABLE);
+    ext_object_p->u.array.length_prop = new_prop_value;
+  }
+
+  if (current_len_uint32 == new_len_uint32)
+  {
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+  return ecma_reject (is_throw);
+} /* ecma_op_array_object_set_length */
+
+/**
+ * [[DefineOwnProperty]] ecma array object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *          ECMA-262 v5, 15.4.5.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_array_object_define_own_property (ecma_object_t *object_p, /**< the array object */
+                                          ecma_string_t *property_name_p, /**< property name */
+                                          const ecma_property_descriptor_t *property_desc_p, /**< property descriptor */
+                                          bool is_throw) /**< flag that controls failure handling */
+{
+  if (ecma_string_is_length (property_name_p))
+  {
+    JERRY_ASSERT (property_desc_p->is_configurable_defined || !property_desc_p->is_configurable);
+    JERRY_ASSERT (property_desc_p->is_enumerable_defined || !property_desc_p->is_enumerable);
+    JERRY_ASSERT (property_desc_p->is_writable_defined || !property_desc_p->is_writable);
+
+    uint32_t flags = 0;
+
+    if (is_throw)
+    {
+      flags |= ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_IS_THROW;
+    }
+
+    /* Only the writable and data properties can be modified. */
+    if (property_desc_p->is_configurable
+        || property_desc_p->is_enumerable
+        || property_desc_p->is_get_defined
+        || property_desc_p->is_set_defined)
+    {
+      flags |= ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_REJECT;
+    }
+
+    if (property_desc_p->is_writable_defined)
+    {
+      flags |= ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_WRITABLE_DEFINED;
+    }
+
+    if (property_desc_p->is_writable)
+    {
+      flags |= ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_WRITABLE;
+    }
+
+    if (property_desc_p->is_value_defined)
+    {
+      return ecma_op_array_object_set_length (object_p, property_desc_p->value, flags);
+    }
+
+    ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+    ecma_value_t length_value = ecma_make_uint32_value (ext_object_p->u.array.length);
+
+    ecma_value_t result = ecma_op_array_object_set_length (object_p, length_value, flags);
+
+    ecma_fast_free_value (length_value);
+    return result;
+  }
+
+  uint32_t index = ecma_string_get_array_index (property_name_p);
+
+  if (index == ECMA_STRING_NOT_ARRAY_INDEX)
+  {
+    return ecma_op_general_object_define_own_property (object_p, property_name_p, property_desc_p, is_throw);
+  }
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+  bool update_length = (index >= ext_object_p->u.array.length);
+
+  if (update_length && !ecma_is_property_writable (ext_object_p->u.array.length_prop))
+  {
+    return ecma_reject (is_throw);
+  }
+
+  ecma_value_t completition = ecma_op_general_object_define_own_property (object_p,
+                                                                          property_name_p,
+                                                                          property_desc_p,
+                                                                          false);
+  JERRY_ASSERT (ecma_is_value_boolean (completition));
+
+  if (ecma_is_value_false (completition))
+  {
+    return ecma_reject (is_throw);
+  }
+
+  if (update_length)
+  {
+    ext_object_p->u.array.length = index + 1;
+  }
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+} /* ecma_op_array_object_define_own_property */
+
+/**
+ * List names of a String object's lazy instantiated properties
+ *
+ * @return string values collection
+ */
+void
+ecma_op_array_list_lazy_property_names (ecma_object_t *obj_p, /**< a String object */
+                                        bool separate_enumerable, /**< true -  list enumerable properties
+                                                                   *           into main collection,
+                                                                   *           and non-enumerable to collection of
+                                                                   *           'skipped non-enumerable' properties,
+                                                                   *   false - list all properties into main
+                                                                   *           collection.
+                                                                   */
+                                        ecma_collection_header_t *main_collection_p, /**< 'main'
+                                                                                      *   collection */
+                                        ecma_collection_header_t *non_enum_collection_p) /**< skipped
+                                                                                          *   'non-enumerable'
+                                                                                          *   collection */
+{
+  JERRY_ASSERT (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_ARRAY);
+
+  ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? non_enum_collection_p : main_collection_p;
+
+  ecma_string_t *length_str_p = ecma_new_ecma_length_string ();
+  ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (length_str_p), true);
+  ecma_deref_ecma_string (length_str_p);
+} /* ecma_op_array_list_lazy_property_names */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-array-object.h b/deps/jerry/jerry-core/ecma/operations/ecma-array-object.h
new file mode 100644 (file)
index 0000000..f32c6cf
--- /dev/null
@@ -0,0 +1,63 @@
+/* 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.
+ */
+
+#ifndef ECMA_ARRAY_OBJECT_H
+#define ECMA_ARRAY_OBJECT_H
+
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaarrayobject ECMA Array object related routines
+ * @{
+ */
+
+/**
+ * Flags for ecma_op_array_object_set_length
+ */
+typedef enum
+{
+  ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_IS_THROW = 1u << 0, /**< is_throw flag is set */
+  ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_REJECT = 1u << 1, /**< reject later because the descriptor flags
+                                                       *   contains an unallowed combination */
+  ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_WRITABLE_DEFINED = 1u << 2, /**< writable flag defined
+                                                                 *   in the property descriptor */
+  ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_WRITABLE = 1u << 3, /**< writable flag enabled
+                                                         *   in the property descriptor */
+} ecma_array_object_set_length_flags_t;
+
+ecma_value_t
+ecma_op_create_array_object (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len,
+                             bool is_treat_single_arg_as_length);
+
+ecma_value_t
+ecma_op_array_object_set_length (ecma_object_t *object_p, ecma_value_t new_value, uint32_t flags);
+
+ecma_value_t
+ecma_op_array_object_define_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p,
+                                          const ecma_property_descriptor_t *property_desc_p, bool is_throw);
+
+void
+ecma_op_array_list_lazy_property_names (ecma_object_t *obj_p, bool separate_enumerable,
+                                        ecma_collection_header_t *main_collection_p,
+                                        ecma_collection_header_t *non_enum_collection_p);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_ARRAY_OBJECT_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-arraybuffer-object.c b/deps/jerry/jerry-core/ecma/operations/ecma-arraybuffer-object.c
new file mode 100644 (file)
index 0000000..cf44a59
--- /dev/null
@@ -0,0 +1,163 @@
+/* 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.
+ */
+
+#include "ecma-arraybuffer-object.h"
+#include "ecma-try-catch-macro.h"
+#include "ecma-objects.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "jmem.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaarraybufferobject ECMA ArrayBuffer object related routines
+ * @{
+ */
+
+/**
+ * Helper function: create arraybuffer object based on the array length
+ *
+ * The struct of arraybuffer object:
+ *   ecma_object_t
+ *   extend_part
+ *   data buffer
+ *
+ * @return ecma_object_t *
+ */
+ecma_object_t *
+ecma_arraybuffer_new_object (ecma_length_t length) /**< length of the arraybuffer */
+{
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE);
+  ecma_object_t *object_p = ecma_create_object (prototype_obj_p,
+                                                sizeof (ecma_extended_object_t) + length,
+                                                ECMA_OBJECT_TYPE_CLASS);
+  ecma_deref_object (prototype_obj_p);
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_ARRAY_BUFFER_UL;
+  ext_object_p->u.class_prop.u.length = length;
+
+  lit_utf8_byte_t *buf = (lit_utf8_byte_t *) (ext_object_p + 1);
+  memset (buf, 0, length);
+
+  return object_p;
+} /* ecma_arraybuffer_new_object */
+
+/**
+ * ArrayBuffer object creation operation.
+ *
+ * See also: ES2015 24.1.1.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_create_arraybuffer_object (const ecma_value_t *arguments_list_p, /**< list of arguments that
+                                                                          *   are passed to String constructor */
+                                   ecma_length_t arguments_list_len) /**< length of the arguments' list */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  uint32_t length = 0;
+
+  if (arguments_list_len > 0)
+  {
+    ecma_number_t num;
+
+    if (ecma_is_value_number (arguments_list_p[0]))
+    {
+      num = ecma_get_number_from_value (arguments_list_p[0]);
+    }
+    else
+    {
+      ecma_value_t to_number_value = ecma_op_to_number (arguments_list_p[0]);
+
+      if (ECMA_IS_VALUE_ERROR (to_number_value))
+      {
+        return to_number_value;
+      }
+
+      num = ecma_get_number_from_value (to_number_value);
+
+      ecma_free_value (to_number_value);
+    }
+
+    length = ecma_number_to_uint32 (num);
+
+    if (num != ((ecma_number_t) length)
+        || length > (UINT32_MAX - sizeof (ecma_extended_object_t) - JMEM_ALIGNMENT + 1))
+    {
+      return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid ArrayBuffer length."));
+    }
+  }
+
+  return ecma_make_object_value (ecma_arraybuffer_new_object (length));
+} /* ecma_op_create_arraybuffer_object */
+
+/**
+ * Helper function: check if the target is ArrayBuffer
+ *
+ *
+ * See also: ES2015 24.1.1.4
+ *
+ * @return true - if value is an ArrayBuffer object
+ *         false - otherwise
+ */
+bool
+ecma_is_arraybuffer (ecma_value_t target) /**< the target value */
+{
+  return (ecma_is_value_object (target)
+          && ecma_object_class_is (ecma_get_object_from_value (target),
+                                   LIT_MAGIC_STRING_ARRAY_BUFFER_UL));
+} /* ecma_is_arraybuffer */
+
+/**
+ * Helper function: return the length of the buffer inside the arraybuffer object
+ *
+ * @return ecma_length_t, the length of the arraybuffer
+ */
+ecma_length_t __attr_pure___
+ecma_arraybuffer_get_length (ecma_object_t *object_p) /**< pointer to the ArrayBuffer object */
+{
+  JERRY_ASSERT (ecma_object_class_is (object_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL));
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  return ext_object_p->u.class_prop.u.length;
+} /* ecma_arraybuffer_get_length */
+
+/**
+ * Helper function: return the pointer to the data buffer inside the arraybuffer object
+ *
+ * @return pointer to the data buffer
+ */
+inline lit_utf8_byte_t * __attr_pure___ __attr_always_inline___
+ecma_arraybuffer_get_buffer (ecma_object_t *object_p) /**< pointer to the ArrayBuffer object */
+{
+  JERRY_ASSERT (ecma_object_class_is (object_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL));
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  return (lit_utf8_byte_t *) (ext_object_p + 1);
+} /* ecma_arraybuffer_get_buffer */
+
+/**
+ * @}
+ * @}
+ */
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-arraybuffer-object.h b/deps/jerry/jerry-core/ecma/operations/ecma-arraybuffer-object.h
new file mode 100644 (file)
index 0000000..f363f4c
--- /dev/null
@@ -0,0 +1,50 @@
+/* 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.
+ */
+
+#ifndef ECMA_ARRAYBUFFER_OBJECT_H
+#define ECMA_ARRAYBUFFER_OBJECT_H
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaarraybufferobject ECMA ArrayBuffer object related routines
+ * @{
+ */
+
+ecma_value_t
+ecma_op_create_arraybuffer_object (const ecma_value_t *, ecma_length_t);
+
+/**
+ * Helper functions for arraybuffer.
+ */
+ecma_object_t *
+ecma_arraybuffer_new_object (ecma_length_t lengh);
+lit_utf8_byte_t *
+ecma_arraybuffer_get_buffer (ecma_object_t *obj_p) __attr_pure___;
+ecma_length_t
+ecma_arraybuffer_get_length (ecma_object_t *obj_p) __attr_pure___;
+bool
+ecma_is_arraybuffer (ecma_value_t val);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+#endif /* !ECMA_ARRAYBUFFER_OBJECT_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-boolean-object.c b/deps/jerry/jerry-core/ecma/operations/ecma-boolean-object.c
new file mode 100644 (file)
index 0000000..fdadfbc
--- /dev/null
@@ -0,0 +1,68 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-boolean-object.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabooleanobject ECMA Boolean object related routines
+ * @{
+ */
+
+/**
+ * Boolean object creation operation.
+ *
+ * See also: ECMA-262 v5, 15.6.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boolean constructor */
+{
+  bool boolean_value = ecma_op_to_boolean (arg);
+
+#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE);
+#else /* CONFIG_DISABLE_BOOLEAN_BUILTIN */
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
+#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
+
+  ecma_object_t *object_p = ecma_create_object (prototype_obj_p,
+                                                sizeof (ecma_extended_object_t),
+                                                ECMA_OBJECT_TYPE_CLASS);
+
+  ecma_deref_object (prototype_obj_p);
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_BOOLEAN_UL;
+  ext_object_p->u.class_prop.u.value = ecma_make_boolean_value (boolean_value);
+
+  return ecma_make_object_value (object_p);
+} /* ecma_op_create_boolean_object */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-boolean-object.h b/deps/jerry/jerry-core/ecma/operations/ecma-boolean-object.h
new file mode 100644 (file)
index 0000000..adf0353
--- /dev/null
@@ -0,0 +1,35 @@
+/* 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.
+ */
+
+#ifndef ECMA_BOOLEAN_OBJECT_H
+#define ECMA_BOOLEAN_OBJECT_H
+
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmabooleanobject ECMA Boolean object related routines
+ * @{
+ */
+
+ecma_value_t ecma_op_create_boolean_object (ecma_value_t arg);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_BOOLEAN_OBJECT_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-comparison.c b/deps/jerry/jerry-core/ecma/operations/ecma-comparison.c
new file mode 100644 (file)
index 0000000..df92fc3
--- /dev/null
@@ -0,0 +1,405 @@
+/* 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.
+ */
+
+#include "ecma-comparison.h"
+#include "ecma-conversion.h"
+#include "ecma-globals.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmacomparison ECMA comparison
+ * @{
+ */
+
+/**
+ * ECMA abstract equality comparison routine.
+ *
+ * See also: ECMA-262 v5, 11.9.3
+ *
+ * @return true - if values are equal,
+ *         false - otherwise
+ */
+ecma_value_t
+ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
+                                   ecma_value_t y) /**< second operand */
+{
+  if (x == y)
+  {
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+
+  if (ecma_are_values_integer_numbers (x, y))
+  {
+    /* Note: the (x == y) comparison captures the true case. */
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+  }
+
+  if (ecma_is_value_number (x))
+  {
+    if (ecma_is_value_number (y))
+    {
+      /* 1.c */
+      ecma_number_t x_num = ecma_get_number_from_value (x);
+      ecma_number_t y_num = ecma_get_number_from_value (y);
+
+      bool is_x_equal_to_y = (x_num == y_num);
+
+#ifndef JERRY_NDEBUG
+      bool is_x_equal_to_y_check;
+
+      if (ecma_number_is_nan (x_num)
+          || ecma_number_is_nan (y_num))
+      {
+        is_x_equal_to_y_check = false;
+      }
+      else if (x_num == y_num
+               || (ecma_number_is_zero (x_num)
+                   && ecma_number_is_zero (y_num)))
+      {
+        is_x_equal_to_y_check = true;
+      }
+      else
+      {
+        is_x_equal_to_y_check = false;
+      }
+
+      JERRY_ASSERT (is_x_equal_to_y == is_x_equal_to_y_check);
+#endif /* !JERRY_NDEBUG */
+
+      return ecma_make_boolean_value (is_x_equal_to_y);
+    }
+
+    /* Swap values. */
+    ecma_value_t tmp = x;
+    x = y;
+    y = tmp;
+  }
+
+  if (ecma_is_value_string (x))
+  {
+    if (ecma_is_value_string (y))
+    {
+      /* 1., d. */
+      ecma_string_t *x_str_p = ecma_get_string_from_value (x);
+      ecma_string_t *y_str_p = ecma_get_string_from_value (y);
+
+      bool is_equal = ecma_compare_ecma_strings (x_str_p, y_str_p);
+
+      return ecma_make_boolean_value (is_equal);
+    }
+
+    if (ecma_is_value_number (y))
+    {
+      /* 4. */
+      ecma_value_t x_num_value = ecma_op_to_number (x);
+
+      if (ECMA_IS_VALUE_ERROR (x_num_value))
+      {
+        return x_num_value;
+      }
+
+      ecma_value_t compare_result = ecma_op_abstract_equality_compare (x_num_value, y);
+
+      ecma_free_value (x_num_value);
+      return compare_result;
+    }
+
+    /* Swap values. */
+    ecma_value_t tmp = x;
+    x = y;
+    y = tmp;
+  }
+
+  if (ecma_is_value_boolean (y))
+  {
+    if (ecma_is_value_boolean (x))
+    {
+      /* 1., e. */
+      /* Note: the (x == y) comparison captures the true case. */
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+    }
+
+    /* 7. */
+    return ecma_op_abstract_equality_compare (x, ecma_make_integer_value (ecma_is_value_true (y) ? 1 : 0));
+  }
+
+  if (ecma_is_value_object (x))
+  {
+    if (ecma_is_value_string (y)
+        || ecma_is_value_number (y))
+    {
+      /* 9. */
+      ecma_value_t x_prim_value = ecma_op_to_primitive (x, ECMA_PREFERRED_TYPE_NO);
+
+      if (ECMA_IS_VALUE_ERROR (x_prim_value))
+      {
+        return x_prim_value;
+      }
+
+      ecma_value_t compare_result = ecma_op_abstract_equality_compare (x_prim_value, y);
+
+      ecma_free_value (x_prim_value);
+      return compare_result;
+    }
+
+    /* 1., f. */
+    /* Note: the (x == y) comparison captures the true case. */
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+  }
+
+  if (ecma_is_value_boolean (x))
+  {
+    /* 6. */
+    return ecma_op_abstract_equality_compare (ecma_make_integer_value (ecma_is_value_true (x) ? 1 : 0), y);
+  }
+
+  if (ecma_is_value_undefined (x)
+      || ecma_is_value_null (x))
+  {
+    /* 1. a., b. */
+    /* 2., 3. */
+    bool is_equal = ecma_is_value_undefined (y) || ecma_is_value_null (y);
+
+    return ecma_make_boolean_value (is_equal);
+  }
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+} /* ecma_op_abstract_equality_compare */
+
+/**
+ * ECMA strict equality comparison routine.
+ *
+ * See also: ECMA-262 v5, 11.9.6
+ *
+ * @return true - if values are strict equal,
+ *         false - otherwise
+ */
+bool
+ecma_op_strict_equality_compare (ecma_value_t x, /**< first operand */
+                                 ecma_value_t y) /**< second operand */
+{
+  if (ecma_is_value_direct (x)
+      || ecma_is_value_direct (y)
+      || ecma_is_value_object (x)
+      || ecma_is_value_object (y))
+  {
+    JERRY_ASSERT (!ecma_is_value_direct (x)
+                  || ecma_is_value_undefined (x)
+                  || ecma_is_value_null (x)
+                  || ecma_is_value_boolean (x)
+                  || ecma_is_value_integer_number (x));
+
+    JERRY_ASSERT (!ecma_is_value_direct (y)
+                  || ecma_is_value_undefined (y)
+                  || ecma_is_value_null (y)
+                  || ecma_is_value_boolean (y)
+                  || ecma_is_value_integer_number (y));
+
+    if ((x != ecma_make_integer_value (0) || !ecma_is_value_float_number (y))
+        && (y != ecma_make_integer_value (0) || !ecma_is_value_float_number (x)))
+    {
+      return (x == y);
+    }
+
+    /* The +0 === -0 case handled below. */
+  }
+
+  JERRY_ASSERT (ecma_is_value_number (x) || ecma_is_value_string (x));
+  JERRY_ASSERT (ecma_is_value_number (y) || ecma_is_value_string (y));
+
+  if (ecma_is_value_string (x))
+  {
+    if (!ecma_is_value_string (y))
+    {
+      return false;
+    }
+
+    ecma_string_t *x_str_p = ecma_get_string_from_value (x);
+    ecma_string_t *y_str_p = ecma_get_string_from_value (y);
+
+    return ecma_compare_ecma_strings (x_str_p, y_str_p);
+  }
+
+  if (!ecma_is_value_number (y))
+  {
+    return false;
+  }
+
+  ecma_number_t x_num = ecma_get_number_from_value (x);
+  ecma_number_t y_num = ecma_get_number_from_value (y);
+
+  bool is_x_equal_to_y = (x_num == y_num);
+
+#ifndef JERRY_NDEBUG
+  bool is_x_equal_to_y_check;
+
+  if (ecma_number_is_nan (x_num)
+      || ecma_number_is_nan (y_num))
+  {
+    is_x_equal_to_y_check = false;
+  }
+  else if (x_num == y_num
+           || (ecma_number_is_zero (x_num)
+               && ecma_number_is_zero (y_num)))
+  {
+    is_x_equal_to_y_check = true;
+  }
+  else
+  {
+    is_x_equal_to_y_check = false;
+  }
+
+  JERRY_ASSERT (is_x_equal_to_y == is_x_equal_to_y_check);
+#endif /* !JERRY_NDEBUG */
+
+  return is_x_equal_to_y;
+} /* ecma_op_strict_equality_compare */
+
+/**
+ * ECMA abstract relational comparison routine.
+ *
+ * See also: ECMA-262 v5, 11.8.5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */
+                                     ecma_value_t y, /**< second operand */
+                                     bool left_first) /**< 'LeftFirst' flag */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1., 2. */
+  ECMA_TRY_CATCH (prim_first_converted_value,
+                  ecma_op_to_primitive (x, ECMA_PREFERRED_TYPE_NUMBER),
+                  ret_value);
+  ECMA_TRY_CATCH (prim_second_converted_value,
+                  ecma_op_to_primitive (y, ECMA_PREFERRED_TYPE_NUMBER),
+                  ret_value);
+
+  const ecma_value_t px = left_first ? prim_first_converted_value : prim_second_converted_value;
+  const ecma_value_t py = left_first ? prim_second_converted_value : prim_first_converted_value;
+
+  const bool is_px_string = ecma_is_value_string (px);
+  const bool is_py_string = ecma_is_value_string (py);
+
+  if (!(is_px_string && is_py_string))
+  {
+    /* 3. */
+
+    /* a. */
+    ECMA_OP_TO_NUMBER_TRY_CATCH (nx, px, ret_value);
+    ECMA_OP_TO_NUMBER_TRY_CATCH (ny, py, ret_value);
+
+    /* b. */
+    if (ecma_number_is_nan (nx)
+        || ecma_number_is_nan (ny))
+    {
+      /* c., d. */
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+    else
+    {
+      bool is_x_less_than_y = (nx < ny);
+
+#ifndef JERRY_NDEBUG
+      bool is_x_less_than_y_check;
+
+      if (nx == ny
+          || (ecma_number_is_zero (nx)
+              && ecma_number_is_zero (ny)))
+      {
+        /* e., f., g. */
+        is_x_less_than_y_check = false;
+      }
+      else if (ecma_number_is_infinity (nx)
+               && !ecma_number_is_negative (nx))
+      {
+        /* h. */
+        is_x_less_than_y_check = false;
+      }
+      else if (ecma_number_is_infinity (ny)
+               && !ecma_number_is_negative (ny))
+      {
+        /* i. */
+        is_x_less_than_y_check = true;
+      }
+      else if (ecma_number_is_infinity (ny)
+               && ecma_number_is_negative (ny))
+      {
+        /* j. */
+        is_x_less_than_y_check = false;
+      }
+      else if (ecma_number_is_infinity (nx)
+               && ecma_number_is_negative (nx))
+      {
+        /* k. */
+        is_x_less_than_y_check = true;
+      }
+      else
+      {
+        /* l. */
+        JERRY_ASSERT (!ecma_number_is_nan (nx)
+                      && !ecma_number_is_infinity (nx));
+        JERRY_ASSERT (!ecma_number_is_nan (ny)
+                      && !ecma_number_is_infinity (ny));
+        JERRY_ASSERT (!(ecma_number_is_zero (nx)
+                        && ecma_number_is_zero (ny)));
+
+        if (nx < ny)
+        {
+          is_x_less_than_y_check = true;
+        }
+        else
+        {
+          is_x_less_than_y_check = false;
+        }
+      }
+
+      JERRY_ASSERT (is_x_less_than_y_check == is_x_less_than_y);
+#endif /* !JERRY_NDEBUG */
+
+      ret_value = ecma_make_boolean_value (is_x_less_than_y);
+    }
+
+    ECMA_OP_TO_NUMBER_FINALIZE (ny);
+    ECMA_OP_TO_NUMBER_FINALIZE (nx);
+  }
+  else
+  { /* 4. */
+    JERRY_ASSERT (is_px_string && is_py_string);
+
+    ecma_string_t *str_x_p = ecma_get_string_from_value (px);
+    ecma_string_t *str_y_p = ecma_get_string_from_value (py);
+
+    bool is_px_less = ecma_compare_ecma_strings_relational (str_x_p, str_y_p);
+
+    ret_value = ecma_make_boolean_value (is_px_less);
+  }
+
+  ECMA_FINALIZE (prim_second_converted_value);
+  ECMA_FINALIZE (prim_first_converted_value);
+
+  return ret_value;
+} /* ecma_op_abstract_relational_compare */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-comparison.h b/deps/jerry/jerry-core/ecma/operations/ecma-comparison.h
new file mode 100644 (file)
index 0000000..d8e0084
--- /dev/null
@@ -0,0 +1,38 @@
+/* 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.
+ */
+
+#ifndef ECMA_COMPARISON_H
+#define ECMA_COMPARISON_H
+
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmacomparison ECMA comparison
+ * @{
+ */
+
+ecma_value_t ecma_op_abstract_equality_compare (ecma_value_t x, ecma_value_t y);
+bool ecma_op_strict_equality_compare (ecma_value_t x, ecma_value_t y);
+ecma_value_t ecma_op_abstract_relational_compare (ecma_value_t x, ecma_value_t y, bool left_first);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_COMPARISON_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-conversion.c b/deps/jerry/jerry-core/ecma/operations/ecma-conversion.c
new file mode 100644 (file)
index 0000000..f2951ad
--- /dev/null
@@ -0,0 +1,784 @@
+/* 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.
+ */
+
+/**
+ * Implementation of ECMA-defined conversion routines
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-boolean-object.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-number-object.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+#include "ecma-string-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt-libc-includes.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaconversion ECMA conversion routines
+ * @{
+ */
+
+/**
+ * CheckObjectCoercible operation.
+ *
+ * See also:
+ *          ECMA-262 v5, 9.10
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_check_object_coercible (ecma_value_t value) /**< ecma value */
+{
+  ecma_check_value_type_is_spec_defined (value);
+
+  if (ecma_is_value_undefined (value)
+      || ecma_is_value_null (value))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Argument cannot be converted to an object."));
+  }
+  else
+  {
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  }
+} /* ecma_op_check_object_coercible */
+
+/**
+ * SameValue operation.
+ *
+ * See also:
+ *          ECMA-262 v5, 9.12
+ *
+ * @return true - if the value are same according to ECMA-defined SameValue algorithm,
+ *         false - otherwise
+ */
+bool
+ecma_op_same_value (ecma_value_t x, /**< ecma value */
+                    ecma_value_t y) /**< ecma value */
+{
+  const bool is_x_undefined = ecma_is_value_undefined (x);
+  const bool is_x_null = ecma_is_value_null (x);
+  const bool is_x_boolean = ecma_is_value_boolean (x);
+  const bool is_x_number = ecma_is_value_number (x);
+  const bool is_x_string = ecma_is_value_string (x);
+  const bool is_x_object = ecma_is_value_object (x);
+
+  const bool is_y_undefined = ecma_is_value_undefined (y);
+  const bool is_y_null = ecma_is_value_null (y);
+  const bool is_y_boolean = ecma_is_value_boolean (y);
+  const bool is_y_number = ecma_is_value_number (y);
+  const bool is_y_string = ecma_is_value_string (y);
+  const bool is_y_object = ecma_is_value_object (y);
+
+  const bool is_types_equal = ((is_x_undefined && is_y_undefined)
+                               || (is_x_null && is_y_null)
+                               || (is_x_boolean && is_y_boolean)
+                               || (is_x_number && is_y_number)
+                               || (is_x_string && is_y_string)
+                               || (is_x_object && is_y_object));
+
+  if (!is_types_equal)
+  {
+    return false;
+  }
+  else if (is_x_undefined || is_x_null)
+  {
+    return true;
+  }
+  else if (is_x_number)
+  {
+    ecma_number_t x_num = ecma_get_number_from_value (x);
+    ecma_number_t y_num = ecma_get_number_from_value (y);
+
+    bool is_x_nan = ecma_number_is_nan (x_num);
+    bool is_y_nan = ecma_number_is_nan (y_num);
+
+    if (is_x_nan || is_y_nan)
+    {
+      /*
+       * If both are NaN
+       *   return true;
+       * else
+       *   one of the numbers is NaN, and another - is not
+       *   return false;
+       */
+      return (is_x_nan && is_y_nan);
+    }
+    else if (ecma_number_is_zero (x_num)
+             && ecma_number_is_zero (y_num)
+             && ecma_number_is_negative (x_num) != ecma_number_is_negative (y_num))
+    {
+      return false;
+    }
+    else
+    {
+      return (x_num == y_num);
+    }
+  }
+  else if (is_x_string)
+  {
+    ecma_string_t *x_str_p = ecma_get_string_from_value (x);
+    ecma_string_t *y_str_p = ecma_get_string_from_value (y);
+
+    return ecma_compare_ecma_strings (x_str_p, y_str_p);
+  }
+  else if (is_x_boolean)
+  {
+    return (ecma_is_value_true (x) == ecma_is_value_true (y));
+  }
+  else
+  {
+    JERRY_ASSERT (is_x_object);
+
+    return (ecma_get_object_from_value (x) == ecma_get_object_from_value (y));
+  }
+} /* ecma_op_same_value */
+
+/**
+ * ToPrimitive operation.
+ *
+ * See also:
+ *          ECMA-262 v5, 9.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_to_primitive (ecma_value_t value, /**< ecma value */
+                      ecma_preferred_type_hint_t preferred_type) /**< preferred type hint */
+{
+  ecma_check_value_type_is_spec_defined (value);
+
+  if (ecma_is_value_object (value))
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (value);
+
+    return ecma_op_object_default_value (obj_p, preferred_type);
+  }
+  else
+  {
+    return ecma_copy_value (value);
+  }
+} /* ecma_op_to_primitive */
+
+/**
+ * ToBoolean operation. Cannot throw an exception.
+ *
+ * See also:
+ *          ECMA-262 v5, 9.2
+ *
+ * @return true - if the logical value is true
+ *         false - otherwise
+ */
+bool
+ecma_op_to_boolean (ecma_value_t value) /**< ecma value */
+{
+  ecma_check_value_type_is_spec_defined (value);
+
+  if (ecma_is_value_simple (value))
+  {
+    JERRY_ASSERT (ecma_is_value_boolean (value)
+                  || ecma_is_value_undefined (value)
+                  || ecma_is_value_null (value));
+
+    return ecma_is_value_true (value);
+  }
+
+  if (ecma_is_value_integer_number (value))
+  {
+    return (value != ecma_make_integer_value (0));
+  }
+
+  if (ecma_is_value_float_number (value))
+  {
+    ecma_number_t num = ecma_get_float_from_value (value);
+
+    return (!ecma_number_is_nan (num) && !ecma_number_is_zero (num));
+  }
+
+  if (ecma_is_value_string (value))
+  {
+    ecma_string_t *str_p = ecma_get_string_from_value (value);
+
+    return !ecma_string_is_empty (str_p);
+  }
+
+  JERRY_ASSERT (ecma_is_value_object (value));
+
+  return true;
+} /* ecma_op_to_boolean */
+
+/**
+ * ToNumber operation.
+ *
+ * See also:
+ *          ECMA-262 v5, 9.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_to_number (ecma_value_t value) /**< ecma value */
+{
+  ecma_check_value_type_is_spec_defined (value);
+
+  if (ecma_is_value_integer_number (value))
+  {
+    return value;
+  }
+  else if (ecma_is_value_float_number (value))
+  {
+    return ecma_copy_value (value);
+  }
+  else if (ecma_is_value_string (value))
+  {
+    ecma_string_t *str_p = ecma_get_string_from_value (value);
+    return ecma_make_number_value (ecma_string_to_number (str_p));
+  }
+  else if (ecma_is_value_object (value))
+  {
+    ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+    ECMA_TRY_CATCH (primitive_value,
+                    ecma_op_to_primitive (value, ECMA_PREFERRED_TYPE_NUMBER),
+                    ret_value);
+
+    ret_value = ecma_op_to_number (primitive_value);
+
+    ECMA_FINALIZE (primitive_value);
+
+    return ret_value;
+  }
+  else
+  {
+    int16_t num = 0;
+
+    if (ecma_is_value_undefined (value))
+    {
+      return ecma_make_nan_value ();
+    }
+    else if (ecma_is_value_null (value))
+    {
+      num = 0;
+    }
+    else
+    {
+      JERRY_ASSERT (ecma_is_value_boolean (value));
+
+      if (ecma_is_value_true (value))
+      {
+        num = 1;
+      }
+      else
+      {
+        num = 0;
+      }
+    }
+
+    return ecma_make_integer_value (num);
+  }
+} /* ecma_op_to_number */
+
+/**
+ * ToString operation.
+ *
+ * See also:
+ *          ECMA-262 v5, 9.8
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_to_string (ecma_value_t value) /**< ecma value */
+{
+  ecma_check_value_type_is_spec_defined (value);
+
+  if (unlikely (ecma_is_value_object (value)))
+  {
+    ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+    ECMA_TRY_CATCH (prim_value,
+                    ecma_op_to_primitive (value, ECMA_PREFERRED_TYPE_STRING),
+                    ret_value);
+
+    ret_value = ecma_op_to_string (prim_value);
+
+    ECMA_FINALIZE (prim_value);
+
+    return ret_value;
+  }
+  else
+  {
+    ecma_string_t *res_p = NULL;
+
+    if (ecma_is_value_string (value))
+    {
+      res_p = ecma_get_string_from_value (value);
+      ecma_ref_ecma_string (res_p);
+    }
+    else if (ecma_is_value_integer_number (value))
+    {
+      ecma_integer_value_t num = ecma_get_integer_from_value (value);
+
+      if (num < 0)
+      {
+        res_p = ecma_new_ecma_string_from_number ((ecma_number_t) num);
+      }
+      else
+      {
+        res_p = ecma_new_ecma_string_from_uint32 ((uint32_t) num);
+      }
+    }
+    else if (ecma_is_value_float_number (value))
+    {
+      ecma_number_t num = ecma_get_float_from_value (value);
+      res_p = ecma_new_ecma_string_from_number (num);
+    }
+    else if (ecma_is_value_undefined (value))
+    {
+      res_p = ecma_get_magic_string (LIT_MAGIC_STRING_UNDEFINED);
+    }
+    else if (ecma_is_value_null (value))
+    {
+      res_p = ecma_get_magic_string (LIT_MAGIC_STRING_NULL);
+    }
+    else
+    {
+      JERRY_ASSERT (ecma_is_value_boolean (value));
+
+      if (ecma_is_value_true (value))
+      {
+        res_p = ecma_get_magic_string (LIT_MAGIC_STRING_TRUE);
+      }
+      else
+      {
+        res_p = ecma_get_magic_string (LIT_MAGIC_STRING_FALSE);
+      }
+    }
+
+    return ecma_make_string_value (res_p);
+  }
+} /* ecma_op_to_string */
+
+/**
+ * ToObject operation.
+ *
+ * See also:
+ *          ECMA-262 v5, 9.9
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_to_object (ecma_value_t value) /**< ecma value */
+{
+  ecma_check_value_type_is_spec_defined (value);
+
+  if (ecma_is_value_number (value))
+  {
+    return ecma_op_create_number_object (value);
+  }
+  else if (ecma_is_value_string (value))
+  {
+    return ecma_op_create_string_object (&value, 1);
+  }
+  else if (ecma_is_value_object (value))
+  {
+    return ecma_copy_value (value);
+  }
+  else
+  {
+    if (ecma_is_value_undefined (value)
+        || ecma_is_value_null (value))
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG ("Argument cannot be converted to an object."));
+    }
+    else
+    {
+      JERRY_ASSERT (ecma_is_value_boolean (value));
+
+      return ecma_op_create_boolean_object (value);
+    }
+  }
+} /* ecma_op_to_object */
+
+/**
+ * FromPropertyDescriptor operation.
+ *
+ * See also:
+ *          ECMA-262 v5, 8.10.4
+ *
+ * @return constructed object
+ */
+ecma_object_t *
+ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_desc_p) /**< property descriptor */
+{
+  /* 2. */
+  ecma_object_t *obj_p = ecma_op_create_object_object_noarg ();
+
+  ecma_value_t completion;
+  ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
+  {
+    prop_desc.is_value_defined = true;
+
+    prop_desc.is_writable_defined = true;
+    prop_desc.is_writable = true;
+
+    prop_desc.is_enumerable_defined = true;
+    prop_desc.is_enumerable = true;
+
+    prop_desc.is_configurable_defined = true;
+    prop_desc.is_configurable = true;
+  }
+
+  /* 3. */
+  if (src_prop_desc_p->is_value_defined
+      || src_prop_desc_p->is_writable_defined)
+  {
+    JERRY_ASSERT (prop_desc.is_value_defined && prop_desc.is_writable_defined);
+
+    /* a. */
+    prop_desc.value = src_prop_desc_p->value;
+
+    ecma_string_t *value_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_VALUE);
+    completion = ecma_op_object_define_own_property (obj_p,
+                                                     value_magic_string_p,
+                                                     &prop_desc,
+                                                     false);
+    ecma_deref_ecma_string (value_magic_string_p);
+    JERRY_ASSERT (ecma_is_value_true (completion));
+
+    /* b. */
+    const bool is_writable = (src_prop_desc_p->is_writable);
+    prop_desc.value = ecma_make_boolean_value (is_writable);
+
+    ecma_string_t *writable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_WRITABLE);
+    completion = ecma_op_object_define_own_property (obj_p,
+                                                     writable_magic_string_p,
+                                                     &prop_desc,
+                                                     false);
+    ecma_deref_ecma_string (writable_magic_string_p);
+    JERRY_ASSERT (ecma_is_value_true (completion));
+  }
+  else
+  {
+    /* 4. */
+    JERRY_ASSERT (src_prop_desc_p->is_get_defined
+                  || src_prop_desc_p->is_set_defined);
+
+    /* a. */
+    if (src_prop_desc_p->get_p == NULL)
+    {
+      prop_desc.value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+    else
+    {
+      prop_desc.value = ecma_make_object_value (src_prop_desc_p->get_p);
+    }
+
+    ecma_string_t *get_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GET);
+    completion = ecma_op_object_define_own_property (obj_p,
+                                                     get_magic_string_p,
+                                                     &prop_desc,
+                                                     false);
+    ecma_deref_ecma_string (get_magic_string_p);
+    JERRY_ASSERT (ecma_is_value_true (completion));
+
+    /* b. */
+    if (src_prop_desc_p->set_p == NULL)
+    {
+      prop_desc.value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+    else
+    {
+      prop_desc.value = ecma_make_object_value (src_prop_desc_p->set_p);
+    }
+
+    ecma_string_t *set_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SET);
+    completion = ecma_op_object_define_own_property (obj_p,
+                                                     set_magic_string_p,
+                                                     &prop_desc,
+                                                     false);
+    ecma_deref_ecma_string (set_magic_string_p);
+    JERRY_ASSERT (ecma_is_value_true (completion));
+  }
+
+  const bool is_enumerable = src_prop_desc_p->is_enumerable;
+  prop_desc.value = ecma_make_boolean_value (is_enumerable);
+
+  ecma_string_t *enumerable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_ENUMERABLE);
+  completion = ecma_op_object_define_own_property (obj_p,
+                                                   enumerable_magic_string_p,
+                                                   &prop_desc,
+                                                   false);
+  ecma_deref_ecma_string (enumerable_magic_string_p);
+  JERRY_ASSERT (ecma_is_value_true (completion));
+
+  const bool is_configurable = src_prop_desc_p->is_configurable;
+  prop_desc.value = ecma_make_boolean_value (is_configurable);
+
+  ecma_string_t *configurable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CONFIGURABLE);
+  completion = ecma_op_object_define_own_property (obj_p,
+                                                   configurable_magic_string_p,
+                                                   &prop_desc,
+                                                   false);
+  ecma_deref_ecma_string (configurable_magic_string_p);
+  JERRY_ASSERT (ecma_is_value_true (completion));
+
+  return obj_p;
+} /* ecma_op_from_property_descriptor */
+
+/**
+ * ToPropertyDescriptor operation.
+ *
+ * See also:
+ *          ECMA-262 v5, 8.10.5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
+                                ecma_property_descriptor_t *out_prop_desc_p) /**< [out] filled property descriptor
+                                                                                  if return value is normal
+                                                                                  empty completion value */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 1. */
+  if (!ecma_is_value_object (obj_value))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected an object."));
+  }
+  else
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (obj_value);
+
+    /* 2. */
+    ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
+
+    /* 3. */
+    ecma_string_t *enumerable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_ENUMERABLE);
+
+    ECMA_TRY_CATCH (enumerable_prop_value,
+                    ecma_op_object_find (obj_p, enumerable_magic_string_p),
+                    ret_value);
+
+    if (ecma_is_value_found (enumerable_prop_value))
+    {
+      prop_desc.is_enumerable_defined = true;
+      prop_desc.is_enumerable = ecma_op_to_boolean (enumerable_prop_value);
+    }
+
+    ECMA_FINALIZE (enumerable_prop_value);
+
+    ecma_deref_ecma_string (enumerable_magic_string_p);
+
+    if (!ECMA_IS_VALUE_ERROR (ret_value))
+    {
+      JERRY_ASSERT (ecma_is_value_empty (ret_value));
+
+      /* 4. */
+      ecma_string_t *configurable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CONFIGURABLE);
+
+      ECMA_TRY_CATCH (configurable_prop_value,
+                      ecma_op_object_find (obj_p, configurable_magic_string_p),
+                      ret_value);
+
+      if (ecma_is_value_found (configurable_prop_value))
+      {
+        prop_desc.is_configurable_defined = true;
+        prop_desc.is_configurable = ecma_op_to_boolean (configurable_prop_value);
+      }
+
+      ECMA_FINALIZE (configurable_prop_value);
+
+      ecma_deref_ecma_string (configurable_magic_string_p);
+    }
+
+    if (!ECMA_IS_VALUE_ERROR (ret_value))
+    {
+      JERRY_ASSERT (ecma_is_value_empty (ret_value));
+
+      /* 5. */
+      ecma_string_t *value_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_VALUE);
+
+      ECMA_TRY_CATCH (value_prop_value,
+                      ecma_op_object_find (obj_p, value_magic_string_p),
+                      ret_value);
+
+      if (ecma_is_value_found (value_prop_value))
+      {
+        prop_desc.is_value_defined = true;
+        prop_desc.value = ecma_copy_value (value_prop_value);
+      }
+
+      ECMA_FINALIZE (value_prop_value);
+
+      ecma_deref_ecma_string (value_magic_string_p);
+    }
+
+    if (!ECMA_IS_VALUE_ERROR (ret_value))
+    {
+      JERRY_ASSERT (ecma_is_value_empty (ret_value));
+
+      /* 6. */
+      ecma_string_t *writable_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_WRITABLE);
+
+      ECMA_TRY_CATCH (writable_prop_value,
+                      ecma_op_object_find (obj_p, writable_magic_string_p),
+                      ret_value);
+
+      if (ecma_is_value_found (writable_prop_value))
+      {
+        prop_desc.is_writable_defined = true;
+        prop_desc.is_writable = ecma_op_to_boolean (writable_prop_value);
+      }
+
+      ECMA_FINALIZE (writable_prop_value);
+
+      ecma_deref_ecma_string (writable_magic_string_p);
+    }
+
+    if (!ECMA_IS_VALUE_ERROR (ret_value))
+    {
+      JERRY_ASSERT (ecma_is_value_empty (ret_value));
+
+      /* 7. */
+      ecma_string_t *get_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GET);
+
+      ECMA_TRY_CATCH (get_prop_value,
+                      ecma_op_object_find (obj_p, get_magic_string_p),
+                      ret_value);
+
+      if (ecma_is_value_found (get_prop_value))
+      {
+        if (!ecma_op_is_callable (get_prop_value)
+            && !ecma_is_value_undefined (get_prop_value))
+        {
+          ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected a function."));
+        }
+        else
+        {
+          prop_desc.is_get_defined = true;
+
+          if (ecma_is_value_undefined (get_prop_value))
+          {
+            prop_desc.get_p = NULL;
+          }
+          else
+          {
+            JERRY_ASSERT (ecma_is_value_object (get_prop_value));
+
+            ecma_object_t *get_p = ecma_get_object_from_value (get_prop_value);
+            ecma_ref_object (get_p);
+
+            prop_desc.get_p = get_p;
+          }
+        }
+      }
+
+      ECMA_FINALIZE (get_prop_value);
+
+      ecma_deref_ecma_string (get_magic_string_p);
+    }
+
+    if (!ECMA_IS_VALUE_ERROR (ret_value))
+    {
+      JERRY_ASSERT (ecma_is_value_empty (ret_value));
+
+      /* 8. */
+      ecma_string_t *set_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SET);
+
+      ECMA_TRY_CATCH (set_prop_value,
+                      ecma_op_object_find (obj_p, set_magic_string_p),
+                      ret_value);
+
+      if (ecma_is_value_found (set_prop_value))
+      {
+        if (!ecma_op_is_callable (set_prop_value)
+            && !ecma_is_value_undefined (set_prop_value))
+        {
+          ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected a function."));
+        }
+        else
+        {
+          prop_desc.is_set_defined = true;
+
+          if (ecma_is_value_undefined (set_prop_value))
+          {
+            prop_desc.set_p = NULL;
+          }
+          else
+          {
+            JERRY_ASSERT (ecma_is_value_object (set_prop_value));
+
+            ecma_object_t *set_p = ecma_get_object_from_value (set_prop_value);
+            ecma_ref_object (set_p);
+
+            prop_desc.set_p = set_p;
+          }
+        }
+      }
+
+      ECMA_FINALIZE (set_prop_value);
+
+      ecma_deref_ecma_string (set_magic_string_p);
+    }
+
+    if (!ECMA_IS_VALUE_ERROR (ret_value))
+    {
+      JERRY_ASSERT (ecma_is_value_empty (ret_value));
+
+      /* 9. */
+      if (prop_desc.is_get_defined
+          || prop_desc.is_set_defined)
+      {
+        if (prop_desc.is_value_defined
+            || prop_desc.is_writable_defined)
+        {
+          ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Accessors cannot be writable."));
+        }
+      }
+    }
+
+    if (!ECMA_IS_VALUE_ERROR (ret_value))
+    {
+      JERRY_ASSERT (ecma_is_value_empty (ret_value));
+    }
+    else
+    {
+      ecma_free_property_descriptor (&prop_desc);
+    }
+
+    *out_prop_desc_p = prop_desc;
+  }
+
+  return ret_value;
+} /* ecma_op_to_property_descriptor */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-conversion.h b/deps/jerry/jerry-core/ecma/operations/ecma-conversion.h
new file mode 100644 (file)
index 0000000..056b255
--- /dev/null
@@ -0,0 +1,56 @@
+/* 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.
+ */
+
+#ifndef ECMA_CONVERSION_H
+#define ECMA_CONVERSION_H
+
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaconversion ECMA conversion routines
+ * @{
+ */
+
+/**
+ * Second argument of 'ToPrimitive' operation that is a hint,
+ * specifying the preferred type of conversion result.
+ */
+typedef enum
+{
+  ECMA_PREFERRED_TYPE_NO, /**< no preferred type is specified */
+  ECMA_PREFERRED_TYPE_NUMBER, /**< Number */
+  ECMA_PREFERRED_TYPE_STRING /**< String */
+} ecma_preferred_type_hint_t;
+
+ecma_value_t ecma_op_check_object_coercible (ecma_value_t value);
+bool ecma_op_same_value (ecma_value_t x, ecma_value_t y);
+ecma_value_t ecma_op_to_primitive (ecma_value_t value, ecma_preferred_type_hint_t preferred_type);
+bool ecma_op_to_boolean (ecma_value_t value);
+ecma_value_t ecma_op_to_number (ecma_value_t value);
+ecma_value_t ecma_op_to_string (ecma_value_t value);
+ecma_value_t ecma_op_to_object (ecma_value_t value);
+
+ecma_object_t *ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_desc_p);
+ecma_value_t ecma_op_to_property_descriptor (ecma_value_t obj_value, ecma_property_descriptor_t *out_prop_desc_p);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_CONVERSION_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-eval.c b/deps/jerry/jerry-core/ecma/operations/ecma-eval.c
new file mode 100644 (file)
index 0000000..a742771
--- /dev/null
@@ -0,0 +1,115 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-eval.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-lex-env.h"
+#include "js-parser.h"
+#include "vm.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup eval eval
+ * @{
+ */
+
+/**
+ * Perform 'eval' with code stored in ecma-string
+ *
+ * See also:
+ *          ecma_op_eval_chars_buffer
+ *          ECMA-262 v5, 15.1.2.1 (steps 2 to 8)
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_op_eval (ecma_string_t *code_p, /**< code string */
+              bool is_direct, /**< is eval called directly (ECMA-262 v5, 15.1.2.1.1) */
+              bool is_called_from_strict_mode_code) /**< is eval is called from strict mode code */
+{
+  ecma_value_t ret_value;
+
+  lit_utf8_size_t chars_num = ecma_string_get_size (code_p);
+  if (chars_num == 0)
+  {
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  }
+  else
+  {
+    ECMA_STRING_TO_UTF8_STRING (code_p, code_utf8_buffer_p, code_utf8_buffer_size);
+
+    ret_value = ecma_op_eval_chars_buffer (code_utf8_buffer_p,
+                                           chars_num,
+                                           is_direct,
+                                           is_called_from_strict_mode_code);
+
+    ECMA_FINALIZE_UTF8_STRING (code_utf8_buffer_p, code_utf8_buffer_size);
+  }
+
+  return ret_value;
+} /* ecma_op_eval */
+
+/**
+ * Perform 'eval' with code stored in continuous character buffer
+ *
+ * See also:
+ *          ecma_op_eval
+ *          ECMA-262 v5, 15.1.2.1 (steps 2 to 8)
+ *
+ * @return ecma value
+ */
+ecma_value_t
+ecma_op_eval_chars_buffer (const lit_utf8_byte_t *code_p, /**< code characters buffer */
+                           size_t code_buffer_size, /**< size of the buffer */
+                           bool is_direct, /**< is eval called directly (ECMA-262 v5, 15.1.2.1.1) */
+                           bool is_called_from_strict_mode_code) /**< is eval is called from strict mode code */
+{
+#if JERRY_JS_PARSER
+  JERRY_ASSERT (code_p != NULL);
+
+  ecma_compiled_code_t *bytecode_data_p;
+
+  bool is_strict_call = (is_direct && is_called_from_strict_mode_code);
+
+  ecma_value_t parse_status = parser_parse_script (code_p,
+                                                   code_buffer_size,
+                                                   is_strict_call,
+                                                   &bytecode_data_p);
+
+  if (ECMA_IS_VALUE_ERROR (parse_status))
+  {
+    return parse_status;
+  }
+
+  return vm_run_eval (bytecode_data_p, is_direct);
+#else /* !JERRY_JS_PARSER */
+  JERRY_UNUSED (code_p);
+  JERRY_UNUSED (code_buffer_size);
+  JERRY_UNUSED (is_direct);
+  JERRY_UNUSED (is_called_from_strict_mode_code);
+
+  return ecma_raise_syntax_error (ECMA_ERR_MSG ("The parser has been disabled."));
+#endif /* JERRY_JS_PARSER */
+} /* ecma_op_eval_chars_buffer */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-eval.h b/deps/jerry/jerry-core/ecma/operations/ecma-eval.h
new file mode 100644 (file)
index 0000000..500bd61
--- /dev/null
@@ -0,0 +1,40 @@
+/* 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.
+ */
+
+#ifndef ECMA_EVAL_H
+#define ECMA_EVAL_H
+
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup eval eval
+ * @{
+ */
+
+ecma_value_t
+ecma_op_eval (ecma_string_t *code_p, bool is_direct, bool is_called_from_strict_mode_code);
+
+ecma_value_t
+ecma_op_eval_chars_buffer (const lit_utf8_byte_t *code_p, size_t code_buffer_size, bool is_direct,
+                           bool is_called_from_strict_mode_code);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_EVAL_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-exceptions.c b/deps/jerry/jerry-core/ecma/operations/ecma-exceptions.c
new file mode 100644 (file)
index 0000000..872f922
--- /dev/null
@@ -0,0 +1,349 @@
+/* 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.
+ */
+
+#include <stdarg.h>
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "jrt.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup exceptions Exceptions
+ * @{
+ */
+
+/**
+ * Standard ecma-error object constructor.
+ *
+ * @return pointer to ecma-object representing specified error
+ *         with reference counter set to one.
+ */
+ecma_object_t *
+ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error type */
+{
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+  ecma_builtin_id_t prototype_id = ECMA_BUILTIN_ID__COUNT;
+
+  switch (error_type)
+  {
+    case ECMA_ERROR_COMMON:
+    {
+      prototype_id = ECMA_BUILTIN_ID_ERROR_PROTOTYPE;
+      break;
+    }
+
+    case ECMA_ERROR_EVAL:
+    {
+      prototype_id = ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE;
+      break;
+    }
+
+    case ECMA_ERROR_RANGE:
+    {
+      prototype_id = ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE;
+      break;
+    }
+
+    case ECMA_ERROR_REFERENCE:
+    {
+      prototype_id = ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE;
+      break;
+    }
+
+    case ECMA_ERROR_TYPE:
+    {
+      prototype_id = ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE;
+      break;
+    }
+
+    case ECMA_ERROR_URI:
+    {
+      prototype_id = ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE;
+      break;
+    }
+
+    case ECMA_ERROR_SYNTAX:
+    {
+      prototype_id = ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE;
+      break;
+    }
+  }
+#else
+  JERRY_UNUSED (error_type);
+  ecma_builtin_id_t prototype_id = ECMA_BUILTIN_ID_ERROR_PROTOTYPE;
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (prototype_id);
+
+  ecma_object_t *new_error_obj_p = ecma_create_object (prototype_obj_p,
+                                                       sizeof (ecma_extended_object_t),
+                                                       ECMA_OBJECT_TYPE_CLASS);
+
+  ecma_deref_object (prototype_obj_p);
+
+  ((ecma_extended_object_t *) new_error_obj_p)->u.class_prop.class_id = LIT_MAGIC_STRING_ERROR_UL;
+
+  return new_error_obj_p;
+} /* ecma_new_standard_error */
+
+/**
+ * Standard ecma-error object constructor.
+ *
+ * @return pointer to ecma-object representing specified error
+ *         with reference counter set to one.
+ */
+ecma_object_t *
+ecma_new_standard_error_with_message (ecma_standard_error_t error_type, /**< native error type */
+                                      ecma_string_t *message_string_p) /**< message string */
+{
+  ecma_object_t *new_error_obj_p = ecma_new_standard_error (error_type);
+
+  ecma_string_t *message_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_MESSAGE);
+
+  ecma_property_value_t *prop_value_p;
+  prop_value_p = ecma_create_named_data_property (new_error_obj_p,
+                                                  message_magic_string_p,
+                                                  ECMA_PROPERTY_CONFIGURABLE_WRITABLE,
+                                                  NULL);
+  ecma_deref_ecma_string (message_magic_string_p);
+
+  ecma_ref_ecma_string (message_string_p);
+  prop_value_p->value = ecma_make_string_value (message_string_p);
+
+  return new_error_obj_p;
+} /* ecma_new_standard_error_with_message */
+
+/**
+ * Raise a standard ecma-error with the given type and message.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_raise_standard_error (ecma_standard_error_t error_type, /**< error type */
+                           const lit_utf8_byte_t *msg_p) /**< error message */
+{
+  ecma_object_t *error_obj_p;
+
+  if (msg_p != NULL)
+  {
+    ecma_string_t *error_msg_p = ecma_new_ecma_string_from_utf8 (msg_p,
+                                                                 lit_zt_utf8_string_size (msg_p));
+    error_obj_p = ecma_new_standard_error_with_message (error_type, error_msg_p);
+    ecma_deref_ecma_string (error_msg_p);
+  }
+  else
+  {
+    error_obj_p = ecma_new_standard_error (error_type);
+  }
+
+  return ecma_make_error_obj_value (error_obj_p);
+} /* ecma_raise_standard_error */
+
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+
+/**
+ * Raise a standard ecma-error with the given format string and arguments.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_raise_standard_error_with_format (ecma_standard_error_t error_type, /**< error type */
+                                       const char *format, /**< format string */
+                                       ...) /**< ecma-values */
+{
+  JERRY_ASSERT (format != NULL);
+
+  ecma_string_t *error_msg_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+  ecma_string_t *string1_p;
+  ecma_string_t *string2_p;
+
+  const char *start_p = format;
+  const char *end_p = format;
+
+  va_list args;
+
+  va_start (args, format);
+
+  while (*end_p)
+  {
+    if (*end_p == '%')
+    {
+      /* Concat template string. */
+      if (end_p > start_p)
+      {
+        string1_p = error_msg_p;
+        string2_p = ecma_new_ecma_string_from_utf8 ((const lit_utf8_byte_t *) start_p,
+                                                    (lit_utf8_size_t) (end_p - start_p));
+        error_msg_p = ecma_concat_ecma_strings (string1_p, string2_p);
+        ecma_deref_ecma_string (string1_p);
+        ecma_deref_ecma_string (string2_p);
+      }
+
+      /* Convert an argument to string without side effects. */
+      ecma_string_t *arg_string_p;
+      const ecma_value_t arg_val = va_arg (args, ecma_value_t);
+      if (unlikely (ecma_is_value_object (arg_val)))
+      {
+        ecma_object_t *arg_object_p = ecma_get_object_from_value (arg_val);
+        lit_magic_string_id_t class_name = ecma_object_get_class_name (arg_object_p);
+        arg_string_p = ecma_get_magic_string (class_name);
+      }
+      else
+      {
+        ecma_value_t str_val = ecma_op_to_string (arg_val);
+        arg_string_p = ecma_get_string_from_value (str_val);
+      }
+
+      /* Concat argument. */
+      string1_p = error_msg_p;
+      string2_p = arg_string_p;
+      error_msg_p = ecma_concat_ecma_strings (string1_p, string2_p);
+      ecma_deref_ecma_string (string1_p);
+      ecma_deref_ecma_string (string2_p);
+
+      start_p = end_p + 1;
+    }
+
+    end_p++;
+  }
+
+  va_end (args);
+
+  /* Concat reset of template string. */
+  if (start_p < end_p)
+  {
+    string1_p = error_msg_p;
+    string2_p = ecma_new_ecma_string_from_utf8 ((const lit_utf8_byte_t *) start_p,
+                                                (lit_utf8_size_t) (end_p - start_p));
+    error_msg_p = ecma_concat_ecma_strings (string1_p, string2_p);
+    ecma_deref_ecma_string (string1_p);
+    ecma_deref_ecma_string (string2_p);
+  }
+
+  ecma_object_t *error_obj_p = ecma_new_standard_error_with_message (error_type, error_msg_p);
+  ecma_deref_ecma_string (error_msg_p);
+  return ecma_make_error_obj_value (error_obj_p);
+} /* ecma_raise_standard_error_with_format */
+
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+
+/**
+ * Raise a common error with the given message.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_raise_common_error (const char *msg_p) /**< error message */
+{
+  return ecma_raise_standard_error (ECMA_ERROR_COMMON, (const lit_utf8_byte_t *) msg_p);
+} /* ecma_raise_common_error */
+
+/**
+ * Raise an EvalError with the given message.
+ *
+ * See also: ECMA-262 v5, 15.11.6.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_raise_eval_error (const char *msg_p) /**< error message */
+{
+  return ecma_raise_standard_error (ECMA_ERROR_EVAL, (const lit_utf8_byte_t *) msg_p);
+} /* ecma_raise_eval_error */
+
+/**
+ * Raise a RangeError with the given message.
+ *
+ * See also: ECMA-262 v5, 15.11.6.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_raise_range_error (const char *msg_p) /**< error message */
+{
+  return ecma_raise_standard_error (ECMA_ERROR_RANGE, (const lit_utf8_byte_t *) msg_p);
+} /* ecma_raise_range_error */
+
+/**
+ * Raise a ReferenceError with the given message.
+ *
+ * See also: ECMA-262 v5, 15.11.6.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_raise_reference_error (const char *msg_p) /**< error message */
+{
+  return ecma_raise_standard_error (ECMA_ERROR_REFERENCE, (const lit_utf8_byte_t *) msg_p);
+} /* ecma_raise_reference_error */
+
+/**
+ * Raise a SyntaxError with the given message.
+ *
+ * See also: ECMA-262 v5, 15.11.6.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_raise_syntax_error (const char *msg_p) /**< error message */
+{
+  return ecma_raise_standard_error (ECMA_ERROR_SYNTAX, (const lit_utf8_byte_t *) msg_p);
+} /* ecma_raise_syntax_error */
+
+/**
+ * Raise a TypeError with the given message.
+ *
+* See also: ECMA-262 v5, 15.11.6.5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_raise_type_error (const char *msg_p) /**< error message */
+{
+  return ecma_raise_standard_error (ECMA_ERROR_TYPE, (const lit_utf8_byte_t *) msg_p);
+} /* ecma_raise_type_error */
+
+/**
+ * Raise a URIError with the given message.
+ *
+* See also: ECMA-262 v5, 15.11.6.6
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_raise_uri_error (const char *msg_p) /**< error message */
+{
+  return ecma_raise_standard_error (ECMA_ERROR_URI, (const lit_utf8_byte_t *) msg_p);
+} /* ecma_raise_uri_error */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-exceptions.h b/deps/jerry/jerry-core/ecma/operations/ecma-exceptions.h
new file mode 100644 (file)
index 0000000..7decda2
--- /dev/null
@@ -0,0 +1,70 @@
+/* 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.
+ */
+
+#ifndef ECMA_EXCEPTIONS_H
+#define ECMA_EXCEPTIONS_H
+
+#include "ecma-globals.h"
+#include "jrt.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup exceptions Exceptions
+ * @{
+ */
+
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+#define ECMA_ERR_MSG(msg) msg
+#else /* !JERRY_ENABLE_ERROR_MESSAGES */
+#define ECMA_ERR_MSG(msg) NULL
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+
+/**
+ * Native errors.
+ *
+ * See also: 15.11.1, 15.11.6
+ */
+typedef enum
+{
+  ECMA_ERROR_COMMON,    /**< Error */
+  ECMA_ERROR_EVAL,      /**< EvalError */
+  ECMA_ERROR_RANGE,     /**< RangeError */
+  ECMA_ERROR_REFERENCE, /**< ReferenceError */
+  ECMA_ERROR_SYNTAX,    /**< SyntaxError */
+  ECMA_ERROR_TYPE,      /**< TypeError */
+  ECMA_ERROR_URI        /**< URIError */
+} ecma_standard_error_t;
+
+ecma_object_t *ecma_new_standard_error (ecma_standard_error_t error_type);
+ecma_object_t *ecma_new_standard_error_with_message (ecma_standard_error_t error_type, ecma_string_t *message_string_p);
+ecma_value_t ecma_raise_standard_error (ecma_standard_error_t error_type, const lit_utf8_byte_t *msg_p);
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+ecma_value_t ecma_raise_standard_error_with_format (ecma_standard_error_t error_type, const char *msg_p, ...);
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+ecma_value_t ecma_raise_common_error (const char *msg_p);
+ecma_value_t ecma_raise_eval_error (const char *msg_p);
+ecma_value_t ecma_raise_range_error (const char *msg_p);
+ecma_value_t ecma_raise_reference_error (const char *msg_p);
+ecma_value_t ecma_raise_syntax_error (const char *msg_p);
+ecma_value_t ecma_raise_type_error (const char *msg_p);
+ecma_value_t ecma_raise_uri_error (const char *msg_p);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_EXCEPTIONS_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-function-object.c b/deps/jerry/jerry-core/ecma/operations/ecma-function-object.c
new file mode 100644 (file)
index 0000000..a5a1b4f
--- /dev/null
@@ -0,0 +1,783 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-helpers.h"
+#include "ecma-lex-env.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+#include "ecma-objects-arguments.h"
+#include "ecma-try-catch-macro.h"
+#include "jcontext.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmafunctionobject ECMA Function object related routines
+ * @{
+ */
+
+/**
+ * IsCallable operation.
+ *
+ * See also: ECMA-262 v5, 9.11
+ *
+ * @return true - if value is callable object;
+ *         false - otherwise
+ */
+bool
+ecma_op_is_callable (ecma_value_t value) /**< ecma value */
+{
+  if (!ecma_is_value_object (value))
+  {
+    return false;
+  }
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (value);
+
+  JERRY_ASSERT (obj_p != NULL);
+  JERRY_ASSERT (!ecma_is_lexical_environment (obj_p));
+
+  return (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_FUNCTION
+          || ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION
+          || ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
+} /* ecma_op_is_callable */
+
+/**
+ * Check whether the value is Object that implements [[Construct]].
+ *
+ * @return true - if value is constructor object;
+ *         false - otherwise
+ */
+bool
+ecma_is_constructor (ecma_value_t value) /**< ecma value */
+{
+  if (!ecma_is_value_object (value))
+  {
+    return false;
+  }
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (value);
+
+  JERRY_ASSERT (obj_p != NULL);
+  JERRY_ASSERT (!ecma_is_lexical_environment (obj_p));
+
+  if (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_FUNCTION)
+  {
+    return (!ecma_get_object_is_builtin (obj_p)
+            || !ecma_builtin_function_is_routine (obj_p));
+  }
+
+  return (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION
+          || ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION);
+} /* ecma_is_constructor */
+
+/**
+ * Function object creation operation.
+ *
+ * See also: ECMA-262 v5, 13.2
+ *
+ * @return pointer to newly created Function object
+ */
+ecma_object_t *
+ecma_op_create_function_object (ecma_object_t *scope_p, /**< function's scope */
+                                bool is_decl_in_strict_mode, /**< is function declared in strict mode code? */
+                                const ecma_compiled_code_t *bytecode_data_p) /**< byte-code array */
+{
+  bool is_strict_mode_code = is_decl_in_strict_mode;
+
+  if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE)
+  {
+    is_strict_mode_code = true;
+  }
+
+  /* 1., 4., 13. */
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE);
+
+  ecma_object_t *func_p = ecma_create_object (prototype_obj_p,
+                                              sizeof (ecma_extended_object_t),
+                                              ECMA_OBJECT_TYPE_FUNCTION);
+
+  ecma_deref_object (prototype_obj_p);
+
+  /* 2., 6., 7., 8. */
+  /*
+   * We don't setup [[Get]], [[Call]], [[Construct]], [[HasInstance]] for each function object.
+   * Instead we set the object's type to ECMA_OBJECT_TYPE_FUNCTION
+   * that defines which version of the routine should be used on demand.
+   */
+
+  /* 3. */
+  /*
+   * [[Class]] property is not stored explicitly for objects of ECMA_OBJECT_TYPE_FUNCTION type.
+   *
+   * See also: ecma_object_get_class_name
+   */
+
+  ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) func_p;
+
+  /* 9. */
+  ECMA_SET_INTERNAL_VALUE_POINTER (ext_func_p->u.function.scope_cp, scope_p);
+
+  /* 10., 11., 12. */
+  ECMA_SET_INTERNAL_VALUE_POINTER (ext_func_p->u.function.bytecode_cp, bytecode_data_p);
+  ecma_bytecode_ref ((ecma_compiled_code_t *) bytecode_data_p);
+
+  /* 14., 15., 16., 17., 18. */
+  /*
+   * 'length' and 'prototype' properties are instantiated lazily
+   *
+   * See also: ecma_op_function_try_lazy_instantiate_property
+   */
+
+  /* 19. */
+  if (is_strict_mode_code)
+  {
+    ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER);
+
+    ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
+    {
+      prop_desc.is_enumerable_defined = true;
+      prop_desc.is_enumerable = false;
+
+      prop_desc.is_configurable_defined = true;
+      prop_desc.is_configurable = false;
+
+      prop_desc.is_get_defined = true;
+      prop_desc.get_p = thrower_p;
+
+      prop_desc.is_set_defined = true;
+      prop_desc.set_p = thrower_p;
+    }
+
+    ecma_string_t *magic_string_caller_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLER);
+    ecma_op_object_define_own_property (func_p,
+                                        magic_string_caller_p,
+                                        &prop_desc,
+                                        false);
+    ecma_deref_ecma_string (magic_string_caller_p);
+
+    ecma_string_t *magic_string_arguments_p = ecma_get_magic_string (LIT_MAGIC_STRING_ARGUMENTS);
+    ecma_op_object_define_own_property (func_p,
+                                        magic_string_arguments_p,
+                                        &prop_desc,
+                                        false);
+    ecma_deref_ecma_string (magic_string_arguments_p);
+
+    ecma_deref_object (thrower_p);
+  }
+
+  return func_p;
+} /* ecma_op_create_function_object */
+
+/**
+ * List names of a Function object's lazy instantiated properties,
+ * adding them to corresponding string collections
+ *
+ * See also:
+ *          ecma_op_function_try_lazy_instantiate_property
+ */
+void
+ecma_op_function_list_lazy_property_names (bool separate_enumerable, /**< true - list enumerable properties into
+                                                                      *          main collection and non-enumerable
+                                                                      *          to collection of 'skipped
+                                                                      *          non-enumerable' properties,
+                                                                      *   false - list all properties into main
+                                                                      *           collection.
+                                                                      */
+                                           ecma_collection_header_t *main_collection_p, /**< 'main' collection */
+                                           ecma_collection_header_t *non_enum_collection_p) /**< skipped
+                                                                                             *   'non-enumerable'
+                                                                                             *   collection */
+{
+  ecma_collection_header_t *for_enumerable_p = main_collection_p;
+  JERRY_UNUSED (for_enumerable_p);
+
+  ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? non_enum_collection_p : main_collection_p;
+
+  ecma_string_t *name_p;
+
+  /* 'length' property is non-enumerable (ECMA-262 v5, 13.2.5) */
+  name_p = ecma_new_ecma_length_string ();
+  ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), true);
+  ecma_deref_ecma_string (name_p);
+
+  /* 'prototype' property is non-enumerable (ECMA-262 v5, 13.2.18) */
+  name_p = ecma_get_magic_string (LIT_MAGIC_STRING_PROTOTYPE);
+  ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (name_p), true);
+  ecma_deref_ecma_string (name_p);
+} /* ecma_op_function_list_lazy_property_names */
+
+/**
+ * Lazy instantation of non-builtin ecma function object's properties
+ *
+ * Warning:
+ *         Only non-configurable properties could be instantiated lazily in this function,
+ *         as configurable properties could be deleted and it would be incorrect
+ *         to reinstantiate them in the function in second time.
+ *
+ * @return pointer to newly instantiated property, if a property was instantiated,
+ *         NULL - otherwise
+ */
+ecma_property_t *
+ecma_op_function_try_lazy_instantiate_property (ecma_object_t *object_p, /**< the function object */
+                                                ecma_string_t *property_name_p) /**< property name */
+{
+  static const char prototype_str_p[] = "prototype";
+
+  JERRY_ASSERT (!ecma_get_object_is_builtin (object_p));
+
+  ecma_string_container_t container = ECMA_STRING_GET_CONTAINER (property_name_p);
+
+  /* Check whether the property_name_p is prototype */
+  if (container == ECMA_STRING_CONTAINER_MAGIC_STRING)
+  {
+    if (property_name_p->u.magic_string_id != LIT_MAGIC_STRING_PROTOTYPE)
+    {
+      return NULL;
+    }
+  }
+  else if (container != ECMA_STRING_CONTAINER_HEAP_UTF8_STRING
+           || property_name_p->u.utf8_string.size != (sizeof (prototype_str_p) - 1))
+  {
+    return NULL;
+  }
+  else
+  {
+    if (strncmp ((char *) (property_name_p + 1), prototype_str_p, (sizeof (prototype_str_p) - 1)) != 0)
+    {
+      return NULL;
+    }
+  }
+
+  /* ECMA-262 v5, 13.2, 16-18 */
+
+  /* 16. */
+  ecma_object_t *proto_object_p = ecma_op_create_object_object_noarg ();
+
+  /* 17. */
+  ecma_string_t *magic_string_constructor_p = ecma_get_magic_string (LIT_MAGIC_STRING_CONSTRUCTOR);
+
+  ecma_property_value_t *constructor_prop_value_p;
+  constructor_prop_value_p = ecma_create_named_data_property (proto_object_p,
+                                                              magic_string_constructor_p,
+                                                              ECMA_PROPERTY_CONFIGURABLE_WRITABLE,
+                                                              NULL);
+
+  constructor_prop_value_p->value = ecma_make_object_value (object_p);
+
+  ecma_deref_ecma_string (magic_string_constructor_p);
+
+  /* 18. */
+  ecma_property_t *prototype_prop_p;
+  ecma_property_value_t *prototype_prop_value_p;
+  prototype_prop_value_p = ecma_create_named_data_property (object_p,
+                                                            property_name_p,
+                                                            ECMA_PROPERTY_FLAG_WRITABLE,
+                                                            &prototype_prop_p);
+
+  prototype_prop_value_p->value = ecma_make_object_value (proto_object_p);
+
+  ecma_deref_object (proto_object_p);
+
+  return prototype_prop_p;
+} /* ecma_op_function_try_lazy_instantiate_property */
+
+/**
+ * External function object creation operation.
+ *
+ * Note:
+ *      external function object is implementation-defined object type
+ *      that represent functions implemented in native code, using Embedding API
+ *
+ * @return pointer to newly created external function object
+ */
+ecma_object_t *
+ecma_op_create_external_function_object (ecma_external_handler_t handler_cb) /**< pointer to external native handler */
+{
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE);
+
+  ecma_object_t *function_obj_p;
+  function_obj_p = ecma_create_object (prototype_obj_p,
+                                       sizeof (ecma_extended_object_t),
+                                       ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION);
+
+  ecma_deref_object (prototype_obj_p);
+
+  /*
+   * [[Class]] property is not stored explicitly for objects of ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION type.
+   *
+   * See also: ecma_object_get_class_name
+   */
+
+  ecma_extended_object_t *ext_func_obj_p = (ecma_extended_object_t *) function_obj_p;
+  ext_func_obj_p->u.external_handler_cb = handler_cb;
+
+  ecma_string_t *magic_string_prototype_p = ecma_get_magic_string (LIT_MAGIC_STRING_PROTOTYPE);
+  ecma_builtin_helper_def_prop (function_obj_p,
+                                magic_string_prototype_p,
+                                ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                true, /* Writable */
+                                false, /* Enumerable */
+                                false, /* Configurable */
+                                false); /* Failure handling */
+
+  ecma_deref_ecma_string (magic_string_prototype_p);
+
+  return function_obj_p;
+} /* ecma_op_create_external_function_object */
+
+/**
+ * [[Call]] implementation for Function objects,
+ * created through 13.2 (ECMA_OBJECT_TYPE_FUNCTION)
+ * or 15.3.4.5 (ECMA_OBJECT_TYPE_BOUND_FUNCTION),
+ * and for built-in Function objects
+ * from section 15 (ECMA_OBJECT_TYPE_FUNCTION).
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object */
+                               ecma_value_t value) /**< argument 'V' */
+{
+  JERRY_ASSERT (func_obj_p != NULL
+                && !ecma_is_lexical_environment (func_obj_p));
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_FUNCTION
+      || ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION)
+  {
+    if (!ecma_is_value_object (value))
+    {
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+    }
+
+    ecma_object_t *v_obj_p = ecma_get_object_from_value (value);
+
+    ecma_string_t *prototype_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_PROTOTYPE);
+
+    ECMA_TRY_CATCH (prototype_obj_value,
+                    ecma_op_object_get (func_obj_p, prototype_magic_string_p),
+                    ret_value);
+
+    if (!ecma_is_value_object (prototype_obj_value))
+    {
+      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Object expected."));
+    }
+    else
+    {
+      ecma_object_t *prototype_obj_p = ecma_get_object_from_value (prototype_obj_value);
+      JERRY_ASSERT (prototype_obj_p != NULL);
+
+      do
+      {
+        v_obj_p = ecma_get_object_prototype (v_obj_p);
+
+        if (v_obj_p == NULL)
+        {
+          ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+
+          break;
+        }
+        else if (v_obj_p == prototype_obj_p)
+        {
+          ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+
+          break;
+        }
+      } while (true);
+    }
+
+    ECMA_FINALIZE (prototype_obj_value);
+
+    ecma_deref_ecma_string (prototype_magic_string_p);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
+
+    /* 1. */
+    ecma_extended_object_t *ext_function_p = (ecma_extended_object_t *) func_obj_p;
+
+    ecma_object_t *target_func_obj_p;
+    target_func_obj_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                         ext_function_p->u.bound_function.target_function);
+
+    /* 3. */
+    ret_value = ecma_op_object_has_instance (target_func_obj_p, value);
+  }
+
+  return ret_value;
+} /* ecma_op_function_has_instance */
+
+/**
+ * [[Call]] implementation for Function objects,
+ * created through 13.2 (ECMA_OBJECT_TYPE_FUNCTION)
+ * or 15.3.4.5 (ECMA_OBJECT_TYPE_BOUND_FUNCTION),
+ * and for built-in Function objects
+ * from section 15 (ECMA_OBJECT_TYPE_FUNCTION).
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
+                       ecma_value_t this_arg_value, /**< 'this' argument's value */
+                       const ecma_value_t *arguments_list_p, /**< arguments list */
+                       ecma_length_t arguments_list_len) /**< length of arguments list */
+{
+  JERRY_ASSERT (func_obj_p != NULL
+                && !ecma_is_lexical_environment (func_obj_p));
+  JERRY_ASSERT (ecma_op_is_callable (ecma_make_object_value (func_obj_p)));
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_FUNCTION)
+  {
+    if (unlikely (ecma_get_object_is_builtin (func_obj_p)))
+    {
+      ret_value = ecma_builtin_dispatch_call (func_obj_p,
+                                              this_arg_value,
+                                              arguments_list_p,
+                                              arguments_list_len);
+    }
+    else
+    {
+      /* Entering Function Code (ECMA-262 v5, 10.4.3) */
+      ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) func_obj_p;
+
+      ecma_object_t *scope_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                                ext_func_p->u.function.scope_cp);
+
+      /* 8. */
+      ecma_value_t this_binding;
+      bool is_strict;
+      bool is_no_lex_env;
+
+      const ecma_compiled_code_t *bytecode_data_p;
+      bytecode_data_p = ECMA_GET_INTERNAL_VALUE_POINTER (const ecma_compiled_code_t,
+                                                         ext_func_p->u.function.bytecode_cp);
+
+      is_strict = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) ? true : false;
+      is_no_lex_env = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_LEXICAL_ENV_NOT_NEEDED) ? true : false;
+
+      /* 1. */
+      if (is_strict)
+      {
+        this_binding = ecma_copy_value (this_arg_value);
+      }
+      else if (ecma_is_value_undefined (this_arg_value)
+               || ecma_is_value_null (this_arg_value))
+      {
+        /* 2. */
+        this_binding = ecma_make_object_value (ecma_builtin_get (ECMA_BUILTIN_ID_GLOBAL));
+      }
+      else
+      {
+        /* 3., 4. */
+        this_binding = ecma_op_to_object (this_arg_value);
+
+        JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (this_binding));
+      }
+
+      /* 5. */
+      ecma_object_t *local_env_p;
+      if (is_no_lex_env)
+      {
+        local_env_p = scope_p;
+      }
+      else
+      {
+        local_env_p = ecma_create_decl_lex_env (scope_p);
+        if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_ARGUMENTS_NEEDED)
+        {
+          ecma_op_create_arguments_object (func_obj_p,
+                                           local_env_p,
+                                           arguments_list_p,
+                                           arguments_list_len,
+                                           bytecode_data_p);
+        }
+      }
+
+      ret_value = vm_run (bytecode_data_p,
+                          this_binding,
+                          local_env_p,
+                          false,
+                          arguments_list_p,
+                          arguments_list_len);
+
+      if (!is_no_lex_env)
+      {
+        ecma_deref_object (local_env_p);
+      }
+
+      ecma_free_value (this_binding);
+    }
+  }
+  else if (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION)
+  {
+    ecma_extended_object_t *ext_func_obj_p = (ecma_extended_object_t *) func_obj_p;
+
+    ret_value = ext_func_obj_p->u.external_handler_cb (ecma_make_object_value (func_obj_p),
+                                                       this_arg_value,
+                                                       arguments_list_p,
+                                                       arguments_list_len);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
+    JERRY_CONTEXT (is_direct_eval_form_call) = false;
+
+    /* 2-3. */
+    ecma_extended_object_t *ext_function_p = (ecma_extended_object_t *) func_obj_p;
+
+    ecma_object_t *target_func_obj_p;
+    target_func_obj_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                         ext_function_p->u.bound_function.target_function);
+
+    /* 4. */
+    ecma_value_t *args_p = (ecma_value_t *) (ext_function_p + 1);
+
+    ecma_value_t bound_this_value = *args_p;
+    ecma_length_t args_length = ext_function_p->u.bound_function.args_length;
+
+    JERRY_ASSERT (args_length > 0);
+
+    if (args_length > 1)
+    {
+      args_length--;
+      ecma_length_t merged_args_list_len = args_length + arguments_list_len;
+
+      JMEM_DEFINE_LOCAL_ARRAY (merged_args_list_p, merged_args_list_len, ecma_value_t);
+
+      memcpy (merged_args_list_p, args_p + 1, args_length * sizeof (ecma_value_t));
+      memcpy (merged_args_list_p + args_length, arguments_list_p, arguments_list_len * sizeof (ecma_value_t));
+
+      /* 5. */
+      ret_value = ecma_op_function_call (target_func_obj_p,
+                                         bound_this_value,
+                                         merged_args_list_p,
+                                         merged_args_list_len);
+
+      JMEM_FINALIZE_LOCAL_ARRAY (merged_args_list_p);
+    }
+    else
+    {
+      /* 5. */
+      ret_value = ecma_op_function_call (target_func_obj_p,
+                                         bound_this_value,
+                                         arguments_list_p,
+                                         arguments_list_len);
+    }
+  }
+
+  JERRY_ASSERT (!ecma_is_value_empty (ret_value));
+
+  return ret_value;
+} /* ecma_op_function_call */
+
+/**
+ * [[Construct]] implementation for Function objects (13.2.2),
+ * created through 13.2 (ECMA_OBJECT_TYPE_FUNCTION) and
+ * externally defined (host) functions (ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION).
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+ecma_op_function_construct_simple_or_external (ecma_object_t *func_obj_p, /**< Function object */
+                                               const ecma_value_t *arguments_list_p, /**< arguments list */
+                                               ecma_length_t arguments_list_len) /**< length of arguments list */
+{
+  JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_FUNCTION
+                || ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION);
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ecma_string_t *prototype_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_PROTOTYPE);
+
+  /* 5. */
+  ECMA_TRY_CATCH (func_obj_prototype_prop_value,
+                  ecma_op_object_get (func_obj_p,
+                                      prototype_magic_string_p),
+                  ret_value);
+
+  /* 1., 2., 4. */
+  ecma_object_t *obj_p;
+  if (ecma_is_value_object (func_obj_prototype_prop_value))
+  {
+    /* 6. */
+    obj_p = ecma_create_object (ecma_get_object_from_value (func_obj_prototype_prop_value),
+                                0,
+                                ECMA_OBJECT_TYPE_GENERAL);
+  }
+  else
+  {
+    /* 7. */
+    ecma_object_t *prototype_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
+
+    obj_p = ecma_create_object (prototype_p, 0, ECMA_OBJECT_TYPE_GENERAL);
+
+    ecma_deref_object (prototype_p);
+  }
+
+  /* 3. */
+  /*
+   * [[Class]] property of ECMA_OBJECT_TYPE_GENERAL type objects
+   * without ECMA_INTERNAL_PROPERTY_CLASS internal property
+   * is "Object".
+   *
+   * See also: ecma_object_get_class_name.
+   */
+
+  /* 8. */
+  ECMA_TRY_CATCH (call_completion,
+                  ecma_op_function_call (func_obj_p,
+                                         ecma_make_object_value (obj_p),
+                                         arguments_list_p,
+                                         arguments_list_len),
+                  ret_value);
+
+  /* 9. */
+  if (ecma_is_value_object (call_completion))
+  {
+    ret_value = ecma_copy_value (call_completion);
+  }
+  else
+  {
+    /* 10. */
+    ecma_ref_object (obj_p);
+    ret_value = ecma_make_object_value (obj_p);
+  }
+
+  ECMA_FINALIZE (call_completion);
+
+  ecma_deref_object (obj_p);
+
+  ECMA_FINALIZE (func_obj_prototype_prop_value);
+
+  ecma_deref_ecma_string (prototype_magic_string_p);
+
+  return ret_value;
+} /* ecma_op_function_construct_simple_or_external */
+
+/**
+ * [[Construct]] implementation:
+ *   13.2.2 - for Function objects, created through 13.2 (ECMA_OBJECT_TYPE_FUNCTION),
+ *            and externally defined host functions (ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION);
+ *   15.3.4.5.1 - for Function objects, created through 15.3.4.5 (ECMA_OBJECT_TYPE_BOUND_FUNCTION).
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
+                            const ecma_value_t *arguments_list_p, /**< arguments list */
+                            ecma_length_t arguments_list_len) /**< length of arguments list */
+{
+  JERRY_ASSERT (func_obj_p != NULL
+                && !ecma_is_lexical_environment (func_obj_p));
+  JERRY_ASSERT (ecma_is_constructor (ecma_make_object_value (func_obj_p)));
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_FUNCTION)
+  {
+    if (unlikely (ecma_get_object_is_builtin (func_obj_p)
+                  && !ecma_builtin_function_is_routine (func_obj_p)))
+    {
+      ret_value = ecma_builtin_dispatch_construct (func_obj_p,
+                                                   arguments_list_p,
+                                                   arguments_list_len);
+    }
+    else
+    {
+      ret_value = ecma_op_function_construct_simple_or_external (func_obj_p,
+                                                                 arguments_list_p,
+                                                                 arguments_list_len);
+    }
+  }
+  else if (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION)
+  {
+    ret_value = ecma_op_function_construct_simple_or_external (func_obj_p,
+                                                               arguments_list_p,
+                                                               arguments_list_len);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
+
+    /* 1. */
+    ecma_extended_object_t *ext_function_p = (ecma_extended_object_t *) func_obj_p;
+
+    ecma_object_t *target_func_obj_p;
+    target_func_obj_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                         ext_function_p->u.bound_function.target_function);
+
+    /* 2. */
+    if (!ecma_is_constructor (ecma_make_object_value (target_func_obj_p)))
+    {
+      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected a constructor."));
+    }
+    else
+    {
+      /* 4. */
+      ecma_length_t args_length = ext_function_p->u.bound_function.args_length;
+
+      JERRY_ASSERT (args_length > 0);
+
+      if (args_length > 1)
+      {
+        ecma_value_t *args_p = (ecma_value_t *) (ext_function_p + 1);
+
+        args_length--;
+        ecma_length_t merged_args_list_len = args_length + arguments_list_len;
+
+        JMEM_DEFINE_LOCAL_ARRAY (merged_args_list_p, merged_args_list_len, ecma_value_t);
+
+        memcpy (merged_args_list_p, args_p + 1, args_length * sizeof (ecma_value_t));
+        memcpy (merged_args_list_p + args_length, arguments_list_p, arguments_list_len * sizeof (ecma_value_t));
+
+        /* 5. */
+        ret_value = ecma_op_function_construct (target_func_obj_p,
+                                                merged_args_list_p,
+                                                merged_args_list_len);
+
+        JMEM_FINALIZE_LOCAL_ARRAY (merged_args_list_p);
+      }
+      else
+      {
+        /* 5. */
+        ret_value = ecma_op_function_construct (target_func_obj_p,
+                                                arguments_list_p,
+                                                arguments_list_len);
+      }
+    }
+  }
+
+  return ret_value;
+} /* ecma_op_function_construct */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-function-object.h b/deps/jerry/jerry-core/ecma/operations/ecma-function-object.h
new file mode 100644 (file)
index 0000000..a52c5b1
--- /dev/null
@@ -0,0 +1,63 @@
+/* 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.
+ */
+
+#ifndef ECMA_FUNCTION_OBJECT_H
+#define ECMA_FUNCTION_OBJECT_H
+
+#include "ecma-globals.h"
+#include "vm.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmafunctionobject ECMA Function object related routines
+ * @{
+ */
+
+bool ecma_op_is_callable (ecma_value_t value);
+bool ecma_is_constructor (ecma_value_t value);
+
+ecma_object_t *
+ecma_op_create_function_object (ecma_object_t *scope_p, bool is_decl_in_strict_mode,
+                                const ecma_compiled_code_t *bytecode_data_p);
+
+void
+ecma_op_function_list_lazy_property_names (bool separate_enumerable,
+                                           ecma_collection_header_t *main_collection_p,
+                                           ecma_collection_header_t *non_enum_collection_p);
+
+ecma_property_t *
+ecma_op_function_try_lazy_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p);
+
+ecma_object_t *
+ecma_op_create_external_function_object (ecma_external_handler_t handler_cb);
+
+ecma_value_t
+ecma_op_function_call (ecma_object_t *func_obj_p, ecma_value_t this_arg_value,
+                       const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
+
+ecma_value_t
+ecma_op_function_construct (ecma_object_t *func_obj_p, const ecma_value_t *arguments_list_p,
+                            ecma_length_t arguments_list_len);
+
+ecma_value_t
+ecma_op_function_has_instance (ecma_object_t *func_obj_p, ecma_value_t value);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_FUNCTION_OBJECT_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-get-put-value.c b/deps/jerry/jerry-core/ecma/operations/ecma-get-put-value.c
new file mode 100644 (file)
index 0000000..fbd92af
--- /dev/null
@@ -0,0 +1,202 @@
+/* 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.
+ */
+
+/**
+ * Implementation of ECMA GetValue and PutValue
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-helpers.h"
+#include "ecma-lex-env.h"
+#include "ecma-objects.h"
+#include "ecma-function-object.h"
+#include "ecma-objects-general.h"
+#include "ecma-try-catch-macro.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup lexicalenvironment Lexical environment
+ * @{
+ */
+
+/**
+ * GetValue operation part (lexical environment base or unresolvable reference).
+ *
+ * See also: ECMA-262 v5, 8.7.1, sections 3 and 5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_op_get_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, /**< reference's base (lexical environment) */
+                                ecma_string_t *var_name_string_p, /**< variable name */
+                                bool is_strict) /**< flag indicating strict mode */
+{
+  const bool is_unresolvable_reference = (ref_base_lex_env_p == NULL);
+
+  /* 3. */
+  if (unlikely (is_unresolvable_reference))
+  {
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+    ecma_value_t var_name_val = ecma_make_string_value (var_name_string_p);
+    ecma_value_t error_value = ecma_raise_standard_error_with_format (ECMA_ERROR_REFERENCE,
+                                                                      "% is not defined",
+                                                                      var_name_val);
+#else /* !JERRY_ENABLE_ERROR_MESSAGES */
+    ecma_value_t error_value = ecma_raise_reference_error (NULL);
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+    return error_value;
+  }
+
+  /* 5. */
+  JERRY_ASSERT (ref_base_lex_env_p != NULL
+                && ecma_is_lexical_environment (ref_base_lex_env_p));
+
+  /* 5.a */
+  return ecma_op_get_binding_value (ref_base_lex_env_p,
+                                    var_name_string_p,
+                                    is_strict);
+} /* ecma_op_get_value_lex_env_base */
+
+/**
+ * GetValue operation part (object base).
+ *
+ * See also: ECMA-262 v5, 8.7.1, section 4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_op_get_value_object_base (ecma_value_t base_value, /**< base value */
+                               ecma_string_t *property_name_p) /**< property name */
+{
+  if (ecma_is_value_object (base_value))
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (base_value);
+    JERRY_ASSERT (obj_p != NULL
+                  && !ecma_is_lexical_environment (obj_p));
+
+    return ecma_op_object_get (obj_p, property_name_p);
+  }
+
+  JERRY_ASSERT (ecma_is_value_boolean (base_value)
+                || ecma_is_value_number (base_value)
+                || ecma_is_value_string (base_value));
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_TRY_CATCH (object_base, ecma_op_to_object (base_value), ret_value);
+
+  ecma_object_t *object_p = ecma_get_object_from_value (object_base);
+  JERRY_ASSERT (object_p != NULL
+                && !ecma_is_lexical_environment (object_p));
+
+  ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+  /* Circular reference is possible in JavaScript and testing it is complicated. */
+  int max_depth = ECMA_PROPERTY_SEARCH_DEPTH_LIMIT;
+
+  do
+  {
+    ecma_value_t value = ecma_op_object_find_own (base_value, object_p, property_name_p);
+
+    if (ecma_is_value_found (value))
+    {
+      ret_value = value;
+      break;
+    }
+
+    if (--max_depth == 0)
+    {
+      break;
+    }
+
+    object_p = ecma_get_object_prototype (object_p);
+  }
+  while (object_p != NULL);
+
+  ECMA_FINALIZE (object_base);
+
+  return ret_value;
+} /* ecma_op_get_value_object_base */
+
+/**
+ * PutValue operation part (lexical environment base or unresolvable reference).
+ *
+ * See also: ECMA-262 v5, 8.7.2, sections 3 and 5
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_op_put_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, /**< reference's base (lexical environment) */
+                                ecma_string_t *var_name_string_p, /**< variable name */
+                                bool is_strict, /**< flag indicating strict mode */
+                                ecma_value_t value) /**< ECMA-value */
+{
+  const bool is_unresolvable_reference = (ref_base_lex_env_p == NULL);
+
+  /* 3. */
+  if (unlikely (is_unresolvable_reference))
+  {
+    /* 3.a. */
+    if (is_strict)
+    {
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+      ecma_value_t var_name_val = ecma_make_string_value (var_name_string_p);
+      ecma_value_t error_value = ecma_raise_standard_error_with_format (ECMA_ERROR_REFERENCE,
+                                                                        "% is not defined",
+                                                                        var_name_val);
+#else /* !JERRY_ENABLE_ERROR_MESSAGES */
+      ecma_value_t error_value = ecma_raise_reference_error (NULL);
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+      return error_value;
+    }
+    else
+    {
+      /* 3.b. */
+      ecma_object_t *global_object_p = ecma_builtin_get (ECMA_BUILTIN_ID_GLOBAL);
+
+      ecma_value_t completion = ecma_op_object_put (global_object_p,
+                                                    var_name_string_p,
+                                                    value,
+                                                    false);
+
+      ecma_deref_object (global_object_p);
+
+      JERRY_ASSERT (ecma_is_value_boolean (completion));
+
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+    }
+  }
+
+  /* 5. */
+  JERRY_ASSERT (ref_base_lex_env_p != NULL
+                && ecma_is_lexical_environment (ref_base_lex_env_p));
+
+  /* 5.a */
+  return ecma_op_set_mutable_binding (ref_base_lex_env_p,
+                                      var_name_string_p,
+                                      value,
+                                      is_strict);
+} /* ecma_op_put_value_lex_env_base */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-jobqueue.c b/deps/jerry/jerry-core/ecma/operations/ecma-jobqueue.c
new file mode 100644 (file)
index 0000000..f7bbcbd
--- /dev/null
@@ -0,0 +1,349 @@
+/* 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.
+ */
+
+#include "ecma-function-object.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-jobqueue.h"
+#include "ecma-objects.h"
+#include "ecma-promise-object.h"
+#include "jcontext.h"
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmajobqueue ECMA Job Queue related routines
+ * @{
+ */
+
+/**
+ * Description of the PromiseReactionJob
+ */
+typedef struct
+{
+  ecma_value_t reaction; /**< the PromiseReaction */
+  ecma_value_t argument; /**< argument for the reaction */
+} ecma_job_promise_reaction_t;
+
+/**
+ * Description of the PromiseResolveThenableJob
+ */
+typedef struct
+{
+  ecma_value_t promise; /**< promise to be resolved */
+  ecma_value_t thenable; /**< thenbale object */
+  ecma_value_t then; /** 'then' function */
+} ecma_job_promise_resolve_thenable_t;
+
+/**
+ * Initialize the jobqueue.
+ */
+void ecma_job_queue_init (void)
+{
+  JERRY_CONTEXT (job_queue_head_p) = NULL;
+  JERRY_CONTEXT (job_queue_tail_p) = NULL;
+} /* ecma_job_queue_init */
+
+/**
+ * Create a PromiseReactionJob.
+ *
+ * @return pointer to the PromiseReactionJob
+ */
+static ecma_job_promise_reaction_t *
+ecma_create_promise_reaction_job (ecma_value_t reaction, /**< PromiseReaction */
+                                  ecma_value_t argument) /**< argument for the reaction */
+{
+  JERRY_ASSERT (ecma_is_value_object (reaction));
+
+  ecma_job_promise_reaction_t *job_p;
+  job_p = (ecma_job_promise_reaction_t *) jmem_heap_alloc_block (sizeof (ecma_job_promise_reaction_t));
+  job_p->reaction = ecma_copy_value (reaction);
+  job_p->argument = ecma_copy_value (argument);
+
+  return job_p;
+} /* ecma_create_promise_reaction_job */
+
+/**
+ * Free the heap and the member of the PromiseReactionJob.
+ */
+static void
+ecma_free_promise_reaction_job (ecma_job_promise_reaction_t *job_p) /**< points to the PromiseReactionJob */
+{
+  JERRY_ASSERT (job_p != NULL);
+
+  ecma_free_value (job_p->reaction);
+  ecma_free_value (job_p->argument);
+
+  jmem_heap_free_block (job_p, sizeof (ecma_job_promise_reaction_t));
+} /* ecma_free_promise_reaction_job */
+
+/**
+ * Create a PromiseResolveThenableJob
+ *
+ * @return pointer to the PromiseResolveThenableJob
+ */
+static ecma_job_promise_resolve_thenable_t *
+ecma_create_promise_resolve_thenable_job (ecma_value_t promise, /**< promise to be resolved */
+                                          ecma_value_t thenable, /**< thenable object */
+                                          ecma_value_t then) /**< 'then' function */
+{
+  JERRY_ASSERT (ecma_is_promise (ecma_get_object_from_value (promise)));
+  JERRY_ASSERT (ecma_is_value_object (thenable));
+  JERRY_ASSERT (ecma_op_is_callable (then));
+
+  ecma_job_promise_resolve_thenable_t *job_p;
+  job_p = (ecma_job_promise_resolve_thenable_t *) jmem_heap_alloc_block (sizeof (ecma_job_promise_resolve_thenable_t));
+
+  job_p->promise = ecma_copy_value (promise);
+  job_p->thenable = ecma_copy_value (thenable);
+  job_p->then = ecma_copy_value (then);
+
+  return job_p;
+} /* ecma_create_promise_resolve_thenable_job */
+
+/**
+ * Free the heap and the member of the PromiseResolveThenableJob.
+ */
+static void
+ecma_free_promise_resolve_thenable_job (ecma_job_promise_resolve_thenable_t *job_p) /**< points to the
+                                                                                     *   PromiseResolveThenableJob */
+{
+  JERRY_ASSERT (job_p != NULL);
+
+  ecma_free_value (job_p->promise);
+  ecma_free_value (job_p->thenable);
+  ecma_free_value (job_p->then);
+
+  jmem_heap_free_block (job_p, sizeof (ecma_job_promise_resolve_thenable_t));
+} /* ecma_free_promise_resolve_thenable_job */
+
+/**
+ * The processor for PromiseReactionJob.
+ *
+ * See also: ES2015 25.4.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+ecma_process_promise_reaction_job (void *obj_p) /**< the job to be operated */
+{
+  ecma_job_promise_reaction_t *job_p = (ecma_job_promise_reaction_t *) obj_p;
+  ecma_object_t *reaction_p = ecma_get_object_from_value (job_p->reaction);
+
+  ecma_string_t *str_capability = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
+  ecma_string_t *str_handler = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_HANDLER);
+  ecma_string_t *str_resolve = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
+  ecma_string_t *str_reject = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
+
+  /* 2. */
+  ecma_value_t capability = ecma_op_object_get (reaction_p, str_capability);
+  /* 3. */
+  ecma_value_t handler = ecma_op_object_get (reaction_p, str_handler);
+
+  JERRY_ASSERT (ecma_is_value_boolean (handler) || ecma_op_is_callable (handler));
+
+  ecma_value_t handler_result;
+
+  if (ecma_is_value_boolean (handler))
+  {
+    /* 4-5. True indicates "identity" and false indicates "thrower" */
+    handler_result = ecma_copy_value (job_p->argument);
+  }
+  else
+  {
+    /* 6. */
+    handler_result = ecma_op_function_call (ecma_get_object_from_value (handler),
+                                            ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                            &(job_p->argument),
+                                            1);
+  }
+
+  ecma_value_t status;
+
+  if (ecma_is_value_false (handler) || ECMA_IS_VALUE_ERROR (handler_result))
+  {
+    if (ECMA_IS_VALUE_ERROR (handler_result))
+    {
+      handler_result = ecma_get_value_from_error_value (handler_result);
+    }
+
+    /* 7. */
+    ecma_value_t reject = ecma_op_object_get (ecma_get_object_from_value (capability), str_reject);
+
+    JERRY_ASSERT (ecma_op_is_callable (reject));
+
+    status = ecma_op_function_call (ecma_get_object_from_value (reject),
+                                    ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                    &handler_result,
+                                    1);
+    ecma_free_value (reject);
+  }
+  else
+  {
+    /* 8. */
+    ecma_value_t resolve = ecma_op_object_get (ecma_get_object_from_value (capability), str_resolve);
+
+    JERRY_ASSERT (ecma_op_is_callable (resolve));
+
+    status = ecma_op_function_call (ecma_get_object_from_value (resolve),
+                                    ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                    &handler_result,
+                                    1);
+    ecma_free_value (resolve);
+  }
+
+  ecma_free_value (handler_result);
+  ecma_free_value (handler);
+  ecma_free_value (capability);
+  ecma_deref_ecma_string (str_capability);
+  ecma_deref_ecma_string (str_handler);
+  ecma_deref_ecma_string (str_resolve);
+  ecma_deref_ecma_string (str_reject);
+  ecma_free_promise_reaction_job (job_p);
+
+  return status;
+} /* ecma_process_promise_reaction_job */
+
+/**
+ * Process the PromiseResolveThenableJob.
+ *
+ * See also: ES2015 25.4.2.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+ecma_process_promise_resolve_thenable_job (void *obj_p) /**< the job to be operated */
+{
+  ecma_job_promise_resolve_thenable_t *job_p = (ecma_job_promise_resolve_thenable_t *) obj_p;
+  ecma_object_t *promise_p = ecma_get_object_from_value (job_p->promise);
+  ecma_string_t str_resolve, str_reject;
+  ecma_init_ecma_magic_string (&str_resolve, LIT_INTERNAL_MAGIC_STRING_RESOLVE_FUNCTION);
+  ecma_init_ecma_magic_string (&str_reject, LIT_INTERNAL_MAGIC_STRING_REJECT_FUNCTION);
+
+  ecma_value_t resolve = ecma_op_object_get (promise_p, &str_resolve);
+  ecma_value_t reject = ecma_op_object_get (promise_p, &str_reject);
+
+  ecma_value_t argv[] = { resolve, reject };
+  ecma_value_t ret;
+  ecma_value_t then_call_result = ecma_op_function_call (ecma_get_object_from_value (job_p->then),
+                                                         job_p->thenable,
+                                                         argv,
+                                                         2);
+
+  ret = then_call_result;
+
+  if (ECMA_IS_VALUE_ERROR (then_call_result))
+  {
+    ret = ecma_op_function_call (ecma_get_object_from_value (reject),
+                                 ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                 &then_call_result,
+                                 1);
+
+    ecma_free_value (then_call_result);
+  }
+
+  ecma_free_value (resolve);
+  ecma_free_value (reject);
+  ecma_free_promise_resolve_thenable_job (job_p);
+
+  return ret;
+} /* ecma_process_promise_resolve_thenable_job */
+
+/**
+ * Enqueue a Promise job into the jobqueue.
+ */
+static void
+ecma_enqueue_job (ecma_job_handler_t handler, /**< the handler for the job */
+                  void *job_p) /**< the job */
+{
+  ecma_job_queueitem_t *item_p = jmem_heap_alloc_block (sizeof (ecma_job_queueitem_t));
+  item_p->job_p = job_p;
+  item_p->handler = handler;
+  item_p->next_p = NULL;
+
+  if (JERRY_CONTEXT (job_queue_head_p) == NULL)
+  {
+    JERRY_CONTEXT (job_queue_head_p) = item_p;
+    JERRY_CONTEXT (job_queue_tail_p) = item_p;
+  }
+  else
+  {
+    JERRY_CONTEXT (job_queue_tail_p)->next_p = item_p;
+    JERRY_CONTEXT (job_queue_tail_p) = item_p;
+  }
+} /* ecma_enqueue_job */
+
+/**
+ * Enqueue a PromiseReactionJob into the jobqueue.
+ */
+void
+ecma_enqueue_promise_reaction_job (ecma_value_t reaction, /**< PromiseReaction */
+                                   ecma_value_t argument) /**< argument for the reaction */
+{
+  ecma_job_promise_reaction_t *job_p = ecma_create_promise_reaction_job (reaction, argument);
+  ecma_enqueue_job (ecma_process_promise_reaction_job, job_p);
+} /* ecma_enqueue_promise_reaction_job */
+
+/**
+ * Enqueue a PromiseResolveThenableJob into the jobqueue.
+ */
+void
+ecma_enqueue_promise_resolve_thenable_job (ecma_value_t promise, /**< promise to be resolved */
+                                           ecma_value_t thenable, /**< thenable object */
+                                           ecma_value_t then) /**< 'then' function */
+{
+  ecma_job_promise_resolve_thenable_t *job_p = ecma_create_promise_resolve_thenable_job (promise,
+                                                                                         thenable,
+                                                                                         then);
+  ecma_enqueue_job (ecma_process_promise_resolve_thenable_job, job_p);
+} /* ecma_enqueue_promise_resolve_thenable_job */
+
+/**
+ * Process enqueued Promise jobs until the first thrown error or until the
+ * jobqueue becomes empty.
+ *
+ * @return result of the last processed job - if the jobqueue was non-empty,
+ *         undefined - otherwise.
+ */
+ecma_value_t
+ecma_process_all_enqueued_jobs (void)
+{
+  ecma_value_t ret = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+  while (JERRY_CONTEXT (job_queue_head_p) != NULL && !ECMA_IS_VALUE_ERROR (ret))
+  {
+    ecma_job_queueitem_t *item_p = JERRY_CONTEXT (job_queue_head_p);
+    JERRY_CONTEXT (job_queue_head_p) = JERRY_CONTEXT (job_queue_head_p)->next_p;
+
+    void *job_p = item_p->job_p;
+    ecma_job_handler_t handler = item_p->handler;
+    jmem_heap_free_block (item_p, sizeof (ecma_job_queueitem_t));
+
+    ecma_free_value (ret);
+    ret = handler (job_p);
+  }
+
+  return ret;
+} /* ecma_process_all_enqueued_jobs */
+
+/**
+ * @}
+ * @}
+ */
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-jobqueue.h b/deps/jerry/jerry-core/ecma/operations/ecma-jobqueue.h
new file mode 100644 (file)
index 0000000..76dcb4b
--- /dev/null
@@ -0,0 +1,55 @@
+/* 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.
+ */
+
+#ifndef ECMA_JOB_QUEUE_H
+#define ECMA_JOB_QUEUE_H
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmajobqueue ECMA Job Queue related routines
+ * @{
+ */
+
+/**
+ * Jerry job handler function type
+ */
+typedef ecma_value_t (*ecma_job_handler_t) (void *job_p);
+
+/**
+ * Description of the job queue item.
+ */
+typedef struct ecma_job_queueitem_t
+{
+  struct ecma_job_queueitem_t *next_p; /**< points to next item */
+  ecma_job_handler_t handler; /**< the handler for the job*/
+  void *job_p; /**< points to the job */
+} ecma_job_queueitem_t;
+
+void ecma_job_queue_init (void);
+
+void ecma_enqueue_promise_reaction_job (ecma_value_t reaction, ecma_value_t argument);
+void ecma_enqueue_promise_resolve_thenable_job (ecma_value_t promise, ecma_value_t thenable, ecma_value_t then);
+
+ecma_value_t ecma_process_all_enqueued_jobs (void);
+
+/**
+ * @}
+ * @}
+ */
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+#endif /* !ECMA_JOB_QUEUE_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-lex-env.c b/deps/jerry/jerry-core/ecma/operations/ecma-lex-env.c
new file mode 100644 (file)
index 0000000..2349f64
--- /dev/null
@@ -0,0 +1,399 @@
+/* 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.
+ */
+
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-lex-env.h"
+#include "ecma-objects.h"
+#include "jcontext.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup lexicalenvironment Lexical environment
+ * @{
+ *
+ * \addtogroup globallexicalenvironment Global lexical environment
+ * @{
+ */
+
+/**
+ * Initialize Global environment
+ */
+void
+ecma_init_global_lex_env (void)
+{
+#ifdef CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE
+  JERRY_CONTEXT (ecma_global_lex_env_p) = ecma_create_decl_lex_env (NULL);
+#else /* !CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */
+  ecma_object_t *glob_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_GLOBAL);
+
+  JERRY_CONTEXT (ecma_global_lex_env_p) = ecma_create_object_lex_env (NULL, glob_obj_p, false);
+
+  ecma_deref_object (glob_obj_p);
+#endif /* CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */
+} /* ecma_init_global_lex_env */
+
+/**
+ * Finalize Global environment
+ */
+void
+ecma_finalize_global_lex_env (void)
+{
+  ecma_deref_object (JERRY_CONTEXT (ecma_global_lex_env_p));
+  JERRY_CONTEXT (ecma_global_lex_env_p) = NULL;
+} /* ecma_finalize_global_lex_env */
+
+/**
+ * Get reference to Global lexical environment
+ * without increasing its reference count.
+ *
+ * @return pointer to the object's instance
+ */
+ecma_object_t *
+ecma_get_global_environment (void)
+{
+  return JERRY_CONTEXT (ecma_global_lex_env_p);
+} /* ecma_get_global_environment */
+
+/**
+ * @}
+ */
+
+/**
+ * HasBinding operation.
+ *
+ * See also: ECMA-262 v5, 10.2.1
+ *
+ * @return true / false
+ */
+bool
+ecma_op_has_binding (ecma_object_t *lex_env_p, /**< lexical environment */
+                     ecma_string_t *name_p) /**< argument N */
+{
+  JERRY_ASSERT (lex_env_p != NULL
+                && ecma_is_lexical_environment (lex_env_p));
+
+  if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
+  {
+    ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p);
+
+    return (property_p != NULL);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND
+                  || ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
+
+    ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
+
+    return ecma_op_object_has_property (binding_obj_p, name_p);
+  }
+} /* ecma_op_has_binding */
+
+/**
+ * CreateMutableBinding operation.
+ *
+ * See also: ECMA-262 v5, 10.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_create_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment */
+                                ecma_string_t *name_p, /**< argument N */
+                                bool is_deletable) /**< argument D */
+{
+  JERRY_ASSERT (lex_env_p != NULL
+                && ecma_is_lexical_environment (lex_env_p));
+  JERRY_ASSERT (name_p != NULL);
+
+  if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
+  {
+    uint8_t prop_attributes = ECMA_PROPERTY_FLAG_WRITABLE;
+
+    if (is_deletable)
+    {
+      prop_attributes = (uint8_t) (prop_attributes | ECMA_PROPERTY_FLAG_CONFIGURABLE);
+    }
+
+    ecma_create_named_data_property (lex_env_p,
+                                     name_p,
+                                     prop_attributes,
+                                     NULL);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND
+                  || ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
+
+    ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
+
+    ecma_value_t completion;
+    completion = ecma_builtin_helper_def_prop (binding_obj_p,
+                                               name_p,
+                                               ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                               true, /* Writable */
+                                               true, /* Enumerable */
+                                               is_deletable, /* Configurable */
+                                               true); /* Failure handling */
+
+    if (ECMA_IS_VALUE_ERROR (completion))
+    {
+      return completion;
+    }
+    else
+    {
+      JERRY_ASSERT (ecma_is_value_boolean (completion));
+    }
+  }
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+} /* ecma_op_create_mutable_binding */
+
+/**
+ * SetMutableBinding operation.
+ *
+ * See also: ECMA-262 v5, 10.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment */
+                             ecma_string_t *name_p, /**< argument N */
+                             ecma_value_t value, /**< argument V */
+                             bool is_strict) /**< argument S */
+{
+  JERRY_ASSERT (lex_env_p != NULL
+                && ecma_is_lexical_environment (lex_env_p));
+  JERRY_ASSERT (name_p != NULL);
+
+  if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
+  {
+    ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p);
+
+    JERRY_ASSERT (property_p != NULL
+                  && ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA);
+
+    if (ecma_is_property_writable (*property_p))
+    {
+      ecma_named_data_property_assign_value (lex_env_p, ECMA_PROPERTY_VALUE_PTR (property_p), value);
+    }
+    else if (is_strict)
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG ("Binding cannot be set."));
+    }
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND
+                  || ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
+
+    ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
+
+    ecma_value_t completion = ecma_op_object_put (binding_obj_p,
+                                                  name_p,
+                                                  value,
+                                                  is_strict);
+
+    if (ECMA_IS_VALUE_ERROR (completion))
+    {
+      return completion;
+    }
+    else
+    {
+      JERRY_ASSERT (ecma_is_value_boolean (completion));
+    }
+  }
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+} /* ecma_op_set_mutable_binding */
+
+/**
+ * GetBindingValue operation.
+ *
+ * See also: ECMA-262 v5, 10.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_op_get_binding_value (ecma_object_t *lex_env_p, /**< lexical environment */
+                           ecma_string_t *name_p, /**< argument N */
+                           bool is_strict) /**< argument S */
+{
+  JERRY_ASSERT (lex_env_p != NULL
+                && ecma_is_lexical_environment (lex_env_p));
+  JERRY_ASSERT (name_p != NULL);
+
+  if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
+  {
+    ecma_property_value_t *prop_value_p = ecma_get_named_data_property (lex_env_p, name_p);
+
+    return ecma_copy_value (prop_value_p->value);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND
+                  || ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
+
+    ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
+
+    ecma_value_t result = ecma_op_object_find (binding_obj_p, name_p);
+
+    if (!ecma_is_value_found (result))
+    {
+      if (is_strict)
+      {
+        result = ecma_raise_reference_error (ECMA_ERR_MSG ("Binding does not exist or is uninitialised."));
+      }
+      else
+      {
+        result = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+      }
+    }
+
+    return result;
+  }
+} /* ecma_op_get_binding_value */
+
+/**
+ * DeleteBinding operation.
+ *
+ * See also: ECMA-262 v5, 10.2.1
+ *
+ * @return ecma value
+ *         Return value is simple and so need not be freed.
+ *         However, ecma_free_value may be called for it, but it is a no-op.
+ */
+ecma_value_t
+ecma_op_delete_binding (ecma_object_t *lex_env_p, /**< lexical environment */
+                        ecma_string_t *name_p) /**< argument N */
+{
+  JERRY_ASSERT (lex_env_p != NULL
+                && ecma_is_lexical_environment (lex_env_p));
+  JERRY_ASSERT (name_p != NULL);
+
+
+  if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
+  {
+    ecma_property_t *prop_p = ecma_find_named_property (lex_env_p, name_p);
+    ecma_simple_value_t ret_val;
+
+    if (prop_p == NULL)
+    {
+      ret_val = ECMA_SIMPLE_VALUE_TRUE;
+    }
+    else
+    {
+      JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*prop_p) == ECMA_PROPERTY_TYPE_NAMEDDATA);
+
+      if (!ecma_is_property_configurable (*prop_p))
+      {
+        ret_val = ECMA_SIMPLE_VALUE_FALSE;
+      }
+      else
+      {
+        ecma_delete_property (lex_env_p, ECMA_PROPERTY_VALUE_PTR (prop_p));
+
+        ret_val = ECMA_SIMPLE_VALUE_TRUE;
+      }
+    }
+
+    return ecma_make_simple_value (ret_val);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND
+                  || ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
+
+    ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
+
+    return ecma_op_object_delete (binding_obj_p, name_p, false);
+  }
+} /* ecma_op_delete_binding */
+
+/**
+ * ImplicitThisValue operation.
+ *
+ * See also: ECMA-262 v5, 10.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_op_implicit_this_value (ecma_object_t *lex_env_p) /**< lexical environment */
+{
+  JERRY_ASSERT (lex_env_p != NULL
+                && ecma_is_lexical_environment (lex_env_p));
+
+  if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
+  {
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND
+                  || ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
+
+    if (ecma_get_lex_env_provide_this (lex_env_p))
+    {
+      ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
+      ecma_ref_object (binding_obj_p);
+
+      return ecma_make_object_value (binding_obj_p);
+    }
+    else
+    {
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+  }
+} /* ecma_op_implicit_this_value */
+
+/**
+ * CreateImmutableBinding operation.
+ *
+ * See also: ECMA-262 v5, 10.2.1
+ */
+void
+ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, /**< lexical environment */
+                                  ecma_string_t *name_p, /**< argument N */
+                                  ecma_value_t value) /**< argument V */
+{
+  JERRY_ASSERT (lex_env_p != NULL
+                && ecma_is_lexical_environment (lex_env_p));
+  JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
+
+  /*
+   * Warning:
+   *         Whether immutable bindings are deletable seems not to be defined by ECMA v5.
+   */
+  ecma_property_value_t *prop_value_p = ecma_create_named_data_property (lex_env_p,
+                                                                         name_p,
+                                                                         ECMA_PROPERTY_FIXED,
+                                                                         NULL);
+
+  prop_value_p->value = ecma_copy_value_if_not_object (value);
+} /* ecma_op_create_immutable_binding */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-lex-env.h b/deps/jerry/jerry-core/ecma/operations/ecma-lex-env.h
new file mode 100644 (file)
index 0000000..4b0c605
--- /dev/null
@@ -0,0 +1,67 @@
+/* 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.
+ */
+
+#ifndef ECMA_LEX_ENV_H
+#define ECMA_LEX_ENV_H
+
+#include "ecma-globals.h"
+#include "ecma-reference.h"
+#include "jrt.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup lexicalenvironment Lexical environment
+ * @{
+ *
+ * \addtogroup globallexicalenvironment Global lexical environment
+ * @{
+ */
+
+void ecma_init_global_lex_env (void);
+void ecma_finalize_global_lex_env (void);
+ecma_object_t *ecma_get_global_environment (void);
+
+/**
+ * @}
+ */
+
+/* ECMA-262 v5, 8.7.1 and 8.7.2 */
+ecma_value_t ecma_op_get_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, ecma_string_t *var_name_string_p,
+                                             bool is_strict);
+ecma_value_t ecma_op_get_value_object_base (ecma_value_t base_value, ecma_string_t *property_name_p);
+ecma_value_t ecma_op_put_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, ecma_string_t *var_name_string_p,
+                                             bool is_strict, ecma_value_t value);
+
+/* ECMA-262 v5, Table 17. Abstract methods of Environment Records */
+bool ecma_op_has_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p);
+ecma_value_t ecma_op_create_mutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, bool is_deletable);
+ecma_value_t ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, ecma_value_t value,
+                                          bool is_strict);
+ecma_value_t ecma_op_get_binding_value (ecma_object_t *lex_env_p, ecma_string_t *name_p, bool is_strict);
+ecma_value_t ecma_op_delete_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p);
+ecma_value_t ecma_op_implicit_this_value (ecma_object_t *lex_env_p);
+
+/* ECMA-262 v5, Table 18. Additional methods of Declarative Environment Records */
+void ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, ecma_value_t value);
+
+ecma_object_t *ecma_op_create_global_environment (ecma_object_t *);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_LEX_ENV_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-number-arithmetic.c b/deps/jerry/jerry-core/ecma/operations/ecma-number-arithmetic.c
new file mode 100644 (file)
index 0000000..0440b5f
--- /dev/null
@@ -0,0 +1,59 @@
+/* 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.
+ */
+
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-number-arithmetic.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup numberarithmetic ECMA number arithmetic operations
+ * @{
+ */
+
+/**
+ * ECMA-defined number remainder calculation.
+ *
+ * See also:
+ *          ECMA-262 v5, 11.5.3
+ *
+ * @return number - calculated remainder.
+ */
+ecma_number_t
+ecma_op_number_remainder (ecma_number_t left_num, /**< left operand */
+                          ecma_number_t right_num) /**< right operand */
+{
+  if (ecma_number_is_nan (left_num)
+      || ecma_number_is_nan (right_num)
+      || ecma_number_is_infinity (left_num)
+      || ecma_number_is_zero (right_num))
+  {
+    return ecma_number_make_nan ();
+  }
+  else if (ecma_number_is_infinity (right_num)
+           || (ecma_number_is_zero (left_num)
+               && !ecma_number_is_zero (right_num)))
+  {
+    return left_num;
+  }
+
+  return ecma_number_calc_remainder (left_num, right_num);
+} /* ecma_op_number_remainder */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-number-arithmetic.h b/deps/jerry/jerry-core/ecma/operations/ecma-number-arithmetic.h
new file mode 100644 (file)
index 0000000..2d9d00a
--- /dev/null
@@ -0,0 +1,35 @@
+/* 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.
+ */
+
+#ifndef ECMA_NUMBER_ARITHMETIC_H
+#define ECMA_NUMBER_ARITHMETIC_H
+
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup numberarithmetic ECMA number arithmetic operations
+ * @{
+ */
+
+ecma_number_t ecma_op_number_remainder (ecma_number_t left_num, ecma_number_t right_num);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_NUMBER_ARITHMETIC_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-number-object.c b/deps/jerry/jerry-core/ecma/operations/ecma-number-object.c
new file mode 100644 (file)
index 0000000..bb09f0f
--- /dev/null
@@ -0,0 +1,75 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-number-object.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmanumberobject ECMA Number object related routines
+ * @{
+ */
+
+/**
+ * Number object creation operation.
+ *
+ * See also: ECMA-262 v5, 15.7.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Number constructor */
+{
+  ecma_value_t conv_to_num_completion = ecma_op_to_number (arg);
+
+  if (ECMA_IS_VALUE_ERROR (conv_to_num_completion))
+  {
+    return conv_to_num_completion;
+  }
+
+#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE);
+#else /* CONFIG_DISABLE_NUMBER_BUILTIN */
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
+#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
+
+  ecma_object_t *object_p = ecma_create_object (prototype_obj_p,
+                                                sizeof (ecma_extended_object_t),
+                                                ECMA_OBJECT_TYPE_CLASS);
+
+  ecma_deref_object (prototype_obj_p);
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_NUMBER_UL;
+
+  /* Pass reference (no need to free conv_to_num_completion). */
+  ext_object_p->u.class_prop.u.value = conv_to_num_completion;
+
+  return ecma_make_object_value (object_p);
+} /* ecma_op_create_number_object */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-number-object.h b/deps/jerry/jerry-core/ecma/operations/ecma-number-object.h
new file mode 100644 (file)
index 0000000..c4baf75
--- /dev/null
@@ -0,0 +1,35 @@
+/* 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.
+ */
+
+#ifndef ECMA_NUMBER_OBJECT_H
+#define ECMA_NUMBER_OBJECT_H
+
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmanumberobject ECMA Number object related routines
+ * @{
+ */
+
+ecma_value_t ecma_op_create_number_object (ecma_value_t arg);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_NUMBER_OBJECT_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-objects-arguments.c b/deps/jerry/jerry-core/ecma/operations/ecma-objects-arguments.c
new file mode 100644 (file)
index 0000000..f95fde1
--- /dev/null
@@ -0,0 +1,370 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-builtins.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-lcache.h"
+#include "ecma-lex-env.h"
+#include "ecma-objects.h"
+#include "ecma-objects-arguments.h"
+#include "ecma-objects-general.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmafunctionobject ECMA Function object related routines
+ * @{
+ */
+
+/**
+ * Arguments object creation operation.
+ *
+ * See also: ECMA-262 v5, 10.6
+ */
+void
+ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function */
+                                 ecma_object_t *lex_env_p, /**< lexical environment the Arguments
+                                                                object is created for */
+                                 const ecma_value_t *arguments_list_p, /**< arguments list */
+                                 ecma_length_t arguments_number, /**< length of arguments list */
+                                 const ecma_compiled_code_t *bytecode_data_p) /**< byte code */
+{
+  bool is_strict = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) != 0;
+
+  ecma_length_t formal_params_number;
+  jmem_cpointer_t *literal_p;
+
+  if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_data_p;
+    uint8_t *byte_p = (uint8_t *) bytecode_data_p;
+
+    formal_params_number = args_p->argument_end;
+    literal_p = (jmem_cpointer_t *) (byte_p + sizeof (cbc_uint16_arguments_t));
+  }
+  else
+  {
+    cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_data_p;
+    uint8_t *byte_p = (uint8_t *) bytecode_data_p;
+
+    formal_params_number = args_p->argument_end;
+    literal_p = (jmem_cpointer_t *) (byte_p + sizeof (cbc_uint8_arguments_t));
+  }
+
+  ecma_object_t *prototype_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
+
+  ecma_object_t *obj_p;
+
+  if (!is_strict && arguments_number > 0 && formal_params_number > 0)
+  {
+    size_t formal_params_size = formal_params_number * sizeof (jmem_cpointer_t);
+
+    obj_p = ecma_create_object (prototype_p,
+                                sizeof (ecma_extended_object_t) + formal_params_size,
+                                ECMA_OBJECT_TYPE_PSEUDO_ARRAY);
+
+    ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+    ext_object_p->u.pseudo_array.type = ECMA_PSEUDO_ARRAY_ARGUMENTS;
+
+    ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.pseudo_array.u2.lex_env_cp, lex_env_p);
+
+    ext_object_p->u.pseudo_array.u1.length = (uint16_t) formal_params_number;
+
+    jmem_cpointer_t *arg_Literal_p = (jmem_cpointer_t *) (ext_object_p + 1);
+
+    memcpy (arg_Literal_p, literal_p, formal_params_size);
+
+    for (ecma_length_t i = 0; i < formal_params_number; i++)
+    {
+      if (arg_Literal_p[i] != JMEM_CP_NULL)
+      {
+        ecma_string_t *name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t, arg_Literal_p[i]);
+        ecma_ref_ecma_string (name_p);
+      }
+    }
+  }
+  else
+  {
+    obj_p = ecma_create_object (prototype_p, sizeof (ecma_extended_object_t), ECMA_OBJECT_TYPE_CLASS);
+
+    ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+    ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_ARGUMENTS_UL;
+  }
+
+  ecma_deref_object (prototype_p);
+
+  ecma_property_value_t *prop_value_p;
+
+  /* 11.a, 11.b */
+  for (ecma_length_t indx = 0;
+       indx < arguments_number;
+       indx++)
+  {
+    ecma_string_t *indx_string_p = ecma_new_ecma_string_from_uint32 (indx);
+
+    prop_value_p = ecma_create_named_data_property (obj_p,
+                                                    indx_string_p,
+                                                    ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
+                                                    NULL);
+
+    prop_value_p->value = ecma_copy_value_if_not_object (arguments_list_p[indx]);
+
+    ecma_deref_ecma_string (indx_string_p);
+  }
+
+  /* 7. */
+  ecma_string_t *length_magic_string_p = ecma_new_ecma_length_string ();
+
+  prop_value_p = ecma_create_named_data_property (obj_p,
+                                                  length_magic_string_p,
+                                                  ECMA_PROPERTY_CONFIGURABLE_WRITABLE,
+                                                  NULL);
+
+  prop_value_p->value = ecma_make_uint32_value (arguments_number);
+
+  ecma_deref_ecma_string (length_magic_string_p);
+
+  ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
+
+  /* 13. */
+  if (!is_strict)
+  {
+    ecma_string_t *callee_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLEE);
+
+    prop_value_p = ecma_create_named_data_property (obj_p,
+                                                    callee_magic_string_p,
+                                                    ECMA_PROPERTY_CONFIGURABLE_WRITABLE,
+                                                    NULL);
+
+    prop_value_p->value = ecma_make_object_value (func_obj_p);
+
+    ecma_deref_ecma_string (callee_magic_string_p);
+  }
+  else
+  {
+    ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER);
+
+    /* 14. */
+    prop_desc = ecma_make_empty_property_descriptor ();
+    {
+      prop_desc.is_get_defined = true;
+      prop_desc.get_p = thrower_p;
+
+      prop_desc.is_set_defined = true;
+      prop_desc.set_p = thrower_p;
+
+      prop_desc.is_enumerable_defined = true;
+      prop_desc.is_enumerable = false;
+
+      prop_desc.is_configurable_defined = true;
+      prop_desc.is_configurable = false;
+    }
+
+    ecma_string_t *callee_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLEE);
+
+    ecma_value_t completion = ecma_op_object_define_own_property (obj_p,
+                                                                  callee_magic_string_p,
+                                                                  &prop_desc,
+                                                                  false);
+
+    JERRY_ASSERT (ecma_is_value_true (completion));
+    ecma_deref_ecma_string (callee_magic_string_p);
+
+    ecma_string_t *caller_magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_CALLER);
+    completion = ecma_op_object_define_own_property (obj_p,
+                                                     caller_magic_string_p,
+                                                     &prop_desc,
+                                                     false);
+    JERRY_ASSERT (ecma_is_value_true (completion));
+    ecma_deref_ecma_string (caller_magic_string_p);
+
+    ecma_deref_object (thrower_p);
+  }
+
+  ecma_string_t *arguments_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_ARGUMENTS);
+
+  if (is_strict)
+  {
+    ecma_op_create_immutable_binding (lex_env_p,
+                                      arguments_string_p,
+                                      ecma_make_object_value (obj_p));
+  }
+  else
+  {
+    ecma_value_t completion = ecma_op_create_mutable_binding (lex_env_p,
+                                                              arguments_string_p,
+                                                              false);
+    JERRY_ASSERT (ecma_is_value_empty (completion));
+
+    completion = ecma_op_set_mutable_binding (lex_env_p,
+                                              arguments_string_p,
+                                              ecma_make_object_value (obj_p),
+                                              false);
+
+    JERRY_ASSERT (ecma_is_value_empty (completion));
+  }
+
+  ecma_deref_ecma_string (arguments_string_p);
+  ecma_deref_object (obj_p);
+} /* ecma_op_create_arguments_object */
+
+/**
+ * [[DefineOwnProperty]] ecma Arguments object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *          ECMA-262 v5, 10.6
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_arguments_object_define_own_property (ecma_object_t *object_p, /**< the object */
+                                              ecma_string_t *property_name_p, /**< property name */
+                                              const ecma_property_descriptor_t *property_desc_p, /**< property
+                                                                                                  *   descriptor */
+                                              bool is_throw) /**< flag that controls failure handling */
+{
+  /* 3. */
+  ecma_value_t ret_value = ecma_op_general_object_define_own_property (object_p,
+                                                                       property_name_p,
+                                                                       property_desc_p,
+                                                                       is_throw);
+
+  if (ECMA_IS_VALUE_ERROR (ret_value))
+  {
+    return ret_value;
+  }
+
+  uint32_t index = ecma_string_get_array_index (property_name_p);
+
+  if (index == ECMA_STRING_NOT_ARRAY_INDEX)
+  {
+    return ret_value;
+  }
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+  if (index >= ext_object_p->u.pseudo_array.u1.length)
+  {
+    return ret_value;
+  }
+
+  jmem_cpointer_t *arg_Literal_p = (jmem_cpointer_t *) (ext_object_p + 1);
+
+  if (arg_Literal_p[index] == JMEM_CP_NULL)
+  {
+    return ret_value;
+  }
+
+  ecma_string_t *name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t, arg_Literal_p[index]);
+
+  if (property_desc_p->is_get_defined
+      || property_desc_p->is_set_defined)
+  {
+    ecma_deref_ecma_string (name_p);
+    arg_Literal_p[index] = JMEM_CP_NULL;
+  }
+  else
+  {
+    if (property_desc_p->is_value_defined)
+    {
+      /* emulating execution of function described by MakeArgSetter */
+      ecma_object_t *lex_env_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                                  ext_object_p->u.pseudo_array.u2.lex_env_cp);
+
+      ecma_value_t completion = ecma_op_set_mutable_binding (lex_env_p,
+                                                             name_p,
+                                                             property_desc_p->value,
+                                                             true);
+
+      JERRY_ASSERT (ecma_is_value_empty (completion));
+    }
+
+    if (property_desc_p->is_writable_defined
+        && !property_desc_p->is_writable)
+    {
+      ecma_deref_ecma_string (name_p);
+      arg_Literal_p[index] = JMEM_CP_NULL;
+    }
+  }
+
+  return ret_value;
+} /* ecma_op_arguments_object_define_own_property */
+
+/**
+ * [[Delete]] ecma Arguments object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *          ECMA-262 v5, 10.6
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_arguments_object_delete (ecma_object_t *object_p, /**< the object */
+                                 ecma_string_t *property_name_p, /**< property name */
+                                 bool is_throw) /**< flag that controls failure handling */
+{
+  /* 3. */
+  ecma_value_t ret_value = ecma_op_general_object_delete (object_p, property_name_p, is_throw);
+
+  if (ECMA_IS_VALUE_ERROR (ret_value))
+  {
+    return ret_value;
+  }
+
+  JERRY_ASSERT (ecma_is_value_boolean (ret_value));
+
+  if (ecma_is_value_true (ret_value))
+  {
+    uint32_t index = ecma_string_get_array_index (property_name_p);
+
+    if (index != ECMA_STRING_NOT_ARRAY_INDEX)
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      if (index < ext_object_p->u.pseudo_array.u1.length)
+      {
+        jmem_cpointer_t *arg_Literal_p = (jmem_cpointer_t *) (ext_object_p + 1);
+
+        if (arg_Literal_p[index] != JMEM_CP_NULL)
+        {
+          ecma_string_t *name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t, arg_Literal_p[index]);
+          ecma_deref_ecma_string (name_p);
+          arg_Literal_p[index] = JMEM_CP_NULL;
+        }
+      }
+    }
+
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+
+  return ret_value;
+} /* ecma_op_arguments_object_delete */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-objects-arguments.h b/deps/jerry/jerry-core/ecma/operations/ecma-objects-arguments.h
new file mode 100644 (file)
index 0000000..dbd167e
--- /dev/null
@@ -0,0 +1,33 @@
+/* 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.
+ */
+
+#ifndef ECMA_OBJECTS_ARGUMENTS_H
+#define ECMA_OBJECTS_ARGUMENTS_H
+
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+
+void
+ecma_op_create_arguments_object (ecma_object_t *func_obj_p, ecma_object_t *lex_env_p,
+                                 const ecma_value_t *arguments_list_p, ecma_length_t arguments_number,
+                                 const ecma_compiled_code_t *bytecode_data_p);
+
+ecma_value_t
+ecma_op_arguments_object_delete (ecma_object_t *object_p, ecma_string_t *property_name_p, bool is_throw);
+ecma_value_t
+ecma_op_arguments_object_define_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p,
+                                              const ecma_property_descriptor_t *property_desc_p, bool is_throw);
+
+#endif /* !ECMA_OBJECTS_ARGUMENTS_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-objects-general.c b/deps/jerry/jerry-core/ecma/operations/ecma-objects-general.c
new file mode 100644 (file)
index 0000000..d94ec0d
--- /dev/null
@@ -0,0 +1,573 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+#include "ecma-try-catch-macro.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaobjectsinternalops ECMA objects' operations
+ * @{
+ */
+
+/**
+ * Reject sequence
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_reject (bool is_throw) /**< Throw flag */
+{
+  if (is_throw)
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type."));
+  }
+  else
+  {
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+  }
+} /* ecma_reject */
+
+/**
+ * 'Object' object creation operation with no arguments.
+ *
+ * See also: ECMA-262 v5, 15.2.2.1
+ *
+ * @return pointer to newly created 'Object' object
+ */
+ecma_object_t *
+ecma_op_create_object_object_noarg (void)
+{
+  ecma_object_t *object_prototype_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
+
+  /* 3., 4., 6., 7. */
+  ecma_object_t *obj_p = ecma_op_create_object_object_noarg_and_set_prototype (object_prototype_p);
+
+  ecma_deref_object (object_prototype_p);
+
+  return obj_p;
+} /* ecma_op_create_object_object_noarg */
+
+/**
+ * 'Object' object creation operation with one argument.
+ *
+ * See also: ECMA-262 v5, 15.2.2.1
+ *
+ * @return pointer to newly created 'Object' object
+ */
+ecma_value_t
+ecma_op_create_object_object_arg (ecma_value_t value) /**< argument of constructor */
+{
+  ecma_check_value_type_is_spec_defined (value);
+
+  if (ecma_is_value_object (value)
+      || ecma_is_value_number (value)
+      || ecma_is_value_string (value)
+      || ecma_is_value_boolean (value))
+  {
+    /* 1.b, 1.c, 1.d */
+    return ecma_op_to_object (value);
+  }
+  else
+  {
+    /* 2. */
+    JERRY_ASSERT (ecma_is_value_undefined (value)
+                  || ecma_is_value_null (value));
+
+    ecma_object_t *obj_p = ecma_op_create_object_object_noarg ();
+
+    return ecma_make_object_value (obj_p);
+  }
+} /* ecma_op_create_object_object_arg */
+
+/**
+ * Object creation operation with no arguments.
+ * It sets the given prototype to the newly created object.
+ *
+ * See also: ECMA-262 v5, 15.2.2.1, 15.2.3.5
+ *
+ * @return pointer to newly created object
+ */
+ecma_object_t *
+ecma_op_create_object_object_noarg_and_set_prototype (ecma_object_t *object_prototype_p) /**< pointer to prototype of
+                                                                                              the object
+                                                                                              (can be NULL) */
+{
+  ecma_object_t *obj_p = ecma_create_object (object_prototype_p, 0, ECMA_OBJECT_TYPE_GENERAL);
+
+  /*
+   * [[Class]] property of ECMA_OBJECT_TYPE_GENERAL type objects
+   * without ECMA_INTERNAL_PROPERTY_CLASS internal property
+   * is "Object".
+   *
+   * See also: ecma_object_get_class_name
+   */
+
+  return obj_p;
+} /* ecma_op_create_object_object_noarg_and_set_prototype */
+
+/**
+ * [[Delete]] ecma general object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *          ECMA-262 v5, 8.12.7
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_general_object_delete (ecma_object_t *obj_p, /**< the object */
+                               ecma_string_t *property_name_p, /**< property name */
+                               bool is_throw) /**< flag that controls failure handling */
+{
+  JERRY_ASSERT (obj_p != NULL
+                && !ecma_is_lexical_environment (obj_p));
+  JERRY_ASSERT (property_name_p != NULL);
+
+  /* 1. */
+  ecma_property_ref_t property_ref;
+
+  ecma_property_t property = ecma_op_object_get_own_property (obj_p,
+                                                              property_name_p,
+                                                              &property_ref,
+                                                              ECMA_PROPERTY_GET_NO_OPTIONS);
+
+  /* 2. */
+  if (property == ECMA_PROPERTY_TYPE_NOT_FOUND || property == ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP)
+  {
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+
+  /* 3. */
+  if (ecma_is_property_configurable (property))
+  {
+    /* a. */
+    ecma_delete_property (obj_p, property_ref.value_p);
+
+    /* b. */
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+  else if (is_throw)
+  {
+    /* 4. */
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Expected a configurable property."));
+  }
+  else
+  {
+    /* 5. */
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+  }
+
+  JERRY_UNREACHABLE ();
+} /* ecma_op_general_object_delete */
+
+/**
+ * [[DefaultValue]] ecma general object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *          ECMA-262 v5, 8.12.8
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */
+                                      ecma_preferred_type_hint_t hint) /**< hint on preferred result type */
+{
+  JERRY_ASSERT (obj_p != NULL
+                && !ecma_is_lexical_environment (obj_p));
+
+  if (hint == ECMA_PREFERRED_TYPE_NO)
+  {
+    if (ecma_object_class_is (obj_p, LIT_MAGIC_STRING_DATE_UL))
+    {
+      hint = ECMA_PREFERRED_TYPE_STRING;
+    }
+    else
+    {
+      hint = ECMA_PREFERRED_TYPE_NUMBER;
+    }
+  }
+
+  for (uint32_t i = 1; i <= 2; i++)
+  {
+    lit_magic_string_id_t function_name_magic_string_id;
+
+    if ((i == 1 && hint == ECMA_PREFERRED_TYPE_STRING)
+        || (i == 2 && hint == ECMA_PREFERRED_TYPE_NUMBER))
+    {
+      function_name_magic_string_id = LIT_MAGIC_STRING_TO_STRING_UL;
+    }
+    else
+    {
+      function_name_magic_string_id = LIT_MAGIC_STRING_VALUE_OF_UL;
+    }
+
+    ecma_string_t *function_name_p = ecma_get_magic_string (function_name_magic_string_id);
+
+    ecma_value_t function_value_get_completion = ecma_op_object_get (obj_p, function_name_p);
+
+    ecma_deref_ecma_string (function_name_p);
+
+    if (ECMA_IS_VALUE_ERROR (function_value_get_completion))
+    {
+      return function_value_get_completion;
+    }
+
+    ecma_value_t call_completion = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+    if (ecma_op_is_callable (function_value_get_completion))
+    {
+      ecma_object_t *func_obj_p = ecma_get_object_from_value (function_value_get_completion);
+
+      call_completion = ecma_op_function_call (func_obj_p,
+                                               ecma_make_object_value (obj_p),
+                                               NULL,
+                                               0);
+    }
+
+    ecma_free_value (function_value_get_completion);
+
+    if (ECMA_IS_VALUE_ERROR (call_completion)
+        || (!ecma_is_value_empty (call_completion)
+           && !ecma_is_value_object (call_completion)))
+    {
+      return call_completion;
+    }
+
+    ecma_free_value (call_completion);
+  }
+
+  return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type in [[DefaultValue]]."));
+} /* ecma_op_general_object_default_value */
+
+/**
+ * Special type for ecma_op_general_object_define_own_property.
+ */
+#define ECMA_PROPERTY_TYPE_GENERIC ECMA_PROPERTY_TYPE_SPECIAL
+
+/**
+ * [[DefineOwnProperty]] ecma general object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *          ECMA-262 v5, 8.12.9
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the object */
+                                            ecma_string_t *property_name_p, /**< property name */
+                                            const ecma_property_descriptor_t *property_desc_p, /**< property
+                                                                                                *   descriptor */
+                                            bool is_throw) /**< flag that controls failure handling */
+{
+  JERRY_ASSERT (object_p != NULL
+                && !ecma_is_lexical_environment (object_p));
+  JERRY_ASSERT (property_name_p != NULL);
+
+  ecma_property_types_t property_desc_type = ECMA_PROPERTY_TYPE_GENERIC;
+
+  if (property_desc_p->is_value_defined
+      || property_desc_p->is_writable_defined)
+  {
+    /* A property descriptor cannot be both named data and named accessor. */
+    JERRY_ASSERT (!property_desc_p->is_get_defined
+                  && !property_desc_p->is_set_defined);
+    property_desc_type = ECMA_PROPERTY_TYPE_NAMEDDATA;
+  }
+  else if (property_desc_p->is_get_defined
+           || property_desc_p->is_set_defined)
+  {
+    property_desc_type = ECMA_PROPERTY_TYPE_NAMEDACCESSOR;
+  }
+
+  /* These three asserts ensures that a new property is created with the appropriate default flags.
+   * E.g. if is_configurable_defined is false, the newly created property must be non-configurable. */
+  JERRY_ASSERT (property_desc_p->is_configurable_defined || !property_desc_p->is_configurable);
+  JERRY_ASSERT (property_desc_p->is_enumerable_defined || !property_desc_p->is_enumerable);
+  JERRY_ASSERT (property_desc_p->is_writable_defined || !property_desc_p->is_writable);
+
+  /* 1. */
+  ecma_extended_property_ref_t ext_property_ref = { .property_ref.value_p = NULL, .property_p = NULL };
+  ecma_property_t current_prop;
+
+  current_prop = ecma_op_object_get_own_property (object_p,
+                                                  property_name_p,
+                                                  &ext_property_ref.property_ref,
+                                                  ECMA_PROPERTY_GET_VALUE | ECMA_PROPERTY_GET_EXT_REFERENCE);
+
+  if (current_prop == ECMA_PROPERTY_TYPE_NOT_FOUND || current_prop == ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP)
+  {
+    /* 3. */
+    if (!ecma_get_object_extensible (object_p))
+    {
+      /* 2. */
+      return ecma_reject (is_throw);
+    }
+
+    /* 4. */
+
+    if (property_desc_type != ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
+    {
+      /* a. */
+
+      JERRY_ASSERT (property_desc_type == ECMA_PROPERTY_TYPE_GENERIC
+                    || property_desc_type == ECMA_PROPERTY_TYPE_NAMEDDATA);
+
+      uint8_t prop_attributes = 0;
+
+      if (property_desc_p->is_configurable)
+      {
+        prop_attributes = (uint8_t) (prop_attributes | ECMA_PROPERTY_FLAG_CONFIGURABLE);
+      }
+      if (property_desc_p->is_enumerable)
+      {
+        prop_attributes = (uint8_t) (prop_attributes | ECMA_PROPERTY_FLAG_ENUMERABLE);
+      }
+      if (property_desc_p->is_writable)
+      {
+        prop_attributes = (uint8_t) (prop_attributes | ECMA_PROPERTY_FLAG_WRITABLE);
+      }
+
+      ecma_property_value_t *new_prop_value_p = ecma_create_named_data_property (object_p,
+                                                                                 property_name_p,
+                                                                                 prop_attributes,
+                                                                                 NULL);
+
+      JERRY_ASSERT (property_desc_p->is_value_defined
+                    || ecma_is_value_undefined (property_desc_p->value));
+
+      new_prop_value_p->value = ecma_copy_value_if_not_object (property_desc_p->value);
+    }
+    else
+    {
+      /* b. */
+
+      uint8_t prop_attributes = 0;
+
+      if (property_desc_p->is_configurable)
+      {
+        prop_attributes = (uint8_t) (prop_attributes | ECMA_PROPERTY_FLAG_CONFIGURABLE);
+      }
+      if (property_desc_p->is_enumerable)
+      {
+        prop_attributes = (uint8_t) (prop_attributes | ECMA_PROPERTY_FLAG_ENUMERABLE);
+      }
+
+      ecma_create_named_accessor_property (object_p,
+                                           property_name_p,
+                                           property_desc_p->get_p,
+                                           property_desc_p->set_p,
+                                           prop_attributes,
+                                           NULL);
+    }
+
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+
+  /* 6. */
+  ecma_property_types_t current_property_type = ECMA_PROPERTY_GET_TYPE (current_prop);
+  const bool is_current_configurable = ecma_is_property_configurable (current_prop);
+
+  JERRY_ASSERT (current_property_type == ECMA_PROPERTY_TYPE_NAMEDDATA
+                || current_property_type == ECMA_PROPERTY_TYPE_NAMEDACCESSOR
+                || current_property_type == ECMA_PROPERTY_TYPE_VIRTUAL);
+
+  /* 7. a., b. */
+  if (!is_current_configurable
+      && (property_desc_p->is_configurable
+          || (property_desc_p->is_enumerable_defined
+              && (property_desc_p->is_enumerable != ecma_is_property_enumerable (current_prop)))))
+  {
+    if (current_property_type == ECMA_PROPERTY_TYPE_VIRTUAL)
+    {
+      ecma_free_value (ext_property_ref.property_ref.virtual_value);
+    }
+    return ecma_reject (is_throw);
+  }
+
+  if (current_property_type == ECMA_PROPERTY_TYPE_VIRTUAL)
+  {
+    JERRY_ASSERT (!is_current_configurable && !ecma_is_property_writable (current_prop));
+
+    ecma_value_t result = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+
+    if (property_desc_type == ECMA_PROPERTY_TYPE_NAMEDACCESSOR
+        || property_desc_p->is_writable
+        || (property_desc_p->is_value_defined
+            && !ecma_op_same_value (property_desc_p->value,
+                                    ext_property_ref.property_ref.virtual_value)))
+    {
+      result = ecma_reject (is_throw);
+    }
+
+    ecma_free_value (ext_property_ref.property_ref.virtual_value);
+    return result;
+  }
+
+  /* 8. */
+  if (property_desc_type == ECMA_PROPERTY_TYPE_GENERIC)
+  {
+    /* No action required. */
+  }
+  else if (likely (property_desc_type == current_property_type))
+  {
+    /* If property is configurable, there is no need for checks. */
+    if (unlikely (!is_current_configurable))
+    {
+      if (property_desc_type == ECMA_PROPERTY_TYPE_NAMEDDATA)
+      {
+        /* 10. a. i. & ii. */
+        if (!ecma_is_property_writable (current_prop)
+            && (property_desc_p->is_writable
+                || (property_desc_p->is_value_defined
+                    && !ecma_op_same_value (property_desc_p->value,
+                                            ext_property_ref.property_ref.value_p->value))))
+        {
+          return ecma_reject (is_throw);
+        }
+      }
+      else
+      {
+        /* 11. */
+
+        /* a. */
+        ecma_property_value_t *value_p = ext_property_ref.property_ref.value_p;
+
+        if ((property_desc_p->is_get_defined
+             && property_desc_p->get_p != ecma_get_named_accessor_property_getter (value_p))
+            || (property_desc_p->is_set_defined
+                && property_desc_p->set_p != ecma_get_named_accessor_property_setter (value_p)))
+        {
+          /* i., ii. */
+          return ecma_reject (is_throw);
+        }
+      }
+    }
+  }
+  else
+  {
+    /* 9. */
+    if (!is_current_configurable)
+    {
+      /* a. */
+      return ecma_reject (is_throw);
+    }
+
+    ecma_property_value_t *value_p = ext_property_ref.property_ref.value_p;
+
+    if (property_desc_type == ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
+    {
+      JERRY_ASSERT (current_property_type == ECMA_PROPERTY_TYPE_NAMEDDATA);
+      ecma_free_value_if_not_object (value_p->value);
+
+#ifdef JERRY_CPOINTER_32_BIT
+      ecma_getter_setter_pointers_t *getter_setter_pair_p;
+      getter_setter_pair_p = jmem_pools_alloc (sizeof (ecma_getter_setter_pointers_t));
+      getter_setter_pair_p->getter_p = JMEM_CP_NULL;
+      getter_setter_pair_p->setter_p = JMEM_CP_NULL;
+      ECMA_SET_POINTER (value_p->getter_setter_pair_cp, getter_setter_pair_p);
+#else /* !JERRY_CPOINTER_32_BIT */
+      value_p->getter_setter_pair.getter_p = JMEM_CP_NULL;
+      value_p->getter_setter_pair.setter_p = JMEM_CP_NULL;
+#endif /* JERRY_CPOINTER_32_BIT */
+    }
+    else
+    {
+      JERRY_ASSERT (current_property_type == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+#ifdef JERRY_CPOINTER_32_BIT
+      ecma_getter_setter_pointers_t *getter_setter_pair_p;
+      getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
+                                               value_p->getter_setter_pair_cp);
+      jmem_pools_free (getter_setter_pair_p, sizeof (ecma_getter_setter_pointers_t));
+#endif /* JERRY_CPOINTER_32_BIT */
+      value_p->value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+
+    /* Update flags */
+    ecma_property_t prop_flags = *(ext_property_ref.property_p);
+    prop_flags = (ecma_property_t) (prop_flags & ~(ECMA_PROPERTY_TYPE_MASK | ECMA_PROPERTY_FLAG_WRITABLE));
+    prop_flags = (ecma_property_t) (prop_flags | property_desc_type);
+    *(ext_property_ref.property_p) = prop_flags;
+  }
+
+  /* 12. */
+  if (property_desc_type == ECMA_PROPERTY_TYPE_NAMEDDATA)
+  {
+    JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*ext_property_ref.property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA);
+
+    if (property_desc_p->is_value_defined)
+    {
+      ecma_named_data_property_assign_value (object_p,
+                                             ext_property_ref.property_ref.value_p,
+                                             property_desc_p->value);
+    }
+
+    if (property_desc_p->is_writable_defined)
+    {
+      ecma_set_property_writable_attr (ext_property_ref.property_p, property_desc_p->is_writable);
+    }
+  }
+  else if (property_desc_type == ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
+  {
+    JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*ext_property_ref.property_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+    if (property_desc_p->is_get_defined)
+    {
+      ecma_set_named_accessor_property_getter (object_p,
+                                               ext_property_ref.property_ref.value_p,
+                                               property_desc_p->get_p);
+    }
+
+    if (property_desc_p->is_set_defined)
+    {
+      ecma_set_named_accessor_property_setter (object_p,
+                                               ext_property_ref.property_ref.value_p,
+                                               property_desc_p->set_p);
+    }
+  }
+
+  if (property_desc_p->is_enumerable_defined)
+  {
+    ecma_set_property_enumerable_attr (ext_property_ref.property_p, property_desc_p->is_enumerable);
+  }
+
+  if (property_desc_p->is_configurable_defined)
+  {
+    ecma_set_property_configurable_attr (ext_property_ref.property_p, property_desc_p->is_configurable);
+  }
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+} /* ecma_op_general_object_define_own_property */
+
+#undef ECMA_PROPERTY_TYPE_GENERIC
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-objects-general.h b/deps/jerry/jerry-core/ecma/operations/ecma-objects-general.h
new file mode 100644 (file)
index 0000000..f9b3433
--- /dev/null
@@ -0,0 +1,45 @@
+/* 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.
+ */
+
+#ifndef ECMA_OBJECTS_GENERAL_H
+#define ECMA_OBJECTS_GENERAL_H
+
+#include "ecma-conversion.h"
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaobjectsinternalops ECMA objects' operations
+ * @{
+ */
+
+ecma_value_t ecma_reject (bool is_throw);
+ecma_object_t *ecma_op_create_object_object_noarg (void);
+ecma_value_t ecma_op_create_object_object_arg (ecma_value_t value);
+ecma_object_t *ecma_op_create_object_object_noarg_and_set_prototype (ecma_object_t *object_prototype_p);
+
+ecma_value_t ecma_op_general_object_delete (ecma_object_t *obj_p, ecma_string_t *property_name_p, bool is_throw);
+ecma_value_t ecma_op_general_object_default_value (ecma_object_t *obj_p, ecma_preferred_type_hint_t hint);
+ecma_value_t ecma_op_general_object_define_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p,
+                                                         const ecma_property_descriptor_t *property_desc_p,
+                                                         bool is_throw);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_OBJECTS_GENERAL_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-objects.c b/deps/jerry/jerry-core/ecma/operations/ecma-objects.c
new file mode 100644 (file)
index 0000000..6163bf4
--- /dev/null
@@ -0,0 +1,1839 @@
+/* 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.
+ */
+
+#include "ecma-array-object.h"
+#include "ecma-builtins.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-function-object.h"
+#include "ecma-lcache.h"
+#include "ecma-lex-env.h"
+#include "ecma-string-object.h"
+#include "ecma-objects-arguments.h"
+#include "ecma-objects-general.h"
+#include "ecma-objects.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+#include "ecma-typedarray-object.h"
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaobjectsinternalops ECMA objects' operations
+ * @{
+ */
+
+/**
+ * Hash bitmap size for ecma objects
+ */
+#define ECMA_OBJECT_HASH_BITMAP_SIZE 256
+
+/**
+ * Assert that specified object type value is valid
+ *
+ * @param type object's implementation-defined type
+ */
+#ifndef JERRY_NDEBUG
+#define JERRY_ASSERT_OBJECT_TYPE_IS_VALID(type) \
+  JERRY_ASSERT (type == ECMA_OBJECT_TYPE_GENERAL \
+                || type == ECMA_OBJECT_TYPE_CLASS \
+                || type == ECMA_OBJECT_TYPE_FUNCTION \
+                || type == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION \
+                || type == ECMA_OBJECT_TYPE_ARRAY \
+                || type == ECMA_OBJECT_TYPE_BOUND_FUNCTION \
+                || type == ECMA_OBJECT_TYPE_PSEUDO_ARRAY);
+#else /* JERRY_NDEBUG */
+#define JERRY_ASSERT_OBJECT_TYPE_IS_VALID(type)
+#endif /* !JERRY_NDEBUG */
+
+/**
+ * [[GetOwnProperty]] ecma object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *
+ * @return pointer to a property - if it exists,
+ *         NULL (i.e. ecma-undefined) - otherwise.
+ */
+ecma_property_t
+ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
+                                 ecma_string_t *property_name_p, /**< property name */
+                                 ecma_property_ref_t *property_ref_p, /**< property reference */
+                                 uint32_t options) /**< option bits */
+{
+  JERRY_ASSERT (object_p != NULL
+                && !ecma_is_lexical_environment (object_p));
+  JERRY_ASSERT (property_name_p != NULL);
+  JERRY_ASSERT (options == ECMA_PROPERTY_GET_NO_OPTIONS || property_ref_p != NULL);
+
+  ecma_object_type_t type = ecma_get_object_type (object_p);
+
+  switch (type)
+  {
+    case ECMA_OBJECT_TYPE_CLASS:
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      if (ext_object_p->u.class_prop.class_id == LIT_MAGIC_STRING_STRING_UL)
+      {
+        if (ecma_string_is_length (property_name_p))
+        {
+          if (options & ECMA_PROPERTY_GET_VALUE)
+          {
+            ecma_value_t prim_value_p = ext_object_p->u.class_prop.u.value;
+            ecma_string_t *prim_value_str_p = ecma_get_string_from_value (prim_value_p);
+
+            ecma_length_t length = ecma_string_get_length (prim_value_str_p);
+            property_ref_p->virtual_value = ecma_make_uint32_value (length);
+          }
+
+          return ECMA_PROPERTY_TYPE_VIRTUAL;
+        }
+
+        uint32_t index = ecma_string_get_array_index (property_name_p);
+
+        if (index != ECMA_STRING_NOT_ARRAY_INDEX)
+        {
+          ecma_value_t prim_value_p = ext_object_p->u.class_prop.u.value;
+          ecma_string_t *prim_value_str_p = ecma_get_string_from_value (prim_value_p);
+
+          if (index < ecma_string_get_length (prim_value_str_p))
+          {
+            if (options & ECMA_PROPERTY_GET_VALUE)
+            {
+              ecma_char_t char_at_idx = ecma_string_get_char_at_pos (prim_value_str_p, index);
+              ecma_string_t *char_str_p = ecma_new_ecma_string_from_code_unit (char_at_idx);
+              property_ref_p->virtual_value = ecma_make_string_value (char_str_p);
+            }
+
+            return ECMA_PROPERTY_FLAG_ENUMERABLE | ECMA_PROPERTY_TYPE_VIRTUAL;
+          }
+        }
+      }
+      break;
+    }
+    case ECMA_OBJECT_TYPE_ARRAY:
+    {
+      if (ecma_string_is_length (property_name_p))
+      {
+        ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+        if (options & ECMA_PROPERTY_GET_VALUE)
+        {
+          property_ref_p->virtual_value = ecma_make_uint32_value (ext_object_p->u.array.length);
+        }
+
+        return ext_object_p->u.array.length_prop;
+      }
+      break;
+    }
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+    case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
+    {
+      /* ES2015 9.4.5.1 */
+      if (ecma_is_typedarray (ecma_make_object_value (object_p)))
+      {
+        if (ECMA_STRING_GET_CONTAINER (property_name_p) == ECMA_STRING_CONTAINER_UINT32_IN_DESC)
+        {
+          ecma_value_t value = ecma_op_typedarray_get_index_prop (object_p, property_name_p->u.uint32_number);
+
+          if (!ecma_is_value_undefined (value))
+          {
+            if (options & ECMA_PROPERTY_GET_VALUE)
+            {
+              property_ref_p->virtual_value = value;
+            }
+            else
+            {
+              ecma_fast_free_value (value);
+            }
+
+            return ECMA_PROPERTY_ENUMERABLE_WRITABLE | ECMA_PROPERTY_TYPE_VIRTUAL;
+          }
+
+          return ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP;
+        }
+
+        ecma_number_t num = ecma_string_to_number (property_name_p);
+        ecma_string_t *num_to_str = ecma_new_ecma_string_from_number (num);
+
+        if (ecma_compare_ecma_strings (property_name_p, num_to_str))
+        {
+          ecma_deref_ecma_string (num_to_str);
+
+          return ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP;
+        }
+
+        ecma_deref_ecma_string (num_to_str);
+      }
+
+      break;
+    }
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+    default:
+    {
+      break;
+    }
+  }
+
+  ecma_property_t *property_p = ecma_find_named_property (object_p, property_name_p);
+
+  if (property_p == NULL)
+  {
+    if (ecma_get_object_is_builtin (object_p))
+    {
+      property_p = ecma_builtin_try_to_instantiate_property (object_p, property_name_p);
+    }
+    else if (type == ECMA_OBJECT_TYPE_FUNCTION)
+    {
+      if (ecma_string_is_length (property_name_p))
+      {
+        if (options & ECMA_PROPERTY_GET_VALUE)
+        {
+          /* Get length virtual property. */
+          ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
+
+          const ecma_compiled_code_t *bytecode_data_p;
+          bytecode_data_p = ECMA_GET_INTERNAL_VALUE_POINTER (const ecma_compiled_code_t,
+                                                             ext_func_p->u.function.bytecode_cp);
+
+          uint32_t len;
+          if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+          {
+            cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_data_p;
+            len = args_p->argument_end;
+          }
+          else
+          {
+            cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_data_p;
+            len = args_p->argument_end;
+          }
+
+          property_ref_p->virtual_value = ecma_make_uint32_value (len);
+        }
+
+        return ECMA_PROPERTY_TYPE_VIRTUAL;
+      }
+
+      /* Get prototype physical property. */
+      property_p = ecma_op_function_try_lazy_instantiate_property (object_p, property_name_p);
+    }
+
+    if (property_p == NULL)
+    {
+      return ECMA_PROPERTY_TYPE_NOT_FOUND;
+    }
+  }
+  else if (type == ECMA_OBJECT_TYPE_PSEUDO_ARRAY
+           && property_ref_p != NULL)
+  {
+    ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+    if (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS)
+    {
+      uint32_t index = ecma_string_get_array_index (property_name_p);
+
+      if (index != ECMA_STRING_NOT_ARRAY_INDEX)
+      {
+        if (index < ext_object_p->u.pseudo_array.u1.length)
+        {
+          jmem_cpointer_t *arg_Literal_p = (jmem_cpointer_t *) (ext_object_p + 1);
+
+          if (arg_Literal_p[index] != JMEM_CP_NULL)
+          {
+            ecma_string_t *arg_name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                      arg_Literal_p[index]);
+
+            ecma_object_t *lex_env_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                                        ext_object_p->u.pseudo_array.u2.lex_env_cp);
+
+            JERRY_ASSERT (lex_env_p != NULL
+                          && ecma_is_lexical_environment (lex_env_p));
+
+            ecma_value_t binding_value = ecma_op_get_binding_value (lex_env_p, arg_name_p, true);
+
+            ecma_named_data_property_assign_value (object_p,
+                                                   ECMA_PROPERTY_VALUE_PTR (property_p),
+                                                   binding_value);
+            ecma_free_value (binding_value);
+          }
+        }
+      }
+    }
+  }
+
+  if (options & ECMA_PROPERTY_GET_EXT_REFERENCE)
+  {
+    ((ecma_extended_property_ref_t *) property_ref_p)->property_p = property_p;
+  }
+
+  if (property_ref_p != NULL)
+  {
+    property_ref_p->value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
+  }
+
+  return *property_p;
+} /* ecma_op_object_get_own_property */
+
+/**
+ * [[GetProperty]] ecma object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *
+ * @return pointer to a property - if it exists,
+ *         NULL (i.e. ecma-undefined) - otherwise.
+ */
+ecma_property_t
+ecma_op_object_get_property (ecma_object_t *object_p, /**< the object */
+                             ecma_string_t *property_name_p, /**< property name */
+                             ecma_property_ref_t *property_ref_p, /**< property reference */
+                             uint32_t options) /**< option bits */
+{
+  /* Circular reference is possible in JavaScript and testing it is complicated. */
+  int max_depth = ECMA_PROPERTY_SEARCH_DEPTH_LIMIT;
+
+  do
+  {
+    ecma_property_t property = ecma_op_object_get_own_property (object_p,
+                                                                property_name_p,
+                                                                property_ref_p,
+                                                                options);
+
+    if (property != ECMA_PROPERTY_TYPE_NOT_FOUND && property != ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP)
+    {
+      return property;
+    }
+
+    if (--max_depth == 0 || property == ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP)
+    {
+      break;
+    }
+
+    object_p = ecma_get_object_prototype (object_p);
+  }
+  while (object_p != NULL);
+
+  return ECMA_PROPERTY_TYPE_NOT_FOUND;
+} /* ecma_op_object_get_property */
+
+/**
+ * Checks whether an object (excluding prototypes) has a named property
+ *
+ * @return true - if property is found
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+ecma_op_object_has_own_property (ecma_object_t *object_p, /**< the object */
+                                 ecma_string_t *property_name_p) /**< property name */
+{
+  ecma_property_t property = ecma_op_object_get_own_property (object_p,
+                                                              property_name_p,
+                                                              NULL,
+                                                              ECMA_PROPERTY_GET_NO_OPTIONS);
+
+  return property != ECMA_PROPERTY_TYPE_NOT_FOUND && property != ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP;
+} /* ecma_op_object_has_own_property */
+
+/**
+ * Checks whether an object (including prototypes) has a named property
+ *
+ * @return true - if property is found
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+ecma_op_object_has_property (ecma_object_t *object_p, /**< the object */
+                             ecma_string_t *property_name_p) /**< property name */
+{
+  ecma_property_t property = ecma_op_object_get_property (object_p,
+                                                          property_name_p,
+                                                          NULL,
+                                                          ECMA_PROPERTY_GET_NO_OPTIONS);
+  return property != ECMA_PROPERTY_TYPE_NOT_FOUND;
+} /* ecma_op_object_has_property */
+
+/**
+ * Search the value corresponding to a property name
+ *
+ * Note: search includes prototypes
+ *
+ * @return ecma value if property is found
+ *         ECMA_SIMPLE_VALUE_NOT_FOUND if property is not found
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
+                         ecma_object_t *object_p, /**< target object */
+                         ecma_string_t *property_name_p) /**< property name */
+{
+  JERRY_ASSERT (object_p != NULL
+                && !ecma_is_lexical_environment (object_p));
+  JERRY_ASSERT (property_name_p != NULL);
+
+  ecma_object_type_t type = ecma_get_object_type (object_p);
+
+  switch (type)
+  {
+    case ECMA_OBJECT_TYPE_CLASS:
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      if (ext_object_p->u.class_prop.class_id == LIT_MAGIC_STRING_STRING_UL)
+      {
+        if (ecma_string_is_length (property_name_p))
+        {
+          ecma_value_t prim_value_p = ext_object_p->u.class_prop.u.value;
+
+          ecma_string_t *prim_value_str_p = ecma_get_string_from_value (prim_value_p);
+          ecma_length_t length = ecma_string_get_length (prim_value_str_p);
+
+          return ecma_make_uint32_value (length);
+        }
+
+        uint32_t index = ecma_string_get_array_index (property_name_p);
+
+        if (index != ECMA_STRING_NOT_ARRAY_INDEX)
+        {
+          ecma_value_t prim_value_p = ext_object_p->u.class_prop.u.value;
+
+          ecma_string_t *prim_value_str_p = ecma_get_string_from_value (prim_value_p);
+
+          if (index < ecma_string_get_length (prim_value_str_p))
+          {
+            ecma_char_t char_at_idx = ecma_string_get_char_at_pos (prim_value_str_p, index);
+            return ecma_make_string_value (ecma_new_ecma_string_from_code_unit (char_at_idx));
+          }
+        }
+      }
+
+      break;
+    }
+    case ECMA_OBJECT_TYPE_ARRAY:
+    {
+      if (ecma_string_is_length (property_name_p))
+      {
+        ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+        return ecma_make_uint32_value (ext_object_p->u.array.length);
+      }
+      break;
+    }
+    case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      if (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS)
+      {
+        uint32_t index = ecma_string_get_array_index (property_name_p);
+
+        if (index != ECMA_STRING_NOT_ARRAY_INDEX)
+        {
+          if (index < ext_object_p->u.pseudo_array.u1.length)
+          {
+            jmem_cpointer_t *arg_Literal_p = (jmem_cpointer_t *) (ext_object_p + 1);
+
+            if (arg_Literal_p[index] != JMEM_CP_NULL)
+            {
+              ecma_string_t *arg_name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                        arg_Literal_p[index]);
+
+              ecma_object_t *lex_env_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                                          ext_object_p->u.pseudo_array.u2.lex_env_cp);
+
+              JERRY_ASSERT (lex_env_p != NULL
+                            && ecma_is_lexical_environment (lex_env_p));
+
+              return ecma_op_get_binding_value (lex_env_p, arg_name_p, true);
+            }
+          }
+        }
+      }
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+      /* ES2015 9.4.5.4 */
+      if (ecma_is_typedarray (ecma_make_object_value (object_p)))
+      {
+        if (ECMA_STRING_GET_CONTAINER (property_name_p) == ECMA_STRING_CONTAINER_UINT32_IN_DESC)
+        {
+          return ecma_op_typedarray_get_index_prop (object_p, property_name_p->u.uint32_number);
+        }
+
+        ecma_number_t num = ecma_string_to_number (property_name_p);
+        ecma_string_t *num_to_str = ecma_new_ecma_string_from_number (num);
+
+        if (ecma_compare_ecma_strings (property_name_p, num_to_str))
+        {
+          ecma_deref_ecma_string (num_to_str);
+
+          return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+        }
+
+        ecma_deref_ecma_string (num_to_str);
+      }
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  ecma_property_t *property_p = ecma_find_named_property (object_p, property_name_p);
+
+  if (property_p == NULL)
+  {
+    if (ecma_get_object_is_builtin (object_p))
+    {
+      property_p = ecma_builtin_try_to_instantiate_property (object_p, property_name_p);
+    }
+    else if (type == ECMA_OBJECT_TYPE_FUNCTION)
+    {
+      if (ecma_string_is_length (property_name_p))
+      {
+        /* Get length virtual property. */
+        ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
+
+        const ecma_compiled_code_t *bytecode_data_p;
+        bytecode_data_p = ECMA_GET_INTERNAL_VALUE_POINTER (const ecma_compiled_code_t,
+                                                           ext_func_p->u.function.bytecode_cp);
+
+        uint32_t len;
+        if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+        {
+          cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_data_p;
+          len = args_p->argument_end;
+        }
+        else
+        {
+          cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_data_p;
+          len = args_p->argument_end;
+        }
+
+        return ecma_make_uint32_value (len);
+      }
+
+      /* Get prototype physical property. */
+      property_p = ecma_op_function_try_lazy_instantiate_property (object_p, property_name_p);
+    }
+
+    if (property_p == NULL)
+    {
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_NOT_FOUND);
+    }
+  }
+
+  ecma_property_value_t *prop_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
+
+  if (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA)
+  {
+    return ecma_fast_copy_value (prop_value_p->value);
+  }
+
+  JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+  ecma_object_t *getter_p = ecma_get_named_accessor_property_getter (prop_value_p);
+
+  if (getter_p == NULL)
+  {
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  }
+
+  return ecma_op_function_call (getter_p, base_value, NULL, 0);
+} /* ecma_op_object_find_own */
+
+/**
+ * Search the value corresponding to a property name
+ *
+ * Note: search includes prototypes
+ *
+ * @return ecma value if property is found
+ *         ECMA_SIMPLE_VALUE_NOT_FOUND if property is not found
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_object_find (ecma_object_t *object_p, /**< the object */
+                     ecma_string_t *property_name_p) /**< property name */
+{
+  /* Circular reference is possible in JavaScript and testing it is complicated. */
+  int max_depth = ECMA_PROPERTY_SEARCH_DEPTH_LIMIT;
+
+  ecma_value_t base_value = ecma_make_object_value (object_p);
+  do
+  {
+    ecma_value_t value = ecma_op_object_find_own (base_value, object_p, property_name_p);
+
+    if (ecma_is_value_found (value))
+    {
+      return value;
+    }
+
+    if (--max_depth == 0)
+    {
+      break;
+    }
+
+    object_p = ecma_get_object_prototype (object_p);
+  }
+  while (object_p != NULL);
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_NOT_FOUND);
+} /* ecma_op_object_find */
+
+/**
+ * Get own property by name
+ *
+ * Note: property must be an existing data property
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+inline ecma_value_t __attr_always_inline___
+ecma_op_object_get_own_data_prop (ecma_object_t *object_p, /**< the object */
+                                  ecma_string_t *property_name_p) /**< property name */
+{
+  ecma_value_t result = ecma_op_object_find_own (ecma_make_object_value (object_p),
+                                                 object_p,
+                                                 property_name_p);
+
+#ifndef JERRY_NDEBUG
+  /* Because ecma_op_object_find_own might create a property
+   * this check is executed after the function return. */
+  ecma_property_t *property_p = ecma_find_named_property (object_p,
+                                                          property_name_p);
+
+  JERRY_ASSERT (property_p != NULL
+                && ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                && !ecma_is_property_configurable (*property_p));
+#endif /* !JERRY_NDEBUG */
+
+  return result;
+} /* ecma_op_object_get_own_data_prop */
+
+/**
+ * [[Get]] ecma object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_object_get (ecma_object_t *object_p, /**< the object */
+                    ecma_string_t *property_name_p) /**< property name */
+{
+  /* Circular reference is possible in JavaScript and testing it is complicated. */
+  int max_depth = ECMA_PROPERTY_SEARCH_DEPTH_LIMIT;
+
+  ecma_value_t base_value = ecma_make_object_value (object_p);
+  do
+  {
+    ecma_value_t value = ecma_op_object_find_own (base_value, object_p, property_name_p);
+
+    if (ecma_is_value_found (value))
+    {
+      return value;
+    }
+
+    if (--max_depth == 0)
+    {
+      break;
+    }
+
+    object_p = ecma_get_object_prototype (object_p);
+  }
+  while (object_p != NULL);
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+} /* ecma_op_object_get */
+
+/**
+ * [[Put]] ecma general object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *          ECMA-262 v5, 8.12.5
+ *          Also incorporates [[CanPut]] ECMA-262 v5, 8.12.4
+ *
+ * @return ecma value
+ *         The returned value must be freed with ecma_free_value.
+ *
+ *         Returns with ECMA_SIMPLE_VALUE_TRUE if the operation is
+ *         successful. Otherwise it returns with an error object
+ *         or ECMA_SIMPLE_VALUE_FALSE.
+ *
+ *         Note: even if is_throw is false, the setter can throw an
+ *         error, and this function returns with that error.
+ */
+ecma_value_t
+ecma_op_object_put (ecma_object_t *object_p, /**< the object */
+                    ecma_string_t *property_name_p, /**< property name */
+                    ecma_value_t value, /**< ecma value */
+                    bool is_throw) /**< flag that controls failure handling */
+{
+  JERRY_ASSERT (object_p != NULL
+                && !ecma_is_lexical_environment (object_p));
+  JERRY_ASSERT (property_name_p != NULL);
+
+  ecma_object_t *setter_p = NULL;
+  ecma_object_type_t type = ecma_get_object_type (object_p);
+
+  switch (type)
+  {
+    case ECMA_OBJECT_TYPE_ARRAY:
+    {
+      if (ecma_string_is_length (property_name_p))
+      {
+        ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+        if (ecma_is_property_writable (ext_object_p->u.array.length_prop))
+        {
+          return ecma_op_array_object_set_length (object_p, value, 0);
+        }
+
+        return ecma_reject (is_throw);
+      }
+      break;
+    }
+    case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      if (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS)
+      {
+        uint32_t index = ecma_string_get_array_index (property_name_p);
+
+        if (index != ECMA_STRING_NOT_ARRAY_INDEX)
+        {
+          if (index < ext_object_p->u.pseudo_array.u1.length)
+          {
+            jmem_cpointer_t *arg_Literal_p = (jmem_cpointer_t *) (ext_object_p + 1);
+
+            if (arg_Literal_p[index] != JMEM_CP_NULL)
+            {
+              ecma_string_t *arg_name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                        arg_Literal_p[index]);
+
+              ecma_object_t *lex_env_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
+                                                                          ext_object_p->u.pseudo_array.u2.lex_env_cp);
+
+              JERRY_ASSERT (lex_env_p != NULL
+                            && ecma_is_lexical_environment (lex_env_p));
+
+              ecma_op_set_mutable_binding (lex_env_p, arg_name_p, value, true);
+              return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+            }
+          }
+        }
+      }
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+      /* ES2015 9.4.5.5 */
+      if (ecma_is_typedarray (ecma_make_object_value (object_p)))
+      {
+        if (ECMA_STRING_GET_CONTAINER (property_name_p) == ECMA_STRING_CONTAINER_UINT32_IN_DESC)
+        {
+          bool set_status = ecma_op_typedarray_set_index_prop (object_p, property_name_p->u.uint32_number, value);
+
+          if (set_status)
+          {
+            return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+          }
+
+          return ecma_reject (is_throw);
+        }
+
+        ecma_number_t num = ecma_string_to_number (property_name_p);
+        ecma_string_t *num_to_str = ecma_new_ecma_string_from_number (num);
+
+        if (ecma_compare_ecma_strings (property_name_p, num_to_str))
+        {
+          ecma_deref_ecma_string (num_to_str);
+
+          return ecma_reject (is_throw);
+        }
+
+        ecma_deref_ecma_string (num_to_str);
+      }
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  ecma_property_t *property_p = ecma_find_named_property (object_p, property_name_p);
+
+  if (property_p == NULL)
+  {
+    if (type == ECMA_OBJECT_TYPE_CLASS)
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+      if (ext_object_p->u.class_prop.class_id == LIT_MAGIC_STRING_STRING_UL)
+      {
+        uint32_t index = ecma_string_get_array_index (property_name_p);
+
+        if (index != ECMA_STRING_NOT_ARRAY_INDEX)
+        {
+          ecma_value_t prim_value_p = ext_object_p->u.class_prop.u.value;
+          ecma_string_t *prim_value_str_p = ecma_get_string_from_value (prim_value_p);
+
+          if (index < ecma_string_get_length (prim_value_str_p))
+          {
+            return ecma_reject (is_throw);
+          }
+        }
+      }
+    }
+
+    if (ecma_get_object_is_builtin (object_p))
+    {
+      property_p = ecma_builtin_try_to_instantiate_property (object_p, property_name_p);
+    }
+    else if (type == ECMA_OBJECT_TYPE_FUNCTION)
+    {
+      if (ecma_string_is_length (property_name_p))
+      {
+        return ecma_reject (is_throw);
+      }
+
+      /* Get prototype physical property. */
+      property_p = ecma_op_function_try_lazy_instantiate_property (object_p, property_name_p);
+    }
+  }
+
+  if (property_p != NULL)
+  {
+    if (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA)
+    {
+      if (ecma_is_property_writable (*property_p))
+      {
+        /* There is no need for special casing arrays here because changing the
+         * value of an existing property never changes the length of an array. */
+        ecma_named_data_property_assign_value (object_p,
+                                               ECMA_PROPERTY_VALUE_PTR (property_p),
+                                               value);
+        return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+      }
+    }
+    else
+    {
+      JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+      setter_p = ecma_get_named_accessor_property_setter (ECMA_PROPERTY_VALUE_PTR (property_p));
+    }
+  }
+  else
+  {
+    ecma_object_t *proto_p = ecma_get_object_prototype (object_p);
+    bool create_new_property = true;
+
+    if (proto_p != NULL)
+    {
+      ecma_property_ref_t property_ref = { NULL };
+
+      ecma_property_t inherited_property = ecma_op_object_get_property (proto_p,
+                                                                        property_name_p,
+                                                                        &property_ref,
+                                                                        ECMA_PROPERTY_GET_NO_OPTIONS);
+
+      if (inherited_property != ECMA_PROPERTY_TYPE_NOT_FOUND)
+      {
+        if (ECMA_PROPERTY_GET_TYPE (inherited_property) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
+        {
+          setter_p = ecma_get_named_accessor_property_setter (property_ref.value_p);
+          create_new_property = false;
+        }
+        else
+        {
+          create_new_property = ecma_is_property_writable (inherited_property);
+        }
+      }
+    }
+
+    if (create_new_property
+        && ecma_get_object_extensible (object_p))
+    {
+      const ecma_object_type_t obj_type = ecma_get_object_type (object_p);
+
+      if (obj_type == ECMA_OBJECT_TYPE_PSEUDO_ARRAY)
+      {
+        ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+        if (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS)
+        {
+          return ecma_builtin_helper_def_prop (object_p,
+                                               property_name_p,
+                                               value,
+                                               true, /* Writable */
+                                               true, /* Enumerable */
+                                               true, /* Configurable */
+                                               is_throw); /* Failure handling */
+        }
+      }
+
+      uint32_t index = ecma_string_get_array_index (property_name_p);
+
+      if (obj_type == ECMA_OBJECT_TYPE_ARRAY
+          && index != ECMA_STRING_NOT_ARRAY_INDEX)
+      {
+        ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+        if (index < UINT32_MAX
+            && index >= ext_object_p->u.array.length)
+        {
+          if (!ecma_is_property_writable (ext_object_p->u.array.length_prop))
+          {
+            return ecma_reject (is_throw);
+          }
+
+          ext_object_p->u.array.length = index + 1;
+        }
+      }
+
+      ecma_property_value_t *new_prop_value_p;
+      new_prop_value_p = ecma_create_named_data_property (object_p,
+                                                          property_name_p,
+                                                          ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
+                                                          NULL);
+
+      JERRY_ASSERT (ecma_is_value_undefined (new_prop_value_p->value));
+      new_prop_value_p->value = ecma_copy_value_if_not_object (value);
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+    }
+  }
+
+  if (setter_p == NULL)
+  {
+    return ecma_reject (is_throw);
+  }
+
+  ecma_value_t ret_value = ecma_op_function_call (setter_p,
+                                                  ecma_make_object_value (object_p),
+                                                  &value,
+                                                  1);
+
+  if (!ECMA_IS_VALUE_ERROR (ret_value))
+  {
+    ecma_fast_free_value (ret_value);
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+
+  return ret_value;
+} /* ecma_op_object_put */
+
+/**
+ * [[Delete]] ecma object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *
+ * Note:
+ *      returned value must be freed with ecma_free_value
+ *
+ * @return true - if deleted successfully
+ *         false - or type error otherwise (based in 'is_throw')
+ */
+ecma_value_t
+ecma_op_object_delete (ecma_object_t *obj_p, /**< the object */
+                       ecma_string_t *property_name_p, /**< property name */
+                       bool is_throw) /**< flag that controls failure handling */
+{
+  JERRY_ASSERT (obj_p != NULL
+                && !ecma_is_lexical_environment (obj_p));
+  JERRY_ASSERT (property_name_p != NULL);
+
+  const ecma_object_type_t type = ecma_get_object_type (obj_p);
+
+  switch (type)
+  {
+    case ECMA_OBJECT_TYPE_GENERAL:
+    case ECMA_OBJECT_TYPE_CLASS:
+    case ECMA_OBJECT_TYPE_FUNCTION:
+    case ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION:
+    case ECMA_OBJECT_TYPE_ARRAY:
+    case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
+    {
+      return ecma_op_general_object_delete (obj_p,
+                                            property_name_p,
+                                            is_throw);
+    }
+
+    case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+      if (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS)
+      {
+        return ecma_op_arguments_object_delete (obj_p,
+                                                property_name_p,
+                                                is_throw);
+      }
+      else
+      {
+        return ecma_op_general_object_delete (obj_p,
+                                              property_name_p,
+                                              is_throw);
+      }
+
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (false);
+
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+    }
+  }
+} /* ecma_op_object_delete */
+
+/**
+ * [[DefaultValue]] ecma object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_object_default_value (ecma_object_t *obj_p, /**< the object */
+                              ecma_preferred_type_hint_t hint) /**< hint on preferred result type */
+{
+  JERRY_ASSERT (obj_p != NULL
+                && !ecma_is_lexical_environment (obj_p));
+
+  JERRY_ASSERT_OBJECT_TYPE_IS_VALID (ecma_get_object_type (obj_p));
+
+  /*
+   * typedef ecma_property_t * (*default_value_ptr_t) (ecma_object_t *, ecma_string_t *);
+   * static const default_value_ptr_t default_value [ECMA_OBJECT_TYPE__COUNT] =
+   * {
+   *   [ECMA_OBJECT_TYPE_GENERAL]           = &ecma_op_general_object_default_value,
+   *   [ECMA_OBJECT_TYPE_CLASS]             = &ecma_op_general_object_default_value,
+   *   [ECMA_OBJECT_TYPE_FUNCTION]          = &ecma_op_general_object_default_value,
+   *   [ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION] = &ecma_op_general_object_default_value,
+   *   [ECMA_OBJECT_TYPE_ARRAY]             = &ecma_op_general_object_default_value,
+   *   [ECMA_OBJECT_TYPE_BOUND_FUNCTION]    = &ecma_op_general_object_default_value,
+   *   [ECMA_OBJECT_TYPE_PSEUDO_ARRAY]      = &ecma_op_general_object_default_value
+   * };
+   *
+   * return default_value[type] (obj_p, property_name_p);
+   */
+
+  return ecma_op_general_object_default_value (obj_p, hint);
+} /* ecma_op_object_default_value */
+
+/**
+ * [[DefineOwnProperty]] ecma object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_object_define_own_property (ecma_object_t *obj_p, /**< the object */
+                                    ecma_string_t *property_name_p, /**< property name */
+                                    const ecma_property_descriptor_t *property_desc_p, /**< property
+                                                                                        *   descriptor */
+                                    bool is_throw) /**< flag that controls failure handling */
+{
+  JERRY_ASSERT (obj_p != NULL
+                && !ecma_is_lexical_environment (obj_p));
+  JERRY_ASSERT (property_name_p != NULL);
+
+  const ecma_object_type_t type = ecma_get_object_type (obj_p);
+
+  switch (type)
+  {
+    case ECMA_OBJECT_TYPE_GENERAL:
+    case ECMA_OBJECT_TYPE_CLASS:
+    case ECMA_OBJECT_TYPE_FUNCTION:
+    case ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION:
+    case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
+    {
+      return ecma_op_general_object_define_own_property (obj_p,
+                                                         property_name_p,
+                                                         property_desc_p,
+                                                         is_throw);
+    }
+
+    case ECMA_OBJECT_TYPE_ARRAY:
+    {
+      return ecma_op_array_object_define_own_property (obj_p,
+                                                       property_name_p,
+                                                       property_desc_p,
+                                                       is_throw);
+    }
+
+    case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+      if (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS)
+      {
+        return ecma_op_arguments_object_define_own_property (obj_p,
+                                                             property_name_p,
+                                                             property_desc_p,
+                                                             is_throw);
+      }
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+      /* ES2015 9.4.5.3 */
+      if (ecma_is_typedarray (ecma_make_object_value (obj_p)))
+      {
+        if (ECMA_STRING_GET_CONTAINER (property_name_p) == ECMA_STRING_CONTAINER_UINT32_IN_DESC)
+        {
+          bool define_status = ecma_op_typedarray_define_index_prop (obj_p,
+                                                                     property_name_p->u.uint32_number,
+                                                                     property_desc_p);
+
+          if (define_status)
+          {
+            return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+          }
+
+          return ecma_reject (is_throw);
+        }
+
+        ecma_number_t num = ecma_string_to_number (property_name_p);
+        ecma_string_t *num_to_str = ecma_new_ecma_string_from_number (num);
+
+        if (ecma_compare_ecma_strings (property_name_p, num_to_str))
+        {
+          ecma_deref_ecma_string (num_to_str);
+
+          return ecma_reject (is_throw);
+        }
+
+        ecma_deref_ecma_string (num_to_str);
+      }
+
+      return ecma_op_general_object_define_own_property (obj_p,
+                                                         property_name_p,
+                                                         property_desc_p,
+                                                         is_throw);
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+      break;
+    }
+    default:
+    {
+      JERRY_ASSERT (false);
+    }
+  }
+
+  JERRY_UNREACHABLE ();
+
+  return ecma_reject (is_throw);
+} /* ecma_op_object_define_own_property */
+
+/**
+ * Get property descriptor from specified property
+ *
+ * depending on the property type the following fields are set:
+ *   - for named data properties: { [Value], [Writable], [Enumerable], [Configurable] };
+ *   - for named accessor properties: { [Get] - if defined,
+ *                                      [Set] - if defined,
+ *                                      [Enumerable], [Configurable]
+ *                                    }.
+ *
+ * @return true - if property found
+ *         false - otherwise
+ */
+bool
+ecma_op_object_get_own_property_descriptor (ecma_object_t *object_p, /**< the object */
+                                            ecma_string_t *property_name_p, /**< property name */
+                                            ecma_property_descriptor_t *prop_desc_p) /**< property descriptor */
+{
+  ecma_property_ref_t property_ref;
+
+  ecma_property_t property = ecma_op_object_get_own_property (object_p,
+                                                              property_name_p,
+                                                              &property_ref,
+                                                              ECMA_PROPERTY_GET_VALUE);
+
+  if (property == ECMA_PROPERTY_TYPE_NOT_FOUND || property == ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP)
+  {
+    return false;
+  }
+
+  *prop_desc_p = ecma_make_empty_property_descriptor ();
+
+  prop_desc_p->is_enumerable = ecma_is_property_enumerable (property);
+  prop_desc_p->is_enumerable_defined = true;
+  prop_desc_p->is_configurable = ecma_is_property_configurable (property);
+  prop_desc_p->is_configurable_defined = true;
+
+  ecma_property_types_t type = ECMA_PROPERTY_GET_TYPE (property);
+
+  if (type != ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
+  {
+    if (type == ECMA_PROPERTY_TYPE_NAMEDDATA)
+    {
+      prop_desc_p->value = ecma_copy_value (property_ref.value_p->value);
+    }
+    else
+    {
+      JERRY_ASSERT (type == ECMA_PROPERTY_TYPE_VIRTUAL);
+      prop_desc_p->value = property_ref.virtual_value;
+    }
+
+    prop_desc_p->is_value_defined = true;
+    prop_desc_p->is_writable = ecma_is_property_writable (property);
+    prop_desc_p->is_writable_defined = true;
+  }
+  else
+  {
+    prop_desc_p->get_p = ecma_get_named_accessor_property_getter (property_ref.value_p);
+    prop_desc_p->is_get_defined = true;
+
+    if (prop_desc_p->get_p != NULL)
+    {
+      ecma_ref_object (prop_desc_p->get_p);
+    }
+
+    prop_desc_p->set_p = ecma_get_named_accessor_property_setter (property_ref.value_p);
+    prop_desc_p->is_set_defined = true;
+
+    if (prop_desc_p->set_p != NULL)
+    {
+      ecma_ref_object (prop_desc_p->set_p);
+    }
+  }
+
+  return true;
+} /* ecma_op_object_get_own_property_descriptor */
+
+/**
+ * [[HasInstance]] ecma object's operation
+ *
+ * See also:
+ *          ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 9
+ */
+ecma_value_t
+ecma_op_object_has_instance (ecma_object_t *obj_p, /**< the object */
+                             ecma_value_t value) /**< argument 'V' */
+{
+  JERRY_ASSERT (obj_p != NULL
+                && !ecma_is_lexical_environment (obj_p));
+
+  const ecma_object_type_t type = ecma_get_object_type (obj_p);
+
+  switch (type)
+  {
+    case ECMA_OBJECT_TYPE_GENERAL:
+    case ECMA_OBJECT_TYPE_CLASS:
+    case ECMA_OBJECT_TYPE_ARRAY:
+    case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG ("Expected a function object."));
+    }
+
+    case ECMA_OBJECT_TYPE_FUNCTION:
+    case ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION:
+    case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
+    {
+      return ecma_op_function_has_instance (obj_p, value);
+    }
+
+    default:
+    {
+      JERRY_UNREACHABLE ();
+      break;
+    }
+  }
+} /* ecma_op_object_has_instance */
+
+/**
+ * Object's isPrototypeOf operation
+ *
+ * See also:
+ *          ECMA-262 v5, 15.2.4.6; 3
+ *
+ * @return true - if the target object is prototype of the base object
+ *         false - if the target object is not prototype of the base object
+ */
+bool
+ecma_op_object_is_prototype_of (ecma_object_t *base_p, /**< base object */
+                                ecma_object_t *target_p) /**< target object */
+{
+  do
+  {
+    target_p = ecma_get_object_prototype (target_p);
+    if (target_p == NULL)
+    {
+      return false;
+    }
+    else if (target_p == base_p)
+    {
+      return true;
+    }
+  } while (true);
+} /* ecma_op_object_is_prototype_of */
+
+/**
+ * Get collection of property names
+ *
+ * Order of names in the collection:
+ *  - integer indices in ascending order
+ *  - other indices in creation order (for built-ins: the order of the properties are listed in specification).
+ *
+ * Note:
+ *      Implementation of the routine assumes that new properties are appended to beginning of corresponding object's
+ *      property list, and the list is not reordered (in other words, properties are stored in order that is reversed
+ *      to the properties' addition order).
+ *
+ * @return collection of strings - property names
+ */
+ecma_collection_header_t *
+ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
+                                   bool is_array_indices_only, /**< true - exclude properties with names
+                                                                *          that are not indices */
+                                   bool is_enumerable_only, /**< true - exclude non-enumerable properties */
+                                   bool is_with_prototype_chain) /**< true - list properties from prototype chain,
+                                                                  *   false - list only own properties */
+{
+  JERRY_ASSERT (obj_p != NULL
+                && !ecma_is_lexical_environment (obj_p));
+
+  ecma_collection_header_t *ret_p = ecma_new_strings_collection (NULL, 0);
+  ecma_collection_header_t *skipped_non_enumerable_p = ecma_new_strings_collection (NULL, 0);
+
+  const ecma_object_type_t type = ecma_get_object_type (obj_p);
+  const bool obj_is_builtin = ecma_get_object_is_builtin (obj_p);
+
+  const size_t bitmap_row_size = sizeof (uint32_t) * JERRY_BITSINBYTE;
+  uint32_t names_hashes_bitmap[ECMA_OBJECT_HASH_BITMAP_SIZE / bitmap_row_size];
+
+  memset (names_hashes_bitmap, 0, sizeof (names_hashes_bitmap));
+
+  for (ecma_object_t *prototype_chain_iter_p = obj_p;
+       prototype_chain_iter_p != NULL;
+       prototype_chain_iter_p = is_with_prototype_chain ? ecma_get_object_prototype (prototype_chain_iter_p)
+                                                        : NULL)
+  {
+    ecma_length_t string_named_properties_count = 0;
+    ecma_length_t array_index_named_properties_count = 0;
+
+    ecma_collection_header_t *prop_names_p = ecma_new_strings_collection (NULL, 0);
+
+    if (obj_is_builtin)
+    {
+      ecma_builtin_list_lazy_property_names (obj_p,
+                                             is_enumerable_only,
+                                             prop_names_p,
+                                             skipped_non_enumerable_p);
+    }
+    else
+    {
+      switch (type)
+      {
+        case ECMA_OBJECT_TYPE_GENERAL:
+        case ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION:
+        case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
+        {
+          break;
+        }
+        case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
+        {
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+          if (ecma_is_typedarray (ecma_make_object_value (obj_p)))
+          {
+            ecma_op_typedarray_list_lazy_property_names (obj_p, prop_names_p);
+          }
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+          break;
+        }
+        case ECMA_OBJECT_TYPE_FUNCTION:
+        {
+          ecma_op_function_list_lazy_property_names (is_enumerable_only,
+                                                     prop_names_p,
+                                                     skipped_non_enumerable_p);
+          break;
+        }
+        case ECMA_OBJECT_TYPE_CLASS:
+        {
+          ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+          if (ext_object_p->u.class_prop.class_id == LIT_MAGIC_STRING_STRING_UL)
+          {
+            ecma_op_string_list_lazy_property_names (obj_p,
+                                                     is_enumerable_only,
+                                                     prop_names_p,
+                                                     skipped_non_enumerable_p);
+          }
+
+          break;
+        }
+        case ECMA_OBJECT_TYPE_ARRAY:
+        {
+          ecma_op_array_list_lazy_property_names (obj_p,
+                                                  is_enumerable_only,
+                                                  prop_names_p,
+                                                  skipped_non_enumerable_p);
+          break;
+        }
+        default:
+        {
+          JERRY_UNREACHABLE ();
+          break;
+        }
+      }
+    }
+
+    ecma_collection_iterator_t iter;
+    ecma_collection_iterator_init (&iter, prop_names_p);
+
+    uint32_t own_names_hashes_bitmap[ECMA_OBJECT_HASH_BITMAP_SIZE / bitmap_row_size];
+    memset (own_names_hashes_bitmap, 0, sizeof (own_names_hashes_bitmap));
+
+    while (ecma_collection_iterator_next (&iter))
+    {
+      ecma_string_t *name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+      uint8_t hash = (uint8_t) name_p->hash;
+      uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
+      uint32_t bitmap_column = (uint32_t) (hash % bitmap_row_size);
+
+      if ((own_names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) == 0)
+      {
+        own_names_hashes_bitmap[bitmap_row] |= (1u << bitmap_column);
+      }
+    }
+
+    ecma_property_header_t *prop_iter_p = ecma_get_property_list (prototype_chain_iter_p);
+
+    if (prop_iter_p != NULL && prop_iter_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
+    {
+      prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                      prop_iter_p->next_property_cp);
+    }
+
+    while (prop_iter_p != NULL)
+    {
+      JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (prop_iter_p));
+
+      for (int i = 0; i < ECMA_PROPERTY_PAIR_ITEM_COUNT; i++)
+      {
+        ecma_property_t *property_p = prop_iter_p->types + i;
+
+        if (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA
+            || ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
+        {
+          ecma_property_pair_t *prop_pair_p = (ecma_property_pair_t *) prop_iter_p;
+
+          if (ECMA_PROPERTY_GET_NAME_TYPE (*property_p) == ECMA_STRING_CONTAINER_MAGIC_STRING
+              && prop_pair_p->names_cp[i] >= LIT_NON_INTERNAL_MAGIC_STRING__COUNT)
+          {
+            /* Internal properties are never enumerated. */
+            continue;
+          }
+
+          ecma_string_t *name_p = ecma_string_from_property_name (*property_p,
+                                                                  prop_pair_p->names_cp[i]);
+
+          if (!(is_enumerable_only && !ecma_is_property_enumerable (*property_p)))
+          {
+            uint8_t hash = (uint8_t) name_p->hash;
+            uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
+            uint32_t bitmap_column = (uint32_t) (hash % bitmap_row_size);
+
+            bool is_add = true;
+
+            if ((own_names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) != 0)
+            {
+              ecma_collection_iterator_init (&iter, prop_names_p);
+
+              while (ecma_collection_iterator_next (&iter))
+              {
+                ecma_string_t *name2_p = ecma_get_string_from_value (*iter.current_value_p);
+
+                if (ecma_compare_ecma_strings (name_p, name2_p))
+                {
+                  is_add = false;
+                  break;
+                }
+              }
+            }
+
+            if (is_add)
+            {
+              own_names_hashes_bitmap[bitmap_row] |= (1u << bitmap_column);
+
+              ecma_append_to_values_collection (prop_names_p,
+                                                ecma_make_string_value (name_p),
+                                                true);
+            }
+          }
+          else
+          {
+            JERRY_ASSERT (is_enumerable_only && !ecma_is_property_enumerable (*property_p));
+
+            ecma_append_to_values_collection (skipped_non_enumerable_p,
+                                              ecma_make_string_value (name_p),
+                                              true);
+
+            uint8_t hash = (uint8_t) name_p->hash;
+            uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
+            uint32_t bitmap_column = (uint32_t) (hash % bitmap_row_size);
+
+            if ((names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) == 0)
+            {
+              names_hashes_bitmap[bitmap_row] |= (1u << bitmap_column);
+            }
+          }
+
+          ecma_deref_ecma_string (name_p);
+        }
+      }
+
+      prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
+                                      prop_iter_p->next_property_cp);
+    }
+
+    ecma_collection_iterator_init (&iter, prop_names_p);
+    while (ecma_collection_iterator_next (&iter))
+    {
+      ecma_string_t *name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+      uint32_t index = ecma_string_get_array_index (name_p);
+
+      if (index != ECMA_STRING_NOT_ARRAY_INDEX)
+      {
+        /* The name is a valid array index. */
+        array_index_named_properties_count++;
+      }
+      else if (!is_array_indices_only)
+      {
+        string_named_properties_count++;
+      }
+    }
+
+    /* Second pass: collecting properties names into arrays */
+    JMEM_DEFINE_LOCAL_ARRAY (names_p,
+                             array_index_named_properties_count + string_named_properties_count,
+                             ecma_string_t *);
+    JMEM_DEFINE_LOCAL_ARRAY (array_index_names_p, array_index_named_properties_count, uint32_t);
+
+    uint32_t name_pos = array_index_named_properties_count + string_named_properties_count;
+    uint32_t array_index_name_pos = 0;
+
+    ecma_collection_iterator_init (&iter, prop_names_p);
+    while (ecma_collection_iterator_next (&iter))
+    {
+      ecma_string_t *name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+      uint32_t index = ecma_string_get_array_index (name_p);
+
+      if (index != ECMA_STRING_NOT_ARRAY_INDEX)
+      {
+        JERRY_ASSERT (array_index_name_pos < array_index_named_properties_count);
+
+        uint32_t insertion_pos = 0;
+        while (insertion_pos < array_index_name_pos
+               && index < array_index_names_p[insertion_pos])
+        {
+          insertion_pos++;
+        }
+
+        if (insertion_pos == array_index_name_pos)
+        {
+          array_index_names_p[array_index_name_pos++] = index;
+        }
+        else
+        {
+          JERRY_ASSERT (insertion_pos < array_index_name_pos);
+          JERRY_ASSERT (index >= array_index_names_p[insertion_pos]);
+
+          uint32_t move_pos = array_index_name_pos++;
+
+          while (move_pos > insertion_pos)
+          {
+            array_index_names_p[move_pos] = array_index_names_p[move_pos - 1u];
+
+            move_pos--;
+          }
+
+          array_index_names_p[insertion_pos] = index;
+        }
+      }
+      else if (!is_array_indices_only)
+      {
+        /*
+         * Filling from end to begin, as list of object's properties is sorted
+         * in order that is reverse to properties creation order
+         */
+
+        JERRY_ASSERT (name_pos > 0
+                      && name_pos <= array_index_named_properties_count + string_named_properties_count);
+        ecma_ref_ecma_string (name_p);
+        names_p[--name_pos] = name_p;
+      }
+    }
+
+    for (uint32_t i = 0; i < array_index_named_properties_count; i++)
+    {
+      JERRY_ASSERT (name_pos > 0
+                    && name_pos <= array_index_named_properties_count + string_named_properties_count);
+      names_p[--name_pos] = ecma_new_ecma_string_from_uint32 (array_index_names_p[i]);
+    }
+
+    JERRY_ASSERT (name_pos == 0);
+
+    JMEM_FINALIZE_LOCAL_ARRAY (array_index_names_p);
+
+    ecma_free_values_collection (prop_names_p, true);
+
+    /* Third pass:
+     *   embedding own property names of current object of prototype chain to aggregate property names collection */
+    for (uint32_t i = 0;
+         i < array_index_named_properties_count + string_named_properties_count;
+         i++)
+    {
+      bool is_append;
+
+      ecma_string_t *name_p = names_p[i];
+
+      uint8_t hash = (uint8_t) name_p->hash;
+      uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
+      uint32_t bitmap_column = (uint32_t) (hash % bitmap_row_size);
+
+      if ((names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) == 0)
+      {
+        /* no name with the hash is in constructed collection */
+        is_append = true;
+
+        names_hashes_bitmap[bitmap_row] |= (1u << bitmap_column);
+      }
+      else
+      {
+        /* name with same hash already occured */
+        bool is_equal_found = false;
+
+        ecma_collection_iterator_init (&iter, ret_p);
+
+        while (ecma_collection_iterator_next (&iter))
+        {
+          ecma_string_t *iter_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+          if (ecma_compare_ecma_strings (name_p, iter_name_p))
+          {
+            is_equal_found = true;
+          }
+        }
+
+        ecma_collection_iterator_init (&iter, skipped_non_enumerable_p);
+        while (ecma_collection_iterator_next (&iter))
+        {
+          ecma_string_t *iter_name_p = ecma_get_string_from_value (*iter.current_value_p);
+
+          if (ecma_compare_ecma_strings (name_p, iter_name_p))
+          {
+            is_equal_found = true;
+          }
+        }
+
+        is_append = !is_equal_found;
+      }
+
+      if (is_append)
+      {
+        JERRY_ASSERT ((names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) != 0);
+
+        ecma_append_to_values_collection (ret_p, ecma_make_string_value (names_p[i]), true);
+      }
+
+      ecma_deref_ecma_string (name_p);
+    }
+
+    JMEM_FINALIZE_LOCAL_ARRAY (names_p);
+  }
+
+  ecma_free_values_collection (skipped_non_enumerable_p, true);
+
+  return ret_p;
+} /* ecma_op_object_get_property_names */
+
+/**
+ * The function is used in the assert of ecma_object_get_class_name
+ */
+inline static bool
+ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */
+{
+#ifndef JERRY_NDEBUG
+  return (ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_GLOBAL)
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_PROMISE_PROTOTYPE)
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE)
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE)
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_INT8ARRAY_PROTOTYPE)
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_UINT8ARRAY_PROTOTYPE)
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_INT16ARRAY_PROTOTYPE)
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_UINT16ARRAY_PROTOTYPE)
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_INT32ARRAY_PROTOTYPE)
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE)
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE)
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE)
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE)
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+          || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_OBJECT_PROTOTYPE));
+#else /* JERRY_NDEBUG */
+  JERRY_UNUSED (obj_p);
+  return true;
+#endif /* !JERRY_NDEBUG */
+} /* ecma_object_check_class_name_is_object */
+
+/**
+ * Get [[Class]] string of specified object
+ *
+ * @return class name magic string
+ */
+lit_magic_string_id_t
+ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
+{
+  ecma_object_type_t type = ecma_get_object_type (obj_p);
+
+  switch (type)
+  {
+    case ECMA_OBJECT_TYPE_ARRAY:
+    {
+      return LIT_MAGIC_STRING_ARRAY_UL;
+    }
+    case ECMA_OBJECT_TYPE_CLASS:
+    {
+      ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+      return ext_object_p->u.class_prop.class_id;
+    }
+    case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
+    {
+      ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) obj_p;
+
+      switch (ext_obj_p->u.pseudo_array.type)
+      {
+        case ECMA_PSEUDO_ARRAY_ARGUMENTS:
+        {
+          return LIT_MAGIC_STRING_ARGUMENTS_UL;
+        }
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+        case ECMA_PSEUDO_ARRAY_TYPEDARRAY:
+        case ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO:
+        {
+          return ext_obj_p->u.pseudo_array.u1.class_id;
+        }
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+        default:
+        {
+          JERRY_UNREACHABLE ();
+        }
+      }
+
+      JERRY_UNREACHABLE ();
+      break;
+    }
+    case ECMA_OBJECT_TYPE_FUNCTION:
+    case ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION:
+    case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
+    {
+      return LIT_MAGIC_STRING_FUNCTION_UL;
+    }
+    default:
+    {
+      JERRY_ASSERT (type == ECMA_OBJECT_TYPE_GENERAL);
+
+      if (ecma_get_object_is_builtin (obj_p))
+      {
+        ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) obj_p;
+
+        switch (ext_obj_p->u.built_in.id)
+        {
+#ifndef CONFIG_DISABLE_MATH_BUILTIN
+          case ECMA_BUILTIN_ID_MATH:
+          {
+            return LIT_MAGIC_STRING_MATH_UL;
+          }
+#endif /* !CONFIG_DISABLE_MATH_BUILTIN */
+#ifndef CONFIG_DISABLE_JSON_BUILTIN
+          case ECMA_BUILTIN_ID_JSON:
+          {
+            return LIT_MAGIC_STRING_JSON_U;
+          }
+#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
+#ifndef CONFIG_DISABLE_ERROR_BUILTINS
+          case ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE:
+          case ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE:
+          case ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE:
+          case ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE:
+          case ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE:
+          case ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE:
+#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
+          case ECMA_BUILTIN_ID_ERROR_PROTOTYPE:
+          {
+            return LIT_MAGIC_STRING_ERROR_UL;
+          }
+          default:
+          {
+            JERRY_ASSERT (ecma_object_check_class_name_is_object (obj_p));
+
+            return LIT_MAGIC_STRING_OBJECT_UL;
+          }
+        }
+      }
+      else
+      {
+        return LIT_MAGIC_STRING_OBJECT_UL;
+      }
+    }
+  }
+} /* ecma_object_get_class_name */
+
+/**
+ * Get value of an object if the class matches
+ *
+ * @return value of the object if the class matches
+ *         ECMA_SIMPLE_VALUE_NOT_FOUND otherwise
+ */
+inline bool __attr_always_inline___
+ecma_object_class_is (ecma_object_t *object_p, /**< object */
+                      uint32_t class_id) /**< class id */
+{
+  if (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_CLASS)
+  {
+    ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+    if (ext_object_p->u.class_prop.class_id == class_id)
+    {
+      return true;
+    }
+  }
+
+  return false;
+} /* ecma_object_class_is */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-objects.h b/deps/jerry/jerry-core/ecma/operations/ecma-objects.h
new file mode 100644 (file)
index 0000000..26c6b35
--- /dev/null
@@ -0,0 +1,60 @@
+/* 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.
+ */
+
+#ifndef ECMA_OBJECTS_H
+#define ECMA_OBJECTS_H
+
+#include "ecma-conversion.h"
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaobjectsinternalops ECMA objects' operations
+ * @{
+ */
+
+ecma_property_t ecma_op_object_get_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p,
+                                                 ecma_property_ref_t *property_ref_p, uint32_t options);
+ecma_property_t ecma_op_object_get_property (ecma_object_t *object_p, ecma_string_t *property_name_p,
+                                             ecma_property_ref_t *property_ref_p, uint32_t options);
+bool ecma_op_object_has_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p);
+bool ecma_op_object_has_property (ecma_object_t *object_p, ecma_string_t *property_name_p);
+ecma_value_t ecma_op_object_find_own (ecma_value_t base_value, ecma_object_t *object_p, ecma_string_t *property_name_p);
+ecma_value_t ecma_op_object_find (ecma_object_t *object_p, ecma_string_t *property_name_p);
+ecma_value_t ecma_op_object_get_own_data_prop (ecma_object_t *object_p, ecma_string_t *property_name_p);
+ecma_value_t ecma_op_object_get (ecma_object_t *object_p, ecma_string_t *property_name_p);
+ecma_value_t ecma_op_object_put (ecma_object_t *object_p, ecma_string_t *property_name_p, ecma_value_t value,
+                                 bool is_throw);
+ecma_value_t ecma_op_object_delete (ecma_object_t *obj_p, ecma_string_t *property_name_p, bool is_throw);
+ecma_value_t ecma_op_object_default_value (ecma_object_t *obj_p, ecma_preferred_type_hint_t hint);
+ecma_value_t ecma_op_object_define_own_property (ecma_object_t *obj_p, ecma_string_t *property_name_p,
+                                                 const ecma_property_descriptor_t *property_desc_p, bool is_throw);
+bool ecma_op_object_get_own_property_descriptor (ecma_object_t *object_p, ecma_string_t *property_name_p,
+                                                 ecma_property_descriptor_t *prop_desc_p);
+ecma_value_t ecma_op_object_has_instance (ecma_object_t *obj_p, ecma_value_t value);
+bool ecma_op_object_is_prototype_of (ecma_object_t *base_p, ecma_object_t *target_p);
+ecma_collection_header_t * ecma_op_object_get_property_names (ecma_object_t *obj_p, bool is_array_indices_only,
+                                                              bool is_enumerable_only, bool is_with_prototype_chain);
+
+lit_magic_string_id_t ecma_object_get_class_name (ecma_object_t *obj_p);
+bool ecma_object_class_is (ecma_object_t *object_p, uint32_t class_id);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_OBJECTS_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-promise-object.c b/deps/jerry/jerry-core/ecma/operations/ecma-promise-object.c
new file mode 100644 (file)
index 0000000..35bbc7c
--- /dev/null
@@ -0,0 +1,775 @@
+/* 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.
+ */
+
+#include "ecma-boolean-object.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-jobqueue.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+#include "ecma-promise-object.h"
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmapromiseobject ECMA Promise object related routines
+ * @{
+ */
+
+/**
+ * Check if an object is promise.
+ *
+ * @return true - if the object is a promise.
+ *         false - otherwise.
+ */
+inline bool __attr_always_inline___
+ecma_is_promise (ecma_object_t *obj_p) /**< points to object */
+{
+  return ecma_object_class_is (obj_p, LIT_MAGIC_STRING_PROMISE_UL);
+} /* ecma_is_promise */
+
+/**
+ * Get the result of the promise.
+ *
+ * @return ecma value of the promise result.
+ *         Returned value must be freed with ecma_free_value
+ */
+inline ecma_value_t
+ecma_promise_get_result (ecma_object_t *obj_p) /**< points to promise object */
+{
+  JERRY_ASSERT (ecma_is_promise (obj_p));
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+  return ecma_copy_value (ext_object_p->u.class_prop.u.value);
+} /* ecma_promise_get_result */
+
+/**
+ * Set the PromiseResult of promise.
+ */
+inline void __attr_always_inline___
+ecma_promise_set_result (ecma_object_t *obj_p, /**< points to promise object */
+                         ecma_value_t result) /**< the result value */
+{
+  JERRY_ASSERT (ecma_is_promise (obj_p));
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+  JERRY_ASSERT (ext_object_p->u.class_prop.u.value == ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED));
+
+  ext_object_p->u.class_prop.u.value = result;
+} /* ecma_promise_set_result */
+
+/**
+ * Get the PromiseState of promise.
+ *
+ * @return the state's enum value
+ */
+inline uint8_t __attr_always_inline___
+ecma_promise_get_state (ecma_object_t *obj_p) /**< points to promise object */
+{
+  JERRY_ASSERT (ecma_is_promise (obj_p));
+
+  return ((ecma_promise_object_t *) obj_p)->state;
+} /* ecma_promise_get_state */
+
+/**
+ * Set the PromiseState of promise.
+ */
+inline void __attr_always_inline___
+ecma_promise_set_state (ecma_object_t *obj_p, /**< points to promise object */
+                        uint8_t state) /**< the state */
+{
+  JERRY_ASSERT (ecma_is_promise (obj_p));
+
+  ((ecma_promise_object_t *) obj_p)->state = state;
+} /* ecma_promise_set_state */
+
+/**
+ * Get the bool value of alreadyResolved.
+ *
+ * @return bool value of alreadyResolved.
+ */
+static bool
+ecma_get_already_resolved_bool_value (ecma_value_t already_resolved) /**< the alreadyResolved */
+{
+  JERRY_ASSERT (ecma_is_value_object (already_resolved));
+
+  ecma_object_t *already_resolved_p = ecma_get_object_from_value (already_resolved);
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) already_resolved_p;
+
+  JERRY_ASSERT (ext_object_p->u.class_prop.class_id == LIT_MAGIC_STRING_BOOLEAN_UL);
+
+  return ext_object_p->u.class_prop.u.value == ecma_make_boolean_value (true);
+} /* ecma_get_already_resolved_bool_value */
+
+/**
+ * Set the value of alreadyResolved.
+ */
+static void
+ecma_set_already_resolved_value (ecma_value_t already_resolved, /**< the alreadyResolved */
+                                 bool value) /**< the value to set */
+{
+  JERRY_ASSERT (ecma_is_value_object (already_resolved));
+
+  ecma_object_t *already_resolved_p = ecma_get_object_from_value (already_resolved);
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) already_resolved_p;
+
+  JERRY_ASSERT (ext_object_p->u.class_prop.class_id == LIT_MAGIC_STRING_BOOLEAN_UL);
+
+  ext_object_p->u.class_prop.u.value = ecma_make_boolean_value (value);
+} /* ecma_set_already_resolved_value */
+
+/**
+ * Take a collection of Reactions and enqueue a new PromiseReactionJob for each Reaction.
+ *
+ * See also: ES2015 25.4.1.8
+ */
+static void
+ecma_promise_trigger_reactions (ecma_collection_header_t *reactions, /**< lists of reactions */
+                                ecma_value_t value) /**< value for resolve or reject */
+{
+  ecma_collection_iterator_t iter;
+  ecma_collection_iterator_init (&iter, reactions);
+
+  while (ecma_collection_iterator_next (&iter))
+  {
+    ecma_enqueue_promise_reaction_job (*iter.current_value_p, value);
+  }
+
+  ecma_free_values_collection (reactions, false);
+} /* ecma_promise_trigger_reactions */
+
+/**
+ * Reject a Promise with a reason.
+ *
+ * See also: ES2015 25.4.1.7
+ */
+static void
+ecma_reject_promise (ecma_value_t promise, /**< promise */
+                     ecma_value_t reason) /**< reason for reject */
+{
+  ecma_object_t *obj_p = ecma_get_object_from_value (promise);
+
+  JERRY_ASSERT (ecma_promise_get_state (obj_p) == ECMA_PROMISE_STATE_PENDING);
+
+  ecma_promise_set_state (obj_p, ECMA_PROMISE_STATE_REJECTED);
+  ecma_promise_set_result (obj_p, ecma_copy_value_if_not_object (reason));
+  ecma_promise_object_t *promise_p = (ecma_promise_object_t *) obj_p;
+  ecma_promise_trigger_reactions (promise_p->reject_reactions, reason);
+  promise_p->reject_reactions = ecma_new_values_collection (NULL, 0, false);
+  /* Free all fullfill_reactions. */
+  ecma_free_values_collection (promise_p->fulfill_reactions, false);
+  promise_p->fulfill_reactions = ecma_new_values_collection (NULL, 0, false);
+} /* ecma_reject_promise */
+
+/**
+ * Fulfill a Promise with a value.
+ *
+ * See also: ES2015 25.4.1.4
+ */
+static void
+ecma_fulfill_promise (ecma_value_t promise, /**< promise */
+                      ecma_value_t value) /**< fulfilled value */
+{
+  ecma_object_t *obj_p = ecma_get_object_from_value (promise);
+
+  JERRY_ASSERT (ecma_promise_get_state (obj_p) == ECMA_PROMISE_STATE_PENDING);
+
+  ecma_promise_set_state (obj_p, ECMA_PROMISE_STATE_FULFILLED);
+  ecma_promise_set_result (obj_p, ecma_copy_value_if_not_object (value));
+  ecma_promise_object_t *promise_p = (ecma_promise_object_t *) obj_p;
+  ecma_promise_trigger_reactions (promise_p->fulfill_reactions, value);
+  promise_p->fulfill_reactions = ecma_new_values_collection (NULL, 0, false);
+  /* Free all reject_reactions. */
+  ecma_free_values_collection (promise_p->reject_reactions, false);
+  promise_p->reject_reactions = ecma_new_values_collection (NULL, 0, false);
+} /* ecma_fulfill_promise */
+
+/**
+ * Native handler for Promise Reject Function.
+ *
+ * See also: ES2015 25.4.1.3.1
+ *
+ * @return ecma value of undefined.
+ */
+static ecma_value_t
+ecma_promise_reject_handler (const ecma_value_t function, /**< the function itself */
+                             const ecma_value_t this, /**< this_arg of the function */
+                             const ecma_value_t argv[], /**< argument list */
+                             const ecma_length_t argc) /**< argument number */
+{
+  JERRY_UNUSED (this);
+  JERRY_UNUSED (argc);
+
+  ecma_string_t str_promise;
+  ecma_string_t str_already_resolved;
+  ecma_init_ecma_magic_string (&str_promise, LIT_INTERNAL_MAGIC_STRING_PROMISE);
+  ecma_init_ecma_magic_string (&str_already_resolved, LIT_INTERNAL_MAGIC_STRING_ALREADY_RESOLVED);
+  ecma_object_t *function_p = ecma_get_object_from_value (function);
+  /* 2. */
+  ecma_value_t promise = ecma_op_object_get (function_p, &str_promise);
+  /* 1. */
+  JERRY_ASSERT (ecma_is_promise (ecma_get_object_from_value (promise)));
+  /* 3. */
+  ecma_value_t already_resolved = ecma_op_object_get (function_p, &str_already_resolved);
+
+  /* 4. */
+  if (ecma_get_already_resolved_bool_value (already_resolved))
+  {
+    ecma_free_value (promise);
+    ecma_free_value (already_resolved);
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  }
+
+  /* 5. */
+  ecma_set_already_resolved_value (already_resolved, true);
+  /* 6. */
+  ecma_reject_promise (promise, argv[0]);
+  ecma_free_value (promise);
+  ecma_free_value (already_resolved);
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+} /* ecma_promise_reject_handler */
+
+/**
+ * Native handler for Promise Resolve Function.
+ *
+ * See also: ES2015 25.4.1.3.2
+ *
+ * @return ecma value of undefined.
+ */
+static ecma_value_t
+ecma_promise_resolve_handler (const ecma_value_t function, /**< the function itself */
+                              const ecma_value_t this, /**< this_arg of the function */
+                              const ecma_value_t argv[], /**< argument list */
+                              const ecma_length_t argc) /**< argument number */
+{
+  JERRY_UNUSED (this);
+  JERRY_UNUSED (argc);
+
+  ecma_string_t str_promise;
+  ecma_string_t str_already_resolved;
+  ecma_init_ecma_magic_string (&str_promise, LIT_INTERNAL_MAGIC_STRING_PROMISE);
+  ecma_init_ecma_magic_string (&str_already_resolved, LIT_INTERNAL_MAGIC_STRING_ALREADY_RESOLVED);
+  ecma_object_t *function_p = ecma_get_object_from_value (function);
+  /* 2. */
+  ecma_value_t promise = ecma_op_object_get (function_p, &str_promise);
+  /* 1. */
+  JERRY_ASSERT (ecma_is_promise (ecma_get_object_from_value (promise)));
+  /* 3. */
+  ecma_value_t already_resolved = ecma_op_object_get (function_p, &str_already_resolved);
+
+  /* 4. */
+  if (ecma_get_already_resolved_bool_value (already_resolved))
+  {
+    goto end_of_resolve_function;
+  }
+
+  /* 5. */
+  ecma_set_already_resolved_value (already_resolved, true);
+
+  /* 6. */
+  if (argv[0] == promise)
+  {
+    ecma_object_t *error_p = ecma_new_standard_error (ECMA_ERROR_TYPE);
+    ecma_reject_promise (promise, ecma_make_object_value (error_p));
+    ecma_deref_object (error_p);
+    goto end_of_resolve_function;
+  }
+
+  /* 7. */
+  if (!ecma_is_value_object (argv[0]))
+  {
+    ecma_fulfill_promise (promise, argv[0]);
+    goto end_of_resolve_function;
+  }
+
+  /* 8. */
+  ecma_string_t *str_then = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING_THEN);
+  ecma_value_t then = ecma_op_object_get (ecma_get_object_from_value (argv[0]), str_then);
+
+  if (ECMA_IS_VALUE_ERROR (then))
+  {
+    /* 9. */
+    ecma_reject_promise (promise, then);
+  }
+  else if (!ecma_op_is_callable (then))
+  {
+    /* 11 .*/
+    ecma_fulfill_promise (promise, argv[0]);
+  }
+  else
+  {
+    /* 12 */
+    ecma_enqueue_promise_resolve_thenable_job (promise, argv[0], then);
+  }
+
+  ecma_deref_ecma_string (str_then);
+  ecma_free_value (then);
+
+end_of_resolve_function:
+  ecma_free_value (promise);
+  ecma_free_value (already_resolved);
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+} /* ecma_promise_resolve_handler */
+
+/**
+ * CapabilityiesExecutor Function.
+ *
+ * See also: ES2015 25.4.1.5.1
+ *
+ * @return ecma value of undefined or typerror.
+ *         Returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+ecma_call_builtin_executor (ecma_object_t *executor_p, /**< the executor object */
+                            ecma_value_t resolve_func, /**< the resolve function */
+                            ecma_value_t reject_func) /**< the reject function */
+{
+  ecma_string_t *str_capability = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
+  ecma_string_t *str_resolve = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
+  ecma_string_t *str_reject = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
+
+  /* 2. */
+  ecma_value_t capability = ecma_op_object_get (executor_p, str_capability);
+  /* 3. */
+  ecma_value_t resolve = ecma_op_object_get (ecma_get_object_from_value (capability), str_resolve);
+
+  if (resolve != ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED))
+  {
+    ecma_free_value (resolve);
+    ecma_free_value (capability);
+    ecma_deref_ecma_string (str_capability);
+    ecma_deref_ecma_string (str_resolve);
+    ecma_deref_ecma_string (str_reject);
+
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'resolve' function should be undefined."));
+  }
+
+  /* 4. */
+  ecma_value_t reject = ecma_op_object_get (ecma_get_object_from_value (capability), str_reject);
+
+  if (reject != ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED))
+  {
+    ecma_free_value (reject);
+    ecma_free_value (capability);
+    ecma_deref_ecma_string (str_capability);
+    ecma_deref_ecma_string (str_resolve);
+    ecma_deref_ecma_string (str_reject);
+
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'reject' function should be undefined."));
+  }
+
+  /* 5. */
+  ecma_op_object_put (ecma_get_object_from_value (capability),
+                      str_resolve,
+                      resolve_func,
+                      false);
+  /* 6. */
+  ecma_op_object_put (ecma_get_object_from_value (capability),
+                      str_reject,
+                      reject_func,
+                      false);
+
+  ecma_free_value (capability);
+  ecma_deref_ecma_string (str_capability);
+  ecma_deref_ecma_string (str_resolve);
+  ecma_deref_ecma_string (str_reject);
+
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+} /* ecma_call_builtin_executor */
+
+/**
+ * Create a PromiseCreateResovingFucntions.
+ *
+ * See also: ES2015 25.4.1.3
+ *
+ * @return pointer to the resolving functions
+ */
+static ecma_promise_resolving_functions_t *
+ecma_promise_create_resolving_functions (ecma_object_t *object_p) /**< the promise object */
+{
+  /* 1. */
+  ecma_value_t already_resolved = ecma_op_create_boolean_object (ecma_make_boolean_value (false));
+
+  ecma_string_t str_promise;
+  ecma_string_t str_already_resolved;
+  ecma_init_ecma_magic_string (&str_promise, LIT_INTERNAL_MAGIC_STRING_PROMISE);
+  ecma_init_ecma_magic_string (&str_already_resolved, LIT_INTERNAL_MAGIC_STRING_ALREADY_RESOLVED);
+  /* 2. */
+  ecma_object_t *resolve_p;
+  resolve_p = ecma_op_create_external_function_object (ecma_promise_resolve_handler);
+
+  /* 3. */
+  ecma_op_object_put (resolve_p,
+                      &str_promise,
+                      ecma_make_object_value (object_p),
+                      false);
+  /* 4. */
+  ecma_op_object_put (resolve_p,
+                      &str_already_resolved,
+                      already_resolved,
+                      false);
+  /* 5. */
+  ecma_object_t *reject_p;
+  reject_p = ecma_op_create_external_function_object (ecma_promise_reject_handler);
+  /* 6. */
+  ecma_op_object_put (reject_p,
+                      &str_promise,
+                      ecma_make_object_value (object_p),
+                      false);
+  /* 7. */
+  ecma_op_object_put (reject_p,
+                      &str_already_resolved,
+                      already_resolved,
+                      false);
+
+  /* 8. */
+  ecma_promise_resolving_functions_t *funcs = jmem_heap_alloc_block (sizeof (ecma_promise_resolving_functions_t));
+  funcs->resolve = ecma_make_object_value (resolve_p);
+  funcs->reject = ecma_make_object_value (reject_p);
+
+  ecma_free_value (already_resolved);
+
+  return funcs;
+} /* ecma_promise_create_resolving_functions */
+
+/**
+ * Free the heap and the member of the resolving functions.
+ */
+static void
+ecma_promise_free_resolving_functions (ecma_promise_resolving_functions_t *funcs) /**< points to the functions */
+{
+  ecma_free_value (funcs->resolve);
+  ecma_free_value (funcs->reject);
+  jmem_heap_free_block (funcs, sizeof (ecma_promise_resolving_functions_t));
+} /* ecma_promise_free_resolving_functions */
+
+/**
+ * Create a promise object.
+ *
+ * See also: ES2015 25.4.3.1
+ *
+ * @return ecma value of the new promise object
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_create_promise_object (ecma_value_t executor, /**< the executor function or object */
+                               ecma_promise_executor_type_t type) /**< indicates the type of executor */
+{
+  /* 3. */
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_PROMISE_PROTOTYPE);
+  ecma_object_t *object_p = ecma_create_object (prototype_obj_p,
+                                                sizeof (ecma_promise_object_t),
+                                                ECMA_OBJECT_TYPE_CLASS);
+  ecma_deref_object (prototype_obj_p);
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_PROMISE_UL;
+  ext_object_p->u.class_prop.u.value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  ecma_promise_object_t *promise_object_p = (ecma_promise_object_t *) object_p;
+  promise_object_p->fulfill_reactions = NULL;
+  promise_object_p->reject_reactions = NULL;
+
+  /* 5 */
+  ecma_promise_set_state (object_p, ECMA_PROMISE_STATE_PENDING);
+  /* 6-7. */
+  promise_object_p->fulfill_reactions = ecma_new_values_collection (NULL, 0, false);
+  promise_object_p->reject_reactions = ecma_new_values_collection (NULL, 0, false);
+  /* 8. */
+  ecma_promise_resolving_functions_t *funcs = ecma_promise_create_resolving_functions (object_p);
+
+  ecma_string_t str_resolve, str_reject;
+  ecma_init_ecma_magic_string (&str_resolve, LIT_INTERNAL_MAGIC_STRING_RESOLVE_FUNCTION);
+  ecma_init_ecma_magic_string (&str_reject, LIT_INTERNAL_MAGIC_STRING_REJECT_FUNCTION);
+  ecma_op_object_put (object_p,
+                      &str_resolve,
+                      funcs->resolve,
+                      false);
+  ecma_op_object_put (object_p,
+                      &str_reject,
+                      funcs->reject,
+                      false);
+
+  /* 9. */
+  ecma_value_t completion = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+  if (type == ECMA_PROMISE_EXECUTOR_FUNCTION)
+  {
+    JERRY_ASSERT (ecma_op_is_callable (executor));
+
+    ecma_value_t argv[] = { funcs->resolve, funcs->reject };
+    completion = ecma_op_function_call (ecma_get_object_from_value (executor),
+                                        ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                        argv,
+                                        2);
+  }
+  else if (type == ECMA_PROMISE_EXECUTOR_OBJECT)
+  {
+    JERRY_ASSERT (ecma_is_value_object (executor));
+
+    completion = ecma_call_builtin_executor (ecma_get_object_from_value (executor),
+                                             funcs->resolve,
+                                             funcs->reject);
+  }
+  else
+  {
+    JERRY_ASSERT (type == ECMA_PROMISE_EXECUTOR_EMPTY);
+    JERRY_UNUSED (executor);
+  }
+
+  ecma_value_t status = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (ECMA_IS_VALUE_ERROR (completion))
+  {
+    /* 10.a. */
+    completion = ecma_get_value_from_error_value (completion);
+    status = ecma_op_function_call (ecma_get_object_from_value (funcs->reject),
+                                    ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED),
+                                    &completion,
+                                    1);
+  }
+
+  ecma_promise_free_resolving_functions (funcs);
+  ecma_free_value (completion);
+
+  /* 10.b. */
+  if (ECMA_IS_VALUE_ERROR (status))
+  {
+    ecma_deref_object (object_p);
+    return status;
+  }
+
+  /* 11. */
+  ecma_free_value (status);
+
+  return ecma_make_object_value (object_p);
+} /* ecma_op_create_promise_object */
+
+/**
+ * Create a new PromiseCapability.
+ *
+ * See also: ES2015 25.4.1.5
+ *
+ * @return ecma value of the new PromiseCapability
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_promise_new_capability (void)
+{
+  /* 3. */
+  ecma_object_t *capability_p = ecma_op_create_object_object_noarg ();
+  ecma_string_t *str_capability = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
+  ecma_string_t *str_promise = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_PROMISE);
+  /* 4. */
+  ecma_object_t *executor_p;
+  executor_p = ecma_op_create_object_object_noarg ();
+  ecma_value_t executor = ecma_make_object_value (executor_p);
+  /* 5. */
+  ecma_op_object_put (executor_p,
+                      str_capability,
+                      ecma_make_object_value (capability_p),
+                      false);
+
+  /* 6. */
+  ecma_value_t promise = ecma_op_create_promise_object (executor, ECMA_PROMISE_EXECUTOR_OBJECT);
+
+  /* 10. */
+  ecma_op_object_put (capability_p,
+                      str_promise,
+                      promise,
+                      false);
+
+  ecma_deref_object (executor_p);
+  ecma_deref_ecma_string (str_promise);
+  ecma_deref_ecma_string (str_capability);
+  /* 7. */
+  if (ECMA_IS_VALUE_ERROR (promise))
+  {
+    ecma_free_value (promise);
+    ecma_deref_object (capability_p);
+    return promise;
+  }
+
+  ecma_free_value (promise);
+  /* 8. */
+  ecma_string_t *str_resolve = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_RESOLVE);
+  ecma_value_t resolve = ecma_op_object_get (capability_p, str_resolve);
+  ecma_deref_ecma_string (str_resolve);
+
+  if (!ecma_op_is_callable (resolve))
+  {
+    ecma_free_value (resolve);
+    ecma_deref_object (capability_p);
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'resolve' parameter must be callable."));
+  }
+
+  ecma_free_value (resolve);
+  /* 9. */
+  ecma_string_t *str_reject = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_REJECT);
+  ecma_value_t reject = ecma_op_object_get (capability_p, str_reject);
+  ecma_deref_ecma_string (str_reject);
+
+  if (!ecma_op_is_callable (reject))
+  {
+    ecma_free_value (reject);
+    ecma_deref_object (capability_p);
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'reject' parameter must be callable."));
+  }
+
+  ecma_free_value (reject);
+  /* 11. */
+  return ecma_make_object_value (capability_p);
+} /* ecma_promise_new_capability */
+
+/**
+ * It performs the "then" operation on promiFulfilled
+ * and onRejected as its settlement actions.
+ *
+ * See also: 25.4.5.3.1
+ *
+ * @return ecma value of the new promise object
+ *         Returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+ecma_promise_do_then (ecma_value_t promise, /**< the promise which call 'then' */
+                      ecma_value_t on_fulfilled, /**< on_fulfilled function */
+                      ecma_value_t on_rejected, /**< on_rejected function */
+                      ecma_value_t result_capability) /**< promise capability */
+{
+  ecma_string_t *str_capability = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_CAPABILITY);
+  ecma_string_t *str_handler = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_HANDLER);
+  ecma_string_t *str_promise = ecma_new_ecma_string_from_uint32 (ECMA_PROMISE_PROPERTY_PROMISE);
+
+  /* 3. boolean true indicates "indentity" */
+  if (!ecma_op_is_callable (on_fulfilled))
+  {
+    on_fulfilled = ecma_make_boolean_value (true);
+  }
+
+  /* 4. boolean false indicates "thrower" */
+  if (!ecma_op_is_callable (on_rejected))
+  {
+    on_rejected = ecma_make_boolean_value (false);
+  }
+
+  /* 5-6. */
+  ecma_object_t *fulfill_reaction_p = ecma_op_create_object_object_noarg ();
+  ecma_object_t *reject_reaction_p = ecma_op_create_object_object_noarg ();
+  ecma_op_object_put (fulfill_reaction_p,
+                      str_capability,
+                      result_capability,
+                      false);
+  ecma_op_object_put (fulfill_reaction_p,
+                      str_handler,
+                      on_fulfilled,
+                      false);
+
+  ecma_op_object_put (reject_reaction_p,
+                      str_capability,
+                      result_capability,
+                      false);
+  ecma_op_object_put (reject_reaction_p,
+                      str_handler,
+                      on_rejected,
+                      false);
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (promise);
+  ecma_promise_object_t *promise_p = (ecma_promise_object_t *) obj_p;
+
+  if (ecma_promise_get_state (obj_p) == ECMA_PROMISE_STATE_PENDING)
+  {
+    /* 7. */
+    ecma_append_to_values_collection (promise_p->fulfill_reactions,
+                                      ecma_make_object_value (fulfill_reaction_p),
+                                      false);
+
+    ecma_append_to_values_collection (promise_p->reject_reactions,
+                                      ecma_make_object_value (reject_reaction_p),
+                                      false);
+  }
+  else if (ecma_promise_get_state (obj_p) == ECMA_PROMISE_STATE_FULFILLED)
+  {
+    /* 8. */
+    ecma_value_t value = ecma_promise_get_result (obj_p);
+    ecma_enqueue_promise_reaction_job (ecma_make_object_value (fulfill_reaction_p), value);
+    ecma_free_value (value);
+  }
+  else
+  {
+    /* 9. */
+    ecma_value_t reason = ecma_promise_get_result (obj_p);
+    ecma_enqueue_promise_reaction_job (ecma_make_object_value (reject_reaction_p), reason);
+    ecma_free_value (reason);
+  }
+
+  /* 10. */
+  ecma_value_t ret = ecma_op_object_get (ecma_get_object_from_value (result_capability), str_promise);
+
+  ecma_deref_object (fulfill_reaction_p);
+  ecma_deref_object (reject_reaction_p);
+  ecma_deref_ecma_string (str_capability);
+  ecma_deref_ecma_string (str_handler);
+  ecma_deref_ecma_string (str_promise);
+  return ret;
+} /* ecma_promise_do_then */
+
+/**
+ * The common function for ecma_builtin_promise_prototype_then
+ * and ecma_builtin_promise_prototype_catch.
+ *
+ * @return ecma value of a new promise object.
+ *         Returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+ecma_promise_then (ecma_value_t promise, /**< the promise which call 'then' */
+                   ecma_value_t on_fulfilled, /**< on_fulfilled function */
+                   ecma_value_t on_rejected) /**< on_rejected function */
+{
+  if (!ecma_is_value_object (promise))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not an object."));
+  }
+
+  ecma_object_t *obj = ecma_get_object_from_value (promise);
+
+  if (!ecma_is_promise (obj))
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a Promise."));
+  }
+
+  ecma_value_t result_capability = ecma_promise_new_capability ();
+
+  if (ECMA_IS_VALUE_ERROR (result_capability))
+  {
+    return result_capability;
+  }
+
+  ecma_value_t ret = ecma_promise_do_then (promise, on_fulfilled, on_rejected, result_capability);
+  ecma_free_value (result_capability);
+
+  return ret;
+} /* ecma_promise_then */
+
+/**
+ * @}
+ * @}
+ */
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-promise-object.h b/deps/jerry/jerry-core/ecma/operations/ecma-promise-object.h
new file mode 100644 (file)
index 0000000..c4422bd
--- /dev/null
@@ -0,0 +1,107 @@
+/* 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.
+ */
+
+#ifndef ECMA_PROMISE_OBJECT_H
+#define ECMA_PROMISE_OBJECT_H
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaarraybufferobject ECMA ArrayBuffer object related routines
+ * @{
+ */
+
+/**
+ * The PromiseState of promise object.
+ */
+typedef enum
+{
+  ECMA_PROMISE_STATE_PENDING, /**< pending state */
+  ECMA_PROMISE_STATE_FULFILLED, /**< fulfilled state */
+  ECMA_PROMISE_STATE_REJECTED, /** rejected state */
+  ECMA_PROMISE_STATE__COUNT /**< number of states */
+} ecma_promise_state_t;
+
+/**
+ * Indicates the type of the executor in promise construct.
+ */
+typedef enum
+{
+  ECMA_PROMISE_EXECUTOR_FUNCTION, /**< the executor is a function, it is for the usual constructor */
+  ECMA_PROMISE_EXECUTOR_OBJECT, /**< the executor is an object, it is for the `then` routine */
+  ECMA_PROMISE_EXECUTOR_EMPTY /**< the executor is empty, it is for external C API */
+} ecma_promise_executor_type_t;
+
+/**
+ * Description of the promise resolving functions.
+ */
+typedef struct
+{
+  ecma_value_t resolve; /**< the resolve function */
+  ecma_value_t reject; /**< the reject function */
+} ecma_promise_resolving_functions_t;
+
+/**
+ * Description of the promise object.
+ * It need more space than normal object to store builtin properties.
+ */
+typedef struct
+{
+  ecma_extended_object_t ecma_extended_object_t; /**< extended object part */
+  uint8_t state; /**< promise state, see ecma_promise_state_t */
+  ecma_collection_header_t *fulfill_reactions; /**< list of PromiseFullfillReactions */
+  ecma_collection_header_t *reject_reactions; /**< list of PromiseRejectReactions */
+} ecma_promise_object_t;
+
+/**
+ * Use symbolic constant to represent the internal property name of
+ * promise related structures.
+ */
+typedef enum
+{
+  ECMA_PROMISE_PROPERTY_PROMISE, /**< [[Promise]] property */
+  ECMA_PROMISE_PROPERTY_RESOLVE, /**< [[Resolve]] property */
+  ECMA_PROMISE_PROPERTY_REJECT, /**< [[Reject]] property */
+  ECMA_PROMISE_PROPERTY_CAPABILITY, /**< [[Capability]] property */
+  ECMA_PROMISE_PROPERTY_HANDLER, /**< [[Handler]] property */
+  ECMA_PROMISE_PROPERTY_ALREADY_CALLED, /**< [[AlreadyCalled]] property */
+  ECMA_PROMISE_PROPERTY_INDEX, /**< [[Index]] property */
+  ECMA_PROMISE_PROPERTY_VALUE, /**< [[Values]] property */
+  ECMA_PROMISE_PROPERTY_REMAINING_ELEMENT /**< [[RemainingElement]] property */
+} ecma_promise_property_symbolic_constant_t;
+
+bool ecma_is_promise (ecma_object_t *obj_p);
+ecma_value_t ecma_promise_get_result (ecma_object_t *obj_p);
+void ecma_promise_set_result (ecma_object_t *obj_p, ecma_value_t result);
+uint8_t ecma_promise_get_state (ecma_object_t *obj_p);
+void ecma_promise_set_state (ecma_object_t *obj_p, uint8_t state);
+ecma_value_t
+ecma_op_create_promise_object (ecma_value_t executor, ecma_promise_executor_type_t type);
+ecma_value_t ecma_promise_new_capability (void);
+ecma_value_t
+ecma_promise_then (ecma_value_t promise,
+                   ecma_value_t on_fulfilled,
+                   ecma_value_t on_rejected);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+#endif /* !ECMA_PROMISE_OBJECT_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-reference.c b/deps/jerry/jerry-core/ecma/operations/ecma-reference.c
new file mode 100644 (file)
index 0000000..373f968
--- /dev/null
@@ -0,0 +1,140 @@
+/* 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.
+ */
+
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-lcache.h"
+#include "ecma-lex-env.h"
+#include "ecma-objects.h"
+#include "ecma-reference.h"
+#include "jrt.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup references ECMA-Reference
+ * @{
+ */
+
+/**
+ * Resolve syntactic reference.
+ *
+ * @return if reference was resolved successfully,
+ *          pointer to lexical environment - reference's base,
+ *         else - NULL.
+ */
+ecma_object_t *
+ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, /**< starting lexical environment */
+                                ecma_string_t *name_p) /**< identifier's name */
+{
+  JERRY_ASSERT (lex_env_p != NULL);
+
+  ecma_object_t *lex_env_iter_p = lex_env_p;
+
+  while (lex_env_iter_p != NULL)
+  {
+    if (ecma_op_has_binding (lex_env_iter_p, name_p))
+    {
+      return lex_env_iter_p;
+    }
+
+    lex_env_iter_p = ecma_get_lex_env_outer_reference (lex_env_iter_p);
+  }
+
+  return NULL;
+} /* ecma_op_resolve_reference_base */
+
+/**
+ * Resolve value corresponding to reference.
+ *
+ * @return value of the reference
+ */
+ecma_value_t
+ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical environment */
+                                 ecma_string_t *name_p) /**< identifier's name */
+{
+  JERRY_ASSERT (lex_env_p != NULL);
+
+  while (lex_env_p != NULL)
+  {
+    if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
+    {
+      ecma_property_t *property_p = ecma_find_named_property (lex_env_p, name_p);
+
+      if (property_p != NULL)
+      {
+        return ecma_fast_copy_value (ECMA_PROPERTY_VALUE_PTR (property_p)->value);
+      }
+    }
+    else
+    {
+      JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_OBJECT_BOUND
+                    || ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
+
+      ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
+
+      ecma_property_t *property_p = ecma_lcache_lookup (binding_obj_p, name_p);
+
+      if (property_p != NULL)
+      {
+        ecma_property_value_t *prop_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
+
+        if (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA)
+        {
+          return ecma_fast_copy_value (prop_value_p->value);
+        }
+
+        JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
+
+        ecma_object_t *getter_p = ecma_get_named_accessor_property_getter (prop_value_p);
+
+        if (getter_p == NULL)
+        {
+          return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+        }
+
+        ecma_value_t base_value = ecma_make_object_value (binding_obj_p);
+        return ecma_op_function_call (getter_p, base_value, NULL, 0);
+      }
+
+      ecma_value_t prop_value = ecma_op_object_find (binding_obj_p, name_p);
+
+      if (ecma_is_value_found (prop_value))
+      {
+        return prop_value;
+      }
+    }
+
+    lex_env_p = ecma_get_lex_env_outer_reference (lex_env_p);
+  }
+
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+  ecma_value_t name_val = ecma_make_string_value (name_p);
+  ecma_value_t error_value = ecma_raise_standard_error_with_format (ECMA_ERROR_REFERENCE,
+                                                                    "% is not defined",
+                                                                    name_val);
+#else /* !JERRY_ENABLE_ERROR_MESSAGES */
+  ecma_value_t error_value = ecma_raise_reference_error (NULL);
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+  return error_value;
+} /* ecma_op_resolve_reference_value */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-reference.h b/deps/jerry/jerry-core/ecma/operations/ecma-reference.h
new file mode 100644 (file)
index 0000000..e059341
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+#ifndef ECMA_REFERENCE_H
+#define ECMA_REFERENCE_H
+
+#include "ecma-globals.h"
+#include "jrt.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup references ECMA-Reference
+ * @{
+ */
+
+ecma_object_t *ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, ecma_string_t *name_p);
+ecma_value_t ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, ecma_string_t *name_p);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_REFERENCE_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-regexp-object.c b/deps/jerry/jerry-core/ecma/operations/ecma-regexp-object.c
new file mode 100644 (file)
index 0000000..56ce38b
--- /dev/null
@@ -0,0 +1,1457 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-array-object.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-objects.h"
+#include "ecma-regexp-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt-libc-includes.h"
+#include "lit-char-helpers.h"
+#include "re-compiler.h"
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+#define ECMA_BUILTINS_INTERNAL
+#include "ecma-builtins-internal.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaregexpobject ECMA RegExp object related routines
+ * @{
+ */
+
+/**
+ * RegExp results are stored in an array of string pointers. If N is the number
+ * of groups then the length of the array is 2*N, because every group has a start
+ * and end. We have to handle those pointers.
+ *
+ *   [0] RE global start
+ *   [1] RE global end
+ *   [2] 1st group start
+ *   [3] 1st group end
+ *   ...
+ *   [n]   n/2 th group start
+ *   [n+1] n/2 th group end
+ */
+#define RE_GLOBAL_START_IDX 0
+#define RE_GLOBAL_END_IDX   1
+
+/**
+ * Check if a RegExp opcode is a capture group or not
+ */
+#define RE_IS_CAPTURE_GROUP(x) (((x) < RE_OP_NON_CAPTURE_GROUP_START) ? 1 : 0)
+
+/**
+ * Parse RegExp flags (global, ignoreCase, multiline)
+ *
+ * See also: ECMA-262 v5, 15.10.4.1
+ *
+ * @return empty ecma value - if parsed successfully
+ *         error ecma value - otherwise
+ *
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+re_parse_regexp_flags (ecma_string_t *flags_str_p, /**< Input string with flags */
+                       uint16_t *flags_p) /**< [out] parsed flag bits */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_STRING_TO_UTF8_STRING (flags_str_p, flags_start_p, flags_start_size);
+
+  const lit_utf8_byte_t *flags_str_curr_p = flags_start_p;
+  const lit_utf8_byte_t *flags_str_end_p = flags_start_p + flags_start_size;
+
+  while (flags_str_curr_p < flags_str_end_p
+         && ecma_is_value_empty (ret_value))
+  {
+    switch (*flags_str_curr_p++)
+    {
+      case 'g':
+      {
+        if (*flags_p & RE_FLAG_GLOBAL)
+        {
+          ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid RegExp flags."));
+        }
+        *flags_p |= RE_FLAG_GLOBAL;
+        break;
+      }
+      case 'i':
+      {
+        if (*flags_p & RE_FLAG_IGNORE_CASE)
+        {
+          ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid RegExp flags."));
+        }
+        *flags_p |= RE_FLAG_IGNORE_CASE;
+        break;
+      }
+      case 'm':
+      {
+        if (*flags_p & RE_FLAG_MULTILINE)
+        {
+          ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid RegExp flags."));
+        }
+        *flags_p |= RE_FLAG_MULTILINE;
+        break;
+      }
+      default:
+      {
+        ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid RegExp flags."));
+        break;
+      }
+    }
+  }
+
+  ECMA_FINALIZE_UTF8_STRING (flags_start_p, flags_start_size);
+
+  return ret_value;
+} /* re_parse_regexp_flags  */
+
+/**
+ * Set a data property value for a regexp object.
+ */
+static void
+re_set_data_property (ecma_object_t *re_object_p, /**< RegExp object */
+                      ecma_string_t *property_name_p, /**< property name */
+                      uint8_t prop_attributes, /**< property attributes */
+                      ecma_value_t value) /**< property value */
+{
+  ecma_property_ref_t property_ref;
+  ecma_property_t property = ecma_op_object_get_own_property (re_object_p,
+                                                              property_name_p,
+                                                              &property_ref,
+                                                              ECMA_PROPERTY_GET_VALUE);
+
+  if (property == ECMA_PROPERTY_TYPE_NOT_FOUND)
+  {
+    property_ref.value_p = ecma_create_named_data_property (re_object_p,
+                                                            property_name_p,
+                                                            prop_attributes,
+                                                            NULL);
+  }
+  else
+  {
+    JERRY_ASSERT (ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDDATA
+                  && !ecma_is_property_configurable (property));
+  }
+
+  ecma_named_data_property_assign_value (re_object_p, property_ref.value_p, value);
+} /* re_set_data_property */
+
+/**
+ * Initializes the source, global, ignoreCase, multiline, and lastIndex properties of RegExp instance.
+ */
+void
+re_initialize_props (ecma_object_t *re_obj_p, /**< RegExp object */
+                     ecma_string_t *source_p, /**< source string */
+                     uint16_t flags) /**< flags */
+{
+ /* Set source property. ECMA-262 v5, 15.10.7.1 */
+  ecma_string_t *magic_string_p;
+
+  magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE);
+  re_set_data_property (re_obj_p,
+                        magic_string_p,
+                        ECMA_PROPERTY_FIXED,
+                        ecma_make_string_value (source_p));
+  ecma_deref_ecma_string (magic_string_p);
+
+  /* Set global property. ECMA-262 v5, 15.10.7.2 */
+  magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL);
+  re_set_data_property (re_obj_p,
+                        magic_string_p,
+                        ECMA_PROPERTY_FIXED,
+                        ecma_make_boolean_value (flags & RE_FLAG_GLOBAL));
+  ecma_deref_ecma_string (magic_string_p);
+
+  /* Set ignoreCase property. ECMA-262 v5, 15.10.7.3 */
+  magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL);
+  re_set_data_property (re_obj_p,
+                        magic_string_p,
+                        ECMA_PROPERTY_FIXED,
+                        ecma_make_boolean_value (flags & RE_FLAG_IGNORE_CASE));
+  ecma_deref_ecma_string (magic_string_p);
+
+  /* Set multiline property. ECMA-262 v5, 15.10.7.4 */
+  magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE);
+  re_set_data_property (re_obj_p,
+                        magic_string_p,
+                        ECMA_PROPERTY_FIXED,
+                        ecma_make_boolean_value (flags & RE_FLAG_MULTILINE));
+  ecma_deref_ecma_string (magic_string_p);
+
+  /* Set lastIndex property. ECMA-262 v5, 15.10.7.5 */
+  magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL);
+  re_set_data_property (re_obj_p,
+                        magic_string_p,
+                        ECMA_PROPERTY_FLAG_WRITABLE,
+                        ecma_make_integer_value (0));
+  ecma_deref_ecma_string (magic_string_p);
+} /* re_initialize_props */
+
+/**
+ * RegExp object creation operation.
+ *
+ * See also: ECMA-262 v5, 15.10.4.1
+ *
+ * @return constructed RegExp object
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_create_regexp_object_from_bytecode (re_compiled_code_t *bytecode_p) /**< RegExp bytecode */
+{
+  JERRY_ASSERT (bytecode_p != NULL);
+
+  ecma_object_t *re_prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE);
+
+  ecma_object_t *object_p = ecma_create_object (re_prototype_obj_p,
+                                                sizeof (ecma_extended_object_t),
+                                                ECMA_OBJECT_TYPE_CLASS);
+
+  ecma_deref_object (re_prototype_obj_p);
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+
+  /* Set the internal [[Class]] property */
+  ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_REGEXP_UL;
+
+  /* Set bytecode internal property. */
+  ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.class_prop.u.value, bytecode_p);
+  ecma_bytecode_ref ((ecma_compiled_code_t *) bytecode_p);
+
+  /* Initialize RegExp object properties */
+  re_initialize_props (object_p,
+                       ECMA_GET_NON_NULL_POINTER (ecma_string_t, bytecode_p->pattern_cp),
+                       bytecode_p->header.status_flags);
+
+  return ecma_make_object_value (object_p);
+} /* ecma_op_create_regexp_object_from_bytecode */
+
+/**
+ * RegExp object creation operation.
+ *
+ * See also: ECMA-262 v5, 15.10.4.1
+ *
+ * @return constructed RegExp object - if pattern and flags were parsed successfully
+ *         error ecma value          - otherwise
+ *
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_create_regexp_object (ecma_string_t *pattern_p, /**< input pattern */
+                              ecma_string_t *flags_str_p) /**< flags */
+{
+  JERRY_ASSERT (pattern_p != NULL);
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  uint16_t flags = 0;
+
+  if (flags_str_p != NULL)
+  {
+    ECMA_TRY_CATCH (empty, re_parse_regexp_flags (flags_str_p, &flags), ret_value);
+    ECMA_FINALIZE (empty);
+
+    if (!ecma_is_value_empty (ret_value))
+    {
+      return ret_value;
+    }
+  }
+
+  ecma_object_t *re_prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE);
+
+  ecma_object_t *object_p = ecma_create_object (re_prototype_obj_p,
+                                                sizeof (ecma_extended_object_t),
+                                                ECMA_OBJECT_TYPE_CLASS);
+
+  ecma_deref_object (re_prototype_obj_p);
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_UNDEFINED;
+
+  re_initialize_props (object_p, pattern_p, flags);
+
+  /* Compile bytecode. */
+  const re_compiled_code_t *bc_p = NULL;
+  ECMA_TRY_CATCH (empty, re_compile_bytecode (&bc_p, pattern_p, flags), ret_value);
+
+  /* Set [[Class]] and bytecode internal properties. */
+  ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_REGEXP_UL;
+  ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.class_prop.u.value, bc_p);
+
+  ret_value = ecma_make_object_value (object_p);
+
+  ECMA_FINALIZE (empty);
+
+  if (ECMA_IS_VALUE_ERROR (ret_value))
+  {
+    ecma_deref_object (object_p);
+  }
+
+  return ret_value;
+} /* ecma_op_create_regexp_object */
+
+/**
+ * RegExp Canonicalize abstract operation
+ *
+ * See also: ECMA-262 v5, 15.10.2.8
+ *
+ * @return ecma_char_t canonicalized character
+ */
+inline ecma_char_t __attr_always_inline___
+re_canonicalize (ecma_char_t ch, /**< character */
+                 bool is_ignorecase) /**< IgnoreCase flag */
+{
+  ecma_char_t ret_value = ch;
+
+  if (is_ignorecase)
+  {
+    if (ch < 128)
+    {
+      /* ASCII fast path. */
+      if (ch >= LIT_CHAR_LOWERCASE_A && ch <= LIT_CHAR_LOWERCASE_Z)
+      {
+        ret_value = (ecma_char_t) (ch - (LIT_CHAR_LOWERCASE_A - LIT_CHAR_UPPERCASE_A));
+      }
+    }
+    else
+    {
+      /* 2. */
+      ecma_char_t u[LIT_MAXIMUM_OTHER_CASE_LENGTH];
+      ecma_length_t size = lit_char_to_upper_case (ch, u, LIT_MAXIMUM_OTHER_CASE_LENGTH);
+
+      /* 3. */
+      if (size == 1)
+      {
+        /* 4. */
+        ecma_char_t cu = u[0];
+        /* 5. */
+        if (cu >= 128)
+        {
+          /* 6. */
+          ret_value = cu;
+        }
+      }
+    }
+  }
+
+  return ret_value;
+} /* re_canonicalize */
+
+/**
+ * Recursive function for RegExp matching. Tests for a regular expression
+ * match and returns a MatchResult value.
+ *
+ * See also:
+ *          ECMA-262 v5, 15.10.2.1
+ *
+ * @return true  - if matched
+ *         false - otherwise
+ *
+ *         May raise error, so returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+re_match_regexp (re_matcher_ctx_t *re_ctx_p, /**< RegExp matcher context */
+                 uint8_t *bc_p, /**< pointer to the current RegExp bytecode */
+                 const lit_utf8_byte_t *str_p, /**< input string pointer */
+                 const lit_utf8_byte_t **out_str_p) /**< [out] matching substring iterator */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  re_opcode_t op;
+
+  const lit_utf8_byte_t *str_curr_p = str_p;
+
+  while ((op = re_get_opcode (&bc_p)))
+  {
+    switch (op)
+    {
+      case RE_OP_MATCH:
+      {
+        JERRY_TRACE_MSG ("Execute RE_OP_MATCH: match\n");
+        *out_str_p = str_curr_p;
+        ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+        return ret_value; /* match */
+      }
+      case RE_OP_CHAR:
+      {
+        if (str_curr_p >= re_ctx_p->input_end_p)
+        {
+          return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+        }
+
+        bool is_ignorecase = re_ctx_p->flags & RE_FLAG_IGNORE_CASE;
+        ecma_char_t ch1 = (ecma_char_t) re_get_char (&bc_p); /* Already canonicalized. */
+        ecma_char_t ch2 = re_canonicalize (lit_utf8_read_next (&str_curr_p), is_ignorecase);
+        JERRY_TRACE_MSG ("Character matching %d to %d: ", ch1, ch2);
+
+        if (ch1 != ch2)
+        {
+          JERRY_TRACE_MSG ("fail\n");
+          return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+        }
+
+        JERRY_TRACE_MSG ("match\n");
+
+        break; /* tail merge */
+      }
+      case RE_OP_PERIOD:
+      {
+        if (str_curr_p >= re_ctx_p->input_end_p)
+        {
+          return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+        }
+
+        ecma_char_t ch = lit_utf8_read_next (&str_curr_p);
+        JERRY_TRACE_MSG ("Period matching '.' to %u: ", (unsigned int) ch);
+
+        if (lit_char_is_line_terminator (ch))
+        {
+          JERRY_TRACE_MSG ("fail\n");
+          return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+        }
+
+        JERRY_TRACE_MSG ("match\n");
+        break; /* tail merge */
+      }
+      case RE_OP_ASSERT_START:
+      {
+        JERRY_TRACE_MSG ("Execute RE_OP_ASSERT_START: ");
+
+        if (str_curr_p <= re_ctx_p->input_start_p)
+        {
+          JERRY_TRACE_MSG ("match\n");
+          break; /* tail merge */
+        }
+
+        if (!(re_ctx_p->flags & RE_FLAG_MULTILINE))
+        {
+          JERRY_TRACE_MSG ("fail\n");
+          return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+        }
+
+        if (lit_char_is_line_terminator (lit_utf8_peek_prev (str_curr_p)))
+        {
+          JERRY_TRACE_MSG ("match\n");
+          break; /* tail merge */
+        }
+
+        JERRY_TRACE_MSG ("fail\n");
+        return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+      }
+      case RE_OP_ASSERT_END:
+      {
+        JERRY_TRACE_MSG ("Execute RE_OP_ASSERT_END: ");
+
+        if (str_curr_p >= re_ctx_p->input_end_p)
+        {
+          JERRY_TRACE_MSG ("match\n");
+          break; /* tail merge */
+        }
+
+        if (!(re_ctx_p->flags & RE_FLAG_MULTILINE))
+        {
+          JERRY_TRACE_MSG ("fail\n");
+          return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+        }
+
+        if (lit_char_is_line_terminator (lit_utf8_peek_next (str_curr_p)))
+        {
+          JERRY_TRACE_MSG ("match\n");
+          break; /* tail merge */
+        }
+
+        JERRY_TRACE_MSG ("fail\n");
+        return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+      }
+      case RE_OP_ASSERT_WORD_BOUNDARY:
+      case RE_OP_ASSERT_NOT_WORD_BOUNDARY:
+      {
+        bool is_wordchar_left, is_wordchar_right;
+
+        if (str_curr_p <= re_ctx_p->input_start_p)
+        {
+          is_wordchar_left = false;  /* not a wordchar */
+        }
+        else
+        {
+          is_wordchar_left = lit_char_is_word_char (lit_utf8_peek_prev (str_curr_p));
+        }
+
+        if (str_curr_p >= re_ctx_p->input_end_p)
+        {
+          is_wordchar_right = false;  /* not a wordchar */
+        }
+        else
+        {
+          is_wordchar_right = lit_char_is_word_char (lit_utf8_peek_next (str_curr_p));
+        }
+
+        if (op == RE_OP_ASSERT_WORD_BOUNDARY)
+        {
+          JERRY_TRACE_MSG ("Execute RE_OP_ASSERT_WORD_BOUNDARY: ");
+          if (is_wordchar_left == is_wordchar_right)
+          {
+            JERRY_TRACE_MSG ("fail\n");
+            return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+          }
+        }
+        else
+        {
+          JERRY_ASSERT (op == RE_OP_ASSERT_NOT_WORD_BOUNDARY);
+          JERRY_TRACE_MSG ("Execute RE_OP_ASSERT_NOT_WORD_BOUNDARY: ");
+
+          if (is_wordchar_left != is_wordchar_right)
+          {
+            JERRY_TRACE_MSG ("fail\n");
+            return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+          }
+        }
+
+        JERRY_TRACE_MSG ("match\n");
+        break; /* tail merge */
+      }
+      case RE_OP_LOOKAHEAD_POS:
+      case RE_OP_LOOKAHEAD_NEG:
+      {
+        ecma_value_t match_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+        const lit_utf8_byte_t *sub_str_p = NULL;
+
+        uint32_t array_size = re_ctx_p->num_of_captures + re_ctx_p->num_of_non_captures;
+        JMEM_DEFINE_LOCAL_ARRAY (saved_bck_p, array_size, lit_utf8_byte_t *);
+
+        size_t size = (size_t) (array_size) * sizeof (lit_utf8_byte_t *);
+        memcpy (saved_bck_p, re_ctx_p->saved_p, size);
+
+        do
+        {
+          uint32_t offset = re_get_value (&bc_p);
+
+          if (!sub_str_p)
+          {
+            match_value = re_match_regexp (re_ctx_p, bc_p, str_curr_p, &sub_str_p);
+            if (ECMA_IS_VALUE_ERROR (match_value))
+            {
+              break;
+            }
+          }
+          bc_p += offset;
+        }
+        while (re_get_opcode (&bc_p) == RE_OP_ALTERNATIVE);
+
+        if (!ECMA_IS_VALUE_ERROR (match_value))
+        {
+          JERRY_TRACE_MSG ("Execute RE_OP_LOOKAHEAD_POS/NEG: ");
+          ecma_free_value (match_value);
+          if ((op == RE_OP_LOOKAHEAD_POS && sub_str_p)
+              || (op == RE_OP_LOOKAHEAD_NEG && !sub_str_p))
+          {
+            JERRY_TRACE_MSG ("match\n");
+            match_value = re_match_regexp (re_ctx_p, bc_p, str_curr_p, &sub_str_p);
+          }
+          else
+          {
+            JERRY_TRACE_MSG ("fail\n");
+            match_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+          }
+        }
+
+        if (!ECMA_IS_VALUE_ERROR (match_value))
+        {
+          if (ecma_is_value_true (match_value))
+          {
+            *out_str_p = sub_str_p;
+          }
+          else
+          {
+            JERRY_ASSERT (ecma_is_value_boolean (match_value));
+            /* restore saved */
+            memcpy (re_ctx_p->saved_p, saved_bck_p, size);
+          }
+        }
+
+        JMEM_FINALIZE_LOCAL_ARRAY (saved_bck_p);
+        return match_value;
+      }
+      case RE_OP_CHAR_CLASS:
+      case RE_OP_INV_CHAR_CLASS:
+      {
+        uint32_t num_of_ranges;
+        bool is_match;
+
+        JERRY_TRACE_MSG ("Execute RE_OP_CHAR_CLASS/RE_OP_INV_CHAR_CLASS, ");
+        if (str_curr_p >= re_ctx_p->input_end_p)
+        {
+          JERRY_TRACE_MSG ("fail\n");
+          return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+        }
+
+        bool is_ignorecase = re_ctx_p->flags & RE_FLAG_IGNORE_CASE;
+        ecma_char_t curr_ch = re_canonicalize (lit_utf8_read_next (&str_curr_p), is_ignorecase);
+
+        num_of_ranges = re_get_value (&bc_p);
+        is_match = false;
+
+        while (num_of_ranges)
+        {
+          ecma_char_t ch1 = re_canonicalize (re_get_char (&bc_p), is_ignorecase);
+          ecma_char_t ch2 = re_canonicalize (re_get_char (&bc_p), is_ignorecase);
+          JERRY_TRACE_MSG ("num_of_ranges=%u, ch1=%u, ch2=%u, curr_ch=%u; ",
+                           (unsigned int) num_of_ranges, (unsigned int) ch1,
+                           (unsigned int) ch2, (unsigned int) curr_ch);
+
+          if (curr_ch >= ch1 && curr_ch <= ch2)
+          {
+            /* We must read all the ranges from bytecode. */
+            is_match = true;
+          }
+          num_of_ranges--;
+        }
+
+        if (op == RE_OP_CHAR_CLASS)
+        {
+          if (!is_match)
+          {
+            JERRY_TRACE_MSG ("fail\n");
+            return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+          }
+        }
+        else
+        {
+          JERRY_ASSERT (op == RE_OP_INV_CHAR_CLASS);
+          if (is_match)
+          {
+            JERRY_TRACE_MSG ("fail\n");
+            return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+          }
+        }
+        JERRY_TRACE_MSG ("match\n");
+        break; /* tail merge */
+      }
+      case RE_OP_BACKREFERENCE:
+      {
+        uint32_t backref_idx;
+
+        backref_idx = re_get_value (&bc_p);
+        JERRY_TRACE_MSG ("Execute RE_OP_BACKREFERENCE (idx: %u): ", (unsigned int) backref_idx);
+        backref_idx *= 2;  /* backref n -> saved indices [n*2, n*2+1] */
+        JERRY_ASSERT (backref_idx >= 2 && backref_idx + 1 < re_ctx_p->num_of_captures);
+
+        if (!re_ctx_p->saved_p[backref_idx] || !re_ctx_p->saved_p[backref_idx + 1])
+        {
+          JERRY_TRACE_MSG ("match\n");
+          break; /* capture is 'undefined', always matches! */
+        }
+
+        const lit_utf8_byte_t *sub_str_p = re_ctx_p->saved_p[backref_idx];
+
+        while (sub_str_p < re_ctx_p->saved_p[backref_idx + 1])
+        {
+          ecma_char_t ch1, ch2;
+
+          if (str_curr_p >= re_ctx_p->input_end_p)
+          {
+            JERRY_TRACE_MSG ("fail\n");
+            return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+          }
+
+          ch1 = lit_utf8_read_next (&sub_str_p);
+          ch2 = lit_utf8_read_next (&str_curr_p);
+
+          if (ch1 != ch2)
+          {
+            JERRY_TRACE_MSG ("fail\n");
+            return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+          }
+        }
+        JERRY_TRACE_MSG ("match\n");
+        break; /* tail merge */
+      }
+      case RE_OP_SAVE_AT_START:
+      {
+        uint8_t *old_bc_p;
+
+        JERRY_TRACE_MSG ("Execute RE_OP_SAVE_AT_START\n");
+        const lit_utf8_byte_t *old_start_p = re_ctx_p->saved_p[RE_GLOBAL_START_IDX];
+        re_ctx_p->saved_p[RE_GLOBAL_START_IDX] = str_curr_p;
+
+        do
+        {
+          uint32_t offset = re_get_value (&bc_p);
+          const lit_utf8_byte_t *sub_str_p = NULL;
+          ecma_value_t match_value = re_match_regexp (re_ctx_p, bc_p, str_curr_p, &sub_str_p);
+
+          if (ecma_is_value_true (match_value))
+          {
+            *out_str_p = sub_str_p;
+            return match_value; /* match */
+          }
+          else if (ECMA_IS_VALUE_ERROR (match_value))
+          {
+            return match_value;
+          }
+
+          bc_p += offset;
+          old_bc_p = bc_p;
+        }
+        while (re_get_opcode (&bc_p) == RE_OP_ALTERNATIVE);
+        bc_p = old_bc_p;
+
+        re_ctx_p->saved_p[RE_GLOBAL_START_IDX] = old_start_p;
+        return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+      }
+      case RE_OP_SAVE_AND_MATCH:
+      {
+        JERRY_TRACE_MSG ("End of pattern is reached: match\n");
+        re_ctx_p->saved_p[RE_GLOBAL_END_IDX] = str_curr_p;
+        *out_str_p = str_curr_p;
+        return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE); /* match */
+      }
+      case RE_OP_ALTERNATIVE:
+      {
+        /*
+        *  Alternatives should be jump over, when alternative opcode appears.
+        */
+        uint32_t offset = re_get_value (&bc_p);
+        JERRY_TRACE_MSG ("Execute RE_OP_ALTERNATIVE");
+        bc_p += offset;
+
+        while (*bc_p == RE_OP_ALTERNATIVE)
+        {
+          JERRY_TRACE_MSG (", jump: %u", (unsigned int) offset);
+          bc_p++;
+          offset = re_get_value (&bc_p);
+          bc_p += offset;
+        }
+
+        JERRY_TRACE_MSG ("\n");
+        break; /* tail merge */
+      }
+      case RE_OP_CAPTURE_NON_GREEDY_ZERO_GROUP_START:
+      case RE_OP_NON_CAPTURE_NON_GREEDY_ZERO_GROUP_START:
+      {
+        /*
+        *  On non-greedy iterations we have to execute the bytecode
+        *  after the group first, if zero iteration is allowed.
+        */
+        uint32_t start_idx, iter_idx, offset;
+        const lit_utf8_byte_t *old_start_p = NULL;
+        const lit_utf8_byte_t *sub_str_p = NULL;
+        uint8_t *old_bc_p;
+
+        old_bc_p = bc_p; /* save the bytecode start position of the group start */
+        start_idx = re_get_value (&bc_p);
+        offset = re_get_value (&bc_p);
+
+        if (RE_IS_CAPTURE_GROUP (op))
+        {
+          JERRY_ASSERT (start_idx <= re_ctx_p->num_of_captures / 2);
+          iter_idx = start_idx - 1;
+          start_idx *= 2;
+
+          old_start_p = re_ctx_p->saved_p[start_idx];
+          re_ctx_p->saved_p[start_idx] = str_curr_p;
+        }
+        else
+        {
+          JERRY_ASSERT (start_idx < re_ctx_p->num_of_non_captures);
+          iter_idx = start_idx + (re_ctx_p->num_of_captures / 2) - 1;
+          start_idx += re_ctx_p->num_of_captures;
+        }
+        re_ctx_p->num_of_iterations_p[iter_idx] = 0;
+
+        /* Jump all over to the end of the END opcode. */
+        bc_p += offset;
+
+        /* Try to match after the close paren if zero is allowed */
+        ecma_value_t match_value = re_match_regexp (re_ctx_p, bc_p, str_curr_p, &sub_str_p);
+
+        if (ecma_is_value_true (match_value))
+        {
+          *out_str_p = sub_str_p;
+          return match_value; /* match */
+        }
+        else if (ECMA_IS_VALUE_ERROR (match_value))
+        {
+          return match_value;
+        }
+        if (RE_IS_CAPTURE_GROUP (op))
+        {
+          re_ctx_p->saved_p[start_idx] = old_start_p;
+        }
+
+        bc_p = old_bc_p;
+        /* FALLTHRU */
+      }
+      case RE_OP_CAPTURE_GROUP_START:
+      case RE_OP_CAPTURE_GREEDY_ZERO_GROUP_START:
+      case RE_OP_NON_CAPTURE_GROUP_START:
+      case RE_OP_NON_CAPTURE_GREEDY_ZERO_GROUP_START:
+      {
+        uint32_t start_idx, iter_idx, old_iteration_cnt, offset;
+        const lit_utf8_byte_t *sub_str_p = NULL;
+        uint8_t *old_bc_p;
+        uint8_t *end_bc_p = NULL;
+        start_idx = re_get_value (&bc_p);
+
+        if (op != RE_OP_CAPTURE_GROUP_START
+            && op != RE_OP_NON_CAPTURE_GROUP_START)
+        {
+          offset = re_get_value (&bc_p);
+          end_bc_p = bc_p + offset;
+        }
+
+        if (RE_IS_CAPTURE_GROUP (op))
+        {
+          JERRY_ASSERT (start_idx <= re_ctx_p->num_of_captures / 2);
+          iter_idx = start_idx - 1;
+          start_idx *= 2;
+        }
+        else
+        {
+          JERRY_ASSERT (start_idx < re_ctx_p->num_of_non_captures);
+          iter_idx = start_idx + (re_ctx_p->num_of_captures / 2) - 1;
+          start_idx += re_ctx_p->num_of_captures;
+        }
+
+        const lit_utf8_byte_t *old_start_p = re_ctx_p->saved_p[start_idx];
+        old_iteration_cnt = re_ctx_p->num_of_iterations_p[iter_idx];
+        re_ctx_p->saved_p[start_idx] = str_curr_p;
+        re_ctx_p->num_of_iterations_p[iter_idx] = 0;
+
+        do
+        {
+          offset = re_get_value (&bc_p);
+          ecma_value_t match_value = re_match_regexp (re_ctx_p, bc_p, str_curr_p, &sub_str_p);
+
+          if (ecma_is_value_true (match_value))
+          {
+            *out_str_p = sub_str_p;
+            return match_value; /* match */
+          }
+          else if (ECMA_IS_VALUE_ERROR (match_value))
+          {
+            return match_value;
+          }
+
+          bc_p += offset;
+          old_bc_p = bc_p;
+        }
+        while (re_get_opcode (&bc_p) == RE_OP_ALTERNATIVE);
+        bc_p = old_bc_p;
+        re_ctx_p->num_of_iterations_p[iter_idx] = old_iteration_cnt;
+
+        /* Try to match after the close paren if zero is allowed. */
+        if (op == RE_OP_CAPTURE_GREEDY_ZERO_GROUP_START
+            || op == RE_OP_NON_CAPTURE_GREEDY_ZERO_GROUP_START)
+        {
+          JERRY_ASSERT (end_bc_p);
+          ecma_value_t match_value = re_match_regexp (re_ctx_p, end_bc_p, str_curr_p, &sub_str_p);
+
+          if (ecma_is_value_true (match_value))
+          {
+            *out_str_p = sub_str_p;
+            return match_value; /* match */
+          }
+          else if (ECMA_IS_VALUE_ERROR (match_value))
+          {
+            return match_value;
+          }
+        }
+
+        re_ctx_p->saved_p[start_idx] = old_start_p;
+        return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+      }
+      case RE_OP_CAPTURE_NON_GREEDY_GROUP_END:
+      case RE_OP_NON_CAPTURE_NON_GREEDY_GROUP_END:
+      {
+        uint32_t end_idx, iter_idx, min, max;
+        uint8_t *old_bc_p;
+
+        /*
+        *  On non-greedy iterations we have to execute the bytecode
+        *  after the group first. Try to iterate only if it fails.
+        */
+        old_bc_p = bc_p; /* save the bytecode start position of the group end */
+        end_idx = re_get_value (&bc_p);
+        min = re_get_value (&bc_p);
+        max = re_get_value (&bc_p);
+        re_get_value (&bc_p); /* start offset */
+
+        if (RE_IS_CAPTURE_GROUP (op))
+        {
+          JERRY_ASSERT (end_idx <= re_ctx_p->num_of_captures / 2);
+          iter_idx = end_idx - 1;
+          end_idx = (end_idx * 2) + 1;
+        }
+        else
+        {
+          JERRY_ASSERT (end_idx <= re_ctx_p->num_of_non_captures);
+          iter_idx = end_idx + (re_ctx_p->num_of_captures / 2) - 1;
+          end_idx += re_ctx_p->num_of_captures;
+        }
+
+        re_ctx_p->num_of_iterations_p[iter_idx]++;
+
+        if (re_ctx_p->num_of_iterations_p[iter_idx] >= min
+            && re_ctx_p->num_of_iterations_p[iter_idx] <= max)
+        {
+          const lit_utf8_byte_t *old_end_p = re_ctx_p->saved_p[end_idx];
+          re_ctx_p->saved_p[end_idx] = str_curr_p;
+
+          const lit_utf8_byte_t *sub_str_p = NULL;
+          ecma_value_t match_value = re_match_regexp (re_ctx_p, bc_p, str_curr_p, &sub_str_p);
+
+          if (ecma_is_value_true (match_value))
+          {
+            *out_str_p = sub_str_p;
+            return match_value; /* match */
+          }
+          else if (ECMA_IS_VALUE_ERROR (match_value))
+          {
+            return match_value;
+          }
+
+          re_ctx_p->saved_p[end_idx] = old_end_p;
+        }
+        re_ctx_p->num_of_iterations_p[iter_idx]--;
+        bc_p = old_bc_p;
+
+        /* If non-greedy fails and try to iterate... */
+        /* FALLTHRU */
+      }
+      case RE_OP_CAPTURE_GREEDY_GROUP_END:
+      case RE_OP_NON_CAPTURE_GREEDY_GROUP_END:
+      {
+        uint32_t start_idx, end_idx, iter_idx, min, max, offset;
+        const lit_utf8_byte_t *old_start_p = NULL;
+        const lit_utf8_byte_t *old_end_p = NULL;
+        const lit_utf8_byte_t *sub_str_p = NULL;
+        uint8_t *old_bc_p;
+
+        end_idx = re_get_value (&bc_p);
+        min = re_get_value (&bc_p);
+        max = re_get_value (&bc_p);
+        offset = re_get_value (&bc_p);
+
+        if (RE_IS_CAPTURE_GROUP (op))
+        {
+          JERRY_ASSERT (end_idx <= re_ctx_p->num_of_captures / 2);
+          iter_idx = end_idx - 1;
+          start_idx = end_idx * 2;
+          end_idx = start_idx + 1;
+        }
+        else
+        {
+          JERRY_ASSERT (end_idx <= re_ctx_p->num_of_non_captures);
+          iter_idx = end_idx + (re_ctx_p->num_of_captures / 2) - 1;
+          end_idx += re_ctx_p->num_of_captures;
+          start_idx = end_idx;
+        }
+
+        /* Check the empty iteration if the minimum number of iterations is reached. */
+        if (re_ctx_p->num_of_iterations_p[iter_idx] >= min
+            && str_curr_p== re_ctx_p->saved_p[start_idx])
+        {
+          return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+        }
+
+        re_ctx_p->num_of_iterations_p[iter_idx]++;
+
+        old_bc_p = bc_p; /* Save the bytecode end position of the END opcodes for matching after it. */
+        old_end_p = re_ctx_p->saved_p[end_idx];
+        re_ctx_p->saved_p[end_idx] = str_curr_p;
+
+        if (re_ctx_p->num_of_iterations_p[iter_idx] < max)
+        {
+          bc_p -= offset;
+          offset = re_get_value (&bc_p);
+
+          old_start_p = re_ctx_p->saved_p[start_idx];
+          re_ctx_p->saved_p[start_idx] = str_curr_p;
+          ecma_value_t match_value = re_match_regexp (re_ctx_p, bc_p, str_curr_p, &sub_str_p);
+
+          if (ecma_is_value_true (match_value))
+          {
+            *out_str_p = sub_str_p;
+            return match_value; /* match */
+          }
+          else if (ECMA_IS_VALUE_ERROR (match_value))
+          {
+            return match_value;
+          }
+
+          re_ctx_p->saved_p[start_idx] = old_start_p;
+
+          /* Try to match alternatives if any. */
+          bc_p += offset;
+          while (*bc_p == RE_OP_ALTERNATIVE)
+          {
+            bc_p++; /* RE_OP_ALTERNATIVE */
+            offset = re_get_value (&bc_p);
+
+            old_start_p = re_ctx_p->saved_p[start_idx];
+            re_ctx_p->saved_p[start_idx] = str_curr_p;
+
+            match_value = re_match_regexp (re_ctx_p, bc_p, str_curr_p, &sub_str_p);
+
+            if (ecma_is_value_true (match_value))
+            {
+              *out_str_p = sub_str_p;
+              return match_value; /* match */
+            }
+            else if (ECMA_IS_VALUE_ERROR (match_value))
+            {
+              return match_value;
+            }
+
+            re_ctx_p->saved_p[start_idx] = old_start_p;
+            bc_p += offset;
+          }
+        }
+
+        if (re_ctx_p->num_of_iterations_p[iter_idx] >= min
+            && re_ctx_p->num_of_iterations_p[iter_idx] <= max)
+        {
+          /* Try to match the rest of the bytecode. */
+          ecma_value_t match_value = re_match_regexp (re_ctx_p, old_bc_p, str_curr_p, &sub_str_p);
+
+          if (ecma_is_value_true (match_value))
+          {
+            *out_str_p = sub_str_p;
+            return match_value; /* match */
+          }
+          else if (ECMA_IS_VALUE_ERROR (match_value))
+          {
+            return match_value;
+          }
+        }
+
+        /* restore if fails */
+        re_ctx_p->saved_p[end_idx] = old_end_p;
+        re_ctx_p->num_of_iterations_p[iter_idx]--;
+        return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+      }
+      case RE_OP_NON_GREEDY_ITERATOR:
+      {
+        uint32_t min, max, offset, num_of_iter;
+        const lit_utf8_byte_t *sub_str_p = NULL;
+
+        min = re_get_value (&bc_p);
+        max = re_get_value (&bc_p);
+
+        offset = re_get_value (&bc_p);
+        JERRY_TRACE_MSG ("Non-greedy iterator, min=%lu, max=%lu, offset=%ld\n",
+                         (unsigned long) min, (unsigned long) max, (long) offset);
+
+        num_of_iter = 0;
+        while (num_of_iter <= max)
+        {
+          if (num_of_iter >= min)
+          {
+            ecma_value_t match_value = re_match_regexp (re_ctx_p, bc_p + offset, str_curr_p, &sub_str_p);
+
+            if (ecma_is_value_true (match_value))
+            {
+              *out_str_p = sub_str_p;
+              return match_value; /* match */
+            }
+            else if (ECMA_IS_VALUE_ERROR (match_value))
+            {
+              return match_value;
+            }
+          }
+
+          ecma_value_t match_value = re_match_regexp (re_ctx_p, bc_p, str_curr_p, &sub_str_p);
+
+          if (!ecma_is_value_true (match_value))
+          {
+            if (ECMA_IS_VALUE_ERROR (match_value))
+            {
+              return match_value;
+            }
+
+            break;
+          }
+
+          str_curr_p = sub_str_p;
+          num_of_iter++;
+        }
+        return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+      }
+      case RE_OP_GREEDY_ITERATOR:
+      {
+        uint32_t min, max, offset, num_of_iter;
+        const lit_utf8_byte_t *sub_str_p = NULL;
+
+        min = re_get_value (&bc_p);
+        max = re_get_value (&bc_p);
+
+        offset = re_get_value (&bc_p);
+        JERRY_TRACE_MSG ("Greedy iterator, min=%lu, max=%lu, offset=%ld\n",
+                         (unsigned long) min, (unsigned long) max, (long) offset);
+
+        num_of_iter = 0;
+
+        while (num_of_iter < max)
+        {
+          ecma_value_t match_value = re_match_regexp (re_ctx_p, bc_p, str_curr_p, &sub_str_p);
+
+          if (!ecma_is_value_true (match_value))
+          {
+            if (ECMA_IS_VALUE_ERROR (match_value))
+            {
+              return match_value;
+            }
+
+            break;
+          }
+
+          str_curr_p = sub_str_p;
+          num_of_iter++;
+        }
+
+        while (num_of_iter >= min)
+        {
+          ecma_value_t match_value = re_match_regexp (re_ctx_p, bc_p + offset, str_curr_p, &sub_str_p);
+
+          if (ecma_is_value_true (match_value))
+          {
+            *out_str_p = sub_str_p;
+            return match_value; /* match */
+          }
+          else if (ECMA_IS_VALUE_ERROR (match_value))
+          {
+            return match_value;
+          }
+
+          if (num_of_iter == min)
+          {
+            break;
+          }
+
+          lit_utf8_read_prev (&str_curr_p);
+          num_of_iter--;
+        }
+        return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+      }
+      default:
+      {
+        JERRY_TRACE_MSG ("UNKNOWN opcode (%u)!\n", (unsigned int) op);
+        return ecma_raise_common_error (ECMA_ERR_MSG ("Unknown RegExp opcode."));
+      }
+    }
+  }
+
+  JERRY_UNREACHABLE ();
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE); /* fail */
+} /* re_match_regexp */
+
+/**
+ * Define the necessary properties for the result array (index, input, length).
+ */
+void
+re_set_result_array_properties (ecma_object_t *array_obj_p, /**< result array */
+                                ecma_string_t *input_str_p, /**< input string */
+                                uint32_t num_of_elements, /**< Number of array elements */
+                                int32_t index) /**< index of matching */
+{
+  /* Set index property of the result array */
+  ecma_string_t *result_prop_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_INDEX);
+  {
+    ecma_builtin_helper_def_prop (array_obj_p,
+                                  result_prop_str_p,
+                                  ecma_make_int32_value (index),
+                                  true, /* Writable */
+                                  true, /* Enumerable */
+                                  true, /* Configurable */
+                                  true); /* Failure handling */
+  }
+  ecma_deref_ecma_string (result_prop_str_p);
+
+  /* Set input property of the result array */
+  result_prop_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_INPUT);
+
+  ecma_builtin_helper_def_prop (array_obj_p,
+                                result_prop_str_p,
+                                ecma_make_string_value (input_str_p),
+                                true, /* Writable */
+                                true, /* Enumerable */
+                                true, /* Configurable */
+                                true); /* Failure handling */
+
+  ecma_deref_ecma_string (result_prop_str_p);
+
+  /* Set length property of the result array */
+  result_prop_str_p = ecma_new_ecma_length_string ();
+  {
+    ecma_property_descriptor_t array_item_prop_desc = ecma_make_empty_property_descriptor ();
+    array_item_prop_desc.is_value_defined = true;
+
+    array_item_prop_desc.value = ecma_make_uint32_value (num_of_elements);
+
+    ecma_op_object_define_own_property (array_obj_p,
+                                        result_prop_str_p,
+                                        &array_item_prop_desc,
+                                        true);
+  }
+  ecma_deref_ecma_string (result_prop_str_p);
+} /* re_set_result_array_properties */
+
+/**
+ * RegExp helper function to start the recursive matching algorithm
+ * and create the result Array object
+ *
+ * See also:
+ *          ECMA-262 v5, 15.10.6.2
+ *
+ * @return array object - if matched
+ *         null         - otherwise
+ *
+ *         May raise error.
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_regexp_exec_helper (ecma_value_t regexp_value, /**< RegExp object */
+                         ecma_value_t input_string, /**< input string */
+                         bool ignore_global) /**< ignore global flag */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  JERRY_ASSERT (ecma_is_value_object (regexp_value));
+  JERRY_ASSERT (ecma_is_value_string (input_string));
+
+  ecma_object_t *regexp_object_p = ecma_get_object_from_value (regexp_value);
+
+  JERRY_ASSERT (ecma_object_class_is (regexp_object_p, LIT_MAGIC_STRING_REGEXP_UL));
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) regexp_object_p;
+  re_compiled_code_t *bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t,
+                                                              ext_object_p->u.class_prop.u.value);
+
+  if (bc_p == NULL)
+  {
+    return ecma_raise_type_error (ECMA_ERR_MSG ("Incompatible type"));
+  }
+
+  ecma_string_t *input_string_p = ecma_get_string_from_value (input_string);
+  ECMA_STRING_TO_UTF8_STRING (input_string_p, input_buffer_p, input_buffer_size);
+
+  re_matcher_ctx_t re_ctx;
+  const lit_utf8_byte_t *input_curr_p = input_buffer_p;
+
+  re_ctx.input_start_p = input_curr_p;
+  const lit_utf8_byte_t *input_end_p = re_ctx.input_start_p + input_buffer_size;
+  re_ctx.input_end_p = input_end_p;
+
+  /* 1. Read bytecode header and init regexp matcher context. */
+  re_ctx.flags = bc_p->header.status_flags;
+
+  if (ignore_global)
+  {
+    re_ctx.flags &= (uint16_t) ~RE_FLAG_GLOBAL;
+  }
+
+  JERRY_TRACE_MSG ("Exec with flags [global: %d, ignoreCase: %d, multiline: %d]\n",
+                   re_ctx.flags & RE_FLAG_GLOBAL,
+                   re_ctx.flags & RE_FLAG_IGNORE_CASE,
+                   re_ctx.flags & RE_FLAG_MULTILINE);
+
+  re_ctx.num_of_captures = bc_p->num_of_captures;
+  JERRY_ASSERT (re_ctx.num_of_captures % 2 == 0);
+  re_ctx.num_of_non_captures = bc_p->num_of_non_captures;
+
+  JMEM_DEFINE_LOCAL_ARRAY (saved_p, re_ctx.num_of_captures + re_ctx.num_of_non_captures, const lit_utf8_byte_t *);
+
+  for (uint32_t i = 0; i < re_ctx.num_of_captures + re_ctx.num_of_non_captures; i++)
+  {
+    saved_p[i] = NULL;
+  }
+  re_ctx.saved_p = saved_p;
+
+  uint32_t num_of_iter_length = (re_ctx.num_of_captures / 2) + (re_ctx.num_of_non_captures - 1);
+  JMEM_DEFINE_LOCAL_ARRAY (num_of_iter_p, num_of_iter_length, uint32_t);
+
+  for (uint32_t i = 0; i < num_of_iter_length; i++)
+  {
+    num_of_iter_p[i] = 0u;
+  }
+
+  bool is_match = false;
+  re_ctx.num_of_iterations_p = num_of_iter_p;
+  int32_t index = 0;
+  ecma_length_t input_str_len;
+
+  input_str_len = lit_utf8_string_length (input_buffer_p, input_buffer_size);
+
+  if (input_buffer_p && (re_ctx.flags & RE_FLAG_GLOBAL))
+  {
+    ecma_string_t *magic_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL);
+    ecma_value_t lastindex_value = ecma_op_object_get_own_data_prop (regexp_object_p, magic_str_p);
+
+    ECMA_OP_TO_NUMBER_TRY_CATCH (lastindex_num, lastindex_value, ret_value)
+
+    index = ecma_number_to_int32 (lastindex_num);
+
+    if (input_curr_p < input_end_p
+        && index <= (int32_t) input_str_len
+        && index > 0)
+    {
+      for (int i = 0; i < index; i++)
+      {
+        lit_utf8_incr (&input_curr_p);
+      }
+    }
+
+    ECMA_OP_TO_NUMBER_FINALIZE (lastindex_num);
+
+    ecma_fast_free_value (lastindex_value);
+
+    ecma_deref_ecma_string (magic_str_p);
+  }
+
+  /* 2. Try to match */
+  const lit_utf8_byte_t *sub_str_p = NULL;
+  uint8_t *bc_start_p = (uint8_t *) (bc_p + 1);
+
+  while (ecma_is_value_empty (ret_value))
+  {
+    if (index < 0 || index > (int32_t) input_str_len)
+    {
+      if (re_ctx.flags & RE_FLAG_GLOBAL)
+      {
+        ecma_string_t *magic_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL);
+        ecma_op_object_put (regexp_object_p, magic_str_p, ecma_make_integer_value (0), true);
+        ecma_deref_ecma_string (magic_str_p);
+      }
+
+      is_match = false;
+      break;
+    }
+    else
+    {
+      ECMA_TRY_CATCH (match_value, re_match_regexp (&re_ctx,
+                                                    bc_start_p,
+                                                    input_curr_p,
+                                                    &sub_str_p),
+                                                    ret_value);
+
+      if (ecma_is_value_true (match_value))
+      {
+        is_match = true;
+        break;
+      }
+
+      if (input_curr_p < input_end_p)
+      {
+        lit_utf8_incr (&input_curr_p);
+      }
+      index++;
+
+      ECMA_FINALIZE (match_value);
+    }
+  }
+
+  if (input_curr_p && (re_ctx.flags & RE_FLAG_GLOBAL))
+  {
+    ecma_string_t *magic_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL);
+    ecma_number_t lastindex_num;
+
+    if (sub_str_p != NULL
+        && input_buffer_p != NULL)
+    {
+      lastindex_num = (ecma_number_t) lit_utf8_string_length (input_buffer_p,
+                                                              (lit_utf8_size_t) (sub_str_p - input_buffer_p));
+    }
+    else
+    {
+      lastindex_num = ECMA_NUMBER_ZERO;
+    }
+
+    ecma_op_object_put (regexp_object_p, magic_str_p, ecma_make_number_value (lastindex_num), true);
+    ecma_deref_ecma_string (magic_str_p);
+  }
+
+  /* 3. Fill the result array or return with 'undefiend' */
+  if (ecma_is_value_empty (ret_value))
+  {
+    if (is_match)
+    {
+      ecma_value_t result_array = ecma_op_create_array_object (0, 0, false);
+      ecma_object_t *result_array_obj_p = ecma_get_object_from_value (result_array);
+
+      ecma_string_t *input_str_p = ecma_new_ecma_string_from_utf8 (input_buffer_p, input_buffer_size);
+      re_set_result_array_properties (result_array_obj_p, input_str_p, re_ctx.num_of_captures / 2, index);
+      ecma_deref_ecma_string (input_str_p);
+
+      for (uint32_t i = 0; i < re_ctx.num_of_captures; i += 2)
+      {
+        ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (i / 2);
+        ecma_value_t capture_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+        if (((re_ctx.saved_p[i] && re_ctx.saved_p[i + 1])
+             && re_ctx.saved_p[i + 1] >= re_ctx.saved_p[i]))
+        {
+          ecma_length_t capture_str_len;
+          capture_str_len = (ecma_length_t) (re_ctx.saved_p[i + 1] - re_ctx.saved_p[i]);
+          ecma_string_t *capture_str_p;
+
+          if (capture_str_len > 0)
+          {
+            capture_str_p = ecma_new_ecma_string_from_utf8 (re_ctx.saved_p[i], capture_str_len);
+          }
+          else
+          {
+            capture_str_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
+          }
+
+          capture_value = ecma_make_string_value (capture_str_p);
+        }
+
+        ecma_property_value_t *prop_value_p;
+        prop_value_p = ecma_create_named_data_property (result_array_obj_p,
+                                                        index_str_p,
+                                                        ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
+                                                        NULL);
+        prop_value_p->value = capture_value;
+
+        JERRY_ASSERT (!ecma_is_value_object (capture_value));
+        ecma_deref_ecma_string (index_str_p);
+      }
+
+      ret_value = result_array;
+    }
+    else
+    {
+      ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+    }
+  }
+
+  JMEM_FINALIZE_LOCAL_ARRAY (num_of_iter_p);
+  JMEM_FINALIZE_LOCAL_ARRAY (saved_p);
+  ECMA_FINALIZE_UTF8_STRING (input_buffer_p, input_buffer_size);
+
+  return ret_value;
+} /* ecma_regexp_exec_helper */
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-regexp-object.h b/deps/jerry/jerry-core/ecma/operations/ecma-regexp-object.h
new file mode 100644 (file)
index 0000000..ccefe99
--- /dev/null
@@ -0,0 +1,70 @@
+/* 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.
+ */
+
+#ifndef ECMA_REGEXP_OBJECT_H
+#define ECMA_REGEXP_OBJECT_H
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+#include "ecma-globals.h"
+#include "re-compiler.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmaregexpobject ECMA RegExp object related routines
+ * @{
+ */
+
+/**
+ * RegExp flags
+ */
+typedef enum
+{
+  RE_FLAG_GLOBAL = (1u << 1),      /**< ECMA-262 v5, 15.10.7.2 */
+  RE_FLAG_IGNORE_CASE = (1u << 2), /**< ECMA-262 v5, 15.10.7.3 */
+  RE_FLAG_MULTILINE = (1u << 3)    /**< ECMA-262 v5, 15.10.7.4 */
+} re_flags_t;
+
+/**
+ * RegExp executor context
+ */
+typedef struct
+{
+  const lit_utf8_byte_t **saved_p;      /**< saved result string pointers, ECMA 262 v5, 15.10.2.1, State */
+  const lit_utf8_byte_t *input_start_p; /**< start of input pattern string */
+  const lit_utf8_byte_t *input_end_p;   /**< end of input pattern string */
+  uint32_t num_of_captures;             /**< number of capture groups */
+  uint32_t num_of_non_captures;         /**< number of non-capture groups */
+  uint32_t *num_of_iterations_p;        /**< number of iterations */
+  uint16_t flags;                       /**< RegExp flags */
+} re_matcher_ctx_t;
+
+ecma_value_t ecma_op_create_regexp_object_from_bytecode (re_compiled_code_t *bytecode_p);
+ecma_value_t ecma_op_create_regexp_object (ecma_string_t *pattern_p, ecma_string_t *flags_str_p);
+ecma_value_t ecma_regexp_exec_helper (ecma_value_t regexp_value, ecma_value_t input_string, bool ignore_global);
+ecma_char_t re_canonicalize (ecma_char_t ch, bool is_ignorecase);
+void re_set_result_array_properties (ecma_object_t *array_obj_p, ecma_string_t *input_str_p, uint32_t num_of_elements,
+                                     int32_t index);
+ecma_value_t re_parse_regexp_flags (ecma_string_t *flags_str_p, uint16_t *flags_p);
+void re_initialize_props (ecma_object_t *re_obj_p, ecma_string_t *source_p, uint16_t flags);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+#endif /* !ECMA_REGEXP_OBJECT_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-string-object.c b/deps/jerry/jerry-core/ecma/operations/ecma-string-object.c
new file mode 100644 (file)
index 0000000..207a370
--- /dev/null
@@ -0,0 +1,142 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+#include "ecma-string-object.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmastringobject ECMA String object related routines
+ * @{
+ */
+
+/**
+ * String object creation operation.
+ *
+ * See also: ECMA-262 v5, 15.5.2.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of arguments that
+                                                                         are passed to String constructor */
+                              ecma_length_t arguments_list_len) /**< length of the arguments' list */
+{
+  JERRY_ASSERT (arguments_list_len == 0
+                || arguments_list_p != NULL);
+
+  ecma_string_t *prim_prop_str_value_p;
+
+  if (arguments_list_len == 0)
+  {
+    prim_prop_str_value_p = ecma_new_ecma_string_from_magic_string_id (LIT_MAGIC_STRING__EMPTY);
+  }
+  else
+  {
+    ecma_value_t to_str_arg_value = ecma_op_to_string (arguments_list_p[0]);
+
+    if (ECMA_IS_VALUE_ERROR (to_str_arg_value))
+    {
+      return to_str_arg_value;
+    }
+    else
+    {
+      JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (to_str_arg_value));
+      JERRY_ASSERT (ecma_is_value_string (to_str_arg_value));
+
+      prim_prop_str_value_p = ecma_get_string_from_value (to_str_arg_value);
+    }
+  }
+
+#ifndef CONFIG_DISABLE_STRING_BUILTIN
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_STRING_PROTOTYPE);
+#else /* CONFIG_DISABLE_STRING_BUILTIN */
+  ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
+#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
+
+  ecma_object_t *object_p = ecma_create_object (prototype_obj_p,
+                                                sizeof (ecma_extended_object_t),
+                                                ECMA_OBJECT_TYPE_CLASS);
+
+  ecma_deref_object (prototype_obj_p);
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_STRING_UL;
+  ext_object_p->u.class_prop.u.value = ecma_make_string_value (prim_prop_str_value_p);
+
+  return ecma_make_object_value (object_p);
+} /* ecma_op_create_string_object */
+
+/**
+ * List names of a String object's lazy instantiated properties
+ *
+ * @return string values collection
+ */
+void
+ecma_op_string_list_lazy_property_names (ecma_object_t *obj_p, /**< a String object */
+                                         bool separate_enumerable, /**< true -  list enumerable properties
+                                                                    *           into main collection,
+                                                                    *           and non-enumerable to collection of
+                                                                    *           'skipped non-enumerable' properties,
+                                                                    *   false - list all properties into main
+                                                                    *           collection.
+                                                                    */
+                                         ecma_collection_header_t *main_collection_p, /**< 'main'
+                                                                                       *   collection */
+                                         ecma_collection_header_t *non_enum_collection_p) /**< skipped
+                                                                                           *   'non-enumerable'
+                                                                                           *   collection */
+{
+  JERRY_ASSERT (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_CLASS);
+
+  ecma_collection_header_t *for_enumerable_p = main_collection_p;
+
+  ecma_collection_header_t *for_non_enumerable_p = separate_enumerable ? non_enum_collection_p : main_collection_p;
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+  JERRY_ASSERT (ext_object_p->u.class_prop.class_id == LIT_MAGIC_STRING_STRING_UL);
+
+  ecma_string_t *prim_value_str_p = ecma_get_string_from_value (ext_object_p->u.class_prop.u.value);
+
+  ecma_length_t length = ecma_string_get_length (prim_value_str_p);
+
+  for (ecma_length_t i = 0; i < length; i++)
+  {
+    ecma_string_t *name_p = ecma_new_ecma_string_from_uint32 (i);
+
+    /* the properties are enumerable (ECMA-262 v5, 15.5.5.2.9) */
+    ecma_append_to_values_collection (for_enumerable_p, ecma_make_string_value (name_p), true);
+
+    ecma_deref_ecma_string (name_p);
+  }
+
+  ecma_string_t *length_str_p = ecma_new_ecma_length_string ();
+  ecma_append_to_values_collection (for_non_enumerable_p, ecma_make_string_value (length_str_p), true);
+  ecma_deref_ecma_string (length_str_p);
+} /* ecma_op_string_list_lazy_property_names */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-string-object.h b/deps/jerry/jerry-core/ecma/operations/ecma-string-object.h
new file mode 100644 (file)
index 0000000..5c7d805
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+#ifndef ECMA_STRING_OBJECT_H
+#define ECMA_STRING_OBJECT_H
+
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmastringobject ECMA String object related routines
+ * @{
+ */
+
+ecma_value_t
+ecma_op_create_string_object (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
+
+void
+ecma_op_string_list_lazy_property_names (ecma_object_t *obj_p,
+                                         bool separate_enumerable,
+                                         ecma_collection_header_t *main_collection_p,
+                                         ecma_collection_header_t *non_enum_collection_p);
+
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !ECMA_STRING_OBJECT_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-try-catch-macro.h b/deps/jerry/jerry-core/ecma/operations/ecma-try-catch-macro.h
new file mode 100644 (file)
index 0000000..14415eb
--- /dev/null
@@ -0,0 +1,101 @@
+/* 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.
+ */
+
+#ifndef ECMA_TRY_CATCH_MACRO_H
+#define ECMA_TRY_CATCH_MACRO_H
+
+#include "ecma-helpers.h"
+
+/**
+ * The macro defines try-block that initializes variable 'var' with 'op'
+ * and checks for exceptions that might be thrown during initialization.
+ *
+ * If no exception was thrown, then code after the try-block is executed.
+ * Otherwise, throw-completion value is just copied to return_value.
+ *
+ * Note:
+ *      Each ECMA_TRY_CATCH should have it's own corresponding ECMA_FINALIZE
+ *      statement with same argument as corresponding ECMA_TRY_CATCH's first argument.
+ */
+#define ECMA_TRY_CATCH(var, op, return_value) \
+  JERRY_ASSERT (return_value == ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY)); \
+  ecma_value_t var ## _completion = op; \
+  if (ECMA_IS_VALUE_ERROR (var ## _completion)) \
+  { \
+    return_value = var ## _completion; \
+  } \
+  else \
+  { \
+    ecma_value_t var = var ## _completion; \
+    JERRY_UNUSED (var);
+
+/**
+ * The macro marks end of code block that is defined by corresponding
+ * ECMA_TRY_CATCH and frees variable, initialized by the ECMA_TRY_CATCH.
+ *
+ * Note:
+ *      Each ECMA_TRY_CATCH should be followed by ECMA_FINALIZE with same argument
+ *      as corresponding ECMA_TRY_CATCH's first argument.
+ */
+#define ECMA_FINALIZE(var) \
+    ecma_free_value (var ## _completion); \
+  }
+
+/**
+ * The macro defines try-block that tries to perform ToNumber operation on given value
+ * and checks for exceptions that might be thrown during the operation.
+ *
+ * If no exception was thrown, then code after the try-block is executed.
+ * Otherwise, throw-completion value is just copied to return_value.
+ *
+ * Note:
+ *      Each ECMA_OP_TO_NUMBER_TRY_CATCH should have it's own corresponding ECMA_OP_TO_NUMBER_FINALIZE
+ *      statement with same argument as corresponding ECMA_OP_TO_NUMBER_TRY_CATCH's first argument.
+ */
+#define ECMA_OP_TO_NUMBER_TRY_CATCH(num_var, value, return_value) \
+  JERRY_ASSERT (return_value == ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY)); \
+  ecma_number_t num_var = ecma_number_make_nan (); \
+  if (ecma_is_value_number (value)) \
+  { \
+    num_var = ecma_get_number_from_value (value); \
+  } \
+  else \
+  { \
+    ECMA_TRY_CATCH (to_number_value, \
+                    ecma_op_to_number (value), \
+                    return_value); \
+    \
+    num_var = ecma_get_number_from_value (to_number_value); \
+    \
+    ECMA_FINALIZE (to_number_value); \
+  } \
+  \
+  if (ecma_is_value_empty (return_value)) \
+  {
+
+/**
+ * The macro marks end of code block that is defined by corresponding ECMA_OP_TO_NUMBER_TRY_CATCH.
+ *
+ * Note:
+ *      Each ECMA_OP_TO_NUMBER_TRY_CATCH should be followed by ECMA_OP_TO_NUMBER_FINALIZE
+ *      with same argument as corresponding ECMA_OP_TO_NUMBER_TRY_CATCH's first argument.
+ */
+#define ECMA_OP_TO_NUMBER_FINALIZE(num_var) } \
+  else \
+  { \
+    JERRY_ASSERT (ecma_number_is_nan (num_var)); \
+  }
+
+#endif /* !ECMA_TRY_CATCH_MACRO_H */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-typedarray-object.c b/deps/jerry/jerry-core/ecma/operations/ecma-typedarray-object.c
new file mode 100644 (file)
index 0000000..8890b48
--- /dev/null
@@ -0,0 +1,998 @@
+/* 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.
+ */
+
+#include <math.h>
+
+#include "ecma-typedarray-object.h"
+#include "ecma-arraybuffer-object.h"
+#include "ecma-function-object.h"
+#include "ecma-builtin-helpers.h"
+#include "ecma-try-catch-macro.h"
+#include "ecma-objects.h"
+#include "ecma-builtins.h"
+#include "ecma-exceptions.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmatypedarrayobject ECMA TypedArray object related routines
+ * @{
+ */
+
+/**
+ * Convert the value in location,
+ * cast it from type to ecma_number_t
+ * then assign to variale number
+ */
+#define GET_ELEMENT(type, location) \
+  ((ecma_number_t) (*((type *) location)));
+
+/**
+ * set typedarray's element value
+ *
+ * @return ecma_number_t: the value of the element
+ */
+static ecma_number_t
+get_typedarray_element (lit_utf8_byte_t *src, /**< the location in the internal arraybuffer */
+                        lit_magic_string_id_t class_id) /**< class name of the typedarray */
+{
+  switch (class_id)
+  {
+    case LIT_MAGIC_STRING_INT8_ARRAY_UL:
+    {
+      return GET_ELEMENT (int8_t, src);
+    }
+    case LIT_MAGIC_STRING_UINT8_ARRAY_UL:
+    case LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL:
+    {
+      return GET_ELEMENT (uint8_t, src);
+    }
+    case LIT_MAGIC_STRING_INT16_ARRAY_UL:
+    {
+      return GET_ELEMENT (int16_t, src);
+    }
+    case LIT_MAGIC_STRING_UINT16_ARRAY_UL:
+    {
+      return GET_ELEMENT (uint16_t, src);
+    }
+    case LIT_MAGIC_STRING_INT32_ARRAY_UL:
+    {
+      return GET_ELEMENT (int32_t, src);
+    }
+    case LIT_MAGIC_STRING_UINT32_ARRAY_UL:
+    {
+      return GET_ELEMENT (uint32_t, src);
+    }
+    case LIT_MAGIC_STRING_FLOAT32_ARRAY_UL:
+    {
+      return GET_ELEMENT (float, src);
+    }
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+    case LIT_MAGIC_STRING_FLOAT64_ARRAY_UL:
+    {
+      return GET_ELEMENT (double, src);
+    }
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+    default:
+    {
+      JERRY_UNREACHABLE ();
+      return 0;
+    }
+  }
+} /* get_typedarray_element */
+
+#undef GET_ELEMENT
+
+/**
+ * set typedarray's element value
+ */
+static void
+set_typedarray_element (lit_utf8_byte_t *dst_p, /**< the location in the internal arraybuffer */
+                        ecma_number_t value, /**< the number value to set */
+                        lit_magic_string_id_t class_id) /**< class name of the typedarray */
+{
+  switch (class_id)
+  {
+    case LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL:
+    {
+      uint8_t clamped;
+
+      if (value > 255)
+      {
+        clamped = 255;
+      }
+      else if (value <= 0)
+      {
+        clamped = 0;
+      }
+      else
+      {
+        clamped = (uint8_t) value;
+
+        if (clamped + 0.5 < value
+            || (clamped + 0.5 == value && (clamped % 2) == 1))
+        {
+          clamped ++;
+        }
+      }
+      *((uint8_t *) dst_p) = clamped;
+      return;
+    }
+    case LIT_MAGIC_STRING_FLOAT32_ARRAY_UL:
+    {
+      *((float *) dst_p) = (float) value;
+      return;
+    }
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+    case LIT_MAGIC_STRING_FLOAT64_ARRAY_UL:
+    {
+      *((double *) dst_p) = (double) value;
+      return;
+    }
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+    default:
+    {
+      break;
+    }
+  }
+
+  uint32_t uint32_value = 0;
+
+  if (!ecma_number_is_nan (value) && !ecma_number_is_infinity (value))
+  {
+    bool is_negative = false;
+
+    if (value < 0)
+    {
+      is_negative = true;
+      value = -value;
+    }
+
+    if (value > ((ecma_number_t) 0xffffffff))
+    {
+      value = (ecma_number_t) (fmod (value, (ecma_number_t) 0x100000000));
+    }
+
+    uint32_value = (uint32_t) value;
+
+    if (is_negative)
+    {
+      uint32_value = (uint32_t) (-(int32_t) uint32_value);
+    }
+  }
+
+  switch (class_id)
+  {
+    case LIT_MAGIC_STRING_INT8_ARRAY_UL:
+    {
+      *((int8_t *) dst_p) = (int8_t) uint32_value;
+      break;
+    }
+    case LIT_MAGIC_STRING_UINT8_ARRAY_UL:
+    {
+      *((uint8_t *) dst_p) = (uint8_t) uint32_value;
+      break;
+    }
+    case LIT_MAGIC_STRING_INT16_ARRAY_UL:
+    {
+      *((int16_t *) dst_p) = (int16_t) uint32_value;
+      break;
+    }
+    case LIT_MAGIC_STRING_UINT16_ARRAY_UL:
+    {
+      *((uint16_t *) dst_p) = (uint16_t) uint32_value;
+      break;
+    }
+    case LIT_MAGIC_STRING_INT32_ARRAY_UL:
+    {
+      *((int32_t *) dst_p) = (int32_t) uint32_value;
+      break;
+    }
+    case LIT_MAGIC_STRING_UINT32_ARRAY_UL:
+    {
+      *((uint32_t *) dst_p) = uint32_value;
+      break;
+    }
+    default:
+    {
+      JERRY_UNREACHABLE ();
+    }
+  }
+} /* set_typedarray_element */
+
+/**
+ * Create a TypedArray object by given array_length
+ *
+ * See also: ES2015 22.2.1.2.1
+ *
+ * @return ecma value of the new typedarray object
+ *         Returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+ecma_typedarray_create_object_with_length (ecma_length_t array_length, /**< length of the typedarray */
+                                           ecma_object_t *proto_p, /**< prototype object */
+                                           uint8_t element_size_shift, /**< the size shift of the element length */
+                                           lit_magic_string_id_t class_id) /**< class name of the typedarray */
+{
+  if (array_length > (UINT32_MAX >> element_size_shift))
+  {
+    return ecma_raise_range_error (ECMA_ERR_MSG ("Maximum typedarray size is reached."));
+  }
+
+  ecma_length_t byte_length = array_length << element_size_shift;
+
+  if (byte_length > UINT32_MAX - sizeof (ecma_extended_object_t) - JMEM_ALIGNMENT + 1)
+  {
+    return ecma_raise_range_error (ECMA_ERR_MSG ("Maximum typedarray size is reached."));
+  }
+
+  ecma_value_t new_arraybuffer_p = ecma_make_object_value (ecma_arraybuffer_new_object (byte_length));
+  ecma_object_t *object_p = ecma_create_object (proto_p,
+                                                sizeof (ecma_extended_object_t),
+                                                ECMA_OBJECT_TYPE_PSEUDO_ARRAY);
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  ext_object_p->u.pseudo_array.u1.class_id = class_id;
+  ext_object_p->u.pseudo_array.type = ECMA_PSEUDO_ARRAY_TYPEDARRAY;
+  ext_object_p->u.pseudo_array.extra_info = element_size_shift;
+  ext_object_p->u.pseudo_array.u2.arraybuffer = new_arraybuffer_p;
+
+  ecma_free_value (new_arraybuffer_p);
+
+  return ecma_make_object_value (object_p);
+} /* !ecma_typedarray_create_object_with_length */
+
+/**
+ * Create a TypedArray object by given buffer, offset, and array_length
+ *
+ * See also: ES2015 22.2.1.5
+ *
+ * @return ecma value of the new typedarray object
+ *         Returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+ecma_typedarray_create_object_with_buffer (ecma_object_t *arraybuffer_p, /**< the arraybuffer inside */
+                                           ecma_length_t byte_offset, /**< the byte offset of the arraybuffer */
+                                           ecma_length_t array_length, /**< length of the typedarray */
+                                           ecma_object_t *proto_p, /**< prototype object */
+                                           uint8_t element_size_shift, /**< the size shift of the element length */
+                                           lit_magic_string_id_t class_id) /**< class name of the typedarray */
+{
+  ecma_length_t expected_length = (ecma_arraybuffer_get_length (arraybuffer_p) >> element_size_shift);
+
+  bool needs_ext_typedarray_obj = (byte_offset != 0 || array_length != expected_length);
+
+  size_t object_size = (needs_ext_typedarray_obj ? sizeof (ecma_extended_typedarray_object_t)
+                                                 : sizeof (ecma_extended_object_t));
+
+  ecma_object_t *object_p = ecma_create_object (proto_p, object_size, ECMA_OBJECT_TYPE_PSEUDO_ARRAY);
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) object_p;
+  ext_object_p->u.pseudo_array.u1.class_id = class_id;
+  ext_object_p->u.pseudo_array.type = ECMA_PSEUDO_ARRAY_TYPEDARRAY;
+  ext_object_p->u.pseudo_array.extra_info = element_size_shift;
+  ext_object_p->u.pseudo_array.u2.arraybuffer = ecma_make_object_value (arraybuffer_p);
+
+  if (needs_ext_typedarray_obj)
+  {
+    ext_object_p->u.pseudo_array.type = ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO;
+
+    ecma_extended_typedarray_object_t *typedarray_info_p = (ecma_extended_typedarray_object_t *) object_p;
+    typedarray_info_p->array_length = array_length;
+    typedarray_info_p->byte_offset = byte_offset;
+  }
+
+  return ecma_make_object_value (object_p);
+} /* ecma_typedarray_create_object_with_buffer */
+
+/**
+ * Create a TypedArray object by given another TypedArray object
+ *
+ * See also: ES2015 22.2.1.3
+ *
+ * @return ecma value of the new typedarray object
+ *         Returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+ecma_typedarray_create_object_with_typedarray (ecma_object_t *typedarray_p, /**< a typedarray object */
+                                               ecma_object_t *proto_p, /**< prototype object */
+                                               uint8_t element_size_shift, /**< the size shift of the element length */
+                                               lit_magic_string_id_t class_id) /**< class name of the typedarray */
+{
+  ecma_length_t array_length = ecma_typedarray_get_length (typedarray_p);
+
+  ecma_value_t new_typedarray = ecma_typedarray_create_object_with_length (array_length,
+                                                                           proto_p,
+                                                                           element_size_shift,
+                                                                           class_id);
+
+  if (ECMA_IS_VALUE_ERROR (new_typedarray))
+  {
+    return new_typedarray;
+  }
+
+  ecma_object_t *new_typedarray_p = ecma_get_object_from_value (new_typedarray);
+
+  ecma_object_t *src_arraybuffer_p = ecma_typedarray_get_arraybuffer (typedarray_p);
+  lit_utf8_byte_t *src_buf_p = ecma_arraybuffer_get_buffer (src_arraybuffer_p);
+
+  ecma_object_t *dst_arraybuffer_p = ecma_typedarray_get_arraybuffer (new_typedarray_p);
+  lit_utf8_byte_t *dst_buf_p = ecma_arraybuffer_get_buffer (dst_arraybuffer_p);
+
+  src_buf_p += ecma_typedarray_get_offset (typedarray_p);
+
+  lit_magic_string_id_t src_class_id = ecma_object_get_class_name (typedarray_p);
+
+  if (src_class_id == class_id)
+  {
+    memcpy (dst_buf_p, src_buf_p, array_length << element_size_shift);
+  }
+  else
+  {
+    uint32_t src_element_size = 1u << ecma_typedarray_get_element_size_shift (typedarray_p);
+    uint32_t dst_element_size = 1u << element_size_shift;
+
+    for (uint32_t i = 0; i < array_length; i++)
+    {
+      /* Convert values from source to destination format. */
+      ecma_number_t tmp = get_typedarray_element (src_buf_p, src_class_id);
+      set_typedarray_element (dst_buf_p, tmp, class_id);
+
+      src_buf_p += src_element_size;
+      dst_buf_p += dst_element_size;
+    }
+  }
+
+  return new_typedarray;
+} /* ecma_typedarray_create_object_with_typedarray */
+
+/**
+ * Create a TypedArray object by transforming from an array-like object
+ *
+ * See also: ES2015 22.2.2.1
+ *
+ * @return ecma value of the new typedarray object
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_typedarray_from (ecma_value_t items_val, /**< the source array-like object */
+                         ecma_value_t map_fn_val, /**< map function */
+                         ecma_value_t this_val, /**< this_arg for the above map function */
+                         ecma_object_t *proto_p, /**< prototype object */
+                         uint8_t element_size_shift, /**< the size shift of the element length */
+                         lit_magic_string_id_t class_id) /**< class name of the typedarray */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  /* 3 */
+  JERRY_ASSERT (ecma_op_is_callable (map_fn_val) || ecma_is_value_undefined (map_fn_val));
+
+  ecma_object_t *func_object_p = NULL;
+  if (!ecma_is_value_undefined (map_fn_val))
+  {
+    func_object_p = ecma_get_object_from_value (map_fn_val);
+  }
+
+  /* 10 */
+  ECMA_TRY_CATCH (arraylike_object_val,
+                  ecma_op_to_object (items_val),
+                  ret_value);
+
+  ecma_object_t *arraylike_object_p = ecma_get_object_from_value (arraylike_object_val);
+
+  /* 12 */
+  ecma_string_t magic_string_length;
+  ecma_init_ecma_length_string (&magic_string_length);
+
+  ECMA_TRY_CATCH (len_value,
+                  ecma_op_object_get (arraylike_object_p, &magic_string_length),
+                  ret_value);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (len_number, len_value, ret_value);
+
+  uint32_t len = ecma_number_to_uint32 (len_number);
+
+  /* 14 */
+  ecma_value_t new_typedarray = ecma_typedarray_create_object_with_length (len,
+                                                                           proto_p,
+                                                                           element_size_shift,
+                                                                           class_id);
+
+  if (ECMA_IS_VALUE_ERROR (new_typedarray))
+  {
+    ret_value = ecma_copy_value (new_typedarray);
+  }
+
+  ecma_object_t *new_typedarray_p = ecma_get_object_from_value (new_typedarray);
+
+  /* 17 */
+  ecma_value_t current_index;
+
+  for (uint32_t index = 0; index < len && ecma_is_value_empty (ret_value); index++)
+  {
+    /* 17.a */
+    ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (index);
+
+    /* 17.b */
+    ECMA_TRY_CATCH (current_value, ecma_op_object_find (arraylike_object_p, index_str_p), ret_value);
+
+    if (ecma_is_value_found (current_value))
+    {
+      if (func_object_p != NULL)
+      {
+        /* 17.d 17.f */
+        current_index = ecma_make_uint32_value (index);
+        ecma_value_t call_args[] = { current_value, current_index};
+
+        ECMA_TRY_CATCH (mapped_value, ecma_op_function_call (func_object_p, this_val, call_args, 2), ret_value);
+
+        bool set_status = ecma_op_typedarray_set_index_prop (new_typedarray_p, index, mapped_value);
+
+        if (!set_status)
+        {
+          ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type."));;
+        }
+
+        ECMA_FINALIZE (mapped_value);
+      }
+      else
+      {
+        /* 17.e 17.f */
+        bool set_status = ecma_op_typedarray_set_index_prop (new_typedarray_p, index, current_value);
+
+        if (!set_status)
+        {
+          ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type."));;
+        }
+      }
+    }
+
+    ECMA_FINALIZE (current_value);
+
+    ecma_deref_ecma_string (index_str_p);
+  }
+
+  if (ecma_is_value_empty (ret_value))
+  {
+    ret_value = ecma_make_object_value (new_typedarray_p);
+  }
+  else
+  {
+    ecma_deref_object (new_typedarray_p);
+  }
+
+  ECMA_OP_TO_NUMBER_FINALIZE (len_number);
+  ECMA_FINALIZE (len_value);
+  ECMA_FINALIZE (arraylike_object_val);
+
+  return ret_value;
+} /* ecma_op_typedarray_from */
+
+/**
+ * Get the array length of the typedarray object
+ *
+ * @return the pointer to the internal arraybuffer
+ */
+inline ecma_object_t * __attr_always_inline___
+ecma_typedarray_get_arraybuffer (ecma_object_t *typedarray_p) /**< the pointer to the typedarray object */
+{
+  JERRY_ASSERT (ecma_is_typedarray (ecma_make_object_value (typedarray_p)));
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) typedarray_p;
+
+  return ecma_get_object_from_value (ext_object_p->u.pseudo_array.u2.arraybuffer);
+} /* ecma_typedarray_get_arraybuffer */
+
+/**
+ * Get the element size shift in the typedarray object
+ *
+ * @return the size shift of the element, size is 1 << shift
+ */
+uint8_t
+ecma_typedarray_get_element_size_shift (ecma_object_t *typedarray_p) /**< the pointer to the typedarray object */
+{
+  JERRY_ASSERT (ecma_is_typedarray (ecma_make_object_value (typedarray_p)));
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) typedarray_p;
+
+  return ext_object_p->u.pseudo_array.extra_info;
+} /* ecma_typedarray_get_element_size_shift */
+
+
+/**
+ * Get the array length of the typedarray object
+ *
+ * @return the array length
+ */
+ecma_length_t
+ecma_typedarray_get_length (ecma_object_t *typedarray_p) /**< the pointer to the typedarray object */
+{
+  JERRY_ASSERT (ecma_is_typedarray (ecma_make_object_value (typedarray_p)));
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) typedarray_p;
+
+  if (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_TYPEDARRAY)
+  {
+    ecma_object_t *arraybuffer_p = ecma_get_object_from_value (ext_object_p->u.pseudo_array.u2.arraybuffer);
+    ecma_length_t buffer_length = ecma_arraybuffer_get_length (arraybuffer_p);
+    uint8_t shift = ext_object_p->u.pseudo_array.extra_info;
+
+    return buffer_length >> shift;
+  }
+
+  ecma_extended_typedarray_object_t *info_p = (ecma_extended_typedarray_object_t *) ext_object_p;
+
+  return info_p->array_length;
+} /* ecma_typedarray_get_length */
+
+/**
+ * Get the offset of the internal arraybuffer
+ *
+ * @return the offset
+ */
+ecma_length_t
+ecma_typedarray_get_offset (ecma_object_t *typedarray_p) /**< the pointer to the typedarray object */
+{
+  JERRY_ASSERT (ecma_is_typedarray (ecma_make_object_value (typedarray_p)));
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) typedarray_p;
+
+  if (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_TYPEDARRAY)
+  {
+    return 0;
+  }
+
+  ecma_extended_typedarray_object_t *info_p = (ecma_extended_typedarray_object_t *) ext_object_p;
+
+  return info_p->byte_offset;
+} /* ecma_typedarray_get_offset */
+
+/**
+ * Utility function: return the pointer of the data buffer referenced by the typed array
+ *
+ * @return pointer to the data buffer
+ */
+lit_utf8_byte_t *
+ecma_typedarray_get_buffer (ecma_object_t *typedarray_p) /**< the pointer to the typed array object */
+{
+  ecma_object_t *arraybuffer_p = ecma_typedarray_get_arraybuffer (typedarray_p);
+
+  return ecma_arraybuffer_get_buffer (arraybuffer_p) + ecma_typedarray_get_offset (typedarray_p);
+} /* ecma_typedarray_get_buffer */
+
+/**
+ * Create a new typedarray object.
+ *
+ * The struct of the typedarray object
+ *   ecma_object_t
+ *   extend_part
+ *   typedarray_info
+ *
+ * @return ecma value of the new typedarray object
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg list passed to typedarray construct */
+                           ecma_length_t arguments_list_len, /**< the length of the arguments_list_p */
+                           ecma_object_t *proto_p, /**< prototype object */
+                           uint8_t element_size_shift, /**< the size shift of the element length */
+                           lit_magic_string_id_t class_id) /**< class name of the typedarray */
+{
+  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
+
+  ecma_value_t ret = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (arguments_list_len == 0)
+  {
+    /* 22.2.1.1 */
+    ret = ecma_typedarray_create_object_with_length (0, proto_p, element_size_shift, class_id);
+  }
+  else if (!ecma_is_value_object (arguments_list_p[0]))
+  {
+    /* 22.2.1.2 */
+    if (ecma_is_value_undefined (arguments_list_p[0]))
+    {
+      return ecma_raise_type_error (ECMA_ERR_MSG ("length argument is undefined"));
+    }
+
+    ECMA_OP_TO_NUMBER_TRY_CATCH (num, arguments_list_p[0], ret);
+
+    uint32_t length = ecma_number_to_uint32 (num);
+
+    if (num != ((ecma_number_t) length))
+    {
+      ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid typedarray length."));
+    }
+    else
+    {
+      ret = ecma_typedarray_create_object_with_length (length,
+                                                       proto_p,
+                                                       element_size_shift,
+                                                       class_id);
+    }
+
+    ECMA_OP_TO_NUMBER_FINALIZE (num);
+  }
+  else if (ecma_is_value_object (arguments_list_p[0]))
+  {
+    if (ecma_is_typedarray (arguments_list_p[0]))
+    {
+      /* 22.2.1.3 */
+      ecma_object_t *typedarray_p = ecma_get_object_from_value (arguments_list_p[0]);
+      ret = ecma_typedarray_create_object_with_typedarray (typedarray_p,
+                                                           proto_p,
+                                                           element_size_shift,
+                                                           class_id);
+    }
+    else if (ecma_is_arraybuffer (arguments_list_p[0]))
+    {
+      /* 22.2.1.5 */
+      ecma_object_t *arraybuffer_p = ecma_get_object_from_value (arguments_list_p[0]);
+      ecma_value_t arg2 = ((arguments_list_len > 1) ? arguments_list_p[1]
+                                                    : ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED));
+
+      ecma_value_t arg3 = ((arguments_list_len > 2) ? arguments_list_p[2]
+                                                    : ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED));
+
+      ECMA_OP_TO_NUMBER_TRY_CATCH (num2, arg2, ret);
+
+      uint32_t offset = ecma_number_to_uint32 (num2);
+
+      if (ecma_number_is_negative (ecma_number_to_int32 (num2)) || (offset % (uint32_t) (1 << element_size_shift) != 0))
+      {
+        ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid offset."));
+      }
+      else
+      {
+        ecma_length_t buf_byte_length = ecma_arraybuffer_get_length (arraybuffer_p);
+        ecma_length_t new_byte_length = 0;
+
+        if (ecma_is_value_undefined (arg3))
+        {
+          if (buf_byte_length % (uint32_t) (1 << element_size_shift) != 0)
+          {
+            ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid length."));
+          }
+          else if (buf_byte_length < offset)
+          {
+            ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid length."));
+          }
+          else
+          {
+            new_byte_length = (ecma_length_t) (buf_byte_length - offset);
+          }
+        }
+        else
+        {
+          ECMA_OP_TO_NUMBER_TRY_CATCH (num3, arg3, ret);
+          int32_t new_length = ecma_number_to_int32 (num3);
+          new_length = (new_length > 0) ? new_length : 0;
+
+          if ((uint32_t) new_length > (UINT32_MAX >> element_size_shift))
+          {
+            ret = ecma_raise_range_error (ECMA_ERR_MSG ("Maximum typedarray size is reached."));
+          }
+
+          new_byte_length = (ecma_length_t) new_length << element_size_shift;
+
+          if (new_byte_length + offset > buf_byte_length)
+          {
+            ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid length."));
+          }
+
+          ECMA_OP_TO_NUMBER_FINALIZE (num3);
+        }
+
+        if (ecma_is_value_empty (ret))
+        {
+          ecma_length_t array_length = new_byte_length >> element_size_shift;
+          ret = ecma_typedarray_create_object_with_buffer (arraybuffer_p,
+                                                           offset,
+                                                           array_length,
+                                                           proto_p,
+                                                           element_size_shift,
+                                                           class_id);
+        }
+      }
+
+      ECMA_OP_TO_NUMBER_FINALIZE (num2);
+    }
+    else
+    {
+      /* 22.2.1.4 */
+      ecma_value_t undef = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+      ret = ecma_op_typedarray_from (arguments_list_p[0],
+                                     undef,
+                                     undef,
+                                     proto_p,
+                                     element_size_shift,
+                                     class_id);
+    }
+  }
+
+  return ret;
+} /* ecma_op_create_typedarray */
+
+/**
+ * Check if the value is typedarray
+ *
+ * @return true - if value is a TypedArray object
+ *         false - otherwise
+ */
+bool
+ecma_is_typedarray (ecma_value_t value) /**< the target need to be checked */
+{
+  if (!ecma_is_value_object (value))
+  {
+    return false;
+  }
+
+  ecma_object_t *obj_p = ecma_get_object_from_value (value);
+
+  if (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_PSEUDO_ARRAY)
+  {
+    ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+
+    return ((ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_TYPEDARRAY)
+            || (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO));
+  }
+
+  return false;
+} /* ecma_is_typedarray */
+
+/**
+ * List names of a TypedArray object's integer indexed properties
+ *
+ * @return void
+ */
+void
+ecma_op_typedarray_list_lazy_property_names (ecma_object_t *obj_p, /**< a TypedArray object */
+                                             ecma_collection_header_t *main_collection_p) /**< 'main'
+                                                                                           *   collection */
+{
+  JERRY_ASSERT (ecma_is_typedarray (ecma_make_object_value (obj_p)));
+
+  ecma_length_t array_length = ecma_typedarray_get_length (obj_p);
+
+  for (ecma_length_t i = 0; i < array_length; i++)
+  {
+    ecma_string_t *name_p = ecma_new_ecma_string_from_uint32 (i);
+
+    ecma_append_to_values_collection (main_collection_p, ecma_make_string_value (name_p), true);
+
+    ecma_deref_ecma_string (name_p);
+  }
+} /* ecma_op_typedarray_list_lazy_property_names */
+
+/**
+ * Get the integer number property value of the typedarray
+ *
+ * See also: ES2015 9.4.5.8
+ *
+ * @return ecma value
+ *         returns undefined if index is greater or equal than length
+ */
+ecma_value_t
+ecma_op_typedarray_get_index_prop (ecma_object_t *obj_p, /**< a TypedArray object */
+                                   uint32_t index) /**< the index number */
+{
+  JERRY_ASSERT (ecma_is_typedarray (ecma_make_object_value (obj_p)));
+
+  ecma_length_t array_length = ecma_typedarray_get_length (obj_p);
+
+  if (index >= array_length)
+  {
+    return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  }
+
+  ecma_object_t *arraybuffer_p = ecma_typedarray_get_arraybuffer (obj_p);
+  ecma_length_t offset = ecma_typedarray_get_offset (obj_p);
+  uint8_t shift = ecma_typedarray_get_element_size_shift (obj_p);
+  ecma_length_t byte_pos = (index << shift) + offset;
+  lit_magic_string_id_t class_id = ecma_object_get_class_name (obj_p);
+  lit_utf8_byte_t *target_p = ecma_arraybuffer_get_buffer (arraybuffer_p) + byte_pos;
+  ecma_number_t value = get_typedarray_element (target_p, class_id);
+
+  return ecma_make_number_value (value);
+} /* ecma_op_typedarray_get_index_prop */
+
+/**
+ * Define the integer number property value of the typedarray
+ *
+ * See also: ES2015 9.4.5.3: 3.c
+ *
+ * @return boolean, false if failed
+ */
+bool
+ecma_op_typedarray_define_index_prop (ecma_object_t *obj_p, /**< a TypedArray object */
+                                      uint32_t index, /**< the index number */
+                                      const ecma_property_descriptor_t *property_desc_p) /**< the description of
+                                                                                               the prop */
+{
+  JERRY_ASSERT (ecma_is_typedarray (ecma_make_object_value (obj_p)));
+
+  ecma_length_t array_length = ecma_typedarray_get_length (obj_p);
+
+  if (index >= array_length)
+  {
+    return false;
+  }
+
+  if (property_desc_p->is_get_defined
+      || property_desc_p->is_set_defined)
+  {
+    return false;
+  }
+
+  if ((property_desc_p->is_configurable_defined && property_desc_p->is_configurable)
+      || (property_desc_p->is_enumerable_defined && !property_desc_p->is_enumerable)
+      || (property_desc_p->is_writable_defined && !property_desc_p->is_writable))
+  {
+    return false;
+  }
+
+  if (property_desc_p->is_value_defined)
+  {
+    return ecma_op_typedarray_set_index_prop (obj_p, index, property_desc_p->value);
+  }
+
+  return true;
+} /* ecma_op_typedarray_define_index_prop */
+
+/**
+ * Set the integer number property value of the typedarray
+ *
+ * See also: ES2015 9.4.5.9
+ *
+ * @return boolean, false if failed
+ */
+bool
+ecma_op_typedarray_set_index_prop (ecma_object_t *obj_p, /**< a TypedArray object */
+                                   uint32_t index, /**< the index number */
+                                   ecma_value_t value) /**< value of the property */
+{
+  JERRY_ASSERT (ecma_is_typedarray (ecma_make_object_value (obj_p)));
+
+  ecma_length_t array_length = ecma_typedarray_get_length (obj_p);
+
+  if (index >= array_length)
+  {
+    return false;
+  }
+
+  ecma_value_t error = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (value_num, value, error);
+
+  ecma_object_t *arraybuffer_p = ecma_typedarray_get_arraybuffer (obj_p);
+  ecma_length_t offset = ecma_typedarray_get_offset (obj_p);
+  uint8_t shift = ecma_typedarray_get_element_size_shift (obj_p);
+  ecma_length_t byte_pos = (index << shift) + offset;
+  lit_magic_string_id_t class_id = ecma_object_get_class_name (obj_p);
+  lit_utf8_byte_t *target_p = ecma_arraybuffer_get_buffer (arraybuffer_p) + byte_pos;
+  set_typedarray_element (target_p, value_num, class_id);
+
+  ECMA_OP_TO_NUMBER_FINALIZE (value_num);
+
+  if (ecma_is_value_empty (error))
+  {
+    return true;
+  }
+
+  return false;
+} /* ecma_op_typedarray_set_index_prop */
+
+/**
+ * Create a typedarray object based on the "type" and arraylength
+ * The "type" is same with arg1
+ *
+ * @return ecma_value_t
+ */
+ecma_value_t
+ecma_op_create_typedarray_with_type_and_length (ecma_object_t *obj_p, /**< TypedArray object
+                                                                        *  indicates the type */
+                                                ecma_length_t array_length) /**< length of the typedarray */
+{
+  JERRY_ASSERT (ecma_is_typedarray (ecma_make_object_value (obj_p)));
+
+  ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
+  lit_magic_string_id_t class_id = ext_object_p->u.pseudo_array.u1.class_id;
+  ecma_object_t *proto_p;
+  uint8_t element_size_shift = 0;
+
+  switch (class_id)
+  {
+    case LIT_MAGIC_STRING_INT8_ARRAY_UL:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_INT8ARRAY_PROTOTYPE);
+      element_size_shift = 0;
+      break;
+    }
+    case LIT_MAGIC_STRING_UINT8_ARRAY_UL:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT8ARRAY_PROTOTYPE);
+      element_size_shift = 0;
+      break;
+    }
+    case LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE);
+      element_size_shift = 0;
+      break;
+    }
+    case LIT_MAGIC_STRING_INT16_ARRAY_UL:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_INT16ARRAY_PROTOTYPE);
+      element_size_shift = 1;
+      break;
+    }
+    case LIT_MAGIC_STRING_UINT16_ARRAY_UL:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT16ARRAY_PROTOTYPE);
+      element_size_shift = 1;
+      break;
+    }
+    case LIT_MAGIC_STRING_INT32_ARRAY_UL:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_INT32ARRAY_PROTOTYPE);
+      element_size_shift = 2;
+      break;
+    }
+    case LIT_MAGIC_STRING_UINT32_ARRAY_UL:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE);
+      element_size_shift = 2;
+      break;
+    }
+    case LIT_MAGIC_STRING_FLOAT32_ARRAY_UL:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE);
+      element_size_shift = 2;
+      break;
+    }
+#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
+    case LIT_MAGIC_STRING_FLOAT64_ARRAY_UL:
+    {
+      proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE);
+      element_size_shift = 3;
+      break;
+    }
+#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
+    default:
+    {
+      JERRY_UNREACHABLE ();
+    }
+  }
+
+  ecma_value_t new_obj = ecma_typedarray_create_object_with_length (array_length,
+                                                                    proto_p,
+                                                                    element_size_shift,
+                                                                    class_id);
+
+  ecma_deref_object (proto_p);
+
+  return new_obj;
+} /* ecma_op_create_typedarray_with_type_and_length */
+
+/**
+ * @}
+ * @}
+ */
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
diff --git a/deps/jerry/jerry-core/ecma/operations/ecma-typedarray-object.h b/deps/jerry/jerry-core/ecma/operations/ecma-typedarray-object.h
new file mode 100644 (file)
index 0000000..31bb5bd
--- /dev/null
@@ -0,0 +1,62 @@
+/* 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.
+ */
+
+#ifndef ECMA_TYPEDARRAY_OBJECT_H
+#define ECMA_TYPEDARRAY_OBJECT_H
+#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+
+#include "ecma-globals.h"
+
+/** \addtogroup ecma ECMA
+ * @{
+ *
+ * \addtogroup ecmatypedarrayobject ECMA TypedArray object related routines
+ * @{
+ */
+
+ecma_value_t ecma_op_typedarray_from (ecma_value_t items_val,
+                                      ecma_value_t map_fn_val,
+                                      ecma_value_t this_val,
+                                      ecma_object_t *proto_p,
+                                      uint8_t element_size_shift,
+                                      lit_magic_string_id_t class_id);
+ecma_length_t ecma_typedarray_get_length (ecma_object_t *typedarray_p);
+ecma_length_t ecma_typedarray_get_offset (ecma_object_t *typedarray_p);
+lit_utf8_byte_t *ecma_typedarray_get_buffer (ecma_object_t *typedarray_p);
+uint8_t ecma_typedarray_get_element_size_shift (ecma_object_t *typedarray_p);
+ecma_object_t *ecma_typedarray_get_arraybuffer (ecma_object_t *typedarray_p);
+ecma_value_t ecma_op_create_typedarray (const ecma_value_t *arguments_list_p,
+                                        ecma_length_t arguments_list_len,
+                                        ecma_object_t *proto_p,
+                                        uint8_t element_size_shift,
+                                        lit_magic_string_id_t class_id);
+bool ecma_is_typedarray (ecma_value_t target);
+void ecma_op_typedarray_list_lazy_property_names (ecma_object_t *obj_p,
+                                                  ecma_collection_header_t *main_collection_p);
+ecma_value_t ecma_op_typedarray_get_index_prop (ecma_object_t *obj_p, uint32_t index);
+bool ecma_op_typedarray_define_index_prop (ecma_object_t *obj_p,
+                                           uint32_t index,
+                                           const ecma_property_descriptor_t *property_desc_p);
+bool ecma_op_typedarray_set_index_prop (ecma_object_t *obj_p, uint32_t index, ecma_value_t value);
+ecma_value_t ecma_op_create_typedarray_with_type_and_length (ecma_object_t *obj_p,
+                                                             ecma_length_t array_length);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
+#endif /* !ECMA_TYPEDARRAY_OBJECT_H */
diff --git a/deps/jerry/jerry-core/include/jerry-api.h b/deps/jerry/jerry-core/include/jerry-api.h
new file mode 100644 (file)
index 0000000..65b8335
--- /dev/null
@@ -0,0 +1,23 @@
+/* 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.
+ */
+
+#ifndef JERRY_API_H
+#define JERRY_API_H
+
+#pragma message ("using jerry-api.h directly is deprecated, please use jerryscript.h")
+
+#include "jerryscript.h"
+
+#endif /* !JERRY_API_H */
diff --git a/deps/jerry/jerry-core/include/jerry-port.h b/deps/jerry/jerry-core/include/jerry-port.h
new file mode 100644 (file)
index 0000000..fe6bc37
--- /dev/null
@@ -0,0 +1,23 @@
+/* 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.
+ */
+
+#ifndef JERRY_PORT_H
+#define JERRY_PORT_H
+
+#pragma message ("using jerry-port.h directly is deprecated, please use jerryscript-port.h")
+
+#include "jerryscript-port.h"
+
+#endif /* !JERRY_PORT_H */
diff --git a/deps/jerry/jerry-core/include/jerryscript-core.h b/deps/jerry/jerry-core/include/jerryscript-core.h
new file mode 100644 (file)
index 0000000..b70768a
--- /dev/null
@@ -0,0 +1,431 @@
+/* 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.
+ */
+
+#ifndef JERRYSCRIPT_CORE_H
+#define JERRYSCRIPT_CORE_H
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#ifdef __GNUC__
+#define JERRY_DEPRECATED_API __attribute__((deprecated))
+#else /* !__GNUC__ */
+/* TODO: for other compilers */
+#define JERRY_DEPRECATED_API
+#endif /* __GNUC__ */
+
+/** \addtogroup jerry Jerry engine interface
+ * @{
+ */
+
+/**
+ * Major version of JerryScript API.
+ */
+#define JERRY_API_MAJOR_VERSION 1
+
+/**
+ * Minor version of JerryScript API.
+ */
+#define JERRY_API_MINOR_VERSION 0
+
+/**
+ * JerryScript init flags.
+ */
+typedef enum
+{
+  JERRY_INIT_EMPTY               = (0u),      /**< empty flag set */
+  JERRY_INIT_SHOW_OPCODES        = (1u << 0), /**< dump byte-code to log after parse */
+  JERRY_INIT_SHOW_REGEXP_OPCODES = (1u << 1), /**< dump regexp byte-code to log after compilation */
+  JERRY_INIT_MEM_STATS           = (1u << 2), /**< dump memory statistics */
+  JERRY_INIT_MEM_STATS_SEPARATE  = (1u << 3), /**< deprecated, an unused placeholder now */
+  JERRY_INIT_DEBUGGER            = (1u << 4), /**< deprecated, an unused placeholder now */
+} jerry_init_flag_t;
+
+/**
+ * JerryScript API Error object types.
+ */
+typedef enum
+{
+  JERRY_ERROR_COMMON,    /**< Error */
+  JERRY_ERROR_EVAL,      /**< EvalError */
+  JERRY_ERROR_RANGE,     /**< RangeError */
+  JERRY_ERROR_REFERENCE, /**< ReferenceError */
+  JERRY_ERROR_SYNTAX,    /**< SyntaxError */
+  JERRY_ERROR_TYPE,      /**< TypeError */
+  JERRY_ERROR_URI        /**< URIError */
+} jerry_error_t;
+
+/**
+ * JerryScript feature types.
+ */
+typedef enum
+{
+  JERRY_FEATURE_CPOINTER_32_BIT, /**< 32 bit compressed pointers */
+  JERRY_FEATURE_ERROR_MESSAGES, /**< error messages */
+  JERRY_FEATURE_JS_PARSER, /**< js-parser */
+  JERRY_FEATURE_MEM_STATS, /**< memory statistics */
+  JERRY_FEATURE_PARSER_DUMP, /**< parser byte-code dumps */
+  JERRY_FEATURE_REGEXP_DUMP, /**< regexp byte-code dumps */
+  JERRY_FEATURE_SNAPSHOT_SAVE, /**< saving snapshot files */
+  JERRY_FEATURE_SNAPSHOT_EXEC, /**< executing snapshot files */
+  JERRY_FEATURE_DEBUGGER, /**< debugging */
+  JERRY_FEATURE_VM_EXEC_STOP, /**< stopping ECMAScript execution */
+  JERRY_FEATURE__COUNT /**< number of features. NOTE: must be at the end of the list */
+} jerry_feature_t;
+
+/**
+ * Character type of JerryScript.
+ */
+typedef uint8_t jerry_char_t;
+
+/**
+ * Pointer to an array of character values.
+ */
+typedef jerry_char_t *jerry_char_ptr_t;
+
+/**
+ * Size type of JerryScript.
+ */
+typedef uint32_t jerry_size_t;
+
+/**
+ * Length type of JerryScript.
+ */
+typedef uint32_t jerry_length_t;
+
+/**
+ * Description of a JerryScript value.
+ */
+typedef uint32_t jerry_value_t;
+
+/**
+ * Description of ECMA property descriptor.
+ */
+typedef struct
+{
+  /** Is [[Value]] defined? */
+  bool is_value_defined;
+
+  /** Is [[Get]] defined? */
+  bool is_get_defined;
+
+  /** Is [[Set]] defined? */
+  bool is_set_defined;
+
+  /** Is [[Writable]] defined? */
+  bool is_writable_defined;
+
+  /** [[Writable]] */
+  bool is_writable;
+
+  /** Is [[Enumerable]] defined? */
+  bool is_enumerable_defined;
+
+  /** [[Enumerable]] */
+  bool is_enumerable;
+
+  /** Is [[Configurable]] defined? */
+  bool is_configurable_defined;
+
+  /** [[Configurable]] */
+  bool is_configurable;
+
+  /** [[Value]] */
+  jerry_value_t value;
+
+  /** [[Get]] */
+  jerry_value_t getter;
+
+  /** [[Set]] */
+  jerry_value_t setter;
+} jerry_property_descriptor_t;
+
+/**
+ * Type of an external function handler.
+ */
+typedef jerry_value_t (*jerry_external_handler_t) (const jerry_value_t function_obj,
+                                                   const jerry_value_t this_val,
+                                                   const jerry_value_t args_p[],
+                                                   const jerry_length_t args_count);
+
+/**
+ * Native free callback of an object (deprecated).
+ */
+typedef void (*jerry_object_free_callback_t) (const uintptr_t native_p);
+
+/**
+ * Native free callback of an object.
+ */
+typedef void (*jerry_object_native_free_callback_t) (void *native_p);
+
+/**
+ * Callback which tells whether the ECMAScript execution should be stopped.
+ *
+ * As long as the function returns with undefined the execution continues.
+ * When a non-undefined value is returned the execution stops and the value
+ * is thrown by the engine (if the error flag is not set for the returned
+ * value the engine automatically sets it).
+ *
+ * Note: if the function returns with a non-undefined value it
+ *       must return with the same value for future calls.
+ */
+typedef jerry_value_t (*jerry_vm_exec_stop_callback_t) (void *user_p);
+
+/**
+ * Function type applied for each data property of an object.
+ */
+typedef bool (*jerry_object_property_foreach_t) (const jerry_value_t property_name,
+                                                 const jerry_value_t property_value,
+                                                 void *user_data_p);
+
+/**
+ * User context item manager
+ */
+typedef struct
+{
+  void (*init_cb) (void *); /**< callback responsible for initializing a context item, or NULL to zero out the memory */
+  void (*deinit_cb) (void *); /**< callback responsible for deinitializing a context item */
+  size_t bytes_needed; /**< number of bytes to allocate for this manager */
+} jerry_context_data_manager_t;
+
+/**
+ * Function type for allocating buffer for JerryScript instance.
+ */
+typedef void *(*jerry_instance_alloc_t) (size_t size, void *cb_data_p);
+
+/**
+ * Type information of a native pointer.
+ */
+typedef struct
+{
+  jerry_object_native_free_callback_t free_cb; /**< the free callback of the native pointer */
+} jerry_object_native_info_t;
+
+/**
+ * A forward declaration of the JerryScript instance structure.
+ */
+typedef struct jerry_instance_t jerry_instance_t;
+
+/**
+ * General engine functions.
+ */
+void jerry_init (jerry_init_flag_t flags);
+void jerry_cleanup (void);
+void jerry_register_magic_strings (const jerry_char_ptr_t *ex_str_items_p, uint32_t count,
+                                   const jerry_length_t *str_lengths_p);
+void jerry_get_memory_limits (size_t *out_data_bss_brk_limit_p, size_t *out_stack_limit_p);
+void jerry_gc (void);
+void *jerry_get_context_data (const jerry_context_data_manager_t *manager_p);
+
+/**
+ * Parser and executor functions.
+ */
+bool jerry_run_simple (const jerry_char_t *script_source_p, size_t script_source_size, jerry_init_flag_t flags);
+jerry_value_t jerry_parse (const jerry_char_t *source_p, size_t source_size, bool is_strict);
+jerry_value_t jerry_parse_named_resource (const jerry_char_t *name_p, size_t name_length,
+                                          const jerry_char_t *source_p, size_t source_size, bool is_strict);
+jerry_value_t jerry_run (const jerry_value_t func_val);
+jerry_value_t jerry_eval (const jerry_char_t *source_p, size_t source_size, bool is_strict);
+
+jerry_value_t jerry_run_all_enqueued_jobs (void);
+
+/**
+ * Get the global context.
+ */
+jerry_value_t jerry_get_global_object (void);
+
+/**
+ * Checker functions of 'jerry_value_t'.
+ */
+bool jerry_value_is_array (const jerry_value_t value);
+bool jerry_value_is_boolean (const jerry_value_t value);
+bool jerry_value_is_constructor (const jerry_value_t value);
+bool jerry_value_is_function (const jerry_value_t value);
+bool jerry_value_is_number (const jerry_value_t value);
+bool jerry_value_is_null (const jerry_value_t value);
+bool jerry_value_is_object (const jerry_value_t value);
+bool jerry_value_is_promise (const jerry_value_t value);
+bool jerry_value_is_string (const jerry_value_t value);
+bool jerry_value_is_undefined (const jerry_value_t value);
+
+/**
+ * Checker function of whether the specified compile feature is enabled.
+ */
+bool jerry_is_feature_enabled (const jerry_feature_t feature);
+
+/**
+ * Error flag manipulation functions.
+ */
+bool jerry_value_has_error_flag (const jerry_value_t value);
+void jerry_value_clear_error_flag (jerry_value_t *value_p);
+void jerry_value_set_error_flag (jerry_value_t *value_p);
+
+/**
+ * Getter functions of 'jerry_value_t'.
+ */
+bool jerry_get_boolean_value (const jerry_value_t value);
+double jerry_get_number_value (const jerry_value_t value);
+
+/**
+ * Functions for string values.
+ */
+jerry_size_t jerry_get_string_size (const jerry_value_t value);
+jerry_size_t jerry_get_utf8_string_size (const jerry_value_t value);
+jerry_length_t jerry_get_string_length (const jerry_value_t value);
+jerry_length_t jerry_get_utf8_string_length (const jerry_value_t value);
+jerry_size_t jerry_string_to_char_buffer (const jerry_value_t value, jerry_char_t *buffer_p, jerry_size_t buffer_size);
+jerry_size_t jerry_string_to_utf8_char_buffer (const jerry_value_t value,
+                                               jerry_char_t *buffer_p,
+                                               jerry_size_t buffer_size);
+jerry_size_t jerry_substring_to_char_buffer (const jerry_value_t value,
+                                             jerry_length_t start_pos,
+                                             jerry_length_t end_pos,
+                                             jerry_char_t *buffer_p,
+                                             jerry_size_t buffer_size);
+jerry_size_t jerry_substring_to_utf8_char_buffer (const jerry_value_t value,
+                                                  jerry_length_t start_pos,
+                                                  jerry_length_t end_pos,
+                                                  jerry_char_t *buffer_p,
+                                                  jerry_size_t buffer_size);
+
+/**
+ * Functions for array object values.
+ */
+uint32_t jerry_get_array_length (const jerry_value_t value);
+
+/**
+ * Converters of 'jerry_value_t'.
+ */
+bool jerry_value_to_boolean (const jerry_value_t value);
+jerry_value_t jerry_value_to_number (const jerry_value_t value);
+jerry_value_t jerry_value_to_object (const jerry_value_t value);
+jerry_value_t jerry_value_to_primitive (const jerry_value_t value);
+jerry_value_t jerry_value_to_string (const jerry_value_t value);
+
+/**
+ * Acquire types with reference counter (increase the references).
+ */
+jerry_value_t jerry_acquire_value (jerry_value_t value);
+
+/**
+ * Release the referenced values.
+ */
+void jerry_release_value (jerry_value_t value);
+
+/**
+ * Create functions of API values.
+ */
+jerry_value_t jerry_create_array (uint32_t size);
+jerry_value_t jerry_create_boolean (bool value);
+jerry_value_t jerry_create_error (jerry_error_t error_type, const jerry_char_t *message_p);
+jerry_value_t jerry_create_error_sz (jerry_error_t error_type, const jerry_char_t *message_p,
+                                     jerry_size_t message_size);
+jerry_value_t jerry_create_external_function (jerry_external_handler_t handler_p);
+jerry_value_t jerry_create_number (double value);
+jerry_value_t jerry_create_number_infinity (bool sign);
+jerry_value_t jerry_create_number_nan (void);
+jerry_value_t jerry_create_null (void);
+jerry_value_t jerry_create_object (void);
+jerry_value_t jerry_create_promise (void);
+jerry_value_t jerry_create_string_from_utf8 (const jerry_char_t *str_p);
+jerry_value_t jerry_create_string_sz_from_utf8 (const jerry_char_t *str_p, jerry_size_t str_size);
+jerry_value_t jerry_create_string (const jerry_char_t *str_p);
+jerry_value_t jerry_create_string_sz (const jerry_char_t *str_p, jerry_size_t str_size);
+jerry_value_t jerry_create_undefined (void);
+
+/**
+ * General API functions of JS objects.
+ */
+jerry_value_t jerry_has_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val);
+jerry_value_t jerry_has_own_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val);
+bool jerry_delete_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val);
+
+jerry_value_t jerry_get_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val);
+jerry_value_t jerry_get_property_by_index (const jerry_value_t  obj_val, uint32_t index);
+jerry_value_t jerry_set_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val,
+                                  const jerry_value_t value_to_set);
+jerry_value_t jerry_set_property_by_index (const jerry_value_t obj_val, uint32_t index,
+                                           const jerry_value_t value_to_set);
+
+void jerry_init_property_descriptor_fields (jerry_property_descriptor_t *prop_desc_p);
+jerry_value_t jerry_define_own_property (const jerry_value_t obj_val,
+                                         const jerry_value_t prop_name_val,
+                                         const jerry_property_descriptor_t *prop_desc_p);
+
+bool jerry_get_own_property_descriptor (const jerry_value_t obj_val,
+                                        const jerry_value_t prop_name_val,
+                                        jerry_property_descriptor_t *prop_desc_p);
+void jerry_free_property_descriptor_fields (const jerry_property_descriptor_t *prop_desc_p);
+
+jerry_value_t jerry_call_function (const jerry_value_t func_obj_val, const jerry_value_t this_val,
+                                   const jerry_value_t args_p[], jerry_size_t args_count);
+jerry_value_t jerry_construct_object (const jerry_value_t func_obj_val, const jerry_value_t args_p[],
+                                      jerry_size_t args_count);
+
+jerry_value_t jerry_get_object_keys (const jerry_value_t obj_val);
+jerry_value_t jerry_get_prototype (const jerry_value_t obj_val);
+jerry_value_t jerry_set_prototype (const jerry_value_t obj_val, const jerry_value_t proto_obj_val);
+
+JERRY_DEPRECATED_API
+bool jerry_get_object_native_handle (const jerry_value_t obj_val, uintptr_t *out_handle_p);
+JERRY_DEPRECATED_API
+void jerry_set_object_native_handle (const jerry_value_t obj_val, uintptr_t handle_p,
+                                     jerry_object_free_callback_t freecb_p);
+
+bool jerry_get_object_native_pointer (const jerry_value_t obj_val,
+                                      void **out_native_pointer_p,
+                                      const jerry_object_native_info_t **out_pointer_info_p);
+void jerry_set_object_native_pointer (const jerry_value_t obj_val,
+                                      void *native_pointer_p,
+                                      const jerry_object_native_info_t *native_info_p);
+
+bool jerry_foreach_object_property (const jerry_value_t obj_val, jerry_object_property_foreach_t foreach_p,
+                                    void *user_data_p);
+
+/**
+ * Promise resolve/reject functions.
+ */
+jerry_value_t jerry_resolve_or_reject_promise (jerry_value_t promise, jerry_value_t argument, bool is_resolve);
+
+/**
+ * Input validator functions.
+ */
+bool jerry_is_valid_utf8_string (const jerry_char_t *utf8_buf_p, jerry_size_t buf_size);
+bool jerry_is_valid_cesu8_string (const jerry_char_t *cesu8_buf_p, jerry_size_t buf_size);
+
+/*
+ * External context functions.
+ */
+jerry_instance_t *jerry_create_instance (uint32_t heap_size, jerry_instance_alloc_t alloc, void *cb_data_p);
+
+/**
+ * Miscellaneous functions.
+ */
+void jerry_set_vm_exec_stop_callback (jerry_vm_exec_stop_callback_t stop_cb, void *user_p, uint32_t frequency);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRYSCRIPT_CORE_H */
diff --git a/deps/jerry/jerry-core/include/jerryscript-debugger.h b/deps/jerry/jerry-core/include/jerryscript-debugger.h
new file mode 100644 (file)
index 0000000..d1b0a37
--- /dev/null
@@ -0,0 +1,48 @@
+/* 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.
+ */
+
+#ifndef JERRYSCRIPT_DEBUGGER_H
+#define JERRYSCRIPT_DEBUGGER_H
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** \addtogroup jerry-debugger Jerry engine interface - Debugger feature
+ * @{
+ */
+
+/**
+ * Engine debugger functions.
+ */
+bool jerry_debugger_is_connected (void);
+void jerry_debugger_stop (void);
+void jerry_debugger_continue (void);
+void jerry_debugger_stop_at_breakpoint (bool enable_stop_at_breakpoint);
+
+void jerry_debugger_init (uint16_t port);
+void jerry_debugger_cleanup (void);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRYSCRIPT_DEBUGGER_H */
diff --git a/deps/jerry/jerry-core/include/jerryscript-port.h b/deps/jerry/jerry-core/include/jerryscript-port.h
new file mode 100644 (file)
index 0000000..f15db6d
--- /dev/null
@@ -0,0 +1,148 @@
+/* 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.
+ */
+
+#ifndef JERRYSCRIPT_PORT_H
+#define JERRYSCRIPT_PORT_H
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** \addtogroup jerry_port Jerry engine port
+ * @{
+ */
+
+/*
+ * Termination Port API
+ *
+ * Note:
+ *      It is questionable whether a library should be able to terminate an
+ *      application. However, as of now, we only have the concept of completion
+ *      code around jerry_parse and jerry_run. Most of the other API functions
+ *      have no way of signaling an error. So, we keep the termination approach
+ *      with this port function.
+ */
+
+/**
+ * Error codes
+ */
+typedef enum
+{
+  ERR_OUT_OF_MEMORY = 10,
+  ERR_SYSCALL = 11,
+  ERR_REF_COUNT_LIMIT = 12,
+  ERR_FAILED_INTERNAL_ASSERTION = 120
+} jerry_fatal_code_t;
+
+/**
+ * Signal the port that jerry experienced a fatal failure from which it cannot
+ * recover.
+ *
+ * @param code gives the cause of the error.
+ *
+ * Note:
+ *      Jerry expects the function not to return.
+ *
+ * Example: a libc-based port may implement this with exit() or abort(), or both.
+ */
+void jerry_port_fatal (jerry_fatal_code_t code) __attribute__((noreturn));
+
+/*
+ *  I/O Port API
+ */
+
+/**
+ * Jerry log levels. The levels are in severity order
+ * where the most serious levels come first.
+ */
+typedef enum
+{
+  JERRY_LOG_LEVEL_ERROR,    /**< the engine will terminate after the message is printed */
+  JERRY_LOG_LEVEL_WARNING,  /**< a request is aborted, but the engine continues its operation */
+  JERRY_LOG_LEVEL_DEBUG,    /**< debug messages from the engine, low volume */
+  JERRY_LOG_LEVEL_TRACE     /**< detailed info about engine internals, potentially high volume */
+} jerry_log_level_t;
+
+/**
+ * Display or log a debug/error message. The function should implement a printf-like
+ * interface, where the first argument specifies the log level
+ * and the second argument specifies a format string on how to stringify the rest
+ * of the parameter list.
+ *
+ * This function is only called with messages coming from the jerry engine as
+ * the result of some abnormal operation or describing its internal operations
+ * (e.g., data structure dumps or tracing info).
+ *
+ * It should be the port that decides whether error and debug messages are logged to
+ * the console, or saved to a database or to a file.
+ *
+ * Example: a libc-based port may implement this with vfprintf(stderr) or
+ * vfprintf(logfile), or both, depending on log level.
+ */
+void jerry_port_log (jerry_log_level_t level, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+
+/*
+ * Date Port API
+ */
+
+/**
+ * Jerry time zone structure
+ */
+typedef struct
+{
+  int offset;                /**< minutes from west */
+  int daylight_saving_time;  /**< daylight saving time (1 - DST applies, 0 - not on DST) */
+} jerry_time_zone_t;
+
+/**
+ * Get timezone and daylight saving data
+ *
+ * @return true  - if success
+ *         false - otherwise
+ */
+bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p);
+
+/**
+ * Get system time
+ *
+ * @return milliseconds since Unix epoch
+ */
+double jerry_port_get_current_time (void);
+
+/**
+ * Get the current instance which contains the current context, heap and other
+ * structures. Each port should provide its own implementation of this interface.
+ *
+ *Note:
+ *    This port function is called by jerry-core when JERRY_ENABLE_EXTERNAL_CONTEXT
+ *    is defined. Otherwise this function is not used.
+ *
+ * @return the pointer to the jerry instance.
+ */
+struct jerry_instance_t *jerry_port_get_current_instance (void);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRYSCRIPT_PORT_H */
diff --git a/deps/jerry/jerry-core/include/jerryscript-snapshot.h b/deps/jerry/jerry-core/include/jerryscript-snapshot.h
new file mode 100644 (file)
index 0000000..62aa8a8
--- /dev/null
@@ -0,0 +1,46 @@
+/* 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.
+ */
+
+#ifndef JERRYSCRIPT_SNAPSHOT_H
+#define JERRYSCRIPT_SNAPSHOT_H
+
+#include "jerryscript-core.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** \addtogroup jerry-snapshot Jerry engine interface - Snapshot feature
+ * @{
+ */
+
+/**
+ * Snapshot functions.
+ */
+size_t jerry_parse_and_save_snapshot (const jerry_char_t *source_p, size_t source_size, bool is_for_global,
+                                      bool is_strict, uint32_t *buffer_p, size_t buffer_size);
+jerry_value_t jerry_exec_snapshot (const uint32_t *snapshot_p, size_t snapshot_size, bool copy_bytecode);
+size_t jerry_parse_and_save_literals (const jerry_char_t *source_p, size_t source_size, bool is_strict,
+                                      uint32_t *buffer_p, size_t buffer_size, bool is_c_format);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRYSCRIPT_SNAPSHOT_H */
diff --git a/deps/jerry/jerry-core/include/jerryscript.h b/deps/jerry/jerry-core/include/jerryscript.h
new file mode 100644 (file)
index 0000000..041ac7e
--- /dev/null
@@ -0,0 +1,23 @@
+/* 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.
+ */
+
+#ifndef JERRYSCRIPT_H
+#define JERRYSCRIPT_H
+
+#include "jerryscript-core.h"
+#include "jerryscript-debugger.h"
+#include "jerryscript-snapshot.h"
+
+#endif /* !JERRYSCRIPT_H */
diff --git a/deps/jerry/jerry-core/jcontext/jcontext.c b/deps/jerry/jerry-core/jcontext/jcontext.c
new file mode 100644 (file)
index 0000000..a89f2aa
--- /dev/null
@@ -0,0 +1,56 @@
+/* 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.
+ */
+
+#include "jcontext.h"
+
+/** \addtogroup context Context
+ * @{
+ */
+
+#ifndef JERRY_ENABLE_EXTERNAL_CONTEXT
+/**
+ * Global context.
+ */
+jerry_context_t jerry_global_context;
+
+/**
+ * Jerry global heap section attribute.
+ */
+#ifndef JERRY_HEAP_SECTION_ATTR
+#define JERRY_GLOBAL_HEAP_SECTION
+#else /* JERRY_HEAP_SECTION_ATTR */
+#define JERRY_GLOBAL_HEAP_SECTION __attribute__ ((section (JERRY_HEAP_SECTION_ATTR)))
+#endif /* !JERRY_HEAP_SECTION_ATTR */
+
+#ifndef JERRY_SYSTEM_ALLOCATOR
+/**
+ * Global heap.
+ */
+jmem_heap_t jerry_global_heap __attribute__ ((aligned (JMEM_ALIGNMENT))) JERRY_GLOBAL_HEAP_SECTION;
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+
+/**
+ * Global hash table.
+ */
+jerry_hash_table_t jerry_global_hash_table;
+
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+#endif /* !JERRY_ENABLE_EXTERNAL_CONTEXT */
+
+/**
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/jcontext/jcontext.h b/deps/jerry/jerry-core/jcontext/jcontext.h
new file mode 100644 (file)
index 0000000..8218397
--- /dev/null
@@ -0,0 +1,294 @@
+/* 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.
+ */
+
+/**
+ * Memory context for JerryScript
+ */
+#ifndef JCONTEXT_H
+#define JCONTEXT_H
+
+#include "debugger.h"
+#include "ecma-builtins.h"
+#include "ecma-jobqueue.h"
+#include "jerryscript-port.h"
+#include "jmem.h"
+#include "re-bytecode.h"
+#include "vm-defines.h"
+#include "jerryscript.h"
+
+/** \addtogroup context Context
+ * @{
+ */
+
+/**
+ * First member of the jerry context
+ */
+#define JERRY_CONTEXT_FIRST_MEMBER ecma_builtin_objects
+
+/**
+ * User context item
+ */
+typedef struct jerry_context_data_header
+{
+  struct jerry_context_data_header *next_p; /**< pointer to next context item */
+  const jerry_context_data_manager_t *manager_p; /**< manager responsible for deleting this item */
+} jerry_context_data_header_t;
+
+#define JERRY_CONTEXT_DATA_HEADER_USER_DATA(item_p) \
+  ((uint8_t *) (item_p + 1))
+
+/**
+ * JerryScript context
+ *
+ * The purpose of this header is storing
+ * all global variables for Jerry
+ */
+typedef struct
+{
+  /* Update JERRY_CONTEXT_FIRST_MEMBER if the first member changes */
+  ecma_object_t *ecma_builtin_objects[ECMA_BUILTIN_ID__COUNT]; /**< pointer to instances of built-in objects */
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+  const re_compiled_code_t *re_cache[RE_CACHE_SIZE]; /**< regex cache */
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+  ecma_object_t *ecma_gc_objects_lists[ECMA_GC_COLOR__COUNT]; /**< List of marked (visited during
+                                                               *   current GC session) and umarked objects */
+  jmem_heap_free_t *jmem_heap_list_skip_p; /**< This is used to speed up deallocation. */
+  jmem_pools_chunk_t *jmem_free_8_byte_chunk_p; /**< list of free eight byte pool chunks */
+#ifdef JERRY_CPOINTER_32_BIT
+  jmem_pools_chunk_t *jmem_free_16_byte_chunk_p; /**< list of free sixteen byte pool chunks */
+#endif /* JERRY_CPOINTER_32_BIT */
+  jmem_free_unused_memory_callback_t jmem_free_unused_memory_callback; /**< Callback for freeing up memory. */
+  const lit_utf8_byte_t **lit_magic_string_ex_array; /**< array of external magic strings */
+  const lit_utf8_size_t *lit_magic_string_ex_sizes; /**< external magic string lengths */
+  ecma_lit_storage_item_t *string_list_first_p; /**< first item of the literal string list */
+  ecma_lit_storage_item_t *number_list_first_p; /**< first item of the literal number list */
+  ecma_object_t *ecma_global_lex_env_p; /**< global lexical environment */
+  vm_frame_ctx_t *vm_top_context_p; /**< top (current) interpreter context */
+  jerry_context_data_header_t *context_data_p; /**< linked list of user-provided context-specific pointers */
+  size_t ecma_gc_objects_number; /**< number of currently allocated objects */
+  size_t ecma_gc_new_objects; /**< number of newly allocated objects since last GC session */
+  size_t jmem_heap_allocated_size; /**< size of allocated regions */
+  size_t jmem_heap_limit; /**< current limit of heap usage, that is upon being reached,
+                           *   causes call of "try give memory back" callbacks */
+  uint32_t lit_magic_string_ex_count; /**< external magic strings count */
+  uint32_t jerry_init_flags; /**< run-time configuration flags */
+  uint8_t ecma_gc_visited_flip_flag; /**< current state of an object's visited flag */
+  uint8_t is_direct_eval_form_call; /**< direct call from eval */
+  uint8_t jerry_api_available; /**< API availability flag */
+
+#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
+  uint8_t ecma_prop_hashmap_alloc_state; /**< property hashmap allocation state: 0-4,
+                                          *   if !0 property hashmap allocation is disabled */
+  bool ecma_prop_hashmap_alloc_last_is_hs_gc; /**< true, if and only if the last gc action was a high severity gc */
+#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+  uint8_t re_cache_idx; /**< evicted item index when regex cache is full (round-robin) */
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+  ecma_job_queueitem_t *job_queue_head_p; /**< points to the head item of the jobqueue */
+  ecma_job_queueitem_t *job_queue_tail_p; /**< points to the tail item of the jobqueue*/
+#endif /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+
+#ifdef JERRY_VM_EXEC_STOP
+  uint32_t vm_exec_stop_frequency; /**< reset value for vm_exec_stop_counter */
+  uint32_t vm_exec_stop_counter; /**< down counter for reducing the calls of vm_exec_stop_cb */
+  void *vm_exec_stop_user_p; /**< user pointer for vm_exec_stop_cb */
+  ecma_vm_exec_stop_callback_t vm_exec_stop_cb; /**< user function which returns whether the
+                                                 *   ECMAScript execution should be stopped */
+#endif /* JERRY_VM_EXEC_STOP */
+
+#ifdef JERRY_DEBUGGER
+  uint8_t debugger_send_buffer[JERRY_DEBUGGER_MAX_BUFFER_SIZE]; /**< buffer for sending messages */
+  uint8_t debugger_receive_buffer[JERRY_DEBUGGER_MAX_BUFFER_SIZE]; /**< buffer for receiving messages */
+  vm_frame_ctx_t *debugger_stop_context; /**< stop only if the current context is equal to this context */
+  jmem_cpointer_t debugger_byte_code_free_head; /**< head of byte code free linked list */
+  jmem_cpointer_t debugger_byte_code_free_tail; /**< tail of byte code free linked list */
+  uint8_t debugger_flags; /**< debugger flags */
+  uint8_t debugger_message_delay; /**< call receive message when reaches zero */
+  uint16_t debugger_receive_buffer_offset; /**< receive buffer offset */
+  int debugger_connection; /**< holds the file descriptor of the socket communication */
+  uint16_t debugger_port; /**< debugger socket communication port */
+#endif /* JERRY_DEBUGGER */
+
+#ifdef JMEM_STATS
+  jmem_heap_stats_t jmem_heap_stats; /**< heap's memory usage statistics */
+#endif /* JMEM_STATS */
+
+#ifdef JERRY_VALGRIND_FREYA
+  uint8_t valgrind_freya_mempool_request; /**< Tells whether a pool manager
+                                           *   allocator request is in progress */
+#endif /* JERRY_VALGRIND_FREYA */
+} jerry_context_t;
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+/**
+ * Hash table for caching the last access of properties.
+ */
+typedef struct
+{
+  ecma_lcache_hash_entry_t table[ECMA_LCACHE_HASH_ROWS_COUNT][ECMA_LCACHE_HASH_ROW_LENGTH];
+} jerry_hash_table_t;
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+
+#ifdef JERRY_ENABLE_EXTERNAL_CONTEXT
+
+#ifndef JERRY_GET_CURRENT_INSTANCE
+
+/**
+ * Default function if JERRY_GET_CURRENT_INSTANCE is not defined.
+ */
+#define JERRY_GET_CURRENT_INSTANCE() (jerry_port_get_current_instance ())
+
+#endif /* !JERRY_GET_CURRENT_INSTANCE */
+
+/**
+ * This part is for Jerry which enable external context.
+ */
+typedef struct
+{
+  jmem_heap_free_t first; /**< first node in free region list */
+  uint8_t area[]; /**< heap area */
+} jmem_heap_t;
+
+/**
+ * Description of jerry instance which is the header of the context space.
+ */
+struct jerry_instance_t
+{
+  jerry_context_t context; /**< the context of the instance */
+#ifndef JERRY_SYSTEM_ALLOCATOR
+  jmem_heap_t *heap_p; /**< point to the heap aligned to JMEM_ALIGNMENT. */
+  uint32_t heap_size; /**< size of the heap */
+#endif
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+  uint8_t *lcache_p; /**< point to the entrance of the lcache in buffer */
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+};
+
+#define JERRY_CONTEXT(field) (JERRY_GET_CURRENT_INSTANCE ()->context.field)
+
+#ifndef JERRY_SYSTEM_ALLOCATOR
+
+static inline jmem_heap_t * __attr_always_inline___
+jerry_context_get_current_heap (void)
+{
+  return JERRY_GET_CURRENT_INSTANCE ()->heap_p;
+} /* jerry_context_get_current_heap */
+
+#define JERRY_HEAP_CONTEXT(field) (jerry_context_get_current_heap ()->field)
+
+#ifdef JMEM_HEAP_SIZE
+#error "JMEM_HEAP_SIZE must not be defined if JERRY_ENABLE_EXTERNAL_CONTEXT is defined"
+#endif /* JMEM_HEAP_SIZE */
+
+#define JMEM_HEAP_SIZE (JERRY_GET_CURRENT_INSTANCE ()->heap_size)
+
+#define JMEM_HEAP_AREA_SIZE (JERRY_GET_CURRENT_INSTANCE ()->heap_size - JMEM_ALIGNMENT)
+
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+
+static inline jerry_hash_table_t * __attr_always_inline___
+jerry_context_get_current_lcache (void)
+{
+  return (jerry_hash_table_t *) (JERRY_GET_CURRENT_INSTANCE ()->lcache_p);
+} /* jerry_context_get_current_lcache */
+
+#define JERRY_HASH_TABLE_CONTEXT(field) (jerry_context_get_current_lcache ()->field)
+
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+
+#else /* !JERRY_ENABLE_EXTERNAL_CONTEXT */
+
+/**
+ * This part is for Jerry which use default context.
+ */
+
+/**
+ * Calculate heap area size, leaving space for a pointer to the free list
+ */
+#define JMEM_HEAP_AREA_SIZE (JMEM_HEAP_SIZE - JMEM_ALIGNMENT)
+
+/**
+ * Heap structure
+ *
+ * Memory blocks returned by the allocator must not start from the
+ * beginning of the heap area because offset 0 is reserved for
+ * JMEM_CP_NULL. This special constant is used in several places,
+ * e.g. it marks the end of the property chain list, so it cannot
+ * be eliminated from the project. Although the allocator cannot
+ * use the first 8 bytes of the heap, nothing prevents to use it
+ * for other purposes. Currently the free region start is stored
+ * there.
+ */
+typedef struct
+{
+  jmem_heap_free_t first; /**< first node in free region list */
+  uint8_t area[JMEM_HEAP_AREA_SIZE]; /**< heap area */
+} jmem_heap_t;
+
+/**
+ * Global context.
+ */
+extern jerry_context_t jerry_global_context;
+
+#ifndef JERRY_SYSTEM_ALLOCATOR
+/**
+ * Global heap.
+ */
+extern jmem_heap_t jerry_global_heap;
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+
+/**
+ * Global hash table.
+ */
+extern jerry_hash_table_t jerry_global_hash_table;
+
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+
+/**
+ * Provides a reference to a field in the current context.
+ */
+#define JERRY_CONTEXT(field) (jerry_global_context.field)
+
+#ifndef JERRY_SYSTEM_ALLOCATOR
+/**
+ * Provides a reference to the area field of the heap.
+ */
+#define JERRY_HEAP_CONTEXT(field) (jerry_global_heap.field)
+
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+
+#ifndef CONFIG_ECMA_LCACHE_DISABLE
+
+/**
+ * Provides a reference to the global hash table.
+ */
+#define JERRY_HASH_TABLE_CONTEXT(field) (jerry_global_hash_table.field)
+
+#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
+
+#endif /* JERRY_ENABLE_EXTERNAL_CONTEXT */
+
+/**
+ * @}
+ */
+
+#endif /* !JCONTEXT_H */
diff --git a/deps/jerry/jerry-core/jmem/jmem-allocator-internal.h b/deps/jerry/jerry-core/jmem/jmem-allocator-internal.h
new file mode 100644 (file)
index 0000000..c2e6d73
--- /dev/null
@@ -0,0 +1,55 @@
+/* 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.
+ */
+
+#ifndef JMEM_ALLOCATOR_INTERNAL_H
+#define JMEM_ALLOCATOR_INTERNAL_H
+
+#ifndef JMEM_ALLOCATOR_INTERNAL
+# error "The header is for internal routines of memory allocator component. Please, don't use the routines directly."
+#endif /* !JMEM_ALLOCATOR_INTERNAL */
+
+/** \addtogroup mem Memory allocation
+ * @{
+ */
+
+#ifdef JMEM_STATS
+void jmem_heap_get_stats (jmem_heap_stats_t *);
+void jmem_heap_stats_reset_peak (void);
+void jmem_heap_stats_print (void);
+#endif /* JMEM_STATS */
+
+void jmem_heap_init (void);
+void jmem_heap_finalize (void);
+bool jmem_is_heap_pointer (const void *pointer);
+
+void jmem_run_free_unused_memory_callbacks (jmem_free_unused_memory_severity_t severity);
+
+/**
+ * \addtogroup poolman Memory pool manager
+ * @{
+ */
+#ifdef JMEM_STATS
+void jmem_pools_stats_print (void);
+#endif /* JMEM_STATS */
+
+void jmem_pools_finalize (void);
+void jmem_pools_collect_empty (void);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !JMEM_ALLOCATOR_INTERNAL_H */
diff --git a/deps/jerry/jerry-core/jmem/jmem-allocator.c b/deps/jerry/jerry-core/jmem/jmem-allocator.c
new file mode 100644 (file)
index 0000000..db3bb8f
--- /dev/null
@@ -0,0 +1,280 @@
+/* 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.
+ */
+
+/**
+ * Allocator implementation
+ */
+#include "ecma-globals.h"
+#include "jcontext.h"
+#include "jmem.h"
+#include "jrt-libc-includes.h"
+
+#define JMEM_ALLOCATOR_INTERNAL
+#include "jmem-allocator-internal.h"
+
+/**
+ * Initialize memory allocators.
+ */
+void
+jmem_init (void)
+{
+  jmem_heap_init ();
+} /* jmem_init */
+
+/**
+ * Finalize memory allocators.
+ */
+void
+jmem_finalize (void)
+{
+  jmem_pools_finalize ();
+
+#ifdef JMEM_STATS
+  if (JERRY_CONTEXT (jerry_init_flags) & ECMA_INIT_MEM_STATS)
+  {
+    jmem_stats_print ();
+  }
+#endif /* JMEM_STATS */
+
+  jmem_heap_finalize ();
+} /* jmem_finalize */
+
+/**
+ * Compress pointer
+ *
+ * @return packed pointer
+ */
+inline jmem_cpointer_t __attr_pure___ __attr_always_inline___
+jmem_compress_pointer (const void *pointer_p) /**< pointer to compress */
+{
+  JERRY_ASSERT (pointer_p != NULL);
+  JERRY_ASSERT (jmem_is_heap_pointer (pointer_p));
+
+  uintptr_t uint_ptr = (uintptr_t) pointer_p;
+
+  JERRY_ASSERT (uint_ptr % JMEM_ALIGNMENT == 0);
+
+#if defined (ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY) && defined (JERRY_CPOINTER_32_BIT)
+  JERRY_ASSERT (((jmem_cpointer_t) uint_ptr) == uint_ptr);
+#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY || !JERRY_CPOINTER_32_BIT */
+  const uintptr_t heap_start = (uintptr_t) &JERRY_HEAP_CONTEXT (first);
+
+  uint_ptr -= heap_start;
+  uint_ptr >>= JMEM_ALIGNMENT_LOG;
+
+#ifdef JERRY_CPOINTER_32_BIT
+  JERRY_ASSERT (uint_ptr <= UINT32_MAX);
+#else /* !JERRY_CPOINTER_32_BIT */
+  JERRY_ASSERT (uint_ptr <= UINT16_MAX);
+#endif /* JERRY_CPOINTER_32_BIT */
+  JERRY_ASSERT (uint_ptr != JMEM_CP_NULL);
+#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY && JERRY_CPOINTER_32_BIT */
+
+  return (jmem_cpointer_t) uint_ptr;
+} /* jmem_compress_pointer */
+
+/**
+ * Decompress pointer
+ *
+ * @return unpacked pointer
+ */
+inline void * __attr_pure___ __attr_always_inline___
+jmem_decompress_pointer (uintptr_t compressed_pointer) /**< pointer to decompress */
+{
+  JERRY_ASSERT (compressed_pointer != JMEM_CP_NULL);
+
+  uintptr_t uint_ptr = compressed_pointer;
+
+  JERRY_ASSERT (((jmem_cpointer_t) uint_ptr) == uint_ptr);
+
+#if defined (ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY) && defined (JERRY_CPOINTER_32_BIT)
+  JERRY_ASSERT (uint_ptr % JMEM_ALIGNMENT == 0);
+#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY || !JERRY_CPOINTER_32_BIT */
+  const uintptr_t heap_start = (uintptr_t) &JERRY_HEAP_CONTEXT (first);
+
+  uint_ptr <<= JMEM_ALIGNMENT_LOG;
+  uint_ptr += heap_start;
+
+  JERRY_ASSERT (jmem_is_heap_pointer ((void *) uint_ptr));
+#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY && JERRY_CPOINTER_32_BIT */
+
+  return (void *) uint_ptr;
+} /* jmem_decompress_pointer */
+
+/**
+ * Register specified 'try to give memory back' callback routine
+ */
+void
+jmem_register_free_unused_memory_callback (jmem_free_unused_memory_callback_t callback) /**< callback routine */
+{
+  /* Currently only one callback is supported */
+  JERRY_ASSERT (JERRY_CONTEXT (jmem_free_unused_memory_callback) == NULL);
+
+  JERRY_CONTEXT (jmem_free_unused_memory_callback) = callback;
+} /* jmem_register_free_unused_memory_callback */
+
+/**
+ * Unregister specified 'try to give memory back' callback routine
+ */
+void
+jmem_unregister_free_unused_memory_callback (jmem_free_unused_memory_callback_t callback) /**< callback routine */
+{
+  /* Currently only one callback is supported */
+  JERRY_ASSERT (JERRY_CONTEXT (jmem_free_unused_memory_callback) == callback);
+
+  JERRY_CONTEXT (jmem_free_unused_memory_callback) = NULL;
+} /* jmem_unregister_free_unused_memory_callback */
+
+/**
+ * Run 'try to give memory back' callbacks with specified severity
+ */
+void
+jmem_run_free_unused_memory_callbacks (jmem_free_unused_memory_severity_t severity) /**< severity of the request */
+{
+  if (JERRY_CONTEXT (jmem_free_unused_memory_callback) != NULL)
+  {
+    JERRY_CONTEXT (jmem_free_unused_memory_callback) (severity);
+  }
+
+  jmem_pools_collect_empty ();
+} /* jmem_run_free_unused_memory_callbacks */
+
+#ifdef JMEM_STATS
+/**
+ * Print memory usage statistics
+ */
+void
+jmem_stats_print (void)
+{
+  jmem_heap_stats_print ();
+} /* jmem_stats_print */
+
+/**
+ * Register byte code allocation.
+ */
+void
+jmem_stats_allocate_byte_code_bytes (size_t byte_code_size)
+{
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  heap_stats->byte_code_bytes += byte_code_size;
+
+  if (heap_stats->byte_code_bytes >= heap_stats->peak_byte_code_bytes)
+  {
+    heap_stats->peak_byte_code_bytes = heap_stats->byte_code_bytes;
+  }
+} /* jmem_stats_allocate_byte_code_bytes */
+
+/**
+ * Register byte code free.
+ */
+void
+jmem_stats_free_byte_code_bytes (size_t byte_code_size)
+{
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  JERRY_ASSERT (heap_stats->byte_code_bytes >= byte_code_size);
+
+  heap_stats->byte_code_bytes -= byte_code_size;
+} /* jmem_stats_free_byte_code_bytes */
+
+/**
+ * Register string allocation.
+ */
+void
+jmem_stats_allocate_string_bytes (size_t string_size)
+{
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  heap_stats->string_bytes += string_size;
+
+  if (heap_stats->string_bytes >= heap_stats->peak_string_bytes)
+  {
+    heap_stats->peak_string_bytes = heap_stats->string_bytes;
+  }
+} /* jmem_stats_allocate_string_bytes */
+
+/**
+ * Register string free.
+ */
+void
+jmem_stats_free_string_bytes (size_t string_size)
+{
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  JERRY_ASSERT (heap_stats->string_bytes >= string_size);
+
+  heap_stats->string_bytes -= string_size;
+} /* jmem_stats_free_string_bytes */
+
+/**
+ * Register object allocation.
+ */
+void
+jmem_stats_allocate_object_bytes (size_t object_size)
+{
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  heap_stats->object_bytes += object_size;
+
+  if (heap_stats->object_bytes >= heap_stats->peak_object_bytes)
+  {
+    heap_stats->peak_object_bytes = heap_stats->object_bytes;
+  }
+} /* jmem_stats_allocate_object_bytes */
+
+/**
+ * Register object free.
+ */
+void
+jmem_stats_free_object_bytes (size_t object_size)
+{
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  JERRY_ASSERT (heap_stats->object_bytes >= object_size);
+
+  heap_stats->object_bytes -= object_size;
+} /* jmem_stats_free_object_bytes */
+
+/**
+ * Register property allocation.
+ */
+void
+jmem_stats_allocate_property_bytes (size_t property_size)
+{
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  heap_stats->property_bytes += property_size;
+
+  if (heap_stats->property_bytes >= heap_stats->peak_property_bytes)
+  {
+    heap_stats->peak_property_bytes = heap_stats->property_bytes;
+  }
+} /* jmem_stats_allocate_property_bytes */
+
+/**
+ * Register property free.
+ */
+void
+jmem_stats_free_property_bytes (size_t property_size)
+{
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  JERRY_ASSERT (heap_stats->property_bytes >= property_size);
+
+  heap_stats->property_bytes -= property_size;
+} /* jmem_stats_free_property_bytes */
+
+#endif /* JMEM_STATS */
diff --git a/deps/jerry/jerry-core/jmem/jmem-heap.c b/deps/jerry/jerry-core/jmem/jmem-heap.c
new file mode 100644 (file)
index 0000000..f362292
--- /dev/null
@@ -0,0 +1,724 @@
+/* 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.
+ */
+
+/**
+ * Heap implementation
+ */
+
+#include "jcontext.h"
+#include "jmem.h"
+#include "jrt-bit-fields.h"
+#include "jrt-libc-includes.h"
+
+#define JMEM_ALLOCATOR_INTERNAL
+#include "jmem-allocator-internal.h"
+
+/** \addtogroup mem Memory allocation
+ * @{
+ *
+ * \addtogroup heap Heap
+ * @{
+ */
+
+/*
+ * Valgrind-related options and headers
+ */
+#ifdef JERRY_VALGRIND
+# include "memcheck.h"
+
+# define VALGRIND_NOACCESS_SPACE(p, s)   VALGRIND_MAKE_MEM_NOACCESS((p), (s))
+# define VALGRIND_UNDEFINED_SPACE(p, s)  VALGRIND_MAKE_MEM_UNDEFINED((p), (s))
+# define VALGRIND_DEFINED_SPACE(p, s)    VALGRIND_MAKE_MEM_DEFINED((p), (s))
+
+#else /* !JERRY_VALGRIND */
+# define VALGRIND_NOACCESS_SPACE(p, s)
+# define VALGRIND_UNDEFINED_SPACE(p, s)
+# define VALGRIND_DEFINED_SPACE(p, s)
+#endif /* JERRY_VALGRIND */
+
+#ifdef JERRY_VALGRIND_FREYA
+
+#ifdef JERRY_VALGRIND
+#error Valgrind and valgrind-freya modes are not compatible.
+#endif /* JERRY_VALGRIND */
+
+#include "memcheck.h"
+
+# define VALGRIND_FREYA_CHECK_MEMPOOL_REQUEST \
+  bool mempool_request = JERRY_CONTEXT (valgrind_freya_mempool_request); \
+  JERRY_CONTEXT (valgrind_freya_mempool_request) = false
+
+# define VALGRIND_FREYA_MALLOCLIKE_SPACE(p, s) \
+  if (!mempool_request) \
+  { \
+    VALGRIND_MALLOCLIKE_BLOCK((p), (s), 0, 0); \
+  }
+
+# define VALGRIND_FREYA_FREELIKE_SPACE(p) \
+  if (!mempool_request) \
+  { \
+    VALGRIND_FREELIKE_BLOCK((p), 0); \
+  }
+
+#else /* !JERRY_VALGRIND_FREYA */
+# define VALGRIND_FREYA_CHECK_MEMPOOL_REQUEST
+# define VALGRIND_FREYA_MALLOCLIKE_SPACE(p, s)
+# define VALGRIND_FREYA_FREELIKE_SPACE(p)
+#endif /* JERRY_VALGRIND_FREYA */
+
+/**
+ * End of list marker.
+ */
+#define JMEM_HEAP_END_OF_LIST ((uint32_t) 0xffffffff)
+
+#ifdef ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY
+/* In this case we simply store the pointer, since it fits anyway. */
+#define JMEM_HEAP_GET_OFFSET_FROM_ADDR(p) ((uint32_t) (p))
+#define JMEM_HEAP_GET_ADDR_FROM_OFFSET(u) ((jmem_heap_free_t *) (u))
+#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
+#define JMEM_HEAP_GET_OFFSET_FROM_ADDR(p) ((uint32_t) ((uint8_t *) (p) - JERRY_HEAP_CONTEXT (area)))
+#define JMEM_HEAP_GET_ADDR_FROM_OFFSET(u) ((jmem_heap_free_t *) (JERRY_HEAP_CONTEXT (area) + (u)))
+#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
+
+#ifndef JERRY_SYSTEM_ALLOCATOR
+/**
+ * Get end of region
+ */
+static inline jmem_heap_free_t *  __attr_always_inline___ __attr_pure___
+jmem_heap_get_region_end (jmem_heap_free_t *curr_p) /**< current region */
+{
+  return (jmem_heap_free_t *)((uint8_t *) curr_p + curr_p->size);
+} /* jmem_heap_get_region_end */
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+
+#ifndef JERRY_ENABLE_EXTERNAL_CONTEXT
+/**
+ * Check size of heap is corresponding to configuration
+ */
+JERRY_STATIC_ASSERT (sizeof (jmem_heap_t) <= JMEM_HEAP_SIZE,
+                     size_of_mem_heap_must_be_less_than_or_equal_to_MEM_HEAP_SIZE);
+#endif /* !JERRY_ENABLE_EXTERNAL_CONTEXT */
+
+#ifdef JMEM_STATS
+
+#ifdef JERRY_SYSTEM_ALLOCATOR
+/* TODO: Implement mem-stat support for system allocator */
+#error Memory statistics (JMEM_STATS) are not supported
+#endif
+
+static void jmem_heap_stat_init (void);
+static void jmem_heap_stat_alloc (size_t num);
+static void jmem_heap_stat_free (size_t num);
+static void jmem_heap_stat_skip (void);
+static void jmem_heap_stat_nonskip (void);
+static void jmem_heap_stat_alloc_iter (void);
+static void jmem_heap_stat_free_iter (void);
+
+#  define JMEM_HEAP_STAT_INIT() jmem_heap_stat_init ()
+#  define JMEM_HEAP_STAT_ALLOC(v1) jmem_heap_stat_alloc (v1)
+#  define JMEM_HEAP_STAT_FREE(v1) jmem_heap_stat_free (v1)
+#  define JMEM_HEAP_STAT_SKIP() jmem_heap_stat_skip ()
+#  define JMEM_HEAP_STAT_NONSKIP() jmem_heap_stat_nonskip ()
+#  define JMEM_HEAP_STAT_ALLOC_ITER() jmem_heap_stat_alloc_iter ()
+#  define JMEM_HEAP_STAT_FREE_ITER() jmem_heap_stat_free_iter ()
+#else /* !JMEM_STATS */
+#  define JMEM_HEAP_STAT_INIT()
+#  define JMEM_HEAP_STAT_ALLOC(v1)
+#  define JMEM_HEAP_STAT_FREE(v1)
+#  define JMEM_HEAP_STAT_SKIP()
+#  define JMEM_HEAP_STAT_NONSKIP()
+#  define JMEM_HEAP_STAT_ALLOC_ITER()
+#  define JMEM_HEAP_STAT_FREE_ITER()
+#endif /* JMEM_STATS */
+
+/**
+ * Startup initialization of heap
+ */
+void
+jmem_heap_init (void)
+{
+#ifndef JERRY_CPOINTER_32_BIT
+  /* the maximum heap size for 16bit compressed pointers should be 512K */
+  JERRY_ASSERT (((UINT16_MAX + 1) << JMEM_ALIGNMENT_LOG) >= JMEM_HEAP_SIZE);
+#endif /* !JERRY_CPOINTER_32_BIT */
+
+#ifndef JERRY_SYSTEM_ALLOCATOR
+  JERRY_ASSERT ((uintptr_t) JERRY_HEAP_CONTEXT (area) % JMEM_ALIGNMENT == 0);
+
+  JERRY_CONTEXT (jmem_heap_limit) = CONFIG_MEM_HEAP_DESIRED_LIMIT;
+
+  jmem_heap_free_t *const region_p = (jmem_heap_free_t *) JERRY_HEAP_CONTEXT (area);
+
+  region_p->size = JMEM_HEAP_AREA_SIZE;
+  region_p->next_offset = JMEM_HEAP_END_OF_LIST;
+
+  JERRY_HEAP_CONTEXT (first).size = 0;
+  JERRY_HEAP_CONTEXT (first).next_offset = JMEM_HEAP_GET_OFFSET_FROM_ADDR (region_p);
+
+  JERRY_CONTEXT (jmem_heap_list_skip_p) = &JERRY_HEAP_CONTEXT (first);
+
+  VALGRIND_NOACCESS_SPACE (JERRY_HEAP_CONTEXT (area), JMEM_HEAP_AREA_SIZE);
+
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+  JMEM_HEAP_STAT_INIT ();
+} /* jmem_heap_init */
+
+/**
+ * Finalize heap
+ */
+void
+jmem_heap_finalize (void)
+{
+  JERRY_ASSERT (JERRY_CONTEXT (jmem_heap_allocated_size) == 0);
+#ifndef JERRY_SYSTEM_ALLOCATOR
+  VALGRIND_NOACCESS_SPACE (&JERRY_HEAP_CONTEXT (first), JMEM_HEAP_SIZE);
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+} /* jmem_heap_finalize */
+
+/**
+ * Allocation of memory region.
+ *
+ * See also:
+ *          jmem_heap_alloc_block
+ *
+ * @return pointer to allocated memory block - if allocation is successful,
+ *         NULL - if there is not enough memory.
+ */
+static __attr_hot___ void *
+jmem_heap_alloc_block_internal (const size_t size)
+{
+#ifndef JERRY_SYSTEM_ALLOCATOR
+  /* Align size. */
+  const size_t required_size = ((size + JMEM_ALIGNMENT - 1) / JMEM_ALIGNMENT) * JMEM_ALIGNMENT;
+  jmem_heap_free_t *data_space_p = NULL;
+
+  VALGRIND_DEFINED_SPACE (&JERRY_HEAP_CONTEXT (first), sizeof (jmem_heap_free_t));
+
+  /* Fast path for 8 byte chunks, first region is guaranteed to be sufficient. */
+  if (required_size == JMEM_ALIGNMENT
+      && likely (JERRY_HEAP_CONTEXT (first).next_offset != JMEM_HEAP_END_OF_LIST))
+  {
+    data_space_p = JMEM_HEAP_GET_ADDR_FROM_OFFSET (JERRY_HEAP_CONTEXT (first).next_offset);
+    JERRY_ASSERT (jmem_is_heap_pointer (data_space_p));
+
+    VALGRIND_DEFINED_SPACE (data_space_p, sizeof (jmem_heap_free_t));
+    JERRY_CONTEXT (jmem_heap_allocated_size) += JMEM_ALIGNMENT;
+    JMEM_HEAP_STAT_ALLOC_ITER ();
+
+    if (data_space_p->size == JMEM_ALIGNMENT)
+    {
+      JERRY_HEAP_CONTEXT (first).next_offset = data_space_p->next_offset;
+    }
+    else
+    {
+      JERRY_ASSERT (data_space_p->size > JMEM_ALIGNMENT);
+
+      jmem_heap_free_t *remaining_p;
+      remaining_p = JMEM_HEAP_GET_ADDR_FROM_OFFSET (JERRY_HEAP_CONTEXT (first).next_offset) + 1;
+
+      VALGRIND_DEFINED_SPACE (remaining_p, sizeof (jmem_heap_free_t));
+      remaining_p->size = data_space_p->size - JMEM_ALIGNMENT;
+      remaining_p->next_offset = data_space_p->next_offset;
+      VALGRIND_NOACCESS_SPACE (remaining_p, sizeof (jmem_heap_free_t));
+
+      JERRY_HEAP_CONTEXT (first).next_offset = JMEM_HEAP_GET_OFFSET_FROM_ADDR (remaining_p);
+    }
+
+    VALGRIND_UNDEFINED_SPACE (data_space_p, sizeof (jmem_heap_free_t));
+
+    if (unlikely (data_space_p == JERRY_CONTEXT (jmem_heap_list_skip_p)))
+    {
+      JERRY_CONTEXT (jmem_heap_list_skip_p) = JMEM_HEAP_GET_ADDR_FROM_OFFSET (JERRY_HEAP_CONTEXT (first).next_offset);
+    }
+  }
+  /* Slow path for larger regions. */
+  else
+  {
+    uint32_t current_offset = JERRY_HEAP_CONTEXT (first).next_offset;
+    jmem_heap_free_t *prev_p = &JERRY_HEAP_CONTEXT (first);
+
+    while (current_offset != JMEM_HEAP_END_OF_LIST)
+    {
+      jmem_heap_free_t *current_p = JMEM_HEAP_GET_ADDR_FROM_OFFSET (current_offset);
+      JERRY_ASSERT (jmem_is_heap_pointer (current_p));
+      VALGRIND_DEFINED_SPACE (current_p, sizeof (jmem_heap_free_t));
+      JMEM_HEAP_STAT_ALLOC_ITER ();
+
+      const uint32_t next_offset = current_p->next_offset;
+      JERRY_ASSERT (next_offset == JMEM_HEAP_END_OF_LIST
+                    || jmem_is_heap_pointer (JMEM_HEAP_GET_ADDR_FROM_OFFSET (next_offset)));
+
+      if (current_p->size >= required_size)
+      {
+        /* Region is sufficiently big, store address. */
+        data_space_p = current_p;
+        JERRY_CONTEXT (jmem_heap_allocated_size) += required_size;
+
+        /* Region was larger than necessary. */
+        if (current_p->size > required_size)
+        {
+          /* Get address of remaining space. */
+          jmem_heap_free_t *const remaining_p = (jmem_heap_free_t *) ((uint8_t *) current_p + required_size);
+
+          /* Update metadata. */
+          VALGRIND_DEFINED_SPACE (remaining_p, sizeof (jmem_heap_free_t));
+          remaining_p->size = current_p->size - (uint32_t) required_size;
+          remaining_p->next_offset = next_offset;
+          VALGRIND_NOACCESS_SPACE (remaining_p, sizeof (jmem_heap_free_t));
+
+          /* Update list. */
+          VALGRIND_DEFINED_SPACE (prev_p, sizeof (jmem_heap_free_t));
+          prev_p->next_offset = JMEM_HEAP_GET_OFFSET_FROM_ADDR (remaining_p);
+          VALGRIND_NOACCESS_SPACE (prev_p, sizeof (jmem_heap_free_t));
+        }
+        /* Block is an exact fit. */
+        else
+        {
+          /* Remove the region from the list. */
+          VALGRIND_DEFINED_SPACE (prev_p, sizeof (jmem_heap_free_t));
+          prev_p->next_offset = next_offset;
+          VALGRIND_NOACCESS_SPACE (prev_p, sizeof (jmem_heap_free_t));
+        }
+
+        JERRY_CONTEXT (jmem_heap_list_skip_p) = prev_p;
+
+        /* Found enough space. */
+        break;
+      }
+
+      VALGRIND_NOACCESS_SPACE (current_p, sizeof (jmem_heap_free_t));
+      /* Next in list. */
+      prev_p = current_p;
+      current_offset = next_offset;
+    }
+  }
+
+  while (JERRY_CONTEXT (jmem_heap_allocated_size) >= JERRY_CONTEXT (jmem_heap_limit))
+  {
+    JERRY_CONTEXT (jmem_heap_limit) += CONFIG_MEM_HEAP_DESIRED_LIMIT;
+  }
+
+  VALGRIND_NOACCESS_SPACE (&JERRY_HEAP_CONTEXT (first), sizeof (jmem_heap_free_t));
+
+  if (unlikely (!data_space_p))
+  {
+    return NULL;
+  }
+
+  JERRY_ASSERT ((uintptr_t) data_space_p % JMEM_ALIGNMENT == 0);
+  VALGRIND_UNDEFINED_SPACE (data_space_p, size);
+  JMEM_HEAP_STAT_ALLOC (size);
+
+  return (void *) data_space_p;
+#else /* JERRY_SYSTEM_ALLOCATOR */
+  return malloc (size);
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+} /* jmem_heap_alloc_block_internal */
+
+/**
+ * Allocation of memory block, running 'try to give memory back' callbacks, if there is not enough memory.
+ *
+ * Note:
+ *      if there is still not enough memory after running the callbacks
+ *        - NULL value will be returned if parmeter 'ret_null_on_error' is true
+ *        - the engine will terminate with ERR_OUT_OF_MEMORY if 'ret_null_on_error' is false
+ *
+ * @return NULL, if the required memory size is 0
+ *         also NULL, if 'ret_null_on_error' is true and the allocation fails because of there is not enough memory
+ */
+static void *
+jmem_heap_gc_and_alloc_block (const size_t size,      /**< required memory size */
+                              bool ret_null_on_error) /**< indicates whether return null or terminate
+                                                           with ERR_OUT_OF_MEMORY on out of memory */
+{
+  if (unlikely (size == 0))
+  {
+    return NULL;
+  }
+
+  VALGRIND_FREYA_CHECK_MEMPOOL_REQUEST;
+
+#ifdef JMEM_GC_BEFORE_EACH_ALLOC
+  jmem_run_free_unused_memory_callbacks (JMEM_FREE_UNUSED_MEMORY_SEVERITY_HIGH);
+#endif /* JMEM_GC_BEFORE_EACH_ALLOC */
+
+  if (JERRY_CONTEXT (jmem_heap_allocated_size) + size >= JERRY_CONTEXT (jmem_heap_limit))
+  {
+    jmem_run_free_unused_memory_callbacks (JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW);
+  }
+
+  void *data_space_p = jmem_heap_alloc_block_internal (size);
+
+  if (likely (data_space_p != NULL))
+  {
+    VALGRIND_FREYA_MALLOCLIKE_SPACE (data_space_p, size);
+    return data_space_p;
+  }
+
+  for (jmem_free_unused_memory_severity_t severity = JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW;
+       severity <= JMEM_FREE_UNUSED_MEMORY_SEVERITY_HIGH;
+       severity = (jmem_free_unused_memory_severity_t) (severity + 1))
+  {
+    jmem_run_free_unused_memory_callbacks (severity);
+
+    data_space_p = jmem_heap_alloc_block_internal (size);
+
+    if (likely (data_space_p != NULL))
+    {
+      VALGRIND_FREYA_MALLOCLIKE_SPACE (data_space_p, size);
+      return data_space_p;
+    }
+  }
+
+  JERRY_ASSERT (data_space_p == NULL);
+
+  if (!ret_null_on_error)
+  {
+    jerry_fatal (ERR_OUT_OF_MEMORY);
+  }
+
+  return data_space_p;
+} /* jmem_heap_gc_and_alloc_block */
+
+/**
+ * Allocation of memory block, running 'try to give memory back' callbacks, if there is not enough memory.
+ *
+ * Note:
+ *      If there is still not enough memory after running the callbacks, then the engine will be
+ *      terminated with ERR_OUT_OF_MEMORY.
+ *
+ * @return NULL, if the required memory is 0
+ *         pointer to allocated memory block, otherwise
+ */
+inline void * __attr_hot___ __attr_always_inline___
+jmem_heap_alloc_block (const size_t size)  /**< required memory size */
+{
+  return jmem_heap_gc_and_alloc_block (size, false);
+} /* jmem_heap_alloc_block */
+
+/**
+ * Allocation of memory block, running 'try to give memory back' callbacks, if there is not enough memory.
+ *
+ * Note:
+ *      If there is still not enough memory after running the callbacks, NULL will be returned.
+ *
+ * @return NULL, if the required memory size is 0
+ *         also NULL, if the allocation has failed
+ *         pointer to the allocated memory block, otherwise
+ */
+inline void * __attr_hot___ __attr_always_inline___
+jmem_heap_alloc_block_null_on_error (const size_t size) /**< required memory size */
+{
+  return jmem_heap_gc_and_alloc_block (size, true);
+} /* jmem_heap_alloc_block_null_on_error */
+
+/**
+ * Free the memory block.
+ */
+void __attr_hot___
+jmem_heap_free_block (void *ptr, /**< pointer to beginning of data space of the block */
+                      const size_t size) /**< size of allocated region */
+{
+#ifndef JERRY_SYSTEM_ALLOCATOR
+  VALGRIND_FREYA_CHECK_MEMPOOL_REQUEST;
+
+  /* checking that ptr points to the heap */
+  JERRY_ASSERT (jmem_is_heap_pointer (ptr));
+  JERRY_ASSERT (size > 0);
+  JERRY_ASSERT (JERRY_CONTEXT (jmem_heap_limit) >= JERRY_CONTEXT (jmem_heap_allocated_size));
+
+  VALGRIND_FREYA_FREELIKE_SPACE (ptr);
+  VALGRIND_NOACCESS_SPACE (ptr, size);
+  JMEM_HEAP_STAT_FREE_ITER ();
+
+  jmem_heap_free_t *block_p = (jmem_heap_free_t *) ptr;
+  jmem_heap_free_t *prev_p;
+  jmem_heap_free_t *next_p;
+
+  VALGRIND_DEFINED_SPACE (&JERRY_HEAP_CONTEXT (first), sizeof (jmem_heap_free_t));
+
+  if (block_p > JERRY_CONTEXT (jmem_heap_list_skip_p))
+  {
+    prev_p = JERRY_CONTEXT (jmem_heap_list_skip_p);
+    JMEM_HEAP_STAT_SKIP ();
+  }
+  else
+  {
+    prev_p = &JERRY_HEAP_CONTEXT (first);
+    JMEM_HEAP_STAT_NONSKIP ();
+  }
+
+  JERRY_ASSERT (jmem_is_heap_pointer (block_p));
+  const uint32_t block_offset = JMEM_HEAP_GET_OFFSET_FROM_ADDR (block_p);
+
+  VALGRIND_DEFINED_SPACE (prev_p, sizeof (jmem_heap_free_t));
+  /* Find position of region in the list. */
+  while (prev_p->next_offset < block_offset)
+  {
+    next_p = JMEM_HEAP_GET_ADDR_FROM_OFFSET (prev_p->next_offset);
+    JERRY_ASSERT (jmem_is_heap_pointer (next_p));
+
+    VALGRIND_DEFINED_SPACE (next_p, sizeof (jmem_heap_free_t));
+    VALGRIND_NOACCESS_SPACE (prev_p, sizeof (jmem_heap_free_t));
+    prev_p = next_p;
+
+    JMEM_HEAP_STAT_FREE_ITER ();
+  }
+
+  next_p = JMEM_HEAP_GET_ADDR_FROM_OFFSET (prev_p->next_offset);
+  VALGRIND_DEFINED_SPACE (next_p, sizeof (jmem_heap_free_t));
+
+  /* Realign size */
+  const size_t aligned_size = (size + JMEM_ALIGNMENT - 1) / JMEM_ALIGNMENT * JMEM_ALIGNMENT;
+
+  VALGRIND_DEFINED_SPACE (block_p, sizeof (jmem_heap_free_t));
+  VALGRIND_DEFINED_SPACE (prev_p, sizeof (jmem_heap_free_t));
+  /* Update prev. */
+  if (jmem_heap_get_region_end (prev_p) == block_p)
+  {
+    /* Can be merged. */
+    prev_p->size += (uint32_t) aligned_size;
+    VALGRIND_NOACCESS_SPACE (block_p, sizeof (jmem_heap_free_t));
+    block_p = prev_p;
+  }
+  else
+  {
+    block_p->size = (uint32_t) aligned_size;
+    prev_p->next_offset = block_offset;
+  }
+
+  VALGRIND_DEFINED_SPACE (next_p, sizeof (jmem_heap_free_t));
+  /* Update next. */
+  if (jmem_heap_get_region_end (block_p) == next_p)
+  {
+    if (unlikely (next_p == JERRY_CONTEXT (jmem_heap_list_skip_p)))
+    {
+      JERRY_CONTEXT (jmem_heap_list_skip_p) = block_p;
+    }
+
+    /* Can be merged. */
+    block_p->size += next_p->size;
+    block_p->next_offset = next_p->next_offset;
+
+  }
+  else
+  {
+    block_p->next_offset = JMEM_HEAP_GET_OFFSET_FROM_ADDR (next_p);
+  }
+
+  JERRY_CONTEXT (jmem_heap_list_skip_p) = prev_p;
+
+  VALGRIND_NOACCESS_SPACE (prev_p, sizeof (jmem_heap_free_t));
+  VALGRIND_NOACCESS_SPACE (block_p, size);
+  VALGRIND_NOACCESS_SPACE (next_p, sizeof (jmem_heap_free_t));
+
+  JERRY_ASSERT (JERRY_CONTEXT (jmem_heap_allocated_size) > 0);
+  JERRY_CONTEXT (jmem_heap_allocated_size) -= aligned_size;
+
+  while (JERRY_CONTEXT (jmem_heap_allocated_size) + CONFIG_MEM_HEAP_DESIRED_LIMIT <= JERRY_CONTEXT (jmem_heap_limit))
+  {
+    JERRY_CONTEXT (jmem_heap_limit) -= CONFIG_MEM_HEAP_DESIRED_LIMIT;
+  }
+
+  VALGRIND_NOACCESS_SPACE (&JERRY_HEAP_CONTEXT (first), sizeof (jmem_heap_free_t));
+  JERRY_ASSERT (JERRY_CONTEXT (jmem_heap_limit) >= JERRY_CONTEXT (jmem_heap_allocated_size));
+  JMEM_HEAP_STAT_FREE (size);
+#else /* JERRY_SYSTEM_ALLOCATOR */
+  JERRY_UNUSED (size);
+  free (ptr);
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+} /* jmem_heap_free_block */
+
+#ifndef JERRY_NDEBUG
+/**
+ * Check whether the pointer points to the heap
+ *
+ * Note:
+ *      the routine should be used only for assertion checks
+ *
+ * @return true - if pointer points to the heap,
+ *         false - otherwise
+ */
+bool
+jmem_is_heap_pointer (const void *pointer) /**< pointer */
+{
+#ifndef JERRY_SYSTEM_ALLOCATOR
+  return ((uint8_t *) pointer >= JERRY_HEAP_CONTEXT (area)
+          && (uint8_t *) pointer <= (JERRY_HEAP_CONTEXT (area) + JMEM_HEAP_AREA_SIZE));
+#else /* JERRY_SYSTEM_ALLOCATOR */
+  JERRY_UNUSED (pointer);
+  return true;
+#endif /* !JERRY_SYSTEM_ALLOCATOR */
+} /* jmem_is_heap_pointer */
+#endif /* !JERRY_NDEBUG */
+
+#ifdef JMEM_STATS
+/**
+ * Get heap memory usage statistics
+ */
+void
+jmem_heap_get_stats (jmem_heap_stats_t *out_heap_stats_p) /**< [out] heap stats */
+{
+  JERRY_ASSERT (out_heap_stats_p != NULL);
+
+  *out_heap_stats_p = JERRY_CONTEXT (jmem_heap_stats);
+} /* jmem_heap_get_stats */
+
+/**
+ * Print heap memory usage statistics
+ */
+void
+jmem_heap_stats_print (void)
+{
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  JERRY_DEBUG_MSG ("Heap stats:\n"
+                   "  Heap size = %zu bytes\n"
+                   "  Allocated = %zu bytes\n"
+                   "  Peak allocated = %zu bytes\n"
+                   "  Waste = %zu bytes\n"
+                   "  Peak waste = %zu bytes\n"
+                   "  Allocated byte code data = %zu bytes\n"
+                   "  Peak allocated byte code data = %zu bytes\n"
+                   "  Allocated string data = %zu bytes\n"
+                   "  Peak allocated string data = %zu bytes\n"
+                   "  Allocated object data = %zu bytes\n"
+                   "  Peak allocated object data = %zu bytes\n"
+                   "  Allocated property data = %zu bytes\n"
+                   "  Peak allocated property data = %zu bytes\n"
+                   "  Skip-ahead ratio = %zu.%04zu\n"
+                   "  Average alloc iteration = %zu.%04zu\n"
+                   "  Average free iteration = %zu.%04zu\n"
+                   "\n",
+                   heap_stats->size,
+                   heap_stats->allocated_bytes,
+                   heap_stats->peak_allocated_bytes,
+                   heap_stats->waste_bytes,
+                   heap_stats->peak_waste_bytes,
+                   heap_stats->byte_code_bytes,
+                   heap_stats->peak_byte_code_bytes,
+                   heap_stats->string_bytes,
+                   heap_stats->peak_string_bytes,
+                   heap_stats->object_bytes,
+                   heap_stats->peak_object_bytes,
+                   heap_stats->property_bytes,
+                   heap_stats->peak_property_bytes,
+                   heap_stats->skip_count / heap_stats->nonskip_count,
+                   heap_stats->skip_count % heap_stats->nonskip_count * 10000 / heap_stats->nonskip_count,
+                   heap_stats->alloc_iter_count / heap_stats->alloc_count,
+                   heap_stats->alloc_iter_count % heap_stats->alloc_count * 10000 / heap_stats->alloc_count,
+                   heap_stats->free_iter_count / heap_stats->free_count,
+                   heap_stats->free_iter_count % heap_stats->free_count * 10000 / heap_stats->free_count);
+} /* jmem_heap_stats_print */
+
+/**
+ * Initalize heap memory usage statistics account structure
+ */
+static void
+jmem_heap_stat_init (void)
+{
+  JERRY_CONTEXT (jmem_heap_stats).size = JMEM_HEAP_AREA_SIZE;
+} /* jmem_heap_stat_init */
+
+/**
+ * Account allocation
+ */
+static void
+jmem_heap_stat_alloc (size_t size) /**< Size of allocated block */
+{
+  const size_t aligned_size = (size + JMEM_ALIGNMENT - 1) / JMEM_ALIGNMENT * JMEM_ALIGNMENT;
+  const size_t waste_bytes = aligned_size - size;
+
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  heap_stats->allocated_bytes += aligned_size;
+  heap_stats->waste_bytes += waste_bytes;
+  heap_stats->alloc_count++;
+
+  if (heap_stats->allocated_bytes > heap_stats->peak_allocated_bytes)
+  {
+    heap_stats->peak_allocated_bytes = heap_stats->allocated_bytes;
+  }
+
+  if (heap_stats->waste_bytes > heap_stats->peak_waste_bytes)
+  {
+    heap_stats->peak_waste_bytes = heap_stats->waste_bytes;
+  }
+} /* jmem_heap_stat_alloc */
+
+/**
+ * Account freeing
+ */
+static void
+jmem_heap_stat_free (size_t size) /**< Size of freed block */
+{
+  const size_t aligned_size = (size + JMEM_ALIGNMENT - 1) / JMEM_ALIGNMENT * JMEM_ALIGNMENT;
+  const size_t waste_bytes = aligned_size - size;
+
+  jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
+
+  heap_stats->free_count++;
+  heap_stats->allocated_bytes -= aligned_size;
+  heap_stats->waste_bytes -= waste_bytes;
+} /* jmem_heap_stat_free */
+
+/**
+ * Counts number of skip-aheads during insertion of free block
+ */
+static void
+jmem_heap_stat_skip (void)
+{
+  JERRY_CONTEXT (jmem_heap_stats).skip_count++;
+} /* jmem_heap_stat_skip  */
+
+/**
+ * Counts number of times we could not skip ahead during free block insertion
+ */
+static void
+jmem_heap_stat_nonskip (void)
+{
+  JERRY_CONTEXT (jmem_heap_stats).nonskip_count++;
+} /* jmem_heap_stat_nonskip */
+
+/**
+ * Count number of iterations required for allocations
+ */
+static void
+jmem_heap_stat_alloc_iter (void)
+{
+  JERRY_CONTEXT (jmem_heap_stats).alloc_iter_count++;
+} /* jmem_heap_stat_alloc_iter */
+
+/**
+ * Counts number of iterations required for inserting free blocks
+ */
+static void
+jmem_heap_stat_free_iter (void)
+{
+  JERRY_CONTEXT (jmem_heap_stats).free_iter_count++;
+} /* jmem_heap_stat_free_iter */
+#endif /* JMEM_STATS */
+
+#undef VALGRIND_NOACCESS_SPACE
+#undef VALGRIND_UNDEFINED_SPACE
+#undef VALGRIND_DEFINED_SPACE
+#undef VALGRIND_FREYA_CHECK_MEMPOOL_REQUEST
+#undef VALGRIND_FREYA_MALLOCLIKE_SPACE
+#undef VALGRIND_FREYA_FREELIKE_SPACE
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/jmem/jmem-poolman.c b/deps/jerry/jerry-core/jmem/jmem-poolman.c
new file mode 100644 (file)
index 0000000..e9092b2
--- /dev/null
@@ -0,0 +1,208 @@
+/* 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.
+ */
+
+/**
+ * Memory pool manager implementation
+ */
+
+#include "jcontext.h"
+#include "jmem.h"
+#include "jrt-libc-includes.h"
+
+#define JMEM_ALLOCATOR_INTERNAL
+#include "jmem-allocator-internal.h"
+
+/** \addtogroup mem Memory allocation
+ * @{
+ *
+ * \addtogroup poolman Memory pool manager
+ * @{
+ */
+
+/*
+ * Valgrind-related options and headers
+ */
+#ifdef JERRY_VALGRIND
+# include "memcheck.h"
+
+# define VALGRIND_NOACCESS_SPACE(p, s)   VALGRIND_MAKE_MEM_NOACCESS((p), (s))
+# define VALGRIND_UNDEFINED_SPACE(p, s)  VALGRIND_MAKE_MEM_UNDEFINED((p), (s))
+# define VALGRIND_DEFINED_SPACE(p, s)    VALGRIND_MAKE_MEM_DEFINED((p), (s))
+#else /* !JERRY_VALGRIND */
+# define VALGRIND_NOACCESS_SPACE(p, s)
+# define VALGRIND_UNDEFINED_SPACE(p, s)
+# define VALGRIND_DEFINED_SPACE(p, s)
+#endif /* JERRY_VALGRIND */
+
+#ifdef JERRY_VALGRIND_FREYA
+# include "memcheck.h"
+
+# define VALGRIND_FREYA_MALLOCLIKE_SPACE(p, s) VALGRIND_MALLOCLIKE_BLOCK((p), (s), 0, 0)
+# define VALGRIND_FREYA_FREELIKE_SPACE(p)      VALGRIND_FREELIKE_BLOCK((p), 0)
+#else /* !JERRY_VALGRIND_FREYA */
+# define VALGRIND_FREYA_MALLOCLIKE_SPACE(p, s)
+# define VALGRIND_FREYA_FREELIKE_SPACE(p)
+#endif /* JERRY_VALGRIND_FREYA */
+
+/**
+ * Finalize pool manager
+ */
+void
+jmem_pools_finalize (void)
+{
+  jmem_pools_collect_empty ();
+
+  JERRY_ASSERT (JERRY_CONTEXT (jmem_free_8_byte_chunk_p) == NULL);
+#ifdef JERRY_CPOINTER_32_BIT
+  JERRY_ASSERT (JERRY_CONTEXT (jmem_free_16_byte_chunk_p) == NULL);
+#endif /* JERRY_CPOINTER_32_BIT */
+} /* jmem_pools_finalize */
+
+/**
+ * Allocate a chunk of specified size
+ *
+ * @return pointer to allocated chunk, if allocation was successful,
+ *         or NULL - if not enough memory.
+ */
+inline void * __attr_hot___ __attr_always_inline___
+jmem_pools_alloc (size_t size) /**< size of the chunk */
+{
+#ifdef JMEM_GC_BEFORE_EACH_ALLOC
+  jmem_run_free_unused_memory_callbacks (JMEM_FREE_UNUSED_MEMORY_SEVERITY_HIGH);
+#endif /* JMEM_GC_BEFORE_EACH_ALLOC */
+
+  if (size <= 8)
+  {
+    if (JERRY_CONTEXT (jmem_free_8_byte_chunk_p) != NULL)
+    {
+      const jmem_pools_chunk_t *const chunk_p = JERRY_CONTEXT (jmem_free_8_byte_chunk_p);
+
+      VALGRIND_DEFINED_SPACE (chunk_p, sizeof (jmem_pools_chunk_t));
+
+      JERRY_CONTEXT (jmem_free_8_byte_chunk_p) = chunk_p->next_p;
+
+      VALGRIND_UNDEFINED_SPACE (chunk_p, sizeof (jmem_pools_chunk_t));
+
+      return (void *) chunk_p;
+    }
+    else
+    {
+      return (void *) jmem_heap_alloc_block (8);
+    }
+  }
+
+#ifdef JERRY_CPOINTER_32_BIT
+  JERRY_ASSERT (size <= 16);
+
+  if (JERRY_CONTEXT (jmem_free_16_byte_chunk_p) != NULL)
+  {
+    const jmem_pools_chunk_t *const chunk_p = JERRY_CONTEXT (jmem_free_16_byte_chunk_p);
+
+    VALGRIND_DEFINED_SPACE (chunk_p, sizeof (jmem_pools_chunk_t));
+
+    JERRY_CONTEXT (jmem_free_16_byte_chunk_p) = chunk_p->next_p;
+
+    VALGRIND_UNDEFINED_SPACE (chunk_p, sizeof (jmem_pools_chunk_t));
+
+    return (void *) chunk_p;
+  }
+  else
+  {
+    return (void *) jmem_heap_alloc_block (16);
+  }
+#else /* !JERRY_CPOINTER_32_BIT */
+  JERRY_UNREACHABLE ();
+  return NULL;
+#endif
+} /* jmem_pools_alloc */
+
+/**
+ * Free the chunk
+ */
+inline void __attr_hot___ __attr_always_inline___
+jmem_pools_free (void *chunk_p, /**< pointer to the chunk */
+                 size_t size) /**< size of the chunk */
+{
+  JERRY_ASSERT (chunk_p != NULL);
+
+  jmem_pools_chunk_t *const chunk_to_free_p = (jmem_pools_chunk_t *) chunk_p;
+
+  VALGRIND_DEFINED_SPACE (chunk_to_free_p, size);
+
+  if (size <= 8)
+  {
+    chunk_to_free_p->next_p = JERRY_CONTEXT (jmem_free_8_byte_chunk_p);
+    JERRY_CONTEXT (jmem_free_8_byte_chunk_p) = chunk_to_free_p;
+  }
+  else
+  {
+#ifdef JERRY_CPOINTER_32_BIT
+    JERRY_ASSERT (size <= 16);
+
+    chunk_to_free_p->next_p = JERRY_CONTEXT (jmem_free_16_byte_chunk_p);
+    JERRY_CONTEXT (jmem_free_16_byte_chunk_p) = chunk_to_free_p;
+#else /* !JERRY_CPOINTER_32_BIT */
+    JERRY_UNREACHABLE ();
+#endif /* JERRY_CPOINTER_32_BIT */
+  }
+
+  VALGRIND_NOACCESS_SPACE (chunk_to_free_p, size);
+} /* jmem_pools_free */
+
+/**
+ *  Collect empty pool chunks
+ */
+void
+jmem_pools_collect_empty (void)
+{
+  jmem_pools_chunk_t *chunk_p = JERRY_CONTEXT (jmem_free_8_byte_chunk_p);
+  JERRY_CONTEXT (jmem_free_8_byte_chunk_p) = NULL;
+
+  while (chunk_p)
+  {
+    VALGRIND_DEFINED_SPACE (chunk_p, sizeof (jmem_pools_chunk_t));
+    jmem_pools_chunk_t *const next_p = chunk_p->next_p;
+    VALGRIND_NOACCESS_SPACE (chunk_p, sizeof (jmem_pools_chunk_t));
+
+    jmem_heap_free_block (chunk_p, 8);
+    chunk_p = next_p;
+  }
+
+#ifdef JERRY_CPOINTER_32_BIT
+  chunk_p = JERRY_CONTEXT (jmem_free_16_byte_chunk_p);
+  JERRY_CONTEXT (jmem_free_16_byte_chunk_p) = NULL;
+
+  while (chunk_p)
+  {
+    VALGRIND_DEFINED_SPACE (chunk_p, sizeof (jmem_pools_chunk_t));
+    jmem_pools_chunk_t *const next_p = chunk_p->next_p;
+    VALGRIND_NOACCESS_SPACE (chunk_p, sizeof (jmem_pools_chunk_t));
+
+    jmem_heap_free_block (chunk_p, 16);
+    chunk_p = next_p;
+  }
+#endif /* JERRY_CPOINTER_32_BIT */
+} /* jmem_pools_collect_empty */
+
+#undef VALGRIND_NOACCESS_SPACE
+#undef VALGRIND_UNDEFINED_SPACE
+#undef VALGRIND_DEFINED_SPACE
+#undef VALGRIND_FREYA_MALLOCLIKE_SPACE
+#undef VALGRIND_FREYA_FREELIKE_SPACE
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/jmem/jmem.h b/deps/jerry/jerry-core/jmem/jmem.h
new file mode 100644 (file)
index 0000000..de5b054
--- /dev/null
@@ -0,0 +1,261 @@
+/* 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.
+ */
+
+#ifndef JMEM_H
+#define JMEM_H
+
+#include "jrt.h"
+
+/** \addtogroup mem Memory allocation
+ * @{
+ *
+ * \addtogroup heap Heap
+ * @{
+ */
+
+#ifndef JERRY_ENABLE_EXTERNAL_CONTEXT
+/**
+ * Size of heap
+ */
+#define JMEM_HEAP_SIZE ((size_t) (CONFIG_MEM_HEAP_AREA_SIZE))
+#endif /* !JERRY_ENABLE_EXTERNAL_CONTEXT */
+
+/**
+ * Logarithm of required alignment for allocated units/blocks
+ */
+#define JMEM_ALIGNMENT_LOG   3
+
+/**
+ * Representation of NULL value for compressed pointers
+ */
+#define JMEM_CP_NULL ((jmem_cpointer_t) 0)
+
+/**
+ * Required alignment for allocated units/blocks
+ */
+#define JMEM_ALIGNMENT (1u << JMEM_ALIGNMENT_LOG)
+
+/**
+ * Compressed pointer representations
+ *
+ * 16 bit representation:
+ *   The jmem_cpointer_t is defined as uint16_t
+ *   and it can contain any sixteen bit value.
+ *
+ * 32 bit representation:
+ *   The jmem_cpointer_t is defined as uint32_t.
+ *   The lower JMEM_ALIGNMENT_LOG bits must be zero.
+ *   The other bits can have any value.
+ *
+ * The 16 bit representation always encodes an offset from
+ * a heap base. The 32 bit representation currently encodes
+ * raw 32 bit JMEM_ALIGNMENT aligned pointers on 32 bit systems.
+ * This can be extended to encode a 32 bit offset from a heap
+ * base on 64 bit systems in the future. There are no plans
+ * to support more than 4G address space for JerryScript.
+ */
+
+/**
+ * Compressed pointer
+ */
+#ifdef JERRY_CPOINTER_32_BIT
+typedef uint32_t jmem_cpointer_t;
+#else /* !JERRY_CPOINTER_32_BIT */
+typedef uint16_t jmem_cpointer_t;
+#endif /* JERRY_CPOINTER_32_BIT */
+
+/**
+ * Severity of a 'try give memory back' request
+ *
+ * The request are posted sequentially beginning from
+ * low to high until enough memory is freed.
+ *
+ * If not enough memory is freed upon a high request
+ * then the engine is shut down with ERR_OUT_OF_MEMORY.
+ */
+typedef enum
+{
+  JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW,  /**< 'low' severity */
+  JMEM_FREE_UNUSED_MEMORY_SEVERITY_HIGH, /**< 'high' severity */
+} jmem_free_unused_memory_severity_t;
+
+/**
+ * Node for free chunk list
+ */
+typedef struct jmem_pools_chunk_t
+{
+  struct jmem_pools_chunk_t *next_p; /**< pointer to next pool chunk */
+} jmem_pools_chunk_t;
+
+/**
+ *  Free region node
+ */
+typedef struct
+{
+  uint32_t next_offset; /**< Offset of next region in list */
+  uint32_t size; /**< Size of region */
+} jmem_heap_free_t;
+
+void jmem_init (void);
+void jmem_finalize (void);
+
+void *jmem_heap_alloc_block (const size_t size);
+void *jmem_heap_alloc_block_null_on_error (const size_t size);
+void jmem_heap_free_block (void *ptr, const size_t size);
+
+#ifdef JMEM_STATS
+/**
+ * Heap memory usage statistics
+ */
+typedef struct
+{
+  size_t size; /**< heap total size */
+
+  size_t allocated_bytes; /**< currently allocated bytes */
+  size_t peak_allocated_bytes; /**< peak allocated bytes */
+
+  size_t waste_bytes; /**< bytes waste due to blocks filled partially */
+  size_t peak_waste_bytes; /**< peak wasted bytes */
+
+  size_t byte_code_bytes; /**< allocated memory for byte code */
+  size_t peak_byte_code_bytes; /**< peak allocated memory for byte code */
+
+  size_t string_bytes; /**< allocated memory for strings */
+  size_t peak_string_bytes; /**< peak allocated memory for strings */
+
+  size_t object_bytes; /**< allocated memory for objects */
+  size_t peak_object_bytes; /**< peak allocated memory for objects */
+
+  size_t property_bytes; /**< allocated memory for properties */
+  size_t peak_property_bytes; /**< peak allocated memory for properties */
+
+  size_t skip_count; /**< Number of skip-aheads during insertion of free block */
+  size_t nonskip_count; /**< Number of times we could not skip ahead during
+                         *   free block insertion */
+
+  size_t alloc_count; /**< number of memory allocations */
+  size_t free_count; /**< number of memory frees */
+  size_t alloc_iter_count; /**< Number of iterations required for allocations */
+  size_t free_iter_count; /**< Number of iterations required for inserting free blocks */
+} jmem_heap_stats_t;
+
+void jmem_stats_print (void);
+void jmem_stats_allocate_byte_code_bytes (size_t property_size);
+void jmem_stats_free_byte_code_bytes (size_t property_size);
+void jmem_stats_allocate_string_bytes (size_t string_size);
+void jmem_stats_free_string_bytes (size_t string_size);
+void jmem_stats_allocate_object_bytes (size_t object_size);
+void jmem_stats_free_object_bytes (size_t string_size);
+void jmem_stats_allocate_property_bytes (size_t property_size);
+void jmem_stats_free_property_bytes (size_t property_size);
+
+#endif /* JMEM_STATS */
+
+jmem_cpointer_t jmem_compress_pointer (const void *pointer_p) __attr_pure___;
+void *jmem_decompress_pointer (uintptr_t compressed_pointer) __attr_pure___;
+
+/**
+ * A free memory callback routine type.
+ */
+typedef void (*jmem_free_unused_memory_callback_t) (jmem_free_unused_memory_severity_t);
+
+void jmem_register_free_unused_memory_callback (jmem_free_unused_memory_callback_t callback);
+void jmem_unregister_free_unused_memory_callback (jmem_free_unused_memory_callback_t callback);
+
+void jmem_run_free_unused_memory_callbacks (jmem_free_unused_memory_severity_t severity);
+
+/**
+ * Define a local array variable and allocate memory for the array on the heap.
+ *
+ * If requested number of elements is zero, assign NULL to the variable.
+ *
+ * Warning:
+ *         if there is not enough memory on the heap, shutdown engine with ERR_OUT_OF_MEMORY.
+ */
+#define JMEM_DEFINE_LOCAL_ARRAY(var_name, number, type) \
+{ \
+  size_t var_name ## ___size = (size_t) (number) * sizeof (type); \
+  type *var_name = (type *) (jmem_heap_alloc_block (var_name ## ___size));
+
+/**
+ * Free the previously defined local array variable, freeing corresponding block on the heap,
+ * if it was allocated (i.e. if the array's size was non-zero).
+ */
+#define JMEM_FINALIZE_LOCAL_ARRAY(var_name) \
+  if (var_name != NULL) \
+  { \
+    JERRY_ASSERT (var_name ## ___size != 0); \
+    \
+    jmem_heap_free_block (var_name, var_name ## ___size); \
+  } \
+  else \
+  { \
+    JERRY_ASSERT (var_name ## ___size == 0); \
+  } \
+}
+
+/**
+ * Get value of pointer from specified non-null compressed pointer value
+ */
+#define JMEM_CP_GET_NON_NULL_POINTER(type, cp_value) \
+  ((type *) (jmem_decompress_pointer (cp_value)))
+
+/**
+ * Get value of pointer from specified compressed pointer value
+ */
+#define JMEM_CP_GET_POINTER(type, cp_value) \
+  (((unlikely ((cp_value) == JMEM_CP_NULL)) ? NULL : JMEM_CP_GET_NON_NULL_POINTER (type, cp_value)))
+
+/**
+ * Set value of non-null compressed pointer so that it will correspond
+ * to specified non_compressed_pointer
+ */
+#define JMEM_CP_SET_NON_NULL_POINTER(cp_value, non_compressed_pointer) \
+  (cp_value) = jmem_compress_pointer (non_compressed_pointer)
+
+/**
+ * Set value of compressed pointer so that it will correspond
+ * to specified non_compressed_pointer
+ */
+#define JMEM_CP_SET_POINTER(cp_value, non_compressed_pointer) \
+  do \
+  { \
+    void *ptr_value = (void *) non_compressed_pointer; \
+    \
+    if (unlikely ((ptr_value) == NULL)) \
+    { \
+      (cp_value) = JMEM_CP_NULL; \
+    } \
+    else \
+    { \
+      JMEM_CP_SET_NON_NULL_POINTER (cp_value, ptr_value); \
+    } \
+  } while (false);
+
+/**
+ * @}
+ * \addtogroup poolman Memory pool manager
+ * @{
+ */
+
+void *jmem_pools_alloc (size_t size);
+void jmem_pools_free (void *chunk_p, size_t size);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !JMEM_H */
diff --git a/deps/jerry/jerry-core/jrt/jrt-bit-fields.h b/deps/jerry/jerry-core/jrt/jrt-bit-fields.h
new file mode 100644 (file)
index 0000000..c5aaf37
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+#ifndef JRT_BIT_FIELDS_H
+#define JRT_BIT_FIELDS_H
+
+/**
+ * Extract a bit-field.
+ *
+ * @param type type of container
+ * @param container container to extract bit-field from
+ * @param lsb least significant bit of the value to be extracted
+ * @param width width of the bit-field to be extracted
+ * @return bit-field's value
+ */
+#define JRT_EXTRACT_BIT_FIELD(type, container, lsb, width) \
+  (((container) >> lsb) & ((((type) 1) << (width)) - 1))
+
+/**
+ * Set a bit-field.
+ *
+ * @param type type of container
+ * @param container container to insert bit-field to
+ * @param new_bit_field_value value of bit-field to insert
+ * @param lsb least significant bit of the value to be inserted
+ * @param width width of the bit-field to be inserted
+ * @return bit-field's value
+ */
+#define JRT_SET_BIT_FIELD_VALUE(type, container, new_bit_field_value, lsb, width) \
+  (((container) & ~(((((type) 1) << (width)) - 1) << (lsb))) | (((type) new_bit_field_value) << (lsb)))
+
+#endif /* !JRT_BIT_FIELDS_H */
diff --git a/deps/jerry/jerry-core/jrt/jrt-fatals.c b/deps/jerry/jerry-core/jrt/jrt-fatals.c
new file mode 100644 (file)
index 0000000..d5d8170
--- /dev/null
@@ -0,0 +1,100 @@
+/* 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.
+ */
+
+/**
+ * Implementation of exit with specified status code.
+ */
+
+#include "jrt.h"
+#include "jrt-libc-includes.h"
+
+/*
+ * Exit with specified status code.
+ *
+ * If !JERRY_NDEBUG and code != 0, print status code with description
+ * and call assertion fail handler.
+ */
+void __noreturn
+jerry_fatal (jerry_fatal_code_t code) /**< status code */
+{
+#ifndef JERRY_NDEBUG
+  switch (code)
+  {
+    case ERR_OUT_OF_MEMORY:
+    {
+      JERRY_ERROR_MSG ("Error: ERR_OUT_OF_MEMORY\n");
+      break;
+    }
+    case ERR_SYSCALL:
+    {
+      /* print nothing as it may invoke syscall recursively */
+      break;
+    }
+    case ERR_REF_COUNT_LIMIT:
+    {
+      JERRY_ERROR_MSG ("Error: ERR_REF_COUNT_LIMIT\n");
+      break;
+    }
+    case ERR_FAILED_INTERNAL_ASSERTION:
+    {
+      JERRY_ERROR_MSG ("Error: ERR_FAILED_INTERNAL_ASSERTION\n");
+      break;
+    }
+  }
+#endif /* !JERRY_NDEBUG */
+
+  jerry_port_fatal (code);
+
+  /* to make compiler happy for some RTOS: 'control reaches end of non-void function' */
+  while (true)
+  {
+  }
+} /* jerry_fatal */
+
+#ifndef JERRY_NDEBUG
+/**
+ * Handle failed assertion
+ */
+void __noreturn
+jerry_assert_fail (const char *assertion, /**< assertion condition string */
+                   const char *file, /**< file name */
+                   const char *function, /**< function name */
+                   const uint32_t line) /**< line */
+{
+  JERRY_ERROR_MSG ("ICE: Assertion '%s' failed at %s(%s):%lu.\n",
+                   assertion,
+                   file,
+                   function,
+                   (unsigned long) line);
+
+  jerry_fatal (ERR_FAILED_INTERNAL_ASSERTION);
+} /* jerry_assert_fail */
+
+/**
+ * Handle execution of control path that should be unreachable
+ */
+void __noreturn
+jerry_unreachable (const char *file, /**< file name */
+                   const char *function, /**< function name */
+                   const uint32_t line) /**< line */
+{
+  JERRY_ERROR_MSG ("ICE: Unreachable control path at %s(%s):%lu was executed.\n",
+                   file,
+                   function,
+                   (unsigned long) line);
+
+  jerry_fatal (ERR_FAILED_INTERNAL_ASSERTION);
+} /* jerry_unreachable */
+#endif /* !JERRY_NDEBUG */
diff --git a/deps/jerry/jerry-core/jrt/jrt-libc-includes.h b/deps/jerry/jerry-core/jrt/jrt-libc-includes.h
new file mode 100644 (file)
index 0000000..bf87a86
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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.
+ */
+
+#ifndef JRT_LIBC_INCLUDES_H
+#define JRT_LIBC_INCLUDES_H
+
+#include <ctype.h>
+#include <setjmp.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#endif /* !JRT_LIBC_INCLUDES_H */
diff --git a/deps/jerry/jerry-core/jrt/jrt-types.h b/deps/jerry/jerry-core/jrt/jrt-types.h
new file mode 100644 (file)
index 0000000..16d444e
--- /dev/null
@@ -0,0 +1,24 @@
+/* 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.
+ */
+
+#ifndef JRT_TYPES_H
+#define JRT_TYPES_H
+
+#include <float.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#endif /* !JRT_TYPES_H */
diff --git a/deps/jerry/jerry-core/jrt/jrt.h b/deps/jerry/jerry-core/jrt/jrt.h
new file mode 100644 (file)
index 0000000..583d313
--- /dev/null
@@ -0,0 +1,153 @@
+/* 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.
+ */
+
+#ifndef JRT_H
+#define JRT_H
+
+#include <stdio.h>
+#include <string.h>
+
+#include "jerryscript-port.h"
+#include "jrt-types.h"
+
+/*
+ * Attributes
+ */
+#define __noreturn __attribute__((noreturn))
+#define __attr_noinline___ __attribute__((noinline))
+#define __attr_return_value_should_be_checked___ __attribute__((warn_unused_result))
+#define __attr_hot___ __attribute__((hot))
+#ifndef __attr_always_inline___
+#define __attr_always_inline___ __attribute__((always_inline))
+#endif /* !__attr_always_inline___ */
+#ifndef __attr_const___
+#define __attr_const___ __attribute__((const))
+#endif /* !__attr_const___ */
+#ifndef __attr_pure___
+#define __attr_pure___ __attribute__((pure))
+#endif /* !__attr_pure___ */
+
+/*
+ * Conditions' likeliness, unlikeliness.
+ */
+#ifdef __GNUC__
+#define likely(x)       __builtin_expect(!!(x), 1)
+#define unlikely(x)     __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ */
+#define likely(x)       (x)
+#define unlikely(x)     (x)
+#endif /* __GNUC__ */
+
+/*
+ * Normally compilers store const(ant)s in ROM. Thus saving RAM.
+ * But if your compiler does not support it then the directive below can force it.
+ *
+ * For the moment it is mainly meant for the following targets:
+ *      - ESP8266
+ */
+#ifndef JERRY_CONST_DATA
+# define JERRY_CONST_DATA
+#endif /* JERRY_CONST_DATA */
+
+/*
+ * Constants
+ */
+#define JERRY_BITSINBYTE 8
+
+/*
+ * Make sure unused parameters, variables, or expressions trigger no compiler warning.
+ */
+#define JERRY_UNUSED(x) ((void) (x))
+
+/*
+ * Asserts
+ *
+ * Warning:
+ *         Don't use JERRY_STATIC_ASSERT in headers, because
+ *         __LINE__ may be the same for asserts in a header
+ *         and in an implementation file.
+ */
+#define JERRY_STATIC_ASSERT_GLUE_(a, b, c) a ## b ## _ ## c
+#define JERRY_STATIC_ASSERT_GLUE(a, b, c) JERRY_STATIC_ASSERT_GLUE_ (a, b, c)
+#define JERRY_STATIC_ASSERT(x, msg) \
+  enum { JERRY_STATIC_ASSERT_GLUE (static_assertion_failed_, __LINE__, msg) = 1 / (!!(x)) }
+
+#ifndef JERRY_NDEBUG
+void __noreturn jerry_assert_fail (const char *assertion, const char *file, const char *function, const uint32_t line);
+void __noreturn jerry_unreachable (const char *file, const char *function, const uint32_t line);
+
+#define JERRY_ASSERT(x) \
+  do \
+  { \
+    if (unlikely (!(x))) \
+    { \
+      jerry_assert_fail (#x, __FILE__, __func__, __LINE__); \
+    } \
+  } while (0)
+
+#define JERRY_UNREACHABLE() \
+  do \
+  { \
+    jerry_unreachable (__FILE__, __func__, __LINE__); \
+  } while (0)
+#else /* JERRY_NDEBUG */
+#define JERRY_ASSERT(x) \
+  do \
+  { \
+    if (false) \
+    { \
+      JERRY_UNUSED (x); \
+    } \
+  } while (0)
+
+#ifdef __GNUC__
+#define JERRY_UNREACHABLE() __builtin_unreachable ()
+#else /* !__GNUC__ */
+#define JERRY_UNREACHABLE()
+#endif /* __GNUC__ */
+#endif /* !JERRY_NDEBUG */
+
+/**
+ * Exit on fatal error
+ */
+void __noreturn jerry_fatal (jerry_fatal_code_t code);
+
+/*
+ * Logging
+ */
+#define JERRY_ERROR_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_ERROR, __VA_ARGS__)
+#define JERRY_WARNING_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_WARNING, __VA_ARGS__)
+#define JERRY_DEBUG_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_DEBUG, __VA_ARGS__)
+#define JERRY_TRACE_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_TRACE, __VA_ARGS__)
+
+/**
+ * Size of struct member
+ */
+#define JERRY_SIZE_OF_STRUCT_MEMBER(struct_name, member_name) sizeof (((struct_name *) NULL)->member_name)
+
+/**
+ * Aligns @a value to @a alignment. @a must be the power of 2.
+ *
+ * Returns minimum positive value, that divides @a alignment and is more than or equal to @a value
+ */
+#define JERRY_ALIGNUP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment) - 1))
+
+/*
+ * min, max
+ */
+#define JERRY_MIN(v1, v2) (((v1) < (v2)) ? (v1) : (v2))
+#define JERRY_MAX(v1, v2) (((v1) < (v2)) ? (v2) : (v1))
+
+#endif /* !JRT_H */
diff --git a/deps/jerry/jerry-core/lit/lit-char-helpers.c b/deps/jerry/jerry-core/lit/lit-char-helpers.c
new file mode 100644 (file)
index 0000000..1089923
--- /dev/null
@@ -0,0 +1,784 @@
+/* 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.
+ */
+
+#include "lit-char-helpers.h"
+#include "lit/lit-unicode-ranges.inc.h"
+#include "lit-strings.h"
+
+#ifndef CONFIG_DISABLE_UNICODE_CASE_CONVERSION
+#include "lit-unicode-conversions.inc.h"
+#endif /* !CONFIG_DISABLE_UNICODE_CASE_CONVERSION */
+
+#define NUM_OF_ELEMENTS(array) (sizeof (array) / sizeof ((array)[0]))
+
+/**
+ * Binary search algorithm that searches the a
+ * character in the given char array.
+ *
+ * @return true - if the character is in the given array
+ *         false - otherwise
+ */
+static bool
+search_char_in_char_array (ecma_char_t c,               /**< code unit */
+                           const ecma_char_t *array,    /**< array */
+                           int size_of_array)           /**< length of the array */
+{
+  int bottom = 0;
+  int top = size_of_array - 1;
+
+  while (bottom <= top)
+  {
+    int middle = (bottom + top) / 2;
+    ecma_char_t current = array[middle];
+
+    if (current == c)
+    {
+      return true;
+    }
+
+    if (c < current)
+    {
+      top = middle - 1;
+    }
+    else
+    {
+      bottom = middle + 1;
+    }
+  }
+
+  return false;
+} /* search_char_in_char_array */
+
+/**
+ * Binary search algorithm that searches a character in the given intervals.
+ * Intervals specifed by two arrays. The first one contains the starting points
+ * of the intervals, the second one contains the length of them.
+ *
+ * @return true - if the the character is included (inclusively) in one of the intervals in the given array
+ *         false - otherwise
+ */
+static bool
+search_char_in_interval_array (ecma_char_t c,               /**< code unit */
+                               const ecma_char_t *array_sp, /**< array of interval starting points */
+                               const uint8_t *lengths,      /**< array of interval lengths */
+                               int size_of_array)           /**< length of the array */
+{
+  int bottom = 0;
+  int top = size_of_array - 1;
+
+  while (bottom <= top)
+  {
+    int middle = (bottom + top) / 2;
+    ecma_char_t current_sp = array_sp[middle];
+
+    if (current_sp <= c && c <= current_sp + lengths[middle])
+    {
+      return true;
+    }
+
+    if (c > current_sp)
+    {
+      bottom = middle + 1;
+    }
+    else
+    {
+      top = middle - 1;
+    }
+  }
+
+  return false;
+} /* search_char_in_interval_array */
+
+/**
+ * Check if specified character is one of the Format-Control characters
+ *
+ * @return true - if the character is one of characters, listed in ECMA-262 v5, Table 1,
+ *         false - otherwise
+ */
+bool
+lit_char_is_format_control (ecma_char_t c) /**< code unit */
+{
+  return (c == LIT_CHAR_ZWNJ
+          || c == LIT_CHAR_ZWJ
+          || c == LIT_CHAR_BOM);
+} /* lit_char_is_format_control */
+
+/**
+ * Check if specified character is one of the Whitespace characters including those
+ * that fall into "Space, Separator" ("Zs") Unicode character category.
+ *
+ * @return true - if the character is one of characters, listed in ECMA-262 v5, Table 2,
+ *         false - otherwise
+ */
+bool
+lit_char_is_white_space (ecma_char_t c) /**< code unit */
+{
+  if (c <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+  {
+    return (c == LIT_CHAR_TAB
+            || c == LIT_CHAR_VTAB
+            || c == LIT_CHAR_FF
+            || c == LIT_CHAR_SP);
+  }
+  else
+  {
+    return (c == LIT_CHAR_NBSP
+            || c == LIT_CHAR_BOM
+            || (c >= lit_unicode_separator_char_interval_sps[0]
+                && c <= lit_unicode_separator_char_interval_sps[0] + lit_unicode_separator_char_interval_lengths[0])
+            || search_char_in_char_array (c,
+                                          lit_unicode_separator_chars,
+                                          NUM_OF_ELEMENTS (lit_unicode_separator_chars)));
+  }
+} /* lit_char_is_white_space */
+
+/**
+ * Check if specified character is one of LineTerminator characters
+ *
+ * @return true - if the character is one of characters, listed in ECMA-262 v5, Table 3,
+ *         false - otherwise
+ */
+bool
+lit_char_is_line_terminator (ecma_char_t c) /**< code unit */
+{
+  return (c == LIT_CHAR_LF
+          || c == LIT_CHAR_CR
+          || c == LIT_CHAR_LS
+          || c == LIT_CHAR_PS);
+} /* lit_char_is_line_terminator */
+
+/**
+ * Check if specified character is a unicode letter
+ *
+ * Note:
+ *      Unicode letter is a character, included into one of the following categories:
+ *       - Uppercase letter (Lu);
+ *       - Lowercase letter (Ll);
+ *       - Titlecase letter (Lt);
+ *       - Modifier letter (Lm);
+ *       - Other letter (Lo);
+ *       - Letter number (Nl).
+ *
+ * See also:
+ *          ECMA-262 v5, 7.6
+ *
+ * @return true - if specified character falls into one of the listed categories,
+ *         false - otherwise
+ */
+static bool
+lit_char_is_unicode_letter (ecma_char_t c) /**< code unit */
+{
+  return (search_char_in_interval_array (c,
+                                         lit_unicode_letter_interval_sps,
+                                         lit_unicode_letter_interval_lengths,
+                                         NUM_OF_ELEMENTS (lit_unicode_letter_interval_sps))
+          || search_char_in_char_array (c, lit_unicode_letter_chars, NUM_OF_ELEMENTS (lit_unicode_letter_chars)));
+} /* lit_char_is_unicode_letter */
+
+/**
+ * Check if specified character is a non-letter character and can be used as a
+ * non-first character of an identifier.
+ * These characters coverd by the following unicode categories:
+ *  - digit (Nd)
+ *  - punctuation mark (Mn, Mc)
+ *  - connector punctuation (Pc)
+ *
+ * See also:
+ *          ECMA-262 v5, 7.6
+ *
+ * @return true - if specified character falls into one of the listed categories,
+ *         false - otherwise
+ */
+static bool
+lit_char_is_unicode_non_letter_ident_part (ecma_char_t c) /**< code unit */
+{
+  return (search_char_in_interval_array (c,
+                                         lit_unicode_non_letter_ident_part_interval_sps,
+                                         lit_unicode_non_letter_ident_part_interval_lengths,
+                                         NUM_OF_ELEMENTS (lit_unicode_non_letter_ident_part_interval_sps))
+          || search_char_in_char_array (c,
+                                        lit_unicode_non_letter_ident_part_chars,
+                                        NUM_OF_ELEMENTS (lit_unicode_non_letter_ident_part_chars)));
+} /* lit_char_is_unicode_non_letter_ident_part */
+
+/**
+ * Checks whether the next UTF8 character is a valid identifier start.
+ *
+ * @return true if it is.
+ */
+bool
+lit_char_is_identifier_start (const uint8_t *src_p) /**< pointer to a vaild UTF8 character */
+{
+  if (*src_p <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+  {
+    return lit_char_is_identifier_start_character (*src_p);
+  }
+
+  /* ECMAScript 2015 specification allows some code points in supplementary plane.
+   * However, we don't permit characters in supplementary characters as start of identifier.
+   */
+  if ((*src_p & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER)
+  {
+    return false;
+  }
+
+  return lit_char_is_identifier_start_character (lit_utf8_peek_next (src_p));
+} /* lit_char_is_identifier_start */
+
+/**
+ * Checks whether the character is a valid identifier start.
+ *
+ * @return true if it is.
+ */
+bool
+lit_char_is_identifier_start_character (uint16_t chr) /**< EcmaScript character */
+{
+  /* Fast path for ASCII-defined letters. */
+  if (chr <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+  {
+    return ((LEXER_TO_ASCII_LOWERCASE (chr) >= LIT_CHAR_LOWERCASE_A
+             && LEXER_TO_ASCII_LOWERCASE (chr) <= LIT_CHAR_LOWERCASE_Z)
+            || chr == LIT_CHAR_DOLLAR_SIGN
+            || chr == LIT_CHAR_UNDERSCORE);
+  }
+
+  return lit_char_is_unicode_letter (chr);
+} /* lit_char_is_identifier_start_character */
+
+/**
+ * Checks whether the next UTF8 character is a valid identifier part.
+ *
+ * @return true if it is.
+ */
+bool
+lit_char_is_identifier_part (const uint8_t *src_p) /**< pointer to a vaild UTF8 character */
+{
+  if (*src_p <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+  {
+    return lit_char_is_identifier_part_character (*src_p);
+  }
+
+  /* ECMAScript 2015 specification allows some code points in supplementary plane.
+   * However, we don't permit characters in supplementary characters as part of identifier.
+   */
+  if ((*src_p & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER)
+  {
+    return false;
+  }
+
+  return lit_char_is_identifier_part_character (lit_utf8_peek_next (src_p));
+} /* lit_char_is_identifier_part */
+
+/**
+ * Checks whether the character is a valid identifier part.
+ *
+ * @return true if it is.
+ */
+bool
+lit_char_is_identifier_part_character (uint16_t chr) /**< EcmaScript character */
+{
+  /* Fast path for ASCII-defined letters. */
+  if (chr <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+  {
+    return ((LEXER_TO_ASCII_LOWERCASE (chr) >= LIT_CHAR_LOWERCASE_A
+             && LEXER_TO_ASCII_LOWERCASE (chr) <= LIT_CHAR_LOWERCASE_Z)
+            || (chr >= LIT_CHAR_0 && chr <= LIT_CHAR_9)
+            || chr == LIT_CHAR_DOLLAR_SIGN
+            || chr == LIT_CHAR_UNDERSCORE);
+  }
+
+  return (lit_char_is_unicode_letter (chr)
+          || lit_char_is_unicode_non_letter_ident_part (chr));
+} /* lit_char_is_identifier_part_character */
+
+/**
+ * Check if specified character is one of OctalDigit characters (ECMA-262 v5, B.1.2)
+ *
+ * @return true / false
+ */
+bool
+lit_char_is_octal_digit (ecma_char_t c) /**< code unit */
+{
+  return (c >= LIT_CHAR_ASCII_OCTAL_DIGITS_BEGIN && c <= LIT_CHAR_ASCII_OCTAL_DIGITS_END);
+} /* lit_char_is_octal_digit */
+
+/**
+ * Check if specified character is one of DecimalDigit characters (ECMA-262 v5, 7.8.3)
+ *
+ * @return true / false
+ */
+bool
+lit_char_is_decimal_digit (ecma_char_t c) /**< code unit */
+{
+  return (c >= LIT_CHAR_ASCII_DIGITS_BEGIN && c <= LIT_CHAR_ASCII_DIGITS_END);
+} /* lit_char_is_decimal_digit */
+
+/**
+ * Check if specified character is one of HexDigit characters (ECMA-262 v5, 7.8.3)
+ *
+ * @return true / false
+ */
+bool
+lit_char_is_hex_digit (ecma_char_t c) /**< code unit */
+{
+  return ((c >= LIT_CHAR_ASCII_DIGITS_BEGIN && c <= LIT_CHAR_ASCII_DIGITS_END)
+          || (LEXER_TO_ASCII_LOWERCASE (c) >= LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_BEGIN
+              && LEXER_TO_ASCII_LOWERCASE (c) <= LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_END));
+} /* lit_char_is_hex_digit */
+
+/**
+ * Convert a HexDigit character to its numeric value, as defined in ECMA-262 v5, 7.8.3
+ *
+ * @return digit value, corresponding to the hex char
+ */
+uint32_t
+lit_char_hex_to_int (ecma_char_t c) /**< code unit, corresponding to
+                                     *    one of HexDigit characters */
+{
+  JERRY_ASSERT (lit_char_is_hex_digit (c));
+
+  if (c >= LIT_CHAR_ASCII_DIGITS_BEGIN && c <= LIT_CHAR_ASCII_DIGITS_END)
+  {
+    return (uint32_t) (c - LIT_CHAR_ASCII_DIGITS_BEGIN);
+  }
+  else if (c >= LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_BEGIN && c <= LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_END)
+  {
+    return (uint32_t) (c - LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_BEGIN + 10);
+  }
+  else
+  {
+    return (uint32_t) (c - LIT_CHAR_ASCII_UPPERCASE_LETTERS_HEX_BEGIN + 10);
+  }
+} /* lit_char_hex_to_int */
+
+/**
+ * Converts a character to UTF8 bytes.
+ *
+ * @return length of the UTF8 representation.
+ */
+size_t
+lit_char_to_utf8_bytes (uint8_t *dst_p, /**< destination buffer */
+                        ecma_char_t chr) /**< EcmaScript character */
+{
+  if (!(chr & ~LIT_UTF8_1_BYTE_CODE_POINT_MAX))
+  {
+    /* 00000000 0xxxxxxx -> 0xxxxxxx */
+    *dst_p = (uint8_t) chr;
+    return 1;
+  }
+
+  if (!(chr & ~LIT_UTF8_2_BYTE_CODE_POINT_MAX))
+  {
+    /* 00000yyy yyxxxxxx -> 110yyyyy 10xxxxxx */
+    *(dst_p++) = (uint8_t) (LIT_UTF8_2_BYTE_MARKER | ((chr >> 6) & LIT_UTF8_LAST_5_BITS_MASK));
+    *dst_p = (uint8_t) (LIT_UTF8_EXTRA_BYTE_MARKER | (chr & LIT_UTF8_LAST_6_BITS_MASK));
+    return 2;
+  }
+
+  JERRY_ASSERT (!(chr & ~LIT_UTF8_3_BYTE_CODE_POINT_MAX));
+  /* zzzzyyyy yyxxxxxx -> 1110zzzz 10yyyyyy 10xxxxxx */
+  *(dst_p++) = (uint8_t) (LIT_UTF8_3_BYTE_MARKER | ((chr >> 12) & LIT_UTF8_LAST_4_BITS_MASK));
+  *(dst_p++) = (uint8_t) (LIT_UTF8_EXTRA_BYTE_MARKER | ((chr >> 6) & LIT_UTF8_LAST_6_BITS_MASK));
+  *dst_p = (uint8_t) (LIT_UTF8_EXTRA_BYTE_MARKER | (chr & LIT_UTF8_LAST_6_BITS_MASK));
+  return 3;
+} /* lit_char_to_utf8_bytes */
+
+/**
+ * Returns the length of the UTF8 representation of a character.
+ *
+ * @return length of the UTF8 representation.
+ */
+size_t
+lit_char_get_utf8_length (ecma_char_t chr) /**< EcmaScript character */
+{
+  if (!(chr & ~LIT_UTF8_1_BYTE_CODE_POINT_MAX))
+  {
+    /* 00000000 0xxxxxxx */
+    return 1;
+  }
+
+  if (!(chr & ~LIT_UTF8_2_BYTE_CODE_POINT_MAX))
+  {
+    /* 00000yyy yyxxxxxx */
+    return 2;
+  }
+
+  /* zzzzyyyy yyxxxxxx */
+  JERRY_ASSERT (!(chr & ~LIT_UTF8_3_BYTE_CODE_POINT_MAX));
+  return 3;
+} /* lit_char_get_utf8_length */
+
+/**
+ * Parse the next number_of_characters hexadecimal character,
+ * and construct a code unit from them. The buffer must
+ * be zero terminated.
+ *
+ * @return true if decoding was successful, false otherwise
+ */
+bool
+lit_read_code_unit_from_hex (const lit_utf8_byte_t *buf_p, /**< buffer with characters */
+                             lit_utf8_size_t number_of_characters, /**< number of characters to be read */
+                             ecma_char_ptr_t out_code_unit_p) /**< [out] decoded result */
+{
+  ecma_char_t code_unit = LIT_CHAR_NULL;
+
+  JERRY_ASSERT (number_of_characters >= 2 && number_of_characters <= 4);
+
+  for (lit_utf8_size_t i = 0; i < number_of_characters; i++)
+  {
+    code_unit = (ecma_char_t) (code_unit << 4u);
+
+    if (*buf_p >= LIT_CHAR_ASCII_DIGITS_BEGIN
+        && *buf_p <= LIT_CHAR_ASCII_DIGITS_END)
+    {
+      code_unit |= (ecma_char_t) (*buf_p - LIT_CHAR_ASCII_DIGITS_BEGIN);
+    }
+    else if (*buf_p >= LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_BEGIN
+             && *buf_p <= LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_END)
+    {
+      code_unit |= (ecma_char_t) (*buf_p - (LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_BEGIN - 10));
+    }
+    else if (*buf_p >= LIT_CHAR_ASCII_UPPERCASE_LETTERS_HEX_BEGIN
+             && *buf_p <= LIT_CHAR_ASCII_UPPERCASE_LETTERS_HEX_END)
+    {
+      code_unit |= (ecma_char_t) (*buf_p - (LIT_CHAR_ASCII_UPPERCASE_LETTERS_HEX_BEGIN - 10));
+    }
+    else
+    {
+      return false;
+    }
+
+    buf_p++;
+  }
+
+  *out_code_unit_p = code_unit;
+  return true;
+} /* lit_read_code_unit_from_hex */
+
+/**
+ * Check if specified character is a word character (part of IsWordChar abstract operation)
+ *
+ * See also: ECMA-262 v5, 15.10.2.6 (IsWordChar)
+ *
+ * @return true - if the character is a word character
+ *         false - otherwise
+ */
+bool
+lit_char_is_word_char (ecma_char_t c) /**< code unit */
+{
+  return ((c >= LIT_CHAR_ASCII_LOWERCASE_LETTERS_BEGIN && c <= LIT_CHAR_ASCII_LOWERCASE_LETTERS_END)
+          || (c >= LIT_CHAR_ASCII_UPPERCASE_LETTERS_BEGIN && c <= LIT_CHAR_ASCII_UPPERCASE_LETTERS_END)
+          || (c >= LIT_CHAR_ASCII_DIGITS_BEGIN && c <= LIT_CHAR_ASCII_DIGITS_END)
+          || c == LIT_CHAR_UNDERSCORE);
+} /* lit_char_is_word_char */
+
+#ifndef CONFIG_DISABLE_UNICODE_CASE_CONVERSION
+
+/**
+ * Check if the specified character is in one of those tables which contain bidirectional conversions.
+ *
+ * @return the mapped character sequence of an ecma character, if it's in the table.
+ *         0 - otherwise.
+ */
+static ecma_length_t
+search_in_bidirectional_conversion_tables (ecma_char_t character,        /**< code unit */
+                                           ecma_char_t *output_buffer_p, /**< [out] buffer for the result characters */
+                                           bool is_lowercase)            /**< is lowercase conversion */
+{
+  /* 1, Check if the specified character is part of the lit_character_case_ranges table. */
+  int number_of_case_ranges = NUM_OF_ELEMENTS (lit_character_case_ranges);
+  int conv_counter = 0;
+
+  for (int i = 0; i < number_of_case_ranges; i++)
+  {
+    if (i % 2 == 0 && i > 0)
+    {
+      conv_counter++;
+    }
+
+    int range_length = lit_character_case_range_lengths[conv_counter];
+    ecma_char_t start_point = lit_character_case_ranges[i];
+
+    if (start_point > character || character >= start_point + range_length)
+    {
+      continue;
+    }
+
+    int char_dist = character - start_point;
+
+    if (i % 2 == 0)
+    {
+      output_buffer_p[0] = is_lowercase ? (ecma_char_t) (lit_character_case_ranges[i + 1] + char_dist) : character;
+    }
+    else
+    {
+      output_buffer_p[0] = is_lowercase ? character : (ecma_char_t) (lit_character_case_ranges[i - 1] + char_dist);
+    }
+
+    return 1;
+  }
+
+  /* 2, Check if the specified character is part of the character_pair_ranges table. */
+  int bottom = 0;
+  int top = NUM_OF_ELEMENTS (lit_character_pair_ranges) - 1;
+
+  while (bottom <= top)
+  {
+    int middle = (bottom + top) / 2;
+    ecma_char_t current_sp = lit_character_pair_ranges[middle];
+
+    if (current_sp <= character && character < current_sp + lit_character_pair_range_lengths[middle])
+    {
+      int char_dist = character - current_sp;
+
+      if ((character - current_sp) % 2 == 0)
+      {
+        output_buffer_p[0] = is_lowercase ? (ecma_char_t) (current_sp + char_dist + 1) : character;
+      }
+      else
+      {
+        output_buffer_p[0] = is_lowercase ? character : (ecma_char_t) (current_sp + char_dist - 1);
+      }
+
+      return 1;
+    }
+
+    if (character > current_sp)
+    {
+      bottom = middle + 1;
+    }
+    else
+    {
+      top = middle - 1;
+    }
+  }
+
+  /* 3, Check if the specified character is part of the character_pairs table. */
+  int number_of_character_pairs = NUM_OF_ELEMENTS (lit_character_pairs);
+
+  for (int i = 0; i < number_of_character_pairs; i++)
+  {
+    if (character != lit_character_pairs[i])
+    {
+      continue;
+    }
+
+    if (i % 2 == 0)
+    {
+      output_buffer_p[0] = is_lowercase ? lit_character_pairs[i + 1] : character;
+    }
+    else
+    {
+      output_buffer_p[0] = is_lowercase ? character : lit_character_pairs[i - 1];
+    }
+
+    return 1;
+  }
+
+  return 0;
+} /* search_in_bidirectional_conversion_tables */
+
+/**
+ * Check if the specified character is in the given conversion table.
+ *
+ * @return the mapped character sequence of an ecma character, if it's in the table.
+ *         0 - otherwise.
+ */
+static ecma_length_t
+search_in_conversion_table (ecma_char_t character,        /**< code unit */
+                            ecma_char_t *output_buffer_p, /**< [out] buffer for the result characters */
+                            const ecma_char_t *array,     /**< array */
+                            const uint8_t *counters)      /**< case_values counter */
+{
+  int end_point = 0;
+
+  for (int i = 0; i < 3; i++)
+  {
+    int start_point = end_point;
+    int size_of_case_value = i + 1;
+    end_point += counters[i] * (size_of_case_value + 1);
+
+    int bottom = start_point;
+    int top = end_point - size_of_case_value;
+
+    while (bottom <= top)
+    {
+      int middle = (bottom + top) / 2;
+
+      middle -= ((middle - bottom) % (size_of_case_value + 1));
+
+      ecma_char_t current = array[middle];
+
+      if (current == character)
+      {
+        ecma_length_t char_sequence = 1;
+
+        switch (size_of_case_value)
+        {
+          case 3:
+          {
+            output_buffer_p[2] = array[middle + 3];
+            char_sequence++;
+            /* FALLTHRU */
+          }
+          case 2:
+          {
+            output_buffer_p[1] = array[middle + 2];
+            char_sequence++;
+            /* FALLTHRU */
+          }
+          default:
+          {
+            output_buffer_p[0] = array[middle + 1];
+            return char_sequence;
+          }
+        }
+      }
+
+      if (character < current)
+      {
+        top = middle - (size_of_case_value + 1);
+      }
+      else
+      {
+        bottom = middle + (size_of_case_value + 1);
+      }
+    }
+  }
+
+  return 0;
+} /* search_in_conversion_table */
+#endif /* !CONFIG_DISABLE_UNICODE_CASE_CONVERSION */
+
+/**
+ * Returns the lowercase character sequence of an ecma character.
+ *
+ * Note: output_buffer_p must be able to hold at least LIT_MAXIMUM_OTHER_CASE_LENGTH characters.
+ *
+ * @return the length of the lowercase character sequence
+ *         which is always between 1 and LIT_MAXIMUM_OTHER_CASE_LENGTH.
+ */
+ecma_length_t
+lit_char_to_lower_case (ecma_char_t character, /**< input character value */
+                        ecma_char_t *output_buffer_p, /**< [out] buffer for the result characters */
+                        ecma_length_t buffer_size) /**< buffer size */
+{
+  JERRY_ASSERT (buffer_size >= LIT_MAXIMUM_OTHER_CASE_LENGTH);
+
+  if (character >= LIT_CHAR_UPPERCASE_A && character <= LIT_CHAR_UPPERCASE_Z)
+  {
+    output_buffer_p[0] = (ecma_char_t) (character + (LIT_CHAR_LOWERCASE_A - LIT_CHAR_UPPERCASE_A));
+    return 1;
+  }
+
+#ifndef CONFIG_DISABLE_UNICODE_CASE_CONVERSION
+
+  ecma_length_t lowercase_sequence = search_in_bidirectional_conversion_tables (character, output_buffer_p, true);
+
+  if (lowercase_sequence != 0)
+  {
+    return lowercase_sequence;
+  }
+
+  int num_of_lowercase_ranges = NUM_OF_ELEMENTS (lit_lower_case_ranges);
+
+  for (int i = 0, j = 0; i < num_of_lowercase_ranges; i += 2, j++)
+  {
+    int range_length = lit_lower_case_range_lengths[j] - 1;
+    ecma_char_t start_point = lit_lower_case_ranges[i];
+
+    if (start_point <= character && character <= start_point + range_length)
+    {
+      output_buffer_p[0] = (ecma_char_t) (lit_lower_case_ranges[i + 1] + (character - start_point));
+      return 1;
+    }
+  }
+
+  lowercase_sequence = search_in_conversion_table (character,
+                                                   output_buffer_p,
+                                                   lit_lower_case_conversions,
+                                                   lit_lower_case_conversion_counters);
+
+  if (lowercase_sequence != 0)
+  {
+    return lowercase_sequence;
+  }
+
+#endif /* !CONFIG_DISABLE_UNICODE_CASE_CONVERSION */
+
+  output_buffer_p[0] = character;
+  return 1;
+} /* lit_char_to_lower_case */
+
+/**
+ * Returns the uppercase character sequence of an ecma character.
+ *
+ * Note: output_buffer_p must be able to hold at least LIT_MAXIMUM_OTHER_CASE_LENGTH characters.
+ *
+ * @return the length of the uppercase character sequence
+ *         which is always between 1 and LIT_MAXIMUM_OTHER_CASE_LENGTH.
+ */
+ecma_length_t
+lit_char_to_upper_case (ecma_char_t character, /**< input character value */
+                        ecma_char_t *output_buffer_p, /**< buffer for the result characters */
+                        ecma_length_t buffer_size) /**< buffer size */
+{
+  JERRY_ASSERT (buffer_size >= LIT_MAXIMUM_OTHER_CASE_LENGTH);
+
+  if (character >= LIT_CHAR_LOWERCASE_A && character <= LIT_CHAR_LOWERCASE_Z)
+  {
+    output_buffer_p[0] = (ecma_char_t) (character - (LIT_CHAR_LOWERCASE_A - LIT_CHAR_UPPERCASE_A));
+    return 1;
+  }
+
+#ifndef CONFIG_DISABLE_UNICODE_CASE_CONVERSION
+
+  ecma_length_t uppercase_sequence = search_in_bidirectional_conversion_tables (character, output_buffer_p, false);
+
+  if (uppercase_sequence != 0)
+  {
+    return uppercase_sequence;
+  }
+
+  int num_of_upper_case_special_ranges = NUM_OF_ELEMENTS (lit_upper_case_special_ranges);
+
+  for (int i = 0, j = 0; i < num_of_upper_case_special_ranges; i += 3, j++)
+  {
+    int range_length = lit_upper_case_special_range_lengths[j];
+    ecma_char_t start_point = lit_upper_case_special_ranges[i];
+
+    if (start_point <= character && character <= start_point + range_length)
+    {
+      output_buffer_p[0] = (ecma_char_t) (lit_upper_case_special_ranges[i + 1] + (character - start_point));
+      output_buffer_p[1] = (ecma_char_t) (lit_upper_case_special_ranges[i + 2]);
+      return 2;
+    }
+  }
+
+  uppercase_sequence = search_in_conversion_table (character,
+                                                   output_buffer_p,
+                                                   lit_upper_case_conversions,
+                                                   lit_upper_case_conversion_counters);
+
+  if (uppercase_sequence != 0)
+  {
+    return uppercase_sequence;
+  }
+
+#endif /* !CONFIG_DISABLE_UNICODE_CASE_CONVERSION */
+
+  output_buffer_p[0] = character;
+  return 1;
+} /* lit_char_to_upper_case */
diff --git a/deps/jerry/jerry-core/lit/lit-char-helpers.h b/deps/jerry/jerry-core/lit/lit-char-helpers.h
new file mode 100644 (file)
index 0000000..ae018c9
--- /dev/null
@@ -0,0 +1,249 @@
+/* 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.
+ */
+
+#ifndef LIT_CHAR_HELPERS_H
+#define LIT_CHAR_HELPERS_H
+
+#include "lit-globals.h"
+
+#define LIT_CHAR_UNDEF ((ecma_char_t) 0xFFFF) /* undefined character */
+
+/*
+ * Format control characters (ECMA-262 v5, Table 1)
+ */
+#define LIT_CHAR_ZWNJ ((ecma_char_t) 0x200C) /* zero width non-joiner */
+#define LIT_CHAR_ZWJ  ((ecma_char_t) 0x200D) /* zero width joiner */
+#define LIT_CHAR_BOM  ((ecma_char_t) 0xFEFF) /* byte order mark */
+
+bool lit_char_is_format_control (ecma_char_t c);
+
+/*
+ * Whitespace characters (ECMA-262 v5, Table 2)
+ */
+#define LIT_CHAR_TAB  ((ecma_char_t) 0x0009) /* tab */
+#define LIT_CHAR_VTAB ((ecma_char_t) 0x000B) /* vertical tab */
+#define LIT_CHAR_FF   ((ecma_char_t) 0x000C) /* form feed */
+#define LIT_CHAR_SP   ((ecma_char_t) 0x0020) /* space */
+#define LIT_CHAR_NBSP ((ecma_char_t) 0x00A0) /* no-break space */
+/* LIT_CHAR_BOM is defined above */
+
+bool lit_char_is_white_space (ecma_char_t c);
+
+/*
+ * Line terminator characters (ECMA-262 v5, Table 3)
+ */
+#define LIT_CHAR_LF ((ecma_char_t) 0x000A) /* line feed */
+#define LIT_CHAR_CR ((ecma_char_t) 0x000D) /* carriage return */
+#define LIT_CHAR_LS ((ecma_char_t) 0x2028) /* line separator */
+#define LIT_CHAR_PS ((ecma_char_t) 0x2029) /* paragraph separator */
+
+bool lit_char_is_line_terminator (ecma_char_t c);
+
+/*
+ * String Single Character Escape Sequences (ECMA-262 v5, Table 4)
+ */
+#define LIT_CHAR_BS           ((ecma_char_t) 0x0008) /* backspace */
+/* LIT_CHAR_TAB is defined above */
+/* LIT_CHAR_LF is defined above */
+/* LIT_CHAR_VTAB is defined above */
+/* LIT_CHAR_FF is defined above */
+/* LIT_CHAR_CR is defined above */
+#define LIT_CHAR_DOUBLE_QUOTE ((ecma_char_t) '"') /* double quote */
+#define LIT_CHAR_SINGLE_QUOTE ((ecma_char_t) '\'') /* single quote */
+#define LIT_CHAR_BACKSLASH    ((ecma_char_t) '\\') /* reverse solidus (backslash) */
+
+/*
+ * Comment characters (ECMA-262 v5, 7.4)
+ */
+#define LIT_CHAR_SLASH    ((ecma_char_t) '/') /* solidus */
+#define LIT_CHAR_ASTERISK ((ecma_char_t) '*') /* asterisk */
+
+/*
+ * Identifier name characters (ECMA-262 v5, 7.6)
+ */
+#define LIT_CHAR_DOLLAR_SIGN ((ecma_char_t) '$')  /* dollar sign */
+#define LIT_CHAR_UNDERSCORE  ((ecma_char_t) '_')  /* low line (underscore) */
+/* LIT_CHAR_BACKSLASH defined above */
+
+bool lit_char_is_identifier_start (const uint8_t *src_p);
+bool lit_char_is_identifier_part (const uint8_t *src_p);
+bool lit_char_is_identifier_start_character (ecma_char_t chr);
+bool lit_char_is_identifier_part_character (ecma_char_t chr);
+
+/*
+ * Punctuator characters (ECMA-262 v5, 7.7)
+ */
+#define LIT_CHAR_LEFT_BRACE   ((ecma_char_t) '{') /* left curly bracket */
+#define LIT_CHAR_RIGHT_BRACE  ((ecma_char_t) '}') /* right curly bracket */
+#define LIT_CHAR_LEFT_PAREN   ((ecma_char_t) '(') /* left parenthesis */
+#define LIT_CHAR_RIGHT_PAREN  ((ecma_char_t) ')') /* right parenthesis */
+#define LIT_CHAR_LEFT_SQUARE  ((ecma_char_t) '[') /* left square bracket */
+#define LIT_CHAR_RIGHT_SQUARE ((ecma_char_t) ']') /* right square bracket */
+#define LIT_CHAR_DOT          ((ecma_char_t) '.') /* dot */
+#define LIT_CHAR_SEMICOLON    ((ecma_char_t) ';') /* semicolon */
+#define LIT_CHAR_COMMA        ((ecma_char_t) ',') /* comma */
+#define LIT_CHAR_LESS_THAN    ((ecma_char_t) '<') /* less-than sign */
+#define LIT_CHAR_GREATER_THAN ((ecma_char_t) '>') /* greater-than sign */
+#define LIT_CHAR_EQUALS       ((ecma_char_t) '=') /* equals sign */
+#define LIT_CHAR_PLUS         ((ecma_char_t) '+') /* plus sign */
+#define LIT_CHAR_MINUS        ((ecma_char_t) '-') /* hyphen-minus */
+/* LIT_CHAR_ASTERISK is defined above */
+#define LIT_CHAR_PERCENT      ((ecma_char_t) '%') /* percent sign */
+#define LIT_CHAR_AMPERSAND    ((ecma_char_t) '&') /* ampersand */
+#define LIT_CHAR_VLINE        ((ecma_char_t) '|') /* vertical line */
+#define LIT_CHAR_CIRCUMFLEX   ((ecma_char_t) '^') /* circumflex accent */
+#define LIT_CHAR_EXCLAMATION  ((ecma_char_t) '!') /* exclamation mark */
+#define LIT_CHAR_TILDE        ((ecma_char_t) '~') /* tilde */
+#define LIT_CHAR_QUESTION     ((ecma_char_t) '?') /* question mark */
+#define LIT_CHAR_COLON        ((ecma_char_t) ':') /* colon */
+
+/*
+ * Special characters for String.prototype.replace.
+ */
+#define LIT_CHAR_GRAVE_ACCENT ((ecma_char_t) '`') /* grave accent */
+
+/**
+ * Uppercase ASCII letters
+ */
+#define LIT_CHAR_UPPERCASE_A ((ecma_char_t) 'A')
+#define LIT_CHAR_UPPERCASE_B ((ecma_char_t) 'B')
+#define LIT_CHAR_UPPERCASE_C ((ecma_char_t) 'C')
+#define LIT_CHAR_UPPERCASE_D ((ecma_char_t) 'D')
+#define LIT_CHAR_UPPERCASE_E ((ecma_char_t) 'E')
+#define LIT_CHAR_UPPERCASE_F ((ecma_char_t) 'F')
+#define LIT_CHAR_UPPERCASE_G ((ecma_char_t) 'G')
+#define LIT_CHAR_UPPERCASE_H ((ecma_char_t) 'H')
+#define LIT_CHAR_UPPERCASE_I ((ecma_char_t) 'I')
+#define LIT_CHAR_UPPERCASE_J ((ecma_char_t) 'J')
+#define LIT_CHAR_UPPERCASE_K ((ecma_char_t) 'K')
+#define LIT_CHAR_UPPERCASE_L ((ecma_char_t) 'L')
+#define LIT_CHAR_UPPERCASE_M ((ecma_char_t) 'M')
+#define LIT_CHAR_UPPERCASE_N ((ecma_char_t) 'N')
+#define LIT_CHAR_UPPERCASE_O ((ecma_char_t) 'O')
+#define LIT_CHAR_UPPERCASE_P ((ecma_char_t) 'P')
+#define LIT_CHAR_UPPERCASE_Q ((ecma_char_t) 'Q')
+#define LIT_CHAR_UPPERCASE_R ((ecma_char_t) 'R')
+#define LIT_CHAR_UPPERCASE_S ((ecma_char_t) 'S')
+#define LIT_CHAR_UPPERCASE_T ((ecma_char_t) 'T')
+#define LIT_CHAR_UPPERCASE_U ((ecma_char_t) 'U')
+#define LIT_CHAR_UPPERCASE_V ((ecma_char_t) 'V')
+#define LIT_CHAR_UPPERCASE_W ((ecma_char_t) 'W')
+#define LIT_CHAR_UPPERCASE_X ((ecma_char_t) 'X')
+#define LIT_CHAR_UPPERCASE_Y ((ecma_char_t) 'Y')
+#define LIT_CHAR_UPPERCASE_Z ((ecma_char_t) 'Z')
+
+/**
+ * Lowercase ASCII letters
+ */
+#define LIT_CHAR_LOWERCASE_A ((ecma_char_t) 'a')
+#define LIT_CHAR_LOWERCASE_B ((ecma_char_t) 'b')
+#define LIT_CHAR_LOWERCASE_C ((ecma_char_t) 'c')
+#define LIT_CHAR_LOWERCASE_D ((ecma_char_t) 'd')
+#define LIT_CHAR_LOWERCASE_E ((ecma_char_t) 'e')
+#define LIT_CHAR_LOWERCASE_F ((ecma_char_t) 'f')
+#define LIT_CHAR_LOWERCASE_G ((ecma_char_t) 'g')
+#define LIT_CHAR_LOWERCASE_H ((ecma_char_t) 'h')
+#define LIT_CHAR_LOWERCASE_I ((ecma_char_t) 'i')
+#define LIT_CHAR_LOWERCASE_J ((ecma_char_t) 'j')
+#define LIT_CHAR_LOWERCASE_K ((ecma_char_t) 'k')
+#define LIT_CHAR_LOWERCASE_L ((ecma_char_t) 'l')
+#define LIT_CHAR_LOWERCASE_M ((ecma_char_t) 'm')
+#define LIT_CHAR_LOWERCASE_N ((ecma_char_t) 'n')
+#define LIT_CHAR_LOWERCASE_O ((ecma_char_t) 'o')
+#define LIT_CHAR_LOWERCASE_P ((ecma_char_t) 'p')
+#define LIT_CHAR_LOWERCASE_Q ((ecma_char_t) 'q')
+#define LIT_CHAR_LOWERCASE_R ((ecma_char_t) 'r')
+#define LIT_CHAR_LOWERCASE_S ((ecma_char_t) 's')
+#define LIT_CHAR_LOWERCASE_T ((ecma_char_t) 't')
+#define LIT_CHAR_LOWERCASE_U ((ecma_char_t) 'u')
+#define LIT_CHAR_LOWERCASE_V ((ecma_char_t) 'v')
+#define LIT_CHAR_LOWERCASE_W ((ecma_char_t) 'w')
+#define LIT_CHAR_LOWERCASE_X ((ecma_char_t) 'x')
+#define LIT_CHAR_LOWERCASE_Y ((ecma_char_t) 'y')
+#define LIT_CHAR_LOWERCASE_Z ((ecma_char_t) 'z')
+
+/**
+ * ASCII decimal digits
+ */
+#define LIT_CHAR_0    ((ecma_char_t) '0')
+#define LIT_CHAR_1    ((ecma_char_t) '1')
+#define LIT_CHAR_2    ((ecma_char_t) '2')
+#define LIT_CHAR_3    ((ecma_char_t) '3')
+#define LIT_CHAR_4    ((ecma_char_t) '4')
+#define LIT_CHAR_5    ((ecma_char_t) '5')
+#define LIT_CHAR_6    ((ecma_char_t) '6')
+#define LIT_CHAR_7    ((ecma_char_t) '7')
+#define LIT_CHAR_8    ((ecma_char_t) '8')
+#define LIT_CHAR_9    ((ecma_char_t) '9')
+
+/**
+ * ASCII character ranges
+ */
+#define LIT_CHAR_ASCII_UPPERCASE_LETTERS_BEGIN      LIT_CHAR_UPPERCASE_A /* uppercase letters range */
+#define LIT_CHAR_ASCII_UPPERCASE_LETTERS_END        LIT_CHAR_UPPERCASE_Z
+
+#define LIT_CHAR_ASCII_LOWERCASE_LETTERS_BEGIN      LIT_CHAR_LOWERCASE_A /* lowercase letters range */
+#define LIT_CHAR_ASCII_LOWERCASE_LETTERS_END        LIT_CHAR_LOWERCASE_Z
+
+#define LIT_CHAR_ASCII_UPPERCASE_LETTERS_HEX_BEGIN  LIT_CHAR_UPPERCASE_A /* uppercase letters for
+                                                                          * hexadecimal digits range */
+#define LIT_CHAR_ASCII_UPPERCASE_LETTERS_HEX_END    LIT_CHAR_UPPERCASE_F
+
+#define LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_BEGIN  LIT_CHAR_LOWERCASE_A /* lowercase letters for
+                                                                          * hexadecimal digits range */
+#define LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_END    LIT_CHAR_LOWERCASE_F
+
+#define LIT_CHAR_ASCII_OCTAL_DIGITS_BEGIN           LIT_CHAR_0           /* octal digits range */
+#define LIT_CHAR_ASCII_OCTAL_DIGITS_END             LIT_CHAR_7
+
+#define LIT_CHAR_ASCII_DIGITS_BEGIN                 LIT_CHAR_0           /* decimal digits range */
+#define LIT_CHAR_ASCII_DIGITS_END                   LIT_CHAR_9
+
+#define LEXER_TO_ASCII_LOWERCASE(character) ((character) | LIT_CHAR_SP)
+
+bool lit_char_is_octal_digit (ecma_char_t c);
+bool lit_char_is_decimal_digit (ecma_char_t c);
+bool lit_char_is_hex_digit (ecma_char_t c);
+uint32_t lit_char_hex_to_int (ecma_char_t c);
+size_t lit_char_to_utf8_bytes (uint8_t *dst_p, ecma_char_t chr);
+size_t lit_char_get_utf8_length (ecma_char_t chr);
+
+/* read a hex encoded code point from a zero terminated buffer */
+bool lit_read_code_unit_from_hex (const lit_utf8_byte_t *buf_p, lit_utf8_size_t number_of_characters,
+                                  ecma_char_ptr_t out_code_unit_p);
+
+/**
+ * Null character
+ */
+#define LIT_CHAR_NULL  ((ecma_char_t) '\0')
+
+/*
+ * Part of IsWordChar abstract operation (ECMA-262 v5, 15.10.2.6, step 3)
+ */
+bool lit_char_is_word_char (ecma_char_t c);
+
+/*
+ * Utility functions for uppercasing / lowercasing
+ */
+
+/**
+ * Minimum buffer size for lit_char_to_lower_case / lit_char_to_upper_case functions.
+ */
+#define LIT_MAXIMUM_OTHER_CASE_LENGTH (3)
+
+ecma_length_t lit_char_to_lower_case (ecma_char_t character, ecma_char_t *output_buffer_p, ecma_length_t buffer_size);
+ecma_length_t lit_char_to_upper_case (ecma_char_t character, ecma_char_t *output_buffer_p, ecma_length_t buffer_size);
+
+#endif /* !LIT_CHAR_HELPERS_H */
diff --git a/deps/jerry/jerry-core/lit/lit-globals.h b/deps/jerry/jerry-core/lit/lit-globals.h
new file mode 100644 (file)
index 0000000..df4716d
--- /dev/null
@@ -0,0 +1,141 @@
+/* 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.
+ */
+
+#ifndef LIT_GLOBALS_H
+#define LIT_GLOBALS_H
+
+#include "jrt.h"
+
+/**
+ * ECMAScript standard defines terms "code unit" and "character" as 16-bit unsigned value
+ * used to represent 16-bit unit of text, this is the same as code unit in UTF-16 (See ECMA-262 5.1 Chapter 6).
+ *
+ * The term "code point" or "Unicode character" is used to refer a single Unicode scalar value (may be longer
+ * than 16 bits: 0x0 - 0x10FFFFF). One code point could be represented with one ore two 16-bit code units.
+ *
+ * According to the standard all strings and source text are assumed to be a sequence of code units.
+ * Length of a string equals to number of code units in the string, which is not the same as number of Unicode
+ * characters in a string.
+ *
+ * Internally JerryScript engine uses UTF-8 representation of strings to reduce memory overhead. Unicode character
+ * occupies from one to four bytes in UTF-8 representation.
+ *
+ * Unicode scalar value   | Bytes in UTF-8             | Bytes in UTF-16
+ *                        | (internal representation)  |
+ * ----------------------------------------------------------------------
+ *  0x0     - 0x7F        |  1 byte                    |  2 bytes
+ *  0x80    - 0x7FF       |  2 bytes                   |  2 bytes
+ *  0x800   - 0xFFFF      |  3 bytes                   |  2 bytes
+ *  0x10000 - 0x10FFFF    |  4 bytes                   |  4 bytes
+ *
+ * Scalar values from 0xD800 to 0xDFFF are permanently reserved by Unicode standard to encode high and low
+ * surrogates in UTF-16 (Code points 0x10000 - 0x10FFFF are encoded via pair of surrogates in UTF-16).
+ * Despite that the official Unicode standard says that no UTF forms can encode these code points, we allow
+ * them to be encoded inside strings. The reason for that is compatibility with ECMA standard.
+ *
+ * For example, assume a string which consists one Unicode character: 0x1D700 (Mathematical Italic Small Epsilon).
+ * It has the following representation in UTF-16: 0xD835 0xDF00.
+ *
+ * ECMA standard allows extracting a substring from this string:
+ * > var str = String.fromCharCode (0xD835, 0xDF00); // Create a string containing one character: 0x1D700
+ * > str.length; // 2
+ * > var str1 = str.substring (0, 1);
+ * > str1.length; // 1
+ * > str1.charCodeAt (0); // 55349 (this equals to 0xD835)
+ *
+ * Internally original string would be represented in UTF-8 as the following byte sequence: 0xF0 0x9D 0x9C 0x80.
+ * After substring extraction high surrogate 0xD835 should be encoded via UTF-8: 0xED 0xA0 0xB5.
+ *
+ * Pair of low and high surrogates encoded separately should never occur in internal string representation,
+ * it should be encoded as any code point and occupy 4 bytes. So, when constructing a string from two surrogates,
+ * it should be processed gracefully;
+ * > var str1 = String.fromCharCode (0xD835); // 0xED 0xA0 0xB5 - internal representation
+ * > var str2 = String.fromCharCode (0xDF00); // 0xED 0xBC 0x80 - internal representation
+ * > var str = str1 + str2; // 0xF0 0x9D 0x9C 0x80 - internal representation,
+ *                          // !!! not 0xED 0xA0 0xB5 0xED 0xBC 0x80
+ */
+
+/**
+ * Description of an ecma-character, which represents 16-bit code unit,
+ * which is equal to UTF-16 character (see Chapter 6 from ECMA-262 5.1)
+ */
+typedef uint16_t ecma_char_t;
+
+/**
+ * Description of a collection's/string's length
+ */
+typedef uint32_t ecma_length_t;
+
+/**
+ * Description of an ecma-character pointer
+ */
+typedef ecma_char_t *ecma_char_ptr_t;
+
+/**
+ * Max bytes needed to represent a code unit (utf-16 char) via utf-8 encoding
+ */
+#define LIT_UTF8_MAX_BYTES_IN_CODE_UNIT (3)
+
+/**
+ * Max bytes needed to represent a code point (Unicode character) via utf-8 encoding
+ */
+#define LIT_UTF8_MAX_BYTES_IN_CODE_POINT (4)
+
+/**
+ * Max bytes needed to represent a code unit (utf-16 char) via cesu-8 encoding
+ */
+#define LIT_CESU8_MAX_BYTES_IN_CODE_UNIT (3)
+
+/**
+ * Max bytes needed to represent a code point (Unicode character) via cesu-8 encoding
+ */
+#define LIT_CESU8_MAX_BYTES_IN_CODE_POINT (6)
+
+/**
+ * A byte of utf-8 string
+ */
+typedef uint8_t lit_utf8_byte_t;
+
+/**
+ * Size of a utf-8 string in bytes
+ */
+typedef uint32_t lit_utf8_size_t;
+
+/**
+ * Size of a magic string in bytes
+ */
+typedef uint8_t lit_magic_size_t;
+
+/**
+ * Unicode code point
+ */
+typedef uint32_t lit_code_point_t;
+
+/**
+ * ECMA string hash
+ */
+typedef uint16_t lit_string_hash_t;
+
+/**
+ * Maximum value of ECMA string hash + 1
+ *
+ * Note:
+ *   On ARM, this constant can be encoded as an immediate value
+ *   while 0xffffu cannot be. Hence using this constant reduces
+ *   binary size and improves performance.
+ */
+#define LIT_STRING_HASH_LIMIT 0x10000u
+
+#endif /* !LIT_GLOBALS_H */
diff --git a/deps/jerry/jerry-core/lit/lit-magic-strings.c b/deps/jerry/jerry-core/lit/lit-magic-strings.c
new file mode 100644 (file)
index 0000000..ce220de
--- /dev/null
@@ -0,0 +1,426 @@
+/* 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.
+ */
+
+#include "jcontext.h"
+#include "lit-magic-strings.h"
+#include "lit-strings.h"
+
+/**
+ * Get number of external magic strings
+ *
+ * @return number of the strings, if there were registered,
+ *         zero - otherwise.
+ */
+inline uint32_t __attr_always_inline___
+lit_get_magic_string_ex_count (void)
+{
+  return JERRY_CONTEXT (lit_magic_string_ex_count);
+} /* lit_get_magic_string_ex_count */
+
+/**
+ * Get specified magic string as zero-terminated string
+ *
+ * @return pointer to zero-terminated magic string
+ */
+const lit_utf8_byte_t *
+lit_get_magic_string_utf8 (lit_magic_string_id_t id) /**< magic string id */
+{
+  static const lit_utf8_byte_t * const lit_magic_strings[] JERRY_CONST_DATA =
+  {
+#define LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE(size, id)
+#define LIT_MAGIC_STRING_DEF(id, utf8_string) \
+    (const lit_utf8_byte_t *) utf8_string,
+#include "lit-magic-strings.inc.h"
+#undef LIT_MAGIC_STRING_DEF
+#undef LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE
+  };
+
+  JERRY_ASSERT (id < LIT_NON_INTERNAL_MAGIC_STRING__COUNT);
+
+  return lit_magic_strings[id];
+} /* lit_get_magic_string_utf8 */
+
+/**
+ * Get size of specified magic string
+ *
+ * @return size in bytes
+ */
+lit_utf8_size_t
+lit_get_magic_string_size (lit_magic_string_id_t id) /**< magic string id */
+{
+  static const lit_magic_size_t lit_magic_string_sizes[] JERRY_CONST_DATA =
+  {
+#define LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE(size, id)
+#define LIT_MAGIC_STRING_DEF(id, utf8_string) \
+    sizeof(utf8_string) - 1,
+#include "lit-magic-strings.inc.h"
+#undef LIT_MAGIC_STRING_DEF
+#undef LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE
+  };
+
+  JERRY_ASSERT (id < LIT_NON_INTERNAL_MAGIC_STRING__COUNT);
+
+  return lit_magic_string_sizes[id];
+} /* lit_get_magic_string_size */
+
+/**
+ * Get the block start element with the given size from
+ * the list of ECMA and implementation-defined magic string constants
+ *
+ * @return magic string id
+ */
+lit_magic_string_id_t
+lit_get_magic_string_size_block_start (lit_utf8_size_t size) /**< magic string size */
+{
+  static const lit_magic_string_id_t lit_magic_string_size_block_starts[] JERRY_CONST_DATA =
+  {
+#define LIT_MAGIC_STRING_DEF(id, utf8_string)
+#define LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE(size, id) \
+    id,
+#include "lit-magic-strings.inc.h"
+    LIT_NON_INTERNAL_MAGIC_STRING__COUNT
+#undef LIT_MAGIC_STRING_DEF
+#undef LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE
+  };
+
+  JERRY_ASSERT (size <= (sizeof (lit_magic_string_size_block_starts) / sizeof (lit_magic_string_id_t)));
+
+  return lit_magic_string_size_block_starts[size];
+} /* lit_get_magic_string_size_block_start */
+
+/**
+ * Get specified magic string as zero-terminated string from external table
+ *
+ * @return pointer to zero-terminated magic string
+ */
+const lit_utf8_byte_t *
+lit_get_magic_string_ex_utf8 (lit_magic_string_ex_id_t id) /**< extern magic string id */
+{
+  if (JERRY_CONTEXT (lit_magic_string_ex_array) && id < JERRY_CONTEXT (lit_magic_string_ex_count))
+  {
+    return JERRY_CONTEXT (lit_magic_string_ex_array)[id];
+  }
+
+  JERRY_UNREACHABLE ();
+} /* lit_get_magic_string_ex_utf8 */
+
+/**
+ * Get size of specified external magic string
+ *
+ * @return size in bytes
+ */
+lit_utf8_size_t
+lit_get_magic_string_ex_size (lit_magic_string_ex_id_t id) /**< external magic string id */
+{
+  return JERRY_CONTEXT (lit_magic_string_ex_sizes)[id];
+} /* lit_get_magic_string_ex_size */
+
+/**
+ * Register external magic strings
+ */
+void
+lit_magic_strings_ex_set (const lit_utf8_byte_t **ex_str_items, /**< character arrays, representing
+                                                                 *   external magic strings' contents */
+                          uint32_t count,                       /**< number of the strings */
+                          const lit_utf8_size_t *ex_str_sizes)  /**< sizes of the strings */
+{
+  JERRY_ASSERT (ex_str_items != NULL);
+  JERRY_ASSERT (count > 0);
+  JERRY_ASSERT (ex_str_sizes != NULL);
+
+  JERRY_ASSERT (JERRY_CONTEXT (lit_magic_string_ex_array) == NULL);
+  JERRY_ASSERT (JERRY_CONTEXT (lit_magic_string_ex_count) == 0);
+  JERRY_ASSERT (JERRY_CONTEXT (lit_magic_string_ex_sizes) == NULL);
+
+  /* Set external magic strings information */
+  JERRY_CONTEXT (lit_magic_string_ex_array) = ex_str_items;
+  JERRY_CONTEXT (lit_magic_string_ex_count) = count;
+  JERRY_CONTEXT (lit_magic_string_ex_sizes) = ex_str_sizes;
+
+#ifndef JERRY_NDEBUG
+  for (lit_magic_string_ex_id_t id = (lit_magic_string_ex_id_t) 0;
+       id < JERRY_CONTEXT (lit_magic_string_ex_count);
+       id = (lit_magic_string_ex_id_t) (id + 1))
+  {
+    lit_utf8_size_t string_size = lit_zt_utf8_string_size (lit_get_magic_string_ex_utf8 (id));
+    JERRY_ASSERT (JERRY_CONTEXT (lit_magic_string_ex_sizes)[id] == string_size);
+    JERRY_ASSERT (JERRY_CONTEXT (lit_magic_string_ex_sizes)[id] <= LIT_MAGIC_STRING_LENGTH_LIMIT);
+
+    /**
+     * Check whether the strings are sorted by size and lexicographically,
+     * e.g., "Bb" < "aa" < "aaa" < "xyz0".
+     */
+    if (id > 0)
+    {
+      const lit_magic_string_ex_id_t prev_id = id - 1;
+      const lit_utf8_size_t prev_string_size = lit_get_magic_string_ex_size (prev_id);
+      JERRY_ASSERT (prev_string_size <= string_size);
+
+      if (prev_string_size == string_size)
+      {
+        const lit_utf8_byte_t *prev_ex_string_p = lit_get_magic_string_ex_utf8 (prev_id);
+        const lit_utf8_byte_t *curr_ex_string_p = lit_get_magic_string_ex_utf8 (id);
+        JERRY_ASSERT (memcmp (prev_ex_string_p, curr_ex_string_p, string_size) < 0);
+      }
+    }
+  }
+#endif /* !JERRY_NDEBUG */
+} /* lit_magic_strings_ex_set */
+
+/**
+ * Returns the magic string id of the argument string if it is available.
+ *
+ * @return id - if magic string id is found,
+ *         LIT_MAGIC_STRING__COUNT - otherwise.
+ */
+lit_magic_string_id_t
+lit_is_utf8_string_magic (const lit_utf8_byte_t *string_p, /**< utf-8 string */
+                          lit_utf8_size_t string_size) /**< string size in bytes */
+{
+  if (string_size > lit_get_magic_string_size (LIT_NON_INTERNAL_MAGIC_STRING__COUNT - 1))
+  {
+    return LIT_MAGIC_STRING__COUNT;
+  }
+
+  /**< The string must be in this id range. */
+  lit_utf8_size_t first = lit_get_magic_string_size_block_start (string_size);
+  lit_utf8_size_t last = lit_get_magic_string_size_block_start (string_size + 1);
+
+  while (first < last)
+  {
+    lit_utf8_size_t middle = ((first + last) / 2); /**< mid point of search */
+    int compare = memcmp (lit_get_magic_string_utf8 (middle), string_p, string_size);
+
+    if (compare == 0)
+    {
+      return (lit_magic_string_id_t) middle;
+    }
+    else if (compare > 0)
+    {
+      last = middle;
+    }
+    else
+    {
+      first = middle + 1;
+    }
+  }
+
+  return LIT_MAGIC_STRING__COUNT;
+} /* lit_is_utf8_string_magic */
+
+/**
+ * Returns the magic string id of the argument string pair if it is available.
+ *
+ * @return id - if magic string id is found,
+ *         LIT_MAGIC_STRING__COUNT - otherwise.
+ */
+lit_magic_string_id_t
+lit_is_utf8_string_pair_magic (const lit_utf8_byte_t *string1_p, /**< first utf-8 string */
+                               lit_utf8_size_t string1_size, /**< first string size in bytes */
+                               const lit_utf8_byte_t *string2_p, /**< second utf-8 string */
+                               lit_utf8_size_t string2_size) /**< second string size in bytes */
+{
+  lit_utf8_size_t total_string_size = string1_size + string2_size;
+
+  if (total_string_size > lit_get_magic_string_size (LIT_NON_INTERNAL_MAGIC_STRING__COUNT - 1))
+  {
+    return LIT_MAGIC_STRING__COUNT;
+  }
+
+  /**< The string must be in this id range. */
+  lit_utf8_size_t first = lit_get_magic_string_size_block_start (total_string_size);
+  lit_utf8_size_t last = lit_get_magic_string_size_block_start (total_string_size + 1);
+
+  while (first < last)
+  {
+    lit_utf8_size_t middle = ((first + last) / 2); /**< mid point of search */
+    const lit_utf8_byte_t *middle_string_p = lit_get_magic_string_utf8 (middle);
+
+    int compare = memcmp (middle_string_p, string1_p, string1_size);
+
+    if (compare == 0)
+    {
+      compare = memcmp (middle_string_p + string1_size, string2_p, string2_size);
+    }
+
+    if (compare == 0)
+    {
+      return (lit_magic_string_id_t) middle;
+    }
+    else if (compare > 0)
+    {
+      last = middle;
+    }
+    else
+    {
+      first = middle + 1;
+    }
+  }
+
+  return LIT_MAGIC_STRING__COUNT;
+} /* lit_is_utf8_string_pair_magic */
+
+/**
+ * Returns the ex magic string id of the argument string if it is available.
+ *
+ * @return id - if magic string id is found,
+ *         lit_get_magic_string_ex_count () - otherwise.
+ */
+lit_magic_string_ex_id_t
+lit_is_ex_utf8_string_magic (const lit_utf8_byte_t *string_p, /**< utf-8 string */
+                             lit_utf8_size_t string_size) /**< string size in bytes */
+{
+  const uint32_t magic_string_ex_count = lit_get_magic_string_ex_count ();
+
+  if (magic_string_ex_count == 0
+      || string_size > lit_get_magic_string_ex_size (magic_string_ex_count - 1))
+  {
+    return (lit_magic_string_ex_id_t) magic_string_ex_count;
+  }
+
+  lit_magic_string_ex_id_t first = 0;
+  lit_magic_string_ex_id_t last = (lit_magic_string_ex_id_t) magic_string_ex_count;
+
+  while (first < last)
+  {
+    const lit_magic_string_ex_id_t middle = (first + last) / 2;
+    const lit_utf8_byte_t *ext_string_p = lit_get_magic_string_ex_utf8 (middle);
+    const lit_utf8_size_t ext_string_size = lit_get_magic_string_ex_size (middle);
+
+    if (string_size == ext_string_size)
+    {
+      const int string_compare = memcmp (ext_string_p, string_p, string_size);
+
+      if (string_compare == 0)
+      {
+        return middle;
+      }
+      else if (string_compare < 0)
+      {
+        first = middle + 1;
+      }
+      else
+      {
+        last = middle;
+      }
+    }
+    else if (string_size > ext_string_size)
+    {
+      first = middle + 1;
+    }
+    else
+    {
+      last = middle;
+    }
+  }
+
+  return (lit_magic_string_ex_id_t) magic_string_ex_count;
+} /* lit_is_ex_utf8_string_magic */
+
+/**
+ * Returns the ex magic string id of the argument string pair if it is available.
+ *
+ * @return id - if magic string id is found,
+ *         lit_get_magic_string_ex_count () - otherwise.
+ */
+lit_magic_string_ex_id_t
+lit_is_ex_utf8_string_pair_magic (const lit_utf8_byte_t *string1_p, /**< first utf-8 string */
+                                  lit_utf8_size_t string1_size, /**< first string size in bytes */
+                                  const lit_utf8_byte_t *string2_p, /**< second utf-8 string */
+                                  lit_utf8_size_t string2_size) /**< second string size in bytes */
+{
+  const uint32_t magic_string_ex_count = lit_get_magic_string_ex_count ();
+  const lit_utf8_size_t total_string_size = string1_size + string2_size;
+
+  if (magic_string_ex_count == 0
+      || total_string_size > lit_get_magic_string_ex_size (magic_string_ex_count - 1))
+  {
+    return (lit_magic_string_ex_id_t) magic_string_ex_count;
+  }
+
+  lit_magic_string_ex_id_t first = 0;
+  lit_magic_string_ex_id_t last = (lit_magic_string_ex_id_t) magic_string_ex_count;
+
+  while (first < last)
+  {
+    const lit_magic_string_ex_id_t middle = (first + last) / 2;
+    const lit_utf8_byte_t *ext_string_p = lit_get_magic_string_ex_utf8 (middle);
+    const lit_utf8_size_t ext_string_size = lit_get_magic_string_ex_size (middle);
+
+    if (total_string_size == ext_string_size)
+    {
+      int string_compare = memcmp (ext_string_p, string1_p, string1_size);
+
+      if (string_compare == 0)
+      {
+        string_compare = memcmp (ext_string_p + string1_size, string2_p, string2_size);
+      }
+
+      if (string_compare == 0)
+      {
+        return middle;
+      }
+      else if (string_compare < 0)
+      {
+        first = middle + 1;
+      }
+      else
+      {
+        last = middle;
+      }
+    }
+    else if (total_string_size > ext_string_size)
+    {
+      first = middle + 1;
+    }
+    else
+    {
+      last = middle;
+    }
+  }
+
+  return (lit_magic_string_ex_id_t) magic_string_ex_count;
+} /* lit_is_ex_utf8_string_pair_magic */
+
+/**
+ * Copy magic string to buffer
+ *
+ * Warning:
+ *         the routine requires that buffer size is enough
+ *
+ * @return pointer to the byte next to the last copied in the buffer
+ */
+lit_utf8_byte_t *
+lit_copy_magic_string_to_buffer (lit_magic_string_id_t id, /**< magic string id */
+                                 lit_utf8_byte_t *buffer_p, /**< destination buffer */
+                                 lit_utf8_size_t buffer_size) /**< size of buffer */
+{
+  const lit_utf8_byte_t *magic_string_bytes_p = lit_get_magic_string_utf8 (id);
+  lit_utf8_size_t magic_string_bytes_count = lit_get_magic_string_size (id);
+
+  const lit_utf8_byte_t *str_iter_p = magic_string_bytes_p;
+  lit_utf8_byte_t *buf_iter_p = buffer_p;
+  lit_utf8_size_t bytes_copied = 0;
+
+  while (magic_string_bytes_count--)
+  {
+    bytes_copied ++;
+    JERRY_ASSERT (bytes_copied <= buffer_size);
+
+    *buf_iter_p++ = *str_iter_p++;
+  }
+
+  return buf_iter_p;
+} /* lit_copy_magic_string_to_buffer */
diff --git a/deps/jerry/jerry-core/lit/lit-magic-strings.h b/deps/jerry/jerry-core/lit/lit-magic-strings.h
new file mode 100644 (file)
index 0000000..940330e
--- /dev/null
@@ -0,0 +1,81 @@
+/* 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.
+ */
+
+#ifndef LIT_MAGIC_STRINGS_H
+#define LIT_MAGIC_STRINGS_H
+
+#include "lit-globals.h"
+
+/**
+ * Limit for magic string length
+ */
+#define LIT_MAGIC_STRING_LENGTH_LIMIT 32
+
+/**
+ * Identifiers of ECMA and implementation-defined magic string constants
+ */
+typedef enum
+{
+#define LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE(size, id)
+#define LIT_MAGIC_STRING_DEF(id, ascii_zt_string) \
+     id,
+#include "lit-magic-strings.inc.h"
+#undef LIT_MAGIC_STRING_DEF
+#undef LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE
+  LIT_NON_INTERNAL_MAGIC_STRING__COUNT, /**< number of non-internal magic strings */
+  LIT_INTERNAL_MAGIC_STRING_PROMISE = LIT_NON_INTERNAL_MAGIC_STRING__COUNT, /**<  [[Promise]] of promise
+                                                                             *    reject or resolve functions */
+  LIT_INTERNAL_MAGIC_STRING_ALREADY_RESOLVED, /**< [[AlreadyResolved]] of promise reject or resolve functions */
+  LIT_INTERNAL_MAGIC_STRING_RESOLVE_FUNCTION, /**< the resolve funtion of the promise object */
+  LIT_INTERNAL_MAGIC_STRING_REJECT_FUNCTION, /**< the reject function of the promise object */
+  LIT_NEED_MARK_MAGIC_STRING__COUNT,  /**< number of internal magic strings which will be used as properties' names,
+                                       *   and the properties need to be marked during gc. */
+  LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE = LIT_NEED_MARK_MAGIC_STRING__COUNT, /**< native handle package
+                                                                                *   associated with an object */
+  LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER, /**< native pointer package associated with an object */
+  LIT_MAGIC_STRING__COUNT /**< number of magic strings */
+} lit_magic_string_id_t;
+
+/**
+ * Identifiers of implementation-defined external magic string constants
+ */
+typedef uint32_t lit_magic_string_ex_id_t;
+
+uint32_t lit_get_magic_string_ex_count (void);
+
+const lit_utf8_byte_t *lit_get_magic_string_utf8 (lit_magic_string_id_t id);
+lit_utf8_size_t lit_get_magic_string_size (lit_magic_string_id_t id);
+lit_magic_string_id_t lit_get_magic_string_size_block_start (lit_utf8_size_t size);
+
+const lit_utf8_byte_t *lit_get_magic_string_ex_utf8 (lit_magic_string_ex_id_t id);
+lit_utf8_size_t lit_get_magic_string_ex_size (lit_magic_string_ex_id_t id);
+
+void lit_magic_strings_ex_set (const lit_utf8_byte_t **ex_str_items, uint32_t count,
+                               const lit_utf8_size_t *ex_str_sizes);
+
+lit_magic_string_id_t lit_is_utf8_string_magic (const lit_utf8_byte_t *string_p, lit_utf8_size_t string_size);
+lit_magic_string_id_t lit_is_utf8_string_pair_magic (const lit_utf8_byte_t *string1_p, lit_utf8_size_t string1_size,
+                                                     const lit_utf8_byte_t *string2_p, lit_utf8_size_t string2_size);
+
+lit_magic_string_ex_id_t lit_is_ex_utf8_string_magic (const lit_utf8_byte_t *string_p, lit_utf8_size_t string_size);
+lit_magic_string_ex_id_t lit_is_ex_utf8_string_pair_magic (const lit_utf8_byte_t *string1_p,
+                                                           lit_utf8_size_t string1_size,
+                                                           const lit_utf8_byte_t *string2_p,
+                                                           lit_utf8_size_t string2_size);
+
+lit_utf8_byte_t *lit_copy_magic_string_to_buffer (lit_magic_string_id_t id, lit_utf8_byte_t *buffer_p,
+                                                  lit_utf8_size_t buffer_size);
+
+#endif /* !LIT_MAGIC_STRINGS_H */
diff --git a/deps/jerry/jerry-core/lit/lit-magic-strings.inc.h b/deps/jerry/jerry-core/lit/lit-magic-strings.inc.h
new file mode 100644 (file)
index 0000000..9564e78
--- /dev/null
@@ -0,0 +1,648 @@
+/* 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.
+ */
+
+/* This file is automatically generated by the gen-magic-strings.py script
+ * from lit-magic-strings.ini. Do not edit! */
+
+
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING__EMPTY, "")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NEW_LINE_CHAR, "\n")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPACE_CHAR, " ")
+#if !defined (CONFIG_DISABLE_JSON_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DOUBLE_QUOTE_CHAR, "\"")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LEFT_PARENTHESIS_CHAR, "(")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RIGHT_PARENTHESIS_CHAR, ")")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COMMA_CHAR, ",")
+#if !defined (CONFIG_DISABLE_NUMBER_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MINUS_CHAR, "-")
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SLASH_CHAR, "/")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COLON_CHAR, ":")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_E_U, "E")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LEFT_SQUARE_CHAR, "[")
+#if !defined (CONFIG_DISABLE_JSON_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BACKSLASH_CHAR, "\\")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RIGHT_SQUARE_CHAR, "]")
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_G_CHAR, "g")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_I_CHAR, "i")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_M_CHAR, "m")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LEFT_BRACE_CHAR, "{")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RIGHT_BRACE_CHAR, "}")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PI_U, "PI")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OF, "of")
+#endif
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LN2_U, "LN2")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NAN, "NaN")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UTC_U, "UTC")
+#endif
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ABS, "abs")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_PROMISE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ALL, "all")
+#endif
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COS, "cos")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EXP, "exp")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET, "get")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOG, "log")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MAP, "map")
+#endif
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MAX, "max")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MIN, "min")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NOW, "now")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_POP, "pop")
+#endif
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_POW, "pow")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET, "set")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SIN, "sin")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TAN, "tan")
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP, "(?:)")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DATE_UL, "Date")
+#if !defined (CONFIG_DISABLE_JSON_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_JSON_U, "JSON")
+#endif
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LN10_U, "LN10")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MATH_UL, "Math")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NULL_UL, "Null")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ACOS, "acos")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASIN, "asin")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATAN, "atan")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BIND, "bind")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CALL, "call")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CEIL, "ceil")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EVAL, "eval")
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EXEC, "exec")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FROM, "from")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_JOIN, "join")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_KEYS, "keys")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NAME, "name")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NULL, "null")
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PUSH, "push")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_PROMISE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RACE, "race")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SEAL, "seal")
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SOME, "some")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SORT, "sort")
+#endif
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SQRT, "sqrt")
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TEST, "test")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_PROMISE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_THEN, "then")
+#endif
+#if !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TRIM, "trim")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TRUE, "true")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARRAY_UL, "Array")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ERROR_UL, "Error")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOG2E_U, "LOG2E")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SQRT2_U, "SQRT2")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_APPLY, "apply")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATAN2, "atan2")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_PROMISE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CATCH, "catch")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EVERY, "every")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FALSE, "false")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLOOR, "floor")
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN) \
+|| !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INDEX, "index")
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INPUT, "input")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_NAN, "isNaN")
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN) && !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MATCH, "match")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN) \
+|| !defined (CONFIG_DISABLE_JSON_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PARSE, "parse")
+#endif
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ROUND, "round")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SHIFT, "shift")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SLICE, "slice")
+#endif
+#if !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPLIT, "split")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_VALUE, "value")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOG10E_U, "LOG10E")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NUMBER_UL, "Number")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OBJECT_UL, "Object")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REGEXP_UL, "RegExp")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STRING_UL, "String")
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BUFFER, "buffer")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CALLEE, "callee")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CALLER, "caller")
+#if !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CHAR_AT_UL, "charAt")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CONCAT, "concat")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CREATE, "create")
+#if !defined (CONFIG_DISABLE_ANNEXB_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ESCAPE, "escape")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FILTER, "filter")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FREEZE, "freeze")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_DAY_UL, "getDay")
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GLOBAL, "global")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_VIEW_UL, "isView")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LENGTH, "length")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NUMBER, "number")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OBJECT, "object")
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RANDOM, "random")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REDUCE, "reduce")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_PROMISE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REJECT, "reject")
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN) && !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SEARCH, "search")
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SOURCE, "source")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPLICE, "splice")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STRING, "string")
+#if !defined (CONFIG_DISABLE_ANNEXB_BUILTIN) && !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SUBSTR, "substr")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN) \
+|| !defined (CONFIG_DISABLE_JSON_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_JSON_UL, "toJSON")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BOOLEAN_UL, "Boolean")
+#if !defined (CONFIG_DISABLE_ES2015_PROMISE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROMISE_UL, "Promise")
+#endif
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SQRT1_2_U, "SQRT1_2")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BOOLEAN, "boolean")
+#if !defined (CONFIG_DISABLE_ANNEXB_BUILTIN) && !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COMPILE, "compile")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FOR_EACH_UL, "forEach")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_DATE_UL, "getDate")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_TIME_UL, "getTime")
+#endif
+#if !defined (CONFIG_DISABLE_ANNEXB_BUILTIN) && !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_YEAR_UL, "getYear")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INDEX_OF_UL, "indexOf")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_ARRAY_UL, "isArray")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MESSAGE, "message")
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN) && !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REPLACE, "replace")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_PROMISE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RESOLVE, "resolve")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REVERSE, "reverse")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_DATE_UL, "setDate")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_TIME_UL, "setTime")
+#endif
+#if !defined (CONFIG_DISABLE_ANNEXB_BUILTIN) && !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_YEAR_UL, "setYear")
+#endif
+#if !defined (CONFIG_DISABLE_NUMBER_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_FIXED_UL, "toFixed")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNSHIFT, "unshift")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_VALUE_OF_UL, "valueOf")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION_UL, "Function")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INFINITY_UL, "Infinity")
+#if !defined (CONFIG_DISABLE_ERROR_BUILTINS)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_URI_ERROR_UL, "URIError")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION, "function")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_HOURS_UL, "getHours")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_MONTH_UL, "getMonth")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_FINITE, "isFinite")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_FROZEN_UL, "isFrozen")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_SEALED_UL, "isSealed")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PARSE_INT, "parseInt")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_HOURS_UL, "setHours")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_MONTH_UL, "setMonth")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_STRING_UL, "toString")
+#if !defined (CONFIG_DISABLE_ANNEXB_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNESCAPE, "unescape")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_WRITABLE, "writable")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NEGATIVE_INFINITY_UL, "-Infinity")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARGUMENTS_UL, "Arguments")
+#if !defined (CONFIG_DISABLE_ERROR_BUILTINS)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EVAL_ERROR_UL, "EvalError")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INT8_ARRAY_UL, "Int8Array")
+#endif
+#if !defined (CONFIG_DISABLE_NUMBER_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MAX_VALUE_U, "MAX_VALUE")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MIN_VALUE_U, "MIN_VALUE")
+#endif
+#if !defined (CONFIG_DISABLE_ERROR_BUILTINS)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TYPE_ERROR_UL, "TypeError")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNDEFINED_UL, "Undefined")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARGUMENTS, "arguments")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DECODE_URI, "decodeURI")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENCODE_URI, "encodeURI")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_DAY_UL, "getUTCDay")
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LASTINDEX_UL, "lastIndex")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MULTILINE, "multiline")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROTOTYPE, "prototype")
+#if !defined (CONFIG_DISABLE_JSON_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STRINGIFY, "stringify")
+#endif
+#if !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SUBSTRING, "substring")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNDEFINED, "undefined")
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INT16_ARRAY_UL, "Int16Array")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INT32_ARRAY_UL, "Int32Array")
+#endif
+#if !defined (CONFIG_DISABLE_ERROR_BUILTINS)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RANGE_ERROR_UL, "RangeError")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TYPED_ARRAY_UL, "TypedArray")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UINT8_ARRAY_UL, "Uint8Array")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BYTE_LENGTH_UL, "byteLength")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BYTE_OFFSET_UL, "byteOffset")
+#endif
+#if !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CHAR_CODE_AT_UL, "charCodeAt")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENUMERABLE, "enumerable")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_MINUTES_UL, "getMinutes")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_SECONDS_UL, "getSeconds")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_DATE_UL, "getUTCDate")
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IGNORECASE_UL, "ignoreCase")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PARSE_FLOAT, "parseFloat")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_MINUTES_UL, "setMinutes")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_SECONDS_UL, "setSeconds")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_DATE_UL, "setUTCDate")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARRAY_BUFFER_UL, "ArrayBuffer")
+#endif
+#if !defined (CONFIG_DISABLE_ERROR_BUILTINS)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SYNTAX_ERROR_UL, "SyntaxError")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UINT16_ARRAY_UL, "Uint16Array")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UINT32_ARRAY_UL, "Uint32Array")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CONSTRUCTOR, "constructor")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_FULL_YEAR_UL, "getFullYear")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_HOURS_UL, "getUTCHours")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_MONTH_UL, "getUTCMonth")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LAST_INDEX_OF_UL, "lastIndexOf")
+#endif
+#if !defined (CONFIG_DISABLE_ARRAY_BUILTIN) \
+|| !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REDUCE_RIGHT_UL, "reduceRight")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_FULL_YEAR_UL, "setFullYear")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_HOURS_UL, "setUTCHours")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_MONTH_UL, "setUTCMonth")
+#endif
+#if !defined (CONFIG_DISABLE_ANNEXB_BUILTIN) && !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_GMT_STRING_UL, "toGMTString")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_ISO_STRING_UL, "toISOString")
+#endif
+#if !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOWER_CASE_UL, "toLowerCase")
+#endif
+#if !defined (CONFIG_DISABLE_NUMBER_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_PRECISION_UL, "toPrecision")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_UTC_STRING_UL, "toUTCString")
+#endif
+#if !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_UPPER_CASE_UL, "toUpperCase")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLOAT32_ARRAY_UL, "Float32Array")
+#endif
+#if  CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 && !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLOAT64_ARRAY_UL, "Float64Array")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INVALID_DATE_UL, "Invalid Date")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CONFIGURABLE, "configurable")
+#if !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FROM_CHAR_CODE_UL, "fromCharCode")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_EXTENSIBLE, "isExtensible")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_DATE_STRING_UL, "toDateString")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_TIME_STRING_UL, "toTimeString")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_MINUTES_UL, "getUTCMinutes")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_SECONDS_UL, "getUTCSeconds")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL, "isPrototypeOf")
+#if !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOCALE_COMPARE_UL, "localeCompare")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_MINUTES_UL, "setUTCMinutes")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_SECONDS_UL, "setUTCSeconds")
+#endif
+#if !defined (CONFIG_DISABLE_NUMBER_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_EXPONENTIAL_UL, "toExponential")
+#endif
+#if !defined (CONFIG_DISABLE_ERROR_BUILTINS)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REFERENCE_ERROR_UL, "ReferenceError")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEFINE_PROPERTY_UL, "defineProperty")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_PROTOTYPE_OF_UL, "getPrototypeOf")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_FULL_YEAR_UL, "getUTCFullYear")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_HAS_OWN_PROPERTY_UL, "hasOwnProperty")
+#if !defined (CONFIG_DISABLE_ES2015_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL, "setPrototypeOf")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_FULL_YEAR_UL, "setUTCFullYear")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, "toLocaleString")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_MILLISECONDS_UL, "getMilliseconds")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_MILLISECONDS_UL, "setMilliseconds")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL, "defineProperties")
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U, "BYTES_PER_ELEMENT")
+#endif
+#if !defined (CONFIG_DISABLE_NUMBER_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NEGATIVE_INFINITY_U, "NEGATIVE_INFINITY")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_POSITIVE_INFINITY_U, "POSITIVE_INFINITY")
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL, "Uint8ClampedArray")
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_TIMEZONE_OFFSET_UL, "getTimezoneOffset")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PREVENT_EXTENSIONS_UL, "preventExtensions")
+#if !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOCALE_LOWER_CASE_UL, "toLocaleLowerCase")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOCALE_UPPER_CASE_UL, "toLocaleUpperCase")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DECODE_URI_COMPONENT, "decodeURIComponent")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENCODE_URI_COMPONENT, "encodeURIComponent")
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_MILLISECONDS_UL, "getUTCMilliseconds")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_MILLISECONDS_UL, "setUTCMilliseconds")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOCALE_DATE_STRING_UL, "toLocaleDateString")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOCALE_TIME_STRING_UL, "toLocaleTimeString")
+#endif
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL, "getOwnPropertyNames")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL, "propertyIsEnumerable")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL, "getOwnPropertyDescriptor")
+LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING__FUNCTION_TO_STRING, "function(){/* ecmascript */}")
+
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (0, LIT_MAGIC_STRING__EMPTY)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_NEW_LINE_CHAR)
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_PI_U)
+#elif !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_OF)
+#elif !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_LN2_U)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_NAN)
+#endif
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (3, LIT_MAGIC_STRING_LN2_U)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (3, LIT_MAGIC_STRING_NAN)
+#endif
+#if !defined (CONFIG_DISABLE_REGEXP_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (4, LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (4, LIT_MAGIC_STRING_DATE_UL)
+#endif
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (5, LIT_MAGIC_STRING_ARRAY_UL)
+#if !defined (CONFIG_DISABLE_MATH_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (6, LIT_MAGIC_STRING_LOG10E_U)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (6, LIT_MAGIC_STRING_NUMBER_UL)
+#endif
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (7, LIT_MAGIC_STRING_BOOLEAN_UL)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (8, LIT_MAGIC_STRING_FUNCTION_UL)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (9, LIT_MAGIC_STRING_NEGATIVE_INFINITY_UL)
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_INT16_ARRAY_UL)
+#elif !defined (CONFIG_DISABLE_ERROR_BUILTINS)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_RANGE_ERROR_UL)
+#elif !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_TYPED_ARRAY_UL)
+#elif !defined (CONFIG_DISABLE_STRING_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_CHAR_CODE_AT_UL)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_ENUMERABLE)
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_ARRAY_BUFFER_UL)
+#elif !defined (CONFIG_DISABLE_ERROR_BUILTINS)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_SYNTAX_ERROR_UL)
+#elif !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_UINT16_ARRAY_UL)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_CONSTRUCTOR)
+#endif
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_FLOAT32_ARRAY_UL)
+#elif  CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 && !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_FLOAT64_ARRAY_UL)
+#elif !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_INVALID_DATE_UL)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_CONFIGURABLE)
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_GET_UTC_MINUTES_UL)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL)
+#endif
+#if !defined (CONFIG_DISABLE_ERROR_BUILTINS)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (14, LIT_MAGIC_STRING_REFERENCE_ERROR_UL)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (14, LIT_MAGIC_STRING_DEFINE_PROPERTY_UL)
+#endif
+#if !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_GET_MILLISECONDS_UL)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL)
+#endif
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (16, LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL)
+#if !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U)
+#elif !defined (CONFIG_DISABLE_NUMBER_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_NEGATIVE_INFINITY_U)
+#elif !defined (CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL)
+#elif !defined (CONFIG_DISABLE_DATE_BUILTIN)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_GET_TIMEZONE_OFFSET_UL)
+#else
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_PREVENT_EXTENSIONS_UL)
+#endif
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (18, LIT_MAGIC_STRING_DECODE_URI_COMPONENT)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (19, LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (20, LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (21, LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (22, LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (23, LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (24, LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (25, LIT_MAGIC_STRING__FUNCTION_TO_STRING)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (26, LIT_MAGIC_STRING__FUNCTION_TO_STRING)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (27, LIT_MAGIC_STRING__FUNCTION_TO_STRING)
+LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (28, LIT_MAGIC_STRING__FUNCTION_TO_STRING)
diff --git a/deps/jerry/jerry-core/lit/lit-magic-strings.ini b/deps/jerry/jerry-core/lit/lit-magic-strings.ini
new file mode 100644 (file)
index 0000000..003fe70
--- /dev/null
@@ -0,0 +1,275 @@
+# 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.
+
+# List of ECMA magic strings
+#
+# These strings must be ascii strings. The NULL character cannot be part of
+# magic strings, because it must be the terminator character of all magic
+# strings.
+#
+# If the list is modified, tools/gen-magic-strings.py must be executed!
+
+[LIT_MAGIC_STRINGS]
+
+LIT_MAGIC_STRING__EMPTY = ""
+LIT_MAGIC_STRING_NEW_LINE_CHAR = "\n"
+LIT_MAGIC_STRING_SPACE_CHAR = " "
+LIT_MAGIC_STRING_DOUBLE_QUOTE_CHAR = "\""
+LIT_MAGIC_STRING_LEFT_PARENTHESIS_CHAR = "("
+LIT_MAGIC_STRING_RIGHT_PARENTHESIS_CHAR = ")"
+LIT_MAGIC_STRING_COMMA_CHAR = ","
+LIT_MAGIC_STRING_MINUS_CHAR = "-"
+LIT_MAGIC_STRING_SLASH_CHAR = "/"
+LIT_MAGIC_STRING_COLON_CHAR = ":"
+LIT_MAGIC_STRING_E_U = "E"
+LIT_MAGIC_STRING_LEFT_SQUARE_CHAR = "["
+LIT_MAGIC_STRING_BACKSLASH_CHAR = "\\"
+LIT_MAGIC_STRING_RIGHT_SQUARE_CHAR = "]"
+LIT_MAGIC_STRING_G_CHAR = "g"
+LIT_MAGIC_STRING_I_CHAR = "i"
+LIT_MAGIC_STRING_M_CHAR = "m"
+LIT_MAGIC_STRING_LEFT_BRACE_CHAR = "{"
+LIT_MAGIC_STRING_RIGHT_BRACE_CHAR = "}"
+LIT_MAGIC_STRING_PI_U = "PI"
+LIT_MAGIC_STRING_OF = "of"
+LIT_MAGIC_STRING_LN2_U = "LN2"
+LIT_MAGIC_STRING_NAN = "NaN"
+LIT_MAGIC_STRING_UTC_U = "UTC"
+LIT_MAGIC_STRING_ABS = "abs"
+LIT_MAGIC_STRING_ALL = "all"
+LIT_MAGIC_STRING_COS = "cos"
+LIT_MAGIC_STRING_EXP = "exp"
+LIT_MAGIC_STRING_GET = "get"
+LIT_MAGIC_STRING_LOG = "log"
+LIT_MAGIC_STRING_MAP = "map"
+LIT_MAGIC_STRING_MAX = "max"
+LIT_MAGIC_STRING_MIN = "min"
+LIT_MAGIC_STRING_NOW = "now"
+LIT_MAGIC_STRING_POP = "pop"
+LIT_MAGIC_STRING_POW = "pow"
+LIT_MAGIC_STRING_SET = "set"
+LIT_MAGIC_STRING_SIN = "sin"
+LIT_MAGIC_STRING_TAN = "tan"
+LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP = "(?:)"
+LIT_MAGIC_STRING_DATE_UL = "Date"
+LIT_MAGIC_STRING_JSON_U = "JSON"
+LIT_MAGIC_STRING_LN10_U = "LN10"
+LIT_MAGIC_STRING_MATH_UL = "Math"
+LIT_MAGIC_STRING_NULL_UL = "Null"
+LIT_MAGIC_STRING_ACOS = "acos"
+LIT_MAGIC_STRING_ASIN = "asin"
+LIT_MAGIC_STRING_ATAN = "atan"
+LIT_MAGIC_STRING_BIND = "bind"
+LIT_MAGIC_STRING_CALL = "call"
+LIT_MAGIC_STRING_CEIL = "ceil"
+LIT_MAGIC_STRING_EVAL = "eval"
+LIT_MAGIC_STRING_EXEC = "exec"
+LIT_MAGIC_STRING_FROM = "from"
+LIT_MAGIC_STRING_JOIN = "join"
+LIT_MAGIC_STRING_KEYS = "keys"
+LIT_MAGIC_STRING_NAME = "name"
+LIT_MAGIC_STRING_NULL = "null"
+LIT_MAGIC_STRING_PUSH = "push"
+LIT_MAGIC_STRING_RACE = "race"
+LIT_MAGIC_STRING_SEAL = "seal"
+LIT_MAGIC_STRING_SOME = "some"
+LIT_MAGIC_STRING_SORT = "sort"
+LIT_MAGIC_STRING_SQRT = "sqrt"
+LIT_MAGIC_STRING_TEST = "test"
+LIT_MAGIC_STRING_THEN = "then"
+LIT_MAGIC_STRING_TRIM = "trim"
+LIT_MAGIC_STRING_TRUE = "true"
+LIT_MAGIC_STRING_ARRAY_UL = "Array"
+LIT_MAGIC_STRING_ERROR_UL = "Error"
+LIT_MAGIC_STRING_LOG2E_U = "LOG2E"
+LIT_MAGIC_STRING_SQRT2_U = "SQRT2"
+LIT_MAGIC_STRING_APPLY = "apply"
+LIT_MAGIC_STRING_ATAN2 = "atan2"
+LIT_MAGIC_STRING_CATCH = "catch"
+LIT_MAGIC_STRING_EVERY = "every"
+LIT_MAGIC_STRING_FALSE = "false"
+LIT_MAGIC_STRING_FLOOR = "floor"
+LIT_MAGIC_STRING_INDEX = "index"
+LIT_MAGIC_STRING_INPUT = "input"
+LIT_MAGIC_STRING_IS_NAN = "isNaN"
+LIT_MAGIC_STRING_MATCH = "match"
+LIT_MAGIC_STRING_PARSE = "parse"
+LIT_MAGIC_STRING_ROUND = "round"
+LIT_MAGIC_STRING_SHIFT = "shift"
+LIT_MAGIC_STRING_SLICE = "slice"
+LIT_MAGIC_STRING_SPLIT = "split"
+LIT_MAGIC_STRING_VALUE = "value"
+LIT_MAGIC_STRING_LOG10E_U = "LOG10E"
+LIT_MAGIC_STRING_NUMBER_UL = "Number"
+LIT_MAGIC_STRING_OBJECT_UL = "Object"
+LIT_MAGIC_STRING_REGEXP_UL = "RegExp"
+LIT_MAGIC_STRING_STRING_UL = "String"
+LIT_MAGIC_STRING_BUFFER = "buffer"
+LIT_MAGIC_STRING_CALLEE = "callee"
+LIT_MAGIC_STRING_CALLER = "caller"
+LIT_MAGIC_STRING_CHAR_AT_UL = "charAt"
+LIT_MAGIC_STRING_CONCAT = "concat"
+LIT_MAGIC_STRING_CREATE = "create"
+LIT_MAGIC_STRING_ESCAPE = "escape"
+LIT_MAGIC_STRING_FILTER = "filter"
+LIT_MAGIC_STRING_FREEZE = "freeze"
+LIT_MAGIC_STRING_GET_DAY_UL = "getDay"
+LIT_MAGIC_STRING_GLOBAL = "global"
+LIT_MAGIC_STRING_IS_VIEW_UL = "isView"
+LIT_MAGIC_STRING_LENGTH = "length"
+LIT_MAGIC_STRING_NUMBER = "number"
+LIT_MAGIC_STRING_OBJECT = "object"
+LIT_MAGIC_STRING_RANDOM = "random"
+LIT_MAGIC_STRING_REDUCE = "reduce"
+LIT_MAGIC_STRING_REJECT = "reject"
+LIT_MAGIC_STRING_SEARCH = "search"
+LIT_MAGIC_STRING_SOURCE = "source"
+LIT_MAGIC_STRING_SPLICE = "splice"
+LIT_MAGIC_STRING_STRING = "string"
+LIT_MAGIC_STRING_SUBSTR = "substr"
+LIT_MAGIC_STRING_TO_JSON_UL = "toJSON"
+LIT_MAGIC_STRING_BOOLEAN_UL = "Boolean"
+LIT_MAGIC_STRING_PROMISE_UL = "Promise"
+LIT_MAGIC_STRING_SQRT1_2_U = "SQRT1_2"
+LIT_MAGIC_STRING_BOOLEAN = "boolean"
+LIT_MAGIC_STRING_COMPILE = "compile"
+LIT_MAGIC_STRING_FOR_EACH_UL = "forEach"
+LIT_MAGIC_STRING_GET_DATE_UL = "getDate"
+LIT_MAGIC_STRING_GET_TIME_UL = "getTime"
+LIT_MAGIC_STRING_GET_YEAR_UL = "getYear"
+LIT_MAGIC_STRING_INDEX_OF_UL = "indexOf"
+LIT_MAGIC_STRING_IS_ARRAY_UL = "isArray"
+LIT_MAGIC_STRING_MESSAGE = "message"
+LIT_MAGIC_STRING_REPLACE = "replace"
+LIT_MAGIC_STRING_RESOLVE = "resolve"
+LIT_MAGIC_STRING_REVERSE = "reverse"
+LIT_MAGIC_STRING_SET_DATE_UL = "setDate"
+LIT_MAGIC_STRING_SET_TIME_UL = "setTime"
+LIT_MAGIC_STRING_SET_YEAR_UL = "setYear"
+LIT_MAGIC_STRING_TO_FIXED_UL = "toFixed"
+LIT_MAGIC_STRING_UNSHIFT = "unshift"
+LIT_MAGIC_STRING_VALUE_OF_UL = "valueOf"
+LIT_MAGIC_STRING_FUNCTION_UL = "Function"
+LIT_MAGIC_STRING_INFINITY_UL = "Infinity"
+LIT_MAGIC_STRING_URI_ERROR_UL = "URIError"
+LIT_MAGIC_STRING_FUNCTION = "function"
+LIT_MAGIC_STRING_GET_HOURS_UL = "getHours"
+LIT_MAGIC_STRING_GET_MONTH_UL = "getMonth"
+LIT_MAGIC_STRING_IS_FINITE = "isFinite"
+LIT_MAGIC_STRING_IS_FROZEN_UL = "isFrozen"
+LIT_MAGIC_STRING_IS_SEALED_UL = "isSealed"
+LIT_MAGIC_STRING_PARSE_INT = "parseInt"
+LIT_MAGIC_STRING_SET_HOURS_UL = "setHours"
+LIT_MAGIC_STRING_SET_MONTH_UL = "setMonth"
+LIT_MAGIC_STRING_TO_STRING_UL = "toString"
+LIT_MAGIC_STRING_UNESCAPE = "unescape"
+LIT_MAGIC_STRING_WRITABLE = "writable"
+LIT_MAGIC_STRING_NEGATIVE_INFINITY_UL = "-Infinity"
+LIT_MAGIC_STRING_ARGUMENTS_UL = "Arguments"
+LIT_MAGIC_STRING_EVAL_ERROR_UL = "EvalError"
+LIT_MAGIC_STRING_INT8_ARRAY_UL = "Int8Array"
+LIT_MAGIC_STRING_MAX_VALUE_U = "MAX_VALUE"
+LIT_MAGIC_STRING_MIN_VALUE_U = "MIN_VALUE"
+LIT_MAGIC_STRING_TYPE_ERROR_UL = "TypeError"
+LIT_MAGIC_STRING_UNDEFINED_UL = "Undefined"
+LIT_MAGIC_STRING_ARGUMENTS = "arguments"
+LIT_MAGIC_STRING_DECODE_URI = "decodeURI"
+LIT_MAGIC_STRING_ENCODE_URI = "encodeURI"
+LIT_MAGIC_STRING_GET_UTC_DAY_UL = "getUTCDay"
+LIT_MAGIC_STRING_LASTINDEX_UL = "lastIndex"
+LIT_MAGIC_STRING_MULTILINE = "multiline"
+LIT_MAGIC_STRING_PROTOTYPE = "prototype"
+LIT_MAGIC_STRING_STRINGIFY = "stringify"
+LIT_MAGIC_STRING_SUBSTRING = "substring"
+LIT_MAGIC_STRING_UNDEFINED = "undefined"
+LIT_MAGIC_STRING_INT16_ARRAY_UL = "Int16Array"
+LIT_MAGIC_STRING_INT32_ARRAY_UL = "Int32Array"
+LIT_MAGIC_STRING_RANGE_ERROR_UL = "RangeError"
+LIT_MAGIC_STRING_TYPED_ARRAY_UL = "TypedArray"
+LIT_MAGIC_STRING_UINT8_ARRAY_UL = "Uint8Array"
+LIT_MAGIC_STRING_BYTE_LENGTH_UL = "byteLength"
+LIT_MAGIC_STRING_BYTE_OFFSET_UL = "byteOffset"
+LIT_MAGIC_STRING_CHAR_CODE_AT_UL = "charCodeAt"
+LIT_MAGIC_STRING_ENUMERABLE = "enumerable"
+LIT_MAGIC_STRING_GET_MINUTES_UL = "getMinutes"
+LIT_MAGIC_STRING_GET_SECONDS_UL = "getSeconds"
+LIT_MAGIC_STRING_GET_UTC_DATE_UL = "getUTCDate"
+LIT_MAGIC_STRING_IGNORECASE_UL = "ignoreCase"
+LIT_MAGIC_STRING_PARSE_FLOAT = "parseFloat"
+LIT_MAGIC_STRING_SET_MINUTES_UL = "setMinutes"
+LIT_MAGIC_STRING_SET_SECONDS_UL = "setSeconds"
+LIT_MAGIC_STRING_SET_UTC_DATE_UL = "setUTCDate"
+LIT_MAGIC_STRING_ARRAY_BUFFER_UL = "ArrayBuffer"
+LIT_MAGIC_STRING_SYNTAX_ERROR_UL = "SyntaxError"
+LIT_MAGIC_STRING_UINT16_ARRAY_UL = "Uint16Array"
+LIT_MAGIC_STRING_UINT32_ARRAY_UL = "Uint32Array"
+LIT_MAGIC_STRING_CONSTRUCTOR = "constructor"
+LIT_MAGIC_STRING_GET_FULL_YEAR_UL = "getFullYear"
+LIT_MAGIC_STRING_GET_UTC_HOURS_UL = "getUTCHours"
+LIT_MAGIC_STRING_GET_UTC_MONTH_UL = "getUTCMonth"
+LIT_MAGIC_STRING_LAST_INDEX_OF_UL = "lastIndexOf"
+LIT_MAGIC_STRING_REDUCE_RIGHT_UL = "reduceRight"
+LIT_MAGIC_STRING_SET_FULL_YEAR_UL = "setFullYear"
+LIT_MAGIC_STRING_SET_UTC_HOURS_UL = "setUTCHours"
+LIT_MAGIC_STRING_SET_UTC_MONTH_UL = "setUTCMonth"
+LIT_MAGIC_STRING_TO_GMT_STRING_UL = "toGMTString"
+LIT_MAGIC_STRING_TO_ISO_STRING_UL = "toISOString"
+LIT_MAGIC_STRING_TO_LOWER_CASE_UL = "toLowerCase"
+LIT_MAGIC_STRING_TO_PRECISION_UL = "toPrecision"
+LIT_MAGIC_STRING_TO_UTC_STRING_UL = "toUTCString"
+LIT_MAGIC_STRING_TO_UPPER_CASE_UL = "toUpperCase"
+LIT_MAGIC_STRING_FLOAT32_ARRAY_UL = "Float32Array"
+LIT_MAGIC_STRING_FLOAT64_ARRAY_UL = "Float64Array"
+LIT_MAGIC_STRING_INVALID_DATE_UL = "Invalid Date"
+LIT_MAGIC_STRING_CONFIGURABLE = "configurable"
+LIT_MAGIC_STRING_FROM_CHAR_CODE_UL = "fromCharCode"
+LIT_MAGIC_STRING_IS_EXTENSIBLE = "isExtensible"
+LIT_MAGIC_STRING_TO_DATE_STRING_UL = "toDateString"
+LIT_MAGIC_STRING_TO_TIME_STRING_UL = "toTimeString"
+LIT_MAGIC_STRING_GET_UTC_MINUTES_UL = "getUTCMinutes"
+LIT_MAGIC_STRING_GET_UTC_SECONDS_UL = "getUTCSeconds"
+LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL = "isPrototypeOf"
+LIT_MAGIC_STRING_LOCALE_COMPARE_UL = "localeCompare"
+LIT_MAGIC_STRING_SET_UTC_MINUTES_UL = "setUTCMinutes"
+LIT_MAGIC_STRING_SET_UTC_SECONDS_UL = "setUTCSeconds"
+LIT_MAGIC_STRING_TO_EXPONENTIAL_UL = "toExponential"
+LIT_MAGIC_STRING_REFERENCE_ERROR_UL = "ReferenceError"
+LIT_MAGIC_STRING_DEFINE_PROPERTY_UL = "defineProperty"
+LIT_MAGIC_STRING_GET_PROTOTYPE_OF_UL = "getPrototypeOf"
+LIT_MAGIC_STRING_GET_UTC_FULL_YEAR_UL = "getUTCFullYear"
+LIT_MAGIC_STRING_HAS_OWN_PROPERTY_UL = "hasOwnProperty"
+LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL = "setPrototypeOf"
+LIT_MAGIC_STRING_SET_UTC_FULL_YEAR_UL = "setUTCFullYear"
+LIT_MAGIC_STRING_TO_LOCALE_STRING_UL = "toLocaleString"
+LIT_MAGIC_STRING_GET_MILLISECONDS_UL = "getMilliseconds"
+LIT_MAGIC_STRING_SET_MILLISECONDS_UL = "setMilliseconds"
+LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL = "defineProperties"
+LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U = "BYTES_PER_ELEMENT"
+LIT_MAGIC_STRING_NEGATIVE_INFINITY_U = "NEGATIVE_INFINITY"
+LIT_MAGIC_STRING_POSITIVE_INFINITY_U = "POSITIVE_INFINITY"
+LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL = "Uint8ClampedArray"
+LIT_MAGIC_STRING_GET_TIMEZONE_OFFSET_UL = "getTimezoneOffset"
+LIT_MAGIC_STRING_PREVENT_EXTENSIONS_UL = "preventExtensions"
+LIT_MAGIC_STRING_TO_LOCALE_LOWER_CASE_UL = "toLocaleLowerCase"
+LIT_MAGIC_STRING_TO_LOCALE_UPPER_CASE_UL = "toLocaleUpperCase"
+LIT_MAGIC_STRING_DECODE_URI_COMPONENT = "decodeURIComponent"
+LIT_MAGIC_STRING_ENCODE_URI_COMPONENT = "encodeURIComponent"
+LIT_MAGIC_STRING_GET_UTC_MILLISECONDS_UL = "getUTCMilliseconds"
+LIT_MAGIC_STRING_SET_UTC_MILLISECONDS_UL = "setUTCMilliseconds"
+LIT_MAGIC_STRING_TO_LOCALE_DATE_STRING_UL = "toLocaleDateString"
+LIT_MAGIC_STRING_TO_LOCALE_TIME_STRING_UL = "toLocaleTimeString"
+LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL = "getOwnPropertyNames"
+LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL = "propertyIsEnumerable"
+LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL = "getOwnPropertyDescriptor"
+LIT_MAGIC_STRING__FUNCTION_TO_STRING = "function(){/* ecmascript */}"
diff --git a/deps/jerry/jerry-core/lit/lit-strings.c b/deps/jerry/jerry-core/lit/lit-strings.c
new file mode 100644 (file)
index 0000000..739f5d2
--- /dev/null
@@ -0,0 +1,895 @@
+/* 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.
+ */
+
+#include "lit-strings.h"
+
+#include "jrt-libc-includes.h"
+
+/**
+ * Validate utf-8 string
+ *
+ * NOTE:
+ *   Isolated surrogates are allowed.
+ *   Correct pair of surrogates is not allowed, it should be represented as 4-byte utf-8 character.
+ *
+ * @return true if utf-8 string is well-formed
+ *         false otherwise
+ */
+bool
+lit_is_valid_utf8_string (const lit_utf8_byte_t *utf8_buf_p, /**< utf-8 string */
+                          lit_utf8_size_t buf_size) /**< string size */
+{
+  lit_utf8_size_t idx = 0;
+
+  bool is_prev_code_point_high_surrogate = false;
+  while (idx < buf_size)
+  {
+    lit_utf8_byte_t c = utf8_buf_p[idx++];
+    if ((c & LIT_UTF8_1_BYTE_MASK) == LIT_UTF8_1_BYTE_MARKER)
+    {
+      is_prev_code_point_high_surrogate = false;
+      continue;
+    }
+
+    lit_code_point_t code_point = 0;
+    lit_code_point_t min_code_point = 0;
+    lit_utf8_size_t extra_bytes_count;
+    if ((c & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER)
+    {
+      extra_bytes_count = 1;
+      min_code_point = LIT_UTF8_2_BYTE_CODE_POINT_MIN;
+      code_point = ((uint32_t) (c & LIT_UTF8_LAST_5_BITS_MASK));
+    }
+    else if ((c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER)
+    {
+      extra_bytes_count = 2;
+      min_code_point = LIT_UTF8_3_BYTE_CODE_POINT_MIN;
+      code_point = ((uint32_t) (c & LIT_UTF8_LAST_4_BITS_MASK));
+    }
+    else if ((c & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER)
+    {
+      extra_bytes_count = 3;
+      min_code_point = LIT_UTF8_4_BYTE_CODE_POINT_MIN;
+      code_point = ((uint32_t) (c & LIT_UTF8_LAST_3_BITS_MASK));
+    }
+    else
+    {
+      /* utf-8 string could not contain 5- and 6-byte sequences. */
+      return false;
+    }
+
+    if (idx + extra_bytes_count > buf_size)
+    {
+      /* utf-8 string breaks in the middle */
+      return false;
+    }
+
+    for (lit_utf8_size_t offset = 0; offset < extra_bytes_count; ++offset)
+    {
+      c = utf8_buf_p[idx + offset];
+      if ((c & LIT_UTF8_EXTRA_BYTE_MASK) != LIT_UTF8_EXTRA_BYTE_MARKER)
+      {
+        /* invalid continuation byte */
+        return false;
+      }
+      code_point <<= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+      code_point |= (c & LIT_UTF8_LAST_6_BITS_MASK);
+    }
+
+    if (code_point < min_code_point
+        || code_point > LIT_UNICODE_CODE_POINT_MAX)
+    {
+      /* utf-8 string doesn't encode valid unicode code point */
+      return false;
+    }
+
+    if (code_point >= LIT_UTF16_HIGH_SURROGATE_MIN
+        && code_point <= LIT_UTF16_HIGH_SURROGATE_MAX)
+    {
+      is_prev_code_point_high_surrogate = true;
+    }
+    else if (code_point >= LIT_UTF16_LOW_SURROGATE_MIN
+             && code_point <= LIT_UTF16_LOW_SURROGATE_MAX
+             && is_prev_code_point_high_surrogate)
+    {
+      /* sequence of high and low surrogate is not allowed */
+      return false;
+    }
+    else
+    {
+      is_prev_code_point_high_surrogate = false;
+    }
+
+    idx += extra_bytes_count;
+  }
+
+  return true;
+} /* lit_is_valid_utf8_string */
+
+/**
+ * Validate cesu-8 string
+ *
+ * @return true if cesu-8 string is well-formed
+ *         false otherwise
+ */
+bool
+lit_is_valid_cesu8_string (const lit_utf8_byte_t *cesu8_buf_p, /**< cesu-8 string */
+                           lit_utf8_size_t buf_size) /**< string size */
+{
+  lit_utf8_size_t idx = 0;
+
+  while (idx < buf_size)
+  {
+    lit_utf8_byte_t c = cesu8_buf_p[idx++];
+    if ((c & LIT_UTF8_1_BYTE_MASK) == LIT_UTF8_1_BYTE_MARKER)
+    {
+      continue;
+    }
+
+    lit_code_point_t code_point = 0;
+    lit_code_point_t min_code_point = 0;
+    lit_utf8_size_t extra_bytes_count;
+    if ((c & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER)
+    {
+      extra_bytes_count = 1;
+      min_code_point = LIT_UTF8_2_BYTE_CODE_POINT_MIN;
+      code_point = ((uint32_t) (c & LIT_UTF8_LAST_5_BITS_MASK));
+    }
+    else if ((c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER)
+    {
+      extra_bytes_count = 2;
+      min_code_point = LIT_UTF8_3_BYTE_CODE_POINT_MIN;
+      code_point = ((uint32_t) (c & LIT_UTF8_LAST_4_BITS_MASK));
+    }
+    else
+    {
+      return false;
+    }
+
+    if (idx + extra_bytes_count > buf_size)
+    {
+      /* cesu-8 string breaks in the middle */
+      return false;
+    }
+
+    for (lit_utf8_size_t offset = 0; offset < extra_bytes_count; ++offset)
+    {
+      c = cesu8_buf_p[idx + offset];
+      if ((c & LIT_UTF8_EXTRA_BYTE_MASK) != LIT_UTF8_EXTRA_BYTE_MARKER)
+      {
+        /* invalid continuation byte */
+        return false;
+      }
+      code_point <<= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+      code_point |= (c & LIT_UTF8_LAST_6_BITS_MASK);
+    }
+
+    if (code_point < min_code_point)
+    {
+      /* cesu-8 string doesn't encode valid unicode code point */
+      return false;
+    }
+
+    idx += extra_bytes_count;
+  }
+
+  return true;
+} /* lit_is_valid_cesu8_string */
+
+/**
+ * Check if the code point is UTF-16 low surrogate
+ *
+ * @return true / false
+ */
+bool
+lit_is_code_point_utf16_low_surrogate (lit_code_point_t code_point) /**< code point */
+{
+  return LIT_UTF16_LOW_SURROGATE_MIN <= code_point && code_point <= LIT_UTF16_LOW_SURROGATE_MAX;
+} /* lit_is_code_point_utf16_low_surrogate */
+
+/**
+ * Check if the code point is UTF-16 high surrogate
+ *
+ * @return true / false
+ */
+bool
+lit_is_code_point_utf16_high_surrogate (lit_code_point_t code_point) /**< code point */
+{
+  return LIT_UTF16_HIGH_SURROGATE_MIN <= code_point && code_point <= LIT_UTF16_HIGH_SURROGATE_MAX;
+} /* lit_is_code_point_utf16_high_surrogate */
+
+/**
+ * Represents code point (>0xFFFF) as surrogate pair and returns its lower part
+ *
+ * @return lower code_unit of the surrogate pair
+ */
+static ecma_char_t
+convert_code_point_to_low_surrogate (lit_code_point_t code_point) /**< code point, should be > 0xFFFF */
+{
+  JERRY_ASSERT (code_point > LIT_UTF16_CODE_UNIT_MAX);
+
+  ecma_char_t code_unit_bits;
+  code_unit_bits = (ecma_char_t) (code_point & LIT_UTF16_LAST_10_BITS_MASK);
+
+  return (ecma_char_t) (LIT_UTF16_LOW_SURROGATE_MARKER | code_unit_bits);
+} /* convert_code_point_to_low_surrogate */
+
+/**
+ * Represents code point (>0xFFFF) as surrogate pair and returns its higher part
+ *
+ * @return higher code_unit of the surrogate pair
+ */
+static ecma_char_t
+convert_code_point_to_high_surrogate (lit_code_point_t code_point) /**< code point, should be > 0xFFFF */
+{
+  JERRY_ASSERT (code_point > LIT_UTF16_CODE_UNIT_MAX);
+  JERRY_ASSERT (code_point <= LIT_UNICODE_CODE_POINT_MAX);
+
+  ecma_char_t code_unit_bits;
+  code_unit_bits = (ecma_char_t) ((code_point - LIT_UTF16_FIRST_SURROGATE_CODE_POINT) >> LIT_UTF16_BITS_IN_SURROGATE);
+
+  return (LIT_UTF16_HIGH_SURROGATE_MARKER | code_unit_bits);
+} /* convert_code_point_to_high_surrogate */
+
+/**
+ * Calculate size of a zero-terminated utf-8 string
+ *
+ * NOTE:
+ *   string should not contain zero characters in the middel
+ *
+ * @return size of a string
+ */
+lit_utf8_size_t
+lit_zt_utf8_string_size (const lit_utf8_byte_t *utf8_str_p) /**< zero-terminated utf-8 string */
+{
+  return (lit_utf8_size_t) strlen ((const char *) utf8_str_p);
+} /* lit_zt_utf8_string_size */
+
+/**
+ * Calculate length of a cesu-8 encoded string
+ *
+ * @return UTF-16 code units count
+ */
+ecma_length_t
+lit_utf8_string_length (const lit_utf8_byte_t *utf8_buf_p, /**< utf-8 string */
+                        lit_utf8_size_t utf8_buf_size) /**< string size */
+{
+  ecma_length_t length = 0;
+  lit_utf8_size_t size = 0;
+
+  while (size < utf8_buf_size)
+  {
+    size += lit_get_unicode_char_size_by_utf8_first_byte (*(utf8_buf_p + size));
+    length++;
+  }
+
+  JERRY_ASSERT (size == utf8_buf_size);
+
+  return length;
+} /* lit_utf8_string_length */
+
+/**
+ * Calculate the required size of an utf-8 encoded string from cesu-8 encoded string
+ *
+ * @return size of an utf-8 encoded string
+ */
+lit_utf8_size_t
+lit_get_utf8_size_of_cesu8_string (const lit_utf8_byte_t *cesu8_buf_p, /**< cesu-8 string */
+                                   lit_utf8_size_t cesu8_buf_size) /**< string size */
+{
+  lit_utf8_size_t offset = 0;
+  lit_utf8_size_t utf8_buf_size = cesu8_buf_size;
+  ecma_char_t prev_ch = 0;
+
+  while (offset < cesu8_buf_size)
+  {
+    ecma_char_t ch;
+    offset += lit_read_code_unit_from_utf8 (cesu8_buf_p + offset, &ch);
+
+    if (lit_is_code_point_utf16_low_surrogate (ch) && lit_is_code_point_utf16_high_surrogate (prev_ch))
+    {
+      utf8_buf_size -= 2;
+    }
+
+    prev_ch = ch;
+  }
+
+  JERRY_ASSERT (offset == cesu8_buf_size);
+
+  return utf8_buf_size;
+} /* lit_get_utf8_size_of_cesu8_string */
+
+/**
+ * Calculate length of an utf-8 encoded string from cesu-8 encoded string
+ *
+ * @return length of an utf-8 encoded string
+ */
+ecma_length_t
+lit_get_utf8_length_of_cesu8_string (const lit_utf8_byte_t *cesu8_buf_p, /**< cesu-8 string */
+                                     lit_utf8_size_t cesu8_buf_size) /**< string size */
+{
+  lit_utf8_size_t offset = 0;
+  ecma_length_t utf8_length = 0;
+  ecma_char_t prev_ch = 0;
+
+  while (offset < cesu8_buf_size)
+  {
+    ecma_char_t ch;
+    offset += lit_read_code_unit_from_utf8 (cesu8_buf_p + offset, &ch);
+
+    if (!lit_is_code_point_utf16_low_surrogate (ch) || !lit_is_code_point_utf16_high_surrogate (prev_ch))
+    {
+      utf8_length++;
+    }
+
+    prev_ch = ch;
+  }
+
+  JERRY_ASSERT (offset == cesu8_buf_size);
+
+  return utf8_length;
+} /* lit_get_utf8_length_of_cesu8_string */
+
+/**
+ * Decodes a unicode code point from non-empty utf-8-encoded buffer
+ *
+ * @return number of bytes occupied by code point in the string
+ */
+lit_utf8_size_t
+lit_read_code_point_from_utf8 (const lit_utf8_byte_t *buf_p, /**< buffer with characters */
+                               lit_utf8_size_t buf_size, /**< size of the buffer in bytes */
+                               lit_code_point_t *code_point) /**< [out] code point */
+{
+  JERRY_ASSERT (buf_p && buf_size);
+
+  lit_utf8_byte_t c = buf_p[0];
+  if ((c & LIT_UTF8_1_BYTE_MASK) == LIT_UTF8_1_BYTE_MARKER)
+  {
+    *code_point = (lit_code_point_t) (c & LIT_UTF8_LAST_7_BITS_MASK);
+    return 1;
+  }
+
+  lit_code_point_t ret = LIT_UNICODE_CODE_POINT_NULL;
+  ecma_length_t bytes_count = 0;
+  if ((c & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER)
+  {
+    bytes_count = 2;
+    ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_5_BITS_MASK));
+  }
+  else if ((c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER)
+  {
+    bytes_count = 3;
+    ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_4_BITS_MASK));
+  }
+  else if ((c & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER)
+  {
+    bytes_count = 4;
+    ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_3_BITS_MASK));
+  }
+  else
+  {
+    JERRY_ASSERT (false);
+  }
+
+  JERRY_ASSERT (buf_size >= bytes_count);
+
+  for (uint32_t i = 1; i < bytes_count; ++i)
+  {
+    ret <<= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+    ret |= (buf_p[i] & LIT_UTF8_LAST_6_BITS_MASK);
+  }
+
+  *code_point = ret;
+  return bytes_count;
+} /* lit_read_code_point_from_utf8 */
+
+/**
+ * Decodes a unicode code unit from non-empty cesu-8-encoded buffer
+ *
+ * @return number of bytes occupied by code point in the string
+ */
+lit_utf8_size_t
+lit_read_code_unit_from_utf8 (const lit_utf8_byte_t *buf_p, /**< buffer with characters */
+                              ecma_char_t *code_point) /**< [out] code point */
+{
+  JERRY_ASSERT (buf_p);
+
+  lit_utf8_byte_t c = buf_p[0];
+  if ((c & LIT_UTF8_1_BYTE_MASK) == LIT_UTF8_1_BYTE_MARKER)
+  {
+    *code_point = (ecma_char_t) (c & LIT_UTF8_LAST_7_BITS_MASK);
+    return 1;
+  }
+
+  lit_code_point_t ret = LIT_UNICODE_CODE_POINT_NULL;
+  ecma_length_t bytes_count;
+  if ((c & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER)
+  {
+    bytes_count = 2;
+    ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_5_BITS_MASK));
+  }
+  else
+  {
+    JERRY_ASSERT ((c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER);
+    bytes_count = 3;
+    ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_4_BITS_MASK));
+  }
+
+  for (uint32_t i = 1; i < bytes_count; ++i)
+  {
+    ret <<= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+    ret |= (buf_p[i] & LIT_UTF8_LAST_6_BITS_MASK);
+  }
+
+  JERRY_ASSERT (ret <= LIT_UTF16_CODE_UNIT_MAX);
+  *code_point = (ecma_char_t) ret;
+  return bytes_count;
+} /* lit_read_code_unit_from_utf8 */
+
+/**
+ * Decodes a unicode code unit from non-empty cesu-8-encoded buffer
+ *
+ * @return number of bytes occupied by code point in the string
+ */
+lit_utf8_size_t
+lit_read_prev_code_unit_from_utf8 (const lit_utf8_byte_t *buf_p, /**< buffer with characters */
+                                   ecma_char_t *code_point) /**< [out] code point */
+{
+  JERRY_ASSERT (buf_p);
+
+  lit_utf8_decr (&buf_p);
+  return lit_read_code_unit_from_utf8 (buf_p, code_point);
+} /* lit_read_prev_code_unit_from_utf8 */
+
+/**
+ * Decodes a unicode code unit from non-empty cesu-8-encoded buffer
+ *
+ * @return next code unit
+ */
+ecma_char_t
+lit_utf8_read_next (const lit_utf8_byte_t **buf_p) /**< [in,out] buffer with characters */
+{
+  JERRY_ASSERT (*buf_p);
+  ecma_char_t ch;
+
+  *buf_p += lit_read_code_unit_from_utf8 (*buf_p, &ch);
+
+  return ch;
+} /* lit_utf8_read_next */
+
+/**
+ * Decodes a unicode code unit from non-empty cesu-8-encoded buffer
+ *
+ * @return previous code unit
+ */
+ecma_char_t
+lit_utf8_read_prev (const lit_utf8_byte_t **buf_p) /**< [in,out] buffer with characters */
+{
+  JERRY_ASSERT (*buf_p);
+  ecma_char_t ch;
+
+  lit_utf8_decr (buf_p);
+  lit_read_code_unit_from_utf8 (*buf_p, &ch);
+
+  return ch;
+} /* lit_utf8_read_prev */
+
+/**
+ * Decodes a unicode code unit from non-empty cesu-8-encoded buffer
+ *
+ * @return next code unit
+ */
+ecma_char_t
+lit_utf8_peek_next (const lit_utf8_byte_t *buf_p) /**< [in,out] buffer with characters */
+{
+  JERRY_ASSERT (buf_p);
+  ecma_char_t ch;
+
+  lit_read_code_unit_from_utf8 (buf_p, &ch);
+
+  return ch;
+} /* lit_utf8_peek_next */
+
+/**
+ * Decodes a unicode code unit from non-empty cesu-8-encoded buffer
+ *
+ * @return previous code unit
+ */
+ecma_char_t
+lit_utf8_peek_prev (const lit_utf8_byte_t *buf_p) /**< [in,out] buffer with characters */
+{
+  JERRY_ASSERT (buf_p);
+  ecma_char_t ch;
+
+  lit_read_prev_code_unit_from_utf8 (buf_p, &ch);
+
+  return ch;
+} /* lit_utf8_peek_prev */
+
+/**
+ * Increase cesu-8 encoded string pointer by one code unit.
+ */
+void
+lit_utf8_incr (const lit_utf8_byte_t **buf_p) /**< [in,out] buffer with characters */
+{
+  JERRY_ASSERT (*buf_p);
+
+  *buf_p += lit_get_unicode_char_size_by_utf8_first_byte (**buf_p);
+} /* lit_utf8_incr */
+
+/**
+ * Decrease cesu-8 encoded string pointer by one code unit.
+ */
+void
+lit_utf8_decr (const lit_utf8_byte_t **buf_p) /**< [in,out] buffer with characters */
+{
+  JERRY_ASSERT (*buf_p);
+  const lit_utf8_byte_t *current_p = *buf_p;
+
+  do
+  {
+    current_p--;
+  }
+  while ((*(current_p) & LIT_UTF8_EXTRA_BYTE_MASK) == LIT_UTF8_EXTRA_BYTE_MARKER);
+
+  *buf_p = current_p;
+} /* lit_utf8_decr */
+
+/**
+ * Calc hash using the specified hash_basis.
+ *
+ * NOTE:
+ *   This is implementation of FNV-1a hash function, which is released into public domain.
+ *   Constants used, are carefully picked primes by the authors.
+ *   More info: http://www.isthe.com/chongo/tech/comp/fnv/
+ *
+ * @return ecma-string's hash
+ */
+inline lit_string_hash_t __attr_always_inline___
+lit_utf8_string_hash_combine (lit_string_hash_t hash_basis, /**< hash to be combined with */
+                              const lit_utf8_byte_t *utf8_buf_p, /**< characters buffer */
+                              lit_utf8_size_t utf8_buf_size) /**< number of characters in the buffer */
+{
+  JERRY_ASSERT (utf8_buf_p != NULL || utf8_buf_size == 0);
+
+  uint32_t hash = hash_basis;
+
+  for (uint32_t i = 0; i < utf8_buf_size; i++)
+  {
+    /* 16777619 is 32 bit FNV_prime = 2^24 + 2^8 + 0x93 = 16777619 */
+    hash = (hash ^ utf8_buf_p[i]) * 16777619;
+  }
+
+  return (lit_string_hash_t) hash;
+} /* lit_utf8_string_hash_combine */
+
+/**
+ * Calculate hash from the buffer.
+ *
+ * @return ecma-string's hash
+ */
+inline lit_string_hash_t __attr_always_inline___
+lit_utf8_string_calc_hash (const lit_utf8_byte_t *utf8_buf_p, /**< characters buffer */
+                           lit_utf8_size_t utf8_buf_size) /**< number of characters in the buffer */
+{
+  JERRY_ASSERT (utf8_buf_p != NULL || utf8_buf_size == 0);
+
+  /* 32 bit offset_basis for FNV = 2166136261 */
+  return lit_utf8_string_hash_combine ((lit_string_hash_t) 2166136261, utf8_buf_p, utf8_buf_size);
+} /* lit_utf8_string_calc_hash */
+
+/**
+ * Return code unit at the specified position in string
+ *
+ * NOTE:
+ *   code_unit_offset should be less then string's length
+ *
+ * @return code unit value
+ */
+ecma_char_t
+lit_utf8_string_code_unit_at (const lit_utf8_byte_t *utf8_buf_p, /**< utf-8 string */
+                              lit_utf8_size_t utf8_buf_size, /**< string size in bytes */
+                              ecma_length_t code_unit_offset) /**< ofset of a code_unit */
+{
+  lit_utf8_byte_t *current_p = (lit_utf8_byte_t *) utf8_buf_p;
+  ecma_char_t code_unit;
+
+  do
+  {
+    JERRY_ASSERT (current_p < utf8_buf_p + utf8_buf_size);
+    current_p += lit_read_code_unit_from_utf8 (current_p, &code_unit);
+  }
+  while (code_unit_offset--);
+
+  return code_unit;
+} /* lit_utf8_string_code_unit_at */
+
+/**
+ * Get CESU-8 encoded size of character
+ *
+ * @return number of bytes occupied in CESU-8
+ */
+inline lit_utf8_size_t __attr_always_inline___
+lit_get_unicode_char_size_by_utf8_first_byte (const lit_utf8_byte_t first_byte) /**< buffer with characters */
+{
+  if ((first_byte & LIT_UTF8_1_BYTE_MASK) == LIT_UTF8_1_BYTE_MARKER)
+  {
+    return 1;
+  }
+  else if ((first_byte & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER)
+  {
+    return 2;
+  }
+  else
+  {
+    JERRY_ASSERT ((first_byte & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER);
+    return 3;
+  }
+} /* lit_get_unicode_char_size_by_utf8_first_byte */
+
+/**
+ * Convert code unit to cesu-8 representation
+ *
+ * @return byte count required to represent the code unit
+ */
+lit_utf8_size_t
+lit_code_unit_to_utf8 (ecma_char_t code_unit, /**< code unit */
+                       lit_utf8_byte_t *buf_p) /**< buffer where to store the result and its size
+                                                *   should be at least LIT_UTF8_MAX_BYTES_IN_CODE_UNIT */
+{
+  if (code_unit <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+  {
+    buf_p[0] = (lit_utf8_byte_t) code_unit;
+    return 1;
+  }
+  else if (code_unit <= LIT_UTF8_2_BYTE_CODE_POINT_MAX)
+  {
+    uint32_t code_unit_bits = code_unit;
+    lit_utf8_byte_t second_byte_bits = (lit_utf8_byte_t) (code_unit_bits & LIT_UTF8_LAST_6_BITS_MASK);
+    code_unit_bits >>= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+
+    lit_utf8_byte_t first_byte_bits = (lit_utf8_byte_t) (code_unit_bits & LIT_UTF8_LAST_5_BITS_MASK);
+    JERRY_ASSERT (first_byte_bits == code_unit_bits);
+
+    buf_p[0] = LIT_UTF8_2_BYTE_MARKER | first_byte_bits;
+    buf_p[1] = LIT_UTF8_EXTRA_BYTE_MARKER | second_byte_bits;
+    return 2;
+  }
+  else
+  {
+    uint32_t code_unit_bits = code_unit;
+    lit_utf8_byte_t third_byte_bits = (lit_utf8_byte_t) (code_unit_bits & LIT_UTF8_LAST_6_BITS_MASK);
+    code_unit_bits >>= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+
+    lit_utf8_byte_t second_byte_bits = (lit_utf8_byte_t) (code_unit_bits & LIT_UTF8_LAST_6_BITS_MASK);
+    code_unit_bits >>= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+
+    lit_utf8_byte_t first_byte_bits = (lit_utf8_byte_t) (code_unit_bits & LIT_UTF8_LAST_4_BITS_MASK);
+    JERRY_ASSERT (first_byte_bits == code_unit_bits);
+
+    buf_p[0] = LIT_UTF8_3_BYTE_MARKER | first_byte_bits;
+    buf_p[1] = LIT_UTF8_EXTRA_BYTE_MARKER | second_byte_bits;
+    buf_p[2] = LIT_UTF8_EXTRA_BYTE_MARKER | third_byte_bits;
+    return 3;
+  }
+} /* lit_code_unit_to_utf8 */
+
+/**
+ * Convert code point to cesu-8 representation
+ *
+ * @return byte count required to represent the code point
+ */
+lit_utf8_size_t
+lit_code_point_to_cesu8 (lit_code_point_t code_point, /**< code point */
+                         lit_utf8_byte_t *buf) /**< buffer where to store the result,
+                                                *   its size should be at least 6 bytes */
+{
+  if (code_point <= LIT_UTF16_CODE_UNIT_MAX)
+  {
+    return lit_code_unit_to_utf8 ((ecma_char_t) code_point, buf);
+  }
+  else
+  {
+    lit_utf8_size_t offset = lit_code_unit_to_utf8 (convert_code_point_to_high_surrogate (code_point), buf);
+    offset += lit_code_unit_to_utf8 (convert_code_point_to_low_surrogate (code_point), buf + offset);
+    return offset;
+  }
+} /* lit_code_point_to_cesu8 */
+
+/**
+ * Convert code point to utf-8 representation
+ *
+ * @return byte count required to represent the code point
+ */
+lit_utf8_size_t
+lit_code_point_to_utf8 (lit_code_point_t code_point, /**< code point */
+                        lit_utf8_byte_t *buf) /**< buffer where to store the result,
+                                              *   its size should be at least 4 bytes */
+{
+  if (code_point <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+  {
+    buf[0] = (lit_utf8_byte_t) code_point;
+    return 1;
+  }
+  else if (code_point <= LIT_UTF8_2_BYTE_CODE_POINT_MAX)
+  {
+    uint32_t code_point_bits = code_point;
+    lit_utf8_byte_t second_byte_bits = (lit_utf8_byte_t) (code_point_bits & LIT_UTF8_LAST_6_BITS_MASK);
+    code_point_bits >>= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+
+    lit_utf8_byte_t first_byte_bits = (lit_utf8_byte_t) (code_point_bits & LIT_UTF8_LAST_5_BITS_MASK);
+    JERRY_ASSERT (first_byte_bits == code_point_bits);
+
+    buf[0] = LIT_UTF8_2_BYTE_MARKER | first_byte_bits;
+    buf[1] = LIT_UTF8_EXTRA_BYTE_MARKER | second_byte_bits;
+    return 2;
+  }
+  else if (code_point <= LIT_UTF8_3_BYTE_CODE_POINT_MAX)
+  {
+    uint32_t code_point_bits = code_point;
+    lit_utf8_byte_t third_byte_bits = (lit_utf8_byte_t) (code_point_bits & LIT_UTF8_LAST_6_BITS_MASK);
+    code_point_bits >>= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+
+    lit_utf8_byte_t second_byte_bits = (lit_utf8_byte_t) (code_point_bits & LIT_UTF8_LAST_6_BITS_MASK);
+    code_point_bits >>= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+
+    lit_utf8_byte_t first_byte_bits = (lit_utf8_byte_t) (code_point_bits & LIT_UTF8_LAST_4_BITS_MASK);
+    JERRY_ASSERT (first_byte_bits == code_point_bits);
+
+    buf[0] = LIT_UTF8_3_BYTE_MARKER | first_byte_bits;
+    buf[1] = LIT_UTF8_EXTRA_BYTE_MARKER | second_byte_bits;
+    buf[2] = LIT_UTF8_EXTRA_BYTE_MARKER | third_byte_bits;
+    return 3;
+  }
+  else
+  {
+    JERRY_ASSERT (code_point <= LIT_UTF8_4_BYTE_CODE_POINT_MAX);
+
+    uint32_t code_point_bits = code_point;
+    lit_utf8_byte_t fourth_byte_bits = (lit_utf8_byte_t) (code_point_bits & LIT_UTF8_LAST_6_BITS_MASK);
+    code_point_bits >>= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+
+    lit_utf8_byte_t third_byte_bits = (lit_utf8_byte_t) (code_point_bits & LIT_UTF8_LAST_6_BITS_MASK);
+    code_point_bits >>= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+
+    lit_utf8_byte_t second_byte_bits = (lit_utf8_byte_t) (code_point_bits & LIT_UTF8_LAST_6_BITS_MASK);
+    code_point_bits >>= LIT_UTF8_BITS_IN_EXTRA_BYTES;
+
+    lit_utf8_byte_t first_byte_bits = (lit_utf8_byte_t) (code_point_bits & LIT_UTF8_LAST_3_BITS_MASK);
+    JERRY_ASSERT (first_byte_bits == code_point_bits);
+
+    buf[0] = LIT_UTF8_4_BYTE_MARKER | first_byte_bits;
+    buf[1] = LIT_UTF8_EXTRA_BYTE_MARKER | second_byte_bits;
+    buf[2] = LIT_UTF8_EXTRA_BYTE_MARKER | third_byte_bits;
+    buf[3] = LIT_UTF8_EXTRA_BYTE_MARKER | fourth_byte_bits;
+    return 4;
+  }
+} /* lit_code_point_to_utf8 */
+
+/**
+ * Convert cesu-8 string to an utf-8 string and put it into the buffer.
+ * It is the caller's responsibility to make sure that the string fits in the buffer.
+ *
+ * @return number of bytes copied to the buffer.
+ */
+lit_utf8_size_t
+lit_convert_cesu8_string_to_utf8_string (const lit_utf8_byte_t *cesu8_string, /**< cesu-8 string */
+                                         lit_utf8_size_t cesu8_size, /**< size of cesu-8 string */
+                                         lit_utf8_byte_t *utf8_string, /**< destination utf-8 buffer pointer
+                                                                        * (can be NULL if buffer_size == 0) */
+                                         lit_utf8_size_t utf8_size) /**< size of utf-8 buffer */
+{
+  const lit_utf8_byte_t *cesu8_pos = cesu8_string;
+  const lit_utf8_byte_t *cesu8_end_pos = cesu8_string + cesu8_size;
+
+  lit_utf8_byte_t *utf8_pos = utf8_string;
+  lit_utf8_byte_t *utf8_end_pos = utf8_string + utf8_size;
+
+  lit_utf8_size_t size = 0;
+
+  ecma_char_t prev_ch = 0;
+  lit_utf8_size_t prev_ch_size = 0;
+
+  while (cesu8_pos < cesu8_end_pos)
+  {
+    ecma_char_t ch;
+    lit_utf8_size_t code_unit_size = lit_read_code_unit_from_utf8 (cesu8_pos, &ch);
+
+    if (lit_is_code_point_utf16_low_surrogate (ch) && lit_is_code_point_utf16_high_surrogate (prev_ch))
+    {
+      JERRY_ASSERT (code_unit_size == prev_ch_size);
+      utf8_pos -= prev_ch_size;
+      lit_code_point_t code_point = lit_convert_surrogate_pair_to_code_point (prev_ch, ch);
+      lit_code_point_to_utf8 (code_point, utf8_pos);
+      size++;
+    }
+    else
+    {
+      memcpy (utf8_pos, cesu8_pos, code_unit_size);
+      size += code_unit_size;
+    }
+
+    utf8_pos = utf8_string + size;
+    cesu8_pos += code_unit_size;
+    prev_ch = ch;
+    prev_ch_size = code_unit_size;
+  }
+
+  JERRY_ASSERT (cesu8_pos == cesu8_end_pos);
+  JERRY_ASSERT (utf8_pos <= utf8_end_pos);
+
+  return size;
+} /* lit_convert_cesu8_string_to_utf8_string */
+
+/**
+ * Convert surrogate pair to code point
+ *
+ * @return code point
+ */
+lit_code_point_t
+lit_convert_surrogate_pair_to_code_point (ecma_char_t high_surrogate, /**< high surrogate code point */
+                                          ecma_char_t low_surrogate) /**< low surrogate code point */
+{
+  JERRY_ASSERT (lit_is_code_point_utf16_high_surrogate (high_surrogate));
+  JERRY_ASSERT (lit_is_code_point_utf16_low_surrogate (low_surrogate));
+
+  lit_code_point_t code_point;
+  code_point = (uint16_t) (high_surrogate - LIT_UTF16_HIGH_SURROGATE_MIN);
+  code_point <<= LIT_UTF16_BITS_IN_SURROGATE;
+
+  code_point += LIT_UTF16_FIRST_SURROGATE_CODE_POINT;
+
+  code_point |= (uint16_t) (low_surrogate - LIT_UTF16_LOW_SURROGATE_MIN);
+  return code_point;
+} /* lit_convert_surrogate_pair_to_code_point */
+
+/**
+ * Relational compare of cesu-8 strings
+ *
+ * First string is less than second string if:
+ *  - strings are not equal;
+ *  - first string is prefix of second or is lexicographically less than second.
+ *
+ * @return true - if first string is less than second string,
+ *         false - otherwise
+ */
+bool lit_compare_utf8_strings_relational (const lit_utf8_byte_t *string1_p, /**< utf-8 string */
+                                          lit_utf8_size_t string1_size, /**< string size */
+                                          const lit_utf8_byte_t *string2_p, /**< utf-8 string */
+                                          lit_utf8_size_t string2_size) /**< string size */
+{
+  lit_utf8_byte_t *string1_pos = (lit_utf8_byte_t *) string1_p;
+  lit_utf8_byte_t *string2_pos = (lit_utf8_byte_t *) string2_p;
+  const lit_utf8_byte_t *string1_end_p = string1_p + string1_size;
+  const lit_utf8_byte_t *string2_end_p = string2_p + string2_size;
+
+  while (string1_pos < string1_end_p && string2_pos < string2_end_p)
+  {
+    ecma_char_t ch1, ch2;
+    string1_pos += lit_read_code_unit_from_utf8 (string1_pos, &ch1);
+    string2_pos += lit_read_code_unit_from_utf8 (string2_pos, &ch2);
+
+    if (ch1 < ch2)
+    {
+      return true;
+    }
+    else if (ch1 > ch2)
+    {
+      return false;
+    }
+  }
+
+  return (string1_pos >= string1_end_p && string2_pos < string2_end_p);
+} /* lit_compare_utf8_strings_relational */
diff --git a/deps/jerry/jerry-core/lit/lit-strings.h b/deps/jerry/jerry-core/lit/lit-strings.h
new file mode 100644 (file)
index 0000000..c83bf82
--- /dev/null
@@ -0,0 +1,143 @@
+/* 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.
+ */
+
+#ifndef LIT_STRINGS_H
+#define LIT_STRINGS_H
+
+#include "jrt.h"
+#include "lit-globals.h"
+
+/**
+ * Null character (used in few cases as utf-8 string end marker)
+ */
+#define LIT_BYTE_NULL (0)
+
+/**
+ * For the formal definition of Unicode transformation formats (UTF) see Section 3.9, Unicode Encoding Forms in The
+ * Unicode Standard (http://www.unicode.org/versions/Unicode3.0.0/ch03.pdf#G7404).
+ */
+#define LIT_UNICODE_CODE_POINT_NULL (0x0)
+#define LIT_UNICODE_CODE_POINT_MAX (0x10FFFF)
+
+#define LIT_UTF16_CODE_UNIT_MAX (0xFFFF)
+#define LIT_UTF16_FIRST_SURROGATE_CODE_POINT (0x10000)
+#define LIT_UTF16_LOW_SURROGATE_MARKER (0xDC00)
+#define LIT_UTF16_HIGH_SURROGATE_MARKER (0xD800)
+#define LIT_UTF16_HIGH_SURROGATE_MIN (0xD800)
+#define LIT_UTF16_HIGH_SURROGATE_MAX (0xDBFF)
+#define LIT_UTF16_LOW_SURROGATE_MIN (0xDC00)
+#define LIT_UTF16_LOW_SURROGATE_MAX (0xDFFF)
+#define LIT_UTF16_BITS_IN_SURROGATE (10)
+#define LIT_UTF16_LAST_10_BITS_MASK (0x3FF)
+
+#define LIT_UTF8_1_BYTE_MARKER (0x00)
+#define LIT_UTF8_2_BYTE_MARKER (0xC0)
+#define LIT_UTF8_3_BYTE_MARKER (0xE0)
+#define LIT_UTF8_4_BYTE_MARKER (0xF0)
+#define LIT_UTF8_5_BYTE_MARKER (0xF8)
+#define LIT_UTF8_EXTRA_BYTE_MARKER (0x80)
+
+#define LIT_UTF8_1_BYTE_MASK (0x80)
+#define LIT_UTF8_2_BYTE_MASK (0xE0)
+#define LIT_UTF8_3_BYTE_MASK (0xF0)
+#define LIT_UTF8_4_BYTE_MASK (0xF8)
+#define LIT_UTF8_EXTRA_BYTE_MASK (0xC0)
+
+#define LIT_UTF8_LAST_7_BITS_MASK (0x7F)
+#define LIT_UTF8_LAST_6_BITS_MASK (0x3F)
+#define LIT_UTF8_LAST_5_BITS_MASK (0x1F)
+#define LIT_UTF8_LAST_4_BITS_MASK (0x0F)
+#define LIT_UTF8_LAST_3_BITS_MASK (0x07)
+#define LIT_UTF8_LAST_2_BITS_MASK (0x03)
+#define LIT_UTF8_LAST_1_BIT_MASK  (0x01)
+
+#define LIT_UTF8_BITS_IN_EXTRA_BYTES (6)
+
+#define LIT_UTF8_1_BYTE_CODE_POINT_MAX (0x7F)
+#define LIT_UTF8_2_BYTE_CODE_POINT_MIN (0x80)
+#define LIT_UTF8_2_BYTE_CODE_POINT_MAX (0x7FF)
+#define LIT_UTF8_3_BYTE_CODE_POINT_MIN (0x800)
+#define LIT_UTF8_3_BYTE_CODE_POINT_MAX (LIT_UTF16_CODE_UNIT_MAX)
+#define LIT_UTF8_4_BYTE_CODE_POINT_MIN (0x10000)
+#define LIT_UTF8_4_BYTE_CODE_POINT_MAX (LIT_UNICODE_CODE_POINT_MAX)
+
+/**
+ * Differnce between byte count needed to represent code point greater than 0xFFFF
+ * in common UTF-8 (4 bytes required) and CESU-8 (6 bytes required)
+ */
+#define LIT_UTF8_CESU8_SURROGATE_SIZE_DIF (2 * LIT_UTF8_MAX_BYTES_IN_CODE_UNIT - LIT_UTF8_MAX_BYTES_IN_CODE_POINT)
+
+/**
+ * Byte values >= LIT_UTF8_FIRST_BYTE_MAX are not allowed in internal strings
+ */
+#define LIT_UTF8_FIRST_BYTE_MAX LIT_UTF8_5_BYTE_MARKER
+
+/* validation */
+bool lit_is_valid_utf8_string (const lit_utf8_byte_t *utf8_buf_p, lit_utf8_size_t buf_size);
+bool lit_is_valid_cesu8_string (const lit_utf8_byte_t *cesu8_buf_p, lit_utf8_size_t buf_size);
+
+/* checks */
+bool lit_is_code_point_utf16_low_surrogate (lit_code_point_t code_point);
+bool lit_is_code_point_utf16_high_surrogate (lit_code_point_t code_point);
+
+/* size */
+lit_utf8_size_t lit_zt_utf8_string_size (const lit_utf8_byte_t *utf8_str_p);
+lit_utf8_size_t lit_get_utf8_size_of_cesu8_string (const lit_utf8_byte_t *cesu8_buf_p, lit_utf8_size_t cesu8_buf_size);
+
+/* length */
+ecma_length_t lit_utf8_string_length (const lit_utf8_byte_t *utf8_buf_p, lit_utf8_size_t utf8_buf_size);
+ecma_length_t lit_get_utf8_length_of_cesu8_string (const lit_utf8_byte_t *cesu8_buf_p, lit_utf8_size_t cesu8_buf_size);
+
+/* hash */
+lit_string_hash_t lit_utf8_string_calc_hash (const lit_utf8_byte_t *utf8_buf_p, lit_utf8_size_t utf8_buf_size);
+lit_string_hash_t lit_utf8_string_hash_combine (lit_string_hash_t hash_basis, const lit_utf8_byte_t *utf8_buf_p,
+                                                lit_utf8_size_t utf8_buf_size);
+
+/* code unit access */
+ecma_char_t lit_utf8_string_code_unit_at (const lit_utf8_byte_t *utf8_buf_p, lit_utf8_size_t utf8_buf_size,
+                                          ecma_length_t code_unit_offset);
+lit_utf8_size_t lit_get_unicode_char_size_by_utf8_first_byte (lit_utf8_byte_t first_byte);
+
+/* conversion */
+lit_utf8_size_t lit_code_unit_to_utf8 (ecma_char_t code_unit, lit_utf8_byte_t *buf_p);
+lit_utf8_size_t lit_code_point_to_utf8 (lit_code_point_t code_point, lit_utf8_byte_t *buf);
+lit_utf8_size_t lit_code_point_to_cesu8 (lit_code_point_t code_point, lit_utf8_byte_t *buf);
+lit_utf8_size_t lit_convert_cesu8_string_to_utf8_string (const lit_utf8_byte_t *cesu8_string,
+                                                         lit_utf8_size_t cesu8_size,
+                                                         lit_utf8_byte_t *utf8_string,
+                                                         lit_utf8_size_t utf8_size);
+lit_code_point_t lit_convert_surrogate_pair_to_code_point (ecma_char_t high_surrogate, ecma_char_t low_surrogate);
+
+bool lit_compare_utf8_strings_relational (const lit_utf8_byte_t *string1_p, lit_utf8_size_t string1_size,
+                                          const lit_utf8_byte_t *string2_p, lit_utf8_size_t string2_size);
+
+/* read code point from buffer */
+lit_utf8_size_t lit_read_code_point_from_utf8 (const lit_utf8_byte_t *buf_p, lit_utf8_size_t buf_size,
+                                               lit_code_point_t *code_point);
+
+lit_utf8_size_t lit_read_code_unit_from_utf8 (const lit_utf8_byte_t *buf_p,
+                                              ecma_char_t *code_point);
+
+lit_utf8_size_t lit_read_prev_code_unit_from_utf8 (const lit_utf8_byte_t *buf_p,
+                                                   ecma_char_t *code_point);
+
+ecma_char_t lit_utf8_read_next (const lit_utf8_byte_t **buf_p);
+ecma_char_t lit_utf8_read_prev (const lit_utf8_byte_t **buf_p);
+ecma_char_t lit_utf8_peek_next (const lit_utf8_byte_t *buf_p);
+ecma_char_t lit_utf8_peek_prev (const lit_utf8_byte_t *buf_p);
+void lit_utf8_incr (const lit_utf8_byte_t **buf_p);
+void lit_utf8_decr (const lit_utf8_byte_t **buf_p);
+
+#endif /* !LIT_STRINGS_H */
diff --git a/deps/jerry/jerry-core/lit/lit-unicode-conversions.inc.h b/deps/jerry/jerry-core/lit/lit-unicode-conversions.inc.h
new file mode 100644 (file)
index 0000000..03fb8b2
--- /dev/null
@@ -0,0 +1,162 @@
+/* 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.
+ */
+
+/* This file is automatically generated by the gen-unicode.py script
+ * from UnicodeData-9.0.0.txt and SpecialCasing-9.0.0.txt files. Do not edit! */
+
+/* Contains start points of character case ranges (these are bidirectional conversions). */
+static const uint16_t lit_character_case_ranges[] JERRY_CONST_DATA =
+{
+  0x00c0, 0x00e0, 0x00d8, 0x00f8, 0x0189, 0x0256, 0x01b1, 0x028a, 0x0388, 0x03ad,
+  0x038e, 0x03cd, 0x0391, 0x03b1, 0x03a3, 0x03c3, 0x03fd, 0x037b, 0x0400, 0x0450,
+  0x0410, 0x0430, 0x0531, 0x0561, 0x10a0, 0x2d00, 0x13a0, 0xab70, 0x13f0, 0x13f8,
+  0x1f08, 0x1f00, 0x1f18, 0x1f10, 0x1f28, 0x1f20, 0x1f38, 0x1f30, 0x1f48, 0x1f40,
+  0x1f68, 0x1f60, 0x1fb8, 0x1fb0, 0x1fba, 0x1f70, 0x1fc8, 0x1f72, 0x1fd8, 0x1fd0,
+  0x1fda, 0x1f76, 0x1fe8, 0x1fe0, 0x1fea, 0x1f7a, 0x1ff8, 0x1f78, 0x1ffa, 0x1f7c,
+  0x2160, 0x2170, 0x24b6, 0x24d0, 0x2c00, 0x2c30, 0x2c7e, 0x023f, 0xff21, 0xff41
+};
+
+/* Interval lengths of start points in `character_case_ranges` table. */
+static const uint8_t lit_character_case_range_lengths[] JERRY_CONST_DATA =
+{
+  0x0017, 0x0007, 0x0002, 0x0002, 0x0003, 0x0002, 0x0011, 0x0009, 0x0003, 0x0010,
+  0x0020, 0x0026, 0x0026, 0x0050, 0x0006, 0x0008, 0x0006, 0x0008, 0x0008, 0x0006,
+  0x0008, 0x0002, 0x0002, 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
+  0x0010, 0x001a, 0x002f, 0x0002, 0x001a
+};
+
+/* Contains the start points of bidirectional conversion ranges. */
+static const uint16_t lit_character_pair_ranges[] JERRY_CONST_DATA =
+{
+  0x0100, 0x0132, 0x0139, 0x014a, 0x0179, 0x0182, 0x0187, 0x018b, 0x0191, 0x0198,
+  0x01a0, 0x01a7, 0x01ac, 0x01af, 0x01b3, 0x01b8, 0x01bc, 0x01cd, 0x01de, 0x01f4,
+  0x01f8, 0x0222, 0x023b, 0x0241, 0x0246, 0x0370, 0x0376, 0x03d8, 0x03f7, 0x03fa,
+  0x0460, 0x048a, 0x04c1, 0x04d0, 0x1e00, 0x1ea0, 0x2183, 0x2c60, 0x2c67, 0x2c72,
+  0x2c75, 0x2c80, 0x2ceb, 0x2cf2, 0xa640, 0xa680, 0xa722, 0xa732, 0xa779, 0xa77e,
+  0xa78b, 0xa790, 0xa796, 0xa7b4
+};
+
+/* Interval lengths of start points in `character_pair_ranges` table. */
+static const uint8_t lit_character_pair_range_lengths[] JERRY_CONST_DATA =
+{
+  0x0030, 0x0006, 0x0010, 0x002e, 0x0006, 0x0004, 0x0002, 0x0002, 0x0002, 0x0002,
+  0x0006, 0x0002, 0x0002, 0x0002, 0x0004, 0x0002, 0x0002, 0x0010, 0x0012, 0x0002,
+  0x0028, 0x0012, 0x0002, 0x0002, 0x000a, 0x0004, 0x0002, 0x0018, 0x0002, 0x0002,
+  0x0022, 0x0036, 0x000e, 0x0060, 0x0096, 0x0060, 0x0002, 0x0002, 0x0006, 0x0002,
+  0x0002, 0x0064, 0x0004, 0x0002, 0x002e, 0x001c, 0x000e, 0x003e, 0x0004, 0x000a,
+  0x0002, 0x0004, 0x0014, 0x0004
+};
+
+/* Contains lower/upper case bidirectional conversion pairs. */
+static const uint16_t lit_character_pairs[] JERRY_CONST_DATA =
+{
+  0x0178, 0x00ff, 0x0181, 0x0253, 0x0186, 0x0254, 0x018e, 0x01dd, 0x018f, 0x0259,
+  0x0190, 0x025b, 0x0193, 0x0260, 0x0194, 0x0263, 0x0196, 0x0269, 0x0197, 0x0268,
+  0x019c, 0x026f, 0x019d, 0x0272, 0x019f, 0x0275, 0x01a6, 0x0280, 0x01a9, 0x0283,
+  0x01ae, 0x0288, 0x01b7, 0x0292, 0x01c4, 0x01c6, 0x01c7, 0x01c9, 0x01ca, 0x01cc,
+  0x01f1, 0x01f3, 0x01f6, 0x0195, 0x01f7, 0x01bf, 0x0220, 0x019e, 0x023a, 0x2c65,
+  0x023d, 0x019a, 0x023e, 0x2c66, 0x0243, 0x0180, 0x0244, 0x0289, 0x0245, 0x028c,
+  0x037f, 0x03f3, 0x0386, 0x03ac, 0x038c, 0x03cc, 0x03cf, 0x03d7, 0x03f9, 0x03f2,
+  0x04c0, 0x04cf, 0x10c7, 0x2d27, 0x10cd, 0x2d2d, 0x1f59, 0x1f51, 0x1f5b, 0x1f53,
+  0x1f5d, 0x1f55, 0x1f5f, 0x1f57, 0x1fec, 0x1fe5, 0x2132, 0x214e, 0x2c62, 0x026b,
+  0x2c63, 0x1d7d, 0x2c64, 0x027d, 0x2c6d, 0x0251, 0x2c6e, 0x0271, 0x2c6f, 0x0250,
+  0x2c70, 0x0252, 0xa77d, 0x1d79, 0xa78d, 0x0265, 0xa7aa, 0x0266, 0xa7ab, 0x025c,
+  0xa7ac, 0x0261, 0xa7ad, 0x026c, 0xa7ae, 0x026a, 0xa7b0, 0x029e, 0xa7b1, 0x0287,
+  0xa7b2, 0x029d, 0xa7b3, 0xab53
+};
+
+/* Contains start points of one-to-two uppercase ranges where the second character
+ * is always the same.
+ */
+static const uint16_t lit_upper_case_special_ranges[] JERRY_CONST_DATA =
+{
+  0x1f80, 0x1f08, 0x0399, 0x1f88, 0x1f08, 0x0399, 0x1f90, 0x1f28, 0x0399, 0x1f98,
+  0x1f28, 0x0399, 0x1fa0, 0x1f68, 0x0399, 0x1fa8, 0x1f68, 0x0399
+};
+
+/* Interval lengths for start points in `upper_case_special_ranges` table. */
+static const uint8_t lit_upper_case_special_range_lengths[] JERRY_CONST_DATA =
+{
+  0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007
+};
+
+/* Contains start points of lowercase ranges. */
+static const uint16_t lit_lower_case_ranges[] JERRY_CONST_DATA =
+{
+  0x1e96, 0x1e96, 0x1f80, 0x1f80, 0x1f88, 0x1f80, 0x1f90, 0x1f90, 0x1f98, 0x1f90,
+  0x1fa0, 0x1fa0, 0x1fa8, 0x1fa0, 0x1fb2, 0x1fb2, 0x1fb6, 0x1fb6, 0x1fc2, 0x1fc2,
+  0x1fc6, 0x1fc6, 0x1fd2, 0x1fd2, 0x1fd6, 0x1fd6, 0x1fe2, 0x1fe2, 0x1fe6, 0x1fe6,
+  0x1ff2, 0x1ff2, 0x1ff6, 0x1ff6, 0xfb00, 0xfb00, 0xfb13, 0xfb13
+};
+
+/* Interval lengths for start points in `lower_case_ranges` table. */
+static const uint8_t lit_lower_case_range_lengths[] JERRY_CONST_DATA =
+{
+  0x0005, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0003, 0x0002, 0x0003,
+  0x0002, 0x0002, 0x0002, 0x0003, 0x0002, 0x0003, 0x0002, 0x0007, 0x0005
+};
+
+/* The remaining lowercase conversions. The lowercase variant can be one-to-three character long. */
+static const uint16_t lit_lower_case_conversions[] JERRY_CONST_DATA =
+{
+  0x00df, 0x00df, 0x0149, 0x0149, 0x01c5, 0x01c6, 0x01c8, 0x01c9, 0x01cb, 0x01cc,
+  0x01f0, 0x01f0, 0x01f2, 0x01f3, 0x0390, 0x0390, 0x03b0, 0x03b0, 0x03f4, 0x03b8,
+  0x0587, 0x0587, 0x1e9e, 0x00df, 0x1f50, 0x1f50, 0x1f52, 0x1f52, 0x1f54, 0x1f54,
+  0x1f56, 0x1f56, 0x1fbc, 0x1fb3, 0x1fcc, 0x1fc3, 0x1ffc, 0x1ff3, 0x2126, 0x03c9,
+  0x212a, 0x006b, 0x212b, 0x00e5, 0x0130, 0x0069, 0x0307
+};
+
+/* Number of one-to-one, one-to-two, and one-to-three lowercase conversions. */
+static const uint8_t lit_lower_case_conversion_counters[] JERRY_CONST_DATA =
+{
+  0x0016, 0x0001, 0x0000
+};
+
+/* The remaining uppercase conversions. The uppercase variant can be one-to-three character long. */
+static const uint16_t lit_upper_case_conversions[] JERRY_CONST_DATA =
+{
+  0x00b5, 0x039c, 0x0130, 0x0130, 0x0131, 0x0049, 0x017f, 0x0053, 0x01c5, 0x01c4,
+  0x01c8, 0x01c7, 0x01cb, 0x01ca, 0x01f2, 0x01f1, 0x0345, 0x0399, 0x03c2, 0x03a3,
+  0x03d0, 0x0392, 0x03d1, 0x0398, 0x03d5, 0x03a6, 0x03d6, 0x03a0, 0x03f0, 0x039a,
+  0x03f1, 0x03a1, 0x03f5, 0x0395, 0x1c80, 0x0412, 0x1c81, 0x0414, 0x1c82, 0x041e,
+  0x1c83, 0x0421, 0x1c84, 0x0422, 0x1c85, 0x0422, 0x1c86, 0x042a, 0x1c87, 0x0462,
+  0x1c88, 0xa64a, 0x1e9b, 0x1e60, 0x1fbe, 0x0399, 0x00df, 0x0053, 0x0053, 0x0149,
+  0x02bc, 0x004e, 0x01f0, 0x004a, 0x030c, 0x0587, 0x0535, 0x0552, 0x1e96, 0x0048,
+  0x0331, 0x1e97, 0x0054, 0x0308, 0x1e98, 0x0057, 0x030a, 0x1e99, 0x0059, 0x030a,
+  0x1e9a, 0x0041, 0x02be, 0x1f50, 0x03a5, 0x0313, 0x1f87, 0x1f0f, 0x0399, 0x1f8f,
+  0x1f0f, 0x0399, 0x1f97, 0x1f2f, 0x0399, 0x1f9f, 0x1f2f, 0x0399, 0x1fa7, 0x1f6f,
+  0x0399, 0x1faf, 0x1f6f, 0x0399, 0x1fb2, 0x1fba, 0x0399, 0x1fb3, 0x0391, 0x0399,
+  0x1fb4, 0x0386, 0x0399, 0x1fb6, 0x0391, 0x0342, 0x1fbc, 0x0391, 0x0399, 0x1fc2,
+  0x1fca, 0x0399, 0x1fc3, 0x0397, 0x0399, 0x1fc4, 0x0389, 0x0399, 0x1fc6, 0x0397,
+  0x0342, 0x1fcc, 0x0397, 0x0399, 0x1fd6, 0x0399, 0x0342, 0x1fe4, 0x03a1, 0x0313,
+  0x1fe6, 0x03a5, 0x0342, 0x1ff2, 0x1ffa, 0x0399, 0x1ff3, 0x03a9, 0x0399, 0x1ff4,
+  0x038f, 0x0399, 0x1ff6, 0x03a9, 0x0342, 0x1ffc, 0x03a9, 0x0399, 0xfb00, 0x0046,
+  0x0046, 0xfb01, 0x0046, 0x0049, 0xfb02, 0x0046, 0x004c, 0xfb05, 0x0053, 0x0054,
+  0xfb06, 0x0053, 0x0054, 0xfb13, 0x0544, 0x0546, 0xfb14, 0x0544, 0x0535, 0xfb15,
+  0x0544, 0x053b, 0xfb16, 0x054e, 0x0546, 0xfb17, 0x0544, 0x053d, 0x0390, 0x0399,
+  0x0308, 0x0301, 0x03b0, 0x03a5, 0x0308, 0x0301, 0x1f52, 0x03a5, 0x0313, 0x0300,
+  0x1f54, 0x03a5, 0x0313, 0x0301, 0x1f56, 0x03a5, 0x0313, 0x0342, 0x1fb7, 0x0391,
+  0x0342, 0x0399, 0x1fc7, 0x0397, 0x0342, 0x0399, 0x1fd2, 0x0399, 0x0308, 0x0300,
+  0x1fd3, 0x0399, 0x0308, 0x0301, 0x1fd7, 0x0399, 0x0308, 0x0342, 0x1fe2, 0x03a5,
+  0x0308, 0x0300, 0x1fe3, 0x03a5, 0x0308, 0x0301, 0x1fe7, 0x03a5, 0x0308, 0x0342,
+  0x1ff7, 0x03a9, 0x0342, 0x0399, 0xfb03, 0x0046, 0x0046, 0x0049, 0xfb04, 0x0046,
+  0x0046, 0x004c
+};
+
+/* Number of one-to-one, one-to-two, and one-to-three uppercase conversions. */
+static const uint8_t lit_upper_case_conversion_counters[] JERRY_CONST_DATA =
+{
+  0x001c, 0x002c, 0x0010
+};
diff --git a/deps/jerry/jerry-core/lit/lit-unicode-ranges.inc.h b/deps/jerry/jerry-core/lit/lit-unicode-ranges.inc.h
new file mode 100644 (file)
index 0000000..fb43910
--- /dev/null
@@ -0,0 +1,222 @@
+/* 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.
+ */
+
+/* This file is automatically generated by the gen-unicode.py script
+ * from UnicodeData-9.0.0.txt. Do not edit! */
+
+/**
+ * Character interval starting points for the unicode letters.
+ *
+ * The characters covered by these intervals are from
+ * the following Unicode categories: Lu, Ll, Lt, Lm, Lo, Nl
+ */
+static const uint16_t lit_unicode_letter_interval_sps[] JERRY_CONST_DATA =
+{
+  0x00c0, 0x00d8, 0x00f8, 0x01f8, 0x02c6, 0x02e0, 0x0370, 0x0376, 0x037a, 0x0388,
+  0x038e, 0x03a3, 0x03f7, 0x048a, 0x0531, 0x0561, 0x05d0, 0x05f0, 0x0620, 0x066e,
+  0x0671, 0x06e5, 0x06ee, 0x06fa, 0x0712, 0x074d, 0x07ca, 0x07f4, 0x0800, 0x0840,
+  0x08a0, 0x08b6, 0x0904, 0x0958, 0x0971, 0x0985, 0x098f, 0x0993, 0x09aa, 0x09b6,
+  0x09dc, 0x09df, 0x09f0, 0x0a05, 0x0a0f, 0x0a13, 0x0a2a, 0x0a32, 0x0a35, 0x0a38,
+  0x0a59, 0x0a72, 0x0a85, 0x0a8f, 0x0a93, 0x0aaa, 0x0ab2, 0x0ab5, 0x0ae0, 0x0b05,
+  0x0b0f, 0x0b13, 0x0b2a, 0x0b32, 0x0b35, 0x0b5c, 0x0b5f, 0x0b85, 0x0b8e, 0x0b92,
+  0x0b99, 0x0b9e, 0x0ba3, 0x0ba8, 0x0bae, 0x0c05, 0x0c0e, 0x0c12, 0x0c2a, 0x0c58,
+  0x0c60, 0x0c85, 0x0c8e, 0x0c92, 0x0caa, 0x0cb5, 0x0ce0, 0x0cf1, 0x0d05, 0x0d0e,
+  0x0d12, 0x0d54, 0x0d5f, 0x0d7a, 0x0d85, 0x0d9a, 0x0db3, 0x0dc0, 0x0e01, 0x0e32,
+  0x0e40, 0x0e81, 0x0e87, 0x0e94, 0x0e99, 0x0ea1, 0x0eaa, 0x0ead, 0x0eb2, 0x0ec0,
+  0x0edc, 0x0f40, 0x0f49, 0x0f88, 0x1000, 0x1050, 0x105a, 0x1065, 0x106e, 0x1075,
+  0x10a0, 0x10d0, 0x10fc, 0x11fc, 0x124a, 0x1250, 0x125a, 0x1260, 0x128a, 0x1290,
+  0x12b2, 0x12b8, 0x12c2, 0x12c8, 0x12d8, 0x1312, 0x1318, 0x1380, 0x13a0, 0x13f8,
+  0x1401, 0x1501, 0x1601, 0x166f, 0x1681, 0x16a0, 0x16ee, 0x1700, 0x170e, 0x1720,
+  0x1740, 0x1760, 0x176e, 0x1780, 0x1820, 0x1880, 0x1887, 0x18b0, 0x1900, 0x1950,
+  0x1970, 0x1980, 0x19b0, 0x1a00, 0x1a20, 0x1b05, 0x1b45, 0x1b83, 0x1bae, 0x1bba,
+  0x1c00, 0x1c4d, 0x1c5a, 0x1c80, 0x1ce9, 0x1cee, 0x1cf5, 0x1d00, 0x1e00, 0x1f00,
+  0x1f18, 0x1f20, 0x1f48, 0x1f50, 0x1f5f, 0x1f80, 0x1fb6, 0x1fc2, 0x1fc6, 0x1fd0,
+  0x1fd6, 0x1fe0, 0x1ff2, 0x1ff6, 0x2090, 0x210a, 0x2119, 0x212a, 0x212f, 0x213c,
+  0x2145, 0x2160, 0x2c00, 0x2c30, 0x2c60, 0x2ceb, 0x2cf2, 0x2d00, 0x2d30, 0x2d80,
+  0x2da0, 0x2da8, 0x2db0, 0x2db8, 0x2dc0, 0x2dc8, 0x2dd0, 0x2dd8, 0x3005, 0x3021,
+  0x3031, 0x3038, 0x3041, 0x309d, 0x30a1, 0x30fc, 0x3105, 0x3131, 0x31a0, 0x31f0,
+  0xa000, 0xa100, 0xa200, 0xa300, 0xa400, 0xa4d0, 0xa500, 0xa600, 0xa610, 0xa62a,
+  0xa640, 0xa67f, 0xa6a0, 0xa717, 0xa722, 0xa78b, 0xa7b0, 0xa7f7, 0xa803, 0xa807,
+  0xa80c, 0xa840, 0xa882, 0xa8f2, 0xa90a, 0xa930, 0xa960, 0xa984, 0xa9e0, 0xa9e6,
+  0xa9fa, 0xaa00, 0xaa40, 0xaa44, 0xaa60, 0xaa7e, 0xaab5, 0xaab9, 0xaadb, 0xaae0,
+  0xaaf2, 0xab01, 0xab09, 0xab11, 0xab20, 0xab28, 0xab30, 0xab5c, 0xab70, 0xd7b0,
+  0xd7cb, 0xf900, 0xfa00, 0xfa70, 0xfb00, 0xfb13, 0xfb1f, 0xfb2a, 0xfb38, 0xfb40,
+  0xfb43, 0xfb46, 0xfbd3, 0xfcd3, 0xfd50, 0xfd92, 0xfdf0, 0xfe70, 0xfe76, 0xff21,
+  0xff41, 0xff66, 0xffc2, 0xffca, 0xffd2, 0xffda
+};
+
+/**
+ * Character lengths for the unicode letters.
+ *
+ * The characters covered by these intervals are from
+ * the following Unicode categories: Lu, Ll, Lt, Lm, Lo, Nl
+ */
+static const uint8_t lit_unicode_letter_interval_lengths[] JERRY_CONST_DATA =
+{
+  0x0016, 0x001e, 0x00ff, 0x00c9, 0x000b, 0x0004, 0x0004, 0x0001, 0x0003, 0x0002,
+  0x0013, 0x0052, 0x008a, 0x00a5, 0x0025, 0x0026, 0x001a, 0x0002, 0x002a, 0x0001,
+  0x0062, 0x0001, 0x0001, 0x0002, 0x001d, 0x0058, 0x0020, 0x0001, 0x0015, 0x0018,
+  0x0014, 0x0007, 0x0035, 0x0009, 0x000f, 0x0007, 0x0001, 0x0015, 0x0006, 0x0003,
+  0x0001, 0x0002, 0x0001, 0x0005, 0x0001, 0x0015, 0x0006, 0x0001, 0x0001, 0x0001,
+  0x0003, 0x0002, 0x0008, 0x0002, 0x0015, 0x0006, 0x0001, 0x0004, 0x0001, 0x0007,
+  0x0001, 0x0015, 0x0006, 0x0001, 0x0004, 0x0001, 0x0002, 0x0005, 0x0002, 0x0003,
+  0x0001, 0x0001, 0x0001, 0x0002, 0x000b, 0x0007, 0x0002, 0x0016, 0x000f, 0x0002,
+  0x0001, 0x0007, 0x0002, 0x0016, 0x0009, 0x0004, 0x0001, 0x0001, 0x0007, 0x0002,
+  0x0028, 0x0002, 0x0002, 0x0005, 0x0011, 0x0017, 0x0008, 0x0006, 0x002f, 0x0001,
+  0x0006, 0x0001, 0x0001, 0x0003, 0x0006, 0x0002, 0x0001, 0x0003, 0x0001, 0x0004,
+  0x0003, 0x0007, 0x0023, 0x0004, 0x002a, 0x0005, 0x0003, 0x0001, 0x0002, 0x000c,
+  0x0025, 0x002a, 0x00ff, 0x004c, 0x0003, 0x0006, 0x0003, 0x0028, 0x0003, 0x0020,
+  0x0003, 0x0006, 0x0003, 0x000e, 0x0038, 0x0003, 0x0042, 0x000f, 0x0055, 0x0005,
+  0x00ff, 0x00ff, 0x006b, 0x0010, 0x0019, 0x004a, 0x000a, 0x000c, 0x0003, 0x0011,
+  0x0011, 0x000c, 0x0002, 0x0033, 0x0057, 0x0004, 0x0021, 0x0045, 0x001e, 0x001d,
+  0x0004, 0x002b, 0x0019, 0x0016, 0x0034, 0x002e, 0x0006, 0x001d, 0x0001, 0x002b,
+  0x0023, 0x0002, 0x0023, 0x0008, 0x0003, 0x0003, 0x0001, 0x00bf, 0x00ff, 0x0015,
+  0x0005, 0x0025, 0x0005, 0x0007, 0x001e, 0x0034, 0x0006, 0x0002, 0x0006, 0x0003,
+  0x0005, 0x000c, 0x0002, 0x0006, 0x000c, 0x0009, 0x0004, 0x0003, 0x000a, 0x0003,
+  0x0004, 0x0028, 0x002e, 0x002e, 0x0084, 0x0003, 0x0001, 0x0025, 0x0037, 0x0016,
+  0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0002, 0x0008,
+  0x0004, 0x0004, 0x0055, 0x0002, 0x0059, 0x0003, 0x0028, 0x005d, 0x001a, 0x000f,
+  0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x008c, 0x002d, 0x00ff, 0x000c, 0x000f, 0x0001,
+  0x002e, 0x001e, 0x004f, 0x0008, 0x0066, 0x0023, 0x0007, 0x000a, 0x0002, 0x0003,
+  0x0016, 0x0033, 0x0031, 0x0005, 0x001b, 0x0016, 0x001c, 0x002e, 0x0004, 0x0009,
+  0x0004, 0x0028, 0x0002, 0x0007, 0x0016, 0x0031, 0x0001, 0x0004, 0x0002, 0x000a,
+  0x0002, 0x0005, 0x0005, 0x0005, 0x0006, 0x0006, 0x002a, 0x0009, 0x0072, 0x0016,
+  0x0030, 0x00ff, 0x006d, 0x0069, 0x0006, 0x0004, 0x0009, 0x000c, 0x0004, 0x0001,
+  0x0001, 0x006b, 0x00ff, 0x006a, 0x003f, 0x0035, 0x000b, 0x0004, 0x0086, 0x0019,
+  0x0019, 0x0058, 0x0005, 0x0005, 0x0005, 0x0002
+};
+
+/**
+ * Those unicode letter characters that are not inside any of
+ * the intervals specified in lit_unicode_letter_interval_sps array.
+ *
+ * The characters are from the following Unicode categories:
+ * Lu, Ll, Lt, Lm, Lo, Nl
+ */
+static const uint16_t lit_unicode_letter_chars[] JERRY_CONST_DATA =
+{
+  0x00aa, 0x00b5, 0x00ba, 0x02ec, 0x02ee, 0x037f, 0x0386, 0x038c, 0x0559, 0x06d5,
+  0x06ff, 0x0710, 0x07b1, 0x07fa, 0x081a, 0x0824, 0x0828, 0x093d, 0x0950, 0x09b2,
+  0x09bd, 0x09ce, 0x0a5e, 0x0abd, 0x0ad0, 0x0af9, 0x0b3d, 0x0b71, 0x0b83, 0x0b9c,
+  0x0bd0, 0x0c3d, 0x0c80, 0x0cbd, 0x0cde, 0x0d3d, 0x0d4e, 0x0dbd, 0x0e84, 0x0e8a,
+  0x0e8d, 0x0ea5, 0x0ea7, 0x0ebd, 0x0ec6, 0x0f00, 0x103f, 0x1061, 0x108e, 0x10c7,
+  0x10cd, 0x1258, 0x12c0, 0x17d7, 0x17dc, 0x18aa, 0x1aa7, 0x1f59, 0x1f5b, 0x1f5d,
+  0x1fbe, 0x2071, 0x207f, 0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128, 0x214e,
+  0x2d27, 0x2d2d, 0x2d6f, 0x2e2f, 0x3400, 0x4db5, 0x4e00, 0x9fd5, 0xa8fb, 0xa8fd,
+  0xa9cf, 0xaa7a, 0xaab1, 0xaac0, 0xaac2, 0xac00, 0xd7a3, 0xfb1d, 0xfb3e
+};
+
+/**
+ * Character interval starting points for non-letter character
+ * that can be used as a non-first character of an identifier.
+ *
+ * The characters covered by these intervals are from
+ * the following Unicode categories: Nd, Mn, Mc, Pc
+ */
+static const uint16_t lit_unicode_non_letter_ident_part_interval_sps[] JERRY_CONST_DATA =
+{
+  0x0300, 0x0483, 0x0591, 0x05c1, 0x05c4, 0x0610, 0x064b, 0x06d6, 0x06df, 0x06e7,
+  0x06ea, 0x06f0, 0x0730, 0x07a6, 0x07c0, 0x07eb, 0x0816, 0x081b, 0x0825, 0x0829,
+  0x0859, 0x08d4, 0x08e3, 0x093a, 0x093e, 0x0951, 0x0962, 0x0966, 0x0981, 0x09be,
+  0x09c7, 0x09cb, 0x09e2, 0x09e6, 0x0a01, 0x0a3e, 0x0a47, 0x0a4b, 0x0a66, 0x0a81,
+  0x0abe, 0x0ac7, 0x0acb, 0x0ae2, 0x0ae6, 0x0b01, 0x0b3e, 0x0b47, 0x0b4b, 0x0b56,
+  0x0b62, 0x0b66, 0x0bbe, 0x0bc6, 0x0bca, 0x0be6, 0x0c00, 0x0c3e, 0x0c46, 0x0c4a,
+  0x0c55, 0x0c62, 0x0c66, 0x0c81, 0x0cbe, 0x0cc6, 0x0cca, 0x0cd5, 0x0ce2, 0x0ce6,
+  0x0d01, 0x0d3e, 0x0d46, 0x0d4a, 0x0d62, 0x0d66, 0x0d82, 0x0dcf, 0x0dd8, 0x0de6,
+  0x0df2, 0x0e34, 0x0e47, 0x0e50, 0x0eb4, 0x0ebb, 0x0ec8, 0x0ed0, 0x0f18, 0x0f20,
+  0x0f3e, 0x0f71, 0x0f86, 0x0f8d, 0x0f99, 0x102b, 0x1040, 0x1056, 0x105e, 0x1062,
+  0x1067, 0x1071, 0x1082, 0x108f, 0x135d, 0x1712, 0x1732, 0x1752, 0x1772, 0x17b4,
+  0x17e0, 0x180b, 0x1810, 0x1885, 0x1920, 0x1930, 0x1946, 0x19d0, 0x1a17, 0x1a55,
+  0x1a60, 0x1a7f, 0x1a90, 0x1ab0, 0x1b00, 0x1b34, 0x1b50, 0x1b6b, 0x1b80, 0x1ba1,
+  0x1bb0, 0x1be6, 0x1c24, 0x1c40, 0x1c50, 0x1cd0, 0x1cd4, 0x1cf2, 0x1cf8, 0x1dc0,
+  0x1dfb, 0x203f, 0x20d0, 0x20e5, 0x2cef, 0x2de0, 0x302a, 0x3099, 0xa620, 0xa674,
+  0xa69e, 0xa6f0, 0xa823, 0xa880, 0xa8b4, 0xa8d0, 0xa8e0, 0xa900, 0xa926, 0xa947,
+  0xa980, 0xa9b3, 0xa9d0, 0xa9f0, 0xaa29, 0xaa4c, 0xaa50, 0xaa7b, 0xaab2, 0xaab7,
+  0xaabe, 0xaaeb, 0xaaf5, 0xabe3, 0xabec, 0xabf0, 0xfe00, 0xfe20, 0xfe33, 0xfe4d,
+  0xff10
+};
+
+/**
+ * Character interval lengths for non-letter character
+ * that can be used as a non-first character of an identifier.
+ *
+ * The characters covered by these intervals are from
+ * the following Unicode categories: Nd, Mn, Mc, Pc
+ */
+static const uint8_t lit_unicode_non_letter_ident_part_interval_lengths[] JERRY_CONST_DATA =
+{
+  0x006f, 0x0004, 0x002c, 0x0001, 0x0001, 0x000a, 0x001e, 0x0006, 0x0005, 0x0001,
+  0x0003, 0x0009, 0x001a, 0x000a, 0x0009, 0x0008, 0x0003, 0x0008, 0x0002, 0x0004,
+  0x0002, 0x000d, 0x0020, 0x0002, 0x0011, 0x0006, 0x0001, 0x0009, 0x0002, 0x0006,
+  0x0001, 0x0002, 0x0001, 0x0009, 0x0002, 0x0004, 0x0001, 0x0002, 0x000b, 0x0002,
+  0x0007, 0x0002, 0x0002, 0x0001, 0x0009, 0x0002, 0x0006, 0x0001, 0x0002, 0x0001,
+  0x0001, 0x0009, 0x0004, 0x0002, 0x0003, 0x0009, 0x0003, 0x0006, 0x0002, 0x0003,
+  0x0001, 0x0001, 0x0009, 0x0002, 0x0006, 0x0002, 0x0003, 0x0001, 0x0001, 0x0009,
+  0x0002, 0x0006, 0x0002, 0x0003, 0x0001, 0x0009, 0x0001, 0x0005, 0x0007, 0x0009,
+  0x0001, 0x0006, 0x0007, 0x0009, 0x0005, 0x0001, 0x0005, 0x0009, 0x0001, 0x0009,
+  0x0001, 0x0013, 0x0001, 0x000a, 0x0023, 0x0013, 0x0009, 0x0003, 0x0002, 0x0002,
+  0x0006, 0x0003, 0x000b, 0x000e, 0x0002, 0x0002, 0x0002, 0x0001, 0x0001, 0x001f,
+  0x0009, 0x0002, 0x0009, 0x0001, 0x000b, 0x000b, 0x0009, 0x0009, 0x0004, 0x0009,
+  0x001c, 0x000a, 0x0009, 0x000d, 0x0004, 0x0010, 0x0009, 0x0008, 0x0002, 0x000c,
+  0x0009, 0x000d, 0x0013, 0x0009, 0x0009, 0x0002, 0x0014, 0x0002, 0x0001, 0x0035,
+  0x0004, 0x0001, 0x000c, 0x000b, 0x0002, 0x001f, 0x0005, 0x0001, 0x0009, 0x0009,
+  0x0001, 0x0001, 0x0004, 0x0001, 0x0011, 0x0009, 0x0011, 0x0009, 0x0007, 0x000c,
+  0x0003, 0x000d, 0x0009, 0x0009, 0x000d, 0x0001, 0x0009, 0x0002, 0x0002, 0x0001,
+  0x0001, 0x0004, 0x0001, 0x0007, 0x0001, 0x0009, 0x000f, 0x000f, 0x0001, 0x0002,
+  0x0009
+};
+
+/**
+ * Those non-letter characters that can be used as a non-first
+ * character of an identifier and not included in any of the intervals
+ * specified in lit_unicode_non_letter_ident_part_interval_sps array.
+ *
+ * The characters are from the following Unicode categories:
+ * Nd, Mn, Mc, Pc
+ */
+static const uint16_t lit_unicode_non_letter_ident_part_chars[] JERRY_CONST_DATA =
+{
+  0x05bf, 0x05c7, 0x0670, 0x0711, 0x09bc, 0x09d7, 0x0a3c, 0x0a51, 0x0a75, 0x0abc,
+  0x0b3c, 0x0b82, 0x0bd7, 0x0cbc, 0x0d57, 0x0dca, 0x0dd6, 0x0e31, 0x0eb1, 0x0f35,
+  0x0f37, 0x0f39, 0x0fc6, 0x17dd, 0x18a9, 0x1ced, 0x2054, 0x20e1, 0x2d7f, 0xa66f,
+  0xa802, 0xa806, 0xa80b, 0xa9e5, 0xaa43, 0xaab0, 0xaac1, 0xfb1e, 0xff3f
+};
+
+/**
+ * Unicode separator character interval starting points from Unicode category: Zs
+ */
+static const uint16_t lit_unicode_separator_char_interval_sps[] JERRY_CONST_DATA =
+{
+  0x2000
+};
+
+/**
+ * Unicode separator character interval lengths from Unicode category: Zs
+ */
+static const uint8_t lit_unicode_separator_char_interval_lengths[] JERRY_CONST_DATA =
+{
+  0x000b
+};
+
+/**
+ * Unicode separator characters that are not in the
+ * lit_unicode_separator_char_intervals array.
+ *
+ * Unicode category: Zs
+ */
+static const uint16_t lit_unicode_separator_chars[] JERRY_CONST_DATA =
+{
+  0x1680, 0x180e, 0x202f, 0x205f, 0x3000
+};
diff --git a/deps/jerry/jerry-core/parser/js/byte-code.c b/deps/jerry/jerry-core/parser/js/byte-code.c
new file mode 100644 (file)
index 0000000..9ee17b7
--- /dev/null
@@ -0,0 +1,87 @@
+/* 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.
+ */
+
+#include "js-parser-internal.h"
+
+JERRY_STATIC_ASSERT ((sizeof (cbc_uint8_arguments_t) % sizeof (jmem_cpointer_t)) == 0,
+                     sizeof_cbc_uint8_arguments_t_must_be_divisible_by_sizeof_jmem_cpointer_t);
+
+JERRY_STATIC_ASSERT ((sizeof (cbc_uint16_arguments_t) % sizeof (jmem_cpointer_t)) == 0,
+                     sizeof_cbc_uint16_arguments_t_must_be_divisible_by_sizeof_jmem_cpointer_t);
+
+#if JERRY_JS_PARSER
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_bytecode Bytecode
+ * @{
+ */
+
+#define CBC_OPCODE(arg1, arg2, arg3, arg4) \
+  ((arg2) | (((arg3) + CBC_STACK_ADJUST_BASE) << CBC_STACK_ADJUST_SHIFT)),
+
+/**
+ * Flags of the opcodes.
+ */
+const uint8_t cbc_flags[] JERRY_CONST_DATA =
+{
+  CBC_OPCODE_LIST
+};
+
+/**
+ * Flags of the extended opcodes.
+ */
+const uint8_t cbc_ext_flags[] =
+{
+  CBC_EXT_OPCODE_LIST
+};
+
+#undef CBC_OPCODE
+
+#ifdef PARSER_DUMP_BYTE_CODE
+
+#define CBC_OPCODE(arg1, arg2, arg3, arg4) #arg1,
+
+/**
+ * Names of the opcodes.
+ */
+const char * const cbc_names[] =
+{
+  CBC_OPCODE_LIST
+};
+
+/**
+ * Names of the extended opcodes.
+ */
+const char * const cbc_ext_names[] =
+{
+  CBC_EXT_OPCODE_LIST
+};
+
+#undef CBC_OPCODE
+
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* JERRY_JS_PARSER */
diff --git a/deps/jerry/jerry-core/parser/js/byte-code.h b/deps/jerry/jerry-core/parser/js/byte-code.h
new file mode 100644 (file)
index 0000000..0eb3522
--- /dev/null
@@ -0,0 +1,701 @@
+/* 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.
+ */
+
+#ifndef BYTE_CODE_H
+#define BYTE_CODE_H
+
+#include "ecma-globals.h"
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_bytecode Bytecode
+ * @{
+ */
+
+/**
+ * Compact byte code (CBC) is a byte code representation
+ * of EcmaScript which is designed for low memory
+ * environments. Most opcodes are only one or sometimes
+ * two byte long so the CBC provides a small binary size.
+ *
+ * The execution engine of CBC is a stack machine, where
+ * the maximum stack size is known in advance for each
+ * function.
+ */
+
+/**
+ * Byte code flags. Only the lower 5 bit can be used
+ * since the stack change is encoded in the upper
+ * three bits for each instruction between -4 and 3
+ * (except for call / construct opcodes).
+ */
+#define CBC_STACK_ADJUST_BASE          4
+#define CBC_STACK_ADJUST_SHIFT         5
+#define CBC_STACK_ADJUST_VALUE(value)  \
+  (((value) >> CBC_STACK_ADJUST_SHIFT) - CBC_STACK_ADJUST_BASE)
+
+#define CBC_NO_FLAG                    0x00u
+#define CBC_HAS_LITERAL_ARG            0x01u
+#define CBC_HAS_LITERAL_ARG2           0x02u
+#define CBC_HAS_BYTE_ARG               0x04u
+#define CBC_HAS_BRANCH_ARG             0x08u
+
+/* These flags are shared */
+#define CBC_FORWARD_BRANCH_ARG         0x10u
+#define CBC_POP_STACK_BYTE_ARG         0x10u
+
+#define CBC_ARG_TYPES (CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2 | CBC_HAS_BYTE_ARG | CBC_HAS_BRANCH_ARG)
+
+#define CBC_HAS_POP_STACK_BYTE_ARG (CBC_HAS_BYTE_ARG | CBC_POP_STACK_BYTE_ARG)
+
+/* Debug macro. */
+#define CBC_ARGS_EQ(op, types) \
+  ((cbc_flags[op] & CBC_ARG_TYPES) == (types))
+
+/* Debug macro. */
+#define CBC_SAME_ARGS(op1, op2) \
+  ((cbc_flags[op1] & CBC_ARG_TYPES) == (cbc_flags[op2] & CBC_ARG_TYPES))
+
+#define CBC_UNARY_OPERATION(name, group) \
+  CBC_OPCODE (name, CBC_NO_FLAG, 0, \
+              (VM_OC_ ## group) | VM_OC_GET_STACK | VM_OC_PUT_STACK) \
+  CBC_OPCODE (name ## _LITERAL, CBC_HAS_LITERAL_ARG, 1, \
+              (VM_OC_ ## group) | VM_OC_GET_LITERAL | VM_OC_PUT_STACK)
+
+#define CBC_BINARY_OPERATION(name, group) \
+  CBC_OPCODE (name, CBC_NO_FLAG, -1, \
+              (VM_OC_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_STACK) \
+  CBC_OPCODE (name ## _RIGHT_LITERAL, CBC_HAS_LITERAL_ARG, 0, \
+              (VM_OC_ ## group) | VM_OC_GET_STACK_LITERAL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (name ## _TWO_LITERALS, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 1, \
+              (VM_OC_ ## group) | VM_OC_GET_LITERAL_LITERAL | VM_OC_PUT_STACK)
+
+#define CBC_UNARY_LVALUE_OPERATION(name, group) \
+  CBC_OPCODE (name, CBC_NO_FLAG, -2, \
+              (VM_OC_PROP_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_REFERENCE) \
+  CBC_OPCODE (name ## _PUSH_RESULT, CBC_NO_FLAG, -1, \
+              (VM_OC_PROP_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_REFERENCE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (name ## _BLOCK, CBC_NO_FLAG, -2, \
+              (VM_OC_PROP_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_REFERENCE | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (name ## _IDENT, CBC_HAS_LITERAL_ARG, 0, \
+              (VM_OC_ ## group) | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT) \
+  CBC_OPCODE (name ## _IDENT_PUSH_RESULT, CBC_HAS_LITERAL_ARG, 1, \
+              (VM_OC_ ## group) | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT | VM_OC_PUT_STACK) \
+  CBC_OPCODE (name ## _IDENT_BLOCK, CBC_HAS_LITERAL_ARG, 0, \
+              (VM_OC_ ## group) | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT | VM_OC_PUT_BLOCK)
+
+#define CBC_BINARY_LVALUE_OPERATION(name, group) \
+  CBC_OPCODE (name, CBC_NO_FLAG, -4, \
+              (VM_OC_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_REFERENCE) \
+  CBC_OPCODE (name ## _LITERAL, CBC_HAS_LITERAL_ARG, -3, \
+              (VM_OC_ ## group) | VM_OC_GET_STACK_LITERAL | VM_OC_PUT_REFERENCE) \
+
+#define CBC_EXT_BINARY_LVALUE_OPERATION(name, group) \
+  CBC_OPCODE (name ## _PUSH_RESULT, CBC_NO_FLAG, -3, \
+              (VM_OC_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_REFERENCE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (name ## _LITERAL_PUSH_RESULT, CBC_HAS_LITERAL_ARG, -2, \
+              (VM_OC_ ## group) | VM_OC_GET_STACK_LITERAL | VM_OC_PUT_REFERENCE | VM_OC_PUT_STACK) \
+
+#define CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION(name, group) \
+  CBC_OPCODE (name ## _BLOCK, CBC_NO_FLAG, -4, \
+              (VM_OC_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_REFERENCE | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (name ## _LITERAL_BLOCK, CBC_HAS_LITERAL_ARG, -3, \
+              (VM_OC_ ## group) | VM_OC_GET_STACK_LITERAL | VM_OC_PUT_REFERENCE | VM_OC_PUT_BLOCK) \
+
+#define CBC_UNARY_LVALUE_WITH_IDENT 3
+
+#define CBC_BINARY_LVALUE_WITH_LITERAL 1
+
+#define CBC_BINARY_WITH_LITERAL 1
+#define CBC_BINARY_WITH_TWO_LITERALS 2
+
+/**
+ * Several opcodes (mostly call and assignment opcodes) have
+ * two forms: one which does not push a return value onto
+ * the stack, and another which does. The reasion is that
+ * the return value of these opcodes are often not used
+ * and the first form provides smaller byte code.
+ *
+ * The following rules must be kept by the code generator:
+ *  - only the opcode without return value can be emitted
+ *    by the code generator
+ *  - the first form can be converted to the second form
+ *    by adding 1 to the opcode
+ *  - after the conversion the opcode must be immediately
+ *    flushed, so no further changes are possible
+ *
+ * Hence CBC_NO_RESULT_OPERATION (context_p->last_cbc_opcode)
+ * cannot be true for an opcode which has a result
+ */
+
+#define CBC_NO_RESULT_OPERATION(opcode) \
+  ((opcode) >= CBC_PRE_INCR && (opcode) < CBC_END)
+
+#define CBC_NO_RESULT_BLOCK(opcode) \
+  ((opcode) >= CBC_PRE_INCR && (opcode) < CBC_ASSIGN_ADD)
+
+#define CBC_NO_RESULT_COMPOUND_ASSIGMENT(opcode) \
+  ((opcode) >= CBC_ASSIGN_ADD && (opcode) < CBC_END)
+
+/**
+ * Branch instructions are organized in group of 8 opcodes.
+ *  - 1st opcode: unused, can be used for other purpose
+ *  - 2nd opcode: forward branch with 1 byte offset
+ *  - 3rd opcode: forward branch with 2 byte offset
+ *  - 4th opcode: forward branch with 3 byte offset
+ *  - 5th opcode: unused, can be used for other purpose
+ *  - 6th opcode: backward branch with 1 byte offset
+ *  - 7th opcode: backward branch with 2 byte offset
+ *  - 8th opcode: backward branch with 3 byte offset
+ *
+ * Reasons:
+ *  The branch_opcode & 0x3 tells the length in bytes of the offset
+ *  If branch offset & 0x4 == 0, it is a forward branch. Otherwise
+ *  it is backward.
+ *
+ * The offset bytes are encoded in higher to lower order.
+ */
+
+#define CBC_FORWARD_BRANCH(name, stack, vm_oc) \
+  CBC_OPCODE (name, CBC_HAS_BRANCH_ARG | CBC_FORWARD_BRANCH_ARG, stack, \
+              (vm_oc) | VM_OC_GET_BRANCH) \
+  CBC_OPCODE (name ## _2, CBC_HAS_BRANCH_ARG | CBC_FORWARD_BRANCH_ARG, stack, \
+              (vm_oc) | VM_OC_GET_BRANCH) \
+  CBC_OPCODE (name ## _3, CBC_HAS_BRANCH_ARG | CBC_FORWARD_BRANCH_ARG, stack, \
+              (vm_oc) | VM_OC_GET_BRANCH)
+
+#define CBC_BACKWARD_BRANCH(name, stack, vm_oc) \
+  CBC_OPCODE (name, CBC_HAS_BRANCH_ARG, stack, \
+              (vm_oc) | VM_OC_GET_BRANCH | VM_OC_BACKWARD_BRANCH) \
+  CBC_OPCODE (name ## _2, CBC_HAS_BRANCH_ARG, stack, \
+              (vm_oc) | VM_OC_GET_BRANCH | VM_OC_BACKWARD_BRANCH) \
+  CBC_OPCODE (name ## _3, CBC_HAS_BRANCH_ARG, stack, \
+              (vm_oc) | VM_OC_GET_BRANCH | VM_OC_BACKWARD_BRANCH)
+
+#define CBC_BRANCH_OFFSET_LENGTH(opcode) \
+  ((opcode) & 0x3)
+
+#define CBC_BRANCH_IS_BACKWARD(flags) \
+  (!((flags) & CBC_FORWARD_BRANCH_ARG))
+
+#define CBC_BRANCH_IS_FORWARD(flags) \
+  ((flags) & CBC_FORWARD_BRANCH_ARG)
+
+/* Stack consumption of opcodes with context. */
+
+/* PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION must be <= 4 */
+#define PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION 3
+/* PARSER_WITH_CONTEXT_STACK_ALLOCATION must be <= 4 */
+#define PARSER_WITH_CONTEXT_STACK_ALLOCATION 2
+/* PARSER_TRY_CONTEXT_STACK_ALLOCATION must be <= 3 */
+#define PARSER_TRY_CONTEXT_STACK_ALLOCATION 2
+
+/**
+ * Opcode definitions.
+ */
+#define CBC_OPCODE_LIST \
+  /* Branch opcodes first. Some other opcodes are mixed. */ \
+  CBC_OPCODE (CBC_EXT_OPCODE, CBC_NO_FLAG, 0, \
+              VM_OC_NONE) \
+  CBC_FORWARD_BRANCH (CBC_JUMP_FORWARD, 0, \
+                      VM_OC_JUMP) \
+  CBC_OPCODE (CBC_POP, CBC_NO_FLAG, -1, \
+              VM_OC_POP) \
+  CBC_BACKWARD_BRANCH (CBC_JUMP_BACKWARD, 0, \
+                       VM_OC_JUMP) \
+  CBC_OPCODE (CBC_POP_BLOCK, CBC_NO_FLAG, -1, \
+              VM_OC_POP_BLOCK | VM_OC_PUT_BLOCK) \
+  CBC_FORWARD_BRANCH (CBC_BRANCH_IF_TRUE_FORWARD, -1, \
+                      VM_OC_BRANCH_IF_TRUE) \
+  CBC_OPCODE (CBC_THROW, CBC_NO_FLAG, -1, \
+              VM_OC_THROW | VM_OC_GET_STACK) \
+  CBC_BACKWARD_BRANCH (CBC_BRANCH_IF_TRUE_BACKWARD, -1, \
+                       VM_OC_BRANCH_IF_TRUE) \
+  CBC_OPCODE (CBC_CONTEXT_END, CBC_NO_FLAG, 0, \
+              VM_OC_CONTEXT_END) \
+  CBC_FORWARD_BRANCH (CBC_BRANCH_IF_FALSE_FORWARD, -1, \
+                      VM_OC_BRANCH_IF_FALSE) \
+  CBC_OPCODE (CBC_CREATE_OBJECT, CBC_NO_FLAG, 1, \
+              VM_OC_PUSH_OBJECT | VM_OC_PUT_STACK) \
+  CBC_BACKWARD_BRANCH (CBC_BRANCH_IF_FALSE_BACKWARD, -1, \
+                       VM_OC_BRANCH_IF_FALSE) \
+  CBC_OPCODE (CBC_SET_PROPERTY, CBC_HAS_LITERAL_ARG, -1, \
+              VM_OC_SET_PROPERTY | VM_OC_GET_STACK_LITERAL) \
+  CBC_FORWARD_BRANCH (CBC_JUMP_FORWARD_EXIT_CONTEXT, 0, \
+                      VM_OC_JUMP_AND_EXIT_CONTEXT) \
+  CBC_OPCODE (CBC_CREATE_ARRAY, CBC_NO_FLAG, 1, \
+              VM_OC_PUSH_ARRAY | VM_OC_PUT_STACK) \
+  CBC_FORWARD_BRANCH (CBC_BRANCH_IF_LOGICAL_TRUE, -1, \
+                      VM_OC_BRANCH_IF_LOGICAL_TRUE) \
+  CBC_OPCODE (CBC_ARRAY_APPEND, CBC_HAS_POP_STACK_BYTE_ARG, 0, \
+              VM_OC_APPEND_ARRAY) \
+  CBC_FORWARD_BRANCH (CBC_BRANCH_IF_LOGICAL_FALSE, -1, \
+                      VM_OC_BRANCH_IF_LOGICAL_FALSE) \
+  CBC_OPCODE (CBC_PUSH_ELISION, CBC_NO_FLAG, 1, \
+              VM_OC_PUSH_ELISON | VM_OC_PUT_STACK) \
+  CBC_FORWARD_BRANCH (CBC_BRANCH_IF_STRICT_EQUAL, -1, \
+                      VM_OC_BRANCH_IF_STRICT_EQUAL) \
+  \
+  /* Basic opcodes. */ \
+  CBC_OPCODE (CBC_PUSH_LITERAL, CBC_HAS_LITERAL_ARG, 1, \
+              VM_OC_PUSH | VM_OC_GET_LITERAL) \
+  CBC_OPCODE (CBC_PUSH_TWO_LITERALS, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 2, \
+              VM_OC_PUSH_TWO | VM_OC_GET_LITERAL_LITERAL) \
+  CBC_OPCODE (CBC_PUSH_THREE_LITERALS, CBC_HAS_LITERAL_ARG2, 3, \
+              VM_OC_PUSH_THREE | VM_OC_GET_LITERAL_LITERAL) \
+  CBC_OPCODE (CBC_PUSH_UNDEFINED, CBC_NO_FLAG, 1, \
+              VM_OC_PUSH_UNDEFINED | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_TRUE, CBC_NO_FLAG, 1, \
+              VM_OC_PUSH_TRUE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_FALSE, CBC_NO_FLAG, 1, \
+              VM_OC_PUSH_FALSE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_NULL, CBC_NO_FLAG, 1, \
+              VM_OC_PUSH_NULL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_THIS, CBC_NO_FLAG, 1, \
+              VM_OC_PUSH_THIS | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_THIS_LITERAL, CBC_HAS_LITERAL_ARG, 2, \
+              VM_OC_PUSH_TWO | VM_OC_GET_THIS_LITERAL) \
+  CBC_OPCODE (CBC_PUSH_NUMBER_0, CBC_NO_FLAG, 1, \
+              VM_OC_PUSH_NUMBER_0 | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_NUMBER_POS_BYTE, CBC_HAS_BYTE_ARG, 1, \
+              VM_OC_PUSH_NUMBER_POS_BYTE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_NUMBER_NEG_BYTE, CBC_HAS_BYTE_ARG, 1, \
+              VM_OC_PUSH_NUMBER_NEG_BYTE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_PROP, CBC_NO_FLAG, -1, \
+              VM_OC_PROP_GET | VM_OC_GET_STACK_STACK | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_PROP_LITERAL, CBC_HAS_LITERAL_ARG, 0, \
+              VM_OC_PROP_GET | VM_OC_GET_STACK_LITERAL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_PROP_LITERAL_LITERAL, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 1, \
+              VM_OC_PROP_GET | VM_OC_GET_LITERAL_LITERAL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_PROP_THIS_LITERAL, CBC_HAS_LITERAL_ARG, 1, \
+              VM_OC_PROP_GET | VM_OC_GET_THIS_LITERAL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_IDENT_REFERENCE, CBC_HAS_LITERAL_ARG, 3, \
+              VM_OC_IDENT_REFERENCE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_PROP_REFERENCE, CBC_NO_FLAG, 1, \
+              VM_OC_PROP_REFERENCE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_PROP_LITERAL_REFERENCE, CBC_HAS_LITERAL_ARG, 2, \
+              VM_OC_PROP_REFERENCE | VM_OC_GET_LITERAL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_PROP_LITERAL_LITERAL_REFERENCE, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 3, \
+              VM_OC_PROP_REFERENCE | VM_OC_GET_LITERAL_LITERAL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_PUSH_PROP_THIS_LITERAL_REFERENCE, CBC_HAS_LITERAL_ARG, 3, \
+              VM_OC_PROP_REFERENCE | VM_OC_GET_THIS_LITERAL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_NEW, CBC_HAS_POP_STACK_BYTE_ARG, 0, \
+              VM_OC_NEW | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_NEW0, CBC_NO_FLAG, 0, \
+              VM_OC_NEW | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_NEW1, CBC_NO_FLAG, -1, \
+              VM_OC_NEW | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_EVAL, CBC_NO_FLAG, 0, \
+              VM_OC_EVAL) \
+  CBC_OPCODE (CBC_DEFINE_VARS, CBC_HAS_LITERAL_ARG, 0, \
+              VM_OC_NONE) \
+  CBC_OPCODE (CBC_INITIALIZE_VAR, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \
+              VM_OC_NONE) \
+  CBC_OPCODE (CBC_INITIALIZE_VARS, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \
+              VM_OC_NONE) \
+  CBC_OPCODE (CBC_SET_BYTECODE_PTR, CBC_NO_FLAG, 0, \
+              VM_OC_NONE) \
+  CBC_OPCODE (CBC_RETURN, CBC_NO_FLAG, -1, \
+              VM_OC_RET | VM_OC_GET_STACK) \
+  CBC_OPCODE (CBC_RETURN_WITH_BLOCK, CBC_NO_FLAG, 0, \
+              VM_OC_RET) \
+  CBC_OPCODE (CBC_RETURN_WITH_LITERAL, CBC_HAS_LITERAL_ARG, 0, \
+              VM_OC_RET | VM_OC_GET_LITERAL) \
+  CBC_OPCODE (CBC_BREAKPOINT_ENABLED, CBC_NO_FLAG, 0, \
+              VM_OC_BREAKPOINT_ENABLED) \
+  CBC_OPCODE (CBC_BREAKPOINT_DISABLED, CBC_NO_FLAG, 0, \
+              VM_OC_BREAKPOINT_DISABLED) \
+  \
+  /* Unary opcodes. */ \
+  CBC_UNARY_OPERATION (CBC_PLUS, \
+                       PLUS) \
+  CBC_UNARY_OPERATION (CBC_NEGATE, \
+                       MINUS) \
+  CBC_UNARY_OPERATION (CBC_LOGICAL_NOT, \
+                       NOT) \
+  CBC_UNARY_OPERATION (CBC_BIT_NOT, \
+                       BIT_NOT) \
+  CBC_UNARY_OPERATION (CBC_VOID, \
+                       VOID) \
+  CBC_OPCODE (CBC_TYPEOF, CBC_NO_FLAG, 0, \
+              VM_OC_TYPEOF | VM_OC_GET_STACK | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_TYPEOF_IDENT, CBC_HAS_LITERAL_ARG, 1, \
+              VM_OC_TYPEOF_IDENT | VM_OC_PUT_STACK) \
+  \
+  /* Binary opcodes. */ \
+  CBC_BINARY_OPERATION (CBC_BIT_OR, \
+                        BIT_OR) \
+  CBC_BINARY_OPERATION (CBC_BIT_XOR, \
+                        BIT_XOR) \
+  CBC_BINARY_OPERATION (CBC_BIT_AND, \
+                        BIT_AND) \
+  CBC_BINARY_OPERATION (CBC_EQUAL, \
+                        EQUAL) \
+  CBC_BINARY_OPERATION (CBC_NOT_EQUAL, \
+                        NOT_EQUAL) \
+  CBC_BINARY_OPERATION (CBC_STRICT_EQUAL, \
+                        STRICT_EQUAL) \
+  CBC_BINARY_OPERATION (CBC_STRICT_NOT_EQUAL, \
+                        STRICT_NOT_EQUAL) \
+  CBC_BINARY_OPERATION (CBC_LESS, \
+                        LESS) \
+  CBC_BINARY_OPERATION (CBC_GREATER, \
+                        GREATER) \
+  CBC_BINARY_OPERATION (CBC_LESS_EQUAL, \
+                        LESS_EQUAL) \
+  CBC_BINARY_OPERATION (CBC_GREATER_EQUAL, \
+                        GREATER_EQUAL) \
+  CBC_BINARY_OPERATION (CBC_IN, \
+                        IN) \
+  CBC_BINARY_OPERATION (CBC_INSTANCEOF, \
+                        INSTANCEOF) \
+  CBC_BINARY_OPERATION (CBC_LEFT_SHIFT, \
+                        LEFT_SHIFT) \
+  CBC_BINARY_OPERATION (CBC_RIGHT_SHIFT, \
+                        RIGHT_SHIFT) \
+  CBC_BINARY_OPERATION (CBC_UNS_RIGHT_SHIFT, \
+                        UNS_RIGHT_SHIFT) \
+  CBC_BINARY_OPERATION (CBC_ADD, \
+                        ADD) \
+  CBC_BINARY_OPERATION (CBC_SUBTRACT, \
+                        SUB) \
+  CBC_BINARY_OPERATION (CBC_MULTIPLY, \
+                        MUL) \
+  CBC_BINARY_OPERATION (CBC_DIVIDE, \
+                        DIV) \
+  CBC_BINARY_OPERATION (CBC_MODULO, \
+                        MOD) \
+  \
+  /* Unary lvalue opcodes. */ \
+  CBC_OPCODE (CBC_DELETE_PUSH_RESULT, CBC_NO_FLAG, -1, \
+              VM_OC_PROP_DELETE | VM_OC_GET_STACK_STACK | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_DELETE_IDENT_PUSH_RESULT, CBC_HAS_LITERAL_ARG, 1, \
+              VM_OC_DELETE | VM_OC_PUT_STACK) \
+  CBC_UNARY_LVALUE_OPERATION (CBC_PRE_INCR, \
+                              PRE_INCR) \
+  CBC_UNARY_LVALUE_OPERATION (CBC_PRE_DECR, \
+                              PRE_DECR) \
+  CBC_UNARY_LVALUE_OPERATION (CBC_POST_INCR, \
+                              POST_INCR) \
+  CBC_UNARY_LVALUE_OPERATION (CBC_POST_DECR, \
+                              POST_DECR) \
+  \
+  /* Call opcodes. */ \
+  CBC_OPCODE (CBC_CALL, CBC_HAS_POP_STACK_BYTE_ARG, -1, \
+              VM_OC_CALL) \
+  CBC_OPCODE (CBC_CALL_PUSH_RESULT, CBC_HAS_POP_STACK_BYTE_ARG, 0, \
+              VM_OC_CALL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_CALL_BLOCK, CBC_HAS_POP_STACK_BYTE_ARG, -1, \
+              VM_OC_CALL | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_CALL_PROP, CBC_HAS_POP_STACK_BYTE_ARG, -3, \
+              VM_OC_CALL) \
+  CBC_OPCODE (CBC_CALL_PROP_PUSH_RESULT, CBC_HAS_POP_STACK_BYTE_ARG, -2, \
+              VM_OC_CALL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_CALL_PROP_BLOCK, CBC_HAS_POP_STACK_BYTE_ARG, -3, \
+              VM_OC_CALL | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_CALL0, CBC_NO_FLAG, -1, \
+              VM_OC_CALL) \
+  CBC_OPCODE (CBC_CALL0_PUSH_RESULT, CBC_NO_FLAG, 0, \
+              VM_OC_CALL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_CALL0_BLOCK, CBC_NO_FLAG, -1, \
+              VM_OC_CALL | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_CALL0_PROP, CBC_NO_FLAG, -3, \
+              VM_OC_CALL) \
+  CBC_OPCODE (CBC_CALL0_PROP_PUSH_RESULT, CBC_NO_FLAG, -2, \
+              VM_OC_CALL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_CALL0_PROP_BLOCK, CBC_NO_FLAG, -3, \
+              VM_OC_CALL | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_CALL1, CBC_NO_FLAG, -2, \
+              VM_OC_CALL) \
+  CBC_OPCODE (CBC_CALL1_PUSH_RESULT, CBC_NO_FLAG, -1, \
+              VM_OC_CALL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_CALL1_BLOCK, CBC_NO_FLAG, -2, \
+              VM_OC_CALL | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_CALL1_PROP, CBC_NO_FLAG, -4, \
+              VM_OC_CALL) \
+  CBC_OPCODE (CBC_CALL1_PROP_PUSH_RESULT, CBC_NO_FLAG, -3, \
+              VM_OC_CALL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_CALL1_PROP_BLOCK, CBC_NO_FLAG, -4, \
+              VM_OC_CALL | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_CALL2, CBC_NO_FLAG, -3, \
+              VM_OC_CALL) \
+  CBC_OPCODE (CBC_CALL2_PUSH_RESULT, CBC_NO_FLAG, -2, \
+              VM_OC_CALL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_CALL2_BLOCK, CBC_NO_FLAG, -3, \
+              VM_OC_CALL | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_CALL2_PROP, CBC_NO_FLAG, -4, \
+              VM_OC_CALL) \
+  CBC_OPCODE (CBC_CALL2_PROP_PUSH_RESULT, CBC_NO_FLAG, -3, \
+              VM_OC_CALL | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_CALL2_PROP_BLOCK, CBC_NO_FLAG, -4, \
+              VM_OC_CALL | VM_OC_PUT_BLOCK) \
+  \
+  /* Binary assignment opcodes. */ \
+  CBC_OPCODE (CBC_ASSIGN, CBC_NO_FLAG, -3, \
+              VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_REFERENCE) \
+  CBC_OPCODE (CBC_ASSIGN_PUSH_RESULT, CBC_NO_FLAG, -2, \
+              VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_REFERENCE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_ASSIGN_BLOCK, CBC_NO_FLAG, -3, \
+              VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_REFERENCE | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_ASSIGN_SET_IDENT, CBC_HAS_LITERAL_ARG, -1, \
+              VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_IDENT) \
+  CBC_OPCODE (CBC_ASSIGN_SET_IDENT_PUSH_RESULT, CBC_HAS_LITERAL_ARG, 0, \
+              VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_IDENT | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_ASSIGN_SET_IDENT_BLOCK, CBC_HAS_LITERAL_ARG, -1, \
+              VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_IDENT | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_ASSIGN_LITERAL_SET_IDENT, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \
+              VM_OC_ASSIGN | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT) \
+  CBC_OPCODE (CBC_ASSIGN_LITERAL_SET_IDENT_PUSH_RESULT, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 1, \
+              VM_OC_ASSIGN | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_ASSIGN_LITERAL_SET_IDENT_BLOCK, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \
+              VM_OC_ASSIGN | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_ASSIGN_PROP_LITERAL, CBC_HAS_LITERAL_ARG, -2, \
+              VM_OC_ASSIGN_PROP | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE) \
+  CBC_OPCODE (CBC_ASSIGN_PROP_LITERAL_PUSH_RESULT, CBC_HAS_LITERAL_ARG, -1, \
+              VM_OC_ASSIGN_PROP | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_ASSIGN_PROP_LITERAL_BLOCK, CBC_HAS_LITERAL_ARG, -2, \
+              VM_OC_ASSIGN_PROP | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE | VM_OC_PUT_BLOCK) \
+  CBC_OPCODE (CBC_ASSIGN_PROP_THIS_LITERAL, CBC_HAS_LITERAL_ARG, -1, \
+              VM_OC_ASSIGN_PROP_THIS | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE) \
+  CBC_OPCODE (CBC_ASSIGN_PROP_THIS_LITERAL_PUSH_RESULT, CBC_HAS_LITERAL_ARG, 0, \
+              VM_OC_ASSIGN_PROP_THIS | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE | VM_OC_PUT_STACK) \
+  CBC_OPCODE (CBC_ASSIGN_PROP_THIS_LITERAL_BLOCK, CBC_HAS_LITERAL_ARG, -1, \
+              VM_OC_ASSIGN_PROP_THIS | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE | VM_OC_PUT_BLOCK) \
+  \
+  /* Binary compound assignment opcodes. */ \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_ADD, \
+                               ADD) \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_SUBTRACT, \
+                               SUB) \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_MULTIPLY, \
+                               MUL) \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_DIVIDE, \
+                               DIV) \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_MODULO, \
+                               MOD) \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_LEFT_SHIFT, \
+                               LEFT_SHIFT) \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_RIGHT_SHIFT, \
+                               RIGHT_SHIFT) \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_UNS_RIGHT_SHIFT, \
+                               UNS_RIGHT_SHIFT) \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_BIT_AND, \
+                               BIT_AND) \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_BIT_OR, \
+                               BIT_OR) \
+  CBC_BINARY_LVALUE_OPERATION (CBC_ASSIGN_BIT_XOR, \
+                               BIT_XOR) \
+  \
+  /* Last opcode (not a real opcode). */ \
+  CBC_OPCODE (CBC_END, CBC_NO_FLAG, 0, \
+              VM_OC_NONE)
+
+/* All EXT branches are statement block end
+ * marks, so they are always forward branches. */
+
+#define CBC_EXT_OPCODE_LIST \
+  /* Branch opcodes first. Some other opcodes are mixed. */ \
+  CBC_OPCODE (CBC_EXT_NOP, CBC_NO_FLAG, 0, \
+              VM_OC_NONE) \
+  CBC_FORWARD_BRANCH (CBC_EXT_WITH_CREATE_CONTEXT, \
+                      -1 + PARSER_WITH_CONTEXT_STACK_ALLOCATION, VM_OC_WITH) \
+  CBC_OPCODE (CBC_EXT_FOR_IN_GET_NEXT, CBC_NO_FLAG, 1, \
+              VM_OC_FOR_IN_GET_NEXT | VM_OC_PUT_STACK) \
+  CBC_FORWARD_BRANCH (CBC_EXT_FOR_IN_CREATE_CONTEXT, \
+                      -1 + PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION, VM_OC_FOR_IN_CREATE_CONTEXT) \
+  CBC_OPCODE (CBC_EXT_SET_GETTER, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \
+              VM_OC_SET_GETTER | VM_OC_GET_LITERAL_LITERAL) \
+  CBC_BACKWARD_BRANCH (CBC_EXT_BRANCH_IF_FOR_IN_HAS_NEXT, 0, \
+                       VM_OC_FOR_IN_HAS_NEXT) \
+  CBC_OPCODE (CBC_EXT_SET_SETTER, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \
+              VM_OC_SET_SETTER | VM_OC_GET_LITERAL_LITERAL) \
+  CBC_FORWARD_BRANCH (CBC_EXT_TRY_CREATE_CONTEXT, PARSER_TRY_CONTEXT_STACK_ALLOCATION, \
+                      VM_OC_TRY) \
+  CBC_OPCODE (CBC_EXT_THROW_REFERENCE_ERROR, CBC_NO_FLAG, 1, \
+              VM_OC_THROW_REFERENCE_ERROR) \
+  CBC_FORWARD_BRANCH (CBC_EXT_CATCH, 1, \
+                      VM_OC_CATCH) \
+  CBC_OPCODE (CBC_EXT_PUSH_UNDEFINED_BASE, CBC_NO_FLAG, 1, \
+              VM_OC_PUSH_UNDEFINED_BASE | VM_OC_PUT_STACK) \
+  CBC_FORWARD_BRANCH (CBC_EXT_FINALLY, 0, \
+                      VM_OC_FINALLY) \
+  \
+  /* Basic opcodes. */ \
+  CBC_OPCODE (CBC_EXT_DEBUGGER, CBC_NO_FLAG, 0, \
+              VM_OC_NONE) \
+  \
+  /* Binary compound assignment opcodes with pushing the result. */ \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_ADD, \
+                                   ADD) \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_SUBTRACT, \
+                                   SUB) \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_MULTIPLY, \
+                                   MUL) \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_DIVIDE, \
+                                   DIV) \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_MODULO, \
+                                   MOD) \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_LEFT_SHIFT, \
+                                   LEFT_SHIFT) \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_RIGHT_SHIFT, \
+                                   RIGHT_SHIFT) \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_UNS_RIGHT_SHIFT, \
+                                   UNS_RIGHT_SHIFT) \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_BIT_AND, \
+                                   BIT_AND) \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_BIT_OR, \
+                                   BIT_OR) \
+  CBC_EXT_BINARY_LVALUE_OPERATION (CBC_EXT_ASSIGN_BIT_XOR, \
+                                   BIT_XOR) \
+  \
+  /* Binary compound assignment opcodes with saving the result. */ \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_ADD, \
+                                         ADD) \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_SUBTRACT, \
+                                         SUB) \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_MULTIPLY, \
+                                         MUL) \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_DIVIDE, \
+                                         DIV) \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_MODULO, \
+                                         MOD) \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_LEFT_SHIFT, \
+                                         LEFT_SHIFT) \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_RIGHT_SHIFT, \
+                                         RIGHT_SHIFT) \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_UNS_RIGHT_SHIFT, \
+                                         UNS_RIGHT_SHIFT) \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_BIT_AND, \
+                                         BIT_AND) \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_BIT_OR, \
+                                         BIT_OR) \
+  CBC_EXT_BINARY_LVALUE_BLOCK_OPERATION (CBC_EXT_ASSIGN_BIT_XOR, \
+                                         BIT_XOR) \
+  \
+  /* Last opcode (not a real opcode). */ \
+  CBC_OPCODE (CBC_EXT_END, CBC_NO_FLAG, 0, \
+              VM_OC_NONE)
+
+#define CBC_MAXIMUM_BYTE_VALUE 255
+#define CBC_MAXIMUM_SMALL_VALUE 510
+#define CBC_MAXIMUM_FULL_VALUE 32767
+
+#define CBC_PUSH_NUMBER_BYTE_RANGE_END 256
+
+#define CBC_HIGHEST_BIT_MASK 0x80
+#define CBC_LOWER_SEVEN_BIT_MASK 0x7f
+
+/**
+ * Literal indicies belong to one of the following groups:
+ *
+ * 0 <= index < argument_end                    : arguments
+ * argument_end <= index < register_end         : registers
+ * register_end <= index < ident_end            : identifiers
+ * ident_end <= index < const_literal_end       : constant literals
+ * const_literal_end <= index < literal_end     : template literals
+ */
+
+/**
+ * Compiled byte code arguments.
+ */
+typedef struct
+{
+  ecma_compiled_code_t header;      /**< compiled code header */
+  uint8_t stack_limit;              /**< maximum number of values stored on the stack */
+  uint8_t argument_end;             /**< number of arguments expected by the function */
+  uint8_t register_end;             /**< end position of the register group */
+  uint8_t ident_end;                /**< end position of the identifier group */
+  uint8_t const_literal_end;        /**< end position of the const literal group */
+  uint8_t literal_end;              /**< end position of the literal group */
+} cbc_uint8_arguments_t;
+
+/**
+ * Compiled byte code arguments.
+ */
+typedef struct
+{
+  ecma_compiled_code_t header;      /**< compiled code header */
+  uint16_t stack_limit;             /**< maximum number of values stored on the stack */
+  uint16_t argument_end;            /**< number of arguments expected by the function */
+  uint16_t register_end;            /**< end position of the register group */
+  uint16_t ident_end;               /**< end position of the identifier group */
+  uint16_t const_literal_end;       /**< end position of the const literal group */
+  uint16_t literal_end;             /**< end position of the literal group */
+#ifdef JERRY_CPOINTER_32_BIT
+  uint16_t padding;                 /**< an unused value */
+#endif
+} cbc_uint16_arguments_t;
+
+/**
+ * Compact byte code status flags.
+ */
+typedef enum
+{
+  CBC_CODE_FLAGS_FUNCTION = (1u << 0), /**< compiled code is JavaScript function */
+  CBC_CODE_FLAGS_FULL_LITERAL_ENCODING = (1u << 1), /**< full literal encoding mode is enabled */
+  CBC_CODE_FLAGS_UINT16_ARGUMENTS = (1u << 2), /**< compiled code data is cbc_uint16_arguments_t */
+  CBC_CODE_FLAGS_STRICT_MODE = (1u << 3), /**< strict mode is enabled */
+  CBC_CODE_FLAGS_ARGUMENTS_NEEDED = (1u << 4), /**< arguments object must be constructed */
+  CBC_CODE_FLAGS_LEXICAL_ENV_NOT_NEEDED = (1u << 5), /**< no need to create a lexical environment */
+  CBC_CODE_FLAGS_DEBUGGER_IGNORE = (1u << 6), /**< this function should be ignored by debugger */
+} cbc_code_flags;
+
+#define CBC_OPCODE(arg1, arg2, arg3, arg4) arg1,
+
+/**
+ * Opcode list.
+ */
+typedef enum
+{
+  CBC_OPCODE_LIST      /**< list of opcodes */
+} cbc_opcode_t;
+
+/**
+ * Extended opcode list.
+ */
+typedef enum
+{
+  CBC_EXT_OPCODE_LIST  /**< list extended opcodes */
+} cbc_ext_opcode_t;
+
+#undef CBC_OPCODE
+
+/**
+ * Opcode flags.
+ */
+extern const uint8_t cbc_flags[];
+extern const uint8_t cbc_ext_flags[];
+
+#ifdef PARSER_DUMP_BYTE_CODE
+
+/**
+ * Opcode names for debugging.
+ */
+extern const char * const cbc_names[];
+extern const char * const cbc_ext_names[];
+
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !BYTE_CODE_H */
diff --git a/deps/jerry/jerry-core/parser/js/common.c b/deps/jerry/jerry-core/parser/js/common.c
new file mode 100644 (file)
index 0000000..9982e81
--- /dev/null
@@ -0,0 +1,139 @@
+/* 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.
+ */
+
+#include "common.h"
+#include "ecma-helpers.h"
+
+#if JERRY_JS_PARSER
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_utils Utility
+ * @{
+ */
+
+/**
+ * Free literal.
+ */
+void
+util_free_literal (lexer_literal_t *literal_p) /**< literal */
+{
+  if (literal_p->type == LEXER_IDENT_LITERAL
+      || literal_p->type == LEXER_STRING_LITERAL)
+  {
+    if (!(literal_p->status_flags & LEXER_FLAG_SOURCE_PTR))
+    {
+      jmem_heap_free_block ((void *) literal_p->u.char_p, literal_p->prop.length);
+    }
+  }
+  else if ((literal_p->type == LEXER_FUNCTION_LITERAL)
+           || (literal_p->type == LEXER_REGEXP_LITERAL))
+  {
+    ecma_bytecode_deref (literal_p->u.bytecode_p);
+  }
+} /* util_free_literal */
+
+#ifdef PARSER_DUMP_BYTE_CODE
+
+/**
+ * Debug utility to print a character sequence.
+ */
+static void
+util_print_chars (const uint8_t *char_p, /**< character pointer */
+                  size_t size) /**< size */
+{
+  while (size > 0)
+  {
+    JERRY_DEBUG_MSG ("%c", *char_p++);
+    size--;
+  }
+} /* util_print_chars */
+
+/**
+ * Debug utility to print a number.
+ */
+static void
+util_print_number (ecma_number_t num_p) /**< number to print */
+{
+  lit_utf8_byte_t str_buf[ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER];
+  lit_utf8_size_t str_size = ecma_number_to_utf8_string (num_p, str_buf, sizeof (str_buf));
+  str_buf[str_size] = 0;
+  JERRY_DEBUG_MSG ("%s", str_buf);
+} /* util_print_number */
+
+/**
+ * Print literal.
+ */
+void
+util_print_literal (lexer_literal_t *literal_p) /**< literal */
+{
+  if (literal_p->type == LEXER_IDENT_LITERAL)
+  {
+    if (literal_p->status_flags & LEXER_FLAG_VAR)
+    {
+      JERRY_DEBUG_MSG ("var_ident(");
+    }
+    else
+    {
+      JERRY_DEBUG_MSG ("ident(");
+    }
+    util_print_chars (literal_p->u.char_p, literal_p->prop.length);
+  }
+  else if (literal_p->type == LEXER_FUNCTION_LITERAL)
+  {
+    JERRY_DEBUG_MSG ("function");
+    return;
+  }
+  else if (literal_p->type == LEXER_STRING_LITERAL)
+  {
+    JERRY_DEBUG_MSG ("string(");
+    util_print_chars (literal_p->u.char_p, literal_p->prop.length);
+  }
+  else if (literal_p->type == LEXER_NUMBER_LITERAL)
+  {
+    ecma_string_t *value_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t, literal_p->u.value);
+
+    JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (value_p) == ECMA_STRING_LITERAL_NUMBER);
+
+    JERRY_DEBUG_MSG ("number(");
+    util_print_number (ecma_get_number_from_value (value_p->u.lit_number));
+  }
+  else if (literal_p->type == LEXER_REGEXP_LITERAL)
+  {
+    JERRY_DEBUG_MSG ("regexp");
+    return;
+  }
+  else
+  {
+    JERRY_DEBUG_MSG ("unknown");
+    return;
+  }
+
+  JERRY_DEBUG_MSG (")");
+} /* util_print_literal */
+
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* JERRY_JS_PARSER */
diff --git a/deps/jerry/jerry-core/parser/js/common.h b/deps/jerry/jerry-core/parser/js/common.h
new file mode 100644 (file)
index 0000000..6829d0a
--- /dev/null
@@ -0,0 +1,138 @@
+/* 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.
+ */
+
+#ifndef COMMON_H
+#define COMMON_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>
+#include <setjmp.h>
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_utils Utility
+ * @{
+ */
+
+#include "ecma-globals.h"
+#include "ecma-regexp-object.h"
+#include "jmem.h"
+
+/* Immediate management. */
+
+/**
+ * Literal types.
+ *
+ * The LEXER_UNUSED_LITERAL type is internal and
+ * used for various purposes.
+ */
+typedef enum
+{
+  LEXER_IDENT_LITERAL = 0,          /**< identifier literal */
+  LEXER_STRING_LITERAL = 1,         /**< string literal */
+  LEXER_NUMBER_LITERAL = 2,         /**< number literal */
+  LEXER_FUNCTION_LITERAL = 3,       /**< function literal */
+  LEXER_REGEXP_LITERAL = 4,         /**< regexp literal */
+  LEXER_UNUSED_LITERAL = 5,         /**< unused literal, can only be
+                                         used by the byte code generator. */
+} lexer_literal_type_t;
+
+/* Flags for status_flags. */
+
+/* Local identifier (var, function arg). */
+#define LEXER_FLAG_VAR 0x01
+/* This local identifier cannot be stored in register. */
+#define LEXER_FLAG_NO_REG_STORE 0x02
+/* This local identifier is initialized with a value. */
+#define LEXER_FLAG_INITIALIZED 0x04
+/* This local identifier has a reference to the function itself. */
+#define LEXER_FLAG_FUNCTION_NAME 0x08
+/* This local identifier is a function argument. */
+#define LEXER_FLAG_FUNCTION_ARGUMENT 0x10
+/* This local identifier is not used in the current context. */
+#define LEXER_FLAG_UNUSED_IDENT 0x20
+/* No space is allocated for this character literal. */
+#define LEXER_FLAG_SOURCE_PTR 0x40
+/* Initialize this variable after the byte code is freed. */
+#define LEXER_FLAG_LATE_INIT 0x80
+
+/**
+ * Literal data.
+ */
+typedef struct
+{
+  union
+  {
+    jmem_cpointer_t value;               /**< literal value (not processed by the parser) */
+    const uint8_t *char_p;               /**< character value */
+    ecma_compiled_code_t *bytecode_p;    /**< compiled function or regexp pointer */
+    uint32_t source_data;                /**< encoded source literal */
+  } u;
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  struct
+#else /* !PARSER_DUMP_BYTE_CODE */
+  union
+#endif /* PARSER_DUMP_BYTE_CODE */
+  {
+    uint16_t length;                     /**< length of ident / string literal */
+    uint16_t index;                      /**< real index during post processing */
+  } prop;
+
+  uint8_t type;                          /**< type of the literal */
+  uint8_t status_flags;                  /**< status flags */
+} lexer_literal_t;
+
+void util_free_literal (lexer_literal_t *literal_p);
+
+#ifdef PARSER_DUMP_BYTE_CODE
+void util_print_literal (lexer_literal_t *);
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+/* TRY/CATCH block */
+
+#define PARSER_TRY_CONTEXT(context_name) \
+  jmp_buf context_name
+
+#define PARSER_THROW(context_name) \
+  longjmp (context_name, 1);
+
+#define PARSER_TRY(context_name) \
+  { \
+    if (!setjmp (context_name)) \
+    { \
+
+#define PARSER_CATCH \
+    } \
+    else \
+    {
+
+#define PARSER_TRY_END \
+    } \
+  }
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !COMMON_H */
diff --git a/deps/jerry/jerry-core/parser/js/js-lexer.c b/deps/jerry/jerry-core/parser/js/js-lexer.c
new file mode 100644 (file)
index 0000000..699dd8c
--- /dev/null
@@ -0,0 +1,2165 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-helpers.h"
+#include "ecma-function-object.h"
+#include "ecma-literal-storage.h"
+#include "js-parser-internal.h"
+#include "lit-char-helpers.h"
+
+#if JERRY_JS_PARSER
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_lexer Lexer
+ * @{
+ */
+
+#define IS_UTF8_INTERMEDIATE_OCTET(byte) (((byte) & LIT_UTF8_EXTRA_BYTE_MASK) == LIT_UTF8_2_BYTE_CODE_POINT_MIN)
+
+/**
+ * Align column to the next tab position.
+ *
+ * @return aligned position
+ */
+static parser_line_counter_t
+align_column_to_tab (parser_line_counter_t column) /**< current column */
+{
+  /* Tab aligns to zero column start position. */
+  return (parser_line_counter_t) (((column + (8u - 1u)) & ~ECMA_STRING_CONTAINER_MASK) + 1u);
+} /* align_column_to_tab */
+
+/**
+ * Parse hexadecimal character sequence
+ *
+ * @return character value
+ */
+ecma_char_t
+lexer_hex_to_character (parser_context_t *context_p, /**< context */
+                        const uint8_t *source_p, /**< current source position */
+                        int length) /**< source length */
+{
+  uint32_t result = 0;
+
+  do
+  {
+    uint32_t byte = *source_p++;
+
+    result <<= 4;
+
+    if (byte >= LIT_CHAR_0 && byte <= LIT_CHAR_9)
+    {
+      result += byte - LIT_CHAR_0;
+    }
+    else
+    {
+      byte = LEXER_TO_ASCII_LOWERCASE (byte);
+      if (byte >= LIT_CHAR_LOWERCASE_A && byte <= LIT_CHAR_LOWERCASE_F)
+      {
+        result += byte - (LIT_CHAR_LOWERCASE_A - 10);
+      }
+      else
+      {
+        parser_raise_error (context_p, PARSER_ERR_INVALID_ESCAPE_SEQUENCE);
+      }
+    }
+  }
+  while (--length > 0);
+
+  return (ecma_char_t) result;
+} /* lexer_hex_to_character */
+
+/**
+ * Skip space mode
+ */
+typedef enum
+{
+  LEXER_SKIP_SPACES,                 /**< skip spaces mode */
+  LEXER_SKIP_SINGLE_LINE_COMMENT,    /**< parse single line comment */
+  LEXER_SKIP_MULTI_LINE_COMMENT,     /**< parse multi line comment */
+} skip_mode_t;
+
+/**
+ * Skip spaces.
+ */
+static void
+skip_spaces (parser_context_t *context_p) /**< context */
+{
+  skip_mode_t mode = LEXER_SKIP_SPACES;
+  const uint8_t *source_end_p = context_p->source_end_p;
+
+  context_p->token.was_newline = 0;
+
+  while (true)
+  {
+    if (context_p->source_p >= source_end_p)
+    {
+      if (mode == LEXER_SKIP_MULTI_LINE_COMMENT)
+      {
+        parser_raise_error (context_p, PARSER_ERR_UNTERMINATED_MULTILINE_COMMENT);
+      }
+      return;
+    }
+
+    switch (context_p->source_p[0])
+    {
+      case LIT_CHAR_CR:
+      {
+        if (context_p->source_p + 1 < source_end_p
+            && context_p->source_p[1] == LIT_CHAR_LF)
+        {
+          context_p->source_p++;
+        }
+        /* FALLTHRU */
+      }
+
+      case LIT_CHAR_LF:
+      {
+        context_p->line++;
+        context_p->column = 0;
+        context_p->token.was_newline = 1;
+
+        if (mode == LEXER_SKIP_SINGLE_LINE_COMMENT)
+        {
+          mode = LEXER_SKIP_SPACES;
+        }
+        /* FALLTHRU */
+      }
+
+      case LIT_CHAR_VTAB:
+      case LIT_CHAR_FF:
+      case LIT_CHAR_SP:
+      {
+        context_p->source_p++;
+        context_p->column++;
+        continue;
+      }
+
+      case LIT_CHAR_TAB:
+      {
+        context_p->column = align_column_to_tab (context_p->column);
+        context_p->source_p++;
+        continue;
+      }
+
+      case LIT_CHAR_SLASH:
+      {
+        if (mode == LEXER_SKIP_SPACES
+            && context_p->source_p + 1 < source_end_p)
+        {
+          if (context_p->source_p[1] == LIT_CHAR_SLASH)
+          {
+            mode = LEXER_SKIP_SINGLE_LINE_COMMENT;
+          }
+          else if (context_p->source_p[1] == LIT_CHAR_ASTERISK)
+          {
+            mode = LEXER_SKIP_MULTI_LINE_COMMENT;
+            context_p->token.line = context_p->line;
+            context_p->token.column = context_p->column;
+          }
+
+          if (mode != LEXER_SKIP_SPACES)
+          {
+            context_p->source_p += 2;
+            PARSER_PLUS_EQUAL_LC (context_p->column, 2);
+            continue;
+          }
+        }
+        break;
+      }
+
+      case LIT_CHAR_ASTERISK:
+      {
+        if (mode == LEXER_SKIP_MULTI_LINE_COMMENT
+            && context_p->source_p + 1 < source_end_p
+            && context_p->source_p[1] == LIT_CHAR_SLASH)
+        {
+          mode = LEXER_SKIP_SPACES;
+          context_p->source_p += 2;
+          PARSER_PLUS_EQUAL_LC (context_p->column, 2);
+          continue;
+        }
+        break;
+      }
+
+      case 0xc2:
+      {
+        if (context_p->source_p + 1 < source_end_p
+            && context_p->source_p[1] == 0xa0)
+        {
+          /* Codepoint \u00A0 */
+          context_p->source_p += 2;
+          context_p->column++;
+          continue;
+        }
+        break;
+      }
+
+      case LEXER_NEWLINE_LS_PS_BYTE_1:
+      {
+        JERRY_ASSERT (context_p->source_p + 2 < source_end_p);
+        if (LEXER_NEWLINE_LS_PS_BYTE_23 (context_p->source_p))
+        {
+          /* Codepoint \u2028 and \u2029 */
+          context_p->source_p += 3;
+          context_p->line++;
+          context_p->column = 1;
+          context_p->token.was_newline = 1;
+
+          if (mode == LEXER_SKIP_SINGLE_LINE_COMMENT)
+          {
+            mode = LEXER_SKIP_SPACES;
+          }
+          continue;
+        }
+        break;
+      }
+
+      case 0xef:
+      {
+        if (context_p->source_p + 2 < source_end_p
+            && context_p->source_p[1] == 0xbb
+            && context_p->source_p[2] == 0xbf)
+        {
+          /* Codepoint \uFEFF */
+          context_p->source_p += 3;
+          context_p->column++;
+          continue;
+        }
+        break;
+      }
+
+      default:
+      {
+        break;
+      }
+    }
+
+    if (mode == LEXER_SKIP_SPACES)
+    {
+      return;
+    }
+
+    context_p->source_p++;
+
+    if (context_p->source_p < source_end_p
+        && IS_UTF8_INTERMEDIATE_OCTET (context_p->source_p[0]))
+    {
+      context_p->column++;
+    }
+  }
+} /* skip_spaces */
+
+/**
+ * Keyword data.
+ */
+typedef struct
+{
+  const uint8_t *keyword_p;     /**< keyword string */
+  lexer_token_type_t type;      /**< keyword token type */
+} keyword_string_t;
+
+#define LEXER_KEYWORD(name, type) { (const uint8_t *) (name), (type) }
+#define LEXER_KEYWORD_END()       { (const uint8_t *) NULL, LEXER_EOS }
+
+/**
+ * Keywords with 2 characters.
+ */
+static const keyword_string_t keyword_length_2[4] =
+{
+  LEXER_KEYWORD ("do", LEXER_KEYW_DO),
+  LEXER_KEYWORD ("if", LEXER_KEYW_IF),
+  LEXER_KEYWORD ("in", LEXER_KEYW_IN),
+  LEXER_KEYWORD_END ()
+};
+
+/**
+ * Keywords with 3 characters.
+ */
+static const keyword_string_t keyword_length_3[6] =
+{
+  LEXER_KEYWORD ("for", LEXER_KEYW_FOR),
+  LEXER_KEYWORD ("let", LEXER_KEYW_LET),
+  LEXER_KEYWORD ("new", LEXER_KEYW_NEW),
+  LEXER_KEYWORD ("try", LEXER_KEYW_TRY),
+  LEXER_KEYWORD ("var", LEXER_KEYW_VAR),
+  LEXER_KEYWORD_END ()
+};
+
+/**
+ * Keywords with 4 characters.
+ */
+static const keyword_string_t keyword_length_4[9] =
+{
+  LEXER_KEYWORD ("case", LEXER_KEYW_CASE),
+  LEXER_KEYWORD ("else", LEXER_KEYW_ELSE),
+  LEXER_KEYWORD ("enum", LEXER_KEYW_ENUM),
+  LEXER_KEYWORD ("null", LEXER_LIT_NULL),
+  LEXER_KEYWORD ("this", LEXER_KEYW_THIS),
+  LEXER_KEYWORD ("true", LEXER_LIT_TRUE),
+  LEXER_KEYWORD ("void", LEXER_KEYW_VOID),
+  LEXER_KEYWORD ("with", LEXER_KEYW_WITH),
+  LEXER_KEYWORD_END ()
+};
+
+/**
+ * Keywords with 5 characters.
+ */
+static const keyword_string_t keyword_length_5[10] =
+{
+  LEXER_KEYWORD ("break", LEXER_KEYW_BREAK),
+  LEXER_KEYWORD ("catch", LEXER_KEYW_CATCH),
+  LEXER_KEYWORD ("class", LEXER_KEYW_CLASS),
+  LEXER_KEYWORD ("const", LEXER_KEYW_CONST),
+  LEXER_KEYWORD ("false", LEXER_LIT_FALSE),
+  LEXER_KEYWORD ("super", LEXER_KEYW_SUPER),
+  LEXER_KEYWORD ("throw", LEXER_KEYW_THROW),
+  LEXER_KEYWORD ("while", LEXER_KEYW_WHILE),
+  LEXER_KEYWORD ("yield", LEXER_KEYW_YIELD),
+  LEXER_KEYWORD_END ()
+};
+
+/**
+ * Keywords with 6 characters.
+ */
+static const keyword_string_t keyword_length_6[9] =
+{
+  LEXER_KEYWORD ("delete", LEXER_KEYW_DELETE),
+  LEXER_KEYWORD ("export", LEXER_KEYW_EXPORT),
+  LEXER_KEYWORD ("import", LEXER_KEYW_IMPORT),
+  LEXER_KEYWORD ("public", LEXER_KEYW_PUBLIC),
+  LEXER_KEYWORD ("return", LEXER_KEYW_RETURN),
+  LEXER_KEYWORD ("static", LEXER_KEYW_STATIC),
+  LEXER_KEYWORD ("switch", LEXER_KEYW_SWITCH),
+  LEXER_KEYWORD ("typeof", LEXER_KEYW_TYPEOF),
+  LEXER_KEYWORD_END ()
+};
+
+/**
+ * Keywords with 7 characters.
+ */
+static const keyword_string_t keyword_length_7[6] =
+{
+  LEXER_KEYWORD ("default", LEXER_KEYW_DEFAULT),
+  LEXER_KEYWORD ("extends", LEXER_KEYW_EXTENDS),
+  LEXER_KEYWORD ("finally", LEXER_KEYW_FINALLY),
+  LEXER_KEYWORD ("package", LEXER_KEYW_PACKAGE),
+  LEXER_KEYWORD ("private", LEXER_KEYW_PRIVATE),
+  LEXER_KEYWORD_END ()
+};
+
+/**
+ * Keywords with 8 characters.
+ */
+static const keyword_string_t keyword_length_8[4] =
+{
+  LEXER_KEYWORD ("continue", LEXER_KEYW_CONTINUE),
+  LEXER_KEYWORD ("debugger", LEXER_KEYW_DEBUGGER),
+  LEXER_KEYWORD ("function", LEXER_KEYW_FUNCTION),
+  LEXER_KEYWORD_END ()
+};
+
+/**
+ * Keywords with 9 characters.
+ */
+static const keyword_string_t keyword_length_9[3] =
+{
+  LEXER_KEYWORD ("interface", LEXER_KEYW_INTERFACE),
+  LEXER_KEYWORD ("protected", LEXER_KEYW_PROTECTED),
+  LEXER_KEYWORD_END ()
+};
+
+/**
+ * Keywords with 10 characters.
+ */
+static const keyword_string_t keyword_length_10[3] =
+{
+  LEXER_KEYWORD ("implements", LEXER_KEYW_IMPLEMENTS),
+  LEXER_KEYWORD ("instanceof", LEXER_KEYW_INSTANCEOF),
+  LEXER_KEYWORD_END ()
+};
+
+/**
+ * List to the keywords.
+ */
+static const keyword_string_t * const keyword_string_list[9] =
+{
+  keyword_length_2,
+  keyword_length_3,
+  keyword_length_4,
+  keyword_length_5,
+  keyword_length_6,
+  keyword_length_7,
+  keyword_length_8,
+  keyword_length_9,
+  keyword_length_10
+};
+
+#undef LEXER_KEYWORD
+#undef LEXER_KEYWORD_END
+
+/**
+ * Parse identifier.
+ */
+static void
+lexer_parse_identifier (parser_context_t *context_p, /**< context */
+                        bool check_keywords) /**< check keywords */
+{
+  /* Only very few identifiers contains \u escape sequences. */
+  const uint8_t *source_p = context_p->source_p;
+  const uint8_t *ident_start_p = context_p->source_p;
+  /* Note: newline or tab cannot be part of an identifier. */
+  parser_line_counter_t column = context_p->column;
+  const uint8_t *source_end_p = context_p->source_end_p;
+  size_t length = 0;
+
+  context_p->token.type = LEXER_LITERAL;
+  context_p->token.literal_is_reserved = false;
+  context_p->token.lit_location.type = LEXER_IDENT_LITERAL;
+  context_p->token.lit_location.has_escape = false;
+
+  do
+  {
+    if (*source_p == LIT_CHAR_BACKSLASH)
+    {
+      uint16_t character;
+
+      context_p->token.lit_location.has_escape = true;
+      context_p->source_p = source_p;
+      context_p->token.column = column;
+
+      if ((source_p + 6 > source_end_p) || (source_p[1] != LIT_CHAR_LOWERCASE_U))
+      {
+        parser_raise_error (context_p, PARSER_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE);
+      }
+
+      character = lexer_hex_to_character (context_p, source_p + 2, 4);
+
+      if (length == 0)
+      {
+        if (!lit_char_is_identifier_start_character (character))
+        {
+          parser_raise_error (context_p, PARSER_ERR_INVALID_IDENTIFIER_START);
+        }
+      }
+      else
+      {
+        if (!lit_char_is_identifier_part_character (character))
+        {
+          parser_raise_error (context_p, PARSER_ERR_INVALID_IDENTIFIER_PART);
+        }
+      }
+
+      length += lit_char_get_utf8_length (character);
+      source_p += 6;
+      PARSER_PLUS_EQUAL_LC (column, 6);
+      continue;
+    }
+
+    /* Valid identifiers cannot contain 4 byte long utf-8
+     * characters, since those characters are represented
+     * by 2 ecmascript (UTF-16) characters, and those
+     * characters cannot be literal characters. */
+    JERRY_ASSERT (source_p[0] < LEXER_UTF8_4BYTE_START);
+
+    source_p++;
+    length++;
+    column++;
+
+    while (source_p < source_end_p
+           && IS_UTF8_INTERMEDIATE_OCTET (source_p[0]))
+    {
+      source_p++;
+      length++;
+    }
+  }
+  while (source_p < source_end_p
+         && (lit_char_is_identifier_part (source_p) || *source_p == LIT_CHAR_BACKSLASH));
+
+  context_p->source_p = ident_start_p;
+  context_p->token.column = context_p->column;
+
+  if (length > PARSER_MAXIMUM_IDENT_LENGTH)
+  {
+    parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_TOO_LONG);
+  }
+
+  /* Check keywords (Only if there is no \u escape sequence in the pattern). */
+  if (check_keywords
+      && !context_p->token.lit_location.has_escape
+      && (length >= 2 && length <= 10))
+  {
+    const keyword_string_t *keyword_p = keyword_string_list[length - 2];
+
+    do
+    {
+      if (ident_start_p[0] == keyword_p->keyword_p[0]
+          && ident_start_p[1] == keyword_p->keyword_p[1]
+          && memcmp (ident_start_p, keyword_p->keyword_p, length) == 0)
+      {
+        if (keyword_p->type >= LEXER_FIRST_FUTURE_STRICT_RESERVED_WORD)
+        {
+          if (context_p->status_flags & PARSER_IS_STRICT)
+          {
+            parser_raise_error (context_p, PARSER_ERR_STRICT_IDENT_NOT_ALLOWED);
+          }
+
+          context_p->token.literal_is_reserved = true;
+          break;
+        }
+
+        context_p->token.type = keyword_p->type;
+        break;
+      }
+      keyword_p++;
+    }
+    while (keyword_p->type != LEXER_EOS);
+  }
+
+  if (context_p->token.type == LEXER_LITERAL)
+  {
+    /* Fill literal data. */
+    context_p->token.lit_location.char_p = ident_start_p;
+    context_p->token.lit_location.length = (uint16_t) length;
+  }
+
+  context_p->source_p = source_p;
+  context_p->column = column;
+} /* lexer_parse_identifier */
+
+/**
+ * Parse string.
+ */
+static void
+lexer_parse_string (parser_context_t *context_p) /**< context */
+{
+  uint8_t str_end_character = context_p->source_p[0];
+  const uint8_t *source_p = context_p->source_p + 1;
+  const uint8_t *string_start_p = source_p;
+  const uint8_t *source_end_p = context_p->source_end_p;
+  parser_line_counter_t line = context_p->line;
+  parser_line_counter_t column = (parser_line_counter_t) (context_p->column + 1);
+  parser_line_counter_t original_line = line;
+  parser_line_counter_t original_column = column;
+  size_t length = 0;
+  uint8_t has_escape = false;
+
+  while (true)
+  {
+    if (source_p >= source_end_p)
+    {
+      context_p->token.line = original_line;
+      context_p->token.column = (parser_line_counter_t) (original_column - 1);
+      parser_raise_error (context_p, PARSER_ERR_UNTERMINATED_STRING);
+    }
+
+    if (*source_p == str_end_character)
+    {
+      break;
+    }
+
+    if (*source_p == LIT_CHAR_BACKSLASH)
+    {
+      source_p++;
+      column++;
+      if (source_p >= source_end_p)
+      {
+        /* Will throw an unterminated string error. */
+        continue;
+      }
+
+      has_escape = true;
+
+      /* Newline is ignored. */
+      if (*source_p == LIT_CHAR_CR
+          || *source_p == LIT_CHAR_LF
+          || (*source_p == LEXER_NEWLINE_LS_PS_BYTE_1 && LEXER_NEWLINE_LS_PS_BYTE_23 (source_p)))
+      {
+        if (*source_p == LIT_CHAR_CR)
+        {
+          source_p++;
+          if (source_p < source_end_p
+              && *source_p == LIT_CHAR_LF)
+          {
+            source_p++;
+          }
+        }
+        else if (*source_p == LIT_CHAR_LF)
+        {
+          source_p++;
+        }
+        else
+        {
+          source_p += 3;
+        }
+
+        line++;
+        column = 1;
+        continue;
+      }
+
+      /* Except \x, \u, and octal numbers, everything is
+       * converted to a character which has the same byte length. */
+      if (*source_p >= LIT_CHAR_0 && *source_p <= LIT_CHAR_3)
+      {
+        if (context_p->status_flags & PARSER_IS_STRICT)
+        {
+          parser_raise_error (context_p, PARSER_ERR_OCTAL_ESCAPE_NOT_ALLOWED);
+        }
+
+        source_p++;
+        column++;
+
+        if (source_p < source_end_p && *source_p >= LIT_CHAR_0 && *source_p <= LIT_CHAR_7)
+        {
+          source_p++;
+          column++;
+
+          if (source_p < source_end_p && *source_p >= LIT_CHAR_0 && *source_p <= LIT_CHAR_7)
+          {
+            /* Numbers >= 0x200 (0x80) requires
+             * two bytes for encoding in UTF-8. */
+            if (source_p[-2] >= LIT_CHAR_2)
+            {
+              length++;
+            }
+
+            source_p++;
+            column++;
+          }
+        }
+
+        length++;
+        continue;
+      }
+
+      if (*source_p >= LIT_CHAR_4 && *source_p <= LIT_CHAR_7)
+      {
+        if (context_p->status_flags & PARSER_IS_STRICT)
+        {
+          parser_raise_error (context_p, PARSER_ERR_OCTAL_ESCAPE_NOT_ALLOWED);
+        }
+
+        source_p++;
+        column++;
+
+        if (source_p < source_end_p && *source_p >= LIT_CHAR_0 && *source_p <= LIT_CHAR_7)
+        {
+          source_p++;
+          column++;
+        }
+
+        /* The maximum number is 0x4d so the UTF-8
+         * representation is always one byte. */
+        length++;
+        continue;
+      }
+
+      if (*source_p == LIT_CHAR_LOWERCASE_X || *source_p == LIT_CHAR_LOWERCASE_U)
+      {
+        uint8_t hex_part_length = (*source_p == LIT_CHAR_LOWERCASE_X) ? 2 : 4;
+
+        context_p->token.line = line;
+        context_p->token.column = (parser_line_counter_t) (column - 1);
+        if (source_p + 1 + hex_part_length > source_end_p)
+        {
+          parser_raise_error (context_p, PARSER_ERR_INVALID_ESCAPE_SEQUENCE);
+        }
+
+        length += lit_char_get_utf8_length (lexer_hex_to_character (context_p,
+                                                                    source_p + 1,
+                                                                    hex_part_length));
+        source_p += hex_part_length + 1;
+        PARSER_PLUS_EQUAL_LC (column, hex_part_length + 1u);
+        continue;
+      }
+    }
+
+    if (*source_p >= LEXER_UTF8_4BYTE_START)
+    {
+      /* Processing 4 byte unicode sequence (even if it is
+       * after a backslash). Always converted to two 3 byte
+       * long sequence. */
+      length += 2 * 3;
+      has_escape = true;
+      source_p += 4;
+      column++;
+      continue;
+    }
+    else if (*source_p == LIT_CHAR_CR
+             || *source_p == LIT_CHAR_LF
+             || (*source_p == LEXER_NEWLINE_LS_PS_BYTE_1 && LEXER_NEWLINE_LS_PS_BYTE_23 (source_p)))
+    {
+      context_p->token.line = line;
+      context_p->token.column = column;
+      parser_raise_error (context_p, PARSER_ERR_NEWLINE_NOT_ALLOWED);
+    }
+    else if (*source_p == LIT_CHAR_TAB)
+    {
+      column = align_column_to_tab (column);
+      /* Subtract -1 because column is increased below. */
+      column--;
+    }
+
+    source_p++;
+    column++;
+    length++;
+
+    while (source_p < source_end_p
+           && IS_UTF8_INTERMEDIATE_OCTET (*source_p))
+    {
+      source_p++;
+      length++;
+    }
+  }
+
+  if (length > PARSER_MAXIMUM_STRING_LENGTH)
+  {
+    parser_raise_error (context_p, PARSER_ERR_STRING_TOO_LONG);
+  }
+
+  context_p->token.type = LEXER_LITERAL;
+
+  /* Fill literal data. */
+  context_p->token.lit_location.char_p = string_start_p;
+  context_p->token.lit_location.length = (uint16_t) length;
+  context_p->token.lit_location.type = LEXER_STRING_LITERAL;
+  context_p->token.lit_location.has_escape = has_escape;
+
+  context_p->source_p = source_p + 1;
+  context_p->line = line;
+  context_p->column = (parser_line_counter_t) (column + 1);
+} /* lexer_parse_string */
+
+/**
+ * Parse number.
+ */
+static void
+lexer_parse_number (parser_context_t *context_p) /**< context */
+{
+  const uint8_t *source_p = context_p->source_p;
+  const uint8_t *source_end_p = context_p->source_end_p;
+  bool can_be_float = false;
+  size_t length;
+
+  context_p->token.type = LEXER_LITERAL;
+  context_p->token.literal_is_reserved = false;
+  context_p->token.extra_value = LEXER_NUMBER_DECIMAL;
+  context_p->token.lit_location.char_p = source_p;
+  context_p->token.lit_location.type = LEXER_NUMBER_LITERAL;
+  context_p->token.lit_location.has_escape = false;
+
+  if (source_p[0] == LIT_CHAR_0
+      && source_p + 1 < source_end_p)
+  {
+    if (LEXER_TO_ASCII_LOWERCASE (source_p[1]) == LIT_CHAR_LOWERCASE_X)
+    {
+      context_p->token.extra_value = LEXER_NUMBER_HEXADECIMAL;
+      source_p += 2;
+
+      if (source_p >= source_end_p
+          || !lit_char_is_hex_digit (source_p[0]))
+      {
+        parser_raise_error (context_p, PARSER_ERR_INVALID_HEX_DIGIT);
+      }
+
+      do
+      {
+        source_p++;
+      }
+      while (source_p < source_end_p
+             && lit_char_is_hex_digit (source_p[0]));
+    }
+    else if (source_p[1] >= LIT_CHAR_0
+             && source_p[1] <= LIT_CHAR_7)
+    {
+      context_p->token.extra_value = LEXER_NUMBER_OCTAL;
+
+      if (context_p->status_flags & PARSER_IS_STRICT)
+      {
+        parser_raise_error (context_p, PARSER_ERR_OCTAL_NUMBER_NOT_ALLOWED);
+      }
+
+      do
+      {
+        source_p++;
+      }
+      while (source_p < source_end_p
+             && source_p[0] >= LIT_CHAR_0
+             && source_p[0] <= LIT_CHAR_7);
+
+      if (source_p < source_end_p
+          && source_p[0] >= LIT_CHAR_8
+          && source_p[0] <= LIT_CHAR_9)
+      {
+        parser_raise_error (context_p, PARSER_ERR_INVALID_NUMBER);
+      }
+    }
+    else if (source_p[1] >= LIT_CHAR_8
+             && source_p[1] <= LIT_CHAR_9)
+    {
+      parser_raise_error (context_p, PARSER_ERR_INVALID_NUMBER);
+    }
+    else
+    {
+      can_be_float = true;
+      source_p++;
+    }
+  }
+  else
+  {
+    do
+    {
+      source_p++;
+    }
+    while (source_p < source_end_p
+           && source_p[0] >= LIT_CHAR_0
+           && source_p[0] <= LIT_CHAR_9);
+
+    can_be_float = true;
+  }
+
+  if (can_be_float)
+  {
+    if (source_p < source_end_p
+        && source_p[0] == LIT_CHAR_DOT)
+    {
+      source_p++;
+      while (source_p < source_end_p
+             && source_p[0] >= LIT_CHAR_0
+             && source_p[0] <= LIT_CHAR_9)
+      {
+        source_p++;
+      }
+    }
+
+    if (source_p < source_end_p
+        && LEXER_TO_ASCII_LOWERCASE (source_p[0]) == LIT_CHAR_LOWERCASE_E)
+    {
+      source_p++;
+
+      if (source_p < source_end_p
+          && (source_p[0] == LIT_CHAR_PLUS || source_p[0] == LIT_CHAR_MINUS))
+      {
+        source_p++;
+      }
+
+      if (source_p >= source_end_p
+          || source_p[0] < LIT_CHAR_0
+          || source_p[0] > LIT_CHAR_9)
+      {
+        parser_raise_error (context_p, PARSER_ERR_MISSING_EXPONENT);
+      }
+
+      do
+      {
+        source_p++;
+      }
+      while (source_p < source_end_p
+             && source_p[0] >= LIT_CHAR_0
+             && source_p[0] <= LIT_CHAR_9);
+    }
+  }
+
+  if (source_p < source_end_p
+      && (lit_char_is_identifier_start (source_p) || source_p[0] == LIT_CHAR_BACKSLASH))
+  {
+    parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_AFTER_NUMBER);
+  }
+
+  length = (size_t) (source_p - context_p->source_p);
+  if (length > PARSER_MAXIMUM_IDENT_LENGTH)
+  {
+    parser_raise_error (context_p, PARSER_ERR_NUMBER_TOO_LONG);
+  }
+
+  context_p->token.lit_location.length = (uint16_t) length;
+  PARSER_PLUS_EQUAL_LC (context_p->column, length);
+  context_p->source_p = source_p;
+} /* lexer_parse_number */
+
+#define LEXER_TYPE_A_TOKEN(char1, type1) \
+  case (uint8_t) (char1) : \
+  { \
+    context_p->token.type = (type1); \
+    length = 1; \
+    break; \
+  }
+
+#define LEXER_TYPE_B_TOKEN(char1, type1, char2, type2) \
+  case (uint8_t) (char1) : \
+  { \
+    if (length >= 2 && context_p->source_p[1] == (uint8_t) (char2)) \
+    { \
+      context_p->token.type = (type2); \
+      length = 2; \
+      break; \
+    } \
+    \
+    context_p->token.type = (type1); \
+    length = 1; \
+    break; \
+  }
+
+#define LEXER_TYPE_C_TOKEN(char1, type1, char2, type2, char3, type3) \
+  case (uint8_t) (char1) : \
+  { \
+    if (length >= 2) \
+    { \
+      if (context_p->source_p[1] == (uint8_t) (char2)) \
+      { \
+        context_p->token.type = (type2); \
+        length = 2; \
+        break; \
+      } \
+      \
+      if (context_p->source_p[1] == (uint8_t) (char3)) \
+      { \
+        context_p->token.type = (type3); \
+        length = 2; \
+        break; \
+      } \
+    } \
+    \
+    context_p->token.type = (type1); \
+    length = 1; \
+    break; \
+  }
+
+#define LEXER_TYPE_D_TOKEN(char1, type1, char2, type2, char3, type3) \
+  case (uint8_t) (char1) : \
+  { \
+    if (length >= 2 && context_p->source_p[1] == (uint8_t) (char2)) \
+    { \
+      if (length >= 3 && context_p->source_p[2] == (uint8_t) (char3)) \
+      { \
+        context_p->token.type = (type3); \
+        length = 3; \
+        break; \
+      } \
+      \
+      context_p->token.type = (type2); \
+      length = 2; \
+      break; \
+    } \
+    \
+    context_p->token.type = (type1); \
+    length = 1; \
+    break; \
+  }
+
+/**
+ * Get next token.
+ */
+void
+lexer_next_token (parser_context_t *context_p) /**< context */
+{
+  size_t length;
+
+  skip_spaces (context_p);
+
+  context_p->token.line = context_p->line;
+  context_p->token.column = context_p->column;
+
+  length = (size_t) (context_p->source_end_p - context_p->source_p);
+  if (length == 0)
+  {
+    context_p->token.type = LEXER_EOS;
+    return;
+  }
+
+  if (lit_char_is_identifier_start (context_p->source_p)
+      || context_p->source_p[0] == LIT_CHAR_BACKSLASH)
+  {
+    lexer_parse_identifier (context_p, true);
+    return;
+  }
+
+  if (context_p->source_p[0] >= LIT_CHAR_0 && context_p->source_p[0] <= LIT_CHAR_9)
+  {
+    lexer_parse_number (context_p);
+    return;
+  }
+
+  switch (context_p->source_p[0])
+  {
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_LEFT_BRACE, LEXER_LEFT_BRACE);
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_LEFT_PAREN, LEXER_LEFT_PAREN);
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_LEFT_SQUARE, LEXER_LEFT_SQUARE);
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_RIGHT_BRACE, LEXER_RIGHT_BRACE);
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_RIGHT_PAREN, LEXER_RIGHT_PAREN);
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_RIGHT_SQUARE, LEXER_RIGHT_SQUARE);
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_SEMICOLON, LEXER_SEMICOLON);
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_COMMA, LEXER_COMMA);
+
+    case (uint8_t) LIT_CHAR_DOT :
+    {
+      if (length >= 2
+          && (context_p->source_p[1] >= LIT_CHAR_0 && context_p->source_p[1] <= LIT_CHAR_9))
+      {
+        lexer_parse_number (context_p);
+        return;
+      }
+
+      context_p->token.type = LEXER_DOT;
+      length = 1;
+      break;
+    }
+
+    case (uint8_t) LIT_CHAR_LESS_THAN:
+    {
+      if (length >= 2)
+      {
+        if (context_p->source_p[1] == (uint8_t) LIT_CHAR_EQUALS)
+        {
+          context_p->token.type = LEXER_LESS_EQUAL;
+          length = 2;
+          break;
+        }
+
+        if (context_p->source_p[1] == (uint8_t) LIT_CHAR_LESS_THAN)
+        {
+          if (length >= 3 && context_p->source_p[2] == (uint8_t) LIT_CHAR_EQUALS)
+          {
+            context_p->token.type = LEXER_ASSIGN_LEFT_SHIFT;
+            length = 3;
+            break;
+          }
+
+          context_p->token.type = LEXER_LEFT_SHIFT;
+          length = 2;
+          break;
+        }
+      }
+
+      context_p->token.type = LEXER_LESS;
+      length = 1;
+      break;
+    }
+
+    case LIT_CHAR_GREATER_THAN:
+    {
+      if (length >= 2)
+      {
+        if (context_p->source_p[1] == (uint8_t) LIT_CHAR_EQUALS)
+        {
+          context_p->token.type = LEXER_GREATER_EQUAL;
+          length = 2;
+          break;
+        }
+
+        if (context_p->source_p[1] == (uint8_t) LIT_CHAR_GREATER_THAN)
+        {
+          if (length >= 3)
+          {
+            if (context_p->source_p[2] == (uint8_t) LIT_CHAR_EQUALS)
+            {
+              context_p->token.type = LEXER_ASSIGN_RIGHT_SHIFT;
+              length = 3;
+              break;
+            }
+
+            if (context_p->source_p[2] == (uint8_t) LIT_CHAR_GREATER_THAN)
+            {
+              if (length >= 4 && context_p->source_p[3] == (uint8_t) LIT_CHAR_EQUALS)
+              {
+                context_p->token.type = LEXER_ASSIGN_UNS_RIGHT_SHIFT;
+                length = 4;
+                break;
+              }
+
+              context_p->token.type = LEXER_UNS_RIGHT_SHIFT;
+              length = 3;
+              break;
+            }
+          }
+
+          context_p->token.type = LEXER_RIGHT_SHIFT;
+          length = 2;
+          break;
+        }
+      }
+
+      context_p->token.type = LEXER_GREATER;
+      length = 1;
+      break;
+    }
+
+    LEXER_TYPE_D_TOKEN (LIT_CHAR_EQUALS, LEXER_ASSIGN, LIT_CHAR_EQUALS,
+                        LEXER_EQUAL, LIT_CHAR_EQUALS, LEXER_STRICT_EQUAL)
+    LEXER_TYPE_D_TOKEN (LIT_CHAR_EXCLAMATION, LEXER_LOGICAL_NOT, LIT_CHAR_EQUALS,
+                        LEXER_NOT_EQUAL, LIT_CHAR_EQUALS, LEXER_STRICT_NOT_EQUAL)
+
+    LEXER_TYPE_C_TOKEN (LIT_CHAR_PLUS, LEXER_ADD, LIT_CHAR_EQUALS,
+                        LEXER_ASSIGN_ADD, LIT_CHAR_PLUS, LEXER_INCREASE)
+    LEXER_TYPE_C_TOKEN (LIT_CHAR_MINUS, LEXER_SUBTRACT, LIT_CHAR_EQUALS,
+                        LEXER_ASSIGN_SUBTRACT, LIT_CHAR_MINUS, LEXER_DECREASE)
+
+    LEXER_TYPE_B_TOKEN (LIT_CHAR_ASTERISK, LEXER_MULTIPLY, LIT_CHAR_EQUALS,
+                        LEXER_ASSIGN_MULTIPLY)
+    LEXER_TYPE_B_TOKEN (LIT_CHAR_SLASH, LEXER_DIVIDE, LIT_CHAR_EQUALS,
+                        LEXER_ASSIGN_DIVIDE)
+    LEXER_TYPE_B_TOKEN (LIT_CHAR_PERCENT, LEXER_MODULO, LIT_CHAR_EQUALS,
+                        LEXER_ASSIGN_MODULO)
+
+    LEXER_TYPE_C_TOKEN (LIT_CHAR_AMPERSAND, LEXER_BIT_AND, LIT_CHAR_EQUALS,
+                        LEXER_ASSIGN_BIT_AND, LIT_CHAR_AMPERSAND, LEXER_LOGICAL_AND)
+    LEXER_TYPE_C_TOKEN (LIT_CHAR_VLINE, LEXER_BIT_OR, LIT_CHAR_EQUALS,
+                        LEXER_ASSIGN_BIT_OR, LIT_CHAR_VLINE, LEXER_LOGICAL_OR)
+
+    LEXER_TYPE_B_TOKEN (LIT_CHAR_CIRCUMFLEX, LEXER_BIT_XOR, LIT_CHAR_EQUALS,
+                        LEXER_ASSIGN_BIT_XOR)
+
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_TILDE, LEXER_BIT_NOT);
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_QUESTION, LEXER_QUESTION_MARK);
+    LEXER_TYPE_A_TOKEN (LIT_CHAR_COLON, LEXER_COLON);
+
+    case LIT_CHAR_SINGLE_QUOTE:
+    case LIT_CHAR_DOUBLE_QUOTE:
+    {
+      lexer_parse_string (context_p);
+      return;
+    }
+
+    default:
+    {
+      parser_raise_error (context_p, PARSER_ERR_INVALID_CHARACTER);
+    }
+  }
+
+  context_p->source_p += length;
+  PARSER_PLUS_EQUAL_LC (context_p->column, length);
+} /* lexer_next_token */
+
+#undef LEXER_TYPE_A_TOKEN
+#undef LEXER_TYPE_B_TOKEN
+#undef LEXER_TYPE_C_TOKEN
+#undef LEXER_TYPE_D_TOKEN
+
+/**
+ * Search or append the string to the literal pool.
+ */
+static void
+lexer_process_char_literal (parser_context_t *context_p, /**< context */
+                            const uint8_t *char_p, /**< characters */
+                            size_t length, /**< length of string */
+                            uint8_t literal_type, /**< final literal type */
+                            bool has_escape) /**< has escape sequences */
+{
+  parser_list_iterator_t literal_iterator;
+  lexer_literal_t *literal_p;
+  uint32_t literal_index = 0;
+
+  JERRY_ASSERT (literal_type == LEXER_IDENT_LITERAL
+                || literal_type == LEXER_STRING_LITERAL);
+
+  JERRY_ASSERT (literal_type != LEXER_IDENT_LITERAL || length <= PARSER_MAXIMUM_IDENT_LENGTH);
+  JERRY_ASSERT (literal_type != LEXER_STRING_LITERAL || length <= PARSER_MAXIMUM_STRING_LENGTH);
+
+  parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
+
+  while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)) != NULL)
+  {
+    if (literal_p->type == literal_type
+        && literal_p->prop.length == length
+        && memcmp (literal_p->u.char_p, char_p, length) == 0)
+    {
+      context_p->lit_object.literal_p = literal_p;
+      context_p->lit_object.index = (uint16_t) literal_index;
+      literal_p->status_flags = (uint8_t) (literal_p->status_flags & ~LEXER_FLAG_UNUSED_IDENT);
+      return;
+    }
+
+    literal_index++;
+  }
+
+  JERRY_ASSERT (literal_index == context_p->literal_count);
+
+  if (literal_index >= PARSER_MAXIMUM_NUMBER_OF_LITERALS)
+  {
+    parser_raise_error (context_p, PARSER_ERR_LITERAL_LIMIT_REACHED);
+  }
+
+  if (length == 0)
+  {
+    has_escape = false;
+  }
+
+  literal_p = (lexer_literal_t *) parser_list_append (context_p, &context_p->literal_pool);
+  literal_p->prop.length = (uint16_t) length;
+  literal_p->type = literal_type;
+  literal_p->status_flags = has_escape ? 0 : LEXER_FLAG_SOURCE_PTR;
+
+  if (has_escape)
+  {
+    literal_p->u.char_p = (uint8_t *) jmem_heap_alloc_block (length);
+    memcpy ((uint8_t *) literal_p->u.char_p, char_p, length);
+  }
+  else
+  {
+    literal_p->u.char_p = char_p;
+  }
+
+  context_p->lit_object.literal_p = literal_p;
+  context_p->lit_object.index = (uint16_t) literal_index;
+  context_p->literal_count++;
+} /* lexer_process_char_literal */
+
+/* Maximum buffer size for identifiers which contains escape sequences. */
+#define LEXER_MAX_LITERAL_LOCAL_BUFFER_SIZE 48
+
+/**
+ * Construct a literal object from an identifier.
+ */
+void
+lexer_construct_literal_object (parser_context_t *context_p, /**< context */
+                                lexer_lit_location_t *literal_p, /**< literal location */
+                                uint8_t literal_type) /**< final literal type */
+{
+  uint8_t *destination_start_p;
+  const uint8_t *source_p;
+  uint8_t local_byte_array[LEXER_MAX_LITERAL_LOCAL_BUFFER_SIZE];
+
+  JERRY_ASSERT (literal_p->type == LEXER_IDENT_LITERAL
+                || literal_p->type == LEXER_STRING_LITERAL);
+  JERRY_ASSERT (context_p->allocated_buffer_p == NULL);
+
+  destination_start_p = local_byte_array;
+  source_p = literal_p->char_p;
+
+  if (literal_p->has_escape)
+  {
+    uint8_t *destination_p;
+
+    if (literal_p->length > LEXER_MAX_LITERAL_LOCAL_BUFFER_SIZE)
+    {
+      destination_start_p = (uint8_t *) parser_malloc_local (context_p, literal_p->length);
+      context_p->allocated_buffer_p = destination_start_p;
+      context_p->allocated_buffer_size = literal_p->length;
+    }
+
+    destination_p = destination_start_p;
+
+    if (literal_p->type == LEXER_IDENT_LITERAL)
+    {
+      const uint8_t *source_end_p = context_p->source_end_p;
+
+      JERRY_ASSERT (literal_p->length <= PARSER_MAXIMUM_IDENT_LENGTH);
+
+      do
+      {
+        if (*source_p == LIT_CHAR_BACKSLASH)
+        {
+          destination_p += lit_char_to_utf8_bytes (destination_p,
+                                                   lexer_hex_to_character (context_p, source_p + 2, 4));
+          source_p += 6;
+          continue;
+        }
+
+        *destination_p++ = *source_p++;
+
+        while (source_p < source_end_p
+               && IS_UTF8_INTERMEDIATE_OCTET (*source_p))
+        {
+          *destination_p++ = *source_p++;
+        }
+      }
+      while (source_p < source_end_p
+             && (lit_char_is_identifier_part (source_p) || *source_p == LIT_CHAR_BACKSLASH));
+
+      JERRY_ASSERT (destination_p == destination_start_p + literal_p->length);
+    }
+    else
+    {
+      uint8_t str_end_character = source_p[-1];
+
+      while (true)
+      {
+        if (*source_p == str_end_character)
+        {
+          break;
+        }
+
+        if (*source_p == LIT_CHAR_BACKSLASH)
+        {
+          uint8_t conv_character;
+
+          source_p++;
+          JERRY_ASSERT (source_p < context_p->source_end_p);
+
+          /* Newline is ignored. */
+          if (*source_p == LIT_CHAR_CR
+              || *source_p == LIT_CHAR_LF
+              || (*source_p == LEXER_NEWLINE_LS_PS_BYTE_1 && LEXER_NEWLINE_LS_PS_BYTE_23 (source_p)))
+          {
+            if (*source_p == LIT_CHAR_CR)
+            {
+              source_p++;
+              JERRY_ASSERT (source_p < context_p->source_end_p);
+
+              if (*source_p == LIT_CHAR_LF)
+              {
+                source_p++;
+              }
+            }
+            else if (*source_p == LIT_CHAR_LF)
+            {
+              source_p++;
+            }
+            else
+            {
+              source_p += 3;
+            }
+            continue;
+          }
+
+          if (*source_p >= LIT_CHAR_0 && *source_p <= LIT_CHAR_3)
+          {
+            uint32_t octal_number = (uint32_t) (*source_p - LIT_CHAR_0);
+
+            source_p++;
+            JERRY_ASSERT (source_p < context_p->source_end_p);
+
+            if (*source_p >= LIT_CHAR_0 && *source_p <= LIT_CHAR_7)
+            {
+              octal_number = octal_number * 8 + (uint32_t) (*source_p - LIT_CHAR_0);
+              source_p++;
+              JERRY_ASSERT (source_p < context_p->source_end_p);
+
+              if (*source_p >= LIT_CHAR_0 && *source_p <= LIT_CHAR_7)
+              {
+                octal_number = octal_number * 8 + (uint32_t) (*source_p - LIT_CHAR_0);
+                source_p++;
+                JERRY_ASSERT (source_p < context_p->source_end_p);
+              }
+            }
+
+            destination_p += lit_char_to_utf8_bytes (destination_p, (uint16_t) octal_number);
+            continue;
+          }
+
+          if (*source_p >= LIT_CHAR_4 && *source_p <= LIT_CHAR_7)
+          {
+            uint32_t octal_number = (uint32_t) (*source_p - LIT_CHAR_0);
+
+            source_p++;
+            JERRY_ASSERT (source_p < context_p->source_end_p);
+
+            if (*source_p >= LIT_CHAR_0 && *source_p <= LIT_CHAR_7)
+            {
+              octal_number = octal_number * 8 + (uint32_t) (*source_p - LIT_CHAR_0);
+              source_p++;
+              JERRY_ASSERT (source_p < context_p->source_end_p);
+            }
+
+            *destination_p++ = (uint8_t) octal_number;
+            continue;
+          }
+
+          if (*source_p == LIT_CHAR_LOWERCASE_X || *source_p == LIT_CHAR_LOWERCASE_U)
+          {
+            int hex_part_length = (*source_p == LIT_CHAR_LOWERCASE_X) ? 2 : 4;
+            JERRY_ASSERT (source_p + 1 + hex_part_length <= context_p->source_end_p);
+
+            destination_p += lit_char_to_utf8_bytes (destination_p,
+                                                     lexer_hex_to_character (context_p,
+                                                                             source_p + 1,
+                                                                             hex_part_length));
+            source_p += hex_part_length + 1;
+            continue;
+          }
+
+          conv_character = *source_p;
+          switch (*source_p)
+          {
+            case LIT_CHAR_LOWERCASE_B:
+            {
+              conv_character = 0x08;
+              break;
+            }
+            case LIT_CHAR_LOWERCASE_T:
+            {
+              conv_character = 0x09;
+              break;
+            }
+            case LIT_CHAR_LOWERCASE_N:
+            {
+              conv_character = 0x0a;
+              break;
+            }
+            case LIT_CHAR_LOWERCASE_V:
+            {
+              conv_character = 0x0b;
+              break;
+            }
+            case LIT_CHAR_LOWERCASE_F:
+            {
+              conv_character = 0x0c;
+              break;
+            }
+            case LIT_CHAR_LOWERCASE_R:
+            {
+              conv_character = 0x0d;
+              break;
+            }
+          }
+
+          if (conv_character != *source_p)
+          {
+            *destination_p++ = conv_character;
+            source_p++;
+            continue;
+          }
+        }
+
+        if (*source_p >= LEXER_UTF8_4BYTE_START)
+        {
+          /* Processing 4 byte unicode sequence (even if it is
+           * after a backslash). Always converted to two 3 byte
+           * long sequence. */
+
+          uint32_t character = ((((uint32_t) source_p[0]) & 0x7) << 18);
+          character |= ((((uint32_t) source_p[1]) & LIT_UTF8_LAST_6_BITS_MASK) << 12);
+          character |= ((((uint32_t) source_p[2]) & LIT_UTF8_LAST_6_BITS_MASK) << 6);
+          character |= (((uint32_t) source_p[3]) & LIT_UTF8_LAST_6_BITS_MASK);
+
+          JERRY_ASSERT (character >= 0x10000);
+          character -= 0x10000;
+          destination_p += lit_char_to_utf8_bytes (destination_p,
+                                                   (ecma_char_t) (0xd800 | (character >> 10)));
+          destination_p += lit_char_to_utf8_bytes (destination_p,
+                                                   (ecma_char_t) (0xdc00 | (character & LIT_UTF16_LAST_10_BITS_MASK)));
+          source_p += 4;
+          continue;
+        }
+
+        *destination_p++ = *source_p++;
+
+        /* There is no need to check the source_end_p
+         * since the string is terminated by a quotation mark. */
+        while (IS_UTF8_INTERMEDIATE_OCTET (*source_p))
+        {
+          *destination_p++ = *source_p++;
+        }
+      }
+
+      JERRY_ASSERT (destination_p == destination_start_p + literal_p->length);
+    }
+
+    source_p = destination_start_p;
+  }
+
+  lexer_process_char_literal (context_p,
+                              source_p,
+                              literal_p->length,
+                              literal_type,
+                              literal_p->has_escape);
+
+  context_p->lit_object.type = LEXER_LITERAL_OBJECT_ANY;
+
+  if (literal_type == LEXER_IDENT_LITERAL)
+  {
+    if ((context_p->status_flags & PARSER_INSIDE_WITH)
+        && context_p->lit_object.literal_p->type == LEXER_IDENT_LITERAL)
+    {
+      context_p->lit_object.literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE;
+    }
+
+    if (literal_p->length == 4
+        && source_p[0] == LIT_CHAR_LOWERCASE_E
+        && source_p[3] == LIT_CHAR_LOWERCASE_L
+        && source_p[1] == LIT_CHAR_LOWERCASE_V
+        && source_p[2] == LIT_CHAR_LOWERCASE_A)
+    {
+      context_p->lit_object.type = LEXER_LITERAL_OBJECT_EVAL;
+    }
+
+    if (literal_p->length == 9
+        && source_p[0] == LIT_CHAR_LOWERCASE_A
+        && source_p[8] == LIT_CHAR_LOWERCASE_S
+        && memcmp (source_p + 1, "rgument", 7) == 0)
+    {
+      context_p->lit_object.type = LEXER_LITERAL_OBJECT_ARGUMENTS;
+      if (!(context_p->status_flags & PARSER_ARGUMENTS_NOT_NEEDED))
+      {
+        context_p->status_flags |= PARSER_ARGUMENTS_NEEDED | PARSER_LEXICAL_ENV_NEEDED;
+        context_p->lit_object.literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE;
+      }
+    }
+  }
+
+  if (destination_start_p != local_byte_array)
+  {
+    JERRY_ASSERT (context_p->allocated_buffer_p == destination_start_p);
+
+    context_p->allocated_buffer_p = NULL;
+    parser_free_local (destination_start_p,
+                       context_p->allocated_buffer_size);
+  }
+
+  JERRY_ASSERT (context_p->allocated_buffer_p == NULL);
+} /* lexer_construct_literal_object */
+
+#undef LEXER_MAX_LITERAL_LOCAL_BUFFER_SIZE
+
+/**
+ * Construct a number object.
+ *
+ * @return true if number is small number
+ */
+bool
+lexer_construct_number_object (parser_context_t *context_p, /**< context */
+                               bool push_number_allowed, /**< push number support is allowed */
+                               bool is_negative_number) /**< sign is negative */
+{
+  parser_list_iterator_t literal_iterator;
+  lexer_literal_t *literal_p;
+  ecma_number_t num;
+  uint32_t literal_index = 0;
+  uint16_t length = context_p->token.lit_location.length;
+
+  if (context_p->token.extra_value != LEXER_NUMBER_OCTAL)
+  {
+    num = ecma_utf8_string_to_number (context_p->token.lit_location.char_p,
+                                      length);
+  }
+  else
+  {
+    const uint8_t *src_p = context_p->token.lit_location.char_p;
+    const uint8_t *src_end_p = src_p + length - 1;
+
+    num = 0;
+    do
+    {
+      src_p++;
+      num = num * 8 + (ecma_number_t) (*src_p - LIT_CHAR_0);
+    }
+    while (src_p < src_end_p);
+  }
+
+  if (push_number_allowed)
+  {
+    int32_t int_num = (int32_t) num;
+
+    if (int_num == num)
+    {
+      if (int_num <= CBC_PUSH_NUMBER_BYTE_RANGE_END
+          && (int_num != 0 || !is_negative_number))
+      {
+        context_p->lit_object.index = (uint16_t) int_num;
+        return true;
+      }
+    }
+  }
+
+  if (is_negative_number)
+  {
+    num = -num;
+  }
+
+  jmem_cpointer_t lit_cp = ecma_find_or_create_literal_number (num);
+  parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
+
+  while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)) != NULL)
+  {
+    if (literal_p->type == LEXER_NUMBER_LITERAL
+        && literal_p->u.value == lit_cp)
+    {
+      context_p->lit_object.literal_p = literal_p;
+      context_p->lit_object.index = (uint16_t) literal_index;
+      context_p->lit_object.type = LEXER_LITERAL_OBJECT_ANY;
+      return false;
+    }
+
+    literal_index++;
+  }
+
+  JERRY_ASSERT (literal_index == context_p->literal_count);
+
+  if (literal_index >= PARSER_MAXIMUM_NUMBER_OF_LITERALS)
+  {
+    parser_raise_error (context_p, PARSER_ERR_LITERAL_LIMIT_REACHED);
+  }
+
+  literal_p = (lexer_literal_t *) parser_list_append (context_p, &context_p->literal_pool);
+  literal_p->prop.length = context_p->token.lit_location.length;
+  literal_p->type = LEXER_UNUSED_LITERAL;
+  literal_p->status_flags = 0;
+
+  context_p->literal_count++;
+
+  literal_p->u.value = lit_cp;
+  literal_p->type = LEXER_NUMBER_LITERAL;
+
+  context_p->lit_object.literal_p = literal_p;
+  context_p->lit_object.index = (uint16_t) literal_index;
+  context_p->lit_object.type = LEXER_LITERAL_OBJECT_ANY;
+
+  return false;
+} /* lexer_construct_number_object */
+
+/**
+ * Construct a function literal object.
+ *
+ * @return function object literal index
+ */
+uint16_t
+lexer_construct_function_object (parser_context_t *context_p, /**< context */
+                                 uint32_t extra_status_flags) /**< extra status flags */
+{
+  ecma_compiled_code_t *compiled_code_p;
+  lexer_literal_t *literal_p;
+  uint16_t result_index;
+
+  if (context_p->literal_count >= PARSER_MAXIMUM_NUMBER_OF_LITERALS)
+  {
+    parser_raise_error (context_p, PARSER_ERR_LITERAL_LIMIT_REACHED);
+  }
+
+  if (context_p->status_flags & PARSER_RESOLVE_THIS_FOR_CALLS)
+  {
+    extra_status_flags |= PARSER_RESOLVE_THIS_FOR_CALLS;
+  }
+
+  literal_p = (lexer_literal_t *) parser_list_append (context_p, &context_p->literal_pool);
+  literal_p->type = LEXER_UNUSED_LITERAL;
+  literal_p->status_flags = 0;
+
+  result_index = context_p->literal_count;
+  context_p->literal_count++;
+
+  compiled_code_p = parser_parse_function (context_p, extra_status_flags);
+
+  literal_p->u.bytecode_p = compiled_code_p;
+  literal_p->type = LEXER_FUNCTION_LITERAL;
+
+  return result_index;
+} /* lexer_construct_function_object */
+
+/**
+ * Construct a regular expression object.
+ */
+void
+lexer_construct_regexp_object (parser_context_t *context_p, /**< context */
+                               bool parse_only) /**< parse only */
+{
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+  const uint8_t *source_p = context_p->source_p;
+  const uint8_t *regex_start_p = context_p->source_p;
+  const uint8_t *regex_end_p = regex_start_p;
+  const uint8_t *source_end_p = context_p->source_end_p;
+  parser_line_counter_t column = context_p->column;
+  lexer_literal_t *literal_p;
+  bool in_class = false;
+  uint16_t current_flags;
+  lit_utf8_size_t length;
+
+  JERRY_ASSERT (context_p->token.type == LEXER_DIVIDE
+                || context_p->token.type == LEXER_ASSIGN_DIVIDE);
+
+  if (context_p->token.type == LEXER_ASSIGN_DIVIDE)
+  {
+    regex_start_p--;
+  }
+
+  while (true)
+  {
+    if (source_p >= source_end_p)
+    {
+      parser_raise_error (context_p, PARSER_ERR_UNTERMINATED_REGEXP);
+    }
+
+    if (!in_class && source_p[0] == LIT_CHAR_SLASH)
+    {
+      regex_end_p = source_p;
+      source_p++;
+      column++;
+      break;
+    }
+
+    switch (source_p[0])
+    {
+      case LIT_CHAR_CR:
+      case LIT_CHAR_LF:
+      case LEXER_NEWLINE_LS_PS_BYTE_1:
+      {
+        if (source_p[0] != LEXER_NEWLINE_LS_PS_BYTE_1
+            || LEXER_NEWLINE_LS_PS_BYTE_23 (source_p))
+        {
+          parser_raise_error (context_p, PARSER_ERR_NEWLINE_NOT_ALLOWED);
+        }
+        break;
+      }
+      case LIT_CHAR_TAB:
+      {
+        column = align_column_to_tab (column);
+         /* Subtract -1 because column is increased below. */
+        column--;
+        break;
+      }
+      case LIT_CHAR_LEFT_SQUARE:
+      {
+        in_class = true;
+        break;
+      }
+      case LIT_CHAR_RIGHT_SQUARE:
+      {
+        in_class = false;
+        break;
+      }
+      case LIT_CHAR_BACKSLASH:
+      {
+        if (source_p + 1 >= source_end_p)
+        {
+          parser_raise_error (context_p, PARSER_ERR_UNTERMINATED_REGEXP);
+        }
+
+        if (source_p[1] >= 0x20 && source_p[1] <= LIT_UTF8_1_BYTE_CODE_POINT_MAX)
+        {
+          source_p++;
+          column++;
+        }
+      }
+    }
+
+    source_p++;
+    column++;
+
+    while (source_p < source_end_p
+           && IS_UTF8_INTERMEDIATE_OCTET (source_p[0]))
+    {
+      source_p++;
+    }
+  }
+
+  current_flags = 0;
+  while (source_p < source_end_p)
+  {
+    uint32_t flag = 0;
+
+    if (source_p[0] == LIT_CHAR_LOWERCASE_G)
+    {
+      flag = RE_FLAG_GLOBAL;
+    }
+    else if (source_p[0] == LIT_CHAR_LOWERCASE_I)
+    {
+      flag = RE_FLAG_IGNORE_CASE;
+    }
+    else if (source_p[0] == LIT_CHAR_LOWERCASE_M)
+    {
+      flag = RE_FLAG_MULTILINE;
+    }
+
+    if (flag == 0)
+    {
+      break;
+    }
+
+    if (current_flags & flag)
+    {
+      parser_raise_error (context_p, PARSER_ERR_DUPLICATED_REGEXP_FLAG);
+    }
+
+    current_flags = (uint16_t) (current_flags | flag);
+    source_p++;
+    column++;
+  }
+
+  if (source_p < source_end_p
+      && lit_char_is_identifier_part (source_p))
+  {
+    parser_raise_error (context_p, PARSER_ERR_UNKNOWN_REGEXP_FLAG);
+  }
+
+  context_p->source_p = source_p;
+  context_p->column = column;
+
+  length = (lit_utf8_size_t) (regex_end_p - regex_start_p);
+  if (length > PARSER_MAXIMUM_STRING_LENGTH)
+  {
+    parser_raise_error (context_p, PARSER_ERR_REGEXP_TOO_LONG);
+  }
+
+  context_p->column = column;
+  context_p->source_p = source_p;
+
+  if (parse_only)
+  {
+    return;
+  }
+
+  if (context_p->literal_count >= PARSER_MAXIMUM_NUMBER_OF_LITERALS)
+  {
+    parser_raise_error (context_p, PARSER_ERR_LITERAL_LIMIT_REACHED);
+  }
+
+  literal_p = (lexer_literal_t *) parser_list_append (context_p, &context_p->literal_pool);
+  literal_p->prop.length = (uint16_t) length;
+  literal_p->type = LEXER_UNUSED_LITERAL;
+  literal_p->status_flags = 0;
+
+  context_p->literal_count++;
+
+  /* Compile the RegExp literal and store the RegExp bytecode pointer */
+  const re_compiled_code_t *re_bytecode_p = NULL;
+  ecma_value_t completion_value;
+
+  ecma_string_t *pattern_str_p = NULL;
+
+  if (lit_is_valid_cesu8_string (regex_start_p, length))
+  {
+    pattern_str_p = ecma_new_ecma_string_from_utf8 (regex_start_p, length);
+  }
+  else
+  {
+    JERRY_ASSERT (lit_is_valid_utf8_string (regex_start_p, length));
+    pattern_str_p = ecma_new_ecma_string_from_utf8_converted_to_cesu8 (regex_start_p, length);
+  }
+
+
+  completion_value = re_compile_bytecode (&re_bytecode_p,
+                                          pattern_str_p,
+                                          current_flags);
+  ecma_deref_ecma_string (pattern_str_p);
+
+  bool is_throw = ECMA_IS_VALUE_ERROR (completion_value);
+
+  ecma_free_value (completion_value);
+
+  if (is_throw)
+  {
+    parser_raise_error (context_p, PARSER_ERR_INVALID_REGEXP);
+  }
+
+  literal_p->type = LEXER_REGEXP_LITERAL;
+  literal_p->u.bytecode_p = (ecma_compiled_code_t *) re_bytecode_p;
+
+  context_p->token.type = LEXER_LITERAL;
+  context_p->token.literal_is_reserved = false;
+  context_p->token.lit_location.type = LEXER_REGEXP_LITERAL;
+
+  context_p->lit_object.literal_p = literal_p;
+  context_p->lit_object.index = (uint16_t) (context_p->literal_count - 1);
+  context_p->lit_object.type = LEXER_LITERAL_OBJECT_ANY;
+#else /* CONFIG_DISABLE_REGEXP_BUILTIN */
+  JERRY_UNUSED (parse_only);
+  parser_raise_error (context_p, PARSER_ERR_UNSUPPORTED_REGEXP);
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+} /* lexer_construct_regexp_object */
+
+/**
+ * Next token must be an identifier.
+ */
+void
+lexer_expect_identifier (parser_context_t *context_p, /**< context */
+                         uint8_t literal_type) /**< literal type */
+{
+  JERRY_ASSERT (literal_type == LEXER_STRING_LITERAL
+                || literal_type == LEXER_IDENT_LITERAL);
+
+  skip_spaces (context_p);
+  context_p->token.line = context_p->line;
+  context_p->token.column = context_p->column;
+
+  if (context_p->source_p < context_p->source_end_p
+      && (lit_char_is_identifier_start (context_p->source_p) || context_p->source_p[0] == LIT_CHAR_BACKSLASH))
+  {
+    lexer_parse_identifier (context_p, literal_type != LEXER_STRING_LITERAL);
+
+    if (context_p->token.type == LEXER_LITERAL)
+    {
+      lexer_construct_literal_object (context_p,
+                                      &context_p->token.lit_location,
+                                      literal_type);
+
+      if (literal_type == LEXER_IDENT_LITERAL
+          && (context_p->status_flags & PARSER_IS_STRICT)
+          && context_p->lit_object.type != LEXER_LITERAL_OBJECT_ANY)
+      {
+        parser_error_t error;
+
+        if (context_p->lit_object.type == LEXER_LITERAL_OBJECT_EVAL)
+        {
+          error = PARSER_ERR_EVAL_NOT_ALLOWED;
+        }
+        else
+        {
+          JERRY_ASSERT (context_p->lit_object.type == LEXER_LITERAL_OBJECT_ARGUMENTS);
+          error = PARSER_ERR_ARGUMENTS_NOT_ALLOWED;
+        }
+
+        parser_raise_error (context_p, error);
+      }
+
+      context_p->token.lit_location.type = literal_type;
+      return;
+    }
+  }
+
+  parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_EXPECTED);
+} /* lexer_expect_identifier */
+
+static const lexer_lit_location_t lexer_get_literal =
+{
+  (const uint8_t *) "get", 3, LEXER_IDENT_LITERAL, false
+};
+
+static const lexer_lit_location_t lexer_set_literal =
+{
+  (const uint8_t *) "set", 3, LEXER_IDENT_LITERAL, false
+};
+
+/**
+ * Next token must be an identifier.
+ */
+void
+lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
+                                bool must_be_identifier) /**< only identifiers are accepted */
+{
+  skip_spaces (context_p);
+
+  context_p->token.line = context_p->line;
+  context_p->token.column = context_p->column;
+
+  if (context_p->source_p < context_p->source_end_p)
+  {
+    bool create_literal_object = false;
+
+    if (lit_char_is_identifier_start (context_p->source_p) || context_p->source_p[0] == LIT_CHAR_BACKSLASH)
+    {
+      lexer_parse_identifier (context_p, false);
+
+      if (!must_be_identifier
+          && context_p->token.lit_location.length == 3)
+      {
+        skip_spaces (context_p);
+
+        if (context_p->source_p < context_p->source_end_p
+            && context_p->source_p[0] != LIT_CHAR_COLON)
+        {
+          if (lexer_compare_identifier_to_current (context_p, &lexer_get_literal))
+          {
+            context_p->token.type = LEXER_PROPERTY_GETTER;
+            return;
+          }
+          else if (lexer_compare_identifier_to_current (context_p, &lexer_set_literal))
+          {
+            context_p->token.type = LEXER_PROPERTY_SETTER;
+            return;
+          }
+        }
+      }
+
+      create_literal_object = true;
+    }
+    else if (context_p->source_p[0] == LIT_CHAR_DOUBLE_QUOTE
+             || context_p->source_p[0] == LIT_CHAR_SINGLE_QUOTE)
+    {
+      lexer_parse_string (context_p);
+      create_literal_object = true;
+    }
+    else if (!must_be_identifier && context_p->source_p[0] == LIT_CHAR_RIGHT_BRACE)
+    {
+      context_p->token.type = LEXER_RIGHT_BRACE;
+      context_p->source_p += 1;
+      context_p->column++;
+      return;
+    }
+    else
+    {
+      const uint8_t *char_p = context_p->source_p;
+
+      if (char_p[0] == LIT_CHAR_DOT)
+      {
+        char_p++;
+      }
+
+      if (char_p < context_p->source_end_p
+          && char_p[0] >= LIT_CHAR_0
+          && char_p[0] <= LIT_CHAR_9)
+      {
+        lexer_parse_number (context_p);
+        lexer_construct_number_object (context_p, false, false);
+        return;
+      }
+    }
+
+    if (create_literal_object)
+    {
+      lexer_construct_literal_object (context_p,
+                                      &context_p->token.lit_location,
+                                      LEXER_STRING_LITERAL);
+      return;
+    }
+  }
+
+  parser_raise_error (context_p, PARSER_ERR_PROPERTY_IDENTIFIER_EXPECTED);
+} /* lexer_expect_object_literal_id */
+
+/**
+ * Next token must be an identifier.
+ */
+void
+lexer_scan_identifier (parser_context_t *context_p, /**< context */
+                       bool propety_name) /**< property name */
+{
+  skip_spaces (context_p);
+  context_p->token.line = context_p->line;
+  context_p->token.column = context_p->column;
+
+  if (context_p->source_p < context_p->source_end_p
+      && (lit_char_is_identifier_start (context_p->source_p) || context_p->source_p[0] == LIT_CHAR_BACKSLASH))
+  {
+    lexer_parse_identifier (context_p, false);
+
+    if (propety_name && context_p->token.lit_location.length == 3)
+    {
+      skip_spaces (context_p);
+
+      if (context_p->source_p < context_p->source_end_p
+          && context_p->source_p[0] != LIT_CHAR_COLON)
+      {
+        if (lexer_compare_identifier_to_current (context_p, &lexer_get_literal))
+        {
+          context_p->token.type = LEXER_PROPERTY_GETTER;
+        }
+        else if (lexer_compare_identifier_to_current (context_p, &lexer_set_literal))
+        {
+          context_p->token.type = LEXER_PROPERTY_SETTER;
+        }
+      }
+    }
+    return;
+  }
+
+  if (propety_name)
+  {
+    lexer_next_token (context_p);
+
+    if (context_p->token.type == LEXER_LITERAL
+        || context_p->token.type == LEXER_RIGHT_BRACE)
+    {
+      return;
+    }
+  }
+
+  parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_EXPECTED);
+} /* lexer_scan_identifier */
+
+/**
+ * Compares the given identifier to that which is the current token
+ * in the parser context.
+ *
+ * @return true if the input identifiers are the same
+ */
+bool
+lexer_compare_identifier_to_current (parser_context_t *context_p,        /**< context */
+                                     const lexer_lit_location_t *right)  /**< identifier */
+{
+  lexer_lit_location_t *left = &context_p->token.lit_location;
+  const uint8_t *left_p;
+  const uint8_t *right_p;
+  size_t count;
+
+  JERRY_ASSERT (left->length > 0 && right->length > 0);
+
+  if (left->length != right->length)
+  {
+    return 0;
+  }
+
+  if (!left->has_escape && !right->has_escape)
+  {
+    return memcmp (left->char_p, right->char_p, left->length) == 0;
+  }
+
+  left_p = left->char_p;
+  right_p = right->char_p;
+  count = left->length;
+
+  do
+  {
+    uint8_t utf8_buf[3];
+    size_t utf8_len, offset;
+
+    /* Backslash cannot be part of a multibyte UTF-8 character. */
+    if (*left_p != LIT_CHAR_BACKSLASH && *right_p != LIT_CHAR_BACKSLASH)
+    {
+      if (*left_p++ != *right_p++)
+      {
+        return false;
+      }
+      count--;
+      continue;
+    }
+
+    if (*left_p == LIT_CHAR_BACKSLASH && *right_p == LIT_CHAR_BACKSLASH)
+    {
+      uint16_t left_chr = lexer_hex_to_character (context_p, left_p, 6);
+
+      if (left_chr != lexer_hex_to_character (context_p, right_p, 6))
+      {
+        return false;
+      }
+
+      left_p += 6;
+      right_p += 6;
+      count += lit_char_get_utf8_length (left_chr);
+      continue;
+    }
+
+    /* One character is encoded as unicode sequence. */
+    if (*right_p == LIT_CHAR_BACKSLASH)
+    {
+      /* The pointers can be swapped. */
+      const uint8_t *swap_p = left_p;
+      left_p = right_p;
+      right_p = swap_p;
+    }
+
+    utf8_len = lit_char_to_utf8_bytes (utf8_buf, lexer_hex_to_character (context_p, left_p, 6));
+    JERRY_ASSERT (utf8_len > 0);
+    count -= utf8_len;
+    offset = 0;
+
+    do
+    {
+      if (utf8_buf[offset] != *right_p++)
+      {
+        return false;
+      }
+      offset++;
+    }
+    while (offset < utf8_len);
+
+    left_p += 6;
+  }
+  while (count > 0);
+
+  return true;
+} /* lexer_compare_identifier_to_current */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* JERRY_JS_PARSER */
diff --git a/deps/jerry/jerry-core/parser/js/js-lexer.h b/deps/jerry/jerry-core/parser/js/js-lexer.h
new file mode 100644 (file)
index 0000000..45b3bec
--- /dev/null
@@ -0,0 +1,268 @@
+/* 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.
+ */
+
+#ifndef JS_LEXER_H
+#define JS_LEXER_H
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_lexer Lexer
+ * @{
+ */
+
+/**
+ * Lexer token types.
+ */
+typedef enum
+{
+  LEXER_EOS,                     /**< end of source */
+
+  /* Primary expressions */
+  LEXER_LITERAL,                 /**< literal token */
+  LEXER_KEYW_THIS,               /**< this */
+  LEXER_LIT_TRUE,                /**< true (not a keyword!) */
+  LEXER_LIT_FALSE,               /**< false (not a keyword!) */
+  LEXER_LIT_NULL,                /**< null (not a keyword!) */
+
+  /* Unary operators
+   * IMPORTANT: update CBC_UNARY_OP_TOKEN_TO_OPCODE and
+   *            CBC_UNARY_LVALUE_OP_TOKEN_TO_OPCODE after changes. */
+#define LEXER_IS_UNARY_OP_TOKEN(token_type) \
+  ((token_type) >= LEXER_PLUS && (token_type) <= LEXER_DECREASE)
+#define LEXER_IS_UNARY_LVALUE_OP_TOKEN(token_type) \
+  ((token_type) >= LEXER_KEYW_DELETE && (token_type) <= LEXER_DECREASE)
+
+  LEXER_PLUS,                    /**< "+" */
+  LEXER_NEGATE,                  /**< "-" */
+  LEXER_LOGICAL_NOT,             /**< "!" */
+  LEXER_BIT_NOT,                 /**< "~" */
+  LEXER_KEYW_VOID,               /**< void */
+  LEXER_KEYW_TYPEOF,             /**< typeof */
+  LEXER_KEYW_DELETE,             /**< delete */
+  LEXER_INCREASE,                /**< "++" */
+  LEXER_DECREASE,                /**< "--" */
+
+  /* Binary operators
+   * IMPORTANT: update CBC_BINARY_OP_TOKEN_TO_OPCODE,
+   *            CBC_BINARY_LVALUE_OP_TOKEN_TO_OPCODE and
+   *            parser_binary_precedence_table after changes. */
+#define LEXER_IS_BINARY_OP_TOKEN(token_type) \
+  ((token_type) >= LEXER_ASSIGN && (token_type) <= LEXER_MODULO)
+#define LEXER_IS_BINARY_LVALUE_TOKEN(token_type) \
+  ((token_type) >= LEXER_ASSIGN && (token_type) <= LEXER_ASSIGN_BIT_XOR)
+#define LEXER_FIRST_BINARY_OP LEXER_ASSIGN
+
+  LEXER_ASSIGN,                  /**< "=" (prec: 3) */
+  LEXER_ASSIGN_ADD,              /**< "+=" (prec: 3) */
+  LEXER_ASSIGN_SUBTRACT,         /**< "-=" (prec: 3) */
+  LEXER_ASSIGN_MULTIPLY,         /**< "*=" (prec: 3) */
+  LEXER_ASSIGN_DIVIDE,           /**< "/=" (prec: 3) */
+  LEXER_ASSIGN_MODULO,           /**< "%=" (prec: 3) */
+  LEXER_ASSIGN_LEFT_SHIFT,       /**< "<<=" (prec: 3) */
+  LEXER_ASSIGN_RIGHT_SHIFT,      /**< ">>=" (prec: 3) */
+  LEXER_ASSIGN_UNS_RIGHT_SHIFT,  /**< ">>>=" (prec: 3) */
+  LEXER_ASSIGN_BIT_AND,          /**< "&=" (prec: 3) */
+  LEXER_ASSIGN_BIT_OR,           /**< "|=" (prec: 3) */
+  LEXER_ASSIGN_BIT_XOR,          /**< "^=" (prec: 3) */
+  LEXER_QUESTION_MARK,           /**< "?" (prec: 4) */
+  LEXER_LOGICAL_OR,              /**< "||" (prec: 5) */
+  LEXER_LOGICAL_AND,             /**< "&&" (prec: 6) */
+  LEXER_BIT_OR,                  /**< "|" (prec: 7) */
+  LEXER_BIT_XOR,                 /**< "^" (prec: 8) */
+  LEXER_BIT_AND,                 /**< "&" (prec: 9) */
+  LEXER_EQUAL,                   /**< "==" (prec: 10) */
+  LEXER_NOT_EQUAL,               /**< "!=" (prec: 10) */
+  LEXER_STRICT_EQUAL,            /**< "===" (prec: 10) */
+  LEXER_STRICT_NOT_EQUAL,        /**< "!==" (prec: 10) */
+  LEXER_LESS,                    /**< "<" (prec: 11) */
+  LEXER_GREATER,                 /**< ">" (prec: 11) */
+  LEXER_LESS_EQUAL,              /**< "<=" (prec: 11) */
+  LEXER_GREATER_EQUAL,           /**< ">=" (prec: 11) */
+  LEXER_KEYW_IN,                 /**< in (prec: 11) */
+  LEXER_KEYW_INSTANCEOF,         /**< instanceof (prec: 11) */
+  LEXER_LEFT_SHIFT,              /**< "<<" (prec: 12) */
+  LEXER_RIGHT_SHIFT,             /**< ">>" (prec: 12) */
+  LEXER_UNS_RIGHT_SHIFT,         /**< ">>>" (prec: 12) */
+  LEXER_ADD,                     /**< "+" (prec: 13) */
+  LEXER_SUBTRACT,                /**< "-" (prec: 13) */
+  LEXER_MULTIPLY,                /**< "*" (prec: 14) */
+  LEXER_DIVIDE,                  /**< "/" (prec: 14) */
+  LEXER_MODULO,                  /**< "%" (prec: 14) */
+
+  LEXER_LEFT_BRACE,              /**< "{" */
+  LEXER_LEFT_PAREN,              /**< "(" */
+  LEXER_LEFT_SQUARE,             /**< "[" */
+  LEXER_RIGHT_BRACE,             /**< "}" */
+  LEXER_RIGHT_PAREN,             /**<_")" */
+  LEXER_RIGHT_SQUARE,            /**< "]" */
+  LEXER_DOT,                     /**< "." */
+  LEXER_SEMICOLON,               /**< ";" */
+  LEXER_COLON,                   /**< ":" */
+  LEXER_COMMA,                   /**< "," */
+
+  LEXER_KEYW_BREAK,              /**< break */
+  LEXER_KEYW_DO,                 /**< do */
+  LEXER_KEYW_CASE,               /**< case  */
+  LEXER_KEYW_ELSE,               /**< else */
+  LEXER_KEYW_NEW,                /**< new */
+  LEXER_KEYW_VAR,                /**< var */
+  LEXER_KEYW_CATCH,              /**< catch */
+  LEXER_KEYW_FINALLY,            /**< finally */
+  LEXER_KEYW_RETURN,             /**< return */
+  LEXER_KEYW_CONTINUE,           /**< continue */
+  LEXER_KEYW_FOR,                /**< for */
+  LEXER_KEYW_SWITCH,             /**< switch */
+  LEXER_KEYW_WHILE,              /**< while */
+  LEXER_KEYW_DEBUGGER,           /**< debugger */
+  LEXER_KEYW_FUNCTION,           /**< function */
+  LEXER_KEYW_WITH,               /**< with */
+  LEXER_KEYW_DEFAULT,            /**< default */
+  LEXER_KEYW_IF,                 /**< if */
+  LEXER_KEYW_THROW,              /**< throw */
+  LEXER_KEYW_TRY,                /**< try */
+
+  /* These are virtual tokens. */
+  LEXER_EXPRESSION_START,        /**< expression start */
+  LEXER_PROPERTY_GETTER,         /**< property getter function */
+  LEXER_PROPERTY_SETTER,         /**< property setter function */
+  LEXER_COMMA_SEP_LIST,          /**< comma separated bracketed expression list */
+  LEXER_SCAN_SWITCH,             /**< special value for switch pre-scan */
+
+  /* Future reserved words: these keywords
+   * must form a group after all other keywords. */
+#define LEXER_FIRST_FUTURE_RESERVED_WORD LEXER_KEYW_CLASS
+  LEXER_KEYW_CLASS,              /**< class */
+  LEXER_KEYW_ENUM,               /**< enum */
+  LEXER_KEYW_EXTENDS,            /**< extends */
+  LEXER_KEYW_SUPER,              /**< super */
+  LEXER_KEYW_CONST,              /**< const */
+  LEXER_KEYW_EXPORT,             /**< export */
+  LEXER_KEYW_IMPORT,             /**< import */
+
+  /* Future strict reserved words: these keywords
+   * must form a group after future reserved words. */
+#define LEXER_FIRST_FUTURE_STRICT_RESERVED_WORD LEXER_KEYW_IMPLEMENTS
+  LEXER_KEYW_IMPLEMENTS,         /**< implements */
+  LEXER_KEYW_LET,                /**< let */
+  LEXER_KEYW_PRIVATE,            /**< private */
+  LEXER_KEYW_PUBLIC,             /**< public */
+  LEXER_KEYW_YIELD,              /**< yield */
+  LEXER_KEYW_INTERFACE,          /**< interface */
+  LEXER_KEYW_PACKAGE,            /**< package */
+  LEXER_KEYW_PROTECTED,          /**< protected */
+  LEXER_KEYW_STATIC,             /**< static */
+} lexer_token_type_t;
+
+#define LEXER_NEWLINE_LS_PS_BYTE_1 0xe2
+#define LEXER_NEWLINE_LS_PS_BYTE_23(source) \
+  ((source)[1] == LIT_UTF8_2_BYTE_CODE_POINT_MIN && ((source)[2] | 0x1) == 0xa9)
+#define LEXER_UTF8_4BYTE_START 0xf0
+
+#define LEXER_IS_LEFT_BRACKET(type) \
+  ((type) == LEXER_LEFT_BRACE || (type) == LEXER_LEFT_PAREN || (type) == LEXER_LEFT_SQUARE)
+
+#define LEXER_IS_RIGHT_BRACKET(type) \
+  ((type) == LEXER_RIGHT_BRACE || (type) == LEXER_RIGHT_PAREN || (type) == LEXER_RIGHT_SQUARE)
+
+#define LEXER_UNARY_OP_TOKEN_TO_OPCODE(token_type) \
+   ((((token_type) - LEXER_PLUS) * 2) + CBC_PLUS)
+
+#define LEXER_UNARY_LVALUE_OP_TOKEN_TO_OPCODE(token_type) \
+   ((((token_type) - LEXER_INCREASE) * 6) + CBC_PRE_INCR)
+
+#define LEXER_BINARY_OP_TOKEN_TO_OPCODE(token_type) \
+   ((cbc_opcode_t) ((((token_type) - LEXER_BIT_OR) * 3) + CBC_BIT_OR))
+
+#define LEXER_BINARY_LVALUE_OP_TOKEN_TO_OPCODE(token_type) \
+   ((cbc_opcode_t) ((((token_type) - LEXER_ASSIGN_ADD) * 2) + CBC_ASSIGN_ADD))
+
+/**
+ * Lexer literal object types.
+ */
+typedef enum
+{
+  LEXER_LITERAL_OBJECT_ANY,                 /**< unspecified object type */
+  LEXER_LITERAL_OBJECT_EVAL,                /**< reference is equal to eval */
+  LEXER_LITERAL_OBJECT_ARGUMENTS,           /**< reference is equal to arguments */
+} lexer_literal_object_type_t;
+
+/**
+ * Lexer number types.
+ */
+typedef enum
+{
+  LEXER_NUMBER_DECIMAL,                     /**< decimal number */
+  LEXER_NUMBER_HEXADECIMAL,                 /**< hexadecimal number */
+  LEXER_NUMBER_OCTAL,                       /**< octal number */
+} lexer_number_type_t;
+
+/**
+ * Lexer character (string / identifier) literal data.
+ */
+typedef struct
+{
+  const uint8_t *char_p;                     /**< start of identifier or string token */
+  uint16_t length;                           /**< length or index of a literal */
+  uint8_t type;                              /**< type of the current literal */
+  uint8_t has_escape;                        /**< has escape sequences */
+} lexer_lit_location_t;
+
+/**
+ * Range of input string which processing is postponed.
+ */
+typedef struct
+{
+  const uint8_t *source_p;                   /**< next source byte */
+  const uint8_t *source_end_p;               /**< last source byte */
+  parser_line_counter_t line;                /**< token start line */
+  parser_line_counter_t column;              /**< token start column */
+} lexer_range_t;
+
+/**
+ * Lexer token.
+ */
+typedef struct
+{
+  uint8_t type;                              /**< token type */
+  uint8_t literal_is_reserved;               /**< future reserved keyword
+                                              *   (when char_literal.type is LEXER_IDENT_LITERAL) */
+  uint8_t extra_value;                       /**< helper value for different purposes */
+  uint8_t was_newline;                       /**< newline occured before this token */
+  parser_line_counter_t line;                /**< token start line */
+  parser_line_counter_t column;              /**< token start column */
+  lexer_lit_location_t lit_location;         /**< extra data for character literals */
+} lexer_token_t;
+
+/**
+ * Literal data set by lexer_construct_literal_object.
+ */
+typedef struct
+{
+  lexer_literal_t *literal_p;                /**< pointer to the literal object */
+  uint16_t index;                            /**< literal index */
+  uint8_t type;                              /**< literal object type */
+} lexer_lit_object_t;
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !JS_LEXER_H */
diff --git a/deps/jerry/jerry-core/parser/js/js-parser-expr.c b/deps/jerry/jerry-core/parser/js/js-parser-expr.c
new file mode 100644 (file)
index 0000000..cac2343
--- /dev/null
@@ -0,0 +1,1535 @@
+/* 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.
+ */
+
+#include "js-parser-internal.h"
+
+#if JERRY_JS_PARSER
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_expr Expression parser
+ * @{
+ */
+
+/**
+ * Precedence of the binary tokens.
+ *
+ * See also:
+ *    lexer_token_type_t
+ */
+static const uint8_t parser_binary_precedence_table[36] =
+{
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+  4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
+  11, 11, 11, 11, 11, 11, 12, 12, 12,
+  13, 13, 14, 14, 14
+};
+
+/**
+ * Generate byte code for operators with lvalue.
+ */
+static inline void
+parser_push_result (parser_context_t *context_p) /**< context */
+{
+  if (CBC_NO_RESULT_COMPOUND_ASSIGMENT (context_p->last_cbc_opcode))
+  {
+    context_p->last_cbc_opcode = (uint16_t) PARSER_TO_BINARY_OPERATION_WITH_RESULT (context_p->last_cbc_opcode);
+    parser_flush_cbc (context_p);
+  }
+  else if (CBC_NO_RESULT_OPERATION (context_p->last_cbc_opcode))
+  {
+    JERRY_ASSERT (CBC_SAME_ARGS (context_p->last_cbc_opcode, context_p->last_cbc_opcode + 1));
+
+    if (context_p->last_cbc_opcode == CBC_POST_INCR
+        || context_p->last_cbc_opcode == CBC_POST_DECR)
+    {
+      if (context_p->stack_depth >= context_p->stack_limit)
+      {
+        /* Stack limit is increased for CBC_POST_INCR_PUSH_RESULT
+         * and CBC_POST_DECR_PUSH_RESULT opcodes. Needed by vm.c. */
+        JERRY_ASSERT (context_p->stack_depth == context_p->stack_limit);
+
+        context_p->stack_limit++;
+
+        if (context_p->stack_limit > PARSER_MAXIMUM_STACK_LIMIT)
+        {
+          parser_raise_error (context_p, PARSER_ERR_STACK_LIMIT_REACHED);
+        }
+      }
+    }
+
+    context_p->last_cbc_opcode++;
+    parser_flush_cbc (context_p);
+  }
+} /* parser_push_result */
+
+/**
+ * Generate byte code for operators with lvalue.
+ */
+static void
+parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
+                                 cbc_opcode_t opcode) /**< opcode */
+{
+  if (PARSER_IS_PUSH_LITERAL (context_p->last_cbc_opcode)
+      && context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL)
+  {
+    if (context_p->status_flags & PARSER_IS_STRICT)
+    {
+      if (context_p->last_cbc.literal_object_type != LEXER_LITERAL_OBJECT_ANY)
+      {
+        parser_error_t error;
+
+        if (context_p->last_cbc.literal_object_type == LEXER_LITERAL_OBJECT_EVAL)
+        {
+          error = PARSER_ERR_EVAL_CANNOT_ASSIGNED;
+        }
+        else
+        {
+          JERRY_ASSERT (context_p->last_cbc.literal_object_type == LEXER_LITERAL_OBJECT_ARGUMENTS);
+          error = PARSER_ERR_ARGUMENTS_CANNOT_ASSIGNED;
+        }
+        parser_raise_error (context_p, error);
+      }
+      if (opcode == CBC_DELETE_PUSH_RESULT)
+      {
+        parser_raise_error (context_p, PARSER_ERR_DELETE_IDENT_NOT_ALLOWED);
+      }
+    }
+
+    if (opcode == CBC_DELETE_PUSH_RESULT)
+    {
+      context_p->status_flags |= PARSER_LEXICAL_ENV_NEEDED;
+
+      if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+      {
+        context_p->last_cbc_opcode = CBC_DELETE_IDENT_PUSH_RESULT;
+      }
+      else if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+      {
+        context_p->last_cbc_opcode = CBC_PUSH_LITERAL;
+        parser_emit_cbc_literal (context_p,
+                                 CBC_DELETE_IDENT_PUSH_RESULT,
+                                 context_p->last_cbc.value);
+      }
+      else
+      {
+        JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_THREE_LITERALS);
+
+        context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+        parser_emit_cbc_literal (context_p,
+                                 CBC_DELETE_IDENT_PUSH_RESULT,
+                                 context_p->last_cbc.third_literal_index);
+      }
+      return;
+    }
+
+    JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_LITERAL, opcode + CBC_UNARY_LVALUE_WITH_IDENT));
+
+    if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+    {
+      context_p->last_cbc_opcode = (uint16_t) (opcode + CBC_UNARY_LVALUE_WITH_IDENT);
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+    {
+      context_p->last_cbc_opcode = CBC_PUSH_LITERAL;
+      parser_emit_cbc_literal (context_p,
+                               (uint16_t) (opcode + CBC_UNARY_LVALUE_WITH_IDENT),
+                               context_p->last_cbc.value);
+    }
+    else
+    {
+      JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_THREE_LITERALS);
+
+      context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+      parser_emit_cbc_literal (context_p,
+                               (uint16_t) (opcode + CBC_UNARY_LVALUE_WITH_IDENT),
+                               context_p->last_cbc.third_literal_index);
+    }
+  }
+  else if (context_p->last_cbc_opcode == CBC_PUSH_PROP)
+  {
+    JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP, opcode));
+    context_p->last_cbc_opcode = (uint16_t) opcode;
+  }
+  else
+  {
+    switch (context_p->last_cbc_opcode)
+    {
+      case CBC_PUSH_PROP_LITERAL:
+      {
+        JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP_LITERAL, CBC_PUSH_LITERAL));
+        context_p->last_cbc_opcode = CBC_PUSH_LITERAL;
+        break;
+      }
+      case CBC_PUSH_PROP_LITERAL_LITERAL:
+      {
+        JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP_LITERAL_LITERAL, CBC_PUSH_TWO_LITERALS));
+        context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+        break;
+      }
+      case CBC_PUSH_PROP_THIS_LITERAL:
+      {
+        JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP_THIS_LITERAL, CBC_PUSH_THIS_LITERAL));
+        context_p->last_cbc_opcode = CBC_PUSH_THIS_LITERAL;
+        break;
+      }
+      default:
+      {
+        /* Invalid LeftHandSide expression. */
+        parser_emit_cbc_ext (context_p, (opcode == CBC_DELETE_PUSH_RESULT) ? CBC_EXT_PUSH_UNDEFINED_BASE
+                                                                           : CBC_EXT_THROW_REFERENCE_ERROR);
+        break;
+      }
+    }
+    parser_emit_cbc (context_p, opcode);
+  }
+} /* parser_emit_unary_lvalue_opcode */
+
+/**
+ * Parse array literal.
+ */
+static void
+parser_parse_array_literal (parser_context_t *context_p) /**< context */
+{
+  uint32_t pushed_items = 0;
+
+  JERRY_ASSERT (context_p->token.type == LEXER_LEFT_SQUARE);
+
+  parser_emit_cbc (context_p, CBC_CREATE_ARRAY);
+  lexer_next_token (context_p);
+
+  while (true)
+  {
+    if (context_p->token.type == LEXER_RIGHT_SQUARE)
+    {
+      if (pushed_items > 0)
+      {
+        parser_emit_cbc_call (context_p, CBC_ARRAY_APPEND, pushed_items);
+      }
+      return;
+    }
+
+    pushed_items++;
+
+    if (context_p->token.type == LEXER_COMMA)
+    {
+      parser_emit_cbc (context_p, CBC_PUSH_ELISION);
+      lexer_next_token (context_p);
+    }
+    else
+    {
+      parser_parse_expression (context_p, PARSE_EXPR_NO_COMMA);
+
+      if (context_p->token.type == LEXER_COMMA)
+      {
+        lexer_next_token (context_p);
+      }
+      else if (context_p->token.type != LEXER_RIGHT_SQUARE)
+      {
+        parser_raise_error (context_p, PARSER_ERR_ARRAY_ITEM_SEPARATOR_EXPECTED);
+      }
+    }
+
+    if (pushed_items >= 64)
+    {
+      parser_emit_cbc_call (context_p, CBC_ARRAY_APPEND, pushed_items);
+      pushed_items = 0;
+    }
+  }
+} /* parser_parse_array_literal */
+
+/**
+ * Object literal item types.
+ */
+typedef enum
+{
+  PARSER_OBJECT_PROPERTY_START,                /**< marks the start of the property list */
+  PARSER_OBJECT_PROPERTY_VALUE,                /**< value property */
+  PARSER_OBJECT_PROPERTY_GETTER,               /**< getter property */
+  PARSER_OBJECT_PROPERTY_SETTER,               /**< setter property */
+  PARSER_OBJECT_PROPERTY_BOTH_ACCESSORS,       /**< both getter and setter properties are set */
+} parser_object_literal_item_types_t;
+
+/**
+ * Parse object literal.
+ */
+static void
+parser_append_object_literal_item (parser_context_t *context_p, /**< context */
+                                   uint16_t item_index, /**< index of the item name */
+                                   parser_object_literal_item_types_t item_type) /**< type of the item */
+{
+  parser_stack_iterator_t iterator;
+  uint8_t *current_item_type_p;
+
+  iterator.current_p = context_p->stack.first_p;
+  iterator.current_position = context_p->stack.last_position;
+
+  while (true)
+  {
+    current_item_type_p = iterator.current_p->bytes + iterator.current_position - 1;
+
+    if (*current_item_type_p == PARSER_OBJECT_PROPERTY_START)
+    {
+      parser_stack_push_uint16 (context_p, item_index);
+      parser_stack_push_uint8 (context_p, (uint8_t) item_type);
+      return;
+    }
+
+    iterator.current_position--;
+    if (iterator.current_position == 0)
+    {
+      iterator.current_p = iterator.current_p->next_p;
+      iterator.current_position = PARSER_STACK_PAGE_SIZE;
+    }
+
+    uint32_t current_item_index = iterator.current_p->bytes[iterator.current_position - 1];
+
+    iterator.current_position--;
+    if (iterator.current_position == 0)
+    {
+      iterator.current_p = iterator.current_p->next_p;
+      iterator.current_position = PARSER_STACK_PAGE_SIZE;
+    }
+
+    current_item_index |= ((uint32_t) iterator.current_p->bytes[iterator.current_position - 1]) << 8;
+
+    iterator.current_position--;
+    if (iterator.current_position == 0)
+    {
+      iterator.current_p = iterator.current_p->next_p;
+      iterator.current_position = PARSER_STACK_PAGE_SIZE;
+    }
+
+    if (current_item_index == item_index)
+    {
+      if (item_type == PARSER_OBJECT_PROPERTY_VALUE
+          && *current_item_type_p == PARSER_OBJECT_PROPERTY_VALUE
+          && !(context_p->status_flags & PARSER_IS_STRICT))
+      {
+        return;
+      }
+
+      if (item_type == PARSER_OBJECT_PROPERTY_GETTER
+          && *current_item_type_p == PARSER_OBJECT_PROPERTY_SETTER)
+      {
+        break;
+      }
+
+      if (item_type == PARSER_OBJECT_PROPERTY_SETTER
+          && *current_item_type_p == PARSER_OBJECT_PROPERTY_GETTER)
+      {
+        break;
+      }
+
+      parser_raise_error (context_p, PARSER_ERR_OBJECT_PROPERTY_REDEFINED);
+    }
+  }
+
+  uint8_t *last_page_p = context_p->stack.first_p->bytes;
+
+  *current_item_type_p = PARSER_OBJECT_PROPERTY_BOTH_ACCESSORS;
+
+  if (current_item_type_p == (last_page_p + context_p->stack.last_position - 1))
+  {
+    context_p->stack_top_uint8 = PARSER_OBJECT_PROPERTY_BOTH_ACCESSORS;
+  }
+} /* parser_append_object_literal_item */
+
+/**
+ * Parse object literal.
+ */
+static void
+parser_parse_object_literal (parser_context_t *context_p) /**< context */
+{
+  JERRY_ASSERT (context_p->token.type == LEXER_LEFT_BRACE);
+
+  parser_emit_cbc (context_p, CBC_CREATE_OBJECT);
+
+  parser_stack_push_uint8 (context_p, PARSER_OBJECT_PROPERTY_START);
+
+  while (true)
+  {
+    lexer_expect_object_literal_id (context_p, false);
+
+    if (context_p->token.type == LEXER_RIGHT_BRACE)
+    {
+      break;
+    }
+
+    if (context_p->token.type == LEXER_PROPERTY_GETTER
+        || context_p->token.type == LEXER_PROPERTY_SETTER)
+    {
+      uint32_t status_flags;
+      cbc_ext_opcode_t opcode;
+      uint16_t literal_index, function_literal_index;
+      parser_object_literal_item_types_t item_type;
+
+      if (context_p->token.type == LEXER_PROPERTY_GETTER)
+      {
+        status_flags = PARSER_IS_FUNCTION | PARSER_IS_CLOSURE | PARSER_IS_PROPERTY_GETTER;
+        opcode = CBC_EXT_SET_GETTER;
+        item_type = PARSER_OBJECT_PROPERTY_GETTER;
+      }
+      else
+      {
+        status_flags = PARSER_IS_FUNCTION | PARSER_IS_CLOSURE | PARSER_IS_PROPERTY_SETTER;
+        opcode = CBC_EXT_SET_SETTER;
+        item_type = PARSER_OBJECT_PROPERTY_SETTER;
+      }
+
+      if (context_p->status_flags & PARSER_INSIDE_WITH)
+      {
+        status_flags |= PARSER_RESOLVE_THIS_FOR_CALLS;
+      }
+
+      lexer_expect_object_literal_id (context_p, true);
+      literal_index = context_p->lit_object.index;
+
+      parser_append_object_literal_item (context_p, literal_index, item_type);
+
+      parser_flush_cbc (context_p);
+      function_literal_index = lexer_construct_function_object (context_p, status_flags);
+
+      parser_emit_cbc_literal (context_p,
+                               CBC_PUSH_LITERAL,
+                               literal_index);
+
+      JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_LITERAL);
+      context_p->last_cbc_opcode = PARSER_TO_EXT_OPCODE (opcode);
+      context_p->last_cbc.value = function_literal_index;
+
+      lexer_next_token (context_p);
+    }
+    else
+    {
+      uint16_t literal_index = context_p->lit_object.index;
+
+      parser_append_object_literal_item (context_p,
+                                         literal_index,
+                                         PARSER_OBJECT_PROPERTY_VALUE);
+
+      lexer_next_token (context_p);
+      if (context_p->token.type != LEXER_COLON)
+      {
+        parser_raise_error (context_p, PARSER_ERR_COLON_EXPECTED);
+      }
+
+      lexer_next_token (context_p);
+      parser_parse_expression (context_p, PARSE_EXPR_NO_COMMA);
+
+      parser_emit_cbc_literal (context_p, CBC_SET_PROPERTY, literal_index);
+    }
+
+    if (context_p->token.type == LEXER_RIGHT_BRACE)
+    {
+      break;
+    }
+    else if (context_p->token.type != LEXER_COMMA)
+    {
+      parser_raise_error (context_p, PARSER_ERR_OBJECT_ITEM_SEPARATOR_EXPECTED);
+    }
+  }
+
+  while (context_p->stack_top_uint8 != PARSER_OBJECT_PROPERTY_START)
+  {
+    parser_stack_pop (context_p, NULL, 3);
+  }
+
+  parser_stack_pop_uint8 (context_p);
+} /* parser_parse_object_literal */
+
+/**
+ * Parse and record unary operators, and parse the primary literal.
+ */
+static void
+parser_parse_unary_expression (parser_context_t *context_p, /**< context */
+                               size_t *grouping_level_p) /**< grouping level */
+{
+  int new_was_seen = 0;
+
+  /* Collect unary operators. */
+  while (true)
+  {
+    /* Convert plus and minus binary operators to unary operators. */
+    if (context_p->token.type == LEXER_ADD)
+    {
+      context_p->token.type = LEXER_PLUS;
+    }
+    else if (context_p->token.type == LEXER_SUBTRACT)
+    {
+      context_p->token.type = LEXER_NEGATE;
+    }
+
+    /* Bracketed expressions are primary expressions. At this
+     * point their left paren is pushed onto the stack and
+     * they are processed when their closing paren is reached. */
+    if (context_p->token.type == LEXER_LEFT_PAREN)
+    {
+      (*grouping_level_p)++;
+      new_was_seen = 0;
+    }
+    else if (context_p->token.type == LEXER_KEYW_NEW)
+    {
+      /* After 'new' unary operators are not allowed. */
+      new_was_seen = 1;
+    }
+    else if (new_was_seen || !LEXER_IS_UNARY_OP_TOKEN (context_p->token.type))
+    {
+      break;
+    }
+
+    parser_stack_push_uint8 (context_p, context_p->token.type);
+    lexer_next_token (context_p);
+  }
+
+  /* Parse primary expression. */
+  switch (context_p->token.type)
+  {
+    case LEXER_LITERAL:
+    {
+      cbc_opcode_t opcode = CBC_PUSH_LITERAL;
+
+      if (context_p->token.lit_location.type == LEXER_IDENT_LITERAL
+          || context_p->token.lit_location.type == LEXER_STRING_LITERAL)
+      {
+        lexer_construct_literal_object (context_p,
+                                        &context_p->token.lit_location,
+                                        context_p->token.lit_location.type);
+      }
+      else if (context_p->token.lit_location.type == LEXER_NUMBER_LITERAL)
+      {
+        bool is_negative_number = false;
+
+        while (context_p->stack_top_uint8 == LEXER_PLUS
+               || context_p->stack_top_uint8 == LEXER_NEGATE)
+        {
+          if (context_p->stack_top_uint8 == LEXER_NEGATE)
+          {
+            is_negative_number = !is_negative_number;
+          }
+          parser_stack_pop_uint8 (context_p);
+        }
+
+        if (lexer_construct_number_object (context_p, true, is_negative_number))
+        {
+          JERRY_ASSERT (context_p->lit_object.index <= CBC_PUSH_NUMBER_BYTE_RANGE_END);
+
+          if (context_p->lit_object.index == 0)
+          {
+            parser_emit_cbc (context_p, CBC_PUSH_NUMBER_0);
+            break;
+          }
+
+          parser_emit_cbc_push_number (context_p, is_negative_number);
+          break;
+        }
+      }
+
+      if (context_p->lit_object.type != LEXER_LITERAL_OBJECT_EVAL)
+      {
+        if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+        {
+          context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+          context_p->last_cbc.value = context_p->lit_object.index;
+          context_p->last_cbc.literal_type = context_p->token.lit_location.type;
+          context_p->last_cbc.literal_object_type = context_p->lit_object.type;
+          break;
+        }
+
+        if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+        {
+          context_p->last_cbc_opcode = CBC_PUSH_THREE_LITERALS;
+          context_p->last_cbc.third_literal_index = context_p->lit_object.index;
+          context_p->last_cbc.literal_type = context_p->token.lit_location.type;
+          context_p->last_cbc.literal_object_type = context_p->lit_object.type;
+          break;
+        }
+
+        if (context_p->last_cbc_opcode == CBC_PUSH_THIS)
+        {
+          context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+          opcode = CBC_PUSH_THIS_LITERAL;
+        }
+      }
+
+      parser_emit_cbc_literal_from_token (context_p, opcode);
+      break;
+    }
+    case LEXER_KEYW_FUNCTION:
+    {
+      int literals = 0;
+      uint16_t literal1 = 0;
+      uint16_t literal2 = 0;
+      uint16_t function_literal_index;
+
+      if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+      {
+        literals = 1;
+        literal1 = context_p->last_cbc.literal_index;
+        context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      }
+      else if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+      {
+        literals = 2;
+        literal1 = context_p->last_cbc.literal_index;
+        literal2 = context_p->last_cbc.value;
+        context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      }
+      else
+      {
+        parser_flush_cbc (context_p);
+      }
+
+      uint32_t status_flags = PARSER_IS_FUNCTION | PARSER_IS_FUNC_EXPRESSION | PARSER_IS_CLOSURE;
+
+      if (context_p->status_flags & PARSER_INSIDE_WITH)
+      {
+        status_flags |= PARSER_RESOLVE_THIS_FOR_CALLS;
+      }
+
+      function_literal_index = lexer_construct_function_object (context_p, status_flags);
+
+      JERRY_ASSERT (context_p->last_cbc_opcode == PARSER_CBC_UNAVAILABLE);
+
+      if (literals == 1)
+      {
+        context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+        context_p->last_cbc.literal_index = literal1;
+        context_p->last_cbc.value = function_literal_index;
+      }
+      else if (literals == 2)
+      {
+        context_p->last_cbc_opcode = CBC_PUSH_THREE_LITERALS;
+        context_p->last_cbc.literal_index = literal1;
+        context_p->last_cbc.value = literal2;
+        context_p->last_cbc.third_literal_index = function_literal_index;
+      }
+      else
+      {
+        parser_emit_cbc_literal (context_p,
+                                 CBC_PUSH_LITERAL,
+                                 function_literal_index);
+      }
+
+      context_p->last_cbc.literal_type = LEXER_FUNCTION_LITERAL;
+      context_p->last_cbc.literal_object_type = LEXER_LITERAL_OBJECT_ANY;
+      break;
+    }
+    case LEXER_LEFT_BRACE:
+    {
+      parser_parse_object_literal (context_p);
+      break;
+    }
+    case LEXER_LEFT_SQUARE:
+    {
+      parser_parse_array_literal (context_p);
+      break;
+    }
+    case LEXER_DIVIDE:
+    case LEXER_ASSIGN_DIVIDE:
+    {
+      lexer_construct_regexp_object (context_p, false);
+
+      if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+      {
+        context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+        context_p->last_cbc.value = (uint16_t) (context_p->literal_count - 1);
+      }
+      else if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+      {
+        context_p->last_cbc_opcode = CBC_PUSH_THREE_LITERALS;
+        context_p->last_cbc.third_literal_index = (uint16_t) (context_p->literal_count - 1);
+      }
+      else
+      {
+        parser_emit_cbc_literal (context_p,
+                                 CBC_PUSH_LITERAL,
+                                 (uint16_t) (context_p->literal_count - 1));
+      }
+
+      context_p->last_cbc.literal_type = LEXER_REGEXP_LITERAL;
+      context_p->last_cbc.literal_object_type = LEXER_LITERAL_OBJECT_ANY;
+      break;
+    }
+    case LEXER_KEYW_THIS:
+    {
+      parser_emit_cbc (context_p, CBC_PUSH_THIS);
+      break;
+    }
+    case LEXER_LIT_TRUE:
+    {
+      parser_emit_cbc (context_p, CBC_PUSH_TRUE);
+      break;
+    }
+    case LEXER_LIT_FALSE:
+    {
+      parser_emit_cbc (context_p, CBC_PUSH_FALSE);
+      break;
+    }
+    case LEXER_LIT_NULL:
+    {
+      parser_emit_cbc (context_p, CBC_PUSH_NULL);
+      break;
+    }
+    default:
+    {
+      parser_raise_error (context_p, PARSER_ERR_PRIMARY_EXP_EXPECTED);
+      break;
+    }
+  }
+  lexer_next_token (context_p);
+} /* parser_parse_unary_expression */
+
+/**
+ * Parse the postfix part of unary operators, and
+ * generate byte code for the whole expression.
+ */
+static void
+parser_process_unary_expression (parser_context_t *context_p) /**< context */
+{
+  /* Parse postfix part of a primary expression. */
+  while (true)
+  {
+    /* Since break would only break the switch, we use
+     * continue to continue this loop. Without continue,
+     * the code abandons the loop. */
+    switch (context_p->token.type)
+    {
+      case LEXER_DOT:
+      {
+        parser_push_result (context_p);
+
+        lexer_expect_identifier (context_p, LEXER_STRING_LITERAL);
+        JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
+                      && context_p->token.lit_location.type == LEXER_STRING_LITERAL);
+
+        if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+        {
+          JERRY_ASSERT (CBC_ARGS_EQ (CBC_PUSH_PROP_LITERAL_LITERAL,
+                                     CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2));
+          context_p->last_cbc_opcode = CBC_PUSH_PROP_LITERAL_LITERAL;
+          context_p->last_cbc.value = context_p->lit_object.index;
+        }
+        else if (context_p->last_cbc_opcode == CBC_PUSH_THIS)
+        {
+          context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+          parser_emit_cbc_literal_from_token (context_p, CBC_PUSH_PROP_THIS_LITERAL);
+        }
+        else
+        {
+          parser_emit_cbc_literal_from_token (context_p, CBC_PUSH_PROP_LITERAL);
+        }
+        lexer_next_token (context_p);
+        continue;
+      }
+
+      case LEXER_LEFT_SQUARE:
+      {
+        parser_push_result (context_p);
+
+        lexer_next_token (context_p);
+        parser_parse_expression (context_p, PARSE_EXPR);
+        if (context_p->token.type != LEXER_RIGHT_SQUARE)
+        {
+          parser_raise_error (context_p, PARSER_ERR_RIGHT_SQUARE_EXPECTED);
+        }
+        lexer_next_token (context_p);
+
+        if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+        {
+          context_p->last_cbc_opcode = CBC_PUSH_PROP_LITERAL;
+        }
+        else if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+        {
+          context_p->last_cbc_opcode = CBC_PUSH_PROP_LITERAL_LITERAL;
+        }
+        else if (context_p->last_cbc_opcode == CBC_PUSH_THIS_LITERAL)
+        {
+          context_p->last_cbc_opcode = CBC_PUSH_PROP_THIS_LITERAL;
+        }
+        else
+        {
+          parser_emit_cbc (context_p, CBC_PUSH_PROP);
+        }
+        continue;
+      }
+
+      case LEXER_LEFT_PAREN:
+      {
+        size_t call_arguments = 0;
+        uint16_t opcode = CBC_CALL;
+        bool is_eval = false;
+
+        parser_push_result (context_p);
+
+        if (context_p->stack_top_uint8 == LEXER_KEYW_NEW)
+        {
+          parser_stack_pop_uint8 (context_p);
+          opcode = CBC_NEW;
+        }
+        else
+        {
+          if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL
+              && context_p->last_cbc.literal_object_type == LEXER_LITERAL_OBJECT_EVAL)
+          {
+            JERRY_ASSERT (context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL);
+            context_p->status_flags |= PARSER_ARGUMENTS_NEEDED | PARSER_LEXICAL_ENV_NEEDED | PARSER_NO_REG_STORE;
+            is_eval = true;
+          }
+
+          if (context_p->last_cbc_opcode == CBC_PUSH_PROP)
+          {
+            context_p->last_cbc_opcode = CBC_PUSH_PROP_REFERENCE;
+            opcode = CBC_CALL_PROP;
+          }
+          else if (context_p->last_cbc_opcode == CBC_PUSH_PROP_LITERAL)
+          {
+            context_p->last_cbc_opcode = CBC_PUSH_PROP_LITERAL_REFERENCE;
+            opcode = CBC_CALL_PROP;
+          }
+          else if (context_p->last_cbc_opcode == CBC_PUSH_PROP_LITERAL_LITERAL)
+          {
+            context_p->last_cbc_opcode = CBC_PUSH_PROP_LITERAL_LITERAL_REFERENCE;
+            opcode = CBC_CALL_PROP;
+          }
+          else if (context_p->last_cbc_opcode == CBC_PUSH_PROP_THIS_LITERAL)
+          {
+            context_p->last_cbc_opcode = CBC_PUSH_PROP_THIS_LITERAL_REFERENCE;
+            opcode = CBC_CALL_PROP;
+          }
+          else if ((context_p->status_flags & (PARSER_INSIDE_WITH | PARSER_RESOLVE_THIS_FOR_CALLS))
+                   && PARSER_IS_PUSH_LITERAL (context_p->last_cbc_opcode)
+                   && context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL)
+          {
+            opcode = CBC_CALL_PROP;
+
+            if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+            {
+              context_p->last_cbc_opcode = CBC_PUSH_IDENT_REFERENCE;
+            }
+            else if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+            {
+              context_p->last_cbc_opcode = CBC_PUSH_LITERAL;
+              parser_emit_cbc_literal (context_p,
+                                       CBC_PUSH_IDENT_REFERENCE,
+                                       context_p->last_cbc.value);
+            }
+            else
+            {
+              JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_THREE_LITERALS);
+
+              context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+              parser_emit_cbc_literal (context_p,
+                                       CBC_PUSH_IDENT_REFERENCE,
+                                       context_p->last_cbc.third_literal_index);
+            }
+          }
+        }
+
+        lexer_next_token (context_p);
+
+        if (context_p->token.type != LEXER_RIGHT_PAREN)
+        {
+          while (true)
+          {
+            if (++call_arguments > CBC_MAXIMUM_BYTE_VALUE)
+            {
+              parser_raise_error (context_p, PARSER_ERR_ARGUMENT_LIMIT_REACHED);
+            }
+
+            parser_parse_expression (context_p, PARSE_EXPR_NO_COMMA);
+
+            if (context_p->token.type != LEXER_COMMA)
+            {
+              break;
+            }
+            lexer_next_token (context_p);
+          }
+
+          if (context_p->token.type != LEXER_RIGHT_PAREN)
+          {
+            parser_raise_error (context_p, PARSER_ERR_RIGHT_PAREN_EXPECTED);
+          }
+        }
+
+        lexer_next_token (context_p);
+
+        if (is_eval)
+        {
+          parser_emit_cbc (context_p, CBC_EVAL);
+        }
+
+        if (call_arguments == 0)
+        {
+          if (opcode == CBC_CALL)
+          {
+            parser_emit_cbc (context_p, CBC_CALL0);
+            continue;
+          }
+          if (opcode == CBC_CALL_PROP)
+          {
+            parser_emit_cbc (context_p, CBC_CALL0_PROP);
+            continue;
+          }
+          if (opcode == CBC_NEW)
+          {
+            parser_emit_cbc (context_p, CBC_NEW0);
+            continue;
+          }
+        }
+
+        if (call_arguments == 1)
+        {
+          if (opcode == CBC_CALL)
+          {
+            parser_emit_cbc (context_p, CBC_CALL1);
+            continue;
+          }
+          if (opcode == CBC_CALL_PROP)
+          {
+            parser_emit_cbc (context_p, CBC_CALL1_PROP);
+            continue;
+          }
+          if (opcode == CBC_NEW)
+          {
+            parser_emit_cbc (context_p, CBC_NEW1);
+            continue;
+          }
+        }
+
+        if (call_arguments == 2)
+        {
+          if (opcode == CBC_CALL)
+          {
+            parser_emit_cbc (context_p, CBC_CALL2);
+            continue;
+          }
+          if (opcode == CBC_CALL_PROP)
+          {
+            parser_flush_cbc (context_p);
+            /* Manually adjusting stack usage. */
+            JERRY_ASSERT (context_p->stack_depth > 0);
+            context_p->stack_depth--;
+            parser_emit_cbc (context_p, CBC_CALL2_PROP);
+            continue;
+          }
+        }
+
+        parser_emit_cbc_call (context_p, opcode, call_arguments);
+        continue;
+      }
+
+      default:
+      {
+        if (context_p->stack_top_uint8 == LEXER_KEYW_NEW)
+        {
+          parser_push_result (context_p);
+          parser_emit_cbc (context_p, CBC_NEW0);
+          parser_stack_pop_uint8 (context_p);
+          continue;
+        }
+
+        if (!context_p->token.was_newline
+            && (context_p->token.type == LEXER_INCREASE || context_p->token.type == LEXER_DECREASE))
+        {
+          cbc_opcode_t opcode = (context_p->token.type == LEXER_INCREASE) ? CBC_POST_INCR : CBC_POST_DECR;
+          parser_push_result (context_p);
+          parser_emit_unary_lvalue_opcode (context_p, opcode);
+          lexer_next_token (context_p);
+        }
+        break;
+      }
+    }
+    break;
+  }
+
+  /* Generate byte code for the unary operators. */
+  while (true)
+  {
+    uint8_t token = context_p->stack_top_uint8;
+    if (!LEXER_IS_UNARY_OP_TOKEN (token))
+    {
+      break;
+    }
+
+    parser_push_result (context_p);
+    parser_stack_pop_uint8 (context_p);
+
+    if (LEXER_IS_UNARY_LVALUE_OP_TOKEN (token))
+    {
+      if (token == LEXER_KEYW_DELETE)
+      {
+        token = CBC_DELETE_PUSH_RESULT;
+      }
+      else
+      {
+        token = (uint8_t) (LEXER_UNARY_LVALUE_OP_TOKEN_TO_OPCODE (token));
+      }
+      parser_emit_unary_lvalue_opcode (context_p, (cbc_opcode_t) token);
+    }
+    else
+    {
+      token = (uint8_t) (LEXER_UNARY_OP_TOKEN_TO_OPCODE (token));
+
+      if (token == CBC_TYPEOF)
+      {
+        if (PARSER_IS_PUSH_LITERAL (context_p->last_cbc_opcode)
+            && context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL)
+        {
+          if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+          {
+            context_p->last_cbc_opcode = CBC_TYPEOF_IDENT;
+          }
+          else if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+          {
+            context_p->last_cbc_opcode = CBC_PUSH_LITERAL;
+            parser_emit_cbc_literal (context_p,
+                                     CBC_TYPEOF_IDENT,
+                                     context_p->last_cbc.value);
+          }
+          else
+          {
+            JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_THREE_LITERALS);
+
+            context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+            parser_emit_cbc_literal (context_p,
+                                     CBC_TYPEOF_IDENT,
+                                     context_p->last_cbc.third_literal_index);
+          }
+        }
+        else
+        {
+          parser_emit_cbc (context_p, token);
+        }
+      }
+      else
+      {
+        if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+        {
+          /* It is not worth to combine with push multiple literals
+           * since the byte code size will not decrease. */
+          JERRY_ASSERT (CBC_SAME_ARGS (context_p->last_cbc_opcode, token + 1));
+          context_p->last_cbc_opcode = (uint16_t) (token + 1);
+        }
+        else
+        {
+          parser_emit_cbc (context_p, token);
+        }
+      }
+    }
+  }
+} /* parser_process_unary_expression */
+
+/**
+ * Append a binary token.
+ */
+static void
+parser_append_binary_token (parser_context_t *context_p) /**< context */
+{
+  JERRY_ASSERT (LEXER_IS_BINARY_OP_TOKEN (context_p->token.type));
+
+  parser_push_result (context_p);
+
+  if (context_p->token.type == LEXER_ASSIGN)
+  {
+    /* Unlike other tokens, the whole byte code is saved for binary
+     * assignment, since it has multiple forms depending on the
+     * previous instruction. */
+
+    if (PARSER_IS_PUSH_LITERAL (context_p->last_cbc_opcode)
+        && context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL)
+    {
+      JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_LITERAL, CBC_ASSIGN_SET_IDENT));
+
+      if ((context_p->status_flags & PARSER_IS_STRICT)
+          && context_p->last_cbc.literal_object_type != LEXER_LITERAL_OBJECT_ANY)
+      {
+        parser_error_t error;
+
+        if (context_p->last_cbc.literal_object_type == LEXER_LITERAL_OBJECT_EVAL)
+        {
+          error = PARSER_ERR_EVAL_CANNOT_ASSIGNED;
+        }
+        else
+        {
+          JERRY_ASSERT (context_p->last_cbc.literal_object_type == LEXER_LITERAL_OBJECT_ARGUMENTS);
+          error = PARSER_ERR_ARGUMENTS_CANNOT_ASSIGNED;
+        }
+        parser_raise_error (context_p, error);
+      }
+
+      if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+      {
+        parser_stack_push_uint16 (context_p, context_p->last_cbc.literal_index);
+        context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      }
+      else if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+      {
+        parser_stack_push_uint16 (context_p, context_p->last_cbc.value);
+        context_p->last_cbc_opcode = CBC_PUSH_LITERAL;
+      }
+      else
+      {
+        JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_THREE_LITERALS);
+
+        parser_stack_push_uint16 (context_p, context_p->last_cbc.third_literal_index);
+        context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+      }
+      parser_stack_push_uint8 (context_p, CBC_ASSIGN_SET_IDENT);
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_PROP)
+    {
+      JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP, CBC_ASSIGN));
+      parser_stack_push_uint8 (context_p, CBC_ASSIGN);
+      context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_PROP_LITERAL)
+    {
+      if (context_p->last_cbc.literal_type != LEXER_IDENT_LITERAL)
+      {
+        JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP_LITERAL, CBC_ASSIGN_PROP_LITERAL));
+        parser_stack_push_uint16 (context_p, context_p->last_cbc.literal_index);
+        parser_stack_push_uint8 (context_p, CBC_ASSIGN_PROP_LITERAL);
+        context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      }
+      else
+      {
+        context_p->last_cbc_opcode = CBC_PUSH_LITERAL;
+        parser_stack_push_uint8 (context_p, CBC_ASSIGN);
+      }
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_PROP_LITERAL_LITERAL)
+    {
+      JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP_LITERAL_LITERAL, CBC_PUSH_TWO_LITERALS));
+      context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+      parser_stack_push_uint8 (context_p, CBC_ASSIGN);
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_PROP_THIS_LITERAL)
+    {
+      if (context_p->last_cbc.literal_type != LEXER_IDENT_LITERAL)
+      {
+        JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP_THIS_LITERAL, CBC_ASSIGN_PROP_THIS_LITERAL));
+        parser_stack_push_uint16 (context_p, context_p->last_cbc.literal_index);
+        parser_stack_push_uint8 (context_p, CBC_ASSIGN_PROP_THIS_LITERAL);
+        context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      }
+      else
+      {
+        context_p->last_cbc_opcode = CBC_PUSH_THIS_LITERAL;
+        parser_stack_push_uint8 (context_p, CBC_ASSIGN);
+      }
+    }
+    else
+    {
+      /* Invalid LeftHandSide expression. */
+      parser_emit_cbc_ext (context_p, CBC_EXT_THROW_REFERENCE_ERROR);
+      parser_stack_push_uint8 (context_p, CBC_ASSIGN);
+    }
+  }
+  else if (LEXER_IS_BINARY_LVALUE_TOKEN (context_p->token.type))
+  {
+    if (PARSER_IS_PUSH_LITERAL (context_p->last_cbc_opcode)
+        && context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL)
+    {
+      if ((context_p->status_flags & PARSER_IS_STRICT)
+          && context_p->last_cbc.literal_object_type != LEXER_LITERAL_OBJECT_ANY)
+      {
+        parser_error_t error;
+
+        if (context_p->last_cbc.literal_object_type == LEXER_LITERAL_OBJECT_EVAL)
+        {
+          error = PARSER_ERR_EVAL_CANNOT_ASSIGNED;
+        }
+        else
+        {
+          JERRY_ASSERT (context_p->last_cbc.literal_object_type == LEXER_LITERAL_OBJECT_ARGUMENTS);
+          error = PARSER_ERR_ARGUMENTS_CANNOT_ASSIGNED;
+        }
+        parser_raise_error (context_p, error);
+      }
+
+      if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+      {
+        context_p->last_cbc_opcode = CBC_PUSH_IDENT_REFERENCE;
+      }
+      else if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+      {
+        context_p->last_cbc_opcode = CBC_PUSH_LITERAL;
+        parser_emit_cbc_literal (context_p,
+                                 CBC_PUSH_IDENT_REFERENCE,
+                                 context_p->last_cbc.value);
+      }
+      else
+      {
+        JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_THREE_LITERALS);
+
+        context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+        parser_emit_cbc_literal (context_p,
+                                 CBC_PUSH_IDENT_REFERENCE,
+                                 context_p->last_cbc.third_literal_index);
+      }
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_PROP)
+    {
+      JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP, CBC_PUSH_PROP_REFERENCE));
+      context_p->last_cbc_opcode = CBC_PUSH_PROP_REFERENCE;
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_PROP_LITERAL)
+    {
+      JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP_LITERAL,
+                                   CBC_PUSH_PROP_LITERAL_REFERENCE));
+      context_p->last_cbc_opcode = CBC_PUSH_PROP_LITERAL_REFERENCE;
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_PROP_LITERAL_LITERAL)
+    {
+      JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP_LITERAL_LITERAL,
+                                   CBC_PUSH_PROP_LITERAL_LITERAL_REFERENCE));
+      context_p->last_cbc_opcode = CBC_PUSH_PROP_LITERAL_LITERAL_REFERENCE;
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_PROP_THIS_LITERAL)
+    {
+      JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP_THIS_LITERAL,
+                                   CBC_PUSH_PROP_THIS_LITERAL_REFERENCE));
+      context_p->last_cbc_opcode = CBC_PUSH_PROP_THIS_LITERAL_REFERENCE;
+    }
+    else
+    {
+      /* Invalid LeftHandSide expression. */
+      parser_emit_cbc_ext (context_p, CBC_EXT_THROW_REFERENCE_ERROR);
+      parser_emit_cbc (context_p, CBC_PUSH_PROP_REFERENCE);
+    }
+  }
+  else if (context_p->token.type == LEXER_LOGICAL_OR
+           || context_p->token.type == LEXER_LOGICAL_AND)
+  {
+    parser_branch_t branch;
+    uint16_t opcode = CBC_BRANCH_IF_LOGICAL_TRUE;
+
+    if (context_p->token.type == LEXER_LOGICAL_AND)
+    {
+      opcode = CBC_BRANCH_IF_LOGICAL_FALSE;
+    }
+
+    parser_emit_cbc_forward_branch (context_p, opcode, &branch);
+    parser_stack_push (context_p, &branch, sizeof (parser_branch_t));
+  }
+
+  parser_stack_push_uint8 (context_p, context_p->token.type);
+} /* parser_append_binary_token */
+
+/**
+ * Emit opcode for binary computations.
+ */
+static void
+parser_process_binary_opcodes (parser_context_t *context_p, /**< context */
+                               uint8_t min_prec_treshold) /**< minimal precedence of tokens */
+{
+  while (true)
+  {
+    uint8_t token = context_p->stack_top_uint8;
+    cbc_opcode_t opcode;
+
+    /* For left-to-right operators (all binary operators except assignment
+     * and logical operators), the byte code is flushed if the precedence
+     * of the next operator is less or equal than the current operator. For
+     * assignment and logical operators, we add 1 to the min precendence to
+     * force right-to-left evaluation order. */
+
+    if (!LEXER_IS_BINARY_OP_TOKEN (token)
+        || parser_binary_precedence_table[token - LEXER_FIRST_BINARY_OP] < min_prec_treshold)
+    {
+      return;
+    }
+
+    parser_push_result (context_p);
+    parser_stack_pop_uint8 (context_p);
+
+    if (token == LEXER_ASSIGN)
+    {
+      opcode = (cbc_opcode_t) context_p->stack_top_uint8;
+      parser_stack_pop_uint8 (context_p);
+
+      if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+      {
+        if (opcode == CBC_ASSIGN_SET_IDENT)
+        {
+          JERRY_ASSERT (CBC_ARGS_EQ (CBC_ASSIGN_LITERAL_SET_IDENT,
+                                     CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2));
+          context_p->last_cbc.value = parser_stack_pop_uint16 (context_p);
+          context_p->last_cbc_opcode = CBC_ASSIGN_LITERAL_SET_IDENT;
+          continue;
+        }
+      }
+
+      if (cbc_flags[opcode] & CBC_HAS_LITERAL_ARG)
+      {
+        uint16_t index = parser_stack_pop_uint16 (context_p);
+        parser_emit_cbc_literal (context_p, opcode, index);
+
+        if (opcode == CBC_ASSIGN_PROP_THIS_LITERAL
+            && (context_p->stack_depth >= context_p->stack_limit))
+        {
+          /* Stack limit is increased for VM_OC_ASSIGN_PROP_THIS. Needed by vm.c. */
+          JERRY_ASSERT (context_p->stack_depth == context_p->stack_limit);
+
+          context_p->stack_limit++;
+
+          if (context_p->stack_limit > PARSER_MAXIMUM_STACK_LIMIT)
+          {
+            parser_raise_error (context_p, PARSER_ERR_STACK_LIMIT_REACHED);
+          }
+        }
+        continue;
+      }
+    }
+    else if (LEXER_IS_BINARY_LVALUE_TOKEN (token))
+    {
+      opcode = LEXER_BINARY_LVALUE_OP_TOKEN_TO_OPCODE (token);
+
+      if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+      {
+        JERRY_ASSERT (CBC_ARGS_EQ (opcode + CBC_BINARY_LVALUE_WITH_LITERAL,
+                                   CBC_HAS_LITERAL_ARG));
+        context_p->last_cbc_opcode = (uint16_t) (opcode + CBC_BINARY_LVALUE_WITH_LITERAL);
+        continue;
+      }
+    }
+    else if (token == LEXER_LOGICAL_OR || token == LEXER_LOGICAL_AND)
+    {
+      parser_branch_t branch;
+      parser_stack_pop (context_p, &branch, sizeof (parser_branch_t));
+      parser_set_branch_to_current_position (context_p, &branch);
+      continue;
+    }
+    else
+    {
+      opcode = LEXER_BINARY_OP_TOKEN_TO_OPCODE (token);
+
+      if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+      {
+        JERRY_ASSERT (CBC_SAME_ARGS (context_p->last_cbc_opcode, opcode + CBC_BINARY_WITH_LITERAL));
+        context_p->last_cbc_opcode = (uint16_t) (opcode + CBC_BINARY_WITH_LITERAL);
+        continue;
+      }
+      else if (context_p->last_cbc_opcode == CBC_PUSH_TWO_LITERALS)
+      {
+        JERRY_ASSERT (CBC_ARGS_EQ (opcode + CBC_BINARY_WITH_TWO_LITERALS,
+                                   CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2));
+        context_p->last_cbc_opcode = (uint16_t) (opcode + CBC_BINARY_WITH_TWO_LITERALS);
+        continue;
+      }
+    }
+    parser_emit_cbc (context_p, opcode);
+  }
+} /* parser_process_binary_opcodes */
+
+/**
+ * Parse expression.
+ */
+void
+parser_parse_expression (parser_context_t *context_p, /**< context */
+                         int options) /**< option flags */
+{
+  size_t grouping_level = 0;
+
+  parser_stack_push_uint8 (context_p, LEXER_EXPRESSION_START);
+
+  while (true)
+  {
+    if (options & PARSE_EXPR_HAS_LITERAL)
+    {
+      JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_LITERAL);
+      /* True only for the first expression. */
+      options &= ~PARSE_EXPR_HAS_LITERAL;
+    }
+    else
+    {
+      parser_parse_unary_expression (context_p, &grouping_level);
+    }
+
+    while (true)
+    {
+      parser_process_unary_expression (context_p);
+
+      /* The engine flush binary opcodes above this precedence. */
+      uint8_t min_prec_treshold = CBC_MAXIMUM_BYTE_VALUE;
+
+      if (LEXER_IS_BINARY_OP_TOKEN (context_p->token.type))
+      {
+        min_prec_treshold = parser_binary_precedence_table[context_p->token.type - LEXER_FIRST_BINARY_OP];
+        if (LEXER_IS_BINARY_LVALUE_TOKEN (context_p->token.type)
+            || context_p->token.type == LEXER_LOGICAL_OR
+            || context_p->token.type == LEXER_LOGICAL_AND)
+        {
+          /* Right-to-left evaluation order. */
+          min_prec_treshold++;
+        }
+      }
+      else
+      {
+        min_prec_treshold = 0;
+      }
+
+      parser_process_binary_opcodes (context_p, min_prec_treshold);
+
+      if (context_p->token.type == LEXER_RIGHT_PAREN)
+      {
+        if (context_p->stack_top_uint8 == LEXER_LEFT_PAREN
+            || context_p->stack_top_uint8 == LEXER_COMMA_SEP_LIST)
+        {
+          JERRY_ASSERT (grouping_level > 0);
+          grouping_level--;
+
+          if (context_p->stack_top_uint8 == LEXER_COMMA_SEP_LIST)
+          {
+            parser_push_result (context_p);
+            parser_flush_cbc (context_p);
+          }
+
+          parser_stack_pop_uint8 (context_p);
+          lexer_next_token (context_p);
+          continue;
+        }
+      }
+      else if (context_p->token.type == LEXER_QUESTION_MARK)
+      {
+        cbc_opcode_t opcode = CBC_BRANCH_IF_FALSE_FORWARD;
+        parser_branch_t cond_branch;
+        parser_branch_t uncond_branch;
+
+        parser_push_result (context_p);
+
+        if (context_p->last_cbc_opcode == CBC_LOGICAL_NOT)
+        {
+          context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+          opcode = CBC_BRANCH_IF_TRUE_FORWARD;
+        }
+
+        parser_emit_cbc_forward_branch (context_p, opcode, &cond_branch);
+
+        lexer_next_token (context_p);
+        parser_parse_expression (context_p, PARSE_EXPR_NO_COMMA);
+        parser_emit_cbc_forward_branch (context_p, CBC_JUMP_FORWARD, &uncond_branch);
+        parser_set_branch_to_current_position (context_p, &cond_branch);
+
+        /* Although byte code is constructed for two branches,
+         * only one of them will be executed. To reflect this
+         * the stack is manually adjusted. */
+        JERRY_ASSERT (context_p->stack_depth > 0);
+        context_p->stack_depth--;
+
+        if (context_p->token.type != LEXER_COLON)
+        {
+          parser_raise_error (context_p, PARSER_ERR_COLON_FOR_CONDITIONAL_EXPECTED);
+        }
+
+        lexer_next_token (context_p);
+
+        parser_parse_expression (context_p, PARSE_EXPR_NO_COMMA);
+        parser_set_branch_to_current_position (context_p, &uncond_branch);
+
+        /* Last opcode rewrite is not allowed because
+         * the result may come from the first branch. */
+        parser_flush_cbc (context_p);
+        continue;
+      }
+      break;
+    }
+
+    if (context_p->token.type == LEXER_COMMA)
+    {
+      if (!(options & PARSE_EXPR_NO_COMMA) || grouping_level > 0)
+      {
+        if (!CBC_NO_RESULT_OPERATION (context_p->last_cbc_opcode))
+        {
+          parser_emit_cbc (context_p, CBC_POP);
+        }
+        if (context_p->stack_top_uint8 == LEXER_LEFT_PAREN)
+        {
+          parser_mem_page_t *page_p = context_p->stack.first_p;
+
+          JERRY_ASSERT (page_p != NULL);
+
+          page_p->bytes[context_p->stack.last_position - 1] = LEXER_COMMA_SEP_LIST;
+          context_p->stack_top_uint8 = LEXER_COMMA_SEP_LIST;
+        }
+        lexer_next_token (context_p);
+        continue;
+      }
+    }
+    else if (LEXER_IS_BINARY_OP_TOKEN (context_p->token.type))
+    {
+      parser_append_binary_token (context_p);
+      lexer_next_token (context_p);
+      continue;
+    }
+    break;
+  }
+
+  if (grouping_level != 0)
+  {
+    parser_raise_error (context_p, PARSER_ERR_RIGHT_PAREN_EXPECTED);
+  }
+
+  JERRY_ASSERT (context_p->stack_top_uint8 == LEXER_EXPRESSION_START);
+  parser_stack_pop_uint8 (context_p);
+
+  if (options & PARSE_EXPR_STATEMENT)
+  {
+    if (!CBC_NO_RESULT_OPERATION (context_p->last_cbc_opcode))
+    {
+      parser_emit_cbc (context_p, CBC_POP);
+    }
+  }
+  else if (options & PARSE_EXPR_BLOCK)
+  {
+    if (CBC_NO_RESULT_COMPOUND_ASSIGMENT (context_p->last_cbc_opcode))
+    {
+      context_p->last_cbc_opcode = PARSER_TO_BINARY_OPERATION_WITH_BLOCK (context_p->last_cbc_opcode);
+      parser_flush_cbc (context_p);
+    }
+    else if (CBC_NO_RESULT_BLOCK (context_p->last_cbc_opcode))
+    {
+      JERRY_ASSERT (CBC_SAME_ARGS (context_p->last_cbc_opcode, context_p->last_cbc_opcode + 2));
+      PARSER_PLUS_EQUAL_U16 (context_p->last_cbc_opcode, 2);
+      parser_flush_cbc (context_p);
+    }
+    else
+    {
+      if (CBC_NO_RESULT_OPERATION (context_p->last_cbc_opcode))
+      {
+        JERRY_ASSERT (CBC_SAME_ARGS (context_p->last_cbc_opcode, context_p->last_cbc_opcode + 1));
+        context_p->last_cbc_opcode++;
+      }
+      parser_emit_cbc (context_p, CBC_POP_BLOCK);
+    }
+  }
+  else
+  {
+    parser_push_result (context_p);
+  }
+} /* parser_parse_expression */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* JERRY_JS_PARSER */
diff --git a/deps/jerry/jerry-core/parser/js/js-parser-internal.h b/deps/jerry/jerry-core/parser/js/js-parser-internal.h
new file mode 100644 (file)
index 0000000..d06d36a
--- /dev/null
@@ -0,0 +1,464 @@
+/* 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.
+ */
+
+#ifndef JS_PARSER_INTERNAL_H
+#define JS_PARSER_INTERNAL_H
+
+#include "common.h"
+
+#include "byte-code.h"
+#include "debugger.h"
+#include "js-parser.h"
+#include "js-parser-limits.h"
+#include "js-lexer.h"
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_internals Internals
+ * @{
+ */
+
+/* General parser flags. */
+#define PARSER_IS_STRICT                      0x00001u
+#define PARSER_IS_FUNCTION                    0x00002u
+#define PARSER_IS_CLOSURE                     0x00004u
+#define PARSER_IS_PROPERTY_GETTER             0x00008u
+#define PARSER_IS_PROPERTY_SETTER             0x00010u
+#define PARSER_IS_FUNC_EXPRESSION             0x00020u
+#define PARSER_HAS_NON_STRICT_ARG             0x00040u
+#define PARSER_INSIDE_WITH                    0x00080u
+#define PARSER_RESOLVE_THIS_FOR_CALLS         0x00100u
+#define PARSER_NAMED_FUNCTION_EXP             0x00200u
+#define PARSER_HAS_INITIALIZED_VARS           0x00400u
+#define PARSER_NO_END_LABEL                   0x00800u
+#define PARSER_NO_REG_STORE                   0x01000u
+#define PARSER_ARGUMENTS_NEEDED               0x02000u
+#define PARSER_ARGUMENTS_NOT_NEEDED           0x04000u
+#define PARSER_LEXICAL_ENV_NEEDED             0x08000u
+#define PARSER_HAS_LATE_LIT_INIT              0x10000u
+#define PARSER_DEBUGGER_BREAKPOINT_APPENDED   0x20000u
+
+/* Expression parsing flags. */
+#define PARSE_EXPR                            0x00
+#define PARSE_EXPR_STATEMENT                  0x01
+#define PARSE_EXPR_BLOCK                      0x02
+#define PARSE_EXPR_NO_COMMA                   0x04
+#define PARSE_EXPR_HAS_LITERAL                0x08
+
+/* The maximum of PARSER_CBC_STREAM_PAGE_SIZE is 127. */
+#define PARSER_CBC_STREAM_PAGE_SIZE \
+  ((uint32_t) (64 - sizeof (void *)))
+
+#define PARSER_STACK_PAGE_SIZE \
+  ((uint32_t) (((sizeof (void *) > 4) ? 128 : 64) - sizeof (void *)))
+
+/* Avoid compiler warnings for += operations. */
+#define PARSER_PLUS_EQUAL_U16(base, value) (base) = (uint16_t) ((base) + (value))
+#define PARSER_MINUS_EQUAL_U16(base, value) (base) = (uint16_t) ((base) - (value))
+#define PARSER_PLUS_EQUAL_LC(base, value) (base) = (parser_line_counter_t) ((base) + (value))
+
+/**
+ * Argument for a compact-byte code.
+ */
+typedef struct
+{
+  uint16_t literal_index;                     /**< literal index argument */
+  uint16_t value;                             /**< other argument (second literal or byte). */
+  uint16_t third_literal_index;               /**< literal index argument */
+  uint8_t literal_type;                       /**< last literal type */
+  uint8_t literal_object_type;                /**< last literal object type */
+} cbc_argument_t;
+
+/* Useful parser macros. */
+
+#define PARSER_CBC_UNAVAILABLE CBC_EXT_OPCODE
+
+#define PARSER_TO_EXT_OPCODE(opcode) ((uint16_t) ((opcode) + 256))
+#define PARSER_GET_EXT_OPCODE(opcode) ((opcode) - 256)
+#define PARSER_IS_BASIC_OPCODE(opcode) ((opcode) < 256)
+#define PARSER_IS_PUSH_LITERAL(opcode) \
+  ((opcode) == CBC_PUSH_LITERAL \
+   || (opcode) == CBC_PUSH_TWO_LITERALS \
+   || (opcode) == CBC_PUSH_THREE_LITERALS)
+
+#define PARSER_GET_LITERAL(literal_index) \
+  ((lexer_literal_t *) parser_list_get (&context_p->literal_pool, (literal_index)))
+
+#define PARSER_TO_BINARY_OPERATION_WITH_RESULT(opcode) \
+  (PARSER_TO_EXT_OPCODE(opcode) - CBC_ASSIGN_ADD + CBC_EXT_ASSIGN_ADD_PUSH_RESULT)
+
+#define PARSER_TO_BINARY_OPERATION_WITH_BLOCK(opcode) \
+  ((uint16_t) (PARSER_TO_EXT_OPCODE(opcode) - CBC_ASSIGN_ADD + CBC_EXT_ASSIGN_ADD_BLOCK))
+
+#define PARSER_GET_FLAGS(op) \
+  (PARSER_IS_BASIC_OPCODE (op) ? cbc_flags[(op)] : cbc_ext_flags[PARSER_GET_EXT_OPCODE (op)])
+
+#define PARSER_OPCODE_IS_RETURN(op) \
+  ((op) == CBC_RETURN || (op) == CBC_RETURN_WITH_BLOCK || (op) == CBC_RETURN_WITH_LITERAL)
+
+#define PARSER_ARGS_EQ(op, types) \
+  ((PARSER_GET_FLAGS (op) & CBC_ARG_TYPES) == (types))
+
+/**
+ * All data allocated by the parser is
+ * stored in parser_data_pages in the memory.
+ */
+typedef struct parser_mem_page_t
+{
+  struct parser_mem_page_t *next_p;           /**< next page */
+  uint8_t bytes[1];                           /**< memory bytes */
+} parser_mem_page_t;
+
+/**
+ * Structure for managing parser memory.
+ */
+typedef struct
+{
+  parser_mem_page_t *first_p;                 /**< first allocated page */
+  parser_mem_page_t *last_p;                  /**< last allocated page */
+  uint32_t last_position;                     /**< position of the last allocated byte */
+} parser_mem_data_t;
+
+/**
+ * Parser memory list.
+ */
+typedef struct
+{
+  parser_mem_data_t data;                     /**< storage space */
+  uint32_t page_size;                         /**< size of each page */
+  uint32_t item_size;                         /**< size of each item */
+  uint32_t item_count;                        /**< number of items on each page */
+} parser_list_t;
+
+/**
+ * Iterator for parser memory list.
+ */
+typedef struct
+{
+  parser_list_t *list_p;                      /**< parser list */
+  parser_mem_page_t *current_p;               /**< currently processed page */
+  size_t current_position;                    /**< current position on the page */
+} parser_list_iterator_t;
+
+/**
+ * Parser memory stack.
+ */
+typedef struct
+{
+  parser_mem_data_t data;                     /**< storage space */
+  parser_mem_page_t *free_page_p;             /**< space for fast allocation */
+} parser_stack_t;
+
+/**
+ * Iterator for parser memory stack.
+ */
+typedef struct
+{
+  parser_mem_page_t *current_p;               /**< currently processed page */
+  size_t current_position;                    /**< current position on the page */
+} parser_stack_iterator_t;
+
+/**
+ * Branch type.
+ */
+typedef struct
+{
+  parser_mem_page_t *page_p;                  /**< branch location page */
+  uint32_t offset;                            /**< branch location offset */
+} parser_branch_t;
+
+/**
+ * Branch chain type.
+ */
+typedef struct parser_branch_node_t
+{
+  struct parser_branch_node_t *next_p;        /**< next linked list node */
+  parser_branch_t branch;                     /**< branch */
+} parser_branch_node_t;
+
+#ifdef JERRY_DEBUGGER
+/**
+ * Extra information for each breakpoint.
+ */
+typedef struct
+{
+  uint32_t value;                             /**< line or offset of the breakpoint */
+} parser_breakpoint_info_t;
+#endif /* JERRY_DEBUGGER */
+
+/**
+ * Those members of a context which needs
+ * to be saved when a sub-function is parsed.
+ */
+typedef struct parser_saved_context_t
+{
+  /* Parser members. */
+  uint32_t status_flags;                      /**< parsing options */
+  uint16_t stack_depth;                       /**< current stack depth */
+  uint16_t stack_limit;                       /**< maximum stack depth */
+  struct parser_saved_context_t *prev_context_p; /**< last saved context */
+  parser_stack_iterator_t last_statement;     /**< last statement position */
+
+  /* Literal types */
+  uint16_t argument_count;                    /**< number of function arguments */
+  uint16_t register_count;                    /**< number of registers */
+  uint16_t literal_count;                     /**< number of literals */
+
+  /* Memory storage members. */
+  parser_mem_data_t byte_code;                /**< byte code buffer */
+  uint32_t byte_code_size;                    /**< byte code size for branches */
+  parser_mem_data_t literal_pool_data;        /**< literal list */
+
+#ifndef JERRY_NDEBUG
+  uint16_t context_stack_depth;               /**< current context stack depth */
+#endif /* !JERRY_NDEBUG */
+} parser_saved_context_t;
+
+/**
+ * Shared parser context.
+ */
+typedef struct
+{
+  PARSER_TRY_CONTEXT (try_buffer);            /**< try_buffer */
+  parser_error_t error;                       /**< error code */
+  void *allocated_buffer_p;                   /**< dinamically allocated buffer
+                                               *   which needs to be freed on error */
+  uint32_t allocated_buffer_size;             /**< size of the dinamically allocated buffer */
+
+  /* Parser members. */
+  uint32_t status_flags;                      /**< status flags */
+  uint16_t stack_depth;                       /**< current stack depth */
+  uint16_t stack_limit;                       /**< maximum stack depth */
+  parser_saved_context_t *last_context_p;     /**< last saved context */
+  parser_stack_iterator_t last_statement;     /**< last statement position */
+
+  /* Lexer members. */
+  lexer_token_t token;                        /**< current token */
+  lexer_lit_object_t lit_object;              /**< current literal object */
+  const uint8_t *source_p;                    /**< next source byte */
+  const uint8_t *source_end_p;                /**< last source byte */
+  parser_line_counter_t line;                 /**< current line */
+  parser_line_counter_t column;               /**< current column */
+
+  /* Compact byte code members. */
+  cbc_argument_t last_cbc;                    /**< argument of the last cbc */
+  uint16_t last_cbc_opcode;                   /**< opcode of the last cbc */
+
+  /* Literal types */
+  uint16_t argument_count;                    /**< number of function arguments */
+  uint16_t register_count;                    /**< number of registers */
+  uint16_t literal_count;                     /**< number of literals */
+
+  /* Memory storage members. */
+  parser_mem_data_t byte_code;                /**< byte code buffer */
+  uint32_t byte_code_size;                    /**< current byte code size for branches */
+  parser_list_t literal_pool;                 /**< literal list */
+  parser_mem_data_t stack;                    /**< storage space */
+  parser_mem_page_t *free_page_p;             /**< space for fast allocation */
+  uint8_t stack_top_uint8;                    /**< top byte stored on the stack */
+
+#ifndef JERRY_NDEBUG
+  /* Variables for debugging / logging. */
+  uint16_t context_stack_depth;               /**< current context stack depth */
+#endif /* !JERRY_NDEBUG */
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  int is_show_opcodes;                        /**< show opcodes */
+  uint32_t total_byte_code_size;              /**< total byte code size */
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+#ifdef JERRY_DEBUGGER
+  parser_breakpoint_info_t breakpoint_info[JERRY_DEBUGGER_SEND_MAX (parser_list_t)]; /**< extra data for breakpoints */
+  uint16_t breakpoint_info_count; /**< current breakpoint index */
+  parser_line_counter_t last_breakpoint_line; /**< last line where breakpoint was inserted */
+#endif /* JERRY_DEBUGGER */
+} parser_context_t;
+
+/**
+ * @}
+ * @}
+ * @}
+ *
+ * \addtogroup mem Memory allocation
+ * @{
+ *
+ * \addtogroup mem_parser Parser memory manager
+ * @{
+ */
+
+/* Memory management.
+ * Note: throws an error if unsuccessful. */
+void *parser_malloc (parser_context_t *context_p, size_t size);
+void parser_free (void *ptr, size_t size);
+void *parser_malloc_local (parser_context_t *context_p, size_t size);
+void parser_free_local (void *ptr, size_t size);
+
+/* Parser byte stream. */
+
+void parser_cbc_stream_init (parser_mem_data_t *data_p);
+void parser_cbc_stream_free (parser_mem_data_t *data_p);
+void parser_cbc_stream_alloc_page (parser_context_t *context_p, parser_mem_data_t *data_p);
+
+/* Parser list. Ensures pointer alignment. */
+
+void parser_list_init (parser_list_t *list_p, uint32_t item_size, uint32_t item_count);
+void parser_list_free (parser_list_t *list_p);
+void parser_list_reset (parser_list_t *list_p);
+void *parser_list_append (parser_context_t *context_p, parser_list_t *list_p);
+void *parser_list_get (parser_list_t *list_p, size_t index);
+void parser_list_iterator_init (parser_list_t *list_p, parser_list_iterator_t *iterator_p);
+void *parser_list_iterator_next (parser_list_iterator_t *iterator_p);
+
+/* Parser stack. Optimized for pushing bytes.
+ * Pop functions never throws error. */
+
+void parser_stack_init (parser_context_t *context_p);
+void parser_stack_free (parser_context_t *context_p);
+void parser_stack_push_uint8 (parser_context_t *context_p, uint8_t uint8_value);
+void parser_stack_pop_uint8 (parser_context_t *context_p);
+void parser_stack_push_uint16 (parser_context_t *context_p, uint16_t uint16_value);
+uint16_t parser_stack_pop_uint16 (parser_context_t *context_p);
+void parser_stack_push (parser_context_t *context_p, const void *data_p, uint32_t length);
+void parser_stack_pop (parser_context_t *context_p, void *data_p, uint32_t length);
+void parser_stack_iterator_skip (parser_stack_iterator_t *iterator, size_t length);
+void parser_stack_iterator_read (parser_stack_iterator_t *iterator, void *data_p, size_t length);
+void parser_stack_iterator_write (parser_stack_iterator_t *iterator, const void *data_p, size_t length);
+
+/**
+ * @}
+ * @}
+ *
+ * \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_utils Utility
+ * @{
+ */
+
+/* Compact byte code emitting functions. */
+
+void parser_flush_cbc (parser_context_t *context_p);
+void parser_emit_cbc (parser_context_t *context_p, uint16_t opcode);
+void parser_emit_cbc_literal (parser_context_t *context_p, uint16_t opcode, uint16_t literal_index);
+void parser_emit_cbc_literal_from_token (parser_context_t *context_p, uint16_t opcode);
+void parser_emit_cbc_call (parser_context_t *context_p, uint16_t opcode, size_t call_arguments);
+void parser_emit_cbc_push_number (parser_context_t *context_p, bool is_negative_number);
+void parser_emit_cbc_forward_branch (parser_context_t *context_p, uint16_t opcode, parser_branch_t *branch_p);
+parser_branch_node_t *parser_emit_cbc_forward_branch_item (parser_context_t *context_p, uint16_t opcode,
+                                                           parser_branch_node_t *next_p);
+void parser_emit_cbc_backward_branch (parser_context_t *context_p, uint16_t opcode, uint32_t offset);
+void parser_set_branch_to_current_position (parser_context_t *context_p, parser_branch_t *branch_p);
+void parser_set_breaks_to_current_position (parser_context_t *context_p, parser_branch_node_t *current_p);
+void parser_set_continues_to_current_position (parser_context_t *context_p, parser_branch_node_t *current_p);
+
+/* Convenience macros. */
+#define parser_emit_cbc_ext(context_p, opcode) \
+  parser_emit_cbc ((context_p), PARSER_TO_EXT_OPCODE (opcode))
+#define parser_emit_cbc_ext_literal(context_p, opcode, literal_index) \
+  parser_emit_cbc_literal ((context_p), PARSER_TO_EXT_OPCODE (opcode), (literal_index))
+#define parser_emit_cbc_ext_call(context_p, opcode, call_arguments) \
+  parser_emit_cbc_call ((context_p), PARSER_TO_EXT_OPCODE (opcode), (call_arguments))
+#define parser_emit_cbc_ext_forward_branch(context_p, opcode, branch_p) \
+  parser_emit_cbc_forward_branch ((context_p), PARSER_TO_EXT_OPCODE (opcode), (branch_p))
+#define parser_emit_cbc_ext_backward_branch(context_p, opcode, offset) \
+  parser_emit_cbc_backward_branch ((context_p), PARSER_TO_EXT_OPCODE (opcode), (offset))
+
+/**
+ * @}
+ *
+ * \addtogroup jsparser_lexer Lexer
+ * @{
+ */
+
+/* Lexer functions */
+
+void lexer_next_token (parser_context_t *context_p);
+void lexer_expect_identifier (parser_context_t *context_p, uint8_t literal_type);
+void lexer_scan_identifier (parser_context_t *context_p, bool propety_name);
+ecma_char_t lexer_hex_to_character (parser_context_t *context_p, const uint8_t *source_p, int length);
+void lexer_expect_object_literal_id (parser_context_t *context_p, bool must_be_identifier);
+void lexer_construct_literal_object (parser_context_t *context_p, lexer_lit_location_t *literal_p,
+                                     uint8_t literal_type);
+bool lexer_construct_number_object (parser_context_t *context_p, bool push_number_allowed, bool is_negative_number);
+uint16_t lexer_construct_function_object (parser_context_t *context_p, uint32_t extra_status_flags);
+void lexer_construct_regexp_object (parser_context_t *context_p, bool parse_only);
+bool lexer_compare_identifier_to_current (parser_context_t *context_p, const lexer_lit_location_t *right);
+
+/**
+ * @}
+ *
+ * \addtogroup jsparser_expr Expression parser
+ * @{
+ */
+
+/* Parser functions. */
+
+void parser_parse_expression (parser_context_t *context_p, int options);
+
+/**
+ * @}
+ *
+ * \addtogroup jsparser_scanner Scanner
+ * @{
+ */
+
+void parser_scan_until (parser_context_t *context_p, lexer_range_t *range_p, lexer_token_type_t end_type);
+
+/**
+ * @}
+ *
+ * \addtogroup jsparser_stmt Statement parser
+ * @{
+ */
+
+void parser_parse_statements (parser_context_t *context_p);
+void parser_free_jumps (parser_stack_iterator_t iterator);
+
+/**
+ * @}
+ *
+ * \addtogroup jsparser_parser Parser
+ * @{
+ */
+
+ecma_compiled_code_t *parser_parse_function (parser_context_t *context_p, uint32_t status_flags);
+
+/* Error management. */
+
+void parser_raise_error (parser_context_t *context_p, parser_error_t error);
+
+/* Debug functions. */
+
+#ifdef JERRY_DEBUGGER
+
+void parser_append_breakpoint_info (parser_context_t *context_p, jerry_debugger_header_type_t type, uint32_t value);
+void parser_send_breakpoints (parser_context_t *context_p, jerry_debugger_header_type_t type);
+
+#endif /* JERRY_DEBUGGER */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !JS_PARSER_INTERNAL_H */
diff --git a/deps/jerry/jerry-core/parser/js/js-parser-limits.h b/deps/jerry/jerry-core/parser/js/js-parser-limits.h
new file mode 100644 (file)
index 0000000..d4c8e99
--- /dev/null
@@ -0,0 +1,98 @@
+/* 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.
+ */
+
+#ifndef JS_PARSER_LIMITS_H
+#define JS_PARSER_LIMITS_H
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_internals Internals
+ * @{
+ */
+
+/* Maximum identifier length accepted by the parser.
+ * Limit: LEXER_MAX_STRING_LENGTH. */
+#ifndef PARSER_MAXIMUM_IDENT_LENGTH
+#define PARSER_MAXIMUM_IDENT_LENGTH 255
+#endif /* !PARSER_MAXIMUM_IDENT_LENGTH */
+
+/* Maximum string length.
+ * Limit: 65535. */
+#ifndef PARSER_MAXIMUM_STRING_LENGTH
+#define PARSER_MAXIMUM_STRING_LENGTH 65535
+#endif /* !PARSER_MAXIMUM_STRING_LENGTH */
+
+/* Maximum number of literals.
+ * Limit: 32767. Recommended: 510, 32767 */
+#ifndef PARSER_MAXIMUM_NUMBER_OF_LITERALS
+#define PARSER_MAXIMUM_NUMBER_OF_LITERALS 32767
+#endif /* !PARSER_MAXIMUM_NUMBER_OF_LITERALS */
+
+/* Maximum number of registers.
+ * Limit: PARSER_MAXIMUM_NUMBER_OF_LITERALS */
+#ifndef PARSER_MAXIMUM_NUMBER_OF_REGISTERS
+#define PARSER_MAXIMUM_NUMBER_OF_REGISTERS 256
+#endif /* !PARSER_MAXIMUM_NUMBER_OF_REGISTERS */
+
+/* Maximum code size.
+ * Limit: 16777215. Recommended: 65535, 16777215. */
+#ifndef PARSER_MAXIMUM_CODE_SIZE
+#define PARSER_MAXIMUM_CODE_SIZE (65535 << (JMEM_ALIGNMENT_LOG))
+#endif /* !PARSER_MAXIMUM_CODE_SIZE */
+
+/* Maximum number of values pushed onto the stack by a function.
+ * Limit: 65500. Recommended: 1024. */
+#ifndef PARSER_MAXIMUM_STACK_LIMIT
+#define PARSER_MAXIMUM_STACK_LIMIT 1024
+
+#endif /* !PARSER_MAXIMUM_STACK_LIMIT */
+
+/* Checks. */
+
+#if (PARSER_MAXIMUM_STRING_LENGTH < 1) || (PARSER_MAXIMUM_STRING_LENGTH > 65535)
+#error "Maximum string length is not within range."
+#endif /* (PARSER_MAXIMUM_STRING_LENGTH < 1) || (PARSER_MAXIMUM_STRING_LENGTH > 65535) */
+
+#if (PARSER_MAXIMUM_IDENT_LENGTH < 1) || (PARSER_MAXIMUM_IDENT_LENGTH > PARSER_MAXIMUM_STRING_LENGTH)
+#error "Maximum identifier length is not within range."
+#endif /* (PARSER_MAXIMUM_IDENT_LENGTH < 1) || (PARSER_MAXIMUM_IDENT_LENGTH > PARSER_MAXIMUM_STRING_LENGTH) */
+
+#if (PARSER_MAXIMUM_NUMBER_OF_LITERALS < 1) || (PARSER_MAXIMUM_NUMBER_OF_LITERALS > 32767)
+#error "Maximum number of literals is not within range."
+#endif /* (PARSER_MAXIMUM_NUMBER_OF_LITERALS < 1) || (PARSER_MAXIMUM_NUMBER_OF_LITERALS > 32767) */
+
+#if (PARSER_MAXIMUM_NUMBER_OF_REGISTERS > PARSER_MAXIMUM_NUMBER_OF_LITERALS)
+#error "Maximum number of registers is not within range."
+#endif /* (PARSER_MAXIMUM_NUMBER_OF_REGISTERS > PARSER_MAXIMUM_NUMBER_OF_LITERALS) */
+
+#if (PARSER_MAXIMUM_CODE_SIZE < 4096) || (PARSER_MAXIMUM_CODE_SIZE > 16777215)
+#error "Maximum code size is not within range."
+#endif /* (PARSER_MAXIMUM_CODE_SIZE < 4096) || (PARSER_MAXIMUM_CODE_SIZE > 16777215) */
+
+#if (PARSER_MAXIMUM_STACK_LIMIT < 16) || (PARSER_MAXIMUM_STACK_LIMIT > 65500)
+#error "Maximum function stack usage is not within range."
+#endif /* (PARSER_MAXIMUM_STACK_LIMIT < 16) || (PARSER_MAXIMUM_STACK_LIMIT > 65500) */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !JS_PARSER_LIMITS_H */
diff --git a/deps/jerry/jerry-core/parser/js/js-parser-mem.c b/deps/jerry/jerry-core/parser/js/js-parser-mem.c
new file mode 100644 (file)
index 0000000..96e3ee4
--- /dev/null
@@ -0,0 +1,681 @@
+/* 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.
+ */
+
+#include "js-parser-internal.h"
+
+#if JERRY_JS_PARSER
+
+/** \addtogroup mem Memory allocation
+ * @{
+ *
+ * \addtogroup mem_parser Parser memory manager
+ * @{
+ */
+
+/**********************************************************************/
+/* Memory allocation                                                  */
+/**********************************************************************/
+
+/**
+ * Allocate memory.
+ *
+ * @return allocated memory.
+ */
+void *
+parser_malloc (parser_context_t *context_p, /**< context */
+               size_t size) /**< size of the memory block */
+{
+  void *result;
+
+  JERRY_ASSERT (size > 0);
+  result = jmem_heap_alloc_block_null_on_error (size);
+
+  if (result == NULL)
+  {
+    parser_raise_error (context_p, PARSER_ERR_OUT_OF_MEMORY);
+  }
+  return result;
+} /* parser_malloc */
+
+/**
+ * Free memory allocated by parser_malloc.
+ */
+void parser_free (void *ptr, /**< pointer to free */
+                  size_t size) /**< size of the memory block */
+{
+  jmem_heap_free_block (ptr, size);
+} /* parser_free */
+
+/**
+ * Allocate local memory for short term use.
+ *
+ * @return allocated memory.
+ */
+void *
+parser_malloc_local (parser_context_t *context_p, /**< context */
+                     size_t size) /**< size of the memory */
+{
+  void *result;
+
+  JERRY_ASSERT (size > 0);
+  result = jmem_heap_alloc_block (size);
+  if (result == 0)
+  {
+    parser_raise_error (context_p, PARSER_ERR_OUT_OF_MEMORY);
+  }
+  return result;
+} /* parser_malloc_local */
+
+/**
+ * Free memory allocated by parser_malloc_local.
+ */
+void parser_free_local (void *ptr, /**< pointer to free */
+                        size_t size) /**< size of the memory */
+{
+  jmem_heap_free_block (ptr, size);
+} /* parser_free_local */
+
+/**********************************************************************/
+/* Parser data management functions                                   */
+/**********************************************************************/
+
+/**
+ * Initialize parse data.
+ */
+static void
+parser_data_init (parser_mem_data_t *data_p, /**< memory manager */
+                  uint32_t page_size) /**< size of each page */
+{
+  data_p->first_p = NULL;
+  data_p->last_p = NULL;
+  data_p->last_position = page_size;
+} /* parser_data_init */
+
+/**
+ * Free parse data.
+ */
+static void
+parser_data_free (parser_mem_data_t *data_p, /**< memory manager */
+                  uint32_t page_size) /**< size of each page */
+{
+  parser_mem_page_t *page_p = data_p->first_p;
+
+  while (page_p != NULL)
+  {
+    parser_mem_page_t *next_p = page_p->next_p;
+
+    parser_free (page_p, page_size);
+    page_p = next_p;
+  }
+} /* parser_data_free */
+
+/**********************************************************************/
+/* Parser byte stream management functions                            */
+/**********************************************************************/
+
+/**
+ * Initialize byte stream.
+ */
+void
+parser_cbc_stream_init (parser_mem_data_t *data_p) /**< memory manager */
+{
+  parser_data_init (data_p, PARSER_CBC_STREAM_PAGE_SIZE);
+} /* parser_cbc_stream_init */
+
+/**
+ * Free byte stream.
+ */
+void
+parser_cbc_stream_free (parser_mem_data_t *data_p) /**< memory manager */
+{
+  parser_data_free (data_p,
+                    sizeof (parser_mem_page_t *) + PARSER_CBC_STREAM_PAGE_SIZE);
+} /* parser_cbc_stream_free */
+
+/**
+ * Appends a byte at the end of the byte stream.
+ */
+void
+parser_cbc_stream_alloc_page (parser_context_t *context_p, /**< context */
+                              parser_mem_data_t *data_p) /**< memory manager */
+{
+  size_t size = sizeof (parser_mem_page_t *) + PARSER_CBC_STREAM_PAGE_SIZE;
+  parser_mem_page_t *page_p = (parser_mem_page_t *) parser_malloc (context_p, size);
+
+  page_p->next_p = NULL;
+  data_p->last_position = 0;
+
+  if (data_p->last_p != NULL)
+  {
+    data_p->last_p->next_p = page_p;
+  }
+  else
+  {
+    data_p->first_p = page_p;
+  }
+  data_p->last_p = page_p;
+} /* parser_cbc_stream_alloc_page */
+
+/**********************************************************************/
+/* Parser list management functions                                   */
+/**********************************************************************/
+
+/**
+ * Initialize parser list.
+ */
+void
+parser_list_init (parser_list_t *list_p, /**< parser list */
+                  uint32_t item_size, /**< size for each page */
+                  uint32_t item_count) /**< number of items on each page */
+{
+  /* Align to pointer size. */
+  item_size = (uint32_t) (((item_size) + sizeof (void *) - 1) & ~(sizeof (void *) - 1));
+  parser_data_init (&list_p->data, item_size * item_count);
+  list_p->page_size = item_size * item_count;
+  list_p->item_size = item_size;
+  list_p->item_count = item_count;
+} /* parser_list_init */
+
+/**
+ * Free parser list.
+ */
+void
+parser_list_free (parser_list_t *list_p) /**< parser list */
+{
+  parser_data_free (&list_p->data,
+                    (uint32_t) (sizeof (parser_mem_page_t *) + list_p->page_size));
+} /* parser_list_free */
+
+/**
+ * Reset parser list.
+ */
+void
+parser_list_reset (parser_list_t *list_p) /**< parser list */
+{
+  parser_data_init (&list_p->data, list_p->page_size);
+} /* parser_list_reset */
+
+/**
+ * Allocate space for the next item.
+ *
+ * @return pointer to the appended item.
+ */
+void *
+parser_list_append (parser_context_t *context_p, /**< context */
+                    parser_list_t *list_p) /**< parser list */
+{
+  parser_mem_page_t *page_p = list_p->data.last_p;
+  void *result;
+
+  if (list_p->data.last_position + list_p->item_size > list_p->page_size)
+  {
+    size_t size = sizeof (parser_mem_page_t *) + list_p->page_size;
+
+    page_p = (parser_mem_page_t *) parser_malloc (context_p, size);
+
+    page_p->next_p = NULL;
+    list_p->data.last_position = 0;
+
+    if (list_p->data.last_p != NULL)
+    {
+      list_p->data.last_p->next_p = page_p;
+    }
+    else
+    {
+      list_p->data.first_p = page_p;
+    }
+    list_p->data.last_p = page_p;
+  }
+
+  result = page_p->bytes + list_p->data.last_position;
+  list_p->data.last_position += list_p->item_size;
+  return result;
+} /* parser_list_append */
+
+/**
+ * Return the nth item of the list.
+ *
+ * @return pointer to the item.
+ */
+void *
+parser_list_get (parser_list_t *list_p, /**< parser list */
+                 size_t index) /**< item index */
+{
+  size_t item_count = list_p->item_count;
+  parser_mem_page_t *page_p = list_p->data.first_p;
+
+  while (index >= item_count)
+  {
+    JERRY_ASSERT (page_p != NULL);
+    page_p = page_p->next_p;
+    index -= item_count;
+  }
+
+  JERRY_ASSERT (page_p != NULL);
+  JERRY_ASSERT (page_p != list_p->data.last_p
+                || (index * list_p->item_size < list_p->data.last_position));
+  return page_p->bytes + (index * list_p->item_size);
+} /* parser_list_get */
+
+/**
+ * Initialize a parser list iterator.
+ */
+void
+parser_list_iterator_init (parser_list_t *list_p, /**< parser list */
+                           parser_list_iterator_t *iterator_p) /**< iterator */
+{
+  iterator_p->list_p = list_p;
+  iterator_p->current_p = list_p->data.first_p;
+  iterator_p->current_position = 0;
+} /* parser_list_iterator_init */
+
+/**
+ * Next iterator step.
+ *
+ * @return the address of the current item, or NULL at the end.
+ */
+void *
+parser_list_iterator_next (parser_list_iterator_t *iterator_p) /**< iterator */
+{
+  void *result;
+
+  if (iterator_p->current_p == NULL)
+  {
+    return NULL;
+  }
+
+  result = iterator_p->current_p->bytes + iterator_p->current_position;
+  iterator_p->current_position += iterator_p->list_p->item_size;
+
+  if (iterator_p->current_p->next_p == NULL)
+  {
+    if (iterator_p->current_position >= iterator_p->list_p->data.last_position)
+    {
+      iterator_p->current_p = NULL;
+      iterator_p->current_position = 0;
+    }
+  }
+  else if (iterator_p->current_position >= iterator_p->list_p->page_size)
+  {
+    iterator_p->current_p = iterator_p->current_p->next_p;
+    iterator_p->current_position = 0;
+  }
+  return result;
+} /* parser_list_iterator_next */
+
+/**********************************************************************/
+/* Parser stack management functions                                  */
+/**********************************************************************/
+
+/* Stack is a reversed storage. */
+
+/**
+ * Initialize parser stack.
+ */
+void
+parser_stack_init (parser_context_t *context_p) /**< context */
+{
+  parser_data_init (&context_p->stack, PARSER_STACK_PAGE_SIZE);
+  context_p->free_page_p = NULL;
+} /* parser_stack_init */
+
+/**
+ * Free parser stack.
+ */
+void
+parser_stack_free (parser_context_t *context_p) /**< context */
+{
+  parser_data_free (&context_p->stack,
+                    sizeof (parser_mem_page_t *) + PARSER_STACK_PAGE_SIZE);
+
+  if (context_p->free_page_p != NULL)
+  {
+    parser_free (context_p->free_page_p,
+                 sizeof (parser_mem_page_t *) + PARSER_STACK_PAGE_SIZE);
+  }
+} /* parser_stack_free */
+
+/**
+ * Pushes an uint8_t value onto the stack.
+ */
+void
+parser_stack_push_uint8 (parser_context_t *context_p, /**< context */
+                         uint8_t uint8_value) /**< value pushed onto the stack */
+{
+  parser_mem_page_t *page_p = context_p->stack.first_p;
+
+  /* This assert might trigger false positive valgrind errors, when
+   * parser_stack_push() pushes not fully initialized structures.
+   * More precisely when the last byte of the structure is uninitialized. */
+  JERRY_ASSERT (page_p == NULL
+                || context_p->stack_top_uint8 == page_p->bytes[context_p->stack.last_position - 1]);
+
+  if (context_p->stack.last_position >= PARSER_STACK_PAGE_SIZE)
+  {
+    if (context_p->free_page_p != NULL)
+    {
+      page_p = context_p->free_page_p;
+      context_p->free_page_p = NULL;
+    }
+    else
+    {
+      size_t size = sizeof (parser_mem_page_t *) + PARSER_STACK_PAGE_SIZE;
+      page_p = (parser_mem_page_t *) parser_malloc (context_p, size);
+    }
+
+    page_p->next_p = context_p->stack.first_p;
+    context_p->stack.last_position = 0;
+    context_p->stack.first_p = page_p;
+  }
+
+  page_p->bytes[context_p->stack.last_position++] = uint8_value;
+  context_p->stack_top_uint8 = uint8_value;
+} /* parser_stack_push_uint8 */
+
+/**
+ * Pops the last uint8_t value from the stack.
+ */
+void
+parser_stack_pop_uint8 (parser_context_t *context_p) /**< context */
+{
+  parser_mem_page_t *page_p = context_p->stack.first_p;
+
+  JERRY_ASSERT (page_p != NULL
+                && context_p->stack_top_uint8 == page_p->bytes[context_p->stack.last_position - 1]);
+
+  context_p->stack.last_position--;
+
+  if (context_p->stack.last_position == 0)
+  {
+    context_p->stack.first_p = page_p->next_p;
+    context_p->stack.last_position = PARSER_STACK_PAGE_SIZE;
+
+    if (context_p->free_page_p == NULL)
+    {
+      context_p->free_page_p = page_p;
+    }
+    else
+    {
+      parser_free (page_p,
+                   sizeof (parser_mem_page_t *) + PARSER_STACK_PAGE_SIZE);
+    }
+
+    page_p = context_p->stack.first_p;
+
+    JERRY_ASSERT (page_p != NULL);
+  }
+
+  context_p->stack_top_uint8 = page_p->bytes[context_p->stack.last_position - 1];
+} /* parser_stack_pop_uint8 */
+
+/**
+ * Pushes an uint16_t value onto the stack.
+ */
+void
+parser_stack_push_uint16 (parser_context_t *context_p, /**< context */
+                          uint16_t uint16_value) /**< value pushed onto the stack */
+{
+  if (context_p->stack.last_position + 2 <= PARSER_STACK_PAGE_SIZE)
+  {
+    parser_mem_page_t *page_p = context_p->stack.first_p;
+
+    JERRY_ASSERT (page_p != NULL
+                  && context_p->stack_top_uint8 == page_p->bytes[context_p->stack.last_position - 1]);
+
+    page_p->bytes[context_p->stack.last_position++] = (uint8_t) (uint16_value >> 8);
+    page_p->bytes[context_p->stack.last_position++] = (uint8_t) uint16_value;
+    context_p->stack_top_uint8 = (uint8_t) uint16_value;
+  }
+  else
+  {
+    parser_stack_push_uint8 (context_p, (uint8_t) (uint16_value >> 8));
+    parser_stack_push_uint8 (context_p, (uint8_t) uint16_value);
+  }
+} /* parser_stack_push_uint16 */
+
+/**
+ * Pops the last uint16_t value from the stack.
+ *
+ * @return the value popped from the stack.
+ */
+uint16_t
+parser_stack_pop_uint16 (parser_context_t *context_p) /**< context */
+{
+  uint32_t value = context_p->stack_top_uint8;
+
+  if (context_p->stack.last_position >= 3)
+  {
+    parser_mem_page_t *page_p = context_p->stack.first_p;
+
+    JERRY_ASSERT (page_p != NULL
+                  && context_p->stack_top_uint8 == page_p->bytes[context_p->stack.last_position - 1]);
+
+    value |= ((uint32_t) page_p->bytes[context_p->stack.last_position - 2]) << 8;
+    context_p->stack_top_uint8 = page_p->bytes[context_p->stack.last_position - 3];
+    context_p->stack.last_position -= 2;
+  }
+  else
+  {
+    parser_stack_pop_uint8 (context_p);
+    value |= ((uint32_t) context_p->stack_top_uint8) << 8;
+    parser_stack_pop_uint8 (context_p);
+  }
+  return (uint16_t) value;
+} /* parser_stack_pop_uint16 */
+
+/**
+ * Pushes a data onto the stack.
+ */
+void
+parser_stack_push (parser_context_t *context_p, /**< context */
+                   const void *data_p, /**< data pushed onto the stack */
+                   uint32_t length) /**< length of the data */
+{
+  uint32_t fragment_length = PARSER_STACK_PAGE_SIZE - context_p->stack.last_position;
+  const uint8_t *bytes_p = (const uint8_t *) data_p;
+  parser_mem_page_t *page_p;
+
+  JERRY_ASSERT (length < PARSER_STACK_PAGE_SIZE && length > 0);
+
+  context_p->stack_top_uint8 = bytes_p[length - 1];
+
+  if (fragment_length > 0)
+  {
+    /* Fill the remaining bytes. */
+    if (fragment_length > length)
+    {
+      fragment_length = length;
+    }
+
+    memcpy (context_p->stack.first_p->bytes + context_p->stack.last_position,
+            bytes_p,
+            fragment_length);
+
+    if (fragment_length == length)
+    {
+      context_p->stack.last_position += length;
+      return;
+    }
+
+    bytes_p += fragment_length;
+    length -= fragment_length;
+  }
+
+  if (context_p->free_page_p != NULL)
+  {
+    page_p = context_p->free_page_p;
+    context_p->free_page_p = NULL;
+  }
+  else
+  {
+    size_t size = sizeof (parser_mem_page_t *) + PARSER_STACK_PAGE_SIZE;
+
+    page_p = (parser_mem_page_t *) parser_malloc (context_p, size);
+  }
+
+  page_p->next_p = context_p->stack.first_p;
+
+  context_p->stack.first_p = page_p;
+
+  memcpy (page_p->bytes, bytes_p, length);
+  context_p->stack.last_position = length;
+} /* parser_stack_push */
+
+/**
+ * Pop bytes from the top of the stack.
+ */
+void
+parser_stack_pop (parser_context_t *context_p, /**< context */
+                  void *data_p, /**< destination buffer, can be NULL */
+                  uint32_t length) /**< length of the data */
+{
+  uint8_t *bytes_p = (uint8_t *) data_p;
+  parser_mem_page_t *page_p = context_p->stack.first_p;
+
+  JERRY_ASSERT (length < PARSER_STACK_PAGE_SIZE && length > 0);
+
+  if (context_p->stack.last_position > length)
+  {
+    context_p->stack.last_position -= length;
+    context_p->stack_top_uint8 = page_p->bytes[context_p->stack.last_position - 1];
+
+    if (bytes_p != NULL)
+    {
+      memcpy (bytes_p, context_p->stack.first_p->bytes + context_p->stack.last_position, length);
+    }
+    return;
+  }
+
+  JERRY_ASSERT (page_p->next_p != NULL);
+
+  length -= context_p->stack.last_position;
+
+  if (bytes_p != NULL)
+  {
+    memcpy (bytes_p + length, page_p->bytes, context_p->stack.last_position);
+  }
+
+  context_p->stack.first_p = page_p->next_p;
+  context_p->stack.last_position = PARSER_STACK_PAGE_SIZE - length;
+  context_p->stack_top_uint8 = page_p->next_p->bytes[context_p->stack.last_position - 1];
+
+  if (bytes_p != NULL && length > 0)
+  {
+    memcpy (bytes_p, page_p->next_p->bytes + context_p->stack.last_position, length);
+  }
+
+  JERRY_ASSERT (context_p->stack.last_position > 0);
+
+  if (context_p->free_page_p == NULL)
+  {
+    context_p->free_page_p = page_p;
+  }
+  else
+  {
+    parser_free (page_p,
+                 sizeof (parser_mem_page_t *) + PARSER_STACK_PAGE_SIZE);
+  }
+} /* parser_stack_pop */
+
+/**
+ * Skip the next n bytes of the stack.
+ */
+void
+parser_stack_iterator_skip (parser_stack_iterator_t *iterator, /**< iterator */
+                            size_t length) /**< number of skipped bytes */
+{
+  JERRY_ASSERT (length < PARSER_STACK_PAGE_SIZE && length > 0);
+
+  if (length < iterator->current_position)
+  {
+    iterator->current_position -= length;
+  }
+  else
+  {
+    iterator->current_position = PARSER_STACK_PAGE_SIZE - (length - iterator->current_position);
+    iterator->current_p = iterator->current_p->next_p;
+  }
+} /* parser_stack_iterator_skip */
+
+/**
+ * Read bytes from the stack.
+ */
+void
+parser_stack_iterator_read (parser_stack_iterator_t *iterator, /**< iterator */
+                            void *data_p, /**< destination buffer */
+                            size_t length) /**< length of the data */
+{
+  uint8_t *bytes_p = (uint8_t *) data_p;
+
+  JERRY_ASSERT (length < PARSER_STACK_PAGE_SIZE && length > 0);
+
+  if (length <= iterator->current_position)
+  {
+    memcpy (bytes_p,
+            iterator->current_p->bytes + iterator->current_position - length,
+            length);
+  }
+  else
+  {
+    JERRY_ASSERT (iterator->current_p->next_p != NULL);
+
+    length -= iterator->current_position;
+    memcpy (bytes_p + length,
+            iterator->current_p->bytes,
+            iterator->current_position);
+    memcpy (bytes_p,
+            iterator->current_p->next_p->bytes + PARSER_STACK_PAGE_SIZE - length,
+            length);
+  }
+} /* parser_stack_iterator_read */
+
+/**
+ * Write bytes onto the stack.
+ */
+void
+parser_stack_iterator_write (parser_stack_iterator_t *iterator, /**< iterator */
+                             const void *data_p, /**< destination buffer */
+                             size_t length) /**< length of the data */
+{
+  const uint8_t *bytes_p = (const uint8_t *) data_p;
+
+  JERRY_ASSERT (length < PARSER_STACK_PAGE_SIZE && length > 0);
+
+  if (length <= iterator->current_position)
+  {
+    memcpy (iterator->current_p->bytes + iterator->current_position - length,
+            bytes_p,
+            length);
+  }
+  else
+  {
+    JERRY_ASSERT (iterator->current_p->next_p != NULL);
+
+    length -= iterator->current_position;
+    memcpy (iterator->current_p->bytes,
+            bytes_p + length,
+            iterator->current_position);
+    memcpy (iterator->current_p->next_p->bytes + PARSER_STACK_PAGE_SIZE - length,
+            bytes_p,
+            length);
+  }
+} /* parser_stack_iterator_write */
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* JERRY_JS_PARSER */
diff --git a/deps/jerry/jerry-core/parser/js/js-parser-scanner.c b/deps/jerry/jerry-core/parser/js/js-parser-scanner.c
new file mode 100644 (file)
index 0000000..5179c0d
--- /dev/null
@@ -0,0 +1,682 @@
+/* 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.
+ */
+
+#include "js-parser-internal.h"
+
+#if JERRY_JS_PARSER
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_scanner Scanner
+ * @{
+ */
+
+/**
+ * Scan mode types types.
+ */
+typedef enum
+{
+  SCAN_MODE_PRIMARY_EXPRESSION,            /**< scanning primary expression */
+  SCAN_MODE_PRIMARY_EXPRESSION_AFTER_NEW,  /**< scanning primary expression after new */
+  SCAN_MODE_POST_PRIMARY_EXPRESSION,       /**< scanning post primary expression */
+  SCAN_MODE_PRIMARY_EXPRESSION_END,        /**< scanning prymary expression end */
+  SCAN_MODE_STATEMENT,                     /**< scanning statement */
+  SCAN_MODE_FUNCTION_ARGUMENTS,            /**< scanning function arguments */
+  SCAN_MODE_PROPERTY_NAME,                 /**< scanning property name */
+} scan_modes_t;
+
+/**
+ * Scan stack mode types types.
+ */
+typedef enum
+{
+  SCAN_STACK_HEAD,                         /**< head */
+  SCAN_STACK_PAREN_EXPRESSION,             /**< parent expression group */
+  SCAN_STACK_PAREN_STATEMENT,              /**< parent stetement group */
+  SCAN_STACK_COLON_EXPRESSION,             /**< colon expression group */
+  SCAN_STACK_COLON_STATEMENT,              /**< colon statement group*/
+  SCAN_STACK_SQUARE_BRACKETED_EXPRESSION,  /**< square bracketed expression group */
+  SCAN_STACK_OBJECT_LITERAL,               /**< object literal group */
+  SCAN_STACK_BLOCK_STATEMENT,              /**< block statement group */
+  SCAN_STACK_BLOCK_EXPRESSION,             /**< block expression group*/
+  SCAN_STACK_BLOCK_PROPERTY,               /**< block property group */
+} scan_stack_modes_t;
+
+/**
+ * Scan primary expression.
+ *
+ * @return true for continue, false for break
+ */
+static bool
+parser_scan_primary_expression (parser_context_t *context_p, /**< context */
+                                lexer_token_type_t type, /**< current token type */
+                                scan_stack_modes_t stack_top, /**< current stack top */
+                                scan_modes_t *mode) /**< scan mode */
+{
+  switch (type)
+  {
+    case LEXER_KEYW_NEW:
+    {
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION_AFTER_NEW;
+      break;
+    }
+    case LEXER_DIVIDE:
+    case LEXER_ASSIGN_DIVIDE:
+    {
+      lexer_construct_regexp_object (context_p, true);
+      *mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
+      break;
+    }
+    case LEXER_KEYW_FUNCTION:
+    {
+      parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_EXPRESSION);
+      *mode = SCAN_MODE_FUNCTION_ARGUMENTS;
+      break;
+    }
+    case LEXER_LEFT_PAREN:
+    {
+      parser_stack_push_uint8 (context_p, SCAN_STACK_PAREN_EXPRESSION);
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      break;
+    }
+    case LEXER_LEFT_SQUARE:
+    {
+      parser_stack_push_uint8 (context_p, SCAN_STACK_SQUARE_BRACKETED_EXPRESSION);
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      break;
+    }
+    case LEXER_LEFT_BRACE:
+    {
+      parser_stack_push_uint8 (context_p, SCAN_STACK_OBJECT_LITERAL);
+      *mode = SCAN_MODE_PROPERTY_NAME;
+      return true;
+    }
+    case LEXER_LITERAL:
+    case LEXER_KEYW_THIS:
+    case LEXER_LIT_TRUE:
+    case LEXER_LIT_FALSE:
+    case LEXER_LIT_NULL:
+    {
+      *mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
+      break;
+    }
+    case LEXER_RIGHT_SQUARE:
+    {
+      if (stack_top != SCAN_STACK_SQUARE_BRACKETED_EXPRESSION)
+      {
+        parser_raise_error (context_p, PARSER_ERR_PRIMARY_EXP_EXPECTED);
+      }
+      parser_stack_pop_uint8 (context_p);
+      *mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
+      break;
+    }
+    case LEXER_COMMA:
+    {
+      if (stack_top != SCAN_STACK_SQUARE_BRACKETED_EXPRESSION)
+      {
+        parser_raise_error (context_p, PARSER_ERR_PRIMARY_EXP_EXPECTED);
+      }
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      break;
+    }
+    case LEXER_RIGHT_PAREN:
+    {
+      *mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
+      if (stack_top == SCAN_STACK_PAREN_STATEMENT)
+      {
+        *mode = SCAN_MODE_STATEMENT;
+      }
+      else if (stack_top != SCAN_STACK_PAREN_EXPRESSION)
+      {
+        parser_raise_error (context_p, PARSER_ERR_PRIMARY_EXP_EXPECTED);
+      }
+
+      parser_stack_pop_uint8 (context_p);
+      break;
+    }
+    case LEXER_SEMICOLON:
+    {
+      /* Needed by for (;;) statements. */
+      if (stack_top != SCAN_STACK_PAREN_STATEMENT)
+      {
+        parser_raise_error (context_p, PARSER_ERR_PRIMARY_EXP_EXPECTED);
+      }
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      break;
+    }
+    default:
+    {
+      parser_raise_error (context_p, PARSER_ERR_PRIMARY_EXP_EXPECTED);
+    }
+  }
+  return false;
+} /* parser_scan_primary_expression */
+
+/**
+ * Scan the tokens after the primary expression.
+ *
+ * @return true for break, false for fall through
+ */
+static bool
+parser_scan_post_primary_expression (parser_context_t *context_p, /**< context */
+                                     lexer_token_type_t type, /**< current token type */
+                                     scan_modes_t *mode) /**< scan mode */
+{
+  switch (type)
+  {
+    case LEXER_DOT:
+    {
+      lexer_scan_identifier (context_p, false);
+      return true;
+    }
+    case LEXER_LEFT_PAREN:
+    {
+      parser_stack_push_uint8 (context_p, SCAN_STACK_PAREN_EXPRESSION);
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      return true;
+    }
+    case LEXER_LEFT_SQUARE:
+    {
+      parser_stack_push_uint8 (context_p, SCAN_STACK_SQUARE_BRACKETED_EXPRESSION);
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      return true;
+    }
+    case LEXER_INCREASE:
+    case LEXER_DECREASE:
+    {
+      if (!context_p->token.was_newline)
+      {
+        *mode = SCAN_MODE_PRIMARY_EXPRESSION_END;
+        return true;
+      }
+      /* FALLTHRU */
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  return false;
+} /* parser_scan_post_primary_expression */
+
+/**
+ * Scan the tokens after the primary expression.
+ *
+ * @return true for continue, false for break
+ */
+static bool
+parser_scan_primary_expression_end (parser_context_t *context_p, /**< context */
+                                    lexer_token_type_t type, /**< current token type */
+                                    scan_stack_modes_t stack_top, /**< current stack top */
+                                    lexer_token_type_t end_type, /**< terminator token type */
+                                    scan_modes_t *mode) /**< scan mode */
+{
+  switch (type)
+  {
+    case LEXER_QUESTION_MARK:
+    {
+      parser_stack_push_uint8 (context_p, SCAN_STACK_COLON_EXPRESSION);
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      return false;
+    }
+    case LEXER_COMMA:
+    {
+      if (stack_top == SCAN_STACK_OBJECT_LITERAL)
+      {
+        *mode = SCAN_MODE_PROPERTY_NAME;
+        return true;
+      }
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      return false;
+    }
+    case LEXER_COLON:
+    {
+      if (stack_top == SCAN_STACK_COLON_EXPRESSION
+          || stack_top == SCAN_STACK_COLON_STATEMENT)
+      {
+        if (stack_top == SCAN_STACK_COLON_EXPRESSION)
+        {
+          *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+        }
+        else
+        {
+          *mode = SCAN_MODE_STATEMENT;
+        }
+        parser_stack_pop_uint8 (context_p);
+        return false;
+      }
+      /* FALLTHRU */
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  if (LEXER_IS_BINARY_OP_TOKEN (type)
+      || (type == LEXER_SEMICOLON && stack_top == SCAN_STACK_PAREN_STATEMENT))
+  {
+    *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+    return false;
+  }
+
+  if ((type == LEXER_RIGHT_SQUARE && stack_top == SCAN_STACK_SQUARE_BRACKETED_EXPRESSION)
+      || (type == LEXER_RIGHT_PAREN && stack_top == SCAN_STACK_PAREN_EXPRESSION)
+      || (type == LEXER_RIGHT_BRACE && stack_top == SCAN_STACK_OBJECT_LITERAL))
+  {
+    parser_stack_pop_uint8 (context_p);
+    *mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
+    return false;
+  }
+
+  *mode = SCAN_MODE_STATEMENT;
+  if (type == LEXER_RIGHT_PAREN && stack_top == SCAN_STACK_PAREN_STATEMENT)
+  {
+    parser_stack_pop_uint8 (context_p);
+    return false;
+  }
+
+  /* Check whether we can enter to statement mode. */
+  if (stack_top != SCAN_STACK_BLOCK_STATEMENT
+      && stack_top != SCAN_STACK_BLOCK_EXPRESSION
+      && !(stack_top == SCAN_STACK_HEAD && end_type == LEXER_SCAN_SWITCH))
+  {
+    parser_raise_error (context_p, PARSER_ERR_INVALID_EXPRESSION);
+  }
+
+  if (type == LEXER_RIGHT_BRACE
+      || context_p->token.was_newline)
+  {
+    return true;
+  }
+
+  if (type != LEXER_SEMICOLON)
+  {
+    parser_raise_error (context_p, PARSER_ERR_INVALID_EXPRESSION);
+  }
+
+  return false;
+} /* parser_scan_primary_expression_end */
+
+/**
+ * Scan statements.
+ *
+ * @return true for continue, false for break
+ */
+static bool
+parser_scan_statement (parser_context_t *context_p, /**< context */
+                       lexer_token_type_t type, /**< current token type */
+                       scan_stack_modes_t stack_top, /**< current stack top */
+                       scan_modes_t *mode) /**< scan mode */
+{
+  switch (type)
+  {
+    case LEXER_SEMICOLON:
+    case LEXER_KEYW_ELSE:
+    case LEXER_KEYW_DO:
+    case LEXER_KEYW_TRY:
+    case LEXER_KEYW_FINALLY:
+    case LEXER_KEYW_DEBUGGER:
+    {
+      return false;
+    }
+    case LEXER_KEYW_IF:
+    case LEXER_KEYW_WHILE:
+    case LEXER_KEYW_WITH:
+    case LEXER_KEYW_SWITCH:
+    case LEXER_KEYW_CATCH:
+    {
+      lexer_next_token (context_p);
+      if (context_p->token.type != LEXER_LEFT_PAREN)
+      {
+        parser_raise_error (context_p, PARSER_ERR_LEFT_PAREN_EXPECTED);
+      }
+
+      parser_stack_push_uint8 (context_p, SCAN_STACK_PAREN_STATEMENT);
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      return false;
+    }
+    case LEXER_KEYW_FOR:
+    {
+      lexer_next_token (context_p);
+      if (context_p->token.type != LEXER_LEFT_PAREN)
+      {
+        parser_raise_error (context_p, PARSER_ERR_LEFT_PAREN_EXPECTED);
+      }
+
+      lexer_next_token (context_p);
+      parser_stack_push_uint8 (context_p, SCAN_STACK_PAREN_STATEMENT);
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+
+      if (context_p->token.type == LEXER_KEYW_VAR)
+      {
+        return false;
+      }
+      return true;
+    }
+    case LEXER_KEYW_VAR:
+    case LEXER_KEYW_THROW:
+    {
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      return false;
+    }
+    case LEXER_KEYW_RETURN:
+    {
+      lexer_next_token (context_p);
+      if (!context_p->token.was_newline
+          && context_p->token.type != LEXER_SEMICOLON)
+      {
+        *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      }
+      return true;
+    }
+    case LEXER_KEYW_BREAK:
+    case LEXER_KEYW_CONTINUE:
+    {
+      lexer_next_token (context_p);
+      if (!context_p->token.was_newline
+          && context_p->token.type == LEXER_LITERAL
+          && context_p->token.lit_location.type == LEXER_IDENT_LITERAL)
+      {
+        return false;
+      }
+      return true;
+    }
+    case LEXER_KEYW_DEFAULT:
+    {
+      lexer_next_token (context_p);
+      if (context_p->token.type != LEXER_COLON)
+      {
+        parser_raise_error (context_p, PARSER_ERR_COLON_EXPECTED);
+      }
+      return false;
+    }
+    case LEXER_KEYW_CASE:
+    {
+      parser_stack_push_uint8 (context_p, SCAN_STACK_COLON_STATEMENT);
+      *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+      return false;
+    }
+    case LEXER_RIGHT_BRACE:
+    {
+      if (stack_top == SCAN_STACK_BLOCK_STATEMENT
+          || stack_top == SCAN_STACK_BLOCK_EXPRESSION
+          || stack_top == SCAN_STACK_BLOCK_PROPERTY)
+      {
+        parser_stack_pop_uint8 (context_p);
+
+        if (stack_top == SCAN_STACK_BLOCK_EXPRESSION)
+        {
+          *mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
+        }
+        else if (stack_top == SCAN_STACK_BLOCK_PROPERTY)
+        {
+          *mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
+          lexer_next_token (context_p);
+          if (context_p->token.type != LEXER_COMMA
+              && context_p->token.type != LEXER_RIGHT_BRACE)
+          {
+            parser_raise_error (context_p, PARSER_ERR_OBJECT_ITEM_SEPARATOR_EXPECTED);
+          }
+          return true;
+        }
+        return false;
+      }
+      break;
+    }
+    case LEXER_LEFT_BRACE:
+    {
+      parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_STATEMENT);
+      return false;
+    }
+    case LEXER_KEYW_FUNCTION:
+    {
+      parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_STATEMENT);
+      *mode = SCAN_MODE_FUNCTION_ARGUMENTS;
+      return false;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  *mode = SCAN_MODE_PRIMARY_EXPRESSION;
+
+  if (type == LEXER_LITERAL
+      && context_p->token.lit_location.type == LEXER_IDENT_LITERAL)
+  {
+    lexer_next_token (context_p);
+    if (context_p->token.type == LEXER_COLON)
+    {
+      *mode = SCAN_MODE_STATEMENT;
+      return false;
+    }
+    *mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
+  }
+
+  return true;
+} /* parser_scan_statement */
+
+/**
+ * Pre-scan for token(s).
+ */
+void
+parser_scan_until (parser_context_t *context_p, /**< context */
+                   lexer_range_t *range_p, /**< destination range */
+                   lexer_token_type_t end_type) /**< terminator token type */
+{
+  scan_modes_t mode;
+  lexer_token_type_t end_type_b = end_type;
+
+  range_p->source_p = context_p->source_p;
+  range_p->source_end_p = context_p->source_p;
+  range_p->line = context_p->line;
+  range_p->column = context_p->column;
+
+  mode = SCAN_MODE_PRIMARY_EXPRESSION;
+
+  if (end_type == LEXER_KEYW_CASE)
+  {
+    end_type = LEXER_SCAN_SWITCH;
+    end_type_b = LEXER_SCAN_SWITCH;
+    mode = SCAN_MODE_STATEMENT;
+  }
+  else
+  {
+    lexer_next_token (context_p);
+
+    if (end_type == LEXER_KEYW_IN)
+    {
+      end_type_b = LEXER_SEMICOLON;
+      if (context_p->token.type == LEXER_KEYW_VAR)
+      {
+        lexer_next_token (context_p);
+      }
+    }
+  }
+
+  parser_stack_push_uint8 (context_p, SCAN_STACK_HEAD);
+
+  while (true)
+  {
+    lexer_token_type_t type = (lexer_token_type_t) context_p->token.type;
+    scan_stack_modes_t stack_top = (scan_stack_modes_t) context_p->stack_top_uint8;
+
+    if (type == LEXER_EOS)
+    {
+      parser_raise_error (context_p, PARSER_ERR_EXPRESSION_EXPECTED);
+    }
+
+    if (stack_top == SCAN_STACK_HEAD
+        && (type == end_type || type == end_type_b))
+    {
+      parser_stack_pop_uint8 (context_p);
+      return;
+    }
+
+    switch (mode)
+    {
+      case SCAN_MODE_PRIMARY_EXPRESSION:
+      {
+        if (type == LEXER_ADD
+            || type == LEXER_SUBTRACT
+            || LEXER_IS_UNARY_OP_TOKEN (type))
+        {
+          break;
+        }
+        /* FALLTHRU */
+      }
+      case SCAN_MODE_PRIMARY_EXPRESSION_AFTER_NEW:
+      {
+        if (parser_scan_primary_expression (context_p, type, stack_top, &mode))
+        {
+          continue;
+        }
+        break;
+      }
+      case SCAN_MODE_POST_PRIMARY_EXPRESSION:
+      {
+        if (parser_scan_post_primary_expression (context_p, type, &mode))
+        {
+          break;
+        }
+        /* FALLTHRU */
+      }
+      case SCAN_MODE_PRIMARY_EXPRESSION_END:
+      {
+        if (parser_scan_primary_expression_end (context_p, type, stack_top, end_type, &mode))
+        {
+          continue;
+        }
+        break;
+      }
+      case SCAN_MODE_STATEMENT:
+      {
+        if (end_type == LEXER_SCAN_SWITCH
+            && stack_top == SCAN_STACK_HEAD
+            && (type == LEXER_KEYW_DEFAULT || type == LEXER_KEYW_CASE || type == LEXER_RIGHT_BRACE))
+        {
+          parser_stack_pop_uint8 (context_p);
+          return;
+        }
+
+        if (parser_scan_statement (context_p, type, stack_top, &mode))
+        {
+          continue;
+        }
+        break;
+      }
+      case SCAN_MODE_FUNCTION_ARGUMENTS:
+      {
+        JERRY_ASSERT (stack_top == SCAN_STACK_BLOCK_STATEMENT
+                      || stack_top == SCAN_STACK_BLOCK_EXPRESSION
+                      || stack_top == SCAN_STACK_BLOCK_PROPERTY);
+
+        if (context_p->token.type == LEXER_LITERAL
+            && (context_p->token.lit_location.type == LEXER_IDENT_LITERAL
+                || context_p->token.lit_location.type == LEXER_NUMBER_LITERAL))
+        {
+          lexer_next_token (context_p);
+        }
+
+        if (context_p->token.type != LEXER_LEFT_PAREN)
+        {
+          parser_raise_error (context_p, PARSER_ERR_ARGUMENT_LIST_EXPECTED);
+        }
+        lexer_next_token (context_p);
+
+        if (context_p->token.type != LEXER_RIGHT_PAREN)
+        {
+          while (true)
+          {
+            if (context_p->token.type != LEXER_LITERAL
+                || context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
+            {
+              parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_EXPECTED);
+            }
+            lexer_next_token (context_p);
+
+            if (context_p->token.type != LEXER_COMMA)
+            {
+              break;
+            }
+            lexer_next_token (context_p);
+          }
+        }
+
+        if (context_p->token.type != LEXER_RIGHT_PAREN)
+        {
+          parser_raise_error (context_p, PARSER_ERR_RIGHT_PAREN_EXPECTED);
+        }
+
+        lexer_next_token (context_p);
+
+        if (context_p->token.type != LEXER_LEFT_BRACE)
+        {
+          parser_raise_error (context_p, PARSER_ERR_LEFT_BRACE_EXPECTED);
+        }
+        mode = SCAN_MODE_STATEMENT;
+        break;
+      }
+      case SCAN_MODE_PROPERTY_NAME:
+      {
+        JERRY_ASSERT (stack_top == SCAN_STACK_OBJECT_LITERAL);
+
+        lexer_scan_identifier (context_p, true);
+
+        if (context_p->token.type == LEXER_RIGHT_BRACE)
+        {
+          parser_stack_pop_uint8 (context_p);
+          mode = SCAN_MODE_POST_PRIMARY_EXPRESSION;
+          break;
+        }
+
+        if (context_p->token.type == LEXER_PROPERTY_GETTER
+            || context_p->token.type == LEXER_PROPERTY_SETTER)
+        {
+          parser_stack_push_uint8 (context_p, SCAN_STACK_BLOCK_PROPERTY);
+          mode = SCAN_MODE_FUNCTION_ARGUMENTS;
+          break;
+        }
+
+        lexer_next_token (context_p);
+        if (context_p->token.type != LEXER_COLON)
+        {
+          parser_raise_error (context_p, PARSER_ERR_COLON_EXPECTED);
+        }
+
+        mode = SCAN_MODE_PRIMARY_EXPRESSION;
+        break;
+      }
+    }
+
+    range_p->source_end_p = context_p->source_p;
+    lexer_next_token (context_p);
+  }
+} /* parser_scan_until */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* JERRY_JS_PARSER */
diff --git a/deps/jerry/jerry-core/parser/js/js-parser-statm.c b/deps/jerry/jerry-core/parser/js/js-parser-statm.c
new file mode 100644 (file)
index 0000000..74cc429
--- /dev/null
@@ -0,0 +1,2258 @@
+/* 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.
+ */
+
+#include "js-parser-internal.h"
+
+#if JERRY_JS_PARSER
+
+#ifdef JERRY_DEBUGGER
+#include "jcontext.h"
+#endif /*JERRY_DEBUGGER */
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_stmt Statement parser
+ * @{
+ */
+
+/* Strict mode string literal in directive prologues */
+#define PARSER_USE_STRICT_LITERAL  "use strict"
+#define PARSER_USE_STRICT_LENGTH   10
+
+/**
+ * Parser statement types.
+ *
+ * When a new statement is added, the following
+ * functions may need to be updated as well:
+ *
+ *  - parser_statement_length()
+ *  - parser_parse_break_statement()
+ *  - parser_parse_continue_statement()
+ *  - parser_free_jumps()
+ *  - 'case LEXER_RIGHT_BRACE:' in parser_parse_statements()
+ *  - 'if (context_p->token.type == LEXER_RIGHT_BRACE)' in parser_parse_statements()
+ *  - 'switch (context_p->stack_top_uint8)' in parser_parse_statements()
+ */
+typedef enum
+{
+  PARSER_STATEMENT_START,
+  PARSER_STATEMENT_BLOCK,
+  PARSER_STATEMENT_LABEL,
+  PARSER_STATEMENT_IF,
+  PARSER_STATEMENT_ELSE,
+  /* From switch -> for-in : break target statements */
+  PARSER_STATEMENT_SWITCH,
+  PARSER_STATEMENT_SWITCH_NO_DEFAULT,
+  /* From do-while -> for->in : continue target statements */
+  PARSER_STATEMENT_DO_WHILE,
+  PARSER_STATEMENT_WHILE,
+  PARSER_STATEMENT_FOR,
+  /* From for->in -> try : instructions with context
+   * Break and continue uses another instruction form
+   * when crosses their borders. */
+  PARSER_STATEMENT_FOR_IN,
+  PARSER_STATEMENT_WITH,
+  PARSER_STATEMENT_TRY,
+} parser_statement_type_t;
+
+/**
+ * Loop statement.
+ */
+typedef struct
+{
+  parser_branch_node_t *branch_list_p;    /**< list of breaks and continues targeting this statement */
+} parser_loop_statement_t;
+
+/**
+ * Label statement.
+ */
+typedef struct
+{
+  lexer_lit_location_t label_ident;       /**< name of the label */
+  parser_branch_node_t *break_list_p;     /**< list of breaks targeting this label */
+} parser_label_statement_t;
+
+/**
+ * If/else statement.
+ */
+typedef struct
+{
+  parser_branch_t branch;                 /**< branch to the end */
+} parser_if_else_statement_t;
+
+/**
+ * Switch statement.
+ */
+typedef struct
+{
+  parser_branch_t default_branch;         /**< branch to the default case */
+  parser_branch_node_t *branch_list_p;    /**< branches of case statements */
+} parser_switch_statement_t;
+
+/**
+ * Do-while statement.
+ */
+typedef struct
+{
+  uint32_t start_offset;                  /**< start byte code offset */
+} parser_do_while_statement_t;
+
+/**
+ * While statement.
+ */
+typedef struct
+{
+  parser_branch_t branch;                 /**< branch to the end */
+  lexer_range_t condition_range;          /**< condition part */
+  uint32_t start_offset;                  /**< start byte code offset */
+} parser_while_statement_t;
+
+/**
+ * For statement.
+ */
+typedef struct
+{
+  parser_branch_t branch;                 /**< branch to the end */
+  lexer_range_t condition_range;          /**< condition part */
+  lexer_range_t expression_range;         /**< increase part */
+  uint32_t start_offset;                  /**< start byte code offset */
+} parser_for_statement_t;
+
+/**
+ * For-in statement.
+ */
+typedef struct
+{
+  parser_branch_t branch;                 /**< branch to the end */
+  uint32_t start_offset;                  /**< start byte code offset */
+} parser_for_in_statement_t;
+
+/**
+ * With statement.
+ */
+typedef struct
+{
+  parser_branch_t branch;                 /**< branch to the end */
+} parser_with_statement_t;
+
+/**
+ * Lexer token types.
+ */
+typedef enum
+{
+  parser_try_block,                       /**< try block */
+  parser_catch_block,                     /**< catch block */
+  parser_finally_block,                   /**< finally block */
+} parser_try_block_type_t;
+
+/**
+ * Try statement.
+ */
+typedef struct
+{
+  parser_try_block_type_t type;           /**< current block type */
+  parser_branch_t branch;                 /**< branch to the end of the current block */
+} parser_try_statement_t;
+
+/**
+ * Returns the data consumed by a statement. It can be used
+ * to skip undesired frames on the stack during frame search.
+ *
+ * @return size consumed by a statement.
+ */
+static inline size_t
+parser_statement_length (uint8_t type) /**< type of statement */
+{
+  static const uint8_t statement_lengths[12] =
+  {
+    /* PARSER_STATEMENT_BLOCK */
+    1,
+    /* PARSER_STATEMENT_LABEL */
+    (uint8_t) (sizeof (parser_label_statement_t) + 1),
+    /* PARSER_STATEMENT_IF */
+    (uint8_t) (sizeof (parser_if_else_statement_t) + 1),
+    /* PARSER_STATEMENT_ELSE */
+    (uint8_t) (sizeof (parser_if_else_statement_t) + 1),
+    /* PARSER_STATEMENT_SWITCH */
+    (uint8_t) (sizeof (parser_switch_statement_t) + sizeof (parser_loop_statement_t) + 1),
+    /* PARSER_STATEMENT_SWITCH_NO_DEFAULT */
+    (uint8_t) (sizeof (parser_switch_statement_t) + sizeof (parser_loop_statement_t) + 1),
+    /* PARSER_STATEMENT_DO_WHILE */
+    (uint8_t) (sizeof (parser_do_while_statement_t) + sizeof (parser_loop_statement_t) + 1),
+    /* PARSER_STATEMENT_WHILE */
+    (uint8_t) (sizeof (parser_while_statement_t) + sizeof (parser_loop_statement_t) + 1),
+    /* PARSER_STATEMENT_FOR */
+    (uint8_t) (sizeof (parser_for_statement_t) + sizeof (parser_loop_statement_t) + 1),
+    /* PARSER_STATEMENT_FOR_IN */
+    (uint8_t) (sizeof (parser_for_in_statement_t) + sizeof (parser_loop_statement_t) + 1),
+    /* PARSER_STATEMENT_WITH */
+    (uint8_t) (sizeof (parser_with_statement_t) + 1),
+    /* PARSER_STATEMENT_TRY */
+    (uint8_t) (sizeof (parser_try_statement_t) + 1),
+  };
+
+  JERRY_ASSERT (type >= PARSER_STATEMENT_BLOCK && type <= PARSER_STATEMENT_TRY);
+  JERRY_ASSERT (PARSER_STATEMENT_TRY - PARSER_STATEMENT_BLOCK == 11);
+
+  return statement_lengths[type - PARSER_STATEMENT_BLOCK];
+} /* parser_statement_length */
+
+/**
+ * Initialize a range from the current location.
+ */
+static inline void
+parser_save_range (parser_context_t *context_p, /**< context */
+                   lexer_range_t *range_p, /**< destination range */
+                   const uint8_t *source_end_p) /**< source end */
+{
+  range_p->source_p = context_p->source_p;
+  range_p->source_end_p = source_end_p;
+  range_p->line = context_p->line;
+  range_p->column = context_p->column;
+} /* parser_save_range */
+
+/**
+ * Set the current location on the stack.
+ */
+static inline void
+parser_set_range (parser_context_t *context_p, /**< context */
+                  lexer_range_t *range_p) /**< destination range */
+{
+  context_p->source_p = range_p->source_p;
+  context_p->source_end_p = range_p->source_end_p;
+  context_p->line = range_p->line;
+  context_p->column = range_p->column;
+} /* parser_set_range */
+
+/**
+ * Initialize stack iterator.
+ */
+static inline void
+parser_stack_iterator_init (parser_context_t *context_p, /**< context */
+                            parser_stack_iterator_t *iterator) /**< iterator */
+{
+  iterator->current_p = context_p->stack.first_p;
+  iterator->current_position = context_p->stack.last_position;
+} /* parser_stack_iterator_init */
+
+/**
+ * Read the next byte from the stack.
+ */
+static inline uint8_t
+parser_stack_iterator_read_uint8 (parser_stack_iterator_t *iterator) /**< iterator */
+{
+  JERRY_ASSERT (iterator->current_position > 0 && iterator->current_position <= PARSER_STACK_PAGE_SIZE);
+  return iterator->current_p->bytes[iterator->current_position - 1];
+} /* parser_stack_iterator_read_uint8 */
+
+/**
+ * Change last byte of the stack.
+ */
+static inline void
+parser_stack_change_last_uint8 (parser_context_t *context_p, /**< context */
+                                uint8_t new_value) /**< new value */
+{
+  parser_mem_page_t *page_p = context_p->stack.first_p;
+
+  JERRY_ASSERT (page_p != NULL
+                && context_p->stack_top_uint8 == page_p->bytes[context_p->stack.last_position - 1]);
+
+  page_p->bytes[context_p->stack.last_position - 1] = new_value;
+  context_p->stack_top_uint8 = new_value;
+} /* parser_stack_change_last_uint8 */
+
+/**
+ * Parse expression enclosed in parens.
+ */
+static inline void
+parser_parse_enclosed_expr (parser_context_t *context_p) /**< context */
+{
+  lexer_next_token (context_p);
+
+  if (context_p->token.type != LEXER_LEFT_PAREN)
+  {
+    parser_raise_error (context_p, PARSER_ERR_LEFT_PAREN_EXPECTED);
+  }
+
+  lexer_next_token (context_p);
+  parser_parse_expression (context_p, PARSE_EXPR);
+
+  if (context_p->token.type != LEXER_RIGHT_PAREN)
+  {
+    parser_raise_error (context_p, PARSER_ERR_RIGHT_PAREN_EXPECTED);
+  }
+  lexer_next_token (context_p);
+} /* parser_parse_enclosed_expr */
+
+/**
+ * Parse var statement.
+ */
+static void
+parser_parse_var_statement (parser_context_t *context_p) /**< context */
+{
+  JERRY_ASSERT (context_p->token.type == LEXER_KEYW_VAR);
+
+  while (true)
+  {
+    lexer_expect_identifier (context_p, LEXER_IDENT_LITERAL);
+    JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
+                  && context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
+
+#ifdef JERRY_DEBUGGER
+    parser_line_counter_t ident_line_counter = context_p->token.line;
+#endif /* JERRY_DEBUGGER */
+
+    context_p->lit_object.literal_p->status_flags |= LEXER_FLAG_VAR;
+
+    parser_emit_cbc_literal_from_token (context_p, CBC_PUSH_LITERAL);
+
+    lexer_next_token (context_p);
+
+    if (context_p->token.type == LEXER_ASSIGN)
+    {
+#ifdef JERRY_DEBUGGER
+      if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+          && ident_line_counter != context_p->last_breakpoint_line)
+      {
+        JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_LITERAL);
+
+        cbc_argument_t last_cbc = context_p->last_cbc;
+        context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+
+        parser_emit_cbc (context_p, CBC_BREAKPOINT_DISABLED);
+        parser_flush_cbc (context_p);
+
+        parser_append_breakpoint_info (context_p, JERRY_DEBUGGER_BREAKPOINT_LIST, ident_line_counter);
+
+        context_p->last_cbc_opcode = CBC_PUSH_LITERAL;
+        context_p->last_cbc = last_cbc;
+
+        context_p->last_breakpoint_line = ident_line_counter;
+      }
+#endif /* JERRY_DEBUGGER */
+
+      parser_parse_expression (context_p,
+                               PARSE_EXPR_STATEMENT | PARSE_EXPR_NO_COMMA | PARSE_EXPR_HAS_LITERAL);
+    }
+    else
+    {
+      JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_LITERAL
+                    && context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL);
+      /* We don't need to assign anything to this variable. */
+      context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+    }
+
+    if (context_p->token.type != LEXER_COMMA)
+    {
+      break;
+    }
+  }
+} /* parser_parse_var_statement */
+
+/**
+ * Parse function statement.
+ */
+static void
+parser_parse_function_statement (parser_context_t *context_p) /**< context */
+{
+  uint32_t status_flags;
+  lexer_literal_t *name_p;
+  lexer_literal_t *literal_p;
+  uint8_t no_reg_store;
+
+  JERRY_ASSERT (context_p->token.type == LEXER_KEYW_FUNCTION);
+
+#ifdef JERRY_DEBUGGER
+  parser_line_counter_t debugger_line = context_p->token.line;
+  parser_line_counter_t debugger_column = context_p->token.column;
+#endif /* JERRY_DEBUGGER */
+
+  lexer_expect_identifier (context_p, LEXER_IDENT_LITERAL);
+  JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
+                && context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
+
+  if (context_p->lit_object.type == LEXER_LITERAL_OBJECT_ARGUMENTS)
+  {
+    context_p->status_flags |= PARSER_ARGUMENTS_NOT_NEEDED;
+  }
+
+  name_p = context_p->lit_object.literal_p;
+
+  status_flags = PARSER_IS_FUNCTION | PARSER_IS_CLOSURE;
+  if (context_p->lit_object.type != LEXER_LITERAL_OBJECT_ANY)
+  {
+    JERRY_ASSERT (context_p->lit_object.type == LEXER_LITERAL_OBJECT_EVAL
+                  || context_p->lit_object.type == LEXER_LITERAL_OBJECT_ARGUMENTS);
+    status_flags |= PARSER_HAS_NON_STRICT_ARG;
+  }
+
+#ifdef JERRY_DEBUGGER
+  if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+  {
+    jerry_debugger_send_string (JERRY_DEBUGGER_FUNCTION_NAME,
+                                name_p->u.char_p,
+                                name_p->prop.length);
+
+    /* Reset token position for the function. */
+    context_p->token.line = debugger_line;
+    context_p->token.column = debugger_column;
+  }
+#endif /* JERRY_DEBUGGER */
+
+  if (name_p->status_flags & LEXER_FLAG_INITIALIZED)
+  {
+    if (!(name_p->status_flags & (LEXER_FLAG_FUNCTION_NAME | LEXER_FLAG_FUNCTION_ARGUMENT)))
+    {
+      /* Overwrite the previous initialization. */
+      ecma_compiled_code_t *compiled_code_p;
+
+      literal_p = PARSER_GET_LITERAL ((size_t) (context_p->lit_object.index + 1));
+
+      JERRY_ASSERT (literal_p->type == LEXER_FUNCTION_LITERAL
+                    && literal_p->status_flags == 0);
+
+      compiled_code_p = parser_parse_function (context_p, status_flags);
+      util_free_literal (literal_p);
+
+      literal_p->u.bytecode_p = compiled_code_p;
+      lexer_next_token (context_p);
+      return;
+    }
+  }
+  else if (context_p->lit_object.index + 1 == context_p->literal_count)
+  {
+    /* The most common case: the literal is the last literal. */
+    name_p->status_flags |= LEXER_FLAG_VAR | LEXER_FLAG_INITIALIZED;
+    lexer_construct_function_object (context_p, status_flags);
+    lexer_next_token (context_p);
+    return;
+  }
+
+  /* Clone the literal at the end. */
+  if (context_p->literal_count >= PARSER_MAXIMUM_NUMBER_OF_LITERALS)
+  {
+    parser_raise_error (context_p, PARSER_ERR_LITERAL_LIMIT_REACHED);
+  }
+
+  literal_p = (lexer_literal_t *) parser_list_append (context_p, &context_p->literal_pool);
+  *literal_p = *name_p;
+  no_reg_store = name_p->status_flags & (LEXER_FLAG_NO_REG_STORE | LEXER_FLAG_SOURCE_PTR);
+  literal_p->status_flags = LEXER_FLAG_VAR | LEXER_FLAG_INITIALIZED | no_reg_store;
+
+  name_p->type = LEXER_UNUSED_LITERAL;
+  name_p->status_flags &= LEXER_FLAG_FUNCTION_ARGUMENT | LEXER_FLAG_SOURCE_PTR;
+  /* Byte code references to this literal are
+   * redirected to the newly allocated literal. */
+  name_p->prop.index = context_p->literal_count;
+
+  context_p->literal_count++;
+
+  lexer_construct_function_object (context_p, status_flags);
+  lexer_next_token (context_p);
+} /* parser_parse_function_statement */
+
+/**
+ * Parse if statement (starting part).
+ */
+static void
+parser_parse_if_statement_start (parser_context_t *context_p) /**< context */
+{
+  parser_if_else_statement_t if_statement;
+
+  parser_parse_enclosed_expr (context_p);
+
+  parser_emit_cbc_forward_branch (context_p,
+                                  CBC_BRANCH_IF_FALSE_FORWARD,
+                                  &if_statement.branch);
+
+  parser_stack_push (context_p, &if_statement, sizeof (parser_if_else_statement_t));
+  parser_stack_push_uint8 (context_p, PARSER_STATEMENT_IF);
+  parser_stack_iterator_init (context_p, &context_p->last_statement);
+} /* parser_parse_if_statement_start */
+
+/**
+ * Parse if statement (ending part).
+ */
+static bool
+parser_parse_if_statement_end (parser_context_t *context_p) /**< context */
+{
+  parser_if_else_statement_t if_statement;
+  parser_if_else_statement_t else_statement;
+  parser_stack_iterator_t iterator;
+
+  JERRY_ASSERT (context_p->stack_top_uint8 == PARSER_STATEMENT_IF);
+
+  if (context_p->token.type != LEXER_KEYW_ELSE)
+  {
+    parser_stack_pop_uint8 (context_p);
+    parser_stack_pop (context_p, &if_statement, sizeof (parser_if_else_statement_t));
+    parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+    parser_set_branch_to_current_position (context_p, &if_statement.branch);
+
+    return false;
+  }
+
+  parser_stack_change_last_uint8 (context_p, PARSER_STATEMENT_ELSE);
+  parser_stack_iterator_init (context_p, &iterator);
+  parser_stack_iterator_skip (&iterator, 1);
+  parser_stack_iterator_read (&iterator, &if_statement, sizeof (parser_if_else_statement_t));
+
+  parser_emit_cbc_forward_branch (context_p,
+                                  CBC_JUMP_FORWARD,
+                                  &else_statement.branch);
+
+  parser_set_branch_to_current_position (context_p, &if_statement.branch);
+
+  parser_stack_iterator_write (&iterator, &else_statement, sizeof (parser_if_else_statement_t));
+
+  lexer_next_token (context_p);
+  return true;
+} /* parser_parse_if_statement_end */
+
+/**
+ * Parse with statement (starting part).
+ */
+static void
+parser_parse_with_statement_start (parser_context_t *context_p) /**< context */
+{
+  parser_with_statement_t with_statement;
+
+  if (context_p->status_flags & PARSER_IS_STRICT)
+  {
+    parser_raise_error (context_p, PARSER_ERR_WITH_NOT_ALLOWED);
+  }
+
+  parser_parse_enclosed_expr (context_p);
+
+#ifndef JERRY_NDEBUG
+  PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION);
+#endif /* !JERRY_NDEBUG */
+
+  context_p->status_flags |= PARSER_INSIDE_WITH | PARSER_LEXICAL_ENV_NEEDED;
+  parser_emit_cbc_ext_forward_branch (context_p,
+                                      CBC_EXT_WITH_CREATE_CONTEXT,
+                                      &with_statement.branch);
+
+  parser_stack_push (context_p, &with_statement, sizeof (parser_with_statement_t));
+  parser_stack_push_uint8 (context_p, PARSER_STATEMENT_WITH);
+  parser_stack_iterator_init (context_p, &context_p->last_statement);
+} /* parser_parse_with_statement_start */
+
+/**
+ * Parse with statement (ending part).
+ */
+static void
+parser_parse_with_statement_end (parser_context_t *context_p) /**< context */
+{
+  parser_with_statement_t with_statement;
+  parser_stack_iterator_t iterator;
+
+  JERRY_ASSERT (context_p->status_flags & PARSER_INSIDE_WITH);
+
+  parser_stack_pop_uint8 (context_p);
+  parser_stack_pop (context_p, &with_statement, sizeof (parser_with_statement_t));
+  parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+  parser_flush_cbc (context_p);
+  PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION);
+#ifndef JERRY_NDEBUG
+  PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION);
+#endif /* !JERRY_NDEBUG */
+
+  parser_emit_cbc (context_p, CBC_CONTEXT_END);
+  parser_set_branch_to_current_position (context_p, &with_statement.branch);
+
+  parser_stack_iterator_init (context_p, &iterator);
+
+  while (true)
+  {
+    uint8_t type = parser_stack_iterator_read_uint8 (&iterator);
+
+    if (type == PARSER_STATEMENT_START)
+    {
+      context_p->status_flags &= ~PARSER_INSIDE_WITH;
+      return;
+    }
+
+    if (type == PARSER_STATEMENT_WITH)
+    {
+      return;
+    }
+
+    parser_stack_iterator_skip (&iterator, parser_statement_length (type));
+  }
+} /* parser_parse_with_statement_end */
+
+/**
+ * Parse do-while statement (ending part).
+ */
+static void
+parser_parse_do_while_statement_end (parser_context_t *context_p) /**< context */
+{
+  parser_loop_statement_t loop;
+
+  JERRY_ASSERT (context_p->stack_top_uint8 == PARSER_STATEMENT_DO_WHILE);
+
+  if (context_p->token.type != LEXER_KEYW_WHILE)
+  {
+    parser_raise_error (context_p, PARSER_ERR_WHILE_EXPECTED);
+  }
+
+  parser_stack_iterator_t iterator;
+  parser_stack_iterator_init (context_p, &iterator);
+
+  parser_stack_iterator_skip (&iterator, 1);
+  parser_stack_iterator_read (&iterator, &loop, sizeof (parser_loop_statement_t));
+
+  parser_set_continues_to_current_position (context_p, loop.branch_list_p);
+
+  parser_parse_enclosed_expr (context_p);
+
+  if (context_p->last_cbc_opcode != CBC_PUSH_FALSE)
+  {
+    cbc_opcode_t opcode = CBC_BRANCH_IF_TRUE_BACKWARD;
+    if (context_p->last_cbc_opcode == CBC_LOGICAL_NOT)
+    {
+      context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      opcode = CBC_BRANCH_IF_FALSE_BACKWARD;
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_TRUE)
+    {
+      context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      opcode = CBC_JUMP_BACKWARD;
+    }
+
+    parser_do_while_statement_t do_while_statement;
+    parser_stack_iterator_skip (&iterator, sizeof (parser_loop_statement_t));
+    parser_stack_iterator_read (&iterator, &do_while_statement, sizeof (parser_do_while_statement_t));
+
+    parser_emit_cbc_backward_branch (context_p, opcode, do_while_statement.start_offset);
+  }
+  else
+  {
+    context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+  }
+
+  parser_stack_pop (context_p, NULL, 1 + sizeof (parser_loop_statement_t) + sizeof (parser_do_while_statement_t));
+  parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+  parser_set_breaks_to_current_position (context_p, loop.branch_list_p);
+} /* parser_parse_do_while_statement_end */
+
+/**
+ * Parse while statement (starting part).
+ */
+static void
+parser_parse_while_statement_start (parser_context_t *context_p) /**< context */
+{
+  parser_while_statement_t while_statement;
+  parser_loop_statement_t loop;
+
+  JERRY_ASSERT (context_p->token.type == LEXER_KEYW_WHILE);
+  lexer_next_token (context_p);
+
+  if (context_p->token.type != LEXER_LEFT_PAREN)
+  {
+    parser_raise_error (context_p, PARSER_ERR_LEFT_PAREN_EXPECTED);
+  }
+
+  parser_emit_cbc_forward_branch (context_p, CBC_JUMP_FORWARD, &while_statement.branch);
+
+  JERRY_ASSERT (context_p->last_cbc_opcode == PARSER_CBC_UNAVAILABLE);
+  while_statement.start_offset = context_p->byte_code_size;
+
+  /* The conditional part is processed at the end. */
+  parser_scan_until (context_p, &while_statement.condition_range, LEXER_RIGHT_PAREN);
+  lexer_next_token (context_p);
+
+  loop.branch_list_p = NULL;
+
+  parser_stack_push (context_p, &while_statement, sizeof (parser_while_statement_t));
+  parser_stack_push (context_p, &loop, sizeof (parser_loop_statement_t));
+  parser_stack_push_uint8 (context_p, PARSER_STATEMENT_WHILE);
+  parser_stack_iterator_init (context_p, &context_p->last_statement);
+} /* parser_parse_while_statement_start */
+
+/**
+ * Parse while statement (ending part).
+ */
+static void __attr_noinline___
+parser_parse_while_statement_end (parser_context_t *context_p) /**< context */
+{
+  parser_while_statement_t while_statement;
+  parser_loop_statement_t loop;
+  lexer_token_t current_token;
+  lexer_range_t range;
+  cbc_opcode_t opcode;
+
+  JERRY_ASSERT (context_p->stack_top_uint8 == PARSER_STATEMENT_WHILE);
+
+  parser_stack_iterator_t iterator;
+  parser_stack_iterator_init (context_p, &iterator);
+
+  parser_stack_iterator_skip (&iterator, 1);
+  parser_stack_iterator_read (&iterator, &loop, sizeof (parser_loop_statement_t));
+  parser_stack_iterator_skip (&iterator, sizeof (parser_loop_statement_t));
+  parser_stack_iterator_read (&iterator, &while_statement, sizeof (parser_while_statement_t));
+
+  parser_save_range (context_p, &range, context_p->source_end_p);
+  current_token = context_p->token;
+
+  parser_set_branch_to_current_position (context_p, &while_statement.branch);
+  parser_set_continues_to_current_position (context_p, loop.branch_list_p);
+
+  parser_set_range (context_p, &while_statement.condition_range);
+  lexer_next_token (context_p);
+
+  parser_parse_expression (context_p, PARSE_EXPR);
+  if (context_p->token.type != LEXER_EOS)
+  {
+    parser_raise_error (context_p, PARSER_ERR_INVALID_EXPRESSION);
+  }
+
+  opcode = CBC_BRANCH_IF_TRUE_BACKWARD;
+  if (context_p->last_cbc_opcode == CBC_LOGICAL_NOT)
+  {
+    context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+    opcode = CBC_BRANCH_IF_FALSE_BACKWARD;
+  }
+  else if (context_p->last_cbc_opcode == CBC_PUSH_TRUE)
+  {
+    context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+    opcode = CBC_JUMP_BACKWARD;
+  }
+
+  parser_stack_pop (context_p, NULL, 1 + sizeof (parser_loop_statement_t) + sizeof (parser_while_statement_t));
+  parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+  parser_emit_cbc_backward_branch (context_p, opcode, while_statement.start_offset);
+  parser_set_breaks_to_current_position (context_p, loop.branch_list_p);
+
+  parser_set_range (context_p, &range);
+  context_p->token = current_token;
+} /* parser_parse_while_statement_end */
+
+/**
+ * Parse for statement (starting part).
+ */
+static void
+parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
+{
+  parser_loop_statement_t loop;
+  lexer_range_t start_range;
+
+  JERRY_ASSERT (context_p->token.type == LEXER_KEYW_FOR);
+  lexer_next_token (context_p);
+
+  if (context_p->token.type != LEXER_LEFT_PAREN)
+  {
+    parser_raise_error (context_p, PARSER_ERR_LEFT_PAREN_EXPECTED);
+  }
+
+  parser_scan_until (context_p, &start_range, LEXER_KEYW_IN);
+
+  if (context_p->token.type == LEXER_KEYW_IN)
+  {
+    parser_for_in_statement_t for_in_statement;
+    lexer_range_t range;
+
+    lexer_next_token (context_p);
+    parser_parse_expression (context_p, PARSE_EXPR);
+
+    if (context_p->token.type != LEXER_RIGHT_PAREN)
+    {
+      parser_raise_error (context_p, PARSER_ERR_RIGHT_PAREN_EXPECTED);
+    }
+
+#ifndef JERRY_NDEBUG
+    PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION);
+#endif /* !JERRY_NDEBUG */
+
+    parser_emit_cbc_ext_forward_branch (context_p,
+                                        CBC_EXT_FOR_IN_CREATE_CONTEXT,
+                                        &for_in_statement.branch);
+
+    JERRY_ASSERT (context_p->last_cbc_opcode == PARSER_CBC_UNAVAILABLE);
+    for_in_statement.start_offset = context_p->byte_code_size;
+
+    parser_save_range (context_p, &range, context_p->source_end_p);
+    parser_set_range (context_p, &start_range);
+    lexer_next_token (context_p);
+
+    if (context_p->token.type == LEXER_KEYW_VAR)
+    {
+      uint16_t literal_index;
+
+      lexer_expect_identifier (context_p, LEXER_IDENT_LITERAL);
+      JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
+                    && context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
+
+      context_p->lit_object.literal_p->status_flags |= LEXER_FLAG_VAR;
+
+      literal_index = context_p->lit_object.index;
+
+      lexer_next_token (context_p);
+
+      if (context_p->token.type == LEXER_ASSIGN)
+      {
+        parser_branch_t branch;
+
+        /* Initialiser is never executed. */
+        parser_emit_cbc_forward_branch (context_p, CBC_JUMP_FORWARD, &branch);
+        lexer_next_token (context_p);
+        parser_parse_expression (context_p,
+                                 PARSE_EXPR_STATEMENT | PARSE_EXPR_NO_COMMA);
+        parser_set_branch_to_current_position (context_p, &branch);
+      }
+
+      parser_emit_cbc_ext (context_p, CBC_EXT_FOR_IN_GET_NEXT);
+      parser_emit_cbc_literal (context_p, CBC_ASSIGN_SET_IDENT, literal_index);
+    }
+    else
+    {
+      uint16_t opcode;
+
+      parser_parse_expression (context_p, PARSE_EXPR);
+
+      opcode = context_p->last_cbc_opcode;
+
+      /* The CBC_EXT_FOR_IN_CREATE_CONTEXT flushed the opcode combiner. */
+      JERRY_ASSERT (opcode != CBC_PUSH_TWO_LITERALS
+                    && opcode != CBC_PUSH_THREE_LITERALS);
+
+      if (opcode == CBC_PUSH_LITERAL
+          && context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL)
+      {
+        opcode = CBC_ASSIGN_SET_IDENT;
+        context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      }
+      else if (opcode == CBC_PUSH_PROP)
+      {
+        opcode = CBC_ASSIGN;
+        context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      }
+      else if (opcode == CBC_PUSH_PROP_LITERAL)
+      {
+        opcode = CBC_ASSIGN_PROP_LITERAL;
+        context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      }
+      else if (opcode == CBC_PUSH_PROP_LITERAL_LITERAL)
+      {
+        opcode = CBC_ASSIGN;
+        context_p->last_cbc_opcode = CBC_PUSH_TWO_LITERALS;
+      }
+      else if (opcode == CBC_PUSH_PROP_THIS_LITERAL)
+      {
+        opcode = CBC_ASSIGN;
+        context_p->last_cbc_opcode = CBC_PUSH_THIS_LITERAL;
+      }
+      else
+      {
+        /* Invalid LeftHandSide expression. */
+        parser_emit_cbc_ext (context_p, CBC_EXT_THROW_REFERENCE_ERROR);
+        opcode = CBC_ASSIGN;
+      }
+
+      parser_emit_cbc_ext (context_p, CBC_EXT_FOR_IN_GET_NEXT);
+      parser_flush_cbc (context_p);
+
+      context_p->last_cbc_opcode = opcode;
+    }
+
+    if (context_p->token.type != LEXER_EOS)
+    {
+      parser_raise_error (context_p, PARSER_ERR_IN_EXPECTED);
+    }
+
+    parser_flush_cbc (context_p);
+    parser_set_range (context_p, &range);
+    lexer_next_token (context_p);
+
+    loop.branch_list_p = NULL;
+
+    parser_stack_push (context_p, &for_in_statement, sizeof (parser_for_in_statement_t));
+    parser_stack_push (context_p, &loop, sizeof (parser_loop_statement_t));
+    parser_stack_push_uint8 (context_p, PARSER_STATEMENT_FOR_IN);
+    parser_stack_iterator_init (context_p, &context_p->last_statement);
+  }
+  else
+  {
+    parser_for_statement_t for_statement;
+
+    start_range.source_end_p = context_p->source_end_p;
+    parser_set_range (context_p, &start_range);
+    lexer_next_token (context_p);
+
+    if (context_p->token.type != LEXER_SEMICOLON)
+    {
+      if (context_p->token.type == LEXER_KEYW_VAR)
+      {
+        parser_parse_var_statement (context_p);
+      }
+      else
+      {
+        parser_parse_expression (context_p, PARSE_EXPR_STATEMENT);
+      }
+
+      if (context_p->token.type != LEXER_SEMICOLON)
+      {
+        parser_raise_error (context_p, PARSER_ERR_SEMICOLON_EXPECTED);
+      }
+    }
+
+    parser_emit_cbc_forward_branch (context_p, CBC_JUMP_FORWARD, &for_statement.branch);
+
+    JERRY_ASSERT (context_p->last_cbc_opcode == PARSER_CBC_UNAVAILABLE);
+    for_statement.start_offset = context_p->byte_code_size;
+
+    /* The conditional and expression parts are processed at the end. */
+    parser_scan_until (context_p, &for_statement.condition_range, LEXER_SEMICOLON);
+    parser_scan_until (context_p, &for_statement.expression_range, LEXER_RIGHT_PAREN);
+    lexer_next_token (context_p);
+
+    loop.branch_list_p = NULL;
+
+    parser_stack_push (context_p, &for_statement, sizeof (parser_for_statement_t));
+    parser_stack_push (context_p, &loop, sizeof (parser_loop_statement_t));
+    parser_stack_push_uint8 (context_p, PARSER_STATEMENT_FOR);
+    parser_stack_iterator_init (context_p, &context_p->last_statement);
+  }
+} /* parser_parse_for_statement_start */
+
+/**
+ * Parse for statement (ending part).
+ */
+static void __attr_noinline___
+parser_parse_for_statement_end (parser_context_t *context_p) /**< context */
+{
+  parser_for_statement_t for_statement;
+  parser_loop_statement_t loop;
+  lexer_token_t current_token;
+  lexer_range_t range;
+  cbc_opcode_t opcode;
+
+  JERRY_ASSERT (context_p->stack_top_uint8 == PARSER_STATEMENT_FOR);
+
+  parser_stack_iterator_t iterator;
+  parser_stack_iterator_init (context_p, &iterator);
+
+  parser_stack_iterator_skip (&iterator, 1);
+  parser_stack_iterator_read (&iterator, &loop, sizeof (parser_loop_statement_t));
+  parser_stack_iterator_skip (&iterator, sizeof (parser_loop_statement_t));
+  parser_stack_iterator_read (&iterator, &for_statement, sizeof (parser_for_statement_t));
+
+  parser_save_range (context_p, &range, context_p->source_end_p);
+  current_token = context_p->token;
+
+  parser_set_range (context_p, &for_statement.expression_range);
+  lexer_next_token (context_p);
+
+  parser_set_continues_to_current_position (context_p, loop.branch_list_p);
+
+  if (context_p->token.type != LEXER_EOS)
+  {
+    parser_parse_expression (context_p, PARSE_EXPR_STATEMENT);
+
+    if (context_p->token.type != LEXER_EOS)
+    {
+      parser_raise_error (context_p, PARSER_ERR_INVALID_EXPRESSION);
+    }
+  }
+
+  parser_set_branch_to_current_position (context_p, &for_statement.branch);
+
+  parser_set_range (context_p, &for_statement.condition_range);
+  lexer_next_token (context_p);
+
+  if (context_p->token.type != LEXER_EOS)
+  {
+    parser_parse_expression (context_p, PARSE_EXPR);
+
+    if (context_p->token.type != LEXER_EOS)
+    {
+      parser_raise_error (context_p, PARSER_ERR_INVALID_EXPRESSION);
+    }
+
+    opcode = CBC_BRANCH_IF_TRUE_BACKWARD;
+    if (context_p->last_cbc_opcode == CBC_LOGICAL_NOT)
+    {
+      context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      opcode = CBC_BRANCH_IF_FALSE_BACKWARD;
+    }
+    else if (context_p->last_cbc_opcode == CBC_PUSH_TRUE)
+    {
+      context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+      opcode = CBC_JUMP_BACKWARD;
+    }
+  }
+  else
+  {
+    opcode = CBC_JUMP_BACKWARD;
+  }
+
+  parser_stack_pop (context_p, NULL, 1 + sizeof (parser_loop_statement_t) + sizeof (parser_for_statement_t));
+  parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+  parser_emit_cbc_backward_branch (context_p, opcode, for_statement.start_offset);
+  parser_set_breaks_to_current_position (context_p, loop.branch_list_p);
+
+  parser_set_range (context_p, &range);
+  context_p->token = current_token;
+} /* parser_parse_for_statement_end */
+
+/**
+ * Parse switch statement (starting part).
+ */
+static void __attr_noinline___
+parser_parse_switch_statement_start (parser_context_t *context_p) /**< context */
+{
+  parser_switch_statement_t switch_statement;
+  parser_loop_statement_t loop;
+  parser_stack_iterator_t iterator;
+  lexer_range_t switch_body_start;
+  lexer_range_t unused_range;
+  bool switch_case_was_found;
+  bool default_case_was_found;
+  parser_branch_node_t *cases_p = NULL;
+
+  JERRY_ASSERT (context_p->token.type == LEXER_KEYW_SWITCH);
+
+  parser_parse_enclosed_expr (context_p);
+
+  if (context_p->token.type != LEXER_LEFT_BRACE)
+  {
+    parser_raise_error (context_p, PARSER_ERR_LEFT_BRACE_EXPECTED);
+  }
+
+  parser_save_range (context_p, &switch_body_start, context_p->source_end_p);
+  lexer_next_token (context_p);
+
+  if (context_p->token.type == LEXER_RIGHT_BRACE)
+  {
+    /* Unlikely case, but possible. */
+    parser_emit_cbc (context_p, CBC_POP);
+    parser_flush_cbc (context_p);
+    parser_stack_push_uint8 (context_p, PARSER_STATEMENT_BLOCK);
+    parser_stack_iterator_init (context_p, &context_p->last_statement);
+    return;
+  }
+
+  if (context_p->token.type != LEXER_KEYW_CASE
+      && context_p->token.type != LEXER_KEYW_DEFAULT)
+  {
+    parser_raise_error (context_p, PARSER_ERR_INVALID_SWITCH);
+  }
+
+  /* The reason of using an iterator is error management. If an error
+   * occures, parser_free_jumps() free all data. However, the branches
+   * created by parser_emit_cbc_forward_branch_item() would not be freed.
+   * To free these branches, the current switch data is always stored
+   * on the stack. If any change happens, this data is updated. Updates
+   * are done using the iterator. */
+
+  switch_statement.branch_list_p = NULL;
+  loop.branch_list_p = NULL;
+
+  parser_stack_push (context_p, &switch_statement, sizeof (parser_switch_statement_t));
+  parser_stack_iterator_init (context_p, &iterator);
+  parser_stack_push (context_p, &loop, sizeof (parser_loop_statement_t));
+  parser_stack_push_uint8 (context_p, PARSER_STATEMENT_SWITCH);
+  parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+  switch_case_was_found = false;
+  default_case_was_found = false;
+
+  while (true)
+  {
+    parser_scan_until (context_p, &unused_range, LEXER_KEYW_CASE);
+
+    if (context_p->token.type == LEXER_KEYW_DEFAULT)
+    {
+      if (default_case_was_found)
+      {
+        parser_raise_error (context_p, PARSER_ERR_MULTIPLE_DEFAULTS_NOT_ALLOWED);
+      }
+
+      lexer_next_token (context_p);
+      if (context_p->token.type != LEXER_COLON)
+      {
+        parser_raise_error (context_p, PARSER_ERR_COLON_EXPECTED);
+      }
+
+      default_case_was_found = true;
+    }
+    else if (context_p->token.type == LEXER_KEYW_CASE
+             || context_p->token.type == LEXER_RIGHT_BRACE)
+    {
+      if (switch_case_was_found)
+      {
+        parser_branch_node_t *new_case_p;
+        uint16_t opcode = CBC_BRANCH_IF_STRICT_EQUAL;
+
+        if (context_p->token.type != LEXER_KEYW_CASE)
+        {
+          /* We don't duplicate the value for the last case. */
+          parser_emit_cbc (context_p, CBC_STRICT_EQUAL);
+          opcode = CBC_BRANCH_IF_TRUE_FORWARD;
+        }
+        new_case_p = parser_emit_cbc_forward_branch_item (context_p, opcode, NULL);
+        if (cases_p == NULL)
+        {
+          switch_statement.branch_list_p = new_case_p;
+          parser_stack_iterator_write (&iterator, &switch_statement, sizeof (parser_switch_statement_t));
+        }
+        else
+        {
+          cases_p->next_p = new_case_p;
+        }
+        cases_p = new_case_p;
+      }
+
+      /* End of switch statement. */
+      if (context_p->token.type == LEXER_RIGHT_BRACE)
+      {
+        break;
+      }
+
+      lexer_next_token (context_p);
+
+      parser_parse_expression (context_p, PARSE_EXPR);
+
+      if (context_p->token.type != LEXER_COLON)
+      {
+        parser_raise_error (context_p, PARSER_ERR_COLON_EXPECTED);
+      }
+      switch_case_was_found = true;
+    }
+
+    lexer_next_token (context_p);
+  }
+
+  JERRY_ASSERT (switch_case_was_found || default_case_was_found);
+
+  if (!switch_case_was_found)
+  {
+    /* There was no case statement, so the expression result
+     * of the switch must be popped from the stack */
+    parser_emit_cbc (context_p, CBC_POP);
+  }
+
+  parser_emit_cbc_forward_branch (context_p, CBC_JUMP_FORWARD, &switch_statement.default_branch);
+  parser_stack_iterator_write (&iterator, &switch_statement, sizeof (parser_switch_statement_t));
+
+  if (!default_case_was_found)
+  {
+    parser_stack_change_last_uint8 (context_p, PARSER_STATEMENT_SWITCH_NO_DEFAULT);
+  }
+
+  parser_set_range (context_p, &switch_body_start);
+  lexer_next_token (context_p);
+} /* parser_parse_switch_statement_start */
+
+/**
+ * Parse try statement (ending part).
+ */
+static void
+parser_parse_try_statement_end (parser_context_t *context_p) /**< context */
+{
+  parser_try_statement_t try_statement;
+  parser_stack_iterator_t iterator;
+
+  JERRY_ASSERT (context_p->stack_top_uint8 == PARSER_STATEMENT_TRY);
+
+  parser_stack_iterator_init (context_p, &iterator);
+  parser_stack_iterator_skip (&iterator, 1);
+  parser_stack_iterator_read (&iterator, &try_statement, sizeof (parser_try_statement_t));
+
+  lexer_next_token (context_p);
+
+  if (try_statement.type == parser_finally_block)
+  {
+    parser_flush_cbc (context_p);
+    PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+#ifndef JERRY_NDEBUG
+    PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+#endif /* !JERRY_NDEBUG */
+
+    parser_emit_cbc (context_p, CBC_CONTEXT_END);
+    parser_set_branch_to_current_position (context_p, &try_statement.branch);
+  }
+  else
+  {
+    parser_set_branch_to_current_position (context_p, &try_statement.branch);
+
+    if (try_statement.type == parser_catch_block)
+    {
+      if (context_p->token.type != LEXER_KEYW_FINALLY)
+      {
+        parser_flush_cbc (context_p);
+        PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+#ifndef JERRY_NDEBUG
+        PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+#endif /* !JERRY_NDEBUG */
+
+        parser_emit_cbc (context_p, CBC_CONTEXT_END);
+        parser_flush_cbc (context_p);
+        try_statement.type = parser_finally_block;
+      }
+    }
+    else if (try_statement.type == parser_try_block)
+    {
+      if (context_p->token.type != LEXER_KEYW_CATCH
+          && context_p->token.type != LEXER_KEYW_FINALLY)
+      {
+        parser_raise_error (context_p, PARSER_ERR_CATCH_FINALLY_EXPECTED);
+      }
+    }
+  }
+
+  if (try_statement.type == parser_finally_block)
+  {
+    parser_stack_pop (context_p, NULL, (uint32_t) (sizeof (parser_try_statement_t) + 1));
+    parser_stack_iterator_init (context_p, &context_p->last_statement);
+    return;
+  }
+
+  if (context_p->token.type == LEXER_KEYW_CATCH)
+  {
+    uint16_t literal_index;
+
+    lexer_next_token (context_p);
+
+    if (context_p->token.type != LEXER_LEFT_PAREN)
+    {
+      parser_raise_error (context_p, PARSER_ERR_LEFT_PAREN_EXPECTED);
+    }
+
+    lexer_expect_identifier (context_p, LEXER_IDENT_LITERAL);
+    JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
+                  && context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
+
+    context_p->lit_object.literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE;
+    context_p->status_flags |= PARSER_LEXICAL_ENV_NEEDED;
+
+    literal_index = context_p->lit_object.index;
+
+    lexer_next_token (context_p);
+
+    if (context_p->token.type != LEXER_RIGHT_PAREN)
+    {
+      parser_raise_error (context_p, PARSER_ERR_RIGHT_PAREN_EXPECTED);
+    }
+
+    lexer_next_token (context_p);
+
+    if (context_p->token.type != LEXER_LEFT_BRACE)
+    {
+      parser_raise_error (context_p, PARSER_ERR_LEFT_BRACE_EXPECTED);
+    }
+
+    try_statement.type = parser_catch_block;
+    parser_emit_cbc_ext_forward_branch (context_p,
+                                        CBC_EXT_CATCH,
+                                        &try_statement.branch);
+
+    parser_emit_cbc_literal (context_p, CBC_ASSIGN_SET_IDENT, literal_index);
+    parser_flush_cbc (context_p);
+  }
+  else
+  {
+    JERRY_ASSERT (context_p->token.type == LEXER_KEYW_FINALLY);
+
+    lexer_next_token (context_p);
+
+    if (context_p->token.type != LEXER_LEFT_BRACE)
+    {
+      parser_raise_error (context_p, PARSER_ERR_LEFT_BRACE_EXPECTED);
+    }
+
+    try_statement.type = parser_finally_block;
+    parser_emit_cbc_ext_forward_branch (context_p,
+                                        CBC_EXT_FINALLY,
+                                        &try_statement.branch);
+  }
+
+  lexer_next_token (context_p);
+  parser_stack_iterator_write (&iterator, &try_statement, sizeof (parser_try_statement_t));
+} /* parser_parse_try_statement_end */
+
+/**
+ * Parse default statement.
+ */
+static void
+parser_parse_default_statement (parser_context_t *context_p) /**< context */
+{
+  parser_stack_iterator_t iterator;
+  parser_switch_statement_t switch_statement;
+
+  if (context_p->stack_top_uint8 != PARSER_STATEMENT_SWITCH
+      && context_p->stack_top_uint8 != PARSER_STATEMENT_SWITCH_NO_DEFAULT)
+  {
+    parser_raise_error (context_p, PARSER_ERR_DEFAULT_NOT_IN_SWITCH);
+  }
+
+  lexer_next_token (context_p);
+  /* Already checked in parser_parse_switch_statement_start. */
+  JERRY_ASSERT (context_p->token.type == LEXER_COLON);
+  lexer_next_token (context_p);
+
+  parser_stack_iterator_init (context_p, &iterator);
+  parser_stack_iterator_skip (&iterator, 1 + sizeof (parser_loop_statement_t));
+  parser_stack_iterator_read (&iterator, &switch_statement, sizeof (parser_switch_statement_t));
+
+  parser_set_branch_to_current_position (context_p, &switch_statement.default_branch);
+} /* parser_parse_default_statement */
+
+/**
+ * Parse case statement.
+ */
+static void
+parser_parse_case_statement (parser_context_t *context_p) /**< context */
+{
+  parser_stack_iterator_t iterator;
+  parser_switch_statement_t switch_statement;
+  lexer_range_t dummy_range;
+  parser_branch_node_t *branch_p;
+
+  if (context_p->stack_top_uint8 != PARSER_STATEMENT_SWITCH
+      && context_p->stack_top_uint8 != PARSER_STATEMENT_SWITCH_NO_DEFAULT)
+  {
+    parser_raise_error (context_p, PARSER_ERR_CASE_NOT_IN_SWITCH);
+  }
+
+  parser_scan_until (context_p, &dummy_range, LEXER_COLON);
+  lexer_next_token (context_p);
+
+  parser_stack_iterator_init (context_p, &iterator);
+  parser_stack_iterator_skip (&iterator, 1 + sizeof (parser_loop_statement_t));
+  parser_stack_iterator_read (&iterator, &switch_statement, sizeof (parser_switch_statement_t));
+
+  /* Free memory after the case statement is found. */
+
+  branch_p = switch_statement.branch_list_p;
+  JERRY_ASSERT (branch_p != NULL);
+  switch_statement.branch_list_p = branch_p->next_p;
+  parser_stack_iterator_write (&iterator, &switch_statement, sizeof (parser_switch_statement_t));
+
+  parser_set_branch_to_current_position (context_p, &branch_p->branch);
+  parser_free (branch_p, sizeof (parser_branch_node_t));
+} /* parser_parse_case_statement */
+
+/**
+ * Parse break statement.
+ */
+static void
+parser_parse_break_statement (parser_context_t *context_p) /**< context */
+{
+  parser_stack_iterator_t iterator;
+  cbc_opcode_t opcode = CBC_JUMP_FORWARD;
+
+  lexer_next_token (context_p);
+  parser_stack_iterator_init (context_p, &iterator);
+
+  if (!context_p->token.was_newline
+      && context_p->token.type == LEXER_LITERAL
+      && context_p->token.lit_location.type == LEXER_IDENT_LITERAL)
+  {
+    /* The label with the same name is searched on the stack. */
+    while (true)
+    {
+      uint8_t type = parser_stack_iterator_read_uint8 (&iterator);
+      if (type == PARSER_STATEMENT_START)
+      {
+        parser_raise_error (context_p, PARSER_ERR_INVALID_BREAK_LABEL);
+      }
+
+      if (type == PARSER_STATEMENT_FOR_IN
+          || type == PARSER_STATEMENT_WITH
+          || type == PARSER_STATEMENT_TRY)
+      {
+        opcode = CBC_JUMP_FORWARD_EXIT_CONTEXT;
+      }
+
+      if (type == PARSER_STATEMENT_LABEL)
+      {
+        parser_label_statement_t label_statement;
+
+        parser_stack_iterator_skip (&iterator, 1);
+        parser_stack_iterator_read (&iterator, &label_statement, sizeof (parser_label_statement_t));
+
+        if (lexer_compare_identifier_to_current (context_p, &label_statement.label_ident))
+        {
+          label_statement.break_list_p = parser_emit_cbc_forward_branch_item (context_p,
+                                                                              opcode,
+                                                                              label_statement.break_list_p);
+          parser_stack_iterator_write (&iterator, &label_statement, sizeof (parser_label_statement_t));
+          lexer_next_token (context_p);
+          return;
+        }
+        parser_stack_iterator_skip (&iterator, sizeof (parser_label_statement_t));
+      }
+      else
+      {
+        parser_stack_iterator_skip (&iterator, parser_statement_length (type));
+      }
+    }
+  }
+
+  /* The first switch or loop statement is searched. */
+  while (true)
+  {
+    uint8_t type = parser_stack_iterator_read_uint8 (&iterator);
+    if (type == PARSER_STATEMENT_START)
+    {
+      parser_raise_error (context_p, PARSER_ERR_INVALID_BREAK);
+    }
+
+    if (type == PARSER_STATEMENT_FOR_IN
+        || type == PARSER_STATEMENT_WITH
+        || type == PARSER_STATEMENT_TRY)
+    {
+      opcode = CBC_JUMP_FORWARD_EXIT_CONTEXT;
+    }
+
+    if (type == PARSER_STATEMENT_SWITCH
+        || type == PARSER_STATEMENT_SWITCH_NO_DEFAULT
+        || type == PARSER_STATEMENT_DO_WHILE
+        || type == PARSER_STATEMENT_WHILE
+        || type == PARSER_STATEMENT_FOR
+        || type == PARSER_STATEMENT_FOR_IN)
+    {
+      parser_loop_statement_t loop;
+
+      parser_stack_iterator_skip (&iterator, 1);
+      parser_stack_iterator_read (&iterator, &loop, sizeof (parser_loop_statement_t));
+      loop.branch_list_p = parser_emit_cbc_forward_branch_item (context_p,
+                                                                opcode,
+                                                                loop.branch_list_p);
+      parser_stack_iterator_write (&iterator, &loop, sizeof (parser_loop_statement_t));
+      return;
+    }
+
+    parser_stack_iterator_skip (&iterator, parser_statement_length (type));
+  }
+} /* parser_parse_break_statement */
+
+/**
+ * Parse continue statement.
+ */
+static void
+parser_parse_continue_statement (parser_context_t *context_p) /**< context */
+{
+  parser_stack_iterator_t iterator;
+  cbc_opcode_t opcode = CBC_JUMP_FORWARD;
+
+  lexer_next_token (context_p);
+  parser_stack_iterator_init (context_p, &iterator);
+
+  if (!context_p->token.was_newline
+      && context_p->token.type == LEXER_LITERAL
+      && context_p->token.lit_location.type == LEXER_IDENT_LITERAL)
+  {
+    parser_stack_iterator_t loop_iterator;
+    bool for_in_was_seen = false;
+
+    loop_iterator.current_p = NULL;
+
+    /* The label with the same name is searched on the stack. */
+    while (true)
+    {
+      uint8_t type = parser_stack_iterator_read_uint8 (&iterator);
+
+      if (type == PARSER_STATEMENT_START)
+      {
+        parser_raise_error (context_p, PARSER_ERR_INVALID_CONTINUE_LABEL);
+      }
+
+      /* Only those labels are checked, whose are label of a loop. */
+      if (loop_iterator.current_p != NULL && type == PARSER_STATEMENT_LABEL)
+      {
+        parser_label_statement_t label_statement;
+
+        parser_stack_iterator_skip (&iterator, 1);
+        parser_stack_iterator_read (&iterator, &label_statement, sizeof (parser_label_statement_t));
+
+        if (lexer_compare_identifier_to_current (context_p, &label_statement.label_ident))
+        {
+          parser_loop_statement_t loop;
+
+          parser_stack_iterator_skip (&loop_iterator, 1);
+          parser_stack_iterator_read (&loop_iterator, &loop, sizeof (parser_loop_statement_t));
+          loop.branch_list_p = parser_emit_cbc_forward_branch_item (context_p,
+                                                                    opcode,
+                                                                    loop.branch_list_p);
+          loop.branch_list_p->branch.offset |= CBC_HIGHEST_BIT_MASK;
+          parser_stack_iterator_write (&loop_iterator, &loop, sizeof (parser_loop_statement_t));
+          lexer_next_token (context_p);
+          return;
+        }
+        parser_stack_iterator_skip (&iterator, sizeof (parser_label_statement_t));
+        continue;
+      }
+
+      if (type == PARSER_STATEMENT_WITH
+          || type == PARSER_STATEMENT_TRY
+          || for_in_was_seen)
+      {
+        opcode = CBC_JUMP_FORWARD_EXIT_CONTEXT;
+      }
+      else if (type == PARSER_STATEMENT_FOR_IN)
+      {
+        for_in_was_seen = true;
+      }
+
+      if (type == PARSER_STATEMENT_DO_WHILE
+          || type == PARSER_STATEMENT_WHILE
+          || type == PARSER_STATEMENT_FOR
+          || type == PARSER_STATEMENT_FOR_IN)
+      {
+        loop_iterator = iterator;
+      }
+      else
+      {
+        loop_iterator.current_p = NULL;
+      }
+
+      parser_stack_iterator_skip (&iterator, parser_statement_length (type));
+    }
+  }
+
+  /* The first loop statement is searched. */
+  while (true)
+  {
+    uint8_t type = parser_stack_iterator_read_uint8 (&iterator);
+    if (type == PARSER_STATEMENT_START)
+    {
+      parser_raise_error (context_p, PARSER_ERR_INVALID_CONTINUE);
+    }
+
+    if (type == PARSER_STATEMENT_DO_WHILE
+        || type == PARSER_STATEMENT_WHILE
+        || type == PARSER_STATEMENT_FOR
+        || type == PARSER_STATEMENT_FOR_IN)
+    {
+      parser_loop_statement_t loop;
+
+      parser_stack_iterator_skip (&iterator, 1);
+      parser_stack_iterator_read (&iterator, &loop, sizeof (parser_loop_statement_t));
+      loop.branch_list_p = parser_emit_cbc_forward_branch_item (context_p,
+                                                                opcode,
+                                                                loop.branch_list_p);
+      loop.branch_list_p->branch.offset |= CBC_HIGHEST_BIT_MASK;
+      parser_stack_iterator_write (&iterator, &loop, sizeof (parser_loop_statement_t));
+      return;
+    }
+
+    if (type == PARSER_STATEMENT_WITH
+        || type == PARSER_STATEMENT_TRY)
+    {
+      opcode = CBC_JUMP_FORWARD_EXIT_CONTEXT;
+    }
+
+    parser_stack_iterator_skip (&iterator, parser_statement_length (type));
+  }
+} /* parser_parse_continue_statement */
+
+/**
+ * Parse label statement.
+ */
+static void
+parser_parse_label (parser_context_t *context_p, /**< context */
+                    lexer_lit_location_t *label_literal_p) /**< saved literal */
+{
+  parser_stack_iterator_t iterator;
+  parser_label_statement_t label_statement;
+
+  parser_stack_iterator_init (context_p, &iterator);
+
+  while (true)
+  {
+    uint8_t type = parser_stack_iterator_read_uint8 (&iterator);
+    if (type == PARSER_STATEMENT_START)
+    {
+      break;
+    }
+
+    if (type == PARSER_STATEMENT_LABEL)
+    {
+      parser_stack_iterator_skip (&iterator, 1);
+      parser_stack_iterator_read (&iterator, &label_statement, sizeof (parser_label_statement_t));
+      parser_stack_iterator_skip (&iterator, sizeof (parser_label_statement_t));
+
+      if (lexer_compare_identifier_to_current (context_p, &label_statement.label_ident))
+      {
+        parser_raise_error (context_p, PARSER_ERR_DUPLICATED_LABEL);
+      }
+    }
+    else
+    {
+      parser_stack_iterator_skip (&iterator, parser_statement_length (type));
+    }
+  }
+
+  label_statement.label_ident = *label_literal_p;
+  label_statement.break_list_p = NULL;
+  parser_stack_push (context_p, &label_statement, sizeof (parser_label_statement_t));
+  parser_stack_push_uint8 (context_p, PARSER_STATEMENT_LABEL);
+  parser_stack_iterator_init (context_p, &context_p->last_statement);
+} /* parser_parse_label */
+
+/**
+ * Parse statements.
+ */
+void
+parser_parse_statements (parser_context_t *context_p) /**< context */
+{
+  /* Statement parsing cannot be nested. */
+  JERRY_ASSERT (context_p->last_statement.current_p == NULL);
+  parser_stack_push_uint8 (context_p, PARSER_STATEMENT_START);
+  parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+#ifdef JERRY_DEBUGGER
+  /* Set lexical enviroment for the debugger. */
+  if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+  {
+    context_p->status_flags |= PARSER_LEXICAL_ENV_NEEDED;
+    context_p->last_breakpoint_line = 0;
+  }
+#endif /* JERRY_DEBUGGER */
+
+  while (context_p->token.type == LEXER_LITERAL
+         && context_p->token.lit_location.type == LEXER_STRING_LITERAL)
+  {
+    lexer_lit_location_t lit_location;
+    uint32_t status_flags = context_p->status_flags;
+#ifdef PARSER_DUMP_BYTE_CODE
+    bool switch_to_strict_mode = false;
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+    JERRY_ASSERT (context_p->stack_depth == 0);
+
+    lit_location = context_p->token.lit_location;
+
+    if (lit_location.length == PARSER_USE_STRICT_LENGTH
+        && !lit_location.has_escape
+        && memcmp (PARSER_USE_STRICT_LITERAL, lit_location.char_p, PARSER_USE_STRICT_LENGTH) == 0)
+    {
+      context_p->status_flags |= PARSER_IS_STRICT;
+
+#ifdef PARSER_DUMP_BYTE_CODE
+      switch_to_strict_mode = true;
+#endif /* PARSER_DUMP_BYTE_CODE */
+    }
+
+    lexer_next_token (context_p);
+
+    if (context_p->token.type != LEXER_SEMICOLON
+        && context_p->token.type != LEXER_RIGHT_BRACE)
+    {
+      if (!context_p->token.was_newline
+          || LEXER_IS_BINARY_OP_TOKEN (context_p->token.type)
+          || context_p->token.type == LEXER_LEFT_PAREN
+          || context_p->token.type == LEXER_LEFT_SQUARE
+          || context_p->token.type == LEXER_DOT)
+      {
+        /* The string is part of an expression statement. */
+        context_p->status_flags = status_flags;
+
+#ifdef JERRY_DEBUGGER
+        if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+        {
+          JERRY_ASSERT (context_p->last_breakpoint_line == 0);
+
+          parser_emit_cbc (context_p, CBC_BREAKPOINT_DISABLED);
+          parser_flush_cbc (context_p);
+
+          parser_append_breakpoint_info (context_p, JERRY_DEBUGGER_BREAKPOINT_LIST, context_p->token.line);
+
+          context_p->last_breakpoint_line = context_p->token.line;
+        }
+#endif /* JERRY_DEBUGGER */
+
+        lexer_construct_literal_object (context_p, &lit_location, LEXER_STRING_LITERAL);
+        parser_emit_cbc_literal_from_token (context_p, CBC_PUSH_LITERAL);
+        /* The extra_value is used for saving the token. */
+        context_p->token.extra_value = context_p->token.type;
+        context_p->token.type = LEXER_EXPRESSION_START;
+        break;
+      }
+    }
+
+#ifdef PARSER_DUMP_BYTE_CODE
+    if (context_p->is_show_opcodes
+        && switch_to_strict_mode)
+    {
+      JERRY_DEBUG_MSG ("  Note: switch to strict mode\n\n");
+    }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+    if (context_p->token.type == LEXER_SEMICOLON)
+    {
+      lexer_next_token (context_p);
+    }
+
+    /* The last directive prologue can be the result of the script. */
+    if (!(context_p->status_flags & PARSER_IS_FUNCTION))
+    {
+      if (context_p->token.type != LEXER_LITERAL
+          || context_p->token.lit_location.type != LEXER_STRING_LITERAL)
+      {
+        lexer_construct_literal_object (context_p, &lit_location, LEXER_STRING_LITERAL);
+        parser_emit_cbc_literal_from_token (context_p, CBC_PUSH_LITERAL);
+        parser_emit_cbc (context_p, CBC_POP_BLOCK);
+        parser_flush_cbc (context_p);
+      }
+    }
+  }
+
+  if (context_p->status_flags & PARSER_IS_STRICT
+      && context_p->status_flags & PARSER_HAS_NON_STRICT_ARG)
+  {
+    parser_raise_error (context_p, PARSER_ERR_NON_STRICT_ARG_DEFINITION);
+  }
+
+  while (context_p->token.type != LEXER_EOS
+         || context_p->stack_top_uint8 != PARSER_STATEMENT_START)
+  {
+#ifndef JERRY_NDEBUG
+    JERRY_ASSERT (context_p->stack_depth == context_p->context_stack_depth);
+#endif /* !JERRY_NDEBUG */
+
+#ifdef JERRY_DEBUGGER
+    if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED
+        && context_p->token.line != context_p->last_breakpoint_line
+        && context_p->token.type != LEXER_SEMICOLON
+        && context_p->token.type != LEXER_LEFT_BRACE
+        && context_p->token.type != LEXER_RIGHT_BRACE
+        && context_p->token.type != LEXER_KEYW_VAR
+        && context_p->token.type != LEXER_KEYW_FUNCTION
+        && context_p->token.type != LEXER_KEYW_CASE
+        && context_p->token.type != LEXER_KEYW_DEFAULT)
+    {
+      parser_emit_cbc (context_p, CBC_BREAKPOINT_DISABLED);
+      parser_flush_cbc (context_p);
+
+      parser_append_breakpoint_info (context_p, JERRY_DEBUGGER_BREAKPOINT_LIST, context_p->token.line);
+
+      context_p->last_breakpoint_line = context_p->token.line;
+    }
+#endif /* JERRY_DEBUGGER */
+
+    switch (context_p->token.type)
+    {
+      case LEXER_SEMICOLON:
+      {
+        break;
+      }
+
+      case LEXER_RIGHT_BRACE:
+      {
+        if (context_p->stack_top_uint8 == PARSER_STATEMENT_LABEL
+            || context_p->stack_top_uint8 == PARSER_STATEMENT_IF
+            || context_p->stack_top_uint8 == PARSER_STATEMENT_ELSE
+            || context_p->stack_top_uint8 == PARSER_STATEMENT_DO_WHILE
+            || context_p->stack_top_uint8 == PARSER_STATEMENT_WHILE
+            || context_p->stack_top_uint8 == PARSER_STATEMENT_FOR
+            || context_p->stack_top_uint8 == PARSER_STATEMENT_FOR_IN
+            || context_p->stack_top_uint8 == PARSER_STATEMENT_WITH)
+        {
+          parser_raise_error (context_p, PARSER_ERR_STATEMENT_EXPECTED);
+        }
+        break;
+      }
+
+      case LEXER_LEFT_BRACE:
+      {
+        parser_stack_push_uint8 (context_p, PARSER_STATEMENT_BLOCK);
+        parser_stack_iterator_init (context_p, &context_p->last_statement);
+        lexer_next_token (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_VAR:
+      {
+        parser_parse_var_statement (context_p);
+        break;
+      }
+
+      case LEXER_KEYW_FUNCTION:
+      {
+        parser_parse_function_statement (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_IF:
+      {
+        parser_parse_if_statement_start (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_SWITCH:
+      {
+        parser_parse_switch_statement_start (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_DO:
+      {
+        parser_do_while_statement_t do_while_statement;
+        parser_loop_statement_t loop;
+
+        JERRY_ASSERT (context_p->last_cbc_opcode == PARSER_CBC_UNAVAILABLE);
+
+        do_while_statement.start_offset = context_p->byte_code_size;
+        loop.branch_list_p = NULL;
+
+        parser_stack_push (context_p, &do_while_statement, sizeof (parser_do_while_statement_t));
+        parser_stack_push (context_p, &loop, sizeof (parser_loop_statement_t));
+        parser_stack_push_uint8 (context_p, PARSER_STATEMENT_DO_WHILE);
+        parser_stack_iterator_init (context_p, &context_p->last_statement);
+        lexer_next_token (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_WHILE:
+      {
+        parser_parse_while_statement_start (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_FOR:
+      {
+        parser_parse_for_statement_start (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_WITH:
+      {
+        parser_parse_with_statement_start (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_TRY:
+      {
+        parser_try_statement_t try_statement;
+
+        lexer_next_token (context_p);
+
+        if (context_p->token.type != LEXER_LEFT_BRACE)
+        {
+          parser_raise_error (context_p, PARSER_ERR_LEFT_BRACE_EXPECTED);
+        }
+
+#ifndef JERRY_NDEBUG
+        PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+#endif /* !JERRY_NDEBUG */
+
+        try_statement.type = parser_try_block;
+        parser_emit_cbc_ext_forward_branch (context_p,
+                                            CBC_EXT_TRY_CREATE_CONTEXT,
+                                            &try_statement.branch);
+
+        parser_stack_push (context_p, &try_statement, sizeof (parser_try_statement_t));
+        parser_stack_push_uint8 (context_p, PARSER_STATEMENT_TRY);
+        parser_stack_iterator_init (context_p, &context_p->last_statement);
+        lexer_next_token (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_DEFAULT:
+      {
+        parser_parse_default_statement (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_CASE:
+      {
+        parser_parse_case_statement (context_p);
+        continue;
+      }
+
+      case LEXER_KEYW_BREAK:
+      {
+        parser_parse_break_statement (context_p);
+        break;
+      }
+
+      case LEXER_KEYW_CONTINUE:
+      {
+        parser_parse_continue_statement (context_p);
+        break;
+      }
+
+      case LEXER_KEYW_THROW:
+      {
+        lexer_next_token (context_p);
+        if (context_p->token.was_newline)
+        {
+          parser_raise_error (context_p, PARSER_ERR_EXPRESSION_EXPECTED);
+        }
+        parser_parse_expression (context_p, PARSE_EXPR);
+        parser_emit_cbc (context_p, CBC_THROW);
+        break;
+      }
+
+      case LEXER_KEYW_RETURN:
+      {
+        if (!(context_p->status_flags & PARSER_IS_FUNCTION))
+        {
+          parser_raise_error (context_p, PARSER_ERR_INVALID_RETURN);
+        }
+
+        lexer_next_token (context_p);
+        if (context_p->token.was_newline
+            || context_p->token.type == LEXER_SEMICOLON
+            || context_p->token.type == LEXER_RIGHT_BRACE)
+        {
+          parser_emit_cbc (context_p, CBC_RETURN_WITH_BLOCK);
+          break;
+        }
+
+        parser_parse_expression (context_p, PARSE_EXPR);
+        if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL)
+        {
+          context_p->last_cbc_opcode = CBC_RETURN_WITH_LITERAL;
+        }
+        else
+        {
+          parser_emit_cbc (context_p, CBC_RETURN);
+        }
+        break;
+      }
+
+      case LEXER_KEYW_DEBUGGER:
+      {
+        parser_emit_cbc_ext (context_p, CBC_EXT_DEBUGGER);
+        lexer_next_token (context_p);
+        break;
+      }
+
+      case LEXER_LITERAL:
+      {
+        if (context_p->token.lit_location.type == LEXER_IDENT_LITERAL)
+        {
+          lexer_lit_location_t lit_location = context_p->token.lit_location;
+
+          lexer_next_token (context_p);
+
+          if (context_p->token.type == LEXER_COLON)
+          {
+            parser_parse_label (context_p, &lit_location);
+            lexer_next_token (context_p);
+            continue;
+          }
+
+          lexer_construct_literal_object (context_p, &lit_location, LEXER_IDENT_LITERAL);
+          parser_emit_cbc_literal_from_token (context_p, CBC_PUSH_LITERAL);
+          /* The extra_value is used for saving the token. */
+          context_p->token.extra_value = context_p->token.type;
+          context_p->token.type = LEXER_EXPRESSION_START;
+        }
+        /* FALLTHRU */
+      }
+
+      default:
+      {
+        int options = PARSE_EXPR_BLOCK;
+
+        if (context_p->status_flags & PARSER_IS_FUNCTION)
+        {
+          options = PARSE_EXPR_STATEMENT;
+        }
+
+        if (context_p->token.type == LEXER_EXPRESSION_START)
+        {
+          /* Restore the token type form the extra_value. */
+          context_p->token.type = context_p->token.extra_value;
+          options |= PARSE_EXPR_HAS_LITERAL;
+        }
+
+        parser_parse_expression (context_p, options);
+        break;
+      }
+    }
+
+    parser_flush_cbc (context_p);
+
+    if (context_p->token.type == LEXER_RIGHT_BRACE)
+    {
+      if (context_p->stack_top_uint8 == PARSER_STATEMENT_BLOCK)
+      {
+        parser_stack_pop_uint8 (context_p);
+        parser_stack_iterator_init (context_p, &context_p->last_statement);
+        lexer_next_token (context_p);
+      }
+      else if (context_p->stack_top_uint8 == PARSER_STATEMENT_SWITCH
+               || context_p->stack_top_uint8 == PARSER_STATEMENT_SWITCH_NO_DEFAULT)
+      {
+        int has_default = (context_p->stack_top_uint8 == PARSER_STATEMENT_SWITCH);
+        parser_loop_statement_t loop;
+        parser_switch_statement_t switch_statement;
+
+        parser_stack_pop_uint8 (context_p);
+        parser_stack_pop (context_p, &loop, sizeof (parser_loop_statement_t));
+        parser_stack_pop (context_p, &switch_statement, sizeof (parser_switch_statement_t));
+        parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+        JERRY_ASSERT (switch_statement.branch_list_p == NULL);
+
+        if (!has_default)
+        {
+          parser_set_branch_to_current_position (context_p, &switch_statement.default_branch);
+        }
+
+        parser_set_breaks_to_current_position (context_p, loop.branch_list_p);
+        lexer_next_token (context_p);
+      }
+      else if (context_p->stack_top_uint8 == PARSER_STATEMENT_TRY)
+      {
+        parser_parse_try_statement_end (context_p);
+      }
+      else if (context_p->stack_top_uint8 == PARSER_STATEMENT_START)
+      {
+        if (context_p->status_flags & PARSER_IS_CLOSURE)
+        {
+          parser_stack_pop_uint8 (context_p);
+          context_p->last_statement.current_p = NULL;
+          JERRY_ASSERT (context_p->stack_depth == 0);
+#ifndef JERRY_NDEBUG
+          JERRY_ASSERT (context_p->context_stack_depth == 0);
+#endif /* !JERRY_NDEBUG */
+          /* There is no lexer_next_token here, since the
+           * next token belongs to the parent context. */
+          return;
+        }
+        parser_raise_error (context_p, PARSER_ERR_INVALID_RIGHT_SQUARE);
+      }
+    }
+    else if (context_p->token.type == LEXER_SEMICOLON)
+    {
+      lexer_next_token (context_p);
+    }
+    else if (context_p->token.type != LEXER_EOS
+             && !context_p->token.was_newline)
+    {
+      parser_raise_error (context_p, PARSER_ERR_SEMICOLON_EXPECTED);
+    }
+
+    while (true)
+    {
+      switch (context_p->stack_top_uint8)
+      {
+        case PARSER_STATEMENT_LABEL:
+        {
+          parser_label_statement_t label;
+
+          parser_stack_pop_uint8 (context_p);
+          parser_stack_pop (context_p, &label, sizeof (parser_label_statement_t));
+          parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+          parser_set_breaks_to_current_position (context_p, label.break_list_p);
+          continue;
+        }
+
+        case PARSER_STATEMENT_IF:
+        {
+          if (parser_parse_if_statement_end (context_p))
+          {
+            break;
+          }
+          continue;
+        }
+
+        case PARSER_STATEMENT_ELSE:
+        {
+          parser_if_else_statement_t else_statement;
+
+          parser_stack_pop_uint8 (context_p);
+          parser_stack_pop (context_p, &else_statement, sizeof (parser_if_else_statement_t));
+          parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+          parser_set_branch_to_current_position (context_p, &else_statement.branch);
+          continue;
+        }
+
+        case PARSER_STATEMENT_DO_WHILE:
+        {
+          parser_parse_do_while_statement_end (context_p);
+          if (context_p->token.type == LEXER_SEMICOLON)
+          {
+            lexer_next_token (context_p);
+          }
+          continue;
+        }
+
+        case PARSER_STATEMENT_WHILE:
+        {
+          parser_parse_while_statement_end (context_p);
+          continue;
+        }
+
+        case PARSER_STATEMENT_FOR:
+        {
+          parser_parse_for_statement_end (context_p);
+          continue;
+        }
+
+        case PARSER_STATEMENT_FOR_IN:
+        {
+          parser_for_in_statement_t for_in_statement;
+          parser_loop_statement_t loop;
+
+          parser_stack_pop_uint8 (context_p);
+          parser_stack_pop (context_p, &loop, sizeof (parser_loop_statement_t));
+          parser_stack_pop (context_p, &for_in_statement, sizeof (parser_for_in_statement_t));
+          parser_stack_iterator_init (context_p, &context_p->last_statement);
+
+          parser_set_continues_to_current_position (context_p, loop.branch_list_p);
+
+          parser_flush_cbc (context_p);
+          PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION);
+#ifndef JERRY_NDEBUG
+          PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION);
+#endif /* !JERRY_NDEBUG */
+
+          parser_emit_cbc_ext_backward_branch (context_p,
+                                               CBC_EXT_BRANCH_IF_FOR_IN_HAS_NEXT,
+                                               for_in_statement.start_offset);
+
+          parser_set_breaks_to_current_position (context_p, loop.branch_list_p);
+          parser_set_branch_to_current_position (context_p, &for_in_statement.branch);
+          continue;
+        }
+
+        case PARSER_STATEMENT_WITH:
+        {
+          parser_parse_with_statement_end (context_p);
+          continue;
+        }
+
+        default:
+        {
+          break;
+        }
+      }
+      break;
+    }
+  }
+
+  JERRY_ASSERT (context_p->stack_depth == 0);
+#ifndef JERRY_NDEBUG
+  JERRY_ASSERT (context_p->context_stack_depth == 0);
+#endif /* !JERRY_NDEBUG */
+
+  parser_stack_pop_uint8 (context_p);
+  context_p->last_statement.current_p = NULL;
+
+  if (context_p->status_flags & PARSER_IS_CLOSURE)
+  {
+    parser_raise_error (context_p, PARSER_ERR_STATEMENT_EXPECTED);
+  }
+} /* parser_parse_statements */
+
+/**
+ * Free jumps stored on the stack if a parse error is occured.
+ */
+void __attr_noinline___
+parser_free_jumps (parser_stack_iterator_t iterator) /**< iterator position */
+{
+  while (true)
+  {
+    uint8_t type = parser_stack_iterator_read_uint8 (&iterator);
+    parser_branch_node_t *branch_list_p = NULL;
+
+    switch (type)
+    {
+      case PARSER_STATEMENT_START:
+      {
+        return;
+      }
+
+      case PARSER_STATEMENT_LABEL:
+      {
+        parser_label_statement_t label;
+
+        parser_stack_iterator_skip (&iterator, 1);
+        parser_stack_iterator_read (&iterator, &label, sizeof (parser_label_statement_t));
+        parser_stack_iterator_skip (&iterator, sizeof (parser_label_statement_t));
+        branch_list_p = label.break_list_p;
+        break;
+      }
+
+      case PARSER_STATEMENT_SWITCH:
+      case PARSER_STATEMENT_SWITCH_NO_DEFAULT:
+      {
+        parser_switch_statement_t switch_statement;
+        parser_loop_statement_t loop;
+
+        parser_stack_iterator_skip (&iterator, 1);
+        parser_stack_iterator_read (&iterator, &loop, sizeof (parser_loop_statement_t));
+        parser_stack_iterator_skip (&iterator, sizeof (parser_loop_statement_t));
+        parser_stack_iterator_read (&iterator, &switch_statement, sizeof (parser_switch_statement_t));
+        parser_stack_iterator_skip (&iterator, sizeof (parser_switch_statement_t));
+
+        branch_list_p = switch_statement.branch_list_p;
+        while (branch_list_p != NULL)
+        {
+          parser_branch_node_t *next_p = branch_list_p->next_p;
+          parser_free (branch_list_p, sizeof (parser_branch_node_t));
+          branch_list_p = next_p;
+        }
+        branch_list_p = loop.branch_list_p;
+        break;
+      }
+
+      case PARSER_STATEMENT_DO_WHILE:
+      case PARSER_STATEMENT_WHILE:
+      case PARSER_STATEMENT_FOR:
+      case PARSER_STATEMENT_FOR_IN:
+      {
+        parser_loop_statement_t loop;
+
+        parser_stack_iterator_skip (&iterator, 1);
+        parser_stack_iterator_read (&iterator, &loop, sizeof (parser_loop_statement_t));
+        parser_stack_iterator_skip (&iterator, parser_statement_length (type) - 1);
+        branch_list_p = loop.branch_list_p;
+        break;
+      }
+
+      default:
+      {
+        parser_stack_iterator_skip (&iterator, parser_statement_length (type));
+        continue;
+      }
+    }
+
+    while (branch_list_p != NULL)
+    {
+      parser_branch_node_t *next_p = branch_list_p->next_p;
+      parser_free (branch_list_p, sizeof (parser_branch_node_t));
+      branch_list_p = next_p;
+    }
+  }
+} /* parser_free_jumps */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* JERRY_JS_PARSER */
diff --git a/deps/jerry/jerry-core/parser/js/js-parser-util.c b/deps/jerry/jerry-core/parser/js/js-parser-util.c
new file mode 100644 (file)
index 0000000..7a298f1
--- /dev/null
@@ -0,0 +1,950 @@
+/* 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.
+ */
+
+#include "js-parser-internal.h"
+
+#if JERRY_JS_PARSER
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_utils Utility
+ * @{
+ */
+
+/**********************************************************************/
+/* Emitting byte codes                                                */
+/**********************************************************************/
+
+/**
+ * Append two bytes to the cbc stream.
+ */
+static void
+parser_emit_two_bytes (parser_context_t *context_p, /**< context */
+                       uint8_t first_byte, /**< first byte */
+                       uint8_t second_byte) /**< second byte */
+{
+  uint32_t last_position = context_p->byte_code.last_position;
+
+  if (last_position + 2 <= PARSER_CBC_STREAM_PAGE_SIZE)
+  {
+    parser_mem_page_t *page_p = context_p->byte_code.last_p;
+
+    page_p->bytes[last_position] = first_byte;
+    page_p->bytes[last_position + 1] = second_byte;
+    context_p->byte_code.last_position = last_position + 2;
+  }
+  else if (last_position >= PARSER_CBC_STREAM_PAGE_SIZE)
+  {
+    parser_mem_page_t *page_p;
+
+    parser_cbc_stream_alloc_page (context_p, &context_p->byte_code);
+    page_p = context_p->byte_code.last_p;
+    page_p->bytes[0] = first_byte;
+    page_p->bytes[1] = second_byte;
+    context_p->byte_code.last_position = 2;
+  }
+  else
+  {
+    context_p->byte_code.last_p->bytes[PARSER_CBC_STREAM_PAGE_SIZE - 1] = first_byte;
+    parser_cbc_stream_alloc_page (context_p, &context_p->byte_code);
+    context_p->byte_code.last_p->bytes[0] = second_byte;
+    context_p->byte_code.last_position = 1;
+  }
+} /* parser_emit_two_bytes */
+
+#define PARSER_APPEND_TO_BYTE_CODE(context_p, byte) \
+  if ((context_p)->byte_code.last_position >= PARSER_CBC_STREAM_PAGE_SIZE) \
+  { \
+    parser_cbc_stream_alloc_page ((context_p), &(context_p)->byte_code); \
+  } \
+  (context_p)->byte_code.last_p->bytes[(context_p)->byte_code.last_position++] = (uint8_t) (byte)
+
+/**
+ * Append the current byte code to the stream
+ */
+void
+parser_flush_cbc (parser_context_t *context_p) /**< context */
+{
+  uint8_t flags;
+
+  if (context_p->last_cbc_opcode == PARSER_CBC_UNAVAILABLE)
+  {
+    return;
+  }
+
+  context_p->status_flags |= PARSER_NO_END_LABEL;
+
+  if (PARSER_IS_BASIC_OPCODE (context_p->last_cbc_opcode))
+  {
+    cbc_opcode_t opcode = (cbc_opcode_t) context_p->last_cbc_opcode;
+
+    JERRY_ASSERT (opcode < CBC_END);
+    flags = cbc_flags[opcode];
+
+    PARSER_APPEND_TO_BYTE_CODE (context_p, opcode);
+    context_p->byte_code_size++;
+  }
+  else
+  {
+    cbc_ext_opcode_t opcode = (cbc_ext_opcode_t) PARSER_GET_EXT_OPCODE (context_p->last_cbc_opcode);
+
+    JERRY_ASSERT (opcode < CBC_EXT_END);
+    flags = cbc_ext_flags[opcode];
+    parser_emit_two_bytes (context_p, CBC_EXT_OPCODE, opcode);
+    context_p->byte_code_size += 2;
+  }
+
+  JERRY_ASSERT ((flags >> CBC_STACK_ADJUST_SHIFT) >= CBC_STACK_ADJUST_BASE
+                 || (CBC_STACK_ADJUST_BASE - (flags >> CBC_STACK_ADJUST_SHIFT)) <= context_p->stack_depth);
+  PARSER_PLUS_EQUAL_U16 (context_p->stack_depth, CBC_STACK_ADJUST_VALUE (flags));
+
+  if (flags & (CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2))
+  {
+    uint16_t literal_index = context_p->last_cbc.literal_index;
+
+    parser_emit_two_bytes (context_p,
+                           (uint8_t) (literal_index & 0xff),
+                           (uint8_t) (literal_index >> 8));
+    context_p->byte_code_size += 2;
+  }
+
+  if (flags & CBC_HAS_LITERAL_ARG2)
+  {
+    uint16_t literal_index = context_p->last_cbc.value;
+
+    parser_emit_two_bytes (context_p,
+                           (uint8_t) (literal_index & 0xff),
+                           (uint8_t) (literal_index >> 8));
+    context_p->byte_code_size += 2;
+
+    if (!(flags & CBC_HAS_LITERAL_ARG))
+    {
+      literal_index = context_p->last_cbc.third_literal_index;
+
+      parser_emit_two_bytes (context_p,
+                             (uint8_t) (literal_index & 0xff),
+                             (uint8_t) (literal_index >> 8));
+      context_p->byte_code_size += 2;
+    }
+  }
+
+  if (flags & CBC_HAS_BYTE_ARG)
+  {
+    uint8_t byte_argument = (uint8_t) context_p->last_cbc.value;
+
+    JERRY_ASSERT (context_p->last_cbc.value <= CBC_MAXIMUM_BYTE_VALUE);
+
+    if (flags & CBC_POP_STACK_BYTE_ARG)
+    {
+      JERRY_ASSERT (context_p->stack_depth >= byte_argument);
+      PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, byte_argument);
+    }
+
+    PARSER_APPEND_TO_BYTE_CODE (context_p, byte_argument);
+    context_p->byte_code_size++;
+  }
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  if (context_p->is_show_opcodes)
+  {
+    const char *name_p;
+
+    if (PARSER_IS_BASIC_OPCODE (context_p->last_cbc_opcode))
+    {
+      name_p = cbc_names[context_p->last_cbc_opcode];
+    }
+    else
+    {
+      name_p = cbc_ext_names[PARSER_GET_EXT_OPCODE (context_p->last_cbc_opcode)];
+    }
+
+    JERRY_DEBUG_MSG ("  [%3d] %s", (int) context_p->stack_depth, name_p);
+
+    if (flags & (CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2))
+    {
+      uint16_t literal_index = context_p->last_cbc.literal_index;
+      lexer_literal_t *literal_p = PARSER_GET_LITERAL (literal_index);
+      JERRY_DEBUG_MSG (" idx:%d->", literal_index);
+      util_print_literal (literal_p);
+    }
+
+    if (flags & CBC_HAS_LITERAL_ARG2)
+    {
+      uint16_t literal_index = context_p->last_cbc.value;
+      lexer_literal_t *literal_p = PARSER_GET_LITERAL (literal_index);
+      JERRY_DEBUG_MSG (" idx:%d->", literal_index);
+      util_print_literal (literal_p);
+
+      if (!(flags & CBC_HAS_LITERAL_ARG))
+      {
+        literal_index = context_p->last_cbc.third_literal_index;
+
+        literal_p = PARSER_GET_LITERAL (literal_index);
+        JERRY_DEBUG_MSG (" idx:%d->", literal_index);
+        util_print_literal (literal_p);
+      }
+    }
+
+    if (flags & CBC_HAS_BYTE_ARG)
+    {
+      JERRY_DEBUG_MSG (" byte_arg:%d", (int) context_p->last_cbc.value);
+    }
+
+    JERRY_DEBUG_MSG ("\n");
+  }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+  if (context_p->stack_depth > context_p->stack_limit)
+  {
+    context_p->stack_limit = context_p->stack_depth;
+    if (context_p->stack_limit > PARSER_MAXIMUM_STACK_LIMIT)
+    {
+      parser_raise_error (context_p, PARSER_ERR_STACK_LIMIT_REACHED);
+    }
+  }
+
+  context_p->last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+} /* parser_flush_cbc */
+
+/**
+ * Append a byte code
+ */
+void
+parser_emit_cbc (parser_context_t *context_p, /**< context */
+                 uint16_t opcode) /**< opcode */
+{
+  JERRY_ASSERT (PARSER_ARGS_EQ (opcode, 0));
+
+  if (context_p->last_cbc_opcode != PARSER_CBC_UNAVAILABLE)
+  {
+    parser_flush_cbc (context_p);
+  }
+
+  context_p->last_cbc_opcode = opcode;
+} /* parser_emit_cbc */
+
+/**
+ * Append a byte code with a literal argument
+ */
+void
+parser_emit_cbc_literal (parser_context_t *context_p, /**< context */
+                         uint16_t opcode, /**< opcode */
+                         uint16_t literal_index) /**< literal index */
+{
+  JERRY_ASSERT (PARSER_ARGS_EQ (opcode, CBC_HAS_LITERAL_ARG));
+
+  if (context_p->last_cbc_opcode != PARSER_CBC_UNAVAILABLE)
+  {
+    parser_flush_cbc (context_p);
+  }
+
+  context_p->last_cbc_opcode = opcode;
+  context_p->last_cbc.literal_index = literal_index;
+  context_p->last_cbc.literal_type = LEXER_UNUSED_LITERAL;
+  context_p->last_cbc.literal_object_type = LEXER_LITERAL_OBJECT_ANY;
+} /* parser_emit_cbc_literal */
+
+/**
+ * Append a byte code with the current literal argument
+ */
+void
+parser_emit_cbc_literal_from_token (parser_context_t *context_p, /**< context */
+                                    uint16_t opcode) /**< opcode */
+{
+  JERRY_ASSERT (PARSER_ARGS_EQ (opcode, CBC_HAS_LITERAL_ARG));
+
+  if (context_p->last_cbc_opcode != PARSER_CBC_UNAVAILABLE)
+  {
+    parser_flush_cbc (context_p);
+  }
+
+  context_p->last_cbc_opcode = opcode;
+  context_p->last_cbc.literal_index = context_p->lit_object.index;
+  context_p->last_cbc.literal_type = context_p->token.lit_location.type;
+  context_p->last_cbc.literal_object_type = context_p->lit_object.type;
+} /* parser_emit_cbc_literal_from_token */
+
+/**
+ * Append a byte code with a call argument
+ */
+void
+parser_emit_cbc_call (parser_context_t *context_p, /**< context */
+                      uint16_t opcode, /**< opcode */
+                      size_t call_arguments) /**< number of arguments */
+{
+  JERRY_ASSERT (PARSER_ARGS_EQ (opcode, CBC_HAS_BYTE_ARG));
+  JERRY_ASSERT (call_arguments <= CBC_MAXIMUM_BYTE_VALUE);
+
+  if (context_p->last_cbc_opcode != PARSER_CBC_UNAVAILABLE)
+  {
+    parser_flush_cbc (context_p);
+  }
+
+  context_p->last_cbc_opcode = opcode;
+  context_p->last_cbc.value = (uint16_t) call_arguments;
+} /* parser_emit_cbc_call */
+
+/**
+ * Append a push number 1/2 byte code
+ */
+void
+parser_emit_cbc_push_number (parser_context_t *context_p, /**< context */
+                             bool is_negative_number) /**< sign is negative */
+{
+  uint16_t value = context_p->lit_object.index;
+
+  if (context_p->last_cbc_opcode != PARSER_CBC_UNAVAILABLE)
+  {
+    parser_flush_cbc (context_p);
+  }
+
+  cbc_opcode_t opcode = is_negative_number ? CBC_PUSH_NUMBER_NEG_BYTE : CBC_PUSH_NUMBER_POS_BYTE;
+
+  JERRY_ASSERT (value > 0 && value <= CBC_PUSH_NUMBER_BYTE_RANGE_END);
+  JERRY_ASSERT (CBC_STACK_ADJUST_VALUE (cbc_flags[opcode]) == 1);
+
+  context_p->stack_depth++;
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  if (context_p->is_show_opcodes)
+  {
+    int real_value = value;
+
+    if (is_negative_number)
+    {
+      real_value = -real_value;
+    }
+
+    JERRY_DEBUG_MSG ("  [%3d] %s number:%d\n",
+                     (int) context_p->stack_depth,
+                     cbc_names[opcode],
+                     real_value);
+  }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+  parser_emit_two_bytes (context_p, opcode, (uint8_t) (value - 1));
+
+  context_p->byte_code_size += 2;
+
+  if (context_p->stack_depth > context_p->stack_limit)
+  {
+    context_p->stack_limit = context_p->stack_depth;
+    if (context_p->stack_limit > PARSER_MAXIMUM_STACK_LIMIT)
+    {
+      parser_raise_error (context_p, PARSER_ERR_STACK_LIMIT_REACHED);
+    }
+  }
+} /* parser_emit_cbc_push_number */
+
+/**
+ * Append a byte code with a branch argument
+ */
+void
+parser_emit_cbc_forward_branch (parser_context_t *context_p, /**< context */
+                                uint16_t opcode, /**< opcode */
+                                parser_branch_t *branch_p) /**< branch result */
+{
+  uint8_t flags;
+  uint32_t extra_byte_code_increase;
+
+  if (context_p->last_cbc_opcode != PARSER_CBC_UNAVAILABLE)
+  {
+    parser_flush_cbc (context_p);
+  }
+
+  context_p->status_flags |= PARSER_NO_END_LABEL;
+
+  if (PARSER_IS_BASIC_OPCODE (opcode))
+  {
+    JERRY_ASSERT (opcode < CBC_END);
+    flags = cbc_flags[opcode];
+    extra_byte_code_increase = 0;
+  }
+  else
+  {
+    PARSER_APPEND_TO_BYTE_CODE (context_p, CBC_EXT_OPCODE);
+    opcode = (uint16_t) PARSER_GET_EXT_OPCODE (opcode);
+
+    JERRY_ASSERT (opcode < CBC_EXT_END);
+    flags = cbc_ext_flags[opcode];
+    extra_byte_code_increase = 1;
+  }
+
+  JERRY_ASSERT (flags & CBC_HAS_BRANCH_ARG);
+  JERRY_ASSERT (CBC_BRANCH_IS_FORWARD (flags));
+  JERRY_ASSERT (CBC_BRANCH_OFFSET_LENGTH (opcode) == 1);
+
+  /* Branch opcodes never push anything onto the stack. */
+  JERRY_ASSERT ((flags >> CBC_STACK_ADJUST_SHIFT) >= CBC_STACK_ADJUST_BASE
+                 || (CBC_STACK_ADJUST_BASE - (flags >> CBC_STACK_ADJUST_SHIFT)) <= context_p->stack_depth);
+  PARSER_PLUS_EQUAL_U16 (context_p->stack_depth, CBC_STACK_ADJUST_VALUE (flags));
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  if (context_p->is_show_opcodes)
+  {
+    if (extra_byte_code_increase == 0)
+    {
+      JERRY_DEBUG_MSG ("  [%3d] %s\n", (int) context_p->stack_depth, cbc_names[opcode]);
+    }
+    else
+    {
+      JERRY_DEBUG_MSG ("  [%3d] %s\n", (int) context_p->stack_depth, cbc_ext_names[opcode]);
+    }
+  }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+#if PARSER_MAXIMUM_CODE_SIZE <= 65535
+  opcode++;
+#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
+  PARSER_PLUS_EQUAL_U16 (opcode, 2);
+#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
+
+  parser_emit_two_bytes (context_p, (uint8_t) opcode, 0);
+  branch_p->page_p = context_p->byte_code.last_p;
+  branch_p->offset = (context_p->byte_code.last_position - 1) | (context_p->byte_code_size << 8);
+
+  context_p->byte_code_size += extra_byte_code_increase;
+
+#if PARSER_MAXIMUM_CODE_SIZE <= 65535
+  PARSER_APPEND_TO_BYTE_CODE (context_p, 0);
+  context_p->byte_code_size += 3;
+#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
+  parser_emit_two_bytes (context_p, 0, 0);
+  context_p->byte_code_size += 4;
+#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
+
+  if (context_p->stack_depth > context_p->stack_limit)
+  {
+    context_p->stack_limit = context_p->stack_depth;
+    if (context_p->stack_limit > PARSER_MAXIMUM_STACK_LIMIT)
+    {
+      parser_raise_error (context_p, PARSER_ERR_STACK_LIMIT_REACHED);
+    }
+  }
+} /* parser_emit_cbc_forward_branch */
+
+/**
+ * Append a branch byte code and create an item
+ */
+parser_branch_node_t *
+parser_emit_cbc_forward_branch_item (parser_context_t *context_p, /**< context */
+                                     uint16_t opcode, /**< opcode */
+                                     parser_branch_node_t *next_p) /**< next branch */
+{
+  parser_branch_t branch;
+  parser_branch_node_t *new_item;
+
+  /* Since byte code insertion may throw an out-of-memory error,
+   * the branch is constructed locally, and copied later. */
+  parser_emit_cbc_forward_branch (context_p, opcode, &branch);
+
+  new_item = (parser_branch_node_t *) parser_malloc (context_p, sizeof (parser_branch_node_t));
+  new_item->branch = branch;
+  new_item->next_p = next_p;
+  return new_item;
+} /* parser_emit_cbc_forward_branch_item */
+
+/**
+ * Append a byte code with a branch argument
+ */
+void
+parser_emit_cbc_backward_branch (parser_context_t *context_p, /**< context */
+                                 uint16_t opcode, /**< opcode */
+                                 uint32_t offset) /**< destination offset */
+{
+  uint8_t flags;
+#ifdef PARSER_DUMP_BYTE_CODE
+  const char *name;
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+  if (context_p->last_cbc_opcode != PARSER_CBC_UNAVAILABLE)
+  {
+    parser_flush_cbc (context_p);
+  }
+
+  context_p->status_flags |= PARSER_NO_END_LABEL;
+  offset = context_p->byte_code_size - offset;
+
+  if (PARSER_IS_BASIC_OPCODE (opcode))
+  {
+    JERRY_ASSERT (opcode < CBC_END);
+    flags = cbc_flags[opcode];
+
+#ifdef PARSER_DUMP_BYTE_CODE
+    name = cbc_names[opcode];
+#endif /* PARSER_DUMP_BYTE_CODE */
+  }
+  else
+  {
+    PARSER_APPEND_TO_BYTE_CODE (context_p, CBC_EXT_OPCODE);
+    opcode = (uint16_t) PARSER_GET_EXT_OPCODE (opcode);
+
+    JERRY_ASSERT (opcode < CBC_EXT_END);
+    flags = cbc_ext_flags[opcode];
+    context_p->byte_code_size++;
+
+#ifdef PARSER_DUMP_BYTE_CODE
+    name = cbc_ext_names[opcode];
+#endif /* PARSER_DUMP_BYTE_CODE */
+  }
+
+  JERRY_ASSERT (flags & CBC_HAS_BRANCH_ARG);
+  JERRY_ASSERT (CBC_BRANCH_IS_BACKWARD (flags));
+  JERRY_ASSERT (CBC_BRANCH_OFFSET_LENGTH (opcode) == 1);
+  JERRY_ASSERT (offset <= context_p->byte_code_size);
+
+  /* Branch opcodes never push anything onto the stack. */
+  JERRY_ASSERT ((flags >> CBC_STACK_ADJUST_SHIFT) >= CBC_STACK_ADJUST_BASE
+                 || (CBC_STACK_ADJUST_BASE - (flags >> CBC_STACK_ADJUST_SHIFT)) <= context_p->stack_depth);
+  PARSER_PLUS_EQUAL_U16 (context_p->stack_depth, CBC_STACK_ADJUST_VALUE (flags));
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  if (context_p->is_show_opcodes)
+  {
+    JERRY_DEBUG_MSG ("  [%3d] %s\n", (int) context_p->stack_depth, name);
+  }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+  context_p->byte_code_size += 2;
+#if PARSER_MAXIMUM_CODE_SIZE <= 65535
+  if (offset > 255)
+  {
+    opcode++;
+    context_p->byte_code_size++;
+  }
+#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
+  if (offset > 65535)
+  {
+    PARSER_PLUS_EQUAL_U16 (opcode, 2);
+    context_p->byte_code_size += 2;
+  }
+  else if (offset > 255)
+  {
+    opcode++;
+    context_p->byte_code_size++;
+  }
+#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
+
+  PARSER_APPEND_TO_BYTE_CODE (context_p, (uint8_t) opcode);
+
+#if PARSER_MAXIMUM_CODE_SIZE > 65535
+  if (offset > 65535)
+  {
+    PARSER_APPEND_TO_BYTE_CODE (context_p, offset >> 16);
+  }
+#endif /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
+
+  if (offset > 255)
+  {
+    PARSER_APPEND_TO_BYTE_CODE (context_p, (offset >> 8) & 0xff);
+  }
+
+  PARSER_APPEND_TO_BYTE_CODE (context_p, offset & 0xff);
+} /* parser_emit_cbc_backward_branch */
+
+#undef PARSER_CHECK_LAST_POSITION
+#undef PARSER_APPEND_TO_BYTE_CODE
+
+/**
+ * Set a branch to the current byte code position
+ */
+void
+parser_set_branch_to_current_position (parser_context_t *context_p, /**< context */
+                                       parser_branch_t *branch_p) /**< branch result */
+{
+  uint32_t delta;
+  size_t offset;
+  parser_mem_page_t *page_p = branch_p->page_p;
+
+  if (context_p->last_cbc_opcode != PARSER_CBC_UNAVAILABLE)
+  {
+    parser_flush_cbc (context_p);
+  }
+
+  context_p->status_flags &= ~PARSER_NO_END_LABEL;
+
+  JERRY_ASSERT (context_p->byte_code_size > (branch_p->offset >> 8));
+
+  delta = context_p->byte_code_size - (branch_p->offset >> 8);
+  offset = (branch_p->offset & CBC_LOWER_SEVEN_BIT_MASK);
+
+  JERRY_ASSERT (delta <= PARSER_MAXIMUM_CODE_SIZE);
+
+#if PARSER_MAXIMUM_CODE_SIZE <= 65535
+  page_p->bytes[offset++] = (uint8_t) (delta >> 8);
+  if (offset >= PARSER_CBC_STREAM_PAGE_SIZE)
+  {
+    page_p = page_p->next_p;
+    offset = 0;
+  }
+#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
+  page_p->bytes[offset++] = (uint8_t) (delta >> 16);
+  if (offset >= PARSER_CBC_STREAM_PAGE_SIZE)
+  {
+    page_p = page_p->next_p;
+    offset = 0;
+  }
+  page_p->bytes[offset++] = (uint8_t) ((delta >> 8) & 0xff);
+  if (offset >= PARSER_CBC_STREAM_PAGE_SIZE)
+  {
+    page_p = page_p->next_p;
+    offset = 0;
+  }
+#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
+  page_p->bytes[offset++] = delta & 0xff;
+} /* parser_set_branch_to_current_position */
+
+/**
+ * Set breaks to the current byte code position
+ */
+void
+parser_set_breaks_to_current_position (parser_context_t *context_p, /**< context */
+                                       parser_branch_node_t *current_p) /**< branch list */
+{
+  while (current_p != NULL)
+  {
+    parser_branch_node_t *next_p = current_p->next_p;
+
+    if (!(current_p->branch.offset & CBC_HIGHEST_BIT_MASK))
+    {
+      parser_set_branch_to_current_position (context_p, &current_p->branch);
+    }
+    parser_free (current_p, sizeof (parser_branch_node_t));
+    current_p = next_p;
+  }
+} /* parser_set_breaks_to_current_position */
+
+/**
+ * Set continues to the current byte code position
+ */
+void
+parser_set_continues_to_current_position (parser_context_t *context_p, /**< context */
+                                          parser_branch_node_t *current_p) /**< branch list */
+{
+  while (current_p != NULL)
+  {
+    if (current_p->branch.offset & CBC_HIGHEST_BIT_MASK)
+    {
+      parser_set_branch_to_current_position (context_p, &current_p->branch);
+    }
+    current_p = current_p->next_p;
+  }
+} /* parser_set_continues_to_current_position */
+
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+/**
+ * Returns with the string representation of the error
+ */
+const char *
+parser_error_to_string (parser_error_t error) /**< error code */
+{
+  switch (error)
+  {
+    case PARSER_ERR_OUT_OF_MEMORY:
+    {
+      return "Out of memory.";
+    }
+    case PARSER_ERR_LITERAL_LIMIT_REACHED:
+    {
+      return "Maximum number of literals reached.";
+    }
+    case PARSER_ERR_ARGUMENT_LIMIT_REACHED:
+    {
+      return "Maximum number of function arguments reached.";
+    }
+    case PARSER_ERR_STACK_LIMIT_REACHED:
+    {
+      return "Maximum function stack size reached.";
+    }
+    case PARSER_ERR_REGISTER_LIMIT_REACHED:
+    {
+      return "Maximum number of registers is reached.";
+    }
+    case PARSER_ERR_INVALID_CHARACTER:
+    {
+      return "Invalid (unexpected) character.";
+    }
+    case PARSER_ERR_INVALID_HEX_DIGIT:
+    {
+      return "Invalid hexadecimal digit.";
+    }
+    case PARSER_ERR_INVALID_ESCAPE_SEQUENCE:
+    {
+      return "Invalid escape sequence.";
+    }
+    case PARSER_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE:
+    {
+      return "Invalid unicode escape sequence.";
+    }
+    case PARSER_ERR_INVALID_IDENTIFIER_START:
+    {
+      return "Character cannot be start of an identifier.";
+    }
+    case PARSER_ERR_INVALID_IDENTIFIER_PART:
+    {
+      return "Character cannot be part of an identifier.";
+    }
+    case PARSER_ERR_INVALID_NUMBER:
+    {
+      return "Invalid number.";
+    }
+    case PARSER_ERR_MISSING_EXPONENT:
+    {
+      return "Missing exponent part.";
+    }
+    case PARSER_ERR_IDENTIFIER_AFTER_NUMBER:
+    {
+      return "Identifier cannot start after a number.";
+    }
+    case PARSER_ERR_INVALID_REGEXP:
+    {
+      return "Invalid regular expression.";
+    }
+    case PARSER_ERR_UNKNOWN_REGEXP_FLAG:
+    {
+      return "Unknown regexp flag.";
+    }
+    case PARSER_ERR_DUPLICATED_REGEXP_FLAG:
+    {
+      return "Duplicated regexp flag.";
+    }
+    case PARSER_ERR_UNSUPPORTED_REGEXP:
+    {
+      return "Regexp is not supported in the selected profile.";
+    }
+    case PARSER_ERR_IDENTIFIER_TOO_LONG:
+    {
+      return "Identifier is too long.";
+    }
+    case PARSER_ERR_STRING_TOO_LONG:
+    {
+      return "String is too long.";
+    }
+    case PARSER_ERR_NUMBER_TOO_LONG:
+    {
+      return "Number is too long.";
+    }
+    case PARSER_ERR_REGEXP_TOO_LONG:
+    {
+      return "Regexp is too long.";
+    }
+    case PARSER_ERR_UNTERMINATED_MULTILINE_COMMENT:
+    {
+      return "Unterminated multiline comment.";
+    }
+    case PARSER_ERR_UNTERMINATED_STRING:
+    {
+      return "Unterminated string literal.";
+    }
+    case PARSER_ERR_UNTERMINATED_REGEXP:
+    {
+      return "Unterminated regexp literal.";
+    }
+    case PARSER_ERR_NEWLINE_NOT_ALLOWED:
+    {
+      return "Newline is not allowed in strings or regexps.";
+    }
+    case PARSER_ERR_OCTAL_NUMBER_NOT_ALLOWED:
+    {
+      return "Octal numbers are not allowed in strict mode.";
+    }
+    case PARSER_ERR_OCTAL_ESCAPE_NOT_ALLOWED:
+    {
+      return "Octal escape sequences are not allowed in strict mode.";
+    }
+    case PARSER_ERR_STRICT_IDENT_NOT_ALLOWED:
+    {
+      return "Identifier name is reserved in strict mode.";
+    }
+    case PARSER_ERR_EVAL_NOT_ALLOWED:
+    {
+      return "Eval is not allowed to be used here in strict mode.";
+    }
+    case PARSER_ERR_ARGUMENTS_NOT_ALLOWED:
+    {
+      return "Arguments is not allowed to be used here in strict mode.";
+    }
+    case PARSER_ERR_DELETE_IDENT_NOT_ALLOWED:
+    {
+      return "Deleting identifier is not allowed in strict mode.";
+    }
+    case PARSER_ERR_EVAL_CANNOT_ASSIGNED:
+    {
+      return "Eval cannot be assigned to in strict mode.";
+    }
+    case PARSER_ERR_ARGUMENTS_CANNOT_ASSIGNED:
+    {
+      return "Arguments cannot be assigned to in strict mode.";
+    }
+    case PARSER_ERR_WITH_NOT_ALLOWED:
+    {
+      return "With statement not allowed in strict mode.";
+    }
+    case PARSER_ERR_MULTIPLE_DEFAULTS_NOT_ALLOWED:
+    {
+      return "Multiple default cases are not allowed.";
+    }
+    case PARSER_ERR_DEFAULT_NOT_IN_SWITCH:
+    {
+      return "Default statement must be in a switch block.";
+    }
+    case PARSER_ERR_CASE_NOT_IN_SWITCH:
+    {
+      return "Case statement must be in a switch block.";
+    }
+    case PARSER_ERR_LEFT_PAREN_EXPECTED:
+    {
+      return "Expected '(' token.";
+    }
+    case PARSER_ERR_LEFT_BRACE_EXPECTED:
+    {
+      return "Expected '{' token.";
+    }
+    case PARSER_ERR_RIGHT_PAREN_EXPECTED:
+    {
+      return "Expected ')' token.";
+    }
+    case PARSER_ERR_RIGHT_SQUARE_EXPECTED:
+    {
+      return "Expected ']' token.";
+    }
+    case PARSER_ERR_COLON_EXPECTED:
+    {
+      return "Expected ':' token.";
+    }
+    case PARSER_ERR_COLON_FOR_CONDITIONAL_EXPECTED:
+    {
+      return "Expected ':' token for ?: conditional expression.";
+    }
+    case PARSER_ERR_SEMICOLON_EXPECTED:
+    {
+      return "Expected ';' token.";
+    }
+    case PARSER_ERR_IN_EXPECTED:
+    {
+      return "Expected 'in' token.";
+    }
+    case PARSER_ERR_WHILE_EXPECTED:
+    {
+      return "While expected for do-while loop.";
+    }
+    case PARSER_ERR_CATCH_FINALLY_EXPECTED:
+    {
+      return "Catch or finally block expected.";
+    }
+    case PARSER_ERR_ARRAY_ITEM_SEPARATOR_EXPECTED:
+    {
+      return "Expected ',' or ']' after an array item.";
+    }
+    case PARSER_ERR_OBJECT_ITEM_SEPARATOR_EXPECTED:
+    {
+      return "Expected ',' or '}' after a property definition.";
+    }
+    case PARSER_ERR_IDENTIFIER_EXPECTED:
+    {
+      return "Identifier expected.";
+    }
+    case PARSER_ERR_EXPRESSION_EXPECTED:
+    {
+      return "Expression expected.";
+    }
+    case PARSER_ERR_PRIMARY_EXP_EXPECTED:
+    {
+      return "Primary expression expected.";
+    }
+    case PARSER_ERR_STATEMENT_EXPECTED:
+    {
+      return "Statement expected.";
+    }
+    case PARSER_ERR_PROPERTY_IDENTIFIER_EXPECTED:
+    {
+      return "Property identifier expected.";
+    }
+    case PARSER_ERR_ARGUMENT_LIST_EXPECTED:
+    {
+      return "Expected argument list.";
+    }
+    case PARSER_ERR_NO_ARGUMENTS_EXPECTED:
+    {
+      return "Property getters must have no arguments.";
+    }
+    case PARSER_ERR_ONE_ARGUMENT_EXPECTED:
+    {
+      return "Property setters must have one argument.";
+    }
+    case PARSER_ERR_INVALID_EXPRESSION:
+    {
+      return "Invalid expression.";
+    }
+    case PARSER_ERR_INVALID_SWITCH:
+    {
+      return "Invalid switch body.";
+    }
+    case PARSER_ERR_INVALID_BREAK:
+    {
+      return "Break statement must be inside a loop or switch.";
+    }
+    case PARSER_ERR_INVALID_BREAK_LABEL:
+    {
+      return "Labeled statement targeted by a break not found.";
+    }
+    case PARSER_ERR_INVALID_CONTINUE:
+    {
+      return "Continue statement must be inside a loop.";
+    }
+    case PARSER_ERR_INVALID_CONTINUE_LABEL:
+    {
+      return "Labeled statement targeted by a continue not found.";
+    }
+    case PARSER_ERR_INVALID_RETURN:
+    {
+      return "Return statement must be inside a function body.";
+    }
+    case PARSER_ERR_INVALID_RIGHT_SQUARE:
+    {
+      return "Unexpected '}' token.";
+    }
+    case PARSER_ERR_DUPLICATED_LABEL:
+    {
+      return "Duplicated label.";
+    }
+    case PARSER_ERR_OBJECT_PROPERTY_REDEFINED:
+    {
+      return "Property of object literal redefined.";
+    }
+    case PARSER_ERR_NON_STRICT_ARG_DEFINITION:
+    {
+      return "Non-strict argument definition.";
+    }
+    default:
+    {
+      JERRY_ASSERT (error == PARSER_ERR_NO_ERROR);
+      return "No error.";
+    }
+  }
+} /* parser_error_to_string */
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* JERRY_JS_PARSER */
diff --git a/deps/jerry/jerry-core/parser/js/js-parser.c b/deps/jerry/jerry-core/parser/js/js-parser.c
new file mode 100644 (file)
index 0000000..5c8316b
--- /dev/null
@@ -0,0 +1,2552 @@
+/* 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.
+ */
+
+#include "debugger.h"
+#include "ecma-exceptions.h"
+#include "ecma-helpers.h"
+#include "ecma-literal-storage.h"
+#include "jcontext.h"
+#include "js-parser-internal.h"
+
+#if JERRY_JS_PARSER
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_parser Parser
+ * @{
+ */
+
+/**
+ * Copy identifiers if needed.
+ */
+static void
+parser_copy_identifiers (parser_context_t *context_p) /**< context */
+{
+  parser_saved_context_t *parent_p = context_p->last_context_p;
+
+  if (parent_p == NULL || parent_p->prev_context_p == NULL)
+  {
+    /* Return if this function is not a nested function. */
+    return;
+  }
+
+  if (context_p->status_flags & PARSER_NO_REG_STORE)
+  {
+    /* This flag must affect all parent functions. */
+    parent_p->status_flags |= PARSER_NO_REG_STORE;
+    return;
+  }
+
+  parser_list_iterator_t literal_iterator;
+  lexer_literal_t *literal_p;
+
+  parser_list_t parent_literal_pool;
+
+  /* Accessing the parent literal pool requires all data. */
+  parent_literal_pool.data = parent_p->literal_pool_data;
+  parent_literal_pool.page_size = context_p->literal_pool.page_size;
+  parent_literal_pool.item_size = context_p->literal_pool.item_size;
+  parent_literal_pool.item_count = context_p->literal_pool.item_count;
+
+  parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
+  while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)))
+  {
+    if (literal_p->type != LEXER_IDENT_LITERAL || (literal_p->status_flags & LEXER_FLAG_VAR))
+    {
+      continue;
+    }
+
+    parser_list_iterator_t parent_literal_iterator;
+    parser_list_iterator_init (&parent_literal_pool, &parent_literal_iterator);
+
+    lexer_literal_t *parent_literal_p;
+    const uint8_t *char_p = literal_p->u.char_p;
+    size_t length = literal_p->prop.length;
+
+    while ((parent_literal_p = (lexer_literal_t *) parser_list_iterator_next (&parent_literal_iterator)) != NULL)
+    {
+      if (parent_literal_p->type == LEXER_IDENT_LITERAL
+          && parent_literal_p->prop.length == length
+          && memcmp (parent_literal_p->u.char_p, char_p, length) == 0)
+      {
+        /* This literal is known by the parent. */
+        parent_literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE;
+        break;
+      }
+    }
+
+    if (parent_literal_p != NULL)
+    {
+      continue;
+    }
+
+    if (parent_p->literal_count >= PARSER_MAXIMUM_NUMBER_OF_LITERALS)
+    {
+      parser_raise_error (context_p, PARSER_ERR_LITERAL_LIMIT_REACHED);
+    }
+
+    parent_literal_p = (lexer_literal_t *) parser_list_append (context_p, &parent_literal_pool);
+
+    /* The literal data is updated at every iteration to handle out-of memory. */
+    parent_p->literal_pool_data = parent_literal_pool.data;
+
+    parent_literal_p->prop.length = (uint16_t) length;
+    parent_literal_p->type = LEXER_IDENT_LITERAL;
+    parent_literal_p->status_flags = (uint8_t) (literal_p->status_flags & LEXER_FLAG_SOURCE_PTR);
+    parent_literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE | LEXER_FLAG_UNUSED_IDENT;
+    parent_literal_p->u.char_p = char_p;
+
+    /* The buffer ownership is passed to the parent by
+     * setting this flag which prevents freeing the buffer. */
+    literal_p->status_flags |= LEXER_FLAG_SOURCE_PTR;
+
+    parent_p->literal_count++;
+  }
+} /* parser_copy_identifiers */
+
+/**
+ * Compute real literal indicies.
+ *
+ * @return length of the prefix opcodes
+ */
+static size_t
+parser_compute_indicies (parser_context_t *context_p, /**< context */
+                         uint16_t *ident_end, /**< end of the identifier group */
+                         uint16_t *uninitialized_var_end, /**< end of the uninitialized var group */
+                         uint16_t *initialized_var_end, /**< end of the initialized var group */
+                         uint16_t *const_literal_end) /**< end of the const literal group */
+{
+  parser_list_iterator_t literal_iterator;
+  lexer_literal_t *literal_p;
+  size_t length = 0;
+  uint16_t literal_one_byte_limit;
+  uint32_t status_flags = context_p->status_flags;
+  uint16_t argument_count;
+
+  uint16_t register_count = context_p->register_count;
+  uint16_t uninitialized_var_count = 0;
+  uint16_t initialized_var_count = 0;
+  uint16_t ident_count = 0;
+  uint16_t const_literal_count = 0;
+
+  uint16_t register_index;
+  uint16_t uninitialized_var_index;
+  uint16_t initialized_var_index;
+  uint16_t ident_index;
+  uint16_t const_literal_index;
+  uint16_t literal_index;
+
+  if (status_flags & PARSER_ARGUMENTS_NOT_NEEDED)
+  {
+    status_flags &= ~PARSER_ARGUMENTS_NEEDED;
+    context_p->status_flags = status_flags;
+  }
+
+  /* First phase: count the number of items in each group. */
+  parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
+  while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)))
+  {
+    if (literal_p->status_flags & LEXER_FLAG_UNUSED_IDENT)
+    {
+      context_p->literal_count--;
+      continue;
+    }
+
+#ifndef PARSER_DUMP_BYTE_CODE
+    if (literal_p->type == LEXER_IDENT_LITERAL
+        || literal_p->type == LEXER_STRING_LITERAL)
+    {
+      const uint8_t *char_p = literal_p->u.char_p;
+
+      if ((literal_p->status_flags & LEXER_FLAG_SOURCE_PTR)
+          && literal_p->prop.length < 0xfff)
+      {
+        size_t bytes_to_end = (size_t) (context_p->source_end_p - char_p);
+
+        if (bytes_to_end < 0xfffff)
+        {
+          literal_p->u.source_data = ((uint32_t) bytes_to_end) | (((uint32_t) literal_p->prop.length) << 20);
+          literal_p->status_flags |= LEXER_FLAG_LATE_INIT;
+          status_flags |= PARSER_HAS_LATE_LIT_INIT;
+          context_p->status_flags = status_flags;
+          char_p = NULL;
+        }
+      }
+
+      if (char_p != NULL)
+      {
+        literal_p->u.value = ecma_find_or_create_literal_string (char_p,
+                                                                 literal_p->prop.length);
+
+        if (!(literal_p->status_flags & LEXER_FLAG_SOURCE_PTR))
+        {
+          jmem_heap_free_block ((void *) char_p, literal_p->prop.length);
+        }
+      }
+    }
+#endif /* !PARSER_DUMP_BYTE_CODE */
+
+    switch (literal_p->type)
+    {
+      case LEXER_IDENT_LITERAL:
+      {
+        if (literal_p->status_flags & LEXER_FLAG_VAR)
+        {
+          if (status_flags & PARSER_NO_REG_STORE)
+          {
+            literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE;
+          }
+
+          if (literal_p->status_flags & LEXER_FLAG_INITIALIZED)
+          {
+            if (literal_p->status_flags & LEXER_FLAG_FUNCTION_NAME)
+            {
+              JERRY_ASSERT (literal_p == PARSER_GET_LITERAL (0));
+
+              status_flags |= PARSER_NAMED_FUNCTION_EXP;
+              context_p->status_flags = status_flags;
+
+              literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE;
+              context_p->literal_count++;
+            }
+
+            if (literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT)
+            {
+              if ((status_flags & PARSER_ARGUMENTS_NEEDED)
+                  && !(status_flags & PARSER_IS_STRICT))
+              {
+                literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE;
+              }
+
+              /* Arguments are bound to their position, or
+               * moved to the initialized var section. */
+              if (literal_p->status_flags & LEXER_FLAG_NO_REG_STORE)
+              {
+                initialized_var_count++;
+                context_p->literal_count++;
+              }
+            }
+            else if (!(literal_p->status_flags & LEXER_FLAG_NO_REG_STORE)
+                     && register_count < PARSER_MAXIMUM_NUMBER_OF_REGISTERS)
+            {
+              register_count++;
+            }
+            else
+            {
+              literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE;
+              initialized_var_count++;
+            }
+
+            if (context_p->literal_count >= PARSER_MAXIMUM_NUMBER_OF_LITERALS)
+            {
+              parser_raise_error (context_p, PARSER_ERR_LITERAL_LIMIT_REACHED);
+            }
+          }
+          else if (!(literal_p->status_flags & LEXER_FLAG_NO_REG_STORE)
+                   && register_count < PARSER_MAXIMUM_NUMBER_OF_REGISTERS)
+          {
+            register_count++;
+          }
+          else
+          {
+            literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE;
+            uninitialized_var_count++;
+          }
+
+          if (literal_p->status_flags & LEXER_FLAG_NO_REG_STORE)
+          {
+            status_flags |= PARSER_LEXICAL_ENV_NEEDED;
+            context_p->status_flags = status_flags;
+          }
+        }
+        else
+        {
+          ident_count++;
+        }
+        break;
+      }
+      case LEXER_STRING_LITERAL:
+      case LEXER_NUMBER_LITERAL:
+      {
+        const_literal_count++;
+        break;
+      }
+      case LEXER_UNUSED_LITERAL:
+      {
+        if (!(literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT))
+        {
+          context_p->literal_count--;
+        }
+        break;
+      }
+    }
+  }
+
+  if (context_p->literal_count <= CBC_MAXIMUM_SMALL_VALUE)
+  {
+    literal_one_byte_limit = CBC_MAXIMUM_BYTE_VALUE - 1;
+  }
+  else
+  {
+    literal_one_byte_limit = CBC_LOWER_SEVEN_BIT_MASK;
+  }
+
+  if (uninitialized_var_count > 0)
+  {
+    /* Opcode byte and a literal argument. */
+    length += 2;
+    if ((register_count + uninitialized_var_count - 1) > literal_one_byte_limit)
+    {
+      length++;
+    }
+  }
+
+  register_index = context_p->register_count;
+  uninitialized_var_index = register_count;
+  initialized_var_index = (uint16_t) (uninitialized_var_index + uninitialized_var_count);
+  ident_index = (uint16_t) (initialized_var_index + initialized_var_count);
+  const_literal_index = (uint16_t) (ident_index + ident_count);
+  literal_index = (uint16_t) (const_literal_index + const_literal_count);
+
+  if (initialized_var_count > 2)
+  {
+    status_flags |= PARSER_HAS_INITIALIZED_VARS;
+    context_p->status_flags = status_flags;
+
+    /* Opcode byte and two literal arguments. */
+    length += 3;
+    if (initialized_var_index > literal_one_byte_limit)
+    {
+      length++;
+    }
+    if (ident_index - 1 > literal_one_byte_limit)
+    {
+      length++;
+    }
+  }
+
+  /* Second phase: Assign an index to each literal. */
+  parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
+  argument_count = 0;
+
+  while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)))
+  {
+    uint16_t init_index;
+
+    if (literal_p->status_flags & LEXER_FLAG_UNUSED_IDENT)
+    {
+      continue;
+    }
+
+    if (literal_p->type != LEXER_IDENT_LITERAL)
+    {
+      if (literal_p->type == LEXER_STRING_LITERAL
+          || literal_p->type == LEXER_NUMBER_LITERAL)
+      {
+        JERRY_ASSERT ((literal_p->status_flags & ~(LEXER_FLAG_SOURCE_PTR | LEXER_FLAG_LATE_INIT)) == 0);
+        literal_p->prop.index = const_literal_index;
+        const_literal_index++;
+        continue;
+      }
+
+      if (literal_p->type != LEXER_UNUSED_LITERAL)
+      {
+        JERRY_ASSERT (literal_p->status_flags == 0);
+        JERRY_ASSERT (literal_p->type == LEXER_FUNCTION_LITERAL
+                      || literal_p->type == LEXER_REGEXP_LITERAL);
+
+        literal_p->prop.index = literal_index;
+        literal_index++;
+        continue;
+      }
+
+      JERRY_ASSERT ((literal_p->status_flags & ~(LEXER_FLAG_FUNCTION_ARGUMENT | LEXER_FLAG_SOURCE_PTR)) == 0);
+
+      if (literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT)
+      {
+        argument_count++;
+      }
+      continue;
+    }
+
+    if (!(literal_p->status_flags & LEXER_FLAG_VAR))
+    {
+      literal_p->prop.index = ident_index;
+      ident_index++;
+      continue;
+    }
+
+    if (!(literal_p->status_flags & LEXER_FLAG_INITIALIZED))
+    {
+      if (!(literal_p->status_flags & LEXER_FLAG_NO_REG_STORE))
+      {
+        JERRY_ASSERT (register_count <= PARSER_MAXIMUM_NUMBER_OF_REGISTERS);
+        /* This var literal can be stored in a register. */
+        literal_p->prop.index = register_index;
+        register_index++;
+      }
+      else
+      {
+        literal_p->prop.index = uninitialized_var_index;
+        uninitialized_var_index++;
+      }
+      continue;
+    }
+
+    if (literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT)
+    {
+      if (literal_p->status_flags & LEXER_FLAG_NO_REG_STORE)
+      {
+        literal_p->prop.index = initialized_var_index;
+        initialized_var_index++;
+        init_index = argument_count;
+        argument_count++;
+      }
+      else
+      {
+        literal_p->prop.index = argument_count;
+        argument_count++;
+        continue;
+      }
+    }
+    else
+    {
+      if (!(literal_p->status_flags & LEXER_FLAG_NO_REG_STORE))
+      {
+        JERRY_ASSERT (register_count <= PARSER_MAXIMUM_NUMBER_OF_REGISTERS);
+        /* This var literal can be stored in a register. */
+        literal_p->prop.index = register_index;
+        register_index++;
+      }
+      else
+      {
+        literal_p->prop.index = initialized_var_index;
+        initialized_var_index++;
+      }
+
+      init_index = literal_index;
+      literal_index++;
+
+      if (!(literal_p->status_flags & LEXER_FLAG_FUNCTION_NAME))
+      {
+        lexer_literal_t *func_literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator);
+
+        JERRY_ASSERT (func_literal_p != NULL
+                      && func_literal_p->type == LEXER_FUNCTION_LITERAL);
+        func_literal_p->prop.index = init_index;
+      }
+    }
+
+    /* A CBC_INITIALIZE_VAR instruction or part of a CBC_INITIALIZE_VARS instruction. */
+    if (!(status_flags & PARSER_HAS_INITIALIZED_VARS)
+        || !(literal_p->status_flags & LEXER_FLAG_NO_REG_STORE))
+    {
+      length += 2;
+      if (literal_p->prop.index > literal_one_byte_limit)
+      {
+        length++;
+      }
+    }
+
+    length++;
+    if (init_index > literal_one_byte_limit)
+    {
+      length++;
+    }
+  }
+
+  JERRY_ASSERT (argument_count == context_p->argument_count);
+  JERRY_ASSERT (register_index == register_count);
+  JERRY_ASSERT (uninitialized_var_index == register_count + uninitialized_var_count);
+  JERRY_ASSERT (initialized_var_index == uninitialized_var_index + initialized_var_count);
+  JERRY_ASSERT (ident_index == initialized_var_index + ident_count);
+  JERRY_ASSERT (const_literal_index == ident_index + const_literal_count);
+  JERRY_ASSERT (literal_index == context_p->literal_count);
+
+  *ident_end = ident_index;
+  *uninitialized_var_end = uninitialized_var_index;
+  *initialized_var_end = initialized_var_index;
+  *const_literal_end = const_literal_index;
+  context_p->register_count = register_index;
+
+  return length;
+} /* parser_compute_indicies */
+
+/**
+ * Encode a literal argument.
+ *
+ * @return position after the encoded values
+ */
+static inline uint8_t *
+parser_encode_literal (uint8_t *dst_p, /**< destination buffer */
+                       uint16_t literal_index, /**< literal index */
+                       uint16_t literal_one_byte_limit) /**< maximum value of a literal
+                                                          *   encoded in one byte */
+{
+  if (literal_index <= literal_one_byte_limit)
+  {
+    *dst_p++ = (uint8_t) (literal_index);
+  }
+  else
+  {
+    if (literal_one_byte_limit == CBC_MAXIMUM_BYTE_VALUE - 1)
+    {
+      *dst_p++ = (uint8_t) (CBC_MAXIMUM_BYTE_VALUE);
+      *dst_p++ = (uint8_t) (literal_index - CBC_MAXIMUM_BYTE_VALUE);
+    }
+    else
+    {
+      *dst_p++ = (uint8_t) ((literal_index >> 8) | CBC_HIGHEST_BIT_MASK);
+      *dst_p++ = (uint8_t) (literal_index & CBC_MAXIMUM_BYTE_VALUE);
+    }
+  }
+  return dst_p;
+} /* parser_encode_literal */
+
+/**
+ * Generate initializer byte codes.
+ *
+ * @return the end of the initializer stream
+ */
+static uint8_t *
+parser_generate_initializers (parser_context_t *context_p, /**< context */
+                              uint8_t *dst_p, /**< destination buffer */
+                              jmem_cpointer_t *literal_pool_p, /**< start of literal pool */
+                              uint16_t uninitialized_var_end, /**< end of the uninitialized var group */
+                              uint16_t initialized_var_end, /**< end of the initialized var group */
+                              uint16_t const_literal_end, /**< end of the const literal group */
+                              uint16_t literal_one_byte_limit) /**< maximum value of a literal
+                                                                *   encoded in one byte */
+{
+  parser_list_iterator_t literal_iterator;
+  lexer_literal_t *literal_p;
+  uint16_t argument_count;
+
+  if (uninitialized_var_end > context_p->register_count)
+  {
+    *dst_p++ = CBC_DEFINE_VARS;
+    dst_p = parser_encode_literal (dst_p,
+                                   (uint16_t) (uninitialized_var_end - 1),
+                                   literal_one_byte_limit);
+  }
+
+  if (context_p->status_flags & PARSER_HAS_INITIALIZED_VARS)
+  {
+    const uint8_t expected_status_flags = LEXER_FLAG_VAR | LEXER_FLAG_NO_REG_STORE | LEXER_FLAG_INITIALIZED;
+#ifndef JERRY_NDEBUG
+    uint16_t next_index = uninitialized_var_end;
+#endif /* !JERRY_NDEBUG */
+
+    context_p->status_flags |= PARSER_LEXICAL_ENV_NEEDED;
+
+    *dst_p++ = CBC_INITIALIZE_VARS;
+    dst_p = parser_encode_literal (dst_p,
+                                   (uint16_t) uninitialized_var_end,
+                                   literal_one_byte_limit);
+    dst_p = parser_encode_literal (dst_p,
+                                   (uint16_t) (initialized_var_end - 1),
+                                   literal_one_byte_limit);
+
+    parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
+    argument_count = 0;
+
+    while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)))
+    {
+      if (literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT)
+      {
+        argument_count++;
+      }
+
+      if ((literal_p->status_flags & expected_status_flags) == expected_status_flags)
+      {
+        uint16_t init_index;
+
+        JERRY_ASSERT (literal_p->type == LEXER_IDENT_LITERAL);
+#ifndef JERRY_NDEBUG
+        JERRY_ASSERT (literal_p->prop.index == next_index);
+        next_index++;
+#endif /* !JERRY_NDEBUG */
+        literal_p->status_flags = (uint8_t) (literal_p->status_flags & ~LEXER_FLAG_INITIALIZED);
+
+
+        if (literal_p->status_flags & LEXER_FLAG_FUNCTION_NAME)
+        {
+          init_index = const_literal_end;
+        }
+        else if (literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT)
+        {
+          init_index = (uint16_t) (argument_count - 1);
+        }
+        else
+        {
+          literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator);
+
+          JERRY_ASSERT (literal_p != NULL
+                        && literal_p->type == LEXER_FUNCTION_LITERAL);
+          init_index = literal_p->prop.index;
+        }
+
+        dst_p = parser_encode_literal (dst_p, init_index, literal_one_byte_limit);
+      }
+    }
+
+    JERRY_ASSERT (argument_count == context_p->argument_count);
+  }
+
+  parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
+  argument_count = 0;
+
+  while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)))
+  {
+    const uint8_t expected_status_flags = LEXER_FLAG_VAR | LEXER_FLAG_INITIALIZED;
+
+    if (literal_p->type != LEXER_UNUSED_LITERAL)
+    {
+      if (literal_p->type == LEXER_IDENT_LITERAL
+          || literal_p->type == LEXER_STRING_LITERAL)
+      {
+#ifdef PARSER_DUMP_BYTE_CODE
+        if (!(literal_p->status_flags & LEXER_FLAG_UNUSED_IDENT))
+        {
+          jmem_cpointer_t lit_cp = ecma_find_or_create_literal_string (literal_p->u.char_p,
+                                                                       literal_p->prop.length);
+          literal_pool_p[literal_p->prop.index] = lit_cp;
+        }
+
+        if (!context_p->is_show_opcodes
+            && !(literal_p->status_flags & LEXER_FLAG_SOURCE_PTR))
+        {
+          jmem_heap_free_block ((void *) literal_p->u.char_p, literal_p->prop.length);
+        }
+#else /* !PARSER_DUMP_BYTE_CODE */
+        if (!(literal_p->status_flags & LEXER_FLAG_UNUSED_IDENT))
+        {
+          literal_pool_p[literal_p->prop.index] = literal_p->u.value;
+        }
+#endif /* PARSER_DUMP_BYTE_CODE */
+      }
+      else if ((literal_p->type == LEXER_FUNCTION_LITERAL)
+               || (literal_p->type == LEXER_REGEXP_LITERAL))
+      {
+        ECMA_SET_NON_NULL_POINTER (literal_pool_p[literal_p->prop.index],
+                                   literal_p->u.bytecode_p);
+      }
+      else
+      {
+        JERRY_ASSERT (literal_p->type == LEXER_NUMBER_LITERAL);
+        literal_pool_p[literal_p->prop.index] = literal_p->u.value;
+      }
+    }
+
+    if (literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT)
+    {
+      argument_count++;
+    }
+
+    if ((literal_p->status_flags & expected_status_flags) == expected_status_flags)
+    {
+      uint16_t index = literal_p->prop.index;
+      uint16_t init_index;
+
+      JERRY_ASSERT (literal_p->type == LEXER_IDENT_LITERAL);
+
+      if (literal_p->status_flags & LEXER_FLAG_FUNCTION_NAME)
+      {
+        init_index = const_literal_end;
+      }
+      else if (literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT)
+      {
+        init_index = (uint16_t) (argument_count - 1);
+
+        if (init_index == literal_p->prop.index)
+        {
+          continue;
+        }
+      }
+      else
+      {
+        literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator);
+
+        JERRY_ASSERT (literal_p != NULL
+                      && literal_p->type == LEXER_FUNCTION_LITERAL);
+        init_index = literal_p->prop.index;
+        ECMA_SET_NON_NULL_POINTER (literal_pool_p[literal_p->prop.index],
+                                   literal_p->u.bytecode_p);
+      }
+
+      *dst_p++ = CBC_INITIALIZE_VAR;
+      dst_p = parser_encode_literal (dst_p, index, literal_one_byte_limit);
+      dst_p = parser_encode_literal (dst_p, init_index, literal_one_byte_limit);
+    }
+  }
+
+  JERRY_ASSERT (argument_count == context_p->argument_count);
+  return dst_p;
+} /* parser_generate_initializers */
+
+/*
+ * During byte code post processing certain bytes are not
+ * copied into the final byte code buffer. For example, if
+ * one byte is enough for encoding a literal index, the
+ * second byte is not copied. However, when a byte is skipped,
+ * the offsets of those branches which crosses (jumps over)
+ * that byte code should also be decreased by one. Instead
+ * of finding these jumps every time when a byte is skipped,
+ * all branch offset updates are computed in one step.
+ *
+ * Branch offset mapping example:
+ *
+ * Let's assume that each parser_mem_page of the byte_code
+ * buffer is 8 bytes long and only 4 bytes are kept for a
+ * given page:
+ *
+ * +---+---+---+---+---+---+---+---+
+ * | X | 1 | 2 | 3 | X | 4 | X | X |
+ * +---+---+---+---+---+---+---+---+
+ *
+ * X marks those bytes which are removed. The resulting
+ * offset mapping is the following:
+ *
+ * +---+---+---+---+---+---+---+---+
+ * | 0 | 1 | 2 | 3 | 3 | 4 | 4 | 4 |
+ * +---+---+---+---+---+---+---+---+
+ *
+ * Each X is simply replaced by the index of the previous
+ * index starting from zero. This shows the number of
+ * copied bytes before a given byte including the byte
+ * itself. The last byte always shows the number of bytes
+ * copied from this page.
+ *
+ * This mapping allows recomputing all branch targets,
+ * since mapping[to] - mapping[from] is the new argument
+ * for forward branches. As for backward branches, the
+ * equation is reversed to mapping[from] - mapping[to].
+ *
+ * The mapping is relative to one page, so distance
+ * computation affecting multiple pages requires a loop.
+ * We should also note that only argument bytes can
+ * be skipped, so removed bytes cannot be targeted by
+ * branches. Valid branches always target instruction
+ * starts only.
+ */
+
+/**
+ * Recompute the argument of a forward branch.
+ *
+ * @return the new distance
+ */
+static size_t
+parser_update_forward_branch (parser_mem_page_t *page_p, /**< current page */
+                              size_t full_distance, /**< full distance */
+                              uint8_t bytes_copied_before_jump) /**< bytes copied before jump */
+{
+  size_t new_distance = 0;
+
+  while (full_distance > PARSER_CBC_STREAM_PAGE_SIZE)
+  {
+    new_distance += page_p->bytes[PARSER_CBC_STREAM_PAGE_SIZE - 1] & CBC_LOWER_SEVEN_BIT_MASK;
+    full_distance -= PARSER_CBC_STREAM_PAGE_SIZE;
+    page_p = page_p->next_p;
+  }
+
+  new_distance += page_p->bytes[full_distance - 1] & CBC_LOWER_SEVEN_BIT_MASK;
+  return new_distance - bytes_copied_before_jump;
+} /* parser_update_forward_branch */
+
+/**
+ * Recompute the argument of a backward branch.
+ *
+ * @return the new distance
+ */
+static size_t
+parser_update_backward_branch (parser_mem_page_t *page_p, /**< current page */
+                               size_t full_distance, /**< full distance */
+                               uint8_t bytes_copied_before_jump) /**< bytes copied before jump */
+{
+  size_t new_distance = bytes_copied_before_jump;
+
+  while (full_distance >= PARSER_CBC_STREAM_PAGE_SIZE)
+  {
+    JERRY_ASSERT (page_p != NULL);
+    new_distance += page_p->bytes[PARSER_CBC_STREAM_PAGE_SIZE - 1] & CBC_LOWER_SEVEN_BIT_MASK;
+    full_distance -= PARSER_CBC_STREAM_PAGE_SIZE;
+    page_p = page_p->next_p;
+  }
+
+  if (full_distance > 0)
+  {
+    size_t offset = PARSER_CBC_STREAM_PAGE_SIZE - full_distance;
+
+    JERRY_ASSERT (page_p != NULL);
+
+    new_distance += page_p->bytes[PARSER_CBC_STREAM_PAGE_SIZE - 1] & CBC_LOWER_SEVEN_BIT_MASK;
+    new_distance -= page_p->bytes[offset - 1] & CBC_LOWER_SEVEN_BIT_MASK;
+  }
+
+  return new_distance;
+} /* parser_update_backward_branch */
+
+/**
+ * Update targets of all branches in one step.
+ */
+static void
+parse_update_branches (parser_context_t *context_p, /**< context */
+                       uint8_t *byte_code_p) /**< byte code */
+{
+  parser_mem_page_t *page_p = context_p->byte_code.first_p;
+  parser_mem_page_t *prev_page_p = NULL;
+  parser_mem_page_t *last_page_p = context_p->byte_code.last_p;
+  size_t last_position = context_p->byte_code.last_position;
+  size_t offset = 0;
+  size_t bytes_copied = 0;
+
+  if (last_position >= PARSER_CBC_STREAM_PAGE_SIZE)
+  {
+    last_page_p = NULL;
+    last_position = 0;
+  }
+
+  while (page_p != last_page_p || offset < last_position)
+  {
+    /* Branch instructions are marked to improve search speed. */
+    if (page_p->bytes[offset] & CBC_HIGHEST_BIT_MASK)
+    {
+      uint8_t *bytes_p = byte_code_p + bytes_copied;
+      uint8_t flags;
+      uint8_t bytes_copied_before_jump = 0;
+      size_t branch_argument_length;
+      size_t target_distance;
+      size_t length;
+
+      if (offset > 0)
+      {
+        bytes_copied_before_jump = page_p->bytes[offset - 1] & CBC_LOWER_SEVEN_BIT_MASK;
+      }
+      bytes_p += bytes_copied_before_jump;
+
+      if (*bytes_p == CBC_EXT_OPCODE)
+      {
+        bytes_p++;
+        flags = cbc_ext_flags[*bytes_p];
+      }
+      else
+      {
+        flags = cbc_flags[*bytes_p];
+      }
+
+      JERRY_ASSERT (flags & CBC_HAS_BRANCH_ARG);
+      branch_argument_length = CBC_BRANCH_OFFSET_LENGTH (*bytes_p);
+      bytes_p++;
+
+      /* Decoding target. */
+      length = branch_argument_length;
+      target_distance = 0;
+      do
+      {
+        target_distance = (target_distance << 8) | *bytes_p;
+        bytes_p++;
+      }
+      while (--length > 0);
+
+      if (CBC_BRANCH_IS_FORWARD (flags))
+      {
+        /* Branch target was not set. */
+        JERRY_ASSERT (target_distance > 0);
+
+        target_distance = parser_update_forward_branch (page_p,
+                                                        offset + target_distance,
+                                                        bytes_copied_before_jump);
+      }
+      else
+      {
+        if (target_distance < offset)
+        {
+          uint8_t bytes_copied_before_target = page_p->bytes[offset - target_distance - 1];
+          bytes_copied_before_target = bytes_copied_before_target & CBC_LOWER_SEVEN_BIT_MASK;
+
+          target_distance = (size_t) (bytes_copied_before_jump - bytes_copied_before_target);
+        }
+        else if (target_distance == offset)
+        {
+          target_distance = bytes_copied_before_jump;
+        }
+        else
+        {
+          target_distance = parser_update_backward_branch (prev_page_p,
+                                                           target_distance - offset,
+                                                           bytes_copied_before_jump);
+        }
+      }
+
+      /* Encoding target again. */
+      do
+      {
+        bytes_p--;
+        *bytes_p = (uint8_t) (target_distance & 0xff);
+        target_distance >>= 8;
+      }
+      while (--branch_argument_length > 0);
+    }
+
+    offset++;
+    if (offset >= PARSER_CBC_STREAM_PAGE_SIZE)
+    {
+      parser_mem_page_t *next_p = page_p->next_p;
+
+      /* We reverse the pages before the current page. */
+      page_p->next_p = prev_page_p;
+      prev_page_p = page_p;
+
+      bytes_copied += page_p->bytes[PARSER_CBC_STREAM_PAGE_SIZE - 1] & CBC_LOWER_SEVEN_BIT_MASK;
+      page_p = next_p;
+      offset = 0;
+    }
+  }
+
+  /* After this point the pages of the byte code stream are
+   * not used anymore. However, they needs to be freed during
+   * cleanup, so the first and last pointers of the stream
+   * descriptor are reversed as well. */
+  if (last_page_p != NULL)
+  {
+    JERRY_ASSERT (last_page_p == context_p->byte_code.last_p);
+    last_page_p->next_p = prev_page_p;
+  }
+  else
+  {
+    last_page_p = context_p->byte_code.last_p;
+  }
+
+  context_p->byte_code.last_p = context_p->byte_code.first_p;
+  context_p->byte_code.first_p = last_page_p;
+} /* parse_update_branches */
+
+#ifdef PARSER_DUMP_BYTE_CODE
+
+/**
+ * Print literal.
+ */
+static void
+parse_print_literal (ecma_compiled_code_t *compiled_code_p, /**< compiled code */
+                     uint16_t literal_index, /**< literal index */
+                     parser_list_t *literal_pool_p) /**< literal pool */
+{
+  parser_list_iterator_t literal_iterator;
+  uint16_t argument_end;
+  uint16_t register_end;
+  uint16_t ident_end;
+  uint16_t const_literal_end;
+
+  if (compiled_code_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) compiled_code_p;
+    argument_end = args_p->argument_end;
+    register_end = args_p->register_end;
+    ident_end = args_p->ident_end;
+    const_literal_end = args_p->const_literal_end;
+  }
+  else
+  {
+    cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) compiled_code_p;
+    argument_end = args_p->argument_end;
+    register_end = args_p->register_end;
+    ident_end = args_p->ident_end;
+    const_literal_end = args_p->const_literal_end;
+  }
+
+  parser_list_iterator_init (literal_pool_p, &literal_iterator);
+
+  while (true)
+  {
+    lexer_literal_t *literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator);
+
+    if (literal_p == NULL)
+    {
+      if (literal_index == const_literal_end)
+      {
+        JERRY_DEBUG_MSG (" idx:%d(self)->function", literal_index);
+        break;
+      }
+
+      JERRY_ASSERT (literal_index < argument_end);
+      JERRY_DEBUG_MSG (" idx:%d(arg)->undefined", literal_index);
+      break;
+    }
+
+    if (literal_p->prop.index == literal_index
+        && literal_p->type != LEXER_UNUSED_LITERAL
+        && !(literal_p->status_flags & LEXER_FLAG_UNUSED_IDENT))
+    {
+      JERRY_DEBUG_MSG (" idx:%d", literal_index);
+
+      if (literal_index < argument_end)
+      {
+        JERRY_DEBUG_MSG ("(arg)->");
+      }
+      else if (literal_index < register_end)
+      {
+        JERRY_DEBUG_MSG ("(reg)->");
+      }
+      else if (literal_index < ident_end)
+      {
+        JERRY_DEBUG_MSG ("(ident)->");
+      }
+      else
+      {
+        JERRY_DEBUG_MSG ("(lit)->");
+      }
+
+      util_print_literal (literal_p);
+      return;
+    }
+  }
+} /* parse_print_literal */
+
+#define PARSER_READ_IDENTIFIER_INDEX(name) \
+  name = *byte_code_p++; \
+  if (name >= encoding_limit) \
+  { \
+    name = (uint16_t) (((name << 8) | byte_code_p[0]) - encoding_delta); \
+    byte_code_p++; \
+  }
+
+/**
+ * Print CBC_DEFINE_VARS instruction.
+ *
+ * @return next byte code position
+ */
+static uint8_t *
+parse_print_define_vars (ecma_compiled_code_t *compiled_code_p, /**< compiled code */
+                         uint8_t *byte_code_p, /**< byte code position */
+                         uint16_t encoding_limit, /**< literal encoding limit */
+                         uint16_t encoding_delta, /**< literal encoding delta */
+                         parser_list_t *literal_pool_p) /**< literal pool */
+{
+  uint16_t identifier_index;
+  uint16_t identifier_end;
+
+  if (compiled_code_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) compiled_code_p;
+    identifier_index = args_p->register_end;
+  }
+  else
+  {
+    cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) compiled_code_p;
+    identifier_index = args_p->register_end;
+  }
+
+  PARSER_READ_IDENTIFIER_INDEX (identifier_end);
+
+  JERRY_DEBUG_MSG (" from: %d to: %d\n", identifier_index, identifier_end);
+
+  while (identifier_index <= identifier_end)
+  {
+    JERRY_DEBUG_MSG ("        ");
+    parse_print_literal (compiled_code_p, identifier_index, literal_pool_p);
+    identifier_index++;
+    JERRY_DEBUG_MSG ("\n");
+  }
+
+  return byte_code_p;
+} /* parse_print_define_vars */
+
+/**
+ * Print CBC_INITIALIZE_VARS instruction.
+ *
+ * @return next byte code position
+ */
+static uint8_t *
+parse_print_initialize_vars (ecma_compiled_code_t *compiled_code_p, /**< compiled code */
+                             uint8_t *byte_code_p, /**< byte code position */
+                             uint16_t encoding_limit, /**< literal encoding limit */
+                             uint16_t encoding_delta, /**< literal encoding delta */
+                             parser_list_t *literal_pool_p) /**< literal pool */
+{
+  uint16_t identifier_index;
+  uint16_t identifier_end;
+
+  PARSER_READ_IDENTIFIER_INDEX (identifier_index);
+  PARSER_READ_IDENTIFIER_INDEX (identifier_end);
+
+  JERRY_DEBUG_MSG (" from: %d to: %d\n", identifier_index, identifier_end);
+
+  while (identifier_index <= identifier_end)
+  {
+    uint16_t literal_index;
+
+    JERRY_DEBUG_MSG ("        ");
+    parse_print_literal (compiled_code_p, identifier_index, literal_pool_p);
+    JERRY_DEBUG_MSG (" =");
+
+    PARSER_READ_IDENTIFIER_INDEX (literal_index);
+
+    parse_print_literal (compiled_code_p, literal_index, literal_pool_p);
+    identifier_index++;
+    JERRY_DEBUG_MSG ("\n");
+  }
+
+  return byte_code_p;
+} /* parse_print_initialize_vars */
+
+/**
+ * Print byte code.
+ */
+static void
+parse_print_final_cbc (ecma_compiled_code_t *compiled_code_p, /**< compiled code */
+                       parser_list_t *literal_pool_p, /**< literal pool */
+                       size_t length) /**< length of byte code */
+{
+  uint8_t flags;
+  uint8_t *byte_code_start_p;
+  uint8_t *byte_code_end_p;
+  uint8_t *byte_code_p;
+  uint16_t encoding_limit;
+  uint16_t encoding_delta;
+  uint16_t stack_limit;
+  uint16_t argument_end;
+  uint16_t register_end;
+  uint16_t ident_end;
+  uint16_t const_literal_end;
+  uint16_t literal_end;
+
+  if (compiled_code_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    cbc_uint16_arguments_t *args = (cbc_uint16_arguments_t *) compiled_code_p;
+    stack_limit = args->stack_limit;
+    argument_end = args->argument_end;
+    register_end = args->register_end;
+    ident_end = args->ident_end;
+    const_literal_end = args->const_literal_end;
+    literal_end = args->literal_end;
+  }
+  else
+  {
+    cbc_uint8_arguments_t *args = (cbc_uint8_arguments_t *) compiled_code_p;
+    stack_limit = args->stack_limit;
+    argument_end = args->argument_end;
+    register_end = args->register_end;
+    ident_end = args->ident_end;
+    const_literal_end = args->const_literal_end;
+    literal_end = args->literal_end;
+  }
+
+  JERRY_DEBUG_MSG ("\nFinal byte code dump:\n\n  Maximum stack depth: %d\n  Flags: [",
+                   (int) (stack_limit + register_end));
+
+  if (!(compiled_code_p->status_flags & CBC_CODE_FLAGS_FULL_LITERAL_ENCODING))
+  {
+    JERRY_DEBUG_MSG ("small_lit_enc");
+    encoding_limit = 255;
+    encoding_delta = 0xfe01;
+  }
+  else
+  {
+    JERRY_DEBUG_MSG ("full_lit_enc");
+    encoding_limit = 128;
+    encoding_delta = 0x8000;
+  }
+
+  if (compiled_code_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    JERRY_DEBUG_MSG (",uint16_arguments");
+  }
+
+  if (compiled_code_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE)
+  {
+    JERRY_DEBUG_MSG (",strict_mode");
+  }
+
+  if (compiled_code_p->status_flags & CBC_CODE_FLAGS_ARGUMENTS_NEEDED)
+  {
+    JERRY_DEBUG_MSG (",arguments_needed");
+  }
+
+  if (compiled_code_p->status_flags & CBC_CODE_FLAGS_LEXICAL_ENV_NOT_NEEDED)
+  {
+    JERRY_DEBUG_MSG (",no_lexical_env");
+  }
+
+  JERRY_DEBUG_MSG ("]\n");
+
+  JERRY_DEBUG_MSG ("  Argument range end: %d\n", (int) argument_end);
+  JERRY_DEBUG_MSG ("  Register range end: %d\n", (int) register_end);
+  JERRY_DEBUG_MSG ("  Identifier range end: %d\n", (int) ident_end);
+  JERRY_DEBUG_MSG ("  Const literal range end: %d\n", (int) const_literal_end);
+  JERRY_DEBUG_MSG ("  Literal range end: %d\n\n", (int) literal_end);
+
+  byte_code_start_p = (uint8_t *) compiled_code_p;
+
+  if (compiled_code_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    byte_code_start_p += sizeof (cbc_uint16_arguments_t);
+  }
+  else
+  {
+    byte_code_start_p += sizeof (cbc_uint8_arguments_t);
+  }
+
+  byte_code_start_p += literal_end * sizeof (jmem_cpointer_t);
+  byte_code_end_p = byte_code_start_p + length;
+  byte_code_p = byte_code_start_p;
+
+  while (byte_code_p < byte_code_end_p)
+  {
+    cbc_opcode_t opcode;
+    cbc_ext_opcode_t ext_opcode;
+    size_t cbc_offset;
+
+    opcode = (cbc_opcode_t) *byte_code_p;
+    ext_opcode = CBC_EXT_NOP;
+    cbc_offset = (size_t) (byte_code_p - byte_code_start_p);
+
+    if (opcode != CBC_EXT_OPCODE)
+    {
+      flags = cbc_flags[opcode];
+      JERRY_DEBUG_MSG (" %3d : %s", (int) cbc_offset, cbc_names[opcode]);
+      byte_code_p++;
+
+      if (opcode == CBC_INITIALIZE_VARS)
+      {
+        byte_code_p = parse_print_initialize_vars (compiled_code_p,
+                                                   byte_code_p,
+                                                   encoding_limit,
+                                                   encoding_delta,
+                                                   literal_pool_p);
+        continue;
+      }
+
+      if (opcode == CBC_DEFINE_VARS)
+      {
+        byte_code_p = parse_print_define_vars (compiled_code_p,
+                                               byte_code_p,
+                                               encoding_limit,
+                                               encoding_delta,
+                                               literal_pool_p);
+        continue;
+      }
+
+      if (opcode == CBC_PUSH_NUMBER_POS_BYTE)
+      {
+        int value = *byte_code_p++;
+        JERRY_DEBUG_MSG (" number:%d\n", value + 1);
+        continue;
+      }
+
+      if (opcode == CBC_PUSH_NUMBER_NEG_BYTE)
+      {
+        int value = *byte_code_p++;
+        JERRY_DEBUG_MSG (" number:%d\n", -(value + 1));
+        continue;
+      }
+    }
+    else
+    {
+      ext_opcode = (cbc_ext_opcode_t) byte_code_p[1];
+      flags = cbc_ext_flags[ext_opcode];
+      JERRY_DEBUG_MSG (" %3d : %s", (int) cbc_offset, cbc_ext_names[ext_opcode]);
+      byte_code_p += 2;
+    }
+
+    if (flags & (CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2))
+    {
+      uint16_t literal_index;
+
+      PARSER_READ_IDENTIFIER_INDEX (literal_index);
+      parse_print_literal (compiled_code_p, literal_index, literal_pool_p);
+    }
+
+    if (flags & CBC_HAS_LITERAL_ARG2)
+    {
+      uint16_t literal_index;
+
+      PARSER_READ_IDENTIFIER_INDEX (literal_index);
+      parse_print_literal (compiled_code_p, literal_index, literal_pool_p);
+
+      if (!(flags & CBC_HAS_LITERAL_ARG))
+      {
+        PARSER_READ_IDENTIFIER_INDEX (literal_index);
+        parse_print_literal (compiled_code_p, literal_index, literal_pool_p);
+      }
+    }
+
+    if (flags & CBC_HAS_BYTE_ARG)
+    {
+      JERRY_DEBUG_MSG (" byte_arg:%d", *byte_code_p);
+      byte_code_p++;
+    }
+
+    if (flags & CBC_HAS_BRANCH_ARG)
+    {
+      size_t branch_offset_length = CBC_BRANCH_OFFSET_LENGTH (opcode);
+      size_t offset = 0;
+
+      if (opcode == CBC_EXT_OPCODE)
+      {
+        branch_offset_length = CBC_BRANCH_OFFSET_LENGTH (ext_opcode);
+      }
+
+      do
+      {
+        offset = (offset << 8) | *byte_code_p++;
+      }
+      while (--branch_offset_length > 0);
+
+      if (CBC_BRANCH_IS_FORWARD (flags))
+      {
+        JERRY_DEBUG_MSG (" offset:%d(->%d)", (int) offset, (int) (cbc_offset + offset));
+      }
+      else
+      {
+        JERRY_DEBUG_MSG (" offset:%d(->%d)", (int) offset, (int) (cbc_offset - offset));
+      }
+    }
+
+    JERRY_DEBUG_MSG ("\n");
+  }
+} /* parse_print_final_cbc */
+
+#undef PARSER_READ_IDENTIFIER_INDEX
+
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+#define PARSER_NEXT_BYTE(page_p, offset) \
+  do { \
+    if (++(offset) >= PARSER_CBC_STREAM_PAGE_SIZE) \
+    { \
+      offset = 0; \
+      page_p = page_p->next_p; \
+    } \
+  } while (0)
+
+#define PARSER_NEXT_BYTE_UPDATE(page_p, offset, real_offset) \
+  do { \
+    page_p->bytes[offset] = real_offset; \
+    if (++(offset) >= PARSER_CBC_STREAM_PAGE_SIZE) \
+    { \
+      offset = 0; \
+      real_offset = 0; \
+      page_p = page_p->next_p; \
+    } \
+  } while (0)
+
+/**
+ * Post processing main function.
+ *
+ * @return compiled code
+ */
+static ecma_compiled_code_t *
+parser_post_processing (parser_context_t *context_p) /**< context */
+{
+  uint16_t literal_one_byte_limit;
+  uint16_t ident_end;
+  uint16_t uninitialized_var_end;
+  uint16_t initialized_var_end;
+  uint16_t const_literal_end;
+  parser_mem_page_t *page_p;
+  parser_mem_page_t *last_page_p;
+  size_t last_position;
+  size_t offset;
+  size_t length;
+  size_t total_size;
+  size_t initializers_length;
+  uint8_t real_offset;
+  uint8_t *byte_code_p;
+  bool needs_uint16_arguments;
+  cbc_opcode_t last_opcode = CBC_EXT_OPCODE;
+  ecma_compiled_code_t *compiled_code_p;
+  jmem_cpointer_t *literal_pool_p;
+  uint8_t *dst_p;
+
+  if ((size_t) context_p->stack_limit + (size_t) context_p->register_count > PARSER_MAXIMUM_STACK_LIMIT)
+  {
+    parser_raise_error (context_p, PARSER_ERR_STACK_LIMIT_REACHED);
+  }
+
+  JERRY_ASSERT (context_p->literal_count <= PARSER_MAXIMUM_NUMBER_OF_LITERALS);
+
+#ifdef JERRY_DEBUGGER
+  if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+      && !(context_p->status_flags & PARSER_DEBUGGER_BREAKPOINT_APPENDED))
+  {
+    /* Always provide at least one breakpoint. */
+    parser_emit_cbc (context_p, CBC_BREAKPOINT_DISABLED);
+    parser_flush_cbc (context_p);
+
+    parser_append_breakpoint_info (context_p, JERRY_DEBUGGER_BREAKPOINT_LIST, context_p->token.line);
+
+    context_p->last_breakpoint_line = context_p->token.line;
+  }
+
+  if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+      && context_p->breakpoint_info_count > 0)
+  {
+    parser_send_breakpoints (context_p, JERRY_DEBUGGER_BREAKPOINT_LIST);
+    JERRY_ASSERT (context_p->breakpoint_info_count == 0);
+  }
+#endif /* JERRY_DEBUGGER */
+
+  parser_copy_identifiers (context_p);
+
+  initializers_length = parser_compute_indicies (context_p,
+                                                 &ident_end,
+                                                 &uninitialized_var_end,
+                                                 &initialized_var_end,
+                                                 &const_literal_end);
+  length = initializers_length;
+
+  if (context_p->literal_count <= CBC_MAXIMUM_SMALL_VALUE)
+  {
+    literal_one_byte_limit = CBC_MAXIMUM_BYTE_VALUE - 1;
+  }
+  else
+  {
+    literal_one_byte_limit = CBC_LOWER_SEVEN_BIT_MASK;
+  }
+
+  last_page_p = context_p->byte_code.last_p;
+  last_position = context_p->byte_code.last_position;
+
+  if (last_position >= PARSER_CBC_STREAM_PAGE_SIZE)
+  {
+    last_page_p = NULL;
+    last_position = 0;
+  }
+
+  page_p = context_p->byte_code.first_p;
+  offset = 0;
+
+  while (page_p != last_page_p || offset < last_position)
+  {
+    uint8_t *opcode_p;
+    uint8_t flags;
+    size_t branch_offset_length;
+
+    opcode_p = page_p->bytes + offset;
+    last_opcode = (cbc_opcode_t) (*opcode_p);
+    PARSER_NEXT_BYTE (page_p, offset);
+    branch_offset_length = CBC_BRANCH_OFFSET_LENGTH (last_opcode);
+    flags = cbc_flags[last_opcode];
+    length++;
+
+    if (last_opcode == CBC_EXT_OPCODE)
+    {
+      cbc_ext_opcode_t ext_opcode;
+
+      ext_opcode = (cbc_ext_opcode_t) page_p->bytes[offset];
+      branch_offset_length = CBC_BRANCH_OFFSET_LENGTH (ext_opcode);
+      flags = cbc_ext_flags[ext_opcode];
+      PARSER_NEXT_BYTE (page_p, offset);
+      length++;
+    }
+
+    while (flags & (CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2))
+    {
+      uint8_t *first_byte = page_p->bytes + offset;
+      size_t literal_index = *first_byte;
+      lexer_literal_t *literal_p;
+
+      PARSER_NEXT_BYTE (page_p, offset);
+      length++;
+
+      literal_index |= ((size_t) page_p->bytes[offset]) << 8;
+      literal_p = PARSER_GET_LITERAL (literal_index);
+
+      if (literal_p->type == LEXER_UNUSED_LITERAL)
+      {
+        /* In a few cases uninitialized literals may have been converted to initialized
+         * literals later. Byte code references to the old (uninitialized) literals
+         * must be redirected to the new instance of the literal. */
+        literal_p = PARSER_GET_LITERAL (literal_p->prop.index);
+
+        JERRY_ASSERT (literal_p != NULL && literal_p->type != LEXER_UNUSED_LITERAL);
+      }
+
+      if (literal_p->prop.index <= literal_one_byte_limit)
+      {
+        *first_byte = (uint8_t) literal_p->prop.index;
+      }
+      else
+      {
+        if (context_p->literal_count <= CBC_MAXIMUM_SMALL_VALUE)
+        {
+          JERRY_ASSERT (literal_index <= CBC_MAXIMUM_SMALL_VALUE);
+          *first_byte = CBC_MAXIMUM_BYTE_VALUE;
+          page_p->bytes[offset] = (uint8_t) (literal_p->prop.index - CBC_MAXIMUM_BYTE_VALUE);
+          length++;
+        }
+        else
+        {
+          JERRY_ASSERT (literal_index <= CBC_MAXIMUM_FULL_VALUE);
+          *first_byte = (uint8_t) ((literal_p->prop.index >> 8) | CBC_HIGHEST_BIT_MASK);
+          page_p->bytes[offset] = (uint8_t) (literal_p->prop.index & 0xff);
+          length++;
+        }
+      }
+      PARSER_NEXT_BYTE (page_p, offset);
+
+      if (flags & CBC_HAS_LITERAL_ARG2)
+      {
+        if (flags & CBC_HAS_LITERAL_ARG)
+        {
+          flags = CBC_HAS_LITERAL_ARG;
+        }
+        else
+        {
+          flags = CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2;
+        }
+      }
+      else
+      {
+        break;
+      }
+    }
+
+    if (flags & CBC_HAS_BYTE_ARG)
+    {
+      /* This argument will be copied without modification. */
+      PARSER_NEXT_BYTE (page_p, offset);
+      length++;
+    }
+
+    if (flags & CBC_HAS_BRANCH_ARG)
+    {
+      bool prefix_zero = true;
+#if PARSER_MAXIMUM_CODE_SIZE <= 65535
+      cbc_opcode_t jump_forward = CBC_JUMP_FORWARD_2;
+#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
+      cbc_opcode_t jump_forward = CBC_JUMP_FORWARD_3;
+#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
+
+      /* The leading zeroes are dropped from the stream.
+       * Although dropping these zeroes for backward
+       * branches are unnecessary, we use the same
+       * code path for simplicity. */
+      JERRY_ASSERT (branch_offset_length > 0 && branch_offset_length <= 3);
+
+      while (--branch_offset_length > 0)
+      {
+        uint8_t byte = page_p->bytes[offset];
+        if (byte > 0 || !prefix_zero)
+        {
+          prefix_zero = false;
+          length++;
+        }
+        else
+        {
+          JERRY_ASSERT (CBC_BRANCH_IS_FORWARD (flags));
+        }
+        PARSER_NEXT_BYTE (page_p, offset);
+      }
+
+      if (last_opcode == jump_forward
+          && prefix_zero
+          && page_p->bytes[offset] == CBC_BRANCH_OFFSET_LENGTH (jump_forward) + 1)
+      {
+        /* Uncoditional jumps which jump right after the instruction
+         * are effectively NOPs. These jumps are removed from the
+         * stream. The 1 byte long CBC_JUMP_FORWARD form marks these
+         * instructions, since this form is constructed during post
+         * processing and cannot be emitted directly. */
+        *opcode_p = CBC_JUMP_FORWARD;
+        length--;
+      }
+      else
+      {
+        /* Other last bytes are always copied. */
+        length++;
+      }
+
+      PARSER_NEXT_BYTE (page_p, offset);
+    }
+  }
+
+  if (!(context_p->status_flags & PARSER_NO_END_LABEL)
+      || !(PARSER_OPCODE_IS_RETURN (last_opcode)))
+  {
+    context_p->status_flags &= ~PARSER_NO_END_LABEL;
+    length++;
+  }
+
+  needs_uint16_arguments = false;
+  total_size = sizeof (cbc_uint8_arguments_t);
+
+  if (context_p->stack_limit > CBC_MAXIMUM_BYTE_VALUE
+      || context_p->register_count > CBC_MAXIMUM_BYTE_VALUE
+      || context_p->literal_count > CBC_MAXIMUM_BYTE_VALUE)
+  {
+    needs_uint16_arguments = true;
+    total_size = sizeof (cbc_uint16_arguments_t);
+  }
+
+  total_size += length + context_p->literal_count * sizeof (jmem_cpointer_t);
+  total_size = JERRY_ALIGNUP (total_size, JMEM_ALIGNMENT);
+
+  compiled_code_p = (ecma_compiled_code_t *) parser_malloc (context_p, total_size);
+
+#ifdef JMEM_STATS
+  jmem_stats_allocate_byte_code_bytes (total_size);
+#endif /* JMEM_STATS */
+
+  byte_code_p = (uint8_t *) compiled_code_p;
+  compiled_code_p->size = (uint16_t) (total_size >> JMEM_ALIGNMENT_LOG);
+  compiled_code_p->refs = 1;
+  compiled_code_p->status_flags = CBC_CODE_FLAGS_FUNCTION;
+
+  if (needs_uint16_arguments)
+  {
+    cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) compiled_code_p;
+
+    args_p->stack_limit = context_p->stack_limit;
+    args_p->argument_end = context_p->argument_count;
+    args_p->register_end = context_p->register_count;
+    args_p->ident_end = ident_end;
+    args_p->const_literal_end = const_literal_end;
+    args_p->literal_end = context_p->literal_count;
+
+    compiled_code_p->status_flags |= CBC_CODE_FLAGS_UINT16_ARGUMENTS;
+    byte_code_p += sizeof (cbc_uint16_arguments_t);
+  }
+  else
+  {
+    cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) compiled_code_p;
+
+    args_p->stack_limit = (uint8_t) context_p->stack_limit;
+    args_p->argument_end = (uint8_t) context_p->argument_count;
+    args_p->register_end = (uint8_t) context_p->register_count;
+    args_p->ident_end = (uint8_t) ident_end;
+    args_p->const_literal_end = (uint8_t) const_literal_end;
+    args_p->literal_end = (uint8_t) context_p->literal_count;
+
+    byte_code_p += sizeof (cbc_uint8_arguments_t);
+  }
+
+  if (context_p->literal_count > CBC_MAXIMUM_SMALL_VALUE)
+  {
+    compiled_code_p->status_flags |= CBC_CODE_FLAGS_FULL_LITERAL_ENCODING;
+  }
+
+  if (context_p->status_flags & PARSER_IS_STRICT)
+  {
+    compiled_code_p->status_flags |= CBC_CODE_FLAGS_STRICT_MODE;
+  }
+
+  if (context_p->status_flags & PARSER_ARGUMENTS_NEEDED)
+  {
+    compiled_code_p->status_flags |= CBC_CODE_FLAGS_ARGUMENTS_NEEDED;
+    /* Arguments is stored in the lexical environment. */
+    context_p->status_flags |= PARSER_LEXICAL_ENV_NEEDED;
+  }
+
+  if (!(context_p->status_flags & PARSER_LEXICAL_ENV_NEEDED))
+  {
+    compiled_code_p->status_flags |= CBC_CODE_FLAGS_LEXICAL_ENV_NOT_NEEDED;
+  }
+
+  literal_pool_p = (jmem_cpointer_t *) byte_code_p;
+  byte_code_p += context_p->literal_count * sizeof (jmem_cpointer_t);
+
+  dst_p = parser_generate_initializers (context_p,
+                                        byte_code_p,
+                                        literal_pool_p,
+                                        uninitialized_var_end,
+                                        initialized_var_end,
+                                        const_literal_end,
+                                        literal_one_byte_limit);
+
+  JERRY_ASSERT (dst_p == byte_code_p + initializers_length);
+
+  page_p = context_p->byte_code.first_p;
+  offset = 0;
+  real_offset = 0;
+
+  while (page_p != last_page_p || offset < last_position)
+  {
+    uint8_t flags;
+    uint8_t *opcode_p;
+    uint8_t *branch_mark_p;
+    cbc_opcode_t opcode;
+    size_t branch_offset_length;
+
+    opcode_p = dst_p;
+    branch_mark_p = page_p->bytes + offset;
+    opcode = (cbc_opcode_t) (*branch_mark_p);
+    branch_offset_length = CBC_BRANCH_OFFSET_LENGTH (opcode);
+
+    if (opcode == CBC_JUMP_FORWARD)
+    {
+      /* These opcodes are deleted from the stream. */
+#if PARSER_MAXIMUM_CODE_SIZE <= 65535
+      size_t counter = 3;
+#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
+      size_t counter = 4;
+#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
+
+      do
+      {
+        PARSER_NEXT_BYTE_UPDATE (page_p, offset, real_offset);
+      }
+      while (--counter > 0);
+
+      continue;
+    }
+
+    /* Storing the opcode */
+    *dst_p++ = opcode;
+    real_offset++;
+    PARSER_NEXT_BYTE_UPDATE (page_p, offset, real_offset);
+    flags = cbc_flags[opcode];
+
+#ifdef JERRY_DEBUGGER
+    if (opcode == CBC_BREAKPOINT_DISABLED)
+    {
+      uint32_t bp_offset = (uint32_t) (((uint8_t *) dst_p) - ((uint8_t *) compiled_code_p) - 1);
+      parser_append_breakpoint_info (context_p, JERRY_DEBUGGER_BREAKPOINT_OFFSET_LIST, bp_offset);
+    }
+#endif /* JERRY_DEBUGGER */
+
+    if (opcode == CBC_EXT_OPCODE)
+    {
+      cbc_ext_opcode_t ext_opcode;
+
+      ext_opcode = (cbc_ext_opcode_t) page_p->bytes[offset];
+      flags = cbc_ext_flags[ext_opcode];
+      branch_offset_length = CBC_BRANCH_OFFSET_LENGTH (ext_opcode);
+
+      /* Storing the extended opcode */
+      *dst_p++ = ext_opcode;
+      opcode_p++;
+      real_offset++;
+      PARSER_NEXT_BYTE_UPDATE (page_p, offset, real_offset);
+    }
+
+    if (flags & CBC_HAS_BRANCH_ARG)
+    {
+      *branch_mark_p |= CBC_HIGHEST_BIT_MASK;
+    }
+
+    /* Only literal and call arguments can be combined. */
+    JERRY_ASSERT (!(flags & CBC_HAS_BRANCH_ARG)
+                   || !(flags & (CBC_HAS_BYTE_ARG | CBC_HAS_LITERAL_ARG)));
+
+    while (flags & (CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2))
+    {
+      uint8_t first_byte = page_p->bytes[offset];
+
+      *dst_p++ = first_byte;
+      real_offset++;
+      PARSER_NEXT_BYTE_UPDATE (page_p, offset, real_offset);
+
+      if (first_byte > literal_one_byte_limit)
+      {
+        *dst_p++ = page_p->bytes[offset];
+        real_offset++;
+      }
+      PARSER_NEXT_BYTE_UPDATE (page_p, offset, real_offset);
+
+      if (flags & CBC_HAS_LITERAL_ARG2)
+      {
+        if (flags & CBC_HAS_LITERAL_ARG)
+        {
+          flags = CBC_HAS_LITERAL_ARG;
+        }
+        else
+        {
+          flags = CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2;
+        }
+      }
+      else
+      {
+        break;
+      }
+    }
+
+    if (flags & CBC_HAS_BYTE_ARG)
+    {
+      /* This argument will be copied without modification. */
+      *dst_p++ = page_p->bytes[offset];
+      real_offset++;
+      PARSER_NEXT_BYTE_UPDATE (page_p, offset, real_offset);
+    }
+
+    if (flags & CBC_HAS_BRANCH_ARG)
+    {
+      bool prefix_zero = true;
+
+      /* The leading zeroes are dropped from the stream. */
+      JERRY_ASSERT (branch_offset_length > 0 && branch_offset_length <= 3);
+
+      while (--branch_offset_length > 0)
+      {
+        uint8_t byte = page_p->bytes[offset];
+        if (byte > 0 || !prefix_zero)
+        {
+          prefix_zero = false;
+          *dst_p++ = page_p->bytes[offset];
+          real_offset++;
+        }
+        else
+        {
+          /* When a leading zero is dropped, the branch
+           * offset length must be decreased as well. */
+          (*opcode_p)--;
+        }
+        PARSER_NEXT_BYTE_UPDATE (page_p, offset, real_offset);
+      }
+
+      *dst_p++ = page_p->bytes[offset];
+      real_offset++;
+      PARSER_NEXT_BYTE_UPDATE (page_p, offset, real_offset);
+    }
+  }
+
+#ifdef JERRY_DEBUGGER
+  if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+      && context_p->breakpoint_info_count > 0)
+  {
+    parser_send_breakpoints (context_p, JERRY_DEBUGGER_BREAKPOINT_OFFSET_LIST);
+    JERRY_ASSERT (context_p->breakpoint_info_count == 0);
+  }
+#endif /* JERRY_DEBUGGER */
+
+  if (!(context_p->status_flags & PARSER_NO_END_LABEL))
+  {
+    *dst_p++ = CBC_RETURN_WITH_BLOCK;
+  }
+  JERRY_ASSERT (dst_p == byte_code_p + length);
+
+  parse_update_branches (context_p,
+                         byte_code_p + initializers_length);
+
+  parser_cbc_stream_free (&context_p->byte_code);
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  if (context_p->is_show_opcodes)
+  {
+    parser_list_iterator_t literal_iterator;
+    lexer_literal_t *literal_p;
+
+    parse_print_final_cbc (compiled_code_p, &context_p->literal_pool, length);
+    JERRY_DEBUG_MSG ("\nByte code size: %d bytes\n", (int) length);
+    context_p->total_byte_code_size += (uint32_t) length;
+
+    parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
+    while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)))
+    {
+      if ((literal_p->type == LEXER_IDENT_LITERAL || literal_p->type == LEXER_STRING_LITERAL)
+          && !(literal_p->status_flags & LEXER_FLAG_SOURCE_PTR))
+      {
+        jmem_heap_free_block ((void *) literal_p->u.char_p, literal_p->prop.length);
+      }
+    }
+  }
+#else /* !PARSER_DUMP_BYTE_CODE */
+  if (context_p->status_flags & PARSER_HAS_LATE_LIT_INIT)
+  {
+    parser_list_iterator_t literal_iterator;
+    lexer_literal_t *literal_p;
+
+    parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
+    while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)))
+    {
+      if (literal_p->status_flags & LEXER_FLAG_LATE_INIT)
+      {
+        uint32_t source_data = literal_p->u.source_data;
+        const uint8_t *char_p = context_p->source_end_p - (source_data & 0xfffff);
+        jmem_cpointer_t lit_cp = ecma_find_or_create_literal_string (char_p,
+                                                                     source_data >> 20);
+        literal_pool_p[literal_p->prop.index] = lit_cp;
+      }
+    }
+  }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+  if ((context_p->status_flags & PARSER_ARGUMENTS_NEEDED)
+      && !(context_p->status_flags & PARSER_IS_STRICT))
+  {
+    parser_list_iterator_t literal_iterator;
+    uint16_t argument_count = 0;
+
+    parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
+    while (argument_count < context_p->argument_count)
+    {
+      lexer_literal_t *literal_p;
+      literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator);
+
+      JERRY_ASSERT (literal_p != NULL);
+
+      if (!(literal_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT))
+      {
+        continue;
+      }
+
+      /* All arguments must be moved to initialized registers. */
+      if (literal_p->type == LEXER_UNUSED_LITERAL)
+      {
+        if (literal_p->u.char_p == NULL)
+        {
+          literal_pool_p[argument_count] = JMEM_CP_NULL;
+          argument_count++;
+          continue;
+        }
+
+        literal_p = PARSER_GET_LITERAL (literal_p->prop.index);
+
+        JERRY_ASSERT (literal_p != NULL);
+      }
+
+      JERRY_ASSERT (literal_p->type == LEXER_IDENT_LITERAL
+                    && (literal_p->status_flags & LEXER_FLAG_VAR));
+
+      JERRY_ASSERT (argument_count < literal_p->prop.index);
+
+      literal_pool_p[argument_count] = literal_pool_p[literal_p->prop.index];
+      argument_count++;
+    }
+  }
+
+  if (context_p->status_flags & PARSER_NAMED_FUNCTION_EXP)
+  {
+    ECMA_SET_NON_NULL_POINTER (literal_pool_p[const_literal_end],
+                               compiled_code_p);
+  }
+
+#ifdef JERRY_DEBUGGER
+  if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+  {
+    jerry_debugger_send_function_cp (JERRY_DEBUGGER_BYTE_CODE_CP, compiled_code_p);
+  }
+#endif /* JERRY_DEBUGGER */
+
+  return compiled_code_p;
+} /* parser_post_processing */
+
+#undef PARSER_NEXT_BYTE
+#undef PARSER_NEXT_BYTE_UPDATE
+
+/**
+ * Free identifiers and literals.
+ */
+static void
+parser_free_literals (parser_list_t *literal_pool_p) /**< literals */
+{
+  parser_list_iterator_t literal_iterator;
+  lexer_literal_t *literal_p;
+
+  parser_list_iterator_init (literal_pool_p, &literal_iterator);
+  while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)) != NULL)
+  {
+    util_free_literal (literal_p);
+  }
+
+  parser_list_free (literal_pool_p);
+} /* parser_free_literals */
+
+/**
+ * Parse and compile EcmaScript source code
+ *
+ * Note: source must be a valid UTF-8 string
+ *
+ * @return compiled code
+ */
+static ecma_compiled_code_t *
+parser_parse_source (const uint8_t *source_p, /**< valid UTF-8 source code */
+                     size_t size, /**< size of the source code */
+                     int strict_mode, /**< strict mode */
+                     parser_error_location_t *error_location_p) /**< error location */
+{
+  parser_context_t context;
+  ecma_compiled_code_t *compiled_code;
+
+  context.error = PARSER_ERR_NO_ERROR;
+  context.allocated_buffer_p = NULL;
+
+  if (error_location_p != NULL)
+  {
+    error_location_p->error = PARSER_ERR_NO_ERROR;
+  }
+
+  context.status_flags = PARSER_NO_REG_STORE | PARSER_LEXICAL_ENV_NEEDED | PARSER_ARGUMENTS_NOT_NEEDED;
+  context.stack_depth = 0;
+  context.stack_limit = 0;
+  context.last_context_p = NULL;
+  context.last_statement.current_p = NULL;
+
+  if (strict_mode)
+  {
+    context.status_flags |= PARSER_IS_STRICT;
+  }
+
+  context.source_p = source_p;
+  context.source_end_p = source_p + size;
+  context.line = 1;
+  context.column = 1;
+
+  context.last_cbc_opcode = PARSER_CBC_UNAVAILABLE;
+
+  context.argument_count = 0;
+  context.register_count = 0;
+  context.literal_count = 0;
+
+  parser_cbc_stream_init (&context.byte_code);
+  context.byte_code_size = 0;
+  parser_list_init (&context.literal_pool,
+                    sizeof (lexer_literal_t),
+                    (uint32_t) ((128 - sizeof (void *)) / sizeof (lexer_literal_t)));
+  parser_stack_init (&context);
+
+#ifndef JERRY_NDEBUG
+  context.context_stack_depth = 0;
+#endif /* !JERRY_NDEBUG */
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  context.is_show_opcodes = (JERRY_CONTEXT (jerry_init_flags) & ECMA_INIT_SHOW_OPCODES);
+  context.total_byte_code_size = 0;
+
+  if (context.is_show_opcodes)
+  {
+    JERRY_DEBUG_MSG ("\n--- Script parsing start ---\n\n");
+  }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+#ifdef JERRY_DEBUGGER
+  context.breakpoint_info_count = 0;
+#endif /* JERRY_DEBUGGER */
+
+  PARSER_TRY (context.try_buffer)
+  {
+    /* Pushing a dummy value ensures the stack is never empty.
+     * This simplifies the stack management routines. */
+    parser_stack_push_uint8 (&context, CBC_MAXIMUM_BYTE_VALUE);
+    /* The next token must always be present to make decisions
+     * in the parser. Therefore when a token is consumed, the
+     * lexer_next_token() must be immediately called. */
+    lexer_next_token (&context);
+
+    parser_parse_statements (&context);
+
+    /* When the parsing is successful, only the
+     * dummy value can be remained on the stack. */
+    JERRY_ASSERT (context.stack_top_uint8 == CBC_MAXIMUM_BYTE_VALUE
+                  && context.stack.last_position == 1
+                  && context.stack.first_p != NULL
+                  && context.stack.first_p->next_p == NULL
+                  && context.stack.last_p == NULL);
+    JERRY_ASSERT (context.last_statement.current_p == NULL);
+
+    JERRY_ASSERT (context.last_cbc_opcode == PARSER_CBC_UNAVAILABLE);
+    JERRY_ASSERT (context.allocated_buffer_p == NULL);
+
+    compiled_code = parser_post_processing (&context);
+    parser_list_free (&context.literal_pool);
+
+#ifdef PARSER_DUMP_BYTE_CODE
+    if (context.is_show_opcodes)
+    {
+      JERRY_DEBUG_MSG ("\nScript parsing successfully completed. Total byte code size: %d bytes\n",
+                       (int) context.total_byte_code_size);
+    }
+#endif /* PARSER_DUMP_BYTE_CODE */
+  }
+  PARSER_CATCH
+  {
+    if (context.last_statement.current_p != NULL)
+    {
+      parser_free_jumps (context.last_statement);
+    }
+
+    if (context.allocated_buffer_p != NULL)
+    {
+      parser_free_local (context.allocated_buffer_p,
+                         context.allocated_buffer_size);
+    }
+
+    if (error_location_p != NULL)
+    {
+      error_location_p->error = context.error;
+      error_location_p->line = context.token.line;
+      error_location_p->column = context.token.column;
+    }
+
+    compiled_code = NULL;
+    parser_free_literals (&context.literal_pool);
+    parser_cbc_stream_free (&context.byte_code);
+  }
+  PARSER_TRY_END
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  if (context.is_show_opcodes)
+  {
+    JERRY_DEBUG_MSG ("\n--- Script parsing end ---\n\n");
+  }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+  parser_stack_free (&context);
+
+  return compiled_code;
+} /* parser_parse_source */
+
+/**
+ * Parse function code
+ *
+ * @return compiled code
+ */
+ecma_compiled_code_t *
+parser_parse_function (parser_context_t *context_p, /**< context */
+                       uint32_t status_flags) /**< extra status flags */
+{
+  parser_saved_context_t saved_context;
+  ecma_compiled_code_t *compiled_code_p;
+
+  JERRY_ASSERT (context_p->last_cbc_opcode == PARSER_CBC_UNAVAILABLE);
+
+#ifdef JERRY_DEBUGGER
+  if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED
+      && context_p->breakpoint_info_count > 0)
+  {
+    parser_send_breakpoints (context_p, JERRY_DEBUGGER_BREAKPOINT_LIST);
+    context_p->breakpoint_info_count = 0;
+  }
+#endif /* JERRY_DEBUGGER */
+
+  /* Save private part of the context. */
+
+  saved_context.status_flags = context_p->status_flags;
+  saved_context.stack_depth = context_p->stack_depth;
+  saved_context.stack_limit = context_p->stack_limit;
+  saved_context.prev_context_p = context_p->last_context_p;
+  saved_context.last_statement = context_p->last_statement;
+
+  saved_context.argument_count = context_p->argument_count;
+  saved_context.register_count = context_p->register_count;
+  saved_context.literal_count = context_p->literal_count;
+
+  saved_context.byte_code = context_p->byte_code;
+  saved_context.byte_code_size = context_p->byte_code_size;
+  saved_context.literal_pool_data = context_p->literal_pool.data;
+
+#ifndef JERRY_NDEBUG
+  saved_context.context_stack_depth = context_p->context_stack_depth;
+#endif /* !JERRY_NDEBUG */
+
+  /* Reset private part of the context. */
+
+  JERRY_ASSERT (status_flags & PARSER_IS_FUNCTION);
+
+  context_p->status_flags &= PARSER_IS_STRICT;
+  context_p->status_flags |= status_flags;
+  context_p->stack_depth = 0;
+  context_p->stack_limit = 0;
+  context_p->last_context_p = &saved_context;
+  context_p->last_statement.current_p = NULL;
+
+  context_p->argument_count = 0;
+  context_p->register_count = 0;
+  context_p->literal_count = 0;
+
+  parser_cbc_stream_init (&context_p->byte_code);
+  context_p->byte_code_size = 0;
+  parser_list_reset (&context_p->literal_pool);
+
+#ifndef JERRY_NDEBUG
+  context_p->context_stack_depth = 0;
+#endif /* !JERRY_NDEBUG */
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  if (context_p->is_show_opcodes)
+  {
+    JERRY_DEBUG_MSG ("\n--- Function parsing start ---\n\n");
+  }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+#ifdef JERRY_DEBUGGER
+  parser_line_counter_t debugger_line = context_p->token.line;
+  parser_line_counter_t debugger_column = context_p->token.column;
+#endif /* JERRY_DEBUGGER */
+
+  lexer_next_token (context_p);
+
+  if (context_p->status_flags & PARSER_IS_FUNC_EXPRESSION
+      && context_p->token.type == LEXER_LITERAL
+      && context_p->token.lit_location.type == LEXER_IDENT_LITERAL)
+  {
+    lexer_construct_literal_object (context_p,
+                                    &context_p->token.lit_location,
+                                    LEXER_IDENT_LITERAL);
+
+#ifdef JERRY_DEBUGGER
+    if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+    {
+      jerry_debugger_send_string (JERRY_DEBUGGER_FUNCTION_NAME,
+                                  context_p->lit_object.literal_p->u.char_p,
+                                  context_p->lit_object.literal_p->prop.length);
+    }
+#endif /* JERRY_DEBUGGER */
+
+    /* The arguments object is created later than the binding to the
+     * function expression name, so there is no need to assign special flags. */
+    if (context_p->lit_object.type != LEXER_LITERAL_OBJECT_ARGUMENTS)
+    {
+      uint8_t lexer_flags = LEXER_FLAG_VAR | LEXER_FLAG_INITIALIZED | LEXER_FLAG_FUNCTION_NAME;
+      context_p->lit_object.literal_p->status_flags |= lexer_flags;
+    }
+
+    if (context_p->token.literal_is_reserved
+        || context_p->lit_object.type != LEXER_LITERAL_OBJECT_ANY)
+    {
+      context_p->status_flags |= PARSER_HAS_NON_STRICT_ARG;
+    }
+
+    lexer_next_token (context_p);
+  }
+
+#ifdef JERRY_DEBUGGER
+  if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+      && jerry_debugger_send_parse_function (debugger_line, debugger_column))
+  {
+    /* This option has a high memory and performance costs,
+     * but it is necessary for executing eval operations by the debugger. */
+    context_p->status_flags |= PARSER_LEXICAL_ENV_NEEDED | PARSER_NO_REG_STORE;
+  }
+#endif /* JERRY_DEBUGGER */
+
+  if (context_p->token.type != LEXER_LEFT_PAREN)
+  {
+    parser_raise_error (context_p, PARSER_ERR_ARGUMENT_LIST_EXPECTED);
+  }
+
+  lexer_next_token (context_p);
+
+  /* Argument parsing. */
+  if (context_p->token.type != LEXER_RIGHT_PAREN)
+  {
+    while (true)
+    {
+      uint16_t literal_count = context_p->literal_count;
+
+      if (context_p->token.type != LEXER_LITERAL
+          || context_p->token.lit_location.type != LEXER_IDENT_LITERAL)
+      {
+        parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_EXPECTED);
+      }
+
+      lexer_construct_literal_object (context_p,
+                                      &context_p->token.lit_location,
+                                      LEXER_IDENT_LITERAL);
+
+      if (literal_count == context_p->literal_count
+          || context_p->token.literal_is_reserved
+          || context_p->lit_object.type != LEXER_LITERAL_OBJECT_ANY)
+      {
+        context_p->status_flags |= PARSER_HAS_NON_STRICT_ARG;
+      }
+
+      if (context_p->lit_object.type == LEXER_LITERAL_OBJECT_ARGUMENTS)
+      {
+        uint8_t literal_status_flags = context_p->lit_object.literal_p->status_flags;
+
+        literal_status_flags = (uint8_t) (literal_status_flags & ~LEXER_FLAG_NO_REG_STORE);
+        context_p->lit_object.literal_p->status_flags = literal_status_flags;
+
+        context_p->status_flags |= PARSER_ARGUMENTS_NOT_NEEDED;
+        context_p->status_flags &= ~(PARSER_LEXICAL_ENV_NEEDED | PARSER_ARGUMENTS_NEEDED);
+      }
+
+      if (context_p->literal_count == literal_count)
+      {
+        lexer_literal_t *literal_p;
+
+        if (context_p->literal_count >= PARSER_MAXIMUM_NUMBER_OF_LITERALS)
+        {
+          parser_raise_error (context_p, PARSER_ERR_LITERAL_LIMIT_REACHED);
+        }
+
+        literal_p = (lexer_literal_t *) parser_list_append (context_p, &context_p->literal_pool);
+        *literal_p = *context_p->lit_object.literal_p;
+
+        literal_p->status_flags &= LEXER_FLAG_SOURCE_PTR;
+        literal_p->status_flags |= LEXER_FLAG_VAR | LEXER_FLAG_INITIALIZED | LEXER_FLAG_FUNCTION_ARGUMENT;
+
+        context_p->literal_count++;
+
+        /* There cannot be references from the byte code to these literals
+         * since no byte code has been emitted yet. Therefore there is no
+         * need to set the index field. */
+        context_p->lit_object.literal_p->type = LEXER_UNUSED_LITERAL;
+
+        /* Only the LEXER_FLAG_FUNCTION_ARGUMENT flag is kept. */
+        context_p->lit_object.literal_p->status_flags &= LEXER_FLAG_FUNCTION_ARGUMENT;
+        context_p->lit_object.literal_p->u.char_p = NULL;
+      }
+      else
+      {
+        uint8_t lexer_flags = LEXER_FLAG_VAR | LEXER_FLAG_INITIALIZED | LEXER_FLAG_FUNCTION_ARGUMENT;
+        context_p->lit_object.literal_p->status_flags |= lexer_flags;
+      }
+
+      context_p->argument_count++;
+      if (context_p->argument_count >= PARSER_MAXIMUM_NUMBER_OF_REGISTERS)
+      {
+        parser_raise_error (context_p, PARSER_ERR_REGISTER_LIMIT_REACHED);
+      }
+
+      lexer_next_token (context_p);
+
+      if (context_p->token.type != LEXER_COMMA)
+      {
+        break;
+      }
+
+      lexer_next_token (context_p);
+    }
+  }
+
+  if (context_p->token.type != LEXER_RIGHT_PAREN)
+  {
+    parser_raise_error (context_p, PARSER_ERR_RIGHT_PAREN_EXPECTED);
+  }
+
+  lexer_next_token (context_p);
+
+  context_p->register_count = context_p->argument_count;
+
+  if ((context_p->status_flags & PARSER_IS_PROPERTY_GETTER)
+      && context_p->argument_count != 0)
+  {
+    parser_raise_error (context_p, PARSER_ERR_NO_ARGUMENTS_EXPECTED);
+  }
+
+  if ((context_p->status_flags & PARSER_IS_PROPERTY_SETTER)
+      && context_p->argument_count != 1)
+  {
+    parser_raise_error (context_p, PARSER_ERR_ONE_ARGUMENT_EXPECTED);
+  }
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  if (context_p->is_show_opcodes
+      && (context_p->status_flags & PARSER_HAS_NON_STRICT_ARG))
+  {
+    JERRY_DEBUG_MSG ("  Note: legacy (non-strict) argument definition\n\n");
+  }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+  if (context_p->token.type != LEXER_LEFT_BRACE)
+  {
+    parser_raise_error (context_p, PARSER_ERR_LEFT_BRACE_EXPECTED);
+  }
+
+  lexer_next_token (context_p);
+  parser_parse_statements (context_p);
+  compiled_code_p = parser_post_processing (context_p);
+
+#ifdef PARSER_DUMP_BYTE_CODE
+  if (context_p->is_show_opcodes)
+  {
+    JERRY_DEBUG_MSG ("\n--- Function parsing end ---\n\n");
+  }
+#endif /* PARSER_DUMP_BYTE_CODE */
+
+  parser_list_free (&context_p->literal_pool);
+
+  /* Restore private part of the context. */
+
+  JERRY_ASSERT (context_p->last_cbc_opcode == PARSER_CBC_UNAVAILABLE);
+
+  context_p->status_flags = saved_context.status_flags;
+  context_p->stack_depth = saved_context.stack_depth;
+  context_p->stack_limit = saved_context.stack_limit;
+  context_p->last_context_p = saved_context.prev_context_p;
+  context_p->last_statement = saved_context.last_statement;
+
+  context_p->argument_count = saved_context.argument_count;
+  context_p->register_count = saved_context.register_count;
+  context_p->literal_count = saved_context.literal_count;
+
+  context_p->byte_code = saved_context.byte_code;
+  context_p->byte_code_size = saved_context.byte_code_size;
+  context_p->literal_pool.data = saved_context.literal_pool_data;
+
+#ifndef JERRY_NDEBUG
+  context_p->context_stack_depth = saved_context.context_stack_depth;
+#endif /* !JERRY_NDEBUG */
+
+  return compiled_code_p;
+} /* parser_parse_function */
+
+/**
+ * Raise a parse error
+ */
+void
+parser_raise_error (parser_context_t *context_p, /**< context */
+                    parser_error_t error) /**< error code */
+{
+  parser_saved_context_t *saved_context_p = context_p->last_context_p;
+
+  while (saved_context_p != NULL)
+  {
+    parser_cbc_stream_free (&saved_context_p->byte_code);
+
+    /* First the current literal pool is freed, and then it is replaced
+     * by the literal pool coming from the saved context. Since literals
+     * are not used anymore, this is a valid replacement. The last pool
+     * is freed by parser_parse_source. */
+
+    parser_free_literals (&context_p->literal_pool);
+    context_p->literal_pool.data = saved_context_p->literal_pool_data;
+
+    if (saved_context_p->last_statement.current_p != NULL)
+    {
+      parser_free_jumps (saved_context_p->last_statement);
+    }
+
+    saved_context_p = saved_context_p->prev_context_p;
+  }
+
+  context_p->error = error;
+  PARSER_THROW (context_p->try_buffer);
+  /* Should never been reached. */
+  JERRY_ASSERT (0);
+} /* parser_raise_error */
+
+#ifdef JERRY_DEBUGGER
+
+/**
+ * Append a breakpoint info.
+ */
+void
+parser_append_breakpoint_info (parser_context_t *context_p, /**< context */
+                               jerry_debugger_header_type_t type, /**< message type */
+                               uint32_t value) /**< line or offset of the breakpoint */
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+  context_p->status_flags |= PARSER_DEBUGGER_BREAKPOINT_APPENDED;
+
+  if (context_p->breakpoint_info_count >= JERRY_DEBUGGER_SEND_MAX (parser_list_t))
+  {
+    parser_send_breakpoints (context_p, type);
+  }
+
+  context_p->breakpoint_info[context_p->breakpoint_info_count].value = value;
+  context_p->breakpoint_info_count = (uint16_t) (context_p->breakpoint_info_count + 1);
+} /* parser_append_breakpoint_info */
+
+/**
+ * Send current breakpoint list.
+ */
+void
+parser_send_breakpoints (parser_context_t *context_p, /**< context */
+                         jerry_debugger_header_type_t type) /**< message type */
+{
+  JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+  JERRY_ASSERT (context_p->breakpoint_info_count > 0);
+
+  jerry_debugger_send_data (type,
+                            context_p->breakpoint_info,
+                            context_p->breakpoint_info_count * sizeof (parser_breakpoint_info_t));
+
+  context_p->breakpoint_info_count = 0;
+} /* parser_send_breakpoints */
+
+#endif /* JERRY_DEBUGGER */
+
+#endif /* JERRY_JS_PARSER */
+
+/**
+ * Parse EcamScript source code
+ *
+ * Note:
+ *      returned value must be freed with ecma_free_value
+ *
+ * @return true - if success
+ *         syntax error - otherwise
+ */
+ecma_value_t
+parser_parse_script (const uint8_t *source_p, /**< source code */
+                     size_t size, /**< size of the source code */
+                     bool is_strict, /**< strict mode */
+                     ecma_compiled_code_t **bytecode_data_p) /**< [out] JS bytecode */
+{
+#if JERRY_JS_PARSER
+  parser_error_location_t parser_error;
+
+#ifdef JERRY_DEBUGGER
+  if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+  {
+    jerry_debugger_send_string (JERRY_DEBUGGER_SOURCE_CODE, source_p, size);
+  }
+#endif /* JERRY_DEBUGGER */
+
+  *bytecode_data_p = parser_parse_source (source_p, size, is_strict, &parser_error);
+
+  if (!*bytecode_data_p)
+  {
+#ifdef JERRY_DEBUGGER
+    if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+    {
+      jerry_debugger_send_type (JERRY_DEBUGGER_PARSE_ERROR);
+    }
+#endif /* JERRY_DEBUGGER */
+
+    if (parser_error.error == PARSER_ERR_OUT_OF_MEMORY)
+    {
+      /* It is unlikely that memory can be allocated in an out-of-memory
+       * situation. However, a simple value can still be thrown. */
+      return ecma_make_error_value (ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL));
+    }
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+    const lit_utf8_byte_t *err_bytes_p = (const lit_utf8_byte_t *) parser_error_to_string (parser_error.error);
+    lit_utf8_size_t err_bytes_size = lit_zt_utf8_string_size (err_bytes_p);
+
+    ecma_string_t *err_str_p = ecma_new_ecma_string_from_utf8 (err_bytes_p, err_bytes_size);
+    ecma_value_t err_str_val = ecma_make_string_value (err_str_p);
+    ecma_value_t line_str_val = ecma_make_uint32_value (parser_error.line);
+    ecma_value_t col_str_val = ecma_make_uint32_value (parser_error.column);
+
+    ecma_value_t error_value = ecma_raise_standard_error_with_format (ECMA_ERROR_SYNTAX,
+                                                                      "% [line: %, column: %]",
+                                                                      err_str_val,
+                                                                      line_str_val,
+                                                                      col_str_val);
+
+    ecma_free_value (col_str_val);
+    ecma_free_value (line_str_val);
+    ecma_free_value (err_str_val);
+
+    return error_value;
+#else /* !JERRY_ENABLE_ERROR_MESSAGES */
+    return ecma_raise_syntax_error ("");
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+  }
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+#else /* !JERRY_JS_PARSER */
+  JERRY_UNUSED (source_p);
+  JERRY_UNUSED (size);
+  JERRY_UNUSED (is_strict);
+  JERRY_UNUSED (bytecode_data_p);
+
+  return ecma_raise_syntax_error (ECMA_ERR_MSG ("The parser has been disabled."));
+#endif /* JERRY_JS_PARSER */
+} /* parser_parse_script */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/parser/js/js-parser.h b/deps/jerry/jerry-core/parser/js/js-parser.h
new file mode 100644 (file)
index 0000000..a75fb8d
--- /dev/null
@@ -0,0 +1,142 @@
+/* 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.
+ */
+
+#ifndef JS_PARSER_H
+#define JS_PARSER_H
+
+#include "ecma-globals.h"
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup jsparser JavaScript
+ * @{
+ *
+ * \addtogroup jsparser_parser Parser
+ * @{
+ */
+
+/**
+ * Error codes.
+ */
+typedef enum
+{
+  PARSER_ERR_NO_ERROR,                                /**< no error */
+
+  PARSER_ERR_OUT_OF_MEMORY,                           /**< out of memory */
+  PARSER_ERR_LITERAL_LIMIT_REACHED,                   /**< maximum number of literals reached */
+  PARSER_ERR_ARGUMENT_LIMIT_REACHED,                  /**< maximum number of function arguments reached */
+  PARSER_ERR_STACK_LIMIT_REACHED,                     /**< maximum function stack size reached */
+  PARSER_ERR_REGISTER_LIMIT_REACHED,                  /**< maximum register size reached */
+
+  PARSER_ERR_INVALID_CHARACTER,                       /**< unexpected character */
+  PARSER_ERR_INVALID_HEX_DIGIT,                       /**< invalid hexadecimal digit */
+  PARSER_ERR_INVALID_ESCAPE_SEQUENCE,                 /**< invalid escape sequence */
+  PARSER_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE,         /**< invalid unicode escape sequence */
+  PARSER_ERR_INVALID_IDENTIFIER_START,                /**< character cannot be start of an identifier */
+  PARSER_ERR_INVALID_IDENTIFIER_PART,                 /**< character cannot be part of an identifier */
+
+  PARSER_ERR_INVALID_NUMBER,                          /**< invalid number literal */
+  PARSER_ERR_MISSING_EXPONENT,                        /**< missing exponent */
+  PARSER_ERR_IDENTIFIER_AFTER_NUMBER,                 /**< identifier start after number */
+
+  PARSER_ERR_INVALID_REGEXP,                          /**< invalid regular expression */
+  PARSER_ERR_UNKNOWN_REGEXP_FLAG,                     /**< unknown regexp flag */
+  PARSER_ERR_DUPLICATED_REGEXP_FLAG,                  /**< duplicated regexp flag */
+  PARSER_ERR_UNSUPPORTED_REGEXP,                      /**< regular expression is not supported */
+
+  PARSER_ERR_IDENTIFIER_TOO_LONG,                     /**< too long identifier */
+  PARSER_ERR_STRING_TOO_LONG,                         /**< too long string literal */
+  PARSER_ERR_NUMBER_TOO_LONG,                         /**< too long number literal */
+  PARSER_ERR_REGEXP_TOO_LONG,                         /**< too long regexp literal */
+
+  PARSER_ERR_UNTERMINATED_MULTILINE_COMMENT,          /**< unterminated multiline comment */
+  PARSER_ERR_UNTERMINATED_STRING,                     /**< unterminated string literal */
+  PARSER_ERR_UNTERMINATED_REGEXP,                     /**< unterminated regexp literal */
+
+  PARSER_ERR_NEWLINE_NOT_ALLOWED,                     /**< newline is not allowed */
+  PARSER_ERR_OCTAL_NUMBER_NOT_ALLOWED,                /**< octal numbers are not allowed in strict mode */
+  PARSER_ERR_OCTAL_ESCAPE_NOT_ALLOWED,                /**< octal escape sequences are not allowed in strict mode */
+  PARSER_ERR_STRICT_IDENT_NOT_ALLOWED,                /**< identifier name is reserved in strict mode */
+  PARSER_ERR_EVAL_NOT_ALLOWED,                        /**< eval is not allowed here in strict mode */
+  PARSER_ERR_ARGUMENTS_NOT_ALLOWED,                   /**< arguments is not allowed here in strict mode */
+  PARSER_ERR_DELETE_IDENT_NOT_ALLOWED,                /**< identifier delete is not allowed in strict mode */
+  PARSER_ERR_EVAL_CANNOT_ASSIGNED,                    /**< eval cannot be assigned in strict mode */
+  PARSER_ERR_ARGUMENTS_CANNOT_ASSIGNED,               /**< arguments cannot be assigned in strict mode */
+  PARSER_ERR_WITH_NOT_ALLOWED,                        /**< with statement is not allowed in strict mode */
+  PARSER_ERR_MULTIPLE_DEFAULTS_NOT_ALLOWED,           /**< multiple default cases are not allowed */
+  PARSER_ERR_DEFAULT_NOT_IN_SWITCH,                   /**< default statement is not in switch block */
+  PARSER_ERR_CASE_NOT_IN_SWITCH,                      /**< case statement is not in switch block */
+
+  PARSER_ERR_LEFT_PAREN_EXPECTED,                     /**< left paren expected */
+  PARSER_ERR_LEFT_BRACE_EXPECTED,                     /**< left brace expected */
+  PARSER_ERR_RIGHT_PAREN_EXPECTED,                    /**< right paren expected */
+  PARSER_ERR_RIGHT_SQUARE_EXPECTED,                   /**< right square expected */
+  PARSER_ERR_COLON_EXPECTED,                          /**< colon expected */
+  PARSER_ERR_COLON_FOR_CONDITIONAL_EXPECTED,          /**< colon expected for conditional expression */
+  PARSER_ERR_SEMICOLON_EXPECTED,                      /**< semicolon expected */
+  PARSER_ERR_IN_EXPECTED,                             /**< in keyword expected */
+  PARSER_ERR_WHILE_EXPECTED,                          /**< while expected for do-while loop */
+  PARSER_ERR_CATCH_FINALLY_EXPECTED,                  /**< catch or finally expected */
+  PARSER_ERR_ARRAY_ITEM_SEPARATOR_EXPECTED,           /**< array item separator expected */
+  PARSER_ERR_OBJECT_ITEM_SEPARATOR_EXPECTED,          /**< object item separator expected */
+  PARSER_ERR_IDENTIFIER_EXPECTED,                     /**< identifier expected */
+  PARSER_ERR_EXPRESSION_EXPECTED,                     /**< expression expected */
+  PARSER_ERR_PRIMARY_EXP_EXPECTED,                    /**< primary expression expected */
+  PARSER_ERR_STATEMENT_EXPECTED,                      /**< statement expected */
+  PARSER_ERR_PROPERTY_IDENTIFIER_EXPECTED,            /**< property identifier expected */
+  PARSER_ERR_ARGUMENT_LIST_EXPECTED,                  /**< argument list expected */
+  PARSER_ERR_NO_ARGUMENTS_EXPECTED,                   /**< property getters must have no arguments */
+  PARSER_ERR_ONE_ARGUMENT_EXPECTED,                   /**< property setters must have one argument */
+
+  PARSER_ERR_INVALID_EXPRESSION,                      /**< invalid expression */
+  PARSER_ERR_INVALID_SWITCH,                          /**< invalid switch body */
+  PARSER_ERR_INVALID_BREAK,                           /**< break must be inside a loop or switch */
+  PARSER_ERR_INVALID_BREAK_LABEL,                     /**< break target not found */
+  PARSER_ERR_INVALID_CONTINUE,                        /**< continue must be inside a loop */
+  PARSER_ERR_INVALID_CONTINUE_LABEL,                  /**< continue target not found */
+  PARSER_ERR_INVALID_RETURN,                          /**< return must be inside a function */
+  PARSER_ERR_INVALID_RIGHT_SQUARE,                    /**< right square must terminate a block */
+  PARSER_ERR_DUPLICATED_LABEL,                        /**< duplicated label */
+  PARSER_ERR_OBJECT_PROPERTY_REDEFINED,               /**< property of object literal redefined */
+  PARSER_ERR_NON_STRICT_ARG_DEFINITION                /**< non-strict argument definition */
+} parser_error_t;
+
+/* Source code line counter type. */
+typedef uint32_t parser_line_counter_t;
+
+/**
+ * Error code location.
+ */
+typedef struct
+{
+  parser_error_t error;                               /**< error code */
+  parser_line_counter_t line;                         /**< line where the error occured */
+  parser_line_counter_t column;                       /**< column where the error occured */
+} parser_error_location_t;
+
+/* Note: source must be a valid UTF-8 string */
+ecma_value_t parser_parse_script (const uint8_t *source_p, size_t size, bool is_strict,
+                                  ecma_compiled_code_t **bytecode_data_p);
+
+const char *parser_error_to_string (parser_error_t);
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !JS_PARSER_H */
diff --git a/deps/jerry/jerry-core/parser/regexp/re-bytecode.c b/deps/jerry/jerry-core/parser/regexp/re-bytecode.c
new file mode 100644 (file)
index 0000000..71a72af
--- /dev/null
@@ -0,0 +1,446 @@
+/* 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.
+ */
+
+#include "ecma-globals.h"
+#include "re-bytecode.h"
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup regexparser Regular expression
+ * @{
+ *
+ * \addtogroup regexparser_bytecode Bytecode
+ * @{
+ */
+
+/**
+ * Size of block of RegExp bytecode. Used for allocation
+ */
+#define REGEXP_BYTECODE_BLOCK_SIZE 256UL
+
+/**
+ * Realloc the bytecode container
+ *
+ * @return current position in RegExp bytecode
+ */
+static uint8_t *
+re_realloc_regexp_bytecode_block (re_bytecode_ctx_t *bc_ctx_p) /**< RegExp bytecode context */
+{
+  JERRY_ASSERT (bc_ctx_p->block_end_p >= bc_ctx_p->block_start_p);
+  size_t old_size = (size_t) (bc_ctx_p->block_end_p - bc_ctx_p->block_start_p);
+
+  /* If one of the members of RegExp bytecode context is NULL, then all member should be NULL
+   * (it means first allocation), otherwise all of the members should be a non NULL pointer. */
+  JERRY_ASSERT ((!bc_ctx_p->current_p && !bc_ctx_p->block_end_p && !bc_ctx_p->block_start_p)
+                || (bc_ctx_p->current_p && bc_ctx_p->block_end_p && bc_ctx_p->block_start_p));
+
+  size_t new_block_size = old_size + REGEXP_BYTECODE_BLOCK_SIZE;
+  JERRY_ASSERT (bc_ctx_p->current_p >= bc_ctx_p->block_start_p);
+  size_t current_ptr_offset = (size_t) (bc_ctx_p->current_p - bc_ctx_p->block_start_p);
+
+  uint8_t *new_block_start_p = (uint8_t *) jmem_heap_alloc_block (new_block_size);
+  if (bc_ctx_p->current_p)
+  {
+    memcpy (new_block_start_p, bc_ctx_p->block_start_p, (size_t) (current_ptr_offset));
+    jmem_heap_free_block (bc_ctx_p->block_start_p, old_size);
+  }
+  bc_ctx_p->block_start_p = new_block_start_p;
+  bc_ctx_p->block_end_p = new_block_start_p + new_block_size;
+  bc_ctx_p->current_p = new_block_start_p + current_ptr_offset;
+
+  return bc_ctx_p->current_p;
+} /* re_realloc_regexp_bytecode_block */
+
+/**
+ * Append a new bytecode to the and of the bytecode container
+ */
+static void
+re_bytecode_list_append (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */
+                         uint8_t *bytecode_p, /**< input bytecode */
+                         size_t length) /**< length of input */
+{
+  JERRY_ASSERT (length <= REGEXP_BYTECODE_BLOCK_SIZE);
+
+  uint8_t *current_p = bc_ctx_p->current_p;
+  if (current_p + length > bc_ctx_p->block_end_p)
+  {
+    current_p = re_realloc_regexp_bytecode_block (bc_ctx_p);
+  }
+
+  memcpy (current_p, bytecode_p, length);
+  bc_ctx_p->current_p += length;
+} /* re_bytecode_list_append */
+
+/**
+ * Insert a new bytecode to the bytecode container
+ */
+void
+re_bytecode_list_insert (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */
+                         size_t offset, /**< distance from the start of the container */
+                         uint8_t *bytecode_p, /**< input bytecode */
+                         size_t length) /**< length of input */
+{
+  JERRY_ASSERT (length <= REGEXP_BYTECODE_BLOCK_SIZE);
+
+  uint8_t *current_p = bc_ctx_p->current_p;
+  if (current_p + length > bc_ctx_p->block_end_p)
+  {
+    re_realloc_regexp_bytecode_block (bc_ctx_p);
+  }
+
+  uint8_t *src_p = bc_ctx_p->block_start_p + offset;
+  if ((re_get_bytecode_length (bc_ctx_p) - offset) > 0)
+  {
+    uint8_t *dest_p = src_p + length;
+    uint8_t *tmp_block_start_p;
+    tmp_block_start_p = (uint8_t *) jmem_heap_alloc_block (re_get_bytecode_length (bc_ctx_p) - offset);
+    memcpy (tmp_block_start_p, src_p, (size_t) (re_get_bytecode_length (bc_ctx_p) - offset));
+    memcpy (dest_p, tmp_block_start_p, (size_t) (re_get_bytecode_length (bc_ctx_p) - offset));
+    jmem_heap_free_block (tmp_block_start_p, re_get_bytecode_length (bc_ctx_p) - offset);
+  }
+  memcpy (src_p, bytecode_p, length);
+
+  bc_ctx_p->current_p += length;
+} /* re_bytecode_list_insert */
+
+/**
+ * Get a character from the RegExp bytecode and increase the bytecode position
+ *
+ * @return ecma character
+ */
+inline ecma_char_t __attr_always_inline___
+re_get_char (uint8_t **bc_p) /**< pointer to bytecode start */
+{
+  ecma_char_t chr;
+  memcpy (&chr, *bc_p, sizeof (ecma_char_t));
+  (*bc_p) += sizeof (ecma_char_t);
+  return chr;
+} /* re_get_char */
+
+/**
+ * Get a RegExp opcode and increase the bytecode position
+ *
+ * @return current RegExp opcode
+ */
+inline re_opcode_t __attr_always_inline___
+re_get_opcode (uint8_t **bc_p) /**< pointer to bytecode start */
+{
+  uint8_t bytecode = **bc_p;
+  (*bc_p) += sizeof (uint8_t);
+  return (re_opcode_t) bytecode;
+} /* re_get_opcode */
+
+/**
+ * Get a parameter of a RegExp opcode and increase the bytecode position
+ *
+ * @return opcode parameter
+ */
+inline uint32_t __attr_always_inline___
+re_get_value (uint8_t **bc_p) /**< pointer to bytecode start */
+{
+  uint32_t value;
+  memcpy (&value, *bc_p, sizeof (uint32_t));
+  (*bc_p) += sizeof (uint32_t);
+  return value;
+} /* re_get_value */
+
+/**
+ * Get length of bytecode
+ *
+ * @return bytecode length (unsigned integer)
+ */
+inline uint32_t __attr_pure___ __attr_always_inline___
+re_get_bytecode_length (re_bytecode_ctx_t *bc_ctx_p) /**< RegExp bytecode context */
+{
+  return ((uint32_t) (bc_ctx_p->current_p - bc_ctx_p->block_start_p));
+} /* re_get_bytecode_length */
+
+/**
+ * Append a RegExp opcode
+ */
+void
+re_append_opcode (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */
+                  re_opcode_t opcode) /**< input opcode */
+{
+  re_bytecode_list_append (bc_ctx_p, (uint8_t *) &opcode, sizeof (uint8_t));
+} /* re_append_opcode */
+
+/**
+ * Append a parameter of a RegExp opcode
+ */
+void
+re_append_u32 (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */
+               uint32_t value) /**< input value */
+{
+  re_bytecode_list_append (bc_ctx_p, (uint8_t *) &value, sizeof (uint32_t));
+} /* re_append_u32 */
+
+/**
+ * Append a character to the RegExp bytecode
+ */
+void
+re_append_char (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */
+                ecma_char_t input_char) /**< input char */
+{
+  re_bytecode_list_append (bc_ctx_p, (uint8_t *) &input_char, sizeof (ecma_char_t));
+} /* re_append_char */
+
+/**
+ * Append a jump offset parameter of a RegExp opcode
+ */
+void
+re_append_jump_offset (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */
+                       uint32_t value) /**< input value */
+{
+  value += (uint32_t) (sizeof (uint32_t));
+  re_append_u32 (bc_ctx_p, value);
+} /* re_append_jump_offset */
+
+/**
+ * Insert a RegExp opcode
+ */
+void
+re_insert_opcode (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */
+                  uint32_t offset, /**< distance from the start of the container */
+                  re_opcode_t opcode) /**< input opcode */
+{
+  re_bytecode_list_insert (bc_ctx_p, offset, (uint8_t *) &opcode, sizeof (uint8_t));
+} /* re_insert_opcode */
+
+/**
+ * Insert a parameter of a RegExp opcode
+ */
+void
+re_insert_u32 (re_bytecode_ctx_t *bc_ctx_p, /**< RegExp bytecode context */
+               uint32_t offset, /**< distance from the start of the container */
+               uint32_t value) /**< input value */
+{
+  re_bytecode_list_insert (bc_ctx_p, offset, (uint8_t *) &value, sizeof (uint32_t));
+} /* re_insert_u32 */
+
+#ifdef REGEXP_DUMP_BYTE_CODE
+/**
+ * RegExp bytecode dumper
+ */
+void
+re_dump_bytecode (re_bytecode_ctx_t *bc_ctx_p) /**< RegExp bytecode context */
+{
+  re_compiled_code_t *compiled_code_p = (re_compiled_code_t *) bc_ctx_p->block_start_p;
+  JERRY_DEBUG_MSG ("%d ", compiled_code_p->header.status_flags);
+  JERRY_DEBUG_MSG ("%d ", compiled_code_p->num_of_captures);
+  JERRY_DEBUG_MSG ("%d | ", compiled_code_p->num_of_non_captures);
+
+  uint8_t *bytecode_p = (uint8_t *) (compiled_code_p + 1);
+
+  re_opcode_t op;
+  while ((op = re_get_opcode (&bytecode_p)))
+  {
+    switch (op)
+    {
+      case RE_OP_MATCH:
+      {
+        JERRY_DEBUG_MSG ("MATCH, ");
+        break;
+      }
+      case RE_OP_CHAR:
+      {
+        JERRY_DEBUG_MSG ("CHAR ");
+        JERRY_DEBUG_MSG ("%c, ", (char) re_get_char (&bytecode_p));
+        break;
+      }
+      case RE_OP_CAPTURE_NON_GREEDY_ZERO_GROUP_START:
+      {
+        JERRY_DEBUG_MSG ("N");
+        /* FALLTHRU */
+      }
+      case RE_OP_CAPTURE_GREEDY_ZERO_GROUP_START:
+      {
+        JERRY_DEBUG_MSG ("GZ_START ");
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_CAPTURE_GROUP_START:
+      {
+        JERRY_DEBUG_MSG ("START ");
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_CAPTURE_NON_GREEDY_GROUP_END:
+      {
+        JERRY_DEBUG_MSG ("N");
+        /* FALLTHRU */
+      }
+      case RE_OP_CAPTURE_GREEDY_GROUP_END:
+      {
+        JERRY_DEBUG_MSG ("G_END ");
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_NON_CAPTURE_NON_GREEDY_ZERO_GROUP_START:
+      {
+        JERRY_DEBUG_MSG ("N");
+        /* FALLTHRU */
+      }
+      case RE_OP_NON_CAPTURE_GREEDY_ZERO_GROUP_START:
+      {
+        JERRY_DEBUG_MSG ("GZ_NC_START ");
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_NON_CAPTURE_GROUP_START:
+      {
+        JERRY_DEBUG_MSG ("NC_START ");
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_NON_CAPTURE_NON_GREEDY_GROUP_END:
+      {
+        JERRY_DEBUG_MSG ("N");
+        /* FALLTHRU */
+      }
+      case RE_OP_NON_CAPTURE_GREEDY_GROUP_END:
+      {
+        JERRY_DEBUG_MSG ("G_NC_END ");
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_SAVE_AT_START:
+      {
+        JERRY_DEBUG_MSG ("RE_START ");
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_SAVE_AND_MATCH:
+      {
+        JERRY_DEBUG_MSG ("RE_END, ");
+        break;
+      }
+      case RE_OP_GREEDY_ITERATOR:
+      {
+        JERRY_DEBUG_MSG ("GREEDY_ITERATOR ");
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_NON_GREEDY_ITERATOR:
+      {
+        JERRY_DEBUG_MSG ("NON_GREEDY_ITERATOR ");
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_PERIOD:
+      {
+        JERRY_DEBUG_MSG ("PERIOD ");
+        break;
+      }
+      case RE_OP_ALTERNATIVE:
+      {
+        JERRY_DEBUG_MSG ("ALTERNATIVE ");
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_ASSERT_START:
+      {
+        JERRY_DEBUG_MSG ("ASSERT_START ");
+        break;
+      }
+      case RE_OP_ASSERT_END:
+      {
+        JERRY_DEBUG_MSG ("ASSERT_END ");
+        break;
+      }
+      case RE_OP_ASSERT_WORD_BOUNDARY:
+      {
+        JERRY_DEBUG_MSG ("ASSERT_WORD_BOUNDARY ");
+        break;
+      }
+      case RE_OP_ASSERT_NOT_WORD_BOUNDARY:
+      {
+        JERRY_DEBUG_MSG ("ASSERT_NOT_WORD_BOUNDARY ");
+        break;
+      }
+      case RE_OP_LOOKAHEAD_POS:
+      {
+        JERRY_DEBUG_MSG ("LOOKAHEAD_POS ");
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_LOOKAHEAD_NEG:
+      {
+        JERRY_DEBUG_MSG ("LOOKAHEAD_NEG ");
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_BACKREFERENCE:
+      {
+        JERRY_DEBUG_MSG ("BACKREFERENCE ");
+        JERRY_DEBUG_MSG ("%d, ", re_get_value (&bytecode_p));
+        break;
+      }
+      case RE_OP_INV_CHAR_CLASS:
+      {
+        JERRY_DEBUG_MSG ("INV_");
+        /* FALLTHRU */
+      }
+      case RE_OP_CHAR_CLASS:
+      {
+        JERRY_DEBUG_MSG ("CHAR_CLASS ");
+        uint32_t num_of_class = re_get_value (&bytecode_p);
+        JERRY_DEBUG_MSG ("%d", num_of_class);
+        while (num_of_class)
+        {
+          JERRY_DEBUG_MSG (" %d", re_get_char (&bytecode_p));
+          JERRY_DEBUG_MSG ("-%d", re_get_char (&bytecode_p));
+          num_of_class--;
+        }
+        JERRY_DEBUG_MSG (", ");
+        break;
+      }
+      default:
+      {
+        JERRY_DEBUG_MSG ("UNKNOWN(%d), ", (uint32_t) op);
+        break;
+      }
+    }
+  }
+  JERRY_DEBUG_MSG ("EOF\n");
+} /* re_dump_bytecode */
+#endif /* REGEXP_DUMP_BYTE_CODE */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
diff --git a/deps/jerry/jerry-core/parser/regexp/re-bytecode.h b/deps/jerry/jerry-core/parser/regexp/re-bytecode.h
new file mode 100644 (file)
index 0000000..c166151
--- /dev/null
@@ -0,0 +1,128 @@
+/* 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.
+ */
+
+#ifndef RE_BYTECODE_H
+#define RE_BYTECODE_H
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+#include "ecma-globals.h"
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup regexparser Regular expression
+ * @{
+ *
+ * \addtogroup regexparser_bytecode Bytecode
+ * @{
+ */
+
+/**
+  * Size of the RegExp bytecode cache
+  */
+#define RE_CACHE_SIZE 8u
+
+/**
+  * RegExp flags mask (first 10 bits are for reference count and the rest for the actual RegExp flags)
+  */
+#define RE_FLAGS_MASK 0x3F
+
+/**
+ * RegExp opcodes
+ */
+typedef enum
+{
+  RE_OP_EOF,
+  /* Group opcode order is important, because RE_IS_CAPTURE_GROUP is based on it.
+   * Change it carefully. Capture opcodes should be at first.
+   */
+  RE_OP_CAPTURE_GROUP_START,                      /**< group start */
+  RE_OP_CAPTURE_GREEDY_ZERO_GROUP_START,          /**< greedy zero group start */
+  RE_OP_CAPTURE_NON_GREEDY_ZERO_GROUP_START,      /**< non-greedy zero group start */
+  RE_OP_CAPTURE_GREEDY_GROUP_END,                 /**< greedy group end */
+  RE_OP_CAPTURE_NON_GREEDY_GROUP_END,             /**< non-greedy group end */
+  RE_OP_NON_CAPTURE_GROUP_START,                  /**< non-capture group start */
+  RE_OP_NON_CAPTURE_GREEDY_ZERO_GROUP_START,      /**< non-capture greedy zero group start */
+  RE_OP_NON_CAPTURE_NON_GREEDY_ZERO_GROUP_START,  /**< non-capture non-greedy zero group start */
+  RE_OP_NON_CAPTURE_GREEDY_GROUP_END,             /**< non-capture greedy group end */
+  RE_OP_NON_CAPTURE_NON_GREEDY_GROUP_END,         /**< non-capture non-greedy group end */
+
+  RE_OP_MATCH,                                    /**< match */
+  RE_OP_CHAR,                                     /**< any character */
+  RE_OP_SAVE_AT_START,                            /**< save at start */
+  RE_OP_SAVE_AND_MATCH,                           /**< save and match */
+  RE_OP_PERIOD,                                   /**< "." */
+  RE_OP_ALTERNATIVE,                              /**< "|" */
+  RE_OP_GREEDY_ITERATOR,                          /**< greedy iterator */
+  RE_OP_NON_GREEDY_ITERATOR,                      /**< non-greedy iterator */
+  RE_OP_ASSERT_START,                             /**< "^" */
+  RE_OP_ASSERT_END,                               /**< "$" */
+  RE_OP_ASSERT_WORD_BOUNDARY,                     /**< "\b" */
+  RE_OP_ASSERT_NOT_WORD_BOUNDARY,                 /**< "\B" */
+  RE_OP_LOOKAHEAD_POS,                            /**< lookahead pos */
+  RE_OP_LOOKAHEAD_NEG,                            /**< lookahead neg */
+  RE_OP_BACKREFERENCE,                            /**< "\[0..9]" */
+  RE_OP_CHAR_CLASS,                               /**< "[ ]" */
+  RE_OP_INV_CHAR_CLASS                            /**< "[^ ]" */
+} re_opcode_t;
+
+/**
+ * Compiled byte code data.
+ */
+typedef struct
+{
+  ecma_compiled_code_t header;       /**< compiled code header */
+  jmem_cpointer_t pattern_cp;        /**< original RegExp pattern */
+  uint32_t num_of_captures;          /**< number of capturing brackets */
+  uint32_t num_of_non_captures;      /**< number of non capturing brackets */
+} re_compiled_code_t;
+
+/**
+ * Context of RegExp bytecode container
+ */
+typedef struct
+{
+  uint8_t *block_start_p;      /**< start of bytecode block */
+  uint8_t *block_end_p;        /**< end of bytecode block */
+  uint8_t *current_p;          /**< current position in bytecode */
+} re_bytecode_ctx_t;
+
+re_opcode_t re_get_opcode (uint8_t **bc_p);
+ecma_char_t re_get_char (uint8_t **bc_p);
+uint32_t re_get_value (uint8_t **bc_p);
+uint32_t re_get_bytecode_length (re_bytecode_ctx_t *bc_ctx_p) __attr_pure___;
+
+void re_append_opcode (re_bytecode_ctx_t *bc_ctx_p, re_opcode_t opcode);
+void re_append_u32 (re_bytecode_ctx_t *bc_ctx_p, uint32_t value);
+void re_append_char (re_bytecode_ctx_t *bc_ctx_p, ecma_char_t input_char);
+void re_append_jump_offset (re_bytecode_ctx_t *bc_ctx_p, uint32_t value);
+
+void re_insert_opcode (re_bytecode_ctx_t *bc_ctx_p, uint32_t offset, re_opcode_t opcode);
+void re_insert_u32 (re_bytecode_ctx_t *bc_ctx_p, uint32_t offset, uint32_t value);
+void re_bytecode_list_insert (re_bytecode_ctx_t *bc_ctx_p, size_t offset, uint8_t *bytecode_p, size_t length);
+
+#ifdef REGEXP_DUMP_BYTE_CODE
+void re_dump_bytecode (re_bytecode_ctx_t *bc_ctx);
+#endif /* REGEXP_DUMP_BYTE_CODE */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+#endif /* !RE_BYTECODE_H */
diff --git a/deps/jerry/jerry-core/parser/regexp/re-compiler.c b/deps/jerry/jerry-core/parser/regexp/re-compiler.c
new file mode 100644 (file)
index 0000000..433e881
--- /dev/null
@@ -0,0 +1,649 @@
+/* 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.
+ */
+
+#include "ecma-exceptions.h"
+#include "ecma-helpers.h"
+#include "ecma-regexp-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jcontext.h"
+#include "jrt-libc-includes.h"
+#include "jmem.h"
+#include "re-bytecode.h"
+#include "re-compiler.h"
+#include "re-parser.h"
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup regexparser Regular expression
+ * @{
+ *
+ * \addtogroup regexparser_compiler Compiler
+ * @{
+ */
+
+/**
+ * Callback function of character class generation
+ */
+static void
+re_append_char_class (void *re_ctx_p, /**< RegExp compiler context */
+                      ecma_char_t start, /**< character class range from */
+                      ecma_char_t end) /**< character class range to */
+{
+  re_compiler_ctx_t *ctx_p = (re_compiler_ctx_t *) re_ctx_p;
+  re_append_char (ctx_p->bytecode_ctx_p, start);
+  re_append_char (ctx_p->bytecode_ctx_p, end);
+  ctx_p->parser_ctx_p->num_of_classes++;
+} /* re_append_char_class */
+
+/**
+ * Insert simple atom iterator
+ */
+static void
+re_insert_simple_iterator (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context */
+                           uint32_t new_atom_start_offset) /**< atom start offset */
+{
+  uint32_t atom_code_length;
+  uint32_t offset;
+  uint32_t qmin, qmax;
+
+  qmin = re_ctx_p->current_token.qmin;
+  qmax = re_ctx_p->current_token.qmax;
+  JERRY_ASSERT (qmin <= qmax);
+
+  /* TODO: optimize bytecode length. Store 0 rather than INF */
+
+  re_append_opcode (re_ctx_p->bytecode_ctx_p, RE_OP_MATCH);   /* complete 'sub atom' */
+  uint32_t bytecode_length = re_get_bytecode_length (re_ctx_p->bytecode_ctx_p);
+  atom_code_length = (uint32_t) (bytecode_length - new_atom_start_offset);
+
+  offset = new_atom_start_offset;
+  re_insert_u32 (re_ctx_p->bytecode_ctx_p, offset, atom_code_length);
+  re_insert_u32 (re_ctx_p->bytecode_ctx_p, offset, qmax);
+  re_insert_u32 (re_ctx_p->bytecode_ctx_p, offset, qmin);
+  if (re_ctx_p->current_token.greedy)
+  {
+    re_insert_opcode (re_ctx_p->bytecode_ctx_p, offset, RE_OP_GREEDY_ITERATOR);
+  }
+  else
+  {
+    re_insert_opcode (re_ctx_p->bytecode_ctx_p, offset, RE_OP_NON_GREEDY_ITERATOR);
+  }
+} /* re_insert_simple_iterator */
+
+/**
+ * Get the type of a group start
+ *
+ * @return RegExp opcode
+ */
+static re_opcode_t
+re_get_start_opcode_type (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context */
+                          bool is_capturable) /**< is capturable group */
+{
+  if (is_capturable)
+  {
+    if (re_ctx_p->current_token.qmin == 0)
+    {
+      if (re_ctx_p->current_token.greedy)
+      {
+        return RE_OP_CAPTURE_GREEDY_ZERO_GROUP_START;
+      }
+
+      return RE_OP_CAPTURE_NON_GREEDY_ZERO_GROUP_START;
+    }
+
+    return RE_OP_CAPTURE_GROUP_START;
+  }
+
+  if (re_ctx_p->current_token.qmin == 0)
+  {
+    if (re_ctx_p->current_token.greedy)
+    {
+      return RE_OP_NON_CAPTURE_GREEDY_ZERO_GROUP_START;
+    }
+
+    return RE_OP_NON_CAPTURE_NON_GREEDY_ZERO_GROUP_START;
+  }
+
+  return RE_OP_NON_CAPTURE_GROUP_START;
+} /* re_get_start_opcode_type */
+
+/**
+ * Get the type of a group end
+ *
+ * @return RegExp opcode
+ */
+static re_opcode_t
+re_get_end_opcode_type (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context */
+                        bool is_capturable) /**< is capturable group */
+{
+  if (is_capturable)
+  {
+    if (re_ctx_p->current_token.greedy)
+    {
+      return RE_OP_CAPTURE_GREEDY_GROUP_END;
+    }
+
+    return RE_OP_CAPTURE_NON_GREEDY_GROUP_END;
+  }
+
+  if (re_ctx_p->current_token.greedy)
+  {
+    return RE_OP_NON_CAPTURE_GREEDY_GROUP_END;
+  }
+
+  return RE_OP_NON_CAPTURE_NON_GREEDY_GROUP_END;
+} /* re_get_end_opcode_type */
+
+/**
+ * Enclose the given bytecode to a group
+ */
+static void
+re_insert_into_group (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context */
+                      uint32_t group_start_offset, /**< offset of group start */
+                      uint32_t idx, /**< index of group */
+                      bool is_capturable) /**< is capturable group */
+{
+  uint32_t qmin, qmax;
+  re_opcode_t start_opcode = re_get_start_opcode_type (re_ctx_p, is_capturable);
+  re_opcode_t end_opcode = re_get_end_opcode_type (re_ctx_p, is_capturable);
+  uint32_t start_head_offset_len;
+
+  qmin = re_ctx_p->current_token.qmin;
+  qmax = re_ctx_p->current_token.qmax;
+  JERRY_ASSERT (qmin <= qmax);
+
+  start_head_offset_len = re_get_bytecode_length (re_ctx_p->bytecode_ctx_p);
+  re_insert_u32 (re_ctx_p->bytecode_ctx_p, group_start_offset, idx);
+  re_insert_opcode (re_ctx_p->bytecode_ctx_p, group_start_offset, start_opcode);
+  start_head_offset_len = re_get_bytecode_length (re_ctx_p->bytecode_ctx_p) - start_head_offset_len;
+  re_append_opcode (re_ctx_p->bytecode_ctx_p, end_opcode);
+  re_append_u32 (re_ctx_p->bytecode_ctx_p, idx);
+  re_append_u32 (re_ctx_p->bytecode_ctx_p, qmin);
+  re_append_u32 (re_ctx_p->bytecode_ctx_p, qmax);
+
+  group_start_offset += start_head_offset_len;
+  re_append_jump_offset (re_ctx_p->bytecode_ctx_p,
+                         re_get_bytecode_length (re_ctx_p->bytecode_ctx_p) - group_start_offset);
+
+  if (start_opcode != RE_OP_CAPTURE_GROUP_START && start_opcode != RE_OP_NON_CAPTURE_GROUP_START)
+  {
+    re_insert_u32 (re_ctx_p->bytecode_ctx_p,
+                   group_start_offset,
+                   re_get_bytecode_length (re_ctx_p->bytecode_ctx_p) - group_start_offset);
+  }
+} /* re_insert_into_group */
+
+/**
+ * Enclose the given bytecode to a group and inster jump value
+ */
+static void
+re_insert_into_group_with_jump (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context */
+                                uint32_t group_start_offset, /**< offset of group start */
+                                uint32_t idx, /**< index of group */
+                                bool is_capturable) /**< is capturable group */
+{
+  re_insert_u32 (re_ctx_p->bytecode_ctx_p,
+                 group_start_offset,
+                 re_get_bytecode_length (re_ctx_p->bytecode_ctx_p) - group_start_offset);
+  re_insert_into_group (re_ctx_p, group_start_offset, idx, is_capturable);
+} /* re_insert_into_group_with_jump */
+
+/**
+ * Parse alternatives
+ *
+ * @return empty ecma value - if alternative was successfully parsed
+ *         error ecma value - otherwise
+ *
+ *         Returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context */
+                      bool expect_eof) /**< expect end of file */
+{
+  uint32_t idx;
+  re_bytecode_ctx_t *bc_ctx_p = re_ctx_p->bytecode_ctx_p;
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  uint32_t alterantive_offset = re_get_bytecode_length (re_ctx_p->bytecode_ctx_p);
+  bool should_loop = true;
+
+  while (ecma_is_value_empty (ret_value) && should_loop)
+  {
+    ECMA_TRY_CATCH (empty,
+                    re_parse_next_token (re_ctx_p->parser_ctx_p,
+                                         &(re_ctx_p->current_token)),
+                    ret_value);
+
+    uint32_t new_atom_start_offset = re_get_bytecode_length (re_ctx_p->bytecode_ctx_p);
+
+    switch (re_ctx_p->current_token.type)
+    {
+      case RE_TOK_START_CAPTURE_GROUP:
+      {
+        idx = re_ctx_p->num_of_captures++;
+        JERRY_TRACE_MSG ("Compile a capture group start (idx: %u)\n", (unsigned int) idx);
+
+        ret_value = re_parse_alternative (re_ctx_p, false);
+
+        if (ecma_is_value_empty (ret_value))
+        {
+          re_insert_into_group (re_ctx_p, new_atom_start_offset, idx, true);
+        }
+
+        break;
+      }
+      case RE_TOK_START_NON_CAPTURE_GROUP:
+      {
+        idx = re_ctx_p->num_of_non_captures++;
+        JERRY_TRACE_MSG ("Compile a non-capture group start (idx: %u)\n", (unsigned int) idx);
+
+        ret_value = re_parse_alternative (re_ctx_p, false);
+
+        if (ecma_is_value_empty (ret_value))
+        {
+          re_insert_into_group (re_ctx_p, new_atom_start_offset, idx, false);
+        }
+
+        break;
+      }
+      case RE_TOK_CHAR:
+      {
+        JERRY_TRACE_MSG ("Compile character token: %c, qmin: %u, qmax: %u\n",
+                         (char) re_ctx_p->current_token.value, (unsigned int) re_ctx_p->current_token.qmin,
+                         (unsigned int) re_ctx_p->current_token.qmax);
+
+        re_append_opcode (bc_ctx_p, RE_OP_CHAR);
+        re_append_char (bc_ctx_p, re_canonicalize ((ecma_char_t) re_ctx_p->current_token.value,
+                                                   re_ctx_p->flags & RE_FLAG_IGNORE_CASE));
+
+        if ((re_ctx_p->current_token.qmin != 1) || (re_ctx_p->current_token.qmax != 1))
+        {
+          re_insert_simple_iterator (re_ctx_p, new_atom_start_offset);
+        }
+        break;
+      }
+      case RE_TOK_PERIOD:
+      {
+        JERRY_TRACE_MSG ("Compile a period\n");
+        re_append_opcode (bc_ctx_p, RE_OP_PERIOD);
+
+        if ((re_ctx_p->current_token.qmin != 1) || (re_ctx_p->current_token.qmax != 1))
+        {
+          re_insert_simple_iterator (re_ctx_p, new_atom_start_offset);
+        }
+        break;
+      }
+      case RE_TOK_ALTERNATIVE:
+      {
+        JERRY_TRACE_MSG ("Compile an alternative\n");
+        re_insert_u32 (bc_ctx_p, alterantive_offset, re_get_bytecode_length (bc_ctx_p) - alterantive_offset);
+        re_append_opcode (bc_ctx_p, RE_OP_ALTERNATIVE);
+        alterantive_offset = re_get_bytecode_length (re_ctx_p->bytecode_ctx_p);
+        break;
+      }
+      case RE_TOK_ASSERT_START:
+      {
+        JERRY_TRACE_MSG ("Compile a start assertion\n");
+        re_append_opcode (bc_ctx_p, RE_OP_ASSERT_START);
+        break;
+      }
+      case RE_TOK_ASSERT_END:
+      {
+        JERRY_TRACE_MSG ("Compile an end assertion\n");
+        re_append_opcode (bc_ctx_p, RE_OP_ASSERT_END);
+        break;
+      }
+      case RE_TOK_ASSERT_WORD_BOUNDARY:
+      {
+        JERRY_TRACE_MSG ("Compile a word boundary assertion\n");
+        re_append_opcode (bc_ctx_p, RE_OP_ASSERT_WORD_BOUNDARY);
+        break;
+      }
+      case RE_TOK_ASSERT_NOT_WORD_BOUNDARY:
+      {
+        JERRY_TRACE_MSG ("Compile a not word boundary assertion\n");
+        re_append_opcode (bc_ctx_p, RE_OP_ASSERT_NOT_WORD_BOUNDARY);
+        break;
+      }
+      case RE_TOK_ASSERT_START_POS_LOOKAHEAD:
+      {
+        JERRY_TRACE_MSG ("Compile a positive lookahead assertion\n");
+        idx = re_ctx_p->num_of_non_captures++;
+        re_append_opcode (bc_ctx_p, RE_OP_LOOKAHEAD_POS);
+
+        ret_value = re_parse_alternative (re_ctx_p, false);
+
+        if (ecma_is_value_empty (ret_value))
+        {
+          re_append_opcode (bc_ctx_p, RE_OP_MATCH);
+
+          re_insert_into_group_with_jump (re_ctx_p, new_atom_start_offset, idx, false);
+        }
+
+        break;
+      }
+      case RE_TOK_ASSERT_START_NEG_LOOKAHEAD:
+      {
+        JERRY_TRACE_MSG ("Compile a negative lookahead assertion\n");
+        idx = re_ctx_p->num_of_non_captures++;
+        re_append_opcode (bc_ctx_p, RE_OP_LOOKAHEAD_NEG);
+
+        ret_value = re_parse_alternative (re_ctx_p, false);
+
+        if (ecma_is_value_empty (ret_value))
+        {
+          re_append_opcode (bc_ctx_p, RE_OP_MATCH);
+
+          re_insert_into_group_with_jump (re_ctx_p, new_atom_start_offset, idx, false);
+        }
+
+        break;
+      }
+      case RE_TOK_BACKREFERENCE:
+      {
+        uint32_t backref = (uint32_t) re_ctx_p->current_token.value;
+        idx = re_ctx_p->num_of_non_captures++;
+
+        if (backref > re_ctx_p->highest_backref)
+        {
+          re_ctx_p->highest_backref = backref;
+        }
+
+        JERRY_TRACE_MSG ("Compile a backreference: %u\n", (unsigned int) backref);
+        re_append_opcode (bc_ctx_p, RE_OP_BACKREFERENCE);
+        re_append_u32 (bc_ctx_p, backref);
+
+        re_insert_into_group_with_jump (re_ctx_p, new_atom_start_offset, idx, false);
+        break;
+      }
+      case RE_TOK_DIGIT:
+      case RE_TOK_NOT_DIGIT:
+      case RE_TOK_WHITE:
+      case RE_TOK_NOT_WHITE:
+      case RE_TOK_WORD_CHAR:
+      case RE_TOK_NOT_WORD_CHAR:
+      case RE_TOK_START_CHAR_CLASS:
+      case RE_TOK_START_INV_CHAR_CLASS:
+      {
+        JERRY_TRACE_MSG ("Compile a character class\n");
+        re_append_opcode (bc_ctx_p,
+                          re_ctx_p->current_token.type == RE_TOK_START_INV_CHAR_CLASS
+                                                       ? RE_OP_INV_CHAR_CLASS
+                                                       : RE_OP_CHAR_CLASS);
+        uint32_t offset = re_get_bytecode_length (re_ctx_p->bytecode_ctx_p);
+
+        ECMA_TRY_CATCH (empty_value,
+                        re_parse_char_class (re_ctx_p->parser_ctx_p,
+                                             re_append_char_class,
+                                             re_ctx_p,
+                                             &(re_ctx_p->current_token)),
+                        ret_value);
+        re_insert_u32 (bc_ctx_p, offset, re_ctx_p->parser_ctx_p->num_of_classes);
+
+        if ((re_ctx_p->current_token.qmin != 1) || (re_ctx_p->current_token.qmax != 1))
+        {
+          re_insert_simple_iterator (re_ctx_p, new_atom_start_offset);
+        }
+
+        ECMA_FINALIZE (empty_value);
+
+        break;
+      }
+      case RE_TOK_END_GROUP:
+      {
+        JERRY_TRACE_MSG ("Compile a group end\n");
+
+        if (expect_eof)
+        {
+          ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Unexpected end of paren."));
+        }
+        else
+        {
+          re_insert_u32 (bc_ctx_p, alterantive_offset, re_get_bytecode_length (bc_ctx_p) - alterantive_offset);
+          should_loop = false;
+        }
+        break;
+      }
+      case RE_TOK_EOF:
+      {
+        if (!expect_eof)
+        {
+          ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Unexpected end of pattern."));
+        }
+        else
+        {
+          re_insert_u32 (bc_ctx_p, alterantive_offset, re_get_bytecode_length (bc_ctx_p) - alterantive_offset);
+          should_loop = false;
+        }
+
+        break;
+      }
+      default:
+      {
+        ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Unexpected RegExp token."));
+        break;
+      }
+    }
+    ECMA_FINALIZE (empty);
+  }
+
+  return ret_value;
+} /* re_parse_alternative */
+
+/**
+ * Search for the given pattern in the RegExp cache
+ *
+ * @return index of bytecode in cache - if found
+ *         RE_CACHE_SIZE              - otherwise
+ */
+static uint8_t
+re_find_bytecode_in_cache (ecma_string_t *pattern_str_p, /**< pattern string */
+                           uint16_t flags) /**< flags */
+{
+  uint8_t free_idx = RE_CACHE_SIZE;
+
+  for (uint8_t idx = 0u; idx < RE_CACHE_SIZE; idx++)
+  {
+    const re_compiled_code_t *cached_bytecode_p = JERRY_CONTEXT (re_cache)[idx];
+
+    if (cached_bytecode_p != NULL)
+    {
+      ecma_string_t *cached_pattern_str_p;
+      cached_pattern_str_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t, cached_bytecode_p->pattern_cp);
+
+      if ((cached_bytecode_p->header.status_flags & RE_FLAGS_MASK) == flags
+          && ecma_compare_ecma_strings (cached_pattern_str_p, pattern_str_p))
+      {
+        JERRY_TRACE_MSG ("RegExp is found in cache\n");
+        return idx;
+      }
+    }
+    else
+    {
+      /* mark as free, so it can be overridden if the cache is full */
+      free_idx = idx;
+    }
+  }
+
+  JERRY_TRACE_MSG ("RegExp is NOT found in cache\n");
+  return free_idx;
+} /* re_find_bytecode_in_cache */
+
+/**
+ * Run gerbage collection in RegExp cache
+ */
+void
+re_cache_gc_run (void)
+{
+  for (uint32_t i = 0u; i < RE_CACHE_SIZE; i++)
+  {
+    const re_compiled_code_t *cached_bytecode_p = JERRY_CONTEXT (re_cache)[i];
+
+    if (cached_bytecode_p != NULL
+        && cached_bytecode_p->header.refs == 1)
+    {
+      /* Only the cache has reference for the bytecode */
+      ecma_bytecode_deref ((ecma_compiled_code_t *) cached_bytecode_p);
+      JERRY_CONTEXT (re_cache)[i] = NULL;
+    }
+  }
+} /* re_cache_gc_run */
+
+/**
+ * Compilation of RegExp bytecode
+ *
+ * @return empty ecma value - if bytecode was compiled successfully
+ *         error ecma value - otherwise
+ *
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+re_compile_bytecode (const re_compiled_code_t **out_bytecode_p, /**< [out] pointer to bytecode */
+                     ecma_string_t *pattern_str_p, /**< pattern */
+                     uint16_t flags) /**< flags */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  uint8_t cache_idx = re_find_bytecode_in_cache (pattern_str_p, flags);
+
+  if (cache_idx < RE_CACHE_SIZE)
+  {
+    *out_bytecode_p = JERRY_CONTEXT (re_cache)[cache_idx];
+
+    if (*out_bytecode_p != NULL)
+    {
+      ecma_bytecode_ref ((ecma_compiled_code_t *) *out_bytecode_p);
+      return ret_value;
+    }
+  }
+
+  /* not in the RegExp cache, so compile it */
+  re_compiler_ctx_t re_ctx;
+  re_ctx.flags = flags;
+  re_ctx.highest_backref = 0;
+  re_ctx.num_of_non_captures = 0;
+
+  re_bytecode_ctx_t bc_ctx;
+  bc_ctx.block_start_p = NULL;
+  bc_ctx.block_end_p = NULL;
+  bc_ctx.current_p = NULL;
+
+  re_ctx.bytecode_ctx_p = &bc_ctx;
+
+  ECMA_STRING_TO_UTF8_STRING (pattern_str_p, pattern_start_p, pattern_start_size);
+
+  re_parser_ctx_t parser_ctx;
+  parser_ctx.input_start_p = pattern_start_p;
+  parser_ctx.input_curr_p = (lit_utf8_byte_t *) pattern_start_p;
+  parser_ctx.input_end_p = pattern_start_p + pattern_start_size;
+  parser_ctx.num_of_groups = -1;
+  re_ctx.parser_ctx_p = &parser_ctx;
+
+  /* 1. Parse RegExp pattern */
+  re_ctx.num_of_captures = 1;
+  re_append_opcode (&bc_ctx, RE_OP_SAVE_AT_START);
+
+  ECMA_TRY_CATCH (empty, re_parse_alternative (&re_ctx, true), ret_value);
+
+  /* 2. Check for invalid backreference */
+  if (re_ctx.highest_backref >= re_ctx.num_of_captures)
+  {
+    ret_value = ecma_raise_syntax_error ("Invalid backreference.\n");
+  }
+  else
+  {
+    re_append_opcode (&bc_ctx, RE_OP_SAVE_AND_MATCH);
+    re_append_opcode (&bc_ctx, RE_OP_EOF);
+
+    /* 3. Insert extra informations for bytecode header */
+    re_compiled_code_t re_compiled_code;
+
+    re_compiled_code.header.refs = 1;
+    re_compiled_code.header.status_flags = re_ctx.flags;
+    ecma_ref_ecma_string (pattern_str_p);
+    ECMA_SET_NON_NULL_POINTER (re_compiled_code.pattern_cp, pattern_str_p);
+    re_compiled_code.num_of_captures = re_ctx.num_of_captures * 2;
+    re_compiled_code.num_of_non_captures = re_ctx.num_of_non_captures;
+
+    re_bytecode_list_insert (&bc_ctx,
+                             0,
+                             (uint8_t *) &re_compiled_code,
+                             sizeof (re_compiled_code_t));
+  }
+
+  ECMA_FINALIZE (empty);
+
+  ECMA_FINALIZE_UTF8_STRING (pattern_start_p, pattern_start_size);
+
+  size_t byte_code_size = (size_t) (bc_ctx.block_end_p - bc_ctx.block_start_p);
+
+  if (!ecma_is_value_empty (ret_value))
+  {
+    /* Compilation failed, free bytecode. */
+    JERRY_TRACE_MSG ("RegExp compilation failed!\n");
+    jmem_heap_free_block (bc_ctx.block_start_p, byte_code_size);
+    *out_bytecode_p = NULL;
+  }
+  else
+  {
+#ifdef REGEXP_DUMP_BYTE_CODE
+    if (JERRY_CONTEXT (jerry_init_flags) & ECMA_INIT_SHOW_REGEXP_OPCODES)
+    {
+      re_dump_bytecode (&bc_ctx);
+    }
+#endif /* REGEXP_DUMP_BYTE_CODE */
+
+    /* The RegExp bytecode contains at least a RE_OP_SAVE_AT_START opdoce, so it cannot be NULL. */
+    JERRY_ASSERT (bc_ctx.block_start_p != NULL);
+    *out_bytecode_p = (re_compiled_code_t *) bc_ctx.block_start_p;
+
+    ((re_compiled_code_t *) bc_ctx.block_start_p)->header.size = (uint16_t) (byte_code_size >> JMEM_ALIGNMENT_LOG);
+
+    if (cache_idx == RE_CACHE_SIZE)
+    {
+      if (JERRY_CONTEXT (re_cache_idx) == RE_CACHE_SIZE)
+      {
+        JERRY_CONTEXT (re_cache_idx) = 0;
+      }
+
+      JERRY_TRACE_MSG ("RegExp cache is full! Remove the element on idx: %d\n", JERRY_CONTEXT (re_cache_idx));
+
+      cache_idx = JERRY_CONTEXT (re_cache_idx)++;
+
+      /* The garbage collector might run during the byte code
+       * allocations above and it may free this entry. */
+      if (JERRY_CONTEXT (re_cache)[cache_idx] != NULL)
+      {
+        ecma_bytecode_deref ((ecma_compiled_code_t *) JERRY_CONTEXT (re_cache)[cache_idx]);
+      }
+    }
+
+    JERRY_TRACE_MSG ("Insert bytecode into RegExp cache (idx: %d).\n", cache_idx);
+    ecma_bytecode_ref ((ecma_compiled_code_t *) *out_bytecode_p);
+    JERRY_CONTEXT (re_cache)[cache_idx] = *out_bytecode_p;
+  }
+
+  return ret_value;
+} /* re_compile_bytecode */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
diff --git a/deps/jerry/jerry-core/parser/regexp/re-compiler.h b/deps/jerry/jerry-core/parser/regexp/re-compiler.h
new file mode 100644 (file)
index 0000000..3933597
--- /dev/null
@@ -0,0 +1,61 @@
+/* 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.
+ */
+
+#ifndef RE_COMPILER_H
+#define RE_COMPILER_H
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+#include "ecma-globals.h"
+#include "re-bytecode.h"
+#include "re-parser.h"
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup regexparser Regular expression
+ * @{
+ *
+ * \addtogroup regexparser_compiler Compiler
+ * @{
+ */
+
+/**
+ * Context of RegExp compiler
+ */
+typedef struct
+{
+  uint16_t flags;                    /**< RegExp flags */
+  uint32_t num_of_captures;          /**< number of capture groups */
+  uint32_t num_of_non_captures;      /**< number of non-capture groups */
+  uint32_t highest_backref;          /**< highest backreference */
+  re_bytecode_ctx_t *bytecode_ctx_p; /**< pointer of RegExp bytecode context */
+  re_token_t current_token;          /**< current token */
+  re_parser_ctx_t *parser_ctx_p;     /**< pointer of RegExp parser context */
+} re_compiler_ctx_t;
+
+ecma_value_t
+re_compile_bytecode (const re_compiled_code_t **out_bytecode_p, ecma_string_t *pattern_str_p, uint16_t flags);
+
+void re_cache_gc_run (void);
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+#endif /* !RE_COMPILER_H */
diff --git a/deps/jerry/jerry-core/parser/regexp/re-parser.c b/deps/jerry/jerry-core/parser/regexp/re-parser.c
new file mode 100644 (file)
index 0000000..8e028e7
--- /dev/null
@@ -0,0 +1,929 @@
+/* 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.
+ */
+
+#include "ecma-exceptions.h"
+#include "ecma-globals.h"
+#include "ecma-try-catch-macro.h"
+#include "jrt-libc-includes.h"
+#include "lit-char-helpers.h"
+#include "re-compiler.h"
+#include "re-parser.h"
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup regexparser Regular expression
+ * @{
+ *
+ * \addtogroup regexparser_parser Parser
+ * @{
+ */
+
+/**
+ * Lookup a character in the input string.
+ *
+ * @return true - if lookup number of characters ahead are hex digits
+ *         false - otherwise
+ */
+static bool
+re_hex_lookup (re_parser_ctx_t *parser_ctx_p, /**< RegExp parser context */
+               uint32_t lookup) /**< size of lookup */
+{
+  bool is_digit = true;
+  const lit_utf8_byte_t *curr_p = parser_ctx_p->input_curr_p;
+
+  for (uint32_t i = 0; is_digit && i < lookup; i++)
+  {
+    if (curr_p < parser_ctx_p->input_end_p)
+    {
+      is_digit = lit_char_is_hex_digit (*curr_p++);
+    }
+    else
+    {
+      return false;
+    }
+  }
+
+  return is_digit;
+} /* re_hex_lookup */
+
+/**
+ * Consume non greedy (question mark) character if present.
+ *
+ * @return true - if non-greedy character found
+ *         false - otherwise
+ */
+static inline bool __attr_always_inline___
+re_parse_non_greedy_char (re_parser_ctx_t *parser_ctx_p) /**< RegExp parser context */
+{
+  if (parser_ctx_p->input_curr_p < parser_ctx_p->input_end_p
+      && *parser_ctx_p->input_curr_p == LIT_CHAR_QUESTION)
+  {
+    parser_ctx_p->input_curr_p++;
+    return true;
+  }
+
+  return false;
+} /* re_parse_non_greedy_char */
+
+/**
+ * Parse a max 3 digit long octal number from input string iterator.
+ *
+ * @return uint32_t - parsed octal number
+ */
+static uint32_t
+re_parse_octal (re_parser_ctx_t *parser_ctx_p) /**< RegExp parser context */
+{
+  uint32_t number = 0;
+  for (int index = 0;
+       index < 3
+       && parser_ctx_p->input_curr_p < parser_ctx_p->input_end_p
+       && lit_char_is_octal_digit (*parser_ctx_p->input_curr_p);
+       index++)
+  {
+    number = number * 8 + lit_char_hex_to_int (*parser_ctx_p->input_curr_p++);
+  }
+
+  return number;
+} /* re_parse_octal */
+
+/**
+ * Parse RegExp iterators
+ *
+ * @return empty ecma value - if parsed successfully
+ *         error ecma value - otherwise
+ *
+ *         Returned value must be freed with ecma_free_value
+ */
+static ecma_value_t
+re_parse_iterator (re_parser_ctx_t *parser_ctx_p, /**< RegExp parser context */
+                   re_token_t *re_token_p) /**< [out] output token */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  re_token_p->qmin = 1;
+  re_token_p->qmax = 1;
+  re_token_p->greedy = true;
+
+  if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+  {
+    return ret_value;
+  }
+
+  ecma_char_t ch = *parser_ctx_p->input_curr_p;
+
+  switch (ch)
+  {
+    case LIT_CHAR_QUESTION:
+    {
+      parser_ctx_p->input_curr_p++;
+      re_token_p->qmin = 0;
+      re_token_p->qmax = 1;
+      re_token_p->greedy = !re_parse_non_greedy_char (parser_ctx_p);
+      break;
+    }
+    case LIT_CHAR_ASTERISK:
+    {
+      parser_ctx_p->input_curr_p++;
+      re_token_p->qmin = 0;
+      re_token_p->qmax = RE_ITERATOR_INFINITE;
+      re_token_p->greedy = !re_parse_non_greedy_char (parser_ctx_p);
+      break;
+    }
+    case LIT_CHAR_PLUS:
+    {
+      parser_ctx_p->input_curr_p++;
+      re_token_p->qmin = 1;
+      re_token_p->qmax = RE_ITERATOR_INFINITE;
+      re_token_p->greedy = !re_parse_non_greedy_char (parser_ctx_p);
+      break;
+    }
+    case LIT_CHAR_LEFT_BRACE:
+    {
+      parser_ctx_p->input_curr_p++;
+      uint32_t qmin = 0;
+      uint32_t qmax = RE_ITERATOR_INFINITE;
+      uint32_t digits = 0;
+
+      while (true)
+      {
+        if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+        {
+          return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid quantifier"));
+        }
+
+        ch = *parser_ctx_p->input_curr_p++;
+
+        if (lit_char_is_decimal_digit (ch))
+        {
+          if (digits >= ECMA_NUMBER_MAX_DIGITS)
+          {
+            return ecma_raise_syntax_error (ECMA_ERR_MSG ("RegExp quantifier error: too many digits."));
+          }
+          digits++;
+          qmin = qmin * 10 + lit_char_hex_to_int (ch);
+        }
+        else if (ch == LIT_CHAR_COMMA)
+        {
+          if (qmax != RE_ITERATOR_INFINITE)
+          {
+            return ecma_raise_syntax_error (ECMA_ERR_MSG ("RegExp quantifier error: double comma."));
+          }
+
+          if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+          {
+            return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid quantifier"));
+          }
+
+          if (*parser_ctx_p->input_curr_p == LIT_CHAR_RIGHT_BRACE)
+          {
+            if (digits == 0)
+            {
+              return ecma_raise_syntax_error (ECMA_ERR_MSG ("RegExp quantifier error: missing digits."));
+            }
+
+            parser_ctx_p->input_curr_p++;
+            re_token_p->qmin = qmin;
+            re_token_p->qmax = RE_ITERATOR_INFINITE;
+            break;
+          }
+          qmax = qmin;
+          qmin = 0;
+          digits = 0;
+        }
+        else if (ch == LIT_CHAR_RIGHT_BRACE)
+        {
+          if (digits == 0)
+          {
+            return ecma_raise_syntax_error (ECMA_ERR_MSG ("RegExp quantifier error: missing digits."));
+          }
+
+          if (qmax != RE_ITERATOR_INFINITE)
+          {
+            re_token_p->qmin = qmax;
+          }
+          else
+          {
+            re_token_p->qmin = qmin;
+          }
+
+          re_token_p->qmax = qmin;
+
+          break;
+        }
+        else
+        {
+          return ecma_raise_syntax_error (ECMA_ERR_MSG ("RegExp quantifier error: unknown char."));
+        }
+      }
+
+      re_token_p->greedy = !re_parse_non_greedy_char (parser_ctx_p);
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  JERRY_ASSERT (ecma_is_value_empty (ret_value));
+
+  if (re_token_p->qmin > re_token_p->qmax)
+  {
+    ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("RegExp quantifier error: qmin > qmax."));
+  }
+
+  return ret_value;
+} /* re_parse_iterator */
+
+/**
+ * Count the number of groups in pattern
+ */
+static void
+re_count_num_of_groups (re_parser_ctx_t *parser_ctx_p) /**< RegExp parser context */
+{
+  int char_class_in = 0;
+  parser_ctx_p->num_of_groups = 0;
+  const lit_utf8_byte_t *curr_p = parser_ctx_p->input_start_p;
+
+  while (curr_p < parser_ctx_p->input_end_p)
+  {
+    switch (*curr_p++)
+    {
+      case LIT_CHAR_BACKSLASH:
+      {
+        lit_utf8_incr (&curr_p);
+        break;
+      }
+      case LIT_CHAR_LEFT_SQUARE:
+      {
+        char_class_in++;
+        break;
+      }
+      case LIT_CHAR_RIGHT_SQUARE:
+      {
+        if (char_class_in)
+        {
+          char_class_in--;
+        }
+        break;
+      }
+      case LIT_CHAR_LEFT_PAREN:
+      {
+        if (curr_p < parser_ctx_p->input_end_p
+            && *curr_p != LIT_CHAR_QUESTION
+            && !char_class_in)
+        {
+          parser_ctx_p->num_of_groups++;
+        }
+        break;
+      }
+    }
+  }
+} /* re_count_num_of_groups */
+
+/**
+ * Read the input pattern and parse the range of character class
+ *
+ * @return empty ecma value - if parsed successfully
+ *         error ecma value - otherwise
+ *
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+re_parse_char_class (re_parser_ctx_t *parser_ctx_p, /**< number of classes */
+                     re_char_class_callback append_char_class, /**< callback function,
+                                                                *   which adds the char-ranges
+                                                                *   to the bytecode */
+                     void *re_ctx_p, /**< regexp compiler context */
+                     re_token_t *out_token_p) /**< [out] output token */
+{
+  re_token_type_t token_type = ((re_compiler_ctx_t *) re_ctx_p)->current_token.type;
+  out_token_p->qmax = out_token_p->qmin = 1;
+  ecma_char_t start = LIT_CHAR_UNDEF;
+  bool is_range = false;
+  parser_ctx_p->num_of_classes = 0;
+
+  if (lit_utf8_peek_prev (parser_ctx_p->input_curr_p) != LIT_CHAR_LEFT_SQUARE)
+  {
+    lit_utf8_decr (&parser_ctx_p->input_curr_p);
+    lit_utf8_decr (&parser_ctx_p->input_curr_p);
+  }
+
+  do
+  {
+    if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+    {
+      return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, end of string"));
+    }
+
+    ecma_char_t ch = lit_utf8_read_next (&parser_ctx_p->input_curr_p);
+
+    if (ch == LIT_CHAR_RIGHT_SQUARE)
+    {
+      if (start != LIT_CHAR_UNDEF)
+      {
+        append_char_class (re_ctx_p, start, start);
+      }
+      break;
+    }
+    else if (ch == LIT_CHAR_MINUS)
+    {
+      if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+      {
+        return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, end of string after '-'"));
+      }
+
+      if (start != LIT_CHAR_UNDEF
+          && !is_range
+          && *parser_ctx_p->input_curr_p != LIT_CHAR_RIGHT_SQUARE)
+      {
+        is_range = true;
+        continue;
+      }
+    }
+    else if (ch == LIT_CHAR_BACKSLASH)
+    {
+      if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+      {
+        return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, end of string after '\\'"));
+      }
+
+      ch = lit_utf8_read_next (&parser_ctx_p->input_curr_p);
+
+      if (ch == LIT_CHAR_LOWERCASE_B)
+      {
+        ch = LIT_CHAR_BS;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_F)
+      {
+        ch = LIT_CHAR_FF;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_N)
+      {
+        ch = LIT_CHAR_LF;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_T)
+      {
+        ch = LIT_CHAR_TAB;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_R)
+      {
+        ch = LIT_CHAR_CR;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_V)
+      {
+        ch = LIT_CHAR_VTAB;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_C)
+      {
+        if (parser_ctx_p->input_curr_p < parser_ctx_p->input_end_p)
+        {
+          ch = *parser_ctx_p->input_curr_p;
+
+          if ((ch >= LIT_CHAR_ASCII_UPPERCASE_LETTERS_BEGIN && ch <= LIT_CHAR_ASCII_UPPERCASE_LETTERS_END)
+              || (ch >= LIT_CHAR_ASCII_LOWERCASE_LETTERS_BEGIN && ch <= LIT_CHAR_ASCII_LOWERCASE_LETTERS_END)
+              || (ch >= LIT_CHAR_0 && ch <= LIT_CHAR_9))
+          {
+            /* See ECMA-262 v5, 15.10.2.10 (Point 3) */
+            ch = (ch % 32);
+            parser_ctx_p->input_curr_p++;
+          }
+          else
+          {
+            ch = LIT_CHAR_LOWERCASE_C;
+          }
+        }
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_X)
+      {
+        ecma_char_t code_unit;
+
+        if (!lit_read_code_unit_from_hex (parser_ctx_p->input_curr_p, 2, &code_unit))
+        {
+          return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, end of string after '\\x'"));
+        }
+
+        parser_ctx_p->input_curr_p += 2;
+        if (is_range == false && lit_utf8_peek_next (parser_ctx_p->input_curr_p) == LIT_CHAR_MINUS)
+        {
+          start = code_unit;
+          continue;
+        }
+
+        ch = code_unit;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_U)
+      {
+        ecma_char_t code_unit;
+
+        if (!lit_read_code_unit_from_hex (parser_ctx_p->input_curr_p, 4, &code_unit))
+        {
+          return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, end of string after '\\u'"));
+        }
+
+        parser_ctx_p->input_curr_p += 4;
+        if (is_range == false && lit_utf8_peek_next (parser_ctx_p->input_curr_p) == LIT_CHAR_MINUS)
+        {
+          start = code_unit;
+          continue;
+        }
+
+        ch = code_unit;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_D)
+      {
+        /* See ECMA-262 v5, 15.10.2.12 */
+        append_char_class (re_ctx_p, LIT_CHAR_ASCII_DIGITS_BEGIN, LIT_CHAR_ASCII_DIGITS_END);
+        ch = LIT_CHAR_UNDEF;
+      }
+      else if (ch == LIT_CHAR_UPPERCASE_D)
+      {
+        /* See ECMA-262 v5, 15.10.2.12 */
+        append_char_class (re_ctx_p, LIT_CHAR_NULL, LIT_CHAR_ASCII_DIGITS_BEGIN - 1);
+        append_char_class (re_ctx_p, LIT_CHAR_ASCII_DIGITS_END + 1, LIT_UTF16_CODE_UNIT_MAX);
+        ch = LIT_CHAR_UNDEF;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_S)
+      {
+        /* See ECMA-262 v5, 15.10.2.12 */
+        append_char_class (re_ctx_p, LIT_CHAR_TAB, LIT_CHAR_CR);
+        append_char_class (re_ctx_p, LIT_CHAR_SP, LIT_CHAR_SP);
+        append_char_class (re_ctx_p, LIT_CHAR_NBSP, LIT_CHAR_NBSP);
+        append_char_class (re_ctx_p, 0x1680UL, 0x1680UL); /* Ogham Space Mark */
+        append_char_class (re_ctx_p, 0x180EUL, 0x180EUL); /* Mongolian Vowel Separator */
+        append_char_class (re_ctx_p, 0x2000UL, 0x200AUL); /* En Quad - Hair Space */
+        append_char_class (re_ctx_p, LIT_CHAR_LS, LIT_CHAR_PS);
+        append_char_class (re_ctx_p, 0x202FUL, 0x202FUL); /* Narrow No-Break Space */
+        append_char_class (re_ctx_p, 0x205FUL, 0x205FUL); /* Medium Mathematical Space */
+        append_char_class (re_ctx_p, 0x3000UL, 0x3000UL); /* Ideographic Space */
+        append_char_class (re_ctx_p, LIT_CHAR_BOM, LIT_CHAR_BOM);
+        ch = LIT_CHAR_UNDEF;
+      }
+      else if (ch == LIT_CHAR_UPPERCASE_S)
+      {
+        /* See ECMA-262 v5, 15.10.2.12 */
+        append_char_class (re_ctx_p, LIT_CHAR_NULL, LIT_CHAR_TAB - 1);
+        append_char_class (re_ctx_p, LIT_CHAR_CR + 1, LIT_CHAR_SP - 1);
+        append_char_class (re_ctx_p, LIT_CHAR_SP + 1, LIT_CHAR_NBSP - 1);
+        append_char_class (re_ctx_p, LIT_CHAR_NBSP + 1, 0x167FUL);
+        append_char_class (re_ctx_p, 0x1681UL, 0x180DUL);
+        append_char_class (re_ctx_p, 0x180FUL, 0x1FFFUL);
+        append_char_class (re_ctx_p, 0x200BUL, LIT_CHAR_LS - 1);
+        append_char_class (re_ctx_p, LIT_CHAR_PS + 1, 0x202EUL);
+        append_char_class (re_ctx_p, 0x2030UL, 0x205EUL);
+        append_char_class (re_ctx_p, 0x2060UL, 0x2FFFUL);
+        append_char_class (re_ctx_p, 0x3001UL, LIT_CHAR_BOM - 1);
+        append_char_class (re_ctx_p, LIT_CHAR_BOM + 1, LIT_UTF16_CODE_UNIT_MAX);
+        ch = LIT_CHAR_UNDEF;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_W)
+      {
+        /* See ECMA-262 v5, 15.10.2.12 */
+        append_char_class (re_ctx_p, LIT_CHAR_0, LIT_CHAR_9);
+        append_char_class (re_ctx_p, LIT_CHAR_UPPERCASE_A, LIT_CHAR_UPPERCASE_Z);
+        append_char_class (re_ctx_p, LIT_CHAR_UNDERSCORE, LIT_CHAR_UNDERSCORE);
+        append_char_class (re_ctx_p, LIT_CHAR_LOWERCASE_A, LIT_CHAR_LOWERCASE_Z);
+        ch = LIT_CHAR_UNDEF;
+      }
+      else if (ch == LIT_CHAR_UPPERCASE_W)
+      {
+        /* See ECMA-262 v5, 15.10.2.12 */
+        append_char_class (re_ctx_p, LIT_CHAR_NULL, LIT_CHAR_0 - 1);
+        append_char_class (re_ctx_p, LIT_CHAR_9 + 1, LIT_CHAR_UPPERCASE_A - 1);
+        append_char_class (re_ctx_p, LIT_CHAR_UPPERCASE_Z + 1, LIT_CHAR_UNDERSCORE - 1);
+        append_char_class (re_ctx_p, LIT_CHAR_UNDERSCORE + 1, LIT_CHAR_LOWERCASE_A - 1);
+        append_char_class (re_ctx_p, LIT_CHAR_LOWERCASE_Z + 1, LIT_UTF16_CODE_UNIT_MAX);
+        ch = LIT_CHAR_UNDEF;
+      }
+      else if (lit_char_is_octal_digit ((ecma_char_t) ch)
+               && ch != LIT_CHAR_0)
+      {
+        lit_utf8_decr (&parser_ctx_p->input_curr_p);
+        ch = (ecma_char_t) re_parse_octal (parser_ctx_p);
+      }
+    } /* ch == LIT_CHAR_BACKSLASH */
+
+    if (ch == LIT_CHAR_UNDEF)
+    {
+      if (start != LIT_CHAR_UNDEF)
+      {
+        if (is_range)
+        {
+          return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, invalid range"));
+        }
+        else
+        {
+          append_char_class (re_ctx_p, start, start);
+          start = LIT_CHAR_UNDEF;
+        }
+      }
+    }
+    else
+    {
+      if (start != LIT_CHAR_UNDEF)
+      {
+        if (is_range)
+        {
+          if (start > ch)
+          {
+            return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class, wrong order"));
+          }
+          else
+          {
+            append_char_class (re_ctx_p, start, ch);
+            start = LIT_CHAR_UNDEF;
+            is_range = false;
+          }
+        }
+        else
+        {
+          append_char_class (re_ctx_p, start, start);
+          start = ch;
+        }
+      }
+      else
+      {
+        start = ch;
+      }
+    }
+  }
+  while (token_type == RE_TOK_START_CHAR_CLASS || token_type == RE_TOK_START_INV_CHAR_CLASS);
+
+  return re_parse_iterator (parser_ctx_p, out_token_p);
+} /* re_parse_char_class */
+
+/**
+ * Read the input pattern and parse the next token for the RegExp compiler
+ *
+ * @return empty ecma value - if parsed successfully
+ *         error ecma value - otherwise
+ *
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+re_parse_next_token (re_parser_ctx_t *parser_ctx_p, /**< RegExp parser context */
+                     re_token_t *out_token_p) /**< [out] output token */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+  {
+    out_token_p->type = RE_TOK_EOF;
+    return ret_value;
+  }
+
+  ecma_char_t ch = lit_utf8_read_next (&parser_ctx_p->input_curr_p);
+
+  switch (ch)
+  {
+    case LIT_CHAR_VLINE:
+    {
+      out_token_p->type = RE_TOK_ALTERNATIVE;
+      break;
+    }
+    case LIT_CHAR_CIRCUMFLEX:
+    {
+      out_token_p->type = RE_TOK_ASSERT_START;
+      break;
+    }
+    case LIT_CHAR_DOLLAR_SIGN:
+    {
+      out_token_p->type = RE_TOK_ASSERT_END;
+      break;
+    }
+    case LIT_CHAR_DOT:
+    {
+      out_token_p->type = RE_TOK_PERIOD;
+      ret_value = re_parse_iterator (parser_ctx_p, out_token_p);
+      break;
+    }
+    case LIT_CHAR_BACKSLASH:
+    {
+      if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+      {
+        return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid regular experssion"));
+      }
+
+      out_token_p->type = RE_TOK_CHAR;
+      ch = lit_utf8_read_next (&parser_ctx_p->input_curr_p);
+
+      if (ch == LIT_CHAR_LOWERCASE_B)
+      {
+        out_token_p->type = RE_TOK_ASSERT_WORD_BOUNDARY;
+      }
+      else if (ch == LIT_CHAR_UPPERCASE_B)
+      {
+        out_token_p->type = RE_TOK_ASSERT_NOT_WORD_BOUNDARY;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_F)
+      {
+        out_token_p->value = LIT_CHAR_FF;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_N)
+      {
+        out_token_p->value = LIT_CHAR_LF;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_T)
+      {
+        out_token_p->value = LIT_CHAR_TAB;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_R)
+      {
+        out_token_p->value = LIT_CHAR_CR;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_V)
+      {
+        out_token_p->value = LIT_CHAR_VTAB;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_C)
+      {
+        if (parser_ctx_p->input_curr_p < parser_ctx_p->input_end_p)
+        {
+          ch = *parser_ctx_p->input_curr_p;
+
+          if ((ch >= LIT_CHAR_ASCII_UPPERCASE_LETTERS_BEGIN && ch <= LIT_CHAR_ASCII_UPPERCASE_LETTERS_END)
+              || (ch >= LIT_CHAR_ASCII_LOWERCASE_LETTERS_BEGIN && ch <= LIT_CHAR_ASCII_LOWERCASE_LETTERS_END))
+          {
+            out_token_p->value = (ch % 32);
+            parser_ctx_p->input_curr_p++;
+          }
+          else
+          {
+            out_token_p->value = LIT_CHAR_BACKSLASH;
+            parser_ctx_p->input_curr_p--;
+          }
+        }
+        else
+        {
+          out_token_p->value = LIT_CHAR_BACKSLASH;
+          parser_ctx_p->input_curr_p--;
+        }
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_X
+               && re_hex_lookup (parser_ctx_p, 2))
+      {
+        ecma_char_t code_unit;
+
+        if (!lit_read_code_unit_from_hex (parser_ctx_p->input_curr_p, 2, &code_unit))
+        {
+          return ecma_raise_syntax_error (ECMA_ERR_MSG ("decode error"));
+        }
+
+        parser_ctx_p->input_curr_p += 2;
+        out_token_p->value = code_unit;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_U
+               && re_hex_lookup (parser_ctx_p, 4))
+      {
+        ecma_char_t code_unit;
+
+        if (!lit_read_code_unit_from_hex (parser_ctx_p->input_curr_p, 4, &code_unit))
+        {
+          return ecma_raise_syntax_error (ECMA_ERR_MSG ("decode error"));
+        }
+
+        parser_ctx_p->input_curr_p += 4;
+        out_token_p->value = code_unit;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_D)
+      {
+        out_token_p->type = RE_TOK_DIGIT;
+        break;
+      }
+      else if (ch == LIT_CHAR_UPPERCASE_D)
+      {
+        out_token_p->type = RE_TOK_NOT_DIGIT;
+        break;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_S)
+      {
+        out_token_p->type = RE_TOK_WHITE;
+        break;
+      }
+      else if (ch == LIT_CHAR_UPPERCASE_S)
+      {
+        out_token_p->type = RE_TOK_NOT_WHITE;
+        break;
+      }
+      else if (ch == LIT_CHAR_LOWERCASE_W)
+      {
+        out_token_p->type = RE_TOK_WORD_CHAR;
+        break;
+      }
+      else if (ch == LIT_CHAR_UPPERCASE_W)
+      {
+        out_token_p->type = RE_TOK_NOT_WORD_CHAR;
+        break;
+      }
+      else if (lit_char_is_decimal_digit (ch))
+      {
+        if (ch == LIT_CHAR_0)
+        {
+          if (parser_ctx_p->input_curr_p < parser_ctx_p->input_end_p
+              && lit_char_is_decimal_digit (*parser_ctx_p->input_curr_p))
+          {
+            return ecma_raise_syntax_error (ECMA_ERR_MSG ("RegExp escape pattern error."));
+          }
+
+          out_token_p->value = LIT_UNICODE_CODE_POINT_NULL;
+        }
+        else
+        {
+          if (parser_ctx_p->num_of_groups == -1)
+          {
+            re_count_num_of_groups (parser_ctx_p);
+          }
+
+          if (parser_ctx_p->num_of_groups)
+          {
+            parser_ctx_p->input_curr_p--;
+            uint32_t number = 0;
+            int index = 0;
+
+            do
+            {
+              if (index >= RE_MAX_RE_DECESC_DIGITS)
+              {
+                ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("RegExp escape error: decimal escape too long."));
+                return ret_value;
+              }
+              if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+              {
+                break;
+              }
+
+              ecma_char_t digit = *parser_ctx_p->input_curr_p++;
+
+              if (!lit_char_is_decimal_digit (digit))
+              {
+                parser_ctx_p->input_curr_p--;
+                break;
+              }
+              number = number * 10 + lit_char_hex_to_int (digit);
+              index++;
+            }
+            while (true);
+
+            if ((int) number <= parser_ctx_p->num_of_groups)
+            {
+              out_token_p->type = RE_TOK_BACKREFERENCE;
+            }
+            else
+            /* Invalid backreference, fallback to octal */
+            {
+              /* Rewind to start of number. */
+              parser_ctx_p->input_curr_p -= index;
+
+              /* Try to reparse as octal. */
+              ecma_char_t digit = *parser_ctx_p->input_curr_p;
+
+              if (!lit_char_is_octal_digit (digit))
+              {
+                /* Not octal, keep digit character value. */
+                number = digit;
+                parser_ctx_p->input_curr_p++;
+              }
+              else
+              {
+                number = re_parse_octal (parser_ctx_p);
+              }
+            }
+            out_token_p->value = number;
+          }
+          else
+          /* Invalid backreference, fallback to octal if possible */
+          {
+            if (!lit_char_is_octal_digit (ch))
+            {
+              /* Not octal, keep character value. */
+              out_token_p->value = ch;
+            }
+            else
+            {
+              parser_ctx_p->input_curr_p--;
+              out_token_p->value = re_parse_octal (parser_ctx_p);
+            }
+          }
+        }
+      }
+      else
+      {
+        out_token_p->value = ch;
+      }
+
+      ret_value = re_parse_iterator (parser_ctx_p, out_token_p);
+      break;
+    }
+    case LIT_CHAR_LEFT_PAREN:
+    {
+      if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+      {
+        return ecma_raise_syntax_error (ECMA_ERR_MSG ("Unterminated group"));
+      }
+
+      if (*parser_ctx_p->input_curr_p == LIT_CHAR_QUESTION)
+      {
+        parser_ctx_p->input_curr_p++;
+        if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+        {
+          return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid group"));
+        }
+
+        ch = *parser_ctx_p->input_curr_p++;
+
+        if (ch == LIT_CHAR_EQUALS)
+        {
+          /* (?= */
+          out_token_p->type = RE_TOK_ASSERT_START_POS_LOOKAHEAD;
+        }
+        else if (ch == LIT_CHAR_EXCLAMATION)
+        {
+          /* (?! */
+          out_token_p->type = RE_TOK_ASSERT_START_NEG_LOOKAHEAD;
+        }
+        else if (ch == LIT_CHAR_COLON)
+        {
+          /* (?: */
+          out_token_p->type = RE_TOK_START_NON_CAPTURE_GROUP;
+        }
+        else
+        {
+          return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid group"));
+        }
+      }
+      else
+      {
+        /* ( */
+        out_token_p->type = RE_TOK_START_CAPTURE_GROUP;
+      }
+      break;
+    }
+    case LIT_CHAR_RIGHT_PAREN:
+    {
+      out_token_p->type = RE_TOK_END_GROUP;
+      ret_value = re_parse_iterator (parser_ctx_p, out_token_p);
+      break;
+    }
+    case LIT_CHAR_LEFT_SQUARE:
+    {
+      out_token_p->type = RE_TOK_START_CHAR_CLASS;
+
+      if (parser_ctx_p->input_curr_p >= parser_ctx_p->input_end_p)
+      {
+        return ecma_raise_syntax_error (ECMA_ERR_MSG ("invalid character class"));
+      }
+
+      if (*parser_ctx_p->input_curr_p == LIT_CHAR_CIRCUMFLEX)
+      {
+        out_token_p->type = RE_TOK_START_INV_CHAR_CLASS;
+        parser_ctx_p->input_curr_p++;
+      }
+
+      break;
+    }
+    case LIT_CHAR_QUESTION:
+    case LIT_CHAR_ASTERISK:
+    case LIT_CHAR_PLUS:
+    case LIT_CHAR_LEFT_BRACE:
+    {
+      return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid RegExp token."));
+    }
+    case LIT_CHAR_NULL:
+    {
+      out_token_p->type = RE_TOK_EOF;
+      break;
+    }
+    default:
+    {
+      out_token_p->type = RE_TOK_CHAR;
+      out_token_p->value = ch;
+      ret_value = re_parse_iterator (parser_ctx_p, out_token_p);
+      break;
+    }
+  }
+
+  return ret_value;
+} /* re_parse_next_token */
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
diff --git a/deps/jerry/jerry-core/parser/regexp/re-parser.h b/deps/jerry/jerry-core/parser/regexp/re-parser.h
new file mode 100644 (file)
index 0000000..318220e
--- /dev/null
@@ -0,0 +1,117 @@
+/* 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.
+ */
+
+#ifndef RE_PARSER_H
+#define RE_PARSER_H
+
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+
+/** \addtogroup parser Parser
+ * @{
+ *
+ * \addtogroup regexparser Regular expression
+ * @{
+ *
+ * \addtogroup regexparser_bytecode Bytecode
+ * @{
+ */
+
+/**
+ * RegExp token type definitions
+ */
+typedef enum
+{
+  RE_TOK_EOF,                        /**< EOF */
+  RE_TOK_BACKREFERENCE,              /**< "\[0..9]" */
+  RE_TOK_CHAR,                       /**< any character */
+  RE_TOK_ALTERNATIVE,                /**< "|" */
+  RE_TOK_ASSERT_START,               /**< "^" */
+  RE_TOK_ASSERT_END,                 /**< "$" */
+  RE_TOK_PERIOD,                     /**< "." */
+  RE_TOK_START_CAPTURE_GROUP,        /**< "(" */
+  RE_TOK_START_NON_CAPTURE_GROUP,    /**< "(?:" */
+  RE_TOK_END_GROUP,                  /**< ")" */
+  RE_TOK_ASSERT_START_POS_LOOKAHEAD, /**< "(?=" */
+  RE_TOK_ASSERT_START_NEG_LOOKAHEAD, /**< "(?!" */
+  RE_TOK_ASSERT_WORD_BOUNDARY,       /**< "\b" */
+  RE_TOK_ASSERT_NOT_WORD_BOUNDARY,   /**< "\B" */
+  RE_TOK_DIGIT,                      /**< "\d" */
+  RE_TOK_NOT_DIGIT,                  /**< "\D" */
+  RE_TOK_WHITE,                      /**< "\s" */
+  RE_TOK_NOT_WHITE,                  /**< "\S" */
+  RE_TOK_WORD_CHAR,                  /**< "\w" */
+  RE_TOK_NOT_WORD_CHAR,              /**< "\W" */
+  RE_TOK_START_CHAR_CLASS,           /**< "[ ]" */
+  RE_TOK_START_INV_CHAR_CLASS,       /**< "[^ ]" */
+} re_token_type_t;
+
+/**
+ * @}
+ *
+ * \addtogroup regexparser_parser Parser
+ * @{
+ */
+
+/**
+ * RegExp constant of infinite
+ */
+#define RE_ITERATOR_INFINITE ((uint32_t) - 1)
+
+/**
+ * Maximum number of decimal escape digits
+ */
+#define RE_MAX_RE_DECESC_DIGITS 9
+
+/**
+ * RegExp token type
+ */
+typedef struct
+{
+  re_token_type_t type;   /**< type of the token */
+  uint32_t value;         /**< value of the token */
+  uint32_t qmin;          /**< minimum number of token iterations */
+  uint32_t qmax;          /**< maximum number of token iterations */
+  bool greedy;            /**< type of iteration */
+} re_token_t;
+
+/**
+  * RegExp parser context
+  */
+typedef struct
+{
+  const lit_utf8_byte_t *input_start_p; /**< start of input pattern */
+  const lit_utf8_byte_t *input_curr_p;  /**< current position in input pattern */
+  const lit_utf8_byte_t *input_end_p;   /**< end of input pattern */
+  int num_of_groups;              /**< number of groups */
+  uint32_t num_of_classes;        /**< number of character classes */
+} re_parser_ctx_t;
+
+typedef void (*re_char_class_callback) (void *re_ctx_p, ecma_char_t start, ecma_char_t end);
+
+ecma_value_t
+re_parse_char_class (re_parser_ctx_t *parser_ctx_p, re_char_class_callback append_char_class, void *re_ctx_p,
+                     re_token_t *out_token_p);
+
+ecma_value_t
+re_parse_next_token (re_parser_ctx_t *parser_ctx_p, re_token_t *out_token_p);
+
+/**
+ * @}
+ * @}
+ * @}
+ */
+
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+#endif /* !RE_PARSER_H */
diff --git a/deps/jerry/jerry-core/profiles/README.md b/deps/jerry/jerry-core/profiles/README.md
new file mode 100644 (file)
index 0000000..f520460
--- /dev/null
@@ -0,0 +1,39 @@
+
+### About profile files
+
+Specify compile definitions in profile files to use when compiling the `jerry-core` target.
+
+The default profile is ``es5.1`` which disables the ES2015 features.
+
+### Using profiles with the build system
+
+You can specify the profile for the build system in the following ways:
+  * with absolute path
+  * with a name (this options selects profiles/$(name).profile file)
+
+#### Restrictions
+Only single line options are allowed in the profile file. Any line starting with hash-mark is ignored. Semicolon character is not allowed.
+
+### Example usage:
+
+#### 1. Using the build script
+
+```
+# assuming you are in jerryscript folder
+./tools/build.py --profile=/absolute/path/to/my_profile.any_extension
+```
+
+or
+
+```
+# assuming you are in jerryscript folder
+./tools/build.py --profile=minimal
+```
+
+This command selects the profiles/minimal.profile file.
+
+#### 2. Using only CMake build system
+
+Set FEATURE_PROFILE option to one of the following values:
+* the profile with absolute path
+* name of the profile (which needs to exist in the `profiles` folder)
diff --git a/deps/jerry/jerry-core/profiles/es2015-subset.profile b/deps/jerry/jerry-core/profiles/es2015-subset.profile
new file mode 100644 (file)
index 0000000..93c0f35
--- /dev/null
@@ -0,0 +1 @@
+# Currently an empty profile.
diff --git a/deps/jerry/jerry-core/profiles/es5.1.profile b/deps/jerry/jerry-core/profiles/es5.1.profile
new file mode 100644 (file)
index 0000000..af04018
--- /dev/null
@@ -0,0 +1,3 @@
+CONFIG_DISABLE_ES2015_BUILTIN
+CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
diff --git a/deps/jerry/jerry-core/profiles/minimal.profile b/deps/jerry/jerry-core/profiles/minimal.profile
new file mode 100644 (file)
index 0000000..c56cc8b
--- /dev/null
@@ -0,0 +1,14 @@
+CONFIG_DISABLE_ANNEXB_BUILTIN
+CONFIG_DISABLE_ARRAY_BUILTIN
+CONFIG_DISABLE_BOOLEAN_BUILTIN
+CONFIG_DISABLE_DATE_BUILTIN
+CONFIG_DISABLE_ERROR_BUILTINS
+CONFIG_DISABLE_ES2015_BUILTIN
+CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
+CONFIG_DISABLE_JSON_BUILTIN
+CONFIG_DISABLE_MATH_BUILTIN
+CONFIG_DISABLE_NUMBER_BUILTIN
+CONFIG_DISABLE_REGEXP_BUILTIN
+CONFIG_DISABLE_STRING_BUILTIN
+CONFIG_DISABLE_UNICODE_CASE_CONVERSION
diff --git a/deps/jerry/jerry-core/vm/opcodes-ecma-arithmetics.c b/deps/jerry/jerry-core/vm/opcodes-ecma-arithmetics.c
new file mode 100644 (file)
index 0000000..f11607c
--- /dev/null
@@ -0,0 +1,223 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-conversion.h"
+#include "ecma-helpers.h"
+#include "ecma-number-arithmetic.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "opcodes.h"
+#include "jrt-libc-includes.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup vm_opcodes Opcodes
+ * @{
+ */
+
+/**
+ * Perform ECMA number arithmetic operation.
+ *
+ * The algorithm of the operation is following:
+ *   leftNum = ToNumber (leftValue);
+ *   rightNum = ToNumber (rightValue);
+ *   result = leftNum ArithmeticOp rightNum;
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+do_number_arithmetic (number_arithmetic_op op, /**< number arithmetic operation */
+                      ecma_value_t left_value, /**< left value */
+                      ecma_value_t right_value) /**< right value */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (num_left, left_value, ret_value);
+  ECMA_OP_TO_NUMBER_TRY_CATCH (num_right, right_value, ret_value);
+
+  ecma_number_t result = ECMA_NUMBER_ZERO;
+
+  switch (op)
+  {
+    case NUMBER_ARITHMETIC_SUBSTRACTION:
+    {
+      result = ecma_number_substract (num_left, num_right);
+      break;
+    }
+    case NUMBER_ARITHMETIC_MULTIPLICATION:
+    {
+      result = ecma_number_multiply (num_left, num_right);
+      break;
+    }
+    case NUMBER_ARITHMETIC_DIVISION:
+    {
+      result = ecma_number_divide (num_left, num_right);
+      break;
+    }
+    case NUMBER_ARITHMETIC_REMAINDER:
+    {
+      result = ecma_op_number_remainder (num_left, num_right);
+      break;
+    }
+  }
+
+  ret_value = ecma_make_number_value (result);
+
+  ECMA_OP_TO_NUMBER_FINALIZE (num_right);
+  ECMA_OP_TO_NUMBER_FINALIZE (num_left);
+
+  return ret_value;
+} /* do_number_arithmetic */
+
+/**
+ * 'Addition' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.6.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_addition (ecma_value_t left_value, /**< left value */
+                 ecma_value_t right_value) /**< right value */
+{
+  bool free_left_value = false;
+  bool free_right_value = false;
+
+  if (ecma_is_value_object (left_value))
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (left_value);
+    left_value = ecma_op_object_default_value (obj_p, ECMA_PREFERRED_TYPE_NO);
+    free_left_value = true;
+
+    if (ECMA_IS_VALUE_ERROR (left_value))
+    {
+      return left_value;
+    }
+  }
+
+  if (ecma_is_value_object (right_value))
+  {
+    ecma_object_t *obj_p = ecma_get_object_from_value (right_value);
+    right_value = ecma_op_object_default_value (obj_p, ECMA_PREFERRED_TYPE_NO);
+    free_right_value = true;
+
+    if (ECMA_IS_VALUE_ERROR (right_value))
+    {
+      if (free_left_value)
+      {
+        ecma_free_value (left_value);
+      }
+      return right_value;
+    }
+  }
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (ecma_is_value_string (left_value)
+      || ecma_is_value_string (right_value))
+  {
+    ECMA_TRY_CATCH (str_left_value, ecma_op_to_string (left_value), ret_value);
+    ECMA_TRY_CATCH (str_right_value, ecma_op_to_string (right_value), ret_value);
+
+    ecma_string_t *string1_p = ecma_get_string_from_value (str_left_value);
+    ecma_string_t *string2_p = ecma_get_string_from_value (str_right_value);
+
+    ecma_string_t *concat_str_p = ecma_concat_ecma_strings (string1_p, string2_p);
+
+    ret_value = ecma_make_string_value (concat_str_p);
+
+    ECMA_FINALIZE (str_right_value);
+    ECMA_FINALIZE (str_left_value);
+  }
+  else
+  {
+    ECMA_OP_TO_NUMBER_TRY_CATCH (num_left, left_value, ret_value);
+    ECMA_OP_TO_NUMBER_TRY_CATCH (num_right, right_value, ret_value);
+
+    ret_value = ecma_make_number_value (ecma_number_add (num_left, num_right));
+
+    ECMA_OP_TO_NUMBER_FINALIZE (num_right);
+    ECMA_OP_TO_NUMBER_FINALIZE (num_left);
+  }
+
+  if (free_left_value)
+  {
+    ecma_free_value (left_value);
+  }
+
+  if (free_right_value)
+  {
+    ecma_free_value (right_value);
+  }
+
+  return ret_value;
+} /* opfunc_addition */
+
+/**
+ * 'Unary "+"' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.4, 11.4.6
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_unary_plus (ecma_value_t left_value) /**< left value */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (num_var_value,
+                               left_value,
+                               ret_value);
+
+  ret_value = ecma_make_number_value (num_var_value);
+
+  ECMA_OP_TO_NUMBER_FINALIZE (num_var_value);
+
+  return ret_value;
+} /* opfunc_unary_plus */
+
+/**
+ * 'Unary "-"' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.4, 11.4.7
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_unary_minus (ecma_value_t left_value) /**< left value */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (num_var_value,
+                               left_value,
+                               ret_value);
+
+  ret_value = ecma_make_number_value (ecma_number_negate (num_var_value));
+
+  ECMA_OP_TO_NUMBER_FINALIZE (num_var_value);
+
+  return ret_value;
+} /* opfunc_unary_minus */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/vm/opcodes-ecma-bitwise.c b/deps/jerry/jerry-core/vm/opcodes-ecma-bitwise.c
new file mode 100644 (file)
index 0000000..2375518
--- /dev/null
@@ -0,0 +1,156 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-conversion.h"
+#include "ecma-helpers.h"
+#include "ecma-try-catch-macro.h"
+#include "opcodes.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup vm_opcodes Opcodes
+ * @{
+ */
+
+/**
+ * Perform ECMA number logic operation.
+ *
+ * The algorithm of the operation is following:
+ *   leftNum = ToNumber (leftValue);
+ *   rightNum = ToNumber (rightValue);
+ *   result = leftNum BitwiseLogicOp rightNum;
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+do_number_bitwise_logic (number_bitwise_logic_op op, /**< number bitwise logic operation */
+                         ecma_value_t left_value, /**< left value */
+                         ecma_value_t right_value) /**< right value */
+{
+  JERRY_STATIC_ASSERT (ECMA_DIRECT_TYPE_INTEGER_VALUE == 0,
+                       ecma_direct_type_integer_value_must_be_zero_for_bitwise_logic);
+  JERRY_STATIC_ASSERT ((ECMA_DIRECT_TYPE_MASK | ECMA_VALUE_ERROR_FLAG) == ((1 << ECMA_DIRECT_SHIFT) - 1),
+                       direct_type_mask_and_error_flag_must_fill_all_bits_before_the_value_starts);
+
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                && !ECMA_IS_VALUE_ERROR (right_value));
+
+  if (ecma_are_values_integer_numbers (left_value, right_value))
+  {
+    switch (op)
+    {
+      case NUMBER_BITWISE_LOGIC_AND:
+      {
+        return left_value & right_value;
+      }
+      case NUMBER_BITWISE_LOGIC_OR:
+      {
+        return left_value | right_value;
+      }
+      case NUMBER_BITWISE_LOGIC_XOR:
+      {
+        return (left_value ^ right_value) & (ecma_value_t) (~((1 << ECMA_DIRECT_SHIFT) - 1));
+      }
+      case NUMBER_BITWISE_SHIFT_LEFT:
+      {
+        ecma_integer_value_t left_integer = ecma_get_integer_from_value (left_value);
+        ecma_integer_value_t right_integer = ecma_get_integer_from_value (right_value);
+        return ecma_make_int32_value ((int32_t) (left_integer << (right_integer & 0x1f)));
+      }
+      case NUMBER_BITWISE_SHIFT_RIGHT:
+      {
+        ecma_integer_value_t left_integer = ecma_get_integer_from_value (left_value);
+        ecma_integer_value_t right_integer = ecma_get_integer_from_value (right_value);
+        return ecma_make_integer_value (left_integer >> (right_integer & 0x1f));
+      }
+      case NUMBER_BITWISE_SHIFT_URIGHT:
+      {
+        uint32_t left_uint32 = (uint32_t) ecma_get_integer_from_value (left_value);
+        ecma_integer_value_t right_integer = ecma_get_integer_from_value (right_value);
+        return ecma_make_uint32_value (left_uint32 >> (right_integer & 0x1f));
+      }
+      case NUMBER_BITWISE_NOT:
+      {
+        return (~right_value) & (ecma_value_t) (~((1 << ECMA_DIRECT_SHIFT) - 1));
+      }
+    }
+  }
+
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ECMA_OP_TO_NUMBER_TRY_CATCH (num_left, left_value, ret_value);
+  ECMA_OP_TO_NUMBER_TRY_CATCH (num_right, right_value, ret_value);
+
+  ecma_number_t result = ECMA_NUMBER_ZERO;
+  uint32_t right_uint32 = ecma_number_to_uint32 (num_right);
+
+  switch (op)
+  {
+    case NUMBER_BITWISE_LOGIC_AND:
+    {
+      uint32_t left_uint32 = ecma_number_to_uint32 (num_left);
+      result = (ecma_number_t) ((int32_t) (left_uint32 & right_uint32));
+      break;
+    }
+    case NUMBER_BITWISE_LOGIC_OR:
+    {
+      uint32_t left_uint32 = ecma_number_to_uint32 (num_left);
+      result = (ecma_number_t) ((int32_t) (left_uint32 | right_uint32));
+      break;
+    }
+    case NUMBER_BITWISE_LOGIC_XOR:
+    {
+      uint32_t left_uint32 = ecma_number_to_uint32 (num_left);
+      result = (ecma_number_t) ((int32_t) (left_uint32 ^ right_uint32));
+      break;
+    }
+    case NUMBER_BITWISE_SHIFT_LEFT:
+    {
+      result = (ecma_number_t) (ecma_number_to_int32 (num_left) << (right_uint32 & 0x1F));
+      break;
+    }
+    case NUMBER_BITWISE_SHIFT_RIGHT:
+    {
+      result = (ecma_number_t) (ecma_number_to_int32 (num_left) >> (right_uint32 & 0x1F));
+      break;
+    }
+    case NUMBER_BITWISE_SHIFT_URIGHT:
+    {
+      uint32_t left_uint32 = ecma_number_to_uint32 (num_left);
+      result = (ecma_number_t) (left_uint32 >> (right_uint32 & 0x1F));
+      break;
+    }
+    case NUMBER_BITWISE_NOT:
+    {
+      result = (ecma_number_t) ((int32_t) ~right_uint32);
+      break;
+    }
+  }
+
+  ret_value = ecma_make_number_value (result);
+
+  ECMA_OP_TO_NUMBER_FINALIZE (num_right);
+  ECMA_OP_TO_NUMBER_FINALIZE (num_left);
+
+  return ret_value;
+} /* do_number_bitwise_logic */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/vm/opcodes-ecma-equality.c b/deps/jerry/jerry-core/vm/opcodes-ecma-equality.c
new file mode 100644 (file)
index 0000000..175c7a1
--- /dev/null
@@ -0,0 +1,90 @@
+/* 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.
+ */
+
+#include "ecma-builtins.h"
+#include "ecma-comparison.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-lex-env.h"
+#include "ecma-try-catch-macro.h"
+#include "opcodes.h"
+#include "vm-defines.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup vm_opcodes Opcodes
+ * @{
+ */
+
+/**
+ * 'Equals' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.9.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_equal_value (ecma_value_t left_value, /**< left value */
+                    ecma_value_t right_value) /**< right value */
+{
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                && !ECMA_IS_VALUE_ERROR (right_value));
+
+  ecma_value_t compare_result = ecma_op_abstract_equality_compare (left_value,
+                                                                   right_value);
+
+  JERRY_ASSERT (ecma_is_value_boolean (compare_result)
+                || ECMA_IS_VALUE_ERROR (compare_result));
+
+  return compare_result;
+} /* opfunc_equal_value */
+
+/**
+ * 'Does-not-equals' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.9.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_not_equal_value (ecma_value_t left_value, /**< left value */
+                        ecma_value_t right_value) /**< right value */
+{
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                && !ECMA_IS_VALUE_ERROR (right_value));
+
+  ecma_value_t compare_result = ecma_op_abstract_equality_compare (left_value,
+                                                                   right_value);
+
+  JERRY_ASSERT (ecma_is_value_boolean (compare_result)
+                || ECMA_IS_VALUE_ERROR (compare_result));
+
+  if (!ECMA_IS_VALUE_ERROR (compare_result))
+  {
+    compare_result = ecma_invert_boolean_value (compare_result);
+  }
+
+  return compare_result;
+} /* opfunc_not_equal_value */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/vm/opcodes-ecma-relational.c b/deps/jerry/jerry-core/vm/opcodes-ecma-relational.c
new file mode 100644 (file)
index 0000000..4ccfb35
--- /dev/null
@@ -0,0 +1,241 @@
+/* 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.
+ */
+
+#include "ecma-comparison.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-helpers.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "opcodes.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup vm_opcodes Opcodes
+ * @{
+ */
+
+/**
+ * 'Less-than' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.8.1
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_less_than (ecma_value_t left_value, /**< left value */
+                  ecma_value_t right_value) /**< right value */
+{
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                && !ECMA_IS_VALUE_ERROR (right_value));
+
+  ecma_value_t ret_value = ecma_op_abstract_relational_compare (left_value, right_value, true);
+
+  if (ECMA_IS_VALUE_ERROR (ret_value))
+  {
+    return ret_value;
+  }
+
+  if (ecma_is_value_undefined (ret_value))
+  {
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_is_value_boolean (ret_value));
+  }
+
+  return ret_value;
+} /* opfunc_less_than */
+
+/**
+ * 'Greater-than' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.8.2
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_greater_than (ecma_value_t left_value, /**< left value */
+                     ecma_value_t right_value) /**< right value */
+{
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                && !ECMA_IS_VALUE_ERROR (right_value));
+
+  ecma_value_t ret_value = ecma_op_abstract_relational_compare (left_value, right_value, false);
+
+  if (ECMA_IS_VALUE_ERROR (ret_value))
+  {
+    return ret_value;
+  }
+
+  if (ecma_is_value_undefined (ret_value))
+  {
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_is_value_boolean (ret_value));
+  }
+
+  return ret_value;
+} /* opfunc_greater_than */
+
+/**
+ * 'Less-than-or-equal' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.8.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_less_or_equal_than (ecma_value_t left_value, /**< left value */
+                           ecma_value_t right_value) /**< right value */
+{
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                && !ECMA_IS_VALUE_ERROR (right_value));
+
+  ecma_value_t ret_value = ecma_op_abstract_relational_compare (left_value, right_value, false);
+
+  if (ECMA_IS_VALUE_ERROR (ret_value))
+  {
+    return ret_value;
+  }
+
+  if (ecma_is_value_undefined (ret_value))
+  {
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_is_value_boolean (ret_value));
+
+    ret_value = ecma_invert_boolean_value (ret_value);
+  }
+
+  return ret_value;
+} /* opfunc_less_or_equal_than */
+
+/**
+ * 'Greater-than-or-equal' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.8.4
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_greater_or_equal_than (ecma_value_t left_value, /**< left value */
+                              ecma_value_t right_value) /**< right value */
+{
+  JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                && !ECMA_IS_VALUE_ERROR (right_value));
+
+  ecma_value_t ret_value = ecma_op_abstract_relational_compare (left_value, right_value, true);
+
+  if (ECMA_IS_VALUE_ERROR (ret_value))
+  {
+    return ret_value;
+  }
+
+  if (ecma_is_value_undefined (ret_value))
+  {
+    ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_is_value_boolean (ret_value));
+
+    ret_value = ecma_invert_boolean_value (ret_value);
+  }
+
+  return ret_value;
+} /* opfunc_greater_or_equal_than */
+
+/**
+ * 'instanceof' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.8.6
+ *
+ * @return ecma value
+ *         returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+opfunc_instanceof (ecma_value_t left_value, /**< left value */
+                   ecma_value_t right_value) /**< right value */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (right_value))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected an object in 'instanceof' check."));
+  }
+  else
+  {
+    ecma_object_t *right_value_obj_p = ecma_get_object_from_value (right_value);
+
+    ECMA_TRY_CATCH (is_instance_of,
+                    ecma_op_object_has_instance (right_value_obj_p, left_value),
+                    ret_value);
+
+    ret_value = is_instance_of;
+
+    ECMA_FINALIZE (is_instance_of);
+  }
+
+  return ret_value;
+} /* opfunc_instanceof */
+
+/**
+ * 'in' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.8.7
+ *
+ * @return ecma value
+ *         returned value must be freed with ecma_free_value.
+ */
+ecma_value_t
+opfunc_in (ecma_value_t left_value, /**< left value */
+           ecma_value_t right_value) /**< right value */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_value_object (right_value))
+  {
+    ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected an object in 'in' check."));
+  }
+  else
+  {
+    ECMA_TRY_CATCH (str_left_value, ecma_op_to_string (left_value), ret_value);
+
+    ecma_string_t *left_value_prop_name_p = ecma_get_string_from_value (str_left_value);
+    ecma_object_t *right_value_obj_p = ecma_get_object_from_value (right_value);
+
+    ret_value = ecma_make_boolean_value (ecma_op_object_has_property (right_value_obj_p, left_value_prop_name_p));
+
+    ECMA_FINALIZE (str_left_value);
+  }
+
+  return ret_value;
+} /* opfunc_in */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/vm/opcodes.c b/deps/jerry/jerry-core/vm/opcodes.c
new file mode 100644 (file)
index 0000000..dd73afd
--- /dev/null
@@ -0,0 +1,332 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-builtins.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "ecma-lex-env.h"
+#include "ecma-objects.h"
+#include "ecma-try-catch-macro.h"
+#include "opcodes.h"
+#include "vm-defines.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup vm_opcodes Opcodes
+ * @{
+ */
+
+/**
+ * 'Variable declaration' opcode handler.
+ *
+ * See also: ECMA-262 v5, 10.5 - Declaration binding instantiation (block 8).
+ *
+ * @return ecma value
+ *         Returned value is simple and so need not be freed.
+ *         However, ecma_free_value may be called for it, but it is a no-op.
+ */
+ecma_value_t
+vm_var_decl (vm_frame_ctx_t *frame_ctx_p, /**< interpreter context */
+             ecma_string_t *var_name_str_p) /**< variable name */
+{
+  if (!ecma_op_has_binding (frame_ctx_p->lex_env_p, var_name_str_p))
+  {
+    const bool is_configurable_bindings = frame_ctx_p->is_eval_code;
+
+    ecma_value_t completion_value = ecma_op_create_mutable_binding (frame_ctx_p->lex_env_p,
+                                                                    var_name_str_p,
+                                                                    is_configurable_bindings);
+
+    JERRY_ASSERT (ecma_is_value_empty (completion_value));
+
+    /* Skipping SetMutableBinding as we have already checked that there were not
+     * any binding with specified name in current lexical environment
+     * and CreateMutableBinding sets the created binding's value to undefined */
+    JERRY_ASSERT (ecma_is_value_undefined (ecma_op_get_binding_value (frame_ctx_p->lex_env_p,
+                                                                      var_name_str_p,
+                                                                      true)));
+  }
+  return ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+} /* vm_var_decl */
+
+/**
+ * 'Logical NOT Operator' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.4.9
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_logical_not (ecma_value_t left_value) /**< left value */
+{
+  return ecma_make_boolean_value (!ecma_op_to_boolean (left_value));
+} /* opfunc_logical_not */
+
+/**
+ * 'typeof' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.4.3
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+opfunc_typeof (ecma_value_t left_value) /**< left value */
+{
+  ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ecma_string_t *type_str_p = NULL;
+
+  if (ecma_is_value_undefined (left_value))
+  {
+    type_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_UNDEFINED);
+  }
+  else if (ecma_is_value_null (left_value))
+  {
+    type_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_OBJECT);
+  }
+  else if (ecma_is_value_boolean (left_value))
+  {
+    type_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_BOOLEAN);
+  }
+  else if (ecma_is_value_number (left_value))
+  {
+    type_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_NUMBER);
+  }
+  else if (ecma_is_value_string (left_value))
+  {
+    type_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_STRING);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_is_value_object (left_value));
+
+    if (ecma_op_is_callable (left_value))
+    {
+      type_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_FUNCTION);
+    }
+    else
+    {
+      type_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_OBJECT);
+    }
+  }
+
+  ret_value = ecma_make_string_value (type_str_p);
+
+  return ret_value;
+} /* opfunc_typeof */
+
+/**
+ * Update getter or setter for object literals.
+ */
+void
+opfunc_set_accessor (bool is_getter, /**< is getter accessor */
+                     ecma_value_t object, /**< object value */
+                     ecma_value_t accessor_name, /**< accessor name value */
+                     ecma_value_t accessor) /**< accessor value */
+{
+  ecma_object_t *object_p = ecma_get_object_from_value (object);
+  JERRY_ASSERT (ecma_is_value_string (accessor_name) || ecma_is_value_number (accessor_name));
+  ecma_string_t *accessor_name_p = ecma_get_string_from_value (ecma_op_to_string (accessor_name));
+  ecma_property_t *property_p = ecma_find_named_property (object_p, accessor_name_p);
+
+  if (property_p != NULL
+      && ECMA_PROPERTY_GET_TYPE (*property_p) != ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
+  {
+    ecma_delete_property (object_p, ECMA_PROPERTY_VALUE_PTR (property_p));
+    property_p = NULL;
+  }
+
+  if (property_p == NULL)
+  {
+    ecma_object_t *getter_func_p = NULL;
+    ecma_object_t *setter_func_p = NULL;
+
+    if (is_getter)
+    {
+      getter_func_p = ecma_get_object_from_value (accessor);
+    }
+    else
+    {
+      setter_func_p = ecma_get_object_from_value (accessor);
+    }
+
+    ecma_create_named_accessor_property (object_p,
+                                         accessor_name_p,
+                                         getter_func_p,
+                                         setter_func_p,
+                                         ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE,
+                                         NULL);
+  }
+  else if (is_getter)
+  {
+    ecma_object_t *getter_func_p = ecma_get_object_from_value (accessor);
+
+    ecma_set_named_accessor_property_getter (object_p,
+                                             ECMA_PROPERTY_VALUE_PTR (property_p),
+                                             getter_func_p);
+  }
+  else
+  {
+    ecma_object_t *setter_func_p = ecma_get_object_from_value (accessor);
+
+    ecma_set_named_accessor_property_setter (object_p,
+                                             ECMA_PROPERTY_VALUE_PTR (property_p),
+                                             setter_func_p);
+  }
+
+  ecma_deref_ecma_string (accessor_name_p);
+} /* opfunc_set_accessor */
+
+/**
+ * Deletes an object property.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+vm_op_delete_prop (ecma_value_t object, /**< base object */
+                   ecma_value_t property, /**< property name */
+                   bool is_strict) /**< strict mode */
+{
+  ecma_value_t completion_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (ecma_is_value_undefined (object))
+  {
+    completion_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+  else
+  {
+    completion_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+    ECMA_TRY_CATCH (check_coercible_ret,
+                    ecma_op_check_object_coercible (object),
+                    completion_value);
+    ECMA_TRY_CATCH (str_name_value,
+                    ecma_op_to_string (property),
+                    completion_value);
+
+    JERRY_ASSERT (ecma_is_value_string (str_name_value));
+    ecma_string_t *name_string_p = ecma_get_string_from_value (str_name_value);
+
+    ECMA_TRY_CATCH (obj_value, ecma_op_to_object (object), completion_value);
+
+    JERRY_ASSERT (ecma_is_value_object (obj_value));
+    ecma_object_t *obj_p = ecma_get_object_from_value (obj_value);
+    JERRY_ASSERT (!ecma_is_lexical_environment (obj_p));
+
+    ECMA_TRY_CATCH (delete_op_ret_val,
+                    ecma_op_object_delete (obj_p, name_string_p, is_strict),
+                    completion_value);
+
+    completion_value = delete_op_ret_val;
+
+    ECMA_FINALIZE (delete_op_ret_val);
+    ECMA_FINALIZE (obj_value);
+    ECMA_FINALIZE (str_name_value);
+    ECMA_FINALIZE (check_coercible_ret);
+  }
+
+  return completion_value;
+} /* vm_op_delete_prop */
+
+/**
+ * Deletes a variable.
+ *
+ * @return ecma value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_value_t
+vm_op_delete_var (jmem_cpointer_t name_literal, /**< name literal */
+                  ecma_object_t *lex_env_p) /**< lexical environment */
+{
+  ecma_value_t completion_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  ecma_string_t *var_name_str_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t, name_literal);
+
+  ecma_object_t *ref_base_lex_env_p = ecma_op_resolve_reference_base (lex_env_p, var_name_str_p);
+
+  if (ref_base_lex_env_p == NULL)
+  {
+    completion_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+  }
+  else
+  {
+    JERRY_ASSERT (ecma_is_lexical_environment (ref_base_lex_env_p));
+
+    completion_value = ecma_op_delete_binding (ref_base_lex_env_p, var_name_str_p);
+  }
+
+  return completion_value;
+} /* vm_op_delete_var */
+
+/**
+ * 'for-in' opcode handler
+ *
+ * See also:
+ *          ECMA-262 v5, 12.6.4
+ *
+ * @return completion value
+ *         Returned value must be freed with ecma_free_value
+ */
+ecma_collection_header_t *
+opfunc_for_in (ecma_value_t left_value, /**< left value */
+               ecma_value_t *result_obj_p) /**< expression object */
+{
+  ecma_value_t compl_val = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_collection_header_t *prop_names_p = NULL;
+
+  /* 3. */
+  if (!ecma_is_value_undefined (left_value)
+      && !ecma_is_value_null (left_value))
+  {
+    /* 4. */
+    ECMA_TRY_CATCH (obj_expr_value,
+                    ecma_op_to_object (left_value),
+                    compl_val);
+
+    ecma_object_t *obj_p = ecma_get_object_from_value (obj_expr_value);
+    prop_names_p = ecma_op_object_get_property_names (obj_p, false, true, true);
+
+    if (prop_names_p->unit_number != 0)
+    {
+      ecma_ref_object (obj_p);
+      *result_obj_p = ecma_make_object_value (obj_p);
+    }
+    else
+    {
+      ecma_dealloc_collection_header (prop_names_p);
+      prop_names_p = NULL;
+    }
+
+    ECMA_FINALIZE (obj_expr_value);
+  }
+
+  JERRY_ASSERT (ecma_is_value_empty (compl_val));
+
+  return prop_names_p;
+} /* opfunc_for_in */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/vm/opcodes.h b/deps/jerry/jerry-core/vm/opcodes.h
new file mode 100644 (file)
index 0000000..225c383
--- /dev/null
@@ -0,0 +1,119 @@
+/* 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.
+ */
+
+#ifndef OPCODES_H
+#define OPCODES_H
+
+#include "ecma-globals.h"
+#include "vm-defines.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup vm_opcodes Opcodes
+ * @{
+ */
+
+/**
+ * Number arithmetic operations.
+ */
+typedef enum
+{
+  NUMBER_ARITHMETIC_SUBSTRACTION, /**< substraction */
+  NUMBER_ARITHMETIC_MULTIPLICATION, /**< multiplication */
+  NUMBER_ARITHMETIC_DIVISION, /**< division */
+  NUMBER_ARITHMETIC_REMAINDER, /**< remainder calculation */
+} number_arithmetic_op;
+
+/**
+ * Number bitwise logic operations.
+ */
+typedef enum
+{
+  NUMBER_BITWISE_LOGIC_AND, /**< bitwise AND calculation */
+  NUMBER_BITWISE_LOGIC_OR, /**< bitwise OR calculation */
+  NUMBER_BITWISE_LOGIC_XOR, /**< bitwise XOR calculation */
+  NUMBER_BITWISE_SHIFT_LEFT, /**< bitwise LEFT SHIFT calculation */
+  NUMBER_BITWISE_SHIFT_RIGHT, /**< bitwise RIGHT_SHIFT calculation */
+  NUMBER_BITWISE_SHIFT_URIGHT, /**< bitwise UNSIGNED RIGHT SHIFT calculation */
+  NUMBER_BITWISE_NOT, /**< bitwise NOT calculation */
+} number_bitwise_logic_op;
+
+ecma_value_t
+vm_var_decl (vm_frame_ctx_t *frame_ctx_p, ecma_string_t *var_name_str_p);
+
+ecma_value_t
+opfunc_equal_value (ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+opfunc_not_equal_value (ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+do_number_arithmetic (number_arithmetic_op op, ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+opfunc_unary_plus (ecma_value_t left_value);
+
+ecma_value_t
+opfunc_unary_minus (ecma_value_t left_value);
+
+ecma_value_t
+do_number_bitwise_logic (number_bitwise_logic_op op, ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+opfunc_addition (ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+opfunc_less_than (ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+opfunc_greater_than (ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+opfunc_less_or_equal_than (ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+opfunc_greater_or_equal_than (ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+opfunc_in (ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+opfunc_instanceof (ecma_value_t left_value, ecma_value_t right_value);
+
+ecma_value_t
+opfunc_logical_not (ecma_value_t left_value);
+
+ecma_value_t
+opfunc_typeof (ecma_value_t left_value);
+
+void
+opfunc_set_accessor (bool is_getter, ecma_value_t object, ecma_value_t accessor_name, ecma_value_t accessor);
+
+ecma_value_t
+vm_op_delete_prop (ecma_value_t object, ecma_value_t property, bool is_strict);
+
+ecma_value_t
+vm_op_delete_var (jmem_cpointer_t name_literal, ecma_object_t *lex_env_p);
+
+ecma_collection_header_t *
+opfunc_for_in (ecma_value_t left_value, ecma_value_t *result_obj_p);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !OPCODES_H */
diff --git a/deps/jerry/jerry-core/vm/vm-defines.h b/deps/jerry/jerry-core/vm/vm-defines.h
new file mode 100644 (file)
index 0000000..7ae91ee
--- /dev/null
@@ -0,0 +1,64 @@
+/* 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.
+ */
+#ifndef VM_DEFINES_H
+#define VM_DEFINES_H
+
+#include "byte-code.h"
+#include "ecma-globals.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup vm_executor Executor
+ * @{
+ */
+
+/**
+ * Helpers for updating uint16_t values.
+ */
+#define VM_PLUS_EQUAL_U16(base, value) (base) = (uint16_t) ((base) + (value))
+#define VM_MINUS_EQUAL_U16(base, value) (base) = (uint16_t) ((base) - (value))
+
+/**
+ * Instruction counter / position
+ */
+typedef const uint8_t *vm_instr_counter_t;
+
+/**
+ * Context of interpreter, related to a JS stack frame
+ */
+typedef struct vm_frame_ctx_t
+{
+  const ecma_compiled_code_t *bytecode_header_p;      /**< currently executed byte-code data */
+  uint8_t *byte_code_p;                               /**< current byte code pointer */
+  uint8_t *byte_code_start_p;                         /**< byte code start pointer */
+  ecma_value_t *registers_p;                          /**< register start pointer */
+  ecma_value_t *stack_top_p;                          /**< stack top pointer */
+  jmem_cpointer_t *literal_start_p;                   /**< literal list start pointer */
+  ecma_object_t *lex_env_p;                           /**< current lexical environment */
+  struct vm_frame_ctx_t *prev_context_p;              /**< previous context */
+  ecma_value_t this_binding;                          /**< this binding */
+  ecma_value_t call_block_result;                     /**< preserve block result during a call */
+  uint16_t context_depth;                             /**< current context depth */
+  uint8_t is_eval_code;                               /**< eval mode flag */
+  uint8_t call_operation;                             /**< perform a call or construct operation */
+} vm_frame_ctx_t;
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !VM_DEFINES_H */
diff --git a/deps/jerry/jerry-core/vm/vm-stack.c b/deps/jerry/jerry-core/vm/vm-stack.c
new file mode 100644 (file)
index 0000000..004001f
--- /dev/null
@@ -0,0 +1,255 @@
+/* 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.
+ */
+
+#include "ecma-alloc.h"
+#include "ecma-gc.h"
+#include "ecma-helpers.h"
+#include "vm-defines.h"
+#include "vm-stack.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup stack VM stack
+ * @{
+ */
+
+/**
+ * Abort (finalize) the current stack context, and remove it.
+ *
+ * @return new stack top
+ */
+ecma_value_t *
+vm_stack_context_abort (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
+                        ecma_value_t *vm_stack_top_p) /**< current stack top */
+{
+  switch (VM_GET_CONTEXT_TYPE (vm_stack_top_p[-1]))
+  {
+    case VM_CONTEXT_FINALLY_THROW:
+    case VM_CONTEXT_FINALLY_RETURN:
+    {
+      ecma_free_value (vm_stack_top_p[-2]);
+
+      VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+      vm_stack_top_p -= PARSER_TRY_CONTEXT_STACK_ALLOCATION;
+      break;
+    }
+    case VM_CONTEXT_FINALLY_JUMP:
+    case VM_CONTEXT_TRY:
+    {
+      VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+      vm_stack_top_p -= PARSER_TRY_CONTEXT_STACK_ALLOCATION;
+      break;
+    }
+    case VM_CONTEXT_CATCH:
+    case VM_CONTEXT_WITH:
+    {
+      ecma_deref_object (frame_ctx_p->lex_env_p);
+      frame_ctx_p->lex_env_p = ecma_get_object_from_value (vm_stack_top_p[-2]);
+
+      JERRY_ASSERT (PARSER_TRY_CONTEXT_STACK_ALLOCATION == PARSER_WITH_CONTEXT_STACK_ALLOCATION);
+
+      VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+      vm_stack_top_p -= PARSER_TRY_CONTEXT_STACK_ALLOCATION;
+      break;
+    }
+    case VM_CONTEXT_FOR_IN:
+    {
+      jmem_cpointer_t current = (jmem_cpointer_t) vm_stack_top_p[-2];
+
+      while (current != JMEM_CP_NULL)
+      {
+        ecma_collection_chunk_t *chunk_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_collection_chunk_t,
+                                                                         current);
+
+        lit_utf8_byte_t *data_ptr = chunk_p->data;
+        ecma_free_value (*(ecma_value_t *) data_ptr);
+
+        current = chunk_p->next_chunk_cp;
+        ecma_dealloc_collection_chunk (chunk_p);
+      }
+
+      ecma_free_value (vm_stack_top_p[-3]);
+
+      VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION);
+      vm_stack_top_p -= PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION;
+      break;
+    }
+    default:
+    {
+      JERRY_UNREACHABLE ();
+      break;
+    }
+  }
+
+  return vm_stack_top_p;
+} /* vm_stack_context_abort */
+
+/**
+ * Decode branch offset.
+ *
+ * @return branch offset
+ */
+static uint32_t
+vm_decode_branch_offset (uint8_t *branch_offset_p, /**< start offset of byte code */
+                         uint32_t length) /**< length of the branch */
+{
+  uint32_t branch_offset = *branch_offset_p;
+
+  JERRY_ASSERT (length >= 1 && length <= 3);
+
+  switch (length)
+  {
+    case 3:
+    {
+      branch_offset <<= 8;
+      branch_offset |= *(++branch_offset_p);
+      /* FALLTHRU */
+    }
+    case 2:
+    {
+      branch_offset <<= 8;
+      branch_offset |= *(++branch_offset_p);
+      break;
+    }
+  }
+
+  return branch_offset;
+} /* vm_decode_branch_offset */
+
+/**
+ * Find a finally up to the end position.
+ *
+ * @return true - if 'finally' found,
+ *         false - otherwise
+ */
+bool
+vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
+                       ecma_value_t **vm_stack_top_ref_p, /**< current stack top */
+                       vm_stack_context_type_t finally_type, /**< searching this finally */
+                       uint32_t search_limit) /**< search up-to this byte code */
+{
+  ecma_value_t *vm_stack_top_p = *vm_stack_top_ref_p;
+
+  JERRY_ASSERT (finally_type <= VM_CONTEXT_FINALLY_RETURN);
+
+  if (finally_type != VM_CONTEXT_FINALLY_JUMP)
+  {
+    search_limit = 0xffffffffu;
+  }
+
+  while (frame_ctx_p->context_depth > 0)
+  {
+    vm_stack_context_type_t context_type;
+    uint32_t context_end = VM_GET_CONTEXT_END (vm_stack_top_p[-1]);
+
+    if (search_limit < context_end)
+    {
+      *vm_stack_top_ref_p = vm_stack_top_p;
+      return false;
+    }
+
+    context_type = VM_GET_CONTEXT_TYPE (vm_stack_top_p[-1]);
+    if (context_type == VM_CONTEXT_TRY || context_type == VM_CONTEXT_CATCH)
+    {
+      uint8_t *byte_code_p;
+      uint32_t branch_offset_length;
+      uint32_t branch_offset;
+
+      if (search_limit == context_end)
+      {
+        *vm_stack_top_ref_p = vm_stack_top_p;
+        return false;
+      }
+
+      byte_code_p = frame_ctx_p->byte_code_start_p + context_end;
+
+      if (context_type == VM_CONTEXT_TRY)
+      {
+        JERRY_ASSERT (byte_code_p[0] == CBC_EXT_OPCODE);
+
+        if (byte_code_p[1] >= CBC_EXT_CATCH
+            && byte_code_p[1] <= CBC_EXT_CATCH_3)
+        {
+          branch_offset_length = CBC_BRANCH_OFFSET_LENGTH (byte_code_p[1]);
+          branch_offset = vm_decode_branch_offset (byte_code_p + 2,
+                                                   branch_offset_length);
+
+          if (finally_type == VM_CONTEXT_FINALLY_THROW)
+          {
+            branch_offset += (uint32_t) (byte_code_p - frame_ctx_p->byte_code_start_p);
+
+            vm_stack_top_p[-1] = VM_CREATE_CONTEXT (VM_CONTEXT_CATCH, branch_offset);
+
+            byte_code_p += 2 + branch_offset_length;
+            frame_ctx_p->byte_code_p = byte_code_p;
+
+            *vm_stack_top_ref_p = vm_stack_top_p;
+            return true;
+          }
+
+          byte_code_p += branch_offset;
+
+          if (*byte_code_p == CBC_CONTEXT_END)
+          {
+            VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+            vm_stack_top_p -= PARSER_TRY_CONTEXT_STACK_ALLOCATION;
+            continue;
+          }
+        }
+      }
+      else
+      {
+        ecma_deref_object (frame_ctx_p->lex_env_p);
+        frame_ctx_p->lex_env_p = ecma_get_object_from_value (vm_stack_top_p[-2]);
+
+        if (byte_code_p[0] == CBC_CONTEXT_END)
+        {
+          VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+          vm_stack_top_p -= PARSER_TRY_CONTEXT_STACK_ALLOCATION;
+          continue;
+        }
+      }
+
+      JERRY_ASSERT (byte_code_p[0] == CBC_EXT_OPCODE);
+      JERRY_ASSERT (byte_code_p[1] >= CBC_EXT_FINALLY
+                    && byte_code_p[1] <= CBC_EXT_FINALLY_3);
+
+      branch_offset_length = CBC_BRANCH_OFFSET_LENGTH (byte_code_p[1]);
+      branch_offset = vm_decode_branch_offset (byte_code_p + 2,
+                                               branch_offset_length);
+
+      branch_offset += (uint32_t) (byte_code_p - frame_ctx_p->byte_code_start_p);
+
+      vm_stack_top_p[-1] = VM_CREATE_CONTEXT ((uint32_t) finally_type, branch_offset);
+
+      byte_code_p += 2 + branch_offset_length;
+      frame_ctx_p->byte_code_p = byte_code_p;
+
+      *vm_stack_top_ref_p = vm_stack_top_p;
+      return true;
+    }
+
+    vm_stack_top_p = vm_stack_context_abort (frame_ctx_p, vm_stack_top_p);
+  }
+
+  *vm_stack_top_ref_p = vm_stack_top_p;
+  return false;
+} /* vm_stack_find_finally */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/vm/vm-stack.h b/deps/jerry/jerry-core/vm/vm-stack.h
new file mode 100644 (file)
index 0000000..0f92116
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ */
+
+#ifndef VM_STACK_H
+#define VM_STACK_H
+
+#include "ecma-globals.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup stack VM stack
+ * @{
+ */
+
+/**
+ * Number of ecma values inlined into stack frame
+ */
+#define VM_STACK_FRAME_INLINED_VALUES_NUMBER CONFIG_VM_STACK_FRAME_INLINED_VALUES_NUMBER
+
+/**
+ * Header of a ECMA stack frame's chunk
+ */
+typedef struct
+{
+  uint16_t prev_chunk_p;                      /**< previous chunk of same frame */
+} vm_stack_chunk_header_t;
+
+/**
+ * ECMA stack frame
+ */
+typedef struct vm_stack_frame_t
+{
+  struct vm_stack_frame_t *prev_frame_p;      /**< previous frame */
+  uint32_t regs_number;                       /**< number of register variables */
+} vm_stack_frame_t;
+
+#define VM_CREATE_CONTEXT(type, end_offset) ((ecma_value_t) ((type) | (end_offset) << 4))
+#define VM_GET_CONTEXT_TYPE(value) ((vm_stack_context_type_t) ((value) & 0xf))
+#define VM_GET_CONTEXT_END(value) ((value) >> 4)
+
+/**
+ * Context types for the vm stack.
+ */
+typedef enum
+{
+  VM_CONTEXT_FINALLY_JUMP,                    /**< finally context with a jump */
+  VM_CONTEXT_FINALLY_THROW,                   /**< finally context with a throw */
+  VM_CONTEXT_FINALLY_RETURN,                  /**< finally context with a return */
+  VM_CONTEXT_TRY,                             /**< try context */
+  VM_CONTEXT_CATCH,                           /**< catch context */
+  VM_CONTEXT_WITH,                            /**< with context */
+  VM_CONTEXT_FOR_IN,                          /**< for-in context */
+} vm_stack_context_type_t;
+
+ecma_value_t *vm_stack_context_abort (vm_frame_ctx_t *frame_ctx_p, ecma_value_t *vm_stack_top_p);
+bool vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, ecma_value_t **vm_stack_top_ref_p,
+                            vm_stack_context_type_t finally_type, uint32_t search_limit);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !VM_STACK_H */
diff --git a/deps/jerry/jerry-core/vm/vm.c b/deps/jerry/jerry-core/vm/vm.c
new file mode 100644 (file)
index 0000000..8ac3bf7
--- /dev/null
@@ -0,0 +1,2864 @@
+/* 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.
+ */
+
+#include "common.h"
+
+#include "ecma-alloc.h"
+#include "ecma-array-object.h"
+#include "ecma-builtins.h"
+#include "ecma-comparison.h"
+#include "ecma-conversion.h"
+#include "ecma-exceptions.h"
+#include "ecma-function-object.h"
+#include "ecma-gc.h"
+#include "ecma-helpers.h"
+#include "ecma-lcache.h"
+#include "ecma-lex-env.h"
+#include "ecma-objects.h"
+#include "ecma-objects-general.h"
+#include "ecma-regexp-object.h"
+#include "ecma-try-catch-macro.h"
+#include "jcontext.h"
+#include "opcodes.h"
+#include "vm.h"
+#include "vm-stack.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup vm_executor Executor
+ * @{
+ */
+
+/**
+ * Get the value of object[property].
+ *
+ * @return ecma value
+ */
+static ecma_value_t
+vm_op_get_value (ecma_value_t object, /**< base object */
+                 ecma_value_t property) /**< property name */
+{
+  if (ecma_is_value_object (object))
+  {
+    ecma_object_t *object_p = ecma_get_object_from_value (object);
+    ecma_string_t *property_name_p = NULL;
+    ecma_string_t uint32_string;
+
+    if (ecma_is_value_integer_number (property))
+    {
+      ecma_integer_value_t int_value = ecma_get_integer_from_value (property);
+
+#ifdef JERRY_CPOINTER_32_BIT
+      bool limit_check = (int_value >= 0);
+#else /* !JERRY_CPOINTER_32_BIT */
+      bool limit_check = (int_value >= 0 && int_value < (ecma_integer_value_t) (UINT16_MAX + 1));
+#endif
+
+      if (limit_check)
+      {
+        /* Statically allocated string for searching. */
+        ecma_init_ecma_string_from_uint32 (&uint32_string, (uint32_t) int_value);
+        property_name_p = &uint32_string;
+      }
+    }
+    else if (ecma_is_value_string (property))
+    {
+      property_name_p = ecma_get_string_from_value (property);
+    }
+
+    if (property_name_p != NULL)
+    {
+      ecma_property_t *property_p = ecma_lcache_lookup (object_p, property_name_p);
+
+      if (property_p != NULL &&
+          ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDDATA)
+      {
+        return ecma_fast_copy_value (ECMA_PROPERTY_VALUE_PTR (property_p)->value);
+      }
+
+      /* There is no need to free the name. */
+      return ecma_op_object_get (ecma_get_object_from_value (object), property_name_p);
+    }
+  }
+
+  if (unlikely (ecma_is_value_undefined (object) || ecma_is_value_null (object)))
+  {
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+    ecma_value_t error_value = ecma_raise_standard_error_with_format (ECMA_ERROR_TYPE,
+                                                                      "Cannot read property '%' of %",
+                                                                      property,
+                                                                      object);
+#else /* !JERRY_ENABLE_ERROR_MESSAGES */
+    ecma_value_t error_value = ecma_raise_type_error (NULL);
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+    return error_value;
+  }
+
+  ecma_value_t prop_to_string_result = ecma_op_to_string (property);
+
+  if (ECMA_IS_VALUE_ERROR (prop_to_string_result))
+  {
+    return prop_to_string_result;
+  }
+
+  ecma_string_t *property_name_p = ecma_get_string_from_value (prop_to_string_result);
+
+  ecma_value_t get_value_result = ecma_op_get_value_object_base (object, property_name_p);
+
+  ecma_deref_ecma_string (property_name_p);
+  return get_value_result;
+} /* vm_op_get_value */
+
+/**
+ * Set the value of object[property].
+ *
+ * Note:
+ *  this function frees its object and property arguments
+ *
+ * @return an ecma value which contains an error
+ *         if the property setting is unsuccessful
+ */
+static ecma_value_t
+vm_op_set_value (ecma_value_t object, /**< base object */
+                 ecma_value_t property, /**< property name */
+                 ecma_value_t value, /**< ecma value */
+                 bool is_strict) /**< strict mode */
+{
+  if (unlikely (!ecma_is_value_object (object)))
+  {
+    ecma_value_t to_object = ecma_op_to_object (object);
+    ecma_free_value (object);
+
+    if (ECMA_IS_VALUE_ERROR (to_object))
+    {
+#ifdef JERRY_ENABLE_ERROR_MESSAGES
+      ecma_free_value (to_object);
+
+      ecma_value_t error_value = ecma_raise_standard_error_with_format (ECMA_ERROR_TYPE,
+                                                                        "Cannot set property '%' of %",
+                                                                        property,
+                                                                        object);
+      ecma_free_value (property);
+
+      return error_value;
+#else /* !JERRY_ENABLE_ERROR_MESSAGES */
+      ecma_free_value (property);
+      return to_object;
+#endif /* JERRY_ENABLE_ERROR_MESSAGES */
+    }
+
+    object = to_object;
+  }
+
+  if (!ecma_is_value_string (property))
+  {
+    ecma_value_t to_string = ecma_op_to_string (property);
+    ecma_fast_free_value (property);
+
+    if (ECMA_IS_VALUE_ERROR (to_string))
+    {
+      ecma_free_value (object);
+      return to_string;
+    }
+
+    property = to_string;
+  }
+
+  ecma_object_t *object_p = ecma_get_object_from_value (object);
+  ecma_string_t *property_p = ecma_get_string_from_value (property);
+  ecma_value_t completion_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+
+  if (!ecma_is_lexical_environment (object_p))
+  {
+    completion_value = ecma_op_object_put (object_p,
+                                           property_p,
+                                           value,
+                                           is_strict);
+  }
+  else
+  {
+    completion_value = ecma_op_set_mutable_binding (object_p,
+                                                    property_p,
+                                                    value,
+                                                    is_strict);
+  }
+
+  ecma_free_value (object);
+  ecma_free_value (property);
+
+  return completion_value;
+} /* vm_op_set_value */
+
+#define CBC_OPCODE(arg1, arg2, arg3, arg4) arg4,
+
+/**
+ * Decode table for both opcodes and extended opcodes.
+ */
+static const uint16_t vm_decode_table[] JERRY_CONST_DATA =
+{
+  CBC_OPCODE_LIST
+  CBC_EXT_OPCODE_LIST
+};
+
+#undef CBC_OPCODE
+
+/**
+ * Run global code
+ *
+ * Note:
+ *      returned value must be freed with ecma_free_value, when it is no longer needed.
+ *
+ * @return ecma value
+ */
+ecma_value_t
+vm_run_global (const ecma_compiled_code_t *bytecode_p) /**< pointer to bytecode to run */
+{
+  ecma_object_t *glob_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_GLOBAL);
+
+  ecma_value_t ret_value = vm_run (bytecode_p,
+                                   ecma_make_object_value (glob_obj_p),
+                                   ecma_get_global_environment (),
+                                   false,
+                                   NULL,
+                                   0);
+
+  ecma_deref_object (glob_obj_p);
+  return ret_value;
+} /* vm_run_global */
+
+/**
+ * Run specified eval-mode bytecode
+ *
+ * @return ecma value
+ */
+ecma_value_t
+vm_run_eval (ecma_compiled_code_t *bytecode_data_p, /**< byte-code data */
+             bool is_direct) /**< is eval called in direct mode? */
+{
+  ecma_value_t this_binding;
+  ecma_object_t *lex_env_p;
+
+  /* ECMA-262 v5, 10.4.2 */
+  if (is_direct)
+  {
+    this_binding = ecma_copy_value (JERRY_CONTEXT (vm_top_context_p)->this_binding);
+    lex_env_p = JERRY_CONTEXT (vm_top_context_p)->lex_env_p;
+  }
+  else
+  {
+    this_binding = ecma_make_object_value (ecma_builtin_get (ECMA_BUILTIN_ID_GLOBAL));
+    lex_env_p = ecma_get_global_environment ();
+  }
+
+  ecma_ref_object (lex_env_p);
+
+  if ((bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) != 0)
+  {
+    ecma_object_t *strict_lex_env_p = ecma_create_decl_lex_env (lex_env_p);
+    ecma_deref_object (lex_env_p);
+
+    lex_env_p = strict_lex_env_p;
+  }
+
+  ecma_value_t completion_value = vm_run (bytecode_data_p,
+                                          this_binding,
+                                          lex_env_p,
+                                          true,
+                                          NULL,
+                                          0);
+
+  ecma_deref_object (lex_env_p);
+  ecma_free_value (this_binding);
+  ecma_bytecode_deref (bytecode_data_p);
+
+  return completion_value;
+} /* vm_run_eval */
+
+/**
+ * Construct object
+ *
+ * @return object value
+ */
+static ecma_value_t
+vm_construct_literal_object (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
+                             jmem_cpointer_t lit_cp) /**< literal */
+{
+  ecma_compiled_code_t *bytecode_p = ECMA_GET_NON_NULL_POINTER (ecma_compiled_code_t,
+                                                                lit_cp);
+  bool is_function = ((bytecode_p->status_flags & CBC_CODE_FLAGS_FUNCTION) != 0);
+
+  if (is_function)
+  {
+    bool is_strict = ((frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) != 0);
+
+    ecma_object_t *func_obj_p = ecma_op_create_function_object (frame_ctx_p->lex_env_p,
+                                                                is_strict,
+                                                                bytecode_p);
+
+    return ecma_make_object_value (func_obj_p);
+  }
+  else
+  {
+#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
+    ecma_value_t ret_value;
+    ret_value = ecma_op_create_regexp_object_from_bytecode ((re_compiled_code_t *) bytecode_p);
+
+    if (ECMA_IS_VALUE_ERROR (ret_value))
+    {
+      /* TODO: throw exception instead of define an 'undefined' value. */
+      return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+
+    return ret_value;
+#else /* CONFIG_DISABLE_REGEXP_BUILTIN */
+    JERRY_UNREACHABLE (); /* Regular Expressions are not supported in the selected profile! */
+#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
+  }
+} /* vm_construct_literal_object */
+
+/**
+ * Get implicit this value
+ *
+ * @return true - if the implicit 'this' value is updated,
+ *         false - otherwise
+ */
+static inline bool __attr_always_inline___
+vm_get_implicit_this_value (ecma_value_t *this_value_p) /**< [in,out] this value */
+{
+  if (ecma_is_value_object (*this_value_p))
+  {
+    ecma_object_t *this_obj_p = ecma_get_object_from_value (*this_value_p);
+
+    if (ecma_is_lexical_environment (this_obj_p))
+    {
+      ecma_value_t completion_value = ecma_op_implicit_this_value (this_obj_p);
+
+      JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (completion_value));
+
+      *this_value_p = completion_value;
+      return true;
+    }
+  }
+  return false;
+} /* vm_get_implicit_this_value */
+
+/**
+ * 'Function call' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.2.3
+ */
+static void
+opfunc_call (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
+{
+  uint8_t opcode = frame_ctx_p->byte_code_p[0];
+  uint32_t arguments_list_len;
+
+  if (opcode >= CBC_CALL0)
+  {
+    arguments_list_len = (unsigned int) ((opcode - CBC_CALL0) / 6);
+  }
+  else
+  {
+    arguments_list_len = frame_ctx_p->byte_code_p[1];
+  }
+
+  bool is_call_prop = ((opcode - CBC_CALL) % 6) >= 3;
+
+  ecma_value_t this_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  ecma_value_t *stack_top_p = frame_ctx_p->stack_top_p - arguments_list_len;
+
+  if (is_call_prop)
+  {
+    this_value = stack_top_p[-3];
+
+    if (this_value == ecma_make_simple_value (ECMA_SIMPLE_VALUE_REGISTER_REF))
+    {
+      /* Lexical environment cannot be 'this' value. */
+      stack_top_p[-2] = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+      this_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+    else if (vm_get_implicit_this_value (&this_value))
+    {
+      ecma_free_value (stack_top_p[-3]);
+      stack_top_p[-3] = this_value;
+    }
+  }
+
+  ecma_value_t func_value = stack_top_p[-1];
+  ecma_value_t completion_value;
+
+  if (!ecma_op_is_callable (func_value))
+  {
+    completion_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected a function."));
+  }
+  else
+  {
+    ecma_object_t *func_obj_p = ecma_get_object_from_value (func_value);
+
+    completion_value = ecma_op_function_call (func_obj_p,
+                                              this_value,
+                                              stack_top_p,
+                                              arguments_list_len);
+  }
+
+  JERRY_CONTEXT (is_direct_eval_form_call) = false;
+
+  /* Free registers. */
+  for (uint32_t i = 0; i < arguments_list_len; i++)
+  {
+    ecma_fast_free_value (stack_top_p[i]);
+  }
+
+  if (is_call_prop)
+  {
+    ecma_free_value (*(--stack_top_p));
+    ecma_free_value (*(--stack_top_p));
+  }
+
+  ecma_free_value (stack_top_p[-1]);
+  stack_top_p[-1] = completion_value;
+
+  frame_ctx_p->stack_top_p = stack_top_p;
+} /* opfunc_call */
+
+/**
+ * 'Constructor call' opcode handler.
+ *
+ * See also: ECMA-262 v5, 11.2.2
+ */
+static void
+opfunc_construct (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
+{
+  uint8_t opcode = frame_ctx_p->byte_code_p[0];
+  unsigned int arguments_list_len;
+
+  if (opcode >= CBC_NEW0)
+  {
+    arguments_list_len = (unsigned int) (opcode - CBC_NEW0);
+  }
+  else
+  {
+    arguments_list_len = frame_ctx_p->byte_code_p[1];
+  }
+
+  ecma_value_t *stack_top_p = frame_ctx_p->stack_top_p - arguments_list_len;
+  ecma_value_t constructor_value = stack_top_p[-1];
+  ecma_value_t completion_value;
+
+  if (!ecma_is_constructor (constructor_value))
+  {
+    completion_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected a constructor."));
+  }
+  else
+  {
+    ecma_object_t *constructor_obj_p = ecma_get_object_from_value (constructor_value);
+
+    completion_value = ecma_op_function_construct (constructor_obj_p,
+                                                   stack_top_p,
+                                                   arguments_list_len);
+  }
+
+  /* Free registers. */
+  for (uint32_t i = 0; i < arguments_list_len; i++)
+  {
+    ecma_fast_free_value (stack_top_p[i]);
+  }
+
+  ecma_free_value (stack_top_p[-1]);
+  stack_top_p[-1] = completion_value;
+
+  frame_ctx_p->stack_top_p = stack_top_p;
+} /* opfunc_construct */
+
+#define READ_LITERAL_INDEX(destination) \
+  do \
+  { \
+    (destination) = *byte_code_p++; \
+    if ((destination) >= encoding_limit) \
+    { \
+      (destination) = (uint16_t) ((((destination) << 8) | *byte_code_p++) - encoding_delta); \
+    } \
+  } \
+  while (0)
+
+/* TODO: For performance reasons, we define this as a macro.
+ * When we are able to construct a function with similar speed,
+ * we can remove this macro. */
+#define READ_LITERAL(literal_index, target_value) \
+  do \
+  { \
+    if ((literal_index) < ident_end) \
+    { \
+      if ((literal_index) < register_end) \
+      { \
+        /* Note: There should be no specialization for arguments. */ \
+        (target_value) = ecma_fast_copy_value (frame_ctx_p->registers_p[literal_index]); \
+      } \
+      else \
+      { \
+        ecma_string_t *name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t, \
+                                                              literal_start_p[literal_index]); \
+        result = ecma_op_resolve_reference_value (frame_ctx_p->lex_env_p, \
+                                                  name_p); \
+        \
+        if (ECMA_IS_VALUE_ERROR (result)) \
+        { \
+          goto error; \
+        } \
+        (target_value) = result; \
+      } \
+    } \
+    else if (literal_index < const_literal_end) \
+    { \
+      ecma_string_t *value_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t, \
+                                                             literal_start_p[literal_index]); \
+      \
+      if (unlikely (ECMA_STRING_GET_CONTAINER (value_p) == ECMA_STRING_LITERAL_NUMBER)) \
+      { \
+        (target_value) = ecma_fast_copy_value (value_p->u.lit_number); \
+      } \
+      else \
+      { \
+        ecma_ref_ecma_string (value_p); \
+        (target_value) = ecma_make_string_value (value_p); \
+      } \
+    } \
+    else \
+    { \
+      /* Object construction. */ \
+      (target_value) = vm_construct_literal_object (frame_ctx_p, literal_start_p[literal_index]); \
+    } \
+  } \
+  while (0)
+
+/**
+ * Run initializer byte codes.
+ *
+ * @return ecma value
+ */
+static void
+vm_init_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
+{
+  const ecma_compiled_code_t *bytecode_header_p = frame_ctx_p->bytecode_header_p;
+  uint8_t *byte_code_p = frame_ctx_p->byte_code_p;
+  uint16_t encoding_limit;
+  uint16_t encoding_delta;
+  uint16_t register_end;
+  jmem_cpointer_t *literal_start_p = frame_ctx_p->literal_start_p;
+  bool is_strict = ((frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) != 0);
+  jmem_cpointer_t self_reference;
+  ECMA_SET_NON_NULL_POINTER (self_reference, bytecode_header_p);
+
+  /* Prepare. */
+  if (!(bytecode_header_p->status_flags & CBC_CODE_FLAGS_FULL_LITERAL_ENCODING))
+  {
+    encoding_limit = 255;
+    encoding_delta = 0xfe01;
+  }
+  else
+  {
+    encoding_limit = 128;
+    encoding_delta = 0x8000;
+  }
+
+  if (frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) (frame_ctx_p->bytecode_header_p);
+    register_end = args_p->register_end;
+  }
+  else
+  {
+    cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) (frame_ctx_p->bytecode_header_p);
+    register_end = args_p->register_end;
+  }
+
+  while (true)
+  {
+    switch (*byte_code_p)
+    {
+      case CBC_DEFINE_VARS:
+      {
+        uint32_t literal_index_end;
+        uint32_t literal_index = register_end;
+
+        byte_code_p++;
+        READ_LITERAL_INDEX (literal_index_end);
+
+        while (literal_index <= literal_index_end)
+        {
+          ecma_string_t *name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                literal_start_p[literal_index]);
+          vm_var_decl (frame_ctx_p, name_p);
+          literal_index++;
+        }
+        break;
+      }
+
+      case CBC_INITIALIZE_VAR:
+      case CBC_INITIALIZE_VARS:
+      {
+        uint8_t type = *byte_code_p;
+        uint32_t literal_index;
+        uint32_t literal_index_end;
+
+        byte_code_p++;
+        READ_LITERAL_INDEX (literal_index);
+
+        if (type == CBC_INITIALIZE_VAR)
+        {
+          literal_index_end = literal_index;
+        }
+        else
+        {
+          READ_LITERAL_INDEX (literal_index_end);
+        }
+
+        while (literal_index <= literal_index_end)
+        {
+          uint32_t value_index;
+          ecma_value_t lit_value;
+
+          READ_LITERAL_INDEX (value_index);
+
+          if (value_index < register_end)
+          {
+            lit_value = frame_ctx_p->registers_p[value_index];
+          }
+          else
+          {
+            lit_value = vm_construct_literal_object (frame_ctx_p,
+                                                     literal_start_p[value_index]);
+          }
+
+          if (literal_index < register_end)
+          {
+            frame_ctx_p->registers_p[literal_index] = lit_value;
+          }
+          else
+          {
+            ecma_string_t *name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                  literal_start_p[literal_index]);
+
+            if (self_reference == literal_start_p[value_index])
+            {
+              ecma_op_create_immutable_binding (frame_ctx_p->lex_env_p, name_p, lit_value);
+            }
+            else
+            {
+              vm_var_decl (frame_ctx_p, name_p);
+
+              ecma_object_t *ref_base_lex_env_p = ecma_op_resolve_reference_base (frame_ctx_p->lex_env_p, name_p);
+
+              ecma_value_t put_value_result = ecma_op_put_value_lex_env_base (ref_base_lex_env_p,
+                                                                              name_p,
+                                                                              is_strict,
+                                                                              lit_value);
+              ecma_free_value (put_value_result);
+            }
+
+            if (value_index >= register_end)
+            {
+              ecma_free_value (lit_value);
+            }
+          }
+
+          literal_index++;
+        }
+        break;
+      }
+
+#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
+      case CBC_SET_BYTECODE_PTR:
+      {
+        memcpy (&byte_code_p, byte_code_p + 1, sizeof (uint8_t *));
+        frame_ctx_p->byte_code_start_p = byte_code_p;
+        break;
+      }
+#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
+
+      default:
+      {
+        frame_ctx_p->byte_code_p = byte_code_p;
+        return;
+      }
+    }
+  }
+} /* vm_init_loop */
+
+/**
+ * Run generic byte code.
+ *
+ * @return ecma value
+ */
+static ecma_value_t __attr_noinline___
+vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
+{
+  const ecma_compiled_code_t *bytecode_header_p = frame_ctx_p->bytecode_header_p;
+  uint8_t *byte_code_p = frame_ctx_p->byte_code_p;
+  jmem_cpointer_t *literal_start_p = frame_ctx_p->literal_start_p;
+
+  ecma_value_t *stack_top_p;
+  uint16_t encoding_limit;
+  uint16_t encoding_delta;
+  uint16_t register_end;
+  uint16_t ident_end;
+  uint16_t const_literal_end;
+  int32_t branch_offset = 0;
+  ecma_value_t left_value;
+  ecma_value_t right_value;
+  ecma_value_t result = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+  ecma_value_t block_result = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+  bool is_strict = ((frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) != 0);
+
+  /* Prepare for byte code execution. */
+  if (!(bytecode_header_p->status_flags & CBC_CODE_FLAGS_FULL_LITERAL_ENCODING))
+  {
+    encoding_limit = 255;
+    encoding_delta = 0xfe01;
+  }
+  else
+  {
+    encoding_limit = 128;
+    encoding_delta = 0x8000;
+  }
+
+  if (bytecode_header_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) (bytecode_header_p);
+    register_end = args_p->register_end;
+    ident_end = args_p->ident_end;
+    const_literal_end = args_p->const_literal_end;
+  }
+  else
+  {
+    cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) (bytecode_header_p);
+    register_end = args_p->register_end;
+    ident_end = args_p->ident_end;
+    const_literal_end = args_p->const_literal_end;
+  }
+
+  stack_top_p = frame_ctx_p->stack_top_p;
+
+  /* Outer loop for exception handling. */
+  while (true)
+  {
+    /* Internal loop for byte code execution. */
+    while (true)
+    {
+      uint8_t *byte_code_start_p = byte_code_p;
+      uint8_t opcode = *byte_code_p++;
+      uint32_t opcode_data = opcode;
+
+      if (opcode == CBC_EXT_OPCODE)
+      {
+        opcode = *byte_code_p++;
+        opcode_data = (uint32_t) ((CBC_END + 1) + opcode);
+      }
+
+      opcode_data = vm_decode_table[opcode_data];
+
+      left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+      right_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+      uint32_t operands = VM_OC_GET_ARGS_INDEX (opcode_data);
+
+      if (operands >= VM_OC_GET_LITERAL)
+      {
+        uint16_t literal_index;
+        READ_LITERAL_INDEX (literal_index);
+        READ_LITERAL (literal_index, left_value);
+
+        if (operands != VM_OC_GET_LITERAL)
+        {
+          switch (operands)
+          {
+            case VM_OC_GET_LITERAL_LITERAL:
+            {
+              uint16_t second_literal_index;
+              READ_LITERAL_INDEX (second_literal_index);
+              READ_LITERAL (second_literal_index, right_value);
+              break;
+            }
+            case VM_OC_GET_STACK_LITERAL:
+            {
+              JERRY_ASSERT (stack_top_p > frame_ctx_p->registers_p + register_end);
+              right_value = left_value;
+              left_value = *(--stack_top_p);
+              break;
+            }
+            default:
+            {
+              JERRY_ASSERT (operands == VM_OC_GET_THIS_LITERAL);
+              right_value = left_value;
+              left_value = ecma_copy_value (frame_ctx_p->this_binding);
+              break;
+            }
+          }
+        }
+      }
+      else if (operands >= VM_OC_GET_STACK)
+      {
+        JERRY_ASSERT (operands == VM_OC_GET_STACK
+                      || operands == VM_OC_GET_STACK_STACK);
+
+        JERRY_ASSERT (stack_top_p > frame_ctx_p->registers_p + register_end);
+        left_value = *(--stack_top_p);
+
+        if (operands == VM_OC_GET_STACK_STACK)
+        {
+          JERRY_ASSERT (stack_top_p > frame_ctx_p->registers_p + register_end);
+          right_value = left_value;
+          left_value = *(--stack_top_p);
+        }
+      }
+      else if (operands == VM_OC_GET_BRANCH)
+      {
+        branch_offset = 0;
+
+        switch (CBC_BRANCH_OFFSET_LENGTH (opcode))
+        {
+          case 1:
+          {
+            branch_offset = *(byte_code_p++);
+            break;
+          }
+          case 3:
+          {
+            branch_offset = *(byte_code_p++);
+            /* FALLTHRU */
+          }
+          default:
+          {
+            JERRY_ASSERT (CBC_BRANCH_OFFSET_LENGTH (opcode) == 2
+                          || CBC_BRANCH_OFFSET_LENGTH (opcode) == 3);
+
+            branch_offset <<= 8;
+            branch_offset |= *(byte_code_p++);
+            branch_offset <<= 8;
+            branch_offset |= *(byte_code_p++);
+            break;
+          }
+        }
+
+        if (opcode_data & VM_OC_BACKWARD_BRANCH)
+        {
+#ifdef JERRY_VM_EXEC_STOP
+          if (JERRY_CONTEXT (vm_exec_stop_cb) != NULL
+              && --JERRY_CONTEXT (vm_exec_stop_counter) == 0)
+          {
+            result = JERRY_CONTEXT (vm_exec_stop_cb) (JERRY_CONTEXT (vm_exec_stop_user_p));
+
+            if (ecma_is_value_undefined (result))
+            {
+              JERRY_CONTEXT (vm_exec_stop_counter) = JERRY_CONTEXT (vm_exec_stop_frequency);
+            }
+            else
+            {
+              JERRY_CONTEXT (vm_exec_stop_counter) = 1;
+
+              if (!ECMA_IS_VALUE_ERROR (result))
+              {
+                result = ecma_make_error_value (result);
+              }
+              goto error;
+            }
+          }
+#endif /* JERRY_VM_EXEC_STOP */
+
+          branch_offset = -branch_offset;
+        }
+      }
+
+      switch (VM_OC_GROUP_GET_INDEX (opcode_data))
+      {
+        case VM_OC_NONE:
+        {
+          JERRY_ASSERT (opcode == CBC_EXT_DEBUGGER);
+          continue;
+        }
+        case VM_OC_POP:
+        {
+          JERRY_ASSERT (stack_top_p > frame_ctx_p->registers_p + register_end);
+          ecma_free_value (*(--stack_top_p));
+          continue;
+        }
+        case VM_OC_POP_BLOCK:
+        {
+          ecma_fast_free_value (block_result);
+          block_result = *(--stack_top_p);
+          continue;
+        }
+        case VM_OC_PUSH:
+        {
+          *stack_top_p++ = left_value;
+          continue;
+        }
+        case VM_OC_PUSH_TWO:
+        {
+          *stack_top_p++ = left_value;
+          *stack_top_p++ = right_value;
+          continue;
+        }
+        case VM_OC_PUSH_THREE:
+        {
+          uint16_t literal_index;
+
+          *stack_top_p++ = left_value;
+          left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+          READ_LITERAL_INDEX (literal_index);
+          READ_LITERAL (literal_index, left_value);
+
+          *stack_top_p++ = right_value;
+          *stack_top_p++ = left_value;
+          continue;
+        }
+        case VM_OC_PUSH_UNDEFINED:
+        {
+          *stack_top_p++ = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          continue;
+        }
+        case VM_OC_PUSH_TRUE:
+        {
+          *stack_top_p++ = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
+          continue;
+        }
+        case VM_OC_PUSH_FALSE:
+        {
+          *stack_top_p++ = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+          continue;
+        }
+        case VM_OC_PUSH_NULL:
+        {
+          *stack_top_p++ = ecma_make_simple_value (ECMA_SIMPLE_VALUE_NULL);
+          continue;
+        }
+        case VM_OC_PUSH_THIS:
+        {
+          *stack_top_p++ = ecma_copy_value (frame_ctx_p->this_binding);
+          continue;
+        }
+        case VM_OC_PUSH_NUMBER_0:
+        {
+          *stack_top_p++ = ecma_make_integer_value (0);
+          continue;
+        }
+        case VM_OC_PUSH_NUMBER_POS_BYTE:
+        {
+          ecma_integer_value_t number = *byte_code_p++;
+          *stack_top_p++ = ecma_make_integer_value (number + 1);
+          continue;
+        }
+        case VM_OC_PUSH_NUMBER_NEG_BYTE:
+        {
+          ecma_integer_value_t number = *byte_code_p++;
+          *stack_top_p++ = ecma_make_integer_value (-(number + 1));
+          continue;
+        }
+        case VM_OC_PUSH_OBJECT:
+        {
+          ecma_object_t *prototype_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
+          ecma_object_t *obj_p = ecma_create_object (prototype_p,
+                                                     0,
+                                                     ECMA_OBJECT_TYPE_GENERAL);
+
+          ecma_deref_object (prototype_p);
+          *stack_top_p++ = ecma_make_object_value (obj_p);
+          continue;
+        }
+        case VM_OC_SET_PROPERTY:
+        {
+          ecma_object_t *object_p = ecma_get_object_from_value (stack_top_p[-1]);
+          ecma_string_t *prop_name_p;
+          ecma_property_t *property_p;
+
+          if (ecma_is_value_string (right_value))
+          {
+            prop_name_p = ecma_get_string_from_value (right_value);
+          }
+          else
+          {
+            result = ecma_op_to_string (right_value);
+
+            if (ECMA_IS_VALUE_ERROR (result))
+            {
+              goto error;
+            }
+
+            prop_name_p = ecma_get_string_from_value (result);
+          }
+
+          property_p = ecma_find_named_property (object_p, prop_name_p);
+
+          if (property_p != NULL
+              && ECMA_PROPERTY_GET_TYPE (*property_p) != ECMA_PROPERTY_TYPE_NAMEDDATA)
+          {
+            ecma_delete_property (object_p, ECMA_PROPERTY_VALUE_PTR (property_p));
+            property_p = NULL;
+          }
+
+          ecma_property_value_t *prop_value_p;
+
+          if (property_p == NULL)
+          {
+            prop_value_p = ecma_create_named_data_property (object_p,
+                                                            prop_name_p,
+                                                            ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
+                                                            NULL);
+          }
+          else
+          {
+            prop_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
+          }
+
+          ecma_named_data_property_assign_value (object_p, prop_value_p, left_value);
+
+          if (!ecma_is_value_string (right_value))
+          {
+            ecma_deref_ecma_string (prop_name_p);
+          }
+
+          goto free_both_values;
+        }
+        case VM_OC_SET_GETTER:
+        case VM_OC_SET_SETTER:
+        {
+          opfunc_set_accessor (VM_OC_GROUP_GET_INDEX (opcode_data) == VM_OC_SET_GETTER ? true : false,
+                               stack_top_p[-1],
+                               left_value,
+                               right_value);
+
+          goto free_both_values;
+        }
+        case VM_OC_PUSH_ARRAY:
+        {
+          result = ecma_op_create_array_object (NULL, 0, false);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          continue;
+        }
+        case VM_OC_PUSH_ELISON:
+        {
+          *stack_top_p++ = ecma_make_simple_value (ECMA_SIMPLE_VALUE_ARRAY_HOLE);
+          continue;
+        }
+        case VM_OC_APPEND_ARRAY:
+        {
+          ecma_object_t *array_obj_p;
+          uint32_t length_num;
+          uint32_t values_length = *byte_code_p++;
+
+          stack_top_p -= values_length;
+
+          array_obj_p = ecma_get_object_from_value (stack_top_p[-1]);
+          ecma_extended_object_t *ext_array_obj_p = (ecma_extended_object_t *) array_obj_p;
+
+          length_num = ext_array_obj_p->u.array.length;
+
+          for (uint32_t i = 0; i < values_length; i++)
+          {
+            if (!ecma_is_value_array_hole (stack_top_p[i]))
+            {
+              ecma_string_t *index_str_p = ecma_new_ecma_string_from_uint32 (length_num);
+
+              ecma_property_value_t *prop_value_p;
+              prop_value_p = ecma_create_named_data_property (array_obj_p,
+                                                              index_str_p,
+                                                              ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
+                                                              NULL);
+
+              JERRY_ASSERT (ecma_is_value_undefined (prop_value_p->value));
+              prop_value_p->value = stack_top_p[i];
+
+              /* The reference is moved so no need to free stack_top_p[i] except for objects. */
+              if (ecma_is_value_object (stack_top_p[i]))
+              {
+                ecma_free_value (stack_top_p[i]);
+              }
+
+              ecma_deref_ecma_string (index_str_p);
+            }
+
+            length_num++;
+          }
+
+          ext_array_obj_p->u.array.length = length_num;
+          continue;
+        }
+        case VM_OC_PUSH_UNDEFINED_BASE:
+        {
+          stack_top_p[0] = stack_top_p[-1];
+          stack_top_p[-1] = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          stack_top_p++;
+          continue;
+        }
+        case VM_OC_IDENT_REFERENCE:
+        {
+          uint16_t literal_index;
+
+          READ_LITERAL_INDEX (literal_index);
+
+          JERRY_ASSERT (literal_index < ident_end);
+
+          if (literal_index < register_end)
+          {
+            *stack_top_p++ = ecma_make_simple_value (ECMA_SIMPLE_VALUE_REGISTER_REF);
+            *stack_top_p++ = literal_index;
+            *stack_top_p++ = ecma_fast_copy_value (frame_ctx_p->registers_p[literal_index]);
+          }
+          else
+          {
+            ecma_string_t *name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                  literal_start_p[literal_index]);
+            ecma_object_t *ref_base_lex_env_p;
+
+            ref_base_lex_env_p = ecma_op_resolve_reference_base (frame_ctx_p->lex_env_p,
+                                                                 name_p);
+
+            result = ecma_op_get_value_lex_env_base (ref_base_lex_env_p,
+                                                     name_p,
+                                                     is_strict);
+
+            if (ECMA_IS_VALUE_ERROR (result))
+            {
+              goto error;
+            }
+
+            ecma_ref_object (ref_base_lex_env_p);
+            ecma_ref_ecma_string (name_p);
+            *stack_top_p++ = ecma_make_object_value (ref_base_lex_env_p);
+            *stack_top_p++ = ecma_make_string_value (name_p);
+            *stack_top_p++ = result;
+          }
+          continue;
+        }
+        case VM_OC_PROP_REFERENCE:
+        {
+          /* Forms with reference requires preserving the base and offset. */
+
+          if (opcode == CBC_PUSH_PROP_REFERENCE)
+          {
+            left_value = stack_top_p[-2];
+            right_value = stack_top_p[-1];
+          }
+          else if (opcode == CBC_PUSH_PROP_LITERAL_REFERENCE)
+          {
+            *stack_top_p++ = left_value;
+            right_value = left_value;
+            left_value = stack_top_p[-2];
+          }
+          else
+          {
+            JERRY_ASSERT (opcode == CBC_PUSH_PROP_LITERAL_LITERAL_REFERENCE
+                          || opcode == CBC_PUSH_PROP_THIS_LITERAL_REFERENCE);
+            *stack_top_p++ = left_value;
+            *stack_top_p++ = right_value;
+          }
+          /* FALLTHRU */
+        }
+        case VM_OC_PROP_GET:
+        case VM_OC_PROP_PRE_INCR:
+        case VM_OC_PROP_PRE_DECR:
+        case VM_OC_PROP_POST_INCR:
+        case VM_OC_PROP_POST_DECR:
+        {
+          result = vm_op_get_value (left_value,
+                                    right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            if (opcode >= CBC_PUSH_PROP_REFERENCE && opcode < CBC_PRE_INCR)
+            {
+              left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+              right_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+            }
+            goto error;
+          }
+
+          if (opcode < CBC_PRE_INCR)
+          {
+            if (opcode >= CBC_PUSH_PROP_REFERENCE)
+            {
+              left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+              right_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+            }
+            break;
+          }
+
+          stack_top_p += 2;
+          left_value = result;
+          right_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          /* FALLTHRU */
+        }
+        case VM_OC_PRE_INCR:
+        case VM_OC_PRE_DECR:
+        case VM_OC_POST_INCR:
+        case VM_OC_POST_DECR:
+        {
+          uint32_t opcode_flags = VM_OC_GROUP_GET_INDEX (opcode_data) - VM_OC_PROP_PRE_INCR;
+
+          byte_code_p = byte_code_start_p + 1;
+
+          if (ecma_is_value_integer_number (left_value))
+          {
+            result = left_value;
+            left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+            ecma_integer_value_t int_value = (ecma_integer_value_t) result;
+            ecma_integer_value_t int_increase = 0;
+
+            if (opcode_flags & VM_OC_DECREMENT_OPERATOR_FLAG)
+            {
+              if (int_value > ECMA_INTEGER_NUMBER_MIN_SHIFTED)
+              {
+                int_increase = -(1 << ECMA_DIRECT_SHIFT);
+              }
+            }
+            else if (int_value < ECMA_INTEGER_NUMBER_MAX_SHIFTED)
+            {
+              int_increase = 1 << ECMA_DIRECT_SHIFT;
+            }
+
+            if (likely (int_increase != 0))
+            {
+              /* Postfix operators require the unmodifed number value. */
+              if (opcode_flags & VM_OC_POST_INCR_DECR_OPERATOR_FLAG)
+              {
+                if (opcode_data & VM_OC_PUT_STACK)
+                {
+                  if (opcode_flags & VM_OC_IDENT_INCR_DECR_OPERATOR_FLAG)
+                  {
+                    JERRY_ASSERT (opcode == CBC_POST_INCR_IDENT_PUSH_RESULT
+                                  || opcode == CBC_POST_DECR_IDENT_PUSH_RESULT);
+
+                    *stack_top_p++ = result;
+                  }
+                  else
+                  {
+                    /* The parser ensures there is enough space for the
+                     * extra value on the stack. See js-parser-expr.c. */
+
+                    JERRY_ASSERT (opcode == CBC_POST_INCR_PUSH_RESULT
+                                  || opcode == CBC_POST_DECR_PUSH_RESULT);
+
+                    stack_top_p++;
+                    stack_top_p[-1] = stack_top_p[-2];
+                    stack_top_p[-2] = stack_top_p[-3];
+                    stack_top_p[-3] = result;
+                  }
+                  opcode_data &= (uint32_t)~VM_OC_PUT_STACK;
+                }
+                else if (opcode_data & VM_OC_PUT_BLOCK)
+                {
+                  ecma_free_value (block_result);
+                  block_result = result;
+                  opcode_data &= (uint32_t) ~VM_OC_PUT_BLOCK;
+                }
+              }
+
+              result = (ecma_value_t) (int_value + int_increase);
+              break;
+            }
+          }
+          else if (ecma_is_value_float_number (left_value))
+          {
+            result = left_value;
+            left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          }
+          else
+          {
+            result = ecma_op_to_number (left_value);
+
+            if (ECMA_IS_VALUE_ERROR (result))
+            {
+              goto error;
+            }
+          }
+
+          ecma_number_t increase = ECMA_NUMBER_ONE;
+          ecma_number_t result_number = ecma_get_number_from_value (result);
+
+          if (opcode_flags & VM_OC_DECREMENT_OPERATOR_FLAG)
+          {
+            /* For decrement operators */
+            increase = ECMA_NUMBER_MINUS_ONE;
+          }
+
+          /* Post operators require the unmodifed number value. */
+          if (opcode_flags & VM_OC_POST_INCR_DECR_OPERATOR_FLAG)
+          {
+            if (opcode_data & VM_OC_PUT_STACK)
+            {
+              if (opcode_flags & VM_OC_IDENT_INCR_DECR_OPERATOR_FLAG)
+              {
+                JERRY_ASSERT (opcode == CBC_POST_INCR_IDENT_PUSH_RESULT
+                              || opcode == CBC_POST_DECR_IDENT_PUSH_RESULT);
+
+                *stack_top_p++ = ecma_copy_value (result);
+              }
+              else
+              {
+                /* The parser ensures there is enough space for the
+                 * extra value on the stack. See js-parser-expr.c. */
+
+                JERRY_ASSERT (opcode == CBC_POST_INCR_PUSH_RESULT
+                              || opcode == CBC_POST_DECR_PUSH_RESULT);
+
+                stack_top_p++;
+                stack_top_p[-1] = stack_top_p[-2];
+                stack_top_p[-2] = stack_top_p[-3];
+                stack_top_p[-3] = ecma_copy_value (result);
+              }
+              opcode_data &= (uint32_t)~VM_OC_PUT_STACK;
+            }
+            else if (opcode_data & VM_OC_PUT_BLOCK)
+            {
+              ecma_free_value (block_result);
+              block_result = ecma_copy_value (result);
+              opcode_data &= (uint32_t) ~VM_OC_PUT_BLOCK;
+            }
+          }
+
+          if (ecma_is_value_integer_number (result))
+          {
+            result = ecma_make_number_value (result_number + increase);
+          }
+          else
+          {
+            result = ecma_update_float_number (result, result_number + increase);
+          }
+          break;
+        }
+        case VM_OC_ASSIGN:
+        {
+          result = left_value;
+          left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          break;
+        }
+        case VM_OC_ASSIGN_PROP:
+        {
+          result = stack_top_p[-1];
+          stack_top_p[-1] = left_value;
+          left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          break;
+        }
+        case VM_OC_ASSIGN_PROP_THIS:
+        {
+          result = stack_top_p[-1];
+          stack_top_p[-1] = ecma_copy_value (frame_ctx_p->this_binding);
+          *stack_top_p++ = left_value;
+          left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          break;
+        }
+        case VM_OC_RET:
+        {
+          JERRY_ASSERT (opcode == CBC_RETURN
+                        || opcode == CBC_RETURN_WITH_BLOCK
+                        || opcode == CBC_RETURN_WITH_LITERAL);
+
+          if (opcode == CBC_RETURN_WITH_BLOCK)
+          {
+            left_value = block_result;
+            block_result = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          }
+
+          result = left_value;
+          left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          goto error;
+        }
+        case VM_OC_THROW:
+        {
+          result = ecma_make_error_value (left_value);
+          left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          goto error;
+        }
+        case VM_OC_THROW_REFERENCE_ERROR:
+        {
+          result = ecma_raise_reference_error (ECMA_ERR_MSG ("Undefined reference."));
+          goto error;
+        }
+        case VM_OC_EVAL:
+        {
+          JERRY_CONTEXT (is_direct_eval_form_call) = true;
+          JERRY_ASSERT (*byte_code_p >= CBC_CALL && *byte_code_p <= CBC_CALL2_PROP_BLOCK);
+          continue;
+        }
+        case VM_OC_CALL:
+        {
+          if (frame_ctx_p->call_operation == VM_NO_EXEC_OP)
+          {
+            frame_ctx_p->call_operation = VM_EXEC_CALL;
+            frame_ctx_p->byte_code_p = byte_code_start_p;
+            frame_ctx_p->stack_top_p = stack_top_p;
+            frame_ctx_p->call_block_result = block_result;
+            return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          }
+
+          if (opcode < CBC_CALL0)
+          {
+            byte_code_p++;
+          }
+
+          frame_ctx_p->call_operation = VM_NO_EXEC_OP;
+
+          result = *(--stack_top_p);
+          block_result = frame_ctx_p->call_block_result;
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          if (!(opcode_data & (VM_OC_PUT_STACK | VM_OC_PUT_BLOCK)))
+          {
+            ecma_fast_free_value (result);
+          }
+          else if (opcode_data & VM_OC_PUT_STACK)
+          {
+            *stack_top_p++ = result;
+          }
+          else
+          {
+            ecma_fast_free_value (block_result);
+            block_result = result;
+          }
+          continue;
+        }
+        case VM_OC_NEW:
+        {
+          if (frame_ctx_p->call_operation == VM_NO_EXEC_OP)
+          {
+            frame_ctx_p->call_operation = VM_EXEC_CONSTRUCT;
+            frame_ctx_p->byte_code_p = byte_code_start_p;
+            frame_ctx_p->stack_top_p = stack_top_p;
+            frame_ctx_p->call_block_result = block_result;
+            return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          }
+
+          if (opcode < CBC_NEW0)
+          {
+            byte_code_p++;
+          }
+
+          frame_ctx_p->call_operation = VM_NO_EXEC_OP;
+
+          result = *(--stack_top_p);
+          block_result = frame_ctx_p->call_block_result;
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          continue;
+        }
+        case VM_OC_PROP_DELETE:
+        {
+          result = vm_op_delete_prop (left_value, right_value, is_strict);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          JERRY_ASSERT (ecma_is_value_boolean (result));
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_DELETE:
+        {
+          uint16_t literal_index;
+
+          READ_LITERAL_INDEX (literal_index);
+
+          if (literal_index < register_end)
+          {
+            *stack_top_p++ = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+            continue;
+          }
+
+          result = vm_op_delete_var (literal_start_p[literal_index],
+                                     frame_ctx_p->lex_env_p);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          JERRY_ASSERT (ecma_is_value_boolean (result));
+
+          *stack_top_p++ = result;
+          continue;
+        }
+        case VM_OC_JUMP:
+        {
+          byte_code_p = byte_code_start_p + branch_offset;
+          continue;
+        }
+        case VM_OC_BRANCH_IF_STRICT_EQUAL:
+        {
+          ecma_value_t value = *(--stack_top_p);
+
+          JERRY_ASSERT (stack_top_p > frame_ctx_p->registers_p + register_end);
+
+          if (ecma_op_strict_equality_compare (value, stack_top_p[-1]))
+          {
+            byte_code_p = byte_code_start_p + branch_offset;
+            ecma_free_value (*--stack_top_p);
+          }
+          ecma_free_value (value);
+          continue;
+        }
+        case VM_OC_BRANCH_IF_TRUE:
+        case VM_OC_BRANCH_IF_FALSE:
+        case VM_OC_BRANCH_IF_LOGICAL_TRUE:
+        case VM_OC_BRANCH_IF_LOGICAL_FALSE:
+        {
+          uint32_t opcode_flags = VM_OC_GROUP_GET_INDEX (opcode_data) - VM_OC_BRANCH_IF_TRUE;
+          ecma_value_t value = *(--stack_top_p);
+
+          bool boolean_value = ecma_op_to_boolean (value);
+
+          if (opcode_flags & VM_OC_BRANCH_IF_FALSE_FLAG)
+          {
+            boolean_value = !boolean_value;
+          }
+
+          if (boolean_value)
+          {
+            byte_code_p = byte_code_start_p + branch_offset;
+            if (opcode_flags & VM_OC_LOGICAL_BRANCH_FLAG)
+            {
+              /* "Push" the value back to the stack. */
+              ++stack_top_p;
+              continue;
+            }
+          }
+
+          ecma_fast_free_value (value);
+          continue;
+        }
+        case VM_OC_PLUS:
+        {
+          result = opfunc_unary_plus (left_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_left_value;
+        }
+        case VM_OC_MINUS:
+        {
+          result = opfunc_unary_minus (left_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_left_value;
+        }
+        case VM_OC_NOT:
+        {
+          result = opfunc_logical_not (left_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_left_value;
+        }
+        case VM_OC_BIT_NOT:
+        {
+          result = do_number_bitwise_logic (NUMBER_BITWISE_NOT,
+                                            left_value,
+                                            left_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_left_value;
+        }
+        case VM_OC_VOID:
+        {
+          *stack_top_p++ = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          goto free_left_value;
+        }
+        case VM_OC_TYPEOF_IDENT:
+        {
+          uint16_t literal_index;
+
+          READ_LITERAL_INDEX (literal_index);
+
+          JERRY_ASSERT (literal_index < ident_end);
+
+          if (literal_index < register_end)
+          {
+            left_value = ecma_copy_value (frame_ctx_p->registers_p[literal_index]);
+          }
+          else
+          {
+            ecma_string_t *name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                  literal_start_p[literal_index]);
+
+            ecma_object_t *ref_base_lex_env_p = ecma_op_resolve_reference_base (frame_ctx_p->lex_env_p,
+                                                                                name_p);
+
+            if (ref_base_lex_env_p == NULL)
+            {
+              result = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+            }
+            else
+            {
+              result = ecma_op_get_value_lex_env_base (ref_base_lex_env_p,
+                                                       name_p,
+                                                       is_strict);
+
+            }
+
+            if (ECMA_IS_VALUE_ERROR (result))
+            {
+              goto error;
+            }
+
+            left_value = result;
+          }
+          /* FALLTHRU */
+        }
+        case VM_OC_TYPEOF:
+        {
+          result = opfunc_typeof (left_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_left_value;
+        }
+        case VM_OC_ADD:
+        {
+          if (ecma_are_values_integer_numbers (left_value, right_value))
+          {
+            ecma_integer_value_t left_integer = ecma_get_integer_from_value (left_value);
+            ecma_integer_value_t right_integer = ecma_get_integer_from_value (right_value);
+            result = ecma_make_int32_value ((int32_t) (left_integer + right_integer));
+            break;
+          }
+
+          if (ecma_is_value_float_number (left_value)
+              && ecma_is_value_number (right_value))
+          {
+            ecma_number_t new_value = ecma_number_add (ecma_get_float_from_value (left_value),
+                                                       ecma_get_number_from_value (right_value));
+
+            result = ecma_update_float_number (left_value, new_value);
+            left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+            break;
+          }
+
+          if (ecma_is_value_float_number (right_value)
+              && ecma_is_value_integer_number (left_value))
+          {
+            ecma_number_t new_value = ecma_number_add ((ecma_number_t) ecma_get_integer_from_value (left_value),
+                                                       ecma_get_float_from_value (right_value));
+
+            result = ecma_update_float_number (right_value, new_value);
+            right_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+            break;
+          }
+
+          result = opfunc_addition (left_value, right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_SUB:
+        {
+          JERRY_STATIC_ASSERT (ECMA_INTEGER_NUMBER_MAX * 2 <= INT32_MAX
+                               && ECMA_INTEGER_NUMBER_MIN * 2 >= INT32_MIN,
+                               doubled_ecma_numbers_must_fit_into_int32_range);
+
+          JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                        && !ECMA_IS_VALUE_ERROR (right_value));
+
+          if (ecma_are_values_integer_numbers (left_value, right_value))
+          {
+            ecma_integer_value_t left_integer = ecma_get_integer_from_value (left_value);
+            ecma_integer_value_t right_integer = ecma_get_integer_from_value (right_value);
+            result = ecma_make_int32_value ((int32_t) (left_integer - right_integer));
+            break;
+          }
+
+          if (ecma_is_value_float_number (left_value)
+              && ecma_is_value_number (right_value))
+          {
+            ecma_number_t new_value = ecma_number_substract (ecma_get_float_from_value (left_value),
+                                                             ecma_get_number_from_value (right_value));
+
+            result = ecma_update_float_number (left_value, new_value);
+            left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+            break;
+          }
+
+          if (ecma_is_value_float_number (right_value)
+              && ecma_is_value_integer_number (left_value))
+          {
+            ecma_number_t new_value = ecma_number_substract ((ecma_number_t) ecma_get_integer_from_value (left_value),
+                                                             ecma_get_float_from_value (right_value));
+
+            result = ecma_update_float_number (right_value, new_value);
+            right_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+            break;
+          }
+
+          result = do_number_arithmetic (NUMBER_ARITHMETIC_SUBSTRACTION,
+                                         left_value,
+                                         right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_MUL:
+        {
+          JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                        && !ECMA_IS_VALUE_ERROR (right_value));
+
+          JERRY_STATIC_ASSERT (ECMA_INTEGER_MULTIPLY_MAX * ECMA_INTEGER_MULTIPLY_MAX <= ECMA_INTEGER_NUMBER_MAX
+                               && -(ECMA_INTEGER_MULTIPLY_MAX * ECMA_INTEGER_MULTIPLY_MAX) >= ECMA_INTEGER_NUMBER_MIN,
+                               square_of_integer_multiply_max_must_fit_into_integer_value_range);
+
+          if (ecma_are_values_integer_numbers (left_value, right_value))
+          {
+            ecma_integer_value_t left_integer = ecma_get_integer_from_value (left_value);
+            ecma_integer_value_t right_integer = ecma_get_integer_from_value (right_value);
+
+            if (-ECMA_INTEGER_MULTIPLY_MAX <= left_integer
+                && left_integer <= ECMA_INTEGER_MULTIPLY_MAX
+                && -ECMA_INTEGER_MULTIPLY_MAX <= right_integer
+                && right_integer <= ECMA_INTEGER_MULTIPLY_MAX
+                && left_value != 0
+                && right_value != 0)
+            {
+              result = ecma_make_integer_value (left_integer * right_integer);
+              break;
+            }
+
+            ecma_number_t multiply = ecma_number_multiply ((ecma_number_t) left_integer,
+                                                           (ecma_number_t) right_integer);
+            result = ecma_make_number_value (multiply);
+            break;
+          }
+
+          if (ecma_is_value_float_number (left_value)
+              && ecma_is_value_number (right_value))
+          {
+            ecma_number_t new_value = ecma_number_multiply (ecma_get_float_from_value (left_value),
+                                                            ecma_get_number_from_value (right_value));
+
+            result = ecma_update_float_number (left_value, new_value);
+            left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+            break;
+          }
+
+          if (ecma_is_value_float_number (right_value)
+              && ecma_is_value_integer_number (left_value))
+          {
+            ecma_number_t new_value = ecma_number_multiply ((ecma_number_t) ecma_get_integer_from_value (left_value),
+                                                            ecma_get_float_from_value (right_value));
+
+            result = ecma_update_float_number (right_value, new_value);
+            right_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+            break;
+          }
+
+          result = do_number_arithmetic (NUMBER_ARITHMETIC_MULTIPLICATION,
+                                         left_value,
+                                         right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_DIV:
+        {
+          JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                        && !ECMA_IS_VALUE_ERROR (right_value));
+
+          result = do_number_arithmetic (NUMBER_ARITHMETIC_DIVISION,
+                                         left_value,
+                                         right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_MOD:
+        {
+          JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
+                        && !ECMA_IS_VALUE_ERROR (right_value));
+
+          if (ecma_are_values_integer_numbers (left_value, right_value))
+          {
+            ecma_integer_value_t left_integer = ecma_get_integer_from_value (left_value);
+            ecma_integer_value_t right_integer = ecma_get_integer_from_value (right_value);
+
+            if (right_integer != 0)
+            {
+              ecma_integer_value_t mod_result = left_integer % right_integer;
+
+              if (mod_result != 0 || left_integer >= 0)
+              {
+                result = ecma_make_integer_value (mod_result);
+                break;
+              }
+            }
+          }
+
+          result = do_number_arithmetic (NUMBER_ARITHMETIC_REMAINDER,
+                                         left_value,
+                                         right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_EQUAL:
+        {
+          result = opfunc_equal_value (left_value, right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_NOT_EQUAL:
+        {
+          result = opfunc_not_equal_value (left_value, right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_STRICT_EQUAL:
+        {
+          bool is_equal = ecma_op_strict_equality_compare (left_value, right_value);
+
+          result = ecma_make_boolean_value (is_equal);
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_STRICT_NOT_EQUAL:
+        {
+          bool is_equal = ecma_op_strict_equality_compare (left_value, right_value);
+
+          result = ecma_make_boolean_value (!is_equal);
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_BIT_OR:
+        {
+          result = do_number_bitwise_logic (NUMBER_BITWISE_LOGIC_OR,
+                                            left_value,
+                                            right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_BIT_XOR:
+        {
+          result = do_number_bitwise_logic (NUMBER_BITWISE_LOGIC_XOR,
+                                            left_value,
+                                            right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_BIT_AND:
+        {
+          result = do_number_bitwise_logic (NUMBER_BITWISE_LOGIC_AND,
+                                            left_value,
+                                            right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_LEFT_SHIFT:
+        {
+          result = do_number_bitwise_logic (NUMBER_BITWISE_SHIFT_LEFT,
+                                            left_value,
+                                            right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_RIGHT_SHIFT:
+        {
+          result = do_number_bitwise_logic (NUMBER_BITWISE_SHIFT_RIGHT,
+                                            left_value,
+                                            right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_UNS_RIGHT_SHIFT:
+        {
+          result = do_number_bitwise_logic (NUMBER_BITWISE_SHIFT_URIGHT,
+                                            left_value,
+                                            right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+          break;
+        }
+        case VM_OC_LESS:
+        {
+          if (ecma_are_values_integer_numbers (left_value, right_value))
+          {
+            ecma_integer_value_t left_integer = (ecma_integer_value_t) left_value;
+            ecma_integer_value_t right_integer = (ecma_integer_value_t) right_value;
+
+            *stack_top_p++ = ecma_make_boolean_value (left_integer < right_integer);
+            continue;
+          }
+
+          if (ecma_is_value_number (left_value) && ecma_is_value_number (right_value))
+          {
+            ecma_number_t left_number = ecma_get_number_from_value (left_value);
+            ecma_number_t right_number = ecma_get_number_from_value (right_value);
+
+            *stack_top_p++ = ecma_make_boolean_value (left_number < right_number);
+            goto free_both_values;
+          }
+
+          result = opfunc_less_than (left_value, right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_GREATER:
+        {
+          if (ecma_are_values_integer_numbers (left_value, right_value))
+          {
+            ecma_integer_value_t left_integer = (ecma_integer_value_t) left_value;
+            ecma_integer_value_t right_integer = (ecma_integer_value_t) right_value;
+
+            *stack_top_p++ = ecma_make_boolean_value (left_integer > right_integer);
+            continue;
+          }
+
+          if (ecma_is_value_number (left_value) && ecma_is_value_number (right_value))
+          {
+            ecma_number_t left_number = ecma_get_number_from_value (left_value);
+            ecma_number_t right_number = ecma_get_number_from_value (right_value);
+
+            *stack_top_p++ = ecma_make_boolean_value (left_number > right_number);
+            goto free_both_values;
+          }
+
+          result = opfunc_greater_than (left_value, right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_LESS_EQUAL:
+        {
+          if (ecma_are_values_integer_numbers (left_value, right_value))
+          {
+            ecma_integer_value_t left_integer = (ecma_integer_value_t) left_value;
+            ecma_integer_value_t right_integer = (ecma_integer_value_t) right_value;
+
+            *stack_top_p++ = ecma_make_boolean_value (left_integer <= right_integer);
+            continue;
+          }
+
+          if (ecma_is_value_number (left_value) && ecma_is_value_number (right_value))
+          {
+            ecma_number_t left_number = ecma_get_number_from_value (left_value);
+            ecma_number_t right_number = ecma_get_number_from_value (right_value);
+
+            *stack_top_p++ = ecma_make_boolean_value (left_number <= right_number);
+            goto free_both_values;
+          }
+
+          result = opfunc_less_or_equal_than (left_value, right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_GREATER_EQUAL:
+        {
+          if (ecma_are_values_integer_numbers (left_value, right_value))
+          {
+            ecma_integer_value_t left_integer = (ecma_integer_value_t) left_value;
+            ecma_integer_value_t right_integer = (ecma_integer_value_t) right_value;
+
+            *stack_top_p++ = ecma_make_boolean_value (left_integer >= right_integer);
+            continue;
+          }
+
+          if (ecma_is_value_number (left_value) && ecma_is_value_number (right_value))
+          {
+            ecma_number_t left_number = ecma_get_number_from_value (left_value);
+            ecma_number_t right_number = ecma_get_number_from_value (right_value);
+
+            *stack_top_p++ = ecma_make_boolean_value (left_number >= right_number);
+            goto free_both_values;
+          }
+
+          result = opfunc_greater_or_equal_than (left_value, right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_IN:
+        {
+          result = opfunc_in (left_value, right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_INSTANCEOF:
+        {
+          result = opfunc_instanceof (left_value, right_value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          *stack_top_p++ = result;
+          goto free_both_values;
+        }
+        case VM_OC_WITH:
+        {
+          ecma_value_t value = *(--stack_top_p);
+          ecma_object_t *object_p;
+          ecma_object_t *with_env_p;
+
+          branch_offset += (int32_t) (byte_code_start_p - frame_ctx_p->byte_code_start_p);
+
+          JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+          result = ecma_op_to_object (value);
+          ecma_free_value (value);
+
+          if (ECMA_IS_VALUE_ERROR (result))
+          {
+            goto error;
+          }
+
+          object_p = ecma_get_object_from_value (result);
+
+          with_env_p = ecma_create_object_lex_env (frame_ctx_p->lex_env_p,
+                                                   object_p,
+                                                   true);
+
+          ecma_deref_object (object_p);
+
+          VM_PLUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION);
+          stack_top_p += PARSER_WITH_CONTEXT_STACK_ALLOCATION;
+
+          stack_top_p[-1] = VM_CREATE_CONTEXT (VM_CONTEXT_WITH, branch_offset);
+          stack_top_p[-2] = ecma_make_object_value (frame_ctx_p->lex_env_p);
+
+          frame_ctx_p->lex_env_p = with_env_p;
+          continue;
+        }
+        case VM_OC_FOR_IN_CREATE_CONTEXT:
+        {
+          ecma_value_t value = *(--stack_top_p);
+
+          JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+          ecma_value_t expr_obj_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+          ecma_collection_header_t *header_p = opfunc_for_in (value, &expr_obj_value);
+          ecma_free_value (value);
+
+          if (header_p == NULL)
+          {
+            byte_code_p = byte_code_start_p + branch_offset;
+            continue;
+          }
+
+          branch_offset += (int32_t) (byte_code_start_p - frame_ctx_p->byte_code_start_p);
+
+          VM_PLUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION);
+          stack_top_p += PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION;
+          stack_top_p[-1] = (ecma_value_t) VM_CREATE_CONTEXT (VM_CONTEXT_FOR_IN, branch_offset);
+          stack_top_p[-2] = header_p->first_chunk_cp;
+          stack_top_p[-3] = expr_obj_value;
+
+          ecma_dealloc_collection_header (header_p);
+          continue;
+        }
+        case VM_OC_FOR_IN_GET_NEXT:
+        {
+          ecma_value_t *context_top_p = frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth;
+          ecma_collection_chunk_t *chunk_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_collection_chunk_t, context_top_p[-2]);
+
+          JERRY_ASSERT (VM_GET_CONTEXT_TYPE (context_top_p[-1]) == VM_CONTEXT_FOR_IN);
+
+          lit_utf8_byte_t *data_ptr = chunk_p->data;
+          result = *(ecma_value_t *) data_ptr;
+          context_top_p[-2] = chunk_p->next_chunk_cp;
+
+          ecma_dealloc_collection_chunk (chunk_p);
+
+          *stack_top_p++ = result;
+          continue;
+        }
+        case VM_OC_FOR_IN_HAS_NEXT:
+        {
+          JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+          while (true)
+          {
+            if (stack_top_p[-2] == JMEM_CP_NULL)
+            {
+              ecma_free_value (stack_top_p[-3]);
+
+              VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION);
+              stack_top_p -= PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION;
+              break;
+            }
+
+            ecma_collection_chunk_t *chunk_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_collection_chunk_t, stack_top_p[-2]);
+
+            lit_utf8_byte_t *data_ptr = chunk_p->data;
+            ecma_string_t *prop_name_p = ecma_get_string_from_value (*(ecma_value_t *) data_ptr);
+
+            if (!ecma_op_object_has_property (ecma_get_object_from_value (stack_top_p[-3]),
+                                              prop_name_p))
+            {
+              stack_top_p[-2] = chunk_p->next_chunk_cp;
+              ecma_deref_ecma_string (prop_name_p);
+              ecma_dealloc_collection_chunk (chunk_p);
+            }
+            else
+            {
+              byte_code_p = byte_code_start_p + branch_offset;
+              break;
+            }
+          }
+
+          continue;
+        }
+        case VM_OC_TRY:
+        {
+          /* Try opcode simply creates the try context. */
+          branch_offset += (int32_t) (byte_code_start_p - frame_ctx_p->byte_code_start_p);
+
+          JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+          VM_PLUS_EQUAL_U16 (frame_ctx_p->context_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+          stack_top_p += PARSER_TRY_CONTEXT_STACK_ALLOCATION;
+
+          stack_top_p[-1] = (ecma_value_t) VM_CREATE_CONTEXT (VM_CONTEXT_TRY, branch_offset);
+          continue;
+        }
+        case VM_OC_CATCH:
+        {
+          /* Catches are ignored and turned to jumps. */
+          JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+          JERRY_ASSERT (VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_TRY);
+
+          byte_code_p = byte_code_start_p + branch_offset;
+          continue;
+        }
+        case VM_OC_FINALLY:
+        {
+          branch_offset += (int32_t) (byte_code_start_p - frame_ctx_p->byte_code_start_p);
+
+          JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+          JERRY_ASSERT (VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_TRY
+                        || VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_CATCH);
+
+          if (VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_CATCH)
+          {
+            ecma_deref_object (frame_ctx_p->lex_env_p);
+            frame_ctx_p->lex_env_p = ecma_get_object_from_value (stack_top_p[-2]);
+          }
+
+          stack_top_p[-1] = (ecma_value_t) VM_CREATE_CONTEXT (VM_CONTEXT_FINALLY_JUMP, branch_offset);
+          stack_top_p[-2] = (ecma_value_t) branch_offset;
+          continue;
+        }
+        case VM_OC_CONTEXT_END:
+        {
+          JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+          switch (VM_GET_CONTEXT_TYPE (stack_top_p[-1]))
+          {
+            case VM_CONTEXT_FINALLY_JUMP:
+            {
+              uint32_t jump_target = stack_top_p[-2];
+
+              VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth,
+                                  PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+              stack_top_p -= PARSER_TRY_CONTEXT_STACK_ALLOCATION;
+
+              if (vm_stack_find_finally (frame_ctx_p,
+                                         &stack_top_p,
+                                         VM_CONTEXT_FINALLY_JUMP,
+                                         jump_target))
+              {
+                JERRY_ASSERT (VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_FINALLY_JUMP);
+                byte_code_p = frame_ctx_p->byte_code_p;
+                stack_top_p[-2] = jump_target;
+              }
+              else
+              {
+                byte_code_p = frame_ctx_p->byte_code_start_p + jump_target;
+              }
+              break;
+            }
+            case VM_CONTEXT_FINALLY_THROW:
+            {
+              result = stack_top_p[-2];
+
+              VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth,
+                                  PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+              stack_top_p -= PARSER_TRY_CONTEXT_STACK_ALLOCATION;
+              goto error;
+            }
+            case VM_CONTEXT_FINALLY_RETURN:
+            {
+              result = stack_top_p[-2];
+
+              VM_MINUS_EQUAL_U16 (frame_ctx_p->context_depth,
+                                  PARSER_TRY_CONTEXT_STACK_ALLOCATION);
+              stack_top_p -= PARSER_TRY_CONTEXT_STACK_ALLOCATION;
+              goto error;
+            }
+            default:
+            {
+              stack_top_p = vm_stack_context_abort (frame_ctx_p, stack_top_p);
+            }
+          }
+
+          JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+          continue;
+        }
+        case VM_OC_JUMP_AND_EXIT_CONTEXT:
+        {
+          JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+          branch_offset += (int32_t) (byte_code_start_p - frame_ctx_p->byte_code_start_p);
+
+          if (vm_stack_find_finally (frame_ctx_p,
+                                     &stack_top_p,
+                                     VM_CONTEXT_FINALLY_JUMP,
+                                     (uint32_t) branch_offset))
+          {
+            JERRY_ASSERT (VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_FINALLY_JUMP);
+            byte_code_p = frame_ctx_p->byte_code_p;
+            stack_top_p[-2] = (uint32_t) branch_offset;
+          }
+          else
+          {
+            byte_code_p = frame_ctx_p->byte_code_start_p + branch_offset;
+          }
+
+          JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+          continue;
+        }
+        case VM_OC_BREAKPOINT_ENABLED:
+        {
+#ifdef JERRY_DEBUGGER
+          if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_IGNORE)
+          {
+            continue;
+          }
+
+          JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+          JERRY_ASSERT (!(frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_DEBUGGER_IGNORE));
+
+          frame_ctx_p->byte_code_p = byte_code_start_p;
+
+          jerry_debugger_breakpoint_hit (JERRY_DEBUGGER_BREAKPOINT_HIT);
+#endif /* JERRY_DEBUGGER */
+          continue;
+        }
+        case VM_OC_BREAKPOINT_DISABLED:
+        {
+#ifdef JERRY_DEBUGGER
+          if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_IGNORE)
+          {
+            continue;
+          }
+
+          JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
+
+          JERRY_ASSERT (!(frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_DEBUGGER_IGNORE));
+
+          frame_ctx_p->byte_code_p = byte_code_start_p;
+
+          if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_STOP)
+              && (JERRY_CONTEXT (debugger_stop_context) == NULL
+                  || JERRY_CONTEXT (debugger_stop_context) == JERRY_CONTEXT (vm_top_context_p)))
+          {
+            jerry_debugger_breakpoint_hit (JERRY_DEBUGGER_BREAKPOINT_HIT);
+            continue;
+          }
+
+          if (JERRY_CONTEXT (debugger_message_delay) > 0)
+          {
+            JERRY_CONTEXT (debugger_message_delay)--;
+            continue;
+          }
+
+          JERRY_CONTEXT (debugger_message_delay) = JERRY_DEBUGGER_MESSAGE_FREQUENCY;
+
+          if (jerry_debugger_receive ())
+          {
+            continue;
+          }
+
+          if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_STOP)
+              && (JERRY_CONTEXT (debugger_stop_context) == NULL
+                  || JERRY_CONTEXT (debugger_stop_context) == JERRY_CONTEXT (vm_top_context_p)))
+          {
+            jerry_debugger_breakpoint_hit (JERRY_DEBUGGER_BREAKPOINT_HIT);
+          }
+#endif /* JERRY_DEBUGGER */
+          continue;
+        }
+        default:
+        {
+          JERRY_UNREACHABLE ();
+          continue;
+        }
+      }
+
+      JERRY_ASSERT (VM_OC_HAS_PUT_RESULT (opcode_data));
+
+      if (opcode_data & VM_OC_PUT_IDENT)
+      {
+        uint16_t literal_index;
+
+        READ_LITERAL_INDEX (literal_index);
+
+        if (literal_index < register_end)
+        {
+          ecma_fast_free_value (frame_ctx_p->registers_p[literal_index]);
+
+          frame_ctx_p->registers_p[literal_index] = result;
+
+          if (opcode_data & (VM_OC_PUT_STACK | VM_OC_PUT_BLOCK))
+          {
+            result = ecma_fast_copy_value (result);
+          }
+        }
+        else
+        {
+          ecma_string_t *var_name_str_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                                        literal_start_p[literal_index]);
+          ecma_object_t *ref_base_lex_env_p = ecma_op_resolve_reference_base (frame_ctx_p->lex_env_p,
+                                                                              var_name_str_p);
+
+          ecma_value_t put_value_result = ecma_op_put_value_lex_env_base (ref_base_lex_env_p,
+                                                                          var_name_str_p,
+                                                                          is_strict,
+                                                                          result);
+
+          if (ECMA_IS_VALUE_ERROR (put_value_result))
+          {
+            ecma_free_value (result);
+            result = put_value_result;
+            goto error;
+          }
+
+          if (!(opcode_data & (VM_OC_PUT_STACK | VM_OC_PUT_BLOCK)))
+          {
+            ecma_fast_free_value (result);
+          }
+        }
+      }
+      else if (opcode_data & VM_OC_PUT_REFERENCE)
+      {
+        ecma_value_t property = *(--stack_top_p);
+        ecma_value_t object = *(--stack_top_p);
+
+        if (object == ecma_make_simple_value (ECMA_SIMPLE_VALUE_REGISTER_REF))
+        {
+          ecma_fast_free_value (frame_ctx_p->registers_p[property]);
+
+          frame_ctx_p->registers_p[property] = result;
+
+          if (!(opcode_data & (VM_OC_PUT_STACK | VM_OC_PUT_BLOCK)))
+          {
+            goto free_both_values;
+          }
+          result = ecma_fast_copy_value (result);
+        }
+        else
+        {
+          ecma_value_t set_value_result = vm_op_set_value (object,
+                                                           property,
+                                                           result,
+                                                           is_strict);
+
+          if (ECMA_IS_VALUE_ERROR (set_value_result))
+          {
+            ecma_free_value (result);
+            result = set_value_result;
+            goto error;
+          }
+
+          if (!(opcode_data & (VM_OC_PUT_STACK | VM_OC_PUT_BLOCK)))
+          {
+            ecma_fast_free_value (result);
+            goto free_both_values;
+          }
+        }
+      }
+
+      if (opcode_data & VM_OC_PUT_STACK)
+      {
+        *stack_top_p++ = result;
+      }
+      else if (opcode_data & VM_OC_PUT_BLOCK)
+      {
+        ecma_fast_free_value (block_result);
+        block_result = result;
+      }
+
+free_both_values:
+      ecma_fast_free_value (right_value);
+free_left_value:
+      ecma_fast_free_value (left_value);
+    }
+error:
+
+    ecma_fast_free_value (left_value);
+    ecma_fast_free_value (right_value);
+
+    if (ECMA_IS_VALUE_ERROR (result))
+    {
+      ecma_value_t *vm_stack_p = stack_top_p;
+
+      for (vm_stack_p = frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth;
+           vm_stack_p < stack_top_p;
+           vm_stack_p++)
+      {
+        if (*vm_stack_p == ecma_make_simple_value (ECMA_SIMPLE_VALUE_REGISTER_REF))
+        {
+          JERRY_ASSERT (vm_stack_p < stack_top_p);
+          vm_stack_p++;
+        }
+        else
+        {
+          ecma_free_value (*vm_stack_p);
+        }
+      }
+
+      stack_top_p = frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth;
+#ifdef JERRY_DEBUGGER
+      if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
+          && !(frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_DEBUGGER_IGNORE)
+          && !(JERRY_CONTEXT (debugger_flags) & (JERRY_DEBUGGER_VM_IGNORE_EXCEPTION | JERRY_DEBUGGER_VM_IGNORE)))
+      {
+        if (jerry_debugger_send_exception_string (result))
+        {
+          jerry_debugger_breakpoint_hit (JERRY_DEBUGGER_EXCEPTION_HIT);
+        }
+      }
+#endif /* JERRY_DEBUGGER */
+    }
+
+    JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+    if (frame_ctx_p->context_depth == 0)
+    {
+      /* In most cases there is no context. */
+
+      ecma_fast_free_value (block_result);
+      return result;
+    }
+
+    if (!ECMA_IS_VALUE_ERROR (result))
+    {
+      JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+      stack_top_p = frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth;
+
+      if (vm_stack_find_finally (frame_ctx_p,
+                                 &stack_top_p,
+                                 VM_CONTEXT_FINALLY_RETURN,
+                                 0))
+      {
+        JERRY_ASSERT (VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_FINALLY_RETURN);
+        JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+        byte_code_p = frame_ctx_p->byte_code_p;
+        stack_top_p[-2] = result;
+        continue;
+      }
+    }
+    else
+    {
+      if (vm_stack_find_finally (frame_ctx_p,
+                                 &stack_top_p,
+                                 VM_CONTEXT_FINALLY_THROW,
+                                 0))
+      {
+        JERRY_ASSERT (frame_ctx_p->registers_p + register_end + frame_ctx_p->context_depth == stack_top_p);
+
+        byte_code_p = frame_ctx_p->byte_code_p;
+
+        if (VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_CATCH)
+        {
+          uint32_t literal_index;
+          ecma_object_t *catch_env_p;
+          ecma_string_t *catch_name_p;
+
+          *stack_top_p++ = ecma_get_value_from_error_value (result);
+
+          JERRY_ASSERT (byte_code_p[0] == CBC_ASSIGN_SET_IDENT);
+
+          literal_index = byte_code_p[1];
+          if (literal_index >= encoding_limit)
+          {
+            literal_index = ((literal_index << 8) | byte_code_p[2]) - encoding_delta;
+          }
+
+          catch_env_p = ecma_create_decl_lex_env (frame_ctx_p->lex_env_p);
+
+          catch_name_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_string_t,
+                                                       literal_start_p[literal_index]);
+
+          ecma_op_create_mutable_binding (catch_env_p, catch_name_p, false);
+
+          stack_top_p[-2 - 1] = ecma_make_object_value (frame_ctx_p->lex_env_p);
+          frame_ctx_p->lex_env_p = catch_env_p;
+        }
+        else
+        {
+          JERRY_ASSERT (VM_GET_CONTEXT_TYPE (stack_top_p[-1]) == VM_CONTEXT_FINALLY_THROW);
+          stack_top_p[-2] = result;
+        }
+
+#ifdef JERRY_VM_EXEC_STOP
+        if (JERRY_CONTEXT (vm_exec_stop_cb) != NULL
+            && --JERRY_CONTEXT (vm_exec_stop_counter) == 0)
+        {
+          result = JERRY_CONTEXT (vm_exec_stop_cb) (JERRY_CONTEXT (vm_exec_stop_user_p));
+
+          if (ecma_is_value_undefined (result))
+          {
+            JERRY_CONTEXT (vm_exec_stop_counter) = JERRY_CONTEXT (vm_exec_stop_frequency);
+          }
+          else
+          {
+            JERRY_CONTEXT (vm_exec_stop_counter) = 1;
+
+            left_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+            right_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+
+            if (!ECMA_IS_VALUE_ERROR (result))
+            {
+              result = ecma_make_error_value (result);
+            }
+            goto error;
+          }
+        }
+#endif /* JERRY_VM_EXEC_STOP */
+
+        continue;
+      }
+    }
+
+    ecma_free_value (block_result);
+    return result;
+  }
+} /* vm_loop */
+
+#undef READ_LITERAL
+#undef READ_LITERAL_INDEX
+
+/**
+ * Execute code block.
+ *
+ * @return ecma value
+ */
+static ecma_value_t __attr_noinline___
+vm_execute (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
+            const ecma_value_t *arg_p, /**< arguments list */
+            ecma_length_t arg_list_len) /**< length of arguments list */
+{
+  const ecma_compiled_code_t *bytecode_header_p = frame_ctx_p->bytecode_header_p;
+  ecma_value_t completion_value;
+  uint16_t argument_end;
+  uint16_t register_end;
+
+  if (bytecode_header_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_header_p;
+
+    argument_end = args_p->argument_end;
+    register_end = args_p->register_end;
+  }
+  else
+  {
+    cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_header_p;
+
+    argument_end = args_p->argument_end;
+    register_end = args_p->register_end;
+  }
+
+  frame_ctx_p->stack_top_p = frame_ctx_p->registers_p + register_end;
+
+  if (arg_list_len > argument_end)
+  {
+    arg_list_len = argument_end;
+  }
+
+  for (uint32_t i = 0; i < arg_list_len; i++)
+  {
+    frame_ctx_p->registers_p[i] = ecma_fast_copy_value (arg_p[i]);
+  }
+
+  /* The arg_list_len contains the end of the copied arguments.
+   * Fill everything else with undefined. */
+  if (register_end > arg_list_len)
+  {
+    ecma_value_t *stack_p = frame_ctx_p->registers_p + arg_list_len;
+
+    for (uint32_t i = arg_list_len; i < register_end; i++)
+    {
+      *stack_p++ = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
+    }
+  }
+
+  JERRY_CONTEXT (is_direct_eval_form_call) = false;
+
+  JERRY_CONTEXT (vm_top_context_p) = frame_ctx_p;
+
+  vm_init_loop (frame_ctx_p);
+
+  while (true)
+  {
+    completion_value = vm_loop (frame_ctx_p);
+
+    if (frame_ctx_p->call_operation == VM_NO_EXEC_OP)
+    {
+      break;
+    }
+
+    if (frame_ctx_p->call_operation == VM_EXEC_CALL)
+    {
+      opfunc_call (frame_ctx_p);
+    }
+    else
+    {
+      JERRY_ASSERT (frame_ctx_p->call_operation == VM_EXEC_CONSTRUCT);
+      opfunc_construct (frame_ctx_p);
+    }
+  }
+
+  /* Free arguments and registers */
+  for (uint32_t i = 0; i < register_end; i++)
+  {
+    ecma_fast_free_value (frame_ctx_p->registers_p[i]);
+  }
+
+#ifdef JERRY_DEBUGGER
+  if (JERRY_CONTEXT (debugger_stop_context) == JERRY_CONTEXT (vm_top_context_p))
+  {
+    /* The engine will stop when the next breakpoint is reached. */
+    JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_STOP);
+    JERRY_CONTEXT (debugger_stop_context) = NULL;
+  }
+#endif /* JERRY_DEBUGGER */
+
+  JERRY_CONTEXT (vm_top_context_p) = frame_ctx_p->prev_context_p;
+  return completion_value;
+} /* vm_execute */
+
+/**
+ * Run the code.
+ *
+ * @return ecma value
+ */
+ecma_value_t
+vm_run (const ecma_compiled_code_t *bytecode_header_p, /**< byte-code data header */
+        ecma_value_t this_binding_value, /**< value of 'ThisBinding' */
+        ecma_object_t *lex_env_p, /**< lexical environment to use */
+        bool is_eval_code, /**< is the code is eval code (ECMA-262 v5, 10.1) */
+        const ecma_value_t *arg_list_p, /**< arguments list */
+        ecma_length_t arg_list_len) /**< length of arguments list */
+{
+  jmem_cpointer_t *literal_p;
+  vm_frame_ctx_t frame_ctx;
+  uint32_t call_stack_size;
+
+  if (bytecode_header_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
+  {
+    cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_header_p;
+    uint8_t *byte_p = (uint8_t *) bytecode_header_p;
+
+    literal_p = (jmem_cpointer_t *) (byte_p + sizeof (cbc_uint16_arguments_t));
+    frame_ctx.literal_start_p = literal_p;
+    literal_p += args_p->literal_end;
+    call_stack_size = (uint32_t) (args_p->register_end + args_p->stack_limit);
+  }
+  else
+  {
+    cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_header_p;
+    uint8_t *byte_p = (uint8_t *) bytecode_header_p;
+
+    literal_p = (jmem_cpointer_t *) (byte_p + sizeof (cbc_uint8_arguments_t));
+    frame_ctx.literal_start_p = literal_p;
+    literal_p += args_p->literal_end;
+    call_stack_size = (uint32_t) (args_p->register_end + args_p->stack_limit);
+  }
+
+  frame_ctx.bytecode_header_p = bytecode_header_p;
+  frame_ctx.byte_code_p = (uint8_t *) literal_p;
+  frame_ctx.byte_code_start_p = (uint8_t *) literal_p;
+  frame_ctx.lex_env_p = lex_env_p;
+  frame_ctx.prev_context_p = JERRY_CONTEXT (vm_top_context_p);
+  frame_ctx.this_binding = this_binding_value;
+  frame_ctx.context_depth = 0;
+  frame_ctx.is_eval_code = is_eval_code;
+  frame_ctx.call_operation = VM_NO_EXEC_OP;
+
+  /* Use JERRY_MAX() to avoid array declaration with size 0. */
+  ecma_value_t stack[JERRY_MAX (call_stack_size, 1)];
+  frame_ctx.registers_p = stack;
+
+  return vm_execute (&frame_ctx, arg_list_p, arg_list_len);
+} /* vm_run */
+
+/**
+ * Check whether currently executed code is strict mode code
+ *
+ * @return true - current code is executed in strict mode,
+ *         false - otherwise
+ */
+bool
+vm_is_strict_mode (void)
+{
+  JERRY_ASSERT (JERRY_CONTEXT (vm_top_context_p) != NULL);
+
+  return JERRY_CONTEXT (vm_top_context_p)->bytecode_header_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE;
+} /* vm_is_strict_mode */
+
+/**
+ * Check whether currently performed call (on top of call-stack) is performed in form,
+ * meeting conditions of 'Direct Call to Eval' (see also: ECMA-262 v5, 15.1.2.1.1)
+ *
+ * Warning:
+ *         the function should only be called from implementation
+ *         of built-in 'eval' routine of Global object
+ *
+ * @return true - currently performed call is performed through 'eval' identifier,
+ *                without 'this' argument,
+ *         false - otherwise
+ */
+inline bool __attr_always_inline___
+vm_is_direct_eval_form_call (void)
+{
+  return JERRY_CONTEXT (is_direct_eval_form_call);
+} /* vm_is_direct_eval_form_call */
+
+/**
+ * @}
+ * @}
+ */
diff --git a/deps/jerry/jerry-core/vm/vm.h b/deps/jerry/jerry-core/vm/vm.h
new file mode 100644 (file)
index 0000000..d243b8d
--- /dev/null
@@ -0,0 +1,294 @@
+/* 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.
+ */
+
+#ifndef VM_H
+#define VM_H
+
+#include "ecma-globals.h"
+#include "jrt.h"
+#include "vm-defines.h"
+
+/** \addtogroup vm Virtual machine
+ * @{
+ *
+ * \addtogroup vm_executor Executor
+ * @{
+ */
+
+/**
+ * Each CBC opcode is transformed to three vm opcodes:
+ *
+ *  - first opcode is a "get arguments" opcode which specifies
+ *    the type (register, literal, stack, etc.) and number
+ *    (from 0 to 2) of input arguments
+ *  - second opcode is a "group" opcode which specifies
+ *    the actual operation (add, increment, call, etc.)
+ *  - third opcode is a "put result" opcode which specifies
+ *    the destination where the result is stored (register,
+ *    stack, etc.)
+ */
+
+/**
+ * Branch argument is a backward branch
+ */
+#define VM_OC_BACKWARD_BRANCH 0x4000
+
+/**
+ * Position of "get arguments" opcode.
+ */
+#define VM_OC_GET_ARGS_SHIFT 7
+
+/**
+ * Mask of "get arguments" opcode.
+ */
+#define VM_OC_GET_ARGS_MASK 0x7
+
+/**
+ * Generate the binary representation of a "get arguments" opcode.
+ */
+#define VM_OC_GET_ARGS_CREATE_INDEX(V) (((V) & VM_OC_GET_ARGS_MASK) << VM_OC_GET_ARGS_SHIFT)
+
+/**
+ * Extract the "get arguments" opcode.
+ */
+#define VM_OC_GET_ARGS_INDEX(O) ((O) & (VM_OC_GET_ARGS_MASK << VM_OC_GET_ARGS_SHIFT))
+
+/**
+ * Checks whether the result is stored somewhere.
+ */
+#define VM_OC_HAS_GET_ARGS(V) ((V) & (VM_OC_GET_ARGS_MASK << VM_OC_GET_ARGS_SHIFT))
+
+/**
+ * Argument getters that are part of the opcodes.
+ */
+typedef enum
+{
+  VM_OC_GET_NONE = VM_OC_GET_ARGS_CREATE_INDEX (0),             /**< do nothing */
+  VM_OC_GET_BRANCH = VM_OC_GET_ARGS_CREATE_INDEX (1),           /**< branch argument */
+  VM_OC_GET_STACK = VM_OC_GET_ARGS_CREATE_INDEX (2),            /**< pop one element from the stack */
+  VM_OC_GET_STACK_STACK = VM_OC_GET_ARGS_CREATE_INDEX (3),      /**< pop two elements from the stack */
+
+  VM_OC_GET_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (4),          /**< resolve literal */
+  VM_OC_GET_LITERAL_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (5),  /**< resolve two literals */
+  VM_OC_GET_STACK_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (6),    /**< pop one element from the stack
+                                                                 *   and resolve a literal */
+  VM_OC_GET_THIS_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (7),     /**< get this and resolve a literal */
+} vm_oc_get_types;
+
+/**
+ * Mask of "group" opcode.
+ */
+#define VM_OC_GROUP_MASK 0x7f
+
+/**
+ * Extract the "group" opcode.
+ */
+#define VM_OC_GROUP_GET_INDEX(O) ((O) & VM_OC_GROUP_MASK)
+
+/**
+ * Opcodes.
+ */
+typedef enum
+{
+  VM_OC_NONE,                    /**< do nothing */
+  VM_OC_POP,                     /**< pop from stack */
+  VM_OC_POP_BLOCK,               /**< pop block */
+  VM_OC_PUSH,                    /**< push one element  */
+  VM_OC_PUSH_TWO,                /**< push two elements onto the stack */
+  VM_OC_PUSH_THREE,              /**< push three elements onto the stack */
+  VM_OC_PUSH_UNDEFINED,          /**< push undefined value */
+  VM_OC_PUSH_TRUE,               /**< push true value */
+  VM_OC_PUSH_FALSE,              /**< push false value */
+  VM_OC_PUSH_NULL,               /**< push null value */
+  VM_OC_PUSH_THIS,               /**< push this */
+  VM_OC_PUSH_NUMBER_0,           /**< push number zero */
+  VM_OC_PUSH_NUMBER_POS_BYTE,    /**< push number between 1 and 256 */
+  VM_OC_PUSH_NUMBER_NEG_BYTE,    /**< push number between -1 and -256 */
+  VM_OC_PUSH_OBJECT,             /**< push object */
+  VM_OC_SET_PROPERTY,            /**< set property */
+  VM_OC_SET_GETTER,              /**< set getter */
+  VM_OC_SET_SETTER,              /**< set setter */
+  VM_OC_PUSH_UNDEFINED_BASE,     /**< push undefined base */
+  VM_OC_PUSH_ARRAY,              /**< push array */
+  VM_OC_PUSH_ELISON,             /**< push elison */
+  VM_OC_APPEND_ARRAY,            /**< append array */
+  VM_OC_IDENT_REFERENCE,         /**< ident reference */
+  VM_OC_PROP_REFERENCE,          /**< prop reference */
+  VM_OC_PROP_GET,                /**< prop get */
+
+  /* These eight opcodes must be in this order. */
+  VM_OC_PROP_PRE_INCR,           /**< prefix increment of a property */
+  VM_OC_PROP_PRE_DECR,           /**< prop prefix decrement of a property */
+  VM_OC_PROP_POST_INCR,          /**< prop postfix increment of a property */
+  VM_OC_PROP_POST_DECR,          /**< prop postfix decrement of a property */
+  VM_OC_PRE_INCR,                /**< prefix increment  */
+  VM_OC_PRE_DECR,                /**< prefix decrement */
+  VM_OC_POST_INCR,               /**< postfix increment */
+  VM_OC_POST_DECR,               /**< postfix decrement */
+
+  VM_OC_PROP_DELETE,             /**< delete property */
+  VM_OC_DELETE,                  /**< delete */
+
+  VM_OC_ASSIGN,                  /**< assign */
+  VM_OC_ASSIGN_PROP,             /**< assign property */
+  VM_OC_ASSIGN_PROP_THIS,        /**< assign prop this */
+
+  VM_OC_RET,                     /**< return */
+  VM_OC_THROW,                   /**< throw */
+  VM_OC_THROW_REFERENCE_ERROR,   /**< throw reference error */
+
+  VM_OC_EVAL,                    /**< eval */
+  VM_OC_CALL,                    /**< call */
+  VM_OC_NEW,                     /**< new */
+
+  VM_OC_JUMP,                    /**< jump */
+  VM_OC_BRANCH_IF_STRICT_EQUAL,  /**< branch if stric equal */
+
+  /* These four opcodes must be in this order. */
+  VM_OC_BRANCH_IF_TRUE,          /**< branch if true */
+  VM_OC_BRANCH_IF_FALSE,         /**< branch if false */
+  VM_OC_BRANCH_IF_LOGICAL_TRUE,  /**< branch if logical true */
+  VM_OC_BRANCH_IF_LOGICAL_FALSE, /**< branch if logical false */
+
+  VM_OC_PLUS,                    /**< unary plus */
+  VM_OC_MINUS,                   /**< unary minus */
+  VM_OC_NOT,                     /**< not */
+  VM_OC_BIT_NOT,                 /**< bitwise not */
+  VM_OC_VOID,                    /**< void */
+  VM_OC_TYPEOF_IDENT,            /**< typeof identifier */
+  VM_OC_TYPEOF,                  /**< typeof */
+
+  VM_OC_ADD,                     /**< binary add */
+  VM_OC_SUB,                     /**< binary sub */
+  VM_OC_MUL,                     /**< mul */
+  VM_OC_DIV,                     /**< div */
+  VM_OC_MOD,                     /**< mod */
+
+  VM_OC_EQUAL,                   /**< equal */
+  VM_OC_NOT_EQUAL,               /**< not equal */
+  VM_OC_STRICT_EQUAL,            /**< strict equal */
+  VM_OC_STRICT_NOT_EQUAL,        /**< strict not equal */
+  VM_OC_LESS,                    /**< less */
+  VM_OC_GREATER,                 /**< greater */
+  VM_OC_LESS_EQUAL,              /**< less equal */
+  VM_OC_GREATER_EQUAL,           /**< greater equal */
+  VM_OC_IN,                      /**< in */
+  VM_OC_INSTANCEOF,              /**< instanceof */
+
+  VM_OC_BIT_OR,                  /**< bitwise or */
+  VM_OC_BIT_XOR,                 /**< bitwise xor */
+  VM_OC_BIT_AND,                 /**< bitwise and */
+  VM_OC_LEFT_SHIFT,              /**< left shift */
+  VM_OC_RIGHT_SHIFT,             /**< right shift */
+  VM_OC_UNS_RIGHT_SHIFT,         /**< unsigned right shift */
+
+  VM_OC_WITH,                    /**< with */
+  VM_OC_FOR_IN_CREATE_CONTEXT,   /**< for in create context */
+  VM_OC_FOR_IN_GET_NEXT,         /**< get next */
+  VM_OC_FOR_IN_HAS_NEXT,         /**< has next */
+  VM_OC_TRY,                     /**< try */
+  VM_OC_CATCH,                   /**< catch */
+  VM_OC_FINALLY,                 /**< finally */
+  VM_OC_CONTEXT_END,             /**< context end */
+  VM_OC_JUMP_AND_EXIT_CONTEXT,   /**< jump and exit context */
+  VM_OC_BREAKPOINT_ENABLED,       /**< enabled breakpoint for debugger */
+  VM_OC_BREAKPOINT_DISABLED,      /**< disabled breakpoint for debugger */
+} vm_oc_types;
+
+/**
+ * Decrement operator.
+ */
+#define VM_OC_DECREMENT_OPERATOR_FLAG 0x1
+
+/**
+ * Postfix increment/decrement operator.
+ */
+#define VM_OC_POST_INCR_DECR_OPERATOR_FLAG 0x2
+
+/**
+ * An named variable is updated by the increment/decrement operator.
+ */
+#define VM_OC_IDENT_INCR_DECR_OPERATOR_FLAG 0x4
+
+/**
+ * Jump to target offset if input value is logical false.
+ */
+#define VM_OC_BRANCH_IF_FALSE_FLAG 0x1
+
+/**
+ * Branch optimized for logical and/or opcodes.
+ */
+#define VM_OC_LOGICAL_BRANCH_FLAG 0x2
+
+/**
+ * Position of "put result" opcode.
+ */
+#define VM_OC_PUT_RESULT_SHIFT 10
+
+/**
+ * Mask of "put result" opcode.
+ */
+#define VM_OC_PUT_RESULT_MASK 0xf
+
+/**
+ * Generate a "put result" opcode flag bit.
+ */
+#define VM_OC_PUT_RESULT_CREATE_FLAG(V) (((V) & VM_OC_PUT_RESULT_MASK) << VM_OC_PUT_RESULT_SHIFT)
+
+/**
+ * Checks whether the result is stored somewhere.
+ */
+#define VM_OC_HAS_PUT_RESULT(V) ((V) & (VM_OC_PUT_RESULT_MASK << VM_OC_PUT_RESULT_SHIFT))
+
+/**
+ * Specify where the result is stored
+ */
+typedef enum
+{
+  VM_OC_PUT_IDENT = VM_OC_PUT_RESULT_CREATE_FLAG (0x1),
+  VM_OC_PUT_REFERENCE = VM_OC_PUT_RESULT_CREATE_FLAG (0x2),
+  VM_OC_PUT_STACK = VM_OC_PUT_RESULT_CREATE_FLAG (0x4),
+  VM_OC_PUT_BLOCK = VM_OC_PUT_RESULT_CREATE_FLAG (0x8),
+} vm_oc_put_types;
+
+/**
+ * Non-recursive vm_loop: the vm_loop can be suspended
+ * to execute a call /construct operation. These return
+ * types of the vm_loop tells whether a call operation
+ * is in progress or the vm_loop is finished.
+ */
+typedef enum
+{
+  VM_NO_EXEC_OP,                 /**< do nothing */
+  VM_EXEC_CALL,                  /**< invoke a function */
+  VM_EXEC_CONSTRUCT,             /**< construct a new object */
+} vm_call_operation;
+
+ecma_value_t vm_run_global (const ecma_compiled_code_t *bytecode_p);
+ecma_value_t vm_run_eval (ecma_compiled_code_t *bytecode_data_p, bool is_direct);
+
+ecma_value_t vm_run (const ecma_compiled_code_t *bytecode_header_p, ecma_value_t this_binding_value,
+                     ecma_object_t *lex_env_p, bool is_eval_code, const ecma_value_t *arg_list_p,
+                     ecma_length_t arg_list_len);
+
+bool vm_is_strict_mode (void);
+bool vm_is_direct_eval_form_call (void);
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* !VM_H */
diff --git a/deps/jerry/jerry-debugger/jerry-client-ws-html.py b/deps/jerry/jerry-debugger/jerry-client-ws-html.py
new file mode 100644 (file)
index 0000000..b79072c
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+# 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.
+
+import argparse
+import os
+import webbrowser
+
+
+def main():
+    parser = argparse.ArgumentParser(description="JerryScript debugger client in HTML")
+    parser.add_argument("address", action="store", nargs="?", default="localhost:5001",
+                        help="specify a unique network address for connection (default: %(default)s)")
+    args = parser.parse_args()
+
+    webbrowser.open_new("file://%s?address=%s" % (os.path.abspath("jerry-client-ws.html"), args.address))
+
+
+if __name__ == "__main__":
+    main()
diff --git a/deps/jerry/jerry-debugger/jerry-client-ws.html b/deps/jerry/jerry-debugger/jerry-client-ws.html
new file mode 100644 (file)
index 0000000..c59da1d
--- /dev/null
@@ -0,0 +1,1392 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>
+JerryScript HTML (WebSocket) Debugger Client
+</title>
+<style>
+body {
+  background-color: #feffd6;
+  text-align: center;
+}
+
+input {
+  margin-top: 10px;
+  width: 650px;
+}
+
+textarea {
+  width: 750px;
+  margin-top: 30px;
+  resize: none;
+}
+</style>
+</head>
+<body>
+<h2>JerryScript HTML (WebSocket) Debugger Client</h2>
+<div class="container">
+  <div>
+    <textarea readonly rows="16" id="log"></textarea>
+  </div>
+  <p role="alert">Getting help: type <b>help</b> in the command line below.</p>
+  <div>
+    <input id="command" rows="1" type="text" onkeypress="debuggerCommand(event); return true;">
+  <div>
+</div>
+<script>
+var JERRY_DEBUGGER_CONFIGURATION = 1;
+var JERRY_DEBUGGER_PARSE_ERROR = 2;
+var JERRY_DEBUGGER_BYTE_CODE_CP = 3;
+var JERRY_DEBUGGER_PARSE_FUNCTION = 4;
+var JERRY_DEBUGGER_BREAKPOINT_LIST = 5;
+var JERRY_DEBUGGER_BREAKPOINT_OFFSET_LIST = 6;
+var JERRY_DEBUGGER_SOURCE_CODE = 7;
+var JERRY_DEBUGGER_SOURCE_CODE_END = 8;
+var JERRY_DEBUGGER_SOURCE_CODE_NAME = 9;
+var JERRY_DEBUGGER_SOURCE_CODE_NAME_END = 10;
+var JERRY_DEBUGGER_FUNCTION_NAME = 11;
+var JERRY_DEBUGGER_FUNCTION_NAME_END = 12;
+var JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP = 13;
+var JERRY_DEBUGGER_MEMSTATS_RECEIVE = 14;
+var JERRY_DEBUGGER_BREAKPOINT_HIT = 15;
+var JERRY_DEBUGGER_EXCEPTION_HIT = 16;
+var JERRY_DEBUGGER_EXCEPTION_STR = 17;
+var JERRY_DEBUGGER_EXCEPTION_STR_END = 18;
+var JERRY_DEBUGGER_BACKTRACE = 19;
+var JERRY_DEBUGGER_BACKTRACE_END = 20;
+var JERRY_DEBUGGER_EVAL_RESULT = 21;
+var JERRY_DEBUGGER_EVAL_RESULT_END = 22;
+var JERRY_DEBUGGER_EVAL_ERROR = 23;
+var JERRY_DEBUGGER_EVAL_ERROR_END = 24;
+
+var JERRY_DEBUGGER_FREE_BYTE_CODE_CP = 1;
+var JERRY_DEBUGGER_UPDATE_BREAKPOINT = 2;
+var JERRY_DEBUGGER_EXCEPTION_CONFIG = 3;
+var JERRY_DEBUGGER_MEMSTATS = 4;
+var JERRY_DEBUGGER_STOP = 5;
+var JERRY_DEBUGGER_CONTINUE = 6;
+var JERRY_DEBUGGER_STEP = 7;
+var JERRY_DEBUGGER_NEXT = 8;
+var JERRY_DEBUGGER_GET_BACKTRACE = 9;
+var JERRY_DEBUGGER_EVAL = 10;
+var JERRY_DEBUGGER_EVAL_PART = 11;
+
+var textBox = document.getElementById("log");
+var commandBox = document.getElementById("command");
+var socket = null;
+
+var address = "localhost";
+var params = window.location.search.slice(1).split("&");
+for (var i = 0; i < params.length; i++)
+{
+  var nv = params[i].split("=");
+  var name = nv[0], value = nv[1];
+  if (name == "address")
+  {
+    address = value;
+  }
+}
+
+textBox.value = ""
+commandBox.value = "connect " + address
+
+function appendLog(str)
+{
+  textBox.value += str + "\n";
+  textBox.scrollTop = textBox.scrollHeight;
+}
+
+var debuggerObj = null;
+
+function DebuggerClient(address)
+{
+  appendLog("ws://" + address + "/jerry-debugger");
+
+  var parseObj = null;
+  var maxMessageSize = 0;
+  var cpointerSize = 0;
+  var littleEndian = true;
+  var functions = { };
+  var lineList = new Multimap();
+  var lastBreakpointHit = null;
+  var activeBreakpoints = { };
+  var nextBreakpointIndex = 1;
+  var pendingBreakpoints = [ ];
+  var backtraceFrame = 0;
+  var evalResult = null;
+  var exceptionData = null;
+
+  function assert(expr)
+  {
+    if (!expr)
+    {
+      throw new Error("Assertion failed.");
+    }
+  }
+
+  function setUint32(array, offset, value)
+  {
+    if (littleEndian)
+    {
+      array[offset] = value & 0xff;
+      array[offset + 1] = (value >> 8) & 0xff;
+      array[offset + 2] = (value >> 16) & 0xff;
+      array[offset + 3] = (value >> 24) & 0xff;
+    }
+    else
+    {
+      array[offset] = (value >> 24) & 0xff;
+      array[offset + 1] = (value >> 16) & 0xff;
+      array[offset + 2] = (value >> 8) & 0xff;
+      array[offset + 3] = value & 0xff;
+    }
+  }
+
+  /* Concat the two arrays. The first byte (opcode) of nextArray is ignored. */
+  function concatUint8Arrays(baseArray, nextArray)
+  {
+    if (nextArray.byteLength <= 1)
+    {
+      /* Nothing to append. */
+      return baseArray;
+    }
+
+    if (!baseArray)
+    {
+      /* Cut the first byte (opcode). */
+      return nextArray.slice(1);
+    }
+
+    var baseLength = baseArray.byteLength;
+    var nextLength = nextArray.byteLength - 1;
+
+    var result = new Uint8Array(baseLength + nextLength);
+    result.set(nextArray, baseLength - 1);
+
+    /* This set operation overwrites the opcode. */
+    result.set(baseArray);
+
+    return result;
+  }
+
+  function cesu8ToString(array)
+  {
+    if (!array)
+    {
+      return "";
+    }
+
+    var length = array.byteLength;
+
+    var i = 0;
+    var result = "";
+
+    while (i < length)
+    {
+      var chr = array[i];
+
+      ++i;
+
+      if (chr >= 0x7f)
+      {
+        if (chr & 0x20)
+        {
+          /* Three byte long character. */
+          chr = ((chr & 0xf) << 12) | ((array[i] & 0x3f) << 6) | (array[i + 1] & 0x3f);
+          i += 2;
+        }
+        else
+        {
+          /* Two byte long character. */
+          chr = ((chr & 0x1f) << 6) | (array[i] & 0x3f);
+          ++i;
+        }
+      }
+
+      result += String.fromCharCode(chr);
+    }
+
+    return result;
+  }
+
+  function stringToCesu8(string)
+  {
+    assert(string != "");
+
+    var length = string.length;
+    var byteLength = length;
+
+    for (var i = 0; i < length; i++)
+    {
+      var chr = string.charCodeAt(i);
+
+      if (chr >= 0x7ff)
+      {
+        byteLength ++;
+      }
+
+      if (chr >= 0x7f)
+      {
+        byteLength++;
+      }
+    }
+
+    var result = new Uint8Array(byteLength + 1 + 4);
+
+    result[0] = JERRY_DEBUGGER_EVAL;
+
+    setUint32(result, 1, byteLength);
+
+    var offset = 5;
+
+    for (var i = 0; i < length; i++)
+    {
+      var chr = string.charCodeAt(i);
+
+      if (chr >= 0x7ff)
+      {
+        result[offset] = 0xe0 | (chr >> 12);
+        result[offset + 1] = 0x80 | ((chr >> 6) & 0x3f);
+        result[offset + 2] = 0x80 | (chr & 0x3f);
+        offset += 3;
+      }
+      else if (chr >= 0x7f)
+      {
+        result[offset] = 0xc0 | (chr >> 6);
+        result[offset + 1] = 0x80 | (chr & 0x3f);
+      }
+      else
+      {
+        result[offset] = chr;
+        offset++;
+      }
+    }
+
+    return result;
+  }
+
+  function breakpointToString(breakpoint)
+  {
+    var name = breakpoint.func.name;
+
+    var result = breakpoint.func.sourceName;
+
+    if (!result)
+    {
+      result = "<unknown>";
+    }
+
+    result += ":" + breakpoint.line;
+
+    if (breakpoint.func.is_func)
+    {
+      result += " (in "
+                + (breakpoint.func.name ? breakpoint.func.name : "function")
+                + "() at line:"
+                + breakpoint.func.line
+                + ", col:"
+                + breakpoint.func.column
+                + ")";
+    }
+
+    return result;
+  }
+
+  function Multimap()
+  {
+    /* Each item is an array of items. */
+
+    var map = { };
+
+    this.get = function(key)
+    {
+      var item = map[key];
+      return item ? item : [ ];
+    }
+
+    this.insert = function(key, value)
+    {
+      var item = map[key];
+
+      if (item)
+      {
+        item.push(value);
+        return;
+      }
+
+      map[key] = [ value ];
+    }
+
+    this.delete = function(key, value)
+    {
+      var array = map[key];
+
+      assert(array);
+
+      var newLength = array.length - 1;
+      var i = array.indexOf(value);
+
+      assert(i != -1);
+
+      array.splice(i, 1);
+      array.length = newLength;
+    }
+  }
+
+  var socket = new WebSocket("ws://" + address + "/jerry-debugger");
+  socket.binaryType = 'arraybuffer';
+
+  function abortConnection(message)
+  {
+    assert(socket && debuggerObj);
+
+    socket.close();
+    socket = null;
+    debuggerObj = null;
+
+    appendLog("Abort connection: " + message);
+    throw new Error(message);
+  }
+
+  socket.onerror = function(event)
+  {
+    if (socket)
+    {
+      socket = null;
+      debuggerObj = null;
+      appendLog("Connection closed.");
+    }
+  }
+  socket.onclose = socket.onerror;
+
+  socket.onopen = function(event)
+  {
+    appendLog("Connection created.");
+  }
+
+  function getFormatSize(format)
+  {
+    var length = 0;
+
+    for (var i = 0; i < format.length; i++)
+    {
+      if (format[i] == "B")
+      {
+        length++;
+        continue;
+      }
+
+      if (format[i] == "C")
+      {
+        length += cpointerSize;
+        continue;
+      }
+
+      assert(format[i] == "I")
+
+      length += 4;
+    }
+
+    return length;
+  }
+
+  function decodeMessage(format, message, offset)
+  {
+    /* Format: B=byte I=int32 C=cpointer.
+     * Returns an array of decoded numbers. */
+
+    var result = []
+    var value;
+
+    if (!offset)
+    {
+      offset = 0;
+    }
+
+    if (offset + getFormatSize(format) > message.byteLength)
+    {
+      abortConnection("received message too short.");
+    }
+
+    for (var i = 0; i < format.length; i++)
+    {
+      if (format[i] == "B")
+      {
+        result.push(message[offset])
+        offset++;
+        continue;
+      }
+
+      if (format[i] == "C" && cpointerSize == 2)
+      {
+        if (littleEndian)
+        {
+          value = message[offset] | (message[offset + 1] << 8);
+        }
+        else
+        {
+          value = (message[offset] << 8) | message[offset + 1];
+        }
+
+        result.push(value);
+        offset += 2;
+        continue;
+      }
+
+      assert(format[i] == "I" || (format[i] == "C" && cpointerSize == 4));
+
+      if (littleEndian)
+      {
+        value = (message[offset] | (message[offset + 1] << 8)
+                 | (message[offset + 2] << 16) | (message[offset + 3] << 24));
+      }
+      else
+      {
+        value = ((message[offset] << 24) | (message[offset + 1] << 16)
+                 | (message[offset + 2] << 8) | message[offset + 3] << 24);
+      }
+
+      result.push(value);
+      offset += 4;
+    }
+
+    return result;
+  }
+
+  function encodeMessage(format, values)
+  {
+    /* Format: B=byte I=int32 C=cpointer.
+     * Sends a message after the encoding is completed. */
+
+    var length = getFormatSize(format);
+    var message = new Uint8Array(length);
+    var offset = 0;
+
+    for (var i = 0; i < format.length; i++)
+    {
+      var value = values[i];
+
+      if (format[i] == "B")
+      {
+        message[offset] = value;
+        offset++;
+        continue;
+      }
+
+      if (format[i] == "C" && cpointerSize == 2)
+      {
+        if (littleEndian)
+        {
+          message[offset] = value & 0xff;
+          message[offset + 1] = (value >> 8) & 0xff;
+        }
+        else
+        {
+          message[offset] = (value >> 8) & 0xff;
+          message[offset + 1] = value & 0xff;
+        }
+
+        offset += 2;
+        continue;
+      }
+
+      setUint32(message, offset, value);
+      offset += 4;
+    }
+
+    socket.send(message);
+  }
+
+  function releaseFunction(message)
+  {
+    var byte_code_cp = decodeMessage("C", message, 1)[0];
+    var func = functions[byte_code_cp];
+
+    for (var i in func.lines)
+    {
+      lineList.delete(i, func);
+
+      var breakpoint = func.lines[i];
+
+      assert(i == breakpoint.line);
+
+      if (breakpoint.activeIndex >= 0)
+      {
+        delete activeBreakpoints[breakpoint.activeIndex];
+      }
+    }
+
+    delete functions[byte_code_cp];
+
+    message[0] = JERRY_DEBUGGER_FREE_BYTE_CODE_CP;
+    socket.send(message);
+  }
+
+  function getBreakpoint(breakpointData)
+  {
+    var returnValue = {};
+    var func = functions[breakpointData[0]];
+    var offset = breakpointData[1];
+
+    if (offset in func.offsets)
+    {
+      returnValue.breakpoint = func.offsets[offset];
+      returnValue.at = true;
+      return returnValue;
+    }
+
+    if (offset < func.firstBreakpointOffset)
+    {
+      returnValue.breakpoint = func.offsets[func.firstBreakpointOffset];
+      returnValue.at = true;
+      return returnValue;
+    }
+
+    nearest_offset = -1;
+
+    for (var current_offset in func.offsets)
+    {
+      if ((current_offset <= offset) && (current_offset > nearest_offset))
+      {
+        nearest_offset = current_offset;
+      }
+    }
+
+    returnValue.breakpoint = func.offsets[nearest_offset];
+    returnValue.at = false;
+    return returnValue;
+  }
+
+  this.encodeMessage = encodeMessage;
+
+  function ParseSource()
+  {
+    var source = "";
+    var sourceData = null;
+    var sourceName = "";
+    var sourceNameData = null;
+    var functionName = null;
+    var stack = [{ is_func: false,
+                   line: 1,
+                   column: 1,
+                   name: "",
+                   source: "",
+                   lines: [],
+                   offsets: [] }];
+    var newFunctions = { };
+
+    this.receive = function(message)
+    {
+      switch (message[0])
+      {
+        case JERRY_DEBUGGER_PARSE_ERROR:
+        {
+          /* Parse error occured in JerryScript. */
+          parseObj = null;
+          return;
+        }
+
+        case JERRY_DEBUGGER_SOURCE_CODE:
+        case JERRY_DEBUGGER_SOURCE_CODE_END:
+        {
+          sourceData = concatUint8Arrays(sourceData, message);
+
+          if (message[0] == JERRY_DEBUGGER_SOURCE_CODE_END)
+          {
+            source = cesu8ToString(sourceData);
+          }
+          return;
+        }
+
+        case JERRY_DEBUGGER_SOURCE_CODE_NAME:
+        case JERRY_DEBUGGER_SOURCE_CODE_NAME_END:
+        {
+          sourceNameData = concatUint8Arrays(sourceNameData, message);
+
+          if (message[0] == JERRY_DEBUGGER_SOURCE_CODE_NAME_END)
+          {
+            sourceName = cesu8ToString(sourceNameData);
+          }
+          return;
+        }
+
+        case JERRY_DEBUGGER_FUNCTION_NAME:
+        case JERRY_DEBUGGER_FUNCTION_NAME_END:
+        {
+          functionName = concatUint8Arrays(functionName, message);
+          return;
+        }
+
+        case JERRY_DEBUGGER_PARSE_FUNCTION:
+        {
+          position = decodeMessage("II", message, 1);
+
+          stack.push({ is_func: true,
+                       line: position[0],
+                       column: position[1],
+                       name: cesu8ToString(functionName),
+                       source: source,
+                       sourceName: sourceName,
+                       lines: [],
+                       offsets: [] });
+          functionName = null;
+          return;
+        }
+
+        case JERRY_DEBUGGER_BREAKPOINT_LIST:
+        case JERRY_DEBUGGER_BREAKPOINT_OFFSET_LIST:
+        {
+          var array;
+
+          if (message.byteLength < 1 + 4)
+          {
+            abortConnection("message too short.");
+          }
+
+          if (message[0] == JERRY_DEBUGGER_BREAKPOINT_LIST)
+          {
+            array = stack[stack.length - 1].lines;
+          }
+          else
+          {
+            array = stack[stack.length - 1].offsets;
+          }
+
+          for (var i = 1; i < message.byteLength; i += 4)
+          {
+            array.push(decodeMessage("I", message, i)[0]);
+          }
+          return;
+        }
+
+        case JERRY_DEBUGGER_BYTE_CODE_CP:
+        {
+          var func = stack.pop();
+          func.byte_code_cp = decodeMessage("C", message, 1)[0];
+
+          lines = {}
+          offsets = {}
+
+          func.firstBreakpointLine = func.lines[0];
+          func.firstBreakpointOffset = func.offsets[0];
+
+          for (var i = 0; i < func.lines.length; i++)
+          {
+            var breakpoint = { line: func.lines[i], offset: func.offsets[i], func: func, activeIndex: -1 };
+
+            lines[breakpoint.line] = breakpoint;
+            offsets[breakpoint.offset] = breakpoint;
+          }
+
+          func.lines = lines;
+          func.offsets = offsets;
+
+          newFunctions[func.byte_code_cp] = func;
+
+          if (stack.length > 0)
+          {
+            return;
+          }
+
+          func.source = source;
+          func.sourceName = sourceName;
+          break;
+        }
+
+        case JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP:
+        {
+          var byte_code_cp = decodeMessage("C", message, 1)[0];
+
+          if (byte_code_cp in newFunctions)
+          {
+            delete newFunctions[byte_code_cp];
+          }
+          else
+          {
+            releaseFunction(message);
+          }
+          return;
+        }
+
+        default:
+        {
+          abortConnection("unexpected message.");
+          return;
+        }
+      }
+
+      for (var i in newFunctions)
+      {
+        var func = newFunctions[i];
+
+        functions[i] = func;
+
+        for (var j in func.lines)
+        {
+          lineList.insert(j, func);
+        }
+      }
+
+      if (pendingBreakpoints.length != 0)
+      {
+        appendLog("Available pending breakpoints");
+
+        for (var i in pendingBreakpoints)
+        {
+          if (Number.isInteger(pendingBreakpoints[i]))
+          {
+            pendingBreakpoints[i] = sourceName + ":" + pendingBreakpoints[i];
+          }
+          appendLog("Try to add: " + pendingBreakpoints[i]);
+          debuggerObj.setBreakpoint(pendingBreakpoints[i], false);
+        }
+      }
+      else
+      {
+        appendLog("No pending breakpoints");
+      }
+
+      parseObj = null;
+    }
+  }
+
+  socket.onmessage = function(event)
+  {
+    var message = new Uint8Array(event.data);
+
+    if (message.byteLength < 1)
+    {
+      abortConnection("message too short.");
+    }
+
+    if (cpointerSize == 0)
+    {
+      if (message[0] != JERRY_DEBUGGER_CONFIGURATION
+          || message.byteLength != 4)
+      {
+        abortConnection("the first message must be configuration.");
+      }
+
+      maxMessageSize = message[1]
+      cpointerSize = message[2]
+      littleEndian = (message[3] != 0);
+
+      if (cpointerSize != 2 && cpointerSize != 4)
+      {
+        abortConnection("compressed pointer must be 2 or 4 byte long.");
+      }
+
+      config = false;
+      return;
+    }
+
+    if (parseObj)
+    {
+      parseObj.receive(message)
+      return;
+    }
+
+    switch (message[0])
+    {
+      case JERRY_DEBUGGER_PARSE_ERROR:
+      case JERRY_DEBUGGER_BYTE_CODE_CP:
+      case JERRY_DEBUGGER_PARSE_FUNCTION:
+      case JERRY_DEBUGGER_BREAKPOINT_LIST:
+      case JERRY_DEBUGGER_SOURCE_CODE:
+      case JERRY_DEBUGGER_SOURCE_CODE_END:
+      case JERRY_DEBUGGER_SOURCE_CODE_NAME:
+      case JERRY_DEBUGGER_SOURCE_CODE_NAME_END:
+      case JERRY_DEBUGGER_FUNCTION_NAME:
+      case JERRY_DEBUGGER_FUNCTION_NAME_END:
+      {
+        parseObj = new ParseSource()
+        parseObj.receive(message)
+        return;
+      }
+
+      case JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP:
+      {
+        releaseFunction(message);
+        return;
+      }
+
+      case JERRY_DEBUGGER_MEMSTATS_RECEIVE:
+      {
+        var messagedata = decodeMessage("IIIII", message, 1);
+
+        appendLog("Allocated bytes: " + messagedata[0]);
+        appendLog("Byte code bytes: " + messagedata[1]);
+        appendLog("String bytes: " + messagedata[2]);
+        appendLog("Object bytes: " + messagedata[3]);
+        appendLog("Property bytes: " + messagedata[4]);
+        return;
+      }
+
+      case JERRY_DEBUGGER_BREAKPOINT_HIT:
+      case JERRY_DEBUGGER_EXCEPTION_HIT:
+      {
+        var breakpointData = decodeMessage("CI", message, 1);
+        var breakpointRef = getBreakpoint(breakpointData);
+        var breakpoint = breakpointRef.breakpoint;
+
+        if (message[0] == JERRY_DEBUGGER_EXCEPTION_HIT)
+        {
+          appendLog("Exception throw detected (to disable automatic stop type exception 0)");
+          if (exceptionData)
+          {
+            appendLog("Exception hint: " + cesu8ToString(exceptionData));
+            exceptionData = null;
+          }
+        }
+
+        lastBreakpointHit = breakpoint;
+
+        var breakpointInfo = "";
+        if (breakpoint.offset.activeIndex >= 0)
+        {
+          breakpointInfo = " breakpoint:" + breakpoint.offset.activeIndex + " ";
+        }
+
+        appendLog("Stopped "
+                  + (breakpoint.at ? "at " : "around ")
+                  + breakpointInfo
+                  + breakpointToString(breakpoint));
+        return;
+      }
+
+      case JERRY_DEBUGGER_EXCEPTION_STR:
+      case JERRY_DEBUGGER_EXCEPTION_STR_END:
+      {
+        exceptionData = concatUint8Arrays(exceptionData, message);
+        return;
+      }
+
+      case JERRY_DEBUGGER_BACKTRACE:
+      case JERRY_DEBUGGER_BACKTRACE_END:
+      {
+        for (var i = 1; i < message.byteLength; i += cpointerSize + 4)
+        {
+          var breakpointData = decodeMessage("CI", message, i);
+
+          breakpoint = getBreakpoint(breakpointData).breakpoint;
+
+          appendLog("  frame "
+                    + backtraceFrame
+                    + ": "
+                    + breakpointToString(breakpoint));
+
+          ++backtraceFrame;
+        }
+
+        if (message[0] == JERRY_DEBUGGER_BACKTRACE_END)
+        {
+          backtraceFrame = 0;
+        }
+        return;
+      }
+
+      case JERRY_DEBUGGER_EVAL_RESULT:
+      case JERRY_DEBUGGER_EVAL_RESULT_END:
+      case JERRY_DEBUGGER_EVAL_ERROR:
+      case JERRY_DEBUGGER_EVAL_ERROR_END:
+      {
+        evalResult = concatUint8Arrays(evalResult, message);
+
+        if (message[0] == JERRY_DEBUGGER_EVAL_RESULT_END)
+        {
+          appendLog(cesu8ToString(evalResult));
+          evalResult = null;
+          return;
+        }
+
+        if (message[0] == JERRY_DEBUGGER_EVAL_ERROR_END)
+        {
+          appendLog("Uncaught exception: " + cesu8ToString(evalResult));
+          evalResult = null;
+          return;
+        }
+
+        return;
+      }
+
+      default:
+      {
+        abortConnection("unexpected message.");
+        return;
+      }
+    }
+  }
+
+  function insertBreakpoint(breakpoint)
+  {
+    if (breakpoint.activeIndex < 0)
+    {
+      breakpoint.activeIndex = nextBreakpointIndex;
+      activeBreakpoints[nextBreakpointIndex] = breakpoint;
+      nextBreakpointIndex++;
+
+      var values = [ JERRY_DEBUGGER_UPDATE_BREAKPOINT,
+                     1,
+                     breakpoint.func.byte_code_cp,
+                     breakpoint.offset ];
+
+      encodeMessage("BBCI", values);
+    }
+
+    appendLog("Breakpoint " + breakpoint.activeIndex + " at " + breakpointToString(breakpoint));
+  }
+
+  this.setBreakpoint = function(str, pending)
+  {
+    line = /^(.+):([1-9][0-9]*)$/.exec(str);
+    var found = false;
+
+    if (line)
+    {
+      var functionList = lineList.get(line[2]);
+
+      for (var i = 0; i < functionList.length; ++i)
+      {
+        var func = functionList[i];
+        var sourceName = func.sourceName;
+
+        if (sourceName == line[1]
+            || sourceName.endsWith("/" + line[1])
+            || sourceName.endsWith("\\" + line[1]))
+        {
+          insertBreakpoint(func.lines[line[2]]);
+          found = true;
+        }
+      }
+    }
+    else
+    {
+      for (var i in functions)
+      {
+        var func = functions[i];
+
+        if (func.name == str)
+        {
+          insertBreakpoint(func.lines[func.firstBreakpointLine]);
+          found = true;
+        }
+      }
+    }
+    if (!found)
+    {
+      appendLog("Breakpoint not found");
+      if (pending)
+      {
+        if (line)
+        {
+          pendingBreakpoints.push(Number(line[2]));
+          appendLog("Pending breakpoint index: " + line[0] + " added");
+        }
+        else
+        {
+          pendingBreakpoints.push(str);
+          appendLog("Pending breakpoint function name: " + str + " added");
+        }
+      }
+    }
+  }
+
+  this.sendExceptionConfig = function(enable)
+  {
+    if (enable == "")
+    {
+      appendLog("Argument required");
+      return;
+    }
+
+    if (enable == 1)
+    {
+      appendLog("Stop at exception enabled");
+    }
+    else if (enable == 0)
+    {
+      appendLog("Stop at exception disabled");
+    }
+    else
+    {
+      appendLog("Invalid input. Usage 1: [Enable] or 0: [Disable].");
+      return;
+    }
+
+    encodeMessage("BB", [ JERRY_DEBUGGER_EXCEPTION_CONFIG, enable ]);
+  }
+
+  this.deleteBreakpoint = function(index)
+  {
+    breakpoint = activeBreakpoints[index];
+
+    if (index == "all")
+    {
+      var found = false;
+
+      for (var i in activeBreakpoints)
+      {
+        delete activeBreakpoints[i];
+        found = true;
+      }
+
+      if (!found)
+      {
+        appendLog("No active breakpoints.")
+      }
+    }
+
+    else if (!breakpoint)
+    {
+      appendLog("No breakpoint found with index " + index);
+      return;
+    }
+
+    assert(breakpoint.activeIndex == index);
+
+    delete activeBreakpoints[index];
+    breakpoint.activeIndex = -1;
+
+    var values = [ JERRY_DEBUGGER_UPDATE_BREAKPOINT,
+                   0,
+                   breakpoint.func.byte_code_cp,
+                   breakpoint.offset ];
+
+    encodeMessage("BBCI", values);
+
+    appendLog("Breakpoint " + index + " is deleted.");
+  }
+
+  this.deletePendingBreakpoint = function(index)
+  {
+    if (index >= pendingBreakpoints.length)
+    {
+      appendLog("Pending breakpoint not found");
+    }
+    else
+    {
+      pendingBreakpoints.splice(index, 1);
+      appendLog("Pending breakpoint " + index + " is deleted.");
+    }
+  }
+
+  this.listBreakpoints = function()
+  {
+    appendLog("List of active breakpoints:");
+    var found = false;
+
+    for (var i in activeBreakpoints)
+    {
+      appendLog("  breakpoint " + i + " at " + breakpointToString(activeBreakpoints[i]));
+      found = true;
+    }
+
+    if (!found)
+    {
+      appendLog("  no active breakpoints");
+    }
+
+    if (pendingBreakpoints.length != 0)
+    {
+      appendLog("List of pending breakpoints:");
+      for (var i in pendingBreakpoints)
+      {
+        appendLog("  pending breakpoint " + i + " at " + pendingBreakpoints[i]);
+      }
+    }
+    else {
+      appendLog("No pending breakpoints");
+    }
+  }
+
+  this.sendResumeExec = function(command)
+  {
+    if (!lastBreakpointHit)
+    {
+      appendLog("This command is allowed only if JavaScript execution is stopped at a breakpoint.");
+      return;
+    }
+
+    encodeMessage("B", [ command ]);
+
+    lastBreakpointHit = null;
+  }
+
+  this.sendGetBacktrace = function(depth)
+  {
+    if (!lastBreakpointHit)
+    {
+      appendLog("This command is allowed only if JavaScript execution is stopped at a breakpoint.");
+      return;
+    }
+
+    encodeMessage("BI", [ JERRY_DEBUGGER_GET_BACKTRACE, max_depth ]);
+
+    appendLog("Backtrace:");
+  }
+
+  this.sendEval = function(str)
+  {
+    if (!lastBreakpointHit)
+    {
+      appendLog("This command is allowed only if JavaScript execution is stopped at a breakpoint.");
+      return;
+    }
+
+    if (str == "")
+    {
+      appendLog("Argument required");
+      return;
+    }
+
+    var array = stringToCesu8(str);
+    var byteLength = array.byteLength;
+
+    if (byteLength <= maxMessageSize)
+    {
+      socket.send(array);
+      return;
+    }
+
+    socket.send(array.slice(0, maxMessageSize));
+
+    var offset = maxMessageSize - 1;
+
+    while (offset < byteLength)
+    {
+      array[offset] = JERRY_DEBUGGER_EVAL_PART;
+      socket.send(array.slice(offset, offset + maxMessageSize));
+      offset += maxMessageSize - 1;
+    }
+  }
+
+  this.printSource = function()
+  {
+    if (lastBreakpointHit)
+    {
+      appendLog(lastBreakpointHit.func.source);
+    }
+  }
+
+  this.dump = function()
+  {
+    for (var i in functions)
+    {
+      var func = functions[i];
+      var sourceName = func.sourceName;
+
+      if (!sourceName)
+      {
+        sourceName = "<unknown>";
+      }
+
+      appendLog("Function 0x"
+                + Number(i).toString(16)
+                + " '"
+                + func.name
+                + "' at "
+                + sourceName
+                + ":"
+                + func.line
+                + ","
+                + func.column);
+
+      for (var j in func.lines)
+      {
+        var active = "";
+
+        if (func.lines[j].active >= 0)
+        {
+          active = " (active: " + func.lines[j].active + ")";
+        }
+
+        appendLog("  Breakpoint line: " + j + " at memory offset: " + func.lines[j].offset + active);
+      }
+    }
+  }
+}
+
+function debuggerCommand(event)
+{
+  if (event.keyCode != 13)
+  {
+    return true;
+  }
+
+  var command = commandBox.value.trim();
+
+  args = /^([a-zA-Z]+)(?:\s+([^\s].*)|)$/.exec(command);
+
+  if (!args)
+  {
+    appendLog("Invalid command");
+    document.getElementById("command").value = "";
+    return true;
+  }
+
+  if (!args[2])
+  {
+    args[2] = "";
+  }
+
+  if (args[1] == "help")
+  {
+    appendLog("Debugger commands:\n" +
+              "  connect <IP address:PORT> - connect to server (default is localhost:5001)\n" +
+              "  break|b <file_name:line>|<function_name> - set breakpoint\n" +
+              "  fbreak <file_name:line>|<function_name> - set breakpoint if not found, add to pending list\n" +
+              "  delete|d <id> - delete breakpoint\n" +
+              "  pendingdel <id> - delete pending breakpoint\n" +
+              "  list - list breakpoints\n" +
+              "  continue|c - continue execution\n" +
+              "  step|s - step-in execution\n" +
+              "  next|n - execution until the next breakpoint\n" +
+              "  eval|e - evaluate expression\n" +
+              "  backtrace|bt <max-depth> - get backtrace\n" +
+              "  src - print current source code\n" +
+              "  dump - dump all breakpoint data");
+
+    commandBox.value = "";
+    return true;
+  }
+
+  if (args[1] == "connect")
+  {
+    if (debuggerObj)
+    {
+      appendLog("Debugger is connected");
+      return true;
+    }
+
+    var ipAddr = args[2];
+    var PORT = "5001";
+
+    if (ipAddr == "")
+    {
+      ipAddr = "localhost";
+    }
+
+    if (ipAddr.match(/.*:\d/))
+    {
+      var fields = ipAddr.split(":");
+      ipAddr = fields[0];
+      PORT = fields[1];
+    }
+
+    var address = ipAddr + ":" + PORT;
+
+    appendLog("Connect to: " + address);
+
+    debuggerObj = new DebuggerClient(address);
+
+    commandBox.value = "";
+    return true;
+  }
+
+  if (!debuggerObj)
+  {
+    appendLog("Debugger is NOT connected");
+
+    commandBox.value = "";
+    return true;
+  }
+
+  switch(args[1])
+  {
+    case "b":
+    case "break":
+      debuggerObj.setBreakpoint(args[2], false);
+      break;
+
+    case "fbreak":
+      debuggerObj.setBreakpoint(args[2], true);
+      break;
+
+    case "d":
+    case "delete":
+      debuggerObj.deleteBreakpoint(args[2]);
+      break;
+
+    case "pendingdel":
+      debuggerObj.deletePendingBreakpoint(args[2]);
+
+    case "st":
+    case "stop":
+      debuggerObj.encodeMessage("B", [ JERRY_DEBUGGER_STOP ]);
+      break;
+
+    case "ms":
+    case "memstats":
+      debuggerObj.encodeMessage("B", [ JERRY_DEBUGGER_MEMSTATS ]);
+      break;
+
+    case "c":
+    case "continue":
+      debuggerObj.sendResumeExec(JERRY_DEBUGGER_CONTINUE);
+      break;
+
+    case "s":
+    case "step":
+      debuggerObj.sendResumeExec(JERRY_DEBUGGER_STEP);
+      break;
+
+    case "n":
+    case "next":
+      debuggerObj.sendResumeExec(JERRY_DEBUGGER_NEXT);
+      break;
+
+    case "e":
+    case "eval":
+      debuggerObj.sendEval(args[2]);
+      break;
+
+    case "bt":
+    case "backtrace":
+      max_depth = 0;
+
+      if (args[2])
+      {
+        if (/[1-9][0-9]*/.exec(args[2]))
+        {
+          max_depth = parseInt(args[2]);
+        }
+        else
+        {
+          appendLog("Invalid maximum depth argument.");
+          break;
+        }
+      }
+
+      debuggerObj.sendGetBacktrace(max_depth);
+      break;
+
+    case "exception":
+      debuggerObj.sendExceptionConfig(args[2]);
+      break;
+
+    case "src":
+      debuggerObj.printSource();
+      break;
+
+    case "list":
+      debuggerObj.listBreakpoints();
+      break;
+
+    case "dump":
+      debuggerObj.dump();
+      break;
+
+    default:
+      appendLog("Unknown command: " + args[1]);
+      break;
+  }
+
+  commandBox.value = "";
+  return true;
+}
+
+</script>
+
+</body>
+</html>
diff --git a/deps/jerry/jerry-debugger/jerry-client-ws.py b/deps/jerry/jerry-debugger/jerry-client-ws.py
new file mode 100755 (executable)
index 0000000..45d1221
--- /dev/null
@@ -0,0 +1,1106 @@
+#!/usr/bin/env python
+
+# 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.
+
+from __future__ import print_function
+from cmd import Cmd
+from pprint import pprint  # For the readable stack printing.
+import argparse
+import logging
+import re
+import select
+import socket
+import struct
+import sys
+
+# Messages sent by the server to client.
+JERRY_DEBUGGER_CONFIGURATION = 1
+JERRY_DEBUGGER_PARSE_ERROR = 2
+JERRY_DEBUGGER_BYTE_CODE_CP = 3
+JERRY_DEBUGGER_PARSE_FUNCTION = 4
+JERRY_DEBUGGER_BREAKPOINT_LIST = 5
+JERRY_DEBUGGER_BREAKPOINT_OFFSET_LIST = 6
+JERRY_DEBUGGER_SOURCE_CODE = 7
+JERRY_DEBUGGER_SOURCE_CODE_END = 8
+JERRY_DEBUGGER_SOURCE_CODE_NAME = 9
+JERRY_DEBUGGER_SOURCE_CODE_NAME_END = 10
+JERRY_DEBUGGER_FUNCTION_NAME = 11
+JERRY_DEBUGGER_FUNCTION_NAME_END = 12
+JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP = 13
+JERRY_DEBUGGER_MEMSTATS_RECEIVE = 14
+JERRY_DEBUGGER_BREAKPOINT_HIT = 15
+JERRY_DEBUGGER_EXCEPTION_HIT = 16
+JERRY_DEBUGGER_EXCEPTION_STR = 17
+JERRY_DEBUGGER_EXCEPTION_STR_END = 18
+JERRY_DEBUGGER_BACKTRACE = 19
+JERRY_DEBUGGER_BACKTRACE_END = 20
+JERRY_DEBUGGER_EVAL_RESULT = 21
+JERRY_DEBUGGER_EVAL_RESULT_END = 22
+JERRY_DEBUGGER_EVAL_ERROR = 23
+JERRY_DEBUGGER_EVAL_ERROR_END = 24
+
+
+# Messages sent by the client to server.
+JERRY_DEBUGGER_FREE_BYTE_CODE_CP = 1
+JERRY_DEBUGGER_UPDATE_BREAKPOINT = 2
+JERRY_DEBUGGER_EXCEPTION_CONFIG = 3
+JERRY_DEBUGGER_MEMSTATS = 4
+JERRY_DEBUGGER_STOP = 5
+JERRY_DEBUGGER_CONTINUE = 6
+JERRY_DEBUGGER_STEP = 7
+JERRY_DEBUGGER_NEXT = 8
+JERRY_DEBUGGER_GET_BACKTRACE = 9
+JERRY_DEBUGGER_EVAL = 10
+JERRY_DEBUGGER_EVAL_PART = 11
+
+MAX_BUFFER_SIZE = 128
+WEBSOCKET_BINARY_FRAME = 2
+WEBSOCKET_FIN_BIT = 0x80
+
+
+def arguments_parse():
+    parser = argparse.ArgumentParser(description="JerryScript debugger client")
+
+    parser.add_argument("address", action="store", nargs="?", default="localhost:5001",
+                        help="specify a unique network address for connection (default: %(default)s)")
+    parser.add_argument("-v", "--verbose", action="store_true", default=False,
+                        help="increase verbosity (default: %(default)s)")
+    parser.add_argument("--non-interactive", action="store_true", default=False,
+                        help="disable stop when newline is pressed (default: %(default)s)")
+    parser.add_argument("--color", action="store_true", default=False,
+                        help="enable color highlighting on source commands (default: %(default)s)")
+    parser.add_argument("--display", action="store", default=None, type=int,
+                        help="set display range")
+    parser.add_argument("--exception", action="store", default=None, type=int, choices=[0, 1],
+                        help="set exception config, usage 1: [Enable] or 0: [Disable]")
+
+    args = parser.parse_args()
+
+    if args.verbose:
+        logging.basicConfig(format="%(levelname)s: %(message)s", level=logging.DEBUG)
+        logging.debug("Debug logging mode: ON")
+
+    return args
+
+
+class JerryBreakpoint(object):
+
+    def __init__(self, line, offset, function):
+        self.line = line
+        self.offset = offset
+        self.function = function
+        self.active_index = -1
+
+    def __str__(self):
+        result = self.function.source_name or "<unknown>"
+        result += ":%d" % (self.line)
+
+        if self.function.is_func:
+            result += " (in "
+            result += self.function.name or "function"
+            result += "() at line:%d, col:%d)" % (self.function.line, self.function.column)
+        return result
+
+    def __repr__(self):
+        return ("Breakpoint(line:%d, offset:%d, active_index:%d)"
+                % (self.line, self.offset, self.active_index))
+
+class JerryPendingBreakpoint(object):
+    def __init__(self, line=None, source_name=None, function=None):
+        self.function = function
+        self.line = line
+        self.source_name = source_name
+
+        self.index = -1
+
+    def __str__(self):
+        result = self.source_name or ""
+        if self.line:
+            result += ":%d" % (self.line)
+        else:
+            result += "%s()" % (self.function)
+        return result
+
+
+
+class JerryFunction(object):
+
+    def __init__(self, is_func, byte_code_cp, source, source_name, line, column, name, lines, offsets):
+        self.is_func = is_func
+        self.byte_code_cp = byte_code_cp
+        self.source = re.split("\r\n|[\r\n]", source)
+        self.source_name = source_name
+        self.name = name
+        self.lines = {}
+        self.offsets = {}
+        self.line = line
+        self.column = column
+        self.first_breakpoint_line = lines[0]
+        self.first_breakpoint_offset = offsets[0]
+
+        for i in range(len(lines)):
+            line = lines[i]
+            offset = offsets[i]
+            breakpoint = JerryBreakpoint(line, offset, self)
+            self.lines[line] = breakpoint
+            self.offsets[offset] = breakpoint
+
+    def __repr__(self):
+        result = ("Function(byte_code_cp:0x%x, source_name:%r, name:%r, line:%d, column:%d { "
+                  % (self.byte_code_cp, self.source_name, self.name, self.line, self.column))
+
+        result += ','.join([str(breakpoint) for breakpoint in self.lines.values()])
+
+        return result + " })"
+
+
+class DebuggerPrompt(Cmd):
+
+    def __init__(self, debugger):
+        Cmd.__init__(self)
+        self.debugger = debugger
+        self.stop = False
+        self.quit = False
+        self.cont = True
+        self.non_interactive = False
+
+    def precmd(self, line):
+        self.stop = False
+        self.cont = False
+        if self.non_interactive:
+            print("%s" % line)
+        return line
+
+    def postcmd(self, stop, line):
+        return self.stop
+
+    def disable_args(self, args):
+        if args:
+            print("Error: No argument expected")
+            return True
+        return False
+
+    def do_quit(self, args):
+        """ Exit JerryScript debugger """
+        self.do_delete("all")
+        self.do_exception("0")  # disable the exception handler
+        self.exec_command(args, JERRY_DEBUGGER_CONTINUE)
+        self.stop = True
+        self.quit = True
+
+    def do_break(self, args):
+        """ Insert breakpoints on the given lines or functions """
+        if args == "":
+            print("Error: Breakpoint index expected")
+        else:
+            set_breakpoint(self.debugger, args)
+
+    do_b = do_break
+
+    def exec_command(self, args, command_id):
+        self.stop = True
+        if args != "":
+            print("Error: No argument expected")
+        else:
+            self.debugger.send_command(command_id)
+
+    def do_continue(self, args):
+        """ Continue execution """
+        self.exec_command(args, JERRY_DEBUGGER_CONTINUE)
+        self.stop = True
+        self.cont = True
+        if not self.non_interactive:
+            print("Press enter to stop JavaScript execution.")
+
+    do_c = do_continue
+
+    def do_step(self, args):
+        """ Next breakpoint, step into functions """
+        self.exec_command(args, JERRY_DEBUGGER_STEP)
+        self.cont = True
+
+    do_s = do_step
+
+    def do_next(self, args):
+        """ Next breakpoint in the same context """
+        self.exec_command(args, JERRY_DEBUGGER_NEXT)
+        self.cont = True
+
+    do_n = do_next
+
+    def do_list(self, args):
+        """ Lists the available breakpoints """
+        if self.debugger.active_breakpoint_list:
+            print("=== %sActive breakpoints %s ===" % (self.debugger.green_bg, self.debugger.nocolor))
+            for breakpoint in self.debugger.active_breakpoint_list.values():
+                print(" %d: %s" % (breakpoint.active_index, breakpoint))
+
+        if self.debugger.pending_breakpoint_list:
+            print("=== %sPending breakpoints%s ===" % (self.debugger.yellow_bg, self.debugger.nocolor))
+            for breakpoint in self.debugger.pending_breakpoint_list.values():
+                print(" %d: %s (pending)" % (breakpoint.index, breakpoint))
+
+        if not self.debugger.active_breakpoint_list and not self.debugger.pending_breakpoint_list:
+            print("No breakpoints")
+
+    def do_delete(self, args):
+        """ Delete the given breakpoint, use 'delete all|active|pending' to clear all the given breakpoints """
+        if not args:
+            print("Error: Breakpoint index expected")
+            return
+        elif args == "all":
+            self.debugger.delete_active()
+            self.debugger.delete_pending()
+        elif args == "pending":
+            self.debugger.delete_pending()
+        elif args == "active":
+            self.debugger.delete_active()
+        else:
+            try:
+                breakpoint_index = int(args)
+            except ValueError as val_errno:
+                print("Error: Integer number expected, %s" % (val_errno))
+                return
+
+            if breakpoint_index in self.debugger.active_breakpoint_list:
+                breakpoint = self.debugger.active_breakpoint_list[breakpoint_index]
+                del self.debugger.active_breakpoint_list[breakpoint_index]
+                breakpoint.active_index = -1
+                self.debugger.send_breakpoint(breakpoint)
+            elif breakpoint_index in self.debugger.pending_breakpoint_list:
+                del self.debugger.pending_breakpoint_list[breakpoint_index]
+            else:
+                print("Error: Breakpoint %d not found" % (breakpoint_index))
+
+    def exec_backtrace(self, args):
+        max_depth = 0
+
+        if args:
+            try:
+                max_depth = int(args)
+                if max_depth <= 0:
+                    print("Error: Positive integer number expected")
+                    return
+            except ValueError as val_errno:
+                print("Error: Positive integer number expected, %s" % (val_errno))
+                return
+
+        message = struct.pack(self.debugger.byte_order + "BBIB" + self.debugger.idx_format,
+                              WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
+                              WEBSOCKET_FIN_BIT + 1 + 4,
+                              0,
+                              JERRY_DEBUGGER_GET_BACKTRACE,
+                              max_depth)
+        self.debugger.send_message(message)
+        self.stop = True
+
+    def do_backtrace(self, args):
+        """ Get backtrace data from debugger """
+        self.exec_backtrace(args)
+
+    do_bt = do_backtrace
+
+    def do_src(self, args):
+        """ Get current source code """
+        if args:
+            line_num = src_check_args(args)
+            if line_num >= 0:
+                print_source(self.debugger, line_num)
+            elif line_num == 0:
+                print_source(self.debugger, self.debugger.default_viewrange)
+            else:
+                return
+
+    do_source = do_src
+
+    def do_display(self, args):
+        """ Toggle source code display after breakpoints """
+        if args:
+            line_num = src_check_args(args)
+            if line_num >= 0:
+                self.debugger.display = line_num
+            else:
+                return
+
+        else:
+            print("Non-negative integer number expected, 0 turns off this function")
+            return
+
+    def do_dump(self, args):
+        """ Dump all of the debugger data """
+        if self.disable_args(args):
+            return
+
+        pprint(self.debugger.function_list)
+
+    def eval_string(self, args):
+        size = len(args)
+        if size == 0:
+            return
+
+        # 1: length of type byte
+        # 4: length of an uint32 value
+        message_header = 1 + 4
+        max_fragment = min(self.debugger.max_message_size - message_header, size)
+
+        message = struct.pack(self.debugger.byte_order + "BBIBI",
+                              WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
+                              WEBSOCKET_FIN_BIT + max_fragment + message_header,
+                              0,
+                              JERRY_DEBUGGER_EVAL,
+                              size)
+
+        if size == max_fragment:
+            self.debugger.send_message(message + args)
+            self.stop = True
+            return
+
+        self.debugger.send_message(message + args[0:max_fragment])
+        offset = max_fragment
+
+        # 1: length of type byte
+        message_header = 1
+
+        max_fragment = self.debugger.max_message_size - message_header
+        while offset < size:
+            next_fragment = min(max_fragment, size - offset)
+
+            message = struct.pack(self.debugger.byte_order + "BBIB",
+                                  WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
+                                  WEBSOCKET_FIN_BIT + next_fragment + message_header,
+                                  0,
+                                  JERRY_DEBUGGER_EVAL_PART)
+
+            prev_offset = offset
+            offset += next_fragment
+            self.debugger.send_message(message + args[prev_offset:offset])
+
+        self.stop = True
+
+    def do_eval(self, args):
+        """ Evaluate JavaScript source code """
+        self.eval_string(args)
+
+    do_e = do_eval
+
+    def do_exception(self, args):
+        """ Config the exception handler module """
+        if not args:
+            print("Error: Status expected!")
+            return
+
+        enable = int(args)
+
+        if enable == 1:
+            logging.debug("Stop at exception enabled")
+        elif enable == 0:
+            logging.debug("Stop at exception disabled")
+        else:
+            print("Error: Invalid input! Usage 1: [Enable] or 0: [Disable].")
+            return
+
+        self.debugger.send_exception_config(enable)
+
+    def do_memstats(self, args):
+        """ Memory statistics """
+        self.exec_command(args, JERRY_DEBUGGER_MEMSTATS)
+        return
+
+    do_ms = do_memstats
+
+class Multimap(object):
+
+    def __init__(self):
+        self.map = {}
+
+    def get(self, key):
+        if key in self.map:
+            return self.map[key]
+        return []
+
+    def insert(self, key, value):
+        if key in self.map:
+            self.map[key].append(value)
+        else:
+            self.map[key] = [value]
+
+    def delete(self, key, value):
+        items = self.map[key]
+
+        if len(items) == 1:
+            del self.map[key]
+        else:
+            del items[items.index(value)]
+
+    def __repr__(self):
+        return "Multimap(%r)" % (self.map)
+
+
+class JerryDebugger(object):
+
+    def __init__(self, address):
+
+        if ":" not in address:
+            self.host = address
+            self.port = 5001  # use default port
+        else:
+            self.host, self.port = address.split(":")
+            self.port = int(self.port)
+
+        print("Connecting to: %s:%s" % (self.host, self.port))
+
+        self.message_data = b""
+        self.function_list = {}
+        self.last_breakpoint_hit = None
+        self.next_breakpoint_index = 0
+        self.active_breakpoint_list = {}
+        self.pending_breakpoint_list = {}
+        self.line_list = Multimap()
+        self.display = 0
+        self.default_viewrange = 3
+        self.green = ''
+        self.red = ''
+        self.yellow = ''
+        self.green_bg = ''
+        self.yellow_bg = ''
+        self.nocolor = ''
+        self.client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        self.client_socket.connect((self.host, self.port))
+
+        self.send_message(b"GET /jerry-debugger HTTP/1.1\r\n" +
+                          b"Upgrade: websocket\r\n" +
+                          b"Connection: Upgrade\r\n" +
+                          b"Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n\r\n")
+        result = b""
+        expected = (b"HTTP/1.1 101 Switching Protocols\r\n" +
+                    b"Upgrade: websocket\r\n" +
+                    b"Connection: Upgrade\r\n" +
+                    b"Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\n\r\n")
+
+        len_expected = len(expected)
+
+        while len(result) < len_expected:
+            result += self.client_socket.recv(1024)
+
+        len_result = len(result)
+
+        if result[0:len_expected] != expected:
+            raise Exception("Unexpected handshake")
+
+        if len_result > len_expected:
+            result = result[len_expected:]
+        else:
+            result = b""
+
+        len_expected = 6
+        # Network configurations, which has the following struct:
+        # header [2] - opcode[1], size[1]
+        # type [1]
+        # max_message_size [1]
+        # cpointer_size [1]
+        # little_endian [1]
+
+        while len(result) < len_expected:
+            result += self.client_socket.recv(1024)
+
+        len_result = len(result)
+
+        expected = struct.pack("BBB",
+                               WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
+                               4,
+                               JERRY_DEBUGGER_CONFIGURATION)
+
+        if result[0:3] != expected:
+            raise Exception("Unexpected configuration")
+
+        self.max_message_size = ord(result[3])
+        self.cp_size = ord(result[4])
+        self.little_endian = ord(result[5])
+
+        if self.little_endian:
+            self.byte_order = "<"
+            logging.debug("Little-endian machine")
+        else:
+            self.byte_order = ">"
+            logging.debug("Big-endian machine")
+
+        if self.cp_size == 2:
+            self.cp_format = "H"
+        else:
+            self.cp_format = "I"
+
+        self.idx_format = "I"
+
+        logging.debug("Compressed pointer size: %d", self.cp_size)
+
+        if len_result > len_expected:
+            self.message_data = result[len_expected:]
+
+    def __del__(self):
+        self.client_socket.close()
+
+    def send_message(self, message):
+        size = len(message)
+        while size > 0:
+            bytes_send = self.client_socket.send(message)
+            if bytes_send < size:
+                message = message[bytes_send:]
+            size -= bytes_send
+
+    def delete_active(self):
+        for i in self.active_breakpoint_list.values():
+            breakpoint = self.active_breakpoint_list[i.active_index]
+            del self.active_breakpoint_list[i.active_index]
+            breakpoint.active_index = -1
+            self.send_breakpoint(breakpoint)
+
+    def delete_pending(self):
+        self.pending_breakpoint_list.clear()
+
+    def breakpoint_pending_exists(self, breakpoint):
+        for existing_bp in self.pending_breakpoint_list.values():
+            if (breakpoint.line and existing_bp.source_name == breakpoint.source_name and \
+                  existing_bp.line == breakpoint.line) \
+               or (not breakpoint.line and existing_bp.function == breakpoint.function):
+                return True
+
+        return False
+
+    def send_breakpoint(self, breakpoint):
+        message = struct.pack(self.byte_order + "BBIBB" + self.cp_format + self.idx_format,
+                              WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
+                              WEBSOCKET_FIN_BIT + 1 + 1 + self.cp_size + 4,
+                              0,
+                              JERRY_DEBUGGER_UPDATE_BREAKPOINT,
+                              int(breakpoint.active_index >= 0),
+                              breakpoint.function.byte_code_cp,
+                              breakpoint.offset)
+        self.send_message(message)
+
+    def send_bytecode_cp(self, byte_code_cp):
+        message = struct.pack(self.byte_order + "BBIB" + self.cp_format,
+                              WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
+                              WEBSOCKET_FIN_BIT + 1 + self.cp_size,
+                              0,
+                              JERRY_DEBUGGER_FREE_BYTE_CODE_CP,
+                              byte_code_cp)
+        self.send_message(message)
+
+    def send_command(self, command):
+        message = struct.pack(self.byte_order + "BBIB",
+                              WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
+                              WEBSOCKET_FIN_BIT + 1,
+                              0,
+                              command)
+        self.send_message(message)
+
+    def send_exception_config(self, enable):
+        message = struct.pack(self.byte_order + "BBIBB",
+                              WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT,
+                              WEBSOCKET_FIN_BIT + 1 + 1,
+                              0,
+                              JERRY_DEBUGGER_EXCEPTION_CONFIG,
+                              enable)
+        self.send_message(message)
+
+    def set_colors(self):
+        self.green = '\033[92m'
+        self.nocolor = '\033[0m'
+        self.red = '\033[31m'
+        self.yellow = '\033[93m'
+        self.green_bg = '\033[42m'
+        self.yellow_bg = '\033[43m'
+
+    def get_message(self, blocking):
+        # Connection was closed
+        if self.message_data is None:
+            return None
+
+        while True:
+            if len(self.message_data) >= 2:
+                if ord(self.message_data[0]) != WEBSOCKET_BINARY_FRAME | WEBSOCKET_FIN_BIT:
+                    raise Exception("Unexpected data frame")
+
+                size = ord(self.message_data[1])
+                if size == 0 or size >= 126:
+                    raise Exception("Unexpected data frame")
+
+                if len(self.message_data) >= size + 2:
+                    result = self.message_data[0:size + 2]
+                    self.message_data = self.message_data[size + 2:]
+                    return result
+
+            if not blocking:
+                select_result = select.select([self.client_socket], [], [], 0)[0]
+                if self.client_socket not in select_result:
+                    return b''
+
+            data = self.client_socket.recv(MAX_BUFFER_SIZE)
+
+            if not data:
+                self.message_data = None
+                return None
+
+            self.message_data += data
+
+
+def parse_source(debugger, data):
+    source_code = ""
+    source_code_name = ""
+    function_name = ""
+    stack = [{"line": 1,
+              "column": 1,
+              "name": "",
+              "lines": [],
+              "offsets": []}]
+    new_function_list = {}
+
+    while True:
+        if data is None:
+            return
+
+        buffer_type = ord(data[2])
+        buffer_size = ord(data[1]) - 1
+
+        logging.debug("Parser buffer type: %d, message size: %d", buffer_type, buffer_size)
+
+        if buffer_type == JERRY_DEBUGGER_PARSE_ERROR:
+            logging.error("Parser error!")
+            return
+
+        elif buffer_type in [JERRY_DEBUGGER_SOURCE_CODE, JERRY_DEBUGGER_SOURCE_CODE_END]:
+            source_code += data[3:]
+
+        elif buffer_type in [JERRY_DEBUGGER_SOURCE_CODE_NAME, JERRY_DEBUGGER_SOURCE_CODE_NAME_END]:
+            source_code_name += data[3:]
+
+        elif buffer_type in [JERRY_DEBUGGER_FUNCTION_NAME, JERRY_DEBUGGER_FUNCTION_NAME_END]:
+            function_name += data[3:]
+
+        elif buffer_type == JERRY_DEBUGGER_PARSE_FUNCTION:
+            logging.debug("Source name: %s, function name: %s", source_code_name, function_name)
+
+            position = struct.unpack(debugger.byte_order + debugger.idx_format + debugger.idx_format,
+                                     data[3: 3 + 4 + 4])
+
+            stack.append({"source": source_code,
+                          "source_name": source_code_name,
+                          "line": position[0],
+                          "column": position[1],
+                          "name": function_name,
+                          "lines": [],
+                          "offsets": []})
+            function_name = ""
+
+        elif buffer_type in [JERRY_DEBUGGER_BREAKPOINT_LIST, JERRY_DEBUGGER_BREAKPOINT_OFFSET_LIST]:
+            name = "lines"
+            if buffer_type == JERRY_DEBUGGER_BREAKPOINT_OFFSET_LIST:
+                name = "offsets"
+
+            logging.debug("Breakpoint %s received", name)
+
+            buffer_pos = 3
+            while buffer_size > 0:
+                line = struct.unpack(debugger.byte_order + debugger.idx_format,
+                                     data[buffer_pos: buffer_pos + 4])
+                stack[-1][name].append(line[0])
+                buffer_pos += 4
+                buffer_size -= 4
+
+        elif buffer_type == JERRY_DEBUGGER_BYTE_CODE_CP:
+            byte_code_cp = struct.unpack(debugger.byte_order + debugger.cp_format,
+                                         data[3: 3 + debugger.cp_size])[0]
+
+            logging.debug("Byte code cptr received: {0x%x}", byte_code_cp)
+
+            func_desc = stack.pop()
+
+            # We know the last item in the list is the general byte code.
+            if len(stack) == 0:
+                func_desc["source"] = source_code
+                func_desc["source_name"] = source_code_name
+
+            function = JerryFunction(len(stack) != 0,
+                                     byte_code_cp,
+                                     func_desc["source"],
+                                     func_desc["source_name"],
+                                     func_desc["line"],
+                                     func_desc["column"],
+                                     func_desc["name"],
+                                     func_desc["lines"],
+                                     func_desc["offsets"])
+
+            new_function_list[byte_code_cp] = function
+
+            if len(stack) == 0:
+                logging.debug("Parse completed.")
+                break
+
+        elif buffer_type == JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP:
+            # Redefined functions are dropped during parsing.
+            byte_code_cp = struct.unpack(debugger.byte_order + debugger.cp_format,
+                                         data[3: 3 + debugger.cp_size])[0]
+
+            if byte_code_cp in new_function_list:
+                del new_function_list[byte_code_cp]
+                debugger.send_bytecode_cp(byte_code_cp)
+            else:
+                release_function(debugger, data)
+
+        else:
+            logging.error("Parser error!")
+            return
+
+        data = debugger.get_message(True)
+
+    # Copy the ready list to the global storage.
+    debugger.function_list.update(new_function_list)
+
+    for function in new_function_list.values():
+        for line, breakpoint in function.lines.items():
+            debugger.line_list.insert(line, breakpoint)
+
+    # Try to set the pending breakpoints
+    if len(debugger.pending_breakpoint_list) != 0:
+        logging.debug("Pending breakpoints list: %s", debugger.pending_breakpoint_list)
+
+        for breakpoint in debugger.pending_breakpoint_list:
+            if debugger.pending_breakpoint_list[breakpoint].line:
+                breakpoint = debugger.pending_breakpoint_list[breakpoint].source_name + ":" \
+                             + str(debugger.pending_breakpoint_list[breakpoint].line)
+            else:
+                breakpoint = debugger.pending_breakpoint_list[breakpoint].function
+            set_breakpoint(debugger, breakpoint)
+    else:
+        logging.debug("No pending breakpoints")
+
+
+def src_check_args(args):
+    try:
+        line_num = int(args)
+        if line_num < 0:
+            print("Error: Non-negative integer number expected")
+            return -1
+
+        return line_num
+    except ValueError as val_errno:
+        print("Error: Non-negative integer number expected: %s" % (val_errno))
+        return -1
+
+
+def print_source(debugger, line_num):
+    last_bp = debugger.last_breakpoint_hit
+    if not last_bp:
+        return
+
+    lines = last_bp.function.source
+    if last_bp.function.source_name:
+        print("Source: %s" % (last_bp.function.source_name))
+
+    if line_num == 0:
+        start = 0
+        end = len(last_bp.function.source) - 1
+    else:
+        start = max(last_bp.line - line_num, 0)
+        end = min(last_bp.line + line_num-1, len(last_bp.function.source)-1)
+
+    for i in range(start, end):
+        if i == last_bp.line - 1:
+            print("%s%4d%s %s>%s %s" % (debugger.green, i + 1, debugger.nocolor, debugger.red, \
+                                        debugger.nocolor, lines[i]))
+        else:
+            print("%s%4d%s   %s" % (debugger.green, i + 1, debugger.nocolor, lines[i]))
+
+
+def release_function(debugger, data):
+    byte_code_cp = struct.unpack(debugger.byte_order + debugger.cp_format,
+                                 data[3: 3 + debugger.cp_size])[0]
+
+    function = debugger.function_list[byte_code_cp]
+
+    for line, breakpoint in function.lines.items():
+        debugger.line_list.delete(line, breakpoint)
+        if breakpoint.active_index >= 0:
+            del debugger.active_breakpoint_list[breakpoint.active_index]
+
+    del debugger.function_list[byte_code_cp]
+
+    debugger.send_bytecode_cp(byte_code_cp)
+
+    logging.debug("Function {0x%x} byte-code released", byte_code_cp)
+
+
+def enable_breakpoint(debugger, breakpoint):
+    if isinstance(breakpoint, JerryPendingBreakpoint):
+        if not debugger.breakpoint_pending_exists(breakpoint):
+            debugger.next_breakpoint_index += 1
+            breakpoint.index = debugger.next_breakpoint_index
+            debugger.pending_breakpoint_list[debugger.next_breakpoint_index] = breakpoint
+            print("%sPending breakpoint%s at %s" % (debugger.yellow, debugger.nocolor, breakpoint))
+        else:
+            print("%sPending breakpoint%s already exists" % (debugger.yellow, debugger.nocolor))
+
+    else:
+        if breakpoint.active_index < 0:
+            debugger.next_breakpoint_index += 1
+            debugger.active_breakpoint_list[debugger.next_breakpoint_index] = breakpoint
+            breakpoint.active_index = debugger.next_breakpoint_index
+            debugger.send_breakpoint(breakpoint)
+
+        print("%sBreakpoint %d %sat %s" % (debugger.green, breakpoint.active_index, debugger.nocolor, breakpoint))
+
+
+def set_breakpoint(debugger, string):
+    line = re.match("(.*):(\\d+)$", string)
+    found = False
+
+    if line:
+        source_name = line.group(1)
+        new_line = int(line.group(2))
+
+        for breakpoint in debugger.line_list.get(new_line):
+            func_source = breakpoint.function.source_name
+            if (source_name == func_source or
+                    func_source.endswith("/" + source_name) or
+                    func_source.endswith("\\" + source_name)):
+
+                enable_breakpoint(debugger, breakpoint)
+                found = True
+
+    else:
+        for function in debugger.function_list.values():
+            if function.name == string:
+                enable_breakpoint(debugger, function.lines[function.first_breakpoint_line])
+                found = True
+
+    if not found:
+        print("No breakpoint found, do you want to add a %spending breakpoint%s? (y or [n])" % \
+             (debugger.yellow, debugger.nocolor))
+        ans = sys.stdin.readline()
+        if ans in ['yes\n', 'y\n']:
+            if line:
+                breakpoint = JerryPendingBreakpoint(int(line.group(2)), line.group(1))
+            else:
+                breakpoint = JerryPendingBreakpoint(function=string)
+            enable_breakpoint(debugger, breakpoint)
+
+    return
+
+
+def get_breakpoint(debugger, breakpoint_data):
+    function = debugger.function_list[breakpoint_data[0]]
+    offset = breakpoint_data[1]
+
+    if offset in function.offsets:
+        return (function.offsets[offset], True)
+
+    if offset < function.first_breakpoint_offset:
+        return (function.offsets[function.first_breakpoint_offset], False)
+
+    nearest_offset = -1
+
+    for current_offset in function.offsets:
+        if current_offset <= offset and current_offset > nearest_offset:
+            nearest_offset = current_offset
+
+    return (function.offsets[nearest_offset], False)
+
+
+def main():
+    args = arguments_parse()
+
+    debugger = JerryDebugger(args.address)
+    exception_string = ""
+
+    if args.color:
+        debugger.set_colors()
+
+    non_interactive = args.non_interactive
+
+    logging.debug("Connected to JerryScript on %d port", debugger.port)
+
+    prompt = DebuggerPrompt(debugger)
+    prompt.prompt = "(jerry-debugger) "
+    prompt.non_interactive = non_interactive
+
+    if args.display:
+        prompt.do_display(args.display)
+
+    if args.exception is not None:
+        prompt.do_exception(str(args.exception))
+
+    while True:
+        if not non_interactive and prompt.cont:
+            if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
+                sys.stdin.readline()
+                prompt.cont = False
+                debugger.send_command(JERRY_DEBUGGER_STOP)
+
+        data = debugger.get_message(False)
+
+        if data == b'':
+            continue
+
+        if not data:  # Break the while loop if there is no more data.
+            break
+
+        buffer_type = ord(data[2])
+        buffer_size = ord(data[1]) - 1
+
+        logging.debug("Main buffer type: %d, message size: %d", buffer_type, buffer_size)
+
+        if buffer_type in [JERRY_DEBUGGER_PARSE_ERROR,
+                           JERRY_DEBUGGER_BYTE_CODE_CP,
+                           JERRY_DEBUGGER_PARSE_FUNCTION,
+                           JERRY_DEBUGGER_BREAKPOINT_LIST,
+                           JERRY_DEBUGGER_SOURCE_CODE,
+                           JERRY_DEBUGGER_SOURCE_CODE_END,
+                           JERRY_DEBUGGER_SOURCE_CODE_NAME,
+                           JERRY_DEBUGGER_SOURCE_CODE_NAME_END,
+                           JERRY_DEBUGGER_FUNCTION_NAME,
+                           JERRY_DEBUGGER_FUNCTION_NAME_END]:
+            parse_source(debugger, data)
+
+        elif buffer_type == JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP:
+            release_function(debugger, data)
+
+        elif buffer_type in [JERRY_DEBUGGER_BREAKPOINT_HIT, JERRY_DEBUGGER_EXCEPTION_HIT]:
+            breakpoint_data = struct.unpack(debugger.byte_order + debugger.cp_format + debugger.idx_format, data[3:])
+
+            breakpoint = get_breakpoint(debugger, breakpoint_data)
+            debugger.last_breakpoint_hit = breakpoint[0]
+
+            if buffer_type == JERRY_DEBUGGER_EXCEPTION_HIT:
+                print("Exception throw detected (to disable automatic stop type exception 0)")
+                if exception_string:
+                    print("Exception hint: %s" % (exception_string))
+                    exception_string = ""
+
+            if breakpoint[1]:
+                breakpoint_info = "at"
+            else:
+                breakpoint_info = "around"
+
+            if breakpoint[0].active_index >= 0:
+                breakpoint_info += " breakpoint:%s%d%s" % (debugger.red, breakpoint[0].active_index, debugger.nocolor)
+
+            print("Stopped %s %s" % (breakpoint_info, breakpoint[0]))
+            if debugger.display:
+                print_source(prompt.debugger, debugger.display)
+
+            prompt.cmdloop()
+            if prompt.quit:
+                break
+
+        elif buffer_type == JERRY_DEBUGGER_EXCEPTION_STR:
+            exception_string += data[3:]
+
+        elif buffer_type == JERRY_DEBUGGER_EXCEPTION_STR_END:
+            exception_string += data[3:]
+
+        elif buffer_type in [JERRY_DEBUGGER_BACKTRACE, JERRY_DEBUGGER_BACKTRACE_END]:
+            frame_index = 0
+
+            while True:
+
+                buffer_pos = 3
+                while buffer_size > 0:
+                    breakpoint_data = struct.unpack(debugger.byte_order + debugger.cp_format + debugger.idx_format,
+                                                    data[buffer_pos: buffer_pos + debugger.cp_size + 4])
+
+                    breakpoint = get_breakpoint(debugger, breakpoint_data)
+
+                    print("Frame %d: %s" % (frame_index, breakpoint[0]))
+
+                    frame_index += 1
+                    buffer_pos += 6
+                    buffer_size -= 6
+
+                if buffer_type == JERRY_DEBUGGER_BACKTRACE_END:
+                    break
+
+                data = debugger.get_message(True)
+                buffer_type = ord(data[2])
+                buffer_size = ord(data[1]) - 1
+
+                if buffer_type not in [JERRY_DEBUGGER_BACKTRACE,
+                                       JERRY_DEBUGGER_BACKTRACE_END]:
+                    raise Exception("Backtrace data expected")
+
+            prompt.cmdloop()
+
+        elif buffer_type in [JERRY_DEBUGGER_EVAL_RESULT,
+                             JERRY_DEBUGGER_EVAL_RESULT_END,
+                             JERRY_DEBUGGER_EVAL_ERROR,
+                             JERRY_DEBUGGER_EVAL_ERROR_END]:
+
+            message = b""
+            eval_type = buffer_type
+            while True:
+                message += data[3:]
+
+                if buffer_type in [JERRY_DEBUGGER_EVAL_RESULT_END,
+                                   JERRY_DEBUGGER_EVAL_ERROR_END]:
+                    break
+
+                data = debugger.get_message(True)
+                buffer_type = ord(data[2])
+                buffer_size = ord(data[1]) - 1
+
+                if buffer_type not in [eval_type,
+                                       eval_type + 1]:
+                    raise Exception("Eval result expected")
+
+            if buffer_type == JERRY_DEBUGGER_EVAL_ERROR_END:
+                print("Uncaught exception: %s" % (message))
+            else:
+                print(message)
+
+            prompt.cmdloop()
+
+        elif buffer_type == JERRY_DEBUGGER_MEMSTATS_RECEIVE:
+
+            memory_stats = struct.unpack(debugger.byte_order + debugger.idx_format *5,
+                                         data[3: 3 + 4 *5])
+
+            print("Allocated bytes: %d" % (memory_stats[0]))
+            print("Byte code bytes: %d" % (memory_stats[1]))
+            print("String bytes: %d" % (memory_stats[2]))
+            print("Object bytes: %d" % (memory_stats[3]))
+            print("Property bytes: %d" % (memory_stats[4]))
+
+            prompt.cmdloop()
+
+        else:
+            raise Exception("Unknown message")
+
+
+if __name__ == "__main__":
+    try:
+        main()
+    except socket.error as error_msg:
+        try:
+            errno = error_msg.errno
+            msg = str(error_msg)
+        except:
+            errno = error_msg[0]
+            msg = error_msg[1]
+
+        if errno == 111:
+            sys.exit("Failed to connect to the JerryScript debugger.")
+        elif errno == 32 or errno == 104:
+            sys.exit("Connection closed.")
+        else:
+            sys.exit("Failed to connect to the JerryScript debugger.\nError: %s" % (msg))
diff --git a/deps/jerry/jerry-ext/CMakeLists.txt b/deps/jerry/jerry-ext/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ade3153
--- /dev/null
@@ -0,0 +1,39 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+set(JERRY_EXT_NAME jerry-ext)
+project (${JERRY_EXT_NAME} C)
+
+# Include directories
+set(INCLUDE_EXT "${CMAKE_CURRENT_SOURCE_DIR}/include")
+
+# Source directories
+file(GLOB SOURCE_EXT_ARG      arg/*.c)
+file(GLOB SOURCE_EXT_MODULE   module/*.c)
+file(GLOB SOURCE_EXT_HANDLER  handler/*.c)
+
+set(SOURCE_EXT
+    ${SOURCE_EXT_ARG}
+    ${SOURCE_EXT_MODULE}
+    ${SOURCE_EXT_HANDLER})
+
+add_library(${JERRY_EXT_NAME} STATIC ${SOURCE_EXT})
+
+target_include_directories(${JERRY_EXT_NAME} PUBLIC ${INCLUDE_EXT})
+
+target_link_libraries(${JERRY_EXT_NAME} jerry-core)
+
+install(TARGETS ${JERRY_EXT_NAME} DESTINATION lib)
+install(DIRECTORY ${INCLUDE_EXT}/ DESTINATION include)
diff --git a/deps/jerry/jerry-ext/arg/arg-internal.h b/deps/jerry/jerry-ext/arg/arg-internal.h
new file mode 100644 (file)
index 0000000..3f9c4fe
--- /dev/null
@@ -0,0 +1,31 @@
+/* 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.
+ */
+
+#ifndef JERRYX_ARG_INTERNAL_H
+#define JERRYX_ARG_INTERNAL_H
+
+#include "jerryscript.h"
+
+/**
+ * The iterator structor for JS arguments.
+ */
+struct jerryx_arg_js_iterator_t
+{
+  const jerry_value_t *js_arg_p; /**< the JS arguments */
+  const jerry_length_t js_arg_cnt; /**< the total num of JS arguments */
+  jerry_length_t js_arg_idx; /**< current index of JS argument */
+};
+
+#endif /* !JERRYX_ARG_INTERNAL_H */
diff --git a/deps/jerry/jerry-ext/arg/arg-js-iterator-helper.c b/deps/jerry/jerry-ext/arg/arg-js-iterator-helper.c
new file mode 100644 (file)
index 0000000..7267a68
--- /dev/null
@@ -0,0 +1,58 @@
+/* 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.
+ */
+
+#include "arg-internal.h"
+#include "jerryscript-ext/arg.h"
+#include "jerryscript.h"
+
+/**
+ * Pop the current JS argument from the iterator.
+ * It will change the index and js_arg_p value in the iterator.
+ *
+ * @return the current JS argument.
+ */
+jerry_value_t
+jerryx_arg_js_iterator_pop (jerryx_arg_js_iterator_t *js_arg_iter_p) /**< the JS arg iterator */
+{
+  return (js_arg_iter_p->js_arg_idx++ < js_arg_iter_p->js_arg_cnt ? *js_arg_iter_p->js_arg_p++
+                                                                  : jerry_create_undefined ());
+} /* jerryx_arg_js_iterator_pop */
+
+/**
+ * Get the current JS argument from the iterator.
+ *
+ * Note:
+ *     Unlike jerryx_arg_js_iterator_pop, it will not change index and
+ *     js_arg_p value in the iterator.
+ *
+ * @return the current JS argument.
+ */
+jerry_value_t
+jerryx_arg_js_iterator_peek (jerryx_arg_js_iterator_t *js_arg_iter_p) /**< the JS arg iterator */
+{
+  return (js_arg_iter_p->js_arg_idx < js_arg_iter_p->js_arg_cnt ? *js_arg_iter_p->js_arg_p
+                                                                : jerry_create_undefined ());
+} /* jerryx_arg_js_iterator_peek */
+
+/**
+ * Get the index of the current JS argument
+ *
+ * @return the index
+ */
+jerry_length_t
+jerryx_arg_js_iterator_index (jerryx_arg_js_iterator_t *js_arg_iter_p) /**< the JS arg iterator */
+{
+  return js_arg_iter_p->js_arg_idx;
+} /* jerryx_arg_js_iterator_index */
diff --git a/deps/jerry/jerry-ext/arg/arg-transform-functions.c b/deps/jerry/jerry-ext/arg/arg-transform-functions.c
new file mode 100644 (file)
index 0000000..43257cd
--- /dev/null
@@ -0,0 +1,450 @@
+/* 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.
+ */
+
+#include <math.h>
+
+#include "jerryscript-ext/arg.h"
+#include "jerryscript.h"
+
+/**
+ * The common function to deal with optional arguments.
+ * The core transform function is provided by argument `func`.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+jerry_value_t
+jerryx_arg_transform_optional (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                               const jerryx_arg_t *c_arg_p, /**< native arg */
+                               jerryx_arg_transform_func_t func) /**< the core transform function */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_peek (js_arg_iter_p);
+
+  if (jerry_value_is_undefined (js_arg))
+  {
+    return js_arg;
+  }
+
+  return func (js_arg_iter_p, c_arg_p);
+} /* jerryx_arg_transform_optional */
+
+/**
+ * The common part in transforming a JS argument to a number (double or certain int) type.
+ * Type coercion is not allowed.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+static jerry_value_t
+jerryx_arg_transform_number_strict_common (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                                           double *number_p) /**< [out] the number in JS arg */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_pop (js_arg_iter_p);
+
+  if (!jerry_value_is_number (js_arg))
+  {
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "It is not a number.");
+  }
+
+  *number_p = jerry_get_number_value (js_arg);
+
+  return jerry_create_undefined ();
+} /* jerryx_arg_transform_number_strict_common */
+
+/**
+ * The common part in transforming a JS argument to a number (double or certain int) type.
+ * Type coercion is allowed.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+static jerry_value_t
+jerryx_arg_transform_number_common (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                                    double *number_p) /**< [out] the number in JS arg */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_pop (js_arg_iter_p);
+
+  jerry_value_t to_number = jerry_value_to_number (js_arg);
+
+  if (jerry_value_has_error_flag (to_number))
+  {
+    jerry_release_value (to_number);
+
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "It can not be converted to a number.");
+  }
+
+  *number_p = jerry_get_number_value (to_number);
+  jerry_release_value (to_number);
+
+  return jerry_create_undefined ();
+} /* jerryx_arg_transform_number_common */
+
+/**
+ * Transform a JS argument to a double. Type coercion is not allowed.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+jerry_value_t
+jerryx_arg_transform_number_strict (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                                    const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  return jerryx_arg_transform_number_strict_common (js_arg_iter_p, c_arg_p->dest);
+} /* jerryx_arg_transform_number_strict */
+
+/**
+ * Tranform a JS argument to a double. Type coercion is allowed.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+jerry_value_t
+jerryx_arg_transform_number (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                             const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  return jerryx_arg_transform_number_common (js_arg_iter_p, c_arg_p->dest);
+} /* jerryx_arg_transform_number */
+
+/**
+ * Helper function to process a double number before converting it
+ * to an integer.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+static jerry_value_t
+jerryx_arg_helper_process_double (double *d, /**< [in, out] the number to be processed */
+                                  double min, /**< the min value for clamping */
+                                  double max, /**< the max value for clamping */
+                                  jerryx_arg_int_option_t option) /**< the converting policies */
+{
+  if (option.clamp == JERRYX_ARG_NO_CLAMP)
+  {
+    if (*d > max || *d < min)
+    {
+      return jerry_create_error (JERRY_ERROR_TYPE,
+                                 (jerry_char_t *) "The number is out of range.");
+    }
+  }
+  else
+  {
+    *d = *d < min ? min : *d;
+    *d = *d > max ? max : *d;
+  }
+
+  if (option.round == JERRYX_ARG_ROUND)
+  {
+    *d = (*d >= 0.0) ? floor (*d + 0.5) : ceil (*d - 0.5);
+  }
+  else if (option.round == JERRYX_ARG_FLOOR)
+  {
+    *d = floor (*d);
+  }
+  else
+  {
+    *d = ceil (*d);
+  }
+
+  return jerry_create_undefined ();
+} /* jerryx_arg_helper_process_double */
+
+/**
+ * Use the macro to define thr transform functions for int type.
+ */
+#define JERRYX_ARG_TRANSFORM_FUNC_FOR_INT_TEMPLATE(type, suffix, min, max) \
+  jerry_value_t jerryx_arg_transform_ ## type ## suffix (jerryx_arg_js_iterator_t *js_arg_iter_p, \
+                                                         const jerryx_arg_t *c_arg_p) \
+  { \
+    double tmp = 0.0; \
+    jerry_value_t rv = jerryx_arg_transform_number ## suffix ## _common (js_arg_iter_p, &tmp); \
+    if (jerry_value_has_error_flag (rv)) \
+    { \
+      return rv; \
+    } \
+    jerry_release_value (rv); \
+    jerryx_arg_int_option_t *options_p = (jerryx_arg_int_option_t *) &c_arg_p->extra_info; \
+    rv = jerryx_arg_helper_process_double (&tmp, min, max, *options_p); \
+    if (jerry_value_has_error_flag (rv)) \
+    { \
+      return rv; \
+    } \
+    *(type ## _t *) c_arg_p->dest = (type ## _t) tmp; \
+    return rv; \
+  }
+
+#define JERRYX_ARG_TRANSFORM_FUNC_FOR_INT(type, min, max) \
+  JERRYX_ARG_TRANSFORM_FUNC_FOR_INT_TEMPLATE (type, _strict, min, max) \
+  JERRYX_ARG_TRANSFORM_FUNC_FOR_INT_TEMPLATE (type, , min, max)
+
+JERRYX_ARG_TRANSFORM_FUNC_FOR_INT (uint8, 0, UINT8_MAX)
+JERRYX_ARG_TRANSFORM_FUNC_FOR_INT (int8, INT8_MIN, INT8_MAX)
+JERRYX_ARG_TRANSFORM_FUNC_FOR_INT (uint16, 0, UINT16_MAX)
+JERRYX_ARG_TRANSFORM_FUNC_FOR_INT (int16, INT16_MIN, INT16_MAX)
+JERRYX_ARG_TRANSFORM_FUNC_FOR_INT (uint32, 0, UINT32_MAX)
+JERRYX_ARG_TRANSFORM_FUNC_FOR_INT (int32, INT32_MIN, INT32_MAX)
+
+#undef JERRYX_ARG_TRANSFORM_FUNC_FOR_INT_TEMPLATE
+#undef JERRYX_ARG_TRANSFORM_FUNC_FOR_INT
+/**
+ * Tranform a JS argument to a boolean. Type coercion is not allowed.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+jerry_value_t
+jerryx_arg_transform_boolean_strict (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                                     const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_pop (js_arg_iter_p);
+
+  if (!jerry_value_is_boolean (js_arg))
+  {
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "It is not a boolean.");
+  }
+
+  bool *dest = c_arg_p->dest;
+  *dest = jerry_get_boolean_value (js_arg);
+
+  return jerry_create_undefined ();
+} /* jerryx_arg_transform_boolean_strict */
+
+/**
+ * Tranform a JS argument to a boolean. Type coercion is allowed.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+jerry_value_t
+jerryx_arg_transform_boolean (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                              const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_pop (js_arg_iter_p);
+
+  bool to_boolean = jerry_value_to_boolean (js_arg);
+
+  bool *dest = c_arg_p->dest;
+  *dest = to_boolean;
+
+  return jerry_create_undefined ();
+} /* jerryx_arg_transform_boolean */
+
+/**
+ * The common routine for string transformer.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+static jerry_value_t
+jerryx_arg_string_common_routine (jerry_value_t js_arg, /**< JS arg */
+                                  const jerryx_arg_t *c_arg_p) /**< native arg */
+{
+  jerry_char_t *target_p = (jerry_char_t *) c_arg_p->dest;
+  jerry_size_t target_buf_size = (jerry_size_t) c_arg_p->extra_info;
+  jerry_size_t size = jerry_string_to_char_buffer (js_arg,
+                                                   target_p,
+                                                   target_buf_size);
+
+  if ((size == target_buf_size) || (size == 0 && jerry_get_string_length (js_arg) != 0))
+  {
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "Buffer size is not large enough.");
+  }
+
+  target_p[size] = '\0';
+
+  return jerry_create_undefined ();
+} /* jerryx_arg_string_common_routine */
+
+/**
+ * Tranform a JS argument to a char array. Type coercion is not allowed.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+jerry_value_t
+jerryx_arg_transform_string_strict (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                                    const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_pop (js_arg_iter_p);
+
+  if (!jerry_value_is_string (js_arg))
+  {
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "It is not a string.");
+  }
+
+  return jerryx_arg_string_common_routine (js_arg, c_arg_p);
+} /* jerryx_arg_transform_string_strict */
+
+/**
+ * Tranform a JS argument to a char array. Type coercion is allowed.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+jerry_value_t
+jerryx_arg_transform_string (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                             const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_pop (js_arg_iter_p);
+
+  jerry_value_t to_string = jerry_value_to_string (js_arg);
+
+  if (jerry_value_has_error_flag (to_string))
+  {
+    jerry_release_value (to_string);
+
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "It can not be converted to a string.");
+  }
+
+  jerry_value_t ret = jerryx_arg_string_common_routine (to_string, c_arg_p);
+  jerry_release_value (to_string);
+
+  return ret;
+} /* jerryx_arg_transform_string */
+
+/**
+ * Check whether the JS argument is jerry function, if so, assign to the native argument.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+jerry_value_t
+jerryx_arg_transform_function (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                               const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_pop (js_arg_iter_p);
+
+  if (!jerry_value_is_function (js_arg))
+  {
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "It is not a function.");
+  }
+
+  jerry_value_t *func_p = c_arg_p->dest;
+  *func_p = jerry_acquire_value (js_arg);
+
+  return jerry_create_undefined ();
+} /* jerryx_arg_transform_function */
+
+/**
+ * Check whether the native pointer has the expected type info.
+ * If so, assign it to the native argument.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+jerry_value_t
+jerryx_arg_transform_native_pointer (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                                     const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_pop (js_arg_iter_p);
+
+  if (!jerry_value_is_object (js_arg))
+  {
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "It is not an object.");
+  }
+
+  const jerry_object_native_info_t *expected_info_p;
+  const jerry_object_native_info_t *out_info_p;
+  expected_info_p = (const jerry_object_native_info_t *) c_arg_p->extra_info;
+  void **ptr_p = (void **) c_arg_p->dest;
+  bool is_ok = jerry_get_object_native_pointer (js_arg, ptr_p, &out_info_p);
+
+  if (!is_ok || out_info_p != expected_info_p)
+  {
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "The object has no native pointer or type does not match.");
+  }
+
+  return jerry_create_undefined ();
+} /* jerryx_arg_transform_native_pointer */
+
+/**
+ * Check whether the JS object's properties have expected types, and transform them into native args.
+ *
+ * @return jerry undefined: the transformer passes,
+ *         jerry error: the transformer fails.
+ */
+jerry_value_t
+jerryx_arg_transform_object_props (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                                   const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_pop (js_arg_iter_p);
+
+  const jerryx_arg_object_props_t *object_props = (const jerryx_arg_object_props_t *) c_arg_p->extra_info;
+
+  return jerryx_arg_transform_object_properties (js_arg,
+                                                 object_props->name_p,
+                                                 object_props->name_cnt,
+                                                 object_props->c_arg_p,
+                                                 object_props->c_arg_cnt);
+} /* jerryx_arg_transform_object_props */
+
+/**
+ * Define transformer for optional argument.
+ */
+#define JERRYX_ARG_TRANSFORM_OPTIONAL(type) \
+  jerry_value_t \
+  jerryx_arg_transform_ ## type ## _optional (jerryx_arg_js_iterator_t *js_arg_iter_p, \
+                                              const jerryx_arg_t *c_arg_p) \
+  { \
+    return jerryx_arg_transform_optional (js_arg_iter_p, c_arg_p, jerryx_arg_transform_ ## type); \
+  }
+
+JERRYX_ARG_TRANSFORM_OPTIONAL (number)
+JERRYX_ARG_TRANSFORM_OPTIONAL (number_strict)
+JERRYX_ARG_TRANSFORM_OPTIONAL (boolean)
+JERRYX_ARG_TRANSFORM_OPTIONAL (boolean_strict)
+JERRYX_ARG_TRANSFORM_OPTIONAL (string)
+JERRYX_ARG_TRANSFORM_OPTIONAL (string_strict)
+JERRYX_ARG_TRANSFORM_OPTIONAL (function)
+JERRYX_ARG_TRANSFORM_OPTIONAL (native_pointer)
+JERRYX_ARG_TRANSFORM_OPTIONAL (object_props)
+
+JERRYX_ARG_TRANSFORM_OPTIONAL (uint8)
+JERRYX_ARG_TRANSFORM_OPTIONAL (uint16)
+JERRYX_ARG_TRANSFORM_OPTIONAL (uint32)
+JERRYX_ARG_TRANSFORM_OPTIONAL (int8)
+JERRYX_ARG_TRANSFORM_OPTIONAL (int16)
+JERRYX_ARG_TRANSFORM_OPTIONAL (int32)
+JERRYX_ARG_TRANSFORM_OPTIONAL (int8_strict)
+JERRYX_ARG_TRANSFORM_OPTIONAL (int16_strict)
+JERRYX_ARG_TRANSFORM_OPTIONAL (int32_strict)
+JERRYX_ARG_TRANSFORM_OPTIONAL (uint8_strict)
+JERRYX_ARG_TRANSFORM_OPTIONAL (uint16_strict)
+JERRYX_ARG_TRANSFORM_OPTIONAL (uint32_strict)
+
+#undef JERRYX_ARG_TRANSFORM_OPTIONAL
+
+/**
+ * Ignore the JS argument.
+ *
+ * @return jerry undefined
+ */
+jerry_value_t
+jerryx_arg_transform_ignore (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                             const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  (void) js_arg_iter_p; /* unused */
+  (void) c_arg_p; /* unused */
+
+  return jerry_create_undefined ();
+} /* jerryx_arg_transform_ignore */
diff --git a/deps/jerry/jerry-ext/arg/arg.c b/deps/jerry/jerry-ext/arg/arg.c
new file mode 100644 (file)
index 0000000..9c932e1
--- /dev/null
@@ -0,0 +1,145 @@
+/* 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.
+ */
+
+#include "arg-internal.h"
+#include "jerryscript-ext/arg.h"
+#include "jerryscript.h"
+
+
+#define JERRYX_STATIC_ASSERT(x, msg) \
+  enum { static_assertion_failed_ ## msg = 1 / (!!(x)) }
+
+JERRYX_STATIC_ASSERT (sizeof (jerryx_arg_int_option_t) <= sizeof (((jerryx_arg_t *) 0)->extra_info),
+                      jerryx_arg_number_options_t_must_fit_into_extra_info);
+
+#undef JERRYX_STATIC_ASSERT
+
+/**
+ * Validate the JS arguments and assign them to the native arguments.
+ *
+ * @return jerry undefined: all validators passed,
+ *         jerry error: a validator failed.
+ */
+jerry_value_t
+jerryx_arg_transform_args (const jerry_value_t *js_arg_p, /**< points to the array with JS arguments */
+                           const jerry_length_t js_arg_cnt, /**< the count of the `js_arg_p` array */
+                           const jerryx_arg_t *c_arg_p, /**< points to the array of validation/transformation steps */
+                           jerry_length_t c_arg_cnt) /**< the count of the `c_arg_p` array */
+{
+  jerry_value_t ret = jerry_create_undefined ();
+
+  jerryx_arg_js_iterator_t iterator =
+  {
+    .js_arg_p = js_arg_p,
+    .js_arg_cnt = js_arg_cnt,
+    .js_arg_idx = 0
+  };
+
+  for (; c_arg_cnt != 0 && !jerry_value_has_error_flag (ret); c_arg_cnt--, c_arg_p++)
+  {
+    ret = c_arg_p->func (&iterator, c_arg_p);
+  }
+
+  return ret;
+} /* jerryx_arg_transform_args */
+
+/**
+ * Validate the this value and the JS arguments,
+ * and assign them to the native arguments.
+ * This function is useful to perform input validation inside external
+ * function handlers (see jerry_external_handler_t).
+ * @note this_val is processed as the first value, before the array of arguments.
+ *
+ * @return jerry undefined: all validators passed,
+ *         jerry error: a validator failed.
+ */
+jerry_value_t
+jerryx_arg_transform_this_and_args (const jerry_value_t this_val, /**< the this_val for the external function */
+                                    const jerry_value_t *js_arg_p, /**< points to the array with JS arguments */
+                                    const jerry_length_t js_arg_cnt, /**< the count of the `js_arg_p` array */
+                                    const jerryx_arg_t *c_arg_p, /**< points to the array of transformation steps */
+                                    jerry_length_t c_arg_cnt) /**< the count of the `c_arg_p` array */
+{
+  if (c_arg_cnt == 0)
+  {
+    return jerry_create_undefined ();
+  }
+
+  jerryx_arg_js_iterator_t iterator =
+  {
+    .js_arg_p = &this_val,
+    .js_arg_cnt = 1,
+    .js_arg_idx = 0
+  };
+
+  jerry_value_t ret = c_arg_p->func (&iterator, c_arg_p);
+
+  if (jerry_value_has_error_flag (ret))
+  {
+    jerry_release_value (ret);
+
+    return jerry_create_error (JERRY_ERROR_TYPE, (jerry_char_t *) "'this' validation failed.");
+  }
+
+  return jerryx_arg_transform_args (js_arg_p, js_arg_cnt, c_arg_p + 1, c_arg_cnt - 1);
+} /* jerryx_arg_transform_this_and_args */
+
+/**
+ * Validate the `obj_val`'s properties,
+ * and assign them to the native arguments.
+ *
+ * @return jerry undefined: all validators passed,
+ *         jerry error: a validator failed.
+ */
+jerry_value_t
+jerryx_arg_transform_object_properties (const jerry_value_t obj_val,/**< the JS object */
+                                        const jerry_char_t **name_p, /**< property name list of the JS object */
+                                        const jerry_length_t name_cnt, /**< count of the name list */
+                                        const jerryx_arg_t *c_arg_p, /**< points to the array of transformation steps */
+                                        jerry_length_t c_arg_cnt) /**< the count of the `c_arg_p` array */
+{
+  if (!jerry_value_is_object (obj_val))
+  {
+    return jerry_create_error (JERRY_ERROR_TYPE, (jerry_char_t *) "Not an object.");
+  }
+
+  jerry_value_t prop[name_cnt];
+
+  for (jerry_length_t i = 0; i < name_cnt; i++, name_p++)
+  {
+    const jerry_value_t name_str = jerry_create_string (*name_p);
+    prop[i] = jerry_get_property (obj_val, name_str);
+    jerry_release_value (name_str);
+
+    if (jerry_value_has_error_flag (prop[i]))
+    {
+      for (jerry_length_t j = 0; j < i; j++)
+      {
+        jerry_release_value (prop[j]);
+      }
+
+      return prop[i];
+    }
+  }
+
+  const jerry_value_t ret = jerryx_arg_transform_args (prop, name_cnt, c_arg_p, c_arg_cnt);
+
+  for (jerry_length_t i = 0; i < name_cnt; i++)
+  {
+    jerry_release_value (prop[i]);
+  }
+
+  return ret;
+} /* jerryx_arg_transform_object_properties */
diff --git a/deps/jerry/jerry-ext/handler/handler-assert.c b/deps/jerry/jerry-ext/handler/handler-assert.c
new file mode 100644 (file)
index 0000000..75254ab
--- /dev/null
@@ -0,0 +1,45 @@
+/* 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.
+ */
+
+#include "jerryscript-ext/handler.h"
+#include "jerryscript-port.h"
+
+/**
+ * Assert for scripts. The routine calls jerry_port_fatal on assertion failure.
+ *
+ * @return true - if only one argument was passed and that argument was a boolean true.
+ *         Note that the function does not return otherwise.
+ */
+jerry_value_t
+jerryx_handler_assert (const jerry_value_t func_obj_val, /**< function object */
+                       const jerry_value_t this_p, /**< this arg */
+                       const jerry_value_t args_p[], /**< function arguments */
+                       const jerry_length_t args_cnt) /**< number of function arguments */
+{
+  (void) func_obj_val; /* unused */
+  (void) this_p; /* unused */
+
+  if (args_cnt == 1
+      && jerry_value_is_boolean (args_p[0])
+      && jerry_get_boolean_value (args_p[0]))
+  {
+    return jerry_create_boolean (true);
+  }
+  else
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Script Error: assertion failed\n");
+    jerry_port_fatal (ERR_FAILED_INTERNAL_ASSERTION);
+  }
+} /* jerryx_handler_assert */
diff --git a/deps/jerry/jerry-ext/handler/handler-gc.c b/deps/jerry/jerry-ext/handler/handler-gc.c
new file mode 100644 (file)
index 0000000..65adbad
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+#include "jerryscript-ext/handler.h"
+
+/**
+ * Expose garbage collector to scripts.
+ *
+ * @return undefined.
+ */
+jerry_value_t
+jerryx_handler_gc (const jerry_value_t func_obj_val, /**< function object */
+                   const jerry_value_t this_p, /**< this arg */
+                   const jerry_value_t args_p[], /**< function arguments */
+                   const jerry_length_t args_cnt) /**< number of function arguments */
+{
+  (void) func_obj_val; /* unused */
+  (void) this_p; /* unused */
+  (void) args_p; /* unused */
+  (void) args_cnt; /* unused */
+
+  jerry_gc ();
+  return jerry_create_undefined ();
+} /* jerryx_handler_gc */
diff --git a/deps/jerry/jerry-ext/handler/handler-print.c b/deps/jerry/jerry-ext/handler/handler-print.c
new file mode 100644 (file)
index 0000000..1f198f3
--- /dev/null
@@ -0,0 +1,103 @@
+/* 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.
+ */
+
+#include "jerryscript-ext/handler.h"
+
+/**
+ * Provide a 'print' implementation for scripts.
+ *
+ * The routine converts all of its arguments to strings and outputs them
+ * char-by-char using jerryx_port_handler_print_char.
+ *
+ * The NUL character is output as "\u0000", other characters are output
+ * bytewise.
+ *
+ * Note:
+ *      This implementation does not use standard C `printf` to print its
+ *      output. This allows more flexibility but also extends the core
+ *      JerryScript engine port API. Applications that want to use
+ *      `jerryx_handler_print` must ensure that their port implementation also
+ *      provides `jerryx_port_handler_print_char`.
+ *
+ * @return undefined - if all arguments could be converted to strings,
+ *         error - otherwise.
+ */
+jerry_value_t
+jerryx_handler_print (const jerry_value_t func_obj_val, /**< function object */
+                      const jerry_value_t this_p, /**< this arg */
+                      const jerry_value_t args_p[], /**< function arguments */
+                      const jerry_length_t args_cnt) /**< number of function arguments */
+{
+  (void) func_obj_val; /* unused */
+  (void) this_p; /* unused */
+
+  static const char *null_str = "\\u0000";
+
+  jerry_value_t ret_val = jerry_create_undefined ();
+
+  for (jerry_length_t arg_index = 0;
+       jerry_value_is_undefined (ret_val) && arg_index < args_cnt;
+       arg_index++)
+  {
+    jerry_value_t str_val = jerry_value_to_string (args_p[arg_index]);
+
+    if (!jerry_value_has_error_flag (str_val))
+    {
+      if (arg_index != 0)
+      {
+        jerryx_port_handler_print_char (' ');
+      }
+
+      jerry_size_t substr_size;
+      jerry_length_t substr_pos = 0;
+      jerry_char_t substr_buf[256];
+
+      while ((substr_size = jerry_substring_to_char_buffer (str_val,
+                                                            substr_pos,
+                                                            substr_pos + 256,
+                                                            substr_buf,
+                                                            256)) != 0)
+      {
+        for (jerry_size_t chr_index = 0; chr_index < substr_size; chr_index++)
+        {
+          char chr = (char) substr_buf[chr_index];
+          if (chr == '\0')
+          {
+            for (jerry_size_t null_index = 0; null_str[null_index] != 0; null_index++)
+            {
+              jerryx_port_handler_print_char (null_str[null_index]);
+            }
+          }
+          else
+          {
+            jerryx_port_handler_print_char (chr);
+          }
+        }
+
+        substr_pos += substr_size;
+      }
+
+      jerry_release_value (str_val);
+    }
+    else
+    {
+      ret_val = str_val;
+    }
+  }
+
+  jerryx_port_handler_print_char ('\n');
+
+  return ret_val;
+} /* jerryx_handler_print */
diff --git a/deps/jerry/jerry-ext/handler/handler-register.c b/deps/jerry/jerry-ext/handler/handler-register.c
new file mode 100644 (file)
index 0000000..f30d8f0
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+#include "jerryscript-ext/handler.h"
+
+/**
+ * Register a JavaScript function in the global object.
+ *
+ * Note:
+ *      returned value must be freed with jerry_release_value, when it is no longer needed.
+ *
+ * @return true value - if the operation was successful,
+ *         error - otherwise.
+ */
+jerry_value_t
+jerryx_handler_register_global (const jerry_char_t *name_p, /**< name of the function */
+                                jerry_external_handler_t handler_p) /**< function callback */
+{
+  jerry_value_t global_obj_val = jerry_get_global_object ();
+  jerry_value_t function_name_val = jerry_create_string (name_p);
+  jerry_value_t function_val = jerry_create_external_function (handler_p);
+
+  jerry_value_t result_val = jerry_set_property (global_obj_val, function_name_val, function_val);
+
+  jerry_release_value (function_val);
+  jerry_release_value (function_name_val);
+  jerry_release_value (global_obj_val);
+
+  return result_val;
+} /* jerryx_handler_register_global */
diff --git a/deps/jerry/jerry-ext/include/jerryscript-ext/arg.h b/deps/jerry/jerry-ext/include/jerryscript-ext/arg.h
new file mode 100644 (file)
index 0000000..03424c3
--- /dev/null
@@ -0,0 +1,181 @@
+/* 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.
+ */
+
+#ifndef JERRYX_ARG_H
+#define JERRYX_ARG_H
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include "jerryscript.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/**
+ * The forward declaration of jerryx_arg_t.
+ */
+typedef struct jerryx_arg_t jerryx_arg_t;
+
+/**
+ * The forward declaration of jerryx_arg_js_iterator_t
+ */
+typedef struct jerryx_arg_js_iterator_t jerryx_arg_js_iterator_t;
+
+/**
+ * Signature of the transform function.
+ */
+typedef jerry_value_t (*jerryx_arg_transform_func_t) (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                                                      const jerryx_arg_t *c_arg_p); /**< native arg */
+
+/**
+ * The structure used in jerryx_arg_object_properties
+ */
+typedef struct
+{
+  const jerry_char_t **name_p; /**< property name list of the JS object */
+  jerry_length_t name_cnt; /**< count of the name list */
+  const jerryx_arg_t *c_arg_p; /**< points to the array of transformation steps */
+  jerry_length_t c_arg_cnt; /**< the count of the `c_arg_p` array */
+} jerryx_arg_object_props_t;
+
+/**
+ * The structure defining a single validation & transformation step.
+ */
+struct jerryx_arg_t
+{
+  jerryx_arg_transform_func_t func; /**< the transform function */
+  void *dest; /**< pointer to destination where func should store the result */
+  uintptr_t extra_info; /**< extra information, specific to func */
+};
+
+jerry_value_t jerryx_arg_transform_this_and_args (const jerry_value_t this_val,
+                                                  const jerry_value_t *js_arg_p,
+                                                  const jerry_length_t js_arg_cnt,
+                                                  const jerryx_arg_t *c_arg_p,
+                                                  jerry_length_t c_arg_cnt);
+
+jerry_value_t jerryx_arg_transform_args (const jerry_value_t *js_arg_p,
+                                         const jerry_length_t js_arg_cnt,
+                                         const jerryx_arg_t *c_arg_p,
+                                         jerry_length_t c_arg_cnt);
+
+jerry_value_t jerryx_arg_transform_object_properties (const jerry_value_t obj_val,
+                                                      const jerry_char_t **name_p,
+                                                      const jerry_length_t name_cnt,
+                                                      const jerryx_arg_t *c_arg_p,
+                                                      jerry_length_t c_arg_cnt);
+
+/**
+ * Indicates whether an argument is allowed to be coerced into the expected JS type.
+ */
+typedef enum
+{
+  JERRYX_ARG_COERCE, /**< the transform inside will invoke toNumber, toBoolean or toString */
+  JERRYX_ARG_NO_COERCE /**< the type coercion is not allowed. */
+} jerryx_arg_coerce_t;
+
+/**
+ * Indicates whether an argument is optional or required.
+ */
+typedef enum
+{
+  /**
+   * The argument is optional. If the argument is `undefined` the transform is
+   * successful and `c_arg_p->dest` remains untouched.
+   */
+  JERRYX_ARG_OPTIONAL,
+  /**
+   * The argument is required. If the argument is `undefined` the transform
+   * will fail and `c_arg_p->dest` remains untouched.
+   */
+  JERRYX_ARG_REQUIRED
+} jerryx_arg_optional_t;
+
+/**
+ * Indicates the rounding policy which will be chosen to transform an integer.
+ */
+typedef enum
+{
+  JERRYX_ARG_ROUND, /**< round */
+  JERRYX_ARG_FLOOR, /**< floor */
+  JERRYX_ARG_CEIL /**< ceil */
+} jerryx_arg_round_t;
+
+/**
+ * Indicates the clamping policy which will be chosen to transform an integer.
+ * If the policy is NO_CLAMP, and the number is out of range,
+ * then the transformer will throw a range error.
+ */
+typedef enum
+{
+  JERRYX_ARG_CLAMP,/**< clamp the number when it is out of range */
+  JERRYX_ARG_NO_CLAMP /**< throw a range error */
+} jerryx_arg_clamp_t;
+
+/* Inline functions for initializing jerryx_arg_t */
+
+#define JERRYX_ARG_INTEGER(type) \
+  static inline jerryx_arg_t \
+  jerryx_arg_ ## type (type ## _t *dest, \
+                       jerryx_arg_round_t round_flag, \
+                       jerryx_arg_clamp_t clamp_flag, \
+                       jerryx_arg_coerce_t coerce_flag, \
+                       jerryx_arg_optional_t opt_flag);
+
+JERRYX_ARG_INTEGER (uint8)
+JERRYX_ARG_INTEGER (int8)
+JERRYX_ARG_INTEGER (uint16)
+JERRYX_ARG_INTEGER (int16)
+JERRYX_ARG_INTEGER (uint32)
+JERRYX_ARG_INTEGER (int32)
+
+#undef JERRYX_ARG_INTEGER
+
+static inline jerryx_arg_t
+jerryx_arg_number (double *dest, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag);
+static inline jerryx_arg_t
+jerryx_arg_boolean (bool *dest, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag);
+static inline jerryx_arg_t
+jerryx_arg_string (char *dest, uint32_t size, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag);
+static inline jerryx_arg_t
+jerryx_arg_function (jerry_value_t *dest, jerryx_arg_optional_t opt_flag);
+static inline jerryx_arg_t
+jerryx_arg_native_pointer (void **dest, const jerry_object_native_info_t *info_p, jerryx_arg_optional_t opt_flag);
+static inline jerryx_arg_t
+jerryx_arg_ignore (void);
+static inline jerryx_arg_t
+jerryx_arg_custom (void *dest, uintptr_t extra_info, jerryx_arg_transform_func_t func);
+static inline jerryx_arg_t
+jerryx_arg_object_properties (const jerryx_arg_object_props_t *object_props_p, jerryx_arg_optional_t opt_flag);
+
+jerry_value_t
+jerryx_arg_transform_optional (jerryx_arg_js_iterator_t *js_arg_iter_p,
+                               const jerryx_arg_t *c_arg_p,
+                               jerryx_arg_transform_func_t func);
+
+/* Helper functions for transform functions. */
+jerry_value_t jerryx_arg_js_iterator_pop (jerryx_arg_js_iterator_t *js_arg_iter_p);
+jerry_value_t jerryx_arg_js_iterator_peek (jerryx_arg_js_iterator_t *js_arg_iter_p);
+jerry_length_t jerryx_arg_js_iterator_index (jerryx_arg_js_iterator_t *js_arg_iter_p);
+
+#include "arg.impl.h"
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRYX_ARG_H */
diff --git a/deps/jerry/jerry-ext/include/jerryscript-ext/arg.impl.h b/deps/jerry/jerry-ext/include/jerryscript-ext/arg.impl.h
new file mode 100644 (file)
index 0000000..874ed0f
--- /dev/null
@@ -0,0 +1,364 @@
+/* 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.
+ */
+
+#ifndef JERRYX_ARG_IMPL_H
+#define JERRYX_ARG_IMPL_H
+
+/* transform functions for each type. */
+
+#define JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL(type) \
+  jerry_value_t jerryx_arg_transform_ ## type (jerryx_arg_js_iterator_t *js_arg_iter_p, \
+                                               const jerryx_arg_t *c_arg_p); \
+  jerry_value_t jerryx_arg_transform_ ## type ## _optional (jerryx_arg_js_iterator_t *js_arg_iter_p, \
+                                                            const jerryx_arg_t *c_arg_p);
+
+#define JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT(type) \
+  JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (type) \
+  JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (type ## _strict)
+
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (uint8)
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (int8)
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (uint16)
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (int16)
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (uint32)
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (int32)
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (number)
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (string)
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (boolean)
+
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (function)
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (native_pointer)
+JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (object_props)
+
+jerry_value_t jerryx_arg_transform_ignore (jerryx_arg_js_iterator_t *js_arg_iter_p,
+                                           const jerryx_arg_t *c_arg_p);
+
+#undef JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL
+#undef JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT
+
+/**
+ * The structure indicates the options used to transform integer argument.
+ * It will be passed into jerryx_arg_t's  extra_info field.
+ */
+typedef struct
+{
+  uint8_t round; /**< rounding policy */
+  uint8_t clamp; /**< clamping policy */
+} jerryx_arg_int_option_t;
+
+/**
+ * The macro used to generate jerryx_arg_xxx for int type.
+ */
+#define JERRYX_ARG_INT(type) \
+  static inline jerryx_arg_t \
+  jerryx_arg_ ## type (type ## _t *dest, \
+                       jerryx_arg_round_t round_flag, \
+                       jerryx_arg_clamp_t clamp_flag, \
+                       jerryx_arg_coerce_t coerce_flag, \
+                       jerryx_arg_optional_t opt_flag) \
+  { \
+    jerryx_arg_transform_func_t func; \
+    if (coerce_flag == JERRYX_ARG_NO_COERCE) \
+    { \
+      if (opt_flag == JERRYX_ARG_OPTIONAL) \
+      { \
+        func = jerryx_arg_transform_ ## type ## _strict_optional; \
+      } \
+      else \
+      { \
+        func = jerryx_arg_transform_ ## type ## _strict; \
+      } \
+    } \
+    else \
+    { \
+      if (opt_flag == JERRYX_ARG_OPTIONAL) \
+      { \
+        func = jerryx_arg_transform_ ## type ## _optional; \
+      } \
+      else \
+      { \
+        func = jerryx_arg_transform_ ## type; \
+      } \
+    } \
+    const jerryx_arg_int_option_t int_option = { .round = round_flag, .clamp = clamp_flag }; \
+    return (jerryx_arg_t) \
+    { \
+      .func = func, \
+      .dest = (void *) dest, \
+      .extra_info = *(uintptr_t *) &int_option \
+    }; \
+  }
+
+JERRYX_ARG_INT (uint8)
+JERRYX_ARG_INT (int8)
+JERRYX_ARG_INT (uint16)
+JERRYX_ARG_INT (int16)
+JERRYX_ARG_INT (uint32)
+JERRYX_ARG_INT (int32)
+
+#undef JERRYX_ARG_INT
+
+/**
+ * Create a validation/transformation step (`jerryx_arg_t`) that expects to
+ * consume one `number` JS argument and stores it into a C `double`.
+ *
+ * @return a jerryx_arg_t instance.
+ */
+static inline jerryx_arg_t
+jerryx_arg_number (double *dest, /**< pointer to the double where the result should be stored */
+                   jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */
+                   jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */
+{
+  jerryx_arg_transform_func_t func;
+
+  if (coerce_flag == JERRYX_ARG_NO_COERCE)
+  {
+    if (opt_flag == JERRYX_ARG_OPTIONAL)
+    {
+      func = jerryx_arg_transform_number_strict_optional;
+    }
+    else
+    {
+      func = jerryx_arg_transform_number_strict;
+    }
+  }
+  else
+  {
+    if (opt_flag == JERRYX_ARG_OPTIONAL)
+    {
+      func = jerryx_arg_transform_number_optional;
+    }
+    else
+    {
+      func = jerryx_arg_transform_number;
+    }
+  }
+
+  return (jerryx_arg_t)
+  {
+    .func = func,
+    .dest = (void *) dest
+  };
+} /* jerryx_arg_number */
+
+/**
+ * Create a validation/transformation step (`jerryx_arg_t`) that expects to
+ * consume one `boolean` JS argument and stores it into a C `bool`.
+ *
+ * @return a jerryx_arg_t instance.
+ */
+static inline jerryx_arg_t
+jerryx_arg_boolean (bool *dest, /**< points to the native bool */
+                    jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */
+                    jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */
+{
+  jerryx_arg_transform_func_t func;
+
+  if (coerce_flag == JERRYX_ARG_NO_COERCE)
+  {
+    if (opt_flag == JERRYX_ARG_OPTIONAL)
+    {
+      func = jerryx_arg_transform_boolean_strict_optional;
+    }
+    else
+    {
+      func = jerryx_arg_transform_boolean_strict;
+    }
+  }
+  else
+  {
+    if (opt_flag == JERRYX_ARG_OPTIONAL)
+    {
+      func = jerryx_arg_transform_boolean_optional;
+    }
+    else
+    {
+      func = jerryx_arg_transform_boolean;
+    }
+  }
+
+  return (jerryx_arg_t)
+  {
+    .func = func,
+    .dest = (void *) dest
+  };
+} /* jerryx_arg_boolean */
+
+/**
+ * Create a validation/transformation step (`jerryx_arg_t`) that expects to
+ * consume one `string` JS argument and stores it into a C `char` array.
+ *
+ * @return a jerryx_arg_t instance.
+ */
+static inline jerryx_arg_t
+jerryx_arg_string (char *dest, /**< pointer to the native char array where the result should be stored */
+                   uint32_t size, /**< the size of native char array */
+                   jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */
+                   jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */
+{
+  jerryx_arg_transform_func_t func;
+
+  if (coerce_flag == JERRYX_ARG_NO_COERCE)
+  {
+    if (opt_flag == JERRYX_ARG_OPTIONAL)
+    {
+      func = jerryx_arg_transform_string_strict_optional;
+    }
+    else
+    {
+      func = jerryx_arg_transform_string_strict;
+    }
+  }
+  else
+  {
+    if (opt_flag == JERRYX_ARG_OPTIONAL)
+    {
+      func = jerryx_arg_transform_string_optional;
+    }
+    else
+    {
+      func = jerryx_arg_transform_string;
+    }
+  }
+
+  return (jerryx_arg_t)
+  {
+    .func = func,
+    .dest = (void *) dest,
+    .extra_info = (uintptr_t) size
+  };
+} /* jerryx_arg_string */
+
+/**
+ * Create a validation/transformation step (`jerryx_arg_t`) that expects to
+ * consume one `function` JS argument and stores it into a C `jerry_value_t`.
+ *
+ * @return a jerryx_arg_t instance.
+ */
+static inline jerryx_arg_t
+jerryx_arg_function (jerry_value_t *dest, /**< pointer to the jerry_value_t where the result should be stored */
+                     jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */
+{
+  jerryx_arg_transform_func_t func;
+
+  if (opt_flag == JERRYX_ARG_OPTIONAL)
+  {
+    func = jerryx_arg_transform_function_optional;
+  }
+  else
+  {
+    func = jerryx_arg_transform_function;
+  }
+
+  return (jerryx_arg_t)
+  {
+    .func = func,
+    .dest = (void *) dest
+  };
+} /* jerryx_arg_function */
+
+/**
+ * Create a validation/transformation step (`jerryx_arg_t`) that expects to
+ * consume one `object` JS argument that is 'backed' with a native pointer with
+ * a given type info. In case the native pointer info matches, the transform
+ * will succeed and the object's native pointer will be assigned to *dest.
+ *
+ * @return a jerryx_arg_t instance.
+ */
+static inline jerryx_arg_t
+jerryx_arg_native_pointer (void **dest, /**< pointer to where the resulting native pointer should be stored */
+                           const jerry_object_native_info_t *info_p, /**< expected the type info */
+                           jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */
+{
+  jerryx_arg_transform_func_t func;
+
+  if (opt_flag == JERRYX_ARG_OPTIONAL)
+  {
+    func = jerryx_arg_transform_native_pointer_optional;
+  }
+  else
+  {
+    func = jerryx_arg_transform_native_pointer;
+  }
+
+  return (jerryx_arg_t)
+  {
+    .func = func,
+    .dest = (void *) dest,
+    .extra_info = (uintptr_t) info_p
+  };
+} /* jerryx_arg_native_pointer */
+
+/**
+ * Create a jerryx_arg_t instance for ignored argument.
+ *
+ * @return a jerryx_arg_t instance.
+ */
+static inline jerryx_arg_t
+jerryx_arg_ignore (void)
+{
+  return (jerryx_arg_t)
+  {
+    .func = jerryx_arg_transform_ignore
+  };
+} /* jerryx_arg_ignore */
+
+/**
+ * Create a jerryx_arg_t instance with custom transform.
+ *
+ * @return a jerryx_arg_t instance.
+ */
+static inline jerryx_arg_t
+jerryx_arg_custom (void *dest, /**< pointer to the native argument where the result should be stored */
+                   uintptr_t extra_info, /**< the extra parameter, specific to the transform function */
+                   jerryx_arg_transform_func_t func) /**< the custom transform function */
+{
+  return (jerryx_arg_t)
+  {
+    .func = func,
+    .dest = dest,
+    .extra_info = extra_info
+  };
+} /* jerryx_arg_custom */
+
+/**
+ * Create a jerryx_arg_t instance for object properties.
+ *
+ * @return a jerryx_arg_t instance.
+ */
+static inline jerryx_arg_t
+jerryx_arg_object_properties (const jerryx_arg_object_props_t *object_props, /**< pointer to object property mapping */
+                              jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */
+{
+  jerryx_arg_transform_func_t func;
+
+  if (opt_flag == JERRYX_ARG_OPTIONAL)
+  {
+    func = jerryx_arg_transform_object_props_optional;
+  }
+  else
+  {
+    func = jerryx_arg_transform_object_props;
+  }
+
+  return (jerryx_arg_t)
+  {
+    .func = func,
+    .dest = NULL,
+    .extra_info = (uintptr_t) object_props
+  };
+} /* jerryx_arg_object_properties */
+
+#endif /* !JERRYX_ARG_IMPL_H */
diff --git a/deps/jerry/jerry-ext/include/jerryscript-ext/autorelease.h b/deps/jerry/jerry-ext/include/jerryscript-ext/autorelease.h
new file mode 100644 (file)
index 0000000..f7cf7de
--- /dev/null
@@ -0,0 +1,54 @@
+/* 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.
+ */
+
+#ifndef JERRYX_AUTORELEASE_H
+#define JERRYX_AUTORELEASE_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "autorelease.impl.h"
+
+/*
+ * Macro for `const jerry_value_t` for which jerry_release_value () is
+ * automatically called when the variable goes out of scope.
+ *
+ * Example usage:
+ * static void foo (bool enable)
+ * {
+ *   JERRYX_AR_VALUE_T bar = jerry_create_string (...);
+ *
+ *   if (enable) {
+ *     JERRYX_AR_VALUE_T baz = jerry_get_global_object ();
+ *
+ *     // ...
+ *
+ *     // jerry_release_value (baz) and jerry_release_value (bar) is called automatically before
+ *     // returning, because `baz` and `bar` go out of scope.
+ *     return;
+ *   }
+ *
+ *   // jerry_release_value (bar) is called automatically when the function returns,
+ *   // because `bar` goes out of scope.
+ * }
+ */
+#define JERRYX_AR_VALUE_T __JERRYX_AR_VALUE_T_IMPL
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRYX_AUTORELEASE_H */
diff --git a/deps/jerry/jerry-ext/include/jerryscript-ext/autorelease.impl.h b/deps/jerry/jerry-ext/include/jerryscript-ext/autorelease.impl.h
new file mode 100644 (file)
index 0000000..558b170
--- /dev/null
@@ -0,0 +1,40 @@
+/* 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.
+ */
+
+#ifndef JERRYX_AUTORELEASE_IMPL_H
+#define JERRYX_AUTORELEASE_IMPL_H
+
+#include "jerryscript.h"
+
+#ifdef __GNUC__
+/*
+ * Calls jerry_release_value (*value).
+ * The GCC __cleanup__ function must take a pointer to the variable to clean up.
+ *
+ * @return void
+ */
+static inline void
+jerryx_autorelease_cleanup (const jerry_value_t *value) /**< jerry value */
+{
+  jerry_release_value (*value);
+} /* jerryx_autorelease_cleanup */
+
+#define __JERRYX_AR_VALUE_T_IMPL const jerry_value_t __attribute__ ((__cleanup__(jerryx_autorelease_cleanup)))
+#else /* !__GNUC__ */
+/* TODO: for other compilers */
+#error "No autorelease implementation for your compiler!"
+#endif /* __GNUC__ */
+
+#endif /* !JERRYX_AUTORELEASE_IMPL_H */
diff --git a/deps/jerry/jerry-ext/include/jerryscript-ext/handler.h b/deps/jerry/jerry-ext/include/jerryscript-ext/handler.h
new file mode 100644 (file)
index 0000000..5c1bffb
--- /dev/null
@@ -0,0 +1,58 @@
+/* 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.
+ */
+
+#ifndef JERRYX_HANDLER_H
+#define JERRYX_HANDLER_H
+
+#include "jerryscript.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*
+ * Handler registration helper
+ */
+
+jerry_value_t jerryx_handler_register_global (const jerry_char_t *name_p,
+                                              jerry_external_handler_t handler_p);
+
+/*
+ * Common external function handlers
+ */
+
+jerry_value_t jerryx_handler_assert (const jerry_value_t func_obj_val, const jerry_value_t this_p,
+                                     const jerry_value_t args_p[], const jerry_length_t args_cnt);
+jerry_value_t jerryx_handler_gc (const jerry_value_t func_obj_val, const jerry_value_t this_p,
+                                 const jerry_value_t args_p[], const jerry_length_t args_cnt);
+jerry_value_t jerryx_handler_print (const jerry_value_t func_obj_val, const jerry_value_t this_p,
+                                    const jerry_value_t args_p[], const jerry_length_t args_cnt);
+
+/*
+ * Port API extension
+ */
+
+/**
+ * Print a single character.
+ *
+ * @param c the character to print.
+ */
+void jerryx_port_handler_print_char (char c);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRYX_HANDLER_H */
diff --git a/deps/jerry/jerry-ext/include/jerryscript-ext/module.h b/deps/jerry/jerry-ext/include/jerryscript-ext/module.h
new file mode 100644 (file)
index 0000000..00f22b6
--- /dev/null
@@ -0,0 +1,74 @@
+/* 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.
+ */
+
+#ifndef JERRYX_MODULE_H
+#define JERRYX_MODULE_H
+
+#include "jerryscript.h"
+
+#ifdef __GNUC__
+#define JERRYX_NATIVE_MODULES_SUPPORTED
+#endif /* __GNUC__ */
+
+#ifdef JERRYX_NATIVE_MODULES_SUPPORTED
+#include "jerryscript-ext/section.impl.h"
+
+/**
+ * Declare the signature for the module initialization function.
+ */
+typedef jerry_value_t (*jerryx_native_module_on_resolve_t) (void);
+
+/**
+ * Declare the structure used to define a module. One should only make use of this structure via the
+ * JERRYX_NATIVE_MODULE macro declared below.
+ */
+typedef struct
+{
+  jerry_char_t *name; /**< name of the module */
+  jerryx_native_module_on_resolve_t on_resolve; /**< function that returns a new instance of the module */
+} jerryx_native_module_t;
+
+/**
+ * Declare a helper macro that expands to the declaration of a variable of type jerryx_native_module_t placed into the
+ * specially-named linker section "jerryx_modules" where the JerryScript module resolver
+ * jerryx_module_native_resolver () will look for it.
+ */
+#define JERRYX_NATIVE_MODULE(module_name, on_resolve_cb)                                 \
+  static const jerryx_native_module_t _module JERRYX_SECTION_ATTRIBUTE(jerryx_modules) = \
+  {                                                                                      \
+    .name = ((jerry_char_t *) #module_name),                                             \
+    .on_resolve = (on_resolve_cb)                                                        \
+  };
+
+/**
+ * Declare the JerryScript module resolver so that it may be added to an array of jerryx_module_resolver_t items and
+ * thus passed to jerryx_module_resolve.
+ */
+bool jerryx_module_native_resolver (const jerry_char_t *name, jerry_value_t *result);
+
+#endif /* JERRYX_NATIVE_MODULES_SUPPORTED */
+
+/**
+ * Declare the function pointer type for module resolvers.
+ */
+typedef bool (*jerryx_module_resolver_t) (const jerry_char_t *name, jerry_value_t *result);
+
+/**
+ * Load a copy of a module into the current context using the provided module resolvers, or return one that was already
+ * loaded if it is found.
+ */
+jerry_value_t jerryx_module_resolve (const jerry_char_t *name, jerryx_module_resolver_t *resolvers, size_t count);
+
+#endif /* !JERRYX_MODULE_H */
diff --git a/deps/jerry/jerry-ext/include/jerryscript-ext/section.impl.h b/deps/jerry/jerry-ext/include/jerryscript-ext/section.impl.h
new file mode 100644 (file)
index 0000000..530d021
--- /dev/null
@@ -0,0 +1,56 @@
+/* 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.
+ */
+
+#ifndef JERRYX_SECTION_IMPL_H
+#define JERRYX_SECTION_IMPL_H
+
+/**
+ * Define the name of a section
+ *
+ * @param name the name of the section without quotes
+ */
+#ifdef __MACH__
+#define JERRYX_SECTION_NAME(name) "__DATA," #name
+#else /* !__MACH__ */
+#define JERRYX_SECTION_NAME(name) #name
+#endif /* __MACH__ */
+
+/**
+ * Expands to the proper __attribute__(()) qualifier for appending a variable to a section.
+ */
+#define JERRYX_SECTION_ATTRIBUTE(name) \
+  __attribute__ ((used, section (JERRYX_SECTION_NAME (name)), aligned (sizeof (void *))))
+
+/**
+ * Declare references to a section that contains an array of items.
+ *
+ * @param name the name of the section (without quotes)
+ * @param type the type of the elements stored in the array
+ *
+ * This macro declares two extern const variables such that their type is an array of @p type and their names are
+ * constructed by prefixing @p name with "__start_" and "__stop_". They evaluate to the starting and ending address
+ * of the section @p name.
+ */
+#ifdef __MACH__
+#define JERRYX_SECTION_DECLARE(name, type)                                   \
+  extern const type __start_ ## name[] __asm("section$start$__DATA$" #name); \
+  extern const type __stop_ ## name[] __asm("section$end$__DATA$" #name);
+#else /* !__MACH__ */
+#define JERRYX_SECTION_DECLARE(name, type)                    \
+  extern const type __start_ ## name[] __attribute__((weak)); \
+  extern const type __stop_ ## name[] __attribute__((weak));
+#endif /* __MACH__ */
+
+#endif /* !JERRYX_SECTION_IMPL_H */
diff --git a/deps/jerry/jerry-ext/module/module.c b/deps/jerry/jerry-ext/module/module.c
new file mode 100644 (file)
index 0000000..917cf5d
--- /dev/null
@@ -0,0 +1,217 @@
+/* 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.
+ */
+
+#include <string.h>
+#include "jerryscript.h"
+#include "jerryscript-ext/module.h"
+
+static const jerry_char_t *module_name_property_name = (jerry_char_t *) "moduleName";
+static const jerry_char_t *module_not_found = (jerry_char_t *) "Module not found";
+
+/**
+ * Create an error related to modules
+ *
+ * Creates an error object of the requested type with the additional property "moduleName" the value of which is a
+ * string containing the name of the module that was requested when the error occurred.
+ *
+ * @return the error
+ */
+static jerry_value_t
+jerryx_module_create_error (jerry_error_t error_type, /**< the type of error to create */
+                            const jerry_char_t *message, /**< the error message */
+                            const jerry_char_t *module_name) /**< the module name */
+{
+  jerry_value_t ret = jerry_create_error (error_type, message);
+  jerry_value_t property_name = jerry_create_string (module_name_property_name);
+  jerry_value_t property_value = jerry_create_string_from_utf8 (module_name);
+
+  jerry_release_value (jerry_set_property (ret, property_name, property_value));
+  jerry_release_value (property_name);
+  jerry_release_value (property_value);
+  return ret;
+} /* jerryx_module_create_error */
+
+/**
+ * Initialize the module manager extension.
+ */
+static void
+jerryx_module_manager_init (void *user_data_p)
+{
+  *((jerry_value_t *) user_data_p) = jerry_create_object ();
+} /* jerryx_module_manager_init */
+
+/**
+ * Deinitialize the module manager extension.
+ */
+static void
+jerryx_module_manager_deinit (void *user_data_p) /**< context pointer to deinitialize */
+{
+  jerry_release_value (*(jerry_value_t *) user_data_p);
+} /* jerryx_module_manager_deinit */
+
+/**
+ * Declare the context data manager for modules.
+ */
+static const jerry_context_data_manager_t jerryx_module_manager =
+{
+  .init_cb = jerryx_module_manager_init,
+  .deinit_cb = jerryx_module_manager_deinit,
+  .bytes_needed = sizeof (jerry_value_t)
+};
+
+/**
+ * Declare the linker section where module definitions are stored.
+ */
+JERRYX_SECTION_DECLARE (jerryx_modules, jerryx_native_module_t)
+
+/**
+ * Attempt to retrieve a module by name from a cache, and return false if not found.
+ */
+static bool
+jerryx_module_check_cache (jerry_value_t cache, /**< cache from which to attempt to retrieve the module by name */
+                           jerry_value_t module_name, /**< JerryScript string value holding the module name */
+                           jerry_value_t *result) /**< Resulting value */
+{
+  bool ret = false;
+
+  /* Check if the cache has the module. */
+  jerry_value_t js_has_property = jerry_has_property (cache, module_name);
+
+  /* If we succeed in getting an answer, we examine the answer. */
+  if (!jerry_value_has_error_flag (js_has_property))
+  {
+    bool has_property = jerry_get_boolean_value (js_has_property);
+
+    /* If the module is indeed in the cache, we return it. */
+    if (has_property)
+    {
+      (*result) = jerry_get_property (cache, module_name);
+      ret = true;
+    }
+  }
+
+  jerry_release_value (js_has_property);
+
+  return ret;
+} /* jerryx_module_check_cache */
+
+/**
+ * Attempt to cache a loaded module.
+ *
+ * @return the module on success, otherwise the error encountered when attempting to cache. In the latter case, the
+ * @p module is released.
+ */
+static jerry_value_t
+jerryx_module_add_to_cache (jerry_value_t cache, /**< cache to which to add the module */
+                            jerry_value_t module_name, /**< key at which to cache the module */
+                            jerry_value_t module) /**< the module to cache */
+{
+  jerry_value_t ret = jerry_set_property (cache, module_name, module);
+
+  if (jerry_value_has_error_flag (ret))
+  {
+    jerry_release_value (module);
+  }
+  else
+  {
+    jerry_release_value (ret);
+    ret = module;
+  }
+
+  return ret;
+} /* jerryx_module_add_to_cache */
+
+#ifdef JERRYX_NATIVE_MODULES_SUPPORTED
+static const jerry_char_t *on_resolve_absent = (jerry_char_t *) "Module on_resolve () must not be NULL";
+
+/**
+ * Declare and define the default module resolver - one which examines what modules are defined in the above linker
+ * section and loads one that matches the requested name, caching the result for subsequent requests using the context
+ * data mechanism.
+ */
+bool
+jerryx_module_native_resolver (const jerry_char_t *name, /**< name of the module */
+                               jerry_value_t *result) /**< [out] where to put the resulting module instance */
+{
+  int index;
+  const jerryx_native_module_t *module_p = NULL;
+
+  /* Look for the module by its name in the list of module definitions. */
+  for (index = 0, module_p = &__start_jerryx_modules[0];
+       &__start_jerryx_modules[index] < __stop_jerryx_modules;
+       index++, module_p = &__start_jerryx_modules[index])
+  {
+    if (module_p->name != NULL && !strcmp ((char *) module_p->name, (char *) name))
+    {
+      /* If we find the module by its name we load it and cache it if it has an on_resolve () and complain otherwise. */
+      (*result) = ((module_p->on_resolve) ? module_p->on_resolve ()
+                                          : jerryx_module_create_error (JERRY_ERROR_TYPE, on_resolve_absent, name));
+      return true;
+    }
+  }
+
+  return false;
+} /* jerryx_module_native_resolver */
+#endif /* JERRYX_NATIVE_MODULES_SUPPORTED */
+
+/**
+ * Resolve a single module using the module resolvers available in the section declared above and load it into the
+ * current context.
+ *
+ * @p name - name of the module to resolve
+ * @p resolvers - list of resolvers to invoke
+ * @p count - number of resolvers in the list
+ *
+ * @return a jerry_value_t containing one of the followings:
+ *   - the result of having loaded the module named @p name, or
+ *   - the result of a previous successful load, or
+ *   - an error indicating that something went wrong during the attempt to load the module.
+ */
+jerry_value_t
+jerryx_module_resolve (const jerry_char_t *name, /**< name of the module to load */
+                       jerryx_module_resolver_t *resolvers_p, /**< list of resolvers */
+                       size_t resolver_count) /**< number of resolvers in @p resolvers */
+{
+  size_t index;
+  jerry_value_t ret;
+  jerry_value_t instances = *(jerry_value_t *) jerry_get_context_data (&jerryx_module_manager);
+  jerry_value_t module_name = jerry_create_string_from_utf8 (name);
+
+  /* Return the cached instance if present. */
+  if (jerryx_module_check_cache (instances, module_name, &ret))
+  {
+    goto done;
+  }
+
+  /* Try each resolver until one manages to find the module. */
+  for (index = 0; index < resolver_count; index++)
+  {
+    if ((*resolvers_p[index]) (name, &ret))
+    {
+      if (!jerry_value_has_error_flag (ret))
+      {
+        ret = jerryx_module_add_to_cache (instances, module_name, ret);
+      }
+      goto done;
+    }
+  }
+
+  /* If none of the resolvers manage to find the module, complain with "Module not found" */
+  ret = jerryx_module_create_error (JERRY_ERROR_COMMON, module_not_found, name);
+
+done:
+  jerry_release_value (module_name);
+  return ret;
+} /* jerryx_module_resolve */
diff --git a/deps/jerry/jerry-libc/CMakeLists.txt b/deps/jerry/jerry-libc/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b594e74
--- /dev/null
@@ -0,0 +1,64 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+set(JERRY_LIBC_NAME jerry-libc)
+project (${JERRY_LIBC_NAME} C ASM)
+
+# Optional features
+set(FEATURE_INIT_FINI OFF CACHE BOOL "Enable init/fini arrays?")
+
+# Status messages
+message(STATUS "FEATURE_INIT_FINI         " ${FEATURE_INIT_FINI})
+
+# Checks the optional features
+# Enable init/fini arrays
+if(FEATURE_INIT_FINI)
+  set(DEFINES_LIBC ${DEFINES_LIBC} ENABLE_INIT_FINI)
+endif()
+
+# Architecture-specific configuration
+if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+  set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_x64)
+elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l")
+  set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_ARMv7 __TARGET_HOST_ARMv7_HARD_FLOAT)
+elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l-el")
+  set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_ARMv7 __TARGET_HOST_ARMv7_SOFT_FLOAT)
+elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
+  set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_x86)
+else()
+  message(FATAL_ERROR "Machine architecture ${CMAKE_SYSTEM_PROCESSOR} isn't supported")
+endif()
+
+# Include directories
+set(INCLUDE_LIBC "${CMAKE_CURRENT_SOURCE_DIR}")
+
+# Sources
+file(GLOB SOURCE_LIBC *.c)
+
+# Platform-specific
+# Linux
+if(DEFINED PLATFORM AND ((PLATFORM STREQUAL "LINUX") OR (PLATFORM STREQUAL "DARWIN")))
+  file(GLOB TARGET_SPECIFIC_LIBC_SOURCE target/posix/*.c target/posix/*.S)
+endif()
+
+add_library(${JERRY_LIBC_NAME} STATIC ${SOURCE_LIBC} ${TARGET_SPECIFIC_LIBC_SOURCE})
+
+target_compile_definitions(${JERRY_LIBC_NAME} PRIVATE ${DEFINES_LIBC})
+target_include_directories(${JERRY_LIBC_NAME} PRIVATE ${INCLUDE_LIBC})
+target_include_directories(${JERRY_LIBC_NAME} SYSTEM PUBLIC "${CMAKE_SOURCE_DIR}/jerry-libc/include")
+target_link_libraries(${JERRY_LIBC_NAME} -lgcc)
+
+install(TARGETS ${JERRY_LIBC_NAME} DESTINATION lib)
+install(DIRECTORY ${INCLUDE_LIBC}/include/ DESTINATION include/jerry-libc)
diff --git a/deps/jerry/jerry-libc/arch/arm-v7.h b/deps/jerry/jerry-libc/arch/arm-v7.h
new file mode 100644 (file)
index 0000000..bfe2819
--- /dev/null
@@ -0,0 +1,192 @@
+/* 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.
+ */
+
+#ifndef ASM_ARM_H
+#define ASM_ARM_H
+
+/*
+ * mov syscall_no (%r0) -> %r7
+ * svc #0
+ */
+#define SYSCALL_0 \
+  push {r4-r12, lr}; \
+  \
+  mov r7, r0; \
+  \
+  svc #0; \
+  \
+  pop {r4-r12, pc};
+
+/*
+ * mov syscall_no (%r0) -> %r7
+ * mov arg1 (%r1) -> %r0
+ * svc #0
+ */
+#define SYSCALL_1 \
+  push {r4-r12, lr}; \
+  \
+  mov r7, r0; \
+  mov r0, r1; \
+  \
+  svc #0; \
+  \
+  pop {r4-r12, pc};
+
+/*
+ * mov syscall_no (%r0) -> %r7
+ * mov arg1 (%r1) -> %r0
+ * mov arg2 (%r2) -> %r1
+ * svc #0
+ */
+#define SYSCALL_2 \
+  push {r4-r12, lr}; \
+  \
+  mov r7, r0; \
+  mov r0, r1; \
+  mov r1, r2; \
+  \
+  svc #0; \
+  \
+  pop {r4-r12, pc};
+
+/*
+ * mov syscall_no (%r0) -> %r7
+ * mov arg1 (%r1) -> %r0
+ * mov arg2 (%r2) -> %r1
+ * mov arg3 (%r3) -> %r2
+ * svc #0
+ */
+#define SYSCALL_3 \
+  push {r4-r12, lr}; \
+  \
+  mov r7, r0; \
+  mov r0, r1; \
+  mov r1, r2; \
+  mov r2, r3; \
+  \
+  svc #0; \
+  \
+  pop {r4-r12, pc};
+
+#ifdef ENABLE_INIT_FINI
+/*
+ * bl libc_init_array
+ */
+#define _INIT           \
+  bl libc_init_array;
+#else /* !ENABLE_INIT_FINI */
+#define _INIT
+#endif /* ENABLE_INIT_FINI */
+
+/*
+ * bl libc_init_array
+ *
+ * ldr argc ([sp + 0x0]) -> r0
+ * add argv (sp + 0x4) -> r1
+ * bl main
+ *
+ * bl exit
+ *
+ * infinite loop
+ */
+#define _START          \
+  _INIT;                \
+                        \
+  ldr r0, [sp, #0];     \
+  add r1, sp, #4;       \
+  bl main;              \
+                        \
+  bl exit;              \
+  1:                    \
+  b 1b;
+
+/**
+ * If hard-float mode:
+ *   store s16-s31 vfp registers to buffer, pointed with r0 register,
+ *   and increase the register on size of stored data.
+ */
+#ifdef __TARGET_HOST_ARMv7_HARD_FLOAT
+# define _STORE_VFP_S16_S31_IF_HARD_FLOAT \
+   vstm r0!, {s16 - s31};
+# define _LOAD_VFP_S16_S31_IF_HARD_FLOAT \
+   vldm r0!, {s16 - s31};
+#else /* !__TARGET_HOST_ARMv7_HARD_FLOAT */
+# define _STORE_VFP_S16_S31_IF_HARD_FLOAT
+# define _LOAD_VFP_S16_S31_IF_HARD_FLOAT
+#endif /* __TARGET_HOST_ARMv7_HARD_FLOAT */
+
+/*
+ * setjmp
+ *
+ * According to procedure call standard for the ARM architecture, the following
+ * registers are callee-saved, and so need to be stored in context:
+ *   - r4 - r11
+ *   - sp
+ *   - s16 - s31
+ *
+ * Also, we should store:
+ *   - lr
+ *
+ * stmia {r4-r11, sp, lr} -> jmp_buf_0 (r0)!
+ *
+ * If hard-float build
+ *   vstm  {s16-s31} -> jmp_buf_32 (r0)!
+ *
+ * mov r0, #0
+ *
+ * bx lr
+ */
+#define _SETJMP \
+  stmia r0!, {r4 - r11, sp, lr};    \
+                                    \
+  _STORE_VFP_S16_S31_IF_HARD_FLOAT  \
+                                    \
+  mov r0, #0;                       \
+                                    \
+  bx lr;
+
+/*
+ * longjmp
+ *
+ * See also:
+ *          _SETJMP
+ *
+ * ldmia jmp_buf_0 (r0)! -> {r4-r11, sp, lr}
+ *
+ * If hard-float build
+ *   vldm  jmp_buf_32 (r0)! -> {s16-s31}
+ *
+ * mov r1 -> r0
+ * cmp r0, #0
+ * bne 1f
+ * mov #1 -> r0
+ * 1:
+ *
+ * bx lr
+ */
+#define _LONGJMP \
+  ldmia r0!, {r4 - r11, sp, lr};    \
+                                    \
+  _LOAD_VFP_S16_S31_IF_HARD_FLOAT   \
+                                    \
+  mov r0, r1;                       \
+  cmp r0, #0;                       \
+  bne 1f;                           \
+  mov r0, #1;                       \
+  1:                                \
+                                    \
+  bx lr;
+
+#endif /* !ASM_ARM_H */
diff --git a/deps/jerry/jerry-libc/arch/x86-32.h b/deps/jerry/jerry-libc/arch/x86-32.h
new file mode 100644 (file)
index 0000000..c674f4a
--- /dev/null
@@ -0,0 +1,227 @@
+/* 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.
+ */
+
+#ifndef ASM_X86_H
+#define ASM_X86_H
+
+/*
+ * mov syscall_no -> %eax
+ * int $0x80
+ * mov %eax -> ret
+ */
+#define SYSCALL_0 \
+  push %edi;               \
+  push %esi;               \
+  push %ebx;               \
+  mov 0x10 (%esp), %eax;   \
+  int $0x80;               \
+  pop %ebx;                \
+  pop %esi;                \
+  pop %edi;                \
+  ret;
+
+/*
+ * mov syscall_no -> %eax
+ * mov arg1 -> %ebx
+ * int $0x80
+ * mov %eax -> ret
+ */
+#define SYSCALL_1 \
+  push %edi;               \
+  push %esi;               \
+  push %ebx;               \
+  mov 0x10 (%esp), %eax;   \
+  mov 0x14 (%esp), %ebx;   \
+  int $0x80;               \
+  pop %ebx;                \
+  pop %esi;                \
+  pop %edi;                \
+  ret;
+
+/*
+ * mov syscall_no -> %eax
+ * mov arg1 -> %ebx
+ * mov arg2 -> %ecx
+ * int $0x80
+ * mov %eax -> ret
+ */
+#define SYSCALL_2 \
+  push %edi;               \
+  push %esi;               \
+  push %ebx;               \
+  mov 0x10 (%esp), %eax;   \
+  mov 0x14 (%esp), %ebx;   \
+  mov 0x18 (%esp), %ecx;   \
+  int $0x80;               \
+  pop %ebx;                \
+  pop %esi;                \
+  pop %edi;                \
+  ret;
+
+/*
+ * mov syscall_no -> %eax
+ * mov arg1 -> %ebx
+ * mov arg2 -> %ecx
+ * mov arg3 -> %edx
+ * int $0x80
+ * mov %eax -> ret
+ */
+#define SYSCALL_3 \
+  push %edi;               \
+  push %esi;               \
+  push %ebx;               \
+  mov 0x10 (%esp), %eax;   \
+  mov 0x14 (%esp), %ebx;   \
+  mov 0x18 (%esp), %ecx;   \
+  mov 0x1c (%esp), %edx;   \
+  int $0x80;               \
+  pop %ebx;                \
+  pop %esi;                \
+  pop %edi;               \
+  ret;
+
+#ifdef ENABLE_INIT_FINI
+/*
+ * call libc_init_array
+ */
+#define _INIT             \
+  call libc_init_array;
+#else /* !ENABLE_INIT_FINI */
+#define _INIT
+#endif /* ENABLE_INIT_FINI */
+
+/*
+ * call libc_init_array
+ *
+ * push argv (%esp + 4)
+ * push argc ([%esp + 0x4])
+ *
+ * call main
+ *
+ * push main_ret (%eax)
+ * call exit
+ *
+ * infinite loop
+ */
+#define _START            \
+  _INIT;                  \
+                          \
+  mov %esp, %eax;         \
+  add $4, %eax;           \
+  push %eax;              \
+  mov 0x4 (%esp), %eax;   \
+  push %eax;              \
+                          \
+  call main;              \
+                          \
+  push %eax;              \
+  call exit;              \
+                          \
+  1:                      \
+  jmp 1b;
+
+/*
+ * setjmp
+ *
+ * According to x86_32 System V ABI, the following registers are
+ * callee-saved, and so need to be stored in context:
+ *   - %ebx
+ *   - %esp
+ *   - %ebp
+ *   - %esi
+ *   - %edi
+ *   - x87 control word
+ *
+ * Also, we should store:
+ *   - return address (to jump to upon longjmp)
+ *
+ * mov return_address ([%esp]) -> %eax
+ *
+ * mov env ([%esp + 0x4]) -> %edx
+ *
+ * mov %ebx -> jmp_buf_0  ([%edx + 0x0])
+ * mov %esp -> jmp_buf_4  ([%edx + 0x4])
+ * mov %ebp -> jmp_buf_8  ([%edx + 0x8])
+ * mov %esi -> jmp_buf_12 ([%edx + 0xc])
+ * mov %edi -> jmp_buf_16 ([%edx + 0x10])
+ * mov %eax -> jmp_buf_20 ([%edx + 0x14])
+ * fnstcw   -> jmp_buf_24 ([%edx + 0x18])
+ *
+ * ret
+ */
+#define _SETJMP \
+  mov (%esp), %eax;       \
+  mov 0x4 (%esp), %edx;   \
+                          \
+  mov %ebx, 0x00 (%edx);  \
+  mov %esp, 0x04 (%edx);  \
+  mov %ebp, 0x08 (%edx);  \
+  mov %esi, 0x0c (%edx);  \
+  mov %edi, 0x10 (%edx);  \
+  mov %eax, 0x14 (%edx);  \
+  fnstcw 0x18 (%edx);     \
+                          \
+  xor %eax, %eax;         \
+                          \
+  ret
+
+/*
+ * longjmp
+ *
+ * See also:
+ *          _SETJMP
+ *
+ * mov env ([%esp + 0x4]) -> %edx
+ * mov val ([%esp + 0x8]) -> %eax
+ *
+ * mov jmp_buf_0    ([%edx + 0x0])  -> %ebx
+ * mov jmp_buf_4    ([%edx + 0x8])  -> %esp
+ * mov jmp_buf_8    ([%edx + 0x10]) -> %ebp
+ * mov jmp_buf_12   ([%edx + 0x18]) -> %esi
+ * mov jmp_buf_16   ([%edx + 0x20]) -> %edi
+ * mov jmp_buf_20   ([%edx + 0x28]) -> %ecx
+ * fldcw jmp_buf_24 ([%edx + 0x30])
+ *
+ * mov return_address (%ecx) -> ([%esp])
+ *
+ * cmp (%eax), 0x0
+ * jnz 1f
+ * xor %eax, %eax
+ * 1:
+ *
+ * ret
+ */
+#define _LONGJMP \
+  mov 0x4 (%esp), %edx;   \
+  mov 0x8 (%esp), %eax;   \
+                          \
+  mov 0x0 (%edx), %ebx;   \
+  mov 0x4 (%edx), %esp;   \
+  mov 0x8 (%edx), %ebp;   \
+  mov 0xc (%edx), %esi;   \
+  mov 0x10 (%edx), %edi;  \
+  mov 0x14 (%edx), %ecx;  \
+  fldcw 0x18 (%edx);      \
+                          \
+  mov %ecx, (%esp);       \
+                          \
+  test %eax, %eax;        \
+  jnz 1f;                 \
+  xor %eax, %eax;         \
+ 1:                       \
+                          \
+  ret
+
+#endif /* !ASM_X86_H */
diff --git a/deps/jerry/jerry-libc/arch/x86-64.h b/deps/jerry/jerry-libc/arch/x86-64.h
new file mode 100644 (file)
index 0000000..5a35d02
--- /dev/null
@@ -0,0 +1,202 @@
+/* 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.
+ */
+
+#ifndef ASM_X64_H
+#define ASM_X64_H
+
+/*
+ * mov syscall_no (%rdi) -> %rax
+ * syscall
+ */
+#define SYSCALL_0 \
+  mov %rdi, %rax; \
+  syscall; \
+  ret;
+
+/*
+ * mov syscall_no (%rdi) -> %rax
+ * mov arg1 (%rsi) -> %rdi
+ * syscall
+ */
+#define SYSCALL_1 \
+  mov %rdi, %rax; \
+  mov %rsi, %rdi; \
+  syscall; \
+  ret;
+
+/*
+ * mov syscall_no (%rdi) -> %rax
+ * mov arg1 (%rsi) -> %rdi
+ * mov arg2 (%rdx) -> %rsi
+ * syscall
+ */
+#define SYSCALL_2 \
+  mov %rdi, %rax; \
+  mov %rsi, %rdi; \
+  mov %rdx, %rsi; \
+  syscall; \
+  ret;
+
+/*
+ * mov syscall_no (%rdi) -> %rax
+ * mov arg1 (%rsi) -> %rdi
+ * mov arg2 (%rdx) -> %rsi
+ * mov arg3 (%rcx) -> %rdx
+ * syscall
+ */
+#define SYSCALL_3 \
+  mov %rdi, %rax; \
+  mov %rsi, %rdi; \
+  mov %rdx, %rsi; \
+  mov %rcx, %rdx; \
+  syscall; \
+  ret;
+
+#ifdef ENABLE_INIT_FINI
+/*
+ * call libc_init_array
+ */
+#define _INIT             \
+  call libc_init_array;
+#else /* !ENABLE_INIT_FINI */
+#define _INIT
+#endif /* ENABLE_INIT_FINI */
+
+/*
+ * call libc_init_array
+ *
+ * mov argc ([%rsp]) -> %rdi
+ * mov argv (%rsp + 0x8) -> %rsi
+ *
+ * call main
+ *
+ * mov main_ret (%rax) -> %rdi
+ * call exit
+ *
+ * infinite loop
+ */
+#define _START            \
+  _INIT;                  \
+                          \
+  mov (%rsp), %rdi;       \
+  mov %rsp, %rsi;         \
+  add $8, %rsi;           \
+  callq main;             \
+                          \
+  mov %rax, %rdi;         \
+  callq exit;             \
+  1:                      \
+  jmp 1b;
+
+/*
+ * setjmp
+ *
+ * According to x86_64 System V ABI, the following registers are
+ * callee-saved, and so need to be stored in context:
+ *   - %rbp
+ *   - %rbx
+ *   - %r12
+ *   - %r13
+ *   - %r14
+ *   - %r15
+ *   - x87 control word
+ *
+ * Also, we should store:
+ *   - %rsp (stack pointer)
+ *   - return address (to jump to upon longjmp)
+ *
+ * mov return_address ([%rsp]) -> %rax
+ *
+ * mov %rsp -> jmp_buf_0  ([%rdi + 0x0])
+ * mov %rax -> jmp_buf_8  ([%rdi + 0x8])
+ * mov %rbp -> jmp_buf_16 ([%rdi + 0x10])
+ * mov %rbx -> jmp_buf_24 ([%rdi + 0x18])
+ * mov %r12 -> jmp_buf_32 ([%rdi + 0x20])
+ * mov %r13 -> jmp_buf_40 ([%rdi + 0x28])
+ * mov %r14 -> jmp_buf_48 ([%rdi + 0x30])
+ * mov %r15 -> jmp_buf_56 ([%rdi + 0x38])
+ * fnstcw   -> jmp_buf_64 ([%rdi + 0x40])
+ *
+ * ret
+ */
+#define _SETJMP \
+  mov (%rsp), %rax;      \
+                         \
+  mov %rsp, 0x00(%rdi);  \
+  mov %rax, 0x08(%rdi);  \
+  mov %rbp, 0x10(%rdi);  \
+  mov %rbx, 0x18(%rdi);  \
+  mov %r12, 0x20(%rdi);  \
+  mov %r13, 0x28(%rdi);  \
+  mov %r14, 0x30(%rdi);  \
+  mov %r15, 0x38(%rdi);  \
+  fnstcw 0x40(%rdi);     \
+                         \
+  xor %rax, %rax;        \
+                         \
+  ret;
+
+/*
+ * longjmp
+ *
+ * See also:
+ *          _SETJMP
+ *
+ * mov jmp_buf_0  ([%rdi + 0x0])  -> %rsp
+ * mov jmp_buf_8  ([%rdi + 0x8])  -> %rax
+ * mov jmp_buf_16 ([%rdi + 0x10]) -> %rbp
+ * mov jmp_buf_24 ([%rdi + 0x18]) -> %rbx
+ * mov jmp_buf_32 ([%rdi + 0x20]) -> %r12
+ * mov jmp_buf_40 ([%rdi + 0x28]) -> %r13
+ * mov jmp_buf_48 ([%rdi + 0x30]) -> %r14
+ * mov jmp_buf_56 ([%rdi + 0x38]) -> %r15
+ * fldcw jmp_buf_64 ([%rdi + 0x40])
+ *
+ * mov return_address (%rax) -> ([%rsp])
+ *
+ * mov val (%rsi) -> %rax
+ *
+ * test (%rax), (%rax)
+ * jnz 1f
+ * mov $1, %rax
+ * 1:
+ *
+ * ret
+ */
+#define _LONGJMP \
+  mov 0x00(%rdi), %rsp; \
+  mov 0x08(%rdi), %rax; \
+  mov 0x10(%rdi), %rbp; \
+  mov 0x18(%rdi), %rbx; \
+  mov 0x20(%rdi), %r12; \
+  mov 0x28(%rdi), %r13; \
+  mov 0x30(%rdi), %r14; \
+  mov 0x38(%rdi), %r15; \
+  fldcw 0x40(%rdi);     \
+                        \
+  mov %rax, (%rsp);     \
+                        \
+  mov %rsi, %rax;       \
+                        \
+  test %rax, %rax;      \
+  jnz 1f;               \
+  mov $1, %rax;         \
+ 1:                     \
+                        \
+  ret
+
+
+
+#endif /* !ASM_X64_H */
diff --git a/deps/jerry/jerry-libc/include/assert.h b/deps/jerry/jerry-libc/include/assert.h
new file mode 100644 (file)
index 0000000..8e43849
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ */
+
+#ifndef JERRY_LIBC_ASSERT_H
+#define JERRY_LIBC_ASSERT_H
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#ifndef NDEBUG
+#define assert(x) \
+  do \
+  { \
+    if (!(x)) \
+    { \
+      fprintf (stderr, "%s:%d: %s: Assertion `%s' failed.", __FILE__, __LINE__, __func__, #x); \
+      abort (); \
+    } \
+  } while (0)
+#else /* NDEBUG */
+#define assert(x) ((void) 0)
+#endif /* !NDEBUG */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRY_LIBC_ASSERT_H */
diff --git a/deps/jerry/jerry-libc/include/setjmp.h b/deps/jerry/jerry-libc/include/setjmp.h
new file mode 100644 (file)
index 0000000..ce5961c
--- /dev/null
@@ -0,0 +1,64 @@
+/* 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.
+ */
+
+#ifndef JERRY_LIBC_SETJMP_H
+#define JERRY_LIBC_SETJMP_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/**
+ * Storage for context, used for nonlocal goto
+ *
+ * x86_64 (8 * 8 + 2 bytes):
+ *   0x00 - %rsp
+ *   0x08 - return address
+ *   0x10 - %rbp
+ *   0x18 - %rbx
+ *   0x20 - %r12
+ *   0x28 - %r13
+ *   0x30 - %r14
+ *   0x38 - %r15
+ *   0x40 - x87 control word
+ *
+ * x86_32 (6 * 4 + 2 bytes):
+ *   - %ebx
+ *   - %esp
+ *   - %ebp
+ *   - %esi
+ *   - %edi
+ *   - return address (to jump to upon longjmp)
+ *   - x87 control word
+ *
+ * ARMv7 (10 * 4 + 16 * 4 bytes):
+ *   - r4 - r11, sp, lr
+ *   - s16 - s31 (if hardfp enabled)
+ *
+ * See also:
+ *          setjmp, longjmp
+ */
+typedef uint64_t jmp_buf[14];
+
+int setjmp (jmp_buf env);
+void longjmp (jmp_buf env, int val);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRY_LIBC_SETJMP_H */
diff --git a/deps/jerry/jerry-libc/include/stdio.h b/deps/jerry/jerry-libc/include/stdio.h
new file mode 100644 (file)
index 0000000..9ff331e
--- /dev/null
@@ -0,0 +1,53 @@
+/* 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.
+ */
+
+#ifndef JERRY_LIBC_STDIO_H
+#define JERRY_LIBC_STDIO_H
+
+#include <stdarg.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/**
+ * File descriptor type
+ */
+typedef void FILE;
+
+/**
+ * Standard file descriptors
+ */
+extern FILE *stdin;
+extern FILE *stdout;
+extern FILE *stderr;
+
+/**
+ * I/O routines
+ */
+int vfprintf (FILE *stream, const char *format, va_list ap);
+FILE *fopen (const char *path, const char *mode);
+int fclose (FILE *fp);
+size_t fread (void *ptr, size_t size, size_t nmemb, FILE *stream);
+size_t fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream);
+int printf (const char *format, ...);
+int fprintf (FILE *stream, const char *format, ...);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRY_LIBC_STDIO_H */
diff --git a/deps/jerry/jerry-libc/include/stdlib.h b/deps/jerry/jerry-libc/include/stdlib.h
new file mode 100644 (file)
index 0000000..4682af8
--- /dev/null
@@ -0,0 +1,41 @@
+/* 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.
+ */
+
+#ifndef JERRY_LIBC_STDLIB_H
+#define JERRY_LIBC_STDLIB_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/**
+ * Maximum integer that could be returned by random number generator
+ *
+ * See also:
+ *          rand
+ */
+#define RAND_MAX (0x7fffffffu)
+
+void __attribute__ ((noreturn)) exit (int);
+void __attribute__ ((noreturn)) abort (void);
+int rand (void);
+void srand (unsigned int);
+long int strtol (const char *, char **, int);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRY_LIBC_STDLIB_H */
diff --git a/deps/jerry/jerry-libc/include/string.h b/deps/jerry/jerry-libc/include/string.h
new file mode 100644 (file)
index 0000000..0576540
--- /dev/null
@@ -0,0 +1,38 @@
+/* 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.
+ */
+
+#ifndef JERRY_LIBC_STRING_H
+#define JERRY_LIBC_STRING_H
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+void *memcpy (void *dest, const void *src, size_t n);
+void *memset (void *s, int c, size_t n);
+void *memmove (void *dest, const void *src, size_t n);
+int memcmp (const void *s1, const void *s2, size_t n);
+int strcmp (const char *s1, const char *s2);
+int strncmp (const char *s1, const char *s2, size_t n);
+char *strncpy (char *dest, const char *src, size_t n);
+size_t strlen (const char *s);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRY_LIBC_STRING_H */
diff --git a/deps/jerry/jerry-libc/include/sys/time.h b/deps/jerry/jerry-libc/include/sys/time.h
new file mode 100644 (file)
index 0000000..a20cba0
--- /dev/null
@@ -0,0 +1,47 @@
+/* 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.
+ */
+
+#ifndef JERRY_LIBC_TIME_H
+#define JERRY_LIBC_TIME_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/**
+ * Time value structure
+ */
+struct timeval
+{
+  unsigned long tv_sec;   /**< seconds */
+  unsigned long tv_usec;  /**< microseconds */
+};
+
+/**
+ * Timezone structure
+ */
+struct timezone
+{
+  int tz_minuteswest;     /**< minutes west of Greenwich */
+  int tz_dsttime;         /**< type of DST correction */
+};
+
+int gettimeofday (void *tp, void *tzp);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRY_LIBC_TIME_H */
diff --git a/deps/jerry/jerry-libc/jerry-libc-defs.h b/deps/jerry/jerry-libc/jerry-libc-defs.h
new file mode 100644 (file)
index 0000000..3a61a93
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+#ifndef DEFS_H
+#define DEFS_H
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stddef.h>
+
+/**
+ * Attributes
+ */
+#define __attr_unused___   __attribute__((unused))
+#define __attr_used___     __attribute__((used))
+#define __attr_noreturn___ __attribute__((noreturn))
+#define __attr_noinline___ __attribute__((noinline))
+#define __attr_weak___     __attribute__((weak))
+
+#ifdef ENABLE_INIT_FINI
+void libc_init_array (void);
+void libc_fini_array (void);
+#endif /* ENABLE_INIT_FINI */
+
+#endif /* !DEFS_H */
diff --git a/deps/jerry/jerry-libc/jerry-libc-init.c b/deps/jerry/jerry-libc/jerry-libc-init.c
new file mode 100644 (file)
index 0000000..712359b
--- /dev/null
@@ -0,0 +1,98 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *    Copyright (C) 2004 CodeSourcery, LLC
+ *
+ *    Permission to use, copy, modify, and distribute this file
+ *    for any purpose is hereby granted without fee, provided that
+ *    the above copyright notice and this notice appears in all
+ *    copies.
+ *
+ *    This file is distributed WITHOUT ANY WARRANTY; without even the implied
+ *    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include "jerry-libc-defs.h"
+
+#ifdef ENABLE_INIT_FINI
+
+/* These magic symbols are provided by the linker.  */
+typedef void (*libc_init_fn_t) (void);
+
+extern libc_init_fn_t __preinit_array_start[] __attr_weak___;
+extern libc_init_fn_t __preinit_array_end[] __attr_weak___;
+extern libc_init_fn_t __init_array_start[] __attr_weak___;
+extern libc_init_fn_t __init_array_end[] __attr_weak___;
+extern libc_init_fn_t __fini_array_start[] __attr_weak___;
+extern libc_init_fn_t __fini_array_end[] __attr_weak___;
+extern void _init (void);
+extern void _fini (void);
+
+
+/**
+ * No-op default _init.
+ */
+void  __attr_weak___
+_init (void)
+{
+} /* _init */
+
+/**
+ * No-op default _fini.
+ */
+void  __attr_weak___
+_fini (void)
+{
+} /* _fini */
+
+/**
+ * Iterate over all the init routines.
+ */
+void
+libc_init_array (void)
+{
+  size_t count = (size_t) (__preinit_array_end - __preinit_array_start);
+  for (size_t i = 0; i < count; i++)
+  {
+    __preinit_array_start[i] ();
+  }
+
+  _init ();
+
+  count = (size_t) (__init_array_end - __init_array_start);
+  for (size_t i = 0; i < count; i++)
+  {
+    __init_array_start[i] ();
+  }
+} /* libc_init_array */
+
+/**
+ * Run all the cleanup routines.
+ */
+void
+libc_fini_array (void)
+{
+  size_t count = (size_t) (__fini_array_end - __fini_array_start);
+  for (size_t i = count; i > 0; i--)
+  {
+    __fini_array_start[i - 1] ();
+  }
+
+  _fini ();
+} /* libc_fini_array */
+
+#endif /* ENABLE_INIT_FINI */
diff --git a/deps/jerry/jerry-libc/jerry-libc-printf.c b/deps/jerry/jerry-libc/jerry-libc-printf.c
new file mode 100644 (file)
index 0000000..cc9366c
--- /dev/null
@@ -0,0 +1,754 @@
+/* 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.
+ */
+
+/**
+ * Jerry printf implementation
+ */
+
+#include <assert.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "jerry-libc-defs.h"
+
+/**
+ * printf's length type
+ */
+typedef enum
+{
+  LIBC_PRINTF_ARG_LENGTH_TYPE_NONE, /**< (none) */
+  LIBC_PRINTF_ARG_LENGTH_TYPE_HH, /**< hh */
+  LIBC_PRINTF_ARG_LENGTH_TYPE_H, /**< h */
+  LIBC_PRINTF_ARG_LENGTH_TYPE_L, /**< l */
+  LIBC_PRINTF_ARG_LENGTH_TYPE_LL, /**< ll */
+  LIBC_PRINTF_ARG_LENGTH_TYPE_J, /**< j */
+  LIBC_PRINTF_ARG_LENGTH_TYPE_Z, /**< z */
+  LIBC_PRINTF_ARG_LENGTH_TYPE_T, /**< t */
+  LIBC_PRINTF_ARG_LENGTH_TYPE_HIGHL /**< L */
+} libc_printf_arg_length_type_t;
+
+/**
+ * printf's flags mask
+ */
+typedef uint8_t libc_printf_arg_flags_mask_t;
+
+/**
+ * Left justification of field's contents
+ */
+#define LIBC_PRINTF_ARG_FLAG_LEFT_JUSTIFY (1 << 0)
+
+/**
+ * Force print of number's sign
+ */
+#define LIBC_PRINTF_ARG_FLAG_PRINT_SIGN   (1 << 1)
+
+/**
+ * If no sign is printed, print space before value
+ */
+#define LIBC_PRINTF_ARG_FLAG_SPACE        (1 << 2)
+
+/**
+ * For o, x, X preceed value with 0, 0x or 0X for non-zero values.
+ */
+#define LIBC_PRINTF_ARG_FLAG_SHARP        (1 << 3)
+
+/**
+ * Left-pad field with zeroes instead of spaces
+ */
+#define LIBC_PRINTF_ARG_FLAG_ZERO_PADDING (1 << 4)
+
+/**
+ * printf helper function that outputs a char
+ */
+static void
+libc_printf_putchar (FILE *stream, /**< stream pointer */
+                     char character) /**< character */
+{
+  fwrite (&character, 1, sizeof (character), stream);
+} /* libc_printf_putchar */
+
+/**
+ * printf helper function that outputs justified string
+ */
+static void
+libc_printf_justified_string_output (FILE *stream, /**< stream pointer */
+                                     const char *string_p, /**< string */
+                                     size_t width, /**< minimum field width */
+                                     bool is_left_justify, /**< justify to left (true) or right (false) */
+                                     bool is_zero_padding) /**< left-pad with zeroes (true) or spaces (false) */
+{
+  const size_t str_length = strlen (string_p);
+
+  size_t outputted_length = 0;
+
+  if (!is_left_justify)
+  {
+    char padding_char = is_zero_padding ? '0' : ' ';
+
+    while (outputted_length + str_length < width)
+    {
+      libc_printf_putchar (stream, padding_char);
+      outputted_length++;
+    }
+  }
+
+  fwrite (string_p, 1, str_length * sizeof (*string_p), stream);
+  outputted_length += str_length;
+
+  if (is_left_justify)
+  {
+    while (outputted_length < width)
+    {
+      libc_printf_putchar (stream, ' ');
+      outputted_length++;
+    }
+  }
+} /* libc_printf_justified_string_output */
+
+/**
+ * printf helper function that converts unsigned integer to string
+ */
+static char *
+libc_printf_uint_to_string (uintmax_t value, /**< integer value */
+                            char *buffer_p, /**< buffer for output string */
+                            size_t buffer_size, /**< buffer size */
+                            const char *alphabet, /**< alphabet used for digits */
+                            uint32_t radix) /**< radix */
+{
+  char *str_buffer_end = buffer_p + buffer_size;
+  char *str_p = str_buffer_end;
+  *--str_p = '\0';
+
+  assert (radix >= 2);
+
+  if ((radix & (radix - 1)) != 0)
+  {
+    /*
+     * Radix is not power of 2. Only 32-bit numbers are supported in this mode.
+     */
+    assert ((value >> 32) == 0);
+
+    uint32_t value_lo = (uint32_t) value;
+
+    while (value_lo != 0)
+    {
+      assert (str_p != buffer_p);
+
+      *--str_p = alphabet[ value_lo % radix ];
+      value_lo /= radix;
+    }
+  }
+  else
+  {
+    uint32_t shift = 0;
+    while (!(radix & (1u << shift)))
+    {
+      shift++;
+
+      assert (shift <= 32);
+    }
+
+    uint32_t value_lo = (uint32_t) value;
+    uint32_t value_hi = (uint32_t) (value >> 32);
+
+    while (value_lo != 0
+           || value_hi != 0)
+    {
+      assert (str_p != buffer_p);
+
+      *--str_p = alphabet[ value_lo & (radix - 1) ];
+      value_lo >>= shift;
+      value_lo += (value_hi & (radix - 1)) << (32 - shift);
+      value_hi >>= shift;
+    }
+  }
+
+  if (*str_p == '\0')
+  {
+    *--str_p = '0';
+  }
+
+  assert (str_p >= buffer_p && str_p < str_buffer_end);
+
+  return str_p;
+} /* libc_printf_uint_to_string */
+
+/**
+ * printf helper function that prints d and i arguments
+ *
+ * @return updated va_list
+ */
+static void
+libc_printf_write_d_i (FILE *stream, /**< stream pointer */
+                       va_list *args_list_p, /**< args' list */
+                       libc_printf_arg_flags_mask_t flags, /**< field's flags */
+                       libc_printf_arg_length_type_t length, /**< field's length type */
+                       uint32_t width) /**< minimum field width to output */
+{
+  assert ((flags & LIBC_PRINTF_ARG_FLAG_SHARP) == 0);
+
+  bool is_signed = true;
+  uintmax_t value = 0;
+
+  /* true - positive, false - negative */
+  bool sign = true;
+  const size_t bits_in_byte = 8;
+  const uintmax_t value_sign_mask = ((uintmax_t) 1) << (sizeof (value) * bits_in_byte - 1);
+
+  switch (length)
+  {
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_NONE:
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_HH: /* char is promoted to int */
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_H: /* short int is promoted to int */
+    {
+      value = (uintmax_t) va_arg (*args_list_p, int);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_L:
+    {
+      value = (uintmax_t) va_arg (*args_list_p, long int);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_LL:
+    {
+      value = (uintmax_t) va_arg (*args_list_p, long long int);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_J:
+    {
+      value = (uintmax_t) va_arg (*args_list_p, intmax_t);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_Z:
+    {
+      is_signed = false;
+      value = (uintmax_t) va_arg (*args_list_p, size_t);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_T:
+    {
+      is_signed = false;
+      value = (uintmax_t) va_arg (*args_list_p, ptrdiff_t);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_HIGHL:
+    {
+      assert (false && "unsupported length field L");
+    }
+  }
+
+  if (is_signed)
+  {
+    sign = ((value & value_sign_mask) == 0);
+
+    if (!sign)
+    {
+      value = (uintmax_t) (-value);
+    }
+  }
+
+  char str_buffer[ 32 ];
+  char *string_p = libc_printf_uint_to_string (value,
+                                               str_buffer,
+                                               sizeof (str_buffer),
+                                               "0123456789",
+                                               10);
+
+  if (!sign
+      || (flags & LIBC_PRINTF_ARG_FLAG_PRINT_SIGN))
+  {
+    assert (string_p > str_buffer);
+    *--string_p = (sign ? '+' : '-');
+  }
+  else if (flags & LIBC_PRINTF_ARG_FLAG_SPACE)
+  {
+    /* no sign and space flag, printing one space */
+
+    libc_printf_putchar (stream, ' ');
+    if (width > 0)
+    {
+      width--;
+    }
+  }
+
+  libc_printf_justified_string_output (stream,
+                                       string_p,
+                                       width,
+                                       flags & LIBC_PRINTF_ARG_FLAG_LEFT_JUSTIFY,
+                                       flags & LIBC_PRINTF_ARG_FLAG_ZERO_PADDING);
+} /* libc_printf_write_d_i */
+
+/**
+ * printf helper function that prints d and i arguments
+ *
+ * @return updated va_list
+ */
+static void
+libc_printf_write_u_o_x_X (FILE *stream, /**< stream pointer */
+                           char specifier, /**< specifier (u, o, x, X) */
+                           va_list *args_list_p, /**< args' list */
+                           libc_printf_arg_flags_mask_t flags, /**< field's flags */
+                           libc_printf_arg_length_type_t length, /**< field's length type */
+                           uint32_t width) /**< minimum field width to output */
+{
+  uintmax_t value;
+
+  switch (length)
+  {
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_NONE:
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_HH: /* char is promoted to int */
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_H: /* short int is promoted to int */
+    {
+      value = (uintmax_t) va_arg (*args_list_p, unsigned int);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_L:
+    {
+      value = (uintmax_t) va_arg (*args_list_p, unsigned long int);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_LL:
+    {
+      value = (uintmax_t) va_arg (*args_list_p, unsigned long long int);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_J:
+    {
+      value = (uintmax_t) va_arg (*args_list_p, uintmax_t);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_Z:
+    {
+      value = (uintmax_t) va_arg (*args_list_p, size_t);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_T:
+    {
+      value = (uintmax_t) va_arg (*args_list_p, ptrdiff_t);
+      break;
+    }
+
+    case LIBC_PRINTF_ARG_LENGTH_TYPE_HIGHL:
+    {
+      assert (false && "unsupported length field L");
+      return;
+    }
+
+    default:
+    {
+      assert (false && "unexpected length field");
+      return;
+    }
+  }
+
+  if (flags & LIBC_PRINTF_ARG_FLAG_SHARP)
+  {
+    if (value != 0 && specifier != 'u')
+    {
+      libc_printf_putchar (stream, '0');
+
+      if (specifier == 'x')
+      {
+        libc_printf_putchar (stream, 'x');
+      }
+      else if (specifier == 'X')
+      {
+        libc_printf_putchar (stream, 'X');
+      }
+      else
+      {
+        assert (specifier == 'o');
+      }
+    }
+  }
+
+  uint32_t radix;
+  const char *alphabet;
+
+  switch (specifier)
+  {
+    case 'u':
+    {
+      alphabet = "0123456789";
+      radix = 10;
+      break;
+    }
+
+    case 'o':
+    {
+      alphabet = "01234567";
+      radix = 8;
+      break;
+    }
+
+    case 'x':
+    {
+      alphabet = "0123456789abcdef";
+      radix = 16;
+      break;
+    }
+
+    case 'X':
+    {
+      alphabet = "0123456789ABCDEF";
+      radix = 16;
+      break;
+    }
+
+    default:
+    {
+      assert (false && "unexpected type field");
+      return;
+    }
+  }
+
+  char str_buffer[ 32 ];
+  const char *string_p = libc_printf_uint_to_string (value,
+                                                     str_buffer,
+                                                     sizeof (str_buffer),
+                                                     alphabet,
+                                                     radix);
+
+  if (flags & LIBC_PRINTF_ARG_FLAG_PRINT_SIGN)
+  {
+    /* printing sign */
+
+    libc_printf_putchar (stream, '+');
+    if (width > 0)
+    {
+      width--;
+    }
+  }
+  else if (flags & LIBC_PRINTF_ARG_FLAG_SPACE)
+  {
+    /* no sign and space flag, printing one space */
+
+    libc_printf_putchar (stream, ' ');
+    if (width > 0)
+    {
+      width--;
+    }
+  }
+
+  libc_printf_justified_string_output (stream,
+                                       string_p,
+                                       width,
+                                       flags & LIBC_PRINTF_ARG_FLAG_LEFT_JUSTIFY,
+                                       flags & LIBC_PRINTF_ARG_FLAG_ZERO_PADDING);
+} /* libc_printf_write_u_o_x_X */
+
+/**
+ * vfprintf
+ *
+ * @return number of characters printed
+ */
+int
+vfprintf (FILE *stream, /**< stream pointer */
+          const char *format, /**< format string */
+          va_list args) /**< arguments */
+{
+  va_list args_copy;
+
+  va_copy (args_copy, args);
+
+  const char *format_iter_p = format;
+
+  while (*format_iter_p)
+  {
+    if (*format_iter_p != '%')
+    {
+      libc_printf_putchar (stream, *format_iter_p);
+    }
+    else
+    {
+      libc_printf_arg_flags_mask_t flags = 0;
+      uint32_t width = 0;
+      libc_printf_arg_length_type_t length = LIBC_PRINTF_ARG_LENGTH_TYPE_NONE;
+
+      while (true)
+      {
+        format_iter_p++;
+
+        if (*format_iter_p == '-')
+        {
+          flags |= LIBC_PRINTF_ARG_FLAG_LEFT_JUSTIFY;
+        }
+        else if (*format_iter_p == '+')
+        {
+          flags |= LIBC_PRINTF_ARG_FLAG_PRINT_SIGN;
+        }
+        else if (*format_iter_p == ' ')
+        {
+          flags |= LIBC_PRINTF_ARG_FLAG_SPACE;
+        }
+        else if (*format_iter_p == '#')
+        {
+          flags |= LIBC_PRINTF_ARG_FLAG_SHARP;
+        }
+        else if (*format_iter_p == '0')
+        {
+          flags |= LIBC_PRINTF_ARG_FLAG_ZERO_PADDING;
+        }
+        else
+        {
+          break;
+        }
+      }
+
+      if (*format_iter_p == '*')
+      {
+        assert (false && "unsupported width field *");
+      }
+
+      /* If there is a number, recognize it as field width. */
+      while (*format_iter_p >= '0' && *format_iter_p <= '9')
+      {
+        width = width * 10u + (uint32_t) (*format_iter_p - '0');
+
+        format_iter_p++;
+      }
+
+      if (*format_iter_p == '.')
+      {
+        assert (false && "unsupported precision field");
+      }
+
+      switch (*format_iter_p)
+      {
+        case 'h':
+        {
+          format_iter_p++;
+          if (*format_iter_p == 'h')
+          {
+            format_iter_p++;
+
+            length = LIBC_PRINTF_ARG_LENGTH_TYPE_HH;
+          }
+          else
+          {
+            length = LIBC_PRINTF_ARG_LENGTH_TYPE_H;
+          }
+          break;
+        }
+
+        case 'l':
+        {
+          format_iter_p++;
+          if (*format_iter_p == 'l')
+          {
+            format_iter_p++;
+
+            length = LIBC_PRINTF_ARG_LENGTH_TYPE_LL;
+          }
+          else
+          {
+            length = LIBC_PRINTF_ARG_LENGTH_TYPE_L;
+          }
+          break;
+        }
+
+        case 'j':
+        {
+          format_iter_p++;
+          length = LIBC_PRINTF_ARG_LENGTH_TYPE_J;
+          break;
+        }
+
+        case 'z':
+        {
+          format_iter_p++;
+          length = LIBC_PRINTF_ARG_LENGTH_TYPE_Z;
+          break;
+        }
+
+        case 't':
+        {
+          format_iter_p++;
+          length = LIBC_PRINTF_ARG_LENGTH_TYPE_T;
+          break;
+        }
+
+        case 'L':
+        {
+          format_iter_p++;
+          length = LIBC_PRINTF_ARG_LENGTH_TYPE_HIGHL;
+          break;
+        }
+      }
+
+      switch (*format_iter_p)
+      {
+        case 'd':
+        case 'i':
+        {
+          libc_printf_write_d_i (stream, &args_copy, flags, length, width);
+          break;
+        }
+
+        case 'u':
+        case 'o':
+        case 'x':
+        case 'X':
+        {
+          libc_printf_write_u_o_x_X (stream, *format_iter_p, &args_copy, flags, length, width);
+          break;
+        }
+
+        case 'f':
+        case 'F':
+        case 'e':
+        case 'E':
+        case 'g':
+        case 'G':
+        case 'a':
+        case 'A':
+        {
+          assert (false && "unsupported double type field");
+          break;
+        }
+
+        case 'c':
+        {
+          if (length & LIBC_PRINTF_ARG_LENGTH_TYPE_L)
+          {
+            assert (false && "unsupported length field L");
+          }
+          else
+          {
+            char str[2] =
+            {
+              (char) va_arg (args_copy, int), /* char is promoted to int */
+              '\0'
+            };
+
+            libc_printf_justified_string_output (stream,
+                                                 str,
+                                                 width,
+                                                 flags & LIBC_PRINTF_ARG_FLAG_LEFT_JUSTIFY,
+                                                 flags & LIBC_PRINTF_ARG_FLAG_ZERO_PADDING);
+          }
+          break;
+        }
+
+        case 's':
+        {
+          if (length & LIBC_PRINTF_ARG_LENGTH_TYPE_L)
+          {
+            assert (false && "unsupported length field L");
+          }
+          else
+          {
+            char *str_p = va_arg (args_copy, char *);
+
+            libc_printf_justified_string_output (stream,
+                                                 str_p,
+                                                 width,
+                                                 flags & LIBC_PRINTF_ARG_FLAG_LEFT_JUSTIFY,
+                                                 flags & LIBC_PRINTF_ARG_FLAG_ZERO_PADDING);
+          }
+          break;
+        }
+
+        case 'p':
+        {
+          va_list args_copy2;
+          va_copy (args_copy2, args_copy);
+          void *value = va_arg (args_copy2, void *);
+          va_end (args_copy2);
+
+          if (value == NULL)
+          {
+            printf ("(nil)");
+          }
+          else
+          {
+            libc_printf_write_u_o_x_X (stream,
+                                       'x',
+                                       &args_copy,
+                                       flags | LIBC_PRINTF_ARG_FLAG_SHARP,
+                                       LIBC_PRINTF_ARG_LENGTH_TYPE_Z,
+                                       width);
+          }
+          break;
+        }
+
+        case 'n':
+        {
+          assert (false && "unsupported type field n");
+        }
+      }
+    }
+
+    format_iter_p++;
+  }
+
+  va_end (args_copy);
+
+  return 0;
+} /* vfprintf */
+
+/**
+ * fprintf
+ *
+ * @return number of characters printed
+ */
+int
+fprintf (FILE *stream,      /**< stream pointer */
+         const char *format, /**< format string */
+         ...)                /**< parameters' values */
+{
+  va_list args;
+
+  va_start (args, format);
+
+  int ret = vfprintf (stream, format, args);
+
+  va_end (args);
+
+  return ret;
+} /* fprintf */
+
+/**
+ * printf
+ *
+ * @return number of characters printed
+ */
+int
+printf (const char *format, /**< format string */
+        ...)                /**< parameters' values */
+{
+  va_list args;
+
+  va_start (args, format);
+
+  int ret = vfprintf (stdout, format, args);
+
+  va_end (args);
+
+  return ret;
+} /* printf */
+
diff --git a/deps/jerry/jerry-libc/jerry-libc.c b/deps/jerry/jerry-libc/jerry-libc.c
new file mode 100644 (file)
index 0000000..6511950
--- /dev/null
@@ -0,0 +1,356 @@
+/* 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.
+ */
+
+/**
+ * Jerry libc's common functions implementation
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "jerry-libc-defs.h"
+
+/**
+ * State of pseudo-random number generator
+ */
+static uint32_t libc_random_gen_state[4] = { 1455997910, 1999515274, 1234451287, 1949149569 };
+
+/**
+ * Standard file descriptors
+ */
+FILE *stdin  = (FILE *) 0;
+FILE *stdout = (FILE *) 1;
+FILE *stderr = (FILE *) 2;
+
+#ifdef __GNUC__
+/*
+ * Making GCC not to replace:
+ *   - memcpy  -> call to memcpy;
+ *   - memset  -> call to memset;
+ *   - memmove -> call to memmove.
+ */
+#define CALL_PRAGMA(x) _Pragma (#x)
+
+CALL_PRAGMA (GCC diagnostic push)
+CALL_PRAGMA (GCC diagnostic ignored "-Wpragmas")
+CALL_PRAGMA (GCC push_options)
+CALL_PRAGMA (GCC optimize ("-fno-tree-loop-distribute-patterns"))
+#endif /* __GNUC__ */
+
+/**
+ * memset
+ *
+ * @return @a s
+ */
+void * __attr_used___
+memset (void *s,  /**< area to set values in */
+        int c,    /**< value to set */
+        size_t n) /**< area size */
+{
+  uint8_t *area_p = (uint8_t *) s;
+  while (n--)
+  {
+    *area_p++ = (uint8_t) c;
+  }
+
+  return s;
+} /* memset */
+
+/**
+ * memcmp
+ *
+ * @return 0, if areas are equal;
+ *         <0, if first area's content is lexicographically less, than second area's content;
+ *         >0, otherwise
+ */
+int
+memcmp (const void *s1, /**< first area */
+        const void *s2, /**< second area */
+        size_t n) /**< area size */
+{
+  const uint8_t *area1_p = (uint8_t *) s1, *area2_p = (uint8_t *) s2;
+  while (n--)
+  {
+    int diff = ((int) *area1_p++) - ((int) *area2_p++);
+    if (diff)
+    {
+      return diff;
+    }
+  }
+
+  return 0;
+} /* memcmp */
+
+/**
+ * memcpy
+ */
+void *  __attr_used___
+memcpy (void *s1, /**< destination */
+        const void *s2, /**< source */
+        size_t n) /**< bytes number */
+{
+  uint8_t *dst_p = (uint8_t *) s1;
+  const uint8_t *src_p = (const uint8_t *) s2;
+
+  /* Aligned fast case. */
+  if (n >= 4 && !(((uintptr_t) s1) & 0x3) && !(((uintptr_t) s2) & 0x3))
+  {
+    size_t chunks = (n >> 2);
+    uint32_t *u32_dst_p = (uint32_t *) dst_p;
+    const uint32_t *u32_src_p = (const uint32_t *) src_p;
+
+    do
+    {
+      *u32_dst_p++ = *u32_src_p++;
+    }
+    while (--chunks);
+
+    n &= 0x3;
+    dst_p = (uint8_t *) u32_dst_p;
+    src_p = (const uint8_t *) u32_src_p;
+  }
+
+  while (n--)
+  {
+    *dst_p++ = *src_p++;
+  }
+
+  return s1;
+} /* memcpy */
+
+/**
+ * memmove
+ *
+ * @return the dest pointer's value
+ */
+void * __attr_used___
+memmove (void *s1, /**< destination */
+         const void *s2, /**< source */
+         size_t n) /**< bytes number */
+{
+  uint8_t *dest_p;
+  const uint8_t *src_p;
+
+  if (s1 < s2)
+  { /* from begin to end */
+    dest_p = (uint8_t *) s1;
+    src_p = (const uint8_t *) s2;
+
+    while (n--)
+    {
+      *dest_p++ = *src_p++;
+    }
+  }
+  else if (s1 > s2)
+  { /* from end to begin */
+    dest_p = ((uint8_t *) s1) + n - 1;
+    src_p = ((const uint8_t *) s2) + n - 1;
+
+    while (n--)
+    {
+      *dest_p-- = *src_p--;
+    }
+  }
+
+  return s1;
+} /* memmove */
+
+#ifdef __GNUC__
+CALL_PRAGMA (GCC pop_options)
+CALL_PRAGMA (GCC diagnostic pop)
+#endif /* __GNUC__ */
+
+/** Compare two strings. return an integer less than, equal to, or greater than zero
+     if s1 is found, respectively, to be less than, to match, or be greater than s2.  */
+int
+strcmp (const char *s1, const char *s2)
+{
+  while (1)
+  {
+    int c1 = (unsigned char) *s1++;
+    int c2 = (unsigned char) *s2++;
+    int diff = c1 - c2;
+
+    if (!c1 || diff)
+    {
+      return diff;
+    }
+  }
+} /* strcmp */
+
+/** Compare two strings. return an integer less than, equal to, or greater than zero
+     if the first n character of s1 is found, respectively, to be less than, to match,
+     or be greater than the first n character of s2.  */
+int
+strncmp (const char *s1, const char *s2, size_t n)
+{
+  while (n--)
+  {
+    int c1 = (unsigned char) *s1++;
+    int c2 = (unsigned char) *s2++;
+    int diff = c1 - c2;
+
+    if (!c1 || diff)
+    {
+      return diff;
+    }
+  }
+
+  return 0;
+} /* strncmp */
+
+/** Copy a string. At most n bytes of src are copied.  Warning: If there is no
+     null byte among the first n bytes of src, the string placed in dest will not be null-terminated.
+     @return a pointer to the destination string dest.  */
+char * __attr_used___
+strncpy (char *dest, const char *src, size_t n)
+{
+  while (n--)
+  {
+    char c = *src++;
+    *dest++ = c;
+
+    if (!c)
+    {
+      break;
+    }
+  }
+
+  return dest;
+} /* strncpy */
+
+/** Calculate the length of a string.  */
+size_t
+strlen (const char *s)
+{
+  size_t i = 0;
+  while (s[i])
+  {
+    i++;
+  }
+
+  return i;
+} /* strlen */
+
+/**
+ * Generate pseudo-random integer
+ *
+ * Note:
+ *      The function implements George Marsaglia's XorShift random number generator
+ *
+ * @return integer in range [0; RAND_MAX]
+ */
+int
+rand (void)
+{
+  uint32_t intermediate = libc_random_gen_state[0] ^ (libc_random_gen_state[0] << 11);
+  intermediate ^= intermediate >> 8;
+
+  libc_random_gen_state[0] = libc_random_gen_state[1];
+  libc_random_gen_state[1] = libc_random_gen_state[2];
+  libc_random_gen_state[2] = libc_random_gen_state[3];
+
+  libc_random_gen_state[3] ^= libc_random_gen_state[3] >> 19;
+  libc_random_gen_state[3] ^= intermediate;
+
+  return (int) (libc_random_gen_state[3] % (RAND_MAX + 1));
+} /* rand */
+
+/**
+ * Initialize pseudo-random number generator with the specified seed value
+ */
+void
+srand (unsigned int seed) /**< new seed */
+{
+  libc_random_gen_state[0] =
+  libc_random_gen_state[1] =
+  libc_random_gen_state[2] =
+  libc_random_gen_state[3] = seed;
+} /* srand */
+
+/**
+ * Convert a string to a long integer.
+ *
+ * The function first discards leading whitespace characters. Then takes an
+ * optional sign followed by as many digits as possible and interprets them as a
+ * numerical value. Additional characters after those that form the number are
+ * ignored.
+ *
+ * Note:
+ *      If base is not 10, the behaviour is undefined.
+ *      If the value read is out-of-range, the behaviour is undefined.
+ *      The implementation never sets errno.
+ *
+ * @return the integer value of str.
+ */
+long int
+strtol (const char *nptr, /**< string representation of an integer number */
+        char **endptr, /**< [out] the address of the first non-number character */
+        int base) /**< numerical base or radix (MUST be 10) */
+{
+  assert (base == 10);
+  (void) base; /* Unused. */
+
+  const char *str = nptr;
+
+  /* Skip leading whitespaces. */
+  while (*str == ' ' || *str == '\t' || *str == '\r' || *str == '\n')
+  {
+    str++;
+  }
+
+  bool digits = false;
+  bool positive = true;
+  long int num = 0;
+
+  /* Process optional sign. */
+  if (*str == '-')
+  {
+    positive = false;
+    str++;
+  }
+  else if (*str == '+')
+  {
+    str++;
+  }
+
+  /* Process base-10 digits. */
+  while (*str >= '0' && *str <= '9')
+  {
+    num = num * 10 + (*str - '0');
+    digits = true;
+    str++;
+  }
+
+  /* Set endptr and return result*/
+  if (digits)
+  {
+    if (endptr)
+    {
+      *endptr = (char *) str;
+    }
+    return positive ? num : -num;
+  }
+  else
+  {
+    if (endptr)
+    {
+      *endptr = (char *) nptr;
+    }
+    return 0L;
+  }
+} /* strtol */
diff --git a/deps/jerry/jerry-libc/target/posix/jerry-asm.S b/deps/jerry/jerry-libc/target/posix/jerry-asm.S
new file mode 100644 (file)
index 0000000..8722fc1
--- /dev/null
@@ -0,0 +1,91 @@
+/* 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.
+ */
+
+#if defined (__TARGET_HOST_x64)
+#include "arch/x86-64.h"
+#elif defined (__TARGET_HOST_x86)
+#include "arch/x86-32.h"
+#elif defined (__TARGET_HOST_ARMv7)
+#include "arch/arm-v7.h"
+#else /* !__TARGET_HOST_x64 && !__TARGET_HOST_x86 && !__TARGET_HOST_ARMv7 */
+#error "Unsupported architecture"
+#endif /* __TARGET_HOST_x64 */
+
+#if defined (__linux__)
+.macro func _name
+.global \_name
+.type \_name, %function
+\_name:
+.endm
+.macro endfunc _name
+.size \_name, .-\_name
+.endm
+#elif defined (__APPLE__) && defined (__MACH__)
+.macro func _name
+.global \_name
+\_name:
+.endm
+.macro endfunc _name
+.endm
+#else /* !__linux && !(__APPLE__ && __MACH__) */
+#error "Unsupported OS"
+#endif /* __linux__ */
+
+func _start
+  _START
+endfunc _start
+
+func syscall_0
+  SYSCALL_0
+endfunc syscall_0
+
+func syscall_1
+  SYSCALL_1
+endfunc syscall_1
+
+func syscall_2
+  SYSCALL_2
+endfunc syscall_2
+
+func syscall_3
+  SYSCALL_3
+endfunc syscall_3
+
+/**
+ * setjmp (jmp_buf env)
+ *
+ * See also:
+ *          longjmp
+ *
+ * @return 0 - if returns from direct call,
+ *         nonzero - if returns after longjmp.
+ */
+func setjmp
+  _SETJMP
+endfunc setjmp
+
+/**
+ * longjmp (jmp_buf env, int val)
+ *
+ * Note:
+ *      if val is not 0, then it would be returned from setjmp,
+ *      otherwise - 0 would be returned.
+ *
+ * See also:
+ *          setjmp
+ */
+func longjmp
+  _LONGJMP
+endfunc longjmp
diff --git a/deps/jerry/jerry-libc/target/posix/jerry-libc-target.c b/deps/jerry/jerry-libc/target/posix/jerry-libc-target.c
new file mode 100644 (file)
index 0000000..c1cdc75
--- /dev/null
@@ -0,0 +1,319 @@
+/* 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.
+ */
+
+/**
+ * Jerry libc platform-specific functions posix implementation
+ */
+
+#include <assert.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+
+#if defined (__linux__)
+#define SYSCALL_NO(NAME) __NR_ ## NAME
+#elif defined (__APPLE__) && defined (__MACH__)
+#define SYS_exit_group SYS_exit
+#define SYSCALL_NO(NAME) SYS_ ## NAME
+#else /* !__linux && !(__APPLE__ && __MACH__) */
+#error "Unsupported OS"
+#endif /* __linux__ */
+
+#include "jerry-libc-defs.h"
+
+long int syscall_0 (long int syscall_no);
+long int syscall_1 (long int syscall_no, long int arg1);
+long int syscall_2 (long int syscall_no, long int arg1, long int arg2);
+long int syscall_3 (long int syscall_no, long int arg1, long int arg2, long int arg3);
+
+/**
+ * Exit - cause normal process termination with specified status code
+ */
+void __attr_noreturn___ __attr_used___
+exit (int status) /**< status code */
+{
+#ifdef ENABLE_INIT_FINI
+  libc_fini_array ();
+#endif /* ENABLE_INIT_FINI */
+
+  syscall_1 (SYSCALL_NO (close), (long int) stdin);
+  syscall_1 (SYSCALL_NO (close), (long int) stdout);
+  syscall_1 (SYSCALL_NO (close), (long int) stderr);
+
+  syscall_1 (SYSCALL_NO (exit_group), status);
+
+  while (true)
+  {
+    /* unreachable */
+  }
+} /* exit */
+
+/**
+ * Abort current process, producing an abnormal program termination.
+ * The function raises the SIGABRT signal.
+ */
+void __attr_noreturn___ __attr_used___
+abort (void)
+{
+  syscall_1 (SYSCALL_NO (close), (long int) stdin);
+  syscall_1 (SYSCALL_NO (close), (long int) stdout);
+  syscall_1 (SYSCALL_NO (close), (long int) stderr);
+
+  raise (SIGABRT);
+
+  while (true)
+  {
+    /* unreachable */
+  }
+} /* abort */
+
+/**
+ * Send a signal to the current process.
+ */
+int __attr_used___
+raise (int sig)
+{
+  return (int) syscall_2 (SYSCALL_NO (kill), syscall_0 (SYSCALL_NO (getpid)), sig);
+} /* raise */
+
+/**
+ * fopen
+ *
+ * @return FILE pointer - upon successful completion,
+ *         NULL - otherwise
+ */
+FILE *
+fopen (const char *path, /**< file path */
+       const char *mode) /**< file open mode */
+{
+  bool may_read = false;
+  bool may_write = false;
+  bool truncate = false;
+  bool create_if_not_exist = false;
+  bool position_at_end = false;
+
+  assert (path != NULL && mode != NULL);
+  assert (mode[1] == '+' || mode[1] == '\0');
+
+  switch (mode[0])
+  {
+    case 'r':
+    {
+      may_read = true;
+      may_write = (mode[1] == '+');
+      break;
+    }
+    case 'w':
+    {
+      may_write = true;
+      truncate = true;
+      create_if_not_exist = true;
+      may_read = (mode[1] == '+');
+      break;
+    }
+    case 'a':
+    {
+      may_write = true;
+      position_at_end = true;
+      create_if_not_exist = true;
+      if (mode[1] == '+')
+      {
+        assert (false && "unsupported mode a+");
+      }
+      break;
+    }
+    default:
+    {
+      assert (false && "unsupported mode");
+    }
+  }
+
+  int flags = 0;
+  int access = S_IRUSR | S_IWUSR;
+  if (may_read && !may_write)
+  {
+    flags = O_RDONLY;
+  }
+  else if (!may_read && may_write)
+  {
+    flags = O_WRONLY;
+  }
+  else
+  {
+    assert (may_read && may_write);
+
+    flags = O_RDWR;
+  }
+
+  if (truncate)
+  {
+    flags |= O_TRUNC;
+  }
+
+  if (create_if_not_exist)
+  {
+    flags |= O_CREAT;
+  }
+
+  if (position_at_end)
+  {
+    flags |= O_APPEND;
+  }
+
+  long int ret = syscall_3 (SYSCALL_NO (open), (long int) path, flags, access);
+
+  return ((ret < 0) ? NULL : (void *) (uintptr_t) (ret));
+} /* fopen */
+
+/**
+ * fclose
+ *
+ * @return 0 - upon successful completion,
+ *         non-zero value - otherwise.
+ */
+int
+fclose (FILE *fp) /**< stream pointer */
+{
+  syscall_2 (SYSCALL_NO (close), (long int) fp, 0);
+
+  return 0;
+} /* fclose */
+
+/**
+ * fread
+ *
+ * @return number of elements read
+ */
+size_t
+fread (void *ptr, /**< address of buffer to read to */
+       size_t size, /**< size of elements to read */
+       size_t nmemb, /**< number of elements to read */
+       FILE *stream) /**< stream pointer */
+{
+  long int ret;
+  size_t bytes_read = 0;
+
+  if (size == 0)
+  {
+    return 0;
+  }
+
+  do
+  {
+    ret = syscall_3 (SYSCALL_NO (read),
+                     (long int) stream,
+                     (long int) ((uint8_t *) ptr + bytes_read),
+                     (long int) (size * nmemb - bytes_read));
+
+    bytes_read += (size_t) ret;
+  }
+  while (bytes_read != size * nmemb && ret != 0);
+
+  return bytes_read / size;
+} /* fread */
+
+/**
+ * fwrite
+ *
+ * @return number of elements written
+ */
+size_t
+fwrite (const void *ptr, /**< data to write */
+        size_t size, /**< size of elements to write */
+        size_t nmemb, /**< number of elements */
+        FILE *stream) /**< stream pointer */
+{
+  size_t bytes_written = 0;
+
+  if (size == 0)
+  {
+    return 0;
+  }
+
+  do
+  {
+    long int ret = syscall_3 (SYSCALL_NO (write),
+                              (long int) stream,
+                              (long int) ((uint8_t *) ptr + bytes_written),
+                              (long int) (size * nmemb - bytes_written));
+
+    bytes_written += (size_t) ret;
+  }
+  while (bytes_written != size * nmemb);
+
+  return bytes_written / size;
+} /* fwrite */
+
+/**
+ * This function can get the time as well as a timezone.
+ *
+ * @return 0 if success, -1 otherwise
+ */
+int
+gettimeofday (void *tp,  /**< struct timeval */
+              void *tzp) /**< struct timezone */
+{
+  return (int) syscall_2 (SYSCALL_NO (gettimeofday), (long int) tp, (long int) tzp);
+} /* gettimeofday */
+
+/* FIXME */
+#if 0
+/**
+ * Setup new memory limits
+ */
+void
+jrt_set_mem_limits (size_t data_size, /**< limit for data + bss + brk heap */
+                    size_t stack_size) /**< limit for stack */
+{
+  struct
+  {
+    unsigned long long rlim_cur;
+    unsigned long long rlim_max;
+  } data_limit = { data_size, data_size };
+
+  struct
+  {
+    unsigned long long rlim_cur;
+    unsigned long long rlim_max;
+  } stack_limit = { stack_size, stack_size };
+
+  long int ret;
+
+#if defined (__TARGET_HOST_x64)
+  ret = syscall_2 (SYSCALL_NO (setrlimit), RLIMIT_DATA, (intptr_t) &data_limit);
+  assert (ret == 0);
+
+  ret = syscall_2 (SYSCALL_NO (setrlimit), RLIMIT_STACK, (intptr_t) &stack_limit);
+  assert (ret == 0);
+#elif defined (__TARGET_HOST_ARMv7)
+  ret = syscall_3 (SYSCALL_NO (prlimit64), 0, RLIMIT_DATA, (intptr_t) &data_limit);
+  assert (ret == 0);
+
+  ret = syscall_3 (SYSCALL_NO (prlimit64), 0, RLIMIT_STACK, (intptr_t) &stack_limit);
+  assert (ret == 0);
+#elif defined (__TARGET_HOST_x86)
+# error "__TARGET_HOST_x86 case is not implemented"
+#else /* !__TARGET_HOST_x64 && !__TARGET_HOST_ARMv7 && !__TARGET_HOST_x86 */
+# error "!__TARGET_HOST_x64 && !__TARGET_HOST_ARMv7 && !__TARGET_HOST_x86"
+#endif /* __TARGET_HOST_x64 */
+} /* jrt_set_mem_limits */
+#endif /* 0 */
diff --git a/deps/jerry/jerry-libm/CMakeLists.txt b/deps/jerry/jerry-libm/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4a79fe1
--- /dev/null
@@ -0,0 +1,40 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+set(JERRY_LIBM_NAME jerry-libm)
+project (${JERRY_LIBM_NAME} C)
+
+# Compiler / linker flags
+# TODO: Reduce the below list of warning/error disablings as much as possible
+set(COMPILE_FLAGS_LIBM "${COMPILE_FLAGS_LIBM} -Wno-error=sign-compare")
+set(COMPILE_FLAGS_LIBM "${COMPILE_FLAGS_LIBM} -Wno-error=sign-conversion")
+set(COMPILE_FLAGS_LIBM "${COMPILE_FLAGS_LIBM} -Wno-sign-conversion")
+set(COMPILE_FLAGS_LIBM "${COMPILE_FLAGS_LIBM} -Wno-sign-compare")
+set(COMPILE_FLAGS_LIBM "${COMPILE_FLAGS_LIBM} -Wno-strict-aliasing")
+
+# Include directories
+set(INCLUDE_LIBM "${CMAKE_CURRENT_SOURCE_DIR}/include")
+
+# Source directories
+file(GLOB SOURCE_LIBM *.c)
+
+add_library(${JERRY_LIBM_NAME} STATIC ${SOURCE_LIBM})
+set_property(TARGET ${JERRY_LIBM_NAME}
+             PROPERTY COMPILE_FLAGS "${COMPILE_FLAGS_LIBM}")
+
+target_include_directories(${JERRY_LIBM_NAME} PUBLIC ${INCLUDE_LIBM})
+
+install(TARGETS ${JERRY_LIBM_NAME} DESTINATION lib)
+install(DIRECTORY ${INCLUDE_LIBM}/ DESTINATION include/jerry-libm)
diff --git a/deps/jerry/jerry-libm/acos.c b/deps/jerry/jerry-libm/acos.c
new file mode 100644 (file)
index 0000000..d3b688d
--- /dev/null
@@ -0,0 +1,143 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)e_acos.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* acos(x)
+ *
+ * Method:
+ *      acos(x)  = pi/2 - asin(x)
+ *      acos(-x) = pi/2 + asin(x)
+ * For |x|<=0.5
+ *      acos(x) = pi/2 - (x + x*x^2*R(x^2))     (see asin.c)
+ * For x>0.5
+ *      acos(x) = pi/2 - (pi/2 - 2asin(sqrt((1-x)/2)))
+ *              = 2asin(sqrt((1-x)/2))
+ *              = 2s + 2s*z*R(z)        ...z=(1-x)/2, s=sqrt(z)
+ *              = 2f + (2c + 2s*z*R(z))
+ *     where f=hi part of s, and c = (z-f*f)/(s+f) is the correction term
+ *     for f so that f+c ~ sqrt(z).
+ * For x<-0.5
+ *      acos(x) = pi - 2asin(sqrt((1-|x|)/2))
+ *              = pi - 0.5*(s+s*z*R(z)), where z=(1-|x|)/2,s=sqrt(z)
+ *
+ * Special cases:
+ *      if x is NaN, return x itself;
+ *      if |x|>1, return NaN with invalid signal.
+ *
+ * Function needed: sqrt
+ */
+
+#define one      1.00000000000000000000e+00 /* 0x3FF00000, 0x00000000 */
+#define pi       3.14159265358979311600e+00 /* 0x400921FB, 0x54442D18 */
+#define pio2_hi  1.57079632679489655800e+00 /* 0x3FF921FB, 0x54442D18 */
+#define pio2_lo  6.12323399573676603587e-17 /* 0x3C91A626, 0x33145C07 */
+#define pS0      1.66666666666666657415e-01 /* 0x3FC55555, 0x55555555 */
+#define pS1     -3.25565818622400915405e-01 /* 0xBFD4D612, 0x03EB6F7D */
+#define pS2      2.01212532134862925881e-01 /* 0x3FC9C155, 0x0E884455 */
+#define pS3     -4.00555345006794114027e-02 /* 0xBFA48228, 0xB5688F3B */
+#define pS4      7.91534994289814532176e-04 /* 0x3F49EFE0, 0x7501B288 */
+#define pS5      3.47933107596021167570e-05 /* 0x3F023DE1, 0x0DFDF709 */
+#define qS1     -2.40339491173441421878e+00 /* 0xC0033A27, 0x1C8A2D4B */
+#define qS2      2.02094576023350569471e+00 /* 0x40002AE5, 0x9C598AC8 */
+#define qS3     -6.88283971605453293030e-01 /* 0xBFE6066C, 0x1B8D0159 */
+#define qS4      7.70381505559019352791e-02 /* 0x3FB3B8C5, 0xB12E9282 */
+
+double
+acos (double x)
+{
+  double z, p, q, r, w, s, c, df;
+  int hx, ix;
+
+  hx = __HI (x);
+  ix = hx & 0x7fffffff;
+  if (ix >= 0x3ff00000) /* |x| >= 1 */
+  {
+    if (((ix - 0x3ff00000) | __LO (x)) == 0) /* |x| == 1 */
+    {
+      if (hx > 0) /* acos(1) = 0  */
+      {
+        return 0.0;
+      }
+      else /* acos(-1) = pi */
+      {
+        return pi + 2.0 * pio2_lo;
+      }
+    }
+    return (x - x) / (x - x); /* acos(|x|>1) is NaN */
+  }
+  if (ix < 0x3fe00000) /* |x| < 0.5 */
+  {
+    if (ix <= 0x3c600000) /* if |x| < 2**-57 */
+    {
+      return pio2_hi + pio2_lo;
+    }
+    z = x * x;
+    p = z * (pS0 + z * (pS1 + z * (pS2 + z * (pS3 + z * (pS4 + z * pS5)))));
+    q = one + z * (qS1 + z * (qS2 + z * (qS3 + z * qS4)));
+    r = p / q;
+    return pio2_hi - (x - (pio2_lo - x * r));
+  }
+  else if (hx < 0) /* x < -0.5 */
+  {
+    z = (one + x) * 0.5;
+    p = z * (pS0 + z * (pS1 + z * (pS2 + z * (pS3 + z * (pS4 + z * pS5)))));
+    q = one + z * (qS1 + z * (qS2 + z * (qS3 + z * qS4)));
+    s = sqrt (z);
+    r = p / q;
+    w = r * s - pio2_lo;
+    return pi - 2.0 * (s + w);
+  }
+  else /* x > 0.5 */
+  {
+    z = (one - x) * 0.5;
+    s = sqrt (z);
+    df = s;
+    __LO (df) = 0;
+    c = (z - df * df) / (s + df);
+    p = z * (pS0 + z * (pS1 + z * (pS2 + z * (pS3 + z * (pS4 + z * pS5)))));
+    q = one + z * (qS1 + z * (qS2 + z * (qS3 + z * qS4)));
+    r = p / q;
+    w = r * s + c;
+    return 2.0 * (df + w);
+  }
+} /* acos */
+
+#undef one
+#undef pi
+#undef pio2_hi
+#undef pio2_lo
+#undef pS0
+#undef pS1
+#undef pS2
+#undef pS3
+#undef pS4
+#undef pS5
+#undef qS1
+#undef qS2
+#undef qS3
+#undef qS4
diff --git a/deps/jerry/jerry-libm/asin.c b/deps/jerry/jerry-libm/asin.c
new file mode 100644 (file)
index 0000000..3db5e36
--- /dev/null
@@ -0,0 +1,153 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)e_asin.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* asin(x)
+ *
+ * Method:
+ *      Since  asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ...
+ *      we approximate asin(x) on [0,0.5] by
+ *              asin(x) = x + x*x^2*R(x^2)
+ *      where
+ *              R(x^2) is a rational approximation of (asin(x)-x)/x^3
+ *      and its remez error is bounded by
+ *              |(asin(x)-x)/x^3 - R(x^2)| < 2^(-58.75)
+ *
+ *      For x in [0.5,1]
+ *              asin(x) = pi/2-2*asin(sqrt((1-x)/2))
+ *      Let y = (1-x), z = y/2, s := sqrt(z), and pio2_hi+pio2_lo=pi/2;
+ *      then for x>0.98
+ *              asin(x) = pi/2 - 2*(s+s*z*R(z))
+ *                      = pio2_hi - (2*(s+s*z*R(z)) - pio2_lo)
+ *      For x<=0.98, let pio4_hi = pio2_hi/2, then
+ *              f = hi part of s;
+ *              c = sqrt(z) - f = (z-f*f)/(s+f)         ...f+c=sqrt(z)
+ *      and
+ *              asin(x) = pi/2 - 2*(s+s*z*R(z))
+ *                      = pio4_hi+(pio4-2s)-(2s*z*R(z)-pio2_lo)
+ *                      = pio4_hi+(pio4-2f)-(2s*z*R(z)-(pio2_lo+2c))
+ *
+ * Special cases:
+ *      if x is NaN, return x itself;
+ *      if |x|>1, return NaN with invalid signal.
+ */
+
+#define one      1.00000000000000000000e+00 /* 0x3FF00000, 0x00000000 */
+#define huge     1.000e+300
+#define pio2_hi  1.57079632679489655800e+00 /* 0x3FF921FB, 0x54442D18 */
+#define pio2_lo  6.12323399573676603587e-17 /* 0x3C91A626, 0x33145C07 */
+#define pio4_hi  7.85398163397448278999e-01 /* 0x3FE921FB, 0x54442D18 */
+/* coefficient for R(x^2) */
+#define pS0      1.66666666666666657415e-01 /* 0x3FC55555, 0x55555555 */
+#define pS1     -3.25565818622400915405e-01 /* 0xBFD4D612, 0x03EB6F7D */
+#define pS2      2.01212532134862925881e-01 /* 0x3FC9C155, 0x0E884455 */
+#define pS3     -4.00555345006794114027e-02 /* 0xBFA48228, 0xB5688F3B */
+#define pS4      7.91534994289814532176e-04 /* 0x3F49EFE0, 0x7501B288 */
+#define pS5      3.47933107596021167570e-05 /* 0x3F023DE1, 0x0DFDF709 */
+#define qS1     -2.40339491173441421878e+00 /* 0xC0033A27, 0x1C8A2D4B */
+#define qS2      2.02094576023350569471e+00 /* 0x40002AE5, 0x9C598AC8 */
+#define qS3     -6.88283971605453293030e-01 /* 0xBFE6066C, 0x1B8D0159 */
+#define qS4      7.70381505559019352791e-02 /* 0x3FB3B8C5, 0xB12E9282 */
+
+double
+asin (double x)
+{
+  double t, w, p, q, c, r, s;
+  int hx, ix;
+
+  hx = __HI (x);
+  ix = hx & 0x7fffffff;
+  if (ix >= 0x3ff00000) /* |x| >= 1 */
+  {
+    if (((ix - 0x3ff00000) | __LO (x)) == 0) /* asin(1) = +-pi/2 with inexact */
+    {
+      return x * pio2_hi + x * pio2_lo;
+    }
+    return (x - x) / (x - x); /* asin(|x|>1) is NaN */
+  }
+  else if (ix < 0x3fe00000) /* |x| < 0.5 */
+  {
+    if (ix < 0x3e400000) /* if |x| < 2**-27 */
+    {
+      if (huge + x > one) /* return x with inexact if x != 0 */
+      {
+        return x;
+      }
+    }
+    t = x * x;
+    p = t * (pS0 + t * (pS1 + t * (pS2 + t * (pS3 + t * (pS4 + t * pS5)))));
+    q = one + t * (qS1 + t * (qS2 + t * (qS3 + t * qS4)));
+    w = p / q;
+    return x + x * w;
+  }
+  /* 1 > |x| >= 0.5 */
+  w = one - fabs (x);
+  t = w * 0.5;
+  p = t * (pS0 + t * (pS1 + t * (pS2 + t * (pS3 + t * (pS4 + t * pS5)))));
+  q = one + t * (qS1 + t * (qS2 + t * (qS3 + t * qS4)));
+  s = sqrt (t);
+  if (ix >= 0x3FEF3333) /* if |x| > 0.975 */
+  {
+    w = p / q;
+    t = pio2_hi - (2.0 * (s + s * w) - pio2_lo);
+  }
+  else
+  {
+    w = s;
+    __LO (w) = 0;
+    c = (t - w * w) / (s + w);
+    r = p / q;
+    p = 2.0 * s * r - (pio2_lo - 2.0 * c);
+    q = pio4_hi - 2.0 * w;
+    t = pio4_hi - (p - q);
+  }
+  if (hx > 0)
+  {
+    return t;
+  }
+  else
+  {
+    return -t;
+  }
+} /* asin */
+
+#undef one
+#undef huge
+#undef pio2_hi
+#undef pio2_lo
+#undef pio4_hi
+#undef pS0
+#undef pS1
+#undef pS2
+#undef pS3
+#undef pS4
+#undef pS5
+#undef qS1
+#undef qS2
+#undef qS3
+#undef qS4
diff --git a/deps/jerry/jerry-libm/atan.c b/deps/jerry/jerry-libm/atan.c
new file mode 100644 (file)
index 0000000..586b787
--- /dev/null
@@ -0,0 +1,175 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)s_atan.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* atan(x)
+ *
+ * Method:
+ *   1. Reduce x to positive by atan(x) = -atan(-x).
+ *   2. According to the integer k=4t+0.25 chopped, t=x, the argument
+ *      is further reduced to one of the following intervals and the
+ *      arctangent of t is evaluated by the corresponding formula:
+ *
+ *      [0,7/16]      atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...)
+ *      [7/16,11/16]  atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) )
+ *      [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) )
+ *      [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) )
+ *      [39/16,INF]   atan(x) = atan(INF) + atan( -1/t )
+ *
+ * Constants:
+ * The hexadecimal values are the intended ones for the following
+ * constants. The decimal values may be used, provided that the
+ * compiler will convert from decimal to binary accurately enough
+ * to produce the hexadecimal values shown.
+ */
+
+static const double atanhi[] =
+{
+  4.63647609000806093515e-01, /* atan(0.5)hi 0x3FDDAC67, 0x0561BB4F */
+  7.85398163397448278999e-01, /* atan(1.0)hi 0x3FE921FB, 0x54442D18 */
+  9.82793723247329054082e-01, /* atan(1.5)hi 0x3FEF730B, 0xD281F69B */
+  1.57079632679489655800e+00, /* atan(inf)hi 0x3FF921FB, 0x54442D18 */
+};
+
+static const double atanlo[] =
+{
+  2.26987774529616870924e-17, /* atan(0.5)lo 0x3C7A2B7F, 0x222F65E2 */
+  3.06161699786838301793e-17, /* atan(1.0)lo 0x3C81A626, 0x33145C07 */
+  1.39033110312309984516e-17, /* atan(1.5)lo 0x3C700788, 0x7AF0CBBD */
+  6.12323399573676603587e-17, /* atan(inf)lo 0x3C91A626, 0x33145C07 */
+};
+
+#define aT0   3.33333333333329318027e-01 /* 0x3FD55555, 0x5555550D */
+#define aT1  -1.99999999998764832476e-01 /* 0xBFC99999, 0x9998EBC4 */
+#define aT2   1.42857142725034663711e-01 /* 0x3FC24924, 0x920083FF */
+#define aT3  -1.11111104054623557880e-01 /* 0xBFBC71C6, 0xFE231671 */
+#define aT4   9.09088713343650656196e-02 /* 0x3FB745CD, 0xC54C206E */
+#define aT5  -7.69187620504482999495e-02 /* 0xBFB3B0F2, 0xAF749A6D */
+#define aT6   6.66107313738753120669e-02 /* 0x3FB10D66, 0xA0D03D51 */
+#define aT7  -5.83357013379057348645e-02 /* 0xBFADDE2D, 0x52DEFD9A */
+#define aT8   4.97687799461593236017e-02 /* 0x3FA97B4B, 0x24760DEB */
+#define aT9  -3.65315727442169155270e-02 /* 0xBFA2B444, 0x2C6A6C2F */
+#define aT10  1.62858201153657823623e-02 /* 0x3F90AD3A, 0xE322DA11 */
+
+#define one  1.0
+#define huge 1.0e300
+
+double
+atan (double x)
+{
+  double w, s1, s2, z;
+  int ix, hx, id;
+
+  hx = __HI (x);
+  ix = hx & 0x7fffffff;
+  if (ix >= 0x44100000) /* if |x| >= 2^66 */
+  {
+    if (ix > 0x7ff00000 || (ix == 0x7ff00000 && (__LO (x) != 0)))
+    {
+      return x + x; /* NaN */
+    }
+    if (hx > 0)
+    {
+      return atanhi[3] + atanlo[3];
+    }
+    else
+    {
+      return -atanhi[3] - atanlo[3];
+    }
+  }
+  if (ix < 0x3fdc0000) /* |x| < 0.4375 */
+  {
+    if (ix < 0x3e200000) /* |x| < 2^-29 */
+    {
+      if (huge + x > one) /* raise inexact */
+      {
+        return x;
+      }
+    }
+    id = -1;
+  }
+  else
+  {
+    x = fabs (x);
+    if (ix < 0x3ff30000) /* |x| < 1.1875 */
+    {
+      if (ix < 0x3fe60000) /* 7/16 <= |x| < 11/16 */
+      {
+        id = 0;
+        x = (2.0 * x - one) / (2.0 + x);
+      }
+      else /* 11/16 <= |x| < 19/16 */
+      {
+        id = 1;
+        x = (x - one) / (x + one);
+      }
+    }
+    else
+    {
+      if (ix < 0x40038000) /* |x| < 2.4375 */
+      {
+        id = 2;
+        x = (x - 1.5) / (one + 1.5 * x);
+      }
+      else /* 2.4375 <= |x| < 2^66 */
+      {
+        id = 3;
+        x = -1.0 / x;
+      }
+    }
+  }
+  /* end of argument reduction */
+  z = x * x;
+  w = z * z;
+  /* break sum from i=0 to 10 aT[i] z**(i+1) into odd and even poly */
+  s1 = z * (aT0 + w * (aT2 + w * (aT4 + w * (aT6 + w * (aT8 + w * aT10)))));
+  s2 = w * (aT1 + w * (aT3 + w * (aT5 + w * (aT7 + w * aT9))));
+  if (id < 0)
+  {
+    return x - x * (s1 + s2);
+  }
+  else
+  {
+    z = atanhi[id] - ((x * (s1 + s2) - atanlo[id]) - x);
+    return (hx < 0) ? -z : z;
+  }
+} /* atan */
+
+#undef aT0
+#undef aT1
+#undef aT2
+#undef aT3
+#undef aT4
+#undef aT5
+#undef aT6
+#undef aT7
+#undef aT8
+#undef aT9
+#undef aT10
+#undef one
+#undef huge
diff --git a/deps/jerry/jerry-libm/atan2.c b/deps/jerry/jerry-libm/atan2.c
new file mode 100644 (file)
index 0000000..4776415
--- /dev/null
@@ -0,0 +1,209 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)e_atan2.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* atan2(y,x)
+ *
+ * Method:
+ *      1. Reduce y to positive by atan2(y,x)=-atan2(-y,x).
+ *      2. Reduce x to positive by (if x and y are unexceptional):
+ *              ARG (x+iy) = arctan(y/x)           ... if x > 0,
+ *              ARG (x+iy) = pi - arctan[y/(-x)]   ... if x < 0,
+ *
+ * Special cases:
+ *      ATAN2((anything), NaN ) is NaN;
+ *      ATAN2(NAN , (anything) ) is NaN;
+ *      ATAN2(+-0, +(anything but NaN)) is +-0  ;
+ *      ATAN2(+-0, -(anything but NaN)) is +-pi ;
+ *      ATAN2(+-(anything but 0 and NaN), 0) is +-pi/2;
+ *      ATAN2(+-(anything but INF and NaN), +INF) is +-0 ;
+ *      ATAN2(+-(anything but INF and NaN), -INF) is +-pi;
+ *      ATAN2(+-INF,+INF ) is +-pi/4 ;
+ *      ATAN2(+-INF,-INF ) is +-3pi/4;
+ *      ATAN2(+-INF, (anything but,0,NaN, and INF)) is +-pi/2;
+ *
+ * Constants:
+ * The hexadecimal values are the intended ones for the following
+ * constants. The decimal values may be used, provided that the
+ * compiler will convert from decimal to binary accurately enough
+ * to produce the hexadecimal values shown.
+ */
+
+#define tiny   1.0e-300
+#define zero   0.0
+#define pi_o_4 7.8539816339744827900E-01 /* 0x3FE921FB, 0x54442D18 */
+#define pi_o_2 1.5707963267948965580E+00 /* 0x3FF921FB, 0x54442D18 */
+#define pi     3.1415926535897931160E+00 /* 0x400921FB, 0x54442D18 */
+#define pi_lo  1.2246467991473531772E-16 /* 0x3CA1A626, 0x33145C07 */
+
+double
+atan2 (double y, double x)
+{
+  double z;
+  int k, m, hx, hy, ix, iy;
+  unsigned lx, ly;
+
+  hx = __HI (x);
+  ix = hx & 0x7fffffff;
+  lx = __LO (x);
+  hy = __HI (y);
+  iy = hy & 0x7fffffff;
+  ly = __LO (y);
+  if (((ix | ((lx | -lx) >> 31)) > 0x7ff00000) || ((iy | ((ly | -ly) >> 31)) > 0x7ff00000)) /* x or y is NaN */
+  {
+    return x + y;
+  }
+  if (((hx - 0x3ff00000) | lx) == 0) /* x = 1.0 */
+  {
+    return atan (y);
+  }
+  m = ((hy >> 31) & 1) | ((hx >> 30) & 2); /* 2 * sign(x) + sign(y) */
+
+  /* when y = 0 */
+  if ((iy | ly) == 0)
+  {
+    switch (m)
+    {
+      case 0:
+      case 1:
+      {
+        return y; /* atan(+-0,+anything) = +-0 */
+      }
+      case 2:
+      {
+        return pi + tiny; /* atan(+0,-anything) = pi */
+      }
+      case 3:
+      {
+        return -pi - tiny; /* atan(-0,-anything) = -pi */
+      }
+    }
+  }
+  /* when x = 0 */
+  if ((ix | lx) == 0)
+  {
+    return (hy < 0) ? -pi_o_2 - tiny : pi_o_2 + tiny;
+  }
+
+  /* when x is INF */
+  if (ix == 0x7ff00000)
+  {
+    if (iy == 0x7ff00000)
+    {
+      switch (m)
+      {
+        case 0: /* atan(+INF,+INF) */
+        {
+          return pi_o_4 + tiny;
+        }
+        case 1: /* atan(-INF,+INF) */
+        {
+          return -pi_o_4 - tiny;
+        }
+        case 2: /* atan(+INF,-INF) */
+        {
+          return 3.0 * pi_o_4 + tiny;
+        }
+        case 3: /* atan(-INF,-INF) */
+        {
+          return -3.0 * pi_o_4 - tiny;
+        }
+      }
+    }
+    else
+    {
+      switch (m)
+      {
+        case 0: /* atan(+...,+INF) */
+        {
+          return zero;
+        }
+        case 1: /* atan(-...,+INF) */
+        {
+          return -zero;
+        }
+        case 2: /* atan(+...,-INF) */
+        {
+          return pi + tiny;
+        }
+        case 3: /* atan(-...,-INF) */
+        {
+          return -pi - tiny;
+        }
+      }
+    }
+  }
+  /* when y is INF */
+  if (iy == 0x7ff00000)
+  {
+    return (hy < 0) ? -pi_o_2 - tiny : pi_o_2 + tiny;
+  }
+
+  /* compute y / x */
+  k = (iy - ix) >> 20;
+  if (k > 60) /* |y / x| > 2**60 */
+  {
+    z = pi_o_2 + 0.5 * pi_lo;
+  }
+  else if (hx < 0 && k < -60) /* |y| / x < -2**60 */
+  {
+    z = 0.0;
+  }
+  else /* safe to do y / x */
+  {
+    z = atan (fabs (y / x));
+  }
+  switch (m)
+  {
+    case 0: /* atan(+,+) */
+    {
+      return z;
+    }
+    case 1: /* atan(-,+) */
+    {
+      __HI (z) ^= 0x80000000;
+      return z;
+    }
+    case 2: /* atan(+,-) */
+    {
+      return pi - (z - pi_lo);
+    }
+    /* case 3: */
+    default: /* atan(-,-) */
+    {
+      return (z - pi_lo) - pi;
+    }
+  }
+} /* atan2 */
+
+#undef tiny
+#undef zero
+#undef pi_o_4
+#undef pi_o_2
+#undef pi
+#undef pi_lo
diff --git a/deps/jerry/jerry-libm/ceil.c b/deps/jerry/jerry-libm/ceil.c
new file mode 100644 (file)
index 0000000..fda9b2b
--- /dev/null
@@ -0,0 +1,131 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)s_ceil.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* ceil(x)
+ * Return x rounded toward -inf to integral value
+ *
+ * Method:
+ *      Bit twiddling.
+ *
+ * Exception:
+ *      Inexact flag raised if x not equal to ceil(x).
+ */
+
+#define huge 1.0e300
+
+double
+ceil (double x)
+{
+  int i0, i1, j0;
+  unsigned i, j;
+
+  i0 = __HI (x);
+  i1 = __LO (x);
+  j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
+  if (j0 < 20)
+  {
+    if (j0 < 0) /* raise inexact if x != 0 */
+    {
+      if (huge + x > 0.0) /* return 0 * sign(x) if |x| < 1 */
+      {
+        if (i0 < 0)
+        {
+          i0 = 0x80000000;
+          i1 = 0;
+        }
+        else if ((i0 | i1) != 0)
+        {
+          i0 = 0x3ff00000;
+          i1 = 0;
+        }
+      }
+    }
+    else
+    {
+      i = (0x000fffff) >> j0;
+      if (((i0 & i) | i1) == 0) /* x is integral */
+      {
+        return x;
+      }
+      if (huge + x > 0.0) /* raise inexact flag */
+      {
+        if (i0 > 0)
+        {
+          i0 += (0x00100000) >> j0;
+        }
+        i0 &= (~i);
+        i1 = 0;
+      }
+    }
+  }
+  else if (j0 > 51)
+  {
+    if (j0 == 0x400) /* inf or NaN */
+    {
+      return x + x;
+    }
+    else /* x is integral */
+    {
+      return x;
+    }
+  }
+  else
+  {
+    i = ((unsigned) (0xffffffff)) >> (j0 - 20);
+    if ((i1 & i) == 0) /* x is integral */
+    {
+      return x;
+    }
+    if (huge + x > 0.0) /* raise inexact flag */
+    {
+      if (i0 > 0)
+      {
+        if (j0 == 20)
+        {
+          i0 += 1;
+        }
+        else
+        {
+          j = i1 + (1 << (52 - j0));
+          if (j < i1) /* got a carry */
+          {
+            i0 += 1;
+          }
+          i1 = j;
+        }
+      }
+      i1 &= (~i);
+    }
+  }
+  __HI (x) = i0;
+  __LO (x) = i1;
+  return x;
+} /* ceil */
+
+#undef huge
diff --git a/deps/jerry/jerry-libm/copysign.c b/deps/jerry/jerry-libm/copysign.c
new file mode 100644 (file)
index 0000000..48d35f7
--- /dev/null
@@ -0,0 +1,39 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)s_copysign.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* copysign(x,y) returns a value with the magnitude of x and
+ * with the sign bit of y.
+ */
+
+double
+copysign (double x, double y)
+{
+  __HI (x) = (__HI (x) & 0x7fffffff) | (__HI (y) & 0x80000000);
+  return x;
+} /* copysign */
diff --git a/deps/jerry/jerry-libm/exp.c b/deps/jerry/jerry-libm/exp.c
new file mode 100644 (file)
index 0000000..f20d7d5
--- /dev/null
@@ -0,0 +1,218 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)e_exp.c 1.6 04/04/22
+ */
+
+#include "jerry-libm-internal.h"
+
+/* exp(x)
+ * Returns the exponential of x.
+ *
+ * Method:
+ *   1. Argument reduction:
+ *      Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658.
+ *      Given x, find r and integer k such that
+ *
+ *               x = k*ln2 + r,  |r| <= 0.5*ln2.
+ *
+ *      Here r will be represented as r = hi-lo for better
+ *      accuracy.
+ *
+ *   2. Approximation of exp(r) by a special rational function on
+ *      the interval [0,0.34658]:
+ *      Write
+ *          R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ...
+ *      We use a special Remes algorithm on [0,0.34658] to generate
+ *      a polynomial of degree 5 to approximate R. The maximum error
+ *      of this polynomial approximation is bounded by 2**-59. In
+ *      other words,
+ *          R(z) ~ 2.0 + P1*z + P2*z**2 + P3*z**3 + P4*z**4 + P5*z**5
+ *      (where z=r*r, and the values of P1 to P5 are listed below)
+ *      and
+ *          |                  5          |     -59
+ *          | 2.0+P1*z+...+P5*z   -  R(z) | <= 2
+ *          |                             |
+ *      The computation of exp(r) thus becomes
+ *                             2*r
+ *              exp(r) = 1 + -------
+ *                            R - r
+ *                                 r*R1(r)
+ *                     = 1 + r + ----------- (for better accuracy)
+ *                                2 - R1(r)
+ *      where
+ *                               2       4             10
+ *              R1(r) = r - (P1*r  + P2*r  + ... + P5*r   ).
+ *
+ *   3. Scale back to obtain exp(x):
+ *      From step 1, we have
+ *         exp(x) = 2^k * exp(r)
+ *
+ * Special cases:
+ *      exp(INF) is INF, exp(NaN) is NaN;
+ *      exp(-INF) is 0, and
+ *      for finite argument, only exp(0)=1 is exact.
+ *
+ * Accuracy:
+ *      according to an error analysis, the error is always less than
+ *      1 ulp (unit in the last place).
+ *
+ * Misc. info:
+ *      For IEEE double
+ *          if x >  7.09782712893383973096e+02 then exp(x) overflow
+ *          if x < -7.45133219101941108420e+02 then exp(x) underflow
+ *
+ * Constants:
+ * The hexadecimal values are the intended ones for the following
+ * constants. The decimal values may be used, provided that the
+ * compiler will convert from decimal to binary accurately enough
+ * to produce the hexadecimal values shown.
+ */
+
+static const double halF[2] =
+{
+  0.5,
+  -0.5,
+};
+static const double ln2HI[2] =
+{
+  6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */
+  -6.93147180369123816490e-01, /* 0xbfe62e42, 0xfee00000 */
+};
+static const double ln2LO[2] =
+{
+  1.90821492927058770002e-10, /* 0x3dea39ef, 0x35793c76 */
+  -1.90821492927058770002e-10, /* 0xbdea39ef, 0x35793c76 */
+};
+
+#define one          1.0
+#define huge         1.0e+300
+#define twom1000     9.33263618503218878990e-302 /* 2**-1000=0x01700000,0 */
+#define o_threshold  7.09782712893383973096e+02 /* 0x40862E42, 0xFEFA39EF */
+#define u_threshold -7.45133219101941108420e+02 /* 0xc0874910, 0xD52D3051 */
+#define invln2       1.44269504088896338700e+00 /* 0x3ff71547, 0x652b82fe */
+#define P1           1.66666666666666019037e-01 /* 0x3FC55555, 0x5555553E */
+#define P2          -2.77777777770155933842e-03 /* 0xBF66C16C, 0x16BEBD93 */
+#define P3           6.61375632143793436117e-05 /* 0x3F11566A, 0xAF25DE2C */
+#define P4          -1.65339022054652515390e-06 /* 0xBEBBBD41, 0xC5D26BF1 */
+#define P5           4.13813679705723846039e-08 /* 0x3E663769, 0x72BEA4D0 */
+
+double
+exp (double x) /* default IEEE double exp */
+{
+  double y, hi, lo, c, t;
+  int k = 0, xsb;
+  unsigned hx;
+
+  hx = __HI (x); /* high word of x */
+  xsb = (hx >> 31) & 1; /* sign bit of x */
+  hx &= 0x7fffffff; /* high word of |x| */
+
+  /* filter out non-finite argument */
+  if (hx >= 0x40862E42) /* if |x| >= 709.78... */
+  {
+    if (hx >= 0x7ff00000)
+    {
+      if (((hx & 0xfffff) | __LO (x)) != 0) /* NaN */
+      {
+        return x + x;
+      }
+      else /* exp(+-inf) = {inf,0} */
+      {
+        return (xsb == 0) ? x : 0.0;
+      }
+    }
+    if (x > o_threshold) /* overflow */
+    {
+      return huge * huge;
+    }
+    if (x < u_threshold) /* underflow */
+    {
+      return twom1000 * twom1000;
+    }
+  }
+
+  /* argument reduction */
+  if (hx > 0x3fd62e42) /* if  |x| > 0.5 ln2 */
+  {
+    if (hx < 0x3FF0A2B2) /* and |x| < 1.5 ln2 */
+    {
+      hi = x - ln2HI[xsb];
+      lo = ln2LO[xsb];
+      k = 1 - xsb - xsb;
+    }
+    else
+    {
+      k = (int) (invln2 * x + halF[xsb]);
+      t = k;
+      hi = x - t * ln2HI[0]; /* t * ln2HI is exact here */
+      lo = t * ln2LO[0];
+    }
+    x = hi - lo;
+  }
+  else if (hx < 0x3e300000) /* when |x| < 2**-28 */
+  {
+    if (huge + x > one) /* trigger inexact */
+    {
+      return one + x;
+    }
+  }
+  else
+  {
+    k = 0;
+  }
+
+  /* x is now in primary range */
+  t = x * x;
+  c = x - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));
+  if (k == 0)
+  {
+    return one - ((x * c) / (c - 2.0) - x);
+  }
+  else
+  {
+    y = one - ((lo - (x * c) / (2.0 - c)) - hi);
+  }
+  if (k >= -1021)
+  {
+    __HI (y) += (k << 20); /* add k to y's exponent */
+    return y;
+  }
+  else
+  {
+    __HI (y) += ((k + 1000) << 20); /* add k to y's exponent */
+    return y * twom1000;
+  }
+} /* exp */
+
+#undef one
+#undef huge
+#undef twom1000
+#undef o_threshold
+#undef u_threshold
+#undef invln2
+#undef P1
+#undef P2
+#undef P3
+#undef P4
+#undef P5
diff --git a/deps/jerry/jerry-libm/fabs.c b/deps/jerry/jerry-libm/fabs.c
new file mode 100644 (file)
index 0000000..ed20835
--- /dev/null
@@ -0,0 +1,38 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)s_fabs.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* fabs(x) returns the absolute value of x.
+ */
+
+double
+fabs (double x)
+{
+  __HI (x) &= 0x7fffffff;
+  return x;
+} /* fabs */
diff --git a/deps/jerry/jerry-libm/finite.c b/deps/jerry/jerry-libm/finite.c
new file mode 100644 (file)
index 0000000..dfe628e
--- /dev/null
@@ -0,0 +1,41 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)s_finite.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* finite(x) returns 1 is x is finite, else 0;
+ * no branching!
+ */
+
+int
+finite (double x)
+{
+  int hx;
+
+  hx = __HI (x);
+  return (unsigned) ((hx & 0x7fffffff) - 0x7ff00000) >> 31;
+} /* finite */
diff --git a/deps/jerry/jerry-libm/floor.c b/deps/jerry/jerry-libm/floor.c
new file mode 100644 (file)
index 0000000..b279cd0
--- /dev/null
@@ -0,0 +1,130 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)s_floor.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* floor(x)
+ * Return x rounded toward -inf to integral value
+ *
+ * Method:
+ *      Bit twiddling.
+ *
+ * Exception:
+ *      Inexact flag raised if x not equal to floor(x).
+ */
+
+#define huge 1.0e300
+
+double
+floor (double x)
+{
+  int i0, i1, j0;
+  unsigned i, j;
+
+  i0 = __HI (x);
+  i1 = __LO (x);
+  j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
+  if (j0 < 20)
+  {
+    if (j0 < 0) /* raise inexact if x != 0 */
+    {
+      if (huge + x > 0.0) /* return 0 * sign(x) if |x| < 1 */
+      {
+        if (i0 >= 0)
+        {
+          i0 = i1 = 0;
+        }
+        else if (((i0 & 0x7fffffff) | i1) != 0)
+        {
+          i0 = 0xbff00000;
+          i1 = 0;
+        }
+      }
+    }
+    else
+    {
+      i = (0x000fffff) >> j0;
+      if (((i0 & i) | i1) == 0) /* x is integral */
+      {
+        return x;
+      }
+      if (huge + x > 0.0) /* raise inexact flag */
+      {
+        if (i0 < 0)
+        {
+          i0 += (0x00100000) >> j0;
+        }
+        i0 &= (~i);
+        i1 = 0;
+      }
+    }
+  }
+  else if (j0 > 51)
+  {
+    if (j0 == 0x400) /* inf or NaN */
+    {
+      return x + x;
+    }
+    else /* x is integral */
+    {
+      return x;
+    }
+  }
+  else
+  {
+    i = ((unsigned) (0xffffffff)) >> (j0 - 20);
+    if ((i1 & i) == 0) /* x is integral */
+    {
+      return x;
+    }
+    if (huge + x > 0.0) /* raise inexact flag */
+    {
+      if (i0 < 0)
+      {
+        if (j0 == 20)
+        {
+          i0 += 1;
+        }
+        else
+        {
+          j = i1 + (1 << (52 - j0));
+          if (j < i1) /* got a carry */
+          {
+            i0 += 1;
+          }
+          i1 = j;
+        }
+      }
+      i1 &= (~i);
+    }
+  }
+  __HI (x) = i0;
+  __LO (x) = i1;
+  return x;
+} /* floor */
+
+#undef huge
diff --git a/deps/jerry/jerry-libm/fmod.c b/deps/jerry/jerry-libm/fmod.c
new file mode 100644 (file)
index 0000000..bb58bb1
--- /dev/null
@@ -0,0 +1,235 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)e_fmod.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* fmod(x,y)
+ * Return x mod y in exact arithmetic
+ *
+ * Method: shift and subtract
+ */
+
+static const double Zero[] = { 0.0, -0.0, };
+
+#define one 1.0
+
+double
+fmod (double x, double y)
+{
+  int n, hx, hy, hz, ix, iy, sx, i;
+  unsigned lx, ly, lz;
+
+  hx = __HI (x); /* high word of x */
+  lx = __LO (x); /* low  word of x */
+  hy = __HI (y); /* high word of y */
+  ly = __LO (y); /* low  word of y */
+  sx = hx & 0x80000000; /* sign of x */
+  hx ^= sx; /* |x| */
+  hy &= 0x7fffffff; /* |y| */
+
+  /* purge off exception values */
+  if ((hy | ly) == 0 || (hx >= 0x7ff00000) || /* y = 0, or x not finite */
+      ((hy | ((ly | -ly) >> 31)) > 0x7ff00000)) /* or y is NaN */
+  {
+    return (x * y) / (x * y);
+  }
+  if (hx <= hy)
+  {
+    if ((hx < hy) || (lx < ly)) /* |x| < |y| return x */
+    {
+      return x;
+    }
+    if (lx == ly) /* |x| = |y| return x * 0 */
+    {
+      return Zero[(unsigned) sx >> 31];
+    }
+  }
+
+  /* determine ix = ilogb(x) */
+  if (hx < 0x00100000) /* subnormal x */
+  {
+    if (hx == 0)
+    {
+      for (ix = -1043, i = lx; i > 0; i <<= 1)
+      {
+        ix -= 1;
+      }
+    }
+    else
+    {
+      for (ix = -1022, i = (hx << 11); i > 0; i <<= 1)
+      {
+        ix -= 1;
+      }
+    }
+  }
+  else
+  {
+    ix = (hx >> 20) - 1023;
+  }
+
+  /* determine iy = ilogb(y) */
+  if (hy < 0x00100000) /* subnormal y */
+  {
+    if (hy == 0)
+    {
+      for (iy = -1043, i = ly; i > 0; i <<= 1)
+      {
+        iy -= 1;
+      }
+    }
+    else
+    {
+      for (iy = -1022, i = (hy << 11); i > 0; i <<= 1)
+      {
+        iy -= 1;
+      }
+    }
+  }
+  else
+  {
+    iy = (hy >> 20) - 1023;
+  }
+
+  /* set up {hx,lx}, {hy,ly} and align y to x */
+  if (ix >= -1022)
+  {
+    hx = 0x00100000 | (0x000fffff & hx);
+  }
+  else /* subnormal x, shift x to normal */
+  {
+    n = -1022 - ix;
+    if (n <= 31)
+    {
+      hx = (hx << n) | (lx >> (32 - n));
+      lx <<= n;
+    }
+    else
+    {
+      hx = lx << (n - 32);
+      lx = 0;
+    }
+  }
+  if (iy >= -1022)
+  {
+    hy = 0x00100000 | (0x000fffff & hy);
+  }
+  else /* subnormal y, shift y to normal */
+  {
+    n = -1022 - iy;
+    if (n <= 31)
+    {
+      hy = (hy << n) | (ly >> (32 - n));
+      ly <<= n;
+    }
+    else
+    {
+      hy = ly << (n - 32);
+      ly = 0;
+    }
+  }
+
+  /* fix point fmod */
+  n = ix - iy;
+  while (n--)
+  {
+    hz = hx - hy;
+    lz = lx - ly;
+    if (lx < ly)
+    {
+      hz -= 1;
+    }
+    if (hz < 0)
+    {
+      hx = hx + hx + (lx >> 31);
+      lx = lx + lx;
+    }
+    else
+    {
+      if ((hz | lz) == 0) /* return sign(x) * 0 */
+      {
+        return Zero[(unsigned) sx >> 31];
+      }
+      hx = hz + hz + (lz >> 31);
+      lx = lz + lz;
+    }
+  }
+  hz = hx - hy;
+  lz = lx - ly;
+  if (lx < ly)
+  {
+    hz -= 1;
+  }
+  if (hz >= 0)
+  {
+    hx = hz;
+    lx = lz;
+  }
+
+  /* convert back to floating value and restore the sign */
+  if ((hx | lx) == 0) /* return sign(x) * 0 */
+  {
+    return Zero[(unsigned) sx >> 31];
+  }
+  while (hx < 0x00100000) /* normalize x */
+  {
+    hx = hx + hx + (lx >> 31);
+    lx = lx + lx;
+    iy -= 1;
+  }
+  if (iy >= -1022) /* normalize output */
+  {
+    hx = ((hx - 0x00100000) | ((iy + 1023) << 20));
+    __HI (x) = hx | sx;
+    __LO (x) = lx;
+  }
+  else /* subnormal output */
+  {
+    n = -1022 - iy;
+    if (n <= 20)
+    {
+      lx = (lx >> n) | ((unsigned) hx << (32 - n));
+      hx >>= n;
+    }
+    else if (n <= 31)
+    {
+      lx = (hx << (32 - n)) | (lx >> n);
+      hx = sx;
+    }
+    else
+    {
+      lx = hx >> (n - 32);
+      hx = sx;
+    }
+    __HI (x) = hx | sx;
+    __LO (x) = lx;
+    x *= one; /* create necessary signal */
+  }
+  return x; /* exact output */
+} /* fmod */
+
+#undef one
diff --git a/deps/jerry/jerry-libm/include/math.h b/deps/jerry/jerry-libm/include/math.h
new file mode 100644 (file)
index 0000000..496c242
--- /dev/null
@@ -0,0 +1,80 @@
+/* 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.
+ */
+
+#ifndef JERRY_LIBM_MATH_H
+#define JERRY_LIBM_MATH_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/* General Constants. */
+#define INFINITY    (1.0/0.0)
+#define NAN         (0.0/0.0)
+#define HUGE_VAL    INFINITY
+
+#define isnan(x)    ((x) != (x))
+#define isinf(x)    (((x) == INFINITY) || ((x) == -INFINITY))
+#define isfinite(x) (!(isinf(x)) && (x != NAN))
+
+/* Exponential and Logarithmic constants. */
+#define M_E        2.7182818284590452353602874713526625
+#define M_SQRT2    1.4142135623730950488016887242096981
+#define M_SQRT1_2  0.7071067811865475244008443621048490
+#define M_LOG2E    1.4426950408889634073599246810018921
+#define M_LOG10E   0.4342944819032518276511289189166051
+#define M_LN2      0.6931471805599453094172321214581765
+#define M_LN10     2.3025850929940456840179914546843642
+
+/* Trigonometric Constants. */
+#define M_PI       3.1415926535897932384626433832795029
+#define M_PI_2     1.5707963267948966192313216916397514
+#define M_PI_4     0.7853981633974483096156608458198757
+#define M_1_PI     0.3183098861837906715377675267450287
+#define M_2_PI     0.6366197723675813430755350534900574
+#define M_2_SQRTPI 1.1283791670955125738961589031215452
+
+/* Trigonometric functions. */
+double cos (double);
+double sin (double);
+double tan (double);
+double acos (double);
+double asin (double);
+double atan (double);
+double atan2 (double, double);
+
+/* Exponential and logarithmic functions. */
+double exp (double);
+double log (double);
+
+/* Power functions. */
+double pow (double, double);
+double sqrt (double);
+
+/* Rounding and remainder functions. */
+double ceil (double);
+double floor (double);
+
+/* Other functions. */
+double fabs (double);
+double fmod (double, double);
+
+double nextafter (double, double);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRY_LIBM_MATH_H */
diff --git a/deps/jerry/jerry-libm/isnan.c b/deps/jerry/jerry-libm/isnan.c
new file mode 100644 (file)
index 0000000..08b967a
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)s_isnan.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* isnan(x) returns 1 is x is nan, else 0;
+ * no branching!
+ */
+
+int
+isnan (double x)
+{
+  int hx, lx;
+
+  hx = (__HI (x) & 0x7fffffff);
+  lx = __LO (x);
+  hx |= (unsigned) (lx | (-lx)) >> 31;
+  hx = 0x7ff00000 - hx;
+  return ((unsigned) (hx)) >> 31;
+} /* isnan */
diff --git a/deps/jerry/jerry-libm/jerry-libm-internal.h b/deps/jerry/jerry-libm/jerry-libm-internal.h
new file mode 100644 (file)
index 0000000..073fb93
--- /dev/null
@@ -0,0 +1,82 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)fdlibm.h 1.5 04/04/22
+ */
+
+#ifndef JERRY_LIBM_INTERNAL_H
+#define JERRY_LIBM_INTERNAL_H
+
+/* Sometimes it's necessary to define __LITTLE_ENDIAN explicitly
+   but these catch some common cases. */
+
+#if (defined (i386) || defined (__i386) || defined (__i386__) || \
+     defined (i486) || defined (__i486) || defined (__i486__) || \
+     defined (intel) || defined (x86) || defined (i86pc) || \
+     defined (__alpha) || defined (__osf__) || \
+     defined (__x86_64__) || defined (__arm__) || defined (__aarch64__))
+#define __LITTLE_ENDIAN
+#endif
+
+#ifdef __LITTLE_ENDIAN
+#define __HI(x) *(1 + (int *) &x)
+#define __LO(x) *(int *) &x
+#else /* !__LITTLE_ENDIAN */
+#define __HI(x) *(int *) &x
+#define __LO(x) *(1 + (int *) &x)
+#endif /* __LITTLE_ENDIAN */
+
+/*
+ * ANSI/POSIX
+ */
+double acos (double x);
+double asin (double x);
+double atan (double x);
+double atan2 (double y, double x);
+double cos (double x);
+double sin (double x);
+double tan (double x);
+
+double exp (double x);
+double log (double x);
+
+double pow (double x, double y);
+double sqrt (double x);
+
+double ceil (double x);
+double fabs (double x);
+double floor (double x);
+double fmod (double x, double y);
+
+int isnan (double x);
+int finite (double x);
+
+double nextafter (double x, double y);
+
+/*
+ * Functions callable from C, intended to support IEEE arithmetic.
+ */
+double copysign (double x, double y);
+double scalbn (double x, int n);
+
+#endif /* !JERRY_LIBM_INTERNAL_H */
diff --git a/deps/jerry/jerry-libm/log.c b/deps/jerry/jerry-libm/log.c
new file mode 100644 (file)
index 0000000..7c9e569
--- /dev/null
@@ -0,0 +1,198 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)e_log.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* log(x)
+ * Return the logrithm of x
+ *
+ * Method :
+ *   1. Argument Reduction: find k and f such that
+ *                      x = 2^k * (1+f),
+ *         where  sqrt(2)/2 < 1+f < sqrt(2) .
+ *
+ *   2. Approximation of log(1+f).
+ *      Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
+ *               = 2s + 2/3 s**3 + 2/5 s**5 + .....,
+ *               = 2s + s*R
+ *      We use a special Reme algorithm on [0,0.1716] to generate
+ *      a polynomial of degree 14 to approximate R The maximum error
+ *      of this polynomial approximation is bounded by 2**-58.45. In
+ *      other words,
+ *                      2      4      6      8      10      12      14
+ *          R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s  +Lg6*s  +Lg7*s
+ *      (the values of Lg1 to Lg7 are listed in the program)
+ *      and
+ *          |      2          14          |     -58.45
+ *          | Lg1*s +...+Lg7*s    -  R(z) | <= 2
+ *          |                             |
+ *      Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
+ *      In order to guarantee error in log below 1ulp, we compute log
+ *      by
+ *              log(1+f) = f - s*(f - R)                (if f is not too large)
+ *              log(1+f) = f - (hfsq - s*(hfsq+R)).     (better accuracy)
+ *
+ *      3. Finally,  log(x) = k*ln2 + log(1+f).
+ *                          = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
+ *         Here ln2 is split into two floating point number:
+ *                      ln2_hi + ln2_lo,
+ *         where n*ln2_hi is always exact for |n| < 2000.
+ *
+ * Special cases:
+ *      log(x) is NaN with signal if x < 0 (including -INF) ;
+ *      log(+INF) is +INF; log(0) is -INF with signal;
+ *      log(NaN) is that NaN with no signal.
+ *
+ * Accuracy:
+ *      according to an error analysis, the error is always less than
+ *      1 ulp (unit in the last place).
+ *
+ * Constants:
+ * The hexadecimal values are the intended ones for the following
+ * constants. The decimal values may be used, provided that the
+ * compiler will convert from decimal to binary accurately enough
+ * to produce the hexadecimal values shown.
+ */
+
+#define zero   0.0
+#define ln2_hi 6.93147180369123816490e-01 /* 3fe62e42 fee00000 */
+#define ln2_lo 1.90821492927058770002e-10 /* 3dea39ef 35793c76 */
+#define two54  1.80143985094819840000e+16 /* 43500000 00000000 */
+#define Lg1    6.666666666666735130e-01 /* 3FE55555 55555593 */
+#define Lg2    3.999999999940941908e-01 /* 3FD99999 9997FA04 */
+#define Lg3    2.857142874366239149e-01 /* 3FD24924 94229359 */
+#define Lg4    2.222219843214978396e-01 /* 3FCC71C5 1D8E78AF */
+#define Lg5    1.818357216161805012e-01 /* 3FC74664 96CB03DE */
+#define Lg6    1.531383769920937332e-01 /* 3FC39A09 D078C69F */
+#define Lg7    1.479819860511658591e-01 /* 3FC2F112 DF3E5244 */
+
+double
+log (double x)
+{
+  double hfsq, f, s, z, R, w, t1, t2, dk;
+  int k, hx, i, j;
+  unsigned lx;
+
+  hx = __HI (x); /* high word of x */
+  lx = __LO (x); /* low  word of x */
+
+  k = 0;
+  if (hx < 0x00100000) /* x < 2**-1022  */
+  {
+    if (((hx & 0x7fffffff) | lx) == 0) /* log(+-0) = -inf */
+    {
+      return -two54 / zero;
+    }
+    if (hx < 0) /* log(-#) = NaN */
+    {
+      return (x - x) / zero;
+    }
+    k -= 54;
+    x *= two54; /* subnormal number, scale up x */
+    hx = __HI (x); /* high word of x */
+  }
+  if (hx >= 0x7ff00000)
+  {
+    return x + x;
+  }
+  k += (hx >> 20) - 1023;
+  hx &= 0x000fffff;
+  i = (hx + 0x95f64) & 0x100000;
+  __HI (x) = hx | (i ^ 0x3ff00000); /* normalize x or x / 2 */
+  k += (i >> 20);
+  f = x - 1.0;
+  if ((0x000fffff & (2 + hx)) < 3) /* |f| < 2**-20 */
+  {
+    if (f == zero)
+    {
+      if (k == 0)
+      {
+        return zero;
+      }
+      else
+      {
+        dk = (double) k;
+        return dk * ln2_hi + dk * ln2_lo;
+      }
+    }
+    R = f * f * (0.5 - 0.33333333333333333 * f);
+    if (k == 0)
+    {
+      return f - R;
+    }
+    else
+    {
+      dk = (double) k;
+      return dk * ln2_hi - ((R - dk * ln2_lo) - f);
+    }
+  }
+  s = f / (2.0 + f);
+  dk = (double) k;
+  z = s * s;
+  i = hx - 0x6147a;
+  w = z * z;
+  j = 0x6b851 - hx;
+  t1 = w * (Lg2 + w * (Lg4 + w * Lg6));
+  t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));
+  i |= j;
+  R = t2 + t1;
+  if (i > 0)
+  {
+    hfsq = 0.5 * f * f;
+    if (k == 0)
+    {
+      return f - (hfsq - s * (hfsq + R));
+    }
+    else
+    {
+      return dk * ln2_hi - ((hfsq - (s * (hfsq + R) + dk * ln2_lo)) - f);
+    }
+  }
+  else
+  {
+    if (k == 0)
+    {
+      return f - s * (f - R);
+    }
+    else
+    {
+      return dk * ln2_hi - ((s * (f - R) - dk * ln2_lo) - f);
+    }
+  }
+} /* log */
+
+#undef zero
+#undef ln2_hi
+#undef ln2_lo
+#undef two54
+#undef Lg1
+#undef Lg2
+#undef Lg3
+#undef Lg4
+#undef Lg5
+#undef Lg6
+#undef Lg7
diff --git a/deps/jerry/jerry-libm/nextafter.c b/deps/jerry/jerry-libm/nextafter.c
new file mode 100644 (file)
index 0000000..df6f447
--- /dev/null
@@ -0,0 +1,134 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)s_nextafter.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+double
+nextafter (double x,
+           double y)
+{
+  int hx, hy, ix, iy;
+  unsigned lx, ly;
+
+  hx = __HI (x); /* high word of x */
+  lx = __LO (x); /* low  word of x */
+  hy = __HI (y); /* high word of y */
+  ly = __LO (y); /* low  word of y */
+  ix = hx & 0x7fffffff; /* |x| */
+  iy = hy & 0x7fffffff; /* |y| */
+
+  if (((ix >= 0x7ff00000) && ((ix - 0x7ff00000) | lx) != 0)     /* x is nan */
+      || ((iy >= 0x7ff00000) && ((iy - 0x7ff00000) | ly) != 0)) /* y is nan */
+  {
+    return x + y;
+  }
+
+  if (x == y)
+  {
+    return x; /* x=y, return x */
+  }
+
+  if ((ix | lx) == 0)
+  { /* x == 0 */
+    __HI (x) = hy & 0x80000000; /* return +-minsubnormal */
+    __LO (x) = 1;
+    y = x * x;
+    if (y == x)
+    {
+      return y;
+    }
+    else
+    {
+      return x; /* raise underflow flag */
+    }
+  }
+
+  if (hx >= 0)
+  { /* x > 0 */
+    if (hx > hy || ((hx == hy) && (lx > ly)))
+    { /* x > y, x -= ulp */
+      if (lx == 0)
+      {
+        hx -= 1;
+      }
+
+      lx -= 1;
+    }
+    else
+    { /* x < y, x += ulp */
+      lx += 1;
+
+      if (lx == 0)
+      {
+        hx += 1;
+      }
+    }
+  }
+  else
+  { /* x < 0 */
+    if (hy >= 0 || hx > hy || ((hx == hy) && (lx > ly)))
+    { /* x < y, x -= ulp */
+      if (lx == 0)
+      {
+        hx -= 1;
+      }
+
+      lx -= 1;
+    }
+    else
+    { /* x > y, x += ulp */
+      lx += 1;
+
+      if (lx == 0)
+      {
+        hx += 1;
+      }
+    }
+  }
+
+  hy = hx & 0x7ff00000;
+
+  if (hy >= 0x7ff00000)
+  {
+    return x + x; /* overflow */
+  }
+
+  if (hy < 0x00100000)
+  { /* underflow */
+    y = x * x;
+    if (y != x)
+    { /* raise underflow flag */
+      __HI (y) = hx;
+      __LO (y) = lx;
+      return y;
+    }
+  }
+
+  __HI (x) = hx;
+  __LO (x) = lx;
+  return x;
+} /* nextafter */
diff --git a/deps/jerry/jerry-libm/pow.c b/deps/jerry/jerry-libm/pow.c
new file mode 100644 (file)
index 0000000..18f2bc1
--- /dev/null
@@ -0,0 +1,474 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)e_pow.c 1.5 04/04/22
+ */
+
+#include "jerry-libm-internal.h"
+
+/* pow(x,y) return x**y
+ *
+ *                    n
+ * Method:  Let x =  2   * (1+f)
+ *      1. Compute and return log2(x) in two pieces:
+ *              log2(x) = w1 + w2,
+ *         where w1 has 53-24 = 29 bit trailing zeros.
+ *      2. Perform y*log2(x) = n+y' by simulating muti-precision
+ *         arithmetic, where |y'|<=0.5.
+ *      3. Return x**y = 2**n*exp(y'*log2)
+ *
+ * Special cases:
+ *      0.  +1 ** (anything) is 1
+ *      1.  (anything) ** 0  is 1
+ *      2.  (anything) ** 1  is itself
+ *      3.  (anything) ** NAN is NAN
+ *      4.  NAN ** (anything except 0) is NAN
+ *      5.  +-(|x| > 1) **  +INF is +INF
+ *      6.  +-(|x| > 1) **  -INF is +0
+ *      7.  +-(|x| < 1) **  +INF is +0
+ *      8.  +-(|x| < 1) **  -INF is +INF
+ *      9.  -1          ** +-INF is 1
+ *      10. +0 ** (+anything except 0, NAN)               is +0
+ *      11. -0 ** (+anything except 0, NAN, odd integer)  is +0
+ *      12. +0 ** (-anything except 0, NAN)               is +INF
+ *      13. -0 ** (-anything except 0, NAN, odd integer)  is +INF
+ *      14. -0 ** (odd integer) = -( +0 ** (odd integer) )
+ *      15. +INF ** (+anything except 0,NAN) is +INF
+ *      16. +INF ** (-anything except 0,NAN) is +0
+ *      17. -INF ** (anything)  = -0 ** (-anything)
+ *      18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer)
+ *      19. (-anything except 0 and inf) ** (non-integer) is NAN
+ *
+ * Accuracy:
+ *      pow(x,y) returns x**y nearly rounded. In particular
+ *                      pow(integer,integer)
+ *      always returns the correct integer provided it is
+ *      representable.
+ *
+ * Constants:
+ * The hexadecimal values are the intended ones for the following
+ * constants. The decimal values may be used, provided that the
+ * compiler will convert from decimal to binary accurately enough
+ * to produce the hexadecimal values shown.
+ */
+
+static const double bp[] =
+{
+  1.0,
+  1.5,
+};
+static const double dp_h[] =
+{
+  0.0,
+  5.84962487220764160156e-01, /* 0x3FE2B803, 0x40000000 */
+};
+static const double dp_l[] =
+{
+  0.0,
+  1.35003920212974897128e-08, /* 0x3E4CFDEB, 0x43CFD006 */
+};
+
+#define zero     0.0
+#define one      1.0
+#define two      2.0
+#define two53    9007199254740992.0 /* 0x43400000, 0x00000000 */
+#define huge     1.0e300
+#define tiny     1.0e-300
+/* poly coefs for (3/2) * (log(x) - 2s - 2/3 * s**3 */
+#define L1       5.99999999999994648725e-01 /* 0x3FE33333, 0x33333303 */
+#define L2       4.28571428578550184252e-01 /* 0x3FDB6DB6, 0xDB6FABFF */
+#define L3       3.33333329818377432918e-01 /* 0x3FD55555, 0x518F264D */
+#define L4       2.72728123808534006489e-01 /* 0x3FD17460, 0xA91D4101 */
+#define L5       2.30660745775561754067e-01 /* 0x3FCD864A, 0x93C9DB65 */
+#define L6       2.06975017800338417784e-01 /* 0x3FCA7E28, 0x4A454EEF */
+#define P1       1.66666666666666019037e-01 /* 0x3FC55555, 0x5555553E */
+#define P2      -2.77777777770155933842e-03 /* 0xBF66C16C, 0x16BEBD93 */
+#define P3       6.61375632143793436117e-05 /* 0x3F11566A, 0xAF25DE2C */
+#define P4      -1.65339022054652515390e-06 /* 0xBEBBBD41, 0xC5D26BF1 */
+#define P5       4.13813679705723846039e-08 /* 0x3E663769, 0x72BEA4D0 */
+#define lg2      6.93147180559945286227e-01 /* 0x3FE62E42, 0xFEFA39EF */
+#define lg2_h    6.93147182464599609375e-01 /* 0x3FE62E43, 0x00000000 */
+#define lg2_l   -1.90465429995776804525e-09 /* 0xBE205C61, 0x0CA86C39 */
+#define ovt      8.0085662595372944372e-0017 /* -(1024-log2(ovfl+.5ulp)) */
+#define cp       9.61796693925975554329e-01 /* 0x3FEEC709, 0xDC3A03FD = 2 / (3 ln2) */
+#define cp_h     9.61796700954437255859e-01 /* 0x3FEEC709, 0xE0000000 = (float) cp */
+#define cp_l    -7.02846165095275826516e-09 /* 0xBE3E2FE0, 0x145B01F5 = tail of cp_h */
+#define ivln2    1.44269504088896338700e+00 /* 0x3FF71547, 0x652B82FE = 1 / ln2 */
+#define ivln2_h  1.44269502162933349609e+00 /* 0x3FF71547, 0x60000000 = 24b 1 / ln2 */
+#define ivln2_l  1.92596299112661746887e-08 /* 0x3E54AE0B, 0xF85DDF44 = 1 / ln2 tail */
+
+double
+pow (double x, double y)
+{
+  double z, ax, z_h, z_l, p_h, p_l;
+  double y1, t1, t2, r, s, t, u, v, w;
+  int i, j, k, yisint, n;
+  int hx, hy, ix, iy;
+  unsigned lx, ly;
+
+  hx = __HI (x);
+  lx = __LO (x);
+  hy = __HI (y);
+  ly = __LO (y);
+  ix = hx & 0x7fffffff;
+  iy = hy & 0x7fffffff;
+
+  /* x == one: 1**y = 1 */
+  if (((hx - 0x3ff00000) | lx) == 0)
+  {
+    return one;
+  }
+
+  /* y == zero: x**0 = 1 */
+  if ((iy | ly) == 0)
+  {
+    return one;
+  }
+
+  /* +-NaN return x + y */
+  if (ix > 0x7ff00000 || ((ix == 0x7ff00000) && (lx != 0)) || iy > 0x7ff00000 || ((iy == 0x7ff00000) && (ly != 0)))
+  {
+    return x + y;
+  }
+
+  /* determine if y is an odd int when x < 0
+   * yisint = 0 ... y is not an integer
+   * yisint = 1 ... y is an odd int
+   * yisint = 2 ... y is an even int
+   */
+  yisint = 0;
+  if (hx < 0)
+  {
+    if (iy >= 0x43400000) /* even integer y */
+    {
+      yisint = 2;
+    }
+    else if (iy >= 0x3ff00000)
+    {
+      k = (iy >> 20) - 0x3ff; /* exponent */
+      if (k > 20)
+      {
+        j = ly >> (52 - k);
+        if ((j << (52 - k)) == ly)
+        {
+          yisint = 2 - (j & 1);
+        }
+      }
+      else if (ly == 0)
+      {
+        j = iy >> (20 - k);
+        if ((j << (20 - k)) == iy)
+        {
+          yisint = 2 - (j & 1);
+        }
+      }
+    }
+  }
+
+  /* special value of y */
+  if (ly == 0)
+  {
+    if (iy == 0x7ff00000) /* y is +-inf */
+    {
+      if (((ix - 0x3ff00000) | lx) == 0) /* +-1**+-inf is 1 */
+      {
+        return one;
+      }
+      else if (ix >= 0x3ff00000) /* (|x|>1)**+-inf = inf,0 */
+      {
+        return (hy >= 0) ? y : zero;
+      }
+      else /* (|x|<1)**-,+inf = inf,0 */
+      {
+        return (hy < 0) ? -y : zero;
+      }
+    }
+    if (iy == 0x3ff00000) /* y is +-1 */
+    {
+      if (hy < 0)
+      {
+        return one / x;
+      }
+      else
+      {
+        return x;
+      }
+    }
+    if (hy == 0x40000000) /* y is 2 */
+    {
+      return x * x;
+    }
+    if (hy == 0x3fe00000) /* y is 0.5 */
+    {
+      if (hx >= 0) /* x >= +0 */
+      {
+        return sqrt (x);
+      }
+    }
+  }
+
+  ax = fabs (x);
+  /* special value of x */
+  if (lx == 0)
+  {
+    if (ix == 0x7ff00000 || ix == 0 || ix == 0x3ff00000)
+    {
+      z = ax; /* x is +-0,+-inf,+-1 */
+      if (hy < 0)
+      {
+        z = one / z; /* z = (1 / |x|) */
+      }
+      if (hx < 0)
+      {
+        if (((ix - 0x3ff00000) | yisint) == 0)
+        {
+          z = (z - z) / (z - z); /* (-1)**non-int is NaN */
+        }
+        else if (yisint == 1)
+        {
+          z = -z; /* (x<0)**odd = -(|x|**odd) */
+        }
+      }
+      return z;
+    }
+  }
+
+  n = (hx >> 31) + 1;
+
+  /* (x<0)**(non-int) is NaN */
+  if ((n | yisint) == 0)
+  {
+    return (x - x) / (x - x);
+  }
+
+  s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
+  if ((n | (yisint - 1)) == 0)
+  {
+    s = -one; /* (-ve)**(odd int) */
+  }
+
+  /* |y| is huge */
+  if (iy > 0x41e00000) /* if |y| > 2**31 */
+  {
+    if (iy > 0x43f00000) /* if |y| > 2**64, must o/uflow */
+    {
+      if (ix <= 0x3fefffff)
+      {
+        return (hy < 0) ? huge * huge : tiny * tiny;
+      }
+      if (ix >= 0x3ff00000)
+      {
+        return (hy > 0) ? huge * huge : tiny * tiny;
+      }
+    }
+    /* over/underflow if x is not close to one */
+    if (ix < 0x3fefffff)
+    {
+      return (hy < 0) ? s * huge * huge : s * tiny * tiny;
+    }
+    if (ix > 0x3ff00000)
+    {
+      return (hy > 0) ? s * huge * huge : s * tiny * tiny;
+    }
+    /* now |1 - x| is tiny <= 2**-20, suffice to compute
+       log(x) by x - x^2 / 2 + x^3 / 3 - x^4 / 4 */
+    t = ax - one; /* t has 20 trailing zeros */
+    w = (t * t) * (0.5 - t * (0.3333333333333333333333 - t * 0.25));
+    u = ivln2_h * t; /* ivln2_h has 21 sig. bits */
+    v = t * ivln2_l - w * ivln2;
+    t1 = u + v;
+    __LO (t1) = 0;
+    t2 = v - (t1 - u);
+  }
+  else
+  {
+    double ss, s2, s_h, s_l, t_h, t_l;
+
+    n = 0;
+    /* take care subnormal number */
+    if (ix < 0x00100000)
+    {
+      ax *= two53;
+      n -= 53;
+      ix = __HI (ax);
+    }
+    n += ((ix) >> 20) - 0x3ff;
+    j = ix & 0x000fffff;
+    /* determine interval */
+    ix = j | 0x3ff00000; /* normalize ix */
+    if (j <= 0x3988E) /* |x| < sqrt(3/2) */
+    {
+      k = 0;
+    }
+    else if (j < 0xBB67A) /* |x| < sqrt(3) */
+    {
+      k = 1;
+    }
+    else
+    {
+      k = 0;
+      n += 1;
+      ix -= 0x00100000;
+    }
+    __HI (ax) = ix;
+
+    /* compute ss = s_h + s_l = (x - 1) / (x + 1) or (x - 1.5) / (x + 1.5) */
+    u = ax - bp[k]; /* bp[0] = 1.0, bp[1] = 1.5 */
+    v = one / (ax + bp[k]);
+    ss = u * v;
+    s_h = ss;
+    __LO (s_h) = 0;
+    /* t_h = ax + bp[k] High */
+    t_h = zero;
+    __HI (t_h) = ((ix >> 1) | 0x20000000) + 0x00080000 + (k << 18);
+    t_l = ax - (t_h - bp[k]);
+    s_l = v * ((u - s_h * t_h) - s_h * t_l);
+    /* compute log(ax) */
+    s2 = ss * ss;
+    r = s2 * s2 * (L1 + s2 * (L2 + s2 * (L3 + s2 * (L4 + s2 * (L5 + s2 * L6)))));
+    r += s_l * (s_h + ss);
+    s2 = s_h * s_h;
+    t_h = 3.0 + s2 + r;
+    __LO (t_h) = 0;
+    t_l = r - ((t_h - 3.0) - s2);
+    /* u + v = ss * (1 + ...) */
+    u = s_h * t_h;
+    v = s_l * t_h + t_l * ss;
+    /* 2 / (3 * log2) * (ss + ...) */
+    p_h = u + v;
+    __LO (p_h) = 0;
+    p_l = v - (p_h - u);
+    z_h = cp_h * p_h; /* cp_h + cp_l = 2 / (3 * log2) */
+    z_l = cp_l * p_h + p_l * cp + dp_l[k];
+    /* log2(ax) = (ss + ...) * 2 / (3 * log2) = n + dp_h + z_h + z_l */
+    t = (double) n;
+    t1 = (((z_h + z_l) + dp_h[k]) + t);
+    __LO (t1) = 0;
+    t2 = z_l - (((t1 - t) - dp_h[k]) - z_h);
+  }
+
+  /* split up y into y1 + y2 and compute (y1 + y2) * (t1 + t2) */
+  y1 = y;
+  __LO (y1) = 0;
+  p_l = (y - y1) * t1 + y * t2;
+  p_h = y1 * t1;
+  z = p_l + p_h;
+  j = __HI (z);
+  i = __LO (z);
+  if (j >= 0x40900000) /* z >= 1024 */
+  {
+    if (((j - 0x40900000) | i) != 0) /* if z > 1024 */
+    {
+      return s * huge * huge; /* overflow */
+    }
+    else
+    {
+      if (p_l + ovt > z - p_h)
+      {
+        return s * huge * huge; /* overflow */
+      }
+    }
+  }
+  else if ((j & 0x7fffffff) >= 0x4090cc00) /* z <= -1075 */
+  {
+    if (((j - 0xc090cc00) | i) != 0) /* z < -1075 */
+    {
+      return s * tiny * tiny; /* underflow */
+    }
+    else
+    {
+      if (p_l <= z - p_h)
+      {
+        return s * tiny * tiny; /* underflow */
+      }
+    }
+  }
+  /*
+   * compute 2**(p_h + p_l)
+   */
+  i = j & 0x7fffffff;
+  k = (i >> 20) - 0x3ff;
+  n = 0;
+  if (i > 0x3fe00000) /* if |z| > 0.5, set n = [z + 0.5] */
+  {
+    n = j + (0x00100000 >> (k + 1));
+    k = ((n & 0x7fffffff) >> 20) - 0x3ff; /* new k for n */
+    t = zero;
+    __HI (t) = (n & ~(0x000fffff >> k));
+    n = ((n & 0x000fffff) | 0x00100000) >> (20 - k);
+    if (j < 0)
+    {
+      n = -n;
+    }
+    p_h -= t;
+  }
+  t = p_l + p_h;
+  __LO (t) = 0;
+  u = t * lg2_h;
+  v = (p_l - (t - p_h)) * lg2 + t * lg2_l;
+  z = u + v;
+  w = v - (z - u);
+  t = z * z;
+  t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));
+  r = (z * t1) / (t1 - two) - (w + z * w);
+  z = one - (r - z);
+  j = __HI (z);
+  j += (n << 20);
+  if ((j >> 20) <= 0) /* subnormal output */
+  {
+    z = scalbn (z, n);
+  }
+  else
+  {
+    __HI (z) += (n << 20);
+  }
+  return s * z;
+} /* pow */
+
+#undef zero
+#undef one
+#undef two
+#undef two53
+#undef huge
+#undef tiny
+#undef L1
+#undef L2
+#undef L3
+#undef L4
+#undef L5
+#undef L6
+#undef P1
+#undef P2
+#undef P3
+#undef P4
+#undef P5
+#undef lg2
+#undef lg2_h
+#undef lg2_l
+#undef ovt
+#undef cp
+#undef cp_h
+#undef cp_l
+#undef ivln2
+#undef ivln2_h
+#undef ivln2_l
diff --git a/deps/jerry/jerry-libm/scalbn.c b/deps/jerry/jerry-libm/scalbn.c
new file mode 100644 (file)
index 0000000..2ee4f35
--- /dev/null
@@ -0,0 +1,95 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)s_scalbn.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* scalbn(x,n) returns x* 2**n  computed by  exponent
+ * manipulation rather than by actually performing an
+ * exponentiation or a multiplication.
+ */
+
+#define two54  1.80143985094819840000e+16 /* 0x43500000, 0x00000000 */
+#define twom54 5.55111512312578270212e-17 /* 0x3C900000, 0x00000000 */
+#define huge   1.0e+300
+#define tiny   1.0e-300
+
+double
+scalbn (double x, int n)
+{
+  int k, hx, lx;
+
+  hx = __HI (x);
+  lx = __LO (x);
+  k = (hx & 0x7ff00000) >> 20; /* extract exponent */
+  if (k == 0) /* 0 or subnormal x */
+  {
+    if ((lx | (hx & 0x7fffffff)) == 0) /* +-0 */
+    {
+      return x;
+    }
+    x *= two54;
+    hx = __HI (x);
+    k = ((hx & 0x7ff00000) >> 20) - 54;
+    if (n < -50000) /*underflow */
+    {
+      return tiny * x;
+    }
+  }
+  if (k == 0x7ff) /* NaN or Inf */
+  {
+    return x + x;
+  }
+  k = k + n;
+  if (k > 0x7fe) /* overflow  */
+  {
+    return huge * copysign (huge, x);
+  }
+  if (k > 0) /* normal result */
+  {
+    __HI (x) = (hx & 0x800fffff) | (k << 20);
+    return x;
+  }
+  if (k <= -54)
+  {
+    if (n > 50000) /* in case integer overflow in n + k */
+    {
+      return huge * copysign (huge, x); /*overflow */
+    }
+    else
+    {
+      return tiny * copysign (tiny, x); /*underflow */
+    }
+  }
+  k += 54; /* subnormal result */
+  __HI (x) = (hx & 0x800fffff) | (k << 20);
+  return x * twom54;
+} /* scalbn */
+
+#undef two54
+#undef twom54
+#undef huge
+#undef tiny
diff --git a/deps/jerry/jerry-libm/sqrt.c b/deps/jerry/jerry-libm/sqrt.c
new file mode 100644 (file)
index 0000000..4313535
--- /dev/null
@@ -0,0 +1,499 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)e_sqrt.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+/* sqrt(x)
+ * Return correctly rounded sqrt.
+ *
+ *           ------------------------------------------
+ *           |  Use the hardware sqrt if you have one |
+ *           ------------------------------------------
+ *
+ * Method:
+ *   Bit by bit method using integer arithmetic. (Slow, but portable)
+ *   1. Normalization
+ *      Scale x to y in [1,4) with even powers of 2:
+ *      find an integer k such that  1 <= (y=x*2^(2k)) < 4, then
+ *              sqrt(x) = 2^k * sqrt(y)
+ *   2. Bit by bit computation
+ *      Let q  = sqrt(y) truncated to i bit after binary point (q = 1),
+ *           i                                                   0
+ *                                     i+1         2
+ *          s  = 2*q , and      y  =  2   * ( y - q  ).         (1)
+ *           i      i            i                 i
+ *
+ *      To compute q    from q , one checks whether
+ *                  i+1       i
+ *
+ *                            -(i+1) 2
+ *                      (q + 2      ) <= y.                     (2)
+ *                        i
+ *                                                            -(i+1)
+ *      If (2) is false, then q   = q ; otherwise q   = q  + 2      .
+ *                             i+1   i             i+1   i
+ *
+ *      With some algebric manipulation, it is not difficult to see
+ *      that (2) is equivalent to
+ *                             -(i+1)
+ *                      s  +  2       <= y                      (3)
+ *                       i                i
+ *
+ *      The advantage of (3) is that s  and y  can be computed by
+ *                                    i      i
+ *      the following recurrence formula:
+ *          if (3) is false
+ *
+ *          s     =  s  ,       y    = y   ;                    (4)
+ *           i+1      i          i+1    i
+ *
+ *          otherwise,
+ *                         -i                     -(i+1)
+ *          s     =  s  + 2  ,  y    = y  -  s  - 2             (5)
+ *           i+1      i          i+1    i     i
+ *
+ *      One may easily use induction to prove (4) and (5).
+ *      Note. Since the left hand side of (3) contain only i+2 bits,
+ *            it does not necessary to do a full (53-bit) comparison
+ *            in (3).
+ *   3. Final rounding
+ *      After generating the 53 bits result, we compute one more bit.
+ *      Together with the remainder, we can decide whether the
+ *      result is exact, bigger than 1/2ulp, or less than 1/2ulp
+ *      (it will never equal to 1/2ulp).
+ *      The rounding mode can be detected by checking whether
+ *      huge + tiny is equal to huge, and whether huge - tiny is
+ *      equal to huge for some floating point number "huge" and "tiny".
+ *
+ * Special cases:
+ *      sqrt(+-0) = +-0         ... exact
+ *      sqrt(inf) = inf
+ *      sqrt(-ve) = NaN         ... with invalid signal
+ *      sqrt(NaN) = NaN         ... with invalid signal for signaling NaN
+ *
+ * Other methods: see the appended file at the end of the program below.
+ */
+
+#define one  1.0
+#define tiny 1.0e-300
+
+double
+sqrt (double x)
+{
+  double z;
+  int sign = (int) 0x80000000;
+  unsigned r, t1, s1, ix1, q1;
+  int ix0, s0, q, m, t, i;
+
+  ix0 = __HI (x); /* high word of x */
+  ix1 = __LO (x); /* low word of x */
+
+  /* take care of Inf and NaN */
+  if ((ix0 & 0x7ff00000) == 0x7ff00000)
+  {
+    return x * x + x; /* sqrt(NaN) = NaN, sqrt(+inf) = +inf, sqrt(-inf) = sNaN */
+  }
+  /* take care of zero */
+  if (ix0 <= 0)
+  {
+    if (((ix0 & (~sign)) | ix1) == 0) /* sqrt(+-0) = +-0 */
+    {
+      return x;
+    }
+    else if (ix0 < 0) /* sqrt(-ve) = sNaN */
+    {
+      return (x - x) / (x - x);
+    }
+  }
+  /* normalize x */
+  m = (ix0 >> 20);
+  if (m == 0) /* subnormal x */
+  {
+    while (ix0 == 0)
+    {
+      m -= 21;
+      ix0 |= (ix1 >> 11);
+      ix1 <<= 21;
+    }
+    for (i = 0; (ix0 & 0x00100000) == 0; i++)
+    {
+      ix0 <<= 1;
+    }
+    m -= i - 1;
+    ix0 |= (ix1 >> (32 - i));
+    ix1 <<= i;
+  }
+  m -= 1023; /* unbias exponent */
+  ix0 = (ix0 & 0x000fffff) | 0x00100000;
+  if (m & 1) /* odd m, double x to make it even */
+  {
+    ix0 += ix0 + ((ix1 & sign) >> 31);
+    ix1 += ix1;
+  }
+  m >>= 1; /* m = [m / 2] */
+
+  /* generate sqrt(x) bit by bit */
+  ix0 += ix0 + ((ix1 & sign) >> 31);
+  ix1 += ix1;
+  q = q1 = s0 = s1 = 0; /* [q,q1] = sqrt(x) */
+  r = 0x00200000; /* r = moving bit from right to left */
+
+  while (r != 0)
+  {
+    t = s0 + r;
+    if (t <= ix0)
+    {
+      s0 = t + r;
+      ix0 -= t;
+      q += r;
+    }
+    ix0 += ix0 + ((ix1 & sign) >> 31);
+    ix1 += ix1;
+    r >>= 1;
+  }
+
+  r = sign;
+  while (r != 0)
+  {
+    t1 = s1 + r;
+    t = s0;
+    if ((t < ix0) || ((t == ix0) && (t1 <= ix1)))
+    {
+      s1 = t1 + r;
+      if (((t1 & sign) == sign) && (s1 & sign) == 0)
+      {
+        s0 += 1;
+      }
+      ix0 -= t;
+      if (ix1 < t1)
+      {
+        ix0 -= 1;
+      }
+      ix1 -= t1;
+      q1 += r;
+    }
+    ix0 += ix0 + ((ix1 & sign) >> 31);
+    ix1 += ix1;
+    r >>= 1;
+  }
+
+  /* use floating add to find out rounding direction */
+  if ((ix0 | ix1) != 0)
+  {
+    z = one - tiny; /* trigger inexact flag */
+    if (z >= one)
+    {
+      z = one + tiny;
+      if (q1 == (unsigned) 0xffffffff)
+      {
+        q1 = 0;
+        q += 1;
+      }
+      else if (z > one)
+      {
+        if (q1 == (unsigned) 0xfffffffe)
+        {
+          q += 1;
+        }
+        q1 += 2;
+      }
+      else
+      {
+        q1 += (q1 & 1);
+      }
+    }
+  }
+  ix0 = (q >> 1) + 0x3fe00000;
+  ix1 = q1 >> 1;
+  if ((q & 1) == 1)
+  {
+    ix1 |= sign;
+  }
+  ix0 += (m << 20);
+  __HI (z) = ix0;
+  __LO (z) = ix1;
+  return z;
+} /* sqrt */
+
+#undef one
+#undef tiny
+
+/*
+Other methods  (use floating-point arithmetic)
+-------------
+(This is a copy of a drafted paper by Prof W. Kahan
+and K.C. Ng, written in May, 1986)
+
+        Two algorithms are given here to implement sqrt(x)
+        (IEEE double precision arithmetic) in software.
+        Both supply sqrt(x) correctly rounded. The first algorithm (in
+        Section A) uses newton iterations and involves four divisions.
+        The second one uses reciproot iterations to avoid division, but
+        requires more multiplications. Both algorithms need the ability
+        to chop results of arithmetic operations instead of round them,
+        and the INEXACT flag to indicate when an arithmetic operation
+        is executed exactly with no roundoff error, all part of the
+        standard (IEEE 754-1985). The ability to perform shift, add,
+        subtract and logical AND operations upon 32-bit words is needed
+        too, though not part of the standard.
+
+A.  sqrt(x) by Newton Iteration
+
+   (1)  Initial approximation
+
+        Let x0 and x1 be the leading and the trailing 32-bit words of
+        a floating point number x (in IEEE double format) respectively
+
+            1    11                  52                           ...widths
+           ------------------------------------------------------
+        x: |s|    e     |             f                         |
+           ------------------------------------------------------
+              msb    lsb  msb                                 lsb ...order
+
+
+             ------------------------        ------------------------
+        x0:  |s|   e    |    f1     |    x1: |          f2           |
+             ------------------------        ------------------------
+
+        By performing shifts and subtracts on x0 and x1 (both regarded
+        as integers), we obtain an 8-bit approximation of sqrt(x) as
+        follows.
+
+                k  := (x0>>1) + 0x1ff80000;
+                y0 := k - T1[31&(k>>15)].       ... y ~ sqrt(x) to 8 bits
+        Here k is a 32-bit integer and T1[] is an integer array containing
+        correction terms. Now magically the floating value of y (y's
+        leading 32-bit word is y0, the value of its trailing word is 0)
+        approximates sqrt(x) to almost 8-bit.
+
+        Value of T1:
+        static int T1[32]= {
+        0,      1024,   3062,   5746,   9193,   13348,  18162,  23592,
+        29598,  36145,  43202,  50740,  58733,  67158,  75992,  85215,
+        83599,  71378,  60428,  50647,  41945,  34246,  27478,  21581,
+        16499,  12183,  8588,   5674,   3403,   1742,   661,    130,};
+
+    (2) Iterative refinement
+
+        Apply Heron's rule three times to y, we have y approximates
+        sqrt(x) to within 1 ulp (Unit in the Last Place):
+
+                y := (y+x/y)/2          ... almost 17 sig. bits
+                y := (y+x/y)/2          ... almost 35 sig. bits
+                y := y-(y-x/y)/2        ... within 1 ulp
+
+
+        Remark 1.
+            Another way to improve y to within 1 ulp is:
+
+                y := (y+x/y)            ... almost 17 sig. bits to 2*sqrt(x)
+                y := y - 0x00100006     ... almost 18 sig. bits to sqrt(x)
+
+                                2
+                            (x-y )*y
+                y := y + 2* ----------  ...within 1 ulp
+                               2
+                             3y  + x
+
+
+        This formula has one division fewer than the one above; however,
+        it requires more multiplications and additions. Also x must be
+        scaled in advance to avoid spurious overflow in evaluating the
+        expression 3y*y+x. Hence it is not recommended uless division
+        is slow. If division is very slow, then one should use the
+        reciproot algorithm given in section B.
+
+    (3) Final adjustment
+
+        By twiddling y's last bit it is possible to force y to be
+        correctly rounded according to the prevailing rounding mode
+        as follows. Let r and i be copies of the rounding mode and
+        inexact flag before entering the square root program. Also we
+        use the expression y+-ulp for the next representable floating
+        numbers (up and down) of y. Note that y+-ulp = either fixed
+        point y+-1, or multiply y by nextafter(1,+-inf) in chopped
+        mode.
+
+        I := FALSE;     ... reset INEXACT flag I
+        R := RZ;        ... set rounding mode to round-toward-zero
+                z := x/y;       ... chopped quotient, possibly inexact
+                If(not I) then {        ... if the quotient is exact
+                    if(z=y) {
+                        I := i;  ... restore inexact flag
+                        R := r;  ... restore rounded mode
+                        return sqrt(x):=y.
+                    } else {
+                        z := z - ulp;   ... special rounding
+                    }
+                }
+                i := TRUE;              ... sqrt(x) is inexact
+                If (r=RN) then z=z+ulp  ... rounded-to-nearest
+                If (r=RP) then {        ... round-toward-+inf
+                    y = y+ulp; z=z+ulp;
+                }
+                y := y+z;               ... chopped sum
+                y0:=y0-0x00100000;      ... y := y/2 is correctly rounded.
+                I := i;                 ... restore inexact flag
+                R := r;                 ... restore rounded mode
+                return sqrt(x):=y.
+
+    (4) Special cases
+
+        Square root of +inf, +-0, or NaN is itself;
+        Square root of a negative number is NaN with invalid signal.
+
+
+B.  sqrt(x) by Reciproot Iteration
+
+   (1)  Initial approximation
+
+        Let x0 and x1 be the leading and the trailing 32-bit words of
+        a floating point number x (in IEEE double format) respectively
+        (see section A). By performing shifs and subtracts on x0 and y0,
+        we obtain a 7.8-bit approximation of 1/sqrt(x) as follows.
+
+            k := 0x5fe80000 - (x0>>1);
+            y0:= k - T2[63&(k>>14)].    ... y ~ 1/sqrt(x) to 7.8 bits
+
+        Here k is a 32-bit integer and T2[] is an integer array
+        containing correction terms. Now magically the floating
+        value of y (y's leading 32-bit word is y0, the value of
+        its trailing word y1 is set to zero) approximates 1/sqrt(x)
+        to almost 7.8-bit.
+
+        Value of T2:
+        static int T2[64]= {
+        0x1500, 0x2ef8, 0x4d67, 0x6b02, 0x87be, 0xa395, 0xbe7a, 0xd866,
+        0xf14a, 0x1091b,0x11fcd,0x13552,0x14999,0x15c98,0x16e34,0x17e5f,
+        0x18d03,0x19a01,0x1a545,0x1ae8a,0x1b5c4,0x1bb01,0x1bfde,0x1c28d,
+        0x1c2de,0x1c0db,0x1ba73,0x1b11c,0x1a4b5,0x1953d,0x18266,0x16be0,
+        0x1683e,0x179d8,0x18a4d,0x19992,0x1a789,0x1b445,0x1bf61,0x1c989,
+        0x1d16d,0x1d77b,0x1dddf,0x1e2ad,0x1e5bf,0x1e6e8,0x1e654,0x1e3cd,
+        0x1df2a,0x1d635,0x1cb16,0x1be2c,0x1ae4e,0x19bde,0x1868e,0x16e2e,
+        0x1527f,0x1334a,0x11051,0xe951, 0xbe01, 0x8e0d, 0x5924, 0x1edd,};
+
+    (2) Iterative refinement
+
+        Apply Reciproot iteration three times to y and multiply the
+        result by x to get an approximation z that matches sqrt(x)
+        to about 1 ulp. To be exact, we will have
+                -1ulp < sqrt(x)-z<1.0625ulp.
+
+        ... set rounding mode to Round-to-nearest
+           y := y*(1.5-0.5*x*y*y)       ... almost 15 sig. bits to 1/sqrt(x)
+           y := y*((1.5-2^-30)+0.5*x*y*y)... about 29 sig. bits to 1/sqrt(x)
+        ... special arrangement for better accuracy
+           z := x*y                     ... 29 bits to sqrt(x), with z*y<1
+           z := z + 0.5*z*(1-z*y)       ... about 1 ulp to sqrt(x)
+
+        Remark 2. The constant 1.5-2^-30 is chosen to bias the error so that
+        (a) the term z*y in the final iteration is always less than 1;
+        (b) the error in the final result is biased upward so that
+                -1 ulp < sqrt(x) - z < 1.0625 ulp
+            instead of |sqrt(x)-z|<1.03125ulp.
+
+    (3) Final adjustment
+
+        By twiddling y's last bit it is possible to force y to be
+        correctly rounded according to the prevailing rounding mode
+        as follows. Let r and i be copies of the rounding mode and
+        inexact flag before entering the square root program. Also we
+        use the expression y+-ulp for the next representable floating
+        numbers (up and down) of y. Note that y+-ulp = either fixed
+        point y+-1, or multiply y by nextafter(1,+-inf) in chopped
+        mode.
+
+        R := RZ;                ... set rounding mode to round-toward-zero
+        switch(r) {
+            case RN:            ... round-to-nearest
+               if(x<= z*(z-ulp)...chopped) z = z - ulp; else
+               if(x<= z*(z+ulp)...chopped) z = z; else z = z+ulp;
+               break;
+            case RZ:case RM:    ... round-to-zero or round-to--inf
+               R:=RP;           ... reset rounding mod to round-to-+inf
+               if(x<z*z ... rounded up) z = z - ulp; else
+               if(x>=(z+ulp)*(z+ulp) ...rounded up) z = z+ulp;
+               break;
+            case RP:            ... round-to-+inf
+               if(x>(z+ulp)*(z+ulp)...chopped) z = z+2*ulp; else
+               if(x>z*z ...chopped) z = z+ulp;
+               break;
+        }
+
+        Remark 3. The above comparisons can be done in fixed point. For
+        example, to compare x and w=z*z chopped, it suffices to compare
+        x1 and w1 (the trailing parts of x and w), regarding them as
+        two's complement integers.
+
+        ...Is z an exact square root?
+        To determine whether z is an exact square root of x, let z1 be the
+        trailing part of z, and also let x0 and x1 be the leading and
+        trailing parts of x.
+
+        If ((z1&0x03ffffff)!=0) ... not exact if trailing 26 bits of z!=0
+            I := 1;             ... Raise Inexact flag: z is not exact
+        else {
+            j := 1 - [(x0>>20)&1]       ... j = logb(x) mod 2
+            k := z1 >> 26;              ... get z's 25-th and 26-th
+                                            fraction bits
+            I := i or (k&j) or ((k&(j+j+1))!=(x1&3));
+        }
+        R:= r           ... restore rounded mode
+        return sqrt(x):=z.
+
+        If multiplication is cheaper then the foregoing red tape, the
+        Inexact flag can be evaluated by
+
+            I := i;
+            I := (z*z!=x) or I.
+
+        Note that z*z can overwrite I; this value must be sensed if it is
+        True.
+
+        Remark 4. If z*z = x exactly, then bit 25 to bit 0 of z1 must be
+        zero.
+
+                    --------------------
+                z1: |        f2        |
+                    --------------------
+                bit 31             bit 0
+
+        Further more, bit 27 and 26 of z1, bit 0 and 1 of x1, and the odd
+        or even of logb(x) have the following relations:
+
+        -------------------------------------------------
+        bit 27,26 of z1         bit 1,0 of x1   logb(x)
+        -------------------------------------------------
+        00                      00              odd and even
+        01                      01              even
+        10                      10              odd
+        10                      00              even
+        11                      01              even
+        -------------------------------------------------
+
+    (4) Special cases (see (4) of Section A).
+ */
diff --git a/deps/jerry/jerry-libm/trig.c b/deps/jerry/jerry-libm/trig.c
new file mode 100644 (file)
index 0000000..dd2440d
--- /dev/null
@@ -0,0 +1,1096 @@
+/* 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.
+ *
+ * This file is based on work under the following copyright and permission
+ * notice:
+ *
+ *     Copyright (C) 1993, 2004 by Sun Microsystems, Inc. All rights reserved.
+ *
+ *     Developed at SunSoft, a Sun Microsystems, Inc. business.
+ *     Permission to use, copy, modify, and distribute this
+ *     software is freely granted, provided that this notice
+ *     is preserved.
+ *
+ *     @(#)k_rem_pio2.c 1.3 95/01/18
+ *     @(#)e_rem_pio2.c 1.4 95/01/18
+ *     @(#)k_sin.c 1.3 95/01/18
+ *     @(#)k_cos.c 1.3 95/01/18
+ *     @(#)k_tan.c 1.5 04/04/22
+ *     @(#)s_sin.c 1.3 95/01/18
+ *     @(#)s_cos.c 1.3 95/01/18
+ *     @(#)s_tan.c 1.3 95/01/18
+ */
+
+#include "jerry-libm-internal.h"
+
+#define zero    0.00000000000000000000e+00 /* 0x00000000, 0x00000000 */
+#define half    5.00000000000000000000e-01 /* 0x3FE00000, 0x00000000 */
+#define one     1.00000000000000000000e+00 /* 0x3FF00000, 0x00000000 */
+#define two24   1.67772160000000000000e+07 /* 0x41700000, 0x00000000 */
+#define twon24  5.96046447753906250000e-08 /* 0x3E700000, 0x00000000 */
+
+/* __kernel_rem_pio2(x,y,e0,nx,prec)
+ * double x[],y[]; int e0,nx,prec;
+ *
+ * __kernel_rem_pio2 return the last three digits of N with
+ *              y = x - N*pi/2
+ * so that |y| < pi/2.
+ *
+ * The method is to compute the integer (mod 8) and fraction parts of
+ * (2/pi)*x without doing the full multiplication. In general we
+ * skip the part of the product that are known to be a huge integer (
+ * more accurately, = 0 mod 8 ). Thus the number of operations are
+ * independent of the exponent of the input.
+ *
+ * (2/pi) is represented by an array of 24-bit integers in ipio2[].
+ *
+ * Input parameters:
+ *      x[]     The input value (must be positive) is broken into nx
+ *              pieces of 24-bit integers in double precision format.
+ *              x[i] will be the i-th 24 bit of x. The scaled exponent
+ *              of x[0] is given in input parameter e0 (i.e., x[0]*2^e0
+ *              match x's up to 24 bits.
+ *
+ *              Example of breaking a double positive z into x[0]+x[1]+x[2]:
+ *                      e0 = ilogb(z)-23
+ *                      z  = scalbn(z,-e0)
+ *              for i = 0,1,2
+ *                      x[i] = floor(z)
+ *                      z    = (z-x[i])*2**24
+ *
+ *      y[]     ouput result in an array of double precision numbers.
+ *              The dimension of y[] is:
+ *                      24-bit  precision       1
+ *                      53-bit  precision       2
+ *                      64-bit  precision       2
+ *                      113-bit precision       3
+ *              The actual value is the sum of them. Thus for 113-bit
+ *              precison, one may have to do something like:
+ *
+ *              long double t,w,r_head, r_tail;
+ *              t = (long double)y[2] + (long double)y[1];
+ *              w = (long double)y[0];
+ *              r_head = t+w;
+ *              r_tail = w - (r_head - t);
+ *
+ *      e0      The exponent of x[0]
+ *
+ *      nx      dimension of x[]
+ *
+ *      prec    an integer indicating the precision:
+ *                      0       24  bits (single)
+ *                      1       53  bits (double)
+ *                      2       64  bits (extended)
+ *                      3       113 bits (quad)
+ *
+ * External function:
+ *      double scalbn(), floor();
+ *
+ * Here is the description of some local variables:
+ *
+ *      ipio2[] integer array, contains the (24*i)-th to (24*i+23)-th
+ *              bit of 2/pi after binary point. The corresponding
+ *              floating value is
+ *
+ *                      ipio2[i] * 2^(-24(i+1)).
+ *
+ *      jk      jk+1 is the initial number of terms of ipio2[] needed
+ *              in the computation. The recommended value is 2,3,4,
+ *              6 for single, double, extended,and quad.
+ *
+ *      jz      local integer variable indicating the number of
+ *              terms of ipio2[] used.
+ *
+ *      jx      nx - 1
+ *
+ *      jv      index for pointing to the suitable ipio2[] for the
+ *              computation. In general, we want
+ *                      ( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8
+ *              is an integer. Thus
+ *                      e0-3-24*jv >= 0 or (e0-3)/24 >= jv
+ *              Hence jv = max(0,(e0-3)/24).
+ *
+ *      jp      jp+1 is the number of terms in PIo2[] needed, jp = jk.
+ *
+ *      q[]     double array with integral value, representing the
+ *              24-bits chunk of the product of x and 2/pi.
+ *
+ *      q0      the corresponding exponent of q[0]. Note that the
+ *              exponent for q[i] would be q0-24*i.
+ *
+ *      PIo2[]  double precision array, obtained by cutting pi/2
+ *              into 24 bits chunks.
+ *
+ *      f[]     ipio2[] in floating point
+ *
+ *      iq[]    integer array by breaking up q[] in 24-bits chunk.
+ *
+ *      fq[]    final product of x*(2/pi) in fq[0],..,fq[jk]
+ *
+ *      ih      integer. If >0 it indicates q[] is >= 0.5, hence
+ *              it also indicates the *sign* of the result.
+ */
+
+/*
+ * Constants:
+ * The hexadecimal values are the intended ones for the following
+ * constants. The decimal values may be used, provided that the
+ * compiler will convert from decimal to binary accurately enough
+ * to produce the hexadecimal values shown.
+ */
+
+/* initial value for jk */
+static const int init_jk[] =
+{
+  2, 3, 4, 6
+};
+
+static const double PIo2[] =
+{
+  1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */
+  7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */
+  5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */
+  3.28200341580791294123e-22, /* 0x3B78CC51, 0x60000000 */
+  1.27065575308067607349e-29, /* 0x39F01B83, 0x80000000 */
+  1.22933308981111328932e-36, /* 0x387A2520, 0x40000000 */
+  2.73370053816464559624e-44, /* 0x36E38222, 0x80000000 */
+  2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */
+};
+
+/*
+ * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
+ */
+static const int ipio2[] =
+{
+  0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62,
+  0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A,
+  0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129,
+  0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41,
+  0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8,
+  0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF,
+  0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5,
+  0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08,
+  0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3,
+  0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880,
+  0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B,
+};
+
+static int
+__kernel_rem_pio2 (double *x, double *y, int e0, int nx, int prec)
+{
+  int jz, jx, jv, jp, jk, carry, n, iq[20], i, j, k, m, q0, ih;
+  double z, fw, f[20], fq[20], q[20];
+
+  /* initialize jk */
+  jk = init_jk[prec];
+  jp = jk;
+
+  /* determine jx, jv, q0, note that 3 > q0 */
+  jx = nx - 1;
+  jv = (e0 - 3) / 24;
+  if (jv < 0)
+  {
+    jv = 0;
+  }
+  q0 = e0 - 24 * (jv + 1);
+
+  /* set up f[0] to f[jx + jk] where f[jx + jk] = ipio2[jv + jk] */
+  j = jv - jx;
+  m = jx + jk;
+  for (i = 0; i <= m; i++, j++)
+  {
+    f[i] = (j < 0) ? zero : (double) ipio2[j];
+  }
+
+  /* compute q[0], q[1], ... q[jk] */
+  for (i = 0; i <= jk; i++)
+  {
+    for (j = 0, fw = 0.0; j <= jx; j++)
+    {
+      fw += x[j] * f[jx + i - j];
+    }
+    q[i] = fw;
+  }
+
+  jz = jk;
+recompute:
+  /* distill q[] into iq[] reversingly */
+  for (i = 0, j = jz, z = q[jz]; j > 0; i++, j--)
+  {
+    fw = (double) ((int) (twon24 * z));
+    iq[i] = (int) (z - two24 * fw);
+    z = q[j - 1] + fw;
+  }
+
+  /* compute n */
+  z = scalbn (z, q0); /* actual value of z */
+  z -= 8.0 * floor (z * 0.125); /* trim off integer >= 8 */
+  n = (int) z;
+  z -= (double) n;
+  ih = 0;
+  if (q0 > 0) /* need iq[jz - 1] to determine n */
+  {
+    i = (iq[jz - 1] >> (24 - q0));
+    n += i;
+    iq[jz - 1] -= i << (24 - q0);
+    ih = iq[jz - 1] >> (23 - q0);
+  }
+  else if (q0 == 0)
+  {
+    ih = iq[jz - 1] >> 23;
+  }
+  else if (z >= 0.5)
+  {
+    ih = 2;
+  }
+
+  if (ih > 0) /* q > 0.5 */
+  {
+    n += 1;
+    carry = 0;
+    for (i = 0; i < jz; i++) /* compute 1 - q */
+    {
+      j = iq[i];
+      if (carry == 0)
+      {
+        if (j != 0)
+        {
+          carry = 1;
+          iq[i] = 0x1000000 - j;
+        }
+      }
+      else
+      {
+        iq[i] = 0xffffff - j;
+      }
+    }
+    if (q0 > 0) /* rare case: chance is 1 in 12 */
+    {
+      switch (q0)
+      {
+        case 1:
+        {
+          iq[jz - 1] &= 0x7fffff;
+          break;
+        }
+        case 2:
+        {
+          iq[jz - 1] &= 0x3fffff;
+          break;
+        }
+      }
+    }
+    if (ih == 2)
+    {
+      z = one - z;
+      if (carry != 0)
+      {
+        z -= scalbn (one, q0);
+      }
+    }
+  }
+
+  /* check if recomputation is needed */
+  if (z == zero)
+  {
+    j = 0;
+    for (i = jz - 1; i >= jk; i--)
+    {
+      j |= iq[i];
+    }
+    if (j == 0) /* need recomputation */
+    {
+      for (k = 1; iq[jk - k] == 0; k++) /* k = no. of terms needed */
+      {
+      }
+
+      for (i = jz + 1; i <= jz + k; i++) /* add q[jz + 1] to q[jz + k] */
+      {
+        f[jx + i] = (double) ipio2[jv + i];
+        for (j = 0, fw = 0.0; j <= jx; j++)
+        {
+          fw += x[j] * f[jx + i - j];
+        }
+        q[i] = fw;
+      }
+      jz += k;
+      goto recompute;
+    }
+  }
+
+  /* chop off zero terms */
+  if (z == 0.0)
+  {
+    jz -= 1;
+    q0 -= 24;
+    while (iq[jz] == 0)
+    {
+      jz--;
+      q0 -= 24;
+    }
+  }
+  else
+  { /* break z into 24-bit if necessary */
+    z = scalbn (z, -q0);
+    if (z >= two24)
+    {
+      fw = (double) ((int) (twon24 * z));
+      iq[jz] = (int) (z - two24 * fw);
+      jz += 1;
+      q0 += 24;
+      iq[jz] = (int) fw;
+    }
+    else
+    {
+      iq[jz] = (int) z;
+    }
+  }
+
+  /* convert integer "bit" chunk to floating-point value */
+  fw = scalbn (one, q0);
+  for (i = jz; i >= 0; i--)
+  {
+    q[i] = fw * (double) iq[i];
+    fw *= twon24;
+  }
+
+  /* compute PIo2[0, ..., jp] * q[jz, ..., 0] */
+  for (i = jz; i >= 0; i--)
+  {
+    for (fw = 0.0, k = 0; k <= jp && k <= jz - i; k++)
+    {
+      fw += PIo2[k] * q[i + k];
+    }
+    fq[jz - i] = fw;
+  }
+
+  /* compress fq[] into y[] */
+  switch (prec)
+  {
+    case 0:
+    {
+      fw = 0.0;
+      for (i = jz; i >= 0; i--)
+      {
+        fw += fq[i];
+      }
+      y[0] = (ih == 0) ? fw : -fw;
+      break;
+    }
+    case 1:
+    case 2:
+    {
+      fw = 0.0;
+      for (i = jz; i >= 0; i--)
+      {
+        fw += fq[i];
+      }
+      y[0] = (ih == 0) ? fw : -fw;
+      fw = fq[0] - fw;
+      for (i = 1; i <= jz; i++)
+      {
+        fw += fq[i];
+      }
+      y[1] = (ih == 0) ? fw : -fw;
+      break;
+    }
+    case 3: /* painful */
+    {
+      for (i = jz; i > 0; i--)
+      {
+        fw = fq[i - 1] + fq[i];
+        fq[i] += fq[i - 1] - fw;
+        fq[i - 1] = fw;
+      }
+      for (i = jz; i > 1; i--)
+      {
+        fw = fq[i - 1] + fq[i];
+        fq[i] += fq[i - 1] - fw;
+        fq[i - 1] = fw;
+      }
+      for (fw = 0.0, i = jz; i >= 2; i--)
+      {
+        fw += fq[i];
+      }
+      if (ih == 0)
+      {
+        y[0] = fq[0];
+        y[1] = fq[1];
+        y[2] = fw;
+      }
+      else
+      {
+        y[0] = -fq[0];
+        y[1] = -fq[1];
+        y[2] = -fw;
+      }
+    }
+  }
+  return n & 7;
+} /* __kernel_rem_pio2 */
+
+/* __ieee754_rem_pio2(x,y)
+ * return the remainder of x rem pi/2 in y[0]+y[1]
+ * use __kernel_rem_pio2()
+ */
+
+static const int npio2_hw[] =
+{
+  0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C,
+  0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C,
+  0x40346B9C, 0x4035FDBB, 0x40378FDB, 0x403921FB, 0x403AB41B, 0x403C463A,
+  0x403DD85A, 0x403F6A7A, 0x40407E4C, 0x4041475C, 0x4042106C, 0x4042D97C,
+  0x4043A28C, 0x40446B9C, 0x404534AC, 0x4045FDBB, 0x4046C6CB, 0x40478FDB,
+  0x404858EB, 0x404921FB,
+};
+
+/*
+ * invpio2:  53 bits of 2/pi
+ * pio2_1:   first  33 bit of pi/2
+ * pio2_1t:  pi/2 - pio2_1
+ * pio2_2:   second 33 bit of pi/2
+ * pio2_2t:  pi/2 - (pio2_1 + pio2_2)
+ * pio2_3:   third  33 bit of pi/2
+ * pio2_3t:  pi/2 - (pio2_1 + pio2_2 + pio2_3)
+ */
+#define invpio2 6.36619772367581382433e-01 /* 0x3FE45F30, 0x6DC9C883 */
+#define pio2_1  1.57079632673412561417e+00 /* 0x3FF921FB, 0x54400000 */
+#define pio2_1t 6.07710050650619224932e-11 /* 0x3DD0B461, 0x1A626331 */
+#define pio2_2  6.07710050630396597660e-11 /* 0x3DD0B461, 0x1A600000 */
+#define pio2_2t 2.02226624879595063154e-21 /* 0x3BA3198A, 0x2E037073 */
+#define pio2_3  2.02226624871116645580e-21 /* 0x3BA3198A, 0x2E000000 */
+#define pio2_3t 8.47842766036889956997e-32 /* 0x397B839A, 0x252049C1 */
+
+static int
+__ieee754_rem_pio2 (double x, double *y)
+{
+  double z, w, t, r, fn;
+  double tx[3];
+  int e0, i, j, nx, n, ix, hx;
+
+  hx = __HI (x); /* high word of x */
+  ix = hx & 0x7fffffff;
+  if (ix <= 0x3fe921fb) /* |x| ~<= pi/4 , no need for reduction */
+  {
+    y[0] = x;
+    y[1] = 0;
+    return 0;
+  }
+  if (ix < 0x4002d97c) /* |x| < 3pi/4, special case with n = +-1 */
+  {
+    if (hx > 0)
+    {
+      z = x - pio2_1;
+      if (ix != 0x3ff921fb) /* 33 + 53 bit pi is good enough */
+      {
+        y[0] = z - pio2_1t;
+        y[1] = (z - y[0]) - pio2_1t;
+      }
+      else /* near pi/2, use 33 + 33 + 53 bit pi */
+      {
+        z -= pio2_2;
+        y[0] = z - pio2_2t;
+        y[1] = (z - y[0]) - pio2_2t;
+      }
+      return 1;
+    }
+    else /* negative x */
+    {
+      z = x + pio2_1;
+      if (ix != 0x3ff921fb) /* 33 + 53 bit pi is good enough */
+      {
+        y[0] = z + pio2_1t;
+        y[1] = (z - y[0]) + pio2_1t;
+      }
+      else /* near pi/2, use 33 + 33 + 53 bit pi */
+      {
+        z += pio2_2;
+        y[0] = z + pio2_2t;
+        y[1] = (z - y[0]) + pio2_2t;
+      }
+      return -1;
+    }
+  }
+  if (ix <= 0x413921fb) /* |x| ~<= 2^19 * (pi/2), medium size */
+  {
+    t = fabs (x);
+    n = (int) (t * invpio2 + half);
+    fn = (double) n;
+    r = t - fn * pio2_1;
+    w = fn * pio2_1t; /* 1st round good to 85 bit */
+    if (n < 32 && ix != npio2_hw[n - 1])
+    {
+      y[0] = r - w; /* quick check no cancellation */
+    }
+    else
+    {
+      j = ix >> 20;
+      y[0] = r - w;
+      i = j - (((__HI (y[0])) >> 20) & 0x7ff);
+      if (i > 16) /* 2nd iteration needed, good to 118 */
+      {
+        t = r;
+        w = fn * pio2_2;
+        r = t - w;
+        w = fn * pio2_2t - ((t - r) - w);
+        y[0] = r - w;
+        i = j - (((__HI (y[0])) >> 20) & 0x7ff);
+        if (i > 49) /* 3rd iteration need, 151 bits acc, will cover all possible cases */
+        {
+          t = r;
+          w = fn * pio2_3;
+          r = t - w;
+          w = fn * pio2_3t - ((t - r) - w);
+          y[0] = r - w;
+        }
+      }
+    }
+    y[1] = (r - y[0]) - w;
+    if (hx < 0)
+    {
+      y[0] = -y[0];
+      y[1] = -y[1];
+      return -n;
+    }
+    else
+    {
+      return n;
+    }
+  }
+  /*
+   * all other (large) arguments
+   */
+  if (ix >= 0x7ff00000) /* x is inf or NaN */
+  {
+    y[0] = y[1] = x - x;
+    return 0;
+  }
+  /* set z = scalbn(|x|, ilogb(x) - 23) */
+  __LO (z) = __LO (x);
+  e0 = (ix >> 20) - 1046; /* e0 = ilogb(z) - 23; */
+  __HI (z) = ix - (e0 << 20);
+  for (i = 0; i < 2; i++)
+  {
+    tx[i] = (double) ((int) (z));
+    z = (z - tx[i]) * two24;
+  }
+  tx[2] = z;
+  nx = 3;
+  while (tx[nx - 1] == zero) /* skip zero term */
+  {
+    nx--;
+  }
+  n = __kernel_rem_pio2 (tx, y, e0, nx, 2);
+  if (hx < 0)
+  {
+    y[0] = -y[0];
+    y[1] = -y[1];
+    return -n;
+  }
+  return n;
+} /* __ieee754_rem_pio2 */
+
+/* __kernel_sin( x, y, iy)
+ * kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854
+ * Input x is assumed to be bounded by ~pi/4 in magnitude.
+ * Input y is the tail of x.
+ * Input iy indicates whether y is 0. (if iy=0, y assume to be 0).
+ *
+ * Algorithm
+ *      1. Since sin(-x) = -sin(x), we need only to consider positive x.
+ *      2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0.
+ *      3. sin(x) is approximated by a polynomial of degree 13 on
+ *         [0,pi/4]
+ *                               3            13
+ *              sin(x) ~ x + S1*x + ... + S6*x
+ *         where
+ *
+ *      |sin(x)         2     4     6     8     10     12  |     -58
+ *      |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x  +S6*x   )| <= 2
+ *      |  x                                               |
+ *
+ *      4. sin(x+y) = sin(x) + sin'(x')*y
+ *                  ~ sin(x) + (1-x*x/2)*y
+ *         For better accuracy, let
+ *                   3      2      2      2      2
+ *              r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6))))
+ *         then                   3    2
+ *              sin(x) = x + (S1*x + (x *(r-y/2)+y))
+ */
+
+#define S1   -1.66666666666666324348e-01 /* 0xBFC55555, 0x55555549 */
+#define S2    8.33333333332248946124e-03 /* 0x3F811111, 0x1110F8A6 */
+#define S3   -1.98412698298579493134e-04 /* 0xBF2A01A0, 0x19C161D5 */
+#define S4    2.75573137070700676789e-06 /* 0x3EC71DE3, 0x57B1FE7D */
+#define S5   -2.50507602534068634195e-08 /* 0xBE5AE5E6, 0x8A2B9CEB */
+#define S6    1.58969099521155010221e-10 /* 0x3DE5D93A, 0x5ACFD57C */
+
+static double
+__kernel_sin (double x, double y, int iy)
+{
+  double z, r, v;
+  int ix;
+
+  ix = __HI (x) & 0x7fffffff; /* high word of x */
+  if (ix < 0x3e400000) /* |x| < 2**-27 */
+  {
+    if ((int) x == 0)
+    {
+      return x; /* generate inexact */
+    }
+  }
+  z = x * x;
+  v = z * x;
+  r = S2 + z * (S3 + z * (S4 + z * (S5 + z * S6)));
+  if (iy == 0)
+  {
+    return x + v * (S1 + z * r);
+  }
+  else
+  {
+    return x - ((z * (half * y - v * r) - y) - v * S1);
+  }
+} /* __kernel_sin */
+
+/*
+ * __kernel_cos( x,  y )
+ * kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164
+ * Input x is assumed to be bounded by ~pi/4 in magnitude.
+ * Input y is the tail of x.
+ *
+ * Algorithm
+ *      1. Since cos(-x) = cos(x), we need only to consider positive x.
+ *      2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0.
+ *      3. cos(x) is approximated by a polynomial of degree 14 on
+ *         [0,pi/4]
+ *                                       4            14
+ *              cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x
+ *         where the remez error is
+ *
+ *      |              2     4     6     8     10    12     14 |     -58
+ *      |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x  +C6*x  )| <= 2
+ *      |                                                      |
+ *
+ *                     4     6     8     10    12     14
+ *      4. let r = C1*x +C2*x +C3*x +C4*x +C5*x  +C6*x  , then
+ *             cos(x) = 1 - x*x/2 + r
+ *         since cos(x+y) ~ cos(x) - sin(x)*y
+ *                        ~ cos(x) - x*y,
+ *         a correction term is necessary in cos(x) and hence
+ *              cos(x+y) = 1 - (x*x/2 - (r - x*y))
+ *         For better accuracy when x > 0.3, let qx = |x|/4 with
+ *         the last 32 bits mask off, and if x > 0.78125, let qx = 0.28125.
+ *         Then
+ *              cos(x+y) = (1-qx) - ((x*x/2-qx) - (r-x*y)).
+ *         Note that 1-qx and (x*x/2-qx) is EXACT here, and the
+ *         magnitude of the latter is at least a quarter of x*x/2,
+ *         thus, reducing the rounding error in the subtraction.
+ */
+
+#define C1   4.16666666666666019037e-02 /* 0x3FA55555, 0x5555554C */
+#define C2  -1.38888888888741095749e-03 /* 0xBF56C16C, 0x16C15177 */
+#define C3   2.48015872894767294178e-05 /* 0x3EFA01A0, 0x19CB1590 */
+#define C4  -2.75573143513906633035e-07 /* 0xBE927E4F, 0x809C52AD */
+#define C5   2.08757232129817482790e-09 /* 0x3E21EE9E, 0xBDB4B1C4 */
+#define C6  -1.13596475577881948265e-11 /* 0xBDA8FAE9, 0xBE8838D4 */
+
+static double
+__kernel_cos (double x, double y)
+{
+  double a, hz, z, r, qx;
+  int ix;
+
+  ix = __HI (x) & 0x7fffffff; /* ix = |x|'s high word */
+  if (ix < 0x3e400000) /* if x < 2**27 */
+  {
+    if (((int) x) == 0)
+    {
+      return one; /* generate inexact */
+    }
+  }
+  z = x * x;
+  r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * C6)))));
+  if (ix < 0x3FD33333) /* if |x| < 0.3 */
+  {
+    return one - (0.5 * z - (z * r - x * y));
+  }
+  else
+  {
+    if (ix > 0x3fe90000) /* x > 0.78125 */
+    {
+      qx = 0.28125;
+    }
+    else
+    {
+      __HI (qx) = ix - 0x00200000; /* x / 4 */
+      __LO (qx) = 0;
+    }
+    hz = 0.5 * z - qx;
+    a = one - qx;
+    return a - (hz - (z * r - x * y));
+  }
+} /* __kernel_cos */
+
+/* __kernel_tan( x, y, k )
+ * kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854
+ * Input x is assumed to be bounded by ~pi/4 in magnitude.
+ * Input y is the tail of x.
+ * Input k indicates whether tan (if k = 1) or -1/tan (if k = -1) is returned.
+ *
+ * Algorithm
+ *      1. Since tan(-x) = -tan(x), we need only to consider positive x.
+ *      2. if x < 2^-28 (hx<0x3e300000 0), return x with inexact if x!=0.
+ *      3. tan(x) is approximated by a odd polynomial of degree 27 on
+ *         [0,0.67434]
+ *                               3             27
+ *              tan(x) ~ x + T1*x + ... + T13*x
+ *         where
+ *
+ *              |tan(x)         2     4            26   |     -59.2
+ *              |----- - (1+T1*x +T2*x +.... +T13*x    )| <= 2
+ *              |  x                                    |
+ *
+ *         Note: tan(x+y) = tan(x) + tan'(x)*y
+ *                        ~ tan(x) + (1+x*x)*y
+ *         Therefore, for better accuracy in computing tan(x+y), let
+ *                   3      2      2       2       2
+ *              r = x *(T2+x *(T3+x *(...+x *(T12+x *T13))))
+ *         then
+ *                                  3    2
+ *              tan(x+y) = x + (T1*x + (x *(r+y)+y))
+ *
+ *      4. For x in [0.67434,pi/4],  let y = pi/4 - x, then
+ *              tan(x) = tan(pi/4-y) = (1-tan(y))/(1+tan(y))
+ *                     = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y)))
+ */
+
+#define T0      3.33333333333334091986e-01 /* 3FD55555, 55555563 */
+#define T1      1.33333333333201242699e-01 /* 3FC11111, 1110FE7A */
+#define T2      5.39682539762260521377e-02 /* 3FABA1BA, 1BB341FE */
+#define T3      2.18694882948595424599e-02 /* 3F9664F4, 8406D637 */
+#define T4      8.86323982359930005737e-03 /* 3F8226E3, E96E8493 */
+#define T5      3.59207910759131235356e-03 /* 3F6D6D22, C9560328 */
+#define T6      1.45620945432529025516e-03 /* 3F57DBC8, FEE08315 */
+#define T7      5.88041240820264096874e-04 /* 3F4344D8, F2F26501 */
+#define T8      2.46463134818469906812e-04 /* 3F3026F7, 1A8D1068 */
+#define T9      7.81794442939557092300e-05 /* 3F147E88, A03792A6 */
+#define T10     7.14072491382608190305e-05 /* 3F12B80F, 32F0A7E9 */
+#define T11    -1.85586374855275456654e-05 /* BEF375CB, DB605373 */
+#define T12     2.59073051863633712884e-05 /* 3EFB2A70, 74BF7AD4 */
+#define pio4    7.85398163397448278999e-01 /* 3FE921FB, 54442D18 */
+#define pio4lo  3.06161699786838301793e-17 /* 3C81A626, 33145C07 */
+
+static double
+__kernel_tan (double x, double y, int iy)
+{
+  double z, r, v, w, s;
+  int ix, hx;
+
+  hx = __HI (x); /* high word of x */
+  ix = hx & 0x7fffffff; /* high word of |x| */
+  if (ix < 0x3e300000) /* x < 2**-28 */
+  {
+    if ((int) x == 0) /* generate inexact */
+    {
+      if (((ix | __LO (x)) | (iy + 1)) == 0)
+      {
+        return one / fabs (x);
+      }
+      else
+      {
+        if (iy == 1)
+        {
+          return x;
+        }
+        else /* compute -1 / (x + y) carefully */
+        {
+          double a, t;
+
+          z = w = x + y;
+          __LO (z) = 0;
+          v = y - (z - x);
+          t = a = -one / w;
+          __LO (t) = 0;
+          s = one + t * z;
+          return t + a * (s + t * v);
+        }
+      }
+    }
+  }
+  if (ix >= 0x3FE59428) /* |x| >= 0.6744 */
+  {
+    if (hx < 0)
+    {
+      x = -x;
+      y = -y;
+    }
+    z = pio4 - x;
+    w = pio4lo - y;
+    x = z + w;
+    y = 0.0;
+  }
+  z = x * x;
+  w = z * z;
+  /*
+   * Break x^5 * (T[1] + x^2 * T[2] + ...) into
+   * x^5 (T[1] + x^4 * T[3] + ... + x^20 * T[11]) +
+   * x^5 (x^2 * (T[2] + x^4 * T[4] + ... + x^22 * [T12]))
+   */
+  r = T1 + w * (T3 + w * (T5 + w * (T7 + w * (T9 + w * T11))));
+  v = z * (T2 + w * (T4 + w * (T6 + w * (T8 + w * (T10 + w * T12)))));
+  s = z * x;
+  r = y + z * (s * (r + v) + y);
+  r += T0 * s;
+  w = x + r;
+  if (ix >= 0x3FE59428)
+  {
+    v = (double) iy;
+    return (double) (1 - ((hx >> 30) & 2)) * (v - 2.0 * (x - (w * w / (w + v) - r)));
+  }
+  if (iy == 1)
+  {
+    return w;
+  }
+  else
+  {
+    /*
+     * if allow error up to 2 ulp, simply return
+     * -1.0 / (x + r) here
+     */
+    /* compute -1.0 / (x + r) accurately */
+    double a, t;
+
+    z = w;
+    __LO (z) = 0;
+    v = r - (z - x); /* z + v = r + x */
+    t = a = -1.0 / w; /* a = -1.0 / w */
+    __LO (t) = 0;
+    s = 1.0 + t * z;
+    return t + a * (s + t * v);
+  }
+} /* __kernel_tan */
+
+/* Method:
+ *      Let S,C and T denote the sin, cos and tan respectively on
+ *      [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2
+ *      in [-pi/4 , +pi/4], and let n = k mod 4.
+ *      We have
+ *
+ *          n        sin(x)      cos(x)        tan(x)
+ *     ----------------------------------------------------------
+ *          0          S           C             T
+ *          1          C          -S            -1/T
+ *          2         -S          -C             T
+ *          3         -C           S            -1/T
+ *     ----------------------------------------------------------
+ *
+ * Special cases:
+ *      Let trig be any of sin, cos, or tan.
+ *      trig(+-INF)  is NaN, with signals;
+ *      trig(NaN)    is that NaN;
+ *
+ * Accuracy:
+ *      TRIG(x) returns trig(x) nearly rounded
+ */
+
+/* sin(x)
+ * Return sine function of x.
+ *
+ * kernel function:
+ *      __kernel_sin            ... sine function on [-pi/4,pi/4]
+ *      __kernel_cos            ... cose function on [-pi/4,pi/4]
+ *      __ieee754_rem_pio2      ... argument reduction routine
+ */
+double
+sin (double x)
+{
+  double y[2], z = 0.0;
+  int n, ix;
+
+  /* High word of x. */
+  ix = __HI (x);
+
+  /* |x| ~< pi/4 */
+  ix &= 0x7fffffff;
+  if (ix <= 0x3fe921fb)
+  {
+    return __kernel_sin (x, z, 0);
+  }
+
+  /* sin(Inf or NaN) is NaN */
+  else if (ix >= 0x7ff00000)
+  {
+    return x - x;
+  }
+
+  /* argument reduction needed */
+  else
+  {
+    n = __ieee754_rem_pio2 (x, y);
+    switch (n & 3)
+    {
+      case 0:
+      {
+        return __kernel_sin (y[0], y[1], 1);
+      }
+      case 1:
+      {
+        return __kernel_cos (y[0], y[1]);
+      }
+      case 2:
+      {
+        return -__kernel_sin (y[0], y[1], 1);
+      }
+      default:
+      {
+        return -__kernel_cos (y[0], y[1]);
+      }
+    }
+  }
+} /* sin */
+
+/* cos(x)
+ * Return cosine function of x.
+ *
+ * kernel function:
+ *      __kernel_sin            ... sine function on [-pi/4,pi/4]
+ *      __kernel_cos            ... cosine function on [-pi/4,pi/4]
+ *      __ieee754_rem_pio2      ... argument reduction routine
+ */
+
+double
+cos (double x)
+{
+  double y[2], z = 0.0;
+  int n, ix;
+
+  /* High word of x. */
+  ix = __HI (x);
+
+  /* |x| ~< pi/4 */
+  ix &= 0x7fffffff;
+  if (ix <= 0x3fe921fb)
+  {
+    return __kernel_cos (x, z);
+  }
+
+  /* cos(Inf or NaN) is NaN */
+  else if (ix >= 0x7ff00000)
+  {
+    return x - x;
+  }
+
+  /* argument reduction needed */
+  else
+  {
+    n = __ieee754_rem_pio2 (x, y);
+    switch (n & 3)
+    {
+      case 0:
+      {
+        return __kernel_cos (y[0], y[1]);
+      }
+      case 1:
+      {
+        return -__kernel_sin (y[0], y[1], 1);
+      }
+      case 2:
+      {
+        return -__kernel_cos (y[0], y[1]);
+      }
+      default:
+      {
+        return __kernel_sin (y[0], y[1], 1);
+      }
+    }
+  }
+} /* cos */
+
+/* tan(x)
+ * Return tangent function of x.
+ *
+ * kernel function:
+ *      __kernel_tan            ... tangent function on [-pi/4,pi/4]
+ *      __ieee754_rem_pio2      ... argument reduction routine
+ */
+
+double
+tan (double x)
+{
+  double y[2], z = 0.0;
+  int n, ix;
+
+  /* High word of x. */
+  ix = __HI (x);
+
+  /* |x| ~< pi/4 */
+  ix &= 0x7fffffff;
+  if (ix <= 0x3fe921fb)
+  {
+    return __kernel_tan (x, z, 1);
+  }
+
+  /* tan(Inf or NaN) is NaN */
+  else if (ix >= 0x7ff00000)
+  {
+    return x - x; /* NaN */
+  }
+
+  /* argument reduction needed */
+  else
+  {
+    n = __ieee754_rem_pio2 (x, y);
+    return __kernel_tan (y[0], y[1], 1 - ((n & 1) << 1)); /*   1 -- n even, -1 -- n odd */
+  }
+} /* tan */
+
+#undef zero
+#undef half
+#undef one
+#undef two24
+#undef twon24
+#undef invpio2
+#undef pio2_1
+#undef pio2_1t
+#undef pio2_2
+#undef pio2_2t
+#undef pio2_3
+#undef pio2_3t
+#undef S1
+#undef S2
+#undef S3
+#undef S4
+#undef S5
+#undef S6
+#undef C1
+#undef C2
+#undef C3
+#undef C4
+#undef C5
+#undef C6
+#undef T0
+#undef T1
+#undef T2
+#undef T3
+#undef T4
+#undef T5
+#undef T6
+#undef T7
+#undef T8
+#undef T9
+#undef T10
+#undef T11
+#undef T12
+#undef pio4
+#undef pio4lo
diff --git a/deps/jerry/jerry-main/CMakeLists.txt b/deps/jerry/jerry-main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d37b1dc
--- /dev/null
@@ -0,0 +1,70 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+project (jerry-main C)
+
+# Optional build settings
+set(ENABLE_LINK_MAP OFF CACHE BOOL "Enable generating a link map file?")
+
+# Status messages
+message(STATUS "ENABLE_LINK_MAP           " ${ENABLE_LINK_MAP})
+
+# Generate map file
+if(ENABLE_LINK_MAP)
+  if("${PLATFORM}" STREQUAL "DARWIN")
+    set(LINKER_FLAGS_COMMON "${LINKER_FLAGS_COMMON} -Xlinker -map -Xlinker jerry.map")
+  else()
+    set(LINKER_FLAGS_COMMON "${LINKER_FLAGS_COMMON} -Xlinker -Map -Xlinker jerry.map")
+  endif()
+endif()
+
+# Get version information from git
+if(IS_DIRECTORY "${CMAKE_SOURCE_DIR}/.git")
+  execute_process(COMMAND git rev-parse --short HEAD
+                  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+                  OUTPUT_VARIABLE JERRY_COMMIT_HASH
+                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+  set(JERRY_COMMIT_HASH " (${JERRY_COMMIT_HASH})")
+else()
+  set(JERRY_COMMIT_HASH "")
+endif()
+
+set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_COMMIT_HASH="${JERRY_COMMIT_HASH}")
+
+macro(jerry_create_executable JERRY_NAME)
+  add_executable(${JERRY_NAME} ${ARGN})
+  set_property(TARGET ${JERRY_NAME}
+               PROPERTY LINK_FLAGS "${LINKER_FLAGS_COMMON}")
+  target_compile_definitions(${JERRY_NAME} PRIVATE ${DEFINES_JERRY})
+
+  target_link_libraries(${JERRY_NAME} jerry-core)
+
+  install(TARGETS ${JERRY_NAME} DESTINATION bin)
+endmacro()
+
+if(JERRY_LIBC AND FEATURE_EXTERNAL_CONTEXT)
+  MESSAGE(FATAL_ERROR "This configuration is not supported for jerry-main. Please build against your system libc to enable the external context.")
+endif()
+
+# Jerry standalones
+if(JERRY_CMDLINE)
+  jerry_create_executable("jerry" "main-unix.c" "cli.c")
+  target_link_libraries("jerry" jerry-ext jerry-port-default)
+endif()
+
+if(JERRY_CMDLINE_MINIMAL)
+  jerry_create_executable("jerry-minimal" "main-unix-minimal.c")
+  target_link_libraries("jerry-minimal" jerry-port-default-minimal)
+endif()
diff --git a/deps/jerry/jerry-main/cli.c b/deps/jerry/jerry-main/cli.c
new file mode 100644 (file)
index 0000000..1bf41f3
--- /dev/null
@@ -0,0 +1,433 @@
+/* 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "cli.h"
+
+/*
+ * Fixed layout settings
+ */
+
+/**
+ * Wrap lines at:
+ */
+#define CLI_LINE_LENGTH 80
+
+/**
+ * Indent various lines with:
+ */
+#define CLI_LINE_INDENT 2
+
+/**
+ * Tab stop (for multi-column display) at:
+ */
+#define CLI_LINE_TAB 24
+
+/**
+ * Declare a char VLA and concatenate a program name and a sub-command name
+ * (separated by a single space) into the new array. Useful for printing command
+ * line option usage summary for sub-commands.
+ *
+ * @param CMDNAME name of the new array variable.
+ * @param PROGNAME string containing the name of the program.
+ * @param CMD string continaing the name of the sub-command.
+ */
+#define CLI_CMD_NAME(CMDNAME, PROGNAME, CMD) \
+  char CMDNAME[strlen ((PROGNAME)) + strlen ((CMD)) + 2]; \
+  strncpy (CMDNAME, (PROGNAME), strlen ((PROGNAME))); \
+  CMDNAME[strlen ((PROGNAME))] = ' '; \
+  strncpy (CMDNAME + strlen ((PROGNAME)) + 1, (CMD), strlen ((CMD)) + 1)
+
+/*
+ * Command line option handling
+ */
+
+/**
+ * Initialize a command line option processor.
+ *
+ * @return the state that should be passed to other cli_ functions.
+ */
+cli_state_t
+cli_init (const cli_opt_t *options, /**< array of option definitions, terminated by CLI_OPT_DEFAULT */
+          int argc, /**< number of command line arguments */
+          char **argv) /**< array of command line arguments */
+{
+  return (cli_state_t)
+  {
+    .error = NULL,
+    .arg = NULL,
+    .argc = argc,
+    .argv = argv,
+    .opts = options
+  };
+} /* cli_init */
+
+/**
+ * Checks whether the current argument is an option.
+ *
+ * Note:
+ *   The state->error is not NULL on error and it contains the error message.
+ *
+ * @return the ID of the option that was found or a CLI_OPT_ constant otherwise.
+ */
+int
+cli_consume_option (cli_state_t *state) /**< state of the command line option processor */
+{
+  if (state->error != NULL)
+  {
+    return CLI_OPT_END;
+  }
+
+  if (state->argc <= 0)
+  {
+    state->arg = NULL;
+    return CLI_OPT_END;
+  }
+
+  const char *arg = state->argv[0];
+
+  state->arg = arg;
+
+  if (arg[0] != '-')
+  {
+    return CLI_OPT_DEFAULT;
+  }
+
+  if (arg[1] == '-')
+  {
+    arg += 2;
+
+    for (const cli_opt_t *opt = state->opts; opt->id != CLI_OPT_DEFAULT; opt++)
+    {
+      if (opt->longopt != NULL && strcmp (arg, opt->longopt) == 0)
+      {
+        state->argc--;
+        state->argv++;
+        return opt->id;
+      }
+    }
+
+    state->error = "Unknown long option";
+    return CLI_OPT_END;
+  }
+
+  arg++;
+
+  for (const cli_opt_t *opt = state->opts; opt->id != CLI_OPT_DEFAULT; opt++)
+  {
+    if (opt->opt != NULL && strcmp (arg, opt->opt) == 0)
+    {
+      state->argc--;
+      state->argv++;
+      return opt->id;
+    }
+  }
+
+  state->error = "Unknown option";
+  return CLI_OPT_END;
+} /* cli_consume_option */
+
+/**
+ * Returns the next argument as string.
+ *
+ * Note:
+ *   The state->error is not NULL on error and it contains the error message.
+ *
+ * @return argument string
+ */
+const char *
+cli_consume_string (cli_state_t *state) /**< state of the command line option processor */
+{
+  if (state->error != NULL)
+  {
+    return NULL;
+  }
+
+  if (state->argc <= 0)
+  {
+    state->error = "Expected string argument";
+    state->arg = NULL;
+    return NULL;
+  }
+
+  state->arg = state->argv[0];
+
+  state->argc--;
+  state->argv++;
+  return state->arg;
+} /* cli_consume_string */
+
+/**
+ * Returns the next argument as integer.
+ *
+ * Note:
+ *   The state->error is not NULL on error and it contains the error message.
+ *
+ * @return argument integer
+ */
+int
+cli_consume_int (cli_state_t *state) /**< state of the command line option processor */
+{
+  if (state->error != NULL)
+  {
+    return 0;
+  }
+
+  state->error = "Expected integer argument";
+
+  if (state->argc <= 0)
+  {
+    state->arg = NULL;
+    return 0;
+  }
+
+  state->arg = state->argv[0];
+
+  char *endptr;
+  long int value = strtol (state->arg, &endptr, 10);
+
+  if (*endptr != '\0')
+  {
+    return 0;
+  }
+
+  state->error = NULL;
+  state->argc--;
+  state->argv++;
+  return (int) value;
+} /* cli_consume_int */
+
+/*
+ * Print helper functions
+ */
+
+/**
+ * Pad with spaces.
+ */
+static void
+cli_print_pad (int cnt) /**< number of spaces to print */
+{
+  for (int i = 0; i < cnt; i++)
+  {
+    printf (" ");
+  }
+} /* cli_print_pad */
+
+/**
+ * Print the prefix of a string.
+ */
+static void
+cli_print_prefix (const char *str, /**< string to print */
+                  int len) /**< length of the prefix to print */
+{
+  for (int i = 0; i < len; i++)
+  {
+    printf ("%c", *str++);
+  }
+} /* cli_print_prefix */
+
+/**
+ * Print usage summary of options.
+ */
+static void
+cli_opt_usage (const char *progname, /**< program name, typically argv[0] */
+               const cli_opt_t *opts) /**< array of command line option definitions, terminated by CLI_OPT_DEFAULT */
+{
+  int length = (int) strlen (progname);
+  const cli_opt_t *o = opts;
+
+  printf ("%s", progname);
+
+  while (o->id != CLI_OPT_DEFAULT)
+  {
+    const char *opt = o->opt;
+    int opt_length = 2 + 1;
+
+    if (opt == NULL)
+    {
+      opt = o->longopt;
+      opt_length++;
+    }
+
+    opt_length += (int) strlen (opt);
+
+    if (length + 1 + opt_length >= CLI_LINE_LENGTH)
+    {
+      length = CLI_LINE_INDENT - 1;
+      printf ("\n");
+      cli_print_pad (length);
+    }
+    length += opt_length;
+
+    printf (" [");
+
+    if (o->opt != NULL)
+    {
+      printf ("-%s", opt);
+    }
+    else
+    {
+      printf ("--%s", opt);
+    }
+
+    if (o->meta != NULL)
+    {
+      printf (" %s", o->meta);
+    }
+
+    printf ("]");
+
+    o++;
+  }
+
+  if (o->meta != NULL)
+  {
+    const char *opt = o->meta;
+    int opt_length = (int) (2 + strlen (opt));
+
+    if (length + 1 + opt_length >= CLI_LINE_LENGTH)
+    {
+      length = CLI_LINE_INDENT - 1;
+      printf ("\n");
+      cli_print_pad (length);
+    }
+
+    printf (" [%s]", opt);
+  }
+
+  printf ("\n\n");
+} /* cli_opt_usage */
+
+/**
+ * Print a help message wrapped into the second column.
+ */
+static void
+cli_print_help (const char *help) /**< the help message to print */
+{
+  while (help != NULL && *help != 0)
+  {
+    int length = -1;
+    int i = 0;
+    for (; i < CLI_LINE_LENGTH - CLI_LINE_TAB && help[i] != 0; i++)
+    {
+      if (help[i] == ' ')
+      {
+        length = i;
+      }
+    }
+    if (length < 0 || i < CLI_LINE_LENGTH - CLI_LINE_TAB)
+    {
+      length = i;
+    }
+
+    cli_print_prefix (help, length);
+
+    help += length;
+    while (*help == ' ' && *help != 0)
+    {
+      help++;
+    }
+
+    if (*help != 0)
+    {
+      printf ("\n");
+      cli_print_pad (CLI_LINE_TAB);
+    }
+  }
+} /* cli_print_help */
+
+/**
+ * Print detailed help for options.
+ */
+void
+cli_help (const char *progname, /**< program name, typically argv[0] */
+          const cli_opt_t *options) /**< array of command line option definitions, terminated by CLI_OPT_DEFAULT */
+{
+  cli_opt_usage (progname, options);
+
+  const cli_opt_t *opt = options;
+
+  while (opt->id != CLI_OPT_DEFAULT)
+  {
+    int length = CLI_LINE_INDENT;
+    cli_print_pad (CLI_LINE_INDENT);
+
+    if (opt->opt != NULL)
+    {
+      printf ("-%s", opt->opt);
+      length += (int) (strlen (opt->opt) + 1);
+    }
+
+    if (opt->opt != NULL && opt->longopt != NULL)
+    {
+      printf (", ");
+      length += 2;
+    }
+
+    if (opt->longopt != NULL)
+    {
+      printf ("--%s", opt->longopt);
+      length += (int) (strlen (opt->longopt) + 2);
+    }
+
+    if (opt->meta != NULL)
+    {
+      printf (" %s", opt->meta);
+      length += 1 + (int) strlen (opt->meta);
+    }
+
+    if (opt->help != NULL)
+    {
+      if (length >= CLI_LINE_TAB)
+      {
+        printf ("\n");
+        length = 0;
+      }
+      cli_print_pad (CLI_LINE_TAB - length);
+      length = CLI_LINE_TAB;
+
+      cli_print_help (opt->help);
+    }
+
+    printf ("\n");
+    opt++;
+  }
+
+  if (opt->help != NULL)
+  {
+    int length = 0;
+
+    if (opt->meta != NULL)
+    {
+      length = (int) (CLI_LINE_INDENT + strlen (opt->meta));
+
+      cli_print_pad (CLI_LINE_INDENT);
+      printf ("%s", opt->meta);
+    }
+
+    if (length >= CLI_LINE_TAB)
+    {
+      printf ("\n");
+      length = 0;
+    }
+
+    cli_print_pad (CLI_LINE_TAB - length);
+
+    cli_print_help (opt->help);
+    printf ("\n");
+  }
+} /* cli_help */
diff --git a/deps/jerry/jerry-main/cli.h b/deps/jerry/jerry-main/cli.h
new file mode 100644 (file)
index 0000000..3117e32
--- /dev/null
@@ -0,0 +1,75 @@
+/* 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.
+ */
+
+#ifndef CLI_H
+#define CLI_H
+
+#include <string.h>
+
+/**
+ * Command line option definition.
+ */
+typedef struct
+{
+  int id; /**< unique ID of the option (CLI_OPT_DEFAULT, or anything >= 0) */
+  const char *opt; /**< short option variant (in the form of "x" without dashes) */
+  const char *longopt; /**< long option variant (in the form of "xxx" without dashes) */
+  const char *meta; /**< name(s) of the argument(s) of the option, for display only */
+  const char *help; /**< descriptive help message of the option */
+} cli_opt_t;
+
+/**
+ * Special marker for default option which also marks the end of the option list.
+ */
+#define CLI_OPT_DEFAULT -1
+
+/**
+ * Returned by cli_consume_option () when no more options are available
+ * or an error occured.
+ */
+#define CLI_OPT_END -2
+
+/**
+ * State of the sub-command processor.
+ * No fields should be accessed other than error and arg.
+ */
+typedef struct
+{
+  /* Public fields. */
+  const char *error; /**< public field for error message */
+  const char *arg; /**< last processed argument as string */
+
+  /* Private fields. */
+  int argc; /**< remaining number of arguments */
+  char **argv; /**< remaining arguments */
+  const cli_opt_t *opts; /**< options */
+} cli_state_t;
+
+/**
+ * Macro for writing command line option definition struct literals.
+ */
+#define CLI_OPT_DEF(...) /*(cli_opt_t)*/ { __VA_ARGS__ }
+
+/*
+ * Functions for CLI.
+ */
+
+cli_state_t cli_init (const cli_opt_t *options, int argc, char **argv);
+int cli_consume_option (cli_state_t *state);
+const char * cli_consume_string (cli_state_t *state);
+int cli_consume_int (cli_state_t *state);
+void cli_help (const char *progname, const cli_opt_t *options);
+
+#endif /* CLI_H */
diff --git a/deps/jerry/jerry-main/main-unix-minimal.c b/deps/jerry/jerry-main/main-unix-minimal.c
new file mode 100644 (file)
index 0000000..87bb05f
--- /dev/null
@@ -0,0 +1,128 @@
+/* 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.
+ */
+
+#include <string.h>
+
+#include "jerryscript.h"
+#include "jerryscript-port.h"
+
+/**
+ * Maximum size of source code / snapshots buffer
+ */
+#define JERRY_BUFFER_SIZE (1048576)
+
+/**
+ * Standalone Jerry exit codes
+ */
+#define JERRY_STANDALONE_EXIT_CODE_OK   (0)
+#define JERRY_STANDALONE_EXIT_CODE_FAIL (1)
+
+static uint8_t buffer[ JERRY_BUFFER_SIZE ];
+
+static const uint8_t *
+read_file (const char *file_name,
+           size_t *out_size_p)
+{
+  FILE *file = fopen (file_name, "r");
+  if (file == NULL)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: failed to open file: %s\n", file_name);
+    return NULL;
+  }
+
+  size_t bytes_read = fread (buffer, 1u, sizeof (buffer), file);
+  if (!bytes_read)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: failed to read file: %s\n", file_name);
+    fclose (file);
+    return NULL;
+  }
+
+  fclose (file);
+
+  *out_size_p = bytes_read;
+  return (const uint8_t *) buffer;
+} /* read_file */
+
+static void
+print_help (char *name)
+{
+  printf ("Usage: %s [OPTION]... [FILE]...\n"
+          "\n"
+          "Options:\n"
+          "  -h, --help\n"
+          "\n",
+          name);
+} /* print_help */
+
+int
+main (int argc,
+      char **argv)
+{
+  if (argc <= 1 || (argc == 2 && (!strcmp ("-h", argv[1]) || !strcmp ("--help", argv[1]))))
+  {
+    print_help (argv[0]);
+    return JERRY_STANDALONE_EXIT_CODE_OK;
+  }
+
+  jerry_init (JERRY_INIT_EMPTY);
+  jerry_value_t ret_value = jerry_create_undefined ();
+
+  for (int i = 1; i < argc; i++)
+  {
+    const char *file_name = argv[i];
+    size_t source_size;
+
+    const jerry_char_t *source_p = read_file (file_name, &source_size);
+
+    if (source_p == NULL)
+    {
+      ret_value = jerry_create_error (JERRY_ERROR_COMMON, (jerry_char_t *) "");
+      break;
+    }
+    else
+    {
+      ret_value = jerry_parse (source_p, source_size, false);
+
+      if (!jerry_value_has_error_flag (ret_value))
+      {
+        jerry_value_t func_val = ret_value;
+        ret_value = jerry_run (func_val);
+        jerry_release_value (func_val);
+      }
+    }
+
+    if (jerry_value_has_error_flag (ret_value))
+    {
+      break;
+    }
+
+    jerry_release_value (ret_value);
+    ret_value = jerry_create_undefined ();
+  }
+
+  int ret_code = JERRY_STANDALONE_EXIT_CODE_OK;
+
+  if (jerry_value_has_error_flag (ret_value))
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Unhandled exception: Script Error!\n");
+    ret_code = JERRY_STANDALONE_EXIT_CODE_FAIL;
+  }
+
+  jerry_release_value (ret_value);
+  jerry_cleanup ();
+
+  return ret_code;
+} /* main */
diff --git a/deps/jerry/jerry-main/main-unix.c b/deps/jerry/jerry-main/main-unix.c
new file mode 100644 (file)
index 0000000..bfb8f63
--- /dev/null
@@ -0,0 +1,801 @@
+/* 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.
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+#include "jerryscript-port.h"
+#include "jerryscript-port-default.h"
+
+#include "cli.h"
+
+/**
+ * Maximum size of source code
+ */
+#define JERRY_BUFFER_SIZE (1048576)
+
+/**
+ * Maximum size of snapshots buffer
+ */
+#define JERRY_SNAPSHOT_BUFFER_SIZE (JERRY_BUFFER_SIZE / sizeof (uint32_t))
+
+/**
+ * Standalone Jerry exit codes
+ */
+#define JERRY_STANDALONE_EXIT_CODE_OK   (0)
+#define JERRY_STANDALONE_EXIT_CODE_FAIL (1)
+
+/**
+ * Context size of the SYNTAX_ERROR
+ */
+#define SYNTAX_ERROR_CONTEXT_SIZE 2
+
+static uint8_t buffer[ JERRY_BUFFER_SIZE ];
+
+static const uint32_t *
+read_file (const char *file_name,
+           size_t *out_size_p)
+{
+  FILE *file;
+  if (!strcmp ("-", file_name))
+  {
+    file = stdin;
+  }
+  else
+  {
+    file = fopen (file_name, "r");
+    if (file == NULL)
+    {
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: failed to open file: %s\n", file_name);
+      return NULL;
+    }
+  }
+
+  size_t bytes_read = fread (buffer, 1u, sizeof (buffer), file);
+  if (!bytes_read)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: failed to read file: %s\n", file_name);
+    fclose (file);
+    return NULL;
+  }
+
+  fclose (file);
+
+  *out_size_p = bytes_read;
+  return (const uint32_t *) buffer;
+} /* read_file */
+
+/**
+ * Check whether an error is a SyntaxError or not
+ *
+ * @return true - if param is SyntaxError
+ *         false - otherwise
+ */
+static bool
+jerry_value_is_syntax_error (jerry_value_t error_value) /**< error value */
+{
+  assert (jerry_is_feature_enabled (JERRY_FEATURE_ERROR_MESSAGES));
+
+  if (!jerry_value_is_object (error_value))
+  {
+    return false;
+  }
+
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *)"name");
+  jerry_value_t error_name = jerry_get_property (error_value, prop_name);
+  jerry_release_value (prop_name);
+
+  if (jerry_value_has_error_flag (error_name)
+      || !jerry_value_is_string (error_name))
+  {
+    jerry_release_value (error_name);
+    return false;
+  }
+
+  jerry_size_t err_str_size = jerry_get_string_size (error_name);
+  jerry_char_t err_str_buf[err_str_size];
+
+  jerry_size_t sz = jerry_string_to_char_buffer (error_name, err_str_buf, err_str_size);
+  jerry_release_value (error_name);
+
+  if (sz == 0)
+  {
+    return false;
+  }
+
+  if (!strcmp ((char *) err_str_buf, "SyntaxError"))
+  {
+    return true;
+  }
+
+  return false;
+} /* jerry_value_is_syntax_error */
+
+/**
+ * Print error value
+ */
+static void
+print_unhandled_exception (jerry_value_t error_value) /**< error value */
+{
+  assert (jerry_value_has_error_flag (error_value));
+
+  jerry_value_clear_error_flag (&error_value);
+  jerry_value_t err_str_val = jerry_value_to_string (error_value);
+  jerry_size_t err_str_size = jerry_get_string_size (err_str_val);
+  jerry_char_t err_str_buf[256];
+
+  if (err_str_size >= 256)
+  {
+    const char msg[] = "[Error message too long]";
+    err_str_size = sizeof (msg) / sizeof (char) - 1;
+    memcpy (err_str_buf, msg, err_str_size);
+  }
+  else
+  {
+    jerry_size_t sz = jerry_string_to_char_buffer (err_str_val, err_str_buf, err_str_size);
+    assert (sz == err_str_size);
+    err_str_buf[err_str_size] = 0;
+
+    if (jerry_is_feature_enabled (JERRY_FEATURE_ERROR_MESSAGES) && jerry_value_is_syntax_error (error_value))
+    {
+      unsigned int err_line = 0;
+      unsigned int err_col = 0;
+
+      /* 1. parse column and line information */
+      for (jerry_size_t i = 0; i < sz; i++)
+      {
+        if (!strncmp ((char *) (err_str_buf + i), "[line: ", 7))
+        {
+          i += 7;
+
+          char num_str[8];
+          unsigned int j = 0;
+
+          while (i < sz && err_str_buf[i] != ',')
+          {
+            num_str[j] = (char) err_str_buf[i];
+            j++;
+            i++;
+          }
+          num_str[j] = '\0';
+
+          err_line = (unsigned int) strtol (num_str, NULL, 10);
+
+          if (strncmp ((char *) (err_str_buf + i), ", column: ", 10))
+          {
+            break; /* wrong position info format */
+          }
+
+          i += 10;
+          j = 0;
+
+          while (i < sz && err_str_buf[i] != ']')
+          {
+            num_str[j] = (char) err_str_buf[i];
+            j++;
+            i++;
+          }
+          num_str[j] = '\0';
+
+          err_col = (unsigned int) strtol (num_str, NULL, 10);
+          break;
+        }
+      } /* for */
+
+      if (err_line != 0 && err_col != 0)
+      {
+        unsigned int curr_line = 1;
+
+        bool is_printing_context = false;
+        unsigned int pos = 0;
+
+        /* 2. seek and print */
+        while (buffer[pos] != '\0')
+        {
+          if (buffer[pos] == '\n')
+          {
+            curr_line++;
+          }
+
+          if (err_line < SYNTAX_ERROR_CONTEXT_SIZE
+              || (err_line >= curr_line
+                  && (err_line - curr_line) <= SYNTAX_ERROR_CONTEXT_SIZE))
+          {
+            /* context must be printed */
+            is_printing_context = true;
+          }
+
+          if (curr_line > err_line)
+          {
+            break;
+          }
+
+          if (is_printing_context)
+          {
+            jerry_port_log (JERRY_LOG_LEVEL_ERROR, "%c", buffer[pos]);
+          }
+
+          pos++;
+        }
+
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "\n");
+
+        while (--err_col)
+        {
+          jerry_port_log (JERRY_LOG_LEVEL_ERROR, "~");
+        }
+
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "^\n");
+      }
+    }
+  }
+
+  jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Script Error: %s\n", err_str_buf);
+  jerry_release_value (err_str_val);
+} /* print_unhandled_exception */
+
+/**
+ * Register a JavaScript function in the global object.
+ */
+static void
+register_js_function (const char *name_p, /**< name of the function */
+                      jerry_external_handler_t handler_p) /**< function callback */
+{
+  jerry_value_t result_val = jerryx_handler_register_global ((const jerry_char_t *) name_p, handler_p);
+
+  if (jerry_value_has_error_flag (result_val))
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_WARNING, "Warning: failed to register '%s' method.", name_p);
+    print_unhandled_exception (result_val);
+  }
+
+  jerry_release_value (result_val);
+} /* register_js_function */
+
+/**
+ * Command line option IDs
+ */
+typedef enum
+{
+  OPT_HELP,
+  OPT_VERSION,
+  OPT_MEM_STATS,
+  OPT_PARSE_ONLY,
+  OPT_SHOW_OP,
+  OPT_SHOW_RE_OP,
+  OPT_DEBUG_SERVER,
+  OPT_DEBUG_PORT,
+  OPT_SAVE_SNAP_GLOBAL,
+  OPT_SAVE_SNAP_EVAL,
+  OPT_SAVE_LIT_LIST,
+  OPT_SAVE_LIT_C,
+  OPT_EXEC_SNAP,
+  OPT_LOG_LEVEL,
+  OPT_ABORT_ON_FAIL,
+  OPT_NO_PROMPT
+} main_opt_id_t;
+
+/**
+ * Command line options
+ */
+static const cli_opt_t main_opts[] =
+{
+  CLI_OPT_DEF (.id = OPT_HELP, .opt = "h", .longopt = "help",
+               .help = "print this help and exit"),
+  CLI_OPT_DEF (.id = OPT_VERSION, .opt = "v", .longopt = "version",
+               .help = "print tool and library version and exit"),
+  CLI_OPT_DEF (.id = OPT_MEM_STATS, .longopt = "mem-stats",
+               .help = "dump memory statistics"),
+  CLI_OPT_DEF (.id = OPT_PARSE_ONLY, .longopt = "parse-only",
+               .help = "don't execute JS input"),
+  CLI_OPT_DEF (.id = OPT_SHOW_OP, .longopt = "show-opcodes",
+               .help = "dump parser byte-code"),
+  CLI_OPT_DEF (.id = OPT_SHOW_RE_OP, .longopt = "show-regexp-opcodes",
+               .help = "dump regexp byte-code"),
+  CLI_OPT_DEF (.id = OPT_DEBUG_SERVER, .longopt = "start-debug-server",
+               .help = "start debug server and wait for a connecting client"),
+  CLI_OPT_DEF (.id = OPT_DEBUG_PORT, .longopt = "debug-port", .meta = "NUM",
+               .help = "debug server port (default: 5001)"),
+  CLI_OPT_DEF (.id = OPT_SAVE_SNAP_GLOBAL, .longopt = "save-snapshot-for-global", .meta = "FILE",
+               .help = "save binary snapshot of parsed JS input (for execution in global context)"),
+  CLI_OPT_DEF (.id = OPT_SAVE_SNAP_EVAL, .longopt = "save-snapshot-for-eval", .meta = "FILE",
+               .help = "save binary snapshot of parsed JS input (for execution in local context by eval)"),
+  CLI_OPT_DEF (.id = OPT_SAVE_LIT_LIST, .longopt = "save-literals-list-format", .meta = "FILE",
+               .help = "export literals found in parsed JS input (in list format)"),
+  CLI_OPT_DEF (.id = OPT_SAVE_LIT_C, .longopt = "save-literals-c-format", .meta = "FILE",
+               .help = "export literals found in parsed JS input (in C source format)"),
+  CLI_OPT_DEF (.id = OPT_EXEC_SNAP, .longopt = "exec-snapshot", .meta = "FILE",
+               .help = "execute input snapshot file(s)"),
+  CLI_OPT_DEF (.id = OPT_LOG_LEVEL, .longopt = "log-level", .meta = "NUM",
+               .help = "set log level (0-3)"),
+  CLI_OPT_DEF (.id = OPT_ABORT_ON_FAIL, .longopt = "abort-on-fail",
+               .help = "segfault on internal failure (instead of non-zero exit code)"),
+  CLI_OPT_DEF (.id = OPT_NO_PROMPT, .longopt = "no-prompt",
+               .help = "don't print prompt in REPL mode"),
+  CLI_OPT_DEF (.id = CLI_OPT_DEFAULT, .meta = "FILE",
+               .help = "input JS file(s)")
+};
+
+/**
+ * Check whether JerryScript has a requested feature enabled or not. If not,
+ * print a warning message.
+ *
+ * @return the status of the feature.
+ */
+static bool
+check_feature (jerry_feature_t feature, /**< feature to check */
+               const char *option) /**< command line option that triggered this check */
+{
+  if (!jerry_is_feature_enabled (feature))
+  {
+    jerry_port_default_set_log_level (JERRY_LOG_LEVEL_WARNING);
+    jerry_port_log (JERRY_LOG_LEVEL_WARNING, "Ignoring '%s' option because this feature is disabled!\n", option);
+    return false;
+  }
+  return true;
+} /* check_feature */
+
+/**
+ * Check whether a usage-related condition holds. If not, print an error
+ * message, print the usage, and terminate the application.
+ */
+static void
+check_usage (bool condition, /**< the condition that must hold */
+             const char *name, /**< name of the application (argv[0]) */
+             const char *msg, /**< error message to print if condition does not hold */
+             const char *opt) /**< optional part of the error message */
+{
+  if (!condition)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "%s: %s%s\n", name, msg, opt != NULL ? opt : "");
+    exit (JERRY_STANDALONE_EXIT_CODE_FAIL);
+  }
+} /* check_usage */
+
+#ifdef JERRY_ENABLE_EXTERNAL_CONTEXT
+
+/**
+ * The alloc function passed to jerry_create_instance
+ */
+static void *
+instance_alloc (size_t size,
+                void *cb_data_p __attribute__((unused)))
+{
+  return malloc (size);
+} /* instance_alloc */
+
+#endif /* JERRY_ENABLE_EXTERNAL_CONTEXT */
+
+int
+main (int argc,
+      char **argv)
+{
+  const char *file_names[argc];
+  int files_counter = 0;
+
+  jerry_init_flag_t flags = JERRY_INIT_EMPTY;
+
+  const char *exec_snapshot_file_names[argc];
+  int exec_snapshots_count = 0;
+
+  bool is_parse_only = false;
+  bool is_save_snapshot_mode = false;
+  bool is_save_snapshot_mode_for_global_or_eval = false;
+  const char *save_snapshot_file_name_p = NULL;
+
+  bool is_save_literals_mode = false;
+  bool is_save_literals_mode_in_c_format_or_list = false;
+  const char *save_literals_file_name_p = NULL;
+
+  bool start_debug_server = false;
+  uint16_t debug_port = 5001;
+
+  bool is_repl_mode = false;
+  bool no_prompt = false;
+
+  cli_state_t cli_state = cli_init (main_opts, argc - 1, argv + 1);
+  for (int id = cli_consume_option (&cli_state); id != CLI_OPT_END; id = cli_consume_option (&cli_state))
+  {
+    switch (id)
+    {
+      case OPT_HELP:
+      {
+        cli_help (argv[0], main_opts);
+        return JERRY_STANDALONE_EXIT_CODE_OK;
+      }
+      case OPT_VERSION:
+      {
+        printf ("Version: %d.%d%s\n", JERRY_API_MAJOR_VERSION, JERRY_API_MINOR_VERSION, JERRY_COMMIT_HASH);
+        return JERRY_STANDALONE_EXIT_CODE_OK;
+      }
+      case OPT_MEM_STATS:
+      {
+        if (check_feature (JERRY_FEATURE_MEM_STATS, cli_state.arg))
+        {
+          jerry_port_default_set_log_level (JERRY_LOG_LEVEL_DEBUG);
+          flags |= JERRY_INIT_MEM_STATS;
+        }
+        break;
+      }
+      case OPT_PARSE_ONLY:
+      {
+        is_parse_only = true;
+        break;
+      }
+      case OPT_SHOW_OP:
+      {
+        if (check_feature (JERRY_FEATURE_PARSER_DUMP, cli_state.arg))
+        {
+          jerry_port_default_set_log_level (JERRY_LOG_LEVEL_DEBUG);
+          flags |= JERRY_INIT_SHOW_OPCODES;
+        }
+        break;
+      }
+      case OPT_SHOW_RE_OP:
+      {
+        if (check_feature (JERRY_FEATURE_REGEXP_DUMP, cli_state.arg))
+        {
+          jerry_port_default_set_log_level (JERRY_LOG_LEVEL_DEBUG);
+          flags |= JERRY_INIT_SHOW_REGEXP_OPCODES;
+        }
+        break;
+      }
+      case OPT_DEBUG_SERVER:
+      {
+        if (check_feature (JERRY_FEATURE_DEBUGGER, cli_state.arg))
+        {
+          start_debug_server = true;
+        }
+        break;
+      }
+      case OPT_DEBUG_PORT:
+      {
+        if (check_feature (JERRY_FEATURE_DEBUGGER, cli_state.arg))
+        {
+          debug_port = (uint16_t) cli_consume_int (&cli_state);
+        }
+        break;
+      }
+      case OPT_SAVE_SNAP_GLOBAL:
+      case OPT_SAVE_SNAP_EVAL:
+      {
+        check_usage (save_snapshot_file_name_p == NULL, argv[0], "Error: snapshot file name already specified", NULL);
+        if (check_feature (JERRY_FEATURE_SNAPSHOT_SAVE, cli_state.arg))
+        {
+          is_save_snapshot_mode = true;
+          is_save_snapshot_mode_for_global_or_eval = (id == OPT_SAVE_SNAP_GLOBAL);
+        }
+        save_snapshot_file_name_p = cli_consume_string (&cli_state);
+        break;
+      }
+      case OPT_SAVE_LIT_LIST:
+      case OPT_SAVE_LIT_C:
+      {
+        check_usage (save_literals_file_name_p == NULL, argv[0], "Error: literal file name already specified", NULL);
+        if (check_feature (JERRY_FEATURE_SNAPSHOT_SAVE, cli_state.arg))
+        {
+          is_save_literals_mode = true;
+          is_save_literals_mode_in_c_format_or_list = (id == OPT_SAVE_LIT_C);
+        }
+        save_literals_file_name_p = cli_consume_string (&cli_state);
+        break;
+      }
+      case OPT_EXEC_SNAP:
+      {
+        if (check_feature (JERRY_FEATURE_SNAPSHOT_EXEC, cli_state.arg))
+        {
+          exec_snapshot_file_names[exec_snapshots_count++] = cli_consume_string (&cli_state);
+        }
+        else
+        {
+          cli_consume_string (&cli_state);
+        }
+        break;
+      }
+      case OPT_LOG_LEVEL:
+      {
+        long int log_level = cli_consume_int (&cli_state);
+        check_usage (log_level >= 0 && log_level <= 3,
+                     argv[0], "Error: invalid value for --log-level: ", cli_state.arg);
+
+        jerry_port_default_set_log_level ((jerry_log_level_t) log_level);
+        break;
+      }
+      case OPT_ABORT_ON_FAIL:
+      {
+        jerry_port_default_set_abort_on_fail (true);
+        break;
+      }
+      case OPT_NO_PROMPT:
+      {
+        no_prompt = true;
+        break;
+      }
+      case CLI_OPT_DEFAULT:
+      {
+        file_names[files_counter++] = cli_consume_string (&cli_state);
+        break;
+      }
+      default:
+      {
+        cli_state.error = "Internal error";
+        break;
+      }
+    }
+  }
+
+  if (cli_state.error != NULL)
+  {
+    if (cli_state.arg != NULL)
+    {
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: %s %s\n", cli_state.error, cli_state.arg);
+    }
+    else
+    {
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: %s\n", cli_state.error);
+    }
+
+    return JERRY_STANDALONE_EXIT_CODE_FAIL;
+  }
+
+  if (is_save_snapshot_mode)
+  {
+    check_usage (files_counter == 1,
+                 argv[0], "Error: --save-snapshot-* options work with exactly one script", NULL);
+    check_usage (exec_snapshots_count == 0,
+                 argv[0], "Error: --save-snapshot-* and --exec-snapshot options can't be passed simultaneously", NULL);
+  }
+
+  if (is_save_literals_mode)
+  {
+    check_usage (files_counter == 1,
+                argv[0], "Error: --save-literals-* options work with exactly one script", NULL);
+  }
+
+  if (files_counter == 0
+      && exec_snapshots_count == 0)
+  {
+    is_repl_mode = true;
+  }
+
+#ifdef JERRY_ENABLE_EXTERNAL_CONTEXT
+
+  jerry_instance_t *instance_p = jerry_create_instance (512*1024, instance_alloc, NULL);
+  jerry_port_default_set_instance (instance_p);
+
+#endif /* JERRY_ENABLE_EXTERNAL_CONTEXT */
+
+  jerry_init (flags);
+  if (start_debug_server)
+  {
+    jerry_debugger_init (debug_port);
+  }
+
+  register_js_function ("assert", jerryx_handler_assert);
+  register_js_function ("gc", jerryx_handler_gc);
+  register_js_function ("print", jerryx_handler_print);
+
+  jerry_value_t ret_value = jerry_create_undefined ();
+
+  if (jerry_is_feature_enabled (JERRY_FEATURE_SNAPSHOT_EXEC))
+  {
+    for (int i = 0; i < exec_snapshots_count; i++)
+    {
+      size_t snapshot_size;
+      const uint32_t *snapshot_p = read_file (exec_snapshot_file_names[i], &snapshot_size);
+
+      if (snapshot_p == NULL)
+      {
+        ret_value = jerry_create_error (JERRY_ERROR_COMMON, (jerry_char_t *) "Snapshot file load error");
+      }
+      else
+      {
+        ret_value = jerry_exec_snapshot (snapshot_p,
+                                         snapshot_size,
+                                         true);
+      }
+
+      if (jerry_value_has_error_flag (ret_value))
+      {
+        break;
+      }
+    }
+  }
+
+  if (!jerry_value_has_error_flag (ret_value))
+  {
+    for (int i = 0; i < files_counter; i++)
+    {
+      size_t source_size;
+      const jerry_char_t *source_p = (jerry_char_t *) read_file (file_names[i], &source_size);
+
+      if (source_p == NULL)
+      {
+        ret_value = jerry_create_error (JERRY_ERROR_COMMON, (jerry_char_t *) "Source file load error");
+        break;
+      }
+
+      if (!jerry_is_valid_utf8_string (source_p, (jerry_size_t) source_size))
+      {
+        ret_value = jerry_create_error (JERRY_ERROR_COMMON, (jerry_char_t *) ("Input must be a valid UTF-8 string."));
+        break;
+      }
+
+      if (is_save_snapshot_mode || is_save_literals_mode)
+      {
+        static uint32_t snapshot_save_buffer[ JERRY_SNAPSHOT_BUFFER_SIZE ];
+
+        if (is_save_snapshot_mode)
+        {
+          size_t snapshot_size = jerry_parse_and_save_snapshot ((jerry_char_t *) source_p,
+                                                                source_size,
+                                                                is_save_snapshot_mode_for_global_or_eval,
+                                                                false,
+                                                                snapshot_save_buffer,
+                                                                JERRY_SNAPSHOT_BUFFER_SIZE);
+          if (snapshot_size == 0)
+          {
+            ret_value = jerry_create_error (JERRY_ERROR_COMMON, (jerry_char_t *) "Snapshot saving failed!");
+          }
+          else
+          {
+            FILE *snapshot_file_p = fopen (save_snapshot_file_name_p, "w");
+            fwrite (snapshot_save_buffer, sizeof (uint8_t), snapshot_size, snapshot_file_p);
+            fclose (snapshot_file_p);
+          }
+        }
+
+        if (!jerry_value_has_error_flag (ret_value) && is_save_literals_mode)
+        {
+          const size_t literal_buffer_size = jerry_parse_and_save_literals ((jerry_char_t *) source_p,
+                                                                            source_size,
+                                                                            false,
+                                                                            snapshot_save_buffer,
+                                                                            JERRY_SNAPSHOT_BUFFER_SIZE,
+                                                                            is_save_literals_mode_in_c_format_or_list);
+          if (literal_buffer_size == 0)
+          {
+            ret_value = jerry_create_error (JERRY_ERROR_COMMON, (jerry_char_t *) "Literal saving failed!");
+          }
+          else
+          {
+            FILE *literal_file_p = fopen (save_literals_file_name_p, "w");
+            fwrite (snapshot_save_buffer, sizeof (uint8_t), literal_buffer_size, literal_file_p);
+            fclose (literal_file_p);
+          }
+        }
+      }
+      else
+      {
+        ret_value = jerry_parse_named_resource ((jerry_char_t *) file_names[i],
+                                                strlen (file_names[i]),
+                                                source_p,
+                                                source_size,
+                                                false);
+
+        if (!jerry_value_has_error_flag (ret_value) && !is_parse_only)
+        {
+          jerry_value_t func_val = ret_value;
+          ret_value = jerry_run (func_val);
+          jerry_release_value (func_val);
+        }
+      }
+
+      if (jerry_value_has_error_flag (ret_value))
+      {
+        break;
+      }
+
+      jerry_release_value (ret_value);
+      ret_value = jerry_create_undefined ();
+    }
+  }
+
+  if (is_repl_mode)
+  {
+    const char *prompt = !no_prompt ? "jerry> " : "";
+    bool is_done = false;
+
+    while (!is_done)
+    {
+      uint8_t *source_buffer_tail = buffer;
+      size_t len = 0;
+
+      printf ("%s", prompt);
+
+      /* Read a line */
+      while (true)
+      {
+        if (fread (source_buffer_tail, 1, 1, stdin) != 1 && len == 0)
+        {
+          is_done = true;
+          break;
+        }
+        if (*source_buffer_tail == '\n')
+        {
+          break;
+        }
+        source_buffer_tail ++;
+        len ++;
+      }
+      *source_buffer_tail = 0;
+
+      if (len > 0)
+      {
+        /* Evaluate the line */
+        jerry_value_t ret_val_eval = jerry_eval (buffer, len, false);
+
+        if (!jerry_value_has_error_flag (ret_val_eval))
+        {
+          /* Print return value */
+          const jerry_value_t args[] = { ret_val_eval };
+          jerry_value_t ret_val_print = jerryx_handler_print (jerry_create_undefined (),
+                                                              jerry_create_undefined (),
+                                                              args,
+                                                              1);
+          jerry_release_value (ret_val_print);
+          jerry_release_value (ret_val_eval);
+          ret_val_eval = jerry_run_all_enqueued_jobs ();
+
+          if (jerry_value_has_error_flag (ret_val_eval))
+          {
+            print_unhandled_exception (ret_val_eval);
+          }
+        }
+        else
+        {
+          print_unhandled_exception (ret_val_eval);
+        }
+
+        jerry_release_value (ret_val_eval);
+      }
+    }
+  }
+
+  int ret_code = JERRY_STANDALONE_EXIT_CODE_OK;
+
+  if (jerry_value_has_error_flag (ret_value))
+  {
+    print_unhandled_exception (ret_value);
+
+    ret_code = JERRY_STANDALONE_EXIT_CODE_FAIL;
+  }
+  else
+  {
+    jerry_release_value (ret_value);
+    ret_value = jerry_run_all_enqueued_jobs ();
+
+    if (jerry_value_has_error_flag (ret_value))
+    {
+      print_unhandled_exception (ret_value);
+      ret_code = JERRY_STANDALONE_EXIT_CODE_FAIL;
+    }
+  }
+  jerry_release_value (ret_value);
+
+  if (start_debug_server)
+  {
+    jerry_debugger_cleanup ();
+  }
+  jerry_cleanup ();
+#ifdef JERRY_ENABLE_EXTERNAL_CONTEXT
+  free (instance_p);
+#endif /* JERRY_ENABLE_EXTERNAL_CONTEXT */
+  return ret_code;
+} /* main */
diff --git a/deps/jerry/jerry-port/default/CMakeLists.txt b/deps/jerry/jerry-port/default/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b9df5e5
--- /dev/null
@@ -0,0 +1,45 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+set(JERRY_PORT_DEFAULT_NAME jerry-port-default)
+project (${JERRY_PORT_DEFAULT_NAME} C)
+
+# Include directories
+set(INCLUDE_PORT_DEFAULT "${CMAKE_CURRENT_SOURCE_DIR}/include")
+
+# Source directories
+file(GLOB SOURCE_PORT_DEFAULT *.c)
+
+# Define _BSD_SOURCE and _DEFAULT_SOURCE
+# (should only be necessary if we used compiler default libc but not checking that)
+set(DEFINES_PORT_DEFAULT _BSD_SOURCE _DEFAULT_SOURCE)
+
+# Default Jerry port implementation library variants:
+#   - default
+#   - default-minimal (no extra termination and log APIs)
+foreach(JERRY_PORT_LIBRARY_NAME ${JERRY_PORT_DEFAULT_NAME} ${JERRY_PORT_DEFAULT_NAME}-minimal)
+  add_library(${JERRY_PORT_LIBRARY_NAME} STATIC ${SOURCE_PORT_DEFAULT})
+  target_include_directories(${JERRY_PORT_LIBRARY_NAME} PUBLIC ${INCLUDE_PORT_DEFAULT})
+  target_include_directories(${JERRY_PORT_LIBRARY_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/jerry-core/include)
+  target_include_directories(${JERRY_PORT_LIBRARY_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/jerry-ext/include)
+  target_compile_definitions(${JERRY_PORT_LIBRARY_NAME} PRIVATE ${DEFINES_PORT_DEFAULT})
+  target_link_libraries(${JERRY_PORT_LIBRARY_NAME} jerry-core) # FIXME: remove this dependency as soon as possible
+endforeach()
+
+target_compile_definitions(${JERRY_PORT_DEFAULT_NAME}-minimal PRIVATE DISABLE_EXTRA_API)
+
+# Installation
+install(TARGETS ${JERRY_PORT_DEFAULT_NAME} ${JERRY_PORT_DEFAULT_NAME}-minimal DESTINATION lib)
+install(DIRECTORY ${INCLUDE_PORT_DEFAULT}/ DESTINATION include)
diff --git a/deps/jerry/jerry-port/default/default-date.c b/deps/jerry/jerry-port/default/default-date.c
new file mode 100644 (file)
index 0000000..0d5ebed
--- /dev/null
@@ -0,0 +1,76 @@
+/* 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.
+ */
+
+#ifdef __GNUC__
+#include <sys/time.h>
+#endif
+
+#include "jerryscript-port.h"
+#include "jerryscript-port-default.h"
+
+/**
+ * Default implementation of jerry_port_get_time_zone. Uses 'gettimeofday' if
+ * available on the system, does nothing otherwise.
+ *
+ * @return true - if 'gettimeofday' is available and executed successfully,
+ *         false - otherwise.
+ */
+bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p) /**< [out] time zone structure to fill */
+{
+#ifdef __GNUC__
+  struct timeval tv;
+  struct timezone tz;
+
+  /* gettimeofday may not fill tz, so zero-initializing */
+  tz.tz_minuteswest = 0;
+  tz.tz_dsttime = 0;
+
+  if (gettimeofday (&tv, &tz) != 0)
+  {
+    return false;
+  }
+
+  tz_p->offset = tz.tz_minuteswest;
+  tz_p->daylight_saving_time = tz.tz_dsttime > 0 ? 1 : 0;
+
+  return true;
+#else /* !__GNUC__ */
+  return false;
+#endif /* __GNUC__ */
+} /* jerry_port_get_time_zone */
+
+/**
+ * Default implementation of jerry_port_get_current_time. Uses 'gettimeofday' if
+ * available on the system, does nothing otherwise.
+ *
+ * @return milliseconds since Unix epoch - if 'gettimeofday' is available and
+ *                                         executed successfully,
+ *         0 - otherwise.
+ */
+double jerry_port_get_current_time (void)
+{
+#ifdef __GNUC__
+  struct timeval tv;
+
+  if (gettimeofday (&tv, NULL) != 0)
+  {
+    return 0.0;
+  }
+
+  return ((double) tv.tv_sec) * 1000.0 + ((double) tv.tv_usec) / 1000.0;
+#else /* __!GNUC__ */
+  return 0.0;
+#endif /* __GNUC__ */
+} /* jerry_port_get_current_time */
diff --git a/deps/jerry/jerry-port/default/default-external-context.c b/deps/jerry/jerry-port/default/default-external-context.c
new file mode 100644 (file)
index 0000000..11c7fba
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+#include "jerryscript-port.h"
+#include "jerryscript-port-default.h"
+
+/**
+ * Pointer to the current instance.
+ * Note that it is a global variable, and is not a thread safe implementation.
+ */
+static jerry_instance_t *current_instance_p = NULL;
+
+/**
+ * Set the current_instance_p as the passed pointer.
+ */
+void
+jerry_port_default_set_instance (jerry_instance_t *instance_p) /**< points to the created instance */
+{
+  current_instance_p = instance_p;
+} /* jerry_port_default_set_instance */
+
+/**
+ * Get the current instance.
+ *
+ * @return the pointer to the current instance
+ */
+jerry_instance_t *
+jerry_port_get_current_instance (void)
+{
+  return current_instance_p;
+} /* jerry_port_get_current_instance */
diff --git a/deps/jerry/jerry-port/default/default-fatal.c b/deps/jerry/jerry-port/default/default-fatal.c
new file mode 100644 (file)
index 0000000..3577c38
--- /dev/null
@@ -0,0 +1,80 @@
+/* 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.
+ */
+
+#include <stdlib.h>
+
+#include "jerryscript-port.h"
+#include "jerryscript-port-default.h"
+
+#ifndef DISABLE_EXTRA_API
+
+static bool abort_on_fail = false;
+
+/**
+ * Sets whether 'abort' should be called instead of 'exit' upon exiting with
+ * non-zero exit code in the default implementation of jerry_port_fatal.
+ *
+ * Note:
+ *      This function is only available if the port implementation library is
+ *      compiled without the DISABLE_EXTRA_API macro.
+ */
+void jerry_port_default_set_abort_on_fail (bool flag) /**< new value of 'abort on fail' flag */
+{
+  abort_on_fail = flag;
+} /* jerry_port_default_set_abort_on_fail */
+
+/**
+ * Check whether 'abort' should be called instead of 'exit' upon exiting with
+ * non-zero exit code in the default implementation of jerry_port_fatal.
+ *
+ * @return true - if 'abort on fail' flag is set,
+ *         false - otherwise
+ *
+ * Note:
+ *      This function is only available if the port implementation library is
+ *      compiled without the DISABLE_EXTRA_API macro.
+ */
+bool jerry_port_default_is_abort_on_fail (void)
+{
+  return abort_on_fail;
+} /* jerry_port_default_is_abort_on_fail */
+
+#endif /* !DISABLE_EXTRA_API */
+
+/**
+ * Default implementation of jerry_port_fatal. Calls 'abort' if exit code is
+ * non-zero and "abort-on-fail" behaviour is enabled, 'exit' otherwise.
+ *
+ * Note:
+ *      The "abort-on-fail" behaviour is only available if the port
+ *      implementation library is compiled without the DISABLE_EXTRA_API macro.
+ */
+void jerry_port_fatal (jerry_fatal_code_t code)
+{
+#ifndef DISABLE_EXTRA_API
+  if (code != 0
+      && code != ERR_OUT_OF_MEMORY
+      && jerry_port_default_is_abort_on_fail ())
+  {
+    abort ();
+  }
+  else
+  {
+#endif /* !DISABLE_EXTRA_API */
+    exit (code);
+#ifndef DISABLE_EXTRA_API
+  }
+#endif /* !DISABLE_EXTRA_API */
+} /* jerry_port_fatal */
diff --git a/deps/jerry/jerry-port/default/default-io.c b/deps/jerry/jerry-port/default/default-io.c
new file mode 100644 (file)
index 0000000..6cca973
--- /dev/null
@@ -0,0 +1,84 @@
+/* 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.
+ */
+
+#include <stdarg.h>
+
+#include "jerryscript-port.h"
+#include "jerryscript-port-default.h"
+
+#ifndef DISABLE_EXTRA_API
+
+/**
+ * Actual log level
+ */
+static jerry_log_level_t jerry_port_default_log_level = JERRY_LOG_LEVEL_ERROR;
+
+#define JERRY_PORT_DEFAULT_LOG_LEVEL jerry_port_default_log_level
+
+/**
+ * Get the log level
+ *
+ * @return current log level
+ *
+ * Note:
+ *      This function is only available if the port implementation library is
+ *      compiled without the DISABLE_EXTRA_API macro.
+ */
+jerry_log_level_t
+jerry_port_default_get_log_level (void)
+{
+  return jerry_port_default_log_level;
+} /* jerry_port_default_get_log_level */
+
+/**
+ * Set the log level
+ *
+ * Note:
+ *      This function is only available if the port implementation library is
+ *      compiled without the DISABLE_EXTRA_API macro.
+ */
+void
+jerry_port_default_set_log_level (jerry_log_level_t level) /**< log level */
+{
+  jerry_port_default_log_level = level;
+} /* jerry_port_default_set_log_level */
+
+#else /* DISABLE_EXTRA_API */
+#define JERRY_PORT_DEFAULT_LOG_LEVEL JERRY_LOG_LEVEL_ERROR
+#endif /* !DISABLE_EXTRA_API */
+
+/**
+ * Default implementation of jerry_port_log. Prints log message to standard
+ * error with 'vfprintf' if message level is less than or equal to the set log
+ * level.
+ *
+ * Note:
+ *      Changing the log level from JERRY_LOG_LEVEL_ERROR is only possible if
+ *      the port implementation library is compiled without the
+ *      DISABLE_EXTRA_API macro.
+ */
+void
+jerry_port_log (jerry_log_level_t level, /**< log level */
+                const char *format, /**< format string */
+                ...)  /**< parameters */
+{
+  if (level <= JERRY_PORT_DEFAULT_LOG_LEVEL)
+  {
+    va_list args;
+    va_start (args, format);
+    vfprintf (stderr, format, args);
+    va_end (args);
+  }
+} /* jerry_port_log */
diff --git a/deps/jerry/jerry-port/default/defaultx-handler.c b/deps/jerry/jerry-port/default/defaultx-handler.c
new file mode 100644 (file)
index 0000000..0ded3ee
--- /dev/null
@@ -0,0 +1,28 @@
+/* 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.
+ */
+
+#include <stdio.h>
+
+#include "jerryscript-ext/handler.h"
+
+/**
+ * Default implementation of jerryx_port_handler_print_char. Uses 'printf' to
+ * print a single character to standard output.
+ */
+void
+jerryx_port_handler_print_char (char c) /**< the character to print */
+{
+  printf ("%c", c);
+} /* jerryx_port_handler_print_char */
diff --git a/deps/jerry/jerry-port/default/include/jerryscript-port-default.h b/deps/jerry/jerry-port/default/include/jerryscript-port-default.h
new file mode 100644 (file)
index 0000000..6d66cb9
--- /dev/null
@@ -0,0 +1,49 @@
+/* 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.
+ */
+
+#ifndef JERRYSCRIPT_PORT_DEFAULT_H
+#define JERRYSCRIPT_PORT_DEFAULT_H
+
+#include "jerryscript.h"
+#include "jerryscript-port.h"
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** \addtogroup jerry_port_default Default Jerry engine port API
+ * These functions are only available if the default port of Jerry is used.
+ * @{
+ */
+
+void jerry_port_default_set_abort_on_fail (bool flag);
+bool jerry_port_default_is_abort_on_fail (void);
+
+jerry_log_level_t jerry_port_default_get_log_level (void);
+void jerry_port_default_set_log_level (jerry_log_level_t level);
+
+void jerry_port_default_set_instance (jerry_instance_t *instance_p);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* !JERRYSCRIPT_PORT_DEFAULT_H */
diff --git a/deps/jerry/targets/curie_bsp/README.md b/deps/jerry/targets/curie_bsp/README.md
new file mode 100644 (file)
index 0000000..8e1e70a
--- /dev/null
@@ -0,0 +1,120 @@
+### About Curie BSP port
+[Intel® Curie BSP](https://github.com/CurieBSP/main/blob/master/README.rst) is the SDK that will help you developing software on Curie based boards, for example with the [Arduino 101 board (AKA Genuino 101)](https://www.arduino.cc/en/Main/ArduinoBoard101).
+
+This folder contains necessary files to integrate JerryScript with Intel® Curie BSP, so that JavaScript can run on Arduino 101 board (AKA Genuino 101).
+
+### How to build
+#### 1. Preface
+
+Curie BSP only support Ubuntu GNU/Linux as host OS envirenment.
+
+Necessary hardwares
+* [FlySwatter2 JTAG debugger](https://www.tincantools.com/wiki/Flyswatter2)
+* [ARM-JTAG-20-10](https://www.amazon.com/PACK-ARM-JTAG-20-10-Micro-JTAG-adapter/dp/B010ATK9OC/ref=sr_1_1?ie=UTF8&qid=1469635131&sr=8-1&keywords=ARM+Micro+JTAG+Connector)
+* [USB to TTL Serial Cable](https://www.adafruit.com/products/954)
+
+#### 2. Prepare Curie BSP
+
+You can refer to a detailed document [Curie BSP](https://github.com/CurieBSP/main/releases). But, we summary the main steps below:
+
+##### 1. Get repo:
+```
+mkdir ~/bin
+wget http://commondatastorage.googleapis.com/git-repo-downloads/repo -O ~/bin/repo
+chmod a+x ~/bin/repo
+```
+
+##### 2. In ``~/.bashrc`` add:
+```
+PATH=$PATH:~/bin
+```
+
+##### 3. Create your directory for CurieBSP (eg. Curie_BSP):
+```
+mkdir Curie_BSP && cd $_
+```
+
+##### 4. Initialize your repo:
+```
+repo init -u https://github.com/CurieBSP/manifest
+```
+
+##### 5. Download the sources files:
+```
+repo sync -j 5 -d
+```
+
+##### 6. Get toolchain (compilation/debug):
+Download [issm-toolchain-linux-2016-05-12.tar.gz](https://software.intel.com/en-us/articles/issm-toolchain-only-download), and uncompress it.
+**TOOLCHAIN_DIR** environment variable needs to match the toolchain destination folder
+You can use the command:``export TOOLCHAIN_DIR='path to files of the toolchain'``
+
+Or you can just uncompress the toolchain tarball and copy the contents (`licensing readme.txt tools  version.txt`) into `wearable_device_sw/external/toolchain`.
+
+##### 7. Get BLE firmware:
+Download [curie-ble-v3.1.1.tar.gz]( https://registrationcenter.intel.com/en/forms/?productid=2783) and uncompress the retrieved package into ``wearable_device_sw/packages`` folder
+
+You will first register in the web page. Then you will receive an email where is a download link. Click the link in the mail, choose the `curie-ble-v3.1.1.tar.gz (118 KB)` and download.
+
+##### 8. Get tools to flash the device:
+[https://01.org/android-ia/downloads/intel-platform-flash-tool-lite](https://01.org/android-ia/downloads/intel-platform-flash-tool-lite)
+
+
+#### 3. Build JerryScript and Curie BSP
+##### 1. Generate makefiles
+Run the Python script ``setup.py`` in ``jerryscript/targets/curie_bsp/`` with the full path or relative path of the ``Curie_BSP``:
+```
+python setup.py <path of Curie_BSP>
+```
+
+##### 2. One time setup. It will check/download/install the necessary tools, and must be run only once.
+In the directory ``Curie_BSP``
+```
+make -C wearable_device_sw/projects/curie_bsp_jerry/ one_time_setup
+```
+
+##### 3. In the directory ``Curie_BSP``
+```
+mkdir out && cd $_
+make -f ../wearable_device_sw/projects/curie_bsp_jerry/Makefile setup
+make image
+```
+
+##### 4. Connect JTAG Debugger and TTL Serial Cable to Arduino 101 as below:
+![](./image/connect.png)
+
+##### 5. Flash the firmware
+```
+make flash FLASH_CONFIG=jtag_full
+```
+
+
+#### 4. Serial terminal
+Assume the serial port is ``ttyUSB0`` in ``/dev`` directory, we can type command ``screen ttyUSB0 115200`` to open a serial terminal.
+
+After the board boot successfully, you should see something like this:
+```
+Quark SE ID 16 Rev 0 A0
+ARC Core state: 0000400
+BOOT TARGET: 0
+  6135|QRK| CFW| INFO| GPIO service init in progress..
+  6307|ARC|MAIN| INFO| BSP init done
+  6315|ARC| CFW| INFO| ADC service init in progress..
+  6315|ARC| CFW| INFO| GPIO service init in progress...
+  6315|ARC| CFW| INFO| GPIO service init in progress...
+  6315|ARC|MAIN| INFO| CFW init done
+```
+To test the JavaScript command, you should add characters ``js e `` to the beginning of the JavaScript command, like this:
+``js e print ('Hello World!');``
+
+It is the uart command format of Curie BSP. `js` is cmd group, `e` is cmd name, which is short for eval,  and `print ('Hello World!');` is the cmd parameters, which is the JavaScript code we want to run.
+
+You can see the result through the screen:
+```
+js e print ('Hello World!');js e 1 ACK
+Hello World!
+undefined
+js e 1 OK
+```
+
+`js e 1 ACK` and `js e 1 OK` are debug info of Curie BSP uart commands, which mean it receive and execute the command sucessfully. `Hello World!` is the printed content. `undefined` is the return value of the statement `print ('Hello World!')`.
diff --git a/deps/jerry/targets/curie_bsp/image/connect.png b/deps/jerry/targets/curie_bsp/image/connect.png
new file mode 100644 (file)
index 0000000..da48493
Binary files /dev/null and b/deps/jerry/targets/curie_bsp/image/connect.png differ
diff --git a/deps/jerry/targets/curie_bsp/include/inttypes.h b/deps/jerry/targets/curie_bsp/include/inttypes.h
new file mode 100644 (file)
index 0000000..9b0ba43
--- /dev/null
@@ -0,0 +1,18 @@
+/* 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.
+ */
+#ifndef INTTYPES_H
+#define INTTYPES_H
+
+#endif /* !INTTYPES_H */
diff --git a/deps/jerry/targets/curie_bsp/include/setjmp.h b/deps/jerry/targets/curie_bsp/include/setjmp.h
new file mode 100644 (file)
index 0000000..aad7f93
--- /dev/null
@@ -0,0 +1,25 @@
+/* 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.
+ */
+#ifndef SETJMP_H
+#define SETJMP_H
+
+#include <stdint.h>
+
+typedef uint64_t jmp_buf[14];
+
+int setjmp (jmp_buf env);
+void longjmp (jmp_buf env, int val);
+
+#endif /* !SETJMP_H */
diff --git a/deps/jerry/targets/curie_bsp/jerry_app/arc/defconfig b/deps/jerry/targets/curie_bsp/jerry_app/arc/defconfig
new file mode 100644 (file)
index 0000000..92e3eac
--- /dev/null
@@ -0,0 +1,16 @@
+CONFIG_AUTO_SERVICE_INIT=y
+CONFIG_CFW_PROXY=y
+CONFIG_CFW_QUARK_SE_HELPERS=y
+CONFIG_LOG_SLAVE=y
+CONFIG_MEM_POOL_DEF_PATH="$(PROJECT_PATH)/arc"
+CONFIG_OS_ZEPHYR=y
+CONFIG_SERVICES_QUARK_SE_ADC_IMPL=y
+CONFIG_SERVICES_QUARK_SE_GPIO_IMPL=y
+CONFIG_SOC_GPIO_AON=y
+CONFIG_SOC_GPIO=y
+CONFIG_SS_ADC=y
+CONFIG_SS_GPIO=y
+CONFIG_TCMD_SLAVE=y
+CONFIG_TCMD=y
+CONFIG_ZEPHYR_BOARD="arduino_101_sss"
+CONFIG_CONSOLE_HANDLER_SHELL=y
diff --git a/deps/jerry/targets/curie_bsp/jerry_app/arc/main.c b/deps/jerry/targets/curie_bsp/jerry_app/arc/main.c
new file mode 100644 (file)
index 0000000..6042e44
--- /dev/null
@@ -0,0 +1,35 @@
+/* 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.
+ */
+/* infra */
+#include "infra/log.h"
+#include "infra/bsp.h"
+#include "infra/xloop.h"
+#include "cfw/cfw.h"
+
+static xloop_t loop;
+
+void main (void)
+{
+  T_QUEUE queue = bsp_init ();
+
+  pr_info (LOG_MODULE_MAIN, "BSP init done");
+
+  cfw_init (queue);
+  pr_info (LOG_MODULE_MAIN, "CFW init done");
+
+  xloop_init_from_queue (&loop, queue);
+
+  xloop_run (&loop);
+}
diff --git a/deps/jerry/targets/curie_bsp/jerry_app/arc/memory_pool_list.def b/deps/jerry/targets/curie_bsp/jerry_app/arc/memory_pool_list.def
new file mode 100644 (file)
index 0000000..e06b593
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * Definition of the memory pools used by balloc/bfree:
+ *  DECLARE_MEMORY_POOL( <index>, <size>, <count>, <align> )
+ *  <index> : must start at 0 and be of consecutive values *
+ *  <size>  : size in bytes of each block from the pool
+ *  <count> : number of blocks in the pool
+ *
+ *  * Pool definitions must be sorted according the block size
+ *  value: pool with <index> 0 must have the smallest <size>.
+ */
+
+DECLARE_MEMORY_POOL(0,8,32)
+DECLARE_MEMORY_POOL(1,16,32)
+DECLARE_MEMORY_POOL(2,32,48)
+DECLARE_MEMORY_POOL(3,64,16)
+DECLARE_MEMORY_POOL(4,96,24)
+DECLARE_MEMORY_POOL(5,128,6)
+DECLARE_MEMORY_POOL(6,256,5)
+DECLARE_MEMORY_POOL(7,512,1)
+
+#undef DECLARE_MEMORY_POOL
diff --git a/deps/jerry/targets/curie_bsp/jerry_app/include/project_mapping.h b/deps/jerry/targets/curie_bsp/jerry_app/include/project_mapping.h
new file mode 100644 (file)
index 0000000..2182d88
--- /dev/null
@@ -0,0 +1,30 @@
+/* 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.
+ */
+
+/**
+ * Allow project to override this partition scheme
+ * The following variables are allowed to be defined:
+ *
+ * QUARK_START_PAGE the first page where the QUARK code is located
+ * QUARK_NB_PAGE the number of pages reserved for the QUARK. The ARC gets the
+ *               remaining pages (out of 148).
+ */
+#ifndef PROJECT_MAPPING_H
+#define PROJECT_MAPPING_H
+
+#define QUARK_NB_PAGE 125
+#include "machine/soc/intel/quark_se/quark_se_mapping.h"
+
+#endif /* !PROJECT_MAPPING_H */
diff --git a/deps/jerry/targets/curie_bsp/jerry_app/quark/defconfig b/deps/jerry/targets/curie_bsp/jerry_app/quark/defconfig
new file mode 100644 (file)
index 0000000..efc4775
--- /dev/null
@@ -0,0 +1,35 @@
+CONFIG_AUTO_SERVICE_INIT=y
+CONFIG_CFW_QUARK_SE_HELPERS=y
+CONFIG_CONSOLE_MANAGER=y
+CONFIG_DEBUG_PANIC_TCMD=y
+CONFIG_FACTORY_DATA_WRITE=y
+CONFIG_FACTORY_DATA=y
+CONFIG_INTEL_QRK_AON_PT=y
+CONFIG_INTEL_QRK_RTC=y
+CONFIG_INTEL_QRK_SPI=y
+CONFIG_INTEL_QRK_WDT=y
+CONFIG_LOG_CBUFFER_SIZE=2048
+CONFIG_LOG_CBUFFER=y
+CONFIG_MEMORY_POOLS_BALLOC_STATISTICS=y
+CONFIG_MEMORY_POOLS_BALLOC_TRACK_OWNER=y
+CONFIG_MEM_POOL_DEF_PATH="$(PROJECT_PATH)/quark"
+CONFIG_OS_ZEPHYR=y
+CONFIG_PANIC_ON_BUS_ERROR=y
+CONFIG_QUARK_SE_PROPERTIES_STORAGE=y
+CONFIG_QUARK=y
+CONFIG_SERVICES_QUARK_SE_ADC=y
+CONFIG_SERVICES_QUARK_SE_GPIO_IMPL=y
+CONFIG_SERVICES_QUARK_SE_GPIO=y
+CONFIG_SOC_FLASH=y
+CONFIG_SOC_GPIO_32=y
+CONFIG_SOC_GPIO=y
+CONFIG_SOC_ROM=y
+CONFIG_SPI_FLASH_W25Q16DV=y
+CONFIG_STORAGE_TASK=y
+CONFIG_TCMD_CONSOLE=y
+CONFIG_TCMD_MASTER=y
+CONFIG_TCMD=y
+CONFIG_UART_NS16550=y
+CONFIG_UART_PM_NS16550=y
+CONFIG_ZEPHYR_BOARD="arduino_101"
+CONFIG_CONSOLE_HANDLER_SHELL=y
diff --git a/deps/jerry/targets/curie_bsp/jerry_app/quark/main.c b/deps/jerry/targets/curie_bsp/jerry_app/quark/main.c
new file mode 100644 (file)
index 0000000..e7b49a6
--- /dev/null
@@ -0,0 +1,168 @@
+/* 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.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+
+/* Infra */
+#include "infra/bsp.h"
+#include "infra/reboot.h"
+#include "infra/log.h"
+#include "infra/time.h"
+#include "infra/system_events.h"
+#include "infra/tcmd/handler.h"
+
+#include "cfw/cfw.h"
+/* Watchdog helper */
+#include "infra/wdt_helper.h"
+
+#include "jerryscript.h"
+#include "jerryscript-port.h"
+#include "string.h"
+
+#include "zephyr.h"
+#include "microkernel/task.h"
+#include "os/os.h"
+#include "misc/printk.h"
+
+static T_QUEUE queue;
+
+jerry_value_t print_function;
+
+void jerry_resolve_error (jerry_value_t ret_value)
+{
+  if (jerry_value_has_error_flag (ret_value))
+  {
+    jerry_value_clear_error_flag (&ret_value);
+    jerry_value_t err_str_val = jerry_value_to_string (ret_value);
+    jerry_size_t err_str_size = jerry_get_string_size (err_str_val);
+    jerry_char_t *err_str_buf = (jerry_char_t *) balloc (err_str_size, NULL);
+    jerry_size_t sz = jerry_string_to_char_buffer (err_str_val, err_str_buf, err_str_size);
+    err_str_buf[sz] = 0;
+    printk ("Script Error: unhandled exception: %s\n", err_str_buf);
+    bfree(err_str_buf);
+    jerry_release_value (err_str_val);
+  }
+}
+
+void help ()
+{
+  printk ("Usage:\n");
+  printk ("js e 'JavaScript Command'\n");
+  printk ("eg. js e print ('Hello World');\n");
+}
+
+void eval_jerry_script (int argc, char *argv[], struct tcmd_handler_ctx *ctx)
+{
+  if (argc < 3)
+  {
+    TCMD_RSP_ERROR (ctx, NULL);
+    help ();
+    return;
+  }
+  else
+  {
+    OS_ERR_TYPE err;
+    size_t str_total_length = 0;
+    size_t *str_lens = (size_t *) balloc ((argc - 2) * sizeof(size_t), &err);
+    if (str_lens == NULL || err != E_OS_OK)
+    {
+      printk ("%s: allocate memory failed!", __func__);
+      TCMD_RSP_ERROR (ctx, NULL);
+      return;
+    }
+    for (int i = 2; i < argc; ++i)
+    {
+      str_lens[i - 2] = strlen (argv[i]);
+      str_total_length += str_lens[i - 2] + 1;
+    }
+    err = E_OS_OK;
+    char *buffer = (char *) balloc (str_total_length, &err);
+    if (buffer == NULL || err != E_OS_OK)
+    {
+      printk ("%s: allocate memory failed!", __func__);
+      TCMD_RSP_ERROR (ctx, NULL);
+      return;
+    }
+
+    char *p = buffer;
+    for (int i = 2; i < argc; ++i)
+    {
+      for (int j =0; j < str_lens[i - 2]; ++j)
+      {
+        *p = argv[i][j];
+        ++p;
+      }
+      *p = ' ';
+      ++p;
+    }
+    *p = '\0';
+
+    jerry_value_t eval_ret = jerry_eval (buffer, str_total_length - 1, false);
+
+    if (jerry_value_has_error_flag (eval_ret))
+    {
+      jerry_resolve_error (eval_ret);
+      TCMD_RSP_ERROR (ctx, NULL);
+    }
+    else
+    {
+      jerry_value_t args[] = {eval_ret};
+      jerry_value_t ret_val_print = jerry_call_function (print_function,
+                                                         jerry_create_undefined (),
+                                                         args,
+                                                         1);
+      jerry_release_value (ret_val_print);
+      TCMD_RSP_FINAL (ctx, NULL);
+    }
+    jerry_release_value (eval_ret);
+    bfree (buffer);
+    bfree (str_lens);
+  }
+}
+
+void jerry_start ()
+{
+  jerry_init (JERRY_INIT_EMPTY);
+  jerry_value_t global_obj_val = jerry_get_global_object ();
+  jerry_value_t print_func_name_val = jerry_create_string ((jerry_char_t *) "print");
+  print_function = jerry_get_property (global_obj_val, print_func_name_val);
+  jerry_release_value (print_func_name_val);
+  jerry_release_value (global_obj_val);
+}
+
+/* Application main entry point */
+void main_task (void *param)
+{
+  /* Init BSP (also init BSP on ARC core) */
+  queue = bsp_init ();
+  /* start Quark watchdog */
+  wdt_start (WDT_MAX_TIMEOUT_MS);
+  /* Init the CFW */
+  cfw_init (queue);
+  jerry_start ();
+  /* Loop to process message queue */
+  while (1)
+  {
+    OS_ERR_TYPE err = E_OS_OK;
+    /* Process message with a given timeout */
+    queue_process_message_wait (queue, 5000, &err);
+    /* Acknowledge the system watchdog to prevent panic and reset */
+    wdt_keepalive ();
+  }
+}
+
+DECLARE_TEST_COMMAND (js, e, eval_jerry_script);
diff --git a/deps/jerry/targets/curie_bsp/jerry_app/quark/memory_pool_list.def b/deps/jerry/targets/curie_bsp/jerry_app/quark/memory_pool_list.def
new file mode 100644 (file)
index 0000000..7f6a571
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/*
+ * Definition of the memory pools used by balloc/bfree:
+ *  DECLARE_MEMORY_POOL( <index>, <size>, <count>, <align> )
+ *  <index> : must start at 0 and be of consecutive values *
+ *  <size>  : size in bytes of each block from the pool
+ *  <count> : number of blocks in the pool
+ *
+ *  * Pool definitions must be sorted according the block size
+ *  value: pool with <index> 0 must have the smallest <size>.
+ */
+
+DECLARE_MEMORY_POOL(0,8,32)
+DECLARE_MEMORY_POOL(1,16,64)
+DECLARE_MEMORY_POOL(2,32,64)
+DECLARE_MEMORY_POOL(3,64,48)
+DECLARE_MEMORY_POOL(4,128,8)
+DECLARE_MEMORY_POOL(5,256,4)
+DECLARE_MEMORY_POOL(6,512,3)
+DECLARE_MEMORY_POOL(7,4096,1)
+
+#undef DECLARE_MEMORY_POOL
diff --git a/deps/jerry/targets/curie_bsp/setup.py b/deps/jerry/targets/curie_bsp/setup.py
new file mode 100755 (executable)
index 0000000..cc5a7b4
--- /dev/null
@@ -0,0 +1,253 @@
+#!/usr/bin/env python
+
+# 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.
+#
+import fnmatch
+import os
+
+def build_soft_links(project_path, jerry_path):
+    """ Creates soft links into the @project_path. """
+
+    if not os.path.exists(project_path):
+        os.makedirs(project_path)
+
+    links = [
+        { # arc
+            'src': os.path.join('targets', 'curie_bsp', 'jerry_app', 'arc'),
+            'link_name': 'arc'
+        },
+        { # include
+            'src': os.path.join('targets', 'curie_bsp', 'jerry_app', 'include'),
+            'link_name': 'include'
+        },
+        { # quark
+            'src': os.path.join('targets', 'curie_bsp', 'jerry_app', 'quark'),
+            'link_name': 'quark'
+        },
+        { # quark/jerryscript
+            'src': jerry_path,
+            'link_name': os.path.join('quark', 'jerryscript')
+        }
+    ]
+
+    for link in links:
+        src = os.path.join(jerry_path, link['src'])
+        link_name = os.path.join(project_path, link['link_name'])
+        if not os.path.islink(link_name):
+            os.symlink(src, link_name)
+            print("Created symlink '{link_name}' -> '{src}'".format(src=src, link_name=link_name))
+
+
+def find_sources(root_dir, sub_dir):
+    """
+    Find .c and .S files inside the @root_dir/@sub_dir directory.
+    Note: the returned paths will be relative to the @root_dir directory.
+    """
+    src_dir = os.path.join(root_dir, sub_dir)
+
+    matches = []
+    for root, dirnames, filenames in os.walk(src_dir):
+        for filename in fnmatch.filter(filenames, '*.[c|S]'):
+            file_path = os.path.join(root, filename)
+            relative_path = os.path.relpath(file_path, root_dir)
+            matches.append(relative_path)
+
+    return matches
+
+
+def build_jerry_data(jerry_path):
+    """
+    Build up a dictionary which contains the following items:
+     - sources: list of JerryScript sources which should be built.
+     - dirs: list of JerryScript dirs used.
+     - cflags: CFLAGS for the build.
+    """
+    jerry_sources = []
+    jerry_dirs = set()
+    for sub_dir in ['jerry-core', 'jerry-libm', os.path.join('targets', 'curie_bsp', 'source')]:
+        for file in find_sources(os.path.normpath(jerry_path), sub_dir):
+            path = os.path.join('jerryscript', file)
+            jerry_sources.append(path)
+            jerry_dirs.add(os.path.split(path)[0])
+
+    jerry_cflags = [
+        '-DCONFIG_MEM_HEAP_AREA_SIZE=10*1024',
+        '-DJERRY_NDEBUG',
+        '-DJERRY_JS_PARSER',
+        '-DJERRY_DISABLE_HEAVY_DEBUG',
+        '-DCONFIG_DISABLE_NUMBER_BUILTIN',
+        '-DCONFIG_DISABLE_STRING_BUILTIN',
+        '-DCONFIG_DISABLE_BOOLEAN_BUILTIN',
+        #'-DCONFIG_DISABLE_ERROR_BUILTINS',
+        '-DCONFIG_DISABLE_ARRAY_BUILTIN',
+        '-DCONFIG_DISABLE_MATH_BUILTIN',
+        '-DCONFIG_DISABLE_JSON_BUILTIN',
+        '-DCONFIG_DISABLE_DATE_BUILTIN',
+        '-DCONFIG_DISABLE_REGEXP_BUILTIN',
+        '-DCONFIG_DISABLE_ANNEXB_BUILTIN',
+        '-DCONFIG_DISABLE_ES2015_ARRAYBUFFER_BUILTIN',
+        '-DCONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN',
+        '-DCONFIG_ECMA_LCACHE_DISABLE',
+        '-DCONFIG_ECMA_PROPERTY_HASHMAP_DISABLE',
+    ]
+
+    return {
+        'sources': jerry_sources,
+        'dirs': jerry_dirs,
+        'cflags': jerry_cflags,
+    }
+
+
+def write_file(path, content):
+    """ Writes @content into the file at specified by the @path. """
+    norm_path = os.path.normpath(path)
+    with open(norm_path, "w+") as f:
+        f.write(content)
+    print("Wrote file '{0}'".format(norm_path))
+
+
+def build_obj_y(source_list):
+    """
+    Build obj-y additions from the @source_list.
+    Note: the input sources should have their file extensions.
+    """
+    return '\n'.join(['obj-y += {0}.o'.format(os.path.splitext(fname)[0]) for fname in source_list])
+
+
+def build_cflags_y(cflags_list):
+    """
+    Build cflags-y additions from the @cflags_list.
+    Note: the input sources should have their file extensions.
+    """
+    return '\n'.join(['cflags-y += {0}'.format(cflag) for cflag in cflags_list])
+
+
+def build_mkdir(dir_list):
+    """ Build mkdir calls for each dir in the @dir_list. """
+    return '\n'.join(['\t$(AT)mkdir -p {0}'.format(os.path.join('$(OUT_SRC)', path)) for path in dir_list])
+
+
+def create_root_kbuild(project_path):
+    """ Creates @project_path/Kbuild.mk file. """
+
+    root_kbuild_path = os.path.join(project_path, 'Kbuild.mk')
+    root_kbuild_content = '''
+obj-$(CONFIG_QUARK_SE_ARC) += arc/
+obj-$(CONFIG_QUARK_SE_QUARK) += quark/
+'''
+    write_file(root_kbuild_path, root_kbuild_content)
+
+
+def create_root_makefile(project_path):
+    """ Creates @project_path/Makefile file. """
+
+    root_makefile_path = os.path.join(project_path, 'Makefile')
+    root_makefile_content = '''
+THIS_DIR   := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
+T          := $(abspath $(THIS_DIR)/../..)
+PROJECT    := {project_name}
+BOARD        := curie_101
+ifeq ($(filter curie_101, $(BOARD)),)
+$(error The curie jerry sample application can only run on the curie_101 Board)
+endif
+BUILDVARIANT ?= debug
+quark_DEFCONFIG = $(PROJECT_PATH)/quark/defconfig
+arc_DEFCONFIG = $(PROJECT_PATH)/arc/defconfig
+
+# Optional: set the default version
+VERSION_MAJOR  := 1
+VERSION_MINOR  := 0
+VERSION_PATCH  := 0
+include $(T)/build/project.mk
+'''.format(project_name=project_name)
+
+    write_file(root_makefile_path, root_makefile_content)
+
+
+def create_arc_kbuild(project_path):
+    """ Creates @project_path/arc/Kbuild.mk file. """
+
+    arc_path = os.path.join(project_path, 'arc')
+    arc_kbuild_path = os.path.join(arc_path, 'Kbuild.mk')
+    arc_sources = find_sources(arc_path, '.')
+    arc_kbuild_content = build_obj_y(arc_sources)
+
+    write_file(arc_kbuild_path, arc_kbuild_content)
+
+
+def create_quark_kbuild(project_path, jerry_path):
+    """ Creates @project_path/quark/Kbuild.mk file. """
+    quark_kbuild_path = os.path.join(project_path, 'quark', 'Kbuild.mk')
+
+    # Extract a few JerryScript related data
+    jerry_data = build_jerry_data(jerry_path)
+    jerry_objects = build_obj_y(jerry_data['sources'])
+    jerry_defines = jerry_data['cflags']
+    jerry_build_dirs = build_mkdir(jerry_data['dirs'])
+
+    quark_include_paths = [
+        'include',
+        'jerryscript',
+        os.path.join('jerryscript', 'jerry-libm', 'include'),
+        os.path.join('jerryscript', 'targets' ,'curie_bsp', 'include')
+    ] + list(jerry_data['dirs'])
+
+    quark_includes = [
+        '-Wno-error',
+    ] + ['-I%s' % os.path.join(project_path, 'quark', path) for path in quark_include_paths]
+
+    quark_cflags = build_cflags_y(jerry_defines + quark_includes)
+
+    quark_kbuild_content = '''
+{cflags}
+
+obj-y += main.o
+{objects}
+
+build_dirs:
+{dirs}
+
+$(OUT_SRC): build_dirs
+'''.format(objects=jerry_objects, cflags=quark_cflags, dirs=jerry_build_dirs)
+
+    write_file(quark_kbuild_path, quark_kbuild_content)
+
+
+def main(curie_path, project_name, jerry_path):
+    project_path = os.path.join(curie_path, 'wearable_device_sw', 'projects', project_name)
+
+    build_soft_links(project_path, jerry_path)
+
+    create_root_kbuild(project_path)
+    create_root_makefile(project_path)
+    create_arc_kbuild(project_path)
+    create_quark_kbuild(project_path, jerry_path)
+
+
+if __name__ == '__main__':
+    import sys
+
+    if len(sys.argv) != 2:
+        print('Usage:')
+        print('{script_name} [full or relative path of Curie_BSP]'.format(script_name=sys.argv[0]))
+        sys.exit(1)
+
+    project_name = 'curie_bsp_jerry'
+
+    file_dir = os.path.dirname(os.path.abspath(__file__))
+    jerry_path = os.path.join(file_dir, "..", "..")
+    curie_path = os.path.join(os.getcwd(), sys.argv[1])
+
+    main(curie_path, project_name, jerry_path)
diff --git a/deps/jerry/targets/curie_bsp/source/curie-bsp-port.c b/deps/jerry/targets/curie_bsp/source/curie-bsp-port.c
new file mode 100644 (file)
index 0000000..97cb896
--- /dev/null
@@ -0,0 +1,75 @@
+/* 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.
+ */
+
+#include <infra/time.h>
+#include <misc/printk.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include "jerryscript-port.h"
+
+/**
+ * Provide log message implementation for the engine.
+ * Curie BSP implementation
+ */
+void
+jerry_port_log (jerry_log_level_t level, /**< log level */
+                const char *format, /**< format string */
+                ...)  /**< parameters */
+{
+  if (level <= JERRY_LOG_LEVEL_ERROR)
+  {
+    char buf[256];
+    int length = 0;
+    va_list args;
+    va_start (args, format);
+    length = vsnprintf (buf, 256, format, args);
+    buf[length] = '\0';
+    printk ("%s", buf);
+    va_end (args);
+  }
+} /* jerry_port_log */
+
+/**
+ * Curie BSP implementation of jerry_port_fatal.
+ */
+void jerry_port_fatal (jerry_fatal_code_t code)
+{
+  jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Jerry Fatal Error!\n");
+  while (true);
+} /* jerry_port_fatal */
+
+/**
+ * Curie BSP implementation of jerry_port_get_time_zone.
+ */
+bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
+{
+  //EMPTY implementation
+  tz_p->offset = 0;
+  tz_p->daylight_saving_time = 0;
+
+  return true;
+} /* jerry_port_get_time_zone */
+
+/**
+ * Curie BSP implementation of jerry_port_get_current_time.
+ */
+double jerry_port_get_current_time (void)
+{
+  uint32_t uptime_ms = get_uptime_ms ();
+  uint32_t epoch_time = uptime_to_epoch (uptime_ms);
+
+  return ((double) epoch_time) * 1000.0;
+} /* jerry_port_get_current_time */
diff --git a/deps/jerry/targets/curie_bsp/source/setjmp.S b/deps/jerry/targets/curie_bsp/source/setjmp.S
new file mode 100644 (file)
index 0000000..f1f87ec
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ */
+
+.macro func _name
+.global \_name
+.type \_name, %function
+\_name:
+.endm
+.macro endfunc _name
+.size \_name, .-\_name
+.endm
+
+/**
+ * setjmp (jmp_buf env)
+ *
+ * See also:
+ *          longjmp
+ *
+ * @return 0 - if returns from direct call,
+ *         nonzero - if returns after longjmp.
+ */
+func setjmp
+  mov    %eax,(%eax);
+  mov    %ebx,0x4(%eax);
+  mov    %ecx,0x8(%eax);
+  mov    %edx,0xc(%eax);
+  mov    %esi,0x10(%eax);
+  mov    %edi,0x14(%eax);
+  mov    %ebp,0x18(%eax);
+  mov    %esp,0x1c(%eax);
+  push   %edx;
+  mov    0x4(%esp),%edx;
+  mov    %edx,0x20(%eax);
+  pop    %edx;
+  xor    %eax,%eax;
+  ret
+endfunc setjmp
+
+/**
+ * longjmp (jmp_buf env, int val)
+ *
+ * Note:
+ *      if val is not 0, then it would be returned from setjmp,
+ *      otherwise - 0 would be returned.
+ *
+ * See also:
+ *          setjmp
+ */
+func longjmp
+  test   %edx, %edx;
+  jne    . + 0x3;
+  inc    %edx;
+  mov    0x4(%eax),%ebx;
+  mov    0x8(%eax),%ecx;
+  mov    0x10(%eax),%esi;
+  mov    0x14(%eax),%edi;
+  mov    0x18(%eax),%ebp;
+  mov    0x1c(%eax),%esp;
+  push   %edx;
+  mov    0x20(%eax),%edx;
+  mov    %edx,0x4(%esp);
+  mov    0xc(%eax),%edx;
+  pop    %eax;
+  ret
+endfunc longjmp
diff --git a/deps/jerry/targets/esp8266/LICENSE b/deps/jerry/targets/esp8266/LICENSE
new file mode 100644 (file)
index 0000000..31c1f3f
--- /dev/null
@@ -0,0 +1,56 @@
+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.
+
+================================================================================
+
+ESPRSSIF MIT License
+
+Copyright (c) 2015 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
+
+Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
+it is free of charge, to any person obtaining a copy of this software and associated
+documentation files (the ¡°Software¡±), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or
+substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED ¡°AS IS¡±, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+
+ÀÖöΠMIT Ðí¿ÉÖ¤
+
+°æÈ¨ (c) 2015  <ÀÖöÎÐÅÏ¢¿Æ¼¼£¨ÉϺ££©ÓÐÏÞ¹«Ë¾>
+
+¸ÃÐí¿ÉÖ¤ÊÚȨ½öÏÞÓÚÀÖöÎÐÅÏ¢¿Æ¼¼ ESP8266 ²úÆ·µÄÓ¦Óÿª·¢¡£ÔÚ´ËÇé¿öÏ£¬¸ÃÐí¿ÉÖ¤Ãâ·ÑÊÚȨÈκλñµÃ¸Ã
+Èí¼þ¼°ÆäÏà¹ØÎĵµ£¨Í³³ÆÎª¡°Èí¼þ¡±£©µÄÈËÎÞÏÞÖÆµØ¾­Óª¸ÃÈí¼þ£¬°üÀ¨ÎÞÏÞÖÆµÄʹÓᢸ´ÖÆ¡¢Ð޸ġ¢ºÏ²¢¡¢
+³ö°æ·¢ÐС¢É¢²¼¡¢ÔÙÊÚȨ¡¢¼°··ÊÛÈí¼þ¼°Èí¼þ¸±±¾µÄȨÀû¡£±»ÊÚȨÈËÔÚÏíÊÜÕâЩȨÀûµÄͬʱ£¬Ðè·þ´ÓÏÂÃæ
+µÄÌõ¼þ£º
+
+ÔÚÈí¼þºÍÈí¼þµÄËùÓи±±¾Öж¼±ØÐë°üº¬ÒÔÉϵİæÈ¨ÉùÃ÷ºÍÊÚȨÉùÃ÷¡£
+
+¸ÃÈí¼þ°´±¾À´µÄÑù×ÓÌṩ£¬Ã»ÓÐÈκÎÃ÷È·»ò°µº¬µÄµ£±££¬°üÀ¨µ«²»½öÏÞÓÚ¹ØÓÚÊÔÏúÐÔ¡¢ÊʺÏÄ³Ò»ÌØ¶¨ÓÃ;
+ºÍ·ÇÇÖȨµÄ±£Ö¤¡£×÷ÕߺͰæÈ¨³ÖÓÐÈËÔÚÈκÎÇé¿öϾù²»¾ÍÓÉÈí¼þ»òÈí¼þʹÓÃÒýÆðµÄÒÔºÏͬÐÎʽ¡¢ÃñÊÂÇÖȨ
+»òÆäËü·½Ê½Ìá³öµÄÈκÎË÷Åâ¡¢Ë𺦻òÆäËüÔðÈθºÔð¡£
+
+
+
+
diff --git a/deps/jerry/targets/esp8266/Makefile b/deps/jerry/targets/esp8266/Makefile
new file mode 100644 (file)
index 0000000..f034f1f
--- /dev/null
@@ -0,0 +1,146 @@
+# 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.
+
+#############################################################
+# Required variables for each makefile
+# Discard this section from all parent makefiles
+# Expected variables (with automatic defaults):
+#   CSRCS (all "C" files in the dir)
+#   SUBDIRS (all subdirs with a Makefile)
+#   GEN_LIBS - list of libs to be generated ()
+#   GEN_IMAGES - list of object file images to be generated ()
+#   GEN_BINS - list of binaries to be generated ()
+#   COMPONENTS_xxx - a list of libs/objs in the form
+#     subdir/lib to be extracted and rolled up into
+#     a generated lib/image xxx.a ()
+#
+# Tabsize : 8
+#
+TARGET = eagle
+FLAVOR = release
+#FLAVOR = debug
+
+#EXTRA_CCFLAGS += -u
+
+ifndef PDIR # {
+GEN_IMAGES= eagle.app.v6.out
+GEN_BINS= eagle.app.v6.bin
+SPECIAL_MKTARGETS=$(APP_MKTARGETS)
+SUBDIRS= user
+endif # } PDIR
+
+LDDIR = $(SDK_PATH)/ld
+
+CCFLAGS += -Os
+#CCFLAGS += -O0
+
+TARGET_LDFLAGS =                                       \
+       -nostdlib                                       \
+       -Wl,-EL                                         \
+       --longcalls                                     \
+       --text-section-literals
+
+ifeq ($(FLAVOR),debug)
+       TARGET_LDFLAGS += -O0
+endif
+
+ifeq ($(FLAVOR),release)
+       TARGET_LDFLAGS += -Os
+endif
+
+COMPONENTS_eagle.app.v6 =                              \
+       user/libuser.a                                  \
+
+
+LINKFLAGS_eagle.app.v6 =                               \
+       -L$(SDK_PATH)/lib                               \
+       -Wl,--gc-sections                               \
+       -Wl,-Map,output.map                             \
+       -nostdlib                                       \
+       -T$(LD_FILE)                                    \
+       -Wl,--no-check-sections                         \
+       -u call_user_start                              \
+       -Wl,-static                                     \
+       -Wl,--start-group                               \
+       -lminic                                         \
+       -lgcc                                           \
+       -lhal                                           \
+       -lphy                                           \
+       -lpp                                            \
+       -lnet80211                                      \
+       -lwpa                                           \
+       -lmain                                          \
+       -lfreertos                                      \
+       -llwip                                          \
+       -L./libs                                        \
+       -ljerrycore                                     \
+       -ljerryentry                                    \
+       -ljerrylibm                                     \
+       $(DEP_LIBS_eagle.app.v6)                        \
+       ./libs/lib_a-setjmp.o                           \
+       -Wl,--end-group
+
+
+DEPENDS_eagle.app.v6 =                                 \
+       $(LD_FILE)                                      \
+       $(LDDIR)/eagle.rom.addr.v6.ld                   \
+       ./source/jerry-targetjs.h                       \
+       ./libs/libjerrylibm.a                           \
+       ./libs/libjerrycore.a                           \
+       ./libs/libjerryentry.a
+
+
+#############################################################
+# Configuration i.e. compile options etc.
+# Target specific stuff (defines etc.) goes in here!
+# Generally values applying to a tree are captured in the
+#   makefile at its root level - these are then overridden
+#   for a subtree within the makefile rooted therein
+#
+
+#UNIVERSAL_TARGET_DEFINES =    \
+
+# Other potential configuration flags include:
+#  -DTXRX_TXBUF_DEBUG
+#  -DTXRX_RXBUF_DEBUG
+#  -DWLAN_CONFIG_CCX
+CONFIGURATION_DEFINES = -DICACHE_FLASH
+
+DEFINES += \
+       $(UNIVERSAL_TARGET_DEFINES) \
+       $(CONFIGURATION_DEFINES)
+
+DDEFINES += \
+       $(UNIVERSAL_TARGET_DEFINES) \
+       $(CONFIGURATION_DEFINES)
+
+
+#############################################################
+# Recursion Magic - Don't touch this!!
+#
+# Each subtree potentially has an include directory
+#   corresponding to the common APIs applicable to modules
+#   rooted at that subtree. Accordingly, the INCLUDE PATH
+#   of a module can only contain the include directories up
+#   its parent path, and not its siblings
+#
+# Required for each makefile to inherit from the parent
+#
+
+INCLUDES := $(INCLUDES) -I $(PDIR)include -I $(PDIR)source
+sinclude $(SDK_PATH)/Makefile
+
+.PHONY: FORCE
+
+FORCE:
diff --git a/deps/jerry/targets/esp8266/Makefile.esp8266 b/deps/jerry/targets/esp8266/Makefile.esp8266
new file mode 100644 (file)
index 0000000..2ac0213
--- /dev/null
@@ -0,0 +1,125 @@
+# 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.
+
+# use TAB-8
+
+CURDIR     = `pwd`
+ESP_SDK_PATH ?= $(SDK_PATH)
+ESP_INC    = $(ESP_SDK_PATH)/extra_include
+ESP_INC2   = $(ESP_SDK_PATH)/include
+ESP_LIB    = $(ESP_SDK_PATH)/lib
+TYPE       = release
+INTERM     = build/obj-esp8266
+OUTPUT     = build/bin/$(TYPE).esp8266
+SRCPATH    = targets/esp8266/source
+COPYTARGET = targets/esp8266/libs
+USBDEVICE  ?= /dev/ttyUSB0
+JERRYHEAP  ?= 20
+ESPTOOL    ?= /opt/Espressif/esptool-py/esptool.py
+
+# compile flags
+ESP_CFLAGS := -D__TARGET_ESP8266 -D__attr_always_inline___=
+
+MFORCE32 = `xtensa-lx106-elf-gcc --help=target | grep mforce-l32`
+
+ifneq ($(MFORCE32),)
+    # Your compiler supports the -mforce-l32 flag which means that
+    # constants can be placed in ROM to free additional RAM
+    ESP_CFLAGS += -DJERRY_CONST_DATA="__attribute__((aligned(4))) __attribute__((section(\".irom.text\")))"
+endif
+
+ESP_CFLAGS += -Wl,-EL -fno-inline-functions
+ESP_CFLAGS += -ffunction-sections -fdata-sections
+ESP_CFLAGS += -mlongcalls -mtext-section-literals -mno-serialize-volatile
+ifneq ($(MFORCE32),)
+       ESP_CFLAGS += -mforce-l32
+endif
+
+# include path
+ESP_LIBS_INC :=$(CURDIR)/targets/esp8266/include
+ESP_LIBS_INC :=$(ESP_LIBS_INC);$(ESP_INC2)
+ESP_LIBS_INC :=$(ESP_LIBS_INC);$(ESP_INC2)/espressif
+ESP_LIBS_INC :=$(ESP_LIBS_INC);$(ESP_INC2)/freertos
+ESP_LIBS_INC :=$(ESP_LIBS_INC);$(ESP_INC2)/json
+ESP_LIBS_INC :=$(ESP_LIBS_INC);$(ESP_INC2)/lwip
+ESP_LIBS_INC :=$(ESP_LIBS_INC);$(ESP_INC2)/ssl
+
+# jerry related source files
+JERRY_BUILD_FILES := $(SRCPATH)/jerry_extapi.c
+JERRY_BUILD_FILES := $(JERRY_BUILD_FILES);$(SRCPATH)/jerry_run.c
+
+
+.PHONY: jerry js2c mkbin check-env flash clean
+
+
+all: check-env jerry js2c mkbin
+
+
+jerry:
+       mkdir -p $(INTERM)
+       mkdir -p $(OUTPUT)
+       mkdir -p $(COPYTARGET)
+       cmake -B$(INTERM) -H./ \
+        -DENABLE_LTO=OFF \
+        -DENABLE_VALGRIND=OFF \
+        -DCMAKE_TOOLCHAIN_FILE=build/configs/toolchain_external.cmake \
+        -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=xtensia-lx106 \
+        -DEXTERNAL_CMAKE_C_COMPILER=xtensa-lx106-elf-gcc \
+        -DEXTERNAL_CMAKE_C_COMPILER_ID=GNU \
+        -DEXTERNAL_BUILD_ENTRY_FILE="$(JERRY_BUILD_FILES)" \
+        -DEXTERNAL_COMPILE_FLAGS="$(ESP_CFLAGS)" \
+        -DEXTERNAL_LIBC_INTERFACE="$(ESP_INC)" \
+        -DEXTERNAL_LIBS_INTERFACE="$(ESP_LIBS_INC)" \
+        -DEXTERNAL_MEM_HEAP_SIZE_KB=$(JERRYHEAP)
+
+       make -C $(INTERM) $(TYPE).external
+       cp `cat $(INTERM)/$(TYPE).external/list` $(OUTPUT)/.
+       cp $(OUTPUT)/lib$(TYPE).jerry-core.a $(COPYTARGET)/libjerrycore.a
+       cp $(OUTPUT)/lib$(TYPE).jerry-libm.lib.a $(COPYTARGET)/libjerrylibm.a
+       cp $(INTERM)/lib$(TYPE).external-entry.a $(OUTPUT)/.
+       cp $(OUTPUT)/lib$(TYPE).external-entry.a $(COPYTARGET)/libjerryentry.a
+
+
+js2c:
+       cd targets/esp8266; ../../tools/js2c.py
+
+
+mkbin:
+       cd targets/esp8266; \
+        make clean; \
+        BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=3 make; \
+        BOOT=new APP=2 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=3 make
+
+
+check-env:
+ifndef SDK_PATH
+       $(error SDK_PATH is undefined for ESP8266)
+endif
+ifndef BIN_PATH
+       $(error BIN_PATH is undefined for ESP8266)
+endif
+
+
+flash:
+       $(ESPTOOL) --port $(USBDEVICE) write_flash \
+        0x00000 $(SDK_PATH)/bin/"boot_v1.4(b1).bin" \
+        0x01000 $(BIN_PATH)/upgrade/user1.2048.new.3.bin \
+        0x81000 $(BIN_PATH)/upgrade/user2.2048.new.3.bin \
+        0x1FC000 $(SDK_PATH)/bin/esp_init_data_default.bin \
+        0x1FE000 $(SDK_PATH)/bin/blank.bin
+
+
+clean:
+       rm -rf $(INTERM)
+       rm -rf $(OUTPUT)
diff --git a/deps/jerry/targets/esp8266/docs/ESP-PATCHFORJERRYSCRIPT.md b/deps/jerry/targets/esp8266/docs/ESP-PATCHFORJERRYSCRIPT.md
new file mode 100644 (file)
index 0000000..bc6bb74
--- /dev/null
@@ -0,0 +1,75 @@
+#### Apply patch to ESP8266 SDK
+
+As `iram` is quite small to fit all the codes but linker tries to put it there.
+To force JerryScript codes to be placed at the `irom` section,
+need to change the order and tell the linker as below;
+
+```
+diff --git a/ld/eagle.app.v6.common.ld b/ld/eagle.app.v6.common.ld
+index caf8e32..dadaceb 100644
+--- a/ld/eagle.app.v6.common.ld
++++ b/ld/eagle.app.v6.common.ld
+@@ -151,6 +151,21 @@ SECTIONS
+   } >dram0_0_seg :dram0_0_bss_phdr
+ /* __stack = 0x3ffc8000; */
++  .irom0.text : ALIGN(4)
++  {
++    _irom0_text_start = ABSOLUTE(.);
++    *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
++    *(.literal.* .text.*)
++    _irom0_text_end = ABSOLUTE(.);
++
++    _jerry_text_start = ABSOLUTE(.);
++    *\libjerryentry.a:*(.text*)
++    *\libjerrycore.a:*(.text*)
++    *\libjerrylibm.a:*(.text*)
++    _jerry_text_end = ABSOLUTE(.);
++
++  } >irom0_0_seg :irom0_0_phdr
++
+   .text : ALIGN(4)
+   {
+     _stext = .;
+@@ -199,13 +214,6 @@ SECTIONS
+     _lit4_end = ABSOLUTE(.);
+   } >iram1_0_seg :iram1_0_phdr
+-  .irom0.text : ALIGN(4)
+-  {
+-    _irom0_text_start = ABSOLUTE(.);
+-    *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
+-    *(.literal.* .text.*)
+-    _irom0_text_end = ABSOLUTE(.);
+-  } >irom0_0_seg :irom0_0_phdr
+ }
+ /* get ROM code address */
+diff --git a/ld/eagle.app.v6.ld b/ld/eagle.app.v6.ld
+index 3e7ec1b..4a9ab5b 100644
+--- a/ld/eagle.app.v6.ld
++++ b/ld/eagle.app.v6.ld
+@@ -26,7 +26,7 @@ MEMORY
+   dport0_0_seg :                       org = 0x3FF00000, len = 0x10
+   dram0_0_seg :                        org = 0x3FFE8000, len = 0x14000
+   iram1_0_seg :                        org = 0x40100000, len = 0x8000
+-  irom0_0_seg :                        org = 0x40240000, len = 0x3C000
++  irom0_0_seg :                        org = 0x40240000, len = 0xB0000
+ }
+ INCLUDE "../ld/eagle.app.v6.common.ld"
+```
+
+Second file is to modify `irom` size so that it can hold all the codes and data.
+This can be done by giving another `SPI_SIZE_MAP`.
+For now, I'll use this manual modification.
+
+
+#### Need to get setjmp / longjmp
+
+Extract and copy from the SDK.
+
+```
+cd ~/harmony/jerryscript/targets/esp8266/libs
+ar -xv $SDK_PATH/lib/libcirom.a lib_a-setjmp.o
+```
diff --git a/deps/jerry/targets/esp8266/docs/ESP-PREREQUISITES.md b/deps/jerry/targets/esp8266/docs/ESP-PREREQUISITES.md
new file mode 100644 (file)
index 0000000..7d1a915
--- /dev/null
@@ -0,0 +1,150 @@
+#### Preparation
+
+##### Accessories
+
+You need,
+* 3.3V power supply. You can use bread board power (+5V, +3.3V). I used LM317 like this;
+  * Use [LM317](http://www.ti.com/lit/ds/symlink/lm317.pdf)
+  * R1 = 330 Ohm, R2 = 545 Ohm (1K + 1.2K in parallel)
+  * 5V 2A adaptor
+* USB to RS-232 Serial + RS-232 Serial to Digital or USB-to-RS232 TTL converter
+
+#### Toolchain
+
+Reference [Toolchain](https://github.com/esp8266/esp8266-wiki/wiki/Toolchain) page.
+
+I've slightly changed the step to use SDK from Espressif official SDK
+(https://github.com/espressif/esp_iot_rtos_sdk)
+
+##### Toolchain:
+
+dependencies for x86
+```
+sudo apt-get install git autoconf build-essential gperf \
+   bison flex texinfo libtool libncurses5-dev wget \
+    gawk libc6-dev-i386 python-serial libexpat-dev
+sudo mkdir /opt/Espressif
+sudo chown $USER /opt/Espressif/
+```
+
+dependencies for x64
+```
+sudo apt-get install git autoconf build-essential gperf \
+    bison flex texinfo libtool libncurses5-dev wget \
+    gawk libc6-dev-amd64 python-serial libexpat-dev
+sudo mkdir /opt/Espressif
+sudo chown $USER /opt/Espressif/
+```
+
+crosstool-NG
+```
+cd /opt/Espressif
+git clone -b lx106-g++-1.21.0 git://github.com/jcmvbkbc/crosstool-NG.git
+cd crosstool-NG
+./bootstrap && ./configure --prefix=`pwd` && make && make install
+./ct-ng xtensa-lx106-elf
+./ct-ng build
+```
+add path to environment file such as `.profile`
+```
+PATH=$PWD/builds/xtensa-lx106-elf/bin:$PATH
+```
+
+##### Espressif SDK: use Espressif official
+
+```
+cd /opt/Esprissif
+git clone https://github.com/espressif/ESP8266_RTOS_SDK.git ESP8266_RTOS_SDK.git
+ln -s ESP8266_RTOS_SDK.git ESP8266_SDK
+cd ESP8266_SDK
+git checkout -b jerry a2b413ad2996450fe2f173b6afab243f6e1249aa
+```
+
+We use SDK 1.2.0 version which has stdlib.h and others. Latest 1.3.0 version,
+as of writing this document, doesn't have it.
+(If anyone knows how to use latest version, please add an issue or send a PR.)
+
+
+set two environment variables such as in .profile
+```
+export SDK_PATH=/opt/Espressif/ESP8266_SDK
+export BIN_PATH=(to output folder path)
+```
+
+##### Xtensa libraries and headers:
+```
+cd /opt/Espressif/ESP8266_SDK
+wget -O lib/libhal.a https://github.com/esp8266/esp8266-wiki/raw/master/libs/libhal.a
+```
+
+##### ESP image tool
+```
+cd /opt/Espressif
+wget -O esptool_0.0.2-1_i386.deb https://github.com/esp8266/esp8266-wiki/raw/master/deb/esptool_0.0.2-1_i386.deb
+sudo dpkg -i esptool_0.0.2-1_i386.deb
+```
+
+##### ESP upload tool
+```
+cd /opt/Espressif
+git clone https://github.com/themadinventor/esptool esptool-py
+sudo ln -s $PWD/esptool-py/esptool.py crosstool-NG/builds/xtensa-lx106-elf/bin/esptool.py
+```
+
+#### Test writing with Blinky example
+
+##### Get the source
+
+found one example that works with SDK V1.2 (which is based on FreeRTOS, as of writing)
+
+* https://github.com/mattcallow/esp8266-sdk/tree/master/rtos_apps/01blinky
+
+
+##### Compile
+
+Read `2A-ESP8266__IOT_SDK_User_Manual_EN` document in
+[this](http://bbs.espressif.com/viewtopic.php?f=51&t=1024) link.
+
+It's configured 2048KB flash
+```
+BOOT=new APP=1 SPI_SPEED=80 SPI_MODE=QIO SPI_SIZE_MAP=5 make
+BOOT=new APP=2 SPI_SPEED=80 SPI_MODE=QIO SPI_SIZE_MAP=5 make
+```
+
+or old way... this works not sure this is ok.
+```
+make BOOT=new APP=0 SPI_SPEED=80 SPI_MODE=QIO SPI_SIZE_MAP=2
+```
+
+##### Flashing
+
+* power off ESP8266 board
+* connect GPIO0 to GND, connect GPIO2 to VCC
+* power on
+* write
+
+```
+sudo /opt/Espressif/esptool-py/esptool.py \
+  --port /dev/ttyUSB0 write_flash \
+  0x00000 $SDK_PATH/bin/"boot_v1.4(b1).bin" \
+  0x01000 $BIN_PATH/upgrade/user1.2048.new.5.bin \
+  0x101000 $BIN_PATH/upgrade/user2.2048.new.5.bin \
+  0x3FE000 $SDK_PATH/bin/blank.bin \
+  0x3FC000 $SDK_PATH/bin/esp_init_data_default.bin
+```
+_change `/dev/ttyUSB1` to whatever you have._
+
+or the old way...this works not sure this is ok.
+```
+cd $BIN_PATH
+sudo /opt/Espressif/esptool-py/esptool.py \
+--port /dev/ttyUSB0 write_flash \
+0x00000 eagle.flash.bin 0x40000 eagle.irom0text.bin
+```
+
+* power off
+* disconnect GPIO0 so that it is floating
+* connect GPIO2 with serial of 470 Ohm + LED and to GND
+* power On
+
+LED should blink on and off every second
diff --git a/deps/jerry/targets/esp8266/gen_misc.sh b/deps/jerry/targets/esp8266/gen_misc.sh
new file mode 100644 (file)
index 0000000..9e8a863
--- /dev/null
@@ -0,0 +1,165 @@
+#!/bin/bash
+
+echo "gen_misc.sh version 20150826"
+echo ""
+
+if [ $SDK_PATH ]; then
+       echo "SDK_PATH:"
+       echo "$SDK_PATH"
+       echo ""
+else
+       echo "ERROR: Please export SDK_PATH firstly, exit!!!"
+       exit
+fi
+
+if [ $BIN_PATH ]; then
+       echo "BIN_PATH:"
+       echo "$BIN_PATH"
+       echo ""
+else
+       echo "ERROR: Please export BIN_PATH firstly, exit!!!"
+       exit
+fi
+
+echo "Please check SDK_PATH & BIN_PATH, enter (Y/y) to continue:"
+read input
+
+if [[ $input != Y ]] && [[ $input != y ]]; then
+       exit
+fi
+
+echo ""
+
+echo "Please follow below steps(1-5) to generate specific bin(s):"
+echo "STEP 1: use boot_v1.2+ by default"
+boot=new
+
+echo "boot mode: $boot"
+echo ""
+
+echo "STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)"
+echo "enter (0/1/2, default 0):"
+read input
+
+if [ -z "$input" ]; then
+       if [ $boot != none ]; then
+               boot=none
+               echo "ignore boot"
+       fi
+       app=0
+       echo "generate bin: eagle.flash.bin+eagle.irom0text.bin"
+elif [ $input == 1 ]; then
+       if [ $boot == none ]; then
+               app=0
+               echo "choose no boot before"
+               echo "generate bin: eagle.flash.bin+eagle.irom0text.bin"
+               else
+               app=1
+               echo "generate bin: user1.bin"
+       fi
+elif [ $input == 2 ]; then
+       if [ $boot == none ]; then
+               app=0
+               echo "choose no boot before"
+               echo "generate bin: eagle.flash.bin+eagle.irom0text.bin"
+       else
+               app=2
+               echo "generate bin: user2.bin"
+       fi
+else
+       if [ $boot != none ]; then
+               boot=none
+               echo "ignore boot"
+       fi
+       app=0
+       echo "generate bin: eagle.flash.bin+eagle.irom0text.bin"
+fi
+
+echo ""
+
+echo "STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)"
+echo "enter (0/1/2/3, default 2):"
+read input
+
+if [ -z "$input" ]; then
+       spi_speed=40
+elif [ $input == 0 ]; then
+       spi_speed=20
+elif [ $input == 1 ]; then
+       spi_speed=26.7
+elif [ $input == 3 ]; then
+       spi_speed=80
+else
+       spi_speed=40
+fi
+
+echo "spi speed: $spi_speed MHz"
+echo ""
+
+echo "STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)"
+echo "enter (0/1/2/3, default 0):"
+read input
+
+if [ -z "$input" ]; then
+       spi_mode=QIO
+elif [ $input == 1 ]; then
+       spi_mode=QOUT
+elif [ $input == 2 ]; then
+       spi_mode=DIO
+elif [ $input == 3 ]; then
+       spi_mode=DOUT
+else
+       spi_mode=QIO
+fi
+
+echo "spi mode: $spi_mode"
+echo ""
+
+echo "STEP 5: choose spi size and map"
+echo "    0= 512KB( 256KB+ 256KB)"
+echo "    2=1024KB( 512KB+ 512KB)"
+echo "    3=2048KB( 512KB+ 512KB)"
+echo "    4=4096KB( 512KB+ 512KB)"
+echo "    5=2048KB(1024KB+1024KB)"
+echo "    6=4096KB(1024KB+1024KB)"
+echo "enter (0/2/3/4/5/6, default 0):"
+read input
+
+if [ -z "$input" ]; then
+       spi_size_map=0
+       echo "spi size: 512KB"
+       echo "spi ota map:  256KB + 256KB"
+elif [ $input == 2 ]; then
+       spi_size_map=2
+       echo "spi size: 1024KB"
+       echo "spi ota map:  512KB + 512KB"
+elif [ $input == 3 ]; then
+       spi_size_map=3
+       echo "spi size: 2048KB"
+       echo "spi ota map:  512KB + 512KB"
+elif [ $input == 4 ]; then
+       spi_size_map=4
+       echo "spi size: 4096KB"
+       echo "spi ota map:  512KB + 512KB"
+elif [ $input == 5 ]; then
+       spi_size_map=5
+       echo "spi size: 2048KB"
+       echo "spi ota map:  1024KB + 1024KB"
+elif [ $input == 6 ]; then
+       spi_size_map=6
+       echo "spi size: 4096KB"
+       echo "spi ota map:  1024KB + 1024KB"
+else
+       spi_size_map=0
+       echo "spi size: 512KB"
+       echo "spi ota map:  256KB + 256KB"
+fi
+
+echo ""
+
+echo "start..."
+echo ""
+
+make clean
+
+make BOOT=$boot APP=$app SPI_SPEED=$spi_speed SPI_MODE=$spi_mode SPI_SIZE_MAP=$spi_size_map
diff --git a/deps/jerry/targets/esp8266/include/esp8266_gpio.h b/deps/jerry/targets/esp8266/include/esp8266_gpio.h
new file mode 100644 (file)
index 0000000..6c32363
--- /dev/null
@@ -0,0 +1,151 @@
+/* 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.
+ */
+
+/*
+ *  Copyright (C) 2014 -2016  Espressif System
+ *
+ */
+
+#ifndef __ESP82666_GPIO_H__
+#define __ESP82666_GPIO_H__
+
+#define GPIO_Pin_0              (BIT(0))  /* Pin 0 selected */
+#define GPIO_Pin_1              (BIT(1))  /* Pin 1 selected */
+#define GPIO_Pin_2              (BIT(2))  /* Pin 2 selected */
+#define GPIO_Pin_3              (BIT(3))  /* Pin 3 selected */
+#define GPIO_Pin_4              (BIT(4))  /* Pin 4 selected */
+#define GPIO_Pin_5              (BIT(5))  /* Pin 5 selected */
+#define GPIO_Pin_6              (BIT(6))  /* Pin 6 selected */
+#define GPIO_Pin_7              (BIT(7))  /* Pin 7 selected */
+#define GPIO_Pin_8              (BIT(8))  /* Pin 8 selected */
+#define GPIO_Pin_9              (BIT(9))  /* Pin 9 selected */
+#define GPIO_Pin_10             (BIT(10)) /* Pin 10 selected */
+#define GPIO_Pin_11             (BIT(11)) /* Pin 11 selected */
+#define GPIO_Pin_12             (BIT(12)) /* Pin 12 selected */
+#define GPIO_Pin_13             (BIT(13)) /* Pin 13 selected */
+#define GPIO_Pin_14             (BIT(14)) /* Pin 14 selected */
+#define GPIO_Pin_15             (BIT(15)) /* Pin 15 selected */
+#define GPIO_Pin_All            (0xFFFF)  /* All pins selected */
+
+#define GPIO_PIN_REG_0          PERIPHS_IO_MUX_GPIO0_U
+#define GPIO_PIN_REG_1          PERIPHS_IO_MUX_U0TXD_U
+#define GPIO_PIN_REG_2          PERIPHS_IO_MUX_GPIO2_U
+#define GPIO_PIN_REG_3          PERIPHS_IO_MUX_U0RXD_U
+#define GPIO_PIN_REG_4          PERIPHS_IO_MUX_GPIO4_U
+#define GPIO_PIN_REG_5          PERIPHS_IO_MUX_GPIO5_U
+#define GPIO_PIN_REG_6          PERIPHS_IO_MUX_SD_CLK_U
+#define GPIO_PIN_REG_7          PERIPHS_IO_MUX_SD_DATA0_U
+#define GPIO_PIN_REG_8          PERIPHS_IO_MUX_SD_DATA1_U
+#define GPIO_PIN_REG_9          PERIPHS_IO_MUX_SD_DATA2_U
+#define GPIO_PIN_REG_10         PERIPHS_IO_MUX_SD_DATA3_U
+#define GPIO_PIN_REG_11         PERIPHS_IO_MUX_SD_CMD_U
+#define GPIO_PIN_REG_12         PERIPHS_IO_MUX_MTDI_U
+#define GPIO_PIN_REG_13         PERIPHS_IO_MUX_MTCK_U
+#define GPIO_PIN_REG_14         PERIPHS_IO_MUX_MTMS_U
+#define GPIO_PIN_REG_15         PERIPHS_IO_MUX_MTDO_U
+
+#define GPIO_PIN_REG(i) \
+    (i==0) ? GPIO_PIN_REG_0:  \
+    (i==1) ? GPIO_PIN_REG_1:  \
+    (i==2) ? GPIO_PIN_REG_2:  \
+    (i==3) ? GPIO_PIN_REG_3:  \
+    (i==4) ? GPIO_PIN_REG_4:  \
+    (i==5) ? GPIO_PIN_REG_5:  \
+    (i==6) ? GPIO_PIN_REG_6:  \
+    (i==7) ? GPIO_PIN_REG_7:  \
+    (i==8) ? GPIO_PIN_REG_8:  \
+    (i==9) ? GPIO_PIN_REG_9:  \
+    (i==10)? GPIO_PIN_REG_10: \
+    (i==11)? GPIO_PIN_REG_11: \
+    (i==12)? GPIO_PIN_REG_12: \
+    (i==13)? GPIO_PIN_REG_13: \
+    (i==14)? GPIO_PIN_REG_14: \
+    GPIO_PIN_REG_15
+
+#define GPIO_PIN_ADDR(i)        (GPIO_PIN0_ADDRESS + i*4)
+
+#define GPIO_ID_IS_PIN_REGISTER(reg_id) ((reg_id >= GPIO_ID_PIN0) && (reg_id <= GPIO_ID_PIN(GPIO_PIN_COUNT-1)))
+
+#define GPIO_REGID_TO_PINIDX(reg_id) ((reg_id) - GPIO_ID_PIN0)
+
+typedef enum
+{
+  GPIO_PIN_INTR_DISABLE = 0,
+  GPIO_PIN_INTR_POSEDGE = 1,
+  GPIO_PIN_INTR_NEGEDGE = 2,
+  GPIO_PIN_INTR_ANYEGDE = 3,
+  GPIO_PIN_INTR_LOLEVEL = 4,
+  GPIO_PIN_INTR_HILEVEL = 5
+} GPIO_INT_TYPE;
+
+typedef enum
+{
+  GPIO_Mode_Input = 0x0,
+  GPIO_Mode_Out_OD,
+  GPIO_Mode_Output ,
+  GPIO_Mode_Sigma_Delta
+} GPIOMode_TypeDef;
+
+typedef enum
+{
+  GPIO_PullUp_DIS = 0x0,
+  GPIO_PullUp_EN  = 0x1
+} GPIO_Pullup_IF;
+
+typedef struct
+{
+  uint16           GPIO_Pin;
+  GPIOMode_TypeDef GPIO_Mode;
+  GPIO_Pullup_IF   GPIO_Pullup;
+  GPIO_INT_TYPE    GPIO_IntrType;
+} GPIO_ConfigTypeDef;
+
+#define GPIO_OUTPUT_SET(gpio_no, bit_value) gpio_output_conf (bit_value<<gpio_no, \
+                                                              ((~bit_value)&0x01)<<gpio_no, 1<<gpio_no, 0)
+
+#define GPIO_OUTPUT(gpio_bits, bit_value) do {                                                        \
+                                            if (bit_value) { gpio_output_conf (gpio_bits, 0, gpio_bits, 0); } \
+                                            else { gpio_output_conf(0, gpio_bits, gpio_bits, 0); } \
+                                          } while (0)
+
+#define GPIO_DIS_OUTPUT(gpio_no)    gpio_output_conf (0, 0, 0, 1 << gpio_no)
+#define GPIO_AS_INPUT(gpio_bits)    gpio_output_conf (0, 0, 0, gpio_bits)
+#define GPIO_AS_OUTPUT(gpio_bits)   gpio_output_conf (0, 0, gpio_bits, 0)
+#define GPIO_INPUT_GET(gpio_no)     ((gpio_input_get () >> gpio_no)&BIT0)
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void gpio16_output_conf (void);
+void gpio16_output_set (uint8 value);
+void gpio16_input_conf (void);
+uint8 gpio16_input_get (void);
+
+void gpio_output_conf (uint32 set_mask, uint32 clear_mask, uint32 enable_mask, uint32 disable_mask);
+void gpio_intr_handler_register (void *fn);
+void gpio_pin_wakeup_enable (uint32 i, GPIO_INT_TYPE intr_state);
+void gpio_pin_wakeup_disable ();
+void gpio_pin_intr_state_set (uint32 i, GPIO_INT_TYPE intr_state);
+uint32 gpio_input_get (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/jerry/targets/esp8266/include/esp8266_uart.h b/deps/jerry/targets/esp8266/include/esp8266_uart.h
new file mode 100644 (file)
index 0000000..333fe0d
--- /dev/null
@@ -0,0 +1,48 @@
+/* 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.
+ */
+
+/*
+ *  Copyright (C) 2014 -2016  Espressif System
+ *
+ */
+
+#ifndef __ESP8266_UART_H__
+#define __ESP8266_UART_H__
+
+typedef enum {
+  UART0 = 0x0,
+  UART1 = 0x1,
+} UART_Port;
+
+typedef enum {
+  BIT_RATE_300     = 300,
+  BIT_RATE_600     = 600,
+  BIT_RATE_1200    = 1200,
+  BIT_RATE_2400    = 2400,
+  BIT_RATE_4800    = 4800,
+  BIT_RATE_9600    = 9600,
+  BIT_RATE_19200   = 19200,
+  BIT_RATE_38400   = 38400,
+  BIT_RATE_57600   = 57600,
+  BIT_RATE_74880   = 74880,
+  BIT_RATE_115200  = 115200,
+  BIT_RATE_230400  = 230400,
+  BIT_RATE_460800  = 460800,
+  BIT_RATE_921600  = 921600,
+  BIT_RATE_1843200 = 1843200,
+  BIT_RATE_3686400 = 3686400,
+} UART_BautRate;
+
+#endif
diff --git a/deps/jerry/targets/esp8266/include/jerry_extapi.h b/deps/jerry/targets/esp8266/include/jerry_extapi.h
new file mode 100644 (file)
index 0000000..3127d4b
--- /dev/null
@@ -0,0 +1,35 @@
+/* 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.
+ */
+
+#ifndef __JERRY_EXTAPI_H__
+#define __JERRY_EXTAPI_H__
+
+#define JERRY_STANDALONE_EXIT_CODE_OK   (0)
+#define JERRY_STANDALONE_EXIT_CODE_FAIL (1)
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void js_register_functions (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/jerry/targets/esp8266/include/jerry_run.h b/deps/jerry/targets/esp8266/include/jerry_run.h
new file mode 100644 (file)
index 0000000..984a3c0
--- /dev/null
@@ -0,0 +1,34 @@
+/* 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.
+ */
+
+#ifndef __JERRY_RUN_H__
+#define __JERRY_RUN_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+int js_entry (const char *source_p, const size_t source_size);
+int js_eval (const char *source_p, const size_t source_size);
+int js_loop (uint32_t ticknow);
+void js_exit (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/jerry/targets/esp8266/include/native_esp8266.h b/deps/jerry/targets/esp8266/include/native_esp8266.h
new file mode 100644 (file)
index 0000000..e57665e
--- /dev/null
@@ -0,0 +1,33 @@
+/* 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.
+ */
+
+#ifndef __NATIVE_ESP8266_H__
+#define __NATIVE_ESP8266_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void native_gpio_dir (int, int);
+void native_gpio_set (int, int);
+int native_gpio_get (int);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/jerry/targets/esp8266/include/user_config.h b/deps/jerry/targets/esp8266/include/user_config.h
new file mode 100644 (file)
index 0000000..253786e
--- /dev/null
@@ -0,0 +1,24 @@
+/* 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.
+ */
+
+#ifndef __USER_CONFIG_H__
+#define __USER_CONFIG_H__
+
+
+/* number of stack items, x4 for bytes */
+#define JERRY_STACK_SIZE 2000
+
+
+#endif
diff --git a/deps/jerry/targets/esp8266/js/blink.js b/deps/jerry/targets/esp8266/js/blink.js
new file mode 100644 (file)
index 0000000..b71a626
--- /dev/null
@@ -0,0 +1,15 @@
+var check = 1;
+
+function blink() {
+  var inp = gpio_get(0);
+  var blk = (check > 8) ? 1 - inp : inp;
+  gpio_set(2, blk);
+  check = check >= 10 ? 1 : check+1;
+}
+
+// GPIO 0 as input
+// GPIO 2 as output
+gpio_dir(0, 0);
+gpio_dir(2, 1);
+
+print("blink js OK");
diff --git a/deps/jerry/targets/esp8266/js/main.js b/deps/jerry/targets/esp8266/js/main.js
new file mode 100644 (file)
index 0000000..0d06812
--- /dev/null
@@ -0,0 +1,4 @@
+function sysloop(ticknow) {
+  blink();
+};
+print("main js OK");
diff --git a/deps/jerry/targets/esp8266/readme.md b/deps/jerry/targets/esp8266/readme.md
new file mode 100644 (file)
index 0000000..42a2ce7
--- /dev/null
@@ -0,0 +1,113 @@
+### About
+
+Files in this folder (embedding/esp8266) are copied from
+`examples/project_template` of `esp_iot_rtos_sdk` and modified for JerryScript.
+You can view online from
+[this](https://github.com/espressif/esp_iot_rtos_sdk/tree/master/examples/project_template) page.
+
+
+### How to build JerryScript for ESP8266
+
+#### 1. SDK
+
+Follow [this](./docs/ESP-PREREQUISITES.md) page to setup build environment
+
+
+#### 2. Patch ESP-SDK for JerryScript
+
+Follow [this](./docs/ESP-PATCHFORJERRYSCRIPT.md) page to patch for JerryScript building.
+Below is a summary after SDK patch is applied.
+
+#### 3. Building JerryScript
+
+```
+cd ~/harmony/jerryscript
+# clean build
+make -f ./targets/esp8266/Makefile.esp8266 clean
+# or just normal build
+make -f ./targets/esp8266/Makefile.esp8266
+```
+
+Output files should be placed at $BIN_PATH
+
+#### 4. Flashing for ESP8266 ESP-01 board (WiFi Module)
+
+Steps are for `ESP8266 ESP-01(WiFi)` board. Others may vary.
+Refer http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family page.
+
+##### 4.1 GPIO0 and GPIO2
+
+Before flashing you need to follow the steps.
+
+1. Power off ESP8266
+2. Connect GPIO0 to GND and GPIO2 to VCC
+3. Power on ESP8266
+4. Flash
+
+##### 4.2 Flashing
+
+```
+make -f ./targets/esp8266/Makefile.esp8266 flash
+```
+
+Default USB device is `/dev/ttyUSB0`. If you have different one, give with `USBDEVICE`, like;
+
+```
+USBDEVICE=/dev/ttyUSB1 make -f ./targets/esp8266/Makefile.esp8266 flash
+```
+
+
+### 5. Running
+
+1. Power off
+2. Disonnect(float) both GPIO0 and GPIO2
+3. Power on
+
+Sample program here works with LED and a SW with below connection.
+* Connect GPIO2 to a LED > 4K resistor > GND
+* Connect GPIO0 between VCC > 4K resistor and GND
+
+If GPIO0 is High then LED is turned on longer. If L vice versa.
+
+### 6. Optimizing initial RAM usage (ESP8266 specific)
+The existing open source gcc compiler with Xtensa support stores const(ants) in
+the same limited RAM where our code needs to run. 
+
+It is possible to force the compiler to 1)store a constant into ROM and also 2) read it from there thus saving 1.1) RAM.
+It will require two things though:
+1. To add the attribute JERRY_CONST_DATA to your constant. For example
+
+```C
+static const lit_magic_size_t lit_magic_string_sizes[] =
+```
+
+can be modified to
+
+```C
+static const lit_magic_size_t lit_magic_string_sizes[] JERRY_CONST_DATA =
+```
+
+That is already done to some constants in jerry-core. 
+
+1.1) Below is a short list:
+
+
+Bytes  | Name
+-------- | ---------
+928 | magic_strings$2428
+610 | vm_decode_table
+424 | unicode_letter_interv_sps
+235 | cbc_flags
+232 | lit_magic_string_sizes
+212 | unicode_letter_interv_len
+196 | unicode_non_letter_ident_
+112 | unicode_letter_chars
+
+Which frees 2949 bytes in RAM. 
+
+2. To compile your code with compiler that supports the `-mforce-l32` parameter. You can check if your compiler is 
+supporting that parameter by calling:
+```bash
+xtensa-lx106-elf-gcc --help=target | grep mforce-l32
+```
+If the command above does not provide a result then you will need to upgrade your compiler.
\ No newline at end of file
diff --git a/deps/jerry/targets/esp8266/source/jerry_extapi.c b/deps/jerry/targets/esp8266/source/jerry_extapi.c
new file mode 100644 (file)
index 0000000..ffc9504
--- /dev/null
@@ -0,0 +1,202 @@
+/* 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.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "jerry-core/include/jerryscript.h"
+#include "jerry_extapi.h"
+
+#include "native_esp8266.h"
+
+
+
+#ifndef MIN
+#define MIN(A,B) ((A)<(B)?(A):(B))
+#endif
+
+
+#define __UNSED__ __attribute__((unused))
+
+#define DELCARE_HANDLER(NAME) \
+static jerry_value_t \
+NAME ## _handler (const jerry_value_t  function_obj_val __UNSED__, \
+                  const jerry_value_t  this_val __UNSED__, \
+                  const jerry_value_t  args_p[], \
+                  const jerry_length_t  args_cnt)
+
+#define REGISTER_HANDLER(NAME) \
+  register_native_function ( # NAME, NAME ## _handler)
+
+/*---------------------------------------------------------------------------*/
+
+DELCARE_HANDLER(assert) {
+  if (args_cnt == 1
+      && jerry_value_is_boolean (args_p[0])
+      && jerry_get_boolean_value (args_p[0]))
+  {
+    printf (">> Jerry assert true\r\n");
+    return jerry_create_boolean (true);
+  }
+  printf ("Script assertion failed\n");
+  exit (JERRY_STANDALONE_EXIT_CODE_FAIL);
+  return jerry_create_boolean (false);
+}
+
+
+DELCARE_HANDLER(print) {
+  jerry_length_t cc;
+
+  if (args_cnt)
+  {
+    printf(">> print(%d) :", (int) args_cnt);
+    for (cc=0; cc<args_cnt; cc++)
+    {
+      if (jerry_value_is_string (args_p[cc]))
+      {
+        char *buffer;
+        jerry_size_t size = jerry_get_string_size (args_p[0]);
+        buffer = (char *) malloc(size + 1);
+
+        if(!buffer)
+        {
+            // not enough memory for this string.
+            printf("[<too-long-string>]");
+            continue;
+        }
+
+        jerry_string_to_char_buffer (args_p[cc],
+                                     (jerry_char_t *) buffer,
+                                     size);
+        *(buffer + size) = 0;
+        printf("[%s] ", buffer);
+        free (buffer);
+      }
+      else
+      {
+        printf ("(%d) ", args_p[cc]);
+      }
+    }
+    printf ("\r\n");
+  }
+  return jerry_create_boolean (true);
+}
+
+
+/*---------------------------------------------------------------------------*/
+
+DELCARE_HANDLER(gpio_dir) {
+  int port, value;
+  if (args_cnt < 2)
+  {
+    return false;
+  }
+
+  port = (int) jerry_get_number_value (args_p[0]);
+  value = (int) jerry_get_number_value (args_p[1]);
+
+  native_gpio_dir (port, value);
+
+  return jerry_create_boolean (true);
+} /* gpio_dir_handler */
+
+DELCARE_HANDLER(gpio_set) {
+  int port, value;
+  if (args_cnt < 2)
+  {
+    return jerry_create_boolean (false);
+  }
+
+  port = (int) jerry_get_number_value (args_p[0]);
+  value = (int) jerry_get_number_value (args_p[1]);
+
+  native_gpio_set (port, value);
+
+  return jerry_create_boolean (true);
+} /* gpio_dir_handler */
+
+
+DELCARE_HANDLER(gpio_get) {
+  int port, value;
+  if (args_cnt < 1)
+  {
+    return false;
+  }
+
+  port = (int) jerry_get_number_value (args_p[0]);
+
+  value = native_gpio_get (port) ? 1 : 0;
+
+  return jerry_create_number ((double) value);
+} /* gpio_dir_handler */
+
+
+/*---------------------------------------------------------------------------*/
+
+static bool
+register_native_function (const char* name,
+                          jerry_external_handler_t handler)
+{
+  jerry_value_t global_obj_val;
+  jerry_value_t reg_func_val;
+  jerry_value_t prop_name_val;
+  jerry_value_t res;
+  bool bok;
+
+  global_obj_val = jerry_get_global_object ();
+  reg_func_val = jerry_create_external_function (handler);
+  bok = true;
+
+  if (!(jerry_value_is_function (reg_func_val)
+        && jerry_value_is_constructor (reg_func_val)))
+  {
+    printf ("!!! create_external_function failed !!!\r\n");
+    jerry_release_value (reg_func_val);
+    jerry_release_value (global_obj_val);
+    return false;
+  }
+
+  prop_name_val = jerry_create_string ((const jerry_char_t *) name);
+  res = jerry_set_property (global_obj_val, prop_name_val, reg_func_val);
+
+  if (jerry_value_has_error_flag (res))
+  {
+    bok = false;
+  }
+
+  jerry_release_value (res);
+  jerry_release_value (prop_name_val);
+  jerry_release_value (reg_func_val);
+  jerry_release_value (global_obj_val);
+
+  if (!bok)
+  {
+    printf ("!!! register_native_function failed: [%s]\r\n", name);
+  }
+
+  return bok;
+}
+
+
+/*---------------------------------------------------------------------------*/
+
+void js_register_functions (void)
+{
+  REGISTER_HANDLER(assert);
+  REGISTER_HANDLER(print);
+  REGISTER_HANDLER(gpio_dir);
+  REGISTER_HANDLER(gpio_set);
+  REGISTER_HANDLER(gpio_get);
+}
diff --git a/deps/jerry/targets/esp8266/source/jerry_run.c b/deps/jerry/targets/esp8266/source/jerry_run.c
new file mode 100644 (file)
index 0000000..a15850b
--- /dev/null
@@ -0,0 +1,119 @@
+/* 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.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "jerry-core/include/jerryscript.h"
+#include "jerry_extapi.h"
+#include "jerry_run.h"
+
+
+static const char* fn_sys_loop_name = "sysloop";
+jerry_value_t parsed_res;
+
+
+/*---------------------------------------------------------------------------*/
+
+int js_entry (const char *source_p, const size_t source_size)
+{
+  const jerry_char_t *jerry_src = (const jerry_char_t *) source_p;
+  int ret_code = 0; /* JERRY_COMPLETION_CODE_OK */
+  jerry_init_flag_t flags = JERRY_INIT_EMPTY;
+
+  jerry_init (flags);
+
+  js_register_functions ();
+
+  parsed_res = jerry_parse ((jerry_char_t *) jerry_src, source_size, false);
+
+  if (jerry_value_has_error_flag (parsed_res))
+  {
+    printf ("Error: jerry_parse failed\r\n");
+    ret_code = JERRY_ERROR_SYNTAX;
+  }
+
+  return ret_code;
+}
+
+int js_eval (const char *source_p, const size_t source_size)
+{
+  int status = 0;
+  jerry_value_t res;
+
+  res = jerry_eval ((jerry_char_t *) source_p,
+                           source_size,
+                           false);
+  if (jerry_value_has_error_flag (res)) {
+         status = -1;
+  }
+
+  jerry_release_value (res);
+
+  return status;
+}
+
+int js_loop (uint32_t ticknow)
+{
+  jerry_value_t global_obj_val;
+  jerry_value_t sysloop_func;
+  jerry_value_t val_args[1];
+  uint16_t val_argv;
+  jerry_value_t res;
+  jerry_value_t prop_name_val;
+  int ret_code = 0;
+
+  global_obj_val = jerry_get_global_object ();
+  prop_name_val = jerry_create_string ((const jerry_char_t *) fn_sys_loop_name);
+  sysloop_func = jerry_get_property (global_obj_val, prop_name_val);
+  jerry_release_value (prop_name_val);
+
+  if (jerry_value_has_error_flag (sysloop_func)) {
+    printf ("Error: '%s' not defined!!!\r\n", fn_sys_loop_name);
+    jerry_release_value (sysloop_func);
+    jerry_release_value (global_obj_val);
+    return -1;
+  }
+
+  if (!jerry_value_is_function (sysloop_func)) {
+    printf ("Error: '%s' is not a function!!!\r\n", fn_sys_loop_name);
+    jerry_release_value (sysloop_func);
+    jerry_release_value (global_obj_val);
+    return -2;
+  }
+
+  val_argv = 1;
+  val_args[0] = jerry_create_number (ticknow);
+
+  res = jerry_call_function (sysloop_func,
+                             global_obj_val,
+                             val_args,
+                             val_argv);
+
+  if (jerry_value_has_error_flag (res)) {
+    ret_code = -3;
+  }
+
+  jerry_release_value (res);
+  jerry_release_value (sysloop_func);
+  jerry_release_value (global_obj_val);
+
+  return ret_code;
+}
+
+void js_exit (void)
+{
+  jerry_cleanup ();
+}
diff --git a/deps/jerry/targets/esp8266/user/Makefile b/deps/jerry/targets/esp8266/user/Makefile
new file mode 100644 (file)
index 0000000..31e4bbf
--- /dev/null
@@ -0,0 +1,43 @@
+
+#############################################################
+# Required variables for each makefile
+# Discard this section from all parent makefiles
+# Expected variables (with automatic defaults):
+#   CSRCS (all "C" files in the dir)
+#   SUBDIRS (all subdirs with a Makefile)
+#   GEN_LIBS - list of libs to be generated ()
+#   GEN_IMAGES - list of images to be generated ()
+#   COMPONENTS_xxx - a list of libs/objs in the form
+#     subdir/lib to be extracted and rolled up into
+#     a generated lib/image xxx.a ()
+#
+ifndef PDIR
+GEN_LIBS = libuser.a
+endif
+
+
+#############################################################
+# Configuration i.e. compile options etc.
+# Target specific stuff (defines etc.) goes in here!
+# Generally values applying to a tree are captured in the
+#   makefile at its root level - these are then overridden
+#   for a subtree within the makefile rooted therein
+#
+#DEFINES +=
+
+#############################################################
+# Recursion Magic - Don't touch this!!
+#
+# Each subtree potentially has an include directory
+#   corresponding to the common APIs applicable to modules
+#   rooted at that subtree. Accordingly, the INCLUDE PATH
+#   of a module can only contain the include directories up
+#   its parent path, and not its siblings
+#
+# Required for each makefile to inherit from the parent
+#
+
+INCLUDES := $(INCLUDES) -I $(PDIR)include
+INCLUDES += -I ./ -I ../include -I../../../
+sinclude $(PDIR)Makefile
+
diff --git a/deps/jerry/targets/esp8266/user/jerry_port.c b/deps/jerry/targets/esp8266/user/jerry_port.c
new file mode 100644 (file)
index 0000000..3101d19
--- /dev/null
@@ -0,0 +1,81 @@
+/* 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.
+ */
+
+#include "esp_common.h"
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "jerry-core/include/jerryscript-port.h"
+int ets_putc (int);
+
+/**
+ * Provide log message implementation for the engine.
+ */
+void
+jerry_port_log (jerry_log_level_t level, /**< log level */
+                const char *format, /**< format string */
+                ...)  /**< parameters */
+{
+  (void) level; /* ignore log level */
+
+  va_list args;
+  va_start (args, format);
+  /* TODO, uncomment when vprint link is ok */
+  /* vprintf (stderr, format, args); */
+  va_end (args);
+} /* jerry_port_log */
+
+
+/** exit - cause normal process termination  */
+void exit (int status)
+{
+  while (true)
+  {
+  }
+} /* exit */
+
+/** abort - cause abnormal process termination  */
+void abort (void)
+{
+  while (true)
+  {
+  }
+} /* abort */
+
+/**
+ * fwrite
+ *
+ * @return number of bytes written
+ */
+size_t
+fwrite (const void *ptr, /**< data to write */
+        size_t size, /**< size of elements to write */
+        size_t nmemb, /**< number of elements */
+        FILE *stream) /**< stream pointer */
+{
+  return size * nmemb;
+} /* fwrite */
+
+/**
+ * This function can get the time as well as a timezone.
+ *
+ * @return 0 if success, -1 otherwise
+ */
+int
+gettimeofday (void *tp,  /**< struct timeval */
+              void *tzp) /**< struct timezone */
+{
+  return -1;
+} /* gettimeofday */
diff --git a/deps/jerry/targets/esp8266/user/native_esp8266.c b/deps/jerry/targets/esp8266/user/native_esp8266.c
new file mode 100644 (file)
index 0000000..87f564d
--- /dev/null
@@ -0,0 +1,50 @@
+/* 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.
+ */
+
+/******************************************************************************
+ * Copyright 2013-2014 Espressif Systems (Wuxi)
+ *
+ * FileName: user_main.c
+ *
+ * Description: entry file of user application
+ *
+ * Modification history:
+ *     2014/12/1, v1.0 create this file.
+*******************************************************************************/
+
+#include "esp_common.h"
+
+#include "user_config.h"
+#include "esp8266_gpio.h"
+
+
+void native_gpio_dir(int port, int value) {
+  if (value) {
+    GPIO_AS_OUTPUT(1 << port);
+  }
+  else {
+    GPIO_AS_INPUT(1 << port);
+  }
+}
+
+
+void native_gpio_set(int port, int value) {
+  GPIO_OUTPUT_SET(port, value);
+}
+
+
+int native_gpio_get(int port) {
+  return GPIO_INPUT_GET(port);
+}
diff --git a/deps/jerry/targets/esp8266/user/user_gpio.c b/deps/jerry/targets/esp8266/user/user_gpio.c
new file mode 100644 (file)
index 0000000..36ef702
--- /dev/null
@@ -0,0 +1,39 @@
+/* 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.
+ */
+
+/*
+ *  Copyright (C) 2014 -2016  Espressif System
+ *
+ */
+
+#include "esp_common.h"
+
+#include "esp8266_gpio.h"
+
+
+//-----------------------------------------------------------------------------
+
+void gpio_output_conf(uint32 set_mask, uint32 clear_mask, uint32 enable_mask,
+                      uint32 disable_mask) {
+  GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, set_mask);
+  GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, clear_mask);
+  GPIO_REG_WRITE(GPIO_ENABLE_W1TS_ADDRESS, enable_mask);
+  GPIO_REG_WRITE(GPIO_ENABLE_W1TC_ADDRESS, disable_mask);
+}
+
+
+uint32 gpio_input_get(void) {
+  return GPIO_REG_READ(GPIO_IN_ADDRESS);
+}
diff --git a/deps/jerry/targets/esp8266/user/user_main.c b/deps/jerry/targets/esp8266/user/user_main.c
new file mode 100644 (file)
index 0000000..82ecd97
--- /dev/null
@@ -0,0 +1,111 @@
+/* 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.
+ */
+
+/******************************************************************************
+ * Copyright 2013-2014 Espressif Systems (Wuxi)
+ *
+ * FileName: user_main.c
+ *
+ * Description: entry file of user application
+ *
+ * Modification history:
+ *     2014/12/1, v1.0 create this file.
+*******************************************************************************/
+
+#include "esp_common.h"
+
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+
+#include "user_config.h"
+#include "esp8266_uart.h"
+
+
+//-----------------------------------------------------------------------------
+
+void show_free_mem(int idx) {
+  size_t res = xPortGetFreeHeapSize();
+  printf("dbg free memory(%d): %d\r\n", idx, res);
+}
+
+
+//-----------------------------------------------------------------------------
+
+#include "jerry-targetjs.h"
+
+
+static int jerry_task_init(void) {
+  int retcode;
+  int src;
+
+  DECLARE_JS_CODES;
+
+  /* run main.js */
+  show_free_mem(2);
+  retcode = js_entry(js_codes[0].source, js_codes[0].length);
+  if (retcode != 0) {
+    printf("js_entry failed code(%d) [%s]\r\n", retcode, js_codes[0].name);
+    return -1;
+  }
+  /* run rest of the js files */
+  show_free_mem(3);
+  for (src=1; js_codes[src].source; src++) {
+    retcode = js_eval(js_codes[src].source, js_codes[src].length);
+    if (retcode != 0) {
+      printf("js_eval failed code(%d) [%s]\r\n", retcode, js_codes[src].name);
+      return -2;
+    }
+  }
+  show_free_mem(4);
+  return 0;
+}
+
+
+void jerry_task(void *pvParameters) {
+  const portTickType xDelay = 100 / portTICK_RATE_MS;
+  uint32_t ticknow = 0;
+
+  if (jerry_task_init() == 0) {
+    for (;;) {
+      vTaskDelay(xDelay);
+      js_loop(ticknow);
+      if (!ticknow) {
+        show_free_mem(5);
+      }
+      ticknow++;
+    }
+  }
+  js_exit();
+}
+
+
+//-----------------------------------------------------------------------------
+
+/*
+ * This is entry point for user code
+ */
+void ICACHE_FLASH_ATTR user_init(void)
+{
+  uart_div_modify(UART0, UART_CLK_FREQ / (BIT_RATE_115200));
+
+  show_free_mem(0);
+  wifi_softap_dhcps_stop();
+  show_free_mem(1);
+
+  PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0);    // GPIO 0
+  PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO2_U, FUNC_GPIO2);    // GPIO 2
+
+  xTaskCreate(jerry_task, "jerry", JERRY_STACK_SIZE, NULL, 2, NULL);
+}
diff --git a/deps/jerry/targets/mbed/Makefile.mbed b/deps/jerry/targets/mbed/Makefile.mbed
new file mode 100644 (file)
index 0000000..ea2b59b
--- /dev/null
@@ -0,0 +1,97 @@
+# 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.
+
+# use TAB-8
+
+TARGET_LIST     = k64f stm32f4 stm32f429i nucleo
+JERRYHEAP      ?= 16
+
+ifneq ($(filter $(board), $(TARGET_LIST)),)
+       TARGET        = $(board)
+ifeq ($(TARGET), k64f)
+       YOTTA_TARGET  = frdm-k64f-gcc
+       TARGET_DIR   ?= /media/$(USER)/MBED
+else ifeq ($(TARGET), stm32f4)
+       YOTTA_TARGET  = stm32f4-disco-gcc
+else ifeq ($(TARGET), stm32f429i)
+       YOTTA_TARGET  = stm32f429i-disco-gcc
+else ifeq ($(TARGET), nucleo)
+       YOTTA_TARGET  = st-nucleo-f401re-gcc
+       TARGET_DIR   ?= /media/$(USER)/NODE_F401RE
+endif
+
+BUILD_DIR      ?= build/mbed
+UPPERC_TARGET  ?= $(shell echo $(TARGET) | tr a-z A-Z)
+COPYTARGET     ?= targets/mbed/libjerry
+
+else
+  $(error This board ($(board)) is not supported!)
+endif
+
+EXT_CFLAGS := -D__TARGET_MBED_$(UPPERC_TARGET)
+EXT_CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4
+EXT_CFLAGS += -Wno-error=format=
+
+EXT_PORT_DIR := ""
+
+.PHONY: jerry js2c yotta flash clean
+
+all: jerry js2c yotta
+
+jerry:
+       mkdir -p $(COPYTARGET)
+       mkdir -p $(BUILD_DIR)
+       cmake -B$(BUILD_DIR) -H./ \
+        -DENABLE_LTO=OFF \
+        -DFEATURE_VALGRIND=OFF \
+        -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain_external.cmake \
+        -DJERRY_LIBC=OFF \
+        -DJERRY_CMDLINE=OFF \
+        -DENABLE_ALL_IN_ONE=OFF \
+        -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=armv7l-hf \
+        -DEXTERNAL_CMAKE_C_COMPILER=arm-none-eabi-gcc \
+        -DEXTERNAL_CMAKE_C_COMPILER_ID=GNU \
+        -DEXTERNAL_COMPILE_FLAGS="$(EXT_CFLAGS)" \
+        -DMEM_HEAP_SIZE_KB=$(JERRYHEAP) \
+
+       make -C$(BUILD_DIR) jerry-core
+       make -C$(BUILD_DIR) jerry-libm
+       cp $(BUILD_DIR)/lib/libjerry-core.a $(COPYTARGET)/libjerrycore.a
+       cp $(BUILD_DIR)/lib/libjerry-libm.a $(COPYTARGET)/libjerrylibm.a
+
+js2c:
+       cd targets/mbed; ../../tools/js2c.py;
+
+yotta:
+       cd targets/mbed; \
+        yotta target $(YOTTA_TARGET); \
+        yotta build
+
+flash:
+  ifndef TARGET_DIR
+       st-flash write targets/mbed/build/$(YOTTA_TARGET)/source/jerry.bin 0x08000000
+  else
+         @if [ ! -d "${TARGET_DIR}" ] ; then \
+          echo "The board not mounted at ${TARGET_DIR}"; \
+          exit 1; \
+         fi
+         cp targets/mbed/build/$(YOTTA_TARGET)/source/jerry.bin \
+          "$(TARGET_DIR)/."
+  endif
+       @echo "Wait till LED flashing stops..."
+
+clean:
+       rm -rf $(COPYTARGET)
+       rm -rf $(OUTPUT)
+       rm -rf targets/mbed/build
diff --git a/deps/jerry/targets/mbed/js/blink.js b/deps/jerry/targets/mbed/js/blink.js
new file mode 100644 (file)
index 0000000..ad43888
--- /dev/null
@@ -0,0 +1,25 @@
+/* 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.
+ */
+
+var check = 1;
+
+function blink ()
+{
+  var blk = (check > 8) ? 1 : 0;
+  led (0, blk);
+  check = (check >= 10) ? 1 : check + 1;
+}
+
+print ("blink js OK");
diff --git a/deps/jerry/targets/mbed/js/main.js b/deps/jerry/targets/mbed/js/main.js
new file mode 100644 (file)
index 0000000..d5d1045
--- /dev/null
@@ -0,0 +1,21 @@
+/* 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.
+ */
+
+function sysloop (ticknow)
+{
+  blink ();
+}
+
+print ("main js OK");
diff --git a/deps/jerry/targets/mbed/module.json b/deps/jerry/targets/mbed/module.json
new file mode 100644 (file)
index 0000000..5d73d51
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "name": "jerry",
+  "version": "0.0.1",
+  "bin": "./source",
+  "private": true,
+  "description": "JerryScript in mbed",
+  "author": "",
+  "license": "Apache-2.0",
+  "dependencies": {
+    "mbed-drivers": "^1.5.0"
+  }
+}
diff --git a/deps/jerry/targets/mbed/readme.md b/deps/jerry/targets/mbed/readme.md
new file mode 100644 (file)
index 0000000..c3167f9
--- /dev/null
@@ -0,0 +1,68 @@
+This folder contains files to run JerryScript in mbed / for:
+
+* Freedom-K64F (k64)
+* Discovery-STM32F4 (stm32f4)
+* Discovery-STM32F429ZI (stm32f429i)
+* Nucleo-F401RE (nucleo)
+
+####Yotta
+You need to install yotta before proceeding. Please visit [Yotta docs page](http://yottadocs.mbed.com/#installing-on-linux).
+
+####Cross-compiler
+For cross-compilation the GCC 5.2.1 is suggested to be used. All the supported targets were tested with this version. If you don't have any GCC compiler installed, please visit [this](https://launchpad.net/gcc-arm-embedded/+download) page to download GCC 5.2.1.
+
+####How to build a target
+Navigate to your JerryScript root folder (after you cloned this repository into the targets folder) and use the following command:
+
+```
+make -f targets/mbed/Makefile.mbed board=$(TARGET)
+```
+Where the `$(TARGET)` is one of the following options: `k64f`, `stm32f4`, `stm32f429i` or `nucleo`.
+This command will create a new folder for your target and build the jerryscript and mbed OS into that folder.
+
+####How to build a completely new target
+If you want to build a new target (which is not available in this folder) you have to modify the makefile.
+You have to add the new board name to the `TARGET_LIST` and you have to add a new branch with the new `YOTTA_TARGET` and a new `TARGET_DIR` path (if it neccessary) to the if at the top in the Makefile (just as you see right now).
+There is a little code snippet: 
+
+```
+ifeq ($(TARGET), k64f)
+  YOTTA_TARGET  = frdm-k64f-gcc
+  TARGET_DIR   ?= /media/$(USER)/MBED
+else ifeq ($(TARGET), stm32f4)
+  YOTTA_TARGET  = 
+```
+
+Basically, you can create a new target in this way (If the mbed OS support your board).
+
+#####Let's get into the details!
+1. The next rule is the `jerry` rule. This rule builds the JerryScript and copy the output files into the target libjerry folder. Two files will be generated at `targets/mbed/libjerry`:
+  * libjerrycore.a
+  * libfdlibm.a
+
+  You can run this rule with the following command: 
+  - `make -f targets/mbed/Makefile.mbed board=$(TARGET) jerry`
+
+2. The next rule is the `js2c`. This rule calls a `js2c.py` python script from the `jerryscript/targets/tools` and creates the JavaScript builtin file into the `targets/mbed/source/` folder. This file is the `jerry-targetjs.h`. You can run this rule with the follwoing command:
+
+  - `make -f targets/mbed/Makefile.mbed board=$(TARGET) js2c`
+
+3. The last rule is the `yotta`. This rule sets the yotta target and install the mbed-drivers module, install the dependencies for the mbed OS and finaly creates the mbed binary file. The binary file will be genrated at `targets/mbed/build/$(YOTTA_TARGET)/source/jerry.bin`. You can run this rule with the following command: 
+
+  - `make -f targets/mbed/Makefile.mbed board=$(TARGET) yotta`
+
+4. Optional rule: `clean`. It removes the build folder from the mbed and jerry. You can run this rule with this command:
+
+  - `make -f targets/mbed/Makefile.mbed board=$(TARGET) clean`
+
+#####Flashing
+When the build is finished you can flash the binary into your board if you want. In case of ST boards you have to install the `st-link` software. Please visit [this page](https://github.com/texane/stlink) to install STLink-v2.
+You can flash your binary into your board with the following command:
+```
+make -f targets/mbed/Makefile.mbed board=$(TARGET) flash
+```
+The flash rule grabs the binary and copies it to the mounted board or use the STLink-v2 to flash.
+When the status LED of the board stops blinking, press RESET button on the board to execute JerryScript led flashing sample program in js folder.
+
+###Note
+If you use an STM32F4 board your build will stop with missing header errors. To fix this error please visit to [this page](http://browser.sed.hu/blog/20160407/how-run-javascripts-jerryscript-mbed) and read about the fix in the `New target for STM32F4` block.
diff --git a/deps/jerry/targets/mbed/source/jerry_extapi.cpp b/deps/jerry/targets/mbed/source/jerry_extapi.cpp
new file mode 100644 (file)
index 0000000..8c2c92c
--- /dev/null
@@ -0,0 +1,148 @@
+/* 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.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "jerry-core/include/jerryscript.h"
+#include "jerry_extapi.h"
+
+#include "native_mbed.h"
+
+#ifndef MIN
+#define MIN(A,B) ((A)<(B)?(A):(B))
+#endif
+
+//-----------------------------------------------------------------------------
+
+#define __UNSED__ __attribute__((unused))
+
+#define DECLARE_HANDLER(NAME) \
+static jerry_value_t \
+NAME ## _handler (const jerry_value_t func_value __UNSED__, \
+                  const jerry_value_t this_value __UNSED__, \
+                  const jerry_value_t args[], \
+                  const jerry_length_t args_cnt )
+
+#define REGISTER_HANDLER(NAME) \
+  register_native_function ( # NAME, NAME ## _handler)
+
+//-----------------------------------------------------------------------------
+
+DECLARE_HANDLER(assert)
+{
+  if (args_cnt == 1
+      && jerry_value_is_boolean (args[0])
+      && jerry_get_boolean_value (args[0]))
+  {
+    printf (">> Jerry assert true\r\n");
+    return jerry_create_boolean (true);
+  }
+  printf ("ERROR: Script assertion failed\n");
+  exit (JERRY_STANDALONE_EXIT_CODE_FAIL);
+  return jerry_create_boolean (false);
+}
+
+DECLARE_HANDLER(led)
+{
+  jerry_value_t ret_val;
+
+  if (args_cnt < 2)
+  {
+    ret_val = jerry_create_boolean (false);
+    printf ("Error: invalid arguments number!\r\n");
+    return ret_val;
+  }
+
+  if (!(jerry_value_is_number (args[0])
+        && jerry_value_is_number (args[1])))
+  {
+    ret_val = jerry_create_boolean (false);
+    printf ("Error: arguments must be numbers!\r\n");
+    return ret_val;
+  }
+
+  int port, value;
+  port = (int) jerry_get_number_value (args[0]);
+  value = (int) jerry_get_number_value (args[1]);
+
+  if (port >= 0 && port <= 3)
+  {
+    native_led (port, value);
+    ret_val = jerry_create_boolean (true);
+  }
+  else
+  {
+    ret_val = jerry_create_boolean (false);
+  }
+  return ret_val;
+}
+
+//-----------------------------------------------------------------------------
+
+static bool
+register_native_function (const char* name,
+                          jerry_external_handler_t handler)
+{
+  jerry_value_t global_object_val = jerry_get_global_object ();
+  jerry_value_t reg_function = jerry_create_external_function (handler);
+
+  bool is_ok = true;
+
+  if (!(jerry_value_is_function (reg_function)
+        && jerry_value_is_constructor (reg_function)))
+  {
+    is_ok = false;
+    printf ("Error: create_external_function failed !!!\r\n");
+    jerry_release_value (global_object_val);
+    jerry_release_value (reg_function);
+    return is_ok;
+  }
+
+  if (jerry_value_has_error_flag (reg_function))
+  {
+    is_ok = false;
+    printf ("Error: create_external_function has error flag! \n\r");
+    jerry_release_value (global_object_val);
+    jerry_release_value (reg_function);
+    return is_ok;
+  }
+
+  jerry_value_t jerry_name = jerry_create_string ((jerry_char_t *) name);
+
+  jerry_value_t set_result = jerry_set_property (global_object_val,
+                                                 jerry_name,
+                                                 reg_function);
+
+
+  if (jerry_value_has_error_flag (set_result))
+  {
+    is_ok = false;
+    printf ("Error: register_native_function failed: [%s]\r\n", name);
+  }
+
+  jerry_release_value (jerry_name);
+  jerry_release_value (global_object_val);
+  jerry_release_value (reg_function);
+  jerry_release_value (set_result);
+
+  return is_ok;
+}
+
+void js_register_functions (void)
+{
+  REGISTER_HANDLER (assert);
+  REGISTER_HANDLER (led);
+}
diff --git a/deps/jerry/targets/mbed/source/jerry_extapi.h b/deps/jerry/targets/mbed/source/jerry_extapi.h
new file mode 100644 (file)
index 0000000..8c365b1
--- /dev/null
@@ -0,0 +1,24 @@
+/* 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.
+ */
+
+#ifndef __JERRY_EXTAPI_H__
+#define __JERRY_EXTAPI_H__
+
+#define JERRY_STANDALONE_EXIT_CODE_OK   (0)
+#define JERRY_STANDALONE_EXIT_CODE_FAIL (1)
+
+void js_register_functions (void);
+
+#endif
diff --git a/deps/jerry/targets/mbed/source/jerry_run.cpp b/deps/jerry/targets/mbed/source/jerry_run.cpp
new file mode 100644 (file)
index 0000000..4b8a4b5
--- /dev/null
@@ -0,0 +1,127 @@
+/* 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.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "jerry-core/include/jerryscript.h"
+#include "jerry_extapi.h"
+#include "jerry_run.h"
+
+static const char* fn_sys_loop_name = "sysloop";
+
+int js_entry (const char *source_p, const size_t source_size)
+{
+  const jerry_char_t *jerry_src = (const jerry_char_t *) source_p;
+  jerry_init (JERRY_INIT_EMPTY);
+  uint8_t ret_code = 0;
+
+  js_register_functions ();
+
+  jerry_value_t parsed_code = jerry_parse (jerry_src, source_size, false);
+
+  if (!jerry_value_has_error_flag (parsed_code))
+  {
+    jerry_value_t ret_value = jerry_run (parsed_code);
+
+    if (jerry_value_has_error_flag (ret_value))
+      {
+      printf ("Error: ret_value has an error flag!\r\n");
+      return ret_code = -1;
+      }
+
+    jerry_release_value (ret_value);
+  }
+  else
+  {
+    printf ("Error: jerry_parse failed!\r\n");
+    ret_code = -1;
+  }
+
+  jerry_release_value (parsed_code);
+
+  return ret_code;
+}
+
+int js_eval (const char *source_p, const size_t source_size)
+{
+  int status = 0;
+
+  jerry_value_t ret_val = jerry_eval ((jerry_char_t *) source_p,
+                                      source_size,
+                                      false);
+
+  if (jerry_value_has_error_flag (ret_val))
+  {
+    printf ("Error: jerry_eval failed!\r\n");
+    status = -1;
+  }
+
+  jerry_release_value (ret_val);
+
+  return status;
+}
+
+int js_loop (uint32_t ticknow)
+{
+  int status = 0;
+  jerry_value_t global_obj = jerry_get_global_object ();
+  jerry_value_t sys_name = jerry_create_string ((const jerry_char_t *) fn_sys_loop_name);
+  jerry_value_t sysloop_func = jerry_get_property (global_obj, sys_name);
+
+  jerry_release_value (sys_name);
+
+  if (jerry_value_has_error_flag (sysloop_func))
+  {
+    printf ("Error: '%s' not defined!!!\r\n", fn_sys_loop_name);
+    jerry_release_value (global_obj);
+    jerry_release_value (sysloop_func);
+    return -1;
+  }
+
+  if (!jerry_value_is_function (sysloop_func))
+  {
+    printf ("Error: '%s' is not a function!!!\r\n", fn_sys_loop_name);
+    jerry_release_value (global_obj);
+    jerry_release_value (sysloop_func);
+    return -2;
+  }
+
+  jerry_value_t val_args[1];
+  uint16_t val_argv = 1;
+
+  val_args[0] = jerry_create_number (ticknow);
+
+  jerry_value_t ret_val_sysloop = jerry_call_function (sysloop_func,
+                                                       global_obj,
+                                                       val_args,
+                                                       val_argv);
+  if (jerry_value_has_error_flag (ret_val_sysloop))
+  {
+    status = -3;
+  }
+
+  jerry_release_value (global_obj);
+  jerry_release_value (ret_val_sysloop);
+  jerry_release_value (sysloop_func);
+  jerry_release_value (val_args[0]);
+
+  return status;
+}
+
+void js_exit (void)
+{
+  jerry_cleanup ();
+}
diff --git a/deps/jerry/targets/mbed/source/jerry_run.h b/deps/jerry/targets/mbed/source/jerry_run.h
new file mode 100644 (file)
index 0000000..669beff
--- /dev/null
@@ -0,0 +1,24 @@
+/* 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.
+ */
+
+#ifndef __JERRY_RUN_H__
+#define __JERRY_RUN_H__
+
+int js_entry (const char *source_p, const size_t source_size);
+int js_eval (const char *source_p, const size_t source_size);
+int js_loop (uint32_t ticknow);
+void js_exit (void);
+
+#endif
diff --git a/deps/jerry/targets/mbed/source/main.cpp b/deps/jerry/targets/mbed/source/main.cpp
new file mode 100644 (file)
index 0000000..39aedb1
--- /dev/null
@@ -0,0 +1,72 @@
+/* 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.
+ */
+
+#include "mbed-drivers/mbed.h"
+
+#include "jerry-core/include/jerryscript.h"
+#include "jerry_run.h"
+
+#include "jerry-targetjs.h"
+
+static Serial pc (USBTX, USBRX); //tx, rx
+
+static int jerry_task_init (void)
+{
+  int retcode;
+
+  DECLARE_JS_CODES;
+
+  /* run main.js */
+  retcode = js_entry (js_codes[0].source, js_codes[0].length);
+  if (retcode != 0)
+  {
+    printf ("js_entry failed code(%d) [%s]\r\n", retcode, js_codes[0].name);
+    js_exit ();
+    return -1;
+  }
+  /* run rest of the js files */
+  for (int src = 1; js_codes[src].source; src++)
+  {
+    retcode = js_eval (js_codes[src].source, js_codes[src].length);
+    if (retcode != 0)
+    {
+      printf ("js_eval failed code(%d) [%s]\r\n", retcode, js_codes[src].name);
+      js_exit ();
+      return -2;
+    }
+  }
+  return 0;
+}
+
+static void jerry_loop (void)
+{
+  static uint32_t _jcount = 0;
+
+  js_loop (_jcount++);
+}
+
+void app_start (int, char**)
+{
+  /* set 9600 baud rate for stdout */
+  pc.baud (9600);
+
+  printf ("\r\nJerryScript in mbed\r\n");
+  printf ("Version: \t%d.%d\n\n", JERRY_API_MAJOR_VERSION, JERRY_API_MINOR_VERSION);
+
+  if (jerry_task_init () == 0)
+  {
+    minar::Scheduler::postCallback(jerry_loop).period(minar::milliseconds(100));
+  }
+}
diff --git a/deps/jerry/targets/mbed/source/makejerry.cmake b/deps/jerry/targets/mbed/source/makejerry.cmake
new file mode 100644 (file)
index 0000000..36abec8
--- /dev/null
@@ -0,0 +1,30 @@
+# 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.
+
+# application name
+set(MBEDMODULE "jerry")
+
+# add include jerry-core
+set(LJCORE ${CMAKE_CURRENT_LIST_DIR}/../../../)
+include_directories(${LJCORE})
+
+# compile flags
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlittle-endian -mthumb -mcpu=cortex-m4" )
+
+# link jerryscript
+set(LJPATH ${CMAKE_CURRENT_LIST_DIR}/../libjerry)
+set(LJFILES "")
+set(LJFILES ${LJFILES} ${LJPATH}/libjerrylibm.a)
+set(LJFILES ${LJFILES} ${LJPATH}/libjerrycore.a)
+target_link_libraries(${MBEDMODULE} ${LJFILES})
diff --git a/deps/jerry/targets/mbed/source/native_mbed.cpp b/deps/jerry/targets/mbed/source/native_mbed.cpp
new file mode 100644 (file)
index 0000000..cc81e0e
--- /dev/null
@@ -0,0 +1,25 @@
+/* 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.
+ */
+
+#include "mbed-drivers/mbed.h"
+
+#include "native_mbed.h"
+
+void native_led (int port, int val)
+{
+  static const PinName portmap[] = { LED1, LED2, LED3, LED4 };
+  static DigitalOut led (portmap[port]);
+  led = val;
+}
diff --git a/deps/jerry/targets/mbed/source/native_mbed.h b/deps/jerry/targets/mbed/source/native_mbed.h
new file mode 100644 (file)
index 0000000..9f44010
--- /dev/null
@@ -0,0 +1,21 @@
+/* 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.
+ */
+
+#ifndef __NATIVE_MBED_H__
+#define __NATIVE_MBED_H__
+
+void native_led (int port, int val);
+
+#endif /* !__NATIVE_MBED_H__ */
diff --git a/deps/jerry/targets/mbed/source/port/jerry_port.c b/deps/jerry/targets/mbed/source/port/jerry_port.c
new file mode 100644 (file)
index 0000000..496ee86
--- /dev/null
@@ -0,0 +1,74 @@
+/* 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.
+ */
+
+#define _BSD_SOURCE
+#include <stdarg.h>
+#include <stdlib.h>
+#include <sys/time.h>
+
+#include "jerry-core/include/jerryscript-port.h"
+
+#include "mbed-hal/us_ticker_api.h"
+
+/**
+ * Provide log message implementation for the engine.
+ */
+void
+jerry_port_log (jerry_log_level_t level, /**< log level */
+                const char *format, /**< format string */
+                ...)  /**< parameters */
+{
+  (void) level; /* ignore log level */
+
+  va_list args;
+  va_start (args, format);
+  vfprintf (stderr, format, args);
+  va_end (args);
+} /* jerry_port_log */
+
+/**
+ * Implementation of jerry_port_fatal.
+ */
+void
+jerry_port_fatal (jerry_fatal_code_t code) /**< fatal code enum item */
+{
+  exit (code);
+} /* jerry_port_fatal */
+
+/**
+ * Implementation of jerry_port_get_time_zone.
+ *
+ * @return true - if success
+ */
+bool
+jerry_port_get_time_zone (jerry_time_zone_t *tz_p) /**< timezone pointer */
+{
+  tz_p->offset = 0;
+  tz_p->daylight_saving_time = 0;
+  return true;
+} /* jerry_port_get_time_zone */
+
+/**
+ * Implementation of jerry_port_get_current_time.
+ *
+ * @return current timer's counter value in milliseconds
+ */
+double
+jerry_port_get_current_time (void)
+{
+  /* Note: if the target has its own RTC, this value should be extended by the
+   * RTC's one. */
+  return (double) us_ticker_read () / 1000;
+} /* jerry_port_get_current_time */
diff --git a/deps/jerry/targets/mbedos5/.gitignore b/deps/jerry/targets/mbedos5/.gitignore
new file mode 100644 (file)
index 0000000..1aaa6a5
--- /dev/null
@@ -0,0 +1,9 @@
+mbed-os
+mbed-events
+.build
+.mbed
+.temp/
+mbed_settings.py
+js/pins.js
+source/pins.cpp
+source/jerry-targetjs.h
diff --git a/deps/jerry/targets/mbedos5/Makefile b/deps/jerry/targets/mbedos5/Makefile
new file mode 100644 (file)
index 0000000..faf130c
--- /dev/null
@@ -0,0 +1,94 @@
+# 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.
+
+# USAGE:
+# specify the board using the command line:
+# make BOARD=[mbed board name]
+
+BOARD=$(subst [mbed] ,,$(shell mbed target))
+HEAPSIZE=16
+
+DEBUG?=0
+NO_JS?=0
+MBED_VERBOSE?=0
+
+MBED_CLI_FLAGS=-j0 --source . --source ../../
+
+EXTRA_SRC=
+
+ifneq ($(EXTRA_SRC),)
+EXTRA_SRC_MOD=--source $(subst :, --source ,$(EXTRA_SRC))
+MBED_CLI_FLAGS += $(EXTRA_SRC_MOD)
+endif
+
+EXTERN_BUILD_DIR=
+
+ifneq ($(EXTERN_BUILD_DIR),)
+MBED_CLI_FLAGS += --build $(EXTERN_BUILD_DIR)
+endif
+
+ifeq ($(DEBUG), 1)
+MBED_CLI_FLAGS += --profile ./mbed-os/tools/profiles/debug.json
+endif
+
+ifeq ($(MBED_VERBOSE), 1)
+MBED_CLI_FLAGS += -v
+else ifeq ($(MBED_VERBOSE), 2)
+MBED_CLI_FLAGS += -vv
+endif
+
+MBED_CLI_FLAGS += -D "CONFIG_MEM_HEAP_AREA_SIZE=(1024*$(HEAPSIZE))"
+MBED_CLI_FLAGS += -t GCC_ARM
+
+.PHONY: all js2c getlibs rebuild library
+all: source/jerry-targetjs.h source/pins.cpp .mbed ../../.mbedignore
+       mbed target $(BOARD)
+       mbed compile $(MBED_CLI_FLAGS)
+
+library: .mbed ../../.mbedignore
+       # delete encoded js code if it exists
+       rm -f source/jerry-targetjs.h
+       mbed target $(BOARD)
+       mbed compile $(MBED_CLI_FLAGS) --library
+
+clean:
+       rm -rf ./BUILD/$(BOARD)
+
+js2c: js/main.js js/flash_leds.js
+       python ../../tools/js2c.py --ignore pins.js
+
+source/pins.cpp:
+       python tools/generate_pins.py ${BOARD}
+
+ifeq ($(NO_JS),0)
+source/jerry-targetjs.h: js2c
+else
+source/jerry-targetjs.h: ;
+endif
+
+getlibs: .mbed
+
+.mbed:
+       echo 'ROOT=.' > .mbed
+       mbed config root .
+       mbed toolchain GCC_ARM
+       mbed target $(BOARD)
+       mbed deploy
+
+../../.mbedignore:
+ifeq ($(OS),Windows_NT)
+       copy template-mbedignore.txt ..\..\.mbedignore
+else
+       cp ./template-mbedignore.txt ../../.mbedignore
+endif
diff --git a/deps/jerry/targets/mbedos5/README.md b/deps/jerry/targets/mbedos5/README.md
new file mode 100644 (file)
index 0000000..f97e1a6
--- /dev/null
@@ -0,0 +1,74 @@
+# JerryScript with mbed OS 5
+
+TL;DR? jump straight to [quickstart](#quick-start)
+
+## Introduction
+
+This directory contains the necessary code to build JerryScript for devices
+capable of running mbed OS 5. It has been tested with the following boards
+so far:
+
+- [Nordic Semiconductor NRF52 Development Kit](https://developer.mbed.org/platforms/Nordic-nRF52-DK/)
+- [NXP Freedom K64F](https://developer.mbed.org/platforms/FRDM-K64F/)
+- [STM NUCLEO F401RE](https://developer.mbed.org/platforms/ST-Nucleo-F401RE/)
+- [Silicon Labs EFM32 Giant Gecko](https://developer.mbed.org/platforms/EFM32-Giant-Gecko/)
+
+## Features
+
+### Peripheral Drivers
+
+Peripheral Drivers are intended as a 1-to-1 mapping to mbed C++ APIs, with a few
+differences (due to differences between JavaScript and C++ like lack of operator
+overloading).
+
+- [DigitalOut](https://docs.mbed.com/docs/mbed-os-api-reference/en/5.1/APIs/io/DigitalOut/)
+- [InterruptIn](https://docs.mbed.com/docs/mbed-os-api-reference/en/5.1/APIs/io/InterruptIn/)
+- [I2C](https://docs.mbed.com/docs/mbed-os-api-reference/en/5.1/APIs/interfaces/digital/I2C/)
+- setInterval and setTimeout using [mbed-event](https://github.com/ARMmbed/mbed-events)
+
+## Dependencies
+
+### mbed CLI
+
+mbed CLI is used as the build tool for mbed OS 5. You can find out how to install
+it in the [official documentation](https://docs.mbed.com/docs/mbed-os-handbook/en/5.1/dev_tools/cli/#installing-mbed-cli).
+
+### arm-none-eabi-gcc
+
+arm-none-eabi-gcc is the only currently tested compiler for jerryscript on mbed,
+and instructions for building can be found as part of the mbed-cli installation
+instructions above.
+
+### make
+
+make is used to automate the process of fetching dependencies, and making sure that
+mbed-cli is called with the correct arguments.
+
+### nodejs
+
+npm is used to install the dependencies in the local node_modules folder.
+
+### gulp
+
+gulp is used to automate tasks, like cloning repositories or generate source files.
+If you create an own project, for more info see [mbed-js-gulp](https://github.com/ARMmbed/mbed-js-gulp).
+
+### (optional) jshint
+
+jshint is used to statically check your JavaScript code, as part of the build process.
+This ensures that pins you are using in your code are available on your chosen target
+platform.
+
+## Quick Start
+
+Once you have all of your dependencies installed, you can build the example project as follows:
+
+```bash
+git clone https://github.com/ARMmbed/mbed-js-example
+cd mbed-js-example
+npm install
+gulp --target=YOUR_TARGET_NAME
+```
+
+The produced file (in build/out/YOUR_TARGET_NAME) can then be uploaded to your board, and will
+run when you press reset.
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/AnalogIn-js.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/AnalogIn-js.h
new file mode 100644 (file)
index 0000000..89fc8d4
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_DRIVERS_ANALOGIN_H
+#define _JERRYSCRIPT_MBED_DRIVERS_ANALOGIN_H
+
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+DECLARE_CLASS_CONSTRUCTOR(AnalogIn);
+
+#endif  // _JERRYSCRIPT_MBED_DRIVERS_ANALOGIN_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/DigitalOut-js.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/DigitalOut-js.h
new file mode 100644 (file)
index 0000000..1c819fd
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_DRIVERS_DIGITALOUT_H
+#define _JERRYSCRIPT_MBED_DRIVERS_DIGITALOUT_H
+
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+DECLARE_CLASS_CONSTRUCTOR(DigitalOut);
+
+#endif  // _JERRYSCRIPT_MBED_DRIVERS_DIGITALOUT_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/I2C-js.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/I2C-js.h
new file mode 100644 (file)
index 0000000..984dcc0
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_DRIVERS_I2C_H
+#define _JERRYSCRIPT_MBED_DRIVERS_I2C_H
+
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+DECLARE_CLASS_CONSTRUCTOR(I2C);
+
+#endif  // _JERRYSCRIPT_MBED_DRIVERS_I2C_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/InterruptIn-js.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/InterruptIn-js.h
new file mode 100644 (file)
index 0000000..a41cca0
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_DRIVERS_INTERRUPTIN_H
+#define _JERRYSCRIPT_MBED_DRIVERS_INTERRUPTIN_H
+
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+DECLARE_CLASS_CONSTRUCTOR(InterruptIn);
+
+#endif  // _JERRYSCRIPT_MBED_DRIVERS_INTERRUPTIN_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/PwmOut-js.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/PwmOut-js.h
new file mode 100644 (file)
index 0000000..91ef751
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_DRIVERS_PWMOUT_H
+#define _JERRYSCRIPT_MBED_DRIVERS_PWMOUT_H
+
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+DECLARE_CLASS_CONSTRUCTOR(PwmOut);
+
+#endif  // _JERRYSCRIPT_MBED_DRIVERS_PWMOUT_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/lib_drivers.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/lib_drivers.h
new file mode 100644 (file)
index 0000000..7ec44d0
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_DRIVERS_LIB_DRIVERS_H
+#define _JERRYSCRIPT_MBED_DRIVERS_LIB_DRIVERS_H
+
+#include "jerryscript-ext/handler.h"
+#include "jerryscript-mbed-drivers/InterruptIn-js.h"
+#include "jerryscript-mbed-drivers/DigitalOut-js.h"
+#include "jerryscript-mbed-drivers/setInterval-js.h"
+#include "jerryscript-mbed-drivers/setTimeout-js.h"
+#include "jerryscript-mbed-drivers/I2C-js.h"
+#include "jerryscript-mbed-drivers/AnalogIn-js.h"
+#include "jerryscript-mbed-drivers/PwmOut-js.h"
+
+DECLARE_JS_WRAPPER_REGISTRATION (base) {
+    REGISTER_GLOBAL_FUNCTION_WITH_HANDLER(assert, jerryx_handler_assert);
+    REGISTER_GLOBAL_FUNCTION_WITH_HANDLER(gc, jerryx_handler_gc);
+    REGISTER_GLOBAL_FUNCTION_WITH_HANDLER(print, jerryx_handler_print);
+    REGISTER_GLOBAL_FUNCTION(setInterval);
+    REGISTER_GLOBAL_FUNCTION(setTimeout);
+    REGISTER_GLOBAL_FUNCTION(clearInterval);
+    REGISTER_GLOBAL_FUNCTION(clearTimeout);
+    REGISTER_CLASS_CONSTRUCTOR(DigitalOut);
+    REGISTER_CLASS_CONSTRUCTOR(I2C);
+    REGISTER_CLASS_CONSTRUCTOR(InterruptIn);
+    REGISTER_CLASS_CONSTRUCTOR(AnalogIn);
+    REGISTER_CLASS_CONSTRUCTOR(PwmOut);
+}
+
+#endif  // _JERRYSCRIPT_MBED_DRIVERS_LIB_DRIVERS_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/setInterval-js.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/setInterval-js.h
new file mode 100644 (file)
index 0000000..2501627
--- /dev/null
@@ -0,0 +1,23 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_DRIVERS_SET_INTERVAL_H
+#define _JERRYSCRIPT_MBED_DRIVERS_SET_INTERVAL_H
+
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+DECLARE_GLOBAL_FUNCTION(setInterval);
+DECLARE_GLOBAL_FUNCTION(clearInterval);
+
+#endif  // _JERRYSCRIPT_MBED_DRIVERS_SET_INTERVAL_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/setTimeout-js.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/setTimeout-js.h
new file mode 100644 (file)
index 0000000..13174f7
--- /dev/null
@@ -0,0 +1,23 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_DRIVERS_SET_TIMEOUT_H
+#define _JERRYSCRIPT_MBED_DRIVERS_SET_TIMEOUT_H
+
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+DECLARE_GLOBAL_FUNCTION(setTimeout);
+DECLARE_GLOBAL_FUNCTION(clearTimeout);
+
+#endif  // _JERRYSCRIPT_MBED_DRIVERS_SET_TIMEOUT_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/AnalogIn-js.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/AnalogIn-js.cpp
new file mode 100644 (file)
index 0000000..b29e171
--- /dev/null
@@ -0,0 +1,93 @@
+/* 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.
+ */
+#include "jerryscript-mbed-util/logging.h"
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+#include "mbed.h"
+
+/**
+ * AnalogIn#read (native JavaScript method)
+ *
+ * Read the input voltage, represented as a float in the range [0.0, 1.0]
+ *
+ * @returns A floating-point value representing the current input voltage, measured as a percentage
+ */
+DECLARE_CLASS_FUNCTION(AnalogIn, read) {
+    CHECK_ARGUMENT_COUNT(AnalogIn, read, (args_count == 0));
+
+    // Extract native AnalogIn pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    AnalogIn* native_ptr = reinterpret_cast<AnalogIn*>(ptr_val);
+
+    float result = native_ptr->read();
+    return jerry_create_number(result);
+}
+
+/**
+ * AnalogIn#read_u16 (native JavaScript method)
+ *
+ * Read the input voltage, represented as an unsigned short in the range [0x0, 0xFFFF]
+ *
+ * @returns 16-bit unsigned short representing the current input voltage, normalised to a 16-bit value
+ */
+DECLARE_CLASS_FUNCTION(AnalogIn, read_u16) {
+    CHECK_ARGUMENT_COUNT(AnalogIn, read_u16, (args_count == 0));
+
+    // Extract native AnalogIn pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    AnalogIn* native_ptr = reinterpret_cast<AnalogIn*>(ptr_val);
+
+    uint16_t result = native_ptr->read_u16();
+    return jerry_create_number(result);
+}
+
+/**
+ * AnalogIn#destructor
+ *
+ * Called if/when the AnalogIn is GC'ed.
+ */
+void NAME_FOR_CLASS_NATIVE_DESTRUCTOR(AnalogIn)(const uintptr_t native_handle) {
+    delete reinterpret_cast<AnalogIn*>(native_handle);
+}
+
+/**
+ * AnalogIn (native JavaScript constructor)
+ *
+ * @param pin_name mbed pin to connect the AnalogIn to.
+ * @returns a JavaScript object representing a AnalogIn.
+ */
+DECLARE_CLASS_CONSTRUCTOR(AnalogIn) {
+    CHECK_ARGUMENT_COUNT(AnalogIn, __constructor, args_count == 1);
+    CHECK_ARGUMENT_TYPE_ALWAYS(AnalogIn, __constructor, 0, number);
+
+    PinName pin_name = PinName(jerry_get_number_value(args[0]));
+
+    // create native object
+    uintptr_t native_ptr = (uintptr_t) new AnalogIn(pin_name);
+
+    // create the jerryscript object
+    jerry_value_t js_object = jerry_create_object();
+    jerry_set_object_native_handle(js_object, native_ptr, NAME_FOR_CLASS_NATIVE_DESTRUCTOR(AnalogIn));
+
+    // attach methods
+    ATTACH_CLASS_FUNCTION(js_object, AnalogIn, read);
+    ATTACH_CLASS_FUNCTION(js_object, AnalogIn, read_u16);
+
+    return js_object;
+}
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/DigitalOut-js.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/DigitalOut-js.cpp
new file mode 100644 (file)
index 0000000..88f51d9
--- /dev/null
@@ -0,0 +1,131 @@
+/* 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.
+ */
+#include "jerryscript-mbed-util/logging.h"
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+#include "mbed.h"
+
+/**
+ * DigitalOut#write (native JavaScript method)
+ *
+ * Writes a binary value to a DigitalOut.
+ *
+ * @param value 1 or 0, specifying whether the output pin is high or low,
+ *      respectively
+ * @returns undefined, or an error if invalid arguments are provided.
+ */
+DECLARE_CLASS_FUNCTION(DigitalOut, write) {
+    CHECK_ARGUMENT_COUNT(DigitalOut, write, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(DigitalOut, write, 0, number);
+
+    // Extract native DigitalOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    DigitalOut* native_ptr = reinterpret_cast<DigitalOut*>(ptr_val);
+    
+    int arg0 = jerry_get_number_value(args[0]);
+    native_ptr->write(arg0);
+
+    return jerry_create_undefined();
+}
+
+/**
+ * DigitalOut#read (native JavaScript method)
+ *
+ * Reads the current status of a DigitalOut
+ *
+ * @returns 1 if the pin is currently high, or 0 if the pin is currently low.
+ */
+DECLARE_CLASS_FUNCTION(DigitalOut, read) {
+    CHECK_ARGUMENT_COUNT(DigitalOut, read, (args_count == 0));
+
+    // Extract native DigitalOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    DigitalOut* native_ptr = reinterpret_cast<DigitalOut*>(ptr_val);
+
+    int result = native_ptr->read();
+    return jerry_create_number(result);
+}
+
+/**
+ * DigitalOut#is_connected (native JavaScript method)
+ *
+ * @returns 0 if the DigitalOut is set to NC, or 1 if it is connected to an
+ *  actual pin
+ */
+DECLARE_CLASS_FUNCTION(DigitalOut, is_connected) {
+    CHECK_ARGUMENT_COUNT(DigitalOut, is_connected, (args_count == 0));
+
+    // Extract native DigitalOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    DigitalOut* native_ptr = reinterpret_cast<DigitalOut*>(ptr_val);
+
+    int result = native_ptr->is_connected();
+    return jerry_create_number(result);
+}
+
+/**
+ * DigitalOut#destructor
+ * 
+ * Called if/when the DigitalOut is GC'ed.
+ */
+void NAME_FOR_CLASS_NATIVE_DESTRUCTOR(DigitalOut)(const uintptr_t native_handle) {
+    delete reinterpret_cast<DigitalOut*>(native_handle);
+}
+
+/**
+ * DigitalOut (native JavaScript constructor)
+ *
+ * @param pin_name mbed pin to connect the DigitalOut to.
+ * @param value (optional) Initial value of the DigitalOut.
+ * @returns a JavaScript object representing a DigitalOut.
+ */
+DECLARE_CLASS_CONSTRUCTOR(DigitalOut) {
+    CHECK_ARGUMENT_COUNT(DigitalOut, __constructor, (args_count == 1 || args_count == 2));
+    CHECK_ARGUMENT_TYPE_ALWAYS(DigitalOut, __constructor, 0, number);
+    CHECK_ARGUMENT_TYPE_ON_CONDITION(DigitalOut, __constructor, 1, number, (args_count == 2));
+
+    uintptr_t native_ptr;
+
+    // Call correct overload of DigitalOut::DigitalOut depending on the
+    // arguments passed.
+    PinName pin_name = PinName(jerry_get_number_value(args[0]));
+
+    switch (args_count) {
+        case 1:
+            native_ptr = (uintptr_t) new DigitalOut(pin_name);
+            break;
+        case 2:
+            int value = static_cast<int>(jerry_get_number_value(args[1]));
+            native_ptr = (uintptr_t) new DigitalOut(pin_name, value);
+            break;
+    }
+
+    // create the jerryscript object
+    jerry_value_t js_object = jerry_create_object();
+    jerry_set_object_native_handle(js_object, native_ptr, NAME_FOR_CLASS_NATIVE_DESTRUCTOR(DigitalOut));
+
+    // attach methods
+    ATTACH_CLASS_FUNCTION(js_object, DigitalOut, write);
+    ATTACH_CLASS_FUNCTION(js_object, DigitalOut, read);
+    ATTACH_CLASS_FUNCTION(js_object, DigitalOut, is_connected);
+
+    return js_object;
+}
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/I2C-js.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/I2C-js.cpp
new file mode 100644 (file)
index 0000000..ca6ba7f
--- /dev/null
@@ -0,0 +1,270 @@
+/* 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.
+ */
+#include "jerryscript-mbed-util/logging.h"
+#include "jerryscript-mbed-drivers/I2C-js.h"
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+#include "mbed.h"
+
+/**
+ * I2C#frequency (native JavaScript method)
+ *
+ * Set the frequency of the I2C bus.
+ *
+ * @param frequency New I2C Frequency
+ */
+DECLARE_CLASS_FUNCTION(I2C, frequency) {
+    CHECK_ARGUMENT_COUNT(I2C, frequency, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(I2C, frequency, 0, number);
+
+    // Unwrap native I2C object
+    uintptr_t native_handle;
+    jerry_get_object_native_handle(this_obj, &native_handle);
+    I2C* native_ptr = reinterpret_cast<I2C*>(native_handle);
+
+    int hz = jerry_get_number_value(args[0]);
+    native_ptr->frequency(hz);
+
+    return jerry_create_undefined();
+}
+
+/**
+ * I2C#read (native JavaScript method)
+ *
+ * Read data from the I2C bus.
+ *
+ * @overload I2C#read(int)
+ * Read a single byte from the I2C bus
+ *
+ * @param ack indicates if the byte is to be acknowledged (1 => acknowledge)
+ *
+ * @returns array: Data read from the I2C bus
+ *
+ * @overload I2C#read(int, array, int)
+ * Read a series of bytes from the I2C bus
+ *
+ * @param address I2C address to read from
+ * @param data Array to read into
+ * @param length Length of data to read
+ *
+ * @returns array: Data read from the I2C bus
+ */
+DECLARE_CLASS_FUNCTION(I2C, read) {
+    CHECK_ARGUMENT_COUNT(I2C, read, (args_count == 1 || args_count == 3 || args_count == 4));
+
+    if (args_count == 1) {
+        CHECK_ARGUMENT_TYPE_ALWAYS(I2C, read, 0, number);
+        uintptr_t native_handle;
+        jerry_get_object_native_handle(this_obj, &native_handle);
+        I2C *native_ptr = reinterpret_cast<I2C*>(native_handle);
+
+        int data = jerry_get_number_value(args[0]);
+        int result = native_ptr->read(data);
+
+        return jerry_create_number(result);
+    } else {
+        CHECK_ARGUMENT_TYPE_ALWAYS(I2C, read, 0, number);
+        CHECK_ARGUMENT_TYPE_ALWAYS(I2C, read, 1, array);
+        CHECK_ARGUMENT_TYPE_ALWAYS(I2C, read, 2, number);
+
+        CHECK_ARGUMENT_TYPE_ON_CONDITION(I2C, read, 3, boolean, (args_count == 4));
+
+        uintptr_t native_handle;
+        jerry_get_object_native_handle(this_obj, &native_handle);
+        I2C *native_ptr = reinterpret_cast<I2C*>(native_handle);
+
+        const uint32_t data_len = jerry_get_array_length(args[1]);
+
+        int address = jerry_get_number_value(args[0]);
+        int length = jerry_get_number_value(args[2]);
+
+        char *data = new char[data_len];
+
+        bool repeated = false;
+        if (args_count == 4) {
+            repeated = jerry_get_boolean_value(args[3]);
+        }
+
+        int result = native_ptr->read(address, data, length, repeated);
+
+        jerry_value_t out_array = jerry_create_array(data_len);
+
+        for (uint32_t i = 0; i < data_len; i++) {
+            jerry_value_t val = jerry_create_number(double(data[i]));
+            jerry_set_property_by_index(out_array, i, val);
+            jerry_release_value(val);
+        }
+
+        delete[] data;
+
+        if (result == 0) {
+            // ACK
+            return out_array;
+        } else {
+            // NACK
+            const char *error_msg = "NACK received from I2C bus";
+
+            jerry_release_value(out_array);
+            return jerry_create_error(JERRY_ERROR_COMMON, reinterpret_cast<const jerry_char_t *>(error_msg));
+        }
+    }
+}
+
+/**
+ * I2C#write (native JavaScript method)
+ *
+ * @overload I2C#write(int)
+ * Write a single byte to the I2C bus
+ *
+ * @param data Data byte to write to the I2C bus
+ *
+ * @returns 1 on success, 0 on failure
+ *
+ * @overload I2C#write(int, array, int, bool)
+ * Write an array of data to a certain address on the I2C bus
+ *
+ * @param address 8-bit I2C slave address
+ * @param data Array of bytes to send
+ * @param length Length of data to write
+ * @param repeated (optional) If true, do not send stop at end.
+ *
+ * @returns 0 on success, non-0 on failure
+ */
+DECLARE_CLASS_FUNCTION(I2C, write) {
+    CHECK_ARGUMENT_COUNT(I2C, write, (args_count == 1 || args_count == 3 || args_count == 4));
+
+    if (args_count == 1) {
+        CHECK_ARGUMENT_TYPE_ALWAYS(I2C, write, 0, number);
+
+        // Extract native I2C object
+        uintptr_t native_handle;
+        jerry_get_object_native_handle(this_obj, &native_handle);
+
+        I2C *native_ptr = reinterpret_cast<I2C*>(native_handle);
+
+        // Unwrap arguments
+        int data = jerry_get_number_value(args[0]);
+
+        int result = native_ptr->write(data);
+        return jerry_create_number(result);
+    } else {
+        // 3 or 4
+        CHECK_ARGUMENT_TYPE_ALWAYS(I2C, write, 0, number);
+        CHECK_ARGUMENT_TYPE_ALWAYS(I2C, write, 1, array);
+        CHECK_ARGUMENT_TYPE_ALWAYS(I2C, write, 2, number);
+        CHECK_ARGUMENT_TYPE_ON_CONDITION(I2C, write, 3, boolean, (args_count == 4));
+
+        // Extract native I2C object
+        uintptr_t native_handle;
+        jerry_get_object_native_handle(this_obj, &native_handle);
+
+        I2C *native_ptr = reinterpret_cast<I2C*>(native_handle);
+
+        // Unwrap arguments
+        int address = jerry_get_number_value(args[0]);
+        const uint32_t data_len = jerry_get_array_length(args[1]);
+        int length = jerry_get_number_value(args[2]);
+        bool repeated = args_count == 4 && jerry_get_boolean_value(args[3]);
+
+        // Construct data byte array
+        char *data = new char[data_len];
+        for (uint32_t i = 0; i < data_len; i++) {
+            data[i] = jerry_get_number_value(jerry_get_property_by_index(args[1], i));
+        }
+
+        int result = native_ptr->write(address, data, length, repeated);
+
+        // free dynamically allocated resources
+        delete[] data;
+
+        return jerry_create_number(result);
+    }
+}
+
+/**
+ * I2C#start (native JavaScript method)
+ *
+ * Creates a start condition on the I2C bus.
+ */
+DECLARE_CLASS_FUNCTION(I2C, start)
+{
+    CHECK_ARGUMENT_COUNT(I2C, start, (args_count == 0));
+
+    // Extract native I2C object
+    uintptr_t native_handle;
+    jerry_get_object_native_handle(this_obj, &native_handle);
+
+    I2C *native_ptr = reinterpret_cast<I2C*>(native_handle);
+
+    native_ptr->start();
+    return jerry_create_undefined();
+}
+
+/**
+ * I2C#stop (native JavaScript method)
+ *
+ * Creates a stop condition on the I2C bus.
+ */
+DECLARE_CLASS_FUNCTION(I2C, stop)
+{
+    CHECK_ARGUMENT_COUNT(I2C, stop, (args_count == 0));
+
+    // Extract native I2C object
+    uintptr_t native_handle;
+    jerry_get_object_native_handle(this_obj, &native_handle);
+
+    I2C *native_ptr = reinterpret_cast<I2C*>(native_handle);
+
+    native_ptr->stop();
+    return jerry_create_undefined();
+}
+
+/**
+ * I2C#destructor
+ *
+ * Called if/when the I2C object is GC'ed.
+ */
+void NAME_FOR_CLASS_NATIVE_DESTRUCTOR(I2C) (uintptr_t handle) {
+    delete reinterpret_cast<I2C*>(handle);
+}
+
+/**
+ * I2C (native JavaScript constructor)
+ *
+ * @param sda mbed pin for I2C data
+ * @param scl mbed pin for I2C clock
+ * @returns a JavaScript object representing the I2C bus.
+ */
+DECLARE_CLASS_CONSTRUCTOR(I2C) {
+    CHECK_ARGUMENT_COUNT(I2C, __constructor, (args_count == 2));
+    CHECK_ARGUMENT_TYPE_ALWAYS(I2C, __constructor, 0, number);
+    CHECK_ARGUMENT_TYPE_ALWAYS(I2C, __constructor, 1, number);
+
+    int sda = jerry_get_number_value(args[0]);
+    int scl = jerry_get_number_value(args[1]);
+
+    uintptr_t native_handle = (uintptr_t)new I2C((PinName)sda, (PinName)scl);
+
+    jerry_value_t js_object = jerry_create_object();
+    jerry_set_object_native_handle(js_object, native_handle, NAME_FOR_CLASS_NATIVE_DESTRUCTOR(I2C));
+
+    ATTACH_CLASS_FUNCTION(js_object, I2C, frequency);
+    ATTACH_CLASS_FUNCTION(js_object, I2C, read);
+    ATTACH_CLASS_FUNCTION(js_object, I2C, write);
+    ATTACH_CLASS_FUNCTION(js_object, I2C, start);
+    ATTACH_CLASS_FUNCTION(js_object, I2C, stop);
+
+    return js_object;
+}
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/InterruptIn-js.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/InterruptIn-js.cpp
new file mode 100644 (file)
index 0000000..d4b6d65
--- /dev/null
@@ -0,0 +1,220 @@
+/* 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.
+ */
+#include "jerryscript-mbed-util/logging.h"
+#include "jerryscript-mbed-event-loop/EventLoop.h"
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+#include "mbed.h"
+
+/**
+ * InterruptIn#rise (native JavaScript method)
+ *
+ * Register a rise callback for an InterruptIn
+ *
+ * @param cb Callback function, or null to detach previously attached callback.
+ */
+DECLARE_CLASS_FUNCTION(InterruptIn, rise) {
+    CHECK_ARGUMENT_COUNT(InterruptIn, rise, (args_count == 1));
+
+    // Detach the rise callback when InterruptIn::rise(null) is called
+    if (jerry_value_is_null(args[0])) {
+        uintptr_t native_handle;
+        jerry_get_object_native_handle(this_obj, &native_handle);
+
+        InterruptIn *this_interruptin = (InterruptIn*) native_handle;
+
+        jerry_value_t property_name = jerry_create_string((const jerry_char_t*)"cb_rise");
+        jerry_value_t cb_func = jerry_get_property(this_obj, property_name);
+        jerry_release_value(property_name);
+
+        // Only drop the callback if it exists
+        if (jerry_value_is_function(cb_func)) {
+            // Ensure that the EventLoop frees memory used by the callback.
+            mbed::js::EventLoop::getInstance().dropCallback(cb_func);
+        }
+        jerry_release_value(cb_func);
+
+        this_interruptin->rise(0);
+
+        return jerry_create_undefined();
+    }
+
+    // Assuming we actually have a callback now...
+    CHECK_ARGUMENT_TYPE_ALWAYS(InterruptIn, rise, 0, function);
+
+    uintptr_t native_handle;
+    jerry_get_object_native_handle(this_obj, &native_handle);
+    InterruptIn *this_interruptin = reinterpret_cast<InterruptIn*>(native_handle);
+
+    jerry_value_t f = args[0];
+
+    // Pass the function to EventLoop.
+    mbed::Callback<void()> cb = mbed::js::EventLoop::getInstance().wrapFunction(f);
+    this_interruptin->rise(cb);
+
+    // Keep track of our callback internally.
+    jerry_value_t property_name = jerry_create_string((const jerry_char_t*)"cb_rise");
+    jerry_set_property(this_obj, property_name, f);
+    jerry_release_value(property_name);
+
+    return jerry_create_undefined();
+}
+
+/**
+ * InterruptIn#fall (native JavaScript method)
+ *
+ * Register a fall callback for an InterruptIn
+ *
+ * @param cb Callback function, or null to detach previously attached callback.
+ */
+DECLARE_CLASS_FUNCTION(InterruptIn, fall) {
+    CHECK_ARGUMENT_COUNT(InterruptIn, fall, (args_count == 1));
+
+    // Detach the fall callback when InterruptIn::fall(null) is called
+    if (jerry_value_is_null(args[0])) {
+        uintptr_t native_handle;
+        jerry_get_object_native_handle(this_obj, &native_handle);
+
+        InterruptIn *this_interruptin = (InterruptIn*) native_handle;
+
+        jerry_value_t property_name = jerry_create_string((const jerry_char_t*)"cb_fall");
+        jerry_value_t cb_func = jerry_get_property(this_obj, property_name);
+        jerry_release_value(property_name);
+
+        // Only drop the callback if it exists
+        if (jerry_value_is_function(cb_func)) {
+            // Ensure that the EventLoop frees memory used by the callback.
+            mbed::js::EventLoop::getInstance().dropCallback(cb_func);
+        }
+        jerry_release_value(cb_func);
+
+        this_interruptin->fall(0);
+
+        return jerry_create_undefined();
+    }
+
+    // Assuming we actually have a callback now...
+    CHECK_ARGUMENT_TYPE_ALWAYS(InterruptIn, fall, 0, function);
+
+    uintptr_t native_handle;
+    jerry_get_object_native_handle(this_obj, &native_handle);
+    InterruptIn *this_interruptin = reinterpret_cast<InterruptIn*>(native_handle);
+
+    jerry_value_t f = args[0];
+
+    // Pass the function to EventLoop.
+    mbed::Callback<void()> cb = mbed::js::EventLoop::getInstance().wrapFunction(f);
+    this_interruptin->fall(cb);
+
+    // Keep track of our callback internally.
+    jerry_value_t property_name = jerry_create_string((const jerry_char_t*)"cb_fall");
+    jerry_set_property(this_obj, property_name, f);
+    jerry_release_value(property_name);
+
+    return jerry_create_undefined();
+}
+
+/**
+ * InterruptIn#mode (native JavaScript method)
+ *
+ * Set the mode of the InterruptIn pin.
+ *
+ * @param mode PullUp, PullDown, PullNone
+ */
+DECLARE_CLASS_FUNCTION(InterruptIn, mode) {
+    CHECK_ARGUMENT_COUNT(InterruptIn, mode, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(InterruptIn, mode, 0, number);
+
+    uintptr_t native_handle;
+    jerry_get_object_native_handle(this_obj, &native_handle);
+
+    InterruptIn *native_ptr = reinterpret_cast<InterruptIn*>(native_handle);
+
+    int pull = jerry_get_number_value(args[0]);
+    native_ptr->mode((PinMode)pull);
+
+    return jerry_create_undefined();
+}
+
+/**
+ * InterruptIn#disable_irq (native JavaScript method)
+ *
+ * Disable IRQ. See InterruptIn.h in mbed-os sources for more details.
+ */
+DECLARE_CLASS_FUNCTION(InterruptIn, disable_irq) {
+    CHECK_ARGUMENT_COUNT(InterruptIn, disable_irq, (args_count == 0));
+
+    uintptr_t native_handle;
+    jerry_get_object_native_handle(this_obj, &native_handle);
+    InterruptIn *native_ptr = reinterpret_cast<InterruptIn*>(native_handle);
+
+    native_ptr->disable_irq();
+    return jerry_create_undefined();
+}
+
+/**
+ * InterruptIn#enable_irq (native JavaScript method)
+ *
+ * Enable IRQ. See InterruptIn.h in mbed-os sources for more details.
+ */
+DECLARE_CLASS_FUNCTION(InterruptIn, enable_irq) {
+    CHECK_ARGUMENT_COUNT(InterruptIn, enable_irq, (args_count == 0));
+
+    uintptr_t native_handle;
+    jerry_get_object_native_handle(this_obj, &native_handle);
+    InterruptIn *native_ptr = reinterpret_cast<InterruptIn*>(native_handle);
+
+    native_ptr->enable_irq();
+    return jerry_create_undefined();
+}
+
+/**
+ * InterruptIn#destructor
+ *
+ * Called if/when the InterruptIn object is GC'ed.
+ */
+void NAME_FOR_CLASS_NATIVE_DESTRUCTOR(InterruptIn) (uintptr_t handle) {
+    InterruptIn *native_ptr = reinterpret_cast<InterruptIn*>(handle);
+
+    native_ptr->rise(0);
+    native_ptr->fall(0);
+    delete native_ptr;
+}
+
+/**
+ * InterruptIn (native JavaScript constructor)
+ *
+ * @param pin PinName
+ *
+ * @returns JavaScript object wrapping InterruptIn native object
+ */
+DECLARE_CLASS_CONSTRUCTOR(InterruptIn) {
+    CHECK_ARGUMENT_COUNT(InterruptIn, __constructor, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(InterruptIn, __constructor, 0, number);
+    int pin = jerry_get_number_value(args[0]);
+
+    uintptr_t native_handle = (uintptr_t)new InterruptIn((PinName)pin);
+    jerry_value_t js_object = jerry_create_object();
+
+    jerry_set_object_native_handle(js_object, native_handle, NAME_FOR_CLASS_NATIVE_DESTRUCTOR(InterruptIn));
+
+    ATTACH_CLASS_FUNCTION(js_object, InterruptIn, rise);
+    ATTACH_CLASS_FUNCTION(js_object, InterruptIn, fall);
+    ATTACH_CLASS_FUNCTION(js_object, InterruptIn, mode);
+    ATTACH_CLASS_FUNCTION(js_object, InterruptIn, enable_irq);
+    ATTACH_CLASS_FUNCTION(js_object, InterruptIn, disable_irq);
+
+    return js_object;
+}
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/PwmOut-js.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/PwmOut-js.cpp
new file mode 100644 (file)
index 0000000..4e1af79
--- /dev/null
@@ -0,0 +1,242 @@
+/* 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.
+ */
+#include "jerryscript-mbed-util/logging.h"
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+#include "mbed.h"
+
+/**
+ * PwmOut#write (native JavaScript method)
+ *
+ * Set the ouput duty-cycle, specified as a percentage (float)
+ *
+ * @param value A floating-point value representing the output duty-cycle,
+ *    specified as a percentage. The value should lie between
+ *    0.0 (representing on 0%) and 1.0 (representing on 100%).
+ *    Values outside this range will be saturated to 0.0f or 1.0f
+ * @returns undefined
+ */
+DECLARE_CLASS_FUNCTION(PwmOut, write) {
+    CHECK_ARGUMENT_COUNT(PwmOut, write, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(PwmOut, write, 0, number);
+
+    // Extract native PwmOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    PwmOut* native_ptr = reinterpret_cast<PwmOut*>(ptr_val);
+
+    double arg0 = jerry_get_number_value(args[0]);
+    native_ptr->write(static_cast<float>(arg0));
+
+    return jerry_create_undefined();
+}
+
+/**
+ * PwmOut#read (native JavaScript method)
+ *
+ * Return the current output duty-cycle setting, measured as a percentage (float)
+ *
+ * @returns
+ *    A floating-point value representing the current duty-cycle being output on the pin,
+ *    measured as a percentage. The returned value will lie between
+ *    0.0 (representing on 0%) and 1.0 (representing on 100%).
+ *
+ * @note
+ * This value may not match exactly the value set by a previous <write>.
+ */
+DECLARE_CLASS_FUNCTION(PwmOut, read) {
+    CHECK_ARGUMENT_COUNT(PwmOut, read, (args_count == 0));
+
+    // Extract native PwmOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    PwmOut* native_ptr = reinterpret_cast<PwmOut*>(ptr_val);
+
+    float result = native_ptr->read();
+    return jerry_create_number(result);
+}
+
+/**
+ * PwmOut#period (native JavaScript method)
+ *
+ * Set the PWM period, specified in seconds (float), keeping the duty cycle the same.
+ *
+ * @note
+ *   The resolution is currently in microseconds; periods smaller than this
+ *   will be set to zero.
+ */
+DECLARE_CLASS_FUNCTION(PwmOut, period) {
+    CHECK_ARGUMENT_COUNT(PwmOut, period, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(PwmOut, period, 0, number);
+
+    // Extract native PwmOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    PwmOut* native_ptr = reinterpret_cast<PwmOut*>(ptr_val);
+
+    double arg0 = jerry_get_number_value(args[0]);
+    native_ptr->period(static_cast<float>(arg0));
+
+    return jerry_create_undefined();
+}
+
+/**
+ * PwmOut#period_ms (native JavaScript method)
+ *
+ * Set the PWM period, specified in milli-seconds (int), keeping the duty cycle the same.
+ */
+DECLARE_CLASS_FUNCTION(PwmOut, period_ms) {
+    CHECK_ARGUMENT_COUNT(PwmOut, period_ms, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(PwmOut, period_ms, 0, number);
+
+    // Extract native PwmOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    PwmOut* native_ptr = reinterpret_cast<PwmOut*>(ptr_val);
+
+    double arg0 = jerry_get_number_value(args[0]);
+    native_ptr->period_ms(static_cast<int>(arg0));
+
+    return jerry_create_undefined();
+}
+
+/**
+ * PwmOut#period_us (native JavaScript method)
+ *
+ * Set the PWM period, specified in micro-seconds (int), keeping the duty cycle the same.
+ */
+DECLARE_CLASS_FUNCTION(PwmOut, period_us) {
+    CHECK_ARGUMENT_COUNT(PwmOut, period_us, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(PwmOut, period_us, 0, number);
+
+    // Extract native PwmOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    PwmOut* native_ptr = reinterpret_cast<PwmOut*>(ptr_val);
+
+    double arg0 = jerry_get_number_value(args[0]);
+    native_ptr->period_us(static_cast<int>(arg0));
+
+    return jerry_create_undefined();
+}
+
+/**
+ * PwmOut#pulsewidth (native JavaScript method)
+ *
+ * Set the PWM pulsewidth, specified in seconds (float), keeping the period the same.
+ */
+DECLARE_CLASS_FUNCTION(PwmOut, pulsewidth) {
+    CHECK_ARGUMENT_COUNT(PwmOut, pulsewidth, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(PwmOut, pulsewidth, 0, number);
+
+    // Extract native PwmOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    PwmOut* native_ptr = reinterpret_cast<PwmOut*>(ptr_val);
+
+    double arg0 = jerry_get_number_value(args[0]);
+    native_ptr->pulsewidth(static_cast<float>(arg0));
+
+    return jerry_create_undefined();
+}
+
+/**
+ * PwmOut#pulsewidth_ms (native JavaScript method)
+ *
+ * Set the PWM pulsewidth, specified in milli-seconds (int), keeping the period the same.
+ */
+DECLARE_CLASS_FUNCTION(PwmOut, pulsewidth_ms) {
+    CHECK_ARGUMENT_COUNT(PwmOut, pulsewidth_ms, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(PwmOut, pulsewidth_ms, 0, number);
+
+    // Extract native PwmOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    PwmOut* native_ptr = reinterpret_cast<PwmOut*>(ptr_val);
+
+    double arg0 = jerry_get_number_value(args[0]);
+    native_ptr->pulsewidth_ms(static_cast<int>(arg0));
+
+    return jerry_create_undefined();
+}
+
+/**
+ * PwmOut#pulsewidth_us (native JavaScript method)
+ *
+ * Set the PWM pulsewidth, specified in micro-seconds (int), keeping the period the same.
+ */
+DECLARE_CLASS_FUNCTION(PwmOut, pulsewidth_us) {
+    CHECK_ARGUMENT_COUNT(PwmOut, pulsewidth_us, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(PwmOut, pulsewidth_us, 0, number);
+
+    // Extract native PwmOut pointer
+    uintptr_t ptr_val;
+    jerry_get_object_native_handle(this_obj, &ptr_val);
+
+    PwmOut* native_ptr = reinterpret_cast<PwmOut*>(ptr_val);
+
+    double arg0 = jerry_get_number_value(args[0]);
+    native_ptr->pulsewidth_us(static_cast<int>(arg0));
+
+    return jerry_create_undefined();
+}
+
+/**
+ * PwmOut#destructor
+ *
+ * Called if/when the PwmOut is GC'ed.
+ */
+void NAME_FOR_CLASS_NATIVE_DESTRUCTOR(PwmOut)(const uintptr_t native_handle) {
+    delete reinterpret_cast<PwmOut*>(native_handle);
+}
+
+/**
+ * PwmOut (native JavaScript constructor)
+ *
+ * @param pin_name mbed pin to connect the PwmOut to.
+ * @returns a JavaScript object representing a PwmOut.
+ */
+DECLARE_CLASS_CONSTRUCTOR(PwmOut) {
+    CHECK_ARGUMENT_COUNT(PwmOut, __constructor, args_count == 1);
+    CHECK_ARGUMENT_TYPE_ALWAYS(PwmOut, __constructor, 0, number);
+
+    PinName pin_name = PinName(jerry_get_number_value(args[0]));
+
+    // Create the native object
+    uintptr_t native_ptr = (uintptr_t) new PwmOut(pin_name);
+
+    // create the jerryscript object
+    jerry_value_t js_object = jerry_create_object();
+    jerry_set_object_native_handle(js_object, native_ptr, NAME_FOR_CLASS_NATIVE_DESTRUCTOR(PwmOut));
+
+    // attach methods
+    ATTACH_CLASS_FUNCTION(js_object, PwmOut, write);
+    ATTACH_CLASS_FUNCTION(js_object, PwmOut, read);
+    ATTACH_CLASS_FUNCTION(js_object, PwmOut, period);
+    ATTACH_CLASS_FUNCTION(js_object, PwmOut, period_ms);
+    ATTACH_CLASS_FUNCTION(js_object, PwmOut, period_us);
+    ATTACH_CLASS_FUNCTION(js_object, PwmOut, pulsewidth);
+    ATTACH_CLASS_FUNCTION(js_object, PwmOut, pulsewidth_ms);
+    ATTACH_CLASS_FUNCTION(js_object, PwmOut, pulsewidth_us);
+
+    return js_object;
+}
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/setInterval-js.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/setInterval-js.cpp
new file mode 100644 (file)
index 0000000..7c3beeb
--- /dev/null
@@ -0,0 +1,55 @@
+/* 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.
+ */
+#include "jerryscript-mbed-drivers/setInterval-js.h"
+#include "jerryscript-mbed-event-loop/EventLoop.h"
+
+/**
+ * setInterval (native JavaScript function)
+ *
+ * Call a JavaScript function at fixed intervals.
+ *
+ * @param function Function to call
+ * @param interval Time between function calls, in ms.
+ */
+DECLARE_GLOBAL_FUNCTION(setInterval) {
+    CHECK_ARGUMENT_COUNT(global, setInterval, (args_count == 2));
+    CHECK_ARGUMENT_TYPE_ALWAYS(global, setInterval, 0, function);
+    CHECK_ARGUMENT_TYPE_ALWAYS(global, setInterval, 1, number);
+
+    jerry_acquire_value(args[0]);
+    int interval = int(jerry_get_number_value(args[1]));
+
+    int id = mbed::js::EventLoop::getInstance().getQueue().call_every(interval, jerry_call_function, args[0], jerry_create_null(), (jerry_value_t*)NULL, 0);
+
+    return jerry_create_number(id);
+}
+
+/**
+ * clearInterval (native JavaScript function)
+ *
+ * Cancel an event that was previously scheduled via setInterval.
+ *
+ * @param id ID of the timeout event, returned by setInterval.
+ */
+DECLARE_GLOBAL_FUNCTION(clearInterval) {
+    CHECK_ARGUMENT_COUNT(global, clearInterval, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(global, clearInterval, 0, number);
+
+    int id = int(jerry_get_number_value(args[0]));
+
+    mbed::js::EventLoop::getInstance().getQueue().cancel(id);
+
+    return jerry_create_undefined();
+}
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/setTimeout-js.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/setTimeout-js.cpp
new file mode 100644 (file)
index 0000000..ae47cca
--- /dev/null
@@ -0,0 +1,55 @@
+/* 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.
+ */
+#include "jerryscript-mbed-drivers/setTimeout-js.h"
+#include "jerryscript-mbed-event-loop/EventLoop.h"
+
+/**
+ * setTimeout (native JavaScript function)
+ *
+ * Call a JavaScript function once, after a fixed time period.
+ *
+ * @param function Function to call
+ * @param wait_time Time before function is called, in ms.
+ */
+DECLARE_GLOBAL_FUNCTION(setTimeout) {
+    CHECK_ARGUMENT_COUNT(global, setTimeout, (args_count == 2));
+    CHECK_ARGUMENT_TYPE_ALWAYS(global, setTimeout, 0, function);
+    CHECK_ARGUMENT_TYPE_ALWAYS(global, setTimeout, 1, number);
+
+    jerry_acquire_value(args[0]);
+    int interval = int(jerry_get_number_value(args[1]));
+
+    int id = mbed::js::EventLoop::getInstance().getQueue().call_in(interval, jerry_call_function, args[0], jerry_create_null(), (jerry_value_t*)NULL, 0);
+
+    return jerry_create_number(id);
+}
+
+/**
+ * clearTimeout (native JavaScript function)
+ *
+ * Cancel an event that was previously scheduled via setTimeout.
+ *
+ * @param id ID of the timeout event, returned by setTimeout.
+ */
+DECLARE_GLOBAL_FUNCTION(clearTimeout) {
+    CHECK_ARGUMENT_COUNT(global, clearTimeout, (args_count == 1));
+    CHECK_ARGUMENT_TYPE_ALWAYS(global, clearTimeout, 0, number);
+
+    int id = int(jerry_get_number_value(args[0]));
+
+    mbed::js::EventLoop::getInstance().getQueue().cancel(id);
+
+    return jerry_create_undefined();
+}
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-event-loop/BoundCallback.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-event-loop/BoundCallback.h
new file mode 100644 (file)
index 0000000..f06960e
--- /dev/null
@@ -0,0 +1,114 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_EVENT_LOOP_BOUND_CALLBACK_H
+#define _JERRYSCRIPT_MBED_EVENT_LOOP_BOUND_CALLBACK_H
+
+#include "Callback.h"
+
+namespace mbed {
+namespace js {
+
+template<typename T>
+class BoundCallback;
+
+template<typename R, typename A0>
+class BoundCallback<R(A0)> {
+ public:
+    BoundCallback(Callback<R(A0)> cb, A0 a0) : a0(a0), cb(cb) { }
+
+    void call() {
+        cb(a0);
+    }
+
+    operator Callback<void()>() {
+        Callback<void()> cb(this, &BoundCallback::call);
+        return cb;
+    }
+
+ private:
+    A0 a0;
+    Callback<R(A0)> cb;
+};
+
+template<typename R, typename A0, typename A1>
+class BoundCallback<R(A0, A1)> {
+ public:
+    BoundCallback(Callback<R(A0, A1)> cb, A0 a0, A1 a1) : a0(a0), a1(a1), cb(cb) { }
+
+    void call() {
+        cb(a0, a1);
+    }
+
+    operator Callback<void()>() {
+        Callback<void()> cb(this, &BoundCallback::call);
+        return cb;
+    }
+
+ private:
+    A0 a0;
+    A0 a1;
+
+    Callback<R(A0, A1)> cb;
+};
+
+template<typename R, typename A0, typename A1, typename A2>
+class BoundCallback<R(A0, A1, A2)> {
+ public:
+    BoundCallback(Callback<R(A0, A1, A2)> cb, A0 a0, A1 a1, A2 a2) : a0(a0), a1(a1), a2(a2), cb(cb) { }
+
+    void call() {
+        cb(a0, a1, a2);
+    }
+
+    operator Callback<void()>() {
+        Callback<void()> cb(this, &BoundCallback::call);
+        return cb;
+    }
+
+ private:
+    A0 a0;
+    A1 a1;
+    A2 a2;
+
+    Callback<R(A0, A1, A2)> cb;
+};
+
+template<typename R, typename A0, typename A1, typename A2, typename A3>
+class BoundCallback<R(A0, A1, A2, A3)> {
+ public:
+    BoundCallback(Callback<R(A0, A1, A2, A3)> cb, A0 a0, A1 a1, A2 a2, A3 a3) : a0(a0), a1(a1), a2(a2), a3(a3), cb(cb) { }
+
+    void call() {
+        cb(a0, a1, a2, a3);
+    }
+
+    operator Callback<void()>() {
+        Callback<void()> cb(this, &BoundCallback::call);
+        return cb;
+    }
+
+ private:
+    A0 a0;
+    A1 a1;
+    A2 a2;
+    A3 a3;
+
+    Callback<R(A0, A1, A2, A3)> cb;
+};
+
+}  // namespace js
+}  // namespace mbed
+
+#endif  // _JERRYSCRIPT_MBED_EVENT_LOOP_BOUND_CALLBACK_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-event-loop/EventLoop.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-event-loop/EventLoop.h
new file mode 100644 (file)
index 0000000..99d8552
--- /dev/null
@@ -0,0 +1,99 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_EVENT_LOOP_EVENT_LOOP_H
+#define _JERRYSCRIPT_MBED_EVENT_LOOP_EVENT_LOOP_H
+
+#include <vector>
+
+#include "jerry-core/include/jerryscript.h"
+
+#include "Callback.h"
+#include "mbed_assert.h"
+
+#include "events/EventQueue.h"
+
+#include "jerryscript-mbed-util/logging.h"
+#include "jerryscript-mbed-event-loop/BoundCallback.h"
+
+extern "C" void exit(int return_code);
+
+namespace mbed {
+namespace js {
+
+static const uint32_t EVENT_INTERVAL_MS = 1;
+
+class EventLoop {
+ private:
+    static EventLoop instance;
+
+ public:
+    static EventLoop& getInstance() {
+        return instance;
+    }
+
+    void go() {
+        while (true) {
+            queue.dispatch();
+        }
+    }
+
+    Callback<void()> wrapFunction(jerry_value_t f) {
+        MBED_ASSERT(jerry_value_is_function(f));
+
+        // we need to return a callback that'll schedule this
+        Callback<void(uint32_t)> cb_raw(this, &EventLoop::callback);
+        BoundCallback<void(uint32_t)> *cb = new BoundCallback<void(uint32_t)>(cb_raw, f);
+
+        bound_callbacks.push_back(std::make_pair(f, cb));
+
+        return *cb;
+    }
+
+    void dropCallback(jerry_value_t f) {
+        for (std::vector<std::pair<jerry_value_t, BoundCallback<void(uint32_t)>*> >::iterator it = bound_callbacks.begin(); it != bound_callbacks.end(); it++) {
+            std::pair<jerry_value_t, BoundCallback<void(uint32_t)>*> element = *it;
+
+            if (element.first == f) {
+                delete element.second;
+                break;
+            }
+        }
+    }
+
+    void callback(jerry_value_t f) {
+        queue.call(jerry_call_function, f, jerry_create_null(), (const jerry_value_t*)NULL, 0);
+    }
+
+    void nativeCallback(Callback<void()> cb) {
+        queue.call(cb);
+    }
+
+    events::EventQueue& getQueue() {
+        return queue;
+    }
+
+ private:
+    EventLoop() {}
+
+    std::vector<std::pair<jerry_value_t, BoundCallback<void(uint32_t)>*> > bound_callbacks;
+    events::EventQueue queue;
+};
+
+void event_loop();
+
+}  // namespace js
+}  // namespace mbed
+
+#endif  // _JERRYSCRIPT_MBED_EVENT_LOOP_EVENT_LOOP_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-event-loop/source/EventLoop.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-event-loop/source/EventLoop.cpp
new file mode 100644 (file)
index 0000000..4bc4fa4
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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.
+ */
+#include "jerryscript-mbed-event-loop/EventLoop.h"
+
+namespace mbed {
+namespace js {
+
+EventLoop EventLoop::instance;
+
+void event_loop() {
+    EventLoop::getInstance().go();
+}
+
+}  // namespace js
+}  // namespace mbed
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/launcher.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/launcher.h
new file mode 100644 (file)
index 0000000..ea49bae
--- /dev/null
@@ -0,0 +1,21 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_LAUNCHER_LAUNCHER_H
+#define _JERRYSCRIPT_MBED_LAUNCHER_LAUNCHER_H
+
+void jsmbed_js_launch(void);
+void jsmbed_js_exit(void);
+
+#endif  // _JERRYSCRIPT_MBED_LAUNCHER_LAUNCHER_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/setup.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/setup.h
new file mode 100644 (file)
index 0000000..f87a628
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_LAUNCHER_SETUP_H
+#define _JERRYSCRIPT_MBED_LAUNCHER_SETUP_H
+
+#include "jerry-core/include/jerryscript.h"
+
+void jsmbed_js_load_magic_strings(void);
+
+#endif  // _JERRYSCRIPT_MBED_LAUNCHER_SETUP_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/source/launcher.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/source/launcher.cpp
new file mode 100644 (file)
index 0000000..4ecfbac
--- /dev/null
@@ -0,0 +1,90 @@
+/* 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.
+ */
+#include "mbed.h"
+#include "rtos.h"
+
+#include "jerry-core/include/jerryscript.h"
+
+#include "jerryscript-mbed-event-loop/EventLoop.h"
+
+#include "jerryscript-mbed-util/js_source.h"
+#include "jerryscript-mbed-library-registry/registry.h"
+
+#include "jerryscript-mbed-launcher/launcher.h"
+#include "jerryscript-mbed-launcher/setup.h"
+
+#include "jerry-targetjs.h"
+
+DECLARE_JS_CODES;
+
+/**
+ * load_javascript
+ *
+ * Parse and run javascript files specified in jerry-targetjs.h
+ */
+static int load_javascript() {
+    for (int src = 0; js_codes[src].source; src++) {
+        LOG_PRINT("running js file %s\r\n", js_codes[src].name);
+
+        const jerry_char_t* code = reinterpret_cast<const jerry_char_t*>(js_codes[src].source);
+        const size_t length = js_codes[src].length;
+
+        jerry_value_t parsed_code = jerry_parse(code, length, false);
+
+        if (jerry_value_has_error_flag(parsed_code)) {
+            LOG_PRINT_ALWAYS("jerry_parse failed [%s]\r\n", js_codes[src].name);
+            jsmbed_js_exit();
+            return -1;
+        }
+
+        jerry_value_t returned_value = jerry_run(parsed_code);
+
+        if (jerry_value_has_error_flag(returned_value)) {
+            LOG_PRINT_ALWAYS("jerry_run failed [%s]\r\n", js_codes[src].name);
+            jsmbed_js_exit();
+            return -1;
+        }
+
+        jerry_release_value(parsed_code);
+        jerry_release_value(returned_value);
+    }
+
+    return 0;
+}
+
+int jsmbed_js_init() {
+    jerry_init_flag_t flags = JERRY_INIT_EMPTY;
+    jerry_init(flags);
+
+    jsmbed_js_load_magic_strings();
+    mbed::js::LibraryRegistry::getInstance().register_all();
+
+    return 0;
+}
+
+void jsmbed_js_exit() {
+    jerry_cleanup();
+}
+
+void jsmbed_js_launch() {
+    jsmbed_js_init();
+
+    puts("   JerryScript in mbed\r\n");
+    puts("   build date:  " __DATE__ " \r\n");
+
+    if (load_javascript() == 0) {
+        mbed::js::event_loop();
+    }
+}
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/source/setup.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-launcher/source/setup.cpp
new file mode 100644 (file)
index 0000000..376e086
--- /dev/null
@@ -0,0 +1,49 @@
+/* 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.
+ */
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "jerryscript-mbed-launcher/setup.h"
+#include "jerryscript-mbed-util/logging.h"
+
+extern uint32_t jsmbed_js_magic_string_count;
+extern uint32_t jsmbed_js_magic_string_values[];
+
+extern const jerry_char_ptr_t jsmbed_js_magic_strings[];
+extern const jerry_length_t jsmbed_js_magic_string_lengths[];
+
+void jsmbed_js_load_magic_strings() {
+    if (jsmbed_js_magic_string_count == 0) {
+        return;
+    }
+
+    jerry_register_magic_strings(jsmbed_js_magic_strings,
+                                 jsmbed_js_magic_string_count,
+                                 jsmbed_js_magic_string_lengths);
+
+    jerry_value_t global = jerry_get_global_object();
+
+    for (unsigned int idx = 0; idx < jsmbed_js_magic_string_count; idx++) {
+        jerry_value_t constant_value = jerry_create_number(jsmbed_js_magic_string_values[idx]);
+        jerry_value_t magic_string = jerry_create_string(jsmbed_js_magic_strings[idx]);
+
+        jerry_set_property(global, magic_string, constant_value);
+
+        jerry_release_value(constant_value);
+        jerry_release_value(magic_string);
+    }
+
+    jerry_release_value(global);
+}
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/registry.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/registry.h
new file mode 100644 (file)
index 0000000..01a986c
--- /dev/null
@@ -0,0 +1,57 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_LIBRARY_REGISTRY_REGISTRY_H
+#define _JERRYSCRIPT_MBED_LIBRARY_REGISTRY_REGISTRY_H
+
+#include <vector>
+#include "stdint.h"
+
+#define JERRY_USE_MBED_LIBRARY(NAME) \
+    mbed::js::LibraryRegistry::getInstance().add(jsmbed_wrap_registry_entry__ ## NAME)
+
+namespace mbed {
+namespace js {
+
+typedef void (*library_registration_function_t)(void);
+
+class LibraryRegistry {
+ private:
+    static LibraryRegistry instance;
+
+ public:
+    static LibraryRegistry& getInstance() {
+        return instance;
+    }
+
+    void add(library_registration_function_t lib_func) {
+        funcs.push_back(lib_func);
+    }
+
+    void register_all() {
+        for (std::size_t i = 0; i < funcs.size(); i++) {
+            funcs[i]();
+        }
+    }
+
+ private:
+    LibraryRegistry() {}
+
+    std::vector<library_registration_function_t> funcs;
+};
+
+}  // namespace js
+}  // namespace mbed
+
+#endif  // _JERRYSCRIPT_MBED_LIBRARY_REGISTRY_REGISTRY_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/source/registry.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/source/registry.cpp
new file mode 100644 (file)
index 0000000..ad9198e
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+#include "jerryscript-mbed-library-registry/registry.h"
+
+mbed::js::LibraryRegistry mbed::js::LibraryRegistry::instance;
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/source/wrap_tools.cpp b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/source/wrap_tools.cpp
new file mode 100644 (file)
index 0000000..bb600a7
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ */
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "jerryscript-mbed-library-registry/wrap_tools.h"
+
+bool jsmbed_wrap_register_global_function(const char* name, jerry_external_handler_t handler) {
+    jerry_value_t global_object_val = jerry_get_global_object();
+    jerry_value_t reg_function = jerry_create_external_function(handler);
+
+    bool is_ok = true;
+
+    if (!(jerry_value_is_function(reg_function)
+        && jerry_value_is_constructor(reg_function))) {
+        is_ok = false;
+        LOG_PRINT_ALWAYS("Error: jerry_create_external_function failed!\r\n");
+        jerry_release_value(global_object_val);
+        jerry_release_value(reg_function);
+        return is_ok;
+    }
+
+    if (jerry_value_has_error_flag(reg_function)) {
+        is_ok = false;
+        LOG_PRINT_ALWAYS("Error: jerry_create_external_function has error flag! \r\n");
+        jerry_release_value(global_object_val);
+        jerry_release_value(reg_function);
+        return is_ok;
+    }
+
+    jerry_value_t jerry_name = jerry_create_string((jerry_char_t *) name);
+
+    jerry_value_t set_result = jerry_set_property(global_object_val, jerry_name, reg_function);
+
+
+    if (jerry_value_has_error_flag(set_result)) {
+        is_ok = false;
+        LOG_PRINT_ALWAYS("Error: jerry_create_external_function failed: [%s]\r\n", name);
+    }
+
+    jerry_release_value(jerry_name);
+    jerry_release_value(global_object_val);
+    jerry_release_value(reg_function);
+    jerry_release_value(set_result);
+
+    return is_ok;
+}
+
+bool jsmbed_wrap_register_class_constructor(const char* name, jerry_external_handler_t handler) {
+    // Register class constructor as a global function
+    return jsmbed_wrap_register_global_function(name, handler);
+}
+
+bool jsmbed_wrap_register_class_function(jerry_value_t this_obj, const char* name, jerry_external_handler_t handler) {
+    jerry_value_t property_name = jerry_create_string(reinterpret_cast<const jerry_char_t *>(name));
+    jerry_value_t handler_obj = jerry_create_external_function(handler);
+
+    jerry_set_property(this_obj, property_name, handler_obj);
+
+    jerry_release_value(handler_obj);
+    jerry_release_value(property_name);
+
+    // TODO: check for errors, and return false in the case of errors
+    return true;
+}
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/wrap_tools.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-library-registry/wrap_tools.h
new file mode 100644 (file)
index 0000000..7a844b7
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_LIBRARY_REGISTRY_WRAP_TOOLS_H
+#define _JERRYSCRIPT_MBED_LIBRARY_REGISTRY_WRAP_TOOLS_H
+
+#include <stdlib.h>
+
+#include "jerry-core/include/jerryscript.h"
+
+#include "jerryscript-mbed-util/logging.h"
+#include "jerryscript-mbed-util/wrappers.h"
+
+
+//
+// Functions used by the wrapper registration API.
+//
+
+bool
+jsmbed_wrap_register_global_function (const char* name,
+                          jerry_external_handler_t handler);
+
+bool
+jsmbed_wrap_register_class_constructor (const char* name,
+                            jerry_external_handler_t handler);
+
+bool
+jsmbed_wrap_register_class_function (jerry_value_t this_obj_p,
+                         const char* name,
+                         jerry_external_handler_t handler);
+
+#endif  // _JERRYSCRIPT_MBED_LIBRARY_REGISTRY_WRAP_TOOLS_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-util/js_source.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-util/js_source.h
new file mode 100644 (file)
index 0000000..e7ada23
--- /dev/null
@@ -0,0 +1,24 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_UTIL_JS_SOURCE_H
+#define _JERRYSCRIPT_MBED_UTIL_JS_SOURCE_H
+
+struct jsmbed_js_source_t {
+    const char* name;
+    const char* source;
+    const int length;
+};
+
+#endif  // _JERRYSCRIPT_MBED_UTIL_JS_SOURCE_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-util/logging.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-util/logging.h
new file mode 100644 (file)
index 0000000..12803e3
--- /dev/null
@@ -0,0 +1,28 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_UTIL_LOGGING_H
+#define _JERRYSCRIPT_MBED_UTIL_LOGGING_H
+
+#include "mbed.h"
+
+#ifdef DEBUG_WRAPPER
+#define LOG_PRINT(...) printf(__VA_ARGS__)
+#else
+#define LOG_PRINT(...) while(0) { }
+#endif
+
+#define LOG_PRINT_ALWAYS(...) printf(__VA_ARGS__)
+
+#endif  // _JERRYSCRIPT_MBED_UTIL_LOGGING_H
diff --git a/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-util/wrappers.h b/deps/jerry/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-util/wrappers.h
new file mode 100644 (file)
index 0000000..19c751b
--- /dev/null
@@ -0,0 +1,96 @@
+/* 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.
+ */
+#ifndef _JERRYSCRIPT_MBED_UTIL_WRAPPERS_H
+#define _JERRYSCRIPT_MBED_UTIL_WRAPPERS_H
+
+/*
+ * Used in header/source files for wrappers, to declare the signature of the
+ * registration function.
+ */
+#define DECLARE_JS_WRAPPER_REGISTRATION(NAME) \
+  void jsmbed_wrap_registry_entry__ ## NAME (void)
+
+//
+// 2. Wrapper function declaration/use macros
+//
+
+// Global functions
+#define DECLARE_GLOBAL_FUNCTION(NAME) \
+jerry_value_t \
+NAME_FOR_GLOBAL_FUNCTION(NAME) (const jerry_value_t function_obj_p, \
+                  const jerry_value_t  this_obj, \
+                  const jerry_value_t    args[], \
+                  const jerry_length_t   args_count)
+
+#define REGISTER_GLOBAL_FUNCTION(NAME) \
+  jsmbed_wrap_register_global_function ( # NAME, NAME_FOR_GLOBAL_FUNCTION(NAME) )
+
+#define REGISTER_GLOBAL_FUNCTION_WITH_HANDLER(NAME, HANDLER) \
+  jsmbed_wrap_register_global_function ( # NAME, HANDLER )
+
+// Class constructors
+#define DECLARE_CLASS_CONSTRUCTOR(CLASS) \
+jerry_value_t \
+NAME_FOR_CLASS_CONSTRUCTOR(CLASS) (const jerry_value_t function_obj, \
+                  const jerry_value_t    this_obj, \
+                  const jerry_value_t    args[], \
+                  const jerry_length_t   args_count)
+
+#define REGISTER_CLASS_CONSTRUCTOR(CLASS) \
+  jsmbed_wrap_register_class_constructor ( # CLASS, NAME_FOR_CLASS_CONSTRUCTOR(CLASS) )
+
+// Class functions
+#define DECLARE_CLASS_FUNCTION(CLASS, NAME) \
+jerry_value_t \
+NAME_FOR_CLASS_FUNCTION(CLASS, NAME) (const jerry_value_t function_obj, \
+                  const jerry_value_t  this_obj, \
+                  const jerry_value_t    args[], \
+                  const jerry_length_t   args_count)
+
+#define ATTACH_CLASS_FUNCTION(OBJECT, CLASS, NAME) \
+  jsmbed_wrap_register_class_function (OBJECT, # NAME, NAME_FOR_CLASS_FUNCTION(CLASS, NAME) )
+
+//
+// 3. Argument checking macros
+//
+#define CHECK_ARGUMENT_COUNT(CLASS, NAME, EXPR) \
+    if (!(EXPR)) { \
+        const char* error_msg = "ERROR: wrong argument count for " # CLASS "." # NAME ", expected " # EXPR "."; \
+        return jerry_create_error(JERRY_ERROR_TYPE, reinterpret_cast<const jerry_char_t*>(error_msg)); \
+    }
+
+#define CHECK_ARGUMENT_TYPE_ALWAYS(CLASS, NAME, INDEX, TYPE) \
+    if (!jerry_value_is_ ## TYPE (args[INDEX])) { \
+        const char* error_msg = "ERROR: wrong argument type for " # CLASS "." # NAME ", expected argument " # INDEX " to be a " # TYPE ".\n"; \
+        return jerry_create_error(JERRY_ERROR_TYPE, reinterpret_cast<const jerry_char_t*>(error_msg)); \
+    }
+
+#define CHECK_ARGUMENT_TYPE_ON_CONDITION(CLASS, NAME, INDEX, TYPE, EXPR) \
+    if ((EXPR)) { \
+        if (!jerry_value_is_ ## TYPE (args[INDEX])) { \
+            const char* error_msg = "ERROR: wrong argument type for " # CLASS "." # NAME ", expected argument " # INDEX " to be a " # TYPE ".\n"; \
+            return jerry_create_error(JERRY_ERROR_TYPE, reinterpret_cast<const jerry_char_t*>(error_msg)); \
+        } \
+    }
+
+#define NAME_FOR_GLOBAL_FUNCTION(NAME) __gen_jsmbed_global_func_ ## NAME
+#define NAME_FOR_CLASS_CONSTRUCTOR(CLASS) __gen_jsmbed_class_constructor_ ## CLASS
+#define NAME_FOR_CLASS_FUNCTION(CLASS, NAME) __gen_jsmbed_func_c_ ## CLASS ## _f_ ## NAME
+
+#define NAME_FOR_CLASS_NATIVE_CONSTRUCTOR(CLASS, TYPELIST) __gen_native_jsmbed_ ## CLASS ## __Special_create_ ## TYPELIST
+#define NAME_FOR_CLASS_NATIVE_DESTRUCTOR(CLASS) __gen_native_jsmbed_ ## CLASS ## __Special_destroy
+#define NAME_FOR_CLASS_NATIVE_FUNCTION(CLASS, NAME) __gen_native_jsmbed_ ## CLASS ## _ ## NAME
+
+#endif  // _JERRYSCRIPT_MBED_UTIL_WRAPPERS_H
diff --git a/deps/jerry/targets/mbedos5/js/flash_leds.js b/deps/jerry/targets/mbedos5/js/flash_leds.js
new file mode 100644 (file)
index 0000000..855e907
--- /dev/null
@@ -0,0 +1,76 @@
+/* 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.
+ */
+
+var led = 0;
+
+// Setting the pin to 0 turns the LED on
+var led_off = 1;
+var led_on = 0;
+
+var digital_outs = [];
+
+var leds = [LED1, LED2, LED3, LED4];
+
+function connect_pins() {
+    print("Creating new DigitalOuts");
+    digital_outs = [];
+    for (var i = 0; i < 4; i++) {
+        digital_outs.push(DigitalOut(leds[i], led_off));
+        if (digital_outs[i].is_connected()) {
+            print("LED " + i + " is connected.");
+        }
+        else {
+            print("LED " + i + " is not connected.");
+        }
+    }
+}
+
+connect_pins();
+
+function blink() {
+    digital_outs[0].write(led_off);
+    digital_outs[1].write(led_off);
+    digital_outs[2].write(led_off);
+    digital_outs[3].write(led_off);
+
+    digital_outs[led].write(led_on);
+
+    print("Finished with LED " + led);
+    led = (led + 1) % 4;
+}
+
+// BUTTON2 on NRF52
+// USER_BUTTON on NUCLEO
+// SW2 on the K64F
+// BTN0 on EFM32GG
+var button;
+
+/* global BUTTON2, SW2, USER_BUTTON, BTN0 */
+if (typeof BUTTON2 !== 'undefined') {
+        button = InterruptIn(BUTTON2);
+} else if (typeof SW2 !== 'undefined') {
+        button = InterruptIn(SW2);
+} else if (typeof USER_BUTTON !== 'undefined') {
+        button = InterruptIn(USER_BUTTON);  
+} else if (typeof BTN0 !== 'undefined') {
+        button = InterruptIn(BTN0);    
+} else {
+        print("no button specified");
+}
+button.fall(function() {
+    print("YOU PUSHED THE BUTTON!");
+});
+
+print("flash_leds.js has finished executing.");
diff --git a/deps/jerry/targets/mbedos5/js/main.js b/deps/jerry/targets/mbedos5/js/main.js
new file mode 100644 (file)
index 0000000..39f54fc
--- /dev/null
@@ -0,0 +1,20 @@
+/* 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.
+ */
+
+setInterval(function() {
+    blink();
+}, 1000);
+
+print("main.js has finished executing.");
diff --git a/deps/jerry/targets/mbedos5/mbed-os.lib b/deps/jerry/targets/mbedos5/mbed-os.lib
new file mode 100644 (file)
index 0000000..3a2efff
--- /dev/null
@@ -0,0 +1 @@
+https://github.com/ARMmbed/mbed-os/#8d21974ba35e04c4854e5090c0f8283171664175
diff --git a/deps/jerry/targets/mbedos5/mbed_app.json b/deps/jerry/targets/mbedos5/mbed_app.json
new file mode 100644 (file)
index 0000000..9c956c6
--- /dev/null
@@ -0,0 +1,8 @@
+{
+    "target_overrides": {
+        "NRF52_DK": {
+            "target.uart_hwfc": 0
+        }
+    },
+    "macros": ["JERRY_JS_PARSER 1"]
+}
diff --git a/deps/jerry/targets/mbedos5/source/jerry_port_mbed.c b/deps/jerry/targets/mbedos5/source/jerry_port_mbed.c
new file mode 100644 (file)
index 0000000..adaca5d
--- /dev/null
@@ -0,0 +1,103 @@
+/* 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.
+ */
+
+#define _BSD_SOURCE
+#include <stdarg.h>
+#include <stdlib.h>
+#include <sys/time.h>
+
+#include "jerry-core/include/jerryscript-port.h"
+
+#include "us_ticker_api.h"
+
+#ifndef JSMBED_OVERRIDE_JERRY_PORT_LOG
+/**
+ * Provide log message implementation for the engine.
+ */
+void
+jerry_port_log (jerry_log_level_t level, /**< log level */
+                const char *format, /**< format string */
+                ...)  /**< parameters */
+{
+  (void) level; /* ignore log level */
+
+  va_list args;
+  va_start (args, format);
+  vfprintf (stderr, format, args);
+  va_end (args);
+
+  if (strlen (format) == 1 && format[0] == 0x0a) /* line feed (\n) */
+  {
+    printf ("\r"); /* add CR for proper display in serial monitors */
+  }
+} /* jerry_port_log */
+#endif /* JSMBED_OVERRIDE_JERRY_PORT_LOG */
+
+/**
+ * Implementation of jerry_port_fatal.
+ */
+void
+jerry_port_fatal (jerry_fatal_code_t code) /**< fatal code enum item */
+{
+  exit (code);
+} /* jerry_port_fatal */
+
+/**
+ * Implementation of jerry_port_get_time_zone.
+ *
+ * @return true - if success
+ */
+bool
+jerry_port_get_time_zone (jerry_time_zone_t *tz_p) /**< timezone pointer */
+{
+  tz_p->offset = 0;
+  tz_p->daylight_saving_time = 0;
+  return true;
+} /* jerry_port_get_time_zone */
+
+/**
+ * Implementation of jerry_port_get_current_time.
+ *
+ * @return current timer's counter value in milliseconds
+ */
+double
+jerry_port_get_current_time (void)
+{
+  static uint64_t last_tick = 0;
+  static time_t last_time = 0;
+  static uint32_t skew = 0;
+
+  uint64_t curr_tick = us_ticker_read (); /* The value is in microseconds. */
+  time_t curr_time = time(NULL); /*  The value is in seconds. */
+  double result = curr_time * 1000;
+
+  /* The us_ticker_read () has an overflow for each UINT_MAX microseconds
+   * (~71 mins). For each overflow event the ticker-based clock is about 33
+   * milliseconds fast. Without a timer thread the milliseconds part of the
+   * time can be corrected if the difference of two get_current_time calls
+   * are within the mentioned 71 mins. Above that interval we can assume
+   * that the milliseconds part of the time is negligibe.
+   */
+  if (curr_time - last_time > (time_t)(((uint32_t)-1) / 1000000)) {
+    skew = 0;
+  } else if (last_tick > curr_tick) {
+    skew = (skew + 33) % 1000;
+  }
+  result += (curr_tick / 1000 - skew) % 1000;
+
+  last_tick = curr_tick;
+  last_time = curr_time;
+  return result;
+} /* jerry_port_get_current_time */
diff --git a/deps/jerry/targets/mbedos5/template-mbedignore.txt b/deps/jerry/targets/mbedos5/template-mbedignore.txt
new file mode 100644 (file)
index 0000000..d60ed09
--- /dev/null
@@ -0,0 +1,11 @@
+cmake/*
+docs/*
+jerry-libc/*
+jerry-main/*
+jerry-port/default/default-date.c
+jerry-port/default/default-fatal.c
+jerry-port/default/default-io.c
+targets/*
+tests/*
+third-party/*
+tools/*
diff --git a/deps/jerry/targets/mbedos5/tools/check_pins.sh b/deps/jerry/targets/mbedos5/tools/check_pins.sh
new file mode 100755 (executable)
index 0000000..7d4279b
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# 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.
+
+# If we're checking only for global variable definitions of pins, then
+# file ordering doesn't matter. This is because:
+#
+# var a = b;
+# var b = 7;
+#
+# will be accepted by jshint, just 'a' will evaluate to 'undefined'.
+# Awkward, but at least it means we can have pins.js included at any
+# point in the clump of files and it won't give us false positives.
+
+cat js/*.js | jshint -c tools/jshint.conf - | grep "not defined"
+if [ "$?" == 0 ]; then
+    exit 1
+fi
+exit 0
diff --git a/deps/jerry/targets/mbedos5/tools/cmsis.h b/deps/jerry/targets/mbedos5/tools/cmsis.h
new file mode 100644 (file)
index 0000000..105c81e
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ *
+ * This file is intentionally blank, and is used as a dummy cmsis.h file
+ * when preprocessing generate_pins.py.
+ */
diff --git a/deps/jerry/targets/mbedos5/tools/generate_pins.py b/deps/jerry/targets/mbedos5/tools/generate_pins.py
new file mode 100644 (file)
index 0000000..ccba062
--- /dev/null
@@ -0,0 +1,247 @@
+#!/usr/bin/env python
+
+# 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.
+"""
+Generate pins.js for a specified target, using target definitions from the
+mbed OS source tree.
+
+It's expecting to be run from the targets/mbedos5 directory.
+"""
+
+from __future__ import print_function
+
+import argparse
+import ast
+
+import sys
+import os
+
+from simpleeval import SimpleEval, DEFAULT_OPERATORS
+from pycparserext.ext_c_parser import GnuCParser
+from pycparser import parse_file, c_ast, c_generator
+
+# import mbed tools
+sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'mbed-os'))
+from tools.targets import Target
+
+LICENSE = '''/* 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.
+ *
+ * This file is generated by generate_pins.py. Please do not modify.
+ */
+    '''
+
+
+def find_file(root_dir, directories, name):
+    """
+    Find the first instance of file with name 'name' in the directory tree
+    starting with 'root_dir'.
+
+    Filter out directories that are not in directories, or do not start with
+    TARGET_.
+
+    Since this looks in (essentially )the same directories as the compiler would
+    when compiling mbed OS, we should only find one PinNames.h.
+    """
+
+    for root, dirs, files in os.walk(root_dir, topdown=True):
+        # modify dirs in place
+        dirs[:] = [directory for directory in dirs if directory in directories or not directory.startswith('TARGET_')]
+
+        if name in files:
+            return os.path.join(root, name)
+
+
+def enumerate_includes(root_dir, directories):
+    """
+    Walk through the directory tree, starting at root_dir, and enumerate all
+    valid include directories.
+    """
+    for root, dirs, _ in os.walk(root_dir, topdown=True):
+        # modify dirs in place
+        dirs[:] = [dir_label for dir_label in dirs
+                   if dir_label in directories
+                   or (not dir_label.startswith('TARGET_')
+                       and not dir_label.startswith('TOOLCHAIN_'))]
+        yield root
+
+
+class TypeDeclVisitor(c_ast.NodeVisitor):
+    """
+    A TypeDecl visitor class that walks the ast and calls a visitor function for every node found.
+    """
+    def __init__(self, filter_names=None):
+        self.names = filter_names or []
+
+    def visit(self, node):
+        value = None
+
+        if node.__class__.__name__ == "TypeDecl":
+            value = self.visit_typedecl(node)
+
+        if value is None:
+            for _, child_node in node.children():
+                value = value or self.visit(child_node)
+
+        return value
+
+    def visit_typedecl(self, node):
+        """
+        Visit a node.
+        """
+        if node.declname in self.names:
+            c_gen = c_generator.CGenerator()
+            pins = {}
+
+            operators = DEFAULT_OPERATORS
+            operators[ast.BitOr] = lambda a, b: a | b
+            operators[ast.LShift] = lambda a, b: a << b
+            operators[ast.RShift] = lambda a, b: a << b
+            evaluator = SimpleEval(DEFAULT_OPERATORS)
+
+            for pin in node.type.values.enumerators:
+                expr = c_gen.visit(pin.value)
+
+                if "(int)" in expr:
+                    expr = expr.replace('(int)', '')
+
+                if expr in pins:
+                    pins[pin.name] = pins[expr]
+                else:
+                    pins[pin.name] = evaluator.eval(expr.strip())
+
+            return pins
+
+
+def enumerate_pins(c_source_file, include_dirs, definitions):
+    """
+    Enumerate pins specified in PinNames.h, by looking for a PinName enum
+    typedef somewhere in the file.
+    """
+    definitions += ['__attribute(x)__=', '__extension__(x)=', 'register=', '__IO=', 'uint32_t=unsigned int']
+
+    gcc_args = ['-E', '-fmerge-all-constants']
+    gcc_args += ['-I' + directory for directory in include_dirs]
+
+    gcc_args += ['-D' + definition for definition in definitions]
+    parsed_ast = parse_file(c_source_file,
+                            use_cpp=True,
+                            cpp_path='arm-none-eabi-gcc',
+                            cpp_args=gcc_args,
+                            parser=GnuCParser())
+
+    # now, walk the AST
+    visitor = TypeDeclVisitor(['PinName'])
+    return visitor.visit(parsed_ast)
+
+
+def write_pins_to_files(pins, out_js_file, out_cpp_file):
+    """
+    Write the generated pins for a specified mbed board into the output JS and C++ files.
+    """
+    out_js = '\r\n'.join(['var %s = %s;' % pin for pin in pins])
+    out_js_file.write(out_js)
+
+    count = '''
+unsigned int jsmbed_js_magic_string_count = {};
+    '''.format(len(pins))
+
+    lengths = ',\n    '.join(str(len(pin[0])) for pin in pins)
+    lenghts_source = '''
+unsigned int jsmbed_js_magic_string_lengths[] = {
+    %s
+};
+    ''' % lengths
+
+    magic_values = ',\n    '.join(str(pin[1]) for pin in pins)
+    magic_source = '''
+unsigned int jsmbed_js_magic_string_values[] = {
+    %s
+};
+    ''' % magic_values
+
+    magic_strings = ',\n    '.join('"' + pin[0] + '"' for pin in pins)
+    magic_string_source = '''
+const char * jsmbed_js_magic_strings[] = {
+    %s
+};
+    ''' % magic_strings
+
+    out_cpp_file.write(LICENSE + count + lenghts_source + magic_source + magic_string_source)
+
+
+def main():
+    """
+    Perform the main function of this program
+    """
+    if not os.path.exists('./mbed-os'):
+        print("Fatal: mbed-os directory does not exist.")
+        print("Try running 'make getlibs'")
+        sys.exit(1)
+
+    description = """
+    Generate pins.js for a specified mbed board, using target definitions from the
+    mbed OS source tree.
+    """
+
+    parser = argparse.ArgumentParser(description=description)
+
+    parser.add_argument('board', help='mbed board name')
+    parser.add_argument('-o',
+                        help='Output JavaScript file (default: %(default)s)',
+                        default='js/pins.js',
+                        type=argparse.FileType('w'))
+    parser.add_argument('-c',
+                        help='Output C++ file (default: %(default)s)',
+                        default='source/pins.cpp',
+                        type=argparse.FileType('w'))
+
+    args = parser.parse_args()
+    board_name = args.board.upper()
+
+    target = Target.get_target(board_name)
+
+    directory_labels = ['TARGET_' + label for label in target.labels] + target.macros
+
+    targets_dir = os.path.join('.', 'mbed-os', 'targets')
+
+    pins_file = find_file(targets_dir, directory_labels, 'PinNames.h')
+
+    includes = enumerate_includes(targets_dir, directory_labels)
+    defines = list(directory_labels)
+
+    # enumerate pins from PinNames.h
+    pins = enumerate_pins(pins_file, ['./tools'] + list(includes), defines)
+
+    # first sort alphabetically, then by length.
+    pins = [(x, pins[x]) for x in pins]  # turn dict into tuples, which can be sorted
+    pins = sorted(pins, key=lambda x: (len(x[0]), x[0].lower()))
+
+    write_pins_to_files(pins, args.o, args.c)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/deps/jerry/targets/mbedos5/tools/jshint.conf b/deps/jerry/targets/mbedos5/tools/jshint.conf
new file mode 100644 (file)
index 0000000..26379e2
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "undef": true,
+  "predef": ["print", "BLEDevice", "BLEService", "BLECharacteristic", "DigitalOut", "I2C", "setInterval", "setTimeout", "InterruptIn", "LWIPInterface", "SimpleMbedClient", "M2MBase"]
+}
diff --git a/deps/jerry/targets/mbedos5/tools/requirements.txt b/deps/jerry/targets/mbedos5/tools/requirements.txt
new file mode 100644 (file)
index 0000000..54b167d
--- /dev/null
@@ -0,0 +1,3 @@
+pycparser
+simpleeval
+pycparserext
diff --git a/deps/jerry/targets/nuttx-stm32f4/Kconfig b/deps/jerry/targets/nuttx-stm32f4/Kconfig
new file mode 100644 (file)
index 0000000..6f8ff36
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config JERRYSCRIPT
+       bool "Jerryscript"
+       default n
+       ---help---
+               Enable Jerryscript ECMAScript 5.1 interpreter
+
+if JERRYSCRIPT
+
+config JERRYSCRIPT_PROGNAME
+       string "Program name"
+       default "jerry"
+       depends on BUILD_KERNEL
+       ---help---
+               This is the name of the program that will be
+                use when the NSH ELF program is installed.
+
+config JERRYSCRIPT_PRIORITY
+       int "Jerryscript task priority"
+       default 100
+
+config JERRYSCRIPT_STACKSIZE
+       int "Jerryscript stack size"
+       default 16384
+
+config JERRYSCRIPT_HEAPSIZE
+       int "Jerryscript heap size"
+       default 107520
+
+config JERRYSCRIPT_ERROR_MESSAGES
+       bool "Enable error messages for builtin error objects"
+       default n
+
+config JERRYSCRIPT_MEM_STATS
+       bool "Enable memory statistics"
+       default n
+
+config JERRYSCRIPT_SHOW_OPCODES
+       bool "Enable parser byte-code dumps"
+       default n
+
+config JERRYSCRIPT_DEBUGGER
+       bool "Jerryscript debugger"
+       default n
+
+if JERRYSCRIPT_DEBUGGER
+config JERRYSCRIPT_DEBUGGER_PORT
+       int "Jerryscript debugger port"
+       default 5001
+endif
+
+endif
diff --git a/deps/jerry/targets/nuttx-stm32f4/Make.defs b/deps/jerry/targets/nuttx-stm32f4/Make.defs
new file mode 100644 (file)
index 0000000..8606a4d
--- /dev/null
@@ -0,0 +1,17 @@
+# 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.
+
+ifeq ($(CONFIG_JERRYSCRIPT),y)
+CONFIGURED_APPS += interpreters/jerryscript
+endif
diff --git a/deps/jerry/targets/nuttx-stm32f4/Makefile b/deps/jerry/targets/nuttx-stm32f4/Makefile
new file mode 100644 (file)
index 0000000..e35c609
--- /dev/null
@@ -0,0 +1,72 @@
+# 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.
+
+-include $(TOPDIR)/Make.defs
+
+# Jerryscript built-in application info
+
+CONFIG_JERRYSCRIPT_PRIORITY ?= SCHED_PRIORITY_DEFAULT
+CONFIG_JERRYSCRIPT_STACKSIZE ?= 16384
+CONFIG_JERRYSCRIPT_HEAPSIZE ?= 107520
+CONFIG_JERRY_DEBUGGER_PORT ?= 5001
+
+APPNAME = jerry
+# path to the project dir, "jerry-nuttx" by default
+ROOT_DIR = ../../..
+PRIORITY = $(CONFIG_JERRYSCRIPT_PRIORITY)
+STACKSIZE = $(CONFIG_JERRYSCRIPT_STACKSIZE)
+CFLAGS += -std=c99 -DJERRY_NDEBUG -DJERRY_JS_PARSER '-DCONFIG_MEM_HEAP_AREA_SIZE=$(CONFIG_JERRYSCRIPT_HEAPSIZE)' -DCONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+CFLAGS += -I$(ROOT_DIR)/ $(shell find $(ROOT_DIR)/jerryscript/jerry-core -type d | sed -r -e 's/^/-I/g')
+CFLAGS += -I$(ROOT_DIR)/jerryscript/jerry-libm/include
+CFLAGS += -I$(ROOT_DIR)/jerryscript/jerry-ext/include
+
+# Fill error messages for builtin error objects
+ifeq ($(CONFIG_JERRYSCRIPT_ERROR_MESSAGES),y)
+       CFLAGS += -DJERRY_ENABLE_ERROR_MESSAGES
+endif
+
+ifeq ($(CONFIG_JERRYSCRIPT_MEM_STATS),y)
+       CFLAGS += -DJMEM_STATS
+endif
+
+ifeq ($(CONFIG_JERRYSCRIPT_SHOW_OPCODES),y)
+       CFLAGS += -DPARSER_DUMP_BYTE_CODE
+endif
+
+ifeq ($(CONFIG_JERRYSCRIPT_DEBUGGER),y)
+       CFLAGS += -DJERRY_DEBUGGER '-DJERRY_DEBUGGER_PORT=$(CONFIG_JERRY_DEBUGGER_PORT)'
+endif
+
+# Jerryscript
+
+.PHONY: jerry_core_allin.c
+jerry_core_allin.c:
+       find $(ROOT_DIR)/jerryscript/jerry-core -name "*.c" | sed -r -e 's/(\.\.\/)*(.+)/#include "\2"/g' > jerry_core_allin.c
+
+.PHONY: jerry_libm_allin.c
+jerry_libm_allin.c:
+       find $(ROOT_DIR)/jerryscript/jerry-libm -name "*.c" | sed -r -e 's/(\.\.\/)*(.+)/#include "\2"/g' > jerry_libm_allin.c
+
+.PHONY: jerry_ext_allin.c
+jerry_ext_allin.c:
+       find $(ROOT_DIR)/jerryscript/jerry-ext/handler -name "*.c" | sed -r -e 's/(\.\.\/)*(.+)/#include "\2"/g' > jerry_ext_allin.c
+
+ASRCS = setjmp.S
+CSRCS = jerry_core_allin.c jerry_libm_allin.c jerry_ext_allin.c
+MAINSRC = jerry_main.c
+
+CONFIG_JERRYSCRIPT_PROGNAME ?= jerry$(EXEEXT)
+PROGNAME = $(CONFIG_JERRYSCRIPT_PROGNAME)
+
+include $(APPDIR)/Application.mk
diff --git a/deps/jerry/targets/nuttx-stm32f4/README.md b/deps/jerry/targets/nuttx-stm32f4/README.md
new file mode 100644 (file)
index 0000000..0471297
--- /dev/null
@@ -0,0 +1,130 @@
+### About
+
+This folder contains files to run JerryScript on
+[STM32F4-Discovery board](http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/stm32f4discovery.html) with [NuttX](http://nuttx.org/)
+
+### How to build
+
+#### 1. Setting up the build environment for STM32F4-Discovery board
+
+Clone JerryScript and NuttX into jerry-nuttx directory
+
+```
+mkdir jerry-nuttx
+cd jerry-nuttx
+git clone https://github.com/jerryscript-project/jerryscript.git
+git clone https://bitbucket.org/nuttx/nuttx.git
+git clone https://bitbucket.org/nuttx/apps.git
+git clone https://github.com/texane/stlink.git
+```
+
+The following directory structure is created after these commands
+
+```
+jerry-nuttx
+  + apps
+  + jerryscript
+  |  + targets
+  |      + nuttx-stm32f4
+  + nuttx
+  + stlink
+```
+
+#### 2. Adding JerryScript as an interpreter for NuttX
+
+```
+cd apps/interpreters
+mkdir jerryscript
+cp ../../jerryscript/targets/nuttx-stm32f4/* ./jerryscript/
+```
+
+#### 3. Configure NuttX
+
+```
+# assuming you are in jerry-nuttx folder
+cd nuttx/tools
+
+# configure NuttX USB console shell
+./configure.sh stm32f4discovery/usbnsh
+
+cd ..
+# might require to run "make menuconfig" twice
+make menuconfig
+```
+
+We must set the following options:
+
+* Change `Build Setup -> Build Host Platform` from _Windows_ to _Linux_
+* Enable `System Type -> FPU support`
+* Enable `Application Configuration -> Interpreters -> JerryScript`
+
+If you get `kconfig-mconf: not found` error when you run `make menuconfig` you may have to install kconfig-frontends:
+
+```
+# assume you are in jerry-nuttx folder
+sudo apt-get install gperf flex bison libncurses-dev
+git clone https://github.com/jameswalmsley/kconfig-frontends.git
+cd kconfig-frontends
+./bootstrap
+./configure --enable-mconf
+make
+sudo make install
+sudo ldconfig
+```
+
+#### 4. Build JerryScript for NuttX
+
+```
+# assuming you are in jerry-nuttx folder
+cd nuttx/
+make
+```
+
+#### 5. Flashing
+
+Connect Mini-USB for power supply and connect Micro-USB for `NSH` console.
+
+To configure `stlink` utility for flashing, follow the instructions in the official [Stlink repository](https://github.com/texane/stlink).
+
+To flash,
+```
+# assuming you are in nuttx folder
+sudo ../stlink/build/Release/st-flash write nuttx.bin 0x8000000
+```
+
+### Running JerryScript
+
+You can use `minicom` for terminal program, or any other you may like, but set
+baud rate to `115200`.
+
+```
+sudo minicom --device=/dev/ttyACM0 --baud=115200
+```
+
+You may have to press `RESET` on the board and press `Enter` keys on the console
+several times to make `nsh` prompt to appear.
+
+If the prompt shows like this,
+```
+NuttShell (NSH)
+               nsh>
+                    nsh>
+                         nsh>
+```
+please set `Add Carriage Ret` option by `CTRL-A` > `Z` > `U` at the console,
+if you're using `minicom`.
+
+
+Run `jerry` with javascript file(s)
+
+```
+NuttShell (NSH)
+nsh> jerry full_path/any.js
+```
+
+Without argument it prints:
+```
+nsh> jerry
+No input files, running a hello world demo:
+Hello world 5 times from JerryScript
+```
diff --git a/deps/jerry/targets/nuttx-stm32f4/jerry_main.c b/deps/jerry/targets/nuttx-stm32f4/jerry_main.c
new file mode 100644 (file)
index 0000000..de36b4e
--- /dev/null
@@ -0,0 +1,541 @@
+/* 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+#include "jerryscript-port.h"
+#include "jmem.h"
+#include "setjmp.h"
+
+/**
+ * Maximum command line arguments number.
+ */
+#define JERRY_MAX_COMMAND_LINE_ARGS (16)
+
+/**
+ * Standalone Jerry exit codes.
+ */
+#define JERRY_STANDALONE_EXIT_CODE_OK   (0)
+#define JERRY_STANDALONE_EXIT_CODE_FAIL (1)
+
+/**
+ * Context size of the SYNTAX_ERROR
+ */
+#define SYNTAX_ERROR_CONTEXT_SIZE 2
+
+/**
+ * Print usage and available options
+ */
+static void
+print_help (char *name)
+{
+  printf ("Usage: %s [OPTION]... [FILE]...\n"
+          "\n"
+          "Options:\n"
+          "  --log-level [0-3]\n"
+          "  --mem-stats\n"
+          "  --mem-stats-separate\n"
+          "  --show-opcodes\n"
+          "  --start-debug-server\n"
+          "\n",
+          name);
+} /* print_help */
+
+/**
+ * Read source code into buffer.
+ *
+ * Returned value must be freed with jmem_heap_free_block if it's not NULL.
+ * @return NULL, if read or allocation has failed
+ *         pointer to the allocated memory block, otherwise
+ */
+static const uint8_t *
+read_file (const char *file_name, /**< source code */
+           size_t *out_size_p) /**< [out] number of bytes successfully read from source */
+{
+  FILE *file = fopen (file_name, "r");
+  if (file == NULL)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: cannot open file: %s\n", file_name);
+    return NULL;
+  }
+
+  int fseek_status = fseek (file, 0, SEEK_END);
+  if (fseek_status != 0)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Failed to seek (error: %d)\n", fseek_status);
+    fclose (file);
+    return NULL;
+  }
+
+  long script_len = ftell (file);
+  if (script_len < 0)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Failed to get the file size(error %ld)\n", script_len);
+    fclose (file);
+    return NULL;
+  }
+
+  rewind (file);
+
+  uint8_t *buffer = jmem_heap_alloc_block_null_on_error (script_len);
+
+  if (buffer == NULL)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Out of memory error\n");
+    fclose (file);
+    return NULL;
+  }
+
+  size_t bytes_read = fread (buffer, 1u, script_len, file);
+
+  if (!bytes_read || bytes_read != script_len)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: failed to read file: %s\n", file_name);
+    jmem_heap_free_block ((void*) buffer, script_len);
+
+    fclose (file);
+    return NULL;
+  }
+
+  fclose (file);
+
+  *out_size_p = bytes_read;
+  return (const uint8_t *) buffer;
+} /* read_file */
+
+/**
+ * Check whether an error is a SyntaxError or not
+ *
+ * @return true - if param is SyntaxError
+ *         false - otherwise
+ */
+static bool
+jerry_value_is_syntax_error (jerry_value_t error_value) /**< error value */
+{
+  assert (jerry_is_feature_enabled (JERRY_FEATURE_ERROR_MESSAGES));
+
+  if (!jerry_value_is_object (error_value))
+  {
+    return false;
+  }
+
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *)"name");
+  jerry_value_t error_name = jerry_get_property (error_value, prop_name);
+  jerry_release_value (prop_name);
+
+  if (jerry_value_has_error_flag (error_name)
+      || !jerry_value_is_string (error_name))
+  {
+    return false;
+  }
+
+  jerry_size_t err_str_size = jerry_get_string_size (error_name);
+  jerry_char_t err_str_buf[err_str_size];
+
+  jerry_size_t sz = jerry_string_to_char_buffer (error_name, err_str_buf, err_str_size);
+  jerry_release_value (error_name);
+
+  if (sz == 0)
+  {
+    return false;
+  }
+
+  if (!strcmp ((char *) err_str_buf, "SyntaxError"))
+  {
+    return true;
+  }
+
+  return false;
+} /* jerry_value_is_syntax_error */
+
+/**
+ * Convert string into unsigned integer
+ *
+ * @return converted number
+ */
+static uint32_t
+str_to_uint (const char *num_str_p) /**< string to convert */
+{
+  assert (jerry_is_feature_enabled (JERRY_FEATURE_ERROR_MESSAGES));
+
+  uint32_t result = 0;
+
+  while (*num_str_p != '\0')
+  {
+    assert (*num_str_p >= '0' && *num_str_p <= '9');
+
+    result *= 10;
+    result += (uint32_t) (*num_str_p - '0');
+    num_str_p++;
+  }
+
+  return result;
+} /* str_to_uint */
+
+/**
+ * Print error value
+ */
+static void
+print_unhandled_exception (jerry_value_t error_value, /**< error value */
+                           const jerry_char_t *source_p) /**< source_p */
+{
+  assert (jerry_value_has_error_flag (error_value));
+
+  jerry_value_clear_error_flag (&error_value);
+  jerry_value_t err_str_val = jerry_value_to_string (error_value);
+  jerry_size_t err_str_size = jerry_get_string_size (err_str_val);
+  jerry_char_t err_str_buf[256];
+
+  if (err_str_size >= 256)
+  {
+    const char msg[] = "[Error message too long]";
+    err_str_size = sizeof (msg) / sizeof (char) - 1;
+    memcpy (err_str_buf, msg, err_str_size);
+  }
+  else
+  {
+    jerry_size_t sz = jerry_string_to_char_buffer (err_str_val, err_str_buf, err_str_size);
+    assert (sz == err_str_size);
+    err_str_buf[err_str_size] = 0;
+
+    if (jerry_is_feature_enabled (JERRY_FEATURE_ERROR_MESSAGES) && jerry_value_is_syntax_error (error_value))
+    {
+      uint32_t err_line = 0;
+      uint32_t err_col = 0;
+
+      /* 1. parse column and line information */
+      for (uint32_t i = 0; i < sz; i++)
+      {
+        if (!strncmp ((char *) (err_str_buf + i), "[line: ", 7))
+        {
+          i += 7;
+
+          char num_str[8];
+          uint32_t j = 0;
+
+          while (i < sz && err_str_buf[i] != ',')
+          {
+            num_str[j] = (char) err_str_buf[i];
+            j++;
+            i++;
+          }
+          num_str[j] = '\0';
+
+          err_line = str_to_uint (num_str);
+
+          if (strncmp ((char *) (err_str_buf + i), ", column: ", 10))
+          {
+            break; /* wrong position info format */
+          }
+
+          i += 10;
+          j = 0;
+
+          while (i < sz && err_str_buf[i] != ']')
+          {
+            num_str[j] = (char) err_str_buf[i];
+            j++;
+            i++;
+          }
+          num_str[j] = '\0';
+
+          err_col = str_to_uint (num_str);
+          break;
+        }
+      } /* for */
+
+      if (err_line != 0 && err_col != 0)
+      {
+        uint32_t curr_line = 1;
+
+        bool is_printing_context = false;
+        uint32_t pos = 0;
+
+        /* 2. seek and print */
+        while (source_p[pos] != '\0')
+        {
+          if (source_p[pos] == '\n')
+          {
+            curr_line++;
+          }
+
+          if (err_line < SYNTAX_ERROR_CONTEXT_SIZE
+              || (err_line >= curr_line
+                  && (err_line - curr_line) <= SYNTAX_ERROR_CONTEXT_SIZE))
+          {
+            /* context must be printed */
+            is_printing_context = true;
+          }
+
+          if (curr_line > err_line)
+          {
+            break;
+          }
+
+          if (is_printing_context)
+          {
+            jerry_port_log (JERRY_LOG_LEVEL_ERROR, "%c", source_p[pos]);
+          }
+
+          pos++;
+        }
+
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "\n");
+
+        while (--err_col)
+        {
+          jerry_port_log (JERRY_LOG_LEVEL_ERROR, "~");
+        }
+
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "^\n");
+      }
+    }
+  }
+
+  jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Script Error: %s\n", err_str_buf);
+  jerry_release_value (err_str_val);
+} /* print_unhandled_exception */
+
+/**
+ * Register a JavaScript function in the global object.
+ */
+static void
+register_js_function (const char *name_p, /**< name of the function */
+                      jerry_external_handler_t handler_p) /**< function callback */
+{
+  jerry_value_t result_val = jerryx_handler_register_global ((const jerry_char_t *) name_p, handler_p);
+
+  if (jerry_value_has_error_flag (result_val))
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_WARNING, "Warning: failed to register '%s' method.", name_p);
+  }
+
+  jerry_release_value (result_val);
+} /* register_js_function */
+
+/**
+ * JerryScript log level
+ */
+static jerry_log_level_t jerry_log_level = JERRY_LOG_LEVEL_ERROR;
+
+/**
+ * Main program.
+ *
+ * @return 0 if success, error code otherwise
+ */
+#ifdef CONFIG_BUILD_KERNEL
+int main (int argc, FAR char *argv[])
+#else
+int jerry_main (int argc, char *argv[])
+#endif
+{
+  if (argc > JERRY_MAX_COMMAND_LINE_ARGS)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR,
+                    "Too many command line arguments. Current maximum is %d\n",
+                    JERRY_MAX_COMMAND_LINE_ARGS);
+
+    return JERRY_STANDALONE_EXIT_CODE_FAIL;
+  }
+
+  const char *file_names[JERRY_MAX_COMMAND_LINE_ARGS];
+  int i;
+  int files_counter = 0;
+
+  jerry_init_flag_t flags = JERRY_INIT_EMPTY;
+
+  for (i = 1; i < argc; i++)
+  {
+    if (!strcmp ("-h", argv[i]) || !strcmp ("--help", argv[i]))
+    {
+      print_help (argv[0]);
+      return JERRY_STANDALONE_EXIT_CODE_OK;
+    }
+    else if (!strcmp ("--mem-stats", argv[i]))
+    {
+      flags |= JERRY_INIT_MEM_STATS;
+      jerry_log_level = JERRY_LOG_LEVEL_DEBUG;
+    }
+    else if (!strcmp ("--mem-stats-separate", argv[i]))
+    {
+      flags |= JERRY_INIT_MEM_STATS_SEPARATE;
+      jerry_log_level = JERRY_LOG_LEVEL_DEBUG;
+    }
+    else if (!strcmp ("--show-opcodes", argv[i]))
+    {
+      flags |= JERRY_INIT_SHOW_OPCODES | JERRY_INIT_SHOW_REGEXP_OPCODES;
+      jerry_log_level = JERRY_LOG_LEVEL_DEBUG;
+    }
+    else if (!strcmp ("--log-level", argv[i]))
+    {
+      if (++i < argc && strlen (argv[i]) == 1 && argv[i][0] >='0' && argv[i][0] <= '3')
+      {
+        jerry_log_level = argv[i][0] - '0';
+      }
+      else
+      {
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: wrong format or invalid argument\n");
+        return JERRY_STANDALONE_EXIT_CODE_FAIL;
+      }
+    }
+    else if (!strcmp ("--start-debug-server", argv[i]))
+    {
+      flags |= JERRY_INIT_DEBUGGER;
+    }
+    else
+    {
+      file_names[files_counter++] = argv[i];
+    }
+  }
+
+  jerry_init (flags);
+
+  register_js_function ("assert", jerryx_handler_assert);
+  register_js_function ("gc", jerryx_handler_gc);
+  register_js_function ("print", jerryx_handler_print);
+
+  jerry_value_t ret_value = jerry_create_undefined ();
+
+  if (files_counter == 0)
+  {
+    printf ("No input files, running a hello world demo:\n");
+    const jerry_char_t script[] = "var str = 'Hello World'; print(str + ' from JerryScript')";
+    size_t script_size = strlen ((const char *) script);
+
+    ret_value = jerry_parse (script, script_size, false);
+
+    if (!jerry_value_has_error_flag (ret_value))
+    {
+      ret_value = jerry_run (ret_value);
+    }
+  }
+  else
+  {
+    for (i = 0; i < files_counter; i++)
+    {
+      size_t source_size;
+      const jerry_char_t *source_p = read_file (file_names[i], &source_size);
+
+      if (source_p == NULL)
+      {
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Source file load error\n");
+        return JERRY_STANDALONE_EXIT_CODE_FAIL;
+      }
+
+      ret_value = jerry_parse_named_resource ((jerry_char_t *) file_names[i],
+                                              strlen (file_names[i]),
+                                              source_p,
+                                              source_size,
+                                              false);
+
+      if (!jerry_value_has_error_flag (ret_value))
+      {
+        jerry_value_t func_val = ret_value;
+        ret_value = jerry_run (func_val);
+        jerry_release_value (func_val);
+      }
+
+      if (jerry_value_has_error_flag (ret_value))
+      {
+        print_unhandled_exception (ret_value, source_p);
+        jmem_heap_free_block ((void*) source_p, source_size);
+
+        break;
+      }
+
+      jmem_heap_free_block ((void*) source_p, source_size);
+
+      jerry_release_value (ret_value);
+      ret_value = jerry_create_undefined ();
+    }
+  }
+
+  int ret_code = JERRY_STANDALONE_EXIT_CODE_OK;
+
+  if (jerry_value_has_error_flag (ret_value))
+  {
+    ret_code = JERRY_STANDALONE_EXIT_CODE_FAIL;
+  }
+
+  jerry_release_value (ret_value);
+  jerry_cleanup ();
+
+  return ret_code;
+} /* main */
+
+/**
+ * Aborts the program.
+ */
+void jerry_port_fatal (jerry_fatal_code_t code)
+{
+  exit (1);
+} /* jerry_port_fatal */
+
+/**
+ * Provide log message implementation for the engine.
+ */
+void
+jerry_port_log (jerry_log_level_t level, /**< log level */
+                const char *format, /**< format string */
+                ...)  /**< parameters */
+{
+  if (level <= jerry_log_level)
+  {
+    va_list args;
+    va_start (args, format);
+    vfprintf (stderr, format, args);
+    va_end (args);
+  }
+} /* jerry_port_log */
+
+/**
+ * Dummy function to get the time zone.
+ *
+ * @return true
+ */
+bool
+jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
+{
+  /* We live in UTC. */
+  tz_p->offset = 0;
+  tz_p->daylight_saving_time = 0;
+
+  return true;
+} /* jerry_port_get_time_zone */
+
+/**
+ * Dummy function to get the current time.
+ *
+ * @return 0
+ */
+double
+jerry_port_get_current_time (void)
+{
+  return 0;
+} /* jerry_port_get_current_time */
+
+/**
+ * Provide the implementation of jerryx_port_handler_print_char.
+ * Uses 'printf' to print a single character to standard output.
+ */
+void
+jerryx_port_handler_print_char (char c) /**< the character to print */
+{
+  printf ("%c", c);
+} /* jerryx_port_handler_print_char */
diff --git a/deps/jerry/targets/nuttx-stm32f4/setjmp.S b/deps/jerry/targets/nuttx-stm32f4/setjmp.S
new file mode 100644 (file)
index 0000000..783d87c
--- /dev/null
@@ -0,0 +1,65 @@
+/* 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.
+ */
+
+.syntax unified
+
+.macro func _name
+.global \_name
+.type \_name, %function
+\_name:
+.endm
+.macro endfunc _name
+.size \_name, .-\_name
+.endm
+
+/**
+ * setjmp (jmp_buf env)
+ *
+ * See also:
+ *          longjmp
+ *
+ * @return 0 - if returns from direct call,
+ *         nonzero - if returns after longjmp.
+ */
+func setjmp
+  stmia r0!, {r4 - r11, lr}
+  str sp, [r0], #4
+  vstm r0, {s16 - s31}
+  mov r0, #0
+  bx lr
+endfunc setjmp
+
+/**
+ * longjmp (jmp_buf env, int val)
+ *
+ * Note:
+ *      if val is not 0, then it would be returned from setjmp,
+ *      otherwise - 0 would be returned.
+ *
+ * See also:
+ *          setjmp
+ */
+func longjmp
+  ldmia r0!, {r4 - r11, lr}
+  ldr sp, [r0]
+  add r0, r0, #4
+  vldm r0, {s16 - s31}
+  mov r0, r1
+  cmp r0, #0
+  bne 1f
+  mov r0, #1
+  1:
+  bx lr
+endfunc longjmp
diff --git a/deps/jerry/targets/nuttx-stm32f4/setjmp.h b/deps/jerry/targets/nuttx-stm32f4/setjmp.h
new file mode 100644 (file)
index 0000000..aad7f93
--- /dev/null
@@ -0,0 +1,25 @@
+/* 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.
+ */
+#ifndef SETJMP_H
+#define SETJMP_H
+
+#include <stdint.h>
+
+typedef uint64_t jmp_buf[14];
+
+int setjmp (jmp_buf env);
+void longjmp (jmp_buf env, int val);
+
+#endif /* !SETJMP_H */
diff --git a/deps/jerry/targets/particle/Makefile.particle b/deps/jerry/targets/particle/Makefile.particle
new file mode 100644 (file)
index 0000000..637b0f1
--- /dev/null
@@ -0,0 +1,78 @@
+# 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.
+
+PARTICLE_FIRMWARE := $(CURDIR)/../particle/firmware
+
+JERRYDIR ?= $(CURDIR)
+JERRYHEAP  ?= 16
+
+BUILD_DIR  ?= $(JERRYDIR)/build/particle
+
+EXT_CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4
+EXT_CFLAGS += -Wno-error=format=
+
+.PHONY: jerrycore jerry-main flash clean
+
+PARTICLE_BUILD_CONFIG = \
+        INCLUDE_DIRS=$(JERRYDIR)/jerry-core/include \
+        LIBS=jerry-core \
+        PLATFORM=photon \
+        LIB_DIRS=$(BUILD_DIR)/lib \
+        APPDIR=$(JERRYDIR)/targets/particle/source \
+        TARGET_FILE=jerry_main \
+        TARGET_DIR=$(BUILD_DIR) \
+        LDFLAGS=--specs=nano.specs
+
+all: jerrycore jerry-main
+
+jerrycore:
+       mkdir -p $(BUILD_DIR)
+       cmake -B$(BUILD_DIR) -H./ \
+        -DJERRY_LIBC=OFF \
+        -DJERRY_LIBM=OFF \
+        -DJERRY_CMDLINE=OFF \
+        -DUNITTESTS=OFF \
+        -DENABLE_LTO=ON \
+        -DFEATURE_PROFILE=minimal \
+        -DCMAKE_TOOLCHAIN_FILE=$(JERRYDIR)/cmake/toolchain_external.cmake \
+        -DENABLE_ALL_IN_ONE=OFF \
+        -DENABLE_STRIP=OFF \
+        -DENABLE_STATIC_LINK=ON \
+        -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=armv7l \
+        -DEXTERNAL_CMAKE_C_COMPILER=arm-none-eabi-gcc \
+        -DEXTERNAL_CMAKE_C_COMPILER_ID=GNU \
+        -DEXTERNAL_COMPILE_FLAGS="$(EXT_CFLAGS)" \
+        -DFEATURE_ERROR_MESSAGES=OFF \
+        -DFEATURE_VALGRIND=OFF \
+        -DFEATURE_VALGRIND_FREYA=OFF \
+        -DFEATURE_CPOINTER_32_BIT=OFF \
+        -DFEATURE_MEM_STRESS_TEST=OFF \
+        -DFEATURE_MEM_STATS=OFF \
+        -DFEATURE_PARSER_DUMP=OFF \
+        -DFEATURE_REGEXP_DUMP=OFF \
+        -DFEATURE_SNAPSHOT_SAVE=OFF \
+        -DFEATURE_SNAPSHOT_EXEC=OFF \
+        -DMEM_HEAP_SIZE_KB=$(JERRYHEAP)
+
+       make -C$(BUILD_DIR) jerry-core
+
+jerry-main: jerrycore
+       $(PARTICLE_BUILD_CONFIG) make -C$(PARTICLE_FIRMWARE) -f $(PARTICLE_FIRMWARE)/makefile
+
+flash:
+       $(PARTICLE_BUILD_CONFIG) make -C$(PARTICLE_FIRMWARE)/main -f $(PARTICLE_FIRMWARE)/main/makefile program-dfu
+
+clean:
+       $(PARTICLE_BUILD_CONFIG) make -C$(PARTICLE_FIRMWARE) -f $(PARTICLE_FIRMWARE)/makefile clean
+       rm -rf $(BUILD_DIR)
diff --git a/deps/jerry/targets/particle/README.md b/deps/jerry/targets/particle/README.md
new file mode 100644 (file)
index 0000000..2472f50
--- /dev/null
@@ -0,0 +1,91 @@
+### About
+
+This folder contains files to run JerryScript beside Particle Device Firmware on Photon board.
+It  runs a mini example, blinking an LED which is the "Hello World" example of the microcontroller universe.
+
+### How to build
+
+#### 1. Preface / Directory structure
+
+Assume `root` as the path to the projects to build.
+The folder tree related would look like this.
+
+```
+root
+  + jerryscript
+  |  + targets
+  |      + particle
+  + particle
+  |  + firmware
+```
+
+
+#### 2, Update/Install the Particle Firmware
+
+For detailed descriptions please visit the official website of the firmware: https://www.particle.io/
+
+You can checkout the firmware with the following command:
+
+```
+# assume you are in root folder
+git clone https://github.com/spark/firmware.git particle/firmware particle/firmware
+````
+
+The Photon’s latest firmware release is hosted in the latest branch of the firmware repo.
+
+```
+# assume you are in root folder
+cd particle/firmware
+git checkout latest
+```
+
+Before you type any commands, put your Photon in DFU mode: hold down both the SETUP and RESET buttons. Then release RESET, but hold SETUP until you see the RGB blink yellow. That means the Photon is in DFU mode. To verify that the Photon is in DFU mode and dfu-util is installed properly, try the dfu-util -l command. You should see the device, and the important parts there are the hex values inside the braces – the USB VID and PID, which should be 2b04 and d006 for the Photon.
+
+To build and flash the firmware: switch to the modules directory then call make with a few parameters to build and upload the firmware:
+
+```
+cd modules
+make PLATFORM=photon clean all program-dfu
+```
+
+#### 3. Build JerryScript
+
+```
+# assume you are in root folder
+cd jerryscript
+make -f ./targets/particle/Makefile.particle
+```
+
+This will create a binary file in the `/build/particle/` folder:
+```
+jerry_main.bin
+```
+
+That’s the binary what we’ll be flashing with dfu-util.
+
+
+#### 4. Flashing
+
+Make sure you put your Photon in DFU mode.
+Alternatively, you can make your life a bit easier by using the make command to invoke dfu-util:
+
+```
+make -f targets/particle/Makefile.particle flash
+```
+
+You can also use this dfu-util command directly to upload your BIN file to the Photon’s application memory:
+
+```
+dfu-util -d 2b04:d006 -a 0 -i 0 -s 0x80A0000:leave -D build/particle/jerry_main.bin
+```
+
+#### 5. Cleaning
+
+To clean the build result:
+```
+make -f targets/particle/Makefile.particle clean
+```
+
+### Running the example
+
+The example program will blinks the D7 led periodically after the flash.
\ No newline at end of file
diff --git a/deps/jerry/targets/particle/source/main.cpp b/deps/jerry/targets/particle/source/main.cpp
new file mode 100644 (file)
index 0000000..f8463c0
--- /dev/null
@@ -0,0 +1,148 @@
+/* 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.
+ */
+
+#include "application.h"
+#include "jerryscript.h"
+
+SYSTEM_MODE (MANUAL);
+
+/**
+ * Set led value
+ */
+static jerry_value_t
+set_led  (const jerry_value_t func_value, /**< function object */
+          const jerry_value_t this_value, /**< this arg */
+          const jerry_value_t *args_p, /**< function arguments */
+          const jerry_length_t args_cnt) /**< number of function arguments */
+{
+  if (args_cnt != 2)
+  {
+    Serial.println ("Wrong arguments count in 'test.setLed' function.");
+    return jerry_create_boolean (false);
+  }
+
+  int ledPin = jerry_get_number_value (args_p[0]);
+  bool value = jerry_get_boolean_value (args_p[1]);
+
+  pinMode (ledPin, OUTPUT);
+  digitalWrite (ledPin, value);
+
+  return jerry_create_boolean (true);
+} /* set_led */
+
+/**
+ * Delay function
+ */
+static jerry_value_t
+js_delay (const jerry_value_t func_value, /**< function object */
+          const jerry_value_t this_value, /**< this arg */
+          const jerry_value_t *args_p, /**< function arguments */
+          const jerry_length_t args_cnt) /**< number of function arguments */
+{
+  if (args_cnt != 1)
+  {
+    Serial.println ("Wrong arguments count in 'test.delay' function.");
+    return jerry_create_boolean (false);
+  }
+
+  int millisec = jerry_get_number_value (args_p[0]);
+
+  delay (millisec);
+
+  return jerry_create_boolean (true);
+} /* js_delay */
+
+/*
+ * Init available js functions
+ */
+static void
+init_jerry ()
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  /* Create an empty JS object */
+  jerry_value_t object = jerry_create_object ();
+
+  jerry_value_t func_obj;
+  jerry_value_t prop_name;
+
+  func_obj = jerry_create_external_function (set_led);
+  prop_name = jerry_create_string ((const jerry_char_t *) "setLed");
+  jerry_set_property (object, prop_name, func_obj);
+  jerry_release_value (prop_name);
+  jerry_release_value (func_obj);
+
+  func_obj = jerry_create_external_function (js_delay);
+  prop_name = jerry_create_string ((const jerry_char_t *) "delay");
+  jerry_set_property (object, prop_name, func_obj);
+  jerry_release_value (prop_name);
+  jerry_release_value (func_obj);
+
+  /* Wrap the JS object (not empty anymore) into a jerry api value */
+  jerry_value_t global_object = jerry_get_global_object ();
+
+  /* Add the JS object to the global context */
+  prop_name = jerry_create_string ((const jerry_char_t *) "test");
+  jerry_set_property (global_object, prop_name, object);
+  jerry_release_value (prop_name);
+  jerry_release_value (object);
+  jerry_release_value (global_object);
+} /* init_jerry */
+
+/**
+ * Jerryscript simple test
+ */
+static void
+test_jerry ()
+{
+  const jerry_char_t script[] = " \
+    test.setLed(7, true); \
+    test.delay(250); \
+    test.setLed(7, false); \
+    test.delay(250); \
+  ";
+
+  size_t script_size = strlen ((const char *) script);
+
+  jerry_value_t eval_ret = jerry_eval (script, script_size, false);
+
+  /* Free JavaScript value, returned by eval */
+  jerry_release_value (eval_ret);
+} /* test_jerry */
+
+/**
+ * Setup code for particle firmware
+ */
+void
+setup ()
+{
+  Serial.begin (9600);
+  delay (2000);
+  Serial.println ("Beginning Listening mode test!");
+} /* setup */
+
+/**
+ * Loop code for particle firmware
+ */
+void
+loop ()
+{
+  init_jerry ();
+
+  /* Turn on and off the D7 LED */
+  test_jerry ();
+
+  jerry_cleanup ();
+} /* loop */
diff --git a/deps/jerry/targets/riot-stm32f4/Makefile b/deps/jerry/targets/riot-stm32f4/Makefile
new file mode 100644 (file)
index 0000000..a1ce808
--- /dev/null
@@ -0,0 +1,50 @@
+# 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.
+
+# application name
+APPLICATION = riot_jerry
+
+# default BOARD enviroment
+BOARD ?= stm32f4discovery
+
+# path to the RIOT base directory
+RIOTBASE ?= $(CURDIR)/../RIOT
+# path to the JERRYSCRIPT directory
+JERRYDIR ?= $(CURDIR)
+
+# path to the application directory
+APPDIR ?= $(JERRYDIR)/targets/riot-stm32f4/source
+
+# path to the binary directory
+BINDIR ?= $(JERRYDIR)/targets/riot-stm32f4/bin/
+
+# Comment this out to disable code in RIOT that does safety checking
+# which is not needed in a production environment but helps in the
+# development process:
+CFLAGS += -DDEVELHELP
+
+# Change this to 0 show compiler invocation lines by default:
+QUIET ?= 1
+
+INCLUDES += -I$(JERRYDIR)/jerry-core/include -I$(JERRYDIR)/jerry-ext/include
+
+# Add the shell and some shell commands
+USEMODULE += shell
+USEMODULE += shell_commands
+
+# Add the jerry libs
+USEMODULE += libjerrycore libjerryport-minimal libjerryext
+
+
+include $(RIOTBASE)/Makefile.include
diff --git a/deps/jerry/targets/riot-stm32f4/Makefile.riot b/deps/jerry/targets/riot-stm32f4/Makefile.riot
new file mode 100644 (file)
index 0000000..99c4afe
--- /dev/null
@@ -0,0 +1,60 @@
+# 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.
+
+BUILD_DIR  ?= build/riotstm32f4
+COPYTARGET ?= targets/riot-stm32f4/bin
+
+JERRYHEAP  ?= 16
+
+EXT_CFLAGS := -D__TARGET_RIOT_STM32F4
+EXT_CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4
+EXT_CFLAGS += -Wno-error=format=
+
+.PHONY: libjerry riot-jerry flash clean
+
+all: libjerry riot-jerry
+
+libjerry:
+       mkdir -p $(BUILD_DIR)
+       mkdir -p $(COPYTARGET)
+       cmake -B$(BUILD_DIR) -H./ \
+        -DENABLE_LTO=OFF \
+        -DFEATURE_VALGRIND=OFF \
+        -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain_external.cmake \
+        -DJERRY_LIBM=OFF \
+        -DJERRY_LIBC=OFF \
+        -DJERRY_CMDLINE=OFF \
+        -DENABLE_ALL_IN_ONE=OFF \
+        -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=armv7l \
+        -DEXTERNAL_CMAKE_C_COMPILER=arm-none-eabi-gcc \
+        -DEXTERNAL_CMAKE_C_COMPILER_ID=GNU \
+        -DEXTERNAL_COMPILE_FLAGS="$(EXT_CFLAGS)" \
+        -DMEM_HEAP_SIZE_KB=$(JERRYHEAP)
+
+       make -C$(BUILD_DIR) jerry-core jerry-port-default-minimal jerry-ext
+       cp $(BUILD_DIR)/lib/libjerry-core.a $(COPYTARGET)/libjerrycore.a
+       cp $(BUILD_DIR)/lib/libjerry-port-default-minimal.a $(COPYTARGET)/libjerryport-minimal.a
+       cp $(BUILD_DIR)/lib/libjerry-ext.a $(COPYTARGET)/libjerryext.a
+
+
+riot-jerry: libjerry
+       make -f ./targets/riot-stm32f4/Makefile
+
+flash: libjerry
+       make -f ./targets/riot-stm32f4/Makefile flash
+
+clean:
+       rm -rf $(COPYTARGET)
+       rm -rf $(BUILD_DIR)
+       make -f ./targets/riot-stm32f4/Makefile clean
diff --git a/deps/jerry/targets/riot-stm32f4/README.md b/deps/jerry/targets/riot-stm32f4/README.md
new file mode 100644 (file)
index 0000000..698d5cd
--- /dev/null
@@ -0,0 +1,96 @@
+### About
+
+This folder contains files to run JerryScript on RIOT-OS with STM32F4-Discovery board.
+
+### How to build
+
+#### 1. Preface
+
+1, Directory structure
+
+Assume `harmony` as the path to the projects to build.
+The folder tree related would look like this.
+
+```
+harmony
+  + jerryscript
+  |  + targets
+  |      + riot-stm32f4
+  + RIOT
+```
+
+2, Target board
+
+Assume [STM32F4-Discovery with BB](http://www.st.com/web/en/catalog/tools/FM116/SC959/SS1532/LN1199/PF255417)
+as the target board.
+
+#### 2. Prepare RIOT-OS
+
+Follow [this](https://www.riot-os.org/#download) page to get the RIOT-OS source.
+
+Follow the [Inroduction](https://github.com/RIOT-OS/RIOT/wiki/Introduction) wiki site and also check that you can flash the stm32f4-board.
+
+
+#### 3. Build JerryScript for RIOT-OS
+
+```
+# assume you are in harmony folder
+cd jerryscript
+make -f ./targets/riot-stm32f4/Makefile.riot
+```
+
+This will generate the following libraries:
+```
+/build/bin/release.riotstm32f4/librelease.jerry-core.a
+/build/bin/release.riotstm32f4/librelease.jerry-libm.lib.a
+```
+
+This will copy one library files to `targets/riot-stm32f4/bin` folder:
+```
+libjerrycore.a
+```
+
+This will create a hex file in the `targets/riot-stm32f4/bin` folder:
+```
+riot_jerry.elf
+```
+
+#### 4. Flashing
+
+```
+make -f ./targets/riot-stm32f4/Makefile.riot flash
+```
+
+For how to flash the image with other alternative way can be found here:
+[Alternative way to flash](https://github.com/RIOT-OS/RIOT/wiki/Board:-STM32F4discovery#alternative-way-to-flash)
+
+#### 5. Cleaning
+
+To clean the build result:
+```
+make -f ./targets/riot-stm32f4/Makefile.riot clean
+```
+
+
+### 5. Running JerryScript Hello World! example
+
+You may have to press `RESET` on the board after the flash.
+
+You can use `minicom` for terminal program, and if the prompt shows like this:
+```
+main(): This is RIOT! (Version: ****)
+                                     You are running RIOT on a(n) stm32f4discovery board.
+                                                                                         This board features a(n) stm32f4 MCU.
+```
+please set `Add Carriage Ret` option by `CTRL-A` > `Z` > `U` at the console, if you're using `minicom`.
+
+
+Help will provide a list of commands:
+```
+> help
+```
+
+The `test` command will run the test example, which contains the following script code:
+```
+print ('Hello, World!');
+```
diff --git a/deps/jerry/targets/riot-stm32f4/source/main-riotos.c b/deps/jerry/targets/riot-stm32f4/source/main-riotos.c
new file mode 100644 (file)
index 0000000..bb77072
--- /dev/null
@@ -0,0 +1,108 @@
+/* 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "shell.h"
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+
+/**
+ * Standalone Jerry exit codes
+ */
+#define JERRY_STANDALONE_EXIT_CODE_OK   (0)
+#define JERRY_STANDALONE_EXIT_CODE_FAIL (1)
+
+/**
+ * Register a JavaScript function in the global object.
+ */
+static void
+register_js_function (const char *name_p, /**< name of the function */
+                      jerry_external_handler_t handler_p) /**< function callback */
+{
+  jerry_value_t result_val = jerryx_handler_register_global ((const jerry_char_t *) name_p, handler_p);
+
+  if (jerry_value_has_error_flag (result_val))
+  {
+    printf ("Warning: failed to register '%s' method.", name_p);
+  }
+
+  jerry_release_value (result_val);
+} /* register_js_function */
+
+/**
+ * Jerryscript simple test
+ */
+int test_jerry (int argc, char **argv)
+{
+  /* Suppress compiler errors */
+  (void) argc;
+  (void) argv;
+
+  jerry_value_t ret_value = jerry_create_undefined ();
+
+  const jerry_char_t script[] = "print ('Hello, World!');";
+  size_t script_size = strlen ((const char *) script);
+  printf ("This test run the following script code: [%s]\n\n", script);
+
+  /* Initialize engine */
+  jerry_init (JERRY_INIT_EMPTY);
+
+  /* Register the print function in the global object. */
+  register_js_function ("print", jerryx_handler_print);
+
+  /* Setup Global scope code */
+  ret_value = jerry_parse (script, script_size, false);
+
+  if (!jerry_value_has_error_flag (ret_value))
+  {
+    /* Execute the parsed source code in the Global scope */
+    ret_value = jerry_run (ret_value);
+  }
+
+  int ret_code = JERRY_STANDALONE_EXIT_CODE_OK;
+
+  if (jerry_value_has_error_flag (ret_value))
+  {
+    printf ("Script Error!");
+
+    ret_code = JERRY_STANDALONE_EXIT_CODE_FAIL;
+  }
+
+  jerry_release_value (ret_value);
+
+  /* Cleanup engine */
+  jerry_cleanup ();
+
+  return ret_code;
+
+} /* test_jerry */
+
+const shell_command_t shell_commands[] = {
+  { "test", "Jerryscript Hello World test", test_jerry },
+  { NULL, NULL, NULL }
+};
+
+int main (void)
+{
+  printf ("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
+  printf ("This board features a(n) %s MCU.\n", RIOT_MCU);
+
+  /* start the shell */
+  char line_buf[SHELL_DEFAULT_BUFSIZE];
+  shell_run (shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE);
+
+  return 0;
+}
diff --git a/deps/jerry/targets/tizenrt-artik05x/Makefile.tizenrt b/deps/jerry/targets/tizenrt-artik05x/Makefile.tizenrt
new file mode 100644 (file)
index 0000000..2b7d8e2
--- /dev/null
@@ -0,0 +1,54 @@
+# 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.
+
+JERRYHEAP      ?= 16
+BUILD_DIR      ?= build/tizenrt-artik05x
+LIBTARGET_DIR  ?= $(abspath $(PWD)/../tizenrt/build/output/libraries)
+
+EXT_CFLAGS += -mcpu=cortex-r4 -mfpu=vfpv3
+EXT_CFLAGS += -fno-builtin -fno-strict-aliasing
+EXT_CFLAGS += -fomit-frame-pointer
+EXT_CFLAGS += -fno-strength-reduce
+EXT_CFLAGS += -Wall -Werror -Wshadow
+EXT_CFLAGS += -Wno-error=conversion
+EXT_CFLAGS += -I. -isystem ../tizenrt/os/include
+
+.PHONY: libjerry clean
+
+all: libjerry
+
+libjerry:
+       mkdir -p $(BUILD_DIR)
+       mkdir -p $(LIBTARGET_DIR)
+       cmake -B$(BUILD_DIR) -H./ \
+        -DENABLE_LTO=OFF \
+        -DFEATURE_VALGRIND=OFF \
+        -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain_external.cmake \
+        -DJERRY_LIBC=OFF \
+        -DJERRY_CMDLINE=OFF \
+        -DENABLE_ALL_IN_ONE=OFF \
+        -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=armv7l \
+        -DEXTERNAL_CMAKE_C_COMPILER=arm-none-eabi-gcc \
+        -DEXTERNAL_CMAKE_C_COMPILER_ID=GNU \
+        -DEXTERNAL_COMPILE_FLAGS="$(EXT_CFLAGS)" \
+        -DMEM_HEAP_SIZE_KB=$(JERRYHEAP) \
+        -DCMAKE_BUILD_TYPE=Release
+
+       make -C$(BUILD_DIR) jerry-core jerry-libm jerry-ext
+       cp $(BUILD_DIR)/lib/libjerry-core.a $(LIBTARGET_DIR)
+       cp $(BUILD_DIR)/lib/libjerry-libm.a $(LIBTARGET_DIR)
+       cp $(BUILD_DIR)/lib/libjerry-ext.a $(LIBTARGET_DIR)
+
+clean:
+       rm -rf $(BUILD_DIR)
diff --git a/deps/jerry/targets/tizenrt-artik05x/README.md b/deps/jerry/targets/tizenrt-artik05x/README.md
new file mode 100644 (file)
index 0000000..debfaa5
--- /dev/null
@@ -0,0 +1,107 @@
+### About
+
+This folder contains files to build and run JerryScript on [TizenRT](https://github.com/Samsung/TizenRT) with Artik05x board.
+
+### How to build
+
+#### 1. Set up build environment
+
+* Install toolchain
+
+Get the build in binaries and libraries, [gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar](https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update).
+
+
+Untar the gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar and export the path like
+
+```
+$ tar xvf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar
+$ export PATH=<Your Toolchain PATH>:$PATH
+```
+
+* Get the jerryscript and TizenRT sources
+
+```
+$ mkdir jerry-tizenrt
+$ cd jerry-tizenrt
+$ git clone https://github.com/jerryscript-project/jerryscript.git
+$ git clone https://github.com/Samsung/TizenRT.git tizenrt
+```
+
+The following directory structure is created after these commands
+
+```
+jerry-tizenrt
+├── jerryscript
+└── tizenrt
+```
+
+#### 2. Add jerryscript configuration for TizenRT
+
+```
+$ cp -r jerryscript/targets/tizenrt-artik05x/apps/jerryscript/ tizenrt/apps/system/
+$ cp -r jerryscript/targets/tizenrt-artik05x/configs/jerryscript/ tizenrt/build/configs/artik053/
+```
+
+Apply following diff in jerry-tizenrt/tizenrt/os/FlatLibs.mk.
+(The line number may differ since tizenrt is under developing.)
+
+```diff
+--- a/os/FlatLibs.mk
++++ b/os/FlatLibs.mk
+@@ -142,6 +142,12 @@ endif
+# Add library for Framework
+TINYARALIBS += $(LIBRARIES_DIR)$(DELIM)libframework$(LIBEXT)
++# Add library for Jerryscript
++ifeq ($(CONFIG_JERRYSCRIPT),y)
++TINYARALIBS += $(LIBRARIES_DIR)$(DELIM)libjerry-core$(LIBEXT)
++TINYARALIBS += $(LIBRARIES_DIR)$(DELIM)libjerry-ext$(LIBEXT)
++TINYARALIBS += $(LIBRARIES_DIR)$(DELIM)libjerry-libm$(LIBEXT)
++endif
++
+# Export all libraries
+```
+
+#### 3. Configure TizenRT
+
+```
+$ cd tizenrt/os/tools
+$ ./configure.sh artik053/jerryscript
+```
+
+#### 4. Build JerryScript for TizenRT
+
+```
+# assuming you are in jerry-tizenrt folder
+$ cd jerryscript
+$ make -f targets/tizenrt-artik05x/Makefile.tizenrt
+```
+
+#### 5. Build TizenRT binary
+
+```
+# assuming you are in jerry-tizenrt folder
+$ cd tizenrt/os
+$ make
+```
+Binaries are available in tizenrt/build/output/bin
+
+#### 6. Flash binary
+
+```
+make download ALL
+```
+
+For more information, see [How to program a binary](https://github.com/Samsung/TizenRT/blob/master/build/configs/artik053/README.md).
+
+
+#### 7. Run JerryScript
+
+You can use `minicom` for terminal program, or any other you may like, but set
+baud rate to `115200`.
+
+(Note: Device path may differ like /dev/ttyUSB1.)
+
+```
+sudo minicom --device=/dev/ttyUSB0 --baud=115200
+```
diff --git a/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/Kconfig b/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/Kconfig
new file mode 100644 (file)
index 0000000..6f8ff36
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config JERRYSCRIPT
+       bool "Jerryscript"
+       default n
+       ---help---
+               Enable Jerryscript ECMAScript 5.1 interpreter
+
+if JERRYSCRIPT
+
+config JERRYSCRIPT_PROGNAME
+       string "Program name"
+       default "jerry"
+       depends on BUILD_KERNEL
+       ---help---
+               This is the name of the program that will be
+                use when the NSH ELF program is installed.
+
+config JERRYSCRIPT_PRIORITY
+       int "Jerryscript task priority"
+       default 100
+
+config JERRYSCRIPT_STACKSIZE
+       int "Jerryscript stack size"
+       default 16384
+
+config JERRYSCRIPT_HEAPSIZE
+       int "Jerryscript heap size"
+       default 107520
+
+config JERRYSCRIPT_ERROR_MESSAGES
+       bool "Enable error messages for builtin error objects"
+       default n
+
+config JERRYSCRIPT_MEM_STATS
+       bool "Enable memory statistics"
+       default n
+
+config JERRYSCRIPT_SHOW_OPCODES
+       bool "Enable parser byte-code dumps"
+       default n
+
+config JERRYSCRIPT_DEBUGGER
+       bool "Jerryscript debugger"
+       default n
+
+if JERRYSCRIPT_DEBUGGER
+config JERRYSCRIPT_DEBUGGER_PORT
+       int "Jerryscript debugger port"
+       default 5001
+endif
+
+endif
diff --git a/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/Make.defs b/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/Make.defs
new file mode 100644 (file)
index 0000000..940e730
--- /dev/null
@@ -0,0 +1,17 @@
+# 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.
+
+ifeq ($(CONFIG_JERRYSCRIPT),y)
+CONFIGURED_APPS += system/jerryscript
+endif
diff --git a/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/Makefile b/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/Makefile
new file mode 100644 (file)
index 0000000..5375159
--- /dev/null
@@ -0,0 +1,178 @@
+# 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.
+
+###########################################################################
+#
+# Copyright 2016 Samsung Electronics All Rights Reserved.
+#
+# 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.
+#
+
+############################################################################
+#
+#   Copyright (C) 2008, 2010-2013 Gregory Nutt. All rights reserved.
+#   Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+#    used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+-include $(TOPDIR)/.config
+-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
+
+# Jerryscript built-in application info
+
+CONFIG_JERRYSCRIPT_PRIORITY ?= SCHED_PRIORITY_DEFAULT
+CONFIG_JERRYSCRIPT_STACKSIZE ?= 32768
+CONFIG_JERRYSCRIPT_HEAPSIZE ?= 64000
+CONFIG_JERRY_DEBUGGER_PORT ?= 5001
+
+APPNAME = jerry
+# path to the project dir, "tizenrt-artik05x" by default
+ROOT_DIR = ../../../..
+PRIORITY = $(CONFIG_JERRYSCRIPT_PRIORITY)
+STACKSIZE = $(CONFIG_JERRYSCRIPT_STACKSIZE)
+CFLAGS += -std=c99 -DJERRY_NDEBUG -DJERRY_JS_PARSER '-DCONFIG_MEM_HEAP_AREA_SIZE=$(CONFIG_JERRYSCRIPT_HEAPSIZE)'
+CFLAGS += -I$(ROOT_DIR)/ $(shell find $(ROOT_DIR)/jerryscript/jerry-core -type d | sed -r -e 's/^/-I/g')
+CFLAGS += -I$(ROOT_DIR)/jerryscript/jerry-ext/include
+
+ifeq ($(CONFIG_JERRYSCRIPT_MEM_STATS),y)
+       CFLAGS += -DJMEM_STATS
+endif
+
+ifeq ($(CONFIG_JERRYSCRIPT_SHOW_OPCODES),y)
+       CFLAGS += -DPARSER_DUMP_BYTE_CODE
+endif
+
+ifeq ($(CONFIG_JERRYSCRIPT_DEBUGGER),y)
+       CFLAGS += -DJERRY_DEBUGGER '-DJERRY_DEBUGGER_PORT=$(CONFIG_JERRY_DEBUGGER_PORT)'
+endif
+
+
+EXTRA_LIBS += libjerry-core.a libjerry-libm.a
+LINKLIBS=$(EXTRA_LIBS)
+
+
+ASRCS = setjmp.S
+CSRCS =
+MAINSRC = jerry_main.c
+
+AOBJS = $(ASRCS:.S=$(OBJEXT))
+COBJS = $(CSRCS:.c=$(OBJEXT))
+MAINOBJ = $(MAINSRC:.c=$(OBJEXT))
+
+SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
+OBJS = $(AOBJS) $(COBJS)
+
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+  OBJS += $(MAINOBJ)
+endif
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+  BIN = ..\..\libapps$(LIBEXT)
+else
+ifeq ($(WINTOOL),y)
+  BIN = ..\\..\\libapps$(LIBEXT)
+else
+  BIN = ../../libapps$(LIBEXT)
+endif
+endif
+
+ifeq ($(WINTOOL),y)
+  INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}"
+else
+  INSTALL_DIR = $(BIN_DIR)
+endif
+
+CONFIG_JERRYSCRIPT_PROGNAME ?= jerry$(EXEEXT)
+PROGNAME = $(CONFIG_JERRYSCRIPT_PROGNAME)
+
+ROOTDEPPATH    = --dep-path .
+
+# Common build
+
+VPATH          =
+
+all:   .built
+.PHONY: context depend clean distclean
+
+$(AOBJS): %$(OBJEXT): %.S
+       $(call ASSEMBLE, $<, $@)
+
+$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c
+       $(call COMPILE, $<, $@)
+
+.built: $(OBJS)
+       $(call ARCHIVE, $(BIN), $(OBJS))
+       $(Q) touch .built
+
+install:
+
+context:
+
+# Create dependencies
+
+.depend: Makefile $(SRCS)
+       $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) touch $@
+
+depend: .depend
+
+clean:
+       $(call DELFILE, .built)
+       $(call CLEAN)
+
+distclean: clean
+       $(call DELFILE, Make.dep)
+       $(call DELFILE, .depend)
+
+-include Make.dep
+.PHONY: preconfig
+preconfig:
diff --git a/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/jerry_main.c b/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/jerry_main.c
new file mode 100644 (file)
index 0000000..42b88f6
--- /dev/null
@@ -0,0 +1,527 @@
+/* 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "jerryscript.h"
+#include "jerryscript-ext/handler.h"
+#include "jerryscript-port.h"
+#include "jmem.h"
+#include "setjmp.h"
+
+#include <apps/shell/tash.h> // To register tash command
+
+/**
+ * Maximum command line arguments number.
+ */
+#define JERRY_MAX_COMMAND_LINE_ARGS (16)
+
+/**
+ * Standalone Jerry exit codes.
+ */
+#define JERRY_STANDALONE_EXIT_CODE_OK   (0)
+#define JERRY_STANDALONE_EXIT_CODE_FAIL (1)
+
+/**
+ * Context size of the SYNTAX_ERROR
+ */
+#define SYNTAX_ERROR_CONTEXT_SIZE 2
+
+/**
+ * Print usage and available options
+ */
+static void
+print_help (char *name)
+{
+  printf ("Usage: %s [OPTION]... [FILE]...\n"
+          "\n"
+          "Options:\n"
+          "  --log-level [0-3]\n"
+          "  --mem-stats\n"
+          "  --mem-stats-separate\n"
+          "  --show-opcodes\n"
+          "  --start-debug-server\n"
+          "\n",
+          name);
+} /* print_help */
+
+/**
+ * Read source code into buffer.
+ *
+ * Returned value must be freed with jmem_heap_free_block if it's not NULL.
+ * @return NULL, if read or allocation has failed
+ *         pointer to the allocated memory block, otherwise
+ */
+static const uint8_t *
+read_file (const char *file_name, /**< source code */
+           size_t *out_size_p) /**< [out] number of bytes successfully read from source */
+{
+  FILE *file = fopen (file_name, "r");
+  if (file == NULL)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: cannot open file: %s\n", file_name);
+    return NULL;
+  }
+
+  int fseek_status = fseek (file, 0, SEEK_END);
+  if (fseek_status != 0)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Failed to seek (error: %d)\n", fseek_status);
+    fclose (file);
+    return NULL;
+  }
+
+  long script_len = ftell (file);
+  if (script_len < 0)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Failed to get the file size(error %ld)\n", script_len);
+    fclose (file);
+    return NULL;
+  }
+
+  rewind (file);
+
+  uint8_t *buffer = jmem_heap_alloc_block_null_on_error (script_len);
+
+  if (buffer == NULL)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Out of memory error\n");
+    fclose (file);
+    return NULL;
+  }
+
+  size_t bytes_read = fread (buffer, 1u, script_len, file);
+
+  if (!bytes_read || bytes_read != script_len)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: failed to read file: %s\n", file_name);
+    jmem_heap_free_block ((void*) buffer, script_len);
+
+    fclose (file);
+    return NULL;
+  }
+
+  fclose (file);
+
+  *out_size_p = bytes_read;
+  return (const uint8_t *) buffer;
+} /* read_file */
+
+/**
+ * Check whether an error is a SyntaxError or not
+ *
+ * @return true - if param is SyntaxError
+ *         false - otherwise
+ */
+static bool
+jerry_value_is_syntax_error (jerry_value_t error_value) /**< error value */
+{
+  assert (jerry_is_feature_enabled (JERRY_FEATURE_ERROR_MESSAGES));
+
+  if (!jerry_value_is_object (error_value))
+  {
+    return false;
+  }
+
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *)"name");
+  jerry_value_t error_name = jerry_get_property (error_value, prop_name);
+  jerry_release_value (prop_name);
+
+  if (jerry_value_has_error_flag (error_name)
+      || !jerry_value_is_string (error_name))
+  {
+    return false;
+  }
+
+  jerry_size_t err_str_size = jerry_get_string_size (error_name);
+  jerry_char_t err_str_buf[err_str_size];
+
+  jerry_size_t sz = jerry_string_to_char_buffer (error_name, err_str_buf, err_str_size);
+  jerry_release_value (error_name);
+
+  if (sz == 0)
+  {
+    return false;
+  }
+
+  if (!strcmp ((char *) err_str_buf, "SyntaxError"))
+  {
+    return true;
+  }
+
+  return false;
+} /* jerry_value_is_syntax_error */
+
+/**
+ * Print error value
+ */
+static void
+print_unhandled_exception (jerry_value_t error_value, /**< error value */
+                           const jerry_char_t *source_p) /**< source_p */
+{
+  assert (jerry_value_has_error_flag (error_value));
+
+  jerry_value_clear_error_flag (&error_value);
+  jerry_value_t err_str_val = jerry_value_to_string (error_value);
+  jerry_size_t err_str_size = jerry_get_string_size (err_str_val);
+  jerry_char_t err_str_buf[256];
+
+  if (err_str_size >= 256)
+  {
+    const char msg[] = "[Error message too long]";
+    err_str_size = sizeof (msg) / sizeof (char) - 1;
+    memcpy (err_str_buf, msg, err_str_size);
+  }
+  else
+  {
+    jerry_size_t sz = jerry_string_to_char_buffer (err_str_val, err_str_buf, err_str_size);
+    assert (sz == err_str_size);
+    err_str_buf[err_str_size] = 0;
+
+    if (jerry_is_feature_enabled (JERRY_FEATURE_ERROR_MESSAGES) && jerry_value_is_syntax_error (error_value))
+    {
+      unsigned int err_line = 0;
+      unsigned int err_col = 0;
+
+      /* 1. parse column and line information */
+      for (jerry_size_t i = 0; i < sz; i++)
+      {
+        if (!strncmp ((char *) (err_str_buf + i), "[line: ", 7))
+        {
+          i += 7;
+
+          char num_str[8];
+          unsigned int j = 0;
+
+          while (i < sz && err_str_buf[i] != ',')
+          {
+            num_str[j] = (char) err_str_buf[i];
+            j++;
+            i++;
+          }
+          num_str[j] = '\0';
+
+          err_line = (unsigned int) strtol (num_str, NULL, 10);
+
+          if (strncmp ((char *) (err_str_buf + i), ", column: ", 10))
+          {
+            break; /* wrong position info format */
+          }
+
+          i += 10;
+          j = 0;
+
+          while (i < sz && err_str_buf[i] != ']')
+          {
+            num_str[j] = (char) err_str_buf[i];
+            j++;
+            i++;
+          }
+          num_str[j] = '\0';
+
+          err_col = (unsigned int) strtol (num_str, NULL, 10);
+          break;
+        }
+      } /* for */
+
+      if (err_line != 0 && err_col != 0)
+      {
+        unsigned int curr_line = 1;
+
+        bool is_printing_context = false;
+        unsigned int pos = 0;
+
+        /* 2. seek and print */
+        while (source_p[pos] != '\0')
+        {
+          if (source_p[pos] == '\n')
+          {
+            curr_line++;
+          }
+
+          if (err_line < SYNTAX_ERROR_CONTEXT_SIZE
+              || (err_line >= curr_line
+                  && (err_line - curr_line) <= SYNTAX_ERROR_CONTEXT_SIZE))
+          {
+            /* context must be printed */
+            is_printing_context = true;
+          }
+
+          if (curr_line > err_line)
+          {
+            break;
+          }
+
+          if (is_printing_context)
+          {
+            jerry_port_log (JERRY_LOG_LEVEL_ERROR, "%c", source_p[pos]);
+          }
+
+          pos++;
+        }
+
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "\n");
+
+        while (--err_col)
+        {
+          jerry_port_log (JERRY_LOG_LEVEL_ERROR, "~");
+        }
+
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "^\n");
+      }
+    }
+  }
+
+  jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Script Error: %s\n", err_str_buf);
+  jerry_release_value (err_str_val);
+} /* print_unhandled_exception */
+
+/**
+ * Register a JavaScript function in the global object.
+ */
+static void
+register_js_function (const char *name_p, /**< name of the function */
+                      jerry_external_handler_t handler_p) /**< function callback */
+{
+  jerry_value_t result_val = jerryx_handler_register_global ((const jerry_char_t *) name_p, handler_p);
+
+  if (jerry_value_has_error_flag (result_val))
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_WARNING, "Warning: failed to register '%s' method.", name_p);
+  }
+
+  jerry_release_value (result_val);
+} /* register_js_function */
+
+/**
+ * JerryScript log level
+ */
+static jerry_log_level_t jerry_log_level = JERRY_LOG_LEVEL_ERROR;
+
+/**
+ * Main program.
+ *
+ * @return 0 if success, error code otherwise
+ */
+#ifdef CONFIG_BUILD_KERNEL
+int main (int argc, FAR char *argv[])
+#else
+int jerry_main (int argc, char *argv[])
+#endif
+{
+  if (argc > JERRY_MAX_COMMAND_LINE_ARGS)
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_ERROR,
+                    "Too many command line arguments. Current maximum is %d\n",
+                    JERRY_MAX_COMMAND_LINE_ARGS);
+
+    return JERRY_STANDALONE_EXIT_CODE_FAIL;
+  }
+
+  const char *file_names[JERRY_MAX_COMMAND_LINE_ARGS];
+  int i;
+  int files_counter = 0;
+
+  jerry_init_flag_t flags = JERRY_INIT_EMPTY;
+
+  for (i = 1; i < argc; i++)
+  {
+    if (!strcmp ("-h", argv[i]) || !strcmp ("--help", argv[i]))
+    {
+      print_help (argv[0]);
+      return JERRY_STANDALONE_EXIT_CODE_OK;
+    }
+    else if (!strcmp ("--mem-stats", argv[i]))
+    {
+      jerry_log_level = JERRY_LOG_LEVEL_DEBUG;
+      flags |= JERRY_INIT_MEM_STATS;
+    }
+    else if (!strcmp ("--mem-stats-separate", argv[i]))
+    {
+      jerry_log_level = JERRY_LOG_LEVEL_DEBUG;
+      flags |= JERRY_INIT_MEM_STATS_SEPARATE;
+    }
+    else if (!strcmp ("--show-opcodes", argv[i]))
+    {
+      jerry_log_level = JERRY_LOG_LEVEL_DEBUG;
+      flags |= JERRY_INIT_SHOW_OPCODES | JERRY_INIT_SHOW_REGEXP_OPCODES;
+    }
+    else if (!strcmp ("--log-level", argv[i]))
+    {
+      if (++i < argc && strlen (argv[i]) == 1 && argv[i][0] >='0' && argv[i][0] <= '3')
+      {
+        jerry_log_level = argv[i][0] - '0';
+      }
+      else
+      {
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: wrong format or invalid argument\n");
+        return JERRY_STANDALONE_EXIT_CODE_FAIL;
+      }
+    }
+    else if (!strcmp ("--start-debug-server", argv[i]))
+    {
+      flags |= JERRY_INIT_DEBUGGER;
+    }
+    else
+    {
+      file_names[files_counter++] = argv[i];
+    }
+  }
+
+  jerry_init (flags);
+
+  register_js_function ("assert", jerryx_handler_assert);
+  register_js_function ("gc", jerryx_handler_gc);
+  register_js_function ("print", jerryx_handler_print);
+
+  jerry_value_t ret_value = jerry_create_undefined ();
+
+  if (files_counter == 0)
+  {
+    printf ("No input files, running a hello world demo:\n");
+    const jerry_char_t script[] = "var str = 'Hello World'; print(str + ' from JerryScript')";
+    size_t script_size = strlen ((const char *) script);
+
+    ret_value = jerry_parse (script, script_size, false);
+
+    if (!jerry_value_has_error_flag (ret_value))
+    {
+      ret_value = jerry_run (ret_value);
+    }
+  }
+  else
+  {
+    for (i = 0; i < files_counter; i++)
+    {
+      size_t source_size;
+      const jerry_char_t *source_p = read_file (file_names[i], &source_size);
+
+      if (source_p == NULL)
+      {
+        jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Source file load error\n");
+        return JERRY_STANDALONE_EXIT_CODE_FAIL;
+      }
+
+      ret_value = jerry_parse_named_resource ((jerry_char_t *) file_names[i],
+                                              strlen (file_names[i]),
+                                              source_p,
+                                              source_size,
+                                              false);
+
+      if (!jerry_value_has_error_flag (ret_value))
+      {
+        jerry_value_t func_val = ret_value;
+        ret_value = jerry_run (func_val);
+        jerry_release_value (func_val);
+      }
+
+      if (jerry_value_has_error_flag (ret_value))
+      {
+        print_unhandled_exception (ret_value, source_p);
+        jmem_heap_free_block ((void*) source_p, source_size);
+
+        break;
+      }
+
+      jmem_heap_free_block ((void*) source_p, source_size);
+
+      jerry_release_value (ret_value);
+      ret_value = jerry_create_undefined ();
+    }
+  }
+
+  int ret_code = JERRY_STANDALONE_EXIT_CODE_OK;
+
+  if (jerry_value_has_error_flag (ret_value))
+  {
+    ret_code = JERRY_STANDALONE_EXIT_CODE_FAIL;
+  }
+
+  jerry_release_value (ret_value);
+  jerry_cleanup ();
+
+  return ret_code;
+} /* main */
+
+/**
+ * Aborts the program.
+ */
+void jerry_port_fatal (jerry_fatal_code_t code)
+{
+  exit (1);
+} /* jerry_port_fatal */
+
+/**
+ * Provide log message implementation for the engine.
+ */
+void
+jerry_port_log (jerry_log_level_t level, /**< log level */
+                const char *format, /**< format string */
+                ...)  /**< parameters */
+{
+  if (level <= jerry_log_level)
+  {
+    va_list args;
+    va_start (args, format);
+    vfprintf (stderr, format, args);
+    va_end (args);
+  }
+} /* jerry_port_log */
+
+/**
+ * Dummy function to get the time zone.
+ *
+ * @return true
+ */
+bool
+jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
+{
+  /* We live in UTC. */
+  tz_p->offset = 0;
+  tz_p->daylight_saving_time = 0;
+
+  return true;
+} /* jerry_port_get_time_zone */
+
+/**
+ * Dummy function to get the current time.
+ *
+ * @return 0
+ */
+double
+jerry_port_get_current_time (void)
+{
+  return 0;
+} /* jerry_port_get_current_time */
+
+/**
+ * Provide the implementation of jerryx_port_handler_print_char.
+ * Uses 'printf' to print a single character to standard output.
+ */
+void
+jerryx_port_handler_print_char (char c) /**< the character to print */
+{
+  printf ("%c", c);
+} /* jerryx_port_handler_print_char */
+
+int
+jerry_register_cmd (void) {
+  const tash_cmdlist_t tash_cmds[] 
+      = { { "jerry", jerry_main, TASH_EXECMD_SYNC }, { 0, 0, 0 } };
+  tash_cmdlist_install(tash_cmds);
+  return 0;
+}
diff --git a/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/setjmp.S b/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/setjmp.S
new file mode 100644 (file)
index 0000000..a5a0a5f
--- /dev/null
@@ -0,0 +1,63 @@
+/* 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.
+ */
+
+.syntax unified
+
+.macro func _name
+.global \_name
+.type \_name, %function
+\_name:
+.endm
+.macro endfunc _name
+.size \_name, .-\_name
+.endm
+
+/**
+ * setjmp (jmp_buf env)
+ *
+ * See also:
+ *          longjmp
+ *
+ * @return 0 - if returns from direct call,
+ *         nonzero - if returns after longjmp.
+ */
+func setjmp
+  stmia r0!, {r4 - r11, lr}
+  str sp, [r0], #4
+  mov r0, #0
+  bx lr
+endfunc setjmp
+
+/**
+ * longjmp (jmp_buf env, int val)
+ *
+ * Note:
+ *      if val is not 0, then it would be returned from setjmp,
+ *      otherwise - 0 would be returned.
+ *
+ * See also:
+ *          setjmp
+ */
+func longjmp
+  ldmia r0!, {r4 - r11, lr}
+  ldr sp, [r0]
+  add r0, r0, #4
+  mov r0, r1
+  cmp r0, #0
+  bne 1f
+  mov r0, #1
+  1:
+  bx lr
+endfunc longjmp
diff --git a/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/setjmp.h b/deps/jerry/targets/tizenrt-artik05x/apps/jerryscript/setjmp.h
new file mode 100644 (file)
index 0000000..aad7f93
--- /dev/null
@@ -0,0 +1,25 @@
+/* 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.
+ */
+#ifndef SETJMP_H
+#define SETJMP_H
+
+#include <stdint.h>
+
+typedef uint64_t jmp_buf[14];
+
+int setjmp (jmp_buf env);
+void longjmp (jmp_buf env, int val);
+
+#endif /* !SETJMP_H */
diff --git a/deps/jerry/targets/tizenrt-artik05x/configs/jerryscript/Make.defs b/deps/jerry/targets/tizenrt-artik05x/configs/jerryscript/Make.defs
new file mode 100644 (file)
index 0000000..97855af
--- /dev/null
@@ -0,0 +1,177 @@
+############################################################################
+# 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.
+#
+# This file is based on work under the following copyright and permission
+# notice:
+#
+############################################################################
+# Copyright 2017 Samsung Electronics All Rights Reserved.
+#
+# 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.
+#
+############################################################################
+############################################################################
+# configs/artik053/tash/Make.defs
+#
+#   Copyright (C) 2011, 2012-2013 Gregory Nutt. All rights reserved.
+#   Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+#    used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+include ${TOPDIR}/tools/Config.mk
+include ${TOPDIR}/arch/arm/src/armv7-r/Toolchain.defs
+
+LDSCRIPT = flash.ld
+
+ifeq ($(CONFIG_UCLIBCXX_HAVE_LIBSUPCXX),y)
+LIBSUPXX = ${shell $(CC) --print-file-name=libsupc++.a}
+EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}"
+EXTRA_LIBS = -lsupc++
+endif
+
+ifeq ($(WINTOOL),y)
+  # Windows-native toolchains
+  DIRLINK = $(TOPDIR)/tools/copydir.sh
+  DIRUNLINK = $(TOPDIR)/tools/unlink.sh
+  MKDEP = $(TOPDIR)/tools/mkwindeps.sh
+  ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
+  ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" -isystem "${shell cygpath -w $(TOPDIR)/include/uClibc++}"
+  ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
+else
+  # Linux/Cygwin-native toolchain
+  MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
+  ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/../framework/include
+  ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx -isystem $(TOPDIR)/include/uClibc++
+  ARCHSCRIPT = -T$(TOPDIR)/../build/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
+
+endif
+
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
+ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
+ARCHCCMINOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f2}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+  ARCHOPTIMIZATION = -g
+endif
+
+ifneq ($(CONFIG_DEBUG_NOOPT),y)
+  ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
+endif
+
+ifeq ($(CONFIG_FRAME_POINTER),y)
+  ARCHOPTIMIZATION += -fno-omit-frame-pointer -mapcs -mno-sched-prolog
+endif
+
+ARCHCFLAGS = -fno-builtin -mcpu=cortex-r4 -mfpu=vfpv3
+ARCHCXXFLAGS = -fno-builtin -fexceptions -mcpu=cortex-r4 -mfpu=vfpv3
+ifeq ($(QUICKBUILD),y)
+ARCHWARNINGS = -Wall -Werror -Wstrict-prototypes -Wshadow -Wundef -Wno-implicit-function-declaration -Wno-unused-function -Wno-unused-but-set-variable
+ARCHWARNINGSXX = -Wall -Werror -Wshadow -Wundef
+else
+ARCHWARNINGS = -Wall -Werror -Wstrict-prototypes -Wshadow -Wundef -Wno-implicit-function-declaration -Wno-unused-function -Wno-unused-but-set-variable
+ARCHWARNINGSXX = -Wall -Werror -Wshadow -Wundef
+# only version 4.9 supports color diagnostics
+ifeq "$(ARCHMAJOR)" "4"
+ifeq "$(ARCHMINOR)" "9"
+  ARCHWARNINGS += -fdiagnostics-color=auto
+  ARCHWARNINGSCC += -fdiagnostics-color=auto
+endif
+endif
+
+endif
+ARCHDEFINES =
+ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
+
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -ffunction-sections -fdata-sections
+CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+NXFLATLDFLAGS1 = -r -d -warn-common
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
+LDNXFLATFLAGS = -e main -s 2048
+
+ASMEXT = .S
+OBJEXT = .o
+LIBEXT = .a
+EXEEXT =
+
+ifneq ($(CROSSDEV),arm-nuttx-elf-)
+  LDFLAGS += -nostartfiles -nodefaultlibs
+endif
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+  LDFLAGS += -g
+endif
+
+LDFLAAGS += --gc-sections
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
+HOSTLDFLAGS =
+
+define DOWNLOAD
+       @$(TOPDIR)/../build/configs/artik053/artik053_download.sh $(1)
+endef
+
diff --git a/deps/jerry/targets/tizenrt-artik05x/configs/jerryscript/defconfig b/deps/jerry/targets/tizenrt-artik05x/configs/jerryscript/defconfig
new file mode 100644 (file)
index 0000000..e592c37
--- /dev/null
@@ -0,0 +1,884 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# TinyAra Configuration
+#
+
+#
+# Build Setup
+#
+# CONFIG_EXPERIMENTAL is not set
+# CONFIG_DEFAULT_SMALL is not set
+CONFIG_HOST_LINUX=y
+# CONFIG_HOST_OSX is not set
+# CONFIG_HOST_WINDOWS is not set
+# CONFIG_HOST_OTHER is not set
+# CONFIG_WINDOWS_NATIVE is not set
+
+#
+# Build Configuration
+#
+CONFIG_APPS_DIR="../apps"
+CONFIG_FRAMEWORK_DIR="../framework"
+CONFIG_TOOLS_DIR="../tools"
+CONFIG_BUILD_FLAT=y
+# CONFIG_BUILD_PROTECTED is not set
+# CONFIG_BUILD_2PASS is not set
+
+#
+# Binary Output Formats
+#
+# CONFIG_INTELHEX_BINARY is not set
+# CONFIG_MOTOROLA_SREC is not set
+CONFIG_RAW_BINARY=y
+CONFIG_SAMSUNG_NS2=y
+# CONFIG_UBOOT_UIMAGE is not set
+# CONFIG_DOWNLOAD_IMAGE is not set
+# CONFIG_SMARTFS_IMAGE is not set
+
+#
+# Customize Header Files
+#
+# CONFIG_ARCH_STDINT_H is not set
+# CONFIG_ARCH_STDBOOL_H is not set
+# CONFIG_ARCH_MATH_H is not set
+# CONFIG_ARCH_FLOAT_H is not set
+# CONFIG_ARCH_STDARG_H is not set
+
+#
+# Debug Options
+#
+CONFIG_DEBUG=y
+CONFIG_DEBUG_ERROR=y
+# CONFIG_DEBUG_WARN is not set
+CONFIG_DEBUG_VERBOSE=y
+
+#
+# Subsystem Debug Options
+#
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_LIB is not set
+# CONFIG_DEBUG_MM is not set
+# CONFIG_DEBUG_SCHED is not set
+
+#
+# SLSI WLAN Debug Options
+#
+
+#
+# OS Function Debug Options
+#
+# CONFIG_ARCH_HAVE_HEAPCHECK is not set
+CONFIG_DEBUG_MM_HEAPINFO=y
+# CONFIG_DEBUG_IRQ is not set
+
+#
+# Driver Debug Options
+#
+# CONFIG_DEBUG_PWM is not set
+# CONFIG_DEBUG_RTC is not set
+# CONFIG_DEBUG_SPI is not set
+# CONFIG_DEBUG_WATCHDOG is not set
+# CONFIG_DEBUG_TTRACE is not set
+
+#
+# Stack Debug Options
+#
+CONFIG_ARCH_HAVE_STACKCHECK=y
+CONFIG_STACK_COLORATION=y
+
+#
+# Build Debug Options
+#
+CONFIG_DEBUG_SYMBOLS=y
+# CONFIG_FRAME_POINTER is not set
+CONFIG_ARCH_HAVE_CUSTOMOPT=y
+# CONFIG_DEBUG_NOOPT is not set
+# CONFIG_DEBUG_CUSTOMOPT is not set
+CONFIG_DEBUG_FULLOPT=y
+
+#
+# Chip Selection
+#
+CONFIG_ARCH_ARM=y
+CONFIG_ARCH="arm"
+
+#
+# ARM Options
+#
+CONFIG_ARCH_CHIP_S5J=y
+# CONFIG_ARCH_CORTEXM3 is not set
+# CONFIG_ARCH_CORTEXM4 is not set
+CONFIG_ARCH_CORTEXR4=y
+CONFIG_ARCH_FAMILY="armv7-r"
+CONFIG_ARCH_CHIP="s5j"
+# CONFIG_ARCH_HAVE_FPU is not set
+CONFIG_ARMV7M_MPU=y
+CONFIG_ARMV7M_MPU_NREGIONS=12
+
+#
+# Exception stack options
+#
+CONFIG_ARCH_HAVE_DABORTSTACK=y
+CONFIG_ARCH_DABORTSTACK=0
+
+#
+# ARMv7-R Configuration Options
+#
+CONFIG_ARMV7R_HAVE_GICv2=y
+CONFIG_ARMV7R_MEMINIT=y
+CONFIG_ARMV7R_ICACHE=y
+CONFIG_ARMV7R_DCACHE=y
+# CONFIG_ARMV7R_DCACHE_WRITETHROUGH is not set
+# CONFIG_ARMV7R_HAVE_L2CC is not set
+# CONFIG_ARMV7R_HAVE_L2CC_PL310 is not set
+# CONFIG_ARMV7R_TOOLCHAIN_BUILDROOT is not set
+# CONFIG_ARMV7R_TOOLCHAIN_CODESOURCERYL is not set
+CONFIG_ARMV7R_TOOLCHAIN_GNU_EABIL=y
+# CONFIG_ARMV7R_TOOLCHAIN_GNU_OABI is not set
+# CONFIG_ARMV7R_HAVE_DECODEFIQ is not set
+# CONFIG_BOOT_RESULT is not set
+
+#
+# S5J Configuration Options
+#
+CONFIG_ARCH_CHIP_S5JT200=y
+CONFIG_S5J_S5JT200=y
+
+#
+# S5J Peripheral Support
+#
+CONFIG_S5J_HAVE_ADC=y
+CONFIG_S5J_HAVE_I2C=y
+CONFIG_S5J_HAVE_MCT=y
+CONFIG_S5J_HAVE_PWM0=y
+CONFIG_S5J_HAVE_PWM1=y
+CONFIG_S5J_HAVE_PWM2=y
+CONFIG_S5J_HAVE_PWM3=y
+CONFIG_S5J_HAVE_PWM4=y
+CONFIG_S5J_HAVE_PWM5=y
+CONFIG_S5J_HAVE_PWR=y
+CONFIG_S5J_HAVE_RTC=y
+CONFIG_S5J_HAVE_SFLASH=y
+CONFIG_S5J_HAVE_SPI=y
+CONFIG_S5J_HAVE_SSS=y
+CONFIG_S5J_HAVE_UART0=y
+CONFIG_S5J_HAVE_UART1=y
+CONFIG_S5J_HAVE_UART2=y
+CONFIG_S5J_HAVE_UART3=y
+CONFIG_S5J_HAVE_UART4=y
+CONFIG_S5J_HAVE_WATCHDOG=y
+# CONFIG_S5J_ADC is not set
+CONFIG_S5J_I2C=y
+# CONFIG_S5J_MCT is not set
+# CONFIG_S5J_TIMER0 is not set
+# CONFIG_S5J_TIMER1 is not set
+# CONFIG_S5J_TIMER2 is not set
+# CONFIG_S5J_TIMER3 is not set
+# CONFIG_S5J_UART_FLOWCONTROL is not set
+CONFIG_S5J_UART0=y
+CONFIG_S5J_UART1=y
+CONFIG_S5J_UART2=y
+# CONFIG_S5J_UART2_FLOWCONTROL is not set
+CONFIG_S5J_UART3=y
+# CONFIG_S5J_UART3_FLOWCONTROL is not set
+CONFIG_S5J_UART4=y
+# CONFIG_S5J_PWM is not set
+# CONFIG_S5J_PWM0 is not set
+# CONFIG_S5J_PWM1 is not set
+# CONFIG_S5J_PWM2 is not set
+# CONFIG_S5J_PWM3 is not set
+# CONFIG_S5J_PWM4 is not set
+# CONFIG_S5J_PWM5 is not set
+# CONFIG_S5J_SSS is not set
+CONFIG_S5J_SPI=y
+# CONFIG_S5J_WATCHDOG is not set
+CONFIG_S5J_SFLASH=y
+CONFIG_S5J_PWR=y
+
+#
+# PMU Configuration
+#
+# CONFIG_S5J_PWR_DSTOP is not set
+# CONFIG_S5J_PWR_SLEEP is not set
+
+#
+# Architecture Options
+#
+# CONFIG_ARCH_NOINTC is not set
+# CONFIG_ARCH_VECNOTIRQ is not set
+# CONFIG_ARCH_DMA is not set
+# CONFIG_ARCH_HAVE_IRQPRIO is not set
+# CONFIG_ARCH_L2CACHE is not set
+# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set
+# CONFIG_ARCH_HAVE_ADDRENV is not set
+# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set
+CONFIG_ARCH_HAVE_VFORK=y
+# CONFIG_ARCH_HAVE_MMU is not set
+CONFIG_ARCH_HAVE_MPU=y
+# CONFIG_ARCH_NAND_HWECC is not set
+# CONFIG_ARCH_HAVE_EXTCLK is not set
+# CONFIG_ARCH_HAVE_POWEROFF is not set
+CONFIG_ARCH_HAVE_RESET=y
+CONFIG_ARCH_USE_MPU=y
+# CONFIG_ARCH_STACKDUMP is not set
+# CONFIG_ENDIAN_BIG is not set
+# CONFIG_ARCH_IDLE_CUSTOM is not set
+# CONFIG_ARCH_HAVE_RAMFUNCS is not set
+# CONFIG_ARCH_HAVE_RAMVECTORS is not set
+
+#
+# Board Settings
+#
+CONFIG_BOARD_LOOPSPERMSEC=29100
+# CONFIG_ARCH_CALIBRATION is not set
+
+#
+# Interrupt options
+#
+CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
+CONFIG_ARCH_INTERRUPTSTACK=0
+# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set
+
+#
+# Boot options
+#
+# CONFIG_BOOT_RUNFROMEXTSRAM is not set
+CONFIG_BOOT_RUNFROMFLASH=y
+# CONFIG_BOOT_RUNFROMISRAM is not set
+# CONFIG_BOOT_RUNFROMSDRAM is not set
+# CONFIG_BOOT_COPYTORAM is not set
+
+#
+# Boot Memory Configuration
+#
+CONFIG_RAM_START=0x02023800
+CONFIG_RAM_SIZE=804864
+# CONFIG_ARCH_HAVE_SDRAM is not set
+
+#
+# Board Selection
+#
+CONFIG_ARCH_BOARD_ARTIK053=y
+# CONFIG_ARCH_BOARD_SIDK_S5JT200 is not set
+CONFIG_ARCH_BOARD="artik053"
+
+#
+# Common Board Options
+#
+# CONFIG_BOARD_CRASHDUMP is not set
+CONFIG_LIB_BOARDCTL=y
+CONFIG_BOARDCTL_RESET=y
+# CONFIG_BOARDCTL_UNIQUEID is not set
+# CONFIG_BOARD_COREDUMP_FLASH is not set
+# CONFIG_BOARD_FOTA_SUPPORT is not set
+# CONFIG_BOARD_RAMDUMP_FLASH is not set
+# CONFIG_BOARD_RAMDUMP_UART is not set
+
+#
+# Board-Specific Options
+#
+CONFIG_ARTIK053_BOOT_FAILURE_DETECTION=y
+CONFIG_ARTIK053_BOOT_COUNTS_ADDR=0x80090810
+CONFIG_ARTIK053_FLASH_CAPACITY=8388608
+CONFIG_ARTIK053_FLASH_PAGE_SIZE=4096
+CONFIG_ARTIK053_FLASH_PART=y
+CONFIG_ARTIK053_FLASH_MINOR=0
+CONFIG_ARTIK053_FLASH_PART_LIST="16,48,192,32,512,2400,1536,1536,1400,8,512,"
+CONFIG_ARTIK053_FLASH_PART_TYPE="none,ftl,none,none,none,none,none,ftl,smartfs,config,none,"
+CONFIG_ARTIK053_FLASH_PART_NAME="bl1,sssro,bl2,sssfw,wlanfw,os,factory,ota,user,nvram,sssrw,"
+CONFIG_ARTIK053_AUTOMOUNT=y
+CONFIG_ARTIK053_AUTOMOUNT_USERFS=y
+CONFIG_ARTIK053_AUTOMOUNT_USERFS_DEVNAME="/dev/smart0p8"
+CONFIG_ARTIK053_AUTOMOUNT_USERFS_MOUNTPOINT="/mnt"
+
+#
+# RTOS Features
+#
+CONFIG_DISABLE_OS_API=y
+# CONFIG_DISABLE_POSIX_TIMERS is not set
+# CONFIG_DISABLE_PTHREAD is not set
+# CONFIG_DISABLE_SIGNALS is not set
+# CONFIG_DISABLE_MQUEUE is not set
+# CONFIG_DISABLE_ENVIRON is not set
+
+#
+# Clocks and Timers
+#
+CONFIG_ARCH_HAVE_TICKLESS=y
+# CONFIG_SCHED_TICKLESS is not set
+CONFIG_USEC_PER_TICK=9979
+CONFIG_SYSTEM_TIME64=y
+CONFIG_CLOCK_MONOTONIC=y
+# CONFIG_JULIAN_TIME is not set
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_WDOG_INTRESERVE=4
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# Tasks and Scheduling
+#
+CONFIG_INIT_ENTRYPOINT=y
+CONFIG_RR_INTERVAL=100
+CONFIG_TASK_NAME_SIZE=31
+CONFIG_MAX_TASKS=16
+CONFIG_SCHED_HAVE_PARENT=y
+# CONFIG_SCHED_CHILD_STATUS is not set
+CONFIG_SCHED_WAITPID=y
+
+#
+# Pthread Options
+#
+CONFIG_PTHREAD_MUTEX_TYPES=y
+# CONFIG_PTHREAD_MUTEX_ROBUST is not set
+CONFIG_PTHREAD_MUTEX_UNSAFE=y
+# CONFIG_PTHREAD_MUTEX_BOTH is not set
+CONFIG_NPTHREAD_KEYS=4
+# CONFIG_PTHREAD_CLEANUP is not set
+# CONFIG_CANCELLATION_POINTS is not set
+
+#
+# Performance Monitoring
+#
+# CONFIG_SCHED_CPULOAD is not set
+# CONFIG_SCHED_INSTRUMENTATION is not set
+
+#
+# Latency optimization
+#
+# CONFIG_SCHED_YIELD_OPTIMIZATION is not set
+
+#
+# Files and I/O
+#
+CONFIG_DEV_CONSOLE=y
+# CONFIG_FDCLONE_DISABLE is not set
+# CONFIG_FDCLONE_STDIO is not set
+# CONFIG_SDCLONE_DISABLE is not set
+CONFIG_NFILE_DESCRIPTORS=64
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+# CONFIG_PRIORITY_INHERITANCE is not set
+
+#
+# RTOS hooks
+#
+CONFIG_BOARD_INITIALIZE=y
+# CONFIG_BOARD_INITTHREAD is not set
+# CONFIG_SCHED_STARTHOOK is not set
+CONFIG_SCHED_ATEXIT=y
+CONFIG_SCHED_ONEXIT=y
+CONFIG_SCHED_ONEXIT_MAX=1
+
+#
+# Signal Numbers
+#
+CONFIG_SIG_SIGUSR1=1
+CONFIG_SIG_SIGUSR2=2
+CONFIG_SIG_SIGALARM=3
+CONFIG_SIG_SIGCHLD=4
+CONFIG_SIG_SIGCONDTIMEDOUT=16
+CONFIG_SIG_SIGWORK=17
+
+#
+# POSIX Message Queue Options
+#
+CONFIG_PREALLOC_MQ_MSGS=4
+CONFIG_MQ_MAXMSGSIZE=600
+
+#
+# Work Queue Support
+#
+CONFIG_SCHED_WORKQUEUE=y
+CONFIG_SCHED_WORKQUEUE_SORTING=y
+CONFIG_SCHED_HPWORK=y
+CONFIG_SCHED_HPWORKPRIORITY=224
+CONFIG_SCHED_HPWORKPERIOD=50000
+CONFIG_SCHED_HPWORKSTACKSIZE=2048
+# CONFIG_SCHED_LPWORK is not set
+
+#
+# Stack size information
+#
+CONFIG_IDLETHREAD_STACKSIZE=1024
+CONFIG_USERMAIN_STACKSIZE=2048
+CONFIG_PREAPP_STACKSIZE=2048
+# CONFIG_MPU_STACKGAURD is not set
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=2048
+
+#
+# System Call
+#
+# CONFIG_LIB_SYSCALL is not set
+
+#
+# Device Drivers
+#
+# CONFIG_DISABLE_POLL is not set
+CONFIG_DEV_NULL=y
+# CONFIG_DEV_ZERO is not set
+
+#
+# Buffering
+#
+# CONFIG_DRVR_WRITEBUFFER is not set
+# CONFIG_DRVR_READAHEAD is not set
+# CONFIG_CAN is not set
+# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set
+# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set
+CONFIG_PWM=y
+# CONFIG_ARCH_HAVE_I2CRESET is not set
+CONFIG_I2C=y
+CONFIG_I2C_SLAVE=y
+CONFIG_I2C_USERIO=y
+CONFIG_I2C_TRANSFER=y
+CONFIG_I2C_POLLED=y
+# CONFIG_I2C_TRACE is not set
+# CONFIG_I2C_WRITEREAD is not set
+CONFIG_SPI=y
+# CONFIG_SPI_OWNBUS is not set
+# CONFIG_SPI_EXCHANGE is not set
+# CONFIG_SPI_CMDDATA is not set
+# CONFIG_SPI_BITBANG is not set
+CONFIG_GPIO=y
+# CONFIG_I2S is not set
+# CONFIG_BCH is not set
+CONFIG_RTC=y
+CONFIG_RTC_DATETIME=y
+# CONFIG_RTC_ALARM is not set
+CONFIG_RTC_DRIVER=y
+# CONFIG_RTC_IOCTL is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_DEVPATH="/dev/watchdog0"
+# CONFIG_TIMER is not set
+CONFIG_ANALOG=y
+CONFIG_ADC=y
+CONFIG_ADC_FIFOSIZE=8
+# CONFIG_DAC is not set
+# CONFIG_LCD is not set
+# CONFIG_PIPES is not set
+CONFIG_POWER=y
+# CONFIG_BATTERY_CHARGER is not set
+# CONFIG_BATTERY_GAUGE is not set
+# CONFIG_SERCOMM_CONSOLE is not set
+CONFIG_SERIAL=y
+# CONFIG_DEV_LOWCONSOLE is not set
+# CONFIG_16550_UART is not set
+# CONFIG_ARCH_HAVE_UART is not set
+CONFIG_ARCH_HAVE_UART0=y
+CONFIG_ARCH_HAVE_UART1=y
+CONFIG_ARCH_HAVE_UART2=y
+CONFIG_ARCH_HAVE_UART3=y
+CONFIG_ARCH_HAVE_UART4=y
+# CONFIG_ARCH_HAVE_UART5 is not set
+# CONFIG_ARCH_HAVE_UART6 is not set
+# CONFIG_ARCH_HAVE_UART7 is not set
+# CONFIG_ARCH_HAVE_UART8 is not set
+# CONFIG_ARCH_HAVE_SCI0 is not set
+# CONFIG_ARCH_HAVE_SCI1 is not set
+# CONFIG_ARCH_HAVE_USART0 is not set
+# CONFIG_ARCH_HAVE_USART1 is not set
+# CONFIG_ARCH_HAVE_USART2 is not set
+# CONFIG_ARCH_HAVE_USART3 is not set
+# CONFIG_ARCH_HAVE_USART4 is not set
+# CONFIG_ARCH_HAVE_USART5 is not set
+# CONFIG_ARCH_HAVE_USART6 is not set
+# CONFIG_ARCH_HAVE_USART7 is not set
+# CONFIG_ARCH_HAVE_USART8 is not set
+# CONFIG_ARCH_HAVE_OTHER_UART is not set
+
+#
+# USART Configuration
+#
+CONFIG_MCU_SERIAL=y
+CONFIG_STANDARD_SERIAL=y
+CONFIG_SERIAL_NPOLLWAITERS=2
+# CONFIG_SERIAL_IFLOWCONTROL is not set
+# CONFIG_SERIAL_OFLOWCONTROL is not set
+# CONFIG_SERIAL_TIOCSERGSTRUCT is not set
+CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
+CONFIG_SERIAL_TERMIOS=y
+# CONFIG_UART0_SERIAL_CONSOLE is not set
+# CONFIG_UART1_SERIAL_CONSOLE is not set
+# CONFIG_UART2_SERIAL_CONSOLE is not set
+# CONFIG_UART3_SERIAL_CONSOLE is not set
+CONFIG_UART4_SERIAL_CONSOLE=y
+# CONFIG_OTHER_SERIAL_CONSOLE is not set
+# CONFIG_NO_SERIAL_CONSOLE is not set
+
+#
+# UART0 Configuration
+#
+CONFIG_UART0_RXBUFSIZE=64
+CONFIG_UART0_TXBUFSIZE=64
+CONFIG_UART0_BAUD=115200
+CONFIG_UART0_BITS=8
+CONFIG_UART0_PARITY=0
+CONFIG_UART0_2STOP=0
+# CONFIG_UART0_IFLOWCONTROL is not set
+# CONFIG_UART0_OFLOWCONTROL is not set
+
+#
+# UART1 Configuration
+#
+CONFIG_UART1_RXBUFSIZE=64
+CONFIG_UART1_TXBUFSIZE=64
+CONFIG_UART1_BAUD=115200
+CONFIG_UART1_BITS=8
+CONFIG_UART1_PARITY=0
+CONFIG_UART1_2STOP=0
+# CONFIG_UART1_IFLOWCONTROL is not set
+# CONFIG_UART1_OFLOWCONTROL is not set
+
+#
+# UART2 Configuration
+#
+CONFIG_UART2_RXBUFSIZE=64
+CONFIG_UART2_TXBUFSIZE=64
+CONFIG_UART2_BAUD=115200
+CONFIG_UART2_BITS=8
+CONFIG_UART2_PARITY=0
+CONFIG_UART2_2STOP=0
+# CONFIG_UART2_IFLOWCONTROL is not set
+# CONFIG_UART2_OFLOWCONTROL is not set
+
+#
+# UART3 Configuration
+#
+CONFIG_UART3_RXBUFSIZE=256
+CONFIG_UART3_TXBUFSIZE=256
+CONFIG_UART3_BAUD=115200
+CONFIG_UART3_BITS=8
+CONFIG_UART3_PARITY=0
+CONFIG_UART3_2STOP=0
+# CONFIG_UART3_IFLOWCONTROL is not set
+# CONFIG_UART3_OFLOWCONTROL is not set
+
+#
+# UART4 Configuration
+#
+CONFIG_UART4_RXBUFSIZE=256
+CONFIG_UART4_TXBUFSIZE=256
+CONFIG_UART4_BAUD=115200
+CONFIG_UART4_BITS=8
+CONFIG_UART4_PARITY=0
+CONFIG_UART4_2STOP=0
+# CONFIG_UART4_IFLOWCONTROL is not set
+# CONFIG_UART4_OFLOWCONTROL is not set
+
+# CONFIG_USBDEV is not set
+# CONFIG_FOTA_DRIVER is not set
+
+#
+# System Logging
+#
+# CONFIG_RAMLOG is not set
+# CONFIG_SYSLOG_CONSOLE is not set
+
+#
+# T-trace
+#
+# CONFIG_TTRACE is not set
+
+#
+# Wireless Device Options
+#
+# CONFIG_DRIVERS_WIRELESS is not set
+
+#
+# Networking Support
+#
+# CONFIG_ARCH_HAVE_NET is not set
+# CONFIG_ARCH_HAVE_PHY is not set
+# CONFIG_NET is not set
+
+#
+# File Systems
+#
+
+#
+# File system configuration
+#
+# CONFIG_DISABLE_MOUNTPOINT is not set
+# CONFIG_FS_AUTOMOUNTER is not set
+# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
+CONFIG_FS_READABLE=y
+CONFIG_FS_WRITABLE=y
+# CONFIG_FS_NAMED_SEMAPHORES is not set
+CONFIG_FS_MQUEUE_MPATH="/var/mqueue"
+CONFIG_FS_SMARTFS=y
+
+#
+# SMARTFS options
+#
+CONFIG_SMARTFS_ERASEDSTATE=0xff
+CONFIG_SMARTFS_MAXNAMLEN=32
+# CONFIG_SMARTFS_MULTI_ROOT_DIRS is not set
+CONFIG_SMARTFS_ALIGNED_ACCESS=y
+# CONFIG_SMARTFS_BAD_SECTOR is not set
+# CONFIG_SMARTFS_DYNAMIC_HEADER is not set
+# CONFIG_SMARTFS_JOURNALING is not set
+# CONFIG_SMARTFS_SECTOR_RECOVERY is not set
+CONFIG_FS_PROCFS=y
+
+#
+# Exclude individual procfs entries
+#
+# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set
+# CONFIG_FS_PROCFS_EXCLUDE_VERSION is not set
+# CONFIG_FS_PROCFS_EXCLUDE_MTD is not set
+# CONFIG_FS_PROCFS_EXCLUDE_PARTITIONS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_SMARTFS is not set
+# CONFIG_FS_ROMFS is not set
+
+#
+# Block Driver Configurations
+#
+# CONFIG_RAMDISK is not set
+
+#
+# MTD Configuration
+#
+CONFIG_MTD=y
+CONFIG_MTD_PARTITION=y
+CONFIG_MTD_PARTITION_NAMES=y
+CONFIG_MTD_PROGMEM=y
+CONFIG_MTD_FTL=y
+
+#
+# MTD_FTL Configurations
+#
+CONFIG_MTD_CONFIG=y
+
+#
+# MTD Configurations
+#
+# CONFIG_MTD_CONFIG_RAM_CONSOLIDATE is not set
+CONFIG_MTD_CONFIG_ERASEDVALUE=0xff
+# CONFIG_MTD_BYTE_WRITE is not set
+
+#
+# MTD Device Drivers
+#
+# CONFIG_MTD_M25P is not set
+# CONFIG_RAMMTD is not set
+CONFIG_MTD_SMART=y
+
+#
+# SMART Device options
+#
+CONFIG_MTD_SMART_SECTOR_SIZE=4096
+# CONFIG_MTD_SMART_WEAR_LEVEL is not set
+# CONFIG_MTD_SMART_ENABLE_CRC is not set
+# CONFIG_MTD_SMART_SECTOR_ERASE_DEBUG is not set
+# CONFIG_MTD_SMART_ALLOC_DEBUG is not set
+
+#
+# System Logging
+#
+# CONFIG_SYSLOG is not set
+# CONFIG_SYSLOG_TIMESTAMP is not set
+
+#
+# Arastorage
+#
+
+#
+# AraStorage database configuration
+#
+# CONFIG_ARASTORAGE is not set
+
+#
+# Memory Management
+#
+# CONFIG_DISABLE_REALLOC_NEIGHBOR_EXTENTION is not set
+# CONFIG_MM_SMALL is not set
+CONFIG_MM_REGIONS=1
+# CONFIG_ARCH_HAVE_HEAP2 is not set
+# CONFIG_GRAN is not set
+
+#
+# Power Management
+#
+# CONFIG_PM is not set
+
+#
+# Logger Module
+#
+# CONFIG_LOGM is not set
+
+#
+# Library Routines
+#
+
+#
+# Standard C Library Options
+#
+CONFIG_STDIO_BUFFER_SIZE=64
+CONFIG_STDIO_LINEBUFFER=y
+CONFIG_NUNGET_CHARS=2
+CONFIG_LIB_HOMEDIR="/"
+CONFIG_LIBM=y
+# CONFIG_NOPRINTF_FIELDWIDTH is not set
+CONFIG_LIBC_FLOATINGPOINT=y
+# CONFIG_LIBC_IOCTL_VARIADIC is not set
+CONFIG_LIB_RAND_ORDER=1
+# CONFIG_EOL_IS_CR is not set
+# CONFIG_EOL_IS_LF is not set
+# CONFIG_EOL_IS_BOTH_CRLF is not set
+CONFIG_EOL_IS_EITHER_CRLF=y
+CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024
+CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
+CONFIG_LIBC_STRERROR=y
+# CONFIG_LIBC_STRERROR_SHORT is not set
+# CONFIG_LIBC_PERROR_STDOUT is not set
+CONFIG_LIBC_TMPDIR="/tmp"
+CONFIG_LIBC_MAX_TMPFILE=32
+CONFIG_ARCH_LOWPUTC=y
+# CONFIG_LIBC_LOCALTIME is not set
+# CONFIG_TIME_EXTENDED is not set
+CONFIG_LIB_SENDFILE_BUFSIZE=512
+# CONFIG_ARCH_ROMGETC is not set
+# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
+# CONFIG_LIBC_NETDB is not set
+# CONFIG_NETDB_HOSTFILE is not set
+
+#
+# Non-standard Library Support
+#
+
+#
+# Basic CXX Support
+#
+# CONFIG_C99_BOOL8 is not set
+# CONFIG_HAVE_CXX is not set
+
+#
+# External Functions
+#
+# CONFIG_ENABLE_IOTIVITY is not set
+# CONFIG_LIBTUV is not set
+
+#
+# Application Configuration
+#
+# CONFIG_ENTRY_MANUAL is not set
+
+#
+# Application entry point list
+#
+CONFIG_ENTRY_HELLO=y
+CONFIG_USER_ENTRYPOINT="jerry_main"
+CONFIG_BUILTIN_APPS=y
+
+#
+# Examples
+#
+# CONFIG_EXAMPLES_ARTIK_DEMO is not set
+# CONFIG_EXAMPLES_EEPROM_TEST is not set
+# CONFIG_EXAMPLES_FOTA_SAMPLE is not set
+# CONFIG_EXAMPLES_HELLO is not set
+# CONFIG_EXAMPLES_HELLO_TASH is not set
+# CONFIG_EXAMPLES_HELLOXX is not set
+# CONFIG_EXAMPLES_KERNEL_SAMPLE is not set
+# CONFIG_EXAMPLES_LIBTUV is not set
+# CONFIG_EXAMPLES_MTDPART is not set
+# CONFIG_EXAMPLES_NETTEST is not set
+# CONFIG_EXAMPLES_PROC_TEST is not set
+# CONFIG_EXAMPLES_SELECT_TEST is not set
+# CONFIG_EXAMPLES_SENSORBOARD is not set
+# CONFIG_EXAMPLES_SMART is not set
+# CONFIG_EXAMPLES_SMART_TEST is not set
+# CONFIG_EXAMPLES_SYSIO_TEST is not set
+# CONFIG_EXAMPLES_TESTCASE is not set
+# CONFIG_EXAMPLES_WAKAAMA_CLIENT is not set
+# CONFIG_EXAMPLES_WIFI_TEST is not set
+# CONFIG_EXAMPLES_WORKQUEUE is not set
+
+#
+# Network Utilities
+#
+# CONFIG_NETUTILS_CODECS is not set
+# CONFIG_NETUTILS_DHCPC is not set
+# CONFIG_NETUTILS_FTPC is not set
+# CONFIG_NETUTILS_FTPD is not set
+# CONFIG_NETUTILS_JSON is not set
+# CONFIG_NETUTILS_MDNS is not set
+# CONFIG_NETUTILS_MQTT is not set
+# CONFIG_NETUTILS_NETLIB is not set
+# CONFIG_NETUTILS_NTPCLIENT is not set
+# CONFIG_NETUTILS_SMTP is not set
+# CONFIG_NETUTILS_TELNETD is not set
+# CONFIG_NETUTILS_TFTPC is not set
+# CONFIG_NETUTILS_WIFI is not set
+# CONFIG_NETUTILS_XMLRPC is not set
+
+#
+# Platform-specific Support
+#
+# CONFIG_PLATFORM_CONFIGDATA is not set
+
+#
+# Enable Shell
+#
+CONFIG_TASH=y
+CONFIG_TASH_MAX_COMMANDS=32
+# CONFIG_DEBUG_TASH is not set
+# CONFIG_TASH_TELNET_INTERFACE is not set
+CONFIG_TASH_CMDTASK_STACKSIZE=4096
+CONFIG_TASH_CMDTASK_PRIORITY=100
+
+#
+# System Libraries and Add-Ons
+#
+CONFIG_SYSTEM_CLE=y
+CONFIG_SYSTEM_CLE_DEBUGLEVEL=0
+# CONFIG_SYSTEM_CUTERM is not set
+# CONFIG_SYSTEM_FOTA_HAL is not set
+# CONFIG_SYSTEM_I2CTOOL is not set
+# CONFIG_SYSTEM_INIFILE is not set
+# CONFIG_SYSTEM_INSTALL is not set
+# CONFIG_SYSTEM_POWEROFF is not set
+CONFIG_SYSTEM_RAMTEST=y
+# CONFIG_SYSTEM_RAMTRON is not set
+CONFIG_SYSTEM_READLINE=y
+CONFIG_READLINE_ECHO=y
+CONFIG_SYSTEM_INFORMATION=y
+CONFIG_KERNEL_CMDS=y
+CONFIG_FS_CMDS=y
+CONFIG_FSCMD_BUFFER_LEN=32
+CONFIG_ENABLE_DATE=y
+CONFIG_ENABLE_ENV_GET=y
+CONFIG_ENABLE_ENV_SET=y
+CONFIG_ENABLE_ENV_UNSET=y
+CONFIG_ENABLE_FREE=y
+CONFIG_ENABLE_HEAPINFO=y
+CONFIG_ENABLE_KILL=y
+CONFIG_ENABLE_KILLALL=y
+CONFIG_ENABLE_PS=y
+CONFIG_ENABLE_STACKMONITOR=y
+CONFIG_STACKMONITOR_PRIORITY=100
+CONFIG_STACKMONITOR_INTERVAL=5
+CONFIG_ENABLE_UPTIME=y
+CONFIG_SYSTEM_VI=y
+CONFIG_SYSTEM_VI_COLS=64
+CONFIG_SYSTEM_VI_ROWS=16
+CONFIG_SYSTEM_VI_DEBUGLEVEL=0
+
+#
+# JerryScript
+#
+CONFIG_JERRYSCRIPT=y
+CONFIG_JERRYSCRIPT_PRIORITY=100
+CONFIG_JERRYSCRIPT_STACKSIZE=16384
+CONFIG_JERRYSCRIPT_HEAPSIZE=107520
+# CONFIG_JERRYSCRIPT_MEM_STATS is not set
+# CONFIG_JERRYSCRIPT_SHOW_OPCODES is not set
+# CONFIG_JERRYSCRIPT_DEBUGGER is not set
+
+#
+# wpa_supplicant
+#
+# CONFIG_WPA_SUPPLICANT is not set
diff --git a/deps/jerry/targets/zephyr/Makefile b/deps/jerry/targets/zephyr/Makefile
new file mode 100644 (file)
index 0000000..f053626
--- /dev/null
@@ -0,0 +1,62 @@
+# 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.
+
+# use TAB-8
+.DEFAULT_GOAL := all
+
+ifndef ZEPHYR_BASE
+$(error Missing zephyr base)
+endif
+
+# For testing without real hardware use qemu_x86 instead of arduino_101
+BOARD ?= arduino_101
+
+O ?= $(PROJECT_BASE)/outdir
+
+ZEPHYR    ?= $(ZEPHYR_BASE)
+TYPE      ?= release
+JERRYHEAP ?= 16
+
+ZEPHYRINC   = $(ZEPHYR_BASE)/include
+ZEPHYRLIB   = $(ZEPHYR_BASE)/lib
+
+TARGET_ZEPHYR ?= ./targets/zephyr
+SOURCE_DIR = $(TARGET_ZEPHYR)/src
+
+export JERRY_INCLUDE = -I$(CURDIR)/jerry-core/include -I$(CURDIR)/jerry-ext/include
+
+MDEF_FILE = $(realpath $(SOURCE_DIR)/../prj.mdef)
+CONF_FILE = $(realpath $(SOURCE_DIR)/../prj.conf)
+
+ifdef V
+$(info Zephyr)
+$(info SOURCE_DIR=$(SOURCE_DIR))
+$(info JERRY_INCLUDE=$(JERRY_INCLUDE))
+$(info CONF_FILE =$(CONF_FILE))
+endif
+
+KERNEL_TYPE = micro
+
+KBUILD_VERBOSE = $(V)
+
+APP = main-zephyr.c
+
+ALL_LIBS += $(USER_LIBS)
+export ALL_LIBS
+LDFLAGS_zephyr += $(USER_LIB_INCLUDE_DIR)
+export LDFLAGS_zephyr
+
+include ${ZEPHYR_BASE}/Makefile.inc
+
+.PHONY = showconfig
diff --git a/deps/jerry/targets/zephyr/Makefile.zephyr b/deps/jerry/targets/zephyr/Makefile.zephyr
new file mode 100644 (file)
index 0000000..c352720
--- /dev/null
@@ -0,0 +1,174 @@
+# 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.
+
+.DEFAULT_GOAL := all
+
+ifeq ($(.DEFAULT_GOAL),)
+  $(warning no default goal is set)
+endif
+
+BOARD ?= arduino_101
+export BOARD
+
+TARGET_ZEPHYR ?= ./targets/zephyr
+TARGET_ZEPHYR_SRC_DIR = $(TARGET_ZEPHYR)/src
+
+COMPONENTS  ?= jerry-core jerry-ext
+JERRYHEAP ?= 16
+JERRYPROFILE ?= minimal
+
+# Include functionality like regular expressions
+# check Jerry script documentation
+#
+# -cp
+# -cp_minimal
+# -cp_minimal-mem_stats
+# -mem_stats
+# -mem_stress_test
+
+ifndef ZEPHYR_BASE
+$(error Missing Zephyr base, did you source zephyr-env.sh? )
+endif
+
+INTERM     = build/$(BOARD)/obj-$(BOARD)
+OUTPUT     = build/$(BOARD)/zephyr
+
+include $(OUTPUT)/Makefile.export
+
+EXT_CFLAGS := -fno-asynchronous-unwind-tables -fno-omit-frame-pointer
+EXT_CFLAGS += -fno-stack-protector -fno-strict-overflow -ffreestanding
+EXT_CFLAGS += -fno-reorder-functions -fno-defer-pop -fdata-sections
+EXT_CFLAGS += -ffunction-sections -fno-inline-functions
+
+EXT_CFLAGS += $(KBUILD_CFLAGS) $(NOSTDINC_FLAGS) $(subst -I,-isystem,$(ZEPHYRINCLUDE))
+
+EXT_CFLAGS += -Wall -Wno-format-zero-length -Wno-pointer-sign
+EXT_CFLAGS += -Werror=format -Werror=implicit-int -Wno-unused-but-set-variable
+EXT_CFLAGS += -Wno-main -Wno-strict-aliasing -Wno-old-style-declaration
+EXT_CFLAGS += -Wno-error=format=
+EXT_CFLAGS += -D_XOPEN_SOURCE=700
+
+EXT_CFLAGS += -Wno-error=conversion
+
+EXTERNAL_LIB = $(INTERM)/lib/libjerry-core.a $(INTERM)/lib/libjerry-ext.a
+
+LIBS = jerry-core jerry-ext
+
+BUILD_CONFIG = O="$(OUTPUT)" V=$(V) USER_LIBS="$(LIBS)" USER_LIB_INCLUDE_DIR="-L $(CURDIR)/$(INTERM)/lib" TARGET_ZEPHYR=$(TARGET_ZEPHYR)
+
+.PHONY: all
+all: zephyr
+
+$(EXTERNAL_LIB):
+ifdef V
+       @echo "- JERRY SCRIPT -------------------------------------------------"
+endif
+       mkdir -p $(INTERM)
+       mkdir -p $(OUTPUT)
+       cmake -B$(INTERM) -H./ \
+        -DENABLE_LTO=OFF \
+        -DFEATURE_VALGRIND=OFF \
+        -DFEATURE_PROFILE=$(JERRYPROFILE) \
+        -DFEATURE_ERROR_MESSAGES=ON \
+        -DCMAKE_BUILD_TYPE=MinSizeRel \
+        -DCMAKE_VERBOSE_MAKEFILE=$(V) \
+        -DMEM_HEAP_SIZE_KB=$(JERRYHEAP) \
+        -DEXTERNAL_CMAKE_C_COMPILER="$(subst ccache ,,$(CC))" \
+        -DEXTERNAL_CMAKE_C_COMPILER_ID=GNU \
+        -DJERRY_CMDLINE=OFF \
+        -DEXTERNAL_COMPILE_FLAGS="$(EXT_CFLAGS)" \
+        -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain_external.cmake \
+        -DFEATURE_SNAPSHOT_EXEC=OFF \
+        -DENABLE_ALL_IN_ONE=OFF \
+        -DJERRY_LIBC=OFF \
+        $(EXT_JERRY_FLAGS)
+
+       make -C $(INTERM) $(COMPONENTS) V=1
+
+$(OUTPUT)/Makefile.export: $(OUTPUT)/include/config/auto.conf
+       make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG) outputexports
+
+$(OUTPUT)/include/config/auto.conf:
+       make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG) initconfig
+
+zephyr: jerry
+ifdef V
+       @echo "- ZEPHYR -------------------------------------------------------"
+endif
+       +make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG)
+       @echo "Finished"
+       @file $(OUTPUT)/zephyr.strip
+       @size $(OUTPUT)/zephyr.strip
+
+jerry: $(EXTERNAL_LIB)
+       @touch $(EXTERNAL_LIB)
+
+GENERIC_TARGETS = qemu qemugdb flash debug debugserver
+KCONFIG_TARGETS = \
+       initconfig config nconfig menuconfig xconfig gconfig \
+       oldconfig silentoldconfig defconfig savedefconfig \
+       allnoconfig allyesconfig alldefconfig randconfig \
+       listnewconfig olddefconfig
+CLEAN_TARGETS = mrproper
+
+$(GENERIC_TARGETS): jerry
+$(CLEAN_TARGETS): clean
+
+$(GENERIC_TARGETS) $(KCONFIG_TARGETS) $(CLEAN_TARGETS):
+ifdef V
+       @echo "- ZEPHYR -------------------------------------------------------"
+endif
+       make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG) $@
+
+dfu-x86: all
+       @- dfu-util -a x86_app -D build/$(BOARD)/zephyr/zephyr.bin; \
+       if [ $$? -eq 0 ] ; then echo "\nYour program will launch in 5 seconds." ; \
+       else echo "\nProgram didn't flash, try pressing the reset buttons \nand wait a second for the bootloader to load, \nor flash again the factory bootloader."; fi
+
+usage:
+help:
+       @echo Usage:
+       @echo showconfig         Show parameters and configuration
+       @echo flash              Flash into board
+       @echo all                Compile jerryscript and zephyr
+
+showconfig:
+       @echo "- CONFIGURATION ------------------------------------------------"
+       @echo "INTERM           = $(INTERM)"
+       @echo "OUTPUT           = $(OUTPUT)"
+       @echo "CC               = $(CC) "
+       @echo "BOARD            = $(ZEPHYR_BASE)/boards/$(BOARD)/Makefile.board "
+       @echo "TOOLCHAIN        = $(ZEPHYR_BASE)/scripts/Makefile.toolchain.$(ZEPHYR_GCC_VARIANT) "
+       @echo "TOOLCHAIN_CFLAGS = $(TOOLCHAIN_CFLAGS) "
+       @echo "CROSS_COMPILE    = $(CROSS_COMPILE) "
+       @echo "TOOLCHAIN_LIBS   = $(TOOLCHAIN_LIBS) "
+       @echo "LIBS             = $(LIBS) "
+       @echo "BUILD_CONFIG     = $(BUILD_CONFIG) "
+       make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG) showconfig
+
+clean:
+ifdef V
+       @echo "- CLEANING JERRY SCRIPT ----------------------------------------"
+endif
+       rm -rf $(INTERM) $(TARGET_ZEPHYR_SRC_DIR)/*.o
+ifdef V
+       @echo "- CLEANING ZEPHYR ----------------------------------------------"
+endif
+       make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG) clean
+
+pristine: clean
+ifdef V
+       @echo "- CLEANING BUILD DIRECTORY -------------------------------------"
+endif
+       rm -rf build/
diff --git a/deps/jerry/targets/zephyr/README.md b/deps/jerry/targets/zephyr/README.md
new file mode 100644 (file)
index 0000000..4f91ec9
--- /dev/null
@@ -0,0 +1,152 @@
+### About
+
+This folder contains files to integrate JerryScript with Zephyr RTOS to
+run on a number of supported boards (like
+[Arduino 101 / Genuino 101](https://www.arduino.cc/en/Main/ArduinoBoard101),
+[Zephyr Arduino 101](https://www.zephyrproject.org/doc/board/arduino_101.html)).
+
+### How to build
+
+#### 1. Preface
+
+1. Directory structure
+
+Assume `harmony` as the path to the projects to build.
+The folder tree related would look like this.
+
+```
+harmony
+  + jerryscript
+  |  + targets
+  |      + zephyr
+  + zephyr-project
+```
+
+
+2. Target boards/emulations
+
+Following Zephyr boards were tested: qemu_x86, qemu_cortex_m3, arduino_101,
+frdm_k64f.
+
+
+#### 2. Prepare Zephyr
+
+Follow [this](https://www.zephyrproject.org/doc/getting_started/getting_started.html) page to get
+the Zephyr source and configure the environment.
+
+If you just start with Zephyr, you may want to follow "Building a Sample
+Application" section in the doc above and check that you can flash your
+target board.
+
+Remember to source the Zephyr environment as explained in the zephyr documenation:
+
+```
+cd zephyr-project
+source zephyr-env.sh
+
+export ZEPHYR_GCC_VARIANT=zephyr
+export ZEPHYR_SDK_INSTALL_DIR=<sdk installation directory>
+```
+
+#### 3. Build JerryScript for Zephyr
+
+The easiest way is to build and run on a QEMU emulator:
+
+For x86 architecture:
+
+```
+make -f ./targets/zephyr/Makefile.zephyr BOARD=qemu_x86 qemu
+```
+
+For ARM (Cortex-M) architecture:
+
+```
+make -f ./targets/zephyr/Makefile.zephyr BOARD=qemu_cortex_m3 qemu
+```
+
+#### 4. Build for Arduino 101
+
+```
+# assume you are in harmony folder
+cd jerryscript
+make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101
+```
+
+This will generate the following libraries:
+```
+./build/arduino_101/librelease-cp_minimal.jerry-core.a
+./build/arduino_101/librelease-cp_minimal.jerry-libm.lib.a
+./build/arduino_101/librelease.external-cp_minimal-entry.a
+```
+
+The final Zephyr image will be located here:
+```
+./build/arduino_101/zephyr/zephyr.strip
+```
+
+#### 5. Flashing
+
+Details on how to flash the image can be found here:
+[Flashing image](https://www.zephyrproject.org/doc/board/arduino_101.html)
+(or similar page for other supported boards).
+
+To be able to use this demo in hardware you will need the serial console
+which will be generating output to Pins 0 & 1.
+
+You will need a 3.3v TTL to RS232, please follow the zephyr documentation on it.
+
+Some examples of building the software
+
+```
+make -f ./targets/zephyr/Makefile.zephyr BOARD=<board> clean
+```
+
+- Not using a Jtag and having a factory stock Arduino 101.
+You can follow the Zephyr instructions to flash using the dfu-util command
+or use this helper:
+
+```
+make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101 dfu-x86
+```
+
+Make sure you have the factory bootloader in your device to use this method or it will not flash.
+
+- Using JTAG
+
+There is a helper function to flash using the JTAG and Flywatter2
+
+![alt tag](docs/arduino_101.jpg?raw=true "Example")
+
+```
+make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101 flash
+```
+
+<warning> Careful if you flash the BOARD arduino_101, you will lose the bootloader
+and you will have to follow the zephyr documentation to get it back from
+the backup we all know you did at the setup. </warning>
+
+#### 6. Serial terminal
+
+Test command line in a serial terminal.
+
+
+You should see something similar to this:
+```
+JerryScript build: Aug 12 2016 17:12:55
+JerryScript API 1.0
+Zephyr version 1.4.0
+js>
+```
+
+
+Run the example javascript command test function
+```
+js> var test=0; for (t=100; t<1000; t++) test+=t; print ('Hi JS World! '+test);
+Hi JS World! 494550
+```
+
+
+Try a more complex function:
+```
+js> function hello(t) {t=t*10;return t}; print("result"+hello(10.5));
+```
diff --git a/deps/jerry/targets/zephyr/docs/arduino_101.jpg b/deps/jerry/targets/zephyr/docs/arduino_101.jpg
new file mode 100644 (file)
index 0000000..b05683c
Binary files /dev/null and b/deps/jerry/targets/zephyr/docs/arduino_101.jpg differ
diff --git a/deps/jerry/targets/zephyr/prj.conf b/deps/jerry/targets/zephyr/prj.conf
new file mode 100644 (file)
index 0000000..29c933f
--- /dev/null
@@ -0,0 +1,7 @@
+CONFIG_STDOUT_CONSOLE=y
+CONFIG_NEWLIB_LIBC=y
+CONFIG_FLOAT=y
+CONFIG_CONSOLE_HANDLER=y
+CONFIG_CONSOLE_HANDLER_SHELL=y
+CONFIG_ARC_INIT=n
+
diff --git a/deps/jerry/targets/zephyr/prj.mdef b/deps/jerry/targets/zephyr/prj.mdef
new file mode 100644 (file)
index 0000000..c64ca80
--- /dev/null
@@ -0,0 +1,5 @@
+% Application       : JerryScript Sample
+
+% TASK NAME  PRIO ENTRY STACK GROUPS
+% ==================================
+  TASK TASKA    7 main  2048 [EXE]
diff --git a/deps/jerry/targets/zephyr/src/Makefile b/deps/jerry/targets/zephyr/src/Makefile
new file mode 100644 (file)
index 0000000..7801a1c
--- /dev/null
@@ -0,0 +1,22 @@
+# 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.
+
+ifdef V
+$(info Compiling application)
+endif
+
+# Adding path for jerry script APIs
+ZEPHYRINCLUDE += $(JERRY_INCLUDE)
+
+obj-y += main-zephyr.o getline-zephyr.o jerry-port.o
diff --git a/deps/jerry/targets/zephyr/src/getline-zephyr.c b/deps/jerry/targets/zephyr/src/getline-zephyr.c
new file mode 100644 (file)
index 0000000..b64489b
--- /dev/null
@@ -0,0 +1,58 @@
+/* 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.
+ */
+
+#include <zephyr.h>
+#include <uart.h>
+#include <drivers/console/console.h>
+#include <drivers/console/uart_console.h>
+#include "getline-zephyr.h"
+
+/* While app processes one input line, Zephyr will have another line
+   buffer to accumulate more console input. */
+static struct console_input line_bufs[2];
+
+static struct k_fifo free_queue;
+static struct k_fifo used_queue;
+
+char *zephyr_getline(void)
+{
+  static struct console_input *cmd;
+
+  /* Recycle cmd buffer returned previous time */
+  if (cmd != NULL)
+  {
+    k_fifo_put(&free_queue, cmd);
+  }
+
+  cmd = k_fifo_get(&used_queue, K_FOREVER);
+  return cmd->line;
+}
+
+void zephyr_getline_init(void)
+{
+  int i;
+
+  k_fifo_init(&used_queue);
+  k_fifo_init(&free_queue);
+  for (i = 0; i < sizeof(line_bufs) / sizeof(*line_bufs); i++)
+  {
+    k_fifo_put(&free_queue, &line_bufs[i]);
+  }
+
+  /* Zephyr UART handler takes an empty buffer from free_queue,
+     stores UART input in it until EOL, and then puts it into
+     used_queue. */
+  uart_register_input(&free_queue, &used_queue, NULL);
+}
diff --git a/deps/jerry/targets/zephyr/src/getline-zephyr.h b/deps/jerry/targets/zephyr/src/getline-zephyr.h
new file mode 100644 (file)
index 0000000..52ad493
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+void zephyr_getline_init(void);
+char *zephyr_getline(void);
diff --git a/deps/jerry/targets/zephyr/src/jerry-port.c b/deps/jerry/targets/zephyr/src/jerry-port.c
new file mode 100644 (file)
index 0000000..b1eb9dc
--- /dev/null
@@ -0,0 +1,84 @@
+/* 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.
+ */
+
+#include <stdarg.h>
+
+#include <zephyr.h>
+
+#include "jerryscript-port.h"
+
+
+/**
+ * Provide log message implementation for the engine.
+ */
+void
+jerry_port_log (jerry_log_level_t level, /**< log level */
+                const char *format, /**< format string */
+                ...)  /**< parameters */
+{
+  (void) level; /* ignore log level */
+
+  va_list args;
+  va_start (args, format);
+  vfprintf (stderr, format, args);
+  va_end (args);
+} /* jerry_port_log */
+
+
+/**
+ * Provide fatal message implementation for the engine.
+ */
+void jerry_port_fatal (jerry_fatal_code_t code)
+{
+  jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Jerry Fatal Error!\n");
+  while (true);
+} /* jerry_port_fatal */
+
+/**
+ * Implementation of jerry_port_get_current_time.
+ *
+ * @return current timer's counter value in milliseconds
+ */
+double
+jerry_port_get_current_time (void)
+{
+  int64_t ms = k_uptime_get();
+  return (double) ms;
+} /* jerry_port_get_current_time */
+
+/**
+ * Dummy function to get the time zone.
+ *
+ * @return true
+ */
+bool
+jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
+{
+  /* We live in UTC. */
+  tz_p->offset = 0;
+  tz_p->daylight_saving_time = 0;
+
+  return true;
+} /* jerry_port_get_time_zone */
+
+/**
+ * Provide the implementation of jerryx_port_handler_print_char.
+ * Uses 'printf' to print a single character to standard output.
+ */
+void
+jerryx_port_handler_print_char (char c) /**< the character to print */
+{
+  printf ("%c", c);
+} /* jerryx_port_handler_print_char */
diff --git a/deps/jerry/targets/zephyr/src/main-zephyr.c b/deps/jerry/targets/zephyr/src/main-zephyr.c
new file mode 100644 (file)
index 0000000..a109589
--- /dev/null
@@ -0,0 +1,116 @@
+/* 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <zephyr.h>
+#include <misc/printk.h>
+#include "getline-zephyr.h"
+
+#include "jerryscript.h"
+#include "jerryscript-port.h"
+#include "jerryscript-ext/handler.h"
+
+static jerry_value_t print_function;
+
+/**
+ * Register a JavaScript function in the global object.
+ */
+static void
+register_js_function (const char *name_p, /**< name of the function */
+                      jerry_external_handler_t handler_p) /**< function callback */
+{
+  jerry_value_t result_val = jerryx_handler_register_global ((const jerry_char_t *) name_p, handler_p);
+
+  if (jerry_value_has_error_flag (result_val))
+  {
+    jerry_port_log (JERRY_LOG_LEVEL_WARNING, "Warning: failed to register '%s' method.", name_p);
+  }
+
+  jerry_release_value (result_val);
+} /* register_js_function */
+
+static int shell_cmd_handler (char *source_buffer)
+{
+  jerry_value_t ret_val;
+
+  ret_val = jerry_eval ((jerry_char_t *) source_buffer,
+    strlen (source_buffer),
+    false);
+
+  if (jerry_value_has_error_flag (ret_val))
+  {
+    /* User-friendly error messages require at least "cp" JerryScript
+       profile. Include a message prefix in case "cp_minimal" profile
+       is used. */
+    printf ("Error executing statement: ");
+    /* Clear error flag, otherwise print call below won't produce any
+       output. */
+    jerry_value_clear_error_flag (&ret_val);
+  }
+
+  if (!jerry_value_has_error_flag (print_function))
+  {
+    jerry_value_t ret_val_print = jerry_call_function (print_function,
+      jerry_create_undefined (),
+      &ret_val,
+      1);
+    jerry_release_value (ret_val_print);
+  }
+
+  jerry_release_value (ret_val);
+
+  return 0;
+} /* shell_cmd_handler */
+
+void main (void)
+{
+  uint32_t zephyr_ver = sys_kernel_version_get ();
+  printf ("JerryScript build: " __DATE__ " " __TIME__ "\n");
+  printf ("JerryScript API %d.%d\n", JERRY_API_MAJOR_VERSION, JERRY_API_MINOR_VERSION);
+  printf ("Zephyr version %d.%d.%d\n", (int)SYS_KERNEL_VER_MAJOR (zephyr_ver),
+    (int)SYS_KERNEL_VER_MINOR (zephyr_ver),
+    (int)SYS_KERNEL_VER_PATCHLEVEL (zephyr_ver));
+
+  zephyr_getline_init ();
+  jerry_init (JERRY_INIT_EMPTY);
+  register_js_function ("print", jerryx_handler_print);
+  jerry_value_t global_obj_val = jerry_get_global_object ();
+
+  jerry_value_t print_func_name_val = jerry_create_string ((jerry_char_t *) "print");
+  print_function = jerry_get_property (global_obj_val, print_func_name_val);
+  jerry_release_value (print_func_name_val);
+  jerry_release_value (global_obj_val);
+  if (jerry_value_has_error_flag (print_function))
+  {
+    printf ("Error: could not look up print function, expression results won't be printed\n");
+  }
+
+  while (1)
+  {
+    char *s;
+    printf("js> ");
+    fflush(stdout);
+    s = zephyr_getline ();
+    if (*s)
+    {
+      shell_cmd_handler (s);
+    }
+  }
+
+  /* As we never retturn from REPL above, don't call jerry_cleanup() here. */
+} /* main */
diff --git a/deps/jerry/tests/benchmarks/jerry/fill-array-with-numbers-3-times-5000-elements.js b/deps/jerry/tests/benchmarks/jerry/fill-array-with-numbers-3-times-5000-elements.js
new file mode 100644 (file)
index 0000000..854496d
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+for (i = 0; i < 3; i++)
+{
+  a = [];
+
+  for (j = 0; j < 5000; j++)
+  {
+    a[j] = j;
+  }
+}
diff --git a/deps/jerry/tests/benchmarks/jerry/function_loop.js b/deps/jerry/tests/benchmarks/jerry/function_loop.js
new file mode 100644 (file)
index 0000000..d9856c7
--- /dev/null
@@ -0,0 +1,36 @@
+// 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.
+
+var x = 7;
+var y = 3;
+var count = 1000000;
+
+function cse_opt(x, y)
+{
+    var tmp1 = x * x;
+    var tmp2 = y * y;
+    var tmp3 = tmp1 * tmp1;
+    var tmp4 = tmp2 * tmp2;
+    
+    for (var i = 0; i < count; i++) {
+        var cached1 = tmp3 * x
+        var cached2 = tmp4 * y;
+        var cached_n_cached = cached1 + cached2;
+        var ret_val = cached_n_cached + cached_n_cached;
+    }
+    
+    return ret_val + ret_val;
+};
+
+cse_opt(x, y);
\ No newline at end of file
diff --git a/deps/jerry/tests/benchmarks/jerry/gc.js b/deps/jerry/tests/benchmarks/jerry/gc.js
new file mode 100644 (file)
index 0000000..0231240
--- /dev/null
@@ -0,0 +1,36 @@
+// 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.
+
+function f (o, i) {
+  if (--i > 0) {
+    f ({a:o, b:o}, i);
+  }
+}
+
+for (var i = 0; i < 100; i++)
+{
+  ({} + f ({}, 12));
+}
+
+for(var i = 0; i < 100; i++)
+{
+  var obj = {}, obj_l;
+  obj_l = obj;
+
+  for (var k = 0; k < 1500; k++)
+  {
+    obj_l.prop = {};
+    obj_l = obj_l.prop;
+  }
+}
diff --git a/deps/jerry/tests/benchmarks/jerry/loop_arithmetics_10kk.js b/deps/jerry/tests/benchmarks/jerry/loop_arithmetics_10kk.js
new file mode 100644 (file)
index 0000000..4d6607d
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var count = 10000000;
+var x = 7;
+var y = 3;
+
+var tmp1;
+var tmp2;
+var tmp3;
+var tmp4;
+
+for (var i = 0; i < count; i++)
+{
+  tmp1 = x * x;
+  tmp2 = y * y;
+  tmp3 = tmp1 * tmp1;
+  tmp4 = tmp2 * tmp2;
+}
diff --git a/deps/jerry/tests/benchmarks/jerry/loop_arithmetics_1kk.js b/deps/jerry/tests/benchmarks/jerry/loop_arithmetics_1kk.js
new file mode 100644 (file)
index 0000000..48ae126
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var count = 1000000;
+var x = 7;
+var y = 3;
+
+var tmp1;
+var tmp2;
+var tmp3;
+var tmp4;
+
+for (var i = 0; i < count; i++)
+{
+  tmp1 = x * x;
+  tmp2 = y * y;
+  tmp3 = tmp1 * tmp1;
+  tmp4 = tmp2 * tmp2;
+}
diff --git a/deps/jerry/tests/debugger/do_backtrace.cmd b/deps/jerry/tests/debugger/do_backtrace.cmd
new file mode 100644 (file)
index 0000000..bb6babb
--- /dev/null
@@ -0,0 +1,12 @@
+next
+n
+next
+step
+next
+s
+bt
+n
+n
+s
+backtrace
+c
diff --git a/deps/jerry/tests/debugger/do_backtrace.expected b/deps/jerry/tests/debugger/do_backtrace.expected
new file mode 100644 (file)
index 0000000..d5810f3
--- /dev/null
@@ -0,0 +1,30 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_backtrace.js:15
+(jerry-debugger) next
+Stopped at tests/debugger/do_backtrace.js:28
+(jerry-debugger) n
+Stopped at tests/debugger/do_backtrace.js:37
+(jerry-debugger) next
+Stopped at tests/debugger/do_backtrace.js:40
+(jerry-debugger) step
+Stopped at tests/debugger/do_backtrace.js:32 (in test() at line:30, col:1)
+(jerry-debugger) next
+Stopped at tests/debugger/do_backtrace.js:33 (in test() at line:30, col:1)
+(jerry-debugger) s
+Stopped at tests/debugger/do_backtrace.js:23 (in foo() at line:21, col:1)
+(jerry-debugger) bt
+Frame 0: tests/debugger/do_backtrace.js:23 (in foo() at line:21, col:1)
+Frame 1: tests/debugger/do_backtrace.js:33 (in test() at line:30, col:1)
+Frame 2: tests/debugger/do_backtrace.js:40
+(jerry-debugger) n
+Stopped at tests/debugger/do_backtrace.js:24 (in foo() at line:21, col:1)
+(jerry-debugger) n
+Stopped at tests/debugger/do_backtrace.js:25 (in foo() at line:21, col:1)
+(jerry-debugger) s
+Stopped at tests/debugger/do_backtrace.js:18 (in f4() at line:17, col:1)
+(jerry-debugger) backtrace
+Frame 0: tests/debugger/do_backtrace.js:18 (in f4() at line:17, col:1)
+Frame 1: tests/debugger/do_backtrace.js:25 (in foo() at line:21, col:1)
+Frame 2: tests/debugger/do_backtrace.js:33 (in test() at line:30, col:1)
+Frame 3: tests/debugger/do_backtrace.js:40
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_backtrace.js b/deps/jerry/tests/debugger/do_backtrace.js
new file mode 100644 (file)
index 0000000..96898d1
--- /dev/null
@@ -0,0 +1,40 @@
+// 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.
+
+print("backtrace-test");
+
+function f4() {
+       print("function f4");
+}
+
+function foo()
+{
+  print("function foo");
+  var tmp = 4;
+  f4();
+}
+
+var cat = 'cat';
+
+function test()
+{
+       print("function test");
+       foo();
+}
+
+var
+       x =
+         1;
+
+test();
diff --git a/deps/jerry/tests/debugger/do_break.cmd b/deps/jerry/tests/debugger/do_break.cmd
new file mode 100644 (file)
index 0000000..1e6ccfb
--- /dev/null
@@ -0,0 +1,10 @@
+break do_break.js:51
+b do_break.js:36
+break f
+list
+c
+delete 1
+list
+c
+continue
+c
diff --git a/deps/jerry/tests/debugger/do_break.expected b/deps/jerry/tests/debugger/do_break.expected
new file mode 100644 (file)
index 0000000..1782851
--- /dev/null
@@ -0,0 +1,28 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_break.js:15
+(jerry-debugger) break do_break.js:51
+Breakpoint 1 at tests/debugger/do_break.js:51
+(jerry-debugger) b do_break.js:36
+Breakpoint 2 at tests/debugger/do_break.js:36 (in test() at line:20, col:1)
+(jerry-debugger) break f
+Breakpoint 3 at tests/debugger/do_break.js:33 (in f() at line:31, col:3)
+Breakpoint 4 at tests/debugger/do_break.js:45 (in f() at line:43, col:1)
+(jerry-debugger) list
+=== Active breakpoints  ===
+ 1: tests/debugger/do_break.js:51
+ 2: tests/debugger/do_break.js:36 (in test() at line:20, col:1)
+ 3: tests/debugger/do_break.js:33 (in f() at line:31, col:3)
+ 4: tests/debugger/do_break.js:45 (in f() at line:43, col:1)
+(jerry-debugger) c
+Stopped at breakpoint:1 tests/debugger/do_break.js:51
+(jerry-debugger) delete 1
+(jerry-debugger) list
+=== Active breakpoints  ===
+ 2: tests/debugger/do_break.js:36 (in test() at line:20, col:1)
+ 3: tests/debugger/do_break.js:33 (in f() at line:31, col:3)
+ 4: tests/debugger/do_break.js:45 (in f() at line:43, col:1)
+(jerry-debugger) c
+Stopped at breakpoint:2 tests/debugger/do_break.js:36 (in test() at line:20, col:1)
+(jerry-debugger) continue
+Stopped at breakpoint:3 tests/debugger/do_break.js:33 (in f() at line:31, col:3)
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_break.js b/deps/jerry/tests/debugger/do_break.js
new file mode 100644 (file)
index 0000000..03dd0dc
--- /dev/null
@@ -0,0 +1,51 @@
+// 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.
+
+print("break test");
+
+print ("var cat");
+var cat = 'cat';
+
+function test(x)
+{
+  function f() {
+    return 0;
+  }
+
+  function f() {
+    /* Again. */
+    return 1;
+  }
+
+  function f() {
+    /* And again. */
+    return 2;
+  }
+
+  print("function test");
+  var a = 3;
+  var b = 5, c = a + b;
+  global_var = f();
+  return c;
+}
+
+function f() {
+  /* And again. */
+}
+
+var
+  x =
+    1;
+
+test(x);
diff --git a/deps/jerry/tests/debugger/do_continue.cmd b/deps/jerry/tests/debugger/do_continue.cmd
new file mode 100644 (file)
index 0000000..44c5d7d
--- /dev/null
@@ -0,0 +1 @@
+continue
diff --git a/deps/jerry/tests/debugger/do_continue.expected b/deps/jerry/tests/debugger/do_continue.expected
new file mode 100644 (file)
index 0000000..dd2c909
--- /dev/null
@@ -0,0 +1,3 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_continue.js:16
+(jerry-debugger) continue
diff --git a/deps/jerry/tests/debugger/do_continue.js b/deps/jerry/tests/debugger/do_continue.js
new file mode 100644 (file)
index 0000000..6d8526c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+/* Empty file. */
diff --git a/deps/jerry/tests/debugger/do_delete.cmd b/deps/jerry/tests/debugger/do_delete.cmd
new file mode 100644 (file)
index 0000000..974c7c5
--- /dev/null
@@ -0,0 +1,12 @@
+next
+b do_delete.js:17
+b do_delete.js:21
+y
+b do_delete.js:19
+b do_delete.js:18
+list
+delete 2
+delete 3
+list
+c
+c
diff --git a/deps/jerry/tests/debugger/do_delete.expected b/deps/jerry/tests/debugger/do_delete.expected
new file mode 100644 (file)
index 0000000..6864444
--- /dev/null
@@ -0,0 +1,29 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_delete.js:15
+(jerry-debugger) next
+Stopped at tests/debugger/do_delete.js:17
+(jerry-debugger) b do_delete.js:17
+Breakpoint 1 at tests/debugger/do_delete.js:17
+(jerry-debugger) b do_delete.js:21
+No breakpoint found, do you want to add a pending breakpoint? (y or [n])
+Pending breakpoint at do_delete.js:21
+(jerry-debugger) b do_delete.js:19
+Breakpoint 3 at tests/debugger/do_delete.js:19
+(jerry-debugger) b do_delete.js:18
+Breakpoint 4 at tests/debugger/do_delete.js:18
+(jerry-debugger) list
+=== Active breakpoints  ===
+ 1: tests/debugger/do_delete.js:17
+ 3: tests/debugger/do_delete.js:19
+ 4: tests/debugger/do_delete.js:18
+=== Pending breakpoints ===
+ 2: do_delete.js:21 (pending)
+(jerry-debugger) delete 2
+(jerry-debugger) delete 3
+(jerry-debugger) list
+=== Active breakpoints  ===
+ 1: tests/debugger/do_delete.js:17
+ 4: tests/debugger/do_delete.js:18
+(jerry-debugger) c
+Stopped at breakpoint:4 tests/debugger/do_delete.js:18
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_delete.js b/deps/jerry/tests/debugger/do_delete.js
new file mode 100644 (file)
index 0000000..f4b42e8
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+print("delete tests");
+
+var x = 10;
+var y = 10;
+var pi = 3.14;
+
+function delete_test(x,y) {
+       var sum = x + y;
+       return
+}
+
+delete_test(x, y);
+
+var z = 0;
diff --git a/deps/jerry/tests/debugger/do_delete_all.cmd b/deps/jerry/tests/debugger/do_delete_all.cmd
new file mode 100644 (file)
index 0000000..224ee77
--- /dev/null
@@ -0,0 +1,11 @@
+break do_delete_all.js:17
+b do_delete_all.js:18
+b do_delete_all.js:21
+b do_delete_all:350
+y
+b do_delete_all:37
+y
+list
+delete all
+next
+c
diff --git a/deps/jerry/tests/debugger/do_delete_all.expected b/deps/jerry/tests/debugger/do_delete_all.expected
new file mode 100644 (file)
index 0000000..3d80eb7
--- /dev/null
@@ -0,0 +1,26 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_delete_all.js:15
+(jerry-debugger) break do_delete_all.js:17
+Breakpoint 1 at tests/debugger/do_delete_all.js:17
+(jerry-debugger) b do_delete_all.js:18
+Breakpoint 2 at tests/debugger/do_delete_all.js:18
+(jerry-debugger) b do_delete_all.js:21
+Breakpoint 3 at tests/debugger/do_delete_all.js:21 (in delete_test() at line:20, col:1)
+(jerry-debugger) b do_delete_all:350
+No breakpoint found, do you want to add a pending breakpoint? (y or [n])
+Pending breakpoint at do_delete_all:350
+(jerry-debugger) b do_delete_all:37
+No breakpoint found, do you want to add a pending breakpoint? (y or [n])
+Pending breakpoint at do_delete_all:37
+(jerry-debugger) list
+=== Active breakpoints  ===
+ 1: tests/debugger/do_delete_all.js:17
+ 2: tests/debugger/do_delete_all.js:18
+ 3: tests/debugger/do_delete_all.js:21 (in delete_test() at line:20, col:1)
+=== Pending breakpoints ===
+ 4: do_delete_all:350 (pending)
+ 5: do_delete_all:37 (pending)
+(jerry-debugger) delete all
+(jerry-debugger) next
+Stopped at tests/debugger/do_delete_all.js:16
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_delete_all.js b/deps/jerry/tests/debugger/do_delete_all.js
new file mode 100644 (file)
index 0000000..59d2463
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var str = "Delete all breakpoints";
+var patt = new RegExp("e");
+var res = patt.test(str);
+var pi = Math.PI;
+
+function delete_test(x,y) {
+       var sum = x + y;
+}
diff --git a/deps/jerry/tests/debugger/do_display.cmd b/deps/jerry/tests/debugger/do_display.cmd
new file mode 100644 (file)
index 0000000..9b85eaf
--- /dev/null
@@ -0,0 +1,13 @@
+b a
+b b
+b c
+b d
+display
+c
+display 2
+c
+display 5435
+c
+display 0
+c
+c
diff --git a/deps/jerry/tests/debugger/do_display.expected b/deps/jerry/tests/debugger/do_display.expected
new file mode 100644 (file)
index 0000000..ac5a429
--- /dev/null
@@ -0,0 +1,52 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_display.js:20
+(jerry-debugger) b a
+Breakpoint 1 at tests/debugger/do_display.js:15 (in a() at line:15, col:1)
+(jerry-debugger) b b
+Breakpoint 2 at tests/debugger/do_display.js:16 (in b() at line:16, col:1)
+(jerry-debugger) b c
+Breakpoint 3 at tests/debugger/do_display.js:17 (in c() at line:17, col:1)
+(jerry-debugger) b d
+Breakpoint 4 at tests/debugger/do_display.js:18 (in d() at line:18, col:1)
+(jerry-debugger) display
+Non-negative integer number expected, 0 turns off this function
+(jerry-debugger) c
+Stopped at breakpoint:1 tests/debugger/do_display.js:15 (in a() at line:15, col:1)
+(jerry-debugger) display 2
+(jerry-debugger) c
+Stopped at breakpoint:2 tests/debugger/do_display.js:16 (in b() at line:16, col:1)
+Source: tests/debugger/do_display.js
+  15   function a() { print("hi"); }
+  16 > function b() { print("welcome"); }
+  17   function c() { print("hello"); }
+(jerry-debugger) display 5435
+(jerry-debugger) c
+Stopped at breakpoint:3 tests/debugger/do_display.js:17 (in c() at line:17, col:1)
+Source: tests/debugger/do_display.js
+   1   // Copyright JS Foundation and other contributors, http://js.foundation
+   2   //
+   3   // Licensed under the Apache License, Version 2.0 (the "License");
+   4   // you may not use this file except in compliance with the License.
+   5   // You may obtain a copy of the License at
+   6   //
+   7   //     http://www.apache.org/licenses/LICENSE-2.0
+   8   //
+   9   // Unless required by applicable law or agreed to in writing, software
+  10   // distributed under the License is distributed on an "AS IS" BASIS
+  11   // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  12   // See the License for the specific language governing permissions and
+  13   // limitations under the License.
+  14   
+  15   function a() { print("hi"); }
+  16   function b() { print("welcome"); }
+  17 > function c() { print("hello"); }
+  18   function d() { print("goodbye"); }
+  19   
+  20   a();
+  21   b();
+  22   c();
+  23   d();
+(jerry-debugger) display 0
+(jerry-debugger) c
+Stopped at breakpoint:4 tests/debugger/do_display.js:18 (in d() at line:18, col:1)
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_display.js b/deps/jerry/tests/debugger/do_display.js
new file mode 100644 (file)
index 0000000..b57be6d
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+function a() { print("hi"); }
+function b() { print("welcome"); }
+function c() { print("hello"); }
+function d() { print("goodbye"); }
+
+a();
+b();
+c();
+d();
diff --git a/deps/jerry/tests/debugger/do_eval.cmd b/deps/jerry/tests/debugger/do_eval.cmd
new file mode 100644 (file)
index 0000000..9dba76d
--- /dev/null
@@ -0,0 +1,13 @@
+e a
+n
+eval a
+break f
+n
+e b
+next
+e b
+e "1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 XXX 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 YYY 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 ZZZ " + 123
+e b = 8
+n
+e a
+c
diff --git a/deps/jerry/tests/debugger/do_eval.expected b/deps/jerry/tests/debugger/do_eval.expected
new file mode 100644 (file)
index 0000000..496b7c8
--- /dev/null
@@ -0,0 +1,27 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_eval.js:15
+(jerry-debugger) e a
+undefined
+(jerry-debugger) n
+Stopped at tests/debugger/do_eval.js:23
+(jerry-debugger) eval a
+5
+(jerry-debugger) break f
+Breakpoint 1 at tests/debugger/do_eval.js:19 (in f() at line:17, col:1)
+(jerry-debugger) n
+Stopped at breakpoint:1 tests/debugger/do_eval.js:19 (in f() at line:17, col:1)
+(jerry-debugger) e b
+undefined
+(jerry-debugger) next
+Stopped at tests/debugger/do_eval.js:20 (in f() at line:17, col:1)
+(jerry-debugger) e b
+6
+(jerry-debugger) e "1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 XXX 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 YYY 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 ZZZ " + 123
+1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 XXX 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 YYY 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 ZZZ 123
+(jerry-debugger) e b = 8
+8
+(jerry-debugger) n
+Stopped at tests/debugger/do_eval.js:24
+(jerry-debugger) e a
+11.3
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_eval.js b/deps/jerry/tests/debugger/do_eval.js
new file mode 100644 (file)
index 0000000..a9ef01e
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+var a = 5;
+
+function f(a)
+{
+  var b = 6;
+  return a + b;
+}
+
+a = f(3.3);
+null;
diff --git a/deps/jerry/tests/debugger/do_eval_syntax.cmd b/deps/jerry/tests/debugger/do_eval_syntax.cmd
new file mode 100644 (file)
index 0000000..71e2eee
--- /dev/null
@@ -0,0 +1,3 @@
+n
+eval loop
+c
diff --git a/deps/jerry/tests/debugger/do_eval_syntax.expected b/deps/jerry/tests/debugger/do_eval_syntax.expected
new file mode 100644 (file)
index 0000000..d944d68
--- /dev/null
@@ -0,0 +1,7 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_eval_syntax.js:24
+(jerry-debugger) n
+Stopped at tests/debugger/do_eval_syntax.js:26
+(jerry-debugger) eval loop
+Uncaught exception: Error
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_eval_syntax.js b/deps/jerry/tests/debugger/do_eval_syntax.js
new file mode 100644 (file)
index 0000000..efe481d
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+function foo(loop)
+{
+    while(loop)
+    {
+        print("eval");
+        print("syntax");
+    }
+}
+
+var a = 10;
+
+eval("bar = function bar() {\nprint('bar function') }");
+bar();
diff --git a/deps/jerry/tests/debugger/do_exception.cmd b/deps/jerry/tests/debugger/do_exception.cmd
new file mode 100644 (file)
index 0000000..c7df8d1
--- /dev/null
@@ -0,0 +1,5 @@
+c
+c
+c
+c
+quit
diff --git a/deps/jerry/tests/debugger/do_exception.expected b/deps/jerry/tests/debugger/do_exception.expected
new file mode 100644 (file)
index 0000000..beb78e2
--- /dev/null
@@ -0,0 +1,19 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_exception.js:15
+(jerry-debugger) c
+Exception throw detected (to disable automatic stop type exception 0)
+Exception hint: TypeError
+Stopped around tests/debugger/do_exception.js:19 (in foo() at line:17, col:1)
+(jerry-debugger) c
+Exception throw detected (to disable automatic stop type exception 0)
+Exception hint: ReferenceError
+Stopped at tests/debugger/do_exception.js:24 (in foo() at line:17, col:1)
+(jerry-debugger) c
+Exception throw detected (to disable automatic stop type exception 0)
+Exception hint: 456
+Stopped at tests/debugger/do_exception.js:29 (in foo() at line:17, col:1)
+(jerry-debugger) c
+Exception throw detected (to disable automatic stop type exception 0)
+Exception hint: RangeError: Bad range!
+Stopped around tests/debugger/do_exception.js:34 (in foo() at line:17, col:1)
+(jerry-debugger) quit
diff --git a/deps/jerry/tests/debugger/do_exception.js b/deps/jerry/tests/debugger/do_exception.js
new file mode 100644 (file)
index 0000000..a3c3e1c
--- /dev/null
@@ -0,0 +1,39 @@
+// 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.
+
+print("exception handler configuration test")
+
+function foo() {
+  try {
+    undefined();
+  } catch (e) {
+  }
+
+  try {
+    xxx();
+  } catch (e) {
+  }
+
+  try {
+    throw 456;
+  } catch (e) {
+  }
+
+  try {
+    throw new RangeError("Bad range!");
+  } catch (e) {
+  }
+}
+
+foo()
diff --git a/deps/jerry/tests/debugger/do_help.cmd b/deps/jerry/tests/debugger/do_help.cmd
new file mode 100644 (file)
index 0000000..7906d52
--- /dev/null
@@ -0,0 +1,2 @@
+help
+quit
diff --git a/deps/jerry/tests/debugger/do_help.expected b/deps/jerry/tests/debugger/do_help.expected
new file mode 100644 (file)
index 0000000..4a89474
--- /dev/null
@@ -0,0 +1,11 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_help.js:15
+(jerry-debugger) help
+
+Documented commands (type help <topic>):
+========================================
+b          bt        delete   e          help      ms    quit    src 
+backtrace  c         display  eval       list      n     s       step
+break      continue  dump     exception  memstats  next  source
+
+(jerry-debugger) quit
diff --git a/deps/jerry/tests/debugger/do_help.js b/deps/jerry/tests/debugger/do_help.js
new file mode 100644 (file)
index 0000000..efc849f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+print("help tests");
diff --git a/deps/jerry/tests/debugger/do_list.cmd b/deps/jerry/tests/debugger/do_list.cmd
new file mode 100644 (file)
index 0000000..2dbab75
--- /dev/null
@@ -0,0 +1,4 @@
+b do_list.js:18
+b do_list.js:19
+list
+quit
diff --git a/deps/jerry/tests/debugger/do_list.expected b/deps/jerry/tests/debugger/do_list.expected
new file mode 100644 (file)
index 0000000..d64f4c9
--- /dev/null
@@ -0,0 +1,11 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_list.js:15
+(jerry-debugger) b do_list.js:18
+Breakpoint 1 at tests/debugger/do_list.js:18
+(jerry-debugger) b do_list.js:19
+Breakpoint 2 at tests/debugger/do_list.js:19
+(jerry-debugger) list
+=== Active breakpoints  ===
+ 1: tests/debugger/do_list.js:18
+ 2: tests/debugger/do_list.js:19
+(jerry-debugger) quit
diff --git a/deps/jerry/tests/debugger/do_list.js b/deps/jerry/tests/debugger/do_list.js
new file mode 100644 (file)
index 0000000..2fe7198
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+print("list tests");
+
+var x = 10;
+var y = 10;
+var pi = 3.14;
+var z = x + y;
diff --git a/deps/jerry/tests/debugger/do_next.cmd b/deps/jerry/tests/debugger/do_next.cmd
new file mode 100644 (file)
index 0000000..f507eef
--- /dev/null
@@ -0,0 +1,3 @@
+next
+next
+c
diff --git a/deps/jerry/tests/debugger/do_next.expected b/deps/jerry/tests/debugger/do_next.expected
new file mode 100644 (file)
index 0000000..4a87f11
--- /dev/null
@@ -0,0 +1,7 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_next.js:15
+(jerry-debugger) next
+Stopped at tests/debugger/do_next.js:17
+(jerry-debugger) next
+Stopped at tests/debugger/do_next.js:18
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_next.js b/deps/jerry/tests/debugger/do_next.js
new file mode 100644 (file)
index 0000000..e35a813
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+print("next test");
+
+print ("var cat");
+var cat = 'cat';
+
+function test()
+{
+  function f()
+  {
+    return 0;
+  }
+}
+
+test();
diff --git a/deps/jerry/tests/debugger/do_pending_breakpoints.cmd b/deps/jerry/tests/debugger/do_pending_breakpoints.cmd
new file mode 100644 (file)
index 0000000..e57e4d5
--- /dev/null
@@ -0,0 +1,7 @@
+break f
+y
+list
+n
+n
+c
+c
diff --git a/deps/jerry/tests/debugger/do_pending_breakpoints.expected b/deps/jerry/tests/debugger/do_pending_breakpoints.expected
new file mode 100644 (file)
index 0000000..e4283d4
--- /dev/null
@@ -0,0 +1,16 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_pending_breakpoints.js:15
+(jerry-debugger) break f
+No breakpoint found, do you want to add a pending breakpoint? (y or [n])
+Pending breakpoint at f()
+(jerry-debugger) list
+=== Pending breakpoints ===
+ 1: f() (pending)
+(jerry-debugger) n
+Stopped at tests/debugger/do_pending_breakpoints.js:17
+(jerry-debugger) n
+Breakpoint 2 at <unknown>:1 (in f() at line:1, col:1)
+Stopped at tests/debugger/do_pending_breakpoints.js:19
+(jerry-debugger) c
+Stopped at breakpoint:2 <unknown>:1 (in f() at line:1, col:1)
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_pending_breakpoints.js b/deps/jerry/tests/debugger/do_pending_breakpoints.js
new file mode 100644 (file)
index 0000000..a706216
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+print("pending-breakpoints");
+
+eval("function f(){ return 5 }");
+
+var bird = "colibri";
+f();
+var a = 234;
diff --git a/deps/jerry/tests/debugger/do_quit.cmd b/deps/jerry/tests/debugger/do_quit.cmd
new file mode 100644 (file)
index 0000000..ff60466
--- /dev/null
@@ -0,0 +1 @@
+quit
diff --git a/deps/jerry/tests/debugger/do_quit.expected b/deps/jerry/tests/debugger/do_quit.expected
new file mode 100644 (file)
index 0000000..de1ca1c
--- /dev/null
@@ -0,0 +1,3 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_quit.js:15
+(jerry-debugger) quit
diff --git a/deps/jerry/tests/debugger/do_quit.js b/deps/jerry/tests/debugger/do_quit.js
new file mode 100644 (file)
index 0000000..afdda5d
--- /dev/null
@@ -0,0 +1,41 @@
+// 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.
+
+print("quit test");
+
+function func() {
+  'use strict';
+  'use stri' + 'ct';
+}
+
+{
+  {
+    print("quit");
+  }
+}
+
+;
+;
+
+var
+  x =
+    1,
+  y =
+    2
+
+test = function
+(
+)
+{
+}
diff --git a/deps/jerry/tests/debugger/do_src.cmd b/deps/jerry/tests/debugger/do_src.cmd
new file mode 100644 (file)
index 0000000..38ab83e
--- /dev/null
@@ -0,0 +1,9 @@
+b f
+n
+next
+s
+source 0
+n
+step
+src
+c
diff --git a/deps/jerry/tests/debugger/do_src.expected b/deps/jerry/tests/debugger/do_src.expected
new file mode 100644 (file)
index 0000000..a80f4ba
--- /dev/null
@@ -0,0 +1,18 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_src.js:19
+(jerry-debugger) b f
+Breakpoint 1 at tests/debugger/do_src.js:16 (in f() at line:15, col:1)
+(jerry-debugger) n
+Stopped at breakpoint:1 tests/debugger/do_src.js:16 (in f() at line:15, col:1)
+(jerry-debugger) next
+Stopped at tests/debugger/do_src.js:20
+(jerry-debugger) s
+Stopped at <unknown>:1
+(jerry-debugger) source 0
+   1 > f = function f() {
+(jerry-debugger) n
+Stopped at tests/debugger/do_src.js:21
+(jerry-debugger) step
+Stopped at <unknown>:2 (in f() at line:1, col:5)
+(jerry-debugger) src
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_src.js b/deps/jerry/tests/debugger/do_src.js
new file mode 100644 (file)
index 0000000..f43419f
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+function f() {
+  print("F1");
+}
+
+f();
+eval("f = function f() {\nprint('F2') }");
+f();
diff --git a/deps/jerry/tests/debugger/do_step.cmd b/deps/jerry/tests/debugger/do_step.cmd
new file mode 100644 (file)
index 0000000..163cf80
--- /dev/null
@@ -0,0 +1,10 @@
+step
+step
+backtrace
+next
+bt
+next
+s
+n
+bt
+c
diff --git a/deps/jerry/tests/debugger/do_step.expected b/deps/jerry/tests/debugger/do_step.expected
new file mode 100644 (file)
index 0000000..2945d63
--- /dev/null
@@ -0,0 +1,25 @@
+Connecting to: localhost:5001
+Stopped at tests/debugger/do_step.js:32
+(jerry-debugger) step
+Stopped at tests/debugger/do_step.js:22 (in f1() at line:15, col:1)
+(jerry-debugger) step
+Stopped at tests/debugger/do_step.js:19 (in g() at line:17, col:3)
+(jerry-debugger) backtrace
+Frame 0: tests/debugger/do_step.js:19 (in g() at line:17, col:3)
+Frame 1: tests/debugger/do_step.js:22 (in f1() at line:15, col:1)
+Frame 2: tests/debugger/do_step.js:32
+(jerry-debugger) next
+Stopped at tests/debugger/do_step.js:23 (in f1() at line:15, col:1)
+(jerry-debugger) bt
+Frame 0: tests/debugger/do_step.js:23 (in f1() at line:15, col:1)
+Frame 1: tests/debugger/do_step.js:32
+(jerry-debugger) next
+Stopped at tests/debugger/do_step.js:33
+(jerry-debugger) s
+Stopped at tests/debugger/do_step.js:28 (in f2() at line:26, col:1)
+(jerry-debugger) n
+Stopped at tests/debugger/do_step.js:29 (in f2() at line:26, col:1)
+(jerry-debugger) bt
+Frame 0: tests/debugger/do_step.js:29 (in f2() at line:26, col:1)
+Frame 1: tests/debugger/do_step.js:33
+(jerry-debugger) c
diff --git a/deps/jerry/tests/debugger/do_step.js b/deps/jerry/tests/debugger/do_step.js
new file mode 100644 (file)
index 0000000..c0de223
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+
+function f1()
+{
+  function g()
+  {
+    return 6;
+  }
+
+  var i = g();
+  g();
+}
+
+function f2()
+{
+  f1();
+  return 7;
+}
+
+f1();
+f2();
diff --git a/deps/jerry/tests/hello.js b/deps/jerry/tests/hello.js
new file mode 100644 (file)
index 0000000..ea3ab71
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+print ("Hello JerryScript!");
diff --git a/deps/jerry/tests/jerry-test-suite/06/06-001.js b/deps/jerry/tests/jerry-test-suite/06/06-001.js
new file mode 100644 (file)
index 0000000..10d68b9
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var str = "a\u000Ab";
+assert(str[1] === '\n');
diff --git a/deps/jerry/tests/jerry-test-suite/06/06-002.js b/deps/jerry/tests/jerry-test-suite/06/06-002.js
new file mode 100644 (file)
index 0000000..250efa5
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+function c(arg)
+{
+  var obj = new Object();
+  obj.print = function () {
+    f = arg;
+  };
+  return obj;
+}
+
+a = c(5);
+b = c(6);
+
+a.print.toString = 7;
+
+assert(typeof a.print.toString !== typeof b.print.toString);
diff --git a/deps/jerry/tests/jerry-test-suite/06/06-003.js b/deps/jerry/tests/jerry-test-suite/06/06-003.js
new file mode 100644 (file)
index 0000000..f737280
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var obj = new Object();
+
+function c(arg)
+{
+  var obj = new Object();
+  obj.par = arg;
+  obj.print = function () {
+    return arg;
+  };
+  return obj;
+}
+
+var a = c(5);
+var b = c(6);
+assert(a.print() + b.par === 11);
+
diff --git a/deps/jerry/tests/jerry-test-suite/06/06-004.js b/deps/jerry/tests/jerry-test-suite/06/06-004.js
new file mode 100644 (file)
index 0000000..2828bcd
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var arg = 3;
+function a() {
+  return 5 + arg;
+}
+
+arg = 4;
+var b = function () {
+  return 6 + arg;
+};
+
+arg = 5;
+c = function e() {
+  return 7 + arg;
+};
+
+assert(a() + b() + c() === 33);
diff --git a/deps/jerry/tests/jerry-test-suite/06/06-005.js b/deps/jerry/tests/jerry-test-suite/06/06-005.js
new file mode 100644 (file)
index 0000000..e121055
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = "\u0410\u0411";
+var b = "\u0509\u0413";
+
+assert(a < b);
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.06/07.06.01/07.06.01-001.js b/deps/jerry/tests/jerry-test-suite/07/07.06/07.06.01/07.06.01-001.js
new file mode 100644 (file)
index 0000000..d0e33f8
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+var let = 1;
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.08/07.08.05/07.08.05-001.js b/deps/jerry/tests/jerry-test-suite/07/07.08/07.08.05/07.08.05-001.js
new file mode 100644 (file)
index 0000000..85d9725
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+/a[a-z]/.exec("abcdefghi");
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-001.js b/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-001.js
new file mode 100644 (file)
index 0000000..2fc8871
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+{ 1
+2 } 3
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-002.js b/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-002.js
new file mode 100644 (file)
index 0000000..fe6f460
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+function test()
+{
+  var a = 1, b = 2;
+
+  return
+  a + b
+}
+
+var v = test();
+
+assert(v !== 3);
+
+assert(typeof v === "undefined")
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-003.js b/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-003.js
new file mode 100644 (file)
index 0000000..ac9a0a0
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var b = 4, c = 5;
+
+a = b
+++c
+
+assert(a === 4 && c === 6);
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-004.js b/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-004.js
new file mode 100644 (file)
index 0000000..bfba9ae
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+var obj = new Object();
+
+function c(arg)
+{
+  var obj = new Object();
+  obj.par = arg;
+  obj.print = function () {
+    return arg;
+  }
+  return obj;
+}
+
+var a, b = 1, d = 2, e = 3;
+
+a = b + c
+        (d + e).print()
+
+assert(a === 6);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-005.js b/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-005.js
new file mode 100644 (file)
index 0000000..da99c44
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var b = 4, c = 5;
+
+a = b
+--c
+
+assert(a === 4 && c === 4);
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-006.js b/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-006.js
new file mode 100644 (file)
index 0000000..204b21d
--- /dev/null
@@ -0,0 +1,31 @@
+// 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.
+
+var mainloop = 1, cnt = 0;
+
+for (var i = 0; i < 10; ++i)
+{
+  for (var j = 0; j < 10; ++j)
+  {
+    if (j == 6)
+    {
+      continue
+      mainloop
+    }
+
+    ++cnt;
+  }
+}
+
+assert(cnt == 90);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-007.js b/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-007.js
new file mode 100644 (file)
index 0000000..56d3ab9
--- /dev/null
@@ -0,0 +1,31 @@
+// 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.
+
+var mainloop = 1, cnt = 0;
+
+for (var i = 0; i < 10; ++i)
+{
+  for (var j = 0; j < 10; ++j)
+  {
+    if (j == 6)
+    {
+      break
+      mainloop
+    }
+
+    ++cnt;
+  }
+}
+
+assert(cnt == 60);
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-008.js b/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-008.js
new file mode 100644 (file)
index 0000000..bc3991f
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+function test()
+{
+  var a = 10, b = 5;
+  var c = a + b
+
+  return c;
+}
+
+assert(test() == 15);
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-009.js b/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-009.js
new file mode 100644 (file)
index 0000000..1cc3c0f
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+{
+  var a, b = 3, c = 30;
+  a = b + c}
+    
+assert (a == 33);
diff --git a/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-010.js b/deps/jerry/tests/jerry-test-suite/07/07.09/07.09-010.js
new file mode 100644 (file)
index 0000000..a4e1526
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+assert (glob === undefined);
+
+var glob = 34
+
+assert (glob === 34);
+
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-001.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-001.js
new file mode 100644 (file)
index 0000000..1e8bba0
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a;
+assert(typeof (a) === "undefined");
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-002.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-002.js
new file mode 100644 (file)
index 0000000..e27f67d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var o = {};
+
+assert(typeof (o.empty) === "undefined");
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-003.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-003.js
new file mode 100644 (file)
index 0000000..550d793
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a;
+var b = null;
+
+assert(a == b);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-004.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-004.js
new file mode 100644 (file)
index 0000000..af4461a
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a;
+assert(!a);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-005.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-005.js
new file mode 100644 (file)
index 0000000..ff8287b
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+a = foo();
+
+assert(typeof (a) === "undefined");
+
+function foo() {
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-006.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-006.js
new file mode 100644 (file)
index 0000000..89923ef
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof (void 0) === "undefined");
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-007.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-007.js
new file mode 100644 (file)
index 0000000..1f28fea
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(undefined === void 0);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-008.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-008.js
new file mode 100644 (file)
index 0000000..6d90482
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x;
+assert(x === void 0);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-009.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-009.js
new file mode 100644 (file)
index 0000000..2331bda
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var x;
+assert(test1() === void 0);
+
+function test1(x) {
+  return x;
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-010.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-010.js
new file mode 100644 (file)
index 0000000..9b2f142
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+assert (test ());
+
+function test (arg)
+{
+  if (typeof (arg) === "undefined")
+    return true;
+  else
+    return false;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-011.js b/deps/jerry/tests/jerry-test-suite/08/08.01/08.01-011.js
new file mode 100644 (file)
index 0000000..9b2f142
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+assert (test ());
+
+function test (arg)
+{
+  if (typeof (arg) === "undefined")
+    return true;
+  else
+    return false;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.02/08.02-001.js b/deps/jerry/tests/jerry-test-suite/08/08.02/08.02-001.js
new file mode 100644 (file)
index 0000000..baa43ef
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+var x = null;
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.02/08.02-002.js b/deps/jerry/tests/jerry-test-suite/08/08.02/08.02-002.js
new file mode 100644 (file)
index 0000000..55c3455
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof null == 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.03/08.03-001.js b/deps/jerry/tests/jerry-test-suite/08/08.03/08.03-001.js
new file mode 100644 (file)
index 0000000..ab47e44
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+assert(a);
+
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.03/08.03-002.js b/deps/jerry/tests/jerry-test-suite/08/08.03/08.03-002.js
new file mode 100644 (file)
index 0000000..f4b6fa1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false;
+assert(!a);
+
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.03/08.03-003.js b/deps/jerry/tests/jerry-test-suite/08/08.03/08.03-003.js
new file mode 100644 (file)
index 0000000..c5f41a6
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(false == true));
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.03/08.03-004.js b/deps/jerry/tests/jerry-test-suite/08/08.03/08.03-004.js
new file mode 100644 (file)
index 0000000..7559398
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(false === true));
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-001.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-001.js
new file mode 100644 (file)
index 0000000..d62c047
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+a = '';
+assert(typeof a == "string");
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-002.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-002.js
new file mode 100644 (file)
index 0000000..20522ca
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(("x\0a" < "x\0b") && ("x\0b" < "x\0c"));
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-003.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-003.js
new file mode 100644 (file)
index 0000000..e38fc37
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var str = "test";
+assert(str.constructor === String);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-004.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-004.js
new file mode 100644 (file)
index 0000000..6880385
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var s = 'hello';
+assert(s[0] == 'h');
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-005.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-005.js
new file mode 100644 (file)
index 0000000..d2c6107
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var s = 'hello';
+assert(s[5] == undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-006.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-006.js
new file mode 100644 (file)
index 0000000..ddcdbc6
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var str = 'ABC';
+var strObj = new String('ABC');
+assert(str.constructor === strObj.constructor);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-007.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-007.js
new file mode 100644 (file)
index 0000000..6d1968a
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var str = 'ABC';
+var strObj = new String('ABC');
+assert(str == strObj);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-008.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-008.js
new file mode 100644 (file)
index 0000000..9b0453e
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var str = 'ABC';
+var strObj = new String('ABC');
+
+assert(str !== strObj);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-009.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-009.js
new file mode 100644 (file)
index 0000000..2997dc7
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var str = "";
+var strObj = new String("");
+var strObj_ = new String();
+
+assert(str.constructor === strObj.constructor);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-010.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-010.js
new file mode 100644 (file)
index 0000000..02c02f1
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var str = "";
+var strObj = new String("");
+var strObj_ = new String();
+
+assert(str.constructor === strObj_.constructor);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-011.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-011.js
new file mode 100644 (file)
index 0000000..310d736
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var str = "";
+var strObj = new String("");
+var strObj_ = new String();
+
+assert(str == strObj);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-012.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-012.js
new file mode 100644 (file)
index 0000000..f54e171
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var str = "";
+var strObj = new String("");
+var strObj_ = new String();
+
+assert(str !== strObj);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-013.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-013.js
new file mode 100644 (file)
index 0000000..964b12a
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var str = "";
+var strObj = new String;
+
+assert(str.constructor === strObj.constructor);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-014.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-014.js
new file mode 100644 (file)
index 0000000..2586173
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var str = "";
+var strObj = new String;
+
+assert(str == strObj);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-015.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-015.js
new file mode 100644 (file)
index 0000000..1db779c
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var str = "";
+var strObj = new String;
+
+assert(str !== strObj);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-016.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-016.js
new file mode 100644 (file)
index 0000000..6f3b1d7
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var str = "";
+var strObj = new String;
+
+assert(typeof str != typeof strObj);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-017.js b/deps/jerry/tests/jerry-test-suite/08/08.04/08.04-017.js
new file mode 100644 (file)
index 0000000..93f72e2
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var __str__ = "\u0041\u0042\u0043" + 'ABC'
+assert(__str__ === 'ABCABC');
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.05/08.05-001.js b/deps/jerry/tests/jerry-test-suite/08/08.05/08.05-001.js
new file mode 100644 (file)
index 0000000..e66b355
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+a = 0x3e7;
+assert(a == 999);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.05/08.05-002.js b/deps/jerry/tests/jerry-test-suite/08/08.05/08.05-002.js
new file mode 100644 (file)
index 0000000..35dcf50
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof -Infinity == 'number');
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.05/08.05-003.js b/deps/jerry/tests/jerry-test-suite/08/08.05/08.05-003.js
new file mode 100644 (file)
index 0000000..f0386f6
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(0 > -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/08/08.12/08.12.02/08.12.02-001.js b/deps/jerry/tests/jerry-test-suite/08/08.12/08.12.02/08.12.02-001.js
new file mode 100644 (file)
index 0000000..c797fcc
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var prot = {
+  b: 3
+};
+
+function Custom() {
+}
+
+Custom.prototype = prot;
+
+var obj = new Custom();
+
+assert(obj.b === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/10/10.03/10.03.01/10.03.01-001.js b/deps/jerry/tests/jerry-test-suite/10/10.03/10.03.01/10.03.01-001.js
new file mode 100644 (file)
index 0000000..63f1ecd
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+a = 10;
+
+function foo() {
+  var b = 20;
+
+  assert(a + b === 30);
+}
+
+foo();
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-001.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-001.js
new file mode 100644 (file)
index 0000000..9cacad0
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  b: 5
+};
+
+assert(a.b === 5);
+
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-002.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-002.js
new file mode 100644 (file)
index 0000000..17bf233
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  "b": 5
+};
+
+assert(a.b === 5);
+
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-003.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-003.js
new file mode 100644 (file)
index 0000000..67ca765
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  10: 5
+};
+
+assert(a[10] === 5);
+
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-004.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-004.js
new file mode 100644 (file)
index 0000000..fec7f12
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = {
+  10.25: 5
+};
+
+assert(a[10.25] === 5);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-005.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-005.js
new file mode 100644 (file)
index 0000000..621532a
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  prop1: 1,
+  prop2: 2
+};
+
+assert(a.prop1 === 1 && a.prop2 === 2);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-006.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-006.js
new file mode 100644 (file)
index 0000000..f2c348b
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = {
+  get a() {
+    return 3;
+  }
+};
+
+assert(a.a === 3);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-007.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-007.js
new file mode 100644 (file)
index 0000000..49058be
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var a = {
+  _a: 3,
+  get a() {
+    return this._a;
+  }
+};
+
+a._a = 5;
+
+assert(a.a === 5);
+
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-008.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.05/11.01.05-008.js
new file mode 100644 (file)
index 0000000..ffe0745
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+var a = {
+  _a: 3,
+  get a() {
+    return this._a;
+  },
+  set a(newa) {
+    this._a = newa;
+  }
+
+};
+
+a.a = 5;
+
+assert(a.a === 5);
+
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-001.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-001.js
new file mode 100644 (file)
index 0000000..8dea7d5
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var a = [1, 2, 4];
+var cnt = 0;
+
+for (var i = (0 in a) ? 1 : 2; i < 10; ++i)
+{
+  ++cnt;
+}
+
+assert(cnt == 9);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-002.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-002.js
new file mode 100644 (file)
index 0000000..25e2876
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 1;
+var b = 2;
+assert(a + b === (a + b));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-003.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-003.js
new file mode 100644 (file)
index 0000000..946ffb0
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 2;
+var b = 3;
+
+assert((a) + (b) === (a + b));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-004.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-004.js
new file mode 100644 (file)
index 0000000..61e7dd1
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+a = {
+  n: Number,
+  s: String
+};
+b = {
+  n: Number,
+  s: String
+};
+a.n = 1;
+b.n = 2;
+a.s = "qwe";
+b.s = "rty";
+
+assert(((a).n + (b).n === 3) && ((a).s + (b).s === "qwerty"));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-005.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-005.js
new file mode 100644 (file)
index 0000000..fe9b00a
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+a = {
+  n: Number,
+  s: String
+}
+
+assert(delete(a.n) === true);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-006.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-006.js
new file mode 100644 (file)
index 0000000..e81d033
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+a = {
+  n: Number,
+  s: String
+}
+
+assert(typeof (a.property) === "undefined");
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-009.js b/deps/jerry/tests/jerry-test-suite/11/11.01/11.01.06/11.01.06-009.js
new file mode 100644 (file)
index 0000000..f7bd472
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof (a) === "undefined");
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-001.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-001.js
new file mode 100644 (file)
index 0000000..e1bbf45
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = {name: "name", value: "1"};
+
+assert(a.name !== "nameeeeeeeeeee");
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-002.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-002.js
new file mode 100644 (file)
index 0000000..6b7f6fc
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = {name: "name", value: "1"};
+var b = {name: "b", value: "1"};
+
+assert((a.name == b.name) || (a.value == b.value));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-003.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-003.js
new file mode 100644 (file)
index 0000000..a95080f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = {name: "name", value: "1"};
+
+assert(a[1] !== "nameeeeeeeeeee");
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-004.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-004.js
new file mode 100644 (file)
index 0000000..99ff8c2
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var name = "name"
+var a = {name: "name", value: "1"};
+
+assert(a[name] == "name");
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-007.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-007.js
new file mode 100644 (file)
index 0000000..4e45123
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var a = {name: "a", value: "1"};
+var b = {name: "b", value: "1"};
+assert(plus(a, b) !== 2)
+
+function plus(a, b)
+{
+  return a.value + b.value;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-008.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-008.js
new file mode 100644 (file)
index 0000000..c0a667d
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var a = {name: "a", value: "1"};
+var b = {name: "b", value: "1"};
+
+assert(isNaN(plus(a, b)));
+
+function plus(a, b)
+{
+  return a.value * b.name;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-009.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-009.js
new file mode 100644 (file)
index 0000000..fc54452
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var a = {name: "a", value: "1"};
+var b = {name: "b", value: "1"};
+
+assert(plus(a, b) === "11");
+
+function plus(a, b)
+{
+  return a.value + b.value;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-010.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-010.js
new file mode 100644 (file)
index 0000000..0098625
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var a = {name: "a", value: "1"};
+var b = {name: "b", value: 1};
+
+assert(plus(a, b) === "11");
+
+function plus(a, b)
+{
+  return a.value + b.value;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-011.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.01/11.02.01-011.js
new file mode 100644 (file)
index 0000000..5c7fc6f
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var a = {name: "a", value: 1};
+var b = {name: "b", value: 1};
+
+assert(plus(a, b) === 2);
+
+function plus(a, b)
+{
+  return a.value + b.value;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-001.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-001.js
new file mode 100644 (file)
index 0000000..405a9ed
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+function Animal(name)
+{
+  this.name = name
+  this.canWalk = true
+}
+
+var animal = new Animal("animal");
+assert(animal.name === "animal");
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-002.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-002.js
new file mode 100644 (file)
index 0000000..74f7541
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+function Animal(name)
+{
+  this.name = name
+  this.canWalk = true
+}
+
+var animal = new Animal("animal");
+assert(animal.name == "animal");
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-003.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-003.js
new file mode 100644 (file)
index 0000000..b377b2a
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+function Animal(name)
+{
+  this.name = name
+  this.canWalk = true
+}
+
+var animal = new Animal("animal");
+assert(animal.name != "insect");
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-004.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-004.js
new file mode 100644 (file)
index 0000000..a09d769
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+function Animal(name)
+{
+  this.name = name
+  this.canWalk = true
+}
+
+var animal = new Animal("animal");
+assert(animal.someparameter != "insect");
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-005.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-005.js
new file mode 100644 (file)
index 0000000..ae927cf
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+function Animal(name)
+{
+  this.name = name
+  this.canWalk = true
+}
+
+var animal = new Animal("animal");
+assert(animal[1] != "animal");
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-006.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-006.js
new file mode 100644 (file)
index 0000000..ee3abc9
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+function Animal(name)
+{
+  this.name = name
+  this.canWalk = true
+  if (name == "bird")
+  {
+    this.canFly = true;
+  }
+}
+
+var animal = new Animal("animal");
+var bird = new Animal("bird");
+assert(animal.canFly !== bird.canFly);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-007.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-007.js
new file mode 100644 (file)
index 0000000..4ebfc54
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+function Animal(name)
+{
+  this.name = name
+  this.canWalk = true
+  if (name == "bird")
+  {
+    this.canFly = true;
+  }
+}
+
+var animal = new Animal("animal");
+var bird = new Animal("bird");
+
+assert(animal.canWalk === true);
+assert(bird.canWalk === true);
+assert(animal.canFly === undefined);
+assert(bird.canFly === true);
+
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-008.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-008.js
new file mode 100644 (file)
index 0000000..683435d
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+function Animal(name)
+{
+  this.name = name
+  this.canWalk = true
+}
+
+var animal = new Animal();
+
+assert(animal.canWalk);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-009.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.02/11.02.02-009.js
new file mode 100644 (file)
index 0000000..0ae3fbb
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = {};
+a.b = true;
+assert(typeof a == "object" && a.b == 1);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-006.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-006.js
new file mode 100644 (file)
index 0000000..e4654fc
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = {};
+a.toString();
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-007.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-007.js
new file mode 100644 (file)
index 0000000..8e34500
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+function foo()
+{
+  return 1;
+}
+assert(foo() === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-008.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-008.js
new file mode 100644 (file)
index 0000000..888b690
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var a = {
+  foo: function ()
+  {
+    return 1;
+  }
+}
+
+assert(a.foo() === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-017.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-017.js
new file mode 100644 (file)
index 0000000..4467574
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var obj = {
+  field: Number,
+  foo: function () {
+    this.field++;
+  }
+}
+
+obj.field = 3;
+obj.foo();
+
+assert(obj.field === 4);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-021.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.03/11.02.03-021.js
new file mode 100644 (file)
index 0000000..eea7ae0
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var a = 1;
+var b = foo();
+function foo()
+{
+  return a;
+}
+
+assert(b === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-001.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-001.js
new file mode 100644 (file)
index 0000000..c27f6a7
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+assert(f_arg().length === 0);
+
+function f_arg() {
+  return arguments;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-002.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-002.js
new file mode 100644 (file)
index 0000000..8971f69
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+assert(f_arg()[0] === undefined);
+
+function f_arg() {
+  return arguments;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-003.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-003.js
new file mode 100644 (file)
index 0000000..18694be
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+assert(f_arg().length === 0);
+
+function f_arg(x, y) {
+  return arguments;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-004.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-004.js
new file mode 100644 (file)
index 0000000..0470e4b
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+assert(f_arg()[0] === undefined);
+
+function f_arg(x,y) {
+  return arguments;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-005.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-005.js
new file mode 100644 (file)
index 0000000..d76f3fe
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+f_arg = function ()
+{
+  return arguments
+}
+
+assert(f_arg(1, 2).length === 2);
+
+f_arg = function () {
+  return arguments;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-006.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-006.js
new file mode 100644 (file)
index 0000000..cbd4d37
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+f_arg = function () {
+  return arguments;
+}
+
+assert(f_arg(1, 2, 3).length === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-007.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-007.js
new file mode 100644 (file)
index 0000000..70cfdd7
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+f_arg = function () {
+  return arguments;
+}
+
+assert(f_arg(1, 2, 3)[0] === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-008.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-008.js
new file mode 100644 (file)
index 0000000..85c8b91
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+f_arg = function () {
+  return arguments;
+}
+
+assert(f_arg(1, 2, 3)[2] === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-009.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-009.js
new file mode 100644 (file)
index 0000000..5a934b8
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+f_arg = function () {
+  return arguments;
+}
+
+assert(f_arg(1, 2, 3)[3] === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-010.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-010.js
new file mode 100644 (file)
index 0000000..42d2a3d
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+f_arg = function () {
+  return arguments;
+}
+
+var args = f_arg (1, 2, 3);
+
+for (var i = 0; i < 3; i++)
+{
+  assert(args[i] === i + 1);
+}
+
+assert(args[3] === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-011.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-011.js
new file mode 100644 (file)
index 0000000..c7f9bed
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+f_arg = function(x,y) {
+  return arguments;
+}
+
+assert(f_arg(1,2,3).length === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-012.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-012.js
new file mode 100644 (file)
index 0000000..3b1c097
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+f_arg = function(x,y) {
+  return arguments;
+}
+
+assert(f_arg(1)[0] === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-013.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-013.js
new file mode 100644 (file)
index 0000000..b542677
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+f_arg = function (x, y) {
+  return arguments;
+}
+
+assert(f_arg(1, 2, 3)[2] === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-014.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-014.js
new file mode 100644 (file)
index 0000000..e7eef83
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+f_arg = function(x,y) {
+  return arguments;
+}
+
+assert(f_arg(1,2,3)[3] === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-016.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-016.js
new file mode 100644 (file)
index 0000000..f9bf5f0
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+function f_arg() {
+}
+
+f_arg(x=1,x);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-017.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-017.js
new file mode 100644 (file)
index 0000000..08c60ef
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+function f_arg() {
+}
+
+try
+{
+  f_arg(x, x = 1);
+}
+catch (e) {
+  assert((e instanceof ReferenceError) === true);
+}
+
+
+
+
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-018.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-018.js
new file mode 100644 (file)
index 0000000..59a185e
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+function f_arg(x, y, z) {
+  return z;
+}
+
+assert(f_arg(x = 1, y = x, x + y) === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-019.js b/deps/jerry/tests/jerry-test-suite/11/11.02/11.02.04/11.02.04-019.js
new file mode 100644 (file)
index 0000000..841bffd
--- /dev/null
@@ -0,0 +1,41 @@
+// 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.
+
+function f_arg() {
+}
+
+
+var x = function () {
+  throw "x";
+};
+var y = function () {
+  throw "y";
+};
+try
+{
+  f_arg(x(), y());
+  assert(false);
+}
+catch (e)
+{
+  if (e === "y")
+  {
+    assert(false);
+  } else {
+    if (e !== "x")
+    {
+      assert(false);
+    }
+  }
+}
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-005.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-005.js
new file mode 100644 (file)
index 0000000..8d8bf38
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 1;
+
+assert((a++ === 1) && (a === 2));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-006.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-006.js
new file mode 100644 (file)
index 0000000..31e1430
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = true;
+var b = false;
+
+assert((a++ === 1) && (b++ === +0) && (a === 2) && (b === 1));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-007.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-007.js
new file mode 100644 (file)
index 0000000..098c06e
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return 1;
+  }
+}
+
+assert((a++ === 1) && (a === 2));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-008.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-008.js
new file mode 100644 (file)
index 0000000..3a7e6fa
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null;
+
+assert((a++ == +0) && (a === 1));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-009.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-009.js
new file mode 100644 (file)
index 0000000..90d8ace
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = undefined;
+
+assert(isNaN(a++) && isNaN(a));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-010.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-010.js
new file mode 100644 (file)
index 0000000..cb2c25f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "1";
+
+assert((a++ === 1) && (a === 2));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-011.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-011.js
new file mode 100644 (file)
index 0000000..2c7166f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "blah";
+assert ( isNaN(a++) && isNaN(a) );
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-012.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-012.js
new file mode 100644 (file)
index 0000000..970f67f
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = "1e3";
+
+assert((a++ === 1e3) && (a === 1001));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-013.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-013.js
new file mode 100644 (file)
index 0000000..09e4aba
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "";
+assert((a++ === 0) && (a === 1));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-014.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-014.js
new file mode 100644 (file)
index 0000000..497c1ba
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "  ";
+assert((a++ === 0) && (a === 1));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-015.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-015.js
new file mode 100644 (file)
index 0000000..ea8e150
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "Infinity";
+
+assert((a++ === Infinity) && (a === Infinity));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-016.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.01/11.03.01-016.js
new file mode 100644 (file)
index 0000000..335dfbe
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "0xa";
+assert((a++ === 0xa) && (a === 0xb));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-005.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-005.js
new file mode 100644 (file)
index 0000000..5154e61
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 1;
+assert((a-- === 1) && (a === 0));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-006.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-006.js
new file mode 100644 (file)
index 0000000..0c2d3ae
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+var b = false;
+assert((a-- === 1) && (b-- === +0) && (a === 0) && (b === -1));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-007.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-007.js
new file mode 100644 (file)
index 0000000..b0c9788
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return 1;
+  }
+}
+
+assert((a-- === 1) && (a === 0));
+    
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-008.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-008.js
new file mode 100644 (file)
index 0000000..b1a96ed
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = null;
+assert((a-- == +0) && (a === -1));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-009.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-009.js
new file mode 100644 (file)
index 0000000..5bb5089
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = undefined;
+assert(isNaN(a--) && isNaN(a));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-010.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-010.js
new file mode 100644 (file)
index 0000000..5c5fcd1
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "1";
+assert((a-- === 1) && (a === 0));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-011.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-011.js
new file mode 100644 (file)
index 0000000..d9aaa16
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "blah";
+assert(isNaN(a--) && isNaN(a));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-012.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-012.js
new file mode 100644 (file)
index 0000000..8b6040e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "1e3";
+assert((a-- === 1e3) && (a === 999));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-013.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-013.js
new file mode 100644 (file)
index 0000000..893b090
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "";
+assert((a-- === 0) && (a === -1));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-014.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-014.js
new file mode 100644 (file)
index 0000000..e9592d2
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = "  ";
+
+assert((a-- === 0) && (a === -1));
+  
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-015.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-015.js
new file mode 100644 (file)
index 0000000..db46d7e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "Infinity";
+assert((a-- === Infinity) && (a === Infinity));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-016.js b/deps/jerry/tests/jerry-test-suite/11/11.03/11.03.02/11.03.02-016.js
new file mode 100644 (file)
index 0000000..e64de6e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "0xa";
+assert((a-- === 0xa) && (a === 9));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-001.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-001.js
new file mode 100644 (file)
index 0000000..eccb52c
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+x = 42;
+
+assert ((delete x) == true);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-002.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-002.js
new file mode 100644 (file)
index 0000000..d7342d0
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var y = 43;
+
+assert((delete y) == false && y == 43);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-003.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-003.js
new file mode 100644 (file)
index 0000000..992e090
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var y = 43;
+
+assert((delete Math.PI) == false);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-004.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-004.js
new file mode 100644 (file)
index 0000000..612feee
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var myobj = {
+  h: 4,
+  k: 5
+};
+
+assert((delete myobj.h) == true && myobj.h == undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-005.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-005.js
new file mode 100644 (file)
index 0000000..51386bb
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+    myobj = {
+        h: 4,
+        k: 5
+    };
+    
+assert ((delete myobj) == true);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-006.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-006.js
new file mode 100644 (file)
index 0000000..631de9f
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+function Foo() {
+}
+Foo.prototype.bar = 42;
+var foo = new Foo();
+if (!(delete foo.bar))
+  assert(false)
+
+if (foo.bar != 42)
+  assert(false)
+
+if (!(delete Foo.prototype.bar))
+  assert(false)
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-007.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-007.js
new file mode 100644 (file)
index 0000000..69c19b2
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var fruits = ['apple', 'banana', 'kiwi', 'pineapple'];
+
+delete fruits[3];
+
+assert(!(3 in fruits) && fruits.length == 4);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-008.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-008.js
new file mode 100644 (file)
index 0000000..41b6b23
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+function x() {
+}
+
+assert((delete x) == false && typeof x == "function");
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-009.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-009.js
new file mode 100644 (file)
index 0000000..c9e84d1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+this.prop = "prop";
+
+assert((delete this.prop) == true);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-010.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-010.js
new file mode 100644 (file)
index 0000000..2ff74d1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((delete arguments) == true);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-011.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-011.js
new file mode 100644 (file)
index 0000000..c4df4c7
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+function test(arg)
+{
+  if ((delete arg) == false)
+    return 0;
+  else
+    return 1;
+}
+
+assert(!test("str"));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-012.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-012.js
new file mode 100644 (file)
index 0000000..ed8646a
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+this.test = function (arg)
+{
+  return 1;
+}
+
+assert((delete test) == true);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-013.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-013.js
new file mode 100644 (file)
index 0000000..63e5a3c
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+eval('var foo = 1;');
+assert((delete foo) == true && typeof foo == "undefined");
+
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-017.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.01/11.04.01-017.js
new file mode 100644 (file)
index 0000000..9eef2c2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((delete i_dont_exist) == true);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.02/11.04.02-001.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.02/11.04.02-001.js
new file mode 100644 (file)
index 0000000..387ec41
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = void(5 / 2);
+
+assert(a == undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.02/11.04.02-002.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.02/11.04.02-002.js
new file mode 100644 (file)
index 0000000..a224aa4
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var b = 1;
+
+var a = void(++b);
+
+assert(a == undefined && b == 2);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-001.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-001.js
new file mode 100644 (file)
index 0000000..5af4a70
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof 37 === 'number');
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-002.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-002.js
new file mode 100644 (file)
index 0000000..5f956b2
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(typeof 37 === 'number' &&
+        typeof 3.14 === 'number');
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-003.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-003.js
new file mode 100644 (file)
index 0000000..544a69f
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+assert(typeof Math.LN2 === 'number' &&
+        typeof Infinity === 'number' &&
+        typeof NaN === 'number' &&
+        typeof Number(1) === 'number');
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-004.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-004.js
new file mode 100644 (file)
index 0000000..c478b2f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(typeof "" === 'string' &&
+        typeof "str" === 'string');
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-005.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-005.js
new file mode 100644 (file)
index 0000000..2662299
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(typeof (typeof 1) === 'string' &&
+        typeof String("str") === 'string');
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-006.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-006.js
new file mode 100644 (file)
index 0000000..96ccc44
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(typeof true === 'boolean' &&
+        typeof false === 'boolean');
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-007.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-007.js
new file mode 100644 (file)
index 0000000..51e08db
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof Boolean(true) === 'boolean');
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-008.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-008.js
new file mode 100644 (file)
index 0000000..4a64445
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(typeof undefined === 'undefined' &&
+        typeof smth === 'undefined');
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-009.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-009.js
new file mode 100644 (file)
index 0000000..a74f62e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(typeof {a: 1} === 'object' &&
+        typeof [1, 2, 4] === 'object')
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-010.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-010.js
new file mode 100644 (file)
index 0000000..30fa4e1
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+assert(typeof new Date() === 'object' &&
+        typeof new Boolean(true) === 'object' &&
+        typeof new Number(1) === 'object' &&
+        typeof new String("abc") === 'object')
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-011.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-011.js
new file mode 100644 (file)
index 0000000..324d9e4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (typeof function(){} === 'function')
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-012.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-012.js
new file mode 100644 (file)
index 0000000..63f62c6
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (typeof Math.sin === 'function');
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-013.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-013.js
new file mode 100644 (file)
index 0000000..2f53919
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof null === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-016.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.03/11.04.03-016.js
new file mode 100644 (file)
index 0000000..303f9ce
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(typeof
+        24 === 'number')
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-001.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-001.js
new file mode 100644 (file)
index 0000000..8186793
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 25;
+
+assert(++a === 26);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-002.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-002.js
new file mode 100644 (file)
index 0000000..e2556a9
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 25, b = -1;
+;
+
+assert(++a === ++b + 26);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-004.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-004.js
new file mode 100644 (file)
index 0000000..880804f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 25;
+
+assert((++a) / 2 === 13);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-005.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-005.js
new file mode 100644 (file)
index 0000000..479561e
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 25;
+
+assert(++
+        a === 26)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-006.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-006.js
new file mode 100644 (file)
index 0000000..53d984c
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 1.12;
+var eps = 0.00000001;
+
+assert(++a >= 2.12 - eps && a <= 2.12 + eps);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-007.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-007.js
new file mode 100644 (file)
index 0000000..dd8c73f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+
+assert(++a === 2);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-008.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-008.js
new file mode 100644 (file)
index 0000000..57b7b88
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = {};
+
+assert(isNaN(++a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-009.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-009.js
new file mode 100644 (file)
index 0000000..6bdf53d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = undefined;
+
+assert(isNaN(++a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-010.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-010.js
new file mode 100644 (file)
index 0000000..9440c82
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null;
+
+assert(++a === 1);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-011.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-011.js
new file mode 100644 (file)
index 0000000..5706d79
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "abc";
+
+assert(isNaN(++a));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-012.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.04/11.04.04-012.js
new file mode 100644 (file)
index 0000000..2b5f37d
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = function () {
+};
+
+assert(isNaN(++a));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-001.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-001.js
new file mode 100644 (file)
index 0000000..eac75f1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 25;
+
+assert(--a === 24)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-002.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-002.js
new file mode 100644 (file)
index 0000000..10778ee
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 25, b = 1;
+;
+
+assert(--a === --b + 24)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-004.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-004.js
new file mode 100644 (file)
index 0000000..1fbed9b
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 25;
+
+assert((--a) / 2 === 12)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-005.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-005.js
new file mode 100644 (file)
index 0000000..3f763ee
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 25;
+
+assert(--
+        a === 24)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-006.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-006.js
new file mode 100644 (file)
index 0000000..19c3430
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var eps = 0.000000001;
+var a = 1.12;
+
+assert(--a >= 0.12 - eps &&
+        a <= 0.12 + eps)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-007.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-007.js
new file mode 100644 (file)
index 0000000..2e6e65d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+
+assert(--a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-008.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-008.js
new file mode 100644 (file)
index 0000000..d140fd0
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = {};
+
+assert(isNaN(--a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-009.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-009.js
new file mode 100644 (file)
index 0000000..a7683eb
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = undefined;
+
+assert(isNaN(--a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-010.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-010.js
new file mode 100644 (file)
index 0000000..03a5997
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null;
+
+assert(--a === -1);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-011.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-011.js
new file mode 100644 (file)
index 0000000..e037cd1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "abc";
+
+assert(isNaN(--a));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-012.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.05/11.04.05-012.js
new file mode 100644 (file)
index 0000000..f8c88dc
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = function () {
+};
+
+assert(isNaN(--a));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-001.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-001.js
new file mode 100644 (file)
index 0000000..cfc2fe6
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 1;
+assert(+a === a)
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-002.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-002.js
new file mode 100644 (file)
index 0000000..226b8e2
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = -1;
+assert(+a === a)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-003.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-003.js
new file mode 100644 (file)
index 0000000..9e38e32
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "1";
+assert(+a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-004.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-004.js
new file mode 100644 (file)
index 0000000..f6622ee
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "-1";
+assert(+a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-005.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-005.js
new file mode 100644 (file)
index 0000000..e29f42e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = true;
+assert(+a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-006.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-006.js
new file mode 100644 (file)
index 0000000..32e2a8e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = false;
+assert(+a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-007.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-007.js
new file mode 100644 (file)
index 0000000..c2b69e3
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number(0);
+assert(+a === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-008.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-008.js
new file mode 100644 (file)
index 0000000..61cb25c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number(1);
+assert(+a === 1)
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-009.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-009.js
new file mode 100644 (file)
index 0000000..73d30c8
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number(-1);
+assert(+a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-010.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-010.js
new file mode 100644 (file)
index 0000000..e3e7d03
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Boolean(true);
+assert(+a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-011.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-011.js
new file mode 100644 (file)
index 0000000..d12eccd
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Boolean(false);
+assert(+a === +0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-012.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-012.js
new file mode 100644 (file)
index 0000000..a6160eb
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new String("1");
+assert(+a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-013.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-013.js
new file mode 100644 (file)
index 0000000..09e67c2
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new String("-1");
+assert(+a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-014.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-014.js
new file mode 100644 (file)
index 0000000..f448e52
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = undefined;
+assert(isNaN(+a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-015.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-015.js
new file mode 100644 (file)
index 0000000..8d3233b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = null;
+assert(+a === +0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-016.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-016.js
new file mode 100644 (file)
index 0000000..1d2ca21
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = NaN;
+assert(isNaN(+a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-017.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-017.js
new file mode 100644 (file)
index 0000000..e61a2b9
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new String("qwerty");
+assert(isNaN(+a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-018.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-018.js
new file mode 100644 (file)
index 0000000..cba4824
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return 1;
+  }
+}
+
+assert(+a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-019.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-019.js
new file mode 100644 (file)
index 0000000..26bd6f3
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return "1";
+  }
+}
+
+assert(+a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-020.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-020.js
new file mode 100644 (file)
index 0000000..e9169ac
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return -1;
+  }
+}
+
+assert(+a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-021.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-021.js
new file mode 100644 (file)
index 0000000..cb10795
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = new Object;
+a.valueOf = function () {
+  return true;
+}
+
+assert(+a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-022.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-022.js
new file mode 100644 (file)
index 0000000..80ab25c
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return false;
+  }
+}
+
+assert(+a === +0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-023.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-023.js
new file mode 100644 (file)
index 0000000..3a69b3b
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return "not a number";
+  }
+}
+
+assert(isNaN(+a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-024.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-024.js
new file mode 100644 (file)
index 0000000..81bf73e
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = {
+  member: Number
+}
+
+assert(isNaN(+a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-025.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-025.js
new file mode 100644 (file)
index 0000000..3974404
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return null;
+  }
+}
+assert(+a === +0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-026.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-026.js
new file mode 100644 (file)
index 0000000..f5a6d7f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var array = [1, 2, 3, 4, 5];
+assert(isNaN(+array))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-027.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-027.js
new file mode 100644 (file)
index 0000000..ecfade2
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = {
+  toString: function () {
+    return "1"
+  }
+}
+
+assert(+a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-028.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.06/11.04.06-028.js
new file mode 100644 (file)
index 0000000..7e1c588
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return ""
+  }
+}
+
+assert(+a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-001.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-001.js
new file mode 100644 (file)
index 0000000..60df96d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 1;
+assert(-a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-002.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-002.js
new file mode 100644 (file)
index 0000000..ef695a8
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = -1;
+assert(-a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-003.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-003.js
new file mode 100644 (file)
index 0000000..fe41623
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "1";
+assert(-a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-004.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-004.js
new file mode 100644 (file)
index 0000000..3af0b36
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "-1";
+assert(-a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-005.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-005.js
new file mode 100644 (file)
index 0000000..5c9ee4b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0;
+assert(-a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-006.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-006.js
new file mode 100644 (file)
index 0000000..c53bdba
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "0";
+assert(-a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-007.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-007.js
new file mode 100644 (file)
index 0000000..56cb8c0
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "";
+assert(-a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-008.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-008.js
new file mode 100644 (file)
index 0000000..348b495
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = true;
+assert(-a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-009.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-009.js
new file mode 100644 (file)
index 0000000..c7fd828
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = false;
+assert(-a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-010.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-010.js
new file mode 100644 (file)
index 0000000..7dd4ed0
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = Infinity;
+assert(-a === -Infinity)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-011.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-011.js
new file mode 100644 (file)
index 0000000..08e525b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = -Infinity;
+assert(-a === Infinity)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-012.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-012.js
new file mode 100644 (file)
index 0000000..bced56a
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = undefined;
+assert(isNaN(-a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-013.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-013.js
new file mode 100644 (file)
index 0000000..6e6b2f5
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = null;
+assert(-a === -0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-014.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-014.js
new file mode 100644 (file)
index 0000000..fd74b98
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number(1);
+assert(-a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-015.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-015.js
new file mode 100644 (file)
index 0000000..fa4ea29
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number(-1);
+assert(-a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-016.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-016.js
new file mode 100644 (file)
index 0000000..3d0fe12
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number(0);
+assert(-a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-017.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-017.js
new file mode 100644 (file)
index 0000000..5cd441f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new String("1");
+assert(-a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-018.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-018.js
new file mode 100644 (file)
index 0000000..9a0e41c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new String("-1");
+assert(-a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-019.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-019.js
new file mode 100644 (file)
index 0000000..7be7e56
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new String("");
+assert(-a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-020.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-020.js
new file mode 100644 (file)
index 0000000..5fd7bce
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Boolean(true);
+assert(-a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-021.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-021.js
new file mode 100644 (file)
index 0000000..ff2d156
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Boolean(false);
+assert(-a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-022.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-022.js
new file mode 100644 (file)
index 0000000..92861fa
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = [1, 2, 3, 4, 5];
+assert(isNaN(-a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-023.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-023.js
new file mode 100644 (file)
index 0000000..96d4785
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return 1;
+  }
+}
+assert(-a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-024.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-024.js
new file mode 100644 (file)
index 0000000..add19e5
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return -1;
+  }
+}
+assert(-a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-025.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-025.js
new file mode 100644 (file)
index 0000000..51524f5
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return true;
+  }
+}
+assert(-a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-026.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-026.js
new file mode 100644 (file)
index 0000000..5426fc0
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return false;
+  }
+}
+assert(-a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-027.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-027.js
new file mode 100644 (file)
index 0000000..aec5999
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return null;
+  }
+}
+assert(-a === -0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-028.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-028.js
new file mode 100644 (file)
index 0000000..10a4859
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return undefined;
+  }
+}
+assert(isNaN(-a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-029.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-029.js
new file mode 100644 (file)
index 0000000..f236926
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var a = {
+  member: 1,
+  valueOf: function () {
+    return this.member;
+  }
+}
+
+assert(-a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-030.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-030.js
new file mode 100644 (file)
index 0000000..2221c77
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = {
+  member: 1,
+}
+
+assert(isNaN(-a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-031.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-031.js
new file mode 100644 (file)
index 0000000..40fd349
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return "qwerty";
+  }
+}
+
+assert(isNaN(-a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-032.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-032.js
new file mode 100644 (file)
index 0000000..9950635
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = +0;
+
+assert(-a === -0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-033.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.07/11.04.07-033.js
new file mode 100644 (file)
index 0000000..679073c
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = new Object;
+a.toString = function () {
+  return "1";
+}
+
+assert(-a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-001.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-001.js
new file mode 100644 (file)
index 0000000..a1cd6c1
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0;
+assert(~a === -1);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-002.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-002.js
new file mode 100644 (file)
index 0000000..0cf1d74
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = -1;
+assert(~a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-003.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-003.js
new file mode 100644 (file)
index 0000000..4f44f09
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 1;
+assert(~a === -2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-004.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-004.js
new file mode 100644 (file)
index 0000000..53ba079
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0x0001;
+assert(~a === -0x0002)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-005.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-005.js
new file mode 100644 (file)
index 0000000..240793e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = NaN;
+assert(~a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-006.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-006.js
new file mode 100644 (file)
index 0000000..c17198c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = +0;
+assert(~a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-007.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-007.js
new file mode 100644 (file)
index 0000000..8c9f4c4
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = -0;
+assert(~a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-008.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-008.js
new file mode 100644 (file)
index 0000000..11c3174
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = +Infinity;
+assert(~a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-009.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-009.js
new file mode 100644 (file)
index 0000000..38daba6
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = -Infinity;
+assert(~a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-010.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-010.js
new file mode 100644 (file)
index 0000000..40e2c49
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 2 * 0x100000000; // to int32 -> 0 
+assert(~a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-011.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-011.js
new file mode 100644 (file)
index 0000000..8309c53
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0x1fffffffe; // % 0x100000000 >= 0x10000000
+assert(~a === ~(0xfffffffe))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-012.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-012.js
new file mode 100644 (file)
index 0000000..1b4a572
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0x110000000; // % 0x100000000 >= 0x10000000
+assert(~a === ~(0x10000000))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-013.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-013.js
new file mode 100644 (file)
index 0000000..f5bca58
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0x1fffffff; // % 0x100000000 < 0x10000000
+assert(~a === ~(0x1fffffff))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-014.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-014.js
new file mode 100644 (file)
index 0000000..c50af15
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0xffff; // % 0x100000000 < 0x10000000
+assert(~a === -0x10000)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-015.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-015.js
new file mode 100644 (file)
index 0000000..f526e28
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "1";
+assert(~a === -2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-016.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-016.js
new file mode 100644 (file)
index 0000000..e510f35
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "Who cares?";
+assert(~a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-017.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-017.js
new file mode 100644 (file)
index 0000000..bc57f38
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = true;
+assert(~a === -2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-018.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-018.js
new file mode 100644 (file)
index 0000000..c63fcc3
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = false;
+assert(~a === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-019.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-019.js
new file mode 100644 (file)
index 0000000..c5b415b
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return "0x001"
+  }
+}
+assert(~a === -0x002)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-020.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-020.js
new file mode 100644 (file)
index 0000000..fc38533
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return -0x01
+  }
+}
+assert(~a === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-021.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-021.js
new file mode 100644 (file)
index 0000000..23e96d8
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return true
+  }
+}
+assert(~a === -2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-022.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.08/11.04.08-022.js
new file mode 100644 (file)
index 0000000..94dc951
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = Number(1);
+assert(~a === -2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-001.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-001.js
new file mode 100644 (file)
index 0000000..62619c7
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = true;
+assert(!a === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-002.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-002.js
new file mode 100644 (file)
index 0000000..85a2bdd
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = false;
+assert(!a === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-003.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-003.js
new file mode 100644 (file)
index 0000000..42c1271
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = undefined;
+assert(!a === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-004.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-004.js
new file mode 100644 (file)
index 0000000..0b8524c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = null;
+assert(!a === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-005.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-005.js
new file mode 100644 (file)
index 0000000..0b8524c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = null;
+assert(!a === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-006.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-006.js
new file mode 100644 (file)
index 0000000..b9c8208
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(+0) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-007.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-007.js
new file mode 100644 (file)
index 0000000..2c86c9f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(-0) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-008.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-008.js
new file mode 100644 (file)
index 0000000..c6642cf
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(NaN) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-009.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-009.js
new file mode 100644 (file)
index 0000000..4583157
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!("") === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-010.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-010.js
new file mode 100644 (file)
index 0000000..1990af2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!("anything") === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-011.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-011.js
new file mode 100644 (file)
index 0000000..8f9495d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Object;
+assert(!a === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-012.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-012.js
new file mode 100644 (file)
index 0000000..4ded291
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  valueOf: function () {
+    return false;
+  }
+}
+assert(!a === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-013.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-013.js
new file mode 100644 (file)
index 0000000..2ba53b3
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!true === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-014.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-014.js
new file mode 100644 (file)
index 0000000..651236e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!false === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-015.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-015.js
new file mode 100644 (file)
index 0000000..90eb081
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(![] === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-016.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-016.js
new file mode 100644 (file)
index 0000000..fd1ac8a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!0 === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-017.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-017.js
new file mode 100644 (file)
index 0000000..00fe91a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!1 === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-018.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-018.js
new file mode 100644 (file)
index 0000000..f410d9f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(-Infinity) === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-019.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-019.js
new file mode 100644 (file)
index 0000000..51fe41b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!Infinity === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-020.js b/deps/jerry/tests/jerry-test-suite/11/11.04/11.04.09/11.04.09-020.js
new file mode 100644 (file)
index 0000000..b9629fe
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Boolean(true);
+assert(!a === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-001.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-001.js
new file mode 100644 (file)
index 0000000..12386f9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(2 * 3 === 6)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-002.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-002.js
new file mode 100644 (file)
index 0000000..4eedc76
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 3;
+assert(2 * a === 6)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-003.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-003.js
new file mode 100644 (file)
index 0000000..adb2a8a
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 3;
+assert(a * 2 === 6)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-004.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-004.js
new file mode 100644 (file)
index 0000000..eb5da62
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 3;
+var b = 2;
+assert(a * b === 6)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-005.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-005.js
new file mode 100644 (file)
index 0000000..0c49c95
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0;
+assert((a = 1) * a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-006.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-006.js
new file mode 100644 (file)
index 0000000..fdc5484
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0;
+assert(a * (a = 1) === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-007.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-007.js
new file mode 100644 (file)
index 0000000..33fe8f2
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 2;
+assert(a *
+        3 === 6)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-008.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-008.js
new file mode 100644 (file)
index 0000000..392ed5c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true * true === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-009.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-009.js
new file mode 100644 (file)
index 0000000..8acf031
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true * false === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-010.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-010.js
new file mode 100644 (file)
index 0000000..cebfd89
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false * false === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-011.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-011.js
new file mode 100644 (file)
index 0000000..20754e7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert("2" * "3" === 6)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-012.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-012.js
new file mode 100644 (file)
index 0000000..498ef1e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN("a" * "1") === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-013.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-013.js
new file mode 100644 (file)
index 0000000..de3af0d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN("1" * "a") === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-014.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-014.js
new file mode 100644 (file)
index 0000000..3f46d67
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null * null === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-015.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-015.js
new file mode 100644 (file)
index 0000000..99c1a97
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined * undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-016.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-016.js
new file mode 100644 (file)
index 0000000..7458763
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined * null) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-017.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-017.js
new file mode 100644 (file)
index 0000000..1bb4c57
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(null * undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-018.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-018.js
new file mode 100644 (file)
index 0000000..8feee08
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true * 1 === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-019.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-019.js
new file mode 100644 (file)
index 0000000..5bd1f8e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1 * true === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-020.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-020.js
new file mode 100644 (file)
index 0000000..4bed39a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(2 * "3" === 6)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-021.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-021.js
new file mode 100644 (file)
index 0000000..c01c03b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert("2" * 3 === 6)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-022.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-022.js
new file mode 100644 (file)
index 0000000..41a7322
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN("a" * 1) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-023.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-023.js
new file mode 100644 (file)
index 0000000..f109bef
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(1 * "a") === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-024.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-024.js
new file mode 100644 (file)
index 0000000..5e1ab44
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1 * null === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-025.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-025.js
new file mode 100644 (file)
index 0000000..d29ea55
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null * 1 === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-026.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-026.js
new file mode 100644 (file)
index 0000000..a31c0e0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(1 * undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-027.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-027.js
new file mode 100644 (file)
index 0000000..f816bea
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined * 1) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-028.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-028.js
new file mode 100644 (file)
index 0000000..b78d1a1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true * "1" === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-029.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-029.js
new file mode 100644 (file)
index 0000000..0b56a36
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert("1" * true === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-030.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-030.js
new file mode 100644 (file)
index 0000000..5f20801
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN("1" * undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-031.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-031.js
new file mode 100644 (file)
index 0000000..e4883e4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined * "1") === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-032.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-032.js
new file mode 100644 (file)
index 0000000..f987ee0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert("1" * null === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-033.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-033.js
new file mode 100644 (file)
index 0000000..7cd6e08
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null * "1" === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-034.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-034.js
new file mode 100644 (file)
index 0000000..114f16d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(true * undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-035.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-035.js
new file mode 100644 (file)
index 0000000..3453f5b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined * true) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-036.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-036.js
new file mode 100644 (file)
index 0000000..16f91bc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true * null === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-037.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-037.js
new file mode 100644 (file)
index 0000000..03036a6
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null * true === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-038.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-038.js
new file mode 100644 (file)
index 0000000..d5f87c0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN * Number.NaN) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-039.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-039.js
new file mode 100644 (file)
index 0000000..c328a4d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN * +0) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-040.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-040.js
new file mode 100644 (file)
index 0000000..03755e2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN * -0) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-041.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-041.js
new file mode 100644 (file)
index 0000000..7109abc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN * Number.POSITIVE_INFINITY) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-042.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-042.js
new file mode 100644 (file)
index 0000000..85ea903
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN * Number.NEGATIVE_INFINITY) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-043.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-043.js
new file mode 100644 (file)
index 0000000..76e0481
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN * Number.MAX_VALUE) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-044.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-044.js
new file mode 100644 (file)
index 0000000..578acf9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN * Number.MIN_VALUE) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-045.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-045.js
new file mode 100644 (file)
index 0000000..3680611
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN * 1) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-046.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-046.js
new file mode 100644 (file)
index 0000000..767fdb9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1 * new Number(1) === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-047.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-047.js
new file mode 100644 (file)
index 0000000..814bb45
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(1) * 1 === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-048.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-048.js
new file mode 100644 (file)
index 0000000..2850fd4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(1) * new Number(1) === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-049.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-049.js
new file mode 100644 (file)
index 0000000..448b275
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(1) * new Boolean(true) === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-050.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-050.js
new file mode 100644 (file)
index 0000000..f34d050
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Boolean(true) * new Boolean(true) === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-051.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-051.js
new file mode 100644 (file)
index 0000000..40a156f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true * new Boolean(true) === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-052.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-052.js
new file mode 100644 (file)
index 0000000..9e8ac8b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Boolean(true) * true === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-053.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-053.js
new file mode 100644 (file)
index 0000000..aa21ccd
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Boolean(true) * new String("2") === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-054.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-054.js
new file mode 100644 (file)
index 0000000..f08a4cc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("2") * new Boolean(true) === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-055.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-055.js
new file mode 100644 (file)
index 0000000..5caf9f4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("2") * true === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-056.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-056.js
new file mode 100644 (file)
index 0000000..df61f2e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("2") * new Number(1) === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-057.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-057.js
new file mode 100644 (file)
index 0000000..2a1519c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("2") * 1 === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-058.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-058.js
new file mode 100644 (file)
index 0000000..f9a5772
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("2") * new String("1") === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-059.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-059.js
new file mode 100644 (file)
index 0000000..2494459
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN({} * {}) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-060.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-060.js
new file mode 100644 (file)
index 0000000..4fcea3c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null * new Number(2) === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-061.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-061.js
new file mode 100644 (file)
index 0000000..b4cae89
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(2) * null === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-062.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-062.js
new file mode 100644 (file)
index 0000000..9e4e4e0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("2") * null === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-063.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-063.js
new file mode 100644 (file)
index 0000000..3c88851
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null * new String("2") === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-064.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-064.js
new file mode 100644 (file)
index 0000000..894f651
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null * new Boolean(true) === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-065.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-065.js
new file mode 100644 (file)
index 0000000..9160db3
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Boolean(true) * null === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-066.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-066.js
new file mode 100644 (file)
index 0000000..77a10a9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(new Boolean(true) * undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-067.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-067.js
new file mode 100644 (file)
index 0000000..02a8aec
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined * new Boolean(true)) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-068.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-068.js
new file mode 100644 (file)
index 0000000..a9a0496
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined * new String("1")) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-069.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-069.js
new file mode 100644 (file)
index 0000000..cd6610c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(new String("1") * undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-070.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-070.js
new file mode 100644 (file)
index 0000000..efce27d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(new Number(1) * undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-071.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-071.js
new file mode 100644 (file)
index 0000000..f45ce6e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined * new Number(1)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-072.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-072.js
new file mode 100644 (file)
index 0000000..7a49865
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NEGATIVE_INFINITY * 0) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-073.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-073.js
new file mode 100644 (file)
index 0000000..87f069b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(0 * Number.NEGATIVE_INFINITY) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-074.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-074.js
new file mode 100644 (file)
index 0000000..02783f9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(0 * Number.POSITIVE_INFINITY) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-075.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-075.js
new file mode 100644 (file)
index 0000000..dd2a964
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.POSITIVE_INFINITY * 0) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-076.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-076.js
new file mode 100644 (file)
index 0000000..80d5fd3
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.POSITIVE_INFINITY * Number.POSITIVE_INFINITY === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-077.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-077.js
new file mode 100644 (file)
index 0000000..07ad0e0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.POSITIVE_INFINITY * Number.NEGATIVE_INFINITY === Number.NEGATIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-078.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-078.js
new file mode 100644 (file)
index 0000000..ac02f07
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.NEGATIVE_INFINITY * Number.POSITIVE_INFINITY === Number.NEGATIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-079.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-079.js
new file mode 100644 (file)
index 0000000..f237d17
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.NEGATIVE_INFINITY * Number.NEGATIVE_INFINITY === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-080.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-080.js
new file mode 100644 (file)
index 0000000..ddf74c6
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.NEGATIVE_INFINITY * 1 === Number.NEGATIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-081.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-081.js
new file mode 100644 (file)
index 0000000..6221255
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((-1) * Number.NEGATIVE_INFINITY === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-082.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-082.js
new file mode 100644 (file)
index 0000000..8f6f753
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((-1) * Number.POSITIVE_INFINITY === Number.NEGATIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-083.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-083.js
new file mode 100644 (file)
index 0000000..bb3c244
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.POSITIVE_INFINITY * 1 === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-084.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-084.js
new file mode 100644 (file)
index 0000000..ffb42e8
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MAX_VALUE * 2 === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-085.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-085.js
new file mode 100644 (file)
index 0000000..3a0cca5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(2 * Number.MAX_VALUE === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-086.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-086.js
new file mode 100644 (file)
index 0000000..e7621ea
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((-1.5) * Number.MAX_VALUE === Number.NEGATIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-087.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-087.js
new file mode 100644 (file)
index 0000000..45fbe22
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MAX_VALUE * (-1.5) === Number.NEGATIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-088.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-088.js
new file mode 100644 (file)
index 0000000..0d3ceaf
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MIN_VALUE * (-0.5) === -0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-089.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-089.js
new file mode 100644 (file)
index 0000000..368c0b9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(0.1 * Number.MIN_VALUE === +0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-090.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.01/11.05.01-090.js
new file mode 100644 (file)
index 0000000..81fc824
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((Number.MAX_VALUE * 1.1) * 0.9 !== Number.MAX_VALUE * (1.1 * 0.9))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-001.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-001.js
new file mode 100644 (file)
index 0000000..7633067
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(6 / 3 === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-002.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-002.js
new file mode 100644 (file)
index 0000000..32889b7
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 3;
+assert(6 / a === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-003.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-003.js
new file mode 100644 (file)
index 0000000..7ef81c7
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 6;
+assert(a / 3 === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-004.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-004.js
new file mode 100644 (file)
index 0000000..fc6c978
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 6;
+var b = 3;
+assert(a / b === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-005.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-005.js
new file mode 100644 (file)
index 0000000..76a30da
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0;
+assert((a = 1) / a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-006.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-006.js
new file mode 100644 (file)
index 0000000..415fc11
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 0;
+assert(a / (a = 1) === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-007.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-007.js
new file mode 100644 (file)
index 0000000..bb99d37
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 6;
+assert(a /
+        3 === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-008.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-008.js
new file mode 100644 (file)
index 0000000..6675a4c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true / true === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-009.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-009.js
new file mode 100644 (file)
index 0000000..6220403
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false / true === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-010.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-010.js
new file mode 100644 (file)
index 0000000..cae1c7b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true / false === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-011.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-011.js
new file mode 100644 (file)
index 0000000..0bcc8db
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert("6" / "3" === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-012.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-012.js
new file mode 100644 (file)
index 0000000..7b6e283
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN("a" / "3") === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-013.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-013.js
new file mode 100644 (file)
index 0000000..1842dd1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN("6" / "a") === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-014.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-014.js
new file mode 100644 (file)
index 0000000..53774c6
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(null / null) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-015.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-015.js
new file mode 100644 (file)
index 0000000..5fba715
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined / undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-016.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-016.js
new file mode 100644 (file)
index 0000000..87f2ad7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined / null) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-017.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-017.js
new file mode 100644 (file)
index 0000000..5c34539
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(null / undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-018.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-018.js
new file mode 100644 (file)
index 0000000..96b98d1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true / 1 === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-019.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-019.js
new file mode 100644 (file)
index 0000000..1a94d09
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(2 / true === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-020.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-020.js
new file mode 100644 (file)
index 0000000..7a7c386
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(6 / "2" === 3)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-021.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-021.js
new file mode 100644 (file)
index 0000000..f9b11e2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert("6" / 2 === 3)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-022.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-022.js
new file mode 100644 (file)
index 0000000..aca34b4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN("a" / 2) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-023.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-023.js
new file mode 100644 (file)
index 0000000..9da4052
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(6 / "a") === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-024.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-024.js
new file mode 100644 (file)
index 0000000..7b9faf7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1 / null === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-025.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-025.js
new file mode 100644 (file)
index 0000000..5090d87
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null / 1 === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-026.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-026.js
new file mode 100644 (file)
index 0000000..d6a0602
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(1 / undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-027.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-027.js
new file mode 100644 (file)
index 0000000..1e95783
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined / 1) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-028.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-028.js
new file mode 100644 (file)
index 0000000..8befa8d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true / "1" === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-029.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-029.js
new file mode 100644 (file)
index 0000000..e0b889c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert("2" / true === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-030.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-030.js
new file mode 100644 (file)
index 0000000..c9c4022
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN("2" / undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-031.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-031.js
new file mode 100644 (file)
index 0000000..5f7d954
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined / "2") === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-032.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-032.js
new file mode 100644 (file)
index 0000000..eb65428
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert("2" / null === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-033.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-033.js
new file mode 100644 (file)
index 0000000..27bb8f5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null / "2" === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-034.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-034.js
new file mode 100644 (file)
index 0000000..1a360f1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(true / undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-035.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-035.js
new file mode 100644 (file)
index 0000000..58fb275
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined / true) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-036.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-036.js
new file mode 100644 (file)
index 0000000..488a9f9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(false / null) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-037.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-037.js
new file mode 100644 (file)
index 0000000..76023eb
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null / true === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-038.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-038.js
new file mode 100644 (file)
index 0000000..a9c5d12
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN / Number.NaN) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-039.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-039.js
new file mode 100644 (file)
index 0000000..76ba629
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN / +0) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-040.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-040.js
new file mode 100644 (file)
index 0000000..1e9e0de
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN / -0) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-041.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-041.js
new file mode 100644 (file)
index 0000000..fe84d8f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN / Number.POSITIVE_INFINITY) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-042.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-042.js
new file mode 100644 (file)
index 0000000..807671f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN / Number.NEGATIVE_INFINITY) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-043.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-043.js
new file mode 100644 (file)
index 0000000..6323ed7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN / Number.MAX_VALUE) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-044.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-044.js
new file mode 100644 (file)
index 0000000..772e8d7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN / Number.MIN_VALUE) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-045.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-045.js
new file mode 100644 (file)
index 0000000..61aa128
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN / 2) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-046.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-046.js
new file mode 100644 (file)
index 0000000..929d39d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(6) / 3 === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-047.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-047.js
new file mode 100644 (file)
index 0000000..984b750
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(6 / new Number(3) === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-048.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-048.js
new file mode 100644 (file)
index 0000000..de53405
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(6) / new Number(3) === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-049.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-049.js
new file mode 100644 (file)
index 0000000..91f1f64
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(2) / new Boolean(true) === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-050.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-050.js
new file mode 100644 (file)
index 0000000..dd3b17d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Boolean(false) / new Boolean(true) === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-051.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-051.js
new file mode 100644 (file)
index 0000000..1dea429
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false / new Boolean(true) === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-052.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-052.js
new file mode 100644 (file)
index 0000000..2f40b17
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Boolean(true) / false === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-053.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-053.js
new file mode 100644 (file)
index 0000000..9dfc1b4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("2") / new Boolean(false) === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-054.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-054.js
new file mode 100644 (file)
index 0000000..127eb7a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Boolean(false) / new String("2") === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-055.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-055.js
new file mode 100644 (file)
index 0000000..07759f0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false / new String("2") === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-056.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-056.js
new file mode 100644 (file)
index 0000000..7bf9de6
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("2") / new Number(1) === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-057.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-057.js
new file mode 100644 (file)
index 0000000..a3fe076
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("2") / 1 === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-058.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-058.js
new file mode 100644 (file)
index 0000000..2dedc24
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("2") / new String("1") === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-059.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-059.js
new file mode 100644 (file)
index 0000000..0792274
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN({} / {}) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-060.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-060.js
new file mode 100644 (file)
index 0000000..d4d1d26
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null / new Number(5) === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-061.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-061.js
new file mode 100644 (file)
index 0000000..4c15539
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(5) / null === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-062.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-062.js
new file mode 100644 (file)
index 0000000..efb79c6
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("5") / null === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-063.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-063.js
new file mode 100644 (file)
index 0000000..5f64178
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null / new String("5") === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-064.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-064.js
new file mode 100644 (file)
index 0000000..11c717d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null / new Boolean(true) === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-065.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-065.js
new file mode 100644 (file)
index 0000000..8c954f1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Boolean(true) / null === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-066.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-066.js
new file mode 100644 (file)
index 0000000..45bd426
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(new Boolean(true) / undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-067.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-067.js
new file mode 100644 (file)
index 0000000..650a6e4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined / new Boolean(true)) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-068.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-068.js
new file mode 100644 (file)
index 0000000..a59abb0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined / new String("5")) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-069.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-069.js
new file mode 100644 (file)
index 0000000..65ca067
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(new String("5") / undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-070.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-070.js
new file mode 100644 (file)
index 0000000..01e5f6e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(new Number(5) / undefined) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-071.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-071.js
new file mode 100644 (file)
index 0000000..0e4799b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined / new Number(5)) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-072.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-072.js
new file mode 100644 (file)
index 0000000..6817de9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.NEGATIVE_INFINITY / 0 === Number.NEGATIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-073.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-073.js
new file mode 100644 (file)
index 0000000..12eaec9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(0 / Number.NEGATIVE_INFINITY === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-074.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-074.js
new file mode 100644 (file)
index 0000000..057b851
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(0 / Number.POSITIVE_INFINITY === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-075.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-075.js
new file mode 100644 (file)
index 0000000..9198303
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.POSITIVE_INFINITY / 0 === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-076.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-076.js
new file mode 100644 (file)
index 0000000..5fb3ac1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.POSITIVE_INFINITY / Number.POSITIVE_INFINITY) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-077.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-077.js
new file mode 100644 (file)
index 0000000..984adb8
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.POSITIVE_INFINITY / Number.NEGATIVE_INFINITY) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-078.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-078.js
new file mode 100644 (file)
index 0000000..63e5205
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NEGATIVE_INFINITY / Number.POSITIVE_INFINITY) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-079.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-079.js
new file mode 100644 (file)
index 0000000..06bcc73
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NEGATIVE_INFINITY / Number.NEGATIVE_INFINITY) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-080.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-080.js
new file mode 100644 (file)
index 0000000..e9cedbc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.NEGATIVE_INFINITY / 2 === Number.NEGATIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-081.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-081.js
new file mode 100644 (file)
index 0000000..2fdbb6e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(2 / Number.NEGATIVE_INFINITY === -0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-082.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-082.js
new file mode 100644 (file)
index 0000000..26aef99
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(2 / Number.POSITIVE_INFINITY === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-083.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-083.js
new file mode 100644 (file)
index 0000000..d8ffc24
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.POSITIVE_INFINITY / 2 === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-084.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-084.js
new file mode 100644 (file)
index 0000000..c9ed4d6
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(0 / 0) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-085.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-085.js
new file mode 100644 (file)
index 0000000..5cff41f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MAX_VALUE / 0.5 === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-086.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-086.js
new file mode 100644 (file)
index 0000000..832b3eb
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MAX_VALUE / Number.MAX_VALUE === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-087.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-087.js
new file mode 100644 (file)
index 0000000..00d1862
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MAX_VALUE / (-0.5) === Number.NEGATIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-088.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-088.js
new file mode 100644 (file)
index 0000000..4d88423
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MIN_VALUE / 2 === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-089.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-089.js
new file mode 100644 (file)
index 0000000..b0b5e47
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(2 / Number.MIN_VALUE === Number.POSITIVE_INFINITY)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-090.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.02/11.05.02-090.js
new file mode 100644 (file)
index 0000000..c32f340
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((1 / 2) / 4 !== 1 / (2 / 4))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-001.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-001.js
new file mode 100644 (file)
index 0000000..f1978bd
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(NaN % 1))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-002.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-002.js
new file mode 100644 (file)
index 0000000..4ed8223
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(100 % NaN))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-003.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-003.js
new file mode 100644 (file)
index 0000000..2798caa
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(NaN % NaN))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-004.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-004.js
new file mode 100644 (file)
index 0000000..1739852
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(-100 % 3 < 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-005.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-005.js
new file mode 100644 (file)
index 0000000..88f9eb7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(100 % -3 > 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-006.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-006.js
new file mode 100644 (file)
index 0000000..6abb1cc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(-100 % -3 < 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-007.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-007.js
new file mode 100644 (file)
index 0000000..4fc48fc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Infinity % 3))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-008.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-008.js
new file mode 100644 (file)
index 0000000..a909ebb
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(-Infinity % 3))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-009.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-009.js
new file mode 100644 (file)
index 0000000..bdebefa
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(5 % 0))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-010.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-010.js
new file mode 100644 (file)
index 0000000..c17c616
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Infinity % 0))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-011.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-011.js
new file mode 100644 (file)
index 0000000..9876e2a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(5 % Infinity === 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-012.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-012.js
new file mode 100644 (file)
index 0000000..c950fb0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(0 % 5 === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-013.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-013.js
new file mode 100644 (file)
index 0000000..5783e6f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(-Infinity % Infinity))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-014.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-014.js
new file mode 100644 (file)
index 0000000..b1f0756
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(-0 % 5 === -0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-015.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-015.js
new file mode 100644 (file)
index 0000000..12aba9b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(+0 % 5 === +0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-016.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-016.js
new file mode 100644 (file)
index 0000000..4a11c82
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var n = 100;
+var d = 10;
+assert(n % d === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-017.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-017.js
new file mode 100644 (file)
index 0000000..a550ff1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var n = 100.5;
+var d = 10;
+assert(n % d === 0.5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-018.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-018.js
new file mode 100644 (file)
index 0000000..0342933
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var n = 105;
+var d = 10;
+assert(n % d === 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-019.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-019.js
new file mode 100644 (file)
index 0000000..51fb4db
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var n = 109.5;
+var d = 5.5;
+assert(n % d === 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-020.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-020.js
new file mode 100644 (file)
index 0000000..7178b73
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var n = 550;
+var d = 5.5;
+assert(n % d === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-021.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-021.js
new file mode 100644 (file)
index 0000000..c77b8b0
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var n = 100;
+var d = new Boolean(true);
+assert(n % d === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-022.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-022.js
new file mode 100644 (file)
index 0000000..a069fa0
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var n = 100;
+var d = new Boolean(false);
+assert(isNaN(n % d))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-023.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-023.js
new file mode 100644 (file)
index 0000000..707d450
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var n = "100";
+var d = "";
+assert(isNaN(n % d))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-024.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-024.js
new file mode 100644 (file)
index 0000000..2ec411b
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var n = {
+  valueOf: function () {
+    return 109.5;
+  }
+}
+var d = {
+  valueOf: function () {
+    return 5.5;
+  }
+}
+assert(n % d === 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-025.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-025.js
new file mode 100644 (file)
index 0000000..48e939b
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var n = {
+  valueOf: function () {
+    return -Infinity;
+  }
+}
+var d = {
+  valueOf: function () {
+    return 0;
+  }
+}
+assert(isNaN(n % d))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-026.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-026.js
new file mode 100644 (file)
index 0000000..460e7c5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(undefined % 1))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-027.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-027.js
new file mode 100644 (file)
index 0000000..51152d3
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(null % 1 === +0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-028.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-028.js
new file mode 100644 (file)
index 0000000..faa098c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(1 % null))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-029.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-029.js
new file mode 100644 (file)
index 0000000..a46cfbe
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var n = new String("100");
+var d = new String("10");
+assert(n % d === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-030.js b/deps/jerry/tests/jerry-test-suite/11/11.05/11.05.03/11.05.03-030.js
new file mode 100644 (file)
index 0000000..c3357d7
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var n = new Boolean(true);
+var d = new String("");
+assert(isNaN(n % d))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-001.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-001.js
new file mode 100644 (file)
index 0000000..d548599
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "lirum ";
+var b = "ipsum";
+assert(a + b == "lirum ipsum")
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-002.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-002.js
new file mode 100644 (file)
index 0000000..5e44043
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 12;
+var b = "3";
+assert(a + b === "123")
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-003.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-003.js
new file mode 100644 (file)
index 0000000..9f03596
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "12";
+var b = 3;
+assert(a + b === "123")
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-004.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-004.js
new file mode 100644 (file)
index 0000000..230a02f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 123;
+var b = 456;
+assert(a + b == 579)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-005.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-005.js
new file mode 100644 (file)
index 0000000..0b1a5e2
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 1;
+assert(x + 1 === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-006.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-006.js
new file mode 100644 (file)
index 0000000..4370620
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var y = 1;
+assert(1 + y === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-007.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-007.js
new file mode 100644 (file)
index 0000000..fccec1d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(1) + 1 === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-008.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-008.js
new file mode 100644 (file)
index 0000000..e94cdae
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var objectx = new Object();
+var objecty = new Object();
+objectx.prop = 1;
+objecty.prop = 1;
+assert(objectx.prop + objecty.prop === 2) 
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-009.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-009.js
new file mode 100644 (file)
index 0000000..f458439
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1 + new Number(1) === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-010.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-010.js
new file mode 100644 (file)
index 0000000..90ca539
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(1) + new Number(1) === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-011.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-011.js
new file mode 100644 (file)
index 0000000..74417cb
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 1
+  },
+  toString: function () {
+    return 0
+  }
+}
+assert(object + 1 === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-012.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-012.js
new file mode 100644 (file)
index 0000000..a1657b2
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 1
+  },
+  toString: function () {
+    return 0
+  }
+}
+assert(1 + object === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-013.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-013.js
new file mode 100644 (file)
index 0000000..bebf277
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 1
+  },
+  toString: function () {
+    return 0
+  }
+}
+assert(object + "1" === "11")
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-014.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-014.js
new file mode 100644 (file)
index 0000000..b3ce8d5
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return "1"
+  },
+  toString: function () {
+    return 0
+  }
+}
+assert("1" + object === "11")
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-015.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-015.js
new file mode 100644 (file)
index 0000000..7ca543b
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+
+object1 = {
+  valueOf: function () {
+    return 1;
+  },
+  toString: function () {
+    return 0;
+  }
+}
+
+object2 = {
+  valueOf: function () {
+    return 1;
+  },
+  toString: function () {
+    return 0;
+  }
+}
+
+assert(object1 + object2 === 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-016.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-016.js
new file mode 100644 (file)
index 0000000..c0db6b7
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+object = new Object()
+
+var str = new String()
+
+assert(object + str === "[object Object]")
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-017.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-017.js
new file mode 100644 (file)
index 0000000..63760e5
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+object = new Object()
+
+var b = 1
+
+assert(object + b === "[object Object]1")
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-018.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.01/11.06.01-018.js
new file mode 100644 (file)
index 0000000..8b144e2
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+object = new String()
+
+var b = 1
+
+assert(object + b === "1")
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-001.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-001.js
new file mode 100644 (file)
index 0000000..4e50a79
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 100;
+var b = 20;
+assert(a - b === 80)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-002.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-002.js
new file mode 100644 (file)
index 0000000..c814284
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = -10;
+var b = 50;
+assert((a - b === -60) && (b - a === 60))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-003.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-003.js
new file mode 100644 (file)
index 0000000..078b114
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = -5;
+var b = -100;
+assert(a - b === 95)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-004.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-004.js
new file mode 100644 (file)
index 0000000..7a150b5
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "string";
+var b = 10;
+assert(isNaN(a - b) && isNaN(b - a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-005.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-005.js
new file mode 100644 (file)
index 0000000..265df7e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 1;
+assert(!((x - 1 !== 0) || (1 - x !== 0)))
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-006.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-006.js
new file mode 100644 (file)
index 0000000..c32261b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1 - 1 === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-007.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-007.js
new file mode 100644 (file)
index 0000000..a3b3744
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var object1 = new Object();
+var object2 = new Object();
+object1.prop = 1;
+object2.prop = 1;
+assert(object1.prop - object2.prop === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-008.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-008.js
new file mode 100644 (file)
index 0000000..b254243
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 1;
+  },
+  toString: function () {
+    return 0;
+  }
+}
+assert(!((object - 1 !== 0) || (1 - object !== 0)));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-009.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-009.js
new file mode 100644 (file)
index 0000000..1ad1f39
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0;
+assert(x - (x = 1) === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-010.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-010.js
new file mode 100644 (file)
index 0000000..511b505
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true - true === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-011.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-011.js
new file mode 100644 (file)
index 0000000..bf09829
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(((new Number(1) - 1 !== 0) || (1 - new Number(1) !== 0))))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-012.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-012.js
new file mode 100644 (file)
index 0000000..48835b9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Number(1) - new Number(1) === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-013.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-013.js
new file mode 100644 (file)
index 0000000..6f26a3c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert("1" - "1" === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-014.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-014.js
new file mode 100644 (file)
index 0000000..a361f6e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!((("1" - new String("1") !== 0) || (new String("1") - 1 !== 0))))
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-015.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-015.js
new file mode 100644 (file)
index 0000000..f8e4297
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new String("1") - new String("1") === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-016.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-016.js
new file mode 100644 (file)
index 0000000..864c996
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN("x" - "1") && isNaN("1" - "x"))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-017.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.02/11.06.02-017.js
new file mode 100644 (file)
index 0000000..79512c7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN("x" - 1) && isNaN(1 - "x"))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-001.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-001.js
new file mode 100644 (file)
index 0000000..abed550
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 1;
+var b = 2;
+assert(a + b === b + a)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-002.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-002.js
new file mode 100644 (file)
index 0000000..481ab56
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+obj = new Object;
+assert(isNaN(obj + NaN) && isNaN(NaN + obj))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-003.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-003.js
new file mode 100644 (file)
index 0000000..cbad578
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+obj = new Object();
+assert(isNaN(obj - NaN) && isNaN(NaN - obj))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-004.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-004.js
new file mode 100644 (file)
index 0000000..c1e134d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Infinity + -Infinity))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-005.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-005.js
new file mode 100644 (file)
index 0000000..3189b63
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((Infinity + Infinity === Infinity) && (-Infinity + -Infinity === -Infinity))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-006.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-006.js
new file mode 100644 (file)
index 0000000..6d087fa
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Infinity + 1 === Infinity)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-007.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-007.js
new file mode 100644 (file)
index 0000000..6dce8ab
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(-0 + -0 === -0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-008.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-008.js
new file mode 100644 (file)
index 0000000..84cd385
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((+0 + +0 === +0) && (+0 + -0 === +0))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-009.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-009.js
new file mode 100644 (file)
index 0000000..4666d57
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(0 + 5 === 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-010.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-010.js
new file mode 100644 (file)
index 0000000..7d1a1cf
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+
+assert(2 + -2 === +0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-011.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-011.js
new file mode 100644 (file)
index 0000000..84cd385
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((+0 + +0 === +0) && (+0 + -0 === +0))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-012.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-012.js
new file mode 100644 (file)
index 0000000..9df4217
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(-Number.MAX_VALUE - Number.MAX_VALUE === -Infinity)
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-013.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-013.js
new file mode 100644 (file)
index 0000000..6e11d60
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(Number.MIN_VALUE + -Number.MIN_VALUE !== +0))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-014.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-014.js
new file mode 100644 (file)
index 0000000..3d866fc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(-Number.MAX_VALUE - -Number.MAX_VALUE === +0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-015.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-015.js
new file mode 100644 (file)
index 0000000..da0e2c5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MAX_VALUE - -Number.MAX_VALUE === +Infinity)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-016.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-016.js
new file mode 100644 (file)
index 0000000..3d51ea8
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 1;
+var b = -1;
+assert(a - b === a + -b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-017.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-017.js
new file mode 100644 (file)
index 0000000..b3e4ddd
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MAX_VALUE - -0 === Number.MAX_VALUE)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-018.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-018.js
new file mode 100644 (file)
index 0000000..5b7f9c2
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+
+assert(0 - 1 === -1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-019.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-019.js
new file mode 100644 (file)
index 0000000..3d866fc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(-Number.MAX_VALUE - -Number.MAX_VALUE === +0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-020.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-020.js
new file mode 100644 (file)
index 0000000..d5b9822
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1e+308 - -1e+308 === +Infinity)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-021.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-021.js
new file mode 100644 (file)
index 0000000..a81d2ce
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(-8.99e+307 - 8.99e+307 === -Infinity)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-022.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-022.js
new file mode 100644 (file)
index 0000000..299bf08
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(-Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE === (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-023.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-023.js
new file mode 100644 (file)
index 0000000..1f95d82
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE !== -Number.MAX_VALUE + (Number.MAX_VALUE + Number.MAX_VALUE))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-024.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-024.js
new file mode 100644 (file)
index 0000000..bfb10ff
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert("1" + 1 + 1 === ("1" + 1) + 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-025.js b/deps/jerry/tests/jerry-test-suite/11/11.06/11.06.03/11.06.03-025.js
new file mode 100644 (file)
index 0000000..e1f9c6c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(("1" + 1) + 1 !== "1" + (1 + 1))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-001.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-001.js
new file mode 100644 (file)
index 0000000..0b5a2ba
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5;
+var b = a << 2 // eq a * 2^2
+assert(b == 20)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-003.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-003.js
new file mode 100644 (file)
index 0000000..650ea54
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5;
+var b = a << 1 + 1;
+assert(b == 20)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-004.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-004.js
new file mode 100644 (file)
index 0000000..22260c1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5;
+var b = a << "2";
+assert(b == 20)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-005.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-005.js
new file mode 100644 (file)
index 0000000..1913894
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a;
+var b = a << 2;
+assert(b == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-006.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-006.js
new file mode 100644 (file)
index 0000000..d2a4b72
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null;
+var b = a << 2;
+assert(b == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-007.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-007.js
new file mode 100644 (file)
index 0000000..17aa46d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5;
+var b = a << null;
+assert(b == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-008.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-008.js
new file mode 100644 (file)
index 0000000..44cc103
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5;
+var b = a << true;
+assert(b == 10)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-009.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.01/11.07.01-009.js
new file mode 100644 (file)
index 0000000..acc8f45
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5;
+var b = a << -1;
+assert(b == -2147483648) // -2^31
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-001.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-001.js
new file mode 100644 (file)
index 0000000..2c096e3
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 20;
+var b = a >> 2 // eq a / 2^2
+assert(b == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-002.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-002.js
new file mode 100644 (file)
index 0000000..0a95f4f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 20;
+var b = a >> 1 + 1;
+assert(b == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-003.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-003.js
new file mode 100644 (file)
index 0000000..c13e73e
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 20;
+var b = a >> "2";
+assert(b == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-004.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-004.js
new file mode 100644 (file)
index 0000000..defce66
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a;
+var b = a >> 2;
+assert(b == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-005.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-005.js
new file mode 100644 (file)
index 0000000..51b95df
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null;
+var b = a >> 2;
+assert(b == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-006.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-006.js
new file mode 100644 (file)
index 0000000..f67c22f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5;
+var b = a >> null;
+assert(b == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-007.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-007.js
new file mode 100644 (file)
index 0000000..e65e4df
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 20;
+var b = a >> true;
+assert(b == 10)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-008.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-008.js
new file mode 100644 (file)
index 0000000..835337b
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5;
+var b = a >> -1;
+assert(b == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-009.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.02/11.07.02-009.js
new file mode 100644 (file)
index 0000000..38cc917
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var b = -2147483648 >> 30;
+assert(b == -2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-001.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-001.js
new file mode 100644 (file)
index 0000000..0eac5f7
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 20;
+var b = a >>> 2 // eq a / 2^2
+assert(b == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-002.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-002.js
new file mode 100644 (file)
index 0000000..e2ece10
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+    var a = 20;
+    var b = a >>> 1+1;
+assert(b == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-003.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-003.js
new file mode 100644 (file)
index 0000000..2ddb2aa
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 20;
+var b = a >>> "2";
+assert(b == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-004.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-004.js
new file mode 100644 (file)
index 0000000..0903175
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a;
+var b = a >>> 2;
+assert(b == 0)
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-005.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-005.js
new file mode 100644 (file)
index 0000000..1a9d88a
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null;
+var b = a >>> 2;
+assert(b == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-006.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-006.js
new file mode 100644 (file)
index 0000000..0e30584
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5;
+var b = a >>> null;
+assert(b == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-007.js b/deps/jerry/tests/jerry-test-suite/11/11.07/11.07.03/11.07.03-007.js
new file mode 100644 (file)
index 0000000..03687e3
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 20;
+var b = a >>> true;
+assert(b == 10)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-001.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-001.js
new file mode 100644 (file)
index 0000000..aa5ea15
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5, b = 7
+var c = a < b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-002.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-002.js
new file mode 100644 (file)
index 0000000..57b8169
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 7, b = 6
+var c = a < b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-003.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-003.js
new file mode 100644 (file)
index 0000000..10913e6
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "abc", b = "abd"
+var c = a < b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-004.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-004.js
new file mode 100644 (file)
index 0000000..f6b0c13
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "abd", b = "abc"
+var c = a < b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-005.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-005.js
new file mode 100644 (file)
index 0000000..ed28fb3
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null, b = undefined
+var c = a < b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-006.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.01/11.08.01-006.js
new file mode 100644 (file)
index 0000000..02eb1a5
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false, b = true
+var c = a < b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-001.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-001.js
new file mode 100644 (file)
index 0000000..7f6ae4a
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 700000000000000000000, b = 500000000000000000000
+var c = a > b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-002.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-002.js
new file mode 100644 (file)
index 0000000..d8bd872
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 6.233, b = 6.234
+var c = a > b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-003.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-003.js
new file mode 100644 (file)
index 0000000..d973090
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "zbda", b = "zbd"
+var c = a > b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-004.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-004.js
new file mode 100644 (file)
index 0000000..a89027f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "aaaaa1", b = "aaaaaz"
+var c = a > b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-005.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-005.js
new file mode 100644 (file)
index 0000000..2f5af43
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null, b = undefined
+var c = a > b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-006.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.02/11.08.02-006.js
new file mode 100644 (file)
index 0000000..16d02e2
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false, b = true
+var c = a > b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-001.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-001.js
new file mode 100644 (file)
index 0000000..97fc60d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5, b = 7
+var c = a <= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-002.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-002.js
new file mode 100644 (file)
index 0000000..af6815d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 7, b = 6
+var c = a <= b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-003.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-003.js
new file mode 100644 (file)
index 0000000..ae0a7d6
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "abc", b = "abd"
+var c = a <= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-004.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-004.js
new file mode 100644 (file)
index 0000000..c435d97
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "abd", b = "abc"
+var c = a <= b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-005.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-005.js
new file mode 100644 (file)
index 0000000..f433b9b
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null, b = undefined
+var c = a <= b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-006.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-006.js
new file mode 100644 (file)
index 0000000..3efa3bf
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false, b = true
+var c = a <= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-007.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-007.js
new file mode 100644 (file)
index 0000000..8ccf0e5
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 7, b = 7
+var c = a <= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-008.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-008.js
new file mode 100644 (file)
index 0000000..6e8f494
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "abd", b = "abd"
+var c = a <= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-009.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-009.js
new file mode 100644 (file)
index 0000000..5c59755
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true, b = true
+var c = a <= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-010.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-010.js
new file mode 100644 (file)
index 0000000..6a82ca0
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 2, b = function () {
+}
+var c = a <= b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-011.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.03/11.08.03-011.js
new file mode 100644 (file)
index 0000000..8418a19
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 2, b = 'sdafg'
+var c = a <= b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-001.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-001.js
new file mode 100644 (file)
index 0000000..145d171
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 700000000000000000000, b = 500000000000000000000
+var c = a >= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-002.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-002.js
new file mode 100644 (file)
index 0000000..a0b7e6f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 6.233, b = 6.234
+var c = a >= b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-003.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-003.js
new file mode 100644 (file)
index 0000000..5b27d96
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "zbda", b = "zbd"
+var c = a >= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-004.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-004.js
new file mode 100644 (file)
index 0000000..5168a78
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "aaaaa1", b = "aaaaaz"
+var c = a >= b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-005.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-005.js
new file mode 100644 (file)
index 0000000..98c1e34
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null, b = undefined
+var c = a >= b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-006.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-006.js
new file mode 100644 (file)
index 0000000..e25971f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false, b = true
+var c = a >= b
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-007.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-007.js
new file mode 100644 (file)
index 0000000..9d342f2
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false, b = false
+var c = a >= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-008.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-008.js
new file mode 100644 (file)
index 0000000..1913ace
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 1.2, b = '1.2'
+var c = a >= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-009.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.04/11.08.04-009.js
new file mode 100644 (file)
index 0000000..8f04bce
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 6.233, b = 6.233
+var c = a >= b
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-001.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-001.js
new file mode 100644 (file)
index 0000000..4806f6e
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 2
+var c = a instanceof Number
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-002.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-002.js
new file mode 100644 (file)
index 0000000..f3aee72
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = Number(2)
+var c = a instanceof Number
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-003.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-003.js
new file mode 100644 (file)
index 0000000..3201b4b
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new Number(2)
+var c = a instanceof Number
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-004.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-004.js
new file mode 100644 (file)
index 0000000..1a4e51a
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 'abcd'
+var c = a instanceof String
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-005.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-005.js
new file mode 100644 (file)
index 0000000..1a90be3
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new String('abcd')
+var c = a instanceof String
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-006.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-006.js
new file mode 100644 (file)
index 0000000..00e3a7c
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = function () {
+}
+var b = new a()
+var c = b instanceof a
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-007.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-007.js
new file mode 100644 (file)
index 0000000..1728932
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new Object()
+var c = a instanceof Object
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-001.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-001.js
new file mode 100644 (file)
index 0000000..89b689f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = [1, 2, 3, 4, 5, 6]
+var c = 0 in a
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-002.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-002.js
new file mode 100644 (file)
index 0000000..b645513
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = [1, 2, 3, 4, 5, 6]
+var c = 5 in a
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-003.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-003.js
new file mode 100644 (file)
index 0000000..c4b1d1e
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = [1, 2, 3, 4, 5, 6]
+var c = 6 in a
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-004.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-004.js
new file mode 100644 (file)
index 0000000..75e50ae
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+
+var a = [1, 2, 3, 4, 5, 6]
+var c = '0' in a
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-005.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-005.js
new file mode 100644 (file)
index 0000000..236b2f6
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = {name: 'Masha', 'age': 10}
+var c = 'name' in a
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-007.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-007.js
new file mode 100644 (file)
index 0000000..a532661
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = {name: 'Masha', 'age': 10}
+var c = "age" in a
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-008.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-008.js
new file mode 100644 (file)
index 0000000..89bebf2
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = {name: 'Masha', 'age': 10}
+var c = 'Masha' in a
+assert(!c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-009.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-009.js
new file mode 100644 (file)
index 0000000..1cd3d38
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = {name: 'Masha', 'age': 10}
+var c = "toString" in a
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-010.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-010.js
new file mode 100644 (file)
index 0000000..e953bb7
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new String('example');
+assert('toString' in a);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-011.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-011.js
new file mode 100644 (file)
index 0000000..d84bc78
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new String('example')
+var c = 'length' in a
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-012.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-012.js
new file mode 100644 (file)
index 0000000..6250122
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new String('example');
+assert(!('toString.' in a));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-013.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-013.js
new file mode 100644 (file)
index 0000000..5936883
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new String('example')
+var c = 'toString' in a
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-014.js b/deps/jerry/tests/jerry-test-suite/11/11.08/11.08.07/11.08.07-014.js
new file mode 100644 (file)
index 0000000..7e2fe04
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var c = 'PI' in Math
+assert(c)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-001.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-001.js
new file mode 100644 (file)
index 0000000..dd15f96
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-002.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-002.js
new file mode 100644 (file)
index 0000000..eb54c3f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = null, y = null
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-003.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-003.js
new file mode 100644 (file)
index 0000000..1c8721f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = NaN, y = 1
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-004.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-004.js
new file mode 100644 (file)
index 0000000..109ca86
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 2, y = NaN
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-005.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-005.js
new file mode 100644 (file)
index 0000000..91dfe3f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 2.756, y = 2.756
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-006.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-006.js
new file mode 100644 (file)
index 0000000..32f404e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = +0, y = -0
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-007.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-007.js
new file mode 100644 (file)
index 0000000..6ae0531
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = -0, y = +0
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-008.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-008.js
new file mode 100644 (file)
index 0000000..ae17d1b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 2.8, y = 3.4
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-009.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-009.js
new file mode 100644 (file)
index 0000000..1d3c6af
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "abg", y = 'abg'
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-010.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-010.js
new file mode 100644 (file)
index 0000000..b1c28c2
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "abg", y = 'abgs'
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-011.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-011.js
new file mode 100644 (file)
index 0000000..9fc441b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "abg", y = 'abh'
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-012.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-012.js
new file mode 100644 (file)
index 0000000..93058d6
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "abg", y = 'aBg'
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-013.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-013.js
new file mode 100644 (file)
index 0000000..f3f7c11
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = true
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-014.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-014.js
new file mode 100644 (file)
index 0000000..5540dce
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = false
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-015.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-015.js
new file mode 100644 (file)
index 0000000..0bacf0c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = true
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-016.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-016.js
new file mode 100644 (file)
index 0000000..180a6c0
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = null, y = undefined
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-017.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-017.js
new file mode 100644 (file)
index 0000000..8ba79c9
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = undefined, y = null
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-018.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-018.js
new file mode 100644 (file)
index 0000000..8b4ca08
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "0.123"
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-019.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-019.js
new file mode 100644 (file)
index 0000000..cd87a7f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "0.124"
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-020.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-020.js
new file mode 100644 (file)
index 0000000..9c5d38d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "0.123e0"
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-021.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-021.js
new file mode 100644 (file)
index 0000000..0935bfc
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "0.123e+2"
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-022.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-022.js
new file mode 100644 (file)
index 0000000..e0e427d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "0.123a"
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-023.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-023.js
new file mode 100644 (file)
index 0000000..e9a325f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "b0.123"
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-024.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-024.js
new file mode 100644 (file)
index 0000000..c588393
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "1.23e-1"
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-025.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-025.js
new file mode 100644 (file)
index 0000000..23889ca
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = "-0"
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-026.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-026.js
new file mode 100644 (file)
index 0000000..543002e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = "+1"
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-027.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-027.js
new file mode 100644 (file)
index 0000000..6ff5ee6
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = "-1"
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-028.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-028.js
new file mode 100644 (file)
index 0000000..4dde0e6
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = "true"
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-029.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-029.js
new file mode 100644 (file)
index 0000000..1c7a855
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = "123"
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-030.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-030.js
new file mode 100644 (file)
index 0000000..d4894a6
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = Object("abc")
+b = x
+assert(x == b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-031.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-031.js
new file mode 100644 (file)
index 0000000..b46019d
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var x = Object("abc")
+var y = Object("abc")
+b = x, c = y
+assert(!(c == b))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-032.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-032.js
new file mode 100644 (file)
index 0000000..a054771
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = "a"
+var y = 2
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-033.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-033.js
new file mode 100644 (file)
index 0000000..c0f5b09
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = "12.1e5"
+var y = 1210000
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-034.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-034.js
new file mode 100644 (file)
index 0000000..dead472
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = "1"
+var y = true
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-035.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-035.js
new file mode 100644 (file)
index 0000000..348a65e
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = 0
+var y = false
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-036.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-036.js
new file mode 100644 (file)
index 0000000..39157be
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = 1e-324
+var y = false
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-037.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-037.js
new file mode 100644 (file)
index 0000000..6b7ed2d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = 0.1e-323
+var y = false
+assert(x == y)
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-038.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.01/11.09.01-038.js
new file mode 100644 (file)
index 0000000..f1fbaf7
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "0", y = Object(0)
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-001.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-001.js
new file mode 100644 (file)
index 0000000..dd15f96
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-002.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-002.js
new file mode 100644 (file)
index 0000000..eb54c3f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = null, y = null
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-003.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-003.js
new file mode 100644 (file)
index 0000000..e3e670e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = NaN, y = 1
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-004.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-004.js
new file mode 100644 (file)
index 0000000..6d22426
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 2, y = NaN
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-005.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-005.js
new file mode 100644 (file)
index 0000000..91dfe3f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 2.756, y = 2.756
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-006.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-006.js
new file mode 100644 (file)
index 0000000..32f404e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = +0, y = -0
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-007.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-007.js
new file mode 100644 (file)
index 0000000..6ae0531
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = -0, y = +0
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-008.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-008.js
new file mode 100644 (file)
index 0000000..6e4665c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 2.8, y = 3.4
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-009.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-009.js
new file mode 100644 (file)
index 0000000..1d3c6af
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "abg", y = 'abg'
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-010.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-010.js
new file mode 100644 (file)
index 0000000..b1c28c2
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "abg", y = 'abgs'
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-011.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-011.js
new file mode 100644 (file)
index 0000000..4155587
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "abg", y = 'abh'
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-012.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-012.js
new file mode 100644 (file)
index 0000000..7b0b7c1
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "abg", y = 'aBg'
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-013.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-013.js
new file mode 100644 (file)
index 0000000..f3f7c11
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = true
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-014.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-014.js
new file mode 100644 (file)
index 0000000..5540dce
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = false
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-015.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-015.js
new file mode 100644 (file)
index 0000000..45c08df
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = true
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-016.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-016.js
new file mode 100644 (file)
index 0000000..180a6c0
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = null, y = undefined
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-017.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-017.js
new file mode 100644 (file)
index 0000000..8ba79c9
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = undefined, y = null
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-018.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-018.js
new file mode 100644 (file)
index 0000000..8b4ca08
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "0.123"
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-019.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-019.js
new file mode 100644 (file)
index 0000000..eec4070
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "0.124"
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-020.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-020.js
new file mode 100644 (file)
index 0000000..9c5d38d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "0.123e0"
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-021.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-021.js
new file mode 100644 (file)
index 0000000..0935bfc
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "0.123e+2"
+assert(!(x == y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-022.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-022.js
new file mode 100644 (file)
index 0000000..aed3b10
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "0.123a"
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-023.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-023.js
new file mode 100644 (file)
index 0000000..680bde7
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "b0.123"
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-024.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-024.js
new file mode 100644 (file)
index 0000000..c588393
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.123, y = "1.23e-1"
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-025.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-025.js
new file mode 100644 (file)
index 0000000..23889ca
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = "-0"
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-026.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-026.js
new file mode 100644 (file)
index 0000000..543002e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = "+1"
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-027.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-027.js
new file mode 100644 (file)
index 0000000..8e41f75
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = "-1"
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-028.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-028.js
new file mode 100644 (file)
index 0000000..6e68cdc
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = "true"
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-029.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-029.js
new file mode 100644 (file)
index 0000000..35ed16b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = "123"
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-030.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-030.js
new file mode 100644 (file)
index 0000000..d4894a6
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = Object("abc")
+b = x
+assert(x == b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-031.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-031.js
new file mode 100644 (file)
index 0000000..458eb24
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var x = Object("abc")
+var y = Object("abc")
+b = x, c = y
+assert(c != b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-032.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-032.js
new file mode 100644 (file)
index 0000000..25d4b43
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = "a"
+var y = 2
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-033.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-033.js
new file mode 100644 (file)
index 0000000..9d7c63f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = "12.1e5"
+var y = 1210000
+assert(!(x != y))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-034.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-034.js
new file mode 100644 (file)
index 0000000..dead472
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = "1"
+var y = true
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-035.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-035.js
new file mode 100644 (file)
index 0000000..348a65e
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = 0
+var y = false
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-036.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-036.js
new file mode 100644 (file)
index 0000000..39157be
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = 1e-324
+var y = false
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-037.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-037.js
new file mode 100644 (file)
index 0000000..3ac5f02
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = 1e-323
+var y = false
+assert(x != y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-038.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.02/11.09.02-038.js
new file mode 100644 (file)
index 0000000..f1fbaf7
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "0", y = Object(0)
+assert(x == y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-001.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-001.js
new file mode 100644 (file)
index 0000000..38d3a3a
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y = null
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-002.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-002.js
new file mode 100644 (file)
index 0000000..ad0431c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y = true
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-003.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-003.js
new file mode 100644 (file)
index 0000000..6b8c64c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y = "undefined"
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-004.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-004.js
new file mode 100644 (file)
index 0000000..93b255a
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y = -37.2e-6
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-005.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-005.js
new file mode 100644 (file)
index 0000000..21b07fe
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y = new Function()
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-006.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-006.js
new file mode 100644 (file)
index 0000000..6f8f466
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = null, y = 0
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-007.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-007.js
new file mode 100644 (file)
index 0000000..0824c4e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = 0
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-008.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-008.js
new file mode 100644 (file)
index 0000000..c87f14d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "0", y = 0
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-009.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-009.js
new file mode 100644 (file)
index 0000000..67f1875
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "0", y = Object(0)
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-010.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-010.js
new file mode 100644 (file)
index 0000000..b32ce74
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = "abc", y = new String("abc")
+
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-011.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-011.js
new file mode 100644 (file)
index 0000000..3f3c7c6
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-012.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-012.js
new file mode 100644 (file)
index 0000000..fee35e6
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = y = null
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-013.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-013.js
new file mode 100644 (file)
index 0000000..9b6f527
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = NaN, y = 0
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-014.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-014.js
new file mode 100644 (file)
index 0000000..343a83b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.0, y = NaN
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-015.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-015.js
new file mode 100644 (file)
index 0000000..86d9443
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = NaN, y = NaN
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-016.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-016.js
new file mode 100644 (file)
index 0000000..0f637f3
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 123.00, y = 0.0123e+4, eps = .00001
+assert(x <= y + eps && x >= y - eps)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-017.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-017.js
new file mode 100644 (file)
index 0000000..e27d2bd
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 123.01, y = 0.0123e+4
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-018.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-018.js
new file mode 100644 (file)
index 0000000..f00d505
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = +0, y = -0
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-019.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-019.js
new file mode 100644 (file)
index 0000000..2b71ccf
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = -0, y = +0
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-020.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-020.js
new file mode 100644 (file)
index 0000000..40ce835
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "12.6asdg$7_sfk/sf/adf\.3rqaf\u0102", y = "12.6asdg$7_sfk/sf/adf\.3rqaf\u0102"
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-021.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-021.js
new file mode 100644 (file)
index 0000000..151ccce
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = true
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-022.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-022.js
new file mode 100644 (file)
index 0000000..493bd27
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = false
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-023.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-023.js
new file mode 100644 (file)
index 0000000..e57c4b5
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = true
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-024.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-024.js
new file mode 100644 (file)
index 0000000..d58a6aa
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = new String("abc")
+var y = x
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-025.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.04/11.09.04-025.js
new file mode 100644 (file)
index 0000000..7e56093
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var x = new String("abc")
+var y = new String("abc")
+
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-001.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-001.js
new file mode 100644 (file)
index 0000000..38d3a3a
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y = null
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-002.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-002.js
new file mode 100644 (file)
index 0000000..ad0431c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y = true
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-003.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-003.js
new file mode 100644 (file)
index 0000000..6b8c64c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y = "undefined"
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-004.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-004.js
new file mode 100644 (file)
index 0000000..93b255a
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y = -37.2e-6
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-005.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-005.js
new file mode 100644 (file)
index 0000000..21b07fe
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y = new Function()
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-006.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-006.js
new file mode 100644 (file)
index 0000000..6f8f466
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = null, y = 0
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-007.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-007.js
new file mode 100644 (file)
index 0000000..0824c4e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = 0
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-008.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-008.js
new file mode 100644 (file)
index 0000000..c87f14d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "0", y = 0
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-009.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-009.js
new file mode 100644 (file)
index 0000000..67f1875
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "0", y = Object(0)
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-010.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-010.js
new file mode 100644 (file)
index 0000000..1030430
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "abc", y = new String("abc")
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-011.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-011.js
new file mode 100644 (file)
index 0000000..3f3c7c6
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x, y
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-012.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-012.js
new file mode 100644 (file)
index 0000000..fee35e6
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = y = null
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-013.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-013.js
new file mode 100644 (file)
index 0000000..9b6f527
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = NaN, y = 0
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-014.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-014.js
new file mode 100644 (file)
index 0000000..343a83b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 0.0, y = NaN
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-015.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-015.js
new file mode 100644 (file)
index 0000000..86d9443
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = NaN, y = NaN
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-016.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-016.js
new file mode 100644 (file)
index 0000000..0f637f3
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 123.00, y = 0.0123e+4, eps = .00001
+assert(x <= y + eps && x >= y - eps)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-017.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-017.js
new file mode 100644 (file)
index 0000000..e27d2bd
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = 123.01, y = 0.0123e+4
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-018.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-018.js
new file mode 100644 (file)
index 0000000..f00d505
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = +0, y = -0
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-019.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-019.js
new file mode 100644 (file)
index 0000000..2b71ccf
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = -0, y = +0
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-020.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-020.js
new file mode 100644 (file)
index 0000000..40ce835
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = "12.6asdg$7_sfk/sf/adf\.3rqaf\u0102", y = "12.6asdg$7_sfk/sf/adf\.3rqaf\u0102"
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-021.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-021.js
new file mode 100644 (file)
index 0000000..151ccce
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = true, y = true
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-022.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-022.js
new file mode 100644 (file)
index 0000000..493bd27
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = false
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-023.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-023.js
new file mode 100644 (file)
index 0000000..e57c4b5
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var x = false, y = true
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-024.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-024.js
new file mode 100644 (file)
index 0000000..d58a6aa
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = new String("abc")
+var y = x
+assert(x === y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-025.js b/deps/jerry/tests/jerry-test-suite/11/11.09/11.09.05/11.09.05-025.js
new file mode 100644 (file)
index 0000000..37ebef8
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var x = new String("abc")
+var y = new String("abc")
+assert(x !== y)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-001.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-001.js
new file mode 100644 (file)
index 0000000..7d9ccc4
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 10;
+a = 1 & 2;
+assert(a == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-002.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-002.js
new file mode 100644 (file)
index 0000000..b966b5d
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var b = 1;
+a & b;
+assert(a == 4 && b == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-003.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-003.js
new file mode 100644 (file)
index 0000000..c8d229b
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var b = "0";
+a = 1 & b;
+assert(a == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-004.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-004.js
new file mode 100644 (file)
index 0000000..7f032b1
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var b = null;
+a = 1 & b;
+assert(a == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-005.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-005.js
new file mode 100644 (file)
index 0000000..8bc9875
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var b;
+a = 1 & b;
+assert(a == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-006.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-006.js
new file mode 100644 (file)
index 0000000..bc06ccb
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a;
+a = 4 | 1;
+assert(a == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-007.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-007.js
new file mode 100644 (file)
index 0000000..e1f764c
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var b = 1;
+a | b;
+assert(a == 4 && b == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-008.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-008.js
new file mode 100644 (file)
index 0000000..b64ba5a
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a;
+var b = "0";
+a = 1 | b;
+assert(a == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-009.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-009.js
new file mode 100644 (file)
index 0000000..e333279
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var b = null;
+a = 1 | b;
+assert(a == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-010.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-010.js
new file mode 100644 (file)
index 0000000..a37440f
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var b;
+a = 1 | b;
+assert(a == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-011.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-011.js
new file mode 100644 (file)
index 0000000..936e48e
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a;
+a = 1 ^ 3;
+assert(a == 2)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-012.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-012.js
new file mode 100644 (file)
index 0000000..597541e
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var b = 1;
+a ^ b;
+assert(a == 4 && b == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-013.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-013.js
new file mode 100644 (file)
index 0000000..b713fe9
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a;
+var b = "0";
+a = 1 ^ b;
+assert(a == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-014.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-014.js
new file mode 100644 (file)
index 0000000..b9b14ab
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var b = null;
+a = 1 ^ b;
+assert(a == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-015.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-015.js
new file mode 100644 (file)
index 0000000..026d178
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var b;
+a = 1 ^ b;
+assert(a == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-016.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-016.js
new file mode 100644 (file)
index 0000000..e342237
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 10;
+a = 1 & 2147483648;
+assert(a == 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-017.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-017.js
new file mode 100644 (file)
index 0000000..281760c
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 10;
+a = 1 & 2147483647;
+assert(a == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-018.js b/deps/jerry/tests/jerry-test-suite/11/11.10/11.10-018.js
new file mode 100644 (file)
index 0000000..a6ed00e
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 10;
+a = 2147483647 & 2147483649;
+assert(a == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-001.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-001.js
new file mode 100644 (file)
index 0000000..86f9fa5
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+var b = false;
+assert(!((a && b) === true))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-002.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-002.js
new file mode 100644 (file)
index 0000000..23b0701
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+var b = true;
+assert((a && b) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-003.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-003.js
new file mode 100644 (file)
index 0000000..5374e31
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false;
+var b = false;
+assert(!((a && b) === true))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-004.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-004.js
new file mode 100644 (file)
index 0000000..77fa32f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false;
+var b = new Object();
+assert((a && b) === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-005.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-005.js
new file mode 100644 (file)
index 0000000..1107ee0
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+var b = new Object();
+assert((a && b) === b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-006.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-006.js
new file mode 100644 (file)
index 0000000..145bf14
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "not empty string"; // will be converted to true
+var b = new Object();
+assert(!((a && b) !== b))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-007.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-007.js
new file mode 100644 (file)
index 0000000..1b82e96
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = ""; // empty string - false
+var b = new Object();
+assert(!((a && b) !== a))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-008.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-008.js
new file mode 100644 (file)
index 0000000..10d16e1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 0;
+var b = new Object();
+assert((a && b) === 0)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-009.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-009.js
new file mode 100644 (file)
index 0000000..2bef661
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = NaN;
+var b = new Object ();
+assert ((!a && b) === b);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-010.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-010.js
new file mode 100644 (file)
index 0000000..c234698
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 12345; // -> true
+var b = new Object();
+assert((a && b) === b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-011.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-011.js
new file mode 100644 (file)
index 0000000..8c994c5
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null; // -> false
+var b = new Object();
+assert((a && b) === a)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-012.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-012.js
new file mode 100644 (file)
index 0000000..3f69735
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = undefined; // -> false
+var b = new Object();
+assert((a && b) === a)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-013.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-013.js
new file mode 100644 (file)
index 0000000..f625a61
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new Object;
+var b = new Object;
+assert((a && b) === b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-014.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-014.js
new file mode 100644 (file)
index 0000000..ebf79c9
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+var b = false;
+assert((a || b) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-015.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-015.js
new file mode 100644 (file)
index 0000000..471d747
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+var b = true;
+assert((a || b) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-016.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-016.js
new file mode 100644 (file)
index 0000000..8f696b4
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false;
+var b = true;
+assert((a || b) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-017.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-017.js
new file mode 100644 (file)
index 0000000..757b644
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false;
+var b = false;
+assert((a || b) === false)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-018.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-018.js
new file mode 100644 (file)
index 0000000..5b2c898
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+var b = new Object;
+assert((a || b) === true)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-019.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-019.js
new file mode 100644 (file)
index 0000000..26f26ca
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false;
+var b = new Object;
+assert((a || b) === b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-020.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-020.js
new file mode 100644 (file)
index 0000000..b3406af
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a1 = +0;
+var a2 = -0;
+var b = new Object;
+assert(((a1 || b) === b) && ((a2 || b) === b))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-021.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-021.js
new file mode 100644 (file)
index 0000000..d6fcf10
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = NaN;
+var b = new Object;
+assert((a || b) === b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-022.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-022.js
new file mode 100644 (file)
index 0000000..d430bdd
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 123.456;
+var b = new Object;
+assert((a || b) === a)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-023.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-023.js
new file mode 100644 (file)
index 0000000..bb25c73
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "non empty string";//-> true
+var b = new Object;
+assert((a || b) === a)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-024.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-024.js
new file mode 100644 (file)
index 0000000..d6ea214
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "";//-> false
+var b = new Object;
+assert((a || b) === b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-025.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-025.js
new file mode 100644 (file)
index 0000000..5ea9419
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = null;//->false
+var b = Number(123.5e5);
+assert((a || b) === b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-026.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-026.js
new file mode 100644 (file)
index 0000000..92f8ecd
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = undefined;
+var b = new String("123");
+assert((a || b) === b)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-027.js b/deps/jerry/tests/jerry-test-suite/11/11.11/11.11-027.js
new file mode 100644 (file)
index 0000000..e276ce1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new Object;
+var b = "who cares, what is this?";
+assert((a || b) === a)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-001.js b/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-001.js
new file mode 100644 (file)
index 0000000..a27f048
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = 5;
+var b = 3;
+
+var c = (a > b) ? 12 : 14;
+
+assert(c == 12)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-002.js b/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-002.js
new file mode 100644 (file)
index 0000000..4e650a8
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var a = 1;
+var b = 2;
+var c = 3;
+
+var d;
+
+d = a < b ? b < c ? 5 : 10 : 15;
+
+assert(d == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-003.js b/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-003.js
new file mode 100644 (file)
index 0000000..e8b6f82
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var a = 1;
+var b = 2;
+var c = 3;
+
+var d;
+
+d = a > b ? 5 : b < c ? 10 : 15;
+
+assert(d == 10)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-004.js b/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-004.js
new file mode 100644 (file)
index 0000000..bd25f5d
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+var a = 1;
+var b = 2;
+var c = 1;
+var d = 1;
+
+var e;
+
+e = (a < b) ? (c = 100) : (d = 10);
+
+assert(c == 100 && e == 100 && d == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-005.js b/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-005.js
new file mode 100644 (file)
index 0000000..da7913d
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+var a = 1;
+var b = 2;
+var c = 1;
+var d = 1;
+
+var e;
+
+e = (a > b) ? (c = 100) : (d = 10);
+
+assert(c == 1 && e == 10 && d == 10)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-008.js b/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-008.js
new file mode 100644 (file)
index 0000000..7d4c64e
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+var cond = 23;
+var a = [1, 2, 4];
+var cnt = 0;
+
+for (var i = (cond < 24) ? 0 in a : 2; i < 10; ++i)
+{
+  ++cnt;
+}
+
+assert(cnt == 9)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-012.js b/deps/jerry/tests/jerry-test-suite/11/11.12/11.12-012.js
new file mode 100644 (file)
index 0000000..f8e8051
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+var cond = 12;
+var res;
+
+res = (cond < 13)
+        ?
+        1
+        :
+        2;
+
+assert(res == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.01/11.13.01-001.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.01/11.13.01-001.js
new file mode 100644 (file)
index 0000000..7e55db7
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = 5;
+var b;
+
+b = a;
+assert(b == 5)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-001.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-001.js
new file mode 100644 (file)
index 0000000..ae0c186
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 1;
+var b = 2;
+a += b;
+assert(a === 3);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-002.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-002.js
new file mode 100644 (file)
index 0000000..dc29d7e
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 1;
+var b = "2";
+a += b;
+assert(a === "12")
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-003.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-003.js
new file mode 100644 (file)
index 0000000..dd75442
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = "1";
+var b = 2;
+a += b;
+assert(a === "12")
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-004.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-004.js
new file mode 100644 (file)
index 0000000..b7a946e
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = "1";
+var b = "2";
+a += b;
+assert(a === "12")
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-005.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-005.js
new file mode 100644 (file)
index 0000000..2eb4b75
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = true;
+var b = false;
+a += b;
+assert(a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-006.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-006.js
new file mode 100644 (file)
index 0000000..0d74c70
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 1;
+var b = null;
+a += b;
+assert(a === 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-007.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-007.js
new file mode 100644 (file)
index 0000000..1e05e8f
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 3;
+var _a = a;
+var b = 7;
+assert((a += b) === (_a + b))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-008.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-008.js
new file mode 100644 (file)
index 0000000..65522f3
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 5;
+var _a = a;
+var b = 10;
+assert((a -= b) === (_a - b))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-009.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-009.js
new file mode 100644 (file)
index 0000000..5e5c612
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 10;
+var _a = a;
+var b = 1.5;
+assert((a *= b) === (_a * b))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-010.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-010.js
new file mode 100644 (file)
index 0000000..c1bb406
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 1;
+var _a = a;
+var b = 10.6;
+assert((a /= b) === (_a / b))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-011.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-011.js
new file mode 100644 (file)
index 0000000..a351850
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 102;
+var _a = a;
+var b = 10;
+assert(((a %= b) === (_a % b)) && (a === (_a % b)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-012.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-012.js
new file mode 100644 (file)
index 0000000..065b16e
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 0xffffffff;
+var _a = a;
+var b = 4;
+assert ((a >>= b) === (_a >> b));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-013.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-013.js
new file mode 100644 (file)
index 0000000..812b2ac
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 0xffffffff;
+var _a = a;
+var b = 4;
+assert ((a <<= b) === (_a << b));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-014.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-014.js
new file mode 100644 (file)
index 0000000..bfdef09
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 0xffffffff;
+var _a = a;
+var b = 4;
+assert ((a >>>= b) === (_a >>> b));
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-039.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-039.js
new file mode 100644 (file)
index 0000000..678f141
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 4;
+var _a = a;
+var b = 10;
+assert((a %= b) === (_a % b))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-040.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-040.js
new file mode 100644 (file)
index 0000000..179655c
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 1
+  },
+  toString: function () {
+    return 0
+  }
+}
+
+copyObject = object;
+assert(((object *= 2) === (copyObject * 2)) && (object === (copyObject * 2)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-041.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-041.js
new file mode 100644 (file)
index 0000000..55f68b4
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 1
+  },
+  toString: function () {
+    return 0
+  }
+}
+
+copyObject = object;
+assert(((object += 2) === (copyObject + 2)) && (object === (copyObject + 2)))
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-042.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-042.js
new file mode 100644 (file)
index 0000000..5e9dff3
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 15
+  },
+  toString: function () {
+    return ""
+  }
+}
+
+copyObject = object;
+assert(((object -= 2) === (copyObject - 2)) && (object === (copyObject - 2)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-043.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-043.js
new file mode 100644 (file)
index 0000000..1fcc33c
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 178
+  },
+  toString: function () {
+    return 0
+  }
+}
+
+copyObject = object;
+assert(((object /= 2) === (copyObject / 2)) && (object === (copyObject / 2)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-044.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-044.js
new file mode 100644 (file)
index 0000000..7080f05
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 1345
+  },
+  toString: function () {
+    return "foo"
+  }
+}
+
+copyObject = object;
+assert(((object %= 2) === (copyObject % 2)) && (object === (copyObject % 2)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-045.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-045.js
new file mode 100644 (file)
index 0000000..be45a5b
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 16
+  },
+  toString: function () {
+    return 0
+  }
+}
+
+copyObject = object;
+assert(((object <<= 2) === (copyObject << 2)) && (object === (copyObject << 2)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-046.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-046.js
new file mode 100644 (file)
index 0000000..a8f17d2
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 16
+  },
+  toString: function () {
+    return 0
+  }
+}
+
+copyObject = object;
+assert(((object >>= 2) === (copyObject >> 2)) && (object === (copyObject >> 2)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-047.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-047.js
new file mode 100644 (file)
index 0000000..606d3f0
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 16
+  },
+  toString: function () {
+    return 0
+  }
+}
+
+copyObject = object;
+assert(((object >>>= 2) === (copyObject >>> 2)) && (object === (copyObject >>> 2)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-048.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-048.js
new file mode 100644 (file)
index 0000000..0d8613f
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 1
+  },
+  toString: function () {
+    return 0
+  }
+}
+
+copyObject = object;
+assert(((object &= 1) === (copyObject & 1)) && (object === (copyObject & 1)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-049.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-049.js
new file mode 100644 (file)
index 0000000..24e3824
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 1
+  },
+  toString: function () {
+    return 0
+  }
+}
+
+copyObject = object;
+assert(((object |= 1) === (copyObject | 1)) && (object === (copyObject | 1)))
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-050.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-050.js
new file mode 100644 (file)
index 0000000..a5d1679
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return 1
+  },
+  toString: function () {
+    return 0
+  }
+}
+
+copyObject = object;
+assert(((object ^= 1) === (copyObject ^ 1)) && (object === (copyObject ^ 1)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-051.js b/deps/jerry/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-051.js
new file mode 100644 (file)
index 0000000..4457cd6
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+object = {
+  valueOf: function () {
+    return "12"
+  },
+  toString: function () {
+    return 0
+  }
+}
+
+copyObject = object;
+assert(((object += 3) === (copyObject + 3)) && (object === (copyObject + 3)))
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.14/11.14-001.js b/deps/jerry/tests/jerry-test-suite/11/11.14/11.14-001.js
new file mode 100644 (file)
index 0000000..13a2757
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var res = (33, false, 73.234, 100);
+
+assert(res == 100);
diff --git a/deps/jerry/tests/jerry-test-suite/11/11.14/11.14-002.js b/deps/jerry/tests/jerry-test-suite/11/11.14/11.14-002.js
new file mode 100644 (file)
index 0000000..4c6b9a8
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a, b, c, res;
+
+res = (a = 39, b = null, c = 12.5);
+
+assert(a == 39 && b == null && c == 12.5 && res == 12.5)
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.01/12.01-001.js b/deps/jerry/tests/jerry-test-suite/12/12.01/12.01-001.js
new file mode 100644 (file)
index 0000000..c3beab9
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+{
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.01/12.01-002.js b/deps/jerry/tests/jerry-test-suite/12/12.01/12.01-002.js
new file mode 100644 (file)
index 0000000..3a47a87
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+function test ()
+{
+  {
+    return true;
+  }
+  return false;
+}
+
+assert (test ());
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.01/12.01-003.js b/deps/jerry/tests/jerry-test-suite/12/12.01/12.01-003.js
new file mode 100644 (file)
index 0000000..eba8c05
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+{;;}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.01/12.01-004.js b/deps/jerry/tests/jerry-test-suite/12/12.01/12.01-004.js
new file mode 100644 (file)
index 0000000..6446ceb
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+{
+  var a = null;
+  ;
+  a = 'null';
+}
+
+assert(a === 'null');
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.01/12.01-005.js b/deps/jerry/tests/jerry-test-suite/12/12.01/12.01-005.js
new file mode 100644 (file)
index 0000000..fe17d95
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+{
+  {
+    var a = null;
+    ;
+  }
+  {
+    {
+    }
+  }
+  a = 'null';
+}
+
+assert(a === 'null');
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-001.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-001.js
new file mode 100644 (file)
index 0000000..4c75505
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a;
+assert(a === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-002.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-002.js
new file mode 100644 (file)
index 0000000..345b808
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 12345;
+assert(a === 12345);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-003.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-003.js
new file mode 100644 (file)
index 0000000..7e3964b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = null;
+assert(a === null);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-004.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-004.js
new file mode 100644 (file)
index 0000000..28554e4
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = undefined;
+
+assert(a === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-005.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-005.js
new file mode 100644 (file)
index 0000000..65c48a6
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "undefined";
+
+assert(a === "undefined");
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-006.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-006.js
new file mode 100644 (file)
index 0000000..4abd662
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 'undefined';
+
+assert(a === "undefined");
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-007.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-007.js
new file mode 100644 (file)
index 0000000..5599522
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 'undefined';
+
+assert(a === 'undefined');
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-008.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-008.js
new file mode 100644 (file)
index 0000000..f2f45eb
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false, b = true;
+
+assert(a === false && b === true);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-009.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-009.js
new file mode 100644 (file)
index 0000000..7d28073
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = 1,
+        b,
+        c = 4;
+
+b = a + c;
+
+assert(b === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-010.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-010.js
new file mode 100644 (file)
index 0000000..05dea28
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a, b = 3.14, c;
+
+assert(a === undefined && b === 3.14 && c === undefined)
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-011.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-011.js
new file mode 100644 (file)
index 0000000..dcda49b
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a, b, c;
+
+assert(a === undefined && b === undefined && c === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-012.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-012.js
new file mode 100644 (file)
index 0000000..570275c
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var /*
+ //
+ */
+        _a1 = 2;
+
+assert(_a1 === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-013.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-013.js
new file mode 100644 (file)
index 0000000..f3b5bed
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var /*
+ //
+ */
+        _a$1 = 2;
+
+assert(_a$1 === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-014.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-014.js
new file mode 100644 (file)
index 0000000..539497a
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var //
+        //
+        $a = 2;
+assert($a === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-015.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-015.js
new file mode 100644 (file)
index 0000000..080dc62
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 12 + "abc";
+
+assert(a === "12abc");
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-016.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-016.js
new file mode 100644 (file)
index 0000000..33f9890
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = {};
+var b = typeof (a);
+
+assert(b === "object" && b === typeof (Object()) && b === typeof ({}));
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-018.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-018.js
new file mode 100644 (file)
index 0000000..448db75
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = [];
+
+assert(a instanceof Array && a.length === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-019.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-019.js
new file mode 100644 (file)
index 0000000..ef9a795
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var
+        a = 2
+
+assert(a === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-020.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-020.js
new file mode 100644 (file)
index 0000000..f28bfdc
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = RegExp();
+
+assert(a instanceof RegExp);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-021.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-021.js
new file mode 100644 (file)
index 0000000..a5e4eba
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new Date();
+
+assert(a instanceof Date);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-022.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02-022.js
new file mode 100644 (file)
index 0000000..0674abf
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = 1;
+var b = a;
+
+assert(a === b);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02.01/12.02.01-001.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02.01/12.02.01-001.js
new file mode 100644 (file)
index 0000000..858103b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var eval = 1;
+assert(eval === 1 && typeof (eval) === "number");
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.02/12.02.01/12.02.01-002.js b/deps/jerry/tests/jerry-test-suite/12/12.02/12.02.01/12.02.01-002.js
new file mode 100644 (file)
index 0000000..1e868d0
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var arguments = 2;
+assert(arguments === 2 && typeof (arguments) === "number");
+
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.03/12.03-001.js b/deps/jerry/tests/jerry-test-suite/12/12.03/12.03-001.js
new file mode 100644 (file)
index 0000000..41e38a9
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+function test()
+{
+  ;
+  return 1;;;;;;
+}
+
+test();
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.03/12.03-002.js b/deps/jerry/tests/jerry-test-suite/12/12.03/12.03-002.js
new file mode 100644 (file)
index 0000000..eb5b6b8
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+function test()
+{
+ ;;;;;;
+ return 1
+}
+
+test();
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.03/12.03-003.js b/deps/jerry/tests/jerry-test-suite/12/12.03/12.03-003.js
new file mode 100644 (file)
index 0000000..260919e
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a="ab;c"
+;
+;
+assert (a === 'ab;c');
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.04/12.04-001.js b/deps/jerry/tests/jerry-test-suite/12/12.04/12.04-001.js
new file mode 100644 (file)
index 0000000..a4a4411
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 5, b = 1;
+(a + b);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.04/12.04-002.js b/deps/jerry/tests/jerry-test-suite/12/12.04/12.04-002.js
new file mode 100644 (file)
index 0000000..6613464
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 5, b = 1;
+a = a && b;
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.04/12.04-003.js b/deps/jerry/tests/jerry-test-suite/12/12.04/12.04-003.js
new file mode 100644 (file)
index 0000000..0a0199e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a, b, c
+a = 2, b = 3, c = 4
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.04/12.04-004.js b/deps/jerry/tests/jerry-test-suite/12/12.04/12.04-004.js
new file mode 100644 (file)
index 0000000..a4a970e
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a
+a = function () {
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-001.js b/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-001.js
new file mode 100644 (file)
index 0000000..065ed84
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+function test()
+{
+  if (true) {
+    return 1;
+  }
+  assert(false);
+}
+
+test();
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-002.js b/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-002.js
new file mode 100644 (file)
index 0000000..0534815
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+function test()
+{
+  if (false) {
+    assert(false);
+  }
+}
+
+test();
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-003.js b/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-003.js
new file mode 100644 (file)
index 0000000..1471854
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+function test()
+{
+  if (true)
+  {
+    return 1;
+  }
+  else
+    assert(false);
+}
+
+test();
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-004.js b/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-004.js
new file mode 100644 (file)
index 0000000..380d145
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+function test()
+{
+  if (false)
+    assert(false);
+  else {
+    return 1;
+  }
+}
+
+test();
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-005.js b/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-005.js
new file mode 100644 (file)
index 0000000..a737356
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+function test()
+{
+    if(true);
+}
+
+test();
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-006.js b/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-006.js
new file mode 100644 (file)
index 0000000..2ea1f94
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 'w\0', b = 'w\0';
+assert(a === b);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-007.js b/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-007.js
new file mode 100644 (file)
index 0000000..90a4374
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var a = 1, b = 2;
+var c;
+if (a === 1)
+{
+  if (b === 1)
+    c = 3;
+}
+else
+if (b === 2)
+  c = 5;
+else
+  c = 7;
+
+assert(c === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-008.js b/deps/jerry/tests/jerry-test-suite/12/12.05/12.05-008.js
new file mode 100644 (file)
index 0000000..a1eed84
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+var a = 1, b = 2;
+var c;
+if (a === 1)
+  if (b === 1)
+    c = 3;
+  else
+  if (b === 2)
+    c = 5;
+  else
+    c = 7;
+
+assert(c === 5);
+      
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-001.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-001.js
new file mode 100644 (file)
index 0000000..503c1a1
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var cnt = 1;
+do
+  cnt++;
+while (cnt < 10);
+
+assert(cnt === 10);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-002.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-002.js
new file mode 100644 (file)
index 0000000..3f58183
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var cnt = 1;
+do
+{
+  cnt++;
+  if (cnt === 42) {
+    break;
+  }
+} while (true);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-003.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-003.js
new file mode 100644 (file)
index 0000000..7b65d53
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+var cnt = 1;
+do {
+  cnt++;
+  
+  if (cnt === 10)
+  {
+    break;
+  }
+}
+while (0, 1);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-004.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-004.js
new file mode 100644 (file)
index 0000000..e3a62c0
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var obj = new Object();
+obj.x = "defined";
+do
+{
+  delete obj.x;
+}
+while (obj.x !== undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-005.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-005.js
new file mode 100644 (file)
index 0000000..10a72c4
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var x = 1 / 3;
+do
+{
+  x = 1;
+}
+while (x === 3 / 9);
+assert (x === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-006.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-006.js
new file mode 100644 (file)
index 0000000..9e1ae96
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var cnt = 1;
+do
+{
+  cnt++;
+}
+while (false);
+
+assert(cnt === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-007.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-007.js
new file mode 100644 (file)
index 0000000..9a89680
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var cnt = 1;
+do
+{
+  cnt++;
+}
+while (!"string");
+
+assert(cnt === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-008.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-008.js
new file mode 100644 (file)
index 0000000..02574a8
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var cnt = 0;
+do
+{
+  cnt++;
+}
+while (!(cnt & 0x8000));
+
+assert(cnt == 32768);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-009.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-009.js
new file mode 100644 (file)
index 0000000..d9b5164
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var cnt = 0;
+do
+{
+  cnt++;
+}
+while
+        (cnt < 10
+                );
+
+assert(cnt === 10);
+
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-010.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.01/12.06.01-010.js
new file mode 100644 (file)
index 0000000..6c14ec4
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+var cnt = 0;
+
+function test()
+{
+  do
+  {
+    cnt++;
+    if (cnt === 8)
+      return 1;
+  }
+  while (cnt < 10);
+
+  return 0;
+}
+
+var r = test();
+
+assert(cnt === 8 && r === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-001.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-001.js
new file mode 100644 (file)
index 0000000..3d59c1a
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var cnt = 25;
+while (cnt)
+  cnt--;
+
+assert(cnt === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-002.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-002.js
new file mode 100644 (file)
index 0000000..2a528ae
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var cnt = 0;
+
+while (1) {
+  cnt++;
+  if (cnt === 10)
+    break;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-003.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-003.js
new file mode 100644 (file)
index 0000000..6e961af
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var cnt = 0;
+while ((1234 - 34) % 23 - 1234 * 23.222)
+{
+  cnt++;
+  if (cnt === 10)
+    break;
+}
+
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-004.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-004.js
new file mode 100644 (file)
index 0000000..8fba08b
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var cnt = 33;
+
+while ("")
+  cnt /= 2;
+
+assert(cnt === 33);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-005.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-005.js
new file mode 100644 (file)
index 0000000..15bd413
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var bVal = true;
+var val = "test";
+
+while (!bVal)
+{
+  val += " of while";
+}
+
+assert(val === "test");
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-006.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-006.js
new file mode 100644 (file)
index 0000000..4b7767c
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var bitField = 0x1000000;
+var cnt = 0;
+
+while (bitField >>= 1)
+{
+  cnt++;
+}
+
+assert(cnt === 24);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-007.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-007.js
new file mode 100644 (file)
index 0000000..92b5a43
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+
+var bitField = 0x1000000;
+var cnt = 0;
+
+while
+        (
+                bitField >>= 1 &&
+                true
+                )
+{
+  cnt++;
+}
+
+assert(cnt === 24);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-008.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.02/12.06.02-008.js
new file mode 100644 (file)
index 0000000..fb774b1
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var cnt = 25;
+
+function test()
+{
+  while (cnt)
+  {
+    cnt--;
+    if (cnt === 3)
+      return 1;
+  }
+  return 0;
+}
+
+r = test();
+
+assert(cnt === 3 && r === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-001.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-001.js
new file mode 100644 (file)
index 0000000..9285151
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var cnt = 1;
+
+for (var i = 0; i < 10; i++)
+  cnt++;
+
+assert(cnt === 11 && i === 10);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-002.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-002.js
new file mode 100644 (file)
index 0000000..6ca1553
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var cond = 1.999;
+var cnt = 0;
+
+for (; cond < 10.333; cond += 1.121)
+  cnt++;
+
+assert(cnt == 8);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-003.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-003.js
new file mode 100644 (file)
index 0000000..c1df4bd
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var i;
+
+for (i = 0; ; i += 5)
+{
+  if (i === 100)
+    break;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-004.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-004.js
new file mode 100644 (file)
index 0000000..65172e2
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var i;
+
+for (i = 1; i < 20; )
+  i *= 2;
+
+assert(i === 32);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-005.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-005.js
new file mode 100644 (file)
index 0000000..d4037f9
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var i = 0;
+for (; ; )
+{
+  if (i++ === 100)
+    break;
+}
+
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-006.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-006.js
new file mode 100644 (file)
index 0000000..58845ac
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+var sum = 0;
+for (var i = 1; i <= 10; i++)
+{
+  for (var j = 1; j <= 5; j++)
+  {
+    sum += i * j;
+  }
+}
+
+assert(sum === 825);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-007.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-007.js
new file mode 100644 (file)
index 0000000..5204fd6
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var sum = 0;
+for (var i = 1, j = 1, k = 1; i + j + k <= 100; i++, j += 2, k += 3)
+{
+  sum += i + j + k;
+}
+
+assert(sum == 867);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-008.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-008.js
new file mode 100644 (file)
index 0000000..d703d18
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var sum = 1;
+
+for (var i = 0; i < 10; i++, sum *= i)
+  ;
+
+assert(sum === 3628800);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-009.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-009.js
new file mode 100644 (file)
index 0000000..a542373
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var init;
+
+for (init = (129 - 8) / 11; init != 11; )
+{
+  init = 33;
+}
+
+assert(init == 11);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-010.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-010.js
new file mode 100644 (file)
index 0000000..36df6a7
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+for
+        (
+                var i = 0
+                ;
+                i < 10
+                ;
+                i++
+                )
+{
+  i++;
+}
+
+assert(i == 10);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-011.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.03/12.06.03-011.js
new file mode 100644 (file)
index 0000000..5153085
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var i;
+
+function test()
+{
+  for (i = 0; i < 10; i++)
+  {
+    if (i === 4)
+      return 1;
+  }
+
+  return 0;
+}
+
+var r = test();
+
+assert(r === 1 && i === 4);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-001.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-001.js
new file mode 100644 (file)
index 0000000..9a6f30a
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var o = {a: 1, b: 2, c: 3};
+
+for (var p in o)
+{
+  o[p] += 4;
+}
+
+assert(o.a === 5 && o.b === 6 && o.c === 7);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-002.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-002.js
new file mode 100644 (file)
index 0000000..287393f
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var a = new Array(1, 2, 3, 4, 5, 6, 7);
+a.eight = 8;
+
+var p;
+for (p in a)
+{
+  a[p] += 1;
+}
+
+assert(a[0] === 2 && a[1] === 3 && a[2] === 4 && a[3] === 5 &&
+        a[4] === 6 && a[5] === 7 && a[6] === 8 && a['eight'] === 9);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-003.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-003.js
new file mode 100644 (file)
index 0000000..b3bf951
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = null;
+
+for (var p in a)
+{
+  assert(false);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-004.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-004.js
new file mode 100644 (file)
index 0000000..4926c10
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a;
+
+for (var p in a)
+{
+  assert(false);
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-005.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-005.js
new file mode 100644 (file)
index 0000000..cbe64f8
--- /dev/null
@@ -0,0 +1,31 @@
+// 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.
+
+
+var b = {basep: "base"};
+
+function dConstr()
+{
+  this.derivedp = "derived";
+}
+dConstr.prototype = b;
+
+var d = new dConstr();
+
+for (var p in d)
+{
+  d[p] += "A";
+}
+
+assert(d.basep === "baseA" && d.derivedp === "derivedA");
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-006.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-006.js
new file mode 100644 (file)
index 0000000..8446cf7
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var o = {a: 1, b: 2, c: 3};
+
+for
+        (
+                var
+                p in o
+                )
+{
+  o[p] += 4;
+}
+
+assert(o.a === 5 && o.b === 6 && o.c === 7);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-007.js b/deps/jerry/tests/jerry-test-suite/12/12.06/12.06.04/12.06.04-007.js
new file mode 100644 (file)
index 0000000..d74d3ec
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+var o = {a: 1, b: 2, c: 3, d: 4, e: 5};
+
+function test()
+{
+  for (var p in o)
+  {
+    if (p === 'c')
+      return 1;
+
+    o[p] += 4;
+  }
+  return 0;
+}
+
+var r = test();
+
+assert(((o.a === 5 && o.b === 6 && o.c === 3) ||
+        (o.c === 3 && o.d === 8 && o.e === 9)) && r === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-001.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-001.js
new file mode 100644 (file)
index 0000000..e751c3e
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var sum = 0;
+for (var i = 0; i < 10; i++)
+{
+  if (i === 5)
+  {
+    continue;
+  }
+
+  sum += i;
+}
+
+assert(sum === 40);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-002.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-002.js
new file mode 100644 (file)
index 0000000..b4942fe
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var sum = 0;
+for (var i = 0; i < 10; i++)
+  for (var j = 0; j < 20; j++)
+  {
+    if (j > 9)
+      continue;
+
+    sum += 1;
+  }
+
+assert(sum === 100);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-003.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-003.js
new file mode 100644 (file)
index 0000000..693c871
--- /dev/null
@@ -0,0 +1,38 @@
+// 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.
+
+var o = {p1: 1, p2: 2, p3: {p1: 100, p2: 200, p3: 100}, p4: 4, p5: 5}, sum = 0;
+
+top:
+        for (var p in o)
+{
+  if (p === "p2")
+    continue;
+
+  if (typeof (o[p]) === "object")
+  {
+    for (var pp in o[p])
+    {
+      if (pp === "p2")
+        continue top;
+
+      sum += o[p][pp];
+    }
+  }
+
+  sum += 20;
+
+}
+
+assert(sum === 160);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-004.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-004.js
new file mode 100644 (file)
index 0000000..1dbbb45
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var o = {a: 1, b: 2, c: 3};
+
+ForLabel:
+        for (var p in o)
+{
+  if (p === "b")
+    continue ForLabel;
+  o[p] += 4;
+}
+
+assert(o.a === 5 && o.b === 2 && o.c === 7);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-005.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-005.js
new file mode 100644 (file)
index 0000000..94865aa
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var sum = 0;
+
+ForLabel:
+        for (var i = 0; i < 10; i++)
+{
+  if (i === 5)
+  {
+    continue ForLabel;
+  }
+
+  sum += i;
+}
+
+assert(sum === 40);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-006.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-006.js
new file mode 100644 (file)
index 0000000..b14f7d6
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var sum = 0;
+top:
+        for (var i = 0; i < 10; i++)
+{
+  for (var j = 0; j < 20; j++)
+  {
+    if (j > 9 && i % 2)
+      continue top;
+
+    sum += 1;
+  }
+
+  sum += 1;
+}
+
+assert(sum === 155);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-007.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-007.js
new file mode 100644 (file)
index 0000000..b964304
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var mask = 0xff0f;
+var numZeroes = 0;
+
+while (mask)
+{
+  mask >>= 1;
+
+  if (mask & 1)
+    continue;
+
+  numZeroes++;
+}
+
+assert(numZeroes === 5);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-008.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-008.js
new file mode 100644 (file)
index 0000000..d073e86
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+
+var i = 10;
+var cnt = 0;
+
+while (i-- > 0)
+{
+  if (i % 2)
+    continue;
+
+  var j = 0;
+  while (j++ < 20)
+  {
+    if (j % 2 === 0)
+      continue;
+    cnt++;
+  }
+
+}
+
+assert(cnt === 50);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-009.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-009.js
new file mode 100644 (file)
index 0000000..2e99823
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var sum = 0, i = 0;
+
+WhileLabel:
+        while (++i < 10)
+{
+  if (i === 5)
+  {
+    continue WhileLabel;
+  }
+
+  sum += i;
+}
+
+assert(sum === 40);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-010.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-010.js
new file mode 100644 (file)
index 0000000..fb02b1f
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+var sum = 0;
+var i = 0, j = 0;
+top:
+        while (i++ < 10)
+{
+  j = 0;
+  while (j++ < 20)
+  {
+    if (j > 9 && i % 2)
+      continue top;
+
+    sum += 1;
+  }
+
+  sum += 1;
+}
+
+assert(sum === 150);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-011.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-011.js
new file mode 100644 (file)
index 0000000..c146b8e
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var mask = 0xff0f;
+var numZeroes = 0;
+
+do
+{
+  mask >>= 1;
+
+  if (mask & 1)
+    continue;
+
+  numZeroes++;
+} while (mask);
+
+assert(numZeroes === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-012.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-012.js
new file mode 100644 (file)
index 0000000..15d054c
--- /dev/null
@@ -0,0 +1,34 @@
+// 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.
+
+var i = 10;
+var cnt = 0;
+
+do
+{
+  if (i % 2)
+    continue;
+
+  var j = 0;
+  do
+  {
+    if (j % 2 === 0)
+      continue;
+    cnt++;
+  }
+  while (j++ < 20)
+}
+while (i-- > 0);
+
+assert(cnt === 60);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-013.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-013.js
new file mode 100644 (file)
index 0000000..58b1f10
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+var sum = 0, i = 0;
+
+DoWhileLabel:
+        do
+{
+  if (i === 5)
+  {
+    continue DoWhileLabel;
+  }
+
+  sum += i;
+}
+while (++i < 10);
+
+assert(sum === 40);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-014.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-014.js
new file mode 100644 (file)
index 0000000..76ac5b7
--- /dev/null
@@ -0,0 +1,35 @@
+// 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.
+
+var sum = 0;
+var i = 0, j = 0;
+top:
+        do
+{
+  j = 0;
+
+  do
+  {
+    if (j > 9 && i % 2)
+      continue top;
+
+    sum += 1;
+  }
+  while (j++ < 20);
+
+  sum += 1;
+}
+while (i++ < 10);
+
+assert(sum === 182);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-015.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-015.js
new file mode 100644 (file)
index 0000000..ba93a22
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var o = {p1: 1, p2: 2, p3: 3, p4: 4, p5: 5}, sum = 0;
+for (var p in o)
+{
+  if (p == "p3")
+  {
+    continue;
+  }
+
+  sum += o[p];
+}
+
+assert(sum == 12)
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-016.js b/deps/jerry/tests/jerry-test-suite/12/12.07/12.07-016.js
new file mode 100644 (file)
index 0000000..97fffe6
--- /dev/null
@@ -0,0 +1,36 @@
+// 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.
+
+var o = {p1: 1, p2: 2, p3: {p1: 100, p2: 200}, p4: 4, p5: 5}, sum = 0;
+for (var p in o)
+{
+  if (p === "p2")
+    continue;
+
+  if (typeof (o[p]) === "object")
+  {
+    for (var pp in o[p])
+    {
+      if (pp === "p2")
+        continue;
+
+      sum += o[p][pp];
+    }
+  }
+  else {
+    sum += o[p];
+  }
+}
+
+assert(sum === 110);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-001.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-001.js
new file mode 100644 (file)
index 0000000..82aae71
--- /dev/null
@@ -0,0 +1,47 @@
+// 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.
+
+var o = {p1: 1,
+  p2: {p1: 100, p2: 200, p3: 100},
+  p3: 4,
+  p4: 7,
+  p5: 124686,
+  p6: {p1: 100, p2: 200, p3: 100},
+  p7: 1},
+sum = 0;
+
+
+for (var p in o)
+{
+  if (p === "p4")
+    break;
+
+  if (typeof (o[p]) === "object")
+  {
+    top:
+            for (var pp in o[p])
+    {
+      if (pp === "p2")
+        break top;
+
+      sum += o[p][pp];
+    }
+  }
+
+  sum += 20;
+
+}
+
+assert(sum === 160);
+
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-002.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-002.js
new file mode 100644 (file)
index 0000000..de91aa0
--- /dev/null
@@ -0,0 +1,45 @@
+// 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.
+
+var o = {p1: 1,
+  p2: {p1: 100, p2: 200, p3: 100},
+  p3: 4,
+  p4: 7,
+  p5: 124686,
+  p6: {p1: 100, p2: 200, p3: 100},
+  p7: 1},
+sum = 0;
+
+for (var p in o)
+{
+  if (p === "p4")
+    break;
+
+  if (typeof (o[p]) === "object")
+  {
+    for (var pp in o[p])
+    {
+      if (pp === "p2")
+        break;
+
+      sum += o[p][pp];
+    }
+  }
+  else
+  {
+    sum += 20;
+  }
+}
+
+assert(sum === 140);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-003.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-003.js
new file mode 100644 (file)
index 0000000..4fedb84
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var sum = 0;
+for (var i = 0; i < 10; i++)
+{
+  if (i === 5)
+  {
+    break;
+  }
+
+  sum += i;
+}
+
+assert(sum === 10);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-004.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-004.js
new file mode 100644 (file)
index 0000000..18610b5
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+function main()
+{
+  var sum = 0;
+  for (var i = 0; i < 10; i++)
+    for (var j = 0; j < 20; j++)
+    {
+      if (j === 10)
+        break;
+
+      sum += 1;
+    }
+
+  assert(sum === 100);
+}
+
+main ();
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-005.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-005.js
new file mode 100644 (file)
index 0000000..b45eac2
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var sum = 0;
+
+ForLabel:
+        for (var i = 0; i < 10; i++)
+{
+  if (i === 5)
+  {
+    break ForLabel;
+  }
+
+  sum += i;
+}
+
+assert(sum === 10);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-006.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-006.js
new file mode 100644 (file)
index 0000000..46058e9
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var sum = 0;
+top:
+        for (var i = 0; i < 10; i++)
+{
+  for (var j = 0; j < 20; j++)
+  {
+    if (j > 9 && i % 2)
+      break top;
+
+    sum += 1;
+  }
+
+  sum += 1;
+}
+
+assert(sum === 31);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-007.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-007.js
new file mode 100644 (file)
index 0000000..0f4d991
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+var mask = 0xff0f;
+var numOnes = 0;
+
+while (mask)
+{
+  if (!(mask & 1))
+    break;
+
+  mask >>= 1;
+  numOnes++;
+}
+
+assert(numOnes === 4);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-008.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-008.js
new file mode 100644 (file)
index 0000000..f168c43
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+
+var i = 9;
+var cnt = 0;
+
+while (i-- > 0)
+{
+  if (i % 2)
+    break;
+
+  var j = 0;
+  while (j++ < 20)
+  {
+    if (j % 2 === 0)
+      break;
+    cnt++;
+  }
+
+}
+
+assert(cnt === 1);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-009.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-009.js
new file mode 100644 (file)
index 0000000..af46bd9
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+
+var sum = 0, i = 0;
+
+WhileLabel:
+        while (++i < 10)
+{
+  if (i === 5)
+  {
+    break WhileLabel;
+  }
+
+  sum += i;
+}
+
+assert(sum === 10);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-010.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-010.js
new file mode 100644 (file)
index 0000000..a263e4b
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+var sum = 0;
+var i = 0, j = 0;
+top:
+        while (i++ < 10)
+{
+  j = 0;
+  while (j++ < 20)
+  {
+    if (j > 9 && i % 2)
+      break top;
+
+    sum += 1;
+  }
+
+  sum += 1;
+}
+
+assert(sum === 9);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-011.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-011.js
new file mode 100644 (file)
index 0000000..1bd8836
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+var mask = 0xff0f;
+var numOnes = 0;
+
+do
+{
+  if (!(mask & 1))
+    break;
+
+  mask >>= 1;
+  numOnes++;
+} while (mask);
+
+assert(numOnes === 4);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-012.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-012.js
new file mode 100644 (file)
index 0000000..a90c11a
--- /dev/null
@@ -0,0 +1,34 @@
+// 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.
+
+var i = 10;
+var cnt = 0;
+
+do
+{
+  var j = 0;
+  do
+  {
+    if (j % 2 === 0)
+      break;
+    cnt++;
+  }
+  while (j++ < 20)
+
+  if (i % 2)
+    break;
+}
+while (i-- > 0);
+
+assert(cnt === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-013.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-013.js
new file mode 100644 (file)
index 0000000..930dc64
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+var sum = 0, i = 0;
+
+DoWhileLabel:
+        do
+{
+  if (i === 5)
+  {
+    break DoWhileLabel;
+  }
+
+  sum += i;
+}
+while (++i < 10);
+
+assert(sum === 10);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-014.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-014.js
new file mode 100644 (file)
index 0000000..bf8c9a1
--- /dev/null
@@ -0,0 +1,35 @@
+// 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.
+
+var sum = 0;
+var i = 0, j = 0;
+top:
+        do
+{
+  j = 0;
+
+  do
+  {
+    if (j > 9 && i % 2)
+      break top;
+
+    sum += 1;
+  }
+  while (j++ < 20);
+
+  sum += 1;
+}
+while (i++ < 10);
+
+assert(sum === 32);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-015.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-015.js
new file mode 100644 (file)
index 0000000..f46ee64
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var o = {p1: 1, p2: 2, p3: 3, p4: 1, p5: 2}, sum = 0;
+for (var p in o)
+{
+  if (p === "p3")
+  {
+    break;
+  }
+
+  sum += o[p];
+}
+
+assert(sum === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-016.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-016.js
new file mode 100644 (file)
index 0000000..46fa199
--- /dev/null
@@ -0,0 +1,36 @@
+// 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.
+
+var o = {p1: 1, p2: 2, p3: {p1: 150, p2: 200, p3: 130, p4: 20}, p4: 4, p5: 46}, sum = 0;
+for (var p in o)
+{
+  if (p === "p4")
+    continue;
+
+  if (typeof (o[p]) === "object")
+  {
+    for (var pp in o[p])
+    {
+      if (pp === "p2")
+        break;
+
+      sum += o[p][pp];
+    }
+  }
+  else {
+    sum += o[p];
+  }
+}
+
+assert(sum === 199);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-017.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-017.js
new file mode 100644 (file)
index 0000000..a10d19f
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var o = {a: 1, b: 2, c: 3};
+
+ForLabel:
+        for (var p in o)
+{
+  if (p === "b")
+    break ForLabel;
+  o[p] += 4;
+}
+
+assert(o.a + o.b + o.c === 10);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-018.js b/deps/jerry/tests/jerry-test-suite/12/12.08/12.08-018.js
new file mode 100644 (file)
index 0000000..929430c
--- /dev/null
@@ -0,0 +1,45 @@
+// 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.
+
+var o = {p1: 1,
+  p2: {p1: 100, p2: 200, p3: 100},
+  p3: 4,
+  p4: 7,
+  p5: 124686,
+  p6: {p1: 100, p2: 200, p3: 100},
+  p7: 1},
+sum = 0;
+
+top:
+        for (var p in o)
+{
+  if (p === "p4")
+    break;
+
+  if (typeof (o[p]) === "object")
+  {
+    for (var pp in o[p])
+    {
+      if (pp === "p2")
+        break top;
+
+      sum += o[p][pp];
+    }
+  }
+
+  sum += 20;
+
+}
+
+assert(sum === 120)
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-001.js b/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-001.js
new file mode 100644 (file)
index 0000000..f81475b
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var r = test()
+
+assert(typeof r == 'object' && r.prop1 === "property1" && r.prop2 === 2 && r.prop3 === false);
+
+function test()
+{
+  var o = {
+    prop1: "property1",
+    prop2: 2,
+    prop3: false
+  };
+
+  return o;
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-002.js b/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-002.js
new file mode 100644 (file)
index 0000000..d8b05eb
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var r = test()
+
+assert(r === 1);
+
+function test()
+{
+  return ((23 << 2) + 8) / 100;
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-003.js b/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-003.js
new file mode 100644 (file)
index 0000000..91dc75e
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var r = test()
+
+assert(r === 33);
+
+function test()
+{
+  return 33;
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-004.js b/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-004.js
new file mode 100644 (file)
index 0000000..79f5dc1
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+var r = test()
+
+assert(r == undefined);
+
+function test()
+{
+  var r = 1;
+  return
+  r;
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-005.js b/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-005.js
new file mode 100644 (file)
index 0000000..b0e3121
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+var r = test()
+
+assert(r === 100);
+
+function test()
+{
+  function internal()
+  {
+    return 100;
+  }
+
+  return internal();
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-006.js b/deps/jerry/tests/jerry-test-suite/12/12.09/12.09-006.js
new file mode 100644 (file)
index 0000000..b4a014f
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+var r = test()
+
+assert(typeof r == 'function');
+
+function test()
+{
+  function internal()
+  {
+    return 100;
+  }
+
+  return internal;
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-001.js b/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-001.js
new file mode 100644 (file)
index 0000000..96cb1f8
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var x, y;
+
+with (Math) {
+  x = cos(PI);
+}
+
+assert(x == -1);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-002.js b/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-002.js
new file mode 100644 (file)
index 0000000..02413cb
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var o = {prop: "property"};
+
+with (o) {
+  assert(prop == "property");
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-003.js b/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-003.js
new file mode 100644 (file)
index 0000000..02413cb
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var o = {prop: "property"};
+
+with (o) {
+  assert(prop == "property");
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-004.js b/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-004.js
new file mode 100644 (file)
index 0000000..027a969
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var x;
+
+function test()
+{
+  with (Math)
+  {
+    x = abs(-396);
+    return 1;
+  }
+
+  return 0;
+}
+
+var r = test();
+
+assert(r === 1 && x === 396);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-005.js b/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-005.js
new file mode 100644 (file)
index 0000000..01357ff
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+with ({})
+{
+  var x = "abc";
+}
+
+assert(x === "abc");
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-006.js b/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-006.js
new file mode 100644 (file)
index 0000000..ca3ab5c
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+assert(test("hello") == "hello" && typeof test({}) == "object" && test({arg: "hello"}) == "hello")
+
+function test(arg) {
+  with (arg) {
+    return arg;
+  }
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-007.js b/deps/jerry/tests/jerry-test-suite/12/12.10/12.10-007.js
new file mode 100644 (file)
index 0000000..dfd0b29
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+var x, y;
+
+with
+        (
+                Math)
+{
+  x = cos(PI);
+}
+
+assert(x == -1);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-001.js b/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-001.js
new file mode 100644 (file)
index 0000000..bed977d
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+switch (1) {
+  case 0:
+    assert(false);
+  case 1:
+    break;
+  default:
+    assert(false);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-002.js b/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-002.js
new file mode 100644 (file)
index 0000000..8eb5c57
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+var matchesCount = 0;
+
+switch ("key") {
+  case "key":
+    ++matchesCount;
+    break;
+  case "key":
+    ++matchesCount;
+    break;
+  case "another key":
+    ++matchesCount;
+    break;
+  default:
+    ++matchesCount;
+    break;
+}
+
+assert (matchesCount === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-003.js b/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-003.js
new file mode 100644 (file)
index 0000000..ea9360b
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+switch (1) {
+  case true:
+    assert(false);
+  case false:
+    assert(false);
+  default:
+    assert(true);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-004.js b/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-004.js
new file mode 100644 (file)
index 0000000..37cb0a8
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var counter = 0;
+
+switch ("key") {
+  case "key":
+    ++counter;
+  case "another key":
+    ++counter;
+  case "another key2":
+    ++counter;
+  default:
+    ++counter;
+}
+
+assert (counter == 4);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-005.js b/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-005.js
new file mode 100644 (file)
index 0000000..4a47b3b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+switch (1) {
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-006.js b/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-006.js
new file mode 100644 (file)
index 0000000..af00f26
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+function fact(n)
+{
+  return n < 2 ? 1 : n * fact(n - 1);
+}
+
+switch (fact(5)) {
+  case 5 * fact(4):
+    break;
+  default:
+    assert(false);
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-007.js b/deps/jerry/tests/jerry-test-suite/12/12.11/12.11-007.js
new file mode 100644 (file)
index 0000000..2b40bc7
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+switch ("key") {
+  case "another key":
+    assert(false);
+  default:
+    break;
+  case "another key2":
+    assert(false);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-001.js b/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-001.js
new file mode 100644 (file)
index 0000000..37ff5c7
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+loop:
+        while (true) {
+  break loop;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-002.js b/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-002.js
new file mode 100644 (file)
index 0000000..011d9ec
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+loop:
+        while (true) {
+  do {
+    for (; true; ) {
+      break loop;
+    }
+  } while (true);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-003.js b/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-003.js
new file mode 100644 (file)
index 0000000..7e6c4c5
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+switchMark:
+        switch (1) {
+  case 0:
+    break;
+  case 1:
+    break switchMark;
+  case 2:
+    assert(false);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-004.js b/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-004.js
new file mode 100644 (file)
index 0000000..2973b68
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var i = 0;
+
+whileMark:
+        while (i < 10) {
+  ++i;
+  continue whileMark;
+  assert(false);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-005.js b/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-005.js
new file mode 100644 (file)
index 0000000..4e3466a
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+whileMark:
+        for (i = 0; i < 10; ++i) {
+  continue whileMark;
+  assert(false);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-006.js b/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-006.js
new file mode 100644 (file)
index 0000000..4c7e80a
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var x = 0;
+lablemark:
+        if (x < 6) {
+  ++x;
+  break lablemark;
+}
+
+assert(x !== 6);
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-007.js b/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-007.js
new file mode 100644 (file)
index 0000000..4b27250
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var x = 0;
+for (i = 0; i < 10; ++i) {
+  for (j = 0; j < 10; ++j) {
+    lablemark:
+            for (k = 0; k < 10; ++k) {
+      ++x;
+      break lablemark;
+    }
+  }
+}
+
+assert(x == 100)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-008.js b/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-008.js
new file mode 100644 (file)
index 0000000..e9cade6
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var x = 0;
+for (i = 0; i < 10; ++i) {
+  lablemark:
+          for (j = 0; j < 10; ++j) {
+    for (k = 0; k < 10; ++k) {
+      ++x;
+      break lablemark;
+    }
+  }
+}
+
+assert(x == 10)
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-009.js b/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-009.js
new file mode 100644 (file)
index 0000000..ed71f4a
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var x = 0;
+lablemark:
+        for (i = 0; i < 10; ++i) {
+  for (j = 0; j < 10; ++j) {
+    for (k = 0; k < 10; ++k) {
+      ++x;
+      break lablemark;
+    }
+  }
+}
+
+assert(x == 1)
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-010.js b/deps/jerry/tests/jerry-test-suite/12/12.12/12.12-010.js
new file mode 100644 (file)
index 0000000..e9e32f3
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var x = 0;
+for (i = 0; i < 10; ++i) {
+  lablemark:
+          for (j = 0; j < 10; ++j) {
+    for (k = 0; k < 10; ++k) {
+      ++x;
+      continue lablemark;
+    }
+  }
+}
+
+assert(x == 100)
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.13/12.13-001.js b/deps/jerry/tests/jerry-test-suite/12/12.13/12.13-001.js
new file mode 100644 (file)
index 0000000..8529388
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+function test ()
+{
+  try {
+    if (true) {
+      throw "error";
+    }
+  } catch (e) {
+    return true;
+  }
+  return false;
+}
+
+assert (test ());
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.13/12.13-002.js b/deps/jerry/tests/jerry-test-suite/12/12.13/12.13-002.js
new file mode 100644 (file)
index 0000000..ccf08d2
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+function test ()
+{
+  try {
+    while (true) {
+      throw "error";
+    }
+  } catch (e) {
+    return true;
+  }
+  return false;
+}
+
+assert (test ());
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.13/12.13-003.js b/deps/jerry/tests/jerry-test-suite/12/12.13/12.13-003.js
new file mode 100644 (file)
index 0000000..fd5f031
--- /dev/null
@@ -0,0 +1,38 @@
+// 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.
+
+function d () {
+  throw "exception";
+}
+function c () {
+  d ();
+}
+function b () {
+  c ();
+}
+function a () {
+  b ();
+}
+
+function test ()
+{
+  try {
+    a ();
+  } catch (e) {
+    return true;
+  }
+  return false;
+}
+
+assert (test ());
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-001.js b/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-001.js
new file mode 100644 (file)
index 0000000..b649057
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+try {
+  try {
+    throw "error";
+  } catch (e) {
+    throw e;
+  }
+  assert(false);
+} catch (e) {
+}
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-002.js b/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-002.js
new file mode 100644 (file)
index 0000000..9ca88eb
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+function test ()
+{
+  try {
+    var x = 1;
+  } catch (e) {
+    return false;
+  }
+
+  return true;
+}
+
+assert (test ());
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-003.js b/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-003.js
new file mode 100644 (file)
index 0000000..0fbc200
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+function test ()
+{
+    try {
+        throw 1;
+    } catch (e) {
+        return (e === 1);
+    }
+
+    return false;
+}
+
+assert (test ());
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-004.js b/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-004.js
new file mode 100644 (file)
index 0000000..bea9130
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+function test ()
+{
+  try {
+    throw "error";
+  } catch (e) {
+    return false;
+  } finally {
+    return true;
+  }
+
+  return false;
+}
+
+assert (test ());
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-005.js b/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-005.js
new file mode 100644 (file)
index 0000000..aee45da
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+function test ()
+{
+    try {
+        throw "error";
+    } catch (e) {
+        return true;
+    } finally {
+    }
+
+    return false;
+}
+
+assert (test ());
diff --git a/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-006.js b/deps/jerry/tests/jerry-test-suite/12/12.14/12.14-006.js
new file mode 100644 (file)
index 0000000..56ef3cb
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+function test ()
+{
+  try {
+    var x = 1;
+  } finally {
+    return true;
+  }
+
+  return false;
+}
+
+assert (test ());
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-001.js b/deps/jerry/tests/jerry-test-suite/13/13-001.js
new file mode 100644 (file)
index 0000000..ffb1a29
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var b = 1;
+for (var i = 1; i < 10; ++i)
+{
+  b *= i;
+}
+var c = b;
+
+assert(c == 362880);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-002.js b/deps/jerry/tests/jerry-test-suite/13/13-002.js
new file mode 100644 (file)
index 0000000..4776a48
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+function foo() {
+  return 1;
+}
+
+assert(foo() === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-003.js b/deps/jerry/tests/jerry-test-suite/13/13-003.js
new file mode 100644 (file)
index 0000000..6a0b9b1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+assert(function (param1, param2) {
+  return 1;
+}(true, "blah") === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-004.js b/deps/jerry/tests/jerry-test-suite/13/13-004.js
new file mode 100644 (file)
index 0000000..7ceda99
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+function foo() {
+}
+
+assert(typeof foo === "function");
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-005.js b/deps/jerry/tests/jerry-test-suite/13/13-005.js
new file mode 100644 (file)
index 0000000..049fdbc
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var foo = 1; //override
+
+assert (foo === 1);
+
+function foo()
+{
+    return 1;
+}
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-006.js b/deps/jerry/tests/jerry-test-suite/13/13-006.js
new file mode 100644 (file)
index 0000000..0a8ee13
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+function foo() {
+}
+
+assert(foo() === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-007.js b/deps/jerry/tests/jerry-test-suite/13/13-007.js
new file mode 100644 (file)
index 0000000..f56351b
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+function foo(arg) {
+  return ++arg;
+}
+
+assert(foo(1) === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-008.js b/deps/jerry/tests/jerry-test-suite/13/13-008.js
new file mode 100644 (file)
index 0000000..8ce5be8
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+function foo(params) {
+  return arguments.length;
+}
+
+assert(foo(1, 'e', true, 5) === 4);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-009.js b/deps/jerry/tests/jerry-test-suite/13/13-009.js
new file mode 100644 (file)
index 0000000..1aa39c9
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var check = typeof (foo) === "function";
+
+var foo = 1;
+
+check = check && (foo === 1);
+
+function foo() {
+  return 1;
+}
+
+assert(check);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-010.js b/deps/jerry/tests/jerry-test-suite/13/13-010.js
new file mode 100644 (file)
index 0000000..860845a
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+function foo() {
+  return 1;
+}
+var object = new Object;
+object.fun = foo;
+
+assert(object.fun() === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-011.js b/deps/jerry/tests/jerry-test-suite/13/13-011.js
new file mode 100644 (file)
index 0000000..6e3b153
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+function foo(param1) {
+  return delete arguments; //arguments is non-configurable
+}
+
+assert(!foo("param"));
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-012.js b/deps/jerry/tests/jerry-test-suite/13/13-012.js
new file mode 100644 (file)
index 0000000..4254797
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+function foo(a, b, c, d) {
+  var deleted = true;
+  for (i = 0; i < arguments.length; i++)
+  {
+    delete arguments[i];
+    deleted = deleted && (typeof (arguments[i]) === "undefined");
+  }
+  return deleted;
+}
+
+assert(foo("A", "F", 1, true) === true);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13-013.js b/deps/jerry/tests/jerry-test-suite/13/13-013.js
new file mode 100644 (file)
index 0000000..cd5975a
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+function foo(arguments) {
+  return arguments;
+}
+
+assert(foo(1) === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13.01/13.01-001.js b/deps/jerry/tests/jerry-test-suite/13/13.01/13.01-001.js
new file mode 100644 (file)
index 0000000..61ee575
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+function arguments (param) {
+  return true;
+}
+assert (arguments ());
diff --git a/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-001.js b/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-001.js
new file mode 100644 (file)
index 0000000..9062d9c
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var foo = function () {
+  this.caller = 123;
+};
+var f = new foo();
+assert(f.caller === 123);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-002.js b/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-002.js
new file mode 100644 (file)
index 0000000..9603dba
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+var foo = function (c, y) {
+};
+var check = foo.hasOwnProperty("length") && foo.length === 2;
+
+foo.length = 12;
+if (foo.length === 12)
+  check = false;
+
+for (p in foo)
+{
+  if (p === "length")
+    check = false;
+}
+delete foo.length;
+if (!foo.hasOwnProperty("length"))
+  check = false;
+
+assert(check === true);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-003.js b/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-003.js
new file mode 100644 (file)
index 0000000..9005b10
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+function foo(arg) {
+  arg.prop = 3;
+}
+var obj = new Object();
+foo(obj);
+
+assert(obj.prop === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-004.js b/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-004.js
new file mode 100644 (file)
index 0000000..a0c80cb
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+function foo(arg) {
+  arg += 3;
+}
+
+var num = 1;
+foo(num);  // by value
+
+assert(num === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-005.js b/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-005.js
new file mode 100644 (file)
index 0000000..c1248f7
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+function foo() {
+  return null;
+}
+
+assert(foo() === null);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-006.js b/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-006.js
new file mode 100644 (file)
index 0000000..8fba8ef
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+function foo() {
+  return;
+}
+
+assert(foo() === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-007.js b/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-007.js
new file mode 100644 (file)
index 0000000..0f9d768
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var obj = new function foo()
+{
+  this.prop = 1;
+};
+
+assert(obj.prop === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-008.js b/deps/jerry/tests/jerry-test-suite/13/13.02/13.02-008.js
new file mode 100644 (file)
index 0000000..51ab836
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+function func() {
+}
+
+assert(Function.prototype.isPrototypeOf(func));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-001.js
new file mode 100644 (file)
index 0000000..40c9da1
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a;
+a = Object();
+
+assert(typeof a === 'object');
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-002.js
new file mode 100644 (file)
index 0000000..8824cc2
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a;
+a = Object(null);
+
+assert(typeof a === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-003.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-003.js
new file mode 100644 (file)
index 0000000..c4fd241
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a;
+a = Object(undefined);
+
+assert(typeof a === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-004.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-004.js
new file mode 100644 (file)
index 0000000..465197a
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 1;
+assert(typeof Object(a) === 'object');
+
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-005.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-005.js
new file mode 100644 (file)
index 0000000..422431f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+
+assert(typeof Object(a) === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-006.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-006.js
new file mode 100644 (file)
index 0000000..a90daee
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = false;
+assert(typeof Object(a) === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-007.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-007.js
new file mode 100644 (file)
index 0000000..3cdc7a7
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "some string";
+
+assert(typeof Object(a) === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-008.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-008.js
new file mode 100644 (file)
index 0000000..366b8ab
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "some string";
+assert(typeof Object(a) === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-009.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-009.js
new file mode 100644 (file)
index 0000000..e6d8ffb
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number(123.5);
+assert (typeof Object(a) === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-010.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.01/15.02.01-010.js
new file mode 100644 (file)
index 0000000..067f5c3
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new String("nice string");
+assert(typeof Object(a) === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-001.js
new file mode 100644 (file)
index 0000000..1c56272
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new Object();
+
+assert(typeof a === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-002.js
new file mode 100644 (file)
index 0000000..87d9c2b
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = new Object();
+var b = new Object();
+
+assert(a !== b);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-003.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-003.js
new file mode 100644 (file)
index 0000000..5f1dfda
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new Object();
+var b = new Object(a);
+assert(a === b);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-004.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-004.js
new file mode 100644 (file)
index 0000000..ed67997
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var a = {
+  field1: Number,
+  field2: String,
+  foo: function () {
+    return 0;
+  }
+}
+var b = new Object(a);
+assert(a === b);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-005.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-005.js
new file mode 100644 (file)
index 0000000..594e38f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = "foobar";
+var b = new Object(a);
+assert(typeof b === "object" && b == a && b !== a);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-006.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-006.js
new file mode 100644 (file)
index 0000000..26ddcd4
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 5.5;
+var b = new Object(a);
+assert(typeof b === "object" && b == a && b !== a);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-007.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-007.js
new file mode 100644 (file)
index 0000000..26f2eda
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = true;
+var b = new Object(a);
+assert(typeof b === "object" && b == a && b !== a);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-008.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-008.js
new file mode 100644 (file)
index 0000000..3e374d7
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = new Object();
+assert(typeof a === 'object' &&
+        typeof (Object.getPrototypeOf(a)) === "object" &&
+        Object.isExtensible(a));
+       
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-009.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-009.js
new file mode 100644 (file)
index 0000000..9b43a07
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = new Object(null);
+assert(typeof a === 'object' &&
+        typeof (Object.getPrototypeOf(a)) === "object" &&
+        Object.isExtensible(a));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-010.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.02/15.02.02-010.js
new file mode 100644 (file)
index 0000000..7bf6a25
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = new Object(undefined);
+assert(typeof a === 'object' &&
+        typeof (Object.getPrototypeOf(a)) === "object" &&
+        Object.isExtensible(a));
+       
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-001.js
new file mode 100644 (file)
index 0000000..1f38e57
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(typeof Object.getPrototypeOf(Object) == "function" &&
+        Object.length == 1);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-002.js
new file mode 100644 (file)
index 0000000..7cef6e9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof Object.prototype == "object");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-003.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-003.js
new file mode 100644 (file)
index 0000000..b8e9d43
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+
+
+writable = false;
+enumerable = false;
+configurable = false;
+
+Object.prototype = "qwerty";
+if (Object.prototype === "qwerty")
+  writable = true;
+
+for (prop in Object)
+{
+  if (Object[prop] == "qwerty")
+    enumerable = true;
+}
+
+if (delete Object.prototype)
+  configurable = true;
+
+assert(!writable && !enumerable && !configurable);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-004.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-004.js
new file mode 100644 (file)
index 0000000..60ebb5e
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var object = {
+  prop1: Number,
+  prop2: String,
+  prop3: true,
+  prop4: 0
+}
+
+var keys = Object.keys(object);
+
+assert(keys[0] == "prop1" &&
+        keys[1] == "prop2" &&
+        keys[2] == "prop3" &&
+        keys[3] == "prop4");
+       
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-005.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-005.js
new file mode 100644 (file)
index 0000000..e687f70
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = {
+  field: Number
+}
+
+assert(Object.getPrototypeOf(a) == Object.getPrototypeOf(Object()));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-006.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-006.js
new file mode 100644 (file)
index 0000000..7fc1832
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+var object1 = {
+  field1: 5,
+  field2: "qwe",
+  field3: true
+}
+
+var object2 = {
+  field1: 5,
+  field2: "qwe",
+  field3: true
+}
+
+Object.freeze(object1);
+
+assert(!Object.isExtensible(object1) && Object.isExtensible(object2));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-007.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-007.js
new file mode 100644 (file)
index 0000000..6f98667
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var a = {
+  foo: function () {
+    return 1
+  }
+}
+desc = Object.getOwnPropertyDescriptor(a, "foo");
+
+assert(desc instanceof Object);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-008.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-008.js
new file mode 100644 (file)
index 0000000..788ba4b
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+var object1 = {
+  field1: 5,
+  field2: "qwe",
+  field3: true
+}
+
+var object2 = {
+  field1: 5,
+  field2: "qwe",
+  field3: true
+}
+
+Object.freeze(object1);
+
+assert(Object.isFrozen(object1) && !Object.isFrozen(object2));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-009.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-009.js
new file mode 100644 (file)
index 0000000..171d200
--- /dev/null
@@ -0,0 +1,31 @@
+// 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.
+
+var a = {
+  prop1: Number,
+  prop2: String,
+  foo: function () {
+    return 1;
+  },
+  bar: function () {
+    return 0;
+  }
+};
+names = Object.getOwnPropertyNames(a);
+
+assert(names instanceof Array &&
+        names[0] === "prop1" &&
+        names[1] === "prop2" &&
+        names[2] === "foo" &&
+        names[3] === "bar");
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-010.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-010.js
new file mode 100644 (file)
index 0000000..e819610
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var a = new String("qwe");
+
+names = Object.getOwnPropertyNames(a);
+
+assert(names instanceof Array);
+
+var is_0 = false, is_1 = false, is_2 = false, is_length = false;
+for (var i = 0; i <= 3; i++)
+{
+  if (names[i] === "0") { is_0 = true; }
+  if (names[i] === "1") { is_1 = true; }
+  if (names[i] === "2") { is_2 = true; }
+  if (names[i] === "length") { is_length = true; }
+}
+
+assert (is_0 && is_1 && is_2 && is_length);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-011.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-011.js
new file mode 100644 (file)
index 0000000..8086d9f
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+var object1 = {
+  field1: 5,
+  field2: "qwe",
+  field3: true
+}
+
+var object2 = {
+  field1: 5,
+  field2: "qwe",
+  field3: true
+}
+
+Object.seal(object1);
+
+assert(Object.isSealed(object1) && !Object.isSealed(object2));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-012.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-012.js
new file mode 100644 (file)
index 0000000..9940bcb
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+var veryUsefulObject = {
+}
+
+Object.preventExtensions(veryUsefulObject);
+
+veryUsefulObject.property = "qwerty";
+
+veryUsefulObject.method = function () {
+  return "asdf";
+}
+
+assert(veryUsefulObject.property === undefined);
+assert(veryUsefulObject.method === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-013.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-013.js
new file mode 100644 (file)
index 0000000..9ebd10a
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var niceObject = {
+  niceProp1: String,
+  niceProp2: Number,
+  niceMeth: function () {
+    return true;
+  }
+}
+var someElseObject = {
+  prop1: Boolean,
+  prop2: Number
+}
+var niceChild = Object.create(niceObject, someElseObject);
+
+assert(Object.getPrototypeOf(niceChild) === niceObject);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-014.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-014.js
new file mode 100644 (file)
index 0000000..352dd99
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var a = new String("qwe"); //I'm not a string I'm Object-String. It's OK.
+var someElseObject = {
+  prop1: Boolean,
+  prop2: Number
+}
+var niceChild = Object.create(a, someElseObject);
+
+assert(Object.getPrototypeOf(niceChild) === a);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-015.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-015.js
new file mode 100644 (file)
index 0000000..903e800
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = {}
+var someElseObject = undefined;
+var childObject = Object.create(a, someElseObject); //nothing is inherited
+
+assert(Object.getPrototypeOf(childObject) === a && Object.getOwnPropertyNames(childObject).length == 0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-016.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-016.js
new file mode 100644 (file)
index 0000000..1b75974
--- /dev/null
@@ -0,0 +1,49 @@
+// 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.
+
+var emptyObject = {}
+
+var propertyDescriptor = {
+  enumerable: true,
+  configurable: true,
+  get: function () {
+    return myProperty;
+  },
+  set: function (newValue) {
+    myProperty = newValue;
+  }
+}
+
+Object.defineProperty(emptyObject, 'myProperty', propertyDescriptor);
+
+var checkGetSet = false;
+var isEnumerable = false;
+var isConfigurable = false;
+
+emptyObject.myProperty = "foobar";
+if (emptyObject.myProperty == "foobar")
+  checkGetSet = true;
+
+for (p in emptyObject) {
+  if (emptyObject[p] == "foobar") {
+    isEnumerable = true;
+    break;
+  }
+}
+
+if (delete emptyObject.myProperty)
+  isConfigurable = true;
+
+assert(checkGetSet && isEnumerable && isConfigurable);
+
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-017.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-017.js
new file mode 100644 (file)
index 0000000..39e2684
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var object = {
+  prop1: "qwerty",
+  prop2: 123,
+}
+
+Object.freeze(object);
+
+object.prop1 = "asdf";
+object.prop3 = true;
+
+assert(!(object.prop1 === "asdf") && !delete object.prop2 && !object.prop3);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-018.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-018.js
new file mode 100644 (file)
index 0000000..bb71e38
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+var object = {
+  prop1: Number,
+  prop2: String,
+  prop3: Boolean
+}
+
+Object.seal(object);
+
+check = delete object.prop1 || delete object.prop2 || delete object.prop3;
+
+object.prop4 = 3;
+
+check = check || Boolean(object.prop4);
+
+assert(!check);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-019.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-019.js
new file mode 100644 (file)
index 0000000..d778dec
--- /dev/null
@@ -0,0 +1,53 @@
+// 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.
+
+var emptyObject = {}
+
+var properties = {
+  prop1: {
+    writable: true,
+    enumerable: true,
+    configurable: false,
+    value: "I'm prop1"
+  },
+  prop2: {
+    writable: true,
+    enumerable: true,
+    configurable: false,
+    value: "I'm prop2"
+  }
+}
+
+var isEnumerable = true;
+var isConfigurable = true;
+var isWritable = false;
+
+Object.defineProperties(emptyObject, properties);
+
+emptyObject.prop1 = "hello";
+emptyObject.prop2 = "world";
+
+if (emptyObject.prop1 === "hello" && emptyObject.prop2 == "world")
+  isWritable = true;
+
+for (p in emptyObject) {
+  if (emptyObject[p] === "hello")
+    isEnumerable = !isEnumerable;
+  else if (emptyObject[p] === "world")
+    isEnumerable = !isEnumerable;
+}
+
+isConfigurable = delete emptyObject.prop1 && delete emptyObject.prop2
+
+assert(isWritable && isEnumerable && !isConfigurable);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-020.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-020.js
new file mode 100644 (file)
index 0000000..8d13526
--- /dev/null
@@ -0,0 +1,44 @@
+// 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.
+
+var emptyObject = {}
+
+var propertyDescriptor = {
+  enumerable: true,
+  configurable: true,
+  value: "hello!",
+  writable: true
+}
+
+Object.defineProperty(emptyObject, 'myProperty', propertyDescriptor);
+
+var isWritable = false;
+var isEnumerable = false;
+var isConfigurable = false;
+
+emptyObject.myProperty = "foobar";
+if (emptyObject.myProperty == "foobar")
+  isWritable = true;
+
+for (p in emptyObject) {
+  if (emptyObject[p] == "foobar") {
+    isEnumerable = true;
+    break;
+  }
+}
+
+if (delete emptyObject.myProperty)
+  isConfigurable = true;
+
+assert(isWritable && isEnumerable && isConfigurable);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-021.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.03/15.02.03-021.js
new file mode 100644 (file)
index 0000000..b4d7715
--- /dev/null
@@ -0,0 +1,52 @@
+// 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.
+
+var emptyObject = {}
+
+var propertyDescriptor = {
+  enumerable: true,
+  configurable: true,
+  value: "hello!",
+  writable: true
+}
+
+Object.defineProperty(emptyObject, 'myProperty', propertyDescriptor);
+
+var newPropertyDescriptor = {
+  enumerable: false,
+  configurable: false,
+  writable: false
+}
+
+Object.defineProperty(emptyObject, 'myProperty', newPropertyDescriptor); //change properties of property
+
+var isWritable = false;
+var isEnumerable = false;
+var isConfigurable = false;
+
+emptyObject.myProperty = "foobar";
+if (emptyObject.myProperty == "foobar")
+  isWritable = true;
+
+for (p in emptyObject) {
+  if (emptyObject[p] == "foobar") {
+    isEnumerable = true;
+    break;
+  }
+}
+
+if (delete emptyObject.myProperty)
+  isConfigurable = true;
+
+assert(!isWritable && !isEnumerable && !isConfigurable);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04-001.js
new file mode 100644 (file)
index 0000000..4dcdc82
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Object.getPrototypeOf(Object.getPrototypeOf(Object())) === null);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04-002.js
new file mode 100644 (file)
index 0000000..2e3887a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Object.isExtensible(Object.getPrototypeOf(Object())));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.01/15.02.04.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.01/15.02.04.01-001.js
new file mode 100644 (file)
index 0000000..a3c1d12
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Object.getPrototypeOf(Object()).constructor === Object);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.01/15.02.04.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.01/15.02.04.01-002.js
new file mode 100644 (file)
index 0000000..e3a6247
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Object.prototype.constructor === Object);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-001.js
new file mode 100644 (file)
index 0000000..783147f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Object.prototype.toString.call(undefined) === "[object Undefined]");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-002.js
new file mode 100644 (file)
index 0000000..9202a6a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Object.prototype.toString.call(null) === "[object Null]");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-003.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-003.js
new file mode 100644 (file)
index 0000000..7a4706d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var obj = {};
+assert(obj.toString() === "[object Object]");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-004.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.02/15.02.04.02-004.js
new file mode 100644 (file)
index 0000000..eaf2da0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Object.prototype.toString.call(123) === "[object Number]");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.03/15.02.04.03-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.03/15.02.04.03-001.js
new file mode 100644 (file)
index 0000000..d5fddd7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof Object.prototype.toLocaleString === 'function');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.03/15.02.04.03-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.03/15.02.04.03-002.js
new file mode 100644 (file)
index 0000000..24a2083
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var o = new Object();
+assert(o.toLocaleString() === o.toString());
+    
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.03/15.02.04.03-003.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.03/15.02.04.03-003.js
new file mode 100644 (file)
index 0000000..e13c8b2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Object.toLocaleString() === Object.toString());
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-001.js
new file mode 100644 (file)
index 0000000..2b57afa
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Object();
+assert(a.valueOf() === a);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-002.js
new file mode 100644 (file)
index 0000000..fce5e47
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = {
+  n: Number(5)
+}
+assert(a.valueOf() === a);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-003.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-003.js
new file mode 100644 (file)
index 0000000..d92db7e
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = {
+  n: true,
+  s: "qwerty"
+}
+
+assert(a.valueOf() === a);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-004.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-004.js
new file mode 100644 (file)
index 0000000..dcc8f15
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new Number(5);
+
+assert(a.valueOf() === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-005.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-005.js
new file mode 100644 (file)
index 0000000..f411c63
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = 123;
+
+assert(a.valueOf() === 123);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-006.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-006.js
new file mode 100644 (file)
index 0000000..91538bf
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = new Boolean(true);
+
+assert(a.valueOf() === true);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-007.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-007.js
new file mode 100644 (file)
index 0000000..9bff514
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var a = false;
+
+assert(a.valueOf() === false);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-008.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-008.js
new file mode 100644 (file)
index 0000000..ae23e5c
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new String("qwe");
+assert(a.valueOf() === "qwe");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-009.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-009.js
new file mode 100644 (file)
index 0000000..d16252d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "asdfgh";
+assert(a.valueOf() === "asdfgh");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-010.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.04/15.02.04.04-010.js
new file mode 100644 (file)
index 0000000..0fe6cf8
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = "123";
+assert(a.valueOf() === "123");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-001.js
new file mode 100644 (file)
index 0000000..3e7453e
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var obj = {
+  prop1: 5,
+  prop2: "qwe",
+  prop3: Boolean
+}
+
+assert(obj.hasOwnProperty("prop1"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-002.js
new file mode 100644 (file)
index 0000000..807be92
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var obj = {
+  prop1: 5
+}
+
+assert(!obj.hasOwnProperty("prop5"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-003.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-003.js
new file mode 100644 (file)
index 0000000..edeb301
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+function Parent() {
+  this.prop = 5;
+}
+
+function Child() {
+  this.prop2 = false;
+}
+
+Child.prototype = Parent;
+
+var obj = new Child();
+
+assert(!obj.hasOwnProperty("prop"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-004.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.05/15.02.04.05-004.js
new file mode 100644 (file)
index 0000000..648a44f
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+function Parent() {
+  this.prop = 5;
+}
+
+function Child() {
+  this.prop2 = false;
+}
+
+Child.prototype = Parent;
+
+var obj = new Child();
+
+assert(obj.hasOwnProperty("prop2"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-001.js
new file mode 100644 (file)
index 0000000..05f7be9
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = new Object();
+var b = 123;
+
+assert(!a.isPrototypeOf(b));
+
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-002.js
new file mode 100644 (file)
index 0000000..041872c
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var object = new Object();
+var p = Object.getPrototypeOf(object);
+
+assert(p.isPrototypeOf(object));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-003.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-003.js
new file mode 100644 (file)
index 0000000..e8c6c2a
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var object = new Object();
+var otherObject = new Object();
+
+assert(!otherObject.isPrototypeOf(object));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-004.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-004.js
new file mode 100644 (file)
index 0000000..beef696
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var object = new Object();
+assert(!object.isPrototypeOf(object));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-005.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-005.js
new file mode 100644 (file)
index 0000000..e58a432
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var object = Object.create(null);
+var temp = new Object();
+assert(!temp.isPrototypeOf(object));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-006.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.06/15.02.04.06-006.js
new file mode 100644 (file)
index 0000000..1913bf8
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+try
+{
+  Object.prototype.isPrototypeOf.call(undefined, {});
+
+  assert(false);
+} catch (e)
+{
+  assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.07/15.02.04.07-001.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.07/15.02.04.07-001.js
new file mode 100644 (file)
index 0000000..6f9a0d3
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var object = {
+  prop: true
+}
+
+assert(!object.propertyIsEnumerable('prop2'));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.07/15.02.04.07-002.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.07/15.02.04.07-002.js
new file mode 100644 (file)
index 0000000..1e2da42
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var object = {}
+
+var propertyDescriptor = {
+  enumerable: true,
+  configurable: true,
+  value: "qwe",
+  writable: true
+}
+
+Object.defineProperty(object, 'prop', propertyDescriptor);
+
+assert(object.propertyIsEnumerable('prop'));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.07/15.02.04.07-003.js b/deps/jerry/tests/jerry-test-suite/15/15.02/15.02.04/15.02.04.07/15.02.04.07-003.js
new file mode 100644 (file)
index 0000000..239d567
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var object = {}
+
+var propertyDescriptor = {
+  enumerable: false,
+  configurable: true,
+  value: "qwe",
+  writable: true
+}
+
+Object.defineProperty(object, 'prop', propertyDescriptor);
+
+assert(!object.propertyIsEnumerable('prop'));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-001.js
new file mode 100644 (file)
index 0000000..961c6b4
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var func = new Function("a,b", "c", "return a+b+c")
+assert(func(1, 2, 3) == 6);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-002.js
new file mode 100644 (file)
index 0000000..edf76f5
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+try
+{
+  Function('a', 'a', '"use strict";');
+  assert(false);
+}
+catch (e)
+{
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-004.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-004.js
new file mode 100644 (file)
index 0000000..6cce8bf
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+try
+{
+  Function('eval', '"use strict";');
+  assert(false);
+}
+catch (e)
+{
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-005.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-005.js
new file mode 100644 (file)
index 0000000..3fefe0e
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+"use strict";
+try
+{
+  Function('eval', 'return;');
+
+}
+catch (e)
+{
+  assert(false);
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-007.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-007.js
new file mode 100644 (file)
index 0000000..7c4b5ed
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+try
+{
+  Function('a,a', '"use strict";');
+  assert(false);
+}
+catch (e)
+{
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-008.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-008.js
new file mode 100644 (file)
index 0000000..5e036d0
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+"use strict";
+
+try
+{
+  Function('a,a', 'return a;');
+}
+catch (e)
+{
+  assert(false);
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-009.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-009.js
new file mode 100644 (file)
index 0000000..8219a9d
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+"use strict";
+
+try
+{
+  Function('arguments', 'return;');
+}
+catch (e)
+{
+  assert(false);
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-010.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-010.js
new file mode 100644 (file)
index 0000000..6e484b5
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict";
+
+var foo = new Function("baz", "qux", "baz", "return 0;");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-011.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-011.js
new file mode 100644 (file)
index 0000000..6d8f290
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+"use strict";
+
+var foo = new Function("baz", "baz", "baz", "return 0;");
+
+assert(foo() === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-012s.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.02/15.03.02.01/15.03.02.01-012s.js
new file mode 100644 (file)
index 0000000..f2301d3
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+"use strict";
+
+try
+{
+  Function('a', 'a', 'return;');
+}
+catch (e)
+{
+  assert(false);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-001.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-001.js
new file mode 100644 (file)
index 0000000..3d31cbc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Function.hasOwnProperty("prototype"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-002.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-002.js
new file mode 100644 (file)
index 0000000..a80b74b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Function.prototype.isPrototypeOf(Function));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-003.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-003.js
new file mode 100644 (file)
index 0000000..86bb337
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+Function.prototype.indicator = 1;
+assert (Function.indicator === 1);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-004.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03-004.js
new file mode 100644 (file)
index 0000000..3c556a2
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(Function.hasOwnProperty("length"));
+assert(Function.length === 1);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-001.js
new file mode 100644 (file)
index 0000000..d44b8dc
--- /dev/null
@@ -0,0 +1,35 @@
+// 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.
+
+var obj = Function.prototype;
+Function.prototype = function () {
+  return "shifted";
+};
+
+if (Function.prototype !== obj)
+{
+  assert(false);
+}
+
+try
+{
+  if (Function.prototype() !== undefined)
+  {
+    assert(false);
+  }
+}
+catch (e)
+{
+  assert(false);
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-002.js
new file mode 100644 (file)
index 0000000..4acb6b8
--- /dev/null
@@ -0,0 +1,31 @@
+// 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.
+
+if (Function.propertyIsEnumerable('prototype'))
+{
+  assert(false);
+}
+
+var count = 0;
+
+for (p in Function)
+{
+  if (p === "prototype")
+    count++;
+}
+
+if (count !== 0)
+{
+  assert(false);
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-003.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-003.js
new file mode 100644 (file)
index 0000000..daa3ed9
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+delete Function.prototype;
+
+if (!(Function.hasOwnProperty('prototype')))
+{
+  assert(false);
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-004.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.01/15.03.03.01-004.js
new file mode 100644 (file)
index 0000000..b611bde
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+function foo() {
+}
+
+Object.defineProperty(foo, 'prototype', {value: {}});
+assert(foo.prototype ===
+        Object.getOwnPropertyDescriptor(foo, 'prototype').value);
+    
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.02/15.03.03.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.03/15.03.03.02/15.03.03.02-001.js
new file mode 100644 (file)
index 0000000..1605611
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var desc = Object.getOwnPropertyDescriptor(Function, "length");
+assert(desc.value === 1 &&
+        desc.writable === false &&
+        desc.enumerable === false &&
+        desc.configurable === false);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-001.js
new file mode 100644 (file)
index 0000000..b24dbc0
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+assert(Function.prototype.toString.hasOwnProperty('length'));
+assert(!(delete Function.prototype.toString.length));
+assert(Function.prototype.toString.hasOwnProperty('length'));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-002.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-002.js
new file mode 100644 (file)
index 0000000..8955e27
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+var FACTORY = Function.prototype.toString;
+
+try
+{
+  var instance = new FACTORY;
+  assert(false);
+}
+catch (e)
+{
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-003.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-003.js
new file mode 100644 (file)
index 0000000..cd07e81
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+assert(Function.prototype.toString.hasOwnProperty('length'));
+assert(!Function.prototype.toString.propertyIsEnumerable('length'));
+for (p in Function.prototype.toString)
+{
+  assert(p !== "length");
+}
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-004.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-004.js
new file mode 100644 (file)
index 0000000..b24dbc0
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+assert(Function.prototype.toString.hasOwnProperty('length'));
+assert(!(delete Function.prototype.toString.length));
+assert(Function.prototype.toString.hasOwnProperty('length'));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-005.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-005.js
new file mode 100644 (file)
index 0000000..b461790
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+assert(Function.prototype.toString.hasOwnProperty('length'));
+
+var obj = Function.prototype.toString.length;
+
+Function.prototype.toString.length = function () {
+  return "shifted";
+};
+
+assert(Function.prototype.toString.length === obj);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-006.js b/deps/jerry/tests/jerry-test-suite/15/15.03/15.03.04/15.03.04.02/15.03.04.02-006.js
new file mode 100644 (file)
index 0000000..8f847a1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+assert(Function.prototype.toString.hasOwnProperty("length"));
+assert(Function.prototype.toString.length === 0);
+  
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-001.js
new file mode 100644 (file)
index 0000000..b5700eb
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array();
+assert(typeof a === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-002.js
new file mode 100644 (file)
index 0000000..b28a5e4
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(1, 2, 5);
+assert(a.length === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-003.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-003.js
new file mode 100644 (file)
index 0000000..56b6d97
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(1, 2, 5);
+assert(a[0] === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-004.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-004.js
new file mode 100644 (file)
index 0000000..d6feaaa
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(1, 2, 5);
+assert(a[1] === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-005.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-005.js
new file mode 100644 (file)
index 0000000..a695c12
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(1, 2, 5);
+assert(a[2] === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-006.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-006.js
new file mode 100644 (file)
index 0000000..e2fcce3
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(1, 2, 5);
+assert(a[3] === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-007.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-007.js
new file mode 100644 (file)
index 0000000..e0ce3e9
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array();
+assert(a.length === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-008.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.01/15.04.02.01-008.js
new file mode 100644 (file)
index 0000000..8ee969a
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array();
+assert(a[0] === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-001.js
new file mode 100644 (file)
index 0000000..1dcd6b5
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(5);
+assert(typeof a === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-002.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-002.js
new file mode 100644 (file)
index 0000000..b44951d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(5);
+assert(a.length === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-003.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-003.js
new file mode 100644 (file)
index 0000000..4b09e87
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(5);
+assert(a[0] === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-004.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-004.js
new file mode 100644 (file)
index 0000000..2587572
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(5);
+assert(a[3] === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-005.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-005.js
new file mode 100644 (file)
index 0000000..46747ed
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(5);
+assert(a[10] === undefined);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-006.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-006.js
new file mode 100644 (file)
index 0000000..8f62407
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array(0);
+assert(a.length === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-007.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-007.js
new file mode 100644 (file)
index 0000000..db0ca42
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array("5");
+assert(a.length === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-008.js b/deps/jerry/tests/jerry-test-suite/15/15.04/15.04.02/15.04.02.02/15.04.02.02-008.js
new file mode 100644 (file)
index 0000000..01d2ef7
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Array("55");
+assert(a[0] === "55");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-001.js
new file mode 100644 (file)
index 0000000..c43541a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String () === String (""));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-002.js
new file mode 100644 (file)
index 0000000..91e868c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (undefined) === "undefined");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-003.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-003.js
new file mode 100644 (file)
index 0000000..2072b70
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (null) === "null");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-004.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-004.js
new file mode 100644 (file)
index 0000000..d262dfa
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (true) === "true");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-005.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-005.js
new file mode 100644 (file)
index 0000000..fbc54a5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (false) === "false");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-006.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-006.js
new file mode 100644 (file)
index 0000000..83942e9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String(NaN) === "NaN");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-007.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-007.js
new file mode 100644 (file)
index 0000000..6b27e04
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (+0) === "0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-008.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-008.js
new file mode 100644 (file)
index 0000000..4c09688
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (-0) === "0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-009.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-009.js
new file mode 100644 (file)
index 0000000..f64dc52
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (-1) === "-" + String (1));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-010.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-010.js
new file mode 100644 (file)
index 0000000..e847f41
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (Infinity) === "Infinity");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-011.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-011.js
new file mode 100644 (file)
index 0000000..170d490
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (123000) === "123000");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-012.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-012.js
new file mode 100644 (file)
index 0000000..c989944
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (10000000000000000000) === "10000000000000000000");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-013.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-013.js
new file mode 100644 (file)
index 0000000..abdfc4f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (0.111111111111111) === "0.111111111111111");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-014.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-014.js
new file mode 100644 (file)
index 0000000..c2e0b69
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (0.00000111111111111111) === "0.00000111111111111111");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-015.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-015.js
new file mode 100644 (file)
index 0000000..5e31647
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String (0.000000111111111111111) === "1.11111111111111e-7");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.02/15.05.02.01/15.05.02.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.02/15.05.02.01/15.05.02.01-001.js
new file mode 100644 (file)
index 0000000..e6c1b52
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String.prototype.isPrototypeOf(new String("")));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.02/15.05.02.01/15.05.02.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.02/15.05.02.01/15.05.02.01-002.js
new file mode 100644 (file)
index 0000000..0243953
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var s = new String ("");
+s.x = 1;
+assert (s.x === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.01/15.05.03.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.01/15.05.03.01-001.js
new file mode 100644 (file)
index 0000000..7415177
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+String.prototype = 1;
+assert(String.prototype !== 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.01/15.05.03.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.01/15.05.03.01-002.js
new file mode 100644 (file)
index 0000000..30d2a87
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+for (var p in String) {
+  if (p === String.prototype) {
+    assert(false);
+  }
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-001.js
new file mode 100644 (file)
index 0000000..faf35f5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String.fromCharCode () === "");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-002.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-002.js
new file mode 100644 (file)
index 0000000..938b260
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String.fromCharCode (65, 66, 67) === "ABC");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.01/15.05.04.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.01/15.05.04.01-001.js
new file mode 100644 (file)
index 0000000..72310cf
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String.prototype.constructor === String);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-001.js
new file mode 100644 (file)
index 0000000..cc5dded
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String ("abc").toString () === "abc");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-002.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-002.js
new file mode 100644 (file)
index 0000000..a5b922c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert ("abc".toString () === "abc");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.03/15.05.04.03-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.03/15.05.04.03-001.js
new file mode 100644 (file)
index 0000000..5726462
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String ("abc").valueOf () === "abc");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-001.js
new file mode 100644 (file)
index 0000000..1d5df22
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String("abc").charAt(-1) === "");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-002.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-002.js
new file mode 100644 (file)
index 0000000..4900f6e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String("abc").charAt(3) === "");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-003.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-003.js
new file mode 100644 (file)
index 0000000..1066773
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String("abc").charAt(0) === "a");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-004.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.04/15.05.04.04-004.js
new file mode 100644 (file)
index 0000000..770817f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String("abc").charAt("0") === "a");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-001.js
new file mode 100644 (file)
index 0000000..f44b7ec
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(String("abc").charCodeAt(-1)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-002.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-002.js
new file mode 100644 (file)
index 0000000..db3ae2b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(String("abc").charCodeAt(3)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-003.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-003.js
new file mode 100644 (file)
index 0000000..2c5b9e8
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String("abc").charCodeAt(0) === 97);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-004.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.05/15.05.04.05-004.js
new file mode 100644 (file)
index 0000000..d10b396
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String("abc").charCodeAt("0") === 97);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-001.js
new file mode 100644 (file)
index 0000000..cae04f5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String("abc").concat("d") === "abcd");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-002.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-002.js
new file mode 100644 (file)
index 0000000..205d97e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String().concat() === "");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-003.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-003.js
new file mode 100644 (file)
index 0000000..0369cc2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String().concat("a", "b", "c") === "abc");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-004.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-004.js
new file mode 100644 (file)
index 0000000..0e22bd7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String ().concat.length === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.07/15.05.04.07-001.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.07/15.05.04.07-001.js
new file mode 100644 (file)
index 0000000..8e0a787
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String("abcd").indexOf("ab") === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.07/15.05.04.07-002.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.07/15.05.04.07-002.js
new file mode 100644 (file)
index 0000000..49623f5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String("abcd").indexOf("ab", 0) === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.07/15.05.04.07-003.js b/deps/jerry/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.07/15.05.04.07-003.js
new file mode 100644 (file)
index 0000000..f448a8b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(String("abcd").indexOf("ab", 1) === -1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-001.js
new file mode 100644 (file)
index 0000000..38feea1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false === Boolean(undefined));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-002.js
new file mode 100644 (file)
index 0000000..05c2e33
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false === Boolean(null));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-003.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-003.js
new file mode 100644 (file)
index 0000000..74e78d9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false === Boolean(false));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-004.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-004.js
new file mode 100644 (file)
index 0000000..8cd0151
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true === Boolean(true));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-005.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-005.js
new file mode 100644 (file)
index 0000000..5e0f380
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false === Boolean(+0));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-006.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-006.js
new file mode 100644 (file)
index 0000000..a8caf49
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false === Boolean(-0));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-007.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-007.js
new file mode 100644 (file)
index 0000000..4bfb876
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false === Boolean(NaN));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-008.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-008.js
new file mode 100644 (file)
index 0000000..feb0a76
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true === Boolean(11111));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-009.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-009.js
new file mode 100644 (file)
index 0000000..c7463bd
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true === Boolean(-11111));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-010.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-010.js
new file mode 100644 (file)
index 0000000..05d154c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(false === Boolean(""));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-011.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-011.js
new file mode 100644 (file)
index 0000000..fcdfa69
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true === Boolean("abcdef"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-012.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.01/15.06.01.01/15.06.01.01-012.js
new file mode 100644 (file)
index 0000000..2c0cf8c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true === Boolean({}));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.02/15.06.02.01/15.06.02.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.02/15.06.02.01/15.06.02.01-001.js
new file mode 100644 (file)
index 0000000..a31b76c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Boolean.prototype.isPrototypeOf(new Boolean(true)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.02/15.06.02.01/15.06.02.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.02/15.06.02.01/15.06.02.01-002.js
new file mode 100644 (file)
index 0000000..f6e40c8
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var b = new Boolean (true);
+b.x = 1;
+assert (b.x === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.03/15.06.03.01/15.06.03.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.03/15.06.03.01/15.06.03.01-001.js
new file mode 100644 (file)
index 0000000..12ca5d9
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+for (var p in Boolean) {
+  if (p === Boolean.prototype) {
+    assert(false);
+  }
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.01/15.06.04.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.01/15.06.04.01-001.js
new file mode 100644 (file)
index 0000000..c8aa949
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Boolean.prototype.constructor === Boolean);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.02/15.06.04.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.02/15.06.04.02-001.js
new file mode 100644 (file)
index 0000000..fa0b6c1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Boolean(true).toString() === "true");
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.02/15.06.04.02-002.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.02/15.06.04.02-002.js
new file mode 100644 (file)
index 0000000..8bd69dc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Boolean(false).toString() === "false");
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.02/15.06.04.02-003.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.02/15.06.04.02-003.js
new file mode 100644 (file)
index 0000000..f901ebf
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(true.toString() === "true");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.03/15.06.04.03-001.js b/deps/jerry/tests/jerry-test-suite/15/15.06/15.06.04/15.06.04.03/15.06.04.03-001.js
new file mode 100644 (file)
index 0000000..b49632f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Boolean(false).valueOf() === false);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07-001.js
new file mode 100644 (file)
index 0000000..02c5567
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = Number;
+Number = null;
+var b = new a(5);
+assert(b !== 5);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07-002.js
new file mode 100644 (file)
index 0000000..1e27a07
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = Number;
+Number = null;
+var b = new a(5)
+assert(!(b === 5));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-001.js
new file mode 100644 (file)
index 0000000..5ccbf7f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number("123456") === 123456);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-002.js
new file mode 100644 (file)
index 0000000..710f1cd
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (typeof Number("123456") === "number");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-003.js
new file mode 100644 (file)
index 0000000..3407feb
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(typeof Number(new Object()) === "number");
+
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-004.js
new file mode 100644 (file)
index 0000000..f9554dd
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Number(753) === 753);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-005.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-005.js
new file mode 100644 (file)
index 0000000..b20a3d8
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Number() === +0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-006.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-006.js
new file mode 100644 (file)
index 0000000..a866a24
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(isNaN(Number(new Error())));
+
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-007.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-007.js
new file mode 100644 (file)
index 0000000..29b660d
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(typeof Number("abcdefg") === "number");
+
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-008.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-008.js
new file mode 100644 (file)
index 0000000..3387e0e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number("abcdefg")));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-009.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-009.js
new file mode 100644 (file)
index 0000000..985f40f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number(function a() {return Infinity})));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-010.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.01/15.07.01-010.js
new file mode 100644 (file)
index 0000000..fc0bf43
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = Number;
+Number = null;
+var b = a(2);
+assert(b === 2 && typeof b === "number");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-001.js
new file mode 100644 (file)
index 0000000..ac65d02
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number("123456");
+assert((a == 123456) && (typeof a === 'object'));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-002.js
new file mode 100644 (file)
index 0000000..7756e49
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number();
+assert((a == +0.0) && (typeof a === 'object'));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-003.js
new file mode 100644 (file)
index 0000000..f1b5587
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = Number
+Number = null
+var b = new a("1e12")
+assert(b == 1000000000000 && typeof b === "object");
+
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-004.js
new file mode 100644 (file)
index 0000000..9138ba9
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var a = Number
+Number = null
+var b = new a("1e12")
+assert(b.toString(35) === "fiyo05lf");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-005.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-005.js
new file mode 100644 (file)
index 0000000..0aba8aa
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = Number
+Number = null
+var b = new a("1e12")
+b.c = new a(new Error())
+
+assert(typeof b.c === "object" && isNaN(b.c));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-006.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-006.js
new file mode 100644 (file)
index 0000000..cc7cfc0
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = Number
+Number = null
+var b = new a("1e12")
+b.c = new a(new a(777))
+assert(typeof b.c === "object" && b.c.valueOf() === 777)
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-007.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-007.js
new file mode 100644 (file)
index 0000000..40b78de
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+delete Number.prototype.toString;
+var a = new Number()
+assert(a.toString() === "[object Number]");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-008.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-008.js
new file mode 100644 (file)
index 0000000..4a13169
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number(null)
+assert(Number.prototype.isPrototypeOf(a));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-009.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-009.js
new file mode 100644 (file)
index 0000000..5bf3ce3
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number(null)
+assert(Number.prototype === a.constructor.prototype);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-010.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-010.js
new file mode 100644 (file)
index 0000000..e19c4aa
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var b = Number.prototype
+var a = Number
+Number = null
+var c = new a(5)
+assert(b === c.constructor.prototype);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-011.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.02/15.07.02-011.js
new file mode 100644 (file)
index 0000000..0a32d27
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number();
+assert(a.valueOf() === +0.0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-001.js
new file mode 100644 (file)
index 0000000..e82e262
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.constructor.prototype === Function.prototype);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-002.js
new file mode 100644 (file)
index 0000000..780224c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.hasOwnProperty("length") && Number.length === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-003.js
new file mode 100644 (file)
index 0000000..79d90f3
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Function.prototype.isPrototypeOf(Number) === true);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03-004.js
new file mode 100644 (file)
index 0000000..cda2e8b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var p = Object.getPrototypeOf(Number);
+assert(p === Function.prototype);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-001.js
new file mode 100644 (file)
index 0000000..1b231f4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.hasOwnProperty("prototype"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-002.js
new file mode 100644 (file)
index 0000000..2822d38
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a = Object.getOwnPropertyDescriptor(Number, 'prototype');
+
+assert((a.writable === false &&
+        a.enumerable === false &&
+        a.configurable === false));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-003.js
new file mode 100644 (file)
index 0000000..4ca8a52
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Object.getPrototypeOf(new Number()) === Number.prototype);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-004.js
new file mode 100644 (file)
index 0000000..062c42d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var b = Number.prototype
+Number.prototype = 4
+assert(Number.prototype != 4 && Number.prototype === b)
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-005.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-005.js
new file mode 100644 (file)
index 0000000..689c25b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(delete Number.prototype === false)
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-006.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-006.js
new file mode 100644 (file)
index 0000000..7a86678
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!Number.propertyIsEnumerable('prototype'));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-007.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-007.js
new file mode 100644 (file)
index 0000000..c29cfe4
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+for (x in Number)
+{
+  if (x === "prototype")
+  {
+    assert(false);
+  }
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-008.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-008.js
new file mode 100644 (file)
index 0000000..4db19e9
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+delete Number.prototype.toString
+assert(Number.prototype.toString() === "[object Number]");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-009.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-009.js
new file mode 100644 (file)
index 0000000..750a445
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+Number.prototype.toString = Object.prototype.toString;
+assert(Number.prototype.toString() === "[object Number]");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-010.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-010.js
new file mode 100644 (file)
index 0000000..d5c7a4c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype == +0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-011.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.01/15.07.03.01-011.js
new file mode 100644 (file)
index 0000000..31f4695
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1/Number.prototype === Number.POSITIVE_INFINITY);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-001.js
new file mode 100644 (file)
index 0000000..9d10069
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.hasOwnProperty("MAX_VALUE"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-002.js
new file mode 100644 (file)
index 0000000..e9a48de
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MAX_VALUE === 1.7976931348623157e308);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-003.js
new file mode 100644 (file)
index 0000000..e9a48de
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MAX_VALUE === 1.7976931348623157e308);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-004.js
new file mode 100644 (file)
index 0000000..a11b020
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var b = Number.MAX_VALUE;
+Number.MAX_VALUE = 0;
+assert(Number.MAX_VALUE === b);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-005.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-005.js
new file mode 100644 (file)
index 0000000..dcbb146
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(delete Number.MAX_VALUE));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-006.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.02/15.07.03.02-006.js
new file mode 100644 (file)
index 0000000..e84b7a3
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+for (x in Number)
+{
+  if (x === "MAX_VALUE")
+  {
+    assert(false);
+  }
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-001.js
new file mode 100644 (file)
index 0000000..d88ccf5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.hasOwnProperty("MIN_VALUE"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-002.js
new file mode 100644 (file)
index 0000000..eb9f0cf
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MIN_VALUE === 5e-324);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-003.js
new file mode 100644 (file)
index 0000000..eb9f0cf
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.MIN_VALUE === 5e-324);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-004.js
new file mode 100644 (file)
index 0000000..6d10e7d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var b = Number.MIN_VALUE
+Number.MIN_VALUE = 0
+assert(Number.MIN_VALUE === b);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-005.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-005.js
new file mode 100644 (file)
index 0000000..ecfec4e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(delete Number.MIN_VALUE));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-006.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.03/15.07.03.03-006.js
new file mode 100644 (file)
index 0000000..9d0fb1b
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+for (x in Number)
+{
+  if (x === "MIN_VALUE")
+  {
+    assert(false);
+  }
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-001.js
new file mode 100644 (file)
index 0000000..59e0afc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.hasOwnProperty("NaN"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-002.js
new file mode 100644 (file)
index 0000000..0afb241
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Number.NaN));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-003.js
new file mode 100644 (file)
index 0000000..bae8ee7
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+for (x in Number)
+{
+  if (x === "NaN")
+  {
+    assert(false);
+  }
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-004.js
new file mode 100644 (file)
index 0000000..725d265
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+Number.NaN = 0;
+assert(isNaN(Number.NaN));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-005.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.04/15.07.03.04-005.js
new file mode 100644 (file)
index 0000000..103f39f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(delete Number.NaN));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-001.js
new file mode 100644 (file)
index 0000000..ade5d00
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.hasOwnProperty("NEGATIVE_INFINITY"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-002.js
new file mode 100644 (file)
index 0000000..cd6c4ad
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(isFinite(Number.NEGATIVE_INFINITY) && Number.NEGATIVE_INFINITY < 0));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-003.js
new file mode 100644 (file)
index 0000000..c3dc7ed
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.NEGATIVE_INFINITY === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-004.js
new file mode 100644 (file)
index 0000000..a54da0b
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var b = Number.NEGATIVE_INFINITY;
+Number.NEGATIVE_INFINITY = 0;
+assert(Number.NEGATIVE_INFINITY === b);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-005.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-005.js
new file mode 100644 (file)
index 0000000..9ab6e44
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(delete Number.NEGATIVE_INFINITY));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-006.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-006.js
new file mode 100644 (file)
index 0000000..37aead5
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+for (x in Number)
+{
+  if (x === "NEGATIVE_INFINITY")
+  {
+    assert(false);
+  }
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-007.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.05/15.07.03.05-007.js
new file mode 100644 (file)
index 0000000..06d73b2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!Number.propertyIsEnumerable('NEGATIVE_INFINITY'));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-001.js
new file mode 100644 (file)
index 0000000..98ecd7a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.hasOwnProperty("POSITIVE_INFINITY"));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-002.js
new file mode 100644 (file)
index 0000000..c405e8c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!isFinite(Number.POSITIVE_INFINITY) && Number.POSITIVE_INFINITY > 0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-003.js
new file mode 100644 (file)
index 0000000..4184c73
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.POSITIVE_INFINITY === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-004.js
new file mode 100644 (file)
index 0000000..88611a4
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var b = Number.POSITIVE_INFINITY
+Number.POSITIVE_INFINITY = 0
+assert(Number.POSITIVE_INFINITY === b);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-005.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-005.js
new file mode 100644 (file)
index 0000000..dba6836
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(delete Number.POSITIVE_INFINITY));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-006.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-006.js
new file mode 100644 (file)
index 0000000..0c18049
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+for (x in Number)
+{
+  if (x === "POSITIVE_INFINITY")
+  {
+    assert(false);
+  }
+}
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-007.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.03/15.07.03.06/15.07.03.06-007.js
new file mode 100644 (file)
index 0000000..1e48b03
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!Number.propertyIsEnumerable('POSITIVE_INFINITY'));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04-001.js
new file mode 100644 (file)
index 0000000..08b0996
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+delete Number.prototype.toString
+assert(Number.prototype.toString() === "[object Number]");
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04-002.js
new file mode 100644 (file)
index 0000000..ced1aa3
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof Number.prototype === "object" && Number.prototype == +0.0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04-003.js
new file mode 100644 (file)
index 0000000..9913d70
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Object.prototype.isPrototypeOf(Number.prototype));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.01/15.07.04.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.01/15.07.04.01-001.js
new file mode 100644 (file)
index 0000000..cf7e705
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype.hasOwnProperty('constructor'));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.01/15.07.04.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.01/15.07.04.01-002.js
new file mode 100644 (file)
index 0000000..1d8b7ec
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype.constructor === Number);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-001.js
new file mode 100644 (file)
index 0000000..f090092
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = Number(0.1);
+assert(a.toString(36) === "0.3llllllllllqsn8td1p464unmi");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-003.js
new file mode 100644 (file)
index 0000000..395d67b
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = new Number(15);
+assert(a.toString(2) === "1111");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-004.js
new file mode 100644 (file)
index 0000000..9183170
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = 123456789012345
+assert(a.toString(8) === "3404420603357571");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-005.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-005.js
new file mode 100644 (file)
index 0000000..9b15d44
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var a = -123456789012345
+assert(a.toString(8) === "-3404420603357571");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-006.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-006.js
new file mode 100644 (file)
index 0000000..c41249b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype.toString(2) === "0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-008.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-008.js
new file mode 100644 (file)
index 0000000..305f878
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype.toString() === "0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-009.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-009.js
new file mode 100644 (file)
index 0000000..cc3a7fe
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(Number.prototype.hasOwnProperty('toString') &&
+        typeof Number.prototype.toString === "function");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-010.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-010.js
new file mode 100644 (file)
index 0000000..f5b9828
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((new Number(NaN)).toString() === "NaN");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-011.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-011.js
new file mode 100644 (file)
index 0000000..c4367f7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((new Number(NaN)).toString(undefined) === "NaN")
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-012.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-012.js
new file mode 100644 (file)
index 0000000..c477592
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert((new Number(Number.POSITIVE_INFINITY)).toString(undefined) === "Infinity");
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-013.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.02/15.07.04.02-013.js
new file mode 100644 (file)
index 0000000..ec78efd
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert ((new Number(Number.NEGATIVE_INFINITY)).toString(undefined) === "-Infinity");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-001.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-001.js
new file mode 100644 (file)
index 0000000..f9e5485
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype.toFixed() === "0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-002.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-002.js
new file mode 100644 (file)
index 0000000..09edcaf
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype.toFixed(0) === "0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-003.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-003.js
new file mode 100644 (file)
index 0000000..d23a50b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype.toFixed(1) === "0.0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-004.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-004.js
new file mode 100644 (file)
index 0000000..8adfc24
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Number.prototype.toFixed(1.1) === "0.0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-005.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-005.js
new file mode 100644 (file)
index 0000000..0bd3ba1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype.toFixed(0.9) === "0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-006.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-006.js
new file mode 100644 (file)
index 0000000..1f24387
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Number.prototype.toFixed("1") === "0.0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-007.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-007.js
new file mode 100644 (file)
index 0000000..7b6ca00
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype.toFixed(Number.NaN) === "0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-008.js b/deps/jerry/tests/jerry-test-suite/15/15.07/15.07.04/15.07.04.05/15.07.04.05-008.js
new file mode 100644 (file)
index 0000000..442444d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Number.prototype.toFixed("some string") === "0");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-001.js
new file mode 100644 (file)
index 0000000..85dfa4f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.abs(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-002.js
new file mode 100644 (file)
index 0000000..d56d5b4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.abs(-0.0) === +0.0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-003.js
new file mode 100644 (file)
index 0000000..7ee7dff
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.abs(Number.NEGATIVE_INFINITY) === Number.POSITIVE_INFINITY);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-004.js
new file mode 100644 (file)
index 0000000..7ee7dff
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.abs(Number.NEGATIVE_INFINITY) === Number.POSITIVE_INFINITY);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.01/15.08.02.01-005.js
new file mode 100644 (file)
index 0000000..c914987
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.abs(-123513745) === 123513745);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-001.js
new file mode 100644 (file)
index 0000000..6c4daa1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.acos(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-002.js
new file mode 100644 (file)
index 0000000..dcae691
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!isNaN(Math.acos(1.00000000000000000000001)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-003.js
new file mode 100644 (file)
index 0000000..88e01ac
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.acos(Number.NEGATIVE_INFINITY)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-004.js
new file mode 100644 (file)
index 0000000..143135a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.acos(1) === +0.0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-005.js
new file mode 100644 (file)
index 0000000..e0719e2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.acos(1.000000000000001)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.02/15.08.02.02-006.js
new file mode 100644 (file)
index 0000000..b3f67d4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.acos(-7)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-001.js
new file mode 100644 (file)
index 0000000..f5cbb87
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.asin(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-002.js
new file mode 100644 (file)
index 0000000..4fbdd65
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.asin(1.000000000000001)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-003.js
new file mode 100644 (file)
index 0000000..6e814ac
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!isNaN(Math.asin(1.0000000000000001)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-004.js
new file mode 100644 (file)
index 0000000..2f69664
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!isNaN(Math.asin(-1.0000000000000001)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-005.js
new file mode 100644 (file)
index 0000000..23e1e8b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.asin(-1.000000000000001)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-006.js
new file mode 100644 (file)
index 0000000..ee06b53
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.asin(-3)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-007.js
new file mode 100644 (file)
index 0000000..f633c41
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.asin(+0) === +0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-008.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-008.js
new file mode 100644 (file)
index 0000000..32a47e6
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.asin(-0) === -0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-009.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.03/15.08.02.03-009.js
new file mode 100644 (file)
index 0000000..b93465c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.asin(1) === Math.PI / 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-001.js
new file mode 100644 (file)
index 0000000..b635e04
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.atan(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-002.js
new file mode 100644 (file)
index 0000000..0f65187
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.atan(undefined)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-003.js
new file mode 100644 (file)
index 0000000..f52ebc0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.atan({})));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-004.js
new file mode 100644 (file)
index 0000000..d2ffa52
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan(+0) === +0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-005.js
new file mode 100644 (file)
index 0000000..f7f66ba
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan(-0) === -0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-006.js
new file mode 100644 (file)
index 0000000..f5a121a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan(Infinity) === Math.PI / 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-007.js
new file mode 100644 (file)
index 0000000..7bb64c5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan(Number.POSITIVE_INFINITY) === Math.PI / 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-008.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-008.js
new file mode 100644 (file)
index 0000000..4dccd5c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan(Number.NEGATIVE_INFINITY) === -Math.PI / 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-009.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.04/15.08.02.04-009.js
new file mode 100644 (file)
index 0000000..9c10a7a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan(-1) === -Math.PI / 4);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-001.js
new file mode 100644 (file)
index 0000000..d56040e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.atan2(NaN, 1)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-002.js
new file mode 100644 (file)
index 0000000..fa30fb0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.atan2(1, NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-003.js
new file mode 100644 (file)
index 0000000..ea832e3
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(Number.MIN_VALUE, +0) === Math.PI / 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-004.js
new file mode 100644 (file)
index 0000000..e8b2278
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!(Math.atan2(0, +0) === Math.PI / 2));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-005.js
new file mode 100644 (file)
index 0000000..0b623fd
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(1, -0) === Math.PI / 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-006.js
new file mode 100644 (file)
index 0000000..0a8fd79
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(+0, Number.MAX_VALUE) === +0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-007.js
new file mode 100644 (file)
index 0000000..0081071
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(+0, +0) === +0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-008.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-008.js
new file mode 100644 (file)
index 0000000..ab7f528
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(+0, -0) === Math.PI);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-009.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-009.js
new file mode 100644 (file)
index 0000000..6fc3a58
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(+0, -Number.MIN_VALUE) === Math.PI);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-010.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-010.js
new file mode 100644 (file)
index 0000000..c754698
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(+0, -Infinity) === Math.PI);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-011.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-011.js
new file mode 100644 (file)
index 0000000..d4635a5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-0, Infinity) === -0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-012.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-012.js
new file mode 100644 (file)
index 0000000..e16abe3
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-0, +0) === -0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-013.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-013.js
new file mode 100644 (file)
index 0000000..3349355
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-0, -0) === -Math.PI);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-014.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-014.js
new file mode 100644 (file)
index 0000000..dc0dc48
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-0, -Number.MIN_VALUE) === -Math.PI);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-015.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-015.js
new file mode 100644 (file)
index 0000000..5aa27ee
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-0, -Infinity) === -Math.PI);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-016.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-016.js
new file mode 100644 (file)
index 0000000..56e04ea
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-99999999, +0) === -Math.PI/2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-017.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-017.js
new file mode 100644 (file)
index 0000000..ece3944
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-99999999, -0) === -Math.PI/2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-018.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-018.js
new file mode 100644 (file)
index 0000000..a395aee
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(1, Infinity) === +0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-019.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-019.js
new file mode 100644 (file)
index 0000000..15f15eb
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(Number.MAX_VALUE, -Infinity) === Math.PI);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-020.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-020.js
new file mode 100644 (file)
index 0000000..da15eb3
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-Number.MAX_VALUE, Number.POSITIVE_INFINITY) === -0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-021.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-021.js
new file mode 100644 (file)
index 0000000..6a3247d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-Number.MIN_VALUE, Number.NEGATIVE_INFINITY) === -Math.PI);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-022.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-022.js
new file mode 100644 (file)
index 0000000..0c89bf9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(Infinity, 1) === Math.PI / 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-023.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-023.js
new file mode 100644 (file)
index 0000000..2aa0a13
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(Infinity, -1) === Math.PI / 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-024.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-024.js
new file mode 100644 (file)
index 0000000..1f54f3b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-Infinity, -1) === -Math.PI / 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-025.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-025.js
new file mode 100644 (file)
index 0000000..cfdb995
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-Infinity, -999999999) === -Math.PI / 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-026.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-026.js
new file mode 100644 (file)
index 0000000..00305f2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(Infinity, Infinity) === Math.PI / 4);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-027.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-027.js
new file mode 100644 (file)
index 0000000..41537d0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(Infinity, -Infinity) === 3*Math.PI / 4);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-028.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-028.js
new file mode 100644 (file)
index 0000000..d8e11c2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-Infinity, +Infinity) === -Math.PI / 4);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-029.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.05/15.08.02.05-029.js
new file mode 100644 (file)
index 0000000..365b09d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.atan2(-Infinity, -Infinity) === -3*Math.PI / 4);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-001.js
new file mode 100644 (file)
index 0000000..4270a99
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.ceil(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-002.js
new file mode 100644 (file)
index 0000000..db05834
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var res = 1 / Math.ceil(+0)
+assert(res === +Infinity && res !== -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-003.js
new file mode 100644 (file)
index 0000000..1fbc91a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1/Math.ceil(-0) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-004.js
new file mode 100644 (file)
index 0000000..3393b65
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.ceil(-Infinity) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-005.js
new file mode 100644 (file)
index 0000000..af2a788
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.ceil(Infinity) === Number.POSITIVE_INFINITY);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-006.js
new file mode 100644 (file)
index 0000000..7e349a1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1/Math.ceil(-0.3) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-007.js
new file mode 100644 (file)
index 0000000..91f245d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.ceil(-1.3) === -1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-008.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-008.js
new file mode 100644 (file)
index 0000000..8d4636b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.ceil(-1.9) === -1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-009.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-009.js
new file mode 100644 (file)
index 0000000..71df782
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.ceil(1.9) === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-010.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-010.js
new file mode 100644 (file)
index 0000000..238b265
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.ceil(1.1) === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-011.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-011.js
new file mode 100644 (file)
index 0000000..3780436
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.ceil("NaN")));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-012.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.06/15.08.02.06-012.js
new file mode 100644 (file)
index 0000000..317d9dd
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.ceil(new Object())));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-001.js
new file mode 100644 (file)
index 0000000..3026bd4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.cos(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-002.js
new file mode 100644 (file)
index 0000000..d2e0229
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(isNaN(Math.cos("   NaN")));
+
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-003.js
new file mode 100644 (file)
index 0000000..d1db6b8
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.cos(+0) === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-004.js
new file mode 100644 (file)
index 0000000..80e8a57
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.cos(-0) === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-005.js
new file mode 100644 (file)
index 0000000..618043c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.cos(Infinity)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-006.js
new file mode 100644 (file)
index 0000000..2703f65
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.cos(-Infinity)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.07/15.08.02.07-007.js
new file mode 100644 (file)
index 0000000..05aa2fe
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.cos(Math.PI) === -1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-001.js
new file mode 100644 (file)
index 0000000..e13d658
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.exp(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-002.js
new file mode 100644 (file)
index 0000000..dfc0f1c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.exp(+0) === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-003.js
new file mode 100644 (file)
index 0000000..3a1a269
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.exp(-0) === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-004.js
new file mode 100644 (file)
index 0000000..a796cf1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.exp(Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-005.js
new file mode 100644 (file)
index 0000000..a796cf1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.exp(Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.08/15.08.02.08-006.js
new file mode 100644 (file)
index 0000000..ceaaf64
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.exp(-Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-001.js
new file mode 100644 (file)
index 0000000..7afdb92
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.floor(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-002.js
new file mode 100644 (file)
index 0000000..372ab8c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.floor(+0) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-003.js
new file mode 100644 (file)
index 0000000..d2d048c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1/Math.floor(-0) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-004.js
new file mode 100644 (file)
index 0000000..dd8c09d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.floor(Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-005.js
new file mode 100644 (file)
index 0000000..0834e07
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.floor(-Infinity) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-006.js
new file mode 100644 (file)
index 0000000..7f956a7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.floor(0.2) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-007.js
new file mode 100644 (file)
index 0000000..564fb17
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.floor(1.2) === -Math.ceil(-1.2));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-008.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.09/15.08.02.09-008.js
new file mode 100644 (file)
index 0000000..ebe07ed
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.floor(1.9) === -Math.ceil(-1.9));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-001.js
new file mode 100644 (file)
index 0000000..edf49fd
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.log(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-002.js
new file mode 100644 (file)
index 0000000..7377ffe
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.log(-0.00001)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-003.js
new file mode 100644 (file)
index 0000000..1ae1244
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.log(+0) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-004.js
new file mode 100644 (file)
index 0000000..5230ff7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.log(-0) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-005.js
new file mode 100644 (file)
index 0000000..51161b4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.log(1) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.10/15.08.02.10-006.js
new file mode 100644 (file)
index 0000000..7e47c50
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.log(Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-001.js
new file mode 100644 (file)
index 0000000..806e253
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.max(undefined)));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-002.js
new file mode 100644 (file)
index 0000000..1e962e8
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.max({})));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-003.js
new file mode 100644 (file)
index 0000000..d51d1bf
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.max(Object())));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-004.js
new file mode 100644 (file)
index 0000000..84aee29
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.max(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-005.js
new file mode 100644 (file)
index 0000000..2ab5942
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.max(5, 7, NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-006.js
new file mode 100644 (file)
index 0000000..cae433c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.max(5, -7, NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-007.js
new file mode 100644 (file)
index 0000000..e56890e
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.max(5, -7) === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-008.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-008.js
new file mode 100644 (file)
index 0000000..01099ba
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!isFinite(Math.max()));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-009.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-009.js
new file mode 100644 (file)
index 0000000..b534425
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.max() === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-010.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-010.js
new file mode 100644 (file)
index 0000000..5aad0a0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.max() !== Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-011.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-011.js
new file mode 100644 (file)
index 0000000..7b94122
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.max(+0, -0) === +0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-012.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-012.js
new file mode 100644 (file)
index 0000000..1a3e839
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof Math.max === "function");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-013.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-013.js
new file mode 100644 (file)
index 0000000..c5a17fb
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.max.length === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-014.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.11/15.08.02.11-014.js
new file mode 100644 (file)
index 0000000..dc32f60
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1/Math.max(-0, +0) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-001.js
new file mode 100644 (file)
index 0000000..637f1b2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.min(undefined)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-002.js
new file mode 100644 (file)
index 0000000..a9776a5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.min({})));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-003.js
new file mode 100644 (file)
index 0000000..bf98fc9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.min(Object())));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-004.js
new file mode 100644 (file)
index 0000000..651f304
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.min(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-005.js
new file mode 100644 (file)
index 0000000..9a3f5bb
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.min(5, 7, NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-006.js
new file mode 100644 (file)
index 0000000..5f49a17
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.min(5, -7, NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-007.js
new file mode 100644 (file)
index 0000000..2e7abbf
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.min(5, -7) === -7);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-008.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-008.js
new file mode 100644 (file)
index 0000000..19bfb9c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(!isFinite(Math.min()));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-009.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-009.js
new file mode 100644 (file)
index 0000000..f592d27
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.min() === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-010.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-010.js
new file mode 100644 (file)
index 0000000..b3b88b0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.min() !== -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-011.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-011.js
new file mode 100644 (file)
index 0000000..a56204b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.min(+0, -0) === +0);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-012.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-012.js
new file mode 100644 (file)
index 0000000..9df1e07
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(typeof Math.min === "function");
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-013.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-013.js
new file mode 100644 (file)
index 0000000..7d9d222
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.min.length === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-014.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.12/15.08.02.12-014.js
new file mode 100644 (file)
index 0000000..c6eca1f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1/Math.min(+0, -0) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-001.js
new file mode 100644 (file)
index 0000000..5821764
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.pow(2, "NaN", 5)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-002.js
new file mode 100644 (file)
index 0000000..335b8fe
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.pow(2, +0, 5, "qeqegfhb") === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-003.js
new file mode 100644 (file)
index 0000000..b8c9ced
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow(NaN, +0, 5, "qeqegfhb") === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-004.js
new file mode 100644 (file)
index 0000000..c1d2300
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow("qeqegfhb", -0) === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-005.js
new file mode 100644 (file)
index 0000000..9d1a1d9
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.pow("qeqegfhb", 1)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-006.js
new file mode 100644 (file)
index 0000000..21edf17
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow(5, Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-007.js
new file mode 100644 (file)
index 0000000..3af77ca
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.pow(5, -Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-008.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-008.js
new file mode 100644 (file)
index 0000000..a3aaaf4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.pow(-5, -Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-009.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-009.js
new file mode 100644 (file)
index 0000000..1cd3180
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(Math.pow(-5, Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-010.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-010.js
new file mode 100644 (file)
index 0000000..58ba5fa
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.pow(1, Infinity)));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-011.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-011.js
new file mode 100644 (file)
index 0000000..19a5276
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.pow(-1, Infinity)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-012.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-012.js
new file mode 100644 (file)
index 0000000..cbaaeee
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.pow(-1, -Infinity)));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-013.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-013.js
new file mode 100644 (file)
index 0000000..cca8010
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.pow(1, -Infinity)));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-014.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-014.js
new file mode 100644 (file)
index 0000000..88d6a34
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(1 / Math.pow(0.3, Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-015.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-015.js
new file mode 100644 (file)
index 0000000..1d12888
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow(-0.3, -Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-016.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-016.js
new file mode 100644 (file)
index 0000000..bb42c36
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow(Infinity, 3) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-017.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-017.js
new file mode 100644 (file)
index 0000000..a572f5d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.pow(Infinity, -3) === Infinity);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-018.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-018.js
new file mode 100644 (file)
index 0000000..422abfc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow(-Infinity, 6) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-019.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-019.js
new file mode 100644 (file)
index 0000000..f10e463
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow(-Infinity, 5) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-020.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-020.js
new file mode 100644 (file)
index 0000000..0bea157
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.pow(-Infinity, -6) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-021.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-021.js
new file mode 100644 (file)
index 0000000..7a29710
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.pow(-Infinity, -5) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-022.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-022.js
new file mode 100644 (file)
index 0000000..45de06b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.pow(+0, 5.2) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-023.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-023.js
new file mode 100644 (file)
index 0000000..e751597
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert(Math.pow(+0, -5.2) === Infinity);
+    
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-024.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-024.js
new file mode 100644 (file)
index 0000000..13b311c
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.pow(-0, 12) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-025.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-025.js
new file mode 100644 (file)
index 0000000..5ec6be8
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.pow(-0, 7) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-026.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-026.js
new file mode 100644 (file)
index 0000000..45970d4
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow(-0, -100) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-027.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-027.js
new file mode 100644 (file)
index 0000000..bf0504f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow(-0, -1) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-028.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-028.js
new file mode 100644 (file)
index 0000000..5587f5b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.pow(-174, 1.78)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-029.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-029.js
new file mode 100644 (file)
index 0000000..2e4f599
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow(2,2) === 4);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-030.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-030.js
new file mode 100644 (file)
index 0000000..b948dfc
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.pow("2   ","2.0") === 4);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-031.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.13/15.08.02.13-031.js
new file mode 100644 (file)
index 0000000..f51be66
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(isNaN(Math.pow(1, NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-001.js
new file mode 100644 (file)
index 0000000..e8c3863
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert (isNaN(Math.round(NaN)));
+
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-002.js
new file mode 100644 (file)
index 0000000..711aa28
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.round(+0) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-003.js
new file mode 100644 (file)
index 0000000..8df5d73
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.round(-0) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-004.js
new file mode 100644 (file)
index 0000000..ef59e22
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.round(Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-005.js
new file mode 100644 (file)
index 0000000..3eacc72
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.round(-Infinity) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-006.js
new file mode 100644 (file)
index 0000000..fced374
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.round(0.2) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.15/15.08.02.15-007.js
new file mode 100644 (file)
index 0000000..3eab02b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.round(-0.3) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-001.js
new file mode 100644 (file)
index 0000000..50be50a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.sin(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-002.js
new file mode 100644 (file)
index 0000000..5fc10f3
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.sin(+0) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-003.js
new file mode 100644 (file)
index 0000000..453a037
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.sin(-0) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-004.js
new file mode 100644 (file)
index 0000000..f449935
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.sin(Infinity)));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.16/15.08.02.16-005.js
new file mode 100644 (file)
index 0000000..0db3f42
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.sin(-Infinity)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-001.js
new file mode 100644 (file)
index 0000000..347783b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.sqrt(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-002.js
new file mode 100644 (file)
index 0000000..23260aa
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.sqrt(-2)));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-003.js
new file mode 100644 (file)
index 0000000..cf8d2df
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.sqrt(+0) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-004.js
new file mode 100644 (file)
index 0000000..e885aae
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.sqrt(-0) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.17/15.08.02.17-005.js
new file mode 100644 (file)
index 0000000..c8b1576
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (Math.sqrt(Infinity) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-001.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-001.js
new file mode 100644 (file)
index 0000000..df4506b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.tan(NaN)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-002.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-002.js
new file mode 100644 (file)
index 0000000..f0c8155
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.tan(Infinity)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-003.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-003.js
new file mode 100644 (file)
index 0000000..076ce32
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.tan(-Infinity)));
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-004.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-004.js
new file mode 100644 (file)
index 0000000..76d0a83
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.tan(+0) === Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-005.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-005.js
new file mode 100644 (file)
index 0000000..dd7836d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.tan(-0) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-006.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-006.js
new file mode 100644 (file)
index 0000000..7acf3ba
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (1/Math.tan(-0, NaN) === -Infinity);
diff --git a/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-007.js b/deps/jerry/tests/jerry-test-suite/15/15.08/15.08.02/15.08.02.18/15.08.02.18-007.js
new file mode 100644 (file)
index 0000000..f3c69d1
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN(Math.tan(undefined)));
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-001.js b/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-001.js
new file mode 100644 (file)
index 0000000..4741fc5
--- /dev/null
@@ -0,0 +1,41 @@
+/* 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.
+ */
+
+function test_set_prototype_of_error(o, proto, msg)
+{
+  var name = "";
+
+  try
+  {
+    Object.setPrototypeOf(o, proto);
+  }
+  catch (e)
+  {
+    name = e.name;
+  }
+
+  assert(name === "TypeError");
+
+  if (msg)
+  {
+    print(msg + " PASS (XFAIL)");
+  }
+}
+
+(function test_incoercible_o(undefined)
+{
+  test_set_prototype_of_error(undefined, new Object(), "Object.setPrototypeOf(undefined, ...)");
+  test_set_prototype_of_error(null, new Object(), "Object.setPrototypeOf(null, ...)");
+})();
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-002.js b/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-002.js
new file mode 100644 (file)
index 0000000..3f1c564
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+function test_set_prototype_of_error(o, proto, msg)
+{
+  var name = "";
+
+  try
+  {
+    Object.setPrototypeOf(o, proto);
+  }
+  catch (e)
+  {
+    name = e.name;
+  }
+
+  assert(name === "TypeError");
+
+  if (msg)
+  {
+    print(msg + " PASS (XFAIL)");
+  }
+}
+
+(function test_nonobject_proto(undefined)
+{
+  test_set_prototype_of_error(new Object(), undefined, "Object.setPrototypeOf(..., undefined)");
+  test_set_prototype_of_error(new Object(), true, "Object.setPrototypeOf(..., boolean)");
+  test_set_prototype_of_error(new Object(), 3.14, "Object.setPrototypeOf(..., number)");
+  test_set_prototype_of_error(new Object(), "xyz", "Object.setPrototypeOf(..., string)");
+})()
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-003.js b/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-003.js
new file mode 100644 (file)
index 0000000..442265e
--- /dev/null
@@ -0,0 +1,31 @@
+/* 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.
+ */
+
+function test_set_prototype_of_success(o, proto, msg)
+{
+  assert(o === Object.setPrototypeOf(o, proto));
+
+  if (msg)
+  {
+    print(msg + " PASS");
+  }
+}
+
+(function test_nonobject_o(undefined)
+{
+  test_set_prototype_of_success(true, new Object(), "Object.setPrototypeOf(boolean, ...)");
+  test_set_prototype_of_success(3.14, new Object(), "Object.setPrototypeOf(number, ...)");
+  test_set_prototype_of_success("xyz", new Object(), "Object.setPrototypeOf(string, ...)");
+})()
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-004.js b/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-004.js
new file mode 100644 (file)
index 0000000..3e93f7b
--- /dev/null
@@ -0,0 +1,56 @@
+/* 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.
+ */
+
+function test_set_prototype_of_error(o, proto, msg)
+{
+  var name = "";
+
+  try
+  {
+    Object.setPrototypeOf(o, proto);
+  }
+  catch (e)
+  {
+    name = e.name;
+  }
+
+  assert(name === "TypeError");
+
+  if (msg)
+  {
+    print(msg + " PASS (XFAIL)");
+  }
+}
+
+function test_set_prototype_of_success_set(o, proto, msg)
+{
+  assert(o === Object.setPrototypeOf(o, proto));
+  assert(proto === Object.getPrototypeOf(o));
+
+  if (msg)
+  {
+    print(msg + " PASS");
+  }
+}
+
+(function test_nonextensible_o(undefined)
+{
+  var o = new Object();
+  var o_proto = Object.getPrototypeOf(o);
+  Object.preventExtensions(o);
+
+  test_set_prototype_of_success_set(o, o_proto, "Object.setPrototypeOf(o_nonext, o_nonext.__proto__)");
+  test_set_prototype_of_error(o, new Object(), "Object.setPrototypeOf(o_nonext, ...)");
+})()
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-005.js b/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-005.js
new file mode 100644 (file)
index 0000000..98a82aa
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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.
+ */
+
+function test_set_prototype_of_error(o, proto, msg)
+{
+  var name = "";
+
+  try
+  {
+    Object.setPrototypeOf(o, proto);
+  }
+  catch (e)
+  {
+    name = e.name;
+  }
+
+  assert(name === "TypeError");
+
+  if (msg)
+  {
+    print(msg + " PASS (XFAIL)");
+  }
+}
+
+(function test_circularity(undefined)
+{
+  var o = new Object();
+
+  test_set_prototype_of_error(o, o, "Object.setPrototypeOf(o, o)");
+})()
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-006.js b/deps/jerry/tests/jerry-test-suite/es2015/19/19.01/19.01.02/19.01.02-006.js
new file mode 100644 (file)
index 0000000..caa9a26
--- /dev/null
@@ -0,0 +1,31 @@
+/* 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.
+ */
+
+function test_set_prototype_of_success_set(o, proto, msg)
+{
+  assert(o === Object.setPrototypeOf(o, proto));
+  assert(proto === Object.getPrototypeOf(o));
+
+  if (msg)
+  {
+    print(msg + " PASS");
+  }
+}
+
+(function test_set_prototype_of(undefined)
+{
+  test_set_prototype_of_success_set(new Object(), new Object(), "Object.setPrototypeOf(o1, o2)");
+  test_set_prototype_of_success_set(new Object(), null, "Object.setPrototypeOf(o, null)");
+})()
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-001.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-001.js
new file mode 100644 (file)
index 0000000..31ac6d7
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new Int8Array();
+assert(a instanceof Int8Array);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-002.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-002.js
new file mode 100644 (file)
index 0000000..945b03f
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new Int8Array(5);
+assert(a instanceof Int8Array);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-003.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-003.js
new file mode 100644 (file)
index 0000000..8eb1d64
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new Int8Array('5');
+assert(a instanceof Int8Array);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-004.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-004.js
new file mode 100644 (file)
index 0000000..10c2e81
--- /dev/null
@@ -0,0 +1,18 @@
+/* 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.
+ */
+
+var a = new Int8Array(5);
+var b = new Int8Array(a);
+assert(a instanceof Int8Array);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-005.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-005.js
new file mode 100644 (file)
index 0000000..325ac04
--- /dev/null
@@ -0,0 +1,18 @@
+/* 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.
+ */
+
+var a = new ArrayBuffer(5);
+var b = new Int8Array(a);
+assert(b instanceof Int8Array);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-006.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-006.js
new file mode 100644 (file)
index 0000000..4d13e21
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new Int8Array([1,2,3]);
+assert(a instanceof Int8Array);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-007.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-007.js
new file mode 100644 (file)
index 0000000..8dd3de8
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new Int8Array(5);
+assert(a[2] === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-008.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-008.js
new file mode 100644 (file)
index 0000000..3906d67
--- /dev/null
@@ -0,0 +1,18 @@
+/* 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.
+ */
+
+var a = new Int8Array([1.5,1000,-9]);
+a[2] = a[1] * a[0]; //a[0] = 1; a[1] = -24 (because 1000 is 0x3e8, convert to int8 is 0xe8)
+assert(a[2] === -24);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-009.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-009.js
new file mode 100644 (file)
index 0000000..7bf38fa
--- /dev/null
@@ -0,0 +1,18 @@
+/* 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.
+ */
+
+Int8Array.prototype[10] = 10;
+var a = new Int8Array(5);
+assert(a[10] === undefined); //Indexed properties will never look at prototype
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-010.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-010.js
new file mode 100644 (file)
index 0000000..c923db7
--- /dev/null
@@ -0,0 +1,29 @@
+/* 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.
+ */
+
+var a = new Float32Array([0.1, -3.4, 65535.9]);
+var b = new Int16Array(a);
+var c = new Uint8Array(a);
+var d = new Int32Array(a);
+
+assert(b[0] === 0);
+assert(b[1] === -3);
+assert(b[2] === -1);
+assert(c[0] === 0);
+assert(c[1] === 253);
+assert(c[2] === 255);
+assert(d[0] === 0);
+assert(d[1] === -3);
+assert(d[2] === 65535);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-011.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-011.js
new file mode 100644 (file)
index 0000000..0f90ce2
--- /dev/null
@@ -0,0 +1,21 @@
+/* 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.
+ */
+
+var a = new Uint8ClampedArray([1.5, 2.5, -1.5, 10000]);
+
+assert(a[0] === 2);
+assert(a[1] === 2);
+assert(a[2] === 0);
+assert(a[3] === 255);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-012.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-012.js
new file mode 100644 (file)
index 0000000..e2c90a3
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+var a = new Float64Array(2);
+
+a[0] = 0.1;
+a[1] = -2.3;
+
+assert(a[0] === 0.1);
+assert(a[1] === -2.3);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-013.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-013.js
new file mode 100644 (file)
index 0000000..26b6e5b
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+var a = new Float32Array(2);
+
+a[0] = 0.1;
+a[1] = -2.3;
+
+assert(a[0] === 0.10000000149011612);
+assert(a[1] === -2.299999952316284);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-014.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-014.js
new file mode 100644 (file)
index 0000000..86c75ae
--- /dev/null
@@ -0,0 +1,24 @@
+/* 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.
+ */
+
+var a = new Int16Array(3);
+
+a[0] = 0xffff;
+a[1] = 0xff0001;
+a[2] = -2.3;
+
+assert(a[0] === -1);
+assert(a[1] === 1);
+assert(a[2] === -2);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-015.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-015.js
new file mode 100644 (file)
index 0000000..5fb7709
--- /dev/null
@@ -0,0 +1,34 @@
+/* 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.
+ */
+
+var a = new Int32Array(8);
+
+a[0] = 0xffffffff;
+a[1] = 0xff00000001;
+a[2] = 0xff80000001;
+a[3] = -2.3;
+a[4] = Number.NEGATIVE_INFINITY;
+a[5] = NaN;
+a[6] = 10e17;
+a[7] = -10e17;
+
+assert(a[0] === -1);
+assert(a[1] === 1);
+assert(a[2] === -2147483647);
+assert(a[3] === -2);
+assert(a[4] === 0);
+assert(a[5] === 0);
+assert(a[6] === -1486618624);
+assert(a[7] === 1486618624);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-016.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-016.js
new file mode 100644 (file)
index 0000000..2bf7766
--- /dev/null
@@ -0,0 +1,24 @@
+/* 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.
+ */
+
+var a = new Int8Array(3);
+
+a[0] = 0xff;
+a[1] = 0xff01;
+a[2] = -2.3;
+
+assert(a[0] === -1);
+assert(a[1] === 1);
+assert(a[2] === -2);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-017.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-017.js
new file mode 100644 (file)
index 0000000..7bdce3d
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+var a = new Uint32Array(2);
+
+a[0] = 0x123456789A;
+a[1] = -2.3;
+
+assert(a[0] === 0x3456789A);
+assert(a[1] === 4294967294); // 0x100000000 - 2
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-018.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-018.js
new file mode 100644 (file)
index 0000000..a56998f
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+var a = new Uint16Array(2);
+
+a[0] = 0x123456789A;
+a[1] = -2.3;
+
+assert(a[0] === 0x789A);
+assert(a[1] === 65534); // 0x10000 - 2
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-019.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-019.js
new file mode 100644 (file)
index 0000000..2debbc4
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+var a = new Uint8Array(2);
+
+a[0] = 0x123456789A;
+a[1] = -2.3;
+
+assert(a[0] === 0x9A);
+assert(a[1] === 254); // 0x100 - 2
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-020.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-020.js
new file mode 100644 (file)
index 0000000..8e59583
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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.
+ */
+
+var name = "";
+
+try
+{
+  new Int16Array(Float32Array.prototype);
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "TypeError");
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-021.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-021.js
new file mode 100644 (file)
index 0000000..1f668bf
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+var a = new Float32Array([0.1, 0.2, 0.3]);
+
+var b = a.hasOwnProperty(1);
+var c = a.hasOwnProperty(3);
+
+assert (b === true);
+assert (c === false);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-001.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-001.js
new file mode 100644 (file)
index 0000000..5819748
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = Object.getPrototypeOf(Int8Array);
+assert(a.name === "TypedArray");
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-002.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-002.js
new file mode 100644 (file)
index 0000000..1629ebc
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = Object.getPrototypeOf(Int8Array);
+assert(a.length === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-003.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-003.js
new file mode 100644 (file)
index 0000000..8d40231
--- /dev/null
@@ -0,0 +1,19 @@
+/* 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.
+ */
+
+var a = Object.getPrototypeOf(Int8Array);
+var b = new Int8Array();
+var c = Object.getPrototypeOf(Object.getPrototypeOf(b));
+assert(c === a.prototype);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-004.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-004.js
new file mode 100644 (file)
index 0000000..198dc71
--- /dev/null
@@ -0,0 +1,25 @@
+/* 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.
+ */
+
+function foo(v, k)
+{
+  return this.num + v + k;
+}
+
+var a = Float32Array.from([10,20,30], foo, {num:0.5});
+
+assert(a[0] === 10.5);
+assert(a[1] === 21.5);
+assert(a[2] === 32.5);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-005.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.02/22.02.02-005.js
new file mode 100644 (file)
index 0000000..b7d575c
--- /dev/null
@@ -0,0 +1,66 @@
+/* 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.
+ */
+
+var name = "";
+
+try
+{
+  Int16Array.from.call(1);
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "TypeError");
+
+name = "";
+
+try
+{
+  Int16Array.from.call(Float32Array);
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "TypeError");
+
+name = "";
+
+try
+{
+  Int16Array.from.call(Float32Array, [1,2,3], 1);
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "TypeError");
+
+name = "";
+
+try
+{
+  Int16Array.from.call(Number, [1,2,3]);
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "TypeError");
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-001.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-001.js
new file mode 100644 (file)
index 0000000..f685f70
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new Int8Array(5);
+assert(a.length === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-002.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-002.js
new file mode 100644 (file)
index 0000000..d4772ba
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new Int8Array(5);
+assert(a.byteOffset === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-003.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-003.js
new file mode 100644 (file)
index 0000000..c5a081c
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new Int8Array(5);
+assert(a.byteLength === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-004.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-004.js
new file mode 100644 (file)
index 0000000..1984b9a
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new Int8Array(5);
+assert(a.buffer instanceof ArrayBuffer);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-005.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-005.js
new file mode 100644 (file)
index 0000000..5fd2dcd
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+var a = new Int8Array([1,2,3,4,5]);
+var b = new Int8Array(a.buffer, 2, 3);
+
+assert(a.buffer === b.buffer);
+assert(b.length === 3);
+assert(b.byteOffset === 2);
+assert(b.byteLength === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-006.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-006.js
new file mode 100644 (file)
index 0000000..0bbd895
--- /dev/null
@@ -0,0 +1,20 @@
+/* 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.
+ */
+
+var a = new Int8Array([1,2,3,4,5]);
+var b = new Int8Array(a.buffer, 2, 3);
+
+b[0] = 5.6;
+assert(a[2] === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-007.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-007.js
new file mode 100644 (file)
index 0000000..82938ab
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+var a = new Uint8Array([10, 20, 30, 40]);
+var o = {
+  "small":0,
+  "large":0
+};
+var func = function(v, k)
+{
+  if (v < 25)
+  {
+    this.small = this.small + k;
+  }
+  else
+  {
+    this.large = this.large + k;
+  }
+}
+
+var ret = a.forEach(func, o);
+
+assert(ret === undefined);
+assert(o.small === 1); // 0+1
+assert(o.large === 5); // 2+3
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-008.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-008.js
new file mode 100644 (file)
index 0000000..71b3060
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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.
+ */
+
+var a = new Uint8Array([1, 2, 3]);
+
+var b = a.map(function(num) {
+  return num * 2;
+});
+
+assert(a[0] === 1);
+assert(a[1] === 2);
+assert(a[2] === 3);
+assert(b[0] === 2);
+assert(b[1] === 4);
+assert(b[2] === 6);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-009.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-009.js
new file mode 100644 (file)
index 0000000..ab21383
--- /dev/null
@@ -0,0 +1,28 @@
+/* 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.
+ */
+
+var a = new Uint8Array([1, 2, 3, 4]);
+var count = 0;
+
+function f_every(num)
+{
+  count++;
+  return num < 3;
+}
+
+var ret = a.every(f_every);
+
+assert(ret === false);
+assert(count === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-010.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-010.js
new file mode 100644 (file)
index 0000000..d91dabe
--- /dev/null
@@ -0,0 +1,28 @@
+/* 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.
+ */
+
+var a = new Uint8Array([1, 2, 3, 4]);
+var count = 0;
+
+function f_some(num)
+{
+  count++;
+  return num > 3;
+}
+
+var ret = a.some(f_some);
+
+assert(ret === true);
+assert(count === 4);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-011.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-011.js
new file mode 100644 (file)
index 0000000..6ea976b
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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.
+ */
+
+var a = new Float32Array([1.25, 2.5, 3.75]);
+
+var b = a.map(function(num) {
+  return num * 2;
+});
+
+assert(a[0] === 1.25);
+assert(a[1] === 2.5);
+assert(a[2] === 3.75);
+assert(b[0] === 2.5);
+assert(b[1] === 5);
+assert(b[2] === 7.5);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-012.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-012.js
new file mode 100644 (file)
index 0000000..c525112
--- /dev/null
@@ -0,0 +1,28 @@
+/* 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.
+ */
+
+var a = new Float32Array([1.1, 2.2, 3.3, 4.4]);
+var count = 0;
+
+function f_every(num)
+{
+  count++;
+  return num < 3;
+}
+
+var ret = a.every(f_every);
+
+assert(ret === false);
+assert(count === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-013.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-013.js
new file mode 100644 (file)
index 0000000..76c148a
--- /dev/null
@@ -0,0 +1,28 @@
+/* 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.
+ */
+
+var a = new Float32Array([1.1, 2.2, 3.3, 4.4]);
+var count = 0;
+
+function f_some(num)
+{
+  count++;
+  return num > 3;
+}
+
+var ret = a.some(f_some);
+
+assert(ret === true);
+assert(count === 3);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-014.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-014.js
new file mode 100644 (file)
index 0000000..7b48b80
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+var a = new Float32Array([-1.1, 0.1, 2.5, 3.0]);
+var o = {
+  "small":0,
+  "large":0
+};
+var func = function(v, k)
+{
+  if (v < 2)
+  {
+    this.small = this.small + k;
+  }
+  else
+  {
+    this.large = this.large + k;
+  }
+}
+
+var ret = a.forEach(func, o);
+
+assert(ret === undefined);
+assert(o.small === 1); // 0+1
+assert(o.large === 5); // 2+3
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-015.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-015.js
new file mode 100644 (file)
index 0000000..2ea4247
--- /dev/null
@@ -0,0 +1,20 @@
+/* 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.
+ */
+
+var total = new Float32Array([-1.5, 0, 1.5, 2]).reduce(function(a, b, c) {
+  return a + b + c;
+}, 10);
+
+assert(total === 18); // 10 + (-1.5) + 0 + 0 + 1 + 1.5 + 2 + 2 + 3
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-016.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-016.js
new file mode 100644 (file)
index 0000000..4e5950c
--- /dev/null
@@ -0,0 +1,20 @@
+/* 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.
+ */
+
+var total = new Float32Array([-1.5, 0, 1.5, 2]).reduceRight(function(a, b) {
+  return a - b;
+});
+
+assert (total === 2) // 2 - 1.5 - 0 - (-1.5)
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-017.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-017.js
new file mode 100644 (file)
index 0000000..95767bd
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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.
+ */
+
+var a = new Float32Array([-1.5, 0, 1.5, 2]);
+var b = a.filter(function(x){
+  return x > 0;
+});
+
+assert(a[0] === -1.5);
+assert(a[1] === 0);
+assert(a[2] === 1.5);
+assert(a[3] === 2);
+assert(b[0] === 1.5);
+assert(b[1] === 2);
+assert(b.length === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-018.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.03/22.02.03-018.js
new file mode 100644 (file)
index 0000000..a55d5ea
--- /dev/null
@@ -0,0 +1,23 @@
+/* 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.
+ */
+
+
+var a = new Float32Array([-1.5, 0, 1.5]);
+var b = a.reverse()
+
+assert(a === b);
+assert(a[0] === 1.5);
+assert(a[1] === 0);
+assert(a[2] === -1.5);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.05/22.02.05-001.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.05/22.02.05-001.js
new file mode 100644 (file)
index 0000000..f074acb
--- /dev/null
@@ -0,0 +1,25 @@
+/* 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.
+ */
+
+assert(Int8Array.BYTES_PER_ELEMENT === 1);
+assert(Uint8Array.BYTES_PER_ELEMENT === 1);
+assert(Uint8ClampedArray.BYTES_PER_ELEMENT === 1);
+assert(Int16Array.BYTES_PER_ELEMENT === 2);
+assert(Uint16Array.BYTES_PER_ELEMENT === 2);
+assert(Int32Array.BYTES_PER_ELEMENT === 4);
+assert(Uint32Array.BYTES_PER_ELEMENT === 4);
+assert(Float32Array.BYTES_PER_ELEMENT === 4);
+assert(Float64Array.BYTES_PER_ELEMENT === 8);
+
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.06/22.02.06-001.js b/deps/jerry/tests/jerry-test-suite/es2015/22/22.02/22.02.06/22.02.06-001.js
new file mode 100644 (file)
index 0000000..2c139d4
--- /dev/null
@@ -0,0 +1,24 @@
+/* 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.
+ */
+
+assert(Int8Array.prototype.BYTES_PER_ELEMENT === 1);
+assert(Uint8Array.prototype.BYTES_PER_ELEMENT === 1);
+assert(Uint8ClampedArray.prototype.BYTES_PER_ELEMENT === 1);
+assert(Int16Array.prototype.BYTES_PER_ELEMENT === 2);
+assert(Uint16Array.prototype.BYTES_PER_ELEMENT === 2);
+assert(Int32Array.prototype.BYTES_PER_ELEMENT === 4);
+assert(Uint32Array.prototype.BYTES_PER_ELEMENT === 4);
+assert(Float32Array.prototype.BYTES_PER_ELEMENT === 4);
+assert(Float64Array.prototype.BYTES_PER_ELEMENT === 8);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-001.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-001.js
new file mode 100644 (file)
index 0000000..e8794a2
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new ArrayBuffer();
+assert(typeof a === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-002.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-002.js
new file mode 100644 (file)
index 0000000..85de9e6
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new ArrayBuffer(5);
+assert(typeof a === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-003.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-003.js
new file mode 100644 (file)
index 0000000..1d47d46
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new ArrayBuffer("5");
+assert(typeof a === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-004.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-004.js
new file mode 100644 (file)
index 0000000..a3f421c
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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.
+ */
+
+var name = "";
+
+try
+{
+  var a = ArrayBuffer();
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "TypeError");
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-005.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-005.js
new file mode 100644 (file)
index 0000000..8a236c8
--- /dev/null
@@ -0,0 +1,16 @@
+/* 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.
+ */
+
+assert(ArrayBuffer.length === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-006.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-006.js
new file mode 100644 (file)
index 0000000..ceb35a6
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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.
+ */
+
+var name = "";
+
+try
+{
+  var a = new ArrayBuffer(5.5);
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "RangeError");
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-007.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-007.js
new file mode 100644 (file)
index 0000000..f0d49c9
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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.
+ */
+
+var name = "";
+
+try
+{
+  var a = new ArrayBuffer("string");
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "RangeError");
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-008.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.02/24.01.02-008.js
new file mode 100644 (file)
index 0000000..4bd7dc6
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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.
+ */
+
+var name = "";
+var obj = {};
+try
+{
+  var a = new ArrayBuffer(obj);
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "RangeError");
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.03/24.01.03-001.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.03/24.01.03-001.js
new file mode 100644 (file)
index 0000000..8195fe6
--- /dev/null
@@ -0,0 +1,16 @@
+/* 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.
+ */
+
+assert(typeof ArrayBuffer.prototype === 'object');
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-001.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-001.js
new file mode 100644 (file)
index 0000000..2a1b3f3
--- /dev/null
@@ -0,0 +1,16 @@
+/* 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.
+ */
+
+assert(ArrayBuffer.prototype.constructor === ArrayBuffer);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-002.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-002.js
new file mode 100644 (file)
index 0000000..61e2db5
--- /dev/null
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+var a = new ArrayBuffer(5);
+assert(a.byteLength === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-003.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-003.js
new file mode 100644 (file)
index 0000000..fd37447
--- /dev/null
@@ -0,0 +1,18 @@
+/* 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.
+ */
+
+var a = new ArrayBuffer(5);
+a.byteLength = 10;
+assert(a.byteLength === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-004.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-004.js
new file mode 100644 (file)
index 0000000..6f38ab1
--- /dev/null
@@ -0,0 +1,18 @@
+/* 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.
+ */
+
+var a = new ArrayBuffer(5);
+var b = a.slice (1, 3);
+assert(b.byteLength === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-005.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-005.js
new file mode 100644 (file)
index 0000000..d19ca20
--- /dev/null
@@ -0,0 +1,18 @@
+/* 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.
+ */
+
+var a = new ArrayBuffer(5);
+var b = a.slice(1, -2);
+assert(b.byteLength === 2);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-006.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-006.js
new file mode 100644 (file)
index 0000000..f55f339
--- /dev/null
@@ -0,0 +1,18 @@
+/* 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.
+ */
+
+var a = new ArrayBuffer(5);
+var b = a.slice (3, 2);
+assert(b.byteLength === 0);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-007.js b/deps/jerry/tests/jerry-test-suite/es2015/24/24.01/24.01.04/24.01.04-007.js
new file mode 100644 (file)
index 0000000..f3897de
--- /dev/null
@@ -0,0 +1,18 @@
+/* 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.
+ */
+
+var a = new ArrayBuffer(5);
+var b = a.slice();
+assert(b.byteLength === 5);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.03/25.04.03-001.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.03/25.04.03-001.js
new file mode 100644 (file)
index 0000000..6605999
--- /dev/null
@@ -0,0 +1,20 @@
+/* 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.
+ */
+
+function foo() {};
+
+var a = new Promise(foo);
+
+assert (a instanceof Promise);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.03/25.04.03-002.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.03/25.04.03-002.js
new file mode 100644 (file)
index 0000000..37aad00
--- /dev/null
@@ -0,0 +1,50 @@
+/* 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.
+ */
+
+var name1 = "";
+var name2 = "";
+var name3 = "";
+function foo() {};
+
+try
+{
+  new Promise();
+}
+catch (e)
+{
+  name1 = e.name;
+}
+
+try
+{
+  Promise(foo);
+}
+catch (e)
+{
+  name2 = e.name;
+}
+
+try
+{
+  new Promise("string");
+}
+catch (e)
+{
+  name3 = e.name;
+}
+
+assert (name1 === "TypeError");
+assert (name2 === "TypeError");
+assert (name3 === "TypeError");
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-001.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-001.js
new file mode 100644 (file)
index 0000000..73c6ae9
--- /dev/null
@@ -0,0 +1,19 @@
+/* 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.
+ */
+
+Promise.resolve("abc").then(function(x)
+{
+  assert (x === "abc");
+});
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-002.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-002.js
new file mode 100644 (file)
index 0000000..8445a40
--- /dev/null
@@ -0,0 +1,25 @@
+/* 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.
+ */
+
+var a = new Promise(function(f)
+{
+  var o = {name: "abc"};
+  f(o);
+})
+
+Promise.resolve(a).then(function(x)
+{
+  assert (x.name === "abc");
+});
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-003.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-003.js
new file mode 100644 (file)
index 0000000..ea6570d
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+Promise.reject("abc").then(function(x)
+{
+  assert (false); // should not run here.
+}, function(x)
+{
+  assert (x === "abc");
+});
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-004.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-004.js
new file mode 100644 (file)
index 0000000..b5e01d2
--- /dev/null
@@ -0,0 +1,49 @@
+/* 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.
+ */
+
+var a = Promise.resolve('a');
+var b = Promise.reject('b');
+
+Promise.race([a, b]).then(function(x)
+{
+  assert (x === 'a');
+}, function(x)
+{
+  assert (false); // should not run here.
+});
+
+Promise.race([b, a]).then(function(x)
+{
+  assert (false); // should not run here.
+}, function(x)
+{
+  assert (x === 'b');
+});
+
+Promise.race([ ,b, a]).then(function(x)
+{
+  assert (x === undefined);
+}, function(x)
+{
+  assert (false); // should not run here.
+});
+
+Promise.race(a).then(function(x)
+{
+  assert (false); // should not run here.
+}, function(x)
+{
+  assert(x.name === "TypeError");
+});
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-005.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.04/25.04.04-005.js
new file mode 100644 (file)
index 0000000..ac56e60
--- /dev/null
@@ -0,0 +1,52 @@
+/* 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.
+ */
+
+var a = Promise.resolve('a');
+var b = Promise.resolve('b');
+var c = Promise.reject('c');
+
+Promise.all([a, b, 1]).then(function(x)
+{
+  assert (x[0] === 'a');
+  assert (x[1] === 'b');
+  assert (x[2] === 1);
+}, function(x)
+{
+  assert (false); // should not run here.
+});
+
+Promise.all([a, b, c, 1]).then(function(x)
+{
+  assert (false); // should not run here.
+}, function(x)
+{
+  assert (x === 'c');
+});
+
+Promise.all([]).then(function(x)
+{
+  assert (x.length === 0);
+}, function(x)
+{
+  assert (false); // should not run here.
+});
+
+Promise.all(a).then(function(x)
+{
+  assert (false); // should not run here.
+}, function(x)
+{
+  assert(x.name === "TypeError");
+});
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-001.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-001.js
new file mode 100644 (file)
index 0000000..0b3218a
--- /dev/null
@@ -0,0 +1,16 @@
+/* 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.
+ */
+
+assert (Promise.prototype.length === 1);
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-002.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-002.js
new file mode 100644 (file)
index 0000000..c1e7584
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+var obj = {name:""};
+
+var a = new Promise(function(f, r){
+  obj.name = obj.name + "a";
+  f(obj);
+});
+
+a.then(function(x) {
+  x.name = x.name + "b";
+  return x;
+}).then(null, function(x) {
+  x.name = x.name + "c"; // unreachable
+  return x;
+}).then(function(x) {
+  x.name = x.name + "d";
+  assert (obj.name === "aebd");
+});
+
+obj.name = obj.name + "e";
+
+assert (obj.name === "ae")
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-003.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-003.js
new file mode 100644 (file)
index 0000000..6b4b90f
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+var a = new Promise(function(f, r){
+  r(0);
+});
+
+a
+.then(function f1(x) {
+  return x + 1; // unreachable
+}, function r1(x){
+  return x + 10;
+})
+.then(function f2(x) {
+  throw x + 100
+})
+.then(function f3(x) {
+  return x + 1000 //unreachable
+}, function r3(x) {
+  return x + 10000
+})
+.then(function(x) {
+  assert (x === 10110);
+})
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-004.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-004.js
new file mode 100644 (file)
index 0000000..ce47a9a
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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.
+ */
+
+var a = new Promise(function(f, r){
+  f("a");
+});
+
+var b = new Promise(function(f, r){
+  f(a);
+})
+
+b.then(function(x) {
+  assert (x === "a");
+})
diff --git a/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-005.js b/deps/jerry/tests/jerry-test-suite/es2015/25/25.04/25.04.05/25.04.05-005.js
new file mode 100644 (file)
index 0000000..e0c5a2b
--- /dev/null
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+Promise.reject("abc").catch(function(x)
+{
+  assert (x === "abc");
+  return "def";
+}).then(function(x) {
+  assert (x === "def");
+});
diff --git a/deps/jerry/tests/jerry-test-suite/es51-profile-list b/deps/jerry/tests/jerry-test-suite/es51-profile-list
new file mode 100644 (file)
index 0000000..42d0ced
--- /dev/null
@@ -0,0 +1,1468 @@
+./06/06-001.js
+./06/06-002.js
+./06/06-003.js
+./06/06-004.js
+./06/06-005.js
+./07/07.06/07.06.01/07.06.01-001.js
+./07/07.08/07.08.05/07.08.05-001.js
+./07/07.09/07.09-001.js
+./07/07.09/07.09-002.js
+./07/07.09/07.09-003.js
+./07/07.09/07.09-004.js
+./07/07.09/07.09-005.js
+./07/07.09/07.09-006.js
+./07/07.09/07.09-007.js
+./07/07.09/07.09-008.js
+./07/07.09/07.09-009.js
+./07/07.09/07.09-010.js
+./08/08.01/08.01-001.js
+./08/08.01/08.01-002.js
+./08/08.01/08.01-003.js
+./08/08.01/08.01-004.js
+./08/08.01/08.01-005.js
+./08/08.01/08.01-006.js
+./08/08.01/08.01-007.js
+./08/08.01/08.01-008.js
+./08/08.01/08.01-009.js
+./08/08.01/08.01-010.js
+./08/08.01/08.01-011.js
+./08/08.02/08.02-001.js
+./08/08.02/08.02-002.js
+./08/08.03/08.03-001.js
+./08/08.03/08.03-002.js
+./08/08.03/08.03-003.js
+./08/08.03/08.03-004.js
+./08/08.04/08.04-001.js
+./08/08.04/08.04-002.js
+./08/08.04/08.04-003.js
+./08/08.04/08.04-004.js
+./08/08.04/08.04-005.js
+./08/08.04/08.04-006.js
+./08/08.04/08.04-007.js
+./08/08.04/08.04-008.js
+./08/08.04/08.04-009.js
+./08/08.04/08.04-010.js
+./08/08.04/08.04-011.js
+./08/08.04/08.04-012.js
+./08/08.04/08.04-013.js
+./08/08.04/08.04-014.js
+./08/08.04/08.04-015.js
+./08/08.04/08.04-016.js
+./08/08.04/08.04-017.js
+./08/08.05/08.05-001.js
+./08/08.05/08.05-002.js
+./08/08.05/08.05-003.js
+./08/08.12/08.12.02/08.12.02-001.js
+./10/10.03/10.03.01/10.03.01-001.js
+./11/11.01/11.01.05/11.01.05-001.js
+./11/11.01/11.01.05/11.01.05-002.js
+./11/11.01/11.01.05/11.01.05-003.js
+./11/11.01/11.01.05/11.01.05-004.js
+./11/11.01/11.01.05/11.01.05-005.js
+./11/11.01/11.01.05/11.01.05-006.js
+./11/11.01/11.01.05/11.01.05-007.js
+./11/11.01/11.01.05/11.01.05-008.js
+./11/11.01/11.01.06/11.01.06-001.js
+./11/11.01/11.01.06/11.01.06-002.js
+./11/11.01/11.01.06/11.01.06-003.js
+./11/11.01/11.01.06/11.01.06-004.js
+./11/11.01/11.01.06/11.01.06-005.js
+./11/11.01/11.01.06/11.01.06-006.js
+./11/11.01/11.01.06/11.01.06-009.js
+./11/11.02/11.02.01/11.02.01-001.js
+./11/11.02/11.02.01/11.02.01-002.js
+./11/11.02/11.02.01/11.02.01-003.js
+./11/11.02/11.02.01/11.02.01-004.js
+./11/11.02/11.02.01/11.02.01-007.js
+./11/11.02/11.02.01/11.02.01-008.js
+./11/11.02/11.02.01/11.02.01-009.js
+./11/11.02/11.02.01/11.02.01-010.js
+./11/11.02/11.02.01/11.02.01-011.js
+./11/11.02/11.02.02/11.02.02-001.js
+./11/11.02/11.02.02/11.02.02-002.js
+./11/11.02/11.02.02/11.02.02-003.js
+./11/11.02/11.02.02/11.02.02-004.js
+./11/11.02/11.02.02/11.02.02-005.js
+./11/11.02/11.02.02/11.02.02-006.js
+./11/11.02/11.02.02/11.02.02-007.js
+./11/11.02/11.02.02/11.02.02-008.js
+./11/11.02/11.02.02/11.02.02-009.js
+./11/11.02/11.02.03/11.02.03-006.js
+./11/11.02/11.02.03/11.02.03-007.js
+./11/11.02/11.02.03/11.02.03-008.js
+./11/11.02/11.02.03/11.02.03-017.js
+./11/11.02/11.02.03/11.02.03-021.js
+./11/11.02/11.02.04/11.02.04-001.js
+./11/11.02/11.02.04/11.02.04-002.js
+./11/11.02/11.02.04/11.02.04-003.js
+./11/11.02/11.02.04/11.02.04-004.js
+./11/11.02/11.02.04/11.02.04-005.js
+./11/11.02/11.02.04/11.02.04-006.js
+./11/11.02/11.02.04/11.02.04-007.js
+./11/11.02/11.02.04/11.02.04-008.js
+./11/11.02/11.02.04/11.02.04-009.js
+./11/11.02/11.02.04/11.02.04-010.js
+./11/11.02/11.02.04/11.02.04-011.js
+./11/11.02/11.02.04/11.02.04-012.js
+./11/11.02/11.02.04/11.02.04-013.js
+./11/11.02/11.02.04/11.02.04-014.js
+./11/11.02/11.02.04/11.02.04-016.js
+./11/11.02/11.02.04/11.02.04-017.js
+./11/11.02/11.02.04/11.02.04-018.js
+./11/11.02/11.02.04/11.02.04-019.js
+./11/11.03/11.03.01/11.03.01-005.js
+./11/11.03/11.03.01/11.03.01-006.js
+./11/11.03/11.03.01/11.03.01-007.js
+./11/11.03/11.03.01/11.03.01-008.js
+./11/11.03/11.03.01/11.03.01-009.js
+./11/11.03/11.03.01/11.03.01-010.js
+./11/11.03/11.03.01/11.03.01-011.js
+./11/11.03/11.03.01/11.03.01-012.js
+./11/11.03/11.03.01/11.03.01-013.js
+./11/11.03/11.03.01/11.03.01-014.js
+./11/11.03/11.03.01/11.03.01-015.js
+./11/11.03/11.03.01/11.03.01-016.js
+./11/11.03/11.03.02/11.03.02-005.js
+./11/11.03/11.03.02/11.03.02-006.js
+./11/11.03/11.03.02/11.03.02-007.js
+./11/11.03/11.03.02/11.03.02-008.js
+./11/11.03/11.03.02/11.03.02-009.js
+./11/11.03/11.03.02/11.03.02-010.js
+./11/11.03/11.03.02/11.03.02-011.js
+./11/11.03/11.03.02/11.03.02-012.js
+./11/11.03/11.03.02/11.03.02-013.js
+./11/11.03/11.03.02/11.03.02-014.js
+./11/11.03/11.03.02/11.03.02-015.js
+./11/11.03/11.03.02/11.03.02-016.js
+./11/11.04/11.04.01/11.04.01-001.js
+./11/11.04/11.04.01/11.04.01-002.js
+./11/11.04/11.04.01/11.04.01-003.js
+./11/11.04/11.04.01/11.04.01-004.js
+./11/11.04/11.04.01/11.04.01-005.js
+./11/11.04/11.04.01/11.04.01-006.js
+./11/11.04/11.04.01/11.04.01-007.js
+./11/11.04/11.04.01/11.04.01-008.js
+./11/11.04/11.04.01/11.04.01-009.js
+./11/11.04/11.04.01/11.04.01-010.js
+./11/11.04/11.04.01/11.04.01-011.js
+./11/11.04/11.04.01/11.04.01-012.js
+./11/11.04/11.04.01/11.04.01-013.js
+./11/11.04/11.04.01/11.04.01-017.js
+./11/11.04/11.04.02/11.04.02-001.js
+./11/11.04/11.04.02/11.04.02-002.js
+./11/11.04/11.04.03/11.04.03-001.js
+./11/11.04/11.04.03/11.04.03-002.js
+./11/11.04/11.04.03/11.04.03-003.js
+./11/11.04/11.04.03/11.04.03-004.js
+./11/11.04/11.04.03/11.04.03-005.js
+./11/11.04/11.04.03/11.04.03-006.js
+./11/11.04/11.04.03/11.04.03-007.js
+./11/11.04/11.04.03/11.04.03-008.js
+./11/11.04/11.04.03/11.04.03-009.js
+./11/11.04/11.04.03/11.04.03-010.js
+./11/11.04/11.04.03/11.04.03-011.js
+./11/11.04/11.04.03/11.04.03-012.js
+./11/11.04/11.04.03/11.04.03-013.js
+./11/11.04/11.04.03/11.04.03-016.js
+./11/11.04/11.04.04/11.04.04-001.js
+./11/11.04/11.04.04/11.04.04-002.js
+./11/11.04/11.04.04/11.04.04-004.js
+./11/11.04/11.04.04/11.04.04-005.js
+./11/11.04/11.04.04/11.04.04-006.js
+./11/11.04/11.04.04/11.04.04-007.js
+./11/11.04/11.04.04/11.04.04-008.js
+./11/11.04/11.04.04/11.04.04-009.js
+./11/11.04/11.04.04/11.04.04-010.js
+./11/11.04/11.04.04/11.04.04-011.js
+./11/11.04/11.04.04/11.04.04-012.js
+./11/11.04/11.04.05/11.04.05-001.js
+./11/11.04/11.04.05/11.04.05-002.js
+./11/11.04/11.04.05/11.04.05-004.js
+./11/11.04/11.04.05/11.04.05-005.js
+./11/11.04/11.04.05/11.04.05-006.js
+./11/11.04/11.04.05/11.04.05-007.js
+./11/11.04/11.04.05/11.04.05-008.js
+./11/11.04/11.04.05/11.04.05-009.js
+./11/11.04/11.04.05/11.04.05-010.js
+./11/11.04/11.04.05/11.04.05-011.js
+./11/11.04/11.04.05/11.04.05-012.js
+./11/11.04/11.04.06/11.04.06-001.js
+./11/11.04/11.04.06/11.04.06-002.js
+./11/11.04/11.04.06/11.04.06-003.js
+./11/11.04/11.04.06/11.04.06-004.js
+./11/11.04/11.04.06/11.04.06-005.js
+./11/11.04/11.04.06/11.04.06-006.js
+./11/11.04/11.04.06/11.04.06-007.js
+./11/11.04/11.04.06/11.04.06-008.js
+./11/11.04/11.04.06/11.04.06-009.js
+./11/11.04/11.04.06/11.04.06-010.js
+./11/11.04/11.04.06/11.04.06-011.js
+./11/11.04/11.04.06/11.04.06-012.js
+./11/11.04/11.04.06/11.04.06-013.js
+./11/11.04/11.04.06/11.04.06-014.js
+./11/11.04/11.04.06/11.04.06-015.js
+./11/11.04/11.04.06/11.04.06-016.js
+./11/11.04/11.04.06/11.04.06-017.js
+./11/11.04/11.04.06/11.04.06-018.js
+./11/11.04/11.04.06/11.04.06-019.js
+./11/11.04/11.04.06/11.04.06-020.js
+./11/11.04/11.04.06/11.04.06-021.js
+./11/11.04/11.04.06/11.04.06-022.js
+./11/11.04/11.04.06/11.04.06-023.js
+./11/11.04/11.04.06/11.04.06-024.js
+./11/11.04/11.04.06/11.04.06-025.js
+./11/11.04/11.04.06/11.04.06-026.js
+./11/11.04/11.04.06/11.04.06-027.js
+./11/11.04/11.04.06/11.04.06-028.js
+./11/11.04/11.04.07/11.04.07-001.js
+./11/11.04/11.04.07/11.04.07-002.js
+./11/11.04/11.04.07/11.04.07-003.js
+./11/11.04/11.04.07/11.04.07-004.js
+./11/11.04/11.04.07/11.04.07-005.js
+./11/11.04/11.04.07/11.04.07-006.js
+./11/11.04/11.04.07/11.04.07-007.js
+./11/11.04/11.04.07/11.04.07-008.js
+./11/11.04/11.04.07/11.04.07-009.js
+./11/11.04/11.04.07/11.04.07-010.js
+./11/11.04/11.04.07/11.04.07-011.js
+./11/11.04/11.04.07/11.04.07-012.js
+./11/11.04/11.04.07/11.04.07-013.js
+./11/11.04/11.04.07/11.04.07-014.js
+./11/11.04/11.04.07/11.04.07-015.js
+./11/11.04/11.04.07/11.04.07-016.js
+./11/11.04/11.04.07/11.04.07-017.js
+./11/11.04/11.04.07/11.04.07-018.js
+./11/11.04/11.04.07/11.04.07-019.js
+./11/11.04/11.04.07/11.04.07-020.js
+./11/11.04/11.04.07/11.04.07-021.js
+./11/11.04/11.04.07/11.04.07-022.js
+./11/11.04/11.04.07/11.04.07-023.js
+./11/11.04/11.04.07/11.04.07-024.js
+./11/11.04/11.04.07/11.04.07-025.js
+./11/11.04/11.04.07/11.04.07-026.js
+./11/11.04/11.04.07/11.04.07-027.js
+./11/11.04/11.04.07/11.04.07-028.js
+./11/11.04/11.04.07/11.04.07-029.js
+./11/11.04/11.04.07/11.04.07-030.js
+./11/11.04/11.04.07/11.04.07-031.js
+./11/11.04/11.04.07/11.04.07-032.js
+./11/11.04/11.04.07/11.04.07-033.js
+./11/11.04/11.04.08/11.04.08-001.js
+./11/11.04/11.04.08/11.04.08-002.js
+./11/11.04/11.04.08/11.04.08-003.js
+./11/11.04/11.04.08/11.04.08-004.js
+./11/11.04/11.04.08/11.04.08-005.js
+./11/11.04/11.04.08/11.04.08-006.js
+./11/11.04/11.04.08/11.04.08-007.js
+./11/11.04/11.04.08/11.04.08-008.js
+./11/11.04/11.04.08/11.04.08-009.js
+./11/11.04/11.04.08/11.04.08-010.js
+./11/11.04/11.04.08/11.04.08-011.js
+./11/11.04/11.04.08/11.04.08-012.js
+./11/11.04/11.04.08/11.04.08-013.js
+./11/11.04/11.04.08/11.04.08-014.js
+./11/11.04/11.04.08/11.04.08-015.js
+./11/11.04/11.04.08/11.04.08-016.js
+./11/11.04/11.04.08/11.04.08-017.js
+./11/11.04/11.04.08/11.04.08-018.js
+./11/11.04/11.04.08/11.04.08-019.js
+./11/11.04/11.04.08/11.04.08-020.js
+./11/11.04/11.04.08/11.04.08-021.js
+./11/11.04/11.04.08/11.04.08-022.js
+./11/11.04/11.04.09/11.04.09-001.js
+./11/11.04/11.04.09/11.04.09-002.js
+./11/11.04/11.04.09/11.04.09-003.js
+./11/11.04/11.04.09/11.04.09-004.js
+./11/11.04/11.04.09/11.04.09-005.js
+./11/11.04/11.04.09/11.04.09-006.js
+./11/11.04/11.04.09/11.04.09-007.js
+./11/11.04/11.04.09/11.04.09-008.js
+./11/11.04/11.04.09/11.04.09-009.js
+./11/11.04/11.04.09/11.04.09-010.js
+./11/11.04/11.04.09/11.04.09-011.js
+./11/11.04/11.04.09/11.04.09-012.js
+./11/11.04/11.04.09/11.04.09-013.js
+./11/11.04/11.04.09/11.04.09-014.js
+./11/11.04/11.04.09/11.04.09-015.js
+./11/11.04/11.04.09/11.04.09-016.js
+./11/11.04/11.04.09/11.04.09-017.js
+./11/11.04/11.04.09/11.04.09-018.js
+./11/11.04/11.04.09/11.04.09-019.js
+./11/11.04/11.04.09/11.04.09-020.js
+./11/11.05/11.05.01/11.05.01-001.js
+./11/11.05/11.05.01/11.05.01-002.js
+./11/11.05/11.05.01/11.05.01-003.js
+./11/11.05/11.05.01/11.05.01-004.js
+./11/11.05/11.05.01/11.05.01-005.js
+./11/11.05/11.05.01/11.05.01-006.js
+./11/11.05/11.05.01/11.05.01-007.js
+./11/11.05/11.05.01/11.05.01-008.js
+./11/11.05/11.05.01/11.05.01-009.js
+./11/11.05/11.05.01/11.05.01-010.js
+./11/11.05/11.05.01/11.05.01-011.js
+./11/11.05/11.05.01/11.05.01-012.js
+./11/11.05/11.05.01/11.05.01-013.js
+./11/11.05/11.05.01/11.05.01-014.js
+./11/11.05/11.05.01/11.05.01-015.js
+./11/11.05/11.05.01/11.05.01-016.js
+./11/11.05/11.05.01/11.05.01-017.js
+./11/11.05/11.05.01/11.05.01-018.js
+./11/11.05/11.05.01/11.05.01-019.js
+./11/11.05/11.05.01/11.05.01-020.js
+./11/11.05/11.05.01/11.05.01-021.js
+./11/11.05/11.05.01/11.05.01-022.js
+./11/11.05/11.05.01/11.05.01-023.js
+./11/11.05/11.05.01/11.05.01-024.js
+./11/11.05/11.05.01/11.05.01-025.js
+./11/11.05/11.05.01/11.05.01-026.js
+./11/11.05/11.05.01/11.05.01-027.js
+./11/11.05/11.05.01/11.05.01-028.js
+./11/11.05/11.05.01/11.05.01-029.js
+./11/11.05/11.05.01/11.05.01-030.js
+./11/11.05/11.05.01/11.05.01-031.js
+./11/11.05/11.05.01/11.05.01-032.js
+./11/11.05/11.05.01/11.05.01-033.js
+./11/11.05/11.05.01/11.05.01-034.js
+./11/11.05/11.05.01/11.05.01-035.js
+./11/11.05/11.05.01/11.05.01-036.js
+./11/11.05/11.05.01/11.05.01-037.js
+./11/11.05/11.05.01/11.05.01-038.js
+./11/11.05/11.05.01/11.05.01-039.js
+./11/11.05/11.05.01/11.05.01-040.js
+./11/11.05/11.05.01/11.05.01-041.js
+./11/11.05/11.05.01/11.05.01-042.js
+./11/11.05/11.05.01/11.05.01-043.js
+./11/11.05/11.05.01/11.05.01-044.js
+./11/11.05/11.05.01/11.05.01-045.js
+./11/11.05/11.05.01/11.05.01-046.js
+./11/11.05/11.05.01/11.05.01-047.js
+./11/11.05/11.05.01/11.05.01-048.js
+./11/11.05/11.05.01/11.05.01-049.js
+./11/11.05/11.05.01/11.05.01-050.js
+./11/11.05/11.05.01/11.05.01-051.js
+./11/11.05/11.05.01/11.05.01-052.js
+./11/11.05/11.05.01/11.05.01-053.js
+./11/11.05/11.05.01/11.05.01-054.js
+./11/11.05/11.05.01/11.05.01-055.js
+./11/11.05/11.05.01/11.05.01-056.js
+./11/11.05/11.05.01/11.05.01-057.js
+./11/11.05/11.05.01/11.05.01-058.js
+./11/11.05/11.05.01/11.05.01-059.js
+./11/11.05/11.05.01/11.05.01-060.js
+./11/11.05/11.05.01/11.05.01-061.js
+./11/11.05/11.05.01/11.05.01-062.js
+./11/11.05/11.05.01/11.05.01-063.js
+./11/11.05/11.05.01/11.05.01-064.js
+./11/11.05/11.05.01/11.05.01-065.js
+./11/11.05/11.05.01/11.05.01-066.js
+./11/11.05/11.05.01/11.05.01-067.js
+./11/11.05/11.05.01/11.05.01-068.js
+./11/11.05/11.05.01/11.05.01-069.js
+./11/11.05/11.05.01/11.05.01-070.js
+./11/11.05/11.05.01/11.05.01-071.js
+./11/11.05/11.05.01/11.05.01-072.js
+./11/11.05/11.05.01/11.05.01-073.js
+./11/11.05/11.05.01/11.05.01-074.js
+./11/11.05/11.05.01/11.05.01-075.js
+./11/11.05/11.05.01/11.05.01-076.js
+./11/11.05/11.05.01/11.05.01-077.js
+./11/11.05/11.05.01/11.05.01-078.js
+./11/11.05/11.05.01/11.05.01-079.js
+./11/11.05/11.05.01/11.05.01-080.js
+./11/11.05/11.05.01/11.05.01-081.js
+./11/11.05/11.05.01/11.05.01-082.js
+./11/11.05/11.05.01/11.05.01-083.js
+./11/11.05/11.05.01/11.05.01-084.js
+./11/11.05/11.05.01/11.05.01-085.js
+./11/11.05/11.05.01/11.05.01-086.js
+./11/11.05/11.05.01/11.05.01-087.js
+./11/11.05/11.05.01/11.05.01-088.js
+./11/11.05/11.05.01/11.05.01-089.js
+./11/11.05/11.05.01/11.05.01-090.js
+./11/11.05/11.05.02/11.05.02-001.js
+./11/11.05/11.05.02/11.05.02-002.js
+./11/11.05/11.05.02/11.05.02-003.js
+./11/11.05/11.05.02/11.05.02-004.js
+./11/11.05/11.05.02/11.05.02-005.js
+./11/11.05/11.05.02/11.05.02-006.js
+./11/11.05/11.05.02/11.05.02-007.js
+./11/11.05/11.05.02/11.05.02-008.js
+./11/11.05/11.05.02/11.05.02-009.js
+./11/11.05/11.05.02/11.05.02-010.js
+./11/11.05/11.05.02/11.05.02-011.js
+./11/11.05/11.05.02/11.05.02-012.js
+./11/11.05/11.05.02/11.05.02-013.js
+./11/11.05/11.05.02/11.05.02-014.js
+./11/11.05/11.05.02/11.05.02-015.js
+./11/11.05/11.05.02/11.05.02-016.js
+./11/11.05/11.05.02/11.05.02-017.js
+./11/11.05/11.05.02/11.05.02-018.js
+./11/11.05/11.05.02/11.05.02-019.js
+./11/11.05/11.05.02/11.05.02-020.js
+./11/11.05/11.05.02/11.05.02-021.js
+./11/11.05/11.05.02/11.05.02-022.js
+./11/11.05/11.05.02/11.05.02-023.js
+./11/11.05/11.05.02/11.05.02-024.js
+./11/11.05/11.05.02/11.05.02-025.js
+./11/11.05/11.05.02/11.05.02-026.js
+./11/11.05/11.05.02/11.05.02-027.js
+./11/11.05/11.05.02/11.05.02-028.js
+./11/11.05/11.05.02/11.05.02-029.js
+./11/11.05/11.05.02/11.05.02-030.js
+./11/11.05/11.05.02/11.05.02-031.js
+./11/11.05/11.05.02/11.05.02-032.js
+./11/11.05/11.05.02/11.05.02-033.js
+./11/11.05/11.05.02/11.05.02-034.js
+./11/11.05/11.05.02/11.05.02-035.js
+./11/11.05/11.05.02/11.05.02-036.js
+./11/11.05/11.05.02/11.05.02-037.js
+./11/11.05/11.05.02/11.05.02-038.js
+./11/11.05/11.05.02/11.05.02-039.js
+./11/11.05/11.05.02/11.05.02-040.js
+./11/11.05/11.05.02/11.05.02-041.js
+./11/11.05/11.05.02/11.05.02-042.js
+./11/11.05/11.05.02/11.05.02-043.js
+./11/11.05/11.05.02/11.05.02-044.js
+./11/11.05/11.05.02/11.05.02-045.js
+./11/11.05/11.05.02/11.05.02-046.js
+./11/11.05/11.05.02/11.05.02-047.js
+./11/11.05/11.05.02/11.05.02-048.js
+./11/11.05/11.05.02/11.05.02-049.js
+./11/11.05/11.05.02/11.05.02-050.js
+./11/11.05/11.05.02/11.05.02-051.js
+./11/11.05/11.05.02/11.05.02-052.js
+./11/11.05/11.05.02/11.05.02-053.js
+./11/11.05/11.05.02/11.05.02-054.js
+./11/11.05/11.05.02/11.05.02-055.js
+./11/11.05/11.05.02/11.05.02-056.js
+./11/11.05/11.05.02/11.05.02-057.js
+./11/11.05/11.05.02/11.05.02-058.js
+./11/11.05/11.05.02/11.05.02-059.js
+./11/11.05/11.05.02/11.05.02-060.js
+./11/11.05/11.05.02/11.05.02-061.js
+./11/11.05/11.05.02/11.05.02-062.js
+./11/11.05/11.05.02/11.05.02-063.js
+./11/11.05/11.05.02/11.05.02-064.js
+./11/11.05/11.05.02/11.05.02-065.js
+./11/11.05/11.05.02/11.05.02-066.js
+./11/11.05/11.05.02/11.05.02-067.js
+./11/11.05/11.05.02/11.05.02-068.js
+./11/11.05/11.05.02/11.05.02-069.js
+./11/11.05/11.05.02/11.05.02-070.js
+./11/11.05/11.05.02/11.05.02-071.js
+./11/11.05/11.05.02/11.05.02-072.js
+./11/11.05/11.05.02/11.05.02-073.js
+./11/11.05/11.05.02/11.05.02-074.js
+./11/11.05/11.05.02/11.05.02-075.js
+./11/11.05/11.05.02/11.05.02-076.js
+./11/11.05/11.05.02/11.05.02-077.js
+./11/11.05/11.05.02/11.05.02-078.js
+./11/11.05/11.05.02/11.05.02-079.js
+./11/11.05/11.05.02/11.05.02-080.js
+./11/11.05/11.05.02/11.05.02-081.js
+./11/11.05/11.05.02/11.05.02-082.js
+./11/11.05/11.05.02/11.05.02-083.js
+./11/11.05/11.05.02/11.05.02-084.js
+./11/11.05/11.05.02/11.05.02-085.js
+./11/11.05/11.05.02/11.05.02-086.js
+./11/11.05/11.05.02/11.05.02-087.js
+./11/11.05/11.05.02/11.05.02-088.js
+./11/11.05/11.05.02/11.05.02-089.js
+./11/11.05/11.05.02/11.05.02-090.js
+./11/11.05/11.05.03/11.05.03-001.js
+./11/11.05/11.05.03/11.05.03-002.js
+./11/11.05/11.05.03/11.05.03-003.js
+./11/11.05/11.05.03/11.05.03-004.js
+./11/11.05/11.05.03/11.05.03-005.js
+./11/11.05/11.05.03/11.05.03-006.js
+./11/11.05/11.05.03/11.05.03-007.js
+./11/11.05/11.05.03/11.05.03-008.js
+./11/11.05/11.05.03/11.05.03-009.js
+./11/11.05/11.05.03/11.05.03-010.js
+./11/11.05/11.05.03/11.05.03-011.js
+./11/11.05/11.05.03/11.05.03-012.js
+./11/11.05/11.05.03/11.05.03-013.js
+./11/11.05/11.05.03/11.05.03-014.js
+./11/11.05/11.05.03/11.05.03-015.js
+./11/11.05/11.05.03/11.05.03-016.js
+./11/11.05/11.05.03/11.05.03-017.js
+./11/11.05/11.05.03/11.05.03-018.js
+./11/11.05/11.05.03/11.05.03-019.js
+./11/11.05/11.05.03/11.05.03-020.js
+./11/11.05/11.05.03/11.05.03-021.js
+./11/11.05/11.05.03/11.05.03-022.js
+./11/11.05/11.05.03/11.05.03-023.js
+./11/11.05/11.05.03/11.05.03-024.js
+./11/11.05/11.05.03/11.05.03-025.js
+./11/11.05/11.05.03/11.05.03-026.js
+./11/11.05/11.05.03/11.05.03-027.js
+./11/11.05/11.05.03/11.05.03-028.js
+./11/11.05/11.05.03/11.05.03-029.js
+./11/11.05/11.05.03/11.05.03-030.js
+./11/11.06/11.06.01/11.06.01-001.js
+./11/11.06/11.06.01/11.06.01-002.js
+./11/11.06/11.06.01/11.06.01-003.js
+./11/11.06/11.06.01/11.06.01-004.js
+./11/11.06/11.06.01/11.06.01-005.js
+./11/11.06/11.06.01/11.06.01-006.js
+./11/11.06/11.06.01/11.06.01-007.js
+./11/11.06/11.06.01/11.06.01-008.js
+./11/11.06/11.06.01/11.06.01-009.js
+./11/11.06/11.06.01/11.06.01-010.js
+./11/11.06/11.06.01/11.06.01-011.js
+./11/11.06/11.06.01/11.06.01-012.js
+./11/11.06/11.06.01/11.06.01-013.js
+./11/11.06/11.06.01/11.06.01-014.js
+./11/11.06/11.06.01/11.06.01-015.js
+./11/11.06/11.06.01/11.06.01-016.js
+./11/11.06/11.06.01/11.06.01-017.js
+./11/11.06/11.06.01/11.06.01-018.js
+./11/11.06/11.06.02/11.06.02-001.js
+./11/11.06/11.06.02/11.06.02-002.js
+./11/11.06/11.06.02/11.06.02-003.js
+./11/11.06/11.06.02/11.06.02-004.js
+./11/11.06/11.06.02/11.06.02-005.js
+./11/11.06/11.06.02/11.06.02-006.js
+./11/11.06/11.06.02/11.06.02-007.js
+./11/11.06/11.06.02/11.06.02-008.js
+./11/11.06/11.06.02/11.06.02-009.js
+./11/11.06/11.06.02/11.06.02-010.js
+./11/11.06/11.06.02/11.06.02-011.js
+./11/11.06/11.06.02/11.06.02-012.js
+./11/11.06/11.06.02/11.06.02-013.js
+./11/11.06/11.06.02/11.06.02-014.js
+./11/11.06/11.06.02/11.06.02-015.js
+./11/11.06/11.06.02/11.06.02-016.js
+./11/11.06/11.06.02/11.06.02-017.js
+./11/11.06/11.06.03/11.06.03-001.js
+./11/11.06/11.06.03/11.06.03-002.js
+./11/11.06/11.06.03/11.06.03-003.js
+./11/11.06/11.06.03/11.06.03-004.js
+./11/11.06/11.06.03/11.06.03-005.js
+./11/11.06/11.06.03/11.06.03-006.js
+./11/11.06/11.06.03/11.06.03-007.js
+./11/11.06/11.06.03/11.06.03-008.js
+./11/11.06/11.06.03/11.06.03-009.js
+./11/11.06/11.06.03/11.06.03-010.js
+./11/11.06/11.06.03/11.06.03-011.js
+./11/11.06/11.06.03/11.06.03-012.js
+./11/11.06/11.06.03/11.06.03-013.js
+./11/11.06/11.06.03/11.06.03-014.js
+./11/11.06/11.06.03/11.06.03-015.js
+./11/11.06/11.06.03/11.06.03-016.js
+./11/11.06/11.06.03/11.06.03-017.js
+./11/11.06/11.06.03/11.06.03-018.js
+./11/11.06/11.06.03/11.06.03-019.js
+./11/11.06/11.06.03/11.06.03-020.js
+./11/11.06/11.06.03/11.06.03-021.js
+./11/11.06/11.06.03/11.06.03-022.js
+./11/11.06/11.06.03/11.06.03-023.js
+./11/11.06/11.06.03/11.06.03-024.js
+./11/11.06/11.06.03/11.06.03-025.js
+./11/11.07/11.07.01/11.07.01-001.js
+./11/11.07/11.07.01/11.07.01-003.js
+./11/11.07/11.07.01/11.07.01-004.js
+./11/11.07/11.07.01/11.07.01-005.js
+./11/11.07/11.07.01/11.07.01-006.js
+./11/11.07/11.07.01/11.07.01-007.js
+./11/11.07/11.07.01/11.07.01-008.js
+./11/11.07/11.07.01/11.07.01-009.js
+./11/11.07/11.07.02/11.07.02-001.js
+./11/11.07/11.07.02/11.07.02-002.js
+./11/11.07/11.07.02/11.07.02-003.js
+./11/11.07/11.07.02/11.07.02-004.js
+./11/11.07/11.07.02/11.07.02-005.js
+./11/11.07/11.07.02/11.07.02-006.js
+./11/11.07/11.07.02/11.07.02-007.js
+./11/11.07/11.07.02/11.07.02-008.js
+./11/11.07/11.07.02/11.07.02-009.js
+./11/11.07/11.07.03/11.07.03-001.js
+./11/11.07/11.07.03/11.07.03-002.js
+./11/11.07/11.07.03/11.07.03-003.js
+./11/11.07/11.07.03/11.07.03-004.js
+./11/11.07/11.07.03/11.07.03-005.js
+./11/11.07/11.07.03/11.07.03-006.js
+./11/11.07/11.07.03/11.07.03-007.js
+./11/11.08/11.08.01/11.08.01-001.js
+./11/11.08/11.08.01/11.08.01-002.js
+./11/11.08/11.08.01/11.08.01-003.js
+./11/11.08/11.08.01/11.08.01-004.js
+./11/11.08/11.08.01/11.08.01-005.js
+./11/11.08/11.08.01/11.08.01-006.js
+./11/11.08/11.08.02/11.08.02-001.js
+./11/11.08/11.08.02/11.08.02-002.js
+./11/11.08/11.08.02/11.08.02-003.js
+./11/11.08/11.08.02/11.08.02-004.js
+./11/11.08/11.08.02/11.08.02-005.js
+./11/11.08/11.08.02/11.08.02-006.js
+./11/11.08/11.08.03/11.08.03-001.js
+./11/11.08/11.08.03/11.08.03-002.js
+./11/11.08/11.08.03/11.08.03-003.js
+./11/11.08/11.08.03/11.08.03-004.js
+./11/11.08/11.08.03/11.08.03-005.js
+./11/11.08/11.08.03/11.08.03-006.js
+./11/11.08/11.08.03/11.08.03-007.js
+./11/11.08/11.08.03/11.08.03-008.js
+./11/11.08/11.08.03/11.08.03-009.js
+./11/11.08/11.08.03/11.08.03-010.js
+./11/11.08/11.08.03/11.08.03-011.js
+./11/11.08/11.08.04/11.08.04-001.js
+./11/11.08/11.08.04/11.08.04-002.js
+./11/11.08/11.08.04/11.08.04-003.js
+./11/11.08/11.08.04/11.08.04-004.js
+./11/11.08/11.08.04/11.08.04-005.js
+./11/11.08/11.08.04/11.08.04-006.js
+./11/11.08/11.08.04/11.08.04-007.js
+./11/11.08/11.08.04/11.08.04-008.js
+./11/11.08/11.08.04/11.08.04-009.js
+./11/11.08/11.08.06/11.08.06-001.js
+./11/11.08/11.08.06/11.08.06-002.js
+./11/11.08/11.08.06/11.08.06-003.js
+./11/11.08/11.08.06/11.08.06-004.js
+./11/11.08/11.08.06/11.08.06-005.js
+./11/11.08/11.08.06/11.08.06-006.js
+./11/11.08/11.08.06/11.08.06-007.js
+./11/11.08/11.08.07/11.08.07-001.js
+./11/11.08/11.08.07/11.08.07-002.js
+./11/11.08/11.08.07/11.08.07-003.js
+./11/11.08/11.08.07/11.08.07-004.js
+./11/11.08/11.08.07/11.08.07-005.js
+./11/11.08/11.08.07/11.08.07-007.js
+./11/11.08/11.08.07/11.08.07-008.js
+./11/11.08/11.08.07/11.08.07-009.js
+./11/11.08/11.08.07/11.08.07-010.js
+./11/11.08/11.08.07/11.08.07-011.js
+./11/11.08/11.08.07/11.08.07-012.js
+./11/11.08/11.08.07/11.08.07-013.js
+./11/11.08/11.08.07/11.08.07-014.js
+./11/11.09/11.09.01/11.09.01-001.js
+./11/11.09/11.09.01/11.09.01-002.js
+./11/11.09/11.09.01/11.09.01-003.js
+./11/11.09/11.09.01/11.09.01-004.js
+./11/11.09/11.09.01/11.09.01-005.js
+./11/11.09/11.09.01/11.09.01-006.js
+./11/11.09/11.09.01/11.09.01-007.js
+./11/11.09/11.09.01/11.09.01-008.js
+./11/11.09/11.09.01/11.09.01-009.js
+./11/11.09/11.09.01/11.09.01-010.js
+./11/11.09/11.09.01/11.09.01-011.js
+./11/11.09/11.09.01/11.09.01-012.js
+./11/11.09/11.09.01/11.09.01-013.js
+./11/11.09/11.09.01/11.09.01-014.js
+./11/11.09/11.09.01/11.09.01-015.js
+./11/11.09/11.09.01/11.09.01-016.js
+./11/11.09/11.09.01/11.09.01-017.js
+./11/11.09/11.09.01/11.09.01-018.js
+./11/11.09/11.09.01/11.09.01-019.js
+./11/11.09/11.09.01/11.09.01-020.js
+./11/11.09/11.09.01/11.09.01-021.js
+./11/11.09/11.09.01/11.09.01-022.js
+./11/11.09/11.09.01/11.09.01-023.js
+./11/11.09/11.09.01/11.09.01-024.js
+./11/11.09/11.09.01/11.09.01-025.js
+./11/11.09/11.09.01/11.09.01-026.js
+./11/11.09/11.09.01/11.09.01-027.js
+./11/11.09/11.09.01/11.09.01-028.js
+./11/11.09/11.09.01/11.09.01-029.js
+./11/11.09/11.09.01/11.09.01-030.js
+./11/11.09/11.09.01/11.09.01-031.js
+./11/11.09/11.09.01/11.09.01-032.js
+./11/11.09/11.09.01/11.09.01-033.js
+./11/11.09/11.09.01/11.09.01-034.js
+./11/11.09/11.09.01/11.09.01-035.js
+./11/11.09/11.09.01/11.09.01-036.js
+./11/11.09/11.09.01/11.09.01-037.js
+./11/11.09/11.09.01/11.09.01-038.js
+./11/11.09/11.09.02/11.09.02-001.js
+./11/11.09/11.09.02/11.09.02-002.js
+./11/11.09/11.09.02/11.09.02-003.js
+./11/11.09/11.09.02/11.09.02-004.js
+./11/11.09/11.09.02/11.09.02-005.js
+./11/11.09/11.09.02/11.09.02-006.js
+./11/11.09/11.09.02/11.09.02-007.js
+./11/11.09/11.09.02/11.09.02-008.js
+./11/11.09/11.09.02/11.09.02-009.js
+./11/11.09/11.09.02/11.09.02-010.js
+./11/11.09/11.09.02/11.09.02-011.js
+./11/11.09/11.09.02/11.09.02-012.js
+./11/11.09/11.09.02/11.09.02-013.js
+./11/11.09/11.09.02/11.09.02-014.js
+./11/11.09/11.09.02/11.09.02-015.js
+./11/11.09/11.09.02/11.09.02-016.js
+./11/11.09/11.09.02/11.09.02-017.js
+./11/11.09/11.09.02/11.09.02-018.js
+./11/11.09/11.09.02/11.09.02-019.js
+./11/11.09/11.09.02/11.09.02-020.js
+./11/11.09/11.09.02/11.09.02-021.js
+./11/11.09/11.09.02/11.09.02-022.js
+./11/11.09/11.09.02/11.09.02-023.js
+./11/11.09/11.09.02/11.09.02-024.js
+./11/11.09/11.09.02/11.09.02-025.js
+./11/11.09/11.09.02/11.09.02-026.js
+./11/11.09/11.09.02/11.09.02-027.js
+./11/11.09/11.09.02/11.09.02-028.js
+./11/11.09/11.09.02/11.09.02-029.js
+./11/11.09/11.09.02/11.09.02-030.js
+./11/11.09/11.09.02/11.09.02-031.js
+./11/11.09/11.09.02/11.09.02-032.js
+./11/11.09/11.09.02/11.09.02-033.js
+./11/11.09/11.09.02/11.09.02-034.js
+./11/11.09/11.09.02/11.09.02-035.js
+./11/11.09/11.09.02/11.09.02-036.js
+./11/11.09/11.09.02/11.09.02-037.js
+./11/11.09/11.09.02/11.09.02-038.js
+./11/11.09/11.09.04/11.09.04-001.js
+./11/11.09/11.09.04/11.09.04-002.js
+./11/11.09/11.09.04/11.09.04-003.js
+./11/11.09/11.09.04/11.09.04-004.js
+./11/11.09/11.09.04/11.09.04-005.js
+./11/11.09/11.09.04/11.09.04-006.js
+./11/11.09/11.09.04/11.09.04-007.js
+./11/11.09/11.09.04/11.09.04-008.js
+./11/11.09/11.09.04/11.09.04-009.js
+./11/11.09/11.09.04/11.09.04-010.js
+./11/11.09/11.09.04/11.09.04-011.js
+./11/11.09/11.09.04/11.09.04-012.js
+./11/11.09/11.09.04/11.09.04-013.js
+./11/11.09/11.09.04/11.09.04-014.js
+./11/11.09/11.09.04/11.09.04-015.js
+./11/11.09/11.09.04/11.09.04-016.js
+./11/11.09/11.09.04/11.09.04-017.js
+./11/11.09/11.09.04/11.09.04-018.js
+./11/11.09/11.09.04/11.09.04-019.js
+./11/11.09/11.09.04/11.09.04-020.js
+./11/11.09/11.09.04/11.09.04-021.js
+./11/11.09/11.09.04/11.09.04-022.js
+./11/11.09/11.09.04/11.09.04-023.js
+./11/11.09/11.09.04/11.09.04-024.js
+./11/11.09/11.09.04/11.09.04-025.js
+./11/11.09/11.09.05/11.09.05-001.js
+./11/11.09/11.09.05/11.09.05-002.js
+./11/11.09/11.09.05/11.09.05-003.js
+./11/11.09/11.09.05/11.09.05-004.js
+./11/11.09/11.09.05/11.09.05-005.js
+./11/11.09/11.09.05/11.09.05-006.js
+./11/11.09/11.09.05/11.09.05-007.js
+./11/11.09/11.09.05/11.09.05-008.js
+./11/11.09/11.09.05/11.09.05-009.js
+./11/11.09/11.09.05/11.09.05-010.js
+./11/11.09/11.09.05/11.09.05-011.js
+./11/11.09/11.09.05/11.09.05-012.js
+./11/11.09/11.09.05/11.09.05-013.js
+./11/11.09/11.09.05/11.09.05-014.js
+./11/11.09/11.09.05/11.09.05-015.js
+./11/11.09/11.09.05/11.09.05-016.js
+./11/11.09/11.09.05/11.09.05-017.js
+./11/11.09/11.09.05/11.09.05-018.js
+./11/11.09/11.09.05/11.09.05-019.js
+./11/11.09/11.09.05/11.09.05-020.js
+./11/11.09/11.09.05/11.09.05-021.js
+./11/11.09/11.09.05/11.09.05-022.js
+./11/11.09/11.09.05/11.09.05-023.js
+./11/11.09/11.09.05/11.09.05-024.js
+./11/11.09/11.09.05/11.09.05-025.js
+./11/11.10/11.10-001.js
+./11/11.10/11.10-002.js
+./11/11.10/11.10-003.js
+./11/11.10/11.10-004.js
+./11/11.10/11.10-005.js
+./11/11.10/11.10-006.js
+./11/11.10/11.10-007.js
+./11/11.10/11.10-008.js
+./11/11.10/11.10-009.js
+./11/11.10/11.10-010.js
+./11/11.10/11.10-011.js
+./11/11.10/11.10-012.js
+./11/11.10/11.10-013.js
+./11/11.10/11.10-014.js
+./11/11.10/11.10-015.js
+./11/11.10/11.10-016.js
+./11/11.10/11.10-017.js
+./11/11.10/11.10-018.js
+./11/11.11/11.11-001.js
+./11/11.11/11.11-002.js
+./11/11.11/11.11-003.js
+./11/11.11/11.11-004.js
+./11/11.11/11.11-005.js
+./11/11.11/11.11-006.js
+./11/11.11/11.11-007.js
+./11/11.11/11.11-008.js
+./11/11.11/11.11-009.js
+./11/11.11/11.11-010.js
+./11/11.11/11.11-011.js
+./11/11.11/11.11-012.js
+./11/11.11/11.11-013.js
+./11/11.11/11.11-014.js
+./11/11.11/11.11-015.js
+./11/11.11/11.11-016.js
+./11/11.11/11.11-017.js
+./11/11.11/11.11-018.js
+./11/11.11/11.11-019.js
+./11/11.11/11.11-020.js
+./11/11.11/11.11-021.js
+./11/11.11/11.11-022.js
+./11/11.11/11.11-023.js
+./11/11.11/11.11-024.js
+./11/11.11/11.11-025.js
+./11/11.11/11.11-026.js
+./11/11.11/11.11-027.js
+./11/11.12/11.12-001.js
+./11/11.12/11.12-002.js
+./11/11.12/11.12-003.js
+./11/11.12/11.12-004.js
+./11/11.12/11.12-005.js
+./11/11.12/11.12-008.js
+./11/11.12/11.12-012.js
+./11/11.13/11.13.01/11.13.01-001.js
+./11/11.13/11.13.02/11.13.02-001.js
+./11/11.13/11.13.02/11.13.02-002.js
+./11/11.13/11.13.02/11.13.02-003.js
+./11/11.13/11.13.02/11.13.02-004.js
+./11/11.13/11.13.02/11.13.02-005.js
+./11/11.13/11.13.02/11.13.02-006.js
+./11/11.13/11.13.02/11.13.02-007.js
+./11/11.13/11.13.02/11.13.02-008.js
+./11/11.13/11.13.02/11.13.02-009.js
+./11/11.13/11.13.02/11.13.02-010.js
+./11/11.13/11.13.02/11.13.02-011.js
+./11/11.13/11.13.02/11.13.02-012.js
+./11/11.13/11.13.02/11.13.02-013.js
+./11/11.13/11.13.02/11.13.02-014.js
+./11/11.13/11.13.02/11.13.02-039.js
+./11/11.13/11.13.02/11.13.02-040.js
+./11/11.13/11.13.02/11.13.02-041.js
+./11/11.13/11.13.02/11.13.02-042.js
+./11/11.13/11.13.02/11.13.02-043.js
+./11/11.13/11.13.02/11.13.02-044.js
+./11/11.13/11.13.02/11.13.02-045.js
+./11/11.13/11.13.02/11.13.02-046.js
+./11/11.13/11.13.02/11.13.02-047.js
+./11/11.13/11.13.02/11.13.02-048.js
+./11/11.13/11.13.02/11.13.02-049.js
+./11/11.13/11.13.02/11.13.02-050.js
+./11/11.13/11.13.02/11.13.02-051.js
+./11/11.14/11.14-001.js
+./11/11.14/11.14-002.js
+./12/12.01/12.01-001.js
+./12/12.01/12.01-002.js
+./12/12.01/12.01-003.js
+./12/12.01/12.01-004.js
+./12/12.01/12.01-005.js
+./12/12.02/12.02-001.js
+./12/12.02/12.02-002.js
+./12/12.02/12.02-003.js
+./12/12.02/12.02-004.js
+./12/12.02/12.02-005.js
+./12/12.02/12.02-006.js
+./12/12.02/12.02-007.js
+./12/12.02/12.02-008.js
+./12/12.02/12.02-009.js
+./12/12.02/12.02-010.js
+./12/12.02/12.02.01/12.02.01-001.js
+./12/12.02/12.02.01/12.02.01-002.js
+./12/12.02/12.02-011.js
+./12/12.02/12.02-012.js
+./12/12.02/12.02-013.js
+./12/12.02/12.02-014.js
+./12/12.02/12.02-015.js
+./12/12.02/12.02-016.js
+./12/12.02/12.02-018.js
+./12/12.02/12.02-019.js
+./12/12.02/12.02-020.js
+./12/12.02/12.02-021.js
+./12/12.02/12.02-022.js
+./12/12.03/12.03-001.js
+./12/12.03/12.03-002.js
+./12/12.03/12.03-003.js
+./12/12.04/12.04-001.js
+./12/12.04/12.04-002.js
+./12/12.04/12.04-003.js
+./12/12.04/12.04-004.js
+./12/12.05/12.05-001.js
+./12/12.05/12.05-002.js
+./12/12.05/12.05-003.js
+./12/12.05/12.05-004.js
+./12/12.05/12.05-005.js
+./12/12.05/12.05-006.js
+./12/12.05/12.05-007.js
+./12/12.05/12.05-008.js
+./12/12.06/12.06.01/12.06.01-001.js
+./12/12.06/12.06.01/12.06.01-002.js
+./12/12.06/12.06.01/12.06.01-003.js
+./12/12.06/12.06.01/12.06.01-004.js
+./12/12.06/12.06.01/12.06.01-005.js
+./12/12.06/12.06.01/12.06.01-006.js
+./12/12.06/12.06.01/12.06.01-007.js
+./12/12.06/12.06.01/12.06.01-008.js
+./12/12.06/12.06.01/12.06.01-009.js
+./12/12.06/12.06.01/12.06.01-010.js
+./12/12.06/12.06.02/12.06.02-001.js
+./12/12.06/12.06.02/12.06.02-002.js
+./12/12.06/12.06.02/12.06.02-003.js
+./12/12.06/12.06.02/12.06.02-004.js
+./12/12.06/12.06.02/12.06.02-005.js
+./12/12.06/12.06.02/12.06.02-006.js
+./12/12.06/12.06.02/12.06.02-007.js
+./12/12.06/12.06.02/12.06.02-008.js
+./12/12.06/12.06.03/12.06.03-001.js
+./12/12.06/12.06.03/12.06.03-002.js
+./12/12.06/12.06.03/12.06.03-003.js
+./12/12.06/12.06.03/12.06.03-004.js
+./12/12.06/12.06.03/12.06.03-005.js
+./12/12.06/12.06.03/12.06.03-006.js
+./12/12.06/12.06.03/12.06.03-007.js
+./12/12.06/12.06.03/12.06.03-008.js
+./12/12.06/12.06.03/12.06.03-009.js
+./12/12.06/12.06.03/12.06.03-010.js
+./12/12.06/12.06.03/12.06.03-011.js
+./12/12.06/12.06.04/12.06.04-001.js
+./12/12.06/12.06.04/12.06.04-002.js
+./12/12.06/12.06.04/12.06.04-003.js
+./12/12.06/12.06.04/12.06.04-004.js
+./12/12.06/12.06.04/12.06.04-005.js
+./12/12.06/12.06.04/12.06.04-006.js
+./12/12.06/12.06.04/12.06.04-007.js
+./12/12.07/12.07-001.js
+./12/12.07/12.07-002.js
+./12/12.07/12.07-003.js
+./12/12.07/12.07-004.js
+./12/12.07/12.07-005.js
+./12/12.07/12.07-006.js
+./12/12.07/12.07-007.js
+./12/12.07/12.07-008.js
+./12/12.07/12.07-009.js
+./12/12.07/12.07-010.js
+./12/12.07/12.07-011.js
+./12/12.07/12.07-012.js
+./12/12.07/12.07-013.js
+./12/12.07/12.07-014.js
+./12/12.07/12.07-015.js
+./12/12.07/12.07-016.js
+./12/12.08/12.08-001.js
+./12/12.08/12.08-002.js
+./12/12.08/12.08-003.js
+./12/12.08/12.08-004.js
+./12/12.08/12.08-005.js
+./12/12.08/12.08-006.js
+./12/12.08/12.08-007.js
+./12/12.08/12.08-008.js
+./12/12.08/12.08-009.js
+./12/12.08/12.08-010.js
+./12/12.08/12.08-011.js
+./12/12.08/12.08-012.js
+./12/12.08/12.08-013.js
+./12/12.08/12.08-014.js
+./12/12.08/12.08-015.js
+./12/12.08/12.08-016.js
+./12/12.08/12.08-017.js
+./12/12.08/12.08-018.js
+./12/12.09/12.09-001.js
+./12/12.09/12.09-002.js
+./12/12.09/12.09-003.js
+./12/12.09/12.09-004.js
+./12/12.09/12.09-005.js
+./12/12.09/12.09-006.js
+./12/12.10/12.10-001.js
+./12/12.10/12.10-002.js
+./12/12.10/12.10-003.js
+./12/12.10/12.10-004.js
+./12/12.10/12.10-005.js
+./12/12.10/12.10-006.js
+./12/12.10/12.10-007.js
+./12/12.11/12.11-001.js
+./12/12.11/12.11-002.js
+./12/12.11/12.11-003.js
+./12/12.11/12.11-004.js
+./12/12.11/12.11-005.js
+./12/12.11/12.11-006.js
+./12/12.11/12.11-007.js
+./12/12.12/12.12-001.js
+./12/12.12/12.12-002.js
+./12/12.12/12.12-003.js
+./12/12.12/12.12-004.js
+./12/12.12/12.12-005.js
+./12/12.12/12.12-006.js
+./12/12.12/12.12-007.js
+./12/12.12/12.12-008.js
+./12/12.12/12.12-009.js
+./12/12.12/12.12-010.js
+./12/12.13/12.13-001.js
+./12/12.13/12.13-002.js
+./12/12.13/12.13-003.js
+./12/12.14/12.14-001.js
+./12/12.14/12.14-002.js
+./12/12.14/12.14-003.js
+./12/12.14/12.14-004.js
+./12/12.14/12.14-005.js
+./12/12.14/12.14-006.js
+./13/13-001.js
+./13/13-002.js
+./13/13-003.js
+./13/13-004.js
+./13/13-005.js
+./13/13-006.js
+./13/13-007.js
+./13/13-008.js
+./13/13-009.js
+./13/13-010.js
+./13/13.01/13.01-001.js
+./13/13-011.js
+./13/13-012.js
+./13/13-013.js
+./13/13.02/13.02-001.js
+./13/13.02/13.02-002.js
+./13/13.02/13.02-003.js
+./13/13.02/13.02-004.js
+./13/13.02/13.02-005.js
+./13/13.02/13.02-006.js
+./13/13.02/13.02-007.js
+./13/13.02/13.02-008.js
+./15/15.02/15.02.01/15.02.01-001.js
+./15/15.02/15.02.01/15.02.01-002.js
+./15/15.02/15.02.01/15.02.01-003.js
+./15/15.02/15.02.01/15.02.01-004.js
+./15/15.02/15.02.01/15.02.01-005.js
+./15/15.02/15.02.01/15.02.01-006.js
+./15/15.02/15.02.01/15.02.01-007.js
+./15/15.02/15.02.01/15.02.01-008.js
+./15/15.02/15.02.01/15.02.01-009.js
+./15/15.02/15.02.01/15.02.01-010.js
+./15/15.02/15.02.02/15.02.02-001.js
+./15/15.02/15.02.02/15.02.02-002.js
+./15/15.02/15.02.02/15.02.02-003.js
+./15/15.02/15.02.02/15.02.02-004.js
+./15/15.02/15.02.02/15.02.02-005.js
+./15/15.02/15.02.02/15.02.02-006.js
+./15/15.02/15.02.02/15.02.02-007.js
+./15/15.02/15.02.02/15.02.02-008.js
+./15/15.02/15.02.02/15.02.02-009.js
+./15/15.02/15.02.02/15.02.02-010.js
+./15/15.02/15.02.03/15.02.03-001.js
+./15/15.02/15.02.03/15.02.03-002.js
+./15/15.02/15.02.03/15.02.03-003.js
+./15/15.02/15.02.03/15.02.03-004.js
+./15/15.02/15.02.03/15.02.03-005.js
+./15/15.02/15.02.03/15.02.03-006.js
+./15/15.02/15.02.03/15.02.03-007.js
+./15/15.02/15.02.03/15.02.03-008.js
+./15/15.02/15.02.03/15.02.03-009.js
+./15/15.02/15.02.03/15.02.03-010.js
+./15/15.02/15.02.03/15.02.03-011.js
+./15/15.02/15.02.03/15.02.03-012.js
+./15/15.02/15.02.03/15.02.03-013.js
+./15/15.02/15.02.03/15.02.03-014.js
+./15/15.02/15.02.03/15.02.03-015.js
+./15/15.02/15.02.03/15.02.03-016.js
+./15/15.02/15.02.03/15.02.03-017.js
+./15/15.02/15.02.03/15.02.03-018.js
+./15/15.02/15.02.03/15.02.03-019.js
+./15/15.02/15.02.03/15.02.03-020.js
+./15/15.02/15.02.03/15.02.03-021.js
+./15/15.02/15.02.04/15.02.04-001.js
+./15/15.02/15.02.04/15.02.04-002.js
+./15/15.02/15.02.04/15.02.04.01/15.02.04.01-001.js
+./15/15.02/15.02.04/15.02.04.01/15.02.04.01-002.js
+./15/15.02/15.02.04/15.02.04.02/15.02.04.02-001.js
+./15/15.02/15.02.04/15.02.04.02/15.02.04.02-002.js
+./15/15.02/15.02.04/15.02.04.02/15.02.04.02-003.js
+./15/15.02/15.02.04/15.02.04.02/15.02.04.02-004.js
+./15/15.02/15.02.04/15.02.04.03/15.02.04.03-001.js
+./15/15.02/15.02.04/15.02.04.03/15.02.04.03-002.js
+./15/15.02/15.02.04/15.02.04.03/15.02.04.03-003.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-001.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-002.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-003.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-004.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-005.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-006.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-007.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-008.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-009.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-010.js
+./15/15.02/15.02.04/15.02.04.05/15.02.04.05-001.js
+./15/15.02/15.02.04/15.02.04.05/15.02.04.05-002.js
+./15/15.02/15.02.04/15.02.04.05/15.02.04.05-003.js
+./15/15.02/15.02.04/15.02.04.05/15.02.04.05-004.js
+./15/15.02/15.02.04/15.02.04.06/15.02.04.06-001.js
+./15/15.02/15.02.04/15.02.04.06/15.02.04.06-002.js
+./15/15.02/15.02.04/15.02.04.06/15.02.04.06-003.js
+./15/15.02/15.02.04/15.02.04.06/15.02.04.06-004.js
+./15/15.02/15.02.04/15.02.04.06/15.02.04.06-005.js
+./15/15.02/15.02.04/15.02.04.06/15.02.04.06-006.js
+./15/15.02/15.02.04/15.02.04.07/15.02.04.07-001.js
+./15/15.02/15.02.04/15.02.04.07/15.02.04.07-002.js
+./15/15.02/15.02.04/15.02.04.07/15.02.04.07-003.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-001.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-002.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-004.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-005.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-007.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-008.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-009.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-010.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-011.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-012s.js
+./15/15.03/15.03.03/15.03.03-001.js
+./15/15.03/15.03.03/15.03.03-002.js
+./15/15.03/15.03.03/15.03.03-003.js
+./15/15.03/15.03.03/15.03.03-004.js
+./15/15.03/15.03.03/15.03.03.01/15.03.03.01-001.js
+./15/15.03/15.03.03/15.03.03.01/15.03.03.01-002.js
+./15/15.03/15.03.03/15.03.03.01/15.03.03.01-003.js
+./15/15.03/15.03.03/15.03.03.01/15.03.03.01-004.js
+./15/15.03/15.03.03/15.03.03.02/15.03.03.02-001.js
+./15/15.03/15.03.04/15.03.04.02/15.03.04.02-001.js
+./15/15.03/15.03.04/15.03.04.02/15.03.04.02-002.js
+./15/15.03/15.03.04/15.03.04.02/15.03.04.02-003.js
+./15/15.03/15.03.04/15.03.04.02/15.03.04.02-004.js
+./15/15.03/15.03.04/15.03.04.02/15.03.04.02-005.js
+./15/15.03/15.03.04/15.03.04.02/15.03.04.02-006.js
+./15/15.04/15.04.02/15.04.02.01/15.04.02.01-001.js
+./15/15.04/15.04.02/15.04.02.01/15.04.02.01-002.js
+./15/15.04/15.04.02/15.04.02.01/15.04.02.01-003.js
+./15/15.04/15.04.02/15.04.02.01/15.04.02.01-004.js
+./15/15.04/15.04.02/15.04.02.01/15.04.02.01-005.js
+./15/15.04/15.04.02/15.04.02.01/15.04.02.01-006.js
+./15/15.04/15.04.02/15.04.02.01/15.04.02.01-007.js
+./15/15.04/15.04.02/15.04.02.01/15.04.02.01-008.js
+./15/15.04/15.04.02/15.04.02.02/15.04.02.02-001.js
+./15/15.04/15.04.02/15.04.02.02/15.04.02.02-002.js
+./15/15.04/15.04.02/15.04.02.02/15.04.02.02-003.js
+./15/15.04/15.04.02/15.04.02.02/15.04.02.02-004.js
+./15/15.04/15.04.02/15.04.02.02/15.04.02.02-005.js
+./15/15.04/15.04.02/15.04.02.02/15.04.02.02-006.js
+./15/15.04/15.04.02/15.04.02.02/15.04.02.02-007.js
+./15/15.04/15.04.02/15.04.02.02/15.04.02.02-008.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-001.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-002.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-003.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-004.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-005.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-006.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-007.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-008.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-009.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-010.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-011.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-012.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-013.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-014.js
+./15/15.05/15.05.01/15.05.01.01/15.05.01.01-015.js
+./15/15.05/15.05.02/15.05.02.01/15.05.02.01-001.js
+./15/15.05/15.05.02/15.05.02.01/15.05.02.01-002.js
+./15/15.05/15.05.03/15.05.03.01/15.05.03.01-001.js
+./15/15.05/15.05.03/15.05.03.01/15.05.03.01-002.js
+./15/15.05/15.05.03/15.05.03.02/15.05.03.02-001.js
+./15/15.05/15.05.03/15.05.03.02/15.05.03.02-002.js
+./15/15.05/15.05.04/15.05.04.01/15.05.04.01-001.js
+./15/15.05/15.05.04/15.05.04.02/15.05.04.02-001.js
+./15/15.05/15.05.04/15.05.04.02/15.05.04.02-002.js
+./15/15.05/15.05.04/15.05.04.03/15.05.04.03-001.js
+./15/15.05/15.05.04/15.05.04.04/15.05.04.04-001.js
+./15/15.05/15.05.04/15.05.04.04/15.05.04.04-002.js
+./15/15.05/15.05.04/15.05.04.04/15.05.04.04-003.js
+./15/15.05/15.05.04/15.05.04.04/15.05.04.04-004.js
+./15/15.05/15.05.04/15.05.04.05/15.05.04.05-001.js
+./15/15.05/15.05.04/15.05.04.05/15.05.04.05-002.js
+./15/15.05/15.05.04/15.05.04.05/15.05.04.05-003.js
+./15/15.05/15.05.04/15.05.04.05/15.05.04.05-004.js
+./15/15.05/15.05.04/15.05.04.06/15.05.04.06-001.js
+./15/15.05/15.05.04/15.05.04.06/15.05.04.06-002.js
+./15/15.05/15.05.04/15.05.04.06/15.05.04.06-003.js
+./15/15.05/15.05.04/15.05.04.06/15.05.04.06-004.js
+./15/15.05/15.05.04/15.05.04.07/15.05.04.07-001.js
+./15/15.05/15.05.04/15.05.04.07/15.05.04.07-002.js
+./15/15.05/15.05.04/15.05.04.07/15.05.04.07-003.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-001.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-002.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-003.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-004.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-005.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-006.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-007.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-008.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-009.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-010.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-011.js
+./15/15.06/15.06.01/15.06.01.01/15.06.01.01-012.js
+./15/15.06/15.06.02/15.06.02.01/15.06.02.01-001.js
+./15/15.06/15.06.02/15.06.02.01/15.06.02.01-002.js
+./15/15.06/15.06.03/15.06.03.01/15.06.03.01-001.js
+./15/15.06/15.06.04/15.06.04.01/15.06.04.01-001.js
+./15/15.06/15.06.04/15.06.04.02/15.06.04.02-001.js
+./15/15.06/15.06.04/15.06.04.02/15.06.04.02-002.js
+./15/15.06/15.06.04/15.06.04.02/15.06.04.02-003.js
+./15/15.06/15.06.04/15.06.04.03/15.06.04.03-001.js
+./15/15.07/15.07-001.js
+./15/15.07/15.07-002.js
+./15/15.07/15.07.01/15.07.01-001.js
+./15/15.07/15.07.01/15.07.01-002.js
+./15/15.07/15.07.01/15.07.01-003.js
+./15/15.07/15.07.01/15.07.01-004.js
+./15/15.07/15.07.01/15.07.01-005.js
+./15/15.07/15.07.01/15.07.01-006.js
+./15/15.07/15.07.01/15.07.01-007.js
+./15/15.07/15.07.01/15.07.01-008.js
+./15/15.07/15.07.01/15.07.01-009.js
+./15/15.07/15.07.01/15.07.01-010.js
+./15/15.07/15.07.02/15.07.02-001.js
+./15/15.07/15.07.02/15.07.02-002.js
+./15/15.07/15.07.02/15.07.02-003.js
+./15/15.07/15.07.02/15.07.02-004.js
+./15/15.07/15.07.02/15.07.02-005.js
+./15/15.07/15.07.02/15.07.02-006.js
+./15/15.07/15.07.02/15.07.02-007.js
+./15/15.07/15.07.02/15.07.02-008.js
+./15/15.07/15.07.02/15.07.02-009.js
+./15/15.07/15.07.02/15.07.02-010.js
+./15/15.07/15.07.02/15.07.02-011.js
+./15/15.07/15.07.03/15.07.03-001.js
+./15/15.07/15.07.03/15.07.03-002.js
+./15/15.07/15.07.03/15.07.03-003.js
+./15/15.07/15.07.03/15.07.03-004.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-001.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-002.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-003.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-004.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-005.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-006.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-007.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-008.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-009.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-010.js
+./15/15.07/15.07.03/15.07.03.01/15.07.03.01-011.js
+./15/15.07/15.07.03/15.07.03.02/15.07.03.02-001.js
+./15/15.07/15.07.03/15.07.03.02/15.07.03.02-002.js
+./15/15.07/15.07.03/15.07.03.02/15.07.03.02-003.js
+./15/15.07/15.07.03/15.07.03.02/15.07.03.02-004.js
+./15/15.07/15.07.03/15.07.03.02/15.07.03.02-005.js
+./15/15.07/15.07.03/15.07.03.02/15.07.03.02-006.js
+./15/15.07/15.07.03/15.07.03.03/15.07.03.03-001.js
+./15/15.07/15.07.03/15.07.03.03/15.07.03.03-002.js
+./15/15.07/15.07.03/15.07.03.03/15.07.03.03-003.js
+./15/15.07/15.07.03/15.07.03.03/15.07.03.03-004.js
+./15/15.07/15.07.03/15.07.03.03/15.07.03.03-005.js
+./15/15.07/15.07.03/15.07.03.03/15.07.03.03-006.js
+./15/15.07/15.07.03/15.07.03.04/15.07.03.04-001.js
+./15/15.07/15.07.03/15.07.03.04/15.07.03.04-002.js
+./15/15.07/15.07.03/15.07.03.04/15.07.03.04-003.js
+./15/15.07/15.07.03/15.07.03.04/15.07.03.04-004.js
+./15/15.07/15.07.03/15.07.03.04/15.07.03.04-005.js
+./15/15.07/15.07.03/15.07.03.05/15.07.03.05-001.js
+./15/15.07/15.07.03/15.07.03.05/15.07.03.05-002.js
+./15/15.07/15.07.03/15.07.03.05/15.07.03.05-003.js
+./15/15.07/15.07.03/15.07.03.05/15.07.03.05-004.js
+./15/15.07/15.07.03/15.07.03.05/15.07.03.05-005.js
+./15/15.07/15.07.03/15.07.03.05/15.07.03.05-006.js
+./15/15.07/15.07.03/15.07.03.05/15.07.03.05-007.js
+./15/15.07/15.07.03/15.07.03.06/15.07.03.06-001.js
+./15/15.07/15.07.03/15.07.03.06/15.07.03.06-002.js
+./15/15.07/15.07.03/15.07.03.06/15.07.03.06-003.js
+./15/15.07/15.07.03/15.07.03.06/15.07.03.06-004.js
+./15/15.07/15.07.03/15.07.03.06/15.07.03.06-005.js
+./15/15.07/15.07.03/15.07.03.06/15.07.03.06-006.js
+./15/15.07/15.07.03/15.07.03.06/15.07.03.06-007.js
+./15/15.07/15.07.04/15.07.04-001.js
+./15/15.07/15.07.04/15.07.04-002.js
+./15/15.07/15.07.04/15.07.04-003.js
+./15/15.07/15.07.04/15.07.04.01/15.07.04.01-001.js
+./15/15.07/15.07.04/15.07.04.01/15.07.04.01-002.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-001.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-003.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-004.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-005.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-006.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-008.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-009.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-010.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-011.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-012.js
+./15/15.07/15.07.04/15.07.04.02/15.07.04.02-013.js
+./15/15.07/15.07.04/15.07.04.05/15.07.04.05-001.js
+./15/15.07/15.07.04/15.07.04.05/15.07.04.05-002.js
+./15/15.07/15.07.04/15.07.04.05/15.07.04.05-003.js
+./15/15.07/15.07.04/15.07.04.05/15.07.04.05-004.js
+./15/15.07/15.07.04/15.07.04.05/15.07.04.05-005.js
+./15/15.07/15.07.04/15.07.04.05/15.07.04.05-006.js
+./15/15.07/15.07.04/15.07.04.05/15.07.04.05-007.js
+./15/15.07/15.07.04/15.07.04.05/15.07.04.05-008.js
+./15/15.08/15.08.02/15.08.02.01/15.08.02.01-001.js
+./15/15.08/15.08.02/15.08.02.01/15.08.02.01-002.js
+./15/15.08/15.08.02/15.08.02.01/15.08.02.01-003.js
+./15/15.08/15.08.02/15.08.02.01/15.08.02.01-004.js
+./15/15.08/15.08.02/15.08.02.01/15.08.02.01-005.js
+./15/15.08/15.08.02/15.08.02.02/15.08.02.02-001.js
+./15/15.08/15.08.02/15.08.02.02/15.08.02.02-002.js
+./15/15.08/15.08.02/15.08.02.02/15.08.02.02-003.js
+./15/15.08/15.08.02/15.08.02.02/15.08.02.02-004.js
+./15/15.08/15.08.02/15.08.02.02/15.08.02.02-005.js
+./15/15.08/15.08.02/15.08.02.02/15.08.02.02-006.js
+./15/15.08/15.08.02/15.08.02.03/15.08.02.03-001.js
+./15/15.08/15.08.02/15.08.02.03/15.08.02.03-002.js
+./15/15.08/15.08.02/15.08.02.03/15.08.02.03-003.js
+./15/15.08/15.08.02/15.08.02.03/15.08.02.03-004.js
+./15/15.08/15.08.02/15.08.02.03/15.08.02.03-005.js
+./15/15.08/15.08.02/15.08.02.03/15.08.02.03-006.js
+./15/15.08/15.08.02/15.08.02.03/15.08.02.03-007.js
+./15/15.08/15.08.02/15.08.02.03/15.08.02.03-008.js
+./15/15.08/15.08.02/15.08.02.03/15.08.02.03-009.js
+./15/15.08/15.08.02/15.08.02.04/15.08.02.04-001.js
+./15/15.08/15.08.02/15.08.02.04/15.08.02.04-002.js
+./15/15.08/15.08.02/15.08.02.04/15.08.02.04-003.js
+./15/15.08/15.08.02/15.08.02.04/15.08.02.04-004.js
+./15/15.08/15.08.02/15.08.02.04/15.08.02.04-005.js
+./15/15.08/15.08.02/15.08.02.04/15.08.02.04-006.js
+./15/15.08/15.08.02/15.08.02.04/15.08.02.04-007.js
+./15/15.08/15.08.02/15.08.02.04/15.08.02.04-008.js
+./15/15.08/15.08.02/15.08.02.04/15.08.02.04-009.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-001.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-002.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-003.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-004.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-005.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-006.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-007.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-008.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-009.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-010.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-011.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-012.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-013.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-014.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-015.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-016.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-017.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-018.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-019.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-020.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-021.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-022.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-023.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-024.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-025.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-026.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-027.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-028.js
+./15/15.08/15.08.02/15.08.02.05/15.08.02.05-029.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-001.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-002.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-003.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-004.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-005.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-006.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-007.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-008.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-009.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-010.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-011.js
+./15/15.08/15.08.02/15.08.02.06/15.08.02.06-012.js
+./15/15.08/15.08.02/15.08.02.07/15.08.02.07-001.js
+./15/15.08/15.08.02/15.08.02.07/15.08.02.07-002.js
+./15/15.08/15.08.02/15.08.02.07/15.08.02.07-003.js
+./15/15.08/15.08.02/15.08.02.07/15.08.02.07-004.js
+./15/15.08/15.08.02/15.08.02.07/15.08.02.07-005.js
+./15/15.08/15.08.02/15.08.02.07/15.08.02.07-006.js
+./15/15.08/15.08.02/15.08.02.07/15.08.02.07-007.js
+./15/15.08/15.08.02/15.08.02.08/15.08.02.08-001.js
+./15/15.08/15.08.02/15.08.02.08/15.08.02.08-002.js
+./15/15.08/15.08.02/15.08.02.08/15.08.02.08-003.js
+./15/15.08/15.08.02/15.08.02.08/15.08.02.08-004.js
+./15/15.08/15.08.02/15.08.02.08/15.08.02.08-005.js
+./15/15.08/15.08.02/15.08.02.08/15.08.02.08-006.js
+./15/15.08/15.08.02/15.08.02.09/15.08.02.09-001.js
+./15/15.08/15.08.02/15.08.02.09/15.08.02.09-002.js
+./15/15.08/15.08.02/15.08.02.09/15.08.02.09-003.js
+./15/15.08/15.08.02/15.08.02.09/15.08.02.09-004.js
+./15/15.08/15.08.02/15.08.02.09/15.08.02.09-005.js
+./15/15.08/15.08.02/15.08.02.09/15.08.02.09-006.js
+./15/15.08/15.08.02/15.08.02.09/15.08.02.09-007.js
+./15/15.08/15.08.02/15.08.02.09/15.08.02.09-008.js
+./15/15.08/15.08.02/15.08.02.10/15.08.02.10-001.js
+./15/15.08/15.08.02/15.08.02.10/15.08.02.10-002.js
+./15/15.08/15.08.02/15.08.02.10/15.08.02.10-003.js
+./15/15.08/15.08.02/15.08.02.10/15.08.02.10-004.js
+./15/15.08/15.08.02/15.08.02.10/15.08.02.10-005.js
+./15/15.08/15.08.02/15.08.02.10/15.08.02.10-006.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-001.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-002.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-003.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-004.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-005.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-006.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-007.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-008.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-009.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-010.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-011.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-012.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-013.js
+./15/15.08/15.08.02/15.08.02.11/15.08.02.11-014.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-001.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-002.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-003.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-004.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-005.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-006.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-007.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-008.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-009.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-010.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-011.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-012.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-013.js
+./15/15.08/15.08.02/15.08.02.12/15.08.02.12-014.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-001.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-002.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-003.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-004.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-005.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-006.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-007.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-008.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-009.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-010.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-011.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-012.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-013.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-014.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-015.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-016.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-017.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-018.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-019.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-020.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-021.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-022.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-023.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-024.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-025.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-026.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-027.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-028.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-029.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-030.js
+./15/15.08/15.08.02/15.08.02.13/15.08.02.13-031.js
+./15/15.08/15.08.02/15.08.02.15/15.08.02.15-001.js
+./15/15.08/15.08.02/15.08.02.15/15.08.02.15-002.js
+./15/15.08/15.08.02/15.08.02.15/15.08.02.15-003.js
+./15/15.08/15.08.02/15.08.02.15/15.08.02.15-004.js
+./15/15.08/15.08.02/15.08.02.15/15.08.02.15-005.js
+./15/15.08/15.08.02/15.08.02.15/15.08.02.15-006.js
+./15/15.08/15.08.02/15.08.02.15/15.08.02.15-007.js
+./15/15.08/15.08.02/15.08.02.16/15.08.02.16-001.js
+./15/15.08/15.08.02/15.08.02.16/15.08.02.16-002.js
+./15/15.08/15.08.02/15.08.02.16/15.08.02.16-003.js
+./15/15.08/15.08.02/15.08.02.16/15.08.02.16-004.js
+./15/15.08/15.08.02/15.08.02.16/15.08.02.16-005.js
+./15/15.08/15.08.02/15.08.02.17/15.08.02.17-001.js
+./15/15.08/15.08.02/15.08.02.17/15.08.02.17-002.js
+./15/15.08/15.08.02/15.08.02.17/15.08.02.17-003.js
+./15/15.08/15.08.02/15.08.02.17/15.08.02.17-004.js
+./15/15.08/15.08.02/15.08.02.17/15.08.02.17-005.js
+./15/15.08/15.08.02/15.08.02.18/15.08.02.18-001.js
+./15/15.08/15.08.02/15.08.02.18/15.08.02.18-002.js
+./15/15.08/15.08.02/15.08.02.18/15.08.02.18-003.js
+./15/15.08/15.08.02/15.08.02.18/15.08.02.18-004.js
+./15/15.08/15.08.02/15.08.02.18/15.08.02.18-005.js
+./15/15.08/15.08.02/15.08.02.18/15.08.02.18-006.js
+./15/15.08/15.08.02/15.08.02.18/15.08.02.18-007.js
diff --git a/deps/jerry/tests/jerry-test-suite/minimal-profile-list b/deps/jerry/tests/jerry-test-suite/minimal-profile-list
new file mode 100644 (file)
index 0000000..126d88b
--- /dev/null
@@ -0,0 +1,765 @@
+./06/06-002.js
+./06/06-003.js
+./06/06-004.js
+./06/06-005.js
+./07/07.06/07.06.01/07.06.01-001.js
+./07/07.09/07.09-001.js
+./07/07.09/07.09-002.js
+./07/07.09/07.09-003.js
+./07/07.09/07.09-004.js
+./07/07.09/07.09-005.js
+./07/07.09/07.09-006.js
+./07/07.09/07.09-007.js
+./07/07.09/07.09-008.js
+./07/07.09/07.09-009.js
+./07/07.09/07.09-010.js
+./08/08.01/08.01-001.js
+./08/08.01/08.01-002.js
+./08/08.01/08.01-003.js
+./08/08.01/08.01-004.js
+./08/08.01/08.01-005.js
+./08/08.01/08.01-006.js
+./08/08.01/08.01-007.js
+./08/08.01/08.01-008.js
+./08/08.01/08.01-009.js
+./08/08.01/08.01-010.js
+./08/08.01/08.01-011.js
+./08/08.02/08.02-001.js
+./08/08.02/08.02-002.js
+./08/08.03/08.03-001.js
+./08/08.03/08.03-002.js
+./08/08.03/08.03-003.js
+./08/08.03/08.03-004.js
+./08/08.04/08.04-001.js
+./08/08.04/08.04-002.js
+./08/08.04/08.04-004.js
+./08/08.04/08.04-005.js
+./08/08.05/08.05-001.js
+./08/08.05/08.05-002.js
+./08/08.05/08.05-003.js
+./08/08.12/08.12.02/08.12.02-001.js
+./10/10.03/10.03.01/10.03.01-001.js
+./11/11.01/11.01.05/11.01.05-001.js
+./11/11.01/11.01.05/11.01.05-002.js
+./11/11.01/11.01.05/11.01.05-003.js
+./11/11.01/11.01.05/11.01.05-004.js
+./11/11.01/11.01.05/11.01.05-005.js
+./11/11.01/11.01.05/11.01.05-006.js
+./11/11.01/11.01.05/11.01.05-007.js
+./11/11.01/11.01.05/11.01.05-008.js
+./11/11.01/11.01.06/11.01.06-001.js
+./11/11.01/11.01.06/11.01.06-002.js
+./11/11.01/11.01.06/11.01.06-003.js
+./11/11.01/11.01.06/11.01.06-009.js
+./11/11.02/11.02.01/11.02.01-001.js
+./11/11.02/11.02.01/11.02.01-002.js
+./11/11.02/11.02.01/11.02.01-003.js
+./11/11.02/11.02.01/11.02.01-004.js
+./11/11.02/11.02.01/11.02.01-007.js
+./11/11.02/11.02.01/11.02.01-008.js
+./11/11.02/11.02.01/11.02.01-009.js
+./11/11.02/11.02.01/11.02.01-010.js
+./11/11.02/11.02.01/11.02.01-011.js
+./11/11.02/11.02.02/11.02.02-001.js
+./11/11.02/11.02.02/11.02.02-002.js
+./11/11.02/11.02.02/11.02.02-003.js
+./11/11.02/11.02.02/11.02.02-004.js
+./11/11.02/11.02.02/11.02.02-005.js
+./11/11.02/11.02.02/11.02.02-006.js
+./11/11.02/11.02.02/11.02.02-007.js
+./11/11.02/11.02.02/11.02.02-008.js
+./11/11.02/11.02.02/11.02.02-009.js
+./11/11.02/11.02.03/11.02.03-006.js
+./11/11.02/11.02.03/11.02.03-007.js
+./11/11.02/11.02.03/11.02.03-008.js
+./11/11.02/11.02.03/11.02.03-021.js
+./11/11.02/11.02.04/11.02.04-016.js
+./11/11.02/11.02.04/11.02.04-018.js
+./11/11.02/11.02.04/11.02.04-019.js
+./11/11.03/11.03.01/11.03.01-005.js
+./11/11.03/11.03.01/11.03.01-006.js
+./11/11.03/11.03.01/11.03.01-007.js
+./11/11.03/11.03.01/11.03.01-008.js
+./11/11.03/11.03.01/11.03.01-009.js
+./11/11.03/11.03.01/11.03.01-010.js
+./11/11.03/11.03.01/11.03.01-011.js
+./11/11.03/11.03.01/11.03.01-012.js
+./11/11.03/11.03.01/11.03.01-013.js
+./11/11.03/11.03.01/11.03.01-014.js
+./11/11.03/11.03.01/11.03.01-015.js
+./11/11.03/11.03.01/11.03.01-016.js
+./11/11.03/11.03.02/11.03.02-005.js
+./11/11.03/11.03.02/11.03.02-006.js
+./11/11.03/11.03.02/11.03.02-007.js
+./11/11.03/11.03.02/11.03.02-008.js
+./11/11.03/11.03.02/11.03.02-009.js
+./11/11.03/11.03.02/11.03.02-010.js
+./11/11.03/11.03.02/11.03.02-011.js
+./11/11.03/11.03.02/11.03.02-012.js
+./11/11.03/11.03.02/11.03.02-013.js
+./11/11.03/11.03.02/11.03.02-014.js
+./11/11.03/11.03.02/11.03.02-015.js
+./11/11.03/11.03.02/11.03.02-016.js
+./11/11.04/11.04.01/11.04.01-001.js
+./11/11.04/11.04.01/11.04.01-002.js
+./11/11.04/11.04.01/11.04.01-004.js
+./11/11.04/11.04.01/11.04.01-005.js
+./11/11.04/11.04.01/11.04.01-006.js
+./11/11.04/11.04.01/11.04.01-007.js
+./11/11.04/11.04.01/11.04.01-008.js
+./11/11.04/11.04.01/11.04.01-009.js
+./11/11.04/11.04.01/11.04.01-010.js
+./11/11.04/11.04.01/11.04.01-011.js
+./11/11.04/11.04.01/11.04.01-012.js
+./11/11.04/11.04.01/11.04.01-017.js
+./11/11.04/11.04.02/11.04.02-001.js
+./11/11.04/11.04.02/11.04.02-002.js
+./11/11.04/11.04.03/11.04.03-001.js
+./11/11.04/11.04.03/11.04.03-002.js
+./11/11.04/11.04.03/11.04.03-004.js
+./11/11.04/11.04.03/11.04.03-006.js
+./11/11.04/11.04.03/11.04.03-008.js
+./11/11.04/11.04.03/11.04.03-009.js
+./11/11.04/11.04.03/11.04.03-011.js
+./11/11.04/11.04.03/11.04.03-013.js
+./11/11.04/11.04.03/11.04.03-016.js
+./11/11.04/11.04.04/11.04.04-001.js
+./11/11.04/11.04.04/11.04.04-002.js
+./11/11.04/11.04.04/11.04.04-004.js
+./11/11.04/11.04.04/11.04.04-005.js
+./11/11.04/11.04.04/11.04.04-006.js
+./11/11.04/11.04.04/11.04.04-007.js
+./11/11.04/11.04.04/11.04.04-008.js
+./11/11.04/11.04.04/11.04.04-009.js
+./11/11.04/11.04.04/11.04.04-010.js
+./11/11.04/11.04.04/11.04.04-011.js
+./11/11.04/11.04.05/11.04.05-001.js
+./11/11.04/11.04.05/11.04.05-002.js
+./11/11.04/11.04.05/11.04.05-004.js
+./11/11.04/11.04.05/11.04.05-005.js
+./11/11.04/11.04.05/11.04.05-007.js
+./11/11.04/11.04.05/11.04.05-008.js
+./11/11.04/11.04.05/11.04.05-009.js
+./11/11.04/11.04.05/11.04.05-010.js
+./11/11.04/11.04.05/11.04.05-011.js
+./11/11.04/11.04.06/11.04.06-001.js
+./11/11.04/11.04.06/11.04.06-002.js
+./11/11.04/11.04.06/11.04.06-003.js
+./11/11.04/11.04.06/11.04.06-005.js
+./11/11.04/11.04.06/11.04.06-006.js
+./11/11.04/11.04.06/11.04.06-014.js
+./11/11.04/11.04.06/11.04.06-015.js
+./11/11.04/11.04.06/11.04.06-016.js
+./11/11.04/11.04.06/11.04.06-018.js
+./11/11.04/11.04.06/11.04.06-019.js
+./11/11.04/11.04.06/11.04.06-020.js
+./11/11.04/11.04.06/11.04.06-021.js
+./11/11.04/11.04.06/11.04.06-022.js
+./11/11.04/11.04.06/11.04.06-023.js
+./11/11.04/11.04.06/11.04.06-025.js
+./11/11.04/11.04.06/11.04.06-027.js
+./11/11.04/11.04.06/11.04.06-028.js
+./11/11.04/11.04.07/11.04.07-001.js
+./11/11.04/11.04.07/11.04.07-002.js
+./11/11.04/11.04.07/11.04.07-003.js
+./11/11.04/11.04.07/11.04.07-005.js
+./11/11.04/11.04.07/11.04.07-006.js
+./11/11.04/11.04.07/11.04.07-007.js
+./11/11.04/11.04.07/11.04.07-008.js
+./11/11.04/11.04.07/11.04.07-009.js
+./11/11.04/11.04.07/11.04.07-010.js
+./11/11.04/11.04.07/11.04.07-011.js
+./11/11.04/11.04.07/11.04.07-012.js
+./11/11.04/11.04.07/11.04.07-013.js
+./11/11.04/11.04.07/11.04.07-023.js
+./11/11.04/11.04.07/11.04.07-024.js
+./11/11.04/11.04.07/11.04.07-025.js
+./11/11.04/11.04.07/11.04.07-026.js
+./11/11.04/11.04.07/11.04.07-027.js
+./11/11.04/11.04.07/11.04.07-028.js
+./11/11.04/11.04.07/11.04.07-029.js
+./11/11.04/11.04.07/11.04.07-030.js
+./11/11.04/11.04.07/11.04.07-031.js
+./11/11.04/11.04.07/11.04.07-032.js
+./11/11.04/11.04.07/11.04.07-033.js
+./11/11.04/11.04.08/11.04.08-001.js
+./11/11.04/11.04.08/11.04.08-002.js
+./11/11.04/11.04.08/11.04.08-003.js
+./11/11.04/11.04.08/11.04.08-004.js
+./11/11.04/11.04.08/11.04.08-005.js
+./11/11.04/11.04.08/11.04.08-006.js
+./11/11.04/11.04.08/11.04.08-007.js
+./11/11.04/11.04.08/11.04.08-008.js
+./11/11.04/11.04.08/11.04.08-009.js
+./11/11.04/11.04.08/11.04.08-010.js
+./11/11.04/11.04.08/11.04.08-011.js
+./11/11.04/11.04.08/11.04.08-012.js
+./11/11.04/11.04.08/11.04.08-013.js
+./11/11.04/11.04.08/11.04.08-014.js
+./11/11.04/11.04.08/11.04.08-015.js
+./11/11.04/11.04.08/11.04.08-016.js
+./11/11.04/11.04.08/11.04.08-017.js
+./11/11.04/11.04.08/11.04.08-018.js
+./11/11.04/11.04.08/11.04.08-019.js
+./11/11.04/11.04.08/11.04.08-020.js
+./11/11.04/11.04.08/11.04.08-021.js
+./11/11.04/11.04.09/11.04.09-001.js
+./11/11.04/11.04.09/11.04.09-002.js
+./11/11.04/11.04.09/11.04.09-003.js
+./11/11.04/11.04.09/11.04.09-004.js
+./11/11.04/11.04.09/11.04.09-005.js
+./11/11.04/11.04.09/11.04.09-006.js
+./11/11.04/11.04.09/11.04.09-007.js
+./11/11.04/11.04.09/11.04.09-008.js
+./11/11.04/11.04.09/11.04.09-009.js
+./11/11.04/11.04.09/11.04.09-010.js
+./11/11.04/11.04.09/11.04.09-011.js
+./11/11.04/11.04.09/11.04.09-012.js
+./11/11.04/11.04.09/11.04.09-013.js
+./11/11.04/11.04.09/11.04.09-014.js
+./11/11.04/11.04.09/11.04.09-015.js
+./11/11.04/11.04.09/11.04.09-016.js
+./11/11.04/11.04.09/11.04.09-017.js
+./11/11.04/11.04.09/11.04.09-018.js
+./11/11.04/11.04.09/11.04.09-019.js
+./11/11.05/11.05.01/11.05.01-001.js
+./11/11.05/11.05.01/11.05.01-002.js
+./11/11.05/11.05.01/11.05.01-003.js
+./11/11.05/11.05.01/11.05.01-004.js
+./11/11.05/11.05.01/11.05.01-005.js
+./11/11.05/11.05.01/11.05.01-006.js
+./11/11.05/11.05.01/11.05.01-007.js
+./11/11.05/11.05.01/11.05.01-008.js
+./11/11.05/11.05.01/11.05.01-009.js
+./11/11.05/11.05.01/11.05.01-010.js
+./11/11.05/11.05.01/11.05.01-011.js
+./11/11.05/11.05.01/11.05.01-012.js
+./11/11.05/11.05.01/11.05.01-013.js
+./11/11.05/11.05.01/11.05.01-014.js
+./11/11.05/11.05.01/11.05.01-015.js
+./11/11.05/11.05.01/11.05.01-016.js
+./11/11.05/11.05.01/11.05.01-017.js
+./11/11.05/11.05.01/11.05.01-018.js
+./11/11.05/11.05.01/11.05.01-019.js
+./11/11.05/11.05.01/11.05.01-020.js
+./11/11.05/11.05.01/11.05.01-021.js
+./11/11.05/11.05.01/11.05.01-022.js
+./11/11.05/11.05.01/11.05.01-023.js
+./11/11.05/11.05.01/11.05.01-024.js
+./11/11.05/11.05.01/11.05.01-025.js
+./11/11.05/11.05.01/11.05.01-026.js
+./11/11.05/11.05.01/11.05.01-027.js
+./11/11.05/11.05.01/11.05.01-028.js
+./11/11.05/11.05.01/11.05.01-029.js
+./11/11.05/11.05.01/11.05.01-030.js
+./11/11.05/11.05.01/11.05.01-031.js
+./11/11.05/11.05.01/11.05.01-032.js
+./11/11.05/11.05.01/11.05.01-033.js
+./11/11.05/11.05.01/11.05.01-034.js
+./11/11.05/11.05.01/11.05.01-035.js
+./11/11.05/11.05.01/11.05.01-036.js
+./11/11.05/11.05.01/11.05.01-037.js
+./11/11.05/11.05.01/11.05.01-059.js
+./11/11.05/11.05.02/11.05.02-001.js
+./11/11.05/11.05.02/11.05.02-002.js
+./11/11.05/11.05.02/11.05.02-003.js
+./11/11.05/11.05.02/11.05.02-004.js
+./11/11.05/11.05.02/11.05.02-005.js
+./11/11.05/11.05.02/11.05.02-006.js
+./11/11.05/11.05.02/11.05.02-007.js
+./11/11.05/11.05.02/11.05.02-008.js
+./11/11.05/11.05.02/11.05.02-009.js
+./11/11.05/11.05.02/11.05.02-011.js
+./11/11.05/11.05.02/11.05.02-012.js
+./11/11.05/11.05.02/11.05.02-013.js
+./11/11.05/11.05.02/11.05.02-014.js
+./11/11.05/11.05.02/11.05.02-015.js
+./11/11.05/11.05.02/11.05.02-016.js
+./11/11.05/11.05.02/11.05.02-017.js
+./11/11.05/11.05.02/11.05.02-018.js
+./11/11.05/11.05.02/11.05.02-019.js
+./11/11.05/11.05.02/11.05.02-020.js
+./11/11.05/11.05.02/11.05.02-021.js
+./11/11.05/11.05.02/11.05.02-022.js
+./11/11.05/11.05.02/11.05.02-023.js
+./11/11.05/11.05.02/11.05.02-025.js
+./11/11.05/11.05.02/11.05.02-026.js
+./11/11.05/11.05.02/11.05.02-027.js
+./11/11.05/11.05.02/11.05.02-028.js
+./11/11.05/11.05.02/11.05.02-029.js
+./11/11.05/11.05.02/11.05.02-030.js
+./11/11.05/11.05.02/11.05.02-031.js
+./11/11.05/11.05.02/11.05.02-033.js
+./11/11.05/11.05.02/11.05.02-034.js
+./11/11.05/11.05.02/11.05.02-035.js
+./11/11.05/11.05.02/11.05.02-036.js
+./11/11.05/11.05.02/11.05.02-037.js
+./11/11.05/11.05.02/11.05.02-059.js
+./11/11.05/11.05.02/11.05.02-084.js
+./11/11.05/11.05.02/11.05.02-090.js
+./11/11.05/11.05.03/11.05.03-001.js
+./11/11.05/11.05.03/11.05.03-002.js
+./11/11.05/11.05.03/11.05.03-003.js
+./11/11.05/11.05.03/11.05.03-004.js
+./11/11.05/11.05.03/11.05.03-005.js
+./11/11.05/11.05.03/11.05.03-006.js
+./11/11.05/11.05.03/11.05.03-007.js
+./11/11.05/11.05.03/11.05.03-008.js
+./11/11.05/11.05.03/11.05.03-009.js
+./11/11.05/11.05.03/11.05.03-010.js
+./11/11.05/11.05.03/11.05.03-011.js
+./11/11.05/11.05.03/11.05.03-012.js
+./11/11.05/11.05.03/11.05.03-013.js
+./11/11.05/11.05.03/11.05.03-014.js
+./11/11.05/11.05.03/11.05.03-015.js
+./11/11.05/11.05.03/11.05.03-016.js
+./11/11.05/11.05.03/11.05.03-017.js
+./11/11.05/11.05.03/11.05.03-018.js
+./11/11.05/11.05.03/11.05.03-019.js
+./11/11.05/11.05.03/11.05.03-020.js
+./11/11.05/11.05.03/11.05.03-023.js
+./11/11.05/11.05.03/11.05.03-024.js
+./11/11.05/11.05.03/11.05.03-025.js
+./11/11.05/11.05.03/11.05.03-026.js
+./11/11.05/11.05.03/11.05.03-027.js
+./11/11.05/11.05.03/11.05.03-028.js
+./11/11.06/11.06.01/11.06.01-001.js
+./11/11.06/11.06.01/11.06.01-002.js
+./11/11.06/11.06.01/11.06.01-003.js
+./11/11.06/11.06.01/11.06.01-004.js
+./11/11.06/11.06.01/11.06.01-005.js
+./11/11.06/11.06.01/11.06.01-006.js
+./11/11.06/11.06.01/11.06.01-008.js
+./11/11.06/11.06.01/11.06.01-011.js
+./11/11.06/11.06.01/11.06.01-012.js
+./11/11.06/11.06.01/11.06.01-013.js
+./11/11.06/11.06.01/11.06.01-014.js
+./11/11.06/11.06.01/11.06.01-015.js
+./11/11.06/11.06.01/11.06.01-017.js
+./11/11.06/11.06.02/11.06.02-001.js
+./11/11.06/11.06.02/11.06.02-002.js
+./11/11.06/11.06.02/11.06.02-003.js
+./11/11.06/11.06.02/11.06.02-004.js
+./11/11.06/11.06.02/11.06.02-005.js
+./11/11.06/11.06.02/11.06.02-006.js
+./11/11.06/11.06.02/11.06.02-007.js
+./11/11.06/11.06.02/11.06.02-008.js
+./11/11.06/11.06.02/11.06.02-009.js
+./11/11.06/11.06.02/11.06.02-010.js
+./11/11.06/11.06.02/11.06.02-013.js
+./11/11.06/11.06.02/11.06.02-016.js
+./11/11.06/11.06.02/11.06.02-017.js
+./11/11.06/11.06.03/11.06.03-001.js
+./11/11.06/11.06.03/11.06.03-002.js
+./11/11.06/11.06.03/11.06.03-003.js
+./11/11.06/11.06.03/11.06.03-004.js
+./11/11.06/11.06.03/11.06.03-005.js
+./11/11.06/11.06.03/11.06.03-006.js
+./11/11.06/11.06.03/11.06.03-007.js
+./11/11.06/11.06.03/11.06.03-008.js
+./11/11.06/11.06.03/11.06.03-009.js
+./11/11.06/11.06.03/11.06.03-010.js
+./11/11.06/11.06.03/11.06.03-011.js
+./11/11.06/11.06.03/11.06.03-016.js
+./11/11.06/11.06.03/11.06.03-018.js
+./11/11.06/11.06.03/11.06.03-020.js
+./11/11.06/11.06.03/11.06.03-021.js
+./11/11.06/11.06.03/11.06.03-024.js
+./11/11.06/11.06.03/11.06.03-025.js
+./11/11.07/11.07.01/11.07.01-001.js
+./11/11.07/11.07.01/11.07.01-003.js
+./11/11.07/11.07.01/11.07.01-004.js
+./11/11.07/11.07.01/11.07.01-005.js
+./11/11.07/11.07.01/11.07.01-006.js
+./11/11.07/11.07.01/11.07.01-007.js
+./11/11.07/11.07.01/11.07.01-008.js
+./11/11.07/11.07.02/11.07.02-001.js
+./11/11.07/11.07.02/11.07.02-002.js
+./11/11.07/11.07.02/11.07.02-003.js
+./11/11.07/11.07.02/11.07.02-004.js
+./11/11.07/11.07.02/11.07.02-005.js
+./11/11.07/11.07.02/11.07.02-006.js
+./11/11.07/11.07.02/11.07.02-007.js
+./11/11.07/11.07.02/11.07.02-008.js
+./11/11.07/11.07.02/11.07.02-009.js
+./11/11.07/11.07.03/11.07.03-001.js
+./11/11.07/11.07.03/11.07.03-002.js
+./11/11.07/11.07.03/11.07.03-003.js
+./11/11.07/11.07.03/11.07.03-004.js
+./11/11.07/11.07.03/11.07.03-005.js
+./11/11.07/11.07.03/11.07.03-006.js
+./11/11.07/11.07.03/11.07.03-007.js
+./11/11.08/11.08.01/11.08.01-001.js
+./11/11.08/11.08.01/11.08.01-002.js
+./11/11.08/11.08.01/11.08.01-003.js
+./11/11.08/11.08.01/11.08.01-004.js
+./11/11.08/11.08.01/11.08.01-005.js
+./11/11.08/11.08.01/11.08.01-006.js
+./11/11.08/11.08.02/11.08.02-001.js
+./11/11.08/11.08.02/11.08.02-002.js
+./11/11.08/11.08.02/11.08.02-003.js
+./11/11.08/11.08.02/11.08.02-004.js
+./11/11.08/11.08.02/11.08.02-005.js
+./11/11.08/11.08.02/11.08.02-006.js
+./11/11.08/11.08.03/11.08.03-001.js
+./11/11.08/11.08.03/11.08.03-002.js
+./11/11.08/11.08.03/11.08.03-003.js
+./11/11.08/11.08.03/11.08.03-004.js
+./11/11.08/11.08.03/11.08.03-005.js
+./11/11.08/11.08.03/11.08.03-006.js
+./11/11.08/11.08.03/11.08.03-007.js
+./11/11.08/11.08.03/11.08.03-008.js
+./11/11.08/11.08.03/11.08.03-009.js
+./11/11.08/11.08.03/11.08.03-011.js
+./11/11.08/11.08.04/11.08.04-001.js
+./11/11.08/11.08.04/11.08.04-002.js
+./11/11.08/11.08.04/11.08.04-003.js
+./11/11.08/11.08.04/11.08.04-004.js
+./11/11.08/11.08.04/11.08.04-005.js
+./11/11.08/11.08.04/11.08.04-006.js
+./11/11.08/11.08.04/11.08.04-007.js
+./11/11.08/11.08.04/11.08.04-008.js
+./11/11.08/11.08.04/11.08.04-009.js
+./11/11.08/11.08.06/11.08.06-006.js
+./11/11.08/11.08.06/11.08.06-007.js
+./11/11.08/11.08.07/11.08.07-001.js
+./11/11.08/11.08.07/11.08.07-002.js
+./11/11.08/11.08.07/11.08.07-003.js
+./11/11.08/11.08.07/11.08.07-004.js
+./11/11.08/11.08.07/11.08.07-005.js
+./11/11.08/11.08.07/11.08.07-007.js
+./11/11.08/11.08.07/11.08.07-008.js
+./11/11.08/11.08.07/11.08.07-009.js
+./11/11.09/11.09.01/11.09.01-001.js
+./11/11.09/11.09.01/11.09.01-002.js
+./11/11.09/11.09.01/11.09.01-003.js
+./11/11.09/11.09.01/11.09.01-004.js
+./11/11.09/11.09.01/11.09.01-005.js
+./11/11.09/11.09.01/11.09.01-006.js
+./11/11.09/11.09.01/11.09.01-007.js
+./11/11.09/11.09.01/11.09.01-008.js
+./11/11.09/11.09.01/11.09.01-009.js
+./11/11.09/11.09.01/11.09.01-010.js
+./11/11.09/11.09.01/11.09.01-011.js
+./11/11.09/11.09.01/11.09.01-012.js
+./11/11.09/11.09.01/11.09.01-013.js
+./11/11.09/11.09.01/11.09.01-014.js
+./11/11.09/11.09.01/11.09.01-015.js
+./11/11.09/11.09.01/11.09.01-016.js
+./11/11.09/11.09.01/11.09.01-017.js
+./11/11.09/11.09.01/11.09.01-018.js
+./11/11.09/11.09.01/11.09.01-019.js
+./11/11.09/11.09.01/11.09.01-020.js
+./11/11.09/11.09.01/11.09.01-021.js
+./11/11.09/11.09.01/11.09.01-022.js
+./11/11.09/11.09.01/11.09.01-023.js
+./11/11.09/11.09.01/11.09.01-024.js
+./11/11.09/11.09.01/11.09.01-025.js
+./11/11.09/11.09.01/11.09.01-026.js
+./11/11.09/11.09.01/11.09.01-028.js
+./11/11.09/11.09.01/11.09.01-029.js
+./11/11.09/11.09.01/11.09.01-030.js
+./11/11.09/11.09.01/11.09.01-031.js
+./11/11.09/11.09.01/11.09.01-032.js
+./11/11.09/11.09.01/11.09.01-033.js
+./11/11.09/11.09.01/11.09.01-034.js
+./11/11.09/11.09.01/11.09.01-035.js
+./11/11.09/11.09.01/11.09.01-036.js
+./11/11.09/11.09.01/11.09.01-037.js
+./11/11.09/11.09.02/11.09.02-001.js
+./11/11.09/11.09.02/11.09.02-002.js
+./11/11.09/11.09.02/11.09.02-003.js
+./11/11.09/11.09.02/11.09.02-004.js
+./11/11.09/11.09.02/11.09.02-005.js
+./11/11.09/11.09.02/11.09.02-006.js
+./11/11.09/11.09.02/11.09.02-007.js
+./11/11.09/11.09.02/11.09.02-008.js
+./11/11.09/11.09.02/11.09.02-009.js
+./11/11.09/11.09.02/11.09.02-010.js
+./11/11.09/11.09.02/11.09.02-011.js
+./11/11.09/11.09.02/11.09.02-012.js
+./11/11.09/11.09.02/11.09.02-013.js
+./11/11.09/11.09.02/11.09.02-014.js
+./11/11.09/11.09.02/11.09.02-015.js
+./11/11.09/11.09.02/11.09.02-016.js
+./11/11.09/11.09.02/11.09.02-017.js
+./11/11.09/11.09.02/11.09.02-018.js
+./11/11.09/11.09.02/11.09.02-019.js
+./11/11.09/11.09.02/11.09.02-020.js
+./11/11.09/11.09.02/11.09.02-021.js
+./11/11.09/11.09.02/11.09.02-022.js
+./11/11.09/11.09.02/11.09.02-023.js
+./11/11.09/11.09.02/11.09.02-024.js
+./11/11.09/11.09.02/11.09.02-025.js
+./11/11.09/11.09.02/11.09.02-026.js
+./11/11.09/11.09.02/11.09.02-028.js
+./11/11.09/11.09.02/11.09.02-029.js
+./11/11.09/11.09.02/11.09.02-030.js
+./11/11.09/11.09.02/11.09.02-031.js
+./11/11.09/11.09.02/11.09.02-032.js
+./11/11.09/11.09.02/11.09.02-033.js
+./11/11.09/11.09.02/11.09.02-034.js
+./11/11.09/11.09.02/11.09.02-035.js
+./11/11.09/11.09.02/11.09.02-036.js
+./11/11.09/11.09.04/11.09.04-001.js
+./11/11.09/11.09.04/11.09.04-002.js
+./11/11.09/11.09.04/11.09.04-003.js
+./11/11.09/11.09.04/11.09.04-004.js
+./11/11.09/11.09.04/11.09.04-006.js
+./11/11.09/11.09.04/11.09.04-007.js
+./11/11.09/11.09.04/11.09.04-008.js
+./11/11.09/11.09.04/11.09.04-009.js
+./11/11.09/11.09.04/11.09.04-011.js
+./11/11.09/11.09.04/11.09.04-012.js
+./11/11.09/11.09.04/11.09.04-013.js
+./11/11.09/11.09.04/11.09.04-014.js
+./11/11.09/11.09.04/11.09.04-015.js
+./11/11.09/11.09.04/11.09.04-016.js
+./11/11.09/11.09.04/11.09.04-017.js
+./11/11.09/11.09.04/11.09.04-018.js
+./11/11.09/11.09.04/11.09.04-019.js
+./11/11.09/11.09.04/11.09.04-020.js
+./11/11.09/11.09.04/11.09.04-021.js
+./11/11.09/11.09.04/11.09.04-022.js
+./11/11.09/11.09.04/11.09.04-023.js
+./11/11.09/11.09.05/11.09.05-001.js
+./11/11.09/11.09.05/11.09.05-002.js
+./11/11.09/11.09.05/11.09.05-003.js
+./11/11.09/11.09.05/11.09.05-004.js
+./11/11.09/11.09.05/11.09.05-006.js
+./11/11.09/11.09.05/11.09.05-007.js
+./11/11.09/11.09.05/11.09.05-008.js
+./11/11.09/11.09.05/11.09.05-009.js
+./11/11.09/11.09.05/11.09.05-011.js
+./11/11.09/11.09.05/11.09.05-012.js
+./11/11.09/11.09.05/11.09.05-013.js
+./11/11.09/11.09.05/11.09.05-014.js
+./11/11.09/11.09.05/11.09.05-015.js
+./11/11.09/11.09.05/11.09.05-016.js
+./11/11.09/11.09.05/11.09.05-017.js
+./11/11.09/11.09.05/11.09.05-018.js
+./11/11.09/11.09.05/11.09.05-019.js
+./11/11.09/11.09.05/11.09.05-020.js
+./11/11.09/11.09.05/11.09.05-021.js
+./11/11.09/11.09.05/11.09.05-022.js
+./11/11.09/11.09.05/11.09.05-023.js
+./11/11.10/11.10-001.js
+./11/11.10/11.10-002.js
+./11/11.10/11.10-003.js
+./11/11.10/11.10-004.js
+./11/11.10/11.10-005.js
+./11/11.10/11.10-006.js
+./11/11.10/11.10-007.js
+./11/11.10/11.10-008.js
+./11/11.10/11.10-009.js
+./11/11.10/11.10-010.js
+./11/11.10/11.10-011.js
+./11/11.10/11.10-012.js
+./11/11.10/11.10-013.js
+./11/11.10/11.10-014.js
+./11/11.10/11.10-015.js
+./11/11.10/11.10-016.js
+./11/11.11/11.11-001.js
+./11/11.11/11.11-002.js
+./11/11.11/11.11-003.js
+./11/11.11/11.11-004.js
+./11/11.11/11.11-005.js
+./11/11.11/11.11-006.js
+./11/11.11/11.11-007.js
+./11/11.11/11.11-008.js
+./11/11.11/11.11-009.js
+./11/11.11/11.11-010.js
+./11/11.11/11.11-011.js
+./11/11.11/11.11-012.js
+./11/11.11/11.11-013.js
+./11/11.11/11.11-014.js
+./11/11.11/11.11-015.js
+./11/11.11/11.11-016.js
+./11/11.11/11.11-017.js
+./11/11.11/11.11-018.js
+./11/11.11/11.11-019.js
+./11/11.11/11.11-020.js
+./11/11.11/11.11-021.js
+./11/11.11/11.11-022.js
+./11/11.11/11.11-023.js
+./11/11.11/11.11-024.js
+./11/11.11/11.11-027.js
+./11/11.12/11.12-001.js
+./11/11.12/11.12-002.js
+./11/11.12/11.12-003.js
+./11/11.12/11.12-004.js
+./11/11.12/11.12-005.js
+./11/11.12/11.12-008.js
+./11/11.12/11.12-012.js
+./11/11.13/11.13.01/11.13.01-001.js
+./11/11.13/11.13.02/11.13.02-001.js
+./11/11.13/11.13.02/11.13.02-002.js
+./11/11.13/11.13.02/11.13.02-003.js
+./11/11.13/11.13.02/11.13.02-004.js
+./11/11.13/11.13.02/11.13.02-005.js
+./11/11.13/11.13.02/11.13.02-006.js
+./11/11.13/11.13.02/11.13.02-007.js
+./11/11.13/11.13.02/11.13.02-008.js
+./11/11.13/11.13.02/11.13.02-009.js
+./11/11.13/11.13.02/11.13.02-010.js
+./11/11.13/11.13.02/11.13.02-011.js
+./11/11.13/11.13.02/11.13.02-039.js
+./11/11.13/11.13.02/11.13.02-040.js
+./11/11.13/11.13.02/11.13.02-041.js
+./11/11.13/11.13.02/11.13.02-042.js
+./11/11.13/11.13.02/11.13.02-043.js
+./11/11.13/11.13.02/11.13.02-044.js
+./11/11.13/11.13.02/11.13.02-045.js
+./11/11.13/11.13.02/11.13.02-046.js
+./11/11.13/11.13.02/11.13.02-047.js
+./11/11.13/11.13.02/11.13.02-048.js
+./11/11.13/11.13.02/11.13.02-049.js
+./11/11.13/11.13.02/11.13.02-050.js
+./11/11.13/11.13.02/11.13.02-051.js
+./11/11.14/11.14-001.js
+./11/11.14/11.14-002.js
+./12/12.01/12.01-001.js
+./12/12.01/12.01-002.js
+./12/12.01/12.01-003.js
+./12/12.01/12.01-004.js
+./12/12.01/12.01-005.js
+./12/12.02/12.02-001.js
+./12/12.02/12.02-002.js
+./12/12.02/12.02-003.js
+./12/12.02/12.02-004.js
+./12/12.02/12.02-005.js
+./12/12.02/12.02-006.js
+./12/12.02/12.02-007.js
+./12/12.02/12.02-008.js
+./12/12.02/12.02-009.js
+./12/12.02/12.02-010.js
+./12/12.02/12.02.01/12.02.01-001.js
+./12/12.02/12.02.01/12.02.01-002.js
+./12/12.02/12.02-011.js
+./12/12.02/12.02-012.js
+./12/12.02/12.02-013.js
+./12/12.02/12.02-014.js
+./12/12.02/12.02-015.js
+./12/12.02/12.02-016.js
+./12/12.02/12.02-019.js
+./12/12.02/12.02-022.js
+./12/12.03/12.03-001.js
+./12/12.03/12.03-002.js
+./12/12.03/12.03-003.js
+./12/12.04/12.04-001.js
+./12/12.04/12.04-002.js
+./12/12.04/12.04-003.js
+./12/12.04/12.04-004.js
+./12/12.05/12.05-001.js
+./12/12.05/12.05-002.js
+./12/12.05/12.05-003.js
+./12/12.05/12.05-004.js
+./12/12.05/12.05-005.js
+./12/12.05/12.05-006.js
+./12/12.05/12.05-007.js
+./12/12.05/12.05-008.js
+./12/12.06/12.06.01/12.06.01-001.js
+./12/12.06/12.06.01/12.06.01-002.js
+./12/12.06/12.06.01/12.06.01-003.js
+./12/12.06/12.06.01/12.06.01-004.js
+./12/12.06/12.06.01/12.06.01-005.js
+./12/12.06/12.06.01/12.06.01-006.js
+./12/12.06/12.06.01/12.06.01-007.js
+./12/12.06/12.06.01/12.06.01-008.js
+./12/12.06/12.06.01/12.06.01-009.js
+./12/12.06/12.06.01/12.06.01-010.js
+./12/12.06/12.06.02/12.06.02-001.js
+./12/12.06/12.06.02/12.06.02-002.js
+./12/12.06/12.06.02/12.06.02-003.js
+./12/12.06/12.06.02/12.06.02-004.js
+./12/12.06/12.06.02/12.06.02-005.js
+./12/12.06/12.06.02/12.06.02-006.js
+./12/12.06/12.06.02/12.06.02-007.js
+./12/12.06/12.06.02/12.06.02-008.js
+./12/12.06/12.06.03/12.06.03-001.js
+./12/12.06/12.06.03/12.06.03-002.js
+./12/12.06/12.06.03/12.06.03-003.js
+./12/12.06/12.06.03/12.06.03-004.js
+./12/12.06/12.06.03/12.06.03-005.js
+./12/12.06/12.06.03/12.06.03-006.js
+./12/12.06/12.06.03/12.06.03-007.js
+./12/12.06/12.06.03/12.06.03-008.js
+./12/12.06/12.06.03/12.06.03-009.js
+./12/12.06/12.06.03/12.06.03-010.js
+./12/12.06/12.06.03/12.06.03-011.js
+./12/12.07/12.07-001.js
+./12/12.07/12.07-002.js
+./12/12.07/12.07-007.js
+./12/12.07/12.07-008.js
+./12/12.07/12.07-011.js
+./12/12.07/12.07-012.js
+./12/12.08/12.08-003.js
+./12/12.08/12.08-004.js
+./12/12.08/12.08-007.js
+./12/12.08/12.08-008.js
+./12/12.08/12.08-011.js
+./12/12.08/12.08-012.js
+./12/12.09/12.09-001.js
+./12/12.09/12.09-002.js
+./12/12.09/12.09-003.js
+./12/12.09/12.09-004.js
+./12/12.09/12.09-005.js
+./12/12.09/12.09-006.js
+./12/12.10/12.10-002.js
+./12/12.10/12.10-003.js
+./12/12.10/12.10-005.js
+./12/12.10/12.10-006.js
+./12/12.11/12.11-001.js
+./12/12.11/12.11-002.js
+./12/12.11/12.11-003.js
+./12/12.11/12.11-004.js
+./12/12.11/12.11-005.js
+./12/12.11/12.11-006.js
+./12/12.11/12.11-007.js
+./12/12.13/12.13-001.js
+./12/12.13/12.13-002.js
+./12/12.13/12.13-003.js
+./12/12.14/12.14-001.js
+./12/12.14/12.14-002.js
+./12/12.14/12.14-003.js
+./12/12.14/12.14-004.js
+./12/12.14/12.14-005.js
+./12/12.14/12.14-006.js
+./13/13-001.js
+./13/13-002.js
+./13/13-003.js
+./13/13-004.js
+./13/13-005.js
+./13/13-006.js
+./13/13-007.js
+./13/13-009.js
+./13/13-010.js
+./13/13.01/13.01-001.js
+./13/13.02/13.02-001.js
+./13/13.02/13.02-003.js
+./13/13.02/13.02-004.js
+./13/13.02/13.02-005.js
+./13/13.02/13.02-006.js
+./13/13.02/13.02-007.js
+./15/15.02/15.02.01/15.02.01-001.js
+./15/15.02/15.02.01/15.02.01-002.js
+./15/15.02/15.02.01/15.02.01-003.js
+./15/15.02/15.02.01/15.02.01-004.js
+./15/15.02/15.02.01/15.02.01-005.js
+./15/15.02/15.02.01/15.02.01-006.js
+./15/15.02/15.02.01/15.02.01-007.js
+./15/15.02/15.02.01/15.02.01-008.js
+./15/15.02/15.02.02/15.02.02-001.js
+./15/15.02/15.02.02/15.02.02-002.js
+./15/15.02/15.02.02/15.02.02-003.js
+./15/15.02/15.02.03/15.02.03-002.js
+./15/15.02/15.02.04/15.02.04.01/15.02.04.01-002.js
+./15/15.02/15.02.04/15.02.04.02/15.02.04.02-003.js
+./15/15.02/15.02.04/15.02.04.03/15.02.04.03-001.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-001.js
+./15/15.02/15.02.04/15.02.04.04/15.02.04.04-003.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-002.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-004.js
+./15/15.03/15.03.02/15.03.02.01/15.03.02.01-007.js
+./15/15.03/15.03.03/15.03.03-003.js
+./15/15.03/15.03.03/15.03.03.01/15.03.03.01-001.js
diff --git a/deps/jerry/tests/jerry/N.compact-profile-error.js b/deps/jerry/tests/jerry/N.compact-profile-error.js
new file mode 100644 (file)
index 0000000..e91b308
--- /dev/null
@@ -0,0 +1,107 @@
+// 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.
+
+var catched = false;
+
+function f1()
+{
+  var arguments = 1;
+}
+
+try
+{
+  f1();
+} catch (e)
+{
+  assert (e === CompactProfileError);
+
+  catched = true;
+}
+
+assert(catched);
+
+catched = false;
+
+function f2()
+{
+  var a = arguments;
+}
+
+try
+{
+  f2();
+} catch (e)
+{
+  assert (e === CompactProfileError);
+
+  catched = true;
+}
+
+assert(catched);
+
+catched = false;
+
+try
+{
+  eval('abc');
+} catch (e)
+{
+  assert (e === CompactProfileError);
+
+  catched = true;
+}
+
+assert(catched);
+
+catched = false;
+
+try
+{
+  Function('abc');
+} catch (e)
+{
+  assert (e === CompactProfileError);
+
+  catched = true;
+}
+
+assert(catched);
+
+catched = false;
+
+try
+{
+  new Function('abc');
+} catch (e)
+{
+  assert (e === CompactProfileError);
+
+  catched = true;
+}
+
+assert(catched);
+
+catched = false;
+
+try
+{
+  var a = Date.now();
+} catch (e)
+{
+  assert (e === CompactProfileError);
+
+  catched = true;
+}
+
+assert(catched);
diff --git a/deps/jerry/tests/jerry/and-or.js b/deps/jerry/tests/jerry/and-or.js
new file mode 100644 (file)
index 0000000..78e4806
--- /dev/null
@@ -0,0 +1,36 @@
+// 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.
+
+function fail() {
+  assert (0);
+  return true;
+}
+
+if (false && fail()) {
+  assert (0);
+}
+
+if (true && false && fail()) {
+  assert (0);
+}
+
+if (true || fail()) {
+} else {
+  assert (0);
+}
+
+if (false || true || fail()) {
+} else {
+  assert (0);
+}
diff --git a/deps/jerry/tests/jerry/arguments.js b/deps/jerry/tests/jerry/arguments.js
new file mode 100644 (file)
index 0000000..a9b3193
--- /dev/null
@@ -0,0 +1,131 @@
+// 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.
+
+function f_arg (arguments)
+{
+  return arguments;
+}
+assert (f_arg (1) === 1);
+
+function f (a, b, c)
+{
+  return arguments;
+}
+
+args = f();
+assert (args[0] === undefined);
+
+args = f (1, 2, 3, 4, 5);
+assert (args[0] === 1);
+assert (args[1] === 2);
+assert (args[2] === 3);
+assert (args[3] === 4);
+assert (args[4] === 5);
+assert (args[5] === undefined);
+
+assert (args.callee === f);
+assert (typeof args.caller === 'undefined');
+
+function g (a, b, c)
+{
+  assert (arguments[0] === 1);
+  assert (arguments[1] === undefined);
+  assert (arguments[2] === undefined);
+
+  a = 'a';
+  b = 'b';
+  c = 'c';
+
+  assert (arguments[0] === 'a');
+  assert (arguments[1] === 'b');
+  assert (arguments[2] === 'c');
+
+  arguments [0] = 1;
+  arguments [1] = 2;
+  arguments [2] = 3;
+
+  assert (a === 1);
+  assert (b === 2);
+  assert (c === 3);
+
+  delete arguments [0];
+  arguments[0] = 'new value';
+  assert (a === 1);
+
+  a = 'a';
+  b = 'b';
+  c = 'c';
+
+  assert (arguments[0] === 'new value');
+  assert (arguments[1] === 'b');
+  assert (arguments[2] === 'c');
+}
+
+g (1);
+
+fn_expr = function (a, b, c)
+{
+  'use strict';
+
+  assert (arguments[0] === 1);
+  assert (arguments[1] === undefined);
+  assert (arguments[2] === undefined);
+
+  a = 'a';
+  b = 'b';
+  c = 'c';
+
+  assert (arguments[0] === 1);
+  assert (arguments[1] === undefined);
+  assert (arguments[2] === undefined);
+
+  arguments [0] = 1;
+  arguments [1] = 'p';
+  arguments [2] = 'q';
+
+  assert (a === 'a');
+  assert (b === 'b');
+  assert (c === 'c');
+
+  delete arguments [0];
+  arguments[0] = 'new value';
+  assert (a === 'a');
+
+  a = 'a';
+  b = 'b';
+  c = 'c';
+
+  assert (arguments[0] === 'new value');
+  assert (arguments[1] === 'p');
+  assert (arguments[2] === 'q');
+
+  function check_type_error_for_property (obj, prop) {
+    try {
+      var v = obj[prop];
+      assert (false);
+    }
+    catch (e) {
+      assert (e instanceof TypeError);
+    }
+  }
+
+  check_type_error_for_property (arguments, 'caller');
+  check_type_error_for_property (arguments, 'callee');
+}
+
+fn_expr (1);
+
+(function () {
+ var a = [arguments];
+})();
diff --git a/deps/jerry/tests/jerry/arithmetics-2.js b/deps/jerry/tests/jerry/arithmetics-2.js
new file mode 100644 (file)
index 0000000..3965465
--- /dev/null
@@ -0,0 +1,53 @@
+// 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.
+
+var a = 21;
+var b = 10;
+var c;
+
+c = a + b;
+assert(c == 31);
+
+c = a - b;
+assert(c == 11);
+
+c = a * b;
+assert(c == 210);
+
+c = a / b;
+assert(c >= 2.1 - 0.000001 && c <= 2.1 + 0.000001);
+
+c = a % b;
+assert(c == 1);
+
+c = a++;
+assert(c == 21);
+
+c = a--;
+assert(c == 22);
+
+var o = { p : 1 };
+
+assert (++o.p === 2);
+assert (o.p === 2);
+assert (--o.p === 1);
+assert (o.p === 1);
+
+try {
+  eval ('++ ++ a');
+  assert (false);
+}
+catch (e) {
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/arithmetics-bignums.js b/deps/jerry/tests/jerry/arithmetics-bignums.js
new file mode 100644 (file)
index 0000000..6b46bb3
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var big = 2147483646;
+
+big++;
+assert(big == 2147483647);
+
+big += 1;
+assert(big == 2147483648); // overflow on 32bit numbers
+
+big++;
+assert(big == 2147483649); // overflow on 32bit numbers
+
+assert ((1152921504606846976).toString() === "1152921504606847000")
+
+assert (1.797693134862315808e+308 === Infinity);
diff --git a/deps/jerry/tests/jerry/arithmetics.js b/deps/jerry/tests/jerry/arithmetics.js
new file mode 100644 (file)
index 0000000..a5d5735
--- /dev/null
@@ -0,0 +1,41 @@
+// 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.
+
+assert((1 + 2) == 3);
+assert((2 + 1) == 3);
+assert((2 + 1) != 4);
+
+assert((7 + 7) == 14);
+assert((7 - 7) == 0);
+assert((7 * 7) == 49);
+assert((7 / 7) == 1);
+assert((7 + 7) == 14);
+assert((7 % 7) == 0);
+
+var number = 81;
+assert((number + 9) == 90);
+assert((number - 9) == 72);
+assert((number * 10) == 810);
+assert((number / 9) == 9);
+assert((number % 79) == 2);
+
+var num1 = 1234567, num2 = 1234000;
+assert((num1 % num2) == 567);
+
+assert (1 / (-1 % -1) < 0);
+assert (1 / (-1 % 1) < 0);
+assert (1 / (1 % -1) > 0);
+assert (1 / (1 % 1) > 0);
+
+assert (eval ("x\n\n=\n\n6\n\n/\n\n3") === 2)
diff --git a/deps/jerry/tests/jerry/array-prototype-concat.js b/deps/jerry/tests/jerry/array-prototype-concat.js
new file mode 100644 (file)
index 0000000..dc1f378
--- /dev/null
@@ -0,0 +1,76 @@
+// 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.
+
+var array = ["foo", [], Infinity, 4]
+var new_arr = array.concat();
+
+assert(new_arr.length === array.length)
+for (i = 0; i < array.length; i++) {
+  assert(array[i] === new_arr[i]);
+}
+
+var obj = { concat : Array.prototype.concat };
+var arr1 = ["Apple", 6, "Peach"];
+var arr2 = [obj, "Cherry", "Grape"];
+
+var new_array = obj.concat(arr1);
+assert(new_array.length === 4);
+assert(new_array[0] === obj);
+assert(new_array[1] === "Apple");
+assert(new_array[2] === 6);
+assert(new_array[3] === "Peach");
+
+var new_array = arr1.concat(arr2, obj, 1);
+
+assert(new_array.length === 8);
+assert(new_array[0] === "Apple");
+assert(new_array[1] === 6);
+assert(new_array[2] === "Peach");
+assert(new_array[3] === obj);
+assert(new_array[4] === "Cherry");
+assert(new_array[5] === "Grape");
+assert(new_array[6] === obj);
+assert(new_array[7] === 1);
+
+var arr1 = [1,2];
+var arr2 = [4,5,6,7,8];
+var arr3 = [,,9,10];
+var arr4 = [];
+var expected = [1,2,4,5,6,7,8,,,9,10];
+
+var result = arr1.concat(arr2, arr3, arr4);
+
+assert(result.length === expected.length)
+for (i = 0; i < result.length; i++) {
+  assert(result[i] === expected[i]);
+}
+
+var arr1 = [];
+arr1.length = 2;
+var arr2 = [];
+arr2.length = 3;
+assert(arr1.concat(arr2).length === arr1.length + arr2.length);
+
+// Checking behavior when unable to get element
+var arr = []
+Object.defineProperty(arr, '0', { 'get' : function () {throw new ReferenceError ("foo"); } });
+arr.length = 1;
+
+try {
+  arr.concat();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-every.js b/deps/jerry/tests/jerry/array-prototype-every.js
new file mode 100644 (file)
index 0000000..b9cb534
--- /dev/null
@@ -0,0 +1,61 @@
+// 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.
+
+var array = ["foo", [], Infinity, 4];
+
+function f(arg1, arg2, arg3) {
+  assert(arg1 === array[arg2]);
+  assert(arg3 === array);
+  return true;
+}
+
+assert(array.every(f) === true);
+
+function g(arg1, arg2, arg3) {
+  if (arg1 === 1) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+var arr1 = [1, 1, 1, 1, 1, 2];
+assert(arr1.every(g) === false);
+
+var arr2 = [1, 1, 1, 1, 1, 1];
+assert(arr2.every(g) === true);
+
+// Checking behavior when unable to get length
+var obj = { every : Array.prototype.every };
+Object.defineProperty(obj, 'length', { 'get' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.every(f);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to get element
+var obj = { every : Array.prototype.every, length : 1};
+Object.defineProperty(obj, '0', { 'get' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.every(f);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-filter.js b/deps/jerry/tests/jerry/array-prototype-filter.js
new file mode 100644 (file)
index 0000000..d99bffc
--- /dev/null
@@ -0,0 +1,78 @@
+// 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.
+
+var array = ["foo", [], Infinity, 4]
+
+function f(arg1, arg2, arg3) {
+  assert(arg1 === array[arg2]);
+  assert(arg3 === array);
+  return true;
+}
+
+var filtered = array.filter(f);
+assert(filtered.length === array.length);
+for (i = 0; i < filtered.length; i++) {
+  assert(filtered[i] === array[i]);
+}
+
+var array = [1, 2, 3, 4, 5, 6, 7, 8];
+
+function g (arg1, arg2, arg3) {
+  if (arg2 % 2 === 0) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+filtered = array.filter(g)
+assert(filtered.length === 4);
+assert(filtered[0] === 1);
+assert(filtered[1] === 3);
+assert(filtered[2] === 5);
+assert(filtered[3] === 7);
+
+var arr = [1,2];
+Array.prototype[0] = 3;
+var newArr = arr.filter(function() { return true; });
+delete Array.prototype[0];
+assert(newArr.hasOwnProperty("0"));
+assert(newArr[0] === 1);
+
+// Checking behavior when unable to get length
+var obj = {};
+Object.defineProperty(obj, 'length', { 'get' : function () {throw new ReferenceError ("foo"); } });
+obj.filter = Array.prototype.filter;
+
+try {
+  obj.filter(f);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to get element
+var obj = {}
+obj.length = 1;
+Object.defineProperty(obj, '0', { 'get' : function () {throw new ReferenceError ("foo"); } });
+obj.filter = Array.prototype.filter
+
+try {
+  obj.filter(f);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-foreach.js b/deps/jerry/tests/jerry/array-prototype-foreach.js
new file mode 100644 (file)
index 0000000..a80f1a4
--- /dev/null
@@ -0,0 +1,49 @@
+// 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.
+
+var array = ["foo", [], Infinity, 4]
+
+function f(arg1, arg2, arg3) {
+  assert(arg1 === array[arg2]);
+  assert(arg3 === array);
+}
+
+array.forEach(f);
+
+// Checking behavior when unable to get length
+var obj = {};
+Object.defineProperty(obj, 'length', { 'get' : function () {throw new ReferenceError ("foo"); } });
+obj.forEach = Array.prototype.forEach;
+
+try {
+  obj.forEach(f);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to get element
+var obj = {}
+obj.length = 1;
+Object.defineProperty(obj, '0', { 'get' : function () {throw new ReferenceError ("foo"); } });
+obj.forEach = Array.prototype.forEach
+
+try {
+  obj.forEach(f);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-indexof.js b/deps/jerry/tests/jerry/array-prototype-indexof.js
new file mode 100644 (file)
index 0000000..ee77f80
--- /dev/null
@@ -0,0 +1,88 @@
+// 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.
+
+var obj = {};
+var array = ["foo", 19, "bar", obj, "foo", 29, "baz"];
+
+var index = array.indexOf("foo");
+assert(index === 0);
+assert(array[index] === "foo");
+
+assert(array.indexOf("foo", 1) === 4);
+assert(array.indexOf("foo", 5) === -1);
+
+var index = array.indexOf("baz");
+assert(index === 6);
+assert(array[index] === "baz");
+
+assert(array.indexOf("baz", 7) === -1);
+
+var index = array.indexOf(obj);
+assert(index === 3);
+assert(array[index] === obj);
+
+assert(array.indexOf("foo", NaN) === 0);
+assert(array.indexOf("foo", Infinity) === -1);
+assert(array.indexOf("foo", -Infinity) === 0);
+
+assert([true].indexOf(true, -0) === 0);
+
+// Checking behavior when length is zero
+var obj = { indexOf : Array.prototype.indexOf, length : 0 };
+assert(obj.indexOf("foo") === -1);
+
+// Checking behavior when start index >= length
+var arr = [11, 22, 33, 44];
+assert(arr.indexOf(44, 4) === -1);
+
+var fromIndex = {
+  toString: function () {
+    return {};
+  },
+
+  valueOf: function () {
+    return {};
+  }
+};
+
+try {
+  [0, 1].indexOf(1, fromIndex);
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// Checking behavior when unable to get length
+var obj = { indexOf : Array.prototype.indexOf}
+Object.defineProperty(obj, 'length', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj.indexOf("bar");
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to get element
+var obj = { indexOf : Array.prototype.indexOf, length : 1}
+Object.defineProperty(obj, '0', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj.indexOf("bar");
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-join.js b/deps/jerry/tests/jerry/array-prototype-join.js
new file mode 100644 (file)
index 0000000..96233d0
--- /dev/null
@@ -0,0 +1,76 @@
+// 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.
+
+assert ([].join() === "");
+assert ([1].join() === "1");
+assert ([1, 2].join() === "1,2");
+
+
+assert ([].join('--') === "");
+assert ([1].join("--") === "1");
+assert ([1, 2].join('--') === "1--2");
+
+assert ([1,2,3].join({toString: function() { return "--"; }}) === "1--2--3");
+
+
+// Join should use 'length' to as the number of elements int the array.
+var lst = [1,2,3,4];
+lst.length = 3;
+assert (lst.join() === [1,2,3].join());
+
+// Checking behavior when unable to get length.
+var obj = {};
+Object.defineProperty(obj, 'length', { 'get' : function () {throw new ReferenceError ("foo"); } });
+obj.join = Array.prototype.join;
+
+try {
+  obj.join();
+  // Should not be reached.
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+// Check join argument fail.
+try {
+  [1,2,3].join({toString: function() { throw new ReferenceError ("foo"); }});
+  // Should not be reached.
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+// Check single join element fail.
+try {
+  [1, 2, {toString: function() { throw new ReferenceError ("foo"); }}, 4].join();
+  // Should not be reached.
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+// Check join on different object.
+var obj_2 = {};
+obj_2.length = 3;
+obj_2[0] = 1;
+obj_2[1] = 2;
+obj_2[2] = 3;
+obj_2[3] = 4;
+
+obj_2.join = Array.prototype.join;
+
+assert (obj_2.join() === "1,2,3");
diff --git a/deps/jerry/tests/jerry/array-prototype-lastindexof.js b/deps/jerry/tests/jerry/array-prototype-lastindexof.js
new file mode 100644 (file)
index 0000000..4aa2c5f
--- /dev/null
@@ -0,0 +1,71 @@
+// 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.
+
+// This test will not pass on FLOAT32 due to precision issues
+
+var obj = {};
+var array = ["foo", 19, "bar", obj, "foo", 29, "baz"];
+
+var index = array.lastIndexOf("foo");
+assert(index === 4);
+assert(array[index] === "foo");
+
+assert(array.lastIndexOf("foo", 3) === 0);
+assert(array.lastIndexOf("foo", -8) === -1);
+
+var index = array.lastIndexOf("baz");
+assert(index === 6);
+assert(array[index] === "baz");
+
+assert(array.lastIndexOf("baz", -2) === -1);
+
+var index = array.lastIndexOf(obj);
+assert(index === 3);
+assert(array[index] === obj);
+
+assert(array.lastIndexOf("foo", NaN) === 0);
+assert(array.lastIndexOf("foo", Infinity) === 4);
+assert(array.lastIndexOf("foo", -Infinity) === -1);
+
+var arr = [];
+arr[4294967294] = "foo";
+assert(arr.lastIndexOf("foo", -1) === 4294967294)
+
+var arr = [1,2];
+assert(arr.lastIndexOf(2, undefined) === -1);
+assert(arr.lastIndexOf(2) === 1);
+
+// Checking behavior when unable to get length
+var obj = { lastIndexOf : Array.prototype.lastIndexOf}
+Object.defineProperty(obj, 'length', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj.lastIndexOf("bar");
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to get element
+var obj = { lastIndexOf : Array.prototype.lastIndexOf, length : 1}
+Object.defineProperty(obj, '0', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj.lastIndexOf("bar");
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-map.js b/deps/jerry/tests/jerry/array-prototype-map.js
new file mode 100644 (file)
index 0000000..4a74663
--- /dev/null
@@ -0,0 +1,111 @@
+// 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.
+
+// helper function - simple implementation
+Array.prototype.equals = function (array) {
+  if (this.length != array.length)
+    return false;
+
+  for (var i = 0; i < this.length; i++) {
+    if (this[i] instanceof Array && array[i] instanceof Array) {
+      if (!this[i].equals(array[i]))
+        return false;
+      }
+      else if (this[i] != array[i]) {
+        return false;
+    }
+  }
+
+  return true;
+}
+
+// check function type
+try {
+  [0].map(new Object());
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// various checks
+assert ([1, 4, 9].map(Math.sqrt).equals([1, 2, 3]));
+
+assert (isNaN([1, 4, "X"].map(Number)[2]));
+
+var func = function(val, idx) {
+  return val + idx;
+};
+
+assert ([1, 4, 9].map(func).equals([1,5,11]));
+
+assert ([1, "X", 10].map(func).equals([1, "X1", 12]));
+
+var arr = [1,2,3];
+arr.length = 5;
+assert(arr.map(func).length === arr.length);
+
+var long_array = [0, 1];
+assert (long_array.map(func).equals([0,2]));
+
+long_array[100] = 1;
+assert (long_array.map(func).equals([0,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,101]));
+
+var arr = [1,2];
+Array.prototype[0] = 3;
+var newArr = arr.map(function(value) { return value; });
+delete Array.prototype[0];
+assert(newArr.hasOwnProperty("0"));
+assert(newArr[0] === 1);
+
+// check behavior when unable to get length
+var obj = {};
+Object.defineProperty(obj, 'length', { 'get' : function () {throw new ReferenceError ("foo"); } });
+obj.map = Array.prototype.map;
+
+try {
+  obj.map(func);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// check behavior when unable to get element
+var obj = {}
+obj.length = 1;
+Object.defineProperty(obj, '0', { 'get' : function () {throw new ReferenceError ("foo"); } });
+obj.map = Array.prototype.map
+
+try {
+  obj.map(func);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// check thisArg
+var thisArg = {add: 10};
+var func2 = function(value) {
+  return this.add + value;
+}
+assert([1,2].map(func2, thisArg).equals([11, 12]));
+
+// check passed Object
+var array_example = [1,2];
+Object.defineProperty(array_example, 'const', { 'get' : function () {return "CT";} });
+var func3 = function(value, idx, thisobj) {
+  return value * idx + thisobj.const;
+}
+assert(array_example.map(func3).equals(["0CT", "2CT"]));
diff --git a/deps/jerry/tests/jerry/array-prototype-pop.js b/deps/jerry/tests/jerry/array-prototype-pop.js
new file mode 100644 (file)
index 0000000..0d58dcb
--- /dev/null
@@ -0,0 +1,74 @@
+// 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.
+
+var array = ["foo", [], Infinity, 4]
+assert(array.length === 4);
+
+assert(array.pop() === 4)
+assert(array.length === 3);
+
+assert(array.pop() === Infinity);
+assert(array.length === 2);
+
+var a = array.pop()
+assert(a instanceof Array);
+assert(array.length === 1);
+
+assert(array.pop() === "foo");
+assert(array.length === 0);
+
+assert(array.pop() === undefined);
+assert(array.length === 0);
+
+// Checking behavior when unable to get length
+var obj = { pop : Array.prototype.pop };
+Object.defineProperty(obj, 'length', { 'get' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.pop();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to set length
+var obj = { pop : Array.prototype.pop };
+Object.defineProperty(obj, 'length', { 'set' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.pop();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when no length property defined
+var obj = { pop : Array.prototype.pop };
+assert(obj.length === undefined)
+assert(obj.pop() === undefined)
+assert(obj.length === 0)
+
+// Checking behavior when unable to get element
+var obj = { pop : Array.prototype.pop, length : 1 };
+Object.defineProperty(obj, '0', { 'get' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.pop();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-push.js b/deps/jerry/tests/jerry/array-prototype-push.js
new file mode 100644 (file)
index 0000000..84a55e9
--- /dev/null
@@ -0,0 +1,76 @@
+// 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.
+
+// This test will not pass on FLOAT32 due to precision issues
+
+var len;
+var d = [];
+assert (d.length === 0);
+len = d.push();
+assert (d.length === 0);
+assert (d.length === len);
+len = d.push(1);
+assert (d.length === 1);
+assert (d.length === len);
+len = d.push(2);
+assert (d.length === 2);
+assert (d.length === len);
+len = d.push('a');
+assert (d.length === 3);
+assert (d.length === len);
+len = d.push('b', 'c', 3);
+assert (d.length == 6);
+assert (d.length === len);
+assert (d[0] === 1);
+assert (d[1] === 2);
+assert (d[2] === 'a');
+assert (d[3] === 'b');
+assert (d[4] === 'c');
+assert (d[5] === 3);
+
+var a = [];
+a.length = 4294967294;
+assert(a.push("x") === 4294967295);
+assert(a.length === 4294967295);
+assert(a[4294967294] === "x");
+
+try {
+  a.push("y");
+  assert(false);
+} catch (e) {
+  assert (e instanceof RangeError);
+}
+assert(a.length === 4294967295)
+
+
+var o = { length : 4294967294, push : Array.prototype.push };
+assert(o.push("x") === 4294967295);
+assert(o.length === 4294967295);
+assert(o[4294967294] === "x");
+
+try {
+  assert(o.push("y") === 4294967296);
+} catch (e) {
+  assert(false);
+}
+assert(o.length === 4294967296);
+assert(o[4294967295] === "y");
+
+try {
+  assert(o.push("z") === 1);
+} catch (e) {
+  assert(false);
+}
+assert(o.length === 1);
+assert(o[0] === "z");
diff --git a/deps/jerry/tests/jerry/array-prototype-reduce-right.js b/deps/jerry/tests/jerry/array-prototype-reduce-right.js
new file mode 100644 (file)
index 0000000..a9a71cb
--- /dev/null
@@ -0,0 +1,89 @@
+// 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.
+
+// This test will not pass on FLOAT32 due to precision issues
+
+var func = function(a, b) {
+  return a + b;
+}
+
+// check function type
+try {
+  [0].reduceRight(new Object());
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// check for init value
+try {
+  [].reduceRight(func);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+try {
+  var arg2;
+  [].reduceRight(func, arg2);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+try {
+  var a = new Array();
+  a.length = 10;
+  a.reduceRight(func);
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError)
+}
+
+// various checks
+assert([].reduceRight(func, 1) === 1);
+
+assert([0].reduceRight(func) === 0);
+
+assert([0, 1].reduceRight(func) === 1);
+
+assert([0, 1].reduceRight(func, 1) === 2);
+
+assert([0, 1, 2, 3].reduceRight(func, 1) === 7);
+
+assert (["A","B"].reduceRight(func) === "BA");
+
+assert (["A","B"].reduceRight(func, "Init:") === "Init:BA");
+
+assert ([0, 1].reduceRight(func, 3.2) === 4.2);
+
+assert ([0, "x", 1].reduceRight(func) === "1x0");
+
+assert ([0, "x", 1].reduceRight(func, 3.2) === "4.2x0");
+
+var long_array = [0, 1];
+assert (long_array.reduceRight(func,10) === 11);
+
+long_array[10000] = 1;
+assert (long_array.reduceRight(func,10) === 12);
+
+var accessed = false;
+function callbackfn(prevVal, curVal, idx, obj) {
+    accessed = true;
+    return typeof prevVal === "undefined";
+}
+
+var obj = { 0: 11, length: 1 };
+
+assert (Array.prototype.reduceRight.call(obj, callbackfn, undefined) === true && accessed);
diff --git a/deps/jerry/tests/jerry/array-prototype-reduce.js b/deps/jerry/tests/jerry/array-prototype-reduce.js
new file mode 100644 (file)
index 0000000..6193ec7
--- /dev/null
@@ -0,0 +1,74 @@
+// 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.
+
+// This test will not pass on FLOAT32 due to precision issues
+
+var func = function(a, b) {
+  return a + b;
+}
+
+// check function type
+try {
+  [0].reduce(new Object());
+  assert(false);
+}
+catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// check for init value
+try {
+  [].reduce(func);
+  assert(false);
+}
+catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// various checks
+assert ([].reduce(func, 1) === 1);
+
+assert ([0].reduce(func) === 0);
+
+assert ([0, 1].reduce(func) === 1);
+
+assert ([0, 1].reduce(func, 1) === 2);
+
+assert ([0, 1, 2, 3].reduce(func, 1) === 7);
+
+assert (["A","B"].reduce(func) === "AB");
+
+assert (["A","B"].reduce(func, "Init:") === "Init:AB");
+
+assert ([0, 1].reduce(func, 3.2) === 4.2);
+
+assert ([0, "x", 1].reduce(func) === "0x1");
+
+assert ([0, "x", 1].reduce(func, 3.2) === "3.2x1");
+
+var long_array = [0, 1];
+assert (long_array.reduce(func,10) === 11);
+
+long_array[10000] = 1;
+assert (long_array.reduce(func,10) === 12);
+
+var accessed = false;
+function callbackfn(prevVal, curVal, idx, obj) {
+    accessed = true;
+    return typeof prevVal === "undefined";
+}
+
+var obj = { 0: 11, length: 1 };
+
+assert (Array.prototype.reduce.call(obj, callbackfn, undefined) === true && accessed);
diff --git a/deps/jerry/tests/jerry/array-prototype-reverse.js b/deps/jerry/tests/jerry/array-prototype-reverse.js
new file mode 100644 (file)
index 0000000..69be5af
--- /dev/null
@@ -0,0 +1,45 @@
+// 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.
+
+var array = [4, 3, 2, 1, 0]
+
+array.reverse();
+
+for (i = 0; i < array.length; i++) {
+  assert(array[i] === i);
+}
+
+// Checking behavior when unable to get length
+var obj = { reverse : Array.prototype.reverse };
+Object.defineProperty(obj, 'length', { 'get' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.reverse();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to get element
+var obj = { reverse : Array.prototype.reverse, length : 3 };
+Object.defineProperty(obj, '0', { 'get' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.reverse();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-shift.js b/deps/jerry/tests/jerry/array-prototype-shift.js
new file mode 100644 (file)
index 0000000..843c17c
--- /dev/null
@@ -0,0 +1,79 @@
+// 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.
+
+var array = ["foo", [], Infinity, 4]
+
+assert(array.length === 4);
+
+assert(array.shift() === "foo");
+assert(array.length === 3);
+
+var a = array.shift();
+assert(a instanceof Array);
+assert(array.length === 2);
+
+assert(array.shift() === Infinity);
+assert(array.length === 1);
+
+assert(array.shift() === 4);
+assert(array.length === 0);
+
+assert(array.shift() === undefined);
+assert(array.length === 0);
+
+var referenceErrorThrower = function () {
+  throw new ReferenceError ("foo");
+}
+
+// Checking behavior when unable to get length
+var obj = { shift : Array.prototype.shift };
+Object.defineProperty(obj, 'length', { 'get' : referenceErrorThrower });
+
+try {
+  obj.shift();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to set length
+var obj = { shift : Array.prototype.shift };
+Object.defineProperty(obj, 'length', { 'set' : referenceErrorThrower });
+
+try {
+  obj.shift();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when no length property defined
+var obj = { shift : Array.prototype.shift };
+assert (obj.length === undefined)
+assert (obj.shift() === undefined)
+assert (obj.length === 0)
+
+// Checking behavior when unable to get element
+var obj = { shift : Array.prototype.shift, length : 1 };
+Object.defineProperty(obj, '0', { 'get' : referenceErrorThrower });
+
+try {
+  obj.shift();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-slice.js b/deps/jerry/tests/jerry/array-prototype-slice.js
new file mode 100644 (file)
index 0000000..bb1a2e8
--- /dev/null
@@ -0,0 +1,112 @@
+// 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.
+
+// This test will not pass on FLOAT32 due to precision issues
+
+var array = [54, undefined, "Lemon", -127];
+
+var array1 = array.slice();
+var array2 = array.slice("a", "3");
+var array3 = array.slice(-2);
+var array4 = array.slice(-12, undefined);
+var array5 = array.slice(undefined, -3);
+var array6 = array.slice(Infinity, NaN);
+var array7 = array.slice(-Infinity, Infinity);
+var array8 = array.slice(NaN, -Infinity);
+
+assert (array1.length == 4);
+assert (array1[0] == 54);
+assert (array1[1] == undefined);
+assert (array1[2] == "Lemon");
+assert (array1[3] == -127);
+
+assert (array2.length == 3);
+assert (array2[0] == 54);
+assert (array2[1] == undefined);
+assert (array2[2] == "Lemon");
+
+assert (array3.length == 2);
+assert (array3[0] == "Lemon");
+assert (array3[1] == -127);
+
+assert (array4.length == 4);
+assert (array4[0] == 54);
+assert (array4[1] == undefined);
+assert (array4[2] == "Lemon");
+assert (array4[3] == -127);
+
+assert (array5.length == 1);
+assert (array5[0] == 54);
+
+assert (array6.length == 0);
+
+assert (array7.length == 4);
+assert (array7[0] == 54);
+assert (array7[1] == undefined);
+assert (array7[2] == "Lemon");
+assert (array7[3] == -127);
+
+assert (array8.length == 0);
+
+var array = [];
+array[4294967293] = "foo";
+array.length = 4294967295;
+var result = array.slice(4294967293, -1)
+assert(result.length === 1)
+assert(result[0] === "foo")
+
+array[0] = "bar";
+var result = array.slice(-4294967295, -4294967294)
+assert(result.length === 1)
+assert(result[0] === "bar")
+
+var array = [];
+array[0] = "foo";
+var result = array.slice(4294967296, 4294967297);
+assert(result.length === 0);
+
+array[4294967293] = "bar";
+var result = array.slice(-4294967297, -4294967296);
+assert(result.length === 0);
+
+var arr = [1,2];
+Array.prototype[0] = 3;
+var newArr = arr.slice(0, 1);
+delete Array.prototype[0];
+assert(newArr.hasOwnProperty("0"));
+assert(newArr[0] === 1);
+
+// Checking behavior when unable to get length
+var obj = { slice : Array.prototype.slice };
+Object.defineProperty(obj, 'length', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj.slice(1, 2);
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to get element
+var obj = { length : 1, slice : Array.prototype.slice };
+Object.defineProperty(obj, '0', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj.slice(0, 1);
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-some.js b/deps/jerry/tests/jerry/array-prototype-some.js
new file mode 100644 (file)
index 0000000..ae93076
--- /dev/null
@@ -0,0 +1,61 @@
+// 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.
+
+var array = ["foo", [], Infinity, 4];
+
+function f(arg1, arg2, arg3) {
+  assert(arg1 === array[arg2]);
+  assert(arg3 === array);
+  return false;
+}
+
+assert(array.some(f) === false);
+
+function g(arg1, arg2, arg3) {
+  if (arg1 === 1) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+var arr1 = [2, 2, 2, 2, 2, 2];
+assert(arr1.some(g) === false);
+
+var arr2 = [2, 2, 2, 2, 2, 1];
+assert(arr2.some(g) === true);
+
+// Checking behavior when unable to get length
+var obj = { some : Array.prototype.some };
+Object.defineProperty(obj, 'length', { 'get' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.some(f);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to get element
+var obj = { some : Array.prototype.some, length : 1};
+Object.defineProperty(obj, '0', { 'get' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.some(f);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-sort.js b/deps/jerry/tests/jerry/array-prototype-sort.js
new file mode 100644 (file)
index 0000000..22b9d4e
--- /dev/null
@@ -0,0 +1,94 @@
+// 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.
+
+var array = ["Peach", "Apple", "Orange", "Grape", "Cherry", "Apricot", "Grapefruit"];
+array.sort();
+
+assert(array[0] === "Apple");
+assert(array[1] === "Apricot");
+assert(array[2] === "Cherry");
+assert(array[3] === "Grape");
+assert(array[4] === "Grapefruit");
+assert(array[5] === "Orange");
+assert(array[6] === "Peach");
+
+var array = [6, 4, 5, 1, 2, 9, 7, 3, 0, 8];
+
+// Default comparison
+array.sort();
+for (i = 0; i < array.length; i++) {
+  assert(array[i] === i);
+}
+
+// Using custom comparison function
+function f(arg1, arg2) {
+  if (arg1 < arg2) {
+    return 1;
+  } else if (arg1 > arg2) {
+    return -1;
+  } else {
+    return 0;
+  }
+}
+
+array.sort(f);
+for (i = 0; i < array.length; i++) {
+  assert(array[array.length - i - 1] === i);
+}
+
+// Sorting sparse array
+var array = [1,,2,,3,,4,undefined,5];
+var expected = [1,2,3,4,5,undefined,,,,];
+
+array.sort();
+
+assert(array.length === expected.length);
+for (i = 0; i < array.length; i++) {
+  assert(expected.hasOwnProperty (i) === array.hasOwnProperty (i));
+  assert(array[i] === expected[i]);
+}
+
+// Checking behavior when provided comparefn is not callable
+var obj = {};
+var arr = [];
+try {
+  arr.sort(obj);
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// Checking behavior when unable to get length
+var obj = { sort : Array.prototype.sort}
+Object.defineProperty(obj, 'length', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj.sort();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to get element
+var obj = { sort : Array.prototype.sort, length : 1}
+Object.defineProperty(obj, '0', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj.sort();
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-splice.js b/deps/jerry/tests/jerry/array-prototype-splice.js
new file mode 100644 (file)
index 0000000..c5c01ab
--- /dev/null
@@ -0,0 +1,177 @@
+// 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.
+
+// This test will not pass on FLOAT32 due to precision issues
+
+function setDefaultValues()
+{
+  return [54, undefined, -127, "sunshine"];
+}
+
+var array = setDefaultValues();
+var array1 = array.splice();
+
+assert (array.length == 4);
+assert (array[0] == 54);
+assert (array[1] == undefined);
+assert (array[2] == -127);
+assert (array[3] == "sunshine");
+assert (array1.length == 0);
+
+// --------------------------------------------------------
+array = setDefaultValues(); // 54, undefined, -127, "sunshine"
+var array2 = array.splice(2);
+
+assert (array.length == 2);
+assert (array[0] == 54);
+assert (array[1] == undefined);
+assert (array2.length == 2);
+assert (array2[0] == -127);
+assert (array2[1] == "sunshine");
+
+// --------------------------------------------------------
+array = setDefaultValues(); // 54, undefined, -127, "sunshine"
+var array3 = array.splice(2, 1);
+
+assert (array.length == 3);
+assert (array[0] == 54);
+assert (array[1] == undefined);
+assert (array[2] == "sunshine");
+assert (array3.length == 1);
+assert (array3[0] == -127);
+
+// --------------------------------------------------------
+array = setDefaultValues(); // 54, undefined, -127, "sunshine"
+var array4 = array.splice(0, 3, 6720, "Szeged");
+
+assert (array.length == 3);
+assert (array[0] == 6720);
+assert (array[1] == "Szeged");
+assert (array[2] == "sunshine");
+assert (array4.length == 3);
+assert (array4[0] == 54);
+assert (array4[1] == undefined);
+assert (array4[2] == -127);
+
+// --------------------------------------------------------
+array = setDefaultValues(); // 54, undefined, -127, "sunshine"
+var array5 = array.splice(-2, -2, 6720, "Szeged");
+
+assert (array.length == 6);
+assert (array[0] == 54);
+assert (array[1] == undefined);
+assert (array[2] == 6720);
+assert (array[3] == "Szeged");
+assert (array[4] == -127);
+assert (array[5] == "sunshine");
+assert (array5.length == 0);
+
+// --------------------------------------------------------
+array = setDefaultValues(); // 54, undefined, -127, "sunshine"
+var array6 = array.splice(undefined, undefined, undefined);
+
+assert (array.length == 5);
+assert (array[0] == undefined);
+assert (array[1] == 54);
+assert (array[2] == undefined);
+assert (array[3] == -127);
+assert (array[4] == "sunshine");
+assert (array6.length == 0);
+
+// --------------------------------------------------------
+array = setDefaultValues(); // 54, undefined, -127, "sunshine"
+var array7 = array.splice(Infinity, NaN);
+assert (array.length == 4);
+assert (array[0] == 54);
+assert (array[1] == undefined);
+assert (array[2] == -127);
+assert (array[3] == "sunshine");
+assert (array7.length == 0);
+
+// --------------------------------------------------------
+array = setDefaultValues(); // 54, undefined, -127, "sunshine"
+var array8 = array.splice(-Infinity, Infinity);
+
+assert (array.length == 0);
+assert (array8.length == 4);
+assert (array8[0] == 54);
+assert (array8[1] == undefined);
+assert (array8[2] == -127);
+assert (array8[3] == "sunshine");
+
+// --------------------------------------------------------
+array = setDefaultValues(); // 54, undefined, -127, "sunshine"
+var array9 = array.splice(NaN, -Infinity);
+assert (array.length == 4);
+assert (array[0] == 54);
+assert (array[1] == undefined);
+assert (array[2] == -127);
+assert (array[3] == "sunshine");
+assert (array9.length == 0);
+
+// --------------------------------------------------------
+array = setDefaultValues(); // 54, undefined, -127, "sunshine"
+var array10 = array.splice(-3, 4, Infinity, "university");
+assert (array.length == 3);
+assert (array[0] == 54);
+assert (array[1] == Infinity);
+assert (array[2] == "university");
+assert (array10.length == 3);
+assert (array10[0] == undefined);
+assert (array10[1] == -127);
+assert (array10[2] == "sunshine");
+
+var array = [];
+array[4294967294] = "foo";
+var result = array.splice(4294967294, 1, "x")
+assert(result.length === 1)
+assert(result[0] === "foo")
+assert(array[4294967294] === "x")
+
+array[0] = "bar";
+var result = array.splice(-4294967295, 1, "y");
+assert(result.length === 1)
+assert(result[0] === "bar")
+assert(array[0] === "y")
+
+var arr = [1,2];
+Array.prototype[0] = 3;
+var newArr = arr.splice(0, 1);
+delete Array.prototype[0];
+assert(newArr.hasOwnProperty("0"));
+assert(newArr[0] === 1);
+
+// Checking behavior when unable to get length
+var obj = {splice : Array.prototype.splice};
+Object.defineProperty(obj, 'length', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj.splice(1, 2, "item1", "item2");
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to get element
+var obj = {length : 1, splice : Array.prototype.splice};
+Object.defineProperty(obj, '0', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj.splice(0, 1, "item1", "item2");
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-tolocalestring.js b/deps/jerry/tests/jerry/array-prototype-tolocalestring.js
new file mode 100644 (file)
index 0000000..54402be
--- /dev/null
@@ -0,0 +1,56 @@
+// 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.
+
+assert ([].toLocaleString() === "");
+assert ([1].toLocaleString() === "1");
+assert ([1,2].toLocaleString() === "1,2");
+assert ([1,2,3].toLocaleString() === "1,2,3");
+
+var test_ok = {
+  length: 1,
+  toLocaleString: function() { return "1"; }
+};
+
+assert ([3, test_ok, 4, test_ok].toLocaleString() === "3,1,4,1");
+
+
+var obj = { toLocaleString: function() {} };
+var test_non_str_locale = [undefined, obj, null, obj, obj];
+
+assert(test_non_str_locale.toLocaleString() === ",undefined,,undefined,undefined");
+
+var test_fail = {
+  toLocaleString: "FAIL"
+};
+
+try {
+  [test_fail].toLocaleString();
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+
+var test_fail_call = {
+  toLocaleString: function() { throw new ReferenceError("foo"); }
+};
+
+
+try {
+  [1, 2, test_fail_call].toLocaleString();
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-tostring.js b/deps/jerry/tests/jerry/array-prototype-tostring.js
new file mode 100644 (file)
index 0000000..5fd8853
--- /dev/null
@@ -0,0 +1,63 @@
+// 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.
+
+// Our own join method if the internal join is not implemented.
+function join(sep)
+{
+  sep = sep ? sep : ",";
+  var result = "";
+
+  for (var i = 0; i < this.length; ++i) {
+    result += this[i];
+    if (i + 1 < this.length) {
+      result += sep;
+    }
+  }
+
+  return result;
+}
+
+// Force fallback to object.prototype.toString()
+Array.prototype.join = 1;
+
+assert ([1].toString() === "[object Array]");
+
+Array.prototype.join = join;
+
+assert ([1, 2].toString() === "1,2");
+
+var test = [1,2,3];
+test.join = function() { throw ReferenceError ("foo"); };
+
+try {
+  test.toString();
+
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+
+// Test if the join returns a ReferenceError
+var arr = [1,2]
+Object.defineProperty(arr, 'join', { 'get' : function () {throw new ReferenceError ("foo"); } });
+try {
+  arr.toString();
+
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/array-prototype-unshift.js b/deps/jerry/tests/jerry/array-prototype-unshift.js
new file mode 100644 (file)
index 0000000..a4394d4
--- /dev/null
@@ -0,0 +1,103 @@
+// 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.
+
+var array = []
+
+assert(array.length === 0);
+
+array.unshift("foo");
+assert(array.length === 1);
+assert(array[0] === "foo");
+
+array.unshift(new Array())
+assert(array.length === 2);
+assert(array[0] instanceof Array);
+assert(array[1] === "foo")
+
+array.unshift(Infinity);
+assert(array.length === 3);
+assert(array[0] === Infinity);
+assert(array[1] instanceof Array);
+assert(array[2] === "foo")
+
+array.unshift("bar", 0);
+assert(array.length === 5);
+assert(array[0] === "bar");
+assert(array[1] === 0);
+assert(array[2] === Infinity);
+assert(array[3] instanceof Array);
+assert(array[4] === "foo")
+
+
+// Checking behavior when no length property defined
+var obj = { unshift : Array.prototype.unshift };
+
+assert(obj.length === undefined);
+obj.unshift(1,2,3);
+assert(obj.length === 3);
+
+// Checking behavior when unable to get length
+var obj = { unshift : Array.prototype.unshift };
+Object.defineProperty(obj, 'length', { 'get' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.unshift(1);
+  assert(false)
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable to set length
+var obj = { unshift : Array.prototype.unshift };
+Object.defineProperty(obj, 'length', { 'set' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.unshift(2);
+  assert(false)
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when unable shift elements
+var obj = { unshift : Array.prototype.unshift, length : 1 };
+Object.defineProperty(obj, '0', { 'get' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.unshift(3);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+var obj = { unshift : Array.prototype.unshift, length : 1 };
+Object.defineProperty(obj, '0', { 'set' : function () {throw new ReferenceError ("foo"); } });
+
+try {
+  obj.unshift(4);
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// Checking behavior when a property is not defined
+var obj = { '0' : "foo", '2' : "bar", length : 3, unshift : Array.prototype.unshift };
+assert(obj.unshift("baz") === 4);
+assert(obj[0] === "baz");
+assert(obj[1] === "foo");
+assert(obj[2] === undefined);
+assert(obj[3] === "bar");
diff --git a/deps/jerry/tests/jerry/array.js b/deps/jerry/tests/jerry/array.js
new file mode 100644 (file)
index 0000000..c6866f3
--- /dev/null
@@ -0,0 +1,157 @@
+// 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.
+
+var cars = ["Saab", "Volvo", "BMW"];
+
+assert (cars[0] === "Saab");
+assert (cars[1] === "Volvo");
+assert (cars[2] === "BMW");
+
+var cars1 = new Array("Saab", "Volvo", "BMW");
+assert (cars[0] === cars1[0]);
+assert (cars[1] === cars1[1]);
+assert (cars[2] === cars1[2]);
+
+var a = new Array();
+assert (typeof (a) === "object");
+assert (Array.isArray (a));
+assert (Array.isArray ([1, 2, 3]));
+
+var b = new Array (30000);
+assert(b.length === 30000);
+assert (b[20000] === undefined);
+b[20000] = 1;
+assert (b[20000] === 1);
+b[20000] = 10;
+assert (b[20000] === 10);
+
+assert(b.length === 30000);
+assert(b[10000] === undefined);
+Object.defineProperty (b, '10000', {value : 25, writable : false});
+assert(b[10000] === 25);
+b[10000] = 30;
+assert(b[10000] === 25);
+
+assert(b.length === 30000);
+assert(b[50000] === undefined);
+assert(b.length === 30000);
+b[50000] = 5;
+assert(b.length === 50001);
+assert(b[50000] === 5);
+b[50000] = 10;
+assert(b[50000] === 10);
+Object.defineProperty (b, '50000', {writable : false});
+assert(b[50000] === 10);
+b[50000] = 20;
+assert(b[50000] === 10);
+
+Object.defineProperty (b, '50000', {writable : true});
+assert(b[50000] === 10);
+b[50000] = 30;
+assert(b[50000] === 30);
+
+b.length = 5;
+assert(b[50000] === undefined);
+
+assert(([1, 2, 3]).length === 3);
+
+assert(Array.prototype.constructor === Array);
+assert(Array.prototype.length === 0);
+Array.prototype[0] = 'string value';
+assert(Array.prototype.length === 1);
+assert(Array.prototype[0] === 'string value');
+
+var c = [0,,,'3'];
+assert (c[0] === 0);
+assert (c[1] === undefined);
+assert (c[2] === undefined);
+assert (c[3] === '3');
+
+b[0] = 1;
+c[0] += b[0];
+assert (c[0] == 1);
+
+var arr = [
+  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+  17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+  33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+  49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+  65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+  81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+  97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
+  113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
+  129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
+  145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160,
+  161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
+  177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
+  193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208,
+  209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
+  225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
+  241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256,
+  257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
+  273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,
+  289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
+  305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320,
+  321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336,
+  337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352,
+  353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368,
+  369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
+  385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400,
+  401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416,
+  417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432,
+  433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448,
+  449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464,
+  465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480,
+  481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496,
+  497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512,
+  513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528,
+  529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544,
+  545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560,
+  561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576,
+  577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592,
+  593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608,
+  609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624,
+  625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640,
+  641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656,
+  657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672,
+  673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688,
+  689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704,
+  705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720,
+  721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736,
+  737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752,
+  753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768,
+  769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784,
+  785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800,
+  801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816,
+  817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832,
+  833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848,
+  849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864,
+  865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880,
+  881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896,
+  897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912,
+  913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928,
+  929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944,
+  945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960,
+  961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976,
+  977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992,
+  993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008,
+  1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024 ];
+
+for (i = 0; i < 1024; i++)
+{
+  assert (arr[i] === i + 1);
+}
+
+var elision = [0,,2 ,3];
+assert (elision.hasOwnProperty(1) == false);
diff --git a/deps/jerry/tests/jerry/assignments.js b/deps/jerry/tests/jerry/assignments.js
new file mode 100644 (file)
index 0000000..4039557
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var b = 5;
+
+assert((b += 10) == 15);
+assert((b -= 3) == 12);
+assert((b *= 10) == 120);
+assert((b /= 10) == 12);
+assert((b %= 10) == 2);
diff --git a/deps/jerry/tests/jerry/bitwise-logic.js b/deps/jerry/tests/jerry/bitwise-logic.js
new file mode 100644 (file)
index 0000000..7ad315a
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+assert((5 & 2) === 0);
+assert((2 & 2) === 2);
+assert((5 | 2) === 7);
+assert((5 | 5) === 5);
+assert((5 ^ 2) === 7);
+assert((5 ^ 5) === 0);
+assert((~5) == -6);
diff --git a/deps/jerry/tests/jerry/break-continue-nested-to-try-with-blocks.js b/deps/jerry/tests/jerry/break-continue-nested-to-try-with-blocks.js
new file mode 100644 (file)
index 0000000..743a0c7
--- /dev/null
@@ -0,0 +1,158 @@
+// 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.
+
+/* with */
+
+for (var i = 0; i < 10; i++)
+{
+  with ({})
+  {
+    break;
+
+    assert (false);
+  }
+}
+assert (i === 0);
+
+for (var i = 0; i < 10; i++)
+{
+  with ({})
+  {
+    continue;
+
+    assert (false);
+  }
+}
+assert (i === 10);
+
+/* try */
+for (var i = 0; i < 10; i++)
+{
+  try
+  {
+    break;
+
+    assert (false);
+  }
+  catch (e)
+  {
+  }
+}
+assert (i === 0);
+
+for (var i = 0; i < 10; i++)
+{
+  try
+  {
+    continue;
+
+    assert (false);
+  }
+  catch (e)
+  {
+  }
+}
+assert (i === 10);
+
+/* catch */
+for (var i = 0; i < 10; i++)
+{
+  try
+  {
+    throw new TypeError ();
+    assert (false);
+  }
+  catch (e)
+  {
+    break;
+    assert (false);
+  }
+}
+assert (i === 0);
+
+for (var i = 0; i < 10; i++)
+{
+  try
+  {
+    throw new TypeError ();
+    assert (false);
+  }
+  catch (e)
+  {
+    continue;
+    assert (false);
+  }
+}
+assert (i === 10);
+
+
+/* finally */
+for (var i = 0; i < 10; i++)
+{
+  try
+  {
+    throw new TypeError ();
+    assert (false);
+  }
+  catch (e)
+  {
+  }
+  finally
+  {
+    break;
+    assert (false);
+  }
+}
+assert (i === 0);
+
+for (var i = 0; i < 10; i++)
+{
+  try
+  {
+    throw new TypeError ();
+    assert (false);
+  }
+  catch (e)
+  {
+  }
+  finally
+  {
+    continue;
+    assert (false);
+  }
+}
+assert (i === 10);
+
+
+/* with - switch */
+
+str = '';
+for (var i = 0; i < 10; i++)
+{
+  with ({})
+  {
+    switch (i)
+    {
+      case 0:
+        str += 'A';
+        break;
+      default:
+        str += 'B';
+        continue;
+    }
+
+    str += 'C';
+  }
+}
+assert (str === 'ACBBBBBBBBB');
diff --git a/deps/jerry/tests/jerry/builtin-constructor-class.js b/deps/jerry/tests/jerry/builtin-constructor-class.js
new file mode 100644 (file)
index 0000000..b1ec809
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+Function.prototype.toString = Object.prototype.toString;
+assert(Array.toString() === "[object Function]");
+assert(Number.toString() === "[object Function]");
+assert(String.toString() === "[object Function]");
+assert(Boolean.toString() === "[object Function]");
+assert(Object.toString() === "[object Function]");
+assert(Function.toString() === "[object Function]");
+assert(Date.toString() === "[object Function]");
+assert(RegExp.toString() === "[object Function]");
+
+assert(Math.toString() === "[object Math]");
+assert(JSON.toString() === "[object JSON]");
diff --git a/deps/jerry/tests/jerry/date-annexb.js b/deps/jerry/tests/jerry/date-annexb.js
new file mode 100644 (file)
index 0000000..95210e2
--- /dev/null
@@ -0,0 +1,45 @@
+// 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.
+
+var d = new Date(1999, 1, 1);
+assert (d.getYear() === 99);
+d = new Date(1874, 4, 9);
+assert (d.getYear() === -26);
+d = new Date(2015, 8, 17);
+assert (d.getYear() === 115);
+d = new Date(NaN);
+assert (isNaN (d.getYear()));
+
+var d = new Date();
+d.setYear(91);
+assert (d.getFullYear() === 1991 && d.getYear() === 91);
+
+d = new Date();
+d.setYear(NaN);
+assert (isNaN(d.valueOf()));
+
+d = new Date();
+d.setYear(2015);
+assert (d.getFullYear() === 2015);
+
+d = new Date(2000, 1, 29);
+d.setYear(2004);
+assert (d.getFullYear() === 2004 && d.getMonth() === 1 && d.getDate() === 29);
+d.setYear(2015);
+assert (d.getFullYear() === 2015 && d.getMonth() === 2 && d.getDate() === 1);
+
+assert (/Thu, 17 Sep 2015 \d{2}:\d{2}:\d{2} GMT/.test (new Date("2015-09-17").toGMTString()));
+
+d = new Date(NaN);
+assert (d.toGMTString() === "Invalid Date");
diff --git a/deps/jerry/tests/jerry/date-construct.js b/deps/jerry/tests/jerry/date-construct.js
new file mode 100644 (file)
index 0000000..16e93de
--- /dev/null
@@ -0,0 +1,81 @@
+// 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.
+
+assert (Date.length == 7);
+assert (Object.prototype.toString.call (Date.prototype) === '[object Date]');
+
+var d;
+
+try
+{
+  d = new Date({toString: function() { throw new Error("foo"); }});
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof Error);
+  assert (e.message === "foo");
+}
+
+assert (isNaN(Date.prototype.valueOf.call(Date.prototype)));
+
+d = new Date("abcd");
+assert (isNaN(d.valueOf()));
+
+d = new Date();
+assert (!isNaN(d.valueOf()));
+
+d = new Date("2015-01-01");
+assert (d.valueOf() == 1420070400000);
+
+d = new Date(1420070400000);
+assert (d.valueOf() == 1420070400000);
+
+d = new Date(2015,0,1,0,0,0,0);
+assert (d.valueOf() - (d.getTimezoneOffset() * 60000) == 1420070400000);
+
+d = new Date(8.64e+15);
+assert (d.valueOf() == 8.64e+15);
+
+d = new Date(8.64e+15 + 1);
+assert (isNaN(d.valueOf()));
+
+d = new Date(20000000, 0, 1);
+assert (isNaN(d.valueOf()));
+
+d = new Date(0, 20000000, 1);
+assert (isNaN(d.valueOf()));
+
+var Obj = function (val)
+{
+  this.value = val;
+  this.valueOf = function () { throw new ReferenceError ("valueOf-" + this.value); };
+  this.toString = function () { throw new ReferenceError ("toString-"+ this.value); };
+};
+
+try
+{
+  d = new Date (new Obj (1), new Obj (2));
+  // Should not be reached.
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+  assert (e.message === "valueOf-1");
+}
+
+assert (typeof Date (2015) == "string");
+assert (typeof Date() != typeof (new Date ()));
+assert (Date (Number.NaN) == Date ());
diff --git a/deps/jerry/tests/jerry/date-getters.js b/deps/jerry/tests/jerry/date-getters.js
new file mode 100644 (file)
index 0000000..3f06bc1
--- /dev/null
@@ -0,0 +1,109 @@
+// 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.
+
+/* 1. test case */
+var d = new Date(2015, 6, 9, 12, 13, 14, 121);
+
+assert (d.getFullYear() == 2015);
+assert (d.getUTCFullYear() == 2015);
+assert (d.getMonth() == 6);
+assert (d.getUTCMonth() == 6);
+assert (d.getDate() == 9);
+assert (d.getUTCDate() == 9);
+assert (d.getDay() == 4);
+assert (d.getUTCDay() == 4);
+assert (d.getHours() == 12);
+// FIXME: Missing timezone adjustment.
+//assert (d.getUTCHours() == (12 + d.getTimezoneOffset() / 60));
+assert (d.getMinutes() == 13);
+assert (d.getUTCMinutes() == 13);
+assert (d.getSeconds() == 14);
+assert (d.getUTCSeconds() == 14);
+assert (d.getMilliseconds() == 121);
+assert (d.getUTCMilliseconds() == 121);
+
+/* 2. test case */
+var d = new Date("2015-07-09T12:13:14.121+01:30");
+
+assert (d.getFullYear() == 2015);
+assert (d.getUTCFullYear() == 2015);
+assert (d.getMonth() == 6);
+assert (d.getUTCMonth() == 6);
+assert (d.getDate() == 9);
+assert (d.getUTCDate() == 9);
+assert (d.getDay() == 4);
+assert (d.getUTCDay() == 4);
+// FIXME: Missing timezone adjustment.
+//assert (d.getHours() == 12);
+//assert (d.getUTCHours() == (12 + d.getTimezoneOffset() / 60));
+assert (d.getMinutes() == 43);
+assert (d.getUTCMinutes() == 43);
+assert (d.getSeconds() == 14);
+assert (d.getUTCSeconds() == 14);
+assert (d.getMilliseconds() == 121);
+assert (d.getUTCMilliseconds() == 121);
+
+/* 3. test case */
+var d = new Date(0);
+
+assert (d.getFullYear() == 1970);
+assert (d.getUTCFullYear() == 1970);
+assert (d.getMonth() == 0);
+assert (d.getUTCMonth() == 0);
+assert (d.getDate() == 1);
+assert (d.getUTCDate() == 1);
+assert (d.getDay() == 4);
+assert (d.getUTCDay() == 4);
+// FIXME: Missing timezone adjustment.
+// assert (d.getHours() == 0 - (d.getTimezoneOffset() / 60));
+assert (d.getUTCHours() == 0);
+assert (d.getMinutes() == 0);
+assert (d.getUTCMinutes() == 0);
+assert (d.getSeconds() == 0);
+assert (d.getUTCSeconds() == 0);
+assert (d.getMilliseconds() == 0);
+assert (d.getUTCMilliseconds() == 0);
+
+/* 4. test case */
+var d = new Date("abcd");
+assert (isNaN (d));
+
+assert (isNaN (d.getFullYear()));
+assert (isNaN (d.getUTCFullYear()));
+assert (isNaN (d.getMonth()));
+assert (isNaN (d.getUTCMonth()));
+assert (isNaN (d.getDate()));
+assert (isNaN (d.getUTCDate()));
+assert (isNaN (d.getDay()));
+assert (isNaN (d.getUTCDay()));
+assert (isNaN (d.getHours()));
+assert (isNaN (d.getUTCHours()));
+assert (isNaN (d.getMinutes()));
+assert (isNaN (d.getUTCMinutes()));
+assert (isNaN (d.getSeconds()));
+assert (isNaN (d.getUTCSeconds()));
+assert (isNaN (d.getMilliseconds()));
+assert (isNaN (d.getUTCMilliseconds()));
+assert (isNaN (d.getTimezoneOffset()));
+
+/* 5. test case */
+assert (new Date(2013, -1).getMonth() === 11);
+assert (new Date(-2, -2).getFullYear() === -3);
+assert (new Date(-1, -1).getFullYear() === -2);
+assert (new Date(-1, -1, -1).getMonth() === 10);
+assert (new Date(-1, -1, -1, -1).getDate() === 28);
+assert (new Date(-1, -1, -1, -1, -1).getHours() === 22);
+assert (new Date(-1, -1, -1, -1, -1, -1).getMinutes() === 58);
+assert (new Date(-1, -1, -1, -1, -1, -1, -1).getSeconds() === 58);
+assert (new Date(-1, -1, -1, -1, -1, -1, -1, -1).getMilliseconds() === 999);
diff --git a/deps/jerry/tests/jerry/date-parse.js b/deps/jerry/tests/jerry/date-parse.js
new file mode 100644 (file)
index 0000000..94b7905
--- /dev/null
@@ -0,0 +1,98 @@
+// 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.
+
+var wrongFormats = ["",
+                    "2",
+                    "20",
+                    "201",
+                    "2015-",
+                    "2015-01-",
+                    "2015-01-01-",
+                    "qwerty",
+                    "2015-01-01T",
+                    "2015-01-01T1:1",
+                    "2015-01-01T01",
+                    "2015-01-01T01",
+                    "2015-01-01T01:01F",
+                    "T2015",
+                    "2015-01-01Z",
+                    "2015-01-01+01:00",
+                    "2015-01-01T00:00+01",
+                    "2015-01-01T00:00+1",
+                    "2015-01-01T00:00-01",
+                    "2015-01-01T00:00.000",
+                    "2015-01-01T00:00:",
+                    "2015-01-01T00:",
+                    "2015-01-01T00:00:00.1",
+                    "2015-01-01T00:00:00.01",
+                    "2015-01-01T00:00+01:00Z",
+                    "2015/01/01",
+                    "2015-01-32",
+                    "2015--1",
+                    "2015-13",
+                    "2015-01--1",
+                    "-215",
+                    "-215-01-01",
+                    "2015-01-00",
+                    "2015-01-01T25:00",
+                    "2015-01-01T00:60",
+                    "2015-01-01T-1:00",
+                    "2015-01-01T00:-1",
+                    "2e+3"];
+
+for (i in wrongFormats) {
+  var d = Date.parse(wrongFormats[i]);
+  assert (isNaN(d));
+}
+
+var d;
+
+d = Date.parse(undefined);
+assert (isNaN(d));
+
+d = Date.parse({});
+assert (isNaN(d));
+
+d = Date.parse(2000 + 15);
+assert (d == 1420070400000);
+
+d = Date.parse("2015");
+assert (d == 1420070400000);
+
+d = Date.parse("2015-01");
+assert (d == 1420070400000);
+
+d = Date.parse("2015-01-01");
+assert (d == 1420070400000);
+
+d = Date.parse("2015-01T00:00");
+assert (d == 1420070400000);
+
+d = Date.parse("2015-01T00:00:00");
+assert (d == 1420070400000);
+
+d = Date.parse("2015-01T00:00:00.000");
+assert (d == 1420070400000);
+
+d = Date.parse("2015-01T24:00:00.000");
+assert (d == 1420070400000);
+
+d = Date.parse("2015-01T00:00:00.000+03:00");
+assert (d == 1420059600000);
+
+d = Date.parse("2015-01T00:00:00.000-03:00");
+assert (d == 1420081200000);
+
+d = Date.parse("2015-07-03T14:35:43.123+01:30");
+assert (d == 1435928743123);
diff --git a/deps/jerry/tests/jerry/date-setters.js b/deps/jerry/tests/jerry/date-setters.js
new file mode 100644 (file)
index 0000000..d587e12
--- /dev/null
@@ -0,0 +1,243 @@
+// 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.
+
+var ms = 1;
+var sec = 1000 * ms;
+var min = 60 * sec;
+var hour = 60 * min;
+var day = 24 * hour; /* 86400000 */
+var d = new Date();
+
+/* 15.9.5.27 Date.prototype.setTime (time) */
+assert (d.setTime(0) == 0);
+d.setTime(0);
+assert (d.setTime(day) == day);
+assert (d.getDate() == 2);
+
+/* 15.9.5.28 Date.prototype.setMilliseconds (ms) */
+d.setTime(0);
+assert (d.setMilliseconds(1) == ms);
+assert (d.getMilliseconds() == 1);
+
+/* 15.9.5.29 Date.prototype.setUTCMilliseconds (ms) */
+d.setTime(0);
+assert (d.setUTCMilliseconds(1) == ms);
+assert (d.getUTCMilliseconds() == 1);
+
+/* 15.9.5.30 Date.prototype.setSeconds (sec [, ms ] ) */
+d.setTime(0);
+assert (d.setSeconds(1) == sec);
+assert (d.getSeconds() == 1);
+d.setTime(0);
+assert (d.setSeconds(1, 1) == sec + ms);
+assert (d.getSeconds() == 1);
+assert (d.getMilliseconds() == 1);
+
+/* 15.9.5.31 Date.prototype.setUTCSeconds (sec [, ms ] ) */
+d.setTime(0);
+assert (d.setUTCSeconds(1) == sec);
+assert (d.getUTCSeconds() == 1);
+d.setTime(0);
+assert (d.setUTCSeconds(1, 1) == sec + ms);
+assert (d.getUTCSeconds() == 1);
+assert (d.getUTCMilliseconds() == 1);
+
+/* 15.9.5.32 Date.prototype.setMinutes (min [, sec [, ms ] ] ) */
+d.setTime(0);
+assert (d.setMinutes(1) == min);
+assert (d.getMinutes() == 1);
+d.setTime(0);
+assert (d.setMinutes(1, 1) == min + sec);
+assert (d.getMinutes() == 1);
+assert (d.getSeconds() == 1);
+d.setTime(0);
+assert (d.setMinutes(1, 1, 1) == min + sec + ms);
+assert (d.getMinutes() == 1);
+assert (d.getSeconds() == 1);
+assert (d.getMilliseconds() == 1);
+
+/* 15.9.5.33 Date.prototype.setUTCMinutes (min [, sec [, ms ] ] ) */
+d.setTime(0);
+assert (d.setUTCMinutes(1) == min);
+assert (d.getUTCMinutes() == 1);
+d.setTime(0);
+assert (d.setUTCMinutes(1, 1) == min + sec);
+assert (d.getUTCMinutes() == 1);
+assert (d.getUTCSeconds() == 1);
+d.setTime(0);
+assert (d.setUTCMinutes(1, 1, 1) == min + sec + ms);
+assert (d.getUTCMinutes() == 1);
+assert (d.getUTCSeconds() == 1);
+assert (d.getUTCMilliseconds() == 1);
+
+/* 15.9.5.34 Date.prototype.setHours (hour [, min [, sec [, ms ] ] ] ) */
+// FIXME: Missing timezone adjustment.
+//d.setTime(0);
+//assert (d.setHours(1) == hour + d.getTimezoneOffset() * 60000);
+//assert (d.getHours() == 1);
+//d.setTime(0);
+//assert (d.setHours(1, 1) == hour + min + d.getTimezoneOffset() * 60000);
+//assert (d.getHours() == 1);
+//assert (d.getMinutes() == 1);
+//d.setTime(0);
+//assert (d.setHours(1, 1, 1) == hour + min + sec + d.getTimezoneOffset() * 60000);
+//assert (d.getHours() == 1);
+//assert (d.getMinutes() == 1);
+//assert (d.getSeconds() == 1);
+//d.setTime(0);
+//assert (d.setHours(1, 1, 1, 1) == hour + min + sec + ms + d.getTimezoneOffset() * 60000);
+//assert (d.getHours() == 1);
+//assert (d.getMinutes() == 1);
+//assert (d.getSeconds() == 1);
+//assert (d.getMilliseconds() == 1);
+
+/* 15.9.5.35 Date.prototype.setUTCHours (hour [, min [, sec [, ms ] ] ] ) */
+d.setTime(0);
+assert (d.setUTCHours(1) == hour);
+assert (d.getUTCHours() == 1);
+d.setTime(0);
+assert (d.setUTCHours(1, 1) == hour + min);
+assert (d.getUTCHours() == 1);
+assert (d.getUTCMinutes() == 1);
+d.setTime(0);
+assert (d.setUTCHours(1, 1, 1) == hour + min + sec);
+assert (d.getUTCHours() == 1);
+assert (d.getUTCMinutes() == 1);
+assert (d.getUTCSeconds() == 1);
+d.setTime(0);
+assert (d.setUTCHours(1, 1, 1, 1) == hour + min + sec + ms);
+assert (d.getUTCHours() == 1);
+assert (d.getUTCMinutes() == 1);
+assert (d.getUTCSeconds() == 1);
+assert (d.getUTCMilliseconds() == 1);
+
+/* 15.9.5.36 Date.prototype.setDate (date) */
+d.setTime(0);
+assert (d.setDate(0) == -day);
+assert (d.getDate() == 31);
+d.setTime(0);
+assert (d.setDate(1) == 0);
+assert (d.getDate() == 1);
+
+/* 15.9.5.37 Date.prototype.setUTCDate (date) */
+d.setTime(0);
+assert (d.setUTCDate(0) == -day);
+assert (d.getUTCDate() == 31);
+d.setTime(0);
+assert (d.setUTCDate(1) == 0);
+assert (d.getUTCDate() == 1);
+
+/* 15.9.5.38 Date.prototype.setMonth (month [, date ] ) */
+d.setTime(0);
+assert (d.setMonth(0) == 0);
+assert (d.getMonth() == 0);
+d.setTime(0);
+assert (d.setMonth(0, 0) == -day);
+assert (d.getMonth() == 11);
+assert (d.getDate() == 31);
+d.setTime(0);
+assert (d.setMonth(1) == 31 * day);
+assert (d.getMonth() == 1);
+d.setTime(0);
+assert (d.setMonth(12) == 365 * day);
+assert (d.getMonth() == 0);
+d.setTime(0);
+assert (d.setMonth(13) == (365 + 31) * day);
+assert (d.getMonth() == 1);
+
+/* 15.9.5.39 Date.prototype.setUTCMonth (month [, date ] ) */
+d.setTime(0);
+assert (d.setUTCMonth(0) == 0);
+assert (d.getUTCMonth() == 0);
+d.setTime(0);
+assert (d.setUTCMonth(0, 0) == -day);
+assert (d.getUTCMonth() == 11);
+assert (d.getUTCDate() == 31);
+d.setTime(0);
+assert (d.setUTCMonth(1) == 31 * day);
+assert (d.getUTCMonth() == 1);
+d.setTime(0);
+assert (d.setUTCMonth(12) == 365 * day);
+assert (d.getUTCMonth() == 0);
+d.setTime(0);
+assert (d.setUTCMonth(13) == (365 + 31) * day);
+assert (d.getUTCMonth() == 1);
+
+/* 15.9.5.40 Date.prototype.setFullYear (year [, month [, date ] ] ) */
+d.setTime(0);
+assert (d.setFullYear(0) == -62167219200000);
+assert (d.getFullYear() == 0);
+d.setTime(0);
+assert (d.setFullYear(0, 0) == -62167219200000);
+assert (d.getFullYear() == 0);
+assert (d.getMonth() == 0);
+d.setTime(0);
+assert (d.setFullYear(0, 0, 0) == -62167219200000 - day);
+assert (d.getFullYear() == -1);
+assert (d.getMonth() == 11);
+assert (d.getDate() == 31);
+d.setTime(0);
+assert (d.setFullYear(1970) == 0);
+assert (d.getFullYear() == 1970);
+
+/* 15.9.5.41 Date.prototype.setUTCFullYear (year [, month [, date ] ] ) */
+d.setTime(0);
+assert (d.setUTCFullYear(0) == -62167219200000);
+assert (d.getUTCFullYear() == 0);
+d.setTime(0);
+assert (d.setUTCFullYear(0, 0) == -62167219200000);
+assert (d.getUTCFullYear() == 0);
+assert (d.getUTCMonth() == 0);
+d.setTime(0);
+assert (d.setUTCFullYear(0, 0, 0) == -62167219200000 - day);
+assert (d.getUTCFullYear() == -1);
+assert (d.getUTCMonth() == 11);
+assert (d.getUTCDate() == 31);
+d.setTime(0);
+assert (d.setUTCFullYear(1970) == 0);
+assert (d.getUTCFullYear() == 1970);
+
+/* Without argument */
+d = new Date();
+assert (isNaN (d.setTime()));
+assert (isNaN (d.setMilliseconds()));
+assert (isNaN (d.setUTCMilliseconds()));
+assert (isNaN (d.setSeconds()));
+assert (isNaN (d.setUTCSeconds()));
+assert (isNaN (d.setMinutes()));
+assert (isNaN (d.setUTCMinutes()));
+assert (isNaN (d.setHours()));
+assert (isNaN (d.setUTCHours()));
+assert (isNaN (d.setDate()));
+assert (isNaN (d.getUTCDate()));
+assert (isNaN (d.setMonth()));
+assert (isNaN (d.setUTCMonth()));
+assert (isNaN (d.setFullYear()));
+assert (isNaN (d.setUTCFullYear()));
+
+assert (isNaN (Date.prototype.setTime()));
+assert (isNaN (Date.prototype.setMilliseconds()));
+assert (isNaN (Date.prototype.setUTCMilliseconds()));
+assert (isNaN (Date.prototype.setSeconds()));
+assert (isNaN (Date.prototype.setUTCSeconds()));
+assert (isNaN (Date.prototype.setMinutes()));
+assert (isNaN (Date.prototype.setUTCMinutes()));
+assert (isNaN (Date.prototype.setHours()));
+assert (isNaN (Date.prototype.setUTCHours()));
+assert (isNaN (Date.prototype.setDate()));
+assert (isNaN (Date.prototype.getUTCDate()));
+assert (isNaN (Date.prototype.setMonth()));
+assert (isNaN (Date.prototype.setUTCMonth()));
+assert (isNaN (Date.prototype.setFullYear()));
+assert (isNaN (Date.prototype.setUTCFullYear()));
diff --git a/deps/jerry/tests/jerry/date-tostring.js b/deps/jerry/tests/jerry/date-tostring.js
new file mode 100644 (file)
index 0000000..9219239
--- /dev/null
@@ -0,0 +1,144 @@
+// 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.
+
+assert (new Date (NaN) == "Invalid Date");
+assert (new Date (Infinity, 1, 1, 0, 0, 0) == "Invalid Date");
+assert (new Date (2015, Infinity, 1, 0, 0, 0) == "Invalid Date");
+assert (new Date (2015, 7, 1, 0, Infinity, 0) == "Invalid Date");
+assert (new Date (NaN, 1, 1, 0, 0, 0) == "Invalid Date");
+assert (new Date (2015, NaN, 1, 0, 0, 0) == "Invalid Date");
+assert (new Date (2015, 7, 1, 0, NaN, 0) == "Invalid Date");
+assert (/Fri Feb 13 2015 \d{2}:\d{2}:\d{2} GMT\+\d{2}:\d{2}/.test (new Date ("2015-02-13")));
+assert (/Wed Jul 08 2015 \d{2}:\d{2}:\d{2} GMT\+\d{2}:\d{2}/.test (new Date ("2015-07-08T11:29:05.023")));
+
+try
+{
+  Date.prototype.toString.call(-1);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+var date = new Date(0);
+assert (/Thu Jan 01 1970 \d{2}:\d{2}:\d{2} GMT\+\d{2}:\d{2}/.test (date.toString()));
+assert (date.toUTCString() === "Thu, 01 Jan 1970 00:00:00 GMT");
+assert (date.toISOString() === "1970-01-01T00:00:00.000Z");
+
+date = new Date("2015-08-12T09:40:20.000Z")
+assert (/Wed Aug 12 2015 \d{2}:\d{2}:\d{2} GMT\+\d{2}:\d{2}/.test (date.toString()));
+assert (date.toUTCString() === "Wed, 12 Aug 2015 09:40:20 GMT");
+assert (date.toISOString() === "2015-08-12T09:40:20.000Z");
+
+assert (new Date (NaN).toDateString () == "Invalid Date");
+assert (new Date ("2015-02-13").toDateString () == "2015-02-13");
+assert (new Date ("2015-07-08T11:29:05.023").toDateString () == "2015-07-08");
+
+try
+{
+  Date.prototype.toDateString.call(-1);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+assert (new Date (NaN).toTimeString () == "Invalid Date");
+assert (new Date (Number.POSITIVE_INFINITY).toString () === "Invalid Date");
+assert (new Date ("2015-02-13").toTimeString () == "00:00:00.000");
+assert (new Date ("2015-07-08T11:29:05.023").toTimeString () == "11:29:05.023");
+
+try
+{
+  Date.prototype.toTimeString.call(-1);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+assert (new Date ("2015-07-16").toISOString () == "2015-07-16T00:00:00.000Z");
+assert (new Date ("2015-07-16T11:29:05.023").toISOString () == "2015-07-16T11:29:05.023Z");
+
+try
+{
+  new Date (NaN).toISOString ();
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof RangeError);
+}
+
+try
+{
+  new Date (Number.POSITIVE_INFINITY).toISOString ();
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof RangeError);
+}
+
+try
+{
+  Date.prototype.toISOString.call(-1);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+assert (new Date (NaN).toUTCString () == "Invalid Date");
+assert (new Date ("2015-07-16").toUTCString () == "Thu, 16 Jul 2015 00:00:00 GMT");
+assert (new Date ("2015-07-16T11:29:05.023").toUTCString () == "Thu, 16 Jul 2015 11:29:05 GMT");
+
+try
+{
+  Date.prototype.toUTCString.call(-1);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+assert (new Date (NaN).toJSON () == null);
+assert (new Date ("2015-07-16").toJSON () == "2015-07-16T00:00:00.000Z");
+assert (new Date ("2015-07-16T11:29:05.023").toJSON () == "2015-07-16T11:29:05.023Z");
+
+try
+{
+  Date.prototype.toJSON.call(-1);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+date_time = new Date ("2015-07-08T11:29:05.023").toJSON ();
+assert (new Date (date_time).toISOString () == "2015-07-08T11:29:05.023Z");
+
+assert (typeof Date (2015) == "string");
+assert (typeof Date() != typeof (new Date ()));
+assert (Date () == (new Date ()).toString ());
+assert (Date (2015, 1, 1) == (new Date ()).toString ());
+assert (Date (Number.NaN) == Date ());
+
+assert (new Date ("2015-07-08T11:29:05.023Z").toISOString() == "2015-07-08T11:29:05.023Z");
diff --git a/deps/jerry/tests/jerry/date-utc.js b/deps/jerry/tests/jerry/date-utc.js
new file mode 100644 (file)
index 0000000..4b6e3d3
--- /dev/null
@@ -0,0 +1,48 @@
+// 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.
+
+var d;
+
+d = Date.UTC(undefined);
+assert (isNaN(d));
+
+d = Date.UTC({});
+assert (isNaN(d));
+
+d = Date.UTC(2015);
+assert (isNaN(d));
+
+d = Date.UTC(2000 + 15, 0);
+assert (d == 1420070400000);
+
+d = Date.UTC(2015, 0);
+assert (d == 1420070400000);
+
+d = Date.UTC(2015, 0, 1);
+assert (d == 1420070400000);
+
+d = Date.UTC(2015, 0, 1, 0);
+assert (d == 1420070400000);
+
+d = Date.UTC(2015, 0, 1, 0, 0);
+assert (d == 1420070400000);
+
+d = Date.UTC(2015, 0, 1, 0, 0, 0);
+assert (d == 1420070400000);
+
+d = Date.UTC(2015, 0, 1, 0, 0, 0, 0);
+assert (d == 1420070400000);
+
+d = Date.UTC(2015, 6, 3, 14, 35, 43, 123);
+assert (d == 1435934143123);
diff --git a/deps/jerry/tests/jerry/delete.js b/deps/jerry/tests/jerry/delete.js
new file mode 100644 (file)
index 0000000..6b37597
--- /dev/null
@@ -0,0 +1,39 @@
+// 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.
+
+/* argument is not reference */
+assert (delete 0 === true);
+assert (delete "0" === true);
+assert (delete (a = 1) === true);
+assert (delete delete a === true);
+
+/* argument is unresolvable reference */
+assert (delete undefined_variable === true);
+
+/* argument is object-based reference */
+var a = [1];
+assert (a[0] === 1);
+assert (delete a[0] === true);
+assert (a[0] == undefined);
+
+var b = {c:0};
+assert (b.c === 0);
+assert (delete b.c === true);
+assert (b.c === undefined);
+
+/* argument is lexical environment-based reference */
+var a = 1;
+assert (a === 1);
+assert (delete a === false);
+assert (a === 1);
diff --git a/deps/jerry/tests/jerry/empty-varg.js b/deps/jerry/tests/jerry/empty-varg.js
new file mode 100644 (file)
index 0000000..40aaf22
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+var a = Object();
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry/equality.js b/deps/jerry/tests/jerry/equality.js
new file mode 100644 (file)
index 0000000..ea7a290
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+assert((5 == 5) == true);
+assert((7 != 2) == true);
+
+var num = 0;
+//var obj = new String("0");
+var str = "0";
+var b = false;
+
+assert(num === num);
+//assert(obj === obj);
+assert(str === str);
+
+//assert((num === obj) == false);
+assert((num === str) == false);
+//assert((obj === str) == false);
+//assert((null === undefined) == false);
+//assert((obj === null) == false);
+//assert((obj === undefined) == false);
diff --git a/deps/jerry/tests/jerry/error.js b/deps/jerry/tests/jerry/error.js
new file mode 100644 (file)
index 0000000..783d2a7
--- /dev/null
@@ -0,0 +1,200 @@
+// 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.
+
+var e;
+
+/* Error */
+e = new Error ();
+assert (e.name === "Error");
+assert (e.message === "");
+assert (e.toString() === "Error");
+
+e = new Error("some message");
+assert (e.name === "Error");
+assert (e.message === "some message");
+assert (e.toString() === "Error: some message");
+
+e.name = "";
+assert (e.toString() === "some message");
+e.message = "";
+assert (e.toString() === "");
+
+assert (Error.prototype.toString !== Object.prototype.toString);
+assert (Error.prototype.constructor === Error);
+assert (Error.prototype.name === "Error");
+assert (Error.prototype.message === "");
+assert (Error.prototype.toString() === "Error");
+
+/* TypeError */
+e = new TypeError ();
+assert (e.name === "TypeError");
+assert (e.message === "");
+assert (e.toString() === "TypeError");
+
+e = new TypeError("some message");
+assert (e.name === "TypeError");
+assert (e.message === "some message");
+assert (e.toString() === "TypeError: some message");
+
+e.name = "";
+assert (e.toString() === "some message");
+e.message = "";
+assert (e.toString() === "");
+
+assert (TypeError.prototype.toString === Error.prototype.toString);
+assert (TypeError.prototype.constructor === TypeError);
+assert (TypeError.prototype.name === "TypeError");
+assert (TypeError.prototype.message === "");
+assert (TypeError.prototype.toString() === "TypeError");
+
+try
+{
+  null[1] = 'abcd';
+
+  assert (false);
+}
+catch (e)
+{
+  assert(e instanceof TypeError);
+  assert(e instanceof Error);
+  assert(e instanceof Object);
+
+  assert(!(e instanceof Function));
+}
+
+
+/* ReferenceError */
+e = new ReferenceError ();
+assert (e.name === "ReferenceError");
+assert (e.message === "");
+assert (e.toString() === "ReferenceError");
+
+e = new ReferenceError("some message");
+assert (e.name === "ReferenceError");
+assert (e.message === "some message");
+assert (e.toString() === "ReferenceError: some message");
+
+e.name = "";
+assert (e.toString() === "some message");
+e.message = "";
+assert (e.toString() === "");
+
+assert (ReferenceError.prototype.toString === Error.prototype.toString);
+assert (ReferenceError.prototype.constructor === ReferenceError);
+assert (ReferenceError.prototype.name === "ReferenceError");
+assert (ReferenceError.prototype.message === "");
+assert (ReferenceError.prototype.toString() === "ReferenceError");
+
+try
+{
+  var a = non_existing_variable;
+
+  assert (false);
+}
+catch (e)
+{
+  assert(e instanceof ReferenceError);
+  assert(e instanceof Error);
+  assert(e instanceof Object);
+
+  assert(!(e instanceof Function));
+}
+
+/* EvalError */
+e = new EvalError ();
+assert (e.name === "EvalError");
+assert (e.message === "");
+assert (e.toString() === "EvalError");
+
+e = new EvalError("some message");
+assert (e.name === "EvalError");
+assert (e.message === "some message");
+assert (e.toString() === "EvalError: some message");
+
+e.name = "";
+assert (e.toString() === "some message");
+e.message = "";
+assert (e.toString() === "");
+
+assert (EvalError.prototype.toString === Error.prototype.toString);
+assert (EvalError.prototype.constructor === EvalError);
+assert (EvalError.prototype.name === "EvalError");
+assert (EvalError.prototype.message === "");
+assert (EvalError.prototype.toString() === "EvalError");
+
+/* RangeError */
+e = new RangeError ();
+assert (e.name === "RangeError");
+assert (e.message === "");
+assert (e.toString() === "RangeError");
+
+e = new RangeError("some message");
+assert (e.name === "RangeError");
+assert (e.message === "some message");
+assert (e.toString() === "RangeError: some message");
+
+e.name = "";
+assert (e.toString() === "some message");
+e.message = "";
+assert (e.toString() === "");
+
+assert (RangeError.prototype.toString === Error.prototype.toString);
+assert (RangeError.prototype.constructor === RangeError);
+assert (RangeError.prototype.name === "RangeError");
+assert (RangeError.prototype.message === "");
+assert (RangeError.prototype.toString() === "RangeError");
+
+/* SyntaxError */
+e = new SyntaxError ();
+assert (e.name === "SyntaxError");
+assert (e.message === "");
+assert (e.toString() === "SyntaxError");
+
+e = new SyntaxError("some message");
+assert (e.name === "SyntaxError");
+assert (e.message === "some message");
+assert (e.toString() === "SyntaxError: some message");
+
+e.name = "";
+assert (e.toString() === "some message");
+e.message = "";
+assert (e.toString() === "");
+
+assert (SyntaxError.prototype.toString === Error.prototype.toString);
+assert (SyntaxError.prototype.constructor === SyntaxError);
+assert (SyntaxError.prototype.name === "SyntaxError");
+assert (SyntaxError.prototype.message === "");
+assert (SyntaxError.prototype.toString() === "SyntaxError");
+
+/* URIError */
+e = new URIError ();
+assert (e.name === "URIError");
+assert (e.message === "");
+assert (e.toString() === "URIError");
+
+e = new URIError("some message");
+assert (e.name === "URIError");
+assert (e.message === "some message");
+assert (e.toString() === "URIError: some message");
+
+e.name = "";
+assert (e.toString() === "some message");
+e.message = "";
+assert (e.toString() === "");
+
+assert (URIError.prototype.toString === Error.prototype.toString);
+assert (URIError.prototype.constructor === URIError);
+assert (URIError.prototype.name === "URIError");
+assert (URIError.prototype.message === "");
+assert (URIError.prototype.toString() === "URIError");
diff --git a/deps/jerry/tests/jerry/es2015/regression-test-issue-1616.js b/deps/jerry/tests/jerry/es2015/regression-test-issue-1616.js
new file mode 100644 (file)
index 0000000..f08bd4d
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+var name = "";
+
+try
+{
+  var a = new ArrayBuffer (0xfffffffe)
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "RangeError");
+
diff --git a/deps/jerry/tests/jerry/es2015/regression-test-issue-1622.js b/deps/jerry/tests/jerry/es2015/regression-test-issue-1622.js
new file mode 100644 (file)
index 0000000..5c2b0c2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+for (var a in new Int8Array(123));
diff --git a/deps/jerry/tests/jerry/es2015/regression-test-issue-1633.js b/deps/jerry/tests/jerry/es2015/regression-test-issue-1633.js
new file mode 100644 (file)
index 0000000..60355b7
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+delete new Uint16Array()[0]
diff --git a/deps/jerry/tests/jerry/es2015/regression-test-issue-1670.js b/deps/jerry/tests/jerry/es2015/regression-test-issue-1670.js
new file mode 100644 (file)
index 0000000..636a1a7
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+var name = "";
+
+try
+{
+  Int16Array.from();
+}
+catch (e)
+{
+  name = e.name;
+}
+
+assert(name === "TypeError");
+
+Int16Array.of();
diff --git a/deps/jerry/tests/jerry/es2015/regression-test-issue-1763.js b/deps/jerry/tests/jerry/es2015/regression-test-issue-1763.js
new file mode 100644 (file)
index 0000000..cdbf96b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+new Promise(Math.max.propertyIsEnumerable.toString).then()
diff --git a/deps/jerry/tests/jerry/es2015/regression-test-issue-1765.js b/deps/jerry/tests/jerry/es2015/regression-test-issue-1765.js
new file mode 100644 (file)
index 0000000..d26b187
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+Function()(Promise.prototype.toLocaleString())
diff --git a/deps/jerry/tests/jerry/es2015/regression-test-issue-1881.js b/deps/jerry/tests/jerry/es2015/regression-test-issue-1881.js
new file mode 100644 (file)
index 0000000..9fddc6b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+new Promise(isFinite.toString).catch(Promise.prototype.then)
diff --git a/deps/jerry/tests/jerry/escape-sequences.js b/deps/jerry/tests/jerry/escape-sequences.js
new file mode 100644 (file)
index 0000000..7b3b8eb
--- /dev/null
@@ -0,0 +1,44 @@
+// 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.
+
+assert ('abcd\
+efgh' === 'abcdefgh');
+
+assert ('\'' === "'");
+assert ("\'" === "'");
+assert ('\"' === '"');
+assert ("\"" === '"');
+
+assert ((new String ('\\')).length === 1);
+assert ((new String ('\b')).length === 1);
+assert ((new String ('\f')).length === 1);
+assert ((new String ('\n')).length === 1);
+assert ((new String ('\r')).length === 1);
+assert ((new String ('\t')).length === 1);
+assert ((new String ('\v')).length === 1);
+
+/* verifying character codes */
+assert ((new String ('\\')).charCodeAt (0) === 92);
+assert ((new String ('\b')).charCodeAt (0) === 8);
+assert ((new String ('\f')).charCodeAt (0) === 12);
+assert ((new String ('\n')).charCodeAt (0) === 10);
+assert ((new String ('\r')).charCodeAt (0) === 13);
+assert ((new String ('\t')).charCodeAt (0) === 9);
+assert ((new String ('\v')).charCodeAt (0) === 11);
+
+/* 'p' is not SingleEscapeCharacter */
+assert ('\p' === 'p');
+
+var v\u0061riable = 'valu\u0065';
+assert (variable === 'value');
diff --git a/deps/jerry/tests/jerry/eval.js b/deps/jerry/tests/jerry/eval.js
new file mode 100644 (file)
index 0000000..4d0c4b6
--- /dev/null
@@ -0,0 +1,124 @@
+// 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.
+
+assert (eval () === undefined);
+assert (eval (undefined) === undefined);
+assert (eval (null) === null);
+assert (eval (true) === true);
+assert (eval (false) === false);
+assert (eval (1) === 1);
+assert (eval (eval) === eval);
+
+/* Indirect eval */
+function f1()
+{
+ var v1 = 'local value';
+
+ assert (v1 === 'local value');
+ assert (typeof (this.v1) === 'undefined');
+
+ r = this.eval ('var v1 = "global value";');
+
+ assert (v1 === 'local value');
+ assert (this.v1 === 'global value');
+ assert (r === undefined);
+};
+
+f1 ();
+
+/* Direct eval from strict mode code */
+function f2 (global)
+{
+ 'use strict';
+ var v2 = 'local value';
+
+ assert (v2 === 'local value');
+ assert (typeof (global.v2) === 'undefined');
+
+ r = eval ('var v2 = "global value";');
+
+ assert (v2 === 'local value');
+ assert (typeof (global.v2) === 'undefined');
+ assert (r === undefined);
+
+ try
+ {
+   eval ('arguments = 1;');
+   assert (false);
+ }
+ catch (e)
+ {
+   assert (e instanceof SyntaxError);
+ }
+}
+
+f2 (this);
+
+var y;
+
+for (var i = 0; i < 100; i++)
+{
+  var r = eval ('var x =' + ' 1;');
+  assert (typeof (x) === 'number');
+  assert (r === undefined);
+
+  delete x;
+  assert (typeof (x) === 'undefined');
+
+  r = eval ('"use ' + 's' + 't' + 'r' + 'i' + 'c' + 't"; va' + 'r x = 1;');
+  assert (typeof (x) === 'undefined');
+  assert (r === "use strict");
+
+  y = 'str';
+  assert (typeof (y) === 'string');
+
+  delete y;
+  assert (typeof (y) === 'string');
+
+  r = eval ('var y = "another ' + 'string";');
+  assert (y === 'another string');
+  assert (r == undefined);
+
+  delete y;
+  assert (typeof (y) === 'string');
+
+  r = eval ('if (true) 3; else 5;');
+  assert (r === 3);
+}
+
+// Check SyntaxError handling
+try
+{
+  eval ('var var;');
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof SyntaxError);
+}
+
+try
+{
+  eval ("v_0 = {a: Math, /[]/};");
+  assert (false);
+}
+catch(e)
+{
+  assert (e instanceof SyntaxError);
+}
+
+// nested eval with function expressions
+code = 'eval("(function (){})")';
+code = "eval ('" + code + "')";
+eval (code);
diff --git a/deps/jerry/tests/jerry/fail/arguments-assignment-strict.js b/deps/jerry/tests/jerry/fail/arguments-assignment-strict.js
new file mode 100644 (file)
index 0000000..21b91fd
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+arguments = 1;
diff --git a/deps/jerry/tests/jerry/fail/arguments-catch-strict.js b/deps/jerry/tests/jerry/fail/arguments-catch-strict.js
new file mode 100644 (file)
index 0000000..c772e1c
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+try{}catch(arguments){};
diff --git a/deps/jerry/tests/jerry/fail/arguments-in-prop-set-param-list-strict.js b/deps/jerry/tests/jerry/fail/arguments-in-prop-set-param-list-strict.js
new file mode 100644 (file)
index 0000000..c897ca3
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+var a = { set a(arguments) {} };
diff --git a/deps/jerry/tests/jerry/fail/arguments-in-var-decl-strict.js b/deps/jerry/tests/jerry/fail/arguments-in-var-decl-strict.js
new file mode 100644 (file)
index 0000000..9a2521b
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+var arguments;
diff --git a/deps/jerry/tests/jerry/fail/arguments-param-strict.js b/deps/jerry/tests/jerry/fail/arguments-param-strict.js
new file mode 100644 (file)
index 0000000..42e3d6b
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+function f(arguments) {}
diff --git a/deps/jerry/tests/jerry/fail/arguments-postfix-strict.js b/deps/jerry/tests/jerry/fail/arguments-postfix-strict.js
new file mode 100644 (file)
index 0000000..f1d6ce7
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+arguments++;
diff --git a/deps/jerry/tests/jerry/fail/arguments-prefix-strict.js b/deps/jerry/tests/jerry/fail/arguments-prefix-strict.js
new file mode 100644 (file)
index 0000000..b5f1a95
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+++arguments;
diff --git a/deps/jerry/tests/jerry/fail/delete-strict.js b/deps/jerry/tests/jerry/fail/delete-strict.js
new file mode 100644 (file)
index 0000000..e01eb49
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+delete a;
diff --git a/deps/jerry/tests/jerry/fail/escape-sequences-invalid-hex.js b/deps/jerry/tests/jerry/fail/escape-sequences-invalid-hex.js
new file mode 100644 (file)
index 0000000..ef72128
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+var str = '\x5t';
diff --git a/deps/jerry/tests/jerry/fail/escape-sequences-invalid-unicode.js b/deps/jerry/tests/jerry/fail/escape-sequences-invalid-unicode.js
new file mode 100644 (file)
index 0000000..539956a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+var str = '\u004t';
diff --git a/deps/jerry/tests/jerry/fail/escape-sequences-invalid-variable.js b/deps/jerry/tests/jerry/fail/escape-sequences-invalid-variable.js
new file mode 100644 (file)
index 0000000..102de95
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+var a\u0028bcd;
diff --git a/deps/jerry/tests/jerry/fail/eval-assignment-strict.js b/deps/jerry/tests/jerry/fail/eval-assignment-strict.js
new file mode 100644 (file)
index 0000000..26978d0
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+eval = 1;
diff --git a/deps/jerry/tests/jerry/fail/eval-catch-strict.js b/deps/jerry/tests/jerry/fail/eval-catch-strict.js
new file mode 100644 (file)
index 0000000..46fcf0d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+try{}catch(eval){};
diff --git a/deps/jerry/tests/jerry/fail/eval-in-prop-set-param-list-strict.js b/deps/jerry/tests/jerry/fail/eval-in-prop-set-param-list-strict.js
new file mode 100644 (file)
index 0000000..9a20d68
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+var a = { set a(eval) {} };
diff --git a/deps/jerry/tests/jerry/fail/eval-in-var-decl-strict.js b/deps/jerry/tests/jerry/fail/eval-in-var-decl-strict.js
new file mode 100644 (file)
index 0000000..9cd6f75
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+var eval;
diff --git a/deps/jerry/tests/jerry/fail/eval-param-strict.js b/deps/jerry/tests/jerry/fail/eval-param-strict.js
new file mode 100644 (file)
index 0000000..ff02fdb
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+function f(eval) {}
diff --git a/deps/jerry/tests/jerry/fail/eval-postfix-strict.js b/deps/jerry/tests/jerry/fail/eval-postfix-strict.js
new file mode 100644 (file)
index 0000000..41b5c89
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+eval++;
diff --git a/deps/jerry/tests/jerry/fail/eval-prefix-strict.js b/deps/jerry/tests/jerry/fail/eval-prefix-strict.js
new file mode 100644 (file)
index 0000000..d0a5773
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+++eval;
diff --git a/deps/jerry/tests/jerry/fail/func-expr-strict.js b/deps/jerry/tests/jerry/fail/func-expr-strict.js
new file mode 100644 (file)
index 0000000..3b16543
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+"use strict";
+
+(function () {
+  var let = 1;
+})();
diff --git a/deps/jerry/tests/jerry/fail/labelled-statements-break-across-function.js b/deps/jerry/tests/jerry/fail/labelled-statements-break-across-function.js
new file mode 100644 (file)
index 0000000..d467075
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+a: for (var i = 0; i < 10; i++)
+{
+  function f ()
+  {
+    for (var j = 0; n < 10; j++)
+    {
+      break a;
+    }
+  }
+
+  f ();
+}
diff --git a/deps/jerry/tests/jerry/fail/labelled-statements-duplicate-label.js b/deps/jerry/tests/jerry/fail/labelled-statements-duplicate-label.js
new file mode 100644 (file)
index 0000000..1730aa7
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+a: a: for (var i = 0; i < 10; i++)
+{
+  break a;
+}
diff --git a/deps/jerry/tests/jerry/fail/labelled-statements-no-label.js b/deps/jerry/tests/jerry/fail/labelled-statements-no-label.js
new file mode 100644 (file)
index 0000000..d5307a3
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+for (var i = 0; i < 10; i++)
+{
+  break a;
+}
diff --git a/deps/jerry/tests/jerry/fail/let-strict.js b/deps/jerry/tests/jerry/fail/let-strict.js
new file mode 100644 (file)
index 0000000..7c8a2d6
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+var let = 1;
diff --git a/deps/jerry/tests/jerry/fail/object-get-data.js b/deps/jerry/tests/jerry/fail/object-get-data.js
new file mode 100644 (file)
index 0000000..459a157
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+var a = {a:1, get a() {return 1}}
diff --git a/deps/jerry/tests/jerry/fail/object-get-get.js b/deps/jerry/tests/jerry/fail/object-get-get.js
new file mode 100644 (file)
index 0000000..4d987df
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+var a = {get a() {return undefined}, get a() {return undefined}}
diff --git a/deps/jerry/tests/jerry/fail/object-several-prop-names-strict.js b/deps/jerry/tests/jerry/fail/object-several-prop-names-strict.js
new file mode 100644 (file)
index 0000000..cec4eca
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+var a = {a:1, a:2};
diff --git a/deps/jerry/tests/jerry/fail/octal-strict.js b/deps/jerry/tests/jerry/fail/octal-strict.js
new file mode 100644 (file)
index 0000000..efdc0df
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+var a = 07;
diff --git a/deps/jerry/tests/jerry/fail/param-duplication-strict.js b/deps/jerry/tests/jerry/fail/param-duplication-strict.js
new file mode 100644 (file)
index 0000000..767f41f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+function f(a, a) {}
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1549.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1549.js
new file mode 100644 (file)
index 0000000..6e2e99b
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+va'Ôc=
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1550.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1550.js
new file mode 100644 (file)
index 0000000..2af0a00
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+do break; while a
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1597.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1597.js
new file mode 100644 (file)
index 0000000..7e58443
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+try {
+  throw 1
+} catch (e) {
+
+  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
+
+  throw 1
+}
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1598.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1598.js
new file mode 100644 (file)
index 0000000..8eed2dd
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+for (;; a[,b] )
+  break;
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1615.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1615.js
new file mode 100644 (file)
index 0000000..7b06851
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+0x10000 && eval(0x10000())
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1624.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1624.js
new file mode 100644 (file)
index 0000000..1c12273
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+with ({}) {
+  a = function (b)
+  {
+    var init;
+    init();
+  }
+}
+a();
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1671.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1671.js
new file mode 100644 (file)
index 0000000..0093114
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+Array.prototype.push("A", "B", 0, 1)
+Array.prototype.sort(JSON.parse)
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1831.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1831.js
new file mode 100644 (file)
index 0000000..26b5ebf
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+/኱𞻲/‌ஃ︠﹍
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1871-1.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1871-1.js
new file mode 100644 (file)
index 0000000..654d118
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+𝄞
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1871-2.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1871-2.js
new file mode 100644 (file)
index 0000000..dce6286
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+g𝄞
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1873.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1873.js
new file mode 100644 (file)
index 0000000..22e8f09
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+while (
+  {a: a,
+   get a() {}
+ }) continue;
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-1918.js b/deps/jerry/tests/jerry/fail/regression-test-issue-1918.js
new file mode 100644 (file)
index 0000000..e6ec1e5
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+throw $ = {name: function () {}}
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-358.js b/deps/jerry/tests/jerry/fail/regression-test-issue-358.js
new file mode 100644 (file)
index 0000000..e7d19c5
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+label_0: 
+    if (false)
+        do  {
+            continue label_0;
+        } while (false);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry/fail/regression-test-issue-384.js b/deps/jerry/tests/jerry/fail/regression-test-issue-384.js
new file mode 100644 (file)
index 0000000..13c3347
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+// Copyrnse.
+
+'use stricto
+// C_pyrnsq.
+
+'use strictI
+// Copyrnse. Functionn f_0(){
+    'use strictT
+// Copyrnse.
+
+'use strict)
+// Copyrnse.
+
+'use strict;
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry/fail/throw-error-object.js b/deps/jerry/tests/jerry/fail/throw-error-object.js
new file mode 100644 (file)
index 0000000..7782d95
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+throw new SyntaxError("error");
diff --git a/deps/jerry/tests/jerry/fail/throw-number.js b/deps/jerry/tests/jerry/fail/throw-number.js
new file mode 100644 (file)
index 0000000..dd9bd11
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+throw 0.1234;
diff --git a/deps/jerry/tests/jerry/fail/throw-string.js b/deps/jerry/tests/jerry/fail/throw-string.js
new file mode 100644 (file)
index 0000000..ae1476d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+throw "SyntaxError"
diff --git a/deps/jerry/tests/jerry/fail/with-strict.js b/deps/jerry/tests/jerry/fail/with-strict.js
new file mode 100644 (file)
index 0000000..7974a5c
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+"use strict"
+
+with (Array) {}
diff --git a/deps/jerry/tests/jerry/for-in.js b/deps/jerry/tests/jerry/for-in.js
new file mode 100644 (file)
index 0000000..84ef4e7
--- /dev/null
@@ -0,0 +1,283 @@
+// 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.
+
+// 1.
+var simple_obj = {a: 1, b: 2, c: 3, d: 4};
+for (var prop_of_simple_obj in simple_obj) {
+    simple_obj[prop_of_simple_obj] += 4;
+}
+
+assert(simple_obj.a === 5
+       && simple_obj.b === 6
+       && simple_obj.c === 7
+       && simple_obj.d === 8);
+
+// 2.
+for
+    (
+    var
+        prop_of_simple_obj in simple_obj
+    ) {
+    simple_obj[prop_of_simple_obj] -= 4;
+}
+
+assert(simple_obj.a === 1
+       && simple_obj.b === 2
+       && simple_obj.c === 3
+       && simple_obj.d === 4);
+
+// 3.
+function test() {
+  var cnt = 0;
+
+  for (var prop_of_simple_obj in simple_obj) {
+    if (prop_of_simple_obj === 'b')
+      continue;
+
+    cnt++;
+
+    simple_obj[prop_of_simple_obj] += 4;
+  }
+
+  return cnt;
+}
+
+var ret_val = test();
+
+assert((simple_obj.a === 5
+        && simple_obj.b === 2
+        && simple_obj.c === 7
+        && simple_obj.d == 8)
+       && ret_val === 3);
+
+// 4.
+var array_obj = new Array(1, 2, 3, 4, 5, 6, 7);
+var prop_of_array_obj;
+
+array_obj.eight = 8;
+
+for (prop_of_array_obj in array_obj) {
+    array_obj[prop_of_array_obj] += 1;
+}
+
+assert(array_obj[0] === 2
+       && array_obj[1] === 3
+       && array_obj[2] === 4
+       && array_obj[3] === 5
+       && array_obj[4] === 6
+       && array_obj[5] === 7
+       && array_obj[6] === 8
+       && array_obj['eight'] === 9);
+
+// 5.
+var null_obj = null;
+for (var prop_of_null_obj in null_obj) {
+    assert(false);
+}
+
+// 6.
+var empty_object = {};
+for (var prop_of_empty_object in empty_object) {
+    assert(false);
+}
+
+// 7.
+for (var i in undefined) {
+    assert(false);
+}
+
+// 8.
+var base_obj = {base_prop: "base"};
+
+function constr() {
+    this.derived_prop = "derived";
+}
+
+constr.prototype = base_obj;
+
+var derived_obj = new constr();
+
+for (var prop_of_derived_obj in derived_obj) {
+    derived_obj[prop_of_derived_obj] += "A";
+}
+
+assert(derived_obj.base_prop === "baseA" && derived_obj.derived_prop === "derivedA");
+
+// 9.
+log = {};
+count = 0;
+
+for (i in {q : 1})
+{
+  log [i] = true;
+  count++;
+}
+
+assert (count == 1 && 'q' in log);
+
+// 10.
+log = {};
+count = 0;
+
+for (i in {q : 1, p : 2, get f() { ; }, set f (v) { ; }, get t () { }, set c (v) {}})
+{
+  log [i] = true;
+  count++;
+}
+
+assert (count == 5
+        && 'q' in log
+        && 'p' in log
+        && 'f' in log
+        && 't' in log
+        && 'c' in log);
+
+// 11.
+log = {};
+count = 0;
+
+var a = [];
+a[5] = 5;
+for (var x in a)
+{
+  log[x] = true;
+  count++;
+}
+
+assert (count == 1
+        && '5' in log);
+
+// 12.
+log = {};
+count = 0;
+
+q = { c : 3, d : 4 };
+
+function p_constructor ()
+{
+  this.a = 1;
+  this.b = 2;
+
+  return this;
+}
+
+p_constructor.prototype = q;
+p = new p_constructor ();
+
+Object.defineProperty (p, 'h', { value : 5, enumerable : false, configurable : true });
+Object.defineProperty (q, 'h', { value : 6, enumerable : true, configurable : true });
+
+for (var i in p)
+{
+  log[i] = true;
+  count++;
+}
+
+assert (count == 4
+        && 'a' in log
+        && 'b' in log
+        && 'c' in log
+        && 'd' in log);
+
+// 13.
+log = {};
+count = 0;
+
+function f()
+{
+  var tmp = { a: 1, b: 2, c: 3, d: 4 };
+
+  return tmp;
+}
+
+for (var i in f())
+{
+  log[i] = true;
+  count++;
+}
+
+assert (count == 4
+        && 'a' in log
+        && 'b' in log
+        && 'c' in log
+        && 'd' in log);
+
+// 14.
+log = {};
+count = 0;
+
+b = 'prop';
+c = { prop : 1 };
+Boolean.prototype.boolean_prototype_prop = 1;
+
+for (a in b in c)
+{
+  log[a] = true;
+  count++;
+}
+
+assert (count == 1
+        && 'boolean_prototype_prop' in log);
+
+// 15.
+log = {};
+count = 0;
+
+for (a in 'prop' in { prop : 1 })
+{
+  log[a] = true;
+  count++;
+}
+
+assert (count == 1
+        && 'boolean_prototype_prop' in log);
+
+// 16.
+a = 'str';
+b = {};
+for ((a in b) ; ; )
+{
+  break;
+}
+
+// 17.
+log = {};
+count = 0;
+
+var base_obj = { base_prop1: "base1", base_prop2: "base2" };
+
+function l () {
+    this.derived_prop1 = "derived1";
+    this.derived_prop2 = "derived2";
+}
+
+l.prototype = base_obj;
+
+var derived_obj = new l();
+
+for (var prop_of_derived_obj in derived_obj) {
+  delete derived_obj.derived_prop1;
+  delete derived_obj.derived_prop2;
+  delete base_obj.base_prop1;
+  delete base_obj.base_prop2;
+
+  log[prop_of_derived_obj] = true;
+  count++;
+}
+
+assert(count == 1
+       && ('base_prop1' in log
+           || 'base_prop2' in log
+           || 'derived_prop1' in log
+           || 'derived_prop2' in log));
diff --git a/deps/jerry/tests/jerry/for.js b/deps/jerry/tests/jerry/for.js
new file mode 100644 (file)
index 0000000..9a2ee16
--- /dev/null
@@ -0,0 +1,83 @@
+// 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.
+
+// 1.
+var i = 0;
+for (; i < 100; i++) {
+}
+assert(i == 100);
+
+// 2.
+for (var j = 0; j < 100; j++) {
+}
+assert(j == 100);
+
+// 3.
+for (i = 0; ; ) {
+  if (i == 100) {
+    break;
+    assert(false);
+  }
+  i++;
+}
+assert(i == 100);
+
+// 4.
+for (i = 0; i < 10; i++) {
+  for (j = 0; j < 10; j++) {
+  }
+}
+assert(i != 100);
+assert(j != 100);
+assert(i == 10);
+assert(j == 10);
+
+// 5.
+s = '';
+for (
+var i = {x: 0};
+
+ i.x < 2
+;
+ i.x++
+
+)
+ {
+  s += i.x;
+}
+
+assert (s === '01');
+
+// 6.
+s = '';
+for (
+var i = {x: 0};
+
+ i.x < 2
+;
+
+ i.x++
+
+)
+ {
+  s += i.x;
+}
+
+assert (s === '01');
+
+// 7.
+a = [];
+for (; a[0]; ) {
+  assert (false);
+}
diff --git a/deps/jerry/tests/jerry/func-decl.js b/deps/jerry/tests/jerry/func-decl.js
new file mode 100644 (file)
index 0000000..6be92e2
--- /dev/null
@@ -0,0 +1,55 @@
+// 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.
+
+function f() {
+    return 'foo';
+}
+assert ((function() {
+    if (1 === 0) {
+        function f() {
+            return 'bar';
+        }
+    }
+    return f();
+})() === 'bar');
+
+function check_syntax_error (s) {
+  try {
+    eval (s);
+    assert (false);
+  }
+  catch (e) {
+    assert (e instanceof SyntaxError);
+  }
+}
+
+check_syntax_error ("'use strict'; function arguments () {}");
+check_syntax_error ("'use strict'; var l = function arguments () {}");
+
+check_syntax_error ("function f__strict_mode_duplicate_parameters (p, p) { 'use strict'; }");
+
+function test_strict_mode_propagation_in_func_expr_and_getters_setters () {
+  var p = function () {
+    'use strict';
+
+    return true;
+  }
+
+  var o = { get prop () { 'use strict'; return true; }, set prop (v) { 'use strict'; } };
+
+  function test () {
+    tmp_eval = eval;
+    eval = tmp_eval;
+  }
+}
diff --git a/deps/jerry/tests/jerry/function-args.js b/deps/jerry/tests/jerry/function-args.js
new file mode 100644 (file)
index 0000000..a205494
--- /dev/null
@@ -0,0 +1,72 @@
+// 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.
+
+function f1(x)
+{
+  var c1 = (x >= 1);
+  var c2 = (x <= 10);
+
+  if (c1 === true)
+  {
+    if (c2 === true)
+    {
+      assert(t);
+
+      return;
+    }
+  }
+
+  assert(t === false);
+}
+
+var i;
+var t = true;
+
+for(i = 1; i <= 10; i++)
+{
+  f1(i);
+}
+
+t = false;
+
+for(i = 11; i <= 20; i++)
+{
+  f1(i);
+}
+
+function g (p, p) {
+  assert (p === arguments[1]);
+  assert (p === 'second');
+}
+
+g ('first', 'second');
+
+try {
+  f1 ({});
+  f1 (undefined_variable);
+  assert (false);
+}
+catch (e) {
+  assert (e instanceof ReferenceError);
+}
+
+function f2 ()
+{
+  return this;
+}
+
+with ({})
+{
+  assert (f2 () === this);
+}
diff --git a/deps/jerry/tests/jerry/function-construct.js b/deps/jerry/tests/jerry/function-construct.js
new file mode 100644 (file)
index 0000000..d04935a
--- /dev/null
@@ -0,0 +1,134 @@
+// 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.
+
+var f = new Function ('');
+assert (f () === undefined);
+
+var f = new Function ('"use strict"; f = undefined;');
+assert (f () === undefined && f === undefined);
+
+var f = new Function ('"use strict"; q = undefined;');
+try
+{
+  f ();
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+}
+
+for (i = 1; i < 10; i ++)
+{
+  var f = new Function ('a', 'b', 'var q = a; b++; function f (k) {return q + k + b++;}; return f;');
+
+  var fns = new Array ();
+
+  for (var n = 0; n < 10; n++)
+  {
+    var r = f (1, 7);
+    fns[n] = r;
+
+    var check_value = 10;
+
+    for (var m = 0; m < 100; m++)
+    {
+      var value = r (1);
+      assert (check_value++ === value);
+    }
+  }
+
+  var check_value = 109;
+  for (var n = 0; n < 11; n++)
+  {
+    for (var m = 0; m < 10; m++)
+    {
+      var value = fns [m] (m * n);
+      assert (value == check_value + m * n);
+    }
+
+    check_value++;
+  }
+}
+
+var f = new Function ("a,b", "c", "return a + b + c;");
+assert (f (1,2,3) === 6);
+
+f = new Function ("a,b", "c,d", "return a + b + c + d;");
+assert (f (1,2,3,4) === 10);
+
+f = new Function ("a" , "b", "c,d", "return a + b + c + d;");
+assert (f (1,2,3,4) === 10);
+
+var f = new Function (" a\t ,  b", "\u0020c", "return a + b + c;");
+assert (f (1,2,3) === 6);
+
+f = new Function ("a, \n b  \u0020", "c \t, d\n", "return a + b + c + d;");
+assert (f (1,2,3,4) === 10);
+
+f = new Function (" a\t" , "\nb ", " \u0020c , d ", "return a + b + c + d;");
+assert (f (1,2,3,4) === 10);
+
+try
+{
+  new Function ({
+    toString : function () {
+      throw new TypeError();
+    },
+    valueOf : function () {
+      throw new TypeError();
+    }
+  });
+
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+var p = { toString : function() { throw 1; } };
+var body = { toString : function() { throw "body"; } };
+
+try
+{
+  new Function (p, body);
+  // Should not be reached.
+  assert (false);
+}
+catch (e)
+{
+  assert (e === 1);
+}
+
+// Check SyntaxError handling
+try
+{
+  new Function ('var var;');
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof SyntaxError);
+}
+
+try
+{
+  new Function ('a;b', 'return;');
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof SyntaxError);
+}
diff --git a/deps/jerry/tests/jerry/function-external.js b/deps/jerry/tests/jerry/function-external.js
new file mode 100644 (file)
index 0000000..d6eae39
--- /dev/null
@@ -0,0 +1,43 @@
+// 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.
+
+try {
+  ({} instanceof assert);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+assert.prototype = {}
+
+try {
+  assert(!({} instanceof assert));
+} catch(e) {
+  assert(false);
+}
+
+try {
+  ({} instanceof Math.sin);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+Math.sin.prototype = {}
+
+try {
+  assert(!({} instanceof Math.sin));
+} catch(e) {
+  assert(false);
+}
diff --git a/deps/jerry/tests/jerry/function-prototype-apply.js b/deps/jerry/tests/jerry/function-prototype-apply.js
new file mode 100644 (file)
index 0000000..1198f33
--- /dev/null
@@ -0,0 +1,74 @@
+// 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.
+
+// See a general usage: number addition.
+function addNum ()
+{
+  var sum = 0;
+  for(var i = 0; i < arguments.length; i++)
+  {
+    sum += arguments[i];
+  }
+  return sum;
+}
+
+var array = [6720, 4, 42];
+var obj;
+
+obj = addNum.apply(obj, array);
+assert (obj === 6766);
+
+// If the arguments are missing.
+obj = addNum.apply();
+assert (obj === 0);
+
+obj = addNum.apply(obj);
+assert (obj === 0);
+
+// If the function is a builtin.
+assert (Math.min.apply(null, array) === 4);
+assert (Math.max.apply(null, array) === 6720);
+
+// If the function can't be used as caller.
+try {
+  obj = new Function.prototype.apply();
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+// If the called function throws an error.
+function throwError ()
+{
+  throw new ReferenceError ("foo");
+}
+
+try {
+  obj = throwError.apply(obj, array);
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+// If the array access throws an error.
+Object.defineProperty(array, '0', { 'get' : function () { throw new ReferenceError ("foo"); } });
+
+try {
+  obj = addNum.apply(obj, array);
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/function-prototype-bind.js b/deps/jerry/tests/jerry/function-prototype-bind.js
new file mode 100644 (file)
index 0000000..76401a6
--- /dev/null
@@ -0,0 +1,139 @@
+// 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.
+
+var mul = function(a, b) {
+  return a * b;
+};
+
+var triple = mul.bind(null, 3);
+delete mul;
+assert (triple(20) === 60);
+assert (triple.prototype === undefined);
+
+var dupl = triple.bind({}, 2);
+assert (dupl() === 6);
+assert (dupl.prototype === undefined);
+
+try {
+  var obj = {};
+  var new_func = obj.bind(null, 'foo');
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+var obj1 = {num : 36};
+
+var f1 = function(a) {
+  return this.num + a;
+}
+
+var add36 = f1.bind(obj1);
+assert (add36(24) === 60);
+
+var appendfoo = f1.bind(obj1, "foo");
+assert (appendfoo() === "36foo");
+
+var f2 = function(a) {
+  return this.num + a.num;
+}
+
+var sum = f2.bind(obj1, obj1);
+assert (sum() === 72);
+
+function P(x, y) {
+  this.x = x;
+  this.y = y;
+}
+
+var P1 = P.bind({}, 2);
+var _p1 = new P1();
+assert (_p1.x === 2);
+assert (_p1.y === undefined);
+assert (_p1 instanceof P);
+assert (_p1 instanceof P1);
+
+var P2 = P1.bind(null);
+var _p2 = new P2();
+assert (_p2.x === 2);
+assert (_p2.y === undefined);
+
+_p2 = new P2(12, 60);
+assert (_p2.x === 2);
+assert (_p2.y === 12);
+
+_p2 = new P2({}, 12);
+assert (_p2.x === 2);
+assert (Object.getPrototypeOf(_p2.y) === Object.prototype);
+assert (_p2 instanceof P);
+assert (_p2 instanceof P1);
+assert (_p2 instanceof P2);
+
+var P3 = P2.bind({}, 5);
+var _p3 = new P3(8);
+assert (_p3.x === 2);
+assert (_p3.y === 5);
+assert (_p3 instanceof P);
+assert (_p3 instanceof P1);
+assert (_p3 instanceof P2);
+assert (_p3 instanceof P3);
+
+var P4 = P.bind();
+P4(4, 5);
+assert (x === 4);
+assert (y === 5);
+
+var _x = x;
+var _y = y;
+
+var P5 = P.bind(undefined);
+P5(5, 4);
+assert (x === _y);
+assert (y === _x);
+
+var number = Number.constructor;
+var bound = number.bind(null, 24);
+var foo = new bound();
+assert (foo() === undefined);
+
+var number = Number;
+var bound = number.bind(null, 3);
+var foo = new bound();
+assert (foo == 3);
+assert (foo instanceof Number);
+assert (foo.prototype === undefined);
+
+var func = Number.prototype.toString.bind('foo');
+assert (func instanceof Function);
+
+try {
+  var math = Math.sin;
+  var bound = math.bind(null, 0);
+  var foo = new bound();
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+var foo = function(x, y) { }
+
+var bound = foo.bind(null);
+assert(bound.length === 2);
+
+bound = foo.bind(null, 9);
+assert(bound.length === 1);
+
+bound = foo.bind(null, 9, 8);
+assert(bound.length === 0);
+
diff --git a/deps/jerry/tests/jerry/function-prototype-tostring.js b/deps/jerry/tests/jerry/function-prototype-tostring.js
new file mode 100644 (file)
index 0000000..9b1438e
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+assert (Math.cos.toString() === "function(){/* ecmascript */}");
+
+function none() { return 1; }
+assert (none.toString() === "function(){/* ecmascript */}");
+
+function single(b) { return 1; }
+assert (single.toString() === "function(){/* ecmascript */}");
+
+function multiple(a,b) { return 1; }
+assert (multiple.toString() === "function(){/* ecmascript */}");
+
+function lots(a,b,c,d,e,f,g,h,i,j,k) { return 1; }
+assert (lots.toString() === "function(){/* ecmascript */}");
diff --git a/deps/jerry/tests/jerry/function-return.js b/deps/jerry/tests/jerry/function-return.js
new file mode 100644 (file)
index 0000000..62a9053
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+
+function f_empty()
+{
+  return;
+}
+
+function f_42()
+{
+  return 42;
+}
+
+function f_expr()
+{
+  var a = 5;
+  var b = 5;
+  return a + b;
+}
+
+assert(f_expr() === 10);
+assert(f_42() === 42);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry/function-scopes.js b/deps/jerry/tests/jerry/function-scopes.js
new file mode 100644 (file)
index 0000000..b7f46f1
--- /dev/null
@@ -0,0 +1,36 @@
+// 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.
+
+try {
+  (function() {
+    function decl() {}
+  })();
+  decl();
+  assert(false);
+} catch (e) {
+  assert(e instanceof ReferenceError);
+}
+
+try {
+  var o = {
+    get p() {
+      function decl() {
+      }
+    }
+  };
+  decl();
+  assert(false);
+} catch (e) {
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/function.js b/deps/jerry/tests/jerry/function.js
new file mode 100644 (file)
index 0000000..6b80e73
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+assert(Function.constructor === Function);
+assert(Function.prototype() === undefined);
+assert(Function.length === 1);
diff --git a/deps/jerry/tests/jerry/function.prototype.js b/deps/jerry/tests/jerry/function.prototype.js
new file mode 100644 (file)
index 0000000..0203901
--- /dev/null
@@ -0,0 +1,28 @@
+// 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.
+
+function f (arg1, arg2, arg3)
+{
+  this.string = arg1;
+  this.number = arg2;
+  this.boolean = arg3;
+}
+
+var this_arg = {};
+
+f.call (this_arg, 's', 1, true, null);
+
+assert (this_arg.string  === 's');
+assert (this_arg.number  === 1);
+assert (this_arg.boolean === true);
diff --git a/deps/jerry/tests/jerry/gc.js b/deps/jerry/tests/jerry/gc.js
new file mode 100644 (file)
index 0000000..e6e48c2
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+
+var obj = {}, obj_l;
+obj_l = obj;
+
+for (var k = 0; k < 1500; k++)
+{
+  obj_l.prop = {};
+  obj_l = obj_l.prop;
+}
+
+function f (o, i) {
+  if (--i > 0) {
+    f ({a:o, b:o}, i);
+  }
+}
+
+for (var i = 0; i < 100; i++)
+{
+  ({} + f ({}, 12));
+}
diff --git a/deps/jerry/tests/jerry/get-value.js b/deps/jerry/tests/jerry/get-value.js
new file mode 100644 (file)
index 0000000..1a6534e
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+
+
+/*
+ * Check that in case of 'primitive' base, 'this' argument of [[Call]] is the base value, not ToObject (base).
+ */
+function test_1 ()
+{
+ 'use strict';
+
+ Object.defineProperty (Number.prototype,
+                        'getter',
+                        { get : function () { return this; }, configurable : true });
+
+ assert ((10).getter === 10);
+ assert (typeof ((10).getter) === 'number');
+
+ delete Number.prototype.getter;
+}
+
+test_1 ();
diff --git a/deps/jerry/tests/jerry/getter-setter-this-value.js b/deps/jerry/tests/jerry/getter-setter-this-value.js
new file mode 100644 (file)
index 0000000..217e9f0
--- /dev/null
@@ -0,0 +1,34 @@
+// 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.
+
+function Box(data) {
+  this._data = data;
+}
+
+var box = new Box('=');
+
+Object.defineProperty(Box.prototype, 'data', {
+  get: function () {
+    assert(this === box);
+    return this._data;
+  },
+  set: function (data) {
+    assert(this === box);
+    this._data = data;
+  }
+});
+
+assert(box.data === '=');
+box.data = '+';
+assert(box.data === '+');
diff --git a/deps/jerry/tests/jerry/global-escaping.js b/deps/jerry/tests/jerry/global-escaping.js
new file mode 100644 (file)
index 0000000..5ceaec5
--- /dev/null
@@ -0,0 +1,59 @@
+// 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.
+
+// Escaping
+
+assert (escape ("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f") ===
+        "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F");
+assert (escape ("\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f") ===
+        "%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F");
+assert (escape (" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN") ===
+        "%20%21%22%23%24%25%26%27%28%29*+%2C-./0123456789%3A%3B%3C%3D%3E%3F@ABCDEFGHIJKLMN");
+assert (escape ("OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\x7F") ===
+        "OPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7F");
+
+assert (escape("\x80\x95\xaf\xfe\xff") === "%80%95%AF%FE%FF");
+assert (escape("\u0100\ud800\udc00") === "%u0100%uD800%uDC00");
+
+assert (escape({}) === "%5Bobject%20Object%5D");
+assert (escape(true) === "true");
+
+// Unescaping
+
+assert (unescape ("%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F") ===
+        "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f");
+assert (unescape("%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F") ===
+        "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f");
+assert (unescape("%20%21%22%23%24%25%26%27%28%29*+%2C-./0123456789%3A%3B%3C%3D%3E%3F@ABCDEFGHIJKLMN") ===
+        " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN");
+assert (unescape("OPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7F") ===
+        "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\x7F");
+assert (unescape("%80%95%AF%FE%FF") === "\x80\x95\xaf\xfe\xff");
+assert (unescape("%ud800") === "\ud800");
+assert (unescape("\ud800") === "\ud800");
+assert (unescape("\ud800\udc00") === "\ud800\udc00");
+assert (unescape("%ud800%udc00") === "\ud800\udc00");
+assert (unescape("\ud800%udc00") === "\ud800\udc00");
+assert (unescape("%ud800\udc00") === "\ud800\udc00");
+
+assert (unescape({}) === "[object Object]");
+assert (unescape(true) === "true")
+assert (unescape() === "undefined");
+assert (unescape(1985) === "1985");
+assert (unescape("%5#%uu") === "%5#%uu");
+
+// Inversion
+
+var str = "\u0001\u0000\uFFFF";
+assert (unescape(escape(str)) === str);
diff --git a/deps/jerry/tests/jerry/global-parsefloat.js b/deps/jerry/tests/jerry/global-parsefloat.js
new file mode 100644 (file)
index 0000000..7df1734
--- /dev/null
@@ -0,0 +1,87 @@
+// 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.
+
+assert(parseFloat("1") === 1);
+assert(parseFloat("+1") === 1);
+assert(parseFloat("-1") === -1);
+assert(parseFloat("1.2") === 1.2);
+assert(parseFloat("+1.2") === 1.2);
+assert(parseFloat("-1.2") === -1.2);
+assert(parseFloat("1.2e3") === 1200);
+assert(parseFloat("+1.2e3") === 1200);
+assert(parseFloat("-1.2e3") === -1200);
+assert(parseFloat("   \n\t  1.2e3") === 1200);
+assert(parseFloat("03.02e1") === 30.2);
+assert(parseFloat("003.") === 3);
+assert(parseFloat(".2e3") === 200);
+assert(parseFloat("1.e3") === 1000);
+assert(parseFloat("1.2e") === 1.2);
+assert(parseFloat("1.e") === 1);
+assert(parseFloat("1.e3") === 1000);
+assert(parseFloat("1e3") === 1000);
+assert(parseFloat("1e") === 1);
+assert(parseFloat("1.2e3foo") === 1200);
+assert(isNaN(parseFloat("foo1.2e3foo")));
+assert(parseFloat("Infinity") === Infinity);
+assert(parseFloat("-Infinity") === -Infinity);
+assert(parseFloat("Infinityfoo") === Infinity);
+assert(parseFloat("-Infinityfoo") === -Infinity);
+assert(isNaN(parseFloat("")));
+assert(isNaN(parseFloat(".")));
+assert(isNaN(parseFloat("..")));
+assert(isNaN(parseFloat("+")));
+assert(isNaN(parseFloat("-")));
+assert(isNaN(parseFloat("e")));
+assert(isNaN(parseFloat("a")));
+assert(isNaN(parseFloat("e+")));
+assert(isNaN(parseFloat("+e-")));
+assert(isNaN(parseFloat(".e")));
+assert(isNaN(parseFloat(".a")));
+assert(isNaN(parseFloat("e3")));
+assert(isNaN(parseFloat(".e3")));
+assert(parseFloat("1..2") === 1);
+assert(parseFloat("1.2.3") === 1.2);
+assert(parseFloat("1.2ee3") === 1.2);
+assert(parseFloat("0") === 0);
+assert(parseFloat(".0") === 0);
+assert(parseFloat("0.e3") === 0);
+assert(parseFloat("0.0e3") === 0);
+assert(parseFloat("1.2eA") === 1.2);
+assert(parseFloat("1.ae3") === 1);
+assert(parseFloat("\u00a0\u00a01.2e3") === 1200);
+assert(parseFloat("\u2029\u2029\u00a01.2e\u00D0") === 1.2);
+assert(isNaN(parseFloat("\u2029\u2029\u00a0\u00D01.2e3")));
+assert(parseFloat("\u2029\u2029\u00a01.\u20292e\u00D0") === 1);
+assert(isNaN(parseFloat("\u2029\u2029")));
+
+var obj = new Object();
+var arr = [3,4,5];
+var num = 7;
+var bool = true;
+var undef;
+
+assert(isNaN(parseFloat(obj)));
+assert(parseFloat(arr) === 3);
+assert(parseFloat(num) === 7);
+assert(isNaN(parseFloat(bool)));
+assert(isNaN(parseFloat(undef)));
+
+var obj = { toString : function () { throw new ReferenceError("foo") } };
+try {
+  parseFloat(obj);
+  assert(false);
+} catch (e) {
+  assert(e instanceof ReferenceError);
+  assert(e.message === "foo");
+}
diff --git a/deps/jerry/tests/jerry/global-parseint.js b/deps/jerry/tests/jerry/global-parseint.js
new file mode 100644 (file)
index 0000000..b58cf32
--- /dev/null
@@ -0,0 +1,79 @@
+// 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.
+
+assert(parseInt("123") === 123);
+assert(parseInt("+123") === 123);
+assert(parseInt("-123") === -123);
+assert(parseInt("0123") === 123);
+assert(parseInt("  123") === 123);
+assert(parseInt(" \n  123") === 123);
+assert(parseInt(" \n  123  \t") === 123);
+assert(parseInt("0x123") === 291);
+assert(parseInt("0X123") === 291);
+assert(parseInt("123", 4) === 27);
+assert(parseInt("ABC", 16) === 2748);
+assert(parseInt("12A3") === 12);
+assert(parseInt("12.34") === 12);
+assert(isNaN(parseInt("AB")));
+assert(isNaN(parseInt("")));
+assert(isNaN(parseInt("-")));
+assert(isNaN(parseInt("-", 11)));
+assert(parseInt("\u00a0123") === 123);
+assert(parseInt("\u20291  123\u00D0") === 1);
+assert(parseInt("\u00a0123", 13) === 198);
+assert(parseInt("\u2029123  1\u00D0", 11) === 146);
+assert(isNaN(parseInt("\u0009")));
+assert(isNaN(parseInt("\u00A0")));
+assert(parseInt("\u00A0\u00A0-1") === parseInt("-1"));
+assert(parseInt("\u00A01") === parseInt("1"));
+
+var bool = true;
+var obj = new Object();
+var num = 8;
+var arr = [2,3,4];
+var undef;
+
+assert(isNaN(parseInt(bool, bool)));
+assert(isNaN(parseInt(bool, obj)));
+assert(isNaN(parseInt(bool, num)));
+assert(isNaN(parseInt(bool, arr)));
+
+assert(isNaN(parseInt(obj, bool)));
+assert(isNaN(parseInt(obj, obj)));
+assert(isNaN(parseInt(obj, num)));
+assert(isNaN(parseInt(obj, arr)));
+
+assert(isNaN(parseInt(num, bool)));
+assert(parseInt(num, obj) === 8);
+assert(isNaN(parseInt(num, num)));
+assert(parseInt(num, arr) === 8);
+
+assert(isNaN(parseInt(arr, bool)));
+assert(parseInt(arr, obj) === 2);
+assert(parseInt(arr, num) === 2);
+assert(parseInt(arr, arr) === 2);
+
+assert(isNaN(parseInt(undef, bool)));
+assert(isNaN(parseInt(undef, obj)));
+assert(isNaN(parseInt(undef, num)));
+assert(isNaN(parseInt(undef, arr)));
+
+var obj = { toString : function () { throw new ReferenceError("foo") } };
+try {
+  parseInt(obj);
+  assert(false);
+} catch (e) {
+  assert(e instanceof ReferenceError);
+  assert(e.message === "foo");
+}
diff --git a/deps/jerry/tests/jerry/global-uri-coding.js b/deps/jerry/tests/jerry/global-uri-coding.js
new file mode 100644 (file)
index 0000000..169507b
--- /dev/null
@@ -0,0 +1,134 @@
+// 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.
+
+// URI encoding
+
+// This test will not pass on FLOAT32 due to precision issues
+
+function checkEncodeURIParseError (str)
+{
+  try {
+    encodeURI (str);
+    assert (false);
+  } catch(e) {
+    assert(e instanceof URIError);
+  }
+}
+
+assert (encodeURI ("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f") ===
+        "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F");
+assert (encodeURI ("\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f") ===
+        "%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F");
+assert (encodeURI (" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN") ===
+         "%20!%22#$%25&'()*+,-./0123456789:;%3C=%3E?@ABCDEFGHIJKLMN");
+assert (encodeURI ("OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\x7F") ===
+         "OPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7F");
+
+assert (encodeURIComponent ("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f") ===
+        "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F");
+assert (encodeURIComponent ("\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f") ===
+        "%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F");
+assert (encodeURIComponent (" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN") ===
+        "%20!%22%23%24%25%26'()*%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMN");
+assert (encodeURIComponent ("OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\x7F") ===
+        "OPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7F");
+
+assert (encodeURI ("\xe9") == "%C3%A9");
+assert (encodeURI ("\ud7ff") == "%ED%9F%BF");
+assert (encodeURI ("\ue000") == "%EE%80%80");
+assert (encodeURI ("\ud800\udc00") == "%F0%90%80%80");
+assert (encodeURI (String.fromCharCode(0xd800, 0xdc00)) == "%F0%90%80%80");
+
+checkEncodeURIParseError ("\ud800");
+checkEncodeURIParseError ("\udfff");
+
+// URI decoding
+
+function checkDecodeURIParseError (str)
+{
+  try {
+    decodeURI (str);
+    assert (false);
+  } catch(e) {
+    assert(e instanceof URIError);
+  }
+}
+
+assert (decodeURI ("%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F") ===
+        "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f");
+assert (decodeURI ("%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F") ===
+        "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f");
+assert (decodeURI ("%20%21%22%23%24%25%26%27%28%29%2a%2b%2c%2d%2e%2f") ===
+        " !\"%23%24%%26'()*%2b%2c-.%2f");
+assert (decodeURI ("%30%31%32%33%34%35%36%37%38%39%3a%3b%3c%3d%3e%3f") ===
+        "0123456789%3a%3b<%3d>%3f");
+assert (decodeURI ("%40%41%42%43%44%45%46%47%48%49%4a%4b%4c%4d%4e%4f") ===
+        "%40ABCDEFGHIJKLMNO");
+assert (decodeURI ("%50%51%52%53%54%55%56%57%58%59%5a%5b%5c%5d%5e%5f") ===
+        "PQRSTUVWXYZ[\\]^_");
+assert (decodeURI ("%60%61%62%63%64%65%66%67%68%69%6a%6b%6c%6d%6e%6f") ===
+        "`abcdefghijklmno");
+assert (decodeURI ("%70%71%72%73%74%75%76%77%78%79%7a%7b%7c%7d%7e") ===
+        "pqrstuvwxyz{|}~");
+
+assert (decodeURIComponent ("%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F") ===
+        "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f");
+assert (decodeURIComponent ("%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F") ===
+        "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f");
+assert (decodeURIComponent ("%20%21%22%23%24%25%26%27%28%29%2a%2b%2c%2d%2e%2f") ===
+        " !\"#$%&'()*+,-./");
+assert (decodeURIComponent ("%30%31%32%33%34%35%36%37%38%39%3a%3b%3c%3d%3e%3f") ===
+        "0123456789:;<=>?");
+assert (decodeURIComponent ("%40%41%42%43%44%45%46%47%48%49%4a%4b%4c%4d%4e%4f") ===
+        "@ABCDEFGHIJKLMNO");
+assert (decodeURIComponent ("%50%51%52%53%54%55%56%57%58%59%5a%5b%5c%5d%5e%5f") ===
+        "PQRSTUVWXYZ[\\]^_");
+assert (decodeURIComponent ("%60%61%62%63%64%65%66%67%68%69%6a%6b%6c%6d%6e%6f") ===
+        "`abcdefghijklmno");
+assert (decodeURIComponent ("%70%71%72%73%74%75%76%77%78%79%7a%7b%7c%7d%7e") ===
+        "pqrstuvwxyz{|}~");
+
+assert (decodeURI ("%6A%6B%6C%6D%6E%6F") === "jklmno");
+assert (decodeURI ("%C3%A9") === "\xe9");
+assert (decodeURI ("%e2%b1%a5") === "\u2c65");
+/* assert (decodeURI ("%f0%90%90%a8") === "\ud801\udc28"); */
+
+checkDecodeURIParseError ("13%");
+checkDecodeURIParseError ("%0g");
+checkDecodeURIParseError ("%1G");
+checkDecodeURIParseError ("%a");
+checkDecodeURIParseError ("%c1%81");
+checkDecodeURIParseError ("a%80b");
+checkDecodeURIParseError ("%f4%90%80%80");
+checkDecodeURIParseError ("%ed%a0%80");
+checkDecodeURIParseError ("%ed%b0%80");
+checkDecodeURIParseError ("%fa%81%82%83%84");
+checkDecodeURIParseError ("%fd%81%82%83%84%85");
+
+// Coerce (automatic toString()) tests
+
+assert (decodeURI ([1, 2, 3]) === "1,2,3");
+assert (decodeURI ({ x:1 }) === "[object Object]");
+assert (encodeURI (void 0) === "undefined");
+assert (encodeURI (216.000e1) === "2160");
+
+// Combining surrogate fragments
+
+assert (decodeURI("\ud800\udc00 \ud800 \udc00") === "\ud800\udc00 \ud800 \udc00");
+assert (decodeURI("%f0%90%80%80") === "\ud800\udc00");
+assert (decodeURI("\ud800%f0%90%80%80\ud800") === "\ud800\ud800\udc00\ud800");
+assert (decodeURI("\udc00%f0%90%80%80\udc00") === "\udc00\ud800\udc00\udc00");
+
+checkDecodeURIParseError ("\ud800%ed%b0%80");
+checkDecodeURIParseError ("%ed%a0%80\udc00");
diff --git a/deps/jerry/tests/jerry/global.js b/deps/jerry/tests/jerry/global.js
new file mode 100644 (file)
index 0000000..d369e30
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+
+assert (this.hasOwnProperty !== undefined);
diff --git a/deps/jerry/tests/jerry/hash.js b/deps/jerry/tests/jerry/hash.js
new file mode 100644 (file)
index 0000000..0eea13a
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+a = {};
+a['12345']=1;
+a['13345']=3;
+a['sss45']=4;
+a['1'] = 2;
+
+assert (a[12345] === 1);
+assert (a[1] === 2);
+assert (a[13345] === 3);
+assert (a['sss45'] === 4);
diff --git a/deps/jerry/tests/jerry/if-else.js b/deps/jerry/tests/jerry/if-else.js
new file mode 100644 (file)
index 0000000..8499a7c
--- /dev/null
@@ -0,0 +1,35 @@
+// 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.
+
+var was_then = false, was_else = false;
+
+if (true) {
+  was_then = true;
+} else {
+  was_else = true;
+}
+
+assert (was_then && !was_else);
+
+was_then = false;
+was_else = false;
+
+if (false) {
+  was_then = true;
+} else {
+  was_else = true;
+}
+
+assert (was_else && !was_then);
+
diff --git a/deps/jerry/tests/jerry/insert-semicolon.js b/deps/jerry/tests/jerry/insert-semicolon.js
new file mode 100644 (file)
index 0000000..32fe83d
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+var f = new Function ('return a');
diff --git a/deps/jerry/tests/jerry/json-parse.js b/deps/jerry/tests/jerry/json-parse.js
new file mode 100644 (file)
index 0000000..6b4986d
--- /dev/null
@@ -0,0 +1,373 @@
+// 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.
+
+// This test will not pass on FLOAT32 due to precision issues
+
+// Checking primitve types
+var str;
+var result;
+var log;
+
+function check_parse_error (str)
+{
+  try {
+    JSON.parse (str);
+    // Should throw a parse error.
+    assert (false);
+  } catch (e) {
+  }
+}
+
+str = ' null ';
+assert (JSON.parse (str) === null);
+str = 'true';
+assert (JSON.parse (str) === true);
+str = 'false';
+assert (JSON.parse (str) === false);
+str = '-32.5e002';
+assert (JSON.parse (str) == -3250);
+str = '"str"';
+assert (JSON.parse (str) == "str");
+str = '"\\b\\f\\n\\t\\r"'
+assert (JSON.parse (str) === "\b\f\n\t\r");
+/* Note: \u is parsed by the lexer, \\u is by the JSON parser. */
+str = '"\\u0000\\u001f"';
+assert (JSON.parse (str) === "\x00\x1f");
+str = '"\\ud801\\udc00\\ud801\udc00\ud801\\udc00\ud801\udc00"';
+assert (JSON.parse (str) === "\ud801\udc00\ud801\udc00\ud801\udc00\ud801\udc00");
+/* These surrogates do not form a valid surrogate pairs. */
+str = '"\\ud801,\\udc00,\\ud801,\udc00,\ud801,\\udc00,\ud801,\udc00"';
+assert (JSON.parse (str) === "\ud801,\udc00,\ud801,\udc00,\ud801,\udc00,\ud801,\udc00");
+
+check_parse_error ('undefined');
+check_parse_error ('falses');
+check_parse_error ('+5');
+check_parse_error ('5.');
+check_parse_error ('01');
+check_parse_error ('0x1');
+check_parse_error ('0e-');
+check_parse_error ('3e+a');
+check_parse_error ('55e4,');
+check_parse_error ('5 true');
+check_parse_error ("'str'");
+check_parse_error ('\x00');
+check_parse_error ('"\x00"');
+check_parse_error ('"\x1f"');
+
+// Checking objects
+str = ' { "x": 0, "yy": null, "zzz": { "A": 4.0, "BB": { "1": 63e-1 }, "CCC" : false } } ';
+result = JSON.parse (str);
+assert (typeof result == "object");
+assert (result.x === 0);
+assert (result.yy === null);
+assert (typeof result.zzz == "object");
+assert (result.zzz.A === 4);
+assert (typeof result.zzz.BB == "object");
+assert (result.zzz.BB["1"] === 6.3);
+assert (result.zzz.CCC === false);
+
+check_parse_error ('{');
+check_parse_error ('{{{}');
+check_parse_error ('{x:5}');
+check_parse_error ('{true:4}');
+check_parse_error ('{"x":5 "y":6}');
+check_parse_error ('{"x":5,"y":6,}');
+check_parse_error ('{"x":5,,"y":6}');
+
+// Checking arrays
+str = '[{"x":[]},[[]],{}, [ null ] ]';
+result = JSON.parse (str);
+assert (result.length === 4);
+assert (typeof result === "object");
+assert (typeof result[0] === "object");
+assert (typeof result[0].x === "object");
+assert (result[0].x.length === 0);
+assert (result[1].length === 1);
+assert (result[1][0].length === 0);
+assert (typeof result[2] === "object");
+assert (result[3].length === 1);
+assert (result[3][0] === null);
+
+check_parse_error ('[');
+check_parse_error ('[[[]');
+check_parse_error ('[ true null ]');
+check_parse_error ('[1,,2]');
+check_parse_error ('[1,2,]');
+check_parse_error ('[1] [2]');
+
+// Checking parse with different primitive types
+
+assert (JSON.parse (null) == null);
+assert (JSON.parse (true) == true);
+assert (JSON.parse (3) == 3);
+
+try {
+  JSON.parse (undefined);
+  // Should not be reached.
+  assert (false);
+} catch (e) {
+  assert (e instanceof SyntaxError);
+}
+
+// Checking parse with different object types
+
+object = { toString: function() { return false; } };
+assert (JSON.parse (object) == false);
+
+object = {"a": 3, "b": "foo"};
+try {
+  JSON.parse (object);
+  // Should not be reached.
+  assert (false);
+} catch (e) {
+  assert (e instanceof SyntaxError);
+}
+
+array = [3, "foo"];
+try {
+  JSON.parse (array);
+  // Should not be reached.
+  assert (false);
+} catch (e) {
+  assert (e instanceof SyntaxError);
+}
+
+assert (JSON.parse (new Number (3)) == 3);
+assert (JSON.parse (new Boolean (true)) == true);
+
+object = new String ('{"a": 3, "b": "foo"}');
+result = JSON.parse (object);
+
+assert (result.a == 3);
+assert (result.b == "foo");
+
+// Checking reviver
+
+function toStringReviver(k, v)
+{
+  log += "<" + k + ">:" + (typeof v == "number" ? v : "(obj)") + ", ";
+  return v;
+}
+
+str = '{ "a":1, "b":2, "c": { "d":4, "e": { "f":6 } } }';
+log = "";
+JSON.parse (str, toStringReviver);
+assert (log === "<a>:1, <b>:2, <d>:4, <f>:6, <e>:(obj), <c>:(obj), <>:(obj), ");
+
+str = '[ 32, 47, 33 ]';
+log = "";
+JSON.parse (str, toStringReviver);
+assert (log === "<0>:32, <1>:47, <2>:33, <>:(obj), ");
+
+// Defining properties multiple times
+
+str = ' { "a":1, "b":2, "a":3 } ';
+log = "";
+JSON.parse (str, toStringReviver);
+assert (log === "<a>:3, <b>:2, <>:(obj), ");
+
+str = ' { "a":1, "b":2, "b":3 } ';
+log = "";
+JSON.parse (str, toStringReviver);
+assert (log === "<a>:1, <b>:3, <>:(obj), ");
+
+str = ' { "a":1, "b":{}, "b":[], "a":2, "b":3, "c":4 } ';
+log = "";
+JSON.parse (str, toStringReviver);
+assert (log === "<a>:2, <b>:3, <c>:4, <>:(obj), ");
+
+// Changing property value
+
+str = ' { "a":1, "b":2, "c":3 } ';
+result = JSON.parse (str, function (k, v) {
+  if (k == "a")
+  {
+    return 8;
+  }
+  if (k == "b")
+  {
+    return 9;
+  }
+  if (k == "c")
+  {
+    return void 0;
+  }
+  return v;
+});
+
+assert (result.a === 8);
+assert (result.b === 9);
+assert (result.c === void 0);
+
+// Adding / deleting properties
+
+str = ' { "a":1, "b":2 } ';
+log = "";
+result = JSON.parse (str, function (k, v) {
+  if (k == "a")
+  {
+    // Deleted properties must still be enumerated.
+    delete this["b"];
+    // New properties must not be enumerated.
+    this.c = 4;
+  }
+  if (k != "")
+  {
+    log += "<" + k + ">:" + v + " ";
+  }
+  return v;
+});
+
+assert (log === "<a>:1 <b>:undefined ");
+assert (result.a === 1);
+assert (result.b === void 0);
+assert (result.c === 4);
+
+// Changing properties to accessors
+
+str = ' { "a":1, "b":2, "c":3 } ';
+log = "";
+JSON.parse (str, function (k, v) {
+  if (k == "a")
+  {
+    Object.defineProperty(this, "b", {
+      enumerable: true,
+      configurable: true,
+      get: function() { return 12; }
+    });
+    Object.defineProperty(this, "c", {
+      enumerable: true,
+      configurable: true,
+      set: function(val) { }
+    });
+  }
+  if (k != "")
+  {
+    log += "<" + k + ">:" + v + " ";
+  }
+  return v;
+});
+assert (log === "<a>:1 <b>:12 <c>:undefined ");
+
+// Forcing extra walk steps
+
+str = ' { "a":1, "b":2 } ';
+log = "";
+JSON.parse (str, function (k, v) {
+  if (k == "a")
+  {
+     this.b = { x:3, y:4 };
+  }
+  if (k != "")
+  {
+    log += "<" + k + ">:" + v + " ";
+  }
+  return v;
+});
+assert (log === "<a>:1 <x>:3 <y>:4 <b>:[object Object] ");
+
+// Setting a property to read-only, and change its value.
+
+str = ' { "a":1, "b":2 } ';
+result = JSON.parse (str, function (k, v) {
+  if (k == "a")
+  {
+    Object.defineProperty(this, "b", {
+      enumerable: true,
+      // FIXME: Should work with configurable: true.
+      configurable: false,
+      writable: false,
+      value: 2
+    });
+    return 8;
+  }
+  if (k == "b")
+  {
+    return 9;
+  }
+  return v;
+});
+
+assert (result.a === 8);
+assert (result.b === 2);
+
+// Throw error in the reviver
+
+try {
+  str = ' { "a":1, "b":2 } ';
+  result = JSON.parse (str, function (k, v) { throw new ReferenceError("error"); } );
+  assert(false);
+} catch (e) {
+  assert (e.message === "error");
+  assert (e instanceof ReferenceError);
+}
+
+// Throw error in a getter
+
+try {
+  str = ' { "a":1, "b":2 } ';
+  JSON.parse (str, function (k, v) {
+    if (k == "a")
+    {
+      Object.defineProperty(this, "b", {
+        enumerable: true,
+        configurable: true,
+        get: function() { throw new ReferenceError("error"); }
+      });
+    }
+    return v;
+  });
+  assert(false);
+} catch (e) {
+  assert (e.message === "error");
+  assert (e instanceof ReferenceError);
+}
+
+// Checking reviver with different primitive types
+
+str = ' { "a":1 } ';
+
+result = JSON.parse (str, 4);
+assert (result.a == 1);
+
+result = JSON.parse (str, null);
+assert (result.a == 1);
+
+result = JSON.parse (str, undefined);
+assert (result.a == 1);
+
+result = JSON.parse (str, true);
+assert (result.a == 1);
+
+result = JSON.parse (str, "foo");
+assert (result.a == 1);
+
+// Checking reviver with different object types
+
+str = ' { "a":1 } ';
+
+result = JSON.parse(str, new Boolean (true));
+assert (result.a == 1);
+
+result = JSON.parse(str, new String ("foo"));
+assert (result.a == 1);
+
+result = JSON.parse(str, new Number (3));
+assert (result.a == 1);
+
+result = JSON.parse(str, {"a": 2});
+assert (result.a == 1);
+
+result = JSON.parse(str, [1, 2, 3]);
+assert (result.a == 1);
diff --git a/deps/jerry/tests/jerry/json-stringify.js b/deps/jerry/tests/jerry/json-stringify.js
new file mode 100644 (file)
index 0000000..1ca260f
--- /dev/null
@@ -0,0 +1,214 @@
+// 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.
+
+// Checking quoting strings
+assert (JSON.stringify ("") === '""');
+
+normal_string = "asdasd";
+assert (JSON.stringify (normal_string) == '"asdasd"');
+
+format_characters = "\ba\fs\nd\ra\tsd";
+assert (JSON.stringify (format_characters) == '"\\ba\\fs\\nd\\ra\\tsd"');
+
+ctl_string = "asd\1fasd";
+assert (JSON.stringify (ctl_string) == '"asd\\u001fasd"');
+
+escpad_string = "\"asda\sd";
+assert (JSON.stringify (escpad_string) == '"\\"asdasd"');
+
+assert (JSON.stringify('\u2040') == '"⁀"');
+assert (JSON.stringify('abc\u2040\u2030cba') == '"abc⁀‰cba"');
+
+// Checking primitive types
+assert (JSON.stringify (1) === '1');
+assert (JSON.stringify (true) === 'true');
+assert (JSON.stringify ("foo") === '"foo"');
+assert (JSON.stringify (null) === 'null');
+assert (JSON.stringify (undefined) === undefined);
+
+assert (JSON.stringify (new Number(1)) === '1');
+assert (JSON.stringify (new Boolean(true)) === 'true');
+assert (JSON.stringify (new String("foo")) === '"foo"');
+
+// Checking objects
+empty_object = {}
+assert (JSON.stringify (empty_object) == '{}');
+
+empty_object = {};
+empty_object.a = undefined;
+
+assert (JSON.stringify (empty_object) == '{}');
+
+p_object = { "a": 1, "b": true, "c": "foo", "d": null, "e": undefined };
+assert (JSON.stringify (p_object) == '{"a":1,"b":true,"c":"foo","d":null}');
+
+o_object = { "a": new Number(1), "b": new Boolean(true), "c": new String("foo") };
+assert (JSON.stringify (o_object) == '{"a":1,"b":true,"c":"foo"}');
+
+child = { "a": 1, "b": new String("\nfoo"), "c": undefined };
+parent = { "a": true, "b": child, "c": null};
+
+assert (JSON.stringify (parent) == '{"a":true,"b":{"a":1,"b":"\\nfoo"},"c":null}');
+
+recursive_object = {};
+recursive_object.a = 2;
+recursive_object.b = recursive_object;
+
+try {
+  JSON.stringify (recursive_object)
+  // Should not be reached.
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+// Checking arrays
+empty_array = [];
+assert (JSON.stringify (empty_array) == '[]');
+
+array = [undefined];
+assert (JSON.stringify (array) == '[null]');
+
+p_array = [1, true, "foo", null, undefined];
+assert (JSON.stringify (p_array) == '[1,true,"foo",null,null]');
+
+o_array = [new Number(1), new Boolean(true), new String("foo")];
+assert (JSON.stringify (o_array) == '[1,true,"foo"]');
+
+child = [ 1, new String("\nfoo"), undefined ];
+parent = [ true, child, null ];
+
+assert (JSON.stringify (parent) == '[true,[1,"\\nfoo",null],null]');
+
+recursive_array = [];
+recursive_array[0] = 2;
+recursive_array[1] = recursive_array;
+
+try {
+  JSON.stringify (recursive_array)
+  // Should not be reached.
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+object = {"a": 1, "b": [1, true, {"a": "foo"}]};
+assert (JSON.stringify (object) == '{"a":1,"b":[1,true,{"a":"foo"}]}');
+
+object = {"a": [1], "b": {}};
+assert (JSON.stringify(object) === '{"a":[1],"b":{}}');
+
+array = [1, {"a": 2, "b": true, c: [3]}];
+assert (JSON.stringify (array) == '[1,{"a":2,"b":true,"c":[3]}]');
+
+// Filtering / replacing
+to_json_object = {};
+to_json_object.a = 2;
+to_json_object.toJSON = function (key) { return 3; };
+
+assert (JSON.stringify (to_json_object) === "3");
+
+function replacer_function (key, value)
+{
+  if (typeof(value) == "string")
+    return "FOO";
+  return value;
+}
+
+object = { "a": "JSON", "b": new String("JSON"), "c": 3 };
+assert (JSON.stringify (object, replacer_function) == '{"a":"FOO","b":"JSON","c":3}');
+
+filter = ["a", "b"];
+assert (JSON.stringify (object, filter) == '{"a":"JSON","b":"JSON"}');
+
+assert (JSON.stringify ([], [ 'foo', 'foo' ]) === '[]');
+
+number = new Number(2.2);
+number.toString = {};
+number.valueOf = [];
+
+try
+{
+  JSON.stringify([], [number]);
+  // Should not be reached.
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+// Throw error in the replacer function
+function replacer_thrower (key, value)
+{
+  throw new ReferenceError("foo");
+  return value;
+}
+
+try {
+  JSON.stringify (object, replacer_thrower)
+  // Should not be reached.
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+// Checking replacer with different primitive types
+object = { "a": 2 };
+assert (JSON.stringify (object, 3) == '{"a":2}');
+assert (JSON.stringify (object, true) == '{"a":2}');
+assert (JSON.stringify (object, null) == '{"a":2}');
+assert (JSON.stringify (object, undefined) == '{"a":2}');
+assert (JSON.stringify (object, "foo") == '{"a":2}');
+
+// Checking replacer with different primitive types
+assert (JSON.stringify (object, new Boolean (true)) == '{"a":2}');
+assert (JSON.stringify (object, new Number (3)) == '{"a":2}');
+assert (JSON.stringify (object, new String ("foo")) == '{"a":2}');
+assert (JSON.stringify (object, { "a": 3 }) == '{"a":2}');
+
+// Checking JSON formatting
+object = {"a": 2};
+assert (JSON.stringify (object, null, "   ") == '{\n   "a": 2\n}');
+assert (JSON.stringify (object, null, "asd") == '{\nasd"a": 2\n}');
+assert (JSON.stringify (object, null, "asd0123456789") == '{\nasd0123456"a": 2\n}');
+assert (JSON.stringify (object, null, "asd\u20400123456789") == '{\nasd⁀012345"a": 2\n}');
+assert (JSON.stringify (object, null, 100) == '{\n          "a": 2\n}');
+assert (JSON.stringify (object, null, -5) == '{"a":2}');
+
+array = [2];
+assert (JSON.stringify (array, null, "   ") == '[\n   2\n]');
+assert (JSON.stringify (array, null, "asd") == '[\nasd2\n]');
+assert (JSON.stringify (array, null, "asd0123456789") == '[\nasd01234562\n]');
+assert (JSON.stringify (array, null, "asd\u20400123456789") == '[\nasd⁀0123452\n]');
+assert (JSON.stringify (array, null, 100) == '[\n          2\n]');
+assert (JSON.stringify (array, null, -5) == '[2]');
+
+nested_object = {"a": 2, "b": {"c": 1, "d": true}};
+assert (JSON.stringify (nested_object, null, 2) == '{\n  "a": 2,\n  "b": {\n    "c": 1,\n    "d": true\n  }\n}');
+
+nested_array = [2, [1,true]];
+assert (JSON.stringify (nested_array, null, 2) == '[\n  2,\n  [\n    1,\n    true\n  ]\n]');
+
+// Checking space (formatting parameter) with different primititve types
+object = { "a": 2 };
+assert (JSON.stringify (object, null, true) == '{"a":2}');
+assert (JSON.stringify (object, null, null) == '{"a":2}');
+assert (JSON.stringify (object, null, undefined) == '{"a":2}');
+
+// Checking space (formatting parameter) with different object types
+assert (JSON.stringify (object, null, new Boolean (true)) == '{"a":2}');
+assert (JSON.stringify (object, null, [1, 2, 3] ) == '{"a":2}');
+assert (JSON.stringify (object, null, { "a": 3 }) == '{"a":2}');
diff --git a/deps/jerry/tests/jerry/labelled-statements.js b/deps/jerry/tests/jerry/labelled-statements.js
new file mode 100644 (file)
index 0000000..600332f
--- /dev/null
@@ -0,0 +1,320 @@
+// 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.
+
+/* 1 */
+
+a: a = 1;
+
+str = '';
+
+a: for (j = 0; j < 10; j++)
+{
+  str += 'A';
+
+  b: for (i = 0; i < 10; i++)
+  {
+    str += 'B';
+
+    break a;
+
+    str += 'C';
+  }
+
+  str += 'D';
+}
+
+assert (str === 'AB');
+
+/* 2 */
+str = '';
+
+a: for (j = 0; j < 5; j++)
+{
+  str += 'A';
+
+  b: for (i = 0; i < 5; i++)
+  {
+    str += 'B';
+
+    switch (1)
+    {
+      case 1:
+        continue b;
+      default:
+        break b;
+    }
+
+    str += 'C';
+  }
+
+  str += 'D';
+}
+
+assert (str === 'ABBBBBDABBBBBDABBBBBDABBBBBDABBBBBD');
+
+/* 3 */
+str = '';
+
+a: for (j = 0; j < 5; j++)
+{
+  str += 'A';
+
+  b: for (i = 0; i < 5; i++)
+  {
+    str += 'B';
+
+    switch (1)
+    {
+      case 1:
+        continue a;
+    }
+
+    str += 'C';
+  }
+
+  str += 'D';
+}
+
+assert (str === 'ABABABABAB');
+
+/* 4 */
+str = '';
+
+a: for (j = 0; j < 5; j++)
+{
+  str += 'A';
+
+  b: for (i = 0; i < 5; i++)
+  {
+    str += 'B';
+
+    switch (1)
+    {
+      case 1:
+        break b;
+    }
+
+    str += 'C';
+  }
+
+  str += 'D';
+}
+
+assert (str === 'ABDABDABDABDABD');
+
+/* 5 */
+str = '';
+
+a: for (j = 0; j < 5; j++)
+{
+  str += 'A';
+
+  b: for (i = 0; i < 5; i++)
+  {
+    str += 'B';
+
+    switch (1)
+    {
+      case 1:
+        break a;
+    }
+
+    str += 'C';
+  }
+
+  str += 'D';
+}
+
+assert (str === 'AB');
+
+
+/* 6 */
+str = '';
+
+a: for (j = 0; j < 5; j++)
+{
+  str += 'A';
+
+  b: for (i = 0; i < 5; i++)
+  {
+    str += 'B';
+
+    with ({})
+    {
+      break b;
+    }
+
+    str += 'C';
+  }
+
+  str += 'D';
+}
+
+assert (str === 'ABDABDABDABDABD');
+
+/* 7 */
+str = '';
+
+a: for (j = 0; j < 5; j++)
+{
+  c:
+  {
+    str += 'A';
+
+    b: for (i = 0; i < 5; i++)
+    {
+      str += 'B';
+
+      with ({})
+      {
+        break c;
+      }
+
+      str += 'C';
+    }
+
+    str += 'D';
+  }
+}
+
+assert (str === 'ABABABABAB');
+
+/* 8 */
+
+a: {
+ function f ()
+ {
+      str = '';
+
+   a: for (i = 0; i < 5; i++)
+      {
+        str += 'A';
+
+        for (j = 0; j < 5; j++)
+        {
+          str += 'B';
+
+          continue a;
+
+          str += 'C';
+        }
+        str += 'D';
+      }
+
+    assert (str === 'ABABABABAB');
+ }
+}
+
+f ();
+
+/* 9 */
+
+str = '';
+
+for (i = 0; i < 5; i++)
+{
+  str += 'A';
+
+  switch (i)
+  {
+    case 0:
+    {
+      str += '0';
+      break;
+    }
+    case 1:
+    {
+      str += '1';
+      break;
+    }
+    case 2:
+    {
+      str += '2';
+      break;
+    }
+    case 3:
+    {
+      str += '3';
+      break;
+    }
+    case 4:
+    {
+      str += '4';
+      break;
+    }
+  }
+
+  str += 'B';
+}
+
+assert (str === 'A0BA1BA2BA3BA4B');
+
+/* 10 */
+
+str = '';
+
+for (i = 0; i < 2; i++)
+{
+  str += '[A]';
+
+  a:
+  for (j = 0; j < 5; j++)
+  {
+    str += '[B]';
+
+    switch (j)
+    {
+      case 0:
+      {
+        str += '[0]';
+        break;
+      }
+      case 1:
+      {
+        str += '[1]';
+        if (i % 2 == 0)
+        {
+          str += '[1.1]';
+          break a;
+        }
+        else
+        {
+          str += '[1.2]';
+        }
+      }
+      case 2:
+      {
+        str += '[2]';
+        continue a;
+      }
+      case 3:
+      {
+        str += '[3]';
+        break;
+      }
+      case 4:
+      {
+        str += '[4]';
+        continue a;
+      }
+    }
+
+    str += '[C]';
+  }
+
+  str += '[D]';
+}
+
+assert (str === '[A][B][0][C][B][1][1.1][D]' +
+                '[A][B][0][C][B][1][1.2][2][B][2][B][3][C][B][4][D]');
diff --git a/deps/jerry/tests/jerry/logical.js b/deps/jerry/tests/jerry/logical.js
new file mode 100644 (file)
index 0000000..53353f1
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+assert((!false) === true);
+
+assert((true || true) === true);
+assert((false || true) === true);
+assert((false || false) === false);
+assert((true || false) === true);
+
+assert((true && true) === true);
+assert((true && false) === false);
+assert((false && true) === false);
+assert((false && false) === false);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry/math-abs.js b/deps/jerry/tests/jerry/math-abs.js
new file mode 100644 (file)
index 0000000..d1023b2
--- /dev/null
@@ -0,0 +1,37 @@
+// 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.
+
+var nan = NaN;
+var p_zero = 0.0;
+var m_zero = -p_zero;
+var p_inf = Infinity;
+var m_inf = -p_inf;
+
+assert (isNaN(Math['abs'](NaN)));
+assert (Math['abs'](p_zero) === p_zero);
+assert (Math['abs'](m_zero) === p_zero);
+assert (Math['abs'](p_inf) === p_inf);
+assert (Math['abs'](m_inf) === p_inf);
+
+assert (Math['abs'](0.5) === 0.5);
+assert (Math['abs'](-0.5) === 0.5);
+assert (Math['abs'](1.2) === 1.2);
+assert (Math['abs'](1.5) === 1.5);
+assert (Math['abs'](0.7) === 0.7);
+assert (Math['abs'](0.2) === 0.2);
+assert (Math['abs'](-0.2) === 0.2);
+assert (Math['abs'](-0.7) === 0.7);
+assert (Math['abs'](-1.2) === 1.2);
+assert (Math['abs'](-1.7) === 1.7);
+assert (Math['abs'](-1.5) === 1.5);
diff --git a/deps/jerry/tests/jerry/math-exp.js b/deps/jerry/tests/jerry/math-exp.js
new file mode 100644 (file)
index 0000000..1cca991
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+assert(isNaN(Math['exp'] (NaN)));
+assert(Math['exp'] (0.0) === 1.0);
+assert(Math['exp'] (Infinity) === Infinity);
+assert(Math['exp'] (-Infinity) === 0.0);
+
+assert(Math['exp'] (1) >= 0.999999 * Math['E']);
+assert(Math['exp'] (1) <= 1.000001 * Math['E']);
+
+assert(Math['exp'] (-1) >= 0.999999 * (1 / Math['E']));
+assert(Math['exp'] (-1) <= 1.000001 * (1 / Math['E']));
+
+assert(Math['exp'] (0.5) >= 0.999999 * 1.6487212707);
+assert(Math['exp'] (0.5) <= 1.000001 * 1.6487212707);
+
+assert(Math['exp'] (30) >= 0.999999 * 1.06864745815e+13);
+assert(Math['exp'] (30) <= 1.000001 * 1.06864745815e+13);
diff --git a/deps/jerry/tests/jerry/math-log.js b/deps/jerry/tests/jerry/math-log.js
new file mode 100644 (file)
index 0000000..ac4ef50
--- /dev/null
@@ -0,0 +1,44 @@
+// 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.
+
+assert( isNaN (Math.log(NaN)) );
+assert( isNaN (Math.log (-1)) );
+assert( isNaN (Math.log (-Infinity)) );
+
+assert( Math.log (0) === -Infinity );
+assert( Math.log (1) === 0 );
+assert( Math.log (Infinity) === Infinity );
+assert( Math.log (2) >= Math.LN2 * 0.999999 );
+assert( Math.log (2) <= Math.LN2 * 1.000001 );
+
+var very_close_to_1_but_greater = 1.0000001;
+assert( very_close_to_1_but_greater > 1.0 );
+
+assert( Math.log (very_close_to_1_but_greater) >= 0.0 );
+assert( Math.log (very_close_to_1_but_greater) <= 0.000001 );
+
+var very_close_to_1_but_less = 0.999999;
+assert( very_close_to_1_but_less < 1.0 );
+
+assert( Math.log (very_close_to_1_but_less) <= 0.0 );
+assert( Math.log (very_close_to_1_but_less) >= -0.00001 );
+
+assert( Math.log (2.7182818284590452354) >= 0.999999 );
+assert( Math.log (2.7182818284590452354) <= 1.000001 );
+
+assert( Math.log (0.000000001) <= 0.999999 * (-20.7232658369) );
+assert( Math.log (0.000000001) >= 1.000001 * (-20.7232658369) );
+
+assert( Math.log (1.0e+38) >= 0.999999 * 87.4982335338 );
+assert( Math.log (1.0e+38) <= 1.000001 * 87.4982335338 );
diff --git a/deps/jerry/tests/jerry/math-max.js b/deps/jerry/tests/jerry/math-max.js
new file mode 100644 (file)
index 0000000..7ad9373
--- /dev/null
@@ -0,0 +1,39 @@
+// 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.
+
+assert(isNaN (Math['max'] (1.0, NaN)));
+assert(isNaN (Math['max'] (NaN, 1.0)));
+assert(isNaN (Math['max'] (Infinity, NaN)));
+assert(isNaN (Math['max'] (NaN, Infinity)));
+assert(Math['max'] (1.0, 3.0, 0.0) === 3.0);
+assert(Math['max'] (1.0, 3.0, Infinity) === Infinity);
+assert(Math['max'] (1.0, 3.0, -Infinity) === 3.0);
+assert(Math['max'] (-Infinity, Infinity) === Infinity);
+assert(Math['max'] (Infinity, -Infinity) === Infinity);
+assert(Math['max'] (Infinity, Infinity) === Infinity);
+assert(Math['max'] (-Infinity, -Infinity) === -Infinity);
+assert(Math['max'] () === -Infinity);
+
+assert(Math['max'] (0.0, -0.0) === 0.0);
+assert(Math['max'] (-0.0, 0.0) === 0.0);
+
+assert(Math['max'] (2, Infinity) === Infinity);
+assert(Math['max'] (Infinity, 2) === Infinity);
+assert(Math['max'] (2, -Infinity) === 2);
+assert(Math['max'] (-Infinity, 2) === 2);
+
+assert(Math['max'] (-2, Infinity) === Infinity);
+assert(Math['max'] (Infinity, -2) === Infinity);
+assert(Math['max'] (-2, -Infinity) === -2);
+assert(Math['max'] (-Infinity, -2) === -2);
diff --git a/deps/jerry/tests/jerry/math-min.js b/deps/jerry/tests/jerry/math-min.js
new file mode 100644 (file)
index 0000000..ffbf47d
--- /dev/null
@@ -0,0 +1,39 @@
+// 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.
+
+assert(isNaN (Math['min'] (1.0, NaN)));
+assert(isNaN (Math['min'] (NaN, 1.0)));
+assert(isNaN (Math['min'] (-Infinity, NaN)));
+assert(isNaN (Math['min'] (NaN, -Infinity)));
+assert(Math['min'] (1.0, 3.0, 0.0) === 0.0);
+assert(Math['min'] (1.0, 3.0, Infinity) === 1.0);
+assert(Math['min'] (1.0, 3.0, -Infinity) === -Infinity);
+assert(Math['min'] (-Infinity, Infinity) === -Infinity);
+assert(Math['min'] (Infinity, -Infinity) === -Infinity);
+assert(Math['min'] (Infinity, Infinity) === Infinity);
+assert(Math['min'] (-Infinity, -Infinity) === -Infinity);
+assert(Math['min'] () === Infinity);
+
+assert(Math['min'] (0.0, -0.0) === -0.0);
+assert(Math['min'] (-0.0, 0.0) === -0.0);
+
+assert(Math['min'] (2, -Infinity) === -Infinity);
+assert(Math['min'] (-Infinity, 2) === -Infinity);
+assert(Math['min'] (2, Infinity) === 2);
+assert(Math['min'] (Infinity, 2) === 2);
+
+assert(Math['min'] (-2, Infinity) === -2);
+assert(Math['min'] (Infinity, -2) === -2);
+assert(Math['min'] (-2, -Infinity) === -Infinity);
+assert(Math['min'] (-Infinity, -2) === -Infinity);
diff --git a/deps/jerry/tests/jerry/math-pow.js b/deps/jerry/tests/jerry/math-pow.js
new file mode 100644 (file)
index 0000000..8bd449e
--- /dev/null
@@ -0,0 +1,50 @@
+// 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.
+
+assert ( isNaN (Math.pow (0.0 /* any number */, NaN)) );
+assert ( Math.pow (NaN, 0.0) === 1.0 );
+// assert ( Math.pow (NaN, -0.0) === 1.0 );
+assert ( isNaN (Math.pow (NaN, 1.0 /* any non-zero number */)) );
+assert ( Math.pow (2.0, Infinity) === Infinity );
+assert ( Math.pow (2.0, -Infinity) === 0.0 );
+assert ( isNaN (Math.pow (1.0, Infinity)) );
+assert ( isNaN (Math.pow (1.0, -Infinity)) );
+assert ( Math.pow (0.5, Infinity) === 0.0 );
+assert ( Math.pow (0.5, -Infinity) === Infinity );
+assert ( Math.pow (Infinity, 1.0) === Infinity );
+assert ( Math.pow (Infinity, -1.0) === 0 );
+assert ( Math.pow (-Infinity, 3.0) === -Infinity );
+assert ( Math.pow (-Infinity, 2.0) === Infinity );
+assert ( Math.pow (-Infinity, 2.5) === Infinity );
+// assert ( Math.pow (-Infinity, -3.0) === -0.0 );
+assert ( Math.pow (-Infinity, -2.0) === 0.0 );
+assert ( Math.pow (-Infinity, -2.5) === 0.0 );
+assert ( Math.pow (0.0, 1.2) === 0.0 );
+assert ( Math.pow (0.0, -1.2) === Infinity );
+// assert ( Math.pow (-0.0, 3.0) === -0.0 );
+// assert ( Math.pow (-0.0, 2.0) === 0.0 );
+// assert ( Math.pow (-0.0, 2.5) === 0.0 );
+// assert ( Math.pow (-0.0, -3.0) === -Infinity );
+// assert ( Math.pow (-0.0, -2.0) === Infinity );
+// assert ( Math.pow (-0.0, -2.5) === Infinity );
+assert ( isNaN (Math.pow (-3, 2.5)) );
+
+assert(Math.pow (-2, 2) === 4);
+assert(Math.pow (2, 2) === 4);
+
+assert(Math.pow (2, 3) === 8);
+assert(Math.pow (-2, 3) === -8);
+
+assert(Math.pow (5, 3) === 125);
+assert(Math.pow (-5, 3) === -125);
diff --git a/deps/jerry/tests/jerry/math-round.js b/deps/jerry/tests/jerry/math-round.js
new file mode 100644 (file)
index 0000000..36f1fdb
--- /dev/null
@@ -0,0 +1,37 @@
+// 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.
+
+var nan = NaN;
+var p_zero = 0.0;
+var m_zero = -p_zero;
+var p_inf = Infinity;
+var m_inf = -p_inf;
+
+assert (isNaN(Math['round'](NaN)));
+assert (Math['round'](p_zero) === p_zero);
+assert (Math['round'](m_zero) === m_zero);
+assert (Math['round'](p_inf) === p_inf);
+assert (Math['round'](m_inf) === m_inf);
+
+assert (Math['round'](0.5) === 1.0);
+assert (Math['round'](-0.5) === -0.0);
+assert (Math['round'](1.2) === 1.0);
+assert (Math['round'](1.5) === 2.0);
+assert (Math['round'](0.7) === 1.0);
+assert (Math['round'](0.2) === 0.0);
+assert (Math['round'](-0.2) === -0.0);
+assert (Math['round'](-0.7) === -1.0);
+assert (Math['round'](-1.2) === -1.0);
+assert (Math['round'](-1.7) === -2.0);
+assert (Math['round'](-1.5) === -1.0);
diff --git a/deps/jerry/tests/jerry/math-trig.js b/deps/jerry/tests/jerry/math-trig.js
new file mode 100644 (file)
index 0000000..b248c42
--- /dev/null
@@ -0,0 +1,71 @@
+// 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.
+
+var delta = 0.0001;
+var mod_m = 1.0 - delta;
+var mod_p = 1.0 + delta;
+
+assert (isNaN (Math.cos (NaN)));
+assert ((Math.cos (+0.0)) == 1.0);
+assert ((Math.cos (-0.0)) == 1.0);
+assert (isNaN (Math.cos (Infinity)));
+assert (isNaN (Math.cos (-Infinity)));
+
+assert (Math.cos (Math.PI) > -1.0 * mod_p);
+assert (Math.cos (Math.PI) < -1.0 * mod_m);
+
+assert (Math.cos (Math.PI / 2) > -delta);
+assert (Math.cos (Math.PI / 2) < +delta);
+assert (Math.cos (-Math.PI / 2) > -delta);
+assert (Math.cos (-Math.PI / 2) < +delta);
+
+assert (Math.cos (Math.PI / 4) > mod_m * Math.SQRT2 / 2);
+assert (Math.cos (Math.PI / 4) < mod_p * Math.SQRT2 / 2);
+
+assert (Math.cos (-Math.PI / 4) > mod_m * Math.SQRT2 / 2);
+assert (Math.cos (-Math.PI / 4) < mod_p * Math.SQRT2 / 2);
+
+assert (isNaN (Math.sin (NaN)));
+assert (1.0 / Math.sin (0.0) == Infinity);
+assert (1.0 / Math.sin (-0.0) == -Infinity);
+assert (isNaN (Math.sin (Infinity)));
+assert (isNaN (Math.sin (-Infinity)));
+
+assert (Math.sin (Math.PI) > -delta);
+assert (Math.sin (Math.PI) < +delta);
+
+assert (Math.sin (Math.PI / 2) > 1.0 * mod_m);
+assert (Math.sin (Math.PI / 2) < 1.0 * mod_p);
+
+assert (Math.sin (-Math.PI / 2) > -1.0 * mod_p);
+assert (Math.sin (-Math.PI / 2) < -1.0 * mod_m);
+
+assert (Math.sin (Math.PI / 4) > mod_m * Math.SQRT2 / 2);
+assert (Math.sin (Math.PI / 4) < mod_p * Math.SQRT2 / 2);
+
+assert (Math.sin (-Math.PI / 4) > -mod_p * Math.SQRT2 / 2);
+assert (Math.sin (-Math.PI / 4) < -mod_m * Math.SQRT2 / 2);
+
+var step = 0.01;
+
+for (var x = -2 * Math.PI; x <= 2 * Math.PI; x += step)
+{
+  var s = Math.sin (x);
+  var c = Math.cos (x);
+  var sqr_s = s * s;
+  var sqr_c = c * c;
+
+  assert (sqr_s + sqr_c > mod_m);
+  assert (sqr_s + sqr_c < mod_p);
+}
diff --git a/deps/jerry/tests/jerry/nested-function.js b/deps/jerry/tests/jerry/nested-function.js
new file mode 100644 (file)
index 0000000..2706a24
--- /dev/null
@@ -0,0 +1,41 @@
+// 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.
+
+function f1()
+{
+  function f2()
+    {
+      assert(k > 0);
+      assert(i < 10000);
+
+      if(--k == 0)
+        {
+          return;
+        }
+
+      f2();
+    }
+
+  k = 17;
+
+  f2();
+}
+
+var k;
+var i;
+
+for(i = 0; i < 100; i++)
+{
+  f1();
+}
diff --git a/deps/jerry/tests/jerry/new-line-in-literal.js b/deps/jerry/tests/jerry/new-line-in-literal.js
new file mode 100644 (file)
index 0000000..a77a6f5
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+assert (eval ("'1\\\r\n2'") === '12');
+
+assert (eval ("'1\\\n2'") === '12');
diff --git a/deps/jerry/tests/jerry/number-prototype-to-exponential.js b/deps/jerry/tests/jerry/number-prototype-to-exponential.js
new file mode 100644 (file)
index 0000000..b0416d8
--- /dev/null
@@ -0,0 +1,71 @@
+// 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.
+
+//This test will not pass on FLOAT32 due to precision issues
+
+assert((123.56).toExponential() === "1.2356e+2");
+assert((123.56).toExponential(0) === "1e+2");
+assert((123.56).toExponential(1) === "1.2e+2");
+assert((123.56).toExponential(5) === "1.23560e+2");
+assert((-1.23).toExponential(1) === "-1.2e+0");
+assert((0.00023).toExponential(0) === "2e-4");
+assert((0.356).toExponential(1) === "3.6e-1");
+assert((0.0000356).toExponential(2) === "3.56e-5");
+assert((0.000030056).toExponential(2) === "3.01e-5");
+assert(Infinity.toExponential(0) === "Infinity");
+assert((-Infinity).toExponential(0) === "-Infinity");
+assert(NaN.toExponential(0) === "NaN");
+assert((0.0).toExponential(0) === "0e+0");
+assert((0.0).toExponential(1) === "0.0e+0");
+assert((-0.0).toExponential(0) === "0e+0");
+assert((-0.0).toExponential(1) === "0.0e+0");
+assert((123456789012345678901.0).toExponential(20) === "1.23456789012345680000e+20");
+assert((123456789012345678901.0).toExponential("6") === "1.234568e+20");
+assert((123.45).toExponential(3.2) === "1.235e+2");
+assert((123.45).toExponential(-0.1) === "1e+2");
+
+try {
+    (12).toExponential(Number.MAX_VALUE);
+    assert(false);
+} catch (e) {
+    assert(e instanceof RangeError)
+}
+
+try {
+    (12).toExponential(Infinity);
+    assert(false);
+} catch (e) {
+    assert(e instanceof RangeError)
+}
+
+try {
+    (12).toExponential(-1);
+    assert(false);
+} catch (e) {
+    assert(e instanceof RangeError)
+}
+
+try {
+    (12).toExponential(21);
+    assert(false);
+} catch (e) {
+    assert(e instanceof RangeError)
+}
+
+try {
+    Number.prototype.toExponential.call(new Object());
+    assert(false);
+} catch (e) {
+    assert(e instanceof TypeError)
+}
diff --git a/deps/jerry/tests/jerry/number-prototype-to-fixed.js b/deps/jerry/tests/jerry/number-prototype-to-fixed.js
new file mode 100644 (file)
index 0000000..ba693f0
--- /dev/null
@@ -0,0 +1,63 @@
+// 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.
+
+//This test will not pass on FLOAT32 due to precision issues
+
+assert((123.56).toFixed() === "124");
+assert((123.56).toFixed(0) === "124");
+assert((123.56).toFixed(1) === "123.6");
+assert((123.56).toFixed(5) === "123.56000");
+assert((1.23e-10).toFixed(2) === "0.00");
+assert((1.23e+20).toFixed(2) === "123000000000000000000.00");
+assert((1.23e+21).toFixed(2) === "1.23e+21");
+assert((-1.23).toFixed(1) === "-1.2");
+assert((0.00023).toFixed(0) === "0");
+assert((0.356).toFixed(2) === "0.36");
+assert((0.0000356).toFixed(5) === "0.00004");
+assert((0.000030056).toFixed(7) === "0.0000301");
+assert(Infinity.toFixed(0) === "Infinity");
+assert((-Infinity).toFixed(0) === "-Infinity");
+assert(NaN.toFixed(0) === "NaN");
+assert((0.0).toFixed(0) === "0");
+assert((0.0).toFixed(1) === "0.0");
+assert((-0.0).toFixed(0) === "-0");
+assert((-0.0).toFixed(1) === "-0.0");
+assert((123456789012345678901.0).toFixed(20) === "123456789012345680000.00000000000000000000");
+assert((123.56).toFixed(NaN) === "124");
+assert((123.56).toFixed(-0.9) === "124");
+assert((0.095).toFixed(2) === "0.10");
+//assert((0.995).toFixed(2) === "0.99");
+//assert((9.995).toFixed(2) === "9.99");
+assert((99.995).toFixed(2) === "100.00");
+
+try {
+    Number.prototype.toExponential.call(new Object());
+    assert(false);
+} catch (e) {
+    assert(e instanceof TypeError)
+}
+
+try {
+    (12).toFixed(-1);
+    assert(false);
+} catch (e) {
+    assert(e instanceof RangeError)
+}
+
+try {
+    (12).toFixed(21);
+    assert(false);
+} catch (e) {
+    assert(e instanceof RangeError)
+}
diff --git a/deps/jerry/tests/jerry/number-prototype-to-precision.js b/deps/jerry/tests/jerry/number-prototype-to-precision.js
new file mode 100644 (file)
index 0000000..10b7740
--- /dev/null
@@ -0,0 +1,63 @@
+// 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.
+
+//This test will not pass on FLOAT32 due to precision issues
+
+assert((123.56).toPrecision() === "123.56");
+assert((123.56).toPrecision(1) === "1e+2");
+assert((123.56).toPrecision(2) === "1.2e+2");
+assert((123.56).toPrecision(6) === "123.560");
+assert((-1.23).toPrecision(1) === "-1");
+assert((0.00023).toPrecision(1) === "0.0002");
+assert((0.356).toPrecision(2) === "0.36");
+assert((0.0000356).toPrecision(5) === "0.000035600");
+assert((0.000030056).toPrecision(4) === "0.00003006");
+assert(Infinity.toPrecision(1) === "Infinity");
+assert((-Infinity).toPrecision(1) === "-Infinity");
+assert(NaN.toPrecision(1) === "NaN");
+assert((0.0).toPrecision(1) === "0");
+assert((-0.0).toPrecision(1) === "0");
+assert((0.0).toPrecision(6) === "0.00000");
+assert((123456789012345678901.0).toPrecision(20) === "1.2345678901234568000e+20");
+assert((123456789012345678901.0).toPrecision(21) === "123456789012345680000");
+assert((123456789012345678901.0).toPrecision("6") === "1.23457e+20");
+
+assert((123.56).toPrecision(1.3) === "1e+2");
+assert((123.56).toPrecision(21.9) === "123.560000000000000000");
+
+assert(Number(982).toPrecision(1) === "1e+3");
+assert(Number(982).toPrecision(2) === "9.8e+2");
+assert(Number(1499).toPrecision(1) === "1e+3");
+assert(Number(1500).toPrecision(1) === "2e+3");
+
+try {
+    (12).toPrecision(0);
+    assert(false);
+} catch (e) {
+    assert(e instanceof RangeError)
+}
+
+try {
+    (12).toPrecision(22);
+    assert(false);
+} catch (e) {
+    assert(e instanceof RangeError)
+}
+
+try {
+    Number.prototype.toExponential.call(new Object());
+    assert(false);
+} catch (e) {
+    assert(e instanceof TypeError)
+}
diff --git a/deps/jerry/tests/jerry/number-prototype-to-string.js b/deps/jerry/tests/jerry/number-prototype-to-string.js
new file mode 100644 (file)
index 0000000..45acfb5
--- /dev/null
@@ -0,0 +1,132 @@
+// 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.
+
+// This test will not pass on FLOAT32 due to precision issues
+
+assert((NaN).toString() === "NaN");
+assert((-Infinity).toString() === "-Infinity");
+assert((Infinity).toString() === "Infinity");
+assert((NaN).toString(6) === "NaN");
+assert((-Infinity).toString(7) === "-Infinity");
+assert((Infinity).toString(8) === "Infinity");
+assert((16).toString(16) === "10");
+assert((15).toString(16) === "f");
+assert((12.5).toString(4) === "30.2");
+assert((0.005).toString(4) === "0.000110132232011013223201101323");
+assert((2000).toString(4) === "133100");
+assert((2000).toString(3) === "2202002");
+assert((2000).toString(16) === "7d0");
+assert((0.03125).toString(2) === "0.00001");
+assert((0.03125).toString(16) === "0.08");
+assert((0.0001).toString(4) === "0.000000122031232023223013010030231")
+assert((0).toString(16) === "0");
+assert((-16).toString(16) === "-10");
+assert((-15).toString(16) === "-f");
+assert((-12.5).toString(4) === "-30.2");
+assert((-0.005).toString(4) === "-0.000110132232011013223201101323");
+assert((-2000).toString(4) === "-133100");
+assert((-2000).toString(3) === "-2202002");
+assert((-2000).toString(16) === "-7d0");
+assert((-0.03125).toString(2) === "-0.00001");
+assert((-0.03125).toString(16) === "-0.08");
+assert((-0.0001).toString(4) === "-0.000000122031232023223013010030231")
+assert((-0).toString(16) === "0");
+assert((1e+73).toString(35) === "2nx1mg1l0w4ujlpt449c5qfrkkmtpgpsfsc2prlaqtnjbli2")
+assert((-1e+73).toString(35) === "-2nx1mg1l0w4ujlpt449c5qfrkkmtpgpsfsc2prlaqtnjbli2")
+assert((1).toString(undefined) === "1")
+
+assert((123400).toString(2) === "11110001000001000");
+assert((123400).toString(3) === "20021021101");
+assert((123400).toString(4) === "132020020");
+assert((123400).toString(5) === "12422100");
+assert((123400).toString(6) === "2351144");
+assert((123400).toString(7) === "1022524");
+assert((123400).toString(8) === "361010");
+assert((123400).toString(9) === "207241");
+assert((123400).toString(10) === "123400");
+assert((123400).toString(11) === "84792");
+assert((123400).toString(12) === "5b4b4");
+assert((123400).toString(13) === "44224");
+assert((123400).toString(14) === "32d84");
+assert((123400).toString(15) === "2686a");
+assert((123400).toString(16) === "1e208");
+assert((123400).toString(17) === "181ge");
+assert((123400).toString(18) === "132fa");
+assert((123400).toString(19) === "hife");
+assert((123400).toString(20) === "f8a0");
+assert((123400).toString(21) === "d6h4");
+assert((123400).toString(22) === "bcl2");
+assert((123400).toString(23) === "a365");
+assert((123400).toString(24) === "8m5g");
+assert((123400).toString(25) === "7mb0");
+assert((123400).toString(26) === "70e4");
+assert((123400).toString(27) === "677a");
+assert((123400).toString(28) === "5hb4");
+assert((123400).toString(29) === "51l5");
+assert((123400).toString(30) === "4h3a");
+assert((123400).toString(31) === "44ck");
+assert((123400).toString(32) === "3og8");
+assert((123400).toString(33) === "3ead");
+assert((123400).toString(34) === "34pe");
+assert((123400).toString(35) === "2upp");
+assert((123400).toString(36) === "2n7s");
+
+assert ((1152921504606846600).toString([1,2,3,4].slice(1,2)) === "111111111111111111111111111111111111111111111111111010000000");
+assert ((-1152921504606846600).toString(2) === "-111111111111111111111111111111111111111111111111111010000000");
+
+assert ((0x100000000000061).toString(2) === "100000000000000000000000000000000000000000000000001100000")
+assert ((-0x100000000000061).toString(16) === "-100000000000060");
+
+assert((123400).toString(new Number(16)) === "1e208");
+
+assert(65535.9.toString(3) === "10022220020.220022002200220022002210211012200000110221");
+
+var digit_chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+                   'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+                   'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
+                   'u', 'v', 'w', 'x', 'y', 'z'];
+
+for (radix = 2; radix <= 36; radix++) {
+  for (num = 1; num < 100; num++) {
+    var value = num;
+    var str = "";
+    while (value > 0) {
+      str = digit_chars[value % radix] + str;
+      value = Math.floor(value / radix);
+    }
+
+    assert(str === (num).toString(radix));
+  }
+}
+
+try {
+  assert((123).toString(1));
+  assert(false)
+} catch (e) {
+  assert(e instanceof RangeError);
+}
+
+try {
+  assert((123).toString(37));
+  assert(false)
+} catch (e) {
+  assert(e instanceof RangeError);
+}
+
+try {
+  assert((123).toString(Infinity));
+  assert(false)
+} catch (e) {
+  assert(e instanceof RangeError);
+}
diff --git a/deps/jerry/tests/jerry/object-create.js b/deps/jerry/tests/jerry/object-create.js
new file mode 100644 (file)
index 0000000..af2928d
--- /dev/null
@@ -0,0 +1,144 @@
+// 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.
+
+// Example where we create an object with a couple of sample properties.
+// (Note that the second parameter maps keys to *property descriptors*.)
+var o = Object.create(Object.prototype, {
+  // foo is a regular 'value property'
+  foo: { writable: true, configurable: true, value: 'hello' },
+  // bar is a getter-and-setter (accessor) property
+  bar: {
+    configurable: false,
+    get: function() { return 10; },
+    set: function(value) { console.log('Setting `o.bar` to', value); }
+  }
+});
+
+// create a new object whose prototype is a new, empty object
+// and a adding single property 'p', with value 42
+var o = Object.create({}, { p: { value: 42 } });
+// by default properties ARE NOT writable, enumerable or configurable:
+o.p = 24;
+assert (o.p === 42);
+
+// to specify an ES3 property
+var o2 = Object.create({}, {
+  p: {
+    value: 42,
+    writable: true,
+    enumerable: true,
+    configurable: true
+  }
+});
+
+assert (o2.p === 42);
+
+// Shape - superclass
+function Shape() {
+  this.x = 0;
+  this.y = 0;
+}
+
+// superclass method
+Shape.prototype.move = function(x, y) {
+  this.x += x;
+  this.y += y;
+};
+
+// Rectangle - subclass
+function Rectangle() {
+  Shape.call(this); // call super constructor.
+}
+
+// subclass extends superclass
+Rectangle.prototype = Object.create(Shape.prototype);
+Rectangle.prototype.constructor = Rectangle;
+
+var rect = new Rectangle();
+
+assert (rect instanceof Rectangle);
+assert (rect instanceof Shape);
+rect.move(1, 1);
+assert (rect.x === 1)
+assert (rect.y === 1);
+
+var obj = {
+  protoFunction: function() {
+    return 3;
+  }
+};
+
+Object.defineProperties(obj, {
+  "foo": {
+    value: 42,
+    writable: true,
+  },
+  "a": {
+    value: "b",
+    configurable: true
+  },
+  "bar": {
+    get: function() {
+      return this.foo;
+    },
+  },
+});
+
+var obj2 = Object.create(obj);
+
+assert (obj2.protoFunction() === 3);
+assert (obj2.foo === 42);
+assert (obj2.a === "b");
+assert (obj2.bar === 42);
+assert (Object.getPrototypeOf (obj2) === obj);
+
+
+var props = {
+    prop1: {
+        value: 1,
+    },
+    hey: function () {
+        return "ho";
+    }
+};
+
+var obj3 = Object.create(obj, props);
+assert (obj3.prop1 === 1);
+assert (obj3.protoFunction() === 3);
+try {
+  assert (obj3.hey === undefined);
+  obj3.hey();
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+// Create an object with null as prototype
+var obj = Object.create(null)
+assert (typeof (obj) === "object");
+assert (Object.getPrototypeOf (obj) === null);
+
+try {
+    Object.create()
+    assert (false);
+} catch (e) {
+    assert (e instanceof TypeError);
+}
+
+try {
+    Object.create(undefined)
+    assert (false);
+} catch (e) {
+    assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/object-define-properties.js b/deps/jerry/tests/jerry/object-define-properties.js
new file mode 100644 (file)
index 0000000..69c1197
--- /dev/null
@@ -0,0 +1,204 @@
+// 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.
+
+var obj = {};
+Object.defineProperties(obj, {
+  "foo": {
+    value: true,
+    writable: true
+  },
+  "bar": {
+    value: "baz",
+    writable: false
+  },
+  "Hello": {
+    value: "world",
+    writable: false
+  },
+  "inner_object": {
+    value : {
+      "a" : 1,
+      "b" : {
+        value: "foo"
+      }
+    }
+  }
+});
+
+assert (obj.foo === true);
+assert (obj.bar === "baz");
+assert (obj.Hello === "world");
+assert (obj.inner_object.a === 1);
+assert (obj.inner_object.b.value === "foo");
+
+// These cases should throw TypeError
+try {
+  Object.defineProperties(obj, undefined);
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+try {
+  Object.defineProperties(obj, null);
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+try {
+  Object.defineProperties(undefined, {
+    "foo": {
+      value: true,
+      writable: true
+    }
+  });
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+// Check for internal assert, see issue #131.
+try {
+  Object.defineProperties([], undefined);
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+// If one of the properties is wrong than it shouldn't update the object.
+var obj2 = {
+  a: 5
+};
+try {
+  Object.defineProperties(obj2, {
+    "foo": {
+      value: true,
+      writable: true
+    },
+    "bar": {
+      value: 3,
+      set: 3
+    },
+    "Hello": {
+      value: "world",
+      writable: false
+    }
+  });
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+  assert (obj2.foo === undefined);
+  assert (obj2.set === undefined);
+  assert (obj2.Hello === undefined);
+  assert (obj2.a === 5);
+}
+
+// Define accessors
+var obj = {};
+Object.defineProperties(obj, {
+  "foo": {
+    value: 42,
+    writable: true,
+  },
+  "bar": {
+    get: function() { return this.foo },
+    set: function(v) { this.foo = v }
+  }
+});
+
+assert (obj.bar === 42);
+obj.bar = "baz";
+assert (obj.foo === "baz");
+
+// Define get method which throws error
+var obj = {};
+var props = {
+  prop1: {
+    value: 1,
+    writable: true,
+  },
+  get bar() {
+    throw new TypeError("foo");
+    return { value : 2, writable : true };
+  },
+  prop2: {
+    value: 3,
+    writable: true,
+  },
+  prop3: {
+    value: 4,
+    writable: true,
+  }
+};
+
+try {
+  Object.defineProperties(obj, props);
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+  assert (e.message === "foo");
+}
+
+// Define get method which deletes a property
+var obj = {};
+Object.defineProperties(obj, {
+  "foo": {
+    value: 42,
+    writable: true,
+  },
+  "a": {
+    value: "b",
+    configurable: true
+  },
+  "bar": {
+    get: function() {
+      delete this.a;
+      return this.foo;
+    },
+  }
+});
+
+assert (obj.a === "b");
+assert (obj.bar === 42);
+assert (obj.a === undefined);
+
+// This code should throw TypeError
+var obj = {};
+var props = {
+  prop1: {
+    value: 1,
+    writable: true,
+  },
+  get bar() {
+    delete props.prop1;
+    delete props.prop2;
+    return { value : 2, writable : true };
+  },
+  prop2: {
+    value: 3,
+    writable: true,
+  },
+  prop3: {
+    value: 4,
+    writable: true,
+  }
+};
+
+try {
+  Object.defineProperties(obj, props);
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/object-defineproperty.js b/deps/jerry/tests/jerry/object-defineproperty.js
new file mode 100644 (file)
index 0000000..6988f1a
--- /dev/null
@@ -0,0 +1,70 @@
+// 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.
+
+var obj = [];
+
+Object.defineProperty (obj, "prop", {
+    value: 2010,
+    writable: true,
+    enumerable: true,
+    configurable: false
+});
+
+assert (obj.hasOwnProperty ("prop"));
+function getFunc() {
+    return 20;
+}
+
+try {
+    Object.defineProperty (obj, "prop", {
+        get: getFunc
+    });
+    assert (false);
+} catch (e) {
+    assert (e instanceof TypeError);
+    var desc = Object.getOwnPropertyDescriptor (obj, "prop");
+    assert (desc.value === 2010);
+    assert (typeof (desc.get) === 'undefined');
+}
+
+obj = {};
+var setter = function () {};
+
+Object.defineProperty(obj, "prop", {
+    set: setter,
+    configurable: true
+});
+
+var desc1 = Object.getOwnPropertyDescriptor(obj, "prop");
+
+Object.defineProperty(obj, "prop", {
+    set: undefined
+});
+
+var desc2 = Object.getOwnPropertyDescriptor(obj, "prop");
+assert (desc1.set === setter && desc2.set === undefined);
+
+obj = {};
+
+/* This error is thrown even in non-strict mode. */
+Object.defineProperty(obj, 'f', {
+  set: function(value) { throw 234; },
+});
+
+try {
+  obj.f = 5;
+  assert (false);
+} catch (err) {
+  assert (err === 234);
+}
diff --git a/deps/jerry/tests/jerry/object-get-own-property-descriptor.js b/deps/jerry/tests/jerry/object-get-own-property-descriptor.js
new file mode 100644 (file)
index 0000000..cf2cd34
--- /dev/null
@@ -0,0 +1,84 @@
+// 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.
+
+var obj;
+var desc;
+
+obj = { bar: 42 };
+desc = Object.getOwnPropertyDescriptor (obj, 'bar');
+// desc is { configurable: true, enumerable: true, value: 42, writable: true }
+assert (desc.value === 42);
+assert (desc.configurable);
+assert (desc.writable);
+assert (desc.enumerable);
+
+obj = { "foo": "bar" };
+desc = Object.getOwnPropertyDescriptor (obj, 'foo');
+assert (desc.value === "bar");
+
+obj = {};
+Object.defineProperty (obj, 'baz', { value: 8675309, writable: false, enumerable: false });
+desc = Object.getOwnPropertyDescriptor (obj, 'baz');
+// desc is { value: 8675309, writable: false, enumerable: false, configurable: false }
+assert (desc.value === 8675309);
+assert (!desc.configurable);
+assert (!desc.writable);
+assert (!desc.enumerable);
+
+obj = { "0.00001": 1 };
+desc = Object.getOwnPropertyDescriptor (obj, 1e-5);
+assert ( desc.value === 1);
+
+obj = { "123": 1 };
+desc = Object.getOwnPropertyDescriptor (obj, 123);
+assert (desc.value === 1);
+
+obj = { "undefined": 1 };
+var desc1 = Object.getOwnPropertyDescriptor (obj, undefined);
+var desc2 = Object.getOwnPropertyDescriptor (obj, "undefined");
+assert (desc1.value === 1 && desc2.value === 1);
+
+obj = { "0": 1 };
+desc = Object.getOwnPropertyDescriptor (obj, -0);
+assert (desc.value === 1);
+
+obj = { "Hellobj": 42 };
+desc = Object.getOwnPropertyDescriptor (obj, new String ("Hellobj"));
+assert (desc.value === 42);
+
+obj = {};
+desc = Object.getOwnPropertyDescriptor (obj, 'baz');
+assert (desc === undefined);
+
+obj = { get foo() { return obj.bar; }, set foo(a) { obj.bar = a; }, bar: 0 };
+desc = Object.getOwnPropertyDescriptor(obj, 'foo');
+// d is { configurable: true, enumerable: true, get: /*the getter function*/, set: /*the setter function*/ }
+assert (typeof(desc.get) === 'function');
+assert (typeof(desc.set) === 'function');
+assert (desc.configurable);
+assert (desc.enumerable);
+assert (obj.foo === 0)
+
+var array_desc = Object.getOwnPropertyDescriptor(Array, "prototype");
+assert (array_desc.configurable === false);
+assert (array_desc.writable === false);
+assert (array_desc.enumerable === false);
+
+var obj_undef;
+try {
+    Object.getOwnPropertyDescriptor (obj_undef, "fail");
+    assert (false);
+} catch (e) {
+    assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/object-get-own-property-names.js b/deps/jerry/tests/jerry/object-get-own-property-names.js
new file mode 100644 (file)
index 0000000..10ab4cb
--- /dev/null
@@ -0,0 +1,72 @@
+// 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.
+
+// Test array
+var arr = ['a', 'b', 'c'];
+var props = Object.getOwnPropertyNames(arr);
+// props should contain: 0,1,2,length and the order is not defined!
+assert (props.indexOf("0") !== -1);
+assert (props.indexOf("1") !== -1);
+assert (props.indexOf("2") !== -1);
+assert (props.indexOf("length") !== -1);
+assert (props.length === 4);
+
+// Test object
+var obj = {key1: 'a', key3: 'b', key2: 'c', key4: 'c', key5: ''};
+props = Object.getOwnPropertyNames(obj);
+// props should contain: key1,key2,key3,key4,key5 and the order is not defined!
+assert (props.indexOf("key1") !== -1);
+assert (props.indexOf("key2") !== -1);
+assert (props.indexOf("key3") !== -1);
+assert (props.indexOf("key4") !== -1);
+assert (props.indexOf("key5") !== -1);
+assert (props.length === 5);
+
+var obj2 = {};
+Object.defineProperties(obj2, {
+    key_one: {enumerable: true, value: 'one'},
+    key_two: {enumerable: false, value: 'two'},
+});
+
+props = Object.getOwnPropertyNames(obj2);
+// props should contain: key_one,key_two and the order is not defined!
+assert (props.indexOf("key_one") !== -1);
+assert (props.indexOf("key_two") !== -1);
+assert (props.length === 2);
+
+// Test prototype chain
+function Parent() {}
+Parent.prototype.inheritedMethod = function() {};
+
+function Child() {
+  this.prop = 5;
+  this.method = function() {};
+}
+Child.prototype = new Parent;
+Child.prototype.prototypeMethod = function() {};
+
+props = Object.getOwnPropertyNames (new Child());
+// props should contain: prop,method and the order is not defined!
+assert (props.indexOf("prop") !== -1);
+assert (props.indexOf("method") !== -1);
+
+assert (props.length === 2);
+
+// Test non-object argument
+try {
+  Object.getOwnPrototypeNames("hello");
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/object-getprototypeof.js b/deps/jerry/tests/jerry/object-getprototypeof.js
new file mode 100644 (file)
index 0000000..d740388
--- /dev/null
@@ -0,0 +1,54 @@
+// 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.
+
+try {
+  var v;
+  Object.getPrototypeOf(v);
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+try {
+  Object.getPrototypeOf("foo");
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+try {
+  Object.getPrototypeOf(60);
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+try {
+  var y = Object.getPrototypeOf(null);
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+var obj = { x : "foo" };
+assert (Object.getPrototypeOf(obj) === Object.prototype);
+
+var constructor = function () {};
+constructor.prototype = obj;
+
+var d_obj = new constructor();
+assert (Object.getPrototypeOf(d_obj) === obj);
+
+obj = Object.create(null);
+assert (Object.getPrototypeOf(obj) === null);
diff --git a/deps/jerry/tests/jerry/object-is-extensible.js b/deps/jerry/tests/jerry/object-is-extensible.js
new file mode 100644 (file)
index 0000000..f3e96b5
--- /dev/null
@@ -0,0 +1,46 @@
+// 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.
+
+// New objects are extensible.
+var empty = {};
+assert (Object.isExtensible(empty) === true);
+
+// ...but that can be changed.
+Object.preventExtensions(empty);
+assert(Object.isExtensible(empty) === false);
+
+// Call on undefined should throw TypeError.
+try
+{
+    Object.isExtensible(undefined);
+    assert (false);
+} catch (e) {
+    assert (e instanceof TypeError);
+}
+
+try
+{
+    Object.preventExtensions(undefined);
+    assert (false);
+} catch (e) {
+    assert (e instanceof TypeError);
+}
+
+// Sealed objects are by definition non-extensible.
+var sealed = Object.seal({});
+assert (Object.isExtensible(sealed) === false);
+
+// Frozen objects are also by definition non-extensible.
+var frozen = Object.freeze({});
+assert(Object.isExtensible(frozen) === false);
diff --git a/deps/jerry/tests/jerry/object-keys.js b/deps/jerry/tests/jerry/object-keys.js
new file mode 100644 (file)
index 0000000..4ebae68
--- /dev/null
@@ -0,0 +1,98 @@
+// 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.
+
+// Test array
+var arr = ['a', 'b', 'c'];
+var props = Object.keys(arr);
+// props should contain: 0,1,2 and the order is not defined!
+assert (props.indexOf("0") !== -1);
+assert (props.indexOf("1") !== -1);
+assert (props.indexOf("2") !== -1);
+assert (props.length === 3);
+
+// Test object
+var obj = {key1: 'a', key3: 'b', key2: 'c', key4: 'c', key5: ''};
+props = Object.keys(obj);
+// props should contain: key1,key2,key3,key4,key5 and the order is not defined!
+assert (props.indexOf("key1") !== -1);
+assert (props.indexOf("key2") !== -1);
+assert (props.indexOf("key3") !== -1);
+assert (props.indexOf("key4") !== -1);
+assert (props.indexOf("key5") !== -1);
+assert (props.length === 5);
+
+var obj2 = {};
+Object.defineProperties(obj2, {
+    key_one: {enumerable: true, value: 'one'},
+    key_two: {enumerable: false, value: 'two'},
+});
+
+props = Object.keys(obj2);
+// props should contain: key_one
+assert (props.indexOf("key_one") !== -1);
+assert (props.indexOf("key_two") === -1);
+assert (props.length === 1);
+
+// Test prototype chain
+function Parent() {}
+Parent.prototype.inheritedMethod = function() {};
+
+function Child() {
+  this.prop = 5;
+  this.method = function() {};
+}
+Child.prototype = new Parent;
+Child.prototype.prototypeMethod = function() {};
+
+props = Object.keys (new Child());
+// props should contain: prop,method and the order is not defined!
+assert (props.indexOf("prop") !== -1);
+assert (props.indexOf("method") !== -1);
+assert (props.length === 2);
+
+// Test non-object argument
+try {
+  Object.keys("hello");
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+var o = {};
+
+Object.defineProperty(o, 'a', {
+  value: "OK",
+  writable: true,
+  enumerable: true,
+  configurable: true
+});
+
+Object.defineProperty(o, 'b', {
+  value: "NOT_OK",
+  writable: true,
+  enumerable: false,
+  configurable: true
+});
+
+Object.defineProperty(o, 'c', {
+  value: "OK",
+  writable: true,
+  enumerable: true,
+  configurable: true
+});
+
+props = Object.keys(o);
+assert(props.length === 2);
+assert(o[props[0]] === "OK");
+assert(o[props[1]] === "OK");
diff --git a/deps/jerry/tests/jerry/object-literal-2.js b/deps/jerry/tests/jerry/object-literal-2.js
new file mode 100644 (file)
index 0000000..67c229c
--- /dev/null
@@ -0,0 +1,39 @@
+// 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.
+
+var a = {get a(){return undefined}, set a(b){}}
+
+var b = {if:0, else:1, try:2, catch:3, finally:4, let:5}
+
+assert (b.if + b.else + b.try + b.catch + b.finally + b.let === 15)
+
+function c() {
+  "use strict"
+  var b = {let:15, enum:10}
+  assert (b.let + b.enum === 25)
+}
+c();
+
+function d () {
+  "use strict";
+
+  try {
+    /* 'let' is a FutureReservedWord in strict mode code */
+    eval ('var a = { get prop () { let = 1; } }');
+    assert (false);
+  } catch (e) {
+    assert (e instanceof SyntaxError);
+  }
+}
+d ();
diff --git a/deps/jerry/tests/jerry/object-literal-3.js b/deps/jerry/tests/jerry/object-literal-3.js
new file mode 100644 (file)
index 0000000..f7a5aa4
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+try
+{
+  // This should be failed in ECMA-262 v5.1
+  eval("({ get 1() {}, 1:1 })");
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof SyntaxError);
+}
diff --git a/deps/jerry/tests/jerry/object-literal.js b/deps/jerry/tests/jerry/object-literal.js
new file mode 100644 (file)
index 0000000..bf4943d
--- /dev/null
@@ -0,0 +1,227 @@
+// 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.
+
+var person = {
+    firstName:"John",
+    lastName:"Doe",
+    age:50,
+    eyeColor:"blue",
+    "gender":"male",
+    0:0
+};
+
+assert (person.firstName === "John");
+assert (person["firstName"] === "John");
+assert (person.lastName === "Doe");
+assert (person["lastName"] === "Doe");
+assert (person.age === 50);
+assert (person["age"] === 50);
+assert (person.eyeColor === "blue");
+assert (person["eyeColor"] === "blue");
+assert (person.gender === "male");
+assert (person["gender"] === "male");
+assert (person["0"] === 0);
+
+var x = person;
+x.age = 40;
+assert (x.age === 40);
+assert (person.age === 40);
+
+var john = new Object();
+john.firstName = "John";
+john.lastName = "Doe";
+john.age = 40;
+john.eyeColor = "blue";
+
+assert (person.firstName === john.firstName);
+assert (person.lastName === john.lastName);
+assert (person.age === john.age);
+assert (person.eyeColor === john.eyeColor);
+
+var a, b; 
+b = 'property1'; 
+a = { 
+  'property1' : 'value1', 
+  get property2 () { return 1; }, 
+  set property2 (a) {
+    if (true)
+      this.property3 = a * 10;
+    else
+      this.property3 = a;
+  },
+  set property3 (b) { this.property1 = b; }
+}; 
+assert (a.property1 === 'value1'); 
+assert (a.property2 === 1); 
+a.property3 = 'value2'; 
+assert (a.property1 === 'value2'); 
+a.property2 = 2.5; 
+assert (a.property1 === 25); 
+b = delete a[b]; 
+assert (b === true); 
+assert (a.property1 === undefined); 
+
+flow = '';
+a = {
+  get q ()
+  {
+    flow += 'get: ' + (typeof q);
+
+    return 0;
+  },
+  set q (v)
+  {
+    flow += ', set: ' + (typeof q);
+  }
+};
+
+a.q;
+a.q = 1;
+
+assert (flow == 'get: undefined, set: undefined');
+
+var data = {
+  '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8,
+  '9': 9, '10': 10, '11': 11, '12': 12, '13': 13, '14': 14, '15': 15, '16': 16,
+  '17': 17, '18': 18, '19': 19, '20': 20, '21': 21, '22': 22, '23': 23, '24': 24,
+  '25': 25, '26': 26, '27': 27, '28': 28, '29': 29, '30': 30, '31': 31, '32': 32,
+  '33': 33, '34': 34, '35': 35, '36': 36, '37': 37, '38': 38, '39': 39, '40': 40,
+  '41': 41, '42': 42, '43': 43, '44': 44, '45': 45, '46': 46, '47': 47, '48': 48,
+  '49': 49, '50': 50, '51': 51, '52': 52, '53': 53, '54': 54, '55': 55, '56': 56,
+  '57': 57, '58': 58, '59': 59, '60': 60, '61': 61, '62': 62, '63': 63, '64': 64,
+  '65': 65, '66': 66, '67': 67, '68': 68, '69': 69, '70': 70, '71': 71, '72': 72,
+  '73': 73, '74': 74, '75': 75, '76': 76, '77': 77, '78': 78, '79': 79, '80': 80,
+  '81': 81, '82': 82, '83': 83, '84': 84, '85': 85, '86': 86, '87': 87, '88': 88,
+  '89': 89, '90': 90, '91': 91, '92': 92, '93': 93, '94': 94, '95': 95, '96': 96,
+  '97': 97, '98': 98, '99': 99, '100': 100, '101': 101, '102': 102, '103': 103, '104': 104,
+  '105': 105, '106': 106, '107': 107, '108': 108, '109': 109, '110': 110, '111': 111, '112': 112,
+  '113': 113, '114': 114, '115': 115, '116': 116, '117': 117, '118': 118, '119': 119, '120': 120,
+  '121': 121, '122': 122, '123': 123, '124': 124, '125': 125, '126': 126, '127': 127, '128': 128,
+  '129': 129, '130': 130, '131': 131, '132': 132, '133': 133, '134': 134, '135': 135, '136': 136,
+  '137': 137, '138': 138, '139': 139, '140': 140, '141': 141, '142': 142, '143': 143, '144': 144,
+  '145': 145, '146': 146, '147': 147, '148': 148, '149': 149, '150': 150, '151': 151, '152': 152,
+  '153': 153, '154': 154, '155': 155, '156': 156, '157': 157, '158': 158, '159': 159, '160': 160,
+  '161': 161, '162': 162, '163': 163, '164': 164, '165': 165, '166': 166, '167': 167, '168': 168,
+  '169': 169, '170': 170, '171': 171, '172': 172, '173': 173, '174': 174, '175': 175, '176': 176,
+  '177': 177, '178': 178, '179': 179, '180': 180, '181': 181, '182': 182, '183': 183, '184': 184,
+  '185': 185, '186': 186, '187': 187, '188': 188, '189': 189, '190': 190, '191': 191, '192': 192,
+  '193': 193, '194': 194, '195': 195, '196': 196, '197': 197, '198': 198, '199': 199, '200': 200,
+  '201': 201, '202': 202, '203': 203, '204': 204, '205': 205, '206': 206, '207': 207, '208': 208,
+  '209': 209, '210': 210, '211': 211, '212': 212, '213': 213, '214': 214, '215': 215, '216': 216,
+  '217': 217, '218': 218, '219': 219, '220': 220, '221': 221, '222': 222, '223': 223, '224': 224,
+  '225': 225, '226': 226, '227': 227, '228': 228, '229': 229, '230': 230, '231': 231, '232': 232,
+  '233': 233, '234': 234, '235': 235, '236': 236, '237': 237, '238': 238, '239': 239, '240': 240,
+  '241': 241, '242': 242, '243': 243, '244': 244, '245': 245, '246': 246, '247': 247, '248': 248,
+  '249': 249, '250': 250, '251': 251, '252': 252, '253': 253, '254': 254, '255': 255, '256': 256,
+  '257': 257, '258': 258, '259': 259, '260': 260, '261': 261, '262': 262, '263': 263, '264': 264,
+  '265': 265, '266': 266, '267': 267, '268': 268, '269': 269, '270': 270, '271': 271, '272': 272,
+  '273': 273, '274': 274, '275': 275, '276': 276, '277': 277, '278': 278, '279': 279, '280': 280,
+  '281': 281, '282': 282, '283': 283, '284': 284, '285': 285, '286': 286, '287': 287, '288': 288,
+  '289': 289, '290': 290, '291': 291, '292': 292, '293': 293, '294': 294, '295': 295, '296': 296,
+  '297': 297, '298': 298, '299': 299, '300': 300, '301': 301, '302': 302, '303': 303, '304': 304,
+  '305': 305, '306': 306, '307': 307, '308': 308, '309': 309, '310': 310, '311': 311, '312': 312,
+  '313': 313, '314': 314, '315': 315, '316': 316, '317': 317, '318': 318, '319': 319, '320': 320,
+  '321': 321, '322': 322, '323': 323, '324': 324, '325': 325, '326': 326, '327': 327, '328': 328,
+  '329': 329, '330': 330, '331': 331, '332': 332, '333': 333, '334': 334, '335': 335, '336': 336,
+  '337': 337, '338': 338, '339': 339, '340': 340, '341': 341, '342': 342, '343': 343, '344': 344,
+  '345': 345, '346': 346, '347': 347, '348': 348, '349': 349, '350': 350, '351': 351, '352': 352,
+  '353': 353, '354': 354, '355': 355, '356': 356, '357': 357, '358': 358, '359': 359, '360': 360,
+  '361': 361, '362': 362, '363': 363, '364': 364, '365': 365, '366': 366, '367': 367, '368': 368,
+  '369': 369, '370': 370, '371': 371, '372': 372, '373': 373, '374': 374, '375': 375, '376': 376,
+  '377': 377, '378': 378, '379': 379, '380': 380, '381': 381, '382': 382, '383': 383, '384': 384,
+  '385': 385, '386': 386, '387': 387, '388': 388, '389': 389, '390': 390, '391': 391, '392': 392,
+  '393': 393, '394': 394, '395': 395, '396': 396, '397': 397, '398': 398, '399': 399, '400': 400,
+  '401': 401, '402': 402, '403': 403, '404': 404, '405': 405, '406': 406, '407': 407, '408': 408,
+  '409': 409, '410': 410, '411': 411, '412': 412, '413': 413, '414': 414, '415': 415, '416': 416,
+  '417': 417, '418': 418, '419': 419, '420': 420, '421': 421, '422': 422, '423': 423, '424': 424,
+  '425': 425, '426': 426, '427': 427, '428': 428, '429': 429, '430': 430, '431': 431, '432': 432,
+  '433': 433, '434': 434, '435': 435, '436': 436, '437': 437, '438': 438, '439': 439, '440': 440,
+  '441': 441, '442': 442, '443': 443, '444': 444, '445': 445, '446': 446, '447': 447, '448': 448,
+  '449': 449, '450': 450, '451': 451, '452': 452, '453': 453, '454': 454, '455': 455, '456': 456,
+  '457': 457, '458': 458, '459': 459, '460': 460, '461': 461, '462': 462, '463': 463, '464': 464,
+  '465': 465, '466': 466, '467': 467, '468': 468, '469': 469, '470': 470, '471': 471, '472': 472,
+  '473': 473, '474': 474, '475': 475, '476': 476, '477': 477, '478': 478, '479': 479, '480': 480,
+  '481': 481, '482': 482, '483': 483, '484': 484, '485': 485, '486': 486, '487': 487, '488': 488,
+  '489': 489, '490': 490, '491': 491, '492': 492, '493': 493, '494': 494, '495': 495, '496': 496,
+  '497': 497, '498': 498, '499': 499, '500': 500, '501': 501, '502': 502, '503': 503, '504': 504,
+  '505': 505, '506': 506, '507': 507, '508': 508, '509': 509, '510': 510, '511': 511, '512': 512,
+  '513': 513, '514': 514, '515': 515, '516': 516, '517': 517, '518': 518, '519': 519, '520': 520,
+  '521': 521, '522': 522, '523': 523, '524': 524, '525': 525, '526': 526, '527': 527, '528': 528,
+  '529': 529, '530': 530, '531': 531, '532': 532, '533': 533, '534': 534, '535': 535, '536': 536,
+  '537': 537, '538': 538, '539': 539, '540': 540, '541': 541, '542': 542, '543': 543, '544': 544,
+  '545': 545, '546': 546, '547': 547, '548': 548, '549': 549, '550': 550, '551': 551, '552': 552,
+  '553': 553, '554': 554, '555': 555, '556': 556, '557': 557, '558': 558, '559': 559, '560': 560,
+  '561': 561, '562': 562, '563': 563, '564': 564, '565': 565, '566': 566, '567': 567, '568': 568,
+  '569': 569, '570': 570, '571': 571, '572': 572, '573': 573, '574': 574, '575': 575, '576': 576,
+  '577': 577, '578': 578, '579': 579, '580': 580, '581': 581, '582': 582, '583': 583, '584': 584,
+  '585': 585, '586': 586, '587': 587, '588': 588, '589': 589, '590': 590, '591': 591, '592': 592,
+  '593': 593, '594': 594, '595': 595, '596': 596, '597': 597, '598': 598, '599': 599, '600': 600,
+  '601': 601, '602': 602, '603': 603, '604': 604, '605': 605, '606': 606, '607': 607, '608': 608,
+  '609': 609, '610': 610, '611': 611, '612': 612, '613': 613, '614': 614, '615': 615, '616': 616,
+  '617': 617, '618': 618, '619': 619, '620': 620, '621': 621, '622': 622, '623': 623, '624': 624,
+  '625': 625, '626': 626, '627': 627, '628': 628, '629': 629, '630': 630, '631': 631, '632': 632,
+  '633': 633, '634': 634, '635': 635, '636': 636, '637': 637, '638': 638, '639': 639, '640': 640,
+  '641': 641, '642': 642, '643': 643, '644': 644, '645': 645, '646': 646, '647': 647, '648': 648,
+  '649': 649, '650': 650, '651': 651, '652': 652, '653': 653, '654': 654, '655': 655, '656': 656,
+  '657': 657, '658': 658, '659': 659, '660': 660, '661': 661, '662': 662, '663': 663, '664': 664,
+  '665': 665, '666': 666, '667': 667, '668': 668, '669': 669, '670': 670, '671': 671, '672': 672,
+  '673': 673, '674': 674, '675': 675, '676': 676, '677': 677, '678': 678, '679': 679, '680': 680,
+  '681': 681, '682': 682, '683': 683, '684': 684, '685': 685, '686': 686, '687': 687, '688': 688,
+  '689': 689, '690': 690, '691': 691, '692': 692, '693': 693, '694': 694, '695': 695, '696': 696,
+  '697': 697, '698': 698, '699': 699, '700': 700, '701': 701, '702': 702, '703': 703, '704': 704,
+  '705': 705, '706': 706, '707': 707, '708': 708, '709': 709, '710': 710, '711': 711, '712': 712,
+  '713': 713, '714': 714, '715': 715, '716': 716, '717': 717, '718': 718, '719': 719, '720': 720,
+  '721': 721, '722': 722, '723': 723, '724': 724, '725': 725, '726': 726, '727': 727, '728': 728,
+  '729': 729, '730': 730, '731': 731, '732': 732, '733': 733, '734': 734, '735': 735, '736': 736,
+  '737': 737, '738': 738, '739': 739, '740': 740, '741': 741, '742': 742, '743': 743, '744': 744,
+  '745': 745, '746': 746, '747': 747, '748': 748, '749': 749, '750': 750, '751': 751, '752': 752,
+  '753': 753, '754': 754, '755': 755, '756': 756, '757': 757, '758': 758, '759': 759, '760': 760,
+  '761': 761, '762': 762, '763': 763, '764': 764, '765': 765, '766': 766, '767': 767, '768': 768,
+  '769': 769, '770': 770, '771': 771, '772': 772, '773': 773, '774': 774, '775': 775, '776': 776,
+  '777': 777, '778': 778, '779': 779, '780': 780, '781': 781, '782': 782, '783': 783, '784': 784,
+  '785': 785, '786': 786, '787': 787, '788': 788, '789': 789, '790': 790, '791': 791, '792': 792,
+  '793': 793, '794': 794, '795': 795, '796': 796, '797': 797, '798': 798, '799': 799, '800': 800,
+  '801': 801, '802': 802, '803': 803, '804': 804, '805': 805, '806': 806, '807': 807, '808': 808,
+  '809': 809, '810': 810, '811': 811, '812': 812, '813': 813, '814': 814, '815': 815, '816': 816,
+  '817': 817, '818': 818, '819': 819, '820': 820, '821': 821, '822': 822, '823': 823, '824': 824,
+  '825': 825, '826': 826, '827': 827, '828': 828, '829': 829, '830': 830, '831': 831, '832': 832,
+  '833': 833, '834': 834, '835': 835, '836': 836, '837': 837, '838': 838, '839': 839, '840': 840,
+  '841': 841, '842': 842, '843': 843, '844': 844, '845': 845, '846': 846, '847': 847, '848': 848,
+  '849': 849, '850': 850, '851': 851, '852': 852, '853': 853, '854': 854, '855': 855, '856': 856,
+  '857': 857, '858': 858, '859': 859, '860': 860, '861': 861, '862': 862, '863': 863, '864': 864,
+  '865': 865, '866': 866, '867': 867, '868': 868, '869': 869, '870': 870, '871': 871, '872': 872,
+  '873': 873, '874': 874, '875': 875, '876': 876, '877': 877, '878': 878, '879': 879, '880': 880,
+  '881': 881, '882': 882, '883': 883, '884': 884, '885': 885, '886': 886, '887': 887, '888': 888,
+  '889': 889, '890': 890, '891': 891, '892': 892, '893': 893, '894': 894, '895': 895, '896': 896,
+  '897': 897, '898': 898, '899': 899, '900': 900, '901': 901, '902': 902, '903': 903, '904': 904,
+  '905': 905, '906': 906, '907': 907, '908': 908, '909': 909, '910': 910, '911': 911, '912': 912,
+  '913': 913, '914': 914, '915': 915, '916': 916, '917': 917, '918': 918, '919': 919, '920': 920,
+  '921': 921, '922': 922, '923': 923, '924': 924, '925': 925, '926': 926, '927': 927, '928': 928,
+  '929': 929, '930': 930, '931': 931, '932': 932, '933': 933, '934': 934, '935': 935, '936': 936,
+  '937': 937, '938': 938, '939': 939, '940': 940, '941': 941, '942': 942, '943': 943, '944': 944,
+  '945': 945, '946': 946, '947': 947, '948': 948, '949': 949, '950': 950, '951': 951, '952': 952,
+  '953': 953, '954': 954, '955': 955, '956': 956, '957': 957, '958': 958, '959': 959, '960': 960,
+  '961': 961, '962': 962, '963': 963, '964': 964, '965': 965, '966': 966, '967': 967, '968': 968,
+  '969': 969, '970': 970, '971': 971, '972': 972, '973': 973, '974': 974, '975': 975, '976': 976,
+  '977': 977, '978': 978, '979': 979, '980': 980, '981': 981, '982': 982, '983': 983, '984': 984,
+  '985': 985, '986': 986, '987': 987, '988': 988, '989': 989, '990': 990, '991': 991, '992': 992,
+  '993': 993, '994': 994, '995': 995, '996': 996, '997': 997, '998': 998, '999': 999, '1000': 1000,
+  '1001': 1001, '1002': 1002, '1003': 1003, '1004': 1004, '1005': 1005, '1006': 1006, '1007': 1007, '1008': 1008,
+  '1009': 1009, '1010': 1010, '1011': 1011, '1012': 1012, '1013': 1013, '1014': 1014, '1015': 1015, '1016': 1016,
+  '1017': 1017, '1018': 1018, '1019': 1019, '1020': 1020, '1021': 1021, '1022': 1022, '1023': 1023, '1024': 1024 };
+
+for (i = 1; i <= 1024; i++)
+{
+  assert (data[i] === i);
+}
diff --git a/deps/jerry/tests/jerry/object-prototype-hasownproperty.js b/deps/jerry/tests/jerry/object-prototype-hasownproperty.js
new file mode 100644 (file)
index 0000000..9b7c0f0
--- /dev/null
@@ -0,0 +1,52 @@
+// 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.
+
+var obj1 = {};
+obj1.prop = "hi";
+
+assert (obj1.hasOwnProperty('prop') === true);
+assert (obj1.hasOwnProperty('NO_PROP') === false);
+
+
+// Test if the toString fails.
+try {
+  obj1.hasOwnProperty({toString: function() { throw new ReferenceError ("foo"); }});
+
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+// Test if the toObject fails.
+
+var obj2;
+try {
+  obj2.hasOwnProperty("fail");
+
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+var obj_undef;
+var obj3 = {};
+Object.defineProperty(obj3, 'Test', { 'get' : function () {throw new ReferenceError ("foo"); } });
+assert (obj3.hasOwnProperty("Test") === true);
+
+Object.defineProperty(obj3, 'Test2', { 'get' : function () { return 0/0; } });
+assert (obj3.hasOwnProperty("Test2") === true);
+
+Object.defineProperty(obj3, 'Test4', { 'get' : function () { return obj_undef; } });
+assert (obj3.hasOwnProperty("Test4") === true);
diff --git a/deps/jerry/tests/jerry/object-prototype-isprototypeof.js b/deps/jerry/tests/jerry/object-prototype-isprototypeof.js
new file mode 100644 (file)
index 0000000..aeec6a3
--- /dev/null
@@ -0,0 +1,34 @@
+// 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.
+
+function Function_A() { }
+function Function_B() { }
+Function_B.prototype = new Function_A();
+
+function Function_C() { }
+Function_C.prototype = new Function_B();
+
+function Function_D() { }
+Function_D.prototype = new Function_C();
+
+var d_instance = new Function_D();
+
+assert (Function_A.prototype.isPrototypeOf (d_instance) === true)
+assert (Function_A.prototype.isPrototypeOf (Array) === false)
+
+
+assert (Function_A.prototype.isPrototypeOf.call(0, 0) === false);
+assert (Function_A.prototype.isPrototypeOf.call(Function_A, 0) === false);
+
+assert (Function.prototype.isPrototypeOf (Object) === true)
diff --git a/deps/jerry/tests/jerry/object-prototype-propertyisenumerable.js b/deps/jerry/tests/jerry/object-prototype-propertyisenumerable.js
new file mode 100644 (file)
index 0000000..4a4616f
--- /dev/null
@@ -0,0 +1,97 @@
+// 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.
+
+var obj = {};
+
+// Test if the toString fails.
+try {
+  obj.propertyIsEnumerable({ toString: function() { throw new ReferenceError ("foo"); } });
+
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+// Test if the toObject fails.
+var obj1;
+try {
+  obj1.propertyIsEnumerable("fail");
+
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+var array = [];
+obj.prop = "bar";
+array[0] = "bar";
+
+assert (obj.propertyIsEnumerable('prop') === true);
+assert (array.propertyIsEnumerable(0) === true);
+
+assert (obj.propertyIsEnumerable('length') === false);
+assert (array.propertyIsEnumerable('length') === false);
+assert (Math.propertyIsEnumerable('random') === false);
+
+// Creating a new property
+Object.defineProperty(obj, 'prop1', { value: 'foo', enumerable: true });
+Object.defineProperty(obj, 'prop2', { value: 'foo', enumerable: false });
+Object.defineProperty(obj, 'prop3', { value: 'foo' });
+assert (obj.propertyIsEnumerable('prop1') === true);
+assert (obj.propertyIsEnumerable('prop2') === false);
+assert (obj.propertyIsEnumerable('prop3') === false);
+
+Object.defineProperty(array, 'prop1', { value: 'foo', enumerable: true });
+Object.defineProperty(array, 'prop2', { value: 'foo', enumerable: false });
+Object.defineProperty(array, 'prop3', { value: 'foo' });
+assert (array.propertyIsEnumerable('prop1') === true);
+assert (array.propertyIsEnumerable('prop2') === false);
+assert (array.propertyIsEnumerable('prop3') === false);
+
+// Modify an existing one
+Object.defineProperty(obj, 'prop', { value: 'foo', enumerable: false });
+assert (obj.propertyIsEnumerable('prop') === false);
+Object.defineProperty(obj, 'prop', { value: 'foo', enumerable: true });
+assert (obj.propertyIsEnumerable('prop') === true);
+
+Object.defineProperty(array, 0, { value: 'foo', enumerable: false });
+assert (array.propertyIsEnumerable(0) === false);
+Object.defineProperty(array, 0, { value: 'foo', enumerable: true });
+assert (array.propertyIsEnumerable(0) === true);
+
+// Enumerability of inherited properties
+function construct1()
+{
+  this.prop1 = 'foo';
+}
+
+function construct2()
+{
+  this.prop2 = 'foo';
+}
+
+construct2.prototype = new construct1;
+construct2.prototype.constructor = construct2;
+
+var obj2 = new construct2();
+obj2.prop3 = 'foo';
+
+assert (obj2.propertyIsEnumerable('prop3') === true);
+assert (obj2.propertyIsEnumerable('prop2') === true);
+assert (obj2.propertyIsEnumerable('prop1') === false);
+
+obj2.prop1 = 'foo';
+
+assert (obj2.propertyIsEnumerable('prop1') === true);
diff --git a/deps/jerry/tests/jerry/object-prototype-tolocalestring.js b/deps/jerry/tests/jerry/object-prototype-tolocalestring.js
new file mode 100644 (file)
index 0000000..19e5935
--- /dev/null
@@ -0,0 +1,54 @@
+// 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.
+
+var obj1 = {};
+obj1.toString = function () { return "mystring"; }
+
+assert (obj1.toLocaleString() === "mystring");
+
+var obj2 = {a: 3};
+assert (obj2.toLocaleString() === "[object Object]");
+
+
+var obj3 = {toLocaleString: function() { throw ReferenceError ("foo"); }};
+try {
+  obj3.toLocaleString();
+
+  assert (false);
+} catch (e) {
+  assert (e.message === "foo");
+  assert (e instanceof ReferenceError);
+}
+
+// Test invalid toString call
+var obj4 = {toString: 2};
+try {
+  obj4.toLocaleString();
+
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+// Test undefined toString call
+var obj5 = {};
+var obj6;
+obj5.toString = obj6
+try {
+  obj5.toLocaleString();
+
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/object_freeze.js b/deps/jerry/tests/jerry/object_freeze.js
new file mode 100644 (file)
index 0000000..a40359d
--- /dev/null
@@ -0,0 +1,78 @@
+// 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.
+
+var obj = {
+  prop: function() {},
+  foo: 'bar'
+};
+
+// New properties may be added, existing properties may be changed or removed
+obj.foo = 'baz';
+obj.lumpy = 'woof';
+delete obj.prop;
+
+var o = Object.freeze(obj);
+
+assert(Object.isFrozen(obj) === true);
+
+// Now any changes will fail
+obj.foo = 'quux'; // silently does nothing
+assert (obj.foo === 'baz');
+
+obj.quaxxor = 'the friendly duck'; // silently doesn't add the property
+assert (obj.quaxxor === undefined);
+
+// ...and in strict mode such attempts will throw TypeErrors
+function fail(){
+  'use strict';
+
+  try {
+    obj.foo = 'sparky'; // throws a TypeError
+    assert (false);
+  } catch (e) {
+    assert (e instanceof TypeError);
+  }
+
+  try {
+    delete obj.foo; // throws a TypeError
+    assert (false);
+  } catch (e) {
+    assert (e instanceof TypeError);
+  }
+
+  try {
+    obj.sparky = 'arf'; // throws a TypeError
+    assert (false);
+  } catch (e) {
+    assert (e instanceof TypeError);
+  }
+}
+
+fail();
+
+// Attempted changes through Object.defineProperty will also throw
+
+try {
+  Object.defineProperty(obj, 'ohai', { value: 17 }); // throws a TypeError
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+try {
+  Object.defineProperty(obj, 'foo', { value: 'eit' }); // throws a TypeError
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/object_seal.js b/deps/jerry/tests/jerry/object_seal.js
new file mode 100644 (file)
index 0000000..b7fe983
--- /dev/null
@@ -0,0 +1,85 @@
+// 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.
+
+var obj = {
+  prop: function() {},
+  foo: 'bar'
+};
+// New properties may be added, existing properties may be changed or removed.
+obj.foo = 'baz';
+obj.lumpy = 'woof';
+delete obj.prop;
+
+var o = Object.seal(obj);
+
+assert (o === obj);
+assert (Object.isSealed (obj) === true);
+
+// Changing property values on a sealed object still works.
+obj.foo = 'quux';
+assert (obj.foo === 'quux');
+// But you can't convert data properties to accessors, or vice versa.
+try {
+    Object.defineProperty(obj, 'foo', { get: function() { return 42; } }); // throws a TypeError
+    assert (false);
+} catch (e) {
+    assert (e instanceof TypeError);
+}
+
+// Now any changes, other than to property values, will fail.
+obj.quaxxor = 'the friendly duck'; // silently doesn't add the property
+delete obj.foo; // silently doesn't delete the property
+
+assert (obj.quaxxor === undefined);
+assert (obj.foo === 'quux')
+
+try {
+    // Attempted additions through Object.defineProperty will also throw.
+    Object.defineProperty (obj, 'ohai', { value: 17 }); // throws a TypeError
+    assert (false);
+} catch (e) {
+    assert (e instanceof TypeError);
+}
+
+try {
+    Object.defineProperties (obj, { 'ohai' : { value: 17 } });
+    assert (false);
+} catch (e) {
+    assert (e instanceof TypeError);
+}
+
+Object.defineProperty (obj, 'foo', { value: 'eit' });
+assert (obj.foo === 'eit')
+
+// Objects aren't sealed by default.
+var empty = {};
+assert (Object.isSealed (empty) === false);
+
+// If you make an empty object non-extensible, it is vacuously sealed.
+Object.preventExtensions (empty);
+assert (Object.isSealed (empty) === true);
+
+// The same is not true of a non-empty object, unless its properties are all non-configurable.
+var hasProp = { fee: 'fie foe fum' };
+Object.preventExtensions (hasProp);
+assert (Object.isSealed (hasProp) === false);
+
+// But make them all non-configurable and the object becomes sealed.
+Object.defineProperty (hasProp, 'fee', { configurable: false });
+assert (Object.isSealed (hasProp) === true);
+
+// The easiest way to seal an object, of course, is Object.seal.
+var sealed = {};
+Object.seal (sealed);
+assert (Object.isSealed (sealed) === true);
diff --git a/deps/jerry/tests/jerry/octal.js b/deps/jerry/tests/jerry/octal.js
new file mode 100644 (file)
index 0000000..358ab13
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (010 === 8);
diff --git a/deps/jerry/tests/jerry/parser-oom.js b/deps/jerry/tests/jerry/parser-oom.js
new file mode 100644 (file)
index 0000000..22c58a2
--- /dev/null
@@ -0,0 +1,39 @@
+// 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.
+
+/* String which is 32 bytes long. */
+var str = "1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+";
+
+for (var i = 0; i < 10; i++) {
+  str = str + str;
+}
+
+str = "(function() { return " + str + "1 })";
+
+/* Eat memory. */
+var array = [];
+
+try
+{
+  for (var i = 0; i < 30; i++)
+  {
+    array[i] = eval(str);
+  }
+  assert (false);
+}
+catch (err)
+{
+  array = null;
+  assert (err === null);
+}
diff --git a/deps/jerry/tests/jerry/regexp-alternatives.js b/deps/jerry/tests/jerry/regexp-alternatives.js
new file mode 100644 (file)
index 0000000..d084d45
--- /dev/null
@@ -0,0 +1,60 @@
+// 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.
+
+var r;
+
+r = new RegExp ("a|b");
+assert (r.exec("a") == "a");
+
+r = new RegExp ("a|b");
+assert (r.exec("b") == "b");
+
+r = new RegExp ("a|b|c");
+assert (r.exec("b") == "b");
+
+r = new RegExp ("a|b|c");
+assert (r.exec("c") == "c");
+
+r = new RegExp ("a|b|c|d");
+assert (r.exec("") == undefined);
+
+r = new RegExp ("a|b|c|d");
+assert (r.exec("a") == "a");
+
+r = new RegExp ("a|b|c|d");
+assert (r.exec("b") == "b");
+
+r = new RegExp ("a|b|c|d");
+assert (r.exec("c") == "c");
+
+r = new RegExp ("a|b|c|d");
+assert (r.exec("d") == "d");
+
+r = new RegExp ("a|bb|c|d");
+assert (r.exec("e") == undefined);
+
+r = new RegExp ("a|bb|c|d");
+assert (r.exec("bb") == "bb");
+
+r = new RegExp ("a|bb|c|d");
+assert (r.exec("bba") == "bb");
+
+r = new RegExp ("a|bb|c|d");
+assert (r.exec("bbbb") == "bb");
+
+r = new RegExp ("a|bb|c|d");
+assert (r.exec("a") == "a");
+
+r = new RegExp ("a|bb|c|d");
+assert (r.exec("b") == undefined);
diff --git a/deps/jerry/tests/jerry/regexp-assertions.js b/deps/jerry/tests/jerry/regexp-assertions.js
new file mode 100644 (file)
index 0000000..dd3a642
--- /dev/null
@@ -0,0 +1,175 @@
+// 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.
+
+var t;
+
+t = new RegExp ("^alma$").exec("alma");
+assert (t == "alma");
+
+t = new RegExp ("^alma$").exec("almaa");
+assert (t == undefined);
+
+t = new RegExp ("^alma$").exec("aalma");
+assert (t == undefined);
+
+t = new RegExp ("^alma").exec("alma");
+assert (t == "alma");
+
+t = new RegExp ("^alma").exec("almaa");
+assert (t == "alma");
+
+t = new RegExp ("^alma").exec("aalma");
+assert (t == undefined);
+
+t = new RegExp ("alma$").exec("alma");
+assert (t == "alma");
+
+t = new RegExp ("alma$").exec("almaa");
+assert (t == undefined);
+
+t = new RegExp ("alma$").exec("aalma");
+assert (t == "alma");
+
+t = new RegExp ("\\bis\\b").exec("This island is beautiful");
+assert (t == "is");
+
+t = new RegExp ("\\Bis\\B").exec("This island is beautiful");
+assert (t == undefined);
+
+t = new RegExp ("\\Bis").exec("This island is beautiful");
+assert (t == "is");
+
+t = new RegExp ("is\\B").exec("This island is beautiful");
+assert (t == "is");
+
+t = new RegExp ("\\Bis\\b").exec("This island is beautiful");
+assert (t == "is");
+
+t = new RegExp ("\\bis\\B").exec("This island is beautiful");
+assert (t == "is");
+
+t = new RegExp ("al(?=(ma))").exec("al");
+assert (t == undefined);
+
+t = new RegExp ("al(?!(ma))").exec("ala");
+assert (t[0] == "al");
+assert (t[1] == undefined);
+
+t = new RegExp ("al(?=(ma))").exec("alma");
+assert (t[0] == "al");
+assert (t[1] == "ma");
+
+t = new RegExp ("al(?=(ma))").exec("almama");
+assert (t[0] == "al");
+assert (t[1] == "ma");
+
+t = new RegExp ("(al)(?=(ma))ma").exec("al");
+assert (t == undefined);
+
+t = new RegExp ("(al)(?=(ma)ma)").exec("al");
+assert (t == undefined);
+
+t = new RegExp ("al(?=(ma))*ma").exec("alma");
+assert (t[0] == "alma");
+assert (t[1] == undefined);
+
+t = new RegExp ("al(?!(ma))*ma").exec("alma");
+assert (t[0] == "alma");
+assert (t[1] == undefined);
+
+t = new RegExp ("al(?=(ma))ma").exec("alma");
+assert (t[0] == "alma");
+assert (t[1] == "ma");
+
+t = new RegExp ("al(?!(ma))ma").exec("alma");
+assert (t == undefined);
+
+t = new RegExp ("(al)(?=(ma))ma").exec("almama");
+t = new RegExp ("(al)(?=(ma)ma)").exec("almama");
+
+t = new RegExp ("al(?=(ma))ma").exec("almama");
+assert (t[0] == "alma");
+assert (t[1] == "ma");
+
+t = new RegExp ("al(?=(ma)ma)").exec("almama");
+assert (t[0] == "al");
+assert (t[1] == "ma");
+
+t = new RegExp ("al(?!(ma))ma").exec("almama");
+assert (t == undefined);
+
+t = new RegExp ("a(?=(a)(a))aab|aaac").exec("aaac");
+t = new RegExp ("a(?=(a)(a))aab|aaac").exec("aaab");
+
+t = new RegExp ("(?!(a)b)|ab").exec("ab");
+assert (t[0] == "ab");
+assert (t[1] == undefined);
+
+t = new RegExp ("(?=(a)b)|ab").exec("ab");
+assert (t[0] == "");
+assert (t[1] == "a");
+
+t = new RegExp ("(?=a|.)Dt").exec("Dt");
+assert (t == "Dt");
+
+t = new RegExp ("(?=.|a)Dt").exec("Dt");
+assert (t == "Dt");
+
+t = new RegExp ("(?=a|b)Dt").exec("Dt");
+assert (t == undefined);
+
+t = new RegExp ("(?=.|P)").exec("a");
+assert (t == "");
+
+t = new RegExp ("(?=.)").exec("a");
+assert (t == "");
+
+t = new RegExp ("(?!a|.)Dt").exec("Dt");
+assert (t == undefined);
+
+t = new RegExp ("(?!.|a)Dt").exec("Dt");
+assert (t == undefined);
+
+t = new RegExp ("(?!a|b)Dt").exec("Dt");
+assert (t == "Dt");
+
+t = new RegExp ("(?!.|P)").exec("a");
+assert (t == "");
+
+t = new RegExp ("(?!.)").exec("a");
+assert (t == "");
+
+t = new RegExp ("abc","g");
+t.lastIndex = {toString: function () { return "4"}};
+var result = t.exec("abc   abc");
+assert(result[0] === "abc");
+assert(result.index === 6);
+
+t = new RegExp ("abc","g");
+t.lastIndex = {valueOf: function () { return "4"}};
+var result = t.exec("abc   abc");
+assert(result[0] === "abc");
+assert(result.index === 6);
+
+t = new RegExp ("abc","g");
+t.lastIndex = "2"
+var result = t.exec("abc   abc");
+assert(result[0] === "abc");
+assert(result.index === 6);
+
+t = new RegExp ("abc","g");
+t.lastIndex = -12;
+result = t.exec("abc   abc");
+assert(!result);
+assert(t.lastIndex === 0);
diff --git a/deps/jerry/tests/jerry/regexp-backreference.js b/deps/jerry/tests/jerry/regexp-backreference.js
new file mode 100644 (file)
index 0000000..2551cd5
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var r;
+
+r = new RegExp ("(a)b\\1").exec("aba");
+assert (r[0] == "aba");
+assert (r[1] == "a");
+
+r = new RegExp ("(a)b\\1").exec("b");
+assert (r == undefined);
+
+r = new RegExp ("(a)*b\\1").exec("b");
+assert (r[0] == "b");
+assert (r[1] == undefined);
diff --git a/deps/jerry/tests/jerry/regexp-capture-groups.js b/deps/jerry/tests/jerry/regexp-capture-groups.js
new file mode 100644 (file)
index 0000000..801e062
--- /dev/null
@@ -0,0 +1,198 @@
+// 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.
+
+var r;
+
+// Simple test cases
+r = new RegExp ("()");
+assert (r.exec ("a") == ",");
+
+r = new RegExp ("(a)");
+assert (r.exec ("a") == "a,a");
+
+r = new RegExp ("((a)b)c");
+assert (r.exec ("abc") == "abc,ab,a");
+
+r = new RegExp ("(a)*");
+assert (r.exec ("b")[0] == "");
+assert (r.exec ("b")[1] == undefined);
+assert (r.exec ("aaaa") == "aaaa,a");
+
+r = new RegExp ("(a)+");
+assert (r.exec ("aaaa") == "aaaa,a");
+
+r = new RegExp ("(a){4}");
+assert (r.exec ("aaaa") == "aaaa,a");
+
+r = new RegExp ("(a){1,2}");
+assert (r.exec ("a") == "a,a");
+assert (r.exec ("aa") == "aa,a");
+assert (r.exec ("aaaa") == "aa,a");
+
+r = new RegExp ("(a)?");
+assert (r.exec ("a") == "a,a");
+assert (r.exec ("b")[0] == "");
+assert (r.exec ("b")[1] == undefined);
+
+// Test greedy iterations
+r = new RegExp ("(a){1,3}a");
+assert (r.exec("aa") == "aa,a");
+
+r = new RegExp ("(a){1,3}a");
+assert (r.exec("aaa") == "aaa,a");
+
+r = new RegExp ("(a){1,3}");
+assert (r.exec("a") == "a,a");
+
+r = new RegExp ("(a){1,3}");
+assert (r.exec("aaa") == "aaa,a");
+
+r = new RegExp ("(a){1,3}");
+assert (r.exec("aaaa") == "aaa,a");
+
+r = new RegExp ("(a){1,5}");
+assert (r.exec("aaaa") == "aaaa,a");
+
+r = new RegExp ("(a|b){1,2}");
+assert (r.exec("a") == "a,a");
+
+r = new RegExp ("(a|b){1,3}a");
+assert (r.exec("aaa") == "aaa,a");
+
+r = new RegExp ("(a|b){1,3}a");
+assert (r.exec("aba") == "aba,b");
+
+r = new RegExp ("(a|b){1,3}a");
+assert (r.exec("b") == undefined);
+
+r = new RegExp ("(a|b){1,3}a");
+assert (r.exec("bbb") == undefined);
+
+r = new RegExp ("(a|b){1,3}");
+assert (r.exec("a") == "a,a");
+
+r = new RegExp ("(a|b){1,3}");
+assert (r.exec("aa") == "aa,a");
+
+r = new RegExp ("(a|b){1,3}");
+assert (r.exec("aaa") == "aaa,a");
+
+r = new RegExp ("(a|b){1,3}");
+assert (r.exec("ab") == "ab,b");
+
+r = new RegExp ("(a|b){1,3}");
+assert (r.exec("aba") == "aba,a");
+
+r = new RegExp ("(a|b){1,3}");
+assert (r.exec("bab") == "bab,b");
+
+r = new RegExp ("(a|b){1,3}");
+assert (r.exec("bbb") == "bbb,b");
+
+r = new RegExp ("(a|b){1,4}a");
+assert (r.exec("bbb") == undefined);
+
+r = new RegExp ("(a|b){1,4}");
+assert (r.exec("ab") == "ab,b");
+
+r = new RegExp ("(a|b){1,4}");
+assert (r.exec("aba") == "aba,a");
+
+r = new RegExp ("(a|b){1,4}");
+assert (r.exec("bbb") == "bbb,b");
+
+r = new RegExp ("(a|b){1,5}");
+assert (r.exec("aba") == "aba,a");
+
+r = new RegExp ("(a|b){1,5}");
+assert (r.exec("abab") == "abab,b");
+
+r = new RegExp ("(a|b){1,5}");
+assert (r.exec("bbb") == "bbb,b");
+
+r = new RegExp ("(aba)*");
+assert (r.exec("aaaa") == ",");
+
+r = new RegExp ("(aba)+");
+assert (r.exec("aaaa") == undefined);
+
+r = new RegExp ("(a|bb|c|d)");
+assert (r.exec("a") == "a,a");
+
+r = new RegExp ("(a|b)");
+assert (r.exec("a") == "a,a");
+
+r = new RegExp ("(a|b)+");
+assert (r.exec("aba") == "aba,a");
+
+r = new RegExp ("(a|b)");
+assert (r.exec("b") == "b,b");
+
+r = new RegExp ("(a)");
+assert (r.exec("a") == "a,a");
+
+r = new RegExp ("(a)*");
+assert (r.exec("a") == "a,a");
+
+r = new RegExp ("(a)*");
+assert (r.exec("aaaa") == "aaaa,a");
+
+r = new RegExp ("(a)+");
+assert (r.exec("aaaa") == "aaaa,a");
+
+r = new RegExp ("(a|aa){0,3}b");
+assert (r.exec("aaaaaab") == "aaaaaab,aa");
+
+r = new RegExp ("((a){2,3}){4}b");
+assert (r.exec("aaaaaaaab") == "aaaaaaaab,aa,a");
+
+// Test non-greedy iterations
+r = new RegExp ("(a)+?");
+assert (r.exec("aaaa") == "a,a");
+
+r = new RegExp ("(a)*?aa");
+assert (r.exec("aaaa") == "aa,");
+
+r = new RegExp ("(aaa|aa)*?aa");
+assert (r.exec("aaaa")[0] == "aa");
+assert (r.exec("aaaa")[1] == undefined);
+
+r = new RegExp ("(a)??aa");
+assert (r.exec("aaaa")[0] == "aa");
+assert (r.exec("aaaa")[1] == undefined);
+
+r = new RegExp ("(a)?aa");
+assert (r.exec("aaaa") == "aaa,a");
+
+r = new RegExp ("(()*?)*?a");
+assert (r.exec("ba")[0] == "a");
+assert (r.exec("ba")[1] == undefined);
+assert (r.exec("ba")[2] == undefined);
+
+r = new RegExp ("((bb?)*)*a");
+assert (r.exec("bbba") == "bbba,bbb,b");
+
+r = new RegExp ("((bb?)*)*bbb\\Ba");
+assert (r.exec("bbba")[0] == "bbba");
+assert (r.exec("bbba")[1] == undefined);
+assert (r.exec("bbba")[2] == undefined);
+
+r = new RegExp ("(a??){0,1}a");
+assert (r.exec("aa") == "aa,a");
+
+r = new RegExp ("(a?){0,1}a");
+assert (r.exec("aa") == "aa,a");
+
+r = new RegExp ("(a{0,1}?){0,1}a");
+assert (r.exec("aa") == "aa,a");
diff --git a/deps/jerry/tests/jerry/regexp-character-class.js b/deps/jerry/tests/jerry/regexp-character-class.js
new file mode 100644 (file)
index 0000000..baa897a
--- /dev/null
@@ -0,0 +1,131 @@
+// 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.
+
+var r;
+
+r = new RegExp ("[abc]*").exec("aaabbcccabcacbacabacbacab");
+assert (r == "aaabbcccabcacbacabacbacab");
+
+r = new RegExp ("[abc]*").exec("aaabbcccabdcacb");
+assert (r == "aaabbcccab");
+
+r = new RegExp ("[abc]*").exec("defghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("[a-z]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("[A-Z]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("[^a-z]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("[^A-Z]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("\\d*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("\\D*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("\\w*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("\\W*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("\\s*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("\\S*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("[\\d]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("[\\D]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("[\\w]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("[\\W]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("[\\s]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("[\\S]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("[^\\d]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("[^\\D]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("[^\\w]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("[^\\W]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("[^\\s]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("[^\\S]*").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "");
+
+r = new RegExp ("\\d*").exec("0123456789");
+assert (r == "0123456789");
+
+try
+{
+  r = new RegExp("[");
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof SyntaxError);
+}
+
+try
+{
+  r = new RegExp("[\\");
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof SyntaxError);
+}
+
+r = new RegExp ("^[\\u0061-\\u007a]+$").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("^[\\u0061-\\u007a]+").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("[\\u0061-\\u007a]+$").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("^[\\x61-\\x7a]+$").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("^[\\x61-\\x7a]+").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
+
+r = new RegExp ("[\\x61-\\x7a]+$").exec("abcdefghjklmnopqrstuvwxyz");
+assert (r == "abcdefghjklmnopqrstuvwxyz");
diff --git a/deps/jerry/tests/jerry/regexp-construct.js b/deps/jerry/tests/jerry/regexp-construct.js
new file mode 100644 (file)
index 0000000..4aa7c80
--- /dev/null
@@ -0,0 +1,162 @@
+// 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.
+
+var r;
+
+r = new RegExp ();
+assert (r.source == "(?:)");
+assert (r.global == false);
+assert (r.ignoreCase == false);
+assert (r.multiline == false);
+
+r = new RegExp ("a");
+assert (r.source == "a");
+assert (r.global == false);
+assert (r.ignoreCase == false);
+assert (r.multiline == false);
+
+r = new RegExp ("a","gim");
+assert (r.source == "a");
+assert (r.global == true);
+assert (r.ignoreCase == true);
+assert (r.multiline == true);
+
+r = RegExp ("a");
+assert (r.source == "a");
+assert (r.global == false);
+assert (r.ignoreCase == false);
+assert (r.multiline == false);
+
+r = RegExp ("a","gim");
+assert (r.source == "a");
+assert (r.global == true);
+assert (r.ignoreCase == true);
+assert (r.multiline == true);
+
+var r2;
+try {
+  r2 = RegExp (r,"gim");
+  assert(false);
+}
+catch ( e )
+{
+  assert (e instanceof TypeError);
+}
+
+r2 = RegExp (r);
+assert (r2.source == "a");
+assert (r2.global == true);
+assert (r2.ignoreCase == true);
+assert (r2.multiline == true);
+
+r2 = RegExp (r, undefined);
+assert (r2.source == "a");
+assert (r2.global == true);
+assert (r2.ignoreCase == true);
+assert (r2.multiline == true);
+
+r = /(?:)/;
+assert (r.source == "(?:)");
+assert (r.global == false);
+assert (r.ignoreCase == false);
+assert (r.multiline == false);
+
+r = /a/;
+assert (r.source == "a");
+assert (r.global == false);
+assert (r.ignoreCase == false);
+assert (r.multiline == false);
+
+r = /a/gim;
+assert (r.source == "a");
+assert (r.global == true);
+assert (r.ignoreCase == true);
+assert (r.multiline == true);
+
+assert(Object.prototype.toString.call(RegExp.prototype) === '[object RegExp]');
+
+/* The 'undefined' argument for the RegExp constructor should not be converted to string,
+ * and it should behave just like when there is no argument.
+ */
+r1 = new RegExp();
+r2 = new RegExp(undefined);
+var foo;
+r3 = new RegExp(foo)
+
+assert (r1.source === r2.source);
+assert (r2.source === r3.source);
+
+r = new RegExp ("foo", undefined);
+assert (r.source === "foo");
+assert (r.global === false);
+assert (r.ignoreCase === false);
+assert (r.multiline === false);
+
+r = new RegExp ("foo", void 0);
+assert (r.source === "foo");
+assert (r.global === false);
+assert (r.ignoreCase === false);
+assert (r.multiline === false);
+
+try {
+  new RegExp (undefined, "ii");
+  assert (false);
+} catch (e) {
+  assert (e instanceof SyntaxError);
+}
+
+try {
+  new RegExp ("", "gg");
+  assert (false);
+} catch (e) {
+  assert (e instanceof SyntaxError);
+}
+
+try {
+  new RegExp (void 0, "mm");
+  assert (false);
+} catch (e) {
+  assert (e instanceof SyntaxError);
+}
+
+r = new RegExp (undefined, undefined);
+assert (r.source == "(?:)");
+assert (r.global == false);
+assert (r.ignoreCase == false);
+assert (r.multiline == false);
+
+/* RegExp properties */
+assert (RegExp.length === 2);
+assert (RegExp.prototype.source === "(?:)");
+assert (RegExp.prototype.global === false);
+assert (RegExp.prototype.ignoreCase === false);
+assert (RegExp.prototype.multiline === false);
+
+RegExp.prototype.source = "a";
+RegExp.prototype.global = true;
+RegExp.prototype.ignoreCase = true;
+RegExp.prototype.multiline = true;
+assert (RegExp.prototype.source === "(?:)");
+assert (RegExp.prototype.global === false);
+assert (RegExp.prototype.ignoreCase === false);
+assert (RegExp.prototype.multiline === false);
+
+delete RegExp.prototype.source;
+delete RegExp.prototype.global;
+delete RegExp.prototype.ignoreCase;
+delete RegExp.prototype.multiline;
+assert (RegExp.prototype.source === "(?:)");
+assert (RegExp.prototype.global === false);
+assert (RegExp.prototype.ignoreCase === false);
+assert (RegExp.prototype.multiline === false);
diff --git a/deps/jerry/tests/jerry/regexp-literal.js b/deps/jerry/tests/jerry/regexp-literal.js
new file mode 100644 (file)
index 0000000..b46f6bd
--- /dev/null
@@ -0,0 +1,84 @@
+// 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.
+
+var t;
+
+t = /\//.exec("/");
+assert (t == "/");
+
+t = /[/]/.exec("/");
+assert ("a"+/x/+"b" == "a/x/b");
+
+t = /\/\[[\]/]/.exec("/[/");
+assert (t == "/[/");
+
+t = /\u0000/.exec("\u0000");
+assert (t == "\u0000");
+
+try {
+  eval("/" + String.fromCharCode("0x0000") + "/");
+} catch (e) {
+  assert (false);
+}
+
+try {
+  eval("var x = 5\n\n/foo/");
+  assert(false);
+} catch (e) {
+  assert(e instanceof SyntaxError);
+}
+
+try {
+  eval("var x = 5;\n\n/foo/");
+} catch (e) {
+  assert(false);
+}
+
+try {
+  eval("for (;false;/abc/.exec(\"abc\")) {5}");
+} catch (e) {
+  assert(false);
+}
+
+try {
+  eval("var a = [] /foo/");
+  assert(false);
+} catch (e) {
+  assert(e instanceof SyntaxError);
+}
+
+try {
+  eval("/");
+  assert(false);
+} catch (e) {
+  assert(e instanceof SyntaxError);
+}
+
+try {
+  eval("var x = /aaa/");
+} catch (e) {
+  assert (false);
+}
+
+try {
+  eval("{}/a/g");
+} catch (e) {
+  assert (false);
+}
+
+try {
+  eval("var a, g; +{}/a/g");
+} catch (e) {
+  assert (false);
+}
diff --git a/deps/jerry/tests/jerry/regexp-non-capture-groups.js b/deps/jerry/tests/jerry/regexp-non-capture-groups.js
new file mode 100644 (file)
index 0000000..4bfb93a
--- /dev/null
@@ -0,0 +1,196 @@
+// 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.
+
+var r;
+
+// Simple test cases
+r = new RegExp ("(?:)");
+assert (r.exec ("a") == "");
+
+r = new RegExp ("(?:a)");
+assert (r.exec ("a") == "a");
+
+r = new RegExp ("(?:(?:a)b)c");
+assert (r.exec ("abc") == "abc");
+
+r = new RegExp ("(?:a)*");
+assert (r.exec ("b") == "");
+assert (r.exec ("aaaa") == "aaaa");
+
+r = new RegExp ("(?:a)+");
+assert (r.exec ("aaaa") == "aaaa");
+
+r = new RegExp ("(?:a){4}");
+assert (r.exec ("aaaa") == "aaaa");
+
+r = new RegExp ("(?:a){1,2}");
+assert (r.exec ("a") == "a");
+assert (r.exec ("aa") == "aa");
+assert (r.exec ("aaaa") == "aa");
+
+r = new RegExp ("(?:a)?");
+assert (r.exec ("a") == "a");
+assert (r.exec ("b") == "");
+
+// Test greedy iterations
+r = new RegExp ("(?:a){1,3}a");
+assert (r.exec ("aa") == "aa");
+
+r = new RegExp ("(?:a){1,3}a");
+assert (r.exec ("aaa") == "aaa");
+
+r = new RegExp ("(?:a){1,3}");
+assert (r.exec ("a") == "a");
+
+r = new RegExp ("(?:a){1,3}");
+assert (r.exec ("aaa") == "aaa");
+
+r = new RegExp ("(?:a){1,3}");
+assert (r.exec ("aaaa") == "aaa");
+
+r = new RegExp ("(?:a){1,5}");
+assert (r.exec ("aaaa") == "aaaa");
+
+r = new RegExp ("(?:a|b){1,2}");
+assert (r.exec ("a") == "a");
+
+r = new RegExp ("(?:a|b){1,3}a");
+assert (r.exec ("aaa") == "aaa");
+
+r = new RegExp ("(?:a|b){1,3}a");
+assert (r.exec ("aba") == "aba");
+
+r = new RegExp ("(?:a|b){1,3}a");
+assert (r.exec ("b") == undefined);
+
+r = new RegExp ("(?:a|b){1,3}a");
+assert (r.exec ("bbb") == undefined);
+
+r = new RegExp ("(?:a|b){1,3}");
+assert (r.exec ("a") == "a");
+
+r = new RegExp ("(?:a|b){1,3}");
+assert (r.exec ("aa") == "aa");
+
+r = new RegExp ("(?:a|b){1,3}");
+assert (r.exec ("aaa") == "aaa");
+
+r = new RegExp ("(?:a|b){1,3}");
+assert (r.exec ("ab") == "ab");
+
+r = new RegExp ("(?:a|b){1,3}");
+assert (r.exec ("aba") == "aba");
+
+r = new RegExp ("(?:a|b){1,3}");
+assert (r.exec ("bab") == "bab");
+
+r = new RegExp ("(?:a|b){1,3}");
+assert (r.exec ("bbb") == "bbb");
+
+r = new RegExp ("(?:a|b){1,4}a");
+assert (r.exec ("bbb") == undefined);
+
+r = new RegExp ("(?:a|b){1,4}");
+assert (r.exec ("ab") == "ab");
+
+r = new RegExp ("(?:a|b){1,4}");
+assert (r.exec ("aba") == "aba");
+
+r = new RegExp ("(?:a|b){1,4}");
+assert (r.exec ("bbb") == "bbb");
+
+r = new RegExp ("(?:a|b){1,5}");
+assert (r.exec ("abab") == "abab");
+
+r = new RegExp ("(?:aba)*");
+assert (r.exec ("aaaa") == "");
+
+r = new RegExp ("(?:aba)+");
+assert (r.exec ("aaaa") == undefined);
+
+r = new RegExp ("(?:a|bb|c|d)");
+assert (r.exec ("a") == "a");
+
+r = new RegExp ("(?:a|b|c|d)");
+assert (r.exec ("") == undefined);
+
+r = new RegExp ("(?:a|b|c|d)");
+assert (r.exec ("a") == "a");
+
+r = new RegExp ("(?:a|b|c|d)");
+assert (r.exec ("b") == "b");
+
+r = new RegExp ("(?:a|b|c|d)");
+assert (r.exec ("c") == "c");
+
+r = new RegExp ("(?:a|b|c|d)");
+assert (r.exec ("d") == "d");
+
+r = new RegExp ("(?:a|b)+");
+assert (r.exec ("aba") == "aba");
+
+r = new RegExp ("(?:a|b)");
+assert (r.exec ("b") == "b");
+
+r = new RegExp ("(?:a)");
+assert (r.exec ("a") == "a");
+
+r = new RegExp ("(?:a)*");
+assert (r.exec ("a") == "a");
+
+r = new RegExp ("(?:a)*");
+assert (r.exec ("aaaa") == "aaaa");
+
+r = new RegExp ("(?:a)+");
+assert (r.exec ("aaaa") == "aaaa");
+
+r = new RegExp ("(?:a)?aa");
+assert (r.exec ("aaaa") == "aaa");
+
+r = new RegExp ("(?:a?){0,1}a");
+assert (r.exec ("aa") == "aa");
+
+r = new RegExp ("(?:a|aa){0,3}b");
+assert (r.exec ("aaaaaab") == "aaaaaab");
+
+r = new RegExp ("(?:(?:a){2,3}){4}b");
+assert (r.exec ("aaaaaaaab") == "aaaaaaaab");
+
+// Test non-greedy iterations
+r = new RegExp ("(?:a)+?");
+assert (r.exec ("aaaa") == "a");
+
+r = new RegExp ("(?:a)*?aa");
+assert (r.exec ("aaaa") == "aa");
+
+r = new RegExp ("(?:aaa|aa)*?aa");
+assert (r.exec ("aaaa") == "aa");
+
+r = new RegExp ("(?:a)??aa");
+assert (r.exec ("aaaa") == "aa");
+
+r = new RegExp ("(?:(?:)*?)*?a");
+assert (r.exec ("ba") == "a");
+
+r = new RegExp ("(?:(?:bb?)*)*a");
+assert (r.exec ("bbba") == "bbba");
+
+r = new RegExp ("(?:(?:bb?)*)*bbb\\Ba");
+assert (r.exec ("bbba") == "bbba");
+
+r = new RegExp ("(?:a??){0,1}a");
+assert (r.exec ("aa") == "aa");
+
+r = new RegExp ("(?:a{0,1}?){0,1}a");
+assert (r.exec ("aa") == "aa");
diff --git a/deps/jerry/tests/jerry/regexp-routines.js b/deps/jerry/tests/jerry/regexp-routines.js
new file mode 100644 (file)
index 0000000..0775896
--- /dev/null
@@ -0,0 +1,112 @@
+// 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.
+
+var r;
+
+r = new RegExp ("a");
+assert (r.exec ("a") == "a");
+assert (r.exec ("b") == null);
+try {
+  r.exec.call({}, "a");
+  assert (false)
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+assert (r.test ("a") == true);
+assert (r.test ("b") == false);
+try {
+  r.test.call({}, "a");
+  assert (false)
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+r = new RegExp ("a", "mig");
+assert (r.toString () == "/a/gim");
+try {
+  r.toString.call({}, "a");
+  assert (false)
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+
+/* Test continous calls to the exec method to see how does the match
+ * updates the lastIndex propertyand see if the match restarts.
+ */
+var re = new RegExp("a", "g");
+result = re.exec("a");
+assert (result.length === 1);
+assert (result[0] === "a");
+assert (re.lastIndex === 1);
+
+assert (re.exec("a") === null);
+assert (re.lastIndex === 0);
+
+result = re.exec("a");
+assert (result.length === 1);
+assert (result[0] === "a");
+assert (re.lastIndex === 1);
+
+var re1 = /foo/gim;
+var re2 = /bar/g;
+
+try {
+  re2.compile("asd", "ggim");
+  assert (false);
+} catch (e) {
+  assert (e instanceof SyntaxError);
+  assert (re2 == "/bar/g");
+}
+
+try {
+  re2.compile("[", undefined);
+  assert (false);
+} catch (e) {
+  assert (e instanceof SyntaxError);
+  assert (re2 == "/bar/g");
+}
+
+try {
+  re2.compile(re1, "im");
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+  assert (re2 == "/bar/g");
+}
+
+re2.lastIndex = 2;
+re2.compile("asd", "im");
+
+assert (re2 == "/asd/im");
+assert (re2.global === false);
+assert (re2.ignoreCase === true);
+assert (re2.multiline === true);
+assert (re2.source === "asd");
+assert (re2.lastIndex === 0);
+
+re2.compile(re1);
+assert (re2.toString() === re1.toString());
+assert (re2.global === re1.global);
+assert (re2.ignoreCase === re1.ignoreCase);
+assert (re2.multiline === re1.multiline);
+assert (re2.source === re1.source);
+assert (re2.lastIndex === 0);
diff --git a/deps/jerry/tests/jerry/regexp-simple-atom-and-iterations.js b/deps/jerry/tests/jerry/regexp-simple-atom-and-iterations.js
new file mode 100644 (file)
index 0000000..c1f15da
--- /dev/null
@@ -0,0 +1,90 @@
+// 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.
+
+var r;
+
+r = new RegExp ("a");
+assert (r.exec ("a") == "a");
+assert (r.exec ("b") == undefined);
+
+r = new RegExp ("abc");
+assert (r.exec ("abc") == "abc");
+
+r = new RegExp ("a*");
+assert (r.exec ("aaa") == "aaa");
+assert (r.exec ("b") == "");
+
+r = new RegExp ("a+");
+assert (r.exec ("aaa") == "aaa");
+assert (r.exec ("b") == undefined);
+
+r = new RegExp ("ab*");
+assert (r.exec ("a") == "a");
+assert (r.exec ("ab") == "ab");
+assert (r.exec ("abbbb") == "abbbb");
+assert (r.exec ("bbb") == undefined);
+
+r = new RegExp ("a?");
+assert (r.exec ("a") == "a");
+assert (r.exec ("b") == "");
+
+r = new RegExp ("a{4}");
+assert (r.exec ("aaa") == undefined);
+assert (r.exec ("aaaaa") == "aaaa");
+assert (r.exec ("aaaa") == "aaaa");
+
+r = new RegExp ("a{2,6}");
+assert (r.exec ("a") == undefined);
+assert (r.exec ("aa") == "aa");
+assert (r.exec ("aaaaaa") == "aaaaaa");
+assert (r.exec ("aaaaaaa") == "aaaaaa");
+
+r = new RegExp (".*");
+assert (r.exec ("abcdefghijkl") == "abcdefghijkl");
+
+r = /\n/;
+assert (r.exec ("\n") == "\n");
+
+assert (/[\12]+/.exec ("1\n\n\n\n\n2") == "\n\n\n\n\n");
+assert (/[\1284]+/.exec ("1\n\n8\n4\n\n2") == "\n\n8\n4\n\n");
+assert (/[\89]12/.exec ("1\9128123") == "912");
+assert (/[\11]/.exec ("1\n\n\t\n\n2") == "\t");
+assert (/[\142][\143][\144]/.exec ("abcde") == "bcd");
+
+assert (/\12+/.exec ("1\n\n\n\n\n2") == "\n\n\n\n\n");
+assert (/\11/.exec ("1\n\n\t\n\n2") == "\t");
+assert (/\142\143\144/.exec ("abcde") == "bcd");
+assert (/\942\143\144/.exec ("a942cde") == "942cd");
+assert (/\14234/.exec ("b34") == "b34");
+
+assert (/(\d+)\2([abc]+)\1\2/.exec("123abc123abc") == "123abc123abc,123,abc");
+assert (/([abc]+)\40([d-f]+)\12\1/.exec("abc def\nabc") == "abc def\nabc,abc,def");
+
+var expected = "8765432911,8,7,6,5,4,3,2,9,1";
+assert (/(\d)(\d)(\d)(\d)(\d)(\d)(\d)(\d)\9(\d)\9/.exec("8765432911") == expected);
+
+r = /\c/;
+assert (r.exec ("\\c") == "\\c");
+
+r = /[\c]/;
+assert (r.exec ("c") == "c");
+
+r = /[\c1]/;
+assert (r.exec ("\u0011") == "\u0011");
+
+r = /\c3/;
+assert (r.exec ("\\c3") == "\\c3");
+
+r = /\cIasd/;
+assert (r.exec ("\tasd") == "\tasd");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1054.js b/deps/jerry/tests/jerry/regression-test-issue-1054.js
new file mode 100644 (file)
index 0000000..608f23d
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+try {
+  new String(Number.MAX_VALUE)
+} catch(e) {
+  assert(false);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1065.js b/deps/jerry/tests/jerry/regression-test-issue-1065.js
new file mode 100644 (file)
index 0000000..9daa3a4
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+new (new (new RegExp().constructor)().constructor)().constructor.prototype.toString()
+RegExp().constructor().constructor.prototype.compile(RegExp.prototype)
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1071.js b/deps/jerry/tests/jerry/regression-test-issue-1071.js
new file mode 100644 (file)
index 0000000..a4e85fa
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+var d = new Date(864858163349847396, 1, 1, 1, 1, 1, 1, 1)
+assert (d.toGMTString() === "Invalid Date");
+
+d = new Date(864858, 1, 1, 1, 1, 1, 1, 1)
+assert (d.toGMTString() === "Invalid Date");
+
+d = new Date(86485, 1, 1, 1, 1, 1, 1, 1)
+assert (d.toGMTString() !== "Invalid Date");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1072.js b/deps/jerry/tests/jerry/regression-test-issue-1072.js
new file mode 100644 (file)
index 0000000..4408ab9
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+try { new (this.$)(new (this.RegExp)().ignoreCase).$ ()  } catch($){}
+try { new (this.String)() .constructor.prototype.match()  } catch($){}
+try { this.RegExp().compile() } catch($){}
+try { this.$(this.RegExp.prototype .compile (this.RegExp.prototype))  } catch($){}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1073.js b/deps/jerry/tests/jerry/regression-test-issue-1073.js
new file mode 100644 (file)
index 0000000..01a8fbe
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+try { String.prototype(new (RegExp)())  } catch($){}
+try { RegExp.prototype.compile() } catch($){}
+try { isNaN(RegExp.prototype.compile(RegExp.prototype)) } catch($){}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1074.js b/deps/jerry/tests/jerry/regression-test-issue-1074.js
new file mode 100644 (file)
index 0000000..e520c58
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+try { this.Date.prototype.$ (this.isNaN.length, this.String.fromCharCode.length)  } catch($){}
+try { this.String.prototype.constructor.prototype.$(new (this.RegExp)())  } catch($){}
+try { this.RegExp.prototype.constructor.prototype.compile ()  } catch($){}
+try { this.isNaN (undefined)  } catch($){}
+try { new (this.Date)("2015-09-17").constructor.parse()  } catch($){}
+try { this.isNaN(this.RegExp.prototype.compile(this.RegExp.prototype))  } catch($){}
+try { new $.$ ()  } catch($){}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1075.js b/deps/jerry/tests/jerry/regression-test-issue-1075.js
new file mode 100644 (file)
index 0000000..e284d39
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+try { new (RegExp)().$()  } catch($){}
+try { RegExp.prototype.compile()  } catch($){}
+try { new (this.$)(1, RegExp.prototype.compile(RegExp.prototype))  } catch($){}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1076.js b/deps/jerry/tests/jerry/regression-test-issue-1076.js
new file mode 100644 (file)
index 0000000..6f89f88
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+try { Array.prototype.unshift(1)  } catch($){}
+try { Object.freeze(this.Array.prototype)()  } catch($){}
+try { new String(1).split("")  } catch($){}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1078.js b/deps/jerry/tests/jerry/regression-test-issue-1078.js
new file mode 100644 (file)
index 0000000..a3508c2
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+Array.prototype.splice(Function.prototype, 1, this);
+Object.freeze(Array.prototype);
+var res = (new String("Hello")).split(new RegExp());
+assert(res.length == 5);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1079.js b/deps/jerry/tests/jerry/regression-test-issue-1079.js
new file mode 100644 (file)
index 0000000..2ca8019
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+Array.prototype.push(1)
+Object.freeze(Array.prototype)
+try { new RegExp().constructor.prototype.exec()  } catch($){}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1080.js b/deps/jerry/tests/jerry/regression-test-issue-1080.js
new file mode 100644 (file)
index 0000000..9b5ae20
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+((new RegExp("}").constructor)("a", "g").constructor)(undefined).constructor.prototype.toString();
+new Date("2015-07-09T12:13:14.121+01:30").toISOString();
+RegExp(new RegExp("a", "g")).constructor("").constructor.prototype.compile(RegExp.prototype);
+new Date("2015-09-17").getUTCFullYear();
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1081.js b/deps/jerry/tests/jerry/regression-test-issue-1081.js
new file mode 100644 (file)
index 0000000..56e1fe4
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+try { new RegExp().compile(A)  } catch (err) {}
+try { A } catch (err) {}
+try { new RegExp().constructor.prototype.toString()  } catch (A) {}
+try { A } catch (err) {}
+try { new RegExp(1, "g").exec(1)  } catch (A) {}
+try { A } catch (err) {}
+try { A } catch (A) {}
+try { A } catch (A) {}
+try { new (Boolean.constructor.prototype)  } catch (err) {}
+try { Boolean  } catch (A) {}
+try { A } catch(A) {}
+try { new RegExp().compile(new (RegExp)())  } catch (A) {}
+try { Math.max().constructor.seal(A) } catch (err) {}
+try { Date.parse(RegExp.prototype.compile(RegExp.prototype)) } catch(A) {}
+try { Boolean.A() } catch (err) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1082.js b/deps/jerry/tests/jerry/regression-test-issue-1082.js
new file mode 100644 (file)
index 0000000..2363e40
--- /dev/null
@@ -0,0 +1,38 @@
+// 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.
+
+try { new (String)().A.A.A (A)  } catch (A) {}
+try { new (this.RegExp)().A ()  } catch (A) {}
+try { A.A.A ()  } catch (A) {}
+try { ; } catch (A) {}
+try { new A.A ()  } catch (A) {}
+try { new (this.Date)().setMinutes (this.RegExp.prototype)  } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { new A.A (A)  } catch (A) {}
+try { this.A (A)  } catch (A) {}
+try { new A.A ()  } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { new A().A ()  } catch (A) {}
+try { new A().A ()  } catch (A) {}
+try { this.isNaN (this.RegExp.prototype.compile (this.RegExp.prototype))  } catch (A) {}
+try { ; } catch (A) {}
+try { A.A.A (A)  } catch (A) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1083.js b/deps/jerry/tests/jerry/regression-test-issue-1083.js
new file mode 100644 (file)
index 0000000..3a48c9f
--- /dev/null
@@ -0,0 +1,31 @@
+// 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.
+
+try { ; } catch (A) {}
+try { new (this.String)().A.A.A (A)  } catch (A) {}
+try { ; } catch (A) {}
+try { new (this.RegExp)().A ()  } catch (A) {}
+try { A.A.A ()  } catch (A) {}
+try {  } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { ; } catch (A) {}
+try { new A.A ()  } catch (A) {}
+try { new (this.Date)().setMinutes (this.RegExp.prototype)  } catch (A) {}
+try { this.A (A)  } catch (A) {}
+try { new A.A ()  } catch (A) {}
+try { this.isNaN (this.RegExp.prototype.compile (this.RegExp.prototype))  } catch (A) {}
+try { ; } catch (A) {}
+try { A.A.A(A)  } catch (A) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-112.js b/deps/jerry/tests/jerry/regression-test-issue-112.js
new file mode 100644 (file)
index 0000000..72240a7
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+delete Function.prototype.toString;
+assert (Math.cos + 1 === '[object Function]1');
diff --git a/deps/jerry/tests/jerry/regression-test-issue-113.js b/deps/jerry/tests/jerry/regression-test-issue-113.js
new file mode 100644 (file)
index 0000000..5595554
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+v_1 = [];
+v_1 * v_1[v_1 % v_1];
diff --git a/deps/jerry/tests/jerry/regression-test-issue-114.js b/deps/jerry/tests/jerry/regression-test-issue-114.js
new file mode 100644 (file)
index 0000000..9fc4354
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+v_1 = 1;
+v_1[1] = 1;
diff --git a/deps/jerry/tests/jerry/regression-test-issue-115.js b/deps/jerry/tests/jerry/regression-test-issue-115.js
new file mode 100644 (file)
index 0000000..6460c14
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var v_1 = [,];
+Object.defineProperty(v_1, "0", {
+    set: function() {},
+});
diff --git a/deps/jerry/tests/jerry/regression-test-issue-116.js b/deps/jerry/tests/jerry/regression-test-issue-116.js
new file mode 100644 (file)
index 0000000..8a4145f
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+try
+{
+  Symbol.for.length.toString.length.toExponential.length.valueOf.length.toExponential.length.valueOf.length.toFixed.name.anchor.name.bold.length.toExponential.caller;
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-117.js b/deps/jerry/tests/jerry/regression-test-issue-117.js
new file mode 100644 (file)
index 0000000..6aff5f8
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+[print(typeof v_1)];
diff --git a/deps/jerry/tests/jerry/regression-test-issue-121.js b/deps/jerry/tests/jerry/regression-test-issue-121.js
new file mode 100644 (file)
index 0000000..4d2514b
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+try {
+  function f_1() {
+    v_1 + v_1;
+  }
+
+  f_1(new f_1);
+
+  assert (false);
+} catch (e) {
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-122.js b/deps/jerry/tests/jerry/regression-test-issue-122.js
new file mode 100644 (file)
index 0000000..316c76a
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+try
+{
+  print({toString: function() { throw new TypeError("foo"); }}, []);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+  assert (e.message === "foo");
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-123.js b/deps/jerry/tests/jerry/regression-test-issue-123.js
new file mode 100644 (file)
index 0000000..2b63bf7
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var v_1 = (1 + (1 + (1 +
+    (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 +
+    (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 +
+    (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 +
+    1
+    )) )) )) )) )) )) )) )) )) ))
+    )) )) )) )) )) )) )) )) )) ))
+    )) )) )) )) )) )) )) )) )) ))
+    )) );
diff --git a/deps/jerry/tests/jerry/regression-test-issue-128.js b/deps/jerry/tests/jerry/regression-test-issue-128.js
new file mode 100644 (file)
index 0000000..0e81d71
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+do {
+    try {
+    } finally {
+        break;
+    }
+} while (false);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1282.js b/deps/jerry/tests/jerry/regression-test-issue-1282.js
new file mode 100644 (file)
index 0000000..8067429
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+
+var counter = 0;
+
+({ get "0"() { counter += 1; } })[0];
+({ get 0() { counter += 2; } })[0];
+({ get 0.0() { counter += 3; } })[0];
+({ get 0.() { counter += 4; } })[0];
+({ get 1.() { counter += 5; } })[1];
+({ get 5.2322341234123() { counter += 6; } })[5.2322341234123];
+
+assert (counter == 21);
+
+({ set "0"(q) { counter -= 1; } })[0] = "dummy";
+({ set 0(q) { counter -= 2; } })[0] = "dummy";
+({ set 0.0(q) { counter -= 3; } })[0] = "dummy";
+({ set 0.(q) { counter -= 4; } })[0] = "dummy";
+({ set 1.(q) { counter -= 5; } })[1] = "dummy";
+({ set 5.2322341234123(q) { counter -= 6; } })[5.2322341234123] = "dummy";
+
+assert (counter == 0);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1284.js b/deps/jerry/tests/jerry/regression-test-issue-1284.js
new file mode 100644 (file)
index 0000000..00bad57
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var count = 0;
+[].length = { valueOf: function() { count++; return 1; } };
+assert(count == 2);
+
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1286.js b/deps/jerry/tests/jerry/regression-test-issue-1286.js
new file mode 100644 (file)
index 0000000..be9693d
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var builtinEval = eval;
+var eval = builtinEval.bind(undefined, "context");
+
+var context = "global";
+function checkIfDirectEval() {
+  var context = "function";
+  return (eval() == "function");
+}
+
+assert (!checkIfDirectEval());
+
diff --git a/deps/jerry/tests/jerry/regression-test-issue-129.js b/deps/jerry/tests/jerry/regression-test-issue-129.js
new file mode 100644 (file)
index 0000000..979b33d
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+try {
+    eval("do { \
+        return null; \
+        } while (false);");
+    assert (false);
+} catch (e) {
+    assert (e instanceof SyntaxError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1292.js b/deps/jerry/tests/jerry/regression-test-issue-1292.js
new file mode 100644 (file)
index 0000000..ab2cf76
--- /dev/null
@@ -0,0 +1,31 @@
+// 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.
+
+(function nonStrictFuncExpr() {
+  assert(typeof nonStrictFuncExpr == "function");
+  nonStrictFuncExpr = 123;
+  assert(typeof nonStrictFuncExpr == "function");
+})();
+
+(function strictFuncExpr() {
+  "use strict";
+  assert(typeof strictFuncExpr == "function");
+  try {
+    strictFuncExpr = 123;
+    assert(false);
+  } catch (e) {
+    assert(e instanceof TypeError);
+  }
+  assert(typeof strictFuncExpr == "function");
+})();
diff --git a/deps/jerry/tests/jerry/regression-test-issue-130.js b/deps/jerry/tests/jerry/regression-test-issue-130.js
new file mode 100644 (file)
index 0000000..d1672e6
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+v_1 = Math.floor('\u3d52');
+v_1 = Math.floor([]);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1300.js b/deps/jerry/tests/jerry/regression-test-issue-1300.js
new file mode 100644 (file)
index 0000000..6196854
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+var array = [ [0] ];
+var obj = { prop : "" };
+var i = 0;
+var count = 0;
+
+(function () {
+      for (array[0][i] in obj)
+          count++;
+})();
+
+assert(array[0][0] == "prop");
+assert(count == 1);
+
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1309.js b/deps/jerry/tests/jerry/regression-test-issue-1309.js
new file mode 100644 (file)
index 0000000..b2d346f
--- /dev/null
@@ -0,0 +1,30 @@
+// 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.
+
+var errorMessage = "toStringThrows"
+
+var toStringThrows = {
+  toString : function() {
+    throw new Error(errorMessage);
+  }
+}
+
+try {
+  var obj = {};
+  obj[toStringThrows] = 3;
+  assert(false);
+} catch (e) {
+  assert(e.message == errorMessage);
+}
+
diff --git a/deps/jerry/tests/jerry/regression-test-issue-132.js b/deps/jerry/tests/jerry/regression-test-issue-132.js
new file mode 100644 (file)
index 0000000..42a532f
--- /dev/null
@@ -0,0 +1,41 @@
+// 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.
+
+// Test raised by fuzzer
+v_0 = [,];
+v_1 = [,];
+v_2 = Object.defineProperties([,], { '0': {  get: function() { } } });
+
+// Test change from data to accessor type
+var a = { x:2 };
+Object.defineProperty(a, "x", {
+      enumerable: true,
+      configurable: true,
+      get: function() { return 0; }
+});
+
+// Test change from accessor to data type
+var obj = {test: 2};
+
+Object.defineProperty(obj, "test", {
+      enumerable: true,
+      configurable: true,
+      get: function() { return 0; }
+});
+
+Object.defineProperty(obj, "x", {
+      enumerable: true,
+      configurable: true,
+      value: -2
+});
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1386.js b/deps/jerry/tests/jerry/regression-test-issue-1386.js
new file mode 100644 (file)
index 0000000..c4c87cf
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+for (var y = 1950; y < 2050; y++) {
+  for (var m = 0; m < 12; m++) {
+    var last_date = new Date(y, m, 1).getDay ();
+    assert (!isNaN (last_date));
+    for (var d = 1; d < 32; d++) {
+      assert (last_date == new Date(y, m, d).getDay ());
+      last_date = (last_date + 1) % 7;
+    }
+  }
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1387.js b/deps/jerry/tests/jerry/regression-test-issue-1387.js
new file mode 100644 (file)
index 0000000..e8a8afa
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+'use strict'
+function undefined () {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1389.js b/deps/jerry/tests/jerry/regression-test-issue-1389.js
new file mode 100644 (file)
index 0000000..6a99c89
--- /dev/null
@@ -0,0 +1,38 @@
+// 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.
+
+function x(){}
+
+"a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","a12","a13","a14",
+"a15","a16","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27",
+"a28","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40",
+"a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53",
+"a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66",
+"a67","a68","a69","a70","a71","a72","a73","a74","a75","a76","a77","a78","a79",
+"a80","a81","a82","a83","a84","a85","a86","a87","a88","a89","a90","a91","a92",
+"a93","a94","a95","a96","a97","a98","a99","a100","a101","a102","a103","a104",
+"a105","a106","a107","a108","a109","a110","a111","a112","a113","a114","a115",
+"a116","a117","a118","a119","a120","a121","a122","a123","a124","a125","a126",
+"a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137",
+"a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148",
+"a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159",
+"a160","a161","a162","a163","a164","a165","a166","a167","a168","a169","a170",
+"a171","a172","a173","a174","a175","a176","a177","a178","a179","a180","a181",
+"a182","a183","a184","a185","a186","a187","a188","a189","a190","a191","a192",
+"a193","a194","a195","a196","a197","a198","a199","a200","a201","a202","a203",
+"a204","a205","a206","a207","a208","a209","a210","a211","a212","a213","a214",
+"a215","a216","a217","a218","a219","a220","a221","a222","a223","a224","a225",
+"a226","a227","a228","a229","a230","a231","a232","a233","a234","a235","a236",
+"a237","a238","a239","a240","a241","a242","a243","a244","a245","a246","a247",
+"a248","a249","a250","a251","a252","a253","a254","a255","a256","a257"
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1533.js b/deps/jerry/tests/jerry/regression-test-issue-1533.js
new file mode 100644 (file)
index 0000000..b91cb23
--- /dev/null
@@ -0,0 +1,36 @@
+// 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.
+
+var a = [];
+
+for (var i = 0; i < 200; ++i)
+  a[i] = 5;
+
+for (var i = 0; i < 200; ++i)
+  a[i] = a[i] + 5;
+
+for (var i = 0; i < 200; ++i)
+  delete a[i]
+
+a[0] = 5
+
+a = [];
+
+for (var i = 0; i < 200; ++i)
+  a[i] = 5;
+
+a.length = 0
+
+for (var i = 0; i < 200; ++i)
+  a[i] = 5;
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1546.js b/deps/jerry/tests/jerry/regression-test-issue-1546.js
new file mode 100644 (file)
index 0000000..2fb01ed
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+String.prototype.split(RegExp.prototype);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1547.js b/deps/jerry/tests/jerry/regression-test-issue-1547.js
new file mode 100644 (file)
index 0000000..1a06966
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert(new Date(Number.MAX_VALUE, Number.MAX_VALUE).toString() == "Invalid Date");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1552.js b/deps/jerry/tests/jerry/regression-test-issue-1552.js
new file mode 100644 (file)
index 0000000..9e1a687
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var o = []
+
+function add(i)
+{
+  delete o[i & 31];
+  o[i] = 0;
+}
+
+for (var i = 0; i < 130; i++)
+{
+  add(i)
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1555.js b/deps/jerry/tests/jerry/regression-test-issue-1555.js
new file mode 100644 (file)
index 0000000..c277bfa
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var src = "var a = 0; while(a) { switch(a) {";
+/* The += operation has a longer opcode. */
+for (var i = 0; i < 4000; i++)
+    src += "case " + i + ": a += a += a; break; ";
+src += "} }";
+
+eval(src);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1556.js b/deps/jerry/tests/jerry/regression-test-issue-1556.js
new file mode 100644 (file)
index 0000000..e1a59d3
--- /dev/null
@@ -0,0 +1,43 @@
+// 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.
+
+/* Maximum 256 paramaters are allowed. */
+var src = "(function (";
+for (var i = 0; i < 254; i++)
+    src += "a" + i + ", ";
+src += "b) { var c = 1; })()";
+
+eval(src);
+
+/* More than 256 parameters is a syntax error. */
+var src = "(function (";
+for (var i = 0; i < 255; i++)
+    src += "a" + i + ", ";
+src += "b) { })()";
+
+try {
+  eval(src);
+  assert(false);
+} catch (e) {
+  assert(e instanceof SyntaxError);
+}
+
+/* Maximum 256 local variables are stored in registers.
+ * The rest is stored in the lexical environment. */
+var src = "(function () {";
+for (var i = 0; i < 400; i++)
+    src += "var a" + i + " = 5; ";
+src += "})()";
+
+eval(src);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-156.js b/deps/jerry/tests/jerry/regression-test-issue-156.js
new file mode 100644 (file)
index 0000000..2760f55
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+function dec(x) { return x - 1 };
+for (var i = 5; i > 0; i = dec(i)) {}
+for (var i = 11; i = dec (i); i--) {}
+for (var i = dec (12); i > 0; i--) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1621.js b/deps/jerry/tests/jerry/regression-test-issue-1621.js
new file mode 100644 (file)
index 0000000..27af5e1
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var eval = eval.bind()
+gc();
+eval("1");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1636.js b/deps/jerry/tests/jerry/regression-test-issue-1636.js
new file mode 100644 (file)
index 0000000..d734674
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+assert(Number("Infinity") == Infinity);
+assert(isNaN(Number("infinity")));
+assert(isNaN(Number("InfinitY")));
+assert(isNaN(Number("e")));
+assert(isNaN(Number("e3")));
+assert(Number("1e2") == 100);
+assert(isNaN(Number(".")));
+assert(isNaN(Number(".e2")));
+assert(Number("0.") == 0);
+assert(Number(".0") == 0);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-164.js b/deps/jerry/tests/jerry/regression-test-issue-164.js
new file mode 100644 (file)
index 0000000..917fcb3
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var v_1 = { };
+
+for (i = 0; i < 1; i++) {
+  with ( v_1 ) {
+    with ( v_1 ) { }
+  }
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1641.js b/deps/jerry/tests/jerry/regression-test-issue-1641.js
new file mode 100644 (file)
index 0000000..f642bfb
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+var result = "0".split(RegExp.prototype);
+
+assert(result.length === 1);
+assert(result[0] === "0");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1657.js b/deps/jerry/tests/jerry/regression-test-issue-1657.js
new file mode 100644 (file)
index 0000000..30d441e
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+/* Negative out-of-range years should NOT cause hangs. */
+new Date(-565224, 1);
+Date.UTC(-565224, 1);
+new Date().setFullYear(-565224);
+new Date().setUTCFullYear(-565224);
+new Date().setYear(-565224);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1829.js b/deps/jerry/tests/jerry/regression-test-issue-1829.js
new file mode 100644 (file)
index 0000000..006f3e2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+for ({ get 10() {} } ; ; ) break;
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1830.js b/deps/jerry/tests/jerry/regression-test-issue-1830.js
new file mode 100644 (file)
index 0000000..23a1e79
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+/[\꧿]ౘ/
+
+var r = new RegExp ("[\꧿]ౘ");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1833.js b/deps/jerry/tests/jerry/regression-test-issue-1833.js
new file mode 100644 (file)
index 0000000..7c08601
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+'\
+'
diff --git a/deps/jerry/tests/jerry/regression-test-issue-1855.js b/deps/jerry/tests/jerry/regression-test-issue-1855.js
new file mode 100644 (file)
index 0000000..8eadaca
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert ((1 / 0*(-1)) == -Infinity);
+assert ((1 / 0*1) == Infinity);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-195.js b/deps/jerry/tests/jerry/regression-test-issue-195.js
new file mode 100644 (file)
index 0000000..0896882
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+function Error() { }
diff --git a/deps/jerry/tests/jerry/regression-test-issue-212.js b/deps/jerry/tests/jerry/regression-test-issue-212.js
new file mode 100644 (file)
index 0000000..b817f2f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+with(0xB276)
+  eval("foo = true;");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-245.js b/deps/jerry/tests/jerry/regression-test-issue-245.js
new file mode 100644 (file)
index 0000000..22b71f2
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+try
+{
+  v_0 = new RegExp("N(?![^6](?:.)|(?!C[^k-o]*|p){0,}|H)|\\\\xDF\\db{0,}|i\\\\0?)");
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof SyntaxError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-255.js b/deps/jerry/tests/jerry/regression-test-issue-255.js
new file mode 100644 (file)
index 0000000..0b74749
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+v_0 = /(?!(?!l{666,}))/;
+
+try
+{
+  v_0.exec("llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll");
+}
+catch (e)
+{
+  assert (e instanceof RangeError);
+  assert (e.message === "RegExp executor steps limit is exceeded.");
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-257.js b/deps/jerry/tests/jerry/regression-test-issue-257.js
new file mode 100644 (file)
index 0000000..6c77212
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var r;
+r = new RegExp("]");
+assert (r.exec("]") == "]");
+
+r = new RegExp("}");
+assert (r.exec("}") == "}");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-260.js b/deps/jerry/tests/jerry/regression-test-issue-260.js
new file mode 100644 (file)
index 0000000..fe53ad4
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+try {
+  isNaN(__proto__);
+} catch (e) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-261.js b/deps/jerry/tests/jerry/regression-test-issue-261.js
new file mode 100644 (file)
index 0000000..3745fb6
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+try {
+  SyntaxError(RegExp());
+  isFinite(foo);
+} catch (e) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-262.js b/deps/jerry/tests/jerry/regression-test-issue-262.js
new file mode 100644 (file)
index 0000000..479946c
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+try {
+    RegExp("");
+    eval(encodeURI(isNaN(__proto__)));
+} catch (e) { }
diff --git a/deps/jerry/tests/jerry/regression-test-issue-263.js b/deps/jerry/tests/jerry/regression-test-issue-263.js
new file mode 100644 (file)
index 0000000..268499c
--- /dev/null
@@ -0,0 +1,42 @@
+// 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.
+
+try {
+    Boolean(decodeURI(decodeURIComponent(Number())));
+} catch(err) {}
+ try {
+    ReferenceError(isNaN(__proto__));
+ } catch(err) {}
+ try {
+    isNaN(__proto__);
+ } catch(err) {}
+ try {
+    load();
+ } catch(err) {}
+ try {
+    RegExp("\n");
+ } catch(err) {}
+ try {} catch(err) {}
+ try {
+    ReferenceError(performance.__proto__.isPrototypeOf(arguments.map(os)));
+ } catch(err) {}
+ try {
+    Float64Array(performance,WeakSet(),Infinity.valueOf());
+ } catch(err) {}
+ try {
+    arguments.push(Int8Array(Boolean(isFinite(quit())),ArrayBuffer(os.system()),Array(read())));
+ } catch(err) {}
+ try {
+    Boolean(encodeURI(DataView(ArrayBuffer(os),parseFloat(Set()),URIError(Object(Int8Array(Function(parseInt(write(),RangeError(__proto__.valueOf()))),Int16Array(Map(),__proto__.valueOf(),readbuffer()),Math))))));
+ } catch(err) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-264.js b/deps/jerry/tests/jerry/regression-test-issue-264.js
new file mode 100644 (file)
index 0000000..968da47
--- /dev/null
@@ -0,0 +1,44 @@
+// 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.
+
+try {
+    Boolean(decodeURI(decodeURIComponent(Number())));
+ } catch(err) {}
+ try {
+    ReferenceError(isNaN(__proto__));
+ } catch(err) {}
+ try {
+    isNaN(__proto__);
+ } catch(err) {}
+ try {
+    load();
+ } catch(err) {}
+ try {
+    RegExp("\n");
+ } catch(err) {}
+ try {
+    Set();
+ } catch(err) {}
+ try {
+    ReferenceError(performance.__proto__.isPrototypeOf(arguments.map(os)));
+ } catch(err) {}
+ try {
+    Float64Array(performance,WeakSet(),Infinity.valueOf());
+ } catch(err) {}
+ try {
+    arguments.push(Int8Array(Boolean(isFinite(quit())),ArrayBuffer(os.system()),Array(read())));
+ } catch(err) {}
+ try {
+    Boolean(encodeURI(DataView(ArrayBuffer(os),parseFloat(Set()),URIError(Object(Int8Array(Function(parseInt(write(),RangeError(__proto__.valueOf()))),Int16Array(Map(),__proto__.valueOf(),readbuffer()),Math))))));
+ } catch(err) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-265.js b/deps/jerry/tests/jerry/regression-test-issue-265.js
new file mode 100644 (file)
index 0000000..898f6a6
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+parseInt(NaN,RegExp("54"));
+
+try {
+    parseInt(ArrayBuffer());
+} catch(err) {}
+
+try {
+    isNaN(__proto__);
+} catch(err) {}
+
+try {
+    RangeError(parseInt(Infinity,readbuffer()));
+} catch (err) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-266.js b/deps/jerry/tests/jerry/regression-test-issue-266.js
new file mode 100644 (file)
index 0000000..3b6280a
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+try {
+    String("test");
+    isNaN(__proto__);
+} catch(err) {}
+
+try {
+    SyntaxError(RegExp("[/]"));
+} catch(err) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-267.js b/deps/jerry/tests/jerry/regression-test-issue-267.js
new file mode 100644 (file)
index 0000000..69a7f08
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+try {
+    RegExp("\u2029");
+} catch(err) {}
+
+try {
+    URIError(isNaN(__proto__));
+} catch(err) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-274.js b/deps/jerry/tests/jerry/regression-test-issue-274.js
new file mode 100644 (file)
index 0000000..b698131
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+'�'
diff --git a/deps/jerry/tests/jerry/regression-test-issue-276.js b/deps/jerry/tests/jerry/regression-test-issue-276.js
new file mode 100644 (file)
index 0000000..a425da5
--- /dev/null
@@ -0,0 +1,37 @@
+// 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.
+
+/* 256 "a" in the array */
+
+try {
+      ["a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+        "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a",
+          "a", "a", "a", "a"];
+} catch(e) { }
diff --git a/deps/jerry/tests/jerry/regression-test-issue-279.js b/deps/jerry/tests/jerry/regression-test-issue-279.js
new file mode 100644 (file)
index 0000000..86fce28
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (isNaN (parseInt (RegExp ("\u2029"))));
diff --git a/deps/jerry/tests/jerry/regression-test-issue-280.js b/deps/jerry/tests/jerry/regression-test-issue-280.js
new file mode 100644 (file)
index 0000000..e27498b
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+function check_reference_error (s) {
+  try {
+    eval (s);
+    assert (false);
+  } catch (e) {
+    assert (e instanceof ReferenceError);
+  }
+}
+
+check_reference_error ('v_0 = {0: delete 3. instanceof foo() ^ {} }');
diff --git a/deps/jerry/tests/jerry/regression-test-issue-281.js b/deps/jerry/tests/jerry/regression-test-issue-281.js
new file mode 100644 (file)
index 0000000..59af4fb
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+while(false) foo
diff --git a/deps/jerry/tests/jerry/regression-test-issue-285.js b/deps/jerry/tests/jerry/regression-test-issue-285.js
new file mode 100644 (file)
index 0000000..e153a7f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+NaN == RegExp;
+NaN == Date;
diff --git a/deps/jerry/tests/jerry/regression-test-issue-312.js b/deps/jerry/tests/jerry/regression-test-issue-312.js
new file mode 100644 (file)
index 0000000..30e6bc9
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var res = RegExp.prototype.exec(10);
+
+assert (res[0] === "");
+assert (res.input === "10");
+assert (res.index === 0);
+assert (res.length === 1);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-316.js b/deps/jerry/tests/jerry/regression-test-issue-316.js
new file mode 100644 (file)
index 0000000..5317321
--- /dev/null
@@ -0,0 +1,40 @@
+// 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.
+
+try {
+  v_1 = RegExp.prototype.test;
+  v_1(ReferenceError);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+try {
+  v_1 = RegExp.prototype.exec;
+  v_1(ReferenceError);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+try {
+  v_1 = RegExp.prototype.toString;
+  v_1(ReferenceError);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-339.js b/deps/jerry/tests/jerry/regression-test-issue-339.js
new file mode 100644 (file)
index 0000000..663113d
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+try
+{
+  eval ('var y = 4e;');
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof SyntaxError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-340.js b/deps/jerry/tests/jerry/regression-test-issue-340.js
new file mode 100644 (file)
index 0000000..1efe487
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+'\0'+'456';
diff --git a/deps/jerry/tests/jerry/regression-test-issue-341.js b/deps/jerry/tests/jerry/regression-test-issue-341.js
new file mode 100644 (file)
index 0000000..3a448e5
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+try
+{
+  eval ('\xbf\x0a\x0a');
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof SyntaxError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-354.js b/deps/jerry/tests/jerry/regression-test-issue-354.js
new file mode 100644 (file)
index 0000000..cb013cb
--- /dev/null
@@ -0,0 +1,49 @@
+// 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.
+
+var data = {
+'1': '', '2': '', '3': '', '4': '', '5': '', '6': '', '7': '', '8': '',
+'9': '', '10': '', '11': '', '12': '', '13': '', '14': '', '15': '', '16': '',
+'17': '', '18': '', '19': '', '20': '', '21': '', '22': '', '23': '', '24': '',
+'25': '', '26': '', '27': '', '28': '', '29': '', '30': '', '31': '', '32': '',
+'33': '', '34': '', '35': '', '36': '', '37': '', '38': '', '39': '', '40': '',
+'41': '', '42': '', '43': '', '44': '', '45': '', '46': '', '47': '', '48': '',
+'49': '', '50': '', '51': '', '52': '', '53': '', '54': '', '55': '', '56': '',
+'57': '', '58': '', '59': '', '60': '', '61': '', '62': '', '63': '', '64': '',
+'65': '', '66': '', '67': '', '68': '', '69': '', '70': '', '71': '', '72': '',
+'73': '', '74': '', '75': '', '76': '', '77': '', '78': '', '79': '', '80': '',
+'81': '', '82': '', '83': '', '84': '', '85': '', '86': '', '87': '', '88': '',
+'89': '', '90': '', '91': '', '92': '', '93': '', '94': '', '95': '', '96': '',
+'97': '', '98': '', '99': '', '100': '', '101': '', '102': '', '103': '', '104': '',
+'105': '', '106': '', '107': '', '108': '', '109': '', '110': '', '111': '', '112': '',
+'113': '', '114': '', '115': '', '116': '', '117': '', '118': '', '119': '', '120': '',
+'121': '', '122': '', '123': '', '124': '', '125': '', '126': '', '127': '', '128': '',
+'129': '', '130': '', '131': '', '132': '', '133': '', '134': '', '135': '', '136': '',
+'137': '', '138': '', '139': '', '140': '', '141': '', '142': '', '143': '', '144': '',
+'145': '', '146': '', '147': '', '148': '', '149': '', '150': '', '151': '', '152': '',
+'153': '', '154': '', '155': '', '156': '', '157': '', '158': '', '159': '', '160': '',
+'161': '', '162': '', '163': '', '164': '', '165': '', '166': '', '167': '', '168': '',
+'169': '', '170': '', '171': '', '172': '', '173': '', '174': '', '175': '', '176': '',
+'177': '', '178': '', '179': '', '180': '', '181': '', '182': '', '183': '', '184': '',
+'185': '', '186': '', '187': '', '188': '', '189': '', '190': '', '191': '', '192': '',
+'193': '', '194': '', '195': '', '196': '', '197': '', '198': '', '199': '', '200': '',
+'201': '', '202': '', '203': '', '204': '', '205': '', '206': '', '207': '', '208': '',
+'209': '', '210': '', '211': '', '212': '', '213': '', '214': '', '215': '', '216': '',
+'217': '', '218': '', '219': '', '220': '', '221': '', '222': '', '223': '', '224': '',
+'225': '', '226': '', '227': '', '228': '', '229': '', '230': '', '231': '', '232': '',
+'233': '', '234': '', '235': '', '236': '', '237': '', '238': '', '239': '', '240': '',
+'241': '', '242': '', '243': '', '244': '', '245': '', '246': '', '247': '', '248': '',
+'249': '', '250': '', '251': '', '252': '', '253': '', '254': '', '255': '',
+'256': '',
+};
diff --git a/deps/jerry/tests/jerry/regression-test-issue-359.js b/deps/jerry/tests/jerry/regression-test-issue-359.js
new file mode 100644 (file)
index 0000000..6d8a05b
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+function f_0(a_0) {
+    "use strict";
+    Object.freeze({a: "foo"});
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-380.js b/deps/jerry/tests/jerry/regression-test-issue-380.js
new file mode 100644 (file)
index 0000000..ed84633
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+var v_0 = [];
+var v_1 = [['\u200E', '\u0601', '\u0602', '\u0603', '\u06DD', '\u070F'],[0x1107, 0x1175, 0x11B0]];
+v_0[v_1];
diff --git a/deps/jerry/tests/jerry/regression-test-issue-381.js b/deps/jerry/tests/jerry/regression-test-issue-381.js
new file mode 100644 (file)
index 0000000..1847813
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+function f_0(){
+    'use strict';
+    var v_0 = {
+        p_0: function(a_0, a_1) {}
+    };
+    f_1(function(a_2) {});
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-429.js b/deps/jerry/tests/jerry/regression-test-issue-429.js
new file mode 100644 (file)
index 0000000..c752c49
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+var v_0 = [
+    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+    64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+    80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+    96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
+    112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
+    128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
+    144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
+    160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
+    176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
+    192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
+    208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
+    224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
+    240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
+];
diff --git a/deps/jerry/tests/jerry/regression-test-issue-440.js b/deps/jerry/tests/jerry/regression-test-issue-440.js
new file mode 100644 (file)
index 0000000..184992b
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+(function () {
+  var d = {};
+  var a = [arguments];
+})();
diff --git a/deps/jerry/tests/jerry/regression-test-issue-447.js b/deps/jerry/tests/jerry/regression-test-issue-447.js
new file mode 100644 (file)
index 0000000..9c23618
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+try
+{
+  for (v_0 in v_1) {};
+  f_0(v_2.v_3 === 5);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-453.js b/deps/jerry/tests/jerry/regression-test-issue-453.js
new file mode 100644 (file)
index 0000000..02f15fa
--- /dev/null
@@ -0,0 +1,24 @@
+// 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.
+
+try {
+    var v_0 = [
+        ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,     
+        ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,     
+        ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,     
+        ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,     
+        ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,     
+        ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,     ];
+    }
+catch(e) {}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-541.js b/deps/jerry/tests/jerry/regression-test-issue-541.js
new file mode 100644 (file)
index 0000000..fc6664e
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+new RegExp("m\u2820");
+parseInt("145");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-563.js b/deps/jerry/tests/jerry/regression-test-issue-563.js
new file mode 100644 (file)
index 0000000..1d6ed13
--- /dev/null
@@ -0,0 +1,31 @@
+// 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.
+
+try {
+  eval('if (true) /abc/.exec("abc");');
+} catch (e) {
+  assert (false);
+}
+
+try {
+  eval('if (true) {} /abc/.exec("abc");');
+} catch (e) {
+  assert (false);
+}
+
+try {
+  eval('var a\n/abc/.exec("abc");');
+} catch (e) {
+  assert (false);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-566.js b/deps/jerry/tests/jerry/regression-test-issue-566.js
new file mode 100644 (file)
index 0000000..c08ef50
--- /dev/null
@@ -0,0 +1,46 @@
+// 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.
+
+var setMethods =
+[
+    "setTime",
+    "setMilliseconds",
+    "setSeconds",
+    "setUTCMilliseconds",
+    "setSeconds",
+    "setUTCSeconds",
+    "setMinutes",
+    "setUTCMinutes",
+    "setHours",
+    "setUTCHours",
+    "setDate",
+    "setUTCDate",
+    "setMonth",
+    "setUTCMonth",
+    "setFullYear",
+    "setUTCFullYear"
+]
+
+for(var i in setMethods)
+{
+  var setMethod = setMethods[i];
+  try
+  {
+    ({method: Date.prototype[setMethod]}).method(0);
+  }
+  catch (e)
+  {
+    assert(e instanceof TypeError);
+  }
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-612.js b/deps/jerry/tests/jerry/regression-test-issue-612.js
new file mode 100644 (file)
index 0000000..e0fe6ce
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+var result = RegExp.prototype.compile([]);
+assert(result === undefined);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-613.js b/deps/jerry/tests/jerry/regression-test-issue-613.js
new file mode 100644 (file)
index 0000000..5c87583
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+a = "é"
diff --git a/deps/jerry/tests/jerry/regression-test-issue-614.js b/deps/jerry/tests/jerry/regression-test-issue-614.js
new file mode 100644 (file)
index 0000000..caa76fe
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+JSON.stringify & (Date = 1);
+
+b = 1;
+this.a = 2;
+this.a
+b = 3;
+assert(b == 3);
+assert(a == 2);
+this.a & (b = 4);
+assert(b == 4);
+assert(a == 2);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-639.js b/deps/jerry/tests/jerry/regression-test-issue-639.js
new file mode 100644 (file)
index 0000000..e0bcb6d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+function f_0() {
+      var f_0 = print;
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-640.js b/deps/jerry/tests/jerry/regression-test-issue-640.js
new file mode 100644 (file)
index 0000000..e9d4df2
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+function f_0() {
+  var f_0 = 10;
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-641.js b/deps/jerry/tests/jerry/regression-test-issue-641.js
new file mode 100644 (file)
index 0000000..bfc0d7c
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+try
+{
+  Object.freeze(RegExp.prototype.compile)();
+  assert(false);
+}
+catch (e)
+{
+  assert(e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-642.js b/deps/jerry/tests/jerry/regression-test-issue-642.js
new file mode 100644 (file)
index 0000000..b15f07f
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+Function.prototype.length = function() {};
+Function.prototype.bind(0);
+assert (Function.prototype.length === 0);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-644.js b/deps/jerry/tests/jerry/regression-test-issue-644.js
new file mode 100644 (file)
index 0000000..a98fa76
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+function a()
+{
+  for (i = 1; i < 5; i++)
+    if (i) {
+      5;
+    }
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-646.js b/deps/jerry/tests/jerry/regression-test-issue-646.js
new file mode 100644 (file)
index 0000000..4874e51
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+var a;
+
+(a) = 1;
+
+assert (a === 1);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-652.js b/deps/jerry/tests/jerry/regression-test-issue-652.js
new file mode 100644 (file)
index 0000000..3b9afe8
--- /dev/null
@@ -0,0 +1,31 @@
+// 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.
+
+try {
+  eval("this / 10");
+} catch (e) {
+  assert (false);
+}
+
+try {
+  eval("var v_0 = 10;\nv_0++ / 1");
+} catch (e) {
+  assert (false);
+}
+
+try {
+  eval("var v_0 = 10;\nif (v_0++ / 1) {\n}");
+} catch (e) {
+  assert (false);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-653.js b/deps/jerry/tests/jerry/regression-test-issue-653.js
new file mode 100644 (file)
index 0000000..1564ef9
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var a = "foo", r;
+switch(a) {
+    case true ? "foo" : "bar":
+        r = "OK";
+        break;
+}
+assert(r === "OK");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-654.js b/deps/jerry/tests/jerry/regression-test-issue-654.js
new file mode 100644 (file)
index 0000000..d3105ea
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+switch (true) {
+    case {"foo": "bar"}:
+        break;
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-655.js b/deps/jerry/tests/jerry/regression-test-issue-655.js
new file mode 100644 (file)
index 0000000..e09dc1d
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+try {
+  eval("if (true) {}\n/a/;");
+} catch (e) {
+  assert (false);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-667.js b/deps/jerry/tests/jerry/regression-test-issue-667.js
new file mode 100644 (file)
index 0000000..8345b15
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+switch (1) {
+  case 0:
+    assert(false);
+    break;
+  case 2:
+    assert(false);
+    break;
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-669.js b/deps/jerry/tests/jerry/regression-test-issue-669.js
new file mode 100644 (file)
index 0000000..0c7afde
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+function f(){return}
+
+switch (1) {
+  case 1:
+    break}
+
+while (false) {continue}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-680.js b/deps/jerry/tests/jerry/regression-test-issue-680.js
new file mode 100644 (file)
index 0000000..15e6a95
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+try
+{
+  f1(function(a1){});
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+}
+
+var x = {
+foo: function () { throw new TypeError("bar"); }
+};
diff --git a/deps/jerry/tests/jerry/regression-test-issue-686.js b/deps/jerry/tests/jerry/regression-test-issue-686.js
new file mode 100644 (file)
index 0000000..63a8693
--- /dev/null
@@ -0,0 +1,32 @@
+// 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.
+
+function check_syntax_error (code) {
+  try {
+    eval(code);
+    assert (false);
+  } catch (e) {
+    assert (e instanceof SyntaxError);
+  }
+}
+
+check_syntax_error ("function eval () {'use strict';}");
+check_syntax_error ("function f (eval) {'use strict';}");
+check_syntax_error ("function arguments () {'use strict';}");
+check_syntax_error ("function f (arguments) {'use strict';}");
+
+check_syntax_error ("(function eval () {'use strict';})");
+check_syntax_error ("(function f (eval) {'use strict';})");
+check_syntax_error ("(function arguments () {'use strict';})");
+check_syntax_error ("(function f (arguments) {'use strict';})");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-689.js b/deps/jerry/tests/jerry/regression-test-issue-689.js
new file mode 100644 (file)
index 0000000..d17ba18
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+'use strict';
+
+function f (g) {
+  new g ({prop_name: 'value'});
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-703.js b/deps/jerry/tests/jerry/regression-test-issue-703.js
new file mode 100644 (file)
index 0000000..e2bcac8
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+function f(a, b) {
+  return {
+    a: a,
+    b: b
+  };
+}
+
+var o = f('1', '2');
+
+assert(o.a == '1');
+assert(o.b == '2');
diff --git a/deps/jerry/tests/jerry/regression-test-issue-725.js b/deps/jerry/tests/jerry/regression-test-issue-725.js
new file mode 100644 (file)
index 0000000..5152df0
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+try {
+       eval("switch(foo){} {}");
+       assert(false);
+} catch (e) {
+       assert(e instanceof ReferenceError);
+}
+
diff --git a/deps/jerry/tests/jerry/regression-test-issue-736.js b/deps/jerry/tests/jerry/regression-test-issue-736.js
new file mode 100644 (file)
index 0000000..9d31f73
--- /dev/null
@@ -0,0 +1,39 @@
+// 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.
+
+var code = 'try\n\
+{\n\
+  print({toStSing:!function() { throw new TypeError("foo"); }}, []);t (false);\n\
+}\n\
+catch (e)\n\
+{\n\
+  assert*(e instanceof\n\
+  assert );\n\
+  asstrt (e.a%e === "foo");\n\
+}';
+
+try {
+  eval(code);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+try {
+  eval("var x = {}; x instanceof assert;");
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
diff --git a/deps/jerry/tests/jerry/regression-test-issue-737.js b/deps/jerry/tests/jerry/regression-test-issue-737.js
new file mode 100644 (file)
index 0000000..a36683b
--- /dev/null
@@ -0,0 +1,68 @@
+// 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.
+
+function check_syntax_error (s) {
+  try {
+    eval (s);
+    assert (false);
+  } catch (e) {
+    assert (e instanceof SyntaxError);
+  }
+}
+
+/* Test case #1 */
+check_syntax_error (
+" new function f(f) {                                \
+  return {className: 'xxx'};                         \
+};                                                   \
+x = 1;                                               \
+function g(active) {                                 \
+  for (i = 1; i <= 1000; i++) { if (i == active) {   \
+  x = i;   if (f(\"\" + i) != null) { }              \
+    } else {                                         \
+  if (f(\"\" + i) != null) }                         \
+  }                                                  \
+}                                                    \
+g(0)                                                 \
+");
+
+/* Test case #2 */
+check_syntax_error (
+" new function a(a) {;for (f in [1,2,3]) print(f);   \
+}; 1;                                                \
+function g(active) {                                 \
+  for (i = 1; i <= 1000; i++) { if (i == active) {   \
+  xI                                                 \
+      if (f != null) { }                             \
+    } else {                                         \
+  if (f(\"\" + i) != null) }                         \
+  }                                                  \
+}                                                    \
+g(0)                                                 \
+");
+
+/* Test case #3 */
+check_syntax_error (
+" new function f(f) {;for (f in [1,2,3]) pRint(f);   \
+}; 1;                                                \
+function g(active) {                                 \
+  for (i = 1; i <= 1000; i++) { if (i == active) {   \
+  x                                                  \
+      if (f != null) { }                             \
+    } else {                                         \
+  if (f(\"\" + i) != null) }                         \
+  }                                                  \
+}                                                    \
+g(0)                                                 \
+");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-738.js b/deps/jerry/tests/jerry/regression-test-issue-738.js
new file mode 100644 (file)
index 0000000..2214cf0
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+function g() {};for (B in Boolean) print(f);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-739.js b/deps/jerry/tests/jerry/regression-test-issue-739.js
new file mode 100644 (file)
index 0000000..3b34e28
--- /dev/null
@@ -0,0 +1,41 @@
+// 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.
+
+try {
+  var res = RegExp.prototyj_l;
+  obj_l = obj;
+
+  for (var k = 0; k < 1500; k++)
+  {
+    obj_l.prop = {};
+    obj_l = obj_l.prop;
+  }
+
+  function f (f, i) {
+    if (--i > 0) {
+      f ({a:o, b:o}, i);
+    }
+  }
+
+  for (var i = 0; i < 100; i++)
+  {
+    ({} + f ({}, 12));
+  }
+
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-741.js b/deps/jerry/tests/jerry/regression-test-issue-741.js
new file mode 100644 (file)
index 0000000..5533cb0
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+var a = JSON.stringify (b=+'�');
+
+assert(a === "null");
+
+var b = JSON.stringify (b=-'�0001');
+
+assert(b === "null");
+
+var c = JSON.stringify (b=+'�');
+
+assert(c === "null");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-743.js b/deps/jerry/tests/jerry/regression-test-issue-743.js
new file mode 100644 (file)
index 0000000..484f16a
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+function Error(Error) { }
diff --git a/deps/jerry/tests/jerry/regression-test-issue-745.js b/deps/jerry/tests/jerry/regression-test-issue-745.js
new file mode 100644 (file)
index 0000000..0e458bc
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+try {
+  eval("7E9.");
+  assert(false);
+} catch (e) {
+  assert(e instanceof SyntaxError);
+}
+
+assert(7E9.toString() === "7000000000");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-747.js b/deps/jerry/tests/jerry/regression-test-issue-747.js
new file mode 100644 (file)
index 0000000..6c02c8f
--- /dev/null
@@ -0,0 +1,16 @@
+// 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.
+
+assert (''.replace(/$/g,"a") === "a");
+assert (''.replace(/^/g,"a") === "a");
diff --git a/deps/jerry/tests/jerry/regression-test-issue-781.js b/deps/jerry/tests/jerry/regression-test-issue-781.js
new file mode 100644 (file)
index 0000000..2d36d75
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+try
+{
+  Function (Array.isArray);
+  assert (false);
+}
+catch (e)
+{ 
+  assert (e instanceof SyntaxError);
+}
+
+try { Function(TypeError.prototype) } catch (err) { }
diff --git a/deps/jerry/tests/jerry/regression-test-issue-782.js b/deps/jerry/tests/jerry/regression-test-issue-782.js
new file mode 100644 (file)
index 0000000..ecc56ac
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+try
+{
+  String.prototype.search(RegExp.prototype);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-783.js b/deps/jerry/tests/jerry/regression-test-issue-783.js
new file mode 100644 (file)
index 0000000..44644f2
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+RegExp.prototype.compile(RegExp.prototype);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-785.js b/deps/jerry/tests/jerry/regression-test-issue-785.js
new file mode 100644 (file)
index 0000000..e785eb7
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+try { RegExp.prototype.toString() } catch (err) {  }
+try { isNaN.apply(unescape, JSON.stringify) } catch (err) {  }
+try { Array.prototype.forEach(eval) } catch (err) {  }
+try { RegExp.prototype.compile(RegExp.prototype) } catch (err) {  }
diff --git a/deps/jerry/tests/jerry/regression-test-issue-786.js b/deps/jerry/tests/jerry/regression-test-issue-786.js
new file mode 100644 (file)
index 0000000..dd4fa03
--- /dev/null
@@ -0,0 +1,42 @@
+// 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.
+
+try { RegExp.prototype.toString() } catch (err) {  }
+try { Date.prototype.toTimeString() } catch (err) {  }
+try { Boolean.prototype.toString() } catch (err) {  }
+try { String.prototype.match(isNaN) } catch (err) {  }
+try { Math.round(Math.atan) } catch (err) {  }
+try { Date.prototype.getUTCDay() } catch (err) {  }
+try { toLocaleString() } catch (err) {  }
+try { Array.prototype.join(String.prototype.split) } catch (err) {  }
+try { Date.prototype.getSeconds() } catch (err) {  }
+try { isNaN.apply(Date.prototype.toISOString, String.prototype.split) } catch (err) {  }
+try { Math.cos(Object) } catch (err) {  }
+try { Math.floor(Date.prototype.getUTCSeconds) } catch (err) {  }
+try { isNaN.apply(assert, JSON.stringify) } catch (err) {  }
+try { Number.prototype.toLocaleString() } catch (err) {  }
+try { Date.prototype.getTimezoneOffset() } catch (err) {  }
+try { Date.prototype.setMinutes(Object.getOwnPropertyDescriptor,  Object.getOwnPropertyNames) } catch (err) {  }
+try { Math.log(String.prototype.search) } catch (err) {  }
+try { ReferenceError(Object.defineProperty) } catch (err) {  }
+try { Array.prototype.filter(Number.prototype.toLocaleString) } catch (err) {  }
+try { Array.prototype.forEach(Date.prototype.getDay) } catch (err) {  }
+try { Object.defineProperty(SyntaxError.prototype, Date.prototype.setUTCMinutes, Math.max) } catch (err) {  }
+try { Date.prototype.setMilliseconds(String.prototype.localeCompare) } catch (err) {  }
+try { Math.asin(Date.prototype.getDay) } catch (err) {  }
+try { Array.prototype.some(Date.prototype.getDay) } catch (err) {  }
+try { String.prototype.charCodeAt(toString) } catch (err) {  }
+try { isPrototypeOf(Math.tan) } catch (err) {  }
+try { Object.isFrozen(print) } catch (err) {  }
+try { RegExp.prototype.compile(RegExp.prototype) } catch (err) {  }
diff --git a/deps/jerry/tests/jerry/regression-test-issue-787.js b/deps/jerry/tests/jerry/regression-test-issue-787.js
new file mode 100644 (file)
index 0000000..6b8692b
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+Array.prototype.push(Math.sin);
+Object.freeze(Array.prototype);
+String.prototype.match(String.prototype);
diff --git a/deps/jerry/tests/jerry/regression-test-issue-798.js b/deps/jerry/tests/jerry/regression-test-issue-798.js
new file mode 100644 (file)
index 0000000..8476cbb
--- /dev/null
@@ -0,0 +1,38 @@
+// 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.
+
+var a = {}, b = 0;
+
+while (a[b]) {
+  assert (false);
+}
+
+for ( ; a[b]; ) {
+  assert (false);
+}
+
+var flag = false;
+do
+{
+  assert (!flag);
+  flag = true;
+} while (a[b]);
+
+a = { };
+a.b = { c : 1 };
+
+with (a.b)
+{
+  assert (c === 1);
+}
diff --git a/deps/jerry/tests/jerry/regression-test-issue-962.js b/deps/jerry/tests/jerry/regression-test-issue-962.js
new file mode 100644 (file)
index 0000000..8b4910b
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+function re_test (pattern, string, expected)
+{
+  assert ((new RegExp(pattern)).exec(string) == expected);
+}
+
+re_test("[\\u0020]", "u", null);
+re_test("[\\u0020]", " ", " ");
+re_test("[\\u0020]", "x", null);
+
+re_test("[\\x20]", "u", null);
+re_test("[\\x20]", " ", " ");
+re_test("[\\x20]", "x", null);
diff --git a/deps/jerry/tests/jerry/regression-test-issues-43-183.js b/deps/jerry/tests/jerry/regression-test-issues-43-183.js
new file mode 100644 (file)
index 0000000..544ff9f
--- /dev/null
@@ -0,0 +1,56 @@
+// 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.
+
+function check_syntax_error (script)
+{
+  try
+  {
+    eval (script);
+    assert (false);
+  }
+  catch (e)
+  {
+    assert (e instanceof SyntaxError);
+  }
+}
+
+check_syntax_error ('{');
+check_syntax_error ('}');
+check_syntax_error ('[');
+check_syntax_error (']');
+check_syntax_error ('(');
+check_syntax_error (')');
+
+check_syntax_error ('function f (');
+check_syntax_error ('function f ()');
+check_syntax_error ('function f () {');
+check_syntax_error ('function f () }');
+check_syntax_error ('function f ({) }');
+check_syntax_error ('function f { }');
+check_syntax_error ('function f {');
+check_syntax_error ('function f }');
+
+check_syntax_error ('a = [[];');
+
+check_syntax_error ('a = {;');
+check_syntax_error ('a = };');
+check_syntax_error ('a = {{};');
+
+check_syntax_error ('a = {get q {} };');
+check_syntax_error ('a = {get q ( {} };');
+check_syntax_error ('a = {get q ) {} };');
+check_syntax_error ('a = {get q () };');
+check_syntax_error ('a = {get q () { };');
+check_syntax_error ('a = {get q () };');
+check_syntax_error ('a = {get q () { };');
diff --git a/deps/jerry/tests/jerry/relational.js b/deps/jerry/tests/jerry/relational.js
new file mode 100644 (file)
index 0000000..a9a6a3e
--- /dev/null
@@ -0,0 +1,35 @@
+// 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.
+
+assert((7 < 4) == false);
+assert((7 > 4) == true);
+
+assert((7 <= 11) == true);
+assert((11 <= 11) == true);
+
+assert((7 >= 11) == false);
+assert((7 >= 7) == true);
+
+assert(0 > (0 - 'Infinity'));
+assert(0 < (0 - '-Infinity'));
+assert((0 - 'Infinity') < (0 - '-Infinity'));
+
+assert('a' > '');
+assert(!('' < ''));
+assert(!('' > ''));
+assert('abcd' > 'abc');
+assert('abc' < 'abcd');
+assert('abcd' <= 'abcd');
+assert('abcd' >= 'abcd');
+assert(!('abcd' > 'abcd'));
diff --git a/deps/jerry/tests/jerry/shift.js b/deps/jerry/tests/jerry/shift.js
new file mode 100644 (file)
index 0000000..442a602
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+assert((9 << 2) === 36);
+assert((14 << 2) === 56);
+
+assert((9 >> 2) === 2);
+assert((-14 >> 2) === -4);
+
+assert((9 >>> 2) === (9 >> 2));
diff --git a/deps/jerry/tests/jerry/sqrt.js b/deps/jerry/tests/jerry/sqrt.js
new file mode 100644 (file)
index 0000000..3d3c734
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+
+assert(isNaN(Math['sqrt'] (NaN)));
+assert(isNaN(Math['sqrt'] (-1.0)));
+assert(isNaN(Math['sqrt'] (-Infinity)));
+assert(Math['sqrt'] (0.0) === 0.0);
+assert(Math['sqrt'] (Infinity) === Infinity);
+
+assert(Math['sqrt'] (1.0) === 1.0);
+assert(Math['sqrt'] (2.0) >= Math['SQRT2'] * 0.999999);
+assert(Math['sqrt'] (2.0) <= Math['SQRT2'] * 1.000001);
+assert(Math['sqrt'] (0.5) >= Math['SQRT1_2'] * 0.999999);
+assert(Math['sqrt'] (0.5) <= Math['SQRT1_2'] * 1.000001);
+
+var sqrt_1e38 = Math['sqrt'] (1.0e+38);
+assert(sqrt_1e38 > 0.999999 * 1.0e+19);
+assert(sqrt_1e38 < 1.000001 * 1.0e+19);
+
+var sqrt_1e38 = Math['sqrt'] (1.0e-38);
+assert(sqrt_1e38 > 0.999999 * 1.0e-19);
+assert(sqrt_1e38 < 1.000001 * 1.0e-19);
diff --git a/deps/jerry/tests/jerry/strict.js b/deps/jerry/tests/jerry/strict.js
new file mode 100644 (file)
index 0000000..8bd33c3
--- /dev/null
@@ -0,0 +1,76 @@
+// 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.
+
+'use strict';
+
+var temp;
+
+try
+{
+  a = 1;
+
+  assert (false);
+} catch (e)
+{
+  assert (e instanceof ReferenceError);
+}
+
+try
+{
+  NaN = 1;
+
+  assert (false);
+} catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+function f()
+{
+  assert(this === undefined);
+}
+
+f();
+
+Object.function_prop = function ()
+{
+  assert (this === Object);
+}
+
+Object.function_prop ();
+
+try
+{
+  var temp = f.caller;
+
+  assert (false);
+} catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+try
+{
+  delete this.NaN;
+
+  assert (false);
+} catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+(function (a) {
+  (function (a) {
+  });
+});
diff --git a/deps/jerry/tests/jerry/string-prototype-charat.js b/deps/jerry/tests/jerry/string-prototype-charat.js
new file mode 100644 (file)
index 0000000..68daf68
--- /dev/null
@@ -0,0 +1,111 @@
+// 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.
+
+// check properties
+assert(Object.getOwnPropertyDescriptor(String.prototype.charAt, 'length').configurable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.charAt, 'length').enumerable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.charAt, 'length').writable === false);
+
+assert(String.prototype.charAt.length === 1);
+
+// check empty string
+assert(String.prototype.charAt.call(new String()) === "");
+
+// check NaN
+assert("hello world!".charAt(NaN) === "h");
+
+// check Object
+assert(String.prototype.charAt.call({})  === "[");
+
+// simple checks
+assert("hello world!".charAt(0) === "h");
+
+assert("hello world!".charAt(1) === "e");
+
+// check +-Inf
+assert("hello world!".charAt(-Infinity) === "");
+
+assert("hello world!".charAt(Infinity) === "");
+
+assert("hello world!".charAt(11) === "!");
+
+assert("hello world!".charAt(12) === "");
+
+// check unicode
+assert("hello\u000B\u000C\u0020\u00A0world!".charAt(8) === "\u00A0");
+
+assert("hello\uD834\uDF06world!".charAt(6) === "\uDF06");
+
+assert("hell\u006F\u006F w\u006F\u006Frld!".charAt(8) === "\u006F");
+
+assert("\u00A9\u006F".charAt(2) === "");
+
+// check negative
+assert("hello world!".charAt(-1) === "");
+
+assert("hello world!".charAt(-9999999) === "");
+
+assert("hello world!".charAt(-0) === "h");
+
+// check undefined
+assert("hello world!".charAt(undefined) === "h");
+
+// check booleans
+assert("hello world!".charAt(true) === "e");
+
+assert("hello world!".charAt(false) === "h");
+
+// check this is undefined
+try {
+  String.prototype.charAt.call(undefined);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// check this is null
+try {
+  String.prototype.charAt.call(null);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - undefined
+try {
+  assert(true.charAt() === "");
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - null
+try {
+  assert(String.prototype.charAt.call(null, 0) === "");
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - Boolean
+assert(String.prototype.charAt.call(true, 1) === "r");
+
+// check coercible - Object
+var test_object = {firstName:"John", lastName:"Doe"};
+assert(String.prototype.charAt.call(test_object, 1) === "o");
+
+// check coercible - Number
+assert(String.prototype.charAt.call(123, 2) === "3");
diff --git a/deps/jerry/tests/jerry/string-prototype-charcodeat.js b/deps/jerry/tests/jerry/string-prototype-charcodeat.js
new file mode 100644 (file)
index 0000000..bfb68f6
--- /dev/null
@@ -0,0 +1,98 @@
+// 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.
+
+// check properties
+assert(Object.getOwnPropertyDescriptor(String.prototype.charCodeAt, 'length').configurable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.charCodeAt, 'length').enumerable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.charCodeAt, 'length').writable === false);
+
+assert(String.prototype.charCodeAt.length === 1);
+
+// check empty string
+assert(isNaN(String.prototype.charCodeAt.call(new String())));
+
+// check Object with NaN pos
+assert(String.prototype.charCodeAt.call({}) === 91);
+
+// simple checks
+assert("hello world!".charCodeAt(0) === 104);
+
+assert("hello world!".charCodeAt(1) === 101);
+
+assert("HELLO WORLD".charCodeAt(10) === 68);
+
+// check +-Inf
+assert(isNaN("hello world!".charCodeAt(-Infinity)));
+
+assert(isNaN("hello world!".charCodeAt(Infinity)));
+
+assert("hello world!".charCodeAt(11) === 33);
+
+assert(isNaN("hello world!".charCodeAt(12)));
+
+// check unicode
+assert("hello\u000B\u000C\u0020\u00A0world!".charCodeAt(8) === 160);
+
+assert("hello\uD834\uDF06world!".charCodeAt(6) === 57094);
+
+assert("hell\u006F\u006F w\u006F\u006Frld!".charCodeAt(8) === 111);
+
+assert(isNaN("\u00A9\u006F".charCodeAt(2)));
+
+// check negative
+assert(isNaN("hello world!".charCodeAt(-1)));
+
+assert(isNaN("hello world!".charCodeAt(-9999999)));
+
+assert("hello world!".charCodeAt(-0) === 104);
+
+// check undefined
+assert("hello world!".charCodeAt(undefined) === 104);
+
+// check booleans
+assert("hello world!".charCodeAt(true) === 101);
+
+assert("hello world!".charCodeAt(false) === 104);
+
+// check index above uint32_t
+assert(isNaN("hello world!".charCodeAt(4294967299)));
+
+// check coercible - undefined
+try {
+  assert(isNaN(String.prototype.charCodeAt.call(undefined)));
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - null
+try {
+  assert(isNaN(String.prototype.charCodeAt.call(null, 0)));
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - Boolean
+assert(String.prototype.charCodeAt.call(true, 1) === 114);
+assert(String.prototype.charCodeAt.call(true) === 116);
+
+// check coercible - Object
+var test_object = {firstName:"John", lastName:"Doe"};
+assert(String.prototype.charCodeAt.call(test_object, 1) === 111);
+
+// check coercible - Number
+assert(String.prototype.charCodeAt.call(123, 2) === 51);
diff --git a/deps/jerry/tests/jerry/string-prototype-concat.js b/deps/jerry/tests/jerry/string-prototype-concat.js
new file mode 100644 (file)
index 0000000..c001903
--- /dev/null
@@ -0,0 +1,60 @@
+// 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.
+
+// check properties
+assert(Object.getOwnPropertyDescriptor(String.prototype.concat, 'length').configurable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.concat, 'length').enumerable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.concat, 'length').writable === false);
+
+// simple checks
+var s1 = "Hello ";
+var s2 = "world!";
+var s3 = " ";
+assert(s1.concat(s2, s3, 3, 10, "  ", ".") === "Hello world! 310  .");
+assert("Hello ".concat(s1) === "Hello Hello ");
+
+assert(s1.concat(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9) === "Hello 012345678901234567890123456789");
+
+assert("".concat() === "");
+
+// check unicode
+assert("\u0041".concat("\u0041", "\u1041") === "\u0041\u0041\u1041");
+assert("\u0041\u1D306A".concat("\u0041", "\u1041") === "\u0041\u1D306A\u0041\u1041");
+
+// check undefined
+var y;
+assert("Check ".concat(y) === "Check undefined");
+
+// check toString error in this object
+var y = {};
+y.toString = function () { throw new ReferenceError ("foo");}
+y.concat = String.prototype.concat;
+try {
+  y.concat("cat");
+  assert(false);
+} catch (e) {
+  assert(e instanceof ReferenceError);
+}
+
+// check toString error in arguments
+var x = {};
+x.toString = function () { throw new ReferenceError ("foo");}
+try {
+  "a".concat(x);
+  assert(false);
+} catch (e) {
+  assert(e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/string-prototype-indexof.js b/deps/jerry/tests/jerry/string-prototype-indexof.js
new file mode 100644 (file)
index 0000000..a0b55fb
--- /dev/null
@@ -0,0 +1,113 @@
+// 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.
+
+// check properties
+assert(Object.getOwnPropertyDescriptor(String.prototype.indexOf, 'length').configurable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.indexOf, 'length').enumerable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.indexOf, 'length').writable === false);
+
+assert(String.prototype.indexOf.length === 1);
+
+assert("Hello world, welcome to the universe.".indexOf("welcome") === 13);
+
+assert("Hello world, welcome to the universe.".indexOf("Hello world, welcome to the universe.") === 0);
+
+assert("Hello world, welcome to the universe.".indexOf("welcome",10) == 13);
+
+assert("Hello world, welcome to the universe.".indexOf("welcome",-100) == 13);
+
+assert("Hello world, welcome to the universe.".indexOf("welcome", 15) === -1);
+
+assert("Hello world, welcome to the universe.".indexOf("o", 15) === 17);
+
+// check utf8 strings
+assert("\uFFA2".indexOf("\uFFA2") === 0);
+
+assert("\uFFA2".indexOf("A") === -1);
+
+assert("w2\uFFA2A".indexOf("A") === 3);
+
+assert("w2\u1D306A".indexOf("A") === 4);
+
+assert("\uD834\uDF06".indexOf("\uDF06") === 1);
+
+assert("\uD834\uDF06w2\u1D306D".indexOf("D") === 6);
+
+assert("\ud800\dc00".indexOf("\dc00") === 1);
+
+assert("\u8000\u0700\u8000\u8000A".indexOf("A", 3) === 4);
+
+// check prefix search
+assert("aaaabaaa".indexOf("aaaba") === 1);
+
+// check empty string
+assert(String.prototype.indexOf.call(new String()) === -1);
+
+assert(String.prototype.indexOf.call("","") === 0);
+
+// check NaN
+assert("Hello world, welcome to the universe.".indexOf(NaN) === -1);
+
+assert("Hello world, welcome to the universe.".indexOf("welcome",NaN) === 13);
+
+// check Object
+assert(String.prototype.indexOf.call({}) === -1);
+
+// check +-Inf
+assert("hello world!".indexOf("world", -Infinity) === 6);
+
+assert("hello world!".indexOf("world", Infinity) === -1);
+
+// check numbers
+assert("hello world!".indexOf(-1) === -1);
+
+assert("hello 0 world!".indexOf(-0) === 6);
+
+// check undefined
+assert("hello world!".indexOf(undefined) === -1);
+
+var undefined_var;
+assert("Hello world, welcome to the universe.".indexOf("welcome", undefined_var) === 13);
+
+// check booleans
+assert("true".indexOf(true, false) === 0);
+
+// check coercible - undefined
+try {
+  String.prototype.indexOf.call(undefined);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - null
+try {
+  String.prototype.indexOf.call(null);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - Boolean
+assert(String.prototype.indexOf.call(true, "e") === 3);
+assert(String.prototype.indexOf.call(false, "e") === 4);
+
+// check coercible - Object
+var test_object = {firstName:"John", lastName:"Doe"};
+assert(String.prototype.indexOf.call(test_object, "Obj") === 8);
+
+// check coercible - Number
+assert(String.prototype.indexOf.call(123, "2") === 1);
diff --git a/deps/jerry/tests/jerry/string-prototype-lastindexof.js b/deps/jerry/tests/jerry/string-prototype-lastindexof.js
new file mode 100644 (file)
index 0000000..ca90a78
--- /dev/null
@@ -0,0 +1,127 @@
+// 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.
+
+// check properties
+assert(Object.getOwnPropertyDescriptor(String.prototype.lastIndexOf, 'length').configurable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.lastIndexOf, 'length').enumerable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.lastIndexOf, 'length').writable === false);
+
+assert(String.prototype.lastIndexOf.length === 1);
+
+// simple checks
+assert("Hello welcome, welcome to the universe.".lastIndexOf("welcome") === 15);
+
+assert("Hello world, welcome to the universe.".lastIndexOf("Hello world, welcome to the universe.") === 0);
+
+assert("Hello welcome, welcome to the universe.".lastIndexOf("welcome", 5) === -1);
+
+assert("Hello welcome, welcome to the universe.".lastIndexOf("welcome", -100) == -1);
+
+assert("Hello welcome, welcome to the universe.".lastIndexOf("welcome", 15) === 15);
+
+assert("Hello welcome, welcome to the universe o.".lastIndexOf("o", 10) === 10);
+
+assert("Hello welcome, welcome to the universe o.".lastIndexOf("o", 25) === 24);
+
+assert("Helloooo woooorld".lastIndexOf("oooo", 6) === 4);
+
+// check utf8 strings
+assert("\uFFA2".lastIndexOf("\uFFA2") === 0);
+
+assert("\uFFA2".lastIndexOf("A") === -1);
+
+assert("w2\uFFA2 A".lastIndexOf("A") === 4);
+
+assert("w2\u1D306A".indexOf("A") === 4);
+
+assert("\u0070A".lastIndexOf("A") === 1);
+
+assert("\u8000A".lastIndexOf("A") === 1);
+
+assert("\u0080\u0080\u0980\u1080A".lastIndexOf("A") === 4);
+
+assert("\u0080\u0980\u1080A\u0080\u0080\u0980\u1080".lastIndexOf("A", 4) === 3);
+
+assert("\u0080\u0080\u0980\u1080A\u0980AA\u0980A".lastIndexOf("A\u0980A") === 7);
+
+assert("\u0080\u0080\u0980\u1080A\u0980AA\u0980A".lastIndexOf("A\u0980A", 4) === 4);
+
+assert("\uD834\uDF06".lastIndexOf("\uDF06") === 1);
+
+assert("\uD834\uDF06w2\u1D306D\uDF06w2\u1D306D".lastIndexOf("D") === 12);
+
+assert("\ud800\dc00\ud800\dc00".lastIndexOf("\dc00") === 6);
+
+// check empty string
+assert(String.prototype.lastIndexOf.call(new String()) === -1);
+
+assert(String.prototype.lastIndexOf.call("Hello world, welcome to the universe.","") === 37);
+
+assert(String.prototype.lastIndexOf.call("","") === 0);
+
+// check NaN
+assert("Hello world, welcome to the universe.".lastIndexOf(NaN) === -1);
+
+assert("Hello world, welcome to the universe.".lastIndexOf("o", NaN) === 22);
+
+// check Object
+assert(String.prototype.lastIndexOf.call({}) === -1);
+
+// check +-Inf
+assert("hello world!".lastIndexOf("world", -Infinity) === -1);
+
+assert("hello world!".lastIndexOf("world", Infinity) === 6);
+
+// check numbers
+assert("hello world!".lastIndexOf(-1) === -1);
+
+assert("hello 0 world!".lastIndexOf(-0) === 6);
+
+// check undefined
+assert("hello world!".lastIndexOf(undefined) === -1);
+
+var undefined_var;
+assert("Hello world, welcome to the universe.".lastIndexOf("welcome", undefined_var) === 13);
+
+// check booleans
+assert("true".lastIndexOf(true, false) === 0);
+
+// check coercible - undefined
+try {
+  String.prototype.lastIndexOf.call(undefined);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - null
+try {
+  String.prototype.lastIndexOf.call(null);
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - Boolean
+assert(String.prototype.lastIndexOf.call(true, "e") === 3);
+assert(String.prototype.lastIndexOf.call(false, "e") === 4);
+
+// check coercible - Object
+var test_object = {firstName:"John", lastName:"Doe"};
+assert(String.prototype.lastIndexOf.call(test_object, "Obj") === 8);
+
+// check coercible - Number
+assert(String.prototype.lastIndexOf.call(123, "2") === 1);
diff --git a/deps/jerry/tests/jerry/string-prototype-localecompare.js b/deps/jerry/tests/jerry/string-prototype-localecompare.js
new file mode 100644 (file)
index 0000000..fd8d8dd
--- /dev/null
@@ -0,0 +1,53 @@
+// 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.
+
+var str1 = "ab";
+var str2 = "cd";
+assert (str1.localeCompare(str1) === 0);
+assert (str1.localeCompare(str2) === -1);
+assert (str2.localeCompare(str1) === 1);
+
+var x = "32";
+var y = "-32";
+assert (y.localeCompare(-31) === 1);
+assert (y.localeCompare("") === 1);
+assert (y.localeCompare(-32) === 0);
+assert (x.localeCompare(33) === -1);
+assert (x.localeCompare() === -1);
+assert (x.localeCompare(null) === -1);
+assert (x.localeCompare(NaN) === -1);
+assert (x.localeCompare(Infinity) === -1);
+assert (x.localeCompare(-Infinity) === 1);
+
+var array1 = ["1", 2];
+var array2 = [3, 4];
+assert (String.prototype.localeCompare.call(42, array1) === 1);
+assert (String.prototype.localeCompare.call(array1, null) === -1);
+assert (String.prototype.localeCompare.call(array1, array1) === 0);
+assert (String.prototype.localeCompare.call(array1, array2) === -1);
+assert (String.prototype.localeCompare.call(array2, array1) === 1);
+
+try {
+  var res = String.prototype.localeCompare.call(null, 0);
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+try {
+  var res = String.prototype.localeCompare.call();
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/string-prototype-match.js b/deps/jerry/tests/jerry/string-prototype-match.js
new file mode 100644 (file)
index 0000000..c8a0999
--- /dev/null
@@ -0,0 +1,98 @@
+// 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.
+
+// check properties
+assert(Object.getOwnPropertyDescriptor(String.prototype.match, 'length').configurable === false);
+assert(Object.getOwnPropertyDescriptor(String.prototype.match, 'length').enumerable === false);
+assert(Object.getOwnPropertyDescriptor(String.prototype.match, 'length').writable === false);
+
+function match_equals (match_result, expected)
+{
+  if (match_result.length !== expected.length)
+  {
+    return false;
+  }
+
+  for(var i = 0; i < expected.length; i++)
+  {
+    if (match_result[i] !== expected[i])
+    {
+      return false;
+    }
+  }
+
+  return true;
+}
+
+assert (match_equals ("hello".match("o"), ["o"]));
+assert ("hello".match(/ /g) == void 0);
+
+assert (match_equals ("hello".match(/o/), ["o"]));
+
+assert (match_equals ("hello".match(/l/), ["l"]));
+assert (match_equals ("hello".match(/l/g), ["l", "l"]));
+
+assert ("".match(/a/g) == void 0);
+
+assert ("".match() !== void 0 );
+
+assert (match_equals ("".match(), [""]));
+assert (match_equals ("".match(undefined), [""]));
+assert (match_equals ("".match(""), [""]));
+
+assert (match_equals ("test 1, test 2, test 3, test 45".match(/[0-9]+/g), ["1", "2", "3", "45"]));
+
+var re = new RegExp("", "g");
+assert (match_equals ("a".match(re), ["", ""]));
+
+
+/* Check Object coercible */
+try {
+  String.prototype.match.call(undefined, "");
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+/* Check toString conversion */
+try {
+  var obj = { toString: function() { throw new ReferenceError("foo"); } };
+  String.prototype.match.call(obj, "");
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+  assert (e.message === "foo");
+}
+
+/* Check Invalid RegExp */
+try {
+  var obj = { toString: function() { throw new ReferenceError("foo"); } };
+  "".match (obj);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+  assert (e.message === "foo");
+}
+
+/* Check if lastIndex is set to 0 on start */
+var re = /a/g;
+re.lastIndex = 3;
+
+assert (match_equals ("a".match(re), ["a"]));
diff --git a/deps/jerry/tests/jerry/string-prototype-replace.js b/deps/jerry/tests/jerry/string-prototype-replace.js
new file mode 100644 (file)
index 0000000..b8d3a04
--- /dev/null
@@ -0,0 +1,119 @@
+// 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.
+
+assert ("abcabc".replace("bc", ":") === "a:abc");
+assert ("hello".replace("", ":") === ":hello");
+
+assert ("xabcxabcx".replace (/abc/g, "[$&][$`][$']") === "x[abc][x][xabcx]x[abc][xabcx][x]x");
+assert ("abc".replace (/a(b)c|d()/, "[$1][$01][$2][$02][$99][$123][$012]") === "[b][b][][][$99][b23][b2]");
+assert ("abc".replace("abc", "$x$$5$0$00$") === "$x$5$0$00$");
+
+assert ("#x#".replace("x", "$1") === "#$1#");
+assert ("#x#".replace(/(x)/, "$1$2") === "#x$2#");
+assert ("#x#".replace(/(x)/, "$01$02$11$20") === "#x$02x1$20#");
+assert ("#xy#".replace(/(x)((((((((((y))))))))))/, "$07|$20|$11|$12|$110|$99|$011") === "#y|y0|y|x2|y0|y9|x1#");
+assert ("#xy#".replace(/(x)((((((((y))))))))/, "$00|$01|$011|$090|$10|$99") === "#$00|x|x1|y0|x0|y9#");
+
+assert ("a true true story".replace(true) === "a undefined true story");
+assert ("1234".replace(23, 32) === "1324");
+
+assert ("abcabc".replace(/bc/, ":") === "a:abc");
+assert ("axbcxx".replace(/x*/g, ":") === ":a::b:c::");
+
+assert ("".replace(/|/g,"஻") === "஻");
+assert ("஻BB8B@abXde^".replace(/a/g,"$஻Bce((/a%") === "஻BB8B@$஻Bce((/a%bXde^");
+assert ("abcab".replace(/a/g,"˙Ł$Đ") === "˙Ł$Đbc˙Ł$Đb");
+assert ("˙Ł$Đbc˙Ł$Đb".replace("Ł$","ab") === "˙abĐbc˙Ł$Đb");
+
+assert (String.prototype.replace.call (12321, /2/g, ".") === "1.3.1");
+
+try
+{
+  String.prototype.replace.call (null, "u", ".");
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+assert ("98765".replace(76, function () { return {}; }) === "98[object Object]5");
+
+function concat_arguments()
+{
+  var str = "";
+  for (var i = 0; i < arguments.length; i++)
+  {
+    str += "[" + arguments[i] + "]";
+  }
+  return str;
+}
+
+assert ("abcdabcd".replace("cd", concat_arguments) === "ab[cd][2][abcdabcd]abcd");
+assert ("abcdef".replace (/a((b)c)|d()/, concat_arguments) === "[abc][bc][b][undefined][0][abcdef]def");
+
+try
+{
+  "x".replace("x", function() { throw "MyError"; });
+  assert (false);
+}
+catch (e)
+{
+  assert (e === "MyError");
+}
+
+assert ("\ud801\udc00".replace("\ud801", "#") === "#\udc00");
+assert ("\ud801\udc00".replace("\udc00", "#") === "\ud801#");
+
+var global = this;
+
+function case1()
+{
+  assert(this === global);
+  return "y";
+}
+
+function case2()
+{
+  "use strict";
+  assert(this === undefined);
+  return "y";
+}
+
+assert ("x".replace("x", case1) === "y");
+assert ("x".replace("x", case2) === "y");
+
+var regexp = /r/g;
+
+Object.defineProperty(regexp, "lastIndex", {
+  configurable : false,
+  enumerable : false,
+  value : 0,
+  writable : false
+});
+
+try {
+  "r".replace (regexp, "x");
+  assert (false);
+} catch (e) {
+  assert (e instanceof TypeError);
+}
+
+// The real "exec" never returns with a number.
+Object.getPrototypeOf(/x/).exec = function () { return 1234; }
+
+assert (/y/.exec("y") === 1234);
+
+// Changing exec should not affect replace.
+assert ("y".replace (/y/, "x") === "x");
diff --git a/deps/jerry/tests/jerry/string-prototype-search.js b/deps/jerry/tests/jerry/string-prototype-search.js
new file mode 100644 (file)
index 0000000..cf16c50
--- /dev/null
@@ -0,0 +1,59 @@
+// 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.
+
+assert ("abcabbcd".search (/abb+c/) === 3);
+assert ("ababbccabd".search ("((?:(ax))|(bx)|ab*c+)") === 2);
+assert ("acbaabcabcabc".search (/b+c/g) === 5);
+assert ("abcabd".search ("c?a+d") === -1);
+
+assert (String.prototype.search.call ({}, "ec+t") === 4);
+
+try
+{
+  String.prototype.search.call (null, "u");
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+var regexp = /x/g;
+regexp.lastIndex = "index";
+
+assert ("aaxbb".search (regexp) === 2);
+assert ("aabb".search (regexp) === -1);
+assert (regexp.lastIndex === "index");
+
+Object.defineProperty(regexp, "lastIndex", {
+  configurable : false,
+  enumerable : false,
+  value : "index2",
+  writable : false
+});
+
+assert ("axb".search (regexp) === 1);
+assert ("aabb".search (regexp) === -1);
+assert (regexp.lastIndex === "index2");
+
+assert ("##\ud801\udc00".search ("\ud801") === 2);
+assert ("##\ud801\udc00".search ("\udc00") === 3);
+
+// The real "exec" never returns with a number.
+Object.getPrototypeOf(/x/).exec = function () { return "???"; }
+
+assert (/y/.exec("y") === "???");
+
+// Changing exec should not affect search.
+assert ("ay".search (/y/) === 1);
diff --git a/deps/jerry/tests/jerry/string-prototype-slice.js b/deps/jerry/tests/jerry/string-prototype-slice.js
new file mode 100644 (file)
index 0000000..941a520
--- /dev/null
@@ -0,0 +1,58 @@
+// 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.
+
+var str = "universe";
+var res;
+
+res = str.slice();
+assert (res === "universe");
+
+res = str.slice(1, 6);
+assert (res === "niver");
+
+res = str.slice("a", "-4");
+assert (res === "univ");
+
+res = str.slice(-5);
+assert (res === "verse");
+
+res = str.slice(-12, undefined);
+assert (res === "universe");
+
+res = str.slice(undefined, -20);
+assert (res === "");
+
+res = str.slice(undefined, undefined);
+assert (res === "universe");
+
+res = str.slice(Infinity, NaN);
+assert (res === "");
+
+res = str.slice(-Infinity, Infinity);
+assert (res === "universe");
+
+res = str.slice(NaN, -Infinity);
+assert (res === "");
+
+res = str.slice(false, true);
+assert (res === "u");
+
+var x;
+res = str.slice(x, x);
+assert (res === "universe");
+
+var obj = {y: "foo"};
+var arr = [x, x];
+res = str.slice(obj, arr);
+assert (res === "");
diff --git a/deps/jerry/tests/jerry/string-prototype-split.js b/deps/jerry/tests/jerry/string-prototype-split.js
new file mode 100644 (file)
index 0000000..bef02ca
--- /dev/null
@@ -0,0 +1,160 @@
+// 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.
+
+var res = "".split();
+assert (res[0] === "");
+
+res = "foo".split();
+assert (res[0] === "foo");
+
+var str = "foo//bar/baz//foo";
+res = str.split("");
+
+assert (res.length === 17);
+for (var i = 0; i < res.length; i++)
+{
+  assert (res[i] === str[i]);
+}
+
+res = str.split("", "foo");
+assert (res.length === 0);
+
+res = str.split("", "4");
+assert (res.length === 4);
+for (var i = 0; i < res.length; i++)
+{
+  assert (res[i] === str[i]);
+}
+
+res = str.split(undefined, undefined)
+assert (res.length === 1);
+assert (res[0] === "foo//bar/baz//foo");
+
+res = str.split("a", false);
+assert (res.length === 0);
+
+res = str.split("a", true);
+assert (res.length === 1);
+assert (res[0] === "foo//b");
+
+res = str.split("a", NaN);
+assert (res.length === 0);
+
+res = str.split("a", Infinity);
+assert (res.length === 0);
+
+res = str.split(["o"])
+assert (res.length === 5);
+assert (res[0] === "f");
+assert (res[1] === "");
+assert (res[2] === "//bar/baz//f");
+assert (res[3] === "");
+assert (res[4] === "");
+
+res = str.split(["o", "/"]);
+assert (res.length === 1);
+assert (res[0] === "foo//bar/baz//foo");
+
+res = str.split("a", ["2"]);
+assert (res.length === 2);
+assert (res[0] === "foo//b");
+assert (res[1] === "r/b");
+
+res = str.split("a", ["2", "3"]);
+assert (res.length === 0);
+
+var obj = {x: 12, b: undefined};
+res = str.split(obj, 4);
+assert (res.length === 1);
+assert (res[0] === "foo//bar/baz//foo");
+
+res = str.split("o", obj);
+assert (res.length === 0);
+
+res = str.split(false, true);
+assert (res.length === 1);
+assert (res[0] === "foo//bar/baz//foo");
+
+res = str.split(/\/\//);
+assert (res.length === 3);
+assert (res[0] === "foo");
+assert (res[1] === "bar/baz");
+assert (res[2] === "foo");
+
+res = str.split(/\/\//, 1);
+assert (res.length === 1);
+assert (res[0] === "foo");
+
+res = str.split(/\/\//, -1);
+assert (res.length === 3);
+assert (res[0] === "foo");
+assert (res[1] === "bar/baz");
+assert (res[2] === "foo");
+
+str = "fo123o12bar";
+res = str.split(12, undefined);
+assert (res.length === 3);
+assert (res[0] === "fo");
+assert (res[1] === "3o");
+assert (res[2] === "bar");
+
+str = "aaabababaab";
+res = str.split(/aa+/);
+assert (res.length === 3);
+assert (res[0] === "");
+assert (res[1] === "babab");
+assert (res[2] === "b");
+
+str = "A<B>bold</B>and<CODE>coded</CODE>";
+res = str.split(/<(\/)?([^<>]+)>/);
+assert (res.length === 13);
+var expected = ["A", undefined, "B", "bold", "/", "B", "and", undefined, "CODE", "coded", "/", "CODE", ""];
+for (var i = 0; i < res.length; i++)
+{
+  assert (res[i] === expected[i]);
+}
+
+/* Check Object coercible */
+try {
+  String.prototype.split.call(undefined, "");
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
+
+/* Check toString conversion */
+try {
+  var obj = { toString: function() { throw new ReferenceError("foo"); } };
+  String.prototype.split.call(obj, "");
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+  assert (e.message === "foo");
+}
+
+/* Check Invalid RegExp */
+try {
+  var obj = { toString: function() { throw new ReferenceError("foo"); } };
+  "".split(obj);
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+  assert (e.message === "foo");
+}
diff --git a/deps/jerry/tests/jerry/string-prototype-substr.js b/deps/jerry/tests/jerry/string-prototype-substr.js
new file mode 100644 (file)
index 0000000..40613b7
--- /dev/null
@@ -0,0 +1,138 @@
+// 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.
+
+// check properties
+assert(Object.getOwnPropertyDescriptor(String.prototype.substr, 'length').configurable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.substr, 'length').enumerable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.substr, 'length').writable === false);
+
+assert(String.prototype.substr.length === 2);
+
+assert(String.prototype.substr.call(new String()) === "");
+
+assert(String.prototype.substr.call({}) === "[object Object]");
+
+// check this is undefined
+try {
+  String.prototype.substr.call(undefined);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// check this is null
+try {
+  String.prototype.substr.call(null);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// simple checks
+assert("Hello world!".substr(0, 11) === "Hello world");
+
+assert("Hello world!".substr(11, 0) === "");
+
+assert("Hello world!".substr(0, 12) === "Hello world!");
+
+assert("Hello world!".substr(12, 0) === "");
+// check NaN
+assert("Hello world!".substr(NaN, 12) === "Hello world!");
+
+// check NaN
+assert("Hello world!".substr(2, NaN) === "");
+
+// check end undefined
+assert("Hello world!".substr(2, undefined) === "llo world!");
+
+// check negative
+assert("Hello world!".substr(-1,8) === "!");
+
+// check negative
+assert("Hello\tworld!".substr(5,-8) === "");
+
+// check negative
+assert("Hello world!".substr(-1,-8) === "");
+
+// check ranges
+assert("Hello world!".substr(-1,10000) === "!");
+
+assert("Hello world!".substr(10000,1000000) === "");
+
+assert("Hello world!".substr(100000,1) === "");
+
+// check both undefined
+assert("Hello world!".substr(undefined, undefined) === "Hello world!");
+
+var undef_var;
+assert("Hello world!".substr(undef_var, undef_var) === "Hello world!");
+
+// check integer conversion
+assert("Hello world!".substr(undefined, 5) === "Hello");
+
+assert("Hello world!".substr(undefined, "bar") === "");
+
+assert("Hello world!".substr(2, true) === "l");
+
+assert("Hello world!".substr(2, false) === "");
+
+assert("Hello world!".substr(5, obj) === " world!");
+
+// check other objects
+var obj = { substr : String.prototype.substr }
+
+obj.toString = function() {
+    return "Iam";
+}
+assert(obj.substr(0,1) === "I");
+
+obj.toString = function() {
+  throw new ReferenceError ("foo");
+};
+
+try {
+  assert(obj.substr(100000,1));
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// check coercible - undefined
+try {
+  assert(true.substr() === "");
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - null
+try {
+  assert(String.prototype.substr.call(null, 0, 1) === "");
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - Boolean
+assert(String.prototype.substr.call(true, 0, 1) === "t");
+
+// check coercible - Object
+var test_object = {firstName:"John", lastName:"Doe"};
+assert(String.prototype.substr.call(test_object, 0, 7) === "[object");
+
+// check coercible - Number
+assert(String.prototype.substr.call(123, 0, 3) === "123");
diff --git a/deps/jerry/tests/jerry/string-prototype-substring.js b/deps/jerry/tests/jerry/string-prototype-substring.js
new file mode 100644 (file)
index 0000000..51d03b1
--- /dev/null
@@ -0,0 +1,139 @@
+// 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.
+
+// check properties
+assert(Object.getOwnPropertyDescriptor(String.prototype.substring, 'length').configurable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.substring, 'length').enumerable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.substring, 'length').writable === false);
+
+assert(String.prototype.substring.length === 2);
+
+assert(String.prototype.substring.call(new String()) === "");
+
+assert(String.prototype.substring.call({}) === "[object Object]");
+
+// check this is undefined
+try {
+  String.prototype.substring.call(undefined);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// check this is null
+try {
+  String.prototype.substring.call(null);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// simple checks
+assert("hello world!".substring(0, 11) === "hello world");
+
+assert("hello world!".substring(11, 0) === "hello world");
+
+assert("hello world!".substring(0, 12) === "hello world!");
+
+assert("hello world!".substring(12, 0) === "hello world!");
+
+// check NaN
+assert("hello world!".substring(NaN, 12) === "hello world!");
+
+// check NaN
+assert("hello world!".substring(2, NaN) === "he");
+
+// check end undefined
+assert("hello world!".substring(2, undefined) === "llo world!");
+
+// check negative
+assert("hello world!".substring(-1,8) === "hello wo");
+
+// check negative
+assert("hello\tworld!".substring(5,-8) === "hello");
+
+// check negative
+assert("hello world!".substring(-1,-8) === "");
+
+// check ranges
+assert("hello world!".substring(-1,10000) === "hello world!");
+
+assert("hello world!".substring(10000,1000000) === "");
+
+assert("hello world!".substring(100000,1) === "ello world!");
+
+// check both undefined
+assert("hello world!".substring(undefined, undefined) === "hello world!");
+
+var undef_var;
+assert("hello world!".substring(undef_var, undef_var) === "hello world!");
+
+// check integer conversion
+assert("hello world!".substring(undefined, 5) === "hello");
+
+assert("hello world!".substring(undefined, "bar") === "");
+
+assert("hello world!".substring(2, true) === "e");
+
+assert("hello world!".substring(2, false) === "he");
+
+assert("hello world!".substring(5, obj) === " world!");
+
+// check other objects
+var obj = { substring : String.prototype.substring }
+
+obj.toString = function() {
+    return "Iam";
+}
+assert(obj.substring(100000,1) === "am");
+
+obj.toString = function() {
+  throw new ReferenceError ("foo");
+};
+
+try {
+  assert(obj.substring(100000,1));
+  assert(false);
+} catch (e) {
+  assert(e.message === "foo");
+  assert(e instanceof ReferenceError);
+}
+
+// check coercible - undefined
+try {
+  assert(true.substring() === "");
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - null
+try {
+  assert(String.prototype.substring.call(null, 0, 1) === "");
+  assert(false);
+} catch (e) {
+  assert(e instanceof TypeError);
+}
+
+// check coercible - Boolean
+assert(String.prototype.substring.call(true, 0, 1) === "t");
+
+// check coercible - Object
+var test_object = {firstName:"John", lastName:"Doe"};
+assert(String.prototype.substring.call(test_object, 0, 7) === "[object");
+
+// check coercible - Number
+assert(String.prototype.substring.call(123, 0, 3) === "123");
diff --git a/deps/jerry/tests/jerry/string-prototype-trim.js b/deps/jerry/tests/jerry/string-prototype-trim.js
new file mode 100644 (file)
index 0000000..abeb31c
--- /dev/null
@@ -0,0 +1,77 @@
+// 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.
+
+// check properties
+assert(Object.getOwnPropertyDescriptor(String.prototype.trim, 'length').configurable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.trim, 'length').enumerable === false);
+
+assert(Object.getOwnPropertyDescriptor(String.prototype.trim, 'length').writable === false);
+
+assert(String.prototype.trim.length === 0);
+
+// check this value
+assert(String.prototype.trim.call(new String()) === "");
+
+assert(String.prototype.trim.call({}) === "[object Object]");
+
+// check undefined
+try {
+  String.prototype.trim.call(undefined);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// check null
+try {
+  String.prototype.trim.call(null);
+  assert(false);
+} catch(e) {
+  assert(e instanceof TypeError);
+}
+
+// simple checks
+assert(" hello world".trim() === "hello world");
+
+assert("hello world ".trim() === "hello world");
+
+assert("    hello world   ".trim() === "hello world");
+
+assert("\t  hello world\n".trim() === "hello world");
+
+assert("\t\n  hello world\t \n ".trim() === "hello world");
+
+assert("hello world\n   \t\t".trim() === "hello world");
+
+assert(" hello world \\ ".trim() === "hello world \\");
+
+assert("**hello world**".trim() === "**hello world**");
+
+assert(" \t \n".trim() === "");
+
+assert("          ".trim() === "");
+
+assert("".trim() === "");
+
+assert("\uf389".trim() === "\uf389");
+assert(String.prototype.trim.call('\uf389') === "\uf389");
+assert("\u20291\u00D0".trim() === "1\u00D0");
+assert("\u20291\u00A0".trim() === "1");
+
+assert("\u0009\u000B\u000C\u0020\u00A01".trim() === "1");
+assert("\u000A\u000D\u2028\u202911".trim() === "11");
+
+assert("\u0009\u000B\u000C\u0020\u00A01\u0009\u000B\u000C\u0020\u00A0".trim() === "1");
+assert("\u000A\u000D\u2028\u202911\u000A\u000D\u2028\u2029".trim() === "11");
diff --git a/deps/jerry/tests/jerry/string-prototype.js b/deps/jerry/tests/jerry/string-prototype.js
new file mode 100644 (file)
index 0000000..00a710f
--- /dev/null
@@ -0,0 +1,15 @@
+// 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.
+
+assert (String.prototype.length === 0);
diff --git a/deps/jerry/tests/jerry/string-surrogates-concat.js b/deps/jerry/tests/jerry/string-surrogates-concat.js
new file mode 100644 (file)
index 0000000..340fcc0
--- /dev/null
@@ -0,0 +1,23 @@
+// 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.
+
+var str0 = "𐐀";
+var str1 = "\ud801\udc00";
+var str2 = "\ud801";
+var str3 = "\udc00";
+
+var str_concat = str2 + str3;
+
+assert(str0 == str_concat);
+assert(str1 == str_concat);
diff --git a/deps/jerry/tests/jerry/string-upper-lower-case-conversion.js b/deps/jerry/tests/jerry/string-upper-lower-case-conversion.js
new file mode 100644 (file)
index 0000000..75a6dea
--- /dev/null
@@ -0,0 +1,111 @@
+// 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.
+
+// LATIN SMALL LIGATURES
+// LATIN SMALL LIGATURE FF
+assert ("\ufb00".toLowerCase() == "\ufb00");
+assert ("\ufb00".toUpperCase() == "\u0046\u0046");
+// LATIN SMALL LIGATURE FI
+assert ("\ufb01".toLowerCase() == "\ufb01");
+assert ("\ufb01".toUpperCase() == "\u0046\u0049");
+// LATIN SMALL LIGATURE FL
+assert ("\ufb02".toLowerCase() == "\ufb02");
+assert ("\ufb02".toUpperCase() == "\u0046\u004c");
+// LATIN SMALL LIGATURE FFI
+assert ("\ufb03".toLowerCase() == "\ufb03");
+assert ("\ufb03".toUpperCase() == "\u0046\u0046\u0049");
+// LATIN SMALL LIGATURE FFL
+assert ("\ufb04".toLowerCase() == "\ufb04");
+assert ("\ufb04".toUpperCase() == "\u0046\u0046\u004c");
+// LATIN SMALL LIGATURE LONG S T
+assert ("\ufb05".toLowerCase() == "\ufb05");
+assert ("\ufb05".toUpperCase() == "\u0053\u0054");
+// LATIN SMALL LIGATURE ST
+assert ("\ufb06".toLowerCase() == "\ufb06");
+assert ("\ufb06".toUpperCase() == "\u0053\u0054");
+
+// LATIN CAPITAL LETTER I WITH DOT ABOVE
+assert ("\u0130".toLowerCase() == "\u0069\u0307");
+assert ("\u0130".toUpperCase() == "\u0130");
+
+// LATIN SMALL LETTER SHARP S
+assert ("\u00df".toLowerCase() == "\u00df");
+assert ("\u00df".toUpperCase() == "\u0053\u0053");
+
+// LATIN CAPITAL LETTER I WITH BREVE
+assert ("\u012c".toLowerCase() == "\u012d");
+assert ("\u012c".toUpperCase() == "\u012c");
+// LATIN SMALL LETTER I WITH BREVE
+assert ("\u012d".toLowerCase() == "\u012d")
+assert ("\u012d".toUpperCase() == "\u012c");
+
+// Check randomly selected characters from conversion tables
+
+// lower-case conversions
+assert ("\u01c5\u01c8\u01cb\u212b".toLowerCase() == "\u01c6\u01c9\u01cc\u00e5");
+assert ("\u0130".toLowerCase() == "\u0069\u0307");
+
+// upper-case conversions
+assert ("\u00b5\u017f".toUpperCase() == "\u039c\u0053");
+assert ("\ufb17\u00df\u1fbc".toUpperCase() == "\u0544\u053D\u0053\u0053\u0391\u0399");
+assert ("\ufb03\ufb04".toUpperCase() == "\u0046\u0046\u0049\u0046\u0046\u004c");
+
+// character case ranges
+assert ("\u0100\u0101\u0139\u03fa\ua7b4".toLowerCase() == "\u0101\u0101\u013a\u03fb\ua7b5");
+assert ("\u0101\u0100\u013a\u03fb\ua7b5".toUpperCase() == "\u0100\u0100\u0139\u03fa\ua7b4");
+
+// character pairs
+assert ("\u0178\ua7b1\u0287\ua7b3".toLowerCase() == "\u00ff\u0287\u0287\uab53");
+assert ("\u00ff\u0287\ua7b1\uab53".toUpperCase() == "\u0178\ua7b1\ua7b1\ua7b3");
+
+// character case ranges
+assert ("\u00e0\u00c0\u00c1\u00c2\uff21".toLowerCase() == "\u00e0\u00e0\u00e1\u00e2\uff41");
+assert ("\u00e0\u00c0\u00e1\u00e2\uff41".toUpperCase() == "\u00c0\u00c0\u00c1\u00c2\uff21");
+
+// lower-case ranges
+assert ("\u1f88\u1f98\u1fa8\u1f8b\u1faf".toLowerCase() == "\u1f80\u1f90\u1fa0\u1f83\u1fa7");
+
+// upper-case special ranges
+assert ("\u1f80\u1f81\u1fa7".toUpperCase() == "\u1f08\u0399\u1f09\u0399\u1f6f\u0399");
+
+assert ("0123456789abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXYZ".toLowerCase()
+        == "0123456789abcdefghijklmnopqrstuvwxzyabcdefghijklmnopqrstuvwxyz");
+assert ("0123456789abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXYZ".toUpperCase()
+        == "0123456789ABCDEFGHIJKLMNOPQRSTUVWXZYABCDEFGHIJKLMNOPQRSTUVWXYZ");
+
+// Although codepoint 0x10400 and 0x10428 are an upper-lowercase pair,
+// we must not do their conversion in JavaScript. We must also ignore
+// stray surrogates.
+
+assert ("\ud801\ud801\udc00\udc00".toLowerCase() == "\ud801\ud801\udc00\udc00");
+assert ("\ud801\ud801\udc28\udc28".toUpperCase() == "\ud801\ud801\udc28\udc28");
+
+// Conversion of non-string objects.
+
+assert (String.prototype.toUpperCase.call(true) == "TRUE");
+assert (String.prototype.toLowerCase.call(-23) == "-23");
+
+var object = { toString : function() { return "<sTr>"; } };
+assert (String.prototype.toUpperCase.call(object) == "<STR>");
+assert (String.prototype.toLowerCase.call(object) == "<str>");
+
+try
+{
+  String.prototype.toUpperCase.call(null);
+  assert(false);
+}
+catch (e)
+{
+  assert (e instanceof TypeError);
+}
diff --git a/deps/jerry/tests/jerry/string.js b/deps/jerry/tests/jerry/string.js
new file mode 100644 (file)
index 0000000..86b6110
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+var a = 'abcd';
+var b = 'dfgh';
+
+c = a + b;
+
+assert(c == a + b);
+assert(c === a + b);
+assert(c != a);
+assert(c != b);
+assert(c !== a);
+assert(c !== b);
+assert(c != b + a);
+assert(c !== b + a);
diff --git a/deps/jerry/tests/jerry/switch-case.js b/deps/jerry/tests/jerry/switch-case.js
new file mode 100644 (file)
index 0000000..64dd479
--- /dev/null
@@ -0,0 +1,105 @@
+// 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.
+
+var a = 1;
+
+switch (a) {
+  case 1:
+  case 2:
+    break;
+  case 3:
+    assert (0);
+}
+
+switch (a) {
+  case 1:
+    break;
+  case 2:
+  case 3:
+    assert (0);
+}
+
+switch (a) {
+  default:
+    assert (0);
+  case 1:
+    break;
+  case 2:
+  case 3:
+    assert (0);
+}
+
+switch (a) {
+  default:
+    break;
+  case 2:
+  case 3:
+    assert (0);
+}
+
+switch (a) {
+  case 3:
+    assert (0);
+  default:
+    assert (0);
+  case 1:
+}
+
+executed_case = '';
+switch (a) {
+  default:
+    executed_case = 'default';
+    break;
+  case 2:
+    executed_case = 'case 2';
+    break;
+}
+assert (executed_case === 'default');
+
+var counter = 0;
+
+switch ("var") {
+  case "var":
+    counter++;
+  case "var1":
+    counter++;
+  case "var2":
+    counter++;
+  default:
+    counter++;
+}
+
+assert (counter === 4);
+
+var flow = '';
+
+switch ("var") {
+  case "var":
+    flow += '1';
+  case "var1":
+    flow += '2';
+  case "var2":
+    flow += '3';
+    switch (flow) {
+      case '123':
+       flow += 'a';
+       break;
+      default:
+       flow += 'b';
+    }
+  default:
+    flow += '4';
+}
+
+assert (flow === '123a4');
diff --git a/deps/jerry/tests/jerry/test-new-string.js b/deps/jerry/tests/jerry/test-new-string.js
new file mode 100644 (file)
index 0000000..6f8f1c8
--- /dev/null
@@ -0,0 +1,20 @@
+// 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.
+
+var a = new String ('abcd');
+var b = String.fromCharCode (97, 98, 99, 100);
+
+assert (a + '' === 'abcd');
+assert (b + '' === 'abcd');
+assert (a + b === 'abcdabcd');
diff --git a/deps/jerry/tests/jerry/this-arg.js b/deps/jerry/tests/jerry/this-arg.js
new file mode 100644 (file)
index 0000000..8af4c9f
--- /dev/null
@@ -0,0 +1,26 @@
+// 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.
+
+var i = 0;
+
+function a() {}
+
+a.prototype.b = function() { i++; }
+
+a.prototype.c = function() { this.b(); i++; }
+
+var aa = new a();
+aa.c();
+
+assert (i === 2);
diff --git a/deps/jerry/tests/jerry/try-catch-finally.js b/deps/jerry/tests/jerry/try-catch-finally.js
new file mode 100644 (file)
index 0000000..1d82a59
--- /dev/null
@@ -0,0 +1,39 @@
+// 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.
+
+var was_catch = false, was_finally = false;
+
+try {
+} catch (err) {
+  was_catch = true;
+} finally {
+  was_finally = true;
+}
+
+assert (!was_catch && was_finally);
+
+was_catch = false;
+was_finally = false;
+
+try {
+  throw 1;
+  assert (0);
+} catch (err) {
+  assert (err === 1);
+  was_catch = true;
+} finally {
+  was_finally = true;
+}
+
+assert (was_catch && was_finally);
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry/typeof.js b/deps/jerry/tests/jerry/typeof.js
new file mode 100644 (file)
index 0000000..220c040
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+function f()
+{
+  return 1;
+}
+
+assert(typeof(a) === "undefined");
+assert(typeof(null) === "object");
+assert(typeof(false) === "boolean");
+assert(typeof(true) === "boolean");
+assert(typeof(1) === "number");
+assert(typeof(1.1) === "number");
+assert(typeof('abcd') === "string");
+assert(typeof("1.1") === "string");
+assert(typeof(this) === "object");
+assert(typeof(f) === "function");
diff --git a/deps/jerry/tests/jerry/unary-plus-minus.js b/deps/jerry/tests/jerry/unary-plus-minus.js
new file mode 100644 (file)
index 0000000..f6ac8e5
--- /dev/null
@@ -0,0 +1,19 @@
+// 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.
+
+assert (+0 === -0);
+assert (1/-0 === -Infinity);
+assert (1/+0 === Infinity);
+assert ("3" -+-+-+ "1" + "1" / "3" * "6" + "2" === "42");
+assert (isNaN (-NaN));
\ No newline at end of file
diff --git a/deps/jerry/tests/jerry/var-decl.js b/deps/jerry/tests/jerry/var-decl.js
new file mode 100644 (file)
index 0000000..e5990ff
--- /dev/null
@@ -0,0 +1,63 @@
+// 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.
+
+assert (x === undefined);
+assert (y === undefined);
+assert (z === undefined);
+assert (i === undefined);
+assert (j === undefined);
+assert (k === undefined);
+assert (q === undefined);
+assert (v === undefined);
+
+eval ('var n');
+eval ('var m = 1');
+
+try
+{
+  x = p;
+  assert (false);
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+}
+
+{
+  var y;
+}
+var x = y;
+
+do var z; while (0);
+
+for (var i, j = function () {var p;}; i === undefined; i = null)
+{
+}
+
+for (var q in {})
+{
+}
+
+{ var v = 1 }
+
+try
+{
+  var k
+  l
+  assert (false)
+}
+catch (e)
+{
+  assert (e instanceof ReferenceError);
+}
diff --git a/deps/jerry/tests/jerry/variables.js b/deps/jerry/tests/jerry/variables.js
new file mode 100644 (file)
index 0000000..dd01caf
--- /dev/null
@@ -0,0 +1,21 @@
+// 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.
+
+var real = 42;
+var float = 3.14;
+var integer = -4;
+var exponent = 1e7;
+var str = 'literal';
+
+a = 42;
diff --git a/deps/jerry/tests/jerry/zero-character.js b/deps/jerry/tests/jerry/zero-character.js
new file mode 100644 (file)
index 0000000..5475e95
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+try {
+  eval("/*var " + String.fromCharCode(0) + "xx = 1*/");
+}
+catch (e) {
+  assert (false);
+}
+
+assert ("x\0y" !== "x\0z");
diff --git a/deps/jerry/tests/unit-core/CMakeLists.txt b/deps/jerry/tests/unit-core/CMakeLists.txt
new file mode 100644 (file)
index 0000000..dbd9a25
--- /dev/null
@@ -0,0 +1,43 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+project (unit-core C)
+
+if (NOT IS_ABSOLUTE ${FEATURE_PROFILE})
+  set(FEATURE_PROFILE "${CMAKE_SOURCE_DIR}/jerry-core/profiles/${FEATURE_PROFILE}.profile")
+endif()
+
+if(${FEATURE_PROFILE} STREQUAL "${CMAKE_SOURCE_DIR}/jerry-core/profiles/minimal.profile")
+  message(FATAL_ERROR "minimal profile isn't supported in unit-core")
+endif()
+
+# Unit tests main modules
+file(GLOB SOURCE_UNIT_TEST_MAIN_MODULES *.c)
+
+# Unit tests declaration
+add_custom_target(unittests-core)
+
+foreach(SOURCE_UNIT_TEST_MAIN ${SOURCE_UNIT_TEST_MAIN_MODULES})
+  get_filename_component(TARGET_NAME ${SOURCE_UNIT_TEST_MAIN} NAME_WE)
+  set(TARGET_NAME unit-${TARGET_NAME})
+
+  add_executable(${TARGET_NAME} ${SOURCE_UNIT_TEST_MAIN})
+  set_property(TARGET ${TARGET_NAME}
+               PROPERTY LINK_FLAGS "${LINKER_FLAGS_COMMON}")
+
+  target_link_libraries(${TARGET_NAME} jerry-core jerry-port-default-minimal)
+
+  add_dependencies(unittests-core ${TARGET_NAME})
+endforeach()
diff --git a/deps/jerry/tests/unit-core/test-api.c b/deps/jerry/tests/unit-core/test-api.c
new file mode 100644 (file)
index 0000000..98721d3
--- /dev/null
@@ -0,0 +1,1267 @@
+/* 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.
+ */
+
+#include "config.h"
+#include "jerryscript.h"
+
+#include "test-common.h"
+
+/**
+ * Maximum size of snapshots buffer
+ */
+#define SNAPSHOT_BUFFER_SIZE (256)
+
+const char *test_source = (
+                           "function assert (arg) { "
+                           "  if (!arg) { "
+                           "    throw Error('Assert failed');"
+                           "  } "
+                           "} "
+                           "this.t = 1; "
+                           "function f () { "
+                           "return this.t; "
+                           "} "
+                           "this.foo = f; "
+                           "this.bar = function (a) { "
+                           "return a + t; "
+                           "}; "
+                           "function A () { "
+                           "this.t = 12; "
+                           "} "
+                           "this.A = A; "
+                           "this.a = new A (); "
+                           "function call_external () { "
+                           "  return this.external ('1', true); "
+                           "} "
+                           "function call_throw_test() { "
+                           "  var catched = false; "
+                           "  try { "
+                           "    this.throw_test(); "
+                           "  } catch (e) { "
+                           "    catched = true; "
+                           "    assert(e.name == 'TypeError'); "
+                           "    assert(e.message == 'error'); "
+                           "  } "
+                           "  assert(catched); "
+                           "} "
+                           "function throw_reference_error() { "
+                           " throw new ReferenceError ();"
+                           "} "
+                           "p = {'alpha':32, 'bravo':false, 'charlie':{}, 'delta':123.45, 'echo':'foobar'};"
+                           "np = {}; Object.defineProperty (np, 'foxtrot', { "
+                           "get: function() { throw 'error'; }, enumerable: true }) "
+                           );
+
+bool test_api_is_free_callback_was_called = false;
+
+static jerry_value_t
+handler (const jerry_value_t func_obj_val, /**< function object */
+         const jerry_value_t this_val, /**< this value */
+         const jerry_value_t args_p[], /**< arguments list */
+         const jerry_length_t args_cnt) /**< arguments length */
+{
+  char buffer[32];
+  jerry_size_t sz;
+
+  printf ("ok %u %u %p %u\n",
+          (unsigned int) func_obj_val, (unsigned int) this_val, (void *) args_p, (unsigned int) args_cnt);
+
+  TEST_ASSERT (args_cnt == 2);
+
+  TEST_ASSERT (jerry_value_is_string (args_p[0]));
+  sz = jerry_get_string_size (args_p[0]);
+  TEST_ASSERT (sz == 1);
+  sz = jerry_string_to_char_buffer (args_p[0],
+                                    (jerry_char_t *) buffer,
+                                    sz);
+  TEST_ASSERT (sz == 1);
+  TEST_ASSERT (!strncmp (buffer, "1", (size_t) sz));
+
+  TEST_ASSERT (jerry_value_is_boolean (args_p[1]));
+
+  return jerry_create_string ((jerry_char_t *) "string from handler");
+} /* handler */
+
+static jerry_value_t
+handler_throw_test (const jerry_value_t func_obj_val, /**< function object */
+                    const jerry_value_t this_val, /**< this value */
+                    const jerry_value_t args_p[], /**< arguments list */
+                    const jerry_length_t args_cnt) /**< arguments length */
+{
+  printf ("ok %u %u %p %u\n",
+          (unsigned int) func_obj_val, (unsigned int) this_val, (void *) args_p, (unsigned int) args_cnt);
+
+  return jerry_create_error (JERRY_ERROR_TYPE, (jerry_char_t *) "error");
+} /* handler_throw_test */
+
+static void
+handler_construct_freecb (void *native_p)
+{
+  TEST_ASSERT ((uintptr_t) native_p == (uintptr_t) 0x0012345678abcdefull);
+  printf ("ok object free callback\n");
+
+  test_api_is_free_callback_was_called = true;
+} /* handler_construct_freecb */
+
+
+/**
+ * The name of the jerry_object_native_info_t struct.
+ */
+#define JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE(c_type) _jerry_object_native_info_##c_type
+
+/**
+ * Define a native pointer's type based on the C type and free callback.
+ */
+#define JERRY_DEFINE_NATIVE_HANDLE_INFO(c_type, native_free_cb) \
+  static const jerry_object_native_info_t JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE (c_type) = \
+  { \
+    .free_cb = (jerry_object_native_free_callback_t) native_free_cb \
+  }
+
+JERRY_DEFINE_NATIVE_HANDLE_INFO (bind1, handler_construct_freecb);
+JERRY_DEFINE_NATIVE_HANDLE_INFO (bind2, handler_construct_freecb);
+JERRY_DEFINE_NATIVE_HANDLE_INFO (bind3, NULL);
+
+static jerry_value_t
+handler_construct (const jerry_value_t func_obj_val, /**< function object */
+                   const jerry_value_t this_val, /**< this value */
+                   const jerry_value_t args_p[], /**< arguments list */
+                   const jerry_length_t args_cnt) /**< arguments length */
+{
+  printf ("ok construct %u %u %p %u\n",
+          (unsigned int) func_obj_val, (unsigned int) this_val, (void *) args_p, (unsigned int) args_cnt);
+
+  TEST_ASSERT (jerry_value_is_object (this_val));
+
+  TEST_ASSERT (args_cnt == 1);
+  TEST_ASSERT (jerry_value_is_boolean (args_p[0]));
+  TEST_ASSERT (jerry_get_boolean_value (args_p[0]) == true);
+
+  jerry_value_t field_name = jerry_create_string ((jerry_char_t *) "value_field");
+  jerry_set_property (this_val, field_name, args_p[0]);
+  jerry_release_value (field_name);
+
+  jerry_set_object_native_pointer (this_val,
+                                   (void *) 0x0000000000000000ull,
+                                   &JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE (bind1));
+
+  void *ptr = NULL;
+  const jerry_object_native_info_t *out_info_p;
+  bool is_ok = jerry_get_object_native_pointer (this_val, &ptr, &out_info_p);
+  TEST_ASSERT (is_ok
+               && (uintptr_t) ptr == (uintptr_t) 0x0000000000000000ull
+               && out_info_p == &JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE (bind1));
+  /* check if setting handle for second time is handled correctly */
+  jerry_set_object_native_pointer (this_val,
+                                   (void *) 0x0012345678abcdefull,
+                                   &JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE (bind2));
+
+  return jerry_create_boolean (true);
+} /* handler_construct */
+
+static jerry_value_t
+vm_exec_stop_callback (void *user_p)
+{
+  int *int_p = (int *) user_p;
+
+  if (*int_p > 0)
+  {
+    (*int_p)--;
+
+    return jerry_create_undefined ();
+  }
+
+  return jerry_create_string ((const jerry_char_t *) "Abort script");
+} /* vm_exec_stop_callback */
+
+/**
+ * Extended Magic Strings
+ */
+#define JERRY_MAGIC_STRING_ITEMS \
+  JERRY_MAGIC_STRING_DEF (GLOBAL, global) \
+  JERRY_MAGIC_STRING_DEF (GREEK_ZERO_SIGN, \xed\xa0\x80\xed\xb6\x8a) \
+  JERRY_MAGIC_STRING_DEF (CONSOLE, console)
+
+#define JERRY_MAGIC_STRING_DEF(NAME, STRING) \
+  static const char jerry_magic_string_ex_ ## NAME[] = # STRING;
+
+JERRY_MAGIC_STRING_ITEMS
+
+#undef JERRY_MAGIC_STRING_DEF
+
+const jerry_length_t magic_string_lengths[] =
+{
+#define JERRY_MAGIC_STRING_DEF(NAME, STRING) \
+    (jerry_length_t) (sizeof (jerry_magic_string_ex_ ## NAME) - 1u),
+
+  JERRY_MAGIC_STRING_ITEMS
+
+#undef JERRY_MAGIC_STRING_DEF
+};
+
+const jerry_char_ptr_t magic_string_items[] =
+{
+#define JERRY_MAGIC_STRING_DEF(NAME, STRING) \
+    (const jerry_char_ptr_t) jerry_magic_string_ex_ ## NAME,
+
+  JERRY_MAGIC_STRING_ITEMS
+
+#undef JERRY_MAGIC_STRING_DEF
+};
+
+static bool
+foreach (const jerry_value_t name, /**< field name */
+         const jerry_value_t value, /**< field value */
+         void *user_data) /**< user data */
+{
+  char str_buf_p[128];
+  jerry_size_t sz = jerry_string_to_char_buffer (name, (jerry_char_t *) str_buf_p, 128);
+  str_buf_p[sz] = '\0';
+
+  TEST_ASSERT (!strncmp ((const char *) user_data, "user_data", 9));
+  TEST_ASSERT (sz > 0);
+
+  if (!strncmp (str_buf_p, "alpha", (size_t) sz))
+  {
+    TEST_ASSERT (jerry_value_is_number (value));
+    TEST_ASSERT (jerry_get_number_value (value) == 32.0);
+    return true;
+  }
+  else if (!strncmp (str_buf_p, "bravo", (size_t) sz))
+  {
+    TEST_ASSERT (jerry_value_is_boolean (value));
+    TEST_ASSERT (jerry_get_boolean_value (value) == false);
+    return true;
+  }
+  else if (!strncmp (str_buf_p, "charlie", (size_t) sz))
+  {
+    TEST_ASSERT (jerry_value_is_object (value));
+    return true;
+  }
+  else if (!strncmp (str_buf_p, "delta", (size_t) sz))
+  {
+    TEST_ASSERT (jerry_value_is_number (value));
+    TEST_ASSERT (jerry_get_number_value (value) == 123.45);
+    return true;
+  }
+  else if (!strncmp (str_buf_p, "echo", (size_t) sz))
+  {
+    TEST_ASSERT (jerry_value_is_string (value));
+    jerry_size_t echo_sz = jerry_string_to_char_buffer (value,
+                                                        (jerry_char_t *) str_buf_p,
+                                                        128);
+    str_buf_p[echo_sz] = '\0';
+    TEST_ASSERT (!strncmp (str_buf_p, "foobar", (size_t) echo_sz));
+    return true;
+  }
+
+  TEST_ASSERT (false);
+  return false;
+
+
+} /* foreach */
+
+static bool
+foreach_exception (const jerry_value_t name, /**< field name */
+                   const jerry_value_t value, /**< field value */
+                   void *user_data) /**< user data */
+{
+  JERRY_UNUSED (value);
+  JERRY_UNUSED (user_data);
+  char str_buf_p[128];
+  jerry_size_t sz = jerry_string_to_char_buffer (name, (jerry_char_t *) str_buf_p, 128);
+  str_buf_p[sz] = '\0';
+
+  if (!strncmp (str_buf_p, "foxtrot", (size_t) sz))
+  {
+    TEST_ASSERT (false);
+  }
+
+  return true;
+} /* foreach_exception */
+
+static bool
+foreach_subset (const jerry_value_t name, /**< field name */
+                const jerry_value_t value, /**< field value */
+                void *user_data) /**< user data */
+{
+  JERRY_UNUSED (name);
+  JERRY_UNUSED (value);
+  int *count_p = (int *) (user_data);
+
+  if (*count_p == 3)
+  {
+    return false;
+  }
+  (*count_p)++;
+  return true;
+} /* foreach_subset */
+
+static jerry_value_t
+get_property (const jerry_value_t obj_val, /**< object value */
+              const char *str_p) /**< property name */
+{
+  jerry_value_t prop_name_val = jerry_create_string ((const jerry_char_t *) str_p);
+  jerry_value_t ret_val = jerry_get_property (obj_val, prop_name_val);
+  jerry_release_value (prop_name_val);
+  return ret_val;
+} /* get_property */
+
+static jerry_value_t
+set_property (const jerry_value_t obj_val, /**< object value */
+              const char *str_p, /**< property name */
+              const jerry_value_t val) /**< value to set */
+{
+  jerry_value_t prop_name_val = jerry_create_string ((const jerry_char_t *) str_p);
+  jerry_value_t ret_val = jerry_set_property (obj_val, prop_name_val, val);
+  jerry_release_value (prop_name_val);
+  return ret_val;
+} /* set_property */
+
+static bool
+test_run_simple (const char *script_p) /**< source code to run */
+{
+  size_t script_size = strlen (script_p);
+
+  return jerry_run_simple ((const jerry_char_t *) script_p, script_size, JERRY_INIT_EMPTY);
+} /* test_run_simple */
+
+static bool
+strict_equals (jerry_value_t a,
+               jerry_value_t b)
+{
+  bool is_strict_equal;
+  const char *is_equal_src;
+  jerry_value_t args[2];
+  jerry_value_t is_equal_fn_val;
+  jerry_value_t res;
+
+  is_equal_src = "var isEqual = function(a, b) { return (a === b); }; isEqual";
+  is_equal_fn_val = jerry_eval ((jerry_char_t *) is_equal_src, strlen (is_equal_src), false);
+  TEST_ASSERT (!jerry_value_has_error_flag (is_equal_fn_val));
+  args[0] = a;
+  args[1] = b;
+  res = jerry_call_function (is_equal_fn_val, jerry_create_undefined (), args, 2);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_boolean (res));
+  is_strict_equal = jerry_get_boolean_value (res);
+  jerry_release_value (res);
+  jerry_release_value (is_equal_fn_val);
+  return is_strict_equal;
+} /* strict_equals */
+
+int
+main (void)
+{
+  TEST_INIT ();
+
+  bool is_ok;
+  jerry_size_t sz, utf8_sz, cesu8_sz;
+  jerry_length_t cesu8_length, utf8_length;
+  jerry_value_t val_t, val_foo, val_bar, val_A, val_A_prototype, val_a, val_a_foo, val_value_field, val_p, val_np;
+  jerry_value_t val_call_external;
+  jerry_value_t global_obj_val, obj_val;
+  jerry_value_t external_func_val, external_construct_val;
+  jerry_value_t throw_test_handler_val;
+  jerry_value_t parsed_code_val, proto_val, prim_val;
+  jerry_value_t res, args[2];
+  double number_val;
+  char buffer[32];
+
+  is_ok = test_run_simple ("throw 'Hello World';");
+  TEST_ASSERT (!is_ok);
+
+  jerry_init (JERRY_INIT_EMPTY);
+
+  parsed_code_val = jerry_parse ((jerry_char_t *) test_source, strlen (test_source), false);
+  TEST_ASSERT (!jerry_value_has_error_flag (parsed_code_val));
+
+  res = jerry_run (parsed_code_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  jerry_release_value (res);
+  jerry_release_value (parsed_code_val);
+
+  global_obj_val = jerry_get_global_object ();
+
+  /* Test corner case for jerry_string_to_char_buffer */
+  args[0] = jerry_create_string ((jerry_char_t *) "");
+  sz = jerry_get_string_size (args[0]);
+  TEST_ASSERT (sz == 0);
+  jerry_release_value (args[0]);
+
+  /* Test create_jerry_string_from_utf8 with 4-byte long unicode sequences,
+   * test string: 'str: {DESERET CAPITAL LETTER LONG I}'
+   */
+  args[0] = jerry_create_string_from_utf8 ((jerry_char_t *) "\x73\x74\x72\x3a \xf0\x90\x90\x80");
+  args[1] = jerry_create_string ((jerry_char_t *) "\x73\x74\x72\x3a \xed\xa0\x81\xed\xb0\x80");
+
+  /* These sizes must be equal */
+  utf8_sz = jerry_get_string_size (args[0]);
+  cesu8_sz = jerry_get_string_size (args[1]);
+
+  char string_from_utf8[utf8_sz];
+  char string_from_cesu8[cesu8_sz];
+
+  jerry_string_to_char_buffer (args[0], (jerry_char_t *) string_from_utf8, utf8_sz);
+  jerry_string_to_char_buffer (args[1], (jerry_char_t *) string_from_cesu8, cesu8_sz);
+
+  TEST_ASSERT (utf8_sz == cesu8_sz);
+  TEST_ASSERT (!strncmp (string_from_utf8, string_from_cesu8, utf8_sz));
+  jerry_release_value (args[0]);
+  jerry_release_value (args[1]);
+
+  /* Test jerry_string_to_utf8_char_buffer, test string: 'str: {DESERET CAPITAL LETTER LONG I}' */
+  args[0] = jerry_create_string_from_utf8 ((jerry_char_t *) "\x73\x74\x72\x3a \xf0\x90\x90\x80");
+  args[1] = jerry_create_string ((jerry_char_t *) "\x73\x74\x72\x3a \xed\xa0\x81\xed\xb0\x80");
+
+  /* Test that the strings are equal / ensure hashes are equal */
+  TEST_ASSERT (strict_equals (args[0], args[1]));
+
+  /* These sizes must be equal */
+  utf8_sz = jerry_get_utf8_string_size (args[0]);
+  cesu8_sz = jerry_get_utf8_string_size (args[1]);
+
+  TEST_ASSERT (utf8_sz == cesu8_sz);
+
+  char string_from_utf8_string[utf8_sz];
+  char string_from_cesu8_string[cesu8_sz];
+
+  jerry_string_to_utf8_char_buffer (args[0], (jerry_char_t *) string_from_utf8_string, utf8_sz);
+  jerry_string_to_utf8_char_buffer (args[1], (jerry_char_t *) string_from_cesu8_string, cesu8_sz);
+
+  TEST_ASSERT (!strncmp (string_from_utf8_string, string_from_cesu8_string, utf8_sz));
+  jerry_release_value (args[0]);
+  jerry_release_value (args[1]);
+
+  /* Test string: 'str: {MATHEMATICAL FRAKTUR SMALL F}{MATHEMATICAL FRAKTUR SMALL G}' */
+  args[0] = jerry_create_string_from_utf8 ((jerry_char_t *) "\x73\x74\x72\x3a \xf0\x9d\x94\xa3 \xf0\x9d\x94\xa4");
+
+  cesu8_length = jerry_get_string_length (args[0]);
+  utf8_length = jerry_get_utf8_string_length (args[0]);
+
+  cesu8_sz = jerry_get_string_size (args[0]);
+  utf8_sz =  jerry_get_utf8_string_size (args[0]);
+
+  TEST_ASSERT (cesu8_length == 10 && utf8_length == 8);
+  TEST_ASSERT (cesu8_sz != utf8_sz);
+  TEST_ASSERT (utf8_sz == 14 && cesu8_sz == 18);
+
+  char test_string[utf8_sz];
+
+  TEST_ASSERT (jerry_string_to_utf8_char_buffer (args[0], (jerry_char_t *) test_string, utf8_sz) == 14);
+  TEST_ASSERT (!strncmp (test_string, "\x73\x74\x72\x3a \xf0\x9d\x94\xa3 \xf0\x9d\x94\xa4", utf8_sz));
+
+  sz = jerry_substring_to_utf8_char_buffer (args[0], 0, utf8_length, (jerry_char_t *) test_string, utf8_sz);
+  TEST_ASSERT (sz == 14);
+  TEST_ASSERT (!strncmp (test_string, "\x73\x74\x72\x3a \xf0\x9d\x94\xa3 \xf0\x9d\x94\xa4", sz));
+
+  sz = jerry_substring_to_utf8_char_buffer (args[0], 0, utf8_length + 1, (jerry_char_t *) test_string, utf8_sz);
+  TEST_ASSERT (sz == 14);
+  TEST_ASSERT (!strncmp (test_string, "\x73\x74\x72\x3a \xf0\x9d\x94\xa3 \xf0\x9d\x94\xa4", sz));
+
+  sz = jerry_substring_to_utf8_char_buffer (args[0], utf8_length, 0, (jerry_char_t *) test_string, utf8_sz);
+  TEST_ASSERT (sz == 0);
+
+  sz = jerry_substring_to_utf8_char_buffer (args[0], 0, utf8_length, (jerry_char_t *) test_string, utf8_sz - 1);
+  TEST_ASSERT (sz == 10);
+  TEST_ASSERT (!strncmp (test_string, "\x73\x74\x72\x3a \xf0\x9d\x94\xa3 ", sz));
+
+  sz = jerry_substring_to_utf8_char_buffer (args[0], 0, utf8_length - 1, (jerry_char_t *) test_string, utf8_sz);
+  TEST_ASSERT (sz == 10);
+  TEST_ASSERT (!strncmp (test_string, "\x73\x74\x72\x3a \xf0\x9d\x94\xa3 ", sz));
+
+  sz = jerry_substring_to_utf8_char_buffer (args[0],
+                                            utf8_length - 2,
+                                            utf8_length - 1,
+                                            (jerry_char_t *) test_string,
+                                            utf8_sz);
+  TEST_ASSERT (sz == 1);
+  TEST_ASSERT (!strncmp (test_string, " ", sz));
+
+  sz = jerry_substring_to_utf8_char_buffer (args[0],
+                                            utf8_length - 3,
+                                            utf8_length - 2,
+                                            (jerry_char_t *) test_string,
+                                            utf8_sz);
+  TEST_ASSERT (sz == 4);
+  TEST_ASSERT (!strncmp (test_string, "\xf0\x9d\x94\xa3", sz));
+
+  jerry_release_value (args[0]);
+
+  /* Test string: 'str: {DESERET CAPITAL LETTER LONG I}' */
+  args[0] = jerry_create_string ((jerry_char_t *) "\x73\x74\x72\x3a \xed\xa0\x81\xed\xb0\x80");
+
+  cesu8_length = jerry_get_string_length (args[0]);
+  utf8_length = jerry_get_utf8_string_length (args[0]);
+
+  cesu8_sz = jerry_get_string_size (args[0]);
+  utf8_sz =  jerry_get_utf8_string_size (args[0]);
+
+  TEST_ASSERT (cesu8_length == 7 && utf8_length == 6);
+  TEST_ASSERT (cesu8_sz != utf8_sz);
+  TEST_ASSERT (utf8_sz == 9 && cesu8_sz == 11);
+
+  jerry_release_value (args[0]);
+
+  /* Test string: 'price: 10{EURO SIGN}' */
+  args[0] = jerry_create_string_from_utf8 ((jerry_char_t *) "\x70\x72\x69\x63\x65\x3a \x31\x30\xe2\x82\xac");
+
+  cesu8_length = jerry_get_string_length (args[0]);
+  utf8_length = jerry_get_utf8_string_length (args[0]);
+
+  cesu8_sz = jerry_get_string_size (args[0]);
+  utf8_sz =  jerry_get_utf8_string_size (args[0]);
+
+  TEST_ASSERT (cesu8_length == utf8_length);
+  TEST_ASSERT (cesu8_length == 10);
+  TEST_ASSERT (cesu8_sz == utf8_sz);
+  TEST_ASSERT (utf8_sz == 12);
+  jerry_release_value (args[0]);
+
+  /* Test jerry_substring_to_char_buffer */
+  args[0] = jerry_create_string ((jerry_char_t *) "an ascii string");
+
+  /* Buffer size */
+  cesu8_sz = 5;
+
+  char substring[cesu8_sz];
+  sz = jerry_substring_to_char_buffer (args[0], 3, 8, (jerry_char_t *) substring, cesu8_sz);
+  TEST_ASSERT (sz == 5);
+  TEST_ASSERT (!strncmp (substring, "ascii", sz));
+
+  /* Buffer size is 5, substring length is 11 => copied only the first 5 char */
+  sz = jerry_substring_to_char_buffer (args[0], 0, 11, (jerry_char_t *) substring, cesu8_sz);
+
+  TEST_ASSERT (sz == 5);
+  TEST_ASSERT (!strncmp (substring, "an as", sz));
+
+  /* Position of the first character is greater than the string length */
+  sz = jerry_substring_to_char_buffer (args[0], 16, 21, (jerry_char_t *) substring, cesu8_sz);
+  TEST_ASSERT (sz == 0);
+
+  sz = jerry_substring_to_char_buffer (args[0], 14, 15, (jerry_char_t *) substring, cesu8_sz);
+  TEST_ASSERT (sz == 1);
+  TEST_ASSERT (!strncmp (substring, "g", sz));
+
+  sz = jerry_substring_to_char_buffer (args[0], 0, 1, (jerry_char_t *) substring, cesu8_sz);
+  TEST_ASSERT (sz == 1);
+  TEST_ASSERT (!strncmp (substring, "a", sz));
+
+  cesu8_length = jerry_get_string_length (args[0]);
+  cesu8_sz = jerry_get_string_size (args[0]);
+  TEST_ASSERT (cesu8_length == 15);
+  TEST_ASSERT (cesu8_length == cesu8_sz);
+
+  sz = jerry_substring_to_char_buffer (args[0], 0, cesu8_length, (jerry_char_t *) substring, cesu8_sz);
+  TEST_ASSERT (sz = 15);
+  TEST_ASSERT (!strncmp (substring, "an ascii string", sz));
+
+  jerry_release_value (args[0]);
+
+  /* Test jerry_substring_to_char_buffer: '0101' */
+  args[0] = jerry_create_string ((jerry_char_t *) "0101");
+  cesu8_sz = jerry_get_string_size (args[0]);
+
+  char number_substring[cesu8_sz];
+
+  sz = jerry_substring_to_char_buffer (args[0], 1, 3, (jerry_char_t *) number_substring, cesu8_sz);
+  TEST_ASSERT (sz == 2);
+  TEST_ASSERT (!strncmp (number_substring, "10", sz));
+
+  jerry_release_value (args[0]);
+
+  /* Test jerry_substring_to_char_buffer: 'str: {greek zero sign}' */
+  args[0] = jerry_create_string ((jerry_char_t *) "\x73\x74\x72\x3a \xed\xa0\x80\xed\xb6\x8a");
+  cesu8_sz = jerry_get_string_size (args[0]);
+  cesu8_length = jerry_get_string_length (args[0]);
+  TEST_ASSERT (cesu8_sz == 11);
+  TEST_ASSERT (cesu8_length = 7);
+
+  char supl_substring[cesu8_sz];
+
+  sz = jerry_substring_to_char_buffer (args[0], 0, cesu8_length, (jerry_char_t *) supl_substring, cesu8_sz);
+  TEST_ASSERT (sz == 11);
+  TEST_ASSERT (!strncmp (supl_substring, "\x73\x74\x72\x3a \xed\xa0\x80\xed\xb6\x8a", sz));
+
+  /* Decrease the buffer size => the low surrogate char will not fit into the buffer */
+  cesu8_sz -= 1;
+  sz = jerry_substring_to_char_buffer (args[0], 0, cesu8_length, (jerry_char_t *) supl_substring, cesu8_sz);
+  TEST_ASSERT (sz == 8);
+  TEST_ASSERT (!strncmp (supl_substring, "\x73\x74\x72\x3a \xed\xa0\x80", sz));
+
+  sz = jerry_substring_to_char_buffer (args[0],
+                                       cesu8_length - 1,
+                                       cesu8_length,
+                                       (jerry_char_t *) supl_substring,
+                                       cesu8_sz);
+  TEST_ASSERT (sz == 3);
+  TEST_ASSERT (!strncmp (supl_substring, "\xed\xb6\x8a", sz));
+
+  sz = jerry_substring_to_char_buffer (args[0],
+                                       cesu8_length - 2,
+                                       cesu8_length - 1,
+                                       (jerry_char_t *) supl_substring,
+                                       cesu8_sz);
+  TEST_ASSERT (sz == 3);
+  TEST_ASSERT (!strncmp (supl_substring, "\xed\xa0\x80", sz));
+
+  jerry_release_value (args[0]);
+
+  /* Get global.boo (non-existing field) */
+  val_t = get_property (global_obj_val, "boo");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_t));
+  TEST_ASSERT (jerry_value_is_undefined (val_t));
+
+  /* Get global.t */
+  val_t = get_property (global_obj_val, "t");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_t));
+  TEST_ASSERT (jerry_value_is_number (val_t)
+               && jerry_get_number_value (val_t) == 1.0);
+  jerry_release_value (val_t);
+
+  /* Get global.foo */
+  val_foo = get_property (global_obj_val, "foo");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_foo));
+  TEST_ASSERT (jerry_value_is_object (val_foo));
+
+  /* Call foo (4, 2) */
+  args[0] = jerry_create_number (4);
+  args[1] = jerry_create_number (2);
+  res = jerry_call_function (val_foo, jerry_create_undefined (), args, 2);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_number (res)
+               && jerry_get_number_value (res) == 1.0);
+  jerry_release_value (res);
+
+  /* Get global.bar */
+  val_bar = get_property (global_obj_val, "bar");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_bar));
+  TEST_ASSERT (jerry_value_is_object (val_bar));
+
+  /* Call bar (4, 2) */
+  res = jerry_call_function (val_bar, jerry_create_undefined (), args, 2);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_number (res)
+               && jerry_get_number_value (res) == 5.0);
+  jerry_release_value (res);
+  jerry_release_value (val_bar);
+
+  /* Set global.t = "abcd" */
+  jerry_release_value (args[0]);
+  args[0] = jerry_create_string ((jerry_char_t *) "abcd");
+  res = set_property (global_obj_val, "t", args[0]);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_get_boolean_value (res));
+  jerry_release_value (res);
+
+  /* Call foo (4, 2) */
+  res = jerry_call_function (val_foo, jerry_create_undefined (), args, 2);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_string (res));
+  sz = jerry_get_string_size (res);
+  TEST_ASSERT (sz == 4);
+  sz = jerry_string_to_char_buffer (res, (jerry_char_t *) buffer, sz);
+  TEST_ASSERT (sz == 4);
+  jerry_release_value (res);
+  TEST_ASSERT (!strncmp (buffer, "abcd", (size_t) sz));
+  jerry_release_value (args[0]);
+  jerry_release_value (args[1]);
+
+  /* Get global.A */
+  val_A = get_property (global_obj_val, "A");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_A));
+  TEST_ASSERT (jerry_value_is_object (val_A));
+
+  /* Get A.prototype */
+  is_ok = jerry_value_is_constructor (val_A);
+  TEST_ASSERT (is_ok);
+  val_A_prototype = get_property (val_A, "prototype");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_A_prototype));
+  TEST_ASSERT (jerry_value_is_object (val_A_prototype));
+  jerry_release_value (val_A);
+
+  /* Set A.prototype.foo = global.foo */
+  res = set_property (val_A_prototype, "foo", val_foo);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_get_boolean_value (res));
+  jerry_release_value (res);
+  jerry_release_value (val_A_prototype);
+  jerry_release_value (val_foo);
+
+  /* Get global.a */
+  val_a = get_property (global_obj_val, "a");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_a));
+  TEST_ASSERT (jerry_value_is_object (val_a));
+
+  /* Get a.t */
+  res = get_property (val_a, "t");
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_number (res)
+               && jerry_get_number_value (res) == 12.0);
+  jerry_release_value (res);
+
+  /* foreach properties */
+  val_p = get_property (global_obj_val, "p");
+  is_ok = jerry_foreach_object_property (val_p, foreach, (void *) "user_data");
+  TEST_ASSERT (is_ok);
+
+  /* break foreach at third element */
+  int count = 0;
+  is_ok = jerry_foreach_object_property (val_p, foreach_subset, &count);
+  TEST_ASSERT (is_ok);
+  TEST_ASSERT (count == 3);
+  jerry_release_value (val_p);
+
+  /* foreach with throw test */
+  val_np = get_property (global_obj_val, "np");
+  is_ok = !jerry_foreach_object_property (val_np, foreach_exception, NULL);
+  TEST_ASSERT (is_ok);
+  jerry_release_value (val_np);
+
+  /* Get a.foo */
+  val_a_foo = get_property (val_a, "foo");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_a_foo));
+  TEST_ASSERT (jerry_value_is_object (val_a_foo));
+
+  /* Call a.foo () */
+  res = jerry_call_function (val_a_foo, val_a, NULL, 0);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_number (res)
+               && jerry_get_number_value (res) == 12.0);
+  jerry_release_value (res);
+  jerry_release_value (val_a_foo);
+
+  jerry_release_value (val_a);
+
+  /* Create native handler bound function object and set it to 'external' variable */
+  external_func_val = jerry_create_external_function (handler);
+  TEST_ASSERT (jerry_value_is_function (external_func_val)
+               && jerry_value_is_constructor (external_func_val));
+
+  res = set_property (global_obj_val, "external", external_func_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_get_boolean_value (res));
+  jerry_release_value (external_func_val);
+
+  /* Call 'call_external' function that should call external function created above */
+  val_call_external = get_property (global_obj_val, "call_external");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_call_external));
+  TEST_ASSERT (jerry_value_is_object (val_call_external));
+  res = jerry_call_function (val_call_external, global_obj_val, NULL, 0);
+  jerry_release_value (val_call_external);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_string (res));
+  sz = jerry_get_string_size (res);
+  TEST_ASSERT (sz == 19);
+  sz = jerry_string_to_char_buffer (res, (jerry_char_t *) buffer, sz);
+  TEST_ASSERT (sz == 19);
+  jerry_release_value (res);
+  TEST_ASSERT (!strncmp (buffer, "string from handler", (size_t) sz));
+
+  /* Create native handler bound function object and set it to 'external_construct' variable */
+  external_construct_val = jerry_create_external_function (handler_construct);
+  TEST_ASSERT (jerry_value_is_function (external_construct_val)
+               && jerry_value_is_constructor (external_construct_val));
+
+  res = set_property (global_obj_val, "external_construct", external_construct_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_get_boolean_value (res));
+  jerry_release_value (res);
+
+  /* Call external function created above, as constructor */
+  args[0] = jerry_create_boolean (true);
+  res = jerry_construct_object (external_construct_val, args, 1);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_object (res));
+  val_value_field = get_property (res, "value_field");
+
+  /* Get 'value_field' of constructed object */
+  TEST_ASSERT (!jerry_value_has_error_flag (val_value_field));
+  TEST_ASSERT (jerry_value_is_boolean (val_value_field)
+               && jerry_get_boolean_value (val_value_field));
+  jerry_release_value (val_value_field);
+  jerry_release_value (external_construct_val);
+
+  void *ptr = NULL;
+  const jerry_object_native_info_t *out_info_p;
+  is_ok = jerry_get_object_native_pointer (res, &ptr, &out_info_p);
+  TEST_ASSERT (is_ok
+               && (uintptr_t) ptr == (uintptr_t) 0x0012345678abcdefull
+               && out_info_p == &JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE (bind2));
+
+  /* Passing NULL for out_info_p is allowed. */
+  is_ok = jerry_get_object_native_pointer (res, &ptr, NULL);
+  TEST_ASSERT (is_ok
+               && (uintptr_t) ptr == (uintptr_t) 0x0012345678abcdefull);
+
+  jerry_release_value (res);
+
+  /* Test: It is ok to set native pointer's free callback as NULL. */
+  jerry_value_t obj_freecb = jerry_create_object ();
+  jerry_set_object_native_pointer (obj_freecb,
+                                   (void *) 0x1234,
+                                   &JERRY_NATIVE_HANDLE_INFO_FOR_CTYPE (bind3));
+
+  jerry_release_value (obj_freecb);
+
+  /* Test: Throwing exception from native handler. */
+  throw_test_handler_val = jerry_create_external_function (handler_throw_test);
+  TEST_ASSERT (jerry_value_is_function (throw_test_handler_val));
+
+  res = set_property (global_obj_val, "throw_test", throw_test_handler_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_get_boolean_value (res));
+  jerry_release_value (res);
+  jerry_release_value (throw_test_handler_val);
+
+  val_t = get_property (global_obj_val, "call_throw_test");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_t));
+  TEST_ASSERT (jerry_value_is_object (val_t));
+
+  res = jerry_call_function (val_t, global_obj_val, NULL, 0);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  jerry_release_value (val_t);
+  jerry_release_value (res);
+
+  /* Test: Unhandled exception in called function */
+  val_t = get_property (global_obj_val, "throw_reference_error");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_t));
+  TEST_ASSERT (jerry_value_is_object (val_t));
+
+  res = jerry_call_function (val_t, global_obj_val, NULL, 0);
+
+  TEST_ASSERT (jerry_value_has_error_flag (res));
+  jerry_release_value (val_t);
+
+  /* 'res' should contain exception object */
+  TEST_ASSERT (jerry_value_is_object (res));
+  jerry_release_value (res);
+
+  /* Test: Call of non-function */
+  obj_val = jerry_create_object ();
+  res = jerry_call_function (obj_val, global_obj_val, NULL, 0);
+  TEST_ASSERT (jerry_value_has_error_flag (res));
+
+  /* 'res' should contain exception object */
+  TEST_ASSERT (jerry_value_is_object (res));
+  jerry_release_value (res);
+
+  jerry_release_value (obj_val);
+
+  /* Test: Unhandled exception in function called, as constructor */
+  val_t = get_property (global_obj_val, "throw_reference_error");
+  TEST_ASSERT (!jerry_value_has_error_flag (val_t));
+  TEST_ASSERT (jerry_value_is_object (val_t));
+
+  res = jerry_construct_object (val_t, NULL, 0);
+  TEST_ASSERT (jerry_value_has_error_flag (res));
+  jerry_release_value (val_t);
+
+  /* 'res' should contain exception object */
+  TEST_ASSERT (jerry_value_is_object (res));
+  jerry_release_value (res);
+
+  /* Test: Call of non-function as constructor */
+  obj_val = jerry_create_object ();
+  res = jerry_construct_object (obj_val, NULL, 0);
+  TEST_ASSERT (jerry_value_has_error_flag (res));
+
+  /* 'res' should contain exception object */
+  TEST_ASSERT (jerry_value_is_object (res));
+  jerry_release_value (res);
+
+  jerry_release_value (obj_val);
+
+  /* Test: Array Object API */
+  jerry_value_t array_obj_val = jerry_create_array (10);
+  TEST_ASSERT (jerry_value_is_array (array_obj_val));
+  TEST_ASSERT (jerry_get_array_length (array_obj_val) == 10);
+
+  jerry_value_t v_in = jerry_create_number (10.5);
+  jerry_set_property_by_index (array_obj_val, 5, v_in);
+  jerry_value_t v_out = jerry_get_property_by_index (array_obj_val, 5);
+
+  TEST_ASSERT (jerry_value_is_number (v_out)
+               && jerry_get_number_value (v_out) == 10.5);
+
+  jerry_release_value (v_in);
+  jerry_release_value (v_out);
+  jerry_release_value (array_obj_val);
+
+  /* Test: init property descriptor */
+  jerry_property_descriptor_t prop_desc;
+  jerry_init_property_descriptor_fields (&prop_desc);
+  TEST_ASSERT (prop_desc.is_value_defined == false);
+  TEST_ASSERT (jerry_value_is_undefined (prop_desc.value));
+  TEST_ASSERT (prop_desc.is_writable_defined == false);
+  TEST_ASSERT (prop_desc.is_writable == false);
+  TEST_ASSERT (prop_desc.is_enumerable_defined == false);
+  TEST_ASSERT (prop_desc.is_enumerable == false);
+  TEST_ASSERT (prop_desc.is_configurable_defined == false);
+  TEST_ASSERT (prop_desc.is_configurable == false);
+  TEST_ASSERT (prop_desc.is_get_defined == false);
+  TEST_ASSERT (jerry_value_is_undefined (prop_desc.getter));
+  TEST_ASSERT (prop_desc.is_set_defined == false);
+  TEST_ASSERT (jerry_value_is_undefined (prop_desc.setter));
+
+  /* Test: define own properties */
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_defined_property");
+  prop_desc.is_value_defined = true;
+  prop_desc.value = jerry_acquire_value (prop_name);
+  res = jerry_define_own_property (global_obj_val, prop_name, &prop_desc);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_boolean (res));
+  TEST_ASSERT (jerry_get_boolean_value (res));
+  jerry_release_value (res);
+  jerry_free_property_descriptor_fields (&prop_desc);
+
+  /* Test: get own property descriptor */
+  is_ok = jerry_get_own_property_descriptor (global_obj_val, prop_name, &prop_desc);
+  TEST_ASSERT (is_ok);
+  TEST_ASSERT (prop_desc.is_value_defined == true);
+  TEST_ASSERT (jerry_value_is_string (prop_desc.value));
+  TEST_ASSERT (prop_desc.is_writable == false);
+  TEST_ASSERT (prop_desc.is_enumerable == false);
+  TEST_ASSERT (prop_desc.is_configurable == false);
+  TEST_ASSERT (prop_desc.is_get_defined == false);
+  TEST_ASSERT (jerry_value_is_undefined (prop_desc.getter));
+  TEST_ASSERT (prop_desc.is_set_defined == false);
+  TEST_ASSERT (jerry_value_is_undefined (prop_desc.setter));
+  jerry_release_value (prop_name);
+  jerry_free_property_descriptor_fields (&prop_desc);
+
+  /* Test: object keys */
+  res = jerry_get_object_keys (global_obj_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_array (res));
+  jerry_release_value (res);
+
+  /* Test: jerry_value_to_primitive */
+  obj_val = jerry_eval ((jerry_char_t *) "new String ('hello')", 20, false);
+  TEST_ASSERT (!jerry_value_has_error_flag (obj_val));
+  TEST_ASSERT (jerry_value_is_object (obj_val));
+  TEST_ASSERT (!jerry_value_is_string (obj_val));
+  prim_val = jerry_value_to_primitive (obj_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (prim_val));
+  TEST_ASSERT (jerry_value_is_string (prim_val));
+  jerry_release_value (prim_val);
+
+  /* Test: jerry_get_prototype */
+  proto_val = jerry_get_prototype (obj_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (proto_val));
+  TEST_ASSERT (jerry_value_is_object (proto_val));
+  jerry_release_value (obj_val);
+
+  /* Test: jerry_set_prototype */
+  obj_val = jerry_create_object ();
+  res = jerry_set_prototype (obj_val, jerry_create_null ());
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_boolean (res));
+  TEST_ASSERT (jerry_get_boolean_value (res));
+
+  res = jerry_set_prototype (obj_val, jerry_create_object ());
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_boolean (res));
+  TEST_ASSERT (jerry_get_boolean_value (res));
+  proto_val = jerry_get_prototype (obj_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (proto_val));
+  TEST_ASSERT (jerry_value_is_object (proto_val));
+  jerry_release_value (proto_val);
+  jerry_release_value (obj_val);
+
+  /* Test: eval */
+  const char *eval_code_src_p = "(function () { return 123; })";
+  val_t = jerry_eval ((jerry_char_t *) eval_code_src_p, strlen (eval_code_src_p), true);
+  TEST_ASSERT (!jerry_value_has_error_flag (val_t));
+  TEST_ASSERT (jerry_value_is_object (val_t));
+  TEST_ASSERT (jerry_value_is_function (val_t));
+
+  res = jerry_call_function (val_t, jerry_create_undefined (), NULL, 0);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (jerry_value_is_number (res)
+               && jerry_get_number_value (res) == 123.0);
+  jerry_release_value (res);
+
+  jerry_release_value (val_t);
+
+  /* cleanup. */
+  jerry_release_value (global_obj_val);
+
+  /* Test: run gc. */
+  jerry_gc ();
+
+  /* Test: spaces */
+  eval_code_src_p = "\x0a \x0b \x0c \xc2\xa0 \xe2\x80\xa8 \xe2\x80\xa9 \xef\xbb\xbf 4321";
+  val_t = jerry_eval ((jerry_char_t *) eval_code_src_p, strlen (eval_code_src_p), true);
+  TEST_ASSERT (!jerry_value_has_error_flag (val_t));
+  TEST_ASSERT (jerry_value_is_number (val_t)
+               && jerry_get_number_value (val_t) == 4321.0);
+  jerry_release_value (val_t);
+
+  /* Test: number */
+  val_t = jerry_create_number (6.25);
+  number_val = jerry_get_number_value (val_t);
+  TEST_ASSERT (number_val * 3 == 18.75);
+  jerry_release_value (val_t);
+
+  val_t = jerry_create_number_infinity (true);
+  number_val = jerry_get_number_value (val_t);
+  TEST_ASSERT (number_val * 3 == number_val && number_val != 0.0);
+  jerry_release_value (val_t);
+
+  val_t = jerry_create_number_nan ();
+  number_val = jerry_get_number_value (val_t);
+  TEST_ASSERT (number_val != number_val);
+  jerry_release_value (val_t);
+
+  jerry_cleanup ();
+
+  TEST_ASSERT (test_api_is_free_callback_was_called);
+
+  /* Test: parser error location */
+  if (jerry_is_feature_enabled (JERRY_FEATURE_ERROR_MESSAGES))
+  {
+    jerry_init (JERRY_INIT_SHOW_OPCODES);
+
+    const char *parser_err_src_p = "b = 'hello';\nvar a = (;";
+    parsed_code_val = jerry_parse ((jerry_char_t *) parser_err_src_p,
+                                   strlen (parser_err_src_p),
+                                   false);
+    TEST_ASSERT (jerry_value_has_error_flag (parsed_code_val));
+    jerry_value_clear_error_flag (&parsed_code_val);
+    jerry_value_t err_str_val = jerry_value_to_string (parsed_code_val);
+    jerry_size_t err_str_size = jerry_get_string_size (err_str_val);
+    jerry_char_t err_str_buf[256];
+    sz = jerry_string_to_char_buffer (err_str_val, err_str_buf, err_str_size);
+    err_str_buf[sz] = 0;
+
+    jerry_release_value (err_str_val);
+    jerry_release_value (parsed_code_val);
+    TEST_ASSERT (!strcmp ((char *) err_str_buf,
+                          "SyntaxError: Primary expression expected. [line: 2, column: 10]"));
+
+    jerry_cleanup ();
+  }
+
+  /* Test stopping an infinite loop. */
+  if (jerry_is_feature_enabled (JERRY_FEATURE_VM_EXEC_STOP))
+  {
+    jerry_init (JERRY_INIT_EMPTY);
+
+    int countdown = 6;
+    jerry_set_vm_exec_stop_callback (vm_exec_stop_callback, &countdown, 16);
+
+    const char *inf_loop_code_src_p = "while(true) {}";
+    parsed_code_val = jerry_parse ((jerry_char_t *) inf_loop_code_src_p, strlen (inf_loop_code_src_p), false);
+    TEST_ASSERT (!jerry_value_has_error_flag (parsed_code_val));
+    res = jerry_run (parsed_code_val);
+    TEST_ASSERT (countdown == 0);
+
+    TEST_ASSERT (jerry_value_has_error_flag (res));
+
+    jerry_release_value (res);
+    jerry_release_value (parsed_code_val);
+
+    /* A more complex example. Although the callback error is captured
+     * by the catch block, it is automatically thrown again. */
+
+    /* We keep the callback function, only the countdown is reset. */
+    countdown = 6;
+
+    inf_loop_code_src_p = ("function f() { while (true) ; }\n"
+                           "try { f(); } catch(e) {}");
+
+    parsed_code_val = jerry_parse ((jerry_char_t *) inf_loop_code_src_p, strlen (inf_loop_code_src_p), false);
+
+    TEST_ASSERT (!jerry_value_has_error_flag (parsed_code_val));
+    res = jerry_run (parsed_code_val);
+    TEST_ASSERT (countdown == 0);
+
+    /* The result must have an error flag which proves that
+     * the error is thrown again inside the catch block. */
+    TEST_ASSERT (jerry_value_has_error_flag (res));
+
+    jerry_release_value (res);
+    jerry_release_value (parsed_code_val);
+
+    jerry_cleanup ();
+  }
+
+  /* External Magic String */
+  jerry_init (JERRY_INIT_SHOW_OPCODES);
+
+  uint32_t num_magic_string_items = (uint32_t) (sizeof (magic_string_items) / sizeof (jerry_char_ptr_t));
+  jerry_register_magic_strings (magic_string_items,
+                                num_magic_string_items,
+                                magic_string_lengths);
+
+  const char *ms_code_src_p = "var global = {}; var console = [1]; var process = 1;";
+  parsed_code_val = jerry_parse ((jerry_char_t *) ms_code_src_p, strlen (ms_code_src_p), false);
+  TEST_ASSERT (!jerry_value_has_error_flag (parsed_code_val));
+
+  res = jerry_run (parsed_code_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  jerry_release_value (res);
+  jerry_release_value (parsed_code_val);
+
+  /* call jerry_create_string functions which will returns with the registered external magic strings */
+  args[0] = jerry_create_string ((jerry_char_t *) "console");
+  args[1] = jerry_create_string ((jerry_char_t *) "\xed\xa0\x80\xed\xb6\x8a"); /**< greek zero sign */
+
+  cesu8_length = jerry_get_string_length (args[0]);
+  cesu8_sz = jerry_get_string_size (args[0]);
+
+  char string_console[cesu8_sz];
+  jerry_string_to_char_buffer (args[0], (jerry_char_t *) string_console, cesu8_sz);
+
+  TEST_ASSERT (!strncmp (string_console, "console", cesu8_sz));
+  TEST_ASSERT (cesu8_length == 7);
+  TEST_ASSERT (cesu8_length == cesu8_sz);
+
+  jerry_release_value (args[0]);
+
+  cesu8_length = jerry_get_string_length (args[1]);
+  cesu8_sz = jerry_get_string_size (args[1]);
+
+  char string_greek_zero_sign[cesu8_sz];
+  jerry_string_to_char_buffer (args[1], (jerry_char_t *) string_greek_zero_sign, cesu8_sz);
+
+  TEST_ASSERT (!strncmp (string_greek_zero_sign, "\xed\xa0\x80\xed\xb6\x8a", cesu8_sz));
+  TEST_ASSERT (cesu8_length == 2);
+  TEST_ASSERT (cesu8_sz == 6);
+
+  jerry_release_value (args[1]);
+
+  jerry_cleanup ();
+
+  /* Dump / execute snapshot */
+  if (jerry_is_feature_enabled (JERRY_FEATURE_SNAPSHOT_SAVE)
+      && jerry_is_feature_enabled (JERRY_FEATURE_SNAPSHOT_EXEC))
+  {
+    static uint32_t global_mode_snapshot_buffer[SNAPSHOT_BUFFER_SIZE];
+    static uint32_t eval_mode_snapshot_buffer[SNAPSHOT_BUFFER_SIZE];
+
+    const char *code_to_snapshot_p = "(function () { return 'string from snapshot'; }) ();";
+
+    jerry_init (JERRY_INIT_SHOW_OPCODES);
+    size_t global_mode_snapshot_size = jerry_parse_and_save_snapshot ((jerry_char_t *) code_to_snapshot_p,
+                                                                      strlen (code_to_snapshot_p),
+                                                                      true,
+                                                                      false,
+                                                                      global_mode_snapshot_buffer,
+                                                                      SNAPSHOT_BUFFER_SIZE);
+    TEST_ASSERT (global_mode_snapshot_size != 0);
+    jerry_cleanup ();
+
+    jerry_init (JERRY_INIT_SHOW_OPCODES);
+    size_t eval_mode_snapshot_size = jerry_parse_and_save_snapshot ((jerry_char_t *) code_to_snapshot_p,
+                                                                    strlen (code_to_snapshot_p),
+                                                                    false,
+                                                                    false,
+                                                                    eval_mode_snapshot_buffer,
+                                                                    SNAPSHOT_BUFFER_SIZE);
+    TEST_ASSERT (eval_mode_snapshot_size != 0);
+    jerry_cleanup ();
+
+    jerry_init (JERRY_INIT_SHOW_OPCODES);
+
+    res = jerry_exec_snapshot (global_mode_snapshot_buffer,
+                               global_mode_snapshot_size,
+                               false);
+
+    TEST_ASSERT (!jerry_value_has_error_flag (res));
+    TEST_ASSERT (jerry_value_is_string (res));
+    sz = jerry_get_string_size (res);
+    TEST_ASSERT (sz == 20);
+    sz = jerry_string_to_char_buffer (res, (jerry_char_t *) buffer, sz);
+    TEST_ASSERT (sz == 20);
+    jerry_release_value (res);
+    TEST_ASSERT (!strncmp (buffer, "string from snapshot", (size_t) sz));
+
+    res = jerry_exec_snapshot (eval_mode_snapshot_buffer,
+                               eval_mode_snapshot_size,
+                               false);
+
+    TEST_ASSERT (!jerry_value_has_error_flag (res));
+    TEST_ASSERT (jerry_value_is_string (res));
+    sz = jerry_get_string_size (res);
+    TEST_ASSERT (sz == 20);
+    sz = jerry_string_to_char_buffer (res, (jerry_char_t *) buffer, sz);
+    TEST_ASSERT (sz == 20);
+    jerry_release_value (res);
+    TEST_ASSERT (!strncmp (buffer, "string from snapshot", (size_t) sz));
+
+    jerry_cleanup ();
+  }
+
+  /* Save literals */
+  if (jerry_is_feature_enabled (JERRY_FEATURE_SNAPSHOT_SAVE))
+  {
+    /* C format generation */
+    jerry_init (JERRY_INIT_EMPTY);
+
+    static uint32_t literal_buffer_c[SNAPSHOT_BUFFER_SIZE];
+    static const char *code_for_c_format_p = "var object = { aa:'fo o', Bb:'max', aaa:'xzy0' };";
+
+    size_t literal_sizes_c_format = jerry_parse_and_save_literals ((jerry_char_t *) code_for_c_format_p,
+                                                                   strlen (code_for_c_format_p),
+                                                                   false,
+                                                                   literal_buffer_c,
+                                                                   SNAPSHOT_BUFFER_SIZE,
+                                                                   true);
+    TEST_ASSERT (literal_sizes_c_format == 203);
+
+    static const char *expected_c_format = (
+                                            "jerry_length_t literal_count = 4;\n\n"
+                                            "jerry_char_ptr_t literals[4] =\n"
+                                            "{\n"
+                                            "  \"Bb\",\n"
+                                            "  \"aa\",\n"
+                                            "  \"aaa\",\n"
+                                            "  \"xzy0\"\n"
+                                            "};\n\n"
+                                            "jerry_length_t literal_sizes[4] =\n"
+                                            "{\n"
+                                            "  2 /* Bb */,\n"
+                                            "  2 /* aa */,\n"
+                                            "  3 /* aaa */,\n"
+                                            "  4 /* xzy0 */\n"
+                                            "};\n"
+                                            );
+
+    TEST_ASSERT (!strncmp ((char *) literal_buffer_c, expected_c_format, literal_sizes_c_format));
+    jerry_cleanup ();
+
+    /* List format generation */
+    jerry_init (JERRY_INIT_EMPTY);
+
+    static uint32_t literal_buffer_list[SNAPSHOT_BUFFER_SIZE];
+    static const char *code_for_list_format_p = "var obj = { a:'aa', bb:'Bb' };";
+
+    size_t literal_sizes_list_format = jerry_parse_and_save_literals ((jerry_char_t *) code_for_list_format_p,
+                                                                      strlen (code_for_list_format_p),
+                                                                      false,
+                                                                      literal_buffer_list,
+                                                                      SNAPSHOT_BUFFER_SIZE,
+                                                                      false);
+
+    TEST_ASSERT (literal_sizes_list_format == 25);
+    TEST_ASSERT (!strncmp ((char *) literal_buffer_list, "1 a\n2 Bb\n2 aa\n2 bb\n3 obj\n", literal_sizes_list_format));
+
+    jerry_cleanup ();
+  }
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-common.h b/deps/jerry/tests/unit-core/test-common.h
new file mode 100644 (file)
index 0000000..6200a8a
--- /dev/null
@@ -0,0 +1,71 @@
+/* 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.
+ */
+
+#ifndef TEST_COMMON_H
+#define TEST_COMMON_H
+
+#include "jrt.h"
+
+#include <math.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define TEST_ASSERT(x) \
+  do \
+  { \
+    if (unlikely (!(x))) \
+    { \
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, \
+                      "TEST: Assertion '%s' failed at %s(%s):%lu.\n", \
+                      #x, \
+                      __FILE__, \
+                      __func__, \
+                      (unsigned long) __LINE__); \
+      jerry_fatal (ERR_FAILED_INTERNAL_ASSERTION); \
+    } \
+  } while (0)
+
+/**
+ * Test initialization statement that should be included
+ * at the beginning of main function in every unit test.
+ */
+#define TEST_INIT() \
+do \
+{ \
+  FILE *f_rnd = fopen ("/dev/urandom", "r"); \
+ \
+  if (f_rnd == NULL) \
+  { \
+    return 1; \
+  } \
+ \
+  uint32_t seed; \
+ \
+  size_t bytes_read = fread (&seed, 1, sizeof (seed), f_rnd); \
+ \
+ fclose (f_rnd); \
+ \
+  if (bytes_read != sizeof (seed)) \
+  { \
+    return 1; \
+  } \
+ \
+  srand (seed); \
+} while (0)
+
+#endif /* TEST_COMMON_H */
diff --git a/deps/jerry/tests/unit-core/test-context-data.c b/deps/jerry/tests/unit-core/test-context-data.c
new file mode 100644 (file)
index 0000000..5c0c604
--- /dev/null
@@ -0,0 +1,95 @@
+/* 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.
+ */
+
+#include "config.h"
+#include "jerryscript.h"
+#include "test-common.h"
+
+static bool test_context_data1_new_called = false;
+static bool test_context_data2_new_called = false;
+static bool test_context_data1_free_called = false;
+static bool test_context_data2_free_called = false;
+
+/* Context item 1 */
+const char *string1 = "item1";
+
+static void
+test_context_data1_new (void *user_data_p)
+{
+  test_context_data1_new_called = true;
+  *((const char **) user_data_p) = string1;
+} /* test_context_data1_new */
+
+static void
+test_context_data1_free (void *user_data_p)
+{
+  test_context_data1_free_called = true;
+  TEST_ASSERT ((*(const char **) user_data_p) == string1);
+} /* test_context_data1_free */
+
+static const jerry_context_data_manager_t manager1 =
+{
+  .init_cb = test_context_data1_new,
+  .deinit_cb = test_context_data1_free,
+  .bytes_needed = sizeof (const char *)
+};
+
+/* Context item 2 */
+const char *string2 = "item2";
+
+static void
+test_context_data2_new (void *user_data_p)
+{
+  test_context_data2_new_called = true;
+  *((const char **) user_data_p) = string2;
+} /* test_context_data2_new */
+
+static void
+test_context_data2_free (void *user_data_p)
+{
+  test_context_data2_free_called = true;
+  TEST_ASSERT ((*(const char **) user_data_p) == string2);
+} /* test_context_data2_free */
+
+static const jerry_context_data_manager_t manager2 =
+{
+  .init_cb = test_context_data2_new,
+  .deinit_cb = test_context_data2_free,
+  .bytes_needed = sizeof (const char *)
+};
+
+int
+main (void)
+{
+  TEST_INIT ();
+
+  jerry_init (JERRY_INIT_EMPTY);
+
+  TEST_ASSERT (!strcmp (*((const char **) jerry_get_context_data (&manager1)), "item1"));
+  TEST_ASSERT (!strcmp (*((const char **) jerry_get_context_data (&manager2)), "item2"));
+
+  TEST_ASSERT (test_context_data1_new_called);
+  TEST_ASSERT (test_context_data2_new_called);
+
+  TEST_ASSERT (!test_context_data1_free_called);
+  TEST_ASSERT (!test_context_data2_free_called);
+
+  jerry_cleanup ();
+
+  TEST_ASSERT (test_context_data1_free_called);
+  TEST_ASSERT (test_context_data2_free_called);
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-date-helpers.c b/deps/jerry/tests/unit-core/test-date-helpers.c
new file mode 100644 (file)
index 0000000..426dabd
--- /dev/null
@@ -0,0 +1,139 @@
+/* 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.
+ */
+
+#include "ecma-builtin-helpers.h"
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+
+#include "test-common.h"
+
+#define MS_PER_DAY ((ecma_number_t) 86400000)
+#define MS_PER_YEAR ((ecma_number_t) 365 * MS_PER_DAY)
+#define START_OF_GREGORIAN_CALENDAR ((ecma_number_t) (-1970 * MS_PER_YEAR \
+  - (1970 / 4) * MS_PER_DAY \
+  + (1970 / 100) * MS_PER_DAY \
+  - (1970 / 400) * MS_PER_DAY \
+  - MS_PER_DAY))
+
+/**
+ * Unit test's main function.
+ */
+int
+main (void)
+{
+  /* int ecma_date_day (time)*/
+
+  TEST_ASSERT (ecma_date_day (0) == 0);
+  TEST_ASSERT (ecma_date_day (MS_PER_DAY) == 1);
+
+  /* ecma_number_t ecma_date_time_within_day (time) */
+
+  TEST_ASSERT (ecma_date_time_within_day (0) == 0);
+  TEST_ASSERT (ecma_date_time_within_day (42) == 42);
+  TEST_ASSERT (ecma_date_time_within_day (42.51) == 42.51);
+  TEST_ASSERT (ecma_date_time_within_day (MS_PER_DAY + 42) == 42);
+
+  /* int ecma_date_year_from_time (time) */
+
+  TEST_ASSERT (ecma_date_year_from_time (0) == 1970);
+  TEST_ASSERT (ecma_date_year_from_time (0) == 1970);
+  TEST_ASSERT (ecma_date_year_from_time (MS_PER_DAY) == 1970);
+  TEST_ASSERT (ecma_date_year_from_time ((MS_PER_DAY) * (ecma_number_t) 365 - 1) == 1970);
+  TEST_ASSERT (ecma_date_year_from_time (MS_PER_DAY * (ecma_number_t) 365) == 1971);
+  TEST_ASSERT (ecma_date_year_from_time (MS_PER_DAY * (ecma_number_t) (365 * (2015 - 1970)))
+                == 2014);
+  TEST_ASSERT (ecma_date_year_from_time (MS_PER_DAY * (ecma_number_t) (365.25 * (2015 - 1970)))
+                == 2015);
+  TEST_ASSERT (ecma_date_year_from_time (-MS_PER_YEAR) == 1969);
+  TEST_ASSERT (ecma_date_year_from_time (-1970 * MS_PER_YEAR) == 1);
+  TEST_ASSERT (ecma_date_year_from_time (START_OF_GREGORIAN_CALENDAR) == 0);
+  TEST_ASSERT (ecma_date_year_from_time (START_OF_GREGORIAN_CALENDAR - 1) == -1);
+  TEST_ASSERT (ecma_date_year_from_time (START_OF_GREGORIAN_CALENDAR - 3 * MS_PER_YEAR) == -3);
+
+  /* int ecma_date_month_from_time  (time) */
+
+  TEST_ASSERT (ecma_date_month_from_time (START_OF_GREGORIAN_CALENDAR) == 0);
+  TEST_ASSERT (ecma_date_month_from_time (0) == 0);
+  TEST_ASSERT (ecma_date_month_from_time (-MS_PER_DAY) == 11);
+  TEST_ASSERT (ecma_date_month_from_time (31 * MS_PER_DAY) == 1);
+
+  /* int ecma_date_date_from_time  (time) */
+
+  TEST_ASSERT (ecma_date_date_from_time (START_OF_GREGORIAN_CALENDAR) == 1);
+  TEST_ASSERT (ecma_date_date_from_time (0) == 1);
+  TEST_ASSERT (ecma_date_date_from_time (-MS_PER_DAY) == 31);
+  TEST_ASSERT (ecma_date_date_from_time (31 * MS_PER_DAY) == 1);
+
+  /* int ecma_date_week_day (ecma_number_t time) */
+
+  /* FIXME: Implement */
+
+  /* ecma_number_t ecma_date_utc (time) */
+
+  /* FIXME: Implement */
+
+  /* ecma_number_t ecma_date_hour_from_time (time) */
+
+  TEST_ASSERT (ecma_date_hour_from_time (START_OF_GREGORIAN_CALENDAR) == 0);
+  TEST_ASSERT (ecma_date_hour_from_time (0) == 0);
+  TEST_ASSERT (ecma_date_hour_from_time (-MS_PER_DAY) == 0);
+  TEST_ASSERT (ecma_date_hour_from_time (-1) == 23);
+
+  /* ecma_number_t ecma_date_min_from_time (time) */
+
+  TEST_ASSERT (ecma_date_min_from_time (START_OF_GREGORIAN_CALENDAR) == 0);
+  TEST_ASSERT (ecma_date_min_from_time (0) == 0);
+  TEST_ASSERT (ecma_date_min_from_time (-MS_PER_DAY) == 0);
+  TEST_ASSERT (ecma_date_min_from_time (-1) == 59);
+
+  /* ecma_number_t ecma_date_sec_from_time (time) */
+
+  TEST_ASSERT (ecma_date_sec_from_time (START_OF_GREGORIAN_CALENDAR) == 0);
+  TEST_ASSERT (ecma_date_sec_from_time (0) == 0);
+  TEST_ASSERT (ecma_date_sec_from_time (-MS_PER_DAY) == 0);
+  TEST_ASSERT (ecma_date_sec_from_time (-1) == 59);
+
+  /* ecma_number_t ecma_date_ms_from_time (time) */
+
+  TEST_ASSERT (ecma_date_ms_from_time (START_OF_GREGORIAN_CALENDAR) == 0);
+  TEST_ASSERT (ecma_date_ms_from_time (0) == 0);
+  TEST_ASSERT (ecma_date_ms_from_time (-MS_PER_DAY) == 0);
+  TEST_ASSERT (ecma_date_ms_from_time (-1) == 999);
+
+  /* ecma_number_t ecma_date_make_time (hour, min, sec, ms) */
+
+  /* FIXME: Implement */
+
+  /* ecma_number_t ecma_date_make_day (year, month, date) */
+
+  TEST_ASSERT (ecma_date_make_day (1970, 0, 1) == 0);
+  TEST_ASSERT (ecma_date_make_day (1970, -1, 1) == -31);
+  TEST_ASSERT (ecma_date_make_day (1970, 0, 2.5) == 1);
+  TEST_ASSERT (ecma_date_make_day (1970, 1, 35) == 65);
+  TEST_ASSERT (ecma_date_make_day (1970, 13, 35) == 430);
+  TEST_ASSERT (ecma_date_make_day (2016, 2, 1) == 16861);
+  TEST_ASSERT (ecma_date_make_day (2016, 8, 31) == 17075);
+  TEST_ASSERT (ecma_date_make_day (2016, 9, 1) == 17075);
+
+  /* ecma_number_t ecma_date_make_date (day, time) */
+
+  /* FIXME: Implement */
+
+  /* ecma_number_t ecma_date_time_clip (year) */
+
+  /* FIXME: Implement */
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-has-property.c b/deps/jerry/tests/unit-core/test-has-property.c
new file mode 100644 (file)
index 0000000..95ffe5b
--- /dev/null
@@ -0,0 +1,71 @@
+/* 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.
+ */
+
+#include "config.h"
+#include "jerryscript.h"
+#include "test-common.h"
+
+static void
+assert_boolean_and_release (jerry_value_t result, bool expected)
+{
+  TEST_ASSERT (jerry_value_is_boolean (result));
+  TEST_ASSERT (jerry_get_boolean_value (result) == expected);
+  jerry_release_value (result);
+} /* assert_boolean_and_release */
+
+int
+main (void)
+{
+  TEST_INIT ();
+
+  jerry_init (JERRY_INIT_EMPTY);
+
+  jerry_value_t object = jerry_create_object ();
+  jerry_value_t prop_name = jerry_create_string_from_utf8 ((jerry_char_t *) "something");
+  jerry_value_t prop_value = jerry_create_boolean (true);
+  jerry_value_t proto_object = jerry_create_object ();
+
+  /* Assert that an empty object does not have the property in question */
+  assert_boolean_and_release (jerry_has_property (object, prop_name), false);
+  assert_boolean_and_release (jerry_has_own_property (object, prop_name), false);
+
+  assert_boolean_and_release (jerry_set_prototype (object, proto_object), true);
+
+  /* If the object has a prototype, that still means it doesn't have the property */
+  assert_boolean_and_release (jerry_has_property (object, prop_name), false);
+  assert_boolean_and_release (jerry_has_own_property (object, prop_name), false);
+
+  assert_boolean_and_release (jerry_set_property (proto_object, prop_name, prop_value), true);
+
+  /* After setting the property on the prototype, it must be there, but not on the object */
+  assert_boolean_and_release (jerry_has_property (object, prop_name), true);
+  assert_boolean_and_release (jerry_has_own_property (object, prop_name), false);
+
+  TEST_ASSERT (jerry_delete_property (proto_object, prop_name));
+  assert_boolean_and_release (jerry_set_property (object, prop_name, prop_value), true);
+
+  /* After relocating the property onto the object, it must be there */
+  assert_boolean_and_release (jerry_has_property (object, prop_name), true);
+  assert_boolean_and_release (jerry_has_own_property (object, prop_name), true);
+
+  jerry_release_value (object);
+  jerry_release_value (prop_name);
+  jerry_release_value (prop_value);
+  jerry_release_value (proto_object);
+
+  jerry_cleanup ();
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-heap.c b/deps/jerry/tests/unit-core/test-heap.c
new file mode 100644 (file)
index 0000000..6197def
--- /dev/null
@@ -0,0 +1,125 @@
+/* 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.
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "jmem.h"
+
+#define JMEM_ALLOCATOR_INTERNAL
+#include "jmem-allocator-internal.h"
+
+#include "test-common.h"
+
+/* Heap size is 32K. */
+#define test_heap_size (32 * 1024)
+
+/* Iterations count. */
+#define test_iters (4 * 1024)
+
+/* Subiterations count. */
+#define test_sub_iters 32
+
+/* Threshold size of block to allocate. */
+#define test_threshold_block_size 8192
+
+uint8_t *ptrs[test_sub_iters];
+size_t sizes[test_sub_iters];
+bool is_one_chunked[test_sub_iters];
+
+static void
+test_heap_give_some_memory_back (jmem_free_unused_memory_severity_t severity)
+{
+  int p;
+
+  if (severity == JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW)
+  {
+    p = 8;
+  }
+  else
+  {
+    TEST_ASSERT (severity == JMEM_FREE_UNUSED_MEMORY_SEVERITY_HIGH);
+
+    p = 1;
+  }
+
+  for (int i = 0; i < test_sub_iters; i++)
+  {
+    if (rand () % p == 0)
+    {
+      if (ptrs[i] != NULL)
+      {
+        for (size_t k = 0; k < sizes[i]; k++)
+        {
+          TEST_ASSERT (ptrs[i][k] == 0);
+        }
+
+        jmem_heap_free_block (ptrs[i], sizes[i]);
+        ptrs[i] = NULL;
+      }
+    }
+  }
+} /* test_heap_give_some_memory_back */
+
+int
+main (void)
+{
+  TEST_INIT ();
+
+  jmem_heap_init ();
+
+  jmem_register_free_unused_memory_callback (test_heap_give_some_memory_back);
+
+#ifdef JMEM_STATS
+  jmem_heap_stats_print ();
+#endif /* JMEM_STATS */
+
+  for (uint32_t i = 0; i < test_iters; i++)
+  {
+    for (uint32_t j = 0; j < test_sub_iters; j++)
+    {
+      size_t size = (size_t) rand () % test_threshold_block_size;
+      ptrs[j] = (uint8_t *) jmem_heap_alloc_block (size);
+      sizes[j] = size;
+
+      TEST_ASSERT (sizes[j] == 0 || ptrs[j] != NULL);
+      memset (ptrs[j], 0, sizes[j]);
+    }
+
+    /* jmem_heap_print (true); */
+
+    for (uint32_t j = 0; j < test_sub_iters; j++)
+    {
+      if (ptrs[j] != NULL)
+      {
+        for (size_t k = 0; k < sizes[j]; k++)
+        {
+          TEST_ASSERT (ptrs[j][k] == 0);
+        }
+
+        jmem_heap_free_block (ptrs[j], sizes[j]);
+
+        ptrs[j] = NULL;
+      }
+    }
+  }
+
+#ifdef JMEM_STATS
+  jmem_heap_stats_print ();
+#endif /* JMEM_STATS */
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-lit-char-helpers.c b/deps/jerry/tests/unit-core/test-lit-char-helpers.c
new file mode 100644 (file)
index 0000000..c203e5c
--- /dev/null
@@ -0,0 +1,80 @@
+/* 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.
+ */
+
+#include "ecma-helpers.h"
+#include "lit-strings.h"
+#include "ecma-init-finalize.h"
+#include "lit-char-helpers.h"
+#include "js-parser-internal.h"
+
+#include "test-common.h"
+
+int
+main (void)
+{
+  TEST_INIT ();
+
+  jmem_init ();
+  ecma_init ();
+
+  const uint8_t _1_byte_long1[] = "\\u007F";
+  const uint8_t _1_byte_long2[] = "\\u0000";
+  const uint8_t _1_byte_long3[] = "\\u0065";
+
+  const uint8_t _2_byte_long1[] = "\\u008F";
+  const uint8_t _2_byte_long2[] = "\\u00FF";
+  const uint8_t _2_byte_long3[] = "\\u07FF";
+
+  const uint8_t _3_byte_long1[] = "\\u08FF";
+  const uint8_t _3_byte_long2[] = "\\u0FFF";
+  const uint8_t _3_byte_long3[] = "\\uFFFF";
+
+  size_t length;
+
+  /* Test 1-byte-long unicode sequences. */
+  length = lit_char_get_utf8_length (lexer_hex_to_character (0, _1_byte_long1 + 2, 4));
+  TEST_ASSERT (length == 1);
+
+  length = lit_char_get_utf8_length (lexer_hex_to_character (0, _1_byte_long2 + 2, 4));
+  TEST_ASSERT (length == 1);
+
+  length = lit_char_get_utf8_length (lexer_hex_to_character (0, _1_byte_long3 + 2, 4));
+  TEST_ASSERT (length == 1);
+
+  /* Test 2-byte-long unicode sequences. */
+  length = lit_char_get_utf8_length (lexer_hex_to_character (0, _2_byte_long1 + 2, 4));
+  TEST_ASSERT (length == 2);
+
+  length = lit_char_get_utf8_length (lexer_hex_to_character (0, _2_byte_long2 + 2, 4));
+  TEST_ASSERT (length == 2);
+
+  length = lit_char_get_utf8_length (lexer_hex_to_character (0, _2_byte_long3 + 2, 4));
+  TEST_ASSERT (length == 2);
+
+  /* Test 3-byte-long unicode sequences. */
+  length = lit_char_get_utf8_length (lexer_hex_to_character (0, _3_byte_long1 + 2, 4));
+  TEST_ASSERT (length != 2);
+
+  length = lit_char_get_utf8_length (lexer_hex_to_character (0, _3_byte_long2 + 2, 4));
+  TEST_ASSERT (length == 3);
+
+  length = lit_char_get_utf8_length (lexer_hex_to_character (0, _3_byte_long3 + 2, 4));
+  TEST_ASSERT (length == 3);
+
+  ecma_finalize ();
+  jmem_finalize ();
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-literal-storage.c b/deps/jerry/tests/unit-core/test-literal-storage.c
new file mode 100644 (file)
index 0000000..ceae4a7
--- /dev/null
@@ -0,0 +1,133 @@
+/* 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.
+ */
+
+#include "ecma-helpers.h"
+#include "ecma-literal-storage.h"
+#include "test-common.h"
+
+/* Iterations count. */
+#define test_iters 64
+
+/* Subiterations count. */
+#define test_sub_iters 64
+
+/* Max characters in a string. */
+#define max_characters_in_string 256
+
+static void
+generate_string (lit_utf8_byte_t *str, lit_utf8_size_t len)
+{
+  static const lit_utf8_byte_t bytes[] = "!@#$%^&*()_+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789";
+  static const lit_utf8_size_t length = (lit_utf8_size_t) (sizeof (bytes) - 1);
+  for (lit_utf8_size_t i = 0; i < len; ++i)
+  {
+    str[i] = bytes[(unsigned long) rand () % length];
+  }
+} /* generate_string */
+
+static ecma_number_t
+generate_number (void)
+{
+  ecma_number_t num = ((ecma_number_t) rand () / 32767.0);
+  if (rand () % 2)
+  {
+    num = -num;
+  }
+  int power = rand () % 30;
+  while (power-- > 0)
+  {
+    num *= 10;
+  }
+  return num;
+} /* generate_number */
+
+int
+main (void)
+{
+  TEST_INIT ();
+
+  const lit_utf8_byte_t *ptrs[test_sub_iters];
+  ecma_number_t numbers[test_sub_iters];
+  lit_utf8_byte_t strings[test_sub_iters][max_characters_in_string + 1];
+  lit_utf8_size_t lengths[test_sub_iters];
+
+  jmem_init ();
+
+  for (uint32_t i = 0; i < test_iters; i++)
+  {
+    memset (numbers, 0, sizeof (ecma_number_t) * test_sub_iters);
+    memset (lengths, 0, sizeof (lit_utf8_size_t) * test_sub_iters);
+    memset (ptrs, 0, sizeof (lit_utf8_byte_t *) * test_sub_iters);
+
+    for (uint32_t j = 0; j < test_sub_iters; j++)
+    {
+      int type = rand () % 3;
+      if (type == 0)
+      {
+        lengths[j] = (lit_utf8_size_t) (rand () % max_characters_in_string + 1);
+        generate_string (strings[j], lengths[j]);
+        ecma_find_or_create_literal_string (strings[j], lengths[j]);
+        strings[j][lengths[j]] = '\0';
+        ptrs[j] = strings[j];
+        TEST_ASSERT (ptrs[j]);
+      }
+      else if (type == 1)
+      {
+        lit_magic_string_id_t msi = (lit_magic_string_id_t) (rand () % LIT_NON_INTERNAL_MAGIC_STRING__COUNT);
+        ptrs[j] = lit_get_magic_string_utf8 (msi);
+        TEST_ASSERT (ptrs[j]);
+        lengths[j] = (lit_utf8_size_t) lit_zt_utf8_string_size (ptrs[j]);
+        ecma_find_or_create_literal_string (ptrs[j], lengths[j]);
+      }
+      else
+      {
+        ecma_number_t num = generate_number ();
+        lengths[j] = ecma_number_to_utf8_string (num, strings[j], max_characters_in_string);
+        ecma_find_or_create_literal_number (num);
+      }
+    }
+
+    /* Add empty string. */
+    ecma_find_or_create_literal_string (NULL, 0);
+
+    for (uint32_t j = 0; j < test_sub_iters; j++)
+    {
+      jmem_cpointer_t lit1;
+      jmem_cpointer_t lit2;
+      if (ptrs[j])
+      {
+        lit1 = ecma_find_or_create_literal_string (ptrs[j], lengths[j]);
+        lit2 = ecma_find_or_create_literal_string (ptrs[j], lengths[j]);
+        TEST_ASSERT (lit1 == lit2);
+      }
+      else
+      {
+        lit1 = ecma_find_or_create_literal_number (numbers[j]);
+        lit2 = ecma_find_or_create_literal_number (numbers[j]);
+        TEST_ASSERT (lit1 == lit2);
+      }
+      TEST_ASSERT (lit1);
+      TEST_ASSERT (lit2);
+      TEST_ASSERT (lit1 == lit2);
+    }
+
+    /* Check empty string exists. */
+    TEST_ASSERT (ecma_find_or_create_literal_string (NULL, 0) != JMEM_CP_NULL);
+  }
+
+  ecma_finalize_lit_storage ();
+  jmem_finalize ();
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-longjmp.c b/deps/jerry/tests/unit-core/test-longjmp.c
new file mode 100644 (file)
index 0000000..8ac0fbf
--- /dev/null
@@ -0,0 +1,81 @@
+/* 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.
+ */
+
+#include "test-common.h"
+
+#define TEST_MAX_DEPTH 10
+#define TEST_ITERATIONS_NUM 256
+
+jmp_buf buffers[TEST_MAX_DEPTH];
+
+static void
+test_setjmp_longjmp (volatile int depth)
+{
+  if (depth != TEST_MAX_DEPTH)
+  {
+    int a = 1, b = 2, c = 3;
+
+    int array[256];
+    for (int i = 0; i < 256; i++)
+    {
+      array[i] = i;
+    }
+
+    (void) a;
+    (void) b;
+    (void) c;
+    (void) array;
+
+    int k = setjmp (buffers[depth]);
+
+    if (k == 0)
+    {
+      test_setjmp_longjmp (depth + 1);
+    }
+    else
+    {
+      TEST_ASSERT (k == depth + 1);
+
+      TEST_ASSERT (a == 1);
+      TEST_ASSERT (b == 2);
+      TEST_ASSERT (c == 3);
+
+      for (int i = 0; i < 256; i++)
+      {
+        TEST_ASSERT (array[i] == i);
+      }
+    }
+  }
+  else
+  {
+    int t = rand () % depth;
+    TEST_ASSERT (t >= 0 && t < depth);
+
+    longjmp (buffers[t], t + 1);
+  }
+} /* test_setjmp_longjmp */
+
+int
+main (void)
+{
+  TEST_INIT ();
+
+  for (int i = 0; i < TEST_ITERATIONS_NUM; i++)
+  {
+    test_setjmp_longjmp (0);
+  }
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-number-to-integer.c b/deps/jerry/tests/unit-core/test-number-to-integer.c
new file mode 100644 (file)
index 0000000..0fe6664
--- /dev/null
@@ -0,0 +1,108 @@
+/* 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.
+ */
+
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+
+#include "test-common.h"
+
+typedef struct
+{
+  ecma_number_t num;
+  uint32_t uint32_num;
+} uint32_test_case_t;
+
+typedef struct
+{
+  ecma_number_t num;
+  int32_t int32_num;
+} int32_test_case_t;
+
+/**
+ * Unit test's main function.
+ */
+int
+main (void)
+{
+  TEST_INIT ();
+
+  const uint32_test_case_t test_cases_uint32[] =
+  {
+#define TEST_CASE(num, uint32) { num, uint32 }
+    TEST_CASE (1.0, 1),
+    TEST_CASE (0.0, 0),
+    TEST_CASE (ecma_number_negate (0.0), 0),
+    TEST_CASE (NAN, 0),
+    TEST_CASE (-NAN, 0),
+    TEST_CASE (INFINITY, 0),
+    TEST_CASE (-INFINITY, 0),
+    TEST_CASE (0.1, 0),
+    TEST_CASE (-0.1, 0),
+    TEST_CASE (1.1, 1),
+    TEST_CASE (-1.1, 4294967295),
+    TEST_CASE (4294967295, 4294967295),
+    TEST_CASE (-4294967295, 1),
+    TEST_CASE (4294967296, 0),
+    TEST_CASE (-4294967296, 0),
+    TEST_CASE (4294967297, 1),
+    TEST_CASE (-4294967297, 4294967295)
+#undef TEST_CASE
+  };
+
+  for (uint32_t i = 0;
+       i < sizeof (test_cases_uint32) / sizeof (test_cases_uint32[0]);
+       i++)
+  {
+    TEST_ASSERT (ecma_number_to_uint32 (test_cases_uint32[i].num) == test_cases_uint32[i].uint32_num);
+  }
+
+  int32_test_case_t test_cases_int32[] =
+  {
+#define TEST_CASE(num, int32) { num, int32 }
+    TEST_CASE (1.0, 1),
+    TEST_CASE (0.0, 0),
+    TEST_CASE (ecma_number_negate (0.0), 0),
+    TEST_CASE (NAN, 0),
+    TEST_CASE (-NAN, 0),
+    TEST_CASE (INFINITY, 0),
+    TEST_CASE (-INFINITY, 0),
+    TEST_CASE (0.1, 0),
+    TEST_CASE (-0.1, 0),
+    TEST_CASE (1.1, 1),
+    TEST_CASE (-1.1, -1),
+    TEST_CASE (4294967295, -1),
+    TEST_CASE (-4294967295, 1),
+    TEST_CASE (4294967296, 0),
+    TEST_CASE (-4294967296, 0),
+    TEST_CASE (4294967297, 1),
+    TEST_CASE (-4294967297, -1),
+    TEST_CASE (2147483648, -2147483648),
+    TEST_CASE (-2147483648, -2147483648),
+    TEST_CASE (2147483647, 2147483647),
+    TEST_CASE (-2147483647, -2147483647),
+    TEST_CASE (-2147483649, 2147483647),
+    TEST_CASE (2147483649, -2147483647)
+#undef TEST_CASE
+  };
+
+  for (uint32_t i = 0;
+       i < sizeof (test_cases_int32) / sizeof (test_cases_int32[0]);
+       i++)
+  {
+    TEST_ASSERT (ecma_number_to_int32 (test_cases_int32[i].num) == test_cases_int32[i].int32_num);
+  }
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-number-to-string.c b/deps/jerry/tests/unit-core/test-number-to-string.c
new file mode 100644 (file)
index 0000000..20c9203
--- /dev/null
@@ -0,0 +1,74 @@
+/* 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.
+ */
+
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+
+#include "test-common.h"
+
+/**
+ * Unit test's main function.
+ */
+int
+main (void)
+{
+  TEST_INIT ();
+
+  const lit_utf8_byte_t *strings[] =
+  {
+    (const lit_utf8_byte_t *) "1",
+    (const lit_utf8_byte_t *) "0.5",
+    (const lit_utf8_byte_t *) "12345",
+    (const lit_utf8_byte_t *) "12345.123",
+    (const lit_utf8_byte_t *) "1e-45",
+    (const lit_utf8_byte_t *) "-2.5e+38",
+    (const lit_utf8_byte_t *) "NaN",
+    (const lit_utf8_byte_t *) "Infinity",
+    (const lit_utf8_byte_t *) "-Infinity",
+    (const lit_utf8_byte_t *) "0",
+    (const lit_utf8_byte_t *) "0",
+  };
+
+  const ecma_number_t nums[] =
+  {
+    (ecma_number_t) 1.0,
+    (ecma_number_t) 0.5,
+    (ecma_number_t) 12345.0,
+    (ecma_number_t) 12345.123,
+    (ecma_number_t) 1.0e-45,
+    (ecma_number_t) -2.5e+38,
+    (ecma_number_t) NAN,
+    (ecma_number_t) INFINITY,
+    (ecma_number_t) -INFINITY,
+    (ecma_number_t) +0.0,
+    (ecma_number_t) -0.0
+  };
+
+  for (uint32_t i = 0;
+       i < sizeof (nums) / sizeof (nums[0]);
+       i++)
+  {
+    lit_utf8_byte_t str[64];
+
+    lit_utf8_size_t str_size = ecma_number_to_utf8_string (nums[i], str, sizeof (str));
+
+    if (strncmp ((char *) str, (char *) strings[i], str_size) != 0)
+    {
+      return 1;
+    }
+  }
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-poolman.c b/deps/jerry/tests/unit-core/test-poolman.c
new file mode 100644 (file)
index 0000000..cff5647
--- /dev/null
@@ -0,0 +1,92 @@
+/* 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.
+ */
+
+/**
+ * Unit test for pool manager.
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "jmem.h"
+
+#define JMEM_ALLOCATOR_INTERNAL
+#include "jmem-allocator-internal.h"
+
+#include "test-common.h"
+
+/* Iterations count. */
+const uint32_t test_iters = 1024;
+
+/* Subiterations count. */
+#define TEST_MAX_SUB_ITERS  1024
+#define TEST_CHUNK_SIZE 8
+
+uint8_t *ptrs[TEST_MAX_SUB_ITERS];
+uint8_t data[TEST_MAX_SUB_ITERS][TEST_CHUNK_SIZE];
+
+int
+main (void)
+{
+  TEST_INIT ();
+
+  jmem_init ();
+
+  for (uint32_t i = 0; i < test_iters; i++)
+  {
+    const size_t subiters = ((size_t) rand () % TEST_MAX_SUB_ITERS) + 1;
+
+    for (size_t j = 0; j < subiters; j++)
+    {
+      ptrs[j] = (uint8_t *) jmem_pools_alloc (TEST_CHUNK_SIZE);
+
+      if (ptrs[j] != NULL)
+      {
+        for (size_t k = 0; k < TEST_CHUNK_SIZE; k++)
+        {
+          ptrs[j][k] = (uint8_t) (rand () % 256);
+        }
+
+        memcpy (data[j], ptrs[j], TEST_CHUNK_SIZE);
+      }
+    }
+
+    /* jmem_heap_print (false); */
+
+    for (size_t j = 0; j < subiters; j++)
+    {
+      if (rand () % 256 == 0)
+      {
+        jmem_pools_collect_empty ();
+      }
+
+      if (ptrs[j] != NULL)
+      {
+        TEST_ASSERT (!memcmp (data[j], ptrs[j], TEST_CHUNK_SIZE));
+
+        jmem_pools_free (ptrs[j], TEST_CHUNK_SIZE);
+      }
+    }
+  }
+
+#ifdef JMEM_STATS
+  jmem_pools_stats_print ();
+#endif /* JMEM_STATS */
+
+  jmem_finalize ();
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-promise.c b/deps/jerry/tests/unit-core/test-promise.c
new file mode 100644 (file)
index 0000000..09b9e80
--- /dev/null
@@ -0,0 +1,174 @@
+/* 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.
+ */
+
+#include "jerryscript.h"
+#include "jerryscript-port.h"
+#include "jerryscript-port-default.h"
+#include "test-common.h"
+
+#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
+
+const char *test_source = (
+                           "var p1 = create_promise1();"
+                           "var p2 = create_promise2();"
+                           "p1.then(function(x) { "
+                           "  assert(x==='resolved'); "
+                           "}); "
+                           "p2.catch(function(x) { "
+                           "  assert(x==='rejected'); "
+                           "}); "
+                           );
+
+static int count_in_assert = 0;
+static jerry_value_t my_promise1;
+static jerry_value_t my_promise2;
+const jerry_char_t s1[] = "resolved";
+const jerry_char_t s2[] = "rejected";
+
+static jerry_value_t
+create_promise1_handler (const jerry_value_t func_obj_val, /**< function object */
+                         const jerry_value_t this_val, /**< this value */
+                         const jerry_value_t args_p[], /**< arguments list */
+                         const jerry_length_t args_cnt) /**< arguments length */
+{
+  JERRY_UNUSED (func_obj_val);
+  JERRY_UNUSED (this_val);
+  JERRY_UNUSED (args_p);
+  JERRY_UNUSED (args_cnt);
+
+  jerry_value_t ret =  jerry_create_promise ();
+  my_promise1 = jerry_acquire_value (ret);
+
+  return ret;
+} /* create_promise1_handler */
+
+static jerry_value_t
+create_promise2_handler (const jerry_value_t func_obj_val, /**< function object */
+                         const jerry_value_t this_val, /**< this value */
+                         const jerry_value_t args_p[], /**< arguments list */
+                         const jerry_length_t args_cnt) /**< arguments length */
+{
+  JERRY_UNUSED (func_obj_val);
+  JERRY_UNUSED (this_val);
+  JERRY_UNUSED (args_p);
+  JERRY_UNUSED (args_cnt);
+
+  jerry_value_t ret =  jerry_create_promise ();
+  my_promise2 = jerry_acquire_value (ret);
+
+  return ret;
+} /* create_promise2_handler */
+
+static jerry_value_t
+assert_handler (const jerry_value_t func_obj_val, /**< function object */
+                const jerry_value_t this_val, /**< this arg */
+                const jerry_value_t args_p[], /**< function arguments */
+                const jerry_length_t args_cnt) /**< number of function arguments */
+{
+  JERRY_UNUSED (func_obj_val);
+  JERRY_UNUSED (this_val);
+
+  count_in_assert++;
+
+  if (args_cnt == 1
+      && jerry_value_is_boolean (args_p[0])
+      && jerry_get_boolean_value (args_p[0]))
+  {
+    return jerry_create_boolean (true);
+  }
+  else
+  {
+    TEST_ASSERT (false);
+  }
+} /* assert_handler */
+
+/**
+ * Register a JavaScript function in the global object.
+ */
+static void
+register_js_function (const char *name_p, /**< name of the function */
+                      jerry_external_handler_t handler_p) /**< function callback */
+{
+  jerry_value_t global_obj_val = jerry_get_global_object ();
+
+  jerry_value_t function_val = jerry_create_external_function (handler_p);
+  jerry_value_t function_name_val = jerry_create_string ((const jerry_char_t *) name_p);
+  jerry_value_t result_val = jerry_set_property (global_obj_val, function_name_val, function_val);
+
+  jerry_release_value (function_name_val);
+  jerry_release_value (function_val);
+  jerry_release_value (global_obj_val);
+
+  jerry_release_value (result_val);
+} /* register_js_function */
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  register_js_function ("create_promise1", create_promise1_handler);
+  register_js_function ("create_promise2", create_promise2_handler);
+  register_js_function ("assert", assert_handler);
+
+  jerry_value_t parsed_code_val = jerry_parse ((jerry_char_t *) test_source, strlen (test_source), false);
+  TEST_ASSERT (!jerry_value_has_error_flag (parsed_code_val));
+
+  jerry_value_t res = jerry_run (parsed_code_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+
+  jerry_release_value (res);
+  jerry_release_value (parsed_code_val);
+
+  /* Test jerry_create_promise and jerry_value_is_promise. */
+  TEST_ASSERT (jerry_value_is_promise (my_promise1));
+  TEST_ASSERT (jerry_value_is_promise (my_promise2));
+
+  TEST_ASSERT (count_in_assert == 0);
+
+  /* Test jerry_resolve_or_reject_promise. */
+  jerry_value_t str_resolve = jerry_create_string (s1);
+  jerry_value_t str_reject = jerry_create_string (s2);
+
+  jerry_resolve_or_reject_promise (my_promise1, str_resolve, true);
+  jerry_resolve_or_reject_promise (my_promise2, str_reject, false);
+
+  /* The resolve/reject function should be invalid after the promise has the result. */
+  jerry_resolve_or_reject_promise (my_promise2, str_resolve, true);
+  jerry_resolve_or_reject_promise (my_promise1, str_reject, false);
+
+  /* Run the jobqueue. */
+  res = jerry_run_all_enqueued_jobs ();
+
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (count_in_assert == 2);
+
+  jerry_release_value (my_promise1);
+  jerry_release_value (my_promise2);
+  jerry_release_value (str_resolve);
+  jerry_release_value (str_reject);
+
+  jerry_cleanup ();
+} /* main */
+
+#else /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
+
+int
+main (void)
+{
+  return 0;
+} /* main */
+
+#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
diff --git a/deps/jerry/tests/unit-core/test-string-to-number.c b/deps/jerry/tests/unit-core/test-string-to-number.c
new file mode 100644 (file)
index 0000000..a911557
--- /dev/null
@@ -0,0 +1,89 @@
+/* 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.
+ */
+
+#include "ecma-globals.h"
+#include "ecma-helpers.h"
+#include "jerryscript.h"
+
+#include "test-common.h"
+
+/**
+ * Unit test's main function.
+ */
+int
+main (void)
+{
+  TEST_INIT ();
+
+  const jerry_char_t *strings[] =
+  {
+    (const jerry_char_t *) "1",
+    (const jerry_char_t *) "0.5",
+    (const jerry_char_t *) "12345",
+    (const jerry_char_t *) "1e-45",
+    (const jerry_char_t *) "-2.5e+38",
+    (const jerry_char_t *) "-2.5e38",
+    (const jerry_char_t *) "- 2.5e+38",
+    (const jerry_char_t *) "-2 .5e+38",
+    (const jerry_char_t *) "-2. 5e+38",
+    (const jerry_char_t *) "-2.5e+ 38",
+    (const jerry_char_t *) "-2.5 e+38",
+    (const jerry_char_t *) "-2.5e +38",
+    (const jerry_char_t *) "NaN",
+    (const jerry_char_t *) "abc",
+    (const jerry_char_t *) "   Infinity  ",
+    (const jerry_char_t *) "-Infinity",
+    (const jerry_char_t *) "0",
+    (const jerry_char_t *) "0",
+  };
+
+  const ecma_number_t nums[] =
+  {
+    (ecma_number_t) 1.0,
+    (ecma_number_t) 0.5,
+    (ecma_number_t) 12345.0,
+    (ecma_number_t) 1.0e-45,
+    (ecma_number_t) -2.5e+38,
+    (ecma_number_t) -2.5e+38,
+    (ecma_number_t) NAN,
+    (ecma_number_t) NAN,
+    (ecma_number_t) NAN,
+    (ecma_number_t) NAN,
+    (ecma_number_t) NAN,
+    (ecma_number_t) NAN,
+    (ecma_number_t) NAN,
+    (ecma_number_t) NAN,
+    (ecma_number_t) INFINITY,
+    (ecma_number_t) -INFINITY,
+    (ecma_number_t) +0.0,
+    (ecma_number_t) -0.0
+  };
+
+  for (uint32_t i = 0;
+       i < sizeof (nums) / sizeof (nums[0]);
+       i++)
+  {
+    ecma_number_t num = ecma_utf8_string_to_number (strings[i], lit_zt_utf8_string_size (strings[i]));
+
+    if (num != nums[i]
+        && (!ecma_number_is_nan (num)
+            || !ecma_number_is_nan (nums[i])))
+    {
+      return 1;
+    }
+  }
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-core/test-strings.c b/deps/jerry/tests/unit-core/test-strings.c
new file mode 100644 (file)
index 0000000..31218bd
--- /dev/null
@@ -0,0 +1,222 @@
+/* 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.
+ */
+
+#include "ecma-helpers.h"
+#include "lit-strings.h"
+#include "ecma-init-finalize.h"
+
+#include "test-common.h"
+
+/* Iterations count. */
+#define test_iters (1024)
+
+/* Sub iterations count. */
+#define test_subiters (128)
+
+/* Max bytes in string. */
+#define max_bytes_in_string (16 * 1024)
+#define max_code_units_in_string (max_bytes_in_string)
+
+typedef enum
+{
+  CESU8_ANY_SIZE,
+  CESU8_ONE_BYTE,
+  CESU8_TWO_BYTES,
+  CESU8_THREE_BYTES,
+} utf8_char_size;
+
+static lit_utf8_size_t
+generate_cesu8_char (utf8_char_size char_size,
+                     lit_utf8_byte_t *buf)
+{
+  TEST_ASSERT (char_size >= 0 && char_size <= LIT_CESU8_MAX_BYTES_IN_CODE_UNIT);
+  lit_code_point_t code_point = (lit_code_point_t) rand ();
+
+  if (char_size == 1)
+  {
+    code_point %= LIT_UTF8_1_BYTE_CODE_POINT_MAX;
+  }
+  else if (char_size == 2)
+  {
+    code_point = LIT_UTF8_2_BYTE_CODE_POINT_MIN + code_point % (LIT_UTF8_2_BYTE_CODE_POINT_MAX -
+                                                                LIT_UTF8_2_BYTE_CODE_POINT_MIN);
+  }
+  else if (char_size == 3)
+  {
+    code_point = LIT_UTF8_3_BYTE_CODE_POINT_MIN + code_point % (LIT_UTF8_3_BYTE_CODE_POINT_MAX -
+                                                                LIT_UTF8_3_BYTE_CODE_POINT_MIN);
+  }
+  else
+  {
+    code_point %= LIT_UTF8_3_BYTE_CODE_POINT_MAX;
+  }
+
+  if (code_point >= LIT_UTF16_HIGH_SURROGATE_MIN
+      && code_point <= LIT_UTF16_LOW_SURROGATE_MAX)
+  {
+    code_point = LIT_UTF16_HIGH_SURROGATE_MIN - 1;
+  }
+
+  return lit_code_unit_to_utf8 ((ecma_char_t) code_point, buf);
+} /* generate_cesu8_char */
+
+static ecma_length_t
+generate_cesu8_string (lit_utf8_byte_t *buf_p,
+                       lit_utf8_size_t buf_size)
+{
+  ecma_length_t length = 0;
+
+  lit_utf8_size_t size = 0;
+  while (size  < buf_size)
+  {
+    const utf8_char_size char_size = (((buf_size - size) > LIT_CESU8_MAX_BYTES_IN_CODE_UNIT)
+                                      ? CESU8_ANY_SIZE
+                                      : (utf8_char_size) (buf_size - size));
+
+    lit_utf8_size_t bytes_generated = generate_cesu8_char (char_size, buf_p);
+
+    TEST_ASSERT (lit_is_valid_cesu8_string (buf_p, bytes_generated));
+
+    size += bytes_generated;
+    buf_p += bytes_generated;
+    length++;
+  }
+
+  TEST_ASSERT (size == buf_size);
+
+  return length;
+} /* generate_cesu8_string */
+
+int
+main (void)
+{
+  TEST_INIT ();
+
+  jmem_init ();
+  ecma_init ();
+
+  lit_utf8_byte_t cesu8_string[max_bytes_in_string];
+  ecma_char_t code_units[max_code_units_in_string];
+  const lit_utf8_byte_t *saved_positions[max_code_units_in_string];
+
+  for (int i = 0; i < test_iters; i++)
+  {
+    lit_utf8_size_t cesu8_string_size = (i == 0) ? 0 : (lit_utf8_size_t) (rand () % max_bytes_in_string);
+    ecma_length_t length = generate_cesu8_string (cesu8_string, cesu8_string_size);
+
+    ecma_string_t *char_collection_string_p = ecma_new_ecma_string_from_utf8 (cesu8_string, cesu8_string_size);
+    ecma_length_t char_collection_len = ecma_string_get_length (char_collection_string_p);
+    TEST_ASSERT (char_collection_len == length);
+    ecma_deref_ecma_string (char_collection_string_p);
+
+    TEST_ASSERT (lit_utf8_string_length (cesu8_string, cesu8_string_size) == length);
+
+    const lit_utf8_byte_t *curr_p = cesu8_string;
+    const lit_utf8_byte_t *end_p = cesu8_string + cesu8_string_size;
+
+    ecma_length_t calculated_length = 0;
+    ecma_length_t code_units_count = 0;
+
+    while (curr_p < end_p)
+    {
+      code_units[code_units_count] = lit_utf8_peek_next (curr_p);
+      saved_positions[code_units_count] = curr_p;
+      code_units_count++;
+      calculated_length++;
+
+      lit_utf8_incr (&curr_p);
+    }
+
+    TEST_ASSERT (length == calculated_length);
+
+    if (code_units_count > 0)
+    {
+      for (int j = 0; j < test_subiters; j++)
+      {
+        ecma_length_t index = (ecma_length_t) rand () % code_units_count;
+        curr_p = saved_positions[index];
+        TEST_ASSERT (lit_utf8_peek_next (curr_p) == code_units[index]);
+      }
+    }
+
+    curr_p = (lit_utf8_byte_t *) end_p;
+    while (curr_p > cesu8_string)
+    {
+      TEST_ASSERT (code_units_count > 0);
+      calculated_length--;
+      TEST_ASSERT (code_units[calculated_length] == lit_utf8_peek_prev (curr_p));
+      lit_utf8_decr (&curr_p);
+    }
+
+    TEST_ASSERT (calculated_length == 0);
+
+    while (curr_p < end_p)
+    {
+      ecma_char_t code_unit = lit_utf8_read_next (&curr_p);
+      TEST_ASSERT (code_unit == code_units[calculated_length]);
+      calculated_length++;
+    }
+
+    TEST_ASSERT (length == calculated_length);
+
+    while (curr_p > cesu8_string)
+    {
+      TEST_ASSERT (code_units_count > 0);
+      calculated_length--;
+      TEST_ASSERT (code_units[calculated_length] == lit_utf8_read_prev (&curr_p));
+    }
+
+    TEST_ASSERT (calculated_length == 0);
+  }
+
+  /* Overlong-encoded code point */
+  lit_utf8_byte_t invalid_cesu8_string_1[] = {0xC0, 0x82};
+  TEST_ASSERT (!lit_is_valid_cesu8_string (invalid_cesu8_string_1, sizeof (invalid_cesu8_string_1)));
+
+  /* Overlong-encoded code point */
+  lit_utf8_byte_t invalid_cesu8_string_2[] = {0xE0, 0x80, 0x81};
+  TEST_ASSERT (!lit_is_valid_cesu8_string (invalid_cesu8_string_2, sizeof (invalid_cesu8_string_2)));
+
+  /* Pair of surrogates: 0xD901 0xDFF0 which encode Unicode character 0x507F0 */
+  lit_utf8_byte_t invalid_cesu8_string_3[] = {0xED, 0xA4, 0x81, 0xED, 0xBF, 0xB0};
+  TEST_ASSERT (lit_is_valid_cesu8_string (invalid_cesu8_string_3, sizeof (invalid_cesu8_string_3)));
+
+  /* Isolated high surrogate 0xD901 */
+  lit_utf8_byte_t valid_utf8_string_1[] = {0xED, 0xA4, 0x81};
+  TEST_ASSERT (lit_is_valid_cesu8_string (valid_utf8_string_1, sizeof (valid_utf8_string_1)));
+
+  lit_utf8_byte_t res_buf[3];
+  lit_utf8_size_t res_size;
+
+  res_size = lit_code_unit_to_utf8 (0x73, res_buf);
+  TEST_ASSERT (res_size == 1);
+  TEST_ASSERT (res_buf[0] == 0x73);
+
+  res_size = lit_code_unit_to_utf8 (0x41A, res_buf);
+  TEST_ASSERT (res_size == 2);
+  TEST_ASSERT (res_buf[0] == 0xD0);
+  TEST_ASSERT (res_buf[1] == 0x9A);
+
+  res_size = lit_code_unit_to_utf8 (0xD7FF, res_buf);
+  TEST_ASSERT (res_size == 3);
+  TEST_ASSERT (res_buf[0] == 0xED);
+  TEST_ASSERT (res_buf[1] == 0x9F);
+  TEST_ASSERT (res_buf[2] == 0xBF);
+
+  ecma_finalize ();
+  jmem_finalize ();
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-doc/CMakeLists.txt b/deps/jerry/tests/unit-doc/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5380324
--- /dev/null
@@ -0,0 +1,89 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+project (unit-doc C)
+
+set(GEN_DOCTEST "${CMAKE_SOURCE_DIR}/tools/gen-doctest.py")
+file(GLOB DOC_FILES "${CMAKE_SOURCE_DIR}/docs/*.md")
+
+set(COMPILE_FLAGS_DOCTEST "-Wno-unused-parameter -Wno-unused-function -Wno-unused-variable")
+
+# Dry run of the doctest generator: analyze MarkDown files and get the list of
+# file names that will be generated. This allows the definition of proper
+# dependencies between the MarkDown files and the generated sources.
+execute_process(
+  COMMAND ${GEN_DOCTEST} --dry -d ${CMAKE_CURRENT_SOURCE_DIR} ${DOC_FILES}
+  OUTPUT_VARIABLE DOCTEST_OUTPUT
+  RESULT_VARIABLE GEN_DOCTEST_RESULT
+)
+if(NOT GEN_DOCTEST_RESULT EQUAL 0)
+  message(FATAL_ERROR "failed to get doctest file list")
+endif()
+
+# Process the output of the doctest generator: collect sources that must be
+# compiled, compiled+linked, or compiled+linked+executed into separate lists.
+set(DOCTEST_COMPILE "")
+set(DOCTEST_LINK "")
+set(DOCTEST_RUN "")
+
+string(REPLACE "\n" ";" DOCTEST_LIST "${DOCTEST_OUTPUT}")
+foreach(DOCTEST_ELEMENT IN LISTS DOCTEST_LIST)
+  if(NOT ("${DOCTEST_ELEMENT}" STREQUAL ""))
+    separate_arguments(DOCTEST_ELEMENT)
+    list(GET DOCTEST_ELEMENT 0 DOCTEST_ACTION)
+    list(GET DOCTEST_ELEMENT 1 DOCTEST_NAME)
+    string(TOUPPER ${DOCTEST_ACTION} DOCTEST_ACTION)
+
+    set(DOCTEST_${DOCTEST_ACTION} ${DOCTEST_${DOCTEST_ACTION}} ${DOCTEST_NAME})
+  endif()
+endforeach()
+
+# Add custom command to run doctest generator if any of the MarkDown sources
+# changes.
+add_custom_command(
+  COMMAND ${GEN_DOCTEST} -d ${CMAKE_CURRENT_SOURCE_DIR} ${DOC_FILES}
+  DEPENDS ${GEN_DOCTEST} ${DOC_FILES}
+  OUTPUT ${DOCTEST_COMPILE} ${DOCTEST_LINK} ${DOCTEST_RUN}
+  COMMENT "Generating doctests"
+)
+
+# Process compile-only doctests: add them to a dummy library
+# (named libcompile-doc-tests.a) to trigger compilation.
+if(NOT ("${DOCTEST_COMPILE}" STREQUAL ""))
+  add_library(compile-doc-tests STATIC ${DOCTEST_COMPILE})
+  target_link_libraries(compile-doc-tests jerry-ext jerry-core jerry-port-default-minimal)
+  set_property(TARGET compile-doc-tests APPEND_STRING PROPERTY COMPILE_FLAGS "${COMPILE_FLAGS_DOCTEST}")
+endif()
+
+macro(doctest_add_executables NAME_PREFIX)
+  foreach(DOCTEST_NAME ${ARGN})
+    get_filename_component(TARGET_NAME ${DOCTEST_NAME} NAME)
+    string(REGEX REPLACE "\\.[^.]*$" "" TARGET_NAME ${TARGET_NAME})
+    set(TARGET_NAME ${NAME_PREFIX}-${TARGET_NAME})
+
+    add_executable(${TARGET_NAME} ${DOCTEST_NAME})
+    set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY COMPILE_FLAGS "${COMPILE_FLAGS_DOCTEST}")
+    set_property(TARGET ${TARGET_NAME} PROPERTY LINK_FLAGS "${LINKER_FLAGS_COMMON}")
+    target_link_libraries(${TARGET_NAME} jerry-ext jerry-core jerry-port-default-minimal)
+  endforeach()
+endmacro()
+
+# Process link-only doctests: create an executable from each (named link-doc-*)
+doctest_add_executables("link-doc" ${DOCTEST_LINK})
+
+# Process "full-fledged" doctests: create an executable from each (named
+# unit-doc-*). Their name prefix (unit-) ensures that the unit test runner
+# script will treat them like any other unit test, i.e., executed them.
+doctest_add_executables("unit-doc" ${DOCTEST_RUN})
diff --git a/deps/jerry/tests/unit-ext/CMakeLists.txt b/deps/jerry/tests/unit-ext/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e7e95d7
--- /dev/null
@@ -0,0 +1,44 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+project (unit-ext C)
+
+set(INCLUDE_UNIT_EXT ${CMAKE_CURRENT_SOURCE_DIR})
+
+# Unit tests main modules
+file(GLOB SOURCE_UNIT_TEST_EXT_MODULES *.c)
+
+# Unit tests declaration
+add_custom_target(unittests-ext)
+
+foreach(SOURCE_UNIT_TEST_EXT ${SOURCE_UNIT_TEST_EXT_MODULES})
+  get_filename_component(TARGET_NAME ${SOURCE_UNIT_TEST_EXT} NAME_WE)
+  set(TARGET_NAME unit-${TARGET_NAME})
+
+  add_executable(${TARGET_NAME} ${SOURCE_UNIT_TEST_EXT})
+  set_property(TARGET ${TARGET_NAME}
+               PROPERTY LINK_FLAGS "${LINKER_FLAGS_COMMON}")
+
+  target_link_libraries(${TARGET_NAME} jerry-ext jerry-core jerry-port-default-minimal)
+
+  add_dependencies(unittests-ext ${TARGET_NAME})
+endforeach()
+
+file(GLOB CONTENTS_UNIT_TEST_EXT *)
+foreach(CONTENT_UNIT_TEST_EXT ${CONTENTS_UNIT_TEST_EXT})
+  if(IS_DIRECTORY ${CONTENT_UNIT_TEST_EXT})
+    add_subdirectory(${CONTENT_UNIT_TEST_EXT})
+  endif()
+endforeach()
diff --git a/deps/jerry/tests/unit-ext/module/CMakeLists.txt b/deps/jerry/tests/unit-ext/module/CMakeLists.txt
new file mode 100644 (file)
index 0000000..233b712
--- /dev/null
@@ -0,0 +1,24 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+set(JERRYX_MODULE_UNITTEST_NAME unit-test-jerry-module)
+project (${JERRYX_MODULE_UNITTEST_NAME} C)
+
+file(GLOB JERRYX_MODULE_UNIT_TEST_SOURCES *.c)
+
+add_executable(${JERRYX_MODULE_UNITTEST_NAME} ${JERRYX_MODULE_UNIT_TEST_SOURCES})
+set_property(TARGET ${JERRYX_MODULE_UNITTEST_NAME} PROPERTY LINK_FLAGS "${LINKER_FLAGS_COMMON}")
+target_link_libraries(${JERRYX_MODULE_UNITTEST_NAME} jerry-ext jerry-core jerry-port-default-minimal)
+target_include_directories(${JERRYX_MODULE_UNITTEST_NAME} PRIVATE ${INCLUDE_UNIT_EXT})
diff --git a/deps/jerry/tests/unit-ext/module/jerry-module-test.c b/deps/jerry/tests/unit-ext/module/jerry-module-test.c
new file mode 100644 (file)
index 0000000..7fe3c22
--- /dev/null
@@ -0,0 +1,168 @@
+/* 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.
+ */
+
+#include <string.h>
+
+#include "jerryscript.h"
+#include "test-common.h"
+#include "jerryscript-ext/module.h"
+
+#ifdef JERRYX_NATIVE_MODULES_SUPPORTED
+
+/* Load a module. */
+const char eval_string1[] = "require ('my_custom_module');";
+
+/* Load a module using a different resolver. */
+const char eval_string2[] = "require ('differently-handled-module');";
+
+/* Load a broken module using the built-in resolver. */
+const char eval_string3[] =
+"(function() {"
+"  var theError;"
+"  try {"
+"    require ('my_broken_module');"
+"  } catch (anError) {"
+"    theError = anError;"
+"  }"
+"  return (((theError.message === 'Module on_resolve () must not be NULL') &&"
+"    (theError.moduleName === 'my_broken_module') &&"
+"    (theError instanceof TypeError)) ? 1 : 0);"
+"}) ();";
+
+/* Load a non-existent module. */
+const char eval_string4[] =
+"(function() {"
+"  var theError;"
+"  try {"
+"    require ('some_missing_module_xyzzy');"
+"  } catch (anError) {"
+"    theError = anError;"
+"  }"
+"  return (((theError.message === 'Module not found') &&"
+"    (theError.moduleName === 'some_missing_module_xyzzy')) ? 1 : 0);"
+"}) ();";
+
+/* Make sure the result of a module load is cached. */
+const char eval_string5[] =
+"(function() {"
+"  var x = require('cache-check');"
+"  var y = require('cache-check');"
+"  return x === y ? 1 : 0;"
+"}) ();";
+
+static bool
+resolve_differently_handled_module (const jerry_char_t *name,
+                                                jerry_value_t *result)
+{
+  if (!strcmp ((char *) name, "differently-handled-module"))
+  {
+    (*result) = jerry_create_number (29);
+    return true;
+  }
+  return false;
+} /* resolve_differently_handled_module */
+
+/*
+ * Define module "cache-check" via its own resolver as an empty object. Since objects are accessible only via references
+ * we can strictly compare the object returned on subsequent attempts at loading "cache-check" with the object returned
+ * on the first attempt and establish that the two are in fact the same object - which in turn shows that caching works.
+ */
+static bool
+cache_check (const jerry_char_t *name,
+             jerry_value_t *result)
+{
+  if (!strcmp ((char *) name, "cache-check"))
+  {
+    (*result) = jerry_create_object ();
+    return true;
+  }
+  return false;
+} /* cache_check */
+
+static jerryx_module_resolver_t resolvers[3] =
+{
+  jerryx_module_native_resolver,
+  resolve_differently_handled_module,
+  cache_check
+};
+
+static jerry_value_t
+handle_require (const jerry_value_t js_function,
+                const jerry_value_t this_val,
+                const jerry_value_t args_p[],
+                const jerry_length_t args_count)
+{
+  (void) js_function;
+  (void) this_val;
+  (void) args_count;
+
+  jerry_value_t return_value = 0;
+  jerry_char_t module_name[256] = "";
+  jerry_size_t bytes_copied = 0;
+
+  TEST_ASSERT (args_count == 1);
+  bytes_copied = jerry_string_to_char_buffer (args_p[0], module_name, 256);
+  if (bytes_copied < 256)
+  {
+    module_name[bytes_copied] = 0;
+    return_value = jerryx_module_resolve (module_name, resolvers, 3);
+  }
+
+  return return_value;
+} /* handle_require */
+
+static void
+assert_number (jerry_value_t js_value, double expected_result)
+{
+  TEST_ASSERT (!jerry_value_has_error_flag (js_value));
+  TEST_ASSERT (jerry_get_number_value (js_value) == expected_result);
+} /* assert_number */
+
+static void
+eval_one (const char *the_string, double expected_result)
+{
+  jerry_value_t js_eval_result = jerry_eval ((const jerry_char_t *) the_string, strlen (the_string), true);
+  assert_number (js_eval_result, expected_result);
+  jerry_release_value (js_eval_result);
+} /* eval_one */
+
+int
+main (int argc, char **argv)
+{
+  (void) argc;
+  (void) argv;
+  jerry_value_t js_global = 0, js_function = 0, js_property_name = 0;
+
+  jerry_init (JERRY_INIT_EMPTY);
+
+  js_global = jerry_get_global_object ();
+  js_function = jerry_create_external_function (handle_require);
+  js_property_name = jerry_create_string ((const jerry_char_t *) "require");
+  jerry_set_property (js_global, js_property_name, js_function);
+
+  eval_one (eval_string1, 42);
+  eval_one (eval_string2, 29);
+  eval_one (eval_string3, 1);
+  eval_one (eval_string4, 1);
+  eval_one (eval_string5, 1);
+
+  jerry_release_value (js_property_name);
+  jerry_release_value (js_function);
+  jerry_release_value (js_global);
+
+  jerry_cleanup ();
+} /* main */
+
+#endif /* JERRYX_NATIVE_MODULES_SUPPORTED */
diff --git a/deps/jerry/tests/unit-ext/module/my-broken-module.c b/deps/jerry/tests/unit-ext/module/my-broken-module.c
new file mode 100644 (file)
index 0000000..59ff323
--- /dev/null
@@ -0,0 +1,24 @@
+/* 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.
+ */
+
+#include "jerryscript.h"
+#include "jerryscript-ext/module.h"
+
+#ifdef JERRYX_NATIVE_MODULES_SUPPORTED
+/*
+ * A broken module to test that the loader complains about the absence of on_resolve ()
+ */
+JERRYX_NATIVE_MODULE (my_broken_module, NULL)
+#endif /* JERRYX_NATIVE_MODULES_SUPPORTED */
diff --git a/deps/jerry/tests/unit-ext/module/my-custom-module.c b/deps/jerry/tests/unit-ext/module/my-custom-module.c
new file mode 100644 (file)
index 0000000..178b7db
--- /dev/null
@@ -0,0 +1,29 @@
+/* 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.
+ */
+
+#include "jerryscript.h"
+#include "jerryscript-ext/module.h"
+
+#ifdef JERRYX_NATIVE_MODULES_SUPPORTED
+
+static jerry_value_t
+my_custom_module_on_resolve (void)
+{
+  return jerry_create_number (42);
+} /* my_custom_module_on_resolve */
+
+JERRYX_NATIVE_MODULE (my_custom_module, my_custom_module_on_resolve)
+
+#endif /* JERRYX_NATIVE_MODULES_SUPPORTED */
diff --git a/deps/jerry/tests/unit-ext/test-common.h b/deps/jerry/tests/unit-ext/test-common.h
new file mode 100644 (file)
index 0000000..0254a00
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+#ifndef TEST_COMMON_H
+#define TEST_COMMON_H
+
+#include "jerryscript-port.h"
+
+#define TEST_ASSERT(x) \
+  do \
+  { \
+    if (!(x)) \
+    { \
+      jerry_port_log (JERRY_LOG_LEVEL_ERROR, \
+                      "TEST: Assertion '%s' failed at %s(%s):%lu.\n", \
+                      #x, \
+                      __FILE__, \
+                      __func__, \
+                      (unsigned long) __LINE__); \
+      jerry_port_fatal (ERR_FAILED_INTERNAL_ASSERTION); \
+    } \
+  } while (0)
+
+#endif /* TEST_COMMON_H */
diff --git a/deps/jerry/tests/unit-ext/test-ext-arg.c b/deps/jerry/tests/unit-ext/test-ext-arg.c
new file mode 100644 (file)
index 0000000..3d61930
--- /dev/null
@@ -0,0 +1,541 @@
+/* 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.
+ */
+
+/**
+ * Unit test for jerry-ext/args.
+ */
+
+#include "jerryscript.h"
+#include "jerryscript-ext/arg.h"
+#include "test-common.h"
+
+#include <string.h>
+#include <jerryscript-ext/arg.h>
+
+const char *test_source = (
+                           "var arg1 = true;"
+                           "var arg2 = 10.5;"
+                           "var arg3 = 'abc';"
+                           "var arg4 = function foo() {};"
+                           "test_validator1(arg1, arg2, arg3, arg4);"
+                           "arg1 = new Boolean(true);"
+                           "arg3 = new String('abc');"
+                           "test_validator1(arg1, arg2, arg3);"
+                           "test_validator1(arg1, arg2, '');"
+                           "arg2 = new Number(10.5);"
+                           "test_validator1(arg1, arg2, arg3);"
+                           "test_validator1(arg1, 10.5, 'abcdef');"
+                           "var obj_a = new MyObjectA();"
+                           "var obj_b = new MyObjectB();"
+                           "test_validator2.call(obj_a, 5);"
+                           "test_validator2.call(obj_b, 5);"
+                           "test_validator2.call(obj_a, 1);"
+                           "var obj1 = {prop1:true, prop2:'1.5'};"
+                           "test_validator_prop1(obj1);"
+                           "test_validator_prop2(obj1);"
+                           "test_validator_prop2();"
+                           "var obj2 = {prop1:true};"
+                           "Object.defineProperty(obj2, 'prop2', {"
+                           "  get: function() { throw new TypeError('prop2 error') }"
+                           "});"
+                           "test_validator_prop3(obj2);"
+                           "test_validator_int1(-1000, 1000, 128, -1000, 1000, -127,"
+                           "                    -1000, 4294967297, 65536, -2200000000, 4294967297, -2147483647);"
+                           "test_validator_int2(-1.5, -1.5, -1.5, 1.5, 1.5, 1.5, 300.5, 300.5);"
+                           );
+
+static const jerry_object_native_info_t thing_a_info =
+{
+  .free_cb = NULL
+};
+
+static const jerry_object_native_info_t thing_b_info =
+{
+  .free_cb = NULL
+};
+
+typedef struct
+{
+  int x;
+} my_type_a_t;
+
+typedef struct
+{
+  bool x;
+} my_type_b_t;
+
+static my_type_a_t my_thing_a;
+static my_type_b_t my_thing_b;
+
+static int validator1_count = 0;
+static int validator2_count = 0;
+static int validator_int_count = 0;
+
+static int validator_prop_count = 0;
+
+/**
+ * The handler should have following arguments:
+ *   this: Ignore.
+ *   arg1: Bool.
+ *   arg2: Number. It must be strict primitive number.
+ *   arg3: String.
+ *   arg4: function. It is an optional argument.
+ *
+ */
+static jerry_value_t
+test_validator1_handler (const jerry_value_t func_obj_val __attribute__((unused)), /**< function object */
+                         const jerry_value_t this_val, /**< this value */
+                         const jerry_value_t args_p[], /**< arguments list */
+                         const jerry_length_t args_cnt) /**< arguments length */
+{
+
+  bool arg1;
+  double arg2 = 0.0;
+  char arg3[5] = "1234";
+  jerry_value_t arg4 = jerry_create_undefined ();
+
+  jerryx_arg_t mapping[] =
+  {
+    /* ignore this */
+    jerryx_arg_ignore (),
+    /* 1st argument should be boolean */
+    jerryx_arg_boolean (&arg1, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    /* 2nd argument should be strict number */
+    jerryx_arg_number (&arg2, JERRYX_ARG_NO_COERCE, JERRYX_ARG_REQUIRED),
+    /* 3th argument should be string */
+    jerryx_arg_string (arg3, 5, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    /* 4th argument should be function, and it is optional */
+    jerryx_arg_function (&arg4, JERRYX_ARG_OPTIONAL)
+  };
+
+  jerry_value_t is_ok = jerryx_arg_transform_this_and_args (this_val,
+                                                            args_p,
+                                                            args_cnt,
+                                                            mapping,
+                                                            5);
+
+  if (validator1_count == 0)
+  {
+    TEST_ASSERT (!jerry_value_has_error_flag (is_ok));
+    TEST_ASSERT (arg1);
+    TEST_ASSERT (arg2 == 10.5);
+    TEST_ASSERT (strcmp (arg3, "abc") == 0);
+    TEST_ASSERT (jerry_value_is_function (arg4));
+  }
+  else if (validator1_count == 1)
+  {
+    TEST_ASSERT (!jerry_value_has_error_flag (is_ok));
+    TEST_ASSERT (arg1);
+    TEST_ASSERT (arg2 == 10.5);
+    TEST_ASSERT (strcmp (arg3, "abc") == 0);
+    TEST_ASSERT (jerry_value_is_undefined (arg4));
+  }
+  else if (validator1_count == 2)
+  {
+    TEST_ASSERT (!jerry_value_has_error_flag (is_ok));
+    TEST_ASSERT (arg1);
+    TEST_ASSERT (arg2 == 10.5);
+    TEST_ASSERT (strcmp (arg3, "") == 0);
+    TEST_ASSERT (jerry_value_is_undefined (arg4));
+  }
+  else
+  {
+    TEST_ASSERT (jerry_value_has_error_flag (is_ok));
+  }
+
+  jerry_release_value (is_ok);
+  jerry_release_value (arg4);
+  validator1_count++;
+
+  return jerry_create_undefined ();
+} /* test_validator1_handler */
+
+/**
+ * The JS argument should be number, whose value is equal with the extra_info .
+ */
+static jerry_value_t
+my_custom_transform (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */
+                     const jerryx_arg_t *c_arg_p) /**< the native arg */
+{
+  jerry_value_t js_arg = jerryx_arg_js_iterator_pop (js_arg_iter_p);
+  jerry_value_t to_number = jerry_value_to_number (js_arg);
+
+  if (jerry_value_has_error_flag (to_number))
+  {
+    jerry_release_value (to_number);
+
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "It can not be converted to a number.");
+  }
+
+  int expected_num = (int) c_arg_p->extra_info;
+  int get_num = (int) jerry_get_number_value (to_number);
+
+  if (get_num != expected_num)
+  {
+    return jerry_create_error (JERRY_ERROR_TYPE,
+                               (jerry_char_t *) "Number value is not expected.");
+  }
+
+  return jerry_create_undefined ();
+} /* my_custom_transform */
+
+/**
+ * The handler should have following arguments:
+ *   this: with native pointer whose type is bind_a_info.
+ *   arg1: should pass the custom tranform function.
+ */
+static jerry_value_t
+test_validator2_handler (const jerry_value_t func_obj_val __attribute__((unused)), /**< function object */
+                         const jerry_value_t this_val, /**< this value */
+                         const jerry_value_t args_p[], /**< arguments list */
+                         const jerry_length_t args_cnt) /**< arguments length */
+{
+  my_type_a_t *thing_p;
+
+  jerryx_arg_t mapping[] =
+  {
+    /* this should has native pointer, whose type is thing_a_info */
+    jerryx_arg_native_pointer ((void **) &thing_p, &thing_a_info, JERRYX_ARG_REQUIRED),
+    /* custom tranform function */
+    jerryx_arg_custom (NULL, 5, my_custom_transform)
+  };
+
+  jerry_value_t is_ok = jerryx_arg_transform_this_and_args (this_val,
+                                                            args_p,
+                                                            args_cnt,
+                                                            mapping,
+                                                            2);
+
+  if (validator2_count == 0)
+  {
+    TEST_ASSERT (!jerry_value_has_error_flag (is_ok));
+    TEST_ASSERT (thing_p == &my_thing_a);
+    TEST_ASSERT (thing_p->x == 1);
+  }
+  else
+  {
+    TEST_ASSERT (jerry_value_has_error_flag (is_ok));
+  }
+
+  jerry_release_value (is_ok);
+  validator2_count++;
+
+  return jerry_create_undefined ();
+} /* test_validator2_handler */
+
+/**
+ * Calling jerryx_arg_transform_object_properties directly.
+ */
+static jerry_value_t
+test_validator_prop1_handler (const jerry_value_t func_obj_val __attribute__((unused)), /**< function object */
+                              const jerry_value_t this_val __attribute__((unused)), /**< this value */
+                              const jerry_value_t args_p[], /**< arguments list */
+                              const jerry_length_t args_cnt __attribute__((unused))) /**< arguments length */
+{
+  bool native1 = false;
+  double native2 = 0;
+  double native3 = 3;
+
+  const char *name_p[] = {"prop1", "prop2", "prop3"};
+
+  jerryx_arg_t mapping[] =
+  {
+    jerryx_arg_boolean (&native1, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_number (&native2, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_number (&native3, JERRYX_ARG_COERCE, JERRYX_ARG_OPTIONAL)
+  };
+
+  jerry_value_t is_ok = jerryx_arg_transform_object_properties (args_p[0],
+                                                                (const jerry_char_t **) name_p,
+                                                                3,
+                                                                mapping,
+                                                                3);
+
+  TEST_ASSERT (!jerry_value_has_error_flag (is_ok));
+  TEST_ASSERT (native1);
+  TEST_ASSERT (native2 == 1.5);
+  TEST_ASSERT (native3 == 3);
+
+  validator_prop_count++;
+
+  return jerry_create_undefined ();
+} /* test_validator_prop1_handler */
+
+/**
+ * Calling jerryx_arg_transform_object_properties indirectly by
+ * using jerryx_arg_object_properties.
+ */
+static jerry_value_t
+test_validator_prop2_handler (const jerry_value_t func_obj_val __attribute__((unused)), /**< function object */
+                              const jerry_value_t this_val __attribute__((unused)), /**< this value */
+                              const jerry_value_t args_p[], /**< arguments list */
+                              const jerry_length_t args_cnt __attribute__((unused))) /**< arguments length */
+{
+  bool native1 = false;
+  double native2 = 0;
+  double native3 = 3;
+
+  jerryx_arg_object_props_t prop_info;
+
+  const char *name_p[] = { "prop1", "prop2", "prop3" };
+
+  jerryx_arg_t prop_mapping[] =
+  {
+    jerryx_arg_boolean (&native1, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_number (&native2, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_number (&native3, JERRYX_ARG_COERCE, JERRYX_ARG_OPTIONAL)
+  };
+
+  prop_info.name_p = (const jerry_char_t **) name_p;
+  prop_info.name_cnt = 3;
+  prop_info.c_arg_p = prop_mapping;
+  prop_info.c_arg_cnt = 3;
+
+  jerryx_arg_t mapping[] =
+  {
+    jerryx_arg_object_properties (&prop_info, JERRYX_ARG_OPTIONAL),
+  };
+
+  jerry_value_t is_ok = jerryx_arg_transform_args (args_p, 1, mapping, 1);
+
+
+  TEST_ASSERT (!jerry_value_has_error_flag (is_ok));
+
+  if (validator_prop_count == 1)
+  {
+    TEST_ASSERT (native1);
+    TEST_ASSERT (native2 == 1.5);
+    TEST_ASSERT (native3 == 3);
+  }
+
+  validator_prop_count++;
+
+  return jerry_create_undefined ();
+} /* test_validator_prop2_handler */
+
+static jerry_value_t
+test_validator_prop3_handler (const jerry_value_t func_obj_val __attribute__((unused)), /**< function object */
+                              const jerry_value_t this_val __attribute__((unused)), /**< this value */
+                              const jerry_value_t args_p[], /**< arguments list */
+                              const jerry_length_t args_cnt __attribute__((unused))) /**< arguments length */
+{
+  bool native1 = false;
+  bool native2 = true;
+
+  const char *name_p[] = { "prop1", "prop2" };
+
+  jerryx_arg_t mapping[] =
+  {
+    jerryx_arg_boolean (&native1, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_boolean (&native2, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+  };
+
+  jerry_value_t is_ok = jerryx_arg_transform_object_properties (args_p[0],
+                                                                (const jerry_char_t **) name_p,
+                                                                2,
+                                                                mapping,
+                                                                2);
+
+  TEST_ASSERT (jerry_value_has_error_flag (is_ok));
+  TEST_ASSERT (!native1);
+  TEST_ASSERT (native2);
+
+  validator_prop_count++;
+  jerry_release_value (is_ok);
+
+  return jerry_create_undefined ();
+} /* test_validator_prop3_handler */
+
+/*
+ * args_p[0-2] are uint8, args_p[3-5] are int8, args_p[6-8] are uint32, args_p[9-11] are int32.
+ */
+static jerry_value_t
+test_validator_int1_handler (const jerry_value_t func_obj_val __attribute__((unused)), /**< function object */
+                             const jerry_value_t this_val __attribute__((unused)), /**< this value */
+                             const jerry_value_t args_p[], /**< arguments list */
+                             const jerry_length_t args_cnt) /**< arguments length */
+{
+  uint8_t num0, num1, num2;
+  int8_t num3, num4, num5;
+  uint32_t num6, num7, num8;
+  int32_t num9, num10, num11;
+
+  jerryx_arg_t mapping[] =
+  {
+    jerryx_arg_uint8 (&num0, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_uint8 (&num1, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_uint8 (&num2, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int8 (&num3, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int8 (&num4, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int8 (&num5, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_uint32 (&num6, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_uint32 (&num7, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_uint32 (&num8, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int32 (&num9, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int32 (&num10, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int32 (&num11, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED)
+  };
+
+  jerry_value_t is_ok = jerryx_arg_transform_args (args_p,
+                                                   args_cnt,
+                                                   mapping,
+                                                   12);
+
+  TEST_ASSERT (!jerry_value_has_error_flag (is_ok));
+  TEST_ASSERT (num0 == 0);
+  TEST_ASSERT (num1 == 255);
+  TEST_ASSERT (num2 == 128);
+  TEST_ASSERT (num3 == -128);
+  TEST_ASSERT (num4 == 127);
+  TEST_ASSERT (num5 == -127);
+  TEST_ASSERT (num6 == 0);
+  TEST_ASSERT (num7 == 4294967295);
+  TEST_ASSERT (num8 == 65536);
+  TEST_ASSERT (num9 == -2147483648);
+  TEST_ASSERT (num10 == 2147483647);
+  TEST_ASSERT (num11 == -2147483647);
+
+  jerry_release_value (is_ok);
+  validator_int_count++;
+
+  return jerry_create_undefined ();
+} /* test_validator_int1_handler */
+
+static jerry_value_t
+test_validator_int2_handler (const jerry_value_t func_obj_val __attribute__((unused)), /**< function object */
+                             const jerry_value_t this_val __attribute__((unused)), /**< this value */
+                             const jerry_value_t args_p[], /**< arguments list */
+                             const jerry_length_t args_cnt) /**< arguments length */
+{
+  int8_t num0, num1, num2, num3, num4, num5, num6, num7;
+  num6 = 123;
+  num7 = 123;
+
+  jerryx_arg_t mapping[] =
+  {
+    jerryx_arg_int8 (&num0, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int8 (&num1, JERRYX_ARG_FLOOR, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int8 (&num2, JERRYX_ARG_CEIL, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int8 (&num3, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int8 (&num4, JERRYX_ARG_FLOOR, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int8 (&num5, JERRYX_ARG_CEIL, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int8 (&num6, JERRYX_ARG_ROUND, JERRYX_ARG_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+    jerryx_arg_int8 (&num7, JERRYX_ARG_ROUND, JERRYX_ARG_NO_CLAMP, JERRYX_ARG_COERCE, JERRYX_ARG_REQUIRED),
+  };
+
+  jerry_value_t is_ok = jerryx_arg_transform_args (args_p,
+                                                   args_cnt,
+                                                   mapping,
+                                                   8);
+
+  TEST_ASSERT (jerry_value_has_error_flag (is_ok));
+  TEST_ASSERT (num0 == -2);
+  TEST_ASSERT (num1 == -2);
+  TEST_ASSERT (num2 == -1);
+  TEST_ASSERT (num3 == 2);
+  TEST_ASSERT (num4 == 1);
+  TEST_ASSERT (num5 == 2);
+  TEST_ASSERT (num6 == 127);
+  TEST_ASSERT (num7 == 123);
+
+  jerry_release_value (is_ok);
+  validator_int_count++;
+
+  return jerry_create_undefined ();
+} /* test_validator_int2_handler */
+
+static jerry_value_t
+create_object_a_handler (const jerry_value_t func_obj_val __attribute__((unused)), /**< function object */
+                         const jerry_value_t this_val, /**< this value */
+                         const jerry_value_t args_p[] __attribute__((unused)), /**< arguments list */
+                         const jerry_length_t args_cnt __attribute__((unused))) /**< arguments length */
+{
+  TEST_ASSERT (jerry_value_is_object (this_val));
+
+  my_thing_a.x = 1;
+  jerry_set_object_native_pointer (this_val,
+                                   &my_thing_a,
+                                   &thing_a_info);
+
+  return jerry_create_boolean (true);
+} /* create_object_a_handler */
+
+static jerry_value_t
+create_object_b_handler (const jerry_value_t func_obj_val __attribute__((unused)), /**< function object */
+                         const jerry_value_t this_val, /**< this value */
+                         const jerry_value_t args_p[] __attribute__((unused)), /**< arguments list */
+                         const jerry_length_t args_cnt __attribute__((unused))) /**< arguments length */
+{
+  TEST_ASSERT (jerry_value_is_object (this_val));
+
+  my_thing_b.x = false;
+  jerry_set_object_native_pointer (this_val,
+                                   &my_thing_b,
+                                   &thing_b_info);
+
+  return jerry_create_boolean (true);
+} /* create_object_b_handler */
+
+/**
+ * Register a JavaScript function in the global object.
+ */
+static void
+register_js_function (const char *name_p, /**< name of the function */
+                      jerry_external_handler_t handler_p) /**< function callback */
+{
+  jerry_value_t global_obj_val = jerry_get_global_object ();
+
+  jerry_value_t function_val = jerry_create_external_function (handler_p);
+  jerry_value_t function_name_val = jerry_create_string ((const jerry_char_t *) name_p);
+  jerry_value_t result_val = jerry_set_property (global_obj_val, function_name_val, function_val);
+
+  jerry_release_value (function_name_val);
+  jerry_release_value (function_val);
+  jerry_release_value (global_obj_val);
+
+  jerry_release_value (result_val);
+} /* register_js_function */
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  register_js_function ("test_validator1", test_validator1_handler);
+  register_js_function ("test_validator2", test_validator2_handler);
+  register_js_function ("test_validator_int1", test_validator_int1_handler);
+  register_js_function ("test_validator_int2", test_validator_int2_handler);
+  register_js_function ("MyObjectA", create_object_a_handler);
+  register_js_function ("MyObjectB", create_object_b_handler);
+  register_js_function ("test_validator_prop1", test_validator_prop1_handler);
+  register_js_function ("test_validator_prop2", test_validator_prop2_handler);
+  register_js_function ("test_validator_prop3", test_validator_prop3_handler);
+
+  jerry_value_t parsed_code_val = jerry_parse ((jerry_char_t *) test_source, strlen (test_source), false);
+  TEST_ASSERT (!jerry_value_has_error_flag (parsed_code_val));
+
+  jerry_value_t res = jerry_run (parsed_code_val);
+  TEST_ASSERT (!jerry_value_has_error_flag (res));
+  TEST_ASSERT (validator1_count == 5);
+  TEST_ASSERT (validator2_count == 3);
+  TEST_ASSERT (validator_prop_count == 4);
+  TEST_ASSERT (validator_int_count == 2);
+
+  jerry_release_value (res);
+  jerry_release_value (parsed_code_val);
+
+  jerry_cleanup ();
+} /* main */
diff --git a/deps/jerry/tests/unit-ext/test-ext-autorelease.c b/deps/jerry/tests/unit-ext/test-ext-autorelease.c
new file mode 100644 (file)
index 0000000..c639e99
--- /dev/null
@@ -0,0 +1,64 @@
+/* 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.
+ */
+
+/**
+ * Unit test for jerry-ext/autorelease.
+ */
+
+#include "jerryscript.h"
+#include "jerryscript-ext/autorelease.h"
+#include "test-common.h"
+
+static int native_free_cb_call_count;
+
+static void
+native_free_cb (void *native_p)
+{
+  ++native_free_cb_call_count;
+  (void) native_p;
+} /* native_free_cb */
+
+static const jerry_object_native_info_t native_info =
+{
+  .free_cb = native_free_cb,
+};
+
+static jerry_value_t
+create_object (void)
+{
+  jerry_value_t obj = jerry_create_object ();
+  jerry_set_object_native_pointer (obj, NULL, &native_info);
+  return obj;
+} /* create_object */
+
+static void
+test_autorelease_val (void)
+{
+  JERRYX_AR_VALUE_T obj = create_object ();
+  (void) obj;
+} /* test_autorelease_val */
+
+int
+main (void)
+{
+  jerry_init (JERRY_INIT_EMPTY);
+
+  native_free_cb_call_count = 0;
+  test_autorelease_val ();
+  jerry_gc ();
+  TEST_ASSERT (native_free_cb_call_count == 1);
+
+  jerry_cleanup ();
+} /* main */
diff --git a/deps/jerry/tests/unit-ext/test-ext-module-empty.c b/deps/jerry/tests/unit-ext/test-ext-module-empty.c
new file mode 100644 (file)
index 0000000..9b108a5
--- /dev/null
@@ -0,0 +1,70 @@
+/* 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.
+ */
+
+#include <string.h>
+
+#include "jerryscript.h"
+#include "test-common.h"
+#include "jerryscript-ext/module.h"
+
+int
+main (int argc, char **argv)
+{
+  (void) argc;
+  (void) argv;
+  jerry_char_t buffer[256];
+  jerry_size_t bytes_copied;
+  jerryx_module_resolver_t resolver = jerryx_module_native_resolver;
+
+  jerry_init (JERRY_INIT_EMPTY);
+
+  /* Attempt to load a non-existing module. */
+  jerry_value_t module = jerryx_module_resolve ((jerry_char_t *) "some-unknown-module-name", &resolver, 1);
+
+  TEST_ASSERT (jerry_value_has_error_flag (module));
+
+  /* Retrieve the error message. */
+  jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "message");
+  jerry_value_t prop = jerry_get_property (module, prop_name);
+
+  /* Assert that the error message is a string with specific contents. */
+  TEST_ASSERT (jerry_value_is_string (prop));
+
+  bytes_copied = jerry_substring_to_utf8_char_buffer (prop, 0, 254, buffer, 256);
+  buffer[bytes_copied] = 0;
+  TEST_ASSERT (!strcmp ((const char *) buffer, "Module not found"));
+
+  /* Release the error message property name and value. */
+  jerry_release_value (prop);
+  jerry_release_value (prop_name);
+
+  /* Retrieve the moduleName property. */
+  prop_name = jerry_create_string ((const jerry_char_t *) "moduleName");
+  prop = jerry_get_property (module, prop_name);
+
+  /* Assert that the moduleName property is a string containing the requested module name. */
+  TEST_ASSERT (jerry_value_is_string (prop));
+
+  bytes_copied = jerry_substring_to_utf8_char_buffer (prop, 0, 254, buffer, 256);
+  buffer[bytes_copied] = 0;
+  TEST_ASSERT (!strcmp ((const char *) buffer, "some-unknown-module-name"));
+
+  /* Release everything. */
+  jerry_release_value (prop);
+  jerry_release_value (prop_name);
+  jerry_release_value (module);
+
+  return 0;
+} /* main */
diff --git a/deps/jerry/tests/unit-libm/CMakeLists.txt b/deps/jerry/tests/unit-libm/CMakeLists.txt
new file mode 100644 (file)
index 0000000..83a8b25
--- /dev/null
@@ -0,0 +1,38 @@
+# 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.
+
+cmake_minimum_required (VERSION 2.8.12)
+project (unit-libm C)
+
+# Unit tests main modules
+file(GLOB SOURCE_UNIT_TEST_MAIN_MODULES *.c)
+
+# Unit tests declaration
+add_custom_target(unittests-libm)
+
+foreach(SOURCE_UNIT_TEST_MAIN ${SOURCE_UNIT_TEST_MAIN_MODULES})
+  get_filename_component(TARGET_NAME ${SOURCE_UNIT_TEST_MAIN} NAME_WE)
+  set(TARGET_NAME unit-${TARGET_NAME})
+
+  add_executable(${TARGET_NAME} ${SOURCE_UNIT_TEST_MAIN})
+  set_property(TARGET ${TARGET_NAME}
+               PROPERTY LINK_FLAGS "${LINKER_FLAGS_COMMON}")
+
+  target_link_libraries(${TARGET_NAME} jerry-libm)
+  if(JERRY_LIBC)
+    target_link_libraries(${TARGET_NAME} jerry-libc)
+  endif()
+
+  add_dependencies(unittests-libm ${TARGET_NAME})
+endforeach()
diff --git a/deps/jerry/tests/unit-libm/test-libm.c b/deps/jerry/tests/unit-libm/test-libm.c
new file mode 100644 (file)
index 0000000..9fc33bb
--- /dev/null
@@ -0,0 +1,96 @@
+/* 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.
+ */
+
+/**
+ * Unit test for jerry-libm
+ */
+
+#include <math.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+static bool passed = true;
+
+static void
+check_int (const char *expr, int computed, int expected)
+{
+  printf ("%s = %d [expected=%d] ", expr, computed, expected);
+
+  bool result = computed == expected;
+  printf ("%s\n", result ? "PASS" : "FAIL");
+
+  passed &= result;
+} /* check_int */
+
+typedef union
+{
+  double value;
+  uint64_t bits64;
+  uint32_t bits32[2];
+} double_bits_t;
+
+static void
+check_double (const char *expr, double computed, double expected)
+{
+  double_bits_t computed_bits;
+  double_bits_t expected_bits;
+
+  computed_bits.value = computed;
+  expected_bits.value = expected;
+
+  printf ("%s = 0x%08x%08x [expected=0x%08x%08x] ", expr,
+          (unsigned int) computed_bits.bits32[1], (unsigned int) computed_bits.bits32[0],
+          (unsigned int) expected_bits.bits32[1], (unsigned int) expected_bits.bits32[0]);
+
+  bool result;
+  if (isnan (computed) && isnan (expected))
+  {
+    result = true;
+  }
+  else
+  {
+    int64_t diff = (int64_t) (computed_bits.bits64 - expected_bits.bits64);
+    if (diff < 0)
+    {
+      diff = -diff;
+    }
+
+    if (diff <= 1) /* tolerate 1 bit of differene in the last place */
+    {
+      result = true;
+      if (diff != 0)
+      {
+        printf ("APPROX ");
+      }
+    }
+    else
+    {
+      result = false;
+    }
+  }
+  printf ("%s\n", result ? "PASS" : "FAIL");
+
+  passed &= result;
+} /* check_double */
+
+int
+main (void)
+{
+#define INF INFINITY
+#include "test-libm.inc.h"
+
+  return passed ? 0 : 1;
+} /* main */
diff --git a/deps/jerry/tests/unit-libm/test-libm.inc.h b/deps/jerry/tests/unit-libm/test-libm.inc.h
new file mode 100644 (file)
index 0000000..00f2070
--- /dev/null
@@ -0,0 +1,582 @@
+/* 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.
+ */
+
+/* This file is automatically generated by the gen-test-libm.sh script.
+ * Do not edit! */
+
+check_double ("acos (0.0)", acos (0.0), 1.57079632679489655800E+00);
+check_double ("acos (-0.0)", acos (-0.0), 1.57079632679489655800E+00);
+check_double ("acos (1.0)", acos (1.0), 0.00000000000000000000E+00);
+check_double ("acos (-1.0)", acos (-1.0), 3.14159265358979311600E+00);
+check_double ("acos (0.5)", acos (0.5), 1.04719755119659785336E+00);
+check_double ("acos (-0.5)", acos (-0.5), 2.09439510239319570672E+00);
+check_double ("acos (INFINITY)", acos (INFINITY), NAN);
+check_double ("acos (-INFINITY)", acos (-INFINITY), NAN);
+check_double ("acos (NAN)", acos (NAN), NAN);
+check_double ("acos (6.9e-18)", acos (6.9e-18), 1.57079632679489655800E+00);
+check_double ("acos (-6.9e-18)", acos (-6.9e-18), 1.57079632679489655800E+00);
+check_double ("acos (7.0e-18)", acos (7.0e-18), 1.57079632679489655800E+00);
+check_double ("acos (-7.0e-18)", acos (-7.0e-18), 1.57079632679489655800E+00);
+check_double ("acos (7.4e-9)", acos (7.4e-9), 1.57079631939489661185E+00);
+check_double ("acos (-7.4e-9)", acos (-7.4e-9), 1.57079633419489672619E+00);
+check_double ("acos (7.5e-9)", acos (7.5e-9), 1.57079631929489660358E+00);
+check_double ("acos (-7.5e-9)", acos (-7.5e-9), 1.57079633429489651242E+00);
+check_double ("acos (0.1)", acos (0.1), 1.47062890563333681371E+00);
+check_double ("acos (-0.1)", acos (-0.1), 1.67096374795645652434E+00);
+check_double ("acos (0.4)", acos (0.4), 1.15927948072740849561E+00);
+check_double ("acos (-0.4)", acos (-0.4), 1.98231317286238462039E+00);
+check_double ("acos (0.6)", acos (0.6), 9.27295218001612298053E-01);
+check_double ("acos (-0.6)", acos (-0.6), 2.21429743558818081794E+00);
+check_double ("acos (0.99)", acos (0.99), 1.41539473324427289569E-01);
+check_double ("acos (-0.99)", acos (-0.99), 3.00005318026536604847E+00);
+check_double ("acos (1.1)", acos (1.1), NAN);
+check_double ("acos (-1.1)", acos (-1.1), NAN);
+check_double ("acos (0.7)", acos (0.7), 7.95398830184143590394E-01);
+check_double ("asin (0.0)", asin (0.0), 0.00000000000000000000E+00);
+check_double ("asin (-0.0)", asin (-0.0), -0.00000000000000000000E+00);
+check_double ("asin (1.0)", asin (1.0), 1.57079632679489655800E+00);
+check_double ("asin (-1.0)", asin (-1.0), -1.57079632679489655800E+00);
+check_double ("asin (0.5)", asin (0.5), 5.23598775598298926681E-01);
+check_double ("asin (-0.5)", asin (-0.5), -5.23598775598298926681E-01);
+check_double ("asin (0.98)", asin (0.98), 1.37046148447177684737E+00);
+check_double ("asin (-0.98)", asin (-0.98), -1.37046148447177684737E+00);
+check_double ("asin (INFINITY)", asin (INFINITY), NAN);
+check_double ("asin (-INFINITY)", asin (-INFINITY), NAN);
+check_double ("asin (NAN)", asin (NAN), NAN);
+check_double ("asin (6.9e-18)", asin (6.9e-18), 6.90000000000000026253E-18);
+check_double ("asin (-6.9e-18)", asin (-6.9e-18), -6.90000000000000026253E-18);
+check_double ("asin (7.0e-18)", asin (7.0e-18), 6.99999999999999973042E-18);
+check_double ("asin (-7.0e-18)", asin (-7.0e-18), -6.99999999999999973042E-18);
+check_double ("asin (7.4e-9)", asin (7.4e-9), 7.40000000000000008865E-09);
+check_double ("asin (-7.4e-9)", asin (-7.4e-9), -7.40000000000000008865E-09);
+check_double ("asin (7.5e-9)", asin (7.5e-9), 7.49999999999999932974E-09);
+check_double ("asin (-7.5e-9)", asin (-7.5e-9), -7.49999999999999932974E-09);
+check_double ("asin (0.1)", asin (0.1), 1.00167421161559799803E-01);
+check_double ("asin (-0.1)", asin (-0.1), -1.00167421161559799803E-01);
+check_double ("asin (0.4)", asin (0.4), 4.11516846067488062388E-01);
+check_double ("asin (-0.4)", asin (-0.4), -4.11516846067488062388E-01);
+check_double ("asin (0.6)", asin (0.6), 6.43501108793284370968E-01);
+check_double ("asin (-0.6)", asin (-0.6), -6.43501108793284370968E-01);
+check_double ("asin (0.97)", asin (0.97), 1.32523080927960457132E+00);
+check_double ("asin (-0.97)", asin (-0.97), -1.32523080927960457132E+00);
+check_double ("asin (0.99)", asin (0.99), 1.42925685347046926843E+00);
+check_double ("asin (-0.99)", asin (-0.99), -1.42925685347046926843E+00);
+check_double ("asin (1.1)", asin (1.1), NAN);
+check_double ("asin (-1.1)", asin (-1.1), NAN);
+check_double ("asin (0.7)", asin (0.7), 7.75397496610752967605E-01);
+check_double ("atan (0.0)", atan (0.0), 0.00000000000000000000E+00);
+check_double ("atan (-0.0)", atan (-0.0), -0.00000000000000000000E+00);
+check_double ("atan (7.0 / 16.0)", atan (7.0 / 16.0), 4.12410441597387322776E-01);
+check_double ("atan (-7.0 / 16.0)", atan (-7.0 / 16.0), -4.12410441597387322776E-01);
+check_double ("atan (11.0 / 16.0)", atan (11.0 / 16.0), 6.02287346134964152178E-01);
+check_double ("atan (-11.0 / 16.0)", atan (-11.0 / 16.0), -6.02287346134964152178E-01);
+check_double ("atan (19.0 / 16.0)", atan (19.0 / 16.0), 8.70903457075652975838E-01);
+check_double ("atan (-19.0 / 16.0)", atan (-19.0 / 16.0), -8.70903457075652975838E-01);
+check_double ("atan (39.0 / 16.0)", atan (39.0 / 16.0), 1.18147960496175574718E+00);
+check_double ("atan (-39.0 / 16.0)", atan (-39.0 / 16.0), -1.18147960496175574718E+00);
+check_double ("atan (1.0)", atan (1.0), 7.85398163397448278999E-01);
+check_double ("atan (-1.0)", atan (-1.0), -7.85398163397448278999E-01);
+check_double ("atan (INFINITY)", atan (INFINITY), 1.57079632679489655800E+00);
+check_double ("atan (-INFINITY)", atan (-INFINITY), -1.57079632679489655800E+00);
+check_double ("atan (NAN)", atan (NAN), NAN);
+check_double ("atan (6.9 / 16.0)", atan (6.9 / 16.0), 4.07152520941509277197E-01);
+check_double ("atan (-6.9 / 16.0)", atan (-6.9 / 16.0), -4.07152520941509277197E-01);
+check_double ("atan (7.1 / 16.0)", atan (7.1 / 16.0), 4.17644283240569735849E-01);
+check_double ("atan (-7.1 / 16.0)", atan (-7.1 / 16.0), -4.17644283240569735849E-01);
+check_double ("atan (10.9 / 16.0)", atan (10.9 / 16.0), 5.98030920656102416011E-01);
+check_double ("atan (-10.9 / 16.0)", atan (-10.9 / 16.0), -5.98030920656102416011E-01);
+check_double ("atan (11.1 / 16.0)", atan (11.1 / 16.0), 6.06519005615576589641E-01);
+check_double ("atan (-11.1 / 16.0)", atan (-11.1 / 16.0), -6.06519005615576589641E-01);
+check_double ("atan (18.9 / 16.0)", atan (18.9 / 16.0), 8.68302259886018612534E-01);
+check_double ("atan (-18.9 / 16.0)", atan (-18.9 / 16.0), -8.68302259886018612534E-01);
+check_double ("atan (19.1 / 16.0)", atan (19.1 / 16.0), 8.73488683179258762479E-01);
+check_double ("atan (-19.1 / 16.0)", atan (-19.1 / 16.0), -8.73488683179258762479E-01);
+check_double ("atan (38.9 / 16.0)", atan (38.9 / 16.0), 1.18057723083411603149E+00);
+check_double ("atan (-38.9 / 16.0)", atan (-38.9 / 16.0), -1.18057723083411603149E+00);
+check_double ("atan (39.1 / 16.0)", atan (39.1 / 16.0), 1.18237802686613768799E+00);
+check_double ("atan (-39.1 / 16.0)", atan (-39.1 / 16.0), -1.18237802686613768799E+00);
+check_double ("atan (0.99)", atan (0.99), 7.80373080066635860241E-01);
+check_double ("atan (-0.99)", atan (-0.99), -7.80373080066635860241E-01);
+check_double ("atan (1.1)", atan (1.1), 8.32981266674431730657E-01);
+check_double ("atan (-1.1)", atan (-1.1), -8.32981266674431730657E-01);
+check_double ("atan (7.37e+19)", atan (7.37e+19), 1.57079632679489655800E+00);
+check_double ("atan (-7.37e+19)", atan (-7.37e+19), -1.57079632679489655800E+00);
+check_double ("atan (7.38e+19)", atan (7.38e+19), 1.57079632679489655800E+00);
+check_double ("atan (-7.38e+19)", atan (-7.38e+19), -1.57079632679489655800E+00);
+check_double ("atan (0.7)", atan (0.7), 6.10725964389208564320E-01);
+check_double ("atan2 (NAN, NAN)", atan2 (NAN, NAN), NAN);
+check_double ("atan2 (0.0, NAN)", atan2 (0.0, NAN), NAN);
+check_double ("atan2 (-0.0, NAN)", atan2 (-0.0, NAN), NAN);
+check_double ("atan2 (1.0, NAN)", atan2 (1.0, NAN), NAN);
+check_double ("atan2 (-1.0, NAN)", atan2 (-1.0, NAN), NAN);
+check_double ("atan2 (INFINITY, NAN)", atan2 (INFINITY, NAN), NAN);
+check_double ("atan2 (-INFINITY, NAN)", atan2 (-INFINITY, NAN), NAN);
+check_double ("atan2 (NAN, 0.0)", atan2 (NAN, 0.0), NAN);
+check_double ("atan2 (NAN, -0.0)", atan2 (NAN, -0.0), NAN);
+check_double ("atan2 (NAN, 1.0)", atan2 (NAN, 1.0), NAN);
+check_double ("atan2 (NAN, -1.0)", atan2 (NAN, -1.0), NAN);
+check_double ("atan2 (NAN, INFINITY)", atan2 (NAN, INFINITY), NAN);
+check_double ("atan2 (NAN, -INFINITY)", atan2 (NAN, -INFINITY), NAN);
+check_double ("atan2 (0.0, 0.0)", atan2 (0.0, 0.0), 0.00000000000000000000E+00);
+check_double ("atan2 (0.0, -0.0)", atan2 (0.0, -0.0), 3.14159265358979311600E+00);
+check_double ("atan2 (-0.0, 0.0)", atan2 (-0.0, 0.0), -0.00000000000000000000E+00);
+check_double ("atan2 (-0.0, -0.0)", atan2 (-0.0, -0.0), -3.14159265358979311600E+00);
+check_double ("atan2 (0.0, 1.0)", atan2 (0.0, 1.0), 0.00000000000000000000E+00);
+check_double ("atan2 (0.0, -1.0)", atan2 (0.0, -1.0), 3.14159265358979311600E+00);
+check_double ("atan2 (0.0, INFINITY)", atan2 (0.0, INFINITY), 0.00000000000000000000E+00);
+check_double ("atan2 (0.0, -INFINITY)", atan2 (0.0, -INFINITY), 3.14159265358979311600E+00);
+check_double ("atan2 (-0.0, 1.0)", atan2 (-0.0, 1.0), -0.00000000000000000000E+00);
+check_double ("atan2 (-0.0, -1.0)", atan2 (-0.0, -1.0), -3.14159265358979311600E+00);
+check_double ("atan2 (-0.0, INFINITY)", atan2 (-0.0, INFINITY), -0.00000000000000000000E+00);
+check_double ("atan2 (-0.0, -INFINITY)", atan2 (-0.0, -INFINITY), -3.14159265358979311600E+00);
+check_double ("atan2 (1.0, 0.0)", atan2 (1.0, 0.0), 1.57079632679489655800E+00);
+check_double ("atan2 (1.0, -0.0)", atan2 (1.0, -0.0), 1.57079632679489655800E+00);
+check_double ("atan2 (INFINITY, 0.0)", atan2 (INFINITY, 0.0), 1.57079632679489655800E+00);
+check_double ("atan2 (INFINITY, -0.0)", atan2 (INFINITY, -0.0), 1.57079632679489655800E+00);
+check_double ("atan2 (-1.0, 0.0)", atan2 (-1.0, 0.0), -1.57079632679489655800E+00);
+check_double ("atan2 (-1.0, -0.0)", atan2 (-1.0, -0.0), -1.57079632679489655800E+00);
+check_double ("atan2 (-INFINITY, 0.0)", atan2 (-INFINITY, 0.0), -1.57079632679489655800E+00);
+check_double ("atan2 (-INFINITY, -0.0)", atan2 (-INFINITY, -0.0), -1.57079632679489655800E+00);
+check_double ("atan2 (1.0, INFINITY)", atan2 (1.0, INFINITY), 0.00000000000000000000E+00);
+check_double ("atan2 (-1.0, INFINITY)", atan2 (-1.0, INFINITY), -0.00000000000000000000E+00);
+check_double ("atan2 (1.0, -INFINITY)", atan2 (1.0, -INFINITY), 3.14159265358979311600E+00);
+check_double ("atan2 (-1.0, -INFINITY)", atan2 (-1.0, -INFINITY), -3.14159265358979311600E+00);
+check_double ("atan2 (INFINITY, INFINITY)", atan2 (INFINITY, INFINITY), 7.85398163397448278999E-01);
+check_double ("atan2 (INFINITY, -INFINITY)", atan2 (INFINITY, -INFINITY), 2.35619449019234483700E+00);
+check_double ("atan2 (-INFINITY, INFINITY)", atan2 (-INFINITY, INFINITY), -7.85398163397448278999E-01);
+check_double ("atan2 (-INFINITY, -INFINITY)", atan2 (-INFINITY, -INFINITY), -2.35619449019234483700E+00);
+check_double ("atan2 (INFINITY, 1.0)", atan2 (INFINITY, 1.0), 1.57079632679489655800E+00);
+check_double ("atan2 (INFINITY, -1.0)", atan2 (INFINITY, -1.0), 1.57079632679489655800E+00);
+check_double ("atan2 (-INFINITY, 1.0)", atan2 (-INFINITY, 1.0), -1.57079632679489655800E+00);
+check_double ("atan2 (-INFINITY, -1.0)", atan2 (-INFINITY, -1.0), -1.57079632679489655800E+00);
+check_double ("atan2 (0.7, 1.0)", atan2 (0.7, 1.0), 6.10725964389208564320E-01);
+check_double ("atan2 (-0.7, 1.0)", atan2 (-0.7, 1.0), -6.10725964389208564320E-01);
+check_double ("atan2 (0.7, -1.0)", atan2 (0.7, -1.0), 2.53086668920058466270E+00);
+check_double ("atan2 (-0.7, -1.0)", atan2 (-0.7, -1.0), -2.53086668920058466270E+00);
+check_double ("atan2 (0.4, 0.0003)", atan2 (0.4, 0.0003), 1.57004632693552159672E+00);
+check_double ("atan2 (1.4, -0.93)", atan2 (1.4, -0.93), 2.15714876682378431383E+00);
+check_double ("ceil (0.0)", ceil (0.0), 0.00000000000000000000E+00);
+check_double ("ceil (-0.0)", ceil (-0.0), -0.00000000000000000000E+00);
+check_double ("ceil (INFINITY)", ceil (INFINITY), INF);
+check_double ("ceil (-INFINITY)", ceil (-INFINITY), -INF);
+check_double ("ceil (NAN)", ceil (NAN), NAN);
+check_double ("ceil (3.14)", ceil (3.14), 4.00000000000000000000E+00);
+check_double ("ceil (-3.14)", ceil (-3.14), -3.00000000000000000000E+00);
+check_double ("ceil (3.72e-09)", ceil (3.72e-09), 1.00000000000000000000E+00);
+check_double ("ceil (-3.72e-09)", ceil (-3.72e-09), -0.00000000000000000000E+00);
+check_double ("ceil (7.37e+19)", ceil (7.37e+19), 7.37000000000000000000E+19);
+check_double ("ceil (-7.37e+19)", ceil (-7.37e+19), -7.37000000000000000000E+19);
+check_double ("exp (0.0)", exp (0.0), 1.00000000000000000000E+00);
+check_double ("exp (-0.0)", exp (-0.0), 1.00000000000000000000E+00);
+check_double ("exp (1.0)", exp (1.0), 2.71828182845904509080E+00);
+check_double ("exp (-1.0)", exp (-1.0), 3.67879441171442334024E-01);
+check_double ("exp (INFINITY)", exp (INFINITY), INF);
+check_double ("exp (-INFINITY)", exp (-INFINITY), 0.00000000000000000000E+00);
+check_double ("exp (NAN)", exp (NAN), NAN);
+check_double ("exp (7.08e+02)", exp (7.08e+02), 3.02338314427605515848E+307);
+check_double ("exp (7.10e+02)", exp (7.10e+02), INF);
+check_double ("exp (-7.40e+02)", exp (-7.40e+02), 4.19955798965059562550E-322);
+check_double ("exp (-7.50e+02)", exp (-7.50e+02), 0.00000000000000000000E+00);
+check_double ("exp (0.34)", exp (0.34), 1.40494759056359375116E+00);
+check_double ("exp (-0.34)", exp (-0.34), 7.11770322762609652933E-01);
+check_double ("exp (0.35)", exp (0.35), 1.41906754859325712204E+00);
+check_double ("exp (-0.35)", exp (-0.35), 7.04688089718713439602E-01);
+check_double ("exp (1.03)", exp (1.03), 2.80106583469907910455E+00);
+check_double ("exp (-1.03)", exp (-1.03), 3.57006960569147380191E-01);
+check_double ("exp (1.04)", exp (1.04), 2.82921701435155981130E+00);
+check_double ("exp (-1.04)", exp (-1.04), 3.53454681958780159157E-01);
+check_double ("exp (3.72e-09)", exp (3.72e-09), 1.00000000372000008575E+00);
+check_double ("exp (-3.72e-09)", exp (-3.72e-09), 9.99999996280000025273E-01);
+check_double ("exp (3.73e-09)", exp (3.73e-09), 1.00000000373000008658E+00);
+check_double ("exp (-3.73e-09)", exp (-3.73e-09), 9.99999996270000024445E-01);
+check_double ("exp (2.0)", exp (2.0), 7.38905609893065040694E+00);
+check_double ("exp (3.0)", exp (3.0), 2.00855369231876679237E+01);
+check_double ("exp (0.7)", exp (0.7), 2.01375270747047663278E+00);
+check_double ("exp (38.0)", exp (38.0), 3.18559317571137560000E+16);
+check_double ("fabs (0.0)", fabs (0.0), 0.00000000000000000000E+00);
+check_double ("fabs (-0.0)", fabs (-0.0), 0.00000000000000000000E+00);
+check_double ("fabs (1.0)", fabs (1.0), 1.00000000000000000000E+00);
+check_double ("fabs (-1.0)", fabs (-1.0), 1.00000000000000000000E+00);
+check_double ("fabs (INFINITY)", fabs (INFINITY), INF);
+check_double ("fabs (-INFINITY)", fabs (-INFINITY), INF);
+check_double ("fabs (NAN)", fabs (NAN), NAN);
+check_double ("fabs (3.14)", fabs (3.14), 3.14000000000000012434E+00);
+check_double ("fabs (-3.14)", fabs (-3.14), 3.14000000000000012434E+00);
+check_double ("fabs (0.7)", fabs (0.7), 6.99999999999999955591E-01);
+check_double ("fabs (-0.7)", fabs (-0.7), 6.99999999999999955591E-01);
+check_double ("fabs (3.72e-09)", fabs (3.72e-09), 3.71999999999999997526E-09);
+check_double ("fabs (-3.72e-09)", fabs (-3.72e-09), 3.71999999999999997526E-09);
+check_double ("fabs (7.37e+19)", fabs (7.37e+19), 7.37000000000000000000E+19);
+check_double ("fabs (-7.37e+19)", fabs (-7.37e+19), 7.37000000000000000000E+19);
+check_double ("floor (0.0)", floor (0.0), 0.00000000000000000000E+00);
+check_double ("floor (-0.0)", floor (-0.0), -0.00000000000000000000E+00);
+check_double ("floor (INFINITY)", floor (INFINITY), INF);
+check_double ("floor (-INFINITY)", floor (-INFINITY), -INF);
+check_double ("floor (NAN)", floor (NAN), NAN);
+check_double ("floor (3.14)", floor (3.14), 3.00000000000000000000E+00);
+check_double ("floor (-3.14)", floor (-3.14), -4.00000000000000000000E+00);
+check_double ("floor (3.72e-09)", floor (3.72e-09), 0.00000000000000000000E+00);
+check_double ("floor (-3.72e-09)", floor (-3.72e-09), -1.00000000000000000000E+00);
+check_double ("floor (7.37e+19)", floor (7.37e+19), 7.37000000000000000000E+19);
+check_double ("floor (-7.37e+19)", floor (-7.37e+19), -7.37000000000000000000E+19);
+check_double ("fmod (0.0, 0.0)", fmod (0.0, 0.0), -NAN);
+check_double ("fmod (0.0, -0.0)", fmod (0.0, -0.0), -NAN);
+check_double ("fmod (-0.0, 0.0)", fmod (-0.0, 0.0), -NAN);
+check_double ("fmod (-0.0, -0.0)", fmod (-0.0, -0.0), -NAN);
+check_double ("fmod (0.0, 3.0)", fmod (0.0, 3.0), 0.00000000000000000000E+00);
+check_double ("fmod (0.0, -3.0)", fmod (0.0, -3.0), 0.00000000000000000000E+00);
+check_double ("fmod (-0.0, 3.0)", fmod (-0.0, 3.0), -0.00000000000000000000E+00);
+check_double ("fmod (-0.0, -3.0)", fmod (-0.0, -3.0), -0.00000000000000000000E+00);
+check_double ("fmod (0.0, INFINITY)", fmod (0.0, INFINITY), 0.00000000000000000000E+00);
+check_double ("fmod (0.0, -INFINITY)", fmod (0.0, -INFINITY), 0.00000000000000000000E+00);
+check_double ("fmod (-0.0, INFINITY)", fmod (-0.0, INFINITY), -0.00000000000000000000E+00);
+check_double ("fmod (-0.0, -INFINITY)", fmod (-0.0, -INFINITY), -0.00000000000000000000E+00);
+check_double ("fmod (0.0, NAN)", fmod (0.0, NAN), NAN);
+check_double ("fmod (-0.0, NAN)", fmod (-0.0, NAN), NAN);
+check_double ("fmod (3.0, 0.0)", fmod (3.0, 0.0), -NAN);
+check_double ("fmod (3.0, -0.0)", fmod (3.0, -0.0), -NAN);
+check_double ("fmod (-3.0, 0.0)", fmod (-3.0, 0.0), -NAN);
+check_double ("fmod (-3.0, -0.0)", fmod (-3.0, -0.0), -NAN);
+check_double ("fmod (3.0, 3.0)", fmod (3.0, 3.0), 0.00000000000000000000E+00);
+check_double ("fmod (3.0, -3.0)", fmod (3.0, -3.0), 0.00000000000000000000E+00);
+check_double ("fmod (-3.0, 3.0)", fmod (-3.0, 3.0), -0.00000000000000000000E+00);
+check_double ("fmod (-3.0, -3.0)", fmod (-3.0, -3.0), -0.00000000000000000000E+00);
+check_double ("fmod (3.0, INFINITY)", fmod (3.0, INFINITY), 3.00000000000000000000E+00);
+check_double ("fmod (3.0, -INFINITY)", fmod (3.0, -INFINITY), 3.00000000000000000000E+00);
+check_double ("fmod (-3.0, INFINITY)", fmod (-3.0, INFINITY), -3.00000000000000000000E+00);
+check_double ("fmod (-3.0, -INFINITY)", fmod (-3.0, -INFINITY), -3.00000000000000000000E+00);
+check_double ("fmod (3.0, NAN)", fmod (3.0, NAN), NAN);
+check_double ("fmod (-3.0, NAN)", fmod (-3.0, NAN), NAN);
+check_double ("fmod (INFINITY, 0.0)", fmod (INFINITY, 0.0), -NAN);
+check_double ("fmod (INFINITY, -0.0)", fmod (INFINITY, -0.0), -NAN);
+check_double ("fmod (-INFINITY, 0.0)", fmod (-INFINITY, 0.0), -NAN);
+check_double ("fmod (-INFINITY, -0.0)", fmod (-INFINITY, -0.0), -NAN);
+check_double ("fmod (INFINITY, 3.0)", fmod (INFINITY, 3.0), -NAN);
+check_double ("fmod (INFINITY, -3.0)", fmod (INFINITY, -3.0), -NAN);
+check_double ("fmod (-INFINITY, 3.0)", fmod (-INFINITY, 3.0), -NAN);
+check_double ("fmod (-INFINITY, -3.0)", fmod (-INFINITY, -3.0), -NAN);
+check_double ("fmod (INFINITY, INFINITY)", fmod (INFINITY, INFINITY), -NAN);
+check_double ("fmod (INFINITY, -INFINITY)", fmod (INFINITY, -INFINITY), -NAN);
+check_double ("fmod (-INFINITY, INFINITY)", fmod (-INFINITY, INFINITY), -NAN);
+check_double ("fmod (-INFINITY, -INFINITY)", fmod (-INFINITY, -INFINITY), -NAN);
+check_double ("fmod (INFINITY, NAN)", fmod (INFINITY, NAN), NAN);
+check_double ("fmod (-INFINITY, NAN)", fmod (-INFINITY, NAN), NAN);
+check_double ("fmod (NAN, 0.0)", fmod (NAN, 0.0), NAN);
+check_double ("fmod (NAN, -0.0)", fmod (NAN, -0.0), NAN);
+check_double ("fmod (NAN, 3.0)", fmod (NAN, 3.0), NAN);
+check_double ("fmod (NAN, -3.0)", fmod (NAN, -3.0), NAN);
+check_double ("fmod (NAN, INFINITY)", fmod (NAN, INFINITY), NAN);
+check_double ("fmod (NAN, -INFINITY)", fmod (NAN, -INFINITY), NAN);
+check_double ("fmod (NAN, NAN)", fmod (NAN, NAN), NAN);
+check_double ("fmod (3.0, 1.0)", fmod (3.0, 1.0), 0.00000000000000000000E+00);
+check_double ("fmod (3.0, -1.0)", fmod (3.0, -1.0), 0.00000000000000000000E+00);
+check_double ("fmod (-3.0, 1.0)", fmod (-3.0, 1.0), -0.00000000000000000000E+00);
+check_double ("fmod (-3.0, -1.0)", fmod (-3.0, -1.0), -0.00000000000000000000E+00);
+check_double ("fmod (6.5, 2.3)", fmod (6.5, 2.3), 1.90000000000000035527E+00);
+check_double ("fmod (6.5, -2.3)", fmod (6.5, -2.3), 1.90000000000000035527E+00);
+check_double ("fmod (-6.5, 2.3)", fmod (-6.5, 2.3), -1.90000000000000035527E+00);
+check_double ("fmod (-6.5, -2.3)", fmod (-6.5, -2.3), -1.90000000000000035527E+00);
+check_int ("isnan (0.0)", isnan (0.0), 0);
+check_int ("isnan (-0.0)", isnan (-0.0), 0);
+check_int ("isnan (1.0)", isnan (1.0), 0);
+check_int ("isnan (-1.0)", isnan (-1.0), 0);
+check_int ("isnan (INFINITY)", isnan (INFINITY), 0);
+check_int ("isnan (-INFINITY)", isnan (-INFINITY), 0);
+check_int ("isnan (NAN)", isnan (NAN), 1);
+check_int ("isnan (3.14)", isnan (3.14), 0);
+check_int ("isnan (-3.14)", isnan (-3.14), 0);
+check_int ("isnan (0.7)", isnan (0.7), 0);
+check_int ("isnan (-0.7)", isnan (-0.7), 0);
+check_int ("isnan (3.72e-09)", isnan (3.72e-09), 0);
+check_int ("isnan (-3.72e-09)", isnan (-3.72e-09), 0);
+check_int ("isnan (7.37e+19)", isnan (7.37e+19), 0);
+check_int ("isnan (-7.37e+19)", isnan (-7.37e+19), 0);
+check_double ("log (0.0)", log (0.0), -INF);
+check_double ("log (-0.0)", log (-0.0), -INF);
+check_double ("log (1.0)", log (1.0), 0.00000000000000000000E+00);
+check_double ("log (-1.0)", log (-1.0), NAN);
+check_double ("log (INFINITY)", log (INFINITY), INF);
+check_double ("log (-INFINITY)", log (-INFINITY), NAN);
+check_double ("log (NAN)", log (NAN), NAN);
+check_double ("log (M_E)", log (M_E), 1.00000000000000000000E+00);
+check_double ("log (1.0 / M_E)", log (1.0 / M_E), -1.00000000000000000000E+00);
+check_double ("log (2)", log (2), 6.93147180559945286227E-01);
+check_double ("log (10)", log (10), 2.30258509299404590109E+00);
+check_double ("log (0.7)", log (0.7), -3.56674943938732447180E-01);
+check_double ("log (2.22e-308)", log (2.22e-308), -7.08398701446281847893E+02);
+check_double ("log (2.23e-308)", log (2.23e-308), -7.08394207056694085622E+02);
+check_double ("log (0.17)", log (0.17), -1.77195684193187519284E+00);
+check_double ("log (0.18)", log (0.18), -1.71479842809192661868E+00);
+check_double ("log (1999.0)", log (1999.0), 7.60040233450039970364E+00);
+check_double ("log (2000.0)", log (2000.0), 7.60090245954208221235E+00);
+check_double ("log (2001.0)", log (2001.0), 7.60140233458373337783E+00);
+check_double ("pow (0.0, 0.0)", pow (0.0, 0.0), 1.00000000000000000000E+00);
+check_double ("pow (0.0, -0.0)", pow (0.0, -0.0), 1.00000000000000000000E+00);
+check_double ("pow (-0.0, 0.0)", pow (-0.0, 0.0), 1.00000000000000000000E+00);
+check_double ("pow (-0.0, -0.0)", pow (-0.0, -0.0), 1.00000000000000000000E+00);
+check_double ("pow (0.0, 1.0)", pow (0.0, 1.0), 0.00000000000000000000E+00);
+check_double ("pow (0.0, -1.0)", pow (0.0, -1.0), INF);
+check_double ("pow (-0.0, 1.0)", pow (-0.0, 1.0), -0.00000000000000000000E+00);
+check_double ("pow (-0.0, -1.0)", pow (-0.0, -1.0), -INF);
+check_double ("pow (0.0, INFINITY)", pow (0.0, INFINITY), 0.00000000000000000000E+00);
+check_double ("pow (0.0, -INFINITY)", pow (0.0, -INFINITY), INF);
+check_double ("pow (-0.0, INFINITY)", pow (-0.0, INFINITY), 0.00000000000000000000E+00);
+check_double ("pow (-0.0, -INFINITY)", pow (-0.0, -INFINITY), INF);
+check_double ("pow (0.0, NAN)", pow (0.0, NAN), NAN);
+check_double ("pow (-0.0, NAN)", pow (-0.0, NAN), NAN);
+check_double ("pow (1.0, 0.0)", pow (1.0, 0.0), 1.00000000000000000000E+00);
+check_double ("pow (1.0, -0.0)", pow (1.0, -0.0), 1.00000000000000000000E+00);
+check_double ("pow (-1.0, 0.0)", pow (-1.0, 0.0), 1.00000000000000000000E+00);
+check_double ("pow (-1.0, -0.0)", pow (-1.0, -0.0), 1.00000000000000000000E+00);
+check_double ("pow (1.0, 1.0)", pow (1.0, 1.0), 1.00000000000000000000E+00);
+check_double ("pow (1.0, -1.0)", pow (1.0, -1.0), 1.00000000000000000000E+00);
+check_double ("pow (-1.0, 1.0)", pow (-1.0, 1.0), -1.00000000000000000000E+00);
+check_double ("pow (-1.0, -1.0)", pow (-1.0, -1.0), -1.00000000000000000000E+00);
+check_double ("pow (1.0, INFINITY)", pow (1.0, INFINITY), 1.00000000000000000000E+00);
+check_double ("pow (1.0, -INFINITY)", pow (1.0, -INFINITY), 1.00000000000000000000E+00);
+check_double ("pow (-1.0, INFINITY)", pow (-1.0, INFINITY), 1.00000000000000000000E+00);
+check_double ("pow (-1.0, -INFINITY)", pow (-1.0, -INFINITY), 1.00000000000000000000E+00);
+check_double ("pow (1.0, NAN)", pow (1.0, NAN), 1.00000000000000000000E+00);
+check_double ("pow (-1.0, NAN)", pow (-1.0, NAN), NAN);
+check_double ("pow (INFINITY, 0.0)", pow (INFINITY, 0.0), 1.00000000000000000000E+00);
+check_double ("pow (INFINITY, -0.0)", pow (INFINITY, -0.0), 1.00000000000000000000E+00);
+check_double ("pow (-INFINITY, 0.0)", pow (-INFINITY, 0.0), 1.00000000000000000000E+00);
+check_double ("pow (-INFINITY, -0.0)", pow (-INFINITY, -0.0), 1.00000000000000000000E+00);
+check_double ("pow (INFINITY, 1.0)", pow (INFINITY, 1.0), INF);
+check_double ("pow (INFINITY, -1.0)", pow (INFINITY, -1.0), 0.00000000000000000000E+00);
+check_double ("pow (-INFINITY, 1.0)", pow (-INFINITY, 1.0), -INF);
+check_double ("pow (-INFINITY, -1.0)", pow (-INFINITY, -1.0), -0.00000000000000000000E+00);
+check_double ("pow (INFINITY, INFINITY)", pow (INFINITY, INFINITY), INF);
+check_double ("pow (INFINITY, -INFINITY)", pow (INFINITY, -INFINITY), 0.00000000000000000000E+00);
+check_double ("pow (-INFINITY, INFINITY)", pow (-INFINITY, INFINITY), INF);
+check_double ("pow (-INFINITY, -INFINITY)", pow (-INFINITY, -INFINITY), 0.00000000000000000000E+00);
+check_double ("pow (INFINITY, NAN)", pow (INFINITY, NAN), NAN);
+check_double ("pow (-INFINITY, NAN)", pow (-INFINITY, NAN), NAN);
+check_double ("pow (NAN, 0.0)", pow (NAN, 0.0), 1.00000000000000000000E+00);
+check_double ("pow (NAN, -0.0)", pow (NAN, -0.0), 1.00000000000000000000E+00);
+check_double ("pow (NAN, 1.0)", pow (NAN, 1.0), NAN);
+check_double ("pow (NAN, -1.0)", pow (NAN, -1.0), NAN);
+check_double ("pow (NAN, INFINITY)", pow (NAN, INFINITY), NAN);
+check_double ("pow (NAN, -INFINITY)", pow (NAN, -INFINITY), NAN);
+check_double ("pow (NAN, NAN)", pow (NAN, NAN), NAN);
+check_double ("pow (0.9, INFINITY)", pow (0.9, INFINITY), 0.00000000000000000000E+00);
+check_double ("pow (0.9, -INFINITY)", pow (0.9, -INFINITY), INF);
+check_double ("pow (-0.9, INFINITY)", pow (-0.9, INFINITY), 0.00000000000000000000E+00);
+check_double ("pow (-0.9, -INFINITY)", pow (-0.9, -INFINITY), INF);
+check_double ("pow (1.1, INFINITY)", pow (1.1, INFINITY), INF);
+check_double ("pow (1.1, -INFINITY)", pow (1.1, -INFINITY), 0.00000000000000000000E+00);
+check_double ("pow (-1.1, INFINITY)", pow (-1.1, INFINITY), INF);
+check_double ("pow (-1.1, -INFINITY)", pow (-1.1, -INFINITY), 0.00000000000000000000E+00);
+check_double ("pow (0.0, 2.0)", pow (0.0, 2.0), 0.00000000000000000000E+00);
+check_double ("pow (0.0, -2.0)", pow (0.0, -2.0), INF);
+check_double ("pow (-0.0, 2.0)", pow (-0.0, 2.0), 0.00000000000000000000E+00);
+check_double ("pow (-0.0, -2.0)", pow (-0.0, -2.0), INF);
+check_double ("pow (0.0, 3.0)", pow (0.0, 3.0), 0.00000000000000000000E+00);
+check_double ("pow (0.0, -3.0)", pow (0.0, -3.0), INF);
+check_double ("pow (-0.0, 3.0)", pow (-0.0, 3.0), -0.00000000000000000000E+00);
+check_double ("pow (-0.0, -3.0)", pow (-0.0, -3.0), -INF);
+check_double ("pow (0.0, 3.14)", pow (0.0, 3.14), 0.00000000000000000000E+00);
+check_double ("pow (0.0, -3.14)", pow (0.0, -3.14), INF);
+check_double ("pow (-0.0, 3.14)", pow (-0.0, 3.14), 0.00000000000000000000E+00);
+check_double ("pow (-0.0, -3.14)", pow (-0.0, -3.14), INF);
+check_double ("pow (1.0, 3.14)", pow (1.0, 3.14), 1.00000000000000000000E+00);
+check_double ("pow (1.0, -3.14)", pow (1.0, -3.14), 1.00000000000000000000E+00);
+check_double ("pow (-1.0, 3.14)", pow (-1.0, 3.14), -NAN);
+check_double ("pow (-1.0, -3.14)", pow (-1.0, -3.14), -NAN);
+check_double ("pow (3.14, 0.0)", pow (3.14, 0.0), 1.00000000000000000000E+00);
+check_double ("pow (3.14, -0.0)", pow (3.14, -0.0), 1.00000000000000000000E+00);
+check_double ("pow (-3.14, 0.0)", pow (-3.14, 0.0), 1.00000000000000000000E+00);
+check_double ("pow (-3.14, -0.0)", pow (-3.14, -0.0), 1.00000000000000000000E+00);
+check_double ("pow (3.14, 1.0)", pow (3.14, 1.0), 3.14000000000000012434E+00);
+check_double ("pow (3.14, -1.0)", pow (3.14, -1.0), 3.18471337579617819191E-01);
+check_double ("pow (-3.14, 1.0)", pow (-3.14, 1.0), -3.14000000000000012434E+00);
+check_double ("pow (-3.14, -1.0)", pow (-3.14, -1.0), -3.18471337579617819191E-01);
+check_double ("pow (3.14, 2.0)", pow (3.14, 2.0), 9.85960000000000036380E+00);
+check_double ("pow (3.14, -2.0)", pow (3.14, -2.0), 1.01423992859750899953E-01);
+check_double ("pow (-3.14, 2.0)", pow (-3.14, 2.0), 9.85960000000000036380E+00);
+check_double ("pow (-3.14, -2.0)", pow (-3.14, -2.0), 1.01423992859750899953E-01);
+check_double ("pow (3.14, 3.0)", pow (3.14, 3.0), 3.09591440000000019950E+01);
+check_double ("pow (3.14, -3.0)", pow (3.14, -3.0), 3.23006346687104775595E-02);
+check_double ("pow (-3.14, 3.0)", pow (-3.14, 3.0), -3.09591440000000019950E+01);
+check_double ("pow (-3.14, -3.0)", pow (-3.14, -3.0), -3.23006346687104775595E-02);
+check_double ("pow (3.14, 3.14)", pow (3.14, 3.14), 3.63378388801747078674E+01);
+check_double ("pow (3.14, -3.14)", pow (3.14, -3.14), 2.75195231972252124519E-02);
+check_double ("pow (-3.14, 3.14)", pow (-3.14, 3.14), -NAN);
+check_double ("pow (-3.14, -3.14)", pow (-3.14, -3.14), -NAN);
+check_double ("pow (INFINITY, 2.0)", pow (INFINITY, 2.0), INF);
+check_double ("pow (INFINITY, -2.0)", pow (INFINITY, -2.0), 0.00000000000000000000E+00);
+check_double ("pow (-INFINITY, 2.0)", pow (-INFINITY, 2.0), INF);
+check_double ("pow (-INFINITY, -2.0)", pow (-INFINITY, -2.0), 0.00000000000000000000E+00);
+check_double ("pow (INFINITY, 3.0)", pow (INFINITY, 3.0), INF);
+check_double ("pow (INFINITY, -3.0)", pow (INFINITY, -3.0), 0.00000000000000000000E+00);
+check_double ("pow (-INFINITY, 3.0)", pow (-INFINITY, 3.0), -INF);
+check_double ("pow (-INFINITY, -3.0)", pow (-INFINITY, -3.0), -0.00000000000000000000E+00);
+check_double ("pow (INFINITY, 3.14)", pow (INFINITY, 3.14), INF);
+check_double ("pow (INFINITY, -3.14)", pow (INFINITY, -3.14), 0.00000000000000000000E+00);
+check_double ("pow (-INFINITY, 3.14)", pow (-INFINITY, 3.14), INF);
+check_double ("pow (-INFINITY, -3.14)", pow (-INFINITY, -3.14), 0.00000000000000000000E+00);
+check_double ("pow (0.7, 1.2)", pow (0.7, 1.2), 6.51804940566386381562E-01);
+check_double ("sqrt (0.0)", sqrt (0.0), 0.00000000000000000000E+00);
+check_double ("sqrt (-0.0)", sqrt (-0.0), -0.00000000000000000000E+00);
+check_double ("sqrt (1.0)", sqrt (1.0), 1.00000000000000000000E+00);
+check_double ("sqrt (-1.0)", sqrt (-1.0), -NAN);
+check_double ("sqrt (INFINITY)", sqrt (INFINITY), INF);
+check_double ("sqrt (-INFINITY)", sqrt (-INFINITY), -NAN);
+check_double ("sqrt (NAN)", sqrt (NAN), NAN);
+check_double ("sqrt (0.7)", sqrt (0.7), 8.36660026534075562665E-01);
+check_double ("sqrt (2)", sqrt (2), 1.41421356237309514547E+00);
+check_double ("sqrt (10)", sqrt (10), 3.16227766016837952279E+00);
+check_double ("sqrt (2.22e-308)", sqrt (2.22e-308), 1.48996644257513405066E-154);
+check_double ("sqrt (2.23e-308)", sqrt (2.23e-308), 1.49331845230680803391E-154);
+check_double ("sqrt (3.72e-09)", sqrt (3.72e-09), 6.09918027279076225416E-05);
+check_double ("sqrt (7.37e+19)", sqrt (7.37e+19), 8.58487041253390121460E+09);
+check_double ("sqrt (2209)", sqrt (2209), 4.70000000000000000000E+01);
+check_double ("sqrt (4)", sqrt (4), 2.00000000000000000000E+00);
+check_double ("sqrt (0.25)", sqrt (0.25), 5.00000000000000000000E-01);
+check_double ("sqrt (6642.25)", sqrt (6642.25), 8.15000000000000000000E+01);
+check_double ("sqrt (15239.9025)", sqrt (15239.9025), 1.23450000000000002842E+02);
+check_double ("sin (0.0)", sin (0.0), 0.00000000000000000000E+00);
+check_double ("sin (-0.0)", sin (-0.0), -0.00000000000000000000E+00);
+check_double ("sin (1.0)", sin (1.0), 8.41470984807896504876E-01);
+check_double ("sin (-1.0)", sin (-1.0), -8.41470984807896504876E-01);
+check_double ("sin (INFINITY)", sin (INFINITY), -NAN);
+check_double ("sin (-INFINITY)", sin (-INFINITY), -NAN);
+check_double ("sin (NAN)", sin (NAN), NAN);
+check_double ("sin (M_PI)", sin (M_PI), 1.22464679914735320717E-16);
+check_double ("sin (-M_PI)", sin (-M_PI), -1.22464679914735320717E-16);
+check_double ("sin (2.0 * M_PI)", sin (2.0 * M_PI), -2.44929359829470641435E-16);
+check_double ("sin (-2.0 * M_PI)", sin (-2.0 * M_PI), 2.44929359829470641435E-16);
+check_double ("sin (M_PI / 2.0)", sin (M_PI / 2.0), 1.00000000000000000000E+00);
+check_double ("sin (-M_PI / 2.0)", sin (-M_PI / 2.0), -1.00000000000000000000E+00);
+check_double ("sin (M_PI / 3.0)", sin (M_PI / 3.0), 8.66025403784438596588E-01);
+check_double ("sin (-M_PI / 3.0)", sin (-M_PI / 3.0), -8.66025403784438596588E-01);
+check_double ("sin (M_PI / 4.0)", sin (M_PI / 4.0), 7.07106781186547461715E-01);
+check_double ("sin (-M_PI / 4.0)", sin (-M_PI / 4.0), -7.07106781186547461715E-01);
+check_double ("sin (M_PI / 6.0)", sin (M_PI / 6.0), 4.99999999999999944489E-01);
+check_double ("sin (-M_PI / 6.0)", sin (-M_PI / 6.0), -4.99999999999999944489E-01);
+check_double ("sin (M_PI * 2.0 / 3.0)", sin (M_PI * 2.0 / 3.0), 8.66025403784438707611E-01);
+check_double ("sin (-M_PI * 2.0 / 3.0)", sin (-M_PI * 2.0 / 3.0), -8.66025403784438707611E-01);
+check_double ("sin (M_PI * 5.0 / 6.0)", sin (M_PI * 5.0 / 6.0), 4.99999999999999944489E-01);
+check_double ("sin (-M_PI * 5.0 / 6.0)", sin (-M_PI * 5.0 / 6.0), -4.99999999999999944489E-01);
+check_double ("sin (6.9e-18)", sin (6.9e-18), 6.90000000000000026253E-18);
+check_double ("sin (-6.9e-18)", sin (-6.9e-18), -6.90000000000000026253E-18);
+check_double ("sin (7.0e-18)", sin (7.0e-18), 6.99999999999999973042E-18);
+check_double ("sin (-7.0e-18)", sin (-7.0e-18), -6.99999999999999973042E-18);
+check_double ("sin (7.4e-9)", sin (7.4e-9), 7.40000000000000008865E-09);
+check_double ("sin (-7.4e-9)", sin (-7.4e-9), -7.40000000000000008865E-09);
+check_double ("sin (7.5e-9)", sin (7.5e-9), 7.49999999999999932974E-09);
+check_double ("sin (-7.5e-9)", sin (-7.5e-9), -7.49999999999999932974E-09);
+check_double ("sin (0.2)", sin (0.2), 1.98669330795061216399E-01);
+check_double ("sin (-0.2)", sin (-0.2), -1.98669330795061216399E-01);
+check_double ("sin (0.4)", sin (0.4), 3.89418342308650522465E-01);
+check_double ("sin (-0.4)", sin (-0.4), -3.89418342308650522465E-01);
+check_double ("sin (0.7)", sin (0.7), 6.44217687237691016833E-01);
+check_double ("sin (-0.7)", sin (-0.7), -6.44217687237691016833E-01);
+check_double ("sin (0.8)", sin (0.8), 7.17356090899522791382E-01);
+check_double ("sin (-0.8)", sin (-0.8), -7.17356090899522791382E-01);
+check_double ("sin (3.0)", sin (3.0), 1.41120008059867213523E-01);
+check_double ("sin (-3.0)", sin (-3.0), -1.41120008059867213523E-01);
+check_double ("sin (4.0)", sin (4.0), -7.56802495307928202450E-01);
+check_double ("sin (-4.0)", sin (-4.0), 7.56802495307928202450E-01);
+check_double ("sin (6.0)", sin (6.0), -2.79415498198925860152E-01);
+check_double ("sin (-6.0)", sin (-6.0), 2.79415498198925860152E-01);
+check_double ("sin (7.0)", sin (7.0), 6.56986598718789061024E-01);
+check_double ("sin (-7.0)", sin (-7.0), -6.56986598718789061024E-01);
+check_double ("cos (0.0)", cos (0.0), 1.00000000000000000000E+00);
+check_double ("cos (-0.0)", cos (-0.0), 1.00000000000000000000E+00);
+check_double ("cos (1.0)", cos (1.0), 5.40302305868139765010E-01);
+check_double ("cos (-1.0)", cos (-1.0), 5.40302305868139765010E-01);
+check_double ("cos (INFINITY)", cos (INFINITY), -NAN);
+check_double ("cos (-INFINITY)", cos (-INFINITY), -NAN);
+check_double ("cos (NAN)", cos (NAN), NAN);
+check_double ("cos (M_PI)", cos (M_PI), -1.00000000000000000000E+00);
+check_double ("cos (-M_PI)", cos (-M_PI), -1.00000000000000000000E+00);
+check_double ("cos (2.0 * M_PI)", cos (2.0 * M_PI), 1.00000000000000000000E+00);
+check_double ("cos (-2.0 * M_PI)", cos (-2.0 * M_PI), 1.00000000000000000000E+00);
+check_double ("cos (M_PI / 2.0)", cos (M_PI / 2.0), 6.12323399573676603587E-17);
+check_double ("cos (-M_PI / 2.0)", cos (-M_PI / 2.0), 6.12323399573676603587E-17);
+check_double ("cos (M_PI / 3.0)", cos (M_PI / 3.0), 5.00000000000000111022E-01);
+check_double ("cos (-M_PI / 3.0)", cos (-M_PI / 3.0), 5.00000000000000111022E-01);
+check_double ("cos (M_PI / 4.0)", cos (M_PI / 4.0), 7.07106781186547572737E-01);
+check_double ("cos (-M_PI / 4.0)", cos (-M_PI / 4.0), 7.07106781186547572737E-01);
+check_double ("cos (M_PI / 6.0)", cos (M_PI / 6.0), 8.66025403784438707611E-01);
+check_double ("cos (-M_PI / 6.0)", cos (-M_PI / 6.0), 8.66025403784438707611E-01);
+check_double ("cos (M_PI * 2.0 / 3.0)", cos (M_PI * 2.0 / 3.0), -4.99999999999999777955E-01);
+check_double ("cos (-M_PI * 2.0 / 3.0)", cos (-M_PI * 2.0 / 3.0), -4.99999999999999777955E-01);
+check_double ("cos (M_PI * 5.0 / 6.0)", cos (M_PI * 5.0 / 6.0), -8.66025403784438707611E-01);
+check_double ("cos (-M_PI * 5.0 / 6.0)", cos (-M_PI * 5.0 / 6.0), -8.66025403784438707611E-01);
+check_double ("cos (6.9e-18)", cos (6.9e-18), 1.00000000000000000000E+00);
+check_double ("cos (-6.9e-18)", cos (-6.9e-18), 1.00000000000000000000E+00);
+check_double ("cos (7.0e-18)", cos (7.0e-18), 1.00000000000000000000E+00);
+check_double ("cos (-7.0e-18)", cos (-7.0e-18), 1.00000000000000000000E+00);
+check_double ("cos (7.4e-9)", cos (7.4e-9), 1.00000000000000000000E+00);
+check_double ("cos (-7.4e-9)", cos (-7.4e-9), 1.00000000000000000000E+00);
+check_double ("cos (7.5e-9)", cos (7.5e-9), 1.00000000000000000000E+00);
+check_double ("cos (-7.5e-9)", cos (-7.5e-9), 1.00000000000000000000E+00);
+check_double ("cos (0.2)", cos (0.2), 9.80066577841241626246E-01);
+check_double ("cos (-0.2)", cos (-0.2), 9.80066577841241626246E-01);
+check_double ("cos (0.4)", cos (0.4), 9.21060994002885102816E-01);
+check_double ("cos (-0.4)", cos (-0.4), 9.21060994002885102816E-01);
+check_double ("cos (0.7)", cos (0.7), 7.64842187284488495003E-01);
+check_double ("cos (-0.7)", cos (-0.7), 7.64842187284488495003E-01);
+check_double ("cos (0.8)", cos (0.8), 6.96706709347165387136E-01);
+check_double ("cos (-0.8)", cos (-0.8), 6.96706709347165387136E-01);
+check_double ("cos (3.0)", cos (3.0), -9.89992496600445415211E-01);
+check_double ("cos (-3.0)", cos (-3.0), -9.89992496600445415211E-01);
+check_double ("cos (4.0)", cos (4.0), -6.53643620863611940486E-01);
+check_double ("cos (-4.0)", cos (-4.0), -6.53643620863611940486E-01);
+check_double ("cos (6.0)", cos (6.0), 9.60170286650365967240E-01);
+check_double ("cos (-6.0)", cos (-6.0), 9.60170286650365967240E-01);
+check_double ("cos (7.0)", cos (7.0), 7.53902254343304600859E-01);
+check_double ("cos (-7.0)", cos (-7.0), 7.53902254343304600859E-01);
+check_double ("tan (0.0)", tan (0.0), 0.00000000000000000000E+00);
+check_double ("tan (-0.0)", tan (-0.0), -0.00000000000000000000E+00);
+check_double ("tan (1.0)", tan (1.0), 1.55740772465490229237E+00);
+check_double ("tan (-1.0)", tan (-1.0), -1.55740772465490229237E+00);
+check_double ("tan (INFINITY)", tan (INFINITY), -NAN);
+check_double ("tan (-INFINITY)", tan (-INFINITY), -NAN);
+check_double ("tan (NAN)", tan (NAN), NAN);
+check_double ("tan (M_PI)", tan (M_PI), -1.22464679914735320717E-16);
+check_double ("tan (-M_PI)", tan (-M_PI), 1.22464679914735320717E-16);
+check_double ("tan (2.0 * M_PI)", tan (2.0 * M_PI), -2.44929359829470641435E-16);
+check_double ("tan (-2.0 * M_PI)", tan (-2.0 * M_PI), 2.44929359829470641435E-16);
+check_double ("tan (M_PI / 2.0)", tan (M_PI / 2.0), 1.63312393531953700000E+16);
+check_double ("tan (-M_PI / 2.0)", tan (-M_PI / 2.0), -1.63312393531953700000E+16);
+check_double ("tan (M_PI / 3.0)", tan (M_PI / 3.0), 1.73205080756887674909E+00);
+check_double ("tan (-M_PI / 3.0)", tan (-M_PI / 3.0), -1.73205080756887674909E+00);
+check_double ("tan (M_PI / 4.0)", tan (M_PI / 4.0), 9.99999999999999888978E-01);
+check_double ("tan (-M_PI / 4.0)", tan (-M_PI / 4.0), -9.99999999999999888978E-01);
+check_double ("tan (M_PI / 6.0)", tan (M_PI / 6.0), 5.77350269189625731059E-01);
+check_double ("tan (-M_PI / 6.0)", tan (-M_PI / 6.0), -5.77350269189625731059E-01);
+check_double ("tan (M_PI * 2.0 / 3.0)", tan (M_PI * 2.0 / 3.0), -1.73205080756887830340E+00);
+check_double ("tan (-M_PI * 2.0 / 3.0)", tan (-M_PI * 2.0 / 3.0), 1.73205080756887830340E+00);
+check_double ("tan (M_PI * 5.0 / 6.0)", tan (M_PI * 5.0 / 6.0), -5.77350269189625731059E-01);
+check_double ("tan (-M_PI * 5.0 / 6.0)", tan (-M_PI * 5.0 / 6.0), 5.77350269189625731059E-01);
+check_double ("tan (3.7e-9)", tan (3.7e-9), 3.70000000000000004433E-09);
+check_double ("tan (-3.7e-9)", tan (-3.7e-9), -3.70000000000000004433E-09);
+check_double ("tan (3.8e-9)", tan (3.8e-9), 3.80000000000000011259E-09);
+check_double ("tan (-3.8e-9)", tan (-3.8e-9), -3.80000000000000011259E-09);
+check_double ("tan (0.6)", tan (0.6), 6.84136808341692326252E-01);
+check_double ("tan (-0.6)", tan (-0.6), -6.84136808341692326252E-01);
+check_double ("tan (0.7)", tan (0.7), 8.42288380463079411342E-01);
+check_double ("tan (-0.7)", tan (-0.7), -8.42288380463079411342E-01);
+check_double ("tan (3.0)", tan (3.0), -1.42546543074277803909E-01);
+check_double ("tan (-3.0)", tan (-3.0), 1.42546543074277803909E-01);
+check_double ("tan (4.0)", tan (4.0), 1.15782128234957748525E+00);
+check_double ("tan (-4.0)", tan (-4.0), -1.15782128234957748525E+00);
+check_double ("tan (6.0)", tan (6.0), -2.91006191384749146600E-01);
+check_double ("tan (-6.0)", tan (-6.0), 2.91006191384749146600E-01);
+check_double ("tan (7.0)", tan (7.0), 8.71447982724318781500E-01);
+check_double ("tan (-7.0)", tan (-7.0), -8.71447982724318781500E-01);
diff --git a/deps/jerry/third-party/valgrind/memcheck.h b/deps/jerry/third-party/valgrind/memcheck.h
new file mode 100644 (file)
index 0000000..68474b4
--- /dev/null
@@ -0,0 +1,287 @@
+
+/*
+   ----------------------------------------------------------------
+
+   Notice that the following BSD-style license applies to this one
+   file (memcheck.h) only.  The rest of Valgrind is licensed under the
+   terms of the GNU General Public License, version 2, unless
+   otherwise indicated.  See the COPYING file in the source
+   distribution for details.
+
+   ----------------------------------------------------------------
+
+   This file is part of MemCheck, a heavyweight Valgrind tool for
+   detecting memory errors.
+
+   Copyright (C) 2000-2011 Julian Seward.  All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. The origin of this software must not be misrepresented; you must 
+      not claim that you wrote the original software.  If you use this 
+      software in a product, an acknowledgment in the product 
+      documentation would be appreciated but is not required.
+
+   3. Altered source versions must be plainly marked as such, and must
+      not be misrepresented as being the original software.
+
+   4. The name of the author may not be used to endorse or promote 
+      products derived from this software without specific prior written 
+      permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+   ----------------------------------------------------------------
+
+   Notice that the above BSD-style license applies to this one file
+   (memcheck.h) only.  The entire rest of Valgrind is licensed under
+   the terms of the GNU General Public License, version 2.  See the
+   COPYING file in the source distribution for details.
+
+   ---------------------------------------------------------------- 
+*/
+
+
+#ifndef __MEMCHECK_H
+#define __MEMCHECK_H
+
+
+/* This file is for inclusion into client (your!) code.
+
+   You can use these macros to manipulate and query memory permissions
+   inside your own programs.
+
+   See comment near the top of valgrind.h on how to use them.
+*/
+
+#include "valgrind.h"
+
+/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! 
+   This enum comprises an ABI exported by Valgrind to programs
+   which use client requests.  DO NOT CHANGE THE ORDER OF THESE
+   ENTRIES, NOR DELETE ANY -- add new ones at the end. */
+typedef
+   enum { 
+      VG_USERREQ__MAKE_MEM_NOACCESS = VG_USERREQ_TOOL_BASE('M','C'),
+      VG_USERREQ__MAKE_MEM_UNDEFINED,
+      VG_USERREQ__MAKE_MEM_DEFINED,
+      VG_USERREQ__DISCARD,
+      VG_USERREQ__CHECK_MEM_IS_ADDRESSABLE,
+      VG_USERREQ__CHECK_MEM_IS_DEFINED,
+      VG_USERREQ__DO_LEAK_CHECK,
+      VG_USERREQ__COUNT_LEAKS,
+
+      VG_USERREQ__GET_VBITS,
+      VG_USERREQ__SET_VBITS,
+
+      VG_USERREQ__CREATE_BLOCK,
+
+      VG_USERREQ__MAKE_MEM_DEFINED_IF_ADDRESSABLE,
+
+      /* Not next to VG_USERREQ__COUNT_LEAKS because it was added later. */
+      VG_USERREQ__COUNT_LEAK_BLOCKS,
+
+      /* This is just for memcheck's internal use - don't use it */
+      _VG_USERREQ__MEMCHECK_RECORD_OVERLAP_ERROR 
+         = VG_USERREQ_TOOL_BASE('M','C') + 256
+   } Vg_MemCheckClientRequest;
+
+
+
+/* Client-code macros to manipulate the state of memory. */
+
+/* Mark memory at _qzz_addr as unaddressable for _qzz_len bytes. */
+#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len)           \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,      \
+                            VG_USERREQ__MAKE_MEM_NOACCESS,       \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+      
+/* Similarly, mark memory at _qzz_addr as addressable but undefined
+   for _qzz_len bytes. */
+#define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len)          \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,      \
+                            VG_USERREQ__MAKE_MEM_UNDEFINED,      \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Similarly, mark memory at _qzz_addr as addressable and defined
+   for _qzz_len bytes. */
+#define VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len)            \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,      \
+                            VG_USERREQ__MAKE_MEM_DEFINED,        \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Similar to VALGRIND_MAKE_MEM_DEFINED except that addressability is
+   not altered: bytes which are addressable are marked as defined,
+   but those which are not addressable are left unchanged. */
+#define VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(_qzz_addr,_qzz_len)     \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,              \
+                            VG_USERREQ__MAKE_MEM_DEFINED_IF_ADDRESSABLE, \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Create a block-description handle.  The description is an ascii
+   string which is included in any messages pertaining to addresses
+   within the specified memory range.  Has no other effect on the
+   properties of the memory range. */
+#define VALGRIND_CREATE_BLOCK(_qzz_addr,_qzz_len, _qzz_desc)      \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,        \
+                            VG_USERREQ__CREATE_BLOCK,              \
+                            (_qzz_addr), (_qzz_len), (_qzz_desc),  \
+                            0, 0)
+
+/* Discard a block-description-handle. Returns 1 for an
+   invalid handle, 0 for a valid handle. */
+#define VALGRIND_DISCARD(_qzz_blkindex)                          \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,      \
+                            VG_USERREQ__DISCARD,                 \
+                            0, (_qzz_blkindex), 0, 0, 0)
+
+
+/* Client-code macros to check the state of memory. */
+
+/* Check that memory at _qzz_addr is addressable for _qzz_len bytes.
+   If suitable addressibility is not established, Valgrind prints an
+   error message and returns the address of the first offending byte.
+   Otherwise it returns zero. */
+#define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len)      \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                             \
+                            VG_USERREQ__CHECK_MEM_IS_ADDRESSABLE,  \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Check that memory at _qzz_addr is addressable and defined for
+   _qzz_len bytes.  If suitable addressibility and definedness are not
+   established, Valgrind prints an error message and returns the
+   address of the first offending byte.  Otherwise it returns zero. */
+#define VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len)        \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                           \
+                            VG_USERREQ__CHECK_MEM_IS_DEFINED,    \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Use this macro to force the definedness and addressibility of an
+   lvalue to be checked.  If suitable addressibility and definedness
+   are not established, Valgrind prints an error message and returns
+   the address of the first offending byte.  Otherwise it returns
+   zero. */
+#define VALGRIND_CHECK_VALUE_IS_DEFINED(__lvalue)                \
+   VALGRIND_CHECK_MEM_IS_DEFINED(                                \
+      (volatile unsigned char *)&(__lvalue),                     \
+                      (unsigned long)(sizeof (__lvalue)))
+
+
+/* Do a full memory leak check (like --leak-check=full) mid-execution. */
+#define VALGRIND_DO_LEAK_CHECK                                   \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK,   \
+                                    0, 0, 0, 0, 0)
+
+/* Same as VALGRIND_DO_LEAK_CHECK but only showing the entries for
+   which there was an increase in leaked bytes or leaked nr of blocks
+   since the previous leak search. */
+#define VALGRIND_DO_ADDED_LEAK_CHECK                            \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK,  \
+                                    0, 1, 0, 0, 0)
+
+/* Same as VALGRIND_DO_ADDED_LEAK_CHECK but showing entries with
+   increased or decreased leaked bytes/blocks since previous leak
+   search. */
+#define VALGRIND_DO_CHANGED_LEAK_CHECK                          \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK,  \
+                                    0, 2, 0, 0, 0)
+
+/* Do a summary memory leak check (like --leak-check=summary) mid-execution. */
+#define VALGRIND_DO_QUICK_LEAK_CHECK                             \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK,   \
+                                    1, 0, 0, 0, 0)
+
+/* Return number of leaked, dubious, reachable and suppressed bytes found by
+   all previous leak checks.  They must be lvalues.  */
+#define VALGRIND_COUNT_LEAKS(leaked, dubious, reachable, suppressed)     \
+   /* For safety on 64-bit platforms we assign the results to private
+      unsigned long variables, then assign these to the lvalues the user
+      specified, which works no matter what type 'leaked', 'dubious', etc
+      are.  We also initialise '_qzz_leaked', etc because
+      VG_USERREQ__COUNT_LEAKS doesn't mark the values returned as
+      defined. */                                                        \
+   {                                                                     \
+    unsigned long _qzz_leaked    = 0, _qzz_dubious    = 0;               \
+    unsigned long _qzz_reachable = 0, _qzz_suppressed = 0;               \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(                                     \
+                               VG_USERREQ__COUNT_LEAKS,                  \
+                               &_qzz_leaked, &_qzz_dubious,              \
+                               &_qzz_reachable, &_qzz_suppressed, 0);    \
+    leaked     = _qzz_leaked;                                            \
+    dubious    = _qzz_dubious;                                           \
+    reachable  = _qzz_reachable;                                         \
+    suppressed = _qzz_suppressed;                                        \
+   }
+
+/* Return number of leaked, dubious, reachable and suppressed bytes found by
+   all previous leak checks.  They must be lvalues.  */
+#define VALGRIND_COUNT_LEAK_BLOCKS(leaked, dubious, reachable, suppressed) \
+   /* For safety on 64-bit platforms we assign the results to private
+      unsigned long variables, then assign these to the lvalues the user
+      specified, which works no matter what type 'leaked', 'dubious', etc
+      are.  We also initialise '_qzz_leaked', etc because
+      VG_USERREQ__COUNT_LEAKS doesn't mark the values returned as
+      defined. */                                                        \
+   {                                                                     \
+    unsigned long _qzz_leaked    = 0, _qzz_dubious    = 0;               \
+    unsigned long _qzz_reachable = 0, _qzz_suppressed = 0;               \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(                                     \
+                               VG_USERREQ__COUNT_LEAK_BLOCKS,            \
+                               &_qzz_leaked, &_qzz_dubious,              \
+                               &_qzz_reachable, &_qzz_suppressed, 0);    \
+    leaked     = _qzz_leaked;                                            \
+    dubious    = _qzz_dubious;                                           \
+    reachable  = _qzz_reachable;                                         \
+    suppressed = _qzz_suppressed;                                        \
+   }
+
+
+/* Get the validity data for addresses [zza..zza+zznbytes-1] and copy it
+   into the provided zzvbits array.  Return values:
+      0   if not running on valgrind
+      1   success
+      2   [previously indicated unaligned arrays;  these are now allowed]
+      3   if any parts of zzsrc/zzvbits are not addressable.
+   The metadata is not copied in cases 0, 2 or 3 so it should be
+   impossible to segfault your system by using this call.
+*/
+#define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes)                \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                \
+                                    VG_USERREQ__GET_VBITS,      \
+                                    (const char*)(zza),         \
+                                    (char*)(zzvbits),           \
+                                    (zznbytes), 0, 0)
+
+/* Set the validity data for addresses [zza..zza+zznbytes-1], copying it
+   from the provided zzvbits array.  Return values:
+      0   if not running on valgrind
+      1   success
+      2   [previously indicated unaligned arrays;  these are now allowed]
+      3   if any parts of zza/zzvbits are not addressable.
+   The metadata is not copied in cases 0, 2 or 3 so it should be
+   impossible to segfault your system by using this call.
+*/
+#define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes)                \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                \
+                                    VG_USERREQ__SET_VBITS,      \
+                                    (const char*)(zza),         \
+                                    (const char*)(zzvbits),     \
+                                    (zznbytes), 0, 0 )
+
+#endif
+
diff --git a/deps/jerry/third-party/valgrind/valgrind.h b/deps/jerry/third-party/valgrind/valgrind.h
new file mode 100644 (file)
index 0000000..222a58e
--- /dev/null
@@ -0,0 +1,4060 @@
+/* -*- c -*-
+   ----------------------------------------------------------------
+
+   Notice that the following BSD-style license applies to this one
+   file (valgrind.h) only.  The rest of Valgrind is licensed under the
+   terms of the GNU General Public License, version 2, unless
+   otherwise indicated.  See the COPYING file in the source
+   distribution for details.
+
+   ----------------------------------------------------------------
+
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2000-2011 Julian Seward.  All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. The origin of this software must not be misrepresented; you must 
+      not claim that you wrote the original software.  If you use this 
+      software in a product, an acknowledgment in the product 
+      documentation would be appreciated but is not required.
+
+   3. Altered source versions must be plainly marked as such, and must
+      not be misrepresented as being the original software.
+
+   4. The name of the author may not be used to endorse or promote 
+      products derived from this software without specific prior written 
+      permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+   ----------------------------------------------------------------
+
+   Notice that the above BSD-style license applies to this one file
+   (valgrind.h) only.  The entire rest of Valgrind is licensed under
+   the terms of the GNU General Public License, version 2.  See the
+   COPYING file in the source distribution for details.
+
+   ---------------------------------------------------------------- 
+*/
+
+
+/* This file is for inclusion into client (your!) code.
+
+   You can use these macros to manipulate and query Valgrind's 
+   execution inside your own programs.
+
+   The resulting executables will still run without Valgrind, just a
+   little bit more slowly than they otherwise would, but otherwise
+   unchanged.  When not running on valgrind, each client request
+   consumes very few (eg. 7) instructions, so the resulting performance
+   loss is negligible unless you plan to execute client requests
+   millions of times per second.  Nevertheless, if that is still a
+   problem, you can compile with the NVALGRIND symbol defined (gcc
+   -DNVALGRIND) so that client requests are not even compiled in.  */
+
+#ifndef __VALGRIND_H
+#define __VALGRIND_H
+
+
+/* ------------------------------------------------------------------ */
+/* VERSION NUMBER OF VALGRIND                                         */
+/* ------------------------------------------------------------------ */
+
+/* Specify Valgrind's version number, so that user code can
+   conditionally compile based on our version number.  Note that these
+   were introduced at version 3.6 and so do not exist in version 3.5
+   or earlier.  The recommended way to use them to check for "version
+   X.Y or later" is (eg)
+
+#if defined(__VALGRIND_MAJOR__) && defined(__VALGRIND_MINOR__)   \
+    && (__VALGRIND_MAJOR__ > 3                                   \
+        || (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6))
+*/
+#define __VALGRIND_MAJOR__    3
+#define __VALGRIND_MINOR__    6
+
+
+#include <stdarg.h>
+
+/* Nb: this file might be included in a file compiled with -ansi.  So
+   we can't use C++ style "//" comments nor the "asm" keyword (instead
+   use "__asm__"). */
+
+/* Derive some tags indicating what the target platform is.  Note
+   that in this file we're using the compiler's CPP symbols for
+   identifying architectures, which are different to the ones we use
+   within the rest of Valgrind.  Note, __powerpc__ is active for both
+   32 and 64-bit PPC, whereas __powerpc64__ is only active for the
+   latter (on Linux, that is).
+
+   Misc note: how to find out what's predefined in gcc by default:
+   gcc -Wp,-dM somefile.c
+*/
+#undef PLAT_x86_darwin
+#undef PLAT_amd64_darwin
+#undef PLAT_x86_win32
+#undef PLAT_x86_linux
+#undef PLAT_amd64_linux
+#undef PLAT_ppc32_linux
+#undef PLAT_ppc64_linux
+#undef PLAT_arm_linux
+#undef PLAT_s390x_linux
+
+
+#if defined(__APPLE__) && defined(__i386__)
+#  define PLAT_x86_darwin 1
+#elif defined(__APPLE__) && defined(__x86_64__)
+#  define PLAT_amd64_darwin 1
+#elif defined(__MINGW32__) || defined(__CYGWIN32__) \
+      || (defined(_WIN32) && defined(_M_IX86))
+#  define PLAT_x86_win32 1
+#elif defined(__linux__) && defined(__i386__)
+#  define PLAT_x86_linux 1
+#elif defined(__linux__) && defined(__x86_64__)
+#  define PLAT_amd64_linux 1
+#elif defined(__linux__) && defined(__powerpc__) && !defined(__powerpc64__)
+#  define PLAT_ppc32_linux 1
+#elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__)
+#  define PLAT_ppc64_linux 1
+#elif defined(__linux__) && defined(__arm__)
+#  define PLAT_arm_linux 1
+#elif defined(__linux__) && defined(__s390__) && defined(__s390x__)
+#  define PLAT_s390x_linux 1
+#else
+/* If we're not compiling for our target platform, don't generate
+   any inline asms.  */
+#  if !defined(NVALGRIND)
+#    define NVALGRIND 1
+#  endif
+#endif
+
+
+/* ------------------------------------------------------------------ */
+/* ARCHITECTURE SPECIFICS for SPECIAL INSTRUCTIONS.  There is nothing */
+/* in here of use to end-users -- skip to the next section.           */
+/* ------------------------------------------------------------------ */
+
+/*
+ * VALGRIND_DO_CLIENT_REQUEST(): a statement that invokes a Valgrind client
+ * request. Accepts both pointers and integers as arguments.
+ *
+ * VALGRIND_DO_CLIENT_REQUEST_STMT(): a statement that invokes a Valgrind
+ * client request that does not return a value.
+
+ * VALGRIND_DO_CLIENT_REQUEST_EXPR(): a C expression that invokes a Valgrind
+ * client request and whose value equals the client request result.  Accepts
+ * both pointers and integers as arguments.  Note that such calls are not
+ * necessarily pure functions -- they may have side effects.
+ */
+
+#define VALGRIND_DO_CLIENT_REQUEST(_zzq_rlval, _zzq_default,            \
+                                   _zzq_request, _zzq_arg1, _zzq_arg2,  \
+                                   _zzq_arg3, _zzq_arg4, _zzq_arg5)     \
+  do { (_zzq_rlval) = VALGRIND_DO_CLIENT_REQUEST_EXPR((_zzq_default),   \
+                        (_zzq_request), (_zzq_arg1), (_zzq_arg2),       \
+                        (_zzq_arg3), (_zzq_arg4), (_zzq_arg5)); } while (0)
+
+#define VALGRIND_DO_CLIENT_REQUEST_STMT(_zzq_request, _zzq_arg1,        \
+                           _zzq_arg2,  _zzq_arg3, _zzq_arg4, _zzq_arg5) \
+  do { (void) VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                        \
+                    (_zzq_request), (_zzq_arg1), (_zzq_arg2),           \
+                    (_zzq_arg3), (_zzq_arg4), (_zzq_arg5)); } while (0)
+
+#if defined(NVALGRIND)
+
+/* Define NVALGRIND to completely remove the Valgrind magic sequence
+   from the compiled code (analogous to NDEBUG's effects on
+   assert()) */
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+      (_zzq_default)
+
+#else  /* ! NVALGRIND */
+
+/* The following defines the magic code sequences which the JITter
+   spots and handles magically.  Don't look too closely at them as
+   they will rot your brain.
+
+   The assembly code sequences for all architectures is in this one
+   file.  This is because this file must be stand-alone, and we don't
+   want to have multiple files.
+
+   For VALGRIND_DO_CLIENT_REQUEST, we must ensure that the default
+   value gets put in the return slot, so that everything works when
+   this is executed not under Valgrind.  Args are passed in a memory
+   block, and so there's no intrinsic limit to the number that could
+   be passed, but it's currently five.
+   
+   The macro args are: 
+      _zzq_rlval    result lvalue
+      _zzq_default  default value (result returned when running on real CPU)
+      _zzq_request  request code
+      _zzq_arg1..5  request params
+
+   The other two macros are used to support function wrapping, and are
+   a lot simpler.  VALGRIND_GET_NR_CONTEXT returns the value of the
+   guest's NRADDR pseudo-register and whatever other information is
+   needed to safely run the call original from the wrapper: on
+   ppc64-linux, the R2 value at the divert point is also needed.  This
+   information is abstracted into a user-visible type, OrigFn.
+
+   VALGRIND_CALL_NOREDIR_* behaves the same as the following on the
+   guest, but guarantees that the branch instruction will not be
+   redirected: x86: call *%eax, amd64: call *%rax, ppc32/ppc64:
+   branch-and-link-to-r11.  VALGRIND_CALL_NOREDIR is just text, not a
+   complete inline asm, since it needs to be combined with more magic
+   inline asm stuff to be useful.
+*/
+
+/* ------------------------- x86-{linux,darwin} ---------------- */
+
+#if defined(PLAT_x86_linux)  ||  defined(PLAT_x86_darwin)  \
+    ||  (defined(PLAT_x86_win32) && defined(__GNUC__))
+
+typedef
+   struct { 
+      unsigned int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                     "roll $3,  %%edi ; roll $13, %%edi\n\t"      \
+                     "roll $29, %%edi ; roll $19, %%edi\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+  __extension__                                                   \
+  ({volatile unsigned int _zzq_args[6];                           \
+    volatile unsigned int _zzq_result;                            \
+    _zzq_args[0] = (unsigned int)(_zzq_request);                  \
+    _zzq_args[1] = (unsigned int)(_zzq_arg1);                     \
+    _zzq_args[2] = (unsigned int)(_zzq_arg2);                     \
+    _zzq_args[3] = (unsigned int)(_zzq_arg3);                     \
+    _zzq_args[4] = (unsigned int)(_zzq_arg4);                     \
+    _zzq_args[5] = (unsigned int)(_zzq_arg5);                     \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %EDX = client_request ( %EAX ) */         \
+                     "xchgl %%ebx,%%ebx"                          \
+                     : "=d" (_zzq_result)                         \
+                     : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
+                     : "cc", "memory"                             \
+                    );                                            \
+    _zzq_result;                                                  \
+  })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    volatile unsigned int __addr;                                 \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %EAX = guest_NRADDR */                    \
+                     "xchgl %%ecx,%%ecx"                          \
+                     : "=a" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory"                             \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_CALL_NOREDIR_EAX                                 \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* call-noredir *%EAX */                     \
+                     "xchgl %%edx,%%edx\n\t"
+#endif /* PLAT_x86_linux || PLAT_x86_darwin || (PLAT_x86_win32 && __GNUC__) */
+
+/* ------------------------- x86-Win32 ------------------------- */
+
+#if defined(PLAT_x86_win32) && !defined(__GNUC__)
+
+typedef
+   struct { 
+      unsigned int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#if defined(_MSC_VER)
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                     __asm rol edi, 3  __asm rol edi, 13          \
+                     __asm rol edi, 29 __asm rol edi, 19
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+    valgrind_do_client_request_expr((uintptr_t)(_zzq_default),    \
+        (uintptr_t)(_zzq_request), (uintptr_t)(_zzq_arg1),        \
+        (uintptr_t)(_zzq_arg2), (uintptr_t)(_zzq_arg3),           \
+        (uintptr_t)(_zzq_arg4), (uintptr_t)(_zzq_arg5))
+
+static __inline uintptr_t
+valgrind_do_client_request_expr(uintptr_t _zzq_default, uintptr_t _zzq_request,
+                                uintptr_t _zzq_arg1, uintptr_t _zzq_arg2,
+                                uintptr_t _zzq_arg3, uintptr_t _zzq_arg4,
+                                uintptr_t _zzq_arg5)
+{
+    volatile uintptr_t _zzq_args[6];
+    volatile unsigned int _zzq_result;
+    _zzq_args[0] = (uintptr_t)(_zzq_request);
+    _zzq_args[1] = (uintptr_t)(_zzq_arg1);
+    _zzq_args[2] = (uintptr_t)(_zzq_arg2);
+    _zzq_args[3] = (uintptr_t)(_zzq_arg3);
+    _zzq_args[4] = (uintptr_t)(_zzq_arg4);
+    _zzq_args[5] = (uintptr_t)(_zzq_arg5);
+    __asm { __asm lea eax, _zzq_args __asm mov edx, _zzq_default
+            __SPECIAL_INSTRUCTION_PREAMBLE
+            /* %EDX = client_request ( %EAX ) */
+            __asm xchg ebx,ebx
+            __asm mov _zzq_result, edx
+    }
+    return _zzq_result;
+}
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    volatile unsigned int __addr;                                 \
+    __asm { __SPECIAL_INSTRUCTION_PREAMBLE                        \
+            /* %EAX = guest_NRADDR */                             \
+            __asm xchg ecx,ecx                                    \
+            __asm mov __addr, eax                                 \
+    }                                                             \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_CALL_NOREDIR_EAX ERROR
+
+#else
+#error Unsupported compiler.
+#endif
+
+#endif /* PLAT_x86_win32 */
+
+/* ------------------------ amd64-{linux,darwin} --------------- */
+
+#if defined(PLAT_amd64_linux)  ||  defined(PLAT_amd64_darwin)
+
+typedef
+   struct { 
+      unsigned long long int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                     "rolq $3,  %%rdi ; rolq $13, %%rdi\n\t"      \
+                     "rolq $61, %%rdi ; rolq $51, %%rdi\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+    __extension__                                                 \
+    ({ volatile unsigned long long int _zzq_args[6];              \
+    volatile unsigned long long int _zzq_result;                  \
+    _zzq_args[0] = (unsigned long long int)(_zzq_request);        \
+    _zzq_args[1] = (unsigned long long int)(_zzq_arg1);           \
+    _zzq_args[2] = (unsigned long long int)(_zzq_arg2);           \
+    _zzq_args[3] = (unsigned long long int)(_zzq_arg3);           \
+    _zzq_args[4] = (unsigned long long int)(_zzq_arg4);           \
+    _zzq_args[5] = (unsigned long long int)(_zzq_arg5);           \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %RDX = client_request ( %RAX ) */         \
+                     "xchgq %%rbx,%%rbx"                          \
+                     : "=d" (_zzq_result)                         \
+                     : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
+                     : "cc", "memory"                             \
+                    );                                            \
+    _zzq_result;                                                  \
+    })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    volatile unsigned long long int __addr;                       \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %RAX = guest_NRADDR */                    \
+                     "xchgq %%rcx,%%rcx"                          \
+                     : "=a" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory"                             \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_CALL_NOREDIR_RAX                                 \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* call-noredir *%RAX */                     \
+                     "xchgq %%rdx,%%rdx\n\t"
+#endif /* PLAT_amd64_linux || PLAT_amd64_darwin */
+
+/* ------------------------ ppc32-linux ------------------------ */
+
+#if defined(PLAT_ppc32_linux)
+
+typedef
+   struct { 
+      unsigned int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                     "rlwinm 0,0,3,0,0  ; rlwinm 0,0,13,0,0\n\t"  \
+                     "rlwinm 0,0,29,0,0 ; rlwinm 0,0,19,0,0\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+                                                                  \
+    __extension__                                                 \
+  ({         unsigned int  _zzq_args[6];                          \
+             unsigned int  _zzq_result;                           \
+             unsigned int* _zzq_ptr;                              \
+    _zzq_args[0] = (unsigned int)(_zzq_request);                  \
+    _zzq_args[1] = (unsigned int)(_zzq_arg1);                     \
+    _zzq_args[2] = (unsigned int)(_zzq_arg2);                     \
+    _zzq_args[3] = (unsigned int)(_zzq_arg3);                     \
+    _zzq_args[4] = (unsigned int)(_zzq_arg4);                     \
+    _zzq_args[5] = (unsigned int)(_zzq_arg5);                     \
+    _zzq_ptr = _zzq_args;                                         \
+    __asm__ volatile("mr 3,%1\n\t" /*default*/                    \
+                     "mr 4,%2\n\t" /*ptr*/                        \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = client_request ( %R4 ) */           \
+                     "or 1,1,1\n\t"                               \
+                     "mr %0,3"     /*result*/                     \
+                     : "=b" (_zzq_result)                         \
+                     : "b" (_zzq_default), "b" (_zzq_ptr)         \
+                     : "cc", "memory", "r3", "r4");               \
+    _zzq_result;                                                  \
+    })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    unsigned int __addr;                                          \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = guest_NRADDR */                     \
+                     "or 2,2,2\n\t"                               \
+                     "mr %0,3"                                    \
+                     : "=b" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "r3"                       \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                   \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* branch-and-link-to-noredir *%R11 */       \
+                     "or 3,3,3\n\t"
+#endif /* PLAT_ppc32_linux */
+
+/* ------------------------ ppc64-linux ------------------------ */
+
+#if defined(PLAT_ppc64_linux)
+
+typedef
+   struct { 
+      unsigned long long int nraddr; /* where's the code? */
+      unsigned long long int r2;  /* what tocptr do we need? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                     "rotldi 0,0,3  ; rotldi 0,0,13\n\t"          \
+                     "rotldi 0,0,61 ; rotldi 0,0,51\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+                                                                  \
+  __extension__                                                   \
+  ({         unsigned long long int  _zzq_args[6];                \
+             unsigned long long int  _zzq_result;                 \
+             unsigned long long int* _zzq_ptr;                    \
+    _zzq_args[0] = (unsigned long long int)(_zzq_request);        \
+    _zzq_args[1] = (unsigned long long int)(_zzq_arg1);           \
+    _zzq_args[2] = (unsigned long long int)(_zzq_arg2);           \
+    _zzq_args[3] = (unsigned long long int)(_zzq_arg3);           \
+    _zzq_args[4] = (unsigned long long int)(_zzq_arg4);           \
+    _zzq_args[5] = (unsigned long long int)(_zzq_arg5);           \
+    _zzq_ptr = _zzq_args;                                         \
+    __asm__ volatile("mr 3,%1\n\t" /*default*/                    \
+                     "mr 4,%2\n\t" /*ptr*/                        \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = client_request ( %R4 ) */           \
+                     "or 1,1,1\n\t"                               \
+                     "mr %0,3"     /*result*/                     \
+                     : "=b" (_zzq_result)                         \
+                     : "b" (_zzq_default), "b" (_zzq_ptr)         \
+                     : "cc", "memory", "r3", "r4");               \
+    _zzq_result;                                                  \
+  })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    unsigned long long int __addr;                                \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = guest_NRADDR */                     \
+                     "or 2,2,2\n\t"                               \
+                     "mr %0,3"                                    \
+                     : "=b" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "r3"                       \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = guest_NRADDR_GPR2 */                \
+                     "or 4,4,4\n\t"                               \
+                     "mr %0,3"                                    \
+                     : "=b" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "r3"                       \
+                    );                                            \
+    _zzq_orig->r2 = __addr;                                       \
+  }
+
+#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                   \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* branch-and-link-to-noredir *%R11 */       \
+                     "or 3,3,3\n\t"
+
+#endif /* PLAT_ppc64_linux */
+
+/* ------------------------- arm-linux ------------------------- */
+
+#if defined(PLAT_arm_linux)
+
+typedef
+   struct { 
+      unsigned int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+            "mov r12, r12, ror #3  ; mov r12, r12, ror #13 \n\t"  \
+            "mov r12, r12, ror #29 ; mov r12, r12, ror #19 \n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+                                                                  \
+  __extension__                                                   \
+  ({volatile unsigned int  _zzq_args[6];                          \
+    volatile unsigned int  _zzq_result;                           \
+    _zzq_args[0] = (unsigned int)(_zzq_request);                  \
+    _zzq_args[1] = (unsigned int)(_zzq_arg1);                     \
+    _zzq_args[2] = (unsigned int)(_zzq_arg2);                     \
+    _zzq_args[3] = (unsigned int)(_zzq_arg3);                     \
+    _zzq_args[4] = (unsigned int)(_zzq_arg4);                     \
+    _zzq_args[5] = (unsigned int)(_zzq_arg5);                     \
+    __asm__ volatile("mov r3, %1\n\t" /*default*/                 \
+                     "mov r4, %2\n\t" /*ptr*/                     \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* R3 = client_request ( R4 ) */             \
+                     "orr r10, r10, r10\n\t"                      \
+                     "mov %0, r3"     /*result*/                  \
+                     : "=r" (_zzq_result)                         \
+                     : "r" (_zzq_default), "r" (&_zzq_args[0])    \
+                     : "cc","memory", "r3", "r4");                \
+    _zzq_result;                                                  \
+  })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    unsigned int __addr;                                          \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* R3 = guest_NRADDR */                      \
+                     "orr r11, r11, r11\n\t"                      \
+                     "mov %0, r3"                                 \
+                     : "=r" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "r3"                       \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                    \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* branch-and-link-to-noredir *%R4 */        \
+                     "orr r12, r12, r12\n\t"
+
+#endif /* PLAT_arm_linux */
+
+/* ------------------------ s390x-linux ------------------------ */
+
+#if defined(PLAT_s390x_linux)
+
+typedef
+  struct {
+     unsigned long long int nraddr; /* where's the code? */
+  }
+  OrigFn;
+
+/* __SPECIAL_INSTRUCTION_PREAMBLE will be used to identify Valgrind specific
+ * code. This detection is implemented in platform specific toIR.c
+ * (e.g. VEX/priv/guest_s390_decoder.c).
+ */
+#define __SPECIAL_INSTRUCTION_PREAMBLE                           \
+                     "lr 15,15\n\t"                              \
+                     "lr 1,1\n\t"                                \
+                     "lr 2,2\n\t"                                \
+                     "lr 3,3\n\t"
+
+#define __CLIENT_REQUEST_CODE "lr 2,2\n\t"
+#define __GET_NR_CONTEXT_CODE "lr 3,3\n\t"
+#define __CALL_NO_REDIR_CODE  "lr 4,4\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                         \
+       _zzq_default, _zzq_request,                               \
+       _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+  __extension__                                                  \
+ ({volatile unsigned long long int _zzq_args[6];                 \
+   volatile unsigned long long int _zzq_result;                  \
+   _zzq_args[0] = (unsigned long long int)(_zzq_request);        \
+   _zzq_args[1] = (unsigned long long int)(_zzq_arg1);           \
+   _zzq_args[2] = (unsigned long long int)(_zzq_arg2);           \
+   _zzq_args[3] = (unsigned long long int)(_zzq_arg3);           \
+   _zzq_args[4] = (unsigned long long int)(_zzq_arg4);           \
+   _zzq_args[5] = (unsigned long long int)(_zzq_arg5);           \
+   __asm__ volatile(/* r2 = args */                              \
+                    "lgr 2,%1\n\t"                               \
+                    /* r3 = default */                           \
+                    "lgr 3,%2\n\t"                               \
+                    __SPECIAL_INSTRUCTION_PREAMBLE               \
+                    __CLIENT_REQUEST_CODE                        \
+                    /* results = r3 */                           \
+                    "lgr %0, 3\n\t"                              \
+                    : "=d" (_zzq_result)                         \
+                    : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
+                    : "cc", "2", "3", "memory"                   \
+                   );                                            \
+   _zzq_result;                                                  \
+ })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                      \
+ { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+   volatile unsigned long long int __addr;                       \
+   __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                    __GET_NR_CONTEXT_CODE                        \
+                    "lgr %0, 3\n\t"                              \
+                    : "=a" (__addr)                              \
+                    :                                            \
+                    : "cc", "3", "memory"                        \
+                   );                                            \
+   _zzq_orig->nraddr = __addr;                                   \
+ }
+
+#define VALGRIND_CALL_NOREDIR_R1                                 \
+                    __SPECIAL_INSTRUCTION_PREAMBLE               \
+                    __CALL_NO_REDIR_CODE
+
+#endif /* PLAT_s390x_linux */
+
+/* Insert assembly code for other platforms here... */
+
+#endif /* NVALGRIND */
+
+
+/* ------------------------------------------------------------------ */
+/* PLATFORM SPECIFICS for FUNCTION WRAPPING.  This is all very        */
+/* ugly.  It's the least-worst tradeoff I can think of.               */
+/* ------------------------------------------------------------------ */
+
+/* This section defines magic (a.k.a appalling-hack) macros for doing
+   guaranteed-no-redirection macros, so as to get from function
+   wrappers to the functions they are wrapping.  The whole point is to
+   construct standard call sequences, but to do the call itself with a
+   special no-redirect call pseudo-instruction that the JIT
+   understands and handles specially.  This section is long and
+   repetitious, and I can't see a way to make it shorter.
+
+   The naming scheme is as follows:
+
+      CALL_FN_{W,v}_{v,W,WW,WWW,WWWW,5W,6W,7W,etc}
+
+   'W' stands for "word" and 'v' for "void".  Hence there are
+   different macros for calling arity 0, 1, 2, 3, 4, etc, functions,
+   and for each, the possibility of returning a word-typed result, or
+   no result.
+*/
+
+/* Use these to write the name of your wrapper.  NOTE: duplicates
+   VG_WRAP_FUNCTION_Z{U,Z} in pub_tool_redir.h.  NOTE also: inserts
+   the default behaviour equivalance class tag "0000" into the name.
+   See pub_tool_redir.h for details -- normally you don't need to
+   think about this, though. */
+
+/* Use an extra level of macroisation so as to ensure the soname/fnname
+   args are fully macro-expanded before pasting them together. */
+#define VG_CONCAT4(_aa,_bb,_cc,_dd) _aa##_bb##_cc##_dd
+
+#define I_WRAP_SONAME_FNNAME_ZU(soname,fnname)                    \
+   VG_CONCAT4(_vgw00000ZU_,soname,_,fnname)
+
+#define I_WRAP_SONAME_FNNAME_ZZ(soname,fnname)                    \
+   VG_CONCAT4(_vgw00000ZZ_,soname,_,fnname)
+
+/* Use this macro from within a wrapper function to collect the
+   context (address and possibly other info) of the original function.
+   Once you have that you can then use it in one of the CALL_FN_
+   macros.  The type of the argument _lval is OrigFn. */
+#define VALGRIND_GET_ORIG_FN(_lval)  VALGRIND_GET_NR_CONTEXT(_lval)
+
+/* Derivatives of the main macros below, for calling functions
+   returning void. */
+
+#define CALL_FN_v_v(fnptr)                                        \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_v(_junk,fnptr); } while (0)
+
+#define CALL_FN_v_W(fnptr, arg1)                                  \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_W(_junk,fnptr,arg1); } while (0)
+
+#define CALL_FN_v_WW(fnptr, arg1,arg2)                            \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_WW(_junk,fnptr,arg1,arg2); } while (0)
+
+#define CALL_FN_v_WWW(fnptr, arg1,arg2,arg3)                      \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_WWW(_junk,fnptr,arg1,arg2,arg3); } while (0)
+
+#define CALL_FN_v_WWWW(fnptr, arg1,arg2,arg3,arg4)                \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_WWWW(_junk,fnptr,arg1,arg2,arg3,arg4); } while (0)
+
+#define CALL_FN_v_5W(fnptr, arg1,arg2,arg3,arg4,arg5)             \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_5W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5); } while (0)
+
+#define CALL_FN_v_6W(fnptr, arg1,arg2,arg3,arg4,arg5,arg6)        \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_6W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5,arg6); } while (0)
+
+#define CALL_FN_v_7W(fnptr, arg1,arg2,arg3,arg4,arg5,arg6,arg7)   \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_7W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5,arg6,arg7); } while (0)
+
+/* ------------------------- x86-{linux,darwin} ---------------- */
+
+#if defined(PLAT_x86_linux)  ||  defined(PLAT_x86_darwin)
+
+/* These regs are trashed by the hidden call.  No need to mention eax
+   as gcc can already see that, plus causes gcc to bomb. */
+#define __CALLER_SAVED_REGS /*"eax"*/ "ecx", "edx"
+
+/* These CALL_FN_ macros assume that on x86-linux, sizeof(unsigned
+   long) == 4. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[1];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[2];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      __asm__ volatile(                                           \
+         "subl $12, %%esp\n\t"                                    \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $16, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      __asm__ volatile(                                           \
+         "subl $8, %%esp\n\t"                                     \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $16, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[4];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      __asm__ volatile(                                           \
+         "subl $4, %%esp\n\t"                                     \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $16, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[5];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      __asm__ volatile(                                           \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $16, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[6];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      __asm__ volatile(                                           \
+         "subl $12, %%esp\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $32, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[7];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      __asm__ volatile(                                           \
+         "subl $8, %%esp\n\t"                                     \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $32, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[8];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      __asm__ volatile(                                           \
+         "subl $4, %%esp\n\t"                                     \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $32, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[9];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      __asm__ volatile(                                           \
+         "pushl 32(%%eax)\n\t"                                    \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $32, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[10];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      __asm__ volatile(                                           \
+         "subl $12, %%esp\n\t"                                    \
+         "pushl 36(%%eax)\n\t"                                    \
+         "pushl 32(%%eax)\n\t"                                    \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $48, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[11];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      __asm__ volatile(                                           \
+         "subl $8, %%esp\n\t"                                     \
+         "pushl 40(%%eax)\n\t"                                    \
+         "pushl 36(%%eax)\n\t"                                    \
+         "pushl 32(%%eax)\n\t"                                    \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $48, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11)                          \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[12];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      __asm__ volatile(                                           \
+         "subl $4, %%esp\n\t"                                     \
+         "pushl 44(%%eax)\n\t"                                    \
+         "pushl 40(%%eax)\n\t"                                    \
+         "pushl 36(%%eax)\n\t"                                    \
+         "pushl 32(%%eax)\n\t"                                    \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $48, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11,arg12)                    \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[13];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      _argvec[12] = (unsigned long)(arg12);                       \
+      __asm__ volatile(                                           \
+         "pushl 48(%%eax)\n\t"                                    \
+         "pushl 44(%%eax)\n\t"                                    \
+         "pushl 40(%%eax)\n\t"                                    \
+         "pushl 36(%%eax)\n\t"                                    \
+         "pushl 32(%%eax)\n\t"                                    \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         "addl $48, %%esp\n"                                      \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_x86_linux || PLAT_x86_darwin */
+
+/* ------------------------ amd64-{linux,darwin} --------------- */
+
+#if defined(PLAT_amd64_linux)  ||  defined(PLAT_amd64_darwin)
+
+/* ARGREGS: rdi rsi rdx rcx r8 r9 (the rest on stack in R-to-L order) */
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS /*"rax",*/ "rcx", "rdx", "rsi",       \
+                            "rdi", "r8", "r9", "r10", "r11"
+
+/* This is all pretty complex.  It's so as to make stack unwinding
+   work reliably.  See bug 243270.  The basic problem is the sub and
+   add of 128 of %rsp in all of the following macros.  If gcc believes
+   the CFA is in %rsp, then unwinding may fail, because what's at the
+   CFA is not what gcc "expected" when it constructs the CFIs for the
+   places where the macros are instantiated.
+
+   But we can't just add a CFI annotation to increase the CFA offset
+   by 128, to match the sub of 128 from %rsp, because we don't know
+   whether gcc has chosen %rsp as the CFA at that point, or whether it
+   has chosen some other register (eg, %rbp).  In the latter case,
+   adding a CFI annotation to change the CFA offset is simply wrong.
+
+   So the solution is to get hold of the CFA using
+   __builtin_dwarf_cfa(), put it in a known register, and add a
+   CFI annotation to say what the register is.  We choose %rbp for
+   this (perhaps perversely), because:
+
+   (1) %rbp is already subject to unwinding.  If a new register was
+       chosen then the unwinder would have to unwind it in all stack
+       traces, which is expensive, and
+
+   (2) %rbp is already subject to precise exception updates in the
+       JIT.  If a new register was chosen, we'd have to have precise
+       exceptions for it too, which reduces performance of the
+       generated code.
+
+   However .. one extra complication.  We can't just whack the result
+   of __builtin_dwarf_cfa() into %rbp and then add %rbp to the
+   list of trashed registers at the end of the inline assembly
+   fragments; gcc won't allow %rbp to appear in that list.  Hence
+   instead we need to stash %rbp in %r15 for the duration of the asm,
+   and say that %r15 is trashed instead.  gcc seems happy to go with
+   that.
+
+   Oh .. and this all needs to be conditionalised so that it is
+   unchanged from before this commit, when compiled with older gccs
+   that don't support __builtin_dwarf_cfa.  Furthermore, since
+   this header file is freestanding, it has to be independent of
+   config.h, and so the following conditionalisation cannot depend on
+   configure time checks.
+
+   Although it's not clear from
+   'defined(__GNUC__) && defined(__GCC_HAVE_DWARF2_CFI_ASM)',
+   this expression excludes Darwin.
+   .cfi directives in Darwin assembly appear to be completely
+   different and I haven't investigated how they work.
+
+   For even more entertainment value, note we have to use the
+   completely undocumented __builtin_dwarf_cfa(), which appears to
+   really compute the CFA, whereas __builtin_frame_address(0) claims
+   to but actually doesn't.  See
+   https://bugs.kde.org/show_bug.cgi?id=243270#c47
+*/
+#if defined(__GNUC__) && defined(__GCC_HAVE_DWARF2_CFI_ASM)
+#  define __FRAME_POINTER                                         \
+      ,"r"(__builtin_dwarf_cfa())
+#  define VALGRIND_CFI_PROLOGUE                                   \
+      "movq %%rbp, %%r15\n\t"                                     \
+      "movq %2, %%rbp\n\t"                                        \
+      ".cfi_remember_state\n\t"                                   \
+      ".cfi_def_cfa rbp, 0\n\t"
+#  define VALGRIND_CFI_EPILOGUE                                   \
+      "movq %%r15, %%rbp\n\t"                                     \
+      ".cfi_restore_state\n\t"
+#else
+#  define __FRAME_POINTER
+#  define VALGRIND_CFI_PROLOGUE
+#  define VALGRIND_CFI_EPILOGUE
+#endif
+
+
+/* These CALL_FN_ macros assume that on amd64-linux, sizeof(unsigned
+   long) == 8. */
+
+/* NB 9 Sept 07.  There is a nasty kludge here in all these CALL_FN_
+   macros.  In order not to trash the stack redzone, we need to drop
+   %rsp by 128 before the hidden call, and restore afterwards.  The
+   nastyness is that it is only by luck that the stack still appears
+   to be unwindable during the hidden call - since then the behaviour
+   of any routine using this macro does not match what the CFI data
+   says.  Sigh.
+
+   Why is this important?  Imagine that a wrapper has a stack
+   allocated local, and passes to the hidden call, a pointer to it.
+   Because gcc does not know about the hidden call, it may allocate
+   that local in the redzone.  Unfortunately the hidden call may then
+   trash it before it comes to use it.  So we must step clear of the
+   redzone, for the duration of the hidden call, to make it safe.
+
+   Probably the same problem afflicts the other redzone-style ABIs too
+   (ppc64-linux); but for those, the stack is
+   self describing (none of this CFI nonsense) so at least messing
+   with the stack pointer doesn't give a danger of non-unwindable
+   stack. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[1];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $128,%%rsp\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $128,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[2];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $128,%%rsp\n\t"                                    \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $128,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $128,%%rsp\n\t"                                    \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $128,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[4];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $128,%%rsp\n\t"                                    \
+         "movq 24(%%rax), %%rdx\n\t"                              \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $128,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[5];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $128,%%rsp\n\t"                                    \
+         "movq 32(%%rax), %%rcx\n\t"                              \
+         "movq 24(%%rax), %%rdx\n\t"                              \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $128,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[6];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $128,%%rsp\n\t"                                    \
+         "movq 40(%%rax), %%r8\n\t"                               \
+         "movq 32(%%rax), %%rcx\n\t"                              \
+         "movq 24(%%rax), %%rdx\n\t"                              \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $128,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[7];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $128,%%rsp\n\t"                                    \
+         "movq 48(%%rax), %%r9\n\t"                               \
+         "movq 40(%%rax), %%r8\n\t"                               \
+         "movq 32(%%rax), %%rcx\n\t"                              \
+         "movq 24(%%rax), %%rdx\n\t"                              \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $128,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[8];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $136,%%rsp\n\t"                                    \
+         "pushq 56(%%rax)\n\t"                                    \
+         "movq 48(%%rax), %%r9\n\t"                               \
+         "movq 40(%%rax), %%r8\n\t"                               \
+         "movq 32(%%rax), %%rcx\n\t"                              \
+         "movq 24(%%rax), %%rdx\n\t"                              \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $8, %%rsp\n"                                       \
+         "addq $136,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[9];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $128,%%rsp\n\t"                                    \
+         "pushq 64(%%rax)\n\t"                                    \
+         "pushq 56(%%rax)\n\t"                                    \
+         "movq 48(%%rax), %%r9\n\t"                               \
+         "movq 40(%%rax), %%r8\n\t"                               \
+         "movq 32(%%rax), %%rcx\n\t"                              \
+         "movq 24(%%rax), %%rdx\n\t"                              \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $16, %%rsp\n"                                      \
+         "addq $128,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[10];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $136,%%rsp\n\t"                                    \
+         "pushq 72(%%rax)\n\t"                                    \
+         "pushq 64(%%rax)\n\t"                                    \
+         "pushq 56(%%rax)\n\t"                                    \
+         "movq 48(%%rax), %%r9\n\t"                               \
+         "movq 40(%%rax), %%r8\n\t"                               \
+         "movq 32(%%rax), %%rcx\n\t"                              \
+         "movq 24(%%rax), %%rdx\n\t"                              \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $24, %%rsp\n"                                      \
+         "addq $136,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[11];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $128,%%rsp\n\t"                                    \
+         "pushq 80(%%rax)\n\t"                                    \
+         "pushq 72(%%rax)\n\t"                                    \
+         "pushq 64(%%rax)\n\t"                                    \
+         "pushq 56(%%rax)\n\t"                                    \
+         "movq 48(%%rax), %%r9\n\t"                               \
+         "movq 40(%%rax), %%r8\n\t"                               \
+         "movq 32(%%rax), %%rcx\n\t"                              \
+         "movq 24(%%rax), %%rdx\n\t"                              \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $32, %%rsp\n"                                      \
+         "addq $128,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10,arg11)     \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[12];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $136,%%rsp\n\t"                                    \
+         "pushq 88(%%rax)\n\t"                                    \
+         "pushq 80(%%rax)\n\t"                                    \
+         "pushq 72(%%rax)\n\t"                                    \
+         "pushq 64(%%rax)\n\t"                                    \
+         "pushq 56(%%rax)\n\t"                                    \
+         "movq 48(%%rax), %%r9\n\t"                               \
+         "movq 40(%%rax), %%r8\n\t"                               \
+         "movq 32(%%rax), %%rcx\n\t"                              \
+         "movq 24(%%rax), %%rdx\n\t"                              \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $40, %%rsp\n"                                      \
+         "addq $136,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                arg7,arg8,arg9,arg10,arg11,arg12) \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[13];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      _argvec[12] = (unsigned long)(arg12);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_CFI_PROLOGUE                                    \
+         "subq $128,%%rsp\n\t"                                    \
+         "pushq 96(%%rax)\n\t"                                    \
+         "pushq 88(%%rax)\n\t"                                    \
+         "pushq 80(%%rax)\n\t"                                    \
+         "pushq 72(%%rax)\n\t"                                    \
+         "pushq 64(%%rax)\n\t"                                    \
+         "pushq 56(%%rax)\n\t"                                    \
+         "movq 48(%%rax), %%r9\n\t"                               \
+         "movq 40(%%rax), %%r8\n\t"                               \
+         "movq 32(%%rax), %%rcx\n\t"                              \
+         "movq 24(%%rax), %%rdx\n\t"                              \
+         "movq 16(%%rax), %%rsi\n\t"                              \
+         "movq 8(%%rax), %%rdi\n\t"                               \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */            \
+         VALGRIND_CALL_NOREDIR_RAX                                \
+         "addq $48, %%rsp\n"                                      \
+         "addq $128,%%rsp\n\t"                                    \
+         VALGRIND_CFI_EPILOGUE                                    \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r15"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_amd64_linux || PLAT_amd64_darwin */
+
+/* ------------------------ ppc32-linux ------------------------ */
+
+#if defined(PLAT_ppc32_linux)
+
+/* This is useful for finding out about the on-stack stuff:
+
+   extern int f9  ( int,int,int,int,int,int,int,int,int );
+   extern int f10 ( int,int,int,int,int,int,int,int,int,int );
+   extern int f11 ( int,int,int,int,int,int,int,int,int,int,int );
+   extern int f12 ( int,int,int,int,int,int,int,int,int,int,int,int );
+
+   int g9 ( void ) {
+      return f9(11,22,33,44,55,66,77,88,99);
+   }
+   int g10 ( void ) {
+      return f10(11,22,33,44,55,66,77,88,99,110);
+   }
+   int g11 ( void ) {
+      return f11(11,22,33,44,55,66,77,88,99,110,121);
+   }
+   int g12 ( void ) {
+      return f12(11,22,33,44,55,66,77,88,99,110,121,132);
+   }
+*/
+
+/* ARGREGS: r3 r4 r5 r6 r7 r8 r9 r10 (the rest on stack somewhere) */
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS                                       \
+   "lr", "ctr", "xer",                                            \
+   "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",        \
+   "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",   \
+   "r11", "r12", "r13"
+
+/* These CALL_FN_ macros assume that on ppc32-linux, 
+   sizeof(unsigned long) == 4. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[1];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[2];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[4];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[5];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[6];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[7];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[8];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[9];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      _argvec[8] = (unsigned long)arg8;                           \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 10,32(11)\n\t" /* arg8->r10 */                      \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[10];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      _argvec[8] = (unsigned long)arg8;                           \
+      _argvec[9] = (unsigned long)arg9;                           \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "addi 1,1,-16\n\t"                                       \
+         /* arg9 */                                               \
+         "lwz 3,36(11)\n\t"                                       \
+         "stw 3,8(1)\n\t"                                         \
+         /* args1-8 */                                            \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 10,32(11)\n\t" /* arg8->r10 */                      \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "addi 1,1,16\n\t"                                        \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[11];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      _argvec[8] = (unsigned long)arg8;                           \
+      _argvec[9] = (unsigned long)arg9;                           \
+      _argvec[10] = (unsigned long)arg10;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "addi 1,1,-16\n\t"                                       \
+         /* arg10 */                                              \
+         "lwz 3,40(11)\n\t"                                       \
+         "stw 3,12(1)\n\t"                                        \
+         /* arg9 */                                               \
+         "lwz 3,36(11)\n\t"                                       \
+         "stw 3,8(1)\n\t"                                         \
+         /* args1-8 */                                            \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 10,32(11)\n\t" /* arg8->r10 */                      \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "addi 1,1,16\n\t"                                        \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10,arg11)     \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[12];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      _argvec[8] = (unsigned long)arg8;                           \
+      _argvec[9] = (unsigned long)arg9;                           \
+      _argvec[10] = (unsigned long)arg10;                         \
+      _argvec[11] = (unsigned long)arg11;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "addi 1,1,-32\n\t"                                       \
+         /* arg11 */                                              \
+         "lwz 3,44(11)\n\t"                                       \
+         "stw 3,16(1)\n\t"                                        \
+         /* arg10 */                                              \
+         "lwz 3,40(11)\n\t"                                       \
+         "stw 3,12(1)\n\t"                                        \
+         /* arg9 */                                               \
+         "lwz 3,36(11)\n\t"                                       \
+         "stw 3,8(1)\n\t"                                         \
+         /* args1-8 */                                            \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 10,32(11)\n\t" /* arg8->r10 */                      \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "addi 1,1,32\n\t"                                        \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                arg7,arg8,arg9,arg10,arg11,arg12) \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[13];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      _argvec[8] = (unsigned long)arg8;                           \
+      _argvec[9] = (unsigned long)arg9;                           \
+      _argvec[10] = (unsigned long)arg10;                         \
+      _argvec[11] = (unsigned long)arg11;                         \
+      _argvec[12] = (unsigned long)arg12;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "addi 1,1,-32\n\t"                                       \
+         /* arg12 */                                              \
+         "lwz 3,48(11)\n\t"                                       \
+         "stw 3,20(1)\n\t"                                        \
+         /* arg11 */                                              \
+         "lwz 3,44(11)\n\t"                                       \
+         "stw 3,16(1)\n\t"                                        \
+         /* arg10 */                                              \
+         "lwz 3,40(11)\n\t"                                       \
+         "stw 3,12(1)\n\t"                                        \
+         /* arg9 */                                               \
+         "lwz 3,36(11)\n\t"                                       \
+         "stw 3,8(1)\n\t"                                         \
+         /* args1-8 */                                            \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 10,32(11)\n\t" /* arg8->r10 */                      \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "addi 1,1,32\n\t"                                        \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_ppc32_linux */
+
+/* ------------------------ ppc64-linux ------------------------ */
+
+#if defined(PLAT_ppc64_linux)
+
+/* ARGREGS: r3 r4 r5 r6 r7 r8 r9 r10 (the rest on stack somewhere) */
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS                                       \
+   "lr", "ctr", "xer",                                            \
+   "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",        \
+   "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",   \
+   "r11", "r12", "r13"
+
+/* These CALL_FN_ macros assume that on ppc64-linux, sizeof(unsigned
+   long) == 8. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+0];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1] = (unsigned long)_orig.r2;                       \
+      _argvec[2] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)" /* restore tocptr */                      \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+1];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)" /* restore tocptr */                      \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+2];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)" /* restore tocptr */                      \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+3];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)" /* restore tocptr */                      \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+4];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)" /* restore tocptr */                      \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+5];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)" /* restore tocptr */                      \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+6];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)" /* restore tocptr */                      \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+7];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)" /* restore tocptr */                      \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+8];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)" /* restore tocptr */                      \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+9];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-128\n\t"  /* expand stack frame */            \
+         /* arg9 */                                               \
+         "ld  3,72(11)\n\t"                                       \
+         "std 3,112(1)\n\t"                                       \
+         /* args1-8 */                                            \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         "addi 1,1,128"     /* restore frame */                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+10];                       \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      _argvec[2+10] = (unsigned long)arg10;                       \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-128\n\t"  /* expand stack frame */            \
+         /* arg10 */                                              \
+         "ld  3,80(11)\n\t"                                       \
+         "std 3,120(1)\n\t"                                       \
+         /* arg9 */                                               \
+         "ld  3,72(11)\n\t"                                       \
+         "std 3,112(1)\n\t"                                       \
+         /* args1-8 */                                            \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         "addi 1,1,128"     /* restore frame */                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10,arg11)     \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+11];                       \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      _argvec[2+10] = (unsigned long)arg10;                       \
+      _argvec[2+11] = (unsigned long)arg11;                       \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-144\n\t"  /* expand stack frame */            \
+         /* arg11 */                                              \
+         "ld  3,88(11)\n\t"                                       \
+         "std 3,128(1)\n\t"                                       \
+         /* arg10 */                                              \
+         "ld  3,80(11)\n\t"                                       \
+         "std 3,120(1)\n\t"                                       \
+         /* arg9 */                                               \
+         "ld  3,72(11)\n\t"                                       \
+         "std 3,112(1)\n\t"                                       \
+         /* args1-8 */                                            \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         "addi 1,1,144"     /* restore frame */                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                arg7,arg8,arg9,arg10,arg11,arg12) \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+12];                       \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      _argvec[2+10] = (unsigned long)arg10;                       \
+      _argvec[2+11] = (unsigned long)arg11;                       \
+      _argvec[2+12] = (unsigned long)arg12;                       \
+      __asm__ volatile(                                           \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-144\n\t"  /* expand stack frame */            \
+         /* arg12 */                                              \
+         "ld  3,96(11)\n\t"                                       \
+         "std 3,136(1)\n\t"                                       \
+         /* arg11 */                                              \
+         "ld  3,88(11)\n\t"                                       \
+         "std 3,128(1)\n\t"                                       \
+         /* arg10 */                                              \
+         "ld  3,80(11)\n\t"                                       \
+         "std 3,120(1)\n\t"                                       \
+         /* arg9 */                                               \
+         "ld  3,72(11)\n\t"                                       \
+         "std 3,112(1)\n\t"                                       \
+         /* args1-8 */                                            \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         "addi 1,1,144"     /* restore frame */                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_ppc64_linux */
+
+/* ------------------------- arm-linux ------------------------- */
+
+#if defined(PLAT_arm_linux)
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS "r0", "r1", "r2", "r3","r4","r14"
+
+/* These CALL_FN_ macros assume that on arm-linux, sizeof(unsigned
+   long) == 4. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[1];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "mov %0, r0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[2];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "mov %0, r0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory",  __CALLER_SAVED_REGS         \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "mov %0, r0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[4];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "mov %0, r0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[5];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[6];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "push {r0} \n\t"                                         \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "add sp, sp, #4 \n\t"                                    \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[7];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "push {r0, r1} \n\t"                                     \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "add sp, sp, #8 \n\t"                                    \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[8];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "push {r0, r1, r2} \n\t"                                 \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "add sp, sp, #12 \n\t"                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[9];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "ldr r3, [%1, #32] \n\t"                                 \
+         "push {r0, r1, r2, r3} \n\t"                             \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "add sp, sp, #16 \n\t"                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[10];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "ldr r3, [%1, #32] \n\t"                                 \
+         "ldr r4, [%1, #36] \n\t"                                 \
+         "push {r0, r1, r2, r3, r4} \n\t"                         \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "add sp, sp, #20 \n\t"                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[11];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #40] \n\t"                                 \
+         "push {r0} \n\t"                                         \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "ldr r3, [%1, #32] \n\t"                                 \
+         "ldr r4, [%1, #36] \n\t"                                 \
+         "push {r0, r1, r2, r3, r4} \n\t"                         \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "add sp, sp, #24 \n\t"                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11)                          \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[12];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #40] \n\t"                                 \
+         "ldr r1, [%1, #44] \n\t"                                 \
+         "push {r0, r1} \n\t"                                     \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "ldr r3, [%1, #32] \n\t"                                 \
+         "ldr r4, [%1, #36] \n\t"                                 \
+         "push {r0, r1, r2, r3, r4} \n\t"                         \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "add sp, sp, #28 \n\t"                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory",__CALLER_SAVED_REGS           \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11,arg12)                    \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[13];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      _argvec[12] = (unsigned long)(arg12);                       \
+      __asm__ volatile(                                           \
+         "ldr r0, [%1, #40] \n\t"                                 \
+         "ldr r1, [%1, #44] \n\t"                                 \
+         "ldr r2, [%1, #48] \n\t"                                 \
+         "push {r0, r1, r2} \n\t"                                 \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "ldr r3, [%1, #32] \n\t"                                 \
+         "ldr r4, [%1, #36] \n\t"                                 \
+         "push {r0, r1, r2, r3, r4} \n\t"                         \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         "add sp, sp, #32 \n\t"                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_arm_linux */
+
+/* ------------------------- s390x-linux ------------------------- */
+
+#if defined(PLAT_s390x_linux)
+
+/* Similar workaround as amd64 (see above), but we use r11 as frame
+   pointer and save the old r11 in r7. r11 might be used for
+   argvec, therefore we copy argvec in r1 since r1 is clobbered
+   after the call anyway.  */
+#if defined(__GNUC__) && defined(__GCC_HAVE_DWARF2_CFI_ASM)
+#  define __FRAME_POINTER                                         \
+      ,"d"(__builtin_dwarf_cfa())
+#  define VALGRIND_CFI_PROLOGUE                                   \
+      ".cfi_remember_state\n\t"                                   \
+      "lgr 1,%1\n\t" /* copy the argvec pointer in r1 */          \
+      "lgr 7,11\n\t"                                              \
+      "lgr 11,%2\n\t"                                             \
+      ".cfi_def_cfa r11, 0\n\t"
+#  define VALGRIND_CFI_EPILOGUE                                   \
+      "lgr 11, 7\n\t"                                             \
+      ".cfi_restore_state\n\t"
+#else
+#  define __FRAME_POINTER
+#  define VALGRIND_CFI_PROLOGUE                                   \
+      "lgr 1,%1\n\t"
+#  define VALGRIND_CFI_EPILOGUE
+#endif
+
+
+
+
+/* These regs are trashed by the hidden call. Note that we overwrite
+   r14 in s390_irgen_noredir (VEX/priv/guest_s390_irgen.c) to give the
+   function a proper return address. All others are ABI defined call
+   clobbers. */
+#define __CALLER_SAVED_REGS "0","1","2","3","4","5","14", \
+                           "f0","f1","f2","f3","f4","f5","f6","f7"
+
+
+#define CALL_FN_W_v(lval, orig)                                  \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long  _argvec[1];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 1, 0(1)\n\t"  /* target->r1 */                      \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "d" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+/* The call abi has the arguments in r2-r6 and stack */
+#define CALL_FN_W_W(lval, orig, arg1)                            \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[2];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1, arg2)                     \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[3];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1, arg2, arg3)              \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[4];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1, arg2, arg3, arg4)       \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[5];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1, arg2, arg3, arg4, arg5)   \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[6];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6)                                       \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[7];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-168\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,168\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6, arg7)                                 \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[8];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-176\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,176\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6, arg7 ,arg8)                           \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[9];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-184\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,184\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6, arg7 ,arg8, arg9)                     \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[10];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-192\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,192\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1, arg2, arg3, arg4, arg5,  \
+                     arg6, arg7 ,arg8, arg9, arg10)              \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[11];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      _argvec[10] = (unsigned long)arg10;                        \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-200\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "mvc 192(8,15), 80(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,200\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1, arg2, arg3, arg4, arg5,  \
+                     arg6, arg7 ,arg8, arg9, arg10, arg11)       \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[12];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      _argvec[10] = (unsigned long)arg10;                        \
+      _argvec[11] = (unsigned long)arg11;                        \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-208\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "mvc 192(8,15), 80(1)\n\t"                              \
+         "mvc 200(8,15), 88(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,208\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1, arg2, arg3, arg4, arg5,  \
+                     arg6, arg7 ,arg8, arg9, arg10, arg11, arg12)\
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[13];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      _argvec[10] = (unsigned long)arg10;                        \
+      _argvec[11] = (unsigned long)arg11;                        \
+      _argvec[12] = (unsigned long)arg12;                        \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-216\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "mvc 192(8,15), 80(1)\n\t"                              \
+         "mvc 200(8,15), 88(1)\n\t"                              \
+         "mvc 208(8,15), 96(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,216\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+
+#endif /* PLAT_s390x_linux */
+
+
+/* ------------------------------------------------------------------ */
+/* ARCHITECTURE INDEPENDENT MACROS for CLIENT REQUESTS.               */
+/*                                                                    */
+/* ------------------------------------------------------------------ */
+
+/* Some request codes.  There are many more of these, but most are not
+   exposed to end-user view.  These are the public ones, all of the
+   form 0x1000 + small_number.
+
+   Core ones are in the range 0x00000000--0x0000ffff.  The non-public
+   ones start at 0x2000.
+*/
+
+/* These macros are used by tools -- they must be public, but don't
+   embed them into other programs. */
+#define VG_USERREQ_TOOL_BASE(a,b) \
+   ((unsigned int)(((a)&0xff) << 24 | ((b)&0xff) << 16))
+#define VG_IS_TOOL_USERREQ(a, b, v) \
+   (VG_USERREQ_TOOL_BASE(a,b) == ((v) & 0xffff0000))
+
+/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! 
+   This enum comprises an ABI exported by Valgrind to programs
+   which use client requests.  DO NOT CHANGE THE ORDER OF THESE
+   ENTRIES, NOR DELETE ANY -- add new ones at the end. */
+typedef
+   enum { VG_USERREQ__RUNNING_ON_VALGRIND  = 0x1001,
+          VG_USERREQ__DISCARD_TRANSLATIONS = 0x1002,
+
+          /* These allow any function to be called from the simulated
+             CPU but run on the real CPU.  Nb: the first arg passed to
+             the function is always the ThreadId of the running
+             thread!  So CLIENT_CALL0 actually requires a 1 arg
+             function, etc. */
+          VG_USERREQ__CLIENT_CALL0 = 0x1101,
+          VG_USERREQ__CLIENT_CALL1 = 0x1102,
+          VG_USERREQ__CLIENT_CALL2 = 0x1103,
+          VG_USERREQ__CLIENT_CALL3 = 0x1104,
+
+          /* Can be useful in regression testing suites -- eg. can
+             send Valgrind's output to /dev/null and still count
+             errors. */
+          VG_USERREQ__COUNT_ERRORS = 0x1201,
+
+          /* Allows a string (gdb monitor command) to be passed to the tool
+             Used for interaction with vgdb/gdb */
+          VG_USERREQ__GDB_MONITOR_COMMAND = 0x1202,
+
+          /* These are useful and can be interpreted by any tool that
+             tracks malloc() et al, by using vg_replace_malloc.c. */
+          VG_USERREQ__MALLOCLIKE_BLOCK = 0x1301,
+          VG_USERREQ__RESIZEINPLACE_BLOCK = 0x130b,
+          VG_USERREQ__FREELIKE_BLOCK   = 0x1302,
+          /* Memory pool support. */
+          VG_USERREQ__CREATE_MEMPOOL   = 0x1303,
+          VG_USERREQ__DESTROY_MEMPOOL  = 0x1304,
+          VG_USERREQ__MEMPOOL_ALLOC    = 0x1305,
+          VG_USERREQ__MEMPOOL_FREE     = 0x1306,
+          VG_USERREQ__MEMPOOL_TRIM     = 0x1307,
+          VG_USERREQ__MOVE_MEMPOOL     = 0x1308,
+          VG_USERREQ__MEMPOOL_CHANGE   = 0x1309,
+          VG_USERREQ__MEMPOOL_EXISTS   = 0x130a,
+
+          /* Allow printfs to valgrind log. */
+          /* The first two pass the va_list argument by value, which
+             assumes it is the same size as or smaller than a UWord,
+             which generally isn't the case.  Hence are deprecated.
+             The second two pass the vargs by reference and so are
+             immune to this problem. */
+          /* both :: char* fmt, va_list vargs (DEPRECATED) */
+          VG_USERREQ__PRINTF           = 0x1401,
+          VG_USERREQ__PRINTF_BACKTRACE = 0x1402,
+          /* both :: char* fmt, va_list* vargs */
+          VG_USERREQ__PRINTF_VALIST_BY_REF = 0x1403,
+          VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF = 0x1404,
+
+          /* Stack support. */
+          VG_USERREQ__STACK_REGISTER   = 0x1501,
+          VG_USERREQ__STACK_DEREGISTER = 0x1502,
+          VG_USERREQ__STACK_CHANGE     = 0x1503,
+
+          /* Wine support */
+          VG_USERREQ__LOAD_PDB_DEBUGINFO = 0x1601,
+
+          /* Querying of debug info. */
+          VG_USERREQ__MAP_IP_TO_SRCLOC = 0x1701,
+
+          /* Disable/enable error reporting level.  Takes a single
+             Word arg which is the delta to this thread's error
+             disablement indicator.  Hence 1 disables or further
+             disables errors, and -1 moves back towards enablement.
+             Other values are not allowed. */
+          VG_USERREQ__CHANGE_ERR_DISABLEMENT = 0x1801
+   } Vg_ClientRequest;
+
+#if !defined(__GNUC__)
+#  define __extension__ /* */
+#endif
+
+
+/* Returns the number of Valgrinds this code is running under.  That
+   is, 0 if running natively, 1 if running under Valgrind, 2 if
+   running under Valgrind which is running under another Valgrind,
+   etc. */
+#define RUNNING_ON_VALGRIND                                           \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */,         \
+                                    VG_USERREQ__RUNNING_ON_VALGRIND,  \
+                                    0, 0, 0, 0, 0)                    \
+
+
+/* Discard translation of code in the range [_qzz_addr .. _qzz_addr +
+   _qzz_len - 1].  Useful if you are debugging a JITter or some such,
+   since it provides a way to make sure valgrind will retranslate the
+   invalidated area.  Returns no value. */
+#define VALGRIND_DISCARD_TRANSLATIONS(_qzz_addr,_qzz_len)              \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DISCARD_TRANSLATIONS,  \
+                                    _qzz_addr, _qzz_len, 0, 0, 0)
+
+
+/* These requests are for getting Valgrind itself to print something.
+   Possibly with a backtrace.  This is a really ugly hack.  The return value
+   is the number of characters printed, excluding the "**<pid>** " part at the
+   start and the backtrace (if present). */
+
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
+/* Modern GCC will optimize the static routine out if unused,
+   and unused attribute will shut down warnings about it.  */
+static int VALGRIND_PRINTF(const char *format, ...)
+   __attribute__((format(__printf__, 1, 2), __unused__));
+#endif
+static int
+#if defined(_MSC_VER)
+__inline
+#endif
+VALGRIND_PRINTF(const char *format, ...)
+{
+#if defined(NVALGRIND)
+   return 0;
+#else /* NVALGRIND */
+#if defined(_MSC_VER)
+   uintptr_t _qzz_res;
+#else
+   unsigned long _qzz_res;
+#endif
+   va_list vargs;
+   va_start(vargs, format);
+#if defined(_MSC_VER)
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
+                              VG_USERREQ__PRINTF_VALIST_BY_REF,
+                              (uintptr_t)format,
+                              (uintptr_t)&vargs,
+                              0, 0, 0);
+#else
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
+                              VG_USERREQ__PRINTF_VALIST_BY_REF,
+                              (unsigned long)format,
+                              (unsigned long)&vargs, 
+                              0, 0, 0);
+#endif
+   va_end(vargs);
+   return (int)_qzz_res;
+#endif /* NVALGRIND */
+}
+
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
+static int VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
+   __attribute__((format(__printf__, 1, 2), __unused__));
+#endif
+static int
+#if defined(_MSC_VER)
+__inline
+#endif
+VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
+{
+#if defined(NVALGRIND)
+   return 0;
+#else /* NVALGRIND */
+#if defined(_MSC_VER)
+   uintptr_t _qzz_res;
+#else
+   unsigned long _qzz_res;
+#endif
+   va_list vargs;
+   va_start(vargs, format);
+#if defined(_MSC_VER)
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
+                              VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF,
+                              (uintptr_t)format,
+                              (uintptr_t)&vargs,
+                              0, 0, 0);
+#else
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
+                              VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF,
+                              (unsigned long)format,
+                              (unsigned long)&vargs, 
+                              0, 0, 0);
+#endif
+   va_end(vargs);
+   return (int)_qzz_res;
+#endif /* NVALGRIND */
+}
+
+
+/* These requests allow control to move from the simulated CPU to the
+   real CPU, calling an arbitary function.
+   
+   Note that the current ThreadId is inserted as the first argument.
+   So this call:
+
+     VALGRIND_NON_SIMD_CALL2(f, arg1, arg2)
+
+   requires f to have this signature:
+
+     Word f(Word tid, Word arg1, Word arg2)
+
+   where "Word" is a word-sized type.
+
+   Note that these client requests are not entirely reliable.  For example,
+   if you call a function with them that subsequently calls printf(),
+   there's a high chance Valgrind will crash.  Generally, your prospects of
+   these working are made higher if the called function does not refer to
+   any global variables, and does not refer to any libc or other functions
+   (printf et al).  Any kind of entanglement with libc or dynamic linking is
+   likely to have a bad outcome, for tricky reasons which we've grappled
+   with a lot in the past.
+*/
+#define VALGRIND_NON_SIMD_CALL0(_qyy_fn)                          \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,       \
+                                    VG_USERREQ__CLIENT_CALL0,     \
+                                    _qyy_fn,                      \
+                                    0, 0, 0, 0)
+
+#define VALGRIND_NON_SIMD_CALL1(_qyy_fn, _qyy_arg1)                    \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,            \
+                                    VG_USERREQ__CLIENT_CALL1,          \
+                                    _qyy_fn,                           \
+                                    _qyy_arg1, 0, 0, 0)
+
+#define VALGRIND_NON_SIMD_CALL2(_qyy_fn, _qyy_arg1, _qyy_arg2)         \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,            \
+                                    VG_USERREQ__CLIENT_CALL2,          \
+                                    _qyy_fn,                           \
+                                    _qyy_arg1, _qyy_arg2, 0, 0)
+
+#define VALGRIND_NON_SIMD_CALL3(_qyy_fn, _qyy_arg1, _qyy_arg2, _qyy_arg3) \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,             \
+                                    VG_USERREQ__CLIENT_CALL3,           \
+                                    _qyy_fn,                            \
+                                    _qyy_arg1, _qyy_arg2,               \
+                                    _qyy_arg3, 0)
+
+
+/* Counts the number of errors that have been recorded by a tool.  Nb:
+   the tool must record the errors with VG_(maybe_record_error)() or
+   VG_(unique_error)() for them to be counted. */
+#define VALGRIND_COUNT_ERRORS                                     \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(                    \
+                               0 /* default return */,            \
+                               VG_USERREQ__COUNT_ERRORS,          \
+                               0, 0, 0, 0, 0)
+
+/* Several Valgrind tools (Memcheck, Massif, Helgrind, DRD) rely on knowing
+   when heap blocks are allocated in order to give accurate results.  This
+   happens automatically for the standard allocator functions such as
+   malloc(), calloc(), realloc(), memalign(), new, new[], free(), delete,
+   delete[], etc.
+
+   But if your program uses a custom allocator, this doesn't automatically
+   happen, and Valgrind will not do as well.  For example, if you allocate
+   superblocks with mmap() and then allocates chunks of the superblocks, all
+   Valgrind's observations will be at the mmap() level and it won't know that
+   the chunks should be considered separate entities.  In Memcheck's case,
+   that means you probably won't get heap block overrun detection (because
+   there won't be redzones marked as unaddressable) and you definitely won't
+   get any leak detection.
+
+   The following client requests allow a custom allocator to be annotated so
+   that it can be handled accurately by Valgrind.
+
+   VALGRIND_MALLOCLIKE_BLOCK marks a region of memory as having been allocated
+   by a malloc()-like function.  For Memcheck (an illustrative case), this
+   does two things:
+
+   - It records that the block has been allocated.  This means any addresses
+     within the block mentioned in error messages will be
+     identified as belonging to the block.  It also means that if the block
+     isn't freed it will be detected by the leak checker.
+
+   - It marks the block as being addressable and undefined (if 'is_zeroed' is
+     not set), or addressable and defined (if 'is_zeroed' is set).  This
+     controls how accesses to the block by the program are handled.
+   
+   'addr' is the start of the usable block (ie. after any
+   redzone), 'sizeB' is its size.  'rzB' is the redzone size if the allocator
+   can apply redzones -- these are blocks of padding at the start and end of
+   each block.  Adding redzones is recommended as it makes it much more likely
+   Valgrind will spot block overruns.  `is_zeroed' indicates if the memory is
+   zeroed (or filled with another predictable value), as is the case for
+   calloc().
+   
+   VALGRIND_MALLOCLIKE_BLOCK should be put immediately after the point where a
+   heap block -- that will be used by the client program -- is allocated.
+   It's best to put it at the outermost level of the allocator if possible;
+   for example, if you have a function my_alloc() which calls
+   internal_alloc(), and the client request is put inside internal_alloc(),
+   stack traces relating to the heap block will contain entries for both
+   my_alloc() and internal_alloc(), which is probably not what you want.
+
+   For Memcheck users: if you use VALGRIND_MALLOCLIKE_BLOCK to carve out
+   custom blocks from within a heap block, B, that has been allocated with
+   malloc/calloc/new/etc, then block B will be *ignored* during leak-checking
+   -- the custom blocks will take precedence.
+
+   VALGRIND_FREELIKE_BLOCK is the partner to VALGRIND_MALLOCLIKE_BLOCK.  For
+   Memcheck, it does two things:
+
+   - It records that the block has been deallocated.  This assumes that the
+     block was annotated as having been allocated via
+     VALGRIND_MALLOCLIKE_BLOCK.  Otherwise, an error will be issued.
+
+   - It marks the block as being unaddressable.
+
+   VALGRIND_FREELIKE_BLOCK should be put immediately after the point where a
+   heap block is deallocated.
+
+   VALGRIND_RESIZEINPLACE_BLOCK informs a tool about reallocation. For
+   Memcheck, it does four things:
+
+   - It records that the size of a block has been changed.  This assumes that
+     the block was annotated as having been allocated via
+     VALGRIND_MALLOCLIKE_BLOCK.  Otherwise, an error will be issued.
+
+   - If the block shrunk, it marks the freed memory as being unaddressable.
+
+   - If the block grew, it marks the new area as undefined and defines a red
+     zone past the end of the new block.
+
+   - The V-bits of the overlap between the old and the new block are preserved.
+
+   VALGRIND_RESIZEINPLACE_BLOCK should be put after allocation of the new block
+   and before deallocation of the old block.
+
+   In many cases, these three client requests will not be enough to get your
+   allocator working well with Memcheck.  More specifically, if your allocator
+   writes to freed blocks in any way then a VALGRIND_MAKE_MEM_UNDEFINED call
+   will be necessary to mark the memory as addressable just before the zeroing
+   occurs, otherwise you'll get a lot of invalid write errors.  For example,
+   you'll need to do this if your allocator recycles freed blocks, but it
+   zeroes them before handing them back out (via VALGRIND_MALLOCLIKE_BLOCK).
+   Alternatively, if your allocator reuses freed blocks for allocator-internal
+   data structures, VALGRIND_MAKE_MEM_UNDEFINED calls will also be necessary.
+
+   Really, what's happening is a blurring of the lines between the client
+   program and the allocator... after VALGRIND_FREELIKE_BLOCK is called, the
+   memory should be considered unaddressable to the client program, but the
+   allocator knows more than the rest of the client program and so may be able
+   to safely access it.  Extra client requests are necessary for Valgrind to
+   understand the distinction between the allocator and the rest of the
+   program.
+
+   Ignored if addr == 0.
+*/
+#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed)          \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MALLOCLIKE_BLOCK,       \
+                                    addr, sizeB, rzB, is_zeroed, 0)
+
+/* See the comment for VALGRIND_MALLOCLIKE_BLOCK for details.
+   Ignored if addr == 0.
+*/
+#define VALGRIND_RESIZEINPLACE_BLOCK(addr, oldSizeB, newSizeB, rzB)     \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__RESIZEINPLACE_BLOCK,    \
+                                    addr, oldSizeB, newSizeB, rzB, 0)
+
+/* See the comment for VALGRIND_MALLOCLIKE_BLOCK for details.
+   Ignored if addr == 0.
+*/
+#define VALGRIND_FREELIKE_BLOCK(addr, rzB)                              \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__FREELIKE_BLOCK,         \
+                                    addr, rzB, 0, 0, 0)
+
+/* Create a memory pool. */
+#define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed)             \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL,   \
+                                    pool, rzB, is_zeroed, 0, 0)
+
+/* Destroy a memory pool. */
+#define VALGRIND_DESTROY_MEMPOOL(pool)                            \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DESTROY_MEMPOOL,  \
+                                    pool, 0, 0, 0, 0)
+
+/* Associate a piece of memory with a memory pool. */
+#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size)                  \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_ALLOC,    \
+                                    pool, addr, size, 0, 0)
+
+/* Disassociate a piece of memory from a memory pool. */
+#define VALGRIND_MEMPOOL_FREE(pool, addr)                         \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_FREE,     \
+                                    pool, addr, 0, 0, 0)
+
+/* Disassociate any pieces outside a particular range. */
+#define VALGRIND_MEMPOOL_TRIM(pool, addr, size)                   \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_TRIM,     \
+                                    pool, addr, size, 0, 0)
+
+/* Resize and/or move a piece associated with a memory pool. */
+#define VALGRIND_MOVE_MEMPOOL(poolA, poolB)                       \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MOVE_MEMPOOL,     \
+                                    poolA, poolB, 0, 0, 0)
+
+/* Resize and/or move a piece associated with a memory pool. */
+#define VALGRIND_MEMPOOL_CHANGE(pool, addrA, addrB, size)         \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_CHANGE,   \
+                                    pool, addrA, addrB, size, 0)
+
+/* Return 1 if a mempool exists, else 0. */
+#define VALGRIND_MEMPOOL_EXISTS(pool)                             \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                  \
+                               VG_USERREQ__MEMPOOL_EXISTS,        \
+                               pool, 0, 0, 0, 0)
+
+/* Mark a piece of memory as being a stack. Returns a stack id. */
+#define VALGRIND_STACK_REGISTER(start, end)                       \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                  \
+                               VG_USERREQ__STACK_REGISTER,        \
+                               start, end, 0, 0, 0)
+
+/* Unmark the piece of memory associated with a stack id as being a
+   stack. */
+#define VALGRIND_STACK_DEREGISTER(id)                             \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STACK_DEREGISTER, \
+                                    id, 0, 0, 0, 0)
+
+/* Change the start and end address of the stack id. */
+#define VALGRIND_STACK_CHANGE(id, start, end)                     \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STACK_CHANGE,     \
+                                    id, start, end, 0, 0)
+
+/* Load PDB debug info for Wine PE image_map. */
+#define VALGRIND_LOAD_PDB_DEBUGINFO(fd, ptr, total_size, delta)     \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__LOAD_PDB_DEBUGINFO, \
+                                    fd, ptr, total_size, delta, 0)
+
+/* Map a code address to a source file name and line number.  buf64
+   must point to a 64-byte buffer in the caller's address space.  The
+   result will be dumped in there and is guaranteed to be zero
+   terminated.  If no info is found, the first byte is set to zero. */
+#define VALGRIND_MAP_IP_TO_SRCLOC(addr, buf64)                    \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                  \
+                               VG_USERREQ__MAP_IP_TO_SRCLOC,      \
+                               addr, buf64, 0, 0, 0)
+
+/* Disable error reporting for this thread.  Behaves in a stack like
+   way, so you can safely call this multiple times provided that
+   VALGRIND_ENABLE_ERROR_REPORTING is called the same number of times
+   to re-enable reporting.  The first call of this macro disables
+   reporting.  Subsequent calls have no effect except to increase the
+   number of VALGRIND_ENABLE_ERROR_REPORTING calls needed to re-enable
+   reporting.  Child threads do not inherit this setting from their
+   parents -- they are always created with reporting enabled. */
+#define VALGRIND_DISABLE_ERROR_REPORTING                                \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CHANGE_ERR_DISABLEMENT, \
+                                    1, 0, 0, 0, 0)
+
+/* Re-enable error reporting, as per comments on
+   VALGRIND_DISABLE_ERROR_REPORTING. */
+#define VALGRIND_ENABLE_ERROR_REPORTING                                 \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CHANGE_ERR_DISABLEMENT, \
+                                    -1, 0, 0, 0, 0)
+
+#undef PLAT_x86_darwin
+#undef PLAT_amd64_darwin
+#undef PLAT_x86_win32
+#undef PLAT_x86_linux
+#undef PLAT_amd64_linux
+#undef PLAT_ppc32_linux
+#undef PLAT_ppc64_linux
+#undef PLAT_arm_linux
+#undef PLAT_s390x_linux
+
+#endif   /* __VALGRIND_H */
diff --git a/deps/jerry/tools/apt-get-install-deps.sh b/deps/jerry/tools/apt-get-install-deps.sh
new file mode 100755 (executable)
index 0000000..a2eaf6e
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# 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.
+
+sudo apt-get update -q
+sudo apt-get install -q -y \
+    make cmake \
+    gcc gcc-multilib \
+    doxygen \
+    cppcheck vera++ python
diff --git a/deps/jerry/tools/apt-get-install-qemu-arm.sh b/deps/jerry/tools/apt-get-install-qemu-arm.sh
new file mode 100755 (executable)
index 0000000..7658ccd
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# 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.
+
+sudo apt-get update -q
+sudo apt-get install -q -y \
+    gcc-arm-linux-gnueabihf libc6-dev-armhf-cross \
+    qemu-user-static
diff --git a/deps/jerry/tools/brew-install-deps.sh b/deps/jerry/tools/brew-install-deps.sh
new file mode 100755 (executable)
index 0000000..8e4c783
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# 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.
+
+brew update
+
+PKGS="
+    cmake
+    cppcheck vera++
+    "
+
+for pkg in $PKGS
+do
+    if ! ( brew list -1 | grep -q "^${pkg}\$" )
+    then
+        brew install $pkg
+    fi
+done
diff --git a/deps/jerry/tools/build.py b/deps/jerry/tools/build.py
new file mode 100755 (executable)
index 0000000..2db7d22
--- /dev/null
@@ -0,0 +1,234 @@
+#!/usr/bin/env python
+
+# 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.
+
+from __future__ import print_function
+
+import argparse
+import multiprocessing
+import os
+import shutil
+import subprocess
+import sys
+import settings
+
+BUILD_DIR = os.path.join(settings.PROJECT_DIR, 'build')
+
+DEFAULT_PROFILE = 'es5.1'
+
+def default_toolchain():
+    (sysname, _, _, _, machine) = os.uname()
+    toolchain = os.path.join(settings.PROJECT_DIR,
+                             'cmake',
+                             'toolchain_%s_%s.cmake' % (sysname.lower(), machine.lower()))
+    return toolchain if os.path.isfile(toolchain) else None
+
+def get_arguments():
+    devhelp_preparser = argparse.ArgumentParser(add_help=False)
+    devhelp_preparser.add_argument('--devhelp', action='store_true', default=False,
+                                   help='show help with all options '
+                                   '(including those, which are useful for developers only)')
+
+    devhelp_arguments, args = devhelp_preparser.parse_known_args()
+    if devhelp_arguments.devhelp:
+        args.append('--devhelp')
+
+    def devhelp(helpstring):
+        return helpstring if devhelp_arguments.devhelp else argparse.SUPPRESS
+
+    parser = argparse.ArgumentParser(parents=[devhelp_preparser])
+    parser.add_argument('--all-in-one', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                        help='all-in-one build (%(choices)s; default: %(default)s)')
+    parser.add_argument('--builddir', metavar='DIR', action='store', default=BUILD_DIR,
+                        help='specify output directory (default: %(default)s)')
+    parser.add_argument('--clean', action='store_true', default=False, help='clean build')
+    parser.add_argument('--cmake-param', metavar='OPT', action='append', default=[],
+                        help='add custom argument to CMake')
+    parser.add_argument('--compile-flag', metavar='OPT', action='append', default=[],
+                        help='add custom compile flag')
+    parser.add_argument('--cpointer-32bit', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                        help='enable 32 bit compressed pointers (%(choices)s; default: %(default)s)')
+    parser.add_argument('--debug', action='store_const', const='Debug', default='MinSizeRel', dest='build_type',
+                        help='debug build')
+    parser.add_argument('--doctests', action='store_const', const='ON', default='OFF',
+                        help='build doctests')
+    parser.add_argument('--error-messages', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                        help='enable error messages (%(choices)s; default: %(default)s)')
+    parser.add_argument('--external-context', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                        help='enable external context (%(choices)s; default: %(default)s)')
+    parser.add_argument('-j', '--jobs', metavar='N', action='store', type=int, default=multiprocessing.cpu_count() + 1,
+                        help='Allowed N build jobs at once (default: %(default)s)')
+    parser.add_argument('--jerry-cmdline', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
+                        help='build jerry command line tool (%(choices)s; default: %(default)s)')
+    parser.add_argument('--jerry-cmdline-minimal', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                        help='build minimal version of the jerry command line tool (%(choices)s; default: %(default)s)')
+    parser.add_argument('--jerry-debugger', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                        help='enable the jerry debugger (%(choices)s; default: %(default)s)')
+    parser.add_argument('--jerry-ext', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
+                        help='build jerry-ext (default: %(default)s)')
+    parser.add_argument('--jerry-libc', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
+                        help='build and use jerry-libc (%(choices)s; default: %(default)s)')
+    parser.add_argument('--jerry-libm', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
+                        help='build and use jerry-libm (%(choices)s; default: %(default)s)')
+    parser.add_argument('--jerry-port-default', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
+                        help='build default jerry port implementation (%(choices)s; default: %(default)s)')
+    parser.add_argument('--js-parser', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
+                        help='enable js-parser (%(choices)s; default: %(default)s)')
+    parser.add_argument('--link-lib', metavar='OPT', action='append', default=[],
+                        help='add custom library to be linked')
+    parser.add_argument('--linker-flag', metavar='OPT', action='append', default=[],
+                        help='add custom linker flag')
+    parser.add_argument('--lto', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
+                        help='enable link-time optimizations (%(choices)s; default: %(default)s)')
+    parser.add_argument('--mem-heap', metavar='SIZE', action='store', type=int, default=512,
+                        help='size of memory heap, in kilobytes (default: %(default)s)')
+    parser.add_argument('--profile', metavar='FILE', action='store', default=DEFAULT_PROFILE,
+                        help='specify profile file (default: %(default)s)')
+    parser.add_argument('--snapshot-exec', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                        help='enable executing snapshot files (%(choices)s; default: %(default)s)')
+    parser.add_argument('--snapshot-save', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                        help='enable saving snapshot files (%(choices)s; default: %(default)s)')
+    parser.add_argument('--system-allocator', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                        help='enable system allocator (%(choices)s; default: %(default)s)')
+    parser.add_argument('--static-link', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
+                        help='enable static linking of binaries (%(choices)s; default: %(default)s)')
+    parser.add_argument('--strip', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
+                        help='strip release binaries (%(choices)s; default: %(default)s)')
+    parser.add_argument('--toolchain', metavar='FILE', action='store', default=default_toolchain(),
+                        help='add toolchain file (default: %(default)s)')
+    parser.add_argument('--unittests', action='store_const', const='ON', default='OFF',
+                        help='build unittests')
+    parser.add_argument('-v', '--verbose', action='store_const', const='ON', default='OFF',
+                        help='increase verbosity')
+    parser.add_argument('--vm-exec-stop', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                        help='enable VM execution stopping (%(choices)s; default: %(default)s)')
+
+    devgroup = parser.add_argument_group('developer options')
+    devgroup.add_argument('--link-map', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                          help=devhelp('enable the generation of a link map file for jerry command line tool '
+                                       '(%(choices)s; default: %(default)s)'))
+    devgroup.add_argument('--mem-stats', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                          help=devhelp('enable memory statistics (%(choices)s; default: %(default)s)'))
+    devgroup.add_argument('--mem-stress-test', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                          help=devhelp('enable mem-stress test (%(choices)s; default: %(default)s)'))
+    devgroup.add_argument('--show-opcodes', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                          help=devhelp('enable parser byte-code dumps (%(choices)s; default: %(default)s)'))
+    devgroup.add_argument('--show-regexp-opcodes', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                          help=devhelp('enable regexp byte-code dumps (%(choices)s; default: %(default)s)'))
+    devgroup.add_argument('--valgrind', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                          help=devhelp('enable Valgrind support (%(choices)s; default: %(default)s)'))
+    devgroup.add_argument('--valgrind-freya', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper,
+                          help=devhelp('enable Valgrind-Freya support (%(choices)s; default: %(default)s)'))
+
+    arguments = parser.parse_args(args)
+    if arguments.devhelp:
+        parser.print_help()
+        sys.exit(0)
+
+    return arguments
+
+def generate_build_options(arguments):
+    build_options = []
+
+    build_options.append('-DENABLE_ALL_IN_ONE=%s' % arguments.all_in_one)
+    build_options.append('-DCMAKE_BUILD_TYPE=%s' % arguments.build_type)
+    build_options.extend(arguments.cmake_param)
+    build_options.append('-DEXTERNAL_COMPILE_FLAGS=' + ' '.join(arguments.compile_flag))
+    build_options.append('-DFEATURE_CPOINTER_32_BIT=%s' % arguments.cpointer_32bit)
+    build_options.append('-DFEATURE_ERROR_MESSAGES=%s' % arguments.error_messages)
+    build_options.append('-DJERRY_CMDLINE=%s' % arguments.jerry_cmdline)
+    build_options.append('-DJERRY_CMDLINE_MINIMAL=%s' % arguments.jerry_cmdline_minimal)
+    build_options.append('-DJERRY_PORT_DEFAULT=%s' % arguments.jerry_port_default)
+    build_options.append('-DJERRY_EXT=%s' % arguments.jerry_ext)
+    build_options.append('-DJERRY_LIBC=%s' % arguments.jerry_libc)
+    build_options.append('-DJERRY_LIBM=%s' % arguments.jerry_libm)
+    build_options.append('-DFEATURE_JS_PARSER=%s' % arguments.js_parser)
+    build_options.append('-DEXTERNAL_LINK_LIBS=' + ' '.join(arguments.link_lib))
+    build_options.append('-DEXTERNAL_LINKER_FLAGS=' + ' '.join(arguments.linker_flag))
+    build_options.append('-DENABLE_LTO=%s' % arguments.lto)
+    build_options.append('-DMEM_HEAP_SIZE_KB=%d' % arguments.mem_heap)
+
+    build_options.append('-DFEATURE_PROFILE=%s' % arguments.profile)
+    build_options.append('-DFEATURE_DEBUGGER=%s' % arguments.jerry_debugger)
+    build_options.append('-DFEATURE_EXTERNAL_CONTEXT=%s' % arguments.external_context)
+    build_options.append('-DFEATURE_SNAPSHOT_EXEC=%s' % arguments.snapshot_exec)
+    build_options.append('-DFEATURE_SNAPSHOT_SAVE=%s' % arguments.snapshot_save)
+    build_options.append('-DFEATURE_SYSTEM_ALLOCATOR=%s' % arguments.system_allocator)
+    build_options.append('-DENABLE_STATIC_LINK=%s' % arguments.static_link)
+    build_options.append('-DENABLE_STRIP=%s' % arguments.strip)
+    build_options.append('-DFEATURE_VM_EXEC_STOP=%s' % arguments.vm_exec_stop)
+
+    if arguments.toolchain:
+        build_options.append('-DCMAKE_TOOLCHAIN_FILE=%s' % arguments.toolchain)
+
+    build_options.append('-DUNITTESTS=%s' % arguments.unittests)
+    build_options.append('-DDOCTESTS=%s' % arguments.doctests)
+    build_options.append('-DCMAKE_VERBOSE_MAKEFILE=%s' % arguments.verbose)
+
+    # developer options
+    build_options.append('-DENABLE_LINK_MAP=%s' % arguments.link_map)
+    build_options.append('-DFEATURE_MEM_STATS=%s' % arguments.mem_stats)
+    build_options.append('-DFEATURE_MEM_STRESS_TEST=%s' % arguments.mem_stress_test)
+    build_options.append('-DFEATURE_PARSER_DUMP=%s' % arguments.show_opcodes)
+    build_options.append('-DFEATURE_REGEXP_DUMP=%s' % arguments.show_regexp_opcodes)
+    build_options.append('-DFEATURE_VALGRIND=%s' % arguments.valgrind)
+    build_options.append('-DFEATURE_VALGRIND_FREYA=%s' % arguments.valgrind_freya)
+
+    return build_options
+
+def configure_output_dir(arguments):
+    if not os.path.isabs(arguments.builddir):
+        arguments.builddir = os.path.join(settings.PROJECT_DIR, arguments.builddir)
+
+    if arguments.clean and os.path.exists(arguments.builddir):
+        shutil.rmtree(arguments.builddir)
+
+    if not os.path.exists(arguments.builddir):
+        os.makedirs(arguments.builddir)
+
+def configure_build(arguments):
+    configure_output_dir(arguments)
+
+    build_options = generate_build_options(arguments)
+
+    cmake_cmd = ['cmake', '-B' + arguments.builddir, '-H' + settings.PROJECT_DIR]
+    cmake_cmd.extend(build_options)
+
+    return subprocess.call(cmake_cmd)
+
+def build_jerry(arguments):
+    return subprocess.call(['make', '--no-print-directory', '-j', str(arguments.jobs), '-C', arguments.builddir])
+
+def print_result(ret):
+    print('=' * 30)
+    if ret:
+        print('Build failed with exit code: %s' % (ret))
+    else:
+        print('Build succeeded!')
+    print('=' * 30)
+
+def main():
+    arguments = get_arguments()
+    ret = configure_build(arguments)
+
+    if not ret:
+        ret = build_jerry(arguments)
+
+    print_result(ret)
+    sys.exit(ret)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/deps/jerry/tools/check-cppcheck.sh b/deps/jerry/tools/check-cppcheck.sh
new file mode 100755 (executable)
index 0000000..6f7cb54
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# 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.
+
+if [[ "$OSTYPE" == "linux"* ]]; then
+    CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(nproc)}
+elif [[ "$OSTYPE" == "darwin"* ]]; then
+    CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(sysctl -n hw.ncpu)}
+else
+    CPPCHECK_JOBS=${CPPCHECK_JOBS:=1}
+fi
+
+JERRY_CORE_DIRS=`find jerry-core -type d`
+JERRY_EXT_DIRS=`find jerry-ext -type d`
+JERRY_PORT_DIRS=`find jerry-port -type d`
+JERRY_LIBC_DIRS=`find jerry-libc -type d`
+JERRY_LIBM_DIRS=`find jerry-libm -type d`
+
+
+INCLUDE_DIRS=()
+for DIR in $JERRY_CORE_DIRS $JERRY_EXT_DIRS $JERRY_PORT_DIRS $JERRY_LIBC_DIRS $JERRY_LIBM_DIRS
+do
+ INCLUDE_DIRS=("${INCLUDE_DIRS[@]}" "-I$DIR")
+done
+
+cppcheck -j$CPPCHECK_JOBS --force \
+ --language=c --std=c99 \
+ --enable=warning,style,performance,portability,information \
+ --quiet --template="{file}:{line}: {severity}({id}): {message}" \
+ --error-exitcode=1 \
+ --exitcode-suppressions=tools/cppcheck/suppressions-list \
+ --suppressions-list=tools/cppcheck/suppressions-list \
+ "${INCLUDE_DIRS[@]}" \
+ jerry-core jerry-ext jerry-port jerry-libc jerry-libm jerry-main tests/unit-*
diff --git a/deps/jerry/tools/check-doxygen.sh b/deps/jerry/tools/check-doxygen.sh
new file mode 100755 (executable)
index 0000000..ad1594c
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# 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.
+
+echo -n "Generating documentation with doxygen ..."
+DOXYGEN_WARNINGS=$((doxygen > /dev/null) 2>&1)
+echo " finished"
+
+if [ -n "$DOXYGEN_WARNINGS" ]
+then
+  echo "$DOXYGEN_WARNINGS"
+  exit 1
+fi
diff --git a/deps/jerry/tools/check-license.py b/deps/jerry/tools/check-license.py
new file mode 100755 (executable)
index 0000000..56d4b3c
--- /dev/null
@@ -0,0 +1,91 @@
+#!/usr/bin/env python
+
+# 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.
+
+from __future__ import print_function
+
+import os
+import re
+import sys
+import settings
+
+LICENSE = re.compile(
+    r'((#|//|\*) Copyright .*\n'
+    r')+\s?\2\n'
+    r'\s?\2 Licensed under the Apache License, Version 2.0 \(the "License"\);\n'
+    r'\s?\2 you may not use this file except in compliance with the License.\n'
+    r'\s?\2 You may obtain a copy of the License at\n'
+    r'\s?\2\n'
+    r'\s?\2     http://www.apache.org/licenses/LICENSE-2.0\n'
+    r'\s?\2\n'
+    r'\s?\2 Unless required by applicable law or agreed to in writing, software\n'
+    r'\s?\2 distributed under the License is distributed on an "AS IS" BASIS\n'
+    r'\s?\2 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n'
+    r'\s?\2 See the License for the specific language governing permissions and\n'
+    r'\s?\2 limitations under the License.\n'
+)
+
+INCLUDE_DIRS = [
+    'cmake',
+    'jerry-core',
+    'jerry-ext',
+    'jerry-libc',
+    'jerry-libm',
+    'jerry-main',
+    'jerry-port',
+    'targets',
+    'tests',
+    'tools',
+]
+
+EXCLUDE_DIRS = [
+    'targets/esp8266',
+    os.path.relpath(settings.TEST262_TEST_SUITE_DIR, settings.PROJECT_DIR),
+]
+
+EXTENSIONS = [
+    '.c',
+    '.cpp',
+    '.h',
+    '.S',
+    '.js',
+    '.py',
+    '.sh',
+    '.tcl',
+    '.cmake',
+]
+
+
+def main():
+    is_ok = True
+
+    for dname in INCLUDE_DIRS:
+        for root, _, files in os.walk(dname):
+            if any(root.startswith(exclude) for exclude in EXCLUDE_DIRS):
+                continue
+            for fname in files:
+                if any(fname.endswith(ext) for ext in EXTENSIONS):
+                    fpath = os.path.join(root, fname)
+                    with open(fpath) as curr_file:
+                        if not LICENSE.search(curr_file.read()):
+                            print('%s: incorrect license' % fpath)
+                            is_ok = False
+
+    if not is_ok:
+        sys.exit(1)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/deps/jerry/tools/check-magic-strings.sh b/deps/jerry/tools/check-magic-strings.sh
new file mode 100755 (executable)
index 0000000..23b96e1
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# 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.
+
+MAGIC_STRINGS_GEN="tools/gen-magic-strings.py"
+MAGIC_STRINGS_INC_H="jerry-core/lit/lit-magic-strings.inc.h"
+MAGIC_STRINGS_TEMP=`mktemp lit-magic-strings.inc.h.XXXXXXXXXX`
+
+cp $MAGIC_STRINGS_INC_H $MAGIC_STRINGS_TEMP
+$MAGIC_STRINGS_GEN
+diff -q $MAGIC_STRINGS_INC_H $MAGIC_STRINGS_TEMP
+DIFF_RESULT=$?
+mv $MAGIC_STRINGS_TEMP $MAGIC_STRINGS_INC_H
+
+if [ $DIFF_RESULT -ne 0 ]
+then
+  echo -e "\e[1;33m$MAGIC_STRINGS_INC_H must be re-generated. Run $MAGIC_STRINGS_GEN\e[0m"
+fi
+
+exit $DIFF_RESULT
diff --git a/deps/jerry/tools/check-pylint.sh b/deps/jerry/tools/check-pylint.sh
new file mode 100755 (executable)
index 0000000..8b229c7
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# 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.
+
+find ./tools ./jerry-debugger -name "*.py" \
+    | xargs pylint --rcfile=tools/pylint/pylintrc
diff --git a/deps/jerry/tools/check-signed-off.sh b/deps/jerry/tools/check-signed-off.sh
new file mode 100755 (executable)
index 0000000..a4585da
--- /dev/null
@@ -0,0 +1,110 @@
+#!/bin/bash
+
+# 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.
+
+# Usage
+function print_usage
+{
+ echo "Usage: $0 [--help] [--tolerant] [--travis]"
+}
+
+function print_help
+{
+ echo "$0: Check Signed-off-by message of the latest commit"
+ echo ""
+ print_usage
+ echo ""
+ echo "Optional arguments:"
+ echo "  --help            print this help message"
+ echo "  --tolerant        check the existence of the message only but don't"
+ echo "                    require the name and email address to match the author"
+ echo "                    of the commit"
+ echo "  --travis          perform check in tolerant mode if on Travis CI and not"
+ echo "                    checking a pull request, perform strict check otherwise"
+ echo ""
+ echo "The last line of every commit message must follow the form of:"
+ echo "'JerryScript-DCO-1.0-Signed-off-by: NAME EMAIL', where NAME and EMAIL must"
+ echo "match the name and email address of the author of the commit (unless in"
+ echo "tolerant mode)."
+}
+
+# Processing command line
+TOLERANT="no"
+while [ "$#" -gt 0 ]
+do
+ if [ "$1" == "--help" ]
+ then
+  print_help
+  exit 0
+ elif [ "$1" == "--tolerant" ]
+ then
+  TOLERANT="yes"
+  shift
+ elif [ "$1" == "--travis" ]
+ then
+  if [ "$TRAVIS_PULL_REQUEST" == "" ]
+  then
+   echo -e "\e[1;33mWarning! Travis-tolerant mode requested but not running on Travis CI! \e[0m"
+  elif [ "$TRAVIS_PULL_REQUEST" == "false" ]
+  then
+   TOLERANT="yes"
+  else
+   TOLERANT="no"
+  fi
+  shift
+ else
+  print_usage
+  exit 1
+ fi
+done
+
+# Determining latest commit
+parent_hashes=(`git show -s --format=%p HEAD | head -1`)
+
+if [ "${#parent_hashes[@]}" -eq 1 ]
+then
+ commit_hash=`git show -s --format=%h HEAD | head -1`
+elif [ "${#parent_hashes[@]}" -eq 2 ]
+then
+ commit_hash=${parent_hashes[1]}
+else
+ echo "$0: cannot handle commit with ${#parent_hashes[@]} parents ${parent_hashes[@]}"
+ exit 1
+fi
+
+# Checking the last line
+actual_signed_off_by_line=`git show -s --format=%B $commit_hash | sed '/^$/d' | tr -d '\015' | tail -n 1`
+
+if [ "$TOLERANT" == "no" ]
+then
+ author_name=`git show -s --format=%an $commit_hash`
+ author_email=`git show -s --format=%ae $commit_hash`
+ required_signed_off_by_line="JerryScript-DCO-1.0-Signed-off-by: $author_name $author_email"
+
+ if [ "$actual_signed_off_by_line" != "$required_signed_off_by_line" ]
+ then
+  echo -e "\e[1;33mSigned-off-by message is incorrect. The following line should be at the end of the $commit_hash commit's message: '$required_signed_off_by_line'. \e[0m"
+  exit 1
+ fi
+else
+  echo -e "\e[1;33mWarning! The name and email address of the author of the $commit_hash commit is not checked in tolerant mode! \e[0m"
+  if echo "$actual_signed_off_by_line" | grep -q -v '^JerryScript-DCO-1.0-Signed-off-by:'
+  then
+   echo -e "\e[1;33mSigned-off-by message is incorrect. The following line should be at the end of the $commit_hash commit's message: '$required_signed_off_by_line'. \e[0m"
+   exit 1
+  fi
+fi
+
+exit 0
diff --git a/deps/jerry/tools/check-vera.sh b/deps/jerry/tools/check-vera.sh
new file mode 100755 (executable)
index 0000000..e837545
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# 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.
+
+JERRY_CORE_FILES=`find ./jerry-core -name "*.c" -or -name "*.h"`
+JERRY_EXT_FILES=`find ./jerry-ext -name "*.c" -or -name "*.h"`
+JERRY_PORT_FILES=`find ./jerry-port -name "*.c" -or -name "*.h"`
+JERRY_LIBC_FILES=`find ./jerry-libc -name "*.c" -or -name "*.h"`
+JERRY_LIBM_FILES=`find ./jerry-libm -name "*.c" -or -name "*.h"`
+JERRY_MAIN_FILES=`find ./jerry-main -name "*.c" -or -name "*.h"`
+UNIT_TEST_FILES=`find ./tests/unit-* -name "*.c" -or -name "*.h"`
+
+if [ -n "$1" ]
+then
+MANUAL_CHECK_FILES=`find $1 -name "*.c" -or -name "*.h"`
+fi
+
+vera++ -r tools/vera++ -p jerry \
+ -e --no-duplicate \
+ $MANUAL_CHECK_FILES $JERRY_CORE_FILES $JERRY_EXT_FILES $JERRY_PORT_FILES $JERRY_LIBC_FILES $JERRY_LIBM_FILES $JERRY_MAIN_FILES $UNIT_TEST_FILES
diff --git a/deps/jerry/tools/cppcheck/suppressions-list b/deps/jerry/tools/cppcheck/suppressions-list
new file mode 100644 (file)
index 0000000..af0a3ce
--- /dev/null
@@ -0,0 +1,5 @@
+wrongmathcall:tests/unit-libm/test-libm.inc.h
+variableScope:jerry-libm/*.c
+invalidPointerCast:jerry-libm/*.c
+arithOperationsOnVoidPointer:jerry-libc/*.c
+commaSeparatedReturn:*
diff --git a/deps/jerry/tools/gen-doctest.py b/deps/jerry/tools/gen-doctest.py
new file mode 100755 (executable)
index 0000000..9e3c196
--- /dev/null
@@ -0,0 +1,180 @@
+#!/usr/bin/env python
+
+# 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.
+
+from __future__ import print_function
+
+import argparse
+import fileinput
+import os
+import re
+import shlex
+import sys
+
+
+class DoctestExtractor(object):
+    """
+    An extractor to process Markdown files and find doctests inside.
+    """
+
+    def __init__(self, outdir, dry):
+        """
+        :param outdir: path to the directory where to write the found doctests.
+        :param dry: if True, don't create the doctest files but print the file
+            names only.
+        """
+        self._outdir = outdir
+        self._dry = dry
+
+        # Attributes actually initialized by process()
+        self._infile = None
+        self._outname_base = None
+        self._outname_cnt = None
+
+    def _warning(self, message, lineno):
+        """
+        Print a warning to the standard error.
+
+        :param message: a description of the problem.
+        :param lineno: the location that triggered the warning.
+        """
+        print('%s:%d: %s' % (self._infile, lineno, message), file=sys.stderr)
+
+    def _process_decl(self, params):
+        """
+        Process a doctest declaration (`[doctest]: # (name="test.c", ...)`).
+
+        :param params: the parameter string of the declaration (the string
+            between the parentheses).
+        :return: a tuple of a dictionary (of keys and values taken from the
+            `params` string) and the line number of the declaration.
+        """
+        tokens = list(shlex.shlex(params))
+
+        decl = {}
+        for i in range(0, len(tokens), 4):
+            if i + 2 >= len(tokens) or tokens[i + 1] != '=' or (i + 3 < len(tokens) and tokens[i + 3] != ','):
+                self._warning('incorrect parameter list for test (key="value", ...)', fileinput.filelineno())
+                decl = {}
+                break
+            decl[tokens[i]] = tokens[i + 2].strip('\'"')
+
+        if 'name' not in decl:
+            decl['name'] = '%s%d.c' % (self._outname_base, self._outname_cnt)
+            self._outname_cnt += 1
+
+        if 'test' not in decl:
+            decl['test'] = 'run'
+
+        return decl, fileinput.filelineno()
+
+    def _process_code_start(self):
+        """
+        Process the beginning of a fenced code block (` ```c `).
+
+        :return: a tuple of a list (of the first line(s) of the doctest) and the
+            line number of the start of the code block.
+        """
+        return ['#line %d "%s"\n' % (fileinput.filelineno() + 1, self._infile)], fileinput.filelineno()
+
+    def _process_code_end(self, decl, code):
+        """
+        Process the end of a fenced code block (` ``` `).
+
+        :param decl: the dictionary of the declaration parameters.
+        :param code: the list of lines of the doctest.
+        """
+        outname = os.path.join(self._outdir, decl['name'])
+        action = decl['test']
+        if self._dry:
+            print('%s %s' % (action, outname))
+        else:
+            with open(outname, 'w') as outfile:
+                outfile.writelines(code)
+
+    def process(self, infile):
+        """
+        Find doctests in a Markdown file and process them according to the
+        constructor parameters.
+
+        :param infile: path to the input file.
+        """
+        self._infile = infile
+        self._outname_base = os.path.splitext(os.path.basename(infile))[0]
+        self._outname_cnt = 1
+
+        mode = 'TEXT'
+        decl, decl_lineno = {}, 0
+        code, code_lineno = [], 0
+
+        for line in fileinput.input(infile):
+            decl_match = re.match(r'^\[doctest\]:\s+#\s+\((.*)\)\s*$', line)
+            nl_match = re.match(r'^\s*$', line)
+            start_match = re.match(r'^```c\s*$', line)
+            end_match = re.match(r'^```\s*', line)
+
+            if mode == 'TEXT':
+                if decl_match is not None:
+                    decl, decl_lineno = self._process_decl(decl_match.group(1))
+                    mode = 'NL'
+            elif mode == 'NL':
+                if decl_match is not None:
+                    self._warning('test without code block', decl_lineno)
+                    decl, decl_lineno = self._process_decl(decl_match.group(1))
+                elif start_match is not None:
+                    code, code_lineno = self._process_code_start()
+                    mode = 'CODE'
+                elif nl_match is None:
+                    self._warning('test without code block', decl_lineno)
+                    mode = 'TEXT'
+            elif mode == 'CODE':
+                if end_match is not None:
+                    self._process_code_end(decl, code)
+                    mode = 'TEXT'
+                else:
+                    code.append(line)
+
+        if mode == 'NL':
+            self._warning('test without code block', decl_lineno)
+        elif mode == 'CODE':
+            self._warning('unterminated code block', code_lineno)
+
+
+def main():
+    parser = argparse.ArgumentParser(description='Markdown doctest extractor', epilog="""
+        The tool extracts specially marked fenced C code blocks from the input Markdown files
+        and writes them to the file system. The annotations recognized by the tool are special
+        but valid Markdown links/comments that must be added before the fenced code blocks:
+        `[doctest]: # (name="test.c", ...)`. For now, two parameters are valid:
+        `name` determines the filename for the extracted code block (overriding the default
+        auto-numbered naming scheme), and `test` determines the test action to be performed on
+        the extracted code (valid options are "compile", "link", and the default "run").
+        """)
+    parser.add_argument('-d', '--dir', metavar='NAME', default=os.getcwd(),
+                        help='output directory name (default: %(default)s)')
+    parser.add_argument('--dry', action='store_true',
+                        help='don\'t generate files but print file names that would be generated '
+                             'and what test action to perform on them')
+    parser.add_argument('file', nargs='+',
+                        help='input Markdown file(s)')
+    args = parser.parse_args()
+
+    extractor = DoctestExtractor(args.dir, args.dry)
+    for mdfile in args.file:
+        extractor.process(mdfile)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/deps/jerry/tools/gen-magic-strings.py b/deps/jerry/tools/gen-magic-strings.py
new file mode 100755 (executable)
index 0000000..970ab3d
--- /dev/null
@@ -0,0 +1,289 @@
+#!/usr/bin/env python
+
+# 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.
+
+from __future__ import print_function
+
+try:
+    from configparser import ConfigParser
+except ImportError:
+    from ConfigParser import ConfigParser
+
+import argparse
+import fileinput
+import json
+import os
+import re
+
+from settings import PROJECT_DIR
+
+
+MAGIC_STRINGS_INI = os.path.join(PROJECT_DIR, 'jerry-core', 'lit', 'lit-magic-strings.ini')
+MAGIC_STRINGS_INC_H = os.path.join(PROJECT_DIR, 'jerry-core', 'lit', 'lit-magic-strings.inc.h')
+
+
+def debug_dump(obj):
+    def deepcopy(obj):
+        if isinstance(obj, (list, tuple)):
+            return [deepcopy(e) for e in obj]
+        if isinstance(obj, set):
+            return [repr(e) for e in obj]
+        if isinstance(obj, dict):
+            return {repr(k): deepcopy(e) for k, e in obj.items()}
+        return obj
+    return json.dumps(deepcopy(obj), indent=4)
+
+
+def read_magic_string_defs(debug=False):
+    # Read the `jerry-core/lit/lit-magic-strings.ini` file and returns the magic
+    # string definitions found therein in the form of
+    #   [LIT_MAGIC_STRINGS]
+    #   LIT_MAGIC_STRING_xxx = "vvv"
+    #   ...
+    # as
+    #   [('LIT_MAGIC_STRING_xxx', 'vvv'), ...]
+    # sorted by length and alpha.
+    ini_parser = ConfigParser()
+    ini_parser.optionxform = str # case sensitive options (magic string IDs)
+    ini_parser.read(MAGIC_STRINGS_INI)
+
+    defs = [(str_ref, json.loads(str_value) if str_value != '' else '')
+            for str_ref, str_value in ini_parser.items('LIT_MAGIC_STRINGS')]
+    defs = sorted(defs, key=lambda ref_value: (len(ref_value[1]), ref_value[1]))
+
+    if debug:
+        print('debug: magic string definitions: {dump}'
+              .format(dump=debug_dump(defs)))
+
+    return defs
+
+
+def extract_magic_string_refs(debug=False):
+    results = {}
+
+    def process_line(fname, lnum, line, guard_stack):
+        # Build `results` dictionary as
+        #   results['LIT_MAGIC_STRING_xxx'][('!defined (CONFIG_DISABLE_yyy_BUILTIN)', ...)]
+        #       = [('zzz.c', 123), ...]
+        # meaning that the given literal is referenced under the given guards at
+        # the listed (file, line number) locations.
+        for str_ref in re.findall('LIT_MAGIC_STRING_[a-zA-Z0-9_]+', line):
+            if str_ref in ['LIT_MAGIC_STRING_DEF',
+                           'LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE',
+                           'LIT_MAGIC_STRING_LENGTH_LIMIT',
+                           'LIT_MAGIC_STRING__COUNT']:
+                continue
+
+            guard_set = set()
+            for guards in guard_stack:
+                guard_set.update(guards)
+            guard_tuple = tuple(sorted(guard_set))
+
+            if str_ref not in results:
+                results[str_ref] = {}
+            str_guards = results[str_ref]
+
+            if guard_tuple not in str_guards:
+                str_guards[guard_tuple] = []
+            file_list = str_guards[guard_tuple]
+
+            file_list.append((fname, lnum))
+
+    def process_guard(guard):
+        # Transform `#ifndef MACRO` to `#if !defined (MACRO)` and
+        # `#ifdef MACRO` to `#if defined (MACRO)` to enable or-ing/and-ing the
+        # conditions later on.
+        if guard.startswith('ndef '):
+            guard = guard.replace('ndef ', '!defined (', 1) + ')'
+        elif guard.startswith('def '):
+            guard = guard.replace('def ', 'defined (', 1) + ')'
+        return guard
+
+    def process_file(fname):
+        # Builds `guard_stack` list for each line of a file as
+        #   [['!defined (CONFIG_DISABLE_yyy_BUILTIN)', ...], ...]
+        # meaning that all the listed guards (conditionals) have to hold for the
+        # line to be kept by the preprocessor.
+        guard_stack = []
+
+        for line in fileinput.input(fname):
+            if_match = re.match('^# *if(.*)', line)
+            elif_match = re.match('^# *elif(.*)', line)
+            else_match = re.match('^# *else', line)
+            endif_match = re.match('^# *endif', line)
+            if if_match is not None:
+                guard_stack.append([process_guard(if_match.group(1))])
+            elif elif_match is not None:
+                guards = guard_stack[-1]
+                guards[-1] = '!(%s)' % guards[-1]
+                guards.append(process_guard(elif_match.group(1)))
+            elif else_match is not None:
+                guards = guard_stack[-1]
+                guards[-1] = '!(%s)' % guards[-1]
+            elif endif_match is not None:
+                guard_stack.pop()
+
+            lnum = fileinput.filelineno()
+            process_line(fname, lnum, line, guard_stack)
+
+        if guard_stack:
+            print('warning: {fname}: unbalanced preprocessor conditional '
+                  'directives (analysis finished with no closing `#endif` '
+                  'for {guard_stack})'
+                  .format(fname=fname, guard_stack=guard_stack))
+
+    for root, _, files in os.walk(os.path.join(PROJECT_DIR, 'jerry-core')):
+        for fname in files:
+            if (fname.endswith('.c') or fname.endswith('.h')) \
+               and fname != 'lit-magic-strings.inc.h':
+                process_file(os.path.join(root, fname))
+
+    if debug:
+        print('debug: magic string references: {dump}'
+              .format(dump=debug_dump(results)))
+
+    return results
+
+
+def calculate_magic_string_guards(defs, uses, debug=False):
+    extended_defs = []
+
+    for str_ref, str_value in defs:
+        if str_ref not in uses:
+            print('warning: unused magic string {str_ref}'
+                  .format(str_ref=str_ref))
+            continue
+
+        # Calculate the most compact guard, i.e., if a magic string is
+        # referenced under various guards, keep the one that is more generic.
+        # E.g.,
+        # guard1 = A and B and C and D and E and F
+        # guard2 = A and B and C
+        # then guard1 or guard2 == guard2.
+        guards = [set(guard_tuple) for guard_tuple in uses[str_ref].keys()]
+        for i, guard_i in enumerate(guards):
+            if guard_i is None:
+                continue
+            for j, guard_j in enumerate(guards):
+                if j == i or guard_j is None:
+                    continue
+                if guard_i < guard_j:
+                    guards[j] = None
+        guards = {tuple(sorted(guard)) for guard in guards if guard is not None}
+
+        extended_defs.append((str_ref, str_value, guards))
+
+    if debug:
+        print('debug: magic string definitions (with guards): {dump}'
+              .format(dump=debug_dump(extended_defs)))
+
+    return extended_defs
+
+
+def guards_to_str(guards):
+    return ' \\\n|| '.join(' && '.join(g for g in sorted(guard))
+                           for guard in sorted(guards))
+
+
+def generate_header(gen_file):
+    header = \
+"""/* 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.
+ */
+
+/* This file is automatically generated by the %s script
+ * from %s. Do not edit! */
+""" % (os.path.basename(__file__), os.path.basename(MAGIC_STRINGS_INI))
+    print(header, file=gen_file)
+
+
+def generate_magic_string_defs(gen_file, defs):
+    print(file=gen_file) # empty line separator
+
+    last_guards = set([()])
+    for str_ref, str_value, guards in defs:
+        if last_guards != guards:
+            if () not in last_guards:
+                print('#endif', file=gen_file)
+            if () not in guards:
+                print('#if {guards}'.format(guards=guards_to_str(guards)), file=gen_file)
+
+        print('LIT_MAGIC_STRING_DEF ({str_ref}, {str_value})'
+              .format(str_ref=str_ref, str_value=json.dumps(str_value)), file=gen_file)
+
+        last_guards = guards
+
+    if () not in last_guards:
+        print('#endif', file=gen_file)
+
+
+def generate_first_magic_strings(gen_file, defs):
+    print(file=gen_file) # empty line separator
+
+    max_size = len(defs[-1][1])
+    for size in range(max_size + 1):
+        last_guards = set([()])
+        for str_ref, str_value, guards in defs:
+            if len(str_value) >= size:
+                if () not in guards and () in last_guards:
+                    print('#if {guards}'.format(guards=guards_to_str(guards)), file=gen_file)
+                elif () not in guards and () not in last_guards:
+                    if guards == last_guards:
+                        continue
+                    print('#elif {guards}'.format(guards=guards_to_str(guards)), file=gen_file)
+                elif () in guards and () not in last_guards:
+                    print('#else', file=gen_file)
+
+                print('LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE ({size}, {str_ref})'
+                      .format(size=size, str_ref=str_ref), file=gen_file)
+
+                if () in guards:
+                    break
+
+                last_guards = guards
+
+        if () not in last_guards:
+            print('#endif', file=gen_file)
+
+
+def main():
+    parser = argparse.ArgumentParser(description='lit-magic-strings.inc.h generator')
+    parser.add_argument('--debug', action='store_true', help='enable debug output')
+    args = parser.parse_args()
+
+    defs = read_magic_string_defs(debug=args.debug)
+    uses = extract_magic_string_refs(debug=args.debug)
+
+    extended_defs = calculate_magic_string_guards(defs, uses, debug=args.debug)
+
+    with open(MAGIC_STRINGS_INC_H, 'w') as gen_file:
+        generate_header(gen_file)
+        generate_magic_string_defs(gen_file, extended_defs)
+        generate_first_magic_strings(gen_file, extended_defs)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/deps/jerry/tools/gen-test-libm.sh b/deps/jerry/tools/gen-test-libm.sh
new file mode 100755 (executable)
index 0000000..64bba36
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# 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.
+
+make -C tools/unit-tests build
+tools/unit-tests/gen-test-libm >tests/unit-libm/test-libm.inc.h
+make -C tools/unit-tests clean
diff --git a/deps/jerry/tools/gen-unicode.py b/deps/jerry/tools/gen-unicode.py
new file mode 100755 (executable)
index 0000000..1b9de8b
--- /dev/null
@@ -0,0 +1,783 @@
+#!/usr/bin/env python
+
+# 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.
+
+from __future__ import print_function
+
+import argparse
+import bisect
+import csv
+import itertools
+import os
+import warnings
+
+from gen_c_source import LICENSE, format_code
+from settings import PROJECT_DIR
+
+
+RANGES_C_SOURCE = os.path.join(PROJECT_DIR, 'jerry-core/lit/lit-unicode-ranges.inc.h')
+CONVERSIONS_C_SOURCE = os.path.join(PROJECT_DIR, 'jerry-core/lit/lit-unicode-conversions.inc.h')
+
+
+# common code generation
+
+
+class UniCodeSource(object):
+    def __init__(self, filepath):
+        self.__filepath = filepath
+        self.__header = [LICENSE, ""]
+        self.__data = []
+
+    def complete_header(self, completion):
+        self.__header.append(completion)
+        self.__header.append("")  # for an extra empty line
+
+    def add_table(self, table, table_name, table_type, table_descr):
+        self.__data.append(table_descr)
+        self.__data.append("static const %s lit_%s[] JERRY_CONST_DATA =" % (table_type, table_name))
+        self.__data.append("{")
+        self.__data.append(format_code(table, 1))
+        self.__data.append("};")
+        self.__data.append("")  # for an extra empty line
+
+    def generate(self):
+        with open(self.__filepath, 'w') as generated_source:
+            generated_source.write("\n".join(self.__header))
+            generated_source.write("\n".join(self.__data))
+
+
+# functions for unicode ranges
+
+
+def read_categories(unicode_data_file):
+    """
+    Read the corresponding unicode values and store them in category lists.
+
+    :return: List of letters, non_letter and separators.
+    """
+
+    # unicode categories:      Lu Ll Lt Mn Mc Me Nd Nl No Zs Zl Zp Cc Cf Cs Co Lm Lo Pc Pd Ps Pe Pi Pf Po Sm Sc Sk So
+    # letter:                  Lu Ll Lt Lm Lo Nl
+    # non-letter-indent-part:
+    #   digit:                 Nd
+    #   punctuation mark:      Mn Mc
+    #   connector punctuation: Pc
+    # separators:              Zs
+    letter_category = ["Lu", "Ll", "Lt", "Lm", "Lo", "Nl"]
+    non_letter_category = ["Nd", "Mn", "Mc", "Pc"]
+    separator_category = ["Zs"]
+
+    letters = []
+    non_letters = []
+    separators = []
+
+    with open(unicode_data_file) as unicode_data:
+        for line in csv.reader(unicode_data, delimiter=';'):
+            unicode_id = int(line[0], 16)
+
+            # Skip supplementary planes and ascii chars
+            if unicode_id >= 0x10000 or unicode_id < 128:
+                continue
+
+            category = line[2]
+
+            if category in letter_category:
+                letters.append(unicode_id)
+            elif category in non_letter_category:
+                non_letters.append(unicode_id)
+            elif category in separator_category:
+                separators.append(unicode_id)
+
+    # This separator char is handled separatly
+    non_breaking_space = 0x00A0
+    if non_breaking_space in separators:
+        separators.remove(int(non_breaking_space))
+
+    # These separator chars are not in the unicode data file or not in Zs category
+    mongolian_vowel_separator = 0x180E
+    medium_mathematical_space = 0x205F
+    zero_width_space = 0x200B
+
+    if mongolian_vowel_separator not in separators:
+        bisect.insort(separators, int(mongolian_vowel_separator))
+    if medium_mathematical_space not in separators:
+        bisect.insort(separators, int(medium_mathematical_space))
+    if zero_width_space not in separators:
+        bisect.insort(separators, int(zero_width_space))
+
+    return letters, non_letters, separators
+
+
+def group_ranges(i):
+    """
+    Convert an increasing list of integers into a range list
+
+    :return: List of ranges.
+    """
+    for _, group in itertools.groupby(enumerate(i), lambda q: (q[1] - q[0])):
+        group = list(group)
+        yield group[0][1], group[-1][1]
+
+
+def split_list(category_list):
+    """
+    Split list of ranges into intervals and single char lists.
+
+    :return: List of interval starting points, interval lengths and single chars
+    """
+
+    interval_sps = []
+    interval_lengths = []
+    chars = []
+
+    for element in category_list:
+        interval_length = element[1] - element[0]
+        if interval_length == 0:
+            chars.append(element[0])
+        elif interval_length > 255:
+            for i in range(element[0], element[1], 256):
+                length = 255 if (element[1] - i > 255) else (element[1] - i)
+                interval_sps.append(i)
+                interval_lengths.append(length)
+        else:
+            interval_sps.append(element[0])
+            interval_lengths.append(element[1] - element[0])
+
+    return interval_sps, interval_lengths, chars
+
+
+def generate_ranges(script_args):
+    letters, non_letters, separators = read_categories(script_args.unicode_data)
+
+    letter_tables = split_list(list(group_ranges(letters)))
+    non_letter_tables = split_list(list(group_ranges(non_letters)))
+    separator_tables = split_list(list(group_ranges(separators)))
+
+    c_source = UniCodeSource(RANGES_C_SOURCE)
+
+    header_completion = ["/* This file is automatically generated by the %s script" % os.path.basename(__file__),
+                         " * from %s. Do not edit! */" % os.path.basename(script_args.unicode_data),
+                         ""]
+
+    c_source.complete_header("\n".join(header_completion))
+
+    c_source.add_table(letter_tables[0],
+                       "unicode_letter_interval_sps",
+                       "uint16_t",
+                       ("/**\n"
+                        " * Character interval starting points for the unicode letters.\n"
+                        " *\n"
+                        " * The characters covered by these intervals are from\n"
+                        " * the following Unicode categories: Lu, Ll, Lt, Lm, Lo, Nl\n"
+                        " */"))
+
+    c_source.add_table(letter_tables[1],
+                       "unicode_letter_interval_lengths",
+                       "uint8_t",
+                       ("/**\n"
+                        " * Character lengths for the unicode letters.\n"
+                        " *\n"
+                        " * The characters covered by these intervals are from\n"
+                        " * the following Unicode categories: Lu, Ll, Lt, Lm, Lo, Nl\n"
+                        " */"))
+
+    c_source.add_table(letter_tables[2],
+                       "unicode_letter_chars",
+                       "uint16_t",
+                       ("/**\n"
+                        " * Those unicode letter characters that are not inside any of\n"
+                        " * the intervals specified in lit_unicode_letter_interval_sps array.\n"
+                        " *\n"
+                        " * The characters are from the following Unicode categories:\n"
+                        " * Lu, Ll, Lt, Lm, Lo, Nl\n"
+                        " */"))
+
+    c_source.add_table(non_letter_tables[0],
+                       "unicode_non_letter_ident_part_interval_sps",
+                       "uint16_t",
+                       ("/**\n"
+                        " * Character interval starting points for non-letter character\n"
+                        " * that can be used as a non-first character of an identifier.\n"
+                        " *\n"
+                        " * The characters covered by these intervals are from\n"
+                        " * the following Unicode categories: Nd, Mn, Mc, Pc\n"
+                        " */"))
+
+    c_source.add_table(non_letter_tables[1],
+                       "unicode_non_letter_ident_part_interval_lengths",
+                       "uint8_t",
+                       ("/**\n"
+                        " * Character interval lengths for non-letter character\n"
+                        " * that can be used as a non-first character of an identifier.\n"
+                        " *\n"
+                        " * The characters covered by these intervals are from\n"
+                        " * the following Unicode categories: Nd, Mn, Mc, Pc\n"
+                        " */"))
+
+    c_source.add_table(non_letter_tables[2],
+                       "unicode_non_letter_ident_part_chars",
+                       "uint16_t",
+                       ("/**\n"
+                        " * Those non-letter characters that can be used as a non-first\n"
+                        " * character of an identifier and not included in any of the intervals\n"
+                        " * specified in lit_unicode_non_letter_ident_part_interval_sps array.\n"
+                        " *\n"
+                        " * The characters are from the following Unicode categories:\n"
+                        " * Nd, Mn, Mc, Pc\n"
+                        " */"))
+
+    c_source.add_table(separator_tables[0],
+                       "unicode_separator_char_interval_sps",
+                       "uint16_t",
+                       ("/**\n"
+                        " * Unicode separator character interval starting points from Unicode category: Zs\n"
+                        " */"))
+
+    c_source.add_table(separator_tables[1],
+                       "unicode_separator_char_interval_lengths",
+                       "uint8_t",
+                       ("/**\n"
+                        " * Unicode separator character interval lengths from Unicode category: Zs\n"
+                        " */"))
+
+    c_source.add_table(separator_tables[2],
+                       "unicode_separator_chars",
+                       "uint16_t",
+                       ("/**\n"
+                        " * Unicode separator characters that are not in the\n"
+                        " * lit_unicode_separator_char_intervals array.\n"
+                        " *\n"
+                        " * Unicode category: Zs\n"
+                        " */"))
+
+    c_source.generate()
+
+
+# functions for unicode conversions
+
+
+def parse_unicode_sequence(raw_data):
+    """
+    Parse unicode sequence from raw data.
+
+    :param raw_data: Contains the unicode sequence which needs to parse.
+    :return: The parsed unicode sequence.
+    """
+
+    result = ''
+
+    for unicode_char in raw_data.split(' '):
+        if unicode_char == '':
+            continue
+
+        # Convert it to unicode code point (from hex value without 0x prefix)
+        hex_val = int(unicode_char, 16)
+        try:
+            result += unichr(hex_val)
+        except NameError:
+            result += chr(hex_val)
+
+    return result
+
+
+def read_case_mappings(unicode_data_file, special_casing_file):
+    """
+    Read the corresponding unicode values of lower and upper case letters and store these in tables.
+
+    :param unicode_data_file: Contains the default case mappings (one-to-one mappings).
+    :param special_casing_file: Contains additional informative case mappings that are either not one-to-one
+                                or which are context-sensitive.
+    :return: Upper and lower case mappings.
+    """
+
+    lower_case_mapping = {}
+    upper_case_mapping = {}
+
+    # Add one-to-one mappings
+    with open(unicode_data_file) as unicode_data:
+        unicode_data_reader = csv.reader(unicode_data, delimiter=';')
+
+        for line in unicode_data_reader:
+            letter_id = int(line[0], 16)
+
+            # Skip supplementary planes and ascii chars
+            if letter_id >= 0x10000 or letter_id < 128:
+                continue
+
+            capital_letter = line[12]
+            small_letter = line[13]
+
+            if capital_letter:
+                upper_case_mapping[letter_id] = parse_unicode_sequence(capital_letter)
+
+            if small_letter:
+                lower_case_mapping[letter_id] = parse_unicode_sequence(small_letter)
+
+    # Update the conversion tables with the special cases
+    with open(special_casing_file) as special_casing:
+        special_casing_reader = csv.reader(special_casing, delimiter=';')
+
+        for line in special_casing_reader:
+            # Skip comment sections and empty lines
+            if not line or line[0].startswith('#'):
+                continue
+
+            # Replace '#' character with empty string
+            for idx, i in enumerate(line):
+                if i.find('#') >= 0:
+                    line[idx] = ''
+
+            letter_id = int(line[0], 16)
+            condition_list = line[4]
+
+            # Skip supplementary planes, ascii chars, and condition_list
+            if letter_id >= 0x10000 or letter_id < 128 or condition_list:
+                continue
+
+            small_letter = parse_unicode_sequence(line[1])
+            capital_letter = parse_unicode_sequence(line[3])
+
+            lower_case_mapping[letter_id] = small_letter
+            upper_case_mapping[letter_id] = capital_letter
+
+    return lower_case_mapping, upper_case_mapping
+
+
+def extract_ranges(letter_case, reverse_letter_case=None):
+    """
+    Extract ranges from case mappings
+    (the second param is optional, if it's not empty, a range will contains bidirectional conversions only).
+
+    :param letter_id: An integer, representing the unicode code point of the character.
+    :param letter_case: case mappings dictionary which contains the conversions.
+    :param reverse_letter_case: Comparable case mapping table which contains the return direction of the conversion.
+    :return: A table with the start points and their mapped value, and another table with the lengths of the ranges.
+    """
+
+    in_range = False
+    range_position = -1
+    ranges = []
+    range_lengths = []
+
+    for letter_id in sorted(letter_case.keys()):
+        prev_letter_id = letter_id - 1
+
+        # One-way conversions
+        if reverse_letter_case is None:
+            if len(letter_case[letter_id]) > 1:
+                in_range = False
+                continue
+
+            if prev_letter_id not in letter_case or len(letter_case[prev_letter_id]) > 1:
+                in_range = False
+                continue
+
+        # Two way conversions
+        else:
+            if not is_bidirectional_conversion(letter_id, letter_case, reverse_letter_case):
+                in_range = False
+                continue
+
+            if not is_bidirectional_conversion(prev_letter_id, letter_case, reverse_letter_case):
+                in_range = False
+                continue
+
+        conv_distance = calculate_conversion_distance(letter_case, letter_id)
+        prev_conv_distance = calculate_conversion_distance(letter_case, prev_letter_id)
+
+        if conv_distance != prev_conv_distance:
+            in_range = False
+            continue
+
+        if in_range:
+            range_lengths[range_position] += 1
+        else:
+            in_range = True
+            range_position += 1
+
+            # Add the start point of the range and its mapped value
+            ranges.extend([prev_letter_id, ord(letter_case[prev_letter_id])])
+            range_lengths.append(2)
+
+    # Remove all ranges from the case mapping table.
+    for idx in range(0, len(ranges), 2):
+        range_length = range_lengths[idx // 2]
+
+        for incr in range(range_length):
+            del letter_case[ranges[idx] + incr]
+            if reverse_letter_case is not None:
+                del reverse_letter_case[ranges[idx + 1] + incr]
+
+    return ranges, range_lengths
+
+
+def extract_character_pair_ranges(letter_case, reverse_letter_case):
+    """
+    Extract two or more character pairs from the case mapping tables.
+
+    :param letter_case: case mappings dictionary which contains the conversions.
+    :param reverse_letter_case: Comparable case mapping table which contains the return direction of the conversion.
+    :return: A table with the start points, and another table with the lengths of the ranges.
+    """
+
+    start_points = []
+    lengths = []
+    in_range = False
+    element_counter = -1
+
+    for letter_id in sorted(letter_case.keys()):
+        # Only extract character pairs
+        if not is_bidirectional_conversion(letter_id, letter_case, reverse_letter_case):
+            in_range = False
+            continue
+
+        if ord(letter_case[letter_id]) == letter_id + 1:
+            prev_letter_id = letter_id - 2
+
+            if not is_bidirectional_conversion(prev_letter_id, letter_case, reverse_letter_case):
+                in_range = False
+
+            if in_range:
+                lengths[element_counter] += 2
+            else:
+                element_counter += 1
+                start_points.append(letter_id)
+                lengths.append(2)
+                in_range = True
+
+        else:
+            in_range = False
+
+    # Remove all found case mapping from the conversion tables after the scanning method
+    for idx, letter_id in enumerate(start_points):
+        conv_length = lengths[idx]
+
+        for incr in range(0, conv_length, 2):
+            del letter_case[letter_id + incr]
+            del reverse_letter_case[letter_id + 1 + incr]
+
+    return start_points, lengths
+
+
+def extract_character_pairs(letter_case, reverse_letter_case):
+    """
+    Extract character pairs. Check that two unicode value are also a mapping value of each other.
+
+    :param letter_case: case mappings dictionary which contains the conversions.
+    :param reverse_letter_case: Comparable case mapping table which contains the return direction of the conversion.
+    :return: A table with character pairs.
+    """
+
+    character_pairs = []
+
+    for letter_id in sorted(letter_case.keys()):
+        if is_bidirectional_conversion(letter_id, letter_case, reverse_letter_case):
+            mapped_value = letter_case[letter_id]
+            character_pairs.extend([letter_id, ord(mapped_value)])
+
+            # Remove character pairs from case mapping tables
+            del letter_case[letter_id]
+            del reverse_letter_case[ord(mapped_value)]
+
+    return character_pairs
+
+
+def extract_special_ranges(letter_case):
+    """
+    Extract special ranges. It contains start points of one-to-two letter case ranges
+    where the second character is always the same.
+
+    :param letter_case: case mappings dictionary which contains the conversions.
+
+    :return: A table with the start points and their mapped values, and a table with the lengths of the ranges.
+    """
+
+    special_ranges = []
+    special_range_lengths = []
+
+    range_position = -1
+
+    for letter_id in sorted(letter_case.keys()):
+        mapped_value = letter_case[letter_id]
+
+        if len(mapped_value) != 2:
+            continue
+
+        prev_letter_id = letter_id - 1
+
+        if prev_letter_id not in letter_case:
+            in_range = False
+            continue
+
+        prev_mapped_value = letter_case[prev_letter_id]
+
+        if len(prev_mapped_value) != 2:
+            continue
+
+        if prev_mapped_value[1] != mapped_value[1]:
+            continue
+
+        if (ord(prev_mapped_value[0]) - prev_letter_id) != (ord(mapped_value[0]) - letter_id):
+            in_range = False
+            continue
+
+        if in_range:
+            special_range_lengths[range_position] += 1
+        else:
+            range_position += 1
+            in_range = True
+
+            special_ranges.extend([prev_letter_id, ord(prev_mapped_value[0]), ord(prev_mapped_value[1])])
+            special_range_lengths.append(1)
+
+    # Remove special ranges from the conversion table
+    for idx in range(0, len(special_ranges), 3):
+        range_length = special_range_lengths[idx // 3]
+        letter_id = special_ranges[idx]
+
+        for incr in range(range_length):
+            del letter_case[special_ranges[idx] + incr]
+
+    return special_ranges, special_range_lengths
+
+
+def extract_conversions(letter_case):
+    """
+    Extract conversions. It provide the full (or remained) case mappings from the table.
+    The counter table contains the information of how much one-to-one, one-to-two or one-to-three mappings
+    exists successively in the conversion table.
+
+    :return: A table with conversions, and a table with counters.
+    """
+
+    unicodes = [[], [], []]
+    unicode_lengths = [0, 0, 0]
+
+    # 1 to 1 byte
+    for letter_id in sorted(letter_case.keys()):
+        mapped_value = letter_case[letter_id]
+
+        if len(mapped_value) != 1:
+            continue
+
+        unicodes[0].extend([letter_id, ord(mapped_value)])
+        del letter_case[letter_id]
+
+    # 1 to 2 bytes
+    for letter_id in sorted(letter_case.keys()):
+        mapped_value = letter_case[letter_id]
+
+        if len(mapped_value) != 2:
+            continue
+
+        unicodes[1].extend([letter_id, ord(mapped_value[0]), ord(mapped_value[1])])
+        del letter_case[letter_id]
+
+    # 1 to 3 bytes
+    for letter_id in sorted(letter_case.keys()):
+        mapped_value = letter_case[letter_id]
+
+        if len(mapped_value) != 3:
+            continue
+
+        unicodes[2].extend([letter_id, ord(mapped_value[0]), ord(mapped_value[1]), ord(mapped_value[2])])
+        del letter_case[letter_id]
+
+    unicode_lengths = [int(len(unicodes[0]) / 2), int(len(unicodes[1]) / 3), int(len(unicodes[2]) / 4)]
+
+    return list(itertools.chain.from_iterable(unicodes)), unicode_lengths
+
+
+def is_bidirectional_conversion(letter_id, letter_case, reverse_letter_case):
+    """
+    Check that two unicode value are also a mapping value of each other.
+
+    :param letter_id: An integer, representing the unicode code point of the character.
+    :param other_case_mapping: Comparable case mapping table which possible contains
+                               the return direction of the conversion.
+    :return: True, if it's a reverible conversion, false otherwise.
+    """
+
+    if letter_id not in letter_case:
+        return False
+
+    # Check one-to-one mapping
+    mapped_value = letter_case[letter_id]
+    if len(mapped_value) > 1:
+        return False
+
+    # Check two way conversions
+    mapped_value_id = ord(mapped_value)
+
+    if mapped_value_id not in reverse_letter_case or len(reverse_letter_case[mapped_value_id]) > 1:
+        return False
+
+    if ord(reverse_letter_case[mapped_value_id]) != letter_id:
+        return False
+
+    return True
+
+
+def calculate_conversion_distance(letter_case, letter_id):
+    """
+    Calculate the distance between the unicode character and its mapped value
+    (only needs and works with one-to-one mappings).
+
+    :param letter_case: case mappings dictionary which contains the conversions.
+    :param letter_id: An integer, representing the unicode code point of the character.
+    :return: The conversion distance.
+    """
+
+    if letter_id not in letter_case or len(letter_case[letter_id]) > 1:
+        return None
+
+    return ord(letter_case[letter_id]) - letter_id
+
+
+def generate_conversions(script_args):
+    # Read the corresponding unicode values of lower and upper case letters and store these in tables
+    case_mappings = read_case_mappings(script_args.unicode_data, script_args.special_casing)
+    lower_case = case_mappings[0]
+    upper_case = case_mappings[1]
+
+    character_case_ranges = extract_ranges(lower_case, upper_case)
+    character_pair_ranges = extract_character_pair_ranges(lower_case, upper_case)
+    character_pairs = extract_character_pairs(lower_case, upper_case)
+    upper_case_special_ranges = extract_special_ranges(upper_case)
+    lower_case_ranges = extract_ranges(lower_case)
+    lower_case_conversions = extract_conversions(lower_case)
+    upper_case_conversions = extract_conversions(upper_case)
+
+    if lower_case:
+        warnings.warn('Not all elements extracted from the lowercase table!')
+    if upper_case:
+        warnings.warn('Not all elements extracted from the uppercase table!')
+
+    # Generate conversions output
+    c_source = UniCodeSource(CONVERSIONS_C_SOURCE)
+
+    unicode_file = os.path.basename(script_args.unicode_data)
+    spec_casing_file = os.path.basename(script_args.special_casing)
+
+    header_completion = ["/* This file is automatically generated by the %s script" % os.path.basename(__file__),
+                         " * from %s and %s files. Do not edit! */" % (unicode_file, spec_casing_file),
+                         ""]
+
+    c_source.complete_header("\n".join(header_completion))
+
+    c_source.add_table(character_case_ranges[0],
+                       "character_case_ranges",
+                       "uint16_t",
+                       ("/* Contains start points of character case ranges "
+                        "(these are bidirectional conversions). */"))
+
+    c_source.add_table(character_case_ranges[1],
+                       "character_case_range_lengths",
+                       "uint8_t",
+                       "/* Interval lengths of start points in `character_case_ranges` table. */")
+
+    c_source.add_table(character_pair_ranges[0],
+                       "character_pair_ranges",
+                       "uint16_t",
+                       "/* Contains the start points of bidirectional conversion ranges. */")
+
+    c_source.add_table(character_pair_ranges[1],
+                       "character_pair_range_lengths",
+                       "uint8_t",
+                       "/* Interval lengths of start points in `character_pair_ranges` table. */")
+
+    c_source.add_table(character_pairs,
+                       "character_pairs",
+                       "uint16_t",
+                       "/* Contains lower/upper case bidirectional conversion pairs. */")
+
+    c_source.add_table(upper_case_special_ranges[0],
+                       "upper_case_special_ranges",
+                       "uint16_t",
+                       ("/* Contains start points of one-to-two uppercase ranges where the second character\n"
+                        " * is always the same.\n"
+                        " */"))
+
+    c_source.add_table(upper_case_special_ranges[1],
+                       "upper_case_special_range_lengths",
+                       "uint8_t",
+                       "/* Interval lengths for start points in `upper_case_special_ranges` table. */")
+
+    c_source.add_table(lower_case_ranges[0],
+                       "lower_case_ranges",
+                       "uint16_t",
+                       "/* Contains start points of lowercase ranges. */")
+
+    c_source.add_table(lower_case_ranges[1],
+                       "lower_case_range_lengths",
+                       "uint8_t",
+                       "/* Interval lengths for start points in `lower_case_ranges` table. */")
+
+    c_source.add_table(lower_case_conversions[0],
+                       "lower_case_conversions",
+                       "uint16_t",
+                       ("/* The remaining lowercase conversions. The lowercase variant can "
+                        "be one-to-three character long. */"))
+
+    c_source.add_table(lower_case_conversions[1],
+                       "lower_case_conversion_counters",
+                       "uint8_t",
+                       "/* Number of one-to-one, one-to-two, and one-to-three lowercase conversions. */")
+
+    c_source.add_table(upper_case_conversions[0],
+                       "upper_case_conversions",
+                       "uint16_t",
+                       ("/* The remaining uppercase conversions. The uppercase variant can "
+                        "be one-to-three character long. */"))
+
+    c_source.add_table(upper_case_conversions[1],
+                       "upper_case_conversion_counters",
+                       "uint8_t",
+                       "/* Number of one-to-one, one-to-two, and one-to-three uppercase conversions. */")
+
+    c_source.generate()
+
+
+# entry point
+
+
+def main():
+    parser = argparse.ArgumentParser(description='lit-unicode-{conversions,ranges}.inc.h generator',
+                                     epilog='''
+                                        The input files (UnicodeData.txt, SpecialCasing.txt)
+                                        must be retrieved from
+                                        http://www.unicode.org/Public/<VERSION>/ucd/.
+                                        The last known good version is 9.0.0.
+                                        ''')
+
+    parser.add_argument('--unicode-data', metavar='FILE', action='store', required=True,
+                        help='specify the unicode data file')
+    parser.add_argument('--special-casing', metavar='FILE', action='store', required=True,
+                        help='specify the special casing file')
+
+    script_args = parser.parse_args()
+
+    if not os.path.isfile(script_args.unicode_data) or not os.access(script_args.unicode_data, os.R_OK):
+        parser.error('The %s file is missing or not readable!' % script_args.unicode_data)
+
+    if not os.path.isfile(script_args.special_casing) or not os.access(script_args.special_casing, os.R_OK):
+        parser.error('The %s file is missing or not readable!' % script_args.special_casing)
+
+    generate_ranges(script_args)
+    generate_conversions(script_args)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/deps/jerry/tools/gen_c_source.py b/deps/jerry/tools/gen_c_source.py
new file mode 100644 (file)
index 0000000..7dd0c2e
--- /dev/null
@@ -0,0 +1,51 @@
+# 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.
+
+
+LICENSE = """/* 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.
+ */"""
+
+
+def format_code(code, indent, digit_number=4):
+    def regroup(list_to_group, num):
+        return [list_to_group[i:i+num] for i in range(0, len(list_to_group), num)]
+
+    def hex_format(char, digit_number):
+        if isinstance(char, str):
+            char = ord(char)
+
+        return ("0x{:0%sx}" % digit_number).format(char)
+
+    lines = []
+
+    nums_per_line = 10
+    width = nums_per_line * (digit_number + 4)
+    # convert all characters to hex format
+    converted_code = [hex_format(char, digit_number) for char in code]
+    # 10 hex number per line
+    for line in regroup(", ".join(converted_code), width):
+        lines.append(('  ' * indent) + line.strip())
+    return "\n".join(lines)
diff --git a/deps/jerry/tools/generator.sh b/deps/jerry/tools/generator.sh
new file mode 100755 (executable)
index 0000000..c482121
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# 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.
+
+echo "#define JERRY_MCU_SCRIPT \\" > $2
+# escape all " characters, wrap each line in double quotes and end the line with '\'
+sed 's/"/\\"/g' $1 | sed 's/^.*$/"\0" \\/g' >> $2
+echo >> $2
diff --git a/deps/jerry/tools/js2c.py b/deps/jerry/tools/js2c.py
new file mode 100755 (executable)
index 0000000..63733bc
--- /dev/null
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+
+# 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.
+#
+#  This file converts ./js/*.js to a C-array in ./source/jerry-targetjs.h file
+
+import argparse
+import glob
+import os
+import re
+
+from gen_c_source import LICENSE, format_code
+
+
+HEADER = '''#ifndef JERRY_TARGETJS_H
+#define JERRY_TARGETJS_H
+'''
+
+FOOTER = '''
+#endif
+'''
+
+NATIVE_STRUCT = '''
+struct js_source_all {
+  const char* name;
+  const char* source;
+  const int length;
+};
+
+#define DECLARE_JS_CODES \\
+struct js_source_all js_codes[] = \\
+{ \\'''
+
+
+def extract_name(path):
+    special_chars = re.compile(r'[-\\?\'".]')
+    return special_chars.sub('_', os.path.splitext(os.path.basename(path))[0])
+
+
+def reduce_code(code):
+    code = re.sub(r"/\*.*?\*/", "", code, flags=re.DOTALL)  # remove all occurance streamed comments
+    code = re.sub(r"//.*?\n", "", code)  # remove all occurance singleline comments
+    code = re.sub('\n+', '\n', re.sub('\n +', '\n', code))  # remove white spaces
+    return code
+
+
+def js_to_native_code(path, name, build_type):
+    with open(path, 'r') as js_source:
+        code = js_source.read()
+
+    if build_type != 'debug':
+        code = reduce_code(code)
+
+    data = format_code(code, 1, 2)
+
+    native_code = """const static char {0}_n[] = "{0}";
+const static char {0}_s[] =
+{{
+{1}
+}};
+const static int {0}_l = {2};
+""".format(name, data, len(code))
+
+    return native_code
+
+
+def main():
+    parser = argparse.ArgumentParser(description="js2c")
+    parser.add_argument('--build-type', help='build type', default='release', choices=['release', 'debug'])
+    parser.add_argument('--ignore', help='files to ignore', dest='ignore_files', default=[], action='append')
+    parser.add_argument('--no-main',
+                        help="don't require a 'main.js' file",
+                        dest='main',
+                        action='store_false',
+                        default=True)
+    parser.add_argument('--js-source',
+                        dest='js_source_path',
+                        default='./js',
+                        help='Source directory of JavaScript files" (default: %(default)s)')
+    parser.add_argument('--dest',
+                        dest='output_path',
+                        default='./source',
+                        help="Destination directory of 'jerry-targetjs.h' (default: %(default)s)")
+
+    script_args = parser.parse_args()
+
+    gen_line = "/* This file is generated by %s. Please do not modify. */" % os.path.basename(__file__)
+
+    gen_output = [LICENSE, "", gen_line, "", HEADER]
+    gen_structs = [NATIVE_STRUCT]
+
+    if script_args.main:
+        gen_structs.append('  {{ {0}_n, {0}_s, {0}_l }}, \\'.format("main"))
+
+    files = glob.glob(os.path.join(script_args.js_source_path, '*.js'))
+
+    for path in files:
+        if os.path.basename(path) not in script_args.ignore_files:
+            name = extract_name(path)
+            gen_output.append(js_to_native_code(path, name, script_args.build_type))
+            if name != 'main':
+                gen_structs.append('  {{ {0}_n, {0}_s, {0}_l }}, \\'.format(name))
+
+    gen_structs.append('  { NULL, NULL, 0 } \\\n};')
+
+    gen_output.append("\n".join(gen_structs))
+    gen_output.append(FOOTER)
+
+    with open(os.path.join(script_args.output_path, 'jerry-targetjs.h'), 'w') as gen_file:
+        gen_file.write("\n".join(gen_output))
+
+
+if __name__ == "__main__":
+    main()
diff --git a/deps/jerry/tools/make-log-perf-compare.sh b/deps/jerry/tools/make-log-perf-compare.sh
new file mode 100755 (executable)
index 0000000..5731045
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# 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.
+
+commit_first=$1
+shift
+
+commit_second=$1
+shift
+
+exceptions="-e '' $*"
+
+if [[ "$commit_first" == "" ]] || [[ "$commit_second" == "" ]]
+then
+  exit 1
+fi
+
+perf_first=`git notes --ref=arm-linux-perf show $commit_first | grep -v $exceptions`
+if [ $? -ne 0 ]
+then
+  exit 1
+fi
+
+perf_second=`git notes --ref=arm-linux-perf show $commit_second | grep -v $exceptions`
+if [ $? -ne 0 ]
+then
+  exit 1
+fi
+
+n=0
+rel_mult=1.0
+for bench in `echo "$perf_first" | cut -d ':' -f 1`
+do
+  value1=`echo "$perf_first" | grep "^$bench: " | cut -d ':' -f 2 | cut -d 's' -f 1`
+  value2=`echo "$perf_second" | grep "^$bench: " | cut -d ':' -f 2 | cut -d 's' -f 1`
+  rel=`echo $value1 $value2 | awk '{print $2 / $1; }'`
+  percent=`echo $rel | awk '{print (1.0 - $1) * 100; }'`
+
+  n=`echo $n | awk '{print $1 + 1;}'`;
+  rel_mult=`echo $rel_mult $rel | awk '{print $1 * $2;}'`
+
+  echo $bench":"$value1"s ->"$value2"s ("$percent" %)"
+done
+
+rel_gmean=`echo $rel_mult $n | awk '{print $1 ^ (1.0 / $2);}'`
+percent_gmean=`echo $rel_gmean | awk '{print (1.0 - $1) * 100;}'`
+
+echo
+echo $n $rel_mult $rel_gmean "("$percent_gmean "%)"
diff --git a/deps/jerry/tools/mem-stats-measure.sh b/deps/jerry/tools/mem-stats-measure.sh
new file mode 100755 (executable)
index 0000000..333f6ac
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# 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.
+
+JERRY=$1
+TEST=$2
+
+MEM_PEAK=`$JERRY $TEST --mem-stats | grep "Peak allocated =" | awk '{print $4}'`
+
+echo $MEM_PEAK
diff --git a/deps/jerry/tools/perf.sh b/deps/jerry/tools/perf.sh
new file mode 100755 (executable)
index 0000000..7b4f1fd
--- /dev/null
@@ -0,0 +1,195 @@
+#!/bin/bash
+
+# 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.
+
+ITERS="$1"
+ENGINE="$2"
+BENCHMARK="$3"
+PRINT_MIN="$4"
+OS=`uname -s | tr [:upper:] [:lower:]`
+
+if [ "$OS" == "darwin" ]
+then
+  time_regexp='s/user[         ]*\([0-9]*\)m\([0-9.]*\)s/\1 \2/g'
+else
+  time_regexp='s/user[ \t]*\([0-9]*\)m\([0-9.]*\)s/\1 \2/g'
+fi
+
+perf_values=$( (( for i in `seq 1 1 $ITERS`; do time $ENGINE "$BENCHMARK"; if [ $? -ne 0 ]; then exit 1; fi; done ) 2>&1 ) | \
+               grep user | \
+               sed "$time_regexp" | \
+               awk '{ print ($1 * 60 + $2); }';
+               if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1; fi; );
+
+if [ "$PRINT_MIN" == "-min" ]
+then
+  perf_values=$( echo "$perf_values" | \
+                 awk "BEGIN {
+                        min_v = -1;
+                      }
+                      {
+                        if (min_v == -1 || $1 < min_v) {
+                          min_v = $1;
+                        }
+                      }
+                      END {
+                        print min_v
+                      }" || exit 1;
+               );
+  calc_status=$?
+else
+  perf_values=$( echo "$perf_values" | \
+                 awk "BEGIN {
+                        n = 0
+                      }
+                      {
+                        n++
+                        a[n] = \$1
+                      }
+                      END {
+                        #
+                        # Values of 99% quantiles of two-sided t-distribution for given number of degrees of freedom
+                        #
+                        t_gamma_n_m1 [1]  = 63.657
+                        t_gamma_n_m1 [2]  = 9.9248
+                        t_gamma_n_m1 [3]  = 5.8409
+                        t_gamma_n_m1 [4]  = 4.6041
+                        t_gamma_n_m1 [5]  = 4.0321
+                        t_gamma_n_m1 [6]  = 3.7074
+                        t_gamma_n_m1 [7]  = 3.4995
+                        t_gamma_n_m1 [8]  = 3.3554
+                        t_gamma_n_m1 [9]  = 3.2498
+                        t_gamma_n_m1 [10] = 3.1693
+                        t_gamma_n_m1 [11] = 3.1058
+                        t_gamma_n_m1 [12] = 3.0545
+                        t_gamma_n_m1 [13] = 3.0123
+                        t_gamma_n_m1 [14] = 2.9768
+                        t_gamma_n_m1 [15] = 2.9467
+                        t_gamma_n_m1 [16] = 2.9208
+                        t_gamma_n_m1 [17] = 2.8982
+                        t_gamma_n_m1 [18] = 2.8784
+                        t_gamma_n_m1 [19] = 2.8609
+                        t_gamma_n_m1 [20] = 2.8453
+                        t_gamma_n_m1 [21] = 2.8314
+                        t_gamma_n_m1 [22] = 2.8188
+                        t_gamma_n_m1 [23] = 2.8073
+                        t_gamma_n_m1 [24] = 2.7969
+                        t_gamma_n_m1 [25] = 2.7874
+                        t_gamma_n_m1 [26] = 2.7787
+                        t_gamma_n_m1 [27] = 2.7707
+                        t_gamma_n_m1 [28] = 2.7633
+                        t_gamma_n_m1 [29] = 2.7564
+                        t_gamma_n_m1 [30] = 2.75
+                        t_gamma_n_m1 [31] = 2.744
+                        t_gamma_n_m1 [32] = 2.7385
+                        t_gamma_n_m1 [33] = 2.7333
+                        t_gamma_n_m1 [34] = 2.7284
+                        t_gamma_n_m1 [35] = 2.7238
+                        t_gamma_n_m1 [36] = 2.7195
+                        t_gamma_n_m1 [37] = 2.7154
+                        t_gamma_n_m1 [38] = 2.7116
+                        t_gamma_n_m1 [39] = 2.7079
+                        t_gamma_n_m1 [40] = 2.7045
+                        t_gamma_n_m1 [41] = 2.7012
+                        t_gamma_n_m1 [42] = 2.6981
+                        t_gamma_n_m1 [43] = 2.6951
+                        t_gamma_n_m1 [44] = 2.6923
+                        t_gamma_n_m1 [45] = 2.6896
+                        t_gamma_n_m1 [46] = 2.687
+                        t_gamma_n_m1 [47] = 2.6846
+                        t_gamma_n_m1 [48] = 2.6822
+                        t_gamma_n_m1 [49] = 2.68
+                        t_gamma_n_m1 [50] = 2.6778
+
+                        #
+                        # Sort array of measurements
+                        #
+                        for (i = 2; i <= n; i++) {
+                          j = i
+                          k = a [j]
+                          while (j > 1 && a [j - 1] > k) {
+                            a [j] = a [j - 1]
+                            j--
+                          }
+                          a [j] = k
+                        }
+
+                        #
+                        # Remove 20% of lowest and 20% of highest values
+                        #
+                        n_20_percent = int (n / 5)
+
+                        for (i = 1; i <= n_20_percent; i++) {
+                          delete a[n]
+                          n--
+                        }
+
+                        for (i = 1; i <= n - n_20_percent; i++) {
+                          a[i] = a[i + n_20_percent]
+                        }
+
+                        n -= n_20_percent
+
+                        #
+                        # Calculate average
+                        #
+                        sum = 0
+                        for (i = 1; i <= n; i++) {
+                          sum += a[i]
+                        }
+
+                        avg = sum / n
+
+                        if (n > 1) {
+                          if (n - 1 <= 50) {
+                            t_coef = t_gamma_n_m1 [n - 1]
+                          } else {
+                            # For greater degrees of freedom, values of corresponding quantiles
+                            # are insignificantly less than the value.
+                            #
+                            # For example, the value for infinite number of freedoms is 2.5758
+                            #
+                            # So, to reduce table size, we take this, greater value,
+                            # overestimating inaccuracy for no more than 4%.
+                            #
+                            t_coef = t_gamma_n_m1 [50]
+                          }
+
+                          #
+                          # Calculate inaccuracy estimation
+                          #
+                          sum_delta_squares = 0
+                          for (i = 1; i <= n; i++) {
+                            sum_delta_squares += (avg - a[i]) ^ 2
+                          }
+
+                          delta = t_coef * sqrt (sum_delta_squares / (n * (n - 1)))
+
+                          print avg, delta
+                        } else {
+                          print avg
+                        }
+                      }
+                      " || exit 1;
+               );
+  calc_status=$?
+fi
+
+echo "$perf_values"
+
+if [ $? -ne 0 ];
+then
+  exit 1;
+fi;
diff --git a/deps/jerry/tools/pylint/pylintrc b/deps/jerry/tools/pylint/pylintrc
new file mode 100644 (file)
index 0000000..b228b07
--- /dev/null
@@ -0,0 +1,378 @@
+[MASTER]
+
+# Specify a configuration file.
+#rcfile=
+
+# Python code to execute, usually for sys.path manipulation such as
+# pygtk.require().
+#init-hook=
+
+# Add files or directories to the blacklist. They should be base names, not
+# paths.
+ignore=CVS
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+# Use multiple processes to speed up Pylint.
+jobs=1
+
+# Allow loading of arbitrary C extensions. Extensions are imported into the
+# active Python interpreter and may run arbitrary code.
+unsafe-load-any-extension=no
+
+# A comma-separated list of package or module names from where C extensions may
+# be loaded. Extensions are loading into the active Python interpreter and may
+# run arbitrary code
+extension-pkg-whitelist=
+
+# Allow optimization of some AST trees. This will activate a peephole AST
+# optimizer, which will apply various small optimizations. For instance, it can
+# be used to obtain the result of joining multiple strings with the addition
+# operator. Joining a lot of strings can lead to a maximum recursion error in
+# Pylint and this flag can prevent that. It has one side effect, the resulting
+# AST will be different than the one from reality.
+optimize-ast=no
+
+
+[MESSAGES CONTROL]
+
+# Only show warnings with the listed confidence levels. Leave empty to show
+# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
+confidence=
+
+# Enable the message, report, category or checker with the given id(s). You can
+# either give multiple identifier separated by comma (,) or put this option
+# multiple time. See also the "--disable" option for examples.
+#enable=
+
+# Disable the message, report, category or checker with the given id(s). You
+# can either give multiple identifiers separated by comma (,) or put this
+# option multiple times (only on the command line, not in the configuration
+# file where it should appear only once).You can also use "--disable=all" to
+# disable everything first and then reenable specific checks. For example, if
+# you want to run only the similarities checker, you can use "--disable=all
+# --enable=similarities". If you want to run only the classes checker, but have
+# no Warning level messages displayed, use"--disable=all --enable=classes
+# --disable=W"
+disable=import-star-module-level,old-octal-literal,oct-method,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,missing-docstring
+
+
+[REPORTS]
+
+# Set the output format. Available formats are text, parseable, colorized, msvs
+# (visual studio) and html. You can also give a reporter class, eg
+# mypackage.mymodule.MyReporterClass.
+output-format=text
+
+# Put messages in a separate file for each module / package specified on the
+# command line instead of printing them on stdout. Reports (if any) will be
+# written in a file name "pylint_global.[txt|html]".
+files-output=no
+
+# Tells whether to display a full report or only the messages
+reports=no
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note). You have access to the variables errors warning, statement which
+# respectively contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (RP0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Template used to display messages. This is a python new-style format string
+# used to format the message information. See doc for all details
+#msg-template=
+
+
+[TYPECHECK]
+
+# Tells whether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# List of module names for which member attributes should not be checked
+# (useful for modules/projects where namespaces are manipulated during runtime
+# and thus existing member attributes cannot be deduced by static analysis. It
+# supports qualified module names, as well as Unix pattern matching.
+ignored-modules=
+
+# List of classes names for which member attributes should not be checked
+# (useful for classes with attributes dynamically set). This supports can work
+# with qualified names.
+ignored-classes=
+
+# List of members which are set dynamically and missed by pylint inference
+# system, and so shouldn't trigger E1101 when accessed. Python regular
+# expressions are accepted.
+generated-members=
+
+
+[FORMAT]
+
+# Maximum number of characters on a single line.
+max-line-length=120
+
+# Regexp for a line that is allowed to be longer than the limit.
+ignore-long-lines=^\s*(# )?<?https?://\S+>?$
+
+# Allow the body of an if to be on the same line as the test if there is no
+# else.
+single-line-if-stmt=no
+
+# List of optional constructs for which whitespace checking is disabled. `dict-
+# separator` is used to allow tabulation in dicts, etc.: {1  : 1,\n222: 2}.
+# `trailing-comma` allows a space between comma and closing bracket: (a, ).
+# `empty-line` allows space-only lines.
+no-space-check=trailing-comma,dict-separator
+
+# Maximum number of lines in a module
+max-module-lines=1000
+
+# String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1
+# tab).
+indent-string='    '
+
+# Number of spaces of indent required inside a hanging  or continued line.
+indent-after-paren=4
+
+# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
+expected-line-ending-format=
+
+
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,XXX,TODO
+
+
+[SPELLING]
+
+# Spelling dictionary name. Available dictionaries: none. To make it working
+# install python-enchant package.
+spelling-dict=
+
+# List of comma separated words that should not be checked.
+spelling-ignore-words=
+
+# A path to a file that contains private dictionary; one word per line.
+spelling-private-dict-file=
+
+# Tells whether to store unknown words to indicated private dictionary in
+# --spelling-private-dict-file option instead of raising a message.
+spelling-store-unknown-words=no
+
+
+[VARIABLES]
+
+# Tells whether we should check for unused import in __init__ files.
+init-import=no
+
+# A regular expression matching the name of dummy variables (i.e. expectedly
+# not used).
+dummy-variables-rgx=_$|dummy
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+# List of strings which can identify a callback function by name. A callback
+# name must start or end with one of those strings.
+callbacks=cb_,_cb
+
+
+[BASIC]
+
+# List of builtins function names that should not be used, separated by a comma
+bad-functions=map,filter,input
+
+# Good variable names which should always be accepted, separated by a comma
+good-names=i,j,k,ex,Run,_
+
+# Bad variable names which should always be refused, separated by a comma
+bad-names=foo,bar,baz,toto,tutu,tata
+
+# Colon-delimited sets of names that determine each other's naming style when
+# the name regexes allow several styles.
+name-group=
+
+# Include a hint for the correct naming format with invalid-name
+include-naming-hint=no
+
+# Regular expression matching correct function names
+function-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Naming hint for function names
+function-name-hint=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression matching correct variable names
+variable-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Naming hint for variable names
+variable-name-hint=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression matching correct constant names
+const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
+
+# Naming hint for constant names
+const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
+
+# Regular expression matching correct attribute names
+attr-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Naming hint for attribute names
+attr-name-hint=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression matching correct argument names
+argument-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Naming hint for argument names
+argument-name-hint=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression matching correct class attribute names
+class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
+
+# Naming hint for class attribute names
+class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
+
+# Regular expression matching correct inline iteration names
+inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
+
+# Naming hint for inline iteration names
+inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
+
+# Regular expression matching correct class names
+class-rgx=[A-Z_][a-zA-Z0-9]+$
+
+# Naming hint for class names
+class-name-hint=[A-Z_][a-zA-Z0-9]+$
+
+# Regular expression matching correct module names
+module-rgx=(([a-z_][a-z0-9_-]*)|([A-Z][a-zA-Z0-9]+))$
+
+# Naming hint for module names
+module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
+
+# Regular expression matching correct method names
+method-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Naming hint for method names
+method-name-hint=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression which should only match function or class names that do
+# not require a docstring.
+no-docstring-rgx=^_
+
+# Minimum line length for functions/classes that require docstrings, shorter
+# ones are exempt.
+docstring-min-length=-1
+
+
+[ELIF]
+
+# Maximum number of nested blocks for function / method body
+max-nested-blocks=5
+
+
+[LOGGING]
+
+# Logging modules to check that the string format arguments are in logging
+# function parameter format
+logging-modules=logging
+
+
+[SIMILARITIES]
+
+# Minimum lines number of a similarity.
+min-similarity-lines=4
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
+
+# Ignore imports when computing similarities.
+ignore-imports=no
+
+
+[DESIGN]
+
+# Maximum number of arguments for function / method
+max-args=5
+
+# Argument names that match this expression will be ignored. Default to name
+# with leading underscore
+ignored-argument-names=_.*
+
+# Maximum number of locals for function / method body
+max-locals=15
+
+# Maximum number of return / yield for function / method body
+max-returns=6
+
+# Maximum number of branch for function / method body
+max-branches=15
+
+# Maximum number of statements in function / method body
+max-statements=50
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=7
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=2
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=20
+
+# Maximum number of boolean expressions in a if statement
+max-bool-expr=5
+
+
+[IMPORTS]
+
+# Deprecated modules which should not be used, separated by a comma
+deprecated-modules=regsub,TERMIOS,Bastion,rexec
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report RP0402 must not be disabled)
+import-graph=
+
+# Create a graph of external dependencies in the given file (report RP0402 must
+# not be disabled)
+ext-import-graph=
+
+# Create a graph of internal dependencies in the given file (report RP0402 must
+# not be disabled)
+int-import-graph=
+
+
+[CLASSES]
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,__new__,setUp
+
+# List of valid names for the first argument in a class method.
+valid-classmethod-first-arg=cls
+
+# List of valid names for the first argument in a metaclass class method.
+valid-metaclass-classmethod-first-arg=mcs
+
+# List of member names, which should be excluded from the protected access
+# warning.
+exclude-protected=_asdict,_fields,_replace,_source,_make
+
+
+[EXCEPTIONS]
+
+# Exceptions that will emit a warning when being caught. Defaults to
+# "Exception"
+overgeneral-exceptions=Exception
diff --git a/deps/jerry/tools/rss-measure.sh b/deps/jerry/tools/rss-measure.sh
new file mode 100755 (executable)
index 0000000..02a27d2
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# 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.
+
+JERRY=$1
+TEST=$2
+SLEEP=0.1
+OS=`uname -s | tr [:upper:] [:lower:]`
+
+Rss_OUT=""
+
+function collect_entry()
+{
+  OUT_NAME="$1_OUT";
+  OUT=$OUT_NAME;
+
+  if [ "$OS" == "darwin" ]
+  then
+    SUM=`ps -o rss $PID | grep [0-9]`
+  else
+    SUM=$(grep -o -e "^[0-9a-f][0-9a-f]*.*" -e "^Rss.*" /proc/$PID/smaps 2>/dev/null | grep -A 1 -- "r[w-]-p " | grep "^Rss"|awk '{s += $2;} END {print s;}')
+  fi;
+
+  if [ "$SUM" != "" ];
+  then
+    eval "$OUT=\"\$$OUT $SUM\\n\"";
+  fi;
+}
+
+function print_entry()
+{
+  OUT_NAME="$1_OUT";
+  OUT=$OUT_NAME;
+
+  eval "echo -e \"\$$OUT\"" | awk -v entry="$1" '{ if ($1 != "") { n += 1; if ($1 > max) { max = $1; } } } END { if (n == 0) { exit; }; printf "%d\n",  max; }';
+}
+
+function run_test()
+{
+  $JERRY $TEST &
+  PID=$!
+
+  while kill -0 "$PID" > /dev/null 2>&1;
+  do
+    collect_entry Rss
+
+    sleep $SLEEP
+  done
+
+  wait "$PID" || exit 1
+}
+
+run_test
+
+print_entry Rss
diff --git a/deps/jerry/tools/run-mem-stats-test.sh b/deps/jerry/tools/run-mem-stats-test.sh
new file mode 100755 (executable)
index 0000000..549d6a0
--- /dev/null
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+# 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.
+
+# Choosing table or semicolon-separated output mode
+if [ "$1" == "-d" ]
+then
+  TABLE="no"
+  PRINT_TEST_NAME_AWK_SCRIPT='{printf "%s;", $1}'
+  PRINT_TOTAL_AWK_SCRIPT='{printf "%d;%d;%d\n", $1, $2, $3 * 1024}'
+
+  shift
+else
+  PRINT_TEST_NAME_AWK_SCRIPT='{printf "%30s", $1}'
+  PRINT_TOTAL_AWK_SCRIPT='{printf "%25d%25d%25d\n", $1, $2, $3 * 1024}'
+  TABLE="yes"
+fi
+
+function fail_msg
+{
+  echo "$1"
+  exit 1
+}
+
+# Engine
+
+# Check if the specified build supports memory statistics options
+function is_mem_stats_build
+{
+  [ -x "$1" ] || fail_msg "Engine '$1' is not executable"
+
+  tmpfile=`mktemp`
+  "$1" --mem-stats $tmpfile 2>&1 | grep -- "Ignoring JERRY_INIT_MEM_STATS flag because of !JMEM_STATS configuration." 2>&1 > /dev/null
+  code=$?
+  rm $tmpfile
+
+  return $code
+}
+
+JERRY="$1"
+shift
+is_mem_stats_build "$JERRY" || fail_msg "First engine specified should be built without memory statistics support"
+
+JERRY_MEM_STATS="$1"
+shift
+is_mem_stats_build "$JERRY_MEM_STATS" && fail_msg "Second engine specified should be built with memory statistics support"
+
+# Benchmarks list
+BENCHMARKS=""
+
+while [ $# -ne 0 ]
+do
+  BENCHMARKS="$BENCHMARKS $1"
+  shift
+done
+
+# Running
+if [ "$TABLE" == "yes" ]
+then
+  awk 'BEGIN {printf "%30s%25s%25s%25s\n", "Test name", "Peak Heap (parser)", "Peak Heap (execution)", "Maximum RSS"}'
+  echo
+fi
+
+for bench in $BENCHMARKS
+do
+  test=`basename $bench .js`
+
+  echo "$test" | awk "$PRINT_TEST_NAME_AWK_SCRIPT"
+  MEM_STATS=$("$JERRY_MEM_STATS" --mem-stats --mem-stats-separate $bench | grep -e "Peak allocated =" | grep -o "[0-9]*")
+  RSS=$(./tools/rss-measure.sh "$JERRY" $bench | tail -n 1 | grep -o "[0-9]*")
+  echo $MEM_STATS $RSS | xargs | awk "$PRINT_TOTAL_AWK_SCRIPT"
+done
diff --git a/deps/jerry/tools/run-perf-test.sh b/deps/jerry/tools/run-perf-test.sh
new file mode 100755 (executable)
index 0000000..835cebc
--- /dev/null
@@ -0,0 +1,348 @@
+#!/bin/bash
+
+# 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.
+
+trap "exit 2" INT
+
+function pr_err() {
+  echo -e "\e[91mError: $@\e[39m"
+}
+
+function exit_err() {
+  pr_err $@
+
+  exit 1
+}
+
+# Check if the specified build supports memory statistics options
+function is_mem_stats_build() {
+  [ -x "$1" ] || fail_msg "Engine '$1' is not executable"
+
+  tmpfile=`mktemp`
+  "$1" --mem-stats $tmpfile 2>&1 | grep -- "Ignoring JERRY_INIT_MEM_STATS flag because of !JMEM_STATS configuration." 2>&1 > /dev/null
+  code=$?
+  rm $tmpfile
+
+  return $code
+}
+
+USAGE="Usage:\n    tools/run-perf-test.sh OLD_ENGINE NEW_ENGINE REPEATS TIMEOUT BENCH_FOLDER [-m result-file-name.md]"
+
+if [ "$#" -lt 5 ]
+then
+  echo -e "${USAGE}"
+  exit_err "Argument number mismatch..."
+fi
+
+ENGINE_OLD="$1"
+ENGINE_NEW="$2"
+REPEATS="$3"
+TIMEOUT="$4"
+BENCH_FOLDER="$5"
+OUTPUT_FORMAT="$6"
+OUTPUT_FILE="$7"
+
+if [ "$#" -gt 5 ]
+then
+  if [ "${OUTPUT_FORMAT}" != "-m" ]
+  then
+    exit_err "Please, use '-m result-file-name.md' as last arguments"
+  fi
+  if [ -z "${OUTPUT_FILE}" ]
+  then
+    exit_err "Missing md file name. Please, define the filename. Ex.: '-m result-file-name.md'"
+  fi
+
+  rm -rf "${OUTPUT_FILE}"
+fi
+
+if [ "${REPEATS}" -lt 1 ]
+then
+  exit_err "REPEATS must be greater than 0"
+fi
+
+if [ "${TIMEOUT}" -lt 1 ]
+then
+  exit_err "TIMEOUT must be greater than 0"
+fi
+
+perf_n=0
+mem_n=0
+
+perf_rel_mult=1.0
+perf_rel_inaccuracy_tmp=0
+mem_rel_mult=1.0
+mem_rel_inaccuracy_tmp="-1"
+
+# Unicode "figure space" character
+FIGURE_SPACE=$(echo -e -n "\xE2\x80\x87")
+
+# Unicode "approximately equal" character
+APPROXIMATELY_EQUAL=$(echo -n -e "\xE2\x89\x88")
+
+function run-compare()
+{
+  COMMAND=$1
+  PRE=$2
+  TEST=$3
+  PRECISION=$4
+  UNIT=$5
+
+  ABS_FP_FMT="%$((PRECISION + 4)).$((PRECISION))f$UNIT"
+  REL_FP_FMT="%0.3f"
+  REL_SHOW_PLUS_SIGN_FP_FMT="%+0.3f"
+
+  OLD=$(timeout "${TIMEOUT}" ${COMMAND} "${ENGINE_OLD}" "${TEST}") || return 1
+  NEW=$(timeout "${TIMEOUT}" ${COMMAND} "${ENGINE_NEW}" "${TEST}") || return 1
+
+  #check result
+  ! $OLD || ! $NEW || return 1
+
+  OLD_value=$(echo "$OLD " | cut -d ' ' -f 1)
+  OLD_inaccuracy=$(echo "$OLD " | cut -d ' ' -f 2)
+
+  NEW_value=$(echo "$NEW " | cut -d ' ' -f 1)
+  NEW_inaccuracy=$(echo "$NEW " | cut -d ' ' -f 2)
+
+  #calc relative speedup
+  eval "rel_mult=\$${PRE}_rel_mult"
+
+  rel=$(echo "${OLD_value}" "${NEW_value}" | awk '{ print $2 / $1; }')
+
+  #increment n
+  ((${PRE}_n++))
+
+  #calc percent to display
+  PERCENT=$(echo "$rel" | awk '{print (1.0 - $1) * 100; }')
+
+  if [[ "$OLD_inaccuracy" != "" && "$NEW_inaccuracy" != "" ]]
+  then
+    DIFF=$(printf "$ABS_FP_FMT -> $ABS_FP_FMT" $OLD_value $NEW_value)
+    rel_inaccuracy=$(echo "$OLD_value $OLD_inaccuracy $NEW_value $NEW_inaccuracy" | \
+                     awk "{
+                            OLD_value=\$1
+                            OLD_inaccuracy=\$2
+                            NEW_value=\$3
+                            NEW_inaccuracy=\$4
+
+                            rel_inaccuracy = (NEW_value / OLD_value) * sqrt ((OLD_inaccuracy / OLD_value) ^ 2 + (NEW_inaccuracy / NEW_value) ^ 2)
+                            if (rel_inaccuracy < 0) {
+                              rel_inaccuracy = -rel_inaccuracy
+                            }
+
+                            print rel_inaccuracy
+                          }")
+    PERCENT_inaccuracy=$(echo "$rel_inaccuracy" | awk '{ print $1 * 100.0 }')
+
+    ext=$(echo "$PERCENT $PERCENT_inaccuracy" | \
+                awk "{
+                       PERCENT=\$1
+                       PERCENT_inaccuracy=\$2
+
+                       if (PERCENT > 0.0 && PERCENT > PERCENT_inaccuracy) {
+                         print \"[+]\"
+                       } else if (PERCENT < 0 && -PERCENT > PERCENT_inaccuracy) {
+                         print \"[-]\"
+                       } else {
+                         print \"[$APPROXIMATELY_EQUAL]\"
+                       }
+                     }")
+
+    if [[ $rel_inaccuracy_tmp -lt 0 ]]
+    then
+      return 1
+    fi
+
+    eval "rel_inaccuracy_tmp=\$${PRE}_rel_inaccuracy_tmp"
+
+    rel_inaccuracy_tmp=$(echo "$rel $rel_inaccuracy $rel_inaccuracy_tmp" | \
+                         awk "{
+                                rel=\$1
+                                rel_inaccuracy=\$2
+                                rel_inaccuracy_tmp=\$3
+                                print rel_inaccuracy_tmp + (rel_inaccuracy / rel) ^ 2
+                              }")
+
+    eval "${PRE}_rel_inaccuracy_tmp=\$rel_inaccuracy_tmp"
+
+    PERCENT=$(printf "%8s %11s" $(printf "$REL_SHOW_PLUS_SIGN_FP_FMT%%" $PERCENT) $(printf "(+-$REL_FP_FMT%%)" $PERCENT_inaccuracy))
+    PERCENT="$PERCENT : $ext"
+
+    if [ "${OUTPUT_FORMAT}" == "-m" ]
+    then
+      WIDTH=42
+      MD_DIFF=$(printf "%s%s" "$DIFF" "$(printf "%$(($WIDTH - ${#DIFF}))s")")
+      MD_PERCENT=$(printf "%s%s" "$(printf "%$(($WIDTH - ${#PERCENT}))s")" "$PERCENT")
+
+      MD_FORMAT="\`%s\`<br>\`%s\`"
+    fi
+
+    CONSOLE_FORMAT="%20s : %19s"
+  else
+    ext=""
+
+    if [[ "$OLD_inaccuracy" != "" || "$NEW_inaccuracy" != "" ]]
+    then
+      return 1;
+    fi
+
+    DIFF=$(printf "$ABS_FP_FMT -> $ABS_FP_FMT" $OLD_value $NEW_value)
+    PERCENT=$(printf "$REL_SHOW_PLUS_SIGN_FP_FMT%%" $PERCENT)
+
+    if [ "${OUTPUT_FORMAT}" == "-m" ]
+    then
+      WIDTH=20
+      MD_DIFF=$(printf "%s%s" "$DIFF" "$(printf "%$(($WIDTH - ${#DIFF}))s")")
+      MD_PERCENT=$(printf "%s%s" "$(printf "%$(($WIDTH - ${#PERCENT}))s")" "$PERCENT")
+
+      MD_FORMAT="\`%s\`<br>\`%s\`"
+    fi
+
+    CONSOLE_FORMAT="%14s : %8s"
+  fi
+
+  rel_mult=$(echo "$rel_mult" "$rel" | awk '{print $1 * $2;}')
+
+  eval "${PRE}_rel_mult=\$rel_mult"
+
+  if [ "${OUTPUT_FORMAT}" == "-m" ]
+  then
+    printf "$MD_FORMAT" "$MD_DIFF" "$MD_PERCENT" | sed "s/ /$FIGURE_SPACE/g" >> "${OUTPUT_FILE}"
+  fi
+
+  printf "$CONSOLE_FORMAT" "$DIFF" "$PERCENT"
+}
+
+function run-test()
+{
+  TEST=$1
+
+  # print only filename
+  if [ "${OUTPUT_FORMAT}" == "-m" ]
+  then
+    printf "%s | " "${TEST##*/}" >> "${OUTPUT_FILE}"
+  fi
+
+  printf "%50s | " "${TEST##*/}"
+
+  if [ "$IS_MEM_STAT" -ne 0 ]
+  then
+    run-compare "./tools/mem-stats-measure.sh"      "mem"   "${TEST}" 0   || return 1
+  else
+    run-compare "./tools/rss-measure.sh"      "mem"   "${TEST}" 0 k || return 1
+  fi
+
+  if [ "${OUTPUT_FORMAT}" == "-m" ]
+  then
+    printf " | " >> "${OUTPUT_FILE}"
+  fi
+
+  printf " | "
+  run-compare "./tools/perf.sh ${REPEATS}"  "perf"  "${TEST}" 3 s || return 1
+
+  if [ "${OUTPUT_FORMAT}" == "-m" ]
+  then
+    printf "\n" >> "${OUTPUT_FILE}"
+  fi
+
+  printf "\n"
+}
+
+function run-suite()
+{
+  FOLDER=$1
+
+  for BENCHMARK in ${FOLDER}/*.js
+  do
+    run-test "${BENCHMARK}" 2> /dev/null || printf "<FAILED>\n" "${BENCHMARK}";
+  done
+}
+
+date
+
+is_mem_stats_build "${ENGINE_OLD}" || is_mem_stats_build "${ENGINE_NEW}"
+IS_MEM_STAT=$?
+
+if [ "${OUTPUT_FORMAT}" == "-m" ]
+then
+  if [ "$IS_MEM_STAT" -ne 0 ]
+  then
+    echo "Benchmark | Peak alloc.<br>(+ is better) | Perf<br>(+ is better)" >> "${OUTPUT_FILE}"
+  else
+    echo "Benchmark | RSS<br>(+ is better) | Perf<br>(+ is better)" >> "${OUTPUT_FILE}"
+  fi
+  echo "---------: | --------- | ---------" >> "${OUTPUT_FILE}"
+fi
+
+if [ "$IS_MEM_STAT" -ne 0 ]
+then
+  printf "%50s | %25s | %35s\n" "Benchmark" "Peak alloc.(+ is better)" "Perf(+ is better)"
+else
+  printf "%50s | %25s | %35s\n" "Benchmark" "RSS(+ is better)" "Perf(+ is better)"
+fi
+
+run-suite "${BENCH_FOLDER}"
+
+mem_rel_gmean=$(echo "$mem_rel_mult" "$mem_n" | awk '{print $1 ^ (1.0 / $2);}')
+mem_percent_gmean=$(echo "$mem_rel_gmean" | awk '{print (1.0 - $1) * 100;}')
+if [[ $mem_rel_inaccuracy_tmp != "-1" ]]
+then
+  exit_err "Incorrect inaccuracy calculation for memory consumption geometric mean"
+fi
+
+perf_rel_gmean=$(echo "$perf_rel_mult" "$perf_n" | awk '{print $1 ^ (1.0 / $2);}')
+perf_percent_gmean=$(echo "$perf_rel_gmean" | awk '{print (1.0 - $1) * 100;}')
+if [[ "$perf_rel_inaccuracy_tmp" == "-1" ]]
+then
+  exit_err "Incorrect inaccuracy calculation for performance geometric mean"
+else
+  perf_percent_inaccuracy=$(echo "$perf_rel_gmean $perf_rel_inaccuracy_tmp $perf_n" | \
+                            awk "{
+                                   perf_rel_gmean=\$1
+                                   perf_rel_inaccuracy_tmp=\$2
+                                   perf_n=\$3
+
+                                   print 100.0 * (perf_rel_gmean ^ (1.0 / perf_n) * sqrt (perf_rel_inaccuracy_tmp) / perf_n)
+                                 }")
+  perf_ext=$(echo "$perf_percent_gmean $perf_percent_inaccuracy" | \
+             awk "{
+                    perf_percent_gmean=\$1
+                    perf_percent_inaccuracy=\$2
+
+                    if (perf_percent_gmean > 0.0 && perf_percent_gmean > perf_percent_inaccuracy) {
+                      print \"[+]\"
+                    } else if (perf_percent_gmean < 0 && -perf_percent_gmean > perf_percent_inaccuracy) {
+                      print \"[-]\"
+                    } else {
+                      print \"[$APPROXIMATELY_EQUAL]\"
+                    }
+                  }")
+  perf_percent_inaccuracy=$(printf "(+-%0.3f%%) : $perf_ext" $perf_percent_inaccuracy)
+fi
+
+gmean_label_text="Geometric mean:"
+
+if [ "${OUTPUT_FORMAT}" == "-m" ]
+then
+  mem_percent_gmean_text=$(printf "RSS reduction: \`%0.3f%%\`" "$mem_percent_gmean")
+  perf_percent_gmean_text=$(printf "Speed up: \`%0.3f%% %s\`" "$perf_percent_gmean" "$perf_percent_inaccuracy")
+  printf "%s | %s | %s\n" "$gmean_label_text" "$mem_percent_gmean_text" "$perf_percent_gmean_text" >> "${OUTPUT_FILE}"
+fi
+
+mem_percent_gmean_text=$(printf "RSS reduction: %0.3f%%" "$mem_percent_gmean")
+perf_percent_gmean_text=$(printf "Speed up: %0.3f%% %s" "$perf_percent_gmean" "$perf_percent_inaccuracy")
+printf "%50s | %25s | %51s\n" "$gmean_label_text" "$mem_percent_gmean_text" "$perf_percent_gmean_text"
+
+date
diff --git a/deps/jerry/tools/run-tests.py b/deps/jerry/tools/run-tests.py
new file mode 100755 (executable)
index 0000000..e05e57f
--- /dev/null
@@ -0,0 +1,388 @@
+#!/usr/bin/env python
+
+# 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.
+
+from __future__ import print_function
+
+import argparse
+import os
+import subprocess
+import sys
+import settings
+
+OUTPUT_DIR = os.path.join(settings.PROJECT_DIR, 'build', 'tests')
+
+class Options(object):
+    def __init__(self, name='', build_args=None, test_args=None):
+        if build_args is None:
+            build_args = []
+
+        if test_args is None:
+            test_args = []
+
+        self.build_args = build_args
+        self.name = name
+        self.test_args = test_args
+
+def get_binary_path(bin_dir_path):
+    return os.path.join(bin_dir_path, 'jerry')
+
+# Test options for unittests
+JERRY_UNITTESTS_OPTIONS = [
+    Options('unittests',
+            ['--unittests', '--jerry-cmdline=off', '--error-messages=on', '--snapshot-save=on', '--snapshot-exec=on', '--vm-exec-stop=on', '--profile=es2015-subset']),
+    Options('unittests-debug',
+            ['--unittests', '--jerry-cmdline=off', '--debug', '--error-messages=on', '--snapshot-save=on', '--snapshot-exec=on', '--vm-exec-stop=on', '--profile=es2015-subset']),
+    Options('doctests',
+            ['--doctests', '--jerry-cmdline=off', '--error-messages=on', '--snapshot-save=on', '--snapshot-exec=on', '--vm-exec-stop=on', '--profile=es2015-subset']),
+    Options('doctests-debug',
+            ['--doctests', '--jerry-cmdline=off', '--debug', '--error-messages=on', '--snapshot-save=on', '--snapshot-exec=on', '--vm-exec-stop=on', '--profile=es2015-subset'])
+]
+
+# Test options for jerry-tests
+JERRY_TESTS_OPTIONS = [
+    Options('jerry_tests'),
+    Options('jerry_tests-debug',
+            ['--debug']),
+    Options('jerry_tests-debug-cpointer_32bit',
+            ['--debug', '--cpointer-32bit=on', '--mem-heap=1024']),
+    Options('jerry_tests-snapshot',
+            ['--snapshot-save=on', '--snapshot-exec=on'],
+            ['--snapshot']),
+    Options('jerry_tests-debug-snapshot',
+            ['--debug', '--snapshot-save=on', '--snapshot-exec=on'],
+            ['--snapshot']),
+    Options('jerry_tests-es2015-subset-debug',
+            ['--debug', '--profile=es2015-subset']),
+    Options('jerry_tests-debug-external-context',
+            ['--debug', '--jerry-libc=off', '--external-context=on'])
+]
+
+# Test options for jerry-test-suite
+JERRY_TEST_SUITE_OPTIONS = JERRY_TESTS_OPTIONS[:]
+JERRY_TEST_SUITE_OPTIONS.extend([
+    Options('jerry_test_suite-minimal',
+            ['--profile=minimal']),
+    Options('jerry_test_suite-minimal-snapshot',
+            ['--profile=minimal', '--snapshot-save=on', '--snapshot-exec=on'],
+            ['--snapshot']),
+    Options('jerry_test_suite-minimal-debug',
+            ['--debug', '--profile=minimal']),
+    Options('jerry_test_suite-minimal-debug-snapshot',
+            ['--debug', '--profile=minimal', '--snapshot-save=on', '--snapshot-exec=on'],
+            ['--snapshot']),
+    Options('jerry_test_suite-es2015-subset',
+            ['--profile=es2015-subset']),
+    Options('jerry_test_suite-es2015-subset-snapshot',
+            ['--profile=es2015-subset', '--snapshot-save=on', '--snapshot-exec=on'],
+            ['--snapshot']),
+    Options('jerry_test_suite-es2015-subset-debug-snapshot',
+            ['--debug', '--profile=es2015-subset', '--snapshot-save=on', '--snapshot-exec=on'],
+            ['--snapshot'])
+])
+
+# Test options for test262
+TEST262_TEST_SUITE_OPTIONS = [
+    Options('test262_tests')
+]
+
+# Test options for jerry-debugger
+DEBUGGER_TEST_OPTIONS = [
+    Options('jerry_debugger_tests',
+            ['--debug', '--jerry-debugger=on', '--jerry-libc=off'])
+]
+
+# Test options for buildoption-test
+JERRY_BUILDOPTIONS = [
+    Options('buildoption_test-lto',
+            ['--lto=on']),
+    Options('buildoption_test-error_messages',
+            ['--error-messages=on']),
+    Options('buildoption_test-all_in_one',
+            ['--all-in-one=on']),
+    Options('buildoption_test-valgrind',
+            ['--valgrind=on']),
+    Options('buildoption_test-valgrind_freya',
+            ['--valgrind-freya=on']),
+    Options('buildoption_test-mem_stats',
+            ['--mem-stats=on']),
+    Options('buildoption_test-show_opcodes',
+            ['--show-opcodes=on']),
+    Options('buildoption_test-show_regexp_opcodes',
+            ['--show-regexp-opcodes=on']),
+    Options('buildoption_test-compiler_default_libc',
+            ['--jerry-libc=off']),
+    Options('buildoption_test-cpointer_32bit',
+            ['--jerry-libc=off', '--compile-flag=-m32', '--cpointer-32bit=on', '--system-allocator=on']),
+    Options('buildoption_test-external_context',
+            ['--jerry-libc=off', '--external-context=on']),
+]
+
+def get_arguments():
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--toolchain', action='store', default='', help='Add toolchain file')
+    parser.add_argument('--buildoptions', action='store', default='',
+                        help='Add a comma separated list of extra build options to each test')
+    parser.add_argument('--skip-list', action='store', default='',
+                        help='Add a comma separated list of patterns of the excluded JS-tests')
+    parser.add_argument('--outdir', action='store', default=OUTPUT_DIR,
+                        help='Specify output directory (default: %(default)s)')
+    parser.add_argument('--check-signed-off', action='store_true', default=False,
+                        help='Run signed-off check')
+    parser.add_argument('--check-signed-off-tolerant', action='store_true', default=False,
+                        help='Run signed-off check in tolerant mode')
+    parser.add_argument('--check-signed-off-travis', action='store_true', default=False,
+                        help='Run signed-off check in tolerant mode if on Travis CI and not checking a pull request')
+    parser.add_argument('--check-cppcheck', action='store_true', default=False, help='Run cppcheck')
+    parser.add_argument('--check-doxygen', action='store_true', default=False, help='Run doxygen')
+    parser.add_argument('--check-pylint', action='store_true', default=False, help='Run pylint')
+    parser.add_argument('--check-vera', action='store_true', default=False, help='Run vera check')
+    parser.add_argument('--check-license', action='store_true', default=False, help='Run license check')
+    parser.add_argument('--check-magic-strings', action='store_true', default=False,
+                        help='Run "magic string source code generator should be executed" check')
+    parser.add_argument('--buildoption-test', action='store_true', default=False, help='Run buildoption-test')
+    parser.add_argument('--jerry-debugger', action='store_true', default=False, help='Run jerry-debugger tests')
+    parser.add_argument('--jerry-tests', action='store_true', default=False, help='Run jerry-tests')
+    parser.add_argument('--jerry-test-suite', action='store_true', default=False, help='Run jerry-test-suite')
+    parser.add_argument('--unittests', action='store_true', default=False, help='Run unittests (including doctests)')
+    parser.add_argument('--precommit', action='store_true', default=False, dest='all', help='Run all test')
+    parser.add_argument('--test262', action='store_true', default=False, help='Run test262')
+
+    if len(sys.argv) == 1:
+        parser.print_help()
+        sys.exit(1)
+
+    script_args = parser.parse_args()
+
+    return script_args
+
+BINARY_CACHE = {}
+
+def create_binary(job, options):
+    build_cmd = [settings.BUILD_SCRIPT]
+    build_cmd.extend(job.build_args)
+
+    build_dir_path = os.path.join(options.outdir, job.name)
+    build_cmd.append('--builddir=%s' % build_dir_path)
+
+    if options.toolchain:
+        build_cmd.append('--toolchain=%s' % options.toolchain)
+
+    if options.buildoptions:
+        build_cmd.extend(options.buildoptions.split(','))
+
+    sys.stderr.write('Build command: %s\n' % ' '.join(build_cmd))
+
+    binary_key = tuple(job.build_args)
+    if binary_key in BINARY_CACHE:
+        ret, build_dir_path = BINARY_CACHE[binary_key]
+        sys.stderr.write('(skipping: already built at %s with returncode %d)\n' % (build_dir_path, ret))
+        return ret, os.path.join(build_dir_path, 'bin')
+
+    try:
+        subprocess.check_output(build_cmd)
+        ret = 0
+    except subprocess.CalledProcessError as err:
+        ret = err.returncode
+
+    BINARY_CACHE[binary_key] = (ret, build_dir_path)
+    return ret, os.path.join(build_dir_path, 'bin')
+
+def run_check(runnable):
+    sys.stderr.write('Test command: %s\n' % ' '.join(runnable))
+
+    try:
+        ret = subprocess.check_call(runnable)
+    except subprocess.CalledProcessError as err:
+        return err.returncode
+
+    return ret
+
+def run_jerry_debugger_tests(options):
+    ret_build = ret_test = 0
+    for job in DEBUGGER_TEST_OPTIONS:
+        ret_build, bin_dir_path = create_binary(job, options)
+        if ret_build:
+            break
+
+        for test_file in os.listdir(settings.DEBUGGER_TESTS_DIR):
+            if test_file.endswith(".js"):
+                test_case, _ = os.path.splitext(test_file)
+                test_case_path = os.path.join(settings.DEBUGGER_TESTS_DIR, test_case)
+                test_cmd = [
+                    settings.DEBUGGER_TEST_RUNNER_SCRIPT,
+                    get_binary_path(bin_dir_path),
+                    settings.DEBUGGER_CLIENT_SCRIPT,
+                    os.path.relpath(test_case_path, settings.PROJECT_DIR)
+                ]
+
+                if job.test_args:
+                    test_cmd.extend(job.test_args)
+
+                ret_test |= run_check(test_cmd)
+
+    return ret_build | ret_test
+
+def run_jerry_tests(options):
+    ret_build = ret_test = 0
+    for job in JERRY_TESTS_OPTIONS:
+        ret_build, bin_dir_path = create_binary(job, options)
+        if ret_build:
+            break
+
+        test_cmd = [
+            settings.TEST_RUNNER_SCRIPT,
+            get_binary_path(bin_dir_path),
+            settings.JERRY_TESTS_DIR
+        ]
+        skip_list = []
+
+        if '--profile=es2015-subset' not in job.build_args:
+            skip_list.append(r"es2015\/")
+
+        if options.skip_list:
+            skip_list.append(options.skip_list)
+
+        if skip_list:
+            test_cmd.append("--skip-list=" + ",".join(skip_list))
+
+        if job.test_args:
+            test_cmd.extend(job.test_args)
+
+        ret_test |= run_check(test_cmd)
+
+    return ret_build | ret_test
+
+def run_jerry_test_suite(options):
+    ret_build = ret_test = 0
+    for job in JERRY_TEST_SUITE_OPTIONS:
+        ret_build, bin_dir_path = create_binary(job, options)
+        if ret_build:
+            break
+
+        test_cmd = [settings.TEST_RUNNER_SCRIPT, get_binary_path(bin_dir_path)]
+
+        if '--profile=minimal' in job.build_args:
+            test_cmd.append(settings.JERRY_TEST_SUITE_MINIMAL_LIST)
+        elif '--profile=es2015-subset' in job.build_args:
+            test_cmd.append(settings.JERRY_TEST_SUITE_DIR)
+        else:
+            test_cmd.append(settings.JERRY_TEST_SUITE_ES51_LIST)
+
+        if options.skip_list:
+            test_cmd.append("--skip-list=" + options.skip_list)
+
+        if job.test_args:
+            test_cmd.extend(job.test_args)
+
+        ret_test |= run_check(test_cmd)
+
+    return ret_build | ret_test
+
+def run_test262_test_suite(options):
+    ret_build = ret_test = 0
+    for job in TEST262_TEST_SUITE_OPTIONS:
+        ret_build, bin_dir_path = create_binary(job, options)
+        if ret_build:
+            break
+
+        test_cmd = [
+            settings.TEST262_RUNNER_SCRIPT,
+            get_binary_path(bin_dir_path),
+            settings.TEST262_TEST_SUITE_DIR
+        ]
+
+        if job.test_args:
+            test_cmd.extend(job.test_args)
+
+        ret_test |= run_check(test_cmd)
+
+    return ret_build | ret_test
+
+def run_unittests(options):
+    ret_build = ret_test = 0
+    for job in JERRY_UNITTESTS_OPTIONS:
+        ret_build, bin_dir_path = create_binary(job, options)
+        if ret_build:
+            break
+
+        ret_test |= run_check([
+            settings.UNITTEST_RUNNER_SCRIPT,
+            bin_dir_path
+        ])
+
+    return ret_build | ret_test
+
+def run_buildoption_test(options):
+    for job in JERRY_BUILDOPTIONS:
+        ret, _ = create_binary(job, options)
+        if ret:
+            break
+
+    return ret
+
+def main(options):
+    ret = 0
+
+    if options.check_signed_off_tolerant:
+        ret = run_check([settings.SIGNED_OFF_SCRIPT, '--tolerant'])
+
+    if not ret and options.check_signed_off_travis:
+        ret = run_check([settings.SIGNED_OFF_SCRIPT, '--travis'])
+
+    if not ret and (options.all or options.check_signed_off):
+        ret = run_check([settings.SIGNED_OFF_SCRIPT])
+
+    if not ret and (options.all or options.check_cppcheck):
+        ret = run_check([settings.CPPCHECK_SCRIPT])
+
+    if not ret and (options.all or options.check_doxygen):
+        ret = run_check([settings.DOXYGEN_SCRIPT])
+
+    if not ret and (options.all or options.check_pylint):
+        ret = run_check([settings.PYLINT_SCRIPT])
+
+    if not ret and (options.all or options.check_vera):
+        ret = run_check([settings.VERA_SCRIPT])
+
+    if not ret and (options.all or options.check_license):
+        ret = run_check([settings.LICENSE_SCRIPT])
+
+    if not ret and (options.all or options.check_magic_strings):
+        ret = run_check([settings.MAGIC_STRINGS_SCRIPT])
+
+    if not ret and (options.all or options.jerry_debugger):
+        ret = run_jerry_debugger_tests(options)
+
+    if not ret and (options.all or options.jerry_tests):
+        ret = run_jerry_tests(options)
+
+    if not ret and (options.all or options.jerry_test_suite):
+        ret = run_jerry_test_suite(options)
+
+    if not ret and (options.all or options.test262):
+        ret = run_test262_test_suite(options)
+
+    if not ret and (options.all or options.unittests):
+        ret = run_unittests(options)
+
+    if not ret and (options.all or options.buildoption_test):
+        ret = run_buildoption_test(options)
+
+    sys.exit(ret)
+
+
+if __name__ == "__main__":
+    main(get_arguments())
diff --git a/deps/jerry/tools/runners/run-benchmarks.sh b/deps/jerry/tools/runners/run-benchmarks.sh
new file mode 100755 (executable)
index 0000000..2ec1466
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# 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.
+
+ENGINE=$1
+
+function run ()
+{
+    echo "Running test: $1.js"
+        ./tools/perf.sh 5 $ENGINE ./tests/benchmarks/$1.js
+        ./tools/rss-measure.sh $ENGINE ./tests/benchmarks/$1.js
+}
+
+echo "Running Sunspider:"
+#run jerry/sunspider/3d-morph // too fast
+run jerry/sunspider/bitops-3bit-bits-in-byte
+run jerry/sunspider/bitops-bits-in-byte
+run jerry/sunspider/bitops-bitwise-and
+run jerry/sunspider/controlflow-recursive
+run jerry/sunspider/math-cordic
+run jerry/sunspider/math-partial-sums
+run jerry/sunspider/math-spectral-norm
+
+echo "Running Jerry:"
+run jerry/cse
+run jerry/cse_loop
+run jerry/cse_ready_loop
+run jerry/empty_loop
+run jerry/function_loop
+run jerry/loop_arithmetics_10kk
+run jerry/loop_arithmetics_1kk
+
+echo "Running UBench:"
+run ubench/function-closure
+run ubench/function-empty
+run ubench/function-correct-args
+run ubench/function-excess-args
+run ubench/function-missing-args
+run ubench/function-sum
+run ubench/loop-empty-resolve
+run ubench/loop-empty
+run ubench/loop-sum
+
+
diff --git a/deps/jerry/tools/runners/run-debugger-test.sh b/deps/jerry/tools/runners/run-debugger-test.sh
new file mode 100755 (executable)
index 0000000..d7b967a
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+# 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.
+
+JERRY=$1
+DEBUGGER_CLIENT=$2
+TEST_CASE=$3
+
+START_DEBUG_SERVER="${JERRY} ${TEST_CASE}.js --start-debug-server &"
+
+echo "$START_DEBUG_SERVER"
+eval "$START_DEBUG_SERVER"
+sleep 1s
+
+RESULT_TEMP=`mktemp ${TEST_CASE}.out.XXXXXXXXXX`
+
+(cat "${TEST_CASE}.cmd" | ${DEBUGGER_CLIENT} --non-interactive) &> ${RESULT_TEMP}
+diff -U0 ${TEST_CASE}.expected ${RESULT_TEMP}
+STATUS_CODE=$?
+
+rm -f ${RESULT_TEMP}
+
+if [ ${STATUS_CODE} -ne 0 ]
+then
+  echo "${TEST_CASE} failed"
+else
+  echo "${TEST_CASE} passed"
+fi
+
+exit ${STATUS_CODE}
diff --git a/deps/jerry/tools/runners/run-stability-test.sh b/deps/jerry/tools/runners/run-stability-test.sh
new file mode 100755 (executable)
index 0000000..25ec1e6
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# 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.
+
+NUM_COMMITS=$1
+BENCH=./tests/benchmarks/jerry/loop_arithmetics_1kk.js
+TARGET=release.linux
+
+trap ctrl_c INT
+
+function ctrl_c() {
+  git checkout master >&/dev/null
+  exit 1
+}
+
+commits_to_push=`git log -$NUM_COMMITS | grep "^commit [0-9a-f]*$" | awk 'BEGIN { s = ""; } { s = $2" "s; } END { print s; }'`
+
+for commit_hash in $commits_to_push
+do
+  git checkout $commit_hash >&/dev/null
+
+  echo -e -n " > Testing...\n >  "
+  echo `git log --format=%B -n 1 $commit_hash`
+  make -s $TARGET
+  ./tools/rss-measure.sh $TARGET $BENCH
+  echo
+done
+
+git checkout master >&/dev/null
diff --git a/deps/jerry/tools/runners/run-test-suite-test262.sh b/deps/jerry/tools/runners/run-test-suite-test262.sh
new file mode 100755 (executable)
index 0000000..3626516
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# 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.
+
+ENGINE="$1"
+PATH_TO_TEST262="$2"
+OUTPUT_DIR=`dirname $ENGINE`
+REPORT_PATH="${OUTPUT_DIR}/test262.report"
+TIMEOUT="90s"
+TIMEOUT_CMD=`which timeout`
+if [ $? -ne 0 ]
+then
+    TIMEOUT_CMD=`which gtimeout`
+fi
+
+if [ $# -lt 2 ]
+then
+  echo "This script performs parallel test262 compliance testing of the specified engine."
+  echo ""
+  echo "Usage:"
+  echo "  1st parameter: JavaScript engine to be tested."
+  echo "  2nd parameter: path to the directory with official test262 testsuite."
+  echo ""
+  echo "Example:"
+  echo "  ./run-test-suite-test262.sh <engine> <test262_dir>"
+  exit 1
+fi
+
+if [ ! -d "${PATH_TO_TEST262}/.git" ]
+then
+  git clone https://github.com/tc39/test262.git -b es5-tests "${PATH_TO_TEST262}"
+fi
+
+rm -rf "${PATH_TO_TEST262}/test/suite/bestPractice"
+rm -rf "${PATH_TO_TEST262}/test/suite/intl402"
+
+# TODO: Enable these tests after daylight saving calculation is fixed.
+rm -f "${PATH_TO_TEST262}/test/suite/ch15/15.9/15.9.3/S15.9.3.1_A5_T1.js"
+rm -f "${PATH_TO_TEST262}/test/suite/ch15/15.9/15.9.3/S15.9.3.1_A5_T2.js"
+rm -f "${PATH_TO_TEST262}/test/suite/ch15/15.9/15.9.3/S15.9.3.1_A5_T3.js"
+rm -f "${PATH_TO_TEST262}/test/suite/ch15/15.9/15.9.3/S15.9.3.1_A5_T4.js"
+rm -f "${PATH_TO_TEST262}/test/suite/ch15/15.9/15.9.3/S15.9.3.1_A5_T5.js"
+rm -f "${PATH_TO_TEST262}/test/suite/ch15/15.9/15.9.3/S15.9.3.1_A5_T6.js"
+
+echo "Starting test262 testing for ${ENGINE}. Running test262 may take a several minutes."
+
+"${PATH_TO_TEST262}"/tools/packaging/test262.py --command "${TIMEOUT_CMD} ${TIMEOUT} ${ENGINE}" \
+                                                --tests="${PATH_TO_TEST262}" --summary \
+                                                &> "${REPORT_PATH}"
+
+grep -A3 "=== Summary ===" "${REPORT_PATH}"
+
+FAILURES=`sed -n '/Failed tests/,/^$/p' "${REPORT_PATH}"`
+
+EXIT_CODE=0
+if [ -n "$FAILURES" ]
+then
+  echo -e "\n$FAILURES\n"
+  echo "$0: see ${REPORT_PATH} for details about failures"
+  EXIT_CODE=1
+fi
+
+FAILURES=`sed -n '/Expected to fail but passed/,/^$/p' "${REPORT_PATH}"`
+if [ -n "$FAILURES" ]
+then
+  echo -e "\n$FAILURES\n"
+  echo "$0: see ${REPORT_PATH} for details about failures"
+  EXIT_CODE=1
+fi
+
+exit $EXIT_CODE
diff --git a/deps/jerry/tools/runners/run-test-suite.sh b/deps/jerry/tools/runners/run-test-suite.sh
new file mode 100755 (executable)
index 0000000..0875141
--- /dev/null
@@ -0,0 +1,198 @@
+#!/bin/bash
+
+# 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.
+
+# Usage:
+#       ./tools/runners/run-test-suite.sh ENGINE TESTS [--skip-list=item1,item2] [--snapshot] ENGINE_ARGS....
+
+TIMEOUT=${TIMEOUT:=5}
+TIMEOUT_CMD=`which timeout`
+if [ $? -ne 0 ]
+then
+    TIMEOUT_CMD=`which gtimeout`
+fi
+
+ENGINE="$1"
+shift
+
+TESTS="$1"
+shift
+
+OUTPUT_DIR=`dirname $ENGINE`
+TESTS_BASENAME=`basename $TESTS`
+
+TEST_FILES=$OUTPUT_DIR/$TESTS_BASENAME.files
+TEST_FAILED=$OUTPUT_DIR/$TESTS_BASENAME.failed
+TEST_PASSED=$OUTPUT_DIR/$TESTS_BASENAME.passed
+
+if [[ "$1" =~ ^--skip-list=.* ]]
+then
+    SKIP_LIST=${1#--skip-list=}
+    SKIP_LIST=(${SKIP_LIST//,/ })
+    shift
+fi
+
+if [ "$1" == "--snapshot" ]
+then
+    TEST_FILES="$TEST_FILES.snapshot"
+    TEST_FAILED="$TEST_FAILED.snapshot"
+    TEST_PASSED="$TEST_PASSED.snapshot"
+    IS_SNAPSHOT=true;
+    shift
+fi
+
+ENGINE_ARGS="$@"
+
+if [ ! -x $ENGINE ]
+then
+    echo "$0: $ENGINE: not an executable"
+    exit 1
+fi
+
+if [ -d $TESTS ]
+then
+    TESTS_DIR=$TESTS
+
+    ( cd $TESTS; find . -name "[^N]*.js" ) | sort > $TEST_FILES
+elif [ -f $TESTS ]
+then
+    TESTS_DIR=`dirname $TESTS`
+
+    grep -e '.js\s*$' $TESTS | sort > $TEST_FILES
+else
+    echo "$0: $TESTS: not a test suite"
+    exit 1
+fi
+
+# Remove the skipped tests from list
+for TEST in "${SKIP_LIST[@]}"
+do
+    ( sed -i -r "/$TEST/d" $TEST_FILES )
+done
+
+TOTAL=$(cat $TEST_FILES | wc -l)
+if [ "$TOTAL" -eq 0 ]
+then
+    echo "$0: $TESTS: no test in test suite"
+    exit 1
+fi
+
+rm -f $TEST_FAILED $TEST_PASSED
+
+ROOT_DIR=""
+CURRENT_DIR=`pwd`
+PATH_STEP=2
+while true
+do
+    TMP_ROOT_DIR=`(echo "$CURRENT_DIR"; echo "$0"; echo "$ENGINE"; echo "$TESTS") | cut -f1-$PATH_STEP -d/ | uniq -d`
+    if [ -z "$TMP_ROOT_DIR" ]
+    then
+        break
+    else
+        ROOT_DIR="$TMP_ROOT_DIR"
+    fi
+    PATH_STEP=$((PATH_STEP+1))
+done
+if [ -n "$ROOT_DIR" ]
+then
+    ROOT_DIR="$ROOT_DIR/"
+fi
+
+tested=1
+failed=0
+passed=0
+
+ENGINE_TEMP=`mktemp engine-out.XXXXXXXXXX`
+
+for test in `cat $TEST_FILES`
+do
+    if [[ $test =~ ^\.\/fail\/ ]]
+    then
+        error_code=1
+        PASS="PASS (XFAIL)"
+    else
+        error_code=0
+        PASS="PASS"
+    fi
+
+    full_test=$TESTS_DIR/${test#./}
+
+    if [ "$IS_SNAPSHOT" == true ]
+    then
+        # Testing snapshot
+        SNAPSHOT_TEMP=`mktemp $(basename -s .js $test).snapshot.XXXXXXXXXX`
+
+        cmd_line="${ENGINE#$ROOT_DIR} $ENGINE_ARGS --save-snapshot-for-global $SNAPSHOT_TEMP ${full_test#$ROOT_DIR}"
+        $TIMEOUT_CMD $TIMEOUT $ENGINE $ENGINE_ARGS --save-snapshot-for-global $SNAPSHOT_TEMP $full_test &> $ENGINE_TEMP
+        status_code=$?
+
+        if [ $status_code -eq 0 ]
+        then
+            echo "[$tested/$TOTAL] $cmd_line: PASS"
+
+            cmd_line="${ENGINE#$ROOT_DIR} $ENGINE_ARGS --exec-snapshot $SNAPSHOT_TEMP"
+            $TIMEOUT_CMD $TIMEOUT $ENGINE $ENGINE_ARGS --exec-snapshot $SNAPSHOT_TEMP &> $ENGINE_TEMP
+            status_code=$?
+        fi
+
+        rm -f $SNAPSHOT_TEMP
+    else
+        cmd_line="${ENGINE#$ROOT_DIR} $ENGINE_ARGS ${full_test#$ROOT_DIR}"
+        $TIMEOUT_CMD $TIMEOUT $ENGINE $ENGINE_ARGS $full_test &> $ENGINE_TEMP
+        status_code=$?
+    fi
+
+    if [ $status_code -ne $error_code ]
+    then
+        echo "[$tested/$TOTAL] $cmd_line: FAIL ($status_code)"
+        cat $ENGINE_TEMP
+
+        echo "$status_code: $test" >> $TEST_FAILED
+        echo "============================================" >> $TEST_FAILED
+        cat $ENGINE_TEMP >> $TEST_FAILED
+        echo "============================================" >> $TEST_FAILED
+        echo >> $TEST_FAILED
+        echo >> $TEST_FAILED
+
+        failed=$((failed+1))
+    else
+        echo "[$tested/$TOTAL] $cmd_line: $PASS"
+
+        echo "$test" >> $TEST_PASSED
+
+        passed=$((passed+1))
+    fi
+
+    tested=$((tested+1))
+done
+
+rm -f $ENGINE_TEMP
+
+ratio=$(echo $passed*100/$TOTAL | bc)
+
+if [ "$IS_SNAPSHOT" == true ]
+then
+    ENGINE_ARGS="--snapshot $ENGINE_ARGS"
+fi
+
+echo "[summary] ${ENGINE#$ROOT_DIR} $ENGINE_ARGS ${TESTS#$ROOT_DIR}: $passed PASS, $failed FAIL, $TOTAL total, $ratio% success"
+
+if [ $failed -ne 0 ]
+then
+    echo "$0: see $TEST_FAILED for details about failures"
+    exit 1
+fi
+
+exit 0
diff --git a/deps/jerry/tools/runners/run-tests-remote.sh b/deps/jerry/tools/runners/run-tests-remote.sh
new file mode 100755 (executable)
index 0000000..d6a01eb
--- /dev/null
@@ -0,0 +1,80 @@
+#!/bin/bash
+
+# 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.
+
+TARGET="$1" #debug.linux release.linux
+TARGET_IP="$2" # ip address of target board
+TARGET_USER="$3" # login
+TARGET_PASS="$4" # password
+
+if [ $# -lt 4 ]
+then
+  echo "This script runs ./jerry/* and ./jerry-test-suite/* tests on the remote board."
+  echo ""
+  echo "Usage:"
+  echo "  1st parameter: target to be tested: {debug.linux, release.linux}"
+  echo "  2nd parameter: ip address of target board: {110.110.110.110}"
+  echo "  3rd parameter: ssh login to target board: {login}"
+  echo "  4th parameter: ssh password to target board: {password}"
+  echo ""
+  echo "Example:"
+  echo "  ./tools/runners/run-tests-remote.sh debug.linux 110.110.110.110 login password"
+  exit 1
+fi
+
+BASE_DIR=$(dirname "$(readlink -f "$0")" )
+
+OUT_DIR="${BASE_DIR}"/../.././build/bin
+LOGS_PATH_FULL="${OUT_DIR}"/"${TARGET}"/check
+
+export SSHPASS="${TARGET_PASS}"
+
+rm -rf "${LOGS_PATH_FULL}"
+
+mkdir -p "${LOGS_PATH_FULL}"
+
+REMOTE_TMP_DIR=$(sshpass -e ssh "${TARGET_USER}"@"${TARGET_IP}" 'mktemp -d')
+REMOTE_TMP_TAR=$(sshpass -e ssh "${TARGET_USER}"@"${TARGET_IP}" 'mktemp')
+LOCAL_TMP_TAR=$(mktemp)
+
+tar -zcf "${LOCAL_TMP_TAR}" \
+  "${BASE_DIR}"/../.././build/bin/"${TARGET}" \
+  "${BASE_DIR}"/../.././tests/benchmarks \
+  "${BASE_DIR}"/../.././tests/jerry \
+  "${BASE_DIR}"/../.././tests/jerry-test-suite \
+  "${BASE_DIR}"/../.././tools/runners \
+  "${BASE_DIR}"/../.././tools/precommit-full-testing.sh > /dev/null 2>&1
+
+sshpass -e scp "${LOCAL_TMP_TAR}" "${TARGET_USER}"@"${TARGET_IP}":"${REMOTE_TMP_TAR}"
+
+sshpass -e ssh "${TARGET_USER}"@"${TARGET_IP}" \
+  "tar -zxf \"${REMOTE_TMP_TAR}\" -C \"${REMOTE_TMP_DIR}\"; rm \"${REMOTE_TMP_TAR}\";\
+  cd \"${REMOTE_TMP_DIR}\"; \
+  ./tools/precommit-full-testing.sh ./build/bin \"$TARGET\" > ./build/bin/\"${TARGET}\"/check/run.log 2>&1; \
+  echo \$? > ./build/bin/\"${TARGET}\"/check/IS_TEST_OK"
+
+sshpass -e scp -r "${TARGET_USER}"@"${TARGET_IP}":"${REMOTE_TMP_DIR}"/build/bin/"${TARGET}"/check/* "${LOGS_PATH_FULL}"
+sshpass -e ssh "${TARGET_USER}"@"${TARGET_IP}" "rm -rf \"${REMOTE_TMP_DIR}\""
+
+STATUS=$(cat "${LOGS_PATH_FULL}"/IS_TEST_OK)
+
+if [ "${STATUS}" == 0 ] ; then
+  echo "${TARGET} testing passed."
+  exit 0
+else
+  echo "${TARGET} testing failed."
+  echo "See logs in ${LOGS_PATH_FULL} directory for details."
+  exit 1
+fi
\ No newline at end of file
diff --git a/deps/jerry/tools/runners/run-unittests-remote.sh b/deps/jerry/tools/runners/run-unittests-remote.sh
new file mode 100755 (executable)
index 0000000..1acd4fc
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+# 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.
+
+TARGET_IP="$1"
+TARGET_USER="$2"
+TARGET_PASS="$3"
+
+if [ $# -lt 3 ]
+then
+  echo "This script runs unittests on the remote board."
+  echo ""
+  echo "Usage:"
+  echo "  1st parameter: ip address of target board: {110.110.110.110}"
+  echo "  2nd parameter: ssh login to target board: {login}"
+  echo "  3rd parameter: ssh password to target board: {password}"
+  echo ""
+  echo "Example:"
+  echo "  ./tools/runners/run-unittests-remote.sh 110.110.110.110 login password"
+  exit 1
+fi
+
+BASE_DIR=$(dirname "$(readlink -f "$0")" )
+
+OUT_DIR="${BASE_DIR}"/../.././build/bin
+
+rm -rf "${OUT_DIR}"/unittests/check
+
+mkdir -p "${OUT_DIR}"/unittests/check
+
+export SSHPASS="${TARGET_PASS}"
+REMOTE_TMP_DIR=$(sshpass -e ssh "${TARGET_USER}"@"${TARGET_IP}" 'mktemp -d')
+
+sshpass -e scp "${BASE_DIR}"/../../tools/runners/run-unittests.sh "${TARGET_USER}"@"${TARGET_IP}":"${REMOTE_TMP_DIR}"
+sshpass -e scp -r "${OUT_DIR}"/unittests/* "${TARGET_USER}"@"${TARGET_IP}":"${REMOTE_TMP_DIR}"
+
+sshpass -e ssh "${TARGET_USER}"@"${TARGET_IP}" "mkdir -p \"${REMOTE_TMP_DIR}\"/check; \
+                                                \"${REMOTE_TMP_DIR}\"/run-unittests.sh \"${REMOTE_TMP_DIR}\"; \
+                                                echo \$? > \"${REMOTE_TMP_DIR}\"/check/IS_REMOTE_TEST_OK"
+
+sshpass -e scp -r "${TARGET_USER}"@$"{TARGET_IP}":"${REMOTE_TMP_DIR}"/check "${OUT_DIR}"/unittests
+
+sshpass -e ssh "${TARGET_USER}"@"${TARGET_IP}" "rm -rf \"${REMOTE_TMP_DIR}\""
+
+STATUS=$(cat "${OUT_DIR}"/unittests/check/IS_REMOTE_TEST_OK)
+
+if [ "${STATUS}" == 0 ] ; then
+    echo "Unit tests run passed."
+    exit 0
+else
+    echo "Unit tests run failed. See ${OUT_DIR}/unittests/unit_tests_run.log for details."
+    exit 1
+fi
diff --git a/deps/jerry/tools/runners/run-unittests.sh b/deps/jerry/tools/runners/run-unittests.sh
new file mode 100755 (executable)
index 0000000..0a23556
--- /dev/null
@@ -0,0 +1,101 @@
+#!/bin/bash
+
+# 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.
+
+DIR="$1"
+shift
+
+UNITTEST_ERROR=$DIR/unittests.failed
+UNITTEST_OK=$DIR/unittests.passed
+
+rm -f $UNITTEST_ERROR $UNITTEST_OK
+
+UNITTESTS=$(ls $DIR/unit-*)
+total=$(ls $DIR/unit-* | wc -l)
+
+if [ "$total" -eq 0 ]
+then
+    echo "$0: $DIR: no unit-* test to execute"
+    exit 1
+fi
+
+ROOT_DIR=""
+CURRENT_DIR=`pwd`
+PATH_STEP=2
+while true
+do
+    TMP_ROOT_DIR=`(echo "$CURRENT_DIR"; echo "$0"; echo "$DIR") | cut -f1-$PATH_STEP -d/ | uniq -d`
+    if [ -z "$TMP_ROOT_DIR" ]
+    then
+        break
+    else
+        ROOT_DIR="$TMP_ROOT_DIR"
+    fi
+    PATH_STEP=$((PATH_STEP+1))
+done
+if [ -n "$ROOT_DIR" ]
+then
+    ROOT_DIR="$ROOT_DIR/"
+fi
+
+tested=1
+failed=0
+passed=0
+
+UNITTEST_TEMP=`mktemp unittest-out.XXXXXXXXXX`
+
+for unit_test in $UNITTESTS
+do
+    cmd_line="${unit_test#$ROOT_DIR}"
+    $unit_test &>$UNITTEST_TEMP
+    status_code=$?
+
+    if [ $status_code -ne 0 ]
+    then
+        echo "[$tested/$total] $cmd_line: FAIL ($status_code)"
+        cat $UNITTEST_TEMP
+
+        echo "$status_code: $unit_test" >> $UNITTEST_ERROR
+        echo "============================================" >> $UNITTEST_ERROR
+        cat $UNITTEST_TEMP >> $UNITTEST_ERROR
+        echo "============================================" >> $UNITTEST_ERROR
+        echo >> $UNITTEST_ERROR
+        echo >> $UNITTEST_ERROR
+
+        failed=$((failed+1))
+    else
+        echo "[$tested/$total] $cmd_line: PASS"
+
+        echo "$unit_test" >> $UNITTEST_OK
+
+        passed=$((passed+1))
+    fi
+
+    tested=$((tested+1))
+done
+
+rm -f $UNITTEST_TEMP
+
+ratio=$(echo $passed*100/$total | bc)
+
+echo "[summary] ${DIR#$ROOT_DIR}/unit-*: $passed PASS, $failed FAIL, $total total, $ratio% success"
+
+if [ $failed -ne 0 ]
+then
+    echo "$0: see $UNITTEST_ERROR for details about failures"
+    exit 1
+fi
+
+exit 0
diff --git a/deps/jerry/tools/settings.py b/deps/jerry/tools/settings.py
new file mode 100755 (executable)
index 0000000..d0344ee
--- /dev/null
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+
+# 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.
+
+from os import path
+
+TOOLS_DIR = path.dirname(path.abspath(__file__))
+PROJECT_DIR = path.normpath(path.join(TOOLS_DIR, '..'))
+DEBUGGER_TESTS_DIR = path.join(PROJECT_DIR, 'tests/debugger')
+JERRY_TESTS_DIR = path.join(PROJECT_DIR, 'tests/jerry')
+JERRY_TEST_SUITE_DIR = path.join(PROJECT_DIR, 'tests/jerry-test-suite')
+JERRY_TEST_SUITE_MINIMAL_LIST = path.join(PROJECT_DIR, 'tests/jerry-test-suite/minimal-profile-list')
+JERRY_TEST_SUITE_ES51_LIST = path.join(PROJECT_DIR, 'tests/jerry-test-suite/es51-profile-list')
+TEST262_TEST_SUITE_DIR = path.join(PROJECT_DIR, 'tests/test262')
+
+BUILD_SCRIPT = path.join(TOOLS_DIR, 'build.py')
+CPPCHECK_SCRIPT = path.join(TOOLS_DIR, 'check-cppcheck.sh')
+DEBUGGER_CLIENT_SCRIPT = path.join(PROJECT_DIR, 'jerry-debugger/jerry-client-ws.py')
+DEBUGGER_TEST_RUNNER_SCRIPT = path.join(TOOLS_DIR, 'runners/run-debugger-test.sh')
+DOXYGEN_SCRIPT = path.join(TOOLS_DIR, 'check-doxygen.sh')
+LICENSE_SCRIPT = path.join(TOOLS_DIR, 'check-license.py')
+MAGIC_STRINGS_SCRIPT = path.join(TOOLS_DIR, 'check-magic-strings.sh')
+PYLINT_SCRIPT = path.join(TOOLS_DIR, 'check-pylint.sh')
+SIGNED_OFF_SCRIPT = path.join(TOOLS_DIR, 'check-signed-off.sh')
+TEST_RUNNER_SCRIPT = path.join(TOOLS_DIR, 'runners/run-test-suite.sh')
+TEST262_RUNNER_SCRIPT = path.join(TOOLS_DIR, 'runners/run-test-suite-test262.sh')
+VERA_SCRIPT = path.join(TOOLS_DIR, 'check-vera.sh')
+UNITTEST_RUNNER_SCRIPT = path.join(TOOLS_DIR, 'runners/run-unittests.sh')
diff --git a/deps/jerry/tools/sort-fails.sh b/deps/jerry/tools/sort-fails.sh
new file mode 100755 (executable)
index 0000000..6dfc7dd
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# 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.
+
+INPUT_PATH="$1"
+VERSION=$(git log -n 1 --pretty=format:"%H")
+SYSTEM=$(uname -a)
+TMP_DIR="afl-testing"
+USAGE="Usage:\n\t./tools/sort-fails.sh PATH_TO_DIR_WITH_FAILS"
+
+if [ "$#" -ne 1 ]
+then
+  echo -e "${USAGE}";
+  echo "Argument number mismatch...";
+  exit 1;
+fi
+
+rm "$TMP_DIR" -r; mkdir "$TMP_DIR";
+
+make debug.linux VALGRIND=ON -j && echo "Build OK";
+
+for file in "$INPUT_PATH"/*;
+do
+  key1=$(./build/bin/debug.linux/jerry --abort-on-fail $file 2>&1);
+  key2=$(valgrind --default-suppressions=yes ./build/bin/debug.linux/jerry --abort-on-fail $file 2>&1 \
+        | sed -e 's/^==*[0-9][0-9]*==*//g' \
+        | sed -e 's/^ Command: .*//g');
+
+  hash1=$(echo -n $key1 | md5sum);
+  hash2=$(echo -n $key2 | md5sum);
+
+  dir="$TMP_DIR/$hash1";
+  head="$TMP_DIR/$hash1.err.md";
+  body="$dir/$hash2.err.md";
+
+  if [ ! -s "$dir" ]; then
+    mkdir -p "$dir"; touch "$head";
+    echo "###### Version: $VERSION"     >> "$head";
+    echo "###### System:"               >> "$head";
+    echo '```'                          >> "$head";
+    echo "$SYSTEM"                      >> "$head";
+    echo '```'                          >> "$head";
+    echo "###### Output:"               >> "$head";
+    echo '```'                          >> "$head";
+    echo "$key1"                        >> "$head";
+    echo '```'                          >> "$head";
+  fi
+
+  if [ ! -s "$body" ]; then
+    touch "$body";
+    echo '###### Unique backtrace:```'  >> "$body";
+    echo '```'                          >> "$body";
+    echo "$key2"                        >> "$body"
+    echo '```'                          >> "$body";
+  fi
+
+  echo "###### Test case($file):"       >> "$body";
+  echo '```js'                          >> "$body";
+  cat "$file"                           >> "$body";
+  echo '```'                            >> "$body";
+
+done
+
+cd "$TMP_DIR";
+for dir in */ ; do
+  for file in "$dir"/*;
+  do
+    cat "$file" >> "${dir%/*}.err.md"
+  done
+  rm $dir -r;
+done
diff --git a/deps/jerry/tools/unit-tests/Makefile b/deps/jerry/tools/unit-tests/Makefile
new file mode 100644 (file)
index 0000000..70db637
--- /dev/null
@@ -0,0 +1,28 @@
+# 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.
+
+CC=gcc
+LDFLAGS=-lm
+
+GENS=gen-test-libm
+
+.PHONY: build
+build: $(GENS)
+
+.PHONY: clean
+clean:
+       rm -f $(GENS)
+
+gen-test-libm: gen-test-libm.c
+       $(CC) $< -o $@ $(LDFLAGS)
diff --git a/deps/jerry/tools/unit-tests/gen-test-libm.c b/deps/jerry/tools/unit-tests/gen-test-libm.c
new file mode 100644 (file)
index 0000000..12dddd8
--- /dev/null
@@ -0,0 +1,766 @@
+/* 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.
+ */
+
+/*
+ * Unit test generator for jerry-libm.
+ * To be compiled separately from the rest of jerry and to be linked to a trusted libm.
+ * Its output should be redirected to test-libm.inc.h.
+ *
+ * Example:
+ * gcc gen-test-libm.c -o gen-test-libm -lm
+ * ./gen-test-libm >test-libm.inc.h
+ */
+
+#include <math.h>
+#include <stdio.h>
+
+#define GEN_INT_TEST(EXPR) printf("check_int (\"%s\", %s, %d);\n", #EXPR, #EXPR, EXPR);
+#define GEN_DBL_TEST(EXPR) printf("check_double (\"%s\", %s, %.20E);\n", #EXPR, #EXPR, EXPR);
+
+int
+main (int argc, char **args)
+{
+  printf ("/* Copyright JS Foundation and other contributors, http://js.foundation\n"
+          " *\n"
+          " * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
+          " * you may not use this file except in compliance with the License.\n"
+          " * You may obtain a copy of the License at\n"
+          " *\n"
+          " *     http://www.apache.org/licenses/LICENSE-2.0\n"
+          " *\n"
+          " * Unless required by applicable law or agreed to in writing, software\n"
+          " * distributed under the License is distributed on an \"AS IS\" BASIS\n"
+          " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
+          " * See the License for the specific language governing permissions and\n"
+          " * limitations under the License.\n"
+          " */\n"
+          "\n"
+          "/* This file is automatically generated by the gen-test-libm.sh script.\n"
+          " * Do not edit! */\n"
+          "\n");
+
+  /* acos tests */
+  GEN_DBL_TEST (acos (0.0));
+  GEN_DBL_TEST (acos (-0.0));
+  GEN_DBL_TEST (acos (1.0));
+  GEN_DBL_TEST (acos (-1.0));
+  GEN_DBL_TEST (acos (0.5));
+  GEN_DBL_TEST (acos (-0.5));
+  GEN_DBL_TEST (acos (INFINITY));
+  GEN_DBL_TEST (acos (-INFINITY));
+  GEN_DBL_TEST (acos (NAN));
+  GEN_DBL_TEST (acos (6.9e-18));
+  GEN_DBL_TEST (acos (-6.9e-18));
+  GEN_DBL_TEST (acos (7.0e-18));
+  GEN_DBL_TEST (acos (-7.0e-18));
+  GEN_DBL_TEST (acos (7.4e-9));
+  GEN_DBL_TEST (acos (-7.4e-9));
+  GEN_DBL_TEST (acos (7.5e-9));
+  GEN_DBL_TEST (acos (-7.5e-9));
+  GEN_DBL_TEST (acos (0.1));
+  GEN_DBL_TEST (acos (-0.1));
+  GEN_DBL_TEST (acos (0.4));
+  GEN_DBL_TEST (acos (-0.4));
+  GEN_DBL_TEST (acos (0.6));
+  GEN_DBL_TEST (acos (-0.6));
+  GEN_DBL_TEST (acos (0.99));
+  GEN_DBL_TEST (acos (-0.99));
+  GEN_DBL_TEST (acos (1.1));
+  GEN_DBL_TEST (acos (-1.1));
+  GEN_DBL_TEST (acos (0.7));
+
+  /* asin tests*/
+  GEN_DBL_TEST (asin (0.0));
+  GEN_DBL_TEST (asin (-0.0));
+  GEN_DBL_TEST (asin (1.0));
+  GEN_DBL_TEST (asin (-1.0));
+  GEN_DBL_TEST (asin (0.5));
+  GEN_DBL_TEST (asin (-0.5));
+  GEN_DBL_TEST (asin (0.98));
+  GEN_DBL_TEST (asin (-0.98));
+  GEN_DBL_TEST (asin (INFINITY));
+  GEN_DBL_TEST (asin (-INFINITY));
+  GEN_DBL_TEST (asin (NAN));
+  GEN_DBL_TEST (asin (6.9e-18));
+  GEN_DBL_TEST (asin (-6.9e-18));
+  GEN_DBL_TEST (asin (7.0e-18));
+  GEN_DBL_TEST (asin (-7.0e-18));
+  GEN_DBL_TEST (asin (7.4e-9));
+  GEN_DBL_TEST (asin (-7.4e-9));
+  GEN_DBL_TEST (asin (7.5e-9));
+  GEN_DBL_TEST (asin (-7.5e-9));
+  GEN_DBL_TEST (asin (0.1));
+  GEN_DBL_TEST (asin (-0.1));
+  GEN_DBL_TEST (asin (0.4));
+  GEN_DBL_TEST (asin (-0.4));
+  GEN_DBL_TEST (asin (0.6));
+  GEN_DBL_TEST (asin (-0.6));
+  GEN_DBL_TEST (asin (0.97));
+  GEN_DBL_TEST (asin (-0.97));
+  GEN_DBL_TEST (asin (0.99));
+  GEN_DBL_TEST (asin (-0.99));
+  GEN_DBL_TEST (asin (1.1));
+  GEN_DBL_TEST (asin (-1.1));
+  GEN_DBL_TEST (asin (0.7));
+
+  /* atan tests*/
+  GEN_DBL_TEST (atan (0.0));
+  GEN_DBL_TEST (atan (-0.0));
+  GEN_DBL_TEST (atan (7.0 / 16.0));
+  GEN_DBL_TEST (atan (-7.0 / 16.0));
+  GEN_DBL_TEST (atan (11.0 / 16.0));
+  GEN_DBL_TEST (atan (-11.0 / 16.0));
+  GEN_DBL_TEST (atan (19.0 / 16.0));
+  GEN_DBL_TEST (atan (-19.0 / 16.0));
+  GEN_DBL_TEST (atan (39.0 / 16.0));
+  GEN_DBL_TEST (atan (-39.0 / 16.0));
+  GEN_DBL_TEST (atan (1.0));
+  GEN_DBL_TEST (atan (-1.0));
+  GEN_DBL_TEST (atan (INFINITY));
+  GEN_DBL_TEST (atan (-INFINITY));
+  GEN_DBL_TEST (atan (NAN));
+  GEN_DBL_TEST (atan (6.9 / 16.0));
+  GEN_DBL_TEST (atan (-6.9 / 16.0));
+  GEN_DBL_TEST (atan (7.1 / 16.0));
+  GEN_DBL_TEST (atan (-7.1 / 16.0));
+  GEN_DBL_TEST (atan (10.9 / 16.0));
+  GEN_DBL_TEST (atan (-10.9 / 16.0));
+  GEN_DBL_TEST (atan (11.1 / 16.0));
+  GEN_DBL_TEST (atan (-11.1 / 16.0));
+  GEN_DBL_TEST (atan (18.9 / 16.0));
+  GEN_DBL_TEST (atan (-18.9 / 16.0));
+  GEN_DBL_TEST (atan (19.1 / 16.0));
+  GEN_DBL_TEST (atan (-19.1 / 16.0));
+  GEN_DBL_TEST (atan (38.9 / 16.0));
+  GEN_DBL_TEST (atan (-38.9 / 16.0));
+  GEN_DBL_TEST (atan (39.1 / 16.0));
+  GEN_DBL_TEST (atan (-39.1 / 16.0));
+  GEN_DBL_TEST (atan (0.99));
+  GEN_DBL_TEST (atan (-0.99));
+  GEN_DBL_TEST (atan (1.1));
+  GEN_DBL_TEST (atan (-1.1));
+  GEN_DBL_TEST (atan (7.37e+19));
+  GEN_DBL_TEST (atan (-7.37e+19));
+  GEN_DBL_TEST (atan (7.38e+19));
+  GEN_DBL_TEST (atan (-7.38e+19));
+  GEN_DBL_TEST (atan (0.7));
+
+  /* atan2 tests*/
+  GEN_DBL_TEST (atan2 (NAN, NAN));
+  GEN_DBL_TEST (atan2 (0.0, NAN));
+  GEN_DBL_TEST (atan2 (-0.0, NAN));
+  GEN_DBL_TEST (atan2 (1.0, NAN));
+  GEN_DBL_TEST (atan2 (-1.0, NAN));
+  GEN_DBL_TEST (atan2 (INFINITY, NAN));
+  GEN_DBL_TEST (atan2 (-INFINITY, NAN));
+  GEN_DBL_TEST (atan2 (NAN, 0.0));
+  GEN_DBL_TEST (atan2 (NAN, -0.0));
+  GEN_DBL_TEST (atan2 (NAN, 1.0));
+  GEN_DBL_TEST (atan2 (NAN, -1.0));
+  GEN_DBL_TEST (atan2 (NAN, INFINITY));
+  GEN_DBL_TEST (atan2 (NAN, -INFINITY));
+  GEN_DBL_TEST (atan2 (0.0, 0.0));
+  GEN_DBL_TEST (atan2 (0.0, -0.0));
+  GEN_DBL_TEST (atan2 (-0.0, 0.0));
+  GEN_DBL_TEST (atan2 (-0.0, -0.0));
+  GEN_DBL_TEST (atan2 (0.0, 1.0));
+  GEN_DBL_TEST (atan2 (0.0, -1.0));
+  GEN_DBL_TEST (atan2 (0.0, INFINITY));
+  GEN_DBL_TEST (atan2 (0.0, -INFINITY));
+  GEN_DBL_TEST (atan2 (-0.0, 1.0));
+  GEN_DBL_TEST (atan2 (-0.0, -1.0));
+  GEN_DBL_TEST (atan2 (-0.0, INFINITY));
+  GEN_DBL_TEST (atan2 (-0.0, -INFINITY));
+  GEN_DBL_TEST (atan2 (1.0, 0.0));
+  GEN_DBL_TEST (atan2 (1.0, -0.0));
+  GEN_DBL_TEST (atan2 (INFINITY, 0.0));
+  GEN_DBL_TEST (atan2 (INFINITY, -0.0));
+  GEN_DBL_TEST (atan2 (-1.0, 0.0));
+  GEN_DBL_TEST (atan2 (-1.0, -0.0));
+  GEN_DBL_TEST (atan2 (-INFINITY, 0.0));
+  GEN_DBL_TEST (atan2 (-INFINITY, -0.0));
+  GEN_DBL_TEST (atan2 (1.0, INFINITY));
+  GEN_DBL_TEST (atan2 (-1.0, INFINITY));
+  GEN_DBL_TEST (atan2 (1.0, -INFINITY));
+  GEN_DBL_TEST (atan2 (-1.0, -INFINITY));
+  GEN_DBL_TEST (atan2 (INFINITY, INFINITY));
+  GEN_DBL_TEST (atan2 (INFINITY, -INFINITY));
+  GEN_DBL_TEST (atan2 (-INFINITY, INFINITY));
+  GEN_DBL_TEST (atan2 (-INFINITY, -INFINITY));
+  GEN_DBL_TEST (atan2 (INFINITY, 1.0));
+  GEN_DBL_TEST (atan2 (INFINITY, -1.0));
+  GEN_DBL_TEST (atan2 (-INFINITY, 1.0));
+  GEN_DBL_TEST (atan2 (-INFINITY, -1.0));
+  GEN_DBL_TEST (atan2 (0.7, 1.0));
+  GEN_DBL_TEST (atan2 (-0.7, 1.0));
+  GEN_DBL_TEST (atan2 (0.7, -1.0));
+  GEN_DBL_TEST (atan2 (-0.7, -1.0));
+  GEN_DBL_TEST (atan2 (0.4, 0.0003));
+  GEN_DBL_TEST (atan2 (1.4, -0.93));
+
+  /* ceil tests */
+  GEN_DBL_TEST (ceil (0.0));
+  GEN_DBL_TEST (ceil (-0.0));
+  GEN_DBL_TEST (ceil (INFINITY));
+  GEN_DBL_TEST (ceil (-INFINITY));
+  GEN_DBL_TEST (ceil (NAN));
+  GEN_DBL_TEST (ceil (3.14));
+  GEN_DBL_TEST (ceil (-3.14));
+  GEN_DBL_TEST (ceil (3.72e-09));
+  GEN_DBL_TEST (ceil (-3.72e-09));
+  GEN_DBL_TEST (ceil (7.37e+19));
+  GEN_DBL_TEST (ceil (-7.37e+19));
+
+  /* copysign tests */
+  /* SKIPPED: not publicly declared in jerry-libm
+  GEN_DBL_TEST (copysign (0.0, 0.0));
+  GEN_DBL_TEST (copysign (0.0, -0.0));
+  GEN_DBL_TEST (copysign (-0.0, 0.0));
+  GEN_DBL_TEST (copysign (-0.0, -0.0));
+  GEN_DBL_TEST (copysign (0.0, 1.0));
+  GEN_DBL_TEST (copysign (0.0, -1.0));
+  GEN_DBL_TEST (copysign (-0.0, 1.0));
+  GEN_DBL_TEST (copysign (-0.0, -1.0));
+  GEN_DBL_TEST (copysign (0.0, INFINITY));
+  GEN_DBL_TEST (copysign (0.0, -INFINITY));
+  GEN_DBL_TEST (copysign (-0.0, INFINITY));
+  GEN_DBL_TEST (copysign (-0.0, -INFINITY));
+  GEN_DBL_TEST (copysign (0.0, NAN));
+  GEN_DBL_TEST (copysign (-0.0, NAN));
+  GEN_DBL_TEST (copysign (1.0, 0.0));
+  GEN_DBL_TEST (copysign (1.0, -0.0));
+  GEN_DBL_TEST (copysign (-1.0, 0.0));
+  GEN_DBL_TEST (copysign (-1.0, -0.0));
+  GEN_DBL_TEST (copysign (1.0, 1.0));
+  GEN_DBL_TEST (copysign (1.0, -1.0));
+  GEN_DBL_TEST (copysign (-1.0, 1.0));
+  GEN_DBL_TEST (copysign (-1.0, -1.0));
+  GEN_DBL_TEST (copysign (1.0, INFINITY));
+  GEN_DBL_TEST (copysign (1.0, -INFINITY));
+  GEN_DBL_TEST (copysign (-1.0, INFINITY));
+  GEN_DBL_TEST (copysign (-1.0, -INFINITY));
+  GEN_DBL_TEST (copysign (1.0, NAN));
+  GEN_DBL_TEST (copysign (-1.0, NAN));
+  GEN_DBL_TEST (copysign (INFINITY, 0.0));
+  GEN_DBL_TEST (copysign (INFINITY, -0.0));
+  GEN_DBL_TEST (copysign (-INFINITY, 0.0));
+  GEN_DBL_TEST (copysign (-INFINITY, -0.0));
+  GEN_DBL_TEST (copysign (INFINITY, 1.0));
+  GEN_DBL_TEST (copysign (INFINITY, -1.0));
+  GEN_DBL_TEST (copysign (-INFINITY, 1.0));
+  GEN_DBL_TEST (copysign (-INFINITY, -1.0));
+  GEN_DBL_TEST (copysign (INFINITY, INFINITY));
+  GEN_DBL_TEST (copysign (INFINITY, -INFINITY));
+  GEN_DBL_TEST (copysign (-INFINITY, INFINITY));
+  GEN_DBL_TEST (copysign (-INFINITY, -INFINITY));
+  GEN_DBL_TEST (copysign (INFINITY, NAN));
+  GEN_DBL_TEST (copysign (-INFINITY, NAN));
+  GEN_DBL_TEST (copysign (NAN, 0.0));
+  GEN_DBL_TEST (copysign (NAN, -0.0));
+  GEN_DBL_TEST (copysign (NAN, 1.0));
+  GEN_DBL_TEST (copysign (NAN, -1.0));
+  GEN_DBL_TEST (copysign (NAN, INFINITY));
+  GEN_DBL_TEST (copysign (NAN, -INFINITY));
+  GEN_DBL_TEST (copysign (NAN, NAN));
+  GEN_DBL_TEST (copysign (3.14, -1.0));
+  GEN_DBL_TEST (copysign (-3.14, 1.0));
+  GEN_DBL_TEST (copysign (1.0, -3.14));
+  GEN_DBL_TEST (copysign (-1.0, 3.14));
+  */
+
+  /* exp tests */
+  GEN_DBL_TEST (exp (0.0));
+  GEN_DBL_TEST (exp (-0.0));
+  GEN_DBL_TEST (exp (1.0));
+  GEN_DBL_TEST (exp (-1.0));
+  GEN_DBL_TEST (exp (INFINITY));
+  GEN_DBL_TEST (exp (-INFINITY));
+  GEN_DBL_TEST (exp (NAN));
+  GEN_DBL_TEST (exp (7.08e+02));
+  GEN_DBL_TEST (exp (7.10e+02));
+  GEN_DBL_TEST (exp (-7.40e+02));
+  GEN_DBL_TEST (exp (-7.50e+02));
+  GEN_DBL_TEST (exp (0.34));
+  GEN_DBL_TEST (exp (-0.34));
+  GEN_DBL_TEST (exp (0.35));
+  GEN_DBL_TEST (exp (-0.35));
+  GEN_DBL_TEST (exp (1.03));
+  GEN_DBL_TEST (exp (-1.03));
+  GEN_DBL_TEST (exp (1.04));
+  GEN_DBL_TEST (exp (-1.04));
+  GEN_DBL_TEST (exp (3.72e-09));
+  GEN_DBL_TEST (exp (-3.72e-09));
+  GEN_DBL_TEST (exp (3.73e-09));
+  GEN_DBL_TEST (exp (-3.73e-09));
+  GEN_DBL_TEST (exp (2.0));
+  GEN_DBL_TEST (exp (3.0));
+  GEN_DBL_TEST (exp (0.7));
+  GEN_DBL_TEST (exp (38.0));
+
+  /* fabs tests */
+  GEN_DBL_TEST (fabs (0.0));
+  GEN_DBL_TEST (fabs (-0.0));
+  GEN_DBL_TEST (fabs (1.0));
+  GEN_DBL_TEST (fabs (-1.0));
+  GEN_DBL_TEST (fabs (INFINITY));
+  GEN_DBL_TEST (fabs (-INFINITY));
+  GEN_DBL_TEST (fabs (NAN));
+  GEN_DBL_TEST (fabs (3.14));
+  GEN_DBL_TEST (fabs (-3.14));
+  GEN_DBL_TEST (fabs (0.7));
+  GEN_DBL_TEST (fabs (-0.7));
+  GEN_DBL_TEST (fabs (3.72e-09));
+  GEN_DBL_TEST (fabs (-3.72e-09));
+  GEN_DBL_TEST (fabs (7.37e+19));
+  GEN_DBL_TEST (fabs (-7.37e+19));
+
+  /* finite tests */
+  /* SKIPPED: not publicly declared in jerry-libm
+  GEN_INT_TEST (finite (0.0));
+  GEN_INT_TEST (finite (-0.0));
+  GEN_INT_TEST (finite (1.0));
+  GEN_INT_TEST (finite (-1.0));
+  GEN_INT_TEST (finite (INFINITY));
+  GEN_INT_TEST (finite (-INFINITY));
+  GEN_INT_TEST (finite (NAN));
+  GEN_INT_TEST (finite (3.14));
+  GEN_INT_TEST (finite (-3.14));
+  GEN_INT_TEST (finite (0.7));
+  GEN_INT_TEST (finite (-0.7));
+  GEN_INT_TEST (finite (3.72e-09));
+  GEN_INT_TEST (finite (-3.72e-09));
+  GEN_INT_TEST (finite (7.37e+19));
+  GEN_INT_TEST (finite (-7.37e+19));
+  */
+
+  /* floor tests */
+  GEN_DBL_TEST (floor (0.0));
+  GEN_DBL_TEST (floor (-0.0));
+  GEN_DBL_TEST (floor (INFINITY));
+  GEN_DBL_TEST (floor (-INFINITY));
+  GEN_DBL_TEST (floor (NAN));
+  GEN_DBL_TEST (floor (3.14));
+  GEN_DBL_TEST (floor (-3.14));
+  GEN_DBL_TEST (floor (3.72e-09));
+  GEN_DBL_TEST (floor (-3.72e-09));
+  GEN_DBL_TEST (floor (7.37e+19));
+  GEN_DBL_TEST (floor (-7.37e+19));
+
+  /* fmod tests */
+  GEN_DBL_TEST (fmod (0.0, 0.0));
+  GEN_DBL_TEST (fmod (0.0, -0.0));
+  GEN_DBL_TEST (fmod (-0.0, 0.0));
+  GEN_DBL_TEST (fmod (-0.0, -0.0));
+  GEN_DBL_TEST (fmod (0.0, 3.0));
+  GEN_DBL_TEST (fmod (0.0, -3.0));
+  GEN_DBL_TEST (fmod (-0.0, 3.0));
+  GEN_DBL_TEST (fmod (-0.0, -3.0));
+  GEN_DBL_TEST (fmod (0.0, INFINITY));
+  GEN_DBL_TEST (fmod (0.0, -INFINITY));
+  GEN_DBL_TEST (fmod (-0.0, INFINITY));
+  GEN_DBL_TEST (fmod (-0.0, -INFINITY));
+  GEN_DBL_TEST (fmod (0.0, NAN));
+  GEN_DBL_TEST (fmod (-0.0, NAN));
+  GEN_DBL_TEST (fmod (3.0, 0.0));
+  GEN_DBL_TEST (fmod (3.0, -0.0));
+  GEN_DBL_TEST (fmod (-3.0, 0.0));
+  GEN_DBL_TEST (fmod (-3.0, -0.0));
+  GEN_DBL_TEST (fmod (3.0, 3.0));
+  GEN_DBL_TEST (fmod (3.0, -3.0));
+  GEN_DBL_TEST (fmod (-3.0, 3.0));
+  GEN_DBL_TEST (fmod (-3.0, -3.0));
+  GEN_DBL_TEST (fmod (3.0, INFINITY));
+  GEN_DBL_TEST (fmod (3.0, -INFINITY));
+  GEN_DBL_TEST (fmod (-3.0, INFINITY));
+  GEN_DBL_TEST (fmod (-3.0, -INFINITY));
+  GEN_DBL_TEST (fmod (3.0, NAN));
+  GEN_DBL_TEST (fmod (-3.0, NAN));
+  GEN_DBL_TEST (fmod (INFINITY, 0.0));
+  GEN_DBL_TEST (fmod (INFINITY, -0.0));
+  GEN_DBL_TEST (fmod (-INFINITY, 0.0));
+  GEN_DBL_TEST (fmod (-INFINITY, -0.0));
+  GEN_DBL_TEST (fmod (INFINITY, 3.0));
+  GEN_DBL_TEST (fmod (INFINITY, -3.0));
+  GEN_DBL_TEST (fmod (-INFINITY, 3.0));
+  GEN_DBL_TEST (fmod (-INFINITY, -3.0));
+  GEN_DBL_TEST (fmod (INFINITY, INFINITY));
+  GEN_DBL_TEST (fmod (INFINITY, -INFINITY));
+  GEN_DBL_TEST (fmod (-INFINITY, INFINITY));
+  GEN_DBL_TEST (fmod (-INFINITY, -INFINITY));
+  GEN_DBL_TEST (fmod (INFINITY, NAN));
+  GEN_DBL_TEST (fmod (-INFINITY, NAN));
+  GEN_DBL_TEST (fmod (NAN, 0.0));
+  GEN_DBL_TEST (fmod (NAN, -0.0));
+  GEN_DBL_TEST (fmod (NAN, 3.0));
+  GEN_DBL_TEST (fmod (NAN, -3.0));
+  GEN_DBL_TEST (fmod (NAN, INFINITY));
+  GEN_DBL_TEST (fmod (NAN, -INFINITY));
+  GEN_DBL_TEST (fmod (NAN, NAN));
+  GEN_DBL_TEST (fmod (3.0, 1.0));
+  GEN_DBL_TEST (fmod (3.0, -1.0));
+  GEN_DBL_TEST (fmod (-3.0, 1.0));
+  GEN_DBL_TEST (fmod (-3.0, -1.0));
+  GEN_DBL_TEST (fmod (6.5, 2.3));
+  GEN_DBL_TEST (fmod (6.5, -2.3));
+  GEN_DBL_TEST (fmod (-6.5, 2.3));
+  GEN_DBL_TEST (fmod (-6.5, -2.3));
+
+  /* isnan tests */
+  GEN_INT_TEST (isnan (0.0));
+  GEN_INT_TEST (isnan (-0.0));
+  GEN_INT_TEST (isnan (1.0));
+  GEN_INT_TEST (isnan (-1.0));
+  GEN_INT_TEST (isnan (INFINITY));
+  GEN_INT_TEST (isnan (-INFINITY));
+  GEN_INT_TEST (isnan (NAN));
+  GEN_INT_TEST (isnan (3.14));
+  GEN_INT_TEST (isnan (-3.14));
+  GEN_INT_TEST (isnan (0.7));
+  GEN_INT_TEST (isnan (-0.7));
+  GEN_INT_TEST (isnan (3.72e-09));
+  GEN_INT_TEST (isnan (-3.72e-09));
+  GEN_INT_TEST (isnan (7.37e+19));
+  GEN_INT_TEST (isnan (-7.37e+19));
+
+  /* log tests */
+  GEN_DBL_TEST (log (0.0));
+  GEN_DBL_TEST (log (-0.0));
+  GEN_DBL_TEST (log (1.0));
+  GEN_DBL_TEST (log (-1.0));
+  GEN_DBL_TEST (log (INFINITY));
+  GEN_DBL_TEST (log (-INFINITY));
+  GEN_DBL_TEST (log (NAN));
+  GEN_DBL_TEST (log (M_E));
+  GEN_DBL_TEST (log (1.0 / M_E));
+  GEN_DBL_TEST (log (2));
+  GEN_DBL_TEST (log (10));
+  GEN_DBL_TEST (log (0.7));
+  GEN_DBL_TEST (log (2.22e-308));
+  GEN_DBL_TEST (log (2.23e-308));
+  GEN_DBL_TEST (log (0.17));
+  GEN_DBL_TEST (log (0.18));
+  GEN_DBL_TEST (log (1999.0));
+  GEN_DBL_TEST (log (2000.0));
+  GEN_DBL_TEST (log (2001.0));
+
+  /* pow tests */
+  GEN_DBL_TEST (pow (0.0, 0.0));
+  GEN_DBL_TEST (pow (0.0, -0.0));
+  GEN_DBL_TEST (pow (-0.0, 0.0));
+  GEN_DBL_TEST (pow (-0.0, -0.0));
+  GEN_DBL_TEST (pow (0.0, 1.0));
+  GEN_DBL_TEST (pow (0.0, -1.0));
+  GEN_DBL_TEST (pow (-0.0, 1.0));
+  GEN_DBL_TEST (pow (-0.0, -1.0));
+  GEN_DBL_TEST (pow (0.0, INFINITY));
+  GEN_DBL_TEST (pow (0.0, -INFINITY));
+  GEN_DBL_TEST (pow (-0.0, INFINITY));
+  GEN_DBL_TEST (pow (-0.0, -INFINITY));
+  GEN_DBL_TEST (pow (0.0, NAN));
+  GEN_DBL_TEST (pow (-0.0, NAN));
+  GEN_DBL_TEST (pow (1.0, 0.0));
+  GEN_DBL_TEST (pow (1.0, -0.0));
+  GEN_DBL_TEST (pow (-1.0, 0.0));
+  GEN_DBL_TEST (pow (-1.0, -0.0));
+  GEN_DBL_TEST (pow (1.0, 1.0));
+  GEN_DBL_TEST (pow (1.0, -1.0));
+  GEN_DBL_TEST (pow (-1.0, 1.0));
+  GEN_DBL_TEST (pow (-1.0, -1.0));
+  GEN_DBL_TEST (pow (1.0, INFINITY));
+  GEN_DBL_TEST (pow (1.0, -INFINITY));
+  GEN_DBL_TEST (pow (-1.0, INFINITY));
+  GEN_DBL_TEST (pow (-1.0, -INFINITY));
+  GEN_DBL_TEST (pow (1.0, NAN));
+  GEN_DBL_TEST (pow (-1.0, NAN));
+  GEN_DBL_TEST (pow (INFINITY, 0.0));
+  GEN_DBL_TEST (pow (INFINITY, -0.0));
+  GEN_DBL_TEST (pow (-INFINITY, 0.0));
+  GEN_DBL_TEST (pow (-INFINITY, -0.0));
+  GEN_DBL_TEST (pow (INFINITY, 1.0));
+  GEN_DBL_TEST (pow (INFINITY, -1.0));
+  GEN_DBL_TEST (pow (-INFINITY, 1.0));
+  GEN_DBL_TEST (pow (-INFINITY, -1.0));
+  GEN_DBL_TEST (pow (INFINITY, INFINITY));
+  GEN_DBL_TEST (pow (INFINITY, -INFINITY));
+  GEN_DBL_TEST (pow (-INFINITY, INFINITY));
+  GEN_DBL_TEST (pow (-INFINITY, -INFINITY));
+  GEN_DBL_TEST (pow (INFINITY, NAN));
+  GEN_DBL_TEST (pow (-INFINITY, NAN));
+  GEN_DBL_TEST (pow (NAN, 0.0));
+  GEN_DBL_TEST (pow (NAN, -0.0));
+  GEN_DBL_TEST (pow (NAN, 1.0));
+  GEN_DBL_TEST (pow (NAN, -1.0));
+  GEN_DBL_TEST (pow (NAN, INFINITY));
+  GEN_DBL_TEST (pow (NAN, -INFINITY));
+  GEN_DBL_TEST (pow (NAN, NAN));
+  GEN_DBL_TEST (pow (0.9, INFINITY));
+  GEN_DBL_TEST (pow (0.9, -INFINITY));
+  GEN_DBL_TEST (pow (-0.9, INFINITY));
+  GEN_DBL_TEST (pow (-0.9, -INFINITY));
+  GEN_DBL_TEST (pow (1.1, INFINITY));
+  GEN_DBL_TEST (pow (1.1, -INFINITY));
+  GEN_DBL_TEST (pow (-1.1, INFINITY));
+  GEN_DBL_TEST (pow (-1.1, -INFINITY));
+  GEN_DBL_TEST (pow (0.0, 2.0));
+  GEN_DBL_TEST (pow (0.0, -2.0));
+  GEN_DBL_TEST (pow (-0.0, 2.0));
+  GEN_DBL_TEST (pow (-0.0, -2.0));
+  GEN_DBL_TEST (pow (0.0, 3.0));
+  GEN_DBL_TEST (pow (0.0, -3.0));
+  GEN_DBL_TEST (pow (-0.0, 3.0));
+  GEN_DBL_TEST (pow (-0.0, -3.0));
+  GEN_DBL_TEST (pow (0.0, 3.14));
+  GEN_DBL_TEST (pow (0.0, -3.14));
+  GEN_DBL_TEST (pow (-0.0, 3.14));
+  GEN_DBL_TEST (pow (-0.0, -3.14));
+  GEN_DBL_TEST (pow (1.0, 3.14));
+  GEN_DBL_TEST (pow (1.0, -3.14));
+  GEN_DBL_TEST (pow (-1.0, 3.14));
+  GEN_DBL_TEST (pow (-1.0, -3.14));
+  GEN_DBL_TEST (pow (3.14, 0.0));
+  GEN_DBL_TEST (pow (3.14, -0.0));
+  GEN_DBL_TEST (pow (-3.14, 0.0));
+  GEN_DBL_TEST (pow (-3.14, -0.0));
+  GEN_DBL_TEST (pow (3.14, 1.0));
+  GEN_DBL_TEST (pow (3.14, -1.0));
+  GEN_DBL_TEST (pow (-3.14, 1.0));
+  GEN_DBL_TEST (pow (-3.14, -1.0));
+  GEN_DBL_TEST (pow (3.14, 2.0));
+  GEN_DBL_TEST (pow (3.14, -2.0));
+  GEN_DBL_TEST (pow (-3.14, 2.0));
+  GEN_DBL_TEST (pow (-3.14, -2.0));
+  GEN_DBL_TEST (pow (3.14, 3.0));
+  GEN_DBL_TEST (pow (3.14, -3.0));
+  GEN_DBL_TEST (pow (-3.14, 3.0));
+  GEN_DBL_TEST (pow (-3.14, -3.0));
+  GEN_DBL_TEST (pow (3.14, 3.14));
+  GEN_DBL_TEST (pow (3.14, -3.14));
+  GEN_DBL_TEST (pow (-3.14, 3.14));
+  GEN_DBL_TEST (pow (-3.14, -3.14));
+  GEN_DBL_TEST (pow (INFINITY, 2.0));
+  GEN_DBL_TEST (pow (INFINITY, -2.0));
+  GEN_DBL_TEST (pow (-INFINITY, 2.0));
+  GEN_DBL_TEST (pow (-INFINITY, -2.0));
+  GEN_DBL_TEST (pow (INFINITY, 3.0));
+  GEN_DBL_TEST (pow (INFINITY, -3.0));
+  GEN_DBL_TEST (pow (-INFINITY, 3.0));
+  GEN_DBL_TEST (pow (-INFINITY, -3.0));
+  GEN_DBL_TEST (pow (INFINITY, 3.14));
+  GEN_DBL_TEST (pow (INFINITY, -3.14));
+  GEN_DBL_TEST (pow (-INFINITY, 3.14));
+  GEN_DBL_TEST (pow (-INFINITY, -3.14));
+  GEN_DBL_TEST (pow (0.7, 1.2));
+
+  /* scalbn tests */
+  /* SKIPPED: not publicly declared in jerry-libm
+  GEN_DBL_TEST (scalbn (0.0, 0));
+  GEN_DBL_TEST (scalbn (-0.0, 0));
+  GEN_DBL_TEST (scalbn (0.0, 1));
+  GEN_DBL_TEST (scalbn (0.0, -1));
+  GEN_DBL_TEST (scalbn (-0.0, 1));
+  GEN_DBL_TEST (scalbn (-0.0, -1));
+  GEN_DBL_TEST (scalbn (1.0, 0));
+  GEN_DBL_TEST (scalbn (-1.0, 0));
+  GEN_DBL_TEST (scalbn (1.0, 1));
+  GEN_DBL_TEST (scalbn (1.0, -1));
+  GEN_DBL_TEST (scalbn (-1.0, 1));
+  GEN_DBL_TEST (scalbn (-1.0, -1));
+  GEN_DBL_TEST (scalbn (INFINITY, 0));
+  GEN_DBL_TEST (scalbn (-INFINITY, 0));
+  GEN_DBL_TEST (scalbn (INFINITY, 1));
+  GEN_DBL_TEST (scalbn (INFINITY, -1));
+  GEN_DBL_TEST (scalbn (-INFINITY, 1));
+  GEN_DBL_TEST (scalbn (-INFINITY, -1));
+  GEN_DBL_TEST (scalbn (NAN, 0));
+  GEN_DBL_TEST (scalbn (NAN, 1));
+  GEN_DBL_TEST (scalbn (NAN, -1));
+  GEN_DBL_TEST (scalbn (3.14, -1));
+  GEN_DBL_TEST (scalbn (-3.14, 1));
+  GEN_DBL_TEST (scalbn (0.7, 4));
+  GEN_DBL_TEST (scalbn (0.7, -4));
+  GEN_DBL_TEST (scalbn (-0.7, 4));
+  GEN_DBL_TEST (scalbn (-0.7, -4));
+  GEN_DBL_TEST (scalbn (0.8, 5));
+  GEN_DBL_TEST (scalbn (0.8, -5));
+  GEN_DBL_TEST (scalbn (-0.8, 5));
+  GEN_DBL_TEST (scalbn (-0.8, -5));
+  GEN_DBL_TEST (scalbn (5.55e-18, 49999));
+  GEN_DBL_TEST (scalbn (5.55e-18, 50000));
+  GEN_DBL_TEST (scalbn (5.55e-18, 50001));
+  GEN_DBL_TEST (scalbn (1.0, -49999));
+  GEN_DBL_TEST (scalbn (1.0, -50000));
+  GEN_DBL_TEST (scalbn (1.0, -50001));
+  */
+
+  /* sqrt tests */
+  GEN_DBL_TEST (sqrt (0.0));
+  GEN_DBL_TEST (sqrt (-0.0));
+  GEN_DBL_TEST (sqrt (1.0));
+  GEN_DBL_TEST (sqrt (-1.0));
+  GEN_DBL_TEST (sqrt (INFINITY));
+  GEN_DBL_TEST (sqrt (-INFINITY));
+  GEN_DBL_TEST (sqrt (NAN));
+  GEN_DBL_TEST (sqrt (0.7));
+  GEN_DBL_TEST (sqrt (2));
+  GEN_DBL_TEST (sqrt (10));
+  GEN_DBL_TEST (sqrt (2.22e-308));
+  GEN_DBL_TEST (sqrt (2.23e-308));
+  GEN_DBL_TEST (sqrt (3.72e-09));
+  GEN_DBL_TEST (sqrt (7.37e+19));
+  GEN_DBL_TEST (sqrt (2209));
+  GEN_DBL_TEST (sqrt (4));
+  GEN_DBL_TEST (sqrt (0.25));
+  GEN_DBL_TEST (sqrt (6642.25));
+  GEN_DBL_TEST (sqrt (15239.9025));
+
+  /* sin tests */
+  GEN_DBL_TEST (sin (0.0));
+  GEN_DBL_TEST (sin (-0.0));
+  GEN_DBL_TEST (sin (1.0));
+  GEN_DBL_TEST (sin (-1.0));
+  GEN_DBL_TEST (sin (INFINITY));
+  GEN_DBL_TEST (sin (-INFINITY));
+  GEN_DBL_TEST (sin (NAN));
+  GEN_DBL_TEST (sin (M_PI));
+  GEN_DBL_TEST (sin (-M_PI));
+  GEN_DBL_TEST (sin (2.0 * M_PI));
+  GEN_DBL_TEST (sin (-2.0 * M_PI));
+  GEN_DBL_TEST (sin (M_PI / 2.0));
+  GEN_DBL_TEST (sin (-M_PI / 2.0));
+  GEN_DBL_TEST (sin (M_PI / 3.0));
+  GEN_DBL_TEST (sin (-M_PI / 3.0));
+  GEN_DBL_TEST (sin (M_PI / 4.0));
+  GEN_DBL_TEST (sin (-M_PI / 4.0));
+  GEN_DBL_TEST (sin (M_PI / 6.0));
+  GEN_DBL_TEST (sin (-M_PI / 6.0));
+  GEN_DBL_TEST (sin (M_PI * 2.0 / 3.0));
+  GEN_DBL_TEST (sin (-M_PI * 2.0 / 3.0));
+  GEN_DBL_TEST (sin (M_PI * 5.0 / 6.0));
+  GEN_DBL_TEST (sin (-M_PI * 5.0 / 6.0));
+  GEN_DBL_TEST (sin (6.9e-18));
+  GEN_DBL_TEST (sin (-6.9e-18));
+  GEN_DBL_TEST (sin (7.0e-18));
+  GEN_DBL_TEST (sin (-7.0e-18));
+  GEN_DBL_TEST (sin (7.4e-9));
+  GEN_DBL_TEST (sin (-7.4e-9));
+  GEN_DBL_TEST (sin (7.5e-9));
+  GEN_DBL_TEST (sin (-7.5e-9));
+  GEN_DBL_TEST (sin (0.2));
+  GEN_DBL_TEST (sin (-0.2));
+  GEN_DBL_TEST (sin (0.4));
+  GEN_DBL_TEST (sin (-0.4));
+  GEN_DBL_TEST (sin (0.7));
+  GEN_DBL_TEST (sin (-0.7));
+  GEN_DBL_TEST (sin (0.8));
+  GEN_DBL_TEST (sin (-0.8));
+  GEN_DBL_TEST (sin (3.0));
+  GEN_DBL_TEST (sin (-3.0));
+  GEN_DBL_TEST (sin (4.0));
+  GEN_DBL_TEST (sin (-4.0));
+  GEN_DBL_TEST (sin (6.0));
+  GEN_DBL_TEST (sin (-6.0));
+  GEN_DBL_TEST (sin (7.0));
+  GEN_DBL_TEST (sin (-7.0));
+
+  /* cos tests */
+  GEN_DBL_TEST (cos (0.0));
+  GEN_DBL_TEST (cos (-0.0));
+  GEN_DBL_TEST (cos (1.0));
+  GEN_DBL_TEST (cos (-1.0));
+  GEN_DBL_TEST (cos (INFINITY));
+  GEN_DBL_TEST (cos (-INFINITY));
+  GEN_DBL_TEST (cos (NAN));
+  GEN_DBL_TEST (cos (M_PI));
+  GEN_DBL_TEST (cos (-M_PI));
+  GEN_DBL_TEST (cos (2.0 * M_PI));
+  GEN_DBL_TEST (cos (-2.0 * M_PI));
+  GEN_DBL_TEST (cos (M_PI / 2.0));
+  GEN_DBL_TEST (cos (-M_PI / 2.0));
+  GEN_DBL_TEST (cos (M_PI / 3.0));
+  GEN_DBL_TEST (cos (-M_PI / 3.0));
+  GEN_DBL_TEST (cos (M_PI / 4.0));
+  GEN_DBL_TEST (cos (-M_PI / 4.0));
+  GEN_DBL_TEST (cos (M_PI / 6.0));
+  GEN_DBL_TEST (cos (-M_PI / 6.0));
+  GEN_DBL_TEST (cos (M_PI * 2.0 / 3.0));
+  GEN_DBL_TEST (cos (-M_PI * 2.0 / 3.0));
+  GEN_DBL_TEST (cos (M_PI * 5.0 / 6.0));
+  GEN_DBL_TEST (cos (-M_PI * 5.0 / 6.0));
+  GEN_DBL_TEST (cos (6.9e-18));
+  GEN_DBL_TEST (cos (-6.9e-18));
+  GEN_DBL_TEST (cos (7.0e-18));
+  GEN_DBL_TEST (cos (-7.0e-18));
+  GEN_DBL_TEST (cos (7.4e-9));
+  GEN_DBL_TEST (cos (-7.4e-9));
+  GEN_DBL_TEST (cos (7.5e-9));
+  GEN_DBL_TEST (cos (-7.5e-9));
+  GEN_DBL_TEST (cos (0.2));
+  GEN_DBL_TEST (cos (-0.2));
+  GEN_DBL_TEST (cos (0.4));
+  GEN_DBL_TEST (cos (-0.4));
+  GEN_DBL_TEST (cos (0.7));
+  GEN_DBL_TEST (cos (-0.7));
+  GEN_DBL_TEST (cos (0.8));
+  GEN_DBL_TEST (cos (-0.8));
+  GEN_DBL_TEST (cos (3.0));
+  GEN_DBL_TEST (cos (-3.0));
+  GEN_DBL_TEST (cos (4.0));
+  GEN_DBL_TEST (cos (-4.0));
+  GEN_DBL_TEST (cos (6.0));
+  GEN_DBL_TEST (cos (-6.0));
+  GEN_DBL_TEST (cos (7.0));
+  GEN_DBL_TEST (cos (-7.0));
+
+  /* tan tests */
+  GEN_DBL_TEST (tan (0.0));
+  GEN_DBL_TEST (tan (-0.0));
+  GEN_DBL_TEST (tan (1.0));
+  GEN_DBL_TEST (tan (-1.0));
+  GEN_DBL_TEST (tan (INFINITY));
+  GEN_DBL_TEST (tan (-INFINITY));
+  GEN_DBL_TEST (tan (NAN));
+  GEN_DBL_TEST (tan (M_PI));
+  GEN_DBL_TEST (tan (-M_PI));
+  GEN_DBL_TEST (tan (2.0 * M_PI));
+  GEN_DBL_TEST (tan (-2.0 * M_PI));
+  GEN_DBL_TEST (tan (M_PI / 2.0));
+  GEN_DBL_TEST (tan (-M_PI / 2.0));
+  GEN_DBL_TEST (tan (M_PI / 3.0));
+  GEN_DBL_TEST (tan (-M_PI / 3.0));
+  GEN_DBL_TEST (tan (M_PI / 4.0));
+  GEN_DBL_TEST (tan (-M_PI / 4.0));
+  GEN_DBL_TEST (tan (M_PI / 6.0));
+  GEN_DBL_TEST (tan (-M_PI / 6.0));
+  GEN_DBL_TEST (tan (M_PI * 2.0 / 3.0));
+  GEN_DBL_TEST (tan (-M_PI * 2.0 / 3.0));
+  GEN_DBL_TEST (tan (M_PI * 5.0 / 6.0));
+  GEN_DBL_TEST (tan (-M_PI * 5.0 / 6.0));
+  GEN_DBL_TEST (tan (3.7e-9));
+  GEN_DBL_TEST (tan (-3.7e-9));
+  GEN_DBL_TEST (tan (3.8e-9));
+  GEN_DBL_TEST (tan (-3.8e-9));
+  GEN_DBL_TEST (tan (0.6));
+  GEN_DBL_TEST (tan (-0.6));
+  GEN_DBL_TEST (tan (0.7));
+  GEN_DBL_TEST (tan (-0.7));
+  GEN_DBL_TEST (tan (3.0));
+  GEN_DBL_TEST (tan (-3.0));
+  GEN_DBL_TEST (tan (4.0));
+  GEN_DBL_TEST (tan (-4.0));
+  GEN_DBL_TEST (tan (6.0));
+  GEN_DBL_TEST (tan (-6.0));
+  GEN_DBL_TEST (tan (7.0));
+  GEN_DBL_TEST (tan (-7.0));
+} /* main */
diff --git a/deps/jerry/tools/update-webpage.sh b/deps/jerry/tools/update-webpage.sh
new file mode 100755 (executable)
index 0000000..6fef58e
--- /dev/null
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+# 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.
+
+if [ $# -ne 1 ]; then
+  echo "Please, specify your gh-pages clone directory: update-webpage <gh-pages clone dir>"
+  exit 1
+fi
+
+gh_pages_dir=$1
+docs_dir=`dirname $(readlink -f $0)`"/../docs"
+
+GETTING_STARTED_MD="01.GETTING-STARTED.md"
+API_REFERENCE_MD="02.API-REFERENCE.md"
+API_EXAMPLES_MD="03.API-EXAMPLE.md"
+INTERNALS_MD="04.INTERNALS.md"
+PORT_API_MD="05.PORT-API.md"
+REFERENCE_COUNTING_MD="06.REFERENCE-COUNTING.md"
+DEBUGGER_MD="07.DEBUGGER.md"
+CODING_STANDARDS_MD="08.CODING-STANDARDS.md"
+EXT_REFERENCE_ARG_MD="09.EXT-REFERENCE-ARG.md"
+EXT_REFERENCE_HANDLER_MD="10.EXT-REFERENCE-HANDLER.md"
+EXT_REFERENCE_AUTORELEASE_MD="11.EXT-REFERENCE-AUTORELEASE.md"
+EXT_REFERENCE_MODULE_MD="12.EXT-REFERENCE-MODULE.md"
+
+declare -A titles
+
+titles[$GETTING_STARTED_MD]="Getting Started"
+titles[$API_REFERENCE_MD]="API Reference"
+titles[$API_EXAMPLES_MD]="API Examples"
+titles[$INTERNALS_MD]="Internals"
+titles[$PORT_API_MD]="Port API"
+titles[$REFERENCE_COUNTING_MD]="Reference Counting"
+titles[$DEBUGGER_MD]="Debugger"
+titles[$CODING_STANDARDS_MD]="Coding Standards"
+titles[$EXT_REFERENCE_ARG_MD]="'Extension API: Argument Validation'"
+titles[$EXT_REFERENCE_HANDLER_MD]="'Extension API: External Function Handlers'"
+titles[$EXT_REFERENCE_AUTORELEASE_MD]="'Extension API: Autorelease Values'"
+titles[$EXT_REFERENCE_MODULE_MD]="'Extension API: Module Support'"
+
+for docfile in $docs_dir/*.md; do
+  docfile_base=`basename $docfile`
+
+  permalink=`echo $docfile_base | cut -d'.' -f 2 | tr '[:upper:]' '[:lower:]'`
+  missing_title=`echo $permalink | tr '-' ' '`
+
+  # the first three documents belong to the navigation bar
+  category=$([[ $docfile_base =~ ^0[1-3] ]] && echo "navbar" || echo "documents")
+
+  # generate appropriate header for each *.md
+  echo "---"                                             >  $gh_pages_dir/$docfile_base
+  echo "layout: page"                                    >> $gh_pages_dir/$docfile_base
+  echo "title: ${titles[$docfile_base]:-$missing_title}" >> $gh_pages_dir/$docfile_base
+  echo "category: ${category}"                           >> $gh_pages_dir/$docfile_base
+  echo "permalink: /$permalink/"                         >> $gh_pages_dir/$docfile_base
+  echo "---"                                             >> $gh_pages_dir/$docfile_base
+  echo                                                   >> $gh_pages_dir/$docfile_base
+  echo "* toc"                                           >> $gh_pages_dir/$docfile_base
+  echo "{:toc}"                                          >> $gh_pages_dir/$docfile_base
+  echo                                                   >> $gh_pages_dir/$docfile_base
+
+  # the file itself removing underscores inside links
+  gawk \
+  '
+  !/\[.*\]\(#/ {
+    print $0
+  }
+
+  /\[.*\]\(#/ {
+    link_start_pos = index($0, "](#");
+    line_beg = substr($0, 1, link_start_pos+2);
+    line_remain = substr($0, link_start_pos+3);
+    link_end_pos = index(line_remain, ")")
+    link = substr(line_remain, 1, link_end_pos-1);
+    line_end = substr(line_remain, link_end_pos)
+
+    printf "%s%s%s\n", line_beg, link, line_end
+  }
+  ' $docfile                                             >> $gh_pages_dir/$docfile_base
+
+  # fix image links
+  sed -i -r -e 's/^!\[.*\]\(/&{{ site.github.url }}\//' $gh_pages_dir/$docfile_base
+  sed -i -r -e 's/^!\[.*\]\(\{\{ site\.github\.url \}\}\/img.*$/&{: class="thumbnail center-block img-responsive" }/' $gh_pages_dir/$docfile_base
+
+  # replace span tags to div
+  sed -i 's/<span class=/<div class=/g' $gh_pages_dir/$docfile_base
+  sed -i 's/<\/span>/<\/div>/g' $gh_pages_dir/$docfile_base
+
+  # remove table header separators
+  sed -i '/^| ---/d' $gh_pages_dir/$docfile_base
+
+  # update images
+  cp -Ru $docs_dir/img $gh_pages_dir
+done
diff --git a/deps/jerry/tools/vera++/profiles/jerry b/deps/jerry/tools/vera++/profiles/jerry
new file mode 100644 (file)
index 0000000..23fa097
--- /dev/null
@@ -0,0 +1,17 @@
+set rules {
+    jerry_always_curly
+    jerry_braces_on_separate_line
+    jerry_braces_same_line_or_column
+    jerry_comment_function_end
+    jerry_funcname_space_parentheses
+    jerry_identifier_no_space_bracket
+    jerry_indentation
+    jerry_max_line_length
+    jerry_no_space_after_opening_parentheses
+    jerry_no_space_before_closing_parentheses
+    jerry_no_tabs
+    jerry_no_trailing_spaces
+    jerry_pointer_declarator_space
+    jerry_switch_case
+    jerry_typecast_space_parentheses
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_always_curly.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_always_curly.tcl
new file mode 100644 (file)
index 0000000..ec5dd74
--- /dev/null
@@ -0,0 +1,87 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+foreach file_name [getSourceFileNames] {
+    set state "control"
+    set do_marks {}
+    set prev_tok_type ""
+    set prev_ctrl ""
+    set expect_while false
+    set expect_open_brace false
+    set paren_count 0
+
+    foreach token [getTokens $file_name 1 0 -1 -1 {if do while else for leftparen rightparen semicolon leftbrace rightbrace}] {
+        set tok_val [lindex $token 0]
+        set line_num [lindex $token 1]
+        set col_num [lindex $token 2]
+        set tok_type [lindex $token 3]
+
+        if {$state == "expression"} {
+            # puts "expression $paren_count $tok_type ($line_num , $col_num)"
+            if {$tok_type == "leftparen"} {
+                incr paren_count
+            } elseif {$tok_type == "rightparen"} {
+                incr paren_count -1
+                if {$paren_count == 0} {
+                    set state "control"
+                    set expect_open_brace true
+                } elseif {$paren_count < 0 } {
+                    report $file_name $line_num "unexpected right parentheses"
+                }
+            } elseif {$tok_type != "semicolon"} {
+                report $file_name $line_num "unexpected token: $tok_type"
+            }
+        } else {
+            if {$expect_open_brace == true} {
+                if {$tok_type == "if" && $prev_tok_type == "else"} {
+                    # empty
+                } elseif {$tok_type != "leftbrace"} {
+                    report $file_name [lindex $prev_ctrl 1] "brace after \'[lindex $prev_ctrl 3]\' required"
+                }
+                set expect_open_brace false
+            }
+
+            if {$tok_type == "while" && ($expect_while == true || [lindex $prev_ctrl 3] == "do")} {
+                set expect_while false
+                set prev_ctrl ""
+            } elseif {$tok_type in {if for while}} {
+                set state "expression"
+                set prev_ctrl $token
+            } elseif {$tok_type in {do else}} {
+                set expect_open_brace true
+                set prev_ctrl $token
+            } elseif {$tok_type == "leftbrace"} {
+                if {[lindex $prev_ctrl 3] == "do"} {
+                    lappend do_marks 1
+                } else {
+                    lappend do_marks 0
+                }
+                set prev_ctrl ""
+            } elseif {$tok_type == "rightbrace"} {
+                if {[llength $do_marks] > 0} {
+                    if {[lindex $do_marks end] == 1} {
+                        set expect_while true
+                    }
+                    set do_marks [lreplace $do_marks end end]
+                } else {
+                    report $file_name $line_num "unmatched brace"
+                }
+            }
+        }
+
+        set prev_tok_type $tok_type
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_braces_on_separate_line.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_braces_on_separate_line.tcl
new file mode 100644 (file)
index 0000000..c142948
--- /dev/null
@@ -0,0 +1,115 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+foreach file_name [getSourceFileNames] {
+    set state "normal"
+    set lines {}
+    set cols {}
+    set struct_marks {}
+    set expect_struct_name false
+    set prev_tok ""
+    set def_start false
+    set expect_newline false
+    set check_newline true
+
+    foreach token [getTokens $file_name 1 0 -1 -1 {}] {
+        set tok_val [lindex $token 0]
+        set line_num [lindex $token 1]
+        set col_num [lindex $token 2]
+        set tok_type [lindex $token 3]
+
+        if {$state == "macro"} {
+            if {$col_num == 0} {
+                set state "normal"
+            } else {
+                continue
+            }
+        }
+
+        if {$tok_type in {space ccomment cppcomment newline}} {
+            continue
+        }
+
+        if {$tok_type == "pp_define"} {
+            set state "macro"
+            set prev_tok ""
+            set def_start false
+            continue
+        }
+
+        if {$expect_struct_name == true} {
+            if {$tok_type == "identifier" && $line_num != [lindex $prev_tok 1]} {
+                report $file_name $line_num "type name should be on the same line with the rightbrace"
+            }
+            set expect_struct_name false
+        }
+
+        # check that rightbrace and typename (in struct, union and enum definitons) are on the same line
+        if {$tok_type in {struct enum union}} {
+            set def_start true
+        } elseif {$tok_type == "semicolon"} {
+            set def_start false
+        } elseif {$tok_type == "leftbrace"} {
+            lappend cols $col_num
+            lappend lines $line_num
+            if {$def_start == true} {
+                lappend struct_marks 1
+                set def_start false
+            } elseif {[lindex $prev_tok 3] == "assign"} {
+                lappend struct_marks 2
+                set check_newline false
+            } else {
+                lappend struct_marks 0
+            }
+        } elseif {$tok_type == "rightbrace"} {
+            if {[llength $lines] > 0} {
+                if {[lindex $struct_marks end] == 1} {
+                    set expect_struct_name true
+                    set check_newline false
+                } elseif {[lindex $struct_marks end] == 2} {
+                    set check_newline false
+                }
+                set lines [lreplace $lines end end]
+                set cols [lreplace $cols end end]
+                set struct_marks [lreplace $struct_marks end end]
+            } else {
+                report $file_name $line_num "unmatched brace"
+            }
+        }
+
+        # check that braces are on separate lines
+        if {$check_newline == true} {
+            if {$expect_newline == true} {
+                if {$tok_type == "semicolon"} {
+                    # empty
+                } elseif {[lindex $prev_tok 1] == $line_num} {
+                    report $file_name $line_num "brace should be placed on a separate line"
+                } else {
+                    set expect_newline false
+                }
+            } elseif {$tok_type in {leftbrace rightbrace}} {
+                if {[lindex $prev_tok 1] == $line_num} {
+                    report $file_name $line_num "brace should be placed on a separate line"
+                }
+                set expect_newline true
+            }
+        } else {
+            set check_newline true
+        }
+
+        set prev_tok $token
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_braces_same_line_or_column.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_braces_same_line_or_column.tcl
new file mode 100644 (file)
index 0000000..821f447
--- /dev/null
@@ -0,0 +1,61 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+foreach file_name [getSourceFileNames] {
+    set state "normal"
+    set lines {}
+    set cols {}
+
+    foreach token [getTokens $file_name 1 0 -1 -1 {}] {
+        set tok_val [lindex $token 0]
+        set line_num [lindex $token 1]
+        set col_num [lindex $token 2]
+        set tok_type [lindex $token 3]
+
+        if {$state == "macro"} {
+            if {$col_num == 0} {
+                set state "normal"
+            } else {
+                set prev_tok_line $line_num
+                continue
+            }
+        }
+
+        if {$tok_type in {space ccomment cppcomment newline}} {
+            continue
+        }
+
+        if {$tok_type == "pp_define"} {
+            set state "macro"
+            continue
+        }
+
+        if {$tok_type == "leftbrace"} {
+            lappend cols $col_num
+            lappend lines $line_num
+        } elseif {$tok_type == "rightbrace"} {
+            if {[llength $lines] > 0} {
+                if {[lindex $lines end] != $line_num && [lindex $cols end] != $col_num} {
+                    report $file_name $line_num "matching braces should be on the same line or column"
+                }
+                set lines [lreplace $lines end end]
+                set cols [lreplace $cols end end]
+            } else {
+                report $file_name $line_num "unmatched brace"
+            }
+        }
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_comment_function_end.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_comment_function_end.tcl
new file mode 100644 (file)
index 0000000..e94a271
--- /dev/null
@@ -0,0 +1,52 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+foreach fileName [getSourceFileNames] {
+    set funcStart 0
+    set funcName ""
+    set lineNumber 1
+    foreach line [getAllLines $fileName] {
+        if {[regexp {^((static |const )*\w+ )*\w+ \(.*[,\)]} $line]} {
+            set type {}
+            set modifier {}
+            if {$funcStart == 0} {
+                regexp {^((static |const )*\w+ )*(\w+) \(} $line matched type modifier funcName
+            }
+        }
+
+        if {[regexp {^\{$} $line]} {
+            set funcStart 1
+        }
+
+        if {$funcStart == 1} {
+            if {[regexp {^\}$} $line] && [string length $funcName] != 0} {
+                report $fileName $lineNumber "missing comment at the end of function: /* $funcName */"
+                set funcStart 0
+            } elseif {[regexp {^\} /\*\s*\w+\s*\*/$} $line] && [string length $funcName] != 0} {
+                set comment {}
+                regexp {^\} /\*\s*(\w+)\s*\*/$} $line -> comment
+                if {$comment != $funcName} {
+                    report $fileName $lineNumber "comment missmatch. (Current: $comment, Expected: $funcName) "
+                }
+                set funcStart 0
+            } elseif {[regexp {^\}.*;?$} $line]} {
+                set funcStart 0
+            }
+        }
+
+        incr lineNumber
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_funcname_space_parentheses.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_funcname_space_parentheses.tcl
new file mode 100644 (file)
index 0000000..c012736
--- /dev/null
@@ -0,0 +1,60 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+proc check_part_of_the_file {file line_num col_start col_end} {
+    if {$col_start == $col_end} {
+        return
+    }
+    set line [getLine $file $line_num]
+
+    if {[regexp {^\s*#[ ]*define} $line]} {
+        return
+    }
+
+    set line [string range $line $col_start $col_end]
+
+    if {[regexp {([[:alnum:]][\s]{2,}\()|([[:alnum:]]\()} $line]} {
+        report $file $line_num "there should be exactly one space before left parentheses"
+    }
+}
+
+foreach fileName [getSourceFileNames] {
+    set checkLine 1
+    set checkColStart 0
+    set seenOmitToken false
+    foreach token [getTokens $fileName 1 0 -1 -1 {}] {
+        set lineNumber [lindex $token 1]
+        set colNumber [lindex $token 2]
+        set tokenType [lindex $token 3]
+
+        if {$checkLine != $lineNumber} {
+            if {!$seenOmitToken} {
+                check_part_of_the_file $fileName $checkLine $checkColStart end
+            }
+            set checkColStart $colNumber
+            set checkLine $lineNumber
+        } elseif {$seenOmitToken} {
+            set checkColStart $colNumber
+        }
+
+        if {$tokenType in {ccomment cppcomment stringlit}} {
+            check_part_of_the_file $fileName $checkLine $checkColStart $colNumber
+            set seenOmitToken true
+        } else {
+            set seenOmitToken false
+        }
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_identifier_no_space_bracket.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_identifier_no_space_bracket.tcl
new file mode 100644 (file)
index 0000000..5f02dce
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+proc check_part_of_the_file {file line_num col_start col_end} {
+    if {$col_start == $col_end} {
+        return
+    }
+
+    set line [getLine $file $line_num]
+    set line [string range $line $col_start $col_end]
+
+    if {[regexp {[[:alnum:]_][\s]+\[} $line]} {
+        report $file $line_num "there should be no spaces between identifier and left bracket"
+    }
+}
+
+foreach fileName [getSourceFileNames] {
+    set checkLine 1
+    set checkColStart 0
+    set seenOmitToken false
+    foreach token [getTokens $fileName 1 0 -1 -1 {}] {
+        set lineNumber [lindex $token 1]
+        set colNumber [lindex $token 2]
+        set tokenType [lindex $token 3]
+
+        if {$checkLine != $lineNumber} {
+            if {!$seenOmitToken} {
+                check_part_of_the_file $fileName $checkLine $checkColStart end
+            }
+            set checkColStart $colNumber
+            set checkLine $lineNumber
+        } elseif {$seenOmitToken} {
+            set checkColStart $colNumber
+        }
+
+        if {$tokenType in {ccomment cppcomment stringlit}} {
+            check_part_of_the_file $fileName $checkLine $checkColStart $colNumber
+            set seenOmitToken true
+        } else {
+            set seenOmitToken false
+        }
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_indentation.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_indentation.tcl
new file mode 100644 (file)
index 0000000..97b4352
--- /dev/null
@@ -0,0 +1,126 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+# Indentation
+
+foreach fileName [getSourceFileNames] {
+    set indent 0
+    set lastCheckedLineNumber -1
+    set is_in_comment "no"
+    set is_in_pp_define "no"
+    set is_in_class "no"
+    set is_in_template "no"
+    set parentheses_level 0
+    set template_brackets_level 0
+
+    foreach token [getTokens $fileName 1 0 -1 -1 {}] {
+        set type [lindex $token 3]
+        set lineNumber [lindex $token 1]
+
+        if {$is_in_comment == "yes"} {
+            set is_in_comment "no"
+        }
+
+        if {$type == "newline"} {
+            set is_in_pp_define "no"
+        } elseif {$type == "class"} {
+            set is_in_class "yes"
+        } elseif {$type == "template"} {
+            set is_in_template "yes"
+        } elseif {$is_in_class == "yes" && $type == "semicolon" && $indent == 0} {
+            set is_in_class "no"
+        } elseif {$type == "ccomment"} {
+            set is_in_comment "yes"
+        } elseif {[string first "pp_" $type] == 0} {
+            if {$type == "pp_define"} {
+                set is_in_pp_define "yes"
+            }
+
+            set lastCheckedLineNumber $lineNumber
+        } elseif {$type == "space"} {
+        } elseif {$type != "eof"} {
+            if {$type == "rightbrace" && $indent > 0} {
+                incr indent -2
+            }
+
+            if {$is_in_pp_define == "no" && $is_in_comment == "no" && $parentheses_level == 0 &&
+                $is_in_template == "no"} {
+                set line [getLine $fileName $lineNumber]
+
+                if {$lineNumber != $lastCheckedLineNumber} {
+                    if {[regexp {^[[:blank:]]*} $line match]} {
+                        set real_indent [string length $match]
+                        if {$indent != $real_indent} {
+                            if {[regexp {^[[:blank:]]*(private:|public:|protected:)} $line]} {
+                                if {$indent != $real_indent + 2} {
+                                    set exp_indent [expr  {$indent - 2}]
+                                    report $fileName $lineNumber "Indentation: $real_indent -> $exp_indent. Line: '$line'"
+                                }
+                            } elseif {![regexp {^[[:alnum:]_]{1,}:$} $line] || $real_indent != 0} {
+                                report $fileName $lineNumber "Indentation: $real_indent -> $indent. Line: '$line'"
+                            }
+                        }
+                    }
+                }
+
+                if {$lineNumber == $lastCheckedLineNumber} {
+                    if {$type == "leftbrace"} {
+                        if {![regexp {^[[:blank:]]*\{[[:blank:]]*$} $line]
+                            && ![regexp {[^\{=]=[^\{=]\{.*\},?} $line]} {
+                            report $fileName $lineNumber "Left brace is not the only non-space character in the line: '$line'"
+                        }
+                    }
+                    if {$type == "rightbrace"} {
+                        if {![regexp {^.* = .*\{.*\}[,;]?$} $line]
+                            && ![regexp {[^\{=]=[^\{=]\{.*\}[,;]?} $line]} {
+                            report $fileName $lineNumber "Right brace is not first non-space character in the line: '$line'"
+                        }
+                    }
+                }
+                if {$type == "rightbrace"} {
+                    if {![regexp {^[[:blank:]]*\};?((( [a-z_\(][a-z0-9_\(\)]{0,}){1,})?;| /\*.*\*/| //.*)?$} $line]
+                        && ![regexp {[^\{=]=[^\{=]\{.*\}[,;]?} $line]} {
+                        report $fileName $lineNumber "Right brace is not the only non-space character in the line and \
+                            is not single right brace followed by \[a-z0-9_() \] string and single semicolon character: '$line'"
+                    }
+                }
+            }
+
+            if {$type == "leftbrace"} {
+                if {![regexp {^extern "C"} [getLine $fileName [expr {$lineNumber - 1}]]]} {
+                    incr indent 2
+                }
+            } elseif {$type == "leftparen"} {
+                incr parentheses_level 1
+            } elseif {$type == "rightparen"} {
+                incr parentheses_level -1
+            }
+
+            if {$is_in_template == "yes"} {
+                if {$type == "less"} {
+                    incr template_brackets_level
+                } elseif {$type == "greater"} {
+                    incr template_brackets_level -1
+                    if {$template_brackets_level == 0} {
+                        set is_in_template "no"
+                    }
+                }
+            }
+
+            set lastCheckedLineNumber $lineNumber
+        }
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_max_line_length.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_max_line_length.tcl
new file mode 100644 (file)
index 0000000..a55533a
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+set maxLen 120
+
+foreach f [getSourceFileNames] {
+    set lineNumber 1
+    foreach line [getAllLines $f] {
+        if {[string length $line] > $maxLen} {
+            report $f $lineNumber "line is longer than ${maxLen} characters"
+        }
+        incr lineNumber
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_no_space_after_opening_parentheses.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_no_space_after_opening_parentheses.tcl
new file mode 100644 (file)
index 0000000..8956144
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+proc check_part_of_the_file {file line_num col_start col_end} {
+    if {$col_start == $col_end} {
+        return
+    }
+
+    set line [getLine $file $line_num]
+    set line [string range $line $col_start $col_end]
+
+    if {[regexp {\(+[[:blank:]]} $line]} {
+        report $file $line_num "there should be no blank characters after opening parentheses"
+    }
+}
+
+foreach fileName [getSourceFileNames] {
+    set checkLine 1
+    set checkColStart 0
+    set seenOmitToken false
+    foreach token [getTokens $fileName 1 0 -1 -1 {}] {
+        set lineNumber [lindex $token 1]
+        set colNumber [lindex $token 2]
+        set tokenType [lindex $token 3]
+
+        if {$checkLine != $lineNumber} {
+            if {!$seenOmitToken} {
+                check_part_of_the_file $fileName $checkLine $checkColStart end
+            }
+            set checkColStart $colNumber
+            set checkLine $lineNumber
+        } elseif {$seenOmitToken} {
+            set checkColStart $colNumber
+        }
+
+        if {$tokenType in {ccomment cppcomment stringlit}} {
+            check_part_of_the_file $fileName $checkLine $checkColStart $colNumber
+            set seenOmitToken true
+        } else {
+            set seenOmitToken false
+        }
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_no_space_before_closing_parentheses.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_no_space_before_closing_parentheses.tcl
new file mode 100644 (file)
index 0000000..8ddc38f
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+proc check_part_of_the_file {file line_num col_start col_end} {
+    if {$col_start == $col_end} {
+        return
+    }
+
+    set line [getLine $file $line_num]
+    set line [string range $line $col_start $col_end]
+
+    if {[regexp {[[:graph:]][[:blank:]]+\)} $line]} {
+        report $file $line_num "there should be no blank characters before closing parentheses"
+    }
+}
+
+foreach fileName [getSourceFileNames] {
+    set checkLine 1
+    set checkColStart 0
+    set seenOmitToken false
+    foreach token [getTokens $fileName 1 0 -1 -1 {}] {
+        set lineNumber [lindex $token 1]
+        set colNumber [lindex $token 2]
+        set tokenType [lindex $token 3]
+
+        if {$checkLine != $lineNumber} {
+            if {!$seenOmitToken} {
+                check_part_of_the_file $fileName $checkLine $checkColStart end
+            }
+            set checkColStart $colNumber
+            set checkLine $lineNumber
+        } elseif {$seenOmitToken} {
+            set checkColStart $colNumber
+        }
+
+        if {$tokenType in {ccomment cppcomment stringlit}} {
+            check_part_of_the_file $fileName $checkLine $checkColStart $colNumber
+            set seenOmitToken true
+        } else {
+            set seenOmitToken false
+        }
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_no_tabs.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_no_tabs.tcl
new file mode 100644 (file)
index 0000000..a065c08
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+foreach f [getSourceFileNames] {
+    set lineNumber 1
+    foreach line [getAllLines $f] {
+        if {[regexp {\t} $line]} {
+            report $f $lineNumber "tabs are not allowed"
+        }
+        incr lineNumber
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_no_trailing_spaces.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_no_trailing_spaces.tcl
new file mode 100644 (file)
index 0000000..31ee30f
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+foreach f [getSourceFileNames] {
+    set lineNumber 1
+    foreach line [getAllLines $f] {
+        if {[regexp {[[:blank:]]$} $line]} {
+            report $f $lineNumber "trailing space is not allowed"
+        }
+        incr lineNumber
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_pointer_declarator_space.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_pointer_declarator_space.tcl
new file mode 100644 (file)
index 0000000..c6da4e1
--- /dev/null
@@ -0,0 +1,58 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+proc check_part_of_the_file {file line_num col_start col_end} {
+    if {$col_start == $col_end} {
+        return
+    }
+
+    set line [getLine $file $line_num]
+    set line [string range $line $col_start $col_end]
+
+    if {[regexp {\w\*\s\w+} $line]
+         || [regexp {\w\*\)} $line]
+         || [regexp {\w\*$} $line]} {
+        report $file $line_num "there should be a space between the referenced type and the pointer declarator."
+    }
+}
+
+foreach fileName [getSourceFileNames] {
+    set checkLine 1
+    set checkColStart 0
+    set seenOmitToken false
+    foreach token [getTokens $fileName 1 0 -1 -1 {}] {
+        set lineNumber [lindex $token 1]
+        set colNumber [lindex $token 2]
+        set tokenType [lindex $token 3]
+
+        if {$checkLine != $lineNumber} {
+            if {!$seenOmitToken} {
+                check_part_of_the_file $fileName $checkLine $checkColStart end
+            }
+            set checkColStart $colNumber
+            set checkLine $lineNumber
+        } elseif {$seenOmitToken} {
+            set checkColStart $colNumber
+        }
+
+        if {$tokenType in {ccomment cppcomment stringlit}} {
+            check_part_of_the_file $fileName $checkLine $checkColStart $colNumber
+            set seenOmitToken true
+        } else {
+            set seenOmitToken false
+        }
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_switch_case.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_switch_case.tcl
new file mode 100644 (file)
index 0000000..d332a12
--- /dev/null
@@ -0,0 +1,282 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+# switch-case
+
+foreach fileName [getSourceFileNames] {
+    set is_in_comment "no"
+    set is_in_pp_define "no"
+
+    foreach token [getTokens $fileName 1 0 -1 -1 {}] {
+        set type [lindex $token 3]
+        set lineNumber [lindex $token 1]
+
+        if {$is_in_comment == "yes"} {
+            set is_in_comment "no"
+        }
+
+        if {$type == "newline"} {
+            set is_in_pp_define "no"
+        } elseif {$type == "ccomment"} {
+            set is_in_comment "yes"
+        } elseif {[string first "pp_" $type] == 0} {
+            if {$type == "pp_define"} {
+                set is_in_pp_define "yes"
+            }
+        } elseif {$type == "space"} {
+        } elseif {$type != "eof"} {
+            if {$is_in_pp_define == "no" && $type == "switch"} {
+                set next_token_start [lindex $token 2]
+                incr next_token_start 1
+                set line_num 0
+                set state "switch"
+                set case_block "no"
+                set seen_braces 0
+                foreach next_token [getTokens $fileName $lineNumber $next_token_start -1 -1 {}] {
+                    set next_token_type [lindex $next_token 3]
+                    set next_token_value [lindex $next_token 0]
+                    if {$state == "switch"} {
+                        if {$next_token_type == "ccomment" || $next_token_type == "space" || $next_token_type == "newline"} {
+                            continue
+                        } elseif {$next_token_type == "leftbrace"} {
+                            set state "first-case"
+                            continue
+                        } else {
+                            # TODO: check switch
+                            continue
+                        }
+                    } elseif {$state == "first-case"} {
+                        if {$next_token_type == "ccomment" || $next_token_type == "space" || $next_token_type == "newline"} {
+                            continue
+                        } elseif {$next_token_type == "case"} {
+                            set state "case"
+                            continue
+                        } elseif {$next_token_type == "default"} {
+                            set state "default"
+                            continue
+                        } else {
+                            # Macros magic: give up
+                            break
+                        }
+                    } elseif {$state == "case"} {
+                        if {$next_token_type == "space"} {
+                            set state "space-after-case"
+                            continue
+                        } else {
+                            report $fileName [lindex $next_token 1] "There should be single space character after 'case' keyword (state $state)"
+                        }
+                    } elseif {$state == "space-after-case"} {
+                        if {$next_token_type != "identifier" && $next_token_type != "intlit" && $next_token_type != "charlit" && $next_token_type != "sizeof"} {
+                            report $fileName [lindex $next_token 1] "There should be single space character after 'case' keyword (state $state, next_token_type $next_token_type)"
+                        } else {
+                            set state "case-label"
+                            continue
+                        }
+                    } elseif {$state == "case-label" || $state == "default"} {
+                        set case_block "no"
+                        if {$next_token_type != "colon"} {
+                            continue
+                        } else {
+                            set state "colon"
+                            continue
+                        }
+                    } elseif {$state == "after-colon-preprocessor"} {
+                      if {$next_token_type == "newline"} {
+                          set state "colon"
+                      }
+                    } elseif {$state == "colon"} {
+                        if {$next_token_type == "space" || $next_token_type == "newline"} {
+                            continue
+                        } elseif {$next_token_type == "ccomment"} {
+                            if {[string match "*FALL*" $next_token_value]} {
+                                set state "fallthru"
+                                set line_num [lindex $next_token 1]
+                                continue
+                            } else {
+                                continue
+                            }
+                        } elseif {$next_token_type == "case"} {
+                            set state "case"
+                            continue
+                        } elseif {$next_token_type == "default"} {
+                            set state "default"
+                            continue
+                        } elseif {$next_token_type == "leftbrace"} {
+                            set case_block "yes"
+                            set state "wait-for-break"
+                            continue
+                        } elseif {$next_token_type == "identifier"} {
+                            if {[string compare "JERRY_UNREACHABLE" $next_token_value] == 0
+                                || [string first "JERRY_UNIMPLEMENTED" $next_token_value] == 0} {
+                                set state "wait-for-semicolon"
+                                continue
+                            } else {
+                                set state "wait-for-break"
+                                continue
+                            }
+                        } elseif {$next_token_type == "break"
+                                  || $next_token_type == "continue"
+                                  || $next_token_type == "return"} {
+                            set state "wait-for-semicolon"
+                            continue
+                        } elseif {[string first "pp_" $next_token_type] == 0} {
+                            set state "after-colon-preprocessor"
+                        } else {
+                            set state "wait-for-break"
+                            continue
+                        }
+                    } elseif {$state == "wait-for-semicolon"} {
+                        if {$next_token_type == "semicolon"} {
+                            set state "break"
+                        }
+                        continue
+                    } elseif {$state == "wait-for-break"} {
+                        if {$next_token_type == "case" || $next_token_type == "default"} {
+                            report $fileName [lindex $next_token 1] "Missing break, continue or FALLTHRU comment before case (state $state)"
+                        } elseif {$next_token_type == "leftbrace"} {
+                            set state "inside-braces"
+                            incr seen_braces 1
+                            continue
+                        } elseif {$next_token_type == "rightbrace"} {
+                            if {$case_block == "yes"} {
+                                set state "case-blocks-end"
+                                continue
+                            } else {
+                                break
+                            }
+                        } elseif {[string compare "JERRY_UNREACHABLE" $next_token_value] == 0
+                                   || [string first "JERRY_UNIMPLEMENTED" $next_token_value] == 0} {
+                            set state "wait-for-semicolon"
+                            continue
+                        } elseif {$next_token_type == "ccomment" && [string match "*FALL*" $next_token_value]} {
+                            set state "fallthru"
+                            set line_num [lindex $next_token 1]
+                            continue
+                        } elseif {$next_token_type == "break"
+                                  || $next_token_type == "continue"
+                                  || $next_token_type == "return"
+                                  || $next_token_type == "goto"} {
+                            set state "wait-for-semicolon"
+                            continue
+                        }
+                        continue
+                    } elseif {$state == "break" || $state == "fallthru"} {
+                        if {$case_block == "no"} {
+                            if {$next_token_type == "ccomment" || $next_token_type == "space" || $next_token_type == "newline"} {
+                                continue
+                            } elseif {$next_token_type == "case"} {
+                                set state "case"
+                                continue
+                            } elseif {$next_token_type == "default"} {
+                                set state "default"
+                                continue
+                            } elseif {$next_token_type == "leftbrace"} {
+                                set state "inside-braces"
+                                incr seen_braces 1
+                                continue
+                            } elseif {$next_token_type == "rightbrace"} {
+                                lappend switch_ends [lindex $next_token 1]
+                                break
+                            } elseif {$next_token_type == "break"
+                                      || $next_token_type == "continue"
+                                      || $next_token_type == "return"} {
+                                set state "wait-for-semicolon"
+                                continue
+                            } else {
+                                set state "wait-for-break"
+                                continue
+                            }
+                        } else {
+                            if {$next_token_type == "ccomment" || $next_token_type == "space" || $next_token_type == "newline"} {
+                                continue
+                            } elseif {$next_token_type == "case"} {
+                                set state "case"
+                                continue
+                            } elseif {$next_token_type == "default"} {
+                                set state "default"
+                                continue
+                            } elseif {$next_token_type == "leftbrace"} {
+                                set state "inside-braces"
+                                incr seen_braces 1
+                                continue
+                            } elseif {$next_token_type == "rightbrace"} {
+                                set state "after-rightbrace"
+                                continue
+                            } elseif {$next_token_type == "break"
+                                      || $next_token_type == "continue"
+                                      || $next_token_type == "return"} {
+                                set state "wait-for-semicolon"
+                                continue
+                            } else {
+                                set state "wait-for-break"
+                                continue
+                            }
+                        }
+                    } elseif {$state == "inside-braces"} {
+                        if {$next_token_type == "rightbrace"} {
+                            incr seen_braces -1
+                            if {$seen_braces == 0} {
+                                set state "wait-for-break"
+                                continue
+                            }
+                        } elseif {$next_token_type == "leftbrace"} {
+                            incr seen_braces 1
+                        }
+                        continue
+                    } elseif {$state == "after-rightbrace-preprocessor"} {
+                        if {$next_token_type == "newline"} {
+                            set state "after-rightbrace"
+                        }
+                   } elseif {$state == "after-rightbrace"} {
+                        if {$next_token_type == "ccomment" || $next_token_type == "space" || $next_token_type == "newline"} {
+                            continue
+                        } elseif {$next_token_type == "case"} {
+                            set state "case"
+                            continue
+                        } elseif {$next_token_type == "default"} {
+                            set state "default"
+                            continue
+                        }  elseif {$next_token_type == "rightbrace"} {
+                            lappend switch_ends [lindex $next_token 1]
+                            break
+                        } elseif {[string first "pp_" $next_token_type] == 0} {
+                            set state "after-rightbrace-preprocessor"
+                        } else {
+                            report $fileName [lindex $next_token 1] "There should be 'case' or 'default' (state $state)"
+                        }
+                    } elseif {$state == "case-blocks-end-preprocessor"} {
+                      if {$next_token_type == "newline"} {
+                          set state "case-blocks-end"
+                      }
+                    } elseif {$state == "case-blocks-end"} {
+                        if {$next_token_type == "ccomment" || $next_token_type == "space" || $next_token_type == "newline"} {
+                            continue
+                        } elseif {$next_token_type == "rightbrace"} {
+                            lappend switch_ends [lindex $next_token 1]
+                            break
+                        } elseif {[string first "pp_" $next_token_type] == 0} {
+                            set state "case-blocks-end-preprocessor"
+                        } else {
+                            report $fileName [lindex $next_token 1] "Missing break, continue or FALLTHRU comment before rightbrace (state $state)"
+                        }
+                    } else {
+                        report $fileName [lindex $next_token 1] "Unknown state: $state"
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/deps/jerry/tools/vera++/scripts/rules/jerry_typecast_space_parentheses.tcl b/deps/jerry/tools/vera++/scripts/rules/jerry_typecast_space_parentheses.tcl
new file mode 100644 (file)
index 0000000..5b8c9c9
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/tclsh
+
+# 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.
+
+proc check_part_of_the_file {file line_num col_start col_end} {
+    if {$col_start == $col_end} {
+        return
+    }
+
+    set line [getLine $file $line_num]
+    set line [string range $line $col_start $col_end]
+
+    if {[regexp {\)\w} $line]} {
+        report $file $line_num "there should be exactly one space after right parentheses"
+    }
+}
+
+foreach fileName [getSourceFileNames] {
+    set checkLine 1
+    set checkColStart 0
+    set seenOmitToken false
+    foreach token [getTokens $fileName 1 0 -1 -1 {}] {
+        set lineNumber [lindex $token 1]
+        set colNumber [lindex $token 2]
+        set tokenType [lindex $token 3]
+
+        if {$checkLine != $lineNumber} {
+            if {!$seenOmitToken} {
+                check_part_of_the_file $fileName $checkLine $checkColStart end
+            }
+            set checkColStart $colNumber
+            set checkLine $lineNumber
+        } elseif {$seenOmitToken} {
+            set checkColStart $colNumber
+        }
+
+        if {$tokenType in {ccomment cppcomment stringlit}} {
+            check_part_of_the_file $fileName $checkLine $checkColStart $colNumber
+            set seenOmitToken true
+        } else {
+            set seenOmitToken false
+        }
+    }
+}
diff --git a/deps/libtuv/.gitignore b/deps/libtuv/.gitignore
new file mode 100644 (file)
index 0000000..5926595
--- /dev/null
@@ -0,0 +1,3 @@
+build/
+tuv__config.h
+tuv_host_ipaddress.h
diff --git a/deps/libtuv/.travis.yml b/deps/libtuv/.travis.yml
new file mode 100644 (file)
index 0000000..2b0244c
--- /dev/null
@@ -0,0 +1,19 @@
+language: c
+
+os: linux
+dist: trusty
+sudo: required
+
+before_install:
+  - tools/check-signed-off.sh --travis
+  - tools/apt-get-install-deps.sh
+  - if [[ "$INSTALL_ARM_DEPS" == "yes" ]]; then tools/apt-get-install-arm.sh; fi
+
+install:
+
+script: "make run_test $OPT"
+
+env:
+  - OPT="TUV_BUILD_TYPE=debug"
+  - OPT="TUV_BUILD_TYPE=release"
+  - OPT="TUV_PLATFORM=arm-linux TUV_BOARD=rpi2" INSTALL_ARM_DEPS=yes
diff --git a/deps/libtuv/CMakeLists.txt b/deps/libtuv/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7a3ff1e
--- /dev/null
@@ -0,0 +1,44 @@
+# 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.
+
+cmake_minimum_required(VERSION 2.8.12)
+project(libtuv C)
+
+set(LIBTUV_VERSION_MAJOR 0)
+set(LIBTUV_VERSION_MINOR 1)
+
+#
+# + unix_common: unix like, posix, multi-tasking
+#     + linux_common
+#         + arm-linux
+#         + i686-linux
+#         + x86_64-linux
+#     + arm-nuttx
+# + (mtsk_common: multi-tasking
+#     + (TBD)
+# + raw_common: single task, big-while-loop, event driven
+#     + arm-mbed
+#
+include(cmake/options.cmake)
+include(cmake/libtuv.cmake)
+if (DEFINED BUILDTESTER AND "${BUILDTESTER}" STREQUAL "yes")
+  include(cmake/tuvtest.cmake)
+elseif (DEFINED BUILDAPIEMULTESTER AND "${BUILDAPIEMULTESTER}" STREQUAL "yes")
+  include(cmake/apiemultest.cmake)
+endif()
+
+unset(BUILDTESTER CACHE)
+unset(BUILDAPIEMULTESTER CACHE)
+unset(BUILD_TEST_LIB CACHE)
+unset(BUILD_HOST_HELPER CACHE)
diff --git a/deps/libtuv/LICENSE b/deps/libtuv/LICENSE
new file mode 100644 (file)
index 0000000..dc1ef2a
--- /dev/null
@@ -0,0 +1,275 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   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.
+
+=============================================================================
+
+
+libuv is licensed for use as follows:
+
+====
+Copyright (c) 2015-present libuv project contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+====
+
+This license applies to parts of libuv originating from the
+https://github.com/joyent/libuv repository:
+
+====
+
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+
+====
+
+This license applies to all parts of libuv that are not externally
+maintained libraries.
+
+The externally maintained libraries used by libuv are:
+
+  - tree.h (from FreeBSD), copyright Niels Provos. Two clause BSD license.
+
+  - inet_pton and inet_ntop implementations, contained in src/inet.c, are
+    copyright the Internet Systems Consortium, Inc., and licensed under the ISC
+    license.
+
+  - stdint-msvc2008.h (from msinttypes), copyright Alexander Chemeris. Three
+    clause BSD license.
+
+  - pthread-fixes.h, pthread-fixes.c, copyright Google Inc. and Sony Mobile
+    Communications AB. Three clause BSD license.
+
+  - android-ifaddrs.h, android-ifaddrs.c, copyright Berkeley Software Design
+    Inc, Kenneth MacKay and Emergya (Cloud4all, FP7/2007-2013, grant agreement
+    n° 289016). Three clause BSD license.
diff --git a/deps/libtuv/Makefile b/deps/libtuv/Makefile
new file mode 100644 (file)
index 0000000..1ab6509
--- /dev/null
@@ -0,0 +1,86 @@
+# Copyright 2015-2017 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.
+
+UNAME_M := $(shell uname -m)
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Linux)
+       UNAME_S := linux
+endif
+ifeq ($(UNAME_S),Darwin)
+       UNAME_S := darwin
+endif
+
+
+TUV_PLATFORM    ?= $(UNAME_M)-$(UNAME_S)
+TUV_BUILD_TYPE  ?= debug
+TUV_BOARD       ?= unknown
+TUV_SYSTEMROOT  ?= default
+TUV_BUILDTESTER ?= yes
+TUV_BUILDAPIEMULTESTER ?= no
+TUV_BUILDHOSTHELPER ?= no
+
+OUTPUT_ROOT     := build
+BUILD_FOLDER    := ./$(OUTPUT_ROOT)/$(TUV_PLATFORM)/$(TUV_BUILD_TYPE)
+CMAKE_FOLDER    := $(BUILD_FOLDER)/cmake
+CMAKE_DEFINES   := \
+       -DCMAKE_TOOLCHAIN_FILE=./cmake/config/config_$(TUV_PLATFORM).cmake \
+       -DCMAKE_BUILD_TYPE=$(TUV_BUILD_TYPE) \
+       -DTARGET_PLATFORM=$(TUV_PLATFORM) \
+       -DBUILDTESTER=${TUV_BUILDTESTER} \
+       -DBUILD_HOST_HELPER=${TUV_BUILDHOSTHELPER}
+
+ifneq ($(TUV_BOARD),unknown)
+       CMAKE_DEFINES += -DTARGET_BOARD=${TUV_BOARD}
+endif
+
+ifneq ($(TUV_SYSTEMROOT),default)
+       CMAKE_DEFINES += -DTARGET_SYSTEMROOT=${TUV_SYSTEMROOT}
+endif
+
+ifneq ($(TUV_BUILDAPIEMULTESTER),no)
+       CMAKE_DEFINES += -DBUILDAPIEMULTESTER=${TUV_BUILDAPIEMULTESTER}
+endif
+
+.phony: all
+
+all:
+       mkdir -p $(CMAKE_FOLDER)
+       cmake -B$(CMAKE_FOLDER) -H./ $(CMAKE_DEFINES)
+       make -C $(CMAKE_FOLDER)
+ifeq ($(TUV_PLATFORM), $(filter $(TUV_PLATFORM), i686-linux x86_64-linux x86_64-darwin))
+       @echo '=============================================================='
+       @echo 'to run test,'
+       @echo '$(BUILD_FOLDER)/bin/tuvtester'
+       @echo '=============================================================='
+endif
+ifeq ("$(TUV_BUILDHOSTHELPER)","yes")
+       @echo '=============================================================='
+       @echo 'to run helper in host,'
+       @echo '$(BUILD_FOLDER)/bin/tuvhelper'
+       @echo '=============================================================='
+endif
+
+run_test:
+       make
+ifeq ($(TUV_PLATFORM), $(filter $(TUV_PLATFORM), i686-linux x86_64-linux x86_64-darwin))
+       $(BUILD_FOLDER)/bin/tuvtester
+else
+       @echo 'Cannot run test for $(TUV_PLATFORM)'
+endif
+
+call:
+       make -C $(CMAKE_FOLDER)
+
+clean:
+       rm -rf $(OUTPUT_ROOT)
diff --git a/deps/libtuv/Makefile.all b/deps/libtuv/Makefile.all
new file mode 100644 (file)
index 0000000..eefce67
--- /dev/null
@@ -0,0 +1,42 @@
+# 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.
+
+HARMONY ?= $(HOME)/harmony
+
+#
+# Use this makefile to check build all platforms.
+# You may have to set "HARMONY" to a valid folder for NuttX on
+# STM32F4 discovery board.
+#
+
+.phony: all
+
+all: clean linux rpi2 stm32f4
+
+
+clean:
+       make clean
+
+
+linux:
+       make
+
+
+rpi2:
+       TUV_PLATFORM=arm-linux TUV_BOARD=rpi2 make
+
+
+stm32f4:
+       TUV_PLATFORM=arm-nuttx TUV_BOARD=stm32f4dis \
+        TUV_SYSTEMROOT=$(HARMONY)/nuttx/nuttx make
diff --git a/deps/libtuv/README.md b/deps/libtuv/README.md
new file mode 100644 (file)
index 0000000..be30689
--- /dev/null
@@ -0,0 +1 @@
+You can find project details in [wiki](https://github.com/Samsung/libtuv/wiki)
diff --git a/deps/libtuv/cmake/apiemultest.cmake b/deps/libtuv/cmake/apiemultest.cmake
new file mode 100644 (file)
index 0000000..7f92324
--- /dev/null
@@ -0,0 +1,46 @@
+# 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.
+
+cmake_minimum_required(VERSION 2.8.12)
+
+set(TUVTESTNAME "tuvtester")
+
+add_definitions("-D__TUV_APIEMUL__")
+
+if(DEFINED BUILD_TEST_LIB AND BUILD_TEST_LIB STREQUAL "yes")
+  add_library(${TUVTESTNAME} ${TEST_MAINFILE} ${TEST_APIEMULFILES})
+else()
+  #add_executable(${TUVTESTNAME} ${TEST_MAINFILE} ${APIEMUL_FILES})
+  message(FATAL_ERROR "BUILD_TEST_LIB must be 'yes'")
+endif()
+
+
+target_include_directories(${TUVTESTNAME} SYSTEM PRIVATE ${TARGET_INC})
+target_include_directories(${TUVTESTNAME} PUBLIC ${LIB_TUV_INCDIRS}
+                                                 ${TUV_TEST_INCDIRS})
+target_link_libraries(${TUVTESTNAME} LINK_PUBLIC ${TARGETLIBNAME}
+                      ${TUV_LINK_LIBS})
+set_target_properties(${TUVTESTNAME} PROPERTIES
+    ARCHIVE_OUTPUT_DIRECTORY "${LIB_OUT}"
+    LIBRARY_OUTPUT_DIRECTORY "${LIB_OUT}"
+    RUNTIME_OUTPUT_DIRECTORY "${BIN_OUT}")
+
+if(DEFINED BUILD_TEST_LIB AND BUILD_TEST_LIB STREQUAL "yes")
+  if(DEFINED COPY_TARGET_LIB)
+    add_custom_command(TARGET ${TUVTESTNAME} POST_BUILD
+        COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${TUVTESTNAME}>
+                                        "${COPY_TARGET_LIB}"
+        COMMENT "Copying lib${TUVTESTNAME} to ${COPY_TARGET_LIB}")
+  endif()
+endif()
diff --git a/deps/libtuv/cmake/config/config_arm-linux.cmake b/deps/libtuv/cmake/config/config_arm-linux.cmake
new file mode 100644 (file)
index 0000000..49e24c6
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright 2015-2016 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR arm)
+
+SET(CMAKE_C_COMPILER   arm-linux-gnueabihf-gcc)
diff --git a/deps/libtuv/cmake/config/config_arm-mbed.cmake b/deps/libtuv/cmake/config/config_arm-mbed.cmake
new file mode 100644 (file)
index 0000000..5fdb4d0
--- /dev/null
@@ -0,0 +1,24 @@
+# Copyright 2015-2016 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME mbed)
+set(CMAKE_SYSTEM_PROCESSOR arm)
+
+SET(CMAKE_C_COMPILER   arm-none-eabi-g++)
+
+# need to force compiler,
+# else it'll try to check and exit with 'unedefined _exit()
+CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
diff --git a/deps/libtuv/cmake/config/config_arm-nuttx.cmake b/deps/libtuv/cmake/config/config_arm-nuttx.cmake
new file mode 100644 (file)
index 0000000..7b30b9a
--- /dev/null
@@ -0,0 +1,24 @@
+# Copyright 2015-2016 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME nuttx)
+set(CMAKE_SYSTEM_PROCESSOR arm)
+
+SET(CMAKE_C_COMPILER   arm-none-eabi-gcc)
+
+# need to force compiler,
+# else it'll try to check and exit with 'unedefined _exit()
+CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
diff --git a/deps/libtuv/cmake/config/config_arm-tizen.cmake b/deps/libtuv/cmake/config/config_arm-tizen.cmake
new file mode 100644 (file)
index 0000000..35074d1
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright 2017 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR arm)
+
diff --git a/deps/libtuv/cmake/config/config_arm-tizenrt.cmake b/deps/libtuv/cmake/config/config_arm-tizenrt.cmake
new file mode 100644 (file)
index 0000000..a87d991
--- /dev/null
@@ -0,0 +1,24 @@
+# Copyright 2017-present 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME tizenrt)
+set(CMAKE_SYSTEM_PROCESSOR arm)
+
+SET(CMAKE_C_COMPILER   arm-none-eabi-gcc)
+
+# need to force compiler,
+# else it'll try to check and exit with 'unedefined _exit()
+CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
diff --git a/deps/libtuv/cmake/config/config_armhf-linux.cmake b/deps/libtuv/cmake/config/config_armhf-linux.cmake
new file mode 100644 (file)
index 0000000..a3d3c4f
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright 2017 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.
+
+include(CMakeForceCompiler)
+
+SET(CMAKE_C_COMPILER  arm-linux-gnueabihf-gcc)
+
diff --git a/deps/libtuv/cmake/config/config_i686-linux.cmake b/deps/libtuv/cmake/config/config_i686-linux.cmake
new file mode 100644 (file)
index 0000000..facda47
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR i686)
diff --git a/deps/libtuv/cmake/config/config_mips-openwrt.cmake b/deps/libtuv/cmake/config/config_mips-openwrt.cmake
new file mode 100755 (executable)
index 0000000..6b4bb32
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright 2016 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Openwrt)
+set(CMAKE_SYSTEM_PROCESSOR mips)
+
+SET(CMAKE_C_COMPILER   mipsel-openwrt-linux-gcc)
diff --git a/deps/libtuv/cmake/config/config_mipsel-linux.cmake b/deps/libtuv/cmake/config/config_mipsel-linux.cmake
new file mode 100644 (file)
index 0000000..3cd52cc
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright 2015-2016 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR mipsel)
+
+SET(CMAKE_C_COMPILER   mipsel-linux-gcc)
diff --git a/deps/libtuv/cmake/config/config_noarch-linux.cmake b/deps/libtuv/cmake/config/config_noarch-linux.cmake
new file mode 100644 (file)
index 0000000..e665b74
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright 2017 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.
+
+# This file is used for compilation without any compiler flags or 
+# cross compilation options. Default make always checks for CPU
+# and operating system and tries to find config_cpu_os.cmake.
+#
+# This file you can include using flags:
+# $  TUV_PLATFORM=noarch-linux make
+
diff --git a/deps/libtuv/cmake/config/config_x86_64-darwin.cmake b/deps/libtuv/cmake/config/config_x86_64-darwin.cmake
new file mode 100644 (file)
index 0000000..e1a1c50
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright 2017 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Darwin)
+set(CMAKE_SYSTEM_PROCESSOR x86_64)
diff --git a/deps/libtuv/cmake/config/config_x86_64-linux.cmake b/deps/libtuv/cmake/config/config_x86_64-linux.cmake
new file mode 100644 (file)
index 0000000..31db625
--- /dev/null
@@ -0,0 +1,18 @@
+# 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.
+
+include(CMakeForceCompiler)
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR x86_64)
diff --git a/deps/libtuv/cmake/libtuv.cmake b/deps/libtuv/cmake/libtuv.cmake
new file mode 100644 (file)
index 0000000..211cb01
--- /dev/null
@@ -0,0 +1,66 @@
+# Copyright 2015-2016 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.
+
+cmake_minimum_required(VERSION 2.8.12)
+
+#
+# { TUV_CHANGES@20161129: It corresponds to uv.gyp's `sources` }
+#
+set(COMMON_SRCFILES
+    ${INCLUDE_ROOT}/uv.h
+# { TUV_CHANGES@20161129:
+#   Makefile.am include tree.h only in WINNT
+#   But tree.h is used in unix's several files (i.e. loop.c)
+#   But we don't provide unix's the corresponding part.     }
+#   ${INCLUDE_ROOT}/tree.h
+    ${INCLUDE_ROOT}/uv-errno.h
+    ${INCLUDE_ROOT}/uv-threadpool.h
+    ${INCLUDE_ROOT}/uv-version.h
+#   ${SOURCE_ROOT}/fs-poll.c
+    ${SOURCE_ROOT}/heap-inl.h
+    ${SOURCE_ROOT}/inet.c
+    ${SOURCE_ROOT}/queue.h
+    ${SOURCE_ROOT}/threadpool.c
+    ${SOURCE_ROOT}/uv-common.c
+    ${SOURCE_ROOT}/uv-common.h
+#   ${SOURCE_ROOT}/version.c
+    ${SOURCE_ROOT}/tuv_debuglog.c
+    )
+
+set(LIB_TUV_SRCFILES
+      ${COMMON_SRCFILES}
+      ${PLATFORM_SRCFILES}
+      )
+
+set(LIB_TUV_INCDIRS
+      ${INCLUDE_ROOT}
+      ${SOURCE_ROOT}
+      )
+
+# build tuv library
+set(TARGETLIBNAME tuv)
+add_library(${TARGETLIBNAME} ${LIB_TUV_SRCFILES})
+target_include_directories(${TARGETLIBNAME} SYSTEM PRIVATE ${TARGET_INC})
+target_include_directories(${TARGETLIBNAME} PUBLIC ${LIB_TUV_INCDIRS})
+set_target_properties(${TARGETLIBNAME} PROPERTIES
+    ARCHIVE_OUTPUT_DIRECTORY "${LIB_OUT}"
+    LIBRARY_OUTPUT_DIRECTORY "${LIB_OUT}"
+    RUNTIME_OUTPUT_DIRECTORY "${BIN_OUT}")
+
+if(DEFINED COPY_TARGET_LIB)
+  add_custom_command(TARGET ${TARGETLIBNAME} POST_BUILD
+      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${TARGETLIBNAME}>
+                                  "${COPY_TARGET_LIB}"
+      COMMENT "Copying lib${TARGETLIBNAME} to ${COPY_TARGET_LIB}")
+endif()
diff --git a/deps/libtuv/cmake/option/option_arm-linux.cmake b/deps/libtuv/cmake/option/option_arm-linux.cmake
new file mode 100644 (file)
index 0000000..5f96230
--- /dev/null
@@ -0,0 +1,34 @@
+# 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.
+
+# linux common
+include("cmake/option/option_unix_common.cmake")
+include("cmake/option/option_linux_common.cmake")
+
+# arm-linux specific
+if(DEFINED TARGET_BOARD)
+  if(${TARGET_BOARD} STREQUAL "rpi2")
+    # rpi2 specific
+    set(FLAGS_COMMON
+          ${FLAGS_COMMON}
+          "-mcpu=cortex-a7"
+          "-mfloat-abi=hard"
+          "-mfpu=neon-vfpv4"
+          )
+  else()
+    message(FATAL_ERROR "TARGET_BOARD=`${TARGET_BOARD}` is unknown to make")
+  endif()
+else()
+  message(FATAL_ERROR "TARGET_BOARD is undefined")
+endif()
diff --git a/deps/libtuv/cmake/option/option_arm-mbed.cmake b/deps/libtuv/cmake/option/option_arm-mbed.cmake
new file mode 100644 (file)
index 0000000..b3859b3
--- /dev/null
@@ -0,0 +1,72 @@
+# 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.
+
+include("cmake/option/option_raw_common.cmake")
+
+# mbed common source files
+set(MBED_PATH "${SOURCE_ROOT}/mbed")
+
+set(PLATFORM_SRCFILES
+      ${PLATFORM_SRCFILES}
+      "${MBED_PATH}/uv_mbed.c"
+      "${MBED_PATH}/uv_mbed_io.c"
+      "${MBED_PATH}/uv_mbed_stream.c"
+      "${MBED_PATH}/uv_mbed_tcp.c"
+      )
+
+#set(PLATFORM_TESTFILES "${TEST_ROOT}/runner_mbed.c")
+
+set(FLAGS_COMMON
+      ${FLAGS_COMMON}
+      "-D__TUV_MBED__"
+      )
+
+# use "mbed" lower case for platform path
+set(TUV_PLATFORM_PATH ${PLATFORM_NAME_L})
+
+if(DEFINED TARGET_BOARD)
+  if(${TARGET_BOARD} STREQUAL "mbedk64f")
+    set(FLAGS_COMMON
+          ${FLAGS_COMMON}
+          "-mcpu=cortex-m4"
+          "-mthumb"
+          "-mlittle-endian"
+          )
+    if(NOT DEFINED TARGET_SYSTEMROOT)
+      set(TARGET_SYSTEMROOT "${CMAKE_SOURCE_DIR}/targets/mbedk64f")
+    endif()
+  else()
+    message(FATAL_ERROR "TARGET_BOARD=`${TARGET_BOARD}` is unknown to make")
+  endif()
+else()
+  message(FATAL_ERROR "TARGET_BOARD is undefined")
+endif()
+
+# mbed port source/include
+set(TARGET_INC ${TARGET_INC} "${TARGET_SYSTEMROOT}/source")
+
+
+# build tester as library
+set(BUILD_TEST_LIB "yes")
+unset(BUILD_TEST_LIB CACHE)
+
+
+# set copy libs to ${TARGET_SYSTEMROOT}/libtiv
+file(MAKE_DIRECTORY "${TARGET_SYSTEMROOT}/libtuv")
+set(COPY_TARGET_LIB "${TARGET_SYSTEMROOT}/libtuv/.")
+
+# to help unittest to give host ip address
+if(EXISTS ${RAW_TEST}/tuv_host_ipaddress.h)
+  add_definitions("-D__TUV_HOST_IPEXIST__")
+endif()
diff --git a/deps/libtuv/cmake/option/option_arm-nuttx.cmake b/deps/libtuv/cmake/option/option_arm-nuttx.cmake
new file mode 100644 (file)
index 0000000..5157ff8
--- /dev/null
@@ -0,0 +1,65 @@
+# Copyright 2015-2017 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.
+
+include("cmake/option/option_unix_common.cmake")
+
+set(FLAGS_COMMON ${FLAGS_COMMON} "-D__NUTTX__")
+
+# override TUV_PLATFORM_PATH for NuttX
+# use "nuttx" for NuttX platform dependent source files
+# set(TUV_PLATFORM_PATH ${PLATFORM_NAME_L})
+
+# nuttx source files
+# set(NUTTX_PATH "${SOURCE_ROOT}/${TUV_PLATFORM_PATH}")
+
+set(PLATFORM_SRCFILES
+      ${PLATFORM_SRCFILES}
+      ${UNIX_PATH}/nuttx.c
+      )
+
+set(PLATFORM_TESTFILES "${TEST_ROOT}/runner_nuttx.c")
+
+if(DEFINED TARGET_BOARD)
+  if(${TARGET_BOARD} STREQUAL "stm32f4dis")
+    set(FLAGS_COMMON
+          ${FLAGS_COMMON}
+          "-mcpu=cortex-m4"
+          "-mthumb"
+          "-march=armv7e-m"
+          "-mfpu=fpv4-sp-d16"
+          "-mfloat-abi=hard"
+          )
+  else()
+    message(FATAL_ERROR "TARGET_BOARD=`${TARGET_BOARD}` is unknown to make")
+  endif()
+else()
+  message(FATAL_ERROR "TARGET_BOARD is undefined")
+endif()
+
+if(NOT DEFINED TARGET_SYSTEMROOT OR "${TARGET_SYSTEMROOT}" STREQUAL "default")
+  message(FATAL_ERROR "\nPlease set TARGET_SYSTEMROOT for NuttX include path\n")
+endif()
+
+# system include folder
+set(TARGET_INC
+      ${TARGET_INC}
+      "${TARGET_SYSTEMROOT}/include"
+      )
+
+# build tester as library
+set(BUILD_TEST_LIB "yes")
+unset(BUILD_TEST_LIB CACHE)
+
+# set copy libs to ${TARGET_SYSTEMROOT}/lib
+set(COPY_TARGET_LIB "${TARGET_SYSTEMROOT}/lib")
diff --git a/deps/libtuv/cmake/option/option_arm-tizen.cmake b/deps/libtuv/cmake/option/option_arm-tizen.cmake
new file mode 100644 (file)
index 0000000..1d50e5f
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright 2017 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.
+
+# linux common
+include("cmake/option/option_unix_common.cmake")
+include("cmake/option/option_linux_common.cmake")
+
+# arm-tizen specific
+if(DEFINED TARGET_BOARD)
+  if(${TARGET_BOARD} STREQUAL "artik10")
+    set(FLAGS_COMMON
+          ${FLAGS_COMMON}
+          "-mcpu=cortex-a7"
+          "-mfloat-abi=softfp"
+          "-mfpu=neon-vfpv4"
+          )
+  else()
+    message(FATAL_ERROR "TARGET_BOARD=`${TARGET_BOARD}` is unknown to make")
+  endif()
+else()
+  message(FATAL_ERROR "TARGET_BOARD is undefined")
+endif()
diff --git a/deps/libtuv/cmake/option/option_arm-tizenrt.cmake b/deps/libtuv/cmake/option/option_arm-tizenrt.cmake
new file mode 100644 (file)
index 0000000..a96a881
--- /dev/null
@@ -0,0 +1,57 @@
+# Copyright 2017-present 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.
+
+include("cmake/option/option_unix_common.cmake")
+
+set(FLAGS_COMMON ${FLAGS_COMMON} "-D__TIZENRT__")
+
+
+set(PLATFORM_SRCFILES
+      ${PLATFORM_SRCFILES}
+      ${UNIX_PATH}/tizenrt.c
+      )
+
+set(PLATFORM_TESTFILES "${TEST_ROOT}/runner_tizenrt.c")
+
+if(DEFINED TARGET_BOARD)
+  if(${TARGET_BOARD} STREQUAL "artik05x")
+    set(FLAGS_COMMON
+          ${FLAGS_COMMON}
+          "-mcpu=cortex-r4"
+          "-mfpu=vfp3"
+          )
+  else()
+    message(FATAL_ERROR "TARGET_BOARD=`${TARGET_BOARD}` is unknown to make")
+  endif()
+else()
+  message(FATAL_ERROR "TARGET_BOARD is undefined")
+endif()
+
+if(NOT DEFINED TARGET_SYSTEMROOT OR "${TARGET_SYSTEMROOT}" STREQUAL "default")
+  message(FATAL_ERROR "\nPlease set TARGET_SYSTEMROOT for TizenRT include path\n")
+endif()
+
+# system include folder
+set(TARGET_INC
+      ${TARGET_INC}
+      "${TARGET_SYSTEMROOT}/include"
+      "${TARGET_SYSTEMROOT}/include/cxx"
+      )
+
+# build tester as library
+set(BUILD_TEST_LIB "yes")
+unset(BUILD_TEST_LIB CACHE)
+
+# set copy libs to ${TARGET_SYSTEMROOT}/lib
+set(COPY_TARGET_LIB "${TARGET_SYSTEMROOT}/lib")
diff --git a/deps/libtuv/cmake/option/option_armhf-linux.cmake b/deps/libtuv/cmake/option/option_armhf-linux.cmake
new file mode 100644 (file)
index 0000000..02aed1d
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright 2017 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.
+
+# linux common
+include("cmake/option/option_unix_common.cmake")
+include("cmake/option/option_linux_common.cmake")
+
+set(FLAGS_COMMON ${FLAGS_COMMON} -lrt)
+
diff --git a/deps/libtuv/cmake/option/option_i686-linux.cmake b/deps/libtuv/cmake/option/option_i686-linux.cmake
new file mode 100644 (file)
index 0000000..2740918
--- /dev/null
@@ -0,0 +1,25 @@
+# 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.
+
+# linux common
+include("cmake/option/option_unix_common.cmake")
+include("cmake/option/option_linux_common.cmake")
+
+# i686 specific
+
+set(FLAGS_COMMON
+      ${FLAGS_COMMON}
+      "-march=i686"
+      "-m32"
+      )
diff --git a/deps/libtuv/cmake/option/option_linux_common.cmake b/deps/libtuv/cmake/option/option_linux_common.cmake
new file mode 100644 (file)
index 0000000..8eca41e
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright 2015-2016 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.
+
+
+# override TUV_PLATFORM_PATH for Linux
+# use "linux" for Linux platform dependent source files
+set(TUV_PLATFORM_PATH ${PLATFORM_NAME_L})
+
+#
+# { TUV_CHANGES@20161129:
+#   It corresponds to uv.gyp's `conditions` with OS == `linux` }
+#
+set(PLATFORM_SRCFILES
+      ${PLATFORM_SRCFILES}
+#     ${UNIX_PATH}/proctitle.c
+      ${UNIX_PATH}/linux-core.c
+#     ${UNIX_PATH}/linux-inotify.c
+      ${UNIX_PATH}/linux-syscalls.c
+      ${UNIX_PATH}/linux-syscalls.h
+      )
+
+set(PLATFORM_TESTFILES "${TEST_ROOT}/runner_linux.c")
+
+set(PLATFORM_HOSTHELPERFILES "${TEST_ROOT}/runner_linux_raw.c")
+
+set(TUV_LINK_LIBS "pthread")
+
+if(DEFINED BUILD_HOST_HELPER AND BUILD_HOST_HELPER STREQUAL "yes")
+  add_definitions("-D__HOST_HELPER__")
+endif()
diff --git a/deps/libtuv/cmake/option/option_mips-openwrt.cmake b/deps/libtuv/cmake/option/option_mips-openwrt.cmake
new file mode 100755 (executable)
index 0000000..3729842
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright 2016 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.
+
+# linux common
+include("cmake/option/option_unix_common.cmake")
+
+set(TUV_PLATFORM_PATH "linux")
+set(BUILDTESTER "no")
+set(BUILDAPIEMULTESTER "no")
+
+# linux specific source files
+set(LINUX_PATH "${SOURCE_ROOT}/${TUV_PLATFORM_PATH}")
+
+set(PLATFORM_SRCFILES ${PLATFORM_SRCFILES}
+                      "${LINUX_PATH}/uv_linux.c"
+                      "${LINUX_PATH}/uv_linux_loop.c"
+                      "${LINUX_PATH}/uv_linux_clock.c"
+                      "${LINUX_PATH}/uv_linux_io.c"
+                      "${LINUX_PATH}/uv_linux_syscall.c"
+                      "${LINUX_PATH}/uv_linux_thread.c"
+                      )
+
+set(PLATFORM_TESTFILES "${TEST_ROOT}/runner_linux.c"
+                       )
+
+set(TUV_LINK_LIBS "pthread")
+
+# mips-linux specific
+if(DEFINED TARGET_BOARD)
+endif()
diff --git a/deps/libtuv/cmake/option/option_mipsel-linux.cmake b/deps/libtuv/cmake/option/option_mipsel-linux.cmake
new file mode 100644 (file)
index 0000000..f6e5455
--- /dev/null
@@ -0,0 +1,17 @@
+# 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.
+
+# linux common
+include("cmake/option/option_unix_common.cmake")
+include("cmake/option/option_linux_common.cmake")
diff --git a/deps/libtuv/cmake/option/option_noarch-linux.cmake b/deps/libtuv/cmake/option/option_noarch-linux.cmake
new file mode 100644 (file)
index 0000000..6fdecd6
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright 2017 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.
+
+# linux common
+include("cmake/option/option_unix_common.cmake")
+include("cmake/option/option_linux_common.cmake")
+
diff --git a/deps/libtuv/cmake/option/option_raw_common.cmake b/deps/libtuv/cmake/option/option_raw_common.cmake
new file mode 100644 (file)
index 0000000..3eba62f
--- /dev/null
@@ -0,0 +1,77 @@
+# Copyright 2015-2017 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.
+
+set(FLAGS_COMMON
+      "-fno-builtin"
+      "-D__TUV_RAW__"
+      )
+
+set(CMAKE_C_FLAGS_DEBUG     "-O0 -g -DDEBUG")
+set(CMAKE_C_FLAGS_RELEASE   "-O2 -DNDEBUG")
+
+# raw common source files
+set(RAW_PATH "${SOURCE_ROOT}/raw")
+set(RAW_TEST "${TEST_ROOT}/raw")
+
+# test include
+set(TUV_TEST_INCDIRS
+      "${TEST_ROOT}"
+      "${TEST_ROOT}/raw"
+      )
+
+set(PLATFORM_SRCFILES
+      "${RAW_PATH}/uv_raw.c"
+      "${RAW_PATH}/uv_raw_clock.c"
+      "${RAW_PATH}/uv_raw_io.c"
+      "${RAW_PATH}/uv_raw_loop.c"
+      "${RAW_PATH}/uv_raw_threadpool.c"
+      "${RAW_PATH}/uv_raw_thread.c"
+
+      "${RAW_PATH}/uv_raw_async.c"
+      "${RAW_PATH}/uv_raw_process.c"
+      )
+
+set(TEST_MAINFILE
+      "${RAW_TEST}/raw_main.c"
+      )
+
+set(TEST_UNITFILES
+      "${RAW_TEST}/runner_main_raw.c"
+      "${RAW_TEST}/test_idle_raw.c"
+      "${RAW_TEST}/test_active_raw.c"
+      "${RAW_TEST}/test_timer_raw_init.c"
+      "${RAW_TEST}/test_timer_raw_norm.c"
+      "${RAW_TEST}/test_timer_raw_start_twice.c"
+      "${RAW_TEST}/test_timer_raw_order.c"
+      "${RAW_TEST}/test_timer_raw_run_once.c"
+      "${RAW_TEST}/test_timer_raw_run_null_callback.c"
+      "${RAW_TEST}/test_timer_raw_again.c"
+      "${RAW_TEST}/test_timer_raw_huge_timeout.c"
+      "${RAW_TEST}/test_timer_raw_huge_repeat.c"
+      "${RAW_TEST}/test_condvar_raw.c"
+      "${RAW_TEST}/test_async_raw.c"
+      "${RAW_TEST}/test_threadpool_raw_queue_work_simple.c"
+      "${RAW_TEST}/test_walk_handles_raw.c"
+
+      "${RAW_TEST}/test_tcp_open_raw.c"
+      "${RAW_TEST}/test_shutdown_eof_raw.c"
+      )
+
+set(TEST_APIEMULFILES
+      "${RAW_TEST}/apiemul_main.c"
+      "${RAW_TEST}/apiemul_socket.c"
+      )
+
+# configuration values
+set(CONFIG_FILESYSTEM 0)
diff --git a/deps/libtuv/cmake/option/option_unix_common.cmake b/deps/libtuv/cmake/option/option_unix_common.cmake
new file mode 100644 (file)
index 0000000..60c0514
--- /dev/null
@@ -0,0 +1,85 @@
+# Copyright 2015-2017 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.
+
+
+set(FLAGS_COMMON
+      "-fno-builtin"
+      )
+
+set(CMAKE_C_FLAGS_DEBUG     "-O0 -g -DDEBUG")
+set(CMAKE_C_FLAGS_RELEASE   "-O2 -DNDEBUG")
+
+# unix common source files
+set(UNIX_PATH "${SOURCE_ROOT}/unix")
+
+# test include
+set(TUV_TEST_INCDIRS "${TEST_ROOT}")
+
+#
+# { TUV_CHANGES@20161129:
+#   It corresponds to uv.gyp's section "Not Windows i.e. POSIX" }
+#
+set(PLATFORM_SRCFILES
+      ${INCLUDE_ROOT}/uv-unix.h
+      ${INCLUDE_ROOT}/uv-linux.h
+#     ${INCLUDE_ROOT}/uv-sunos.h
+#     ${INCLUDE_ROOT}/uv-darwin.h
+#     ${INCLUDE_ROOT}/uv-bsd.h
+#     ${INCLUDE_ROOT}/uv-aix.h
+      ${UNIX_PATH}/async.c
+      ${UNIX_PATH}/atomic-ops.h
+      ${UNIX_PATH}/core.c
+#     ${UNIX_PATH}/dl.c
+      ${UNIX_PATH}/fs.c
+      ${UNIX_PATH}/getaddrinfo.c
+#     ${UNIX_PATH}/getnameinfo.c
+      ${UNIX_PATH}/internal.h
+      ${UNIX_PATH}/loop.c
+      ${UNIX_PATH}/loop-watcher.c
+#     ${UNIX_PATH}/pipe.c
+      ${UNIX_PATH}/poll.c
+      ${UNIX_PATH}/process.c
+#     ${UNIX_PATH}/proctitle.c
+#     ${UNIX_PATH}/signal.c
+      ${UNIX_PATH}/spinlock.h
+      ${UNIX_PATH}/stream.c
+      ${UNIX_PATH}/tcp.c
+      ${UNIX_PATH}/thread.c
+      ${UNIX_PATH}/timer.c
+#     ${UNIX_PATH}/tty.c
+      ${UNIX_PATH}/udp.c
+    )
+
+set(TEST_MAINFILE "${TEST_ROOT}/runner_main.c")
+
+set(TEST_UNITFILES
+      "${TEST_ROOT}/test_idle.c"
+      "${TEST_ROOT}/test_timer.c"
+      "${TEST_ROOT}/test_timer_again.c"
+      "${TEST_ROOT}/test_fs.c"
+      "${TEST_ROOT}/test_cwd.c"
+      "${TEST_ROOT}/test_error.c"
+      "${TEST_ROOT}/test_tcp_open.c"
+      "${TEST_ROOT}/test_shutdown_eof.c"
+      "${TEST_ROOT}/echo_server.c"
+      "${TEST_ROOT}/test_getaddrinfo.c"
+      "${TEST_ROOT}/test_threadpool.c"
+      "${TEST_ROOT}/test_condvar.c"
+      "${TEST_ROOT}/test_active.c"
+      "${TEST_ROOT}/test_walk_handles.c"
+      "${TEST_ROOT}/test_async.c"
+      )
+
+# configuration values
+set(CONFIG_FILESYSTEM 1)
diff --git a/deps/libtuv/cmake/option/option_x86_64-darwin.cmake b/deps/libtuv/cmake/option/option_x86_64-darwin.cmake
new file mode 100644 (file)
index 0000000..309dd01
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright 2017 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.
+
+# unix common
+
+include("cmake/option/option_unix_common.cmake")
+
+# darwin specific
+
+set(PLATFORM_SRCFILES
+      ${PLATFORM_SRCFILES}
+      ${INCLUDE_ROOT}/uv-darwin.h
+      ${INCLUDE_ROOT}/pthread-barrier.h
+#     ${UNIX_PATH}/bsd-ifaddrs.c
+      ${UNIX_PATH}/darwin.c
+#     ${UNIX_PATH}/darwin-proctitle.c
+      ${UNIX_PATH}/fsevents.c
+      ${UNIX_PATH}/kqueue.c
+#     ${UNIX_PATH}/proctitle.c
+      ${UNIX_PATH}/pthread-barrier.c
+      )
+
+set(PLATFORM_TESTFILES "${TEST_ROOT}/runner_linux.c")
+
+set(PLATFORM_HOSTHELPERFILES "${TEST_ROOT}/runner_linux_raw.c")
+
+set(TUV_LINK_LIBS "pthread")
+
+if(DEFINED BUILD_HOST_HELPER AND BUILD_HOST_HELPER STREQUAL "yes")
+  add_definitions("-D__HOST_HELPER__")
+endif()
diff --git a/deps/libtuv/cmake/option/option_x86_64-linux.cmake b/deps/libtuv/cmake/option/option_x86_64-linux.cmake
new file mode 100644 (file)
index 0000000..4139a69
--- /dev/null
@@ -0,0 +1,19 @@
+# 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.
+
+# linux common
+include("cmake/option/option_unix_common.cmake")
+include("cmake/option/option_linux_common.cmake")
+
+# x86_64 specific
diff --git a/deps/libtuv/cmake/options.cmake b/deps/libtuv/cmake/options.cmake
new file mode 100644 (file)
index 0000000..04d017b
--- /dev/null
@@ -0,0 +1,57 @@
+# Copyright 2015-2017 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.
+
+cmake_minimum_required(VERSION 2.8.12)
+
+# platform name in lower case
+string(TOLOWER ${CMAKE_SYSTEM_NAME} PLATFORM_NAME_L)
+
+set(PATH_ROOT    ${CMAKE_SOURCE_DIR})
+set(SOURCE_ROOT  ${PATH_ROOT}/src)
+set(INCLUDE_ROOT ${PATH_ROOT}/include)
+set(TEST_ROOT    ${PATH_ROOT}/test)
+
+if (DEFINED LIBTUV_CUSTOM_LIB_OUT)
+  set(LIB_OUT ${LIBTUV_CUSTOM_LIB_OUT})
+else()
+  set(BIN_ROOT ${CMAKE_BINARY_DIR})
+  set(LIB_OUT "${BIN_ROOT}/../lib")
+  set(BIN_OUT "${BIN_ROOT}/../bin")
+endif()
+
+# path for platform depends files, use full name for default
+# (e.g, i686-linux)
+if (NOT DEFINED TARGET_PLATFORM)
+  message(FATAL_ERROR "TARGET_PLATFORM was not specified! (e.g., arm-linux)")
+endif()
+
+set(TUV_PLATFORM_PATH ${TARGET_PLATFORM})
+include("cmake/option/option_${TARGET_PLATFORM}.cmake")
+
+string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE_L)
+if (${BUILD_TYPE_L} STREQUAL "debug")
+  set(FLAGS_COMMON "${FLAGS_COMMON} -DENABLE_DEBUG_LOG")
+endif()
+
+foreach(FLAG ${FLAGS_COMMON})
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG}")
+endforeach()
+
+# generate configure file
+configure_file("${SOURCE_ROOT}/tuv__config.h.in"
+               "${CMAKE_BINARY_DIR}/tuv__config.h")
+configure_file("${SOURCE_ROOT}/tuv__config.h.in"
+               "${INCLUDE_ROOT}/tuv__config.h")
+
+message(STATUS "Build Type: [${CMAKE_BUILD_TYPE}]")
diff --git a/deps/libtuv/cmake/tuvtest.cmake b/deps/libtuv/cmake/tuvtest.cmake
new file mode 100644 (file)
index 0000000..4f4e9e0
--- /dev/null
@@ -0,0 +1,66 @@
+# 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.
+
+cmake_minimum_required(VERSION 2.8.12)
+
+
+set(TEST_PLATFORMFILES )
+
+set(TUVTESTNAME "tuvtester")
+
+foreach(FILES ${PLATFORM_TESTFILES})
+  set(TEST_PLATFORMFILES ${TEST_PLATFORMFILES} ${FILES})
+endforeach()
+
+if(DEFINED BUILD_TEST_LIB AND BUILD_TEST_LIB STREQUAL "yes")
+  add_library(${TUVTESTNAME} ${TEST_MAINFILE} ${TEST_UNITFILES}
+              ${TEST_PLATFORMFILES})
+else()
+  add_executable(${TUVTESTNAME} ${TEST_MAINFILE} ${TEST_UNITFILES}
+                 ${TEST_PLATFORMFILES})
+endif()
+
+target_include_directories(${TUVTESTNAME} SYSTEM PRIVATE ${TARGET_INC})
+target_include_directories(${TUVTESTNAME} PUBLIC ${LIB_TUV_INCDIRS}
+                                                 ${TUV_TEST_INCDIRS})
+target_link_libraries(${TUVTESTNAME} LINK_PUBLIC ${TARGETLIBNAME}
+                      ${TUV_LINK_LIBS})
+set_target_properties(${TUVTESTNAME} PROPERTIES
+    ARCHIVE_OUTPUT_DIRECTORY "${LIB_OUT}"
+    LIBRARY_OUTPUT_DIRECTORY "${LIB_OUT}"
+    RUNTIME_OUTPUT_DIRECTORY "${BIN_OUT}")
+
+if(DEFINED BUILD_TEST_LIB AND BUILD_TEST_LIB STREQUAL "yes")
+  if(DEFINED COPY_TARGET_LIB)
+    add_custom_command(TARGET ${TUVTESTNAME} POST_BUILD
+        COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${TUVTESTNAME}>
+                                        "${COPY_TARGET_LIB}"
+        COMMENT "Copying lib${TUVTESTNAME} to ${COPY_TARGET_LIB}")
+  endif()
+endif()
+
+if(DEFINED BUILD_HOST_HELPER AND BUILD_HOST_HELPER STREQUAL "yes")
+  set(TUVHOSTHELPER "tuvhelper")
+  add_executable(${TUVHOSTHELPER} ${TEST_MAINFILE} ${TEST_UNITFILES}
+                 ${PLATFORM_HOSTHELPERFILES})
+
+  target_include_directories(${TUVHOSTHELPER} SYSTEM PRIVATE ${TARGET_INC})
+  target_include_directories(${TUVHOSTHELPER} PUBLIC ${LIB_TUV_INCDIRS})
+  target_link_libraries(${TUVHOSTHELPER} LINK_PUBLIC ${TARGETLIBNAME}
+                        ${TUV_LINK_LIBS})
+  set_target_properties(${TUVHOSTHELPER} PROPERTIES
+      ARCHIVE_OUTPUT_DIRECTORY "${LIB_OUT}"
+      LIBRARY_OUTPUT_DIRECTORY "${LIB_OUT}"
+      RUNTIME_OUTPUT_DIRECTORY "${BIN_OUT}")
+endif()
diff --git a/deps/libtuv/include/android-ifaddrs.h b/deps/libtuv/include/android-ifaddrs.h
new file mode 100644 (file)
index 0000000..9cd19fe
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 1995, 1999
+ *     Berkeley Software Design, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
+ */
+
+#ifndef        _IFADDRS_H_
+#define        _IFADDRS_H_
+
+struct ifaddrs {
+       struct ifaddrs  *ifa_next;
+       char            *ifa_name;
+       unsigned int     ifa_flags;
+       struct sockaddr *ifa_addr;
+       struct sockaddr *ifa_netmask;
+       struct sockaddr *ifa_dstaddr;
+       void            *ifa_data;
+};
+
+/*
+ * This may have been defined in <net/if.h>.  Note that if <net/if.h> is
+ * to be included it must be included before this header file.
+ */
+#ifndef        ifa_broadaddr
+#define        ifa_broadaddr   ifa_dstaddr     /* broadcast address interface */
+#endif
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+extern int getifaddrs(struct ifaddrs **ifap);
+extern void freeifaddrs(struct ifaddrs *ifa);
+__END_DECLS
+
+#endif
diff --git a/deps/libtuv/include/pthread-barrier.h b/deps/libtuv/include/pthread-barrier.h
new file mode 100644 (file)
index 0000000..3e01705
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+Copyright (c) 2016, Kari Tristan Helgason <kthelgason@gmail.com>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#ifndef _UV_PTHREAD_BARRIER_
+#define _UV_PTHREAD_BARRIER_
+#include <errno.h>
+#include <pthread.h>
+#include <semaphore.h> /* sem_t */
+
+#define PTHREAD_BARRIER_SERIAL_THREAD  0x12345
+
+/*
+ * To maintain ABI compatibility with
+ * libuv v1.x struct is padded according
+ * to target platform
+ */
+#if defined(__ANDROID__)
+# define UV_BARRIER_STRUCT_PADDING \
+  sizeof(pthread_mutex_t) + \
+  sizeof(pthread_cond_t) + \
+  sizeof(unsigned int) - \
+  sizeof(void *)
+#elif defined(__APPLE__)
+# define UV_BARRIER_STRUCT_PADDING \
+  sizeof(pthread_mutex_t) + \
+  2 * sizeof(sem_t) + \
+  2 * sizeof(unsigned int) - \
+  sizeof(void *)
+#else
+# define UV_BARRIER_STRUCT_PADDING 0
+#endif
+
+typedef struct {
+  pthread_mutex_t  mutex;
+  pthread_cond_t   cond;
+  unsigned         threshold;
+  unsigned         in;
+  unsigned         out;
+} _uv_barrier;
+
+typedef struct {
+  _uv_barrier* b;
+  char _pad[UV_BARRIER_STRUCT_PADDING];
+} pthread_barrier_t;
+
+int pthread_barrier_init(pthread_barrier_t* barrier,
+                         const void* barrier_attr,
+                         unsigned count);
+
+int pthread_barrier_wait(pthread_barrier_t* barrier);
+int pthread_barrier_destroy(pthread_barrier_t *barrier);
+
+#endif /* _UV_PTHREAD_BARRIER_ */
diff --git a/deps/libtuv/include/stdint-msvc2008.h b/deps/libtuv/include/stdint-msvc2008.h
new file mode 100644 (file)
index 0000000..d02608a
--- /dev/null
@@ -0,0 +1,247 @@
+// ISO C9x  compliant stdint.h for Microsoft Visual Studio
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
+// 
+//  Copyright (c) 2006-2008 Alexander Chemeris
+// 
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// 
+//   1. Redistributions of source code must retain the above copyright notice,
+//      this list of conditions and the following disclaimer.
+// 
+//   2. Redistributions in binary form must reproduce the above copyright
+//      notice, this list of conditions and the following disclaimer in the
+//      documentation and/or other materials provided with the distribution.
+// 
+//   3. The name of the author may be used to endorse or promote products
+//      derived from this software without specific prior written permission.
+// 
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// 
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _MSC_VER // [
+#error "Use this header only with Microsoft Visual C++ compilers!"
+#endif // _MSC_VER ]
+
+#ifndef _MSC_STDINT_H_ // [
+#define _MSC_STDINT_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif
+
+#include <limits.h>
+
+// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
+// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
+// or compiler give many errors like this:
+//   error C2733: second C linkage of overloaded function 'wmemchr' not allowed
+#ifdef __cplusplus
+extern "C" {
+#endif
+#  include <wchar.h>
+#ifdef __cplusplus
+}
+#endif
+
+// Define _W64 macros to mark types changing their size, like intptr_t.
+#ifndef _W64
+#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
+#     define _W64 __w64
+#  else
+#     define _W64
+#  endif
+#endif
+
+
+// 7.18.1 Integer types
+
+// 7.18.1.1 Exact-width integer types
+
+// Visual Studio 6 and Embedded Visual C++ 4 doesn't
+// realize that, e.g. char has the same size as __int8
+// so we give up on __intX for them.
+#if (_MSC_VER < 1300)
+   typedef signed char       int8_t;
+   typedef signed short      int16_t;
+   typedef signed int        int32_t;
+   typedef unsigned char     uint8_t;
+   typedef unsigned short    uint16_t;
+   typedef unsigned int      uint32_t;
+#else
+   typedef signed __int8     int8_t;
+   typedef signed __int16    int16_t;
+   typedef signed __int32    int32_t;
+   typedef unsigned __int8   uint8_t;
+   typedef unsigned __int16  uint16_t;
+   typedef unsigned __int32  uint32_t;
+#endif
+typedef signed __int64       int64_t;
+typedef unsigned __int64     uint64_t;
+
+
+// 7.18.1.2 Minimum-width integer types
+typedef int8_t    int_least8_t;
+typedef int16_t   int_least16_t;
+typedef int32_t   int_least32_t;
+typedef int64_t   int_least64_t;
+typedef uint8_t   uint_least8_t;
+typedef uint16_t  uint_least16_t;
+typedef uint32_t  uint_least32_t;
+typedef uint64_t  uint_least64_t;
+
+// 7.18.1.3 Fastest minimum-width integer types
+typedef int8_t    int_fast8_t;
+typedef int16_t   int_fast16_t;
+typedef int32_t   int_fast32_t;
+typedef int64_t   int_fast64_t;
+typedef uint8_t   uint_fast8_t;
+typedef uint16_t  uint_fast16_t;
+typedef uint32_t  uint_fast32_t;
+typedef uint64_t  uint_fast64_t;
+
+// 7.18.1.4 Integer types capable of holding object pointers
+#ifdef _WIN64 // [
+   typedef signed __int64    intptr_t;
+   typedef unsigned __int64  uintptr_t;
+#else // _WIN64 ][
+   typedef _W64 signed int   intptr_t;
+   typedef _W64 unsigned int uintptr_t;
+#endif // _WIN64 ]
+
+// 7.18.1.5 Greatest-width integer types
+typedef int64_t   intmax_t;
+typedef uint64_t  uintmax_t;
+
+
+// 7.18.2 Limits of specified-width integer types
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259
+
+// 7.18.2.1 Limits of exact-width integer types
+#define INT8_MIN     ((int8_t)_I8_MIN)
+#define INT8_MAX     _I8_MAX
+#define INT16_MIN    ((int16_t)_I16_MIN)
+#define INT16_MAX    _I16_MAX
+#define INT32_MIN    ((int32_t)_I32_MIN)
+#define INT32_MAX    _I32_MAX
+#define INT64_MIN    ((int64_t)_I64_MIN)
+#define INT64_MAX    _I64_MAX
+#define UINT8_MAX    _UI8_MAX
+#define UINT16_MAX   _UI16_MAX
+#define UINT32_MAX   _UI32_MAX
+#define UINT64_MAX   _UI64_MAX
+
+// 7.18.2.2 Limits of minimum-width integer types
+#define INT_LEAST8_MIN    INT8_MIN
+#define INT_LEAST8_MAX    INT8_MAX
+#define INT_LEAST16_MIN   INT16_MIN
+#define INT_LEAST16_MAX   INT16_MAX
+#define INT_LEAST32_MIN   INT32_MIN
+#define INT_LEAST32_MAX   INT32_MAX
+#define INT_LEAST64_MIN   INT64_MIN
+#define INT_LEAST64_MAX   INT64_MAX
+#define UINT_LEAST8_MAX   UINT8_MAX
+#define UINT_LEAST16_MAX  UINT16_MAX
+#define UINT_LEAST32_MAX  UINT32_MAX
+#define UINT_LEAST64_MAX  UINT64_MAX
+
+// 7.18.2.3 Limits of fastest minimum-width integer types
+#define INT_FAST8_MIN    INT8_MIN
+#define INT_FAST8_MAX    INT8_MAX
+#define INT_FAST16_MIN   INT16_MIN
+#define INT_FAST16_MAX   INT16_MAX
+#define INT_FAST32_MIN   INT32_MIN
+#define INT_FAST32_MAX   INT32_MAX
+#define INT_FAST64_MIN   INT64_MIN
+#define INT_FAST64_MAX   INT64_MAX
+#define UINT_FAST8_MAX   UINT8_MAX
+#define UINT_FAST16_MAX  UINT16_MAX
+#define UINT_FAST32_MAX  UINT32_MAX
+#define UINT_FAST64_MAX  UINT64_MAX
+
+// 7.18.2.4 Limits of integer types capable of holding object pointers
+#ifdef _WIN64 // [
+#  define INTPTR_MIN   INT64_MIN
+#  define INTPTR_MAX   INT64_MAX
+#  define UINTPTR_MAX  UINT64_MAX
+#else // _WIN64 ][
+#  define INTPTR_MIN   INT32_MIN
+#  define INTPTR_MAX   INT32_MAX
+#  define UINTPTR_MAX  UINT32_MAX
+#endif // _WIN64 ]
+
+// 7.18.2.5 Limits of greatest-width integer types
+#define INTMAX_MIN   INT64_MIN
+#define INTMAX_MAX   INT64_MAX
+#define UINTMAX_MAX  UINT64_MAX
+
+// 7.18.3 Limits of other integer types
+
+#ifdef _WIN64 // [
+#  define PTRDIFF_MIN  _I64_MIN
+#  define PTRDIFF_MAX  _I64_MAX
+#else  // _WIN64 ][
+#  define PTRDIFF_MIN  _I32_MIN
+#  define PTRDIFF_MAX  _I32_MAX
+#endif  // _WIN64 ]
+
+#define SIG_ATOMIC_MIN  INT_MIN
+#define SIG_ATOMIC_MAX  INT_MAX
+
+#ifndef SIZE_MAX // [
+#  ifdef _WIN64 // [
+#     define SIZE_MAX  _UI64_MAX
+#  else // _WIN64 ][
+#     define SIZE_MAX  _UI32_MAX
+#  endif // _WIN64 ]
+#endif // SIZE_MAX ]
+
+// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
+#ifndef WCHAR_MIN // [
+#  define WCHAR_MIN  0
+#endif  // WCHAR_MIN ]
+#ifndef WCHAR_MAX // [
+#  define WCHAR_MAX  _UI16_MAX
+#endif  // WCHAR_MAX ]
+
+#define WINT_MIN  0
+#define WINT_MAX  _UI16_MAX
+
+#endif // __STDC_LIMIT_MACROS ]
+
+
+// 7.18.4 Limits of other integer types
+
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260
+
+// 7.18.4.1 Macros for minimum-width integer constants
+
+#define INT8_C(val)  val##i8
+#define INT16_C(val) val##i16
+#define INT32_C(val) val##i32
+#define INT64_C(val) val##i64
+
+#define UINT8_C(val)  val##ui8
+#define UINT16_C(val) val##ui16
+#define UINT32_C(val) val##ui32
+#define UINT64_C(val) val##ui64
+
+// 7.18.4.2 Macros for greatest-width integer constants
+#define INTMAX_C   INT64_C
+#define UINTMAX_C  UINT64_C
+
+#endif // __STDC_CONSTANT_MACROS ]
+
+
+#endif // _MSC_STDINT_H_ ]
diff --git a/deps/libtuv/include/tree.h b/deps/libtuv/include/tree.h
new file mode 100644 (file)
index 0000000..f936416
--- /dev/null
@@ -0,0 +1,768 @@
+/*-
+ * Copyright 2002 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef  UV_TREE_H_
+#define  UV_TREE_H_
+
+#ifndef UV__UNUSED
+# if __GNUC__
+#  define UV__UNUSED __attribute__((unused))
+# else
+#  define UV__UNUSED
+# endif
+#endif
+
+/*
+ * This file defines data structures for different types of trees:
+ * splay trees and red-black trees.
+ *
+ * A splay tree is a self-organizing data structure.  Every operation
+ * on the tree causes a splay to happen.  The splay moves the requested
+ * node to the root of the tree and partly rebalances it.
+ *
+ * This has the benefit that request locality causes faster lookups as
+ * the requested nodes move to the top of the tree.  On the other hand,
+ * every lookup causes memory writes.
+ *
+ * The Balance Theorem bounds the total access time for m operations
+ * and n inserts on an initially empty tree as O((m + n)lg n).  The
+ * amortized cost for a sequence of m accesses to a splay tree is O(lg n);
+ *
+ * A red-black tree is a binary search tree with the node color as an
+ * extra attribute.  It fulfills a set of conditions:
+ *  - every search path from the root to a leaf consists of the
+ *    same number of black nodes,
+ *  - each red node (except for the root) has a black parent,
+ *  - each leaf node is black.
+ *
+ * Every operation on a red-black tree is bounded as O(lg n).
+ * The maximum height of a red-black tree is 2lg (n+1).
+ */
+
+#define SPLAY_HEAD(name, type)                                                \
+struct name {                                                                 \
+  struct type *sph_root; /* root of the tree */                               \
+}
+
+#define SPLAY_INITIALIZER(root)                                               \
+  { NULL }
+
+#define SPLAY_INIT(root) do {                                                 \
+  (root)->sph_root = NULL;                                                    \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ENTRY(type)                                                     \
+struct {                                                                      \
+  struct type *spe_left;          /* left element */                          \
+  struct type *spe_right;         /* right element */                         \
+}
+
+#define SPLAY_LEFT(elm, field)    (elm)->field.spe_left
+#define SPLAY_RIGHT(elm, field)   (elm)->field.spe_right
+#define SPLAY_ROOT(head)          (head)->sph_root
+#define SPLAY_EMPTY(head)         (SPLAY_ROOT(head) == NULL)
+
+/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
+#define SPLAY_ROTATE_RIGHT(head, tmp, field) do {                             \
+  SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field);              \
+  SPLAY_RIGHT(tmp, field) = (head)->sph_root;                                 \
+  (head)->sph_root = tmp;                                                     \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ROTATE_LEFT(head, tmp, field) do {                              \
+  SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field);              \
+  SPLAY_LEFT(tmp, field) = (head)->sph_root;                                  \
+  (head)->sph_root = tmp;                                                     \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_LINKLEFT(head, tmp, field) do {                                 \
+  SPLAY_LEFT(tmp, field) = (head)->sph_root;                                  \
+  tmp = (head)->sph_root;                                                     \
+  (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);                     \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_LINKRIGHT(head, tmp, field) do {                                \
+  SPLAY_RIGHT(tmp, field) = (head)->sph_root;                                 \
+  tmp = (head)->sph_root;                                                     \
+  (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);                    \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ASSEMBLE(head, node, left, right, field) do {                   \
+  SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field);             \
+  SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);            \
+  SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field);             \
+  SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field);             \
+} while (/*CONSTCOND*/ 0)
+
+/* Generates prototypes and inline functions */
+
+#define SPLAY_PROTOTYPE(name, type, field, cmp)                               \
+void name##_SPLAY(struct name *, struct type *);                              \
+void name##_SPLAY_MINMAX(struct name *, int);                                 \
+struct type *name##_SPLAY_INSERT(struct name *, struct type *);               \
+struct type *name##_SPLAY_REMOVE(struct name *, struct type *);               \
+                                                                              \
+/* Finds the node with the same key as elm */                                 \
+static __inline struct type *                                                 \
+name##_SPLAY_FIND(struct name *head, struct type *elm)                        \
+{                                                                             \
+  if (SPLAY_EMPTY(head))                                                      \
+    return(NULL);                                                             \
+  name##_SPLAY(head, elm);                                                    \
+  if ((cmp)(elm, (head)->sph_root) == 0)                                      \
+    return (head->sph_root);                                                  \
+  return (NULL);                                                              \
+}                                                                             \
+                                                                              \
+static __inline struct type *                                                 \
+name##_SPLAY_NEXT(struct name *head, struct type *elm)                        \
+{                                                                             \
+  name##_SPLAY(head, elm);                                                    \
+  if (SPLAY_RIGHT(elm, field) != NULL) {                                      \
+    elm = SPLAY_RIGHT(elm, field);                                            \
+    while (SPLAY_LEFT(elm, field) != NULL) {                                  \
+      elm = SPLAY_LEFT(elm, field);                                           \
+    }                                                                         \
+  } else                                                                      \
+    elm = NULL;                                                               \
+  return (elm);                                                               \
+}                                                                             \
+                                                                              \
+static __inline struct type *                                                 \
+name##_SPLAY_MIN_MAX(struct name *head, int val)                              \
+{                                                                             \
+  name##_SPLAY_MINMAX(head, val);                                             \
+  return (SPLAY_ROOT(head));                                                  \
+}
+
+/* Main splay operation.
+ * Moves node close to the key of elm to top
+ */
+#define SPLAY_GENERATE(name, type, field, cmp)                                \
+struct type *                                                                 \
+name##_SPLAY_INSERT(struct name *head, struct type *elm)                      \
+{                                                                             \
+    if (SPLAY_EMPTY(head)) {                                                  \
+      SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL;                \
+    } else {                                                                  \
+      int __comp;                                                             \
+      name##_SPLAY(head, elm);                                                \
+      __comp = (cmp)(elm, (head)->sph_root);                                  \
+      if(__comp < 0) {                                                        \
+        SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);         \
+        SPLAY_RIGHT(elm, field) = (head)->sph_root;                           \
+        SPLAY_LEFT((head)->sph_root, field) = NULL;                           \
+      } else if (__comp > 0) {                                                \
+        SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);       \
+        SPLAY_LEFT(elm, field) = (head)->sph_root;                            \
+        SPLAY_RIGHT((head)->sph_root, field) = NULL;                          \
+      } else                                                                  \
+        return ((head)->sph_root);                                            \
+    }                                                                         \
+    (head)->sph_root = (elm);                                                 \
+    return (NULL);                                                            \
+}                                                                             \
+                                                                              \
+struct type *                                                                 \
+name##_SPLAY_REMOVE(struct name *head, struct type *elm)                      \
+{                                                                             \
+  struct type *__tmp;                                                         \
+  if (SPLAY_EMPTY(head))                                                      \
+    return (NULL);                                                            \
+  name##_SPLAY(head, elm);                                                    \
+  if ((cmp)(elm, (head)->sph_root) == 0) {                                    \
+    if (SPLAY_LEFT((head)->sph_root, field) == NULL) {                        \
+      (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);                \
+    } else {                                                                  \
+      __tmp = SPLAY_RIGHT((head)->sph_root, field);                           \
+      (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);                 \
+      name##_SPLAY(head, elm);                                                \
+      SPLAY_RIGHT((head)->sph_root, field) = __tmp;                           \
+    }                                                                         \
+    return (elm);                                                             \
+  }                                                                           \
+  return (NULL);                                                              \
+}                                                                             \
+                                                                              \
+void                                                                          \
+name##_SPLAY(struct name *head, struct type *elm)                             \
+{                                                                             \
+  struct type __node, *__left, *__right, *__tmp;                              \
+  int __comp;                                                                 \
+                                                                              \
+  SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;            \
+  __left = __right = &__node;                                                 \
+                                                                              \
+  while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) {                      \
+    if (__comp < 0) {                                                         \
+      __tmp = SPLAY_LEFT((head)->sph_root, field);                            \
+      if (__tmp == NULL)                                                      \
+        break;                                                                \
+      if ((cmp)(elm, __tmp) < 0){                                             \
+        SPLAY_ROTATE_RIGHT(head, __tmp, field);                               \
+        if (SPLAY_LEFT((head)->sph_root, field) == NULL)                      \
+          break;                                                              \
+      }                                                                       \
+      SPLAY_LINKLEFT(head, __right, field);                                   \
+    } else if (__comp > 0) {                                                  \
+      __tmp = SPLAY_RIGHT((head)->sph_root, field);                           \
+      if (__tmp == NULL)                                                      \
+        break;                                                                \
+      if ((cmp)(elm, __tmp) > 0){                                             \
+        SPLAY_ROTATE_LEFT(head, __tmp, field);                                \
+        if (SPLAY_RIGHT((head)->sph_root, field) == NULL)                     \
+          break;                                                              \
+      }                                                                       \
+      SPLAY_LINKRIGHT(head, __left, field);                                   \
+    }                                                                         \
+  }                                                                           \
+  SPLAY_ASSEMBLE(head, &__node, __left, __right, field);                      \
+}                                                                             \
+                                                                              \
+/* Splay with either the minimum or the maximum element                       \
+ * Used to find minimum or maximum element in tree.                           \
+ */                                                                           \
+void name##_SPLAY_MINMAX(struct name *head, int __comp)                       \
+{                                                                             \
+  struct type __node, *__left, *__right, *__tmp;                              \
+                                                                              \
+  SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;            \
+  __left = __right = &__node;                                                 \
+                                                                              \
+  while (1) {                                                                 \
+    if (__comp < 0) {                                                         \
+      __tmp = SPLAY_LEFT((head)->sph_root, field);                            \
+      if (__tmp == NULL)                                                      \
+        break;                                                                \
+      if (__comp < 0){                                                        \
+        SPLAY_ROTATE_RIGHT(head, __tmp, field);                               \
+        if (SPLAY_LEFT((head)->sph_root, field) == NULL)                      \
+          break;                                                              \
+      }                                                                       \
+      SPLAY_LINKLEFT(head, __right, field);                                   \
+    } else if (__comp > 0) {                                                  \
+      __tmp = SPLAY_RIGHT((head)->sph_root, field);                           \
+      if (__tmp == NULL)                                                      \
+        break;                                                                \
+      if (__comp > 0) {                                                       \
+        SPLAY_ROTATE_LEFT(head, __tmp, field);                                \
+        if (SPLAY_RIGHT((head)->sph_root, field) == NULL)                     \
+          break;                                                              \
+      }                                                                       \
+      SPLAY_LINKRIGHT(head, __left, field);                                   \
+    }                                                                         \
+  }                                                                           \
+  SPLAY_ASSEMBLE(head, &__node, __left, __right, field);                      \
+}
+
+#define SPLAY_NEGINF  -1
+#define SPLAY_INF     1
+
+#define SPLAY_INSERT(name, x, y)  name##_SPLAY_INSERT(x, y)
+#define SPLAY_REMOVE(name, x, y)  name##_SPLAY_REMOVE(x, y)
+#define SPLAY_FIND(name, x, y)    name##_SPLAY_FIND(x, y)
+#define SPLAY_NEXT(name, x, y)    name##_SPLAY_NEXT(x, y)
+#define SPLAY_MIN(name, x)        (SPLAY_EMPTY(x) ? NULL                      \
+                                  : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))
+#define SPLAY_MAX(name, x)        (SPLAY_EMPTY(x) ? NULL                      \
+                                  : name##_SPLAY_MIN_MAX(x, SPLAY_INF))
+
+#define SPLAY_FOREACH(x, name, head)                                          \
+  for ((x) = SPLAY_MIN(name, head);                                           \
+       (x) != NULL;                                                           \
+       (x) = SPLAY_NEXT(name, head, x))
+
+/* Macros that define a red-black tree */
+#define RB_HEAD(name, type)                                                   \
+struct name {                                                                 \
+  struct type *rbh_root; /* root of the tree */                               \
+}
+
+#define RB_INITIALIZER(root)                                                  \
+  { NULL }
+
+#define RB_INIT(root) do {                                                    \
+  (root)->rbh_root = NULL;                                                    \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_BLACK  0
+#define RB_RED    1
+#define RB_ENTRY(type)                                                        \
+struct {                                                                      \
+  struct type *rbe_left;        /* left element */                            \
+  struct type *rbe_right;       /* right element */                           \
+  struct type *rbe_parent;      /* parent element */                          \
+  int rbe_color;                /* node color */                              \
+}
+
+#define RB_LEFT(elm, field)     (elm)->field.rbe_left
+#define RB_RIGHT(elm, field)    (elm)->field.rbe_right
+#define RB_PARENT(elm, field)   (elm)->field.rbe_parent
+#define RB_COLOR(elm, field)    (elm)->field.rbe_color
+#define RB_ROOT(head)           (head)->rbh_root
+#define RB_EMPTY(head)          (RB_ROOT(head) == NULL)
+
+#define RB_SET(elm, parent, field) do {                                       \
+  RB_PARENT(elm, field) = parent;                                             \
+  RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL;                          \
+  RB_COLOR(elm, field) = RB_RED;                                              \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_SET_BLACKRED(black, red, field) do {                               \
+  RB_COLOR(black, field) = RB_BLACK;                                          \
+  RB_COLOR(red, field) = RB_RED;                                              \
+} while (/*CONSTCOND*/ 0)
+
+#ifndef RB_AUGMENT
+#define RB_AUGMENT(x)  do {} while (0)
+#endif
+
+#define RB_ROTATE_LEFT(head, elm, tmp, field) do {                            \
+  (tmp) = RB_RIGHT(elm, field);                                               \
+  if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) {                 \
+    RB_PARENT(RB_LEFT(tmp, field), field) = (elm);                            \
+  }                                                                           \
+  RB_AUGMENT(elm);                                                            \
+  if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) {              \
+    if ((elm) == RB_LEFT(RB_PARENT(elm, field), field))                       \
+      RB_LEFT(RB_PARENT(elm, field), field) = (tmp);                          \
+    else                                                                      \
+      RB_RIGHT(RB_PARENT(elm, field), field) = (tmp);                         \
+  } else                                                                      \
+    (head)->rbh_root = (tmp);                                                 \
+  RB_LEFT(tmp, field) = (elm);                                                \
+  RB_PARENT(elm, field) = (tmp);                                              \
+  RB_AUGMENT(tmp);                                                            \
+  if ((RB_PARENT(tmp, field)))                                                \
+    RB_AUGMENT(RB_PARENT(tmp, field));                                        \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_ROTATE_RIGHT(head, elm, tmp, field) do {                           \
+  (tmp) = RB_LEFT(elm, field);                                                \
+  if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) {                 \
+    RB_PARENT(RB_RIGHT(tmp, field), field) = (elm);                           \
+  }                                                                           \
+  RB_AUGMENT(elm);                                                            \
+  if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) {              \
+    if ((elm) == RB_LEFT(RB_PARENT(elm, field), field))                       \
+      RB_LEFT(RB_PARENT(elm, field), field) = (tmp);                          \
+    else                                                                      \
+      RB_RIGHT(RB_PARENT(elm, field), field) = (tmp);                         \
+  } else                                                                      \
+    (head)->rbh_root = (tmp);                                                 \
+  RB_RIGHT(tmp, field) = (elm);                                               \
+  RB_PARENT(elm, field) = (tmp);                                              \
+  RB_AUGMENT(tmp);                                                            \
+  if ((RB_PARENT(tmp, field)))                                                \
+    RB_AUGMENT(RB_PARENT(tmp, field));                                        \
+} while (/*CONSTCOND*/ 0)
+
+/* Generates prototypes and inline functions */
+#define  RB_PROTOTYPE(name, type, field, cmp)                                 \
+  RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
+#define  RB_PROTOTYPE_STATIC(name, type, field, cmp)                          \
+  RB_PROTOTYPE_INTERNAL(name, type, field, cmp, UV__UNUSED static)
+#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr)                   \
+attr void name##_RB_INSERT_COLOR(struct name *, struct type *);               \
+attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
+attr struct type *name##_RB_REMOVE(struct name *, struct type *);             \
+attr struct type *name##_RB_INSERT(struct name *, struct type *);             \
+attr struct type *name##_RB_FIND(struct name *, struct type *);               \
+attr struct type *name##_RB_NFIND(struct name *, struct type *);              \
+attr struct type *name##_RB_NEXT(struct type *);                              \
+attr struct type *name##_RB_PREV(struct type *);                              \
+attr struct type *name##_RB_MINMAX(struct name *, int);                       \
+                                                                              \
+
+/* Main rb operation.
+ * Moves node close to the key of elm to top
+ */
+#define  RB_GENERATE(name, type, field, cmp)                                  \
+  RB_GENERATE_INTERNAL(name, type, field, cmp,)
+#define  RB_GENERATE_STATIC(name, type, field, cmp)                           \
+  RB_GENERATE_INTERNAL(name, type, field, cmp, UV__UNUSED static)
+#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr)                    \
+attr void                                                                     \
+name##_RB_INSERT_COLOR(struct name *head, struct type *elm)                   \
+{                                                                             \
+  struct type *parent, *gparent, *tmp;                                        \
+  while ((parent = RB_PARENT(elm, field)) != NULL &&                          \
+      RB_COLOR(parent, field) == RB_RED) {                                    \
+    gparent = RB_PARENT(parent, field);                                       \
+    if (parent == RB_LEFT(gparent, field)) {                                  \
+      tmp = RB_RIGHT(gparent, field);                                         \
+      if (tmp && RB_COLOR(tmp, field) == RB_RED) {                            \
+        RB_COLOR(tmp, field) = RB_BLACK;                                      \
+        RB_SET_BLACKRED(parent, gparent, field);                              \
+        elm = gparent;                                                        \
+        continue;                                                             \
+      }                                                                       \
+      if (RB_RIGHT(parent, field) == elm) {                                   \
+        RB_ROTATE_LEFT(head, parent, tmp, field);                             \
+        tmp = parent;                                                         \
+        parent = elm;                                                         \
+        elm = tmp;                                                            \
+      }                                                                       \
+      RB_SET_BLACKRED(parent, gparent, field);                                \
+      RB_ROTATE_RIGHT(head, gparent, tmp, field);                             \
+    } else {                                                                  \
+      tmp = RB_LEFT(gparent, field);                                          \
+      if (tmp && RB_COLOR(tmp, field) == RB_RED) {                            \
+        RB_COLOR(tmp, field) = RB_BLACK;                                      \
+        RB_SET_BLACKRED(parent, gparent, field);                              \
+        elm = gparent;                                                        \
+        continue;                                                             \
+      }                                                                       \
+      if (RB_LEFT(parent, field) == elm) {                                    \
+        RB_ROTATE_RIGHT(head, parent, tmp, field);                            \
+        tmp = parent;                                                         \
+        parent = elm;                                                         \
+        elm = tmp;                                                            \
+      }                                                                       \
+      RB_SET_BLACKRED(parent, gparent, field);                                \
+      RB_ROTATE_LEFT(head, gparent, tmp, field);                              \
+    }                                                                         \
+  }                                                                           \
+  RB_COLOR(head->rbh_root, field) = RB_BLACK;                                 \
+}                                                                             \
+                                                                              \
+attr void                                                                     \
+name##_RB_REMOVE_COLOR(struct name *head, struct type *parent,                \
+    struct type *elm)                                                         \
+{                                                                             \
+  struct type *tmp;                                                           \
+  while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) &&                 \
+      elm != RB_ROOT(head)) {                                                 \
+    if (RB_LEFT(parent, field) == elm) {                                      \
+      tmp = RB_RIGHT(parent, field);                                          \
+      if (RB_COLOR(tmp, field) == RB_RED) {                                   \
+        RB_SET_BLACKRED(tmp, parent, field);                                  \
+        RB_ROTATE_LEFT(head, parent, tmp, field);                             \
+        tmp = RB_RIGHT(parent, field);                                        \
+      }                                                                       \
+      if ((RB_LEFT(tmp, field) == NULL ||                                     \
+          RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&                \
+          (RB_RIGHT(tmp, field) == NULL ||                                    \
+          RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {               \
+        RB_COLOR(tmp, field) = RB_RED;                                        \
+        elm = parent;                                                         \
+        parent = RB_PARENT(elm, field);                                       \
+      } else {                                                                \
+        if (RB_RIGHT(tmp, field) == NULL ||                                   \
+            RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {              \
+          struct type *oleft;                                                 \
+          if ((oleft = RB_LEFT(tmp, field))                                   \
+              != NULL)                                                        \
+            RB_COLOR(oleft, field) = RB_BLACK;                                \
+          RB_COLOR(tmp, field) = RB_RED;                                      \
+          RB_ROTATE_RIGHT(head, tmp, oleft, field);                           \
+          tmp = RB_RIGHT(parent, field);                                      \
+        }                                                                     \
+        RB_COLOR(tmp, field) = RB_COLOR(parent, field);                       \
+        RB_COLOR(parent, field) = RB_BLACK;                                   \
+        if (RB_RIGHT(tmp, field))                                             \
+          RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;                   \
+        RB_ROTATE_LEFT(head, parent, tmp, field);                             \
+        elm = RB_ROOT(head);                                                  \
+        break;                                                                \
+      }                                                                       \
+    } else {                                                                  \
+      tmp = RB_LEFT(parent, field);                                           \
+      if (RB_COLOR(tmp, field) == RB_RED) {                                   \
+        RB_SET_BLACKRED(tmp, parent, field);                                  \
+        RB_ROTATE_RIGHT(head, parent, tmp, field);                            \
+        tmp = RB_LEFT(parent, field);                                         \
+      }                                                                       \
+      if ((RB_LEFT(tmp, field) == NULL ||                                     \
+          RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&                \
+          (RB_RIGHT(tmp, field) == NULL ||                                    \
+          RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {               \
+        RB_COLOR(tmp, field) = RB_RED;                                        \
+        elm = parent;                                                         \
+        parent = RB_PARENT(elm, field);                                       \
+      } else {                                                                \
+        if (RB_LEFT(tmp, field) == NULL ||                                    \
+            RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {               \
+          struct type *oright;                                                \
+          if ((oright = RB_RIGHT(tmp, field))                                 \
+              != NULL)                                                        \
+            RB_COLOR(oright, field) = RB_BLACK;                               \
+          RB_COLOR(tmp, field) = RB_RED;                                      \
+          RB_ROTATE_LEFT(head, tmp, oright, field);                           \
+          tmp = RB_LEFT(parent, field);                                       \
+        }                                                                     \
+        RB_COLOR(tmp, field) = RB_COLOR(parent, field);                       \
+        RB_COLOR(parent, field) = RB_BLACK;                                   \
+        if (RB_LEFT(tmp, field))                                              \
+          RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;                    \
+        RB_ROTATE_RIGHT(head, parent, tmp, field);                            \
+        elm = RB_ROOT(head);                                                  \
+        break;                                                                \
+      }                                                                       \
+    }                                                                         \
+  }                                                                           \
+  if (elm)                                                                    \
+    RB_COLOR(elm, field) = RB_BLACK;                                          \
+}                                                                             \
+                                                                              \
+attr struct type *                                                            \
+name##_RB_REMOVE(struct name *head, struct type *elm)                         \
+{                                                                             \
+  struct type *child, *parent, *old = elm;                                    \
+  int color;                                                                  \
+  if (RB_LEFT(elm, field) == NULL)                                            \
+    child = RB_RIGHT(elm, field);                                             \
+  else if (RB_RIGHT(elm, field) == NULL)                                      \
+    child = RB_LEFT(elm, field);                                              \
+  else {                                                                      \
+    struct type *left;                                                        \
+    elm = RB_RIGHT(elm, field);                                               \
+    while ((left = RB_LEFT(elm, field)) != NULL)                              \
+      elm = left;                                                             \
+    child = RB_RIGHT(elm, field);                                             \
+    parent = RB_PARENT(elm, field);                                           \
+    color = RB_COLOR(elm, field);                                             \
+    if (child)                                                                \
+      RB_PARENT(child, field) = parent;                                       \
+    if (parent) {                                                             \
+      if (RB_LEFT(parent, field) == elm)                                      \
+        RB_LEFT(parent, field) = child;                                       \
+      else                                                                    \
+        RB_RIGHT(parent, field) = child;                                      \
+      RB_AUGMENT(parent);                                                     \
+    } else                                                                    \
+      RB_ROOT(head) = child;                                                  \
+    if (RB_PARENT(elm, field) == old)                                         \
+      parent = elm;                                                           \
+    (elm)->field = (old)->field;                                              \
+    if (RB_PARENT(old, field)) {                                              \
+      if (RB_LEFT(RB_PARENT(old, field), field) == old)                       \
+        RB_LEFT(RB_PARENT(old, field), field) = elm;                          \
+      else                                                                    \
+        RB_RIGHT(RB_PARENT(old, field), field) = elm;                         \
+      RB_AUGMENT(RB_PARENT(old, field));                                      \
+    } else                                                                    \
+      RB_ROOT(head) = elm;                                                    \
+    RB_PARENT(RB_LEFT(old, field), field) = elm;                              \
+    if (RB_RIGHT(old, field))                                                 \
+      RB_PARENT(RB_RIGHT(old, field), field) = elm;                           \
+    if (parent) {                                                             \
+      left = parent;                                                          \
+      do {                                                                    \
+        RB_AUGMENT(left);                                                     \
+      } while ((left = RB_PARENT(left, field)) != NULL);                      \
+    }                                                                         \
+    goto color;                                                               \
+  }                                                                           \
+  parent = RB_PARENT(elm, field);                                             \
+  color = RB_COLOR(elm, field);                                               \
+  if (child)                                                                  \
+    RB_PARENT(child, field) = parent;                                         \
+  if (parent) {                                                               \
+    if (RB_LEFT(parent, field) == elm)                                        \
+      RB_LEFT(parent, field) = child;                                         \
+    else                                                                      \
+      RB_RIGHT(parent, field) = child;                                        \
+    RB_AUGMENT(parent);                                                       \
+  } else                                                                      \
+    RB_ROOT(head) = child;                                                    \
+color:                                                                        \
+  if (color == RB_BLACK)                                                      \
+    name##_RB_REMOVE_COLOR(head, parent, child);                              \
+  return (old);                                                               \
+}                                                                             \
+                                                                              \
+/* Inserts a node into the RB tree */                                         \
+attr struct type *                                                            \
+name##_RB_INSERT(struct name *head, struct type *elm)                         \
+{                                                                             \
+  struct type *tmp;                                                           \
+  struct type *parent = NULL;                                                 \
+  int comp = 0;                                                               \
+  tmp = RB_ROOT(head);                                                        \
+  while (tmp) {                                                               \
+    parent = tmp;                                                             \
+    comp = (cmp)(elm, parent);                                                \
+    if (comp < 0)                                                             \
+      tmp = RB_LEFT(tmp, field);                                              \
+    else if (comp > 0)                                                        \
+      tmp = RB_RIGHT(tmp, field);                                             \
+    else                                                                      \
+      return (tmp);                                                           \
+  }                                                                           \
+  RB_SET(elm, parent, field);                                                 \
+  if (parent != NULL) {                                                       \
+    if (comp < 0)                                                             \
+      RB_LEFT(parent, field) = elm;                                           \
+    else                                                                      \
+      RB_RIGHT(parent, field) = elm;                                          \
+    RB_AUGMENT(parent);                                                       \
+  } else                                                                      \
+    RB_ROOT(head) = elm;                                                      \
+  name##_RB_INSERT_COLOR(head, elm);                                          \
+  return (NULL);                                                              \
+}                                                                             \
+                                                                              \
+/* Finds the node with the same key as elm */                                 \
+attr struct type *                                                            \
+name##_RB_FIND(struct name *head, struct type *elm)                           \
+{                                                                             \
+  struct type *tmp = RB_ROOT(head);                                           \
+  int comp;                                                                   \
+  while (tmp) {                                                               \
+    comp = cmp(elm, tmp);                                                     \
+    if (comp < 0)                                                             \
+      tmp = RB_LEFT(tmp, field);                                              \
+    else if (comp > 0)                                                        \
+      tmp = RB_RIGHT(tmp, field);                                             \
+    else                                                                      \
+      return (tmp);                                                           \
+  }                                                                           \
+  return (NULL);                                                              \
+}                                                                             \
+                                                                              \
+/* Finds the first node greater than or equal to the search key */            \
+attr struct type *                                                            \
+name##_RB_NFIND(struct name *head, struct type *elm)                          \
+{                                                                             \
+  struct type *tmp = RB_ROOT(head);                                           \
+  struct type *res = NULL;                                                    \
+  int comp;                                                                   \
+  while (tmp) {                                                               \
+    comp = cmp(elm, tmp);                                                     \
+    if (comp < 0) {                                                           \
+      res = tmp;                                                              \
+      tmp = RB_LEFT(tmp, field);                                              \
+    }                                                                         \
+    else if (comp > 0)                                                        \
+      tmp = RB_RIGHT(tmp, field);                                             \
+    else                                                                      \
+      return (tmp);                                                           \
+  }                                                                           \
+  return (res);                                                               \
+}                                                                             \
+                                                                              \
+/* ARGSUSED */                                                                \
+attr struct type *                                                            \
+name##_RB_NEXT(struct type *elm)                                              \
+{                                                                             \
+  if (RB_RIGHT(elm, field)) {                                                 \
+    elm = RB_RIGHT(elm, field);                                               \
+    while (RB_LEFT(elm, field))                                               \
+      elm = RB_LEFT(elm, field);                                              \
+  } else {                                                                    \
+    if (RB_PARENT(elm, field) &&                                              \
+        (elm == RB_LEFT(RB_PARENT(elm, field), field)))                       \
+      elm = RB_PARENT(elm, field);                                            \
+    else {                                                                    \
+      while (RB_PARENT(elm, field) &&                                         \
+          (elm == RB_RIGHT(RB_PARENT(elm, field), field)))                    \
+        elm = RB_PARENT(elm, field);                                          \
+      elm = RB_PARENT(elm, field);                                            \
+    }                                                                         \
+  }                                                                           \
+  return (elm);                                                               \
+}                                                                             \
+                                                                              \
+/* ARGSUSED */                                                                \
+attr struct type *                                                            \
+name##_RB_PREV(struct type *elm)                                              \
+{                                                                             \
+  if (RB_LEFT(elm, field)) {                                                  \
+    elm = RB_LEFT(elm, field);                                                \
+    while (RB_RIGHT(elm, field))                                              \
+      elm = RB_RIGHT(elm, field);                                             \
+  } else {                                                                    \
+    if (RB_PARENT(elm, field) &&                                              \
+        (elm == RB_RIGHT(RB_PARENT(elm, field), field)))                      \
+      elm = RB_PARENT(elm, field);                                            \
+    else {                                                                    \
+      while (RB_PARENT(elm, field) &&                                         \
+          (elm == RB_LEFT(RB_PARENT(elm, field), field)))                     \
+        elm = RB_PARENT(elm, field);                                          \
+      elm = RB_PARENT(elm, field);                                            \
+    }                                                                         \
+  }                                                                           \
+  return (elm);                                                               \
+}                                                                             \
+                                                                              \
+attr struct type *                                                            \
+name##_RB_MINMAX(struct name *head, int val)                                  \
+{                                                                             \
+  struct type *tmp = RB_ROOT(head);                                           \
+  struct type *parent = NULL;                                                 \
+  while (tmp) {                                                               \
+    parent = tmp;                                                             \
+    if (val < 0)                                                              \
+      tmp = RB_LEFT(tmp, field);                                              \
+    else                                                                      \
+      tmp = RB_RIGHT(tmp, field);                                             \
+  }                                                                           \
+  return (parent);                                                            \
+}
+
+#define RB_NEGINF   -1
+#define RB_INF      1
+
+#define RB_INSERT(name, x, y)   name##_RB_INSERT(x, y)
+#define RB_REMOVE(name, x, y)   name##_RB_REMOVE(x, y)
+#define RB_FIND(name, x, y)     name##_RB_FIND(x, y)
+#define RB_NFIND(name, x, y)    name##_RB_NFIND(x, y)
+#define RB_NEXT(name, x, y)     name##_RB_NEXT(y)
+#define RB_PREV(name, x, y)     name##_RB_PREV(y)
+#define RB_MIN(name, x)         name##_RB_MINMAX(x, RB_NEGINF)
+#define RB_MAX(name, x)         name##_RB_MINMAX(x, RB_INF)
+
+#define RB_FOREACH(x, name, head)                                             \
+  for ((x) = RB_MIN(name, head);                                              \
+       (x) != NULL;                                                           \
+       (x) = name##_RB_NEXT(x))
+
+#define RB_FOREACH_FROM(x, name, y)                                           \
+  for ((x) = (y);                                                             \
+      ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL);                \
+       (x) = (y))
+
+#define RB_FOREACH_SAFE(x, name, head, y)                                     \
+  for ((x) = RB_MIN(name, head);                                              \
+      ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL);                \
+       (x) = (y))
+
+#define RB_FOREACH_REVERSE(x, name, head)                                     \
+  for ((x) = RB_MAX(name, head);                                              \
+       (x) != NULL;                                                           \
+       (x) = name##_RB_PREV(x))
+
+#define RB_FOREACH_REVERSE_FROM(x, name, y)                                   \
+  for ((x) = (y);                                                             \
+      ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL);                \
+       (x) = (y))
+
+#define RB_FOREACH_REVERSE_SAFE(x, name, head, y)                             \
+  for ((x) = RB_MAX(name, head);                                              \
+      ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL);                \
+       (x) = (y))
+
+#endif  /* UV_TREE_H_ */
diff --git a/deps/libtuv/include/tuv__debuglog.h b/deps/libtuv/include/tuv__debuglog.h
new file mode 100644 (file)
index 0000000..b67e1ca
--- /dev/null
@@ -0,0 +1,111 @@
+/* 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.
+ */
+
+#ifndef __tuv_debuglog_header__
+#define __tuv_debuglog_header__
+
+
+#ifdef ENABLE_DEBUG_LOG
+
+#include <stdio.h>
+
+#if defined(DEBUG)
+#define ABORT()                  \
+  do {                           \
+    TDLOG("!!!!! ABORT !!!!!");  \
+    exit(-1);                    \
+  } while(0)
+#else
+#define ABORT() abort()
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern int tuv_debug_level;
+extern FILE *tuv_log_stream;
+extern const char* tuv_debug_prefix[4];
+
+#define TDBGLEV_ERR  1
+#define TDBGLEV_WARN 2
+#define TDBGLEV_INFO 3
+
+#define TUV_DLOG(lvl, ...) \
+  do { \
+    int errback = errno; \
+    if (0 <= lvl && lvl <= tuv_debug_level && tuv_log_stream) { \
+      fprintf(tuv_log_stream, "[%s] ", tuv_debug_prefix[lvl]); \
+      fprintf(tuv_log_stream, __VA_ARGS__); \
+      fprintf(tuv_log_stream, "\r\n"); \
+      fflush(tuv_log_stream); \
+    } \
+    errno = errback; \
+  } while (0)
+#define TDLOG(...)   TUV_DLOG(TDBGLEV_ERR, __VA_ARGS__)
+#define TDDLOG(...)  TUV_DLOG(TDBGLEV_WARN, __VA_ARGS__)
+#define TDDDLOG(...) TUV_DLOG(TDBGLEV_INFO, __VA_ARGS__)
+
+/*
+  Use DLOG for errors, default you will see them
+  Use DDLOG for warnings, set tuv_debug_level=2 to see them
+  USE DDDLOG for informations, set tuv_debug_level=3 to see them
+*/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#else /* !ENABLE_DEBUG_LOG */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ABORT()
+#define TUV_DLOG(...)
+#define TDLOG(...)
+#define TDDLOG(...)
+#define TDDDLOG(...)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* ENABLE_DEBUG_LOG */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void InitDebugSettings();
+void ReleaseDebugSettings();
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* __tuv_debuglog_header__ */
diff --git a/deps/libtuv/include/uv-aix.h b/deps/libtuv/include/uv-aix.h
new file mode 100644 (file)
index 0000000..7dc992f
--- /dev/null
@@ -0,0 +1,32 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_AIX_H
+#define UV_AIX_H
+
+#define UV_PLATFORM_LOOP_FIELDS                                               \
+  int fs_fd;                                                                  \
+
+#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
+  uv__io_t event_watcher;                                                     \
+  char *dir_filename;                                                         \
+
+#endif /* UV_AIX_H */
diff --git a/deps/libtuv/include/uv-bsd.h b/deps/libtuv/include/uv-bsd.h
new file mode 100644 (file)
index 0000000..2d72b3d
--- /dev/null
@@ -0,0 +1,34 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_BSD_H
+#define UV_BSD_H
+
+#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
+  uv__io_t event_watcher;                                                     \
+
+#define UV_IO_PRIVATE_PLATFORM_FIELDS                                         \
+  int rcount;                                                                 \
+  int wcount;                                                                 \
+
+#define UV_HAVE_KQUEUE 1
+
+#endif /* UV_BSD_H */
diff --git a/deps/libtuv/include/uv-darwin.h b/deps/libtuv/include/uv-darwin.h
new file mode 100644 (file)
index 0000000..d226415
--- /dev/null
@@ -0,0 +1,61 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_DARWIN_H
+#define UV_DARWIN_H
+
+#if defined(__APPLE__) && defined(__MACH__)
+# include <mach/mach.h>
+# include <mach/task.h>
+# include <mach/semaphore.h>
+# include <TargetConditionals.h>
+# define UV_PLATFORM_SEM_T semaphore_t
+#endif
+
+#define UV_IO_PRIVATE_PLATFORM_FIELDS                                         \
+  int rcount;                                                                 \
+  int wcount;                                                                 \
+
+#define UV_PLATFORM_LOOP_FIELDS                                               \
+  uv_thread_t cf_thread;                                                      \
+  void* _cf_reserved;                                                         \
+  void* cf_state;                                                             \
+  uv_mutex_t cf_mutex;                                                        \
+  uv_sem_t cf_sem;                                                            \
+  void* cf_signals[2];                                                        \
+
+#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
+  uv__io_t event_watcher;                                                     \
+  char* realpath;                                                             \
+  int realpath_len;                                                           \
+  int cf_flags;                                                               \
+  uv_async_t* cf_cb;                                                          \
+  void* cf_events[2];                                                         \
+  void* cf_member[2];                                                         \
+  int cf_error;                                                               \
+  uv_mutex_t cf_mutex;                                                        \
+
+#define UV_STREAM_PRIVATE_PLATFORM_FIELDS                                     \
+  void* select;                                                               \
+
+#define UV_HAVE_KQUEUE 1
+
+#endif /* UV_DARWIN_H */
diff --git a/deps/libtuv/include/uv-errno.h b/deps/libtuv/include/uv-errno.h
new file mode 100644 (file)
index 0000000..f137151
--- /dev/null
@@ -0,0 +1,419 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_ERRNO_H_
+#define UV_ERRNO_H_
+
+#include <errno.h>
+
+#define UV__EOF     (-4095)
+#define UV__UNKNOWN (-4094)
+
+#define UV__EAI_ADDRFAMILY  (-3000)
+#define UV__EAI_AGAIN       (-3001)
+#define UV__EAI_BADFLAGS    (-3002)
+#define UV__EAI_CANCELED    (-3003)
+#define UV__EAI_FAIL        (-3004)
+#define UV__EAI_FAMILY      (-3005)
+#define UV__EAI_MEMORY      (-3006)
+#define UV__EAI_NODATA      (-3007)
+#define UV__EAI_NONAME      (-3008)
+#define UV__EAI_OVERFLOW    (-3009)
+#define UV__EAI_SERVICE     (-3010)
+#define UV__EAI_SOCKTYPE    (-3011)
+#define UV__EAI_BADHINTS    (-3013)
+#define UV__EAI_PROTOCOL    (-3014)
+
+/* Only map to the system errno on non-Windows platforms. It's apparently
+ * a fairly common practice for Windows programmers to redefine errno codes.
+ */
+#if defined(E2BIG) && !defined(_WIN32)
+# define UV__E2BIG (-E2BIG)
+#else
+# define UV__E2BIG (-4093)
+#endif
+
+#if defined(EACCES) && !defined(_WIN32)
+# define UV__EACCES (-EACCES)
+#else
+# define UV__EACCES (-4092)
+#endif
+
+#if defined(EADDRINUSE) && !defined(_WIN32)
+# define UV__EADDRINUSE (-EADDRINUSE)
+#else
+# define UV__EADDRINUSE (-4091)
+#endif
+
+#if defined(EADDRNOTAVAIL) && !defined(_WIN32)
+# define UV__EADDRNOTAVAIL (-EADDRNOTAVAIL)
+#else
+# define UV__EADDRNOTAVAIL (-4090)
+#endif
+
+#if defined(EAFNOSUPPORT) && !defined(_WIN32)
+# define UV__EAFNOSUPPORT (-EAFNOSUPPORT)
+#else
+# define UV__EAFNOSUPPORT (-4089)
+#endif
+
+#if defined(EAGAIN) && !defined(_WIN32)
+# define UV__EAGAIN (-EAGAIN)
+#else
+# define UV__EAGAIN (-4088)
+#endif
+
+#if defined(EALREADY) && !defined(_WIN32)
+# define UV__EALREADY (-EALREADY)
+#else
+# define UV__EALREADY (-4084)
+#endif
+
+#if defined(EBADF) && !defined(_WIN32)
+# define UV__EBADF (-EBADF)
+#else
+# define UV__EBADF (-4083)
+#endif
+
+#if defined(EBUSY) && !defined(_WIN32)
+# define UV__EBUSY (-EBUSY)
+#else
+# define UV__EBUSY (-4082)
+#endif
+
+#if defined(ECANCELED) && !defined(_WIN32)
+# define UV__ECANCELED (-ECANCELED)
+#else
+# define UV__ECANCELED (-4081)
+#endif
+
+#if defined(ECHARSET) && !defined(_WIN32)
+# define UV__ECHARSET (-ECHARSET)
+#else
+# define UV__ECHARSET (-4080)
+#endif
+
+#if defined(ECONNABORTED) && !defined(_WIN32)
+# define UV__ECONNABORTED (-ECONNABORTED)
+#else
+# define UV__ECONNABORTED (-4079)
+#endif
+
+#if defined(ECONNREFUSED) && !defined(_WIN32)
+# define UV__ECONNREFUSED (-ECONNREFUSED)
+#else
+# define UV__ECONNREFUSED (-4078)
+#endif
+
+#if defined(ECONNRESET) && !defined(_WIN32)
+# define UV__ECONNRESET (-ECONNRESET)
+#else
+# define UV__ECONNRESET (-4077)
+#endif
+
+#if defined(EDESTADDRREQ) && !defined(_WIN32)
+# define UV__EDESTADDRREQ (-EDESTADDRREQ)
+#else
+# define UV__EDESTADDRREQ (-4076)
+#endif
+
+#if defined(EEXIST) && !defined(_WIN32)
+# define UV__EEXIST (-EEXIST)
+#else
+# define UV__EEXIST (-4075)
+#endif
+
+#if defined(EFAULT) && !defined(_WIN32)
+# define UV__EFAULT (-EFAULT)
+#else
+# define UV__EFAULT (-4074)
+#endif
+
+#if defined(EHOSTUNREACH) && !defined(_WIN32)
+# define UV__EHOSTUNREACH (-EHOSTUNREACH)
+#else
+# define UV__EHOSTUNREACH (-4073)
+#endif
+
+#if defined(EINTR) && !defined(_WIN32)
+# define UV__EINTR (-EINTR)
+#else
+# define UV__EINTR (-4072)
+#endif
+
+#if defined(EINVAL) && !defined(_WIN32)
+# define UV__EINVAL (-EINVAL)
+#else
+# define UV__EINVAL (-4071)
+#endif
+
+#if defined(EIO) && !defined(_WIN32)
+# define UV__EIO (-EIO)
+#else
+# define UV__EIO (-4070)
+#endif
+
+#if defined(EISCONN) && !defined(_WIN32)
+# define UV__EISCONN (-EISCONN)
+#else
+# define UV__EISCONN (-4069)
+#endif
+
+#if defined(EISDIR) && !defined(_WIN32)
+# define UV__EISDIR (-EISDIR)
+#else
+# define UV__EISDIR (-4068)
+#endif
+
+#if defined(ELOOP) && !defined(_WIN32)
+# define UV__ELOOP (-ELOOP)
+#else
+# define UV__ELOOP (-4067)
+#endif
+
+#if defined(EMFILE) && !defined(_WIN32)
+# define UV__EMFILE (-EMFILE)
+#else
+# define UV__EMFILE (-4066)
+#endif
+
+#if defined(EMSGSIZE) && !defined(_WIN32)
+# define UV__EMSGSIZE (-EMSGSIZE)
+#else
+# define UV__EMSGSIZE (-4065)
+#endif
+
+#if defined(ENAMETOOLONG) && !defined(_WIN32)
+# define UV__ENAMETOOLONG (-ENAMETOOLONG)
+#else
+# define UV__ENAMETOOLONG (-4064)
+#endif
+
+#if defined(ENETDOWN) && !defined(_WIN32)
+# define UV__ENETDOWN (-ENETDOWN)
+#else
+# define UV__ENETDOWN (-4063)
+#endif
+
+#if defined(ENETUNREACH) && !defined(_WIN32)
+# define UV__ENETUNREACH (-ENETUNREACH)
+#else
+# define UV__ENETUNREACH (-4062)
+#endif
+
+#if defined(ENFILE) && !defined(_WIN32)
+# define UV__ENFILE (-ENFILE)
+#else
+# define UV__ENFILE (-4061)
+#endif
+
+#if defined(ENOBUFS) && !defined(_WIN32)
+# define UV__ENOBUFS (-ENOBUFS)
+#else
+# define UV__ENOBUFS (-4060)
+#endif
+
+#if defined(ENODEV) && !defined(_WIN32)
+# define UV__ENODEV (-ENODEV)
+#else
+# define UV__ENODEV (-4059)
+#endif
+
+#if defined(ENOENT) && !defined(_WIN32)
+# define UV__ENOENT (-ENOENT)
+#else
+# define UV__ENOENT (-4058)
+#endif
+
+#if defined(ENOMEM) && !defined(_WIN32)
+# define UV__ENOMEM (-ENOMEM)
+#else
+# define UV__ENOMEM (-4057)
+#endif
+
+#if defined(ENONET) && !defined(_WIN32)
+# define UV__ENONET (-ENONET)
+#else
+# define UV__ENONET (-4056)
+#endif
+
+#if defined(ENOSPC) && !defined(_WIN32)
+# define UV__ENOSPC (-ENOSPC)
+#else
+# define UV__ENOSPC (-4055)
+#endif
+
+#if defined(ENOSYS) && !defined(_WIN32)
+# define UV__ENOSYS (-ENOSYS)
+#else
+# define UV__ENOSYS (-4054)
+#endif
+
+#if defined(ENOTCONN) && !defined(_WIN32)
+# define UV__ENOTCONN (-ENOTCONN)
+#else
+# define UV__ENOTCONN (-4053)
+#endif
+
+#if defined(ENOTDIR) && !defined(_WIN32)
+# define UV__ENOTDIR (-ENOTDIR)
+#else
+# define UV__ENOTDIR (-4052)
+#endif
+
+#if defined(ENOTEMPTY) && !defined(_WIN32)
+# define UV__ENOTEMPTY (-ENOTEMPTY)
+#else
+# define UV__ENOTEMPTY (-4051)
+#endif
+
+#if defined(ENOTSOCK) && !defined(_WIN32)
+# define UV__ENOTSOCK (-ENOTSOCK)
+#else
+# define UV__ENOTSOCK (-4050)
+#endif
+
+#if defined(ENOTSUP) && !defined(_WIN32)
+# define UV__ENOTSUP (-ENOTSUP)
+#else
+# define UV__ENOTSUP (-4049)
+#endif
+
+#if defined(EPERM) && !defined(_WIN32)
+# define UV__EPERM (-EPERM)
+#else
+# define UV__EPERM (-4048)
+#endif
+
+#if defined(EPIPE) && !defined(_WIN32)
+# define UV__EPIPE (-EPIPE)
+#else
+# define UV__EPIPE (-4047)
+#endif
+
+#if defined(EPROTO) && !defined(_WIN32)
+# define UV__EPROTO (-EPROTO)
+#else
+# define UV__EPROTO (-4046)
+#endif
+
+#if defined(EPROTONOSUPPORT) && !defined(_WIN32)
+# define UV__EPROTONOSUPPORT (-EPROTONOSUPPORT)
+#else
+# define UV__EPROTONOSUPPORT (-4045)
+#endif
+
+#if defined(EPROTOTYPE) && !defined(_WIN32)
+# define UV__EPROTOTYPE (-EPROTOTYPE)
+#else
+# define UV__EPROTOTYPE (-4044)
+#endif
+
+#if defined(EROFS) && !defined(_WIN32)
+# define UV__EROFS (-EROFS)
+#else
+# define UV__EROFS (-4043)
+#endif
+
+#if defined(ESHUTDOWN) && !defined(_WIN32)
+# define UV__ESHUTDOWN (-ESHUTDOWN)
+#else
+# define UV__ESHUTDOWN (-4042)
+#endif
+
+#if defined(ESPIPE) && !defined(_WIN32)
+# define UV__ESPIPE (-ESPIPE)
+#else
+# define UV__ESPIPE (-4041)
+#endif
+
+#if defined(ESRCH) && !defined(_WIN32)
+# define UV__ESRCH (-ESRCH)
+#else
+# define UV__ESRCH (-4040)
+#endif
+
+#if defined(ETIMEDOUT) && !defined(_WIN32)
+# define UV__ETIMEDOUT (-ETIMEDOUT)
+#else
+# define UV__ETIMEDOUT (-4039)
+#endif
+
+#if defined(ETXTBSY) && !defined(_WIN32)
+# define UV__ETXTBSY (-ETXTBSY)
+#else
+# define UV__ETXTBSY (-4038)
+#endif
+
+#if defined(EXDEV) && !defined(_WIN32)
+# define UV__EXDEV (-EXDEV)
+#else
+# define UV__EXDEV (-4037)
+#endif
+
+#if defined(EFBIG) && !defined(_WIN32)
+# define UV__EFBIG (-EFBIG)
+#else
+# define UV__EFBIG (-4036)
+#endif
+
+#if defined(ENOPROTOOPT) && !defined(_WIN32)
+# define UV__ENOPROTOOPT (-ENOPROTOOPT)
+#else
+# define UV__ENOPROTOOPT (-4035)
+#endif
+
+#if defined(ERANGE) && !defined(_WIN32)
+# define UV__ERANGE (-ERANGE)
+#else
+# define UV__ERANGE (-4034)
+#endif
+
+#if defined(ENXIO) && !defined(_WIN32)
+# define UV__ENXIO (-ENXIO)
+#else
+# define UV__ENXIO (-4033)
+#endif
+
+#if defined(EMLINK) && !defined(_WIN32)
+# define UV__EMLINK (-EMLINK)
+#else
+# define UV__EMLINK (-4032)
+#endif
+
+/* EHOSTDOWN is not visible on BSD-like systems when _POSIX_C_SOURCE is
+ * defined. Fortunately, its value is always 64 so it's possible albeit
+ * icky to hard-code it.
+ */
+#if defined(EHOSTDOWN) && !defined(_WIN32)
+# define UV__EHOSTDOWN (-EHOSTDOWN)
+#elif defined(__APPLE__) || \
+      defined(__DragonFly__) || \
+      defined(__FreeBSD__) || \
+      defined(__FreeBSD_kernel__) || \
+      defined(__NetBSD__) || \
+      defined(__OpenBSD__)
+# define UV__EHOSTDOWN (-64)
+#else
+# define UV__EHOSTDOWN (-4031)
+#endif
+
+#endif /* UV_ERRNO_H_ */
diff --git a/deps/libtuv/include/uv-linux.h b/deps/libtuv/include/uv-linux.h
new file mode 100644 (file)
index 0000000..9b38405
--- /dev/null
@@ -0,0 +1,34 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_LINUX_H
+#define UV_LINUX_H
+
+#define UV_PLATFORM_LOOP_FIELDS                                               \
+  uv__io_t inotify_read_watcher;                                              \
+  void* inotify_watchers;                                                     \
+  int inotify_fd;                                                             \
+
+#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
+  void* watchers[2];                                                          \
+  int wd;                                                                     \
+
+#endif /* UV_LINUX_H */
diff --git a/deps/libtuv/include/uv-nuttx.h b/deps/libtuv/include/uv-nuttx.h
new file mode 100644 (file)
index 0000000..d97a893
--- /dev/null
@@ -0,0 +1,111 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_NUTTX_H
+#define UV_NUTTX_H
+
+#include <pthread.h>
+#include <poll.h>     // nuttx poll
+#include <unistd.h>
+#include <errno.h>
+
+#include <netdb.h>
+#include <sys/uio.h>
+
+#ifndef TUV_POLL_EVENTS_SIZE
+#define TUV_POLL_EVENTS_SIZE  32
+#endif
+
+// TUV_CHANGES@20161130: FIXME: What is the reasonable nubmer?
+#ifndef IOV_MAX
+#define IOV_MAX TUV_POLL_EVENTS_SIZE
+#endif
+
+//---------------------------------------------------------------------------
+// TUV_CHANGES@20161130: NuttX does not provide ENOTSUP.
+// TUV_CHANGES@20170407: NuttX started to provide ENOTSUP.
+#ifndef ENOTSUP
+#define ENOTSUP       EOPNOTSUPP
+#endif
+
+// TUV_CHANGES@20171130:
+// Not defined macros. Copied from x86-64 linux system header
+#define STDIN_FILENO  0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+
+#define SIGPROF       27
+#define TCP_NODELAY   1
+
+//-----------------------------------------------------------------------------
+// TUV_CHANGES@20171130:
+// Not used. I believe we can remove those.
+#define _SC_CLK_TCK           0x0006
+#define _SC_NPROCESSORS_ONLN  0x0061
+#define CLOCK_MONOTONIC       1
+
+//-----------------------------------------------------------------------------
+// date time extension
+// uint64_t uv__time_precise();
+
+
+//-----------------------------------------------------------------------------
+// thread and mutex
+#define UV_PLATFORM_RWLOCK_T pthread_mutex_t
+
+//-----------------------------------------------------------------------------
+// uio
+ssize_t readv(int __fd, const struct iovec* __iovec, int __count);
+ssize_t writev(int __fd, const struct iovec* __iovec, int __count);
+
+
+//-----------------------------------------------------------------------------
+// etc
+int getpeername(int sockfd, struct sockaddr* addr, socklen_t* addrlen);
+
+// Maximum queue length specifiable by listen
+#define SOMAXCONN 8
+
+//-----------------------------------------------------------------------------
+// structure extension for nuttx                                                          
+//                                                                                        
+#define UV_PLATFORM_LOOP_FIELDS                                               \
+  struct pollfd pollfds[TUV_POLL_EVENTS_SIZE];                                \
+  int npollfds;                                                               \
+
+
+
+#endif // UV_NUTTX_H
diff --git a/deps/libtuv/include/uv-os390.h b/deps/libtuv/include/uv-os390.h
new file mode 100644 (file)
index 0000000..b0b068f
--- /dev/null
@@ -0,0 +1,27 @@
+/* Copyright libuv project contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_MVS_H
+#define UV_MVS_H
+
+#define UV_PLATFORM_SEM_T int
+
+#endif /* UV_MVS_H */
diff --git a/deps/libtuv/include/uv-sunos.h b/deps/libtuv/include/uv-sunos.h
new file mode 100644 (file)
index 0000000..0421664
--- /dev/null
@@ -0,0 +1,44 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_SUNOS_H
+#define UV_SUNOS_H
+
+#include <sys/port.h>
+#include <port.h>
+
+/* For the sake of convenience and reduced #ifdef-ery in src/unix/sunos.c,
+ * add the fs_event fields even when this version of SunOS doesn't support
+ * file watching.
+ */
+#define UV_PLATFORM_LOOP_FIELDS                                               \
+  uv__io_t fs_event_watcher;                                                  \
+  int fs_fd;                                                                  \
+
+#if defined(PORT_SOURCE_FILE)
+
+# define UV_PLATFORM_FS_EVENT_FIELDS                                          \
+  file_obj_t fo;                                                              \
+  int fd;                                                                     \
+
+#endif /* defined(PORT_SOURCE_FILE) */
+
+#endif /* UV_SUNOS_H */
diff --git a/deps/libtuv/include/uv-threadpool.h b/deps/libtuv/include/uv-threadpool.h
new file mode 100644 (file)
index 0000000..9708ebd
--- /dev/null
@@ -0,0 +1,37 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/*
+ * This file is private to libuv. It provides common functionality to both
+ * Windows and Unix backends.
+ */
+
+#ifndef UV_THREADPOOL_H_
+#define UV_THREADPOOL_H_
+
+struct uv__work {
+  void (*work)(struct uv__work *w);
+  void (*done)(struct uv__work *w, int status);
+  struct uv_loop_s* loop;
+  void* wq[2];
+};
+
+#endif /* UV_THREADPOOL_H_ */
diff --git a/deps/libtuv/include/uv-tizenrt.h b/deps/libtuv/include/uv-tizenrt.h
new file mode 100644 (file)
index 0000000..ccd2ad7
--- /dev/null
@@ -0,0 +1,112 @@
+/* Copyright 2017-present 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_TIZENRT_H
+#define UV_TIZENRT_H
+
+#include <pthread.h>
+#include <poll.h>     // tizenrt poll
+#include <unistd.h>
+#include <errno.h>
+
+#include <netdb.h>
+
+/* FIXME: This is workaround for strange TizenRT headers... */
+struct iovec
+{
+  void *iov_base;
+  size_t    iov_len;
+};
+
+#ifndef TUV_POLL_EVENTS_SIZE
+#define TUV_POLL_EVENTS_SIZE  32
+#endif
+
+// TUV_CHANGES@20161130: FIXME: What is the reasonable nubmer?
+#ifndef IOV_MAX
+#define IOV_MAX TUV_POLL_EVENTS_SIZE
+#endif
+
+//---------------------------------------------------------------------------
+// TUV_CHANGES@20161130: NuttX doesn't provide ENOTSUP.
+#define ENOTSUP       EOPNOTSUPP
+
+// TUV_CHANGES@20171130:
+// Not defined macros. Copied from x86-64 linux system header
+#define STDIN_FILENO  0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+
+#define SIGPROF       27
+
+//-----------------------------------------------------------------------------
+// TUV_CHANGES@20171130: Not used. I believe we can remove those.
+#define _SC_CLK_TCK           0x0006
+#define _SC_NPROCESSORS_ONLN  0x0061
+#define CLOCK_MONOTONIC       1
+
+//-----------------------------------------------------------------------------
+// date time extension
+// uint64_t uv__time_precise();
+
+
+//-----------------------------------------------------------------------------
+// thread and mutex
+#define UV_PLATFORM_RWLOCK_T pthread_mutex_t
+
+//-----------------------------------------------------------------------------
+// uio
+ssize_t readv(int __fd, const struct iovec* __iovec, int __count);
+ssize_t writev(int __fd, const struct iovec* __iovec, int __count);
+
+
+//-----------------------------------------------------------------------------
+// etc
+int getpeername(int sockfd, struct sockaddr* addr, socklen_t* addrlen);
+
+// Maximum queue length specifiable by listen
+#define SOMAXCONN 8
+
+//-----------------------------------------------------------------------------
+// structure extension for nuttx                                                          
+//                                                                                        
+#define UV_PLATFORM_LOOP_FIELDS                                               \
+  struct pollfd pollfds[TUV_POLL_EVENTS_SIZE];                                \
+  int npollfds;                                                               \
+
+
+
+#endif // UV_NUTTX_H
diff --git a/deps/libtuv/include/uv-unix.h b/deps/libtuv/include/uv-unix.h
new file mode 100644 (file)
index 0000000..faa5590
--- /dev/null
@@ -0,0 +1,445 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_UNIX_H
+#define UV_UNIX_H
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <dirent.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#if !defined(__NUTTX__) && \
+    !defined(__TIZENRT__) /* No netinet/tcp.h */
+#include <netinet/tcp.h>
+#endif
+#include <arpa/inet.h>
+#include <netdb.h>
+
+#include <termios.h>
+#include <pwd.h>
+
+#include <semaphore.h>
+#include <pthread.h>
+#include <signal.h>
+
+#include "uv-threadpool.h"
+
+#if defined(__linux__)
+# include "uv-linux.h"
+#elif defined(_AIX)
+# include "uv-aix.h"
+#elif defined(__sun)
+# include "uv-sunos.h"
+#elif defined(__APPLE__)
+# include "uv-darwin.h"
+#elif defined(__DragonFly__)       || \
+      defined(__FreeBSD__)         || \
+      defined(__FreeBSD_kernel__)  || \
+      defined(__OpenBSD__)         || \
+      defined(__NetBSD__)
+# include "uv-bsd.h"
+#elif defined(__NUTTX__)
+# include "uv-nuttx.h"
+#elif defined(__TIZENRT__)
+# include "uv-tizenrt.h"
+#endif
+
+#ifndef PTHREAD_BARRIER_SERIAL_THREAD
+# include "pthread-barrier.h"
+#endif
+
+#ifndef NI_MAXHOST
+# define NI_MAXHOST 1025
+#endif
+
+#ifndef NI_MAXSERV
+# define NI_MAXSERV 32
+#endif
+
+#ifndef UV_IO_PRIVATE_PLATFORM_FIELDS
+# define UV_IO_PRIVATE_PLATFORM_FIELDS /* empty */
+#endif
+
+/*
+ * Enables memory optimizations for low memory systems.
+ * This might hurt the performance of the library.
+ */
+#define TUV_ENABLE_MEMORY_CONSTRAINTS /* empty */
+
+struct uv__io_s;
+struct uv__async;
+struct uv_loop_s;
+
+typedef void (*uv__io_cb)(struct uv_loop_s* loop,
+                          struct uv__io_s* w,
+                          unsigned int events);
+typedef struct uv__io_s uv__io_t;
+
+struct uv__io_s {
+  uv__io_cb cb;
+  void* pending_queue[2];
+  void* watcher_queue[2];
+  unsigned int pevents; /* Pending event mask i.e. mask at next tick. */
+  unsigned int events;  /* Current event mask. */
+  int fd;
+  UV_IO_PRIVATE_PLATFORM_FIELDS
+};
+
+typedef void (*uv__async_cb)(struct uv_loop_s* loop,
+                             struct uv__async* w,
+                             unsigned int nevents);
+
+struct uv__async {
+  uv__async_cb cb;
+  uv__io_t io_watcher;
+  int wfd;
+};
+
+#ifndef UV_PLATFORM_SEM_T
+# define UV_PLATFORM_SEM_T sem_t
+#endif
+
+/* TUV_CHANGES@20161128: for NuttX */
+#ifndef UV_PLATFORM_RWLOCK_T
+# define UV_PLATFORM_RWLOCK_T pthread_rwlock_t
+#endif
+
+#ifndef UV_PLATFORM_LOOP_FIELDS
+# define UV_PLATFORM_LOOP_FIELDS /* empty */
+#endif
+
+#ifndef UV_PLATFORM_FS_EVENT_FIELDS
+# define UV_PLATFORM_FS_EVENT_FIELDS /* empty */
+#endif
+
+#ifndef UV_STREAM_PRIVATE_PLATFORM_FIELDS
+# define UV_STREAM_PRIVATE_PLATFORM_FIELDS /* empty */
+#endif
+
+/* Note: May be cast to struct iovec. See writev(2). */
+typedef struct uv_buf_t {
+  char* base;
+  size_t len;
+} uv_buf_t;
+
+typedef int uv_file;
+typedef int uv_os_sock_t;
+typedef int uv_os_fd_t;
+
+#define UV_ONCE_INIT PTHREAD_ONCE_INIT
+
+typedef pthread_once_t uv_once_t;
+typedef pthread_t uv_thread_t;
+typedef pthread_mutex_t uv_mutex_t;
+typedef UV_PLATFORM_RWLOCK_T uv_rwlock_t;
+typedef UV_PLATFORM_SEM_T uv_sem_t;
+typedef pthread_cond_t uv_cond_t;
+typedef pthread_key_t uv_key_t;
+typedef pthread_barrier_t uv_barrier_t;
+
+
+/* Platform-specific definitions for uv_spawn support. */
+typedef gid_t uv_gid_t;
+typedef uid_t uv_uid_t;
+
+typedef struct dirent uv__dirent_t;
+
+#if defined(DT_UNKNOWN)
+# define HAVE_DIRENT_TYPES
+# if defined(DT_REG)
+#  define UV__DT_FILE DT_REG
+# else
+#  define UV__DT_FILE -1
+# endif
+# if defined(DT_DIR)
+#  define UV__DT_DIR DT_DIR
+# else
+#  define UV__DT_DIR -2
+# endif
+# if defined(DT_LNK)
+#  define UV__DT_LINK DT_LNK
+# else
+#  define UV__DT_LINK -3
+# endif
+# if defined(DT_FIFO)
+#  define UV__DT_FIFO DT_FIFO
+# else
+#  define UV__DT_FIFO -4
+# endif
+# if defined(DT_SOCK)
+#  define UV__DT_SOCKET DT_SOCK
+# else
+#  define UV__DT_SOCKET -5
+# endif
+# if defined(DT_CHR)
+#  define UV__DT_CHAR DT_CHR
+# else
+#  define UV__DT_CHAR -6
+# endif
+# if defined(DT_BLK)
+#  define UV__DT_BLOCK DT_BLK
+# else
+#  define UV__DT_BLOCK -7
+# endif
+#endif
+
+/* Platform-specific definitions for uv_dlopen support. */
+#define UV_DYNAMIC /* empty */
+
+typedef struct {
+  void* handle;
+  char* errmsg;
+} uv_lib_t;
+
+#ifdef TUV_ENABLE_MEMORY_CONSTRAINTS
+# define UV_LOOP_PRIVATE_FIELDS                                               \
+  unsigned long flags;                                                        \
+  int backend_fd;                                                             \
+  void* pending_queue[2];                                                     \
+  void* watcher_queue[2];                                                     \
+  uv__io_t** watchers;                                                        \
+  unsigned int nwatchers;                                                     \
+  unsigned int nfds;                                                          \
+  void* wq[2];                                                                \
+  uv_mutex_t wq_mutex;                                                        \
+  uv_async_t wq_async;                                                        \
+  uv_rwlock_t cloexec_lock;                                                   \
+  uv_handle_t* closing_handles;                                               \
+  void* process_handles[2];                                                   \
+  void* prepare_handles[2];                                                   \
+  void* check_handles[2];                                                     \
+  void* idle_handles[2];                                                      \
+  void* async_handles[2];                                                     \
+  struct uv__async async_watcher;                                             \
+  struct {                                                                    \
+    void* min;                                                                \
+    unsigned int nelts;                                                       \
+  } timer_heap;                                                               \
+  uint32_t timer_counter;                                                     \
+  uint64_t time;                                                              \
+  int signal_pipefd[2];                                                       \
+  uv__io_t signal_io_watcher;                                                 \
+  uv_signal_t child_watcher;                                                  \
+  int emfile_fd;                                                              \
+  UV_PLATFORM_LOOP_FIELDS
+#else /* original libuv code */
+# define UV_LOOP_PRIVATE_FIELDS                                               \
+  unsigned long flags;                                                        \
+  int backend_fd;                                                             \
+  void* pending_queue[2];                                                     \
+  void* watcher_queue[2];                                                     \
+  uv__io_t** watchers;                                                        \
+  unsigned int nwatchers;                                                     \
+  unsigned int nfds;                                                          \
+  void* wq[2];                                                                \
+  uv_mutex_t wq_mutex;                                                        \
+  uv_async_t wq_async;                                                        \
+  uv_rwlock_t cloexec_lock;                                                   \
+  uv_handle_t* closing_handles;                                               \
+  void* process_handles[2];                                                   \
+  void* prepare_handles[2];                                                   \
+  void* check_handles[2];                                                     \
+  void* idle_handles[2];                                                      \
+  void* async_handles[2];                                                     \
+  struct uv__async async_watcher;                                             \
+  struct {                                                                    \
+    void* min;                                                                \
+    unsigned int nelts;                                                       \
+  } timer_heap;                                                               \
+  uint64_t timer_counter;                                                     \
+  uint64_t time;                                                              \
+  int signal_pipefd[2];                                                       \
+  uv__io_t signal_io_watcher;                                                 \
+  uv_signal_t child_watcher;                                                  \
+  int emfile_fd;                                                              \
+  UV_PLATFORM_LOOP_FIELDS
+#endif
+
+#define UV_REQ_TYPE_PRIVATE /* empty */
+
+#define UV_REQ_PRIVATE_FIELDS  /* empty */
+
+#define UV_PRIVATE_REQ_TYPES /* empty */
+
+#define UV_WRITE_PRIVATE_FIELDS                                               \
+  void* queue[2];                                                             \
+  unsigned int write_index;                                                   \
+  uv_buf_t* bufs;                                                             \
+  unsigned int nbufs;                                                         \
+  int error;                                                                  \
+  uv_buf_t bufsml[4];                                                         \
+
+#define UV_CONNECT_PRIVATE_FIELDS                                             \
+  void* queue[2];                                                             \
+
+#define UV_SHUTDOWN_PRIVATE_FIELDS /* empty */
+
+#define UV_UDP_SEND_PRIVATE_FIELDS                                            \
+  void* queue[2];                                                             \
+  struct sockaddr_storage addr;                                               \
+  unsigned int nbufs;                                                         \
+  uv_buf_t* bufs;                                                             \
+  ssize_t status;                                                             \
+  uv_udp_send_cb send_cb;                                                     \
+  uv_buf_t bufsml[4];                                                         \
+
+#define UV_HANDLE_PRIVATE_FIELDS                                              \
+  uv_handle_t* next_closing;                                                  \
+  unsigned int flags;                                                         \
+
+#define UV_STREAM_PRIVATE_FIELDS                                              \
+  uv_connect_t *connect_req;                                                  \
+  uv_shutdown_t *shutdown_req;                                                \
+  uv__io_t io_watcher;                                                        \
+  void* write_queue[2];                                                       \
+  void* write_completed_queue[2];                                             \
+  uv_connection_cb connection_cb;                                             \
+  int delayed_error;                                                          \
+  int accepted_fd;                                                            \
+  void* queued_fds;                                                           \
+  UV_STREAM_PRIVATE_PLATFORM_FIELDS                                           \
+
+#define UV_TCP_PRIVATE_FIELDS /* empty */
+
+#define UV_UDP_PRIVATE_FIELDS                                                 \
+  uv_alloc_cb alloc_cb;                                                       \
+  uv_udp_recv_cb recv_cb;                                                     \
+  uv__io_t io_watcher;                                                        \
+  void* write_queue[2];                                                       \
+  void* write_completed_queue[2];                                             \
+
+#define UV_PIPE_PRIVATE_FIELDS                                                \
+  const char* pipe_fname; /* strdup'ed */
+
+#define UV_POLL_PRIVATE_FIELDS                                                \
+  uv__io_t io_watcher;
+
+#define UV_PREPARE_PRIVATE_FIELDS                                             \
+  uv_prepare_cb prepare_cb;                                                   \
+  void* queue[2];                                                             \
+
+#define UV_CHECK_PRIVATE_FIELDS                                               \
+  uv_check_cb check_cb;                                                       \
+  void* queue[2];                                                             \
+
+#define UV_IDLE_PRIVATE_FIELDS                                                \
+  uv_idle_cb idle_cb;                                                         \
+  void* queue[2];                                                             \
+
+#define UV_ASYNC_PRIVATE_FIELDS                                               \
+  uv_async_cb async_cb;                                                       \
+  void* queue[2];                                                             \
+  int pending;                                                                \
+
+#ifdef TUV_ENABLE_MEMORY_CONSTRAINTS
+# define UV_TIMER_PRIVATE_FIELDS                                              \
+  uv_timer_cb timer_cb;                                                       \
+  void* heap_node[1];                                                         \
+  uint64_t timeout;                                                           \
+  uint64_t repeat;
+#else /* original libuv code */
+# define UV_TIMER_PRIVATE_FIELDS                                              \
+  uv_timer_cb timer_cb;                                                       \
+  void* heap_node[3];                                                         \
+  uint64_t timeout;                                                           \
+  uint64_t repeat;                                                            \
+  uint64_t start_id;
+#endif
+
+#define UV_GETADDRINFO_PRIVATE_FIELDS                                         \
+  struct uv__work work_req;                                                   \
+  uv_getaddrinfo_cb cb;                                                       \
+  struct addrinfo* hints;                                                     \
+  char* hostname;                                                             \
+  char* service;                                                              \
+  struct addrinfo* addrinfo;                                                  \
+  int retcode;
+
+#define UV_GETNAMEINFO_PRIVATE_FIELDS                                         \
+  struct uv__work work_req;                                                   \
+  uv_getnameinfo_cb getnameinfo_cb;                                           \
+  struct sockaddr_storage storage;                                            \
+  int flags;                                                                  \
+  char host[NI_MAXHOST];                                                      \
+  char service[NI_MAXSERV];                                                   \
+  int retcode;
+
+#define UV_PROCESS_PRIVATE_FIELDS                                             \
+  void* queue[2];                                                             \
+  int status;                                                                 \
+
+#define UV_FS_PRIVATE_FIELDS                                                  \
+  const char *new_path;                                                       \
+  uv_file file;                                                               \
+  int flags;                                                                  \
+  mode_t mode;                                                                \
+  unsigned int nbufs;                                                         \
+  uv_buf_t* bufs;                                                             \
+  off_t off;                                                                  \
+  uv_uid_t uid;                                                               \
+  uv_gid_t gid;                                                               \
+  double atime;                                                               \
+  double mtime;                                                               \
+  struct uv__work work_req;                                                   \
+  uv_buf_t bufsml[4];                                                         \
+
+#define UV_WORK_PRIVATE_FIELDS                                                \
+  struct uv__work work_req;
+
+#define UV_TTY_PRIVATE_FIELDS                                                 \
+  struct termios orig_termios;                                                \
+  int mode;
+
+#define UV_SIGNAL_PRIVATE_FIELDS                                              \
+  /* RB_ENTRY(uv_signal_s) tree_entry; */                                     \
+  struct {                                                                    \
+    struct uv_signal_s* rbe_left;                                             \
+    struct uv_signal_s* rbe_right;                                            \
+    struct uv_signal_s* rbe_parent;                                           \
+    int rbe_color;                                                            \
+  } tree_entry;                                                               \
+  /* Use two counters here so we don have to fiddle with atomics. */          \
+  unsigned int caught_signals;                                                \
+  unsigned int dispatched_signals;
+
+#define UV_FS_EVENT_PRIVATE_FIELDS                                            \
+  uv_fs_event_cb cb;                                                          \
+  UV_PLATFORM_FS_EVENT_FIELDS                                                 \
+
+#endif /* UV_UNIX_H */
diff --git a/deps/libtuv/include/uv-version.h b/deps/libtuv/include/uv-version.h
new file mode 100644 (file)
index 0000000..63454a5
--- /dev/null
@@ -0,0 +1,43 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_VERSION_H
+#define UV_VERSION_H
+
+ /*
+ * Versions with the same major number are ABI stable. API is allowed to
+ * evolve between minor releases, but only in a backwards compatible way.
+ * Make sure you update the -soname directives in configure.ac
+ * and uv.gyp whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but
+ * not UV_VERSION_PATCH.)
+ */
+
+#define UV_VERSION_MAJOR 1
+#define UV_VERSION_MINOR 10
+#define UV_VERSION_PATCH 1
+#define UV_VERSION_IS_RELEASE 1
+#define UV_VERSION_SUFFIX ""
+
+#define UV_VERSION_HEX  ((UV_VERSION_MAJOR << 16) | \
+                         (UV_VERSION_MINOR <<  8) | \
+                         (UV_VERSION_PATCH))
+
+#endif /* UV_VERSION_H */
diff --git a/deps/libtuv/include/uv-win.h b/deps/libtuv/include/uv-win.h
new file mode 100644 (file)
index 0000000..e8b9b15
--- /dev/null
@@ -0,0 +1,649 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef _WIN32_WINNT
+# define _WIN32_WINNT   0x0502
+#endif
+
+#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
+typedef intptr_t ssize_t;
+# define _SSIZE_T_
+# define _SSIZE_T_DEFINED
+#endif
+
+#include <winsock2.h>
+
+#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
+typedef struct pollfd {
+  SOCKET fd;
+  short  events;
+  short  revents;
+} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
+#endif
+
+#ifndef LOCALE_INVARIANT
+# define LOCALE_INVARIANT 0x007f
+#endif
+
+#include <mswsock.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+
+#include <process.h>
+#include <signal.h>
+#include <sys/stat.h>
+
+#if defined(_MSC_VER) && _MSC_VER < 1600
+# include "stdint-msvc2008.h"
+#else
+# include <stdint.h>
+#endif
+
+#include "tree.h"
+#include "uv-threadpool.h"
+
+#define MAX_PIPENAME_LEN 256
+
+#ifndef S_IFLNK
+# define S_IFLNK 0xA000
+#endif
+
+/* Additional signals supported by uv_signal and or uv_kill. The CRT defines
+ * the following signals already:
+ *
+ *   #define SIGINT           2
+ *   #define SIGILL           4
+ *   #define SIGABRT_COMPAT   6
+ *   #define SIGFPE           8
+ *   #define SIGSEGV         11
+ *   #define SIGTERM         15
+ *   #define SIGBREAK        21
+ *   #define SIGABRT         22
+ *
+ * The additional signals have values that are common on other Unix
+ * variants (Linux and Darwin)
+ */
+#define SIGHUP                1
+#define SIGKILL               9
+#define SIGWINCH             28
+
+/* The CRT defines SIGABRT_COMPAT as 6, which equals SIGABRT on many */
+/* unix-like platforms. However MinGW doesn't define it, so we do. */
+#ifndef SIGABRT_COMPAT
+# define SIGABRT_COMPAT       6
+#endif
+
+/*
+ * Guids and typedefs for winsock extension functions
+ * Mingw32 doesn't have these :-(
+ */
+#ifndef WSAID_ACCEPTEX
+# define WSAID_ACCEPTEX                                                       \
+         {0xb5367df1, 0xcbac, 0x11cf,                                         \
+         {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
+
+# define WSAID_CONNECTEX                                                      \
+         {0x25a207b9, 0xddf3, 0x4660,                                         \
+         {0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}}
+
+# define WSAID_GETACCEPTEXSOCKADDRS                                           \
+         {0xb5367df2, 0xcbac, 0x11cf,                                         \
+         {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
+
+# define WSAID_DISCONNECTEX                                                   \
+         {0x7fda2e11, 0x8630, 0x436f,                                         \
+         {0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}}
+
+# define WSAID_TRANSMITFILE                                                   \
+         {0xb5367df0, 0xcbac, 0x11cf,                                         \
+         {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
+
+  typedef BOOL (PASCAL *LPFN_ACCEPTEX)
+                      (SOCKET sListenSocket,
+                       SOCKET sAcceptSocket,
+                       PVOID lpOutputBuffer,
+                       DWORD dwReceiveDataLength,
+                       DWORD dwLocalAddressLength,
+                       DWORD dwRemoteAddressLength,
+                       LPDWORD lpdwBytesReceived,
+                       LPOVERLAPPED lpOverlapped);
+
+  typedef BOOL (PASCAL *LPFN_CONNECTEX)
+                      (SOCKET s,
+                       const struct sockaddr* name,
+                       int namelen,
+                       PVOID lpSendBuffer,
+                       DWORD dwSendDataLength,
+                       LPDWORD lpdwBytesSent,
+                       LPOVERLAPPED lpOverlapped);
+
+  typedef void (PASCAL *LPFN_GETACCEPTEXSOCKADDRS)
+                      (PVOID lpOutputBuffer,
+                       DWORD dwReceiveDataLength,
+                       DWORD dwLocalAddressLength,
+                       DWORD dwRemoteAddressLength,
+                       LPSOCKADDR* LocalSockaddr,
+                       LPINT LocalSockaddrLength,
+                       LPSOCKADDR* RemoteSockaddr,
+                       LPINT RemoteSockaddrLength);
+
+  typedef BOOL (PASCAL *LPFN_DISCONNECTEX)
+                      (SOCKET hSocket,
+                       LPOVERLAPPED lpOverlapped,
+                       DWORD dwFlags,
+                       DWORD reserved);
+
+  typedef BOOL (PASCAL *LPFN_TRANSMITFILE)
+                      (SOCKET hSocket,
+                       HANDLE hFile,
+                       DWORD nNumberOfBytesToWrite,
+                       DWORD nNumberOfBytesPerSend,
+                       LPOVERLAPPED lpOverlapped,
+                       LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
+                       DWORD dwFlags);
+
+  typedef PVOID RTL_SRWLOCK;
+  typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK;
+#endif
+
+typedef int (WSAAPI* LPFN_WSARECV)
+            (SOCKET socket,
+             LPWSABUF buffers,
+             DWORD buffer_count,
+             LPDWORD bytes,
+             LPDWORD flags,
+             LPWSAOVERLAPPED overlapped,
+             LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine);
+
+typedef int (WSAAPI* LPFN_WSARECVFROM)
+            (SOCKET socket,
+             LPWSABUF buffers,
+             DWORD buffer_count,
+             LPDWORD bytes,
+             LPDWORD flags,
+             struct sockaddr* addr,
+             LPINT addr_len,
+             LPWSAOVERLAPPED overlapped,
+             LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine);
+
+#ifndef _NTDEF_
+  typedef LONG NTSTATUS;
+  typedef NTSTATUS *PNTSTATUS;
+#endif
+
+#ifndef RTL_CONDITION_VARIABLE_INIT
+  typedef PVOID CONDITION_VARIABLE, *PCONDITION_VARIABLE;
+#endif
+
+typedef struct _AFD_POLL_HANDLE_INFO {
+  HANDLE Handle;
+  ULONG Events;
+  NTSTATUS Status;
+} AFD_POLL_HANDLE_INFO, *PAFD_POLL_HANDLE_INFO;
+
+typedef struct _AFD_POLL_INFO {
+  LARGE_INTEGER Timeout;
+  ULONG NumberOfHandles;
+  ULONG Exclusive;
+  AFD_POLL_HANDLE_INFO Handles[1];
+} AFD_POLL_INFO, *PAFD_POLL_INFO;
+
+#define UV_MSAFD_PROVIDER_COUNT 3
+
+
+/**
+ * It should be possible to cast uv_buf_t[] to WSABUF[]
+ * see http://msdn.microsoft.com/en-us/library/ms741542(v=vs.85).aspx
+ */
+typedef struct uv_buf_t {
+  ULONG len;
+  char* base;
+} uv_buf_t;
+
+typedef int uv_file;
+typedef SOCKET uv_os_sock_t;
+typedef HANDLE uv_os_fd_t;
+
+typedef HANDLE uv_thread_t;
+
+typedef HANDLE uv_sem_t;
+
+typedef CRITICAL_SECTION uv_mutex_t;
+
+/* This condition variable implementation is based on the SetEvent solution
+ * (section 3.2) at http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
+ * We could not use the SignalObjectAndWait solution (section 3.4) because
+ * it want the 2nd argument (type uv_mutex_t) of uv_cond_wait() and
+ * uv_cond_timedwait() to be HANDLEs, but we use CRITICAL_SECTIONs.
+ */
+
+typedef union {
+  CONDITION_VARIABLE cond_var;
+  struct {
+    unsigned int waiters_count;
+    CRITICAL_SECTION waiters_count_lock;
+    HANDLE signal_event;
+    HANDLE broadcast_event;
+  } fallback;
+} uv_cond_t;
+
+typedef union {
+  struct {
+    unsigned int num_readers_;
+    CRITICAL_SECTION num_readers_lock_;
+    HANDLE write_semaphore_;
+  } state_;
+  /* TODO: remove me in v2.x. */
+  struct {
+    SRWLOCK unused_;
+  } unused1_;
+  /* TODO: remove me in v2.x. */
+  struct {
+    uv_mutex_t unused1_;
+    uv_mutex_t unused2_;
+  } unused2_;
+} uv_rwlock_t;
+
+typedef struct {
+  unsigned int n;
+  unsigned int count;
+  uv_mutex_t mutex;
+  uv_sem_t turnstile1;
+  uv_sem_t turnstile2;
+} uv_barrier_t;
+
+typedef struct {
+  DWORD tls_index;
+} uv_key_t;
+
+#define UV_ONCE_INIT { 0, NULL }
+
+typedef struct uv_once_s {
+  unsigned char ran;
+  HANDLE event;
+} uv_once_t;
+
+/* Platform-specific definitions for uv_spawn support. */
+typedef unsigned char uv_uid_t;
+typedef unsigned char uv_gid_t;
+
+typedef struct uv__dirent_s {
+  int d_type;
+  char d_name[1];
+} uv__dirent_t;
+
+#define HAVE_DIRENT_TYPES
+#define UV__DT_DIR     UV_DIRENT_DIR
+#define UV__DT_FILE    UV_DIRENT_FILE
+#define UV__DT_LINK    UV_DIRENT_LINK
+#define UV__DT_FIFO    UV_DIRENT_FIFO
+#define UV__DT_SOCKET  UV_DIRENT_SOCKET
+#define UV__DT_CHAR    UV_DIRENT_CHAR
+#define UV__DT_BLOCK   UV_DIRENT_BLOCK
+
+/* Platform-specific definitions for uv_dlopen support. */
+#define UV_DYNAMIC FAR WINAPI
+typedef struct {
+  HMODULE handle;
+  char* errmsg;
+} uv_lib_t;
+
+RB_HEAD(uv_timer_tree_s, uv_timer_s);
+
+#define UV_LOOP_PRIVATE_FIELDS                                                \
+    /* The loop's I/O completion port */                                      \
+  HANDLE iocp;                                                                \
+  /* The current time according to the event loop. in msecs. */               \
+  uint64_t time;                                                              \
+  /* Tail of a single-linked circular queue of pending reqs. If the queue */  \
+  /* is empty, tail_ is NULL. If there is only one item, */                   \
+  /* tail_->next_req == tail_ */                                              \
+  uv_req_t* pending_reqs_tail;                                                \
+  /* Head of a single-linked list of closed handles */                        \
+  uv_handle_t* endgame_handles;                                               \
+  /* The head of the timers tree */                                           \
+  struct uv_timer_tree_s timers;                                              \
+    /* Lists of active loop (prepare / check / idle) watchers */              \
+  uv_prepare_t* prepare_handles;                                              \
+  uv_check_t* check_handles;                                                  \
+  uv_idle_t* idle_handles;                                                    \
+  /* This pointer will refer to the prepare/check/idle handle whose */        \
+  /* callback is scheduled to be called next. This is needed to allow */      \
+  /* safe removal from one of the lists above while that list being */        \
+  /* iterated over. */                                                        \
+  uv_prepare_t* next_prepare_handle;                                          \
+  uv_check_t* next_check_handle;                                              \
+  uv_idle_t* next_idle_handle;                                                \
+  /* This handle holds the peer sockets for the fast variant of uv_poll_t */  \
+  SOCKET poll_peer_sockets[UV_MSAFD_PROVIDER_COUNT];                          \
+  /* Counter to keep track of active tcp streams */                           \
+  unsigned int active_tcp_streams;                                            \
+  /* Counter to keep track of active udp streams */                           \
+  unsigned int active_udp_streams;                                            \
+  /* Counter to started timer */                                              \
+  uint64_t timer_counter;                                                     \
+  /* Threadpool */                                                            \
+  void* wq[2];                                                                \
+  uv_mutex_t wq_mutex;                                                        \
+  uv_async_t wq_async;
+
+#define UV_REQ_TYPE_PRIVATE                                                   \
+  /* TODO: remove the req suffix */                                           \
+  UV_ACCEPT,                                                                  \
+  UV_FS_EVENT_REQ,                                                            \
+  UV_POLL_REQ,                                                                \
+  UV_PROCESS_EXIT,                                                            \
+  UV_READ,                                                                    \
+  UV_UDP_RECV,                                                                \
+  UV_WAKEUP,                                                                  \
+  UV_SIGNAL_REQ,
+
+#define UV_REQ_PRIVATE_FIELDS                                                 \
+  union {                                                                     \
+    /* Used by I/O operations */                                              \
+    struct {                                                                  \
+      OVERLAPPED overlapped;                                                  \
+      size_t queued_bytes;                                                    \
+    } io;                                                                     \
+  } u;                                                                        \
+  struct uv_req_s* next_req;
+
+#define UV_WRITE_PRIVATE_FIELDS                                               \
+  int ipc_header;                                                             \
+  uv_buf_t write_buffer;                                                      \
+  HANDLE event_handle;                                                        \
+  HANDLE wait_handle;
+
+#define UV_CONNECT_PRIVATE_FIELDS                                             \
+  /* empty */
+
+#define UV_SHUTDOWN_PRIVATE_FIELDS                                            \
+  /* empty */
+
+#define UV_UDP_SEND_PRIVATE_FIELDS                                            \
+  /* empty */
+
+#define UV_PRIVATE_REQ_TYPES                                                  \
+  typedef struct uv_pipe_accept_s {                                           \
+    UV_REQ_FIELDS                                                             \
+    HANDLE pipeHandle;                                                        \
+    struct uv_pipe_accept_s* next_pending;                                    \
+  } uv_pipe_accept_t;                                                         \
+                                                                              \
+  typedef struct uv_tcp_accept_s {                                            \
+    UV_REQ_FIELDS                                                             \
+    SOCKET accept_socket;                                                     \
+    char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32];             \
+    HANDLE event_handle;                                                      \
+    HANDLE wait_handle;                                                       \
+    struct uv_tcp_accept_s* next_pending;                                     \
+  } uv_tcp_accept_t;                                                          \
+                                                                              \
+  typedef struct uv_read_s {                                                  \
+    UV_REQ_FIELDS                                                             \
+    HANDLE event_handle;                                                      \
+    HANDLE wait_handle;                                                       \
+  } uv_read_t;
+
+#define uv_stream_connection_fields                                           \
+  unsigned int write_reqs_pending;                                            \
+  uv_shutdown_t* shutdown_req;
+
+#define uv_stream_server_fields                                               \
+  uv_connection_cb connection_cb;
+
+#define UV_STREAM_PRIVATE_FIELDS                                              \
+  unsigned int reqs_pending;                                                  \
+  int activecnt;                                                              \
+  uv_read_t read_req;                                                         \
+  union {                                                                     \
+    struct { uv_stream_connection_fields } conn;                              \
+    struct { uv_stream_server_fields     } serv;                              \
+  } stream;
+
+#define uv_tcp_server_fields                                                  \
+  uv_tcp_accept_t* accept_reqs;                                               \
+  unsigned int processed_accepts;                                             \
+  uv_tcp_accept_t* pending_accepts;                                           \
+  LPFN_ACCEPTEX func_acceptex;
+
+#define uv_tcp_connection_fields                                              \
+  uv_buf_t read_buffer;                                                       \
+  LPFN_CONNECTEX func_connectex;
+
+#define UV_TCP_PRIVATE_FIELDS                                                 \
+  SOCKET socket;                                                              \
+  int delayed_error;                                                          \
+  union {                                                                     \
+    struct { uv_tcp_server_fields } serv;                                     \
+    struct { uv_tcp_connection_fields } conn;                                 \
+  } tcp;
+
+#define UV_UDP_PRIVATE_FIELDS                                                 \
+  SOCKET socket;                                                              \
+  unsigned int reqs_pending;                                                  \
+  int activecnt;                                                              \
+  uv_req_t recv_req;                                                          \
+  uv_buf_t recv_buffer;                                                       \
+  struct sockaddr_storage recv_from;                                          \
+  int recv_from_len;                                                          \
+  uv_udp_recv_cb recv_cb;                                                     \
+  uv_alloc_cb alloc_cb;                                                       \
+  LPFN_WSARECV func_wsarecv;                                                  \
+  LPFN_WSARECVFROM func_wsarecvfrom;
+
+#define uv_pipe_server_fields                                                 \
+  int pending_instances;                                                      \
+  uv_pipe_accept_t* accept_reqs;                                              \
+  uv_pipe_accept_t* pending_accepts;
+
+#define uv_pipe_connection_fields                                             \
+  uv_timer_t* eof_timer;                                                      \
+  uv_write_t ipc_header_write_req;                                            \
+  int ipc_pid;                                                                \
+  uint64_t remaining_ipc_rawdata_bytes;                                       \
+  struct {                                                                    \
+    void* queue[2];                                                           \
+    int queue_len;                                                            \
+  } pending_ipc_info;                                                         \
+  uv_write_t* non_overlapped_writes_tail;                                     \
+  uv_mutex_t readfile_mutex;                                                  \
+  volatile HANDLE readfile_thread;
+
+#define UV_PIPE_PRIVATE_FIELDS                                                \
+  HANDLE handle;                                                              \
+  WCHAR* name;                                                                \
+  union {                                                                     \
+    struct { uv_pipe_server_fields } serv;                                    \
+    struct { uv_pipe_connection_fields } conn;                                \
+  } pipe;
+
+/* TODO: put the parser states in an union - TTY handles are always */
+/* half-duplex so read-state can safely overlap write-state. */
+#define UV_TTY_PRIVATE_FIELDS                                                 \
+  HANDLE handle;                                                              \
+  union {                                                                     \
+    struct {                                                                  \
+      /* Used for readable TTY handles */                                     \
+      /* TODO: remove me in v2.x. */                                          \
+      HANDLE unused_;                                                         \
+      uv_buf_t read_line_buffer;                                              \
+      HANDLE read_raw_wait;                                                   \
+      /* Fields used for translating win keystrokes into vt100 characters */  \
+      char last_key[8];                                                       \
+      unsigned char last_key_offset;                                          \
+      unsigned char last_key_len;                                             \
+      WCHAR last_utf16_high_surrogate;                                        \
+      INPUT_RECORD last_input_record;                                         \
+    } rd;                                                                     \
+    struct {                                                                  \
+      /* Used for writable TTY handles */                                     \
+      /* utf8-to-utf16 conversion state */                                    \
+      unsigned int utf8_codepoint;                                            \
+      unsigned char utf8_bytes_left;                                          \
+      /* eol conversion state */                                              \
+      unsigned char previous_eol;                                             \
+      /* ansi parser state */                                                 \
+      unsigned char ansi_parser_state;                                        \
+      unsigned char ansi_csi_argc;                                            \
+      unsigned short ansi_csi_argv[4];                                        \
+      COORD saved_position;                                                   \
+      WORD saved_attributes;                                                  \
+    } wr;                                                                     \
+  } tty;
+
+#define UV_POLL_PRIVATE_FIELDS                                                \
+  SOCKET socket;                                                              \
+  /* Used in fast mode */                                                     \
+  SOCKET peer_socket;                                                         \
+  AFD_POLL_INFO afd_poll_info_1;                                              \
+  AFD_POLL_INFO afd_poll_info_2;                                              \
+  /* Used in fast and slow mode. */                                           \
+  uv_req_t poll_req_1;                                                        \
+  uv_req_t poll_req_2;                                                        \
+  unsigned char submitted_events_1;                                           \
+  unsigned char submitted_events_2;                                           \
+  unsigned char mask_events_1;                                                \
+  unsigned char mask_events_2;                                                \
+  unsigned char events;
+
+#define UV_TIMER_PRIVATE_FIELDS                                               \
+  RB_ENTRY(uv_timer_s) tree_entry;                                            \
+  uint64_t due;                                                               \
+  uint64_t repeat;                                                            \
+  uint64_t start_id;                                                          \
+  uv_timer_cb timer_cb;
+
+#define UV_ASYNC_PRIVATE_FIELDS                                               \
+  struct uv_req_s async_req;                                                  \
+  uv_async_cb async_cb;                                                       \
+  /* char to avoid alignment issues */                                        \
+  char volatile async_sent;
+
+#define UV_PREPARE_PRIVATE_FIELDS                                             \
+  uv_prepare_t* prepare_prev;                                                 \
+  uv_prepare_t* prepare_next;                                                 \
+  uv_prepare_cb prepare_cb;
+
+#define UV_CHECK_PRIVATE_FIELDS                                               \
+  uv_check_t* check_prev;                                                     \
+  uv_check_t* check_next;                                                     \
+  uv_check_cb check_cb;
+
+#define UV_IDLE_PRIVATE_FIELDS                                                \
+  uv_idle_t* idle_prev;                                                       \
+  uv_idle_t* idle_next;                                                       \
+  uv_idle_cb idle_cb;
+
+#define UV_HANDLE_PRIVATE_FIELDS                                              \
+  uv_handle_t* endgame_next;                                                  \
+  unsigned int flags;
+
+#define UV_GETADDRINFO_PRIVATE_FIELDS                                         \
+  struct uv__work work_req;                                                   \
+  uv_getaddrinfo_cb getaddrinfo_cb;                                           \
+  void* alloc;                                                                \
+  WCHAR* node;                                                                \
+  WCHAR* service;                                                             \
+  /* The addrinfoW field is used to store a pointer to the hints, and    */   \
+  /* later on to store the result of GetAddrInfoW. The final result will */   \
+  /* be converted to struct addrinfo* and stored in the addrinfo field.  */   \
+  struct addrinfoW* addrinfow;                                                \
+  struct addrinfo* addrinfo;                                                  \
+  int retcode;
+
+#define UV_GETNAMEINFO_PRIVATE_FIELDS                                         \
+  struct uv__work work_req;                                                   \
+  uv_getnameinfo_cb getnameinfo_cb;                                           \
+  struct sockaddr_storage storage;                                            \
+  int flags;                                                                  \
+  char host[NI_MAXHOST];                                                      \
+  char service[NI_MAXSERV];                                                   \
+  int retcode;
+
+#define UV_PROCESS_PRIVATE_FIELDS                                             \
+  struct uv_process_exit_s {                                                  \
+    UV_REQ_FIELDS                                                             \
+  } exit_req;                                                                 \
+  BYTE* child_stdio_buffer;                                                   \
+  int exit_signal;                                                            \
+  HANDLE wait_handle;                                                         \
+  HANDLE process_handle;                                                      \
+  volatile char exit_cb_pending;
+
+#define UV_FS_PRIVATE_FIELDS                                                  \
+  struct uv__work work_req;                                                   \
+  int flags;                                                                  \
+  DWORD sys_errno_;                                                           \
+  union {                                                                     \
+    /* TODO: remove me in 0.9. */                                             \
+    WCHAR* pathw;                                                             \
+    int fd;                                                                   \
+  } file;                                                                     \
+  union {                                                                     \
+    struct {                                                                  \
+      int mode;                                                               \
+      WCHAR* new_pathw;                                                       \
+      int file_flags;                                                         \
+      int fd_out;                                                             \
+      unsigned int nbufs;                                                     \
+      uv_buf_t* bufs;                                                         \
+      int64_t offset;                                                         \
+      uv_buf_t bufsml[4];                                                     \
+    } info;                                                                   \
+    struct {                                                                  \
+      double atime;                                                           \
+      double mtime;                                                           \
+    } time;                                                                   \
+  } fs;
+
+#define UV_WORK_PRIVATE_FIELDS                                                \
+  struct uv__work work_req;
+
+#define UV_FS_EVENT_PRIVATE_FIELDS                                            \
+  struct uv_fs_event_req_s {                                                  \
+    UV_REQ_FIELDS                                                             \
+  } req;                                                                      \
+  HANDLE dir_handle;                                                          \
+  int req_pending;                                                            \
+  uv_fs_event_cb cb;                                                          \
+  WCHAR* filew;                                                               \
+  WCHAR* short_filew;                                                         \
+  WCHAR* dirw;                                                                \
+  char* buffer;
+
+#define UV_SIGNAL_PRIVATE_FIELDS                                              \
+  RB_ENTRY(uv_signal_s) tree_entry;                                           \
+  struct uv_req_s signal_req;                                                 \
+  unsigned long pending_signum;
+
+#ifndef F_OK
+#define F_OK 0
+#endif
+#ifndef R_OK
+#define R_OK 4
+#endif
+#ifndef W_OK
+#define W_OK 2
+#endif
+#ifndef X_OK
+#define X_OK 1
+#endif
diff --git a/deps/libtuv/include/uv.h b/deps/libtuv/include/uv.h
new file mode 100644 (file)
index 0000000..0d00d75
--- /dev/null
@@ -0,0 +1,1504 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/* See https://github.com/libuv/libuv#documentation for documentation. */
+
+#ifndef UV_H
+#define UV_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _WIN32
+  /* Windows - set up dll import/export decorators. */
+# if defined(BUILDING_UV_SHARED)
+    /* Building shared library. */
+#   define UV_EXTERN __declspec(dllexport)
+# elif defined(USING_UV_SHARED)
+    /* Using shared library. */
+#   define UV_EXTERN __declspec(dllimport)
+# else
+    /* Building static library. */
+#   define UV_EXTERN /* nothing */
+# endif
+#elif __GNUC__ >= 4
+# define UV_EXTERN __attribute__((visibility("default")))
+#else
+# define UV_EXTERN /* nothing */
+#endif
+
+#include "uv-errno.h"
+#include "uv-version.h"
+#include <stddef.h>
+#include <stdio.h>
+
+#if defined(_MSC_VER) && _MSC_VER < 1600
+# include "stdint-msvc2008.h"
+#else
+# include <stdint.h>
+#endif
+
+#if defined(_WIN32)
+# include "uv-win.h"
+#else
+# include "uv-unix.h"
+#endif
+
+#include "tuv__debuglog.h"
+
+/* Expand this list if necessary. */
+#define UV_ERRNO_MAP(XX)                                                      \
+  XX(EADDRINUSE, "address already in use")                                    \
+  XX(EAFNOSUPPORT, "address family not supported")                            \
+  XX(EAGAIN, "resource temporarily unavailable")                              \
+  XX(EAI_ADDRFAMILY, "address family not supported")                          \
+  XX(EAI_AGAIN, "temporary failure")                                          \
+  XX(EAI_BADFLAGS, "bad ai_flags value")                                      \
+  XX(EAI_BADHINTS, "invalid value for hints")                                 \
+  XX(EAI_CANCELED, "request canceled")                                        \
+  XX(EAI_FAIL, "permanent failure")                                           \
+  XX(EAI_FAMILY, "ai_family not supported")                                   \
+  XX(EAI_MEMORY, "out of memory")                                             \
+  XX(EAI_NODATA, "no address")                                                \
+  XX(EAI_NONAME, "unknown node or service")                                   \
+  XX(EAI_OVERFLOW, "argument buffer overflow")                                \
+  XX(EAI_PROTOCOL, "resolved protocol is unknown")                            \
+  XX(EAI_SERVICE, "service not available for socket type")                    \
+  XX(EAI_SOCKTYPE, "socket type not supported")                               \
+  XX(EALREADY, "connection already in progress")                              \
+  XX(EBUSY, "resource busy or locked")                                        \
+  XX(ECANCELED, "operation canceled")                                         \
+  XX(ECONNREFUSED, "connection refused")                                      \
+  XX(EINVAL, "invalid argument")                                              \
+  XX(EIO, "i/o error")                                                        \
+  XX(ELOOP, "too many symbolic links encountered")                            \
+  XX(ENAMETOOLONG, "name too long")                                           \
+  XX(ENOBUFS, "no buffer space available")                                    \
+  XX(ENOENT, "no such file or directory")                                     \
+  XX(ENOMEM, "not enough memory")                                             \
+  XX(ENOSPC, "no space left on device")                                       \
+  XX(ENOTDIR, "not a directory")                                              \
+  XX(EPERM, "operation not permitted")                                        \
+  XX(ETIMEDOUT, "connection timed out")                                       \
+  XX(EOF, "end of file")                                                      \
+
+#define UV_HANDLE_TYPE_MAP(XX)                                                \
+  XX(ASYNC, async)                                                            \
+  XX(CHECK, check)                                                            \
+  XX(FS_EVENT, fs_event)                                                      \
+  XX(FS_POLL, fs_poll)                                                        \
+  XX(HANDLE, handle)                                                          \
+  XX(IDLE, idle)                                                              \
+  XX(NAMED_PIPE, pipe)                                                        \
+  XX(POLL, poll)                                                              \
+  XX(PREPARE, prepare)                                                        \
+  XX(PROCESS, process)                                                        \
+  XX(STREAM, stream)                                                          \
+  XX(TCP, tcp)                                                                \
+  XX(TIMER, timer)                                                            \
+  XX(TTY, tty)                                                                \
+  XX(UDP, udp)                                                                \
+  XX(SIGNAL, signal)                                                          \
+
+#define UV_REQ_TYPE_MAP(XX)                                                   \
+  XX(REQ, req)                                                                \
+  XX(CONNECT, connect)                                                        \
+  XX(WRITE, write)                                                            \
+  XX(SHUTDOWN, shutdown)                                                      \
+  XX(UDP_SEND, udp_send)                                                      \
+  XX(FS, fs)                                                                  \
+  XX(WORK, work)                                                              \
+  XX(GETADDRINFO, getaddrinfo)                                                \
+  XX(GETNAMEINFO, getnameinfo)                                                \
+
+typedef enum {
+#define XX(code, _) UV_ ## code = UV__ ## code,
+  UV_ERRNO_MAP(XX)
+#undef XX
+  UV_ERRNO_MAX = UV__EOF - 1
+} uv_errno_t;
+
+typedef enum {
+  UV_UNKNOWN_HANDLE = 0,
+#define XX(uc, lc) UV_##uc,
+  UV_HANDLE_TYPE_MAP(XX)
+#undef XX
+  UV_FILE,
+  UV_HANDLE_TYPE_MAX
+} uv_handle_type;
+
+typedef enum {
+  UV_UNKNOWN_REQ = 0,
+#define XX(uc, lc) UV_##uc,
+  UV_REQ_TYPE_MAP(XX)
+#undef XX
+  UV_REQ_TYPE_PRIVATE
+  UV_REQ_TYPE_MAX
+} uv_req_type;
+
+
+/* Handle types. */
+typedef struct uv_loop_s uv_loop_t;
+typedef struct uv_handle_s uv_handle_t;
+typedef struct uv_stream_s uv_stream_t;
+typedef struct uv_tcp_s uv_tcp_t;
+typedef struct uv_udp_s uv_udp_t;
+typedef struct uv_pipe_s uv_pipe_t;
+typedef struct uv_tty_s uv_tty_t;
+typedef struct uv_poll_s uv_poll_t;
+typedef struct uv_timer_s uv_timer_t;
+typedef struct uv_prepare_s uv_prepare_t;
+typedef struct uv_check_s uv_check_t;
+typedef struct uv_idle_s uv_idle_t;
+typedef struct uv_async_s uv_async_t;
+typedef struct uv_process_s uv_process_t;
+typedef struct uv_fs_event_s uv_fs_event_t;
+typedef struct uv_fs_poll_s uv_fs_poll_t;
+typedef struct uv_signal_s uv_signal_t;
+
+/* Request types. */
+typedef struct uv_req_s uv_req_t;
+typedef struct uv_getaddrinfo_s uv_getaddrinfo_t;
+typedef struct uv_getnameinfo_s uv_getnameinfo_t;
+typedef struct uv_shutdown_s uv_shutdown_t;
+typedef struct uv_write_s uv_write_t;
+typedef struct uv_connect_s uv_connect_t;
+typedef struct uv_udp_send_s uv_udp_send_t;
+typedef struct uv_fs_s uv_fs_t;
+typedef struct uv_work_s uv_work_t;
+
+/* None of the above. */
+typedef struct uv_cpu_info_s uv_cpu_info_t;
+typedef struct uv_interface_address_s uv_interface_address_t;
+typedef struct uv_dirent_s uv_dirent_t;
+typedef struct uv_passwd_s uv_passwd_t;
+
+typedef enum {
+  UV_LOOP_BLOCK_SIGNAL
+} uv_loop_option;
+
+typedef enum {
+  UV_RUN_DEFAULT = 0,
+  UV_RUN_ONCE,
+  UV_RUN_NOWAIT
+} uv_run_mode;
+
+
+UV_EXTERN unsigned int uv_version(void);
+UV_EXTERN const char* uv_version_string(void);
+
+typedef void* (*uv_malloc_func)(size_t size);
+typedef void* (*uv_realloc_func)(void* ptr, size_t size);
+typedef void* (*uv_calloc_func)(size_t count, size_t size);
+typedef void (*uv_free_func)(void* ptr);
+
+UV_EXTERN int uv_replace_allocator(uv_malloc_func malloc_func,
+                                   uv_realloc_func realloc_func,
+                                   uv_calloc_func calloc_func,
+                                   uv_free_func free_func);
+
+UV_EXTERN uv_loop_t* uv_default_loop(void);
+UV_EXTERN int uv_loop_init(uv_loop_t* loop);
+UV_EXTERN int uv_loop_close(uv_loop_t* loop);
+/*
+ * NOTE:
+ *  This function is DEPRECATED (to be removed after 0.12), users should
+ *  allocate the loop manually and use uv_loop_init instead.
+ */
+UV_EXTERN uv_loop_t* uv_loop_new(void);
+/*
+ * NOTE:
+ *  This function is DEPRECATED (to be removed after 0.12). Users should use
+ *  uv_loop_close and free the memory manually instead.
+ */
+UV_EXTERN void uv_loop_delete(uv_loop_t*);
+UV_EXTERN size_t uv_loop_size(void);
+UV_EXTERN int uv_loop_alive(const uv_loop_t* loop);
+UV_EXTERN int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...);
+UV_EXTERN int uv_loop_has_active_reqs(const uv_loop_t* loop); /* test driver */
+
+UV_EXTERN int uv_run(uv_loop_t*, uv_run_mode mode);
+UV_EXTERN void uv_stop(uv_loop_t*);
+
+UV_EXTERN void uv_ref(uv_handle_t*);
+UV_EXTERN void uv_unref(uv_handle_t*);
+UV_EXTERN int uv_has_ref(const uv_handle_t*);
+
+UV_EXTERN void uv_update_time(uv_loop_t*);
+UV_EXTERN uint64_t uv_now(const uv_loop_t*);
+
+UV_EXTERN int uv_backend_fd(const uv_loop_t*);
+UV_EXTERN int uv_backend_timeout(const uv_loop_t*);
+
+typedef void (*uv_alloc_cb)(uv_handle_t* handle,
+                            size_t suggested_size,
+                            uv_buf_t* buf);
+typedef void (*uv_read_cb)(uv_stream_t* stream,
+                           ssize_t nread,
+                           const uv_buf_t* buf);
+typedef void (*uv_write_cb)(uv_write_t* req, int status);
+typedef void (*uv_connect_cb)(uv_connect_t* req, int status);
+typedef void (*uv_shutdown_cb)(uv_shutdown_t* req, int status);
+typedef void (*uv_connection_cb)(uv_stream_t* server, int status);
+typedef void (*uv_close_cb)(uv_handle_t* handle);
+typedef void (*uv_poll_cb)(uv_poll_t* handle, int status, int events);
+typedef void (*uv_timer_cb)(uv_timer_t* handle);
+typedef void (*uv_async_cb)(uv_async_t* handle);
+typedef void (*uv_prepare_cb)(uv_prepare_t* handle);
+typedef void (*uv_check_cb)(uv_check_t* handle);
+typedef void (*uv_idle_cb)(uv_idle_t* handle);
+typedef void (*uv_exit_cb)(uv_process_t*, int64_t exit_status, int term_signal);
+typedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg);
+typedef void (*uv_fs_cb)(uv_fs_t* req);
+typedef void (*uv_work_cb)(uv_work_t* req);
+typedef void (*uv_after_work_cb)(uv_work_t* req, int status);
+typedef void (*uv_getaddrinfo_cb)(uv_getaddrinfo_t* req,
+                                  int status,
+                                  struct addrinfo* res);
+typedef void (*uv_getnameinfo_cb)(uv_getnameinfo_t* req,
+                                  int status,
+                                  const char* hostname,
+                                  const char* service);
+
+typedef struct {
+  long tv_sec;
+  long tv_nsec;
+} uv_timespec_t;
+
+
+typedef struct {
+  uint64_t st_dev;
+  uint64_t st_mode;
+  uint64_t st_nlink;
+  uint64_t st_uid;
+  uint64_t st_gid;
+  uint64_t st_rdev;
+  uint64_t st_ino;
+  uint64_t st_size;
+  uint64_t st_blksize;
+  uint64_t st_blocks;
+  uint64_t st_flags;
+  uint64_t st_gen;
+  uv_timespec_t st_atim;
+  uv_timespec_t st_mtim;
+  uv_timespec_t st_ctim;
+  uv_timespec_t st_birthtim;
+} uv_stat_t;
+
+
+typedef void (*uv_fs_event_cb)(uv_fs_event_t* handle,
+                               const char* filename,
+                               int events,
+                               int status);
+
+typedef void (*uv_fs_poll_cb)(uv_fs_poll_t* handle,
+                              int status,
+                              const uv_stat_t* prev,
+                              const uv_stat_t* curr);
+
+typedef void (*uv_signal_cb)(uv_signal_t* handle, int signum);
+
+
+typedef enum {
+  UV_LEAVE_GROUP = 0,
+  UV_JOIN_GROUP
+} uv_membership;
+
+
+UV_EXTERN int uv_translate_sys_error(int sys_errno);
+
+UV_EXTERN const char* uv_strerror(int err);
+UV_EXTERN const char* uv_err_name(int err);
+
+
+#ifdef TUV_ENABLE_MEMORY_CONSTRAINTS
+# define UV_REQ_FIELDS                                                        \
+  /* public */                                                                \
+  void* data;                                                                 \
+  /* read-only */                                                             \
+  uv_req_type type;                                                           \
+  /* private */                                                               \
+  void* active_queue[2];                                                      \
+  UV_REQ_PRIVATE_FIELDS
+#else /* original libuv code */
+# define UV_REQ_FIELDS                                                        \
+  /* public */                                                                \
+  void* data;                                                                 \
+  /* read-only */                                                             \
+  uv_req_type type;                                                           \
+  /* private */                                                               \
+  void* active_queue[2];                                                      \
+  void* reserved[4];                                                          \
+  UV_REQ_PRIVATE_FIELDS
+#endif
+
+/* Abstract base class of all requests. */
+struct uv_req_s {
+  UV_REQ_FIELDS
+};
+
+
+/* Platform-specific request types. */
+UV_PRIVATE_REQ_TYPES
+
+
+UV_EXTERN int uv_shutdown(uv_shutdown_t* req,
+                          uv_stream_t* handle,
+                          uv_shutdown_cb cb);
+
+struct uv_shutdown_s {
+  UV_REQ_FIELDS
+  uv_stream_t* handle;
+  uv_shutdown_cb cb;
+  UV_SHUTDOWN_PRIVATE_FIELDS
+};
+
+
+#ifdef TUV_ENABLE_MEMORY_CONSTRAINTS
+# define UV_HANDLE_FIELDS                                                     \
+  /* public */                                                                \
+  void* data;                                                                 \
+  /* read-only */                                                             \
+  uv_loop_t* loop;                                                            \
+  uv_handle_type type;                                                        \
+  /* private */                                                               \
+  uv_close_cb close_cb;                                                       \
+  void* handle_queue[2];                                                      \
+  union {                                                                     \
+    int fd;                                                                   \
+  } u;                                                                        \
+  UV_HANDLE_PRIVATE_FIELDS
+#else /* original libuv code */
+# define UV_HANDLE_FIELDS                                                     \
+  /* public */                                                                \
+  void* data;                                                                 \
+  /* read-only */                                                             \
+  uv_loop_t* loop;                                                            \
+  uv_handle_type type;                                                        \
+  /* private */                                                               \
+  uv_close_cb close_cb;                                                       \
+  void* handle_queue[2];                                                      \
+  union {                                                                     \
+    int fd;                                                                   \
+    void* reserved[4];                                                        \
+  } u;                                                                        \
+  UV_HANDLE_PRIVATE_FIELDS
+#endif
+
+/* The abstract base class of all handles. */
+struct uv_handle_s {
+  UV_HANDLE_FIELDS
+};
+
+UV_EXTERN size_t uv_handle_size(uv_handle_type type);
+UV_EXTERN size_t uv_req_size(uv_req_type type);
+
+UV_EXTERN int uv_is_active(const uv_handle_t* handle);
+
+UV_EXTERN void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg);
+
+/* Helpers for ad hoc debugging, no API/ABI stability guaranteed. */
+UV_EXTERN void uv_print_all_handles(uv_loop_t* loop, FILE* stream);
+UV_EXTERN void uv_print_active_handles(uv_loop_t* loop, FILE* stream);
+
+UV_EXTERN void uv_close(uv_handle_t* handle, uv_close_cb close_cb);
+
+UV_EXTERN int uv_send_buffer_size(uv_handle_t* handle, int* value);
+UV_EXTERN int uv_recv_buffer_size(uv_handle_t* handle, int* value);
+
+UV_EXTERN int uv_fileno(const uv_handle_t* handle, uv_os_fd_t* fd);
+
+UV_EXTERN uv_buf_t uv_buf_init(char* base, unsigned int len);
+
+
+#define UV_STREAM_FIELDS                                                      \
+  /* number of bytes queued for writing */                                    \
+  size_t write_queue_size;                                                    \
+  uv_alloc_cb alloc_cb;                                                       \
+  uv_read_cb read_cb;                                                         \
+  /* private */                                                               \
+  UV_STREAM_PRIVATE_FIELDS
+
+/*
+ * uv_stream_t is a subclass of uv_handle_t.
+ *
+ * uv_stream is an abstract class.
+ *
+ * uv_stream_t is the parent class of uv_tcp_t, uv_pipe_t and uv_tty_t.
+ */
+struct uv_stream_s {
+  UV_HANDLE_FIELDS
+  UV_STREAM_FIELDS
+};
+
+UV_EXTERN int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb);
+UV_EXTERN int uv_accept(uv_stream_t* server, uv_stream_t* client);
+
+UV_EXTERN int uv_read_start(uv_stream_t*,
+                            uv_alloc_cb alloc_cb,
+                            uv_read_cb read_cb);
+UV_EXTERN int uv_read_stop(uv_stream_t*);
+
+UV_EXTERN int uv_write(uv_write_t* req,
+                       uv_stream_t* handle,
+                       const uv_buf_t bufs[],
+                       unsigned int nbufs,
+                       uv_write_cb cb);
+UV_EXTERN int uv_write2(uv_write_t* req,
+                        uv_stream_t* handle,
+                        const uv_buf_t bufs[],
+                        unsigned int nbufs,
+                        uv_stream_t* send_handle,
+                        uv_write_cb cb);
+UV_EXTERN int uv_try_write(uv_stream_t* handle,
+                           const uv_buf_t bufs[],
+                           unsigned int nbufs);
+
+/* uv_write_t is a subclass of uv_req_t. */
+struct uv_write_s {
+  UV_REQ_FIELDS
+  uv_write_cb cb;
+  uv_stream_t* send_handle;
+  uv_stream_t* handle;
+  UV_WRITE_PRIVATE_FIELDS
+};
+
+
+UV_EXTERN int uv_is_readable(const uv_stream_t* handle);
+UV_EXTERN int uv_is_writable(const uv_stream_t* handle);
+
+UV_EXTERN int uv_stream_set_blocking(uv_stream_t* handle, int blocking);
+
+UV_EXTERN int uv_is_closing(const uv_handle_t* handle);
+
+
+/*
+ * uv_tcp_t is a subclass of uv_stream_t.
+ *
+ * Represents a TCP stream or TCP server.
+ */
+struct uv_tcp_s {
+  UV_HANDLE_FIELDS
+  UV_STREAM_FIELDS
+  UV_TCP_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_tcp_init(uv_loop_t*, uv_tcp_t* handle);
+UV_EXTERN int uv_tcp_init_ex(uv_loop_t*, uv_tcp_t* handle, unsigned int flags);
+UV_EXTERN int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock);
+UV_EXTERN int uv_tcp_nodelay(uv_tcp_t* handle, int enable);
+UV_EXTERN int uv_tcp_keepalive(uv_tcp_t* handle,
+                               int enable,
+                               unsigned int delay);
+UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable);
+
+enum uv_tcp_flags {
+  /* Used with uv_tcp_bind, when an IPv6 address is used. */
+  UV_TCP_IPV6ONLY = 1
+};
+
+UV_EXTERN int uv_tcp_bind(uv_tcp_t* handle,
+                          const struct sockaddr* addr,
+                          unsigned int flags);
+UV_EXTERN int uv_tcp_getsockname(const uv_tcp_t* handle,
+                                 struct sockaddr* name,
+                                 int* namelen);
+UV_EXTERN int uv_tcp_getpeername(const uv_tcp_t* handle,
+                                 struct sockaddr* name,
+                                 int* namelen);
+UV_EXTERN int uv_tcp_connect(uv_connect_t* req,
+                             uv_tcp_t* handle,
+                             const struct sockaddr* addr,
+                             uv_connect_cb cb);
+
+/* uv_connect_t is a subclass of uv_req_t. */
+struct uv_connect_s {
+  UV_REQ_FIELDS
+  uv_connect_cb cb;
+  uv_stream_t* handle;
+  UV_CONNECT_PRIVATE_FIELDS
+};
+
+
+/*
+ * UDP support.
+ */
+
+enum uv_udp_flags {
+  /* Disables dual stack mode. */
+  UV_UDP_IPV6ONLY = 1,
+  /*
+   * Indicates message was truncated because read buffer was too small. The
+   * remainder was discarded by the OS. Used in uv_udp_recv_cb.
+   */
+  UV_UDP_PARTIAL = 2,
+  /*
+   * Indicates if SO_REUSEADDR will be set when binding the handle.
+   * This sets the SO_REUSEPORT socket flag on the BSDs and OS X. On other
+   * Unix platforms, it sets the SO_REUSEADDR flag.  What that means is that
+   * multiple threads or processes can bind to the same address without error
+   * (provided they all set the flag) but only the last one to bind will receive
+   * any traffic, in effect "stealing" the port from the previous listener.
+   */
+  UV_UDP_REUSEADDR = 4
+};
+
+typedef void (*uv_udp_send_cb)(uv_udp_send_t* req, int status);
+typedef void (*uv_udp_recv_cb)(uv_udp_t* handle,
+                               ssize_t nread,
+                               const uv_buf_t* buf,
+                               const struct sockaddr* addr,
+                               unsigned flags);
+
+/* uv_udp_t is a subclass of uv_handle_t. */
+struct uv_udp_s {
+  UV_HANDLE_FIELDS
+  /* read-only */
+  /*
+   * Number of bytes queued for sending. This field strictly shows how much
+   * information is currently queued.
+   */
+  size_t send_queue_size;
+  /*
+   * Number of send requests currently in the queue awaiting to be processed.
+   */
+  size_t send_queue_count;
+  UV_UDP_PRIVATE_FIELDS
+};
+
+/* uv_udp_send_t is a subclass of uv_req_t. */
+struct uv_udp_send_s {
+  UV_REQ_FIELDS
+  uv_udp_t* handle;
+  uv_udp_send_cb cb;
+  UV_UDP_SEND_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_udp_init(uv_loop_t*, uv_udp_t* handle);
+UV_EXTERN int uv_udp_init_ex(uv_loop_t*, uv_udp_t* handle, unsigned int flags);
+UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock);
+UV_EXTERN int uv_udp_bind(uv_udp_t* handle,
+                          const struct sockaddr* addr,
+                          unsigned int flags);
+
+UV_EXTERN int uv_udp_getsockname(const uv_udp_t* handle,
+                                 struct sockaddr* name,
+                                 int* namelen);
+UV_EXTERN int uv_udp_set_membership(uv_udp_t* handle,
+                                    const char* multicast_addr,
+                                    const char* interface_addr,
+                                    uv_membership membership);
+UV_EXTERN int uv_udp_set_multicast_loop(uv_udp_t* handle, int on);
+UV_EXTERN int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl);
+UV_EXTERN int uv_udp_set_multicast_interface(uv_udp_t* handle,
+                                             const char* interface_addr);
+UV_EXTERN int uv_udp_set_broadcast(uv_udp_t* handle, int on);
+UV_EXTERN int uv_udp_set_ttl(uv_udp_t* handle, int ttl);
+UV_EXTERN int uv_udp_send(uv_udp_send_t* req,
+                          uv_udp_t* handle,
+                          const uv_buf_t bufs[],
+                          unsigned int nbufs,
+                          const struct sockaddr* addr,
+                          uv_udp_send_cb send_cb);
+UV_EXTERN int uv_udp_try_send(uv_udp_t* handle,
+                              const uv_buf_t bufs[],
+                              unsigned int nbufs,
+                              const struct sockaddr* addr);
+UV_EXTERN int uv_udp_recv_start(uv_udp_t* handle,
+                                uv_alloc_cb alloc_cb,
+                                uv_udp_recv_cb recv_cb);
+UV_EXTERN int uv_udp_recv_stop(uv_udp_t* handle);
+
+
+/*
+ * uv_tty_t is a subclass of uv_stream_t.
+ *
+ * Representing a stream for the console.
+ */
+struct uv_tty_s {
+  UV_HANDLE_FIELDS
+  UV_STREAM_FIELDS
+  UV_TTY_PRIVATE_FIELDS
+};
+
+typedef enum {
+  /* Initial/normal terminal mode */
+  UV_TTY_MODE_NORMAL,
+  /* Raw input mode (On Windows, ENABLE_WINDOW_INPUT is also enabled) */
+  UV_TTY_MODE_RAW,
+  /* Binary-safe I/O mode for IPC (Unix-only) */
+  UV_TTY_MODE_IO
+} uv_tty_mode_t;
+
+UV_EXTERN int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd, int readable);
+UV_EXTERN int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode);
+UV_EXTERN int uv_tty_reset_mode(void);
+UV_EXTERN int uv_tty_get_winsize(uv_tty_t*, int* width, int* height);
+
+#ifdef __cplusplus
+extern "C++" {
+
+inline int uv_tty_set_mode(uv_tty_t* handle, int mode) {
+  return uv_tty_set_mode(handle, static_cast<uv_tty_mode_t>(mode));
+}
+
+}
+#endif
+
+UV_EXTERN uv_handle_type uv_guess_handle(uv_file file);
+
+/*
+ * uv_pipe_t is a subclass of uv_stream_t.
+ *
+ * Representing a pipe stream or pipe server. On Windows this is a Named
+ * Pipe. On Unix this is a Unix domain socket.
+ */
+struct uv_pipe_s {
+  UV_HANDLE_FIELDS
+  UV_STREAM_FIELDS
+  int ipc; /* non-zero if this pipe is used for passing handles */
+  UV_PIPE_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc);
+UV_EXTERN int uv_pipe_open(uv_pipe_t*, uv_file file);
+UV_EXTERN int uv_pipe_bind(uv_pipe_t* handle, const char* name);
+UV_EXTERN void uv_pipe_connect(uv_connect_t* req,
+                               uv_pipe_t* handle,
+                               const char* name,
+                               uv_connect_cb cb);
+UV_EXTERN int uv_pipe_getsockname(const uv_pipe_t* handle,
+                                  char* buffer,
+                                  size_t* size);
+UV_EXTERN int uv_pipe_getpeername(const uv_pipe_t* handle,
+                                  char* buffer,
+                                  size_t* size);
+UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t* handle, int count);
+UV_EXTERN int uv_pipe_pending_count(uv_pipe_t* handle);
+UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle);
+
+
+struct uv_poll_s {
+  UV_HANDLE_FIELDS
+  uv_poll_cb poll_cb;
+  UV_POLL_PRIVATE_FIELDS
+};
+
+enum uv_poll_event {
+  UV_READABLE = 1,
+  UV_WRITABLE = 2,
+  UV_DISCONNECT = 4
+};
+
+UV_EXTERN int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd);
+UV_EXTERN int uv_poll_init_socket(uv_loop_t* loop,
+                                  uv_poll_t* handle,
+                                  uv_os_sock_t socket);
+UV_EXTERN int uv_poll_start(uv_poll_t* handle, int events, uv_poll_cb cb);
+UV_EXTERN int uv_poll_stop(uv_poll_t* handle);
+
+
+struct uv_prepare_s {
+  UV_HANDLE_FIELDS
+  UV_PREPARE_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_prepare_init(uv_loop_t*, uv_prepare_t* prepare);
+UV_EXTERN int uv_prepare_start(uv_prepare_t* prepare, uv_prepare_cb cb);
+UV_EXTERN int uv_prepare_stop(uv_prepare_t* prepare);
+
+
+struct uv_check_s {
+  UV_HANDLE_FIELDS
+  UV_CHECK_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_check_init(uv_loop_t*, uv_check_t* check);
+UV_EXTERN int uv_check_start(uv_check_t* check, uv_check_cb cb);
+UV_EXTERN int uv_check_stop(uv_check_t* check);
+
+
+struct uv_idle_s {
+  UV_HANDLE_FIELDS
+  UV_IDLE_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_idle_init(uv_loop_t*, uv_idle_t* idle);
+UV_EXTERN int uv_idle_start(uv_idle_t* idle, uv_idle_cb cb);
+UV_EXTERN int uv_idle_stop(uv_idle_t* idle);
+
+
+struct uv_async_s {
+  UV_HANDLE_FIELDS
+  UV_ASYNC_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_async_init(uv_loop_t*,
+                            uv_async_t* async,
+                            uv_async_cb async_cb);
+UV_EXTERN int tuv_async_deinit(uv_loop_t* loop,
+                               uv_async_t* handle);
+UV_EXTERN int uv_async_send(uv_async_t* async);
+
+
+/*
+ * uv_timer_t is a subclass of uv_handle_t.
+ *
+ * Used to get woken up at a specified time in the future.
+ */
+struct uv_timer_s {
+  UV_HANDLE_FIELDS
+  UV_TIMER_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_timer_init(uv_loop_t*, uv_timer_t* handle);
+UV_EXTERN void tuv_timer_deinit(uv_loop_t*, uv_timer_t* handle);
+UV_EXTERN int uv_timer_start(uv_timer_t* handle,
+                             uv_timer_cb cb,
+                             uint64_t timeout,
+                             uint64_t repeat);
+UV_EXTERN int uv_timer_stop(uv_timer_t* handle);
+UV_EXTERN int uv_timer_again(uv_timer_t* handle);
+UV_EXTERN void uv_timer_set_repeat(uv_timer_t* handle, uint64_t repeat);
+UV_EXTERN uint64_t uv_timer_get_repeat(const uv_timer_t* handle);
+
+
+/*
+ * uv_getaddrinfo_t is a subclass of uv_req_t.
+ *
+ * Request object for uv_getaddrinfo.
+ */
+struct uv_getaddrinfo_s {
+  UV_REQ_FIELDS
+  /* read-only */
+  uv_loop_t* loop;
+  /* struct addrinfo* addrinfo is marked as private, but it really isn't. */
+  UV_GETADDRINFO_PRIVATE_FIELDS
+};
+
+
+UV_EXTERN int uv_getaddrinfo(uv_loop_t* loop,
+                             uv_getaddrinfo_t* req,
+                             uv_getaddrinfo_cb getaddrinfo_cb,
+                             const char* node,
+                             const char* service,
+                             const struct addrinfo* hints);
+UV_EXTERN void uv_freeaddrinfo(struct addrinfo* ai);
+
+
+/*
+* uv_getnameinfo_t is a subclass of uv_req_t.
+*
+* Request object for uv_getnameinfo.
+*/
+struct uv_getnameinfo_s {
+  UV_REQ_FIELDS
+  /* read-only */
+  uv_loop_t* loop;
+  /* host and service are marked as private, but they really aren't. */
+  UV_GETNAMEINFO_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_getnameinfo(uv_loop_t* loop,
+                             uv_getnameinfo_t* req,
+                             uv_getnameinfo_cb getnameinfo_cb,
+                             const struct sockaddr* addr,
+                             int flags);
+
+
+/* uv_spawn() options. */
+typedef enum {
+  UV_IGNORE         = 0x00,
+  UV_CREATE_PIPE    = 0x01,
+  UV_INHERIT_FD     = 0x02,
+  UV_INHERIT_STREAM = 0x04,
+
+  /*
+   * When UV_CREATE_PIPE is specified, UV_READABLE_PIPE and UV_WRITABLE_PIPE
+   * determine the direction of flow, from the child process' perspective. Both
+   * flags may be specified to create a duplex data stream.
+   */
+  UV_READABLE_PIPE  = 0x10,
+  UV_WRITABLE_PIPE  = 0x20
+} uv_stdio_flags;
+
+typedef struct uv_stdio_container_s {
+  uv_stdio_flags flags;
+
+  union {
+    uv_stream_t* stream;
+    int fd;
+  } data;
+} uv_stdio_container_t;
+
+typedef struct uv_process_options_s {
+  uv_exit_cb exit_cb; /* Called after the process exits. */
+  const char* file;   /* Path to program to execute. */
+  /*
+   * Command line arguments. args[0] should be the path to the program. On
+   * Windows this uses CreateProcess which concatenates the arguments into a
+   * string this can cause some strange errors. See the note at
+   * windows_verbatim_arguments.
+   */
+  char** args;
+  /*
+   * This will be set as the environ variable in the subprocess. If this is
+   * NULL then the parents environ will be used.
+   */
+  char** env;
+  /*
+   * If non-null this represents a directory the subprocess should execute
+   * in. Stands for current working directory.
+   */
+  const char* cwd;
+  /*
+   * Various flags that control how uv_spawn() behaves. See the definition of
+   * `enum uv_process_flags` below.
+   */
+  unsigned int flags;
+  /*
+   * The `stdio` field points to an array of uv_stdio_container_t structs that
+   * describe the file descriptors that will be made available to the child
+   * process. The convention is that stdio[0] points to stdin, fd 1 is used for
+   * stdout, and fd 2 is stderr.
+   *
+   * Note that on windows file descriptors greater than 2 are available to the
+   * child process only if the child processes uses the MSVCRT runtime.
+   */
+  int stdio_count;
+  uv_stdio_container_t* stdio;
+  /*
+   * Libuv can change the child process' user/group id. This happens only when
+   * the appropriate bits are set in the flags fields. This is not supported on
+   * windows; uv_spawn() will fail and set the error to UV_ENOTSUP.
+   */
+  uv_uid_t uid;
+  uv_gid_t gid;
+} uv_process_options_t;
+
+/*
+ * These are the flags that can be used for the uv_process_options.flags field.
+ */
+enum uv_process_flags {
+  /*
+   * Set the child process' user id. The user id is supplied in the `uid` field
+   * of the options struct. This does not work on windows; setting this flag
+   * will cause uv_spawn() to fail.
+   */
+  UV_PROCESS_SETUID = (1 << 0),
+  /*
+   * Set the child process' group id. The user id is supplied in the `gid`
+   * field of the options struct. This does not work on windows; setting this
+   * flag will cause uv_spawn() to fail.
+   */
+  UV_PROCESS_SETGID = (1 << 1),
+  /*
+   * Do not wrap any arguments in quotes, or perform any other escaping, when
+   * converting the argument list into a command line string. This option is
+   * only meaningful on Windows systems. On Unix it is silently ignored.
+   */
+  UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = (1 << 2),
+  /*
+   * Spawn the child process in a detached state - this will make it a process
+   * group leader, and will effectively enable the child to keep running after
+   * the parent exits.  Note that the child process will still keep the
+   * parent's event loop alive unless the parent process calls uv_unref() on
+   * the child's process handle.
+   */
+  UV_PROCESS_DETACHED = (1 << 3),
+  /*
+   * Hide the subprocess console window that would normally be created. This
+   * option is only meaningful on Windows systems. On Unix it is silently
+   * ignored.
+   */
+  UV_PROCESS_WINDOWS_HIDE = (1 << 4)
+};
+
+/*
+ * uv_process_t is a subclass of uv_handle_t.
+ */
+struct uv_process_s {
+  UV_HANDLE_FIELDS
+  uv_exit_cb exit_cb;
+  int pid;
+  UV_PROCESS_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_spawn(uv_loop_t* loop,
+                       uv_process_t* handle,
+                       const uv_process_options_t* options);
+UV_EXTERN int uv_process_kill(uv_process_t*, int signum);
+UV_EXTERN int uv_kill(int pid, int signum);
+
+
+/*
+ * uv_work_t is a subclass of uv_req_t.
+ */
+struct uv_work_s {
+  UV_REQ_FIELDS
+  uv_loop_t* loop;
+  uv_work_cb work_cb;
+  uv_after_work_cb after_work_cb;
+  UV_WORK_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_queue_work(uv_loop_t* loop,
+                            uv_work_t* req,
+                            uv_work_cb work_cb,
+                            uv_after_work_cb after_work_cb);
+
+UV_EXTERN int uv_cancel(uv_req_t* req);
+#if defined(__NUTTX__) || defined(__TUV_RAW__) || defined(__TIZENRT__)
+// For embed systems that need cleanup before exit
+UV_EXTERN void tuv_cleanup(void);
+#endif
+
+struct uv_cpu_info_s {
+  char* model;
+  int speed;
+  struct uv_cpu_times_s {
+    uint64_t user;
+    uint64_t nice;
+    uint64_t sys;
+    uint64_t idle;
+    uint64_t irq;
+  } cpu_times;
+};
+
+struct uv_interface_address_s {
+  char* name;
+  char phys_addr[6];
+  int is_internal;
+  union {
+    struct sockaddr_in address4;
+    struct sockaddr_in6 address6;
+  } address;
+  union {
+    struct sockaddr_in netmask4;
+    struct sockaddr_in6 netmask6;
+  } netmask;
+};
+
+struct uv_passwd_s {
+  char* username;
+  long uid;
+  long gid;
+  char* shell;
+  char* homedir;
+};
+
+typedef enum {
+  UV_DIRENT_UNKNOWN,
+  UV_DIRENT_FILE,
+  UV_DIRENT_DIR,
+  UV_DIRENT_LINK,
+  UV_DIRENT_FIFO,
+  UV_DIRENT_SOCKET,
+  UV_DIRENT_CHAR,
+  UV_DIRENT_BLOCK
+} uv_dirent_type_t;
+
+struct uv_dirent_s {
+  const char* name;
+  uv_dirent_type_t type;
+};
+
+UV_EXTERN int uv_resident_set_memory(size_t* rss);
+UV_EXTERN int uv_uptime(double* uptime);
+
+typedef struct {
+  long tv_sec;
+  long tv_usec;
+} uv_timeval_t;
+
+typedef struct {
+   uv_timeval_t ru_utime; /* user CPU time used */
+   uv_timeval_t ru_stime; /* system CPU time used */
+   uint64_t ru_maxrss;    /* maximum resident set size */
+   uint64_t ru_ixrss;     /* integral shared memory size */
+   uint64_t ru_idrss;     /* integral unshared data size */
+   uint64_t ru_isrss;     /* integral unshared stack size */
+   uint64_t ru_minflt;    /* page reclaims (soft page faults) */
+   uint64_t ru_majflt;    /* page faults (hard page faults) */
+   uint64_t ru_nswap;     /* swaps */
+   uint64_t ru_inblock;   /* block input operations */
+   uint64_t ru_oublock;   /* block output operations */
+   uint64_t ru_msgsnd;    /* IPC messages sent */
+   uint64_t ru_msgrcv;    /* IPC messages received */
+   uint64_t ru_nsignals;  /* signals received */
+   uint64_t ru_nvcsw;     /* voluntary context switches */
+   uint64_t ru_nivcsw;    /* involuntary context switches */
+} uv_rusage_t;
+
+UV_EXTERN int uv_getrusage(uv_rusage_t* rusage);
+
+UV_EXTERN int uv_os_homedir(char* buffer, size_t* size);
+UV_EXTERN int uv_os_tmpdir(char* buffer, size_t* size);
+UV_EXTERN int uv_os_get_passwd(uv_passwd_t* pwd);
+UV_EXTERN void uv_os_free_passwd(uv_passwd_t* pwd);
+
+UV_EXTERN int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count);
+UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count);
+
+UV_EXTERN int uv_interface_addresses(uv_interface_address_t** addresses,
+                                     int* count);
+UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t* addresses,
+                                           int count);
+
+
+typedef enum {
+  UV_FS_UNKNOWN = -1,
+  UV_FS_CUSTOM,
+  UV_FS_OPEN,
+  UV_FS_CLOSE,
+  UV_FS_READ,
+  UV_FS_WRITE,
+  UV_FS_SENDFILE,
+  UV_FS_STAT,
+  UV_FS_LSTAT,
+  UV_FS_FSTAT,
+  UV_FS_FTRUNCATE,
+  UV_FS_UTIME,
+  UV_FS_FUTIME,
+  UV_FS_ACCESS,
+  UV_FS_CHMOD,
+  UV_FS_FCHMOD,
+  UV_FS_FSYNC,
+  UV_FS_FDATASYNC,
+  UV_FS_UNLINK,
+  UV_FS_RMDIR,
+  UV_FS_MKDIR,
+  UV_FS_MKDTEMP,
+  UV_FS_RENAME,
+  UV_FS_SCANDIR,
+  UV_FS_LINK,
+  UV_FS_SYMLINK,
+  UV_FS_READLINK,
+  UV_FS_CHOWN,
+  UV_FS_FCHOWN,
+  UV_FS_REALPATH
+} uv_fs_type;
+
+/* uv_fs_t is a subclass of uv_req_t. */
+struct uv_fs_s {
+  UV_REQ_FIELDS
+  uv_fs_type fs_type;
+  uv_loop_t* loop;
+  uv_fs_cb cb;
+  ssize_t result;
+  void* ptr;
+  const char* path;
+  uv_stat_t statbuf;  /* Stores the result of uv_fs_stat() and uv_fs_fstat(). */
+  UV_FS_PRIVATE_FIELDS
+};
+
+UV_EXTERN void uv_fs_req_cleanup(uv_fs_t* req);
+UV_EXTERN int uv_fs_close(uv_loop_t* loop,
+                          uv_fs_t* req,
+                          uv_file file,
+                          uv_fs_cb cb);
+UV_EXTERN int uv_fs_open(uv_loop_t* loop,
+                         uv_fs_t* req,
+                         const char* path,
+                         int flags,
+                         int mode,
+                         uv_fs_cb cb);
+UV_EXTERN int uv_fs_read(uv_loop_t* loop,
+                         uv_fs_t* req,
+                         uv_file file,
+                         const uv_buf_t bufs[],
+                         unsigned int nbufs,
+                         int64_t offset,
+                         uv_fs_cb cb);
+UV_EXTERN int uv_fs_unlink(uv_loop_t* loop,
+                           uv_fs_t* req,
+                           const char* path,
+                           uv_fs_cb cb);
+UV_EXTERN int uv_fs_write(uv_loop_t* loop,
+                          uv_fs_t* req,
+                          uv_file file,
+                          const uv_buf_t bufs[],
+                          unsigned int nbufs,
+                          int64_t offset,
+                          uv_fs_cb cb);
+UV_EXTERN int uv_fs_mkdir(uv_loop_t* loop,
+                          uv_fs_t* req,
+                          const char* path,
+                          int mode,
+                          uv_fs_cb cb);
+UV_EXTERN int uv_fs_mkdtemp(uv_loop_t* loop,
+                            uv_fs_t* req,
+                            const char* tpl,
+                            uv_fs_cb cb);
+UV_EXTERN int uv_fs_rmdir(uv_loop_t* loop,
+                          uv_fs_t* req,
+                          const char* path,
+                          uv_fs_cb cb);
+UV_EXTERN int uv_fs_scandir(uv_loop_t* loop,
+                            uv_fs_t* req,
+                            const char* path,
+                            int flags,
+                            uv_fs_cb cb);
+UV_EXTERN int uv_fs_scandir_next(uv_fs_t* req,
+                                 uv_dirent_t* ent);
+UV_EXTERN int uv_fs_stat(uv_loop_t* loop,
+                         uv_fs_t* req,
+                         const char* path,
+                         uv_fs_cb cb);
+UV_EXTERN int uv_fs_fstat(uv_loop_t* loop,
+                          uv_fs_t* req,
+                          uv_file file,
+                          uv_fs_cb cb);
+UV_EXTERN int uv_fs_rename(uv_loop_t* loop,
+                           uv_fs_t* req,
+                           const char* path,
+                           const char* new_path,
+                           uv_fs_cb cb);
+UV_EXTERN int uv_fs_fsync(uv_loop_t* loop,
+                          uv_fs_t* req,
+                          uv_file file,
+                          uv_fs_cb cb);
+UV_EXTERN int uv_fs_fdatasync(uv_loop_t* loop,
+                              uv_fs_t* req,
+                              uv_file file,
+                              uv_fs_cb cb);
+UV_EXTERN int uv_fs_ftruncate(uv_loop_t* loop,
+                              uv_fs_t* req,
+                              uv_file file,
+                              int64_t offset,
+                              uv_fs_cb cb);
+UV_EXTERN int uv_fs_sendfile(uv_loop_t* loop,
+                             uv_fs_t* req,
+                             uv_file out_fd,
+                             uv_file in_fd,
+                             int64_t in_offset,
+                             size_t length,
+                             uv_fs_cb cb);
+UV_EXTERN int uv_fs_access(uv_loop_t* loop,
+                           uv_fs_t* req,
+                           const char* path,
+                           int mode,
+                           uv_fs_cb cb);
+UV_EXTERN int uv_fs_chmod(uv_loop_t* loop,
+                          uv_fs_t* req,
+                          const char* path,
+                          int mode,
+                          uv_fs_cb cb);
+UV_EXTERN int uv_fs_utime(uv_loop_t* loop,
+                          uv_fs_t* req,
+                          const char* path,
+                          double atime,
+                          double mtime,
+                          uv_fs_cb cb);
+UV_EXTERN int uv_fs_futime(uv_loop_t* loop,
+                           uv_fs_t* req,
+                           uv_file file,
+                           double atime,
+                           double mtime,
+                           uv_fs_cb cb);
+UV_EXTERN int uv_fs_lstat(uv_loop_t* loop,
+                          uv_fs_t* req,
+                          const char* path,
+                          uv_fs_cb cb);
+UV_EXTERN int uv_fs_link(uv_loop_t* loop,
+                         uv_fs_t* req,
+                         const char* path,
+                         const char* new_path,
+                         uv_fs_cb cb);
+
+/*
+ * This flag can be used with uv_fs_symlink() on Windows to specify whether
+ * path argument points to a directory.
+ */
+#define UV_FS_SYMLINK_DIR          0x0001
+
+/*
+ * This flag can be used with uv_fs_symlink() on Windows to specify whether
+ * the symlink is to be created using junction points.
+ */
+#define UV_FS_SYMLINK_JUNCTION     0x0002
+
+UV_EXTERN int uv_fs_symlink(uv_loop_t* loop,
+                            uv_fs_t* req,
+                            const char* path,
+                            const char* new_path,
+                            int flags,
+                            uv_fs_cb cb);
+UV_EXTERN int uv_fs_readlink(uv_loop_t* loop,
+                             uv_fs_t* req,
+                             const char* path,
+                             uv_fs_cb cb);
+UV_EXTERN int uv_fs_realpath(uv_loop_t* loop,
+                             uv_fs_t* req,
+                             const char* path,
+                             uv_fs_cb cb);
+UV_EXTERN int uv_fs_fchmod(uv_loop_t* loop,
+                           uv_fs_t* req,
+                           uv_file file,
+                           int mode,
+                           uv_fs_cb cb);
+UV_EXTERN int uv_fs_chown(uv_loop_t* loop,
+                          uv_fs_t* req,
+                          const char* path,
+                          uv_uid_t uid,
+                          uv_gid_t gid,
+                          uv_fs_cb cb);
+UV_EXTERN int uv_fs_fchown(uv_loop_t* loop,
+                           uv_fs_t* req,
+                           uv_file file,
+                           uv_uid_t uid,
+                           uv_gid_t gid,
+                           uv_fs_cb cb);
+
+
+enum uv_fs_event {
+  UV_RENAME = 1,
+  UV_CHANGE = 2
+};
+
+
+struct uv_fs_event_s {
+  UV_HANDLE_FIELDS
+  /* private */
+  char* path;
+  UV_FS_EVENT_PRIVATE_FIELDS
+};
+
+
+/*
+ * uv_fs_stat() based polling file watcher.
+ */
+struct uv_fs_poll_s {
+  UV_HANDLE_FIELDS
+  /* Private, don't touch. */
+  void* poll_ctx;
+};
+
+UV_EXTERN int uv_fs_poll_init(uv_loop_t* loop, uv_fs_poll_t* handle);
+UV_EXTERN int uv_fs_poll_start(uv_fs_poll_t* handle,
+                               uv_fs_poll_cb poll_cb,
+                               const char* path,
+                               unsigned int interval);
+UV_EXTERN int uv_fs_poll_stop(uv_fs_poll_t* handle);
+UV_EXTERN int uv_fs_poll_getpath(uv_fs_poll_t* handle,
+                                 char* buffer,
+                                 size_t* size);
+
+
+struct uv_signal_s {
+  UV_HANDLE_FIELDS
+  uv_signal_cb signal_cb;
+  int signum;
+  UV_SIGNAL_PRIVATE_FIELDS
+};
+
+UV_EXTERN int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle);
+UV_EXTERN int uv_signal_start(uv_signal_t* handle,
+                              uv_signal_cb signal_cb,
+                              int signum);
+UV_EXTERN int uv_signal_stop(uv_signal_t* handle);
+
+UV_EXTERN void uv_loadavg(double avg[3]);
+
+
+/*
+ * Flags to be passed to uv_fs_event_start().
+ */
+enum uv_fs_event_flags {
+  /*
+   * By default, if the fs event watcher is given a directory name, we will
+   * watch for all events in that directory. This flags overrides this behavior
+   * and makes fs_event report only changes to the directory entry itself. This
+   * flag does not affect individual files watched.
+   * This flag is currently not implemented yet on any backend.
+   */
+  UV_FS_EVENT_WATCH_ENTRY = 1,
+
+  /*
+   * By default uv_fs_event will try to use a kernel interface such as inotify
+   * or kqueue to detect events. This may not work on remote filesystems such
+   * as NFS mounts. This flag makes fs_event fall back to calling stat() on a
+   * regular interval.
+   * This flag is currently not implemented yet on any backend.
+   */
+  UV_FS_EVENT_STAT = 2,
+
+  /*
+   * By default, event watcher, when watching directory, is not registering
+   * (is ignoring) changes in it's subdirectories.
+   * This flag will override this behaviour on platforms that support it.
+   */
+  UV_FS_EVENT_RECURSIVE = 4
+};
+
+
+UV_EXTERN int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle);
+UV_EXTERN int uv_fs_event_start(uv_fs_event_t* handle,
+                                uv_fs_event_cb cb,
+                                const char* path,
+                                unsigned int flags);
+UV_EXTERN int uv_fs_event_stop(uv_fs_event_t* handle);
+UV_EXTERN int uv_fs_event_getpath(uv_fs_event_t* handle,
+                                  char* buffer,
+                                  size_t* size);
+
+UV_EXTERN int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr);
+UV_EXTERN int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr);
+
+UV_EXTERN int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size);
+UV_EXTERN int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size);
+
+UV_EXTERN int uv_inet_ntop(int af, const void* src, char* dst, size_t size);
+UV_EXTERN int uv_inet_pton(int af, const char* src, void* dst);
+
+UV_EXTERN int uv_exepath(char* buffer, size_t* size);
+
+UV_EXTERN int uv_cwd(char* buffer, size_t* size);
+
+UV_EXTERN int uv_chdir(const char* dir);
+
+UV_EXTERN uint64_t uv_get_free_memory(void);
+UV_EXTERN uint64_t uv_get_total_memory(void);
+
+UV_EXTERN uint64_t uv_hrtime(void);
+
+UV_EXTERN void uv_disable_stdio_inheritance(void);
+
+UV_EXTERN int uv_dlopen(const char* filename, uv_lib_t* lib);
+UV_EXTERN void uv_dlclose(uv_lib_t* lib);
+UV_EXTERN int uv_dlsym(uv_lib_t* lib, const char* name, void** ptr);
+UV_EXTERN const char* uv_dlerror(const uv_lib_t* lib);
+
+UV_EXTERN int uv_mutex_init(uv_mutex_t* handle);
+UV_EXTERN void uv_mutex_destroy(uv_mutex_t* handle);
+UV_EXTERN void uv_mutex_lock(uv_mutex_t* handle);
+UV_EXTERN int uv_mutex_trylock(uv_mutex_t* handle);
+UV_EXTERN void uv_mutex_unlock(uv_mutex_t* handle);
+
+UV_EXTERN int uv_rwlock_init(uv_rwlock_t* rwlock);
+UV_EXTERN void uv_rwlock_destroy(uv_rwlock_t* rwlock);
+UV_EXTERN void uv_rwlock_rdlock(uv_rwlock_t* rwlock);
+UV_EXTERN int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock);
+UV_EXTERN void uv_rwlock_rdunlock(uv_rwlock_t* rwlock);
+UV_EXTERN void uv_rwlock_wrlock(uv_rwlock_t* rwlock);
+UV_EXTERN int uv_rwlock_trywrlock(uv_rwlock_t* rwlock);
+UV_EXTERN void uv_rwlock_wrunlock(uv_rwlock_t* rwlock);
+
+UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value);
+UV_EXTERN void uv_sem_destroy(uv_sem_t* sem);
+UV_EXTERN void uv_sem_post(uv_sem_t* sem);
+UV_EXTERN void uv_sem_wait(uv_sem_t* sem);
+UV_EXTERN int uv_sem_trywait(uv_sem_t* sem);
+
+UV_EXTERN int uv_cond_init(uv_cond_t* cond);
+UV_EXTERN void uv_cond_destroy(uv_cond_t* cond);
+UV_EXTERN void uv_cond_signal(uv_cond_t* cond);
+UV_EXTERN void uv_cond_broadcast(uv_cond_t* cond);
+
+UV_EXTERN int uv_barrier_init(uv_barrier_t* barrier, unsigned int count);
+UV_EXTERN void uv_barrier_destroy(uv_barrier_t* barrier);
+UV_EXTERN int uv_barrier_wait(uv_barrier_t* barrier);
+
+UV_EXTERN void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex);
+UV_EXTERN int uv_cond_timedwait(uv_cond_t* cond,
+                                uv_mutex_t* mutex,
+                                uint64_t timeout);
+
+UV_EXTERN void uv_once(uv_once_t* guard, void (*callback)(void));
+
+UV_EXTERN int uv_key_create(uv_key_t* key);
+UV_EXTERN void uv_key_delete(uv_key_t* key);
+UV_EXTERN void* uv_key_get(uv_key_t* key);
+UV_EXTERN void uv_key_set(uv_key_t* key, void* value);
+
+typedef void (*uv_thread_cb)(void* arg);
+
+UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg);
+UV_EXTERN uv_thread_t uv_thread_self(void);
+UV_EXTERN int uv_thread_join(uv_thread_t *tid);
+UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2);
+
+/* The presence of these unions force similar struct layout. */
+#define XX(_, name) uv_ ## name ## _t name;
+union uv_any_handle {
+  UV_HANDLE_TYPE_MAP(XX)
+};
+
+union uv_any_req {
+  UV_REQ_TYPE_MAP(XX)
+};
+#undef XX
+
+
+struct uv_loop_s {
+  /* User data - use this for whatever. */
+  void* data;
+  /* Loop reference counting. */
+  unsigned int active_handles;
+  void* handle_queue[2];
+  void* active_reqs[2];
+  /* Internal flag to signal loop stop. */
+  unsigned int stop_flag;
+  UV_LOOP_PRIVATE_FIELDS
+};
+
+/* Pause the calling thread for a number of milliseconds. */
+UV_EXTERN void uv_sleep(int msec);
+
+/* Don't export the private CPP symbols. */
+#undef UV_HANDLE_TYPE_PRIVATE
+#undef UV_REQ_TYPE_PRIVATE
+#undef UV_REQ_PRIVATE_FIELDS
+#undef UV_STREAM_PRIVATE_FIELDS
+#undef UV_TCP_PRIVATE_FIELDS
+#undef UV_PREPARE_PRIVATE_FIELDS
+#undef UV_CHECK_PRIVATE_FIELDS
+#undef UV_IDLE_PRIVATE_FIELDS
+#undef UV_ASYNC_PRIVATE_FIELDS
+#undef UV_TIMER_PRIVATE_FIELDS
+#undef UV_GETADDRINFO_PRIVATE_FIELDS
+#undef UV_GETNAMEINFO_PRIVATE_FIELDS
+#undef UV_FS_REQ_PRIVATE_FIELDS
+#undef UV_WORK_PRIVATE_FIELDS
+#undef UV_FS_EVENT_PRIVATE_FIELDS
+#undef UV_SIGNAL_PRIVATE_FIELDS
+#undef UV_LOOP_PRIVATE_FIELDS
+#undef UV_LOOP_PRIVATE_PLATFORM_FIELDS
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* UV_H */
diff --git a/deps/libtuv/src/fs-poll.c b/deps/libtuv/src/fs-poll.c
new file mode 100644 (file)
index 0000000..ee73d5a
--- /dev/null
@@ -0,0 +1,256 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "uv-common.h"
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+
+struct poll_ctx {
+  uv_fs_poll_t* parent_handle; /* NULL if parent has been stopped or closed */
+  int busy_polling;
+  unsigned int interval;
+  uint64_t start_time;
+  uv_loop_t* loop;
+  uv_fs_poll_cb poll_cb;
+  uv_timer_t timer_handle;
+  uv_fs_t fs_req; /* TODO(bnoordhuis) mark fs_req internal */
+  uv_stat_t statbuf;
+  char path[1]; /* variable length */
+};
+
+static int statbuf_eq(const uv_stat_t* a, const uv_stat_t* b);
+static void poll_cb(uv_fs_t* req);
+static void timer_cb(uv_timer_t* timer);
+static void timer_close_cb(uv_handle_t* handle);
+
+static uv_stat_t zero_statbuf;
+
+
+int uv_fs_poll_init(uv_loop_t* loop, uv_fs_poll_t* handle) {
+  uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_POLL);
+  return 0;
+}
+
+
+int uv_fs_poll_start(uv_fs_poll_t* handle,
+                     uv_fs_poll_cb cb,
+                     const char* path,
+                     unsigned int interval) {
+  struct poll_ctx* ctx;
+  uv_loop_t* loop;
+  size_t len;
+  int err;
+
+  if (uv__is_active(handle))
+    return 0;
+
+  loop = handle->loop;
+  len = strlen(path);
+  ctx = uv__calloc(1, sizeof(*ctx) + len);
+
+  if (ctx == NULL)
+    return UV_ENOMEM;
+
+  ctx->loop = loop;
+  ctx->poll_cb = cb;
+  ctx->interval = interval ? interval : 1;
+  ctx->start_time = uv_now(loop);
+  ctx->parent_handle = handle;
+  memcpy(ctx->path, path, len + 1);
+
+  err = uv_timer_init(loop, &ctx->timer_handle);
+  if (err < 0)
+    goto error;
+
+  ctx->timer_handle.flags |= UV__HANDLE_INTERNAL;
+  uv__handle_unref(&ctx->timer_handle);
+
+  err = uv_fs_stat(loop, &ctx->fs_req, ctx->path, poll_cb);
+  if (err < 0)
+    goto error;
+
+  handle->poll_ctx = ctx;
+  uv__handle_start(handle);
+
+  return 0;
+
+error:
+  uv__free(ctx);
+  return err;
+}
+
+
+int uv_fs_poll_stop(uv_fs_poll_t* handle) {
+  struct poll_ctx* ctx;
+
+  if (!uv__is_active(handle))
+    return 0;
+
+  ctx = handle->poll_ctx;
+  assert(ctx != NULL);
+  assert(ctx->parent_handle != NULL);
+  ctx->parent_handle = NULL;
+  handle->poll_ctx = NULL;
+
+  /* Close the timer if it's active. If it's inactive, there's a stat request
+   * in progress and poll_cb will take care of the cleanup.
+   */
+  if (uv__is_active(&ctx->timer_handle))
+    uv_close((uv_handle_t*)&ctx->timer_handle, timer_close_cb);
+
+  uv__handle_stop(handle);
+
+  return 0;
+}
+
+
+int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buffer, size_t* size) {
+  struct poll_ctx* ctx;
+  size_t required_len;
+
+  if (!uv__is_active(handle)) {
+    *size = 0;
+    return UV_EINVAL;
+  }
+
+  ctx = handle->poll_ctx;
+  assert(ctx != NULL);
+
+  required_len = strlen(ctx->path);
+  if (required_len >= *size) {
+    *size = required_len + 1;
+    return UV_ENOBUFS;
+  }
+
+  memcpy(buffer, ctx->path, required_len);
+  *size = required_len;
+  buffer[required_len] = '\0';
+
+  return 0;
+}
+
+
+void uv__fs_poll_close(uv_fs_poll_t* handle) {
+  uv_fs_poll_stop(handle);
+}
+
+
+static void timer_cb(uv_timer_t* timer) {
+  struct poll_ctx* ctx;
+
+  ctx = container_of(timer, struct poll_ctx, timer_handle);
+  assert(ctx->parent_handle != NULL);
+  assert(ctx->parent_handle->poll_ctx == ctx);
+  ctx->start_time = uv_now(ctx->loop);
+
+  if (uv_fs_stat(ctx->loop, &ctx->fs_req, ctx->path, poll_cb))
+    abort();
+}
+
+
+static void poll_cb(uv_fs_t* req) {
+  uv_stat_t* statbuf;
+  struct poll_ctx* ctx;
+  uint64_t interval;
+
+  ctx = container_of(req, struct poll_ctx, fs_req);
+
+  if (ctx->parent_handle == NULL) { /* handle has been stopped or closed */
+    uv_close((uv_handle_t*)&ctx->timer_handle, timer_close_cb);
+    uv_fs_req_cleanup(req);
+    return;
+  }
+
+  if (req->result != 0) {
+    if (ctx->busy_polling != req->result) {
+      ctx->poll_cb(ctx->parent_handle,
+                   req->result,
+                   &ctx->statbuf,
+                   &zero_statbuf);
+      ctx->busy_polling = req->result;
+    }
+    goto out;
+  }
+
+  statbuf = &req->statbuf;
+
+  if (ctx->busy_polling != 0)
+    if (ctx->busy_polling < 0 || !statbuf_eq(&ctx->statbuf, statbuf))
+      ctx->poll_cb(ctx->parent_handle, 0, &ctx->statbuf, statbuf);
+
+  ctx->statbuf = *statbuf;
+  ctx->busy_polling = 1;
+
+out:
+  uv_fs_req_cleanup(req);
+
+  if (ctx->parent_handle == NULL) { /* handle has been stopped by callback */
+    uv_close((uv_handle_t*)&ctx->timer_handle, timer_close_cb);
+    return;
+  }
+
+  /* Reschedule timer, subtract the delay from doing the stat(). */
+  interval = ctx->interval;
+  interval -= (uv_now(ctx->loop) - ctx->start_time) % interval;
+
+  if (uv_timer_start(&ctx->timer_handle, timer_cb, interval, 0))
+    abort();
+}
+
+
+static void timer_close_cb(uv_handle_t* handle) {
+  uv__free(container_of(handle, struct poll_ctx, timer_handle));
+}
+
+
+static int statbuf_eq(const uv_stat_t* a, const uv_stat_t* b) {
+  return a->st_ctim.tv_nsec == b->st_ctim.tv_nsec
+      && a->st_mtim.tv_nsec == b->st_mtim.tv_nsec
+      && a->st_birthtim.tv_nsec == b->st_birthtim.tv_nsec
+      && a->st_ctim.tv_sec == b->st_ctim.tv_sec
+      && a->st_mtim.tv_sec == b->st_mtim.tv_sec
+      && a->st_birthtim.tv_sec == b->st_birthtim.tv_sec
+      && a->st_size == b->st_size
+      && a->st_mode == b->st_mode
+      && a->st_uid == b->st_uid
+      && a->st_gid == b->st_gid
+      && a->st_ino == b->st_ino
+      && a->st_dev == b->st_dev
+      && a->st_flags == b->st_flags
+      && a->st_gen == b->st_gen;
+}
+
+
+#if defined(_WIN32)
+
+#include "win/internal.h"
+#include "win/handle-inl.h"
+
+void uv__fs_poll_endgame(uv_loop_t* loop, uv_fs_poll_t* handle) {
+  assert(handle->flags & UV__HANDLE_CLOSING);
+  assert(!(handle->flags & UV_HANDLE_CLOSED));
+  uv__handle_close(handle);
+}
+
+#endif /* _WIN32 */
diff --git a/deps/libtuv/src/heap-inl.h b/deps/libtuv/src/heap-inl.h
new file mode 100644 (file)
index 0000000..12716cb
--- /dev/null
@@ -0,0 +1,343 @@
+/* Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef UV_SRC_HEAP_H_
+#define UV_SRC_HEAP_H_
+
+#include <stddef.h>  /* NULL */
+
+#if defined(__GNUC__)
+# define HEAP_EXPORT(declaration) __attribute__((unused)) static declaration
+#else
+# define HEAP_EXPORT(declaration) static declaration
+#endif
+
+#ifdef TUV_ENABLE_MEMORY_CONSTRAINTS
+struct heap_node {
+  struct heap_node* next;
+};
+
+struct heap {
+  struct heap_node* min; /* head */
+  unsigned int nelts; /* number of elements */
+};
+
+/* Return non-zero if a < b. */
+typedef int (*heap_compare_fn)(const struct heap_node* a,
+                               const struct heap_node* b);
+
+/* Public functions. */
+HEAP_EXPORT(void heap_init(struct heap* heap));
+HEAP_EXPORT(struct heap_node* heap_min(const struct heap* heap));
+HEAP_EXPORT(void heap_insert(struct heap* heap,
+                             struct heap_node* newnode,
+                             heap_compare_fn less_than));
+HEAP_EXPORT(void heap_remove(struct heap* heap,
+                             struct heap_node* node));
+
+/* Implementation follows. */
+
+HEAP_EXPORT(void heap_init(struct heap* heap)) {
+  heap->min = NULL;
+  heap->nelts = 0;
+}
+
+HEAP_EXPORT(struct heap_node* heap_min(const struct heap* heap)) {
+  return heap->min;
+}
+
+HEAP_EXPORT(void heap_insert(struct heap* heap,
+                             struct heap_node* newnode,
+                             heap_compare_fn less_than)) {
+  struct heap_node* curr = heap->min;
+
+  if (curr == NULL || less_than(newnode, curr))
+  {
+    /* Update head */
+    newnode->next = curr;
+    heap->min = newnode;
+    heap->nelts++;
+    return;
+  }
+
+  while (curr->next != NULL)
+  {
+    if (less_than(newnode, curr->next))
+    {
+      newnode->next = curr->next;
+      curr->next = newnode;
+      heap->nelts++;
+      return;
+    }
+
+    curr = curr->next;
+  }
+
+  /* Insert to the end of the list */
+  curr->next = newnode;
+  newnode->next = NULL;
+  heap->nelts++;
+}
+
+HEAP_EXPORT(void heap_remove(struct heap* heap,
+                             struct heap_node* node)) {
+  struct heap_node* curr = heap->min;
+
+  if (curr == NULL)
+  {
+    return;
+  }
+
+  if (curr == node)
+  {
+    heap->min = heap->min->next;
+    return;
+  }
+
+  while (curr->next != NULL)
+  {
+    if (curr->next == node)
+    {
+      curr->next = curr->next->next;
+      break;
+    }
+
+    curr = curr->next;
+  }
+}
+
+#else /* original libuv code */
+
+struct heap_node {
+  struct heap_node* left;
+  struct heap_node* right;
+  struct heap_node* parent;
+};
+
+/* A binary min heap.  The usual properties hold: the root is the lowest
+ * element in the set, the height of the tree is at most log2(nodes) and
+ * it's always a complete binary tree.
+ *
+ * The heap function try hard to detect corrupted tree nodes at the cost
+ * of a minor reduction in performance.  Compile with -DNDEBUG to disable.
+ */
+struct heap {
+  struct heap_node* min;
+  unsigned int nelts;
+};
+
+/* Return non-zero if a < b. */
+typedef int (*heap_compare_fn)(const struct heap_node* a,
+                               const struct heap_node* b);
+
+/* Public functions. */
+HEAP_EXPORT(void heap_init(struct heap* heap));
+HEAP_EXPORT(struct heap_node* heap_min(const struct heap* heap));
+HEAP_EXPORT(void heap_insert(struct heap* heap,
+                             struct heap_node* newnode,
+                             heap_compare_fn less_than));
+HEAP_EXPORT(void heap_remove(struct heap* heap,
+                             struct heap_node* node,
+                             heap_compare_fn less_than));
+HEAP_EXPORT(void heap_dequeue(struct heap* heap, heap_compare_fn less_than));
+
+/* Implementation follows. */
+
+HEAP_EXPORT(void heap_init(struct heap* heap)) {
+  heap->min = NULL;
+  heap->nelts = 0;
+}
+
+HEAP_EXPORT(struct heap_node* heap_min(const struct heap* heap)) {
+  return heap->min;
+}
+
+/* Swap parent with child. Child moves closer to the root, parent moves away. */
+static void heap_node_swap(struct heap* heap,
+                           struct heap_node* parent,
+                           struct heap_node* child) {
+  struct heap_node* sibling;
+  struct heap_node t;
+
+  t = *parent;
+  *parent = *child;
+  *child = t;
+
+  parent->parent = child;
+  if (child->left == child) {
+    child->left = parent;
+    sibling = child->right;
+  } else {
+    child->right = parent;
+    sibling = child->left;
+  }
+  if (sibling != NULL)
+    sibling->parent = child;
+
+  if (parent->left != NULL)
+    parent->left->parent = parent;
+  if (parent->right != NULL)
+    parent->right->parent = parent;
+
+  if (child->parent == NULL)
+    heap->min = child;
+  else if (child->parent->left == parent)
+    child->parent->left = child;
+  else
+    child->parent->right = child;
+}
+
+HEAP_EXPORT(void heap_insert(struct heap* heap,
+                             struct heap_node* newnode,
+                             heap_compare_fn less_than)) {
+  struct heap_node** parent;
+  struct heap_node** child;
+  unsigned int path;
+  unsigned int n;
+  unsigned int k;
+
+  newnode->left = NULL;
+  newnode->right = NULL;
+  newnode->parent = NULL;
+
+  /* Calculate the path from the root to the insertion point.  This is a min
+   * heap so we always insert at the left-most free node of the bottom row.
+   */
+  path = 0;
+  for (k = 0, n = 1 + heap->nelts; n >= 2; k += 1, n /= 2)
+    path = (path << 1) | (n & 1);
+
+  /* Now traverse the heap using the path we calculated in the previous step. */
+  parent = child = &heap->min;
+  while (k > 0) {
+    parent = child;
+    if (path & 1)
+      child = &(*child)->right;
+    else
+      child = &(*child)->left;
+    path >>= 1;
+    k -= 1;
+  }
+
+  /* Insert the new node. */
+  newnode->parent = *parent;
+  *child = newnode;
+  heap->nelts += 1;
+
+  /* Walk up the tree and check at each node if the heap property holds.
+   * It's a min heap so parent < child must be true.
+   */
+  while (newnode->parent != NULL && less_than(newnode, newnode->parent))
+    heap_node_swap(heap, newnode->parent, newnode);
+}
+
+HEAP_EXPORT(void heap_remove(struct heap* heap,
+                             struct heap_node* node,
+                             heap_compare_fn less_than)) {
+  struct heap_node* smallest;
+  struct heap_node** max;
+  struct heap_node* child;
+  unsigned int path;
+  unsigned int k;
+  unsigned int n;
+
+  if (heap->nelts == 0)
+    return;
+
+  /* Calculate the path from the min (the root) to the max, the left-most node
+   * of the bottom row.
+   */
+  path = 0;
+  for (k = 0, n = heap->nelts; n >= 2; k += 1, n /= 2)
+    path = (path << 1) | (n & 1);
+
+  /* Now traverse the heap using the path we calculated in the previous step. */
+  max = &heap->min;
+  while (k > 0) {
+    if (path & 1)
+      max = &(*max)->right;
+    else
+      max = &(*max)->left;
+    path >>= 1;
+    k -= 1;
+  }
+
+  heap->nelts -= 1;
+
+  /* Unlink the max node. */
+  child = *max;
+  *max = NULL;
+
+  if (child == node) {
+    /* We're removing either the max or the last node in the tree. */
+    if (child == heap->min) {
+      heap->min = NULL;
+    }
+    return;
+  }
+
+  /* Replace the to be deleted node with the max node. */
+  child->left = node->left;
+  child->right = node->right;
+  child->parent = node->parent;
+
+  if (child->left != NULL) {
+    child->left->parent = child;
+  }
+
+  if (child->right != NULL) {
+    child->right->parent = child;
+  }
+
+  if (node->parent == NULL) {
+    heap->min = child;
+  } else if (node->parent->left == node) {
+    node->parent->left = child;
+  } else {
+    node->parent->right = child;
+  }
+
+  /* Walk down the subtree and check at each node if the heap property holds.
+   * It's a min heap so parent < child must be true.  If the parent is bigger,
+   * swap it with the smallest child.
+   */
+  for (;;) {
+    smallest = child;
+    if (child->left != NULL && less_than(child->left, smallest))
+      smallest = child->left;
+    if (child->right != NULL && less_than(child->right, smallest))
+      smallest = child->right;
+    if (smallest == child)
+      break;
+    heap_node_swap(heap, child, smallest);
+  }
+
+  /* Walk up the subtree and check that each parent is less than the node
+   * this is required, because `max` node is not guaranteed to be the
+   * actual maximum in tree
+   */
+  while (child->parent != NULL && less_than(child, child->parent))
+    heap_node_swap(heap, child->parent, child);
+}
+
+HEAP_EXPORT(void heap_dequeue(struct heap* heap, heap_compare_fn less_than)) {
+  heap_remove(heap, heap->min, less_than);
+}
+
+#endif
+
+#undef HEAP_EXPORT
+
+#endif  /* UV_SRC_HEAP_H_ */
diff --git a/deps/libtuv/src/inet.c b/deps/libtuv/src/inet.c
new file mode 100644 (file)
index 0000000..b68438c
--- /dev/null
@@ -0,0 +1,129 @@
+/* Copyright 2015-2016 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.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#if defined(_MSC_VER) && _MSC_VER < 1600
+# include "stdint-msvc2008.h"
+#else
+# include <stdint.h>
+#endif
+
+#include "uv.h"
+#include "uv-common.h"
+
+#define UV__INET_ADDRSTRLEN         16
+#define UV__INET6_ADDRSTRLEN        46
+
+
+static int inet_ntop4(const unsigned char *src, char *dst, size_t size);
+static int inet_pton4(const char *src, unsigned char *dst);
+
+
+int uv_inet_ntop(int af, const void* src, char* dst, size_t size) {
+  switch (af) {
+  case AF_INET:
+    return (inet_ntop4(src, dst, size));
+  default:
+    return UV_EAFNOSUPPORT;
+  }
+  /* NOTREACHED */
+}
+
+
+static int inet_ntop4(const unsigned char *src, char *dst, size_t size) {
+  static const char fmt[] = "%u.%u.%u.%u";
+  char tmp[UV__INET_ADDRSTRLEN];
+  int l;
+
+  l = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
+  if (l <= 0 || (size_t) l >= size) {
+    return UV_ENOSPC;
+  }
+  strncpy(dst, tmp, size);
+  dst[size - 1] = '\0';
+  return 0;
+}
+
+
+int uv_inet_pton(int af, const char* src, void* dst) {
+  if (src == NULL || dst == NULL)
+    return UV_EINVAL;
+
+  switch (af) {
+  case AF_INET:
+    return (inet_pton4(src, dst));
+  default:
+    return UV_EAFNOSUPPORT;
+  }
+  /* NOTREACHED */
+}
+
+
+static int inet_pton4(const char *src, unsigned char *dst) {
+  static const char digits[] = "0123456789";
+  int saw_digit, octets, ch;
+  unsigned char tmp[sizeof(struct in_addr)], *tp;
+
+  saw_digit = 0;
+  octets = 0;
+  *(tp = tmp) = 0;
+  while ((ch = *src++) != '\0') {
+    const char *pch;
+
+    if ((pch = strchr(digits, ch)) != NULL) {
+      unsigned int nw = *tp * 10 + (pch - digits);
+
+      if (saw_digit && *tp == 0)
+        return UV_EINVAL;
+      if (nw > 255)
+        return UV_EINVAL;
+      *tp = nw;
+      if (!saw_digit) {
+        if (++octets > 4)
+          return UV_EINVAL;
+        saw_digit = 1;
+      }
+    } else if (ch == '.' && saw_digit) {
+      if (octets == 4)
+        return UV_EINVAL;
+      *++tp = 0;
+      saw_digit = 0;
+    } else
+      return UV_EINVAL;
+  }
+  if (octets < 4)
+    return UV_EINVAL;
+  memcpy(dst, tmp, sizeof(struct in_addr));
+  return 0;
+}
diff --git a/deps/libtuv/src/queue.h b/deps/libtuv/src/queue.h
new file mode 100644 (file)
index 0000000..ff3540a
--- /dev/null
@@ -0,0 +1,108 @@
+/* Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef QUEUE_H_
+#define QUEUE_H_
+
+#include <stddef.h>
+
+typedef void *QUEUE[2];
+
+/* Private macros. */
+#define QUEUE_NEXT(q)       (*(QUEUE **) &((*(q))[0]))
+#define QUEUE_PREV(q)       (*(QUEUE **) &((*(q))[1]))
+#define QUEUE_PREV_NEXT(q)  (QUEUE_NEXT(QUEUE_PREV(q)))
+#define QUEUE_NEXT_PREV(q)  (QUEUE_PREV(QUEUE_NEXT(q)))
+
+/* Public macros. */
+#define QUEUE_DATA(ptr, type, field)                                          \
+  ((type *) ((char *) (ptr) - offsetof(type, field)))
+
+/* Important note: mutating the list while QUEUE_FOREACH is
+ * iterating over its elements results in undefined behavior.
+ */
+#define QUEUE_FOREACH(q, h)                                                   \
+  for ((q) = QUEUE_NEXT(h); (q) != (h); (q) = QUEUE_NEXT(q))
+
+#define QUEUE_EMPTY(q)                                                        \
+  ((const QUEUE *) (q) == (const QUEUE *) QUEUE_NEXT(q))
+
+#define QUEUE_HEAD(q)                                                         \
+  (QUEUE_NEXT(q))
+
+#define QUEUE_INIT(q)                                                         \
+  do {                                                                        \
+    QUEUE_NEXT(q) = (q);                                                      \
+    QUEUE_PREV(q) = (q);                                                      \
+  }                                                                           \
+  while (0)
+
+#define QUEUE_ADD(h, n)                                                       \
+  do {                                                                        \
+    QUEUE_PREV_NEXT(h) = QUEUE_NEXT(n);                                       \
+    QUEUE_NEXT_PREV(n) = QUEUE_PREV(h);                                       \
+    QUEUE_PREV(h) = QUEUE_PREV(n);                                            \
+    QUEUE_PREV_NEXT(h) = (h);                                                 \
+  }                                                                           \
+  while (0)
+
+#define QUEUE_SPLIT(h, q, n)                                                  \
+  do {                                                                        \
+    QUEUE_PREV(n) = QUEUE_PREV(h);                                            \
+    QUEUE_PREV_NEXT(n) = (n);                                                 \
+    QUEUE_NEXT(n) = (q);                                                      \
+    QUEUE_PREV(h) = QUEUE_PREV(q);                                            \
+    QUEUE_PREV_NEXT(h) = (h);                                                 \
+    QUEUE_PREV(q) = (n);                                                      \
+  }                                                                           \
+  while (0)
+
+#define QUEUE_MOVE(h, n)                                                      \
+  do {                                                                        \
+    if (QUEUE_EMPTY(h))                                                       \
+      QUEUE_INIT(n);                                                          \
+    else {                                                                    \
+      QUEUE* q = QUEUE_HEAD(h);                                               \
+      QUEUE_SPLIT(h, q, n);                                                   \
+    }                                                                         \
+  }                                                                           \
+  while (0)
+
+#define QUEUE_INSERT_HEAD(h, q)                                               \
+  do {                                                                        \
+    QUEUE_NEXT(q) = QUEUE_NEXT(h);                                            \
+    QUEUE_PREV(q) = (h);                                                      \
+    QUEUE_NEXT_PREV(q) = (q);                                                 \
+    QUEUE_NEXT(h) = (q);                                                      \
+  }                                                                           \
+  while (0)
+
+#define QUEUE_INSERT_TAIL(h, q)                                               \
+  do {                                                                        \
+    QUEUE_NEXT(q) = (h);                                                      \
+    QUEUE_PREV(q) = QUEUE_PREV(h);                                            \
+    QUEUE_PREV_NEXT(q) = (q);                                                 \
+    QUEUE_PREV(h) = (q);                                                      \
+  }                                                                           \
+  while (0)
+
+#define QUEUE_REMOVE(q)                                                       \
+  do {                                                                        \
+    QUEUE_PREV_NEXT(q) = QUEUE_NEXT(q);                                       \
+    QUEUE_NEXT_PREV(q) = QUEUE_PREV(q);                                       \
+  }                                                                           \
+  while (0)
+
+#endif /* QUEUE_H_ */
diff --git a/deps/libtuv/src/threadpool.c b/deps/libtuv/src/threadpool.c
new file mode 100644 (file)
index 0000000..32b1001
--- /dev/null
@@ -0,0 +1,334 @@
+/* Copyright 2015-2017 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv-common.h"
+
+#if !defined(_WIN32)
+# include "unix/internal.h"
+#else
+# include "win/req-inl.h"
+/* TODO(saghul): unify internal req functions */
+static void uv__req_init(uv_loop_t* loop,
+                         uv_req_t* req,
+                         uv_req_type type) {
+  uv_req_init(loop, req);
+  req->type = type;
+  uv__req_register(loop, req);
+}
+# define uv__req_init(loop, req, type) \
+    uv__req_init((loop), (uv_req_t*)(req), (type))
+#endif
+
+#include <stdlib.h>
+
+#define MAX_THREADPOOL_SIZE 128
+
+static uv_once_t once = UV_ONCE_INIT;
+static uv_cond_t cond;
+static uv_mutex_t mutex;
+static unsigned int idle_threads;
+static unsigned int nthreads;
+static uv_thread_t* threads;
+static uv_thread_t default_threads[4];
+static QUEUE exit_message;
+static QUEUE wq;
+static volatile int initialized;
+
+
+static void uv__cancelled(struct uv__work* w) {
+  abort();
+}
+
+
+/* To avoid deadlock with uv_cancel() it's crucial that the worker
+ * never holds the global mutex and the loop-local mutex at the same time.
+ */
+static void worker(void* arg) {
+  struct uv__work* w;
+  QUEUE* q;
+
+  (void) arg;
+
+  for (;;) {
+    uv_mutex_lock(&mutex);
+
+    while (QUEUE_EMPTY(&wq)) {
+      idle_threads += 1;
+      uv_cond_wait(&cond, &mutex);
+      idle_threads -= 1;
+    }
+
+    q = QUEUE_HEAD(&wq);
+
+    if (q == &exit_message)
+      uv_cond_signal(&cond);
+    else {
+      QUEUE_REMOVE(q);
+      QUEUE_INIT(q);  /* Signal uv_cancel() that the work req is
+                             executing. */
+    }
+
+    uv_mutex_unlock(&mutex);
+
+    if (q == &exit_message)
+      break;
+
+    w = QUEUE_DATA(q, struct uv__work, wq);
+    w->work(w);
+
+    uv_mutex_lock(&w->loop->wq_mutex);
+    w->work = NULL;  /* Signal uv_cancel() that the work req is done
+                        executing. */
+    QUEUE_INSERT_TAIL(&w->loop->wq, &w->wq);
+    uv_async_send(&w->loop->wq_async);
+    uv_mutex_unlock(&w->loop->wq_mutex);
+  }
+}
+
+
+static void post(QUEUE* q) {
+  uv_mutex_lock(&mutex);
+  QUEUE_INSERT_TAIL(&wq, q);
+  if (idle_threads > 0)
+    uv_cond_signal(&cond);
+  uv_mutex_unlock(&mutex);
+}
+
+
+#ifndef _WIN32
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+static void cleanup(void) {
+#else
+UV_DESTRUCTOR(static void cleanup(void)) {
+#endif
+  unsigned int i;
+
+  if (initialized == 0)
+    return;
+
+  post(&exit_message);
+
+  for (i = 0; i < nthreads; i++)
+    if (uv_thread_join(threads + i))
+      abort();
+
+  if (threads != default_threads)
+    uv__free(threads);
+
+  uv_mutex_destroy(&mutex);
+  uv_cond_destroy(&cond);
+
+  threads = NULL;
+  nthreads = 0;
+  initialized = 0;
+  // tuv
+  // It is very important to initialize once again.
+  // Without following once initialization,
+  // test/run_pass/test_fs_xxx blocks on second running.
+  uv_once_t once_again = UV_ONCE_INIT;
+  once = once_again;
+}
+#endif
+
+
+static void init_once(void) {
+  unsigned int i;
+  const char* val;
+
+  nthreads = ARRAY_SIZE(default_threads);
+  val = getenv("UV_THREADPOOL_SIZE");
+  if (val != NULL)
+    nthreads = atoi(val);
+  if (nthreads == 0)
+    nthreads = 1;
+  if (nthreads > MAX_THREADPOOL_SIZE)
+    nthreads = MAX_THREADPOOL_SIZE;
+
+  threads = default_threads;
+  if (nthreads > ARRAY_SIZE(default_threads)) {
+    threads = uv__malloc(nthreads * sizeof(threads[0]));
+    if (threads == NULL) {
+      nthreads = ARRAY_SIZE(default_threads);
+      threads = default_threads;
+    }
+  }
+
+  if (uv_cond_init(&cond))
+    abort();
+
+  if (uv_mutex_init(&mutex))
+    abort();
+
+  QUEUE_INIT(&wq);
+
+  for (i = 0; i < nthreads; i++)
+    if (uv_thread_create(threads + i, worker, NULL))
+      abort();
+
+  initialized = 1;
+}
+
+
+void uv__work_submit(uv_loop_t* loop,
+                     struct uv__work* w,
+                     void (*work)(struct uv__work* w),
+                     void (*done)(struct uv__work* w, int status)) {
+  uv_once(&once, init_once);
+  w->loop = loop;
+  w->work = work;
+  w->done = done;
+  post(&w->wq);
+}
+
+
+static int uv__work_cancel(uv_loop_t* loop, uv_req_t* req, struct uv__work* w) {
+  int cancelled;
+
+  uv_mutex_lock(&mutex);
+  uv_mutex_lock(&w->loop->wq_mutex);
+
+  cancelled = !QUEUE_EMPTY(&w->wq) && w->work != NULL;
+  if (cancelled)
+    QUEUE_REMOVE(&w->wq);
+
+  uv_mutex_unlock(&w->loop->wq_mutex);
+  uv_mutex_unlock(&mutex);
+
+  if (!cancelled)
+    return UV_EBUSY;
+
+  w->work = uv__cancelled;
+  uv_mutex_lock(&loop->wq_mutex);
+  QUEUE_INSERT_TAIL(&loop->wq, &w->wq);
+  uv_async_send(&loop->wq_async);
+  uv_mutex_unlock(&loop->wq_mutex);
+
+  return 0;
+}
+
+
+void uv__work_done(uv_async_t* handle) {
+  struct uv__work* w;
+  uv_loop_t* loop;
+  QUEUE* q;
+  QUEUE wq;
+  int err;
+
+  loop = container_of(handle, uv_loop_t, wq_async);
+  uv_mutex_lock(&loop->wq_mutex);
+  QUEUE_MOVE(&loop->wq, &wq);
+  uv_mutex_unlock(&loop->wq_mutex);
+
+  while (!QUEUE_EMPTY(&wq)) {
+    q = QUEUE_HEAD(&wq);
+    QUEUE_REMOVE(q);
+
+    w = container_of(q, struct uv__work, wq);
+    err = (w->work == uv__cancelled) ? UV_ECANCELED : 0;
+    w->done(w, err);
+  }
+}
+
+
+static void uv__queue_work(struct uv__work* w) {
+  uv_work_t* req = container_of(w, uv_work_t, work_req);
+
+  req->work_cb(req);
+}
+
+
+static void uv__queue_done(struct uv__work* w, int err) {
+  uv_work_t* req;
+
+  req = container_of(w, uv_work_t, work_req);
+  uv__req_unregister(req->loop, req);
+
+  if (req->after_work_cb == NULL)
+    return;
+
+  req->after_work_cb(req, err);
+}
+
+
+int uv_queue_work(uv_loop_t* loop,
+                  uv_work_t* req,
+                  uv_work_cb work_cb,
+                  uv_after_work_cb after_work_cb) {
+  if (work_cb == NULL)
+    return UV_EINVAL;
+
+  uv__req_init(loop, req, UV_WORK);
+  req->loop = loop;
+  req->work_cb = work_cb;
+  req->after_work_cb = after_work_cb;
+  uv__work_submit(loop, &req->work_req, uv__queue_work, uv__queue_done);
+  return 0;
+}
+
+
+int uv_cancel(uv_req_t* req) {
+  struct uv__work* wreq;
+  uv_loop_t* loop;
+
+  switch (req->type) {
+  case UV_FS:
+    loop =  ((uv_fs_t*) req)->loop;
+    wreq = &((uv_fs_t*) req)->work_req;
+    break;
+  case UV_GETADDRINFO:
+    loop =  ((uv_getaddrinfo_t*) req)->loop;
+    wreq = &((uv_getaddrinfo_t*) req)->work_req;
+    break;
+  case UV_GETNAMEINFO:
+    loop = ((uv_getnameinfo_t*) req)->loop;
+    wreq = &((uv_getnameinfo_t*) req)->work_req;
+    break;
+  case UV_WORK:
+    loop =  ((uv_work_t*) req)->loop;
+    wreq = &((uv_work_t*) req)->work_req;
+    break;
+  default:
+    return UV_EINVAL;
+  }
+
+  return uv__work_cancel(loop, req, wreq);
+}
+
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+void tuv_cleanup(void) {
+  cleanup();
+}
+#endif
diff --git a/deps/libtuv/src/tuv__config.h.in b/deps/libtuv/src/tuv__config.h.in
new file mode 100644 (file)
index 0000000..f45510e
--- /dev/null
@@ -0,0 +1,24 @@
+/* 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.
+ */
+
+#ifndef __TUV_CONFIG_HEADER__
+#define __TUV_CONFIG_HEADER__
+
+
+#define TUV_CONFIG_PLATFORM     "@TARGET_PLATFORM@"
+#define TUV_CONFIG_FILESYSTEM   @CONFIG_FILESYSTEM@
+
+
+#endif /* __TUV_CONFIG_HEADER__ */
diff --git a/deps/libtuv/src/tuv_debuglog.c b/deps/libtuv/src/tuv_debuglog.c
new file mode 100644 (file)
index 0000000..0303118
--- /dev/null
@@ -0,0 +1,71 @@
+/* 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "tuv__debuglog.h"
+
+#ifdef ENABLE_DEBUG_LOG
+
+#if defined(__NUTTX__) || defined(__TUV_MBED__) || defined(__TIZENRT__)
+int tuv_debug_level = TDBGLEV_INFO;
+#else
+int tuv_debug_level = TDBGLEV_ERR;
+#endif
+
+FILE *tuv_log_stream;
+const char* tuv_debug_prefix[4] = { "", "ERR", "WRN", "INF" };
+#endif // ENABLE_DEBUG_LOG
+
+
+void InitDebugSettings() {
+#ifdef ENABLE_DEBUG_LOG
+  const char* dbglevel = NULL;
+  const char* dbglogfile = NULL;
+
+  dbglevel = getenv("TUV_DEBUG_LEVEL");
+  dbglogfile = getenv("TUV_DEBUG_LOGFILE");
+
+  tuv_log_stream = stderr;
+
+  if (dbglevel) {
+    tuv_debug_level = atoi(dbglevel);
+    if (tuv_debug_level < 0) tuv_debug_level = 0;
+    if (tuv_debug_level > TDBGLEV_INFO) tuv_debug_level = TDBGLEV_INFO;
+  }
+  if (dbglogfile) {
+    FILE* logstream;
+    logstream  = fopen(dbglogfile, "w+");
+    if (logstream != NULL) {
+      tuv_log_stream = logstream;
+    }
+  }
+  //fprintf(stderr, "DBG LEV = %d\r\n", tuv_debug_level);
+  //fprintf(stderr, "DBG OUT = %s\r\n", (dbglogfile==NULL?"(stderr)":dbglogfile));
+#endif // ENABLE_DEBUG_LOG
+}
+
+
+void ReleaseDebugSettings() {
+#ifdef ENABLE_DEBUG_LOG
+  if (tuv_log_stream != stderr || tuv_log_stream != stdout) {
+    fclose(tuv_log_stream);
+  }
+  // some embed systems(ex, nuttx) may need this
+  tuv_log_stream = stderr;
+  tuv_debug_level = TDBGLEV_ERR;
+#endif // ENABLE_DEBUG_LOG
+}
diff --git a/deps/libtuv/src/unix/aix.c b/deps/libtuv/src/unix/aix.c
new file mode 100644 (file)
index 0000000..652cd98
--- /dev/null
@@ -0,0 +1,1154 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <sys/time.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <utmp.h>
+#include <libgen.h>
+
+#include <sys/protosw.h>
+#include <libperfstat.h>
+#include <procinfo.h>
+#include <sys/proc.h>
+#include <sys/procfs.h>
+
+#include <sys/poll.h>
+
+#include <sys/pollset.h>
+#include <ctype.h>
+#ifdef HAVE_SYS_AHAFS_EVPRODS_H
+#include <sys/ahafs_evProds.h>
+#endif
+
+#include <sys/mntctl.h>
+#include <sys/vmount.h>
+#include <limits.h>
+#include <strings.h>
+#include <sys/vnode.h>
+
+#define RDWR_BUF_SIZE   4096
+#define EQ(a,b)         (strcmp(a,b) == 0)
+
+int uv__platform_loop_init(uv_loop_t* loop) {
+  loop->fs_fd = -1;
+
+  /* Passing maxfd of -1 should mean the limit is determined
+   * by the user's ulimit or the global limit as per the doc */
+  loop->backend_fd = pollset_create(-1);
+
+  if (loop->backend_fd == -1)
+    return -1;
+
+  return 0;
+}
+
+
+void uv__platform_loop_delete(uv_loop_t* loop) {
+  if (loop->fs_fd != -1) {
+    uv__close(loop->fs_fd);
+    loop->fs_fd = -1;
+  }
+
+  if (loop->backend_fd != -1) {
+    pollset_destroy(loop->backend_fd);
+    loop->backend_fd = -1;
+  }
+}
+
+
+int uv__io_check_fd(uv_loop_t* loop, int fd) {
+  struct poll_ctl pc;
+
+  pc.events = POLLIN;
+  pc.cmd = PS_MOD;  /* Equivalent to PS_ADD if the fd is not in the pollset. */
+  pc.fd = fd;
+
+  if (pollset_ctl(loop->backend_fd, &pc, 1))
+    return -errno;
+
+  pc.cmd = PS_DELETE;
+  if (pollset_ctl(loop->backend_fd, &pc, 1))
+    abort();
+
+  return 0;
+}
+
+
+void uv__io_poll(uv_loop_t* loop, int timeout) {
+  struct pollfd events[1024];
+  struct pollfd pqry;
+  struct pollfd* pe;
+  struct poll_ctl pc;
+  QUEUE* q;
+  uv__io_t* w;
+  uint64_t base;
+  uint64_t diff;
+  int have_signals;
+  int nevents;
+  int count;
+  int nfds;
+  int i;
+  int rc;
+  int add_failed;
+
+  if (loop->nfds == 0) {
+    assert(QUEUE_EMPTY(&loop->watcher_queue));
+    return;
+  }
+
+  while (!QUEUE_EMPTY(&loop->watcher_queue)) {
+    q = QUEUE_HEAD(&loop->watcher_queue);
+    QUEUE_REMOVE(q);
+    QUEUE_INIT(q);
+
+    w = QUEUE_DATA(q, uv__io_t, watcher_queue);
+    assert(w->pevents != 0);
+    assert(w->fd >= 0);
+    assert(w->fd < (int) loop->nwatchers);
+
+    pc.events = w->pevents;
+    pc.fd = w->fd;
+
+    add_failed = 0;
+    if (w->events == 0) {
+      pc.cmd = PS_ADD;
+      if (pollset_ctl(loop->backend_fd, &pc, 1)) {
+        if (errno != EINVAL) {
+          assert(0 && "Failed to add file descriptor (pc.fd) to pollset");
+          abort();
+        }
+        /* Check if the fd is already in the pollset */
+        pqry.fd = pc.fd;
+        rc = pollset_query(loop->backend_fd, &pqry);
+        switch (rc) {
+        case -1:
+          assert(0 && "Failed to query pollset for file descriptor");
+          abort();
+        case 0:
+          assert(0 && "Pollset does not contain file descriptor");
+          abort();
+        }
+        /* If we got here then the pollset already contained the file descriptor even though
+         * we didn't think it should. This probably shouldn't happen, but we can continue. */
+        add_failed = 1;
+      }
+    }
+    if (w->events != 0 || add_failed) {
+      /* Modify, potentially removing events -- need to delete then add.
+       * Could maybe mod if we knew for sure no events are removed, but
+       * content of w->events is handled above as not reliable (falls back)
+       * so may require a pollset_query() which would have to be pretty cheap
+       * compared to a PS_DELETE to be worth optimizing. Alternatively, could
+       * lazily remove events, squelching them in the mean time. */
+      pc.cmd = PS_DELETE;
+      if (pollset_ctl(loop->backend_fd, &pc, 1)) {
+        assert(0 && "Failed to delete file descriptor (pc.fd) from pollset");
+        abort();
+      }
+      pc.cmd = PS_ADD;
+      if (pollset_ctl(loop->backend_fd, &pc, 1)) {
+        assert(0 && "Failed to add file descriptor (pc.fd) to pollset");
+        abort();
+      }
+    }
+
+    w->events = w->pevents;
+  }
+
+  assert(timeout >= -1);
+  base = loop->time;
+  count = 48; /* Benchmarks suggest this gives the best throughput. */
+
+  for (;;) {
+    nfds = pollset_poll(loop->backend_fd,
+                        events,
+                        ARRAY_SIZE(events),
+                        timeout);
+
+    /* Update loop->time unconditionally. It's tempting to skip the update when
+     * timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the
+     * operating system didn't reschedule our process while in the syscall.
+     */
+    SAVE_ERRNO(uv__update_time(loop));
+
+    if (nfds == 0) {
+      assert(timeout != -1);
+      return;
+    }
+
+    if (nfds == -1) {
+      if (errno != EINTR) {
+        abort();
+      }
+
+      if (timeout == -1)
+        continue;
+
+      if (timeout == 0)
+        return;
+
+      /* Interrupted by a signal. Update timeout and poll again. */
+      goto update_timeout;
+    }
+
+    have_signals = 0;
+    nevents = 0;
+
+    assert(loop->watchers != NULL);
+    loop->watchers[loop->nwatchers] = (void*) events;
+    loop->watchers[loop->nwatchers + 1] = (void*) (uintptr_t) nfds;
+
+    for (i = 0; i < nfds; i++) {
+      pe = events + i;
+      pc.cmd = PS_DELETE;
+      pc.fd = pe->fd;
+
+      /* Skip invalidated events, see uv__platform_invalidate_fd */
+      if (pc.fd == -1)
+        continue;
+
+      assert(pc.fd >= 0);
+      assert((unsigned) pc.fd < loop->nwatchers);
+
+      w = loop->watchers[pc.fd];
+
+      if (w == NULL) {
+        /* File descriptor that we've stopped watching, disarm it.
+         *
+         * Ignore all errors because we may be racing with another thread
+         * when the file descriptor is closed.
+         */
+        pollset_ctl(loop->backend_fd, &pc, 1);
+        continue;
+      }
+
+      /* Run signal watchers last.  This also affects child process watchers
+       * because those are implemented in terms of signal watchers.
+       */
+      if (w == &loop->signal_io_watcher)
+        have_signals = 1;
+      else
+        w->cb(loop, w, pe->revents);
+
+      nevents++;
+    }
+
+    if (have_signals != 0)
+      loop->signal_io_watcher.cb(loop, &loop->signal_io_watcher, POLLIN);
+
+    loop->watchers[loop->nwatchers] = NULL;
+    loop->watchers[loop->nwatchers + 1] = NULL;
+
+    if (have_signals != 0)
+      return;  /* Event loop should cycle now so don't poll again. */
+
+    if (nevents != 0) {
+      if (nfds == ARRAY_SIZE(events) && --count != 0) {
+        /* Poll for more events but don't block this time. */
+        timeout = 0;
+        continue;
+      }
+      return;
+    }
+
+    if (timeout == 0)
+      return;
+
+    if (timeout == -1)
+      continue;
+
+update_timeout:
+    assert(timeout > 0);
+
+    diff = loop->time - base;
+    if (diff >= (uint64_t) timeout)
+      return;
+
+    timeout -= diff;
+  }
+}
+
+
+uint64_t uv__hrtime(uv_clocktype_t type) {
+  uint64_t G = 1000000000;
+  timebasestruct_t t;
+  read_wall_time(&t, TIMEBASE_SZ);
+  time_base_to_time(&t, TIMEBASE_SZ);
+  return (uint64_t) t.tb_high * G + t.tb_low;
+}
+
+
+/*
+ * We could use a static buffer for the path manipulations that we need outside
+ * of the function, but this function could be called by multiple consumers and
+ * we don't want to potentially create a race condition in the use of snprintf.
+ * There is no direct way of getting the exe path in AIX - either through /procfs
+ * or through some libc APIs. The below approach is to parse the argv[0]'s pattern
+ * and use it in conjunction with PATH environment variable to craft one.
+ */
+int uv_exepath(char* buffer, size_t* size) {
+  int res;
+  char args[PATH_MAX];
+  char abspath[PATH_MAX];
+  size_t abspath_size;
+  struct procsinfo pi;
+
+  if (buffer == NULL || size == NULL || *size == 0)
+    return -EINVAL;
+
+  pi.pi_pid = getpid();
+  res = getargs(&pi, sizeof(pi), args, sizeof(args));
+  if (res < 0)
+    return -EINVAL;
+
+  /*
+   * Possibilities for args:
+   * i) an absolute path such as: /home/user/myprojects/nodejs/node
+   * ii) a relative path such as: ./node or ../myprojects/nodejs/node
+   * iii) a bare filename such as "node", after exporting PATH variable
+   *     to its location.
+   */
+
+  /* Case i) and ii) absolute or relative paths */
+  if (strchr(args, '/') != NULL) {
+    if (realpath(args, abspath) != abspath)
+      return -errno;
+
+    abspath_size = strlen(abspath);
+
+    *size -= 1;
+    if (*size > abspath_size)
+      *size = abspath_size;
+
+    memcpy(buffer, abspath, *size);
+    buffer[*size] = '\0';
+
+    return 0;
+  } else {
+  /* Case iii). Search PATH environment variable */
+    char trypath[PATH_MAX];
+    char *clonedpath = NULL;
+    char *token = NULL;
+    char *path = getenv("PATH");
+
+    if (path == NULL)
+      return -EINVAL;
+
+    clonedpath = uv__strdup(path);
+    if (clonedpath == NULL)
+      return -ENOMEM;
+
+    token = strtok(clonedpath, ":");
+    while (token != NULL) {
+      snprintf(trypath, sizeof(trypath) - 1, "%s/%s", token, args);
+      if (realpath(trypath, abspath) == abspath) {
+        /* Check the match is executable */
+        if (access(abspath, X_OK) == 0) {
+          abspath_size = strlen(abspath);
+
+          *size -= 1;
+          if (*size > abspath_size)
+            *size = abspath_size;
+
+          memcpy(buffer, abspath, *size);
+          buffer[*size] = '\0';
+
+          uv__free(clonedpath);
+          return 0;
+        }
+      }
+      token = strtok(NULL, ":");
+    }
+    uv__free(clonedpath);
+
+    /* Out of tokens (path entries), and no match found */
+    return -EINVAL;
+  }
+}
+
+
+uint64_t uv_get_free_memory(void) {
+  perfstat_memory_total_t mem_total;
+  int result = perfstat_memory_total(NULL, &mem_total, sizeof(mem_total), 1);
+  if (result == -1) {
+    return 0;
+  }
+  return mem_total.real_free * 4096;
+}
+
+
+uint64_t uv_get_total_memory(void) {
+  perfstat_memory_total_t mem_total;
+  int result = perfstat_memory_total(NULL, &mem_total, sizeof(mem_total), 1);
+  if (result == -1) {
+    return 0;
+  }
+  return mem_total.real_total * 4096;
+}
+
+
+void uv_loadavg(double avg[3]) {
+  perfstat_cpu_total_t ps_total;
+  int result = perfstat_cpu_total(NULL, &ps_total, sizeof(ps_total), 1);
+  if (result == -1) {
+    avg[0] = 0.; avg[1] = 0.; avg[2] = 0.;
+    return;
+  }
+  avg[0] = ps_total.loadavg[0] / (double)(1 << SBITS);
+  avg[1] = ps_total.loadavg[1] / (double)(1 << SBITS);
+  avg[2] = ps_total.loadavg[2] / (double)(1 << SBITS);
+}
+
+
+#ifdef HAVE_SYS_AHAFS_EVPRODS_H
+static char *uv__rawname(char *cp) {
+  static char rawbuf[FILENAME_MAX+1];
+  char *dp = rindex(cp, '/');
+
+  if (dp == 0)
+    return 0;
+
+  *dp = 0;
+  strcpy(rawbuf, cp);
+  *dp = '/';
+  strcat(rawbuf, "/r");
+  strcat(rawbuf, dp+1);
+  return rawbuf;
+}
+
+
+/*
+ * Determine whether given pathname is a directory
+ * Returns 0 if the path is a directory, -1 if not
+ *
+ * Note: Opportunity here for more detailed error information but
+ *       that requires changing callers of this function as well
+ */
+static int uv__path_is_a_directory(char* filename) {
+  struct stat statbuf;
+
+  if (stat(filename, &statbuf) < 0)
+    return -1;  /* failed: not a directory, assume it is a file */
+
+  if (statbuf.st_type == VDIR)
+    return 0;
+
+  return -1;
+}
+
+
+/*
+ * Check whether AHAFS is mounted.
+ * Returns 0 if AHAFS is mounted, or an error code < 0 on failure
+ */
+static int uv__is_ahafs_mounted(void){
+  int rv, i = 2;
+  struct vmount *p;
+  int size_multiplier = 10;
+  size_t siz = sizeof(struct vmount)*size_multiplier;
+  struct vmount *vmt;
+  const char *dev = "/aha";
+  char *obj, *stub;
+
+  p = uv__malloc(siz);
+  if (p == NULL)
+    return -errno;
+
+  /* Retrieve all mounted filesystems */
+  rv = mntctl(MCTL_QUERY, siz, (char*)p);
+  if (rv < 0)
+    return -errno;
+  if (rv == 0) {
+    /* buffer was not large enough, reallocate to correct size */
+    siz = *(int*)p;
+    uv__free(p);
+    p = uv__malloc(siz);
+    if (p == NULL)
+      return -errno;
+    rv = mntctl(MCTL_QUERY, siz, (char*)p);
+    if (rv < 0)
+      return -errno;
+  }
+
+  /* Look for dev in filesystems mount info */
+  for(vmt = p, i = 0; i < rv; i++) {
+    obj = vmt2dataptr(vmt, VMT_OBJECT);     /* device */
+    stub = vmt2dataptr(vmt, VMT_STUB);      /* mount point */
+
+    if (EQ(obj, dev) || EQ(uv__rawname(obj), dev) || EQ(stub, dev)) {
+      uv__free(p);  /* Found a match */
+      return 0;
+    }
+    vmt = (struct vmount *) ((char *) vmt + vmt->vmt_length);
+  }
+
+  /* /aha is required for monitoring filesystem changes */
+  return -1;
+}
+
+/*
+ * Recursive call to mkdir() to create intermediate folders, if any
+ * Returns code from mkdir call
+ */
+static int uv__makedir_p(const char *dir) {
+  char tmp[256];
+  char *p = NULL;
+  size_t len;
+  int err;
+
+  snprintf(tmp, sizeof(tmp),"%s",dir);
+  len = strlen(tmp);
+  if (tmp[len - 1] == '/')
+    tmp[len - 1] = 0;
+  for (p = tmp + 1; *p; p++) {
+    if (*p == '/') {
+      *p = 0;
+      err = mkdir(tmp, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+      if (err != 0 && errno != EEXIST)
+        return err;
+      *p = '/';
+    }
+  }
+  return mkdir(tmp, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+}
+
+/*
+ * Creates necessary subdirectories in the AIX Event Infrastructure
+ * file system for monitoring the object specified.
+ * Returns code from mkdir call
+ */
+static int uv__make_subdirs_p(const char *filename) {
+  char cmd[2048];
+  char *p;
+  int rc = 0;
+
+  /* Strip off the monitor file name */
+  p = strrchr(filename, '/');
+
+  if (p == NULL)
+    return 0;
+
+  if (uv__path_is_a_directory((char*)filename) == 0) {
+    sprintf(cmd, "/aha/fs/modDir.monFactory");
+  } else {
+    sprintf(cmd, "/aha/fs/modFile.monFactory");
+  }
+
+  strncat(cmd, filename, (p - filename));
+  rc = uv__makedir_p(cmd);
+
+  if (rc == -1 && errno != EEXIST){
+    return -errno;
+  }
+
+  return rc;
+}
+
+
+/*
+ * Checks if /aha is mounted, then proceeds to set up the monitoring
+ * objects for the specified file.
+ * Returns 0 on success, or an error code < 0 on failure
+ */
+static int uv__setup_ahafs(const char* filename, int *fd) {
+  int rc = 0;
+  char mon_file_write_string[RDWR_BUF_SIZE];
+  char mon_file[PATH_MAX];
+  int file_is_directory = 0; /* -1 == NO, 0 == YES  */
+
+  /* Create monitor file name for object */
+  file_is_directory = uv__path_is_a_directory((char*)filename);
+
+  if (file_is_directory == 0)
+    sprintf(mon_file, "/aha/fs/modDir.monFactory");
+  else
+    sprintf(mon_file, "/aha/fs/modFile.monFactory");
+
+  if ((strlen(mon_file) + strlen(filename) + 5) > PATH_MAX)
+    return -ENAMETOOLONG;
+
+  /* Make the necessary subdirectories for the monitor file */
+  rc = uv__make_subdirs_p(filename);
+  if (rc == -1 && errno != EEXIST)
+    return rc;
+
+  strcat(mon_file, filename);
+  strcat(mon_file, ".mon");
+
+  *fd = 0; errno = 0;
+
+  /* Open the monitor file, creating it if necessary */
+  *fd = open(mon_file, O_CREAT|O_RDWR);
+  if (*fd < 0)
+    return -errno;
+
+  /* Write out the monitoring specifications.
+   * In this case, we are monitoring for a state change event type
+   *    CHANGED=YES
+   * We will be waiting in select call, rather than a read:
+   *    WAIT_TYPE=WAIT_IN_SELECT
+   * We only want minimal information for files:
+   *      INFO_LVL=1
+   * For directories, we want more information to track what file
+   * caused the change
+   *      INFO_LVL=2
+   */
+
+  if (file_is_directory == 0)
+    sprintf(mon_file_write_string, "CHANGED=YES;WAIT_TYPE=WAIT_IN_SELECT;INFO_LVL=2");
+  else
+    sprintf(mon_file_write_string, "CHANGED=YES;WAIT_TYPE=WAIT_IN_SELECT;INFO_LVL=1");
+
+  rc = write(*fd, mon_file_write_string, strlen(mon_file_write_string)+1);
+  if (rc < 0)
+    return -errno;
+
+  return 0;
+}
+
+/*
+ * Skips a specified number of lines in the buffer passed in.
+ * Walks the buffer pointed to by p and attempts to skip n lines.
+ * Returns the total number of lines skipped
+ */
+static int uv__skip_lines(char **p, int n) {
+  int lines = 0;
+
+  while(n > 0) {
+    *p = strchr(*p, '\n');
+    if (!p)
+      return lines;
+
+    (*p)++;
+    n--;
+    lines++;
+  }
+  return lines;
+}
+
+
+/*
+ * Parse the event occurrence data to figure out what event just occurred
+ * and take proper action.
+ *
+ * The buf is a pointer to the buffer containing the event occurrence data
+ * Returns 0 on success, -1 if unrecoverable error in parsing
+ *
+ */
+static int uv__parse_data(char *buf, int *events, uv_fs_event_t* handle) {
+  int    evp_rc, i;
+  char   *p;
+  char   filename[PATH_MAX]; /* To be used when handling directories */
+
+  p = buf;
+  *events = 0;
+
+  /* Clean the filename buffer*/
+  for(i = 0; i < PATH_MAX; i++) {
+    filename[i] = 0;
+  }
+  i = 0;
+
+  /* Check for BUF_WRAP */
+  if (strncmp(buf, "BUF_WRAP", strlen("BUF_WRAP")) == 0) {
+    assert(0 && "Buffer wrap detected, Some event occurrences lost!");
+    return 0;
+  }
+
+  /* Since we are using the default buffer size (4K), and have specified
+   * INFO_LVL=1, we won't see any EVENT_OVERFLOW conditions.  Applications
+   * should check for this keyword if they are using an INFO_LVL of 2 or
+   * higher, and have a buffer size of <= 4K
+   */
+
+  /* Skip to RC_FROM_EVPROD */
+  if (uv__skip_lines(&p, 9) != 9)
+    return -1;
+
+  if (sscanf(p, "RC_FROM_EVPROD=%d\nEND_EVENT_DATA", &evp_rc) == 1) {
+    if (uv__path_is_a_directory(handle->path) == 0) { /* Directory */
+      if (evp_rc == AHAFS_MODDIR_UNMOUNT || evp_rc == AHAFS_MODDIR_REMOVE_SELF) {
+        /* The directory is no longer available for monitoring */
+        *events = UV_RENAME;
+        handle->dir_filename = NULL;
+      } else {
+        /* A file was added/removed inside the directory */
+        *events = UV_CHANGE;
+
+        /* Get the EVPROD_INFO */
+        if (uv__skip_lines(&p, 1) != 1)
+          return -1;
+
+        /* Scan out the name of the file that triggered the event*/
+        if (sscanf(p, "BEGIN_EVPROD_INFO\n%sEND_EVPROD_INFO", filename) == 1) {
+          handle->dir_filename = uv__strdup((const char*)&filename);
+        } else
+          return -1;
+        }
+    } else { /* Regular File */
+      if (evp_rc == AHAFS_MODFILE_RENAME)
+        *events = UV_RENAME;
+      else
+        *events = UV_CHANGE;
+    }
+  }
+  else
+    return -1;
+
+  return 0;
+}
+
+
+/* This is the internal callback */
+static void uv__ahafs_event(uv_loop_t* loop, uv__io_t* event_watch, unsigned int fflags) {
+  char   result_data[RDWR_BUF_SIZE];
+  int bytes, rc = 0;
+  uv_fs_event_t* handle;
+  int events = 0;
+  char fname[PATH_MAX];
+  char *p;
+
+  handle = container_of(event_watch, uv_fs_event_t, event_watcher);
+
+  /* At this point, we assume that polling has been done on the
+   * file descriptor, so we can just read the AHAFS event occurrence
+   * data and parse its results without having to block anything
+   */
+  bytes = pread(event_watch->fd, result_data, RDWR_BUF_SIZE, 0);
+
+  assert((bytes >= 0) && "uv__ahafs_event - Error reading monitor file");
+
+  /* Parse the data */
+  if(bytes > 0)
+    rc = uv__parse_data(result_data, &events, handle);
+
+  /* Unrecoverable error */
+  if (rc == -1)
+    return;
+
+  /* For directory changes, the name of the files that triggered the change
+   * are never absolute pathnames
+   */
+  if (uv__path_is_a_directory(handle->path) == 0) {
+    p = handle->dir_filename;
+  } else {
+    p = strrchr(handle->path, '/');
+    if (p == NULL)
+      p = handle->path;
+    else
+      p++;
+  }
+  strncpy(fname, p, sizeof(fname) - 1);
+  /* Just in case */
+  fname[sizeof(fname) - 1] = '\0';
+
+  handle->cb(handle, fname, events, 0);
+}
+#endif
+
+
+int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) {
+#ifdef HAVE_SYS_AHAFS_EVPRODS_H
+  uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);
+  return 0;
+#else
+  return -ENOSYS;
+#endif
+}
+
+
+int uv_fs_event_start(uv_fs_event_t* handle,
+                      uv_fs_event_cb cb,
+                      const char* filename,
+                      unsigned int flags) {
+#ifdef HAVE_SYS_AHAFS_EVPRODS_H
+  int  fd, rc, str_offset = 0;
+  char cwd[PATH_MAX];
+  char absolute_path[PATH_MAX];
+  char readlink_cwd[PATH_MAX];
+
+
+  /* Figure out whether filename is absolute or not */
+  if (filename[0] == '/') {
+    /* We have absolute pathname */
+    snprintf(absolute_path, sizeof(absolute_path), "%s", filename);
+  } else {
+    /* We have a relative pathname, compose the absolute pathname */
+    snprintf(cwd, sizeof(cwd), "/proc/%lu/cwd", (unsigned long) getpid());
+    rc = readlink(cwd, readlink_cwd, sizeof(readlink_cwd) - 1);
+    if (rc < 0)
+      return rc;
+    /* readlink does not null terminate our string */
+    readlink_cwd[rc] = '\0';
+
+    if (filename[0] == '.' && filename[1] == '/')
+      str_offset = 2;
+
+    snprintf(absolute_path, sizeof(absolute_path), "%s%s", readlink_cwd,
+             filename + str_offset);
+  }
+
+  if (uv__is_ahafs_mounted() < 0)  /* /aha checks failed */
+    return UV_ENOSYS;
+
+  /* Setup ahafs */
+  rc = uv__setup_ahafs((const char *)absolute_path, &fd);
+  if (rc != 0)
+    return rc;
+
+  /* Setup/Initialize all the libuv routines */
+  uv__handle_start(handle);
+  uv__io_init(&handle->event_watcher, uv__ahafs_event, fd);
+  handle->path = uv__strdup(filename);
+  handle->cb = cb;
+
+  uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
+
+  return 0;
+#else
+  return -ENOSYS;
+#endif
+}
+
+
+int uv_fs_event_stop(uv_fs_event_t* handle) {
+#ifdef HAVE_SYS_AHAFS_EVPRODS_H
+  if (!uv__is_active(handle))
+    return 0;
+
+  uv__io_close(handle->loop, &handle->event_watcher);
+  uv__handle_stop(handle);
+
+  if (uv__path_is_a_directory(handle->path) == 0) {
+    uv__free(handle->dir_filename);
+    handle->dir_filename = NULL;
+  }
+
+  uv__free(handle->path);
+  handle->path = NULL;
+  uv__close(handle->event_watcher.fd);
+  handle->event_watcher.fd = -1;
+
+  return 0;
+#else
+  return -ENOSYS;
+#endif
+}
+
+
+void uv__fs_event_close(uv_fs_event_t* handle) {
+#ifdef HAVE_SYS_AHAFS_EVPRODS_H
+  uv_fs_event_stop(handle);
+#else
+  UNREACHABLE();
+#endif
+}
+
+
+char** uv_setup_args(int argc, char** argv) {
+  return argv;
+}
+
+
+int uv_set_process_title(const char* title) {
+  return 0;
+}
+
+
+int uv_get_process_title(char* buffer, size_t size) {
+  if (buffer == NULL || size == 0)
+    return -EINVAL;
+
+  buffer[0] = '\0';
+  return 0;
+}
+
+
+int uv_resident_set_memory(size_t* rss) {
+  char pp[64];
+  psinfo_t psinfo;
+  int err;
+  int fd;
+
+  snprintf(pp, sizeof(pp), "/proc/%lu/psinfo", (unsigned long) getpid());
+
+  fd = open(pp, O_RDONLY);
+  if (fd == -1)
+    return -errno;
+
+  /* FIXME(bnoordhuis) Handle EINTR. */
+  err = -EINVAL;
+  if (read(fd, &psinfo, sizeof(psinfo)) == sizeof(psinfo)) {
+    *rss = (size_t)psinfo.pr_rssize * 1024;
+    err = 0;
+  }
+  uv__close(fd);
+
+  return err;
+}
+
+
+int uv_uptime(double* uptime) {
+  struct utmp *utmp_buf;
+  size_t entries = 0;
+  time_t boot_time;
+
+  utmpname(UTMP_FILE);
+
+  setutent();
+
+  while ((utmp_buf = getutent()) != NULL) {
+    if (utmp_buf->ut_user[0] && utmp_buf->ut_type == USER_PROCESS)
+      ++entries;
+    if (utmp_buf->ut_type == BOOT_TIME)
+      boot_time = utmp_buf->ut_time;
+  }
+
+  endutent();
+
+  if (boot_time == 0)
+    return -ENOSYS;
+
+  *uptime = time(NULL) - boot_time;
+  return 0;
+}
+
+
+int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
+  uv_cpu_info_t* cpu_info;
+  perfstat_cpu_total_t ps_total;
+  perfstat_cpu_t* ps_cpus;
+  perfstat_id_t cpu_id;
+  int result, ncpus, idx = 0;
+
+  result = perfstat_cpu_total(NULL, &ps_total, sizeof(ps_total), 1);
+  if (result == -1) {
+    return -ENOSYS;
+  }
+
+  ncpus = result = perfstat_cpu(NULL, NULL, sizeof(perfstat_cpu_t), 0);
+  if (result == -1) {
+    return -ENOSYS;
+  }
+
+  ps_cpus = (perfstat_cpu_t*) uv__malloc(ncpus * sizeof(perfstat_cpu_t));
+  if (!ps_cpus) {
+    return -ENOMEM;
+  }
+
+  strcpy(cpu_id.name, FIRST_CPU);
+  result = perfstat_cpu(&cpu_id, ps_cpus, sizeof(perfstat_cpu_t), ncpus);
+  if (result == -1) {
+    uv__free(ps_cpus);
+    return -ENOSYS;
+  }
+
+  *cpu_infos = (uv_cpu_info_t*) uv__malloc(ncpus * sizeof(uv_cpu_info_t));
+  if (!*cpu_infos) {
+    uv__free(ps_cpus);
+    return -ENOMEM;
+  }
+
+  *count = ncpus;
+
+  cpu_info = *cpu_infos;
+  while (idx < ncpus) {
+    cpu_info->speed = (int)(ps_total.processorHZ / 1000000);
+    cpu_info->model = uv__strdup(ps_total.description);
+    cpu_info->cpu_times.user = ps_cpus[idx].user;
+    cpu_info->cpu_times.sys = ps_cpus[idx].sys;
+    cpu_info->cpu_times.idle = ps_cpus[idx].idle;
+    cpu_info->cpu_times.irq = ps_cpus[idx].wait;
+    cpu_info->cpu_times.nice = 0;
+    cpu_info++;
+    idx++;
+  }
+
+  uv__free(ps_cpus);
+  return 0;
+}
+
+
+void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
+  int i;
+
+  for (i = 0; i < count; ++i) {
+    uv__free(cpu_infos[i].model);
+  }
+
+  uv__free(cpu_infos);
+}
+
+
+int uv_interface_addresses(uv_interface_address_t** addresses,
+  int* count) {
+  uv_interface_address_t* address;
+  int sockfd, size = 1;
+  struct ifconf ifc;
+  struct ifreq *ifr, *p, flg;
+
+  *count = 0;
+
+  if (0 > (sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP))) {
+    return -errno;
+  }
+
+  if (ioctl(sockfd, SIOCGSIZIFCONF, &size) == -1) {
+    uv__close(sockfd);
+    return -errno;
+  }
+
+  ifc.ifc_req = (struct ifreq*)uv__malloc(size);
+  ifc.ifc_len = size;
+  if (ioctl(sockfd, SIOCGIFCONF, &ifc) == -1) {
+    uv__close(sockfd);
+    return -errno;
+  }
+
+#define ADDR_SIZE(p) MAX((p).sa_len, sizeof(p))
+
+  /* Count all up and running ipv4/ipv6 addresses */
+  ifr = ifc.ifc_req;
+  while ((char*)ifr < (char*)ifc.ifc_req + ifc.ifc_len) {
+    p = ifr;
+    ifr = (struct ifreq*)
+      ((char*)ifr + sizeof(ifr->ifr_name) + ADDR_SIZE(ifr->ifr_addr));
+
+    if (!(p->ifr_addr.sa_family == AF_INET6 ||
+          p->ifr_addr.sa_family == AF_INET))
+      continue;
+
+    memcpy(flg.ifr_name, p->ifr_name, sizeof(flg.ifr_name));
+    if (ioctl(sockfd, SIOCGIFFLAGS, &flg) == -1) {
+      uv__close(sockfd);
+      return -errno;
+    }
+
+    if (!(flg.ifr_flags & IFF_UP && flg.ifr_flags & IFF_RUNNING))
+      continue;
+
+    (*count)++;
+  }
+
+  /* Alloc the return interface structs */
+  *addresses = (uv_interface_address_t*)
+    uv__malloc(*count * sizeof(uv_interface_address_t));
+  if (!(*addresses)) {
+    uv__close(sockfd);
+    return -ENOMEM;
+  }
+  address = *addresses;
+
+  ifr = ifc.ifc_req;
+  while ((char*)ifr < (char*)ifc.ifc_req + ifc.ifc_len) {
+    p = ifr;
+    ifr = (struct ifreq*)
+      ((char*)ifr + sizeof(ifr->ifr_name) + ADDR_SIZE(ifr->ifr_addr));
+
+    if (!(p->ifr_addr.sa_family == AF_INET6 ||
+          p->ifr_addr.sa_family == AF_INET))
+      continue;
+
+    memcpy(flg.ifr_name, p->ifr_name, sizeof(flg.ifr_name));
+    if (ioctl(sockfd, SIOCGIFFLAGS, &flg) == -1) {
+      uv__close(sockfd);
+      return -ENOSYS;
+    }
+
+    if (!(flg.ifr_flags & IFF_UP && flg.ifr_flags & IFF_RUNNING))
+      continue;
+
+    /* All conditions above must match count loop */
+
+    address->name = uv__strdup(p->ifr_name);
+
+    if (p->ifr_addr.sa_family == AF_INET6) {
+      address->address.address6 = *((struct sockaddr_in6*) &p->ifr_addr);
+    } else {
+      address->address.address4 = *((struct sockaddr_in*) &p->ifr_addr);
+    }
+
+    /* TODO: Retrieve netmask using SIOCGIFNETMASK ioctl */
+
+    address->is_internal = flg.ifr_flags & IFF_LOOPBACK ? 1 : 0;
+
+    address++;
+  }
+
+#undef ADDR_SIZE
+
+  uv__close(sockfd);
+  return 0;
+}
+
+
+void uv_free_interface_addresses(uv_interface_address_t* addresses,
+  int count) {
+  int i;
+
+  for (i = 0; i < count; ++i) {
+    uv__free(addresses[i].name);
+  }
+
+  uv__free(addresses);
+}
+
+void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
+  struct pollfd* events;
+  uintptr_t i;
+  uintptr_t nfds;
+  struct poll_ctl pc;
+
+  assert(loop->watchers != NULL);
+
+  events = (struct pollfd*) loop->watchers[loop->nwatchers];
+  nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1];
+
+  if (events != NULL)
+    /* Invalidate events with same file descriptor */
+    for (i = 0; i < nfds; i++)
+      if ((int) events[i].fd == fd)
+        events[i].fd = -1;
+
+  /* Remove the file descriptor from the poll set */
+  pc.events = 0;
+  pc.cmd = PS_DELETE;
+  pc.fd = fd;
+  if(loop->backend_fd >= 0)
+    pollset_ctl(loop->backend_fd, &pc, 1);
+}
diff --git a/deps/libtuv/src/unix/android-ifaddrs.c b/deps/libtuv/src/unix/android-ifaddrs.c
new file mode 100644 (file)
index 0000000..30f681b
--- /dev/null
@@ -0,0 +1,703 @@
+/*
+Copyright (c) 2013, Kenneth MacKay
+Copyright (c) 2014, Emergya (Cloud4all, FP7/2007-2013 grant agreement #289016)
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "android-ifaddrs.h"
+#include "uv-common.h"
+
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <netinet/in.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
+typedef struct NetlinkList
+{
+    struct NetlinkList *m_next;
+    struct nlmsghdr *m_data;
+    unsigned int m_size;
+} NetlinkList;
+
+static int netlink_socket(void)
+{
+    struct sockaddr_nl l_addr;
+
+    int l_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+    if(l_socket < 0)
+    {
+        return -1;
+    }
+
+    memset(&l_addr, 0, sizeof(l_addr));
+    l_addr.nl_family = AF_NETLINK;
+    if(bind(l_socket, (struct sockaddr *)&l_addr, sizeof(l_addr)) < 0)
+    {
+        close(l_socket);
+        return -1;
+    }
+
+    return l_socket;
+}
+
+static int netlink_send(int p_socket, int p_request)
+{
+    char l_buffer[NLMSG_ALIGN(sizeof(struct nlmsghdr)) + NLMSG_ALIGN(sizeof(struct rtgenmsg))];
+
+    struct nlmsghdr *l_hdr;
+    struct rtgenmsg *l_msg;
+    struct sockaddr_nl l_addr;
+
+    memset(l_buffer, 0, sizeof(l_buffer));
+
+    l_hdr = (struct nlmsghdr *)l_buffer;
+    l_msg = (struct rtgenmsg *)NLMSG_DATA(l_hdr);
+
+    l_hdr->nlmsg_len = NLMSG_LENGTH(sizeof(*l_msg));
+    l_hdr->nlmsg_type = p_request;
+    l_hdr->nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
+    l_hdr->nlmsg_pid = 0;
+    l_hdr->nlmsg_seq = p_socket;
+    l_msg->rtgen_family = AF_UNSPEC;
+
+    memset(&l_addr, 0, sizeof(l_addr));
+    l_addr.nl_family = AF_NETLINK;
+    return (sendto(p_socket, l_hdr, l_hdr->nlmsg_len, 0, (struct sockaddr *)&l_addr, sizeof(l_addr)));
+}
+
+static int netlink_recv(int p_socket, void *p_buffer, size_t p_len)
+{
+    struct sockaddr_nl l_addr;
+    struct msghdr l_msg;
+
+    struct iovec l_iov;
+    l_iov.iov_base = p_buffer;
+    l_iov.iov_len = p_len;
+
+    for(;;)
+    {
+        int l_result;
+        l_msg.msg_name = (void *)&l_addr;
+        l_msg.msg_namelen = sizeof(l_addr);
+        l_msg.msg_iov = &l_iov;
+        l_msg.msg_iovlen = 1;
+        l_msg.msg_control = NULL;
+        l_msg.msg_controllen = 0;
+        l_msg.msg_flags = 0;
+        l_result = recvmsg(p_socket, &l_msg, 0);
+
+        if(l_result < 0)
+        {
+            if(errno == EINTR)
+            {
+                continue;
+            }
+            return -2;
+        }
+
+        /* Buffer was too small */
+        if(l_msg.msg_flags & MSG_TRUNC)
+        {
+            return -1;
+        }
+        return l_result;
+    }
+}
+
+static struct nlmsghdr *getNetlinkResponse(int p_socket, int *p_size, int *p_done)
+{
+    size_t l_size = 4096;
+    void *l_buffer = NULL;
+
+    for(;;)
+    {
+        int l_read;
+
+        uv__free(l_buffer);
+        l_buffer = uv__malloc(l_size);
+        if (l_buffer == NULL)
+        {
+            return NULL;
+        }
+
+        l_read = netlink_recv(p_socket, l_buffer, l_size);
+        *p_size = l_read;
+        if(l_read == -2)
+        {
+            uv__free(l_buffer);
+            return NULL;
+        }
+        if(l_read >= 0)
+        {
+            pid_t l_pid = getpid();
+            struct nlmsghdr *l_hdr;
+            for(l_hdr = (struct nlmsghdr *)l_buffer; NLMSG_OK(l_hdr, (unsigned int)l_read); l_hdr = (struct nlmsghdr *)NLMSG_NEXT(l_hdr, l_read))
+            {
+                if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket)
+                {
+                    continue;
+                }
+
+                if(l_hdr->nlmsg_type == NLMSG_DONE)
+                {
+                    *p_done = 1;
+                    break;
+                }
+
+                if(l_hdr->nlmsg_type == NLMSG_ERROR)
+                {
+                    uv__free(l_buffer);
+                    return NULL;
+                }
+            }
+            return l_buffer;
+        }
+
+        l_size *= 2;
+    }
+}
+
+static NetlinkList *newListItem(struct nlmsghdr *p_data, unsigned int p_size)
+{
+    NetlinkList *l_item = uv__malloc(sizeof(NetlinkList));
+    if (l_item == NULL)
+    {
+        return NULL;
+    }
+
+    l_item->m_next = NULL;
+    l_item->m_data = p_data;
+    l_item->m_size = p_size;
+    return l_item;
+}
+
+static void freeResultList(NetlinkList *p_list)
+{
+    NetlinkList *l_cur;
+    while(p_list)
+    {
+        l_cur = p_list;
+        p_list = p_list->m_next;
+        uv__free(l_cur->m_data);
+        uv__free(l_cur);
+    }
+}
+
+static NetlinkList *getResultList(int p_socket, int p_request)
+{
+    int l_size;
+    int l_done;
+    NetlinkList *l_list;
+    NetlinkList *l_end;
+
+    if(netlink_send(p_socket, p_request) < 0)
+    {
+        return NULL;
+    }
+
+    l_list = NULL;
+    l_end = NULL;
+
+    l_done = 0;
+    while(!l_done)
+    {
+        NetlinkList *l_item;
+
+        struct nlmsghdr *l_hdr = getNetlinkResponse(p_socket, &l_size, &l_done);
+        /* Error */
+        if(!l_hdr)
+        {
+            freeResultList(l_list);
+            return NULL;
+        }
+
+        l_item = newListItem(l_hdr, l_size);
+        if (!l_item)
+        {
+            freeResultList(l_list);
+            return NULL;
+        }
+        if(!l_list)
+        {
+            l_list = l_item;
+        }
+        else
+        {
+            l_end->m_next = l_item;
+        }
+        l_end = l_item;
+    }
+    return l_list;
+}
+
+static size_t maxSize(size_t a, size_t b)
+{
+    return (a > b ? a : b);
+}
+
+static size_t calcAddrLen(sa_family_t p_family, int p_dataSize)
+{
+    switch(p_family)
+    {
+        case AF_INET:
+            return sizeof(struct sockaddr_in);
+        case AF_INET6:
+            return sizeof(struct sockaddr_in6);
+        case AF_PACKET:
+            return maxSize(sizeof(struct sockaddr_ll), offsetof(struct sockaddr_ll, sll_addr) + p_dataSize);
+        default:
+            return maxSize(sizeof(struct sockaddr), offsetof(struct sockaddr, sa_data) + p_dataSize);
+    }
+}
+
+static void makeSockaddr(sa_family_t p_family, struct sockaddr *p_dest, void *p_data, size_t p_size)
+{
+    switch(p_family)
+    {
+        case AF_INET:
+            memcpy(&((struct sockaddr_in*)p_dest)->sin_addr, p_data, p_size);
+            break;
+        case AF_INET6:
+            memcpy(&((struct sockaddr_in6*)p_dest)->sin6_addr, p_data, p_size);
+            break;
+        case AF_PACKET:
+            memcpy(((struct sockaddr_ll*)p_dest)->sll_addr, p_data, p_size);
+            ((struct sockaddr_ll*)p_dest)->sll_halen = p_size;
+            break;
+        default:
+            memcpy(p_dest->sa_data, p_data, p_size);
+            break;
+    }
+    p_dest->sa_family = p_family;
+}
+
+static void addToEnd(struct ifaddrs **p_resultList, struct ifaddrs *p_entry)
+{
+    if(!*p_resultList)
+    {
+        *p_resultList = p_entry;
+    }
+    else
+    {
+        struct ifaddrs *l_cur = *p_resultList;
+        while(l_cur->ifa_next)
+        {
+            l_cur = l_cur->ifa_next;
+        }
+        l_cur->ifa_next = p_entry;
+    }
+}
+
+static int interpretLink(struct nlmsghdr *p_hdr, struct ifaddrs **p_resultList)
+{
+    struct ifaddrs *l_entry;
+
+    char *l_index;
+    char *l_name;
+    char *l_addr;
+    char *l_data;
+
+    struct ifinfomsg *l_info = (struct ifinfomsg *)NLMSG_DATA(p_hdr);
+
+    size_t l_nameSize = 0;
+    size_t l_addrSize = 0;
+    size_t l_dataSize = 0;
+
+    size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg));
+    struct rtattr *l_rta;
+    for(l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))
+    {
+        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);
+        switch(l_rta->rta_type)
+        {
+            case IFLA_ADDRESS:
+            case IFLA_BROADCAST:
+                l_addrSize += NLMSG_ALIGN(calcAddrLen(AF_PACKET, l_rtaDataSize));
+                break;
+            case IFLA_IFNAME:
+                l_nameSize += NLMSG_ALIGN(l_rtaSize + 1);
+                break;
+            case IFLA_STATS:
+                l_dataSize += NLMSG_ALIGN(l_rtaSize);
+                break;
+            default:
+                break;
+        }
+    }
+
+    l_entry = uv__malloc(sizeof(struct ifaddrs) + sizeof(int) + l_nameSize + l_addrSize + l_dataSize);
+    if (l_entry == NULL)
+    {
+        return -1;
+    }
+    memset(l_entry, 0, sizeof(struct ifaddrs));
+    l_entry->ifa_name = "";
+
+    l_index = ((char *)l_entry) + sizeof(struct ifaddrs);
+    l_name = l_index + sizeof(int);
+    l_addr = l_name + l_nameSize;
+    l_data = l_addr + l_addrSize;
+
+    /* Save the interface index so we can look it up when handling the
+     * addresses.
+     */
+    memcpy(l_index, &l_info->ifi_index, sizeof(int));
+
+    l_entry->ifa_flags = l_info->ifi_flags;
+
+    l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg));
+    for(l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))
+    {
+        void *l_rtaData = RTA_DATA(l_rta);
+        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);
+        switch(l_rta->rta_type)
+        {
+            case IFLA_ADDRESS:
+            case IFLA_BROADCAST:
+            {
+                size_t l_addrLen = calcAddrLen(AF_PACKET, l_rtaDataSize);
+                makeSockaddr(AF_PACKET, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize);
+                ((struct sockaddr_ll *)l_addr)->sll_ifindex = l_info->ifi_index;
+                ((struct sockaddr_ll *)l_addr)->sll_hatype = l_info->ifi_type;
+                if(l_rta->rta_type == IFLA_ADDRESS)
+                {
+                    l_entry->ifa_addr = (struct sockaddr *)l_addr;
+                }
+                else
+                {
+                    l_entry->ifa_broadaddr = (struct sockaddr *)l_addr;
+                }
+                l_addr += NLMSG_ALIGN(l_addrLen);
+                break;
+            }
+            case IFLA_IFNAME:
+                strncpy(l_name, l_rtaData, l_rtaDataSize);
+                l_name[l_rtaDataSize] = '\0';
+                l_entry->ifa_name = l_name;
+                break;
+            case IFLA_STATS:
+                memcpy(l_data, l_rtaData, l_rtaDataSize);
+                l_entry->ifa_data = l_data;
+                break;
+            default:
+                break;
+        }
+    }
+
+    addToEnd(p_resultList, l_entry);
+    return 0;
+}
+
+static struct ifaddrs *findInterface(int p_index, struct ifaddrs **p_links, int p_numLinks)
+{
+    int l_num = 0;
+    struct ifaddrs *l_cur = *p_links;
+    while(l_cur && l_num < p_numLinks)
+    {
+        char *l_indexPtr = ((char *)l_cur) + sizeof(struct ifaddrs);
+        int l_index;
+        memcpy(&l_index, l_indexPtr, sizeof(int));
+        if(l_index == p_index)
+        {
+            return l_cur;
+        }
+
+        l_cur = l_cur->ifa_next;
+        ++l_num;
+    }
+    return NULL;
+}
+
+static int interpretAddr(struct nlmsghdr *p_hdr, struct ifaddrs **p_resultList, int p_numLinks)
+{
+    struct ifaddrmsg *l_info = (struct ifaddrmsg *)NLMSG_DATA(p_hdr);
+    struct ifaddrs *l_interface = findInterface(l_info->ifa_index, p_resultList, p_numLinks);
+
+    size_t l_nameSize = 0;
+    size_t l_addrSize = 0;
+
+    int l_addedNetmask = 0;
+
+    size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg));
+    struct rtattr *l_rta;
+    struct ifaddrs *l_entry;
+
+    char *l_name;
+    char *l_addr;
+
+    for(l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))
+    {
+        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);
+        if(l_info->ifa_family == AF_PACKET)
+        {
+            continue;
+        }
+
+        switch(l_rta->rta_type)
+        {
+            case IFA_ADDRESS:
+            case IFA_LOCAL:
+                if((l_info->ifa_family == AF_INET || l_info->ifa_family == AF_INET6) && !l_addedNetmask)
+                {
+                    /* Make room for netmask */
+                    l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize));
+                    l_addedNetmask = 1;
+                }
+            case IFA_BROADCAST:
+                l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize));
+                break;
+            case IFA_LABEL:
+                l_nameSize += NLMSG_ALIGN(l_rtaSize + 1);
+                break;
+            default:
+                break;
+        }
+    }
+
+    l_entry = uv__malloc(sizeof(struct ifaddrs) + l_nameSize + l_addrSize);
+    if (l_entry == NULL)
+    {
+        return -1;
+    }
+    memset(l_entry, 0, sizeof(struct ifaddrs));
+    l_entry->ifa_name = (l_interface ? l_interface->ifa_name : "");
+
+    l_name = ((char *)l_entry) + sizeof(struct ifaddrs);
+    l_addr = l_name + l_nameSize;
+
+    l_entry->ifa_flags = l_info->ifa_flags;
+    if(l_interface)
+    {
+        l_entry->ifa_flags |= l_interface->ifa_flags;
+    }
+
+    l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg));
+    for(l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize))
+    {
+        void *l_rtaData = RTA_DATA(l_rta);
+        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);
+        switch(l_rta->rta_type)
+        {
+            case IFA_ADDRESS:
+            case IFA_BROADCAST:
+            case IFA_LOCAL:
+            {
+                size_t l_addrLen = calcAddrLen(l_info->ifa_family, l_rtaDataSize);
+                makeSockaddr(l_info->ifa_family, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize);
+                if(l_info->ifa_family == AF_INET6)
+                {
+                    if(IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)l_rtaData) || IN6_IS_ADDR_MC_LINKLOCAL((struct in6_addr *)l_rtaData))
+                    {
+                        ((struct sockaddr_in6 *)l_addr)->sin6_scope_id = l_info->ifa_index;
+                    }
+                }
+
+                /* Apparently in a point-to-point network IFA_ADDRESS contains
+                 * the dest address and IFA_LOCAL contains the local address
+                 */
+                if(l_rta->rta_type == IFA_ADDRESS)
+                {
+                    if(l_entry->ifa_addr)
+                    {
+                        l_entry->ifa_dstaddr = (struct sockaddr *)l_addr;
+                    }
+                    else
+                    {
+                        l_entry->ifa_addr = (struct sockaddr *)l_addr;
+                    }
+                }
+                else if(l_rta->rta_type == IFA_LOCAL)
+                {
+                    if(l_entry->ifa_addr)
+                    {
+                        l_entry->ifa_dstaddr = l_entry->ifa_addr;
+                    }
+                    l_entry->ifa_addr = (struct sockaddr *)l_addr;
+                }
+                else
+                {
+                    l_entry->ifa_broadaddr = (struct sockaddr *)l_addr;
+                }
+                l_addr += NLMSG_ALIGN(l_addrLen);
+                break;
+            }
+            case IFA_LABEL:
+                strncpy(l_name, l_rtaData, l_rtaDataSize);
+                l_name[l_rtaDataSize] = '\0';
+                l_entry->ifa_name = l_name;
+                break;
+            default:
+                break;
+        }
+    }
+
+    if(l_entry->ifa_addr && (l_entry->ifa_addr->sa_family == AF_INET || l_entry->ifa_addr->sa_family == AF_INET6))
+    {
+        unsigned l_maxPrefix = (l_entry->ifa_addr->sa_family == AF_INET ? 32 : 128);
+        unsigned l_prefix = (l_info->ifa_prefixlen > l_maxPrefix ? l_maxPrefix : l_info->ifa_prefixlen);
+        char l_mask[16] = {0};
+        unsigned i;
+        for(i=0; i<(l_prefix/8); ++i)
+        {
+            l_mask[i] = 0xff;
+        }
+        if(l_prefix % 8)
+        {
+            l_mask[i] = 0xff << (8 - (l_prefix % 8));
+        }
+
+        makeSockaddr(l_entry->ifa_addr->sa_family, (struct sockaddr *)l_addr, l_mask, l_maxPrefix / 8);
+        l_entry->ifa_netmask = (struct sockaddr *)l_addr;
+    }
+
+    addToEnd(p_resultList, l_entry);
+    return 0;
+}
+
+static int interpretLinks(int p_socket, NetlinkList *p_netlinkList, struct ifaddrs **p_resultList)
+{
+
+    int l_numLinks = 0;
+    pid_t l_pid = getpid();
+    for(; p_netlinkList; p_netlinkList = p_netlinkList->m_next)
+    {
+        unsigned int l_nlsize = p_netlinkList->m_size;
+        struct nlmsghdr *l_hdr;
+        for(l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize))
+        {
+            if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket)
+            {
+                continue;
+            }
+
+            if(l_hdr->nlmsg_type == NLMSG_DONE)
+            {
+                break;
+            }
+
+            if(l_hdr->nlmsg_type == RTM_NEWLINK)
+            {
+                if(interpretLink(l_hdr, p_resultList) == -1)
+                {
+                    return -1;
+                }
+                ++l_numLinks;
+            }
+        }
+    }
+    return l_numLinks;
+}
+
+static int interpretAddrs(int p_socket, NetlinkList *p_netlinkList, struct ifaddrs **p_resultList, int p_numLinks)
+{
+    pid_t l_pid = getpid();
+    for(; p_netlinkList; p_netlinkList = p_netlinkList->m_next)
+    {
+        unsigned int l_nlsize = p_netlinkList->m_size;
+        struct nlmsghdr *l_hdr;
+        for(l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize))
+        {
+            if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket)
+            {
+                continue;
+            }
+
+            if(l_hdr->nlmsg_type == NLMSG_DONE)
+            {
+                break;
+            }
+
+            if(l_hdr->nlmsg_type == RTM_NEWADDR)
+            {
+                if (interpretAddr(l_hdr, p_resultList, p_numLinks) == -1)
+                {
+                    return -1;
+                }
+            }
+        }
+    }
+    return 0;
+}
+
+int getifaddrs(struct ifaddrs **ifap)
+{
+    int l_socket;
+    int l_result;
+    int l_numLinks;
+    NetlinkList *l_linkResults;
+    NetlinkList *l_addrResults;
+
+    if(!ifap)
+    {
+        return -1;
+    }
+    *ifap = NULL;
+
+    l_socket = netlink_socket();
+    if(l_socket < 0)
+    {
+        return -1;
+    }
+
+    l_linkResults = getResultList(l_socket, RTM_GETLINK);
+    if(!l_linkResults)
+    {
+        close(l_socket);
+        return -1;
+    }
+
+    l_addrResults = getResultList(l_socket, RTM_GETADDR);
+    if(!l_addrResults)
+    {
+        close(l_socket);
+        freeResultList(l_linkResults);
+        return -1;
+    }
+
+    l_result = 0;
+    l_numLinks = interpretLinks(l_socket, l_linkResults, ifap);
+    if(l_numLinks == -1 || interpretAddrs(l_socket, l_addrResults, ifap, l_numLinks) == -1)
+    {
+        l_result = -1;
+    }
+
+    freeResultList(l_linkResults);
+    freeResultList(l_addrResults);
+    close(l_socket);
+    return l_result;
+}
+
+void freeifaddrs(struct ifaddrs *ifa)
+{
+    struct ifaddrs *l_cur;
+    while(ifa)
+    {
+        l_cur = ifa;
+        ifa = ifa->ifa_next;
+        uv__free(l_cur);
+    }
+}
diff --git a/deps/libtuv/src/unix/async.c b/deps/libtuv/src/unix/async.c
new file mode 100644 (file)
index 0000000..87beb1d
--- /dev/null
@@ -0,0 +1,314 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/* This file contains both the uv__async internal infrastructure and the
+ * user-facing uv_async_t functions.
+ */
+
+#include "uv.h"
+#include "internal.h"
+#include "atomic-ops.h"
+
+#include <errno.h>
+#include <stdio.h>  /* snprintf() */
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static void uv__async_event(uv_loop_t* loop,
+                            struct uv__async* w,
+                            unsigned int nevents);
+static int uv__async_eventfd(void);
+
+
+int uv_async_init(uv_loop_t* loop, uv_async_t* handle, uv_async_cb async_cb) {
+  int err;
+
+  err = uv__async_start(loop, &loop->async_watcher, uv__async_event);
+  if (err)
+    return err;
+
+  uv__handle_init(loop, (uv_handle_t*)handle, UV_ASYNC);
+  handle->async_cb = async_cb;
+  handle->pending = 0;
+
+  QUEUE_INSERT_TAIL(&loop->async_handles, &handle->queue);
+  uv__handle_start(handle);
+
+  return 0;
+}
+
+int tuv_async_deinit(uv_loop_t* loop, uv_async_t* handle) {
+  uv__async_stop(loop, &loop->async_watcher);
+  uv__handle_stop(handle);
+  QUEUE_REMOVE(&handle->queue);
+  QUEUE_INIT(&handle->queue);
+  tuv__handle_deinit(handle);
+
+  return 0;
+}
+
+int uv_async_send(uv_async_t* handle) {
+  /* Do a cheap read first. */
+  if (ACCESS_ONCE(int, handle->pending) != 0)
+    return 0;
+
+  if (cmpxchgi(&handle->pending, 0, 1) == 0)
+    uv__async_send(&handle->loop->async_watcher);
+
+  return 0;
+}
+
+
+void uv__async_close(uv_async_t* handle) {
+  QUEUE_REMOVE(&handle->queue);
+  uv__handle_stop(handle);
+}
+
+
+static void uv__async_event(uv_loop_t* loop,
+                            struct uv__async* w,
+                            unsigned int nevents) {
+  QUEUE queue;
+  QUEUE* q;
+  uv_async_t* h;
+
+  QUEUE_MOVE(&loop->async_handles, &queue);
+  while (!QUEUE_EMPTY(&queue)) {
+    q = QUEUE_HEAD(&queue);
+    h = QUEUE_DATA(q, uv_async_t, queue);
+
+    QUEUE_REMOVE(q);
+    QUEUE_INSERT_TAIL(&loop->async_handles, q);
+
+    if (cmpxchgi(&h->pending, 1, 0) == 0)
+      continue;
+
+    if (h->async_cb == NULL)
+      continue;
+    h->async_cb(h);
+  }
+}
+
+
+static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
+  struct uv__async* wa;
+  char buf[1024];
+  unsigned n;
+  ssize_t r;
+
+  n = 0;
+  for (;;) {
+    r = read(w->fd, buf, sizeof(buf));
+
+    if (r > 0)
+      n += r;
+
+    if (r == sizeof(buf))
+      continue;
+
+    if (r != -1)
+      break;
+
+    if (errno == EAGAIN || errno == EWOULDBLOCK)
+      break;
+
+    if (errno == EINTR)
+      continue;
+
+    abort();
+  }
+
+  wa = container_of(w, struct uv__async, io_watcher);
+
+#if defined(__linux__)
+  if (wa->wfd == -1) {
+    uint64_t val;
+    assert(n == sizeof(val));
+    memcpy(&val, buf, sizeof(val));  /* Avoid alignment issues. */
+    wa->cb(loop, wa, val);
+    return;
+  }
+#endif
+
+  wa->cb(loop, wa, n);
+}
+
+
+void uv__async_send(struct uv__async* wa) {
+  const void* buf;
+  ssize_t len;
+  int fd;
+  int r;
+
+  buf = "";
+  len = 1;
+  fd = wa->wfd;
+
+#if defined(__linux__)
+  if (fd == -1) {
+    static const uint64_t val = 1;
+    buf = &val;
+    len = sizeof(val);
+    fd = wa->io_watcher.fd;  /* eventfd */
+  }
+#endif
+
+  do
+    r = write(fd, buf, len);
+  while (r == -1 && errno == EINTR);
+
+  if (r == len)
+    return;
+
+  if (r == -1)
+    if (errno == EAGAIN || errno == EWOULDBLOCK)
+      return;
+
+  abort();
+}
+
+
+void uv__async_init(struct uv__async* wa) {
+  wa->io_watcher.fd = -1;
+  wa->wfd = -1;
+}
+
+
+int uv__async_start(uv_loop_t* loop, struct uv__async* wa, uv__async_cb cb) {
+  int pipefd[2];
+  int err;
+
+  if (wa->io_watcher.fd != -1)
+    return 0;
+
+  err = uv__async_eventfd();
+  if (err >= 0) {
+    pipefd[0] = err;
+    pipefd[1] = -1;
+  }
+  else if (err == -ENOSYS) {
+    err = uv__make_pipe(pipefd, UV__F_NONBLOCK);
+#if defined(__linux__)
+    /* Save a file descriptor by opening one of the pipe descriptors as
+     * read/write through the procfs.  That file descriptor can then
+     * function as both ends of the pipe.
+     */
+    if (err == 0) {
+      char buf[32];
+      int fd;
+
+      snprintf(buf, sizeof(buf), "/proc/self/fd/%d", pipefd[0]);
+      fd = uv__open_cloexec(buf, O_RDWR);
+      if (fd >= 0) {
+        uv__close(pipefd[0]);
+        uv__close(pipefd[1]);
+        pipefd[0] = fd;
+        pipefd[1] = fd;
+      }
+    }
+#endif
+  }
+
+  if (err < 0)
+    return err;
+
+  uv__io_init(&wa->io_watcher, uv__async_io, pipefd[0]);
+  uv__io_start(loop, &wa->io_watcher, POLLIN);
+  wa->wfd = pipefd[1];
+  wa->cb = cb;
+
+  return 0;
+}
+
+
+void uv__async_stop(uv_loop_t* loop, struct uv__async* wa) {
+  if (wa->io_watcher.fd == -1)
+    return;
+
+  if (wa->wfd != -1) {
+    if (wa->wfd != wa->io_watcher.fd)
+      uv__close(wa->wfd);
+    wa->wfd = -1;
+  }
+
+  uv__io_stop(loop, &wa->io_watcher, POLLIN);
+  uv__close(wa->io_watcher.fd);
+  wa->io_watcher.fd = -1;
+}
+
+
+static int uv__async_eventfd() {
+#if defined(__linux__)
+  static int no_eventfd2;
+  static int no_eventfd;
+  int fd;
+
+  if (no_eventfd2)
+    goto skip_eventfd2;
+
+  fd = uv__eventfd2(0, UV__EFD_CLOEXEC | UV__EFD_NONBLOCK);
+  if (fd != -1)
+    return fd;
+
+  if (errno != ENOSYS)
+    return -errno;
+
+  no_eventfd2 = 1;
+
+skip_eventfd2:
+
+  if (no_eventfd)
+    goto skip_eventfd;
+
+  fd = uv__eventfd(0);
+  if (fd != -1) {
+    uv__cloexec(fd, 1);
+    uv__nonblock(fd, 1);
+    return fd;
+  }
+
+  if (errno != ENOSYS)
+    return -errno;
+
+  no_eventfd = 1;
+
+skip_eventfd:
+
+#endif
+
+  return -ENOSYS;
+}
diff --git a/deps/libtuv/src/unix/atomic-ops.h b/deps/libtuv/src/unix/atomic-ops.h
new file mode 100644 (file)
index 0000000..815e355
--- /dev/null
@@ -0,0 +1,88 @@
+/* Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef UV_ATOMIC_OPS_H_
+#define UV_ATOMIC_OPS_H_
+
+#include "internal.h"  /* UV_UNUSED */
+
+#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+#include <atomic.h>
+#define __sync_val_compare_and_swap(p, o, n) atomic_cas_ptr(p, o, n)
+#endif
+
+UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval));
+UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval));
+UV_UNUSED(static void cpu_relax(void));
+
+/* Prefer hand-rolled assembly over the gcc builtins because the latter also
+ * issue full memory barriers.
+ */
+UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) {
+#if defined(__i386__) || defined(__x86_64__)
+  int out;
+  __asm__ __volatile__ ("lock; cmpxchg %2, %1;"
+                        : "=a" (out), "+m" (*(volatile int*) ptr)
+                        : "r" (newval), "0" (oldval)
+                        : "memory");
+  return out;
+#elif defined(_AIX) && defined(__xlC__)
+  const int out = (*(volatile int*) ptr);
+  __compare_and_swap(ptr, &oldval, newval);
+  return out;
+#elif defined(__MVS__)
+  return __plo_CS(ptr, (unsigned int*) ptr,
+                  oldval, (unsigned int*) &newval);
+#else
+  return __sync_val_compare_and_swap(ptr, oldval, newval);
+#endif
+}
+
+UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) {
+#if defined(__i386__) || defined(__x86_64__)
+  long out;
+  __asm__ __volatile__ ("lock; cmpxchg %2, %1;"
+                        : "=a" (out), "+m" (*(volatile long*) ptr)
+                        : "r" (newval), "0" (oldval)
+                        : "memory");
+  return out;
+#elif defined(_AIX) && defined(__xlC__)
+  const long out = (*(volatile int*) ptr);
+# if defined(__64BIT__)
+  __compare_and_swaplp(ptr, &oldval, newval);
+# else
+  __compare_and_swap(ptr, &oldval, newval);
+# endif /* if defined(__64BIT__) */
+  return out;
+#elif defined (__MVS__)
+# ifdef _LP64
+  return __plo_CSGR(ptr, (unsigned long long*) ptr,
+                    oldval, (unsigned long long*) &newval);
+# else
+  return __plo_CS(ptr, (unsigned int*) ptr,
+                  oldval, (unsigned int*) &newval);
+# endif
+#else
+  return __sync_val_compare_and_swap(ptr, oldval, newval);
+#endif
+}
+
+UV_UNUSED(static void cpu_relax(void)) {
+#if defined(__i386__) || defined(__x86_64__)
+  __asm__ __volatile__ ("rep; nop");  /* a.k.a. PAUSE */
+#endif
+}
+
+#endif  /* UV_ATOMIC_OPS_H_ */
diff --git a/deps/libtuv/src/unix/core.c b/deps/libtuv/src/unix/core.c
new file mode 100644 (file)
index 0000000..8b29ef9
--- /dev/null
@@ -0,0 +1,834 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <stddef.h> /* NULL */
+#include <stdio.h> /* printf */
+#include <stdlib.h>
+#include <string.h> /* strerror */
+#include <errno.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <limits.h> /* INT_MAX, PATH_MAX, IOV_MAX */
+#if !defined(__TIZENRT__)
+# include <sys/uio.h> /* writev */
+#endif
+#include <pwd.h>
+
+#ifdef __sun
+# include <sys/filio.h>
+# include <sys/types.h>
+# include <sys/wait.h>
+#endif
+
+#ifdef __APPLE__
+# include <mach-o/dyld.h> /* _NSGetExecutablePath */
+# include <sys/filio.h>
+# if defined(O_CLOEXEC)
+#  define UV__O_CLOEXEC O_CLOEXEC
+# endif
+#endif
+
+#if defined(__DragonFly__)      || \
+    defined(__FreeBSD__)        || \
+    defined(__FreeBSD_kernel__)
+# include <sys/sysctl.h>
+# include <sys/filio.h>
+# include <sys/wait.h>
+# define UV__O_CLOEXEC O_CLOEXEC
+# if defined(__FreeBSD__) && __FreeBSD__ >= 10
+#  define uv__accept4 accept4
+#  define UV__SOCK_NONBLOCK SOCK_NONBLOCK
+#  define UV__SOCK_CLOEXEC  SOCK_CLOEXEC
+# endif
+# if !defined(F_DUP2FD_CLOEXEC) && defined(_F_DUP2FD_CLOEXEC)
+#  define F_DUP2FD_CLOEXEC  _F_DUP2FD_CLOEXEC
+# endif
+#endif
+
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
+# include <dlfcn.h>  /* for dlsym */
+#endif
+
+#if defined(__MVS__)
+#include <sys/ioctl.h>
+#endif
+
+static int uv__run_pending(uv_loop_t* loop);
+
+/* Verify that uv_buf_t is ABI-compatible with struct iovec. */
+STATIC_ASSERT(sizeof(uv_buf_t) == sizeof(struct iovec));
+STATIC_ASSERT(sizeof(&((uv_buf_t*) 0)->base) ==
+              sizeof(((struct iovec*) 0)->iov_base));
+STATIC_ASSERT(sizeof(&((uv_buf_t*) 0)->len) ==
+              sizeof(((struct iovec*) 0)->iov_len));
+STATIC_ASSERT(offsetof(uv_buf_t, base) == offsetof(struct iovec, iov_base));
+STATIC_ASSERT(offsetof(uv_buf_t, len) == offsetof(struct iovec, iov_len));
+
+
+void uv_close(uv_handle_t* handle, uv_close_cb close_cb) {
+  assert(!uv__is_closing(handle));
+
+  handle->flags |= UV_CLOSING;
+  handle->close_cb = close_cb;
+
+  switch (handle->type) {
+  case UV_TTY:
+    uv__stream_close((uv_stream_t*)handle);
+    break;
+
+  case UV_TCP:
+    uv__tcp_close((uv_tcp_t*)handle);
+    break;
+
+  case UV_UDP:
+    uv__udp_close((uv_udp_t*)handle);
+    break;
+
+  case UV_IDLE:
+    uv__idle_close((uv_idle_t*)handle);
+    break;
+
+  case UV_ASYNC:
+    uv__async_close((uv_async_t*)handle);
+    break;
+
+  case UV_TIMER:
+    uv__timer_close((uv_timer_t*)handle);
+    break;
+
+  case UV_POLL:
+    uv__poll_close((uv_poll_t*)handle);
+    break;
+
+  default:
+    assert(0);
+  }
+
+  uv__make_close_pending(handle);
+}
+
+
+void uv__make_close_pending(uv_handle_t* handle) {
+  assert(handle->flags & UV_CLOSING);
+  assert(!(handle->flags & UV_CLOSED));
+  handle->next_closing = handle->loop->closing_handles;
+  handle->loop->closing_handles = handle;
+}
+
+int uv__getiovmax(void) {
+#if defined(IOV_MAX)
+  return IOV_MAX;
+#elif defined(_SC_IOV_MAX)
+  static int iovmax = -1;
+  if (iovmax == -1) {
+    iovmax = sysconf(_SC_IOV_MAX);
+    /* On some embedded devices (arm-linux-uclibc based ip camera),
+     * sysconf(_SC_IOV_MAX) can not get the correct value. The return
+     * value is -1 and the errno is EINPROGRESS. Degrade the value to 1.
+     */
+    if (iovmax == -1) iovmax = 1;
+  }
+  return iovmax;
+#else
+  return 1024;
+#endif
+}
+
+
+static void uv__finish_close(uv_handle_t* handle) {
+  /* Note: while the handle is in the UV_CLOSING state now, it's still possible
+   * for it to be active in the sense that uv__is_active() returns true.
+   * A good example is when the user calls uv_shutdown(), immediately followed
+   * by uv_close(). The handle is considered active at this point because the
+   * completion of the shutdown req is still pending.
+   */
+  assert(handle->flags & UV_CLOSING);
+  assert(!(handle->flags & UV_CLOSED));
+  handle->flags |= UV_CLOSED;
+
+  switch (handle->type) {
+    // case UV_PREPARE:
+    // case UV_CHECK:
+    case UV_IDLE:
+    case UV_ASYNC:
+    case UV_TIMER:
+    // case UV_PROCESS:
+    // case UV_FS_EVENT:
+    // case UV_FS_POLL:
+    case UV_POLL:
+    // case UV_SIGNAL:
+      break;
+
+    case UV_NAMED_PIPE:
+    case UV_TCP:
+    case UV_TTY:
+      uv__stream_destroy((uv_stream_t*)handle);
+      break;
+
+    case UV_UDP:
+      uv__udp_finish_close((uv_udp_t*)handle);
+      break;
+
+    default:
+      assert(0);
+      break;
+  }
+
+  uv__handle_unref(handle);
+  QUEUE_REMOVE(&handle->handle_queue);
+
+  if (handle->close_cb) {
+    handle->close_cb(handle);
+  }
+}
+
+
+static void uv__run_closing_handles(uv_loop_t* loop) {
+  uv_handle_t* p;
+  uv_handle_t* q;
+
+  p = loop->closing_handles;
+  loop->closing_handles = NULL;
+
+  while (p) {
+    q = p->next_closing;
+    uv__finish_close(p);
+    p = q;
+  }
+}
+
+
+int uv_is_closing(const uv_handle_t* handle) {
+  return uv__is_closing(handle);
+}
+
+
+int uv_backend_timeout(const uv_loop_t* loop) {
+  if (loop->stop_flag != 0)
+    return 0;
+
+  if (!uv__has_active_handles(loop) && !uv__has_active_reqs(loop))
+    return 0;
+
+  if (!QUEUE_EMPTY(&loop->idle_handles))
+    return 0;
+
+  if (!QUEUE_EMPTY(&loop->pending_queue))
+    return 0;
+
+  if (loop->closing_handles)
+    return 0;
+
+  return uv__next_timeout(loop);
+}
+
+
+static int uv__loop_alive(const uv_loop_t* loop) {
+  return uv__has_active_handles(loop) ||
+         uv__has_active_reqs(loop) ||
+         loop->closing_handles != NULL;
+}
+
+
+int uv_loop_alive(const uv_loop_t* loop) {
+    return uv__loop_alive(loop);
+}
+
+/* test driver */
+int uv_loop_has_active_reqs(const uv_loop_t* loop) {
+    return uv__has_active_reqs(loop);
+}
+
+
+int uv_run(uv_loop_t* loop, uv_run_mode mode) {
+  int timeout;
+  int r;
+  int ran_pending;
+
+  r = uv__loop_alive(loop);
+  if (!r)
+    uv__update_time(loop);
+
+  while (r != 0 && loop->stop_flag == 0) {
+    uv__update_time(loop);
+    uv__run_timers(loop);
+    ran_pending = uv__run_pending(loop);
+    uv__run_idle(loop);
+
+    timeout = 0;
+    if ((mode == UV_RUN_ONCE && !ran_pending) || mode == UV_RUN_DEFAULT)
+      timeout = uv_backend_timeout(loop);
+
+    uv__io_poll(loop, timeout);
+    uv__run_closing_handles(loop);
+
+    if (mode == UV_RUN_ONCE) {
+      /* UV_RUN_ONCE implies forward progress: at least one callback must have
+       * been invoked when it returns. uv__io_poll() can return without doing
+       * I/O (meaning: no callbacks) when its timeout expires - which means we
+       * have pending timers that satisfy the forward progress constraint.
+       *
+       * UV_RUN_NOWAIT makes no guarantees about progress so it's omitted from
+       * the check.
+       */
+      uv__update_time(loop);
+      uv__run_timers(loop);
+    }
+
+    r = uv__loop_alive(loop);
+    if (mode == UV_RUN_ONCE || mode == UV_RUN_NOWAIT)
+      break;
+  }
+
+  /* The if statement lets gcc compile it to a conditional store. Avoids
+   * dirtying a cache line.
+   */
+  if (loop->stop_flag != 0)
+    loop->stop_flag = 0;
+
+  return r;
+}
+
+
+void uv_update_time(uv_loop_t* loop) {
+  uv__update_time(loop);
+}
+
+
+int uv_is_active(const uv_handle_t* handle) {
+  return uv__is_active(handle);
+}
+
+
+/* Open a socket in non-blocking close-on-exec mode, atomically if possible. */
+int uv__socket(int domain, int type, int protocol) {
+  int sockfd;
+  int err;
+
+#if defined(SOCK_NONBLOCK) && defined(SOCK_CLOEXEC)
+  sockfd = socket(domain, type | SOCK_NONBLOCK | SOCK_CLOEXEC, protocol);
+  if (sockfd != -1)
+    return sockfd;
+
+  if (errno != EINVAL)
+    return -errno;
+#endif
+
+  sockfd = socket(domain, type, protocol);
+  if (sockfd == -1)
+    return -errno;
+
+  err = uv__nonblock(sockfd, 1);
+  if (err == 0)
+    err = uv__cloexec(sockfd, 1);
+
+  if (err) {
+    uv__close(sockfd);
+    return err;
+  }
+
+#if defined(SO_NOSIGPIPE)
+  {
+    int on = 1;
+    setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on));
+  }
+#endif
+
+  return sockfd;
+}
+
+
+int uv__accept(int sockfd) {
+  int peerfd;
+  int err;
+
+  assert(sockfd >= 0);
+
+  while (1) {
+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD__ >= 10)
+    static int no_accept4;
+
+    if (no_accept4)
+      goto skip;
+
+    peerfd = uv__accept4(sockfd,
+                         NULL,
+                         NULL,
+                         UV__SOCK_NONBLOCK|UV__SOCK_CLOEXEC);
+    if (peerfd != -1)
+      return peerfd;
+
+    if (errno == EINTR)
+      continue;
+
+    if (errno != ENOSYS)
+      return -errno;
+
+    no_accept4 = 1;
+skip:
+#endif
+
+    peerfd = accept(sockfd, NULL, NULL);
+    if (peerfd == -1) {
+      if (errno == EINTR)
+        continue;
+      return -errno;
+    }
+
+    err = uv__cloexec(peerfd, 1);
+    if (err == 0)
+      err = uv__nonblock(peerfd, 1);
+
+    if (err) {
+      uv__close(peerfd);
+      return err;
+    }
+
+    return peerfd;
+  }
+}
+
+
+int uv__close_nocheckstdio(int fd) {
+  int saved_errno;
+  int rc;
+
+  assert(fd > -1);  /* Catch uninitialized io_watcher.fd bugs. */
+
+  saved_errno = errno;
+  rc = close(fd);
+  if (rc == -1) {
+    rc = -errno;
+    if (rc == -EINTR || rc == -EINPROGRESS)
+      rc = 0;    /* The close is in progress, not an error. */
+    errno = saved_errno;
+  }
+
+  return rc;
+}
+
+
+int uv__close(int fd) {
+#if !defined(__NUTTX__) && !defined(__TIZENRT__) /* No STDERR_FILENO in nuttx */
+  assert(fd > STDERR_FILENO);  /* Catch stdio close bugs. */
+#endif
+  return uv__close_nocheckstdio(fd);
+}
+
+
+#if defined(_AIX) || \
+    defined(__APPLE__) || \
+    defined(__DragonFly__) || \
+    defined(__FreeBSD__) || \
+    defined(__FreeBSD_kernel__) || \
+    defined(__linux__)
+int uv__nonblock_ioctl(int fd, int set) {
+  int r;
+
+  do
+    r = ioctl(fd, FIONBIO, &set);
+  while (r == -1 && errno == EINTR);
+
+  if (r)
+    return -errno;
+
+  return 0;
+}
+
+
+int uv__cloexec_ioctl(int fd, int set) {
+  int r;
+
+  do
+    r = ioctl(fd, set ? FIOCLEX : FIONCLEX);
+  while (r == -1 && errno == EINTR);
+
+  if (r)
+    return -errno;
+
+  return 0;
+}
+#endif
+
+int uv__nonblock_fcntl(int fd, int set) {
+  int flags;
+  int r;
+
+  do
+    r = fcntl(fd, F_GETFL);
+  while (r == -1 && errno == EINTR);
+
+  if (r == -1)
+    return -errno;
+
+  /* Bail out now if already set/clear. */
+  if (!!(r & O_NONBLOCK) == !!set)
+    return 0;
+
+  if (set)
+    flags = r | O_NONBLOCK;
+  else
+    flags = r & ~O_NONBLOCK;
+
+  do
+    r = fcntl(fd, F_SETFL, flags);
+  while (r == -1 && errno == EINTR);
+
+  if (r)
+    return -errno;
+
+  return 0;
+}
+
+
+int uv__cloexec_fcntl(int fd, int set) {
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+  return 0;
+#endif
+  int flags;
+  int r;
+
+  do
+    r = fcntl(fd, F_GETFD);
+  while (r == -1 && errno == EINTR);
+
+  if (r == -1)
+    return -errno;
+
+  /* Bail out now if already set/clear. */
+  if (!!(r & FD_CLOEXEC) == !!set)
+    return 0;
+
+  if (set)
+    flags = r | FD_CLOEXEC;
+  else
+    flags = r & ~FD_CLOEXEC;
+
+  do
+    r = fcntl(fd, F_SETFD, flags);
+  while (r == -1 && errno == EINTR);
+
+  if (r)
+    return -errno;
+
+  return 0;
+}
+
+
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+ssize_t uv__recvmsg(int fd, struct msghdr* msg, int flags) {
+  return -1;
+}
+#else
+ssize_t uv__recvmsg(int fd, struct msghdr* msg, int flags) {
+  struct cmsghdr* cmsg;
+  ssize_t rc;
+  int* pfd;
+  int* end;
+#if defined(__linux__)
+  static int no_msg_cmsg_cloexec;
+  if (no_msg_cmsg_cloexec == 0) {
+    rc = recvmsg(fd, msg, flags | 0x40000000);  /* MSG_CMSG_CLOEXEC */
+    if (rc != -1)
+      return rc;
+    if (errno != EINVAL)
+      return -errno;
+    rc = recvmsg(fd, msg, flags);
+    if (rc == -1)
+      return -errno;
+    no_msg_cmsg_cloexec = 1;
+  } else {
+    rc = recvmsg(fd, msg, flags);
+  }
+#else
+  rc = recvmsg(fd, msg, flags);
+#endif
+  if (rc == -1)
+    return -errno;
+  if (msg->msg_controllen == 0)
+    return rc;
+  for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg))
+    if (cmsg->cmsg_type == SCM_RIGHTS)
+      for (pfd = (int*) CMSG_DATA(cmsg),
+           end = (int*) ((char*) cmsg + cmsg->cmsg_len);
+           pfd < end;
+           pfd += 1)
+        uv__cloexec(*pfd, 1);
+  return rc;
+}
+#endif /* End of !NUTTX */
+
+
+int uv_cwd(char* buffer, size_t* size) {
+  if (buffer == NULL || size == NULL)
+    return -EINVAL;
+
+  if (getcwd(buffer, *size) == NULL)
+    return -errno;
+
+  *size = strlen(buffer);
+  if (*size > 1 && buffer[*size - 1] == '/') {
+    buffer[*size-1] = '\0';
+    (*size)--;
+  }
+
+  return 0;
+}
+
+
+int uv_chdir(const char* dir) {
+  if (chdir(dir))
+    return -errno;
+
+  return 0;
+}
+
+
+static int uv__run_pending(uv_loop_t* loop) {
+  QUEUE* q;
+  QUEUE pq;
+  uv__io_t* w;
+
+  if (QUEUE_EMPTY(&loop->pending_queue))
+    return 0;
+
+  QUEUE_MOVE(&loop->pending_queue, &pq);
+
+  while (!QUEUE_EMPTY(&pq)) {
+    q = QUEUE_HEAD(&pq);
+    QUEUE_REMOVE(q);
+    QUEUE_INIT(q);
+    w = QUEUE_DATA(q, uv__io_t, pending_queue);
+    w->cb(loop, w, POLLOUT);
+  }
+
+  return 1;
+}
+
+
+static unsigned int next_power_of_two(unsigned int val) {
+  val -= 1;
+  val |= val >> 1;
+  val |= val >> 2;
+  val |= val >> 4;
+  val |= val >> 8;
+  val |= val >> 16;
+  val += 1;
+  return val;
+}
+
+static void maybe_resize(uv_loop_t* loop, unsigned int len) {
+  uv__io_t** watchers;
+  void* fake_watcher_list;
+  void* fake_watcher_count;
+  unsigned int nwatchers;
+  unsigned int i;
+
+  if (len <= loop->nwatchers)
+    return;
+
+  /* Preserve fake watcher list and count at the end of the watchers */
+  if (loop->watchers != NULL) {
+    fake_watcher_list = loop->watchers[loop->nwatchers];
+    fake_watcher_count = loop->watchers[loop->nwatchers + 1];
+  } else {
+    fake_watcher_list = NULL;
+    fake_watcher_count = NULL;
+  }
+
+  nwatchers = next_power_of_two(len + 2) - 2;
+  watchers = uv__realloc(loop->watchers,
+                         (nwatchers + 2) * sizeof(loop->watchers[0]));
+
+  if (watchers == NULL)
+    abort();
+  for (i = loop->nwatchers; i < nwatchers; i++)
+    watchers[i] = NULL;
+  watchers[nwatchers] = fake_watcher_list;
+  watchers[nwatchers + 1] = fake_watcher_count;
+
+  loop->watchers = watchers;
+  loop->nwatchers = nwatchers;
+}
+
+
+void uv__io_init(uv__io_t* w, uv__io_cb cb, int fd) {
+  assert(cb != NULL);
+  assert(fd >= -1);
+  QUEUE_INIT(&w->pending_queue);
+  QUEUE_INIT(&w->watcher_queue);
+  w->cb = cb;
+  w->fd = fd;
+  w->events = 0;
+  w->pevents = 0;
+
+#if defined(UV_HAVE_KQUEUE)
+  w->rcount = 0;
+  w->wcount = 0;
+#endif /* defined(UV_HAVE_KQUEUE) */
+}
+
+
+void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
+  assert(0 == (events & ~(POLLIN | POLLOUT | UV__POLLRDHUP)));
+  assert(0 != events);
+  assert(w->fd >= 0);
+  assert(w->fd < INT_MAX);
+
+  w->pevents |= events;
+  maybe_resize(loop, w->fd + 1);
+
+#if !defined(__sun)
+  /* The event ports backend needs to rearm all file descriptors on each and
+   * every tick of the event loop but the other backends allow us to
+   * short-circuit here if the event mask is unchanged.
+   */
+  if (w->events == w->pevents) {
+    if (w->events == 0 && !QUEUE_EMPTY(&w->watcher_queue)) {
+      QUEUE_REMOVE(&w->watcher_queue);
+      QUEUE_INIT(&w->watcher_queue);
+    }
+    return;
+  }
+#endif
+
+  if (QUEUE_EMPTY(&w->watcher_queue))
+    QUEUE_INSERT_TAIL(&loop->watcher_queue, &w->watcher_queue);
+
+  if (loop->watchers[w->fd] == NULL) {
+    loop->watchers[w->fd] = w;
+    loop->nfds++;
+  }
+}
+
+
+void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
+  assert(0 == (events & ~(POLLIN | POLLOUT | UV__POLLRDHUP)));
+  assert(0 != events);
+
+  if (w->fd == -1)
+    return;
+
+  assert(w->fd >= 0);
+
+  /* Happens when uv__io_stop() is called on a handle that was never started. */
+  if ((unsigned) w->fd >= loop->nwatchers)
+    return;
+
+  w->pevents &= ~events;
+
+  if (w->pevents == 0) {
+    QUEUE_REMOVE(&w->watcher_queue);
+    QUEUE_INIT(&w->watcher_queue);
+
+    if (loop->watchers[w->fd] != NULL) {
+      assert(loop->watchers[w->fd] == w);
+      assert(loop->nfds > 0);
+      loop->watchers[w->fd] = NULL;
+      loop->nfds--;
+      w->events = 0;
+    }
+  }
+  else if (QUEUE_EMPTY(&w->watcher_queue))
+    QUEUE_INSERT_TAIL(&loop->watcher_queue, &w->watcher_queue);
+}
+
+
+void uv__io_close(uv_loop_t* loop, uv__io_t* w) {
+  uv__io_stop(loop, w, POLLIN | POLLOUT | UV__POLLRDHUP);
+  QUEUE_REMOVE(&w->pending_queue);
+
+  /* Remove stale events for this file descriptor */
+  uv__platform_invalidate_fd(loop, w->fd);
+}
+
+
+void uv__io_feed(uv_loop_t* loop, uv__io_t* w) {
+  if (QUEUE_EMPTY(&w->pending_queue))
+    QUEUE_INSERT_TAIL(&loop->pending_queue, &w->pending_queue);
+}
+
+
+int uv__io_active(const uv__io_t* w, unsigned int events) {
+  assert(0 == (events & ~(POLLIN | POLLOUT | UV__POLLRDHUP)));
+  assert(0 != events);
+  return 0 != (w->pevents & events);
+}
+
+
+int uv__open_cloexec(const char* path, int flags) {
+  int err;
+  int fd;
+
+#if defined(UV__O_CLOEXEC)
+  static int no_cloexec;
+
+  if (!no_cloexec) {
+    fd = open(path, flags | UV__O_CLOEXEC);
+    if (fd != -1)
+      return fd;
+
+    if (errno != EINVAL)
+      return -errno;
+
+    /* O_CLOEXEC not supported. */
+    no_cloexec = 1;
+  }
+#endif
+
+  fd = open(path, flags);
+  if (fd == -1)
+    return -errno;
+
+  err = uv__cloexec(fd, 1);
+  if (err) {
+    uv__close(fd);
+    return err;
+  }
+
+  return fd;
+}
+
diff --git a/deps/libtuv/src/unix/darwin-proctitle.c b/deps/libtuv/src/unix/darwin-proctitle.c
new file mode 100644 (file)
index 0000000..1142311
--- /dev/null
@@ -0,0 +1,206 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <dlfcn.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <TargetConditionals.h>
+
+#if !TARGET_OS_IPHONE
+# include <CoreFoundation/CoreFoundation.h>
+# include <ApplicationServices/ApplicationServices.h>
+#endif
+
+
+static int uv__pthread_setname_np(const char* name) {
+  int (*dynamic_pthread_setname_np)(const char* name);
+  char namebuf[64];  /* MAXTHREADNAMESIZE */
+  int err;
+
+  /* pthread_setname_np() first appeared in OS X 10.6 and iOS 3.2. */
+  *(void **)(&dynamic_pthread_setname_np) =
+      dlsym(RTLD_DEFAULT, "pthread_setname_np");
+
+  if (dynamic_pthread_setname_np == NULL)
+    return -ENOSYS;
+
+  strncpy(namebuf, name, sizeof(namebuf) - 1);
+  namebuf[sizeof(namebuf) - 1] = '\0';
+
+  err = dynamic_pthread_setname_np(namebuf);
+  if (err)
+    return -err;
+
+  return 0;
+}
+
+
+int uv__set_process_title(const char* title) {
+#if TARGET_OS_IPHONE
+  return uv__pthread_setname_np(title);
+#else
+  CFStringRef (*pCFStringCreateWithCString)(CFAllocatorRef,
+                                            const char*,
+                                            CFStringEncoding);
+  CFBundleRef (*pCFBundleGetBundleWithIdentifier)(CFStringRef);
+  void *(*pCFBundleGetDataPointerForName)(CFBundleRef, CFStringRef);
+  void *(*pCFBundleGetFunctionPointerForName)(CFBundleRef, CFStringRef);
+  CFTypeRef (*pLSGetCurrentApplicationASN)(void);
+  OSStatus (*pLSSetApplicationInformationItem)(int,
+                                               CFTypeRef,
+                                               CFStringRef,
+                                               CFStringRef,
+                                               CFDictionaryRef*);
+  void* application_services_handle;
+  void* core_foundation_handle;
+  CFBundleRef launch_services_bundle;
+  CFStringRef* display_name_key;
+  CFDictionaryRef (*pCFBundleGetInfoDictionary)(CFBundleRef);
+  CFBundleRef (*pCFBundleGetMainBundle)(void);
+  CFBundleRef hi_services_bundle;
+  OSStatus (*pSetApplicationIsDaemon)(int);
+  CFDictionaryRef (*pLSApplicationCheckIn)(int, CFDictionaryRef);
+  void (*pLSSetApplicationLaunchServicesServerConnectionStatus)(uint64_t,
+                                                                void*);
+  CFTypeRef asn;
+  int err;
+
+  err = -ENOENT;
+  application_services_handle = dlopen("/System/Library/Frameworks/"
+                                       "ApplicationServices.framework/"
+                                       "Versions/A/ApplicationServices",
+                                       RTLD_LAZY | RTLD_LOCAL);
+  core_foundation_handle = dlopen("/System/Library/Frameworks/"
+                                  "CoreFoundation.framework/"
+                                  "Versions/A/CoreFoundation",
+                                  RTLD_LAZY | RTLD_LOCAL);
+
+  if (application_services_handle == NULL || core_foundation_handle == NULL)
+    goto out;
+
+  *(void **)(&pCFStringCreateWithCString) =
+      dlsym(core_foundation_handle, "CFStringCreateWithCString");
+  *(void **)(&pCFBundleGetBundleWithIdentifier) =
+      dlsym(core_foundation_handle, "CFBundleGetBundleWithIdentifier");
+  *(void **)(&pCFBundleGetDataPointerForName) =
+      dlsym(core_foundation_handle, "CFBundleGetDataPointerForName");
+  *(void **)(&pCFBundleGetFunctionPointerForName) =
+      dlsym(core_foundation_handle, "CFBundleGetFunctionPointerForName");
+
+  if (pCFStringCreateWithCString == NULL ||
+      pCFBundleGetBundleWithIdentifier == NULL ||
+      pCFBundleGetDataPointerForName == NULL ||
+      pCFBundleGetFunctionPointerForName == NULL) {
+    goto out;
+  }
+
+#define S(s) pCFStringCreateWithCString(NULL, (s), kCFStringEncodingUTF8)
+
+  launch_services_bundle =
+      pCFBundleGetBundleWithIdentifier(S("com.apple.LaunchServices"));
+
+  if (launch_services_bundle == NULL)
+    goto out;
+
+  *(void **)(&pLSGetCurrentApplicationASN) =
+      pCFBundleGetFunctionPointerForName(launch_services_bundle,
+                                         S("_LSGetCurrentApplicationASN"));
+
+  if (pLSGetCurrentApplicationASN == NULL)
+    goto out;
+
+  *(void **)(&pLSSetApplicationInformationItem) =
+      pCFBundleGetFunctionPointerForName(launch_services_bundle,
+                                         S("_LSSetApplicationInformationItem"));
+
+  if (pLSSetApplicationInformationItem == NULL)
+    goto out;
+
+  display_name_key = pCFBundleGetDataPointerForName(launch_services_bundle,
+                                                    S("_kLSDisplayNameKey"));
+
+  if (display_name_key == NULL || *display_name_key == NULL)
+    goto out;
+
+  *(void **)(&pCFBundleGetInfoDictionary) = dlsym(core_foundation_handle,
+                                     "CFBundleGetInfoDictionary");
+  *(void **)(&pCFBundleGetMainBundle) = dlsym(core_foundation_handle,
+                                 "CFBundleGetMainBundle");
+  if (pCFBundleGetInfoDictionary == NULL || pCFBundleGetMainBundle == NULL)
+    goto out;
+
+  /* Black 10.9 magic, to remove (Not responding) mark in Activity Monitor */
+  hi_services_bundle =
+      pCFBundleGetBundleWithIdentifier(S("com.apple.HIServices"));
+  err = -ENOENT;
+  if (hi_services_bundle == NULL)
+    goto out;
+
+  *(void **)(&pSetApplicationIsDaemon) = pCFBundleGetFunctionPointerForName(
+      hi_services_bundle,
+      S("SetApplicationIsDaemon"));
+  *(void **)(&pLSApplicationCheckIn) = pCFBundleGetFunctionPointerForName(
+      launch_services_bundle,
+      S("_LSApplicationCheckIn"));
+  *(void **)(&pLSSetApplicationLaunchServicesServerConnectionStatus) =
+      pCFBundleGetFunctionPointerForName(
+          launch_services_bundle,
+          S("_LSSetApplicationLaunchServicesServerConnectionStatus"));
+  if (pSetApplicationIsDaemon == NULL ||
+      pLSApplicationCheckIn == NULL ||
+      pLSSetApplicationLaunchServicesServerConnectionStatus == NULL) {
+    goto out;
+  }
+
+  if (pSetApplicationIsDaemon(1) != noErr)
+    goto out;
+
+  pLSSetApplicationLaunchServicesServerConnectionStatus(0, NULL);
+
+  /* Check into process manager?! */
+  pLSApplicationCheckIn(-2,
+                        pCFBundleGetInfoDictionary(pCFBundleGetMainBundle()));
+
+  asn = pLSGetCurrentApplicationASN();
+
+  err = -EINVAL;
+  if (pLSSetApplicationInformationItem(-2,  /* Magic value. */
+                                       asn,
+                                       *display_name_key,
+                                       S(title),
+                                       NULL) != noErr) {
+    goto out;
+  }
+
+  uv__pthread_setname_np(title);  /* Don't care if it fails. */
+  err = 0;
+
+out:
+  if (core_foundation_handle != NULL)
+    dlclose(core_foundation_handle);
+
+  if (application_services_handle != NULL)
+    dlclose(application_services_handle);
+
+  return err;
+#endif  /* !TARGET_OS_IPHONE */
+}
diff --git a/deps/libtuv/src/unix/darwin.c b/deps/libtuv/src/unix/darwin.c
new file mode 100644 (file)
index 0000000..cf95da2
--- /dev/null
@@ -0,0 +1,335 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <assert.h>
+#include <stdint.h>
+#include <errno.h>
+
+#include <ifaddrs.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+
+#include <mach/mach.h>
+#include <mach/mach_time.h>
+#include <mach-o/dyld.h> /* _NSGetExecutablePath */
+#include <sys/resource.h>
+#include <sys/sysctl.h>
+#include <unistd.h>  /* sysconf */
+
+
+int uv__platform_loop_init(uv_loop_t* loop) {
+  loop->cf_state = NULL;
+
+  if (uv__kqueue_init(loop))
+    return -errno;
+
+  return 0;
+}
+
+
+void uv__platform_loop_delete(uv_loop_t* loop) {
+  uv__fsevents_loop_delete(loop);
+}
+
+
+uint64_t uv__hrtime(uv_clocktype_t type) {
+  static mach_timebase_info_data_t info;
+
+  if ((ACCESS_ONCE(uint32_t, info.numer) == 0 ||
+       ACCESS_ONCE(uint32_t, info.denom) == 0) &&
+      mach_timebase_info(&info) != KERN_SUCCESS)
+    abort();
+
+  return mach_absolute_time() * info.numer / info.denom;
+}
+
+
+int uv_exepath(char* buffer, size_t* size) {
+  /* realpath(exepath) may be > PATH_MAX so double it to be on the safe side. */
+  char abspath[PATH_MAX * 2 + 1];
+  char exepath[PATH_MAX + 1];
+  uint32_t exepath_size;
+  size_t abspath_size;
+
+  if (buffer == NULL || size == NULL || *size == 0)
+    return -EINVAL;
+
+  exepath_size = sizeof(exepath);
+  if (_NSGetExecutablePath(exepath, &exepath_size))
+    return -EIO;
+
+  if (realpath(exepath, abspath) != abspath)
+    return -errno;
+
+  abspath_size = strlen(abspath);
+  if (abspath_size == 0)
+    return -EIO;
+
+  *size -= 1;
+  if (*size > abspath_size)
+    *size = abspath_size;
+
+  memcpy(buffer, abspath, *size);
+  buffer[*size] = '\0';
+
+  return 0;
+}
+
+
+uint64_t uv_get_free_memory(void) {
+  vm_statistics_data_t info;
+  mach_msg_type_number_t count = sizeof(info) / sizeof(integer_t);
+
+  if (host_statistics(mach_host_self(), HOST_VM_INFO,
+                      (host_info_t)&info, &count) != KERN_SUCCESS) {
+    return -EINVAL;  /* FIXME(bnoordhuis) Translate error. */
+  }
+
+  return (uint64_t) info.free_count * sysconf(_SC_PAGESIZE);
+}
+
+
+uint64_t uv_get_total_memory(void) {
+  uint64_t info;
+  int which[] = {CTL_HW, HW_MEMSIZE};
+  size_t size = sizeof(info);
+
+  if (sysctl(which, 2, &info, &size, NULL, 0))
+    return -errno;
+
+  return (uint64_t) info;
+}
+
+
+void uv_loadavg(double avg[3]) {
+  struct loadavg info;
+  size_t size = sizeof(info);
+  int which[] = {CTL_VM, VM_LOADAVG};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) return;
+
+  avg[0] = (double) info.ldavg[0] / info.fscale;
+  avg[1] = (double) info.ldavg[1] / info.fscale;
+  avg[2] = (double) info.ldavg[2] / info.fscale;
+}
+
+
+int uv_resident_set_memory(size_t* rss) {
+  mach_msg_type_number_t count;
+  task_basic_info_data_t info;
+  kern_return_t err;
+
+  count = TASK_BASIC_INFO_COUNT;
+  err = task_info(mach_task_self(),
+                  TASK_BASIC_INFO,
+                  (task_info_t) &info,
+                  &count);
+  (void) &err;
+  /* task_info(TASK_BASIC_INFO) cannot really fail. Anything other than
+   * KERN_SUCCESS implies a libuv bug.
+   */
+  assert(err == KERN_SUCCESS);
+  *rss = info.resident_size;
+
+  return 0;
+}
+
+
+int uv_uptime(double* uptime) {
+  time_t now;
+  struct timeval info;
+  size_t size = sizeof(info);
+  static int which[] = {CTL_KERN, KERN_BOOTTIME};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0))
+    return -errno;
+
+  now = time(NULL);
+  *uptime = now - info.tv_sec;
+
+  return 0;
+}
+
+int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
+  unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
+               multiplier = ((uint64_t)1000L / ticks);
+  char model[512];
+  uint64_t cpuspeed;
+  size_t size;
+  unsigned int i;
+  natural_t numcpus;
+  mach_msg_type_number_t msg_type;
+  processor_cpu_load_info_data_t *info;
+  uv_cpu_info_t* cpu_info;
+
+  size = sizeof(model);
+  if (sysctlbyname("machdep.cpu.brand_string", &model, &size, NULL, 0) &&
+      sysctlbyname("hw.model", &model, &size, NULL, 0)) {
+    return -errno;
+  }
+
+  size = sizeof(cpuspeed);
+  if (sysctlbyname("hw.cpufrequency", &cpuspeed, &size, NULL, 0))
+    return -errno;
+
+  if (host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &numcpus,
+                          (processor_info_array_t*)&info,
+                          &msg_type) != KERN_SUCCESS) {
+    return -EINVAL;  /* FIXME(bnoordhuis) Translate error. */
+  }
+
+  *cpu_infos = uv__malloc(numcpus * sizeof(**cpu_infos));
+  if (!(*cpu_infos)) {
+    vm_deallocate(mach_task_self(), (vm_address_t)info, msg_type);
+    return -ENOMEM;
+  }
+
+  *count = numcpus;
+
+  for (i = 0; i < numcpus; i++) {
+    cpu_info = &(*cpu_infos)[i];
+
+    cpu_info->cpu_times.user = (uint64_t)(info[i].cpu_ticks[0]) * multiplier;
+    cpu_info->cpu_times.nice = (uint64_t)(info[i].cpu_ticks[3]) * multiplier;
+    cpu_info->cpu_times.sys = (uint64_t)(info[i].cpu_ticks[1]) * multiplier;
+    cpu_info->cpu_times.idle = (uint64_t)(info[i].cpu_ticks[2]) * multiplier;
+    cpu_info->cpu_times.irq = 0;
+
+    cpu_info->model = uv__strdup(model);
+    cpu_info->speed = cpuspeed/1000000;
+  }
+  vm_deallocate(mach_task_self(), (vm_address_t)info, msg_type);
+
+  return 0;
+}
+
+
+void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
+  int i;
+
+  for (i = 0; i < count; i++) {
+    uv__free(cpu_infos[i].model);
+  }
+
+  uv__free(cpu_infos);
+}
+
+
+int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
+  struct ifaddrs *addrs, *ent;
+  uv_interface_address_t* address;
+  int i;
+  struct sockaddr_dl *sa_addr;
+
+  if (getifaddrs(&addrs))
+    return -errno;
+
+  *count = 0;
+
+  /* Count the number of interfaces */
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
+        (ent->ifa_addr == NULL) ||
+        (ent->ifa_addr->sa_family == AF_LINK)) {
+      continue;
+    }
+
+    (*count)++;
+  }
+
+  *addresses = uv__malloc(*count * sizeof(**addresses));
+  if (!(*addresses)) {
+    freeifaddrs(addrs);
+    return -ENOMEM;
+  }
+
+  address = *addresses;
+
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
+      continue;
+
+    if (ent->ifa_addr == NULL)
+      continue;
+
+    /*
+     * On Mac OS X getifaddrs returns information related to Mac Addresses for
+     * various devices, such as firewire, etc. These are not relevant here.
+     */
+    if (ent->ifa_addr->sa_family == AF_LINK)
+      continue;
+
+    address->name = uv__strdup(ent->ifa_name);
+
+    if (ent->ifa_addr->sa_family == AF_INET6) {
+      address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
+    } else {
+      address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
+    }
+
+    if (ent->ifa_netmask->sa_family == AF_INET6) {
+      address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
+    } else {
+      address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
+    }
+
+    address->is_internal = !!(ent->ifa_flags & IFF_LOOPBACK);
+
+    address++;
+  }
+
+  /* Fill in physical addresses for each interface */
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
+        (ent->ifa_addr == NULL) ||
+        (ent->ifa_addr->sa_family != AF_LINK)) {
+      continue;
+    }
+
+    address = *addresses;
+
+    for (i = 0; i < (*count); i++) {
+      if (strcmp(address->name, ent->ifa_name) == 0) {
+        sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
+        memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
+      }
+      address++;
+    }
+  }
+
+  freeifaddrs(addrs);
+
+  return 0;
+}
+
+
+void uv_free_interface_addresses(uv_interface_address_t* addresses,
+  int count) {
+  int i;
+
+  for (i = 0; i < count; i++) {
+    uv__free(addresses[i].name);
+  }
+
+  uv__free(addresses);
+}
diff --git a/deps/libtuv/src/unix/dl.c b/deps/libtuv/src/unix/dl.c
new file mode 100644 (file)
index 0000000..fc1c052
--- /dev/null
@@ -0,0 +1,80 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <dlfcn.h>
+#include <errno.h>
+#include <string.h>
+#include <locale.h>
+
+static int uv__dlerror(uv_lib_t* lib);
+
+
+int uv_dlopen(const char* filename, uv_lib_t* lib) {
+  dlerror(); /* Reset error status. */
+  lib->errmsg = NULL;
+  lib->handle = dlopen(filename, RTLD_LAZY);
+  return lib->handle ? 0 : uv__dlerror(lib);
+}
+
+
+void uv_dlclose(uv_lib_t* lib) {
+  uv__free(lib->errmsg);
+  lib->errmsg = NULL;
+
+  if (lib->handle) {
+    /* Ignore errors. No good way to signal them without leaking memory. */
+    dlclose(lib->handle);
+    lib->handle = NULL;
+  }
+}
+
+
+int uv_dlsym(uv_lib_t* lib, const char* name, void** ptr) {
+  dlerror(); /* Reset error status. */
+  *ptr = dlsym(lib->handle, name);
+  return uv__dlerror(lib);
+}
+
+
+const char* uv_dlerror(const uv_lib_t* lib) {
+  return lib->errmsg ? lib->errmsg : "no error";
+}
+
+
+static int uv__dlerror(uv_lib_t* lib) {
+  const char* errmsg;
+
+  uv__free(lib->errmsg);
+
+  errmsg = dlerror();
+
+  if (errmsg) {
+    lib->errmsg = uv__strdup(errmsg);
+    return -1;
+  }
+  else {
+    lib->errmsg = NULL;
+    return 0;
+  }
+}
diff --git a/deps/libtuv/src/unix/freebsd.c b/deps/libtuv/src/unix/freebsd.c
new file mode 100644 (file)
index 0000000..cba44a3
--- /dev/null
@@ -0,0 +1,460 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <assert.h>
+#include <string.h>
+#include <errno.h>
+
+#include <ifaddrs.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+
+#include <kvm.h>
+#include <paths.h>
+#include <sys/user.h>
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <sys/sysctl.h>
+#include <vm/vm_param.h> /* VM_LOADAVG */
+#include <time.h>
+#include <stdlib.h>
+#include <unistd.h> /* sysconf */
+#include <fcntl.h>
+
+#undef NANOSEC
+#define NANOSEC ((uint64_t) 1e9)
+
+#ifndef CPUSTATES
+# define CPUSTATES 5U
+#endif
+#ifndef CP_USER
+# define CP_USER 0
+# define CP_NICE 1
+# define CP_SYS 2
+# define CP_IDLE 3
+# define CP_INTR 4
+#endif
+
+static char *process_title;
+
+
+int uv__platform_loop_init(uv_loop_t* loop) {
+  return uv__kqueue_init(loop);
+}
+
+
+void uv__platform_loop_delete(uv_loop_t* loop) {
+}
+
+
+uint64_t uv__hrtime(uv_clocktype_t type) {
+  struct timespec ts;
+  clock_gettime(CLOCK_MONOTONIC, &ts);
+  return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
+}
+
+
+#ifdef __DragonFly__
+int uv_exepath(char* buffer, size_t* size) {
+  char abspath[PATH_MAX * 2 + 1];
+  ssize_t abspath_size;
+
+  if (buffer == NULL || size == NULL || *size == 0)
+    return -EINVAL;
+
+  abspath_size = readlink("/proc/curproc/file", abspath, sizeof(abspath));
+  if (abspath_size < 0)
+    return -errno;
+
+  assert(abspath_size > 0);
+  *size -= 1;
+
+  if (*size > abspath_size)
+    *size = abspath_size;
+
+  memcpy(buffer, abspath, *size);
+  buffer[*size] = '\0';
+
+  return 0;
+}
+#else
+int uv_exepath(char* buffer, size_t* size) {
+  char abspath[PATH_MAX * 2 + 1];
+  int mib[4];
+  size_t abspath_size;
+
+  if (buffer == NULL || size == NULL || *size == 0)
+    return -EINVAL;
+
+  mib[0] = CTL_KERN;
+  mib[1] = KERN_PROC;
+  mib[2] = KERN_PROC_PATHNAME;
+  mib[3] = -1;
+
+  abspath_size = sizeof abspath;
+  if (sysctl(mib, 4, abspath, &abspath_size, NULL, 0))
+    return -errno;
+
+  assert(abspath_size > 0);
+  abspath_size -= 1;
+  *size -= 1;
+
+  if (*size > abspath_size)
+    *size = abspath_size;
+
+  memcpy(buffer, abspath, *size);
+  buffer[*size] = '\0';
+
+  return 0;
+}
+#endif
+
+uint64_t uv_get_free_memory(void) {
+  int freecount;
+  size_t size = sizeof(freecount);
+
+  if (sysctlbyname("vm.stats.vm.v_free_count", &freecount, &size, NULL, 0))
+    return -errno;
+
+  return (uint64_t) freecount * sysconf(_SC_PAGESIZE);
+
+}
+
+
+uint64_t uv_get_total_memory(void) {
+  unsigned long info;
+  int which[] = {CTL_HW, HW_PHYSMEM};
+
+  size_t size = sizeof(info);
+
+  if (sysctl(which, 2, &info, &size, NULL, 0))
+    return -errno;
+
+  return (uint64_t) info;
+}
+
+
+void uv_loadavg(double avg[3]) {
+  struct loadavg info;
+  size_t size = sizeof(info);
+  int which[] = {CTL_VM, VM_LOADAVG};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) return;
+
+  avg[0] = (double) info.ldavg[0] / info.fscale;
+  avg[1] = (double) info.ldavg[1] / info.fscale;
+  avg[2] = (double) info.ldavg[2] / info.fscale;
+}
+
+
+char** uv_setup_args(int argc, char** argv) {
+  process_title = argc ? uv__strdup(argv[0]) : NULL;
+  return argv;
+}
+
+
+int uv_set_process_title(const char* title) {
+  int oid[4];
+
+  uv__free(process_title);
+  process_title = uv__strdup(title);
+
+  oid[0] = CTL_KERN;
+  oid[1] = KERN_PROC;
+  oid[2] = KERN_PROC_ARGS;
+  oid[3] = getpid();
+
+  sysctl(oid,
+         ARRAY_SIZE(oid),
+         NULL,
+         NULL,
+         process_title,
+         strlen(process_title) + 1);
+
+  return 0;
+}
+
+
+int uv_get_process_title(char* buffer, size_t size) {
+  size_t len;
+
+  if (buffer == NULL || size == 0)
+    return -EINVAL;
+
+  if (process_title) {
+    len = strlen(process_title) + 1;
+
+    if (size < len)
+      return -ENOBUFS;
+
+    memcpy(buffer, process_title, len);
+  } else {
+    len = 0;
+  }
+
+  buffer[len] = '\0';
+
+  return 0;
+}
+
+
+int uv_resident_set_memory(size_t* rss) {
+  kvm_t *kd = NULL;
+  struct kinfo_proc *kinfo = NULL;
+  pid_t pid;
+  int nprocs;
+  size_t page_size = getpagesize();
+
+  pid = getpid();
+
+  kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open");
+  if (kd == NULL) goto error;
+
+  kinfo = kvm_getprocs(kd, KERN_PROC_PID, pid, &nprocs);
+  if (kinfo == NULL) goto error;
+
+#ifdef __DragonFly__
+  *rss = kinfo->kp_vm_rssize * page_size;
+#else
+  *rss = kinfo->ki_rssize * page_size;
+#endif
+
+  kvm_close(kd);
+
+  return 0;
+
+error:
+  if (kd) kvm_close(kd);
+  return -EPERM;
+}
+
+
+int uv_uptime(double* uptime) {
+  int r;
+  struct timespec sp;
+  r = clock_gettime(CLOCK_MONOTONIC, &sp);
+  if (r)
+    return -errno;
+
+  *uptime = sp.tv_sec;
+  return 0;
+}
+
+
+int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
+  unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
+               multiplier = ((uint64_t)1000L / ticks), cpuspeed, maxcpus,
+               cur = 0;
+  uv_cpu_info_t* cpu_info;
+  const char* maxcpus_key;
+  const char* cptimes_key;
+  char model[512];
+  long* cp_times;
+  int numcpus;
+  size_t size;
+  int i;
+
+#if defined(__DragonFly__)
+  /* This is not quite correct but DragonFlyBSD doesn't seem to have anything
+   * comparable to kern.smp.maxcpus or kern.cp_times (kern.cp_time is a total,
+   * not per CPU). At least this stops uv_cpu_info() from failing completely.
+   */
+  maxcpus_key = "hw.ncpu";
+  cptimes_key = "kern.cp_time";
+#else
+  maxcpus_key = "kern.smp.maxcpus";
+  cptimes_key = "kern.cp_times";
+#endif
+
+  size = sizeof(model);
+  if (sysctlbyname("hw.model", &model, &size, NULL, 0))
+    return -errno;
+
+  size = sizeof(numcpus);
+  if (sysctlbyname("hw.ncpu", &numcpus, &size, NULL, 0))
+    return -errno;
+
+  *cpu_infos = uv__malloc(numcpus * sizeof(**cpu_infos));
+  if (!(*cpu_infos))
+    return -ENOMEM;
+
+  *count = numcpus;
+
+  size = sizeof(cpuspeed);
+  if (sysctlbyname("hw.clockrate", &cpuspeed, &size, NULL, 0)) {
+    uv__free(*cpu_infos);
+    return -errno;
+  }
+
+  /* kern.cp_times on FreeBSD i386 gives an array up to maxcpus instead of
+   * ncpu.
+   */
+  size = sizeof(maxcpus);
+  if (sysctlbyname(maxcpus_key, &maxcpus, &size, NULL, 0)) {
+    uv__free(*cpu_infos);
+    return -errno;
+  }
+
+  size = maxcpus * CPUSTATES * sizeof(long);
+
+  cp_times = uv__malloc(size);
+  if (cp_times == NULL) {
+    uv__free(*cpu_infos);
+    return -ENOMEM;
+  }
+
+  if (sysctlbyname(cptimes_key, cp_times, &size, NULL, 0)) {
+    uv__free(cp_times);
+    uv__free(*cpu_infos);
+    return -errno;
+  }
+
+  for (i = 0; i < numcpus; i++) {
+    cpu_info = &(*cpu_infos)[i];
+
+    cpu_info->cpu_times.user = (uint64_t)(cp_times[CP_USER+cur]) * multiplier;
+    cpu_info->cpu_times.nice = (uint64_t)(cp_times[CP_NICE+cur]) * multiplier;
+    cpu_info->cpu_times.sys = (uint64_t)(cp_times[CP_SYS+cur]) * multiplier;
+    cpu_info->cpu_times.idle = (uint64_t)(cp_times[CP_IDLE+cur]) * multiplier;
+    cpu_info->cpu_times.irq = (uint64_t)(cp_times[CP_INTR+cur]) * multiplier;
+
+    cpu_info->model = uv__strdup(model);
+    cpu_info->speed = cpuspeed;
+
+    cur+=CPUSTATES;
+  }
+
+  uv__free(cp_times);
+  return 0;
+}
+
+
+void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
+  int i;
+
+  for (i = 0; i < count; i++) {
+    uv__free(cpu_infos[i].model);
+  }
+
+  uv__free(cpu_infos);
+}
+
+
+int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
+  struct ifaddrs *addrs, *ent;
+  uv_interface_address_t* address;
+  int i;
+  struct sockaddr_dl *sa_addr;
+
+  if (getifaddrs(&addrs))
+    return -errno;
+
+   *count = 0;
+
+  /* Count the number of interfaces */
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
+        (ent->ifa_addr == NULL) ||
+        (ent->ifa_addr->sa_family == AF_LINK)) {
+      continue;
+    }
+
+    (*count)++;
+  }
+
+  *addresses = uv__malloc(*count * sizeof(**addresses));
+  if (!(*addresses)) {
+    freeifaddrs(addrs);
+    return -ENOMEM;
+  }
+
+  address = *addresses;
+
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
+      continue;
+
+    if (ent->ifa_addr == NULL)
+      continue;
+
+    /*
+     * On FreeBSD getifaddrs returns information related to the raw underlying
+     * devices. We're not interested in this information yet.
+     */
+    if (ent->ifa_addr->sa_family == AF_LINK)
+      continue;
+
+    address->name = uv__strdup(ent->ifa_name);
+
+    if (ent->ifa_addr->sa_family == AF_INET6) {
+      address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
+    } else {
+      address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
+    }
+
+    if (ent->ifa_netmask->sa_family == AF_INET6) {
+      address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
+    } else {
+      address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
+    }
+
+    address->is_internal = !!(ent->ifa_flags & IFF_LOOPBACK);
+
+    address++;
+  }
+
+  /* Fill in physical addresses for each interface */
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
+        (ent->ifa_addr == NULL) ||
+        (ent->ifa_addr->sa_family != AF_LINK)) {
+      continue;
+    }
+
+    address = *addresses;
+
+    for (i = 0; i < (*count); i++) {
+      if (strcmp(address->name, ent->ifa_name) == 0) {
+        sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
+        memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
+      }
+      address++;
+    }
+  }
+
+  freeifaddrs(addrs);
+
+  return 0;
+}
+
+
+void uv_free_interface_addresses(uv_interface_address_t* addresses,
+  int count) {
+  int i;
+
+  for (i = 0; i < count; i++) {
+    uv__free(addresses[i].name);
+  }
+
+  uv__free(addresses);
+}
diff --git a/deps/libtuv/src/unix/fs.c b/deps/libtuv/src/unix/fs.c
new file mode 100644 (file)
index 0000000..4281246
--- /dev/null
@@ -0,0 +1,937 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/* Caveat emptor: this file deviates from the libuv convention of returning
+ * negated errno codes. Most uv_fs_*() functions map directly to the system
+ * call of the same name. For more complex wrappers, it's easier to just
+ * return -1 with errno set. The dispatcher in uv__fs_work() takes care of
+ * getting the errno to the right place (req->result or as the return value.)
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h> /* PATH_MAX */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#if !defined(__TIZENRT__)
+# include <sys/uio.h> /* writev */
+#endif
+#include <pthread.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <utime.h>
+#include <poll.h>
+
+#if defined(__DragonFly__)        ||                                      \
+    defined(__FreeBSD__)          ||                                      \
+    defined(__FreeBSD_kernel_)    ||                                      \
+    defined(__OpenBSD__)          ||                                      \
+    defined(__NetBSD__)
+# define HAVE_PREADV 1
+#else
+# define HAVE_PREADV 0
+#endif
+
+#if defined(__linux__) || defined(__sun)
+# include <sys/sendfile.h>
+#endif
+
+#define INIT(subtype)                                                         \
+  do {                                                                        \
+    req->type = UV_FS;                                                        \
+    if (cb != NULL)                                                           \
+      uv__req_init(loop, req, UV_FS);                                         \
+    req->fs_type = UV_FS_ ## subtype;                                         \
+    req->result = 0;                                                          \
+    req->ptr = NULL;                                                          \
+    req->loop = loop;                                                         \
+    req->path = NULL;                                                         \
+    req->new_path = NULL;                                                     \
+    req->cb = cb;                                                             \
+  }                                                                           \
+  while (0)
+
+#define PATH                                                                  \
+  do {                                                                        \
+    assert(path != NULL);                                                     \
+    if (cb == NULL) {                                                         \
+      req->path = path;                                                       \
+    } else {                                                                  \
+      req->path = strdup(path);                                               \
+      if (req->path == NULL) {                                                \
+        uv__req_unregister(loop, req);                                        \
+        return -ENOMEM;                                                       \
+      }                                                                       \
+    }                                                                         \
+  }                                                                           \
+  while (0)
+
+#define PATH2                                                                 \
+  do {                                                                        \
+    if (cb == NULL) {                                                         \
+      req->path = path;                                                       \
+      req->new_path = new_path;                                               \
+    } else {                                                                  \
+      size_t path_len;                                                        \
+      size_t new_path_len;                                                    \
+      path_len = strlen(path) + 1;                                            \
+      new_path_len = strlen(new_path) + 1;                                    \
+      req->path = uv__malloc(path_len + new_path_len);                        \
+      if (req->path == NULL) {                                                \
+        uv__req_unregister(loop, req);                                        \
+        return -ENOMEM;                                                       \
+      }                                                                       \
+      req->new_path = req->path + path_len;                                   \
+      memcpy((void*) req->path, path, path_len);                              \
+      memcpy((void*) req->new_path, new_path, new_path_len);                  \
+    }                                                                         \
+  }                                                                           \
+  while (0)
+
+#define POST                                                                  \
+  do {                                                                        \
+    if (cb != NULL) {                                                         \
+      uv__work_submit(loop, &req->work_req, uv__fs_work, uv__fs_done);        \
+      return 0;                                                               \
+    }                                                                         \
+    else {                                                                    \
+      uv__fs_work(&req->work_req);                                            \
+      return req->result;                                                     \
+    }                                                                         \
+  }                                                                           \
+  while (0)
+
+
+static ssize_t uv__fs_fdatasync(uv_fs_t* req) {
+#if defined(__linux__) || defined(__sun) || defined(__NetBSD__)
+  return fdatasync(req->file);
+#elif defined(__APPLE__) && defined(SYS_fdatasync)
+  return syscall(SYS_fdatasync, req->file);
+#else
+  return fsync(req->file);
+#endif
+}
+
+
+static ssize_t uv__fs_futime(uv_fs_t* req) {
+#if defined(__linux__)
+  /* utimesat() has nanosecond resolution but we stick to microseconds
+   * for the sake of consistency with other platforms.
+   */
+  static int no_utimesat;
+  struct timespec ts[2];
+  struct timeval tv[2];
+  char path[sizeof("/proc/self/fd/") + 3 * sizeof(int)];
+  int r;
+
+  if (no_utimesat)
+    goto skip;
+
+  ts[0].tv_sec  = req->atime;
+  ts[0].tv_nsec = (uint64_t)(req->atime * 1000000) % 1000000 * 1000;
+  ts[1].tv_sec  = req->mtime;
+  ts[1].tv_nsec = (uint64_t)(req->mtime * 1000000) % 1000000 * 1000;
+
+  r = uv__utimesat(req->file, NULL, ts, 0);
+  if (r == 0)
+    return r;
+
+  if (errno != ENOSYS)
+    return r;
+
+  no_utimesat = 1;
+
+skip:
+
+  tv[0].tv_sec  = req->atime;
+  tv[0].tv_usec = (uint64_t)(req->atime * 1000000) % 1000000;
+  tv[1].tv_sec  = req->mtime;
+  tv[1].tv_usec = (uint64_t)(req->mtime * 1000000) % 1000000;
+  snprintf(path, sizeof(path), "/proc/self/fd/%d", (int) req->file);
+
+  r = utimes(path, tv);
+  if (r == 0)
+    return r;
+
+  switch (errno) {
+  case ENOENT:
+    if (fcntl(req->file, F_GETFL) == -1 && errno == EBADF)
+      break;
+    /* Fall through. */
+
+  case EACCES:
+  case ENOTDIR:
+    errno = ENOSYS;
+    break;
+  }
+
+  return r;
+
+#elif defined(__APPLE__)                                                      \
+    || defined(__DragonFly__)                                                 \
+    || defined(__FreeBSD__)                                                   \
+    || defined(__FreeBSD_kernel__)                                            \
+    || defined(__NetBSD__)                                                    \
+    || defined(__OpenBSD__)                                                   \
+    || defined(__sun)
+  struct timeval tv[2];
+  tv[0].tv_sec  = req->atime;
+  tv[0].tv_usec = (uint64_t)(req->atime * 1000000) % 1000000;
+  tv[1].tv_sec  = req->mtime;
+  tv[1].tv_usec = (uint64_t)(req->mtime * 1000000) % 1000000;
+# if defined(__sun)
+  return futimesat(req->file, NULL, tv);
+# else
+  return futimes(req->file, tv);
+# endif
+#elif defined(_AIX71)
+  struct timespec ts[2];
+  ts[0].tv_sec  = req->atime;
+  ts[0].tv_nsec = (uint64_t)(req->atime * 1000000) % 1000000 * 1000;
+  ts[1].tv_sec  = req->mtime;
+  ts[1].tv_nsec = (uint64_t)(req->mtime * 1000000) % 1000000 * 1000;
+  return futimens(req->file, ts);
+#elif defined(__MVS__)
+  attrib_t atr;
+  memset(&atr, 0, sizeof(atr));
+  atr.att_mtimechg = 1;
+  atr.att_atimechg = 1;
+  atr.att_mtime = req->mtime;
+  atr.att_atime = req->atime;
+  return __fchattr(req->file, &atr, sizeof(atr));
+#else
+  errno = ENOSYS;
+  return -1;
+#endif
+}
+
+
+static ssize_t uv__fs_open(uv_fs_t* req) {
+  static int no_cloexec_support;
+  int r;
+
+  /* Try O_CLOEXEC before entering locks */
+  if (no_cloexec_support == 0) {
+#ifdef O_CLOEXEC
+    r = open(req->path, req->flags | O_CLOEXEC, req->mode);
+    if (r >= 0)
+      return r;
+    if (errno != EINVAL)
+      return r;
+    no_cloexec_support = 1;
+#endif  /* O_CLOEXEC */
+  }
+
+  if (req->cb != NULL)
+    uv_rwlock_rdlock(&req->loop->cloexec_lock);
+
+  r = open(req->path, req->flags, req->mode);
+
+  /* In case of failure `uv__cloexec` will leave error in `errno`,
+   * so it is enough to just set `r` to `-1`.
+   */
+  if (r >= 0 && uv__cloexec(r, 1) != 0) {
+    r = uv__close(r);
+    if (r != 0)
+      abort();
+    r = -1;
+  }
+
+  if (req->cb != NULL)
+    uv_rwlock_rdunlock(&req->loop->cloexec_lock);
+
+  return r;
+}
+
+
+static ssize_t uv__fs_read(uv_fs_t* req) {
+#if defined(__linux__)
+  static int no_preadv;
+#endif
+  ssize_t result;
+
+#if defined(_AIX)
+  struct stat buf;
+  if(fstat(req->file, &buf))
+    return -1;
+  if(S_ISDIR(buf.st_mode)) {
+    errno = EISDIR;
+    return -1;
+  }
+#endif /* defined(_AIX) */
+  if (req->off < 0) {
+    if (req->nbufs == 1)
+      result = read(req->file, req->bufs[0].base, req->bufs[0].len);
+    else
+      result = readv(req->file, (struct iovec*) req->bufs, req->nbufs);
+  } else {
+    if (req->nbufs == 1) {
+      result = pread(req->file, req->bufs[0].base, req->bufs[0].len, req->off);
+      goto done;
+    }
+
+#if HAVE_PREADV
+    result = preadv(req->file, (struct iovec*) req->bufs, req->nbufs, req->off);
+#else
+# if defined(__linux__)
+    if (no_preadv) retry:
+# endif
+    {
+      off_t nread;
+      size_t index;
+
+      nread = 0;
+      index = 0;
+      result = 1;
+      do {
+        if (req->bufs[index].len > 0) {
+          result = pread(req->file,
+                         req->bufs[index].base,
+                         req->bufs[index].len,
+                         req->off + nread);
+          if (result > 0)
+            nread += result;
+        }
+        index++;
+      } while (index < req->nbufs && result > 0);
+      if (nread > 0)
+        result = nread;
+    }
+# if defined(__linux__)
+    else {
+      result = uv__preadv(req->file,
+                          (struct iovec*)req->bufs,
+                          req->nbufs,
+                          req->off);
+      if (result == -1 && errno == ENOSYS) {
+        no_preadv = 1;
+        goto retry;
+      }
+    }
+# endif
+#endif
+  }
+
+done:
+  return result;
+}
+
+
+#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_8)
+#define UV_CONST_DIRENT uv__dirent_t
+#else
+#define UV_CONST_DIRENT const uv__dirent_t
+#endif
+
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+static int uv__fs_scandir_filter(UV_CONST_DIRENT* dent) {
+  return strcmp(dent->d_name, ".") != 0 && strcmp(dent->d_name, "..") != 0;
+}
+
+
+static int uv__fs_scandir_sort(UV_CONST_DIRENT** a, UV_CONST_DIRENT** b) {
+  return strcmp((*a)->d_name, (*b)->d_name);
+}
+#endif
+
+static ssize_t uv__fs_scandir(uv_fs_t* req) {
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+  return -1;
+#else
+  uv__dirent_t **dents;
+  int n;
+
+  dents = NULL;
+  n = scandir(req->path, &dents, uv__fs_scandir_filter, uv__fs_scandir_sort);
+
+  /* NOTE: We will use nbufs as an index field */
+  req->nbufs = 0;
+
+  if (n == 0) {
+    /* Memory was allocated using the system allocator, so use free() here. */
+    if (dents != NULL) {
+      free(dents);
+      dents = NULL;
+    }
+  }
+  else if (n == -1)
+    return n;
+
+  req->ptr = dents;
+
+  return n;
+#endif
+}
+
+
+static ssize_t uv__fs_utime(uv_fs_t* req) {
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+  return -1;
+#else
+  struct utimbuf buf;
+  buf.actime = req->atime;
+  buf.modtime = req->mtime;
+  return utime(req->path, &buf); /* TODO use utimes() where available */
+#endif
+}
+
+
+static ssize_t uv__fs_write(uv_fs_t* req) {
+#if defined(__linux__)
+  static int no_pwritev;
+#endif
+  ssize_t r;
+
+  /* Serialize writes on OS X, concurrent write() and pwrite() calls result in
+   * data loss. We can't use a per-file descriptor lock, the descriptor may be
+   * a dup().
+   */
+#if defined(__APPLE__)
+  static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
+
+  if (pthread_mutex_lock(&lock))
+    abort();
+#endif
+
+  if (req->off < 0) {
+    if (req->nbufs == 1)
+      r = write(req->file, req->bufs[0].base, req->bufs[0].len);
+    else
+      r = writev(req->file, (struct iovec*) req->bufs, req->nbufs);
+  } else {
+    if (req->nbufs == 1) {
+      r = pwrite(req->file, req->bufs[0].base, req->bufs[0].len, req->off);
+      goto done;
+    }
+#if HAVE_PREADV
+    r = pwritev(req->file, (struct iovec*) req->bufs, req->nbufs, req->off);
+#else
+# if defined(__linux__)
+    if (no_pwritev) retry:
+# endif
+    {
+      off_t written;
+      size_t index;
+
+      written = 0;
+      index = 0;
+      r = 0;
+      do {
+        if (req->bufs[index].len > 0) {
+          r = pwrite(req->file,
+                     req->bufs[index].base,
+                     req->bufs[index].len,
+                     req->off + written);
+          if (r > 0)
+            written += r;
+        }
+        index++;
+      } while (index < req->nbufs && r >= 0);
+      if (written > 0)
+        r = written;
+    }
+# if defined(__linux__)
+    else {
+      r = uv__pwritev(req->file,
+                      (struct iovec*) req->bufs,
+                      req->nbufs,
+                      req->off);
+      if (r == -1 && errno == ENOSYS) {
+        no_pwritev = 1;
+        goto retry;
+      }
+    }
+# endif
+#endif
+  }
+
+done:
+#if defined(__APPLE__)
+  if (pthread_mutex_unlock(&lock))
+    abort();
+#endif
+
+  return r;
+}
+
+static void uv__to_stat(struct stat* src, uv_stat_t* dst) {
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  dst->st_dev = src->st_dev;
+#endif
+  dst->st_mode = src->st_mode;
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  dst->st_nlink = src->st_nlink;
+  dst->st_uid = src->st_uid;
+  dst->st_gid = src->st_gid;
+  dst->st_rdev = src->st_rdev;
+  dst->st_ino = src->st_ino;
+#endif
+  dst->st_size = src->st_size;
+  dst->st_blksize = src->st_blksize;
+  dst->st_blocks = src->st_blocks;
+
+#if defined(__APPLE__)
+  dst->st_atim.tv_sec = src->st_atimespec.tv_sec;
+  dst->st_atim.tv_nsec = src->st_atimespec.tv_nsec;
+  dst->st_mtim.tv_sec = src->st_mtimespec.tv_sec;
+  dst->st_mtim.tv_nsec = src->st_mtimespec.tv_nsec;
+  dst->st_ctim.tv_sec = src->st_ctimespec.tv_sec;
+  dst->st_ctim.tv_nsec = src->st_ctimespec.tv_nsec;
+  dst->st_birthtim.tv_sec = src->st_birthtimespec.tv_sec;
+  dst->st_birthtim.tv_nsec = src->st_birthtimespec.tv_nsec;
+  dst->st_flags = src->st_flags;
+  dst->st_gen = src->st_gen;
+#elif defined(__ANDROID__)
+  dst->st_atim.tv_sec = src->st_atime;
+  dst->st_atim.tv_nsec = src->st_atimensec;
+  dst->st_mtim.tv_sec = src->st_mtime;
+  dst->st_mtim.tv_nsec = src->st_mtimensec;
+  dst->st_ctim.tv_sec = src->st_ctime;
+  dst->st_ctim.tv_nsec = src->st_ctimensec;
+  dst->st_birthtim.tv_sec = src->st_ctime;
+  dst->st_birthtim.tv_nsec = src->st_ctimensec;
+  dst->st_flags = 0;
+  dst->st_gen = 0;
+#elif !defined(_AIX) && (       \
+    defined(_GNU_SOURCE)     || \
+    defined(_BSD_SOURCE)     || \
+    defined(_SVID_SOURCE)    || \
+    defined(_XOPEN_SOURCE)   || \
+    defined(_DEFAULT_SOURCE))
+  dst->st_atim.tv_sec = src->st_atim.tv_sec;
+  dst->st_atim.tv_nsec = src->st_atim.tv_nsec;
+  dst->st_mtim.tv_sec = src->st_mtim.tv_sec;
+  dst->st_mtim.tv_nsec = src->st_mtim.tv_nsec;
+  dst->st_ctim.tv_sec = src->st_ctim.tv_sec;
+  dst->st_ctim.tv_nsec = src->st_ctim.tv_nsec;
+# if defined(__DragonFly__)  || \
+     defined(__FreeBSD__)    || \
+     defined(__OpenBSD__)    || \
+     defined(__NetBSD__)
+  dst->st_birthtim.tv_sec = src->st_birthtim.tv_sec;
+  dst->st_birthtim.tv_nsec = src->st_birthtim.tv_nsec;
+  dst->st_flags = src->st_flags;
+  dst->st_gen = src->st_gen;
+# else
+  dst->st_birthtim.tv_sec = src->st_ctim.tv_sec;
+  dst->st_birthtim.tv_nsec = src->st_ctim.tv_nsec;
+  dst->st_flags = 0;
+  dst->st_gen = 0;
+# endif
+#else
+  dst->st_atim.tv_sec = src->st_atime;
+  dst->st_atim.tv_nsec = 0;
+  dst->st_mtim.tv_sec = src->st_mtime;
+  dst->st_mtim.tv_nsec = 0;
+  dst->st_ctim.tv_sec = src->st_ctime;
+  dst->st_ctim.tv_nsec = 0;
+  dst->st_birthtim.tv_sec = src->st_ctime;
+  dst->st_birthtim.tv_nsec = 0;
+  dst->st_flags = 0;
+  dst->st_gen = 0;
+#endif
+}
+
+
+static int uv__fs_stat(const char *path, uv_stat_t *buf) {
+  struct stat pbuf;
+  int ret;
+
+  ret = stat(path, &pbuf);
+  if (ret == 0)
+    uv__to_stat(&pbuf, buf);
+
+  return ret;
+}
+
+
+static int uv__fs_fstat(int fd, uv_stat_t *buf) {
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+  return -1;
+#else
+  struct stat pbuf;
+  int ret;
+
+  ret = fstat(fd, &pbuf);
+  if (ret == 0)
+    uv__to_stat(&pbuf, buf);
+
+  return ret;
+#endif
+}
+
+
+typedef ssize_t (*uv__fs_buf_iter_processor)(uv_fs_t* req);
+static ssize_t uv__fs_buf_iter(uv_fs_t* req, uv__fs_buf_iter_processor process) {
+  unsigned int iovmax;
+  unsigned int nbufs;
+  uv_buf_t* bufs;
+  ssize_t total;
+  ssize_t result;
+
+  iovmax = uv__getiovmax();
+  nbufs = req->nbufs;
+  bufs = req->bufs;
+  total = 0;
+
+  while (nbufs > 0) {
+    req->nbufs = nbufs;
+    if (req->nbufs > iovmax)
+      req->nbufs = iovmax;
+
+    result = process(req);
+    if (result <= 0) {
+      if (total == 0)
+        total = result;
+      break;
+    }
+
+    if (req->off >= 0)
+      req->off += result;
+
+    req->bufs += req->nbufs;
+    nbufs -= req->nbufs;
+    total += result;
+  }
+
+  if (errno == EINTR && total == -1)
+    return total;
+
+  if (bufs != req->bufsml)
+    uv__free(bufs);
+
+  req->bufs = NULL;
+  req->nbufs = 0;
+
+  return total;
+}
+
+
+static void uv__fs_work(struct uv__work* w) {
+  int retry_on_eintr;
+  uv_fs_t* req;
+  ssize_t r;
+
+  req = container_of(w, uv_fs_t, work_req);
+  retry_on_eintr = !(req->fs_type == UV_FS_CLOSE);
+
+  do {
+    errno = 0;
+
+#define X(type, action)                                                       \
+  case UV_FS_ ## type:                                                        \
+    r = action;                                                               \
+    break;
+
+    switch (req->fs_type) {
+    X(CLOSE, close(req->file));
+    X(FDATASYNC, uv__fs_fdatasync(req));
+    X(FSTAT, uv__fs_fstat(req->file, &req->statbuf));
+    X(FSYNC, fsync(req->file));
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+    X(FTRUNCATE, ftruncate(req->file, req->off));
+#endif
+    X(FUTIME, uv__fs_futime(req));
+    X(MKDIR, mkdir(req->path, req->mode));
+    X(OPEN, uv__fs_open(req));
+    X(READ, uv__fs_buf_iter(req, uv__fs_read));
+    X(SCANDIR, uv__fs_scandir(req));
+    X(RENAME, rename(req->path, req->new_path));
+    X(RMDIR, rmdir(req->path));
+    X(STAT, uv__fs_stat(req->path, &req->statbuf));
+    X(UNLINK, unlink(req->path));
+    X(UTIME, uv__fs_utime(req));
+    X(WRITE, uv__fs_buf_iter(req, uv__fs_write));
+    default: abort();
+    }
+#undef X
+  } while (r == -1 && errno == EINTR && retry_on_eintr);
+
+  if (r == -1)
+    req->result = -errno;
+  else
+    req->result = r;
+
+  if (r == 0 && (req->fs_type == UV_FS_STAT ||
+                 req->fs_type == UV_FS_FSTAT ||
+                 req->fs_type == UV_FS_LSTAT)) {
+    req->ptr = &req->statbuf;
+  }
+}
+
+
+static void uv__fs_done(struct uv__work* w, int status) {
+  uv_fs_t* req;
+
+  req = container_of(w, uv_fs_t, work_req);
+  uv__req_unregister(req->loop, req);
+
+  if (status == -ECANCELED) {
+    assert(req->result == 0);
+    req->result = -ECANCELED;
+  }
+
+  req->cb(req);
+}
+
+
+int uv_fs_close(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
+  INIT(CLOSE);
+  req->file = file;
+  POST;
+}
+
+
+int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
+  INIT(FDATASYNC);
+  req->file = file;
+  POST;
+}
+
+
+int uv_fs_fstat(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
+  INIT(FSTAT);
+  req->file = file;
+  POST;
+}
+
+
+int uv_fs_fsync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
+  INIT(FSYNC);
+  req->file = file;
+  POST;
+}
+
+
+int uv_fs_ftruncate(uv_loop_t* loop,
+                    uv_fs_t* req,
+                    uv_file file,
+                    int64_t off,
+                    uv_fs_cb cb) {
+  INIT(FTRUNCATE);
+  req->file = file;
+  req->off = off;
+  POST;
+}
+
+
+int uv_fs_futime(uv_loop_t* loop,
+                 uv_fs_t* req,
+                 uv_file file,
+                 double atime,
+                 double mtime,
+                 uv_fs_cb cb) {
+  INIT(FUTIME);
+  req->file = file;
+  req->atime = atime;
+  req->mtime = mtime;
+  POST;
+}
+
+
+int uv_fs_mkdir(uv_loop_t* loop,
+                uv_fs_t* req,
+                const char* path,
+                int mode,
+                uv_fs_cb cb) {
+  INIT(MKDIR);
+  PATH;
+  req->mode = mode;
+  POST;
+}
+
+
+int uv_fs_open(uv_loop_t* loop,
+               uv_fs_t* req,
+               const char* path,
+               int flags,
+               int mode,
+               uv_fs_cb cb) {
+  INIT(OPEN);
+  PATH;
+  req->flags = flags;
+  req->mode = mode;
+  POST;
+}
+
+
+int uv_fs_read(uv_loop_t* loop, uv_fs_t* req,
+               uv_file file,
+               const uv_buf_t bufs[],
+               unsigned int nbufs,
+               int64_t off,
+               uv_fs_cb cb) {
+  if (bufs == NULL || nbufs == 0)
+    return -EINVAL;
+
+  INIT(READ);
+  req->file = file;
+
+  req->nbufs = nbufs;
+  req->bufs = req->bufsml;
+  if (nbufs > ARRAY_SIZE(req->bufsml))
+    req->bufs = uv__malloc(nbufs * sizeof(*bufs));
+
+  if (req->bufs == NULL) {
+    if (cb != NULL)
+      uv__req_unregister(loop, req);
+    return -ENOMEM;
+  }
+
+  memcpy(req->bufs, bufs, nbufs * sizeof(*bufs));
+
+  req->off = off;
+  POST;
+}
+
+
+int uv_fs_scandir(uv_loop_t* loop,
+                  uv_fs_t* req,
+                  const char* path,
+                  int flags,
+                  uv_fs_cb cb) {
+  INIT(SCANDIR);
+  PATH;
+  req->flags = flags;
+  POST;
+}
+
+
+int uv_fs_rename(uv_loop_t* loop,
+                 uv_fs_t* req,
+                 const char* path,
+                 const char* new_path,
+                 uv_fs_cb cb) {
+  INIT(RENAME);
+  PATH2;
+  POST;
+}
+
+
+int uv_fs_rmdir(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
+  INIT(RMDIR);
+  PATH;
+  POST;
+}
+
+
+int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
+  INIT(STAT);
+  PATH;
+  POST;
+}
+
+
+int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
+  INIT(UNLINK);
+  PATH;
+  POST;
+}
+
+
+int uv_fs_utime(uv_loop_t* loop,
+                uv_fs_t* req,
+                const char* path,
+                double atime,
+                double mtime,
+                uv_fs_cb cb) {
+  INIT(UTIME);
+  PATH;
+  req->atime = atime;
+  req->mtime = mtime;
+  POST;
+}
+
+
+int uv_fs_write(uv_loop_t* loop,
+                uv_fs_t* req,
+                uv_file file,
+                const uv_buf_t bufs[],
+                unsigned int nbufs,
+                int64_t off,
+                uv_fs_cb cb) {
+  if (bufs == NULL || nbufs == 0)
+    return -EINVAL;
+
+  INIT(WRITE);
+  req->file = file;
+
+  req->nbufs = nbufs;
+  req->bufs = req->bufsml;
+  if (nbufs > ARRAY_SIZE(req->bufsml))
+    req->bufs = uv__malloc(nbufs * sizeof(*bufs));
+
+  if (req->bufs == NULL) {
+    if (cb != NULL)
+      uv__req_unregister(loop, req);
+    return -ENOMEM;
+  }
+
+  memcpy(req->bufs, bufs, nbufs * sizeof(*bufs));
+
+  req->off = off;
+  POST;
+}
+
+
+void uv_fs_req_cleanup(uv_fs_t* req) {
+  /* Only necessary for asychronous requests, i.e., requests with a callback.
+   * Synchronous ones don't copy their arguments and have req->path and
+   * req->new_path pointing to user-owned memory.  UV_FS_MKDTEMP is the
+   * exception to the rule, it always allocates memory.
+   */
+  if (req->path != NULL && (req->cb != NULL || req->fs_type == UV_FS_MKDTEMP))
+    uv__free((void*) req->path);  /* Memory is shared with req->new_path. */
+
+  req->path = NULL;
+  req->new_path = NULL;
+
+  if (req->fs_type == UV_FS_SCANDIR && req->ptr != NULL)
+    uv__fs_scandir_cleanup(req);
+
+  if (req->ptr != &req->statbuf)
+    uv__free(req->ptr);
+  req->ptr = NULL;
+}
diff --git a/deps/libtuv/src/unix/fsevents.c b/deps/libtuv/src/unix/fsevents.c
new file mode 100644 (file)
index 0000000..d331a13
--- /dev/null
@@ -0,0 +1,904 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#if TARGET_OS_IPHONE
+
+/* iOS (currently) doesn't provide the FSEvents-API (nor CoreServices) */
+
+int uv__fsevents_init(uv_fs_event_t* handle) {
+  return 0;
+}
+
+
+int uv__fsevents_close(uv_fs_event_t* handle) {
+  return 0;
+}
+
+
+void uv__fsevents_loop_delete(uv_loop_t* loop) {
+}
+
+#else /* TARGET_OS_IPHONE */
+
+#include <dlfcn.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+#include <CoreFoundation/CFRunLoop.h>
+#include <CoreServices/CoreServices.h>
+
+/* These are macros to avoid "initializer element is not constant" errors
+ * with old versions of gcc.
+ */
+#define kFSEventsModified (kFSEventStreamEventFlagItemFinderInfoMod |         \
+                           kFSEventStreamEventFlagItemModified |              \
+                           kFSEventStreamEventFlagItemInodeMetaMod |          \
+                           kFSEventStreamEventFlagItemChangeOwner |           \
+                           kFSEventStreamEventFlagItemXattrMod)
+
+#define kFSEventsRenamed  (kFSEventStreamEventFlagItemCreated |               \
+                           kFSEventStreamEventFlagItemRemoved |               \
+                           kFSEventStreamEventFlagItemRenamed)
+
+#define kFSEventsSystem   (kFSEventStreamEventFlagUserDropped |               \
+                           kFSEventStreamEventFlagKernelDropped |             \
+                           kFSEventStreamEventFlagEventIdsWrapped |           \
+                           kFSEventStreamEventFlagHistoryDone |               \
+                           kFSEventStreamEventFlagMount |                     \
+                           kFSEventStreamEventFlagUnmount |                   \
+                           kFSEventStreamEventFlagRootChanged)
+
+typedef struct uv__fsevents_event_s uv__fsevents_event_t;
+typedef struct uv__cf_loop_signal_s uv__cf_loop_signal_t;
+typedef struct uv__cf_loop_state_s uv__cf_loop_state_t;
+
+enum uv__cf_loop_signal_type_e {
+  kUVCFLoopSignalRegular,
+  kUVCFLoopSignalClosing
+};
+typedef enum uv__cf_loop_signal_type_e uv__cf_loop_signal_type_t;
+
+struct uv__cf_loop_signal_s {
+  QUEUE member;
+  uv_fs_event_t* handle;
+  uv__cf_loop_signal_type_t type;
+};
+
+struct uv__fsevents_event_s {
+  QUEUE member;
+  int events;
+  char path[1];
+};
+
+struct uv__cf_loop_state_s {
+  CFRunLoopRef loop;
+  CFRunLoopSourceRef signal_source;
+  int fsevent_need_reschedule;
+  FSEventStreamRef fsevent_stream;
+  uv_sem_t fsevent_sem;
+  uv_mutex_t fsevent_mutex;
+  void* fsevent_handles[2];
+  unsigned int fsevent_handle_count;
+};
+
+/* Forward declarations */
+static void uv__cf_loop_cb(void* arg);
+static void* uv__cf_loop_runner(void* arg);
+static int uv__cf_loop_signal(uv_loop_t* loop,
+                              uv_fs_event_t* handle,
+                              uv__cf_loop_signal_type_t type);
+
+/* Lazy-loaded by uv__fsevents_global_init(). */
+static CFArrayRef (*pCFArrayCreate)(CFAllocatorRef,
+                                    const void**,
+                                    CFIndex,
+                                    const CFArrayCallBacks*);
+static void (*pCFRelease)(CFTypeRef);
+static void (*pCFRunLoopAddSource)(CFRunLoopRef,
+                                   CFRunLoopSourceRef,
+                                   CFStringRef);
+static CFRunLoopRef (*pCFRunLoopGetCurrent)(void);
+static void (*pCFRunLoopRemoveSource)(CFRunLoopRef,
+                                      CFRunLoopSourceRef,
+                                      CFStringRef);
+static void (*pCFRunLoopRun)(void);
+static CFRunLoopSourceRef (*pCFRunLoopSourceCreate)(CFAllocatorRef,
+                                                    CFIndex,
+                                                    CFRunLoopSourceContext*);
+static void (*pCFRunLoopSourceSignal)(CFRunLoopSourceRef);
+static void (*pCFRunLoopStop)(CFRunLoopRef);
+static void (*pCFRunLoopWakeUp)(CFRunLoopRef);
+static CFStringRef (*pCFStringCreateWithFileSystemRepresentation)(
+    CFAllocatorRef,
+    const char*);
+static CFStringEncoding (*pCFStringGetSystemEncoding)(void);
+static CFStringRef (*pkCFRunLoopDefaultMode);
+static FSEventStreamRef (*pFSEventStreamCreate)(CFAllocatorRef,
+                                                FSEventStreamCallback,
+                                                FSEventStreamContext*,
+                                                CFArrayRef,
+                                                FSEventStreamEventId,
+                                                CFTimeInterval,
+                                                FSEventStreamCreateFlags);
+static void (*pFSEventStreamFlushSync)(FSEventStreamRef);
+static void (*pFSEventStreamInvalidate)(FSEventStreamRef);
+static void (*pFSEventStreamRelease)(FSEventStreamRef);
+static void (*pFSEventStreamScheduleWithRunLoop)(FSEventStreamRef,
+                                                 CFRunLoopRef,
+                                                 CFStringRef);
+static Boolean (*pFSEventStreamStart)(FSEventStreamRef);
+static void (*pFSEventStreamStop)(FSEventStreamRef);
+
+#define UV__FSEVENTS_PROCESS(handle, block)                                   \
+    do {                                                                      \
+      QUEUE events;                                                           \
+      QUEUE* q;                                                               \
+      uv__fsevents_event_t* event;                                            \
+      int err;                                                                \
+      uv_mutex_lock(&(handle)->cf_mutex);                                     \
+      /* Split-off all events and empty original queue */                     \
+      QUEUE_MOVE(&(handle)->cf_events, &events);                              \
+      /* Get error (if any) and zero original one */                          \
+      err = (handle)->cf_error;                                               \
+      (handle)->cf_error = 0;                                                 \
+      uv_mutex_unlock(&(handle)->cf_mutex);                                   \
+      /* Loop through events, deallocating each after processing */           \
+      while (!QUEUE_EMPTY(&events)) {                                         \
+        q = QUEUE_HEAD(&events);                                              \
+        event = QUEUE_DATA(q, uv__fsevents_event_t, member);                  \
+        QUEUE_REMOVE(q);                                                      \
+        /* NOTE: Checking uv__is_active() is required here, because handle    \
+         * callback may close handle and invoking it after it will lead to    \
+         * incorrect behaviour */                                             \
+        if (!uv__is_closing((handle)) && uv__is_active((handle)))             \
+          block                                                               \
+        /* Free allocated data */                                             \
+        uv__free(event);                                                      \
+      }                                                                       \
+      if (err != 0 && !uv__is_closing((handle)) && uv__is_active((handle)))   \
+        (handle)->cb((handle), NULL, 0, err);                                 \
+    } while (0)
+
+
+/* Runs in UV loop's thread, when there're events to report to handle */
+static void uv__fsevents_cb(uv_async_t* cb) {
+  uv_fs_event_t* handle;
+
+  handle = cb->data;
+
+  UV__FSEVENTS_PROCESS(handle, {
+    handle->cb(handle, event->path[0] ? event->path : NULL, event->events, 0);
+  });
+}
+
+
+/* Runs in CF thread, pushed event into handle's event list */
+static void uv__fsevents_push_event(uv_fs_event_t* handle,
+                                    QUEUE* events,
+                                    int err) {
+  assert(events != NULL || err != 0);
+  uv_mutex_lock(&handle->cf_mutex);
+
+  /* Concatenate two queues */
+  if (events != NULL)
+    QUEUE_ADD(&handle->cf_events, events);
+
+  /* Propagate error */
+  if (err != 0)
+    handle->cf_error = err;
+  uv_mutex_unlock(&handle->cf_mutex);
+
+  uv_async_send(handle->cf_cb);
+}
+
+
+/* Runs in CF thread, when there're events in FSEventStream */
+static void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef,
+                                  void* info,
+                                  size_t numEvents,
+                                  void* eventPaths,
+                                  const FSEventStreamEventFlags eventFlags[],
+                                  const FSEventStreamEventId eventIds[]) {
+  size_t i;
+  int len;
+  char** paths;
+  char* path;
+  char* pos;
+  uv_fs_event_t* handle;
+  QUEUE* q;
+  uv_loop_t* loop;
+  uv__cf_loop_state_t* state;
+  uv__fsevents_event_t* event;
+  QUEUE head;
+
+  loop = info;
+  state = loop->cf_state;
+  assert(state != NULL);
+  paths = eventPaths;
+
+  /* For each handle */
+  uv_mutex_lock(&state->fsevent_mutex);
+  QUEUE_FOREACH(q, &state->fsevent_handles) {
+    handle = QUEUE_DATA(q, uv_fs_event_t, cf_member);
+    QUEUE_INIT(&head);
+
+    /* Process and filter out events */
+    for (i = 0; i < numEvents; i++) {
+      /* Ignore system events */
+      if (eventFlags[i] & kFSEventsSystem)
+        continue;
+
+      path = paths[i];
+      len = strlen(path);
+
+      /* Filter out paths that are outside handle's request */
+      if (strncmp(path, handle->realpath, handle->realpath_len) != 0)
+        continue;
+
+      if (handle->realpath_len > 1 || *handle->realpath != '/') {
+        path += handle->realpath_len;
+        len -= handle->realpath_len;
+
+        /* Skip forward slash */
+        if (*path != '\0') {
+          path++;
+          len--;
+        }
+      }
+
+#ifdef MAC_OS_X_VERSION_10_7
+      /* Ignore events with path equal to directory itself */
+      if (len == 0)
+        continue;
+#endif /* MAC_OS_X_VERSION_10_7 */
+
+      /* Do not emit events from subdirectories (without option set) */
+      if ((handle->cf_flags & UV_FS_EVENT_RECURSIVE) == 0 && *path != 0) {
+        pos = strchr(path + 1, '/');
+        if (pos != NULL)
+          continue;
+      }
+
+#ifndef MAC_OS_X_VERSION_10_7
+      path = "";
+      len = 0;
+#endif /* MAC_OS_X_VERSION_10_7 */
+
+      event = uv__malloc(sizeof(*event) + len);
+      if (event == NULL)
+        break;
+
+      memset(event, 0, sizeof(*event));
+      memcpy(event->path, path, len + 1);
+
+      if ((eventFlags[i] & kFSEventsModified) != 0 &&
+          (eventFlags[i] & kFSEventsRenamed) == 0)
+        event->events = UV_CHANGE;
+      else
+        event->events = UV_RENAME;
+
+      QUEUE_INSERT_TAIL(&head, &event->member);
+    }
+
+    if (!QUEUE_EMPTY(&head))
+      uv__fsevents_push_event(handle, &head, 0);
+  }
+  uv_mutex_unlock(&state->fsevent_mutex);
+}
+
+
+/* Runs in CF thread */
+static int uv__fsevents_create_stream(uv_loop_t* loop, CFArrayRef paths) {
+  uv__cf_loop_state_t* state;
+  FSEventStreamContext ctx;
+  FSEventStreamRef ref;
+  CFAbsoluteTime latency;
+  FSEventStreamCreateFlags flags;
+
+  /* Initialize context */
+  ctx.version = 0;
+  ctx.info = loop;
+  ctx.retain = NULL;
+  ctx.release = NULL;
+  ctx.copyDescription = NULL;
+
+  latency = 0.05;
+
+  /* Explanation of selected flags:
+   * 1. NoDefer - without this flag, events that are happening continuously
+   *    (i.e. each event is happening after time interval less than `latency`,
+   *    counted from previous event), will be deferred and passed to callback
+   *    once they'll either fill whole OS buffer, or when this continuous stream
+   *    will stop (i.e. there'll be delay between events, bigger than
+   *    `latency`).
+   *    Specifying this flag will invoke callback after `latency` time passed
+   *    since event.
+   * 2. FileEvents - fire callback for file changes too (by default it is firing
+   *    it only for directory changes).
+   */
+  flags = kFSEventStreamCreateFlagNoDefer | kFSEventStreamCreateFlagFileEvents;
+
+  /*
+   * NOTE: It might sound like a good idea to remember last seen StreamEventId,
+   * but in reality one dir might have last StreamEventId less than, the other,
+   * that is being watched now. Which will cause FSEventStream API to report
+   * changes to files from the past.
+   */
+  ref = pFSEventStreamCreate(NULL,
+                             &uv__fsevents_event_cb,
+                             &ctx,
+                             paths,
+                             kFSEventStreamEventIdSinceNow,
+                             latency,
+                             flags);
+  assert(ref != NULL);
+
+  state = loop->cf_state;
+  pFSEventStreamScheduleWithRunLoop(ref,
+                                    state->loop,
+                                    *pkCFRunLoopDefaultMode);
+  if (!pFSEventStreamStart(ref)) {
+    pFSEventStreamInvalidate(ref);
+    pFSEventStreamRelease(ref);
+    return -EMFILE;
+  }
+
+  state->fsevent_stream = ref;
+  return 0;
+}
+
+
+/* Runs in CF thread */
+static void uv__fsevents_destroy_stream(uv_loop_t* loop) {
+  uv__cf_loop_state_t* state;
+
+  state = loop->cf_state;
+
+  if (state->fsevent_stream == NULL)
+    return;
+
+  /* Flush all accumulated events */
+  pFSEventStreamFlushSync(state->fsevent_stream);
+
+  /* Stop emitting events */
+  pFSEventStreamStop(state->fsevent_stream);
+
+  /* Release stream */
+  pFSEventStreamInvalidate(state->fsevent_stream);
+  pFSEventStreamRelease(state->fsevent_stream);
+  state->fsevent_stream = NULL;
+}
+
+
+/* Runs in CF thread, when there're new fsevent handles to add to stream */
+static void uv__fsevents_reschedule(uv_fs_event_t* handle,
+                                    uv__cf_loop_signal_type_t type) {
+  uv__cf_loop_state_t* state;
+  QUEUE* q;
+  uv_fs_event_t* curr;
+  CFArrayRef cf_paths;
+  CFStringRef* paths;
+  unsigned int i;
+  int err;
+  unsigned int path_count;
+
+  state = handle->loop->cf_state;
+  paths = NULL;
+  cf_paths = NULL;
+  err = 0;
+  /* NOTE: `i` is used in deallocation loop below */
+  i = 0;
+
+  /* Optimization to prevent O(n^2) time spent when starting to watch
+   * many files simultaneously
+   */
+  uv_mutex_lock(&state->fsevent_mutex);
+  if (state->fsevent_need_reschedule == 0) {
+    uv_mutex_unlock(&state->fsevent_mutex);
+    goto final;
+  }
+  state->fsevent_need_reschedule = 0;
+  uv_mutex_unlock(&state->fsevent_mutex);
+
+  /* Destroy previous FSEventStream */
+  uv__fsevents_destroy_stream(handle->loop);
+
+  /* Any failure below will be a memory failure */
+  err = -ENOMEM;
+
+  /* Create list of all watched paths */
+  uv_mutex_lock(&state->fsevent_mutex);
+  path_count = state->fsevent_handle_count;
+  if (path_count != 0) {
+    paths = uv__malloc(sizeof(*paths) * path_count);
+    if (paths == NULL) {
+      uv_mutex_unlock(&state->fsevent_mutex);
+      goto final;
+    }
+
+    q = &state->fsevent_handles;
+    for (; i < path_count; i++) {
+      q = QUEUE_NEXT(q);
+      assert(q != &state->fsevent_handles);
+      curr = QUEUE_DATA(q, uv_fs_event_t, cf_member);
+
+      assert(curr->realpath != NULL);
+      paths[i] =
+          pCFStringCreateWithFileSystemRepresentation(NULL, curr->realpath);
+      if (paths[i] == NULL) {
+        uv_mutex_unlock(&state->fsevent_mutex);
+        goto final;
+      }
+    }
+  }
+  uv_mutex_unlock(&state->fsevent_mutex);
+  err = 0;
+
+  if (path_count != 0) {
+    /* Create new FSEventStream */
+    cf_paths = pCFArrayCreate(NULL, (const void**) paths, path_count, NULL);
+    if (cf_paths == NULL) {
+      err = -ENOMEM;
+      goto final;
+    }
+    err = uv__fsevents_create_stream(handle->loop, cf_paths);
+  }
+
+final:
+  /* Deallocate all paths in case of failure */
+  if (err != 0) {
+    if (cf_paths == NULL) {
+      while (i != 0)
+        pCFRelease(paths[--i]);
+      uv__free(paths);
+    } else {
+      /* CFArray takes ownership of both strings and original C-array */
+      pCFRelease(cf_paths);
+    }
+
+    /* Broadcast error to all handles */
+    uv_mutex_lock(&state->fsevent_mutex);
+    QUEUE_FOREACH(q, &state->fsevent_handles) {
+      curr = QUEUE_DATA(q, uv_fs_event_t, cf_member);
+      uv__fsevents_push_event(curr, NULL, err);
+    }
+    uv_mutex_unlock(&state->fsevent_mutex);
+  }
+
+  /*
+   * Main thread will block until the removal of handle from the list,
+   * we must tell it when we're ready.
+   *
+   * NOTE: This is coupled with `uv_sem_wait()` in `uv__fsevents_close`
+   */
+  if (type == kUVCFLoopSignalClosing)
+    uv_sem_post(&state->fsevent_sem);
+}
+
+
+static int uv__fsevents_global_init(void) {
+  static pthread_mutex_t global_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+  static void* core_foundation_handle;
+  static void* core_services_handle;
+  int err;
+
+  err = 0;
+  pthread_mutex_lock(&global_init_mutex);
+  if (core_foundation_handle != NULL)
+    goto out;
+
+  /* The libraries are never unloaded because we currently don't have a good
+   * mechanism for keeping a reference count. It's unlikely to be an issue
+   * but if it ever becomes one, we can turn the dynamic library handles into
+   * per-event loop properties and have the dynamic linker keep track for us.
+   */
+  err = -ENOSYS;
+  core_foundation_handle = dlopen("/System/Library/Frameworks/"
+                                  "CoreFoundation.framework/"
+                                  "Versions/A/CoreFoundation",
+                                  RTLD_LAZY | RTLD_LOCAL);
+  if (core_foundation_handle == NULL)
+    goto out;
+
+  core_services_handle = dlopen("/System/Library/Frameworks/"
+                                "CoreServices.framework/"
+                                "Versions/A/CoreServices",
+                                RTLD_LAZY | RTLD_LOCAL);
+  if (core_services_handle == NULL)
+    goto out;
+
+  err = -ENOENT;
+#define V(handle, symbol)                                                     \
+  do {                                                                        \
+    *(void **)(&p ## symbol) = dlsym((handle), #symbol);                      \
+    if (p ## symbol == NULL)                                                  \
+      goto out;                                                               \
+  }                                                                           \
+  while (0)
+  V(core_foundation_handle, CFArrayCreate);
+  V(core_foundation_handle, CFRelease);
+  V(core_foundation_handle, CFRunLoopAddSource);
+  V(core_foundation_handle, CFRunLoopGetCurrent);
+  V(core_foundation_handle, CFRunLoopRemoveSource);
+  V(core_foundation_handle, CFRunLoopRun);
+  V(core_foundation_handle, CFRunLoopSourceCreate);
+  V(core_foundation_handle, CFRunLoopSourceSignal);
+  V(core_foundation_handle, CFRunLoopStop);
+  V(core_foundation_handle, CFRunLoopWakeUp);
+  V(core_foundation_handle, CFStringCreateWithFileSystemRepresentation);
+  V(core_foundation_handle, CFStringGetSystemEncoding);
+  V(core_foundation_handle, kCFRunLoopDefaultMode);
+  V(core_services_handle, FSEventStreamCreate);
+  V(core_services_handle, FSEventStreamFlushSync);
+  V(core_services_handle, FSEventStreamInvalidate);
+  V(core_services_handle, FSEventStreamRelease);
+  V(core_services_handle, FSEventStreamScheduleWithRunLoop);
+  V(core_services_handle, FSEventStreamStart);
+  V(core_services_handle, FSEventStreamStop);
+#undef V
+  err = 0;
+
+out:
+  if (err && core_services_handle != NULL) {
+    dlclose(core_services_handle);
+    core_services_handle = NULL;
+  }
+
+  if (err && core_foundation_handle != NULL) {
+    dlclose(core_foundation_handle);
+    core_foundation_handle = NULL;
+  }
+
+  pthread_mutex_unlock(&global_init_mutex);
+  return err;
+}
+
+
+/* Runs in UV loop */
+static int uv__fsevents_loop_init(uv_loop_t* loop) {
+  CFRunLoopSourceContext ctx;
+  uv__cf_loop_state_t* state;
+  pthread_attr_t attr_storage;
+  pthread_attr_t* attr;
+  int err;
+
+  if (loop->cf_state != NULL)
+    return 0;
+
+  err = uv__fsevents_global_init();
+  if (err)
+    return err;
+
+  state = uv__calloc(1, sizeof(*state));
+  if (state == NULL)
+    return -ENOMEM;
+
+  err = uv_mutex_init(&loop->cf_mutex);
+  if (err)
+    goto fail_mutex_init;
+
+  err = uv_sem_init(&loop->cf_sem, 0);
+  if (err)
+    goto fail_sem_init;
+
+  QUEUE_INIT(&loop->cf_signals);
+
+  err = uv_sem_init(&state->fsevent_sem, 0);
+  if (err)
+    goto fail_fsevent_sem_init;
+
+  err = uv_mutex_init(&state->fsevent_mutex);
+  if (err)
+    goto fail_fsevent_mutex_init;
+
+  QUEUE_INIT(&state->fsevent_handles);
+  state->fsevent_need_reschedule = 0;
+  state->fsevent_handle_count = 0;
+
+  memset(&ctx, 0, sizeof(ctx));
+  ctx.info = loop;
+  ctx.perform = uv__cf_loop_cb;
+  state->signal_source = pCFRunLoopSourceCreate(NULL, 0, &ctx);
+  if (state->signal_source == NULL) {
+    err = -ENOMEM;
+    goto fail_signal_source_create;
+  }
+
+  /* In the unlikely event that pthread_attr_init() fails, create the thread
+   * with the default stack size. We'll use a little more address space but
+   * that in itself is not a fatal error.
+   */
+  attr = &attr_storage;
+  if (pthread_attr_init(attr))
+    attr = NULL;
+
+  if (attr != NULL)
+    if (pthread_attr_setstacksize(attr, 4 * PTHREAD_STACK_MIN))
+      abort();
+
+  loop->cf_state = state;
+
+  /* uv_thread_t is an alias for pthread_t. */
+  err = -pthread_create(&loop->cf_thread, attr, uv__cf_loop_runner, loop);
+
+  if (attr != NULL)
+    pthread_attr_destroy(attr);
+
+  if (err)
+    goto fail_thread_create;
+
+  /* Synchronize threads */
+  uv_sem_wait(&loop->cf_sem);
+  return 0;
+
+fail_thread_create:
+  loop->cf_state = NULL;
+
+fail_signal_source_create:
+  uv_mutex_destroy(&state->fsevent_mutex);
+
+fail_fsevent_mutex_init:
+  uv_sem_destroy(&state->fsevent_sem);
+
+fail_fsevent_sem_init:
+  uv_sem_destroy(&loop->cf_sem);
+
+fail_sem_init:
+  uv_mutex_destroy(&loop->cf_mutex);
+
+fail_mutex_init:
+  uv__free(state);
+  return err;
+}
+
+
+/* Runs in UV loop */
+void uv__fsevents_loop_delete(uv_loop_t* loop) {
+  uv__cf_loop_signal_t* s;
+  uv__cf_loop_state_t* state;
+  QUEUE* q;
+
+  if (loop->cf_state == NULL)
+    return;
+
+  if (uv__cf_loop_signal(loop, NULL, kUVCFLoopSignalRegular) != 0)
+    abort();
+
+  uv_thread_join(&loop->cf_thread);
+  uv_sem_destroy(&loop->cf_sem);
+  uv_mutex_destroy(&loop->cf_mutex);
+
+  /* Free any remaining data */
+  while (!QUEUE_EMPTY(&loop->cf_signals)) {
+    q = QUEUE_HEAD(&loop->cf_signals);
+    s = QUEUE_DATA(q, uv__cf_loop_signal_t, member);
+    QUEUE_REMOVE(q);
+    uv__free(s);
+  }
+
+  /* Destroy state */
+  state = loop->cf_state;
+  uv_sem_destroy(&state->fsevent_sem);
+  uv_mutex_destroy(&state->fsevent_mutex);
+  pCFRelease(state->signal_source);
+  uv__free(state);
+  loop->cf_state = NULL;
+}
+
+
+/* Runs in CF thread. This is the CF loop's body */
+static void* uv__cf_loop_runner(void* arg) {
+  uv_loop_t* loop;
+  uv__cf_loop_state_t* state;
+
+  loop = arg;
+  state = loop->cf_state;
+  state->loop = pCFRunLoopGetCurrent();
+
+  pCFRunLoopAddSource(state->loop,
+                      state->signal_source,
+                      *pkCFRunLoopDefaultMode);
+
+  uv_sem_post(&loop->cf_sem);
+
+  pCFRunLoopRun();
+  pCFRunLoopRemoveSource(state->loop,
+                         state->signal_source,
+                         *pkCFRunLoopDefaultMode);
+
+  return NULL;
+}
+
+
+/* Runs in CF thread, executed after `uv__cf_loop_signal()` */
+static void uv__cf_loop_cb(void* arg) {
+  uv_loop_t* loop;
+  uv__cf_loop_state_t* state;
+  QUEUE* item;
+  QUEUE split_head;
+  uv__cf_loop_signal_t* s;
+
+  loop = arg;
+  state = loop->cf_state;
+
+  uv_mutex_lock(&loop->cf_mutex);
+  QUEUE_MOVE(&loop->cf_signals, &split_head);
+  uv_mutex_unlock(&loop->cf_mutex);
+
+  while (!QUEUE_EMPTY(&split_head)) {
+    item = QUEUE_HEAD(&split_head);
+    QUEUE_REMOVE(item);
+
+    s = QUEUE_DATA(item, uv__cf_loop_signal_t, member);
+
+    /* This was a termination signal */
+    if (s->handle == NULL)
+      pCFRunLoopStop(state->loop);
+    else
+      uv__fsevents_reschedule(s->handle, s->type);
+
+    uv__free(s);
+  }
+}
+
+
+/* Runs in UV loop to notify CF thread */
+int uv__cf_loop_signal(uv_loop_t* loop,
+                       uv_fs_event_t* handle,
+                       uv__cf_loop_signal_type_t type) {
+  uv__cf_loop_signal_t* item;
+  uv__cf_loop_state_t* state;
+
+  item = uv__malloc(sizeof(*item));
+  if (item == NULL)
+    return -ENOMEM;
+
+  item->handle = handle;
+  item->type = type;
+
+  uv_mutex_lock(&loop->cf_mutex);
+  QUEUE_INSERT_TAIL(&loop->cf_signals, &item->member);
+  uv_mutex_unlock(&loop->cf_mutex);
+
+  state = loop->cf_state;
+  assert(state != NULL);
+  pCFRunLoopSourceSignal(state->signal_source);
+  pCFRunLoopWakeUp(state->loop);
+
+  return 0;
+}
+
+
+/* Runs in UV loop to initialize handle */
+int uv__fsevents_init(uv_fs_event_t* handle) {
+  int err;
+  uv__cf_loop_state_t* state;
+
+  err = uv__fsevents_loop_init(handle->loop);
+  if (err)
+    return err;
+
+  /* Get absolute path to file */
+  handle->realpath = realpath(handle->path, NULL);
+  if (handle->realpath == NULL)
+    return -errno;
+  handle->realpath_len = strlen(handle->realpath);
+
+  /* Initialize event queue */
+  QUEUE_INIT(&handle->cf_events);
+  handle->cf_error = 0;
+
+  /*
+   * Events will occur in other thread.
+   * Initialize callback for getting them back into event loop's thread
+   */
+  handle->cf_cb = uv__malloc(sizeof(*handle->cf_cb));
+  if (handle->cf_cb == NULL) {
+    err = -ENOMEM;
+    goto fail_cf_cb_malloc;
+  }
+
+  handle->cf_cb->data = handle;
+  uv_async_init(handle->loop, handle->cf_cb, uv__fsevents_cb);
+  handle->cf_cb->flags |= UV__HANDLE_INTERNAL;
+  uv_unref((uv_handle_t*) handle->cf_cb);
+
+  err = uv_mutex_init(&handle->cf_mutex);
+  if (err)
+    goto fail_cf_mutex_init;
+
+  /* Insert handle into the list */
+  state = handle->loop->cf_state;
+  uv_mutex_lock(&state->fsevent_mutex);
+  QUEUE_INSERT_TAIL(&state->fsevent_handles, &handle->cf_member);
+  state->fsevent_handle_count++;
+  state->fsevent_need_reschedule = 1;
+  uv_mutex_unlock(&state->fsevent_mutex);
+
+  /* Reschedule FSEventStream */
+  assert(handle != NULL);
+  err = uv__cf_loop_signal(handle->loop, handle, kUVCFLoopSignalRegular);
+  if (err)
+    goto fail_loop_signal;
+
+  return 0;
+
+fail_loop_signal:
+  uv_mutex_destroy(&handle->cf_mutex);
+
+fail_cf_mutex_init:
+  uv__free(handle->cf_cb);
+  handle->cf_cb = NULL;
+
+fail_cf_cb_malloc:
+  uv__free(handle->realpath);
+  handle->realpath = NULL;
+  handle->realpath_len = 0;
+
+  return err;
+}
+
+
+/* Runs in UV loop to de-initialize handle */
+int uv__fsevents_close(uv_fs_event_t* handle) {
+  int err;
+  uv__cf_loop_state_t* state;
+
+  if (handle->cf_cb == NULL)
+    return -EINVAL;
+
+  /* Remove handle from  the list */
+  state = handle->loop->cf_state;
+  uv_mutex_lock(&state->fsevent_mutex);
+  QUEUE_REMOVE(&handle->cf_member);
+  state->fsevent_handle_count--;
+  state->fsevent_need_reschedule = 1;
+  uv_mutex_unlock(&state->fsevent_mutex);
+
+  /* Reschedule FSEventStream */
+  assert(handle != NULL);
+  err = uv__cf_loop_signal(handle->loop, handle, kUVCFLoopSignalClosing);
+  if (err)
+    return -err;
+
+  /* Wait for deinitialization */
+  uv_sem_wait(&state->fsevent_sem);
+
+  uv_close((uv_handle_t*) handle->cf_cb, (uv_close_cb) uv__free);
+  handle->cf_cb = NULL;
+
+  /* Free data in queue */
+  UV__FSEVENTS_PROCESS(handle, {
+    /* NOP */
+  });
+
+  uv_mutex_destroy(&handle->cf_mutex);
+  uv__free(handle->realpath);
+  handle->realpath = NULL;
+  handle->realpath_len = 0;
+
+  return 0;
+}
+
+#endif /* TARGET_OS_IPHONE */
diff --git a/deps/libtuv/src/unix/getaddrinfo.c b/deps/libtuv/src/unix/getaddrinfo.c
new file mode 100644 (file)
index 0000000..f996e2f
--- /dev/null
@@ -0,0 +1,227 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/* Expose glibc-specific EAI_* error codes. Needs to be defined before we
+ * include any headers.
+ */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
+
+#include "uv.h"
+#include "internal.h"
+
+#include <errno.h>
+#include <stddef.h> /* NULL */
+#include <stdlib.h>
+#include <string.h>
+
+/* EAI_* constants. */
+#include <netdb.h>
+
+
+int uv__getaddrinfo_translate_error(int sys_err) {
+  switch (sys_err) {
+  case 0: return 0;
+#if defined(EAI_ADDRFAMILY)
+  case EAI_ADDRFAMILY: return UV_EAI_ADDRFAMILY;
+#endif
+#if defined(EAI_AGAIN)
+  case EAI_AGAIN: return UV_EAI_AGAIN;
+#endif
+#if defined(EAI_BADFLAGS)
+  case EAI_BADFLAGS: return UV_EAI_BADFLAGS;
+#endif
+#if defined(EAI_BADHINTS)
+  case EAI_BADHINTS: return UV_EAI_BADHINTS;
+#endif
+#if defined(EAI_CANCELED)
+  case EAI_CANCELED: return UV_EAI_CANCELED;
+#endif
+#if defined(EAI_FAIL)
+  case EAI_FAIL: return UV_EAI_FAIL;
+#endif
+#if defined(EAI_FAMILY)
+  case EAI_FAMILY: return UV_EAI_FAMILY;
+#endif
+#if defined(EAI_MEMORY)
+  case EAI_MEMORY: return UV_EAI_MEMORY;
+#endif
+#if defined(EAI_NODATA)
+  case EAI_NODATA: return UV_EAI_NODATA;
+#endif
+#if defined(EAI_NONAME)
+# if !defined(EAI_NODATA) || EAI_NODATA != EAI_NONAME
+  case EAI_NONAME: return UV_EAI_NONAME;
+# endif
+#endif
+#if defined(EAI_OVERFLOW)
+  case EAI_OVERFLOW: return UV_EAI_OVERFLOW;
+#endif
+#if defined(EAI_PROTOCOL)
+  case EAI_PROTOCOL: return UV_EAI_PROTOCOL;
+#endif
+#if defined(EAI_SERVICE)
+  case EAI_SERVICE: return UV_EAI_SERVICE;
+#endif
+#if defined(EAI_SOCKTYPE)
+  case EAI_SOCKTYPE: return UV_EAI_SOCKTYPE;
+#endif
+#if defined(EAI_SYSTEM)
+  case EAI_SYSTEM: return -errno;
+#endif
+  }
+  assert(!"unknown EAI_* error code");
+  abort();
+  return 0;  /* Pacify compiler. */
+}
+
+
+static void uv__getaddrinfo_work(struct uv__work* w) {
+  uv_getaddrinfo_t* req;
+  int err;
+
+  req = container_of(w, uv_getaddrinfo_t, work_req);
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+  err = 0;
+#else
+  /* Only IPv4 is supported now. (Not support IPv6.)*/
+  if (req->hints) {
+    req->hints->ai_family = AF_INET;
+  }
+  err = getaddrinfo(req->hostname, req->service, req->hints, &req->addrinfo);
+#endif
+  req->retcode = uv__getaddrinfo_translate_error(err);
+}
+
+
+static void uv__getaddrinfo_done(struct uv__work* w, int status) {
+  uv_getaddrinfo_t* req;
+
+  req = container_of(w, uv_getaddrinfo_t, work_req);
+  uv__req_unregister(req->loop, req);
+
+  /* See initialization in uv_getaddrinfo(). */
+  if (req->hints)
+    uv__free(req->hints);
+  else if (req->service)
+    uv__free(req->service);
+  else if (req->hostname)
+    uv__free(req->hostname);
+  else
+    assert(0);
+
+  req->hints = NULL;
+  req->service = NULL;
+  req->hostname = NULL;
+
+  if (status == -ECANCELED) {
+    assert(req->retcode == 0);
+    req->retcode = UV_EAI_CANCELED;
+  }
+
+  if (req->cb)
+    req->cb(req, req->retcode, req->addrinfo);
+}
+
+
+int uv_getaddrinfo(uv_loop_t* loop,
+                   uv_getaddrinfo_t* req,
+                   uv_getaddrinfo_cb cb,
+                   const char* hostname,
+                   const char* service,
+                   const struct addrinfo* hints) {
+  size_t hostname_len;
+  size_t service_len;
+  size_t hints_len;
+  size_t len;
+  char* buf;
+
+  if (req == NULL || (hostname == NULL && service == NULL))
+    return -EINVAL;
+
+  hostname_len = hostname ? strlen(hostname) + 1 : 0;
+  service_len = service ? strlen(service) + 1 : 0;
+  hints_len = hints ? sizeof(*hints) : 0;
+  buf = uv__malloc(hostname_len + service_len + hints_len);
+
+  if (buf == NULL)
+    return -ENOMEM;
+
+  uv__req_init(loop, req, UV_GETADDRINFO);
+  req->loop = loop;
+  req->cb = cb;
+  req->addrinfo = NULL;
+  req->hints = NULL;
+  req->service = NULL;
+  req->hostname = NULL;
+  req->retcode = 0;
+
+  /* order matters, see uv_getaddrinfo_done() */
+  len = 0;
+
+  if (hints) {
+    req->hints = memcpy(buf + len, hints, sizeof(*hints));
+    len += sizeof(*hints);
+  }
+
+  if (service) {
+    req->service = memcpy(buf + len, service, service_len);
+    len += service_len;
+  }
+
+  if (hostname)
+    req->hostname = memcpy(buf + len, hostname, hostname_len);
+
+  if (cb) {
+    uv__work_submit(loop,
+                    &req->work_req,
+                    uv__getaddrinfo_work,
+                    uv__getaddrinfo_done);
+    return 0;
+  } else {
+    uv__getaddrinfo_work(&req->work_req);
+    uv__getaddrinfo_done(&req->work_req, 0);
+    return req->retcode;
+  }
+}
+
+
+void uv_freeaddrinfo(struct addrinfo* ai) {
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  if (ai)
+    freeaddrinfo(ai);
+#endif
+}
diff --git a/deps/libtuv/src/unix/getnameinfo.c b/deps/libtuv/src/unix/getnameinfo.c
new file mode 100644 (file)
index 0000000..daa798a
--- /dev/null
@@ -0,0 +1,120 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to
+* deal in the Software without restriction, including without limitation the
+* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+* sell copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+* IN THE SOFTWARE.
+*/
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "uv.h"
+#include "internal.h"
+
+
+static void uv__getnameinfo_work(struct uv__work* w) {
+  uv_getnameinfo_t* req;
+  int err;
+  socklen_t salen;
+
+  req = container_of(w, uv_getnameinfo_t, work_req);
+
+  if (req->storage.ss_family == AF_INET)
+    salen = sizeof(struct sockaddr_in);
+  else if (req->storage.ss_family == AF_INET6)
+    salen = sizeof(struct sockaddr_in6);
+  else
+    abort();
+
+  err = getnameinfo((struct sockaddr*) &req->storage,
+                    salen,
+                    req->host,
+                    sizeof(req->host),
+                    req->service,
+                    sizeof(req->service),
+                    req->flags);
+  req->retcode = uv__getaddrinfo_translate_error(err);
+}
+
+static void uv__getnameinfo_done(struct uv__work* w, int status) {
+  uv_getnameinfo_t* req;
+  char* host;
+  char* service;
+
+  req = container_of(w, uv_getnameinfo_t, work_req);
+  uv__req_unregister(req->loop, req);
+  host = service = NULL;
+
+  if (status == -ECANCELED) {
+    assert(req->retcode == 0);
+    req->retcode = UV_EAI_CANCELED;
+  } else if (req->retcode == 0) {
+    host = req->host;
+    service = req->service;
+  }
+
+  if (req->getnameinfo_cb)
+    req->getnameinfo_cb(req, req->retcode, host, service);
+}
+
+/*
+* Entry point for getnameinfo
+* return 0 if a callback will be made
+* return error code if validation fails
+*/
+int uv_getnameinfo(uv_loop_t* loop,
+                   uv_getnameinfo_t* req,
+                   uv_getnameinfo_cb getnameinfo_cb,
+                   const struct sockaddr* addr,
+                   int flags) {
+  if (req == NULL || addr == NULL)
+    return UV_EINVAL;
+
+  if (addr->sa_family == AF_INET) {
+    memcpy(&req->storage,
+           addr,
+           sizeof(struct sockaddr_in));
+  } else if (addr->sa_family == AF_INET6) {
+    memcpy(&req->storage,
+           addr,
+           sizeof(struct sockaddr_in6));
+  } else {
+    return UV_EINVAL;
+  }
+
+  uv__req_init(loop, (uv_req_t*)req, UV_GETNAMEINFO);
+
+  req->getnameinfo_cb = getnameinfo_cb;
+  req->flags = flags;
+  req->type = UV_GETNAMEINFO;
+  req->loop = loop;
+  req->retcode = 0;
+
+  if (getnameinfo_cb) {
+    uv__work_submit(loop,
+                    &req->work_req,
+                    uv__getnameinfo_work,
+                    uv__getnameinfo_done);
+    return 0;
+  } else {
+    uv__getnameinfo_work(&req->work_req);
+    uv__getnameinfo_done(&req->work_req, 0);
+    return req->retcode;
+  }
+}
diff --git a/deps/libtuv/src/unix/internal.h b/deps/libtuv/src/unix/internal.h
new file mode 100644 (file)
index 0000000..fdab195
--- /dev/null
@@ -0,0 +1,348 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_UNIX_INTERNAL_H_
+#define UV_UNIX_INTERNAL_H_
+
+#include "uv-common.h"
+
+#include <assert.h>
+#include <stdlib.h> /* abort */
+#include <string.h> /* strrchr */
+#include <fcntl.h>  /* O_CLOEXEC, may be */
+#include <stdio.h>
+
+#if defined(__STRICT_ANSI__)
+# define inline __inline
+#endif
+
+#if defined(__linux__)
+# include "linux-syscalls.h"
+#endif /* __linux__ */
+
+#if defined(__sun)
+# include <sys/port.h>
+# include <port.h>
+#endif /* __sun */
+
+#if defined(_AIX)
+# define reqevents events
+# define rtnevents revents
+# include <sys/poll.h>
+#else
+# include <poll.h>
+#endif /* _AIX */
+
+#if defined(__APPLE__) && !TARGET_OS_IPHONE
+# include <AvailabilityMacros.h>
+#endif
+
+#if defined(__ANDROID__)
+int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset);
+# ifdef pthread_sigmask
+# undef pthread_sigmask
+# endif
+# define pthread_sigmask(how, set, oldset) uv__pthread_sigmask(how, set, oldset)
+#endif
+
+#define ACCESS_ONCE(type, var)                                                \
+  (*(volatile type*) &(var))
+
+#define ROUND_UP(a, b)                                                        \
+  ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a))
+
+#define UNREACHABLE()                                                         \
+  do {                                                                        \
+    assert(0 && "unreachable code");                                          \
+    abort();                                                                  \
+  }                                                                           \
+  while (0)
+
+#define SAVE_ERRNO(block)                                                     \
+  do {                                                                        \
+    int _saved_errno = errno;                                                 \
+    do { block; } while (0);                                                  \
+    errno = _saved_errno;                                                     \
+  }                                                                           \
+  while (0)
+
+/* The __clang__ and __INTEL_COMPILER checks are superfluous because they
+ * define __GNUC__. They are here to convey to you, dear reader, that these
+ * macros are enabled when compiling with clang or icc.
+ */
+#if defined(__clang__) ||                                                     \
+    defined(__GNUC__) ||                                                      \
+    defined(__INTEL_COMPILER) ||                                              \
+    defined(__SUNPRO_C)
+# define UV_DESTRUCTOR(declaration) __attribute__((destructor)) declaration
+# define UV_UNUSED(declaration)     __attribute__((unused)) declaration
+#else
+# define UV_DESTRUCTOR(declaration) declaration
+# define UV_UNUSED(declaration)     declaration
+#endif
+
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+# undef UV_DESTRUCTOR
+# define UV_DESTRUCTOR(declaration) UV_DESTRUCTOR_not_supported##declaration
+#endif
+
+/* Leans on the fact that, on Linux, POLLRDHUP == EPOLLRDHUP. */
+#ifdef POLLRDHUP
+# define UV__POLLRDHUP POLLRDHUP
+#else
+# define UV__POLLRDHUP 0x2000
+#endif
+
+#if !defined(O_CLOEXEC) && defined(__FreeBSD__)
+/*
+ * It may be that we are just missing `__POSIX_VISIBLE >= 200809`.
+ * Try using fixed value const and give up, if it doesn't work
+ */
+# define O_CLOEXEC 0x00100000
+#endif
+
+typedef struct uv__stream_queued_fds_s uv__stream_queued_fds_t;
+
+/* handle flags */
+enum {
+  UV_CLOSING              = 0x01,   /* uv_close() called but not finished. */
+  UV_CLOSED               = 0x02,   /* close(2) finished. */
+  UV_STREAM_READING       = 0x04,   /* uv_read_start() called. */
+  UV_STREAM_SHUTTING      = 0x08,   /* uv_shutdown() called but not complete. */
+  UV_STREAM_SHUT          = 0x10,   /* Write side closed. */
+  UV_STREAM_READABLE      = 0x20,   /* The stream is readable */
+  UV_STREAM_WRITABLE      = 0x40,   /* The stream is writable */
+  UV_STREAM_BLOCKING      = 0x80,   /* Synchronous writes. */
+  UV_STREAM_READ_PARTIAL  = 0x100,  /* read(2) read less than requested. */
+  UV_STREAM_READ_EOF      = 0x200,  /* read(2) read EOF. */
+  UV_TCP_NODELAY          = 0x400,  /* Disable Nagle. */
+  UV_TCP_KEEPALIVE        = 0x800,  /* Turn on keep-alive. */
+  UV_TCP_SINGLE_ACCEPT    = 0x1000, /* Only accept() when idle. */
+  UV_HANDLE_IPV6          = 0x10000, /* Handle is bound to a IPv6 socket. */
+  UV_UDP_PROCESSING       = 0x20000, /* Handle is running the send callback queue. */
+  UV_HANDLE_BOUND         = 0x40000  /* Handle is bound to an address and port */
+};
+
+/* loop flags */
+enum {
+  UV_LOOP_BLOCK_SIGPROF = 1
+};
+
+typedef enum {
+  UV_CLOCK_PRECISE = 0,  /* Use the highest resolution clock available. */
+  UV_CLOCK_FAST = 1      /* Use the fastest clock with <= 1ms granularity. */
+} uv_clocktype_t;
+
+struct uv__stream_queued_fds_s {
+  unsigned int size;
+  unsigned int offset;
+  int fds[1];
+};
+
+
+#if defined(_AIX) || \
+    defined(__APPLE__) || \
+    defined(__DragonFly__) || \
+    defined(__FreeBSD__) || \
+    defined(__FreeBSD_kernel__) || \
+    defined(__linux__)
+#define uv__cloexec uv__cloexec_ioctl
+#define uv__nonblock uv__nonblock_ioctl
+#else
+#define uv__cloexec uv__cloexec_fcntl
+#define uv__nonblock uv__nonblock_fcntl
+#endif
+
+/* core */
+int uv__cloexec_ioctl(int fd, int set);
+int uv__cloexec_fcntl(int fd, int set);
+int uv__nonblock_ioctl(int fd, int set);
+int uv__nonblock_fcntl(int fd, int set);
+int uv__close(int fd);
+int uv__close_nocheckstdio(int fd);
+int uv__socket(int domain, int type, int protocol);
+int uv__dup(int fd);
+#if defined(__NUTTX__) || defined(__TIZENRT__) /* No msghdr in nuttx */
+struct msghdr;
+#endif
+ssize_t uv__recvmsg(int fd, struct msghdr *msg, int flags);
+void uv__make_close_pending(uv_handle_t* handle);
+int uv__getiovmax(void);
+
+void uv__io_init(uv__io_t* w, uv__io_cb cb, int fd);
+void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events);
+void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events);
+void uv__io_close(uv_loop_t* loop, uv__io_t* w);
+void uv__io_feed(uv_loop_t* loop, uv__io_t* w);
+int uv__io_active(const uv__io_t* w, unsigned int events);
+int uv__io_check_fd(uv_loop_t* loop, int fd);
+void uv__io_poll(uv_loop_t* loop, int timeout); /* in milliseconds or -1 */
+
+/* async */
+void uv__async_send(struct uv__async* wa);
+void uv__async_init(struct uv__async* wa);
+int uv__async_start(uv_loop_t* loop, struct uv__async* wa, uv__async_cb cb);
+void uv__async_stop(uv_loop_t* loop, struct uv__async* wa);
+
+/* loop */
+void uv__run_idle(uv_loop_t* loop);
+void uv__run_check(uv_loop_t* loop);
+void uv__run_prepare(uv_loop_t* loop);
+
+/* stream */
+void uv__stream_init(uv_loop_t* loop, uv_stream_t* stream,
+    uv_handle_type type);
+int uv__stream_open(uv_stream_t*, int fd, int flags);
+void uv__stream_destroy(uv_stream_t* stream);
+#if defined(__APPLE__)
+int uv__stream_try_select(uv_stream_t* stream, int* fd);
+#endif /* defined(__APPLE__) */
+void uv__server_io(uv_loop_t* loop, uv__io_t* w, unsigned int events);
+int uv__accept(int sockfd);
+int uv__dup2_cloexec(int oldfd, int newfd);
+int uv__open_cloexec(const char* path, int flags);
+
+/* tcp */
+int uv_tcp_listen(uv_tcp_t* tcp, int backlog, uv_connection_cb cb);
+int uv__tcp_nodelay(int fd, int on);
+int uv__tcp_keepalive(int fd, int on, unsigned int delay);
+
+/* pipe */
+int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb);
+
+/* timer */
+void uv__run_timers(uv_loop_t* loop);
+int uv__next_timeout(const uv_loop_t* loop);
+
+/* signal */
+void uv__signal_close(uv_signal_t* handle);
+void uv__signal_global_once_init(void);
+void uv__signal_loop_cleanup(uv_loop_t* loop);
+
+/* platform specific */
+uint64_t uv__hrtime(uv_clocktype_t type);
+int uv__kqueue_init(uv_loop_t* loop);
+int uv__platform_loop_init(uv_loop_t* loop);
+void uv__platform_loop_delete(uv_loop_t* loop);
+void uv__platform_invalidate_fd(uv_loop_t* loop, int fd);
+
+/* various */
+void uv__async_close(uv_async_t* handle);
+void uv__check_close(uv_check_t* handle);
+void uv__fs_event_close(uv_fs_event_t* handle);
+void uv__idle_close(uv_idle_t* handle);
+void uv__pipe_close(uv_pipe_t* handle);
+void uv__poll_close(uv_poll_t* handle);
+void uv__prepare_close(uv_prepare_t* handle);
+void uv__process_close(uv_process_t* handle);
+void uv__stream_close(uv_stream_t* handle);
+void uv__tcp_close(uv_tcp_t* handle);
+void uv__timer_close(uv_timer_t* handle);
+void uv__udp_close(uv_udp_t* handle);
+void uv__udp_finish_close(uv_udp_t* handle);
+uv_handle_type uv__handle_type(int fd);
+FILE* uv__open_file(const char* path);
+int uv__getpwuid_r(uv_passwd_t* pwd);
+
+
+#if defined(__APPLE__)
+int uv___stream_fd(const uv_stream_t* handle);
+#define uv__stream_fd(handle) (uv___stream_fd((const uv_stream_t*) (handle)))
+#else
+#define uv__stream_fd(handle) ((handle)->io_watcher.fd)
+#endif /* defined(__APPLE__) */
+
+#ifdef UV__O_NONBLOCK
+# define UV__F_NONBLOCK UV__O_NONBLOCK
+#else
+# define UV__F_NONBLOCK 1
+#endif
+
+int uv__make_socketpair(int fds[2], int flags);
+int uv__make_pipe(int fds[2], int flags);
+
+#if defined(__APPLE__)
+
+int uv__fsevents_init(uv_fs_event_t* handle);
+int uv__fsevents_close(uv_fs_event_t* handle);
+void uv__fsevents_loop_delete(uv_loop_t* loop);
+
+/* OSX < 10.7 has no file events, polyfill them */
+#ifndef MAC_OS_X_VERSION_10_7
+
+static const int kFSEventStreamCreateFlagFileEvents = 0x00000010;
+static const int kFSEventStreamEventFlagItemCreated = 0x00000100;
+static const int kFSEventStreamEventFlagItemRemoved = 0x00000200;
+static const int kFSEventStreamEventFlagItemInodeMetaMod = 0x00000400;
+static const int kFSEventStreamEventFlagItemRenamed = 0x00000800;
+static const int kFSEventStreamEventFlagItemModified = 0x00001000;
+static const int kFSEventStreamEventFlagItemFinderInfoMod = 0x00002000;
+static const int kFSEventStreamEventFlagItemChangeOwner = 0x00004000;
+static const int kFSEventStreamEventFlagItemXattrMod = 0x00008000;
+static const int kFSEventStreamEventFlagItemIsFile = 0x00010000;
+static const int kFSEventStreamEventFlagItemIsDir = 0x00020000;
+static const int kFSEventStreamEventFlagItemIsSymlink = 0x00040000;
+
+#endif /* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070 */
+
+#endif /* defined(__APPLE__) */
+
+UV_UNUSED(static void uv__req_init(uv_loop_t* loop,
+                                   uv_req_t* req,
+                                   uv_req_type type)) {
+  req->type = type;
+  uv__req_register(loop, req);
+}
+#define uv__req_init(loop, req, type) \
+  uv__req_init((loop), (uv_req_t*)(req), (type))
+
+UV_UNUSED(static void uv__update_time(uv_loop_t* loop)) {
+  /* Use a fast time source if available.  We only need millisecond precision.
+   */
+  loop->time = uv__hrtime(UV_CLOCK_FAST) / 1000000;
+}
+
+UV_UNUSED(static char* uv__basename_r(const char* path)) {
+  char* s;
+
+  s = strrchr(path, '/');
+  if (s == NULL)
+    return (char*) path;
+
+  return s + 1;
+}
+
+#endif /* UV_UNIX_INTERNAL_H_ */
diff --git a/deps/libtuv/src/unix/kqueue.c b/deps/libtuv/src/unix/kqueue.c
new file mode 100644 (file)
index 0000000..fffd462
--- /dev/null
@@ -0,0 +1,463 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <sys/event.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <time.h>
+
+static void uv__fs_event(uv_loop_t* loop, uv__io_t* w, unsigned int fflags);
+
+
+int uv__kqueue_init(uv_loop_t* loop) {
+  loop->backend_fd = kqueue();
+  if (loop->backend_fd == -1)
+    return -errno;
+
+  uv__cloexec(loop->backend_fd, 1);
+
+  return 0;
+}
+
+
+int uv__io_check_fd(uv_loop_t* loop, int fd) {
+  struct kevent ev;
+  int rc;
+
+  rc = 0;
+  EV_SET(&ev, fd, EVFILT_READ, EV_ADD, 0, 0, 0);
+  if (kevent(loop->backend_fd, &ev, 1, NULL, 0, NULL))
+    rc = -errno;
+
+  EV_SET(&ev, fd, EVFILT_READ, EV_DELETE, 0, 0, 0);
+  if (rc == 0)
+    if (kevent(loop->backend_fd, &ev, 1, NULL, 0, NULL))
+      abort();
+
+  return rc;
+}
+
+
+void uv__io_poll(uv_loop_t* loop, int timeout) {
+  struct kevent events[1024];
+  struct kevent* ev;
+  struct timespec spec;
+  unsigned int nevents;
+  unsigned int revents;
+  QUEUE* q;
+  uv__io_t* w;
+  sigset_t* pset;
+  sigset_t set;
+  uint64_t base;
+  uint64_t diff;
+  int have_signals;
+  int filter;
+  int fflags;
+  int count;
+  int nfds;
+  int fd;
+  int op;
+  int i;
+
+  if (loop->nfds == 0) {
+    assert(QUEUE_EMPTY(&loop->watcher_queue));
+    return;
+  }
+
+  nevents = 0;
+
+  while (!QUEUE_EMPTY(&loop->watcher_queue)) {
+    q = QUEUE_HEAD(&loop->watcher_queue);
+    QUEUE_REMOVE(q);
+    QUEUE_INIT(q);
+
+    w = QUEUE_DATA(q, uv__io_t, watcher_queue);
+    assert(w->pevents != 0);
+    assert(w->fd >= 0);
+    assert(w->fd < (int) loop->nwatchers);
+
+    if ((w->events & POLLIN) == 0 && (w->pevents & POLLIN) != 0) {
+      filter = EVFILT_READ;
+      fflags = 0;
+      op = EV_ADD;
+
+      if (w->cb == uv__fs_event) {
+        filter = EVFILT_VNODE;
+        fflags = NOTE_ATTRIB | NOTE_WRITE  | NOTE_RENAME
+               | NOTE_DELETE | NOTE_EXTEND | NOTE_REVOKE;
+        op = EV_ADD | EV_ONESHOT; /* Stop the event from firing repeatedly. */
+      }
+
+      EV_SET(events + nevents, w->fd, filter, op, fflags, 0, 0);
+
+      if (++nevents == ARRAY_SIZE(events)) {
+        if (kevent(loop->backend_fd, events, nevents, NULL, 0, NULL))
+          abort();
+        nevents = 0;
+      }
+    }
+
+    if ((w->events & POLLOUT) == 0 && (w->pevents & POLLOUT) != 0) {
+      EV_SET(events + nevents, w->fd, EVFILT_WRITE, EV_ADD, 0, 0, 0);
+
+      if (++nevents == ARRAY_SIZE(events)) {
+        if (kevent(loop->backend_fd, events, nevents, NULL, 0, NULL))
+          abort();
+        nevents = 0;
+      }
+    }
+
+    w->events = w->pevents;
+  }
+
+  pset = NULL;
+  if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
+    pset = &set;
+    sigemptyset(pset);
+    sigaddset(pset, SIGPROF);
+  }
+
+  assert(timeout >= -1);
+  base = loop->time;
+  count = 48; /* Benchmarks suggest this gives the best throughput. */
+
+  for (;; nevents = 0) {
+    if (timeout != -1) {
+      spec.tv_sec = timeout / 1000;
+      spec.tv_nsec = (timeout % 1000) * 1000000;
+    }
+
+    if (pset != NULL)
+      pthread_sigmask(SIG_BLOCK, pset, NULL);
+
+    nfds = kevent(loop->backend_fd,
+                  events,
+                  nevents,
+                  events,
+                  ARRAY_SIZE(events),
+                  timeout == -1 ? NULL : &spec);
+
+    if (pset != NULL)
+      pthread_sigmask(SIG_UNBLOCK, pset, NULL);
+
+    /* Update loop->time unconditionally. It's tempting to skip the update when
+     * timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the
+     * operating system didn't reschedule our process while in the syscall.
+     */
+    SAVE_ERRNO(uv__update_time(loop));
+
+    if (nfds == 0) {
+      assert(timeout != -1);
+      return;
+    }
+
+    if (nfds == -1) {
+      if (errno != EINTR)
+        abort();
+
+      if (timeout == 0)
+        return;
+
+      if (timeout == -1)
+        continue;
+
+      /* Interrupted by a signal. Update timeout and poll again. */
+      goto update_timeout;
+    }
+
+    have_signals = 0;
+    nevents = 0;
+
+    assert(loop->watchers != NULL);
+    loop->watchers[loop->nwatchers] = (void*) events;
+    loop->watchers[loop->nwatchers + 1] = (void*) (uintptr_t) nfds;
+    for (i = 0; i < nfds; i++) {
+      ev = events + i;
+      fd = ev->ident;
+      /* Skip invalidated events, see uv__platform_invalidate_fd */
+      if (fd == -1)
+        continue;
+      w = loop->watchers[fd];
+
+      if (w == NULL) {
+        /* File descriptor that we've stopped watching, disarm it. */
+        /* TODO batch up */
+        struct kevent events[1];
+
+        EV_SET(events + 0, fd, ev->filter, EV_DELETE, 0, 0, 0);
+        if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL))
+          if (errno != EBADF && errno != ENOENT)
+            abort();
+
+        continue;
+      }
+
+      if (ev->filter == EVFILT_VNODE) {
+        assert(w->events == POLLIN);
+        assert(w->pevents == POLLIN);
+        w->cb(loop, w, ev->fflags); /* XXX always uv__fs_event() */
+        nevents++;
+        continue;
+      }
+
+      revents = 0;
+
+      if (ev->filter == EVFILT_READ) {
+        if (w->pevents & POLLIN) {
+          revents |= POLLIN;
+          w->rcount = ev->data;
+        } else {
+          /* TODO batch up */
+          struct kevent events[1];
+          EV_SET(events + 0, fd, ev->filter, EV_DELETE, 0, 0, 0);
+          if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL))
+            if (errno != ENOENT)
+              abort();
+        }
+      }
+
+      if (ev->filter == EVFILT_WRITE) {
+        if (w->pevents & POLLOUT) {
+          revents |= POLLOUT;
+          w->wcount = ev->data;
+        } else {
+          /* TODO batch up */
+          struct kevent events[1];
+          EV_SET(events + 0, fd, ev->filter, EV_DELETE, 0, 0, 0);
+          if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL))
+            if (errno != ENOENT)
+              abort();
+        }
+      }
+
+      if (ev->flags & EV_ERROR)
+        revents |= POLLERR;
+
+      if ((ev->flags & EV_EOF) && (w->pevents & UV__POLLRDHUP))
+        revents |= UV__POLLRDHUP;
+
+      if (revents == 0)
+        continue;
+
+      /* Run signal watchers last.  This also affects child process watchers
+       * because those are implemented in terms of signal watchers.
+       */
+      if (w == &loop->signal_io_watcher)
+        have_signals = 1;
+      else
+        w->cb(loop, w, revents);
+
+      nevents++;
+    }
+
+    if (have_signals != 0)
+      loop->signal_io_watcher.cb(loop, &loop->signal_io_watcher, POLLIN);
+
+    loop->watchers[loop->nwatchers] = NULL;
+    loop->watchers[loop->nwatchers + 1] = NULL;
+
+    if (have_signals != 0)
+      return;  /* Event loop should cycle now so don't poll again. */
+
+    if (nevents != 0) {
+      if (nfds == ARRAY_SIZE(events) && --count != 0) {
+        /* Poll for more events but don't block this time. */
+        timeout = 0;
+        continue;
+      }
+      return;
+    }
+
+    if (timeout == 0)
+      return;
+
+    if (timeout == -1)
+      continue;
+
+update_timeout:
+    assert(timeout > 0);
+
+    diff = loop->time - base;
+    if (diff >= (uint64_t) timeout)
+      return;
+
+    timeout -= diff;
+  }
+}
+
+
+void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
+  struct kevent* events;
+  uintptr_t i;
+  uintptr_t nfds;
+
+  assert(loop->watchers != NULL);
+
+  events = (struct kevent*) loop->watchers[loop->nwatchers];
+  nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1];
+  if (events == NULL)
+    return;
+
+  /* Invalidate events with same file descriptor */
+  for (i = 0; i < nfds; i++)
+    if ((int) events[i].ident == fd)
+      events[i].ident = -1;
+}
+
+
+static void uv__fs_event(uv_loop_t* loop, uv__io_t* w, unsigned int fflags) {
+  uv_fs_event_t* handle;
+  struct kevent ev;
+  int events;
+  const char* path;
+#if defined(F_GETPATH)
+  /* MAXPATHLEN == PATH_MAX but the former is what XNU calls it internally. */
+  char pathbuf[MAXPATHLEN];
+#endif
+
+  handle = container_of(w, uv_fs_event_t, event_watcher);
+
+  if (fflags & (NOTE_ATTRIB | NOTE_EXTEND))
+    events = UV_CHANGE;
+  else
+    events = UV_RENAME;
+
+  path = NULL;
+#if defined(F_GETPATH)
+  /* Also works when the file has been unlinked from the file system. Passing
+   * in the path when the file has been deleted is arguably a little strange
+   * but it's consistent with what the inotify backend does.
+   */
+  if (fcntl(handle->event_watcher.fd, F_GETPATH, pathbuf) == 0)
+    path = uv__basename_r(pathbuf);
+#endif
+  handle->cb(handle, path, events, 0);
+
+  if (handle->event_watcher.fd == -1)
+    return;
+
+  /* Watcher operates in one-shot mode, re-arm it. */
+  fflags = NOTE_ATTRIB | NOTE_WRITE  | NOTE_RENAME
+         | NOTE_DELETE | NOTE_EXTEND | NOTE_REVOKE;
+
+  EV_SET(&ev, w->fd, EVFILT_VNODE, EV_ADD | EV_ONESHOT, fflags, 0, 0);
+
+  if (kevent(loop->backend_fd, &ev, 1, NULL, 0, NULL))
+    abort();
+}
+
+
+int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) {
+  uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);
+  return 0;
+}
+
+
+int uv_fs_event_start(uv_fs_event_t* handle,
+                      uv_fs_event_cb cb,
+                      const char* path,
+                      unsigned int flags) {
+#if defined(__APPLE__)
+  struct stat statbuf;
+#endif /* defined(__APPLE__) */
+  int fd;
+
+  if (uv__is_active(handle))
+    return -EINVAL;
+
+  /* TODO open asynchronously - but how do we report back errors? */
+  fd = open(path, O_RDONLY);
+  if (fd == -1)
+    return -errno;
+
+  uv__handle_start(handle);
+  uv__io_init(&handle->event_watcher, uv__fs_event, fd);
+  handle->path = uv__strdup(path);
+  handle->cb = cb;
+
+#if defined(__APPLE__)
+  /* Nullify field to perform checks later */
+  handle->cf_cb = NULL;
+  handle->realpath = NULL;
+  handle->realpath_len = 0;
+  handle->cf_flags = flags;
+
+  if (fstat(fd, &statbuf))
+    goto fallback;
+  /* FSEvents works only with directories */
+  if (!(statbuf.st_mode & S_IFDIR))
+    goto fallback;
+
+  /* The fallback fd is no longer needed */
+  uv__close(fd);
+  handle->event_watcher.fd = -1;
+
+  return uv__fsevents_init(handle);
+
+fallback:
+#endif /* defined(__APPLE__) */
+
+  uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
+
+  return 0;
+}
+
+
+int uv_fs_event_stop(uv_fs_event_t* handle) {
+  if (!uv__is_active(handle))
+    return 0;
+
+  uv__handle_stop(handle);
+
+#if defined(__APPLE__)
+  if (uv__fsevents_close(handle))
+#endif /* defined(__APPLE__) */
+  {
+    uv__io_close(handle->loop, &handle->event_watcher);
+  }
+
+  uv__free(handle->path);
+  handle->path = NULL;
+
+  if (handle->event_watcher.fd != -1) {
+    /* When FSEvents is used, we don't use the event_watcher's fd under certain
+     * confitions. (see uv_fs_event_start) */
+    uv__close(handle->event_watcher.fd);
+    handle->event_watcher.fd = -1;
+  }
+
+  return 0;
+}
+
+
+void uv__fs_event_close(uv_fs_event_t* handle) {
+  uv_fs_event_stop(handle);
+}
diff --git a/deps/libtuv/src/unix/linux-core.c b/deps/libtuv/src/unix/linux-core.c
new file mode 100644 (file)
index 0000000..4141497
--- /dev/null
@@ -0,0 +1,461 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/* We lean on the fact that POLL{IN,OUT,ERR,HUP} correspond with their
+ * EPOLL* counterparts.  We use the POLL* variants in this file because that
+ * is what libuv uses elsewhere and it avoids a dependency on <sys/epoll.h>.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <net/if.h>
+#include <sys/param.h>
+#include <sys/prctl.h>
+#include <sys/sysinfo.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <time.h>
+
+#define HAVE_IFADDRS_H 1
+
+#ifdef __UCLIBC__
+# if __UCLIBC_MAJOR__ < 0 && __UCLIBC_MINOR__ < 9 && __UCLIBC_SUBLEVEL__ < 32
+#  undef HAVE_IFADDRS_H
+# endif
+#endif
+
+#ifdef HAVE_IFADDRS_H
+# if defined(__ANDROID__)
+#  include "android-ifaddrs.h"
+# else
+#  include <ifaddrs.h>
+# endif
+# include <sys/socket.h>
+# include <net/ethernet.h>
+# include <netpacket/packet.h>
+#endif /* HAVE_IFADDRS_H */
+
+/* Available from 2.6.32 onwards. */
+#ifndef CLOCK_MONOTONIC_COARSE
+# define CLOCK_MONOTONIC_COARSE 6
+#endif
+
+/* This is rather annoying: CLOCK_BOOTTIME lives in <linux/time.h> but we can't
+ * include that file because it conflicts with <time.h>. We'll just have to
+ * define it ourselves.
+ */
+#ifndef CLOCK_BOOTTIME
+# define CLOCK_BOOTTIME 7
+#endif
+
+int uv__platform_loop_init(uv_loop_t* loop) {
+  int fd;
+
+  fd = uv__epoll_create1(UV__EPOLL_CLOEXEC);
+
+  /* epoll_create1() can fail either because it's not implemented (old kernel)
+   * or because it doesn't understand the EPOLL_CLOEXEC flag.
+   */
+  if (fd == -1 && (errno == ENOSYS || errno == EINVAL)) {
+    fd = uv__epoll_create(256);
+
+    if (fd != -1)
+      uv__cloexec(fd, 1);
+  }
+
+  loop->backend_fd = fd;
+  loop->inotify_fd = -1;
+  loop->inotify_watchers = NULL;
+
+  if (fd == -1)
+    return -errno;
+
+  return 0;
+}
+
+
+void uv__platform_loop_delete(uv_loop_t* loop) {
+  if (loop->inotify_fd == -1) return;
+  uv__io_stop(loop, &loop->inotify_read_watcher, POLLIN);
+  uv__close(loop->inotify_fd);
+  loop->inotify_fd = -1;
+}
+
+
+void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
+  struct uv__epoll_event* events;
+  struct uv__epoll_event dummy;
+  uintptr_t i;
+  uintptr_t nfds;
+
+  assert(loop->watchers != NULL);
+
+  events = (struct uv__epoll_event*) loop->watchers[loop->nwatchers];
+  nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1];
+  if (events != NULL)
+    /* Invalidate events with same file descriptor */
+    for (i = 0; i < nfds; i++)
+      if ((int) events[i].data == fd)
+        events[i].data = -1;
+
+  /* Remove the file descriptor from the epoll.
+   * This avoids a problem where the same file description remains open
+   * in another process, causing repeated junk epoll events.
+   *
+   * We pass in a dummy epoll_event, to work around a bug in old kernels.
+   */
+  if (loop->backend_fd >= 0) {
+    /* Work around a bug in kernels 3.10 to 3.19 where passing a struct that
+     * has the EPOLLWAKEUP flag set generates spurious audit syslog warnings.
+     */
+    memset(&dummy, 0, sizeof(dummy));
+    uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_DEL, fd, &dummy);
+  }
+}
+
+
+int uv__io_check_fd(uv_loop_t* loop, int fd) {
+  struct uv__epoll_event e;
+  int rc;
+
+  e.events = POLLIN;
+  e.data = -1;
+
+  rc = 0;
+  if (uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_ADD, fd, &e))
+    if (errno != EEXIST)
+      rc = -errno;
+
+  if (rc == 0)
+    if (uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_DEL, fd, &e))
+      abort();
+
+  return rc;
+}
+
+
+void uv__io_poll(uv_loop_t* loop, int timeout) {
+  /* A bug in kernels < 2.6.37 makes timeouts larger than ~30 minutes
+   * effectively infinite on 32 bits architectures.  To avoid blocking
+   * indefinitely, we cap the timeout and poll again if necessary.
+   *
+   * Note that "30 minutes" is a simplification because it depends on
+   * the value of CONFIG_HZ.  The magic constant assumes CONFIG_HZ=1200,
+   * that being the largest value I have seen in the wild (and only once.)
+   */
+  static const int max_safe_timeout = 1789569;
+  static int no_epoll_pwait;
+  static int no_epoll_wait;
+  struct uv__epoll_event events[1024];
+  struct uv__epoll_event* pe;
+  struct uv__epoll_event e;
+  int real_timeout;
+  QUEUE* q;
+  uv__io_t* w;
+  sigset_t sigset;
+  uint64_t sigmask;
+  uint64_t base;
+  int have_signals;
+  int nevents;
+  int count;
+  int nfds;
+  int fd;
+  int op;
+  int i;
+
+  if (loop->nfds == 0) {
+    assert(QUEUE_EMPTY(&loop->watcher_queue));
+    return;
+  }
+
+  while (!QUEUE_EMPTY(&loop->watcher_queue)) {
+    q = QUEUE_HEAD(&loop->watcher_queue);
+    QUEUE_REMOVE(q);
+    QUEUE_INIT(q);
+
+    w = QUEUE_DATA(q, uv__io_t, watcher_queue);
+    assert(w->pevents != 0);
+    assert(w->fd >= 0);
+    assert(w->fd < (int) loop->nwatchers);
+
+    e.events = w->pevents;
+    e.data = w->fd;
+
+    if (w->events == 0)
+      op = UV__EPOLL_CTL_ADD;
+    else
+      op = UV__EPOLL_CTL_MOD;
+
+    /* XXX Future optimization: do EPOLL_CTL_MOD lazily if we stop watching
+     * events, skip the syscall and squelch the events after epoll_wait().
+     */
+    if (uv__epoll_ctl(loop->backend_fd, op, w->fd, &e)) {
+      if (errno != EEXIST)
+        abort();
+
+      assert(op == UV__EPOLL_CTL_ADD);
+
+      /* We've reactivated a file descriptor that's been watched before. */
+      if (uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_MOD, w->fd, &e))
+        abort();
+    }
+
+    w->events = w->pevents;
+  }
+
+  sigmask = 0;
+  if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
+    sigemptyset(&sigset);
+    sigaddset(&sigset, SIGPROF);
+    sigmask |= 1 << (SIGPROF - 1);
+  }
+
+  assert(timeout >= -1);
+  base = loop->time;
+  count = 48; /* Benchmarks suggest this gives the best throughput. */
+  real_timeout = timeout;
+
+  for (;;) {
+    /* See the comment for max_safe_timeout for an explanation of why
+     * this is necessary.  Executive summary: kernel bug workaround.
+     */
+    if (sizeof(int32_t) == sizeof(long) && timeout >= max_safe_timeout)
+      timeout = max_safe_timeout;
+
+    if (sigmask != 0 && no_epoll_pwait != 0)
+      if (pthread_sigmask(SIG_BLOCK, &sigset, NULL))
+        abort();
+
+    if (no_epoll_wait != 0 || (sigmask != 0 && no_epoll_pwait == 0)) {
+      nfds = uv__epoll_pwait(loop->backend_fd,
+                             events,
+                             ARRAY_SIZE(events),
+                             timeout,
+                             sigmask);
+      if (nfds == -1 && errno == ENOSYS)
+        no_epoll_pwait = 1;
+    } else {
+      nfds = uv__epoll_wait(loop->backend_fd,
+                            events,
+                            ARRAY_SIZE(events),
+                            timeout);
+      if (nfds == -1 && errno == ENOSYS)
+        no_epoll_wait = 1;
+    }
+
+    if (sigmask != 0 && no_epoll_pwait != 0)
+      if (pthread_sigmask(SIG_UNBLOCK, &sigset, NULL))
+        abort();
+
+    /* Update loop->time unconditionally. It's tempting to skip the update when
+     * timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the
+     * operating system didn't reschedule our process while in the syscall.
+     */
+    SAVE_ERRNO(uv__update_time(loop));
+
+    if (nfds == 0) {
+      assert(timeout != -1);
+
+      if (timeout == 0)
+        return;
+
+      /* We may have been inside the system call for longer than |timeout|
+       * milliseconds so we need to update the timestamp to avoid drift.
+       */
+      goto update_timeout;
+    }
+
+    if (nfds == -1) {
+      if (errno == ENOSYS) {
+        /* epoll_wait() or epoll_pwait() failed, try the other system call. */
+        assert(no_epoll_wait == 0 || no_epoll_pwait == 0);
+        continue;
+      }
+
+      if (errno != EINTR)
+        abort();
+
+      if (timeout == -1)
+        continue;
+
+      if (timeout == 0)
+        return;
+
+      /* Interrupted by a signal. Update timeout and poll again. */
+      goto update_timeout;
+    }
+
+    have_signals = 0;
+    nevents = 0;
+
+    assert(loop->watchers != NULL);
+    loop->watchers[loop->nwatchers] = (void*) events;
+    loop->watchers[loop->nwatchers + 1] = (void*) (uintptr_t) nfds;
+    for (i = 0; i < nfds; i++) {
+      pe = events + i;
+      fd = pe->data;
+
+      /* Skip invalidated events, see uv__platform_invalidate_fd */
+      if (fd == -1)
+        continue;
+
+      assert(fd >= 0);
+      assert((unsigned) fd < loop->nwatchers);
+
+      w = loop->watchers[fd];
+
+      if (w == NULL) {
+        /* File descriptor that we've stopped watching, disarm it.
+         *
+         * Ignore all errors because we may be racing with another thread
+         * when the file descriptor is closed.
+         */
+        uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_DEL, fd, pe);
+        continue;
+      }
+
+      /* Give users only events they're interested in. Prevents spurious
+       * callbacks when previous callback invocation in this loop has stopped
+       * the current watcher. Also, filters out events that users has not
+       * requested us to watch.
+       */
+      pe->events &= w->pevents | POLLERR | POLLHUP;
+
+      /* Work around an epoll quirk where it sometimes reports just the
+       * EPOLLERR or EPOLLHUP event.  In order to force the event loop to
+       * move forward, we merge in the read/write events that the watcher
+       * is interested in; uv__read() and uv__write() will then deal with
+       * the error or hangup in the usual fashion.
+       *
+       * Note to self: happens when epoll reports EPOLLIN|EPOLLHUP, the user
+       * reads the available data, calls uv_read_stop(), then sometime later
+       * calls uv_read_start() again.  By then, libuv has forgotten about the
+       * hangup and the kernel won't report EPOLLIN again because there's
+       * nothing left to read.  If anything, libuv is to blame here.  The
+       * current hack is just a quick bandaid; to properly fix it, libuv
+       * needs to remember the error/hangup event.  We should get that for
+       * free when we switch over to edge-triggered I/O.
+       */
+      if (pe->events == POLLERR || pe->events == POLLHUP)
+        pe->events |= w->pevents & (POLLIN | POLLOUT);
+
+      if (pe->events != 0) {
+        /* Run signal watchers last.  This also affects child process watchers
+         * because those are implemented in terms of signal watchers.
+         */
+        if (w == &loop->signal_io_watcher)
+          have_signals = 1;
+        else
+          w->cb(loop, w, pe->events);
+
+        nevents++;
+      }
+    }
+
+    if (have_signals != 0)
+      loop->signal_io_watcher.cb(loop, &loop->signal_io_watcher, POLLIN);
+
+    loop->watchers[loop->nwatchers] = NULL;
+    loop->watchers[loop->nwatchers + 1] = NULL;
+
+    if (have_signals != 0)
+      return;  /* Event loop should cycle now so don't poll again. */
+
+    if (nevents != 0) {
+      if (nfds == ARRAY_SIZE(events) && --count != 0) {
+        /* Poll for more events but don't block this time. */
+        timeout = 0;
+        continue;
+      }
+      return;
+    }
+
+    if (timeout == 0)
+      return;
+
+    if (timeout == -1)
+      continue;
+
+update_timeout:
+    assert(timeout > 0);
+
+    real_timeout -= (loop->time - base);
+    if (real_timeout <= 0)
+      return;
+
+    timeout = real_timeout;
+  }
+}
+
+
+uint64_t uv__hrtime(uv_clocktype_t type) {
+  static clock_t fast_clock_id = -1;
+  struct timespec t;
+  clock_t clock_id;
+
+  /* Prefer CLOCK_MONOTONIC_COARSE if available but only when it has
+   * millisecond granularity or better.  CLOCK_MONOTONIC_COARSE is
+   * serviced entirely from the vDSO, whereas CLOCK_MONOTONIC may
+   * decide to make a costly system call.
+   */
+  /* TODO(bnoordhuis) Use CLOCK_MONOTONIC_COARSE for UV_CLOCK_PRECISE
+   * when it has microsecond granularity or better (unlikely).
+   */
+  if (type == UV_CLOCK_FAST && fast_clock_id == -1) {
+    if (clock_getres(CLOCK_MONOTONIC_COARSE, &t) == 0 &&
+        t.tv_nsec <= 1 * 1000 * 1000) {
+      fast_clock_id = CLOCK_MONOTONIC_COARSE;
+    } else {
+      fast_clock_id = CLOCK_MONOTONIC;
+    }
+  }
+
+  clock_id = CLOCK_MONOTONIC;
+  if (type == UV_CLOCK_FAST)
+    clock_id = fast_clock_id;
+
+  if (clock_gettime(clock_id, &t))
+    return 0;  /* Not really possible. */
+
+  return t.tv_sec * (uint64_t) 1e9 + t.tv_nsec;
+}
diff --git a/deps/libtuv/src/unix/linux-inotify.c b/deps/libtuv/src/unix/linux-inotify.c
new file mode 100644 (file)
index 0000000..4708c05
--- /dev/null
@@ -0,0 +1,285 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "tree.h"
+#include "internal.h"
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <sys/types.h>
+#include <unistd.h>
+
+struct watcher_list {
+  RB_ENTRY(watcher_list) entry;
+  QUEUE watchers;
+  int iterating;
+  char* path;
+  int wd;
+};
+
+struct watcher_root {
+  struct watcher_list* rbh_root;
+};
+#define CAST(p) ((struct watcher_root*)(p))
+
+
+static int compare_watchers(const struct watcher_list* a,
+                            const struct watcher_list* b) {
+  if (a->wd < b->wd) return -1;
+  if (a->wd > b->wd) return 1;
+  return 0;
+}
+
+
+RB_GENERATE_STATIC(watcher_root, watcher_list, entry, compare_watchers)
+
+
+static void uv__inotify_read(uv_loop_t* loop,
+                             uv__io_t* w,
+                             unsigned int revents);
+
+
+static int new_inotify_fd(void) {
+  int err;
+  int fd;
+
+  fd = uv__inotify_init1(UV__IN_NONBLOCK | UV__IN_CLOEXEC);
+  if (fd != -1)
+    return fd;
+
+  if (errno != ENOSYS)
+    return -errno;
+
+  fd = uv__inotify_init();
+  if (fd == -1)
+    return -errno;
+
+  err = uv__cloexec(fd, 1);
+  if (err == 0)
+    err = uv__nonblock(fd, 1);
+
+  if (err) {
+    uv__close(fd);
+    return err;
+  }
+
+  return fd;
+}
+
+
+static int init_inotify(uv_loop_t* loop) {
+  int err;
+
+  if (loop->inotify_fd != -1)
+    return 0;
+
+  err = new_inotify_fd();
+  if (err < 0)
+    return err;
+
+  loop->inotify_fd = err;
+  uv__io_init(&loop->inotify_read_watcher, uv__inotify_read, loop->inotify_fd);
+  uv__io_start(loop, &loop->inotify_read_watcher, POLLIN);
+
+  return 0;
+}
+
+
+static struct watcher_list* find_watcher(uv_loop_t* loop, int wd) {
+  struct watcher_list w;
+  w.wd = wd;
+  return RB_FIND(watcher_root, CAST(&loop->inotify_watchers), &w);
+}
+
+static void maybe_free_watcher_list(struct watcher_list* w, uv_loop_t* loop) {
+  /* if the watcher_list->watchers is being iterated over, we can't free it. */
+  if ((!w->iterating) && QUEUE_EMPTY(&w->watchers)) {
+    /* No watchers left for this path. Clean up. */
+    RB_REMOVE(watcher_root, CAST(&loop->inotify_watchers), w);
+    uv__inotify_rm_watch(loop->inotify_fd, w->wd);
+    uv__free(w);
+  }
+}
+
+static void uv__inotify_read(uv_loop_t* loop,
+                             uv__io_t* dummy,
+                             unsigned int events) {
+  const struct uv__inotify_event* e;
+  struct watcher_list* w;
+  uv_fs_event_t* h;
+  QUEUE queue;
+  QUEUE* q;
+  const char* path;
+  ssize_t size;
+  const char *p;
+  /* needs to be large enough for sizeof(inotify_event) + strlen(path) */
+  char buf[4096];
+
+  while (1) {
+    do
+      size = read(loop->inotify_fd, buf, sizeof(buf));
+    while (size == -1 && errno == EINTR);
+
+    if (size == -1) {
+      assert(errno == EAGAIN || errno == EWOULDBLOCK);
+      break;
+    }
+
+    assert(size > 0); /* pre-2.6.21 thing, size=0 == read buffer too small */
+
+    /* Now we have one or more inotify_event structs. */
+    for (p = buf; p < buf + size; p += sizeof(*e) + e->len) {
+      e = (const struct uv__inotify_event*)p;
+
+      events = 0;
+      if (e->mask & (UV__IN_ATTRIB|UV__IN_MODIFY))
+        events |= UV_CHANGE;
+      if (e->mask & ~(UV__IN_ATTRIB|UV__IN_MODIFY))
+        events |= UV_RENAME;
+
+      w = find_watcher(loop, e->wd);
+      if (w == NULL)
+        continue; /* Stale event, no watchers left. */
+
+      /* inotify does not return the filename when monitoring a single file
+       * for modifications. Repurpose the filename for API compatibility.
+       * I'm not convinced this is a good thing, maybe it should go.
+       */
+      path = e->len ? (const char*) (e + 1) : uv__basename_r(w->path);
+
+      /* We're about to iterate over the queue and call user's callbacks.
+       * What can go wrong?
+       * A callback could call uv_fs_event_stop()
+       * and the queue can change under our feet.
+       * So, we use QUEUE_MOVE() trick to safely iterate over the queue.
+       * And we don't free the watcher_list until we're done iterating.
+       *
+       * First,
+       * tell uv_fs_event_stop() (that could be called from a user's callback)
+       * not to free watcher_list.
+       */
+      w->iterating = 1;
+      QUEUE_MOVE(&w->watchers, &queue);
+      while (!QUEUE_EMPTY(&queue)) {
+        q = QUEUE_HEAD(&queue);
+        h = QUEUE_DATA(q, uv_fs_event_t, watchers);
+
+        QUEUE_REMOVE(q);
+        QUEUE_INSERT_TAIL(&w->watchers, q);
+
+        h->cb(h, path, events, 0);
+      }
+      /* done iterating, time to (maybe) free empty watcher_list */
+      w->iterating = 0;
+      maybe_free_watcher_list(w, loop);
+    }
+  }
+}
+
+
+int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) {
+  uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);
+  return 0;
+}
+
+
+int uv_fs_event_start(uv_fs_event_t* handle,
+                      uv_fs_event_cb cb,
+                      const char* path,
+                      unsigned int flags) {
+  struct watcher_list* w;
+  int events;
+  int err;
+  int wd;
+
+  if (uv__is_active(handle))
+    return -EINVAL;
+
+  err = init_inotify(handle->loop);
+  if (err)
+    return err;
+
+  events = UV__IN_ATTRIB
+         | UV__IN_CREATE
+         | UV__IN_MODIFY
+         | UV__IN_DELETE
+         | UV__IN_DELETE_SELF
+         | UV__IN_MOVE_SELF
+         | UV__IN_MOVED_FROM
+         | UV__IN_MOVED_TO;
+
+  wd = uv__inotify_add_watch(handle->loop->inotify_fd, path, events);
+  if (wd == -1)
+    return -errno;
+
+  w = find_watcher(handle->loop, wd);
+  if (w)
+    goto no_insert;
+
+  w = uv__malloc(sizeof(*w) + strlen(path) + 1);
+  if (w == NULL)
+    return -ENOMEM;
+
+  w->wd = wd;
+  w->path = strcpy((char*)(w + 1), path);
+  QUEUE_INIT(&w->watchers);
+  w->iterating = 0;
+  RB_INSERT(watcher_root, CAST(&handle->loop->inotify_watchers), w);
+
+no_insert:
+  uv__handle_start(handle);
+  QUEUE_INSERT_TAIL(&w->watchers, &handle->watchers);
+  handle->path = w->path;
+  handle->cb = cb;
+  handle->wd = wd;
+
+  return 0;
+}
+
+
+int uv_fs_event_stop(uv_fs_event_t* handle) {
+  struct watcher_list* w;
+
+  if (!uv__is_active(handle))
+    return 0;
+
+  w = find_watcher(handle->loop, handle->wd);
+  assert(w != NULL);
+
+  handle->wd = -1;
+  handle->path = NULL;
+  uv__handle_stop(handle);
+  QUEUE_REMOVE(&handle->watchers);
+
+  maybe_free_watcher_list(w, handle->loop);
+
+  return 0;
+}
+
+
+void uv__fs_event_close(uv_fs_event_t* handle) {
+  uv_fs_event_stop(handle);
+}
diff --git a/deps/libtuv/src/unix/linux-syscalls.c b/deps/libtuv/src/unix/linux-syscalls.c
new file mode 100644 (file)
index 0000000..d7d0937
--- /dev/null
@@ -0,0 +1,416 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "linux-syscalls.h"
+#include <unistd.h>
+#include <signal.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <errno.h>
+
+#if defined(__has_feature)
+# if __has_feature(memory_sanitizer)
+#  define MSAN_ACTIVE 1
+#  include <sanitizer/msan_interface.h>
+# endif
+#endif
+
+#if defined(__i386__)
+# ifndef __NR_socketcall
+#  define __NR_socketcall 102
+# endif
+#endif
+
+#if defined(__arm__)
+# if defined(__thumb__) || defined(__ARM_EABI__)
+#  define UV_SYSCALL_BASE 0
+# else
+#  define UV_SYSCALL_BASE 0x900000
+# endif
+#endif /* __arm__ */
+
+#ifndef __NR_accept4
+# if defined(__x86_64__)
+#  define __NR_accept4 288
+# elif defined(__i386__)
+   /* Nothing. Handled through socketcall(). */
+# elif defined(__arm__)
+#  define __NR_accept4 (UV_SYSCALL_BASE + 366)
+# endif
+#endif /* __NR_accept4 */
+
+#ifndef __NR_eventfd
+# if defined(__x86_64__)
+#  define __NR_eventfd 284
+# elif defined(__i386__)
+#  define __NR_eventfd 323
+# elif defined(__arm__)
+#  define __NR_eventfd (UV_SYSCALL_BASE + 351)
+# endif
+#endif /* __NR_eventfd */
+
+#ifndef __NR_eventfd2
+# if defined(__x86_64__)
+#  define __NR_eventfd2 290
+# elif defined(__i386__)
+#  define __NR_eventfd2 328
+# elif defined(__arm__)
+#  define __NR_eventfd2 (UV_SYSCALL_BASE + 356)
+# endif
+#endif /* __NR_eventfd2 */
+
+#ifndef __NR_epoll_create
+# if defined(__x86_64__)
+#  define __NR_epoll_create 213
+# elif defined(__i386__)
+#  define __NR_epoll_create 254
+# elif defined(__arm__)
+#  define __NR_epoll_create (UV_SYSCALL_BASE + 250)
+# endif
+#endif /* __NR_epoll_create */
+
+#ifndef __NR_epoll_create1
+# if defined(__x86_64__)
+#  define __NR_epoll_create1 291
+# elif defined(__i386__)
+#  define __NR_epoll_create1 329
+# elif defined(__arm__)
+#  define __NR_epoll_create1 (UV_SYSCALL_BASE + 357)
+# endif
+#endif /* __NR_epoll_create1 */
+
+#ifndef __NR_epoll_ctl
+# if defined(__x86_64__)
+#  define __NR_epoll_ctl 233 /* used to be 214 */
+# elif defined(__i386__)
+#  define __NR_epoll_ctl 255
+# elif defined(__arm__)
+#  define __NR_epoll_ctl (UV_SYSCALL_BASE + 251)
+# endif
+#endif /* __NR_epoll_ctl */
+
+#ifndef __NR_epoll_wait
+# if defined(__x86_64__)
+#  define __NR_epoll_wait 232 /* used to be 215 */
+# elif defined(__i386__)
+#  define __NR_epoll_wait 256
+# elif defined(__arm__)
+#  define __NR_epoll_wait (UV_SYSCALL_BASE + 252)
+# endif
+#endif /* __NR_epoll_wait */
+
+#ifndef __NR_epoll_pwait
+# if defined(__x86_64__)
+#  define __NR_epoll_pwait 281
+# elif defined(__i386__)
+#  define __NR_epoll_pwait 319
+# elif defined(__arm__)
+#  define __NR_epoll_pwait (UV_SYSCALL_BASE + 346)
+# endif
+#endif /* __NR_epoll_pwait */
+
+#ifndef __NR_inotify_init
+# if defined(__x86_64__)
+#  define __NR_inotify_init 253
+# elif defined(__i386__)
+#  define __NR_inotify_init 291
+# elif defined(__arm__)
+#  define __NR_inotify_init (UV_SYSCALL_BASE + 316)
+# endif
+#endif /* __NR_inotify_init */
+
+#ifndef __NR_inotify_init1
+# if defined(__x86_64__)
+#  define __NR_inotify_init1 294
+# elif defined(__i386__)
+#  define __NR_inotify_init1 332
+# elif defined(__arm__)
+#  define __NR_inotify_init1 (UV_SYSCALL_BASE + 360)
+# endif
+#endif /* __NR_inotify_init1 */
+
+#ifndef __NR_inotify_add_watch
+# if defined(__x86_64__)
+#  define __NR_inotify_add_watch 254
+# elif defined(__i386__)
+#  define __NR_inotify_add_watch 292
+# elif defined(__arm__)
+#  define __NR_inotify_add_watch (UV_SYSCALL_BASE + 317)
+# endif
+#endif /* __NR_inotify_add_watch */
+
+#ifndef __NR_inotify_rm_watch
+# if defined(__x86_64__)
+#  define __NR_inotify_rm_watch 255
+# elif defined(__i386__)
+#  define __NR_inotify_rm_watch 293
+# elif defined(__arm__)
+#  define __NR_inotify_rm_watch (UV_SYSCALL_BASE + 318)
+# endif
+#endif /* __NR_inotify_rm_watch */
+
+#ifndef __NR_pipe2
+# if defined(__x86_64__)
+#  define __NR_pipe2 293
+# elif defined(__i386__)
+#  define __NR_pipe2 331
+# elif defined(__arm__)
+#  define __NR_pipe2 (UV_SYSCALL_BASE + 359)
+# endif
+#endif /* __NR_pipe2 */
+
+#ifndef __NR_recvmmsg
+# if defined(__x86_64__)
+#  define __NR_recvmmsg 299
+# elif defined(__i386__)
+#  define __NR_recvmmsg 337
+# elif defined(__arm__)
+#  define __NR_recvmmsg (UV_SYSCALL_BASE + 365)
+# endif
+#endif /* __NR_recvmsg */
+
+#ifndef __NR_sendmmsg
+# if defined(__x86_64__)
+#  define __NR_sendmmsg 307
+# elif defined(__i386__)
+#  define __NR_sendmmsg 345
+# elif defined(__arm__)
+#  define __NR_sendmmsg (UV_SYSCALL_BASE + 374)
+# endif
+#endif /* __NR_sendmmsg */
+
+#ifndef __NR_utimensat
+# if defined(__x86_64__)
+#  define __NR_utimensat 280
+# elif defined(__i386__)
+#  define __NR_utimensat 320
+# elif defined(__arm__)
+#  define __NR_utimensat (UV_SYSCALL_BASE + 348)
+# endif
+#endif /* __NR_utimensat */
+
+#ifndef __NR_preadv
+# if defined(__x86_64__)
+#  define __NR_preadv 295
+# elif defined(__i386__)
+#  define __NR_preadv 333
+# elif defined(__arm__)
+#  define __NR_preadv (UV_SYSCALL_BASE + 361)
+# endif
+#endif /* __NR_preadv */
+
+#ifndef __NR_pwritev
+# if defined(__x86_64__)
+#  define __NR_pwritev 296
+# elif defined(__i386__)
+#  define __NR_pwritev 334
+# elif defined(__arm__)
+#  define __NR_pwritev (UV_SYSCALL_BASE + 362)
+# endif
+#endif /* __NR_pwritev */
+
+#ifndef __NR_dup3
+# if defined(__x86_64__)
+#  define __NR_dup3 292
+# elif defined(__i386__)
+#  define __NR_dup3 330
+# elif defined(__arm__)
+#  define __NR_dup3 (UV_SYSCALL_BASE + 358)
+# endif
+#endif /* __NR_pwritev */
+
+
+int uv__accept4(int fd, struct sockaddr* addr, socklen_t* addrlen, int flags) {
+#if defined(__i386__)
+  unsigned long args[4];
+  int r;
+
+  args[0] = (unsigned long) fd;
+  args[1] = (unsigned long) addr;
+  args[2] = (unsigned long) addrlen;
+  args[3] = (unsigned long) flags;
+
+  r = syscall(__NR_socketcall, 18 /* SYS_ACCEPT4 */, args);
+
+  /* socketcall() raises EINVAL when SYS_ACCEPT4 is not supported but so does
+   * a bad flags argument. Try to distinguish between the two cases.
+   */
+  if (r == -1)
+    if (errno == EINVAL)
+      if ((flags & ~(UV__SOCK_CLOEXEC|UV__SOCK_NONBLOCK)) == 0)
+        errno = ENOSYS;
+
+  return r;
+#elif defined(__NR_accept4)
+  return syscall(__NR_accept4, fd, addr, addrlen, flags);
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+int uv__eventfd(unsigned int count) {
+#if defined(__NR_eventfd)
+  return syscall(__NR_eventfd, count);
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+int uv__eventfd2(unsigned int count, int flags) {
+#if defined(__NR_eventfd2)
+  return syscall(__NR_eventfd2, count, flags);
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+int uv__epoll_create(int size) {
+#if defined(__NR_epoll_create)
+  return syscall(__NR_epoll_create, size);
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+int uv__epoll_create1(int flags) {
+#if defined(__NR_epoll_create1)
+  return syscall(__NR_epoll_create1, flags);
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+int uv__epoll_ctl(int epfd, int op, int fd, struct uv__epoll_event* events) {
+#if defined(__NR_epoll_ctl)
+  return syscall(__NR_epoll_ctl, epfd, op, fd, events);
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+int uv__epoll_wait(int epfd,
+                   struct uv__epoll_event* events,
+                   int nevents,
+                   int timeout) {
+#if defined(__NR_epoll_wait)
+  int result;
+  result = syscall(__NR_epoll_wait, epfd, events, nevents, timeout);
+#if MSAN_ACTIVE
+  if (result > 0)
+    __msan_unpoison(events, sizeof(events[0]) * result);
+#endif
+  return result;
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+int uv__epoll_pwait(int epfd,
+                    struct uv__epoll_event* events,
+                    int nevents,
+                    int timeout,
+                    uint64_t sigmask) {
+#if defined(__NR_epoll_pwait)
+  int result;
+  result = syscall(__NR_epoll_pwait,
+                   epfd,
+                   events,
+                   nevents,
+                   timeout,
+                   &sigmask,
+                   sizeof(sigmask));
+#if MSAN_ACTIVE
+  if (result > 0)
+    __msan_unpoison(events, sizeof(events[0]) * result);
+#endif
+  return result;
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+int uv__pipe2(int pipefd[2], int flags) {
+#if defined(__NR_pipe2)
+  int result;
+  result = syscall(__NR_pipe2, pipefd, flags);
+#if MSAN_ACTIVE
+  if (!result)
+    __msan_unpoison(pipefd, sizeof(int[2]));
+#endif
+  return result;
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+int uv__utimesat(int dirfd,
+                 const char* path,
+                 const struct timespec times[2],
+                 int flags)
+{
+#if defined(__NR_utimensat)
+  return syscall(__NR_utimensat, dirfd, path, times, flags);
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, int64_t offset) {
+#if defined(__NR_preadv)
+  return syscall(__NR_preadv, fd, iov, iovcnt, (long)offset, (long)(offset >> 32));
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
+
+
+ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset) {
+#if defined(__NR_pwritev)
+  return syscall(__NR_pwritev, fd, iov, iovcnt, (long)offset, (long)(offset >> 32));
+#else
+  return errno = ENOSYS, -1;
+#endif
+}
diff --git a/deps/libtuv/src/unix/linux-syscalls.h b/deps/libtuv/src/unix/linux-syscalls.h
new file mode 100644 (file)
index 0000000..4c095e9
--- /dev/null
@@ -0,0 +1,151 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef UV_LINUX_SYSCALL_H_
+#define UV_LINUX_SYSCALL_H_
+
+#undef  _GNU_SOURCE
+#define _GNU_SOURCE
+
+#include <stdint.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+
+#if defined(__alpha__)
+# define UV__O_CLOEXEC        0x200000
+#elif defined(__hppa__)
+# define UV__O_CLOEXEC        0x200000
+#elif defined(__sparc__)
+# define UV__O_CLOEXEC        0x400000
+#else
+# define UV__O_CLOEXEC        0x80000
+#endif
+
+#if defined(__alpha__)
+# define UV__O_NONBLOCK       0x4
+#elif defined(__hppa__)
+# define UV__O_NONBLOCK       O_NONBLOCK
+#elif defined(__mips__)
+# define UV__O_NONBLOCK       0x80
+#elif defined(__sparc__)
+# define UV__O_NONBLOCK       0x4000
+#else
+# define UV__O_NONBLOCK       0x800
+#endif
+
+#define UV__EFD_CLOEXEC       UV__O_CLOEXEC
+#define UV__EFD_NONBLOCK      UV__O_NONBLOCK
+
+#define UV__IN_CLOEXEC        UV__O_CLOEXEC
+#define UV__IN_NONBLOCK       UV__O_NONBLOCK
+
+#define UV__SOCK_CLOEXEC      UV__O_CLOEXEC
+#if defined(SOCK_NONBLOCK)
+# define UV__SOCK_NONBLOCK    SOCK_NONBLOCK
+#else
+# define UV__SOCK_NONBLOCK    UV__O_NONBLOCK
+#endif
+
+/* epoll flags */
+#define UV__EPOLL_CLOEXEC     UV__O_CLOEXEC
+#define UV__EPOLL_CTL_ADD     1
+#define UV__EPOLL_CTL_DEL     2
+#define UV__EPOLL_CTL_MOD     3
+
+/* inotify flags */
+#define UV__IN_ACCESS         0x001
+#define UV__IN_MODIFY         0x002
+#define UV__IN_ATTRIB         0x004
+#define UV__IN_CLOSE_WRITE    0x008
+#define UV__IN_CLOSE_NOWRITE  0x010
+#define UV__IN_OPEN           0x020
+#define UV__IN_MOVED_FROM     0x040
+#define UV__IN_MOVED_TO       0x080
+#define UV__IN_CREATE         0x100
+#define UV__IN_DELETE         0x200
+#define UV__IN_DELETE_SELF    0x400
+#define UV__IN_MOVE_SELF      0x800
+
+#if defined(__x86_64__)
+struct uv__epoll_event {
+  uint32_t events;
+  uint64_t data;
+} __attribute__((packed));
+#else
+struct uv__epoll_event {
+  uint32_t events;
+  uint64_t data;
+};
+#endif
+
+struct uv__inotify_event {
+  int32_t wd;
+  uint32_t mask;
+  uint32_t cookie;
+  uint32_t len;
+  /* char name[0]; */
+};
+
+struct uv__mmsghdr {
+  struct msghdr msg_hdr;
+  unsigned int msg_len;
+};
+
+int uv__accept4(int fd, struct sockaddr* addr, socklen_t* addrlen, int flags);
+int uv__eventfd(unsigned int count);
+int uv__epoll_create(int size);
+int uv__epoll_create1(int flags);
+int uv__epoll_ctl(int epfd, int op, int fd, struct uv__epoll_event *ev);
+int uv__epoll_wait(int epfd,
+                   struct uv__epoll_event* events,
+                   int nevents,
+                   int timeout);
+int uv__epoll_pwait(int epfd,
+                    struct uv__epoll_event* events,
+                    int nevents,
+                    int timeout,
+                    uint64_t sigmask);
+int uv__eventfd2(unsigned int count, int flags);
+int uv__inotify_init(void);
+int uv__inotify_init1(int flags);
+int uv__inotify_add_watch(int fd, const char* path, uint32_t mask);
+int uv__inotify_rm_watch(int fd, int32_t wd);
+int uv__pipe2(int pipefd[2], int flags);
+int uv__recvmmsg(int fd,
+                 struct uv__mmsghdr* mmsg,
+                 unsigned int vlen,
+                 unsigned int flags,
+                 struct timespec* timeout);
+int uv__sendmmsg(int fd,
+                 struct uv__mmsghdr* mmsg,
+                 unsigned int vlen,
+                 unsigned int flags);
+int uv__utimesat(int dirfd,
+                 const char* path,
+                 const struct timespec times[2],
+                 int flags);
+ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, int64_t offset);
+ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset);
+int uv__dup3(int oldfd, int newfd, int flags);
+
+#endif /* UV_LINUX_SYSCALL_H_ */
diff --git a/deps/libtuv/src/unix/loop-watcher.c b/deps/libtuv/src/unix/loop-watcher.c
new file mode 100644 (file)
index 0000000..7b5bedb
--- /dev/null
@@ -0,0 +1,81 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#define UV_LOOP_WATCHER_DEFINE(name, type)                                    \
+  int uv_##name##_init(uv_loop_t* loop, uv_##name##_t* handle) {              \
+    uv__handle_init(loop, (uv_handle_t*)handle, UV_##type);                   \
+    handle->name##_cb = NULL;                                                 \
+    return 0;                                                                 \
+  }                                                                           \
+                                                                              \
+  int uv_##name##_start(uv_##name##_t* handle, uv_##name##_cb cb) {           \
+    if (uv__is_active(handle)) return 0;                                      \
+    if (cb == NULL) return -EINVAL;                                           \
+    QUEUE_INSERT_HEAD(&handle->loop->name##_handles, &handle->queue);         \
+    handle->name##_cb = cb;                                                   \
+    uv__handle_start(handle);                                                 \
+    return 0;                                                                 \
+  }                                                                           \
+                                                                              \
+  int uv_##name##_stop(uv_##name##_t* handle) {                               \
+    if (!uv__is_active(handle)) return 0;                                     \
+    QUEUE_REMOVE(&handle->queue);                                             \
+    uv__handle_stop(handle);                                                  \
+    return 0;                                                                 \
+  }                                                                           \
+                                                                              \
+  void uv__run_##name(uv_loop_t* loop) {                                      \
+    uv_##name##_t* h;                                                         \
+    QUEUE queue;                                                              \
+    QUEUE* q;                                                                 \
+    QUEUE_MOVE(&loop->name##_handles, &queue);                                \
+    while (!QUEUE_EMPTY(&queue)) {                                            \
+      q = QUEUE_HEAD(&queue);                                                 \
+      h = QUEUE_DATA(q, uv_##name##_t, queue);                                \
+      QUEUE_REMOVE(q);                                                        \
+      QUEUE_INSERT_TAIL(&loop->name##_handles, q);                            \
+      h->name##_cb(h);                                                        \
+    }                                                                         \
+  }                                                                           \
+                                                                              \
+  void uv__##name##_close(uv_##name##_t* handle) {                            \
+    uv_##name##_stop(handle);                                                 \
+  }
+
+UV_LOOP_WATCHER_DEFINE(idle, IDLE)
diff --git a/deps/libtuv/src/unix/loop.c b/deps/libtuv/src/unix/loop.c
new file mode 100644 (file)
index 0000000..39bce4f
--- /dev/null
@@ -0,0 +1,150 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "tree.h"
+#include "internal.h"
+#include "heap-inl.h"
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+int uv_loop_init(uv_loop_t* loop) {
+  void* saved_data;
+  int err;
+
+  saved_data = loop->data;
+  memset(loop, 0, sizeof(*loop));
+  loop->data = saved_data;
+
+  heap_init((struct heap*) &loop->timer_heap);
+  QUEUE_INIT(&loop->wq);
+  QUEUE_INIT(&loop->active_reqs);
+  QUEUE_INIT(&loop->idle_handles);
+  QUEUE_INIT(&loop->async_handles);
+  QUEUE_INIT(&loop->check_handles);
+  QUEUE_INIT(&loop->prepare_handles);
+  QUEUE_INIT(&loop->handle_queue);
+
+  loop->nfds = 0;
+  loop->watchers = NULL;
+  loop->nwatchers = 0;
+  QUEUE_INIT(&loop->pending_queue);
+  QUEUE_INIT(&loop->watcher_queue);
+
+  loop->closing_handles = NULL;
+  uv__update_time(loop);
+  uv__async_init(&loop->async_watcher);
+  loop->backend_fd = -1;
+  loop->emfile_fd = -1;
+
+  loop->timer_counter = 0;
+  loop->stop_flag = 0;
+
+  err = uv__platform_loop_init(loop);
+  if (err)
+    return err;
+
+  uv__handle_unref(&loop->child_watcher);
+  loop->child_watcher.flags |= UV__HANDLE_INTERNAL;
+  QUEUE_INIT(&loop->process_handles);
+
+  err = uv_rwlock_init(&loop->cloexec_lock);
+  if (err)
+    goto fail_rwlock_init;
+
+  err = uv_mutex_init(&loop->wq_mutex);
+  if (err)
+    goto fail_mutex_init;
+
+  err = uv_async_init(loop, &loop->wq_async, uv__work_done);
+  if (err)
+    goto fail_async_init;
+
+  uv__handle_unref(&loop->wq_async);
+  loop->wq_async.flags |= UV__HANDLE_INTERNAL;
+
+  return 0;
+
+fail_async_init:
+  uv_mutex_destroy(&loop->wq_mutex);
+
+fail_mutex_init:
+  uv_rwlock_destroy(&loop->cloexec_lock);
+
+fail_rwlock_init:
+  uv__platform_loop_delete(loop);
+
+  return err;
+}
+
+
+void uv__loop_close(uv_loop_t* loop) {
+  uv__platform_loop_delete(loop);
+  uv__async_stop(loop, &loop->async_watcher);
+
+  if (loop->emfile_fd != -1) {
+    uv__close(loop->emfile_fd);
+    loop->emfile_fd = -1;
+  }
+
+  if (loop->backend_fd != -1) {
+    uv__close(loop->backend_fd);
+    loop->backend_fd = -1;
+  }
+
+  uv_mutex_lock(&loop->wq_mutex);
+  assert(QUEUE_EMPTY(&loop->wq) && "thread pool work queue not empty!");
+  assert(!uv__has_active_reqs(loop));
+  uv_mutex_unlock(&loop->wq_mutex);
+  uv_mutex_destroy(&loop->wq_mutex);
+
+  /*
+   * Note that all thread pool stuff is finished at this point and
+   * it is safe to just destroy rw lock
+   */
+  uv_rwlock_destroy(&loop->cloexec_lock);
+
+#if 0
+  assert(QUEUE_EMPTY(&loop->pending_queue));
+  assert(QUEUE_EMPTY(&loop->watcher_queue));
+  assert(loop->nfds == 0);
+#endif
+
+  uv__free(loop->watchers);
+  loop->watchers = NULL;
+  loop->nwatchers = 0;
+}
diff --git a/deps/libtuv/src/unix/netbsd.c b/deps/libtuv/src/unix/netbsd.c
new file mode 100644 (file)
index 0000000..4a9e6cb
--- /dev/null
@@ -0,0 +1,380 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <assert.h>
+#include <string.h>
+#include <errno.h>
+
+#include <kvm.h>
+#include <paths.h>
+#include <ifaddrs.h>
+#include <unistd.h>
+#include <time.h>
+#include <stdlib.h>
+#include <fcntl.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <sys/resource.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <uvm/uvm_extern.h>
+
+#include <unistd.h>
+#include <time.h>
+
+#undef NANOSEC
+#define NANOSEC ((uint64_t) 1e9)
+
+static char *process_title;
+
+
+int uv__platform_loop_init(uv_loop_t* loop) {
+  return uv__kqueue_init(loop);
+}
+
+
+void uv__platform_loop_delete(uv_loop_t* loop) {
+}
+
+
+uint64_t uv__hrtime(uv_clocktype_t type) {
+  struct timespec ts;
+  clock_gettime(CLOCK_MONOTONIC, &ts);
+  return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
+}
+
+
+void uv_loadavg(double avg[3]) {
+  struct loadavg info;
+  size_t size = sizeof(info);
+  int which[] = {CTL_VM, VM_LOADAVG};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) == -1) return;
+
+  avg[0] = (double) info.ldavg[0] / info.fscale;
+  avg[1] = (double) info.ldavg[1] / info.fscale;
+  avg[2] = (double) info.ldavg[2] / info.fscale;
+}
+
+
+int uv_exepath(char* buffer, size_t* size) {
+  int mib[4];
+  size_t cb;
+  pid_t mypid;
+
+  if (buffer == NULL || size == NULL || *size == 0)
+    return -EINVAL;
+
+  mypid = getpid();
+  mib[0] = CTL_KERN;
+  mib[1] = KERN_PROC_ARGS;
+  mib[2] = mypid;
+  mib[3] = KERN_PROC_ARGV;
+
+  cb = *size;
+  if (sysctl(mib, 4, buffer, &cb, NULL, 0))
+    return -errno;
+  *size = strlen(buffer);
+
+  return 0;
+}
+
+
+uint64_t uv_get_free_memory(void) {
+  struct uvmexp info;
+  size_t size = sizeof(info);
+  int which[] = {CTL_VM, VM_UVMEXP};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0))
+    return -errno;
+
+  return (uint64_t) info.free * sysconf(_SC_PAGESIZE);
+}
+
+
+uint64_t uv_get_total_memory(void) {
+#if defined(HW_PHYSMEM64)
+  uint64_t info;
+  int which[] = {CTL_HW, HW_PHYSMEM64};
+#else
+  unsigned int info;
+  int which[] = {CTL_HW, HW_PHYSMEM};
+#endif
+  size_t size = sizeof(info);
+
+  if (sysctl(which, 2, &info, &size, NULL, 0))
+    return -errno;
+
+  return (uint64_t) info;
+}
+
+
+char** uv_setup_args(int argc, char** argv) {
+  process_title = argc ? uv__strdup(argv[0]) : NULL;
+  return argv;
+}
+
+
+int uv_set_process_title(const char* title) {
+  if (process_title) uv__free(process_title);
+
+  process_title = uv__strdup(title);
+  setproctitle("%s", title);
+
+  return 0;
+}
+
+
+int uv_get_process_title(char* buffer, size_t size) {
+  size_t len;
+
+  if (buffer == NULL || size == 0)
+    return -EINVAL;
+
+  if (process_title) {
+    len = strlen(process_title) + 1;
+
+    if (size < len)
+      return -ENOBUFS;
+
+    memcpy(buffer, process_title, len);
+  } else {
+    len = 0;
+  }
+
+  buffer[len] = '\0';
+
+  return 0;
+}
+
+
+int uv_resident_set_memory(size_t* rss) {
+  kvm_t *kd = NULL;
+  struct kinfo_proc2 *kinfo = NULL;
+  pid_t pid;
+  int nprocs;
+  int max_size = sizeof(struct kinfo_proc2);
+  int page_size;
+
+  page_size = getpagesize();
+  pid = getpid();
+
+  kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open");
+
+  if (kd == NULL) goto error;
+
+  kinfo = kvm_getproc2(kd, KERN_PROC_PID, pid, max_size, &nprocs);
+  if (kinfo == NULL) goto error;
+
+  *rss = kinfo->p_vm_rssize * page_size;
+
+  kvm_close(kd);
+
+  return 0;
+
+error:
+  if (kd) kvm_close(kd);
+  return -EPERM;
+}
+
+
+int uv_uptime(double* uptime) {
+  time_t now;
+  struct timeval info;
+  size_t size = sizeof(info);
+  static int which[] = {CTL_KERN, KERN_BOOTTIME};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0))
+    return -errno;
+
+  now = time(NULL);
+
+  *uptime = (double)(now - info.tv_sec);
+  return 0;
+}
+
+
+int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
+  unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK);
+  unsigned int multiplier = ((uint64_t)1000L / ticks);
+  unsigned int cur = 0;
+  uv_cpu_info_t* cpu_info;
+  u_int64_t* cp_times;
+  char model[512];
+  u_int64_t cpuspeed;
+  int numcpus;
+  size_t size;
+  int i;
+
+  size = sizeof(model);
+  if (sysctlbyname("machdep.cpu_brand", &model, &size, NULL, 0) &&
+      sysctlbyname("hw.model", &model, &size, NULL, 0)) {
+    return -errno;
+  }
+
+  size = sizeof(numcpus);
+  if (sysctlbyname("hw.ncpu", &numcpus, &size, NULL, 0))
+    return -errno;
+  *count = numcpus;
+
+  /* Only i386 and amd64 have machdep.tsc_freq */
+  size = sizeof(cpuspeed);
+  if (sysctlbyname("machdep.tsc_freq", &cpuspeed, &size, NULL, 0))
+    cpuspeed = 0;
+
+  size = numcpus * CPUSTATES * sizeof(*cp_times);
+  cp_times = uv__malloc(size);
+  if (cp_times == NULL)
+    return -ENOMEM;
+
+  if (sysctlbyname("kern.cp_time", cp_times, &size, NULL, 0))
+    return -errno;
+
+  *cpu_infos = uv__malloc(numcpus * sizeof(**cpu_infos));
+  if (!(*cpu_infos)) {
+    uv__free(cp_times);
+    uv__free(*cpu_infos);
+    return -ENOMEM;
+  }
+
+  for (i = 0; i < numcpus; i++) {
+    cpu_info = &(*cpu_infos)[i];
+    cpu_info->cpu_times.user = (uint64_t)(cp_times[CP_USER+cur]) * multiplier;
+    cpu_info->cpu_times.nice = (uint64_t)(cp_times[CP_NICE+cur]) * multiplier;
+    cpu_info->cpu_times.sys = (uint64_t)(cp_times[CP_SYS+cur]) * multiplier;
+    cpu_info->cpu_times.idle = (uint64_t)(cp_times[CP_IDLE+cur]) * multiplier;
+    cpu_info->cpu_times.irq = (uint64_t)(cp_times[CP_INTR+cur]) * multiplier;
+    cpu_info->model = uv__strdup(model);
+    cpu_info->speed = (int)(cpuspeed/(uint64_t) 1e6);
+    cur += CPUSTATES;
+  }
+  uv__free(cp_times);
+  return 0;
+}
+
+
+void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
+  int i;
+
+  for (i = 0; i < count; i++) {
+    uv__free(cpu_infos[i].model);
+  }
+
+  uv__free(cpu_infos);
+}
+
+
+int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
+  struct ifaddrs *addrs, *ent;
+  uv_interface_address_t* address;
+  int i;
+  struct sockaddr_dl *sa_addr;
+
+  if (getifaddrs(&addrs))
+    return -errno;
+
+  *count = 0;
+
+  /* Count the number of interfaces */
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
+        (ent->ifa_addr == NULL) ||
+        (ent->ifa_addr->sa_family != PF_INET)) {
+      continue;
+    }
+    (*count)++;
+  }
+
+  *addresses = uv__malloc(*count * sizeof(**addresses));
+
+  if (!(*addresses)) {
+    freeifaddrs(addrs);
+    return -ENOMEM;
+  }
+
+  address = *addresses;
+
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
+      continue;
+
+    if (ent->ifa_addr == NULL)
+      continue;
+
+    if (ent->ifa_addr->sa_family != PF_INET)
+      continue;
+
+    address->name = uv__strdup(ent->ifa_name);
+
+    if (ent->ifa_addr->sa_family == AF_INET6) {
+      address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
+    } else {
+      address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
+    }
+
+    if (ent->ifa_netmask->sa_family == AF_INET6) {
+      address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
+    } else {
+      address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
+    }
+
+    address->is_internal = !!(ent->ifa_flags & IFF_LOOPBACK);
+
+    address++;
+  }
+
+  /* Fill in physical addresses for each interface */
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
+        (ent->ifa_addr == NULL) ||
+        (ent->ifa_addr->sa_family != AF_LINK)) {
+      continue;
+    }
+
+    address = *addresses;
+
+    for (i = 0; i < (*count); i++) {
+      if (strcmp(address->name, ent->ifa_name) == 0) {
+        sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
+        memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
+      }
+      address++;
+    }
+  }
+
+  freeifaddrs(addrs);
+
+  return 0;
+}
+
+
+void uv_free_interface_addresses(uv_interface_address_t* addresses, int count) {
+  int i;
+
+  for (i = 0; i < count; i++) {
+    uv__free(addresses[i].name);
+  }
+
+  uv__free(addresses);
+}
diff --git a/deps/libtuv/src/unix/nuttx.c b/deps/libtuv/src/unix/nuttx.c
new file mode 100644 (file)
index 0000000..46e0bae
--- /dev/null
@@ -0,0 +1,277 @@
+/* Copyright 2015-present 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <string.h>
+
+#include <uv.h>
+#include "unix/internal.h"
+
+//-----------------------------------------------------------------------------
+// loop
+int uv__platform_loop_init(uv_loop_t* loop) {
+  loop->npollfds = 0;
+  return 0;
+}
+
+void uv__platform_loop_delete(uv_loop_t* loop) {
+  loop->npollfds = 0;
+}
+
+
+//-----------------------------------------------------------------------------
+
+void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
+  int i;
+  int nfd = loop->npollfds;
+  for (i = 0; i < nfd; ++i) {
+    struct pollfd* pfd = &loop->pollfds[i];
+    if (fd == pfd->fd) {
+      pfd->fd = -1;
+    }
+  }
+}
+
+//-----------------------------------------------------------------------------
+
+/* should not clear handle structure with memset as
+ * *data can be set before calling init function */
+
+//-----------------------------------------------------------------------------
+
+int getpeername(int sockfd, struct sockaddr* addr, socklen_t* addrlen) {
+  return 0;
+}
+
+ssize_t readv(int fd, const struct iovec* iiovec, int count) {
+  ssize_t result = 0;
+  ssize_t total = 0;
+  int idx;
+
+  for (idx = 0; idx < count; ++idx) {
+    result = read(fd, iiovec[idx].iov_base, iiovec[idx].iov_len);
+    if (result < 0) {
+      return result;
+    } else {
+      total += result;
+    }
+  }
+  return total;
+}
+
+
+ssize_t writev(int fd, const struct iovec* iiovec, int count) {
+  ssize_t result = 0;
+  ssize_t total = 0;
+  int idx;
+
+  for (idx = 0; idx < count; ++idx) {
+    result = write(fd, iiovec[idx].iov_base, iiovec[idx].iov_len);
+    if (result < 0) {
+      return result;
+    } else {
+      total += result;
+    }
+  }
+  return total;
+}
+
+// From nuttx_clock.c
+uint64_t uv__hrtime(uv_clocktype_t type) {
+  struct timespec ts;
+  clock_gettime(CLOCK_MONOTONIC, &ts);
+  uint64_t ret = (((uint64_t) ts.tv_sec) * ((uint64_t) 1e9) +
+                   (uint64_t) ts.tv_nsec);
+  return ret;
+}
+
+// From nuttx_io.c
+static void uv__add_pollfd(uv_loop_t* loop, struct pollfd* pe) {
+  int i;
+  bool exist = false;
+  int free_idx = -1;
+  for (i = 0; i < loop->npollfds; ++i) {
+    struct pollfd* cur = &loop->pollfds[i];
+    if (cur->fd == pe->fd) {
+      cur->events = pe->events;
+      exist = true;
+      break;
+    }
+    if (cur->fd == -1) {
+      free_idx = i;
+    }
+  }
+  if (!exist) {
+    if (free_idx == -1) {
+      free_idx = loop->npollfds++;
+      if (free_idx >= TUV_POLL_EVENTS_SIZE)
+      {
+        TDLOG("uv__add_pollfd abort, because loop->npollfds (%d) reached maximum size", free_idx);
+        ABORT();
+      }
+    }
+    struct pollfd* cur = &loop->pollfds[free_idx];
+
+    cur->fd = pe->fd;
+    cur->events = pe->events;
+    cur->revents = 0;
+    cur->sem = 0;
+    cur->priv = 0;
+  }
+}
+
+
+static void uv__rem_pollfd(uv_loop_t* loop, struct pollfd* pe) {
+  int i = 0;
+  while (i < loop->npollfds) {
+    struct pollfd* cur = &loop->pollfds[i];
+    if (cur->fd == pe->fd) {
+      *cur = loop->pollfds[--loop->npollfds];
+    } else {
+      ++i;
+    }
+  }
+}
+
+
+void uv__io_poll(uv_loop_t* loop, int timeout) {
+  struct pollfd pfd;
+  struct pollfd* pe;
+  QUEUE* q;
+  uv__io_t* w;
+  uint64_t base;
+  uint64_t diff;
+  int nevents;
+  int count;
+  int nfd;
+  int i;
+
+  if (loop->nfds == 0) {
+    assert(QUEUE_EMPTY(&loop->watcher_queue));
+    return;
+  }
+
+  while (!QUEUE_EMPTY(&loop->watcher_queue)) {
+    q = QUEUE_HEAD(&loop->watcher_queue);
+    QUEUE_REMOVE(q);
+    QUEUE_INIT(q);
+
+    w = QUEUE_DATA(q, uv__io_t, watcher_queue);
+    assert(w->pevents != 0);
+    assert(w->fd >= 0);
+    assert(w->fd < (int)loop->nwatchers);
+
+    pfd.fd = w->fd;
+    pfd.events = w->pevents;
+    uv__add_pollfd(loop, &pfd);
+
+    w->events = w->pevents;
+  }
+
+  assert(timeout >= -1);
+  base = loop->time;
+  count = 5;
+
+  for (;;) {
+    nfd = poll(loop->pollfds, loop->npollfds, timeout);
+
+    SAVE_ERRNO(uv__update_time(loop));
+
+    if (nfd == 0) {
+      assert(timeout != -1);
+      return;
+    }
+
+    if (nfd == -1) {
+      int err = get_errno();
+      if (err == EAGAIN ) {
+        set_errno(0);
+      }
+      else if ( err != EINTR) {
+        TDLOG("uv__io_poll abort for errno(%d)", err);
+        ABORT();
+      }
+      if (timeout == -1) {
+        continue;
+      }
+      if (timeout == 0) {
+        return;
+      }
+      goto update_timeout;
+    }
+
+    nevents = 0;
+
+    for (i = 0; i < loop->npollfds; ++i) {
+      pe = &loop->pollfds[i];
+
+      if (pe->fd >= 0) {
+        if (pe->revents & (POLLIN | POLLOUT | POLLHUP)) {
+          w = loop->watchers[pe->fd];
+          if (w == NULL) {
+            uv__rem_pollfd(loop, pe);
+          } else {
+            w->cb(loop, w, pe->revents);
+            ++nevents;
+          }
+        }
+      }
+    }
+
+    if (nevents != 0) {
+      if (--count != 0) {
+        timeout = 0;
+        continue;
+      }
+      return;
+    }
+    if (timeout == 0) {
+      return;
+    }
+    if (timeout == -1) {
+      continue;
+    }
+update_timeout:
+    assert(timeout > 0);
+
+    diff = loop->time - base;
+    if (diff >= (uint64_t)timeout) {
+      return;
+    }
+    timeout -= diff;
+  }
+}
+
diff --git a/deps/libtuv/src/unix/openbsd.c b/deps/libtuv/src/unix/openbsd.c
new file mode 100644 (file)
index 0000000..909288c
--- /dev/null
@@ -0,0 +1,396 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/resource.h>
+#include <sys/sched.h>
+#include <sys/time.h>
+#include <sys/sysctl.h>
+
+#include <ifaddrs.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <kvm.h>
+#include <paths.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#undef NANOSEC
+#define NANOSEC ((uint64_t) 1e9)
+
+
+static char *process_title;
+
+
+int uv__platform_loop_init(uv_loop_t* loop) {
+  return uv__kqueue_init(loop);
+}
+
+
+void uv__platform_loop_delete(uv_loop_t* loop) {
+}
+
+
+uint64_t uv__hrtime(uv_clocktype_t type) {
+  struct timespec ts;
+  clock_gettime(CLOCK_MONOTONIC, &ts);
+  return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
+}
+
+
+void uv_loadavg(double avg[3]) {
+  struct loadavg info;
+  size_t size = sizeof(info);
+  int which[] = {CTL_VM, VM_LOADAVG};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0) < 0) return;
+
+  avg[0] = (double) info.ldavg[0] / info.fscale;
+  avg[1] = (double) info.ldavg[1] / info.fscale;
+  avg[2] = (double) info.ldavg[2] / info.fscale;
+}
+
+
+int uv_exepath(char* buffer, size_t* size) {
+  int mib[4];
+  char **argsbuf = NULL;
+  char **argsbuf_tmp;
+  size_t argsbuf_size = 100U;
+  size_t exepath_size;
+  pid_t mypid;
+  int err;
+
+  if (buffer == NULL || size == NULL || *size == 0)
+    return -EINVAL;
+
+  mypid = getpid();
+  for (;;) {
+    err = -ENOMEM;
+    argsbuf_tmp = uv__realloc(argsbuf, argsbuf_size);
+    if (argsbuf_tmp == NULL)
+      goto out;
+    argsbuf = argsbuf_tmp;
+    mib[0] = CTL_KERN;
+    mib[1] = KERN_PROC_ARGS;
+    mib[2] = mypid;
+    mib[3] = KERN_PROC_ARGV;
+    if (sysctl(mib, 4, argsbuf, &argsbuf_size, NULL, 0) == 0) {
+      break;
+    }
+    if (errno != ENOMEM) {
+      err = -errno;
+      goto out;
+    }
+    argsbuf_size *= 2U;
+  }
+
+  if (argsbuf[0] == NULL) {
+    err = -EINVAL;  /* FIXME(bnoordhuis) More appropriate error. */
+    goto out;
+  }
+
+  *size -= 1;
+  exepath_size = strlen(argsbuf[0]);
+  if (*size > exepath_size)
+    *size = exepath_size;
+
+  memcpy(buffer, argsbuf[0], *size);
+  buffer[*size] = '\0';
+  err = 0;
+
+out:
+  uv__free(argsbuf);
+
+  return err;
+}
+
+
+uint64_t uv_get_free_memory(void) {
+  struct uvmexp info;
+  size_t size = sizeof(info);
+  int which[] = {CTL_VM, VM_UVMEXP};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0))
+    return -errno;
+
+  return (uint64_t) info.free * sysconf(_SC_PAGESIZE);
+}
+
+
+uint64_t uv_get_total_memory(void) {
+  uint64_t info;
+  int which[] = {CTL_HW, HW_PHYSMEM64};
+  size_t size = sizeof(info);
+
+  if (sysctl(which, 2, &info, &size, NULL, 0))
+    return -errno;
+
+  return (uint64_t) info;
+}
+
+
+char** uv_setup_args(int argc, char** argv) {
+  process_title = argc ? uv__strdup(argv[0]) : NULL;
+  return argv;
+}
+
+
+int uv_set_process_title(const char* title) {
+  uv__free(process_title);
+  process_title = uv__strdup(title);
+  setproctitle(title);
+  return 0;
+}
+
+
+int uv_get_process_title(char* buffer, size_t size) {
+  size_t len;
+
+  if (buffer == NULL || size == 0)
+    return -EINVAL;
+
+  if (process_title) {
+    len = strlen(process_title) + 1;
+
+    if (size < len)
+      return -ENOBUFS;
+
+    memcpy(buffer, process_title, len);
+  } else {
+    len = 0;
+  }
+
+  buffer[len] = '\0';
+
+  return 0;
+}
+
+
+int uv_resident_set_memory(size_t* rss) {
+  struct kinfo_proc kinfo;
+  size_t page_size = getpagesize();
+  size_t size = sizeof(struct kinfo_proc);
+  int mib[6];
+
+  mib[0] = CTL_KERN;
+  mib[1] = KERN_PROC;
+  mib[2] = KERN_PROC_PID;
+  mib[3] = getpid();
+  mib[4] = sizeof(struct kinfo_proc);
+  mib[5] = 1;
+
+  if (sysctl(mib, 6, &kinfo, &size, NULL, 0) < 0)
+    return -errno;
+
+  *rss = kinfo.p_vm_rssize * page_size;
+  return 0;
+}
+
+
+int uv_uptime(double* uptime) {
+  time_t now;
+  struct timeval info;
+  size_t size = sizeof(info);
+  static int which[] = {CTL_KERN, KERN_BOOTTIME};
+
+  if (sysctl(which, 2, &info, &size, NULL, 0))
+    return -errno;
+
+  now = time(NULL);
+
+  *uptime = (double)(now - info.tv_sec);
+  return 0;
+}
+
+
+int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
+  unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
+               multiplier = ((uint64_t)1000L / ticks), cpuspeed;
+  uint64_t info[CPUSTATES];
+  char model[512];
+  int numcpus = 1;
+  int which[] = {CTL_HW,HW_MODEL,0};
+  size_t size;
+  int i;
+  uv_cpu_info_t* cpu_info;
+
+  size = sizeof(model);
+  if (sysctl(which, 2, &model, &size, NULL, 0))
+    return -errno;
+
+  which[1] = HW_NCPU;
+  size = sizeof(numcpus);
+  if (sysctl(which, 2, &numcpus, &size, NULL, 0))
+    return -errno;
+
+  *cpu_infos = uv__malloc(numcpus * sizeof(**cpu_infos));
+  if (!(*cpu_infos))
+    return -ENOMEM;
+
+  *count = numcpus;
+
+  which[1] = HW_CPUSPEED;
+  size = sizeof(cpuspeed);
+  if (sysctl(which, 2, &cpuspeed, &size, NULL, 0)) {
+    uv__free(*cpu_infos);
+    return -errno;
+  }
+
+  size = sizeof(info);
+  which[0] = CTL_KERN;
+  which[1] = KERN_CPTIME2;
+  for (i = 0; i < numcpus; i++) {
+    which[2] = i;
+    size = sizeof(info);
+    if (sysctl(which, 3, &info, &size, NULL, 0)) {
+      uv__free(*cpu_infos);
+      return -errno;
+    }
+
+    cpu_info = &(*cpu_infos)[i];
+
+    cpu_info->cpu_times.user = (uint64_t)(info[CP_USER]) * multiplier;
+    cpu_info->cpu_times.nice = (uint64_t)(info[CP_NICE]) * multiplier;
+    cpu_info->cpu_times.sys = (uint64_t)(info[CP_SYS]) * multiplier;
+    cpu_info->cpu_times.idle = (uint64_t)(info[CP_IDLE]) * multiplier;
+    cpu_info->cpu_times.irq = (uint64_t)(info[CP_INTR]) * multiplier;
+
+    cpu_info->model = uv__strdup(model);
+    cpu_info->speed = cpuspeed;
+  }
+
+  return 0;
+}
+
+
+void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
+  int i;
+
+  for (i = 0; i < count; i++) {
+    uv__free(cpu_infos[i].model);
+  }
+
+  uv__free(cpu_infos);
+}
+
+
+int uv_interface_addresses(uv_interface_address_t** addresses,
+  int* count) {
+  struct ifaddrs *addrs, *ent;
+  uv_interface_address_t* address;
+  int i;
+  struct sockaddr_dl *sa_addr;
+
+  if (getifaddrs(&addrs) != 0)
+    return -errno;
+
+   *count = 0;
+
+  /* Count the number of interfaces */
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
+        (ent->ifa_addr == NULL) ||
+        (ent->ifa_addr->sa_family != PF_INET)) {
+      continue;
+    }
+    (*count)++;
+  }
+
+  *addresses = uv__malloc(*count * sizeof(**addresses));
+
+  if (!(*addresses)) {
+    freeifaddrs(addrs);
+    return -ENOMEM;
+  }
+
+  address = *addresses;
+
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
+      continue;
+
+    if (ent->ifa_addr == NULL)
+      continue;
+
+    if (ent->ifa_addr->sa_family != PF_INET)
+      continue;
+
+    address->name = uv__strdup(ent->ifa_name);
+
+    if (ent->ifa_addr->sa_family == AF_INET6) {
+      address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
+    } else {
+      address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
+    }
+
+    if (ent->ifa_netmask->sa_family == AF_INET6) {
+      address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
+    } else {
+      address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
+    }
+
+    address->is_internal = !!(ent->ifa_flags & IFF_LOOPBACK);
+
+    address++;
+  }
+
+  /* Fill in physical addresses for each interface */
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
+        (ent->ifa_addr == NULL) ||
+        (ent->ifa_addr->sa_family != AF_LINK)) {
+      continue;
+    }
+
+    address = *addresses;
+
+    for (i = 0; i < (*count); i++) {
+      if (strcmp(address->name, ent->ifa_name) == 0) {
+        sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
+        memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
+      }
+      address++;
+    }
+  }
+
+  freeifaddrs(addrs);
+
+  return 0;
+}
+
+
+void uv_free_interface_addresses(uv_interface_address_t* addresses,
+  int count) {
+  int i;
+
+  for (i = 0; i < count; i++) {
+    uv__free(addresses[i].name);
+  }
+
+  uv__free(addresses);
+}
diff --git a/deps/libtuv/src/unix/os390.c b/deps/libtuv/src/unix/os390.c
new file mode 100644 (file)
index 0000000..bcdbc4b
--- /dev/null
@@ -0,0 +1,42 @@
+/* Copyright libuv project contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "internal.h"
+
+int uv__io_check_fd(uv_loop_t* loop, int fd) {
+  struct pollfd p[1];
+  int rv;
+
+  p[0].fd = fd;
+  p[0].events = POLLIN;
+
+  do
+    rv = poll(p, 1, 0);
+  while (rv == -1 && errno == EINTR);
+
+  if (rv == -1)
+    abort();
+
+  if (p[0].revents & POLLNVAL)
+    return -1;
+
+  return 0;
+}
diff --git a/deps/libtuv/src/unix/pipe.c b/deps/libtuv/src/unix/pipe.c
new file mode 100644 (file)
index 0000000..b73994c
--- /dev/null
@@ -0,0 +1,298 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+
+int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) {
+  uv__stream_init(loop, (uv_stream_t*)handle, UV_NAMED_PIPE);
+  handle->shutdown_req = NULL;
+  handle->connect_req = NULL;
+  handle->pipe_fname = NULL;
+  handle->ipc = ipc;
+  return 0;
+}
+
+
+int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
+  struct sockaddr_un saddr;
+  const char* pipe_fname;
+  int sockfd;
+  int err;
+
+  pipe_fname = NULL;
+  sockfd = -1;
+
+  /* Already bound? */
+  if (uv__stream_fd(handle) >= 0)
+    return -EINVAL;
+
+  /* Make a copy of the file name, it outlives this function's scope. */
+  pipe_fname = uv__strdup(name);
+  if (pipe_fname == NULL)
+    return -ENOMEM;
+
+  /* We've got a copy, don't touch the original any more. */
+  name = NULL;
+
+  err = uv__socket(AF_UNIX, SOCK_STREAM, 0);
+  if (err < 0)
+    goto err_socket;
+  sockfd = err;
+
+  memset(&saddr, 0, sizeof saddr);
+  strncpy(saddr.sun_path, pipe_fname, sizeof(saddr.sun_path) - 1);
+  saddr.sun_path[sizeof(saddr.sun_path) - 1] = '\0';
+  saddr.sun_family = AF_UNIX;
+
+  if (bind(sockfd, (struct sockaddr*)&saddr, sizeof saddr)) {
+    err = -errno;
+    /* Convert ENOENT to EACCES for compatibility with Windows. */
+    if (err == -ENOENT)
+      err = -EACCES;
+    goto err_bind;
+  }
+
+  /* Success. */
+  handle->flags |= UV_HANDLE_BOUND;
+  handle->pipe_fname = pipe_fname; /* Is a strdup'ed copy. */
+  handle->io_watcher.fd = sockfd;
+  return 0;
+
+err_bind:
+  uv__close(sockfd);
+
+err_socket:
+  uv__free((void*)pipe_fname);
+  return err;
+}
+
+
+int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb) {
+  if (uv__stream_fd(handle) == -1)
+    return -EINVAL;
+
+#if defined(__MVS__)
+  /* On zOS, backlog=0 has undefined behaviour */
+  if (backlog == 0)
+    backlog = 1;
+  else if (backlog < 0)
+    backlog = SOMAXCONN;
+#endif
+
+  if (listen(uv__stream_fd(handle), backlog))
+    return -errno;
+
+  handle->connection_cb = cb;
+  handle->io_watcher.cb = uv__server_io;
+  uv__io_start(handle->loop, &handle->io_watcher, POLLIN);
+  return 0;
+}
+
+
+void uv__pipe_close(uv_pipe_t* handle) {
+  if (handle->pipe_fname) {
+    /*
+     * Unlink the file system entity before closing the file descriptor.
+     * Doing it the other way around introduces a race where our process
+     * unlinks a socket with the same name that's just been created by
+     * another thread or process.
+     */
+    unlink(handle->pipe_fname);
+    uv__free((void*)handle->pipe_fname);
+    handle->pipe_fname = NULL;
+  }
+
+  uv__stream_close((uv_stream_t*)handle);
+}
+
+
+int uv_pipe_open(uv_pipe_t* handle, uv_file fd) {
+  int err;
+
+  err = uv__nonblock(fd, 1);
+  if (err)
+    return err;
+
+#if defined(__APPLE__)
+  err = uv__stream_try_select((uv_stream_t*) handle, &fd);
+  if (err)
+    return err;
+#endif /* defined(__APPLE__) */
+
+  return uv__stream_open((uv_stream_t*)handle,
+                         fd,
+                         UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+}
+
+
+void uv_pipe_connect(uv_connect_t* req,
+                    uv_pipe_t* handle,
+                    const char* name,
+                    uv_connect_cb cb) {
+  struct sockaddr_un saddr;
+  int new_sock;
+  int err;
+  int r;
+
+  new_sock = (uv__stream_fd(handle) == -1);
+
+  if (new_sock) {
+    err = uv__socket(AF_UNIX, SOCK_STREAM, 0);
+    if (err < 0)
+      goto out;
+    handle->io_watcher.fd = err;
+  }
+
+  memset(&saddr, 0, sizeof saddr);
+  strncpy(saddr.sun_path, name, sizeof(saddr.sun_path) - 1);
+  saddr.sun_path[sizeof(saddr.sun_path) - 1] = '\0';
+  saddr.sun_family = AF_UNIX;
+
+  do {
+    r = connect(uv__stream_fd(handle),
+                (struct sockaddr*)&saddr, sizeof saddr);
+  }
+  while (r == -1 && errno == EINTR);
+
+  if (r == -1 && errno != EINPROGRESS) {
+    err = -errno;
+    goto out;
+  }
+
+  err = 0;
+  if (new_sock) {
+    err = uv__stream_open((uv_stream_t*)handle,
+                          uv__stream_fd(handle),
+                          UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+  }
+
+  if (err == 0)
+    uv__io_start(handle->loop, &handle->io_watcher, POLLIN | POLLOUT);
+
+out:
+  handle->delayed_error = err;
+  handle->connect_req = req;
+
+  uv__req_init(handle->loop, req, UV_CONNECT);
+  req->handle = (uv_stream_t*)handle;
+  req->cb = cb;
+  QUEUE_INIT(&req->queue);
+
+  /* Force callback to run on next tick in case of error. */
+  if (err)
+    uv__io_feed(handle->loop, &handle->io_watcher);
+
+}
+
+
+typedef int (*uv__peersockfunc)(int, struct sockaddr*, socklen_t*);
+
+
+static int uv__pipe_getsockpeername(const uv_pipe_t* handle,
+                                    uv__peersockfunc func,
+                                    char* buffer,
+                                    size_t* size) {
+  struct sockaddr_un sa;
+  socklen_t addrlen;
+  int err;
+
+  addrlen = sizeof(sa);
+  memset(&sa, 0, addrlen);
+  err = func(uv__stream_fd(handle), (struct sockaddr*) &sa, &addrlen);
+  if (err < 0) {
+    *size = 0;
+    return -errno;
+  }
+
+#if defined(__linux__)
+  if (sa.sun_path[0] == 0)
+    /* Linux abstract namespace */
+    addrlen -= offsetof(struct sockaddr_un, sun_path);
+  else
+#endif
+    addrlen = strlen(sa.sun_path);
+
+
+  if (addrlen >= *size) {
+    *size = addrlen + 1;
+    return UV_ENOBUFS;
+  }
+
+  memcpy(buffer, sa.sun_path, addrlen);
+  *size = addrlen;
+
+  /* only null-terminate if it's not an abstract socket */
+  if (buffer[0] != '\0')
+    buffer[addrlen] = '\0';
+
+  return 0;
+}
+
+
+int uv_pipe_getsockname(const uv_pipe_t* handle, char* buffer, size_t* size) {
+  return uv__pipe_getsockpeername(handle, getsockname, buffer, size);
+}
+
+
+int uv_pipe_getpeername(const uv_pipe_t* handle, char* buffer, size_t* size) {
+  return uv__pipe_getsockpeername(handle, getpeername, buffer, size);
+}
+
+
+void uv_pipe_pending_instances(uv_pipe_t* handle, int count) {
+}
+
+
+int uv_pipe_pending_count(uv_pipe_t* handle) {
+  uv__stream_queued_fds_t* queued_fds;
+
+  if (!handle->ipc)
+    return 0;
+
+  if (handle->accepted_fd == -1)
+    return 0;
+
+  if (handle->queued_fds == NULL)
+    return 1;
+
+  queued_fds = handle->queued_fds;
+  return queued_fds->offset + 1;
+}
+
+
+uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle) {
+  if (!handle->ipc)
+    return UV_UNKNOWN_HANDLE;
+
+  if (handle->accepted_fd == -1)
+    return UV_UNKNOWN_HANDLE;
+  else
+    return uv__handle_type(handle->accepted_fd);
+}
diff --git a/deps/libtuv/src/unix/poll.c b/deps/libtuv/src/unix/poll.c
new file mode 100644 (file)
index 0000000..7b8e008
--- /dev/null
@@ -0,0 +1,149 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <unistd.h>
+#include <assert.h>
+#include <errno.h>
+
+
+static void uv__poll_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
+  uv_poll_t* handle;
+  int pevents;
+
+  handle = container_of(w, uv_poll_t, io_watcher);
+
+  if (events & POLLERR) {
+    uv__io_stop(loop, w, POLLIN | POLLOUT | UV__POLLRDHUP);
+    uv__handle_stop(handle);
+    handle->poll_cb(handle, -EBADF, 0);
+    return;
+  }
+
+  pevents = 0;
+  if (events & POLLIN)
+    pevents |= UV_READABLE;
+  if (events & POLLOUT)
+    pevents |= UV_WRITABLE;
+  if (events & UV__POLLRDHUP)
+    pevents |= UV_DISCONNECT;
+
+  handle->poll_cb(handle, 0, pevents);
+}
+
+
+int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) {
+  int err;
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  err = uv__io_check_fd(loop, fd);
+  if (err)
+    return err;
+#endif
+
+  /* If ioctl(FIONBIO) reports ENOTTY, try fcntl(F_GETFL) + fcntl(F_SETFL).
+   * Workaround for e.g. kqueue fds not supporting ioctls.
+   */
+  err = uv__nonblock(fd, 1);
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  if (err == -ENOTTY)
+    if (uv__nonblock == uv__nonblock_ioctl)
+      err = uv__nonblock_fcntl(fd, 1);
+#endif
+
+  if (err)
+    return err;
+
+  uv__handle_init(loop, (uv_handle_t*) handle, UV_POLL);
+  uv__io_init(&handle->io_watcher, uv__poll_io, fd);
+  handle->poll_cb = NULL;
+  return 0;
+}
+
+
+int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
+    uv_os_sock_t socket) {
+  return uv_poll_init(loop, handle, socket);
+}
+
+
+static void uv__poll_stop(uv_poll_t* handle) {
+  uv__io_stop(handle->loop,
+              &handle->io_watcher,
+              POLLIN | POLLOUT | UV__POLLRDHUP);
+  uv__handle_stop(handle);
+}
+
+
+int uv_poll_stop(uv_poll_t* handle) {
+  assert(!uv__is_closing(handle));
+  uv__poll_stop(handle);
+  return 0;
+}
+
+
+int uv_poll_start(uv_poll_t* handle, int pevents, uv_poll_cb poll_cb) {
+  int events;
+
+  assert((pevents & ~(UV_READABLE | UV_WRITABLE | UV_DISCONNECT)) == 0);
+  assert(!uv__is_closing(handle));
+
+  uv__poll_stop(handle);
+
+  if (pevents == 0)
+    return 0;
+
+  events = 0;
+  if (pevents & UV_READABLE)
+    events |= POLLIN;
+  if (pevents & UV_WRITABLE)
+    events |= POLLOUT;
+  if (pevents & UV_DISCONNECT)
+    events |= UV__POLLRDHUP;
+
+  uv__io_start(handle->loop, &handle->io_watcher, events);
+  uv__handle_start(handle);
+  handle->poll_cb = poll_cb;
+
+  return 0;
+}
+
+
+void uv__poll_close(uv_poll_t* handle) {
+  uv__poll_stop(handle);
+}
diff --git a/deps/libtuv/src/unix/process.c b/deps/libtuv/src/unix/process.c
new file mode 100644 (file)
index 0000000..a528054
--- /dev/null
@@ -0,0 +1,90 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <poll.h>
+
+#if defined(__APPLE__) && !TARGET_OS_IPHONE
+# include <crt_externs.h>
+#endif
+
+#if defined(__linux__) || defined(__GLIBC__)
+# include <grp.h>
+#endif
+
+
+int uv__make_pipe(int fds[2], int flags) {
+#if defined(__linux__)
+  static int no_pipe2;
+
+  if (no_pipe2)
+    goto skip;
+
+  if (uv__pipe2(fds, flags | UV__O_CLOEXEC) == 0)
+    return 0;
+
+  if (errno != ENOSYS)
+    return -errno;
+
+  no_pipe2 = 1;
+
+skip:
+#endif
+
+  if (pipe(fds))
+    return -errno;
+
+  uv__cloexec(fds[0], 1);
+  uv__cloexec(fds[1], 1);
+
+  if (flags & UV__F_NONBLOCK) {
+    uv__nonblock(fds[0], 1);
+    uv__nonblock(fds[1], 1);
+  }
+
+  return 0;
+}
diff --git a/deps/libtuv/src/unix/proctitle.c b/deps/libtuv/src/unix/proctitle.c
new file mode 100644 (file)
index 0000000..08d875f
--- /dev/null
@@ -0,0 +1,105 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+extern void uv__set_process_title(const char* title);
+
+static void* args_mem;
+
+static struct {
+  char* str;
+  size_t len;
+} process_title;
+
+
+char** uv_setup_args(int argc, char** argv) {
+  char** new_argv;
+  size_t size;
+  char* s;
+  int i;
+
+  if (argc <= 0)
+    return argv;
+
+  /* Calculate how much memory we need for the argv strings. */
+  size = 0;
+  for (i = 0; i < argc; i++)
+    size += strlen(argv[i]) + 1;
+
+  process_title.str = argv[0];
+  process_title.len = argv[argc - 1] + strlen(argv[argc - 1]) - argv[0];
+  assert(process_title.len + 1 == size);  /* argv memory should be adjacent. */
+
+  /* Add space for the argv pointers. */
+  size += (argc + 1) * sizeof(char*);
+
+  new_argv = uv__malloc(size);
+  if (new_argv == NULL)
+    return argv;
+  args_mem = new_argv;
+
+  /* Copy over the strings and set up the pointer table. */
+  s = (char*) &new_argv[argc + 1];
+  for (i = 0; i < argc; i++) {
+    size = strlen(argv[i]) + 1;
+    memcpy(s, argv[i], size);
+    new_argv[i] = s;
+    s += size;
+  }
+  new_argv[i] = NULL;
+
+  return new_argv;
+}
+
+
+int uv_set_process_title(const char* title) {
+  if (process_title.len == 0)
+    return 0;
+
+  /* No need to terminate, byte after is always '\0'. */
+  strncpy(process_title.str, title, process_title.len);
+  uv__set_process_title(title);
+
+  return 0;
+}
+
+
+int uv_get_process_title(char* buffer, size_t size) {
+  if (buffer == NULL || size == 0)
+    return -EINVAL;
+  else if (size <= process_title.len)
+    return -ENOBUFS;
+
+  memcpy(buffer, process_title.str, process_title.len + 1);
+  buffer[process_title.len] = '\0';
+
+  return 0;
+}
+
+
+UV_DESTRUCTOR(static void free_args_mem(void)) {
+  uv__free(args_mem);  /* Keep valgrind happy. */
+  args_mem = NULL;
+}
diff --git a/deps/libtuv/src/unix/pthread-barrier.c b/deps/libtuv/src/unix/pthread-barrier.c
new file mode 100644 (file)
index 0000000..f57bf25
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+Copyright (c) 2016, Kari Tristan Helgason <kthelgason@gmail.com>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+#include "uv-common.h"
+#include "pthread-barrier.h"
+
+#include <stdlib.h>
+#include <assert.h>
+
+/* TODO: support barrier_attr */
+int pthread_barrier_init(pthread_barrier_t* barrier,
+                         const void* barrier_attr,
+                         unsigned count) {
+  int rc;
+  _uv_barrier* b;
+
+  if (barrier == NULL || count == 0)
+    return EINVAL;
+
+  if (barrier_attr != NULL)
+    return ENOTSUP;
+
+  b = uv__malloc(sizeof(*b));
+  if (b == NULL)
+    return ENOMEM;
+
+  b->in = 0;
+  b->out = 0;
+  b->threshold = count;
+
+  if ((rc = pthread_mutex_init(&b->mutex, NULL)) != 0)
+    goto error2;
+  if ((rc = pthread_cond_init(&b->cond, NULL)) != 0)
+    goto error;
+
+  barrier->b = b;
+  return 0;
+
+error:
+  pthread_mutex_destroy(&b->mutex);
+error2:
+  uv__free(b);
+  return rc;
+}
+
+int pthread_barrier_wait(pthread_barrier_t* barrier) {
+  int rc;
+  _uv_barrier* b;
+
+  if (barrier == NULL || barrier->b == NULL)
+    return EINVAL;
+
+  b = barrier->b;
+  /* Lock the mutex*/
+  if ((rc = pthread_mutex_lock(&b->mutex)) != 0)
+    return rc;
+
+  /* Increment the count. If this is the first thread to reach the threshold,
+     wake up waiters, unlock the mutex, then return
+     PTHREAD_BARRIER_SERIAL_THREAD. */
+  if (++b->in == b->threshold) {
+    b->in = 0;
+    b->out = b->threshold - 1;
+    assert(pthread_cond_signal(&b->cond) == 0);
+
+    pthread_mutex_unlock(&b->mutex);
+    return PTHREAD_BARRIER_SERIAL_THREAD;
+  }
+  /* Otherwise, wait for other threads until in is set to 0,
+     then return 0 to indicate this is not the first thread. */
+  do {
+    if ((rc = pthread_cond_wait(&b->cond, &b->mutex)) != 0)
+      break;
+  } while (b->in != 0);
+
+  /* mark thread exit */
+  b->out--;
+  pthread_cond_signal(&b->cond);
+  pthread_mutex_unlock(&b->mutex);
+  return rc;
+}
+
+int pthread_barrier_destroy(pthread_barrier_t* barrier) {
+  int rc;
+  _uv_barrier* b;
+
+  if (barrier == NULL || barrier->b == NULL)
+    return EINVAL;
+
+  b = barrier->b;
+
+  if ((rc = pthread_mutex_lock(&b->mutex)) != 0)
+    return rc;
+
+  if (b->in > 0 || b->out > 0)
+    rc = EBUSY;
+
+  pthread_mutex_unlock(&b->mutex);
+
+  if (rc)
+    return rc;
+
+  pthread_cond_destroy(&b->cond);
+  pthread_mutex_destroy(&b->mutex);
+  uv__free(barrier->b);
+  barrier->b = NULL;
+  return 0;
+}
diff --git a/deps/libtuv/src/unix/pthread-fixes.c b/deps/libtuv/src/unix/pthread-fixes.c
new file mode 100644 (file)
index 0000000..fb17995
--- /dev/null
@@ -0,0 +1,56 @@
+/* Copyright (c) 2013, Sony Mobile Communications AB
+ * Copyright (c) 2012, Google Inc.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are
+   met:
+
+     * Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+       * Redistributions in binary form must reproduce the above
+   copyright notice, this list of conditions and the following disclaimer
+   in the documentation and/or other materials provided with the
+   distribution.
+       * Neither the name of Google Inc. nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/* Android versions < 4.1 have a broken pthread_sigmask. */
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
+
+int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset) {
+  static int workaround;
+  int err;
+
+  if (workaround) {
+    return sigprocmask(how, set, oset);
+  } else {
+    err = pthread_sigmask(how, set, oset);
+    if (err) {
+      if (err == EINVAL && sigprocmask(how, set, oset) == 0) {
+        workaround = 1;
+        return 0;
+      } else {
+        return -1;
+      }
+    }
+  }
+
+  return 0;
+}
diff --git a/deps/libtuv/src/unix/signal.c b/deps/libtuv/src/unix/signal.c
new file mode 100644 (file)
index 0000000..dbd8f86
--- /dev/null
@@ -0,0 +1,467 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+
+typedef struct {
+  uv_signal_t* handle;
+  int signum;
+} uv__signal_msg_t;
+
+RB_HEAD(uv__signal_tree_s, uv_signal_s);
+
+
+static int uv__signal_unlock(void);
+static void uv__signal_event(uv_loop_t* loop, uv__io_t* w, unsigned int events);
+static int uv__signal_compare(uv_signal_t* w1, uv_signal_t* w2);
+static void uv__signal_stop(uv_signal_t* handle);
+
+
+static uv_once_t uv__signal_global_init_guard = UV_ONCE_INIT;
+static struct uv__signal_tree_s uv__signal_tree =
+    RB_INITIALIZER(uv__signal_tree);
+static int uv__signal_lock_pipefd[2];
+
+
+RB_GENERATE_STATIC(uv__signal_tree_s,
+                   uv_signal_s, tree_entry,
+                   uv__signal_compare)
+
+
+static void uv__signal_global_init(void) {
+  if (uv__make_pipe(uv__signal_lock_pipefd, 0))
+    abort();
+
+  if (uv__signal_unlock())
+    abort();
+}
+
+
+void uv__signal_global_once_init(void) {
+  uv_once(&uv__signal_global_init_guard, uv__signal_global_init);
+}
+
+
+
+static int uv__signal_lock(void) {
+  int r;
+  char data;
+
+  do {
+    r = read(uv__signal_lock_pipefd[0], &data, sizeof data);
+  } while (r < 0 && errno == EINTR);
+
+  return (r < 0) ? -1 : 0;
+}
+
+
+static int uv__signal_unlock(void) {
+  int r;
+  char data = 42;
+
+  do {
+    r = write(uv__signal_lock_pipefd[1], &data, sizeof data);
+  } while (r < 0 && errno == EINTR);
+
+  return (r < 0) ? -1 : 0;
+}
+
+
+static void uv__signal_block_and_lock(sigset_t* saved_sigmask) {
+  sigset_t new_mask;
+
+  if (sigfillset(&new_mask))
+    abort();
+
+  if (pthread_sigmask(SIG_SETMASK, &new_mask, saved_sigmask))
+    abort();
+
+  if (uv__signal_lock())
+    abort();
+}
+
+
+static void uv__signal_unlock_and_unblock(sigset_t* saved_sigmask) {
+  if (uv__signal_unlock())
+    abort();
+
+  if (pthread_sigmask(SIG_SETMASK, saved_sigmask, NULL))
+    abort();
+}
+
+
+static uv_signal_t* uv__signal_first_handle(int signum) {
+  /* This function must be called with the signal lock held. */
+  uv_signal_t lookup;
+  uv_signal_t* handle;
+
+  lookup.signum = signum;
+  lookup.loop = NULL;
+
+  handle = RB_NFIND(uv__signal_tree_s, &uv__signal_tree, &lookup);
+
+  if (handle != NULL && handle->signum == signum)
+    return handle;
+
+  return NULL;
+}
+
+
+static void uv__signal_handler(int signum) {
+  uv__signal_msg_t msg;
+  uv_signal_t* handle;
+  int saved_errno;
+
+  saved_errno = errno;
+  memset(&msg, 0, sizeof msg);
+
+  if (uv__signal_lock()) {
+    errno = saved_errno;
+    return;
+  }
+
+  for (handle = uv__signal_first_handle(signum);
+       handle != NULL && handle->signum == signum;
+       handle = RB_NEXT(uv__signal_tree_s, &uv__signal_tree, handle)) {
+    int r;
+
+    msg.signum = signum;
+    msg.handle = handle;
+
+    /* write() should be atomic for small data chunks, so the entire message
+     * should be written at once. In theory the pipe could become full, in
+     * which case the user is out of luck.
+     */
+    do {
+      r = write(handle->loop->signal_pipefd[1], &msg, sizeof msg);
+    } while (r == -1 && errno == EINTR);
+
+    assert(r == sizeof msg ||
+           (r == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)));
+
+    if (r != -1)
+      handle->caught_signals++;
+  }
+
+  uv__signal_unlock();
+  errno = saved_errno;
+}
+
+
+static int uv__signal_register_handler(int signum) {
+  /* When this function is called, the signal lock must be held. */
+  struct sigaction sa;
+
+  /* XXX use a separate signal stack? */
+  memset(&sa, 0, sizeof(sa));
+  if (sigfillset(&sa.sa_mask))
+    abort();
+  sa.sa_handler = uv__signal_handler;
+
+  /* XXX save old action so we can restore it later on? */
+  if (sigaction(signum, &sa, NULL))
+    return -errno;
+
+  return 0;
+}
+
+
+static void uv__signal_unregister_handler(int signum) {
+  /* When this function is called, the signal lock must be held. */
+  struct sigaction sa;
+
+  memset(&sa, 0, sizeof(sa));
+  sa.sa_handler = SIG_DFL;
+
+  /* sigaction can only fail with EINVAL or EFAULT; an attempt to deregister a
+   * signal implies that it was successfully registered earlier, so EINVAL
+   * should never happen.
+   */
+  if (sigaction(signum, &sa, NULL))
+    abort();
+}
+
+
+static int uv__signal_loop_once_init(uv_loop_t* loop) {
+  int err;
+
+  /* Return if already initialized. */
+  if (loop->signal_pipefd[0] != -1)
+    return 0;
+
+  err = uv__make_pipe(loop->signal_pipefd, UV__F_NONBLOCK);
+  if (err)
+    return err;
+
+  uv__io_init(&loop->signal_io_watcher,
+              uv__signal_event,
+              loop->signal_pipefd[0]);
+  uv__io_start(loop, &loop->signal_io_watcher, POLLIN);
+
+  return 0;
+}
+
+
+void uv__signal_loop_cleanup(uv_loop_t* loop) {
+  QUEUE* q;
+
+  /* Stop all the signal watchers that are still attached to this loop. This
+   * ensures that the (shared) signal tree doesn't contain any invalid entries
+   * entries, and that signal handlers are removed when appropriate.
+   * It's safe to use QUEUE_FOREACH here because the handles and the handle
+   * queue are not modified by uv__signal_stop().
+   */
+  QUEUE_FOREACH(q, &loop->handle_queue) {
+    uv_handle_t* handle = QUEUE_DATA(q, uv_handle_t, handle_queue);
+
+    if (handle->type == UV_SIGNAL)
+      uv__signal_stop((uv_signal_t*) handle);
+  }
+
+  if (loop->signal_pipefd[0] != -1) {
+    uv__close(loop->signal_pipefd[0]);
+    loop->signal_pipefd[0] = -1;
+  }
+
+  if (loop->signal_pipefd[1] != -1) {
+    uv__close(loop->signal_pipefd[1]);
+    loop->signal_pipefd[1] = -1;
+  }
+}
+
+
+int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle) {
+  int err;
+
+  err = uv__signal_loop_once_init(loop);
+  if (err)
+    return err;
+
+  uv__handle_init(loop, (uv_handle_t*) handle, UV_SIGNAL);
+  handle->signum = 0;
+  handle->caught_signals = 0;
+  handle->dispatched_signals = 0;
+
+  return 0;
+}
+
+
+void uv__signal_close(uv_signal_t* handle) {
+
+  uv__signal_stop(handle);
+
+  /* If there are any caught signals "trapped" in the signal pipe, we can't
+   * call the close callback yet. Otherwise, add the handle to the finish_close
+   * queue.
+   */
+  if (handle->caught_signals == handle->dispatched_signals) {
+    uv__make_close_pending((uv_handle_t*) handle);
+  }
+}
+
+
+int uv_signal_start(uv_signal_t* handle, uv_signal_cb signal_cb, int signum) {
+  sigset_t saved_sigmask;
+  int err;
+
+  assert(!uv__is_closing(handle));
+
+  /* If the user supplies signum == 0, then return an error already. If the
+   * signum is otherwise invalid then uv__signal_register will find out
+   * eventually.
+   */
+  if (signum == 0)
+    return -EINVAL;
+
+  /* Short circuit: if the signal watcher is already watching {signum} don't
+   * go through the process of deregistering and registering the handler.
+   * Additionally, this avoids pending signals getting lost in the small time
+   * time frame that handle->signum == 0.
+   */
+  if (signum == handle->signum) {
+    handle->signal_cb = signal_cb;
+    return 0;
+  }
+
+  /* If the signal handler was already active, stop it first. */
+  if (handle->signum != 0) {
+    uv__signal_stop(handle);
+  }
+
+  uv__signal_block_and_lock(&saved_sigmask);
+
+  /* If at this point there are no active signal watchers for this signum (in
+   * any of the loops), it's time to try and register a handler for it here.
+   */
+  if (uv__signal_first_handle(signum) == NULL) {
+    err = uv__signal_register_handler(signum);
+    if (err) {
+      /* Registering the signal handler failed. Must be an invalid signal. */
+      uv__signal_unlock_and_unblock(&saved_sigmask);
+      return err;
+    }
+  }
+
+  handle->signum = signum;
+  RB_INSERT(uv__signal_tree_s, &uv__signal_tree, handle);
+
+  uv__signal_unlock_and_unblock(&saved_sigmask);
+
+  handle->signal_cb = signal_cb;
+  uv__handle_start(handle);
+
+  return 0;
+}
+
+
+static void uv__signal_event(uv_loop_t* loop,
+                             uv__io_t* w,
+                             unsigned int events) {
+  uv__signal_msg_t* msg;
+  uv_signal_t* handle;
+  char buf[sizeof(uv__signal_msg_t) * 32];
+  size_t bytes, end, i;
+  int r;
+
+  bytes = 0;
+  end = 0;
+
+  do {
+    r = read(loop->signal_pipefd[0], buf + bytes, sizeof(buf) - bytes);
+
+    if (r == -1 && errno == EINTR)
+      continue;
+
+    if (r == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
+      /* If there are bytes in the buffer already (which really is extremely
+       * unlikely if possible at all) we can't exit the function here. We'll
+       * spin until more bytes are read instead.
+       */
+      if (bytes > 0)
+        continue;
+
+      /* Otherwise, there was nothing there. */
+      return;
+    }
+
+    /* Other errors really should never happen. */
+    if (r == -1)
+      abort();
+
+    bytes += r;
+
+    /* `end` is rounded down to a multiple of sizeof(uv__signal_msg_t). */
+    end = (bytes / sizeof(uv__signal_msg_t)) * sizeof(uv__signal_msg_t);
+
+    for (i = 0; i < end; i += sizeof(uv__signal_msg_t)) {
+      msg = (uv__signal_msg_t*) (buf + i);
+      handle = msg->handle;
+
+      if (msg->signum == handle->signum) {
+        assert(!(handle->flags & UV_CLOSING));
+        handle->signal_cb(handle, handle->signum);
+      }
+
+      handle->dispatched_signals++;
+
+      /* If uv_close was called while there were caught signals that were not
+       * yet dispatched, the uv__finish_close was deferred. Make close pending
+       * now if this has happened.
+       */
+      if ((handle->flags & UV_CLOSING) &&
+          (handle->caught_signals == handle->dispatched_signals)) {
+        uv__make_close_pending((uv_handle_t*) handle);
+      }
+    }
+
+    bytes -= end;
+
+    /* If there are any "partial" messages left, move them to the start of the
+     * the buffer, and spin. This should not happen.
+     */
+    if (bytes) {
+      memmove(buf, buf + end, bytes);
+      continue;
+    }
+  } while (end == sizeof buf);
+}
+
+
+static int uv__signal_compare(uv_signal_t* w1, uv_signal_t* w2) {
+  /* Compare signums first so all watchers with the same signnum end up
+   * adjacent.
+   */
+  if (w1->signum < w2->signum) return -1;
+  if (w1->signum > w2->signum) return 1;
+
+  /* Sort by loop pointer, so we can easily look up the first item after
+   * { .signum = x, .loop = NULL }.
+   */
+  if (w1->loop < w2->loop) return -1;
+  if (w1->loop > w2->loop) return 1;
+
+  if (w1 < w2) return -1;
+  if (w1 > w2) return 1;
+
+  return 0;
+}
+
+
+int uv_signal_stop(uv_signal_t* handle) {
+  assert(!uv__is_closing(handle));
+  uv__signal_stop(handle);
+  return 0;
+}
+
+
+static void uv__signal_stop(uv_signal_t* handle) {
+  uv_signal_t* removed_handle;
+  sigset_t saved_sigmask;
+
+  /* If the watcher wasn't started, this is a no-op. */
+  if (handle->signum == 0)
+    return;
+
+  uv__signal_block_and_lock(&saved_sigmask);
+
+  removed_handle = RB_REMOVE(uv__signal_tree_s, &uv__signal_tree, handle);
+  assert(removed_handle == handle);
+  (void) removed_handle;
+
+  /* Check if there are other active signal watchers observing this signal. If
+   * not, unregister the signal handler.
+   */
+  if (uv__signal_first_handle(handle->signum) == NULL)
+    uv__signal_unregister_handler(handle->signum);
+
+  uv__signal_unlock_and_unblock(&saved_sigmask);
+
+  handle->signum = 0;
+  uv__handle_stop(handle);
+}
diff --git a/deps/libtuv/src/unix/spinlock.h b/deps/libtuv/src/unix/spinlock.h
new file mode 100644 (file)
index 0000000..a20c83c
--- /dev/null
@@ -0,0 +1,53 @@
+/* Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef UV_SPINLOCK_H_
+#define UV_SPINLOCK_H_
+
+#include "internal.h"  /* ACCESS_ONCE, UV_UNUSED */
+#include "atomic-ops.h"
+
+#define UV_SPINLOCK_INITIALIZER { 0 }
+
+typedef struct {
+  int lock;
+} uv_spinlock_t;
+
+UV_UNUSED(static void uv_spinlock_init(uv_spinlock_t* spinlock));
+UV_UNUSED(static void uv_spinlock_lock(uv_spinlock_t* spinlock));
+UV_UNUSED(static void uv_spinlock_unlock(uv_spinlock_t* spinlock));
+UV_UNUSED(static int uv_spinlock_trylock(uv_spinlock_t* spinlock));
+
+UV_UNUSED(static void uv_spinlock_init(uv_spinlock_t* spinlock)) {
+  ACCESS_ONCE(int, spinlock->lock) = 0;
+}
+
+UV_UNUSED(static void uv_spinlock_lock(uv_spinlock_t* spinlock)) {
+  while (!uv_spinlock_trylock(spinlock)) cpu_relax();
+}
+
+UV_UNUSED(static void uv_spinlock_unlock(uv_spinlock_t* spinlock)) {
+  ACCESS_ONCE(int, spinlock->lock) = 0;
+}
+
+UV_UNUSED(static int uv_spinlock_trylock(uv_spinlock_t* spinlock)) {
+  /* TODO(bnoordhuis) Maybe change to a ticket lock to guarantee fair queueing.
+   * Not really critical until we have locks that are (frequently) contended
+   * for by several threads.
+   */
+  return 0 == cmpxchgi(&spinlock->lock, 0, 1);
+}
+
+#endif  /* UV_SPINLOCK_H_ */
diff --git a/deps/libtuv/src/unix/stream.c b/deps/libtuv/src/unix/stream.c
new file mode 100644 (file)
index 0000000..b747a44
--- /dev/null
@@ -0,0 +1,1662 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#if !defined(__TIZENRT__)
+# include <sys/uio.h>
+#endif
+
+#include <sys/un.h>
+#include <unistd.h>
+#include <limits.h> /* IOV_MAX */
+
+#if defined(__APPLE__)
+# include <sys/event.h>
+# include <sys/time.h>
+# include <sys/select.h>
+
+/* Forward declaration */
+typedef struct uv__stream_select_s uv__stream_select_t;
+
+struct uv__stream_select_s {
+  uv_stream_t* stream;
+  uv_thread_t thread;
+  uv_sem_t close_sem;
+  uv_sem_t async_sem;
+  uv_async_t async;
+  int events;
+  int fake_fd;
+  int int_fd;
+  int fd;
+  fd_set* sread;
+  size_t sread_sz;
+  fd_set* swrite;
+  size_t swrite_sz;
+};
+#endif /* defined(__APPLE__) */
+
+static void uv__stream_connect(uv_stream_t*);
+static void uv__write(uv_stream_t* stream);
+static void uv__read(uv_stream_t* stream);
+static void uv__stream_io(uv_loop_t* loop, uv__io_t* w, unsigned int events);
+static void uv__write_callbacks(uv_stream_t* stream);
+static size_t uv__write_req_size(uv_write_t* req);
+
+
+void uv__stream_init(uv_loop_t* loop,
+                     uv_stream_t* stream,
+                     uv_handle_type type) {
+  int err;
+
+  uv__handle_init(loop, (uv_handle_t*)stream, type);
+  stream->read_cb = NULL;
+  stream->alloc_cb = NULL;
+  stream->close_cb = NULL;
+  stream->connection_cb = NULL;
+  stream->connect_req = NULL;
+  stream->shutdown_req = NULL;
+  stream->accepted_fd = -1;
+  stream->queued_fds = NULL;
+  stream->delayed_error = 0;
+  QUEUE_INIT(&stream->write_queue);
+  QUEUE_INIT(&stream->write_completed_queue);
+  stream->write_queue_size = 0;
+
+  if (loop->emfile_fd == -1) {
+    err = uv__open_cloexec("/dev/null", O_RDONLY);
+    if (err < 0)
+        /* In the rare case that "/dev/null" isn't mounted open "/"
+         * instead.
+         */
+        err = uv__open_cloexec("/", O_RDONLY);
+    if (err >= 0)
+      loop->emfile_fd = err;
+  }
+
+#if defined(__APPLE__)
+  stream->select = NULL;
+#endif /* defined(__APPLE_) */
+
+  uv__io_init(&stream->io_watcher, uv__stream_io, -1);
+}
+
+
+static void uv__stream_osx_interrupt_select(uv_stream_t* stream) {
+#if defined(__APPLE__)
+  /* Notify select() thread about state change */
+  uv__stream_select_t* s;
+  int r;
+
+  s = stream->select;
+  if (s == NULL)
+    return;
+
+  /* Interrupt select() loop
+   * NOTE: fake_fd and int_fd are socketpair(), thus writing to one will
+   * emit read event on other side
+   */
+  do
+    r = write(s->fake_fd, "x", 1);
+  while (r == -1 && errno == EINTR);
+
+  assert(r == 1);
+#else  /* !defined(__APPLE__) */
+  /* No-op on any other platform */
+#endif  /* !defined(__APPLE__) */
+}
+
+
+#if defined(__APPLE__)
+static void uv__stream_osx_select(void* arg) {
+  uv_stream_t* stream;
+  uv__stream_select_t* s;
+  char buf[1024];
+  int events;
+  int fd;
+  int r;
+  int max_fd;
+
+  stream = arg;
+  s = stream->select;
+  fd = s->fd;
+
+  if (fd > s->int_fd)
+    max_fd = fd;
+  else
+    max_fd = s->int_fd;
+
+  while (1) {
+    /* Terminate on semaphore */
+    if (uv_sem_trywait(&s->close_sem) == 0)
+      break;
+
+    /* Watch fd using select(2) */
+    memset(s->sread, 0, s->sread_sz);
+    memset(s->swrite, 0, s->swrite_sz);
+
+    if (uv__io_active(&stream->io_watcher, POLLIN))
+      FD_SET(fd, s->sread);
+    if (uv__io_active(&stream->io_watcher, POLLOUT))
+      FD_SET(fd, s->swrite);
+    FD_SET(s->int_fd, s->sread);
+
+    /* Wait indefinitely for fd events */
+    r = select(max_fd + 1, s->sread, s->swrite, NULL, NULL);
+    if (r == -1) {
+      if (errno == EINTR)
+        continue;
+
+      /* XXX: Possible?! */
+      abort();
+    }
+
+    /* Ignore timeouts */
+    if (r == 0)
+      continue;
+
+    /* Empty socketpair's buffer in case of interruption */
+    if (FD_ISSET(s->int_fd, s->sread))
+      while (1) {
+        r = read(s->int_fd, buf, sizeof(buf));
+
+        if (r == sizeof(buf))
+          continue;
+
+        if (r != -1)
+          break;
+
+        if (errno == EAGAIN || errno == EWOULDBLOCK)
+          break;
+
+        if (errno == EINTR)
+          continue;
+
+        abort();
+      }
+
+    /* Handle events */
+    events = 0;
+    if (FD_ISSET(fd, s->sread))
+      events |= POLLIN;
+    if (FD_ISSET(fd, s->swrite))
+      events |= POLLOUT;
+
+    assert(events != 0 || FD_ISSET(s->int_fd, s->sread));
+    if (events != 0) {
+      ACCESS_ONCE(int, s->events) = events;
+
+      uv_async_send(&s->async);
+      uv_sem_wait(&s->async_sem);
+
+      /* Should be processed at this stage */
+      assert((s->events == 0) || (stream->flags & UV_CLOSING));
+    }
+  }
+}
+
+
+static void uv__stream_osx_select_cb(uv_async_t* handle) {
+  uv__stream_select_t* s;
+  uv_stream_t* stream;
+  int events;
+
+  s = container_of(handle, uv__stream_select_t, async);
+  stream = s->stream;
+
+  /* Get and reset stream's events */
+  events = s->events;
+  ACCESS_ONCE(int, s->events) = 0;
+
+  assert(events != 0);
+  assert(events == (events & (POLLIN | POLLOUT)));
+
+  /* Invoke callback on event-loop */
+  if ((events & POLLIN) && uv__io_active(&stream->io_watcher, POLLIN))
+    uv__stream_io(stream->loop, &stream->io_watcher, POLLIN);
+
+  if ((events & POLLOUT) && uv__io_active(&stream->io_watcher, POLLOUT))
+    uv__stream_io(stream->loop, &stream->io_watcher, POLLOUT);
+
+  if (stream->flags & UV_CLOSING)
+    return;
+
+  /* NOTE: It is important to do it here, otherwise `select()` might be called
+   * before the actual `uv__read()`, leading to the blocking syscall
+   */
+  uv_sem_post(&s->async_sem);
+}
+
+
+static void uv__stream_osx_cb_close(uv_handle_t* async) {
+  uv__stream_select_t* s;
+
+  s = container_of(async, uv__stream_select_t, async);
+  uv__free(s);
+}
+
+
+int uv__stream_try_select(uv_stream_t* stream, int* fd) {
+  /*
+   * kqueue doesn't work with some files from /dev mount on osx.
+   * select(2) in separate thread for those fds
+   */
+
+  struct kevent filter[1];
+  struct kevent events[1];
+  struct timespec timeout;
+  uv__stream_select_t* s;
+  int fds[2];
+  int err;
+  int ret;
+  int kq;
+  int old_fd;
+  int max_fd;
+  size_t sread_sz;
+  size_t swrite_sz;
+
+  kq = kqueue();
+  if (kq == -1) {
+    perror("(libuv) kqueue()");
+    return -errno;
+  }
+
+  EV_SET(&filter[0], *fd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, 0);
+
+  /* Use small timeout, because we only want to capture EINVALs */
+  timeout.tv_sec = 0;
+  timeout.tv_nsec = 1;
+
+  do
+    ret = kevent(kq, filter, 1, events, 1, &timeout);
+  while (ret == -1 && errno == EINTR);
+
+  uv__close(kq);
+
+  if (ret == -1)
+    return -errno;
+
+  if (ret == 0 || (events[0].flags & EV_ERROR) == 0 || events[0].data != EINVAL)
+    return 0;
+
+  /* At this point we definitely know that this fd won't work with kqueue */
+
+  /*
+   * Create fds for io watcher and to interrupt the select() loop.
+   * NOTE: do it ahead of malloc below to allocate enough space for fd_sets
+   */
+  if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds))
+    return -errno;
+
+  max_fd = *fd;
+  if (fds[1] > max_fd)
+    max_fd = fds[1];
+
+  sread_sz = ROUND_UP(max_fd + 1, sizeof(uint32_t) * NBBY) / NBBY;
+  swrite_sz = sread_sz;
+
+  s = uv__malloc(sizeof(*s) + sread_sz + swrite_sz);
+  if (s == NULL) {
+    err = -ENOMEM;
+    goto failed_malloc;
+  }
+
+  s->events = 0;
+  s->fd = *fd;
+  s->sread = (fd_set*) ((char*) s + sizeof(*s));
+  s->sread_sz = sread_sz;
+  s->swrite = (fd_set*) ((char*) s->sread + sread_sz);
+  s->swrite_sz = swrite_sz;
+
+  err = uv_async_init(stream->loop, &s->async, uv__stream_osx_select_cb);
+  if (err)
+    goto failed_async_init;
+
+  s->async.flags |= UV__HANDLE_INTERNAL;
+  uv__handle_unref(&s->async);
+
+  err = uv_sem_init(&s->close_sem, 0);
+  if (err != 0)
+    goto failed_close_sem_init;
+
+  err = uv_sem_init(&s->async_sem, 0);
+  if (err != 0)
+    goto failed_async_sem_init;
+
+  s->fake_fd = fds[0];
+  s->int_fd = fds[1];
+
+  old_fd = *fd;
+  s->stream = stream;
+  stream->select = s;
+  *fd = s->fake_fd;
+
+  err = uv_thread_create(&s->thread, uv__stream_osx_select, stream);
+  if (err != 0)
+    goto failed_thread_create;
+
+  return 0;
+
+failed_thread_create:
+  s->stream = NULL;
+  stream->select = NULL;
+  *fd = old_fd;
+
+  uv_sem_destroy(&s->async_sem);
+
+failed_async_sem_init:
+  uv_sem_destroy(&s->close_sem);
+
+failed_close_sem_init:
+  uv__close(fds[0]);
+  uv__close(fds[1]);
+  uv_close((uv_handle_t*) &s->async, uv__stream_osx_cb_close);
+  return err;
+
+failed_async_init:
+  uv__free(s);
+
+failed_malloc:
+  uv__close(fds[0]);
+  uv__close(fds[1]);
+
+  return err;
+}
+#endif /* defined(__APPLE__) */
+
+
+int uv__stream_open(uv_stream_t* stream, int fd, int flags) {
+#if defined(__APPLE__)
+  int enable;
+#endif
+
+  if (!(stream->io_watcher.fd == -1 || stream->io_watcher.fd == fd))
+    return -EBUSY;
+
+  assert(fd >= 0);
+  stream->flags |= flags;
+
+  if (stream->type == UV_TCP) {
+    if ((stream->flags & UV_TCP_NODELAY) && uv__tcp_nodelay(fd, 1))
+      return -errno;
+
+    /* TODO Use delay the user passed in. */
+    if ((stream->flags & UV_TCP_KEEPALIVE) && uv__tcp_keepalive(fd, 1, 60))
+      return -errno;
+  }
+
+#if defined(__APPLE__)
+  enable = 1;
+  if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &enable, sizeof(enable)) &&
+      errno != ENOTSOCK &&
+      errno != EINVAL) {
+    return -errno;
+  }
+#endif
+
+  stream->io_watcher.fd = fd;
+
+  return 0;
+}
+
+
+void uv__stream_flush_write_queue(uv_stream_t* stream, int error) {
+  uv_write_t* req;
+  QUEUE* q;
+  while (!QUEUE_EMPTY(&stream->write_queue)) {
+    q = QUEUE_HEAD(&stream->write_queue);
+    QUEUE_REMOVE(q);
+
+    req = QUEUE_DATA(q, uv_write_t, queue);
+    req->error = error;
+
+    QUEUE_INSERT_TAIL(&stream->write_completed_queue, &req->queue);
+  }
+}
+
+
+void uv__stream_destroy(uv_stream_t* stream) {
+  assert(!uv__io_active(&stream->io_watcher, POLLIN | POLLOUT));
+  assert(stream->flags & UV_CLOSED);
+
+  if (stream->connect_req) {
+    uv__req_unregister(stream->loop, stream->connect_req);
+    stream->connect_req->cb(stream->connect_req, -ECANCELED);
+    stream->connect_req = NULL;
+  }
+
+  uv__stream_flush_write_queue(stream, -ECANCELED);
+  uv__write_callbacks(stream);
+
+  if (stream->shutdown_req) {
+    /* The ECANCELED error code is a lie, the shutdown(2) syscall is a
+     * fait accompli at this point. Maybe we should revisit this in v0.11.
+     * A possible reason for leaving it unchanged is that it informs the
+     * callee that the handle has been destroyed.
+     */
+    uv__req_unregister(stream->loop, stream->shutdown_req);
+    stream->shutdown_req->cb(stream->shutdown_req, -ECANCELED);
+    stream->shutdown_req = NULL;
+  }
+
+  assert(stream->write_queue_size == 0);
+}
+
+
+/* Implements a best effort approach to mitigating accept() EMFILE errors.
+ * We have a spare file descriptor stashed away that we close to get below
+ * the EMFILE limit. Next, we accept all pending connections and close them
+ * immediately to signal the clients that we're overloaded - and we are, but
+ * we still keep on trucking.
+ *
+ * There is one caveat: it's not reliable in a multi-threaded environment.
+ * The file descriptor limit is per process. Our party trick fails if another
+ * thread opens a file or creates a socket in the time window between us
+ * calling close() and accept().
+ */
+static int uv__emfile_trick(uv_loop_t* loop, int accept_fd) {
+  int err;
+  int emfile_fd;
+
+  if (loop->emfile_fd == -1)
+    return -EMFILE;
+
+  uv__close(loop->emfile_fd);
+  loop->emfile_fd = -1;
+
+  do {
+    err = uv__accept(accept_fd);
+    if (err >= 0)
+      uv__close(err);
+  } while (err >= 0 || err == -EINTR);
+
+  emfile_fd = uv__open_cloexec("/", O_RDONLY);
+  if (emfile_fd >= 0)
+    loop->emfile_fd = emfile_fd;
+
+  return err;
+}
+
+
+#if defined(UV_HAVE_KQUEUE)
+# define UV_DEC_BACKLOG(w) w->rcount--;
+#else
+# define UV_DEC_BACKLOG(w) /* no-op */
+#endif /* defined(UV_HAVE_KQUEUE) */
+
+
+void uv__server_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
+  uv_stream_t* stream;
+  int err;
+
+  stream = container_of(w, uv_stream_t, io_watcher);
+  assert(events == POLLIN);
+  assert(stream->accepted_fd == -1);
+  assert(!(stream->flags & UV_CLOSING));
+
+  uv__io_start(stream->loop, &stream->io_watcher, POLLIN);
+
+  /* connection_cb can close the server socket while we're
+   * in the loop so check it on each iteration.
+   */
+  while (uv__stream_fd(stream) != -1) {
+    assert(stream->accepted_fd == -1);
+
+#if defined(UV_HAVE_KQUEUE)
+    if (w->rcount <= 0)
+      return;
+#endif /* defined(UV_HAVE_KQUEUE) */
+
+    err = uv__accept(uv__stream_fd(stream));
+    if (err < 0) {
+      if (err == -EAGAIN || err == -EWOULDBLOCK)
+        return;  /* Not an error. */
+
+      if (err == -ECONNABORTED)
+        continue;  /* Ignore. Nothing we can do about that. */
+
+      if (err == -EMFILE || err == -ENFILE) {
+        err = uv__emfile_trick(loop, uv__stream_fd(stream));
+        if (err == -EAGAIN || err == -EWOULDBLOCK)
+          break;
+      }
+
+      stream->connection_cb(stream, err);
+      continue;
+    }
+
+    UV_DEC_BACKLOG(w)
+    stream->accepted_fd = err;
+    stream->connection_cb(stream, 0);
+
+    if (stream->accepted_fd != -1) {
+      /* The user hasn't yet accepted called uv_accept() */
+      uv__io_stop(loop, &stream->io_watcher, POLLIN);
+      return;
+    }
+
+    if (stream->type == UV_TCP && (stream->flags & UV_TCP_SINGLE_ACCEPT)) {
+      /* Give other processes a chance to accept connections. */
+      struct timespec timeout = { 0, 1 };
+      nanosleep(&timeout, NULL);
+    }
+  }
+}
+
+
+#undef UV_DEC_BACKLOG
+
+
+int uv_accept(uv_stream_t* server, uv_stream_t* client) {
+  int err;
+
+  assert(server->loop == client->loop);
+
+  if (server->accepted_fd == -1)
+    return -EAGAIN;
+
+  switch (client->type) {
+    case UV_NAMED_PIPE:
+    case UV_TCP:
+      err = uv__stream_open(client,
+                            server->accepted_fd,
+                            UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+      if (err) {
+        /* TODO handle error */
+        uv__close(server->accepted_fd);
+        goto done;
+      }
+      break;
+
+    case UV_UDP:
+      err = uv_udp_open((uv_udp_t*) client, server->accepted_fd);
+      if (err) {
+        uv__close(server->accepted_fd);
+        goto done;
+      }
+      break;
+
+    default:
+      return -EINVAL;
+  }
+
+  client->flags |= UV_HANDLE_BOUND;
+
+done:
+  /* Process queued fds */
+  if (server->queued_fds != NULL) {
+    uv__stream_queued_fds_t* queued_fds;
+
+    queued_fds = server->queued_fds;
+
+    /* Read first */
+    server->accepted_fd = queued_fds->fds[0];
+
+    /* All read, free */
+    assert(queued_fds->offset > 0);
+    if (--queued_fds->offset == 0) {
+      uv__free(queued_fds);
+      server->queued_fds = NULL;
+    } else {
+      /* Shift rest */
+      memmove(queued_fds->fds,
+              queued_fds->fds + 1,
+              queued_fds->offset * sizeof(*queued_fds->fds));
+    }
+  } else {
+    server->accepted_fd = -1;
+    if (err == 0)
+      uv__io_start(server->loop, &server->io_watcher, POLLIN);
+  }
+  return err;
+}
+
+
+int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb) {
+  int err;
+
+  switch (stream->type) {
+  case UV_TCP:
+    err = uv_tcp_listen((uv_tcp_t*)stream, backlog, cb);
+    break;
+
+  default:
+    err = -EINVAL;
+  }
+
+  if (err == 0)
+    uv__handle_start(stream);
+
+  return err;
+}
+
+
+static void uv__drain(uv_stream_t* stream) {
+  uv_shutdown_t* req;
+  int err;
+
+  assert(QUEUE_EMPTY(&stream->write_queue));
+  uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT);
+  uv__stream_osx_interrupt_select(stream);
+
+  /* Shutdown? */
+  if ((stream->flags & UV_STREAM_SHUTTING) &&
+      !(stream->flags & UV_CLOSING) &&
+      !(stream->flags & UV_STREAM_SHUT)) {
+    assert(stream->shutdown_req);
+
+    req = stream->shutdown_req;
+    stream->shutdown_req = NULL;
+    stream->flags &= ~UV_STREAM_SHUTTING;
+    uv__req_unregister(stream->loop, req);
+
+    err = 0;
+    if (shutdown(uv__stream_fd(stream), SHUT_WR))
+      err = -errno;
+
+    if (err == 0)
+      stream->flags |= UV_STREAM_SHUT;
+
+    if (req->cb != NULL)
+      req->cb(req, err);
+  }
+}
+
+
+static size_t uv__write_req_size(uv_write_t* req) {
+  size_t size;
+
+  assert(req->bufs != NULL);
+  size = uv__count_bufs(req->bufs + req->write_index,
+                        req->nbufs - req->write_index);
+  assert(req->handle->write_queue_size >= size);
+
+  return size;
+}
+
+
+static void uv__write_req_finish(uv_write_t* req) {
+  uv_stream_t* stream = req->handle;
+
+  /* Pop the req off tcp->write_queue. */
+  QUEUE_REMOVE(&req->queue);
+
+  /* Only free when there was no error. On error, we touch up write_queue_size
+   * right before making the callback. The reason we don't do that right away
+   * is that a write_queue_size > 0 is our only way to signal to the user that
+   * they should stop writing - which they should if we got an error. Something
+   * to revisit in future revisions of the libuv API.
+   */
+  if (req->error == 0) {
+    if (req->bufs != req->bufsml)
+      uv__free(req->bufs);
+    req->bufs = NULL;
+  }
+
+  /* Add it to the write_completed_queue where it will have its
+   * callback called in the near future.
+   */
+  QUEUE_INSERT_TAIL(&stream->write_completed_queue, &req->queue);
+  uv__io_feed(stream->loop, &stream->io_watcher);
+}
+
+
+static int uv__handle_fd(uv_handle_t* handle) {
+  switch (handle->type) {
+    case UV_NAMED_PIPE:
+    case UV_TCP:
+      return ((uv_stream_t*) handle)->io_watcher.fd;
+
+    case UV_UDP:
+      return ((uv_udp_t*) handle)->io_watcher.fd;
+
+    default:
+      return -1;
+  }
+}
+
+static void uv__write(uv_stream_t* stream) {
+  struct iovec* iov;
+  QUEUE* q;
+  uv_write_t* req;
+  int iovmax;
+  int iovcnt;
+  ssize_t n;
+
+start:
+
+  assert(uv__stream_fd(stream) >= 0);
+
+  if (QUEUE_EMPTY(&stream->write_queue))
+    return;
+
+  q = QUEUE_HEAD(&stream->write_queue);
+  req = QUEUE_DATA(q, uv_write_t, queue);
+  assert(req->handle == stream);
+
+  /*
+   * Cast to iovec. We had to have our own uv_buf_t instead of iovec
+   * because Windows's WSABUF is not an iovec.
+   */
+  assert(sizeof(uv_buf_t) == sizeof(struct iovec));
+  iov = (struct iovec*) &(req->bufs[req->write_index]);
+  iovcnt = req->nbufs - req->write_index;
+
+  iovmax = uv__getiovmax();
+
+  /* Limit iov count to avoid EINVALs from writev() */
+  if (iovcnt > iovmax)
+    iovcnt = iovmax;
+
+  /*
+   * Now do the actual writev. Note that we've been updating the pointers
+   * inside the iov each time we write. So there is no need to offset it.
+   */
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  if (req->send_handle) {
+    struct msghdr msg;
+    struct cmsghdr *cmsg;
+    int fd_to_send = uv__handle_fd((uv_handle_t*) req->send_handle);
+    char scratch[64] = {0};
+
+    assert(fd_to_send >= 0);
+
+    msg.msg_name = NULL;
+    msg.msg_namelen = 0;
+    msg.msg_iov = iov;
+    msg.msg_iovlen = iovcnt;
+    msg.msg_flags = 0;
+
+    msg.msg_control = (void*) scratch;
+    msg.msg_controllen = CMSG_SPACE(sizeof(fd_to_send));
+
+    cmsg = CMSG_FIRSTHDR(&msg);
+    cmsg->cmsg_level = SOL_SOCKET;
+    cmsg->cmsg_type = SCM_RIGHTS;
+    cmsg->cmsg_len = CMSG_LEN(sizeof(fd_to_send));
+
+    /* silence aliasing warning */
+    {
+      void* pv = CMSG_DATA(cmsg);
+      int* pi = pv;
+      *pi = fd_to_send;
+    }
+
+    do {
+      n = sendmsg(uv__stream_fd(stream), &msg, 0);
+    }
+#if defined(__APPLE__)
+    /*
+     * Due to a possible kernel bug at least in OS X 10.10 "Yosemite",
+     * EPROTOTYPE can be returned while trying to write to a socket that is
+     * shutting down. If we retry the write, we should get the expected EPIPE
+     * instead.
+     */
+    while (n == -1 && (errno == EINTR || errno == EPROTOTYPE));
+#else
+    while (n == -1 && errno == EINTR);
+#endif
+  } else {
+#endif
+    do {
+      if (iovcnt == 1) {
+        n = write(uv__stream_fd(stream), iov[0].iov_base, iov[0].iov_len);
+      } else {
+        n = writev(uv__stream_fd(stream), iov, iovcnt);
+      }
+    }
+#if defined(__APPLE__)
+    /*
+     * Due to a possible kernel bug at least in OS X 10.10 "Yosemite",
+     * EPROTOTYPE can be returned while trying to write to a socket that is
+     * shutting down. If we retry the write, we should get the expected EPIPE
+     * instead.
+     */
+    while (n == -1 && (errno == EINTR || errno == EPROTOTYPE));
+#else
+    while (n == -1 && errno == EINTR);
+#endif
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  }
+#endif
+
+  if (n < 0) {
+    if (errno != EAGAIN && errno != EWOULDBLOCK) {
+      /* Error */
+      req->error = -errno;
+      uv__write_req_finish(req);
+      uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT);
+      if (!uv__io_active(&stream->io_watcher, POLLIN))
+        uv__handle_stop(stream);
+      uv__stream_osx_interrupt_select(stream);
+      return;
+    } else if (stream->flags & UV_STREAM_BLOCKING) {
+      /* If this is a blocking stream, try again. */
+      goto start;
+    }
+  } else {
+    /* Successful write */
+
+    while (n >= 0) {
+      uv_buf_t* buf = &(req->bufs[req->write_index]);
+      size_t len = buf->len;
+
+      assert(req->write_index < req->nbufs);
+
+      if ((size_t)n < len) {
+        buf->base += n;
+        buf->len -= n;
+        stream->write_queue_size -= n;
+        n = 0;
+
+        /* There is more to write. */
+        if (stream->flags & UV_STREAM_BLOCKING) {
+          /*
+           * If we're blocking then we should not be enabling the write
+           * watcher - instead we need to try again.
+           */
+          goto start;
+        } else {
+          /* Break loop and ensure the watcher is pending. */
+          break;
+        }
+
+      } else {
+        /* Finished writing the buf at index req->write_index. */
+        req->write_index++;
+
+        assert((size_t)n >= len);
+        n -= len;
+
+        assert(stream->write_queue_size >= len);
+        stream->write_queue_size -= len;
+
+        if (req->write_index == req->nbufs) {
+          /* Then we're done! */
+          assert(n == 0);
+          uv__write_req_finish(req);
+          /* TODO: start trying to write the next request. */
+          return;
+        }
+      }
+    }
+  }
+
+  /* Either we've counted n down to zero or we've got EAGAIN. */
+  assert(n == 0 || n == -1);
+
+  /* Only non-blocking streams should use the write_watcher. */
+  assert(!(stream->flags & UV_STREAM_BLOCKING));
+
+  /* We're not done. */
+  uv__io_start(stream->loop, &stream->io_watcher, POLLOUT);
+
+  /* Notify select() thread about state change */
+  uv__stream_osx_interrupt_select(stream);
+}
+
+
+static void uv__write_callbacks(uv_stream_t* stream) {
+  uv_write_t* req;
+  QUEUE* q;
+
+  while (!QUEUE_EMPTY(&stream->write_completed_queue)) {
+    /* Pop a req off write_completed_queue. */
+    q = QUEUE_HEAD(&stream->write_completed_queue);
+    req = QUEUE_DATA(q, uv_write_t, queue);
+    QUEUE_REMOVE(q);
+    uv__req_unregister(stream->loop, req);
+
+    if (req->bufs != NULL) {
+      stream->write_queue_size -= uv__write_req_size(req);
+      if (req->bufs != req->bufsml)
+        uv__free(req->bufs);
+      req->bufs = NULL;
+    }
+
+    /* NOTE: call callback AFTER freeing the request data. */
+    if (req->cb)
+      req->cb(req, req->error);
+  }
+
+  assert(QUEUE_EMPTY(&stream->write_completed_queue));
+}
+
+
+uv_handle_type uv__handle_type(int fd) {
+  struct sockaddr_storage ss;
+  socklen_t sslen;
+  socklen_t len;
+  int type;
+
+  memset(&ss, 0, sizeof(ss));
+  sslen = sizeof(ss);
+
+  if (getsockname(fd, (struct sockaddr*)&ss, &sslen))
+    return UV_UNKNOWN_HANDLE;
+
+  len = sizeof type;
+
+  if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &type, &len))
+    return UV_UNKNOWN_HANDLE;
+
+  if (type == SOCK_STREAM) {
+#if defined(_AIX) || defined(__DragonFly__)
+    /* on AIX/DragonFly the getsockname call returns an empty sa structure
+     * for sockets of type AF_UNIX.  For all other types it will
+     * return a properly filled in structure.
+     */
+    if (sslen == 0)
+      return UV_NAMED_PIPE;
+#endif
+    switch (ss.ss_family) {
+      case AF_UNIX:
+        return UV_NAMED_PIPE;
+      case AF_INET:
+      case AF_INET6:
+        return UV_TCP;
+      }
+  }
+
+  if (type == SOCK_DGRAM &&
+      (ss.ss_family == AF_INET || ss.ss_family == AF_INET6))
+    return UV_UDP;
+
+  return UV_UNKNOWN_HANDLE;
+}
+
+
+static void uv__stream_eof(uv_stream_t* stream, const uv_buf_t* buf) {
+  stream->flags |= UV_STREAM_READ_EOF;
+  uv__io_stop(stream->loop, &stream->io_watcher, POLLIN);
+  if (!uv__io_active(&stream->io_watcher, POLLOUT))
+    uv__handle_stop(stream);
+  uv__stream_osx_interrupt_select(stream);
+  stream->read_cb(stream, UV_EOF, buf);
+  stream->flags &= ~UV_STREAM_READING;
+}
+
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+static int uv__stream_queue_fd(uv_stream_t* stream, int fd) {
+  uv__stream_queued_fds_t* queued_fds;
+  unsigned int queue_size;
+
+  queued_fds = stream->queued_fds;
+  if (queued_fds == NULL) {
+    queue_size = 8;
+    queued_fds = uv__malloc((queue_size - 1) * sizeof(*queued_fds->fds) +
+                            sizeof(*queued_fds));
+    if (queued_fds == NULL)
+      return -ENOMEM;
+    queued_fds->size = queue_size;
+    queued_fds->offset = 0;
+    stream->queued_fds = queued_fds;
+
+    /* Grow */
+  } else if (queued_fds->size == queued_fds->offset) {
+    queue_size = queued_fds->size + 8;
+    queued_fds = uv__realloc(queued_fds,
+                             (queue_size - 1) * sizeof(*queued_fds->fds) +
+                              sizeof(*queued_fds));
+
+    /*
+     * Allocation failure, report back.
+     * NOTE: if it is fatal - sockets will be closed in uv__stream_close
+     */
+    if (queued_fds == NULL)
+      return -ENOMEM;
+    queued_fds->size = queue_size;
+    stream->queued_fds = queued_fds;
+  }
+
+  /* Put fd in a queue */
+  queued_fds->fds[queued_fds->offset++] = fd;
+
+  return 0;
+}
+#endif
+
+
+#define UV__CMSG_FD_COUNT 64
+#define UV__CMSG_FD_SIZE (UV__CMSG_FD_COUNT * sizeof(int))
+
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+static int uv__stream_recv_cmsg(uv_stream_t* stream, struct msghdr* msg) {
+  struct cmsghdr* cmsg;
+
+  for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+    char* start;
+    char* end;
+    int err;
+    void* pv;
+    int* pi;
+    unsigned int i;
+    unsigned int count;
+
+    if (cmsg->cmsg_type != SCM_RIGHTS) {
+      fprintf(stderr, "ignoring non-SCM_RIGHTS ancillary data: %d\n",
+          cmsg->cmsg_type);
+      continue;
+    }
+
+    /* silence aliasing warning */
+    pv = CMSG_DATA(cmsg);
+    pi = pv;
+
+    /* Count available fds */
+    start = (char*) cmsg;
+    end = (char*) cmsg + cmsg->cmsg_len;
+    count = 0;
+    while (start + CMSG_LEN(count * sizeof(*pi)) < end)
+      count++;
+    assert(start + CMSG_LEN(count * sizeof(*pi)) == end);
+
+    for (i = 0; i < count; i++) {
+      /* Already has accepted fd, queue now */
+      if (stream->accepted_fd != -1) {
+        err = uv__stream_queue_fd(stream, pi[i]);
+        if (err != 0) {
+          /* Close rest */
+          for (; i < count; i++)
+            uv__close(pi[i]);
+          return err;
+        }
+      } else {
+        stream->accepted_fd = pi[i];
+      }
+    }
+  }
+
+  return 0;
+}
+#endif
+
+
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wgnu-folding-constant"
+#endif
+
+static void uv__read(uv_stream_t* stream) {
+  uv_buf_t buf;
+  ssize_t nread;
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  struct msghdr msg;
+  char cmsg_space[CMSG_SPACE(UV__CMSG_FD_SIZE)];
+#endif
+  int count;
+  int err;
+  int is_ipc;
+
+  stream->flags &= ~UV_STREAM_READ_PARTIAL;
+
+  /* Prevent loop starvation when the data comes in as fast as (or faster than)
+   * we can read it. XXX Need to rearm fd if we switch to edge-triggered I/O.
+   */
+  count = 32;
+
+  is_ipc = stream->type == UV_NAMED_PIPE && ((uv_pipe_t*) stream)->ipc;
+#if defined(__NUTTX__) || defined(__TIZENRT__) /* No IPC support for now */
+  assert(!is_ipc);
+#endif
+
+  /* XXX: Maybe instead of having UV_STREAM_READING we just test if
+   * tcp->read_cb is NULL or not?
+   */
+  while (stream->read_cb
+      && (stream->flags & UV_STREAM_READING)
+      && (count-- > 0)) {
+    assert(stream->alloc_cb != NULL);
+
+    buf = uv_buf_init(NULL, 0);
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+    stream->alloc_cb((uv_handle_t*)stream, 64 * 1024, &buf);
+#else
+    stream->alloc_cb((uv_handle_t*)stream, 2 * 1024, &buf);
+#endif
+    if (buf.base == NULL || buf.len == 0) {
+      /* User indicates it can't or won't handle the read. */
+      stream->read_cb(stream, UV_ENOBUFS, &buf);
+      return;
+    }
+
+    assert(buf.base != NULL);
+    assert(uv__stream_fd(stream) >= 0);
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+    if (!is_ipc) {
+#endif
+      do {
+        nread = read(uv__stream_fd(stream), buf.base, buf.len);
+      }
+      while (nread < 0 && errno == EINTR);
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+    } else {
+      /* ipc uses recvmsg */
+      msg.msg_flags = 0;
+      msg.msg_iov = (struct iovec*) &buf;
+      msg.msg_iovlen = 1;
+      msg.msg_name = NULL;
+      msg.msg_namelen = 0;
+      /* Set up to receive a descriptor even if one isn't in the message */
+      msg.msg_controllen = sizeof(cmsg_space);
+      msg.msg_control = cmsg_space;
+
+      do {
+        nread = uv__recvmsg(uv__stream_fd(stream), &msg, 0);
+      }
+      while (nread < 0 && errno == EINTR);
+    }
+#endif
+
+    if (nread < 0) {
+      /* Error */
+      if (errno == EAGAIN || errno == EWOULDBLOCK) {
+        /* Wait for the next one. */
+        if (stream->flags & UV_STREAM_READING) {
+          uv__io_start(stream->loop, &stream->io_watcher, POLLIN);
+          uv__stream_osx_interrupt_select(stream);
+        }
+        stream->read_cb(stream, 0, &buf);
+      } else {
+        /* Error. User should call uv_close(). */
+        stream->read_cb(stream, -errno, &buf);
+        if (stream->flags & UV_STREAM_READING) {
+          stream->flags &= ~UV_STREAM_READING;
+          uv__io_stop(stream->loop, &stream->io_watcher, POLLIN);
+          if (!uv__io_active(&stream->io_watcher, POLLOUT))
+            uv__handle_stop(stream);
+          uv__stream_osx_interrupt_select(stream);
+        }
+      }
+      return;
+    } else if (nread == 0) {
+      uv__stream_eof(stream, &buf);
+      return;
+    } else {
+      /* Successful read */
+      ssize_t buflen = buf.len;
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+      if (is_ipc) {
+        err = uv__stream_recv_cmsg(stream, &msg);
+        if (err != 0) {
+          stream->read_cb(stream, err, &buf);
+          return;
+        }
+      }
+#endif
+      stream->read_cb(stream, nread, &buf);
+
+      /* Return if we didn't fill the buffer, there is no more data to read. */
+      if (nread < buflen) {
+        stream->flags |= UV_STREAM_READ_PARTIAL;
+        return;
+      }
+    }
+  }
+}
+
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
+
+#undef UV__CMSG_FD_COUNT
+#undef UV__CMSG_FD_SIZE
+
+
+int uv_shutdown(uv_shutdown_t* req, uv_stream_t* stream, uv_shutdown_cb cb) {
+  assert((stream->type == UV_TCP || stream->type == UV_NAMED_PIPE) &&
+         "uv_shutdown (unix) only supports uv_handle_t right now");
+
+  if (!(stream->flags & UV_STREAM_WRITABLE) ||
+      stream->flags & UV_STREAM_SHUT ||
+      stream->flags & UV_STREAM_SHUTTING ||
+      uv__is_closing(stream)) {
+    return -ENOTCONN;
+  }
+
+  assert(uv__stream_fd(stream) >= 0);
+
+  /* Initialize request */
+  uv__req_init(stream->loop, req, UV_SHUTDOWN);
+  req->handle = stream;
+  req->cb = cb;
+  stream->shutdown_req = req;
+  stream->flags |= UV_STREAM_SHUTTING;
+
+  uv__io_start(stream->loop, &stream->io_watcher, POLLOUT);
+  uv__stream_osx_interrupt_select(stream);
+
+  return 0;
+}
+
+
+static void uv__stream_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
+  uv_stream_t* stream;
+
+  stream = container_of(w, uv_stream_t, io_watcher);
+
+  assert(stream->type == UV_TCP ||
+         stream->type == UV_NAMED_PIPE ||
+         stream->type == UV_TTY);
+  assert(!(stream->flags & UV_CLOSING));
+
+  if (stream->connect_req) {
+    uv__stream_connect(stream);
+    return;
+  }
+
+  assert(uv__stream_fd(stream) >= 0);
+
+  /* Ignore POLLHUP here. Even it it's set, there may still be data to read. */
+  if (events & (POLLIN | POLLERR | POLLHUP))
+    uv__read(stream);
+
+  if (uv__stream_fd(stream) == -1)
+    return;  /* read_cb closed stream. */
+
+  /* Short-circuit iff POLLHUP is set, the user is still interested in read
+   * events and uv__read() reported a partial read but not EOF. If the EOF
+   * flag is set, uv__read() called read_cb with err=UV_EOF and we don't
+   * have to do anything. If the partial read flag is not set, we can't
+   * report the EOF yet because there is still data to read.
+   */
+  if ((events & POLLHUP) &&
+      (stream->flags & UV_STREAM_READING) &&
+      (stream->flags & UV_STREAM_READ_PARTIAL) &&
+      !(stream->flags & UV_STREAM_READ_EOF)) {
+    uv_buf_t buf = { NULL, 0 };
+    uv__stream_eof(stream, &buf);
+  }
+
+  if (uv__stream_fd(stream) == -1)
+    return;  /* read_cb closed stream. */
+
+  if (events & (POLLOUT | POLLERR | POLLHUP)) {
+    uv__write(stream);
+    uv__write_callbacks(stream);
+
+    /* Write queue drained. */
+    if (QUEUE_EMPTY(&stream->write_queue))
+      uv__drain(stream);
+  }
+}
+
+
+/**
+ * We get called here from directly following a call to connect(2).
+ * In order to determine if we've errored out or succeeded must call
+ * getsockopt.
+ */
+static void uv__stream_connect(uv_stream_t* stream) {
+  int error;
+  uv_connect_t* req = stream->connect_req;
+  socklen_t errorsize = sizeof(int);
+
+  assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE);
+  assert(req);
+
+  if (stream->delayed_error) {
+    /* To smooth over the differences between unixes errors that
+     * were reported synchronously on the first connect can be delayed
+     * until the next tick--which is now.
+     */
+    error = stream->delayed_error;
+    stream->delayed_error = 0;
+  } else {
+    /* Normal situation: we need to get the socket error from the kernel. */
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+    // getsockopt for SO_ERROR is not supported in NuttX
+    error = 0;
+#else
+    assert(uv__stream_fd(stream) >= 0);
+    getsockopt(uv__stream_fd(stream),
+               SOL_SOCKET,
+               SO_ERROR,
+               &error,
+               &errorsize);
+    error = -error;
+#endif
+  }
+
+  if (error == -EINPROGRESS)
+    return;
+
+  stream->connect_req = NULL;
+  uv__req_unregister(stream->loop, req);
+
+  if (error < 0 || QUEUE_EMPTY(&stream->write_queue)) {
+    uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT);
+  }
+
+  if (req->cb)
+    req->cb(req, error);
+
+  if (uv__stream_fd(stream) == -1)
+    return;
+
+  if (error < 0) {
+    uv__stream_flush_write_queue(stream, -ECANCELED);
+    uv__write_callbacks(stream);
+  }
+}
+
+
+int uv_write2(uv_write_t* req,
+              uv_stream_t* stream,
+              const uv_buf_t bufs[],
+              unsigned int nbufs,
+              uv_stream_t* send_handle,
+              uv_write_cb cb) {
+  int empty_queue;
+
+  assert(nbufs > 0);
+  assert((stream->type == UV_TCP ||
+          stream->type == UV_NAMED_PIPE ||
+          stream->type == UV_TTY) &&
+         "uv_write (unix) does not yet support other types of streams");
+
+  if (uv__stream_fd(stream) < 0)
+    return -EBADF;
+
+  if (send_handle) {
+    if (stream->type != UV_NAMED_PIPE || !((uv_pipe_t*)stream)->ipc)
+      return -EINVAL;
+
+    /* XXX We abuse uv_write2() to send over UDP handles to child processes.
+     * Don't call uv__stream_fd() on those handles, it's a macro that on OS X
+     * evaluates to a function that operates on a uv_stream_t with a couple of
+     * OS X specific fields. On other Unices it does (handle)->io_watcher.fd,
+     * which works but only by accident.
+     */
+    if (uv__handle_fd((uv_handle_t*) send_handle) < 0)
+      return -EBADF;
+  }
+
+  /* It's legal for write_queue_size > 0 even when the write_queue is empty;
+   * it means there are error-state requests in the write_completed_queue that
+   * will touch up write_queue_size later, see also uv__write_req_finish().
+   * We could check that write_queue is empty instead but that implies making
+   * a write() syscall when we know that the handle is in error mode.
+   */
+  empty_queue = (stream->write_queue_size == 0);
+
+  /* Initialize the req */
+  uv__req_init(stream->loop, req, UV_WRITE);
+  req->cb = cb;
+  req->handle = stream;
+  req->error = 0;
+  req->send_handle = send_handle;
+  QUEUE_INIT(&req->queue);
+
+  req->bufs = req->bufsml;
+  if (nbufs > ARRAY_SIZE(req->bufsml))
+    req->bufs = uv__malloc(nbufs * sizeof(bufs[0]));
+
+  if (req->bufs == NULL)
+    return -ENOMEM;
+
+  memcpy(req->bufs, bufs, nbufs * sizeof(bufs[0]));
+  req->nbufs = nbufs;
+  req->write_index = 0;
+  stream->write_queue_size += uv__count_bufs(bufs, nbufs);
+
+  /* Append the request to write_queue. */
+  QUEUE_INSERT_TAIL(&stream->write_queue, &req->queue);
+
+  /* If the queue was empty when this function began, we should attempt to
+   * do the write immediately. Otherwise start the write_watcher and wait
+   * for the fd to become writable.
+   */
+  if (stream->connect_req) {
+    /* Still connecting, do nothing. */
+  }
+  else if (empty_queue) {
+    uv__write(stream);
+  }
+  else {
+    /*
+     * blocking streams should never have anything in the queue.
+     * if this assert fires then somehow the blocking stream isn't being
+     * sufficiently flushed in uv__write.
+     */
+    assert(!(stream->flags & UV_STREAM_BLOCKING));
+    uv__io_start(stream->loop, &stream->io_watcher, POLLOUT);
+    uv__stream_osx_interrupt_select(stream);
+  }
+
+  return 0;
+}
+
+
+/* The buffers to be written must remain valid until the callback is called.
+ * This is not required for the uv_buf_t array.
+ */
+int uv_write(uv_write_t* req,
+             uv_stream_t* handle,
+             const uv_buf_t bufs[],
+             unsigned int nbufs,
+             uv_write_cb cb) {
+  return uv_write2(req, handle, bufs, nbufs, NULL, cb);
+}
+
+
+void uv_try_write_cb(uv_write_t* req, int status) {
+  /* Should not be called */
+  abort();
+}
+
+
+int uv_try_write(uv_stream_t* stream,
+                 const uv_buf_t bufs[],
+                 unsigned int nbufs) {
+  int r;
+  int has_pollout;
+  size_t written;
+  size_t req_size;
+  uv_write_t req;
+
+  /* Connecting or already writing some data */
+  if (stream->connect_req != NULL || stream->write_queue_size != 0)
+    return -EAGAIN;
+
+  has_pollout = uv__io_active(&stream->io_watcher, POLLOUT);
+
+  r = uv_write(&req, stream, bufs, nbufs, uv_try_write_cb);
+  if (r != 0)
+    return r;
+
+  /* Remove not written bytes from write queue size */
+  written = uv__count_bufs(bufs, nbufs);
+  if (req.bufs != NULL)
+    req_size = uv__write_req_size(&req);
+  else
+    req_size = 0;
+  written -= req_size;
+  stream->write_queue_size -= req_size;
+
+  /* Unqueue request, regardless of immediateness */
+  QUEUE_REMOVE(&req.queue);
+  uv__req_unregister(stream->loop, &req);
+  if (req.bufs != req.bufsml)
+    uv__free(req.bufs);
+  req.bufs = NULL;
+
+  /* Do not poll for writable, if we wasn't before calling this */
+  if (!has_pollout) {
+    uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT);
+    uv__stream_osx_interrupt_select(stream);
+  }
+
+  if (written == 0 && req_size != 0)
+    return -EAGAIN;
+  else
+    return written;
+}
+
+
+int uv_read_start(uv_stream_t* stream,
+                  uv_alloc_cb alloc_cb,
+                  uv_read_cb read_cb) {
+  assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE ||
+      stream->type == UV_TTY);
+
+  if (stream->flags & UV_CLOSING)
+    return -EINVAL;
+
+  /* The UV_STREAM_READING flag is irrelevant of the state of the tcp - it just
+   * expresses the desired state of the user.
+   */
+  stream->flags |= UV_STREAM_READING;
+
+  /* TODO: try to do the read inline? */
+  /* TODO: keep track of tcp state. If we've gotten a EOF then we should
+   * not start the IO watcher.
+   */
+  assert(uv__stream_fd(stream) >= 0);
+  assert(alloc_cb);
+
+  stream->read_cb = read_cb;
+  stream->alloc_cb = alloc_cb;
+
+  uv__io_start(stream->loop, &stream->io_watcher, POLLIN);
+  uv__handle_start(stream);
+  uv__stream_osx_interrupt_select(stream);
+
+  return 0;
+}
+
+
+int uv_read_stop(uv_stream_t* stream) {
+  if (!(stream->flags & UV_STREAM_READING))
+    return 0;
+
+  stream->flags &= ~UV_STREAM_READING;
+  uv__io_stop(stream->loop, &stream->io_watcher, POLLIN);
+  if (!uv__io_active(&stream->io_watcher, POLLOUT))
+    uv__handle_stop(stream);
+  uv__stream_osx_interrupt_select(stream);
+
+  stream->read_cb = NULL;
+  stream->alloc_cb = NULL;
+  return 0;
+}
+
+
+#if defined(__APPLE__)
+int uv___stream_fd(const uv_stream_t* handle) {
+  const uv__stream_select_t* s;
+
+  assert(handle->type == UV_TCP ||
+         handle->type == UV_TTY ||
+         handle->type == UV_NAMED_PIPE);
+
+  s = handle->select;
+  if (s != NULL)
+    return s->fd;
+
+  return handle->io_watcher.fd;
+}
+#endif /* defined(__APPLE__) */
+
+
+void uv__stream_close(uv_stream_t* handle) {
+  unsigned int i;
+  uv__stream_queued_fds_t* queued_fds;
+
+#if defined(__APPLE__)
+  /* Terminate select loop first */
+  if (handle->select != NULL) {
+    uv__stream_select_t* s;
+
+    s = handle->select;
+
+    uv_sem_post(&s->close_sem);
+    uv_sem_post(&s->async_sem);
+    uv__stream_osx_interrupt_select(handle);
+    uv_thread_join(&s->thread);
+    uv_sem_destroy(&s->close_sem);
+    uv_sem_destroy(&s->async_sem);
+    uv__close(s->fake_fd);
+    uv__close(s->int_fd);
+    uv_close((uv_handle_t*) &s->async, uv__stream_osx_cb_close);
+
+    handle->select = NULL;
+  }
+#endif /* defined(__APPLE__) */
+
+  uv__io_close(handle->loop, &handle->io_watcher);
+  uv_read_stop(handle);
+  uv__handle_stop(handle);
+
+  if (handle->io_watcher.fd != -1) {
+    /* Don't close stdio file descriptors.  Nothing good comes from it. */
+    if (handle->io_watcher.fd > STDERR_FILENO)
+      uv__close(handle->io_watcher.fd);
+    handle->io_watcher.fd = -1;
+  }
+
+  if (handle->accepted_fd != -1) {
+    uv__close(handle->accepted_fd);
+    handle->accepted_fd = -1;
+  }
+
+  /* Close all queued fds */
+  if (handle->queued_fds != NULL) {
+    queued_fds = handle->queued_fds;
+    for (i = 0; i < queued_fds->offset; i++)
+      uv__close(queued_fds->fds[i]);
+    uv__free(handle->queued_fds);
+    handle->queued_fds = NULL;
+  }
+
+  assert(!uv__io_active(&handle->io_watcher, POLLIN | POLLOUT));
+}
+
diff --git a/deps/libtuv/src/unix/sunos.c b/deps/libtuv/src/unix/sunos.c
new file mode 100644 (file)
index 0000000..3e7a759
--- /dev/null
@@ -0,0 +1,821 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <errno.h>
+
+#ifndef SUNOS_NO_IFADDRS
+# include <ifaddrs.h>
+#endif
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_arp.h>
+#include <sys/sockio.h>
+
+#include <sys/loadavg.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <kstat.h>
+#include <fcntl.h>
+
+#include <sys/port.h>
+#include <port.h>
+
+#define PORT_FIRED 0x69
+#define PORT_UNUSED 0x0
+#define PORT_LOADED 0x99
+#define PORT_DELETED -1
+
+#if (!defined(_LP64)) && (_FILE_OFFSET_BITS - 0 == 64)
+#define PROCFS_FILE_OFFSET_BITS_HACK 1
+#undef _FILE_OFFSET_BITS
+#else
+#define PROCFS_FILE_OFFSET_BITS_HACK 0
+#endif
+
+#include <procfs.h>
+
+#if (PROCFS_FILE_OFFSET_BITS_HACK - 0 == 1)
+#define _FILE_OFFSET_BITS 64
+#endif
+
+
+int uv__platform_loop_init(uv_loop_t* loop) {
+  int err;
+  int fd;
+
+  loop->fs_fd = -1;
+  loop->backend_fd = -1;
+
+  fd = port_create();
+  if (fd == -1)
+    return -errno;
+
+  err = uv__cloexec(fd, 1);
+  if (err) {
+    uv__close(fd);
+    return err;
+  }
+  loop->backend_fd = fd;
+
+  return 0;
+}
+
+
+void uv__platform_loop_delete(uv_loop_t* loop) {
+  if (loop->fs_fd != -1) {
+    uv__close(loop->fs_fd);
+    loop->fs_fd = -1;
+  }
+
+  if (loop->backend_fd != -1) {
+    uv__close(loop->backend_fd);
+    loop->backend_fd = -1;
+  }
+}
+
+
+void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
+  struct port_event* events;
+  uintptr_t i;
+  uintptr_t nfds;
+
+  assert(loop->watchers != NULL);
+
+  events = (struct port_event*) loop->watchers[loop->nwatchers];
+  nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1];
+  if (events == NULL)
+    return;
+
+  /* Invalidate events with same file descriptor */
+  for (i = 0; i < nfds; i++)
+    if ((int) events[i].portev_object == fd)
+      events[i].portev_object = -1;
+}
+
+
+int uv__io_check_fd(uv_loop_t* loop, int fd) {
+  if (port_associate(loop->backend_fd, PORT_SOURCE_FD, fd, POLLIN, 0))
+    return -errno;
+
+  if (port_dissociate(loop->backend_fd, PORT_SOURCE_FD, fd))
+    abort();
+
+  return 0;
+}
+
+
+void uv__io_poll(uv_loop_t* loop, int timeout) {
+  struct port_event events[1024];
+  struct port_event* pe;
+  struct timespec spec;
+  QUEUE* q;
+  uv__io_t* w;
+  sigset_t* pset;
+  sigset_t set;
+  uint64_t base;
+  uint64_t diff;
+  unsigned int nfds;
+  unsigned int i;
+  int saved_errno;
+  int have_signals;
+  int nevents;
+  int count;
+  int err;
+  int fd;
+
+  if (loop->nfds == 0) {
+    assert(QUEUE_EMPTY(&loop->watcher_queue));
+    return;
+  }
+
+  while (!QUEUE_EMPTY(&loop->watcher_queue)) {
+    q = QUEUE_HEAD(&loop->watcher_queue);
+    QUEUE_REMOVE(q);
+    QUEUE_INIT(q);
+
+    w = QUEUE_DATA(q, uv__io_t, watcher_queue);
+    assert(w->pevents != 0);
+
+    if (port_associate(loop->backend_fd, PORT_SOURCE_FD, w->fd, w->pevents, 0))
+      abort();
+
+    w->events = w->pevents;
+  }
+
+  pset = NULL;
+  if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
+    pset = &set;
+    sigemptyset(pset);
+    sigaddset(pset, SIGPROF);
+  }
+
+  assert(timeout >= -1);
+  base = loop->time;
+  count = 48; /* Benchmarks suggest this gives the best throughput. */
+
+  for (;;) {
+    if (timeout != -1) {
+      spec.tv_sec = timeout / 1000;
+      spec.tv_nsec = (timeout % 1000) * 1000000;
+    }
+
+    /* Work around a kernel bug where nfds is not updated. */
+    events[0].portev_source = 0;
+
+    nfds = 1;
+    saved_errno = 0;
+
+    if (pset != NULL)
+      pthread_sigmask(SIG_BLOCK, pset, NULL);
+
+    err = port_getn(loop->backend_fd,
+                    events,
+                    ARRAY_SIZE(events),
+                    &nfds,
+                    timeout == -1 ? NULL : &spec);
+
+    if (pset != NULL)
+      pthread_sigmask(SIG_UNBLOCK, pset, NULL);
+
+    if (err) {
+      /* Work around another kernel bug: port_getn() may return events even
+       * on error.
+       */
+      if (errno == EINTR || errno == ETIME)
+        saved_errno = errno;
+      else
+        abort();
+    }
+
+    /* Update loop->time unconditionally. It's tempting to skip the update when
+     * timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the
+     * operating system didn't reschedule our process while in the syscall.
+     */
+    SAVE_ERRNO(uv__update_time(loop));
+
+    if (events[0].portev_source == 0) {
+      if (timeout == 0)
+        return;
+
+      if (timeout == -1)
+        continue;
+
+      goto update_timeout;
+    }
+
+    if (nfds == 0) {
+      assert(timeout != -1);
+      return;
+    }
+
+    have_signals = 0;
+    nevents = 0;
+
+    assert(loop->watchers != NULL);
+    loop->watchers[loop->nwatchers] = (void*) events;
+    loop->watchers[loop->nwatchers + 1] = (void*) (uintptr_t) nfds;
+    for (i = 0; i < nfds; i++) {
+      pe = events + i;
+      fd = pe->portev_object;
+
+      /* Skip invalidated events, see uv__platform_invalidate_fd */
+      if (fd == -1)
+        continue;
+
+      assert(fd >= 0);
+      assert((unsigned) fd < loop->nwatchers);
+
+      w = loop->watchers[fd];
+
+      /* File descriptor that we've stopped watching, ignore. */
+      if (w == NULL)
+        continue;
+
+      /* Run signal watchers last.  This also affects child process watchers
+       * because those are implemented in terms of signal watchers.
+       */
+      if (w == &loop->signal_io_watcher)
+        have_signals = 1;
+      else
+        w->cb(loop, w, pe->portev_events);
+
+      nevents++;
+
+      if (w != loop->watchers[fd])
+        continue;  /* Disabled by callback. */
+
+      /* Events Ports operates in oneshot mode, rearm timer on next run. */
+      if (w->pevents != 0 && QUEUE_EMPTY(&w->watcher_queue))
+        QUEUE_INSERT_TAIL(&loop->watcher_queue, &w->watcher_queue);
+    }
+
+    if (have_signals != 0)
+      loop->signal_io_watcher.cb(loop, &loop->signal_io_watcher, POLLIN);
+
+    loop->watchers[loop->nwatchers] = NULL;
+    loop->watchers[loop->nwatchers + 1] = NULL;
+
+    if (have_signals != 0)
+      return;  /* Event loop should cycle now so don't poll again. */
+
+    if (nevents != 0) {
+      if (nfds == ARRAY_SIZE(events) && --count != 0) {
+        /* Poll for more events but don't block this time. */
+        timeout = 0;
+        continue;
+      }
+      return;
+    }
+
+    if (saved_errno == ETIME) {
+      assert(timeout != -1);
+      return;
+    }
+
+    if (timeout == 0)
+      return;
+
+    if (timeout == -1)
+      continue;
+
+update_timeout:
+    assert(timeout > 0);
+
+    diff = loop->time - base;
+    if (diff >= (uint64_t) timeout)
+      return;
+
+    timeout -= diff;
+  }
+}
+
+
+uint64_t uv__hrtime(uv_clocktype_t type) {
+  return gethrtime();
+}
+
+
+/*
+ * We could use a static buffer for the path manipulations that we need outside
+ * of the function, but this function could be called by multiple consumers and
+ * we don't want to potentially create a race condition in the use of snprintf.
+ */
+int uv_exepath(char* buffer, size_t* size) {
+  ssize_t res;
+  char buf[128];
+
+  if (buffer == NULL || size == NULL || *size == 0)
+    return -EINVAL;
+
+  snprintf(buf, sizeof(buf), "/proc/%lu/path/a.out", (unsigned long) getpid());
+
+  res = *size - 1;
+  if (res > 0)
+    res = readlink(buf, buffer, res);
+
+  if (res == -1)
+    return -errno;
+
+  buffer[res] = '\0';
+  *size = res;
+  return 0;
+}
+
+
+uint64_t uv_get_free_memory(void) {
+  return (uint64_t) sysconf(_SC_PAGESIZE) * sysconf(_SC_AVPHYS_PAGES);
+}
+
+
+uint64_t uv_get_total_memory(void) {
+  return (uint64_t) sysconf(_SC_PAGESIZE) * sysconf(_SC_PHYS_PAGES);
+}
+
+
+void uv_loadavg(double avg[3]) {
+  (void) getloadavg(avg, 3);
+}
+
+
+#if defined(PORT_SOURCE_FILE)
+
+static int uv__fs_event_rearm(uv_fs_event_t *handle) {
+  if (handle->fd == -1)
+    return -EBADF;
+
+  if (port_associate(handle->loop->fs_fd,
+                     PORT_SOURCE_FILE,
+                     (uintptr_t) &handle->fo,
+                     FILE_ATTRIB | FILE_MODIFIED,
+                     handle) == -1) {
+    return -errno;
+  }
+  handle->fd = PORT_LOADED;
+
+  return 0;
+}
+
+
+static void uv__fs_event_read(uv_loop_t* loop,
+                              uv__io_t* w,
+                              unsigned int revents) {
+  uv_fs_event_t *handle = NULL;
+  timespec_t timeout;
+  port_event_t pe;
+  int events;
+  int r;
+
+  (void) w;
+  (void) revents;
+
+  do {
+    uint_t n = 1;
+
+    /*
+     * Note that our use of port_getn() here (and not port_get()) is deliberate:
+     * there is a bug in event ports (Sun bug 6456558) whereby a zeroed timeout
+     * causes port_get() to return success instead of ETIME when there aren't
+     * actually any events (!); by using port_getn() in lieu of port_get(),
+     * we can at least workaround the bug by checking for zero returned events
+     * and treating it as we would ETIME.
+     */
+    do {
+      memset(&timeout, 0, sizeof timeout);
+      r = port_getn(loop->fs_fd, &pe, 1, &n, &timeout);
+    }
+    while (r == -1 && errno == EINTR);
+
+    if ((r == -1 && errno == ETIME) || n == 0)
+      break;
+
+    handle = (uv_fs_event_t*) pe.portev_user;
+    assert((r == 0) && "unexpected port_get() error");
+
+    events = 0;
+    if (pe.portev_events & (FILE_ATTRIB | FILE_MODIFIED))
+      events |= UV_CHANGE;
+    if (pe.portev_events & ~(FILE_ATTRIB | FILE_MODIFIED))
+      events |= UV_RENAME;
+    assert(events != 0);
+    handle->fd = PORT_FIRED;
+    handle->cb(handle, NULL, events, 0);
+
+    if (handle->fd != PORT_DELETED) {
+      r = uv__fs_event_rearm(handle);
+      if (r != 0)
+        handle->cb(handle, NULL, 0, r);
+    }
+  }
+  while (handle->fd != PORT_DELETED);
+}
+
+
+int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) {
+  uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);
+  return 0;
+}
+
+
+int uv_fs_event_start(uv_fs_event_t* handle,
+                      uv_fs_event_cb cb,
+                      const char* path,
+                      unsigned int flags) {
+  int portfd;
+  int first_run;
+  int err;
+
+  if (uv__is_active(handle))
+    return -EINVAL;
+
+  first_run = 0;
+  if (handle->loop->fs_fd == -1) {
+    portfd = port_create();
+    if (portfd == -1)
+      return -errno;
+    handle->loop->fs_fd = portfd;
+    first_run = 1;
+  }
+
+  uv__handle_start(handle);
+  handle->path = uv__strdup(path);
+  handle->fd = PORT_UNUSED;
+  handle->cb = cb;
+
+  memset(&handle->fo, 0, sizeof handle->fo);
+  handle->fo.fo_name = handle->path;
+  err = uv__fs_event_rearm(handle);
+  if (err != 0)
+    return err;
+
+  if (first_run) {
+    uv__io_init(&handle->loop->fs_event_watcher, uv__fs_event_read, portfd);
+    uv__io_start(handle->loop, &handle->loop->fs_event_watcher, POLLIN);
+  }
+
+  return 0;
+}
+
+
+int uv_fs_event_stop(uv_fs_event_t* handle) {
+  if (!uv__is_active(handle))
+    return 0;
+
+  if (handle->fd == PORT_FIRED || handle->fd == PORT_LOADED) {
+    port_dissociate(handle->loop->fs_fd,
+                    PORT_SOURCE_FILE,
+                    (uintptr_t) &handle->fo);
+  }
+
+  handle->fd = PORT_DELETED;
+  uv__free(handle->path);
+  handle->path = NULL;
+  handle->fo.fo_name = NULL;
+  uv__handle_stop(handle);
+
+  return 0;
+}
+
+void uv__fs_event_close(uv_fs_event_t* handle) {
+  uv_fs_event_stop(handle);
+}
+
+#else /* !defined(PORT_SOURCE_FILE) */
+
+int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) {
+  return -ENOSYS;
+}
+
+
+int uv_fs_event_start(uv_fs_event_t* handle,
+                      uv_fs_event_cb cb,
+                      const char* filename,
+                      unsigned int flags) {
+  return -ENOSYS;
+}
+
+
+int uv_fs_event_stop(uv_fs_event_t* handle) {
+  return -ENOSYS;
+}
+
+
+void uv__fs_event_close(uv_fs_event_t* handle) {
+  UNREACHABLE();
+}
+
+#endif /* defined(PORT_SOURCE_FILE) */
+
+
+char** uv_setup_args(int argc, char** argv) {
+  return argv;
+}
+
+
+int uv_set_process_title(const char* title) {
+  return 0;
+}
+
+
+int uv_get_process_title(char* buffer, size_t size) {
+  if (buffer == NULL || size == 0)
+    return -EINVAL;
+
+  buffer[0] = '\0';
+  return 0;
+}
+
+
+int uv_resident_set_memory(size_t* rss) {
+  psinfo_t psinfo;
+  int err;
+  int fd;
+
+  fd = open("/proc/self/psinfo", O_RDONLY);
+  if (fd == -1)
+    return -errno;
+
+  /* FIXME(bnoordhuis) Handle EINTR. */
+  err = -EINVAL;
+  if (read(fd, &psinfo, sizeof(psinfo)) == sizeof(psinfo)) {
+    *rss = (size_t)psinfo.pr_rssize * 1024;
+    err = 0;
+  }
+  uv__close(fd);
+
+  return err;
+}
+
+
+int uv_uptime(double* uptime) {
+  kstat_ctl_t   *kc;
+  kstat_t       *ksp;
+  kstat_named_t *knp;
+
+  long hz = sysconf(_SC_CLK_TCK);
+
+  kc = kstat_open();
+  if (kc == NULL)
+    return -EPERM;
+
+  ksp = kstat_lookup(kc, (char*) "unix", 0, (char*) "system_misc");
+  if (kstat_read(kc, ksp, NULL) == -1) {
+    *uptime = -1;
+  } else {
+    knp = (kstat_named_t*)  kstat_data_lookup(ksp, (char*) "clk_intr");
+    *uptime = knp->value.ul / hz;
+  }
+  kstat_close(kc);
+
+  return 0;
+}
+
+
+int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
+  int           lookup_instance;
+  kstat_ctl_t   *kc;
+  kstat_t       *ksp;
+  kstat_named_t *knp;
+  uv_cpu_info_t* cpu_info;
+
+  kc = kstat_open();
+  if (kc == NULL)
+    return -EPERM;
+
+  /* Get count of cpus */
+  lookup_instance = 0;
+  while ((ksp = kstat_lookup(kc, (char*) "cpu_info", lookup_instance, NULL))) {
+    lookup_instance++;
+  }
+
+  *cpu_infos = uv__malloc(lookup_instance * sizeof(**cpu_infos));
+  if (!(*cpu_infos)) {
+    kstat_close(kc);
+    return -ENOMEM;
+  }
+
+  *count = lookup_instance;
+
+  cpu_info = *cpu_infos;
+  lookup_instance = 0;
+  while ((ksp = kstat_lookup(kc, (char*) "cpu_info", lookup_instance, NULL))) {
+    if (kstat_read(kc, ksp, NULL) == -1) {
+      cpu_info->speed = 0;
+      cpu_info->model = NULL;
+    } else {
+      knp = kstat_data_lookup(ksp, (char*) "clock_MHz");
+      assert(knp->data_type == KSTAT_DATA_INT32 ||
+             knp->data_type == KSTAT_DATA_INT64);
+      cpu_info->speed = (knp->data_type == KSTAT_DATA_INT32) ? knp->value.i32
+                                                             : knp->value.i64;
+
+      knp = kstat_data_lookup(ksp, (char*) "brand");
+      assert(knp->data_type == KSTAT_DATA_STRING);
+      cpu_info->model = uv__strdup(KSTAT_NAMED_STR_PTR(knp));
+    }
+
+    lookup_instance++;
+    cpu_info++;
+  }
+
+  cpu_info = *cpu_infos;
+  lookup_instance = 0;
+  for (;;) {
+    ksp = kstat_lookup(kc, (char*) "cpu", lookup_instance, (char*) "sys");
+
+    if (ksp == NULL)
+      break;
+
+    if (kstat_read(kc, ksp, NULL) == -1) {
+      cpu_info->cpu_times.user = 0;
+      cpu_info->cpu_times.nice = 0;
+      cpu_info->cpu_times.sys = 0;
+      cpu_info->cpu_times.idle = 0;
+      cpu_info->cpu_times.irq = 0;
+    } else {
+      knp = kstat_data_lookup(ksp, (char*) "cpu_ticks_user");
+      assert(knp->data_type == KSTAT_DATA_UINT64);
+      cpu_info->cpu_times.user = knp->value.ui64;
+
+      knp = kstat_data_lookup(ksp, (char*) "cpu_ticks_kernel");
+      assert(knp->data_type == KSTAT_DATA_UINT64);
+      cpu_info->cpu_times.sys = knp->value.ui64;
+
+      knp = kstat_data_lookup(ksp, (char*) "cpu_ticks_idle");
+      assert(knp->data_type == KSTAT_DATA_UINT64);
+      cpu_info->cpu_times.idle = knp->value.ui64;
+
+      knp = kstat_data_lookup(ksp, (char*) "intr");
+      assert(knp->data_type == KSTAT_DATA_UINT64);
+      cpu_info->cpu_times.irq = knp->value.ui64;
+      cpu_info->cpu_times.nice = 0;
+    }
+
+    lookup_instance++;
+    cpu_info++;
+  }
+
+  kstat_close(kc);
+
+  return 0;
+}
+
+
+void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
+  int i;
+
+  for (i = 0; i < count; i++) {
+    uv__free(cpu_infos[i].model);
+  }
+
+  uv__free(cpu_infos);
+}
+
+/*
+ * Inspired By:
+ * https://blogs.oracle.com/paulie/entry/retrieving_mac_address_in_solaris
+ * http://www.pauliesworld.org/project/getmac.c
+ */
+static int uv__set_phys_addr(uv_interface_address_t* address,
+                             struct ifaddrs* ent) {
+
+  struct sockaddr_dl* sa_addr;
+  int sockfd;
+  int i;
+  struct arpreq arpreq;
+
+  /* This appears to only work as root */
+  sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
+  memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
+  for (i = 0; i < sizeof(address->phys_addr); i++) {
+    if (address->phys_addr[i] != 0)
+      return 0;
+  }
+  memset(&arpreq, 0, sizeof(arpreq));
+  if (address->address.address4.sin_family == AF_INET) {
+    struct sockaddr_in* sin = ((struct sockaddr_in*)&arpreq.arp_pa);
+    sin->sin_addr.s_addr = address->address.address4.sin_addr.s_addr;
+  } else if (address->address.address4.sin_family == AF_INET6) {
+    struct sockaddr_in6* sin = ((struct sockaddr_in6*)&arpreq.arp_pa);
+    memcpy(sin->sin6_addr.s6_addr,
+           address->address.address6.sin6_addr.s6_addr,
+           sizeof(address->address.address6.sin6_addr.s6_addr));
+  } else {
+    return 0;
+  }
+
+  sockfd = socket(AF_INET, SOCK_DGRAM, 0);
+  if (sockfd < 0)
+    return -errno;
+
+  if (ioctl(sockfd, SIOCGARP, (char*)&arpreq) == -1) {
+    uv__close(sockfd);
+    return -errno;
+  }
+  memcpy(address->phys_addr, arpreq.arp_ha.sa_data, sizeof(address->phys_addr));
+  uv__close(sockfd);
+  return 0;
+}
+
+int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
+#ifdef SUNOS_NO_IFADDRS
+  return -ENOSYS;
+#else
+  uv_interface_address_t* address;
+  struct ifaddrs* addrs;
+  struct ifaddrs* ent;
+  int i;
+
+  if (getifaddrs(&addrs))
+    return -errno;
+
+  *count = 0;
+
+  /* Count the number of interfaces */
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
+        (ent->ifa_addr == NULL) ||
+        (ent->ifa_addr->sa_family == PF_PACKET)) {
+      continue;
+    }
+
+    (*count)++;
+  }
+
+  *addresses = uv__malloc(*count * sizeof(**addresses));
+  if (!(*addresses)) {
+    freeifaddrs(addrs);
+    return -ENOMEM;
+  }
+
+  address = *addresses;
+
+  for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
+    if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
+      continue;
+
+    if (ent->ifa_addr == NULL)
+      continue;
+
+    address->name = uv__strdup(ent->ifa_name);
+
+    if (ent->ifa_addr->sa_family == AF_INET6) {
+      address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
+    } else {
+      address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
+    }
+
+    if (ent->ifa_netmask->sa_family == AF_INET6) {
+      address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
+    } else {
+      address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
+    }
+
+    address->is_internal = !!((ent->ifa_flags & IFF_PRIVATE) ||
+                           (ent->ifa_flags & IFF_LOOPBACK));
+
+    uv__set_phys_addr(address, ent);
+    address++;
+  }
+
+  freeifaddrs(addrs);
+
+  return 0;
+#endif  /* SUNOS_NO_IFADDRS */
+}
+
+
+void uv_free_interface_addresses(uv_interface_address_t* addresses,
+  int count) {
+  int i;
+
+  for (i = 0; i < count; i++) {
+    uv__free(addresses[i].name);
+  }
+
+  uv__free(addresses);
+}
diff --git a/deps/libtuv/src/unix/tcp.c b/deps/libtuv/src/unix/tcp.c
new file mode 100644 (file)
index 0000000..c423dcb
--- /dev/null
@@ -0,0 +1,395 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <assert.h>
+#include <errno.h>
+
+
+static int maybe_new_socket(uv_tcp_t* handle, int domain, int flags) {
+  int sockfd;
+  int err;
+
+  if (domain == AF_UNSPEC || uv__stream_fd(handle) != -1) {
+    handle->flags |= flags;
+    return 0;
+  }
+
+  err = uv__socket(domain, SOCK_STREAM, 0);
+  if (err < 0)
+    return err;
+  sockfd = err;
+
+  err = uv__stream_open((uv_stream_t*) handle, sockfd, flags);
+  if (err) {
+    uv__close(sockfd);
+    return err;
+  }
+
+  return 0;
+}
+
+
+int uv_tcp_init_ex(uv_loop_t* loop, uv_tcp_t* tcp, unsigned int flags) {
+  int domain;
+
+  /* Use the lower 8 bits for the domain */
+  domain = flags & 0xFF;
+  if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC)
+    return -EINVAL;
+
+  if (flags & ~0xFF)
+    return -EINVAL;
+
+  uv__stream_init(loop, (uv_stream_t*)tcp, UV_TCP);
+
+  /* If anything fails beyond this point we need to remove the handle from
+   * the handle queue, since it was added by uv__handle_init in uv_stream_init.
+   */
+
+  if (domain != AF_UNSPEC) {
+    int err = maybe_new_socket(tcp, domain, 0);
+    if (err) {
+      QUEUE_REMOVE(&tcp->handle_queue);
+      return err;
+    }
+  }
+
+  return 0;
+}
+
+
+int uv_tcp_init(uv_loop_t* loop, uv_tcp_t* tcp) {
+  return uv_tcp_init_ex(loop, tcp, AF_UNSPEC);
+}
+
+
+int uv__tcp_bind(uv_tcp_t* tcp,
+                 const struct sockaddr* addr,
+                 unsigned int addrlen,
+                 unsigned int flags) {
+  int err;
+  int on;
+
+  /* Cannot set IPv6-only mode on non-IPv6 socket. */
+  if ((flags & UV_TCP_IPV6ONLY) && addr->sa_family != AF_INET6)
+    return -EINVAL;
+
+  err = maybe_new_socket(tcp,
+                         addr->sa_family,
+                         UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+  if (err)
+    return err;
+
+  on = 1;
+  if (setsockopt(tcp->io_watcher.fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)))
+    return -errno;
+
+#ifdef IPV6_V6ONLY
+  if (addr->sa_family == AF_INET6) {
+    on = (flags & UV_TCP_IPV6ONLY) != 0;
+    if (setsockopt(tcp->io_watcher.fd,
+                   IPPROTO_IPV6,
+                   IPV6_V6ONLY,
+                   &on,
+                   sizeof on) == -1) {
+#if defined(__MVS__)
+      if (errno == EOPNOTSUPP)
+        return -EINVAL;
+#endif
+      return -errno;
+    }
+  }
+#endif
+
+  errno = 0;
+  if (bind(tcp->io_watcher.fd, addr, addrlen) && errno != EADDRINUSE) {
+    if (errno == EAFNOSUPPORT)
+      /* OSX, other BSDs and SunoS fail with EAFNOSUPPORT when binding a
+       * socket created with AF_INET to an AF_INET6 address or vice versa. */
+      return -EINVAL;
+    return -errno;
+  }
+  tcp->delayed_error = -errno;
+
+  tcp->flags |= UV_HANDLE_BOUND;
+  if (addr->sa_family == AF_INET6)
+    tcp->flags |= UV_HANDLE_IPV6;
+
+  return 0;
+}
+
+
+int uv__tcp_connect(uv_connect_t* req,
+                    uv_tcp_t* handle,
+                    const struct sockaddr* addr,
+                    unsigned int addrlen,
+                    uv_connect_cb cb) {
+  int err;
+  int r;
+
+  assert(handle->type == UV_TCP);
+
+  if (handle->connect_req != NULL)
+    return -EALREADY;  /* FIXME(bnoordhuis) -EINVAL or maybe -EBUSY. */
+
+  err = maybe_new_socket(handle,
+                         addr->sa_family,
+                         UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+  if (err)
+    return err;
+
+  handle->delayed_error = 0;
+
+  do {
+    errno = 0;
+    r = connect(uv__stream_fd(handle), addr, addrlen);
+  } while (r == -1 && errno == EINTR);
+
+  /* We not only check the return value, but also check the errno != 0.
+   * Because in rare cases connect() will return -1 but the errno
+   * is 0 (for example, on Android 4.3, OnePlus phone A0001_12_150227)
+   * and actually the tcp three-way handshake is completed.
+   */
+  if (r == -1 && errno != 0) {
+    if (errno == EINPROGRESS)
+      ; /* not an error */
+    else if (errno == ECONNREFUSED)
+    /* If we get a ECONNREFUSED wait until the next tick to report the
+     * error. Solaris wants to report immediately--other unixes want to
+     * wait.
+     */
+      handle->delayed_error = -errno;
+    else
+      return -errno;
+  }
+
+  uv__req_init(handle->loop, req, UV_CONNECT);
+  req->cb = cb;
+  req->handle = (uv_stream_t*) handle;
+  QUEUE_INIT(&req->queue);
+  handle->connect_req = req;
+
+  uv__io_start(handle->loop, &handle->io_watcher, POLLOUT);
+
+  if (handle->delayed_error)
+    uv__io_feed(handle->loop, &handle->io_watcher);
+
+  return 0;
+}
+
+
+int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock) {
+  int err;
+
+  err = uv__nonblock(sock, 1);
+  if (err)
+    return err;
+
+  return uv__stream_open((uv_stream_t*)handle,
+                         sock,
+                         UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+}
+
+
+int uv_tcp_getsockname(const uv_tcp_t* handle,
+                       struct sockaddr* name,
+                       int* namelen) {
+  socklen_t socklen;
+
+  if (handle->delayed_error)
+    return handle->delayed_error;
+
+  if (uv__stream_fd(handle) < 0)
+    return -EINVAL;  /* FIXME(bnoordhuis) -EBADF */
+
+  /* sizeof(socklen_t) != sizeof(int) on some systems. */
+  socklen = (socklen_t) *namelen;
+
+  if (getsockname(uv__stream_fd(handle), name, &socklen))
+    return -errno;
+
+  *namelen = (int) socklen;
+  return 0;
+}
+
+
+int uv_tcp_getpeername(const uv_tcp_t* handle,
+                       struct sockaddr* name,
+                       int* namelen) {
+  socklen_t socklen;
+
+  if (handle->delayed_error)
+    return handle->delayed_error;
+
+  if (uv__stream_fd(handle) < 0)
+    return -EINVAL;  /* FIXME(bnoordhuis) -EBADF */
+
+  /* sizeof(socklen_t) != sizeof(int) on some systems. */
+  socklen = (socklen_t) *namelen;
+
+  if (getpeername(uv__stream_fd(handle), name, &socklen))
+    return -errno;
+
+  *namelen = (int) socklen;
+  return 0;
+}
+
+
+int uv_tcp_listen(uv_tcp_t* tcp, int backlog, uv_connection_cb cb) {
+  static int single_accept = -1;
+  int err;
+
+  if (tcp->delayed_error)
+    return tcp->delayed_error;
+
+  if (single_accept == -1) {
+    const char* val = getenv("UV_TCP_SINGLE_ACCEPT");
+    single_accept = (val != NULL && atoi(val) != 0);  /* Off by default. */
+  }
+
+  if (single_accept)
+    tcp->flags |= UV_TCP_SINGLE_ACCEPT;
+
+  err = maybe_new_socket(tcp, AF_INET, UV_STREAM_READABLE);
+  if (err)
+    return err;
+
+#ifdef __MVS__
+  /* on zOS the listen call does not bind automatically
+     if the socket is unbound. Hence the manual binding to
+     an arbitrary port is required to be done manually
+  */
+
+  if (!(tcp->flags & UV_HANDLE_BOUND)) {
+    struct sockaddr_storage saddr;
+    socklen_t slen  = sizeof(saddr);
+    memset(&saddr, 0, sizeof(saddr));
+
+    if (getsockname(tcp->io_watcher.fd, (struct sockaddr*) &saddr, &slen))
+      return -errno;
+
+    if (bind(tcp->io_watcher.fd, (struct sockaddr*) &saddr, slen))
+      return -errno;
+
+    tcp->flags |= UV_HANDLE_BOUND;
+  }
+#endif
+
+  if (listen(tcp->io_watcher.fd, backlog))
+    return -errno;
+
+  tcp->connection_cb = cb;
+  tcp->flags |= UV_HANDLE_BOUND;
+
+  /* Start listening for connections. */
+  tcp->io_watcher.cb = uv__server_io;
+  uv__io_start(tcp->loop, &tcp->io_watcher, POLLIN);
+
+  return 0;
+}
+
+
+int uv__tcp_nodelay(int fd, int on) {
+  if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)))
+    return -errno;
+  return 0;
+}
+
+
+int uv__tcp_keepalive(int fd, int on, unsigned int delay) {
+  if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on)))
+    return -errno;
+
+#ifdef TCP_KEEPIDLE
+  if (on && setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &delay, sizeof(delay)))
+    return -errno;
+#endif
+
+  /* Solaris/SmartOS, if you don't support keep-alive,
+   * then don't advertise it in your system headers...
+   */
+  /* FIXME(bnoordhuis) That's possibly because sizeof(delay) should be 1. */
+#if defined(TCP_KEEPALIVE) && !defined(__sun)
+  if (on && setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &delay, sizeof(delay)))
+    return -errno;
+#endif
+
+  return 0;
+}
+
+
+int uv_tcp_nodelay(uv_tcp_t* handle, int on) {
+  int err;
+
+  if (uv__stream_fd(handle) != -1) {
+    err = uv__tcp_nodelay(uv__stream_fd(handle), on);
+    if (err)
+      return err;
+  }
+
+  if (on)
+    handle->flags |= UV_TCP_NODELAY;
+  else
+    handle->flags &= ~UV_TCP_NODELAY;
+
+  return 0;
+}
+
+
+int uv_tcp_keepalive(uv_tcp_t* handle, int on, unsigned int delay) {
+  int err;
+
+  if (uv__stream_fd(handle) != -1) {
+    err =uv__tcp_keepalive(uv__stream_fd(handle), on, delay);
+    if (err)
+      return err;
+  }
+
+  if (on)
+    handle->flags |= UV_TCP_KEEPALIVE;
+  else
+    handle->flags &= ~UV_TCP_KEEPALIVE;
+
+  /* TODO Store delay if uv__stream_fd(handle) == -1 but don't want to enlarge
+   *      uv_tcp_t with an int that's almost never used...
+   */
+
+  return 0;
+}
+
+
+int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable) {
+  if (enable)
+    handle->flags &= ~UV_TCP_SINGLE_ACCEPT;
+  else
+    handle->flags |= UV_TCP_SINGLE_ACCEPT;
+  return 0;
+}
+
+
+void uv__tcp_close(uv_tcp_t* handle) {
+  uv__stream_close((uv_stream_t*)handle);
+}
diff --git a/deps/libtuv/src/unix/thread.c b/deps/libtuv/src/unix/thread.c
new file mode 100644 (file)
index 0000000..31c8cbb
--- /dev/null
@@ -0,0 +1,594 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <pthread.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <sys/time.h>
+#include <unistd.h>  /* getpagesize() */
+
+#include <limits.h>
+
+#ifdef __MVS__
+#include <sys/ipc.h>
+#include <sys/sem.h>
+#endif
+
+#undef NANOSEC
+#define NANOSEC ((uint64_t) 1e9)
+
+
+int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) {
+  int err;
+  pthread_attr_t* attr;
+#if defined(__APPLE__)
+  pthread_attr_t attr_storage;
+  struct rlimit lim;
+#endif
+
+  /* On OSX threads other than the main thread are created with a reduced stack
+   * size by default, adjust it to RLIMIT_STACK.
+   */
+#if defined(__APPLE__)
+  if (getrlimit(RLIMIT_STACK, &lim))
+    abort();
+
+  attr = &attr_storage;
+  if (pthread_attr_init(attr))
+    abort();
+
+  if (lim.rlim_cur != RLIM_INFINITY) {
+    /* pthread_attr_setstacksize() expects page-aligned values. */
+    lim.rlim_cur -= lim.rlim_cur % (rlim_t) getpagesize();
+
+    if (lim.rlim_cur >= PTHREAD_STACK_MIN)
+      if (pthread_attr_setstacksize(attr, lim.rlim_cur))
+        abort();
+  }
+#else
+  attr = NULL;
+#endif
+
+  err = pthread_create(tid, attr, (void*(*)(void*)) entry, arg);
+
+  if (attr != NULL)
+    pthread_attr_destroy(attr);
+
+  return -err;
+}
+
+
+uv_thread_t uv_thread_self(void) {
+  return pthread_self();
+}
+
+int uv_thread_join(uv_thread_t *tid) {
+  return -pthread_join(*tid, NULL);
+}
+
+
+int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2) {
+  return pthread_equal(*t1, *t2);
+}
+
+
+int uv_mutex_init(uv_mutex_t* mutex) {
+#if defined(NDEBUG) || !defined(PTHREAD_MUTEX_ERRORCHECK)
+  return -pthread_mutex_init(mutex, NULL);
+#else
+  pthread_mutexattr_t attr;
+  int err;
+
+  if (pthread_mutexattr_init(&attr))
+    abort();
+
+  if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK))
+    abort();
+
+  err = pthread_mutex_init(mutex, &attr);
+
+  if (pthread_mutexattr_destroy(&attr))
+    abort();
+
+  return -err;
+#endif
+}
+
+
+void uv_mutex_destroy(uv_mutex_t* mutex) {
+  if (pthread_mutex_destroy(mutex))
+    abort();
+}
+
+
+void uv_mutex_lock(uv_mutex_t* mutex) {
+  if (pthread_mutex_lock(mutex))
+    abort();
+}
+
+
+int uv_mutex_trylock(uv_mutex_t* mutex) {
+  int err;
+
+  err = pthread_mutex_trylock(mutex);
+  if (err) {
+    if (err != EBUSY && err != EAGAIN)
+      abort();
+    return -EBUSY;
+  }
+
+  return 0;
+}
+
+
+void uv_mutex_unlock(uv_mutex_t* mutex) {
+  if (pthread_mutex_unlock(mutex))
+    abort();
+}
+
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+
+// No pthread_rwlock_t. Use pthread_mutex_t
+
+int uv_rwlock_init(uv_rwlock_t* rwlock) {
+  return uv_mutex_init(rwlock);
+}
+
+
+void uv_rwlock_destroy(uv_rwlock_t* rwlock) {
+  uv_mutex_destroy(rwlock);
+}
+
+
+void uv_rwlock_rdlock(uv_rwlock_t* rwlock) {
+  uv_mutex_lock(rwlock);
+}
+
+
+int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock) {
+  return uv_mutex_trylock(rwlock);
+}
+
+
+void uv_rwlock_rdunlock(uv_rwlock_t* rwlock) {
+  uv_mutex_unlock(rwlock);
+}
+
+
+void uv_rwlock_wrlock(uv_rwlock_t* rwlock) {
+  uv_mutex_lock(rwlock);
+}
+
+
+int uv_rwlock_trywrlock(uv_rwlock_t* rwlock) {
+  return uv_mutex_trylock(rwlock);
+}
+
+
+void uv_rwlock_wrunlock(uv_rwlock_t* rwlock) {
+  uv_mutex_unlock(rwlock);
+}
+
+#else
+
+int uv_rwlock_init(uv_rwlock_t* rwlock) {
+  return -pthread_rwlock_init(rwlock, NULL);
+}
+
+
+void uv_rwlock_destroy(uv_rwlock_t* rwlock) {
+  if (pthread_rwlock_destroy(rwlock))
+    abort();
+}
+
+
+void uv_rwlock_rdlock(uv_rwlock_t* rwlock) {
+  if (pthread_rwlock_rdlock(rwlock))
+    abort();
+}
+
+
+int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock) {
+  int err;
+
+  err = pthread_rwlock_tryrdlock(rwlock);
+  if (err) {
+    if (err != EBUSY && err != EAGAIN)
+      abort();
+    return -EBUSY;
+  }
+
+  return 0;
+}
+
+
+void uv_rwlock_rdunlock(uv_rwlock_t* rwlock) {
+  if (pthread_rwlock_unlock(rwlock))
+    abort();
+}
+
+
+void uv_rwlock_wrlock(uv_rwlock_t* rwlock) {
+  if (pthread_rwlock_wrlock(rwlock))
+    abort();
+}
+
+
+int uv_rwlock_trywrlock(uv_rwlock_t* rwlock) {
+  int err;
+
+  err = pthread_rwlock_trywrlock(rwlock);
+  if (err) {
+    if (err != EBUSY && err != EAGAIN)
+      abort();
+    return -EBUSY;
+  }
+
+  return 0;
+}
+
+
+void uv_rwlock_wrunlock(uv_rwlock_t* rwlock) {
+  if (pthread_rwlock_unlock(rwlock))
+    abort();
+}
+#endif /* End of !NUTTX */
+
+
+void uv_once(uv_once_t* guard, void (*callback)(void)) {
+  if (pthread_once(guard, callback))
+    abort();
+}
+
+#if defined(__APPLE__) && defined(__MACH__)
+
+int uv_sem_init(uv_sem_t* sem, unsigned int value) {
+  kern_return_t err;
+
+  err = semaphore_create(mach_task_self(), sem, SYNC_POLICY_FIFO, value);
+  if (err == KERN_SUCCESS)
+    return 0;
+  if (err == KERN_INVALID_ARGUMENT)
+    return -EINVAL;
+  if (err == KERN_RESOURCE_SHORTAGE)
+    return -ENOMEM;
+
+  abort();
+  return -EINVAL;  /* Satisfy the compiler. */
+}
+
+
+void uv_sem_destroy(uv_sem_t* sem) {
+  if (semaphore_destroy(mach_task_self(), *sem))
+    abort();
+}
+
+
+void uv_sem_post(uv_sem_t* sem) {
+  if (semaphore_signal(*sem))
+    abort();
+}
+
+
+void uv_sem_wait(uv_sem_t* sem) {
+  int r;
+
+  do
+    r = semaphore_wait(*sem);
+  while (r == KERN_ABORTED);
+
+  if (r != KERN_SUCCESS)
+    abort();
+}
+
+
+int uv_sem_trywait(uv_sem_t* sem) {
+  mach_timespec_t interval;
+  kern_return_t err;
+
+  interval.tv_sec = 0;
+  interval.tv_nsec = 0;
+
+  err = semaphore_timedwait(*sem, interval);
+  if (err == KERN_SUCCESS)
+    return 0;
+  if (err == KERN_OPERATION_TIMED_OUT)
+    return -EAGAIN;
+
+  abort();
+  return -EINVAL;  /* Satisfy the compiler. */
+}
+
+#elif defined(__MVS__)
+
+int uv_sem_init(uv_sem_t* sem, unsigned int value) {
+  uv_sem_t semid;
+  struct sembuf buf;
+  int err;
+
+  buf.sem_num = 0;
+  buf.sem_op = value;
+  buf.sem_flg = 0;
+
+  semid = semget(IPC_PRIVATE, 1, S_IRUSR | S_IWUSR);
+  if (semid == -1)
+    return -errno;
+
+  if (-1 == semop(semid, &buf, 1)) {
+    err = errno;
+    if (-1 == semctl(*sem, 0, IPC_RMID))
+      abort();
+    return -err;
+  }
+
+  *sem = semid;
+  return 0;
+}
+
+void uv_sem_destroy(uv_sem_t* sem) {
+  if (-1 == semctl(*sem, 0, IPC_RMID))
+    abort();
+}
+
+void uv_sem_post(uv_sem_t* sem) {
+  struct sembuf buf;
+
+  buf.sem_num = 0;
+  buf.sem_op = 1;
+  buf.sem_flg = 0;
+
+  if (-1 == semop(*sem, &buf, 1))
+    abort();
+}
+
+void uv_sem_wait(uv_sem_t* sem) {
+  struct sembuf buf;
+  int op_status;
+
+  buf.sem_num = 0;
+  buf.sem_op = -1;
+  buf.sem_flg = 0;
+
+  do
+    op_status = semop(*sem, &buf, 1);
+  while (op_status == -1 && errno == EINTR);
+
+  if (op_status)
+    abort();
+}
+
+int uv_sem_trywait(uv_sem_t* sem) {
+  struct sembuf buf;
+  int op_status;
+
+  buf.sem_num = 0;
+  buf.sem_op = -1;
+  buf.sem_flg = IPC_NOWAIT;
+
+  do
+    op_status = semop(*sem, &buf, 1);
+  while (op_status == -1 && errno == EINTR);
+
+  if (op_status) {
+    if (errno == EAGAIN)
+      return -EAGAIN;
+    abort();
+  }
+
+  return 0;
+}
+
+#else /* !(defined(__APPLE__) && defined(__MACH__)) */
+
+int uv_sem_init(uv_sem_t* sem, unsigned int value) {
+  if (sem_init(sem, 0, value))
+    return -errno;
+  return 0;
+}
+
+
+void uv_sem_destroy(uv_sem_t* sem) {
+  if (sem_destroy(sem))
+    abort();
+}
+
+
+void uv_sem_post(uv_sem_t* sem) {
+  if (sem_post(sem))
+    abort();
+}
+
+
+void uv_sem_wait(uv_sem_t* sem) {
+  int r;
+
+  do
+    r = sem_wait(sem);
+  while (r == -1 && errno == EINTR);
+
+  if (r)
+    abort();
+}
+
+
+int uv_sem_trywait(uv_sem_t* sem) {
+  int r;
+
+  do
+    r = sem_trywait(sem);
+  while (r == -1 && errno == EINTR);
+
+  if (r) {
+    if (errno == EAGAIN)
+      return -EAGAIN;
+    abort();
+  }
+
+  return 0;
+}
+
+#endif /* defined(__APPLE__) && defined(__MACH__) */
+
+
+#if defined(__APPLE__) && defined(__MACH__) || defined(__MVS__)
+
+int uv_cond_init(uv_cond_t* cond) {
+  return -pthread_cond_init(cond, NULL);
+}
+
+#else /* !(defined(__APPLE__) && defined(__MACH__)) */
+
+int uv_cond_init(uv_cond_t* cond) {
+  pthread_condattr_t attr;
+  int err;
+
+  err = pthread_condattr_init(&attr);
+  if (err)
+    return -err;
+
+#if !(defined(__ANDROID__) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)) \
+    && !(defined(__NUTTX__) || defined(__TIZENRT__))
+  err = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
+  if (err)
+    goto error2;
+#endif
+
+  err = pthread_cond_init(cond, &attr);
+  if (err)
+    goto error2;
+
+  err = pthread_condattr_destroy(&attr);
+  if (err)
+    goto error;
+
+  return 0;
+
+error:
+  pthread_cond_destroy(cond);
+error2:
+  pthread_condattr_destroy(&attr);
+  return -err;
+}
+
+#endif /* defined(__APPLE__) && defined(__MACH__) */
+
+void uv_cond_destroy(uv_cond_t* cond) {
+#if defined(__APPLE__) && defined(__MACH__)
+  /* It has been reported that destroying condition variables that have been
+   * signalled but not waited on can sometimes result in application crashes.
+   * See https://codereview.chromium.org/1323293005.
+   */
+  pthread_mutex_t mutex;
+  struct timespec ts;
+  int err;
+
+  if (pthread_mutex_init(&mutex, NULL))
+    abort();
+
+  if (pthread_mutex_lock(&mutex))
+    abort();
+
+  ts.tv_sec = 0;
+  ts.tv_nsec = 1;
+
+  err = pthread_cond_timedwait_relative_np(cond, &mutex, &ts);
+  if (err != 0 && err != ETIMEDOUT)
+    abort();
+
+  if (pthread_mutex_unlock(&mutex))
+    abort();
+
+  if (pthread_mutex_destroy(&mutex))
+    abort();
+#endif /* defined(__APPLE__) && defined(__MACH__) */
+
+  if (pthread_cond_destroy(cond))
+    abort();
+}
+
+void uv_cond_signal(uv_cond_t* cond) {
+  if (pthread_cond_signal(cond))
+    abort();
+}
+
+void uv_cond_broadcast(uv_cond_t* cond) {
+  if (pthread_cond_broadcast(cond))
+    abort();
+}
+
+void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex) {
+  if (pthread_cond_wait(cond, mutex))
+    abort();
+}
+
+
+int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) {
+  int r;
+  struct timespec ts;
+
+#if defined(__APPLE__) && defined(__MACH__)
+  ts.tv_sec = timeout / NANOSEC;
+  ts.tv_nsec = timeout % NANOSEC;
+  r = pthread_cond_timedwait_relative_np(cond, mutex, &ts);
+#else
+  timeout += uv__hrtime(UV_CLOCK_PRECISE);
+  ts.tv_sec = timeout / NANOSEC;
+  ts.tv_nsec = timeout % NANOSEC;
+#if defined(__ANDROID__) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)
+  /*
+   * The bionic pthread implementation doesn't support CLOCK_MONOTONIC,
+   * but has this alternative function instead.
+   */
+  r = pthread_cond_timedwait_monotonic_np(cond, mutex, &ts);
+#else
+  r = pthread_cond_timedwait(cond, mutex, &ts);
+#endif /* __ANDROID__ */
+#endif
+
+
+  if (r == 0)
+    return 0;
+
+  if (r == ETIMEDOUT)
+    return -ETIMEDOUT;
+
+  abort();
+  return -EINVAL;  /* Satisfy the compiler. */
+}
diff --git a/deps/libtuv/src/unix/timer.c b/deps/libtuv/src/unix/timer.c
new file mode 100644 (file)
index 0000000..c8ee07e
--- /dev/null
@@ -0,0 +1,210 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+#include "heap-inl.h"
+
+#include <assert.h>
+#include <limits.h>
+
+
+static int timer_less_than(const struct heap_node* ha,
+                           const struct heap_node* hb) {
+  const uv_timer_t* a;
+  const uv_timer_t* b;
+
+  a = container_of(ha, uv_timer_t, heap_node);
+  b = container_of(hb, uv_timer_t, heap_node);
+
+  if (a->timeout < b->timeout)
+    return 1;
+  if (b->timeout < a->timeout)
+    return 0;
+
+#ifndef TUV_ENABLE_MEMORY_CONSTRAINTS
+  /* Compare start_id when both have the same timeout. start_id is
+   * allocated with loop->timer_counter in uv_timer_start().
+   */
+  if (a->start_id < b->start_id)
+    return 1;
+  if (b->start_id < a->start_id)
+    return 0;
+#endif
+
+  return 0;
+}
+
+
+int uv_timer_init(uv_loop_t* loop, uv_timer_t* handle) {
+  uv__handle_init(loop, (uv_handle_t*)handle, UV_TIMER);
+  handle->timer_cb = NULL;
+  handle->repeat = 0;
+  return 0;
+}
+
+void tuv_timer_deinit(uv_loop_t* loop, uv_timer_t* handle) {
+  QUEUE* q;
+  uv_handle_t* h;
+  uv_handle_t* ht;
+  ht = (uv_handle_t*)handle;
+
+  QUEUE_FOREACH(q, &loop->handle_queue) {
+    h = QUEUE_DATA(q, uv_handle_t, handle_queue);
+    if (h == ht) {
+      tuv__handle_deinit(ht);
+      break;
+    }
+  }
+}
+
+int uv_timer_start(uv_timer_t* handle,
+                   uv_timer_cb cb,
+                   uint64_t timeout,
+                   uint64_t repeat) {
+  uint64_t clamped_timeout;
+
+  if (cb == NULL)
+    return -EINVAL;
+
+  if (uv__is_active(handle))
+    uv_timer_stop(handle);
+
+  clamped_timeout = handle->loop->time + timeout;
+  if (clamped_timeout < timeout)
+    clamped_timeout = (uint64_t) -1;
+
+  handle->timer_cb = cb;
+  handle->timeout = clamped_timeout;
+  handle->repeat = repeat;
+#ifndef TUV_ENABLE_MEMORY_CONSTRAINTS
+  /* start_id is the second index to be compared in uv__timer_cmp() */
+  handle->start_id = handle->loop->timer_counter++;
+#endif
+
+  heap_insert((struct heap*) &handle->loop->timer_heap,
+              (struct heap_node*) &handle->heap_node,
+              timer_less_than);
+  uv__handle_start(handle);
+
+  return 0;
+}
+
+
+int uv_timer_stop(uv_timer_t* handle) {
+  if (!uv__is_active(handle))
+    return 0;
+
+#ifdef TUV_ENABLE_MEMORY_CONSTRAINTS
+  heap_remove((struct heap*) &handle->loop->timer_heap,
+              (struct heap_node*) &handle->heap_node);
+#else /* original libuv code */
+  heap_remove((struct heap*) &handle->loop->timer_heap,
+              (struct heap_node*) &handle->heap_node,
+              timer_less_than);
+#endif
+  uv__handle_stop(handle);
+
+  return 0;
+}
+
+
+int uv_timer_again(uv_timer_t* handle) {
+  if (handle->timer_cb == NULL)
+    return -EINVAL;
+
+  if (handle->repeat) {
+    uv_timer_stop(handle);
+    uv_timer_start(handle, handle->timer_cb, handle->repeat, handle->repeat);
+  }
+
+  return 0;
+}
+
+
+void uv_timer_set_repeat(uv_timer_t* handle, uint64_t repeat) {
+  handle->repeat = repeat;
+}
+
+
+uint64_t uv_timer_get_repeat(const uv_timer_t* handle) {
+  return handle->repeat;
+}
+
+
+int uv__next_timeout(const uv_loop_t* loop) {
+  const struct heap_node* heap_node;
+  const uv_timer_t* handle;
+  uint64_t diff;
+
+  heap_node = heap_min((const struct heap*) &loop->timer_heap);
+  if (heap_node == NULL)
+    return -1; /* block indefinitely */
+
+  handle = container_of(heap_node, uv_timer_t, heap_node);
+  if (handle->timeout <= loop->time)
+    return 0;
+
+  diff = handle->timeout - loop->time;
+  if (diff > INT_MAX)
+    diff = INT_MAX;
+
+  return diff;
+}
+
+
+void uv__run_timers(uv_loop_t* loop) {
+  struct heap_node* heap_node;
+  uv_timer_t* handle;
+
+  for (;;) {
+    heap_node = heap_min((struct heap*) &loop->timer_heap);
+    if (heap_node == NULL)
+      break;
+
+    handle = container_of(heap_node, uv_timer_t, heap_node);
+    if (handle->timeout > loop->time)
+      break;
+
+    uv_timer_stop(handle);
+    uv_timer_again(handle);
+    handle->timer_cb(handle);
+  }
+}
+
+
+void uv__timer_close(uv_timer_t* handle) {
+  uv_timer_stop(handle);
+}
diff --git a/deps/libtuv/src/unix/tizenrt.c b/deps/libtuv/src/unix/tizenrt.c
new file mode 100644 (file)
index 0000000..6eb2eb7
--- /dev/null
@@ -0,0 +1,273 @@
+/* Copyright 2017-present 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <string.h>
+
+#include <uv.h>
+#include "unix/internal.h"
+
+//-----------------------------------------------------------------------------
+// loop
+int uv__platform_loop_init(uv_loop_t* loop) {
+  loop->npollfds = 0;
+  return 0;
+}
+
+void uv__platform_loop_delete(uv_loop_t* loop) {
+  loop->npollfds = 0;
+}
+
+
+//-----------------------------------------------------------------------------
+
+void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
+  int i;
+  int nfd = loop->npollfds;
+  for (i = 0; i < nfd; ++i) {
+    struct pollfd* pfd = &loop->pollfds[i];
+    if (fd == pfd->fd) {
+      pfd->fd = -1;
+    }
+  }
+}
+
+//-----------------------------------------------------------------------------
+
+/* should not clear handle structure with memset as
+ * *data can be set before calling init function */
+
+//-----------------------------------------------------------------------------
+
+ssize_t readv(int fd, const struct iovec* iiovec, int count) {
+  ssize_t result = 0;
+  ssize_t total = 0;
+  int idx;
+
+  for (idx = 0; idx < count; ++idx) {
+    result = read(fd, iiovec[idx].iov_base, iiovec[idx].iov_len);
+    if (result < 0) {
+      return result;
+    } else {
+      total += result;
+    }
+  }
+  return total;
+}
+
+
+ssize_t writev(int fd, const struct iovec* iiovec, int count) {
+  ssize_t result = 0;
+  ssize_t total = 0;
+  int idx;
+
+  for (idx = 0; idx < count; ++idx) {
+    result = write(fd, iiovec[idx].iov_base, iiovec[idx].iov_len);
+    if (result < 0) {
+      return result;
+    } else {
+      total += result;
+    }
+  }
+  return total;
+}
+
+// From nuttx_clock.c
+uint64_t uv__hrtime(uv_clocktype_t type) {
+  struct timespec ts;
+  clock_gettime(CLOCK_MONOTONIC, &ts);
+  uint64_t ret = (((uint64_t) ts.tv_sec) * ((uint64_t) 1e9) +
+                   (uint64_t) ts.tv_nsec);
+  return ret;
+}
+
+// From nuttx_io.c
+static void uv__add_pollfd(uv_loop_t* loop, struct pollfd* pe) {
+  int i;
+  bool exist = false;
+  int free_idx = -1;
+  for (i = 0; i < loop->npollfds; ++i) {
+    struct pollfd* cur = &loop->pollfds[i];
+    if (cur->fd == pe->fd) {
+      cur->events = pe->events;
+      exist = true;
+      break;
+    }
+    if (cur->fd == -1) {
+      free_idx = i;
+    }
+  }
+  if (!exist) {
+    if (free_idx == -1) {
+      free_idx = loop->npollfds++;
+      if (free_idx >= TUV_POLL_EVENTS_SIZE)
+      {
+        TDLOG("uv__add_pollfd abort, because loop->npollfds (%d) reached maximum size", free_idx);
+        ABORT();
+      }
+    }
+    struct pollfd* cur = &loop->pollfds[free_idx];
+
+    cur->fd = pe->fd;
+    cur->events = pe->events;
+    cur->revents = 0;
+    cur->sem = 0;
+    cur->priv = 0;
+  }
+}
+
+
+static void uv__rem_pollfd(uv_loop_t* loop, struct pollfd* pe) {
+  int i = 0;
+  while (i < loop->npollfds) {
+    struct pollfd* cur = &loop->pollfds[i];
+    if (cur->fd == pe->fd) {
+      *cur = loop->pollfds[--loop->npollfds];
+    } else {
+      ++i;
+    }
+  }
+}
+
+
+void uv__io_poll(uv_loop_t* loop, int timeout) {
+  struct pollfd pfd;
+  struct pollfd* pe;
+  QUEUE* q;
+  uv__io_t* w;
+  uint64_t base;
+  uint64_t diff;
+  int nevents;
+  int count;
+  int nfd;
+  int i;
+
+  if (loop->nfds == 0) {
+    assert(QUEUE_EMPTY(&loop->watcher_queue));
+    return;
+  }
+
+  while (!QUEUE_EMPTY(&loop->watcher_queue)) {
+    q = QUEUE_HEAD(&loop->watcher_queue);
+    QUEUE_REMOVE(q);
+    QUEUE_INIT(q);
+
+    w = QUEUE_DATA(q, uv__io_t, watcher_queue);
+    assert(w->pevents != 0);
+    assert(w->fd >= 0);
+    assert(w->fd < (int)loop->nwatchers);
+
+    pfd.fd = w->fd;
+    pfd.events = w->pevents;
+    uv__add_pollfd(loop, &pfd);
+
+    w->events = w->pevents;
+  }
+
+  assert(timeout >= -1);
+  base = loop->time;
+  count = 5;
+
+  for (;;) {
+    nfd = poll(loop->pollfds, loop->npollfds, timeout);
+
+    SAVE_ERRNO(uv__update_time(loop));
+
+    if (nfd == 0) {
+      assert(timeout != -1);
+      return;
+    }
+
+    if (nfd == -1) {
+      int err = get_errno();
+      if (err == EAGAIN ) {
+        set_errno(0);
+      }
+      else if ( err != EINTR) {
+        TDLOG("uv__io_poll abort for errno(%d)", err);
+        ABORT();
+      }
+      if (timeout == -1) {
+        continue;
+      }
+      if (timeout == 0) {
+        return;
+      }
+      goto update_timeout;
+    }
+
+    nevents = 0;
+
+    for (i = 0; i < loop->npollfds; ++i) {
+      pe = &loop->pollfds[i];
+
+      if (pe->fd >= 0) {
+        if (pe->revents & (POLLIN | POLLOUT | POLLHUP)) {
+          w = loop->watchers[pe->fd];
+          if (w == NULL) {
+            uv__rem_pollfd(loop, pe);
+          } else {
+            w->cb(loop, w, pe->revents);
+            ++nevents;
+          }
+        }
+      }
+    }
+
+    if (nevents != 0) {
+      if (--count != 0) {
+        timeout = 0;
+        continue;
+      }
+      return;
+    }
+    if (timeout == 0) {
+      return;
+    }
+    if (timeout == -1) {
+      continue;
+    }
+update_timeout:
+    assert(timeout > 0);
+
+    diff = loop->time - base;
+    if (diff >= (uint64_t)timeout) {
+      return;
+    }
+    timeout -= diff;
+  }
+}
+
diff --git a/deps/libtuv/src/unix/tty.c b/deps/libtuv/src/unix/tty.c
new file mode 100644 (file)
index 0000000..b2d37f4
--- /dev/null
@@ -0,0 +1,336 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+#include "spinlock.h"
+
+#include <stdlib.h>
+#include <assert.h>
+#include <unistd.h>
+#include <termios.h>
+#include <errno.h>
+#include <sys/ioctl.h>
+
+#if defined(__MVS__) && !defined(IMAXBEL)
+#define IMAXBEL 0
+#endif
+
+static int orig_termios_fd = -1;
+static struct termios orig_termios;
+static uv_spinlock_t termios_spinlock = UV_SPINLOCK_INITIALIZER;
+
+static int uv__tty_is_slave(const int fd) {
+  int result;
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+  int dummy;
+
+  result = ioctl(fd, TIOCGPTN, &dummy) != 0;
+#elif defined(__APPLE__)
+  char dummy[256];
+
+  result = ioctl(fd, TIOCPTYGNAME, &dummy) != 0;
+#else
+  /* Fallback to ptsname
+   */
+  result = ptsname(fd) == NULL;
+#endif
+  return result;
+}
+
+int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) {
+  uv_handle_type type;
+  int flags;
+  int newfd;
+  int r;
+  int saved_flags;
+  char path[256];
+
+  /* File descriptors that refer to files cannot be monitored with epoll.
+   * That restriction also applies to character devices like /dev/random
+   * (but obviously not /dev/tty.)
+   */
+  type = uv_guess_handle(fd);
+  if (type == UV_FILE || type == UV_UNKNOWN_HANDLE)
+    return -EINVAL;
+
+  flags = 0;
+  newfd = -1;
+
+  /* Reopen the file descriptor when it refers to a tty. This lets us put the
+   * tty in non-blocking mode without affecting other processes that share it
+   * with us.
+   *
+   * Example: `node | cat` - if we put our fd 0 in non-blocking mode, it also
+   * affects fd 1 of `cat` because both file descriptors refer to the same
+   * struct file in the kernel. When we reopen our fd 0, it points to a
+   * different struct file, hence changing its properties doesn't affect
+   * other processes.
+   */
+  if (type == UV_TTY) {
+    /* Reopening a pty in master mode won't work either because the reopened
+     * pty will be in slave mode (*BSD) or reopening will allocate a new
+     * master/slave pair (Linux). Therefore check if the fd points to a
+     * slave device.
+     */
+    if (uv__tty_is_slave(fd) && ttyname_r(fd, path, sizeof(path)) == 0)
+      r = uv__open_cloexec(path, O_RDWR);
+    else
+      r = -1;
+
+    if (r < 0) {
+      /* fallback to using blocking writes */
+      if (!readable)
+        flags |= UV_STREAM_BLOCKING;
+      goto skip;
+    }
+
+    newfd = r;
+
+    r = uv__dup2_cloexec(newfd, fd);
+    if (r < 0 && r != -EINVAL) {
+      /* EINVAL means newfd == fd which could conceivably happen if another
+       * thread called close(fd) between our calls to isatty() and open().
+       * That's a rather unlikely event but let's handle it anyway.
+       */
+      uv__close(newfd);
+      return r;
+    }
+
+    fd = newfd;
+  }
+
+#if defined(__APPLE__)
+  /* Save the fd flags in case we need to restore them due to an error. */
+  do
+    saved_flags = fcntl(fd, F_GETFL);
+  while (saved_flags == -1 && errno == EINTR);
+
+  if (saved_flags == -1) {
+    if (newfd != -1)
+      uv__close(newfd);
+    return -errno;
+  }
+#endif
+
+  /* Pacify the compiler. */
+  (void) &saved_flags;
+
+skip:
+  uv__stream_init(loop, (uv_stream_t*) tty, UV_TTY);
+
+  /* If anything fails beyond this point we need to remove the handle from
+   * the handle queue, since it was added by uv__handle_init in uv_stream_init.
+   */
+
+  if (!(flags & UV_STREAM_BLOCKING))
+    uv__nonblock(fd, 1);
+
+#if defined(__APPLE__)
+  r = uv__stream_try_select((uv_stream_t*) tty, &fd);
+  if (r) {
+    int rc = r;
+    if (newfd != -1)
+      uv__close(newfd);
+    QUEUE_REMOVE(&tty->handle_queue);
+    do
+      r = fcntl(fd, F_SETFL, saved_flags);
+    while (r == -1 && errno == EINTR);
+    return rc;
+  }
+#endif
+
+  if (readable)
+    flags |= UV_STREAM_READABLE;
+  else
+    flags |= UV_STREAM_WRITABLE;
+
+  uv__stream_open((uv_stream_t*) tty, fd, flags);
+  tty->mode = UV_TTY_MODE_NORMAL;
+
+  return 0;
+}
+
+static void uv__tty_make_raw(struct termios* tio) {
+  assert(tio != NULL);
+
+#if defined __sun || defined __MVS__
+  /*
+   * This implementation of cfmakeraw for Solaris and derivatives is taken from
+   * http://www.perkin.org.uk/posts/solaris-portability-cfmakeraw.html.
+   */
+  tio->c_iflag &= ~(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR |
+                    IGNCR | ICRNL | IXON);
+  tio->c_oflag &= ~OPOST;
+  tio->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
+  tio->c_cflag &= ~(CSIZE | PARENB);
+  tio->c_cflag |= CS8;
+#else
+  cfmakeraw(tio);
+#endif /* #ifdef __sun */
+}
+
+int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) {
+  struct termios tmp;
+  int fd;
+
+  if (tty->mode == (int) mode)
+    return 0;
+
+  fd = uv__stream_fd(tty);
+  if (tty->mode == UV_TTY_MODE_NORMAL && mode != UV_TTY_MODE_NORMAL) {
+    if (tcgetattr(fd, &tty->orig_termios))
+      return -errno;
+
+    /* This is used for uv_tty_reset_mode() */
+    uv_spinlock_lock(&termios_spinlock);
+    if (orig_termios_fd == -1) {
+      orig_termios = tty->orig_termios;
+      orig_termios_fd = fd;
+    }
+    uv_spinlock_unlock(&termios_spinlock);
+  }
+
+  tmp = tty->orig_termios;
+  switch (mode) {
+    case UV_TTY_MODE_NORMAL:
+      break;
+    case UV_TTY_MODE_RAW:
+      tmp.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
+      tmp.c_oflag |= (ONLCR);
+      tmp.c_cflag |= (CS8);
+      tmp.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
+      tmp.c_cc[VMIN] = 1;
+      tmp.c_cc[VTIME] = 0;
+      break;
+    case UV_TTY_MODE_IO:
+      uv__tty_make_raw(&tmp);
+      break;
+  }
+
+  /* Apply changes after draining */
+  if (tcsetattr(fd, TCSADRAIN, &tmp))
+    return -errno;
+
+  tty->mode = mode;
+  return 0;
+}
+
+
+int uv_tty_get_winsize(uv_tty_t* tty, int* width, int* height) {
+  struct winsize ws;
+  int err;
+
+  do
+    err = ioctl(uv__stream_fd(tty), TIOCGWINSZ, &ws);
+  while (err == -1 && errno == EINTR);
+
+  if (err == -1)
+    return -errno;
+
+  *width = ws.ws_col;
+  *height = ws.ws_row;
+
+  return 0;
+}
+
+
+uv_handle_type uv_guess_handle(uv_file file) {
+  struct sockaddr sa;
+  struct stat s;
+  socklen_t len;
+  int type;
+
+  if (file < 0)
+    return UV_UNKNOWN_HANDLE;
+
+  if (isatty(file))
+    return UV_TTY;
+
+  if (fstat(file, &s))
+    return UV_UNKNOWN_HANDLE;
+
+  if (S_ISREG(s.st_mode))
+    return UV_FILE;
+
+  if (S_ISCHR(s.st_mode))
+    return UV_FILE;  /* XXX UV_NAMED_PIPE? */
+
+  if (S_ISFIFO(s.st_mode))
+    return UV_NAMED_PIPE;
+
+  if (!S_ISSOCK(s.st_mode))
+    return UV_UNKNOWN_HANDLE;
+
+  len = sizeof(type);
+  if (getsockopt(file, SOL_SOCKET, SO_TYPE, &type, &len))
+    return UV_UNKNOWN_HANDLE;
+
+  len = sizeof(sa);
+  if (getsockname(file, &sa, &len))
+    return UV_UNKNOWN_HANDLE;
+
+  if (type == SOCK_DGRAM)
+    if (sa.sa_family == AF_INET || sa.sa_family == AF_INET6)
+      return UV_UDP;
+
+  if (type == SOCK_STREAM) {
+#if defined(_AIX) || defined(__DragonFly__)
+    /* on AIX/DragonFly the getsockname call returns an empty sa structure
+     * for sockets of type AF_UNIX.  For all other types it will
+     * return a properly filled in structure.
+     */
+    if (len == 0)
+      return UV_NAMED_PIPE;
+#endif /* defined(_AIX) || defined(__DragonFly__) */
+
+    if (sa.sa_family == AF_INET || sa.sa_family == AF_INET6)
+      return UV_TCP;
+    if (sa.sa_family == AF_UNIX)
+      return UV_NAMED_PIPE;
+  }
+
+  return UV_UNKNOWN_HANDLE;
+}
+
+
+/* This function is async signal-safe, meaning that it's safe to call from
+ * inside a signal handler _unless_ execution was inside uv_tty_set_mode()'s
+ * critical section when the signal was raised.
+ */
+int uv_tty_reset_mode(void) {
+  int saved_errno;
+  int err;
+
+  saved_errno = errno;
+  if (!uv_spinlock_trylock(&termios_spinlock))
+    return -EBUSY;  /* In uv_tty_set_mode(). */
+
+  err = 0;
+  if (orig_termios_fd != -1)
+    if (tcsetattr(orig_termios_fd, TCSANOW, &orig_termios))
+      err = -errno;
+
+  uv_spinlock_unlock(&termios_spinlock);
+  errno = saved_errno;
+
+  return err;
+}
diff --git a/deps/libtuv/src/unix/udp.c b/deps/libtuv/src/unix/udp.c
new file mode 100644 (file)
index 0000000..374c881
--- /dev/null
@@ -0,0 +1,975 @@
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright 2015-2016 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <assert.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#if defined(__MVS__)
+#include <xti.h>
+#endif
+
+#if defined(IPV6_JOIN_GROUP) && !defined(IPV6_ADD_MEMBERSHIP)
+# define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+#endif
+
+#if defined(IPV6_LEAVE_GROUP) && !defined(IPV6_DROP_MEMBERSHIP)
+# define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+#endif
+
+
+static void uv__udp_run_completed(uv_udp_t* handle);
+static void uv__udp_io(uv_loop_t* loop, uv__io_t* w, unsigned int revents);
+static void uv__udp_recvmsg(uv_udp_t* handle);
+static void uv__udp_sendmsg(uv_udp_t* handle);
+static int uv__udp_maybe_deferred_bind(uv_udp_t* handle,
+                                       int domain,
+                                       unsigned int flags);
+
+
+void uv__udp_close(uv_udp_t* handle) {
+  uv__io_close(handle->loop, &handle->io_watcher);
+  uv__handle_stop(handle);
+
+  if (handle->io_watcher.fd != -1) {
+    uv__close(handle->io_watcher.fd);
+    handle->io_watcher.fd = -1;
+  }
+}
+
+
+void uv__udp_finish_close(uv_udp_t* handle) {
+  uv_udp_send_t* req;
+  QUEUE* q;
+
+  assert(!uv__io_active(&handle->io_watcher, POLLIN | POLLOUT));
+  assert(handle->io_watcher.fd == -1);
+
+  while (!QUEUE_EMPTY(&handle->write_queue)) {
+    q = QUEUE_HEAD(&handle->write_queue);
+    QUEUE_REMOVE(q);
+
+    req = QUEUE_DATA(q, uv_udp_send_t, queue);
+    req->status = -ECANCELED;
+    QUEUE_INSERT_TAIL(&handle->write_completed_queue, &req->queue);
+  }
+
+  uv__udp_run_completed(handle);
+
+  assert(handle->send_queue_size == 0);
+  assert(handle->send_queue_count == 0);
+
+  /* Now tear down the handle. */
+  handle->recv_cb = NULL;
+  handle->alloc_cb = NULL;
+  /* but _do not_ touch close_cb */
+}
+
+
+static void uv__udp_run_completed(uv_udp_t* handle) {
+  uv_udp_send_t* req;
+  QUEUE* q;
+
+  assert(!(handle->flags & UV_UDP_PROCESSING));
+  handle->flags |= UV_UDP_PROCESSING;
+
+  while (!QUEUE_EMPTY(&handle->write_completed_queue)) {
+    q = QUEUE_HEAD(&handle->write_completed_queue);
+    QUEUE_REMOVE(q);
+
+    req = QUEUE_DATA(q, uv_udp_send_t, queue);
+    uv__req_unregister(handle->loop, req);
+
+    handle->send_queue_size -= uv__count_bufs(req->bufs, req->nbufs);
+    handle->send_queue_count--;
+
+    if (req->bufs != req->bufsml)
+      uv__free(req->bufs);
+    req->bufs = NULL;
+
+    if (req->send_cb == NULL)
+      continue;
+
+    /* req->status >= 0 == bytes written
+     * req->status <  0 == errno
+     */
+    if (req->status >= 0)
+      req->send_cb(req, 0);
+    else
+      req->send_cb(req, req->status);
+  }
+
+  if (QUEUE_EMPTY(&handle->write_queue)) {
+    /* Pending queue and completion queue empty, stop watcher. */
+    uv__io_stop(handle->loop, &handle->io_watcher, POLLOUT);
+    if (!uv__io_active(&handle->io_watcher, POLLIN))
+      uv__handle_stop(handle);
+  }
+
+  handle->flags &= ~UV_UDP_PROCESSING;
+}
+
+
+static void uv__udp_io(uv_loop_t* loop, uv__io_t* w, unsigned int revents) {
+  uv_udp_t* handle;
+
+  handle = container_of(w, uv_udp_t, io_watcher);
+  assert(handle->type == UV_UDP);
+
+  if (revents & POLLIN)
+    uv__udp_recvmsg(handle);
+
+  if (revents & POLLOUT) {
+    uv__udp_sendmsg(handle);
+    uv__udp_run_completed(handle);
+  }
+}
+
+
+static void uv__udp_recvmsg(uv_udp_t* handle) {
+  struct sockaddr_storage peer;
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  struct msghdr h;
+#else
+  socklen_t addrlen;
+#endif
+  ssize_t nread;
+  uv_buf_t buf;
+  int flags;
+  int count;
+
+  assert(handle->recv_cb != NULL);
+  assert(handle->alloc_cb != NULL);
+
+  /* Prevent loop starvation when the data comes in as fast as (or faster than)
+   * we can read it. XXX Need to rearm fd if we switch to edge-triggered I/O.
+   */
+  count = 32;
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  memset(&h, 0, sizeof(h));
+  h.msg_name = &peer;
+#endif
+
+  do {
+    buf = uv_buf_init(NULL, 0);
+    handle->alloc_cb((uv_handle_t*) handle, 64 * 1024, &buf);
+    if (buf.base == NULL || buf.len == 0) {
+      handle->recv_cb(handle, UV_ENOBUFS, &buf, NULL, 0);
+      return;
+    }
+    assert(buf.base != NULL);
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+    h.msg_namelen = sizeof(peer);
+    h.msg_iov = (void*) &buf;
+    h.msg_iovlen = 1;
+
+    do {
+      nread = recvmsg(handle->io_watcher.fd, &h, 0);
+    }
+    while (nread == -1 && errno == EINTR);
+#else
+    addrlen = sizeof(peer);
+    do {
+      nread = recvfrom(handle->io_watcher.fd, buf.base, buf.len, 0,
+                       (struct sockaddr*)&peer, &addrlen);
+    }
+    while (nread == -1 && errno == EINTR);
+#endif
+
+    if (nread == -1) {
+      if (errno == EAGAIN || errno == EWOULDBLOCK)
+        handle->recv_cb(handle, 0, &buf, NULL, 0);
+      else
+        handle->recv_cb(handle, -errno, &buf, NULL, 0);
+    }
+    else {
+      const struct sockaddr *addr;
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+      if (h.msg_namelen == 0)
+#else
+      if (addrlen == 0)
+#endif
+        addr = NULL;
+      else
+        addr = (const struct sockaddr*) &peer;
+
+      flags = 0;
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+      if (h.msg_flags & MSG_TRUNC)
+#else
+      if (buf.len > nread)
+#endif
+        flags |= UV_UDP_PARTIAL;
+
+      handle->recv_cb(handle, nread, &buf, addr, flags);
+    }
+  }
+  /* recv_cb callback may decide to pause or close the handle */
+  while (nread != -1
+      && count-- > 0
+      && handle->io_watcher.fd != -1
+      && handle->recv_cb != NULL);
+}
+
+
+static void uv__udp_sendmsg(uv_udp_t* handle) {
+  uv_udp_send_t* req;
+  QUEUE* q;
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  struct msghdr h;
+#else
+  socklen_t addrlen;
+#endif
+  ssize_t size;
+
+  while (!QUEUE_EMPTY(&handle->write_queue)) {
+    q = QUEUE_HEAD(&handle->write_queue);
+    assert(q != NULL);
+
+    req = QUEUE_DATA(q, uv_udp_send_t, queue);
+    assert(req != NULL);
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+    memset(&h, 0, sizeof h);
+    h.msg_name = &req->addr;
+    h.msg_namelen = (req->addr.ss_family == AF_INET6 ?
+      sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in));
+    h.msg_iov = (struct iovec*) req->bufs;
+    h.msg_iovlen = req->nbufs;
+
+    do {
+      size = sendmsg(handle->io_watcher.fd, &h, 0);
+    } while (size == -1 && errno == EINTR);
+#else
+    assert(req->nbufs == 1);
+    do {
+      size = sendto(handle->io_watcher.fd, req->bufs->base,
+                    req->bufs->len, 0, (struct sockaddr*)&req->addr,
+                    addrlen);
+    } while (size == -1 && errno == EINTR);
+#endif
+    if (size == -1 && (errno == EAGAIN || errno == EWOULDBLOCK))
+      break;
+
+    req->status = (size == -1 ? -errno : size);
+
+    /* Sending a datagram is an atomic operation: either all data
+     * is written or nothing is (and EMSGSIZE is raised). That is
+     * why we don't handle partial writes. Just pop the request
+     * off the write queue and onto the completed queue, done.
+     */
+    QUEUE_REMOVE(&req->queue);
+    QUEUE_INSERT_TAIL(&handle->write_completed_queue, &req->queue);
+    uv__io_feed(handle->loop, &handle->io_watcher);
+  }
+}
+
+
+/* On the BSDs, SO_REUSEPORT implies SO_REUSEADDR but with some additional
+ * refinements for programs that use multicast.
+ *
+ * Linux as of 3.9 has a SO_REUSEPORT socket option but with semantics that
+ * are different from the BSDs: it _shares_ the port rather than steal it
+ * from the current listener.  While useful, it's not something we can emulate
+ * on other platforms so we don't enable it.
+ */
+static int uv__set_reuse(int fd) {
+  int yes;
+
+#if defined(SO_REUSEPORT) && !defined(__linux__)
+  yes = 1;
+  if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes)))
+    return -errno;
+#else
+  yes = 1;
+  if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)))
+    return -errno;
+#endif
+
+  return 0;
+}
+
+
+int uv__udp_bind(uv_udp_t* handle,
+                 const struct sockaddr* addr,
+                 unsigned int addrlen,
+                 unsigned int flags) {
+  int err;
+  int yes;
+  int fd;
+
+  /* Check for bad flags. */
+  if (flags & ~(UV_UDP_IPV6ONLY | UV_UDP_REUSEADDR))
+    return -EINVAL;
+
+  /* Cannot set IPv6-only mode on non-IPv6 socket. */
+  if ((flags & UV_UDP_IPV6ONLY) && addr->sa_family != AF_INET6)
+    return -EINVAL;
+
+  fd = handle->io_watcher.fd;
+  if (fd == -1) {
+    err = uv__socket(addr->sa_family, SOCK_DGRAM, 0);
+    if (err < 0)
+      return err;
+    fd = err;
+    handle->io_watcher.fd = fd;
+  }
+
+  if (flags & UV_UDP_REUSEADDR) {
+    err = uv__set_reuse(fd);
+    if (err)
+      goto out;
+  }
+
+  if (flags & UV_UDP_IPV6ONLY) {
+#ifdef IPV6_V6ONLY
+    yes = 1;
+    if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &yes, sizeof yes) == -1) {
+      err = -errno;
+      goto out;
+    }
+#else
+    err = -ENOTSUP;
+    goto out;
+#endif
+  }
+
+  if (bind(fd, addr, addrlen)) {
+    err = -errno;
+    if (errno == EAFNOSUPPORT)
+      /* OSX, other BSDs and SunoS fail with EAFNOSUPPORT when binding a
+       * socket created with AF_INET to an AF_INET6 address or vice versa. */
+      err = -EINVAL;
+    goto out;
+  }
+
+  if (addr->sa_family == AF_INET6)
+    handle->flags |= UV_HANDLE_IPV6;
+
+  handle->flags |= UV_HANDLE_BOUND;
+
+  return 0;
+
+out:
+  uv__close(handle->io_watcher.fd);
+  handle->io_watcher.fd = -1;
+  return err;
+}
+
+
+static int uv__udp_maybe_deferred_bind(uv_udp_t* handle,
+                                       int domain,
+                                       unsigned int flags) {
+  unsigned char taddr[sizeof(struct sockaddr_in6)];
+  socklen_t addrlen;
+
+  if (handle->io_watcher.fd != -1)
+    return 0;
+
+  switch (domain) {
+  case AF_INET:
+  {
+    struct sockaddr_in* addr = (void*)&taddr;
+    memset(addr, 0, sizeof *addr);
+    addr->sin_family = AF_INET;
+    addr->sin_addr.s_addr = INADDR_ANY;
+    addrlen = sizeof *addr;
+    break;
+  }
+  case AF_INET6:
+  {
+    struct sockaddr_in6* addr = (void*)&taddr;
+    memset(addr, 0, sizeof *addr);
+    addr->sin6_family = AF_INET6;
+    addr->sin6_addr = in6addr_any;
+    addrlen = sizeof *addr;
+    break;
+  }
+  default:
+    assert(0 && "unsupported address family");
+    abort();
+  }
+
+  return uv__udp_bind(handle, (const struct sockaddr*) &taddr, addrlen, flags);
+}
+
+
+int uv__udp_send(uv_udp_send_t* req,
+                 uv_udp_t* handle,
+                 const uv_buf_t bufs[],
+                 unsigned int nbufs,
+                 const struct sockaddr* addr,
+                 unsigned int addrlen,
+                 uv_udp_send_cb send_cb) {
+  int err;
+  int empty_queue;
+
+  assert(nbufs > 0);
+
+  err = uv__udp_maybe_deferred_bind(handle, addr->sa_family, 0);
+  if (err)
+    return err;
+
+  /* It's legal for send_queue_count > 0 even when the write_queue is empty;
+   * it means there are error-state requests in the write_completed_queue that
+   * will touch up send_queue_size/count later.
+   */
+  empty_queue = (handle->send_queue_count == 0);
+
+  uv__req_init(handle->loop, req, UV_UDP_SEND);
+  assert(addrlen <= sizeof(req->addr));
+  memcpy(&req->addr, addr, addrlen);
+  req->send_cb = send_cb;
+  req->handle = handle;
+  req->nbufs = nbufs;
+
+  req->bufs = req->bufsml;
+  if (nbufs > ARRAY_SIZE(req->bufsml))
+    req->bufs = uv__malloc(nbufs * sizeof(bufs[0]));
+
+  if (req->bufs == NULL) {
+    uv__req_unregister(handle->loop, req);
+    return -ENOMEM;
+  }
+
+  memcpy(req->bufs, bufs, nbufs * sizeof(bufs[0]));
+  handle->send_queue_size += uv__count_bufs(req->bufs, req->nbufs);
+  handle->send_queue_count++;
+  QUEUE_INSERT_TAIL(&handle->write_queue, &req->queue);
+  uv__handle_start(handle);
+
+  if (empty_queue && !(handle->flags & UV_UDP_PROCESSING)) {
+    uv__udp_sendmsg(handle);
+  } else {
+    uv__io_start(handle->loop, &handle->io_watcher, POLLOUT);
+  }
+
+  return 0;
+}
+
+
+int uv__udp_try_send(uv_udp_t* handle,
+                     const uv_buf_t bufs[],
+                     unsigned int nbufs,
+                     const struct sockaddr* addr,
+                     unsigned int addrlen) {
+  int err;
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  struct msghdr h;
+#endif
+  ssize_t size;
+
+  assert(nbufs > 0);
+
+  /* already sending a message */
+  if (handle->send_queue_count != 0)
+    return -EAGAIN;
+
+  err = uv__udp_maybe_deferred_bind(handle, addr->sa_family, 0);
+  if (err)
+    return err;
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  memset(&h, 0, sizeof h);
+  h.msg_name = (struct sockaddr*) addr;
+  h.msg_namelen = addrlen;
+  h.msg_iov = (struct iovec*) bufs;
+  h.msg_iovlen = nbufs;
+
+  do {
+    size = sendmsg(handle->io_watcher.fd, &h, 0);
+  } while (size == -1 && errno == EINTR);
+#else
+  assert(nbufs == 1);
+  do {
+    size = sendto(handle->io_watcher.fd, bufs->base, bufs->len,
+                  0, addr, addrlen);
+  } while (size == -1 && errno == EINTR);
+#endif
+
+  if (size == -1) {
+    if (errno == EAGAIN || errno == EWOULDBLOCK)
+      return -EAGAIN;
+    else
+      return -errno;
+  }
+
+  return size;
+}
+
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+static int uv__udp_set_membership4(uv_udp_t* handle,
+                                   const struct sockaddr_in* multicast_addr,
+                                   const char* interface_addr,
+                                   uv_membership membership) {
+  struct ip_mreq mreq;
+  int optname;
+  int err;
+
+  memset(&mreq, 0, sizeof mreq);
+
+  if (interface_addr) {
+    err = uv_inet_pton(AF_INET, interface_addr, &mreq.imr_interface.s_addr);
+    if (err)
+      return err;
+  } else {
+    mreq.imr_interface.s_addr = htonl(INADDR_ANY);
+  }
+
+  mreq.imr_multiaddr.s_addr = multicast_addr->sin_addr.s_addr;
+
+  switch (membership) {
+  case UV_JOIN_GROUP:
+    optname = IP_ADD_MEMBERSHIP;
+    break;
+  case UV_LEAVE_GROUP:
+    optname = IP_DROP_MEMBERSHIP;
+    break;
+  default:
+    return -EINVAL;
+  }
+
+  if (setsockopt(handle->io_watcher.fd,
+                 IPPROTO_IP,
+                 optname,
+                 &mreq,
+                 sizeof(mreq))) {
+#if defined(__MVS__)
+  if (errno == ENXIO)
+    return -ENODEV;
+#endif
+    return -errno;
+  }
+
+  return 0;
+}
+
+
+static int uv__udp_set_membership6(uv_udp_t* handle,
+                                   const struct sockaddr_in6* multicast_addr,
+                                   const char* interface_addr,
+                                   uv_membership membership) {
+  int optname;
+  struct ipv6_mreq mreq;
+  struct sockaddr_in6 addr6;
+
+  memset(&mreq, 0, sizeof mreq);
+
+  if (interface_addr) {
+    if (uv_ip6_addr(interface_addr, 0, &addr6))
+      return -EINVAL;
+    mreq.ipv6mr_interface = addr6.sin6_scope_id;
+  } else {
+    mreq.ipv6mr_interface = 0;
+  }
+
+  mreq.ipv6mr_multiaddr = multicast_addr->sin6_addr;
+
+  switch (membership) {
+  case UV_JOIN_GROUP:
+    optname = IPV6_ADD_MEMBERSHIP;
+    break;
+  case UV_LEAVE_GROUP:
+    optname = IPV6_DROP_MEMBERSHIP;
+    break;
+  default:
+    return -EINVAL;
+  }
+
+  if (setsockopt(handle->io_watcher.fd,
+                 IPPROTO_IPV6,
+                 optname,
+                 &mreq,
+                 sizeof(mreq))) {
+#if defined(__MVS__)
+  if (errno == ENXIO)
+    return -ENODEV;
+#endif
+    return -errno;
+  }
+
+  return 0;
+}
+#endif
+
+
+int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned int flags) {
+  int domain;
+  int err;
+  int fd;
+
+  /* Use the lower 8 bits for the domain */
+  domain = flags & 0xFF;
+  if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC)
+    return -EINVAL;
+
+  if (flags & ~0xFF)
+    return -EINVAL;
+
+  if (domain != AF_UNSPEC) {
+    err = uv__socket(domain, SOCK_DGRAM, 0);
+    if (err < 0)
+      return err;
+    fd = err;
+  } else {
+    fd = -1;
+  }
+
+  uv__handle_init(loop, (uv_handle_t*)handle, UV_UDP);
+  handle->alloc_cb = NULL;
+  handle->recv_cb = NULL;
+  handle->send_queue_size = 0;
+  handle->send_queue_count = 0;
+  uv__io_init(&handle->io_watcher, uv__udp_io, fd);
+  QUEUE_INIT(&handle->write_queue);
+  QUEUE_INIT(&handle->write_completed_queue);
+  return 0;
+}
+
+
+int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) {
+  return uv_udp_init_ex(loop, handle, AF_UNSPEC);
+}
+
+
+int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) {
+  int err;
+
+  /* Check for already active socket. */
+  if (handle->io_watcher.fd != -1)
+    return -EBUSY;
+
+  err = uv__nonblock(sock, 1);
+  if (err)
+    return err;
+
+  err = uv__set_reuse(sock);
+  if (err)
+    return err;
+
+  handle->io_watcher.fd = sock;
+  return 0;
+}
+
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+int uv_udp_set_membership(uv_udp_t* handle,
+                          const char* multicast_addr,
+                          const char* interface_addr,
+                          uv_membership membership) {
+  int err;
+  struct sockaddr_in addr4;
+  struct sockaddr_in6 addr6;
+
+  if (uv_ip4_addr(multicast_addr, 0, &addr4) == 0) {
+    err = uv__udp_maybe_deferred_bind(handle, AF_INET, UV_UDP_REUSEADDR);
+    if (err)
+      return err;
+    return uv__udp_set_membership4(handle, &addr4, interface_addr, membership);
+  } else if (uv_ip6_addr(multicast_addr, 0, &addr6) == 0) {
+    err = uv__udp_maybe_deferred_bind(handle, AF_INET6, UV_UDP_REUSEADDR);
+    if (err)
+      return err;
+    return uv__udp_set_membership6(handle, &addr6, interface_addr, membership);
+  } else {
+    return -EINVAL;
+  }
+}
+#endif
+
+static int uv__setsockopt(uv_udp_t* handle,
+                         int option4,
+                         int option6,
+                         const void* val,
+                         size_t size) {
+  int r;
+
+  if (handle->flags & UV_HANDLE_IPV6)
+    r = setsockopt(handle->io_watcher.fd,
+                   IPPROTO_IPV6,
+                   option6,
+                   val,
+                   size);
+  else
+    r = setsockopt(handle->io_watcher.fd,
+                   IPPROTO_IP,
+                   option4,
+                   val,
+                   size);
+  if (r)
+    return -errno;
+
+  return 0;
+}
+
+static int uv__setsockopt_maybe_char(uv_udp_t* handle,
+                                     int option4,
+                                     int option6,
+                                     int val) {
+#if defined(__sun) || defined(_AIX) || defined(__MVS__)
+  char arg = val;
+#elif defined(__OpenBSD__)
+  unsigned char arg = val;
+#else
+  int arg = val;
+#endif
+
+  if (val < 0 || val > 255)
+    return -EINVAL;
+
+  return uv__setsockopt(handle, option4, option6, &arg, sizeof(arg));
+}
+
+
+int uv_udp_set_broadcast(uv_udp_t* handle, int on) {
+  if (setsockopt(handle->io_watcher.fd,
+                 SOL_SOCKET,
+                 SO_BROADCAST,
+                 &on,
+                 sizeof(on))) {
+    return -errno;
+  }
+
+  return 0;
+}
+
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+int uv_udp_set_ttl(uv_udp_t* handle, int ttl) {
+  if (ttl < 1 || ttl > 255)
+    return -EINVAL;
+
+#if defined(__MVS__)
+  if (!(handle->flags & UV_HANDLE_IPV6))
+    return -ENOTSUP;  /* zOS does not support setting ttl for IPv4 */
+#endif
+
+/*
+ * On Solaris and derivatives such as SmartOS, the length of socket options
+ * is sizeof(int) for IP_TTL and IPV6_UNICAST_HOPS,
+ * so hardcode the size of these options on this platform,
+ * and use the general uv__setsockopt_maybe_char call on other platforms.
+ */
+#if defined(__sun) || defined(_AIX) || defined(__OpenBSD__) || \
+    defined(__MVS__)
+
+  return uv__setsockopt(handle,
+                        IP_TTL,
+                        IPV6_UNICAST_HOPS,
+                        &ttl,
+                        sizeof(ttl));
+#endif /* defined(__sun) || defined(_AIX) || defined (__OpenBSD__) ||
+          defined(__MVS__) */
+
+  return uv__setsockopt_maybe_char(handle,
+                                   IP_TTL,
+                                   IPV6_UNICAST_HOPS,
+                                   ttl);
+}
+
+
+int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl) {
+/*
+ * On Solaris and derivatives such as SmartOS, the length of socket options
+ * is sizeof(int) for IPV6_MULTICAST_HOPS and sizeof(char) for
+ * IP_MULTICAST_TTL, so hardcode the size of the option in the IPv6 case,
+ * and use the general uv__setsockopt_maybe_char call otherwise.
+ */
+#if defined(__sun) || defined(_AIX) || defined(__MVS__)
+  if (handle->flags & UV_HANDLE_IPV6)
+    return uv__setsockopt(handle,
+                          IP_MULTICAST_TTL,
+                          IPV6_MULTICAST_HOPS,
+                          &ttl,
+                          sizeof(ttl));
+#endif /* defined(__sun) || defined(_AIX) || defined(__MVS__) */
+
+  return uv__setsockopt_maybe_char(handle,
+                                   IP_MULTICAST_TTL,
+                                   IPV6_MULTICAST_HOPS,
+                                   ttl);
+}
+
+
+int uv_udp_set_multicast_loop(uv_udp_t* handle, int on) {
+/*
+ * On Solaris and derivatives such as SmartOS, the length of socket options
+ * is sizeof(int) for IPV6_MULTICAST_LOOP and sizeof(char) for
+ * IP_MULTICAST_LOOP, so hardcode the size of the option in the IPv6 case,
+ * and use the general uv__setsockopt_maybe_char call otherwise.
+ */
+#if defined(__sun) || defined(_AIX) || defined(__MVS__)
+  if (handle->flags & UV_HANDLE_IPV6)
+    return uv__setsockopt(handle,
+                          IP_MULTICAST_LOOP,
+                          IPV6_MULTICAST_LOOP,
+                          &on,
+                          sizeof(on));
+#endif /* defined(__sun) || defined(_AIX) || defined(__MVS__) */
+
+  return uv__setsockopt_maybe_char(handle,
+                                   IP_MULTICAST_LOOP,
+                                   IPV6_MULTICAST_LOOP,
+                                   on);
+}
+
+int uv_udp_set_multicast_interface(uv_udp_t* handle, const char* interface_addr) {
+  struct sockaddr_storage addr_st;
+  struct sockaddr_in* addr4;
+  struct sockaddr_in6* addr6;
+
+  addr4 = (struct sockaddr_in*) &addr_st;
+  addr6 = (struct sockaddr_in6*) &addr_st;
+
+  if (!interface_addr) {
+    memset(&addr_st, 0, sizeof addr_st);
+    if (handle->flags & UV_HANDLE_IPV6) {
+      addr_st.ss_family = AF_INET6;
+      addr6->sin6_scope_id = 0;
+    } else {
+      addr_st.ss_family = AF_INET;
+      addr4->sin_addr.s_addr = htonl(INADDR_ANY);
+    }
+  } else if (uv_ip4_addr(interface_addr, 0, addr4) == 0) {
+    /* nothing, address was parsed */
+  } else if (uv_ip6_addr(interface_addr, 0, addr6) == 0) {
+    /* nothing, address was parsed */
+  } else {
+    return -EINVAL;
+  }
+
+  if (addr_st.ss_family == AF_INET) {
+    if (setsockopt(handle->io_watcher.fd,
+                   IPPROTO_IP,
+                   IP_MULTICAST_IF,
+                   (void*) &addr4->sin_addr,
+                   sizeof(addr4->sin_addr)) == -1) {
+      return -errno;
+    }
+  } else if (addr_st.ss_family == AF_INET6) {
+    if (setsockopt(handle->io_watcher.fd,
+                   IPPROTO_IPV6,
+                   IPV6_MULTICAST_IF,
+                   &addr6->sin6_scope_id,
+                   sizeof(addr6->sin6_scope_id)) == -1) {
+      return -errno;
+    }
+  } else {
+    assert(0 && "unexpected address family");
+    abort();
+  }
+
+  return 0;
+}
+#endif
+
+int uv_udp_getsockname(const uv_udp_t* handle,
+                       struct sockaddr* name,
+                       int* namelen) {
+  socklen_t socklen;
+
+  if (handle->io_watcher.fd == -1)
+    return -EINVAL;  /* FIXME(bnoordhuis) -EBADF */
+
+  /* sizeof(socklen_t) != sizeof(int) on some systems. */
+  socklen = (socklen_t) *namelen;
+
+  if (getsockname(handle->io_watcher.fd, name, &socklen))
+    return -errno;
+
+  *namelen = (int) socklen;
+  return 0;
+}
+
+
+int uv__udp_recv_start(uv_udp_t* handle,
+                       uv_alloc_cb alloc_cb,
+                       uv_udp_recv_cb recv_cb) {
+  int err;
+
+  if (alloc_cb == NULL || recv_cb == NULL)
+    return -EINVAL;
+
+  if (uv__io_active(&handle->io_watcher, POLLIN))
+    return -EALREADY;  /* FIXME(bnoordhuis) Should be -EBUSY. */
+
+  err = uv__udp_maybe_deferred_bind(handle, AF_INET, 0);
+  if (err)
+    return err;
+
+  handle->alloc_cb = alloc_cb;
+  handle->recv_cb = recv_cb;
+
+  uv__io_start(handle->loop, &handle->io_watcher, POLLIN);
+  uv__handle_start(handle);
+
+  return 0;
+}
+
+
+int uv__udp_recv_stop(uv_udp_t* handle) {
+  uv__io_stop(handle->loop, &handle->io_watcher, POLLIN);
+
+  if (!uv__io_active(&handle->io_watcher, POLLOUT))
+    uv__handle_stop(handle);
+
+  handle->alloc_cb = NULL;
+  handle->recv_cb = NULL;
+
+  return 0;
+}
diff --git a/deps/libtuv/src/uv-common.c b/deps/libtuv/src/uv-common.c
new file mode 100644 (file)
index 0000000..7279916
--- /dev/null
@@ -0,0 +1,496 @@
+/* Copyright 2015-2017 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "uv-common.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stddef.h> /* NULL */
+#include <stdio.h>
+#include <stdlib.h> /* malloc */
+#include <string.h> /* memset */
+#include <unistd.h> /* usleep */
+
+#if defined(_WIN32)
+# include <malloc.h> /* malloc */
+#else
+# include <net/if.h> /* if_nametoindex */
+#endif
+
+
+typedef struct {
+  uv_malloc_func local_malloc;
+  uv_realloc_func local_realloc;
+  uv_calloc_func local_calloc;
+  uv_free_func local_free;
+} uv__allocator_t;
+
+static uv__allocator_t uv__allocator = {
+  malloc,
+  realloc,
+  calloc,
+  free,
+};
+
+#if defined(__APPLE__)
+char* uv__strdup(const char* s) {
+  size_t len = strlen(s) + 1;
+  char* m = uv__malloc(len);
+  if (m == NULL)
+    return NULL;
+  return memcpy(m, s, len);
+}
+#endif
+
+void* uv__malloc(size_t size) {
+  return uv__allocator.local_malloc(size);
+}
+
+void uv__free(void* ptr) {
+  int saved_errno;
+
+  /* Libuv expects that free() does not clobber errno.  The system allocator
+   * honors that assumption but custom allocators may not be so careful.
+   */
+  saved_errno = errno;
+  uv__allocator.local_free(ptr);
+  errno = saved_errno;
+}
+
+void* uv__calloc(size_t count, size_t size) {
+  return uv__allocator.local_calloc(count, size);
+}
+
+void* uv__realloc(void* ptr, size_t size) {
+  return uv__allocator.local_realloc(ptr, size);
+}
+
+uv_buf_t uv_buf_init(char* base, unsigned int len) {
+  uv_buf_t buf;
+  buf.base = base;
+  buf.len = len;
+  return buf;
+}
+
+
+#define UV_ERR_NAME_GEN(name, _) case UV_ ## name: return #name;
+const char* uv_err_name(int err) {
+  switch (err) {
+    UV_ERRNO_MAP(UV_ERR_NAME_GEN)
+    default:
+      /* TUV_CHANGES@20170517: To figure out what error name is missing */
+      TDLOG("uv_err_name for (%d) is missing. Add err name string\n", err);
+      assert(0);
+      return NULL;
+  }
+}
+#undef UV_ERR_NAME_GEN
+
+
+#define UV_STRERROR_GEN(name, msg) case UV_ ## name: return msg;
+const char* uv_strerror(int err) {
+  switch (err) {
+    UV_ERRNO_MAP(UV_STRERROR_GEN)
+    default:
+        return "Unknown error";
+    }
+}
+#undef UV_STRERROR_GEN
+
+
+int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr) {
+  memset(addr, 0, sizeof(*addr));
+  addr->sin_family = AF_INET;
+  addr->sin_port = htons(port);
+  return uv_inet_pton(AF_INET, ip, &(addr->sin_addr.s_addr));
+}
+
+
+int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) {
+  char address_part[40];
+  size_t address_part_size;
+  const char* zone_index;
+
+  memset(addr, 0, sizeof(*addr));
+  addr->sin6_family = AF_INET6;
+  addr->sin6_port = htons(port);
+
+  zone_index = strchr(ip, '%');
+  if (zone_index != NULL) {
+    address_part_size = zone_index - ip;
+    if (address_part_size >= sizeof(address_part))
+      address_part_size = sizeof(address_part) - 1;
+
+    memcpy(address_part, ip, address_part_size);
+    address_part[address_part_size] = '\0';
+    ip = address_part;
+
+    zone_index++; /* skip '%' */
+    /* NOTE: unknown interface (id=0) is silently ignored */
+#ifdef _WIN32
+    addr->sin6_scope_id = atoi(zone_index);
+#elif !defined(__NUTTX__) && !defined(__TIZENRT__)
+    /* No if_nametoindex in nuttx */
+    addr->sin6_scope_id = if_nametoindex(zone_index);
+#endif
+  }
+
+  return uv_inet_pton(AF_INET6, ip, &addr->sin6_addr);
+}
+
+
+int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size) {
+  return uv_inet_ntop(AF_INET, &src->sin_addr, dst, size);
+}
+
+
+int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size) {
+  return uv_inet_ntop(AF_INET6, &src->sin6_addr, dst, size);
+}
+
+
+int uv_tcp_bind(uv_tcp_t* handle,
+                const struct sockaddr* addr,
+                unsigned int flags) {
+  unsigned int addrlen;
+
+  if (handle->type != UV_TCP)
+    return UV_EINVAL;
+
+  if (addr->sa_family == AF_INET)
+    addrlen = sizeof(struct sockaddr_in);
+  else if (addr->sa_family == AF_INET6)
+    addrlen = sizeof(struct sockaddr_in6);
+  else
+    return UV_EINVAL;
+
+  return uv__tcp_bind(handle, addr, addrlen, flags);
+}
+
+
+int uv_udp_bind(uv_udp_t* handle,
+                const struct sockaddr* addr,
+                unsigned int flags) {
+  unsigned int addrlen;
+
+  if (handle->type != UV_UDP)
+    return UV_EINVAL;
+
+  if (addr->sa_family == AF_INET)
+    addrlen = sizeof(struct sockaddr_in);
+  else if (addr->sa_family == AF_INET6)
+    addrlen = sizeof(struct sockaddr_in6);
+  else
+    return UV_EINVAL;
+
+  return uv__udp_bind(handle, addr, addrlen, flags);
+}
+
+
+int uv_tcp_connect(uv_connect_t* req,
+                   uv_tcp_t* handle,
+                   const struct sockaddr* addr,
+                   uv_connect_cb cb) {
+  unsigned int addrlen;
+
+  if (handle->type != UV_TCP)
+    return UV_EINVAL;
+
+  if (addr->sa_family == AF_INET)
+    addrlen = sizeof(struct sockaddr_in);
+  else if (addr->sa_family == AF_INET6)
+    addrlen = sizeof(struct sockaddr_in6);
+  else
+    return UV_EINVAL;
+
+  return uv__tcp_connect(req, handle, addr, addrlen, cb);
+}
+
+
+int uv_udp_send(uv_udp_send_t* req,
+                uv_udp_t* handle,
+                const uv_buf_t bufs[],
+                unsigned int nbufs,
+                const struct sockaddr* addr,
+                uv_udp_send_cb send_cb) {
+  unsigned int addrlen;
+
+  if (handle->type != UV_UDP)
+    return UV_EINVAL;
+
+  if (addr->sa_family == AF_INET)
+    addrlen = sizeof(struct sockaddr_in);
+  else if (addr->sa_family == AF_INET6)
+    addrlen = sizeof(struct sockaddr_in6);
+  else
+    return UV_EINVAL;
+
+  return uv__udp_send(req, handle, bufs, nbufs, addr, addrlen, send_cb);
+}
+
+
+int uv_udp_try_send(uv_udp_t* handle,
+                    const uv_buf_t bufs[],
+                    unsigned int nbufs,
+                    const struct sockaddr* addr) {
+  unsigned int addrlen;
+
+  if (handle->type != UV_UDP)
+    return UV_EINVAL;
+
+  if (addr->sa_family == AF_INET)
+    addrlen = sizeof(struct sockaddr_in);
+  else if (addr->sa_family == AF_INET6)
+    addrlen = sizeof(struct sockaddr_in6);
+  else
+    return UV_EINVAL;
+
+  return uv__udp_try_send(handle, bufs, nbufs, addr, addrlen);
+}
+
+
+int uv_udp_recv_start(uv_udp_t* handle,
+                      uv_alloc_cb alloc_cb,
+                      uv_udp_recv_cb recv_cb) {
+  if (handle->type != UV_UDP || alloc_cb == NULL || recv_cb == NULL)
+    return UV_EINVAL;
+  else
+    return uv__udp_recv_start(handle, alloc_cb, recv_cb);
+}
+
+
+int uv_udp_recv_stop(uv_udp_t* handle) {
+  if (handle->type != UV_UDP)
+    return UV_EINVAL;
+  else
+    return uv__udp_recv_stop(handle);
+}
+
+
+void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg) {
+  QUEUE queue;
+  QUEUE* q;
+  uv_handle_t* h;
+
+  QUEUE_MOVE(&loop->handle_queue, &queue);
+  while (!QUEUE_EMPTY(&queue)) {
+    q = QUEUE_HEAD(&queue);
+    h = QUEUE_DATA(q, uv_handle_t, handle_queue);
+
+    QUEUE_REMOVE(q);
+    QUEUE_INSERT_TAIL(&loop->handle_queue, q);
+
+    if (h->flags & UV__HANDLE_INTERNAL) continue;
+    walk_cb(h, arg);
+  }
+}
+
+
+void uv_ref(uv_handle_t* handle) {
+  uv__handle_ref(handle);
+}
+
+
+void uv_unref(uv_handle_t* handle) {
+  uv__handle_unref(handle);
+}
+
+
+uint64_t uv_now(const uv_loop_t* loop) {
+  return loop->time;
+}
+
+
+
+size_t uv__count_bufs(const uv_buf_t bufs[], unsigned int nbufs) {
+  unsigned int i;
+  size_t bytes;
+
+  bytes = 0;
+  for (i = 0; i < nbufs; i++)
+    bytes += (size_t) bufs[i].len;
+
+  return bytes;
+}
+
+
+/* The windows implementation does not have the same structure layout as
+ * the unix implementation (nbufs is not directly inside req but is
+ * contained in a nested union/struct) so this function locates it.
+*/
+static unsigned int* uv__get_nbufs(uv_fs_t* req) {
+#ifdef _WIN32
+  return &req->fs.info.nbufs;
+#else
+  return &req->nbufs;
+#endif
+}
+
+/* uv_fs_scandir() uses the system allocator to allocate memory on non-Windows
+ * systems. So, the memory should be released using free(). On Windows,
+ * uv__malloc() is used, so use uv__free() to free memory.
+*/
+#ifdef _WIN32
+# define uv__fs_scandir_free uv__free
+#else
+# define uv__fs_scandir_free free
+#endif
+
+void uv__fs_scandir_cleanup(uv_fs_t* req) {
+  uv__dirent_t** dents;
+
+  unsigned int* nbufs = uv__get_nbufs(req);
+
+  dents = req->ptr;
+  if (*nbufs > 0 && *nbufs != (unsigned int) req->result)
+    (*nbufs)--;
+  for (; *nbufs < (unsigned int) req->result; (*nbufs)++)
+    uv__fs_scandir_free(dents[*nbufs]);
+
+  uv__fs_scandir_free(req->ptr);
+  req->ptr = NULL;
+}
+
+
+int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent) {
+  uv__dirent_t** dents;
+  uv__dirent_t* dent;
+
+  unsigned int* nbufs = uv__get_nbufs(req);
+
+  dents = req->ptr;
+
+  /* Free previous entity */
+  if (*nbufs > 0)
+    uv__fs_scandir_free(dents[*nbufs - 1]);
+
+  /* End was already reached */
+  if (*nbufs == (unsigned int) req->result) {
+    uv__fs_scandir_free(dents);
+    req->ptr = NULL;
+    return UV_EOF;
+  }
+
+  dent = dents[(*nbufs)++];
+
+  ent->name = dent->d_name;
+#ifdef HAVE_DIRENT_TYPES
+  switch (dent->d_type) {
+    case UV__DT_DIR:
+      ent->type = UV_DIRENT_DIR;
+      break;
+    case UV__DT_FILE:
+      ent->type = UV_DIRENT_FILE;
+      break;
+    case UV__DT_LINK:
+      ent->type = UV_DIRENT_LINK;
+      break;
+    case UV__DT_FIFO:
+      ent->type = UV_DIRENT_FIFO;
+      break;
+    case UV__DT_SOCKET:
+      ent->type = UV_DIRENT_SOCKET;
+      break;
+    case UV__DT_CHAR:
+      ent->type = UV_DIRENT_CHAR;
+      break;
+    case UV__DT_BLOCK:
+      ent->type = UV_DIRENT_BLOCK;
+      break;
+    default:
+      ent->type = UV_DIRENT_UNKNOWN;
+  }
+#else
+  ent->type = UV_DIRENT_UNKNOWN;
+#endif
+
+  return 0;
+}
+
+
+static uv_loop_t default_loop_struct;
+static uv_loop_t* default_loop_ptr;
+
+
+uv_loop_t* uv_default_loop(void) {
+  if (default_loop_ptr != NULL)
+    return default_loop_ptr;
+
+  if (uv_loop_init(&default_loop_struct))
+    return NULL;
+
+  default_loop_ptr = &default_loop_struct;
+  return default_loop_ptr;
+}
+
+
+int uv_loop_close(uv_loop_t* loop) {
+  QUEUE* q;
+  uv_handle_t* h;
+#ifndef NDEBUG
+  void* saved_data;
+#endif
+
+  if (!QUEUE_EMPTY(&(loop)->active_reqs))
+    return UV_EBUSY;
+
+  tuv_async_deinit(loop, &loop->wq_async);
+
+  QUEUE_FOREACH(q, &loop->handle_queue) {
+    h = QUEUE_DATA(q, uv_handle_t, handle_queue);
+    if (!(h->flags & UV__HANDLE_INTERNAL))
+      return UV_EBUSY;
+  }
+
+  uv__loop_close(loop);
+
+#ifndef NDEBUG
+  saved_data = loop->data;
+  memset(loop, -1, sizeof(*loop));
+  loop->data = saved_data;
+#endif
+  if (loop == default_loop_ptr)
+    default_loop_ptr = NULL;
+
+  return 0;
+}
+
+/* Pause the calling thread for a number of milliseconds. */
+void uv_sleep(int msec) {
+  usleep(msec * 1000);
+}
diff --git a/deps/libtuv/src/uv-common.h b/deps/libtuv/src/uv-common.h
new file mode 100644 (file)
index 0000000..069b5af
--- /dev/null
@@ -0,0 +1,249 @@
+/* Copyright 2015-2017 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/*
+ * This file is private to libuv. It provides common functionality to both
+ * Windows and Unix backends.
+ */
+
+#ifndef UV_COMMON_H_
+#define UV_COMMON_H_
+
+#include <assert.h>
+#include <stdarg.h>
+#include <stddef.h>
+
+#if defined(_MSC_VER) && _MSC_VER < 1600
+# include "stdint-msvc2008.h"
+#else
+# include <stdint.h>
+#endif
+
+#include "uv.h"
+#include "tree.h"
+#include "queue.h"
+
+#if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900
+extern int snprintf(char*, size_t, const char*, ...);
+#endif
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
+#define container_of(ptr, type, member) \
+  ((type *) ((char *) (ptr) - offsetof(type, member)))
+
+#define STATIC_ASSERT(expr)                                                   \
+  void uv__static_assert(int static_assert_failed[1 - 2 * !(expr)])
+
+#ifndef _WIN32
+enum {
+  UV__HANDLE_INTERNAL = 0x8000,
+  UV__HANDLE_ACTIVE   = 0x4000,
+  UV__HANDLE_REF      = 0x2000,
+  UV__HANDLE_CLOSING  = 0 /* no-op on unix */
+};
+#else
+# define UV__HANDLE_INTERNAL  0x80
+# define UV__HANDLE_ACTIVE    0x40
+# define UV__HANDLE_REF       0x20
+# define UV__HANDLE_CLOSING   0x01
+#endif
+
+int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
+
+void uv__loop_close(uv_loop_t* loop);
+
+int uv__tcp_bind(uv_tcp_t* tcp,
+                 const struct sockaddr* addr,
+                 unsigned int addrlen,
+                 unsigned int flags);
+
+int uv__tcp_connect(uv_connect_t* req,
+                   uv_tcp_t* handle,
+                   const struct sockaddr* addr,
+                   unsigned int addrlen,
+                   uv_connect_cb cb);
+
+int uv__udp_bind(uv_udp_t* handle,
+                 const struct sockaddr* addr,
+                 unsigned int  addrlen,
+                 unsigned int flags);
+
+int uv__udp_send(uv_udp_send_t* req,
+                 uv_udp_t* handle,
+                 const uv_buf_t bufs[],
+                 unsigned int nbufs,
+                 const struct sockaddr* addr,
+                 unsigned int addrlen,
+                 uv_udp_send_cb send_cb);
+
+int uv__udp_try_send(uv_udp_t* handle,
+                     const uv_buf_t bufs[],
+                     unsigned int nbufs,
+                     const struct sockaddr* addr,
+                     unsigned int addrlen);
+
+int uv__udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloccb,
+                       uv_udp_recv_cb recv_cb);
+
+int uv__udp_recv_stop(uv_udp_t* handle);
+
+void uv__fs_poll_close(uv_fs_poll_t* handle);
+
+int uv__getaddrinfo_translate_error(int sys_err);    /* EAI_* error. */
+
+void uv__work_submit(uv_loop_t* loop,
+                     struct uv__work *w,
+                     void (*work)(struct uv__work *w),
+                     void (*done)(struct uv__work *w, int status));
+
+void uv__work_done(uv_async_t* handle);
+
+size_t uv__count_bufs(const uv_buf_t bufs[], unsigned int nbufs);
+
+int uv__socket_sockopt(uv_handle_t* handle, int optname, int* value);
+
+void uv__fs_scandir_cleanup(uv_fs_t* req);
+
+#define uv__has_active_reqs(loop)                                             \
+  (QUEUE_EMPTY(&(loop)->active_reqs) == 0)
+
+#define uv__req_register(loop, req)                                           \
+  do {                                                                        \
+    QUEUE_INSERT_TAIL(&(loop)->active_reqs, &(req)->active_queue);            \
+  }                                                                           \
+  while (0)
+
+#define uv__req_unregister(loop, req)                                         \
+  do {                                                                        \
+    assert(uv__has_active_reqs(loop));                                        \
+    QUEUE_REMOVE(&(req)->active_queue);                                       \
+  }                                                                           \
+  while (0)
+
+#define uv__has_active_handles(loop)                                          \
+  ((loop)->active_handles > 0)
+
+#define uv__active_handle_add(h)                                              \
+  do {                                                                        \
+    (h)->loop->active_handles++;                                              \
+  }                                                                           \
+  while (0)
+
+#define uv__active_handle_rm(h)                                               \
+  do {                                                                        \
+    (h)->loop->active_handles--;                                              \
+  }                                                                           \
+  while (0)
+
+#define uv__is_active(h)                                                      \
+  (((h)->flags & UV__HANDLE_ACTIVE) != 0)
+
+#define uv__is_closing(h)                                                     \
+  (((h)->flags & (UV_CLOSING |  UV_CLOSED)) != 0)
+
+#define uv__handle_start(h)                                                   \
+  do {                                                                        \
+    assert(((h)->flags & UV__HANDLE_CLOSING) == 0);                           \
+    if (((h)->flags & UV__HANDLE_ACTIVE) != 0) break;                         \
+    (h)->flags |= UV__HANDLE_ACTIVE;                                          \
+    if (((h)->flags & UV__HANDLE_REF) != 0) uv__active_handle_add(h);         \
+  }                                                                           \
+  while (0)
+
+#define uv__handle_stop(h)                                                    \
+  do {                                                                        \
+    assert(((h)->flags & UV__HANDLE_CLOSING) == 0);                           \
+    if (((h)->flags & UV__HANDLE_ACTIVE) == 0) break;                         \
+    (h)->flags &= ~UV__HANDLE_ACTIVE;                                         \
+    if (((h)->flags & UV__HANDLE_REF) != 0) uv__active_handle_rm(h);          \
+  }                                                                           \
+  while (0)
+
+#define uv__handle_ref(h)                                                     \
+  do {                                                                        \
+    if (((h)->flags & UV__HANDLE_REF) != 0) break;                            \
+    (h)->flags |= UV__HANDLE_REF;                                             \
+    if (((h)->flags & UV__HANDLE_CLOSING) != 0) break;                        \
+    if (((h)->flags & UV__HANDLE_ACTIVE) != 0) uv__active_handle_add(h);      \
+  }                                                                           \
+  while (0)
+
+#define uv__handle_unref(h)                                                   \
+  do {                                                                        \
+    if (((h)->flags & UV__HANDLE_REF) == 0) break;                            \
+    (h)->flags &= ~UV__HANDLE_REF;                                            \
+    if (((h)->flags & UV__HANDLE_CLOSING) != 0) break;                        \
+    if (((h)->flags & UV__HANDLE_ACTIVE) != 0) uv__active_handle_rm(h);       \
+  }                                                                           \
+  while (0)
+
+#define uv__has_ref(h)                                                        \
+  (((h)->flags & UV__HANDLE_REF) != 0)
+
+#if defined(_WIN32)
+# define uv__handle_platform_init(h) ((h)->u.fd = -1)
+#else
+# define uv__handle_platform_init(h) ((h)->next_closing = NULL)
+#endif
+
+#define uv__handle_init(loop_, h, type_)                                      \
+  do {                                                                        \
+    (h)->loop = (loop_);                                                      \
+    (h)->type = (type_);                                                      \
+    (h)->flags = UV__HANDLE_REF;  /* Ref the loop when active. */             \
+    QUEUE_INSERT_TAIL(&(loop_)->handle_queue, &(h)->handle_queue);            \
+    uv__handle_platform_init(h);                                              \
+  }                                                                           \
+  while (0)
+
+#define tuv__handle_deinit(h)                                                 \
+  do {                                                                        \
+    QUEUE_REMOVE(&(h)->handle_queue);                                         \
+    QUEUE_INIT(&(h)->handle_queue);                                           \
+  }                                                                           \
+  while (0)
+
+/* Allocator prototypes */
+void *uv__calloc(size_t count, size_t size);
+#if defined(__APPLE__)
+char *uv__strdup(const char* s);
+#endif
+void* uv__malloc(size_t size);
+void uv__free(void* ptr);
+void* uv__realloc(void* ptr, size_t size);
+
+#endif /* UV_COMMON_H_ */
diff --git a/deps/libtuv/src/version.c b/deps/libtuv/src/version.c
new file mode 100644 (file)
index 0000000..686dedd
--- /dev/null
@@ -0,0 +1,45 @@
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+
+#define UV_STRINGIFY(v) UV_STRINGIFY_HELPER(v)
+#define UV_STRINGIFY_HELPER(v) #v
+
+#define UV_VERSION_STRING_BASE  UV_STRINGIFY(UV_VERSION_MAJOR) "." \
+                                UV_STRINGIFY(UV_VERSION_MINOR) "." \
+                                UV_STRINGIFY(UV_VERSION_PATCH)
+
+#if UV_VERSION_IS_RELEASE
+# define UV_VERSION_STRING  UV_VERSION_STRING_BASE
+#else
+# define UV_VERSION_STRING  UV_VERSION_STRING_BASE "-" UV_VERSION_SUFFIX
+#endif
+
+
+unsigned int uv_version(void) {
+  return UV_VERSION_HEX;
+}
+
+
+const char* uv_version_string(void) {
+  return UV_VERSION_STRING;
+}
diff --git a/deps/libtuv/test/echo_server.c b/deps/libtuv/test/echo_server.c
new file mode 100644 (file)
index 0000000..0db62e8
--- /dev/null
@@ -0,0 +1,268 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <uv.h>
+#include "runner.h"
+
+static uv_loop_t loop;
+
+static int server_closed;
+static stream_type serverType;
+static uv_tcp_t tcpServer;
+static uv_handle_t* serverHandle;
+
+
+//-----------------------------------------------------------------------------
+
+static void on_close(uv_handle_t* peer) {
+  free(peer);
+}
+
+static void on_server_close(uv_handle_t* handle) {
+  TUV_ASSERT(handle == serverHandle);
+}
+
+
+//-----------------------------------------------------------------------------
+
+static void after_write(uv_write_t* req, int status) {
+  write_req_t* wr;
+
+  /* Free the read/write buffer and the request */
+  wr = (write_req_t*) req;
+  free(wr->buf.base);
+  free(wr);
+
+  if (status == 0)
+    return;
+
+  TDLOG("uv_write error: %s - %s", uv_err_name(status), uv_strerror(status));
+}
+
+
+static void after_shutdown(uv_shutdown_t* req, int status) {
+  uv_close((uv_handle_t*) req->handle, on_close);
+  free(req);
+}
+
+
+static void after_read(uv_stream_t* handle,
+                       ssize_t nread,
+                       const uv_buf_t* buf) {
+  int i;
+  write_req_t *wr;
+  uv_shutdown_t* sreq;
+
+  if (nread < 0) {
+    /* Error or EOF */
+    TUV_ASSERT(nread == UV_EOF);
+
+    free(buf->base);
+    sreq = (uv_shutdown_t*)malloc(sizeof(uv_shutdown_t));
+    memset(sreq, 0, sizeof(uv_shutdown_t));
+    TUV_ASSERT(0 == uv_shutdown(sreq, handle, after_shutdown));
+    return;
+  }
+
+  if (nread == 0) {
+    /* Everything OK, but nothing read. */
+    free(buf->base);
+    return;
+  }
+
+  /*
+   * Scan for the letter Q which signals that we should quit the server.
+   * If we get QS it means close the stream.
+   */
+  if (!server_closed) {
+    for (i = 0; i < nread; i++) {
+      if (buf->base[i] == 'Q') {
+        if (i + 1 < nread && buf->base[i + 1] == 'S') {
+          free(buf->base);
+          uv_close((uv_handle_t*)handle, on_close);
+          return;
+        } else {
+          free(buf->base);
+          uv_close((uv_handle_t*)handle, on_close);
+          uv_close(serverHandle, on_server_close);
+          server_closed = 1;
+          //break;
+          return;
+        }
+      }
+    }
+  }
+
+  wr = (write_req_t*)malloc(sizeof(write_req_t));
+  TUV_ASSERT(wr != NULL);
+  wr->buf = uv_buf_init(buf->base, nread);
+
+  if (uv_write(&wr->req, handle, &wr->buf, 1, after_write)) {
+    TUV_FATAL("uv_write failed");
+  }
+}
+
+
+static void echo_alloc(uv_handle_t* handle,
+                       size_t suggested_size,
+                       uv_buf_t* buf) {
+  buf->base = (char*)malloc(suggested_size);
+  buf->len = suggested_size;
+}
+
+
+static void on_connection(uv_stream_t* server, int status) {
+  uv_stream_t* stream;
+  int r;
+
+  if (status != 0) {
+    TDLOG("echo server on_connection, Connect error %d, %s",
+          status, uv_err_name(status));
+    return;
+  }
+  TUV_ASSERT(status == 0);
+
+  switch (serverType) {
+  case TEST_TCP:
+    stream = (uv_stream_t*)malloc(sizeof(uv_tcp_t));
+    TUV_ASSERT(stream != NULL);
+    r = uv_tcp_init(&loop, (uv_tcp_t*)stream);
+    TUV_ASSERT(r == 0);
+    break;
+
+/*
+  case PIPE:
+    stream = (uv_stream_t*)malloc(sizeof(uv_pipe_t));
+    TUV_ASSERT(stream != NULL);
+    r = uv_pipe_init(loop, (uv_pipe_t*)stream, 0);
+    TUV_ASSERT(r == 0);
+    break;
+*/
+
+  default:
+    TUV_ASSERT(0 && "Bad serverType");
+    ABORT();
+  }
+
+  /* associate server with stream */
+  stream->data = server;
+
+  r = uv_accept(server, stream);
+  TUV_ASSERT(r == 0);
+
+  r = uv_read_start(stream, echo_alloc, after_read);
+  TUV_ASSERT(r == 0);
+
+#if defined(__HOST_HELPER__)
+  struct sockaddr_in tcpname;
+  int namelen;
+  namelen = sizeof(struct sockaddr_in);
+  uv_tcp_getpeername(stream, &tcpname, &namelen);
+  union {
+    uint8_t addr8[4];
+    uint32_t addr32;
+  } c4;
+  c4.addr32 = tcpname.sin_addr.s_addr;
+  TDDDLOG("Client has connected: %d.%d.%d.%d",
+          c4.addr8[0], c4.addr8[1], c4.addr8[2], c4.addr8[3]);
+#endif
+}
+
+
+//-----------------------------------------------------------------------------
+
+static int tcp4_echo_start(int port) {
+  struct sockaddr_in addr;
+  int r;
+
+  TUV_ASSERT(0 == uv_ip4_addr("0.0.0.0", port, &addr));
+
+  serverHandle = (uv_handle_t*)&tcpServer;
+  serverType = TEST_TCP;
+
+  r = uv_tcp_init(&loop, &tcpServer);
+  if (r) {
+    /* TODO: Error codes */
+    TDLOG("svr Socket creation error");
+    return 1;
+  }
+
+  r = uv_tcp_bind(&tcpServer, (const struct sockaddr*) &addr, 0);
+  if (r) {
+    /* TODO: Error codes */
+    TDLOG("svr Bind error");
+    return 1;
+  }
+
+  r = uv_listen((uv_stream_t*)&tcpServer, SOMAXCONN, on_connection);
+  if (r) {
+    /* TODO: Error codes */
+    TDLOG("svr Listen error %s", uv_err_name(r));
+    return 1;
+  }
+
+  return 0;
+}
+
+
+//-----------------------------------------------------------------------------
+
+HELPER_IMPL(tcp4_echo_server) {
+  int r;
+
+  server_closed = 0;
+  serverHandle = NULL;
+
+  r = uv_loop_init(&loop);
+  TUV_ASSERT(r == 0);
+
+  if (tcp4_echo_start(TEST_PORT))
+    return 1;
+
+  r = uv_run(&loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(r == 0);
+
+  assert(server_closed != 0);
+
+  TUV_ASSERT(uv_loop_close(&loop) == 0);
+
+  return 0;
+}
+
diff --git a/deps/libtuv/test/raw/apiemul.h b/deps/libtuv/test/raw/apiemul.h
new file mode 100644 (file)
index 0000000..2ba6941
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+#ifndef __apiemul_header__
+#define __apiemul_header__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define APIEMUL_DUMP_HEAP_ADDRESS 1
+
+
+int apiemultester_entry(void);
+
+void apiemul_main(void);
+void apiemul_socket(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/libtuv/test/raw/apiemul_main.c b/deps/libtuv/test/raw/apiemul_main.c
new file mode 100644 (file)
index 0000000..cc0807f
--- /dev/null
@@ -0,0 +1,23 @@
+/* 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.
+ */
+
+#include <uv.h>
+
+#include "apiemul.h"
+
+
+void apiemul_main(void) {
+  apiemul_socket();
+}
diff --git a/deps/libtuv/test/raw/apiemul_socket.c b/deps/libtuv/test/raw/apiemul_socket.c
new file mode 100644 (file)
index 0000000..fc366a9
--- /dev/null
@@ -0,0 +1,377 @@
+/* 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <uv.h>
+
+#include "apiemul.h"
+
+
+#if defined(__TUV_HOST_IPEXIST__)
+#include "tuv_host_ipaddress.h"
+#else
+#pragma message("Please create tuv_host_ipaddress.h for tcp_open test.")
+#endif
+
+// Please create a file with your host IP address like below.
+// This information is use to connect to host that should be running
+// "tuvhelper" prgoram.
+/*
+#ifndef __tuv_host_ipaddress_header__
+#define __tuv_host_ipaddress_header__
+
+#define HOST_IP_ADDRESS   "192.168.1.2"
+
+#endif
+*/
+
+//----------------------------------------------------------------------------
+
+#define HOST_ECHO_PORT 9123
+
+#define SOCKET_TEST_PORT 7777
+#define SOCKET_TEST_CLIENT_MAX 16
+#define SOCKET_TEST_READBUFFER 1024
+
+//----------------------------------------------------------------------------
+
+// task for network poll
+static uv_thread_t _thread;
+static uv_thread_t _thread_cli;
+
+static struct sockaddr_in _addr_in;
+static int _sock_server;
+static int _sock_client;
+
+static int sock_clients[SOCKET_TEST_CLIENT_MAX];
+static int sock_client_cnt;
+
+static unsigned char read_buffer[SOCKET_TEST_READBUFFER];
+static unsigned char read_client[SOCKET_TEST_READBUFFER];
+
+
+//----------------------------------------------------------------------------
+
+static void test_init_clients(void) {
+  int i;
+  sock_client_cnt = 0;
+  for (i=0;i<SOCKET_TEST_CLIENT_MAX; i++) {
+    sock_clients[i] = -1;
+  }
+}
+
+static int test_client_count(void) {
+  return sock_client_cnt;
+}
+
+static int test_client_add(int fd) {
+  int i;
+  for (i=0;i<SOCKET_TEST_CLIENT_MAX; i++) {
+    if (sock_clients[i] < 0) {
+      sock_clients[i] = fd;
+      sock_client_cnt++;
+      return fd;
+    }
+  }
+  return -1;
+}
+
+static int test_client_sub(int fd) {
+  int i;
+  for (i=0;i<SOCKET_TEST_CLIENT_MAX; i++) {
+    if (sock_clients[i] == fd) {
+      sock_clients[i] = -1;
+      sock_client_cnt--;
+      return fd;
+    }
+  }
+  return -1;
+}
+
+static int test_client_fillfds(struct pollfd* fds) {
+  int i, j;
+  for (i=0, j=0;i<SOCKET_TEST_CLIENT_MAX; i++) {
+    if (sock_clients[i] > 0) {
+      fds[j].fd = sock_clients[i];
+      fds[j].events = POLLIN | POLLHUP;
+      j++;
+    }
+  }
+  return j;
+}
+
+//----------------------------------------------------------------------------
+
+static int inet_pton4(const char *src, unsigned char *dst) {
+  static const char digits[] = "0123456789";
+  int saw_digit, octets, ch;
+  unsigned char tmp[sizeof(struct in_addr)], *tp;
+
+  saw_digit = 0;
+  octets = 0;
+  *(tp = tmp) = 0;
+  while ((ch = *src++) != '\0') {
+    const char *pch;
+
+    if ((pch = strchr(digits, ch)) != NULL) {
+      unsigned int nw = *tp * 10 + (pch - digits);
+
+      if (saw_digit && *tp == 0)
+        return UV_EINVAL;
+      if (nw > 255)
+        return UV_EINVAL;
+      *tp = nw;
+      if (!saw_digit) {
+        if (++octets > 4)
+          return UV_EINVAL;
+        saw_digit = 1;
+      }
+    } else if (ch == '.' && saw_digit) {
+      if (octets == 4)
+        return UV_EINVAL;
+      *++tp = 0;
+      saw_digit = 0;
+    } else
+      return UV_EINVAL;
+  }
+  if (octets < 4)
+    return UV_EINVAL;
+  memcpy(dst, tmp, sizeof(struct in_addr));
+  return 0;
+}
+
+static int ip4_addr(const char* ip, int port, struct sockaddr_in* addr) {
+  memset(addr, 0, sizeof(*addr));
+  addr->sin_family = AF_INET;
+  addr->sin_port = port;
+  return inet_pton4(ip, (unsigned char *)&(addr->sin_addr.s_addr));
+}
+
+static void dump_socket_info(int sockfd) {
+  struct sockaddr_in addrthis;
+  socklen_t len = sizeof(addrthis);
+  union {
+    uint8_t addr8[4];
+    uint32_t addr32;
+  } c4;
+
+  int ret = tuvp_getsockname(sockfd, (struct sockaddr*)&addrthis, &len);
+  c4.addr32 = addrthis.sin_addr.s_addr;
+  if (ret == 0) {
+    printf("%d.%d.%d.%d:%d",
+           c4.addr8[0], c4.addr8[1], c4.addr8[2], c4.addr8[3],
+           addrthis.sin_port);
+  }
+  else {
+    printf("(invalid socket)");
+  }
+}
+
+static void test_new_connection(int sockserver) {
+  struct sockaddr addr_client;
+  int clisockfd;
+  socklen_t socklen;
+
+  memset(&addr_client, 0, sizeof(addr_client));
+  socklen = (socklen_t)sizeof(addr_client);
+  clisockfd = tuvp_accept(sockserver, &addr_client, &socklen);
+  assert(addr_client.sa_family == AF_INET);
+
+  printf(".. new connection to ");
+  dump_socket_info(clisockfd);
+
+  struct sockaddr_in* addrin = (struct sockaddr_in*)&addr_client;
+  union {
+    uint8_t addr8[4];
+    uint32_t addr32;
+  } c4;
+  c4.addr32 = addrin->sin_addr.s_addr;
+  printf(" fd(%d) from %d.%d.%d.%d:%d\r\n",
+         clisockfd,
+         c4.addr8[0], c4.addr8[1], c4.addr8[2], c4.addr8[3],
+         addrin->sin_port);
+
+  test_client_add(clisockfd);
+
+  const char* msg;
+  msg = "Welcome to libtuv api test echo server!\r\nSend 'Q' to end.\r\n";
+  tuvp_write(clisockfd, msg, strlen(msg));
+}
+
+static void test_handle_read(int sockfd) {
+  ssize_t result;
+  result = tuvp_read(sockfd, read_buffer, SOCKET_TEST_READBUFFER);
+  if (result > 0) {
+    read_buffer[result] = 0;
+    if (read_buffer[0] == 'Q') {
+      tuvp_close(sockfd);
+      test_client_sub(sockfd);
+      printf(".. RECV with 'Q', socket closed\r\n");
+      return;
+    }
+    tuvp_write(sockfd, read_buffer, strlen((const char*)read_buffer));
+  }
+}
+
+static void do_tcp_server_start(void) {
+  int result;
+  tuvp_tcp_init();
+
+  ip4_addr("0.0.0.0", tuvp_htons(SOCKET_TEST_PORT), &_addr_in);
+  _sock_server = tuvp_socket(AF_INET, SOCK_STREAM, 0);
+
+  result = tuvp_bind(_sock_server,
+                     (const struct sockaddr*)&_addr_in,
+                     sizeof(_addr_in));
+  if (result != 0) {
+    printf("!! tuvp_bind failed (%d)\r\n", result);
+    return;
+  }
+  result = tuvp_listen(_sock_server, SOMAXCONN);
+  if (result != 0) {
+    printf("!! tuvp_listen failed (%d)\r\n", result);
+    return;
+  }
+
+  printf(".. echo server started at ");
+  dump_socket_info(_sock_server);
+  printf("\r\n");
+
+  printf(".. use 'telnet' to test, manually\r\n");
+}
+
+static void do_poll_test(void) {
+  struct pollfd* fds;
+  int fds_cnt;
+
+  // prepare fds
+  fds_cnt = 1 + test_client_count();
+  fds = (struct pollfd*)malloc(sizeof(struct pollfd) * fds_cnt);
+  memset(fds, 0, sizeof(struct pollfd) * fds_cnt);
+
+  // add listener
+  fds[0].fd = _sock_server;
+  fds[0].events = POLLIN;
+  // add others
+  test_client_fillfds(&fds[1]);
+
+  // call poll
+  if (tuvp_net_poll(fds, fds_cnt) > 0) {
+    if (fds[0].revents & POLLIN) {
+      // server has new connection
+      test_new_connection(_sock_server);
+    }
+    else {
+      int i;
+      for (i=1; i<fds_cnt; i++) {
+        if (fds[i].revents & POLLHUP) {
+          // client hang-up
+          tuvp_close(fds[i].fd);
+          test_client_sub(fds[i].fd);
+        }
+        else if (fds[i].revents & POLLIN) {
+          // client has sent something
+          test_handle_read(fds[i].fd);
+        }
+      }
+    }
+  }
+  free(fds);
+}
+
+#if defined(__TUV_HOST_IPEXIST__)
+static void clitest_entry(void* arg) {
+}
+
+static int clitest_loop(void* arg) {
+  int rsend;
+  static int send_count = 0;
+  static int ok_to_send = 1;
+  struct pollfd fds;
+
+  fds.fd = _sock_client;
+  fds.events = POLLIN | POLLOUT;
+  if (tuvp_net_poll(&fds, 1) > 0) {
+    if (fds.revents & POLLOUT) {
+      rsend = rand() % 100;
+      if (rsend == 0 && ok_to_send) {
+        const char* msg = "Hello api emul tester!";
+        tuvp_write(_sock_client, msg, strlen(msg));
+        ok_to_send = 0;
+      }
+    }
+    if (fds.revents & POLLIN) {
+      tuvp_read(_sock_client, read_client, SOCKET_TEST_READBUFFER);
+      printf(":: read [%s]\r\n", read_client);
+      send_count++;
+      ok_to_send = 1;
+    }
+  }
+  if (send_count > 10) {
+    tuvp_close(_sock_client);
+    _sock_client = -1;
+    ok_to_send = 0;
+    printf(":: connect/send ok. close client\r\n");
+    return 0;
+  }
+  return 1;
+}
+
+static void do_tcp_client_connect(void) {
+  _sock_client = tuvp_socket(AF_INET, SOCK_STREAM, 0);
+  if (_sock_client == -1) {
+    printf("!! tuvp_socket failed, err(%d)\r\n", get_errno());
+    return;
+  }
+
+  struct sockaddr_in server_addr;
+  uv_ip4_addr(HOST_IP_ADDRESS, HOST_ECHO_PORT, &server_addr);
+
+  tuvp_connect(_sock_client, (const sockaddr*)&server_addr,
+               sizeof(server_addr));
+
+  tuv_task_create(&_thread_cli, clitest_entry, clitest_loop, NULL);
+}
+#endif
+
+static void task_entry(void* arg) {
+  test_init_clients();
+  do_tcp_server_start();
+}
+
+static int task_loop(void* arg) {
+#if defined(__TUV_HOST_IPEXIST__)
+  if (_sock_client == -2) {
+    do_tcp_client_connect();
+  }
+#endif
+  do_poll_test();
+  return 1; /* continue task */
+}
+
+/*
+ * socket api testing with echo server
+ *  - start server and wait for connections
+ *  - use 'telnet (server_ip) 7777'
+ *  - to close connection, send "Q"
+ */
+void apiemul_socket(void) {
+  _sock_client = -2;
+  _sock_server = -1;
+  tuv_task_create(&_thread, task_entry, task_loop, NULL);
+}
diff --git a/deps/libtuv/test/raw/echo_server_raw.c b/deps/libtuv/test/raw/echo_server_raw.c
new file mode 100644 (file)
index 0000000..08ce727
--- /dev/null
@@ -0,0 +1,264 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <uv.h>
+#include "runner.h"
+
+static uv_loop_t loop;
+
+static int server_closed;
+static stream_type serverType;
+static uv_tcp_t tcpServer;
+static uv_handle_t* serverHandle;
+
+
+//-----------------------------------------------------------------------------
+
+static void on_close(uv_handle_t* peer) {
+  free(peer);
+}
+
+static void on_server_close(uv_handle_t* handle) {
+  TUV_ASSERT(handle == serverHandle);
+}
+
+
+//-----------------------------------------------------------------------------
+
+static void after_write(uv_write_t* req, int status) {
+  write_req_t* wr;
+
+  /* Free the read/write buffer and the request */
+  wr = (write_req_t*) req;
+  free(wr->buf.base);
+  free(wr);
+
+  if (status == 0)
+    return;
+
+  TDLOG("uv_write error: %s - %s", uv_err_name(status), uv_strerror(status));
+}
+
+
+static void after_shutdown(uv_shutdown_t* req, int status) {
+  uv_close((uv_handle_t*) req->handle, on_close);
+  free(req);
+}
+
+
+static void after_read(uv_stream_t* handle,
+                       ssize_t nread,
+                       const uv_buf_t* buf) {
+  int i;
+  write_req_t *wr;
+  uv_shutdown_t* sreq;
+
+  if (nread < 0) {
+    /* Error or EOF */
+    TUV_ASSERT(nread == UV_EOF);
+
+    free(buf->base);
+    sreq = (uv_shutdown_t*)malloc(sizeof(uv_shutdown_t));
+    memset(sreq, 0, sizeof(uv_shutdown_t));
+    TUV_ASSERT(0 == uv_shutdown(sreq, handle, after_shutdown));
+    return;
+  }
+
+  if (nread == 0) {
+    /* Everything OK, but nothing read. */
+    free(buf->base);
+    return;
+  }
+
+  /*
+   * Scan for the letter Q which signals that we should quit the server.
+   * If we get QS it means close the stream.
+   */
+  if (!server_closed) {
+    for (i = 0; i < nread; i++) {
+      if (buf->base[i] == 'Q') {
+        if (i + 1 < nread && buf->base[i + 1] == 'S') {
+          free(buf->base);
+          uv_close((uv_handle_t*)handle, on_close);
+          return;
+        } else {
+          free(buf->base);
+          uv_close((uv_handle_t*)handle, on_close);
+          uv_close(serverHandle, on_server_close);
+          server_closed = 1;
+          //break;
+          return;
+        }
+      }
+    }
+  }
+
+  wr = (write_req_t*)malloc(sizeof(write_req_t));
+  TUV_ASSERT(wr != NULL);
+  wr->buf = uv_buf_init(buf->base, nread);
+
+  if (uv_write(&wr->req, handle, &wr->buf, 1, after_write)) {
+    TUV_FATAL("uv_write failed");
+  }
+}
+
+
+static void echo_alloc(uv_handle_t* handle,
+                       size_t suggested_size,
+                       uv_buf_t* buf) {
+  buf->base = (char*)malloc(suggested_size);
+  buf->len = suggested_size;
+}
+
+
+static void on_connection(uv_stream_t* server, int status) {
+  uv_stream_t* stream;
+  int r;
+
+  if (status != 0) {
+    TDLOG("echo server on_connection, Connect error %d, %s",
+          status, uv_err_name(status));
+    return;
+  }
+  TUV_ASSERT(status == 0);
+  TDDDLOG("echo server test on_connection server(%p)", server);
+
+  switch (serverType) {
+  case TEST_TCP:
+    stream = (uv_stream_t*)malloc(sizeof(uv_tcp_t));
+    TUV_ASSERT(stream != NULL);
+    r = uv_tcp_init(&loop, (uv_tcp_t*)stream);
+    TUV_ASSERT(r == 0);
+    break;
+
+/*
+  case PIPE:
+    stream = (uv_stream_t*)malloc(sizeof(uv_pipe_t));
+    TUV_ASSERT(stream != NULL);
+    r = uv_pipe_init(loop, (uv_pipe_t*)stream, 0);
+    TUV_ASSERT(r == 0);
+    break;
+*/
+
+  default:
+    TUV_ASSERT(0 && "Bad serverType");
+    ABORT();
+  }
+
+  /* associate server with stream */
+  stream->data = server;
+
+  r = uv_accept(server, stream);
+  TUV_ASSERT(r == 0);
+
+  r = uv_read_start(stream, echo_alloc, after_read);
+  TUV_ASSERT(r == 0);
+}
+
+
+//-----------------------------------------------------------------------------
+
+static int tcp4_echo_start(int port) {
+  struct sockaddr_in addr;
+  int r;
+
+  TUV_ASSERT(0 == uv_ip4_addr("0.0.0.0", port, &addr));
+
+  serverHandle = (uv_handle_t*)&tcpServer;
+  serverType = TEST_TCP;
+
+  r = uv_tcp_init(&loop, &tcpServer);
+  if (r) {
+    /* TODO: Error codes */
+    TDLOG("svr Socket creation error");
+    return 1;
+  }
+
+  r = uv_tcp_bind(&tcpServer, (const struct sockaddr*) &addr, 0);
+  if (r) {
+    /* TODO: Error codes */
+    TDLOG("svr Bind error");
+    return 1;
+  }
+
+  r = uv_listen((uv_stream_t*)&tcpServer, SOMAXCONN, on_connection);
+  if (r) {
+    /* TODO: Error codes */
+    TDLOG("svr Listen error %s", uv_err_name(r));
+    return 1;
+  }
+
+  return 0;
+}
+
+
+//-----------------------------------------------------------------------------
+
+static int echo_server_loop(void* vparam) {
+  uv_run(&loop, UV_RUN_ONCE);
+#pragma message "Make it stop running when signaled"
+  return 1;
+}
+
+static int echo_server_final(void* vparam) {
+  assert(server_closed != 0);
+
+  TUV_ASSERT(uv_loop_close(&loop) == 0);
+}
+
+HELPER_IMPL(tcp4_echo_server) {
+  int r;
+
+  server_closed = 0;
+  serverHandle = NULL;
+
+  r = uv_loop_init(&loop);
+  TUV_ASSERT(r == 0);
+
+  if (tcp4_echo_start(TEST_PORT))
+    return 1;
+
+  tuv_run(&loop, echo_server_loop, echo_server_final, NULL);
+
+  run_tests_continue();
+
+  return 0;
+}
+
diff --git a/deps/libtuv/test/raw/raw_main.c b/deps/libtuv/test/raw/raw_main.c
new file mode 100644 (file)
index 0000000..61bb92e
--- /dev/null
@@ -0,0 +1,28 @@
+/* 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.
+ */
+
+#include <uv.h>
+
+#include "raw_main.h"
+#include "apiemul.h"
+
+
+void call_tuv_tester(void) {
+#if defined(__TUV_APIEMUL__)
+  apiemultester_entry();
+#else
+  tuvtester_entry();
+#endif
+}
diff --git a/deps/libtuv/test/raw/raw_main.h b/deps/libtuv/test/raw/raw_main.h
new file mode 100644 (file)
index 0000000..020c9a5
--- /dev/null
@@ -0,0 +1,38 @@
+/* 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.
+ */
+
+#ifndef __raw_main_header__
+#define __raw_main_header__
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void tuvtester_entry(void);
+
+// to make tuv to control which tester to begin
+void call_tuv_tester(void);
+  // can call regular unit tester, tuvtester_entry()
+  // can call api emulator for raw system, apiemultester_entry()
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/deps/libtuv/test/raw/runner_main_raw.c b/deps/libtuv/test/raw/runner_main_raw.c
new file mode 100644 (file)
index 0000000..6eb6cd2
--- /dev/null
@@ -0,0 +1,203 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <unistd.h>
+#include <uv.h>
+
+#include "runner.h"
+
+
+//-----------------------------------------------------------------------------
+// test function list
+
+#define TEST_ENTRY(name, timeout) \
+  { #name, #name, &run_test_##name, 0, 0, timeout },
+
+task_entry_t TASKS[] = {
+
+  TEST_LIST_ALL(TEST_ENTRY)
+  TEST_LIST_EXT(TEST_ENTRY)
+
+  { NULL, NULL, NULL, 0, 0, 0 }
+};
+
+#undef TEST_ENTRY
+
+//-----------------------------------------------------------------------------
+// test function list
+
+#define HELPER_ENTRY(task_name, name)               \
+    { #task_name, #name, &run_helper_##name, 1, 0, 0 },
+
+task_entry_t HELPERS[] = {
+
+  HELPER_LIST_ALL(HELPER_ENTRY)
+
+  { NULL, NULL, NULL, 0, 0, 0 }
+};
+
+#undef HELPER_ENTRY
+
+//-----------------------------------------------------------------------------
+
+int run_test_part(const char* test, const char* part) {
+  int r;
+  task_entry_t* task;
+
+  for (task = TASKS; task->main; task++) {
+    if (strcmp(test, task->task_name) == 0 &&
+        strcmp(part, task->process_name) == 0) {
+      r = task->main();
+      return r;
+    }
+  }
+
+  fprintf(stderr, "No test part with that name: %s:%s\n", test, part);
+  return 255;
+}
+
+
+task_entry_t* get_helper(const char* test) {
+  int r;
+  task_entry_t* task;
+
+  for (task = HELPERS; task->main; task++) {
+    if (strcmp(test, task->task_name) == 0) {
+      return task;
+    }
+  }
+  return NULL;
+}
+
+static int cur_task = 0;
+static int cur_entry = 0;
+
+void run_tests_init(void) {
+  cur_task = 0;
+  cur_entry = 0;
+}
+
+
+void run_tests_one(void) {
+  task_entry_t* task_group = NULL;
+  task_entry_t* task = NULL;
+
+  while (1) {
+    switch (cur_task) {
+    case 0 :
+      if (!cur_entry)
+        fprintf(stderr, "Run Helpers...\r\n");
+      task_group = HELPERS;
+      break;
+    case 2 :
+      if (!cur_entry)
+        fprintf(stderr, "Stopping Helpers...\r\n");
+      task_group = HELPERS;
+      break;
+    case 1 :
+      task_group = TASKS;
+      break;
+    default:
+      run_test_one(NULL);
+      return;
+    }
+    task = &task_group[cur_entry];
+    if (task && task->task_name) {
+      fprintf(stderr, "[%-30s]\r\n", task->task_name);
+
+      switch (cur_task) {
+      case 0 : run_helper(task); break;
+      case 1 : run_test_one(task); break;
+      case 2 : wait_helper(task); break;
+      }
+      cur_entry++;
+      return;
+    }
+    cur_entry = 0;
+    cur_task++;
+  }
+}
+
+
+// dummy for api emulator
+void apiemul_main(void) {
+}
+
+#if 0
+int run_tests() {
+  int entry;
+  int result;
+  task_entry_t* task;
+
+  fprintf(stderr, "Run Helpers...\r\n");
+  entry = 0;
+  while (HELPERS[entry].task_name) {
+    task = &HELPERS[entry];
+
+    fprintf(stderr, "[%-30s]...", task->task_name);
+    result = run_helper(task);
+    fprintf(stderr, "%s\r\n", result ? "failed" : "OK");
+    entry++;
+  }
+
+  entry = 0;
+  while (TASKS[entry].task_name) {
+    task = &TASKS[entry];
+
+    fprintf(stderr, "[%-30s]...", task->task_name);
+    result = run_test_one(task);
+    fprintf(stderr, "%s\r\n", result ? "failed" : "OK");
+    entry++;
+  }
+
+  fprintf(stderr, "Waiting Helpers to end...\r\n");
+  entry = 0;
+  while (HELPERS[entry].task_name) {
+    task = &HELPERS[entry];
+
+    fprintf(stderr, "[%-30s]...", task->task_name);
+    result = wait_helper(task);
+    fprintf(stderr, "%s\r\n", result ? "failed" : "OK");
+    entry++;
+  }
+
+  fprintf(stderr, "run_tests end\r\n");
+
+  return 0;
+}
+#endif
+
diff --git a/deps/libtuv/test/raw/test_active_raw.c b/deps/libtuv/test/raw/test_active_raw.c
new file mode 100644 (file)
index 0000000..76bc0df
--- /dev/null
@@ -0,0 +1,138 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+static int close_cb_called = 0;
+
+
+static void close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  close_cb_called++;
+}
+
+
+static void timer_cb(uv_timer_t* handle) {
+  TUV_ASSERT(0 && "timer_cb should not have been called");
+}
+
+
+typedef struct {
+
+  uv_loop_t* loop;
+  uv_timer_t timer;
+
+} active_param_t;
+
+
+static int active_loop(void* vparam) {
+  active_param_t* param = (active_param_t*)vparam;
+  uv_loop_t* loop = param->loop;
+  int r;
+
+  r = uv_run(loop, UV_RUN_ONCE);
+
+  return r; // continue while r == 1
+}
+
+static int active_final(void* vparam) {
+  active_param_t* param = (active_param_t*)vparam;
+  uv_loop_t* loop = param->loop;
+
+  TUV_ASSERT(close_cb_called == 1);
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+
+TEST_IMPL(active) {
+  uv_loop_t* loop;
+  active_param_t* param;
+
+  param = (active_param_t*)malloc(sizeof(active_param_t));
+  loop = uv_default_loop();
+  param->loop = loop;
+
+  int r;
+
+  close_cb_called = 0;
+
+  r = uv_timer_init(loop, &param->timer);
+  TUV_ASSERT(r == 0);
+
+  /* uv_is_active() and uv_is_closing() should always return either 0 or 1. */
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) &param->timer));
+  TUV_ASSERT(0 == uv_is_closing((uv_handle_t*) &param->timer));
+
+  r = uv_timer_start(&param->timer, timer_cb, 1000, 0);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(1 == uv_is_active((uv_handle_t*) &param->timer));
+  TUV_ASSERT(0 == uv_is_closing((uv_handle_t*) &param->timer));
+
+  r = uv_timer_stop(&param->timer);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) &param->timer));
+  TUV_ASSERT(0 == uv_is_closing((uv_handle_t*) &param->timer));
+
+  r = uv_timer_start(&param->timer, timer_cb, 1000, 0);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(1 == uv_is_active((uv_handle_t*) &param->timer));
+  TUV_ASSERT(0 == uv_is_closing((uv_handle_t*) &param->timer));
+
+  uv_close((uv_handle_t*) &param->timer, close_cb);
+
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) &param->timer));
+  TUV_ASSERT(1 == uv_is_closing((uv_handle_t*) &param->timer));
+
+  tuv_run(loop, active_loop, active_final, param);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_async_raw.c b/deps/libtuv/test/raw/test_async_raw.c
new file mode 100644 (file)
index 0000000..ff630f9
--- /dev/null
@@ -0,0 +1,181 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+static uv_thread_t _thread;
+static uv_mutex_t _mutex;
+
+static uv_timer_t _timer;
+static uv_async_t _async;
+
+static int _async_cb_called;
+static int _timer_cb_called;
+static int _close_cb_called;
+
+
+static void task_entry(void* arg) {
+}
+
+static int task_loop(void* arg) {
+  int n;
+  int r;
+
+  uv_mutex_lock(&_mutex);
+  n = _async_cb_called;
+  uv_mutex_unlock(&_mutex);
+
+  if (n == 3) {
+    // stop task
+    return 0;
+  }
+
+  r = uv_async_send(&_async);
+  TUV_ASSERT(r == 0);
+
+  // continue task
+  return 1;
+}
+
+
+static void close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  _close_cb_called++;
+}
+
+
+static void async_cb(uv_async_t* handle) {
+  int n;
+
+  TUV_ASSERT(handle == &_async);
+
+  uv_mutex_lock(&_mutex);
+  n = ++_async_cb_called;
+  uv_mutex_unlock(&_mutex);
+
+  if (n == 3) {
+    uv_close((uv_handle_t*)&_async, close_cb);
+  }
+}
+
+
+static void timer_cb(uv_timer_t* timer) {
+  int r;
+
+  TUV_ASSERT(timer == &_timer);
+  _timer_cb_called++;
+
+  r = tuv_task_create(&_thread, task_entry, task_loop, NULL);
+  TUV_ASSERT(r == 0);
+  uv_mutex_unlock(&_mutex);
+
+  uv_close((uv_handle_t*)timer, NULL);
+}
+
+
+//-----------------------------------------------------------------------------
+
+typedef struct {
+  uv_loop_t* loop;
+} async_param_t;
+
+
+static int async_loop(void* vparam) {
+  async_param_t* param = (async_param_t*)vparam;
+  int r;
+  r = uv_run(param->loop, UV_RUN_ONCE);
+  if (r == 0) {
+    if (tuv_task_running(&_thread))
+      return 1;
+  }
+  return r;
+}
+
+
+static int async_final(void* vparam) {
+  async_param_t* param = (async_param_t*)vparam;
+
+  TUV_ASSERT(_async_cb_called == 3);
+  TUV_ASSERT(_close_cb_called == 1);
+  TUV_ASSERT(_timer_cb_called == 1);
+
+  //TUV_ASSERT(0 == uv_thread_join(&_thread));
+
+  uv_mutex_destroy(&_mutex);
+  tuv_task_close(&_thread);
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+
+TEST_IMPL(async) {
+  async_param_t* param = (async_param_t*)malloc(sizeof(async_param_t));
+  param->loop = uv_default_loop();
+
+  int r;
+
+  _async_cb_called = 0;
+  _timer_cb_called = 0;
+  _close_cb_called = 0;
+
+  r = uv_mutex_init(&_mutex);
+  TUV_ASSERT(r == 0);
+  uv_mutex_lock(&_mutex);
+
+  r = uv_async_init(param->loop, &_async, async_cb);
+  TUV_ASSERT(r == 0);
+
+  r = uv_timer_init(param->loop, &_timer);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&_timer, timer_cb, 250, 0);
+  TUV_ASSERT(r == 0);
+
+  tuv_run(param->loop, async_loop, async_final, param);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_condvar_raw.c b/deps/libtuv/test/raw/test_condvar_raw.c
new file mode 100644 (file)
index 0000000..bb1b115
--- /dev/null
@@ -0,0 +1,143 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <errno.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+typedef struct {
+  uv_mutex_t mutex;
+  uv_cond_t cond;
+  int delay;
+  int use_broadcast;
+  volatile int posted;
+  void* data;
+} worker_config;
+
+
+static void worker_entry(void* arg) {
+  worker_config* c = (worker_config*)arg;
+
+  if (c->delay)
+    run_sleep(c->delay);
+
+  uv_mutex_lock(&c->mutex);
+  TUV_ASSERT(c->posted == 0);
+  c->posted = 1;
+  if (c->use_broadcast)
+    uv_cond_broadcast(&c->cond);
+  else
+    uv_cond_signal(&c->cond);
+  uv_mutex_unlock(&c->mutex);
+}
+
+static int worker_loop(void* arg) {
+  // stop the loop
+  return 0;
+}
+
+
+typedef struct {
+  uv_loop_t* loop;
+  uv_thread_t thread;
+  worker_config wc;
+  int waitcond;
+} condvar_1_param_t;
+
+
+static int condvar_1_loop(void* vparam) {
+  condvar_1_param_t* param = (condvar_1_param_t*)vparam;
+  int r;
+
+  if (param->waitcond) {
+    uv_mutex_lock(&param->wc.mutex);
+    run_sleep(100);
+    r = tuv_cond_wait(&param->wc.cond, &param->wc.mutex);
+    uv_mutex_unlock(&param->wc.mutex);
+    if (r == 0) {
+      // keep the loop going
+      return 1;
+    }
+    param->waitcond = 0;
+  }
+  // check task has closed(something like thread joined)
+  r = tuv_task_running(&param->thread);
+  // r=1 for task needs to run, return 1 so that loop keeps going
+  // r=0 for task has ended, return 0 so that loop ends
+  return r > 0 ? 1 : 0;
+}
+
+static int condvar_1_final(void* vparam) {
+  condvar_1_param_t* param = (condvar_1_param_t*)vparam;
+
+  TUV_ASSERT(param->wc.posted == 1);
+
+  tuv_task_close(&param->thread);
+  uv_mutex_destroy(&param->wc.mutex);
+  uv_cond_destroy(&param->wc.cond);
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+
+TEST_IMPL(condvar_1) {
+  condvar_1_param_t* param;
+  param = (condvar_1_param_t*)malloc(sizeof(condvar_1_param_t));
+  param->loop = uv_default_loop();
+
+  memset(&param->wc, 0, sizeof(param->wc));
+  param->wc.data = param;
+  param->waitcond = 1;
+
+  TUV_ASSERT(0 == uv_cond_init(&param->wc.cond));
+  TUV_ASSERT(0 == uv_mutex_init(&param->wc.mutex));
+  TUV_ASSERT(0 == tuv_task_create(&param->thread,
+                                 worker_entry, worker_loop,
+                                 &param->wc));
+
+  tuv_run(param->loop, condvar_1_loop, condvar_1_final, param);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_idle_raw.c b/deps/libtuv/test/raw/test_idle_raw.c
new file mode 100644 (file)
index 0000000..0b36c7c
--- /dev/null
@@ -0,0 +1,73 @@
+/* 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.
+ */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <uv.h>
+#include "runner.h"
+
+
+static uv_idle_t idle_handle;
+static int idle_cb_called = 0;
+
+void idle_callback(uv_idle_t* handle) {
+  idle_cb_called++;
+}
+
+
+typedef struct {
+  uv_loop_t* loop;
+} idle_param_t;
+
+
+static int idle_base_loop(void* vparam) {
+  idle_param_t* param = (idle_param_t*)vparam;
+  uv_run(param->loop, UV_RUN_ONCE);
+  return 0; // stop the loop
+}
+
+static int idle_base_final(void* vparam) {
+  idle_param_t* param = (idle_param_t*)vparam;
+
+  uv_close((uv_handle_t*) &idle_handle, NULL);
+  uv_run(param->loop, UV_RUN_ONCE);
+
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+  TUV_WARN(idle_cb_called == 1);
+
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+TEST_IMPL(idle_basic) {
+  idle_param_t* param = (idle_param_t*)malloc(sizeof(idle_param_t));
+  param->loop = uv_default_loop();
+
+  idle_cb_called = 0;
+
+  uv_idle_init(param->loop, &idle_handle);
+  uv_idle_start(&idle_handle, idle_callback);
+
+  tuv_run(param->loop, idle_base_loop, idle_base_final, param);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_shutdown_eof_raw.c b/deps/libtuv/test/raw/test_shutdown_eof_raw.c
new file mode 100644 (file)
index 0000000..2840987
--- /dev/null
@@ -0,0 +1,206 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <uv.h>
+#include "runner.h"
+
+
+#if defined(__TUV_HOST_IPEXIST__)
+#include "tuv_host_ipaddress.h"
+#else
+#pragma message("Please create tuv_host_ipaddress.h for shutdown_eof test.")
+#endif
+
+// Please create a file with your host IP address like below.
+// This information is use to connect to host that should be running
+// "tuvhelper" prgoram.
+/*
+#ifndef __tuv_host_ipaddress_header__
+#define __tuv_host_ipaddress_header__
+
+#define HOST_IP_ADDRESS   "192.168.1.2"
+
+#endif
+*/
+
+//-----------------------------------------------------------------------------
+
+#if defined(__TUV_HOST_IPEXIST__)
+static uv_tcp_t tcp;
+static uv_connect_t connect_req;
+static uv_write_t write_req;
+static uv_shutdown_t shutdown_req;
+static int got_q;
+static int got_eof;
+
+static int called_connect_cb;
+static int called_shutdown_cb;
+
+
+static void alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) {
+  buf->base = (char*)malloc(size);
+  buf->len = size;
+}
+
+
+static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) {
+  TUV_ASSERT((uv_tcp_t*)t == &tcp);
+
+
+  if (buf->base)
+    free(buf->base);
+
+  if (nread == 0) {
+    return;
+  }
+
+  if (nread > 0) {
+    TUV_ASSERT(0);
+    //TUV_ASSERT(!got_eof);
+    //TUV_ASSERT(buf->base[0] == 'Q');
+    //uv_buf_t qbuf = uv_buf_init((char*)"Q", 1);
+    //int r = uv_write(&write_req, t, &qbuf, 1, NULL);
+    //TUV_ASSERT(r == 0);
+    //got_q = 1;
+  } else {
+    TUV_ASSERT(nread == UV_EOF);
+    uv_close((uv_handle_t*)t, NULL);
+    got_eof = 1;
+  }
+}
+
+
+static void shutdown_cb(uv_shutdown_t *req, int status) {
+  TUV_ASSERT(req == &shutdown_req);
+  TUV_ASSERT(called_connect_cb == 1);
+  TUV_ASSERT(!got_eof);
+
+  called_shutdown_cb++;
+}
+
+
+static void connect_cb(uv_connect_t *req, int status) {
+  TUV_ASSERT(status == 0);
+  TUV_ASSERT(req == &connect_req);
+  int r;
+
+  /* Start reading from our connection so we can receive the EOF.  */
+  r = uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb);
+  TUV_ASSERT(r == 0);
+
+  /*
+   * Write the letter 'Q' to gracefully kill the echo-server. This will not
+   * effect our connection.
+   */
+  uv_buf_t qsbuf = uv_buf_init((char*)"Q", 1);
+  r = uv_write(&write_req, (uv_stream_t*) &tcp, &qsbuf, 1, NULL);
+  TUV_ASSERT(r == 0);
+
+  /* Shutdown our end of the connection.  */
+  //r = uv_shutdown(&shutdown_req, (uv_stream_t*) &tcp, shutdown_cb);
+  //TUV_ASSERT(r == 0);
+
+  called_connect_cb++;
+  TUV_ASSERT(called_shutdown_cb == 0);
+}
+
+
+typedef struct {
+  uv_loop_t* loop;
+} shutdown_eof_param_t;
+
+static int shutdown_eof_loop(void* vparam) {
+  shutdown_eof_param_t* param = (shutdown_eof_param_t*)vparam;
+  return uv_run(param->loop, UV_RUN_ONCE);
+}
+
+static int shutdown_eof_final(void* vparam) {
+  shutdown_eof_param_t* param = (shutdown_eof_param_t*)vparam;
+
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  TUV_ASSERT(1 == called_connect_cb);
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+#endif
+
+/*
+ * This test has a client which connects to the echo_server and immediately
+ * issues a shutdown. The echo-server, in response, will also shutdown their
+ * connection. We check, with a timer, that libuv is not automatically
+ * calling uv_close when the client receives the EOF from echo-server.
+ */
+TEST_IMPL(shutdown_eof) {
+#if defined(__TUV_HOST_IPEXIST__)
+  shutdown_eof_param_t* param;
+  param = (shutdown_eof_param_t*)malloc(sizeof(shutdown_eof_param_t));
+  param->loop = uv_default_loop();
+
+  struct sockaddr_in server_addr;
+  int r;
+
+  got_q = 0;
+  got_eof = 0;
+  called_connect_cb = 0;
+  called_shutdown_cb = 0;
+
+  r = uv_ip4_addr(HOST_IP_ADDRESS, TEST_PORT, &server_addr);
+  TUV_ASSERT(r == 0);
+  r = uv_tcp_init(param->loop, &tcp);
+  TUV_ASSERT(r == 0);
+  r = uv_tcp_connect(&connect_req,
+                     &tcp,
+                     (const struct sockaddr*) &server_addr,
+                     connect_cb);
+  TUV_ASSERT(r == 0);
+
+  tuv_run(param->loop, shutdown_eof_loop, shutdown_eof_final, param);
+#else
+  TDDLOG("'HOST_IP_ADDRESS' not defined. skip test.\r\n");
+  run_tests_continue();
+#endif
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_tcp_open_raw.c b/deps/libtuv/test/raw/test_tcp_open_raw.c
new file mode 100644 (file)
index 0000000..a3ce370
--- /dev/null
@@ -0,0 +1,267 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+#if defined(__TUV_HOST_IPEXIST__)
+#include "tuv_host_ipaddress.h"
+#else
+#pragma message("Please create tuv_host_ipaddress.h for tcp_open test.")
+#endif
+
+// Please create a file with your host IP address like below.
+// This information is use to connect to host that should be running
+// "tuvhelper" prgoram.
+/*
+#ifndef __tuv_host_ipaddress_header__
+#define __tuv_host_ipaddress_header__
+
+#define HOST_IP_ADDRESS   "192.168.1.2"
+
+#endif
+*/
+
+
+#if defined(__TUV_HOST_IPEXIST__)
+
+static int shutdown_cb_called = 0;
+static int connect_cb_called = 0;
+static int write_cb_called = 0;
+static int close_cb_called = 0;
+
+static uv_connect_t connect_req;
+static uv_shutdown_t shutdown_req;
+static uv_write_t write_req;
+
+
+static void startup(void) {
+  uv_sleep(1);
+}
+
+
+static uv_os_sock_t create_tcp_socket(void) {
+  uv_os_sock_t sock;
+
+  sock = tuvp_socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
+  TUV_ASSERT(sock >= 0);
+
+  {
+    /* Allow reuse of the port. */
+    int yes = 1;
+    int r = tuvp_setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes);
+    TUV_ASSERT(r == 0);
+  }
+
+  return sock;
+}
+
+
+static void alloc_cb(uv_handle_t* handle,
+                     size_t suggested_size,
+                     uv_buf_t* buf) {
+#ifdef EMBED_LOW_MEMORY
+  static char slab[2048];
+#else
+  static char slab[65536];
+#endif
+  TUV_ASSERT(suggested_size <= sizeof(slab));
+  buf->base = slab;
+  buf->len = sizeof(slab);
+}
+
+
+static void close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  close_cb_called++;
+}
+
+
+static void shutdown_cb(uv_shutdown_t* req, int status) {
+  TUV_ASSERT(req == &shutdown_req);
+  TUV_ASSERT(status == 0);
+
+  /* Now we wait for the EOF */
+  shutdown_cb_called++;
+}
+
+
+static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) {
+  TUV_ASSERT(tcp != NULL);
+
+  if (nread > 0) {
+    TUV_ASSERT(nread == 4);
+    TUV_ASSERT(memcmp("PING", buf->base, nread) == 0);
+
+    /* tell server to close connection */
+    {
+      //TDDDLOG("read_cb, sending QS to close this");
+      uv_buf_t buf = uv_buf_init((char*)"QS", 2);
+      int r = uv_write(&write_req, tcp, &buf, 1, NULL);
+      TUV_ASSERT(r == 0);
+    }
+  }
+  else if (nread == 0) {
+
+  }
+  else if (nread < 0) {
+    TUV_ASSERT(nread == UV_EOF);
+    uv_close((uv_handle_t*)tcp, close_cb);
+  }
+}
+
+
+static void write_cb(uv_write_t* req, int status) {
+  TUV_ASSERT(req != NULL);
+
+  if (status) {
+    TDLOG("tcp_open uv_write error: %s", uv_strerror(status));
+    TUV_ASSERT(0);
+  }
+
+  write_cb_called++;
+}
+
+
+static void connect_cb(uv_connect_t* req, int status) {
+  uv_buf_t buf = uv_buf_init((char*)"PING", 4);
+  uv_stream_t* stream;
+  int r;
+
+  if (status == UV__ECONNREFUSED) {
+    TDLOG("tcp_open Connection refused. Run server first.");
+    TUV_ASSERT(0);
+  }
+
+  printf(">> connect_cb status(%d)", status);
+
+  TUV_ASSERT(req == &connect_req);
+  TUV_ASSERT(status == 0);
+
+  stream = req->handle;
+  connect_cb_called++;
+
+  r = uv_write(&write_req, stream, &buf, 1, write_cb);
+  TUV_ASSERT(r == 0);
+
+  /* Shutdown on drain. */
+  // r = uv_shutdown(&shutdown_req, stream, shutdown_cb);
+  //TUV_ASSERT(r == 0);
+
+  /* Start reading */
+  r = uv_read_start(stream, alloc_cb, read_cb);
+  TUV_ASSERT(r == 0);
+}
+
+
+typedef struct {
+  uv_loop_t* loop;
+  uv_tcp_t client;
+  uv_os_sock_t sock;
+} tcp_open_param_t;
+
+
+static int tcp_open_loop(void* vparam) {
+  tcp_open_param_t* param = (tcp_open_param_t*)vparam;
+  return uv_run(param->loop, UV_RUN_ONCE);
+}
+
+
+static int tcp_open_final(void* vparam) {
+  tcp_open_param_t* param = (tcp_open_param_t*)vparam;
+
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  //TUV_ASSERT(shutdown_cb_called == 1);
+  TUV_ASSERT(connect_cb_called == 1);
+  TUV_ASSERT(write_cb_called == 1);
+  TUV_ASSERT(close_cb_called == 1);
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+#endif
+
+
+TEST_IMPL(tcp_open) {
+#if defined(__TUV_HOST_IPEXIST__)
+  tcp_open_param_t* param;
+  param = (tcp_open_param_t*)malloc(sizeof(tcp_open_param_t));
+  param->loop = uv_default_loop();
+
+  struct sockaddr_in addr;
+  int r;
+
+  shutdown_cb_called = 0;
+  connect_cb_called = 0;
+  write_cb_called = 0;
+  close_cb_called = 0;
+
+  TUV_ASSERT(0 == uv_ip4_addr(HOST_IP_ADDRESS, TEST_PORT, &addr));
+
+  startup();
+  param->sock = create_tcp_socket();
+
+  r = uv_tcp_init(param->loop, &param->client);
+  TUV_ASSERT(r == 0);
+
+  r = uv_tcp_open(&param->client, param->sock);
+  TUV_ASSERT(r == 0);
+
+  r = uv_tcp_connect(&connect_req,
+                     &param->client,
+                     (const struct sockaddr*)&addr,
+                     connect_cb);
+  TUV_ASSERT(r == 0);
+
+  tuv_run(param->loop, tcp_open_loop, tcp_open_final, param);
+#else
+  TDDLOG("'HOST_IP_ADDRESS' not defined. skip test.\r\n");
+  run_tests_continue();
+#endif
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_threadpool_raw_queue_work_simple.c b/deps/libtuv/test/raw/test_threadpool_raw_queue_work_simple.c
new file mode 100644 (file)
index 0000000..e550306
--- /dev/null
@@ -0,0 +1,114 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stdio.h>
+
+#include <uv.h>
+#include "runner.h"
+
+
+static int work_cb_count;
+static int after_work_cb_count;
+static uv_work_t work_req;
+static char data;
+
+
+static void work_cb(uv_work_t* req) {
+  TUV_ASSERT(req == &work_req);
+  TUV_ASSERT(req->data == &data);
+  work_cb_count++;
+}
+
+
+static void after_work_cb(uv_work_t* req, int status) {
+  TUV_ASSERT(status == 0);
+  TUV_ASSERT(req == &work_req);
+  TUV_ASSERT(req->data == &data);
+  after_work_cb_count++;
+}
+
+
+//-----------------------------------------------------------------------------
+
+typedef struct {
+  uv_loop_t* loop;
+} queuework_param_t;
+
+
+static int queuework_loop(void* vparam) {
+  queuework_param_t* param = (queuework_param_t*)vparam;
+  return uv_run(param->loop, UV_RUN_ONCE);
+}
+
+
+static int queuework_final(void* vparam) {
+  queuework_param_t* param = (queuework_param_t*)vparam;
+
+  TUV_ASSERT(work_cb_count == 1);
+  TUV_ASSERT(after_work_cb_count == 1);
+
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+
+TEST_IMPL(threadpool_queue_work_simple) {
+  queuework_param_t* param =
+                        (queuework_param_t*)malloc(sizeof(queuework_param_t));
+  param->loop = uv_default_loop();
+
+  int r;
+
+  work_cb_count = 0;
+  after_work_cb_count = 0;
+
+  work_req.data = &data;
+  r = uv_queue_work(param->loop, &work_req, work_cb, after_work_cb);
+  TUV_ASSERT(r == 0);
+
+  tuv_run(param->loop, queuework_loop, queuework_final, param);
+
+  return 0;
+}
+
diff --git a/deps/libtuv/test/raw/test_timer_raw_again.c b/deps/libtuv/test/raw/test_timer_raw_again.c
new file mode 100644 (file)
index 0000000..2e7da24
--- /dev/null
@@ -0,0 +1,175 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+static int close_cb_called = 0;
+static int repeat_1_cb_called = 0;
+static int repeat_2_cb_called = 0;
+static int repeat_2_cb_allowed = 0;
+
+static uv_timer_t dummy, repeat_1, repeat_2;
+
+static uint64_t start_time;
+
+
+static void close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+
+  close_cb_called++;
+}
+
+
+static void repeat_1_cb(uv_timer_t* handle) {
+  int r;
+
+  TUV_ASSERT(handle == &repeat_1);
+  TUV_ASSERT(uv_timer_get_repeat((uv_timer_t*)handle) == 50);
+
+  repeat_1_cb_called++;
+
+  r = uv_timer_again(&repeat_2);
+  TUV_ASSERT(r == 0);
+
+  if (repeat_1_cb_called == 10) {
+    uv_close((uv_handle_t*)handle, close_cb);
+    /* We're not calling uv_timer_again on repeat_2 any more, so after this */
+    /* timer_2_cb is expected. */
+    repeat_2_cb_allowed = 1;
+    return;
+  }
+}
+
+
+static void repeat_2_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle == &repeat_2);
+  TUV_ASSERT(repeat_2_cb_allowed);
+
+  repeat_2_cb_called++;
+
+  if (uv_timer_get_repeat(&repeat_2) == 0) {
+    TUV_ASSERT(0 == uv_is_active((uv_handle_t*) handle));
+    uv_close((uv_handle_t*)handle, close_cb);
+    return;
+  }
+
+  TUV_ASSERT(uv_timer_get_repeat(&repeat_2) == 100);
+
+  /* This shouldn't take effect immediately. */
+  uv_timer_set_repeat(&repeat_2, 0);
+}
+
+//-----------------------------------------------------------------------------
+
+typedef struct {
+  uv_loop_t* loop;
+} timer_param_t;
+
+
+static int timer_loop(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+  return uv_run(param->loop, UV_RUN_ONCE);
+}
+
+static int timer_final(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+
+  TUV_ASSERT(repeat_1_cb_called == 10);
+  TUV_ASSERT(repeat_2_cb_called == 2);
+  TUV_ASSERT(close_cb_called == 2);
+
+  // for platform that needs closing
+  tuv_timer_deinit(param->loop, (uv_handle_t*)&dummy);
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+TEST_IMPL(timer_again) {
+  timer_param_t* param = (timer_param_t*)malloc(sizeof(timer_param_t));
+  param->loop = uv_default_loop();
+
+  int r;
+
+  close_cb_called = 0;
+  repeat_1_cb_called = 0;
+  repeat_2_cb_called = 0;
+  repeat_2_cb_allowed = 0;
+
+  start_time = uv_now(param->loop);
+  TUV_ASSERT(0 < start_time);
+
+  /* Verify that it is not possible to uv_timer_again a never-started timer. */
+  r = uv_timer_init(param->loop, &dummy);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_again(&dummy);
+  TUV_ASSERT(r == UV_EINVAL);
+  uv_unref((uv_handle_t*)&dummy);
+
+  /* Start timer repeat_1. */
+  r = uv_timer_init(param->loop, &repeat_1);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&repeat_1, repeat_1_cb, 50, 0);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(uv_timer_get_repeat(&repeat_1) == 0);
+
+  /* Actually make repeat_1 repeating. */
+  uv_timer_set_repeat(&repeat_1, 50);
+  TUV_ASSERT(uv_timer_get_repeat(&repeat_1) == 50);
+
+  /*
+   * Start another repeating timer. It'll be again()ed by the repeat_1 so
+   * it should not time out until repeat_1 stops.
+   */
+  r = uv_timer_init(param->loop, &repeat_2);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&repeat_2, repeat_2_cb, 100, 100);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(uv_timer_get_repeat(&repeat_2) == 100);
+
+  tuv_run(param->loop, timer_loop, timer_final, param);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_timer_raw_huge_repeat.c b/deps/libtuv/test/raw/test_timer_raw_huge_repeat.c
new file mode 100644 (file)
index 0000000..19039b6
--- /dev/null
@@ -0,0 +1,105 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+//-----------------------------------------------------------------------------
+
+static uv_timer_t tiny_timer;
+static uv_timer_t huge_timer1;
+static uv_timer_t huge_timer2;
+
+
+static int huge_repeat_cb_ncalls;
+
+static void huge_repeat_cb(uv_timer_t* handle) {
+  if (huge_repeat_cb_ncalls == 0)
+    TUV_ASSERT(handle == &huge_timer1);
+  else
+    TUV_ASSERT(handle == &tiny_timer);
+
+  if (++huge_repeat_cb_ncalls == 10) {
+    uv_close((uv_handle_t*) &tiny_timer, NULL);
+    uv_close((uv_handle_t*) &huge_timer1, NULL);
+  }
+}
+
+//-----------------------------------------------------------------------------
+
+typedef struct {
+  uv_loop_t* loop;
+} timer_param_t;
+
+
+static int timer_loop(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+  return uv_run(param->loop, UV_RUN_ONCE);
+}
+
+static int timer_final(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+
+  // for platforms that needs cleaning
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+
+TEST_IMPL(timer_huge_repeat) {
+  timer_param_t* param = (timer_param_t*)malloc(sizeof(timer_param_t));
+  param->loop = uv_default_loop();
+
+  huge_repeat_cb_ncalls = 0;
+
+  TUV_ASSERT(0 == uv_timer_init(param->loop, &tiny_timer));
+  TUV_ASSERT(0 == uv_timer_init(param->loop, &huge_timer1));
+  TUV_ASSERT(0 == uv_timer_start(&tiny_timer, huge_repeat_cb, 2, 2));
+  TUV_ASSERT(0 == uv_timer_start(&huge_timer1, huge_repeat_cb, 1, (uint64_t) -1));
+
+  tuv_run(param->loop, timer_loop, timer_final, param);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_timer_raw_huge_timeout.c b/deps/libtuv/test/raw/test_timer_raw_huge_timeout.c
new file mode 100644 (file)
index 0000000..50f2796
--- /dev/null
@@ -0,0 +1,96 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+static uv_timer_t tiny_timer;
+static uv_timer_t huge_timer1;
+static uv_timer_t huge_timer2;
+
+
+static void tiny_timer_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle == &tiny_timer);
+  uv_close((uv_handle_t*) &tiny_timer, NULL);
+  uv_close((uv_handle_t*) &huge_timer1, NULL);
+  uv_close((uv_handle_t*) &huge_timer2, NULL);
+}
+
+
+//-----------------------------------------------------------------------------
+
+typedef struct {
+  uv_loop_t* loop;
+} timer_param_t;
+
+
+static int timer_loop(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+  return uv_run(param->loop, UV_RUN_ONCE);
+}
+
+static int timer_final(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+
+  // for platforms that needs cleaning
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+TEST_IMPL(timer_huge_timeout) {
+  timer_param_t* param = (timer_param_t*)malloc(sizeof(timer_param_t));
+  param->loop = uv_default_loop();
+
+  TUV_ASSERT(0 == uv_timer_init(param->loop, &tiny_timer));
+  TUV_ASSERT(0 == uv_timer_init(param->loop, &huge_timer1));
+  TUV_ASSERT(0 == uv_timer_init(param->loop, &huge_timer2));
+  TUV_ASSERT(0 == uv_timer_start(&tiny_timer, tiny_timer_cb, 1, 0));
+  TUV_ASSERT(0 == uv_timer_start(&huge_timer1, tiny_timer_cb, 0xffffffffffffLL, 0));
+  TUV_ASSERT(0 == uv_timer_start(&huge_timer2, tiny_timer_cb, (uint64_t) -1, 0));
+
+  tuv_run(param->loop, timer_loop, timer_final, param);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_timer_raw_init.c b/deps/libtuv/test/raw/test_timer_raw_init.c
new file mode 100644 (file)
index 0000000..95761bc
--- /dev/null
@@ -0,0 +1,88 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+//-----------------------------------------------------------------------------
+
+typedef struct {
+  uv_loop_t* loop;
+  uv_timer_t handle;
+} timer_param_t;
+
+
+static int timer_loop(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+  uv_loop_t* loop = param->loop;
+
+  uv_run(loop, UV_RUN_ONCE);
+  // make this loop run once
+  return 0;
+}
+
+static int timer_final(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+  uv_loop_t* loop = param->loop;
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+TEST_IMPL(timer_init) {
+  timer_param_t* param = (timer_param_t*)malloc(sizeof(timer_param_t));
+  param->loop = uv_default_loop();
+
+  TUV_ASSERT(0 == uv_timer_init(param->loop, &param->handle));
+  TUV_ASSERT(0 == uv_timer_get_repeat(&param->handle));
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) &param->handle));
+
+  // for platforms that needs cleaning
+  uv_close((uv_handle_t*) &param->handle, NULL);
+
+  tuv_run(param->loop, timer_loop, timer_final, param);
+
+  return 0;
+}
+
diff --git a/deps/libtuv/test/raw/test_timer_raw_norm.c b/deps/libtuv/test/raw/test_timer_raw_norm.c
new file mode 100644 (file)
index 0000000..c235522
--- /dev/null
@@ -0,0 +1,186 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+static int once_cb_called = 0;
+static int once_close_cb_called = 0;
+static int repeat_cb_called = 0;
+static int repeat_close_cb_called = 0;
+
+static uint64_t start_time = 0ll;
+
+
+static void once_close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  TUV_ASSERT(0 == uv_is_active(handle));
+
+  once_close_cb_called++;
+}
+
+static void once_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) handle));
+
+  once_cb_called++;
+
+  uv_close((uv_handle_t*)handle, once_close_cb);
+
+  /* Just call this randomly for the code coverage. */
+  uv_update_time(uv_default_loop());
+}
+
+
+static void repeat_close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+
+  repeat_close_cb_called++;
+}
+
+
+static void repeat_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  TUV_ASSERT(1 == uv_is_active((uv_handle_t*) handle));
+
+  repeat_cb_called++;
+
+  if (repeat_cb_called == 5) {
+    uv_close((uv_handle_t*)handle, repeat_close_cb);
+  }
+}
+
+
+static void never_cb(uv_timer_t* handle) {
+  TUV_FATAL("never_cb should never be called");
+}
+
+
+//-----------------------------------------------------------------------------
+
+typedef struct {
+  uv_loop_t* loop;
+  uv_timer_t once_timers[10];
+  uv_timer_t repeat, never;
+} timer_param_t;
+
+
+static int timer_loop(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+  return uv_run(param->loop, UV_RUN_ONCE);
+}
+
+static int timer_final(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+
+  TUV_ASSERT(once_cb_called == 10);
+  TUV_ASSERT(once_close_cb_called == 10);
+  TUV_ASSERT(repeat_cb_called == 5);
+  TUV_ASSERT(repeat_close_cb_called == 1);
+
+  TUV_ASSERT(500 <= uv_now(param->loop) - start_time);
+
+  // for platforms that needs cleaning
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+TEST_IMPL(timer) {
+  timer_param_t* param = (timer_param_t*)malloc(sizeof(timer_param_t));
+  param->loop = uv_default_loop();
+
+  uv_timer_t *once;
+  unsigned int i;
+  int r;
+
+  once_cb_called = 0;
+  once_close_cb_called = 0;
+  repeat_cb_called = 0;
+  repeat_close_cb_called = 0;
+
+  start_time = uv_now(param->loop);
+  TUV_ASSERT(0 < start_time);
+
+  /* Let 10 timers time out in 500 ms total. */
+  for (i = 0; i < ARRAY_SIZE(param->once_timers); i++) {
+    once = param->once_timers + i;
+    r = uv_timer_init(param->loop, once);
+    TUV_ASSERT(r == 0);
+    r = uv_timer_start(once, once_cb, i * 50, 0);
+    TUV_ASSERT(r == 0);
+  }
+
+  /* The 11th timer is a repeating timer that runs 4 times */
+  r = uv_timer_init(param->loop, &param->repeat);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&param->repeat, repeat_cb, 100, 100);
+  TUV_ASSERT(r == 0);
+
+  /* The 12th timer should not do anything. */
+  r = uv_timer_init(param->loop, &param->never);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&param->never, never_cb, 100, 100);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_stop(&param->never);
+  TUV_ASSERT(r == 0);
+  uv_unref((uv_handle_t*)&param->never);
+  // for platforms that needs cleaning
+  uv_close((uv_handle_t*) &param->never, NULL);
+
+#if 1
+  tuv_run(param->loop, timer_loop, timer_final, param);
+#else
+  loop->raw_loopcb = timer_loop;
+  loop->raw_finalcb = timer_final;
+  loop->raw_param = param;
+  while(true) {
+    int r = timer_loop(param);
+    if (!r) break;
+  }
+  timer_final(param);
+#endif
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_timer_raw_order.c b/deps/libtuv/test/raw/test_timer_raw_order.c
new file mode 100644 (file)
index 0000000..a587031
--- /dev/null
@@ -0,0 +1,140 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <unistd.h> // usleep
+#include <uv.h>
+
+
+#include "runner.h"
+
+
+
+//-----------------------------------------------------------------------------
+
+static int order_cb_called = 0;
+
+
+static void order_cb_a(uv_timer_t *handle) {
+  TUV_ASSERT(order_cb_called++ == *(int*)handle->data);
+}
+
+
+static void order_cb_b(uv_timer_t *handle) {
+  TUV_ASSERT(order_cb_called++ == *(int*)handle->data);
+}
+
+//-----------------------------------------------------------------------------
+
+typedef struct {
+  uv_loop_t* loop;
+  uv_timer_t handle_a;
+  uv_timer_t handle_b;
+  int first;
+  int second;
+} timer_param_t;
+
+
+static int timer_loop(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+  return uv_run(param->loop, UV_RUN_ONCE);
+}
+
+static int timer_final1(void* vparam);
+static int timer_final2(void* vparam);
+
+static int timer_final1(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+
+  TUV_ASSERT(order_cb_called == 2);
+
+  TUV_ASSERT(0 == uv_timer_stop(&param->handle_a));
+  TUV_ASSERT(0 == uv_timer_stop(&param->handle_b));
+
+  /* Test for starting handle_b then handle_a */
+  order_cb_called = 0;
+  param->handle_b.data = &param->first;
+  TUV_ASSERT(0 == uv_timer_start(&param->handle_b, order_cb_b, 0, 0));
+
+  param->handle_a.data = &param->second;
+  TUV_ASSERT(0 == uv_timer_start(&param->handle_a, order_cb_a, 0, 0));
+
+  tuv_run(param->loop, timer_loop, timer_final2, param);
+
+  return 1; // don't clear loop param info
+}
+
+static int timer_final2(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+
+  TUV_ASSERT(order_cb_called == 2);
+
+  // for platforms that needs cleaning
+  uv_close((uv_handle_t*) &param->handle_a, NULL);
+  uv_close((uv_handle_t*) &param->handle_b, NULL);
+  uv_run(param->loop, UV_RUN_ONCE);
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+TEST_IMPL(timer_order) {
+  timer_param_t* param = (timer_param_t*)malloc(sizeof(timer_param_t));
+  param->loop = uv_default_loop();
+
+  order_cb_called = 0;
+
+  param->first = 0;
+  param->second = 1;
+  TUV_ASSERT(0 == uv_timer_init(param->loop, &param->handle_a));
+  TUV_ASSERT(0 == uv_timer_init(param->loop, &param->handle_b));
+
+  /* Test for starting handle_a then handle_b */
+  param->handle_a.data = &param->first;
+  TUV_ASSERT(0 == uv_timer_start(&param->handle_a, order_cb_a, 0, 0));
+  param->handle_b.data = &param->second;
+  TUV_ASSERT(0 == uv_timer_start(&param->handle_b, order_cb_b, 0, 0));
+
+  tuv_run(param->loop, timer_loop, timer_final1, param);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_timer_raw_run_null_callback.c b/deps/libtuv/test/raw/test_timer_raw_run_null_callback.c
new file mode 100644 (file)
index 0000000..0cfa154
--- /dev/null
@@ -0,0 +1,57 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+TEST_IMPL(timer_null_callback) {
+  uv_timer_t handle;
+
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &handle));
+  TUV_ASSERT(UV_EINVAL == uv_timer_start(&handle, NULL, 100, 100));
+
+  // for platform that needs closing
+  tuv_timer_deinit(uv_default_loop(), (uv_handle_t*) &handle);
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
diff --git a/deps/libtuv/test/raw/test_timer_raw_run_once.c b/deps/libtuv/test/raw/test_timer_raw_run_once.c
new file mode 100644 (file)
index 0000000..79c1991
--- /dev/null
@@ -0,0 +1,94 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+//-----------------------------------------------------------------------------
+
+static unsigned int timer_run_once_timer_cb_called = 0;
+
+static void timer_run_once_timer_cb(uv_timer_t* handle) {
+  timer_run_once_timer_cb_called++;
+}
+
+
+typedef struct {
+  uv_loop_t* loop;
+  uv_timer_t timer_handle;
+} timer_param_t;
+
+
+TEST_IMPL(timer_run_once) {
+  timer_param_t* param;
+  uv_loop_t* loop;
+
+  param = (timer_param_t*)malloc(sizeof(timer_param_t));
+  loop = uv_default_loop();
+  param->loop = loop;
+
+  timer_run_once_timer_cb_called = 0;
+
+  TUV_ASSERT(0 == uv_timer_init(param->loop, &param->timer_handle));
+  TUV_ASSERT(0 == uv_timer_start(&param->timer_handle,
+                                 timer_run_once_timer_cb, 0, 0));
+  TUV_ASSERT(0 == uv_run(param->loop, UV_RUN_ONCE));
+  TUV_ASSERT(1 == timer_run_once_timer_cb_called);
+
+  TUV_ASSERT(0 == uv_timer_start(&param->timer_handle,
+                                timer_run_once_timer_cb, 1, 0));
+  // slow systems may have nano second resolution
+  // give some time to sleep so that time tick is changed
+  uv_sleep(1);
+  TUV_ASSERT(0 == uv_run(param->loop, UV_RUN_ONCE));
+  TUV_ASSERT(2 == timer_run_once_timer_cb_called);
+
+  uv_close((uv_handle_t*)&param->timer_handle, NULL);
+  TUV_ASSERT(0 == uv_run(param->loop, UV_RUN_ONCE));
+
+  // for platforms that needs cleaning
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_timer_raw_start_twice.c b/deps/libtuv/test/raw/test_timer_raw_start_twice.c
new file mode 100644 (file)
index 0000000..f1e6bbf
--- /dev/null
@@ -0,0 +1,123 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+
+static int once_cb_called = 0;
+static int once_close_cb_called = 0;
+
+
+static void once_close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  TUV_ASSERT(0 == uv_is_active(handle));
+
+  once_close_cb_called++;
+}
+
+
+static void once_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) handle));
+
+  once_cb_called++;
+
+  uv_close((uv_handle_t*)handle, once_close_cb);
+
+  /* Just call this randomly for the code coverage. */
+  uv_update_time(uv_default_loop());
+}
+
+
+static void never_cb(uv_timer_t* handle) {
+  TUV_FATAL("never_cb should never be called");
+}
+
+
+//-----------------------------------------------------------------------------
+
+typedef struct {
+  uv_loop_t* loop;
+  uv_timer_t once;
+} timer_param_t;
+
+static int timer_loop(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+  return uv_run(param->loop, UV_RUN_ONCE);
+}
+
+static int timer_final(void* vparam) {
+  timer_param_t* param = (timer_param_t*)vparam;
+
+  TUV_ASSERT(once_cb_called == 1);
+
+  // for platforms that needs cleaning
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+//-----------------------------------------------------------------------------
+
+TEST_IMPL(timer_start_twice) {
+  timer_param_t* param = (timer_param_t*)malloc(sizeof(timer_param_t));
+  param->loop = uv_default_loop();
+
+  int r;
+
+  once_cb_called = 0;
+  once_close_cb_called = 0;
+
+  r = uv_timer_init(param->loop, &param->once);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&param->once, never_cb, 86400 * 1000, 0);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&param->once, once_cb, 10, 0);
+  TUV_ASSERT(r == 0);
+
+  tuv_run(param->loop, timer_loop, timer_final, param);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/raw/test_walk_handles_raw.c b/deps/libtuv/test/raw/test_walk_handles_raw.c
new file mode 100644 (file)
index 0000000..67a320e
--- /dev/null
@@ -0,0 +1,120 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+static char magic_cookie[] = "magic cookie";
+static int seen_timer_handle;
+static uv_timer_t timer;
+
+
+static void walk_cb(uv_handle_t* handle, void* arg) {
+  TUV_ASSERT(arg == (void*)magic_cookie);
+
+  if (handle == (uv_handle_t*)&timer) {
+    seen_timer_handle++;
+  } else {
+    TUV_ASSERT(0 && "unexpected handle");
+  }
+}
+
+
+static void timer_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle == &timer);
+
+  uv_walk(handle->loop, walk_cb, magic_cookie);
+  uv_close((uv_handle_t*)handle, NULL);
+}
+
+
+//-----------------------------------------------------------------------------
+
+typedef struct {
+  uv_loop_t* loop;
+} walk_param_t;
+
+static int walk_loop(void* vparam) {
+  walk_param_t* param = (walk_param_t*)vparam;
+  return uv_run(param->loop, UV_RUN_ONCE);
+}
+
+static int walk_final(void* vparam) {
+  walk_param_t* param = (walk_param_t*)vparam;
+
+  TUV_ASSERT(seen_timer_handle == 1);
+  /* Loop is finished, walk_cb should not see our timer handle. */
+  seen_timer_handle = 0;
+  uv_walk(param->loop, walk_cb, magic_cookie);
+  TUV_ASSERT(seen_timer_handle == 0);
+  TUV_ASSERT(0 == uv_loop_close(param->loop));
+
+  // cleanup tuv param
+  free(param);
+
+  // jump to next test
+  run_tests_continue();
+
+  return 0;
+}
+
+
+TEST_IMPL(walk_handles) {
+  walk_param_t* param = (walk_param_t*)malloc(sizeof(walk_param_t));
+  param->loop = uv_default_loop();
+
+  int r;
+
+  seen_timer_handle = 0;
+
+  r = uv_timer_init(param->loop, &timer);
+  TUV_ASSERT(r == 0);
+
+  r = uv_timer_start(&timer, timer_cb, 1, 0);
+  TUV_ASSERT(r == 0);
+
+  /* Start event loop, expect to see the timer handle in walk_cb. */
+  TUV_ASSERT(seen_timer_handle == 0);
+
+  tuv_run(param->loop, walk_loop, walk_final, param);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/resources/empty_file b/deps/libtuv/test/resources/empty_file
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/deps/libtuv/test/runner.h b/deps/libtuv/test/runner.h
new file mode 100644 (file)
index 0000000..6b41f71
--- /dev/null
@@ -0,0 +1,210 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef __tuv_test_runner_header__
+#define __tuv_test_runner_header__
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if defined(__NUTTX__) || defined(__TUV_RAW__)
+#define EMBED_LOW_MEMORY
+#endif
+
+// for tcp_test
+#define TEST_PORT 9123
+#define TEST_PORT_2 9124
+
+
+typedef struct {
+  const char *task_name;
+  const char *process_name;
+  int (*main)(void);
+  int is_helper;
+  int show_output;
+
+  /*
+   * The time in milliseconds after which a single test or benchmark times out.
+   */
+  int timeout;
+  uv_sem_t semsync;
+} task_entry_t;
+
+
+#define TEST_IMPL(name)                                                       \
+  int run_test_##name(void);                                                  \
+  int run_test_##name(void)
+
+#define HELPER_IMPL(name)                                                     \
+  int run_helper_##name(void);                                                \
+  int run_helper_##name(void)
+
+
+/* Have our own assert, so we are sure it does not get optimized away in
+ * a release build.
+ */
+#define TUV_ASSERT(expr)                                  \
+ do {                                                     \
+  if (!(expr)) {                                          \
+    fprintf(stderr,                                       \
+            "Assertion failed in %s on line %d: %s\r\n",  \
+            __FILE__,                                     \
+            __LINE__,                                     \
+            #expr);                                       \
+    ABORT();                                              \
+  }                                                       \
+ } while (0)
+
+#define TUV_WARN(expr)                                    \
+ do {                                                     \
+  if (!(expr)) {                                          \
+    fprintf(stderr,                                       \
+            "Failed in %s on line %d: %s\r\n",            \
+            __FILE__,                                     \
+            __LINE__,                                     \
+            #expr);                                       \
+    return -1;                                            \
+  }                                                       \
+ } while (0)
+
+#define TUV_FATAL(msg)                                    \
+  do {                                                    \
+    fprintf(stderr,                                       \
+            "Fatal error in %s on line %d: %s\r\n",       \
+            __FILE__,                                     \
+            __LINE__,                                     \
+            msg);                                         \
+    fflush(stderr);                                       \
+    ABORT();                                              \
+  } while (0)
+
+/* Reserved test exit codes. */
+enum test_status {
+  TEST_OK = 0,
+  TEST_TODO,
+  TEST_SKIP
+};
+
+typedef struct {
+  FILE* stdout_file;
+  pid_t pid;
+  char* name;
+  int status;
+  int terminated;
+} process_info_t;
+
+typedef struct {
+  int pipe[2];
+  process_info_t* vec;
+  int n;
+} dowait_args;
+
+/* tcp server */
+typedef struct {
+  uv_write_t req;
+  uv_buf_t buf;
+} write_req_t;
+
+typedef enum {
+  TEST_TCP = 0,
+  TEST_UDP,
+  TEST_PIPE
+} stream_type;
+
+#ifdef PATH_MAX
+#define EXEC_PATH_LENGTH PATH_MAX
+#else
+#define EXEC_PATH_LENGTH 4096
+#endif
+
+
+int process_start(const char* name, const char* part, process_info_t* p,
+                  int is_helper);
+int process_wait(process_info_t* vec, int n, int timeout);
+int process_reap(process_info_t *p);
+int process_read_last_line(process_info_t *p, char* buffer, size_t buffer_len);
+void process_cleanup(process_info_t *p);
+
+int run_test_one(task_entry_t* task);
+int run_test_part(const char* test, const char* part);
+int run_tests(void);
+void run_sleep(int msec);
+
+task_entry_t* get_helper(const char* test);
+int run_helper(task_entry_t* task);
+int wait_helper(task_entry_t* task);
+
+
+// for raw systems
+void run_tests_init(void);
+void run_tests_one(void);
+void run_tests_continue(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+//-----------------------------------------------------------------------------
+// test function declaration
+
+#include "runner_list.h"
+
+
+#define TEST_DECLARE(name,x)                                                  \
+  int run_test_##name(void);
+
+#define HELPER_DECLARE(task_name,name)                                        \
+  int run_helper_##name(void);
+
+
+TEST_LIST_ALL(TEST_DECLARE)
+TEST_LIST_EXT(TEST_DECLARE)
+
+HELPER_LIST_ALL(HELPER_DECLARE)
+
+#undef TEST_DECLARE
+#undef HELPER_DECLARE
+
+
+#endif // __tuv_test_runner_header__
diff --git a/deps/libtuv/test/runner_linux.c b/deps/libtuv/test/runner_linux.c
new file mode 100644 (file)
index 0000000..9229440
--- /dev/null
@@ -0,0 +1,406 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/select.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+void run_sleep(int msec) {
+  usleep(msec * 1000);
+}
+
+
+#if 0
+
+char executable_path[EXEC_PATH_LENGTH];
+
+
+/* Do platform-specific initialization. */
+int platform_init(int argc, char **argv) {
+
+  /* Disable stdio output buffering. */
+  setvbuf(stdout, NULL, _IONBF, 0);
+  setvbuf(stderr, NULL, _IONBF, 0);
+  signal(SIGPIPE, SIG_IGN);
+
+  if (realpath(argv[0], executable_path) == NULL) {
+    perror("realpath");
+    return -1;
+  }
+
+  return 0;
+}
+
+//-----------------------------------------------------------------------------
+
+/* Invoke "argv[0] test-name [test-part]". Store process info in *p. */
+/* Make sure that all stdio output of the processes is buffered up. */
+int process_start(const char* name, const char* part, process_info_t* p,
+                  int is_helper) {
+  FILE* stdout_file;
+  const char* arg;
+  const char* args[16];
+  int n;
+  pid_t pid;
+
+  stdout_file = tmpfile();
+  if (!stdout_file) {
+    perror("tmpfile");
+    return -1;
+  }
+
+  p->terminated = 0;
+  p->status = 0;
+
+  pid = fork();
+
+  if (pid < 0) {
+    perror("fork");
+    return -1;
+  }
+
+  if (pid == 0) {
+    /* child */
+    n = 0;
+
+    args[n++] = executable_path;
+    args[n++] = name;
+    args[n++] = part;
+    args[n++] = NULL;
+
+    dup2(fileno(stdout_file), STDOUT_FILENO);
+    dup2(fileno(stdout_file), STDERR_FILENO);
+    execvp(args[0], (char* const*)args);
+    perror("execvp()");
+    _exit(127);
+  }
+
+  /* parent */
+  p->pid = pid;
+  p->name = strdup(name);
+  p->stdout_file = stdout_file;
+
+  return 0;
+}
+
+/* This function is run inside a pthread. We do this so that we can possibly
+ * timeout.
+ */
+static void* dowait(void* data) {
+  dowait_args* args = (dowait_args*)data;
+
+  int i, r;
+  process_info_t* p;
+
+  for (i = 0; i < args->n; i++) {
+    p = (process_info_t*)(args->vec + i * sizeof(process_info_t));
+    if (p->terminated) continue;
+    r = waitpid(p->pid, &p->status, 0);
+    if (r < 0) {
+      perror("waitpid");
+      return NULL;
+    }
+    p->terminated = 1;
+  }
+
+  if (args->pipe[1] >= 0) {
+    /* Write a character to the main thread to notify it about this. */
+    ssize_t r;
+
+    do
+      r = write(args->pipe[1], "", 1);
+    while (r == -1 && errno == EINTR);
+  }
+
+  return NULL;
+}
+
+
+/* Wait for all `n` processes in `vec` to terminate. */
+/* Time out after `timeout` msec, or never if timeout == -1 */
+/* Return 0 if all processes are terminated, -1 on error, -2 on timeout. */
+int process_wait(process_info_t* vec, int n, int timeout) {
+  int i;
+  int r;
+  int retval;
+  process_info_t* p;
+  dowait_args args;
+  pthread_t tid;
+  struct timeval tv;
+  fd_set fds;
+
+  args.vec = vec;
+  args.n = n;
+  args.pipe[0] = -1;
+  args.pipe[1] = -1;
+
+  /* The simple case is where there is no timeout */
+  if (timeout == -1) {
+    dowait(&args);
+    return 0;
+  }
+
+  /* Hard case. Do the wait with a timeout.
+   *
+   * Assumption: we are the only ones making this call right now. Otherwise
+   * we'd need to lock vec.
+   */
+
+  r = pipe((int*)&(args.pipe));
+  if (r) {
+    perror("pipe()");
+    return -1;
+  }
+
+  r = pthread_create(&tid, NULL, dowait, &args);
+  if (r) {
+    perror("pthread_create()");
+    retval = -1;
+    goto terminate;
+  }
+
+  tv.tv_sec = timeout / 1000;
+  tv.tv_usec = 0;
+
+  FD_ZERO(&fds);
+  FD_SET(args.pipe[0], &fds);
+
+  r = select(args.pipe[0] + 1, &fds, NULL, NULL, &tv);
+
+  if (r == -1) {
+    perror("select()");
+    retval = -1;
+
+  } else if (r) {
+    /* The thread completed successfully. */
+    retval = 0;
+
+  } else {
+    /* Timeout. Kill all the children. */
+    for (i = 0; i < n; i++) {
+      p = (process_info_t*)(vec + i * sizeof(process_info_t));
+      kill(p->pid, SIGTERM);
+    }
+    retval = -2;
+
+    /* Wait for thread to finish. */
+    r = pthread_join(tid, NULL);
+    if (r) {
+      perror("pthread_join");
+      retval = -1;
+    }
+  }
+
+terminate:
+  close(args.pipe[0]);
+  close(args.pipe[1]);
+  return retval;
+}
+
+/* Return the exit code of process p. */
+/* On error, return -1. */
+int process_reap(process_info_t *p) {
+  if (WIFEXITED(p->status)) {
+    return WEXITSTATUS(p->status);
+  } else  {
+    return p->status; /* ? */
+  }
+}
+
+int process_read_last_line(process_info_t *p, char* buffer, size_t buffer_len) {
+  char* ptr;
+
+  int r = fseek(p->stdout_file, 0, SEEK_SET);
+  if (r < 0) {
+    perror("fseek");
+    return -1;
+  }
+
+  buffer[0] = '\0';
+
+  while (fgets(buffer, buffer_len, p->stdout_file) != NULL) {
+    for (ptr = buffer; *ptr && *ptr != '\r' && *ptr != '\n'; ptr++);
+    *ptr = '\0';
+  }
+
+  if (ferror(p->stdout_file)) {
+    perror("read");
+    buffer[0] = '\0';
+    return -1;
+  }
+  return 0;
+}
+
+void process_cleanup(process_info_t *p) {
+  fclose(p->stdout_file);
+  free(p->name);
+}
+
+int run_test_one(task_entry_t* task) {
+  process_info_t processes;
+  char errmsg[1024] = "no error";
+  int result = 0;
+  int status;
+
+  status = 255;
+  if (process_start(task->task_name,
+                    task->process_name,
+                    &processes, 0) == -1) {
+    fprintf(stderr,
+            "Process `%s` failed to start.",
+            task->process_name);
+    return -1;
+  }
+
+  usleep(1000);
+
+  if (task->is_helper)
+    return 0;
+
+  result = process_wait(&processes, 1, task->timeout);
+  if (result == -1) {
+    TUV_FATAL("process_wait failed ");
+  } else if (result == -2) {
+    /* Don't have to clean up the process, process_wait() has killed it. */
+    fprintf(stderr, "timeout ");
+    goto out;
+  }
+  status = process_reap(&processes);
+  if (status != TEST_OK) {
+    fprintf(stderr, "exit code %d ", status);
+    result = -1;
+    goto out;
+  }
+
+out:
+  if (result == 0) {
+    result = process_read_last_line(&processes, errmsg, sizeof(errmsg));
+    if (strlen(errmsg))
+      fprintf(stderr, "lastmsg:[%s] ", errmsg);
+  }
+  process_cleanup(&processes);
+
+  return result;
+}
+
+
+int main(int argc, char *argv[]) {
+  int ret = -1;
+  TuvUseDebug usedebug;
+
+  platform_init(argc, argv);
+
+  switch (argc) {
+  case 1:
+    ret = run_tests();
+    break;
+  case 3:
+    ret = run_test_part(argv[1], argv[2]);
+    break;
+  default :
+    TUV_FATAL("System Error");
+    break;
+  }
+  return ret;
+}
+
+#else
+
+static pthread_t tid = 0;
+
+
+/* Do platform-specific initialization. */
+int platform_init(int argc, char **argv) {
+  return 0;
+}
+
+static void* helper_proc(void* data) {
+  task_entry_t* task = (task_entry_t*)data;
+  int ret;
+
+  sem_post(&task->semsync);
+  ret = task->main();
+  TUV_ASSERT(ret == 0);
+
+  sem_post(&task->semsync);
+  pthread_exit(0);
+  return NULL;
+}
+
+int run_helper(task_entry_t* task) {
+  int r;
+  sem_init(&task->semsync, 0, 0);
+  r = pthread_create(&tid, NULL, helper_proc, task);
+  sem_wait(&task->semsync);
+  return r;
+}
+
+int wait_helper(task_entry_t* task) {
+  sem_wait(&task->semsync);
+  pthread_join(tid, NULL);
+  sem_destroy(&task->semsync);
+  return 0;
+}
+
+int run_test_one(task_entry_t* task) {
+  return run_test_part(task->task_name, task->process_name);
+}
+
+int main(int argc, char *argv[]) {
+  int result;
+
+  InitDebugSettings();
+
+  platform_init(argc, argv);
+
+  if (argc>2) {
+    return run_test_part(argv[1], argv[2]);
+  }
+  result = run_tests();
+  ReleaseDebugSettings();
+
+  return result;
+}
+
+#endif
diff --git a/deps/libtuv/test/runner_linux_raw.c b/deps/libtuv/test/runner_linux_raw.c
new file mode 100644 (file)
index 0000000..5994673
--- /dev/null
@@ -0,0 +1,120 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/select.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+/*
+ * About this file.
+ * "runner_linux_raw.c" is used as to create only for host executable,
+ * for unit test running inside target boards which can have limited
+ * capabilites.
+ * Executable is (and should be) generated only for host system, and
+ * the file is placed at same place as tuvtester program with
+ * the name 'tuvhelper'.
+ *
+ * current usage: helper for echo server for mbed
+ *    mbed cannot run echo server and at the same time a client connecting
+ *    to the echo server.
+ */
+
+
+void run_sleep(int msec) {
+  usleep(msec * 1000);
+}
+
+
+static pthread_t tid = 0;
+
+int platform_init(int argc, char **argv) {
+  return 0;
+}
+
+static void* helper_proc(void* data) {
+  task_entry_t* task = (task_entry_t*)data;
+  int ret;
+
+  sem_post(&task->semsync);
+  ret = task->main();
+  TUV_ASSERT(ret == 0);
+
+  sem_post(&task->semsync);
+  pthread_exit(0);
+  return NULL;
+}
+
+int run_helper(task_entry_t* task) {
+  int r;
+  sem_init(&task->semsync, 0, 0);
+  r = pthread_create(&tid, NULL, helper_proc, task);
+  sem_wait(&task->semsync);
+  return r;
+}
+
+int wait_helper(task_entry_t* task) {
+  sem_wait(&task->semsync);
+  pthread_join(tid, NULL);
+  sem_destroy(&task->semsync);
+  return 0;
+}
+
+int run_test_one(task_entry_t* task) {
+  return run_test_part(task->task_name, task->process_name);
+}
+
+int main(int argc, char *argv[]) {
+  InitDebugSettings();
+  platform_init(argc, argv);
+
+  task_entry_t* task;
+  task = get_helper("tcp4_echo_server");
+  if (task) {
+    TDDDLOG("Running network helper for target boards.");
+    run_helper(task);
+    TDDDLOG("Waiting for Test client and quit command...");
+    wait_helper(task);
+  }
+  ReleaseDebugSettings();
+  return 0;
+}
diff --git a/deps/libtuv/test/runner_list.h b/deps/libtuv/test/runner_list.h
new file mode 100644 (file)
index 0000000..bdfc5bd
--- /dev/null
@@ -0,0 +1,133 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+
+#if !defined(__TUV_RAW__)
+#define TEST_LIST_ALL(TE)                                                     \
+  TE(idle_basic, 5000)                                                        \
+  TE(active, 5000)                                                            \
+  TE(timer_init, 5000)                                                        \
+  TE(timer, 5000)                                                             \
+  TE(timer_start_twice, 5000)                                                 \
+  TE(timer_order, 5000)                                                       \
+  TE(timer_run_once, 5000)                                                    \
+  TE(timer_null_callback, 5000)                                               \
+  TE(timer_again, 5000)                                                       \
+  TE(timer_huge_timeout, 5000)                                                \
+  TE(timer_huge_repeat, 5000)                                                 \
+  \
+  TE(async, 5000)                                                             \
+  TE(condvar_2, 5000)                                                         \
+  TE(condvar_3, 5000)                                                         \
+  TE(cwd, 5000)                                                               \
+  \
+  TE(fs_file_noent, 5000)                                                     \
+  TE(fs_file_sync, 5000)                                                      \
+  TE(fs_file_async, 5000)                                                     \
+  TE(fs_file_write_null_buffer, 5000)                                         \
+  TE(fs_stat_missing_path, 5000)                                              \
+  TE(fs_scandir_empty_dir, 5000)                                              \
+  TE(fs_scandir_file, 5000)                                                   \
+  TE(fs_open_dir, 5000)                                                       \
+  TE(fs_file_open_append, 5000)                                               \
+  TE(fs_read_file_eof, 5000)                                                  \
+  TE(fs_async_dir, 5000)                                                      \
+  \
+  TE(error_message, 5000)                                                     \
+  \
+  TE(threadpool_queue_work_simple, 5000)                                      \
+  TE(walk_handles, 5000)                                                      \
+  \
+  TE(tcp_open,5000)                                                           \
+  TE(shutdown_eof,5000)                                                       \
+
+#else
+#define TEST_LIST_ALL(TE)                                                     \
+  TE(idle_basic, 5000)                                                        \
+  TE(active, 5000)                                                            \
+  TE(timer_init, 5000)                                                        \
+  TE(timer, 5000)                                                             \
+  TE(timer_start_twice, 5000)                                                 \
+  TE(timer_order, 5000)                                                       \
+  TE(timer_run_once, 5000)                                                    \
+  TE(timer_null_callback, 5000)                                               \
+  TE(timer_again, 5000)                                                       \
+  TE(timer_huge_timeout, 5000)                                                \
+  TE(timer_huge_repeat, 5000)                                                 \
+  \
+  TE(async, 5000)                                                             \
+  TE(condvar_1, 5000)                                                         \
+  \
+  TE(threadpool_queue_work_simple, 5000)                                      \
+  TE(walk_handles, 5000)                                                      \
+  TE(tcp_open,5000)                                                           \
+  TE(shutdown_eof,5000)                                                       \
+
+
+#endif
+
+// shutdown_eof should be last of tcp test, it'll stop "echo_sevrer"
+
+#if defined(__linux__)
+#define TEST_LIST_EXT(TE)                                                     \
+  TE(condvar_1, 5000)                                                         \
+  TE(condvar_4, 5000)                                                         \
+  \
+  TE(fs_file_nametoolong, 5000)                                               \
+  TE(fs_fstat, 5000)                                                          \
+  TE(fs_utime, 5000)                                                          \
+  TE(fs_futime, 5000)                                                         \
+  \
+  TE(getaddrinfo_basic, 5000)                                                 \
+  TE(getaddrinfo_basic_sync, 5000)                                            \
+  TE(getaddrinfo_concurrent, 5000)                                            \
+
+#elif defined(__TUV_RAW__)
+#define TEST_LIST_EXT(TE)                                                     \
+
+#else
+#define TEST_LIST_EXT(TE)                                                     \
+
+#endif
+
+#if !defined(__TUV_RAW__)
+#define HELPER_LIST_ALL(TE)                                                   \
+  TE(tcp4_echo_server, tcp4_echo_server)                                      \
+
+#else
+#define HELPER_LIST_ALL(TE)                                                   \
+
+#endif
diff --git a/deps/libtuv/test/runner_main.c b/deps/libtuv/test/runner_main.c
new file mode 100644 (file)
index 0000000..b0292f0
--- /dev/null
@@ -0,0 +1,147 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <unistd.h>
+#include <uv.h>
+
+#include "runner.h"
+
+
+//-----------------------------------------------------------------------------
+// test function list
+
+#define TEST_ENTRY(name, timeout) \
+  { #name, #name, &run_test_##name, 0, 0, timeout },
+
+task_entry_t TASKS[] = {
+
+  TEST_LIST_ALL(TEST_ENTRY)
+  TEST_LIST_EXT(TEST_ENTRY)
+
+  { NULL, NULL, NULL, 0, 0, 0 }
+};
+
+#undef TEST_ENTRY
+
+//-----------------------------------------------------------------------------
+// test function list
+
+#define HELPER_ENTRY(task_name, name)               \
+    { #task_name, #name, &run_helper_##name, 1, 0, 0 },
+
+task_entry_t HELPERS[] = {
+
+  HELPER_LIST_ALL(HELPER_ENTRY)
+
+  { NULL, NULL, NULL, 0, 0, 0 }
+};
+
+#undef HELPER_ENTRY
+
+//-----------------------------------------------------------------------------
+
+int run_test_part(const char* test, const char* part) {
+  int r;
+  task_entry_t* task;
+
+  for (task = TASKS; task->main; task++) {
+    if (strcmp(test, task->task_name) == 0 &&
+        strcmp(part, task->process_name) == 0) {
+      r = task->main();
+      return r;
+    }
+  }
+
+  fprintf(stderr, "No test part with that name: %s:%s\n", test, part);
+  return 255;
+}
+
+
+task_entry_t* get_helper(const char* test) {
+  int r;
+  task_entry_t* task;
+
+  for (task = HELPERS; task->main; task++) {
+    if (strcmp(test, task->task_name) == 0) {
+      return task;
+    }
+  }
+  return NULL;
+}
+
+
+int run_tests() {
+  int entry;
+  int result;
+  task_entry_t* task;
+
+  fprintf(stderr, "Run Helpers...\r\n");
+  entry = 0;
+  while (HELPERS[entry].task_name) {
+    task = &HELPERS[entry];
+
+    fprintf(stderr, "[%-30s]...", task->task_name);
+    result = run_helper(task);
+    fprintf(stderr, "%s\r\n", result ? "failed" : "OK");
+    entry++;
+  }
+
+  entry = 0;
+  while (TASKS[entry].task_name) {
+    task = &TASKS[entry];
+
+    fprintf(stderr, "[%-30s]...", task->task_name);
+    result = run_test_one(task);
+    fprintf(stderr, "%s\r\n", result ? "failed" : "OK");
+    entry++;
+  }
+
+  fprintf(stderr, "Waiting Helpers to end...\r\n");
+  entry = 0;
+  while (HELPERS[entry].task_name) {
+    task = &HELPERS[entry];
+
+    fprintf(stderr, "[%-30s]...", task->task_name);
+    result = wait_helper(task);
+    fprintf(stderr, "%s\r\n", result ? "failed" : "OK");
+    entry++;
+  }
+
+  fprintf(stderr, "run_tests end\r\n");
+
+  return 0;
+}
diff --git a/deps/libtuv/test/runner_nuttx.c b/deps/libtuv/test/runner_nuttx.c
new file mode 100644 (file)
index 0000000..ee6eddc
--- /dev/null
@@ -0,0 +1,128 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/select.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+/* Do platform-specific initialization. */
+int platform_init(int argc, char **argv) {
+  return 0;
+}
+
+void run_sleep(int msec) {
+  usleep(msec * 1000);
+}
+
+//-----------------------------------------------------------------------------
+
+#define HELPER_PRIORITY     100
+#define HELPER_STACKSIZE    2048
+
+static pid_t pid_helper;
+static sem_t startsem;
+
+
+static int helper_procedure(int argc, char *argv[]) {
+  task_entry_t* helper;
+  int ret;
+  helper = get_helper(argv[1]);
+  TUV_ASSERT(helper);
+
+  sem_post(&helper->semsync);
+  ret = helper->main();
+  TUV_ASSERT(ret == 0);
+
+  sem_post(&helper->semsync);
+
+  return ret;
+}
+
+int run_helper(task_entry_t* task) {
+
+  const char* argv[3] = {
+    task->task_name,
+    task->process_name,
+    0
+  };
+
+  sem_init(&task->semsync, 0, 0);
+
+  pid_helper = task_create(task->process_name,
+                           HELPER_PRIORITY, HELPER_STACKSIZE,
+                           helper_procedure,
+                           (char * const *)argv);
+
+  sem_wait(&task->semsync);
+
+  usleep(1000);
+
+  return 0;
+}
+
+int wait_helper(task_entry_t* task) {
+  sem_wait(&task->semsync);
+  task_delete(pid_helper);
+  sem_destroy(&task->semsync);
+  return 0;
+}
+
+
+int run_test_one(task_entry_t* task) {
+  return run_test_part(task->task_name, task->process_name);
+}
+
+
+//
+// this is called from nuttx apps system tuvtester
+//
+int tuvtester_entry(int argc, char *argv[]) {
+  fprintf(stderr, ">> tuvtester_entry call ok\n");
+  fflush(stderr);
+  platform_init(argc, argv);
+  if (argc>2) {
+    return run_test_part(argv[1], argv[2]);
+  }
+  return run_tests();
+}
diff --git a/deps/libtuv/test/runner_tizenrt.c b/deps/libtuv/test/runner_tizenrt.c
new file mode 100644 (file)
index 0000000..5611231
--- /dev/null
@@ -0,0 +1,128 @@
+/* Copyright 2017-present 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/select.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+/* Do platform-specific initialization. */
+int platform_init(int argc, char **argv) {
+  return 0;
+}
+
+void run_sleep(int msec) {
+  usleep(msec * 1000);
+}
+
+//-----------------------------------------------------------------------------
+
+#define HELPER_PRIORITY     100
+#define HELPER_STACKSIZE    2048
+
+static pid_t pid_helper;
+static sem_t startsem;
+
+
+static int helper_procedure(int argc, char *argv[]) {
+  task_entry_t* helper;
+  int ret;
+  helper = get_helper(argv[1]);
+  TUV_ASSERT(helper);
+
+  sem_post(&helper->semsync);
+  ret = helper->main();
+  TUV_ASSERT(ret == 0);
+
+  sem_post(&helper->semsync);
+
+  return ret;
+}
+
+int run_helper(task_entry_t* task) {
+
+  const char* argv[3] = {
+    task->task_name,
+    task->process_name,
+    0
+  };
+
+  sem_init(&task->semsync, 0, 0);
+
+  pid_helper = task_create(task->process_name,
+                           HELPER_PRIORITY, HELPER_STACKSIZE,
+                           helper_procedure,
+                           (char * const *)argv);
+
+  sem_wait(&task->semsync);
+
+  usleep(1000);
+
+  return 0;
+}
+
+int wait_helper(task_entry_t* task) {
+  sem_wait(&task->semsync);
+  task_delete(pid_helper);
+  sem_destroy(&task->semsync);
+  return 0;
+}
+
+
+int run_test_one(task_entry_t* task) {
+  return run_test_part(task->task_name, task->process_name);
+}
+
+
+//
+// this is called from nuttx apps system tuvtester
+//
+int tuvtester_entry(int argc, char *argv[]) {
+  fprintf(stderr, ">> tuvtester_entry call ok\n");
+  fflush(stderr);
+  platform_init(argc, argv);
+  if (argc>2) {
+    return run_test_part(argv[1], argv[2]);
+  }
+  return run_tests();
+}
diff --git a/deps/libtuv/test/test_active.c b/deps/libtuv/test/test_active.c
new file mode 100644 (file)
index 0000000..3f6a739
--- /dev/null
@@ -0,0 +1,103 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+static int close_cb_called = 0;
+
+
+static void close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  close_cb_called++;
+}
+
+
+static void timer_cb(uv_timer_t* handle) {
+  TUV_ASSERT(0 && "timer_cb should not have been called");
+}
+
+
+TEST_IMPL(active) {
+  int r;
+  uv_timer_t timer;
+
+  close_cb_called = 0;
+
+  r = uv_timer_init(uv_default_loop(), &timer);
+  TUV_ASSERT(r == 0);
+
+  /* uv_is_active() and uv_is_closing() should always return either 0 or 1. */
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) &timer));
+  TUV_ASSERT(0 == uv_is_closing((uv_handle_t*) &timer));
+
+  r = uv_timer_start(&timer, timer_cb, 1000, 0);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(1 == uv_is_active((uv_handle_t*) &timer));
+  TUV_ASSERT(0 == uv_is_closing((uv_handle_t*) &timer));
+
+  r = uv_timer_stop(&timer);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) &timer));
+  TUV_ASSERT(0 == uv_is_closing((uv_handle_t*) &timer));
+
+  r = uv_timer_start(&timer, timer_cb, 1000, 0);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(1 == uv_is_active((uv_handle_t*) &timer));
+  TUV_ASSERT(0 == uv_is_closing((uv_handle_t*) &timer));
+
+  uv_close((uv_handle_t*) &timer, close_cb);
+
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) &timer));
+  TUV_ASSERT(1 == uv_is_closing((uv_handle_t*) &timer));
+
+  r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(close_cb_called == 1);
+
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
diff --git a/deps/libtuv/test/test_async.c b/deps/libtuv/test/test_async.c
new file mode 100644 (file)
index 0000000..6eba056
--- /dev/null
@@ -0,0 +1,144 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+static uv_thread_t _thread;
+static uv_mutex_t _mutex;
+
+static uv_timer_t _timer;
+static uv_async_t _async;
+
+static int _async_cb_called;
+static int _timer_cb_called;
+static int _close_cb_called;
+
+
+static void thread_cb(void *arg) {
+  int n;
+  int r;
+
+  for (;;) {
+    uv_mutex_lock(&_mutex);
+    n = _async_cb_called;
+    uv_mutex_unlock(&_mutex);
+
+    if (n == 3) {
+      break;
+    }
+
+    r = uv_async_send(&_async);
+    TUV_ASSERT(r == 0);
+
+    uv_sleep(1);
+  }
+}
+
+
+static void close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  _close_cb_called++;
+}
+
+
+static void async_cb(uv_async_t* handle) {
+  int n;
+
+  TUV_ASSERT(handle == &_async);
+
+  uv_mutex_lock(&_mutex);
+  n = ++_async_cb_called;
+  uv_mutex_unlock(&_mutex);
+
+  if (n == 3) {
+    uv_close((uv_handle_t*)&_async, close_cb);
+  }
+}
+
+
+static void timer_cb(uv_timer_t* timer) {
+  int r;
+
+  TUV_ASSERT(timer == &_timer);
+  _timer_cb_called++;
+
+  r = uv_thread_create(&_thread, thread_cb, NULL);
+  TUV_ASSERT(r == 0);
+  uv_mutex_unlock(&_mutex);
+
+  uv_close((uv_handle_t*)timer, NULL);
+}
+
+
+TEST_IMPL(async) {
+  int r;
+  uv_loop_t* loop = uv_default_loop();
+
+  _async_cb_called = 0;
+  _timer_cb_called = 0;
+  _close_cb_called = 0;
+
+  r = uv_mutex_init(&_mutex);
+  TUV_ASSERT(r == 0);
+  uv_mutex_lock(&_mutex);
+
+  r = uv_async_init(loop, &_async, async_cb);
+  TUV_ASSERT(r == 0);
+
+  r = uv_timer_init(loop, &_timer);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&_timer, timer_cb, 250, 0);
+  TUV_ASSERT(r == 0);
+
+  r = uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(_async_cb_called == 3);
+  TUV_ASSERT(_close_cb_called == 1);
+  TUV_ASSERT(_timer_cb_called == 1);
+
+  TUV_ASSERT(0 == uv_thread_join(&_thread));
+
+  uv_mutex_destroy(&_mutex);
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  return 0;
+}
diff --git a/deps/libtuv/test/test_condvar.c b/deps/libtuv/test/test_condvar.c
new file mode 100644 (file)
index 0000000..af612c0
--- /dev/null
@@ -0,0 +1,190 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <errno.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+typedef struct {
+  uv_mutex_t mutex;
+  uv_cond_t cond;
+  int delay;
+  int use_broadcast;
+  volatile int posted;
+} worker_config;
+
+
+static void worker(void* arg) {
+  worker_config* c = (worker_config*)arg;
+
+  if (c->delay)
+    run_sleep(c->delay);
+
+  uv_mutex_lock(&c->mutex);
+  TUV_ASSERT(c->posted == 0);
+  c->posted = 1;
+  if (c->use_broadcast)
+    uv_cond_broadcast(&c->cond);
+  else
+    uv_cond_signal(&c->cond);
+  uv_mutex_unlock(&c->mutex);
+}
+
+
+TEST_IMPL(condvar_1) {
+  uv_thread_t thread;
+  worker_config wc;
+
+  memset(&wc, 0, sizeof(wc));
+
+  TUV_ASSERT(0 == uv_cond_init(&wc.cond));
+  TUV_ASSERT(0 == uv_mutex_init(&wc.mutex));
+  TUV_ASSERT(0 == uv_thread_create(&thread, worker, &wc));
+
+  uv_mutex_lock(&wc.mutex);
+  run_sleep(100);
+  uv_cond_wait(&wc.cond, &wc.mutex);
+  TUV_ASSERT(wc.posted == 1);
+  uv_mutex_unlock(&wc.mutex);
+
+  TUV_ASSERT(0 == uv_thread_join(&thread));
+  uv_mutex_destroy(&wc.mutex);
+  uv_cond_destroy(&wc.cond);
+
+  return 0;
+}
+
+
+TEST_IMPL(condvar_2) {
+  uv_thread_t thread;
+  worker_config wc;
+
+  memset(&wc, 0, sizeof(wc));
+  wc.delay = 100;
+
+  TUV_ASSERT(0 == uv_cond_init(&wc.cond));
+  TUV_ASSERT(0 == uv_mutex_init(&wc.mutex));
+  TUV_ASSERT(0 == uv_thread_create(&thread, worker, &wc));
+
+  uv_mutex_lock(&wc.mutex);
+  uv_cond_wait(&wc.cond, &wc.mutex);
+  uv_mutex_unlock(&wc.mutex);
+
+  TUV_ASSERT(0 == uv_thread_join(&thread));
+  uv_mutex_destroy(&wc.mutex);
+  uv_cond_destroy(&wc.cond);
+
+  return 0;
+}
+
+
+TEST_IMPL(condvar_3) {
+  uv_thread_t thread;
+  worker_config wc;
+  int r;
+
+  memset(&wc, 0, sizeof(wc));
+  wc.delay = 100;
+
+  TUV_ASSERT(0 == uv_cond_init(&wc.cond));
+  TUV_ASSERT(0 == uv_mutex_init(&wc.mutex));
+  TUV_ASSERT(0 == uv_thread_create(&thread, worker, &wc));
+
+  uv_mutex_lock(&wc.mutex);
+  r = uv_cond_timedwait(&wc.cond, &wc.mutex, (uint64_t)(50 * 1e6));
+  TUV_ASSERT(r == UV_ETIMEDOUT);
+  uv_mutex_unlock(&wc.mutex);
+
+  TUV_ASSERT(0 == uv_thread_join(&thread));
+  uv_mutex_destroy(&wc.mutex);
+  uv_cond_destroy(&wc.cond);
+
+  return 0;
+}
+
+
+TEST_IMPL(condvar_4) {
+  uv_thread_t thread;
+  worker_config wc;
+  int r;
+
+  memset(&wc, 0, sizeof(wc));
+  wc.delay = 100;
+
+  TUV_ASSERT(0 == uv_cond_init(&wc.cond));
+  TUV_ASSERT(0 == uv_mutex_init(&wc.mutex));
+  TUV_ASSERT(0 == uv_thread_create(&thread, worker, &wc));
+
+  uv_mutex_lock(&wc.mutex);
+  r = uv_cond_timedwait(&wc.cond, &wc.mutex, (uint64_t)(250 * 1e6));
+  TUV_ASSERT(r == 0);
+  uv_mutex_unlock(&wc.mutex);
+
+  TUV_ASSERT(0 == uv_thread_join(&thread));
+  uv_mutex_destroy(&wc.mutex);
+  uv_cond_destroy(&wc.cond);
+
+  return 0;
+}
+
+
+TEST_IMPL(condvar_5) {
+  uv_thread_t thread;
+  worker_config wc;
+
+  memset(&wc, 0, sizeof(wc));
+  wc.use_broadcast = 1;
+  wc.delay = 100;
+
+  TUV_ASSERT(0 == uv_cond_init(&wc.cond));
+  TUV_ASSERT(0 == uv_mutex_init(&wc.mutex));
+  TUV_ASSERT(0 == uv_thread_create(&thread, worker, &wc));
+
+  uv_mutex_lock(&wc.mutex);
+  run_sleep(100);
+  uv_cond_wait(&wc.cond, &wc.mutex);
+  TUV_ASSERT(wc.posted == 1);
+  uv_mutex_unlock(&wc.mutex);
+
+  TUV_ASSERT(0 == uv_thread_join(&thread));
+  uv_mutex_destroy(&wc.mutex);
+  uv_cond_destroy(&wc.cond);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/test_cwd.c b/deps/libtuv/test/test_cwd.c
new file mode 100644 (file)
index 0000000..5d25248
--- /dev/null
@@ -0,0 +1,37 @@
+/* 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.
+ */
+
+#include <uv.h>
+#include "runner.h"
+
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+# define DIR_BUFF_LENGTH 64
+#else
+# define DIR_BUFF_LENGTH 512
+#endif
+
+static char buffer[DIR_BUFF_LENGTH];
+
+TEST_IMPL(cwd) {
+  size_t size;
+  int err;
+
+  size = sizeof(buffer);
+  err = uv_cwd(buffer, &size);
+  TUV_ASSERT(err == 0);
+  TDDDLOG("uv_cwd: %s\n", buffer);
+
+  return 0;
+}
\ No newline at end of file
diff --git a/deps/libtuv/test/test_error.c b/deps/libtuv/test/test_error.c
new file mode 100644 (file)
index 0000000..d73a68e
--- /dev/null
@@ -0,0 +1,67 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <uv.h>
+#include "runner.h"
+
+
+/*
+ * Synthetic errors (errors that originate from within libuv, not the system)
+ * should produce sensible error messages when run through uv_strerror().
+ *
+ * See https://github.com/joyent/libuv/issues/210
+ */
+TEST_IMPL(error_message) {
+  /* Cop out. Can't do proper checks on systems with
+   * i18n-ized error messages...
+   */
+  /*
+  if (strcmp(uv_strerror(0), "Success") != 0) {
+    printf("i18n error messages detected, skipping test.\n");
+    return 0;
+  }
+  */
+
+  TUV_ASSERT(strstr(uv_strerror(UV_EINVAL), "Success") == NULL);
+  TUV_ASSERT(strcmp(uv_strerror(1337), "Unknown error") == 0);
+  TUV_ASSERT(strcmp(uv_strerror(-1337), "Unknown error") == 0);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/test_fs.c b/deps/libtuv/test/test_fs.c
new file mode 100644 (file)
index 0000000..4cdf9d6
--- /dev/null
@@ -0,0 +1,1444 @@
+/* Copyright 2015-2017 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h> /* unlink, rmdir, etc. */
+#include <dirent.h> /* scandir */
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+//-----------------------------------------------------------------------------
+
+#if defined(__linux__) || defined(__APPLE__)
+static const char* filename1 = "test_file";
+static const char* filename2 = "test_file2";
+#elif defined(__NUTTX__) || defined(__TIZENRT__)
+static const char* filename1 = "/mnt/sdcard/test_file";
+static const char* filename2 = "/mnt/sdcard/test_file2";
+#endif
+
+
+typedef struct {
+  const char* path;
+  double atime;
+  double mtime;
+} utime_check_t;
+
+
+static int dummy_cb_count;
+static int close_cb_count;
+static int create_cb_count;
+static int open_cb_count;
+static int read_cb_count;
+static int write_cb_count;
+static int unlink_cb_count;
+static int mkdir_cb_count;
+static int mkdtemp_cb_count;
+static int rmdir_cb_count;
+static int scandir_cb_count;
+static int stat_cb_count;
+static int rename_cb_count;
+static int fsync_cb_count;
+static int fdatasync_cb_count;
+static int ftruncate_cb_count;
+static int sendfile_cb_count;
+static int fstat_cb_count;
+static int access_cb_count;
+static int chmod_cb_count;
+static int fchmod_cb_count;
+static int chown_cb_count;
+static int fchown_cb_count;
+static int link_cb_count;
+static int symlink_cb_count;
+static int readlink_cb_count;
+static int utime_cb_count;
+static int futime_cb_count;
+
+static uv_loop_t* loop;
+
+static uv_fs_t open_req1;
+static uv_fs_t open_req2;
+static uv_fs_t read_req;
+static uv_fs_t write_req;
+static uv_fs_t unlink_req;
+static uv_fs_t close_req;
+static uv_fs_t mkdir_req;
+static uv_fs_t mkdtemp_req1;
+static uv_fs_t mkdtemp_req2;
+static uv_fs_t rmdir_req;
+static uv_fs_t scandir_req;
+static uv_fs_t stat_req;
+static uv_fs_t rename_req;
+static uv_fs_t fsync_req;
+static uv_fs_t fdatasync_req;
+static uv_fs_t ftruncate_req;
+static uv_fs_t sendfile_req;
+static uv_fs_t utime_req;
+static uv_fs_t futime_req;
+
+static char buf[32];
+static char buf2[32];
+static char test_buf[] = "test-buffer\n";
+static char test_buf2[] = "second-buffer\n";
+static uv_buf_t iov;
+
+static void check_permission(const char* filename, unsigned int mode) {
+  int r;
+  uv_fs_t req;
+  uv_stat_t* s;
+
+  r = uv_fs_stat(uv_default_loop(), &req, filename, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(req.result == 0);
+
+  s = &req.statbuf;
+  TUV_ASSERT((s->st_mode & 0777) == mode);
+
+  uv_fs_req_cleanup(&req);
+}
+
+
+static void dummy_cb(uv_fs_t* req) {
+  (void) req;
+  dummy_cb_count++;
+}
+
+
+static void link_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_LINK);
+  TUV_ASSERT(req->result == 0);
+  link_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+
+static void symlink_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_SYMLINK);
+  TUV_ASSERT(req->result == 0);
+  symlink_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+static void readlink_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_READLINK);
+  TUV_ASSERT(req->result == 0);
+  TUV_ASSERT(strcmp((const char*)req->ptr, "test_file_symlink2") == 0);
+  readlink_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+
+static void access_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_ACCESS);
+  access_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+
+static void fchmod_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_FCHMOD);
+  TUV_ASSERT(req->result == 0);
+  fchmod_cb_count++;
+  uv_fs_req_cleanup(req);
+  check_permission(filename1, *(int*)req->data);
+}
+
+
+static void chmod_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_CHMOD);
+  TUV_ASSERT(req->result == 0);
+  chmod_cb_count++;
+  uv_fs_req_cleanup(req);
+  check_permission(filename1, *(int*)req->data);
+}
+
+
+static void fchown_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_FCHOWN);
+  TUV_ASSERT(req->result == 0);
+  fchown_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+
+static void chown_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_CHOWN);
+  TUV_ASSERT(req->result == 0);
+  chown_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+static void chown_root_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_CHOWN);
+#if defined(_WIN32) || defined(__NUTTX__) || defined(__TIZENRT__)
+  /* On windows, chown is a no-op and always succeeds. */
+  TUV_ASSERT(req->result == 0);
+#else
+  /* On unix, chown'ing the root directory is not allowed -
+   * unless you're root, of course.
+   */
+  if (geteuid() == 0)
+    TUV_ASSERT(req->result == 0);
+  else
+    TUV_ASSERT(req->result == UV_EPERM);
+#endif
+  chown_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+static void unlink_cb(uv_fs_t* req) {
+  TUV_ASSERT(req == &unlink_req);
+  TUV_ASSERT(req->fs_type == UV_FS_UNLINK);
+  TUV_ASSERT(req->result == 0);
+  unlink_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+static void fstat_cb(uv_fs_t* req) {
+  uv_stat_t* s = (uv_stat_t*)req->ptr;
+  TUV_ASSERT(req->fs_type == UV_FS_FSTAT);
+  TUV_ASSERT(req->result == 0);
+  TUV_ASSERT(s->st_size == sizeof(test_buf));
+  uv_fs_req_cleanup(req);
+  fstat_cb_count++;
+}
+
+
+static void close_cb(uv_fs_t* req) {
+  int r;
+  TUV_ASSERT(req == &close_req);
+  TUV_ASSERT(req->fs_type == UV_FS_CLOSE);
+  TUV_ASSERT(req->result == 0);
+  close_cb_count++;
+  uv_fs_req_cleanup(req);
+  if (close_cb_count == 3) {
+    r = uv_fs_unlink(loop, &unlink_req, filename2, unlink_cb);
+    TUV_ASSERT(r == 0);
+  }
+}
+
+
+static void ftruncate_cb(uv_fs_t* req) {
+  int r;
+  TUV_ASSERT(req == &ftruncate_req);
+  TUV_ASSERT(req->fs_type == UV_FS_FTRUNCATE);
+  TUV_ASSERT(req->result == 0);
+  ftruncate_cb_count++;
+  uv_fs_req_cleanup(req);
+  r = uv_fs_close(loop, &close_req, open_req1.result, close_cb);
+  TUV_ASSERT(r == 0);
+}
+
+
+static void read_cb(uv_fs_t* req) {
+  int r;
+  TUV_ASSERT(req == &read_req);
+  TUV_ASSERT(req->fs_type == UV_FS_READ);
+  TUV_ASSERT(req->result >= 0);  /* FIXME(bnoordhuis) Check if requested size? */
+  read_cb_count++;
+  uv_fs_req_cleanup(req);
+  if (read_cb_count == 1) {
+    TUV_ASSERT(strcmp(buf, test_buf) == 0);
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+    r = uv_fs_ftruncate(loop, &ftruncate_req, open_req1.result, 7,
+                        ftruncate_cb);
+#else
+    /* cannot truncate on nuttx so just close the file */
+    r = uv_fs_close(loop, &close_req, open_req1.result, close_cb);
+#endif
+  } else {
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+    TUV_ASSERT(strcmp(buf, "test-bu") == 0);
+#else
+    TUV_ASSERT(strcmp(buf, test_buf) == 0);
+#endif
+    r = uv_fs_close(loop, &close_req, open_req1.result, close_cb);
+  }
+  TUV_ASSERT(r == 0);
+}
+
+
+static void open_cb(uv_fs_t* req) {
+  int r;
+  TUV_ASSERT(req == &open_req1);
+  TUV_ASSERT(req->fs_type == UV_FS_OPEN);
+  if (req->result < 0) {
+    TDLOG("async open error: %d\n", (int)req->result);
+    TUV_ASSERT(0);
+  }
+  open_cb_count++;
+
+  TUV_ASSERT(req->path);
+  TUV_ASSERT(memcmp(req->path, filename2, strlen(filename2)) == 0);
+  uv_fs_req_cleanup(req);
+  memset(buf, 0, sizeof(buf));
+  iov = uv_buf_init(buf, sizeof(buf));
+  r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, read_cb);
+  TUV_ASSERT(r == 0);
+}
+
+
+static void open_cb_simple(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_OPEN);
+  if (req->result < 0) {
+    TDLOG("async open error: %d\n", (int)req->result);
+    TUV_ASSERT(0);
+  }
+  open_cb_count++;
+
+  TUV_ASSERT(req->path);
+  uv_fs_req_cleanup(req);
+}
+
+
+static void fsync_cb(uv_fs_t* req) {
+  int r;
+  TUV_ASSERT(req == &fsync_req);
+  TUV_ASSERT(req->fs_type == UV_FS_FSYNC);
+  TUV_ASSERT(req->result == 0);
+  fsync_cb_count++;
+
+  uv_fs_req_cleanup(req);
+  r = uv_fs_close(loop, &close_req, open_req1.result, close_cb);
+  TUV_ASSERT(r == 0);
+}
+
+
+static void fdatasync_cb(uv_fs_t* req) {
+  int r;
+  TUV_ASSERT(req == &fdatasync_req);
+  TUV_ASSERT(req->fs_type == UV_FS_FDATASYNC);
+  TUV_ASSERT(req->result == 0);
+  fdatasync_cb_count++;
+
+  uv_fs_req_cleanup(req);
+  r = uv_fs_fsync(loop, &fsync_req, open_req1.result, fsync_cb);
+  TUV_ASSERT(r == 0);
+}
+
+
+static void write_cb(uv_fs_t* req) {
+  int r;
+  TUV_ASSERT(req == &write_req);
+  TUV_ASSERT(req->fs_type == UV_FS_WRITE);
+  TUV_ASSERT(req->result >= 0);  /* FIXME(bnoordhuis) Check if requested size? */
+  write_cb_count++;
+
+  uv_fs_req_cleanup(req);
+  r = uv_fs_fdatasync(loop, &fdatasync_req, open_req1.result, fdatasync_cb);
+  TUV_ASSERT(r == 0);
+}
+
+
+static void create_cb(uv_fs_t* req) {
+  int r;
+  TUV_ASSERT(req == &open_req1);
+  TUV_ASSERT(req->fs_type == UV_FS_OPEN);
+  TUV_ASSERT(req->result >= 0);
+  create_cb_count++;
+  uv_fs_req_cleanup(req);
+  iov = uv_buf_init(test_buf, sizeof(test_buf));
+
+  r = uv_fs_write(loop, &write_req, req->result, &iov, 1, -1, write_cb);
+  TUV_ASSERT(r == 0);
+}
+
+
+static void rename_cb(uv_fs_t* req) {
+  TUV_ASSERT(req == &rename_req);
+  TUV_ASSERT(req->fs_type == UV_FS_RENAME);
+  TUV_ASSERT(req->result == 0);
+  rename_cb_count++;
+
+  uv_fs_req_cleanup(req);
+}
+
+
+static void mkdir_cb(uv_fs_t* req) {
+  TUV_ASSERT(req == &mkdir_req);
+  TUV_ASSERT(req->fs_type == UV_FS_MKDIR);
+  TUV_ASSERT(req->result == 0);
+  mkdir_cb_count++;
+
+  TUV_ASSERT(req->path);
+  TUV_ASSERT(memcmp(req->path, "test_dir\0", 9) == 0);
+  uv_fs_req_cleanup(req);
+}
+
+
+static void check_mkdtemp_result(uv_fs_t* req) {
+  int r;
+
+  TUV_ASSERT(req->fs_type == UV_FS_MKDTEMP);
+  TUV_ASSERT(req->result == 0);
+  TUV_ASSERT(req->path);
+  TUV_ASSERT(strlen(req->path) == 15);
+  TUV_ASSERT(memcmp(req->path, "test_dir_", 9) == 0);
+  TUV_ASSERT(memcmp(req->path + 9, "XXXXXX", 6) != 0);
+  check_permission(req->path, 0700);
+
+  /* Check if req->path is actually a directory */
+  r = uv_fs_stat(uv_default_loop(), &stat_req, req->path, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(((uv_stat_t*)stat_req.ptr)->st_mode & S_IFDIR);
+  uv_fs_req_cleanup(&stat_req);
+}
+
+
+static void mkdtemp_cb(uv_fs_t* req) {
+  TUV_ASSERT(req == &mkdtemp_req1);
+  check_mkdtemp_result(req);
+  mkdtemp_cb_count++;
+}
+
+
+static void rmdir_cb(uv_fs_t* req) {
+  TUV_ASSERT(req == &rmdir_req);
+  TUV_ASSERT(req->fs_type == UV_FS_RMDIR);
+  TUV_ASSERT(req->result == 0);
+  rmdir_cb_count++;
+  TUV_ASSERT(req->path);
+  TUV_ASSERT(memcmp(req->path, "test_dir\0", 9) == 0);
+  uv_fs_req_cleanup(req);
+}
+
+static void assert_is_file_type(uv_dirent_t dent) {
+#ifdef HAVE_DIRENT_TYPES
+  /*
+   * For Apple and Windows, we know getdents is expected to work but for other
+   * environments, the filesystem dictates whether or not getdents supports
+   * returning the file type.
+   *
+   *   See:
+   *     http://man7.org/linux/man-pages/man2/getdents.2.html
+   *     https://github.com/libuv/libuv/issues/501
+   */
+  #if defined(__APPLE__) || defined(_WIN32)
+    TUV_ASSERT(dent.type == UV_DIRENT_FILE);
+  #else
+    TUV_ASSERT(dent.type == UV_DIRENT_FILE || dent.type == UV_DIRENT_UNKNOWN);
+  #endif
+#else
+  TUV_ASSERT(dent.type == UV_DIRENT_UNKNOWN);
+#endif
+}
+
+static void scandir_cb(uv_fs_t* req) {
+  uv_dirent_t dent;
+  TUV_ASSERT(req == &scandir_req);
+  TUV_ASSERT(req->fs_type == UV_FS_SCANDIR);
+  TUV_ASSERT(req->result == 2);
+  TUV_ASSERT(req->ptr);
+
+  while (UV_EOF != uv_fs_scandir_next(req, &dent)) {
+    TUV_ASSERT(strcmp(dent.name, "file1") == 0 || strcmp(dent.name, "file2") == 0);
+    TUV_ASSERT(dent.type == UV_DIRENT_FILE || dent.type == UV_DIRENT_UNKNOWN);
+  }
+  scandir_cb_count++;
+  TUV_ASSERT(req->path);
+  TUV_ASSERT(memcmp(req->path, "test_dir\0", 9) == 0);
+  uv_fs_req_cleanup(req);
+  TUV_ASSERT(!req->ptr);
+}
+
+
+static void empty_scandir_cb(uv_fs_t* req) {
+  uv_dirent_t dent;
+
+  TUV_ASSERT(req == &scandir_req);
+  TUV_ASSERT(req->fs_type == UV_FS_SCANDIR);
+  TUV_ASSERT(req->result == 0);
+  TUV_ASSERT(req->ptr == NULL);
+  TUV_ASSERT(UV_EOF == uv_fs_scandir_next(req, &dent));
+  uv_fs_req_cleanup(req);
+  scandir_cb_count++;
+}
+
+
+static void file_scandir_cb(uv_fs_t* req) {
+  TUV_ASSERT(req == &scandir_req);
+  TUV_ASSERT(req->fs_type == UV_FS_SCANDIR);
+  TUV_ASSERT(req->result == UV_ENOTDIR);
+  TUV_ASSERT(req->ptr == NULL);
+  uv_fs_req_cleanup(req);
+  scandir_cb_count++;
+}
+
+
+static void stat_cb(uv_fs_t* req) {
+  TUV_ASSERT(req == &stat_req);
+  TUV_ASSERT(req->fs_type == UV_FS_STAT || req->fs_type == UV_FS_LSTAT);
+  TUV_ASSERT(req->result == 0);
+  TUV_ASSERT(req->ptr);
+  stat_cb_count++;
+  uv_fs_req_cleanup(req);
+  TUV_ASSERT(!req->ptr);
+}
+
+
+static void sendfile_cb(uv_fs_t* req) {
+  TUV_ASSERT(req == &sendfile_req);
+  TUV_ASSERT(req->fs_type == UV_FS_SENDFILE);
+  TUV_ASSERT(req->result == 65546);
+  sendfile_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+
+static void open_noent_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_OPEN);
+  TUV_ASSERT(req->result == UV_ENOENT);
+  open_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+static void open_nametoolong_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_OPEN);
+  TUV_ASSERT(req->result == UV_ENAMETOOLONG);
+  open_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+static void open_loop_cb(uv_fs_t* req) {
+  TUV_ASSERT(req->fs_type == UV_FS_OPEN);
+  TUV_ASSERT(req->result == UV_ELOOP);
+  open_cb_count++;
+  uv_fs_req_cleanup(req);
+}
+
+
+static void check_utime(const char* path, double atime, double mtime) {
+  uv_stat_t* s;
+  uv_fs_t req;
+  int r;
+
+  r = uv_fs_stat(loop, &req, path, NULL);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(req.result == 0);
+  s = &req.statbuf;
+
+  TUV_ASSERT(s->st_atim.tv_sec == atime);
+  TUV_ASSERT(s->st_mtim.tv_sec == mtime);
+
+  uv_fs_req_cleanup(&req);
+}
+
+
+static void utime_cb(uv_fs_t* req) {
+  utime_check_t* c;
+
+  TUV_ASSERT(req == &utime_req);
+  TUV_ASSERT(req->result == 0);
+  TUV_ASSERT(req->fs_type == UV_FS_UTIME);
+
+  c = (utime_check_t*)req->data;
+  check_utime(c->path, c->atime, c->mtime);
+
+  uv_fs_req_cleanup(req);
+  utime_cb_count++;
+}
+
+
+static void futime_cb(uv_fs_t* req) {
+  utime_check_t* c;
+
+  TUV_ASSERT(req == &futime_req);
+  TUV_ASSERT(req->result == 0);
+  TUV_ASSERT(req->fs_type == UV_FS_FUTIME);
+
+  c = (utime_check_t*)req->data;
+  check_utime(c->path, c->atime, c->mtime);
+
+  uv_fs_req_cleanup(req);
+  futime_cb_count++;
+}
+
+
+TEST_IMPL(fs_file_noent) {
+  uv_fs_t req;
+  int r;
+
+  open_cb_count = 0;
+
+  loop = uv_default_loop();
+
+  r = uv_fs_open(NULL, &req, "/does_not_exist", O_RDONLY, 0, NULL);
+  TUV_ASSERT(r == UV_ENOENT);
+  TUV_ASSERT(req.result == UV_ENOENT);
+  uv_fs_req_cleanup(&req);
+
+  r = uv_fs_open(loop, &req, "/does_not_exist", O_RDONLY, 0, open_noent_cb);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(open_cb_count == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(open_cb_count == 1);
+
+  /* TODO add EACCES test */
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  return 0;
+}
+
+
+#if defined(__linux__) || defined(__APPLE__)
+#define TOO_LONG_NAME_LENGTH 65536
+#endif
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+#define TOO_LONG_NAME_LENGTH (256+16)
+#endif
+
+static char name[TOO_LONG_NAME_LENGTH + 1];
+
+
+TEST_IMPL(fs_file_nametoolong) {
+  uv_fs_t req;
+  int r;
+
+  open_cb_count = 0;
+
+  loop = uv_default_loop();
+
+  memset(name, 'a', TOO_LONG_NAME_LENGTH);
+  name[TOO_LONG_NAME_LENGTH] = 0;
+
+  r = uv_fs_open(loop, &req, name, O_RDONLY, 0, NULL);
+  TUV_ASSERT(r == UV_ENAMETOOLONG);
+  TUV_ASSERT(req.result == UV_ENAMETOOLONG);
+  uv_fs_req_cleanup(&req);
+
+  r = uv_fs_open(loop, &req, name, O_RDONLY, 0, open_nametoolong_cb);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(open_cb_count == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(open_cb_count == 1);
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  return 0;
+}
+
+/*
+TEST_IMPL(fs_file_loop) {
+  uv_fs_t req;
+  int r;
+
+  loop = uv_default_loop();
+
+  unlink("test_symlink");
+  r = uv_fs_symlink(loop, &req, "test_symlink", "test_symlink", 0, NULL);
+  TUV_ASSERT(r == 0);
+  uv_fs_req_cleanup(&req);
+
+  r = uv_fs_open(loop, &req, "test_symlink", O_RDONLY, 0, NULL);
+  TUV_ASSERT(r == UV_ELOOP);
+  TUV_ASSERT(req.result == UV_ELOOP);
+  uv_fs_req_cleanup(&req);
+
+  r = uv_fs_open(loop, &req, "test_symlink", O_RDONLY, 0, open_loop_cb);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(open_cb_count == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(open_cb_count == 1);
+
+  unlink("test_symlink");
+
+  return 0;
+}
+*/
+
+
+TEST_IMPL(fs_file_async) {
+  int r;
+
+  /* Setup. */
+  unlink(filename1);
+  unlink(filename2);
+
+  open_cb_count = 0;
+  read_cb_count = 0;
+  close_cb_count = 0;
+  rename_cb_count = 0;
+  create_cb_count = 0;
+  write_cb_count = 0;
+  fsync_cb_count = 0;
+  fdatasync_cb_count = 0;
+  unlink_cb_count = 0;
+
+  memset(&open_req1, 0, sizeof(open_req1));
+  memset(&rename_req, 0, sizeof(rename_req));
+
+  loop = uv_default_loop();
+
+  //---------------------------------------------------------------------------
+  r = uv_fs_open(loop, &open_req1, filename1, O_WRONLY | O_CREAT,
+                 S_IRUSR | S_IWUSR, create_cb);
+  TUV_ASSERT(r == 0);
+
+  r = uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(create_cb_count == 1);
+  TUV_ASSERT(write_cb_count == 1);
+  TUV_ASSERT(fsync_cb_count == 1);
+  TUV_ASSERT(fdatasync_cb_count == 1);
+  TUV_ASSERT(close_cb_count == 1);
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  //---------------------------------------------------------------------------
+  r = uv_loop_init(loop);
+  TUV_ASSERT(r == 0);
+
+  r = uv_fs_rename(loop, &rename_req, filename1, filename2, rename_cb);
+  TUV_ASSERT(r == 0);
+
+  r = uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(create_cb_count == 1);
+  TUV_ASSERT(write_cb_count == 1);
+  TUV_ASSERT(close_cb_count == 1);
+  TUV_ASSERT(rename_cb_count == 1);
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  //---------------------------------------------------------------------------
+  r = uv_loop_init(loop);
+  TUV_ASSERT(r == 0);
+  r = uv_fs_open(loop, &open_req1, filename2, O_RDWR, 0, open_cb);
+  TUV_ASSERT(r == 0);
+
+  r = uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(open_cb_count == 1);
+  TUV_ASSERT(read_cb_count == 1);
+  TUV_ASSERT(close_cb_count == 2);
+  TUV_ASSERT(rename_cb_count == 1);
+  TUV_ASSERT(create_cb_count == 1);
+  TUV_ASSERT(write_cb_count == 1);
+  //TUV_ASSERT(ftruncate_cb_count == 1);
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  //---------------------------------------------------------------------------
+  r = uv_loop_init(loop);
+  TUV_ASSERT(r == 0);
+  r = uv_fs_open(loop, &open_req1, filename2, O_RDONLY, 0, open_cb);
+  TUV_ASSERT(r == 0);
+
+  r = uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(open_cb_count == 2);
+  TUV_ASSERT(read_cb_count == 2);
+  TUV_ASSERT(close_cb_count == 3);
+  TUV_ASSERT(rename_cb_count == 1);
+  TUV_ASSERT(unlink_cb_count == 1);
+  TUV_ASSERT(create_cb_count == 1);
+  TUV_ASSERT(write_cb_count == 1);
+  //TUV_ASSERT(ftruncate_cb_count == 1);
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  //---------------------------------------------------------------------------
+  /* Cleanup. */
+  unlink(filename1);
+  unlink(filename2);
+
+  return 0;
+}
+
+
+TEST_IMPL(fs_file_sync) {
+  int r;
+
+  /* Setup. */
+  unlink(filename1);
+  unlink(filename2);
+
+  loop = uv_default_loop();
+
+  r = uv_fs_open(loop, &open_req1, filename1, O_WRONLY | O_CREAT,
+      S_IWUSR | S_IRUSR, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(open_req1.result >= 0);
+  uv_fs_req_cleanup(&open_req1);
+
+  iov = uv_buf_init(test_buf, sizeof(test_buf));
+  r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(write_req.result >= 0);
+  uv_fs_req_cleanup(&write_req);
+
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(close_req.result == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  r = uv_fs_open(loop, &open_req1, filename1, O_RDWR, 0, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(open_req1.result >= 0);
+  uv_fs_req_cleanup(&open_req1);
+
+  iov = uv_buf_init(buf, sizeof(buf));
+  r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(read_req.result >= 0);
+  TUV_ASSERT(strcmp(buf, test_buf) == 0);
+  uv_fs_req_cleanup(&read_req);
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  r = uv_fs_ftruncate(loop, &ftruncate_req, open_req1.result, 7, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(ftruncate_req.result == 0);
+  uv_fs_req_cleanup(&ftruncate_req);
+#endif
+
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(close_req.result == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  r = uv_fs_rename(loop, &rename_req, filename1, filename2, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(rename_req.result == 0);
+  uv_fs_req_cleanup(&rename_req);
+
+  r = uv_fs_open(loop, &open_req1, filename2, O_RDONLY, 0, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(open_req1.result >= 0);
+  uv_fs_req_cleanup(&open_req1);
+
+  memset(buf, 0, sizeof(buf));
+  iov = uv_buf_init(buf, sizeof(buf));
+  r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(read_req.result >= 0);
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  TUV_ASSERT(strcmp(buf, "test-bu") == 0);
+#else
+  TUV_ASSERT(strcmp(buf, test_buf) == 0);
+#endif
+  uv_fs_req_cleanup(&read_req);
+
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(close_req.result == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  r = uv_fs_unlink(loop, &unlink_req, filename2, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(unlink_req.result == 0);
+  uv_fs_req_cleanup(&unlink_req);
+
+  /* Cleanup */
+  unlink(filename1);
+  unlink(filename2);
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  return 0;
+}
+
+TEST_IMPL(fs_file_write_null_buffer) {
+  int r;
+
+  /* Setup. */
+  unlink(filename1);
+
+  loop = uv_default_loop();
+
+  r = uv_fs_open(loop, &open_req1, filename1, O_WRONLY | O_CREAT,
+                  S_IWUSR | S_IRUSR, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(open_req1.result >= 0);
+  uv_fs_req_cleanup(&open_req1);
+
+  iov = uv_buf_init(NULL, 0);
+  r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(write_req.result == 0);
+  uv_fs_req_cleanup(&write_req);
+
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(close_req.result == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+  unlink(filename1);
+
+  return 0;
+}
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+TEST_IMPL(fs_fstat) {
+  int r;
+  uv_fs_t req;
+  uv_file file;
+  uv_stat_t* s;
+  struct stat t;
+
+  /* Setup. */
+  unlink(filename1);
+
+  loop = uv_default_loop();
+
+  r = uv_fs_open(loop, &req, filename1, O_RDWR | O_CREAT,
+                 S_IWUSR | S_IRUSR, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(req.result >= 0);
+  file = req.result;
+  uv_fs_req_cleanup(&req);
+
+  iov = uv_buf_init(test_buf, sizeof(test_buf));
+  r = uv_fs_write(loop, &req, file, &iov, 1, -1, NULL);
+  TUV_ASSERT(r == sizeof(test_buf));
+  TUV_ASSERT(req.result == sizeof(test_buf));
+  uv_fs_req_cleanup(&req);
+
+  r = uv_fs_fstat(loop, &req, file, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(req.result == 0);
+  s = (uv_stat_t*)req.ptr;
+  TUV_ASSERT(s->st_size == sizeof(test_buf));
+
+  r = fstat(file, &t);
+  TUV_ASSERT(r == 0);
+
+#if defined(__linux__)
+  TUV_ASSERT(s->st_dev == (uint64_t) t.st_dev);
+  TUV_ASSERT(s->st_nlink == (uint64_t) t.st_nlink);
+  TUV_ASSERT(s->st_uid == (uint64_t) t.st_uid);
+  TUV_ASSERT(s->st_gid == (uint64_t) t.st_gid);
+  TUV_ASSERT(s->st_rdev == (uint64_t) t.st_rdev);
+  TUV_ASSERT(s->st_ino == (uint64_t) t.st_ino);
+#endif
+  TUV_ASSERT(s->st_mode == (uint64_t) t.st_mode);
+  TUV_ASSERT(s->st_size == (uint64_t) t.st_size);
+  TUV_ASSERT(s->st_blksize == (uint64_t) t.st_blksize);
+  TUV_ASSERT(s->st_blocks == (uint64_t) t.st_blocks);
+
+#if defined (__linux__)
+  TUV_ASSERT(s->st_atim.tv_sec == t.st_atim.tv_sec);
+  TUV_ASSERT(s->st_atim.tv_nsec == t.st_atim.tv_nsec);
+  TUV_ASSERT(s->st_mtim.tv_sec == t.st_mtim.tv_sec);
+  TUV_ASSERT(s->st_mtim.tv_nsec == t.st_mtim.tv_nsec);
+  TUV_ASSERT(s->st_ctim.tv_sec == t.st_ctim.tv_sec);
+  TUV_ASSERT(s->st_ctim.tv_nsec == t.st_ctim.tv_nsec);
+#else
+  TUV_ASSERT(s->st_atim.tv_sec == t.st_atime);
+  TUV_ASSERT(s->st_atim.tv_nsec == 0);
+  TUV_ASSERT(s->st_mtim.tv_sec == t.st_mtime);
+  TUV_ASSERT(s->st_mtim.tv_nsec == 0);
+  TUV_ASSERT(s->st_ctim.tv_sec == t.st_ctime);
+  TUV_ASSERT(s->st_ctim.tv_nsec == 0);
+#endif
+
+  uv_fs_req_cleanup(&req);
+
+  /* Now do the uv_fs_fstat call asynchronously */
+  r = uv_fs_fstat(loop, &req, file, fstat_cb);
+  TUV_ASSERT(r == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(fstat_cb_count == 1);
+
+  r = uv_fs_close(loop, &req, file, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(req.result == 0);
+  uv_fs_req_cleanup(&req);
+
+  /*
+   * Run the loop just to check we don't have make any extraneous uv_ref()
+   * calls. This should drop out immediately.
+   */
+  uv_run(loop, UV_RUN_DEFAULT);
+
+  /* Cleanup. */
+  unlink(filename1);
+
+  return 0;
+}
+#endif // __NUTTX__
+
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+TEST_IMPL(fs_utime) {
+  utime_check_t checkme;
+  const char* path = filename1;
+  double atime;
+  double mtime;
+  uv_fs_t req;
+  int r;
+
+  /* Setup. */
+  loop = uv_default_loop();
+  unlink(path);
+  r = uv_fs_open(loop, &req, path, O_RDWR | O_CREAT,
+                 S_IWUSR | S_IRUSR, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(req.result >= 0);
+  uv_fs_req_cleanup(&req);
+  close(r);
+
+  atime = mtime = 400497753; /* 1982-09-10 11:22:33 */
+  r = uv_fs_utime(loop, &req, path, atime, mtime, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(req.result == 0);
+  uv_fs_req_cleanup(&req);
+
+  r = uv_fs_stat(loop, &req, path, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(req.result == 0);
+  check_utime(path, atime, mtime);
+  uv_fs_req_cleanup(&req);
+
+
+  atime = mtime = 1291404900; /* 2010-12-03 20:35:00 - mees <3 */
+  checkme.path = path;
+  checkme.atime = atime;
+  checkme.mtime = mtime;
+
+  /* async utime */
+  utime_req.data = &checkme;
+  r = uv_fs_utime(loop, &utime_req, path, atime, mtime, utime_cb);
+  TUV_ASSERT(r == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(utime_cb_count == 1);
+
+  /* Cleanup. */
+  TUV_ASSERT(0 == uv_loop_close(loop));
+  unlink(path);
+
+  return 0;
+}
+#endif
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+TEST_IMPL(fs_futime) {
+  utime_check_t checkme;
+  const char* path = filename1;
+  double atime;
+  double mtime;
+  uv_file file;
+  uv_fs_t req;
+  int r;
+
+  /* Setup. */
+  loop = uv_default_loop();
+  unlink(path);
+  r = uv_fs_open(loop, &req, path, O_RDWR | O_CREAT,
+      S_IWUSR | S_IRUSR, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(req.result >= 0);
+  uv_fs_req_cleanup(&req);
+  close(r);
+
+  atime = mtime = 400497753; /* 1982-09-10 11:22:33 */
+
+  r = uv_fs_open(loop, &req, path, O_RDWR, 0, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(req.result >= 0);
+  file = req.result; /* FIXME probably not how it's supposed to be used */
+  uv_fs_req_cleanup(&req);
+
+  r = uv_fs_futime(loop, &req, file, atime, mtime, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(req.result == 0);
+  uv_fs_req_cleanup(&req);
+
+  r = uv_fs_stat(loop, &req, path, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(req.result == 0);
+  check_utime(path, atime, mtime);
+  uv_fs_req_cleanup(&req);
+
+  atime = mtime = 1291404900; /* 2010-12-03 20:35:00 - mees <3 */
+
+  checkme.atime = atime;
+  checkme.mtime = mtime;
+  checkme.path = path;
+
+  /* async futime */
+  futime_req.data = &checkme;
+  r = uv_fs_futime(loop, &futime_req, file, atime, mtime, futime_cb);
+  TUV_ASSERT(r == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(futime_cb_count == 1);
+
+  /* Cleanup. */
+  unlink(path);
+
+  return 0;
+}
+#endif
+
+
+TEST_IMPL(fs_stat_missing_path) {
+  uv_fs_t req;
+  int r;
+
+  loop = uv_default_loop();
+
+  r = uv_fs_stat(loop, &req, "non_existent_file", NULL);
+  TUV_ASSERT(r == UV_ENOENT);
+  TUV_ASSERT(req.result == UV_ENOENT);
+  uv_fs_req_cleanup(&req);
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  return 0;
+}
+
+
+TEST_IMPL(fs_scandir_empty_dir) {
+  const char* path;
+  uv_fs_t req;
+  uv_dirent_t dent;
+  int r;
+
+  path = "./empty_dir/";
+  loop = uv_default_loop();
+
+  uv_fs_mkdir(NULL, &req, path, 0777, NULL);
+  uv_fs_req_cleanup(&req);
+
+  /* Fill the req to ensure that required fields are cleaned up */
+  memset(&req, 0xdb, sizeof(req));
+
+  scandir_cb_count = 0;
+  r = uv_fs_scandir(NULL, &req, path, 0, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(req.result == 0);
+  TUV_ASSERT(req.ptr == NULL);
+  TUV_ASSERT(UV_EOF == uv_fs_scandir_next(&req, &dent));
+  uv_fs_req_cleanup(&req);
+
+  r = uv_fs_scandir(loop, &scandir_req, path, 0, empty_scandir_cb);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(scandir_cb_count == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(scandir_cb_count == 1);
+
+  uv_fs_rmdir(NULL, &req, path, NULL);
+  uv_fs_req_cleanup(&req);
+
+  return 0;
+}
+
+
+TEST_IMPL(fs_scandir_file) {
+  const char* path;
+  int r;
+
+  path = "test/resources/empty_file";
+  loop = uv_default_loop();
+
+  scandir_cb_count = 0;
+  r = uv_fs_scandir(NULL, &scandir_req, path, 0, NULL);
+  TUV_ASSERT(r == UV_ENOTDIR);
+  uv_fs_req_cleanup(&scandir_req);
+
+  r = uv_fs_scandir(loop, &scandir_req, path, 0, file_scandir_cb);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(scandir_cb_count == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(scandir_cb_count == 1);
+
+  return 0;
+}
+
+
+TEST_IMPL(fs_open_dir) {
+  const char* path;
+  uv_fs_t req;
+  int r, file;
+
+  open_cb_count = 0;
+
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+  path = "/mnt/sdcard";
+#else
+  path = ".";
+#endif
+
+  loop = uv_default_loop();
+
+  r = uv_fs_open(loop, &req, path, O_RDONLY, 0, NULL);
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+  TUV_ASSERT(r == -EISDIR);
+  uv_fs_req_cleanup(&req);
+#else
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(req.result >= 0);
+  TUV_ASSERT(req.ptr == NULL);
+  file = r;
+  uv_fs_req_cleanup(&req);
+
+  r = uv_fs_close(loop, &req, file, NULL);
+  TUV_ASSERT(r == 0);
+  uv_fs_req_cleanup(&req);
+#endif
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  return 0;
+}
+
+
+TEST_IMPL(fs_file_open_append) {
+  int r;
+
+  /* Setup. */
+  unlink(filename1);
+
+  loop = uv_default_loop();
+
+  r = uv_fs_open(loop, &open_req1, filename1, O_WRONLY | O_CREAT,
+                 S_IWUSR | S_IRUSR, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(open_req1.result >= 0);
+  uv_fs_req_cleanup(&open_req1);
+
+  iov = uv_buf_init(test_buf, sizeof(test_buf));
+  r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(write_req.result >= 0);
+  uv_fs_req_cleanup(&write_req);
+
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(close_req.result == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  r = uv_fs_open(loop, &open_req1, filename1, O_RDWR | O_APPEND, 0, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(open_req1.result >= 0);
+  uv_fs_req_cleanup(&open_req1);
+
+  iov = uv_buf_init(test_buf, sizeof(test_buf));
+  r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(write_req.result >= 0);
+  uv_fs_req_cleanup(&write_req);
+
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(close_req.result == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  r = uv_fs_open(loop, &open_req1, filename1, O_RDONLY, S_IRUSR, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(open_req1.result >= 0);
+  uv_fs_req_cleanup(&open_req1);
+
+  iov = uv_buf_init(buf, sizeof(buf));
+  r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, NULL);
+  TUV_ASSERT(r == 26);
+  TUV_ASSERT(read_req.result == 26);
+  TUV_ASSERT(memcmp(buf,
+                    "test-buffer\n\0test-buffer\n\0",
+                    sizeof("test-buffer\n\0test-buffer\n\0") - 1) == 0);
+  uv_fs_req_cleanup(&read_req);
+
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(close_req.result == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  /* Cleanup */
+  TUV_ASSERT(0 == uv_loop_close(loop));
+  unlink(filename1);
+
+  return 0;
+}
+
+
+TEST_IMPL(fs_read_file_eof) {
+  int r;
+
+  /* Setup. */
+  unlink(filename1);
+
+  loop = uv_default_loop();
+
+  r = uv_fs_open(loop, &open_req1, filename1, O_WRONLY | O_CREAT,
+                 S_IWUSR | S_IRUSR, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(open_req1.result >= 0);
+  uv_fs_req_cleanup(&open_req1);
+
+  iov = uv_buf_init(test_buf, sizeof(test_buf));
+  r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(write_req.result >= 0);
+  uv_fs_req_cleanup(&write_req);
+
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(close_req.result == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  r = uv_fs_open(loop, &open_req1, filename1, O_RDONLY, 0, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(open_req1.result >= 0);
+  uv_fs_req_cleanup(&open_req1);
+
+  memset(buf, 0, sizeof(buf));
+  iov = uv_buf_init(buf, sizeof(buf));
+  r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, NULL);
+  TUV_ASSERT(r >= 0);
+  TUV_ASSERT(read_req.result >= 0);
+  TUV_ASSERT(strcmp(buf, test_buf) == 0);
+  uv_fs_req_cleanup(&read_req);
+
+  iov = uv_buf_init(buf, sizeof(buf));
+  r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1,
+                 read_req.result, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(read_req.result == 0);
+  uv_fs_req_cleanup(&read_req);
+
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(close_req.result == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  /* Cleanup */
+  TUV_ASSERT(0 == uv_loop_close(loop));
+  unlink(filename1);
+
+  return 0;
+}
+
+
+TEST_IMPL(fs_async_dir) {
+  int r;
+  uv_dirent_t dent;
+
+  /* Setup */
+  scandir_cb_count = 0;
+  unlink("test_dir/file1");
+  unlink("test_dir/file2");
+  rmdir("test_dir");
+
+  loop = uv_default_loop();
+
+  r = uv_fs_mkdir(loop, &mkdir_req, "test_dir", 0755, mkdir_cb);
+  TUV_ASSERT(r == 0);
+
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(mkdir_cb_count == 1);
+
+  /* Create 2 files synchronously. */
+  r = uv_fs_open(loop, &open_req1, "test_dir/file1", O_WRONLY | O_CREAT,
+      S_IWUSR | S_IRUSR, NULL);
+  TUV_ASSERT(r >= 0);
+  uv_fs_req_cleanup(&open_req1);
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  r = uv_fs_open(loop, &open_req1, "test_dir/file2", O_WRONLY | O_CREAT,
+      S_IWUSR | S_IRUSR, NULL);
+  TUV_ASSERT(r >= 0);
+  uv_fs_req_cleanup(&open_req1);
+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);
+  TUV_ASSERT(r == 0);
+  uv_fs_req_cleanup(&close_req);
+
+  r = uv_fs_scandir(loop, &scandir_req, "test_dir", 0, scandir_cb);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(scandir_cb_count == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(scandir_cb_count == 1);
+
+  /* sync uv_fs_scandir */
+  r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL);
+  TUV_ASSERT(r == 2);
+  TUV_ASSERT(scandir_req.result == 2);
+  TUV_ASSERT(scandir_req.ptr);
+  while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) {
+    TUV_ASSERT(strcmp(dent.name, "file1") == 0 || strcmp(dent.name, "file2") == 0);
+    assert_is_file_type(dent);
+  }
+  uv_fs_req_cleanup(&scandir_req);
+  TUV_ASSERT(!scandir_req.ptr);
+
+  r = uv_fs_stat(loop, &stat_req, "test_dir", stat_cb);
+  TUV_ASSERT(r == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+
+  r = uv_fs_stat(loop, &stat_req, "test_dir/", stat_cb);
+  TUV_ASSERT(r == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+
+  TUV_ASSERT(stat_cb_count == 2);
+
+  r = uv_fs_unlink(loop, &unlink_req, "test_dir/file1", NULL);
+  TUV_ASSERT(r == 0);
+
+  r = uv_fs_unlink(loop, &unlink_req, "test_dir/file2", NULL);
+  TUV_ASSERT(r == 0);
+
+  r = uv_fs_rmdir(loop, &rmdir_req, "test_dir", rmdir_cb);
+  TUV_ASSERT(r == 0);
+  uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(rmdir_cb_count == 1);
+
+  /* Cleanup */
+  unlink("test_dir/file1");
+  unlink("test_dir/file2");
+  rmdir("test_dir");
+  return 0;
+}
diff --git a/deps/libtuv/test/test_getaddrinfo.c b/deps/libtuv/test/test_getaddrinfo.c
new file mode 100644 (file)
index 0000000..2175c01
--- /dev/null
@@ -0,0 +1,158 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stdio.h>
+
+#include <uv.h>
+#include "runner.h"
+
+#define CONCURRENT_COUNT    10
+
+static const char* name = "localhost";
+
+static int getaddrinfo_cbs = 0;
+
+static uv_getaddrinfo_t* getaddrinfo_handle;
+static uv_getaddrinfo_t getaddrinfo_handles[CONCURRENT_COUNT];
+static int callback_counts[CONCURRENT_COUNT];
+
+
+static void getaddrinfo_basic_cb(uv_getaddrinfo_t* handle,
+                                 int status,
+                                 struct addrinfo* res) {
+  TUV_ASSERT(handle == getaddrinfo_handle);
+  getaddrinfo_cbs++;
+  free(handle);
+  uv_freeaddrinfo(res);
+}
+
+
+TEST_IMPL(getaddrinfo_basic) {
+  int r;
+
+  getaddrinfo_cbs = 0;
+
+  getaddrinfo_handle = (uv_getaddrinfo_t*)malloc(sizeof(uv_getaddrinfo_t));
+
+  r = uv_getaddrinfo(uv_default_loop(),
+                     getaddrinfo_handle,
+                     &getaddrinfo_basic_cb,
+                     name,
+                     NULL,
+                     NULL);
+  TUV_ASSERT(r == 0);
+
+  uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+
+  TUV_ASSERT(getaddrinfo_cbs == 1);
+
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
+
+
+TEST_IMPL(getaddrinfo_basic_sync) {
+  uv_getaddrinfo_t req;
+
+  TUV_ASSERT(0 == uv_getaddrinfo(uv_default_loop(),
+                                 &req,
+                                 NULL,
+                                 name,
+                                 NULL,
+                                 NULL));
+  uv_freeaddrinfo(req.addrinfo);
+
+  return 0;
+}
+
+
+
+static void getaddrinfo_cuncurrent_cb(uv_getaddrinfo_t* handle,
+                                      int status,
+                                      struct addrinfo* res) {
+  int i;
+  int* data = (int*)handle->data;
+
+  for (i = 0; i < CONCURRENT_COUNT; i++) {
+    if (&getaddrinfo_handles[i] == handle) {
+      TUV_ASSERT(i == *data);
+
+      callback_counts[i]++;
+      break;
+    }
+  }
+  TUV_ASSERT(i < CONCURRENT_COUNT);
+
+  free(data);
+  uv_freeaddrinfo(res);
+
+  getaddrinfo_cbs++;
+}
+
+
+TEST_IMPL(getaddrinfo_concurrent) {
+  int i, r;
+  int* data;
+
+  for (i = 0; i < CONCURRENT_COUNT; i++) {
+    callback_counts[i] = 0;
+
+    data = (int*)malloc(sizeof(int));
+    TUV_ASSERT(data != NULL);
+    *data = i;
+    getaddrinfo_handles[i].data = data;
+
+    r = uv_getaddrinfo(uv_default_loop(),
+                       &getaddrinfo_handles[i],
+                       &getaddrinfo_cuncurrent_cb,
+                       name,
+                       NULL,
+                       NULL);
+    TUV_ASSERT(r == 0);
+  }
+
+  uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+
+  for (i = 0; i < CONCURRENT_COUNT; i++) {
+    TUV_ASSERT(callback_counts[i] == 1);
+  }
+
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
diff --git a/deps/libtuv/test/test_idle.c b/deps/libtuv/test/test_idle.c
new file mode 100644 (file)
index 0000000..c9b7c54
--- /dev/null
@@ -0,0 +1,52 @@
+/* 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.
+ */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <uv.h>
+#include "runner.h"
+
+
+static uv_idle_t idle_handle;
+static int idle_cb_called = 0;
+
+void idle_callback(uv_idle_t* handle) {
+  TDDDLOG("idle_callback handle flag %p, %x, %d",
+          handle, handle->flags, idle_cb_called);
+  idle_cb_called++;
+}
+
+
+TEST_IMPL(idle_basic) {
+  uv_loop_t* loop;
+
+  idle_cb_called = 0;
+
+  loop = uv_default_loop();
+  uv_idle_init(loop, &idle_handle);
+  uv_idle_start(&idle_handle, idle_callback);
+  uv_run(loop, UV_RUN_ONCE);
+  uv_close((uv_handle_t*) &idle_handle, NULL);
+  uv_run(loop, UV_RUN_ONCE);
+
+  TUV_ASSERT(0 == uv_loop_close(loop));
+
+  TUV_WARN(idle_cb_called==1);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/test_shutdown_eof.c b/deps/libtuv/test/test_shutdown_eof.c
new file mode 100644 (file)
index 0000000..f416794
--- /dev/null
@@ -0,0 +1,156 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <uv.h>
+#include "runner.h"
+
+
+//-----------------------------------------------------------------------------
+
+static uv_tcp_t tcp;
+static uv_connect_t connect_req;
+static uv_write_t write_req;
+static uv_shutdown_t shutdown_req;
+static int got_q;
+static int got_eof;
+
+static int called_connect_cb;
+static int called_shutdown_cb;
+
+
+static void alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) {
+  buf->base = (char*)malloc(size);
+  buf->len = size;
+}
+
+
+static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) {
+  TUV_ASSERT((uv_tcp_t*)t == &tcp);
+
+
+  if (buf->base)
+    free(buf->base);
+
+  if (nread == 0) {
+    return;
+  }
+
+  if (nread > 0) {
+    TUV_ASSERT(0);
+    //TUV_ASSERT(!got_eof);
+    //TUV_ASSERT(buf->base[0] == 'Q');
+    //uv_buf_t qbuf = uv_buf_init((char*)"Q", 1);
+    //int r = uv_write(&write_req, t, &qbuf, 1, NULL);
+    //TUV_ASSERT(r == 0);
+    //got_q = 1;
+  } else {
+    TUV_ASSERT(nread == UV_EOF);
+    uv_close((uv_handle_t*)t, NULL);
+    got_eof = 1;
+  }
+}
+
+
+static void shutdown_cb(uv_shutdown_t *req, int status) {
+  TUV_ASSERT(req == &shutdown_req);
+  TUV_ASSERT(called_connect_cb == 1);
+  TUV_ASSERT(!got_eof);
+
+  called_shutdown_cb++;
+}
+
+
+static void connect_cb(uv_connect_t *req, int status) {
+  TUV_ASSERT(status == 0);
+  TUV_ASSERT(req == &connect_req);
+  int r;
+
+  /* Start reading from our connection so we can receive the EOF.  */
+  r = uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb);
+  TUV_ASSERT(r == 0);
+
+  /*
+   * Write the letter 'Q' to gracefully kill the echo-server. This will not
+   * effect our connection.
+   */
+  uv_buf_t qsbuf = uv_buf_init((char*)"Q", 1);
+  r = uv_write(&write_req, (uv_stream_t*) &tcp, &qsbuf, 1, NULL);
+  TUV_ASSERT(r == 0);
+
+  /* Shutdown our end of the connection.  */
+  //r = uv_shutdown(&shutdown_req, (uv_stream_t*) &tcp, shutdown_cb);
+  //TUV_ASSERT(r == 0);
+
+  called_connect_cb++;
+  TUV_ASSERT(called_shutdown_cb == 0);
+}
+
+
+/*
+ * This test has a client which connects to the echo_server and immediately
+ * issues a shutdown. The echo-server, in response, will also shutdown their
+ * connection. We check, with a timer, that libuv is not automatically
+ * calling uv_close when the client receives the EOF from echo-server.
+ */
+TEST_IMPL(shutdown_eof) {
+  struct sockaddr_in server_addr;
+  int r;
+
+  got_q = 0;
+  got_eof = 0;
+  called_connect_cb = 0;
+  called_shutdown_cb = 0;
+
+
+  TUV_ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr));
+  r = uv_tcp_init(uv_default_loop(), &tcp);
+  TUV_ASSERT(!r);
+
+  r = uv_tcp_connect(&connect_req,
+                     &tcp,
+                     (const struct sockaddr*) &server_addr,
+                     connect_cb);
+  TUV_ASSERT(!r);
+
+  uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
diff --git a/deps/libtuv/test/test_tcp_open.c b/deps/libtuv/test/test_tcp_open.c
new file mode 100644 (file)
index 0000000..7256731
--- /dev/null
@@ -0,0 +1,210 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+static int shutdown_cb_called = 0;
+static int connect_cb_called = 0;
+static int write_cb_called = 0;
+static int close_cb_called = 0;
+
+static uv_connect_t connect_req;
+static uv_shutdown_t shutdown_req;
+static uv_write_t write_req;
+
+
+static void startup(void) {
+  usleep(1000);
+}
+
+
+static uv_os_sock_t create_tcp_socket(void) {
+  uv_os_sock_t sock;
+
+  sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
+  TUV_ASSERT(sock >= 0);
+
+  {
+    /* Allow reuse of the port. */
+    int yes = 1;
+    int r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes);
+    TUV_ASSERT(r == 0);
+  }
+
+  return sock;
+}
+
+
+static void alloc_cb(uv_handle_t* handle,
+                     size_t suggested_size,
+                     uv_buf_t* buf) {
+#ifdef EMBED_LOW_MEMORY
+  static char slab[2048];
+#else
+  static char slab[65536];
+#endif
+  TUV_ASSERT(suggested_size <= sizeof(slab));
+  buf->base = slab;
+  buf->len = sizeof(slab);
+}
+
+
+static void close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  close_cb_called++;
+}
+
+
+static void shutdown_cb(uv_shutdown_t* req, int status) {
+  TUV_ASSERT(req == &shutdown_req);
+  TUV_ASSERT(status == 0);
+
+  /* Now we wait for the EOF */
+  shutdown_cb_called++;
+}
+
+
+static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) {
+  TUV_ASSERT(tcp != NULL);
+
+  if (nread > 0) {
+    TUV_ASSERT(nread == 4);
+    TUV_ASSERT(memcmp("PING", buf->base, nread) == 0);
+
+    /* tell server to close connection */
+    {
+      uv_buf_t buf = uv_buf_init((char*)"QS", 2);
+      int r = uv_write(&write_req, tcp, &buf, 1, NULL);
+      TUV_ASSERT(r == 0);
+    }
+  }
+  else if (nread == 0) {
+
+  }
+  else if (nread < 0) {
+    TUV_ASSERT(nread == UV_EOF);
+    uv_close((uv_handle_t*)tcp, close_cb);
+  }
+}
+
+
+static void write_cb(uv_write_t* req, int status) {
+  TUV_ASSERT(req != NULL);
+
+  if (status) {
+    TDLOG("tcp_open uv_write error: %s", uv_strerror(status));
+    TUV_ASSERT(0);
+  }
+
+  write_cb_called++;
+}
+
+
+static void connect_cb(uv_connect_t* req, int status) {
+  uv_buf_t buf = uv_buf_init((char*)"PING", 4);
+  uv_stream_t* stream;
+  int r;
+
+  if (status == UV__ECONNREFUSED) {
+    TDLOG("tcp_open Connection refused. Run server first.");
+    TUV_ASSERT(0);
+  }
+
+  TUV_ASSERT(req == &connect_req);
+  TUV_ASSERT(status == 0);
+
+  stream = req->handle;
+  connect_cb_called++;
+
+  r = uv_write(&write_req, stream, &buf, 1, write_cb);
+  TUV_ASSERT(r == 0);
+
+  /* Shutdown on drain. */
+  // r = uv_shutdown(&shutdown_req, stream, shutdown_cb);
+  //TUV_ASSERT(r == 0);
+
+  /* Start reading */
+  r = uv_read_start(stream, alloc_cb, read_cb);
+  TUV_ASSERT(r == 0);
+}
+
+
+TEST_IMPL(tcp_open) {
+  struct sockaddr_in addr;
+  uv_tcp_t client;
+  uv_os_sock_t sock;
+  int r;
+
+  shutdown_cb_called = 0;
+  connect_cb_called = 0;
+  write_cb_called = 0;
+  close_cb_called = 0;
+
+  TUV_ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr));
+
+  startup();
+  sock = create_tcp_socket();
+
+  r = uv_tcp_init(uv_default_loop(), &client);
+  TUV_ASSERT(r == 0);
+
+  r = uv_tcp_open(&client, sock);
+  TUV_ASSERT(r == 0);
+
+  r = uv_tcp_connect(&connect_req,
+                     &client,
+                     (const struct sockaddr*)&addr,
+                     connect_cb);
+  TUV_ASSERT(r == 0);
+
+  uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  //TUV_ASSERT(shutdown_cb_called == 1);
+  TUV_ASSERT(connect_cb_called == 1);
+  TUV_ASSERT(write_cb_called == 1);
+  TUV_ASSERT(close_cb_called == 1);
+
+  return 0;
+}
diff --git a/deps/libtuv/test/test_threadpool.c b/deps/libtuv/test/test_threadpool.c
new file mode 100644 (file)
index 0000000..a7742cc
--- /dev/null
@@ -0,0 +1,84 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stdio.h>
+
+#include <uv.h>
+#include "runner.h"
+
+
+static int work_cb_count;
+static int after_work_cb_count;
+static uv_work_t work_req;
+static char data;
+
+
+static void work_cb(uv_work_t* req) {
+  TUV_ASSERT(req == &work_req);
+  TUV_ASSERT(req->data == &data);
+  work_cb_count++;
+}
+
+
+static void after_work_cb(uv_work_t* req, int status) {
+  TUV_ASSERT(status == 0);
+  TUV_ASSERT(req == &work_req);
+  TUV_ASSERT(req->data == &data);
+  after_work_cb_count++;
+}
+
+
+TEST_IMPL(threadpool_queue_work_simple) {
+  int r;
+
+  work_cb_count = 0;
+  after_work_cb_count = 0;
+
+  work_req.data = &data;
+  r = uv_queue_work(uv_default_loop(), &work_req, work_cb, after_work_cb);
+  TUV_ASSERT(r == 0);
+  r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+  TUV_ASSERT(r == 0);
+
+  TUV_ASSERT(work_cb_count == 1);
+  TUV_ASSERT(after_work_cb_count == 1);
+
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
+
diff --git a/deps/libtuv/test/test_timer.c b/deps/libtuv/test/test_timer.c
new file mode 100644 (file)
index 0000000..524499c
--- /dev/null
@@ -0,0 +1,370 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <string.h>
+#include <uv.h>
+
+
+#include "uv-common.h"
+#include "runner.h"
+
+
+//-----------------------------------------------------------------------------
+
+TEST_IMPL(timer_init) {
+  uv_timer_t handle;
+
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &handle));
+  TUV_ASSERT(0 == uv_timer_get_repeat(&handle));
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) &handle));
+
+  // for platforms that needs cleaning
+  uv_close((uv_handle_t*) &handle, NULL);
+  uv_run(uv_default_loop(), UV_RUN_ONCE);
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
+
+
+//-----------------------------------------------------------------------------
+
+static int once_cb_called = 0;
+static int once_close_cb_called = 0;
+static int repeat_cb_called = 0;
+static int repeat_close_cb_called = 0;
+
+static uint64_t start_time = 0ll;
+
+
+static void once_close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  TUV_ASSERT(0 == uv_is_active(handle));
+
+  once_close_cb_called++;
+}
+
+
+static void once_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  TUV_ASSERT(0 == uv_is_active((uv_handle_t*) handle));
+
+  once_cb_called++;
+
+  uv_close((uv_handle_t*)handle, once_close_cb);
+
+  /* Just call this randomly for the code coverage. */
+  uv_update_time(uv_default_loop());
+}
+
+
+static void repeat_close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+
+  repeat_close_cb_called++;
+}
+
+
+static void repeat_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle != NULL);
+  TUV_ASSERT(1 == uv_is_active((uv_handle_t*) handle));
+
+  repeat_cb_called++;
+
+  if (repeat_cb_called == 5) {
+    uv_close((uv_handle_t*)handle, repeat_close_cb);
+  }
+}
+
+
+static void never_cb(uv_timer_t* handle) {
+  TUV_FATAL("never_cb should never be called");
+}
+
+
+TEST_IMPL(timer) {
+  uv_timer_t once_timers[10];
+  uv_timer_t *once;
+  uv_timer_t repeat, never;
+  unsigned int i;
+  int r;
+
+  once_cb_called = 0;
+  once_close_cb_called = 0;
+  repeat_cb_called = 0;
+  repeat_close_cb_called = 0;
+
+  start_time = uv_now(uv_default_loop());
+  TUV_ASSERT(0 < start_time);
+
+  /* Let 10 timers time out in 500 ms total. */
+  for (i = 0; i < ARRAY_SIZE(once_timers); i++) {
+    once = once_timers + i;
+    r = uv_timer_init(uv_default_loop(), once);
+    TUV_ASSERT(r == 0);
+    r = uv_timer_start(once, once_cb, i * 50, 0);
+    TUV_ASSERT(r == 0);
+  }
+
+  /* The 11th timer is a repeating timer that runs 4 times */
+  r = uv_timer_init(uv_default_loop(), &repeat);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&repeat, repeat_cb, 100, 100);
+  TUV_ASSERT(r == 0);
+
+  /* The 12th timer should not do anything. */
+  r = uv_timer_init(uv_default_loop(), &never);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&never, never_cb, 100, 100);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_stop(&never);
+  TUV_ASSERT(r == 0);
+  uv_unref((uv_handle_t*)&never);
+  // for platforms that needs cleaning
+  uv_close((uv_handle_t*) &never, NULL);
+
+  uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+
+  TUV_ASSERT(once_cb_called == 10);
+  TUV_ASSERT(once_close_cb_called == 10);
+  TUV_ASSERT(repeat_cb_called == 5);
+  TUV_ASSERT(repeat_close_cb_called == 1);
+
+  TUV_ASSERT(500 <= uv_now(uv_default_loop()) - start_time);
+
+  // for platforms that needs cleaning
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
+
+
+
+//-----------------------------------------------------------------------------
+
+TEST_IMPL(timer_start_twice) {
+  uv_timer_t once;
+  int r;
+
+  once_cb_called = 0;
+
+  r = uv_timer_init(uv_default_loop(), &once);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&once, never_cb, 86400 * 1000, 0);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&once, once_cb, 10, 0);
+  TUV_ASSERT(r == 0);
+  r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(once_cb_called == 1);
+
+  // for platforms that needs cleaning
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
+
+
+//-----------------------------------------------------------------------------
+
+static int order_cb_called = 0;
+
+static void order_cb_a(uv_timer_t *handle) {
+  TUV_ASSERT(order_cb_called++ == *(int*)handle->data);
+}
+
+
+static void order_cb_b(uv_timer_t *handle) {
+  TUV_ASSERT(order_cb_called++ == *(int*)handle->data);
+}
+
+
+TEST_IMPL(timer_order) {
+  int first;
+  int second;
+  uv_timer_t handle_a;
+  uv_timer_t handle_b;
+
+  order_cb_called = 0;
+
+  first = 0;
+  second = 1;
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &handle_a));
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &handle_b));
+
+  /* Test for starting handle_a then handle_b */
+  handle_a.data = &first;
+  TUV_ASSERT(0 == uv_timer_start(&handle_a, order_cb_a, 0, 0));
+  handle_b.data = &second;
+  TUV_ASSERT(0 == uv_timer_start(&handle_b, order_cb_b, 0, 0));
+  TUV_ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
+
+  TUV_ASSERT(order_cb_called == 2);
+
+  TUV_ASSERT(0 == uv_timer_stop(&handle_a));
+  TUV_ASSERT(0 == uv_timer_stop(&handle_b));
+
+  /* Test for starting handle_b then handle_a */
+  order_cb_called = 0;
+  handle_b.data = &first;
+  TUV_ASSERT(0 == uv_timer_start(&handle_b, order_cb_b, 0, 0));
+
+  handle_a.data = &second;
+  TUV_ASSERT(0 == uv_timer_start(&handle_a, order_cb_a, 0, 0));
+  TUV_ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
+
+  TUV_ASSERT(order_cb_called == 2);
+
+  // for platforms that needs cleaning
+  uv_close((uv_handle_t*) &handle_a, NULL);
+  uv_close((uv_handle_t*) &handle_b, NULL);
+  uv_run(uv_default_loop(), UV_RUN_ONCE);
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
+
+
+//-----------------------------------------------------------------------------
+
+static uv_timer_t tiny_timer;
+static uv_timer_t huge_timer1;
+static uv_timer_t huge_timer2;
+
+
+static void tiny_timer_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle == &tiny_timer);
+  uv_close((uv_handle_t*) &tiny_timer, NULL);
+  uv_close((uv_handle_t*) &huge_timer1, NULL);
+  uv_close((uv_handle_t*) &huge_timer2, NULL);
+}
+
+
+TEST_IMPL(timer_huge_timeout) {
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &tiny_timer));
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &huge_timer1));
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &huge_timer2));
+  TUV_ASSERT(0 == uv_timer_start(&tiny_timer, tiny_timer_cb, 1, 0));
+  TUV_ASSERT(0 == uv_timer_start(&huge_timer1, tiny_timer_cb, 0xffffffffffffLL, 0));
+  TUV_ASSERT(0 == uv_timer_start(&huge_timer2, tiny_timer_cb, (uint64_t) -1, 0));
+  TUV_ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
+
+  // for platforms that needs cleaning
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
+
+
+static int huge_repeat_cb_ncalls;
+
+static void huge_repeat_cb(uv_timer_t* handle) {
+  if (huge_repeat_cb_ncalls == 0)
+    TUV_ASSERT(handle == &huge_timer1);
+  else
+    TUV_ASSERT(handle == &tiny_timer);
+
+  if (++huge_repeat_cb_ncalls == 10) {
+    uv_close((uv_handle_t*) &tiny_timer, NULL);
+    uv_close((uv_handle_t*) &huge_timer1, NULL);
+  }
+}
+
+
+TEST_IMPL(timer_huge_repeat) {
+  huge_repeat_cb_ncalls = 0;
+
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &tiny_timer));
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &huge_timer1));
+  TUV_ASSERT(0 == uv_timer_start(&tiny_timer, huge_repeat_cb, 2, 2));
+  TUV_ASSERT(0 == uv_timer_start(&huge_timer1, huge_repeat_cb, 1, (uint64_t) -1));
+  TUV_ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
+
+  // for platforms that needs cleaning
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
+
+
+//-----------------------------------------------------------------------------
+
+static unsigned int timer_run_once_timer_cb_called = 0;
+
+static void timer_run_once_timer_cb(uv_timer_t* handle) {
+  timer_run_once_timer_cb_called++;
+}
+
+
+TEST_IMPL(timer_run_once) {
+  uv_timer_t timer_handle;
+
+  timer_run_once_timer_cb_called = 0;
+
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &timer_handle));
+  TUV_ASSERT(0 == uv_timer_start(&timer_handle, timer_run_once_timer_cb, 0, 0));
+  TUV_ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE));
+  TUV_ASSERT(1 == timer_run_once_timer_cb_called);
+
+  TUV_ASSERT(0 == uv_timer_start(&timer_handle, timer_run_once_timer_cb, 1, 0));
+  // slow systems may have nano second resolution
+  // give some time to sleep so that time tick is changed
+  uv_sleep(1);
+  TUV_ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE));
+  TUV_ASSERT(2 == timer_run_once_timer_cb_called);
+
+  uv_close((uv_handle_t*)&timer_handle, NULL);
+  TUV_ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE));
+
+  // for platforms that needs cleaning
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
+
+
+TEST_IMPL(timer_null_callback) {
+  uv_timer_t handle;
+
+  TUV_ASSERT(0 == uv_timer_init(uv_default_loop(), &handle));
+  TUV_ASSERT(UV_EINVAL == uv_timer_start(&handle, NULL, 100, 100));
+
+  // for platform that needs closing
+  tuv_timer_deinit(uv_default_loop(), &handle);
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
diff --git a/deps/libtuv/test/test_timer_again.c b/deps/libtuv/test/test_timer_again.c
new file mode 100644 (file)
index 0000000..311fb79
--- /dev/null
@@ -0,0 +1,149 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+static int close_cb_called = 0;
+static int repeat_1_cb_called = 0;
+static int repeat_2_cb_called = 0;
+static int repeat_2_cb_allowed = 0;
+
+static uv_timer_t dummy, repeat_1, repeat_2;
+
+static uint64_t start_time;
+
+
+static void close_cb(uv_handle_t* handle) {
+  TUV_ASSERT(handle != NULL);
+
+  close_cb_called++;
+}
+
+
+static void repeat_1_cb(uv_timer_t* handle) {
+  int r;
+
+  TUV_ASSERT(handle == &repeat_1);
+  TUV_ASSERT(uv_timer_get_repeat((uv_timer_t*)handle) == 50);
+
+  repeat_1_cb_called++;
+
+  r = uv_timer_again(&repeat_2);
+  TUV_ASSERT(r == 0);
+
+  if (repeat_1_cb_called == 10) {
+    uv_close((uv_handle_t*)handle, close_cb);
+    /* We're not calling uv_timer_again on repeat_2 any more, so after this */
+    /* timer_2_cb is expected. */
+    repeat_2_cb_allowed = 1;
+    return;
+  }
+}
+
+
+static void repeat_2_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle == &repeat_2);
+  TUV_ASSERT(repeat_2_cb_allowed);
+
+  repeat_2_cb_called++;
+
+  if (uv_timer_get_repeat(&repeat_2) == 0) {
+    TUV_ASSERT(0 == uv_is_active((uv_handle_t*) handle));
+    uv_close((uv_handle_t*)handle, close_cb);
+    return;
+  }
+
+  TUV_ASSERT(uv_timer_get_repeat(&repeat_2) == 100);
+
+  /* This shouldn't take effect immediately. */
+  uv_timer_set_repeat(&repeat_2, 0);
+}
+
+
+TEST_IMPL(timer_again) {
+  int r;
+
+  close_cb_called = 0;
+  repeat_1_cb_called = 0;
+  repeat_2_cb_called = 0;
+  repeat_2_cb_allowed = 0;
+
+  start_time = uv_now(uv_default_loop());
+  TUV_ASSERT(0 < start_time);
+
+  /* Verify that it is not possible to uv_timer_again a never-started timer. */
+  r = uv_timer_init(uv_default_loop(), &dummy);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_again(&dummy);
+  TUV_ASSERT(r == UV_EINVAL);
+  uv_unref((uv_handle_t*)&dummy);
+
+  /* Start timer repeat_1. */
+  r = uv_timer_init(uv_default_loop(), &repeat_1);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&repeat_1, repeat_1_cb, 50, 0);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(uv_timer_get_repeat(&repeat_1) == 0);
+
+  /* Actually make repeat_1 repeating. */
+  uv_timer_set_repeat(&repeat_1, 50);
+  TUV_ASSERT(uv_timer_get_repeat(&repeat_1) == 50);
+
+  /*
+   * Start another repeating timer. It'll be again()ed by the repeat_1 so
+   * it should not time out until repeat_1 stops.
+   */
+  r = uv_timer_init(uv_default_loop(), &repeat_2);
+  TUV_ASSERT(r == 0);
+  r = uv_timer_start(&repeat_2, repeat_2_cb, 100, 100);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(uv_timer_get_repeat(&repeat_2) == 100);
+
+  uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+
+  TUV_ASSERT(repeat_1_cb_called == 10);
+  TUV_ASSERT(repeat_2_cb_called == 2);
+  TUV_ASSERT(close_cb_called == 2);
+
+  // for platform that needs closing
+  tuv_timer_deinit(uv_default_loop(), &dummy);
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
diff --git a/deps/libtuv/test/test_walk_handles.c b/deps/libtuv/test/test_walk_handles.c
new file mode 100644 (file)
index 0000000..b671ed5
--- /dev/null
@@ -0,0 +1,97 @@
+/* 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.
+ */
+
+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <uv.h>
+
+#include "runner.h"
+
+
+static char magic_cookie[] = "magic cookie";
+static int seen_timer_handle;
+static uv_timer_t timer;
+
+
+static void walk_cb(uv_handle_t* handle, void* arg) {
+  TUV_ASSERT(arg == (void*)magic_cookie);
+
+  if (handle == (uv_handle_t*)&timer) {
+    seen_timer_handle++;
+  } else {
+    TUV_ASSERT(0 && "unexpected handle");
+  }
+}
+
+
+static void timer_cb(uv_timer_t* handle) {
+  TUV_ASSERT(handle == &timer);
+
+  uv_walk(handle->loop, walk_cb, magic_cookie);
+  uv_close((uv_handle_t*)handle, NULL);
+}
+
+
+TEST_IMPL(walk_handles) {
+  uv_loop_t* loop;
+  int r;
+
+  seen_timer_handle = 0;
+
+  loop = uv_default_loop();
+
+  r = uv_timer_init(loop, &timer);
+  TUV_ASSERT(r == 0);
+
+  r = uv_timer_start(&timer, timer_cb, 1, 0);
+  TUV_ASSERT(r == 0);
+
+  /* Start event loop, expect to see the timer handle in walk_cb. */
+  TUV_ASSERT(seen_timer_handle == 0);
+  r = uv_run(loop, UV_RUN_DEFAULT);
+  TUV_ASSERT(r == 0);
+  TUV_ASSERT(seen_timer_handle == 1);
+
+  /* Loop is finished, walk_cb should not see our timer handle. */
+  seen_timer_handle = 0;
+  uv_walk(loop, walk_cb, magic_cookie);
+  TUV_ASSERT(seen_timer_handle == 0);
+
+  TUV_ASSERT(0 == uv_loop_close(uv_default_loop()));
+
+  return 0;
+}
diff --git a/deps/libtuv/tools/apt-get-install-arm.sh b/deps/libtuv/tools/apt-get-install-arm.sh
new file mode 100755 (executable)
index 0000000..3aa7891
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Copyright 2016-2017 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.
+
+sudo apt-get update -q
+sudo apt-get install -q -y \
+    gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
diff --git a/deps/libtuv/tools/apt-get-install-deps.sh b/deps/libtuv/tools/apt-get-install-deps.sh
new file mode 100755 (executable)
index 0000000..4328ea3
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Copyright 2016-2017 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.
+
+sudo apt-get update -q
+sudo apt-get install -q -y \
+    cmake gcc
diff --git a/deps/libtuv/tools/check-signed-off.sh b/deps/libtuv/tools/check-signed-off.sh
new file mode 100755 (executable)
index 0000000..2ef7674
--- /dev/null
@@ -0,0 +1,111 @@
+#!/bin/bash
+
+# Copyright 2015-2016 Samsung Electronics Co., Ltd.
+# Copyright 2016 University of Szeged
+#
+# 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.
+
+# Usage
+function print_usage
+{
+ echo "Usage: $0 [--help] [--tolerant] [--travis]"
+}
+
+function print_help
+{
+ echo "$0: Check Signed-off-by message of the latest commit"
+ echo ""
+ print_usage
+ echo ""
+ echo "Optional arguments:"
+ echo "  --help            print this help message"
+ echo "  --tolerant        check the existence of the message only but don't"
+ echo "                    require the name and email address to match the author"
+ echo "                    of the commit"
+ echo "  --travis          perform check in tolerant mode if on Travis CI and not"
+ echo "                    checking a pull request, perform strict check otherwise"
+ echo ""
+ echo "The last line of every commit message must follow the form of:"
+ echo "'libtuv-DCO-1.0-Signed-off-by: NAME EMAIL', where NAME and EMAIL must"
+ echo "match the name and email address of the author of the commit (unless in"
+ echo "tolerant mode)."
+}
+
+# Processing command line
+TOLERANT="no"
+while [ "$#" -gt 0 ]
+do
+ if [ "$1" == "--help" ]
+ then
+  print_help
+  exit 0
+ elif [ "$1" == "--tolerant" ]
+ then
+  TOLERANT="yes"
+  shift
+ elif [ "$1" == "--travis" ]
+ then
+  if [ "$TRAVIS_PULL_REQUEST" == "" ]
+  then
+   echo -e "\e[1;33mWarning! Travis-tolerant mode requested but not running on Travis CI! \e[0m"
+  elif [ "$TRAVIS_PULL_REQUEST" == "false" ]
+  then
+   TOLERANT="yes"
+  else
+   TOLERANT="no"
+  fi
+  shift
+ else
+  print_usage
+  exit 1
+ fi
+done
+
+# Determining latest commit
+parent_hashes=(`git show -s --format=%p HEAD | head -1`)
+
+if [ "${#parent_hashes[@]}" -eq 1 ]
+then
+ commit_hash=`git show -s --format=%h HEAD | head -1`
+elif [ "${#parent_hashes[@]}" -eq 2 ]
+then
+ commit_hash=${parent_hashes[1]}
+else
+ echo "$0: cannot handle commit with ${#parent_hashes[@]} parents ${parent_hashes[@]}"
+ exit 1
+fi
+
+# Checking the last line
+actual_signed_off_by_line=`git show -s --format=%B $commit_hash | sed '/^$/d' | tr -d '\015' | tail -n 1`
+
+if [ "$TOLERANT" == "no" ]
+then
+ author_name=`git show -s --format=%an $commit_hash`
+ author_email=`git show -s --format=%ae $commit_hash`
+ required_signed_off_by_line="libtuv-DCO-1.0-Signed-off-by: $author_name $author_email"
+
+ if [ "$actual_signed_off_by_line" != "$required_signed_off_by_line" ]
+ then
+  echo -e "\e[1;33mSigned-off-by message is incorrect. The following line should be at the end of the $commit_hash commit's message: '$required_signed_off_by_line'. \e[0m"
+  exit 1
+ fi
+else
+  echo -e "\e[1;33mWarning! The name and email address of the author of the $commit_hash commit is not checked in tolerant mode! \e[0m"
+  if echo "$actual_signed_off_by_line" | grep -q -v '^libtuv-DCO-1.0-Signed-off-by:'
+  then
+   echo -e "\e[1;33mSigned-off-by message is incorrect. The following line should be at the end of the $commit_hash commit's message: '$required_signed_off_by_line'. \e[0m"
+   exit 1
+  fi
+fi
+
+exit 0
diff --git a/docs/Developer's-Guide.md b/docs/Developer's-Guide.md
new file mode 100644 (file)
index 0000000..dd75215
--- /dev/null
@@ -0,0 +1,4 @@
+To contribute to the IoT.js Project (such as reporting bugs and submitting patches):
+* Follow the [Development Process](devs/Development-Process.md) and [GitHub contributor guidelines](https://guides.github.com/activities/contributing-to-open-source/).
+* Add the [IoT.js DCO](devs/IoT.js-Developer's-Certificate-of-Origin-1.0.md) signoff to each commit message during development.
+* Add the [License](License.md) if you introduce any new source code or script files
diff --git a/docs/Getting-Started.md b/docs/Getting-Started.md
new file mode 100644 (file)
index 0000000..47f6924
--- /dev/null
@@ -0,0 +1,24 @@
+### Supported platforms
+Current supported platforms are **Linux and NuttX**
+
+OSX 10.10 as development host
+
+* [Build for x86 / Linux](build/Build-for-x86-Linux.md): Ubuntu 14.04 is used as a base platform.
+* [Build for Stm32f4 / NuttX](build/Build-for-STM32F4-NuttX.md)
+* [Build for Raspberry Pi 2 / Linux](build/Build-for-RPi2-Linux.md)
+
+#### H/W boards
+* Current supporting
+    * STM32F4-Discovery + BB
+    * Raspberry Pi 2
+* Plan to support
+    * Samsung Artik 053
+    * Samsung Artik 10
+    * (and your contributions including above plans)
+
+We will support the correct behavior of APIs for above environments. However, since IoT.js is targeting various kind IoT devices and platforms, single implementation cannot be the best practice for every environments. Therefore embedders should be in charge of optimization for their own environments. For more details on optimization, see the [Optimization Tips](devs/Optimization-Tips.md) page.
+
+
+### Build script
+There is a script to help you build IoT.js called "[build.py](https://github.com/Samsung/iotjs/blob/master/tools/build.py)" in source repository.
+
diff --git a/docs/License.md b/docs/License.md
new file mode 100644 (file)
index 0000000..3ef9f7d
--- /dev/null
@@ -0,0 +1,14 @@
+### Introduce License Policy
+
+IoT.js is open source software under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0). Complete license and copyright information can be found within the code.
+
+> Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+
+> 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.
+
+※ [IoT.js Developer's Certificate of Origin 1.0](IoT.js-Developer's-Certificate-of-Origin-1.0) applies from _15th June in 2015_
+
+### Open Source Software
+
+The following Open Source software supports IoT.js:
+* **_[libuv](https://github.com/libuv/libuv)_** licensed under [MIT License](http://opensource.org/licenses/MIT)
diff --git a/docs/README.md b/docs/README.md
new file mode 100644 (file)
index 0000000..9e78ca9
--- /dev/null
@@ -0,0 +1,31 @@
+Welcome to the IoT.js!
+
+> IoT.js is a framework for "Internet of Things" built on
+> lightweight JavaScript interpreter ['JerryScript'](https://github.com/jerryscript-project/jerryscript)
+> and libtuv for event driven(non-blocking I/O model) similar to node.js.
+
+### IoT.js Wiki
+
+**About**
+- [License](License.md)
+- [Governance](contributing/Governance.md)
+
+**[Getting Started](Getting-Started.md)**
+- [x86 / Linux](build/Build-for-x86-Linux.md)
+- [Raspberry Pi 2 / Linux](build/Build-for-RPi2-Linux.md)
+- [Stm32f4 / NuttX](build/Build-for-STM32F4-NuttX.md)
+
+**[Developer Guide](Developer's-Guide.md)**
+- [Development Process](devs/Development-Process.md)
+- [Certificate of Origin](devs/IoT.js-Developer's-Certificate-of-Origin-1.0.md)
+- [Test Guidelines](devs/Test-Guidelines.md)
+- [Coding Style Guidelines](devs/Coding-Style-Guidelines.md)
+- [API Document Guidelines](devs/API-Document-Guidelines.md)
+- [Developer Tutorial](devs/Developer-Tutorial.md)
+- [Advanced Development](devs/Advanced-Development.md)
+- [IoT.js API Reference](api/IoT.js-API-reference.md)
+
+**Contributing**
+- [Patch Submission Process](contributing/Patch-Submission-Process.md)
+- [Community Guideline](contributing/Community-Guidelines.md)
+- [Assigned People](contributing/Assigned-People.md)
diff --git a/docs/api/IoT.js-API-ADC.md b/docs/api/IoT.js-API-ADC.md
new file mode 100644 (file)
index 0000000..7635269
--- /dev/null
@@ -0,0 +1,113 @@
+### Platform Support
+
+The following table shows ADC module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| adc.open | O | X | O |
+| adcpin.read | O | X | O |
+| adcpin.readSync | O | X | O |
+| adcpin.close | O | X | O |
+| adcpin.closeSync | O | X | O |
+
+
+## Class: ADC
+
+This class allows reading analogue data from hardware pins.
+
+The hardware pins can be read from or written to, therefore they are called bidirectional IO pins. This module provides the reading part.
+
+On NuttX, you have to know the number of pins that is defined on the target board module. For more information, please see the list below.
+  * [STM32F4-discovery](../targets/nuttx/stm32f4dis/IoT.js-API-Stm32f4dis.md#adc-pin)
+
+
+### new ADC()
+
+Returns a new ADC object which can open an ADC pin.
+
+
+### adc.open(configuration[, callback])
+* `configuration` {Object}
+  * `device` {string} Mandatory configuration on Linux.
+  * `pin` {int} Mandatory configuration on NuttX.
+* `callback` {Function}
+  * `err`: {Error|null}
+* Returns: `AdcPin` {adc.AdcPin}
+
+Opens an ADC pin with the specified configuration.
+
+**Example**
+```js
+var Adc = require('adc');
+var adc = new Adc();
+var adc0 = adc.open({
+  device: '/sys/devices/12d10000.adc/iio:device0/in_voltage0_raw'
+}, function(err) {
+  if (err) {
+    throw err;
+  }
+});
+```
+
+
+## Class: ADCPin
+
+
+### adcpin.read([callback])
+* `callback` {Function}
+  * `err`: {Error|null}
+
+Reads the analog value from the pin asynchronously.
+
+`callback` will be called having read the analog value.
+
+**Example**
+```js
+adc0.read(function(err, value) {
+  if (err) {
+    throw err;
+  }
+  console.log('value:', value);
+});
+```
+
+
+### adcpin.readSync()
+* Returns: `{int}` Analog value.
+
+Reads the analog value from the pin synchronously.
+
+**Example**
+```js
+var value = adc0.readSync();
+console.log('value:', value);
+```
+
+
+### adcpin.close([callback])
+* `callback` {Function}
+  * `err`: {Error|null}
+
+Closes ADC pin asynchronously. This function must be called after the work of ADC finished.
+
+`callback` will be called after ADC device is released.
+
+**Example**
+```js
+adc0.close(function(err) {
+  if (err) {
+    throw err;
+  }
+});
+```
+
+
+### adcpin.closeSync()
+
+Closes ADC pin synchronously. This function must be called after the work of ADC finished.
+
+**Example**
+```js
+adc0.closeSync();
+console.log('adc pin is closed');
+```
diff --git a/docs/api/IoT.js-API-Assert.md b/docs/api/IoT.js-API-Assert.md
new file mode 100644 (file)
index 0000000..1c522ce
--- /dev/null
@@ -0,0 +1,228 @@
+### Platform Support
+
+The following shows Assert module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| assert.assert | O | O | O |
+| assert.doesNotThrow | O | O | O |
+| assert.equal | O | O | O |
+| assert.fail | O | O | O |
+| assert.notEqual | O | O | O |
+| assert.notStrictEqual | O | O | O |
+| assert.strictEqual | O | O | O |
+| assert.throws | O | O | O |
+
+# Assert
+
+Assert module is designed for writing tests for applications.
+
+You can access the functions of the module by adding `require('assert')` to your file.
+
+
+## Class: AssertionError
+
+Assert module will produce `AssertionError` in case of an assertion failure. `AssertionError` inherits standard `Error` thus it has properties provided by `Error` object including additional properties.
+
+
+* `actual` {any} This property contains the actual value.
+* `expected` {any} This property contains the expected value.
+* `message` {any} The error message, default value is the error itself.
+* `name` {string} The name is `AssertionError` string.
+* `operator` {string} This property contains the operator used for comparing `actual` with `expected`.
+
+
+### assert(value[, message])
+* `value` {any} Value to test.
+* `message` {any} Message displayed in the thrown error.
+
+Checks if the `value` is truthy. If it is not, throws an AssertionError, with the given optional `message`.
+
+**Example**
+
+```js
+var assert = require('assert');
+
+assert.assert(1);
+// OK
+
+assert.assert(true);
+// OK
+
+assert.assert(false);
+// throws "AssertionError: false == true"
+
+assert.assert(0);
+// throws "AssertionError: 0 == true"
+
+assert.assert(false, "it's false");
+// throws "AssertionError: it's false"
+```
+
+
+### doesNotThrow(block[, message])
+* `block` {Function}
+* `message` {any} Message to be displayed.
+
+Tests if the given `block` does not throw any exception. Otherwise throws an
+exception with the given optional `message`.
+
+**Example**
+
+```js
+var assert = require('assert');
+
+assert.doesNotThrow(
+  function() {
+    assert.assert(1);
+  }
+);
+// OK
+
+assert.doesNotThrow(
+  function() {
+    assert.assert(0);
+  }
+)
+// throws "AssertionError: Got unwanted exception."
+```
+
+
+### equal(actual, expected[, message])
+* `actual` {any} The actual value.
+* `expected` {any} The expected value.
+* `message` {any} Message to be displayed.
+
+Tests if `actual == expected` is evaluated to `true`. Otherwise throws an
+exception with the given optional `message`.
+
+**Example**
+
+```js
+var assert = require('assert');
+
+assert.equal(1, 1);
+assert.equal(1, '1');
+```
+
+
+### fail(actual, expected, message, operator)
+* `actual` {any} The actual value.
+* `expected` {any} The expected value.
+* `message` {any} Message to be displayed.
+* `operator` {string} The operator.
+
+Throws an `AssertionError` exception with the given `message`.
+
+**Example**
+
+```js
+var assert = require('assert');
+
+assert.fail(1, 2, undefined, '>');
+// AssertionError: 1 > 2
+```
+
+
+### notEqual(actual, expected[, message])
+* `actual` {any} The actual value.
+* `expected` {any} The expected value.
+* `message` {any} Message to be displayed.
+
+Tests if `actual != expected` is evaluated to `true`. Otherwise throws an
+exception with the given optional `message`.
+
+**Example**
+
+```js
+var assert = require('assert');
+
+assert.notEqual(1, 2);
+```
+
+
+### notStrictEqual(actual, expected[, message])
+* `actual` {any} The actual value.
+* `expected` {any} The expected value.
+* `message` {any} Message to be displayed.
+
+Tests if `actual !== expected` is evaluated to `true`. Otherwise throws an exception
+with the given optional `message`.
+
+**Example**
+
+```js
+var assert = require('assert');
+
+assert.notStrictEqual(1, 2);
+// OK
+
+assert.notStrictEqual(1, 1);
+// AssertionError: 1 !== 1
+
+assert.notStrictEqual(1, '1');
+// OK
+```
+
+
+### strictEqual(actual, expected[, message])
+* `actual` {any} The actual value.
+* `expected` {any} The expected value.
+* `message` {any} Message to be displayed.
+
+Tests if `actual === expected` is evaluated to `true`. Otherwise throws an exception
+with the given optional `message`.
+
+**Example**
+
+```js
+var assert = require('assert');
+
+assert.strictEqual(1, 1);
+// OK
+
+assert.strictEqual(1, 2);
+// AssertionError: 1 === 2
+
+assert.strictEqual(1, '1');
+// AssertionError: 1 === '1'
+```
+
+
+### throws(block[, expected, message])
+* `block` {Function} The function that throws an error.
+* `expected` {Function} The expected error type.
+* `message` {any} Message to be displayed.
+
+Tests if the given `block` throws an `expected` error. Otherwise throws an exception
+with the given optional `message`.
+
+**Example**
+
+```js
+var assert = require('assert');
+
+assert.throws(
+  function() {
+    assert.equal(1, 2);
+  },
+  assert.AssertionError
+);
+// OK
+
+assert.throws(
+  function() {
+    assert.equal(1, 1);
+  },
+  assert.AssertionError
+);
+// Uncaught error: Missing exception
+
+assert.throws(
+  function() {
+    assert.equal(1, 2);
+  },
+  TypeError
+);
+// AssertionError
+```
diff --git a/docs/api/IoT.js-API-BLE.md b/docs/api/IoT.js-API-BLE.md
new file mode 100644 (file)
index 0000000..a51116d
--- /dev/null
@@ -0,0 +1,191 @@
+### Platform Support
+
+The following shows BLE module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| ble.startAdvertising | O | O | X |
+| ble.stopAdvertising | O | O | X |
+| ble.setServices | O | O | X |
+
+
+# BLE - Bluetooth Low Energy
+
+
+### Event: 'advertisingStart'
+* `callback` {Function}
+  * error {Error}
+
+Emitted when advertisement starts.
+
+**Example**
+
+```js
+var ble = require('ble');
+ble.on('advertisingStart', function(error) {
+  console.log('on -> advertisingStart: ' + (error ? 'error ' + error : 'success'));
+  if (!error) {
+    ble.setServices([
+        // service data
+    ]);
+  }
+});
+```
+
+### Event: 'stateChange'
+* `callback` {Function}
+  * `state` {String} Can be 'unknown', 'resetting', 'unsupported', 'unauthorized', 'poweredOff' or 'poweredOn'.
+
+Emitted when adapter state is changed.
+
+**Example**
+
+```js
+var ble = require('ble');
+ble.on('stateChange', function(state){
+  console.log('onStateChange: ' + state);
+
+  if (state == 'poweredOn') {
+    ble.startAdvertising('iotjs', ['data'], function(err) {
+    });
+  } else {
+    ble.stopAdvertising(function(err) {
+    });
+  }
+});
+```
+
+### ble.startAdvertising(name, serviceUuids[, callback])
+* `name` {string} Maximum 26 bytes.
+* `serviceUuids` {Array[String]}
+  * 1 128-bit service UUID
+  * 1 128-bit service UUID + 2 16-bit service UUIDs
+  * 7 16-bit service UUID
+* `callback` {Function} Error handler.
+  * `error` {Error}
+
+Starts advertising.
+
+`ble.state` must be in poweredOn state before advertising is started.
+`ble.on('stateChange', callback(state));` can be used to register for state change events.
+
+**Example**
+
+```js
+var name = 'name';
+var serviceUuids = ['fffffffffffffffffffffffffffffff0']
+
+ble.startAdvertising(name, serviceUuids[, callback(error)]);
+```
+
+
+### ble.stopAdvertising(callback)
+* `callback` {Function} Error handler.
+  * `error` {Error}
+
+Stops advertising.
+
+
+### ble.setServices(services[, callback])
+* `services` {Array[PrimaryService]}
+* `callback` {Function} Error handler.
+  * `error` {Error}
+
+Sets the primary services available on the peripheral.
+
+
+## Class: Descriptor
+
+Descriptors are defined attributes that describe a characteristic value.
+
+### new Descriptor(options)
+* `options` {Object}
+  * `uuid:` {string} A Universally Unique ID (UUID) is a 16 or 128-bit hex value used to identify the type of every attribute.
+  * `value` {string|Buffer}
+
+**Example**
+
+```js
+var descriptor = new Descriptor({
+    uuid: '2901',
+    value: 'value'
+});
+```
+
+
+## Class: Characteristic
+
+Characteristics are defined attribute types that contain a single logical value.
+
+### new Characteristic(options)
+* `options` {Object}
+  * `uuid:` {string} A Universally Unique ID (UUID) is a 16 or 128-bit hex value used to identify the type of every attribute.
+  * `properties` {Array[string]} Can be a combination of 'read', 'write', 'writeWithoutResponse', 'notify' and 'indicate'.
+  * `secure` {Array[string]} Enables security for properties, can be a combination of 'read', 'write', 'writeWithoutResponse', 'notify' and 'indicate'.
+  * `value` {Buffer}
+  * `descriptors` {Array[Descriptor]}
+  * `onReadRequest` {Function} Read request handler. (optional)
+    * `offset` {number} (0x0000 - 0xffff)
+    * `callback` {Function}
+      * `result` {Characteristic.RESULT_*}
+      * `data` {Buffer}
+  * `onWriteRequest` {Function} Write request handler. (optional)
+    * `data` {Buffer}
+    * `offset` {number} (0x0000 - 0xffff)
+    * `withoutResponse` {boolean}
+    * `callback` {Function}
+      * `result` {Characteristic.RESULT_*}
+  * `onSubscribe` {Function} Notify/indicate subscribe handler. (optional)
+    * `maxValueSize` {number} Maximum data size.
+    * `updateValueCallback` {Function}
+  * `onUnsubscribe` {Function} Notify/indicate unsubscribe handler. (optional)
+  * `onNotify` {Function} Notify sent handler. (optional)
+  * `onIndicate` {Function} Indicate confirmation received handler. (optional)
+Returns: {Characteristic}
+
+**Example**
+
+```js
+var characteristic = new Characteristic({
+  uuid: 'fffffffffffffffffffffffffffffff1', // or 'fff1' for 16-bit
+  properties: ['read', 'write'],
+  secure: [],
+  value: null,
+  descriptors: [descriptor],
+  onReadRequest: null,
+  onWriteRequest: null,
+  onSubscribe: null,
+  onUnsubscribe: null,
+  onNotify: null,
+  onIndicate: null
+});
+```
+
+### Characteristic.RESULT_SUCCESS
+
+### Characteristic.RESULT_INVALID_OFFSET
+
+### Characteristic.RESULT_INVALID_ATTRIBUTE_LENGTH
+
+### Characteristic.RESULT_UNLIKELY_ERROR
+
+
+## Class: PrimaryService
+
+PrimaryService is a collection of characteristics and relationships to other services that encapsulate the behavior of part of a device.
+
+### new PrimaryService(options)
+* `options` {Object}
+  * `uuid` {string} A Universally Unique ID (UUID) is a 16 or 128-bit hex value used to identify the type of every attribute.
+  * `characteristics` {Array[Characteristic]}
+
+**Example**
+
+```js
+var primaryService = new PrimaryService({
+  uuid: 'fffffffffffffffffffffffffffffff0', // or 'fff0' for 16-bit
+  characteristics: [
+    // see Characteristic for data type
+  ]
+});
+```
diff --git a/docs/api/IoT.js-API-Buffer.md b/docs/api/IoT.js-API-Buffer.md
new file mode 100644 (file)
index 0000000..7330af4
--- /dev/null
@@ -0,0 +1,577 @@
+### Platform Support
+
+The following shows Buffer module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| buf.compare | O | O | O |
+| buf.copy | O | O | O |
+| buf.equals | O | O | O |
+| buf.fill | O | O | O |
+| buf.slice | O | O | O |
+| buf.toString | O | O | O |
+| buf.write | O | O | O |
+| buf.writeUInt8 | O | O | O |
+| buf.writeUInt16LE | O | O | O |
+| buf.writeUInt32LE | O | O | O |
+| buf.readInt8 | O | O | O |
+| buf.readUInt8 | O | O | O |
+| buf.readUInt16LE | O | O | O |
+
+
+# Buffer
+
+Buffer class is a global type with various constructors and accessors.
+
+IoT.js provides Buffer to manipulate binary data. Currently buffer has
+a pure ES5 compatible implementation, but this might be reworked to use
+UInt8Array in the future.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+// Creates a zero-filled Buffer of length 10.
+var buf1 = new Buffer(10);
+
+// Creates a Buffer containing [0x1, 0x2, 0x3].
+var buf2 = new Buffer([1, 2, 3]);
+
+// Creates a Buffer containing UTF-8 bytes [0x74, 0xc3, 0xa9, 0x73, 0x74].
+var buf3 = new Buffer('tést');
+```
+
+## Class: Buffer
+
+### new Buffer(size)
+* `size` {integer} Size of the new buffer.
+
+Creates a new buffer of `size` bytes and initialize its data to zero.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer(5);
+```
+
+### new Buffer(buffer)
+* `buffer` {Buffer} Source buffer.
+
+Creates a copy of an existing buffer. The buffer data is not shared
+between the two buffers.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer1 = new Buffer(5);
+var buffer2 = new Buffer(buffer1);
+```
+
+
+### new Buffer(str[, encoding])
+* `str` {string} Source string.
+* `encoding` {string} Encoding format.
+
+Creates a new buffer which contains the CESU-8 representation of
+the `str` string argument. If `encoding` optional argument is
+present its value must be `hex`. When this encoding is specified
+the `str` argument must be a sequence of hexadecimal digit pairs,
+and these pairs are converted to bytes.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer(String.fromCharCode(65));
+
+// prints: 1
+console.log(buffer);
+
+var buffer = new Buffer(String.fromCharCode(128));
+
+// prints: 2
+console.log(buffer);
+
+var buffer = new Buffer(String.fromCharCode(2048));
+
+// prints: 3
+console.log(buffer);
+
+var buffer = new Buffer('4142', 'hex');
+
+// prints: AB
+console.log(buffer);
+```
+
+
+### new Buffer(array)
+* `array` {Array} Array of numbers.
+
+Creates a new Buffer from an array of numbers. The
+numbers are converted to integers first and their modulo
+256 remainder is used for constructing the buffer.
+
+**Example**
+
+```js
+var buffer = new Buffer([65, 256 + 65, 65 - 256, 65.1]);
+
+// prints: AAAA
+console.log(buffer);
+```
+
+
+### Buffer.byteLength(str, encoding)
+
+* `str` {string} Source string.
+* `encoding` {string} String encoding.
+* Returns: {integer} Byte length of source string.
+
+Returns the byte length of a buffer representing the value
+of the string argument encoded with encoding. The effect is
+the same as:
+
+```js
+return new Buffer(str, encoding).length;
+```
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+// prints: 1
+console.log(Buffer.byteLength(String.fromCharCode(65)));
+
+// prints: 2
+console.log(Buffer.byteLength(String.fromCharCode(128)));
+
+// prints: 3
+console.log(Buffer.byteLength(String.fromCharCode(2048)));
+
+// prints: 2
+console.log(Buffer.byteLength('4142', 'hex'));
+```
+
+
+### Buffer.concat(list)
+* `list` {Array} An array of `Buffer` objects.
+* Returns: {Buffer} Concatenated buffer.
+
+Returns the concatenation of the `Buffer` objects
+provided in the `list` array.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = Buffer.concat([ new Buffer('He'),
+                             new Buffer('llo'),
+                             new Buffer(' wo'),
+                             new Buffer('rld') ])
+
+// prints: Hello world
+console.log(buffer);
+```
+
+
+### Buffer.isBuffer(obj)
+* `obj` {Object}
+* Returns: {boolean}
+
+Returns `true` if `obj` is an instance of `Buffer`. Returns
+`false` otherwise.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+// prints: true
+console.log(Buffer.isBuffer(new Buffer(1)));
+
+// prints: false
+console.log(Buffer.isBuffer('str'));
+```
+
+
+### buf.length
+* {integer}
+
+Returns the capacity of the buffer in bytes. Note: when
+the buffer is converted to another type (e.g. String) the
+length of the converted value might be different from
+this value.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer([0xc8, 0x80]);
+
+// prints: 2
+console.log(buffer.length);
+
+var str = buffer.toString();
+
+// prints: 1
+console.log(str.length);
+```
+
+
+### buf.compare(otherBuffer)
+* `otherBuffer` {Buffer} The right-hand side of the comparison.
+* Returns: {integer}
+
+This function performs a lexicographic comparison between
+two buffers.
+
+It returns with `0` if the two buffers are the same. Otherwise
+it returns with `-1` if the first different byte is lower for
+`buf`, and `1` if the byte is higher. If the length of the two
+buffers are different, the comparison is performed until the
+lower length is reached. If all bytes are the same the function
+returns with `-1` if `buf.length` is less than `otherBuffer.length`
+and `1` otherwise.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer1 = new Buffer('AB');
+var buffer2 = new Buffer('A');
+var buffer3 = new Buffer('B');
+
+// prints: 0
+console.log(buffer1.compare(buffer1));
+
+// prints: 1
+console.log(buffer1.compare(buffer2));
+
+// prints: -1
+console.log(buffer1.compare(buffer3));
+```
+
+
+### buf.copy(targetBuffer[, targetStart[, sourceStart[, sourceEnd]]])
+* `targetBuffer` {Buffer} The buffer to be modified.
+* `targetStart` {Integer} **Default:** `0`
+* `sourceStart` {integer} **Default:** `0`
+* `sourceEnd` {integer} **Default:** `buf.length`
+* Returns: {integer} The number of bytes copied.
+
+Copy a sequence of bytes from `buf` buffer to `targetBuffer` buffer.
+The source byte range is specified by `sourceStart` and `sourceEnd`
+and the destination byte offset is specified by `targetStart`. Only
+the `targetBuffer` is modified.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer1 = new Buffer('Hello XY world!');
+var buffer2 = new Buffer('<JS>');
+
+buffer2.copy(buffer1, 6, 1, 3);
+
+// prints: Hello JS world!
+console.log(buffer1);
+```
+
+
+### buf.equals(otherBuffer)
+* `otherBuffer` {Buffer} The right-hand side of the comparison.
+* Returns: {boolean}
+
+Returns `true` if `this` and `otherBuffer` have exactly the
+same bytes. Returns `false` otherwise. The effect is the same as:
+
+```js
+return buf.compare(otherBuffer) == 0;
+```
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer1 = new Buffer('AB');
+var buffer2 = new Buffer('4142', 'hex');
+var buffer3 = new Buffer('A');
+
+// prints: true
+console.log(buffer1.equals(buffer2));
+
+// prints: false
+console.log(buffer1.equals(buffer3));
+```
+
+
+### buf.fill(value)
+* `value` {integer} All bytes are set to this value.
+* Returns: {Buffer} The original buffer.
+
+Set all bytes of the buffer to value. The value is converted to
+integer first and its modulo 256 remainder is used for updating
+the buffer. Returns with `buf`.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer('Hello');
+
+buffer.fill(65);
+
+// prints: AAAAA
+console.log(buffer);
+
+buffer.fill(66 - 256);
+
+// prints: BBBBB
+console.log(buffer);
+```
+
+
+### buf.slice([start[, end]])
+* `start` {integer} **Default:** `0`
+* `end` {integer} **Default:** `buf.length`
+* Returns: {Buffer} A newly created buffer.
+
+This function returns with a newly created buffer which
+contains the bytes of the `buf` buffer between `start`
+and `end`.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer('This is JavaScript!!!');
+
+// prints: JavaScript
+console.log(buffer.slice(8, 18));
+```
+
+
+### buf.toString([start[, end]])
+* `start` {integer} **Default:** `0`
+* `end` {integer} **Default:** `buffer.length`
+* Returns: {string}
+
+Returns a string created from the bytes stored in the buffer.
+By passing `start` and `end` the conversion can be limited
+to a subset of the `buf` buffer. If a single `hex` string is
+passed to the function, the whole buffer is converted to
+hexadecimal data.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer('DEFG');
+
+// prints: EF
+console.log(buffer.toString(1, 3));
+
+// prints: 44454647
+console.log(buffer.toString('hex'));
+```
+
+
+### buf.write(string[, offset[, length]])
+* `string` {string} Data to be written into buffer.
+* `offset` {integer} Start position of writing. **Default:** `0`
+* `length` {integer} How many bytes to write. **Default:** `buffer.length - offset`.
+* Returns: {integer} Total number of bytes written.
+
+Writes `string` into the `buf` buffer. The start position of the
+writing can be specified by `offset` and the maximum number of
+updated bytes can be limited by `length`. Returns total number
+of bytes written to the buffer.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer('......');
+buffer.write('AB');
+buffer.write('XY', 3);
+
+// prints: AB.XY.
+console.log(buffer);
+
+var buffer = new Buffer('......');
+buffer.write('ABCDEF', 1, 3);
+
+// prints: .ABC..
+console.log(buffer);
+```
+
+
+### buf.writeUInt8(value, offset[, noAssert])
+* `value` {integer} Number to be written into the buffer.
+* `offset` {integer} Start position of the writing.
+* `noAssert` {boolean} Skip argument validation. **Default:** `false`
+* Returns: {number} Offset plus the number of bytes written.
+
+Writes `value` into the buffer starting from `offset` position.
+The `value` must be a valid 8-bit unsigned integer.
+
+If `noAssert` is set and the value is outside of the expected range
+or the offset is higher than the size of the buffer the operation
+is undefined.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer('....');
+
+// prints: 3
+console.log(buffer.writeUInt8(65, 2));
+
+// prints: ..A.
+console.log(buffer);
+```
+
+
+### buf.writeUInt16LE(value, offset[, noAssert])
+* `value` {integer} Number to be written into the buffer.
+* `offset` {integer} Start position of the writing.
+* `noAssert` {boolean} Skip argument validation. **Default:** `false`
+* Returns: {integer} Offset plus the number of bytes written.
+
+Writes `value` into the buffer starting from `offset` position
+with little endian format. The `value` must be a valid 16-bit
+unsigned integer.
+
+If `noAssert` is set and the value is outside of the expected range
+or the offset is higher than the size of the buffer the operation
+is undefined.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer('......');
+
+// prints: 3
+console.log(buffer.writeUInt16LE(0x4142, 1));
+
+// prints .BA...
+console.log(buffer);
+```
+
+
+### buf.writeUInt32LE(value, offset[, noAssert])
+* `value` {integer} Number to be written into the buffer.
+* `offset` {integer} Start position of the writing.
+* `noAssert` {boolean} Skip argument validation. **Default:** `false`
+* Returns: {integer} Offset plus the number of bytes written.
+
+Writes `value` into the buffer starting from `offset` position
+with little endian format. The `value` must be a valid 32-bit
+unsigned integer.
+
+If `noAssert` is set and the value is outside of the expected range
+or the offset is higher than the size of the buffer the operation
+is undefined.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer('......');
+
+// prints: 5
+console.log(buffer.writeUInt32LE(0x41424344, 1));
+
+// prints: .DCBA.
+console.log(buffer);
+```
+
+
+### buf.readInt8(offset[, noAssert])
+* `offset` {number} Start position of buffer for reading.
+* `noAssert` {boolean} Skip offset validation. **Default:** `false`
+* Returns: {number}
+
+Reads a signed 8-bit integer from `buf` buffer starting from
+`offset` position.
+
+If `noAssert` is set and the offset is higher than the size of
+the buffer the result is undefined.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer('ABCDEF');
+
+// prints: 42
+console.log(buffer.readUInt8(1).toString(16));
+```
+
+
+### buf.readUInt8(offset[, noAssert])
+* `offset` {integer} Start position of the reading.
+* `noAssert` {boolean} Skip argument validation. **Default:** `false`
+* Returns: {number}
+
+Reads an unsigned 8-bit integer from `buf` buffer starting from
+`offset` position.
+
+If `noAssert` is set and the offset is higher than the size of
+the buffer the result is undefined.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer('ABCDEF');
+
+// prints: 42
+console.log(buffer.readUInt8(1).toString(16));
+```
+
+
+### buf.readUInt16LE(offset[, noAssert])
+* `offset` {number} Start position of buffer for reading.
+* `noAssert` {boolean} Skip offset validation. **Default:** `false`
+* Returns: {number}
+
+Reads an unsigned 16-bit integer from `buf` buffer starting from
+`offset` position with little endian format.
+
+If `noAssert` is set and the offset is higher than the size of
+the buffer the result is undefined.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer('ABCDEF');
+
+// prints: 4342
+console.log(buffer.readUInt16LE(1).toString(16));
+```
diff --git a/docs/api/IoT.js-API-DGRAM.md b/docs/api/IoT.js-API-DGRAM.md
new file mode 100644 (file)
index 0000000..26d9799
--- /dev/null
@@ -0,0 +1,412 @@
+### Platform Support
+
+The following shows dgram module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| dgram.createSocket | O | O | △ ¹ |
+| dgram.Socket.addMembership | O | O | X |
+| dgram.Socket.address | O | O | X |
+| dgram.Socket.bind | O | O | △ ¹ |
+| dgram.Socket.close | O | O | △ ² |
+| dgram.Socket.dropMembership | O | O | X |
+| dgram.Socket.send | O | O | △ ¹ |
+| dgram.Socket.setBroadcast | O | O | X |
+| dgram.Socket.setMulticastLoopback | O | O | X |
+| dgram.Socket.setMulticastTTL | X | X | X |
+| dgram.Socket.setTTL | O | O | X |
+
+1. On NuttX/STM32F4-Discovery, even a couple of sockets/server/requests might not work properly.
+
+2. On NuttX/STM32F4-Discovery, close() may block due to a bug in poll().
+
+# Dgram
+
+The dgram module provides an implementation of UDP Datagram sockets.
+
+The following example creates a UDP Datagram server.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var server = dgram.createSocket('udp4');
+
+server.on('error', function (err) {
+  console.log('Error: ' + err);
+  server.close();
+});
+
+server.on('message', function(msg, rinfo) {
+  // prints: message received
+  console.log('server got: ' + msg);
+});
+
+server.on('listening', function() {
+  console.log('server listening at ' + server.address().port);
+});
+
+server.bind(41234);
+```
+
+### dgram.createSocket(options[, callback])
+* `options` {Object}
+  * `type` {string}
+  * `reuseAddr` {boolean}
+* `callback` {Function} (optional)
+
+Creates a new `dgram.Socket` object. The type of the connection
+is specified by `options.type`. Currently only `udp4` is supported.
+
+If `reuseAddr` is true the `socket.bind()` call reuses the address
+even if this address has been bound by another process.
+
+The optional 'callback' function is attached to the
+[`'message'`](#event-message) event.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var server = dgram.createSocket({ type: 'udp4', reuseAddr: true});
+```
+
+### dgram.createSocket(type[, callback])
+* `type` {string}
+* `callback` {Function} (optional)
+
+Creates a new `dgram.Socket` object. The type of the connection
+is specified by the `type` argument. Currently only `udp4` is
+supported.
+
+The optional 'callback' function is attached to the
+[`'message'`](#event-message) event.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var server = dgram.createSocket('udp4');
+```
+
+## Class: dgram.Socket
+
+The `dgram.Socket` object is an `EventEmitter` that encapsulates the
+datagram functionality.
+
+New instances of `dgram.Socket` are created using `dgram.createSocket()`.
+The new keyword must not be used to create dgram.Socket instances.
+
+Supported events:
+
+### Event: 'close'
+
+The `'close'` event is emitted after a socket is closed with `close()`.
+Once triggered, no new `'message'` events will be emitted on this socket.
+
+### Event: 'error'
+
+* `exception` {Error}
+
+The `'error'` event is emitted whenever any error occurs. A single Error
+object is passed to the event handler.
+
+### Event: 'listening'
+
+The `'listening'` event is emitted whenever a socket begins listening
+for datagram messages. This occurs as soon as UDP sockets are created.
+
+### Event: 'message'
+
+* `msg` {Buffer} The message.
+* `rinfo` {Object} Remote address information.
+  * `address` {string} The sender address.
+  * `family` {string} The address family ('IPv4').
+  * `port` {number} The sender port.
+  * `size` {number} The message size.
+
+The `'message'` event is emitted when a new datagram is received by
+the socket. The `msg` argument contains the message data and the `rinfo`
+argument contains the message properties.
+
+
+### socket.addMembership(multicastAddress[, multicastInterface])
+* `multicastAddress` {string}
+* `multicastInterface` {string}
+
+Joins the multicast group specified by `multicastAddress` and
+`multicastInterface`. If `multicastInterface` is undefined the
+operating system will choose one add interface and will add
+membership to it. To add membership to every available interface,
+call addMembership multiple times, once per interface.
+
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var multicast_address = '230.255.255.250';
+var server = dgram.createSocket('udp4');
+
+server.bind(12345 /* port */, function() {
+  server.addMembership(multicast_address);
+});
+```
+
+
+### socket.address()
+* Returns: {Object}
+
+Returns an object with the properties `address`, `port` and `family`.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var server = dgram.createSocket('udp4');
+
+server.on('listening', function () {
+  var address = server.address();
+  // prints: address and port of the server address
+  console.log('Addr: ' + address.address + ' port: ' + address.port);
+});
+
+server.bind(12345 /* port */);
+```
+
+### socket.bind([port][, address][, bindListener])
+* `port` {number}
+* `address` {string} **Default:** `0.0.0.0`
+* `bindListener` {Function}
+
+Assign the `port` and `address` to an UDP socket. If `port` is
+not specified the operating system selects a random unused
+port.
+
+The optional 'bindListener' function is attached to the
+[`'listening'`](#event-listening) event.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
+
+var port = 12345;
+
+socket.bind(port, function () {
+  // prints: Listening for packets
+  console.log('Listening for packets');
+});
+```
+
+
+### socket.bind(options[, bindListener])
+* `options` {Object}
+  * `port` {number}
+  * `address` {string} **Default:** `0.0.0.0`
+* `bindListener` {Function}
+
+Assign `options.port` and `options.address` to an UDP socket.
+If `options.port` is not specified the operating system selects
+a random unused port.
+
+The optional 'bindListener' function is attached to the
+[`'listening'`](#event-listening) event.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
+
+socket.bind({ port:12345 }, function () {
+  // prints: Listening for packets
+  console.log('Listening for packets');
+});
+```
+
+
+### socket.close([closeListener])
+* `closeListener` {Function}
+
+Close the underlying socket and stop listening for data on it.
+
+The optional 'closeListener' function is attached to the
+[`'close'`](#event-close) event.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
+
+// prints: Close!
+socket.close(function () {
+  // prints: Socket is closed
+  console.log('Socket is closed');
+});
+```
+
+
+### socket.dropMembership(multicastAddress[, multicastInterface])
+* `multicastAddress` {string}
+* `multicastInterface` {string}
+
+Leaves for socket the given multicast group with given `multicastAddress` and `multicastInterface`.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var server = dgram.createSocket('udp4');
+var multicast_address = '230.255.255.250';
+
+server.bind(12345 /* port */, function() {
+  server.addMembership(multicast_address);
+});
+
+server.on('message', function(data, rinfo) {
+  // Drop membership when a message arrived.
+  server.dropMembership(multicast_address);
+});
+```
+
+
+### socket.setBroadcast(flag)
+* `flag` {boolean}
+
+Sets or clears the `SO_BROADCAST` socket option. When `flag` is
+true UDP packets may be sent to a local interface's broadcast
+address.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
+var port = 41237;
+
+socket.bind(port, function() {
+  socket.setBroadcast(true);
+});
+```
+
+
+### socket.send(msg, [offset, length,] port [, address] [, sendListener])
+* `msg` {Buffer|string|array}
+* `offset` {integer} Only valid if `msg` is Buffer.
+* `length` {integer} Only valid if `msg` is Buffer.
+* `port` {integer}
+* `address` {string} **Default:** `127.0.0.1` or `::1`
+* `sendListener` {Function}
+  * `Error` {Object|null}
+    * `code` {string} Currently it is always `"error"`.
+    * `errno` {string} Same as `code`.
+    * `syscall` {integer}
+    * `address` {string}
+    * `port` {integer}
+  * `length` {integer} Length of data.
+
+Transmits a message to the destination socket specified by
+`address` and `port` arguments. The `msg` argument contains
+the data to be sent. It can be a {Buffer}, a {string} converted
+to UTF-8 bytes, or an array of {Buffer} and {string} values.
+In the latter case the items of the array are concatenated
+into a single {Buffer} before sending.
+
+If send operation is successfully completed, `sendListener` will
+be called with `null` and the length of data. Otherwise an
+Error {Object} is passed along with the length of data.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
+var broadcast_address = '255.255.255.255';
+var port = 41237;
+
+socket.bind(port, function() {
+  socket.setBroadcast(true);
+  socket.send('Hello IoT.js', port, broadcast_address);
+});
+```
+
+### socket.sendto(msg, offset, length, port [, address] [, sendListener])
+* `msg` {Buffer|string|array}
+* `offset` {integer}
+* `length` {integer}
+* `port` {integer}
+* `address` {string} **Default:** `127.0.0.1` or `::1`
+* `sendListener` {Function}
+
+Legacy function. It is the same as
+[`socket.send`](#socket-send-msg-offset-length-port-address-sendListener)
+except `offset` and `length` arguments are mandatory.
+
+### socket.setMulticastLoopback(flag)
+* `flag` {boolean}
+
+Sets or clears the `IP_MULTICAST_LOOP` socket option. When `flag` is
+`true` multicast packets will also be received on the local interface.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
+var port = 41237;
+
+socket.bind(port, function() {
+  socket.setMulticastLoopback(true);
+});
+```
+
+
+### socket.setMulticastTTL(ttl)
+* `ttl` {integer} This value must be between 0 and 255.
+
+Sets the `IP_MULTICAST_TTL` socket option which pecifies the
+number of IP hops that a packet is allowed to travel through,
+specifically for multicast traffic. Each router or gateway
+that forwards a packet decrements its TTL. When TTL reaches
+zero the packet is not forwarded anymore.
+
+The default on most systems is 1 but can vary.
+
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
+var port = 41237;
+
+socket.bind(port, function() {
+  socket.setMulticastTTL(1);
+});
+```
+
+
+### socket.setTTL(ttl)
+* `ttl` {integer} This value must be between 1 and 255.
+
+Sets the `IP_TTL` socket option which specifies the number of IP
+hops that a packet is allowed to travel through. Each router or
+gateway that forwards a packet decrements its TTL. When TTL reaches
+zero the packet is not forwarded anymore.
+
+The default on most systems is 64 but can vary.
+
+**Example**
+
+```js
+var dgram = require('dgram');
+var socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
+var port = 41237;
+
+socket.bind(port, function() {
+  socket.setTTL(64);
+});
+```
diff --git a/docs/api/IoT.js-API-DNS.md b/docs/api/IoT.js-API-DNS.md
new file mode 100644 (file)
index 0000000..fb1a70c
--- /dev/null
@@ -0,0 +1,79 @@
+### Platform Support
+
+The following shows dns module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| dns.lookup | O | O | X |
+
+※ dns.lookup currently only returns IPv4 addresses. Support for IPv6 addresses are on the roadmap.
+
+
+# DNS
+
+The `dns` module provides a method to perform host name resolution. The functionality is
+implemented on top of the underlying operation system facilities. Please see
+[Implementation considerations section](#implementation-considerations).
+
+The following properties are flags which can be passed as hints for the
+[`dns.lookup()`](#dnslookuphostname-options-callback) method.
+
+### dns.ADDRCONFIG
+* `{number}`
+
+Returned address types are determined by the types of addresses supported by the current system.
+
+
+### dns.V4MAPPED
+* `{number}`
+
+If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. 
+
+
+
+### dns.lookup(hostname[, options], callback)
+* `hostname` {string} Hostname to be resolved.
+* `options` {Object|number}
+  * `family` {number} The record family. If specified must be 4. Specifies that IPv4 addresses should be returned.
+  * `hints` {number} One or more supported getaddrinfo flags. Multiple flags may be passed by bitwise `OR`ing their values.
+* `callback` {Function}
+  * `err` {Error|null} If there is no error the value is `null`.
+  * `address` {string} A string representation of an IPv4 address.
+  * `family` {number} 4, denoting the family of `address`.
+
+Resolves a hostname (e.g. `iotjs.net`) into the first found A (IPv4) or AAAA (IPv6) record. All `option` properties
+are option. If `option` is a number, then it must be `4`. If `options` is not provided, then IPv4 addresses are
+returned if found.
+
+On error, `err` is an `Error` object where `err.code` is the error code returned by the underlying system call.
+
+The `dns.lookup()` does not necessarily do DNS requests to resolve a hostname. The implementation uses an
+operating system facility to associate names with addresses. Please read the
+[Implementation considerations section](#implementation-considerations) for more system dependent information.
+
+**Example**
+
+```js
+var dns = require('dns');
+dns.lookup ('localhost', 4, function(err, ip, family) {
+  console.log('ip: ' + ip + ' family: ' + family);
+});
+// ip: 127.0.0.1 family: 4
+
+var options = {
+  family: 4,
+  hints: dns.ADDRCONFIG,
+};
+
+dns.lookup ('iotjs.net', options, function(err, ip, family) {
+  console.log('ip: ' + ip + ' family: ' + family);
+});
+// ip: 192.30.252.154 family: 4
+```
+
+# Implementation considerations
+
+The current implementation only supports host name resolution to IPv4 addresses.
+
+On NuttX currently only valid IPv4 addresses are allowed for the
+[`dns.lookup()`](#dnslookuphostname-options-callback) method.
diff --git a/docs/api/IoT.js-API-Events.md b/docs/api/IoT.js-API-Events.md
new file mode 100644 (file)
index 0000000..2bbf198
--- /dev/null
@@ -0,0 +1,223 @@
+### Platform Support
+
+The following shows Event module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| emitter.addListener | O | O | O |
+| emitter.on | O | O | O |
+| emitter.emit | O | O | O |
+| emitter.once | O | O | O |
+| emitter.removeListener | O | O | O |
+| emitter.removeAllListeners | O | O | O |
+
+
+# Events
+
+IoT.js is based on event-driven programming where objects (called "emitters") periodically emit named events.
+
+# Class: EventEmitter
+
+The `events.EventEmitter` plays a role as base class for "emitters".
+User application would not directly creates an instance of `EventEmitter` since `EventEmitter` is an abstract trait which defines its behavior and grants to sub-classes.
+
+### new EventEmitter()
+* Returns {events.EventEmitter}.
+
+Returns with a new EventEmitter object.
+
+
+**Example**
+
+```js
+
+var EventEmitter = require('events').EventEmitter;
+
+var emitter = new EventEmitter();
+
+```
+
+
+### emitter.addListener(event, listener)
+* `event` {string} The name of the event.
+* `listener` {Function} The callback function.
+  * `args` {any}.
+* Returns `emitter` {events.EventEmitter}.
+
+It is an alias for `emitter.on(eventName, listener)`.
+
+Adds the `listener` callback function to the end of the listener's list for the given `event`. No checks are made to see if the `listener` has already been added.
+In case of multiple calls the `listener` will be added and called multiple times.
+
+**Example**
+
+```js
+
+var EventEmitter = require('events').EventEmitter;
+
+var emitter = new EventEmitter();
+
+var eventSequence = '';
+
+var listener1 = function() {
+  eventSequence += '2';
+};
+
+emitter.addListener('test', listener1);
+emitter.addListener('test', listener1);
+emitter.emit('test');
+
+console.log(eventSequence); // prints '22'
+
+```
+
+### emitter.on(event, listener)
+* `event` {string} The name of the event.
+* `listener` {Function} The callback function.
+  * `args` {any}.
+* Returns `emitter` {events.EventEmitter}.
+
+Adds the `listener` callback function to the end of the listener's list for the given `event`. No checks are made to see if the `listener` has already been added.
+In case of multiple calls the `listener` will be added and called multiple times.
+
+**Example**
+
+```js
+
+var EventEmitter = require('events').EventEmitter;
+var emitter = new EventEmitter();
+
+emitter.on('event', function() {
+  console.log('emit event');
+});
+
+emitter.emit('event');
+
+```
+
+### emitter.emit(event[, args..])
+* `event` {string} The name of the event.
+  * `args` {any}.
+* Returns {boolean}.
+
+Synchronously calls each of the listeners registered for the `event`, in the order they were registered, passing the supplied arguments to each.
+
+Returns true if the event had listeners, false otherwise.
+
+**Example**
+
+```js
+
+var EventEmitter = require('events').EventEmitter;
+var emitter = new EventEmitter();
+
+emitter.addListener('event', function() {
+  console.log('emit event');
+});
+
+emitter.emit('event'); // true
+
+emitter.emit('not_an_event'); // false
+
+```
+
+### emitter.once(event, listener)
+* `event` {string} The name of the event.
+* `listener` {Function} The callback function.
+  * `args` {any}.
+* Returns `emitter` {events.EventEmitter}.
+
+Adds the `listener` as a one time listener for the `event`.
+
+Using this method, it is possible to register a listener that is called at most once for a particular `event`.
+The listener will be invoked only once, when the first `event` is emitted.
+
+**Example**
+
+``` js
+
+var EventEmitter = require('events').EventEmitter;
+var assert = require('assert');
+
+var emitter = new EventEmitter();
+
+var onceCnt = 0;
+
+emitter.once('once', function() {
+  onceCnt += 1;
+});
+
+assert.equal(onceCnt, 0);
+emitter.emit('once');
+assert.equal(onceCnt, 1);
+emitter.emit('once');
+assert.equal(onceCnt, 1);
+
+```
+
+### emitter.removeListener(event, listener)
+* `event` {string} The name of the event.
+* `listener` {Function} The callback function.
+  * `args` {any}.
+* Returns `emitter` {events.EventEmitter}.
+
+Removes `listener` from the list of event listeners.
+
+If you add the same `listener` multiple times, this removes only one instance of them.
+
+**Example**
+
+```js
+
+var EventEmitter = require('events').EventEmitter;
+var emitter = new EventEmitter();
+
+var listener = function() {
+    console.log('listener');
+};
+
+emitter.addListener('event', listener);
+emitter.removeListener('event', listener);
+
+```
+
+### emitter.removeAllListeners([event])
+* `event` {string} The name of the event.
+* Returns `emitter` {events.EventEmitter}.
+
+Removes all listeners.
+
+If `event` was specified, it only removes the listeners for that event.
+
+**Example**
+
+``` js
+
+var EventEmitter = require('events').EventEmitter;
+
+var emitter = new EventEmitter();
+
+function removableListener() {
+  console.log("listener called");
+}
+
+emitter.addListener('event1', removableListener);
+
+emitter.addListener('event2', removableListener);
+emitter.addListener('event2', removableListener);
+
+emitter.addListener('event3', removableListener);
+
+
+emitter.removeAllListeners('event2');
+
+var res = emitter.emit('event2'); // res == false
+
+res = emitter.emit('event1'); // res == true, prints "listener called"
+
+emitter.removeAllListeners();
+
+res = emitter.emit('event1'); // res == false
+res = emitter.emit('event3'); // res == false
+
+```
diff --git a/docs/api/IoT.js-API-File-System.md b/docs/api/IoT.js-API-File-System.md
new file mode 100644 (file)
index 0000000..2e58633
--- /dev/null
@@ -0,0 +1,666 @@
+### Platform Support
+
+The following shows fs module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| fs.close | O | O | O |
+| fs.closeSync | O | O | O |
+| fs.exists | O | O | O |
+| fs.existsSync | O | O | O |
+| fs.fstat | O | O | X |
+| fs.fstatSync | O | O | X |
+| fs.mkdir | O | O | O |
+| fs.mkdirSync | O | O | O |
+| fs.open | O | O | O |
+| fs.openSync | O | O | O |
+| fs.read | O | O | O |
+| fs.readSync | O | O | O |
+| fs.readdir | O | O | X |
+| fs.readdirSync | O | O | X |
+| fs.readFile | O | O | O |
+| fs.readFileSync | O | O | O |
+| fs.rename | O | O | O |
+| fs.renameSync | O | O | O |
+| fs.rmdir | O | O | O |
+| fs.rmdirSync | O | O | O |
+| fs.stat | O | O | O |
+| fs.statSync | O | O | O |
+| fs.unlink | O | O | O |
+| fs.unlinkSync | O | O | O |
+| fs.write | O | O | O |
+| fs.writeSync | O | O | O |
+| fs.writeFile | O | O | O |
+| fs.writeFileSync | O | O | O |
+
+※ On NuttX path should be passed with a form of **absolute path**.
+
+
+# File System
+
+## Class: fs.Stats
+
+fs.Stats class is an object returned from `fs.stat()`,`fs.fstat()` and their synchronous counterparts.
+
+
+### stats.isDirectory()
+* Returns: {boolean}
+
+Returns true if stated file is a directory.
+
+
+### stats.isFile()
+* Returns: {boolean}
+
+Returns true if stated file is a file.
+
+**Example**
+
+```js
+var assert = require('assert');
+var fs = require('fs');
+
+fs.stat('test.txt', function(err, stat) {
+  if (err) {
+    throw err;
+  }
+  assert.equal(stat.isFile(), true);
+  assert.equal(stat.isDirectory(), false);
+});
+```
+
+
+### fs.close(fd, callback)
+* `fd` {integer} File descriptor.
+* `callback` {Function}
+  * `err` {Error|null}
+
+Closes the file of `fd` asynchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.open('test.txt', 'r', function(err, fd) {
+  if (err) {
+    throw err;
+  }
+  // do something
+  fs.close(fd, function(err) {
+    if (err) {
+      throw err;
+    }
+  });
+});
+```
+
+
+### fs.closeSync(fd)
+* `fd` {integer} File descriptor.
+
+Closes the file of `fd` synchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+var fd = fs.openSync('test.txt', 'r');
+// do something
+fs.closeSync(fd);
+```
+
+
+### fs.exists(path, callback)
+* `path` {string} File path to be checked.
+* `callback` {Function}
+  * `exists` {boolean}
+
+Checks the file specified by `path` exists asynchronously.
+
+**Example**
+
+```js
+var assert = require('assert');
+var fs = require('fs');
+
+fs.exists('test.txt', function(exists) {
+  assert.equal(exists, true);
+});
+```
+
+
+### fs.existsSync(path)
+* `path` {string} File path to be checked.
+* Returns: {boolean} True if the file exists, otherwise false.
+
+Checks the file specified by `path` exists synchronously.
+
+```js
+var assert = require('assert');
+var fs = require('fs');
+
+var result = fs.existsSync('test.txt');
+assert.equal(result, true);
+```
+
+### fs.fstat(fd, callback)
+* `fd` {integer} File descriptor to be stated.
+* `callback` {Function}
+  * `err` {Error|null}
+  * `stat` {Object} An instance of `fs.Stats`.
+
+Get information about a file what specified by `fd` into `stat` asynchronously.
+
+**Example**
+
+```js
+var assert = require('assert');
+var fs = require('fs');
+
+fs.open('test.txt', 'r', function(err, fd) {
+  if (err) {
+    throw err;
+  }
+  fs.fstat(fd, function(err, stat) {
+    if (err) {
+      throw err;
+    }
+    assert.equal(stat.isFile(), true);
+    assert.equal(stat.isDirectory(), false);
+  });
+});
+```
+
+### fs.fstatSync(fd)
+* `fd` {integer} - File descriptor to be stated.
+* Returns: {Object} An instance of `fs.Stats`.
+
+Get information about a file what specified by `fd` synchronously.
+
+**Example**
+
+```js
+var assert = require('assert');
+var fs = require('fs');
+
+fs.open('test.txt', 'r', function(err, fd) {
+  if (err) {
+    throw err;
+  }
+  var stat = fs.fstatSync(fd);
+  assert.equal(stat.isFile(), true);
+  assert.equal(stat.isDirectory(), false);
+});
+```
+
+
+### fs.mkdir(path[, mode], callback)
+* `path` {string} Path of the directory to be created.
+* `mode` {string|number} Permission mode. **Default:** `0777`
+* `callback` {Function}
+  * `err` {Error|null}
+
+Creates the directory specified by `path` asynchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.mkdir('testdir', function(err) {
+  if (err) {
+    throw err;
+  }
+});
+```
+
+
+### fs.mkdirSync(path[, mode])
+* `path` {string} Path of the directory to be created.
+* `mode` {string|number} Permission mode. **Default:** `0777`
+
+Creates the directory specified by `path` synchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.mkdirSync('testdir');
+```
+
+
+### fs.open(path, flags[, mode], callback)
+* `path` {string} File path to be opened.
+* `flags` {string} Open flags.
+* `mode` {string|number} Permission mode. **Default:** `0666`
+* `callback` {Function}
+  * `err` {Error|null}
+  * `fd` {number}
+
+Opens file asynchronously.
+
+`flags` can be:
+  * `r` Opens file for reading. Throws an exception if the file does not exist.
+  * `rs` or `sr` Opens file for reading in synchronous mode. Throws an exception if the file does not exist.
+  * `r+` Opens file for reading and writing. Throws an exception if the file does not exist.
+  * `rs+` or `sr+` Opens file for reading and writing in synchronous mode. Throws an exception if the file does not exist.
+  * `w` Opens file for writing. The file is overwritten if it exists.
+  * `wx` or `xw` Opens file for writing. Throws an exception if it exists.
+  * `w+` Opens file for reading and writing. The file is overwritten if it exists.
+  * `wx+` or `xw+` Opens file for reading and writing. Throws an exception if it exists.
+  * `a` Opens file for appending. The file is created if it does not exist.
+  * `ax` or `xa` Opens file for appending. Throws an exception if it exists.
+  * `a+` Opens file for reading and appending. The file is created if it does not exist.
+  * `ax+` or `xa+` Opens file for reading and appending. Throws an exception if it exists.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.open('test.txt', 'r', 755, function(err, fd) {
+  if (err) {
+    throw err;
+  }
+  // do something
+});
+```
+
+
+### fs.openSync(path, flags[, mode])
+* `path` {string} File path to be opened.
+* `flags` {string} Open flags.
+* `mode` {string|number} Permission mode. **Default:** `0666`
+* Returns: {number} File descriptor.
+
+Opens file synchronously.
+
+For available options of the `flags` see [fs.open()](#class-method-fsopenpath-flags-mode-callback).
+
+**Example**
+
+```js
+var fs = require('fs');
+
+var fd = fs.openSync('test.txt', 'r', 755);
+// do something
+```
+
+
+### fs.read(fd, buffer, offset, length, position, callback)
+* `fd` {integer} File descriptor.
+* `buffer` {Buffer} Buffer that the data will be written to.
+* `offset` {number} Offset of the buffer where to start writing.
+* `length` {number} Number of bytes to read.
+* `position` {number} Specifying where to start read data from the file, if `null` or `undefined`, read from current position.
+* `callback` {Function}
+  * `err` {Error|null}
+  * `bytesRead` {number}
+  * `buffer` {Buffer}
+
+Reads data from the file specified by `fd` asynchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.open('test.txt', 'r', 755, function(err, fd) {
+  if (err) {
+    throw err;
+  }
+  var buffer = new Buffer(64);
+  fs.read(fd, buffer, 0, buffer.length, 0, function(err, bytesRead, buffer) {
+    if (err) {
+      throw err;
+    }
+  });
+});
+```
+
+
+### fs.readSync(fd, buffer, offset, length, position)
+* `fd` {integer} File descriptor.
+* `buffer` {Buffer} Buffer that the data will be written to.
+* `offset` {number} Offset of the buffer where to start writing.
+* `length` {number} Number of bytes to read.
+* `position` {number} Specifying where to start read data from the file, if `null` or `undefined`, read from current position.
+* Returns: {number} Number of read bytes.
+
+Reads data from the file specified by `fd` synchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+var buffer = new Buffer(16);
+var fd = fs.openSync('test.txt', 'r');
+var bytesRead = fs.readSync(fd, buffer, 0, buffer.length, 0);
+```
+
+
+### fs.readdir(path, callback)
+* `path` {string} Directory path to be checked.
+* `callback` {Function}
+  * `err` {Error|null}
+  * `files` {Object}
+
+Reads the contents of the directory specified by `path` asynchronously, `.` and `..` are excluded from `files`.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.readdir('testdir', function(err, items) {
+  if (err) {
+    throw err;
+  }
+
+  // prints: file1,file2,... from 'testdir'
+  console.log(items);
+});
+```
+
+
+### fs.readdirSync(path)
+* `path` {string} Directory path to be checked.
+* Returns: {Object} Array of filenames.
+
+Reads the contents of the directory specified by `path` synchronously, `.` and `..` are excluded from filenames.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+var items = fs.readdirSync('testdir');
+
+// prints: file1,file2,... from 'testdir'
+console.log(items);
+```
+
+
+### fs.readFile(path, callback)
+* `path` {string} File path to be opened.
+* `callback` {Function}
+  * `err` {Error|null}
+  * `data` {Buffer}
+
+Reads entire file asynchronously into `data`.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.readFile('test.txt', function(err, data) {
+  if (err) {
+    throw err;
+  }
+
+  // prints: the content of 'test.txt'
+  console.log(data);
+});
+```
+
+
+### fs.readFileSync(path)
+* `path` {string} File path to be opened.
+* Returns: {Object} Contents of the file.
+
+Reads entire file synchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+var data = fs.readFileSync('test.txt');
+```
+
+
+### fs.rename(oldPath, newPath, callback)
+* `oldPath` {string} Old file path.
+* `newPath` {string} New file path.
+* `callback` {Function}
+  * `err` {Error|null}
+
+Renames `oldPath` to `newPath` asynchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.rename('test.txt', 'test.txt.async', function(err) {
+  if (err) {
+    throw err;
+  }
+});
+```
+
+
+### fs.renameSync(oldPath, newPath)
+* `oldPath` {string} Old file path.
+* `newPath` {string} New file path.
+
+Renames `oldPath` to `newPath` synchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.renameSync('test.txt', 'test.txt.sync');
+```
+
+
+### fs.rmdir(path, callback)
+* `path` {string} Directory path to be removed.
+* `callback` {Function}
+  * `err` {Error|null}
+
+Removes the directory specified by `path` asynchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.rmdir('testdir', function() {
+  // do something
+});
+```
+
+
+### fs.rmdirSync(path)
+* `path` {string} Directory path to be removed.
+
+Removes the directory specified by `path` synchronously.
+
+```js
+var fs = require('fs');
+
+fs.rmdirSync('testdir');
+```
+
+
+### fs.stat(path, callback)
+* `path` {string} File path to be stated.
+* `callback` {Function}
+  * `err` {Error|null}
+  * `stat` {Object}
+
+Get information about a file into `stat` asynchronously.
+
+**Example**
+
+```js
+var assert = require('assert');
+var fs = require('fs');
+
+fs.stat('test.txt', function(err, stat) {
+  if (err) {
+    throw err;
+  }
+  assert.equal(stat.isFile(), true);
+  assert.equal(stat.isDirectory(), false);
+});
+```
+
+
+### fs.statSync(path)
+* `path` {string} File path to be stated.
+* Returns: {Object} An instance of `fs.Stats`.
+
+Get information about a file synchronously.
+
+**Example**
+
+```js
+var assert = require('assert');
+var fs = require('fs');
+
+var stat = fs.statSync('test.txt');
+assert.equal(stat.isFile(), true);
+assert.equal(stat.isDirectory(), false);
+```
+
+
+### fs.unlink(path, callback)
+* `path` {string} File path to be removed.
+* `callback` {Function}
+  * `err` {Error|null}
+
+Removes the file specified by `path` asynchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.unlink('test.txt', function(err) {
+  if (err) {
+    throw err;
+  }
+});
+```
+
+
+### fs.unlinkSync(path)
+* `path` {string} File path to be removed.
+
+Removes the file specified by `path` synchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.unlinkSync('test.txt');
+```
+
+
+### fs.write(fd, buffer, offset, length[, position], callback)
+* `fd` {integer} File descriptor.
+* `buffer` {Buffer} Buffer that the data will be written from.
+* `offset` {number} Offset of the buffer where from start reading.
+* `length` {number} Number of bytes to write.
+* `position` {number} Specifying where to start write data to the file, if `null` or `undefined`, write at the current position.
+* `callback` {Function}
+  * `err` {Error|null}
+  * `bytesWrite` {integer}
+  * `buffer` {Object}
+
+Writes `buffer` to the file specified by `fd` asynchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+var file = 'test.txt'
+var data = new Buffer('IoT.js');
+
+fs.open(file, 'w', function(err, fd) {
+  if (err) {
+    throw err;
+  }
+
+  fs.write(fd, data, 0, data.length, function(err, bytesWrite, buffer) {
+    if (err) {
+      throw err;
+    }
+
+    // prints: 6
+    console.log(bytesWrite);
+
+    // prints: IoT.js
+    console.log(buffer);
+  });
+});
+```
+
+### fs.writeSync(fd, buffer, offset, length[, position])
+* `fd` {integer} File descriptor.
+* `buffer` {Buffer} Buffer that the data will be written from.
+* `offset` {number} Offset of the buffer where from start reading.
+* `length` {number} Number of bytes to write.
+* `position` {number} Specifying where to start write data to the file, if `null` or `undefined`, write at the current position.
+* Returns: {number} Number of bytes written.
+
+Writes buffer to the file specified by `fd` synchronously.
+
+```js
+var fs = require('fs');
+
+var file = 'test.txt'
+var data = new Buffer('IoT.js');
+
+var fd = fs.openSync(file, 'w');
+var bytes = fs.writeSync(fd, data, 0, data.length);
+
+//prints: 6
+console.log(bytes);
+```
+
+
+### fs.writeFile(path, data, callback)
+* `path` {string} File path that the `data` will be written.
+* `data` {string|Buffer} String or buffer that contains data.
+* `callback` {Function}
+  * `err` {Error|null}
+
+Writes entire `data` to the file specified by `path` asynchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.writeFile('test.txt', 'IoT.js', function(err) {
+  if (err) {
+    throw err;
+  }
+});
+```
+
+
+### fs.writeFileSync(path, data)
+* `path` {string} File path that the `data` will be written.
+* `data` {string|Buffer} String or buffer that contains data.
+
+Writes entire `data` to the file specified by `path` synchronously.
+
+**Example**
+
+```js
+var fs = require('fs');
+
+fs.writeFileSync('test.txt', 'IoT.js');
+```
diff --git a/docs/api/IoT.js-API-GPIO.md b/docs/api/IoT.js-API-GPIO.md
new file mode 100644 (file)
index 0000000..fe71013
--- /dev/null
@@ -0,0 +1,204 @@
+### Platform Support
+
+The following shows GPIO module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| gpio.open | O | O | O |
+| gpiopin.write | O | O | O |
+| gpiopin.writeSync | O | O | O |
+| gpiopin.read | △ | △ | O |
+| gpiopin.readSync | O | O | O |
+| gpiopin.close | O | O | O |
+| gpiopin.closeSync | O | O | O |
+
+
+# GPIO
+
+The GPIO module provides access the General Purpose
+Input Output pins of the hardware.
+
+On Linux each pin has a logical number starting from `1`.
+The logical number might be different from the physical
+pin number of the board. The mapping is available
+in the documentation of a given board.
+
+On NuttX, the pin number is defined in target board
+module. For more information, please check the
+following list:
+[STM32F4-discovery](../targets/nuttx/stm32f4dis/IoT.js-API-Stm32f4dis.md#gpio-pin)
+
+## Class: GPIO
+
+### new GPIO()
+
+Returns a new GPIO object which can access any GPIO pins.
+
+### DIRECTION
+* `IN` Input pin.
+* `OUT` Output pin.
+
+An enumeration which can be used to specify the
+direction of the pin.
+
+
+### MODE
+* `NONE` None.
+* `PULLUP` Pull-up (pin direction must be [`IN`](#direction)).
+* `PULLDOWN` Pull-down (pin direction must be [`IN`](#direction)).
+* `FLOAT` Float (pin direction must be [`OUT`](#direction)).
+* `PUSHPULL` Push-pull (pin direction must be [`OUT`](#direction)).
+* `OPENDRAIN` Open drain (pin direction must be [`OUT`](#direction)).
+
+An enumeration which can be used to specify the
+configuration of the pin.
+
+
+### gpio.open(configuration[, callback])
+* `configuration` {Object}
+  * `pin` {number} Pin number. Mandatory field.
+  * `direction` {GPIO.DIRECTION} Pin direction. **Default:** `GPIO.DIRECTION.OUT`
+  * `mode` {GPIO.MODE} Pin mode. **Default:** `GPIO.MODE.NONE`
+* `callback` {Function}
+  * `error` {Error|null}
+* Returns: {GPIOPin}
+
+Opens the specified GPIO pin and sets the pin configuration.
+
+The mode argument is ignored on Linux.
+
+The optional `callback` function will be called after
+opening is completed. The `error` argument is an
+`Error` object on failure or `null` otherwise.
+
+**Example**
+
+```js
+var GPIO = require('gpio');
+var gpio = new GPIO();
+
+var gpio10 = gpio.open({
+  pin: 10,
+  direction: gpio.DIRECTION.OUT,
+  mode: gpio.MODE.NONE
+}, function(err) {
+  if (err) {
+    throw err;
+  }
+});
+```
+
+## Class: GPIOPin
+
+This class represents an opened and configured GPIO pin.
+It allows getting and setting the status of the pin.
+
+### gpiopin.write(value[, callback])
+* `value` {number|boolean}
+* `callback` {Function}
+  * `error` {Error|null}
+
+Asynchronously writes out a boolean `value` to a GPIO pin
+(a number `value` is converted to boolean first).
+
+The optional `callback` function will be called
+after the write is completed. The `error` argument
+is an `Error` object on failure or `null` otherwise.
+
+**Example**
+
+```js
+gpio10.write(1, function(err) {
+  if (err) {
+    throw err;
+  }
+});
+```
+
+
+### gpiopin.writeSync(value)
+* `value` {number|boolean}
+
+Writes out a boolean `value` to a GPIO pin synchronously
+(a number `value` is converted to boolean first).
+
+**Example**
+
+```js
+gpio10.writeSync(1);
+```
+
+
+### gpiopin.read([callback])
+* `callback` {Function}
+  * `error` {Error|null}
+  * `value` {boolean}
+
+Asynchronously reads a boolean value from a GPIO pin.
+
+The optional `callback` function will be called
+after the read is completed. The `error` argument
+is an `Error` object on failure or `null` otherwise.
+The `value` argument contains the boolean value
+of the pin.
+
+**Example**
+
+```js
+gpio10.read(function(err, value) {
+  if (err) {
+    throw err;
+  }
+  console.log('value:', value);
+});
+```
+
+
+### gpiopin.readSync()
+* Returns: {boolean}
+
+Returns the boolean value of a GPIO pin.
+
+**Example**
+
+```js
+console.log('value:', gpio10.readSync());
+```
+
+
+### gpiopin.close([callback])
+* `callback` {Function}
+  * `error` {Error|null}
+
+Asynchronously closes a GPIO pin.
+
+The optional `callback` function will be called
+after the close is completed. The `error` argument
+is an `Error` object on failure or `null` otherwise.
+
+**Example**
+
+```js
+gpio10.close(function(err) {
+  if (err) {
+    throw err;
+  }
+
+  // prints: gpio pin is closed
+  console.log('gpio pin is closed');
+});
+```
+
+
+### gpiopin.closeSync()
+
+Closes a GPIO pin.
+
+**Example**
+
+```js
+gpio10.closeSync();
+
+// prints: gpio pin is closed
+console.log('gpio pin is closed');
+```
diff --git a/docs/api/IoT.js-API-HTTP.md b/docs/api/IoT.js-API-HTTP.md
new file mode 100644 (file)
index 0000000..1d02ef8
--- /dev/null
@@ -0,0 +1,334 @@
+### Platform Support
+
+ The following shows Http module APIs available for each platform.
+
+ |  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+ | :---: | :---: | :---: | :---: |
+ | http.createServer | O | O | △ ¹ |
+ | http.request | O | O | △ ¹ |
+ | http.get | O | O | △ ¹ |
+
+1. On NuttX/STM32F4-Discovery, even a couple of sockets/server/requests might not work properly.
+
+# Http
+
+IoT.js provides HTTP to support HTTP server and client enabling users to receive/send HTTP request easily.
+
+### http.createServer([requestListener])
+* `requestListener` {Function}
+  * request {http.IncomingMessage}
+  * response {http.ServerResponse}
+* Returns: {http.Server}
+
+The `requestListener` is a function which is automatically added to the `'request'` event.
+
+**Example**
+
+```js
+var server = http.createServer(function(request, response) {
+  ...
+});
+```
+
+### http.request(options[, callback])
+* `options` {Object}
+  * `host` {string} A domain name or IP address of the server to issue the request to. Defaults to 'localhost'.
+  * `hostname` {string} Alias for host.
+  * `port` {number} Port of remote server. Defaults to 80.
+  * `method` {string} A string specifying the HTTP request method. Defaults to 'GET'.
+  * `path` {string} Request path. Defaults to '/'. Should include query string if any. E.G. '/index.html?page=12'. An exception is thrown when the request path contains illegal characters. Currently, only spaces are rejected but that may change in the future.
+  * `headers` {Object} An object containing request headers.
+* `callback` {Function}
+  * `response` {http.IncomingMessage}
+* Returns: {http.ClientRequest}
+
+**Example**
+
+```js
+var http = require('http');
+
+var request = http.request({
+  method: 'POST',
+  port: 80,
+  headers: {'Content-Length': 3}
+});
+
+...
+
+request.end();
+```
+
+Note that in the example `req.end()` was called. With `http.request()` one must always call `req.end()` to signify that you're done with the request - even if there is no data being written to the request body.
+
+### http.get(options[, callback])
+* `options` {Object}
+* `callback` {Function}
+  * `response` {http.IncomingMessage}
+* Returns: {http.ClientRequest}
+
+Same as `http.request` except that `http.get` automatically call `req.end()` at the end.
+
+**Example**
+
+```js
+var http = require('http');
+
+http.get({
+  port: 80,
+}, function(res) {
+...
+});
+```
+
+
+### http.METHODS
+A list of HTTP methods supported by the parser as `string` properties of an `Object`.
+
+## Class: http.Server
+
+This class inherits from `net.Server`.
+
+### Event: 'clientError'
+* `exception` {Error}
+* `socket` {net.Socket}
+
+If a client connection emits an 'error' event, it will be forwarded here. Listener of this event is responsible for closing/destroying the underlying socket.
+
+Default behavior is to destroy the socket immediately on malformed request.
+
+**Example**
+
+```js
+var http = require('http');
+
+var server = http.createServer(function(req, res) {
+  res.end();
+});
+
+server.on('clientError', function(err, socket) {
+  socket.end('HTTP/1.1 400 Bad Request\r\n\r\n');
+});
+
+server.listen(8000);
+```
+
+### Event: 'close'
+This event is emitted when server is closed.
+
+### Event: 'connection'
+* `socket` {net.Socket}
+
+This event is emitted when new TCP connection is established.
+
+### Event: 'connect'
+
+Emitted each time a client requests an `HTTP CONNECT` method.
+
+### Event: 'request'
+* `request` {http.IncomingMessage}
+* `response` {http.ServerResponse}
+
+After request header is parsed, this event will be fired.
+
+
+### server.timeout
+The number of milliseconds of inactivity before a socket is presumed to have timed out. Default value is 120000 (2 minutes).
+
+### server.listen(port[, hostname][, backlog][, callback])
+* `port` {number}
+* `host` {string}
+* `backlog` {number}
+* `callback` {Function}
+
+Wait for new TCP connection with specified port and hostname. If no hostname is provided, server accepts any IP address.
+`backlog` is maximum pending connections. Default backlog length is 511 (not 512).
+`callback` will be called when server has been bound.
+
+**Example**
+
+```js
+var http = require('http');
+
+var server = http.createServer(function(req, res) {
+  res.end();
+});
+server.listen(8080, function() {});
+```
+
+### server.close([callback])
+* `callback` {Function}
+
+Stop accepting new connection to this server. However, the existing connections are preserved. When server is finally closed after all connections are closed, a callback is called.
+
+### server.setTimeout(ms, cb)
+
+* `ms` {number}
+* `cb` {Function}
+
+Registers cb for `'timeout'` event and sets socket's timeout value to ms. This event will be triggered by the underlying socket's 'timeout' event.
+
+If cb is not provided, the socket will be destroyed automatically after timeout.
+If you provide cb, you should handle the socket's timeout.
+
+Default timeout for server is 2 minutes.
+
+**Example**
+
+```js
+var http = require('http');
+
+var server = http.createServer();
+server.setTimeout(100, function(socket) {
+  socket.destroy();
+  server.close();
+});
+```
+
+## Class: http.ServerResponse
+
+### Event: 'close'
+When underlying connection is closed, 'close' event is emitted.
+
+### Event: 'end'
+This event is fired when no more data to be sent.
+
+### Event: 'finish'
+This event is emitted when the response has been sent. It does not guarantee that client has received data yet.
+
+
+### response.end([data][, callback])
+* `data` {Buffer | string}
+* `callback` {Function}
+
+Finishes sending the response.
+
+If `data` is provided, it sends `data` first, and finishes.
+If `callback` is specified, it is called when the response stream is finished.
+
+### response.getHeader(name)
+* `name` {string}
+
+Returns `name` field of response's header
+
+### response.removeHeader(name)
+* `name` {string}
+
+Removes `name` field from response's header
+
+### response.setHeader(name, value)
+* `name` {string}
+* `value` {string}
+
+Sets response's header field(`name`) to `value`. If the field exists, it overwrites the existing value.
+
+### response.setTimeout(ms, cb)
+
+* `ms` {number}
+* `cb` {Function}
+
+Registers cb for 'timeout' event and set socket's timeout value to ms. This event will be triggered by the underlying socket's 'timeout' event.
+
+### response.write(data[, callback])
+* `data` {Buffer | string}
+* `callback` {Function}
+
+Sends `data` as a response body. `callback` will be called when data is flushed.
+
+### response.writeHead(statusCode[, statusMessage][, headers])
+* `statusCode` {number}
+* `statusMessage` {string}
+* `headers` {Object}
+
+Sets response's header. `headers` is a map between field and value in header.
+
+
+## Class: http.ClientRequest
+
+This object is created internally and returned from http.request(). It represents an in-progress request whose header has already been queued.
+
+### Event: 'close'
+This event is fired when the underlying socket is closed.
+
+### Event: 'error'
+* `callback` {Function}
+* `err` {Error}
+
+Emitted if something went wrong with making or parsing the request.
+
+### Event: 'finish'
+This event is emitted after all the data was sent, meaning header and body all finished sending.
+
+### Event: 'response'
+* `response` {http.IncomingMessage}
+
+This event is emitted when server's response header is parsed. ` http.IncomingMessage` object is passed as argument to handler.
+
+### Event: 'socket'
+* `socket` {net.Socket}
+
+This event is emitted when a socket is assigned to this request. `net.Socket` object is passed as argument to handler.
+
+After response header is parsed, this event will be fired.
+
+
+### request.end([data][, callback])
+* `data` {Buffer | string}
+* `callback` {Function}
+
+Finishes sending the request.
+
+If `data` is provided, it sends `data` first, and finishes.
+If `callback` is specified, it is called when the request stream is finished.
+
+### request.setTimeout(ms, cb)
+
+* `ms` {number}
+* `cb` {Function}
+
+Registers cb for 'timeout' event and set socket's timeout value to ms. This event will be triggered by the underlying socket's 'timeout' event.
+
+If cb is not provided, the socket will be destroyed automatically after timeout.
+If you provides cb, you should handle the socket's timeout.
+
+### request.write(data[, callback])
+* `data` {Buffer | string}
+* `callback` {Function}
+
+Sends `data` as a request body. `callback` will be called when data is flushed.
+
+
+## Class: http.IncomingMessage
+
+http.IncomingMessage inherits `Stream.readable`.
+
+### Event: 'close'
+When underlying connection is closed, 'close' event is emitted.
+
+### Event: 'end'
+This event is fired when no more data to be received.
+
+
+### message.headers
+HTTP header object.
+
+### message.method
+Requests method as `string`
+
+### message.socket
+Underlying socket
+
+### message.statusCode
+HTTP response status code as `number` of 3-digit.
+
+### message.statusMessage
+HTTP response status message as `string`
+
+### message.url
+Requests URL as `string`
+
+### message.setTimeout(ms, cb)
+
+* `ms` {number}
+* `cb` {Function}
+
+Registers cb for 'timeout' event set socket's timeout value to ms. This event will be triggered by the underlying socket's 'timeout' event.
diff --git a/docs/api/IoT.js-API-HTTPS.md b/docs/api/IoT.js-API-HTTPS.md
new file mode 100644 (file)
index 0000000..a310130
--- /dev/null
@@ -0,0 +1,143 @@
+### Platform Support
+
+ The following shows Https module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | Nuttx<br/>(STM32F4-Discovery) | Tizen<br/>(Artik 10) |
+| :---: | :---: | :---: | :---: | :---: |
+| https.request  | X | X | X | O |
+| https.get  | X | X | X | O |
+
+
+# Https
+
+IoT.js provides HTTPS to support HTTPS clients enabling users to send HTTPS requests easily.
+
+### https.request(options[, callback])
+* `options` {Object}
+  * `host` {string} A domain name or IP address of the server to issue the request to. **Deafult:** 'localhost'.
+  * `hostname` {string} Alias for host.
+  * `port` {number} Port of remote server. **Deafult:** 80.
+  * `method` {string} A string specifying the HTTPS request method. **Deafult:** 'GET'.
+  * `path` {string} Request path. **Deafult:** '/'. Should include query string if any. E.G. '/index.html?page=12'. An exception is thrown when the request path contains illegal characters. Currently, only spaces are rejected but that may change in the future.
+  * `headers` {Object} An object containing request headers.
+  * `auth` {string} Optional Basic Authentication in the form `username:password`. Used to compute HTTPS Basic Authentication header.
+  * `ca` {string} Optional file path to CA certificate. Allows to override system trusted CA certificates.
+  * `cert` {string} Optional file path to client authentication certificate in PEM format.
+  * `key` {string} Optional file path to private keys for client cert in PEM format.
+* `callback` {Function}
+  * `response` {https.IncomingMessage}
+* Returns: {https.ClientRequest}
+
+Example:
+```javascript
+var https = require('https');
+
+var request = https.request({
+  method: 'POST',
+  port: 443,
+  headers: {'Content-Length': 3}
+});
+
+...
+
+request.end();
+```
+
+Note that in the example `req.end()` was called. With `https.request()` one must always call `req.end()` to signify that you're done with the request - even if there is no data being written to the request body.
+
+### https.get(options[, callback])
+* `options` {Object}
+  * `host` {string} A domain name or IP address of the server to issue the request to. **Deafult:** 'localhost'.
+  * `hostname` {string} Alias for host.
+  * `port` {number} Port of remote server. **Deafult:** 80.
+  * `method` {string} A string specifying the HTTPS request method. **Deafult:** 'GET'.
+  * `path` {string} Request path. **Deafult:** '/'. Should include query string if any. E.G. '/index.html?page=12'. An exception is thrown when the request path contains illegal characters. Currently, only spaces are rejected but that may change in the future.
+  * `headers` {Object} An object containing request headers.
+  * `auth` {string} Optional Basic Authentication in the form `username:password`. Used to compute HTTPS Basic Authentication header.
+  * `ca` {string} Optional file path to CA certificate. Allows to override system trusted CA certificates.
+  * `cert` {string} Optional file path to client authentication certificate in PEM format.
+  * `key` {string} Optional file path to private keys for client cert in PEM format.
+* `callback` {Function}
+  * `response` {https.IncomingMessage}
+* Returns: {https.ClientRequest}
+
+Same as `https.request` except that `https.get` automatically call `req.end()` at the end.
+
+Example:
+```javascript
+var https = require('https');
+
+https.get({
+  port: 80,
+}, function(res) {
+...
+});
+```
+
+
+### https.METHODS
+A list of HTTPS methods supported by the parser as `string` properties of an `Object`. Currently supported methods are `'DELETE'`, `'GET'`, `'HEAD'`, `'POST'`, `'PUT'`, `'CONNECT'`, `'OPTIONS'`, `'TRACE'`.
+
+
+## Class: https.ClientRequest
+
+This object is created internally and returned from https.request(). It represents an in-progress request whose header has already been queued.
+
+https.ClientRequest inherits [`Stream.writable`](IoT.js-API-Stream.md). See it's documentation to write data to an outgoing HTTP request. Notable methods are `'writable.write()'` (to send data as request body), `'writable.end()'` (to signal an end and flush remaining request body), and the event `'finish'`.
+
+### Event: 'close'
+This event is fired when the underlying socket is closed.
+
+### Event: 'response'
+* `response` {https.IncomingMessage}
+
+This event is emitted when server's response header is parsed. ` https.IncomingMessage` object is passed as argument to handler.
+
+### Event: 'socket'
+This event is emitted when a socket is assigned to this request.
+
+### request.abort()
+Will abort the outgoing request, dropping any data to be sent/received and destroying the underlying socket.
+
+### request.aborted
+If the request has been aborted, this contains the time at which the request was aborted in milliseconds since epoch as `Number`.
+
+### request.setTimeout(ms, cb)
+* `ms` {number}
+* `cb` {Function}
+
+Registers cb for 'timeout' event and set socket's timeout value to ms. This event will be triggered by the underlying socket's 'timeout' event.
+
+If cb is not provided, the socket will be destroyed automatically after timeout.
+If you provides cb, you should handle the socket's timeout.
+
+
+## Class: https.IncomingMessage
+
+This object is created internally and returned to the callback in https.request(). It represents the response sent by a server to a request.
+
+https.IncomingMessage inherits [`Stream.readable`](IoT.js-API-Stream.md). See it's documentation to read incoming data from an HTTP request. Notable events are `'data'` (fired when there is data to read), `'close'`, `'end'` (Request has ended) and the method `readable.read()`.
+
+### message.headers
+HTTPS header object.
+
+### message.method
+Request's method as `string`
+
+### message.statusCode
+HTTPS response status code as `number` of 3-digit.
+
+### message.statusMessage
+HTTPS response status message as `string`
+
+### message.url
+Requests URL as `string`
+
+### message.setTimeout(ms, cb)
+* `ms` {number}
+* `cb` {Function}
+
+Registers cb for 'timeout' event set socket's timeout value to ms. This event will be triggered by the underlying socket's 'timeout' event.
+
+If cb is not provided, the socket will be destroyed automatically after timeout.
+If you provides cb, you should handle the socket's timeout.
diff --git a/docs/api/IoT.js-API-I2C.md b/docs/api/IoT.js-API-I2C.md
new file mode 100644 (file)
index 0000000..e62270a
--- /dev/null
@@ -0,0 +1,117 @@
+## Platform Support
+
+The following shows I2C module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| i2c.open | O | O | O |
+| i2cbus.read | O | O | O |
+| i2cbus.write | O | O | O |
+| i2cbus.close | O | O | O |
+
+
+# I2C
+
+The I2C class supports the I2C protocol. I2C bus has two signals - SDA and SCL.
+
+
+### new I2C()
+
+Returns with an I2C object.
+
+**Example**
+
+```js
+var I2C = require('i2c');
+
+var i2c = new I2C();
+```
+
+
+### i2c.open(configuration[, callback])
+* `configuration` {Object} Configuration for open I2CBus.
+  * `device` {string(linux)|number(NuttX)} Device path.
+  * `address` {number} Device address.
+* `callback` {Function}
+  * `err` {Error|null}
+* Returns: {Object} An instance of I2CBus.
+
+Get I2CBus object with configuration.
+
+**Example**
+
+```js
+var I2C = require('i2c');
+
+var i2c = new I2C();
+var i2c_bus = i2c.open({device: '/dev/i2c-1', address: 0x23}, function(err) {
+  if (err) {
+    throw err;
+  }
+});
+```
+
+
+## Class: I2CBus
+
+
+### i2cbus.read(length[, callback])
+* `length` {number} Number of bytes to read.
+* `callback` {Function}
+  * `err` {Error|null}
+  * `res` {Array} Array of bytes.
+
+Read bytes from I2C device.
+
+**Example**
+
+```js
+var I2C = require('i2c');
+
+var i2c = new I2C();
+var i2c_bus = i2c.open({device: '/dev/i2c-1', address: 0x23});
+
+i2c_bus.read(2, function(err, res) {
+  if (!err) {
+    console.log('read result: ' + res);
+  }
+});
+```
+
+### i2cbus.write(bytes[, callback])
+* `bytes` {Array} Array of bytes to write.
+* `callback` {Function}
+  * `err` {Error|null}
+
+Write bytes to I2C device.
+
+**Example**
+
+```js
+var I2C = require('i2c');
+
+var i2c = new I2C();
+var i2c_bus = i2c.open({device: '/dev/i2c-1', address: 0x23});
+
+i2c_bus.write([0x10], function(err) {
+  if(!err) {
+    console.log('write done');
+  }
+});
+```
+
+
+### i2cbus.close()
+
+Close I2C device.
+
+**Example**
+
+```js
+var I2C = require('i2c');
+
+var i2c = new I2C();
+var i2c_bus = i2c.open({device: '/dev/i2c-1', address: 0x23});
+
+i2c_bus.close();
+```
diff --git a/docs/api/IoT.js-API-Module.md b/docs/api/IoT.js-API-Module.md
new file mode 100644 (file)
index 0000000..ab1d963
--- /dev/null
@@ -0,0 +1,43 @@
+### Platform Support
+
+The following shows module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| require | O | O | O |
+
+# Module
+The `require` function is always available there is no need to import `module` explicitly.
+
+### require(id)
+* `id` {string} Module name to be loaded.
+
+Loads the module named `id`.
+
+**Example**
+
+```js
+var assert = require('assert');
+
+assert.equal(2, 2);
+```
+
+**Loading a module**
+
+If a native module named `id` exists, load it and return.
+(_Native module:_ which module came from the IoT.js itself)
+
+`require` function searches for modules in the following order:
+
+1. Current working directory.
+2. `iotjs_modules` folder under current working directory.
+3. `$HOME/iotjs_modules`
+4. `$IOTJS_PATH/iotjs_modules`
+
+For each directory in search paths above:
+
+- If a file `id` exists, load it and return.
+- If a file `id.js` exists, load it and retun.
+- If a directory `id` exists, module system consider the directory as a package:
+  - If `id/package.json` contains **main** property, load the file named **main** property.
+  - If `id/package.json` exists, but neither the **main** property nor the file named **main** property exist, load `index.js`.
diff --git a/docs/api/IoT.js-API-Net.md b/docs/api/IoT.js-API-Net.md
new file mode 100644 (file)
index 0000000..770dcf2
--- /dev/null
@@ -0,0 +1,866 @@
+### Platform Support
+
+The following shows net module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| net.createServer | O | O | △ ¹ |
+| net.connect | O | O | △ ¹ |
+| net.createConnection | O | O | △ ¹ |
+| net.Server.listen | O | O | △ ¹ |
+| net.Server.close | O | O | △ ²|
+| net.Socket.connect | O | O | △ ¹ |
+| net.Socket.write | O | O | △ ¹ |
+| net.Socket.end | O | O | △ ¹ ³ |
+| net.Socket.destroy | O | O | △ ¹ ³ |
+| net.Socket.pause | O | O | △ ¹ |
+| net.Socket.resume | O | O | △ ¹ |
+| net.Socket.setTimeout | O | O | △ ¹ |
+| net.Socket.setKeepAlive | X | X | X |
+
+1. On NuttX/STM32F4-Discovery, even a couple of sockets/server/requests might not work properly.
+
+2. On NuttX/STM32F4-Discovery, close() may block due to a bug in poll().
+
+3. When writable stream is finished but readable stream is still alive, IoT.js tries to shutdown the socket, not destroy.
+However on `NuttX` due to lack of implementation, it does nothing inside.
+
+
+# Net
+
+IoT.js provides asynchronous networking through Net module. You can use this module with `require('net')` and create both servers and clients.
+
+### net.connect(options[, connectListener])
+* `options` {Object} An object which specifies the connection options.
+* `connectListener` {Function} Listener for the `'connect'` event.
+* Returns {net.Socket}.
+
+Creates a new `net.Socket` and automatically connects with the supplied `options`.
+The `options` object specifies the following information:
+* `port` {number} Port connect to (required).
+* `host` {string} Host connect to (optional, **Default:** `localhost`).
+* `family` {number} Version of IP stack.
+
+The `options` are passed to both the `net.Socket` constructor and the `socket.connect` method.
+The `connectListener` is automatically registered as a `'connect'` event listener.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var port = 22702;
+
+var echo_msg = '';
+
+var socket = net.connect({port: port, family: 4}, function() {
+  socket.end('Hello IoT.js');
+});
+
+socket.on('data', function(data) {
+  echo_msg += data;
+});
+
+socket.on('end', function() {
+  console.log(echo_msg);
+});
+
+```
+
+### net.connect(port[, host][, connectListener])
+* `port` {number} Port the client should connect to.
+* `host` {string} Host the client should connect to. **Default:** `localhost`.
+* `connectListener` {Function} Listener for the `'connect'` event.
+* Returns {net.Socket}.
+
+Creates a new `net.Socket` and automatically connects to the supplied `port` and `host`.
+If host is omitted, `localhost` will be assumed.
+The `connectListener` is automatically registered as a `'connect'` event listener.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var port = 22702;
+var host = '127.0.0.1';
+var echo_msg = '';
+
+var socket = net.connect(port, host, function() {
+  socket.end('Hello IoT.js');
+});
+
+socket.on('data', function(data) {
+  echo_msg += data;
+});
+
+socket.on('end', function() {
+  console.log(echo_msg);
+});
+
+```
+
+### net.createConnection(options[, connectListener])
+* `options` {Object} An object which specifies the connection options.
+* `connectListener` {Function} Listener for the `'connect'` event.
+* Returns {net.Socket}.
+
+Creates a new `net.Socket` and automatically connects with the supplied `options`.
+The `options` are passed to both the `net.Socket` constructor and the `socket.connect` method.
+The `options` object specifies the following information:
+* `port` {number} Port connect to (required).
+* `host` {string} Host connect to (optional, **Default:** `localhost`).
+* `family` {number} Version of IP stack.
+
+The `connectionListener` is automatically registered as a `'connect'` event listener.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var port = 80;
+
+var echo_msg = '';
+
+var socket = net.createConnection({port: port, family: 4}, function() {
+  socket.end('Hello IoT.js');
+});
+
+socket.on('data', function(data) {
+  echo_msg += data;
+});
+
+socket.on('end', function() {
+  console.log(echo_msg);
+});
+
+```
+
+### net.createConnection(port[, host][, connectListener])
+* `port` {number} Port the client should connect to.
+* `host` {string} Host the client should connect to. **Default:** `localhost`.
+* `connectListener` {Function} Listener for the `'connect'` event.
+* Returns {net.Socket}.
+
+
+Creates a new `net.Socket` and automatically connects to the supplied `port` and `host`.
+It is equivalent to `new net.Socket()` followed by `socket.connect()`.
+If host is omitted, `localhost` will be assumed.
+The `connectionListener` is automatically registered as a `'connect'` event listener.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var port = 22702;
+var host = '127.0.0.1';
+var echo_msg = '';
+
+var socket = net.createConnection(port, host, function() {
+  socket.end('Hello IoT.js');
+});
+
+socket.on('data', function(data) {
+  echo_msg += data;
+});
+
+socket.on('end', function() {
+  console.log(echo_msg);
+});
+
+```
+
+### net.createServer([options][, connectionListener])
+* `options` {Object} An object which specifies the connection options **Default:** `{ allowHalfOpen: false }`.
+* `connectListener` {Function} Listener for the `'connection'` event.
+* Returns {net.Server}.
+
+Creates a TCP server according to `options`.
+The `connectionListener` is automatically registered as a `'connection'` event listener.
+If `allowHalfOpen` is true, then the socket becomes non-readable, but still writable. You should call the `socket.end()` method explicitly.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var port = 22702;
+
+var server = net.createServer(
+  {
+    allowHalfOpen: true
+  },
+  function(socket) {
+    server.close();
+  }
+);
+
+server.listen(port);
+
+server.on('connection', function(socket) {
+  var msg = '';
+  socket.on('data', function(data) {
+    msg += data;
+  });
+  socket.on('end', function() {
+    socket.end(msg);
+  });
+});
+
+```
+
+## Class: net.Server
+
+This class is used to create a TCP or local server. You can create `net.Server` instance with `net.createServer()`.
+
+### server.close([closeListener])
+* `closeListener` {Function} Listener for the `'close'` event.
+
+Stops listening new arriving connection.
+Server socket will be finally closed when all existing connections are closed, then emits `'close'` event.
+The `closeListener` is registered as a `'close'` event listener.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var server = net.createServer();
+var port = 22704;
+var timeout = 1000;
+
+server.listen(port);
+
+/* ... */
+
+server.close();
+
+```
+
+### server.listen(port[, host][, backlog][, listenListener])
+* `port` {number} Port the client should connect to.
+* `host` {string} Host the client should connect to.
+* `backlog` {number} The maximum length of the queue of pending connections. **Default:** `511`.
+* `listenListener` {Function} Listener for the `'listening'` event.
+* Returns: {Object} The self instance of `net.Server`.
+
+Begin accepting connections on the specified port and hostname.
+If the hostname is omitted, the server will accept connections on any IPv4 address (0.0.0.0).
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var server = net.createServer();
+var port = 22709;
+
+server.listen(port);
+
+```
+
+
+### server.listen(options[, listenListener])
+* options {Object} An object which specifies the connection options.
+* `listenListener` {Function} Listener for the `'listening'` event.
+
+It behaves as the `server.listen(port[, host][, backlog][, listenListener])` function above.
+
+The option object supports the following properties:
+* `port` {number} Port the client should connect to.
+* `host` {string} Host the client should connect to.
+* `backlog` {number} The maximum length of the queue of pending connections. **Default:** `511`.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var server = net.createServer();
+
+server.listen({port: 80, host: 'localhost'});
+
+```
+
+### Event: 'close'
+* `callback` {Function}
+
+Emitted when server has closed the connection.
+
+Note that this event will be emitted after all existing connections are closed.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var serverCloseEvent = 0;
+var server = net.createServer();
+var port = 80;
+
+server.listen(port);
+
+server.on('connection', function(socket) {
+  server.on('close', function() {
+    serverCloseEvent++;
+  });
+});
+
+```
+
+### Event: 'connection(socket)'
+* `callback` {Function}
+  * `socket` {Net.Socket}
+
+Emitted when new connection is established.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var server = net.createServer();
+var port = 80;
+
+server.listen(port);
+
+server.on('connection', function(socket) {
+  var msg = '';
+  socket.on('data', function(data) {
+    msg += data;
+  });
+
+});
+
+```
+
+### Event: 'error'
+* `callback` {Function}
+
+Emitted when an error occurs.
+
+**Example**
+
+```js
+
+var assert = require('assert');
+var net = require('net');
+
+var port = 80;
+var msg = 'Hello IoT.js';
+var server = net.createServer();
+
+/* ... */
+
+server.on('error', function() {
+  assert.fail();
+  server.close();
+});
+
+```
+
+### Event: 'listening'
+* `callback` {Function}
+
+Emitted when server has been started listening.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var port = 80;
+
+var server = net.createServer(
+  {
+    allowHalfOpen: true
+  },
+  function(socket) {
+    server.close();
+  }
+);
+
+server.listen(port);
+
+server.on('listening', function() {
+    console.log('started listening');
+});
+
+```
+
+## Class: net.Socket
+
+This object is an abstraction of a TCP or a local socket. `net.Socket` inherits from [`Stream.Duplex`](IoT.js-API-Stream.md). They can be created by the user (used as a client with connect()) or by the IoT.js engine (passed to the user through the 'connection' event of a server).
+
+### new net.Socket([options])
+* `options` {Object} An optional object which specifies the socket information.
+* Returns {net.Socket}.
+
+Construct a new socket object.
+The `options` object specifies only the following information: `allowHalfOpen` {boolean}.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var socket = new net.Socket();
+
+```
+
+### socket.connect(options[, connectListener])
+* `options` {Object} An object which specifies the connection information.
+* `connectListener` {Function} Listener for the `'connect'` event.
+* Returns {net.Socket}.
+
+Creates a new socket object and automatically connects with the supplied `options`.
+
+The `options` object specifies following information:
+* `port` {number} Port connect to (required).
+* `host` {string}  Host connect to (optional, **Default:** `localhost`).
+* `family` {number} Version of IP stack.
+
+The `connectionListener` is automatically registered as a `'connect'` event listener which will be emitted when the connection is established.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var port = 22702;
+
+var socket = new net.Socket();
+
+socket.connect({port: port, family: 4}, function() {
+  socket.end('Hello IoT.js');
+});
+
+```
+
+### socket.connect(port[, host][, connectListener])
+* `port` {number} Port the client should connect to.
+* `host` {string} Host the client should connect to. **Default:** `localhost`.
+* `connectListener` {Function} Listener for the `'connect'` event.
+* Returns {net.Socket}.
+
+Creates a new socket and automatically connects with the supplied `port` and `host`.
+
+`connectionListener` is automatically registered as a `'connect'` event listener which will be emitted when the connection is established.
+
+**Example**
+
+```js
+
+var net = require('net');
+
+var port = 80;
+
+var socket = new net.Socket();
+
+socket.connect(port, '127.0.0.1', function() {
+  socket.end('Hello IoT.js');
+});
+
+```
+
+### socket.destroy()
+
+Ensures that no more I/O activity happens on the socket and destroys the socket as soon as possible.
+
+**Example**
+```js
+
+var net = require('net');
+
+var port = 80;
+
+var socket = new net.Socket();
+
+socket.connect(port, '127.0.0.1', function() {
+  socket.end('Hello IoT.js');
+});
+
+/* ... */
+
+socket.destroy();
+
+```
+
+### socket.end([data][, callback])
+
+* `data` {Buffer|string}
+* `callback` {Function}
+
+Half-closes the socket. The socket is no longer writable.
+If `data` is given it is equivalent to `socket.write(data)` followed by `socket.end()`.
+
+**Example**
+```js
+
+var net = require('net');
+
+var server = net.createServer();
+var port = 4010;
+
+server.listen(port);
+
+server.on('connection', function(socket) {
+  socket.on('data', function(data) {
+    socket.end('Hello IoT.js');
+  });
+});
+
+```
+
+### socket.pause()
+
+Pauses reading data.
+
+**Example**
+```js
+
+var net = require('net');
+
+var server = net.createServer();
+var port = 4010;
+
+server.listen(port);
+
+server.on('connection', function(socket) {
+
+  // as soon as connection established, pause the socket
+  socket.pause();
+});
+
+```
+
+### socket.resume()
+
+Resumes reading data after a call to `pause()`.
+
+**Example**
+```js
+
+var net = require('net');
+var timers = require('timers');
+
+var server = net.createServer();
+var port = 80;
+
+var socket = new net.Socket();
+var msg = "";
+
+/* ... */
+
+server.listen(port);
+
+server.on('connection', function(socket) {
+  socket.on('data', function(data) {
+    msg += data;
+    socket.end();
+  });
+  socket.on('close', function() {
+    server.close();
+  });
+
+  // as soon as connection established, pause the socket
+  socket.pause();
+
+  // resume after 2 secs
+  timers.setTimeout(function() {
+    socket.resume();
+  }, 2000);
+});
+
+```
+
+### socket.setKeepAlive([enable][, initialDelay])
+
+* `enable` {boolean} **Default:** `false`.
+* `initialDelay {number} **Default:** `0`.
+
+Enables or disables keep-alive functionality.
+
+**Example**
+```js
+
+var net = require('net');
+
+var keepalive_sock = new net.Socket();
+
+keepalive_sock.setKeepAlive(true, 1000);
+
+```
+
+### socket.setTimeout(timeout[, callback])
+* `timeout` {number} Timeout number.
+* `callback` {Function} Registered as a `'timeout'` event listener.
+
+Sets timeout for the socket.
+
+If the socket is inactive for `timeout` milliseconds, `'timeout'` event will emit.
+
+**Example**
+```js
+
+var net = require('net');
+
+var server = net.createServer();
+var port = 40;
+var timeout = 2000;
+var msg = '';
+
+server.listen(port);
+
+server.on('connection', function(socket) {
+  socket.setTimeout(timeout, function() {
+    socket.end();
+  });
+});
+
+```
+
+### socket.write(data[, callback])
+* `data` {Buffer|string} Data to write.
+* `callback` {Function} Executed function (when the data is finally written out).
+
+Sends `data` on the socket.
+
+The optional `callback` function will be called after the given data is flushed through the connection.
+
+**Example**
+```js
+
+var net = require('net');
+var timers = require('timers');
+
+var writeat = 1000;
+
+var socket = new net.Socket();
+
+/* ... */
+
+socket.on('connect', function() {
+  timers.setTimeout(function() {
+    socket.write('Hello IoT.js');
+  }, writeat);
+});
+
+```
+
+### Event: 'connect'
+* `callback` {Function}
+
+Emitted after connection is established.
+
+**Example**
+```js
+
+var net = require('net');
+
+var port = 80;
+
+var count = 40;
+
+/* ... */
+
+for (var i = 0; i < count; ++i) {
+  (function(i) {
+    var socket = new net.Socket();
+
+    socket.connect(port, "localhost");
+    socket.on('connect', function() {
+      socket.end(i.toString());
+    });
+
+    /* ... */
+
+  })(i);
+}
+
+```
+
+### Event: 'close'
+* `callback` {Function}
+
+Emitted when the socket has been closed.
+
+**Example**
+```js
+
+var net = require('net');
+
+var server = net.createServer();
+var port = 80;
+
+server.listen(port);
+
+server.on('connection', function(socket) {
+
+  /* ... */
+
+  socket.on('close', function() {
+    server.close();
+  });
+});
+
+```
+
+### Event: 'data'
+* `callback` {Function}
+
+The data is given an argument (data: Buffer|string).
+
+Emitted when data is received from the connection.
+
+**Example**
+```js
+
+var net = require('net');
+
+var msg = "";
+
+var socket = new net.Socket();
+
+/* ... */
+
+socket.on('data', function(data) {
+  msg += data;
+});
+
+```
+
+### Event: 'drain'
+* `callback` {Function}
+
+Emitted when the write buffer becomes empty.
+
+**Example**
+```js
+
+var net = require('net');
+
+var port = 22703;
+var limit = 200;
+var server = net.createServer();
+
+server.listen({ port: port });
+
+/* ... */
+
+server.on('connection', function(socket) {
+  var i = 0;
+  var writing = function() {
+    var ok;
+    do {
+      ok = socket.write("" + (i % 10));
+      if (++i == limit) {
+        socket.end();
+        ok = false;
+      }
+    } while (ok);
+  };
+  socket.on('drain', writing);
+  writing();
+});
+
+```
+
+### Event: 'end'
+* `callback` {Function}
+
+Emitted when FIN packet received.
+
+**Example**
+```js
+
+var net = require('net');
+
+var socket = new net.Socket();
+
+/* ... */
+
+socket.on('end', function() {
+  socket.end();
+});
+
+```
+
+### Event: 'error'
+* `callback` {Function}
+  * `err` {Error}
+
+Emitted when an error occurs.
+
+**Example**
+```js
+
+var assert = require('assert');
+var net = require('net');
+
+var bad_sock = new net.Socket();
+bad_sock.on('error', function(err){
+  assert.equal(err instanceof Error, true);
+});
+
+```
+
+### Event: 'lookup'
+* `callback` {Function}
+  * `err` {Error}
+  * `address` {string}
+  * `family` {string|null}
+
+Emitted after resolving hostname.
+
+**Example**
+```js
+
+var socket = new net.Socket();
+var msg = "";
+var lookupHandled = false;
+
+socket.on('lookup', function(err, ip, family) {
+  lookupHandled = true;
+});
+
+```
+
+### Event: 'timeout'
+* `callback` {Function}`
+
+Emitted when the connection remains idle for the specified timeout.
+
+**Example**
+```js
+
+var net = require('net');
+
+var timedout = false;
+
+// Try connect to host that is not exist (Reserved address)
+var socket = net.createConnection(11111, '192.0.2.1');
+
+socket.setTimeout(1000);
+
+socket.on('timeout', function() {
+  timedout = true;
+  socket.destroy();
+});
+
+```
diff --git a/docs/api/IoT.js-API-PWM.md b/docs/api/IoT.js-API-PWM.md
new file mode 100644 (file)
index 0000000..d769593
--- /dev/null
@@ -0,0 +1,261 @@
+### Platform Support
+
+The following shows PWM module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| pwm.open | O | O | O |
+| pwmpin.setPeriod | O | O | O |
+| pwmpin.setPeriodSync | O | O | O |
+| pwmpin.setFrequency | O | O | O |
+| pwmpin.setFrequencySync | O | O | O |
+| pwmpin.setDutyCycle | O | O | O |
+| pwmpin.setDutyCycleSync | O | O | O |
+| pwmpin.setEnable | O | O | O |
+| pwmpin.setEnableSync | O | O | O |
+| pwmpin.close | O | O | O |
+| pwmpin.closeSync | O | O | O |
+
+
+## Class: PWM
+
+### new PWM()
+
+Returns a new PWM object which can open a PWM pin.
+
+This object allows the developer to specify a pin and generate a pulse-width modulatated (PWM)
+signal through that.
+
+### pwm.open(configuration[, callback])
+* `configuration` {Object} Configuration object which can have the following properties.
+  * `pin` {number} The pin number to use with this PWM object (mandatory configuration).
+  * `chip` {number} The PWM chip number (only on Linux). **Default:** `0`.
+  * `period` {number} The period of the PWM signal, in seconds (positive number).
+  * `frequency` {integer} In Hz (positive integer).
+  * `dutyCycle` {number} The active time of the PWM signal, must be within the `0.0` and `1.0` range.
+* `callback` {Function} Callback function.
+  * `err` {Error|null} The error object or `null` if there were no error.
+* Returns: `<PWMPin>`
+
+Opens PWM pin with the specified configuration.
+
+To correctly open a PWM pin one must know the correct pin number:
+* On Linux, `pin` is a number which is `0` or `1`.
+* On NuttX, you have to know pin name. The pin name is defined in target board module. For more module information, please see below list.
+  * [STM32F4-discovery](../targets/nuttx/stm32f4dis/IoT.js-API-Stm32f4dis.md#pwm-pin)
+
+
+**Example**
+```js
+var Pwm = require('pwm');
+var pwm = new Pwm();
+var config = {
+  pin: 0,
+  period: 0.1,
+  dutyCycle: 0.5
+}
+var pwm0 = pwm.open(config, function(err) {
+  if (err) {
+    throw err;
+  }
+});
+```
+
+
+## Class: PWMPin
+
+### pwmpin.setPeriod(period[, callback])
+* `period` {number} The period of the PWM signal, in seconds (positive number).
+* `callback` {Function}
+  * `err` {Error|null} The error object or `null` if there were no error.
+
+The `setPeriod` method allows the configuration of the period of the PWM signal in seconds.
+The `period` argument must specified and it should be a positive number.
+
+Configuration is done asynchronously and the `callback` method is invoked after the
+period is configured to the new value or if an error occured.
+
+**Example**
+```js
+pwm0.setPeriod(1, function(err) {
+  if (err) {
+    throw err;
+  }
+  console.log('done');
+});
+// prints: do
+console.log('do');
+// prints: done
+```
+
+
+### pwmpin.setPeriodSync(period)
+* `period` {number} The period of the PWM signal, in seconds (positive number).
+
+The `setPeriodSync` method allows the configuration of the period of the PWM signal in seconds.
+The `period` argument must specified and it should be a positive number.
+
+Configuration is done synchronously and will block till the period is configured.
+
+**Example**
+```js
+pwm0.setPeriodSync(1);
+// prints: done
+console.log('done');
+```
+
+
+### pwmpin.setFrequency(frequency[, callback])
+* `frequency` {integer} In Hz (positive integer).
+* `callback` {Function}
+  * `err` {Error|null} The error object or `null` if there were no error.
+
+The `setFequency` method congifures the frequency of the PWM signal.
+`frequency` is the measurement of how often the signal is repeated in a single period.
+
+Configuration is done asynchronously and the `callback` method is invoked after the
+frequency is configured to the new value or if an error occured.
+
+**Example**
+```js
+pwm0.setFrequency(1, function(err) {
+  if (err) {
+    throw err;
+  }
+  console.log('done');
+});
+// prints: do
+console.log('do');
+// prints: done
+```
+
+
+### pwmpin.setFrequencySync(frequency)
+* `frequency` {integer} In Hz (positive integer).
+
+The `setFequencySync` method congifures the frequency of the PWM signal.
+`frequency` is the measurement of how often the signal is repeated in a single period.
+
+Configuration is done synchronously and will block till the frequency is configured.
+
+**Example**
+```js
+pwm0.setFrequencySync(1);
+// prints: done
+console.log('done');
+```
+
+
+### pwmpin.setDutyCycle(dutyCycle[, callback])
+* `dutyCycle` {number} Must be within the `0.0` and `1.0` range.
+* `callback` {Function}
+  * `err` {Error|null} The error object or `null` if there were no error.
+
+The `setDutyCycle` method allows the configuration of the duty cycle of the PWM signal.
+The duty cycle is the ratio of the pulse width in one period.
+
+Configuration is done asynchronously and the `callback` method is invoked after the
+duty cycle is configured to the new value or if an error occured.
+
+**Example**
+```js
+pwm0.setDutyCycle(1, function(err) {
+  if (err) {
+    throw err;
+  }
+  console.log('done');
+});
+// prints: do
+console.log('do');
+// prints: done
+```
+
+
+### pwmpin.setDutyCycleSync(dutyCycle)
+* `dutyCycle` {number} Must be within the `0.0` and `1.0` range.
+
+The `setDutyCycleSync` method allows the configuration of the duty cycle of the PWM signal.
+The duty cycle is the ratio of the pulse width in one period.
+
+Configuration is done synchronously and will block till the duty cycle is configured.
+
+**Example**
+```js
+pwm0.setDutyCycleSync(1);
+// prints: done
+console.log('done');
+```
+
+
+### pwmpin.setEnable(enable[, callback])
+* `enable` {boolean}
+* `callback` {Function}
+  * `err` {Error|null} The error object or `null` if there were no error.
+
+The `setEnable` method can turn on/off the generation of the PWM signal.
+If the `enable` argument is `true` then the PWN signal generation is turned on.
+Otherwise the signal generation is turned off.
+
+After enabling/disabling the signal generation the `callback` is invoked.
+
+**Example**
+```js
+pwm0.setEnable(true, function(err) {
+  if (err) {
+    throw err;
+  }
+  console.log('done');
+});
+// prints: do
+console.log('do');
+// prints: done
+```
+
+
+### pwmpin.setEnableSync(enable)
+* `enable` {boolean}
+
+The `setEnableSync` method can turn on/off the generation of the PWM signal.
+If the `enable` argument is `true` then the PWN signal generation is turned on.
+Otherwise the signal generation is turned off.
+
+**Example**
+```js
+pwm0.setEnableSync(false);
+// prints: done
+console.log('done');
+```
+
+
+### pwmpin.close([callback])
+* `callback` {Function}
+  * `err` {Error|null} The error object or `null` if there were no error.
+
+The `close` method closes the PWM pin asynchronously.
+
+The `callback` method will be invoked after the PWM device is released.
+
+**Example**
+```js
+pwm0.close(function(err) {
+  if (err) {
+    throw err;
+  }
+  console.log('done');
+});
+// prints: do
+console.log('do');
+// prints: done
+```
+
+
+### pwmpin.closeSync()
+
+The `closeSync` method closes the PWM pin synchronously.
+
+**Example**
+```js
+pwm0.closeSync();
+// prints: done
+console.log('done');
+```
diff --git a/docs/api/IoT.js-API-Process.md b/docs/api/IoT.js-API-Process.md
new file mode 100644 (file)
index 0000000..b6b5fb7
--- /dev/null
@@ -0,0 +1,244 @@
+### Platform Support
+
+The following shows process module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| process.nextTick | O | O | O |
+| process.exit | O | O | O |
+| process.cwd | O | O | O |
+| process.chdir | O | O | O |
+
+※ On NuttX, you should pass absolute path to `process.chdir`.
+
+# Process
+
+The `process` object is a global that provides information about, and control over, the current IoT.js process.
+As a global, it is always available to IoT.js applications without using `require()`.
+
+### process.arch
+* {string}
+
+The `arch` property returns the processor architecture identifier that the IoT.js process is currently running on.
+For instance `'arm'`, `'ia32'`, `'x64'`, or `'unknown'`.
+
+### process.argv
+* {Array}
+
+The `argv` property returns an array containing the command line arguments passed when the IoT.js
+process was launched. The first element is the path to the IoT.js program.
+The second element is the path of the JavaScript file currently being executed.
+The remaining elements will be any additional arguments passed via command line.
+
+**Example**
+
+To print out all command line arguments the following example could be used:
+
+```js
+process.argv.forEach(function(val, idx) {
+  console.log('index: ' + idx + ' value: ' + val);
+});
+```
+
+### process.env
+* {Object}
+
+The `env` property returns an object containing a few environment variables.
+The following environment elements can be accessed:
+* `HOME`
+* `IOTJS_PATH` which is set to `/mnt/sdcard` on NuttX by default.
+* `env` contains `'experimental'` if the IoT.js was build with experimental support.
+
+**Example**
+
+```js
+console.log('HOME: ' + process.env.HOME);
+// prints: HOME: /home/user
+```
+
+### process.exitCode
+* {integer} **Default:** `0`
+
+The `exitCode` property can be used to specify the exit code of the IoT.js process.
+This will be used when the process exits gracefully, or exited via `process.exit()` without specifying an exit code.
+
+Specifying an exit code for the `process.exit()` call will override any previous setting of `process.exitCode`.
+
+### process.iotjs
+* {Object}
+
+The `iotjs` property holds IoT.js related information in an object.
+The following keys can be accessed via this property:
+* `board` specifies the device type on which the IoT.js is running currently. For instance `'STM32F4DIS'`, `'RP2'`, or `'unknown'`.
+
+**Example**
+
+```js
+console.log(process.iotjs.board);
+// on Raspberry 2 it prints: RP2
+```
+
+### process.platform
+* {string}
+
+The `platform` returns the identification of the operating system the IoT.js process
+is currently running on. For instance `'linux'`, `'darwin'`, `'nuttx'`, `'tizenrt'`, or `'unknown'`.
+
+
+### process.chdir(path)
+* `path` {string} The path to change working directory to.
+
+The `chdir` method changes the current working directory of the IoT.js process or
+throws an exception if the operation fails (for instance the `path` specified does not exist).
+
+**Example**
+
+```js
+try {
+  process.chdir('/invalid/path');
+} catch(err) {
+  console.log('invalid path');
+}
+// prints: invalid path
+```
+
+### process.cwd()
+* Returns: {string}
+
+The `cwd()` call returns the current working directory of the IoT.js process.
+
+**Example**
+
+```js
+console.log('Current dir: ' + process.cwd());
+```
+
+### process.exit([code])
+* `code` {integer} The exit code. **Default:** `0`
+
+The `exit()` method instructs the IoT.js to terminate the process synchronously with an exit status of `code`.
+If `code` is not specified, exit uses the `process.exitCode` value which defaults to `0`.
+IoT.js will not exit till all `'exit'` event listeners are called.
+
+The `process.exit()` method call will force the process to exit as quickly as possible,
+ignoring if there is any asynchronous operations still pending.
+
+In most situations, it is not necessary to explcitly call `process.exit()`. The IoT.js will exit on its own
+if there is no additional work pending in the event loop. The `process.exitCode` property can be set
+to exit code when the process exits gracefully.
+
+If it is necessary to terminate the IoT.js process due to an error condition, throwing an
+uncaught error and allowing the process to terminate accordingly is advised instead of calling `process.exit()`.
+
+**Example**
+
+To exit with a failure code:
+
+```js
+process.exit(1);
+```
+The shell that executed the IoT.js should see the returned exit code as `1`.
+
+To set the exit code on graceful exit:
+
+```js
+doSomeWork()
+process.exitCode = 1;
+```
+
+### process.nextTick(callback)
+* `callback` {Function}
+
+The `nextTick` method adds the `callback` method to the "next tick queue".
+Once the current turn of the event loop is completed, all callbacks currently in the next tick queue will be called.
+
+This is not a simple alias to `setTimeout` call. It runs before any additional I/O events.
+
+**Example**
+```js
+console.log('step 1');
+process.nextTick(function() {
+  console.log('step 2');
+});
+console.log('step 3');
+// prints:
+// step 1
+// step 3
+// step 2
+```
+
+### process.version
+* {string}
+
+The `version` property returns the version numbering of the currently running IoT.js process as a string.
+
+**Example**
+```js
+console.log(process.version);
+// prints: (in case of version 1.0.0)
+// 1.0.0
+```
+
+### Event: 'exit'
+* `callback` {Function}
+  * `code` {integer}  exitCode
+
+The `'exit'` event is emitted when the IoT.js process is about to exit.
+This can happen two ways:
+* The `process.exit()` method was called explicitly;
+* The IoT.js event loop does not have any additional work to perform.
+
+There is no way to prevent the exiting, and once all `'exit'` listeners have finished
+running the process will terminate.
+
+The listener callback function is invoked with the exit code specified either by the
+`process.exitCode` property, or the `exitCode` argument passed to the `process.exit()` method.
+
+Listener functions *must* only perform *synchronous* operations. The IoT.js process will exit
+immediately after calling the `'exit'` event listeners causing any additional work still queued
+to be abandoned.
+
+**Example**
+
+```js
+process.on('exit', function(code) {
+  console.log('exited with: ' + code);
+});
+```
+
+### Event: 'uncaughtException'
+* `callback` {Function}
+  * `err` {Error} error object uncaught by catch handler
+
+The `'uncaughtException'` event is emitted when an uncaught JavaScript exception bubbles all the
+way back to the event loop. By default, IoT.js handles such exceptions by printing it to `stderr` and exiting.
+Adding a handler for the `'uncaughtException'` event overrides the default behavior.
+
+The listener function is called with the `Error` object passed as the only argument.
+
+**Warning: Using the `'uncaughtException'` event correctly**
+
+This event is a crude mechanism for exception handling intended to be used only as a last resort.
+The event should not be used as an eqivalent to 'On Error Resume Next'. Unhandled exceptions inherently mean
+that a program is in an unknown state. Thus attempting to resume the application code without properly
+recovering from the exception can cause unforeseen/unpredictable issues.
+
+Only one exception thrown within the event handler will be caught and will immediately terminate the application.
+
+The correct use of the event is to perform synchronous cleanup of allocated resources (e.g. file descriptors, handles, etc)
+before shutting down the process. **It is not safe to resume normal operation after this event**.
+
+To restart a crashed application in a more reliable way, whether uncaughtException is emitted or not,
+an external monitoring application should be employed in a separate process to detect application failures and
+recover or restart as needed.
+
+**Example**
+
+```js
+process.on('uncaughtException', function(err) {
+  console.log('Something went wrong: ' + err);
+});
+
+nonExistentFunctionCall();
+console.log('This will not be printed.');
+```
diff --git a/docs/api/IoT.js-API-SPI.md b/docs/api/IoT.js-API-SPI.md
new file mode 100644 (file)
index 0000000..731445d
--- /dev/null
@@ -0,0 +1,164 @@
+### Platform Support
+
+The following shows spi module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| spi.open | O | O | O |
+| spibus.transfer | O | O | O |
+| spibus.transferSync | O | O | O |
+| spibus.close | O | O | O |
+| spibus.closeSync | O | O | O |
+
+
+## Class: SPI
+
+SPI (Serial Peripheral Interface) is a communication protocol which defines a way to communicate between devices.
+
+On NuttX, you have to know the number of pins that is defined on the target board module. For more information, please see the list below.
+  * [STM32F4-discovery](../targets/nuttx/stm32f4dis/IoT.js-API-Stm32f4dis.md)
+
+### new SPI()
+
+Returns a new SPI object which can open SPI bus.
+
+### SPI.MODE
+The clock polarity and the clock phase can be specified as `0` or `1` to form four unique modes to provide flexibility in communication between devices. The `SPI.MODE` will specify which one to use (the combinations of the polarity and phase).
+
+* `0` Clock Polarity(0), Clock Phase(0), Clock Edge(1)
+* `1` Clock Polarity(0), Clock Phase(1), Clock Edge(0)
+* `2` Clock Polarity(1), Clock Phase(0), Clock Edge(1)
+* `3` Clock Polarity(1), Clock Phase(1), Clock Edge(0)
+
+
+### SPI.CHIPSELECT
+* `NONE`
+* `HIGH`
+
+The chip select is an access-enable switch. When the chip select pin is in the `HIGH` state, the device responds to changes on its input pins.
+
+### SPI.BITORDER
+* `MSB` The most significant bit.
+* `LSB` The least significant bit.
+
+Sets the order of the bits shifted out of and into the SPI bus, either MSB (most-significant bit first) or LSB (least-significant bit first).
+
+### spi.open(configuration[, callback])
+* `configuration` {Object}
+  * `device` {string} The specified path for `spidev`. (only on Linux)
+  * `bus` {number} The specified bus number. (only on NuttX)
+  * `mode` {SPI.MODE} The combinations of the polarity and phase. **Default:** `SPI.MODE[0]`.
+  * `chipSelect` {SPI.CHIPSELECT} Chip select state. **Default:** `SPI.CHIPSELECT.NONE`.
+  * `maxSpeed` {number} Maximum transfer speed. **Default:** `500000`.
+  * `bitsPerWord` {number} Bits per word to send (should be 8 or 9). **Default:** `8`.
+  * `bitOrder` {SPI.BITORDER} Order of the bits shifted out of and into the SPI bus. Default: `SPI.BITORDER.MSB`.
+  * `loopback` {boolean} Using loopback. **Default:** `false`.
+* `callback` {Function}.
+  * `err` {Error|null}.
+* Returns: {SPIBus}.
+
+Opens an SPI device with the specified configuration.
+
+**Example**
+
+```js
+
+var Spi = require('spi');
+var spi = new Spi();
+var spi0 = spi.open({
+  device: '/dev/spidev0.0'
+  }, function(err) {
+    if (err) {
+      throw err;
+    }
+});
+
+```
+
+## Class: SPIBus
+
+The SPIBus is commonly used for communication.
+
+### spibus.transfer(txBuffer, rxBuffer[, callback])
+* `txBuffer` {Array|Buffer}.
+* `rxBuffer` {Array|Buffer}.
+* `callback` {Function}.
+  * `err` {Error|null}.
+
+Writes and reads data from the SPI device asynchronously.
+The `txBuffer` and `rxBuffer` must have equal length.
+
+**Example**
+
+```js
+
+var tx = new Buffer('Hello IoTjs');
+var rx = new Buffer(tx.length);
+spi0.transfer(tx, rx, function(err) {
+  if (err) {
+    throw err;
+  }
+
+  var value = '';
+  for (var i = 0; i < tx.length; i++) {
+    value += String.fromCharCode(rx[i]);
+  }
+  console.log(value);
+});
+
+```
+
+### spibus.transferSync(txBuffer, rxBuffer)
+* `txBuffer` {Array|Buffer}.
+* `rxBuffer` {Array|Buffer}.
+
+Writes and reads data from the SPI device synchronously.
+The `txBuffer` and `rxBuffer` must have equal length.
+
+**Example**
+
+```js
+
+var tx = new Buffer('Hello IoTjs');
+var rx = new Buffer(tx.length);
+spi0.transferSync(tx, rx);
+var value = '';
+for (var i = 0; i < tx.length; i++) {
+  value += String.fromCharCode(rx[i]);
+}
+console.log(value);
+
+```
+
+### spibus.close([callback])
+* `callback` {Function}.
+  * `err` {Error|null}.
+
+Closes the SPI device asynchronously.
+
+The `callback` function will be called after the SPI device is closed.
+
+**Example**
+```js
+
+spi0.close(function(err) {
+  if (err) {
+    throw err;
+  }
+  console.log('spi bus is closed');
+});
+
+```
+
+### spibus.closeSync()
+
+Closes the SPI device synchronously.
+
+**Example**
+```js
+
+spi.closeSync();
+
+console.log('spi bus is closed');
+
+```
diff --git a/docs/api/IoT.js-API-Stream.md b/docs/api/IoT.js-API-Stream.md
new file mode 100644 (file)
index 0000000..97ccddc
--- /dev/null
@@ -0,0 +1,476 @@
+### Platform Support
+
+The following shows stream module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| readable.isPaused | O | O | O |
+| readable.pause | O | O | O |
+| readable.read | O | O | O |
+| readable.resume | O | O | O |
+| writable.end | O | O | O |
+| writable.write | O | O | O |
+
+# Stream
+
+A stream is an abstract interface for working with streaming data.
+Streams can be readable, writable, or both (duplex). All streams
+are instances of EventEmitter.
+
+## Class: Stream
+
+### new Stream()
+
+**This method is only for implementing a new stream type.**
+
+This function registers the common properties of all streams.
+
+**Example**
+
+```js
+var Stream = require('stream').Stream;
+
+var stream = new Stream();
+
+stream.read = function () {
+  // A custom read function.
+}
+```
+
+
+## Class: Stream.Readable
+
+Readable stream is an abstraction for a *data source* from
+which data will be read. At any time a readable stream operates
+in one of two modes: *flowing* and *paused*. All streams begin
+in paused mode.
+
+In paused mode the stream emits [`'readable'`](#event-readable)
+event every time a new data is available for read. This data can
+be read by calling the [`readable.read()`](#readablereadsize)
+function. A stream can be switched to paused mode by calling
+the [`readable.pause()`](#readablepause) function.
+
+In flowing mode the stream emits [`'data'`](#event-data) events
+every time when data is received. The data buffer is passed to
+the callback function. A stream can be switched to flowing mode
+by calling the [`readable.resume()`](#readableresume) function
+or by adding a [`'data'`](#event-data) event handler.
+
+Supported events:
+
+### Event: 'close'
+
+Emitted when the underlying resource has been closed and no more
+events will be emitted. Not all [`Readable`](#class-streamreadable)
+streams will emit the `'close'` event.
+
+
+### Event: 'data'
+* `chunk` {Buffer|string}
+
+Emitted when the stream passes the ownership of the data to a
+consumer. Only streams in flowing mode emit this event.
+
+A stream can be switched to flowing mode by calling the
+[`readable.resume()`](#readableresume) function or by adding
+a `'data'` event handler.
+
+**Example**
+
+```js
+var Readable = require('stream').Readable;
+
+var readable = new Readable();
+
+readable.on('data', function (chunk) {
+  // prints: data received: message
+  console.log('data received: ' + chunk);
+})
+
+readable.push("message");
+```
+
+
+### Event: 'end'
+
+Emitted when there is no more data to be consumed from the stream.
+
+**Example**
+
+```js
+var Readable = require('stream').Readable;
+
+var readable = new Readable();
+
+readable.on('end', function () {
+  // prints: no more data
+  console.log('no more data');
+})
+
+readable.push(null);
+```
+
+
+### Event: 'error'
+* `error` {Object}
+
+Emitted when an error is detected by the readable stream. This event
+may occure any time.
+
+### Event: 'readable'
+
+Emitted when there is data available to be read from the stream.
+This event will also be emitted once the end of the stream data
+has been reached but before the ['end'](#event-end) event is emitted.
+
+**Example**
+
+```js
+var Readable = require('stream').Readable;
+
+var readable = new Readable();
+
+readable.on('readable', function () {
+  // prints:.
+  console.log('data received: ' + this.read());
+})
+
+readable.push('message');
+```
+
+
+### new Readable(options)
+* `options` {Object}
+  * `defaultEncoding` {string} **Default:** `utf8`
+
+**This method is only for implementing a new
+[`Readable`](#class-streamreadable) stream type.**
+
+This function registers the common properties
+of [`Readable`](#class-streamreadable) streams.
+
+The `options` object allows passing configuration
+arguments. The `Readable` constructor only supports
+a few members of the `options` object but descendants
+may supports more of them.
+
+**Example**
+
+```js
+var Readable = require('stream').Readable;
+
+var readable = new Readable({ defaultEncoding: 'utf8' });
+```
+
+
+### readable.isPaused()
+* Returns: {boolean}
+
+Returns `true` if the [`Readable`](#class-streamreadable)
+stream is in paused mode. Otherwise the stream is in
+flowing mode. By default the stream starts in paused mode.
+
+**Example**
+
+```js
+var Readable = require('stream').Readable;
+
+var readable = new Readable();
+
+// prints: true
+console.log(readable.isPaused());
+```
+
+### readable.pause()
+* Returns: {Readable}
+
+Stops emitting [`'data'`](#event-data) events if the
+stream is in flowing mode and sets paused mode. No
+effect otherwise.
+
+**Example**
+
+```js
+var Readable = require('stream').Readable;
+
+var readable = new Readable();
+
+readable.pause();
+```
+
+
+### readable.read([size])
+* `size` {number} Specify how much data will be read.
+* Returns: {Buffer|null}
+
+The `readable.read()` method pulls some data out of the
+internal buffer and returns it. If no data is available
+`null` is returned instead.
+
+Note: currently all data must be read.
+
+**Example**
+
+```js
+var Readable = require('stream').Readable;
+
+var readable = new Readable();
+
+// prints: null
+console.log(readable.read());
+
+readable.push('message');
+
+// prints: message
+console.log(readable.read());
+```
+
+
+### readable.resume()
+* Returns: {Readable}
+
+Starts emitting [`'data'`](#events-data) events if the
+stream is in paused mode and sets flowing mode. No effect
+otherwise.
+
+**Example**
+
+```js
+var Readable = require('stream').Readable;
+
+var readable = new Readable();
+
+readable.resume();
+```
+
+
+### readable.push(chunk)
+* `chunk` {Buffer|string}
+
+**This method is only for implementing a new
+[`Readable`](#class-streamreadable) stream type.**
+
+Push a chunk of data to the underlying `Buffer` of
+this stream. The data can be read by using
+either [`readable.read()`](#readablereadsize) method
+or [`'data'`](#event-data) event of this stream.
+
+**Example**
+
+```js
+var Readable = require('stream').Readable;
+
+var readable = new Readable();
+
+readable.push('message');
+
+// prints: message
+console.log(readable.read());
+```
+
+
+# Class: Stream.Writable
+
+Writable stream is an abstraction for a *destination*
+to which data is written. Several functions of the
+Stream.Writable class are abstract interfaces and
+descendants can override them. The
+[`new Stream.Writable()`](#new-streamwritableoptions)
+constructor must be used for initializing a
+writable stream and
+[`writable._write()`](#writable_writechunk-callback-onwrite)
+method are required to be implemented.
+
+
+Supported events:
+
+### Event: 'drain'
+
+If [`writable.write()`](#writablewritechunk-callback)
+returns `false` the stream emits a `drain` event when
+it is appropriate to resume writing data into the stream.
+
+**Example**
+
+```js
+var Writable = require('stream').Writable;
+
+// Buffer is full after 1 byte of data.
+var writable = new Writable({ highWaterMark:1 });
+
+writable._write = function(chunk, callback, onwrite) {
+  onwrite();
+}
+
+// Writes 1 byte data into the stream.
+writable.write("X");
+
+writable.on('drain', function() {
+  // prints: can continue writing
+  console.log('can continue writing');
+});
+
+writable._readyToWrite();
+```
+
+
+### Event: 'error'
+* `err` {Error}
+
+Emitted if an error occures during writing the data.
+
+
+### Event: 'finish'
+
+Emitted after [`writable.end()`](#writableendchunk-callback)
+has been called and all pending data has been flushed.
+
+**Example**
+
+```js
+var Writable = require('stream').Writable;
+
+var writable = new Writable();
+
+writable.on('finish', function() {
+  // prints: end of writing
+  console.log('end of writing');
+});
+
+writable.end();
+```
+
+
+### new Stream.Writable([options])
+* `options` {Object}
+  * `highWaterMark` {number}
+
+**This method is only for implementing a new
+[`Writable`](#class-streamwritable) stream type.**
+
+This function registers the common properties
+of [`Writable`](#class-streamwritable) streams.
+
+When the size of the internal buffer reaches
+`options.highWaterMark` the
+[`writable.write()`](#writablewritechunk-callback)
+method starts returning with `false` and the data
+should be drained before further data is written.
+
+**Example**
+
+```js
+var Writable = require('stream').Writable;
+
+var writable = new Writable({ highWaterMark:256 });
+```
+
+
+### writable.end([chunk[, callback]])
+* `chunk` {Buffer|string} Final data to write.
+* `callback` {Function}
+
+Calling this function signals that no more data will
+be written to the Writable. The optional `chunk`
+argument allows writing a final chunk of data.
+If `chunk` is `null` no data is written.
+
+The optional `callback` function is attached
+as a listener for the ['finish'](#event-finish) event.
+
+**Example**
+
+```js
+var Writable = require('stream').Writable;
+
+var writable = new Writable();
+
+writable.end();
+```
+
+
+### writable.write(chunk[, callback])
+* `chunk` {Buffer|string} Data to write.
+* `callback` {Function} Called when this chunk of data is flushed.
+* Returns: {boolean}
+
+Converts `chunk` into a sequence of bytes and writes this data
+to the stream. An optional `callback` function is called when
+the data is flushed.
+
+The returned value is `true` if writing can be continued
+right after calling this method. Otherwise the returned
+value is `false` and no data should be written until the
+[`'drain'`](#event-drain) event is received.
+
+**Example**
+
+```js
+var Writable = require('stream').Writable;
+
+var writable = new Writable();
+
+writable.write("String");
+```
+
+
+### writable._readyToWrite()
+
+**This method is only for implementing a new
+[`Writable`](#class-streamwritable) stream type.**
+
+This method informs the [`Writable`](#class-streamwritable)
+stream that the implementation is ready for receiving data.
+
+**Example**
+
+```js
+var Writable = require('stream').Writable;
+
+var writable = new Writable();
+
+writable._readyToWrite();
+```
+
+
+### writable._write(chunk, callback, onwrite)
+* `chunk` {Buffer|string} The data to be written by the stream.
+* `callback` {Function} Callback to be called when the chunk of data is flushed.
+* `onwrite` {Function} Internal Callback to be called for when the chunk of data is flushed.
+
+**This method is only for implementing a new
+[`Writable`](#class-streamwritable) stream type.**
+
+This internal method is called by the
+[`Writable`](#class-streamwritable) stream and the implementation
+**must** override it. The data to be written is passed as the
+`chunk` argument. After the operation is completed, both
+`callback` and `onwrite` function should be called.
+
+**Example**
+
+```js
+var Writable = require('stream').Writable;
+
+var writable = new Writable();
+
+writable._write = function(chunk, callback, onwrite) {
+  // prints: message
+  console.log(chunk);
+
+  onwrite();
+  if (callback)
+    callback();
+}
+
+writable._readyToWrite();
+
+writable.write('message');
+```
+
+
+# Class: Stream.Duplex
+
+Duplex streams are streams that implement both the
+Readable and Writable interfaces.
diff --git a/docs/api/IoT.js-API-Timers.md b/docs/api/IoT.js-API-Timers.md
new file mode 100644 (file)
index 0000000..ee43643
--- /dev/null
@@ -0,0 +1,92 @@
+### Platform Support
+
+The following shows timer module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| setTimeout | O | O | O |
+| clearTimeout | O | O | O |
+| setInterval | O | O | O |
+| clearInterval | O | O | O |
+
+
+# Timers
+
+The `timer` module exposes a global API for scheduling functions to be called at some future period of time. Because the timer functions are globals, there is no need to call require('timers') to use the API.
+
+
+### setTimeout(callback, delay[, args..])
+
+* `callback` {Function} The function to call when the timer elapses.
+  * `...args` {any}
+* `delay` {number} The number of milliseconds to wait before calling the `callback`.
+* `...args` {any} - Optional arguments to pass when the `callback` is called.
+* Returns: {Timeout}
+
+Schedules execution of a one-time `callback` after `delay` milliseconds. Returns a `Timeout` for use with `clearTimeout()`. If `callback` is not a function, a `TypeError` will be thrown.
+
+**Example**
+
+```js
+var timeout = setTimeout(function() {
+  // Do something which will be executed after one second.
+}, 1000);
+```
+
+### clearTimeout(timeout)
+
+* `timeout` {Timeout} A Timeout object returned by `setTimeout()`.
+
+Cancels a `Timeout` object created by `setTimeout()`.
+
+**Example**
+
+```js
+var timeout = setTimeout(function() { }, 1000);
+...
+clearTimeout(timeout);
+```
+
+### setInterval(callback, delay[, args..])
+* `callback` {Function} The function to call when the timer elapses.
+  * `...args` {any}
+* `delay` {number} The number of milliseconds to wait before calling the `callback`.
+* `...args` {any} - Optional arguments to pass when the `callback` is called.
+* Returns: {Timeout}
+
+Schedules repeated execution of `callback` every `delay` milliseconds. Returns a `Timeout` object for use with `clearInterval()`. If `callback` is not a function, a `TypeError` will be thrown.
+
+**Example**
+
+```js
+var timeout = setInterval(function() {
+  // Do something which will be executed repeatadly one time per second.
+}, 1000);
+```
+
+### clearInterval(timeout)
+
+* `timeout` {Timeout} A Timeout object as returned by `setInterval()`.
+
+Cancels a `Timeout` object created by `setInterval()`.
+
+**Example**
+
+```js
+var timeout = setInterval(function() { }, 1000);
+...
+clearInterval(timeout);
+```
+
+## Class: Timeout
+
+This object is created internally and is returned from `setTimeout()` and `setInterval()`.
+
+
+### timeout.ref()
+
+When called, requests that the IoT.js event loop should not exit as long as the `Timeout` is active.
+
+### timeout.unref()
+
+When called, the active `Timeout` object will not force the IoT.js event loop to remain active. If there are no other scheduled activites, the process may exit, the process may exit before the `Timeout` object's callback is invoked.
diff --git a/docs/api/IoT.js-API-UART.md b/docs/api/IoT.js-API-UART.md
new file mode 100644 (file)
index 0000000..b71f00e
--- /dev/null
@@ -0,0 +1,127 @@
+### Platform Support
+
+The following shows uart module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| uart.open | O | O | O |
+| uartport.write | O | O | O |
+| uartport.writeSync | O | O | O |
+| uartport.close | O | O | X |
+| uartport.closeSync | O | O | X |
+
+## Class: UART
+
+The UART (Universal Asynchronous Receiver/Transmitter) class supports asynchronous serial communication.
+
+### new UART()
+
+Returns with a new UART object.
+
+### uart.open(configuration[, callback])
+* `configuration` {Object}
+  * `device` {string} Mandatory configuration.
+  * `baudRate` {number} Specifies how fast data is sent over a serial line. **Default:** `9600`.
+  * `dataBits` {number} Number of data bits that are being transmitted. **Default:** `8`.
+* `callback` {Function}.
+  * `err` {Error|null}.
+* Returns: {UARTPort}.
+
+Opens an UARTPort object with the specified configuration.
+
+The `baudRate` must be equal to one of these values: [0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400].
+
+The `dataBits` must be equal to one of these values: [5, 6, 7, 8].
+
+On NuttX, you also need to set the properties of the `configuration` in the NuttX configuration file. Using the NuttX menuconfig, it can be found at the `Device Drivers -> Serial Driver Support -> U[S]ART(N) Configuration` section.
+
+You can read more information about the usage of the UART on stm32f4-discovery board: [STM32F4-discovery](../targets/nuttx/stm32f4dis/IoT.js-API-Stm32f4dis.md#uart).
+
+**Example**
+
+```js
+
+var Uart = require('uart');
+
+var uart = new Uart();
+var configuration = {
+  device: '/dev/ttyUSB0'
+  baudRate: 115200,
+  dataBits: 8,
+}
+
+var serial = uart.open(configuration, function(err) {
+  // Do something.
+});
+
+```
+
+## Class: UARTPort
+The UARTPort class is responsible for transmitting and receiving serial data.
+
+### uartport.write(data[, callback]).
+* `data` {string}.
+* `callback` {Function}.
+  * `err` {Error|null}.
+
+Writes the given `data` to the UART device asynchronously.
+
+**Example**
+
+```js
+
+serial.write('Hello?', function(err) {
+  if (err) {
+    // Do something.
+  }
+  serial.close();
+});
+
+```
+
+### uartport.writeSync(data)
+* `data` {string}.
+
+Writes the given `data` to the UART device synchronously.
+
+**Example**
+
+```js
+
+serial.writeSync('Hello?');
+
+serial.close();
+
+```
+
+### uartport.close([callback])
+* `callback` {Function}.
+  * `err` {Error|null)}.
+
+Closes the UART device asynchronously.
+
+On NuttX/STM32F4Discovery, Uart.close() blocks after close().
+It seems that poll() does not work properly on NuttX for some cases.
+
+### uartport.closeSync()
+
+Closes the UART device synchronously.
+
+On NuttX/STM32F4Discovery, Uart.close() blocks after close().
+It seems that poll() does not work properly on NuttX for some cases.
+
+### Event: 'data'
+* `callback` {Function}
+  * `data` {string} A string from the sender.
+
+**Example**
+
+```js
+
+/* ... */
+
+serial.on('data', function(data) {
+  console.log('read result: ' + data.toString());
+});
+
+```
diff --git a/docs/api/IoT.js-API-reference.md b/docs/api/IoT.js-API-reference.md
new file mode 100644 (file)
index 0000000..1366db3
--- /dev/null
@@ -0,0 +1,27 @@
+# IoT.js modules
+## Basic API
+* [Assert](IoT.js-API-Assert.md)
+* [Buffer](IoT.js-API-Buffer.md)
+* [DNS](IoT.js-API-DNS.md)
+* [Events](IoT.js-API-Events.md)
+* [File System](IoT.js-API-File-System.md)
+* [HTTP](IoT.js-API-HTTP.md)
+* [Module](IoT.js-API-Module.md)
+* [Net](IoT.js-API-Net.md)
+* [Process](IoT.js-API-Process.md)
+* [Timers](IoT.js-API-Timers.md)
+
+## Extended API
+* [(ADC)](IoT.js-API-ADC.md)
+* [(BLE)](IoT.js-API-BLE.md)
+* [(GPIO)](IoT.js-API-GPIO.md)
+* [(I2C)](IoT.js-API-I2C.md)
+* [(PWM)](IoT.js-API-PWM.md)
+* [(SPI)](IoT.js-API-SPI.md)
+* [(UART)](IoT.js-API-UART.md)
+* [UDP/Datagram](IoT.js-API-DGRAM.md)
+
+## Abstract interfaces
+* [Stream](IoT.js-API-Stream.md)
+
+*() not supported by node.js
diff --git a/docs/build/Build-Script.md b/docs/build/Build-Script.md
new file mode 100644 (file)
index 0000000..fbb03fd
--- /dev/null
@@ -0,0 +1,244 @@
+## Overview
+
+build.py help you build IoT.js.
+
+It locates in "./tools" directory of source tree.
+
+It automatically creates a directory where build object and outputs will be generated, 
+checks configurations, tidiness of source code, licenses, and more.
+Also it downloads, updates and builds submodules.
+And finally generate IoT.js binary.
+
+
+## How to use
+
+You can build IoT.js with default setting for your host machine with;
+```
+./tools/build.py
+```
+The command will generate runnable IoT.js binary in "./build/<arch-os>/debug/bin/iotjs".
+
+You can also build release binary with;
+```
+./tools/build.py --buildtype=release
+```
+
+## Parameters Candidates
+**NOTE: some parameters are not supported by current version of build.py**
+
+--
+#### `--buildtype`
+* `release` | `debug`
+
+Specify whether build output will be for 'debug' or 'release'.
+
+```
+./tools/build.py --buildtype=release
+```
+
+--
+#### `--builddir`
+
+Specify a directory where build outputs will be generated.
+
+If given path is not exist, build.py will create it.
+
+```
+./tools/build.py --builddir=./build
+```
+
+--
+#### `--clean`
+With given this option, build.py will clear all the build directory before start new build.
+
+```
+./tools/build.py --clean
+```
+
+--
+#### `--buildlib`
+With given this option, build.py will generate IoT.js output as a library.
+
+```
+./tools/build.py ---buildlib
+```
+
+--
+#### `--target-arch`
+* `arm` | `x86` | `i686` | `x86_64` | `x64`
+
+Specify target architecture.
+
+```
+./tools/build.py --target-arch=arm
+```
+--
+#### `--target-os`
+* `linux` | `darwin` | `osx` | `nuttx`
+
+Specify target OS.
+
+```
+./tools/build.py --target-os=nuttx --target-arch=arm
+```
+
+--
+#### `--target-board`
+* `stm32f4dis` | empty
+
+Specify target board.
+
+```
+./tools/build.py --target-os=nuttx --target-arch=arm --target-board=stm32f4dis
+```
+--
+#### `--cmake-param`
+Specify CMake parameters for IoT.js.
+
+"cmake" command for IoT.js will be executed with the given parameter applied.
+
+If you have multiple parameters, supply it with multiple use of this option;
+
+```
+./tools/build.py --cmake-param="..." --cmake-param="..."
+```
+
+--
+#### `--compile-flag`
+Specify C compiler flags for IoT.js.
+
+If you have multiple compile flags, supply it with multiple use of this option;
+```
+./tools/build.py --compile-flag="..." --compile-flag="..."
+```
+
+--
+#### `--link-flag`
+Specify linker flags for IoT.js.
+
+If you have multiple link flags, supply it with multiple use of this option;
+```
+./tools/build.py --link-flag="..." --link-flag="..."
+```
+
+--
+#### `--external-include-dir`
+Specify external include directory for IoT.js.
+
+If you have multiple external include directoies, supply it with multiple use of this option;
+```
+./tools/build.py --external-include-dir="..." --external-include-dir="..."
+```
+
+--
+#### `--external-static-lib`
+Specify external static library that will be liked with IoT.js statically.
+
+If you have multiple such libraries, supply it with multiple use of this option;
+```
+./tools/build.py --external-static-lib="libxxx.a"
+```
+
+--
+#### `--jerry-cmake-param`
+Specify CMake parameters for JerryScript.
+
+"cmake" command for JerryScript will be executed with the given parameter applied.
+
+If you have multiple parameters, supply it with multiple use of this option
+
+--
+#### `--jerry-compile-flag`
+Specify C compiler flags for JerryScript.
+
+If you have multiple cflags, supply it with multiple use of this option
+
+```
+./tools/build.py --jerry-compile-flag="-DCONFIG_ECMA_LCACHE_DISABLE"
+```
+
+--
+#### `--jerry-link-flag`
+Specify linker flags for JerryScript.
+
+If you have multiple ldflags, supply it with multiple use of this option
+
+--
+#### `--jerry-heaplimit`
+Specify object heap limit for JerryScript engine.
+
+```
+./tools/build.py --jerry-heaplimit=80
+```
+
+--
+#### `--jerry-memstat`
+Enable memstat of JerryScript engine.
+
+```
+./tools/build.py --jerry-memstat
+```
+
+--
+#### `--jerry-lto`
+With given this option, JerryScript will be built with LTO.
+
+```
+./tools/build.py --jerry-lto
+```
+
+--
+#### `--no-init-submodule`
+With given this option, submoduls will not initialized before start build.
+
+```
+./tools/build.py --no-init-submodule
+```
+
+--
+#### `--no-check-tidy`
+With given this option, tidy checking will not performed.
+
+```
+./tools/build.py --no-check-tidy
+```
+
+--
+#### `--no-check-test`
+With given this option, unit test checking will not performed.
+
+```
+./tools/build.py --no-check-test
+```
+
+--
+#### `--no-parallel-build`
+With given this option, compilation process will not run in parallel. In other words, executes `make` without `-j` option.
+
+```
+./tools/build.py --no-parallel-build
+```
+
+--
+#### `--nuttx-home`
+To build for nuttx os, nuttx home directory must be given.
+
+```
+./tools/build.py --target-os=nuttx --target-arch=arm --target-board=stm32f4dis --nuttx-home="..."
+```
+
+--
+#### `--config`
+Specify build configuration file path.
+
+```
+./tools/build.py --config=build.arm.nuttx.stm32f4dis.config
+```
+
+`build.default.config` file is in the source tree for default setting.
+
+If this option is not specified, `build.config` file will be applied. If the file is not exist, it will be copied from `build.default.config`.
+
+Parameters specified by the config file is applied, and then the parameters given by command line overwrite over the settings.
+
+If you need to apply the same set of parameters for each build, making your own config file and trigger build.py with the config file would be more convenient.
\ No newline at end of file
diff --git a/docs/build/Build-for-ARTIK053-TizenRT.md b/docs/build/Build-for-ARTIK053-TizenRT.md
new file mode 100644 (file)
index 0000000..0951feb
--- /dev/null
@@ -0,0 +1,83 @@
+### About
+
+This directory contains files to run IoT.js on [TizenRT](https://github.com/Samsung/TizenRT).
+
+WARNING: **This document is not 100% accurate since Artik05x board with tooling is not available yet**
+
+### How to build
+
+#### 1. Set up the build environment for Artik05x board
+
+Clone IoT.js and TizenRT into iotjs-tizenrt directory
+
+```bash
+$ mkdir iotjs-tizenrt
+$ cd iotjs-tizenrt
+$ git clone https://github.com/Samsung/iotjs.git
+$ git clone https://github.com/Samsung/TizenRT.git tizenrt
+```
+The following directory structure is created after these commands
+
+```bash
+iotjs-tizenrt
+  + iotjs
+  |  + config
+  |      + tizenrt
+  |          + artik05x
+  + tizenrt
+```
+
+#### 2. Add IoT.js as a builtin application for TizenRT
+
+```bash
+$ cd tizenrt/apps/system
+$ mkdir iotjs
+$ cp ../../../iotjs/config/tizenrt/artik05x/app/* ./iotjs/
+```
+
+**WARNING: Manual modification is required**
+
+**WARNING: Below two bullet points are subject to change**
+
+* change tizenrt/apps/system/Kconfig to include iotjs folder
+    ```
+    menu "IoT.js node.js like Javascript runtime"
+    source "$APPSDIR/system/iotjs/Kconfig"
+    endmenu
+    ```
+* Libraries required to link iotjs have to be supplied in some way
+    ```
+    EXTRA_LIBS = -lhttpparser -liotjs -ljerrycore -ltuv -ljerry-libm
+    ```
+
+
+#### 3. Configure TizenRT
+
+```bash
+$ cd tizenrt/os/tools
+$ ./configure.sh sidk_s5jt200/hello_with_tash
+
+$ cd ..
+# might require to run "make menuconfig" twice
+$ make menuconfig
+```
+
+#### 4. Build IoT.js for TizenRT
+
+```bash
+$ cd iotjs
+$ ./tools/build.py --target-arch=arm --target-os=tizenrt --target-board=artik05x --sysroot=../tizenrt/os
+
+```
+
+#### 5. Build TizenRT
+
+```bash
+$ cd tizenrt/os
+IOTJS_LIB_DIR=../iotjs/build/arm-tizenrt/debug/lib make
+```
+Binaries are available in `tizenrt/build/output/bin`
+
+#### 6. Flashing
+
+Yet to be announced on [TizenRT page](https://github.com/Samsung/TizenRT#board)
diff --git a/docs/build/Build-for-ARTIK10-Tizen.md b/docs/build/Build-for-ARTIK10-Tizen.md
new file mode 100644 (file)
index 0000000..9a40ec5
--- /dev/null
@@ -0,0 +1,90 @@
+
+### 1. Tizen on ARTIK10 cross-compile
+
+#### Prerequisites
+
+* ARTIK10 with Tizen (https://wiki.tizen.org/wiki/Tizen_On_ARTIK)  
+* Tizen Studio with Native app development CLI tools.  
+  This is required to get rootstrap for Tizen (set of native libraries).  
+
+* arm-linux-gnueabi-gcc cross compiler (can be found in Tizen Studio / Native toolchain)  
+  Otherwise, you can install it on your PC.  
+```bash
+sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
+```
+
+#### Building
+1. Make sure arm-linux-gnueabi-gcc is in path. 
+2. Locate Tizen SDK. Default location is: ~/tizen-studio.  
+3. In platforms/tizen-3.0/mobile there should be compatible rootstrap (eg. mobile-3.0-device)  
+
+Compile:
+* Compile with rootstrap in case you use tizen 3.0 libraries.  
+``` bash
+tools/build.py \
+  --target-arch=arm --target-os=tizen --target-board=artik10 \
+  --compile-flag="--sysroot=~/tizen-studio/platforms/tizen-3.0/mobile/rootstraps/mobile-3.0-device.core/"
+```
+
+#### Testing
+Transfer iotjs binary and test file to the device:  
+``` bash
+sdb push ./build/arm-tizen/debug/bin/iotjs /home/owner/iotjs/
+sdb push ./test/run_pass/test_console.js /home/owner/iotjs/
+```
+
+Run the test:
+``` bash
+sdb shell
+$ cd /home/owner/iotjs
+$ ./iotjs test_console.js
+```
+
+
+### 2. Build with GBS
+
+#### Prerequisites
+* Tizen uses GBS to create RPM packages.  
+  SDB tool is in Tizen Studio. To send a file, please, install tizen studio.  
+  (https://developer.tizen.org/development/tizen-studio/download)  
+* To run GBS, please create a GBS configuration file at '~/.gbs.conf'  
+ (https://source.tizen.org/documentation/reference/git-build-system/configuration-file)  
+ You can use this sample, /config/tizen/sample.gbs.conf for GBS build.  
+``` bash
+sudo apt-get install gbs mic
+cp ./config/tizen/sample.gbs.conf ~/.gbs.conf
+```  
+Please add your Tizen.org id and password on this conf file.  
+
+#### Building
+* You can modify IoT.js build option on the spec file.  
+ (config/tizen/packaging/iotjs.spec)  
+* Run gbsbuild.sh at first.
+Compile:
+``` bash
+cp ./config/tizen/gbsbuild.sh ./
+./gbsbuild.sh
+```
+After finishing build, move to a new working directory at '../iotjs_tizen_gbs/'.  
+Next time, build with this basic command.
+```bash
+gbs build -A armv7l --include-all
+```
+
+#### Install
+Transfer iotjs binary and test file to the device:
+``` bash
+sdb push  ~/GBS-ROOT/local/repos/tizen_unified/armv7l/RPMS/iotjs-1.0.0-0.armv7l.rpm /tmp
+sdb push ./test/run_pass/test_console.js /home/owner/iotjs/
+sdb root on
+sdb shell
+(target)$ cd /tmp
+(only in headless Tizen 4.0 target)$ mount -o remount,rw
+(target)$ rpm -ivh --force iotjs-1.0.0.rpm
+```
+
+Run the test:
+``` bash
+sdb shell
+$ iotjs test_console.js
+```
diff --git a/docs/build/Build-for-RPi2-Linux.md b/docs/build/Build-for-RPi2-Linux.md
new file mode 100644 (file)
index 0000000..b244263
--- /dev/null
@@ -0,0 +1,141 @@
+
+IoT.js supports two build types:
+
+1. Build on your desktop. We support Linux(Ubuntu) and macOS. - Cross compile
+2. Build on Raspberry Pi 2.
+
+### Setting Raspberry Pi
+
+IoT.js officially supports Raspbian. For more information, please visit [the official site](https://www.raspberrypi.org/downloads/raspbian/).
+
+#### Enable the I2C interface
+
+To use I2C module, the I2C interface must be enabled.
+
+From the command line type:
+```bash
+sudo raspi-config
+```
+This will launch raspi-config utility.
+   * Select "9 Advanced Options"
+   * Select "A6 I2C"
+
+The screen will ask you to enable I2C interface.
+   * Select "Yes"
+   * Select "Ok"
+   * Select "Finish" to return to the command line.
+
+Reboot your Raspberry Pi.
+
+#### Enable the PWM interface
+
+Raspberry Pi2 has two PWM outputs on the following pins.
+
+| PWM Number | GPIO PIN(FUNC) |
+| :---: | :---: |
+| PWM0 | GPIO12(4), GPIO18(2) |
+| PWM1 | GPIO13(4), GPIO19(2) |
+
+To use PWM module, you must add PWM overlays in `/boot/config.txt` file.
+
+For example, to get a single PWM on GPIO18, add overlays like below.
+```
+dtoverlay=pwm,pin=18,func=2
+```
+
+For example, to get multi PWM on GPIO18 and GPIO19, add overlays like below.
+```
+dtoverlay=pwm-2chan,pin=18,func=2,pin2=19,func2=2
+```
+
+For more information about overlays, refer to [README](https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm/boot/dts/overlays/README).
+
+* Note that it is necessary to have root privileges in order to run PWM module.
+
+#### Enable the UART interface
+
+To use UART module, the UART interface must be enabled.
+
+In `/boot/config.txt` file, change the value of enable_uart from 0 to 1.
+```
+enable_uart=1
+```
+
+To disable the serial console, edit the file `/boot/cmdline.txt`.
+remove the word phase ```"console=serial0,115200"``` or ```"console=ttyAMA0,115200"```
+
+To enable the serial console, edit the file `/boot/cmdline.txt`.
+add the word phase ```"console=serial0,115200"``` or ```"console=ttyAMA0,115200"```
+
+Reboot your Raspberry Pi.
+
+* Note for Raspberry Pi 3 : You should use /dev/ttyS0 instead of /dev/ttyAMA0 in RPI3.
+
+### Build IoT.js on your desktop.
+
+#### Prerequisite
+##### Linux
+
+Install arm linux cross compiler.
+
+``` bash
+sudo apt-get install gcc-arm-linux-gnueabihf
+```
+
+##### macOS
+
+Install arm linux cross compiler via [this site](http://www.welzels.de/blog/en/arm-cross-compiling-with-mac-os-x/).
+
+The default location for arm linux compiler toolchain is **"/usr/local/linaro/arm-linux-gnueabihf-raspbian"**.
+
+Then you need to locate c_compiler.
+In **"./cmake/config/arm-linux.cmake"**,
+``` cmake
+SET(EXTERNAL_CMAKE_C_COMPILER
+    /usr/local/linaro/arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc)
+```
+In **"./deps/libtuv/cmake/config/config_arm-linux.cmake"**,
+``` cmake
+SET(CMAKE_C_COMPILER
+    /usr/local/linaro/arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc)
+```
+
+#### Build IoT.js (Cross compile)
+Give `target-arch`, `target-os` and `target-board` options to the script named 'build.py', then the script do the rest for you.
+
+``` bash
+./tools/build.py --buildtype=[release|debug] --target-arch=arm \
+ --target-os=linux --target-board=rpi2
+```
+
+#### Running in Raspberry Pi 2
+
+This script gives you `build/arm-linux/release/bin/iotjs` or `build/arm-linux/debug/bin/iotjs`.
+Copy this binary with your favorite tool or `scp` like below.
+
+``` bash
+scp build/arm-linux/release/bin/iotjs pi@(your RPi2 IP):/home/pi/.
+```
+
+Lastly, open a shell and run with your test program.
+
+``` bash
+ssh pi@(your RPi2 IP)
+./iotjs (your test program)
+```
+
+### Build IoT.js on Raspberry Pi 2
+
+#### Prerequisite
+Install cmake.
+```bash
+sudo apt-get update
+sudo apt-get install cmake
+```
+
+#### Build IoT.js
+Executing below command will build IoT.js and run our testsuite.
+
+``` bash
+./tools/build.py --target-board=rpi2
+```
diff --git a/docs/build/Build-for-STM32F4-NuttX.md b/docs/build/Build-for-STM32F4-NuttX.md
new file mode 100644 (file)
index 0000000..9bfe16c
--- /dev/null
@@ -0,0 +1,296 @@
+
+### Target board
+We work on STM32F4 board for NuttX and the detail of the reference board is well described at [STM32F4-discovery with BB](http://www.st.com/web/en/catalog/tools/FM116/SC959/SS1532/LN1199/PF255417).
+
+### Relation with STM board?
+We do not have any business relation with STM board. It is selected because it has enough RAM and Flash ROM, so that development can be more comfortable. And it has lots of pins to play with.
+
+When IoT.js is built up and optimized, it may work in devices having smaller resource.
+
+
+### 1. Prepare for prerequisite
+
+#### Linux
+
+```bash
+$ sudo apt-get install autoconf libtool gperf flex bison autoconf2.13
+$ sudo apt-get install cmake libncurses-dev libusb-1.0-0-dev
+$ sudo apt-get install libsgutils2-dev gcc-arm-none-eabi minicom
+```
+
+To use menuconfig in NuttX, you may need to install kconfig frontend.
+
+```bash
+$ git clone https://github.com/jameswalmsley/kconfig-frontends.git
+$ cd kconfig-frontends
+$ ./bootstrap
+$ ./configure --enable-mconf
+$ make
+$ sudo make install
+$ sudo ldconfig
+```
+
+#### macOS
+
+* Install Xcode from the app store and run once Xcode to install components.
+* Install Xcode command line tools.
+```bash
+$ xcode-select --install
+```
+* Install [Homebrew package manager](http://brew.sh/)
+* Install packages
+```bash
+$ brew tap PX4/homebrew-px4
+$ brew update
+$ brew install cmake bash-completion pkg-config kconfig-frontends
+$ brew install gcc-arm-none-eabi libusb minicom
+```
+
+
+### 2. Set up the build environment for STM32F4-Discovery board
+
+#### Supported Nuttx version
+|Repository|Tag Name|
+|----------|:------:|
+| nuttx | nuttx-7.19 |
+| app | nuttx-7.19 |
+
+We only guarantee that the specified version will work well. It is recommended to check out with the specified tag from a git repository.
+
+#### Clone repository
+
+Clone IoT.js and NuttX into iotjs-nuttx directory
+
+```bash
+$ mkdir iotjs-nuttx
+$ cd iotjs-nuttx
+$ git clone https://github.com/Samsung/iotjs.git
+$ git clone https://bitbucket.org/nuttx/nuttx.git --branch nuttx-7.19
+$ git clone https://bitbucket.org/nuttx/apps.git --branch nuttx-7.19
+$ git clone https://github.com/texane/stlink.git
+```
+
+Note that we only support the specified git tag from nuttx repository
+
+The following directory structure is created after these commands
+
+```bash
+iotjs-nuttx
+  + apps
+  + iotjs
+  |  + config
+  |      + nuttx
+  |          + stm32f4dis
+  + nuttx
+  + stlink
+```
+
+
+### 3. Build NuttX (For the first time)
+
+To generate headers which are required to build IoT.js, for the first time, you need to build NuttX at least once. This time NuttX build will be failed. But don't worry at this time. After one execution, you don't need this sequence any more.
+
+#### Add IoT.js as a builtin application for NuttX
+
+```bash
+$ cd apps/system
+$ mkdir iotjs
+$ cp ../../iotjs/config/nuttx/stm32f4dis/app/* ./iotjs/
+```
+
+#### Configure NuttX
+
+```bash
+# assuming you are in iotjs-nuttx folder
+$ cd nuttx/tools
+
+# configure NuttX USB console shell
+$ ./configure.sh stm32f4discovery/usbnsh
+```
+
+Now you can configure nuttx like either of below. For convenience, we provide built-in configure file for you. (This configure file is equipped with modules specified as `always`. For `optional` modules, you might follow instructions below.)
+```bash
+$ cd ..
+$ cp ../iotjs/config/nuttx/stm32f4dis/.config.default .config
+```
+
+Or if you want to configure yourself, you can follow guide below.
+```bash
+$ cd ..
+# might require to run "make menuconfig" twice
+$ make menuconfig
+```
+
+Followings are the options to set:
+
+* Common
+  * Change `Build Setup -> Build Host Platform` from _Windows_ to [_Linux_|_OSX_]
+  * Enable `System Type -> FPU support`
+  * Enable `System Type -> STM32 Peripheral Support -> SDIO`
+  * Enable `RTOS Features -> Clocks and Timers -> Support CLOCK_MONOTONIC`
+  * Enable `RTOS Features -> Pthread Options -> Enable mutex types`
+  * Enable `RTOS Features -> Files and I/O -> Enable /dev/console`
+  * Enable `RTOS Features -> Work queue support -> High priority (kernel) worker thread`
+  * Disable `Device Drivers -> Disable driver poll interfaces`
+  * Enable `Device Drivers -> MMC/SD Driver Support`
+  * Enable `Device Drivers -> MMC/SD Driver Support -> MMC/SD SDIO transfer support`
+  * Enable `Networking Support -> Networking Support`
+  * Enable `Networking Support -> Socket Support -> Socket options`
+  * Enable `Networking Support -> Unix Domain Socket Support`
+  * Enable `Networking Support -> TCP/IP Networking`
+  * Enable `Networking Support -> TCP/IP Networking -> Enable TCP/IP write buffering`
+  * Enable `File Systems -> FAT file system`
+  * Enable `File Systems -> FAT file system -> FAT upper/lower names`
+  * Enable `File Systems -> FAT file system -> FAT long file names`
+  * Enable `Device Drivers -> Network Device/PHY Support -> Late driver initialization`
+  * Enable `Library Routines -> Standard Math library`
+  * Enable `Application Configuration -> System Libraries and NSH Add-ons -> IoT.js`
+  * Enable all children of `Application Configuration -> System Libraries and NSH Add-ons -> readline() Support` (for those who wants to use readline)
+
+* For `net` module
+  * Enable `System Type -> STM32 Peripheral Support -> Ethernet MAC`
+  * Disable `System Type -> STM32 Peripheral Support -> USART2`
+  * Enable `System Type -> STM32 Peripheral Support -> USART6`
+  * Set `System Type -> Ethernet MAC configuration -> PHY address` to `0`
+  * Set `System Type -> Ethernet MAC configuration -> PHY Status Register Address (decimal)` to `31`
+  * Enable `System Type -> Ethernet MAC configuration -> PHY Status Alternate Bit Layout`
+  * Set `System Type -> Ethernet MAC configuration -> PHY Mode Mask` to `0x001c`
+  * Set `System Type -> Ethernet MAC configuration -> 10MBase-T Half Duplex Value` to `0x0004`
+  * Set `System Type -> Ethernet MAC configuration -> 100Base-T Half Duplex Value` to `0x0008`
+  * Set `System Type -> Ethernet MAC configuration -> 10Base-T Full Duplex Value` to `0x0014`
+  * Set `System Type -> Ethernet MAC configuration -> 10MBase-T Full Duplex Value` to `0x0018`
+  * Set `System Type -> Ethernet MAC configuration -> RMII clock configuration` to `External RMII clock`
+  * Enable `Board Selection -> STM32F4DIS-BB base board`
+  * Set `Device Drivers -> Network Device/PHY Support -> Board PHY Selection` to `SMSC LAN8720 PHY`
+  * Enable `Networking Support -> Data link support -> Local loopback`
+  * Enable `Networking Support -> TCP/IP Networking -> TCP/IP backlog support`
+  * Enable `Networking Support -> ARP Configuration -> ARP send`
+
+* For `dgram`
+  * Enable `Networking Support > UDP Networking`
+
+* For `pwm` module
+  * Enable `System Type -> STM32 Peripheral Support -> TIM(N)`
+  * Enable `System Type -> Timer Configuration -> TIM(N) PWM`
+  * Set `System Type -> Timer Configuration -> TIM(N) PWM -> TIM(n) PWM Output Channel` to channel number you want
+  * Enable `Device Drivers -> PWM Driver Support`
+
+* For `adc` module
+  * Enable `System Type -> STM32 Peripheral Support -> ADC(N)`
+  * Enable `System Type -> STM32 Peripheral Support -> TIM(M)`
+  * Enable `System Type -> Timer Configuration -> TIM(M) ADC`
+  * Enable `Device Drivers -> Analog Device(ADC/DAC) Support`
+  * Enable `Device Drivers -> Analog Device(ADC/DAC) Support -> Analog-to-Digital Conversion`
+
+* For `uart` module
+  * Enable `System Type -> STM32 Peripheral Support -> U[S]ART(N)`
+
+* For `i2c` module
+  * Enable `System Type -> STM32 Peripheral Support -> I2C1`
+  * Enable `Device Drivers -> I2C Driver Support`
+
+* For `spi` module
+  * Enable `System Type -> STM32 Peripheral Support -> SPI1`
+  * Enable `Device Drivers -> SPI exchange`  
+  
+#### Build NuttX Context
+
+```bash
+# assuming you are in iotjs-nuttx folder
+$ cd nuttx/
+$ make context
+```
+
+
+### 4. Build IoT.js for NuttX
+
+These options are needed.
+```bash
+--target-arch=arm
+--target-os=nuttx
+--nuttx-home=/path/to/nuttx
+--target-board=stm32f4dis
+--jerry-heaplimit=[..]
+```
+
+For example,
+```bash
+$ ./tools/build.py \
+--target-arch=arm --target-os=nuttx --nuttx-home=../nuttx \
+--target-board=stm32f4dis --jerry-heaplimit=78
+```
+
+Library files will be generated like below when build is successful.
+
+```bash
+$ ls build/arm-nuttx/release/lib
+libhttpparser.a libiotjs.a libjerrycore.a libtuv.a
+```
+
+### 5. Build NuttX
+
+```bash
+# assuming you are in iotjs-nuttx folder
+$ cd nuttx/
+$ make IOTJS_ROOT_DIR=../iotjs
+```
+For release version, you can type R=1 make on the command shell.
+
+
+### 6. Flashing
+
+Connect Mini-USB for power supply and connect Micro-USB for `NSH` console.
+
+To configure `stlink` utility for flashing, follow the instructions [here](https://github.com/texane/stlink#build-from-sources).
+
+To install,
+```bash
+# assuming you are in stlink folder
+$ cd stlink
+$ make
+```
+
+To flash,
+```bash
+# assuming you are in nuttx folder
+$ sudo ../stlink/build/Release/st-flash write nuttx.bin 0x8000000
+```
+
+
+### 7. Run IoT.js
+
+#### USB Connection
+
+There are two USB Connections on the Target board. USB mini CN1 and USB micro CN5. Both USB ports need to be connected to your Host. CN1 is used for power and Flashing, but it will not appear as a device in Linux. CN5 is used for NSH and will appear as `/dev/ttyACM0(linux)` or  `/dev/tty.usbmodem1(macOS)` when things work well.
+
+#### Use minicom
+
+```bash
+// linux
+$ minicom --device=/dev/ttyACM0
+// macOS
+$ minicom --device=/dev/tty.usbmodem1
+
+```
+You may need to enable _Add Carriage Return_ option.
+* Press <kbd>Ctrl-A</kbd> + <kbd>Z</kbd> + <kbd>U</kbd> for short in minicom screen. (For linux user)
+* Press <kbd>[Meta](http://osxdaily.com/2013/02/01/use-option-as-meta-key-in-mac-os-x-terminal/)</kbd> + <kbd>Z</kbd> for short in minicom screen. (For macOS user)
+
+Press _Enter_ key several times to trigger NuttShell to start.
+
+If micro SD is enabled, you can copy any script file to it and run with _nsh_, for example;
+```
+NuttShell (NSH)
+nsh> mount -t vfat /dev/mmcsd0 /mnt/sdcard
+nsh> iotjs /mnt/sdcard/path_to_file.js
+```
+
+If you see
+```
++-----------------------------+                  
+|                             |                  
+|  Cannot open /dev/ttyACM0!  |                  
+|                             |                  
++-----------------------------+
+```
+and it stays on the screen, something is wrong. Blue LED may blink if NuttX is in abnormal state. Press black(reset) button on the board and try again. If you still see this warning message, begin with original NuttX code and check your board, USB line and other softwares.
diff --git a/docs/build/Build-for-x86-Linux.md b/docs/build/Build-for-x86-Linux.md
new file mode 100644 (file)
index 0000000..d6436a4
--- /dev/null
@@ -0,0 +1,204 @@
+### Overall steps to build for Linux
+1. Get the sources
+2. Build all at once
+3. Execute IoT.js
+4. Clean build directory
+
+***
+
+#### Build Host
+Ubuntu 14.04 is recommended. Other Unix like platforms can be used. If it doesn't seem to work properly on other platforms, please look into the [Issues](https://github.com/Samsung/iotjs/issues) page. Someone may have already tried. If you can't find any related one, please leave an issue for help.
+
+#### Directory structure
+
+This document assumes 'harmony' as the root directory. _JerryScript_, _libtuv_ and _libuv_ are included as sub-modules in `deps` directory.
+
+* harmony
+    * iotjs
+        * deps
+            * http-parser
+            * jerry
+            * libuv
+            * libtuv
+
+
+※ harmony? It's from the initial code name of our project. (_Sounds good, isn't it? :)_)
+
+#### Prerequisite
+
+You need to install some packages to build IoT.js, as follows;
+
+```
+sudo apt-get install gyp cmake build-essential valgrind
+```
+
+gcc compiler 4.8 or higher versions are required to compile. If you don't know how to do it, you can get some help from [how-to-install-gcc-4-8](http://askubuntu.com/questions/271388/how-to-install-gcc-4-8) or google.
+
+### 1. Get the sources
+
+Clone our repository to look around and test it. If it attracts you and you want to try something interested, please fork it.
+
+To get the source for this repository,
+```
+cd harmony
+git clone https://github.com/Samsung/iotjs.git
+cd iotjs
+```
+
+Sub-modules(_http-parser_, _JerryScript_, _libuv_ and _libtuv_) will be pulled. And matching hash will be checked out for your current IoT.js version when you run the build script.
+
+
+### 2. Build all at once
+
+IoT.js and required sub-modules are generated all at once in tools directory with build.py.
+
+```
+cd iotjs
+./tools/build.py
+```
+
+
+#### Set build options
+Some basic options are provided.
+
+Existing build options are listed as follows;
+```
+buildtype=debug|release (debug is default)
+builddir=build (build is default)
+clean
+buildlib (default is False)
+target-arch=x86|x86_64|x64|i686|arm (depends on your host platform)
+target-os=linux|nuttx|darwin|osx (linux is default)
+target-board
+cmake-param
+compile-flag
+link_flag
+external-include-dir
+external-static-lib
+external-shared-lib
+iotjs-include-module
+iotjs-exclude-module
+jerry-cmake-param
+jerry-compile-flag
+jerry-link-flag
+jerry-lto
+jerry-heap-section
+jerry-heaplimit (default is 81, may change)
+jerry-memstat (default is False)
+no-init-submodule (default is init)
+no-check-tidy (default is check)
+no-check-test (default is check)
+no-parallel-build
+no-snapshot
+nuttx-home= (no default value)
+```
+
+To give options, please use two dashes '--' before the option name as described in the following sections.
+
+Options that may need explanations.
+* builddir: compile intermediate and output files are generated here.
+* buildlib: generating _iotjs_ to a library if True(e.g. for NuttX). give __--buildlib__ to make it True.
+* jerry-heaplimit: JerryScript default heap size (as of today) is 256Kbytes. This option is to change the size for embedded systems, NuttX for now, and current default is 81KB. For linux, this has no effect. While building nuttx if you see an error `region sram overflowed by xxxx bytes`, you may have to decrease about that amount.
+* jerry-memstat: turn on the flag so that jerry dumps byte codes and literals and memory usage while parsing and execution.
+* no-check-tidy: no checks codes are tidy. we recommend to check tidy.
+* no-check-test: do not run all tests in test folder after build.
+* nuttx-home: it's NuttX platform specific, to tell where the NuttX configuration and header files are.
+
+If you want to know more details about options, please check the [Build Script](Build-Script.md) page.
+
+
+#### Include extended module
+There are two ways to include [extended module](../api/IoT.js-API-reference.md).
+
+The first way is to modify a property value of module in `build.config` file. You can move a module name from 'exclude' to 'include'.
+
+The second way is by using build options which is `--iotjs-include-module`.
+If you enter several modules, separate them with a comma.
+
+```
+./tools/build.py --iotjs-include-module=dgram,pin,gpio
+```
+
+
+#### Options example
+
+It's a good practice to build in separate directory, like 'build'. IoT.js generates all outputs into separate **'build'** directory. You can change this by --builddir option. Usually you won't need to use this option. Target and architecture name are used as a name for a directory inside 'build' directory.
+
+To build debug version, type the command like below. And you can find the binary in 'output' directory.
+```
+./tools/build.py --builddir=output
+```
+
+To build 32bit version in x86_64 with debug version as a library, type the command like below.
+```
+./tools/build.py --target-arch=i686 --buildlib
+```
+
+To build release version with different jerry revision, type the command like below. (Assume that you have already checked it out.)
+```
+./tools/build.py --buildtype=release --no-init-submodule
+```
+
+
+
+#### Build only IoT.js with given build option
+
+This section for explaining how to build only IoT.js when you did some modification. IoT.js uses [CMake](http://www.cmake.org/) for makefile generation. You can go inside the build folder and build with 'make' command. Go inside where your target platform name is, for example x86_64 linux,
+```
+cd build/x86_64-linux/release/iotjs
+make
+```
+
+#### What build script does
+
+1. It will clone sub-modules, this will be done only once when version hash has not changed.
+2. Checkout matching version for each sub-modules.
+3. Build sub-modules, you can see the outputs at build/(target-arch)-(target-os)/(buildtype)/libs folder.
+4. Build IoT.js
+
+
+### 3. Execute IoT.js
+
+Executable name is **'iotjs'** and resides in (target-arch)-(target-os)/(buildtype)/iotjs.
+To run greetings JavaScript in test folder, for example;
+
+```
+./build/x86_64-linux/debug/bin/iotjs ./test/run_pass/test_console.js
+```
+
+#### Set execution Options
+
+Some execution options are provided as follows;
+```
+memstat
+show-opcodes
+```
+
+To give options, please use two dashes '--' before the option name as described in following sections.
+
+For more details on options, please see below.
+* memstat: dump memory statistics. To get this, must build with __jerry-memstat__ option.
+* show-opcodes: print compiled byte-code.
+
+
+#### Options example
+
+To print memory statistics, follow the below steps;
+```
+./tools/build.py --jerry-memstat
+
+./build/x86_64-linux/debug/bin/iotjs --memstat ./test/run_pass/test_console.js
+```
+
+With given `show-opcodes` option, opcodes will be shown.
+```
+./build/x86_64-linux/debug/bin/iotjs --show-opcodes ./test/run_pass/test_console.js
+```
+
+### 4. Clean build directory
+
+Just remove the folder as follows;
+```
+rm -rf build
+rm -rf deps/libuv/out
+```
diff --git a/docs/contributing/Assigned-People.md b/docs/contributing/Assigned-People.md
new file mode 100644 (file)
index 0000000..bb683d9
--- /dev/null
@@ -0,0 +1,13 @@
+#### Maintainers
+* akosthekiss (integration)
+* LaszloLango (integration)
+* zherczeg (Steering Committee)
+* yichoi (Steering Committee, Project main contact)
+
+#### Committers
+* chokobole
+* glistening
+* hs0225
+* daeyeon
+* bzsolt
+* galpeter
\ No newline at end of file
diff --git a/docs/contributing/Community-Guidelines.md b/docs/contributing/Community-Guidelines.md
new file mode 100644 (file)
index 0000000..9789400
--- /dev/null
@@ -0,0 +1,20 @@
+All community members must abide by rules of common sense, civility and good neighborliness. Frank discussion is welcomed and encouraged with the goal of arriving at the best technical solution possible. 
+Community participants must adhere to these simple rules:
+- Respect and acknowledge all contributions, suggestions and comments from the community.
+- Listen and be open to all opinions, which are subject to open discussion.
+- Help each other.
+- Assume people mean well.
+
+<br>
+
+### Community Consensus, Lazy Consensus and Slient Consent
+
+Community consensus about a Project issue means that the issue has been submitted to and discussed by Contributors, and that ALL discussing member agree about the issue.<p>
+Lazy consensus means that Contributors may proceed with work when they have reason to believe that other Contributors in the community will agree with the direction of their work, and do not need to stop or initiate unnecessary discussion about the work. Contributors should publish their work (that is, merge proposals to master branch) in a timely manner to allow others to possibly raise issues about the work. When the Contributor is not sure there will be consensus, they should raise a proposal to the community via appropriate public communication channels(**_currently Github issues is possible way to achieve this_**)<p>
+Silent Consent means that those who do not offer a reasoned alternative in course of the discussion implicitly agree with the proposal.
+
+<br>
+
+### Meritocracy
+
+Responsibilities in the project (including decision making) are given to those who exhibit both the technical skill and dedication to project via their ongoing valuable contributions. Decision making happens inside the community, with more weight given to those who are more familiar with the code.
diff --git a/docs/contributing/Governance.md b/docs/contributing/Governance.md
new file mode 100644 (file)
index 0000000..67d3522
--- /dev/null
@@ -0,0 +1,81 @@
+* [Project Roles](#project-roles)
+  - [Contributor](#contributor)
+  - [Committer](#committer)
+  - [Maintainer](#maintainer)
+  - [Selection of Committers and Maintainers](#selection-of-committers-and-maintainers)
+  - [Revocation of Committers/Maintainers status](#revocation-of-committersmaintainers-status)
+  - [Steering Committee](#steering-committee)
+* [Decision Making Process](#decision-making-process)
+
+## Project Roles
+
+The IoT.js project recognizes the following formal roles: Contributor, Committer, and Maintainer.
+
+* [Assigned people](Assigned-people.md)
+
+#### Contributor
+A _Contributor_ is a developer who wishes to contribute to the project, at any level. Contributors who show dedication and skill are rewarded with additional rights and responsibilities. Their opinions weigh more when decisions are made, in a fully meritocratic fashion.
+
+Contributors are granted the following rights and responsibilities:
+* Right to contribute code, documentation, translations, artwork, etc.
+* Right to report defects (bugs) and suggestions for enhancement.
+* Right to participate in the process of reviewing contributions by others.
+* Right to initiate and participate in discussions in any communication methods.
+* Right to approach any member of the community with matters they believe to be important.
+* Responsibility to abide by decisions, once made. They are welcome to provide new, relevant information to reopen decisions.
+* Responsibility for issues and bugs introduced by one’s own contributions.
+* Responsibility to respect the rules of the community.
+* Responsibility to provide constructive advice whenever participating in discussions and in the review of contributions.
+
+#### Committer
+A _Committer_ is a Contributor who is also responsible for the maintenance of IoT.js source code. 
+
+Committers have the following rights and responsibilities, in addition to those listed for Contributors:
+* Right to set goals for the short and medium terms for the project being maintained, alongside the Maintainer.
+* Right to exceptionally make more invasive changes to the source code, when required.
+* Right to approve own contribution, after discussing with other Contributors.
+* Right and responsibility to participate in the feature development process.
+* Responsibility to ensure all contributions of the project have been reviewed within reasonable time.
+* Responsibility to ensure the quality of the code to expected levels.
+* Responsibility to monitor discussions in the community.
+* Responsibility to participate in the quality verification and release process, when those happen.
+
+#### Maintainer
+A _Maintainer_ is a Contributor who is also responsible for knowing, directing and anticipating the needs of a given IoT.js source code. 
+
+Maintainers have the following rights and responsibilities, in addition to those listed for Contributors and Committers:
+* right to set the overall organization of the source code of the project
+* right to participate in the decision-making of the project, in conjunction with the Committers.
+* Responsibility to ensure all contributions of the project have been reviewed within reasonable time. 
+  - In the reviewing, only Maintainers can give binding scores(refer to [Approval Path for PR(Pull Request)](#approval-path-for-prpull-request))
+
+#### Selection of Committers and Maintainers
+
+A candidate for the Committer role should be one of the Contributors who has submitted at least 10 non-trivial patches in project and has shown characteristics consistent with the requirements of the Committer role. 
+A candidate for the Maintainer role should be one of the Committers. 
+To be a candidate for the Committer or Maintainer, a Contributor can self-nominate with proper evidences.
+
+The selection process should be achieved by consensus of the Contributors active in. If consensus cannot be achieved, Maintainers will make the decision by voting.
+
+#### Revocation of Committers/Maintainers Status
+
+A Maintainer or a Committer who intentionally abused his review privilege may have it temporarily suspended on the request of other Committers or Maintainers. Committers and Maintainers not including the person under consideration should discuss on the revocation of the person. If consensus cannot be reached, Maintainers will make the decision by voting.
+
+#### Steering Committee
+
+_Steering Committee_ oversees and guides the progress of IoT.js project.
+
+The Steering Committee have the following responsibilities:
+
+* responsibility to oversee the health of the project community.
+* responsibility to oversee and facilitate the development of the IoT.js source code under the governance rules of the IoT.js Open Source project.
+* responsibility to guide and direct the development towards goals.
+* responsibility to sets the goals and roadmap for the project
+
+## Decision Making Process
+
+Decisions in the IoT.js project are made always at the lowest level possible that is applicable for the decision in question. Decision makers always need to keep in mind the rules of community and the IoT.js goals and roadmap.
+
+* Individual Contributors are making decisions every time they submit changes in the form of deciding what to implement and how to go about it.
+* Two or more Contributors also make decisions when participating in discussions in community, on bug or feature reports, in reviewing of commits. Their arguments in why a given decision should be made are part of the consensus that needs to be reached for the decision. At this level, the principle of meritocracy is important, as the opinion of those who have contributed more will be given more weight in the consensus-building.
+* If those Contributors cannot agree and reach consensus on a decision, then IoT.js provides for decisions to be made by Maintainers following their own decision-making process, avoiding stalemates.
\ No newline at end of file
diff --git a/docs/contributing/Patch-Submission-Process.md b/docs/contributing/Patch-Submission-Process.md
new file mode 100644 (file)
index 0000000..a6ad0c4
--- /dev/null
@@ -0,0 +1,40 @@
+The following guidelines on the submission process are provided to help you be more effective when submitting code to the IoT.js project.
+
+When development is complete, a patch set should be submitted via Github pull requests. A review of the patch set will take place. When accepted, the patch set will be integrated into the master branch, verified, and tested. It is then the responsibility of the authoring developer to maintain the code throughout its lifecycle.
+
+Please submit all patches in public by opening a pull request. Patches sent privately to Maintainers and Committers will not be considered. Because the IoT.js Project is an Open Source project, be prepared for feedback and criticism-it happens to everyone-. If asked to rework your code, be persistent and resubmit after making changes.
+
+#### 1. Scope the patch
+
+Smaller patches are generally easier to understand and test, so please submit changes in the smallest increments possible, within reason. Smaller patches are less likely to have unintended consequences, and if they do, getting to root cause is much easier for you and the Maintainers and Committers. Additionally, smaller patches are much more likely to be accepted.
+
+#### 2. Sign your work with the [IoT.js DCO](IoT.js-Developer's-Certificate-of-Origin-1.0.md)
+
+The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an Open Source patch. The  sign-off is required for a patch to be accepted.
+
+#### 3. Open [a Github pull request](https://github.com/Samsung/iotjs/pulls)
+
+#### 4. What if my patch is rejected?
+
+It happens all the time, for many reasons, and not necessarily because the code is bad. Take the feedback, adapt your code, and try again. Remember, the ultimate goal is to preserve the quality of the code and maintain the focus of the Project through intensive review.
+
+Maintainers and Committers typically have to process a lot of submissions, and the time for any individual response is generally limited. If the reason for rejection is unclear, please ask for more information to the Maintainers and Committers.
+If you have a solid technical reason to disagree with feedback and you feel that reason has been overlooked, take the time to thoroughly explain it in your response.
+
+#### 5. Code review
+
+Code review can be performed by all the members of the Project (not just Maintainers and Committers). Members can review code changes and share their opinion by comments with the following principles:
+* Discuss code; never discuss the code's author.
+* Respect and acknowledge contributions, suggestions, and comments.
+* Listen and be open to all different opinions.
+* Help each other.
+
+Changes are submitted via pull requests and only the Maintainers and Committers should approve or reject the pull request.
+Changes should be reviewed in reasonable amount of time. Maintainers and Committers should leave changes open for some time (at least 1 full business day) so others can offer feedback. Review times increase with the complexity of the review.
+
+### Tips on GitHub Pull Requests
+* Fork the GitHub repository(https://guides.github.com/activities/forking/) and clone it locally.
+Connect your local repository to the original upstream repository by adding it as a remote.
+Pull in upstream changes often to stay up-to-date so that when you submit your pull request, merge conflicts will be less likely.
+* For more details, see [GitHub fork synching guidelines](https://help.github.com/articles/syncing-a-fork/).
+[Create a branch](https://guides.github.com/introduction/flow/) for your edits.
\ No newline at end of file
diff --git a/docs/devs/API-Document-Guidelines.md b/docs/devs/API-Document-Guidelines.md
new file mode 100644 (file)
index 0000000..eeeda7a
--- /dev/null
@@ -0,0 +1,223 @@
+## This is a sample API reference. Please use this as a guideline to write your module's API references.
+
+- If you have any questions about this guide, please let us know as an issue.
+- `Markdown Example` is added to help understanding, and you can ignore it when writing the actual document.
+- The document contents should be in order of `"Module"`, `"Module Function"`, `"Class"`, `"Constructor"`, `"Properties"`, `"Static Function"`, `"Prototype Functions"`, and `"Events"`. If the content does not exist, it can be omitted.
+- `Module Functions` are what you can directly invoke without an instance of a certain Class. E.g) net.connect.
+- In case of `experimental` module, it's required to explicitly indicate that the features are experimental. Please put the caution below to the beginning of the document.
+> :exclamation: This document describes an experimental feature and considerations. Please be aware that every experimental feature may change, be broken, or be removed in the future without any notice.
+
+***
+
+### Platform Support
+
+The following shows `{Your_module_name}` module APIs available for each platform.
+
+|  | Linux<br/>(Ubuntu) | Raspbian<br/>(Raspberry Pi) | NuttX<br/>(STM32F4-Discovery) |
+| :---: | :---: | :---: | :---: |
+| {class_name}.{functionName1} | O | O | O |
+| {class_name}.{functionName2} | O | O | O |
+| {class_name}.{functionName3} | O | O | O |
+
+# {Your_module_name}
+
+- Write a brief description of this module here.
+- The first character of the title must start with an `Uppercase letter`.
+
+#### Markdown Example
+
+```
+# Timer
+
+The timer module exposes a global API for scheduling functions to be called at some future period of time.
+Because the timer functions are globals, there is no need to call require('timers') to use the API.
+```
+
+## {your_module_name}.{your_module_function_name}([{argument_name}])
+* `{argument_name}` {{Argument_type}} {more information} **Default:** `{defalut_value}`
+* Returns: {{return_type}} {more information}
+
+- Write a description of this function here.
+- The first character of Module in the title must start with a `lowercase letter`.
+- The other rules are the same as mentioned before.
+
+**Example**
+```
+  Write a sample usage for this API if needed.
+```
+
+#### Markdown Example
+```
+### net.connect(port[, host][, connectListener])
+* `port` {number} Port the client should connect to.
+* `host` {string} Host the client should connect to. **Default:** `localhost`.
+* `connectListener` {Function} Listener for the `'connect'` event.
+* Returns {net.Socket}.
+
+Creates a new `net.Socket` and automatically connects to the supplied `port` and `host`.
+If host is omitted, `localhost` will be assumed.
+The `connectListener` is automatically registered as a `'connect'` event listener.
+```
+
+## Class: {Your_class_name}
+
+- Write a brief description of this class here.
+- The first character of the title must start with an `Uppercase letter`.
+- While you are writing this description, if you need to write down module / class / function / event name, arguments, or type which you already mentioned, then enclose the keyword in single-quotation. This rule applies to other items as well.
+
+    E.g) The given `callback` is called every `delay` milliseconds. If it's not a function, a `TypeError` will be thrown.
+
+### new {Your_class_name}([{argument_name}])
+* `{argument_name}` {{Argument_type}} {more information} **Default:** `{defalut_value}`
+* Returns: {{return_type}} {more information}
+
+Notice that every argument name of API and defalut value are in a single-quote.
+
+**Example**
+```
+  Write a sample usage for this API if needed.
+```
+
+#### Markdown Example
+
+```
+# Class: Buffer
+
+Buffer class is a global type with various constructors and accessors.
+IoT.js provides Buffer to manipulate binary data. Currently buffer has a pure
+ES5 compatible implementation, but this might be reworked to use `UInt8Array` in the future.
+
+
+### new Buffer(size)
+* `size` {integer} Size of the new buffer.
+
+Creates a new buffer of `size` bytes and initialize its data to zero.
+
+```
+
+
+### {Your_class_name}.{your_static_function_name}([{argument_name}])
+* `{argument_name}` {{Argument_type}} {more information} **Default:** `{defalut_value}`
+* Returns: {{return_type}} {more information}
+
+- Write a description of this static function here.
+- The first character of Class in the title must start with an `Uppercase letter`.
+- The other rules are the same as mentioned before.
+
+**Example**
+```
+  Write a sample usage for this API if needed.
+```
+
+#### Markdown Example
+
+```
+### Buffer.byteLength(str, encoding)
+
+* `str` {string} Source string.
+* `encoding` {string} String encoding.
+* Returns: {integer} Byte length of source string.
+
+Returns the byte length of a buffer representing the value
+of the string argument encoded with encoding. The effect is
+the same as:
+
+```js
+return new Buffer(str, encoding).length;
+```
+
+
+### {your_class_name}.{property_name}
+* {{property_type}}
+
+- Write a description of this property here.
+- The first character of the title must start with a `lowercase letter`.
+
+**Example**
+```
+  Write a sample usage for this API if needed.
+```
+#### Markdown Example
+```
+### buf.length
+* {integer}
+
+Returns the capacity of the buffer in bytes. Note: when
+the buffer is converted to another type (e.g. `String`) the
+length of the converted value might be different from
+this value.
+
+**Example**
+
+```js
+var Buffer = require('buffer');
+
+var buffer = new Buffer([0xc8, 0x80])
+console.log(buffer.length); // prints 2
+
+var str = buffer.toString();
+console.log(str.length); // prints 1
+```
+
+
+### {your_class_name}.{your_prototype_function_name}([{argument_name}])
+* `{argument_name}` {{Argument_type}} {more information} **Default:** `{defalut_value}`
+* Returns: {{return_type}} {more information}
+
+- Write a description of this prototype function here.
+- The first character of Class in the title must start with a `lowercase letter`.
+- The other rules are the same as mentioned before.
+
+**Example**
+```
+  Write a sample usage for this API if needed.
+```
+
+#### Markdown Example
+
+```
+### emitter.on(event, listener)
+* `event` {string} The name of the event.
+* `listener` {Function} The callback function.
+  * `args` {any}.
+* Returns `emitter` {events.EventEmitter}.
+
+Adds the `listener` callback function to the end of the listener's list for the given `event`. No checks are made to see if the `listener` has already been added.
+In case of multiple calls the `listener` will be added and called multiple times.
+
+**Example**
+
+```js
+var EventEmitter = require('events').EventEmitter;
+var emitter = new EventEmitter();
+
+emitter.on('event', function() {
+  console.log('emit event');
+});
+
+emitter.emit('event');
+
+```
+
+
+### Event: '{your_events_name}'
+* `{callback_name}` {{callback_function_argument}}
+  * `{argument1}` {{argument2_type}} {more information}
+
+- Write a description of this here.
+- In case of Event, the name of Class that this event belongs to, is not prepended in the title.
+- The other rules are the same as mentioned before.
+
+#### Markdown Example
+
+```
+### Event: 'lookup'
+* `callback` {Function}
+  * `err` {Error}
+  * `address` {string}
+  * `family` {string|null}
+
+Emitted after resolving hostname.
+```
+
+ - Notice that the `err {Error}` above is started with `2 spaces` indentation since it's given to `callback` as parameters, not `lookup` event.
diff --git a/docs/devs/Advanced-Development.md b/docs/devs/Advanced-Development.md
new file mode 100644 (file)
index 0000000..198afc0
--- /dev/null
@@ -0,0 +1,9 @@
+ - [Inside IoT.js](Inside-IoT.js.md)
+ - [Experimental Features](Experimental-Features.md)
+ - [Inside Validated Struct](Inside-IoT.js-Validated-Struct.md)
+ - [Logging Execution](Logging-IoT.js-execution.md)
+ - [Memory saving with libtuv](Memory-savings-with-libtuv.md)
+ - [Optimization Tips](Optimization-Tips.md)
+ - [JerryScript Debugger](Use-JerryScript-Debugger.md)
+ - [Writing New Builtin Module](Writing-New-Builtin-Module.md)
+ - [Extended API Guidelines](Extended-API-Guidelines.md)
\ No newline at end of file
diff --git a/docs/devs/Coding-Style-Guidelines.md b/docs/devs/Coding-Style-Guidelines.md
new file mode 100644 (file)
index 0000000..10c52c7
--- /dev/null
@@ -0,0 +1,210 @@
+* [Coding Style Guideline for C](#coding-style-guideline-for-c)
+  * Validated Struct
+  * Header Files
+  * Formatting
+  * Naming
+  * Comments
+* [Coding Style Guideline for Javascript](#coding-style-guideline-for-javascript)
+  * Javascript Language Rules
+  * Javascript Style Rules
+    * Naming
+    * Formatting
+* [Coding Style Guideline for Python](#coding-style-guideline-for-python)
+
+
+# Coding Style Guideline for C
+
+Our coding style guideline is based on [google c++ coding standard](https://google.github.io/styleguide/cppguide.html),
+but modified due to some difference between C and C++.
+When this guideline is ambiguous, just follow the result of running `./tools/check_tidy.py`.
+
+Here are `./tools/check_tidy.py` options:
+```
+--autoedit: Automatically edit the detected clang format errors. No diffs will be displayed.
+```
+
+## Validated Struct
+Use [Validated Struct](../devs/Inside-IoT.js-Validated-Struct.md) whenever possible, for encapsulation and validity check.
+
+## Header Files
+
+### #define guard
+Use #define guard in all header files. `<FILE>_H` format is recommended.
+
+    #ifndef FILE_H
+    #define FILE_H
+        ...
+    #endif // FILE_H
+
+## Formatting
+
+### Line length
+maximum 80 characters in a line.
+
+### Indentation
+2 space indent at a time. Do not use a tab for indentation.
+
+### Vertical whitespace
+Add two blank lines between functions.
+
+Otherwise minimize use of vertical whitespace.
+
+This is more a principle than a rule: don't use blank lines when you don't have to. In particular, don't put more than two blank lines between functions, resist starting functions with a blank line, don't end functions with a blank line, and be discriminating with your use of blank lines inside functions.
+
+### Function call
+Write a function call all in a line if it fits. If not, break the line into multiple lines after assignment operator, or insert newline between parameters.
+Do not insert spaces after open paren and before close paren.
+
+    int value = foo(arg1, arg2, arg3);
+
+    int value =
+        foo(arg1, arg2, arg3);
+
+    int value = foo(arg1, arg2,
+                    arg3);
+
+### Function Declaration and Definition
+Use named parameters in function declaration.
+
+    return_type function_name(int, char); // not allowed
+    return_type function_name(int arg1, char arg2); // Use this
+
+Return type should be on the same line as function name and parameters if it fits. If not, break between them aligned with the first argument.
+
+    return_type function_name(int arg1,
+                              char arg2);
+
+If even first argument does not fit in a line, write it in a new line with 4 space indent.
+
+    return_type function_name(
+        int arg1, char arg2);
+
+
+The open curly brace should be at the same line. The close curly brace should be either at the same line as its open curly brace or at new line.
+
+    return_type function_name(int arg1, char arg2) { };
+    return_type function_name(int arg1, char arg2) {
+      ...
+    }
+    return_type function_name(int arg1, char arg2)
+    {  // not allowed
+      ...
+    }
+
+### Conditionals
+Use a space between the if and open brace. Open brace on the same line as the if.
+
+    if (condition) {
+        ...
+    }
+
+Short conditional statements may be written without braces.
+
+    if (condition)
+      do_something();
+
+### Loops and Switches
+Use a space between the switch and loops(for, while, do-while) and open brace. Open brace on the same line as the switch and loops.
+
+    while (condition) {
+      ...
+    }
+
+Single loop body statement may be written without braces.
+
+    while (condition)
+      do_something(); // ok
+    for (condition)
+      do_something(); // ok
+
+
+## Naming
+
+### Type names
+Use lower cases and underscore for struct names, and add prefix `iotjs_` and suffix `_t`.
+
+    typedef struct {
+      ...
+    } iotjs_name_t;
+
+### Function names
+Use lower cases and underscore for function names.
+
+For constructors, destructor, and methods of validated struct `iotjs_mystruct_t`, use names starting with `iotjs_mystruct_*`.
+Constructor function name should be either `iotjs_mystruct_create` or `iotjs_mystruct_initialize`,
+depending on whether the constructor returns the instance as return value, or the constructor just initializes the instance passed by parameter.
+
+```c
+typedef struct {
+} IOTJS_VALIDATED_STRUCT(iotjs_mystruct_t);
+
+iotjs_mystruct_t iotjs_mystruct_create(); // Ok
+iotjs_mystruct_t* iotjs_mystruct_create(); // Ok
+void iotjs_mystruct_initialize(iotjs_mystruct_t*); // Ok
+
+void iotjs_mystruct_destroy();
+
+int iotjs_mystruct_method();
+```
+
+### Variable names
+Use lower cases and underscore for variable names.
+
+    int lower_case_variable;
+
+
+## Comments
+
+### Comment style
+Use either // or /* */ style comments. However, // style is much prefered.
+
+
+
+# Coding Style Guideline for Javascript
+
+This coding standard is based on [google javascript coding standard](https://google.github.io/styleguide/javascriptguide.xml)
+
+## Javascript Language Rules
+
+### var
+Always declare variable before use.
+
+### Semicolons
+Always use semicolons.
+
+### Function Declaration in blocks
+Do not declare functions within a block.
+
+### Wrapper objects of primitive types
+Do not use wrapper objects for primitive types.
+
+### with
+Do not use `with` statement.
+
+### Modifying prototypes of builtin objects
+Do not modify prototypes of builtin objects
+
+## Javascript Style Rules
+
+### Naming
+Use lowerCamelCase for varible names and function names.
+
+    var myFirstVariable;
+    function myFirstFunction {
+      ...
+    }
+
+Use UpperCamelCase for constructor names
+
+    function MyConstructorFunction(input) {
+      this.variable = input;
+      ...
+    }
+
+### Formatting
+Follow C/C++ formatting above.
+
+
+# Coding Style Guideline For Python
+
+The coding conventions for Python code follows [PEP 8 - Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/)
diff --git a/docs/devs/Developer-Tutorial.md b/docs/devs/Developer-Tutorial.md
new file mode 100644 (file)
index 0000000..cb7189f
--- /dev/null
@@ -0,0 +1,161 @@
+### Getting Started with Examples
+As **IoT.js** is asynchronous and event-driven, programming style is pretty much different from traditional blocking synchronous style. This tutorial lets you know how to code with **IoT.js** mainly focused on asynchronous and event-driven style.
+
+#### Hello World
+Firstly, create a javascript file (e.g. `hello.js`) and open it. Then type as following.
+```javascript
+console.log('Hello, world!');
+```
+
+You must be familiar with the code above if you have ever worked with Javascript in web. This is exactly same way as in major web browsers.
+
+You can run it with:
+```
+$ ./iotjs hello.js
+```
+
+Then it gives:
+```
+Hello, world!
+```
+
+Pretty simple. But where did `console` come from? `console` is not defined in Global Object according to ECMAScript spec.
+
+The answer is `console` is a builtin module so it should have been `require`ed. However, `console` is a special case so we can use it directly without `require`. This is about Module System which we will cover later.
+
+#### File Reader
+To read a file, we need to import *File System* module.
+When importing a module, we use function `require`.
+*File System* module is abbreviated as `fs`. You can import it like:
+```javascript
+var fs = require('fs');
+```
+
+Then we can use APIs of `fs`. To read the whole file, use `readFile()`.
+```javascript
+fs.readFile("hello_iotjs.txt",   // path
+            readFileCallback);   // callback
+```
+Let's say we want to read `hello_iotjs.txt`. Just pass it as first argument.
+It may be enough for synchronous style but we must specify a callback function as last argument. `fs.readFile` does not wait for I/O to be done, it just goes on to next code. Sometime after file opening is completely done, callback will be called. This means that we must not implement `readFile` handling code on the next line, but in callback function.
+
+Take a look at the callback function for `fs.readFile` below.
+```javascript
+function readFileCallback(err, data) {
+  if (err) throw err;
+  console.log(data.toString());
+}
+```
+We can find two arguments in this function. We can think of them as the results of `fs.open`. In this case(`fs.readFile`), `err` and `data` are given. Of course, each API function has their own argument list.
+
+`err` is an `Error` object. We just throw it if an error has occurred. Otherwise we have successfully read the file content and it is stored in `data`. In this example, it only prints the file content but you can do anything you want.
+
+##### full code list
+```javascript
+var fs = require('fs');
+
+fs.readFile("hello_iotjs.txt",   // path
+            readFileCallback);   // callback
+
+function readFileCallback(err, data) {
+  if (err) throw err;
+  console.log(data.toString());
+}
+```
+
+#### TCP Echo Server
+`net` module provides APIs for creating servers and clients. In this tutorial, we are going to create a server only. We can connect to the server and test it with external tools(e.g. `nc`).
+
+Firstly, we need to require `net` module. 
+```javascript
+var net = require('net');
+var port = 1235;  // custom port number
+```
+Then create a server with `net.createServer()`. It could have some arguments
+```javascript
+var server = net.createServer();
+```
+After creating a server, make the server listen for connections.
+```javascript
+server.listen(port);
+```
+By calling `listen`, object `server` starts listening with given port. Of course `listen` is processed asynchronously but we do not have to specify a callback. What we want to do next is not necessarily done in the callback because we are just going to add some event handlers.
+
+**IoT.js** is event-driven. We can do a lot of stuff with event handlers.
+Both `Server` and `Socket` object inherits from `EventsEmitter`, so we can add event listeners for them. For servers, we probably want to add a listener for `'connection'` event which is emitted when a new connection is made. Take a look at the following.
+```javascript
+server.on('connection', function(socket) {
+  socket.on('data', function(data) {
+    socket.write("echo: " + data);
+  });
+});
+```
+In `File Reader` example, we defined callbacks outside and referred them as arguments. In this time the function is embedded as a Function Expression.
+
+When `'connection'` event is emitted, it creates a socket and we can get it from the first argument. In the same way we did for server, add a ``data`` listener for each socket which is emitted when data is received. As we are creating an echo server, what we want to do here is just send the `data` back to client. Note that to clarify this is an echoed data, `"echo: "` is prepended to it.
+
+That is all. We just implemented an echo server less than 10 lines. Actually, the server will run forever because we did not add code for closing the server. As long as the server is listening, it does not terminate even if there is no more *javascript* code to run. As this is a simple tutorial, just kill the process manually like pressing `Ctrl+C`
+
+##### full code list
+
+```javascript
+var net = require('net');
+var port = 1235;
+
+var server = net.createServer();
+server.listen(port, 5);
+server.on('connection', function(socket) {
+  socket.on('data', function(data) {
+    socket.write("echo: " + data);
+  });
+});
+```
+##### test the server
+We have created a server but not a client. Instead of implementing a client, we are going to use a unix tool `nc`.
+
+Run the server first:
+```
+$ ./iotjs echo_server.js &
+```
+
+Connect to the server with `nc`
+```
+$ nc localhost 1235 
+```
+Type whatever you want to send, and the message will be echoed back.
+```
+hello, echo server!
+echo: hello, echo server!
+```
+
+### Module System
+Javascript(ECMAScript 5.1 or under) itself does not support module system. In web browsers, even though a web page loads several Javascript files, they are evaluated in the same context. To overcome this language limit, **IoT.js** supports [CommonJS](http://www.commonjs.org/) modules.
+
+We have used some of native modules through the examples above. When importing those modules, we use `require` function. Once `require`ed a module, we can use its APIs that are exported from the module. It will be covered in the section [Writing user modules](#writing-user-modules).
+
+#### Writing user modules
+When writing a module, APIs must be exposed by adding it in `exports` object. Otherwise it can be used only inside the module. Object `exports` will be returned when another module calls `require`.
+
+Let's write a sample module. Save it as `mymodule.js`
+```javascript
+exports.hello = 'Hello, IoT.js!';   // string
+exports.add = function(a, b) {      // function
+  return a + b;
+}
+var local = 'local string';         // string (not exported)
+```
+Let's write another module that uses the module we just wrote. By calling `require`, we get its `exports` object. We will name it `mymodule_test.js`
+```javascript
+var mymodule = require('mymodule');
+console.log(mymodule.hello);
+console.log(mymodule.add(1, 2));
+console.log(mymodule.local);
+```
+Save two files in the same directory so **IoT.js** can automatically find `mymodule.js`. Then we are ready to go. Execute the later script then you will see:
+```
+$ ./iotjs mymodule_test.js
+Hello, IoT.js!
+3
+undefined
+```
+Note that `console.log(local)` prints `undefined`. It cannot be referred because it is not added in `exports`.
\ No newline at end of file
diff --git a/docs/devs/Development-Process.md b/docs/devs/Development-Process.md
new file mode 100644 (file)
index 0000000..707b2d7
--- /dev/null
@@ -0,0 +1,69 @@
+* [Proposals, Get Answers and Report a Bug via Github Issues](#proposals-get-answers-and-report-a-bug-via-github-issues)
+* [Feature development process](#feature-development-process)
+* [Approval Path for PR(Pull Request)](#approval-path-for-prpull-request)
+* [Tips on GitHub Issues](#tips-on-github-issues)
+
+***
+
+It is the responsibility of IoT.js Maintainers and Reviewers to decide whether submitted code should be integrated into the master branch, returned for revision, or rejected.
+
+Individual developers maintain a local copy of the IoT.js codebase using the git revision control system. Git ensures that all participants are working with a common and up-to-date code base at all times. Each developer works to develop, debug, build, and validate their own code against the current codebase, so that when the time comes to integrate into the master branch of the project, their changes apply cleanly and with a minimum amount of merging effort.
+
+### Proposals, Get Answers and Report a Bug via Github Issues
+
+If you have a question about IoT.js code, have trouble any documentation, would like to suggest new feature, or find a bug, [review the current IoT.js issues](https://github.com/Samsung/iotjs/issues) in GitHub, and if necessary, [create a new issue](https://github.com/Samsung/iotjs/issues/new).
+
+**There are several labels on the Issue. Please choose proper labels on the purpose.**
+* **bug**
+* **community** : any issues on the community operation
+* **enhancement** : feature enhancement proposal
+* **help wanted**
+* **new feature request(proposal)** : new feature proposal
+* **project announcement** : general announcement on the project such as new release, new Maintainer/Reviewer and so on
+* **question** : any questions on the project
+
+and so on.
+
+### Feature development process
+
+The IoT.js Project development process is marked by the following highlights:
+* The feature development process starts with an author discussing a proposed feature with the Maintainers and Reviewers
+  - Open the issue with label 'new feature request(proposal)'
+* The Maintainers and Reviewers evaluate the idea, give feedback, and finally approve or reject the proposal.
+* The author shares the proposal with the community via **_Github issues with 'new feature request' label_**
+* The community provides feedback which can be used by the author to modify their proposal and share it with the community again.
+* The above steps are repeated until the community reaches a consensus according to the [Community Guidelines](Community-Guidelines.md).
+* After a consensus is reached, the author proceeds with the implementation and testing of the feature.
+* After the author is confident their code is ready for integration:
+  - The author generates a patch and signs off on their code.
+  - The author submits a patch according to the [Patch Submission Process](Patch-Submission-Process.md).
+* The Maintainers and Reviewers watch the pull request for the patch, test the code, and accept or reject the patch accordingly.
+* After the code passes code review, the Maintainers and Reviewers accept the code(integrated into the master branch), which completes the development process.
+* After a patch has been accepted, it remains the authoring developer's responsibility to maintain the code throughout its lifecycle, and to provide security and feature updates as needed.
+
+### Approval Path for PR(Pull Request)
+1. Developer should create/update PR to a given issue or enhancement
+2. If Developer works in a team, then peer-review by a colleague developer should be performed
+3. If peer-review was OK, then Developer should summon the component's maintainer
+4. Maintainer should check the code:
+   - make precommit testing is OK (performed automatically)
+   - No minor issues (unified implementation style, comments, etc.)
+   - No major issues (memory leak, crashes, breakage of ECMA logic, etc.)
+5. If Developer has to rework the solution then goto step 3
+6. If everything is OK, then Maintainer should approve the PR with +1(or LGTM)
+   - Code review can be performed by all the members of the project. However only Maintainer can give binding scores.
+7. When the PR get +2(2 LGTM from 2 mainatiners respectively), it should be merged.
+
+### Tips on GitHub Issues
+
+* Check existing [IoT.js issues](https://github.com/Samsung/iotjs/issues) for the answer to your issue.
+Duplicating an issue slows you and others. Search through open and closed issues to see if the problem you are running into has already been addressed.
+* If necessary, [open a new issue](https://github.com/Samsung/iotjs/issues/new).
+  - Clearly describe the issue. 
+     + What did you expect to happen?
+     + What actually happened instead?
+     + How can someone else recreate the problem?
+  - Include system details(such as the hardware, library, and operating system you are using and their versions).
+  - Paste error output and logs in the issue or in a Gist(https://gist.github.com/). 
+
+For more information about GitHub issues, refer to the [GitHub issues guidelines](https://guides.github.com/features/issues/).
\ No newline at end of file
diff --git a/docs/devs/Experimental-Features.md b/docs/devs/Experimental-Features.md
new file mode 100644 (file)
index 0000000..b905bde
--- /dev/null
@@ -0,0 +1,59 @@
+# Enabling Experimental Features
+
+This document provides a guide on how to write and build experimental features.
+
+## What's experimental build?
+
+Experimental build is an executable IoT.js including features that are not yet ready for wide use, so they are protected by an experimental status. Developers can opt in to enabling these features when building IoT.js, but they should be used with caution. Because the changes in experimental build can include not only a brand new module but also the existing modules stably used. So developers and users may face unexpected side effects. You should be aware that all the features handled in experimental build may change, be broken, or be removed in the future.
+
+## How to make IoT.js experimental build
+
+You need to make IoT.js using our build script, ["build.py"](https://github.com/Samsung/iotjs/blob/master/tools/build.py), with `--experimental` or `-e` option.
+
+ ```bash
+ tools/build.py --experimental
+
+ tools/build.py -e --iotjs-include-module experimental-module
+
+ tools/build.py -e --config=build.experimental.config
+ ```
+
+ For selecting modules to be included, you need to notify the script where your modules exist. You can use `--iotjs-include-module` or `--config` option for that. For further information, please refer to [Writing Builtin JavaScript Module](https://github.com/Samsung/iotjs/blob/master/docs/devs/Writing-New-Builtin-Module.md#writing-builtin-javascript-module).
+
+## Writing Code
+
+### Identifier for C Code
+
+Once you make IoT.js with `--experimental` option, a symbolic constant named `EXPERIMENTAL` is predefined in compile stage. You can use the identifier to seperate your experimental code from others as follows.
+
+```c
+#ifdef EXPERIMENTAL
+  // experimental
+#else
+  // normal
+#endif
+
+#ifndef EXPERIMENTAL
+  // normal
+#else
+  // experimental
+#endif
+```
+
+### Identifier for JavaScript Code
+
+In the case of javascript code, you can refer to `process.env.IOTJS_ENV` to check if running IoT.js is built with experimental features.
+
+```javascript
+if (process.env.IOTJS_ENV === 'experimental') {
+  // experimental
+} else {
+  // normal
+}
+```
+
+## Documentation
+
+When documenting a guide or an API reference about your experimental module, it's required to explicitly indicate that the features are experimental. Please put the same caution below in every single document.
+
+> :exclamation: This document describes an experimental feature and considerations. Please be aware that every experimental feature may change, be broken, or be removed in the future without any notice.
diff --git a/docs/devs/Extended-API-Guidelines.md b/docs/devs/Extended-API-Guidelines.md
new file mode 100644 (file)
index 0000000..8c7d0d4
--- /dev/null
@@ -0,0 +1,60 @@
+Basically, our basic APIs are based on node.js. They will follow same form with node.js because of compatibility.<br>
+However, extended APIs need a guideline because they are implemented by many contributor. (for consistent usability)
+
+
+# Ground Rules
+
+## API naming rules
+1. The APIs which have similar role should have same API name. 
+2. Basically, all APIs are async API. If you want to make sync API, you need to add `Sync` as a suffix.<br>For example, `readSync()`, `writeSync()`, and so on.
+
+## Generating an object 
+1. The module object should be generated using `open()` API for consistent usability. (Do not use `New` constructor)
+2. `open()` API should have configuable as first argument and callback function as second argument.<br>callback function is always optional.
+
+For example, GPIO module generate an object like below:
+```javascript
+var gpio = require('gpio');
+
+var gpio10 = gpio.open({pin: 10, direction: gpio.DIRECTION.OUT}, 
+                       function(err){console.log(err);});
+```
+
+## Minimize event generation
+1. The response of the API call uses callback function.
+2. Only generate event when user need to know something without any API call.
+3. The event which have similar role should have same event name.
+
+## Error generation
+1. `error` can be generated in both JS/native side.
+2. The `error` shoud be created in the place where it occurs.
+
+For example, error can be generated like below:
+
+In native side,
+```c
+iotjs_jargs_t jargs = iotjs_jargs_create(2);
+
+// kGpioErrRead: int
+if (result == kGpioErrRead) {
+  iotjs_jargs_append_error_with_code(&jargs, "GPIO Error", kGpioErrRead);
+}
+```
+
+In JavaScript side,
+```javascript
+if (!util.isNumber(value)) {
+  throw new TypeError('Bad arguments');
+}
+```
+
+## Type checking
+1. Type checking of API argument is possible both in JS and Native.
+2. To prevent type checking multiple times, perform type checking on the first function that receives the variable.
+3. Throw `error` when type checking is failed.
+
+
+# Recommended Rules
+1. Call `close()` api when process module occur `exit` event.
+2. If it is possible, use the functions provided by `libtuv` (File open, read, write, etc.)
+3. Callback function in API argument should be always optional.
diff --git a/docs/devs/Inside-IoT.js-Validated-Struct.md b/docs/devs/Inside-IoT.js-Validated-Struct.md
new file mode 100644 (file)
index 0000000..21fed52
--- /dev/null
@@ -0,0 +1,192 @@
+Validated struct is C struct wrapper for encapsulation and validity check.
+
+* Validated Struct Declaration
+* Constructors, Destructor, Methods
+* Ownership of validated struct instance
+  * Case 1: Validated struct instance as local variable
+  * Case 2: Validated struct instance as parameter & return
+  * Case 3: Validated struct instance as member variable of other struct
+  * Case 4: Validated struct instance as data of asynchronous execution
+
+# Validated Struct Declaration
+
+```c
+typedef struct {
+  int a;
+  void* b;
+} IOTJS_VALIDATED_STRUCT(iotjs_myclass_t);
+```
+
+Above struct will make the member variable encapsulated by wrapping real members with wrapper like below.
+
+```c
+typedef struct {
+  int a;
+  void* b;
+} iotjs_myclass_t_impl_t;
+
+typedef struct {
+  iotjs_myclass_impl_t unsafe;
+  /* More members for struct validity check exist in debug mode */
+} iotjs_myclass_t;
+
+int main() {
+  iotjs_myclass_t x;
+}
+```
+
+Only wizards will access the members directly by using `x.unsafe.a`, `x.unafe.b`, ... . Otherwize the members are only accessible with its accessor function.
+
+See `src/iotjs_def.h` for more details on real implementation.
+
+# Constructors, Destructor, Methods
+
+You should create C++-like constructors, destructor and methods with provided accessor. Then you can access the encapsulated member variables using `_this` variable, which has almost same role with C++ `this` keyword.
+You must call `destroy` for every validated structs you've created.
+
+```c
+/* Constructor */
+iotjs_myclass_t iotjs_myclass_create(int a) {
+  iotjs_myclass_t instance;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_myclass_t, &instance);
+
+  _this->a = a;
+  _this->b = malloc(a);
+
+  return instance;
+}
+
+/* Destructor */
+void iotjs_myclass_destroy(iotjs_myclass_t* instance) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_myclass_t, instance);
+  free(_this->b);
+}
+
+/* Method */
+int iotjs_myclass_get_a(iotjs_myclass_t* instance) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_myclass_t, instance);
+  return _this->a;
+}
+
+int main() {
+  /* Validated struct as local variable */
+  iotjs_myclass_t local_instance = iotjs_myclass_create(3);
+  printf("%d\n", iotjs_myclass_get_a(&local_instance));
+  iotjs_myclass_destroy(&local_instance);
+  return 0;
+}
+```
+
+# Ownership of validated struct instance
+
+The ground rule is:
+
+* Use `iotjs_classname_t` typed variable if the variable *is* responsible for destruction of instance.
+* Use `iotjs_classname_t*` typed variable if the variable *is not* responsible for destruction of instance.
+
+Below Case 1 ~ Case 4 shows the case-by-case example of the ownership rule.
+
+## Case 1: Validated struct instance as local variable
+The `local_instance` variable in previous example was the local instance of validated struct.
+Since `local_instance` should be destructed inside the function scope, `iotjs_myclass_t` type was used.
+
+## Case 2: Validated struct instance as parameter & return
+Previous example also included the example of validated struct instance as parameter and return.
+When accessing member variable `a` by calling `iotjs_myclass_get_a()`,
+`iotjs_myclass_t*` type was used as the parameter type, since it *does not* move the responsibility to destruct the instance.
+
+And when returning the newly created instance by calling `iotjs_myclass_create()`,
+`iotjs_myclass_t` type was used as return type, since it *does* move the responsibility to destruct the instance.
+
+## Case 3: Validated struct instance as member variable of other struct
+
+```c
+/* Validated struct as member variable of other struct */
+
+typedef struct {
+  iotjs_myclass_t member_instance;
+} IOTJS_VALIDATED_STRUCT(iotjs_otherclass_t)
+
+iotjs_otherclass_t iotjs_otherclass_create() {
+  /* Initialization steps for iotjs_otherclass_t */
+  _this->member_instance = iotjs_myclass_create(3);
+}
+
+void iotjs_otherclass_destroy() {
+  /* Finalization steps for iotjs_otherclass_t */
+  iotjs_myclass_destroy(&_this->member_instance);
+}
+```
+
+In the case above, `iotjs_myclass_t` instance is used as member variable of other class.
+Since `iotjs_otherclass_t` is responsible for finalizing the `member_instance`,
+it owns the variable as `iotjs_myclass_t` type, not pointer type.
+
+## Case 4: Validated struct instance as data of asynchronous execution
+Another usecase would be using validated struct as callback data.
+Currently, our all asynchronous datas are wrapped with `iotjs_*wrap_t` type,
+and they are destructed automatically.
+
+```c
+/*
+ * Public APIs in iotjs_module_fs.h
+ */
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_fs_t req;
+} IOTJS_VALIDATED_STRUCT(iotjs_fsreqwrap_t);
+
+iotjs_fsreqwrap_t* iotjs_fsreqwrap_create(const iotjs_jval_t* jcallback);
+void iotjs_fsreqwrap_dispatched(iotjs_fsreqwrap_t* fsreqwrap);
+```
+
+As you can see, constructor returns the `iotjs_fsreqwrap_t*` type,
+because it does not pass the responsibility to destruct the return value.
+It is destructed when request is dispatched, which can be informed by calling `iotjs_fsreqwrap_dispatched()`.
+The destructor `iotjs_fsreqwrap_destroy()` is hidden in c file.
+
+```c
+/*
+ * Implementation in iotjs_module_fs.c
+ */
+
+iotjs_fsreqwrap_t* iotjs_fsreqwrap_create(const iotjs_jval_t* jcallback) {
+  iotjs_fsreqwrap_t* fsreqwrap = IOTJS_ALLOC(iotjs_fsreqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_fsreqwrap_t, fsreqwrap);
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+  return fsreqwrap;
+}
+
+static void iotjs_fsreqwrap_destroy(iotjs_fsreqwrap_t* fsreqwrap) { // private function
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_fsreqwrap_t, fsreqwrap);
+  uv_fs_req_cleanup(&_this->req);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(fsreqwrap);
+}
+
+void iotjs_fsreqwrap_dispatched(iotjs_fsreqwrap_t* fsreqwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_fsreqwrap_t, fsreqwrap);
+  iotjs_fsreqwrap_destroy(fsreqwrap);
+}
+
+/*
+ * Use of iotjs_fsreqwrap_t
+ */
+
+void callback(uv_fs_t* req) {
+    do_something(req);
+    iotjs_fsreqwrap_dispatched(req); /* Call iotjs_*reqwrap_dispatched() when callback called */
+}
+
+void request(iotjs_jval_t* jcallback) {
+    iotjs_fsreqwrap_t* wrap = iotjs_fsreqwrap_create(jcallback);
+    uv_fs_request(loop, wrap->req, callback);
+}
+```
+
+In the case of tuv request wrapper, `iotjs_*reqwrap_dispatched()` should be called when the request has been dispatched.
+In the case of tuv handle wrapper, `iotjs_handlewrap_close()` should be called when the handle has been closed.
+in the case of JavaScript object wrapper, you don't have to do anything because JavaScript engine will call the destructor when the object becomes inaccessible.
+
+
diff --git a/docs/devs/Inside-IoT.js.md b/docs/devs/Inside-IoT.js.md
new file mode 100644 (file)
index 0000000..e904713
--- /dev/null
@@ -0,0 +1,292 @@
+Inside IoT.js
+=============
+
+* [Design](#design)
+* [Javascript Binding](#javascript-binding)
+  * iotjs_jval_t
+  * iotjs_jobjectwrap_t
+  * Native handler
+  * Embedding API
+* [libuv Binding](#libuv-binding)
+  * iotjs_handlewrap_t
+  * iotjs_reqwrap_t
+* [IoT.js Core](#iotjscoe)
+  * Life cycle of IoT.js
+  * Builtin
+  * Native module
+  * Event loop
+
+# Design
+
+IoT.js is built on top of [JerryScript](http://jerryscript.net/) and [libuv](http://libuv.org). JerryScript is a lightweight Javascript engine intended to run on small devices for IoT and libuv is a library for supporting asynchronous I/O. There is a layer that binds JerryScript and libuv to IoT.js.
+We will deals with the layer in [Javascript Binding](#javascript-binding) and [libuv Binding](#javascript-binding) section on this document respectively.
+
+IoT.js core layer locates above these binding layer.
+This core layer plays a central role in this project providing upper layer with fundamental functionality of running main event loop, interacting with Javascript engine, managing I/O resources via libuv, managing life cycle of objects, providing builtin modules, and so forth.
+[IoT.js Core](#iotjs-core) section deals with the layer in detail.
+
+IoT.js provides APIs for user applications to help creating IoT friendly services.
+You can see the list of API from [IoT.js API Reference](../api/IoT.js-API-reference.md).
+
+# Javascript Binding
+
+Many modern Javascript Engines come with [embedding API](#embedding-api) to provide functionality for compiling and executing Javascript program, accessing Javascript object and its value, handling errors, managing lifecyles of objects and so on.
+
+You can think of Javascript binding layer as an interface between upper layer (IoT.js core) and  underlying Javascript engine.
+Although IoT.js only supports JerryScript for now, there will be a chance that we extend supporting Javascript engine (such as [Duktape](http://duktape.org/) or [V8](https://code.google.com/p/v8/)) in the future.
+For this reason, we want to keep the layer independent from a specific Javascript engine.
+You can see interface of the layer in [iotjs_binding.h](../../src/iotjs_binding.h).
+
+## iotjs_jval_t
+
+`iotjs_jval_t` struct stands for a real Javascript object. Upper layers will access Javascript object via this struct.
+This struct provides following functionalities:
+
+* Creating a Javascript object using `iotjs_jval_create_*()` constructor.
+* Creating a Javascript object by a value.
+* Creating a Javascript function object where its body is implemented in C.
+* Creating a Javascript Error object.
+* Creating reference for a Javascript object increasing reference count.
+* Increasing reference count.
+* Decreasing reference count.
+* Checking object type.
+* Retrieving value.
+* Calling a Javascript function.
+* Evaluating a Javascript script.
+* Set and Get corresponding native data to the Javascript object.
+
+## iotjs_jobjectwrap_t
+
+You can refer Javascript object from C code side using `iotjs_jval_t` as saw above.
+When a reference for a Javascript object was made using `iotjs_jval_t`, it will increase the reference count and will decrease the count when it goes out of scope.
+
+```c
+{
+  // Create JavaScript object
+  // It increases reference count in JerryScript side.
+  iotjs_jval_t jobject = iotjs_jval_create();
+
+  // Use `jobject`
+  ...
+
+  // Before jobject goes out of scope, destroy it.
+  // It decreases reference count in JerryScript side so that it can be GC-ed.
+  iotjs_jval_destroy(&jobject)
+}
+```
+
+But the situation is different if you want to refer a Javascript object through out program execution until the object is live.
+You may write code like this:
+
+```c
+  iotjs_jval_t* jobject = (iotjs_jval_t*)malloc(sizeof(iotjs_jval_t)); // Not allowed
+```
+
+Unfortunately, we strongly do not recommend that kind of pattern. We treat pointer-types variables in special way. (See [Validated Struct](Inside-IoT.js-Validated-Struct.md) for more details.)
+
+To achieve your wish, we recommend using `iotjs_jobjectwrap_t` for that purpose.
+`iotjs_jobjectwrap_t` is kind of weak pointer to a Javascript Object.
+It refers a Javascript object but never increase reference count so that Javascript engine can collect the object when it turns into garbage.
+The `iotjs_jobjectwrap_t` instance will be released at the time the corresponding Javascript object is being reclaimed.
+
+Do not hold pointer to the wrapper in native code side globally because even if you are holding a wrapper by pointer, Javascript engine probably releases the corresponding Javascript object resulting deallocation of wrapper. Consequentially your pointer will turned into dangling.
+
+The only safe way to get wrapper is to get it from Javascript object. When a wrapper is being created, it links itself with corresponding Javascript object with `iotjs_jval_set_object_native_handle()` method of `iotjs_jval_t`. And you can get the wrapper from the object with `iotjs_jval_get_object_native_handle()` method of `iotjs_jval_t` later when you need it.
+
+
+## Native handler
+
+Some operations - such as file I/O, networking, device control, multitasking, and etc - can not be performed by pure Javascript.
+IoT.js uses a mechanism called "native handler" to enable such operations performed from Javascript.
+You can regard native handler as Javascript function object with its body implemented in C.
+
+You might think it is somewhat similar to [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface).
+In a wide sense, it's true for native handler is for calling C function from Javascript.
+But in a narrow sense, it's not true.
+
+Usually main purpose of [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) is to call a routine written in one language from a program written in another.
+After a routine was invoked, it is common that the routine just do what it is supposed to do without knowing the surrounding context except arguments.
+Whereas native handler does know that it is being called from Javascript (actually it is a Javascript function although not written in Javascript) and does access surrounding Javascript execution context using [embedding API](#embedding-api).
+
+## Embedding API
+
+Many Javascript engines these days provide embedding API. IoT.js uses the API to create [builtin module](#builtin) and [native handler](#native-handler). See following link if you want further information about the API:
+ * [JerryScript API](http://jerryscript.net/api-reference)
+ * [Duktape API](http://duktape.org/api.html)
+ * [V8 embedder's guide](https://developers.google.com/v8/embed)
+ * [SpiderMonkey API](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference)
+
+# libuv Binding
+
+IoT.js is using [libuv](http://libuv.org/) to perform various asynchronous I/O and threading.
+Because IoT.js adopts asynchronous programming model, libuv plays very important role in this project. Actually the [main loop](#event-loop) of IoT.js is libuv event loop waiting I/O event, picks the event, and dispatches it to corresponding event handler function.
+
+You can read [libuv design document](http://docs.libuv.org/en/v1.x/design.html) to get detailed information about asynchronous programming model based on libuv.
+
+## iotjs_handlewrap_t
+
+`iotjs_handlewrap_t` is to bind a Javascript object and a libuv handle (e.g. file descriptor) together.
+`iotjs_handlewrap_t` inherits `iotjs_jobjectwrap_t` since it is linked with a Javascript object.
+
+Unlike `iotjs_jobjectwrap_t`, `iotjs_jobjectwrap_t` increases RC for the Javascript object when an instance of it is created to prevent GC while the handle is alive. The reference counter will be decreased after the handle is closed, allowing GC.
+
+## iotjs_reqwrap_t
+
+`iotjs_reqwrap_t` is for wrapping libuv request data and Javascript callback function. And make sure that the Javascript callback function is alive during the I/O operation.
+
+Let's look at how asynchronous I/O are treated in IoT.js:
+
+1. Javascript module calls builtin function to perform I/O applying arguments including callback.
+2. Builtin creates `iotjs_reqwrap_t` to wrap `uv_req_s` and Javascript callback function.
+3. Builtin calls libuv to perform the I/O.
+4. After I/O finished, libuv calls builtin after handler.
+5. Builtin after handler takes `iotjs_reqwrap_t` containing I/O result and Javascript callback function.
+6. Builtin after handler calls Javascript callback.
+7. Builtin after handler release `iotjs_reqwrap_t` by calling `iotjs_*reqwrap_dispatch()`
+
+`iotjs_reqwrap_t` does not inherits `iotjs_handlewrap_t` for wrapping the callback function object.
+Note that `HandleWrap` does not increase reference count of wrapping object. It does not guarantee guarantee liveness of the object even if the wrapper is alive.
+
+On the other hand, `iotjs_reqwrap_t` increases the reference count for the callback function and decreases when it is being freed to guarantee the liveness of callback function during the request is ongoing.
+After request is finished and `iotjs_reqwrap_t` released by calling `iotjs_*reqwrap_dispatch()`, the callback function could be collected by GC when it need to be.
+
+# IoT.js Core
+
+## Life cycle of IoT.js
+
+_Note:_
+_We are currently focusing on implementing IoT.js upon JerryScript engine._
+_Implementation of initializing process depends on JerryScript API._
+_That could be changed when we adopt other Javascript engines._
+_Anyway, in this chapter we will explain initialization process based on current implementation._
+
+The process of IoT.js can be summarized as follow:
+
+1. Initialize JerryScript engine.
+2. Execute empty script
+ * Create initial Javascript context.
+3. Initialize builtin modules.
+ * Create builin modules including ['process'](../api/IoT.js-API-Process.md).
+4. Evaluate ['iotjs.js'](../../src/js/iotjs.js).
+ * Generate entry function.
+5. Run the entry function passing 'process'.
+ 1. Initialize 'process' module.
+ 2. Load user application script.
+ 3. Run user application.
+6. Run [event loop](#event-loop) until there are no more events to be handled.
+7. Clean up.
+
+## Builtin
+
+"Builtin" is Javascript objects fully implemented in C using [embedding API](#embedding-api).
+The list of builtin objects can be found at `MAP_MODULE_LIST` macro in ['iotjs_module.h'](../../src/iotjs_module.h).
+
+Because methods of builtin modules are implemented as [native handler](#native-handler),
+are able to access underlying system using libuv, C library, and system call.
+Also, builtin modules could be used for optimizing performance of CPU bound routine or reduce binary size.
+
+Builtin modules are initialized during [intializing step of IoT.js](#life-cycle-of-iotjs) and released just before program terminates.
+
+## Native module
+
+The [basic modules and extended modules](../api/IoT.js-API-reference.md) provided by IoT.js are called 'native module' because it will be included IoT.js as binary format.(not as script).
+There is a [tool](../../tools/js2c.py) that transfer Javascript script source file into C file.
+
+Usually a native module needs help from couple of [builtin](#builtin) modules which are implemented in C thus able to access underlying system.
+
+Some native modules are bound to global object while others are on demand.
+On demand modules will be created at the moment when it is first required and will not released until the program terminates.
+
+## Event loop
+
+_Note:_
+_It would be helpful to read [libuv design overview](http://docs.libuv.org/en/v1.x/design.html) to understand asynchronous I/O programming model if you are not familiar with it._
+
+_Note:_
+_In this section we will see simple file open example and relevant code segment. You can find the source files at ['iotjs.c'](../../src/iotjs.c), [`iotjs_module_fs.c`](../../src/module/iotjs_module_fs.c) and ['fs.js'](../../src/js/fs.js)_
+
+
+IoT.js follows asynchronous I/O programming model proposed by libuv to perform non-blocking, single-threaded, asynchronous I/O.
+
+You can find main loop of the program at the file ['iotjs.c'](../../src/iotjs.c) in the source tree. It looks like this:
+
+```c
+  // Run event loop.
+  bool more;
+  do {
+    more = uv_run(iotjs_environment_loop(env), UV_RUN_ONCE);
+    more |= iotjs_process_next_tick();
+    if (more == false) {
+      more = uv_loop_alive(iotjs_environment_loop(env));
+    }
+  } while (more);
+```
+
+While running a IoT.js application, it could make requests for I/O operations using [IoT.js API](../api/IoT.js-API-reference.md).
+For example, You can write a code for opening 'hello.txt' file and printing file descriptor out like this:
+```js
+fs.open('hello.txt', 'r', function(err, fd) {
+  console.log('fd:' + fd);
+});
+conosle.log('requested');
+```
+
+To handle the request, IoT.js will wrapping the request and callback function using `iotjs_reqwrap_t`.
+```c
+  iotjs_fsreqwrap_t* req_wrap = iotjs_fsreqwrap_create(jcallback);
+```
+
+libuv will take charge of actual I/O processing taking the request.
+```c
+  uv_fs_t* fs_req = iotjs_fsreqwrap_req(req_wrap);
+  int err = uv_fs_open(iotjs_environment_loop(env),
+                       fs_req,
+                       path, flags, mode,
+                       AfterAsync);
+```
+
+Since all I/O are treated as non-blocking, calling for async I/O API returns immediately right after request was sent to libuv.
+And then next line of javascript program will be executed immediately without waiting the I/O.
+Thus in the above example 'requested' will be printed out right after file open request was made.
+
+If there were I/O requests, `uv_run()` in the main loop waits by polling the requests until at least one of the request processing were finished.
+When a result for a request was produced, internal part of libuv calls corresponding handler function (let it be after function) back.
+
+Usually, the after function retrieves I/O result and `iotjs_reqwrap_t` object from request data.
+And calling the javascript callback function with the result.
+
+```c
+  iotjs_fsreqwrap_t* req_wrap = (iotjs_fsreqwrap_t*)(req->data); // get request wrapper
+  const iotjs_jval_t* cb = iotjs_fsreqwrap_jcallback(req_wrap); // javascript callback function
+
+  iotjs_jargs_t jarg = iotjs_jargs_create(2);
+  iotjs_jargs_append_null(&jarg); // in case of success.
+  iotjs_jargs_append_number(req->result); // result - file descriptor for open syscall
+
+  // callback
+  iotjs_jhelper_make_callback(cb, iotjs_jval_get_null(), &jarg);
+
+  // cleanup
+  iotjs_jargs_destroy(&jarg);
+  iotjs_fsreqwrap_dispatched(req_wrap);
+```
+
+For above file open example, calling javascript callback function would result execution of the handler.
+```js
+function(err, fd) {
+  console.log('fd:' + fd);
+}
+```
+
+One iteration of event loop is finished and `uv_run()` finally returns after all results were handled.
+Next, it calls next tick handler.
+```c
+    more |= iotjs_process_next_tick();
+```
+And for next step, main event loop checks if there were no more request to be treated.
+```c
+    if (more == false) {
+      more = uv_loop_alive(iotjs_environment_loop(env));
+    }
+```
+If there are another iteration of the loop executed. Otherwise, main event loop ends.
diff --git a/docs/devs/IoT.js-Developer's-Certificate-of-Origin-1.0.md b/docs/devs/IoT.js-Developer's-Certificate-of-Origin-1.0.md
new file mode 100644 (file)
index 0000000..9dafce0
--- /dev/null
@@ -0,0 +1,42 @@
+The IoT.js project uses the signed-off-by language and process, to give us a clear chain of trust for every patch received.
+
+> By making a contribution to this project, I certify that:  
+
+> (a)  The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
+
+> (b)  The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
+
+> (c)  The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
+
+> (d)  I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project, under the same open source license. 
+
+
+### Using the Signed-Off-By Process
+
+We have the same requirements for using the signed-off-by process as the Linux kernel. In short, you need to include a signed-off-by tag in every patch:
+
+"Signed-off-by:" this is a developer's certification that he or she has the right to submit the patch for inclusion into the project. It is an agreement to the Developer's Certificate of Origin (above). **Code without a proper signoff cannot be merged into the mainline.**
+
+You should use your real name and email address in the format below:
+
+> IoT.js-DCO-1.0-Signed-off-by: Random J Developer random@developer.example.org
+
+
+#### How to add DCO every single commit automatically.
+
+It is easy to forget adding DCO end of every commit message. Fortunately there is a nice way to do it automatically. Once you've clone the repository into your local machine, you can add `prepare commit message hook` in `.git/hooks` directory like this:
+
+```
+#!/usr/bin/env python
+
+import sys
+
+commit_msg_filepath = sys.argv[1]
+
+with open(commit_msg_filepath, "r+") as f:
+       content = f.read()
+       f.seek(0, 0)
+       f.write("%s\n\nIoT.js-DCO-1.0-Signed-off-by: <Your Name> <Your Email>" % content)
+```
+
+Please refer [Git Hooks](http://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) for more information.
\ No newline at end of file
diff --git a/docs/devs/IoT.js-Package-(outdated).md b/docs/devs/IoT.js-Package-(outdated).md
new file mode 100644 (file)
index 0000000..0a5d944
--- /dev/null
@@ -0,0 +1,121 @@
+**The content on this page does not work. Currently, there is no plan to run ipm server. This document will leave for discussion in the future.**
+
+IoT.js follows the practice of node.js npm to provide module development community with separate IoT.js own registry.
+
+* To see what it actually is, please visit [www.npmjs.com](https://www.npmjs.com/), and also [docs.npmjs.com](https://docs.npmjs.com/).
+* To avoid confusion with the original server, we'll call it "ipm", for IoT.js Package Manager.
+* Current status of "ipm" is started and it's for developers so has no separate web page. We need to develop them.
+* "npm" program is used for publish and download modules. We may fork when customization is needed.
+
+### Installing "npm"
+```
+sudo apt-get install npm
+```
+
+### Setting registry
+
+As ipm uses different server, you need to change registry information
+```
+npm config set registry="http://ipm.iotjs.net:5984/registry/_design/app/_rewrite"
+```
+
+### Adding your account
+
+You may have to register your account if you plan to publish some packages, for example,
+```
+npm set init.author.name "Your Name"
+npm set init.author.email "you@example.com"
+npm set init.author.url "http://yourblog.com"
+npm adduser
+```
+Please set to your real name and email address. url is optional.
+
+### Publish a package
+
+cd to your package folder you wish to publish and init
+```
+npm init
+```
+
+It'll ask information for your package, for an example;
+```
+Press ^C at any time to quit.
+name: (t) echotest
+version: (1.0.0) 0.0.1
+description: simple echo server
+entry point: (index.js)
+test command:
+git repository:
+keywords:
+license: (ISC)
+About to write to /(your working folder)/package.json:
+{
+  "name": "echotest",
+  "version": "0.0.1",
+  "description": "simple echo server",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "(your name) <your email address> (your blog page)",
+  "license": "ISC"
+}
+
+Is this ok? (yes) yes
+```
+
+and all things are good to go, publish.
+```
+npm publish ./
+```
+
+Please visit [npmjs.org](https://docs.npmjs.com/getting-started/publishing-npm-packages) for detailed explanations.
+
+
+### About the license of each packages
+
+IoT.js is released under Apache 2.0 license, [this page](../License.md). We assume you also agree on this license when publishing to ipm registry.
+
+### Downloading packages
+
+"npm" provides local and global packages and you may be working on some powerful machines. In IoT devices this may be somewhat different. It may not have enough memory, power, network or even no console to give commands. So it can have several scenarios depending on the device you may be working on. This may be some of them;
+
+1) Download to your machine with Linux, Mac or Windows.
+  * Install packages to your powerful machine
+  * Send it to the IoT device through copy to memory card
+  * or send through serial line, BT, USB with old time kermit or z-modem
+
+2) If it has a WiFi the download directly from the registry
+  * But to make this work, we need to develop a small shell program with iotjs.
+  * This can be done with built-in module downloader, we need to develop this.
+  * Issue [#75](https://github.com/Samsung/iotjs/issues/75) to track
+
+3) If your IoT is very small and even has no writable file system
+  * Package modules should be built-in to IoT.js at compile time.
+  * We should also develop this.
+
+4) any more ideas?
+
+
+As for case 1),
+```
+(cd to some working directory)
+npm install <package name>
+(copy node_modules folder to your device)
+```
+
+As mentioned above, npm has local and global packages. But for IoT.js lets stick on the local only. For some cases running on ROTS there may not be any globals place.
+
+### Package license
+
+You may use ipm packages freely under Apache 2.0 license, read [this page](../License.md)
+
+### Searching for packages
+
+Searching is possible with search command. See [docs.npmjs.com/cli/search](https://docs.npmjs.com/cli/search).
+
+```
+npm search <keyword>
+```
+
+If you omit the keyword, it'll list all packages registered.
diff --git a/docs/devs/Logging-IoT.js-execution.md b/docs/devs/Logging-IoT.js-execution.md
new file mode 100644 (file)
index 0000000..c835527
--- /dev/null
@@ -0,0 +1,33 @@
+### Logging Support
+
+IoT.js supports logging on Debug version. It can output message strings to the stderr console by default or any file you give.
+
+To add a message line, use one of three macros in the source, defined in iotjs_module_debug.h
+```
+DLOG()
+DDLOG()
+DDDLOG()
+```
+DLOG is level 1 which means it's an error so that should be displayed. DDLOG is for warning messages and is level 2. DDDLOG is information you need while IoT.js is running, which is level 3. Default is 1.
+
+### Setting logging level
+
+In linux, use `IOTJS_DEBUG_LEVEL` environment variable to change the level, for example, if you want to see error and warning messages;
+```
+export IOTJS_DEBUG_LEVEL=2
+```
+Numbers can be 0, 1, 2 or 3. If you give 0, it will be silence, no message.
+
+### Logging to a file
+
+To save to a file, use also the environment variable, for example;
+```
+export IOTJS_DEBUG_LOGFILE="/home/iotjsdev/iotjslog.txt"
+```
+You must have file creation rights to that directory. File will be overwritten on every start, so don't run the program before looking inside or backing it up.
+
+To disable logging to a file,
+```
+unset IOTJS_DEBUG_LOGFILE
+```
+will do.
diff --git a/docs/devs/Memory-savings-with-libtuv.md b/docs/devs/Memory-savings-with-libtuv.md
new file mode 100644 (file)
index 0000000..ca1f64b
--- /dev/null
@@ -0,0 +1,241 @@
+Memory usage with libtuv on iotjs is described here and compared to libuv.
+
+* Compared with release version in i686.
+* iotjs version: hash f8e8391d8c30a76c2f82644e454056c11a2bad1a
+
+#### runtime memory usage compare with libuv running iotjs
+
+1) how to build
+
+1-1) with libuv
+```
+./tools/build.py --buildtype=release --nochecktest 
+```
+1-2) with libtuv
+```
+./tools/build.py --buildtype=release --nochecktest --tuv
+```
+2) memory usage measurement with valgrind running `test httpserver`
+```
+valgrind ./build/i686-linux/release/iotjs/iotjs ./test/run_pass/test_httpserver.js
+```
+
+2-1) with libuv
+```
+==5740== Memcheck, a memory error detector
+==5740== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
+==5740== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
+==5740== Command: ./build/i686-linux/release/iotjs/iotjs ./test/run_pass/test_httpserver.js
+==5740== 
+==5740== 
+==5740== HEAP SUMMARY:
+==5740==     in use at exit: 0 bytes in 0 blocks
+==5740==   total heap usage: 959 allocs, 959 frees, 482,669 bytes allocated
+==5740== 
+==5740== All heap blocks were freed -- no leaks are possible
+==5740== 
+==5740== For counts of detected and suppressed errors, rerun with: -v
+==5740== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+```
+
+2-2) with libtuv
+```
+==7584== Memcheck, a memory error detector
+==7584== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
+==7584== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
+==7584== Command: ./build/i686-linux/release/iotjs/iotjs ./test/run_pass/test_httpserver.js
+==7584== 
+==7584== 
+==7584== HEAP SUMMARY:
+==7584==     in use at exit: 0 bytes in 0 blocks
+==7584==   total heap usage: 955 allocs, 955 frees, 481,645 bytes allocated
+==7584== 
+==7584== All heap blocks were freed -- no leaks are possible
+==7584== 
+==7584== For counts of detected and suppressed errors, rerun with: -v
+==7584== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+```
+
+482,669 vs 481,645 = 1,024 bytes saved
+
+#### binary size
+
+1) build
+```
+./tools/build.py --buildtype=release --nochecktest --target-arch=arm --target-os=linux
+./tools/build.py --buildtype=release --nochecktest --target-arch=arm --target-os=linux --tuv
+```
+
+2) binary size in i686-linux
+
+* libuv : 213,130 / iotjs: 2,512,292, stripped: 782,152
+* libtuv: 103,158 / iotjs: 2,460,357, stripped: 732,776
+* itself: 109,972 smaller, iotjs: 51,935(striped 49,376) saved
+
+3) binary size in arm-linux
+
+* libuv : 176,614 / iotjs: 2,543,525, stripped: 536,460
+* libtuv:  83,458 / iotjs: 2,506,455, stripped: 507,548
+* itself:  93,156 smaller, iotjs:    37,070(stripped: 28,912) saved
+
+#### libuv vs libtuv itself
+
+1) use `tuvtester` as an application to compare.
+
+2) codes changes to make both libuv.a and libtuv.a interchangeable. 
+
+2-1) as libtuv uses c++ compiler, wrap all codes with
+```
+extern "C" {
+...
+}
+```
+2-2) for libuv, give `libuv.a` by changing `tuvtest.cmake` file. use file from iotjs build.
+```
+target_link_libraries(${TUVTESTNAME} LINK_PUBLIC
+                      #${TARGETLIBNAME}
+                      "/(absolute path to libuv)/libuv.a"
+                      ${TUV_LINK_LIBS})
+```
+
+2-3) some functions that does not exist in libuv. add this bottom of in runner_main.cpp
+```
+#if 1
+
+#define uv__handle_deinit(h)                                                  \
+  do {                                                                        \
+    QUEUE_REMOVE(&(h)->handle_queue);                                         \
+    QUEUE_INIT(&(h)->handle_queue);                                           \
+  }                                                                           \
+  while (0)
+
+void uv_deinit(uv_loop_t* loop, uv_handle_t* handle) {
+  QUEUE* q;
+  uv_handle_t* h;
+
+  QUEUE_FOREACH(q, &loop->handles_queue) {
+    h = QUEUE_DATA(q, uv_handle_t, handle_queue);
+    if (h == handle) {
+      uv__handle_deinit(handle);
+      break;
+    }
+  }
+}
+
+#endif
+```
+
+2-4) remove test codes that does not run with libuv, tested codes are like this in runner_list.h
+```
+#define TEST_LIST_ALL(TE)                                                     \
+  TE(idle_basic, 5000)                                                        \
+  TE(timer_init, 5000)                                                        \
+  \
+  TE(condvar_2, 5000)                                                         \
+  TE(condvar_3, 5000)                                                         \
+  TE(cwd, 5000)                                                               \
+  \
+  TE(fs_file_noent, 5000)                                                     \
+  TE(fs_file_sync, 5000)                                                      \
+  TE(fs_file_async, 5000)                                                     \
+  TE(fs_file_write_null_buffer, 5000)                                         \
+  TE(fs_stat_missing_path, 5000)                                              \
+  TE(fs_open_dir, 5000)                                                       \
+  TE(fs_file_open_append, 5000)                                               \
+  TE(fs_read_file_eof, 5000)                                                  \
+  \
+  TE(threadpool_queue_work_simple, 5000)                                      \
+
+
+// shutdown_eof should be last of tcp test, it'll stop "echo_sevrer"
+
+#if defined(__linux__) 
+#define TEST_LIST_EXT(TE)                                                     \
+
+#else
+#define TEST_LIST_EXT(TE)                                                     \
+
+#endif
+
+#define HELPER_LIST_ALL(TE)                                                   \
+
+```
+
+3) measure
+
+run with valgrind
+```
+valgrind ./build/i686-linux/release/bin/tuvtester
+```
+
+3-1) with libuv
+```
+==24952== Memcheck, a memory error detector
+==24952== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
+==24952== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
+==24952== Command: ./build/i686-linux/release/bin/tuvtester
+==24952== 
+Run Helpers...
+[idle_basic                    ]...OK
+[timer_init                    ]...OK
+[condvar_2                     ]...OK
+[condvar_3                     ]...OK
+[cwd                           ]...OK
+[fs_file_noent                 ]...OK
+[fs_file_sync                  ]...OK
+[fs_file_async                 ]...OK
+[fs_file_write_null_buffer     ]...OK
+[fs_stat_missing_path          ]...OK
+[fs_open_dir                   ]...OK
+[fs_file_open_append           ]...OK
+[fs_read_file_eof              ]...OK
+[threadpool_queue_work_simple  ]...OK
+Waiting Helpers to end...
+==24952== 
+==24952== HEAP SUMMARY:
+==24952==     in use at exit: 0 bytes in 0 blocks
+==24952==   total heap usage: 44 allocs, 44 frees, 1,727 bytes allocated
+==24952== 
+==24952== All heap blocks were freed -- no leaks are possible
+==24952== 
+==24952== For counts of detected and suppressed errors, rerun with: -v
+==24952== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+```
+
+3-2) with libtuv
+```
+==26621== Memcheck, a memory error detector
+==26621== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
+==26621== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
+==26621== Command: ./build/i686-linux/release/bin/tuvtester
+==26621== 
+Run Helpers...
+[idle_basic                    ]...OK
+[timer_init                    ]...OK
+[condvar_2                     ]...OK
+[condvar_3                     ]...OK
+[cwd                           ]...OK
+[fs_file_noent                 ]...OK
+[fs_file_sync                  ]...OK
+[fs_file_async                 ]...OK
+[fs_file_write_null_buffer     ]...OK
+[fs_stat_missing_path          ]...OK
+[fs_open_dir                   ]...OK
+[fs_file_open_append           ]...OK
+[fs_read_file_eof              ]...OK
+[threadpool_queue_work_simple  ]...OK
+Waiting Helpers to end...
+==26621== 
+==26621== HEAP SUMMARY:
+==26621==     in use at exit: 0 bytes in 0 blocks
+==26621==   total heap usage: 40 allocs, 40 frees, 991 bytes allocated
+==26621== 
+==26621== All heap blocks were freed -- no leaks are possible
+==26621== 
+==26621== For counts of detected and suppressed errors, rerun with: -v
+```
+
+3-3) result
+
+* libuv: 1,727 bytes
+* libtuv:  991 bytes
\ No newline at end of file
diff --git a/docs/devs/Native-Module-vs-JS-Module.md b/docs/devs/Native-Module-vs-JS-Module.md
new file mode 100644 (file)
index 0000000..1fbd5c3
--- /dev/null
@@ -0,0 +1,29 @@
+# Native Module vs JS Module
+
+This document provides a basic guide on when to write a builtin module in Javascript instead of C.
+
+## What are Native module and Javascipt module?
+
+Native module is mainly aimed to get a direct access to low-level API of the operation system and is written in C code. While, Javascript module mainly exists as a bridge between native module and users. And, in some situations, it also includes handy functions and handles errors for API coverage.
+
+## When to write JS module
+
+In many cases, a well-written native code could prove better performance than the JavaScript equivalent. So, a feature, where  computational performance is important, is recommended to be written in native module. However, that doesn't mean that every module needs be written in C only. Because there are many cases where the regular Javascript code is useful. Here are a few ground rules as a guide on when to write Javascript module.
+
+1. Support Node.js API usages
+
+   One of IoT.js purposes is to support users who get used to Node.JS api as much as possible. So the builtin basic APIs should be implemented based on this purpose. A module in Node.Js generally consists a pair of native module and Javascript module. Even though there might be some optimization points on them, leave the pairs to facilitate future maintainance.
+
+2. Use Javascript module in the case where we can implement a feature more efficiently.
+
+   The `efficiently` implies effciency in terms of performance, memory, implementation time, and so on. If a certain feature could be easily and rapidly implemented in Javascript but no big difference on performance or memory compared with native module, write it in javascript module. The following includes such a case but not limited to: Type conversion, basic mathematical operations, simple functionality and so on.
+   
+3. Avoid 'Reinventing the wheel'
+
+   In case that a well-peformed feature already exists in builtin modules, it's basically not allowed to wipe it out to native module since it's unnecessary.
+
+## Argument Validation & Type Conversion
+
+For avoiding security issue, argument validation must be handled in native module. However, native module should not take a role to convert the given type for extending API coverage. It should be done in Javascript module.
+
+  e.g) In case of `new Buffer(str[, encoding])`, native module has a responsiblity to validate if the type of the first argument is `string`. However, in user perspective, giving `Number` as the first argument also works since Javascript module appropriately handles the given type to pass it over to the corresponding native module.
diff --git a/docs/devs/Optimization-Tips.md b/docs/devs/Optimization-Tips.md
new file mode 100644 (file)
index 0000000..9542744
--- /dev/null
@@ -0,0 +1,45 @@
+## Tracing JerryScript heap usage
+
+Adding below arguments when building and running IoT.js will show you the JerryScript memory status.
+
+```text
+$ ./tools/build.py --jerry-memstat
+$ ./build/bin/iotjs --memstat test.js
+Heap stats:
+  Heap size = 262136 bytes
+  Allocated = 0 bytes
+  Waste = 0 bytes
+  Peak allocated = 24288 bytes
+  Peak waste = 261 bytes
+  Skip-ahead ratio = 2.6059
+  Average alloc iteration = 1.1284
+  Average free iteration = 19.3718
+
+Pools stats:
+  Pool chunks: 0
+  Peak pool chunks: 735
+  Free chunks: 0
+  Pool reuse ratio: 0.3459
+```
+
+Note that currently only JerryScript heap usage can be shown with memstat option, not IoT.js memory usage. You can use system profiler to trace IoT.js memory usage.
+
+## JerryScript 'external magic string' feature
+
+When parsing and executing JavaScript module, JavaScript strings occupy a huge amount of space in JerryScript heap. To optimize this kind of heap usage, JerryScript has 'external magic string' feature. If you enable snapshot when building, build script will automatically generate `src/iotjs_string_ext.inl.h` file, which includes all of the JavaScript strings used in builtin modules. This file is used by JerryScript to reduce heap usage.
+
+Since same strings will be included only once, you can use this information to get some hints on binary size reduction. Note that only strings with length<32 will be included in this list.
+
+## Placement of JerryScript heap (with an example of STM32F4 CCM Memory)
+
+IoT.js uses two kind of heaps: System heap for normal usage, and separated JerryScript heap for javascript. JerryScript heap is implemented as c array with fixed length decided in static time. Its size can be ~512K.
+
+For some devices, placing this kind of large memory block can be important issue. For example, STM32F4 chips have *Core Coupled Memory* (a.k.a. *ccm* memory), which is usually used as heap or stack. However, since compiler do not have any special knowledge about JerryScript heap, it can be treated as simple array.
+
+You can make your compiler to place the JerryScript heap in specific section by using `--jerry-heap-section` argument when building IoT.js. Your argument will be used with below code in `deps/jerry/jerry-core/jcontext/jcontext.c`
+
+```c
+#define JERRY_GLOBAL_HEAP_SECTION __attribute__ ((section (JERRY_HEAP_SECTION_ATTR)))
+
+jmem_heap_t jerry_global_heap __attribute__ ((aligned (JMEM_ALIGNMENT))) JERRY_GLOBAL_HEAP_SECTION;
+```
diff --git a/docs/devs/Test-Guidelines.md b/docs/devs/Test-Guidelines.md
new file mode 100644 (file)
index 0000000..9ae8045
--- /dev/null
@@ -0,0 +1,50 @@
+### To write a test case
+
+Depend on the purpose of the test case (whether it's a positive or negative one), place it under `test/run_pass` or `test/run_fail` directory. The required external resources should be placed into `test/resources`.
+
+All test case files must be named in the following form `test_<module name>[_<functionallity].js` where `<module name>`
+should match one of the JS modules name in the IoT.js. If there is a test case which can not tied to a
+module (like some js features) then the `iotjs` name can be used as module name. It is important to
+correctly specify the module name as the test executor relies on that information.
+
+1. Write a test case and place it into the proper directory.
+2. List up the test case in [test/testsets.json](https://github.com/Samsung/iotjs/blob/master/test/testsets.json), and set attributes (timeout, skip, ...) on the test case if it needs.
+
+
+### How to Test
+
+When you build ``iotjs`` binary successfully, you can run test driver with this binary.
+
+```bash
+/path/to/iotjs tools/check_test.js
+```
+
+#### Set test options
+
+Some basic options are provided.
+
+Existing test options are listed as follows;
+```
+start-from
+quiet=yes|no (default is yes)
+output-file
+skip-module
+output-coverage=yes|no (default is no)
+experimental=yes|no (default is no)
+```
+
+To give options, please use two dashes '--' **once** before the option name as described in the following sections.
+
+Options that may need explanations.
+* start-from: a test case file name where the driver starts.
+* quiet: a flag that indicates if the driver suppresses console outputs of test case.
+* output-file: a file name where the driver leaves output.
+* skip-module: a module list to skip test of specific modules.
+* output-coverage: a flag that indicates wether coverage data should be written to disk
+* experimental: a flag that indicates if tests for experimental are needed
+
+#### Options example
+
+```bash
+build/x86_64-linux/debug/bin/iotjs tools/check_test.js -- start-from=test_console.js quiet=no
+```
\ No newline at end of file
diff --git a/docs/devs/Use-JerryScript-Debugger.md b/docs/devs/Use-JerryScript-Debugger.md
new file mode 100644 (file)
index 0000000..2af131f
--- /dev/null
@@ -0,0 +1,23 @@
+## Jerry-debugger
+
+Detailed description about the debugger is available
+[here](https://github.com/jerryscript-project/jerryscript/blob/master/docs/07.DEBUGGER.md).
+
+### Enable debugger support in IoT.js
+
+To enable the debugger support under IoT.js, the `--jerry-debugger` option
+should be passed to the `tools/build.py`. The server part of the debugger is
+intergrated into the binary of IoT.js.
+
+If you want to specify the port number of the debugger-server (default: 5001),
+you can do so with the `--jerry-debugger-port=<PORT>` option.
+
+### Usage
+
+To start the debugger-server: `<iotjs binary> --start-debug-server test.js`
+
+Two clients are included, a [python](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-debugger/jerry-client-ws.py)
+and an [HTML](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-debugger/jerry-client-ws.html) variant, they can be found under `deps/jerry/jerry-debugger/`.
+
+*Note*: When snapshot support is enabled, you won't be able to examine js-modules
+that are loaded from snapshots.
diff --git a/docs/devs/Writing-New-Builtin-Module.md b/docs/devs/Writing-New-Builtin-Module.md
new file mode 100644 (file)
index 0000000..0bbc9d6
--- /dev/null
@@ -0,0 +1,175 @@
+
+This document provides a guide on how to write a builtin module for IoT.js.
+
+Contents:
+
+* Writing Builtin JavaScript Module
+* Writing Native Module Builtin
+  - Using native module in JavaScript module
+  - Registering native module
+  - Native handler
+    * Arguments and Return
+    * Wrapping native object with JS object
+    * Callback
+
+You can see more information on the [Optimization Tips](Optimization-Tips.md) page.
+
+It will be easier to write a new IoT.js module if you have background on:
+
+- [Node.js module](https://nodejs.org/api/modules.html) (for writing IoT.js JavaScript module)
+- [Node.js native addon](https://nodejs.org/api/addons.html) (for writing IoT.js native module builtin)
+
+## Writing Builtin JavaScript Module
+
+Builtin JavaScript module can be written in the same way as writing [Node.js module](https://nodejs.org/api/modules.html). JavaScript file should be located in `src/js/` directory, and you should notify to our build script that your module should be included in one of following ways:
+
+* Use `./tools/build.py --iotjs-include-module mymodule` when building
+* Add your module in `build.config` file
+
+Your new module will look like below:
+
+src/js/mymodule.js:
+```javascript
+module.exports = {
+    foo: function() { console.log("OK"); },
+    bar: 123
+}
+```
+
+user.js:
+```javascript
+var mymodule = require('mymodule');
+mymodule.foo();            // prints "OK"
+console.log(mymodule.bar); // prints "123"
+```
+
+and execute:
+```sh
+$ ./tools/build.py
+$ ${PATH_TO}/iotjs user.js
+OK
+123
+```
+
+## Writing Native Module Builtin
+
+You can implement some part of the builtin module in C, to enhance performance and to fully exploit the H/W functionality, etc. It has similar concept with [Node.js native addon](https://nodejs.org/api/addons.html), but we have different set of APIs. Node.js uses its own binding layer with v8 API, but we use [our own binding layer](../../src/iotjs_binding.h) which wraps [JerryScript API](https://github.com/jerryscript-project/JerryScript/blob/master/jerry-core/jerryscript.h). You can see `src/iotjs_binding.*` files to find more APIs to communicate with JS-side values from native-side.
+
+For simple explanation, `console` module will be used as an example.
+
+### Using native module in JavaScript module
+
+Logging to console needs native functionality, so `console` JavaScript module in `src/js/console.js` passes its arguments into native handler like:
+
+```javascript
+var consoleBuiltin = process.binding(process.binding.console);
+...
+Console.prototype.log = consoleBuiltin.stdout(util.format.apply(this, arguments) + '\n');
+```
+
+### Registering native module
+
+According to the code above, `process.binding.console` should be defined before evaluating JavaScript code. IoT.js source code can automatically register native module if some functions are implemented as expected. First you should register your new module into `MODULE_LIST` macro in `src/iotjs_module.h`:
+```c
+#define MAP_MODULE_LIST(F) \
+  E(F, BUFFER, Buffer, buffer) \
+  E(F, CONSOLE, Console, console) \
+  E(F, CONSTANTS, Constants, constants) \
+  ...
+```
+
+Then `iotjs_jval_t Init##ModuleName()` function will be called automatically when registering native module. We already have its implementation in `src/module/iotjs_module_console.c`:
+```c
+iotjs_jval_t InitConsole() {
+  iotjs_jval_t console = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&console, "stdout", Stdout);
+  iotjs_jval_set_method(&console, "stderr", Stderr);
+
+  return console;
+}
+```
+The return value of initializer function (in this case, `iotjs_jval_t console`,) will be passed to JS-side, as a return value of calling `process.binding(process.binding.modulename)`. Calling `iotjs_jval_create_object()` will create a JavaScript object in c code.
+
+And you might want to define some functions and properties to the newly created object. `iotjs_jval_set_method()` will register a native handler as a JavaScript function property. (That's how we was able to call `consoleBuiltin.stdout()` in JavaScript.) And `iotjs_jval_set_property_*()` will define a non-function property into object. You can find the example of registering a constant value as a JavaScript property in `src/module/iotjs_module_constants.c`.
+
+### Native handler
+
+Native handler reads arguments from JavaScript, executes native operations, and returns the final value to JavaScript.
+
+#### Arguments and Return
+
+Let's see an example in `src/module/iotjs_module_console.c`:
+
+```c
+JHANDLER_FUNCTION(Stdout) {
+  JHANDLER_CHECK_ARGS(1, string);
+
+  iotjs_string_t msg = JHANDLER_GET_ARG(0, string);
+  fprintf(stdout, "%s", iotjs_string_data(&msg));
+  iotjs_string_destroy(&msg);
+}
+```
+
+Using `JHANDLER_GET_ARG(index, type)` macro inside `JHANDLER_FUNCTION()` will read JS-side argument. Since JavaScript values can have dynamic types, you must check if argument has valid type with `JHANDLER_CHECK_ARGS(number_of_arguments, type1, type2, type3, ...)` macro, which throws JavaScript TypeError when given condition is not satisfied.
+
+Calling `void iotjs_jhandler_return_*()` function inside `JHANDLER_FUNCTION()` will return value into JS-side. `undefined` will be returned if you didn't explicitly returned something, like normal JavaScript function does. Console methods doesn't have to return values, but you can easily find more examples from other modules.
+
+#### Wrapping native object with JS object
+
+`console` module is *state-free* module, i.e., console module implementation doesn't have to hold any values with it. It just passes value and that's all it does.
+
+However, there are many cases that module should maintain its state. Maintaining the state in JS-side would be simple. But maintaining values in native-side is not an easy problem, because native-side values should follow the lifecycle of JS-side values. Let's take `Buffer` module as an example. `Buffer` should maintain the native buffer content and its length. And the native buffer content should be deallocated when JS-side buffer variable becomes unreachable.
+
+There's `iotjs_jobjectwrap_t` struct for that purpose. if you create a new `iotjs_jobjectwrap_t` struct with JavaScript object as its argument and free handler, the registered free handler will be automatically called when its corresponding JavaScript object becomes unreachable. `Buffer` module also exploits this feature.
+
+```c
+// This wrapper refer javascript object but never increase reference count
+// If the object is freed by GC, then this wrapper instance will be also freed.
+typedef struct {
+  iotjs_jval_t jobject;
+} iotjs_jobjectwrap_t;
+
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+  char* buffer;
+  size_t length;
+} iotjs_bufferwrap_t;
+
+static void iotjs_bufferwrap_destroy(iotjs_bufferwrap_t* bufferwrap);
+IOTJS_DEFINE_NATIVE_HANDLE_INFO(bufferwrap);
+
+iotjs_bufferwrap_t* iotjs_bufferwrap_create(const iotjs_jval_t* jbuiltin,
+                                            size_t length) {
+  iotjs_bufferwrap_t* bufferwrap = IOTJS_ALLOC(iotjs_bufferwrap_t);
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap,
+                               jbuiltin,
+                               &bufferwrap_native_info); /* Automatically called */
+  ...
+}
+
+void iotjs_bufferwrap_destroy(iotjs_bufferwrap_t* bufferwrap) {
+  ...
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+  IOTJS_RELEASE(bufferwrap);
+}
+```
+
+You can use this code like below:
+
+```c
+const iotjs_jval_t* jbuiltin = /*...*/;
+iotjs_bufferwrap_t* buffer_wrap = iotjs_bufferwrap_create(jbuiltin, length);
+// Now `jbuiltin` object can be used in JS-side,
+// and when it becomes unreachable, `iotjs_bufferwrap_destroy` will be called.
+```
+
+#### Callback
+
+Sometimes native handler should call JavaScript function directly. For general function calls (inside current tick), you can use `iotjs_jhelper_call()` function to call JavaScript function from native-side.
+
+And for asynchronous callbacks, after `libtuv` calls your native function, if you want to call JS-side callback you should use `iotjs_make_callback()`. It will not only call the callback function, but also handle the exception, and process the next tick(i.e. it will call `iotjs_process_next_tick()`).
+
+For asynchronous callbacks, you must consider the lifetime of JS-side callback objects. The lifetime of JS-side callback object should be extended until the native-side callback is really called. You can use `iotjs_reqwrap_t` and `iotjs_handlewrap_t` to achieve this.
+
+(Work In Progress)
diff --git a/docs/targets/nuttx/stm32f4dis/IoT.js-API-Stm32f4dis.md b/docs/targets/nuttx/stm32f4dis/IoT.js-API-Stm32f4dis.md
new file mode 100644 (file)
index 0000000..30dd71e
--- /dev/null
@@ -0,0 +1,191 @@
+## Pin
+In order to use system IO, such as GPIO, PWM and ADC you need to know the pin name.
+The `stm32f4dis` module has pin object which is designed to find a pin name easier.
+
+**Example**
+
+```js
+
+var pin = require('stm32f4dis').pin;
+
+```
+
+### GPIO Pin
+P[port][pin]
+
+A configured GPIO pin.
+
+The `port` must be equal to a capital letter from 'A' to 'D'.
+
+The `pin` must be equal to an integer from 0 to 15.
+
+**Example**
+
+```js
+
+var gpio = require('gpio');
+var pin = require('stm32f4dis').pin;
+
+gpio.open(pin.PD6);
+
+```
+
+### PWM Pin
+PWM[timer].CH[channel]_[number]
+
+A configured PWM pin.
+
+The `timer` must be equal to an integer from 1 to 14.
+
+The `channel` must be equal to an integer from 1 to 4, but it also depends on the `timer`.
+
+The `number` must be equal to an integer form 1 to 2, and 3 in case of PWM3.CH1_3, PWM3.CH2_3 and PWM2.CH1_3.
+
+**Example**
+
+```js
+
+var pwm = require('pwm');
+var pin = require('stm32f4dis').pin;
+
+var pwm2 = new pwm(pin.PWM2.CH1_2);
+
+```
+
+The following table shows the available PWM pin names and their corresponding
+ GPIO pins.
+
+| PWM Pin Name | GPIO Name | PWM Pin Name | GPIO Name|
+| :---: | :---: | :---: | :---: |
+| PWM1.CH1_1 | PA8 | PWM4.CH1_1| PB6 |
+| PWM1.CH1_2 | PE9 | PWM4.CH1_2| PD12 |
+| PWM1.CH2_1 | PA9 | PWM4.CH2_1| PB7 |
+| PWM1.CH2_2 | PE11 | PWM4.CH2_2| PD13 |
+| PWM1.CH3_1 | PA10 | PWM4.CH3_1| PB8 |
+| PWM1.CH3_2 | PE13 | PWM4.CH3_2| PD14 |
+| PWM1.CH4_1 | PA11 | PWM4.CH4_1| PB9 |
+| PWM1.CH4_2 | PE14 | PWM4.CH4_2| PD15 |
+| PWM2.CH1_1| PA0 | PWM5.CH1_1| PA0 |
+| PWM2.CH1_2| PA15 | PWM5.CH2_1| PA1 |
+| PWM2.CH1_3| PA5 | PWM5.CH3_1| PA2 |
+| PWM2.CH2_1| PA1 | PWM5.CH4_1| PA3 |
+| PWM2.CH2_2| PB3 | PWM8.CH1_1| PC6 |
+| PWM2.CH3_1| PA2| PWM8.CH2_1| PC7|
+| PWM2.CH3_2| PB10| PWM8.CH3_1| PC8|
+| PWM2.CH4_1| PA3 | PWM8.CH4_1| PC9 |
+| PWM2.CH4_2| PB11 | PWM9.CH1_1 | PA2 |
+| PWM3.CH1_1 | PA6 | PWM9.CH1_2 | PE5 |
+| PWM3.CH1_2 | PB4 | PWM9.CH2_1 | PA3 |
+| PWM3.CH1_3 | PC6 | PWM9.CH2_2 | PE6 |
+| PWM3.CH2_1 | PA7 | PWM10.CH1_1 | PB8 |
+| PWM3.CH2_2 | PB5 | PWM11.CH1_1 | PB9 |
+| PWM3.CH2_3 | PC7 | PWM12.CH1_2 | PB14 |
+| PWM3.CH3_1 | PA11 | PWM12.CH2_1 | PB15 |
+| PWM3.CH3_2 | PE14 | PWM13.CH1_1 | PA6 |
+| PWM3.CH4_1 | PB1 | PWM14.CH1_1 | PA7 |
+| PWM3.CH4_2 | PC9 | | |
+
+### ADC Pin
+ADC[number]_[timer]
+
+A configured ADC pin.
+
+The `number`  must be equal to an integer from 1 to 3.
+
+The `timer` must be equal to an integer from 0 to 15.
+
+**Example**
+
+```js
+
+var adc = require('adc');
+var pin = require('stm32f4dis').pin;
+
+var adc1 = new adc(pin.ADC1_3);
+
+```
+
+The following table shows the available ADC pin names and their corresponding
+ GPIO pins.
+
+| ADC Pin Name | GPIO Name |
+| :--- | :---: |
+| ADC1_0, ADC2_0, ADC3_0 | PA0 |
+| ADC1_1, ADC2_1, ADC3_1 | PA1 |
+| ADC1_2, ADC2_2, ADC3_2 | PA2 |
+| ADC1_3, ADC2_3, ADC3_3 | PA3 |
+| ADC1_4, ADC2_4 | PA4 |
+| ADC1_5, ADC2_5 | PA5 |
+| ADC1_6, ADC2_6 | PA6 |
+| ADC1_7, ADC2_7 | PA7 |
+| ADC1_8, ADC2_8 | PB0 |
+| ADC1_9, ADC2_9 | PB1 |
+| ADC1_10, ADC2_10, ADC3_10 | PC0 |
+| ADC1_11, ADC2_11, ADC3_11 | PC1 |
+| ADC1_12, ADC2_12, ADC3_12 | PC2 |
+| ADC1_13, ADC2_13, ADC3_13 | PC3 |
+| ADC1_14, ADC2_14 | PC4 |
+| ADC1_15, ADC2_15 | PC5 |
+
+## UART Port Information
+
+In order to use the UART on stm32f4-discovery board, you must use proper pins.
+
+The stm32f4-discovery board supports 4 UART ports, such as USART2, USART3, UART5, USART6.
+The UART5 port and the SDIO uses the same pin for connection. SDIO is enabled by default, so be careful when you enable the UART5 port.
+
+The following table shows the U[S]ART pin map:
+
+| U[S]ART Pin Name | GPIO Name |
+| :--- | :---: |
+| USART2_RX | PA3 |
+| USART2_TX | PA2 |
+| USART3_RX | PB11 |
+| USART3_TX | PB10 |
+| UART5_RX | PD2 |
+| UART5_TX | PC12 |
+| USART6_RX | PC7 |
+| USART6_TX | PC6 |
+
+Note: The name of the UART device cannot find by the `stm32f4dis.pin` module, because it can be changed in the NuttX configuration file. It should be '/dev/ttyS[0-3]'.
+
+### Enable USART1 and UART4
+
+The current version of the NuttX does not support the USART1 and UART4 ports for stm32f4-discovery board.
+
+The `config/nuttx/stm32f4dis/patch` file contains the implementations of the the USART1 and UART4 ports. It maps the PB6 and PB7 gpio pins to USART1_TX and USART2_RX, PA0 and PA1 gpio pins to UART4_TX and UART4_RX respectively.
+
+Note: You can add more ports according to the patch file.
+
+**Apply the patch**
+
+```bash
+
+~/workspace/nuttx$ patch -p1 < ../iotjs/config/nuttx/stm32f4dis/patch
+
+```
+
+## I2C Port Information
+
+In order to use the I2C on stm32f4-discovery board, you must use proper pins.
+Currently only I2C1 is supported.
+
+The following table shows the I2C pin map:
+
+| I2C Pin Name | GPIO Name |
+| :--- | :---: |
+| I2C1_SCL | PB8 |
+| I2C1_SDA | PB7 |
+
+
+## SPI Bus Information
+
+The following table shows currently supported SPI pin number list.
+Currently only SPI1 is supported.
+
+| SPI Pin Name | GPIO Name |
+| :--- | :---: |
+| SPI1_SCK | PA5 |
+| SPI1_MISO | PA6 |
+| SPI1_MOSI | PA7 |
+| SPI1_NSS | PA15 |
\ No newline at end of file
diff --git a/docs/targets/tizenrt/artik05x/IoT.js-API-artik053.md b/docs/targets/tizenrt/artik05x/IoT.js-API-artik053.md
new file mode 100644 (file)
index 0000000..29f97ac
--- /dev/null
@@ -0,0 +1,33 @@
+## Artik053 module
+
+## `Pin`
+To use system IO, such as PWM, you must know pin name.
+
+
+### `PWM Pin Number` <a name="pwm-pin"></a>
+
+For example,
+``` javascript
+var pwm = new require('pwm')();
+var config = {
+  pin: 0,
+  period: 0.001,
+  dutyCycle: 0.5
+}
+var pwm0 = pwm.open(config, function() {
+  if (err) {
+    throw err;
+  }
+});
+```
+The following is a list of PWM pin numbers.
+
+| PWM Pin number | GPIO Name |
+| :---: | :---: |
+| 0 | XPWMTOUT_0 |
+| 1 | XPWMTOUT_1 |
+| 2 | XPWMTOUT_2 |
+| 3 | XPWMTOUT_3 |
+| 4 | XPWMTOUT_4 |
+| 5 | XPWMTOUT_5 |
+| 6 | XPWMTOUT_6 |
diff --git a/include/iotjs.h b/include/iotjs.h
new file mode 100644 (file)
index 0000000..a15070a
--- /dev/null
@@ -0,0 +1,30 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_IOTJS_H
+#define IOTJS_IOTJS_H
+
+
+#ifdef __cplusplus
+#define IOTJS_EXTERN_C extern "C"
+#else /* !__cplusplus */
+#define IOTJS_EXTERN_C extern
+#endif /* !__cplusplus */
+
+
+IOTJS_EXTERN_C int iotjs_entry(int argc, char** argv);
+
+
+#endif /* IOTJS_IOTJS_H */
diff --git a/iotjs b/iotjs
deleted file mode 160000 (submodule)
index ba70332..0000000
--- a/iotjs
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit ba703320768db0c1c988671ec8bbb5bfbca1d868
diff --git a/iotjs_linux.c b/iotjs_linux.c
new file mode 100644 (file)
index 0000000..78fb5d1
--- /dev/null
@@ -0,0 +1,20 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs.h"
+
+int main(int argc, char** argv) {
+  return iotjs_entry(argc, argv);
+}
diff --git a/samples/gpio-blinkedled/gpio_led.js b/samples/gpio-blinkedled/gpio_led.js
new file mode 100644 (file)
index 0000000..c0decac
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var Gpio = require('gpio');
+var pin = require('systemio_pin').pin;
+
+var gpio = new Gpio();
+
+var gpio_led = gpio.open({
+  pin: pin.led1,
+  direction: gpio.DIRECTION.OUT
+}, function(err) {
+  if (!err) {
+    gpio_led.writeSync(true);
+
+    var interval = setInterval(function() {
+      gpio_led.read(function(err, value) {
+        if (!err) {
+          console.log("read value:%d", value);
+          gpio_led.write(!value);
+        } else {
+          clearInterval(interval);
+        }
+      });
+    }, 1000);
+  }
+});
diff --git a/samples/gpio-blinkedled/systemio_pin.js b/samples/gpio-blinkedled/systemio_pin.js
new file mode 100644 (file)
index 0000000..c4ec6e6
--- /dev/null
@@ -0,0 +1,27 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var pin = {};
+
+if (process.platform === 'linux') {
+  pin.led1 = 20;
+} else if (process.platform === 'nuttx') {
+  var stm32_pin = require('stm32f4dis').pin;
+  pin.led1 = stm32_pin.PA10;
+} else {
+  throw new Error('Unsupported platform');
+}
+
+exports.pin = pin;
diff --git a/samples/http-hello/client_get.js b/samples/http-hello/client_get.js
new file mode 100644 (file)
index 0000000..7bcefce
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var http = require('http');
+var options = {
+  hostname: '127.0.0.1',
+  port: 8080,
+  path: '/'
+};
+
+http.request(options, function (res) {
+  receive(res, function (data) {
+    console.log(data);
+  });
+}).end();
+
+function receive(incoming, callback) {
+  var data = '';
+
+  incoming.on('data', function (chunk) {
+    data += chunk;
+  });
+
+  incoming.on('end', function () {
+    callback ? callback(data) : '';
+  });
+}
diff --git a/samples/http-hello/client_post.js b/samples/http-hello/client_post.js
new file mode 100644 (file)
index 0000000..277bb0d
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var http = require('http');
+
+var message = JSON.stringify({
+  greeting: 'Hello, IoT.JS!',
+  answer: '',
+});
+
+var options = {
+  hostname: '127.0.0.1',
+  port: 8080,
+  path: '/',
+  method: 'POST',
+  headers: {
+    'Content-Length': message.length
+  }
+};
+
+http.request(options, function (res) {
+  receive(res, function (data) {
+    var obj = JSON.parse(data);
+    console.log(obj.answer);
+  });
+}).end(message);
+
+function receive(incoming, callback) {
+  var data = '';
+
+  incoming.on('data', function (chunk) {
+    data += chunk;
+  });
+
+  incoming.on('end', function () {
+    callback ? callback(data) : '';
+  });
+}
diff --git a/samples/http-hello/server.js b/samples/http-hello/server.js
new file mode 100644 (file)
index 0000000..3fcbe48
--- /dev/null
@@ -0,0 +1,60 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var http = require('http');
+var port = 8080;
+
+http.createServer(function (req, res) {
+  if (req.method == 'GET') {
+    status(res, 'Hello, IoT.JS!');
+
+  } else if (req.method == 'POST') {
+    receive(req, function (data) {
+      var obj = JSON.parse(data);
+      obj.answer = 'Hello, There!'
+      status(res, obj);
+    });
+  }
+}).listen(port);
+
+function receive(incoming, callback) {
+  var data = '';
+
+  incoming.on('data', function (chunk) {
+    data += chunk;
+  });
+
+  incoming.on('end', function () {
+    callback ? callback(data) : '';
+  });
+}
+
+function status(res, data) {
+  var isJson = (typeof data === 'object');
+
+  if (isJson) {
+    data = JSON.stringify(data);
+  }
+
+  var headers = {
+    'Access-Control-Allow-Origin': '*',
+    'Access-Control-Allow-Headers':
+    'Origin, X-Requested-With, Content-Type, Accept',
+    'Content-Type': isJson ? 'application/json' : 'text/plain',
+  };
+
+  res.writeHead(200, headers);
+  res.end(data);
+};
diff --git a/samples/net-hello/client.js b/samples/net-hello/client.js
new file mode 100644 (file)
index 0000000..8c0dc1d
--- /dev/null
@@ -0,0 +1,34 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var net = require('net');
+
+var port = 7468;
+
+var msg = '';
+var socket = new net.Socket();
+
+var address = process.argv[2] ? process.argv[2] : "127.0.0.1";
+
+socket.connect(port, address);
+
+socket.on('data', function(data) {
+  msg += data;
+});
+
+socket.on('end', function() {
+  console.log(msg);
+  socket.end();
+});
diff --git a/samples/net-hello/server.js b/samples/net-hello/server.js
new file mode 100644 (file)
index 0000000..fc5df42
--- /dev/null
@@ -0,0 +1,25 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var net = require('net');
+
+var port = 7468;
+var server = net.createServer();
+
+server.listen(port, 5);
+
+server.on('connection', function(socket) {
+  socket.end('Hello IoT.js');
+});
diff --git a/src/iotjs.c b/src/iotjs.c
new file mode 100644 (file)
index 0000000..69a8dc8
--- /dev/null
@@ -0,0 +1,225 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+
+#include "iotjs.h"
+#include "iotjs_handlewrap.h"
+#include "iotjs_js.h"
+#include "iotjs_string_ext.h"
+
+#include "jerryscript-debugger.h"
+#ifndef __NUTTX__
+#include "jerryscript-port-default.h"
+#endif
+#include "jerryscript-port.h"
+#include "jerryscript.h"
+
+#include <stdio.h>
+#include <string.h>
+
+
+/**
+ * Initialize JerryScript.
+ */
+static bool iotjs_jerry_initialize(const iotjs_environment_t* env) {
+  // Set jerry run flags.
+  uint32_t jerry_flag = JERRY_INIT_EMPTY;
+
+  if (iotjs_environment_config(env)->memstat) {
+    jerry_flag |= JERRY_INIT_MEM_STATS;
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+    jerry_port_default_set_log_level(JERRY_LOG_LEVEL_DEBUG);
+#endif
+  }
+
+  if (iotjs_environment_config(env)->show_opcode) {
+    jerry_flag |= JERRY_INIT_SHOW_OPCODES;
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+    jerry_port_default_set_log_level(JERRY_LOG_LEVEL_DEBUG);
+#endif
+  }
+
+  if (iotjs_environment_config(env)->debugger) {
+    jerry_flag |= JERRY_INIT_DEBUGGER;
+  }
+
+  // Initialize jerry.
+  jerry_init((jerry_init_flag_t)jerry_flag);
+
+  if (iotjs_environment_config(env)->debugger) {
+    jerry_debugger_continue();
+  }
+
+  // Set magic strings.
+  iotjs_register_jerry_magic_string();
+
+  // Do parse and run to generate initial javascript environment.
+  jerry_value_t parsed_code = jerry_parse((jerry_char_t*)"", 0, false);
+  if (jerry_value_has_error_flag(parsed_code)) {
+    DLOG("jerry_parse() failed");
+    jerry_release_value(parsed_code);
+    return false;
+  }
+
+  jerry_value_t ret_val = jerry_run(parsed_code);
+  if (jerry_value_has_error_flag(ret_val)) {
+    DLOG("jerry_run() failed");
+    jerry_release_value(parsed_code);
+    jerry_release_value(ret_val);
+    return false;
+  }
+
+  jerry_release_value(parsed_code);
+  jerry_release_value(ret_val);
+  return true;
+}
+
+
+static void iotjs_jerry_release() {
+  jerry_cleanup();
+}
+
+
+static bool iotjs_run() {
+  // Evaluating 'iotjs.js' returns a function.
+  bool throws = false;
+#ifndef ENABLE_SNAPSHOT
+  iotjs_jval_t jmain = iotjs_jhelper_eval("iotjs.js", strlen("iotjs.js"),
+                                          iotjs_s, iotjs_l, false, &throws);
+#else
+  iotjs_jval_t jmain = iotjs_jhelper_exec_snapshot(iotjs_s, iotjs_l, &throws);
+#endif
+
+  if (throws) {
+    iotjs_uncaught_exception(&jmain);
+  }
+
+  iotjs_jval_destroy(&jmain);
+
+  return !throws;
+}
+
+
+static bool iotjs_start(iotjs_environment_t* env) {
+  // Initialize commonly used jerry values
+  iotjs_binding_initialize();
+
+  // Bind environment to global object.
+  const iotjs_jval_t* global = iotjs_jval_get_global_object();
+  iotjs_jval_set_object_native_handle(global, (uintptr_t)(env), NULL);
+
+  // Initialize builtin modules.
+  iotjs_module_list_init();
+
+  // Initialize builtin process module.
+  const iotjs_jval_t* process =
+      iotjs_module_initialize_if_necessary(MODULE_PROCESS);
+
+  // Call the entry.
+  // load and call iotjs.js
+  iotjs_environment_go_state_running_main(env);
+
+  iotjs_jval_set_property_jval(global, "process", process);
+
+  iotjs_run();
+
+  // Run event loop.
+  iotjs_environment_go_state_running_loop(env);
+
+  bool more;
+  do {
+    more = uv_run(iotjs_environment_loop(env), UV_RUN_ONCE);
+    more |= iotjs_process_next_tick();
+    if (more == false) {
+      more = uv_loop_alive(iotjs_environment_loop(env));
+    }
+    jerry_value_t ret_val = jerry_run_all_enqueued_jobs();
+    if (jerry_value_has_error_flag(ret_val)) {
+      DLOG("jerry_run_all_enqueued_jobs() failed");
+    }
+  } while (more);
+
+  iotjs_environment_go_state_exiting(env);
+
+  // Emit 'exit' event.
+  iotjs_process_emit_exit(0);
+
+  // Release builtin modules.
+  iotjs_module_list_cleanup();
+
+  // Release commonly used jerry values.
+  iotjs_binding_finalize();
+
+  return true;
+}
+
+
+static void iotjs_uv_walk_to_close_callback(uv_handle_t* handle, void* arg) {
+  iotjs_handlewrap_t* handle_wrap = iotjs_handlewrap_from_handle(handle);
+  IOTJS_ASSERT(handle_wrap != NULL);
+
+  iotjs_handlewrap_close(handle_wrap, NULL);
+}
+
+
+int iotjs_entry(int argc, char** argv) {
+  // Initialize debug print.
+  init_debug_settings();
+
+  // Create environment.
+  iotjs_environment_t* env = (iotjs_environment_t*)iotjs_environment_get();
+
+  // Parse command line arguments.
+  if (!iotjs_environment_parse_command_line_arguments(env, (uint32_t)argc,
+                                                      argv)) {
+    DLOG("iotjs_environment_parse_command_line_arguments failed");
+    return 1;
+  }
+
+  // Set event loop.
+  iotjs_environment_set_loop(env, uv_default_loop());
+
+  // Initialize JerryScript engine.
+  if (!iotjs_jerry_initialize(env)) {
+    DLOG("iotjs_jerry_initialize failed");
+    return 1;
+  }
+
+  // Start IoT.js
+  if (!iotjs_start(env)) {
+    DLOG("iotjs_start failed");
+    return 1;
+  }
+
+  // close uv loop.
+  // uv_stop(iotjs_environment_loop(env));
+  uv_walk(iotjs_environment_loop(env), iotjs_uv_walk_to_close_callback, NULL);
+  uv_run(iotjs_environment_loop(env), UV_RUN_DEFAULT);
+
+  int res = uv_loop_close(iotjs_environment_loop(env));
+  IOTJS_ASSERT(res == 0);
+
+  // Release JerryScript engine.
+  iotjs_jerry_release();
+
+  // Release environment.
+  iotjs_environment_release();
+
+  // Release debug print setting.
+  release_debug_settings();
+
+  return 0;
+}
diff --git a/src/iotjs_binding.c b/src/iotjs_binding.c
new file mode 100644 (file)
index 0000000..8d256e2
--- /dev/null
@@ -0,0 +1,905 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "iotjs_def.h"
+#include "iotjs_binding.h"
+
+#include <string.h>
+
+
+static iotjs_jval_t jundefined;
+static iotjs_jval_t jnull;
+static iotjs_jval_t jtrue;
+static iotjs_jval_t jfalse;
+static iotjs_jval_t jglobal;
+
+static iotjs_jargs_t jargs_empty;
+
+static jerry_value_t iotjs_jval_as_raw(const iotjs_jval_t* jval);
+
+
+iotjs_jval_t iotjs_jval_create_number(double v) {
+  iotjs_jval_t jval;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jval_t, &jval);
+
+  _this->value = jerry_create_number(v);
+  return jval;
+}
+
+
+iotjs_jval_t iotjs_jval_create_string(const iotjs_string_t* v) {
+  iotjs_jval_t jval;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jval_t, &jval);
+
+  const jerry_char_t* data = (const jerry_char_t*)(iotjs_string_data(v));
+  jerry_size_t size = iotjs_string_size(v);
+
+  if (jerry_is_valid_utf8_string(data, size)) {
+    _this->value = jerry_create_string_sz_from_utf8(data, size);
+  } else {
+    _this->value =
+        jerry_create_error(JERRY_ERROR_TYPE,
+                           (const jerry_char_t*)"Invalid UTF-8 string");
+  }
+
+  return jval;
+}
+
+
+iotjs_jval_t iotjs_jval_get_string_size(const iotjs_string_t* str) {
+  iotjs_jval_t str_val = iotjs_jval_create_string(str);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, &str_val);
+
+  jerry_size_t size = jerry_get_string_size(_this->value);
+  iotjs_jval_t jval = iotjs_jval_create_number(size);
+
+  iotjs_jval_destroy(&str_val);
+
+  return jval;
+}
+
+
+iotjs_jval_t iotjs_jval_create_string_raw(const char* data) {
+  iotjs_jval_t jval;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jval_t, &jval);
+
+  _this->value = jerry_create_string((const jerry_char_t*)data);
+
+  return jval;
+}
+
+
+iotjs_jval_t iotjs_jval_create_object() {
+  iotjs_jval_t jval;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jval_t, &jval);
+
+  _this->value = jerry_create_object();
+
+  return jval;
+}
+
+
+iotjs_jval_t iotjs_jval_create_array(uint32_t len) {
+  iotjs_jval_t jval;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jval_t, &jval);
+
+  _this->value = jerry_create_array(len);
+
+  return jval;
+}
+
+
+iotjs_jval_t iotjs_jval_create_byte_array(uint32_t len, const char* data) {
+  iotjs_jval_t jval;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jval_t, &jval);
+
+  IOTJS_ASSERT(data != NULL);
+
+  _this->value = jerry_create_array(len);
+  for (uint32_t i = 0; i < len; i++) {
+    jerry_value_t val = jerry_create_number((double)data[i]);
+    jerry_set_property_by_index(_this->value, i, val);
+    jerry_release_value(val);
+  }
+
+  return jval;
+}
+
+
+iotjs_jval_t iotjs_jval_create_function(JHandlerType handler) {
+  iotjs_jval_t jval;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jval_t, &jval);
+
+  _this->value = jerry_create_external_function(handler);
+  IOTJS_ASSERT(jerry_value_is_constructor(_this->value));
+
+  return jval;
+}
+
+
+iotjs_jval_t iotjs_jval_create_error(const char* msg) {
+  return iotjs_jval_create_error_type(IOTJS_ERROR_COMMON, msg);
+}
+
+
+iotjs_jval_t iotjs_jval_create_error_type(iotjs_error_t type, const char* msg) {
+  iotjs_jval_t jval;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jval_t, &jval);
+
+  const jerry_char_t* jmsg = (const jerry_char_t*)(msg);
+  _this->value = jerry_create_error((jerry_error_t)type, jmsg);
+  jerry_value_clear_error_flag(&_this->value);
+
+  return jval;
+}
+
+
+iotjs_jval_t iotjs_jval_create_copied(const iotjs_jval_t* other) {
+  iotjs_jval_t jval;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jval_t, &jval);
+
+  _this->value = jerry_acquire_value(iotjs_jval_as_raw(other));
+  return jval;
+}
+
+
+static iotjs_jval_t iotjs_jval_create_raw(jerry_value_t val) {
+  iotjs_jval_t jval;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jval_t, &jval);
+
+  _this->value = val;
+
+  return jval;
+}
+
+
+void iotjs_jval_destroy(iotjs_jval_t* jval) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_jval_t, jval);
+  jerry_release_value(_this->value);
+}
+
+
+static void iotjs_jval_destroy_norelease(iotjs_jval_t* jval) {
+  IOTJS_VALIDATABLE_STRUCT_DESTRUCTOR_VALIDATE(iotjs_jval_t, jval);
+}
+
+
+iotjs_jval_t* iotjs_jval_get_undefined() {
+  return &jundefined;
+}
+
+
+iotjs_jval_t* iotjs_jval_get_null() {
+  return &jnull;
+}
+
+
+iotjs_jval_t* iotjs_jval_get_boolean(bool v) {
+  return v ? &jtrue : &jfalse;
+}
+
+
+iotjs_jval_t* iotjs_jval_get_global_object() {
+  return &jglobal;
+}
+
+
+#define TYPE_CHECKER_BODY(jval_type)                        \
+  bool iotjs_jval_is_##jval_type(const iotjs_jval_t* val) { \
+    const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, val); \
+    return jerry_value_is_##jval_type(_this->value);        \
+  }
+
+FOR_EACH_JVAL_TYPES(TYPE_CHECKER_BODY)
+
+#undef TYPE_CHECKER_BODY
+
+
+bool iotjs_jval_as_boolean(const iotjs_jval_t* jval) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, jval);
+  IOTJS_ASSERT(iotjs_jval_is_boolean(jval));
+  return jerry_get_boolean_value(_this->value);
+}
+
+
+double iotjs_jval_as_number(const iotjs_jval_t* jval) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, jval);
+  IOTJS_ASSERT(iotjs_jval_is_number(jval));
+  return jerry_get_number_value(_this->value);
+}
+
+
+iotjs_string_t iotjs_jval_as_string(const iotjs_jval_t* jval) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, jval);
+  IOTJS_ASSERT(iotjs_jval_is_string(jval));
+
+  jerry_size_t size = jerry_get_string_size(_this->value);
+
+  if (size == 0)
+    return iotjs_string_create();
+
+  char* buffer = iotjs_buffer_allocate(size + 1);
+  jerry_char_t* jerry_buffer = (jerry_char_t*)(buffer);
+
+  size_t check = jerry_string_to_char_buffer(_this->value, jerry_buffer, size);
+
+  IOTJS_ASSERT(check == size);
+  buffer[size] = '\0';
+
+  iotjs_string_t res = iotjs_string_create_with_buffer(buffer, size);
+
+  return res;
+}
+
+
+const iotjs_jval_t* iotjs_jval_as_object(const iotjs_jval_t* jval) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jval_t, jval);
+  IOTJS_ASSERT(iotjs_jval_is_object(jval));
+  return jval;
+}
+
+
+const iotjs_jval_t* iotjs_jval_as_array(const iotjs_jval_t* jval) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jval_t, jval);
+  IOTJS_ASSERT(iotjs_jval_is_array(jval));
+  return jval;
+}
+
+
+const iotjs_jval_t* iotjs_jval_as_function(const iotjs_jval_t* jval) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jval_t, jval);
+  IOTJS_ASSERT(iotjs_jval_is_function(jval));
+  return jval;
+}
+
+
+static jerry_value_t iotjs_jval_as_raw(const iotjs_jval_t* jval) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, jval);
+  return _this->value;
+}
+
+
+bool iotjs_jval_set_prototype(const iotjs_jval_t* jobj, iotjs_jval_t* jproto) {
+  jerry_value_t ret =
+      jerry_set_prototype(iotjs_jval_as_raw(jobj), iotjs_jval_as_raw(jproto));
+  bool error_found = jerry_value_has_error_flag(ret);
+  jerry_release_value(ret);
+
+  return !error_found;
+}
+
+
+void iotjs_jval_set_method(const iotjs_jval_t* jobj, const char* name,
+                           iotjs_native_handler_t handler) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jval_t, jobj);
+  IOTJS_ASSERT(iotjs_jval_is_object(jobj));
+
+  iotjs_jval_t jfunc = iotjs_jval_create_function_with_dispatch(handler);
+  iotjs_jval_set_property_jval(jobj, name, &jfunc);
+  iotjs_jval_destroy(&jfunc);
+}
+
+
+void iotjs_jval_set_property_jval(const iotjs_jval_t* jobj, const char* name,
+                                  const iotjs_jval_t* val) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, jobj);
+  IOTJS_ASSERT(iotjs_jval_is_object(jobj));
+
+  jerry_value_t prop_name = jerry_create_string((const jerry_char_t*)(name));
+  jerry_value_t value = iotjs_jval_as_raw(val);
+  jerry_value_t ret_val = jerry_set_property(_this->value, prop_name, value);
+  jerry_release_value(prop_name);
+
+  IOTJS_ASSERT(!jerry_value_has_error_flag(ret_val));
+  jerry_release_value(ret_val);
+}
+
+
+void iotjs_jval_set_property_null(const iotjs_jval_t* jobj, const char* name) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jval_t, jobj);
+  iotjs_jval_set_property_jval(jobj, name, iotjs_jval_get_null());
+}
+
+
+void iotjs_jval_set_property_undefined(const iotjs_jval_t* jobj,
+                                       const char* name) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jval_t, jobj);
+  iotjs_jval_set_property_jval(jobj, name, iotjs_jval_get_undefined());
+}
+
+
+void iotjs_jval_set_property_boolean(const iotjs_jval_t* jobj, const char* name,
+                                     bool v) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jval_t, jobj);
+  iotjs_jval_set_property_jval(jobj, name, iotjs_jval_get_boolean(v));
+}
+
+
+void iotjs_jval_set_property_number(const iotjs_jval_t* jobj, const char* name,
+                                    double v) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jval_t, jobj);
+  iotjs_jval_t jval = iotjs_jval_create_number(v);
+  iotjs_jval_set_property_jval(jobj, name, &jval);
+  iotjs_jval_destroy(&jval);
+}
+
+
+void iotjs_jval_set_property_string(const iotjs_jval_t* jobj, const char* name,
+                                    const iotjs_string_t* v) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jval_t, jobj);
+  iotjs_jval_t jval = iotjs_jval_create_string(v);
+  iotjs_jval_set_property_jval(jobj, name, &jval);
+  iotjs_jval_destroy(&jval);
+}
+
+
+void iotjs_jval_set_property_string_raw(const iotjs_jval_t* jobj,
+                                        const char* name, const char* v) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jval_t, jobj);
+  iotjs_jval_t jval = iotjs_jval_create_string_raw(v);
+  iotjs_jval_set_property_jval(jobj, name, &jval);
+  iotjs_jval_destroy(&jval);
+}
+
+
+iotjs_jval_t iotjs_jval_get_property(const iotjs_jval_t* jobj,
+                                     const char* name) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, jobj);
+  IOTJS_ASSERT(iotjs_jval_is_object(jobj));
+
+  jerry_value_t prop_name = jerry_create_string((const jerry_char_t*)(name));
+  jerry_value_t res = jerry_get_property(_this->value, prop_name);
+  jerry_release_value(prop_name);
+
+  if (jerry_value_has_error_flag(res)) {
+    jerry_release_value(res);
+    return iotjs_jval_create_copied(iotjs_jval_get_undefined());
+  }
+
+  return iotjs_jval_create_raw(res);
+}
+
+
+void iotjs_jval_set_object_native_handle(const iotjs_jval_t* jobj,
+                                         uintptr_t ptr,
+                                         JNativeInfoType native_info) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, jobj);
+  IOTJS_ASSERT(iotjs_jval_is_object(jobj));
+
+  jerry_set_object_native_pointer(_this->value, (void*)ptr, native_info);
+}
+
+
+uintptr_t iotjs_jval_get_object_native_handle(const iotjs_jval_t* jobj) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, jobj);
+  IOTJS_ASSERT(iotjs_jval_is_object(jobj));
+
+  uintptr_t ptr = 0x0;
+  JNativeInfoType out_info;
+  jerry_get_object_native_pointer(_this->value, (void**)&ptr, &out_info);
+  return ptr;
+}
+
+
+uintptr_t iotjs_jval_get_object_from_jhandler(iotjs_jhandler_t* jhandler,
+                                              JNativeInfoType native_info) {
+  const iotjs_jval_t* jobj = JHANDLER_GET_THIS(object);
+  const IOTJS_DECLARE_THIS(iotjs_jval_t, jobj);
+
+  if (!jerry_value_is_object(_this->value)) {
+    return 0;
+  }
+
+  uintptr_t ptr = 0;
+  JNativeInfoType out_native_info;
+
+  if (jerry_get_object_native_pointer(_this->value, (void**)&ptr,
+                                      &out_native_info)) {
+    if (ptr && out_native_info == native_info) {
+      return ptr;
+    }
+  }
+
+  JHANDLER_THROW(COMMON, "Unsafe access");
+
+  return 0;
+}
+
+
+uintptr_t iotjs_jval_get_arg_obj_from_jhandler(iotjs_jhandler_t* jhandler,
+                                               uint16_t index,
+                                               JNativeInfoType native_info) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jhandler_t, jhandler);
+
+  if (index >= _this->jargc) {
+    return 0;
+  }
+
+  const iotjs_jval_t jobj = _this->jargv[index];
+
+  if (!jerry_value_is_object(jobj.unsafe.value)) {
+    return 0;
+  }
+
+  uintptr_t ptr = 0;
+  JNativeInfoType out_native_info;
+
+  if (jerry_get_object_native_pointer(jobj.unsafe.value, (void**)&ptr,
+                                      &out_native_info)) {
+    if (ptr && out_native_info == native_info) {
+      return ptr;
+    }
+  }
+
+  JHANDLER_THROW(COMMON, "Unsafe access");
+
+  return 0;
+}
+
+
+void iotjs_jval_set_property_by_index(const iotjs_jval_t* jarr, uint32_t idx,
+                                      const iotjs_jval_t* jval) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, jarr);
+  IOTJS_ASSERT(iotjs_jval_is_object(jarr));
+
+  jerry_value_t value = iotjs_jval_as_raw(jval);
+  jerry_value_t ret_val = jerry_set_property_by_index(_this->value, idx, value);
+  IOTJS_ASSERT(!jerry_value_has_error_flag(ret_val));
+  jerry_release_value(ret_val);
+}
+
+
+iotjs_jval_t iotjs_jval_get_property_by_index(const iotjs_jval_t* jarr,
+                                              uint32_t idx) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jval_t, jarr);
+  IOTJS_ASSERT(iotjs_jval_is_object(jarr));
+
+  jerry_value_t res = jerry_get_property_by_index(_this->value, idx);
+
+  if (jerry_value_has_error_flag(res)) {
+    jerry_release_value(res);
+    return iotjs_jval_create_copied(iotjs_jval_get_undefined());
+  }
+
+  return iotjs_jval_create_raw(res);
+}
+
+
+iotjs_jval_t iotjs_jhelper_call(const iotjs_jval_t* jfunc,
+                                const iotjs_jval_t* jthis,
+                                const iotjs_jargs_t* jargs, bool* throws) {
+  IOTJS_ASSERT(iotjs_jval_is_object(jfunc));
+
+  jerry_value_t* jargv_ = NULL;
+  jerry_length_t jargc_ = iotjs_jargs_length(jargs);
+
+#ifdef NDEBUG
+  jargv_ = (jerry_value_t*)jargs->unsafe.argv;
+#else
+  if (jargc_ > 0) {
+    unsigned buffer_size = sizeof(iotjs_jval_t) * jargc_;
+    jargv_ = (jerry_value_t*)iotjs_buffer_allocate(buffer_size);
+    for (unsigned i = 0; i < jargc_; ++i) {
+      jargv_[i] = iotjs_jval_as_raw(iotjs_jargs_get(jargs, i));
+    }
+  }
+#endif
+
+  jerry_value_t jfunc_ = iotjs_jval_as_raw(jfunc);
+  jerry_value_t jthis_ = iotjs_jval_as_raw(jthis);
+  jerry_value_t res = jerry_call_function(jfunc_, jthis_, jargv_, jargc_);
+
+#ifndef NDEBUG
+  if (jargv_) {
+    iotjs_buffer_release((char*)jargv_);
+  }
+#endif
+
+  *throws = jerry_value_has_error_flag(res);
+
+  jerry_value_clear_error_flag(&res);
+
+  return iotjs_jval_create_raw(res);
+}
+
+
+iotjs_jval_t iotjs_jhelper_call_ok(const iotjs_jval_t* jfunc,
+                                   const iotjs_jval_t* jthis,
+                                   const iotjs_jargs_t* jargs) {
+  bool throws;
+  iotjs_jval_t jres = iotjs_jhelper_call(jfunc, jthis, jargs, &throws);
+  IOTJS_ASSERT(!throws);
+  return jres;
+}
+
+
+iotjs_jval_t iotjs_jhelper_eval(const char* name, size_t name_len,
+                                const uint8_t* data, size_t size,
+                                bool strict_mode, bool* throws) {
+  jerry_value_t res =
+      jerry_parse_named_resource((const jerry_char_t*)name, name_len,
+                                 (const jerry_char_t*)data, size, strict_mode);
+
+  *throws = jerry_value_has_error_flag(res);
+
+  if (!*throws) {
+    jerry_value_t func = res;
+    res = jerry_run(func);
+    jerry_release_value(func);
+
+    *throws = jerry_value_has_error_flag(res);
+  }
+
+  jerry_value_clear_error_flag(&res);
+
+  return iotjs_jval_create_raw(res);
+}
+
+
+#ifdef ENABLE_SNAPSHOT
+iotjs_jval_t iotjs_jhelper_exec_snapshot(const void* snapshot_p,
+                                         size_t snapshot_size, bool* throws) {
+  jerry_value_t res = jerry_exec_snapshot(snapshot_p, snapshot_size, false);
+  /* the snapshot buffer can be referenced
+   * until jerry_cleanup is not called */
+
+  *throws = jerry_value_has_error_flag(res);
+
+  jerry_value_clear_error_flag(&res);
+
+  return iotjs_jval_create_raw(res);
+}
+#endif
+
+
+iotjs_jargs_t iotjs_jargs_create(uint16_t capacity) {
+  iotjs_jargs_t jargs;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jargs_t, &jargs);
+
+  _this->capacity = capacity;
+  _this->argc = 0;
+  if (capacity > 0) {
+    unsigned buffer_size = sizeof(iotjs_jval_t) * capacity;
+    _this->argv = (iotjs_jval_t*)iotjs_buffer_allocate(buffer_size);
+  } else {
+    return jargs_empty;
+  }
+
+  return jargs;
+}
+
+
+static void iotjs_jargs_initialize_empty(iotjs_jargs_t* jargs) {
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jargs_t, jargs);
+  _this->capacity = 0;
+  _this->argc = 0;
+  _this->argv = NULL;
+}
+
+
+const iotjs_jargs_t* iotjs_jargs_get_empty() {
+  return &jargs_empty;
+}
+
+
+void iotjs_jargs_destroy(iotjs_jargs_t* jargs) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_jargs_t, jargs);
+
+  IOTJS_ASSERT(_this->argv == NULL || _this->argc > 0);
+  IOTJS_ASSERT(_this->argc <= _this->capacity);
+
+  if (_this->capacity > 0) {
+    for (unsigned i = 0; i < _this->argc; ++i) {
+      iotjs_jval_destroy(&_this->argv[i]);
+    }
+    iotjs_buffer_release((char*)_this->argv);
+  } else {
+    IOTJS_ASSERT(_this->argv == NULL);
+  }
+}
+
+
+uint16_t iotjs_jargs_length(const iotjs_jargs_t* jargs) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jargs_t, jargs);
+  return _this->argc;
+}
+
+
+void iotjs_jargs_append_jval(iotjs_jargs_t* jargs, const iotjs_jval_t* x) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jargs_t, jargs);
+  IOTJS_ASSERT(_this->argc < _this->capacity);
+  _this->argv[_this->argc++] = iotjs_jval_create_copied(x);
+}
+
+
+void iotjs_jargs_append_undefined(iotjs_jargs_t* jargs) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jargs_t, jargs);
+  iotjs_jargs_append_jval(jargs, iotjs_jval_get_undefined());
+}
+
+
+void iotjs_jargs_append_null(iotjs_jargs_t* jargs) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jargs_t, jargs);
+  iotjs_jargs_append_jval(jargs, iotjs_jval_get_null());
+}
+
+
+void iotjs_jargs_append_bool(iotjs_jargs_t* jargs, bool x) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jargs_t, jargs);
+  iotjs_jargs_append_jval(jargs, iotjs_jval_get_boolean(x));
+}
+
+
+void iotjs_jargs_append_number(iotjs_jargs_t* jargs, double x) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jargs_t, jargs);
+  iotjs_jval_t jval = iotjs_jval_create_number(x);
+  iotjs_jargs_append_jval(jargs, &jval);
+  iotjs_jval_destroy(&jval);
+}
+
+
+void iotjs_jargs_append_string(iotjs_jargs_t* jargs, const iotjs_string_t* x) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jargs_t, jargs);
+  iotjs_jval_t jval = iotjs_jval_create_string(x);
+  iotjs_jargs_append_jval(jargs, &jval);
+  iotjs_jval_destroy(&jval);
+}
+
+
+void iotjs_jargs_append_error(iotjs_jargs_t* jargs, const char* msg) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jargs_t, jargs);
+  iotjs_jval_t error = iotjs_jval_create_error(msg);
+  iotjs_jargs_append_jval(jargs, &error);
+  iotjs_jval_destroy(&error);
+}
+
+
+void iotjs_jargs_append_string_raw(iotjs_jargs_t* jargs, const char* x) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jargs_t, jargs);
+  iotjs_jval_t jval = iotjs_jval_create_string_raw(x);
+  iotjs_jargs_append_jval(jargs, &jval);
+  iotjs_jval_destroy(&jval);
+}
+
+
+void iotjs_jargs_replace(iotjs_jargs_t* jargs, uint16_t index,
+                         const iotjs_jval_t* x) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jargs_t, jargs);
+
+  IOTJS_ASSERT(index < _this->argc);
+
+  iotjs_jval_destroy(&_this->argv[index]);
+  _this->argv[index] = iotjs_jval_create_copied(x);
+}
+
+
+const iotjs_jval_t* iotjs_jargs_get(const iotjs_jargs_t* jargs,
+                                    uint16_t index) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jargs_t, jargs);
+
+  IOTJS_ASSERT(index < _this->argc);
+  return &_this->argv[index];
+}
+
+
+void iotjs_jhandler_initialize(iotjs_jhandler_t* jhandler,
+                               const jerry_value_t jfunc,
+                               const jerry_value_t jthis,
+                               const jerry_value_t jargv[],
+                               const uint16_t jargc) {
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jhandler_t, jhandler);
+
+  _this->jfunc = iotjs_jval_create_raw(jfunc);
+  _this->jthis = iotjs_jval_create_raw(jthis);
+  _this->jret = iotjs_jval_create_copied(iotjs_jval_get_undefined());
+#ifdef NDEBUG
+  _this->jargv = (iotjs_jval_t*)jargv;
+#else
+  if (jargc > 0) {
+    unsigned buffer_size = sizeof(iotjs_jval_t) * jargc;
+    _this->jargv = (iotjs_jval_t*)iotjs_buffer_allocate(buffer_size);
+    for (int i = 0; i < jargc; ++i) {
+      _this->jargv[i] = iotjs_jval_create_raw(jargv[i]);
+    }
+  } else {
+    _this->jargv = NULL;
+  }
+  _this->finished = false;
+#endif
+
+  _this->jargc = jargc;
+}
+
+
+void iotjs_jhandler_destroy(iotjs_jhandler_t* jhandler) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_jhandler_t, jhandler);
+  iotjs_jval_destroy_norelease(&_this->jfunc);
+  iotjs_jval_destroy_norelease(&_this->jthis);
+  iotjs_jval_destroy_norelease(&_this->jret);
+#ifndef NDEBUG
+  if (_this->jargc > 0) {
+    for (int i = 0; i < _this->jargc; ++i) {
+      iotjs_jval_destroy_norelease(&_this->jargv[i]);
+    }
+    iotjs_buffer_release((char*)(_this->jargv));
+  } else {
+    IOTJS_ASSERT(_this->jargv == NULL);
+  }
+#endif
+}
+
+
+const iotjs_jval_t* iotjs_jhandler_get_function(iotjs_jhandler_t* jhandler) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jhandler_t, jhandler);
+  return &_this->jfunc;
+}
+
+
+const iotjs_jval_t* iotjs_jhandler_get_this(iotjs_jhandler_t* jhandler) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jhandler_t, jhandler);
+  return &_this->jthis;
+}
+
+
+const iotjs_jval_t* iotjs_jhandler_get_arg(iotjs_jhandler_t* jhandler,
+                                           uint16_t index) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jhandler_t, jhandler);
+  IOTJS_ASSERT(index < _this->jargc);
+  return &_this->jargv[index];
+}
+
+
+uint16_t iotjs_jhandler_get_arg_length(iotjs_jhandler_t* jhandler) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jhandler_t, jhandler);
+  return _this->jargc;
+}
+
+
+void iotjs_jhandler_return_jval(iotjs_jhandler_t* jhandler,
+                                const iotjs_jval_t* ret) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jhandler_t, jhandler);
+
+#ifndef NDEBUG
+  IOTJS_ASSERT(_this->finished == false);
+#endif
+
+  iotjs_jval_destroy(&_this->jret);
+  _this->jret = iotjs_jval_create_copied(ret);
+#ifndef NDEBUG
+  _this->finished = true;
+#endif
+}
+
+
+void iotjs_jhandler_return_undefined(iotjs_jhandler_t* jhandler) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jhandler_t, jhandler);
+  iotjs_jhandler_return_jval(jhandler, iotjs_jval_get_undefined());
+}
+
+
+void iotjs_jhandler_return_null(iotjs_jhandler_t* jhandler) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jhandler_t, jhandler);
+  iotjs_jhandler_return_jval(jhandler, iotjs_jval_get_null());
+}
+
+
+void iotjs_jhandler_return_boolean(iotjs_jhandler_t* jhandler, bool ret) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jhandler_t, jhandler);
+  iotjs_jhandler_return_jval(jhandler, iotjs_jval_get_boolean(ret));
+}
+
+
+void iotjs_jhandler_return_number(iotjs_jhandler_t* jhandler, double ret) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jhandler_t, jhandler);
+  iotjs_jval_t jval = iotjs_jval_create_number(ret);
+  iotjs_jhandler_return_jval(jhandler, &jval);
+  iotjs_jval_destroy(&jval);
+}
+
+
+void iotjs_jhandler_return_string(iotjs_jhandler_t* jhandler,
+                                  const iotjs_string_t* ret) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jhandler_t, jhandler);
+  iotjs_jval_t jval = iotjs_jval_create_string(ret);
+  iotjs_jhandler_return_jval(jhandler, &jval);
+  iotjs_jval_destroy(&jval);
+}
+
+
+void iotjs_jhandler_return_string_raw(iotjs_jhandler_t* jhandler,
+                                      const char* ret) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_jhandler_t, jhandler);
+  iotjs_jval_t jval = iotjs_jval_create_string_raw(ret);
+  iotjs_jhandler_return_jval(jhandler, &jval);
+  iotjs_jval_destroy(&jval);
+}
+
+
+void iotjs_jhandler_throw(iotjs_jhandler_t* jhandler, const iotjs_jval_t* err) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jhandler_t, jhandler);
+#ifndef NDEBUG
+  IOTJS_ASSERT(_this->finished == false);
+#endif
+
+  iotjs_jval_destroy(&_this->jret);
+  _this->jret = iotjs_jval_create_copied(err);
+  jerry_value_set_error_flag(&_this->jret.unsafe.value);
+
+#ifndef NDEBUG
+  _this->finished = true;
+#endif
+}
+
+
+static jerry_value_t iotjs_native_dispatch_function(
+    const jerry_value_t jfunc, const jerry_value_t jthis,
+    const jerry_value_t jargv[], const JRawLengthType jargc) {
+  uintptr_t target_function_ptr = 0x0;
+  JNativeInfoType out_info;
+
+  if (!jerry_get_object_native_pointer(jfunc, (void**)&target_function_ptr,
+                                       &out_info)) {
+    const jerry_char_t* jmsg = (const jerry_char_t*)("Internal dispatch error");
+    return jerry_create_error((jerry_error_t)IOTJS_ERROR_COMMON, jmsg);
+  }
+
+  IOTJS_ASSERT(target_function_ptr != 0x0);
+
+  iotjs_jhandler_t jhandler;
+  iotjs_jhandler_initialize(&jhandler, jfunc, jthis, jargv, jargc);
+
+  ((iotjs_native_handler_t)target_function_ptr)(&jhandler);
+
+  jerry_value_t ret_val = jhandler.unsafe.jret.unsafe.value;
+  iotjs_jhandler_destroy(&jhandler);
+  return ret_val;
+}
+
+
+iotjs_jval_t iotjs_jval_create_function_with_dispatch(
+    iotjs_native_handler_t handler) {
+  iotjs_jval_t jfunc =
+      iotjs_jval_create_function(iotjs_native_dispatch_function);
+  iotjs_jval_set_object_native_handle(&jfunc, (uintptr_t)handler, NULL);
+  return jfunc;
+}
+
+
+void iotjs_binding_initialize() {
+  jundefined = iotjs_jval_create_raw(jerry_create_undefined());
+  jnull = iotjs_jval_create_raw(jerry_create_null());
+  jtrue = iotjs_jval_create_raw(jerry_create_boolean(true));
+  jfalse = iotjs_jval_create_raw(jerry_create_boolean(false));
+  jglobal = iotjs_jval_create_raw(jerry_get_global_object());
+
+  IOTJS_ASSERT(iotjs_jval_is_object(&jglobal));
+
+  iotjs_jargs_initialize_empty(&jargs_empty);
+
+#ifdef NDEBUG
+  assert(sizeof(iotjs_jval_t) == sizeof(jerry_value_t));
+#endif
+}
+
+
+void iotjs_binding_finalize() {
+  iotjs_jval_destroy(&jundefined);
+  iotjs_jval_destroy(&jnull);
+  iotjs_jval_destroy(&jtrue);
+  iotjs_jval_destroy(&jfalse);
+  iotjs_jval_destroy(&jglobal);
+  iotjs_jargs_destroy(&jargs_empty);
+}
diff --git a/src/iotjs_binding.h b/src/iotjs_binding.h
new file mode 100644 (file)
index 0000000..16af73e
--- /dev/null
@@ -0,0 +1,335 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_BINDING_H
+#define IOTJS_BINDING_H
+
+#include "iotjs_util.h"
+#include "jerryscript.h"
+
+#include <stdio.h>
+
+
+typedef jerry_external_handler_t JHandlerType;
+typedef const jerry_object_native_info_t* JNativeInfoType;
+typedef jerry_length_t JRawLengthType;
+
+
+typedef enum {
+  IOTJS_ERROR_COMMON = JERRY_ERROR_COMMON,
+  IOTJS_ERROR_EVAL = JERRY_ERROR_EVAL,
+  IOTJS_ERROR_RANGE = JERRY_ERROR_RANGE,
+  IOTJS_ERROR_REFERENCE = JERRY_ERROR_REFERENCE,
+  IOTJS_ERROR_SYNTAX = JERRY_ERROR_SYNTAX,
+  IOTJS_ERROR_TYPE = JERRY_ERROR_TYPE,
+  IOTJS_ERROR_URI = JERRY_ERROR_URI
+} iotjs_error_t;
+
+
+#define FOR_EACH_JVAL_TYPES(F) \
+  F(undefined)                 \
+  F(null)                      \
+  F(boolean)                   \
+  F(number)                    \
+  F(string)                    \
+  F(object)                    \
+  F(array)                     \
+  F(function)
+
+
+typedef struct {
+  jerry_value_t value; // JavaScript value representation
+} IOTJS_VALIDATED_STRUCT(iotjs_jval_t);
+
+typedef struct {
+  iotjs_jval_t jfunc;
+  iotjs_jval_t jthis;
+  iotjs_jval_t* jargv;
+  iotjs_jval_t jret;
+  uint16_t jargc;
+#ifndef NDEBUG
+  bool finished;
+#endif
+} IOTJS_VALIDATED_STRUCT(iotjs_jhandler_t);
+
+typedef void (*iotjs_native_handler_t)(iotjs_jhandler_t* jhandler);
+
+
+/* Constructors */
+iotjs_jval_t iotjs_jval_create_number(double v);
+iotjs_jval_t iotjs_jval_create_string(const iotjs_string_t* v);
+iotjs_jval_t iotjs_jval_create_string_raw(const char* data);
+iotjs_jval_t iotjs_jval_create_object();
+iotjs_jval_t iotjs_jval_create_array(uint32_t len);
+iotjs_jval_t iotjs_jval_create_byte_array(uint32_t len, const char* data);
+iotjs_jval_t iotjs_jval_create_function(JHandlerType handler);
+iotjs_jval_t iotjs_jval_create_error(const char* msg);
+iotjs_jval_t iotjs_jval_create_error_type(iotjs_error_t type, const char* msg);
+iotjs_jval_t iotjs_jval_create_copied(const iotjs_jval_t* other);
+
+iotjs_jval_t iotjs_jval_get_string_size(const iotjs_string_t* str);
+
+iotjs_jval_t* iotjs_jval_get_undefined();
+iotjs_jval_t* iotjs_jval_get_null();
+iotjs_jval_t* iotjs_jval_get_boolean(bool v);
+iotjs_jval_t* iotjs_jval_get_global_object();
+
+/* Destructor */
+void iotjs_jval_destroy(iotjs_jval_t* jval);
+
+#define THIS_JVAL const iotjs_jval_t* jval
+
+/* Type Checkers */
+bool iotjs_jval_is_undefined(THIS_JVAL);
+bool iotjs_jval_is_null(THIS_JVAL);
+bool iotjs_jval_is_boolean(THIS_JVAL);
+bool iotjs_jval_is_number(THIS_JVAL);
+bool iotjs_jval_is_string(THIS_JVAL);
+bool iotjs_jval_is_object(THIS_JVAL);
+bool iotjs_jval_is_array(THIS_JVAL);
+bool iotjs_jval_is_function(THIS_JVAL);
+
+/* Type Converters */
+bool iotjs_jval_as_boolean(THIS_JVAL);
+double iotjs_jval_as_number(THIS_JVAL);
+iotjs_string_t iotjs_jval_as_string(THIS_JVAL);
+const iotjs_jval_t* iotjs_jval_as_object(THIS_JVAL);
+const iotjs_jval_t* iotjs_jval_as_array(THIS_JVAL);
+const iotjs_jval_t* iotjs_jval_as_function(THIS_JVAL);
+
+/* Methods for General JavaScript Object */
+bool iotjs_jval_set_prototype(const iotjs_jval_t* jobj, iotjs_jval_t* jproto);
+void iotjs_jval_set_method(THIS_JVAL, const char* name,
+                           iotjs_native_handler_t handler);
+void iotjs_jval_set_property_jval(THIS_JVAL, const char* name,
+                                  const iotjs_jval_t* value);
+void iotjs_jval_set_property_null(THIS_JVAL, const char* name);
+void iotjs_jval_set_property_undefined(THIS_JVAL, const char* name);
+void iotjs_jval_set_property_boolean(THIS_JVAL, const char* name, bool v);
+void iotjs_jval_set_property_number(THIS_JVAL, const char* name, double v);
+void iotjs_jval_set_property_string(THIS_JVAL, const char* name,
+                                    const iotjs_string_t* v);
+void iotjs_jval_set_property_string_raw(THIS_JVAL, const char* name,
+                                        const char* v);
+
+iotjs_jval_t iotjs_jval_get_property(THIS_JVAL, const char* name);
+
+void iotjs_jval_set_object_native_handle(THIS_JVAL, uintptr_t ptr,
+                                         JNativeInfoType native_info);
+uintptr_t iotjs_jval_get_object_native_handle(THIS_JVAL);
+uintptr_t iotjs_jval_get_object_from_jhandler(iotjs_jhandler_t* jhandler,
+                                              JNativeInfoType native_info);
+uintptr_t iotjs_jval_get_arg_obj_from_jhandler(iotjs_jhandler_t* jhandler,
+                                               uint16_t index,
+                                               JNativeInfoType native_info);
+
+void iotjs_jval_set_property_by_index(THIS_JVAL, uint32_t idx,
+                                      const iotjs_jval_t* value);
+iotjs_jval_t iotjs_jval_get_property_by_index(THIS_JVAL, uint32_t idx);
+
+
+#undef THIS_JVAL
+
+
+typedef struct {
+  uint16_t capacity;
+  uint16_t argc;
+  iotjs_jval_t* argv;
+} IOTJS_VALIDATED_STRUCT(iotjs_jargs_t);
+
+
+iotjs_jargs_t iotjs_jargs_create(uint16_t capacity);
+
+const iotjs_jargs_t* iotjs_jargs_get_empty();
+
+void iotjs_jargs_destroy(iotjs_jargs_t* jargs);
+
+uint16_t iotjs_jargs_length(const iotjs_jargs_t* jargs);
+
+void iotjs_jargs_append_jval(iotjs_jargs_t* jargs, const iotjs_jval_t* x);
+void iotjs_jargs_append_undefined(iotjs_jargs_t* jargs);
+void iotjs_jargs_append_null(iotjs_jargs_t* jargs);
+void iotjs_jargs_append_bool(iotjs_jargs_t* jargs, bool x);
+void iotjs_jargs_append_number(iotjs_jargs_t* jargs, double x);
+void iotjs_jargs_append_string(iotjs_jargs_t* jargs, const iotjs_string_t* x);
+void iotjs_jargs_append_string_raw(iotjs_jargs_t* jargs, const char* x);
+void iotjs_jargs_append_error(iotjs_jargs_t* jargs, const char* msg);
+
+
+void iotjs_jargs_replace(iotjs_jargs_t* jargs, uint16_t index,
+                         const iotjs_jval_t* x);
+
+const iotjs_jval_t* iotjs_jargs_get(const iotjs_jargs_t* jargs, uint16_t index);
+
+
+// Calls JavaScript function.
+iotjs_jval_t iotjs_jhelper_call(const iotjs_jval_t* jfunc,
+                                const iotjs_jval_t* jthis,
+                                const iotjs_jargs_t* jargs, bool* throws);
+
+// Calls javascript function.
+iotjs_jval_t iotjs_jhelper_call_ok(const iotjs_jval_t* jfunc,
+                                   const iotjs_jval_t* jthis,
+                                   const iotjs_jargs_t* jargs);
+
+// Evaluates javascript source file.
+iotjs_jval_t iotjs_jhelper_eval(const char* name, size_t name_len,
+                                const uint8_t* data, size_t size,
+                                bool strict_mode, bool* throws);
+#ifdef ENABLE_SNAPSHOT
+// Evaluates javascript snapshot.
+iotjs_jval_t iotjs_jhelper_exec_snapshot(const void* snapshot_p,
+                                         size_t snapshot_size, bool* throws);
+#endif
+
+
+void iotjs_jhandler_initialize(iotjs_jhandler_t* jhandler,
+                               const jerry_value_t jfunc,
+                               const jerry_value_t jthis,
+                               const jerry_value_t jargv[],
+                               const uint16_t jargc);
+
+void iotjs_jhandler_destroy(iotjs_jhandler_t* jhandler);
+
+const iotjs_jval_t* iotjs_jhandler_get_function(iotjs_jhandler_t* jhandler);
+const iotjs_jval_t* iotjs_jhandler_get_this(iotjs_jhandler_t* jhandler);
+const iotjs_jval_t* iotjs_jhandler_get_arg(iotjs_jhandler_t* jhandler,
+                                           uint16_t index);
+uint16_t iotjs_jhandler_get_arg_length(iotjs_jhandler_t* jhandler);
+
+void iotjs_jhandler_return_jval(iotjs_jhandler_t* jhandler,
+                                const iotjs_jval_t* ret);
+void iotjs_jhandler_return_undefined(iotjs_jhandler_t* jhandler);
+void iotjs_jhandler_return_null(iotjs_jhandler_t* jhandler);
+void iotjs_jhandler_return_boolean(iotjs_jhandler_t* jhandler, bool x);
+void iotjs_jhandler_return_number(iotjs_jhandler_t* jhandler, double x);
+void iotjs_jhandler_return_string(iotjs_jhandler_t* jhandler,
+                                  const iotjs_string_t* x);
+void iotjs_jhandler_return_string_raw(iotjs_jhandler_t* jhandler,
+                                      const char* x);
+
+void iotjs_jhandler_throw(iotjs_jhandler_t* jhandler, const iotjs_jval_t* err);
+
+iotjs_jval_t iotjs_jval_create_function_with_dispatch(
+    iotjs_native_handler_t handler);
+
+
+#define JHANDLER_THROW(TYPE, message)                                         \
+  iotjs_jval_t e = iotjs_jval_create_error_type(IOTJS_ERROR_##TYPE, message); \
+  iotjs_jhandler_throw(jhandler, &e);                                         \
+  iotjs_jval_destroy(&e);
+
+#define JHANDLER_CHECK(predicate)                          \
+  if (!(predicate)) {                                      \
+    char buffer[64];                                       \
+    snprintf(buffer, 63, "Internal error (%s)", __func__); \
+    JHANDLER_THROW(COMMON, buffer)                         \
+    return;                                                \
+  }
+
+#define JHANDLER_CHECK_TYPE(jval, type) \
+  JHANDLER_CHECK(iotjs_jval_is_##type(jval));
+
+#define JHANDLER_CHECK_ARG(index, type) \
+  JHANDLER_CHECK_TYPE(iotjs_jhandler_get_arg(jhandler, index), type);
+
+#define JHANDLER_CHECK_ARG_IF_EXIST(index, type)                        \
+  if (iotjs_jhandler_get_arg_length(jhandler) > index) {                \
+    JHANDLER_CHECK_TYPE(iotjs_jhandler_get_arg(jhandler, index), type); \
+  }
+
+#define JHANDLER_CHECK_ARGS_0()
+
+#define JHANDLER_CHECK_ARGS_1(type0) \
+  JHANDLER_CHECK_ARGS_0();           \
+  JHANDLER_CHECK_ARG(0, type0);
+
+#define JHANDLER_CHECK_ARGS_2(type0, type1) \
+  JHANDLER_CHECK_ARGS_1(type0);             \
+  JHANDLER_CHECK_ARG(1, type1);
+
+#define JHANDLER_CHECK_ARGS_3(type0, type1, type2) \
+  JHANDLER_CHECK_ARGS_2(type0, type1);             \
+  JHANDLER_CHECK_ARG(2, type2);
+
+#define JHANDLER_CHECK_ARGS_4(type0, type1, type2, type3) \
+  JHANDLER_CHECK_ARGS_3(type0, type1, type2);             \
+  JHANDLER_CHECK_ARG(3, type3);
+
+#define JHANDLER_CHECK_ARGS_5(type0, type1, type2, type3, type4) \
+  JHANDLER_CHECK_ARGS_4(type0, type1, type2, type3);             \
+  JHANDLER_CHECK_ARG(4, type4);
+
+// Workaround for GCC type-limits warning
+static inline bool ge(uint16_t a, uint16_t b) {
+  return a >= b;
+}
+
+#define JHANDLER_CHECK_ARGS(argc, ...)                               \
+  JHANDLER_CHECK(ge(iotjs_jhandler_get_arg_length(jhandler), argc)); \
+  JHANDLER_CHECK_ARGS_##argc(__VA_ARGS__)
+
+#define JHANDLER_CHECK_THIS(type) \
+  JHANDLER_CHECK_TYPE(iotjs_jhandler_get_this(jhandler), type);
+
+#define JHANDLER_GET_ARG(index, type) \
+  iotjs_jval_as_##type(iotjs_jhandler_get_arg(jhandler, index))
+
+#define JHANDLER_GET_ARG_IF_EXIST(index, type)                          \
+  ((iotjs_jhandler_get_arg_length(jhandler) > index)                    \
+       ? (iotjs_jval_is_##type(iotjs_jhandler_get_arg(jhandler, index)) \
+              ? iotjs_jhandler_get_arg(jhandler, index)                 \
+              : NULL)                                                   \
+       : NULL)
+
+#define JHANDLER_GET_THIS(type) \
+  iotjs_jval_as_##type(iotjs_jhandler_get_this(jhandler))
+
+#define JHANDLER_FUNCTION(name) static void name(iotjs_jhandler_t* jhandler)
+
+#if defined(EXPERIMENTAL) && !defined(DEBUG)
+// This code branch is to be in #ifdef NDEBUG
+#define DJHANDLER_CHECK_ARG(index, type) ((void)0)
+#define DJHANDLER_CHECK_ARGS(argc, ...) ((void)0)
+#define DJHANDLER_CHECK_THIS(type) ((void)0)
+#define DJHANDLER_CHECK_ARG_IF_EXIST(index, type) ((void)0)
+#else
+#define DJHANDLER_CHECK_ARG(index, type) JHANDLER_CHECK_ARG(index, type)
+#define DJHANDLER_CHECK_ARGS(argc, ...) JHANDLER_CHECK_ARGS(argc, __VA_ARGS__)
+#define DJHANDLER_CHECK_THIS(type) JHANDLER_CHECK_THIS(type)
+#define DJHANDLER_CHECK_ARG_IF_EXIST(index, type) \
+  JHANDLER_CHECK_ARG_IF_EXIST(index, type)
+#endif
+
+#define JHANDLER_DECLARE_THIS_PTR(type, name)                                  \
+  iotjs_##type##_t* name = (iotjs_##type##_t*)                                 \
+      iotjs_jval_get_object_from_jhandler(jhandler, &this_module_native_info); \
+  if (!name) {                                                                 \
+    return;                                                                    \
+  }
+
+#define JHANDLER_DECLARE_OBJECT_PTR(index, type, name)                \
+  iotjs_##type##_t* name = (iotjs_##type##_t*)                        \
+      iotjs_jval_get_arg_obj_from_jhandler(jhandler, index,           \
+                                           &this_module_native_info); \
+  if (!name) {                                                        \
+    return;                                                           \
+  }
+
+void iotjs_binding_initialize();
+void iotjs_binding_finalize();
+
+
+#endif /* IOTJS_BINDING_H */
diff --git a/src/iotjs_binding_helper.c b/src/iotjs_binding_helper.c
new file mode 100644 (file)
index 0000000..177099f
--- /dev/null
@@ -0,0 +1,124 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+void iotjs_uncaught_exception(const iotjs_jval_t* jexception) {
+  const iotjs_jval_t* process = iotjs_module_get(MODULE_PROCESS);
+
+  iotjs_jval_t jonuncaughtexception =
+      iotjs_jval_get_property(process, IOTJS_MAGIC_STRING__ONUNCAUGHTEXCEPTION);
+  IOTJS_ASSERT(iotjs_jval_is_function(&jonuncaughtexception));
+
+  iotjs_jargs_t args = iotjs_jargs_create(1);
+  iotjs_jargs_append_jval(&args, jexception);
+
+  bool throws;
+  iotjs_jval_t jres =
+      iotjs_jhelper_call(&jonuncaughtexception, process, &args, &throws);
+
+  iotjs_jargs_destroy(&args);
+  iotjs_jval_destroy(&jres);
+  iotjs_jval_destroy(&jonuncaughtexception);
+
+  if (throws) {
+    exit(2);
+  }
+}
+
+
+void iotjs_process_emit_exit(int code) {
+  const iotjs_jval_t* process = iotjs_module_get(MODULE_PROCESS);
+
+  iotjs_jval_t jexit =
+      iotjs_jval_get_property(process, IOTJS_MAGIC_STRING_EMITEXIT);
+  IOTJS_ASSERT(iotjs_jval_is_function(&jexit));
+
+  iotjs_jargs_t jargs = iotjs_jargs_create(1);
+  iotjs_jargs_append_number(&jargs, code);
+
+  bool throws;
+  iotjs_jval_t jres = iotjs_jhelper_call(&jexit, process, &jargs, &throws);
+
+  iotjs_jargs_destroy(&jargs);
+  iotjs_jval_destroy(&jres);
+  iotjs_jval_destroy(&jexit);
+
+  if (throws) {
+    exit(2);
+  }
+}
+
+
+// Calls next tick callbacks registered via `process.nextTick()`.
+bool iotjs_process_next_tick() {
+  const iotjs_jval_t* process = iotjs_module_get(MODULE_PROCESS);
+
+  iotjs_jval_t jon_next_tick =
+      iotjs_jval_get_property(process, IOTJS_MAGIC_STRING__ONNEXTTICK);
+  IOTJS_ASSERT(iotjs_jval_is_function(&jon_next_tick));
+
+  iotjs_jval_t jres =
+      iotjs_jhelper_call_ok(&jon_next_tick, iotjs_jval_get_undefined(),
+                            iotjs_jargs_get_empty());
+
+  IOTJS_ASSERT(iotjs_jval_is_boolean(&jres));
+
+  bool ret = iotjs_jval_as_boolean(&jres);
+  iotjs_jval_destroy(&jres);
+  iotjs_jval_destroy(&jon_next_tick);
+
+  return ret;
+}
+
+
+// Make a callback for the given `function` with `this_` binding and `args`
+// arguments. The next tick callbacks registered via `process.nextTick()`
+// will be called after the callback function `function` returns.
+void iotjs_make_callback(const iotjs_jval_t* jfunction,
+                         const iotjs_jval_t* jthis,
+                         const iotjs_jargs_t* jargs) {
+  iotjs_jval_t result =
+      iotjs_make_callback_with_result(jfunction, jthis, jargs);
+  iotjs_jval_destroy(&result);
+}
+
+
+iotjs_jval_t iotjs_make_callback_with_result(const iotjs_jval_t* jfunction,
+                                             const iotjs_jval_t* jthis,
+                                             const iotjs_jargs_t* jargs) {
+  // Calls back the function.
+  bool throws;
+  iotjs_jval_t jres = iotjs_jhelper_call(jfunction, jthis, jargs, &throws);
+  if (throws) {
+    iotjs_uncaught_exception(&jres);
+  }
+
+  // Calls the next tick callbacks.
+  iotjs_process_next_tick();
+
+  // Return value.
+  return jres;
+}
+
+
+const iotjs_jval_t* iotjs_init_process_module() {
+  return iotjs_module_initialize_if_necessary(MODULE_PROCESS);
+}
diff --git a/src/iotjs_binding_helper.h b/src/iotjs_binding_helper.h
new file mode 100644 (file)
index 0000000..5ebbaa4
--- /dev/null
@@ -0,0 +1,40 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_BINDING_HELPER_H
+#define IOTJS_BINDING_HELPER_H
+
+
+#include "iotjs_binding.h"
+
+
+void iotjs_uncaught_exception(const iotjs_jval_t* jexception);
+
+void iotjs_process_emit_exit(int code);
+
+bool iotjs_process_next_tick();
+
+void iotjs_make_callback(const iotjs_jval_t* jfunction,
+                         const iotjs_jval_t* jthis, const iotjs_jargs_t* jargs);
+
+iotjs_jval_t iotjs_make_callback_with_result(const iotjs_jval_t* jfunction,
+                                             const iotjs_jval_t* jthis,
+                                             const iotjs_jargs_t* jargs);
+
+
+const iotjs_jval_t* iotjs_init_process_module();
+
+
+#endif /* IOTJS_BINDING_HELPER_H */
diff --git a/src/iotjs_debuglog.c b/src/iotjs_debuglog.c
new file mode 100644 (file)
index 0000000..f2187fd
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "iotjs_debuglog.h"
+
+#ifdef ENABLE_DEBUG_LOG
+int iotjs_debug_level = DBGLEV_ERR;
+FILE* iotjs_log_stream;
+const char* iotjs_debug_prefix[4] = { "", "ERR", "WRN", "INF" };
+#endif // ENABLE_DEBUG_LOG
+
+
+void init_debug_settings() {
+#ifdef ENABLE_DEBUG_LOG
+  const char* dbglevel = NULL;
+  const char* dbglogfile = NULL;
+
+#if defined(__linux__) || defined(__APPLE__)
+  dbglevel = getenv("IOTJS_DEBUG_LEVEL");
+  dbglogfile = getenv("IOTJS_DEBUG_LOGFILE");
+#endif // defined(__linux__) || defined(__APPLE__)
+  if (dbglevel) {
+    iotjs_debug_level = atoi(dbglevel);
+    if (iotjs_debug_level < 0)
+      iotjs_debug_level = 0;
+    if (iotjs_debug_level > DBGLEV_INFO)
+      iotjs_debug_level = DBGLEV_INFO;
+  }
+  iotjs_log_stream = stderr;
+  if (dbglogfile) {
+    FILE* logstream;
+    logstream = fopen(dbglogfile, "w+");
+    if (logstream != NULL)
+      iotjs_log_stream = logstream;
+  }
+// fprintf(stderr, "DBG LEV = %d", iotjs_debug_level);
+// fprintf(stderr, "DBG OUT = %s", (dbglogfile==NULL?"(stderr)":dbglogfile));
+#endif // ENABLE_DEBUG_LOG
+}
+
+
+void release_debug_settings() {
+#ifdef ENABLE_DEBUG_LOG
+  if (iotjs_log_stream != stderr || iotjs_log_stream != stdout) {
+    fclose(iotjs_log_stream);
+  }
+  // some embed systems(ex, nuttx) may need this
+  iotjs_log_stream = stderr;
+  iotjs_debug_level = DBGLEV_ERR;
+#endif // ENABLE_DEBUG_LOG
+}
diff --git a/src/iotjs_debuglog.h b/src/iotjs_debuglog.h
new file mode 100644 (file)
index 0000000..7468027
--- /dev/null
@@ -0,0 +1,65 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_DEBUGLOG_H
+#define IOTJS_DEBUGLOG_H
+
+
+#ifdef ENABLE_DEBUG_LOG
+
+#include <stdio.h>
+
+extern int iotjs_debug_level;
+extern FILE* iotjs_log_stream;
+extern const char* iotjs_debug_prefix[4];
+
+#define DBGLEV_ERR 1
+#define DBGLEV_WARN 2
+#define DBGLEV_INFO 3
+
+#define IOTJS_DLOG(lvl, ...)                                        \
+  do {                                                              \
+    if (0 <= lvl && lvl <= iotjs_debug_level && iotjs_log_stream) { \
+      fprintf(iotjs_log_stream, "[%s] ", iotjs_debug_prefix[lvl]);  \
+      fprintf(iotjs_log_stream, __VA_ARGS__);                       \
+      fprintf(iotjs_log_stream, "\n");                              \
+      fflush(iotjs_log_stream);                                     \
+    }                                                               \
+  } while (0)
+#define DLOG(...) IOTJS_DLOG(DBGLEV_ERR, __VA_ARGS__)
+#define DDLOG(...) IOTJS_DLOG(DBGLEV_WARN, __VA_ARGS__)
+#define DDDLOG(...) IOTJS_DLOG(DBGLEV_INFO, __VA_ARGS__)
+
+/*
+  Use DLOG for errors, default you will see them
+  Use DDLOG for warnings, set iotjs_debug_level=2 to see them
+  USE DDDLOG for information, set iotjs_debug_level=3 to see them
+*/
+
+#else /* !ENABLE_DEBUG_LOG */
+
+#define IOTJS_DLOG(...)
+#define DLOG(...)
+#define DDLOG(...)
+#define DDDLOG(...)
+
+#endif /* ENABLE_DEBUG_LOG */
+
+
+void init_debug_settings();
+void release_debug_settings();
+
+
+#endif /* IOTJS_DEBUGLOG_H */
diff --git a/src/iotjs_def.h b/src/iotjs_def.h
new file mode 100644 (file)
index 0000000..130f6e3
--- /dev/null
@@ -0,0 +1,181 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_DEF_H
+#define IOTJS_DEF_H
+
+
+#ifndef IOTJS_MAX_READ_BUFFER_SIZE
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+#define IOTJS_MAX_READ_BUFFER_SIZE 1023
+#define IOTJS_MAX_PATH_SIZE 120
+#else
+#define IOTJS_MAX_READ_BUFFER_SIZE 65535
+#define IOTJS_MAX_PATH_SIZE PATH_MAX
+#endif
+#endif
+
+
+#ifndef IOTJS_ASSERT
+#ifdef NDEBUG
+#define IOTJS_ASSERT(x) ((void)(x))
+#else
+extern void print_stacktrace();
+extern void force_terminate();
+#define IOTJS_ASSERT(x)                                                      \
+  do {                                                                       \
+    if (!(x)) {                                                              \
+      fprintf(stderr, "%s:%d: Assertion '%s' failed.\n", __FILE__, __LINE__, \
+              #x);                                                           \
+      print_stacktrace();                                                    \
+      force_terminate();                                                     \
+    }                                                                        \
+  } while (0)
+#endif
+#endif
+
+#if defined(__arm__)
+#define TARGET_ARCH "arm"
+#elif defined(__i686__)
+#define TARGET_ARCH "ia32"
+#elif defined(__x86_64__)
+#define TARGET_ARCH "x64"
+#else
+#define TARGET_ARCH "unknown"
+#endif
+
+
+#if defined(__linux__)
+#define TARGET_OS "linux"
+#elif defined(__NUTTX__)
+#define TARGET_OS "nuttx"
+#elif defined(__APPLE__)
+#define TARGET_OS "darwin"
+#elif defined(__TIZENRT__)
+#define TARGET_OS "tizenrt"
+#else
+#define TARGET_OS "unknown"
+#endif
+
+#define IOTJS_VERSION "1.0.0"
+
+#if !defined(STRINGIFY)
+#define STRINGIFY(x) #x
+#endif
+
+#if !defined(TOSTRING)
+#define TOSTRING(x) STRINGIFY(x)
+#endif
+
+
+#if !defined(TARGET_BOARD)
+#define TARGET_BOARD "unknown"
+#endif
+
+
+#define IOTJS_VALID_MAGIC_SEQUENCE 0xfee1c001   /* feel cool */
+#define IOTJS_INVALID_MAGIC_SEQUENCE 0xfee1badd /* feel bad */
+
+#define IOTJS_DECLARE_THIS(iotjs_classname_t, x) \
+  iotjs_classname_t##_impl_t* _this = &(x)->unsafe;
+
+/* Avoid compiler warnings if needed. */
+#define IOTJS_UNUSED(x) ((void)(x))
+
+
+#ifdef NDEBUG
+
+#define IOTJS_VALIDATED_STRUCT(iotjs_classname_t) \
+  iotjs_classname_t##_impl_t;                     \
+  typedef struct iotjs_classname_t {              \
+    iotjs_classname_t##_impl_t unsafe;            \
+  } iotjs_classname_t;
+
+#define IOTJS_VALIDATED_STRUCT_STATIC_INITIALIZER(...) __VA_ARGS__
+
+#define IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_classname_t, x) \
+  IOTJS_DECLARE_THIS(iotjs_classname_t, x);
+#define IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_classname_t, x) \
+  IOTJS_DECLARE_THIS(iotjs_classname_t, x);
+#define IOTJS_VALIDATED_STRUCT_METHOD(iotjs_classname_t, x) \
+  IOTJS_DECLARE_THIS(iotjs_classname_t, x);
+
+#define IOTJS_VALIDATABLE_STRUCT_DESTRUCTOR_VALIDATE(iotjs_classname_t, x)
+#define IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_classname_t, x)
+
+#else /* !NDEBUG */
+
+#define IOTJS_VALIDATED_STRUCT(iotjs_classname_t) \
+  iotjs_classname_t##_impl_t;                     \
+  typedef struct iotjs_classname_t {              \
+    iotjs_classname_t##_impl_t unsafe;            \
+    uint32_t flag_create;                         \
+    char* valgrind_tracer;                        \
+  } iotjs_classname_t;
+
+#define IOTJS_VALIDATED_STRUCT_STATIC_INITIALIZER(...) \
+  { IOTJS_VALID_MAGIC_SEQUENCE, iotjs_buffer_allocate(4), __VA_ARGS__ }
+
+#define IOTJS_VALIDATE_FLAG(iotjs_classname_t, x)                         \
+  if ((x)->flag_create != IOTJS_VALID_MAGIC_SEQUENCE) {                   \
+    DLOG("`%s %s` is not initialized properly.", #iotjs_classname_t, #x); \
+    IOTJS_ASSERT(false);                                                  \
+  }
+
+#define IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_classname_t, x)      \
+  IOTJS_DECLARE_THIS(iotjs_classname_t, x);                           \
+  /* IOTJS_ASSERT((x)->flag_create != IOTJS_VALID_MAGIC_SEQUENCE); */ \
+  (x)->flag_create = IOTJS_VALID_MAGIC_SEQUENCE;                      \
+  (x)->valgrind_tracer = iotjs_buffer_allocate(4);
+
+#define IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_classname_t, x) \
+  IOTJS_DECLARE_THIS(iotjs_classname_t, x);                     \
+  IOTJS_VALIDATE_FLAG(iotjs_classname_t, x);                    \
+  (x)->flag_create = IOTJS_INVALID_MAGIC_SEQUENCE;              \
+  iotjs_buffer_release((x)->valgrind_tracer);
+
+#define IOTJS_VALIDATED_STRUCT_METHOD(iotjs_classname_t, x) \
+  IOTJS_DECLARE_THIS(iotjs_classname_t, x);                 \
+  IOTJS_VALIDATE_FLAG(iotjs_classname_t, x);
+
+#define IOTJS_VALIDATABLE_STRUCT_DESTRUCTOR_VALIDATE(iotjs_classname_t, x) \
+  IOTJS_VALIDATE_FLAG(iotjs_classname_t, x);                               \
+  (x)->flag_create = IOTJS_INVALID_MAGIC_SEQUENCE;                         \
+  iotjs_buffer_release((x)->valgrind_tracer);
+
+#define IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_classname_t, x) \
+  IOTJS_VALIDATE_FLAG(iotjs_classname_t, x);
+
+#endif /* NDEBUG */
+
+#include <uv.h>
+#include <assert.h>
+#include <limits.h> /* PATH_MAX */
+#include <stdbool.h>
+#include <string.h>
+
+// commonly used header files
+#include "iotjs_binding.h"
+#include "iotjs_binding_helper.h"
+#include "iotjs_debuglog.h"
+#include "iotjs_env.h"
+#include "iotjs_magic_strings.h"
+#include "iotjs_module.h"
+#include "iotjs_string.h"
+#include "iotjs_util.h"
+
+
+#endif /* IOTJS_DEF_H */
diff --git a/src/iotjs_env.c b/src/iotjs_env.c
new file mode 100644 (file)
index 0000000..e5299c5
--- /dev/null
@@ -0,0 +1,191 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "iotjs_def.h"
+#include "iotjs_env.h"
+
+#include <string.h>
+
+
+static iotjs_environment_t current_env;
+static bool initialized = false;
+
+
+/**
+ * Constructor/Destructor on private section.
+ * To prevent create an instance of iotjs_environment_t.
+ * The only way to get an instance of environment is iotjs_environment_get()
+ */
+
+
+static void iotjs_environment_initialize(iotjs_environment_t* env);
+static void iotjs_environment_destroy(iotjs_environment_t* env);
+
+
+/**
+ * Get the singleton instance of iotjs_environment_t.
+ */
+const iotjs_environment_t* iotjs_environment_get() {
+  if (!initialized) {
+    iotjs_environment_initialize(&current_env);
+    initialized = true;
+  }
+  return &current_env;
+}
+
+
+/**
+ * Release the singleton instance of iotjs_environment_t.
+ */
+void iotjs_environment_release() {
+  if (initialized) {
+    iotjs_environment_destroy(&current_env);
+    initialized = false;
+  }
+}
+
+
+/**
+ * Initialize an instance of iotjs_environment_t.
+ */
+static void iotjs_environment_initialize(iotjs_environment_t* env) {
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_environment_t, env);
+
+  _this->argc = 0;
+  _this->argv = NULL;
+  _this->loop = NULL;
+  _this->state = kInitializing;
+  _this->config.memstat = false;
+  _this->config.show_opcode = false;
+}
+
+
+/**
+ * Destroy an instance of iotjs_environment_t.
+ */
+static void iotjs_environment_destroy(iotjs_environment_t* env) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_environment_t, env);
+  if (_this->argv) {
+    // release command line argument strings.
+    // _argv[0] and _argv[1] refer addresses in static memory space.
+    // Others refer addresses in heap space that is need to be deallocated.
+    for (uint32_t i = 2; i < _this->argc; ++i) {
+      iotjs_buffer_release(_this->argv[i]);
+    }
+    iotjs_buffer_release((char*)_this->argv);
+  }
+}
+
+
+/**
+ * Parse command line arguments
+ */
+bool iotjs_environment_parse_command_line_arguments(iotjs_environment_t* env,
+                                                    uint32_t argc,
+                                                    char** argv) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);
+
+  // Parse IoT.js command line arguments.
+  uint32_t i = 1;
+  while (i < argc && argv[i][0] == '-') {
+    if (!strcmp(argv[i], "--memstat")) {
+      _this->config.memstat = true;
+    } else if (!strcmp(argv[i], "--show-opcodes")) {
+      _this->config.show_opcode = true;
+    } else if (!strcmp(argv[i], "--start-debug-server")) {
+      _this->config.debugger = true;
+    } else {
+      fprintf(stderr, "unknown command line option: %s\n", argv[i]);
+      return false;
+    }
+    ++i;
+  }
+
+  // There must be at least one argument after processing the IoT.js args.
+  if ((argc - i) < 1) {
+    fprintf(stderr,
+            "Usage: iotjs [options] {script | script.js} [arguments]\n");
+    return false;
+  }
+
+  // Remaining arguments are for application.
+  _this->argc = 2;
+  size_t buffer_size = ((size_t)(_this->argc + argc - i)) * sizeof(char*);
+  _this->argv = (char**)iotjs_buffer_allocate(buffer_size);
+  _this->argv[0] = argv[0];
+  _this->argv[1] = argv[i++];
+  while (i < argc) {
+    _this->argv[_this->argc] = iotjs_buffer_allocate(strlen(argv[i]) + 1);
+    strcpy(_this->argv[_this->argc], argv[i]);
+    _this->argc++;
+    i++;
+  }
+
+  return true;
+}
+
+uint32_t iotjs_environment_argc(const iotjs_environment_t* env) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);
+  return _this->argc;
+}
+
+
+const char* iotjs_environment_argv(const iotjs_environment_t* env,
+                                   uint32_t idx) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);
+  return _this->argv[idx];
+}
+
+
+uv_loop_t* iotjs_environment_loop(const iotjs_environment_t* env) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);
+  return _this->loop;
+}
+
+
+void iotjs_environment_set_loop(iotjs_environment_t* env, uv_loop_t* loop) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);
+  _this->loop = loop;
+}
+
+
+const Config* iotjs_environment_config(const iotjs_environment_t* env) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);
+  return &_this->config;
+}
+
+
+void iotjs_environment_go_state_running_main(iotjs_environment_t* env) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);
+
+  IOTJS_ASSERT(_this->state == kInitializing);
+  _this->state = kRunningMain;
+}
+
+
+void iotjs_environment_go_state_running_loop(iotjs_environment_t* env) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);
+
+  IOTJS_ASSERT(_this->state == kRunningMain);
+  _this->state = kRunningLoop;
+}
+
+
+void iotjs_environment_go_state_exiting(iotjs_environment_t* env) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);
+  IOTJS_ASSERT(_this->state < kExiting);
+  _this->state = kExiting;
+}
diff --git a/src/iotjs_env.h b/src/iotjs_env.h
new file mode 100644 (file)
index 0000000..31b04da
--- /dev/null
@@ -0,0 +1,74 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_ENV_H
+#define IOTJS_ENV_H
+
+#include "uv.h"
+
+
+typedef struct {
+  bool memstat;
+  bool show_opcode;
+  bool debugger;
+} Config;
+
+typedef enum {
+  kInitializing,
+  kRunningMain,
+  kRunningLoop,
+  kExiting,
+} State;
+
+
+typedef struct {
+  // Number of application arguments including 'iotjs' and app name.
+  uint32_t argc;
+
+  // Application arguments list including 'iotjs' and app name.
+  char** argv;
+
+  // I/O event loop.
+  uv_loop_t* loop;
+
+  // Running state.
+  State state;
+
+  // Run config
+  Config config;
+} IOTJS_VALIDATED_STRUCT(iotjs_environment_t);
+
+
+const iotjs_environment_t* iotjs_environment_get();
+void iotjs_environment_release();
+
+bool iotjs_environment_parse_command_line_arguments(iotjs_environment_t* env,
+                                                    uint32_t argc, char** argv);
+
+uint32_t iotjs_environment_argc(const iotjs_environment_t* env);
+const char* iotjs_environment_argv(const iotjs_environment_t* env,
+                                   uint32_t idx);
+
+uv_loop_t* iotjs_environment_loop(const iotjs_environment_t* env);
+void iotjs_environment_set_loop(iotjs_environment_t* env, uv_loop_t* loop);
+
+const Config* iotjs_environment_config(const iotjs_environment_t* env);
+
+void iotjs_environment_go_state_running_main(iotjs_environment_t* env);
+void iotjs_environment_go_state_running_loop(iotjs_environment_t* env);
+void iotjs_environment_go_state_exiting(iotjs_environment_t* env);
+
+
+#endif /* IOTJS_ENV_H */
diff --git a/src/iotjs_exception.c b/src/iotjs_exception.c
new file mode 100644 (file)
index 0000000..bad8c26
--- /dev/null
@@ -0,0 +1,29 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "iotjs_def.h"
+#include "iotjs_exception.h"
+
+#include <stdio.h>
+
+#include "uv.h"
+
+
+iotjs_jval_t iotjs_create_uv_exception(int errorno, const char* syscall) {
+  static char msg[256];
+  snprintf(msg, sizeof(msg), "'%s' %s", syscall, uv_strerror(errorno));
+  return iotjs_jval_create_error(msg);
+}
diff --git a/src/iotjs_exception.h b/src/iotjs_exception.h
new file mode 100644 (file)
index 0000000..6be7916
--- /dev/null
@@ -0,0 +1,23 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_EXCEPTION_H
+#define IOTJS_EXCEPTION_H
+
+
+iotjs_jval_t iotjs_create_uv_exception(int errorno, const char* syscall);
+
+
+#endif /* IOTJS_EXCEPTION_H */
diff --git a/src/iotjs_handlewrap.c b/src/iotjs_handlewrap.c
new file mode 100644 (file)
index 0000000..fb03a3d
--- /dev/null
@@ -0,0 +1,125 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_handlewrap.h"
+
+
+void iotjs_handlewrap_initialize(iotjs_handlewrap_t* handlewrap,
+                                 const iotjs_jval_t* jobject,
+                                 uv_handle_t* handle,
+                                 JNativeInfoType native_info) {
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_handlewrap_t, handlewrap);
+
+  // Increase ref count of Javascript object to guarantee it is alive until the
+  // handle has closed.
+  iotjs_jval_t jobjectref = iotjs_jval_create_copied(jobject);
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap, &jobjectref, native_info);
+
+  _this->handle = handle;
+  _this->on_close_cb = NULL;
+
+  handle->data = handlewrap;
+
+  iotjs_handlewrap_validate(handlewrap);
+}
+
+
+void iotjs_handlewrap_destroy(iotjs_handlewrap_t* handlewrap) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_handlewrap_t, handlewrap);
+
+  // Handle should have been release before this.
+  IOTJS_ASSERT(_this->handle == NULL);
+
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+}
+
+
+iotjs_handlewrap_t* iotjs_handlewrap_from_handle(uv_handle_t* handle) {
+  iotjs_handlewrap_t* handlewrap = (iotjs_handlewrap_t*)(handle->data);
+  iotjs_handlewrap_validate(handlewrap);
+  return handlewrap;
+}
+
+
+iotjs_handlewrap_t* iotjs_handlewrap_from_jobject(const iotjs_jval_t* jobject) {
+  iotjs_handlewrap_t* handlewrap =
+      (iotjs_handlewrap_t*)(iotjs_jval_get_object_native_handle(jobject));
+  iotjs_handlewrap_validate(handlewrap);
+  return handlewrap;
+}
+
+
+uv_handle_t* iotjs_handlewrap_get_uv_handle(iotjs_handlewrap_t* handlewrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_handlewrap_t, handlewrap);
+  iotjs_handlewrap_validate(handlewrap);
+  return _this->handle;
+}
+
+
+iotjs_jval_t* iotjs_handlewrap_jobject(iotjs_handlewrap_t* handlewrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_handlewrap_t, handlewrap);
+  iotjs_handlewrap_validate(handlewrap);
+  return iotjs_jobjectwrap_jobject(&_this->jobjectwrap);
+}
+
+
+static void iotjs_handlewrap_on_close(iotjs_handlewrap_t* handlewrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_handlewrap_t, handlewrap);
+
+  // The handle closed.
+  // Calls registered close handler function.
+  if (_this->on_close_cb) {
+    _this->on_close_cb(_this->handle);
+  }
+
+  // Set handle null.
+  _this->handle = NULL;
+
+  // Decrease ref count of Javascript object. From now the object can be
+  // reclaimed.
+  iotjs_jval_destroy(iotjs_jobjectwrap_jobject(&_this->jobjectwrap));
+}
+
+
+static void iotjs_on_handle_closed(uv_handle_t* handle) {
+  iotjs_handlewrap_t* handlewrap = iotjs_handlewrap_from_handle(handle);
+  iotjs_handlewrap_on_close(handlewrap);
+}
+
+
+void iotjs_handlewrap_close(iotjs_handlewrap_t* handlewrap,
+                            OnCloseHandler on_close_cb) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_handlewrap_t, handlewrap);
+
+  if (_this->handle != NULL && !uv_is_closing(_this->handle)) {
+    _this->on_close_cb = on_close_cb;
+    uv_close(_this->handle, iotjs_on_handle_closed);
+  } else {
+    DDLOG("Attempt to close uninitialized or already closed handle");
+  }
+}
+
+
+void iotjs_handlewrap_validate(iotjs_handlewrap_t* handlewrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_handlewrap_t, handlewrap);
+
+  IOTJS_ASSERT((iotjs_handlewrap_t*)_this == handlewrap);
+  IOTJS_ASSERT((iotjs_jobjectwrap_t*)_this == &_this->jobjectwrap);
+  IOTJS_ASSERT((void*)_this == _this->handle->data);
+  IOTJS_ASSERT((uintptr_t)_this ==
+               iotjs_jval_get_object_native_handle(
+                   iotjs_jobjectwrap_jobject(&_this->jobjectwrap)));
+}
diff --git a/src/iotjs_handlewrap.h b/src/iotjs_handlewrap.h
new file mode 100644 (file)
index 0000000..ed614c6
--- /dev/null
@@ -0,0 +1,72 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_HANDLEWRAP_H
+#define IOTJS_HANDLEWRAP_H
+
+
+#include <uv.h>
+
+#include "iotjs_binding.h"
+#include "iotjs_objectwrap.h"
+
+
+typedef void (*OnCloseHandler)(uv_handle_t*);
+
+
+// UV handle wrapper.
+// This wrapper connects a Javascript object and a libuv handler.
+// This wrapper will increase ref count for the Javascript object and decrease
+//  it after corresponding handle has closed. Hence the Javascript object will
+//  not turn into garbage until the handle is open.
+
+// Javascript object
+//   ->
+// Create a handle wrap, initializing uv handle, increase ref count.
+//   ->
+// The javascript object will be alive until handle has closed.
+//   ->
+// Handle closed, release handle, decrease ref count.
+//   ->
+// The javascript object now can be reclaimed by GC.
+
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+  uv_handle_t* handle;
+  OnCloseHandler on_close_cb;
+} IOTJS_VALIDATED_STRUCT(iotjs_handlewrap_t);
+
+
+// jobject: Object that connect with the uv handle
+void iotjs_handlewrap_initialize(iotjs_handlewrap_t* handlewrap,
+                                 const iotjs_jval_t* jobject,
+                                 uv_handle_t* handle,
+                                 JNativeInfoType native_info);
+
+void iotjs_handlewrap_destroy(iotjs_handlewrap_t* handlewrap);
+
+void iotjs_handlewrap_close(iotjs_handlewrap_t* handlewrap,
+                            OnCloseHandler on_close_cb);
+
+iotjs_handlewrap_t* iotjs_handlewrap_from_handle(uv_handle_t* handle);
+iotjs_handlewrap_t* iotjs_handlewrap_from_jobject(const iotjs_jval_t* jobject);
+
+uv_handle_t* iotjs_handlewrap_get_uv_handle(iotjs_handlewrap_t* handlewrap);
+iotjs_jval_t* iotjs_handlewrap_jobject(iotjs_handlewrap_t* handlewrap);
+
+void iotjs_handlewrap_validate(iotjs_handlewrap_t* handlewrap);
+
+
+#endif /* IOTJS_HANDLEWRAP_H */
diff --git a/src/iotjs_magic_strings.h b/src/iotjs_magic_strings.h
new file mode 100644 (file)
index 0000000..b5abb49
--- /dev/null
@@ -0,0 +1,210 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_STRING_CONSTANTS_H
+#define IOTJS_STRING_CONSTANTS_H
+
+#define IOTJS_MAGIC_STRING_0 "0"
+#define IOTJS_MAGIC_STRING_1 "1"
+#define IOTJS_MAGIC_STRING_2 "2"
+#define IOTJS_MAGIC_STRING_3 "3"
+#define IOTJS_MAGIC_STRING_ABORT "abort"
+#define IOTJS_MAGIC_STRING_ADC "Adc"
+#define IOTJS_MAGIC_STRING_ADDHEADER "addHeader"
+#define IOTJS_MAGIC_STRING_ADDMEMBERSHIP "addMembership"
+#define IOTJS_MAGIC_STRING_ADDRESS "address"
+#define IOTJS_MAGIC_STRING_ARCH "arch"
+#define IOTJS_MAGIC_STRING_ARGV "argv"
+#define IOTJS_MAGIC_STRING_BAUDRATE "baudRate"
+#define IOTJS_MAGIC_STRING_BIND "bind"
+#define IOTJS_MAGIC_STRING_BINDCONTROL "bindControl"
+#define IOTJS_MAGIC_STRING_BINDING "binding"
+#define IOTJS_MAGIC_STRING_BINDRAW "bindRaw"
+#define IOTJS_MAGIC_STRING_BINDUSER "bindUser"
+#define IOTJS_MAGIC_STRING_BITORDER "bitOrder"
+#define IOTJS_MAGIC_STRING_BITORDER_U "BITORDER"
+#define IOTJS_MAGIC_STRING_BITSPERWORD "bitsPerWord"
+#define IOTJS_MAGIC_STRING_BOARD "board"
+#define IOTJS_MAGIC_STRING_BOTH_U "BOTH"
+#define IOTJS_MAGIC_STRING_BUFFER "Buffer"
+#define IOTJS_MAGIC_STRING__BUFFER "_buffer"
+#define IOTJS_MAGIC_STRING__BUILTIN "_builtin"
+#define IOTJS_MAGIC_STRING_BUS "bus"
+#define IOTJS_MAGIC_STRING_BYTELENGTH "byteLength"
+#define IOTJS_MAGIC_STRING_BYTEPARSED "byteParsed"
+#define IOTJS_MAGIC_STRING_CA "ca"
+#define IOTJS_MAGIC_STRING_CERT "cert"
+#define IOTJS_MAGIC_STRING_CHDIR "chdir"
+#define IOTJS_MAGIC_STRING_CHIP "chip"
+#define IOTJS_MAGIC_STRING_CHIPSELECT "chipSelect"
+#define IOTJS_MAGIC_STRING_CHIPSELECT_U "CHIPSELECT"
+#define IOTJS_MAGIC_STRING_CLOSE "close"
+#define IOTJS_MAGIC_STRING_CLOSESYNC "closeSync"
+#define IOTJS_MAGIC_STRING_CODE "code"
+#define IOTJS_MAGIC_STRING_COMPARE "compare"
+#define IOTJS_MAGIC_STRING_COMPILE "compile"
+#define IOTJS_MAGIC_STRING_COMPILENATIVEPTR "compileNativePtr"
+#define IOTJS_MAGIC_STRING_CONNECT "connect"
+#define IOTJS_MAGIC_STRING_COPY "copy"
+#define IOTJS_MAGIC_STRING_CREATEREQUEST "createRequest"
+#define IOTJS_MAGIC_STRING__CREATESTAT "_createStat"
+#define IOTJS_MAGIC_STRING_CREATETCP "createTCP"
+#define IOTJS_MAGIC_STRING_CWD "cwd"
+#define IOTJS_MAGIC_STRING_DATABITS "dataBits"
+#define IOTJS_MAGIC_STRING_DEVICE "device"
+#define IOTJS_MAGIC_STRING_DIRECTION "direction"
+#define IOTJS_MAGIC_STRING_DIRECTION_U "DIRECTION"
+#define IOTJS_MAGIC_STRING_DOEXIT "doExit"
+#define IOTJS_MAGIC_STRING_DROPMEMBERSHIP "dropMembership"
+#define IOTJS_MAGIC_STRING_DUTYCYCLE "dutyCycle"
+#define IOTJS_MAGIC_STRING_EDGE "edge"
+#define IOTJS_MAGIC_STRING_EDGE_U "EDGE"
+#define IOTJS_MAGIC_STRING_EMIT "emit"
+#define IOTJS_MAGIC_STRING_EMITEXIT "emitExit"
+#define IOTJS_MAGIC_STRING_ENV "env"
+#define IOTJS_MAGIC_STRING_ERRNAME "errname"
+#define IOTJS_MAGIC_STRING_EXECUTE "execute"
+#define IOTJS_MAGIC_STRING_EXPORT "export"
+#define IOTJS_MAGIC_STRING_FALLING_U "FALLING"
+#define IOTJS_MAGIC_STRING_FAMILY "family"
+#define IOTJS_MAGIC_STRING_FINISH "finish"
+#define IOTJS_MAGIC_STRING_FINISHREQUEST "finishRequest"
+#define IOTJS_MAGIC_STRING_FLOAT "FLOAT"
+#define IOTJS_MAGIC_STRING_FSTAT "fstat"
+#define IOTJS_MAGIC_STRING_GETADDRINFO "getaddrinfo"
+#define IOTJS_MAGIC_STRING_GETSOCKNAME "getsockname"
+#define IOTJS_MAGIC_STRING_GPIO "Gpio"
+#define IOTJS_MAGIC_STRING_HANDLER "handler"
+#define IOTJS_MAGIC_STRING_HANDLETIMEOUT "handleTimeout"
+#define IOTJS_MAGIC_STRING_HEADERS "headers"
+#define IOTJS_MAGIC_STRING_HEXWRITE "hexWrite"
+#define IOTJS_MAGIC_STRING_HIGH "HIGH"
+#define IOTJS_MAGIC_STRING_HOME "HOME"
+#define IOTJS_MAGIC_STRING_HOST "host"
+#define IOTJS_MAGIC_STRING_HTTPPARSER "HTTPParser"
+#define IOTJS_MAGIC_STRING_IN "IN"
+#define IOTJS_MAGIC_STRING__INCOMING "_incoming"
+#define IOTJS_MAGIC_STRING_IOTJS_ENV "IOTJS_ENV"
+#define IOTJS_MAGIC_STRING_IOTJS_PATH "IOTJS_PATH"
+#define IOTJS_MAGIC_STRING_IOTJS "iotjs"
+#define IOTJS_MAGIC_STRING_IPV4 "IPv4"
+#define IOTJS_MAGIC_STRING_IPV6 "IPv6"
+#define IOTJS_MAGIC_STRING_ISALIVEEXCEPTFOR "isAliveExceptFor"
+#define IOTJS_MAGIC_STRING_ISDEVUP "isDevUp"
+#define IOTJS_MAGIC_STRING_ISDIRECTORY "isDirectory"
+#define IOTJS_MAGIC_STRING_ISFILE "isFile"
+#define IOTJS_MAGIC_STRING_KEY "key"
+#define IOTJS_MAGIC_STRING_LENGTH "length"
+#define IOTJS_MAGIC_STRING_LISTEN "listen"
+#define IOTJS_MAGIC_STRING_LOOPBACK "loopback"
+#define IOTJS_MAGIC_STRING_LSB "LSB"
+#define IOTJS_MAGIC_STRING_MAXSPEED "maxSpeed"
+#define IOTJS_MAGIC_STRING_METHOD "method"
+#define IOTJS_MAGIC_STRING_METHODS "methods"
+#define IOTJS_MAGIC_STRING_MKDIR "mkdir"
+#define IOTJS_MAGIC_STRING_MODE "mode"
+#define IOTJS_MAGIC_STRING_MODE_U "MODE"
+#define IOTJS_MAGIC_STRING_MSB "MSB"
+#define IOTJS_MAGIC_STRING_NATIVE_SOURCES "native_sources"
+#define IOTJS_MAGIC_STRING_NONE "NONE"
+#define IOTJS_MAGIC_STRING_ONBODY "OnBody"
+#define IOTJS_MAGIC_STRING_ONCLOSE "onclose"
+#define IOTJS_MAGIC_STRING_ONCLOSED "onClosed"
+#define IOTJS_MAGIC_STRING_ONCONNECTION "onconnection"
+#define IOTJS_MAGIC_STRING_ONDATA "onData"
+#define IOTJS_MAGIC_STRING_ONEND "onEnd"
+#define IOTJS_MAGIC_STRING_ONERROR "onError"
+#define IOTJS_MAGIC_STRING_ONHEADERSCOMPLETE "OnHeadersComplete"
+#define IOTJS_MAGIC_STRING_ONHEADERS "OnHeaders"
+#define IOTJS_MAGIC_STRING_ONMESSAGECOMPLETE "OnMessageComplete"
+#define IOTJS_MAGIC_STRING_ONMESSAGE "onmessage"
+#define IOTJS_MAGIC_STRING__ONNEXTTICK "_onNextTick"
+#define IOTJS_MAGIC_STRING_ONREAD "onread"
+#define IOTJS_MAGIC_STRING_ONSOCKET "onSocket"
+#define IOTJS_MAGIC_STRING_ONTIMEOUT "onTimeout"
+#define IOTJS_MAGIC_STRING__ONUNCAUGHTEXCEPTION "_onUncaughtException"
+#define IOTJS_MAGIC_STRING_ONWRITABLE "onWritable"
+#define IOTJS_MAGIC_STRING_OPENDRAIN "OPENDRAIN"
+#define IOTJS_MAGIC_STRING_OPEN "open"
+#define IOTJS_MAGIC_STRING_OUT "OUT"
+#define IOTJS_MAGIC_STRING_OWNER "owner"
+#define IOTJS_MAGIC_STRING_PAUSE "pause"
+#define IOTJS_MAGIC_STRING_PERIOD "period"
+#define IOTJS_MAGIC_STRING_PIN "pin"
+#define IOTJS_MAGIC_STRING_PLATFORM "platform"
+#define IOTJS_MAGIC_STRING_PORT "port"
+#define IOTJS_MAGIC_STRING_PROTOTYPE "prototype"
+#define IOTJS_MAGIC_STRING_PULLDOWN "PULLDOWN"
+#define IOTJS_MAGIC_STRING_PULLUP "PULLUP"
+#define IOTJS_MAGIC_STRING_PUSHPULL "PUSHPULL"
+#define IOTJS_MAGIC_STRING_READDIR "readdir"
+#define IOTJS_MAGIC_STRING_READ "read"
+#define IOTJS_MAGIC_STRING_READSOURCE "readSource"
+#define IOTJS_MAGIC_STRING_READSTART "readStart"
+#define IOTJS_MAGIC_STRING_READSYNC "readSync"
+#define IOTJS_MAGIC_STRING_READUINT8 "readUInt8"
+#define IOTJS_MAGIC_STRING_RECVSTART "recvStart"
+#define IOTJS_MAGIC_STRING_RECVSTOP "recvStop"
+#define IOTJS_MAGIC_STRING_REF "ref"
+#define IOTJS_MAGIC_STRING_REINITIALIZE "reinitialize"
+#define IOTJS_MAGIC_STRING_RENAME "rename"
+#define IOTJS_MAGIC_STRING_REQUEST "REQUEST"
+#define IOTJS_MAGIC_STRING_RESPONSE "RESPONSE"
+#define IOTJS_MAGIC_STRING_RESUME "resume"
+#define IOTJS_MAGIC_STRING__REUSEADDR "_reuseAddr"
+#define IOTJS_MAGIC_STRING_RISING_U "RISING"
+#define IOTJS_MAGIC_STRING_RMDIR "rmdir"
+#define IOTJS_MAGIC_STRING_SEND "send"
+#define IOTJS_MAGIC_STRING_SENDREQUEST "sendRequest"
+#define IOTJS_MAGIC_STRING_SETADDRESS "setAddress"
+#define IOTJS_MAGIC_STRING_SETBROADCAST "setBroadcast"
+#define IOTJS_MAGIC_STRING_SETDUTYCYCLE "setDutyCycle"
+#define IOTJS_MAGIC_STRING_SETENABLE "setEnable"
+#define IOTJS_MAGIC_STRING_SETFILTER "setFilter"
+#define IOTJS_MAGIC_STRING_SETFREQUENCY "setFrequency"
+#define IOTJS_MAGIC_STRING_SETKEEPALIVE "setKeepAlive"
+#define IOTJS_MAGIC_STRING_SETMULTICASTLOOPBACK "setMulticastLoopback"
+#define IOTJS_MAGIC_STRING_SETMULTICASTTTL "setMulticastTTL"
+#define IOTJS_MAGIC_STRING_SETPERIOD "setPeriod"
+#define IOTJS_MAGIC_STRING_SETTIMEOUT "setTimeout"
+#define IOTJS_MAGIC_STRING_SETTTL "setTTL"
+#define IOTJS_MAGIC_STRING_SHOULDKEEPALIVE "shouldkeepalive"
+#define IOTJS_MAGIC_STRING_SHUTDOWN "shutdown"
+#define IOTJS_MAGIC_STRING_SLICE "slice"
+#define IOTJS_MAGIC_STRING_SPI "Spi"
+#define IOTJS_MAGIC_STRING_START "start"
+#define IOTJS_MAGIC_STRING_STAT "stat"
+#define IOTJS_MAGIC_STRING_STATS "stats"
+#define IOTJS_MAGIC_STRING_STATUS_MSG "status_msg"
+#define IOTJS_MAGIC_STRING_STATUS "status"
+#define IOTJS_MAGIC_STRING_STDERR "stderr"
+#define IOTJS_MAGIC_STRING_STDOUT "stdout"
+#define IOTJS_MAGIC_STRING_STOP "stop"
+#define IOTJS_MAGIC_STRING_TOHEXSTRING "toHexString"
+#define IOTJS_MAGIC_STRING_TOSTRING "toString"
+#define IOTJS_MAGIC_STRING_TRANSFERARRAY "transferArray"
+#define IOTJS_MAGIC_STRING_TRANSFERBUFFER "transferBuffer"
+#define IOTJS_MAGIC_STRING_UNEXPORT "unexport"
+#define IOTJS_MAGIC_STRING_UNLINK "unlink"
+#define IOTJS_MAGIC_STRING_UNREF "unref"
+#define IOTJS_MAGIC_STRING_UPGRADE "upgrade"
+#define IOTJS_MAGIC_STRING_URL "url"
+#define IOTJS_MAGIC_STRING_VERSION "version"
+#define IOTJS_MAGIC_STRING_WRITESYNC "writeSync"
+#define IOTJS_MAGIC_STRING_WRITEUINT8 "writeUInt8"
+#define IOTJS_MAGIC_STRING_WRITE "write"
+#define IOTJS_MAGIC_STRING__WRITE "_write"
+
+#endif /* IOTJS_STRING_CONSTANTS_H */
diff --git a/src/iotjs_module.c b/src/iotjs_module.c
new file mode 100644 (file)
index 0000000..20a8080
--- /dev/null
@@ -0,0 +1,78 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "iotjs_def.h"
+#include "iotjs_module.h"
+
+
+typedef struct {
+  ModuleKind kind;
+  iotjs_jval_t jmodule;
+  register_func fn_register;
+} iotjs_module_t;
+
+
+static iotjs_module_t modules[MODULE_COUNT];
+
+
+#define DECLARE_MODULE_INITIALIZER(upper, Camel, lower) \
+  iotjs_jval_t Init##Camel();
+
+MAP_MODULE_LIST(DECLARE_MODULE_INITIALIZER)
+
+#undef DECLARE_MODULE_INITIALIZER
+
+
+#define INIT_MODULE_LIST(upper, Camel, lower)                    \
+  modules[MODULE_##upper].kind = MODULE_##upper;                 \
+  modules[MODULE_##upper].jmodule = *iotjs_jval_get_undefined(); \
+  modules[MODULE_##upper].fn_register = Init##Camel;
+
+void iotjs_module_list_init() {
+  MAP_MODULE_LIST(INIT_MODULE_LIST)
+}
+
+#undef INIT_MODULE_LIST
+
+
+#define CLENUP_MODULE_LIST(upper, Camel, lower)                   \
+  if (!iotjs_jval_is_undefined(&modules[MODULE_##upper].jmodule)) \
+    iotjs_jval_destroy(&modules[MODULE_##upper].jmodule);
+
+void iotjs_module_list_cleanup() {
+  MAP_MODULE_LIST(CLENUP_MODULE_LIST)
+}
+
+#undef CLENUP_MODULE_LIST
+
+
+const iotjs_jval_t* iotjs_module_initialize_if_necessary(ModuleKind kind) {
+  IOTJS_ASSERT(kind < MODULE_COUNT);
+  IOTJS_ASSERT(&modules[kind].fn_register != NULL);
+
+  if (iotjs_jval_is_undefined(&modules[kind].jmodule)) {
+    modules[kind].jmodule = modules[kind].fn_register();
+  }
+
+  return iotjs_module_get(kind);
+}
+
+
+const iotjs_jval_t* iotjs_module_get(ModuleKind kind) {
+  IOTJS_ASSERT(kind < MODULE_COUNT);
+  IOTJS_ASSERT(!iotjs_jval_is_undefined(&modules[kind].jmodule));
+  return &modules[kind].jmodule;
+}
diff --git a/src/iotjs_module.h b/src/iotjs_module.h
new file mode 100644 (file)
index 0000000..0b6d86e
--- /dev/null
@@ -0,0 +1,76 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_MODULE_H
+#define IOTJS_MODULE_H
+
+#include "iotjs_binding.h"
+
+
+typedef iotjs_jval_t (*register_func)();
+
+
+#define CONCATENATE(x, ...) x##__VA_ARGS__
+
+#define IF(c) CONCATENATE(IF_, c)
+#define IF_1(expr) expr
+#define IF_0(expr)
+
+// Check if specific module is enabled
+#define E(F, UPPER, Camel, lower) \
+  IF(ENABLE_MODULE_##UPPER)(F(UPPER, Camel, lower))
+
+// List of builtin modules
+#define MAP_MODULE_LIST(F)                       \
+  E(F, ADC, Adc, adc)                            \
+  E(F, BLEHCISOCKET, Blehcisocket, blehcisocket) \
+  E(F, BUFFER, Buffer, buffer)                   \
+  E(F, CONSOLE, Console, console)                \
+  E(F, CONSTANTS, Constants, constants)          \
+  E(F, DNS, Dns, dns)                            \
+  E(F, FS, Fs, fs)                               \
+  E(F, GPIO, Gpio, gpio)                         \
+  E(F, HTTPPARSER, Httpparser, httpparser)       \
+  E(F, HTTPS, Https, https)                      \
+  E(F, I2C, I2c, i2c)                            \
+  E(F, PROCESS, Process, process)                \
+  E(F, PWM, Pwm, pwm)                            \
+  E(F, SPI, Spi, spi)                            \
+  E(F, STM32F4DIS, Stm32f4dis, stm32f4dis)       \
+  E(F, TESTDRIVER, Testdriver, testdriver)       \
+  E(F, TCP, Tcp, tcp)                            \
+  E(F, TIMER, Timer, timer)                      \
+  E(F, UART, Uart, uart)                         \
+  E(F, UDP, Udp, udp)
+
+#define ENUMDEF_MODULE_LIST(upper, Camel, lower) MODULE_##upper,
+
+typedef enum {
+  MAP_MODULE_LIST(ENUMDEF_MODULE_LIST) // enumerate modules
+  MODULE_COUNT,
+} ModuleKind;
+
+#undef ENUMDEF_MODULE_LIST
+
+
+void iotjs_module_list_init();
+
+void iotjs_module_list_cleanup();
+
+const iotjs_jval_t* iotjs_module_initialize_if_necessary(ModuleKind kind);
+const iotjs_jval_t* iotjs_module_get(ModuleKind kind);
+
+
+#endif /* IOTJS_MODULE_H */
diff --git a/src/iotjs_objectwrap.c b/src/iotjs_objectwrap.c
new file mode 100644 (file)
index 0000000..66b22fb
--- /dev/null
@@ -0,0 +1,61 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_objectwrap.h"
+
+
+void iotjs_jobjectwrap_initialize(iotjs_jobjectwrap_t* jobjectwrap,
+                                  const iotjs_jval_t* jobject,
+                                  JNativeInfoType native_info) {
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_jobjectwrap_t, jobjectwrap);
+
+  IOTJS_ASSERT(iotjs_jval_is_object(jobject));
+
+  // This wrapper holds pointer to the javascript object but never increases
+  // reference count.
+  _this->jobject = *((iotjs_jval_t*)jobject);
+
+  // Set native pointer of the object to be this wrapper.
+  // If the object is freed by GC, the wrapper instance should also be freed.
+  iotjs_jval_set_object_native_handle(&_this->jobject, (uintptr_t)jobjectwrap,
+                                      native_info);
+}
+
+
+void iotjs_jobjectwrap_destroy(iotjs_jobjectwrap_t* jobjectwrap) {
+  IOTJS_VALIDATABLE_STRUCT_DESTRUCTOR_VALIDATE(iotjs_jobjectwrap_t,
+                                               jobjectwrap);
+  /* Do nothing on _this->jobject */
+}
+
+
+iotjs_jval_t* iotjs_jobjectwrap_jobject(iotjs_jobjectwrap_t* jobjectwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_jobjectwrap_t, jobjectwrap);
+  iotjs_jval_t* jobject = &_this->jobject;
+  IOTJS_ASSERT((uintptr_t)jobjectwrap ==
+               iotjs_jval_get_object_native_handle(jobject));
+  IOTJS_ASSERT(iotjs_jval_is_object(jobject));
+  return jobject;
+}
+
+
+iotjs_jobjectwrap_t* iotjs_jobjectwrap_from_jobject(
+    const iotjs_jval_t* jobject) {
+  iotjs_jobjectwrap_t* wrap =
+      (iotjs_jobjectwrap_t*)(iotjs_jval_get_object_native_handle(jobject));
+  IOTJS_ASSERT(iotjs_jval_is_object(iotjs_jobjectwrap_jobject(wrap)));
+  return wrap;
+}
diff --git a/src/iotjs_objectwrap.h b/src/iotjs_objectwrap.h
new file mode 100644 (file)
index 0000000..5d51b27
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_OBJECTWRAP_H
+#define IOTJS_OBJECTWRAP_H
+
+
+#include "iotjs_binding.h"
+
+
+// This wrapper refer javascript object but never increase reference count
+// If the object is freed by GC, then this wrapper instance will be also freed.
+typedef struct {
+  iotjs_jval_t jobject;
+} IOTJS_VALIDATED_STRUCT(iotjs_jobjectwrap_t);
+
+void iotjs_jobjectwrap_initialize(iotjs_jobjectwrap_t* jobjectwrap,
+                                  const iotjs_jval_t* jobject,
+                                  JNativeInfoType native_info);
+
+void iotjs_jobjectwrap_destroy(iotjs_jobjectwrap_t* jobjectwrap);
+
+iotjs_jval_t* iotjs_jobjectwrap_jobject(iotjs_jobjectwrap_t* jobjectwrap);
+iotjs_jobjectwrap_t* iotjs_jobjectwrap_from_jobject(
+    const iotjs_jval_t* jobject);
+
+#define IOTJS_DEFINE_NATIVE_HANDLE_INFO(module)                              \
+  static const jerry_object_native_info_t module##_native_info = {           \
+    .free_cb = (jerry_object_native_free_callback_t)iotjs_##module##_destroy \
+  }
+
+#define IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(name)                  \
+  static void iotjs_##name##_destroy(iotjs_##name##_t* wrap);              \
+  static const jerry_object_native_info_t this_module_native_info = {      \
+    .free_cb = (jerry_object_native_free_callback_t)iotjs_##name##_destroy \
+  }
+
+#endif /* IOTJS_OBJECTWRAP_H */
diff --git a/src/iotjs_reqwrap.c b/src/iotjs_reqwrap.c
new file mode 100644 (file)
index 0000000..ae9037f
--- /dev/null
@@ -0,0 +1,61 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_reqwrap.h"
+
+
+void iotjs_reqwrap_initialize(iotjs_reqwrap_t* reqwrap,
+                              const iotjs_jval_t* jcallback,
+                              uv_req_t* request) {
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_reqwrap_t, reqwrap);
+  IOTJS_ASSERT(iotjs_jval_is_function(jcallback));
+  _this->jcallback = iotjs_jval_create_copied(jcallback);
+  _this->request = request;
+  _this->request->data = reqwrap;
+}
+
+
+void iotjs_reqwrap_destroy(iotjs_reqwrap_t* reqwrap) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_reqwrap_t, reqwrap);
+  iotjs_jval_destroy(&_this->jcallback);
+}
+
+
+static void iotjs_reqwrap_validate(iotjs_reqwrap_t* reqwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_reqwrap_t, reqwrap);
+  IOTJS_ASSERT(_this->request->data == reqwrap);
+}
+
+
+const iotjs_jval_t* iotjs_reqwrap_jcallback(iotjs_reqwrap_t* reqwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_reqwrap_t, reqwrap);
+  iotjs_reqwrap_validate(reqwrap);
+  return &_this->jcallback;
+}
+
+
+uv_req_t* iotjs_reqwrap_req(iotjs_reqwrap_t* reqwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_reqwrap_t, reqwrap);
+  iotjs_reqwrap_validate(reqwrap);
+  return _this->request;
+}
+
+
+iotjs_reqwrap_t* iotjs_reqwrap_from_request(uv_req_t* req) {
+  iotjs_reqwrap_t* reqwrap = req->data;
+  iotjs_reqwrap_validate(reqwrap);
+  return reqwrap;
+}
diff --git a/src/iotjs_reqwrap.h b/src/iotjs_reqwrap.h
new file mode 100644 (file)
index 0000000..3fb99ac
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_REQWRAP_H
+#define IOTJS_REQWRAP_H
+
+
+#include <uv.h>
+
+#include "iotjs_binding.h"
+
+
+// UV request wrapper.
+// Wrapping UV request and JavaScript callback.
+// When an instance of request wrapper is created. it will increase ref count
+// for JavaScript callback function to prevent it from reclaimed by GC. The
+// reference count will decrease back when wrapper is being freed.
+typedef struct {
+  iotjs_jval_t jcallback;
+  uv_req_t* request;
+} IOTJS_VALIDATED_STRUCT(iotjs_reqwrap_t);
+
+
+void iotjs_reqwrap_initialize(iotjs_reqwrap_t* reqwrap,
+                              const iotjs_jval_t* jcallback, uv_req_t* request);
+void iotjs_reqwrap_destroy(iotjs_reqwrap_t* reqwrap);
+
+// To retrieve javascript callback function object.
+const iotjs_jval_t* iotjs_reqwrap_jcallback(iotjs_reqwrap_t* reqwrap);
+
+// To retrieve pointer to uv request.
+uv_req_t* iotjs_reqwrap_req(iotjs_reqwrap_t* reqwrap);
+
+
+iotjs_reqwrap_t* iotjs_reqwrap_from_request(uv_req_t* req);
+
+
+#endif /* IOTJS_REQWRAP_H */
diff --git a/src/iotjs_string.c b/src/iotjs_string.c
new file mode 100644 (file)
index 0000000..839b29d
--- /dev/null
@@ -0,0 +1,132 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "iotjs_def.h"
+#include "iotjs_string.h"
+#include "iotjs_util.h"
+
+#include <string.h>
+
+
+iotjs_string_t iotjs_string_create() {
+  iotjs_string_t str;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_string_t, &str);
+
+  _this->size = 0;
+  _this->data = NULL;
+
+  return str;
+}
+
+
+iotjs_string_t iotjs_string_create_with_size(const char* data, size_t size) {
+  iotjs_string_t str;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_string_t, &str);
+
+  _this->size = size;
+
+  if (size > 0) {
+    IOTJS_ASSERT(data != NULL);
+    _this->data = iotjs_buffer_allocate(size);
+    memcpy(_this->data, data, size);
+  } else {
+    _this->data = NULL;
+  }
+
+  return str;
+}
+
+
+iotjs_string_t iotjs_string_create_with_buffer(char* buffer, size_t size) {
+  iotjs_string_t str;
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_string_t, &str);
+
+  _this->size = size;
+
+  if (size > 0) {
+    IOTJS_ASSERT(buffer != NULL);
+    _this->data = buffer;
+  } else {
+    _this->data = NULL;
+  }
+
+  return str;
+}
+
+
+void iotjs_string_destroy(iotjs_string_t* str) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_string_t, str);
+
+  if (_this->data != NULL) {
+    iotjs_buffer_release(_this->data);
+    _this->size = 0;
+  }
+}
+
+
+bool iotjs_string_is_empty(const iotjs_string_t* str) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_string_t, str);
+
+  return _this->size == 0;
+}
+
+
+void iotjs_string_make_empty(iotjs_string_t* str) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_string_t, str);
+
+  if (_this->data != NULL) {
+    iotjs_buffer_release(_this->data);
+    _this->size = 0;
+    _this->data = NULL;
+  }
+}
+
+
+void iotjs_string_append(iotjs_string_t* str, const char* data, size_t size) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_string_t, str);
+
+  IOTJS_ASSERT(data != NULL);
+
+  if (size == 0) {
+    return;
+  }
+
+  if (_this->data != NULL) {
+    _this->data = iotjs_buffer_reallocate(_this->data, _this->size + size);
+  } else {
+    IOTJS_ASSERT(_this->size == 0);
+    _this->data = iotjs_buffer_allocate(size);
+  }
+
+  memcpy(_this->data + _this->size, data, size);
+  _this->size += size;
+}
+
+
+const char* iotjs_string_data(const iotjs_string_t* str) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_string_t, str);
+  if (_this->data == NULL) {
+    return "";
+  }
+
+  return _this->data;
+}
+
+
+unsigned iotjs_string_size(const iotjs_string_t* str) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_string_t, str);
+  return _this->size;
+}
diff --git a/src/iotjs_string.h b/src/iotjs_string.h
new file mode 100644 (file)
index 0000000..19d0e2d
--- /dev/null
@@ -0,0 +1,48 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_STRING_H
+#define IOTJS_STRING_H
+
+
+typedef struct {
+  size_t size;
+  char* data;
+} IOTJS_VALIDATED_STRUCT(iotjs_string_t);
+
+// Create new string
+iotjs_string_t iotjs_string_create();
+iotjs_string_t iotjs_string_create_with_size(const char* data, size_t size);
+iotjs_string_t iotjs_string_create_with_buffer(char* buffer, size_t size);
+
+// Destroy string
+void iotjs_string_destroy(iotjs_string_t* str);
+
+// Check if string is empty
+bool iotjs_string_is_empty(const iotjs_string_t* str);
+
+// Make string empty
+void iotjs_string_make_empty(iotjs_string_t* str);
+
+// Append `data` to tail of the string.
+void iotjs_string_append(iotjs_string_t* str, const char* data, size_t size);
+
+// Returns pointer to the bytes (never returns NULL)
+const char* iotjs_string_data(const iotjs_string_t* str);
+
+unsigned iotjs_string_size(const iotjs_string_t* str);
+
+
+#endif /* IOTJS_STRING_H */
diff --git a/src/iotjs_string_ext.c b/src/iotjs_string_ext.c
new file mode 100644 (file)
index 0000000..9cadefb
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "iotjs_def.h"
+
+//
+// strings in iotjs built-in scripts
+//
+#include "iotjs_string_ext.inl.h"
+
+//
+// declare string items
+//
+#define MAGICSTR_EX_DEF(NAME, STRING) \
+  static const char jerry_magic_string_ex_##NAME[] = STRING;
+
+JERRY_MAGIC_STRING_ITEMS
+
+#undef MAGICSTR_EX_DEF
+
+
+//
+// declare strings length array
+//
+static const jerry_length_t magic_string_lengths[] = {
+#define MAGICSTR_EX_DEF(NAME, STRING) \
+  (jerry_length_t)(sizeof(jerry_magic_string_ex_##NAME) - 1u),
+
+  JERRY_MAGIC_STRING_ITEMS
+
+#undef MAGICSTR_EX_DEF
+};
+
+
+//
+// declare strings table
+//
+static const jerry_char_ptr_t magic_string_items[] = {
+#define MAGICSTR_EX_DEF(NAME, STRING) \
+  (const jerry_char_ptr_t) jerry_magic_string_ex_##NAME,
+
+  JERRY_MAGIC_STRING_ITEMS
+
+#undef MAGICSTR_EX_DEF
+};
+
+
+void iotjs_register_jerry_magic_string(void) {
+  uint32_t num_magic_string_items =
+      (uint32_t)(sizeof(magic_string_items) / sizeof(jerry_char_ptr_t));
+  jerry_register_magic_strings(magic_string_items, num_magic_string_items,
+                               magic_string_lengths);
+}
diff --git a/src/iotjs_string_ext.h b/src/iotjs_string_ext.h
new file mode 100644 (file)
index 0000000..f5d129b
--- /dev/null
@@ -0,0 +1,23 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_STRING_EXT_H
+#define IOTJS_STRING_EXT_H
+
+
+void iotjs_register_jerry_magic_string(void);
+
+
+#endif /* IOTJS_STRING_EXT_H */
diff --git a/src/iotjs_util.c b/src/iotjs_util.c
new file mode 100644 (file)
index 0000000..598d864
--- /dev/null
@@ -0,0 +1,120 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "iotjs_def.h"
+#include "iotjs_util.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(__linux__)
+#include <execinfo.h>
+#endif
+
+iotjs_string_t iotjs_file_read(const char* path) {
+  FILE* file = fopen(path, "rb");
+  IOTJS_ASSERT(file != NULL);
+
+  fseek(file, 0, SEEK_END);
+  long ftell_ret = ftell(file);
+  IOTJS_ASSERT(ftell_ret >= 0);
+  size_t len = (size_t)ftell_ret;
+  fseek(file, 0, SEEK_SET);
+
+  char* buffer = iotjs_buffer_allocate(len + 1);
+
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+  char* ptr = buffer;
+  unsigned nread = 0;
+  unsigned read = 0;
+
+  while ((nread = fread(ptr, 1, IOTJS_MAX_READ_BUFFER_SIZE, file)) > 0) {
+    read += nread;
+    ptr = buffer + read;
+  }
+#else
+  size_t read = fread(buffer, 1, len, file);
+#endif
+  IOTJS_ASSERT(read == len);
+
+  *(buffer + len) = 0;
+
+  fclose(file);
+
+  iotjs_string_t contents = iotjs_string_create_with_buffer(buffer, len);
+
+  return contents;
+}
+
+
+char* iotjs_buffer_allocate(size_t size) {
+  char* buffer = (char*)(calloc(size, sizeof(char)));
+  IOTJS_ASSERT(buffer != NULL);
+  return buffer;
+}
+
+
+char* iotjs_buffer_reallocate(char* buffer, size_t size) {
+  IOTJS_ASSERT(buffer != NULL);
+  return (char*)(realloc(buffer, size));
+}
+
+
+void iotjs_buffer_release(char* buffer) {
+  IOTJS_ASSERT(buffer != NULL);
+  free(buffer);
+}
+
+void print_stacktrace() {
+#if defined(__linux__) && defined(DEBUG)
+  // TODO: support other platforms
+  const int numOfStackTrace = 100;
+  void* buffer[numOfStackTrace];
+  char command[256];
+
+  int nptrs = backtrace(buffer, numOfStackTrace);
+  char** strings = backtrace_symbols(buffer, nptrs);
+
+  if (strings == NULL) {
+    perror("backtrace_symbols");
+    exit(EXIT_FAILURE);
+  }
+
+  printf("\n[Backtrace]:\n");
+  for (int j = 0; j < nptrs - 2; j++) { // remove the last two
+    int idx = 0;
+    while (strings[j][idx] != '\0') {
+      if (strings[j][idx] == '(') {
+        break;
+      }
+      idx++;
+    }
+    snprintf(command, sizeof(command), "addr2line %p -e %.*s", buffer[j], idx,
+             strings[j]);
+
+    if (system(command)) {
+      break;
+    }
+  }
+
+  free(strings);
+#endif // defined(__linux__) && defined(DEBUG)
+}
+
+void force_terminate() {
+  exit(EXIT_FAILURE);
+}
diff --git a/src/iotjs_util.h b/src/iotjs_util.h
new file mode 100644 (file)
index 0000000..e7e1896
--- /dev/null
@@ -0,0 +1,37 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_UTIL_H
+#define IOTJS_UTIL_H
+
+
+#include "iotjs_string.h"
+
+
+// Return value should be released with iotjs_string_destroy()
+iotjs_string_t iotjs_file_read(const char* path);
+
+char* iotjs_buffer_allocate(size_t size);
+char* iotjs_buffer_reallocate(char* buffer, size_t size);
+void iotjs_buffer_release(char* buff);
+
+#define IOTJS_ALLOC(type) /* Allocate (type)-sized, (type*)-typed memory */ \
+  (type*)iotjs_buffer_allocate(sizeof(type))
+
+#define IOTJS_RELEASE(ptr) /* Release memory allocated by IOTJS_ALLOC() */ \
+  iotjs_buffer_release((char*)ptr)
+
+
+#endif /* IOTJS_UTIL_H */
diff --git a/src/js/adc.js b/src/js/adc.js
new file mode 100644 (file)
index 0000000..fbde401
--- /dev/null
@@ -0,0 +1,114 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+var adc = process.binding(process.binding.adc);
+
+
+function Adc() {
+  if (!(this instanceof Adc)) {
+    return new Adc();
+  }
+}
+
+Adc.prototype.open = function(configuration, callback) {
+  return adcPinOpen(configuration, callback);
+};
+
+
+function adcPinOpen(configuration, callback) {
+  var _binding = null;
+
+  function AdcPin(configuration, callback) {
+    var self = this;
+
+    if (util.isObject(configuration)) {
+      if (process.platform === 'linux') {
+        if (!util.isString(configuration.device)) {
+          throw new TypeError(
+            'Bad configuration - device is mandatory and should be String');
+        }
+      } else if (process.platform === 'nuttx') {
+        if (!util.isNumber(configuration.pin)) {
+          throw new TypeError(
+            'Bad configuration - pin is mandatory and should be Number');
+        }
+      }
+    } else {
+      throw new TypeError('Bad arguments - configuration should be Object')
+    }
+
+    _binding = new adc.Adc(configuration, function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+
+    process.on('exit', (function(self) {
+      return function() {
+        if (!util.isNull(_binding)) {
+          self.closeSync();
+        }
+      };
+    })(this));
+  }
+
+  AdcPin.prototype.read = function(callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('ADC pin is not opened');
+    }
+
+    _binding.read(function(err, value) {
+      util.isFunction(callback) && callback.call(self, err, value);
+    });
+  };
+
+  AdcPin.prototype.readSync = function() {
+    if (util.isNull(_binding)) {
+      throw new Error('ADC pin is not opened');
+    }
+
+    return _binding.read();
+  };
+
+  AdcPin.prototype.close = function(callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('ADC pin is not opened');
+    }
+
+    _binding.close(function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+
+    _binding = null;
+  };
+
+  AdcPin.prototype.closeSync = function() {
+    if (util.isNull(_binding)) {
+      throw new Error('ADC pin is not opened');
+    }
+
+    _binding.close();
+
+    _binding = null;
+  };
+
+  return new AdcPin(configuration, callback);
+}
+
+
+module.exports = Adc;
diff --git a/src/js/assert.js b/src/js/assert.js
new file mode 100644 (file)
index 0000000..639642a
--- /dev/null
@@ -0,0 +1,153 @@
+// Originally from narwhal.js (http://narwhaljs.org)
+// Copyright (c) 2009 Thomas Robinson <280north.com>
+// Copyright (c) 2015 Samsung Electronics Co., Ltd.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the 'Software'), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+
+
+function AssertionError(options) {
+  this.name = 'AssertionError';
+  this.actual = options.actual;
+  this.expected = options.expected;
+  this.operator = options.operator;
+  if (options.message) {
+    this.message = options.message;
+  } else {
+    this.message = getMessage(this);
+  }
+}
+
+util.inherits(AssertionError, Error);
+
+
+function getMessage(assertion) {
+  return JSON.stringify(assertion, ['actual', 'expected', 'operator']);
+}
+
+
+function assert(value, message) {
+  if (!value) {
+    fail(value, true, message, '==');
+  }
+}
+
+
+function fail(actual, expected, message, operator) {
+  throw new AssertionError({
+    message: message,
+    actual: actual,
+    expected: expected,
+    operator: operator
+  });
+}
+
+
+function equal(actual, expected, message) {
+  if (actual != expected) {
+    fail(actual, expected, message, '==');
+  }
+}
+
+
+function notEqual(actual, expected, message) {
+  if (actual == expected) {
+    fail(actual, expected, message, '!=');
+  }
+}
+
+
+function strictEqual(actual, expected, message) {
+  if (actual !== expected) {
+    fail(actual, expected, message, '===');
+  }
+}
+
+
+function notStrictEqual(actual, expected, message) {
+  if (actual === expected) {
+    fail(actual, expected, message, '!==');
+  }
+}
+
+
+function throws(block, expected, message) {
+  var actual;
+
+  try {
+    block();
+  } catch (e) {
+    actual = e;
+  }
+
+  message = (expected && expected.name ? '(' + expected.name + ').' : '.') +
+            (message ? ' ' + message : '.');
+
+  if (!actual) {
+    fail(actual, expected, 'Missing expected exception' + message);
+  }
+  if (expected && !(actual instanceof expected)) {
+    throw actual;
+  }
+}
+
+
+function doesNotThrow(block, message) {
+  var actual;
+
+  try {
+    block();
+  } catch (e) {
+    actual = e;
+  }
+
+  message = (message ? ' ' + message : '');
+
+  if (actual) {
+    fail(actual, null, 'Got unwanted exception.' + message);
+  }
+}
+
+
+assert.AssertionError = AssertionError;
+assert.assert = assert;
+assert.fail = fail;
+assert.equal = equal;
+assert.notEqual = notEqual;
+assert.strictEqual = strictEqual;
+assert.notStrictEqual = notStrictEqual;
+assert.throws = throws;
+assert.doesNotThrow = doesNotThrow;
+
+module.exports = assert;
diff --git a/src/js/ble.js b/src/js/ble.js
new file mode 100644 (file)
index 0000000..f928004
--- /dev/null
@@ -0,0 +1,268 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var debug = console.log; // require('debug')('ble');
+
+var events = require('events');
+var util = require('util');
+
+var UuidUtil = require('ble_uuid_util');
+
+var PrimaryService = require('ble_primary_service');
+var Characteristic = require('ble_characteristic');
+var Descriptor = require('ble_descriptor');
+
+var bindings = null;
+
+var platform = process.platform;
+
+if (platform === 'darwin') {
+  // bindings = require('./mac/bindings');
+} else if (platform === 'linux' || platform === 'win32' || platform === 'android') {
+  bindings = require('ble_hci_socket_bindings');
+} else {
+  throw new Error('Unsupported platform');
+}
+
+function Bleno() {
+  this.platform = 'unknown';
+  this.state = 'unknown';
+  this.address = 'unknown';
+  this.rssi = 0;
+  this.mtu = 20;
+
+  this._bindings = bindings;
+
+  this._bindings.on('stateChange', this.onStateChange.bind(this));
+  this._bindings.on('platform', this.onPlatform.bind(this));
+  this._bindings.on('addressChange', this.onAddressChange.bind(this));
+  this._bindings.on('advertisingStart', this.onAdvertisingStart.bind(this));
+  this._bindings.on('advertisingStop', this.onAdvertisingStop.bind(this));
+  this._bindings.on('servicesSet', this.onServicesSet.bind(this));
+  this._bindings.on('accept', this.onAccept.bind(this));
+  this._bindings.on('mtuChange', this.onMtuChange.bind(this));
+  this._bindings.on('disconnect', this.onDisconnect.bind(this));
+
+  this._bindings.on('rssiUpdate', this.onRssiUpdate.bind(this));
+
+  this._bindings.init();
+}
+
+util.inherits(Bleno, events.EventEmitter);
+
+Bleno.prototype.PrimaryService = PrimaryService;
+Bleno.prototype.Characteristic = Characteristic;
+Bleno.prototype.Descriptor = Descriptor;
+
+Bleno.prototype.onPlatform = function(platform) {
+  debug('platform ' + platform);
+
+  this.platform = platform;
+};
+
+Bleno.prototype.onStateChange = function(state) {
+  debug('stateChange ' + state);
+
+  this.state = state;
+
+  this.emit('stateChange', state);
+};
+
+Bleno.prototype.onAddressChange = function(address) {
+  debug('addressChange ' + address);
+
+  this.address = address;
+};
+
+Bleno.prototype.onAccept = function(clientAddress) {
+  debug('accept ' + clientAddress);
+  this.emit('accept', clientAddress);
+};
+
+Bleno.prototype.onMtuChange = function(mtu) {
+  debug('mtu ' + mtu);
+
+  this.mtu = mtu;
+
+  this.emit('mtuChange', mtu);
+};
+
+Bleno.prototype.onDisconnect = function(clientAddress) {
+  debug('disconnect' + clientAddress);
+  this.emit('disconnect', clientAddress);
+};
+
+Bleno.prototype.startAdvertising = function(name, serviceUuids, callback) {
+  if (this.state !== 'poweredOn') {
+    var error = new Error('Could not start advertising, state is ' + this.state + ' (not poweredOn)');
+
+    if (typeof callback === 'function') {
+      callback(error);
+    } else {
+      throw error;
+    }
+  } else {
+    if (callback) {
+      this.once('advertisingStart', callback);
+    }
+
+    var undashedServiceUuids = [];
+
+    if (serviceUuids && serviceUuids.length) {
+      for (var i = 0; i < serviceUuids.length; i++) {
+        undashedServiceUuids[i] = UuidUtil.removeDashes(serviceUuids[i]);
+      }
+    }
+
+    this._bindings.startAdvertising(name, undashedServiceUuids);
+  }
+};
+
+Bleno.prototype.startAdvertisingIBeacon = function(uuid, major, minor, measuredPower, callback) {
+  if (this.state !== 'poweredOn') {
+    var error = new Error('Could not start advertising, state is ' + this.state + ' (not poweredOn)');
+
+    if (typeof callback === 'function') {
+      callback(error);
+    } else {
+      throw error;
+    }
+  } else {
+    var undashedUuid =  UuidUtil.removeDashes(uuid);
+    var uuidData = new Buffer(undashedUuid, 'hex');
+    var uuidDataLength = uuidData.length;
+    var iBeaconData = new Buffer(uuidData.length + 5);
+
+    for (var i = 0; i < uuidDataLength; i++) {
+      iBeaconData[i] = uuidData[i];
+    }
+
+    iBeaconData.writeUInt16BE(major, uuidDataLength);
+    iBeaconData.writeUInt16BE(minor, uuidDataLength + 2);
+    iBeaconData.writeInt8(measuredPower, uuidDataLength + 4);
+
+    if (callback) {
+      this.once('advertisingStart', callback);
+    }
+
+    debug('iBeacon data = ' + iBeaconData.toString('hex'));
+
+    this._bindings.startAdvertisingIBeacon(iBeaconData);
+  }
+};
+
+Bleno.prototype.onAdvertisingStart = function(error) {
+  debug('advertisingStart: ' + error);
+
+  if (error) {
+    this.emit('advertisingStartError', error);
+  }
+
+  this.emit('advertisingStart', error);
+};
+
+Bleno.prototype.startAdvertisingWithEIRData = function(advertisementData, scanData, callback) {
+  if (typeof scanData === 'function') {
+    callback = scanData;
+    scanData = null;
+  }
+
+  if (this.state !== 'poweredOn') {
+    var error = new Error('Could not advertising scanning, state is ' + this.state + ' (not poweredOn)');
+
+    if (typeof callback === 'function') {
+      callback(error);
+    } else {
+      throw error;
+    }
+  } else {
+    if (callback) {
+      this.once('advertisingStart', callback);
+    }
+
+    this._bindings.startAdvertisingWithEIRData(advertisementData, scanData);
+  }
+};
+
+Bleno.prototype.stopAdvertising = function(callback) {
+  if (callback) {
+    this.once('advertisingStop', callback);
+  }
+  this._bindings.stopAdvertising();
+};
+
+Bleno.prototype.onAdvertisingStop = function() {
+  debug('advertisingStop');
+  this.emit('advertisingStop');
+};
+
+Bleno.prototype.setServices = function(services, callback) {
+  if (callback) {
+    this.once('servicesSet', callback);
+  }
+  this._bindings.setServices(services);
+};
+
+Bleno.prototype.onServicesSet = function(error) {
+  debug('servicesSet');
+
+  if (error) {
+    this.emit('servicesSetError', error);
+  }
+
+  this.emit('servicesSet', error);
+};
+
+Bleno.prototype.disconnect = function() {
+  debug('disconnect');
+  this._bindings.disconnect();
+};
+
+Bleno.prototype.updateRssi = function(callback) {
+  if (callback) {
+    this.once('rssiUpdate', function(rssi) {
+      callback(null, rssi);
+    });
+  }
+
+  this._bindings.updateRssi();
+};
+
+Bleno.prototype.onRssiUpdate = function(rssi) {
+  this.emit('rssiUpdate', rssi);
+};
+
+module.exports = new Bleno();
diff --git a/src/js/ble_characteristic.js b/src/js/ble_characteristic.js
new file mode 100644 (file)
index 0000000..d21a367
--- /dev/null
@@ -0,0 +1,129 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var events = require('events');
+var util = require('util');
+
+var debug = console.log; // require('debug')('ble_characteristic');
+
+var UuidUtil = require('ble_uuid_util');
+
+function Characteristic(options) {
+  this.uuid = UuidUtil.removeDashes(options.uuid);
+  this.properties = options.properties || [];
+  this.secure = options.secure || [];
+  this.value = options.value || null;
+  this.descriptors = options.descriptors || [];
+
+  if (this.value && (this.properties.length !== 1 || this.properties[0] !== 'read')) {
+    throw new Error('Characteristics with value can be read only!');
+  }
+
+  if (options.onReadRequest) {
+    this.onReadRequest = options.onReadRequest;
+  }
+
+  if (options.onWriteRequest) {
+    this.onWriteRequest = options.onWriteRequest;
+  }
+
+  if (options.onSubscribe) {
+    this.onSubscribe = options.onSubscribe;
+  }
+
+  if (options.onUnsubscribe) {
+    this.onUnsubscribe = options.onUnsubscribe;
+  }
+
+  if (options.onNotify) {
+    this.onNotify = options.onNotify;
+  }
+
+  if (options.onIndicate) {
+    this.onIndicate = options.onIndicate;
+  }
+
+  this.on('readRequest', this.onReadRequest.bind(this));
+  this.on('writeRequest', this.onWriteRequest.bind(this));
+  this.on('subscribe', this.onSubscribe.bind(this));
+  this.on('unsubscribe', this.onUnsubscribe.bind(this));
+  this.on('notify', this.onNotify.bind(this));
+  this.on('indicate', this.onIndicate.bind(this));
+}
+
+util.inherits(Characteristic, events.EventEmitter);
+
+Characteristic.RESULT_SUCCESS                  = Characteristic.prototype.RESULT_SUCCESS                  = 0x00;
+Characteristic.RESULT_INVALID_OFFSET           = Characteristic.prototype.RESULT_INVALID_OFFSET           = 0x07;
+Characteristic.RESULT_ATTR_NOT_LONG            = Characteristic.prototype.RESULT_ATTR_NOT_LONG            = 0x0b;
+Characteristic.RESULT_INVALID_ATTRIBUTE_LENGTH = Characteristic.prototype.RESULT_INVALID_ATTRIBUTE_LENGTH = 0x0d;
+Characteristic.RESULT_UNLIKELY_ERROR           = Characteristic.prototype.RESULT_UNLIKELY_ERROR           = 0x0e;
+
+Characteristic.prototype.toString = function() {
+  return JSON.stringify({
+    uuid: this.uuid,
+    properties: this.properties,
+    secure: this.secure,
+    value: this.value,
+    descriptors: this.descriptors
+  });
+};
+
+Characteristic.prototype.onReadRequest = function(offset, callback) {
+  callback(this.RESULT_UNLIKELY_ERROR, null);
+};
+
+Characteristic.prototype.onWriteRequest = function(data, offset, withoutResponse, callback) {
+  callback(this.RESULT_UNLIKELY_ERROR);
+};
+
+Characteristic.prototype.onSubscribe = function(maxValueSize, updateValueCallback) {
+  this.maxValueSize = maxValueSize;
+  this.updateValueCallback = updateValueCallback;
+};
+
+Characteristic.prototype.onUnsubscribe = function() {
+  this.maxValueSize = null;
+  this.updateValueCallback = null;
+};
+
+Characteristic.prototype.onNotify = function() {
+};
+
+Characteristic.prototype.onIndicate = function() {
+};
+
+module.exports = Characteristic;
diff --git a/src/js/ble_descriptor.js b/src/js/ble_descriptor.js
new file mode 100644 (file)
index 0000000..660756f
--- /dev/null
@@ -0,0 +1,53 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var debug = console.log; // require('debug')('descriptor');
+
+var UuidUtil = require('ble_uuid_util');
+
+function Descriptor(options) {
+  this.uuid = UuidUtil.removeDashes(options.uuid);
+  this.value = options.value || new Buffer(0);
+}
+
+Descriptor.prototype.toString = function() {
+  return JSON.stringify({
+    uuid: this.uuid,
+    value: Buffer.isBuffer(this.value) ? this.value.toString('hex') : this.value
+  });
+};
+
+module.exports = Descriptor;
diff --git a/src/js/ble_hci_socket.js b/src/js/ble_hci_socket.js
new file mode 100644 (file)
index 0000000..944ff7c
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var events = require('events');
+
+var BluetoothHciSocket= process.binding(process.binding.blehcisocket);
+
+inherits(BluetoothHciSocket, events.EventEmitter);
+
+// extend prototype
+function inherits(target, source) {
+  for (var k in source.prototype) {
+    target.prototype[k] = source.prototype[k];
+  }
+}
+
+module.exports = BluetoothHciSocket;
diff --git a/src/js/ble_hci_socket_acl_stream.js b/src/js/ble_hci_socket_acl_stream.js
new file mode 100644 (file)
index 0000000..1f0d812
--- /dev/null
@@ -0,0 +1,78 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var debug = console.log; // require('debug')('acl-att-stream');
+
+var events = require('events');
+var util = require('util');
+
+var crypto = require('ble_hci_socket_crypto');
+var Smp = require('ble_hci_socket_smp');
+
+var AclStream = function(hci, handle, localAddressType, localAddress, remoteAddressType, remoteAddress) {
+  this._hci = hci;
+  this._handle = handle;
+  this.encypted = false;
+
+  this._smp = new Smp(this, localAddressType, localAddress, remoteAddressType, remoteAddress);
+};
+
+util.inherits(AclStream, events.EventEmitter);
+
+
+AclStream.prototype.write = function(cid, data) {
+  this._hci.writeAclDataPkt(this._handle, cid, data);
+};
+
+AclStream.prototype.push = function(cid, data) {
+  if (data) {
+    this.emit('data', cid, data);
+  } else {
+    this.emit('end');
+  }
+};
+
+AclStream.prototype.pushEncrypt = function(encrypt) {
+  this.encrypted = encrypt ? true : false;
+
+  this.emit('encryptChange', this.encrypted);
+};
+
+AclStream.prototype.pushLtkNegReply = function() {
+  this.emit('ltkNegReply');
+};
+
+module.exports = AclStream;
diff --git a/src/js/ble_hci_socket_bindings.js b/src/js/ble_hci_socket_bindings.js
new file mode 100644 (file)
index 0000000..c2728f9
--- /dev/null
@@ -0,0 +1,253 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var debug = console.log; // require('debug')('ble_hci-socket_bindings');
+
+var events = require('events');
+var util = require('util');
+
+var AclStream = require('ble_hci_socket_acl_stream');
+var Hci = require('ble_hci_socket_hci');
+var Gap = require('ble_hci_socket_gap');
+var Gatt = require('ble_hci_socket_gatt');
+
+var BlenoBindings = function() {
+  this._state = null;
+
+  this._advertising = false;
+
+  this._hci = new Hci();
+  this._gap = new Gap(this._hci);
+  this._gatt = new Gatt(this._hci);
+
+  this._address = null;
+  this._handle = null;
+  this._aclStream = null;
+};
+
+util.inherits(BlenoBindings, events.EventEmitter);
+
+BlenoBindings.prototype.startAdvertising = function(name, serviceUuids) {
+  this._advertising = true;
+
+  this._gap.startAdvertising(name, serviceUuids);
+};
+
+BlenoBindings.prototype.startAdvertisingIBeacon = function(data) {
+  this._advertising = true;
+
+  this._gap.startAdvertisingIBeacon(data);
+};
+
+BlenoBindings.prototype.startAdvertisingWithEIRData = function(advertisementData, scanData) {
+  this._advertising = true;
+
+  this._gap.startAdvertisingWithEIRData(advertisementData, scanData);
+};
+
+BlenoBindings.prototype.stopAdvertising = function() {
+  this._advertising = false;
+
+  this._gap.stopAdvertising();
+};
+
+BlenoBindings.prototype.setServices = function(services) {
+  this._gatt.setServices(services);
+
+  this.emit('servicesSet');
+};
+
+BlenoBindings.prototype.disconnect = function() {
+  if (this._handle) {
+    debug('disconnect by server');
+
+    this._hci.disconnect(this._handle);
+  }
+};
+
+BlenoBindings.prototype.updateRssi = function() {
+  if (this._handle) {
+    this._hci.readRssi(this._handle);
+  }
+};
+
+BlenoBindings.prototype.init = function() {
+  this.onSigIntBinded = this.onSigInt.bind(this);
+
+  process.on('SIGINT', this.onSigIntBinded);
+  process.on('exit', this.onExit.bind(this));
+
+  this._gap.on('advertisingStart', this.onAdvertisingStart.bind(this));
+  this._gap.on('advertisingStop', this.onAdvertisingStop.bind(this));
+
+  this._gatt.on('mtuChange', this.onMtuChange.bind(this));
+
+  this._hci.on('stateChange', this.onStateChange.bind(this));
+  this._hci.on('addressChange', this.onAddressChange.bind(this));
+  this._hci.on('readLocalVersion', this.onReadLocalVersion.bind(this));
+
+  this._hci.on('leConnComplete', this.onLeConnComplete.bind(this));
+  this._hci.on('leConnUpdateComplete', this.onLeConnUpdateComplete.bind(this));
+  this._hci.on('rssiRead', this.onRssiRead.bind(this));
+  this._hci.on('disconnComplete', this.onDisconnComplete.bind(this));
+  this._hci.on('encryptChange', this.onEncryptChange.bind(this));
+  this._hci.on('leLtkNegReply', this.onLeLtkNegReply.bind(this));
+  this._hci.on('aclDataPkt', this.onAclDataPkt.bind(this));
+
+  this.emit('platform', process.platform);
+
+  this._hci.init();
+};
+
+BlenoBindings.prototype.onStateChange = function(state) {
+  if (this._state === state) {
+    return;
+  }
+  this._state = state;
+
+  if (state === 'unauthorized') {
+    console.log('bleno warning: adapter state unauthorized, please run as root or with sudo');
+    console.log('               or see README for information on running without root/sudo:');
+    console.log('               https://github.com/sandeepmistry/bleno#running-on-linux');
+  } else if (state === 'unsupported') {
+    console.log('bleno warning: adapter does not support Bluetooth Low Energy (BLE, Bluetooth Smart).');
+    console.log('               Try to run with environment variable:');
+    console.log('               [sudo] BLENO_HCI_DEVICE_ID=x node ...');
+  }
+
+  this.emit('stateChange', state);
+};
+
+BlenoBindings.prototype.onAddressChange = function(address) {
+  this.emit('addressChange', address);
+};
+
+BlenoBindings.prototype.onReadLocalVersion = function(hciVer, hciRev, lmpVer, manufacturer, lmpSubVer) {
+  if (manufacturer === 93) {
+    // Realtek Semiconductor Corporation
+    this._gatt.maxMtu = 23;
+  }
+};
+
+BlenoBindings.prototype.onAdvertisingStart = function(error) {
+  this.emit('advertisingStart', error);
+};
+
+BlenoBindings.prototype.onAdvertisingStop = function() {
+  this.emit('advertisingStop');
+};
+
+BlenoBindings.prototype.onLeConnComplete = function(status, handle, role, addressType, address, interval, latency, supervisionTimeout, masterClockAccuracy) {
+  if (role !== 1) {
+    // not slave, ignore
+    return;
+  }
+
+  this._address = address;
+  this._handle = handle;
+  this._aclStream = new AclStream(this._hci, handle, this._hci.addressType, this._hci.address, addressType, address);
+  this._gatt.setAclStream(this._aclStream);
+
+  this.emit('accept', address);
+};
+
+BlenoBindings.prototype.onLeConnUpdateComplete = function(handle, interval, latency, supervisionTimeout) {
+  // no-op
+};
+
+BlenoBindings.prototype.onDisconnComplete = function(handle, reason) {
+  if (this._aclStream) {
+    this._aclStream.push(null, null);
+  }
+
+  var address = this._address;
+
+  this._address = null;
+  this._handle = null;
+  this._aclStream = null;
+
+  if (address) {
+    this.emit('disconnect', address); // TODO: use reason
+  }
+
+  if (this._advertising) {
+    this._gap.restartAdvertising();
+  }
+};
+
+BlenoBindings.prototype.onEncryptChange = function(handle, encrypt) {
+  if (this._handle === handle && this._aclStream) {
+    this._aclStream.pushEncrypt(encrypt);
+  }
+};
+
+BlenoBindings.prototype.onLeLtkNegReply = function(handle) {
+  if (this._handle === handle && this._aclStream) {
+    this._aclStream.pushLtkNegReply();
+  }
+};
+
+BlenoBindings.prototype.onMtuChange = function(mtu) {
+  this.emit('mtuChange', mtu);
+};
+
+BlenoBindings.prototype.onRssiRead = function(handle, rssi) {
+  this.emit('rssiUpdate', rssi);
+};
+
+BlenoBindings.prototype.onAclDataPkt = function(handle, cid, data) {
+  if (this._handle === handle && this._aclStream) {
+    this._aclStream.push(cid, data);
+  }
+};
+
+BlenoBindings.prototype.onSigInt = function() {
+  var sigIntListeners = process.listeners('SIGINT');
+
+  if (sigIntListeners[sigIntListeners.length - 1] === this.onSigIntBinded) {
+    // we are the last listener, so exit
+    // this will trigger onExit, and clean up
+    process.exit(1);
+  }
+};
+
+BlenoBindings.prototype.onExit = function() {
+  this._gap.stopAdvertising();
+
+  this.disconnect();
+};
+
+module.exports = new BlenoBindings();
diff --git a/src/js/ble_hci_socket_crypto.js b/src/js/ble_hci_socket_crypto.js
new file mode 100644 (file)
index 0000000..28e715c
--- /dev/null
@@ -0,0 +1,112 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var crypto = require('ble_hci_socket_crypto');
+
+function r() {
+  return crypto.randomBytes(16);
+}
+
+function c1(k, r, pres, preq, iat, ia, rat, ra) {
+  var p1 = Buffer.concat([
+    iat,
+    rat,
+    preq,
+    pres
+  ]);
+
+  var p2 = Buffer.concat([
+    ra,
+    ia,
+    new Buffer('00000000', 'hex')
+  ]);
+
+  var res = xor(r, p1);
+  res = e(k, res);
+  res = xor(res, p2);
+  res = e(k, res);
+
+  return res;
+}
+
+function s1(k, r1, r2) {
+  return e(k, Buffer.concat([
+    r2.slice(0, 8),
+    r1.slice(0, 8)
+  ]));
+}
+
+function e(key, data) {
+  key = swap(key);
+  data = swap(data);
+
+  var cipher = crypto.createCipheriv('aes-128-ecb', key, '');
+  cipher.setAutoPadding(false);
+
+  return swap(Buffer.concat([
+    cipher.update(data),
+    cipher.final()
+  ]));
+}
+
+function xor(b1, b2) {
+  var result = new Buffer(b1.length);
+
+  for (var i = 0; i < b1.length; i++) {
+    //result[i] = b1[i] ^ b2[i];
+    result.writeUInt8(b1.readUInt8(i) ^ b2.readUInt8(i), i);
+  }
+
+  return result;
+}
+
+function swap(input) {
+  var output = new Buffer(input.length);
+
+  for (var i = 0; i < output.length; i++) {
+    //output[i] = input[input.length - i - 1];
+    output.writeUInt8(input.readUInt8(input.length - i - 1), i);
+  }
+
+  return output;
+}
+
+module.exports = {
+  r: r,
+  c1: c1,
+  s1: s1,
+  e: e
+};
diff --git a/src/js/ble_hci_socket_gap.js b/src/js/ble_hci_socket_gap.js
new file mode 100644 (file)
index 0000000..4e766e0
--- /dev/null
@@ -0,0 +1,247 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var debug = console.log; // require('debug')('gap');
+
+var events = require('events');
+var util = require('util');
+
+var Hci = require('ble_hci_socket_hci');
+
+var isLinux = (process.platform === 'linux');
+var isIntelEdison = false; // isLinux && (os.release().indexOf('edison') !== -1);
+var isYocto = false; //TODO isLinux && (os.release().indexOf('yocto') !== -1);
+
+function Gap(hci) {
+  this._hci = hci;
+
+  this._advertiseState = null;
+
+  this._hci.on('error', this.onHciError.bind(this));
+
+  this._hci.on('leAdvertisingParametersSet', this.onHciLeAdvertisingParametersSet.bind(this));
+  this._hci.on('leAdvertisingDataSet', this.onHciLeAdvertisingDataSet.bind(this));
+  this._hci.on('leScanResponseDataSet', this.onHciLeScanResponseDataSet.bind(this));
+  this._hci.on('leAdvertiseEnableSet', this.onHciLeAdvertiseEnableSet.bind(this));
+}
+
+util.inherits(Gap, events.EventEmitter);
+
+Gap.prototype.startAdvertising = function(name, serviceUuids) {
+  debug('startAdvertising: name = ' + name + ', serviceUuids = ' + JSON.stringify(serviceUuids, null, 2));
+
+  var advertisementDataLength = 3;
+  var scanDataLength = 0;
+
+  var serviceUuids16bit = [];
+  var serviceUuids128bit = [];
+  var i = 0;
+
+  if (name && name.length) {
+    scanDataLength += 2 + name.length;
+  }
+
+  if (serviceUuids && serviceUuids.length) {
+    for (i = 0; i < serviceUuids.length; i++) {
+      var serviceUuid = new Buffer(serviceUuids[i].match(/.{1,2}/g).reverse().join(''), 'hex');
+
+      if (serviceUuid.length === 2) {
+        serviceUuids16bit.push(serviceUuid);
+      } else if (serviceUuid.length === 16) {
+        serviceUuids128bit.push(serviceUuid);
+      }
+    }
+  }
+
+  if (serviceUuids16bit.length) {
+    advertisementDataLength += 2 + 2 * serviceUuids16bit.length;
+  }
+
+  if (serviceUuids128bit.length) {
+    advertisementDataLength += 2 + 16 * serviceUuids128bit.length;
+  }
+
+  var advertisementData = new Buffer(advertisementDataLength);
+  var scanData = new Buffer(scanDataLength);
+
+  // flags
+  advertisementData.writeUInt8(2, 0);
+  advertisementData.writeUInt8(0x01, 1);
+  advertisementData.writeUInt8(0x06, 2);
+
+  var advertisementDataOffset = 3;
+
+  if (serviceUuids16bit.length) {
+    advertisementData.writeUInt8(1 + 2 * serviceUuids16bit.length, advertisementDataOffset);
+    advertisementDataOffset++;
+
+    advertisementData.writeUInt8(0x03, advertisementDataOffset);
+    advertisementDataOffset++;
+
+    for (i = 0; i < serviceUuids16bit.length; i++) {
+      serviceUuids16bit[i].copy(advertisementData, advertisementDataOffset);
+      advertisementDataOffset += serviceUuids16bit[i].length;
+    }
+  }
+
+  if (serviceUuids128bit.length) {
+    advertisementData.writeUInt8(1 + 16 * serviceUuids128bit.length, advertisementDataOffset);
+    advertisementDataOffset++;
+
+    advertisementData.writeUInt8(0x06, advertisementDataOffset);
+    advertisementDataOffset++;
+
+    for (i = 0; i < serviceUuids128bit.length; i++) {
+      serviceUuids128bit[i].copy(advertisementData, advertisementDataOffset);
+      advertisementDataOffset += serviceUuids128bit[i].length;
+    }
+  }
+
+  // name
+  if (name && name.length) {
+    var nameBuffer = new Buffer(name);
+
+    scanData.writeUInt8(1 + nameBuffer.length, 0);
+    scanData.writeUInt8(0x08, 1);
+    nameBuffer.copy(scanData, 2);
+  }
+
+  this.startAdvertisingWithEIRData(advertisementData, scanData);
+};
+
+
+Gap.prototype.startAdvertisingIBeacon = function(data) {
+  debug('startAdvertisingIBeacon: data = ' + data.toString('hex'));
+
+  var dataLength = data.length;
+  var manufacturerDataLength = 4 + dataLength;
+  var advertisementDataLength = 5 + manufacturerDataLength;
+  var scanDataLength = 0;
+
+  var advertisementData = new Buffer(advertisementDataLength);
+  var scanData = new Buffer(0);
+
+  // flags
+  advertisementData.writeUInt8(2, 0);
+  advertisementData.writeUInt8(0x01, 1);
+  advertisementData.writeUInt8(0x06, 2);
+
+  advertisementData.writeUInt8(manufacturerDataLength + 1, 3);
+  advertisementData.writeUInt8(0xff, 4);
+  advertisementData.writeUInt16LE(0x004c, 5); // Apple Company Identifier LE (16 bit)
+  advertisementData.writeUInt8(0x02, 7); // type, 2 => iBeacon
+  advertisementData.writeUInt8(dataLength, 8);
+
+  data.copy(advertisementData, 9);
+
+  this.startAdvertisingWithEIRData(advertisementData, scanData);
+};
+
+Gap.prototype.startAdvertisingWithEIRData = function(advertisementData, scanData) {
+  advertisementData = advertisementData || new Buffer(0);
+  scanData = scanData || new Buffer(0);
+
+  debug('startAdvertisingWithEIRData: advertisement data = ' + advertisementData.toString('hex') + ', scan data = ' + scanData.toString('hex'));
+
+  var error = null;
+
+  if (advertisementData.length > 31) {
+    error = new Error('Advertisement data is over maximum limit of 31 bytes');
+  } else if (scanData.length > 31) {
+    error = new Error('Scan data is over maximum limit of 31 bytes');
+  }
+
+  if (error) {
+    this.emit('advertisingStart', error);
+  } else {
+    this._advertiseState = 'starting';
+
+    if (isIntelEdison || isYocto) {
+      // work around for Intel Edison
+      debug('skipping first set of scan response and advertisement data');
+    } else {
+      this._hci.setScanResponseData(scanData);
+      this._hci.setAdvertisingData(advertisementData);
+    }
+    this._hci.setAdvertiseEnable(true);
+    this._hci.setScanResponseData(scanData);
+    this._hci.setAdvertisingData(advertisementData);
+  }
+};
+
+Gap.prototype.restartAdvertising = function() {
+  this._advertiseState = 'restarting';
+
+  this._hci.setAdvertiseEnable(true);
+};
+
+Gap.prototype.stopAdvertising = function() {
+  this._advertiseState = 'stopping';
+
+  this._hci.setAdvertiseEnable(false);
+};
+
+Gap.prototype.onHciError = function(error) {
+};
+
+Gap.prototype.onHciLeAdvertisingParametersSet = function(status) {
+};
+
+Gap.prototype.onHciLeAdvertisingDataSet = function(status) {
+};
+
+Gap.prototype.onHciLeScanResponseDataSet = function(status) {
+};
+
+Gap.prototype.onHciLeAdvertiseEnableSet = function(status) {
+  if (this._advertiseState === 'starting') {
+    this._advertiseState = 'started';
+
+    var error = null;
+
+    if (status) {
+      error = new Error(Hci.STATUS_MAPPER[status] || ('Unknown (' + status + ')'));
+    }
+
+    this.emit('advertisingStart', error);
+  } else if (this._advertiseState === 'stopping') {
+    this._advertiseState = 'stopped';
+
+    this.emit('advertisingStop');
+  }
+};
+
+module.exports = Gap;
diff --git a/src/js/ble_hci_socket_gatt.js b/src/js/ble_hci_socket_gatt.js
new file mode 100644 (file)
index 0000000..13f6586
--- /dev/null
@@ -0,0 +1,1090 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*jshint loopfunc: true */
+
+var debug = console.log; // require('debug')('ble_hci_socket_gatt');
+
+var events = require('events');
+var util = require('util');
+
+var ATT_OP_ERROR                    = 0x01;
+var ATT_OP_MTU_REQ                  = 0x02;
+var ATT_OP_MTU_RESP                 = 0x03;
+var ATT_OP_FIND_INFO_REQ            = 0x04;
+var ATT_OP_FIND_INFO_RESP           = 0x05;
+var ATT_OP_FIND_BY_TYPE_REQ         = 0x06;
+var ATT_OP_FIND_BY_TYPE_RESP        = 0x07;
+var ATT_OP_READ_BY_TYPE_REQ         = 0x08;
+var ATT_OP_READ_BY_TYPE_RESP        = 0x09;
+var ATT_OP_READ_REQ                 = 0x0a;
+var ATT_OP_READ_RESP                = 0x0b;
+var ATT_OP_READ_BLOB_REQ            = 0x0c;
+var ATT_OP_READ_BLOB_RESP           = 0x0d;
+var ATT_OP_READ_MULTI_REQ           = 0x0e;
+var ATT_OP_READ_MULTI_RESP          = 0x0f;
+var ATT_OP_READ_BY_GROUP_REQ        = 0x10;
+var ATT_OP_READ_BY_GROUP_RESP       = 0x11;
+var ATT_OP_WRITE_REQ                = 0x12;
+var ATT_OP_WRITE_RESP               = 0x13;
+var ATT_OP_WRITE_CMD                = 0x52;
+var ATT_OP_PREP_WRITE_REQ           = 0x16;
+var ATT_OP_PREP_WRITE_RESP          = 0x17;
+var ATT_OP_EXEC_WRITE_REQ           = 0x18;
+var ATT_OP_EXEC_WRITE_RESP          = 0x19;
+var ATT_OP_HANDLE_NOTIFY            = 0x1b;
+var ATT_OP_HANDLE_IND               = 0x1d;
+var ATT_OP_HANDLE_CNF               = 0x1e;
+var ATT_OP_SIGNED_WRITE_CMD         = 0xd2;
+
+var GATT_PRIM_SVC_UUID              = 0x2800;
+var GATT_INCLUDE_UUID               = 0x2802;
+var GATT_CHARAC_UUID                = 0x2803;
+
+var GATT_CLIENT_CHARAC_CFG_UUID     = 0x2902;
+var GATT_SERVER_CHARAC_CFG_UUID     = 0x2903;
+
+var ATT_ECODE_SUCCESS               = 0x00;
+var ATT_ECODE_INVALID_HANDLE        = 0x01;
+var ATT_ECODE_READ_NOT_PERM         = 0x02;
+var ATT_ECODE_WRITE_NOT_PERM        = 0x03;
+var ATT_ECODE_INVALID_PDU           = 0x04;
+var ATT_ECODE_AUTHENTICATION        = 0x05;
+var ATT_ECODE_REQ_NOT_SUPP          = 0x06;
+var ATT_ECODE_INVALID_OFFSET        = 0x07;
+var ATT_ECODE_AUTHORIZATION         = 0x08;
+var ATT_ECODE_PREP_QUEUE_FULL       = 0x09;
+var ATT_ECODE_ATTR_NOT_FOUND        = 0x0a;
+var ATT_ECODE_ATTR_NOT_LONG         = 0x0b;
+var ATT_ECODE_INSUFF_ENCR_KEY_SIZE  = 0x0c;
+var ATT_ECODE_INVAL_ATTR_VALUE_LEN  = 0x0d;
+var ATT_ECODE_UNLIKELY              = 0x0e;
+var ATT_ECODE_INSUFF_ENC            = 0x0f;
+var ATT_ECODE_UNSUPP_GRP_TYPE       = 0x10;
+var ATT_ECODE_INSUFF_RESOURCES      = 0x11;
+
+var ATT_CID = 0x0004;
+
+var Gatt = function() {
+  this.maxMtu = 256;
+  this._mtu = 23;
+  this._preparedWriteRequest = null;
+
+  this.setServices([]);
+
+  this.onAclStreamDataBinded = this.onAclStreamData.bind(this);
+  this.onAclStreamEndBinded = this.onAclStreamEnd.bind(this);
+};
+
+util.inherits(Gatt, events.EventEmitter);
+
+Gatt.prototype.setServices = function(services) {
+  var deviceName = process.env.BLENO_DEVICE_NAME || process.platform;
+
+  // base services and characteristics
+  var allServices = [
+    {
+      uuid: '1800',
+      characteristics: [
+        {
+          uuid: '2a00',
+          properties: ['read'],
+          secure: [],
+          value: new Buffer(deviceName),
+          descriptors: []
+        },
+        {
+          uuid: '2a01',
+          properties: ['read'],
+          secure: [],
+          value: new Buffer([0x80, 0x00]),
+          descriptors: []
+        }
+      ]
+    },
+    {
+      uuid: '1801',
+      characteristics: [
+        {
+          uuid: '2a05',
+          properties: ['indicate'],
+          secure: [],
+          value: new Buffer([0x00, 0x00, 0x00, 0x00]),
+          descriptors: []
+        }
+      ]
+    }
+  ].concat(services);
+
+  this._handles = [];
+
+  var handle = 0;
+  var i;
+  var j;
+
+  for (i = 0; i < allServices.length; i++) {
+    var service = allServices[i];
+
+    handle++;
+    var serviceHandle = handle;
+
+    this._handles[serviceHandle] = {
+      type: 'service',
+      uuid: service.uuid,
+      attribute: service,
+      startHandle: serviceHandle
+      // endHandle filled in below
+    };
+
+    for (j = 0; j < service.characteristics.length; j++) {
+      var characteristic = service.characteristics[j];
+
+      var properties = 0;
+      var secure = 0;
+
+      if (characteristic.properties.indexOf('read') !== -1) {
+        properties |= 0x02;
+
+        if (characteristic.secure.indexOf('read') !== -1) {
+          secure |= 0x02;
+        }
+      }
+
+      if (characteristic.properties.indexOf('writeWithoutResponse') !== -1) {
+        properties |= 0x04;
+
+        if (characteristic.secure.indexOf('writeWithoutResponse') !== -1) {
+          secure |= 0x04;
+        }
+      }
+
+      if (characteristic.properties.indexOf('write') !== -1) {
+        properties |= 0x08;
+
+        if (characteristic.secure.indexOf('write') !== -1) {
+          secure |= 0x08;
+        }
+      }
+
+      if (characteristic.properties.indexOf('notify') !== -1) {
+        properties |= 0x10;
+
+        if (characteristic.secure.indexOf('notify') !== -1) {
+          secure |= 0x10;
+        }
+      }
+
+      if (characteristic.properties.indexOf('indicate') !== -1) {
+        properties |= 0x20;
+
+        if (characteristic.secure.indexOf('indicate') !== -1) {
+          secure |= 0x20;
+        }
+      }
+
+      handle++;
+      var characteristicHandle = handle;
+
+      handle++;
+      var characteristicValueHandle = handle;
+
+      this._handles[characteristicHandle] = {
+        type: 'characteristic',
+        uuid: characteristic.uuid,
+        properties: properties,
+        secure: secure,
+        attribute: characteristic,
+        startHandle: characteristicHandle,
+        valueHandle: characteristicValueHandle
+      };
+
+      this._handles[characteristicValueHandle] = {
+        type: 'characteristicValue',
+        handle: characteristicValueHandle,
+        value: characteristic.value
+      };
+
+      if (properties & 0x30) { // notify or indicate
+        // add client characteristic configuration descriptor
+
+        handle++;
+        var clientCharacteristicConfigurationDescriptorHandle = handle;
+        this._handles[clientCharacteristicConfigurationDescriptorHandle] = {
+          type: 'descriptor',
+          handle: clientCharacteristicConfigurationDescriptorHandle,
+          uuid: '2902',
+          attribute: characteristic,
+          properties: (0x02 | 0x04 | 0x08), // read/write
+          secure: (secure & 0x10) ? (0x02 | 0x04 | 0x08) : 0,
+          value: new Buffer([0x00, 0x00])
+        };
+      }
+
+      for (var k = 0; k < characteristic.descriptors.length; k++) {
+        var descriptor = characteristic.descriptors[k];
+
+        handle++;
+        var descriptorHandle = handle;
+
+        this._handles[descriptorHandle] = {
+          type: 'descriptor',
+          handle: descriptorHandle,
+          uuid: descriptor.uuid,
+          attribute: descriptor,
+          properties: 0x02, // read only
+          secure: 0x00,
+          value: descriptor.value
+        };
+      }
+    }
+
+    this._handles[serviceHandle].endHandle = handle;
+  }
+
+  var debugHandles = [];
+  for (i = 0; i < this._handles.length; i++) {
+    handle = this._handles[i];
+
+    debugHandles[i] = {};
+    for(j in handle) {
+      if (Buffer.isBuffer(handle[j])) {
+        debugHandles[i][j] = handle[j] ? 'Buffer(\'' + handle[j].toString('hex') + '\', \'hex\')' : null;
+      } else if (j !== 'attribute') {
+        debugHandles[i][j] = handle[j];
+      }
+    }
+  }
+
+  debug('handles = ' + JSON.stringify(debugHandles, null, 2));
+};
+
+Gatt.prototype.setAclStream = function(aclStream) {
+  this._mtu = 23;
+  this._preparedWriteRequest = null;
+
+  this._aclStream = aclStream;
+
+  this._aclStream.on('data', this.onAclStreamDataBinded);
+  this._aclStream.on('end', this.onAclStreamEndBinded);
+};
+
+Gatt.prototype.onAclStreamData = function(cid, data) {
+  if (cid !== ATT_CID) {
+    return;
+  }
+
+  this.handleRequest(data);
+};
+
+Gatt.prototype.onAclStreamEnd = function() {
+  this._aclStream.removeListener('data', this.onAclStreamDataBinded);
+  this._aclStream.removeListener('end', this.onAclStreamEndBinded);
+};
+
+Gatt.prototype.send = function(data) {
+  debug('send: ' + data.toString('hex'));
+  this._aclStream.write(ATT_CID, data);
+};
+
+Gatt.prototype.errorResponse = function(opcode, handle, status) {
+  var buf = new Buffer(5);
+
+  buf.writeUInt8(ATT_OP_ERROR, 0);
+  buf.writeUInt8(opcode, 1);
+  buf.writeUInt16LE(handle, 2);
+  buf.writeUInt8(status, 4);
+
+  return buf;
+};
+
+Gatt.prototype.handleRequest = function(request) {
+  debug('handing request: ' + request.toString('hex'));
+
+  var requestType = request.readUInt8(0); //buf[0];
+  var response = null;
+
+  switch(requestType) {
+    case ATT_OP_MTU_REQ:
+      response = this.handleMtuRequest(request);
+      break;
+
+    case ATT_OP_FIND_INFO_REQ:
+      response = this.handleFindInfoRequest(request);
+      break;
+
+    case ATT_OP_FIND_BY_TYPE_REQ:
+      response = this.handleFindByTypeRequest(request);
+      break;
+
+    case ATT_OP_READ_BY_TYPE_REQ:
+      response = this.handleReadByTypeRequest(request);
+      break;
+
+    case ATT_OP_READ_REQ:
+    case ATT_OP_READ_BLOB_REQ:
+      response = this.handleReadOrReadBlobRequest(request);
+      break;
+
+    case ATT_OP_READ_BY_GROUP_REQ:
+      response = this.handleReadByGroupRequest(request);
+      break;
+
+    case ATT_OP_WRITE_REQ:
+    case ATT_OP_WRITE_CMD:
+      response = this.handleWriteRequestOrCommand(request);
+      break;
+
+    case ATT_OP_PREP_WRITE_REQ:
+      response = this.handlePrepareWriteRequest(request);
+      break;
+
+    case ATT_OP_EXEC_WRITE_REQ:
+      response = this.handleExecuteWriteRequest(request);
+      break;
+
+    case ATT_OP_HANDLE_CNF:
+      response = this.handleConfirmation(request);
+      break;
+
+    default:
+    case ATT_OP_READ_MULTI_REQ:
+    case ATT_OP_SIGNED_WRITE_CMD:
+      response = this.errorResponse(requestType, 0x0000, ATT_ECODE_REQ_NOT_SUPP);
+      break;
+  }
+
+  if (response) {
+    debug('response: ' + response.toString('hex'));
+
+    this.send(response);
+  }
+};
+
+Gatt.prototype.handleMtuRequest = function(request) {
+  var mtu = request.readUInt16LE(1);
+
+  if (mtu < 23) {
+    mtu = 23;
+  } else if (mtu > this.maxMtu) {
+    mtu = this.maxMtu;
+  }
+
+  this._mtu = mtu;
+
+  this.emit('mtuChange', this._mtu);
+
+  var response = new Buffer(3);
+
+  response.writeUInt8(ATT_OP_MTU_RESP, 0);
+  response.writeUInt16LE(mtu, 1);
+
+  return response;
+};
+
+Gatt.prototype.handleFindInfoRequest = function(request) {
+  var response = null;
+
+  var startHandle = request.readUInt16LE(1);
+  var endHandle = request.readUInt16LE(3);
+
+  var infos = [];
+  var uuid = null;
+
+  for (i = startHandle; i <= endHandle; i++) {
+    var handle = this._handles[i];
+
+    if (!handle) {
+      break;
+    }
+
+    uuid = null;
+
+    if ('service' === handle.type) {
+      uuid = '2800';
+    } else if ('includedService' === handle.type) {
+      uuid = '2802';
+    } else if ('characteristic' === handle.type) {
+      uuid = '2803';
+    } else if ('characteristicValue' === handle.type) {
+      uuid = this._handles[i - 1].uuid;
+    } else if ('descriptor' === handle.type) {
+      uuid = handle.uuid;
+    }
+
+    if (uuid) {
+      infos.push({
+        handle: i,
+        uuid: uuid
+      });
+    }
+  }
+
+  if (infos.length) {
+    var uuidSize = infos[0].uuid.length / 2;
+    var numInfo = 1;
+
+    for (i = 1; i < infos.length; i++) {
+      if (infos[0].uuid.length !== infos[i].uuid.length) {
+        break;
+      }
+      numInfo++;
+    }
+
+    var lengthPerInfo = (uuidSize === 2) ? 4 : 18;
+    var maxInfo = Math.floor((this._mtu - 2) / lengthPerInfo);
+    numInfo = Math.min(numInfo, maxInfo);
+
+    response = new Buffer(2 + numInfo * lengthPerInfo);
+
+    //response[0] = ATT_OP_FIND_INFO_RESP;
+    //response[1] = (uuidSize === 2) ? 0x01 : 0x2;
+    response.writeUInt8(ATT_OP_FIND_INFO_RESP, 0);
+    response.writeUInt8((uuidSize === 2) ? 0x01 : 0x2, 1);
+
+    for (i = 0; i < numInfo; i++) {
+      var info = infos[i];
+
+      response.writeUInt16LE(info.handle, 2 + i * lengthPerInfo);
+
+      uuid = new Buffer(info.uuid.match(/.{1,2}/g).reverse().join(''), 'hex');
+      for (var j = 0; j < uuid.length; j++) {
+        //response[2 + i * lengthPerInfo + 2 + j] = uuid[j];
+        response.writeUInt8(uuid[j], 2 + i * lengthPerInfo + 2 + j);
+      }
+    }
+  } else {
+    response = this.errorResponse(ATT_OP_FIND_INFO_REQ, startHandle, ATT_ECODE_ATTR_NOT_FOUND);
+  }
+
+  return response;
+};
+
+Gatt.prototype.handleFindByTypeRequest = function(request) {
+  var response = null;
+
+  var startHandle = request.readUInt16LE(1);
+  var endHandle = request.readUInt16LE(3);
+  var uuid = request.slice(5, 7).toString('hex').match(/.{1,2}/g).reverse().join('');
+  var value = request.slice(7).toString('hex').match(/.{1,2}/g).reverse().join('');
+
+  var handles = [];
+  var handle;
+
+  for (var i = startHandle; i <= endHandle; i++) {
+    handle = this._handles[i];
+
+    if (!handle) {
+      break;
+    }
+
+    if ('2800' === uuid && handle.type === 'service' && handle.uuid === value) {
+      handles.push({
+        start: handle.startHandle,
+        end: handle.endHandle
+      });
+    }
+  }
+
+  if (handles.length) {
+    var lengthPerHandle = 4;
+    var numHandles = handles.length;
+    var maxHandles = Math.floor((this._mtu - 1) / lengthPerHandle);
+
+    numHandles = Math.min(numHandles, maxHandles);
+
+    response = new Buffer(1 + numHandles * lengthPerHandle);
+
+    //response[0] = ATT_OP_FIND_BY_TYPE_RESP;
+    response.writeUInt8(ATT_OP_FIND_BY_TYPE_RESP, 0);
+
+    for (i = 0; i < numHandles; i++) {
+      handle = handles[i];
+
+      response.writeUInt16LE(handle.start, 1 + i * lengthPerHandle);
+      response.writeUInt16LE(handle.end, 1 + i * lengthPerHandle + 2);
+    }
+  } else {
+    response = this.errorResponse(ATT_OP_FIND_BY_TYPE_REQ, startHandle, ATT_ECODE_ATTR_NOT_FOUND);
+  }
+
+  return response;
+};
+
+Gatt.prototype.handleReadByGroupRequest = function(request) {
+  var response = null;
+
+  var startHandle = request.readUInt16LE(1);
+  var endHandle = request.readUInt16LE(3);
+  var uuid = request.slice(5).toString('hex').match(/.{1,2}/g).reverse().join('');
+
+  debug('read by group: startHandle = 0x' + startHandle.toString(16) + ', endHandle = 0x' + endHandle.toString(16) + ', uuid = 0x' + uuid.toString(16));
+
+  if ('2800' === uuid || '2802' === uuid) {
+    var services = [];
+    var type = ('2800' === uuid) ? 'service' : 'includedService';
+    var i;
+
+    for (i = startHandle; i <= endHandle; i++) {
+      var handle = this._handles[i];
+
+      if (!handle) {
+        break;
+      }
+
+      if (handle.type === type) {
+        services.push(handle);
+      }
+    }
+
+    if (services.length) {
+      var uuidSize = services[0].uuid.length / 2;
+      var numServices = 1;
+
+      for (i = 1; i < services.length; i++) {
+        if (services[0].uuid.length !== services[i].uuid.length) {
+          break;
+        }
+        numServices++;
+      }
+
+      var lengthPerService = (uuidSize === 2) ? 6 : 20;
+      var maxServices = Math.floor((this._mtu - 2) / lengthPerService);
+      numServices = Math.min(numServices, maxServices);
+
+      response = new Buffer(2 + numServices * lengthPerService);
+
+      //response[0] = ATT_OP_READ_BY_GROUP_RESP;
+      //response[1] = lengthPerService;
+      response.writeUInt8(ATT_OP_READ_BY_GROUP_RESP, 0);
+      response.writeUInt8(lengthPerService, 1);
+
+      for (i = 0; i < numServices; i++) {
+        var service = services[i];
+
+        response.writeUInt16LE(service.startHandle, 2 + i * lengthPerService);
+        response.writeUInt16LE(service.endHandle, 2 + i * lengthPerService + 2);
+
+        var serviceUuid = new Buffer(service.uuid.match(/.{1,2}/g).reverse().join(''), 'hex');
+        for (var j = 0; j < serviceUuid.length; j++) {
+          //response[2 + i * lengthPerService + 4 + j] = serviceUuid[j];
+          response.writeUInt8(serviceUuid.readUInt8(j), 2 + i * lengthPerService + 4 + j);
+        }
+      }
+    } else {
+      response = this.errorResponse(ATT_OP_READ_BY_GROUP_REQ, startHandle, ATT_ECODE_ATTR_NOT_FOUND);
+    }
+  } else {
+    response = this.errorResponse(ATT_OP_READ_BY_GROUP_REQ, startHandle, ATT_ECODE_UNSUPP_GRP_TYPE);
+  }
+
+  return response;
+};
+
+Gatt.prototype.handleReadByTypeRequest = function(request) {
+  var response = null;
+
+  var startHandle = request.readUInt16LE(1);
+  var endHandle = request.readUInt16LE(3);
+  var uuid = request.slice(5).toString('hex').match(/.{1,2}/g).reverse().join('');
+  var i;
+  var handle;
+
+  debug('read by type: startHandle = 0x' + startHandle.toString(16) + ', endHandle = 0x' + endHandle.toString(16) + ', uuid = 0x' + uuid.toString(16));
+
+  if ('2803' === uuid) {
+    var characteristics = [];
+
+    for (i = startHandle; i <= endHandle; i++) {
+      handle = this._handles[i];
+
+      if (!handle) {
+        break;
+      }
+
+      if (handle.type === 'characteristic') {
+        characteristics.push(handle);
+      }
+    }
+
+    if (characteristics.length) {
+      var uuidSize = characteristics[0].uuid.length / 2;
+      var numCharacteristics = 1;
+
+      for (i = 1; i < characteristics.length; i++) {
+        if (characteristics[0].uuid.length !== characteristics[i].uuid.length) {
+          break;
+        }
+        numCharacteristics++;
+      }
+
+      var lengthPerCharacteristic = (uuidSize === 2) ? 7 : 21;
+      var maxCharacteristics = Math.floor((this._mtu - 2) / lengthPerCharacteristic);
+      numCharacteristics = Math.min(numCharacteristics, maxCharacteristics);
+
+      response = new Buffer(2 + numCharacteristics * lengthPerCharacteristic);
+
+      //response[0] = ATT_OP_READ_BY_TYPE_RESP;
+      //response[1] = lengthPerCharacteristic;
+      response.writeUInt8(ATT_OP_READ_BY_TYPE_RESP, 0);
+      response.writeUInt8(lengthPerCharacteristic, 1);
+
+      for (i = 0; i < numCharacteristics; i++) {
+        var characteristic = characteristics[i];
+
+        response.writeUInt16LE(characteristic.startHandle, 2 + i * lengthPerCharacteristic);
+        response.writeUInt8(characteristic.properties, 2 + i * lengthPerCharacteristic + 2);
+        response.writeUInt16LE(characteristic.valueHandle, 2 + i * lengthPerCharacteristic + 3);
+
+        var characteristicUuid = new Buffer(characteristic.uuid.match(/.{1,2}/g).reverse().join(''), 'hex');
+        for (var j = 0; j < characteristicUuid.length; j++) {
+          //response[2 + i * lengthPerCharacteristic + 5 + j] = characteristicUuid[j];
+          response.writeUInt8(characteristicUuid.readUInt8(j), 2 + i * lengthPerCharacteristic + 5 + j);
+        }
+      }
+    } else {
+      response = this.errorResponse(ATT_OP_READ_BY_TYPE_REQ, startHandle, ATT_ECODE_ATTR_NOT_FOUND);
+    }
+  } else {
+    var handleAttribute = null;
+    var valueHandle = null;
+    var secure = false;
+
+    for (i = startHandle; i <= endHandle; i++) {
+      handle = this._handles[i];
+
+      if (!handle) {
+        break;
+      }
+
+      if (handle.type === 'characteristic' && handle.uuid === uuid) {
+        handleAttribute = handle.attribute;
+        valueHandle = handle.valueHandle;
+        secure = handle.secure & 0x02;
+        break;
+      } else if (handle.type === 'descriptor' && handle.uuid === uuid) {
+        valueHandle = i;
+        secure = handle.secure & 0x02;
+        break;
+      }
+    }
+
+    if (secure && !this._aclStream.encrypted) {
+      response = this.errorResponse(ATT_OP_READ_BY_TYPE_REQ, startHandle, ATT_ECODE_AUTHENTICATION);
+    } else if (valueHandle) {
+      var callback = (function(valueHandle) {
+        return function(result, data) {
+          var callbackResponse = null;
+
+          if (ATT_ECODE_SUCCESS === result) {
+            var dataLength = Math.min(data.length, this._mtu - 4);
+            callbackResponse = new Buffer(4 + dataLength);
+
+            //callbackResponse[0] = ATT_OP_READ_BY_TYPE_RESP;
+            //callbackResponse[1] = dataLength + 2;
+            callbackResponse.writeUInt8(ATT_OP_READ_BY_TYPE_RESP, 0);
+            callbackResponse.writeUInt8(dataLength + 2, 1);
+            callbackResponse.writeUInt16LE(valueHandle, 2);
+            for (i = 0; i < dataLength; i++) {
+              //callbackResponse[4 + i] = data[i];
+              callbackResponse.writeUInt8(data.readUInt8(i), 4 + i);
+            }
+          } else {
+            callbackResponse = this.errorResponse(requestType, valueHandle, result);
+          }
+
+          debug('read by type response: ' + callbackResponse.toString('hex'));
+
+          this.send(callbackResponse);
+        }.bind(this);
+      }.bind(this))(valueHandle);
+
+      var data = this._handles[valueHandle].value;
+
+      if (data) {
+        callback(ATT_ECODE_SUCCESS, data);
+      } else if (handleAttribute) {
+        handleAttribute.emit('readRequest', 0, callback);
+      } else {
+        callback(ATT_ECODE_UNLIKELY);
+      }
+    } else {
+      response = this.errorResponse(ATT_OP_READ_BY_TYPE_REQ, startHandle, ATT_ECODE_ATTR_NOT_FOUND);
+    }
+  }
+
+  return response;
+};
+
+Gatt.prototype.handleReadOrReadBlobRequest = function(request) {
+  var response = null;
+
+  //var requestType = request[0];
+  var requestType = request.readUInt8(0);
+  var valueHandle = request.readUInt16LE(1);
+  var offset = (requestType === ATT_OP_READ_BLOB_REQ) ? request.readUInt16LE(3) : 0;
+
+  var handle = this._handles[valueHandle];
+
+  if (handle) {
+    var result = null;
+    var data = null;
+    var handleType = handle.type;
+
+    var callback = (function(requestType, valueHandle) {
+      return function(result, data) {
+        var callbackResponse = null;
+
+        if (ATT_ECODE_SUCCESS === result) {
+          var dataLength = Math.min(data.length, this._mtu - 1);
+          callbackResponse = new Buffer(1 + dataLength);
+
+          //callbackResponse[0] = (requestType === ATT_OP_READ_BLOB_REQ) ? ATT_OP_READ_BLOB_RESP : ATT_OP_READ_RESP;
+          callbackResponse.writeUInt8((requestType === ATT_OP_READ_BLOB_REQ) ? ATT_OP_READ_BLOB_RESP : ATT_OP_READ_RESP, 0);
+          for (i = 0; i < dataLength; i++) {
+            //callbackResponse[1 + i] = data[i];
+            callbackResponse.writeUInt8(data.readUInt8(i), 1 + i);
+          }
+        } else {
+          callbackResponse = this.errorResponse(requestType, valueHandle, result);
+        }
+
+        debug('read response: ' + callbackResponse.toString('hex'));
+
+        this.send(callbackResponse);
+      }.bind(this);
+    }.bind(this))(requestType, valueHandle);
+
+    if (handleType === 'service' || handleType === 'includedService') {
+      result = ATT_ECODE_SUCCESS;
+      data = new Buffer(handle.uuid.match(/.{1,2}/g).reverse().join(''), 'hex');
+    } else if (handleType === 'characteristic') {
+      var uuid = new Buffer(handle.uuid.match(/.{1,2}/g).reverse().join(''), 'hex');
+
+      result = ATT_ECODE_SUCCESS;
+      data = new Buffer(3 + uuid.length);
+      data.writeUInt8(handle.properties, 0);
+      data.writeUInt16LE(handle.valueHandle, 1);
+
+      for (i = 0; i < uuid.length; i++) {
+        //data[i + 3] = uuid[i];
+        data.writeUInt8(uuid.readUInt8(i), i + 3);
+      }
+    } else if (handleType === 'characteristicValue' || handleType === 'descriptor') {
+      var handleProperties = handle.properties;
+      var handleSecure = handle.secure;
+      var handleAttribute = handle.attribute;
+      if (handleType === 'characteristicValue') {
+        handleProperties = this._handles[valueHandle - 1].properties;
+        handleSecure = this._handles[valueHandle - 1].secure;
+        handleAttribute = this._handles[valueHandle - 1].attribute;
+      }
+
+      if (handleProperties & 0x02) {
+        if (handleSecure & 0x02 && !this._aclStream.encrypted) {
+          result = ATT_ECODE_AUTHENTICATION;
+        } else {
+          data = handle.value;
+
+          if (data) {
+            result = ATT_ECODE_SUCCESS;
+          } else {
+            handleAttribute.emit('readRequest', offset, callback);
+          }
+        }
+      } else {
+        result = ATT_ECODE_READ_NOT_PERM; // non-readable
+      }
+    }
+
+    if (data && typeof data === 'string') {
+      data = new Buffer(data);
+    }
+
+    if (result === ATT_ECODE_SUCCESS && data && offset) {
+      if (data.length < offset) {
+        errorCode = ATT_ECODE_INVALID_OFFSET;
+        data = null;
+      } else {
+        data = data.slice(offset);
+      }
+    }
+
+    if (result !== null) {
+      callback(result, data);
+    }
+  } else {
+    response = this.errorResponse(requestType, valueHandle, ATT_ECODE_INVALID_HANDLE);
+  }
+
+  return response;
+};
+
+Gatt.prototype.handleWriteRequestOrCommand = function(request) {
+  var response = null;
+
+  //var requestType = request[0];
+  var requestType = request.readUInt8(0);
+  var withoutResponse = (requestType === ATT_OP_WRITE_CMD);
+  var valueHandle = request.readUInt16LE(1);
+  var data = request.slice(3);
+  var offset = 0;
+
+  var handle = this._handles[valueHandle];
+
+  if (handle) {
+    if (handle.type === 'characteristicValue') {
+      handle = this._handles[valueHandle - 1];
+    }
+
+    var handleProperties = handle.properties;
+    var handleSecure = handle.secure;
+
+    if (handleProperties && (withoutResponse ? (handleProperties & 0x04) : (handleProperties & 0x08))) {
+
+      var callback = (function(requestType, valueHandle, withoutResponse) {
+        return function(result) {
+          if (!withoutResponse) {
+            var callbackResponse = null;
+
+            if (ATT_ECODE_SUCCESS === result) {
+              callbackResponse = new Buffer([ATT_OP_WRITE_RESP]);
+            } else {
+              callbackResponse = this.errorResponse(requestType, valueHandle, result);
+            }
+
+            debug('write response: ' + callbackResponse.toString('hex'));
+
+            this.send(callbackResponse);
+          }
+        }.bind(this);
+      }.bind(this))(requestType, valueHandle, withoutResponse);
+
+      if (handleSecure & (withoutResponse ? 0x04 : 0x08) && !this._aclStream.encrypted) {
+        response = this.errorResponse(requestType, valueHandle, ATT_ECODE_AUTHENTICATION);
+      } else if (handle.type === 'descriptor' || handle.uuid === '2902') {
+        var result = null;
+
+        if (data.length !== 2) {
+          result = ATT_ECODE_INVAL_ATTR_VALUE_LEN;
+        } else {
+          var value = data.readUInt16LE(0);
+          var handleAttribute = handle.attribute;
+
+          handle.value = data;
+
+          if (value & 0x0003) {
+            var updateValueCallback = (function(valueHandle, attribute) {
+              return function(data) {
+                var dataLength = Math.min(data.length, this._mtu - 3);
+                var useNotify = attribute.properties.indexOf('notify') !== -1;
+                var useIndicate = attribute.properties.indexOf('indicate') !== -1;
+                var i;
+
+                if (useNotify) {
+                  var notifyMessage = new Buffer(3 + dataLength);
+
+                  notifyMessage.writeUInt8(ATT_OP_HANDLE_NOTIFY, 0);
+                  notifyMessage.writeUInt16LE(valueHandle, 1);
+
+                  for (i = 0; i < dataLength; i++) {
+                    //notifyMessage[3 + i] = data[i];
+                    notifyMessage.writeUInt8(data.readUInt8(i), 3 + i);
+                  }
+
+                  debug('notify message: ' + notifyMessage.toString('hex'));
+                  this.send(notifyMessage);
+
+                  attribute.emit('notify');
+                } else if (useIndicate) {
+                  var indicateMessage = new Buffer(3 + dataLength);
+
+                  indicateMessage.writeUInt8(ATT_OP_HANDLE_IND, 0);
+                  indicateMessage.writeUInt16LE(valueHandle, 1);
+
+                  for (i = 0; i < dataLength; i++) {
+                    //indicateMessage[3 + i] = data[i];
+                    indicateMessage.writeUInt8(data.readUInt8(i), 3 + i);
+                  }
+
+                  this._lastIndicatedAttribute = attribute;
+
+                  debug('indicate message: ' + indicateMessage.toString('hex'));
+                  this.send(indicateMessage);
+                }
+              }.bind(this);
+            }.bind(this))(valueHandle - 1, handleAttribute);
+
+            if (handleAttribute.emit) {
+              handleAttribute.emit('subscribe', this._mtu - 3, updateValueCallback);
+            }
+          } else {
+            handleAttribute.emit('unsubscribe');
+          }
+
+          result = ATT_ECODE_SUCCESS;
+        }
+
+        callback(result);
+      } else {
+        handle.attribute.emit('writeRequest', data, offset, withoutResponse, callback);
+      }
+    } else {
+      response = this.errorResponse(requestType, valueHandle, ATT_ECODE_WRITE_NOT_PERM);
+    }
+  } else {
+    response = this.errorResponse(requestType, valueHandle, ATT_ECODE_INVALID_HANDLE);
+  }
+
+  return response;
+};
+
+Gatt.prototype.handlePrepareWriteRequest = function(request) {
+  var response = null;
+
+  //var requestType = request[0];
+  var requestType = request.readUInt8(0);
+  var valueHandle = request.readUInt16LE(1);
+  var offset = request.readUInt16LE(3);
+  var data = request.slice(5);
+
+  var handle = this._handles[valueHandle];
+
+  if (handle) {
+    if (handle.type === 'characteristicValue') {
+      handle = this._handles[valueHandle - 1];
+
+      var handleProperties = handle.properties;
+      var handleSecure = handle.secure;
+
+      if (handleProperties && (handleProperties & 0x08)) {
+        if ((handleSecure & 0x08) && !this._aclStream.encrypted) {
+          response = this.errorResponse(requestType, valueHandle, ATT_ECODE_AUTHENTICATION);
+        } else if (this._preparedWriteRequest) {
+          if (this._preparedWriteRequest.handle !== handle) {
+            response = this.errorResponse(requestType, valueHandle, ATT_ECODE_UNLIKELY);
+          } else if (offset === (this._preparedWriteRequest.offset + this._preparedWriteRequest.data.length)) {
+            this._preparedWriteRequest.data = Buffer.concat([
+              this._preparedWriteRequest.data,
+              data
+            ]);
+
+            response = new Buffer(request.length);
+            request.copy(response);
+            //response[0] = ATT_OP_PREP_WRITE_RESP;
+            response.writeUInt8(ATT_OP_PREP_WRITE_RESP, 0);
+          } else {
+            response = this.errorResponse(requestType, valueHandle, ATT_ECODE_INVALID_OFFSET);
+          }
+        } else {
+          this._preparedWriteRequest = {
+            handle: handle,
+            valueHandle: valueHandle,
+            offset: offset,
+            data: data
+          };
+
+          response = new Buffer(request.length);
+          request.copy(response);
+          // response[0] = ATT_OP_PREP_WRITE_RESP;
+          response.writeUInt8(ATT_OP_PREP_WRITE_RESP, 0);
+        }
+      } else {
+        response = this.errorResponse(requestType, valueHandle, ATT_ECODE_WRITE_NOT_PERM);
+      }
+    } else {
+      response = this.errorResponse(requestType, valueHandle, ATT_ECODE_ATTR_NOT_LONG);
+    }
+  } else {
+    response = this.errorResponse(requestType, valueHandle, ATT_ECODE_INVALID_HANDLE);
+  }
+
+  return response;
+};
+
+Gatt.prototype.handleExecuteWriteRequest = function(request) {
+  var response = null;
+
+  //var requestType = request[0];
+  //var flag = request[1];
+  var requestType = request.readUInt8(0);
+  var flag = request.readUInt8(1);
+
+  if (this._preparedWriteRequest) {
+    var valueHandle = this._preparedWriteRequest.valueHandle;
+
+    if (flag === 0x00) {
+      response = new Buffer([ATT_OP_EXEC_WRITE_RESP]);
+    } else if (flag === 0x01) {
+      var callback = (function(requestType, valueHandle) {
+        return function(result) {
+          var callbackResponse = null;
+
+          if (ATT_ECODE_SUCCESS === result) {
+            callbackResponse = new Buffer([ATT_OP_EXEC_WRITE_RESP]);
+          } else {
+            callbackResponse = this.errorResponse(requestType, valueHandle, result);
+          }
+
+          debug('execute write response: ' + callbackResponse.toString('hex'));
+
+          this.send(callbackResponse);
+        }.bind(this);
+      }.bind(this))(requestType, this._preparedWriteRequest.valueHandle);
+
+      this._preparedWriteRequest.handle.attribute.emit('writeRequest', this._preparedWriteRequest.data, this._preparedWriteRequest.offset, false, callback);
+    } else {
+      response = this.errorResponse(requestType, 0x0000, ATT_ECODE_UNLIKELY);
+    }
+
+    this._preparedWriteRequest = null;
+  } else {
+    response = this.errorResponse(requestType, 0x0000, ATT_ECODE_UNLIKELY);
+  }
+
+  return response;
+};
+
+Gatt.prototype.handleConfirmation = function(request) {
+  if (this._lastIndicatedAttribute) {
+    if (this._lastIndicatedAttribute.emit) {
+      this._lastIndicatedAttribute.emit('indicate');
+    }
+
+    this._lastIndicatedAttribute = null;
+  }
+};
+
+module.exports = Gatt;
diff --git a/src/js/ble_hci_socket_hci.js b/src/js/ble_hci_socket_hci.js
new file mode 100644 (file)
index 0000000..2428083
--- /dev/null
@@ -0,0 +1,644 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var debug = console.log; // require('debug')('ble_hci');
+
+var events = require('events');
+var util = require('util');
+
+var BluetoothHciSocket = require('ble_hci_socket');
+
+var HCI_COMMAND_PKT = 0x01;
+var HCI_ACLDATA_PKT = 0x02;
+var HCI_EVENT_PKT = 0x04;
+
+var ACL_START_NO_FLUSH = 0x00;
+var ACL_CONT  = 0x01;
+var ACL_START = 0x02;
+
+var EVT_DISCONN_COMPLETE = 0x05;
+var EVT_ENCRYPT_CHANGE = 0x08;
+var EVT_CMD_COMPLETE = 0x0e;
+var EVT_CMD_STATUS = 0x0f;
+var EVT_LE_META_EVENT = 0x3e;
+
+var EVT_LE_CONN_COMPLETE = 0x01;
+var EVT_LE_CONN_UPDATE_COMPLETE = 0x03;
+
+var OGF_LINK_CTL = 0x01;
+var OCF_DISCONNECT = 0x0006;
+
+var OGF_HOST_CTL = 0x03;
+var OCF_SET_EVENT_MASK = 0x0001;
+var OCF_RESET = 0x0003;
+var OCF_READ_LE_HOST_SUPPORTED = 0x006c;
+var OCF_WRITE_LE_HOST_SUPPORTED = 0x006d;
+
+var OGF_INFO_PARAM = 0x04;
+var OCF_READ_LOCAL_VERSION = 0x0001;
+var OCF_READ_BD_ADDR = 0x0009;
+
+var OGF_STATUS_PARAM = 0x05;
+var OCF_READ_RSSI = 0x0005;
+
+var OGF_LE_CTL = 0x08;
+var OCF_LE_SET_EVENT_MASK = 0x0001;
+var OCF_LE_SET_ADVERTISING_PARAMETERS = 0x0006;
+var OCF_LE_SET_ADVERTISING_DATA = 0x0008;
+var OCF_LE_SET_SCAN_RESPONSE_DATA = 0x0009;
+var OCF_LE_SET_ADVERTISE_ENABLE = 0x000a;
+var OCF_LE_LTK_NEG_REPLY = 0x001B;
+
+var DISCONNECT_CMD = OCF_DISCONNECT | OGF_LINK_CTL << 10;
+
+var SET_EVENT_MASK_CMD = OCF_SET_EVENT_MASK | OGF_HOST_CTL << 10;
+var RESET_CMD = OCF_RESET | OGF_HOST_CTL << 10;
+var READ_LE_HOST_SUPPORTED_CMD = OCF_READ_LE_HOST_SUPPORTED | OGF_HOST_CTL << 10;
+var WRITE_LE_HOST_SUPPORTED_CMD = OCF_WRITE_LE_HOST_SUPPORTED | OGF_HOST_CTL << 10;
+
+var READ_LOCAL_VERSION_CMD = OCF_READ_LOCAL_VERSION | (OGF_INFO_PARAM << 10);
+var READ_BD_ADDR_CMD = OCF_READ_BD_ADDR | (OGF_INFO_PARAM << 10);
+
+var READ_RSSI_CMD = OCF_READ_RSSI | OGF_STATUS_PARAM << 10;
+
+var LE_SET_EVENT_MASK_CMD = OCF_LE_SET_EVENT_MASK | OGF_LE_CTL << 10;
+var LE_SET_ADVERTISING_PARAMETERS_CMD = OCF_LE_SET_ADVERTISING_PARAMETERS | OGF_LE_CTL << 10;
+var LE_SET_ADVERTISING_DATA_CMD = OCF_LE_SET_ADVERTISING_DATA | OGF_LE_CTL << 10;
+var LE_SET_SCAN_RESPONSE_DATA_CMD = OCF_LE_SET_SCAN_RESPONSE_DATA | OGF_LE_CTL << 10;
+var LE_SET_ADVERTISE_ENABLE_CMD = OCF_LE_SET_ADVERTISE_ENABLE | OGF_LE_CTL << 10;
+var LE_LTK_NEG_REPLY_CMD = OCF_LE_LTK_NEG_REPLY | OGF_LE_CTL << 10;
+
+var HCI_OE_USER_ENDED_CONNECTION = 0x13;
+
+var STATUS_MAPPER = require('ble_hci_socket_hci_status');
+
+var Hci = function() {
+  this._socket = new BluetoothHciSocket();
+  this._isDevUp = null;
+  this._state = null;
+  this._deviceId = null;
+
+  this._handleBuffers = {};
+
+  this.on('stateChange', this.onStateChange.bind(this));
+};
+
+util.inherits(Hci, events.EventEmitter);
+
+Hci.STATUS_MAPPER = STATUS_MAPPER;
+
+Hci.prototype.init = function() {
+  this._socket.on('data', this.onSocketData.bind(this));
+  this._socket.on('error', this.onSocketError.bind(this));
+
+  var deviceId = process.env.BLENO_HCI_DEVICE_ID ? parseInt(process.env.BLENO_HCI_DEVICE_ID) : undefined;
+
+
+  if (process.env.HCI_CHANNEL_USER) {
+    this._deviceId = this._socket.bindUser(deviceId);
+
+    this._socket.start();
+
+    this.reset();
+  } else {
+    this._deviceId = this._socket.bindRaw(deviceId);
+    this._socket.start();
+
+    this.pollIsDevUp();
+  }
+};
+
+Hci.prototype.pollIsDevUp = function() {
+  var isDevUp = this._socket.isDevUp();
+
+  if (this._isDevUp !== isDevUp) {
+    if (isDevUp) {
+      this.setSocketFilter();
+      this.setEventMask();
+      this.setLeEventMask();
+      this.readLocalVersion();
+      this.writeLeHostSupported();
+      this.readLeHostSupported();
+      this.readBdAddr();
+    } else {
+      this.emit('stateChange', 'poweredOff');
+    }
+
+    this._isDevUp = isDevUp;
+  }
+
+  setTimeout(this.pollIsDevUp.bind(this), 1000);
+};
+
+Hci.prototype.setSocketFilter = function() {
+  var filter = new Buffer(14);
+  var typeMask = (1 << HCI_EVENT_PKT)| (1 << HCI_ACLDATA_PKT);
+  var eventMask1 = (1 << EVT_DISCONN_COMPLETE) | (1 << EVT_ENCRYPT_CHANGE) | (1 << EVT_CMD_COMPLETE) | (1 << EVT_CMD_STATUS);
+  var eventMask2 = (1 << (EVT_LE_META_EVENT - 32));
+  var opcode = 0;
+
+  filter.writeUInt32LE(typeMask, 0);
+  filter.writeUInt32LE(eventMask1, 4);
+  filter.writeUInt32LE(eventMask2, 8);
+  filter.writeUInt16LE(opcode, 12);
+
+  debug('setting filter to: ' + filter.toString('hex'));
+  this._socket.setFilter(filter);
+};
+
+Hci.prototype.setEventMask = function() {
+  var cmd = new Buffer(12);
+  var eventMask = new Buffer('fffffbff07f8bf3d', 'hex');
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(SET_EVENT_MASK_CMD, 1);
+
+  // length
+  cmd.writeUInt8(eventMask.length, 3);
+
+  eventMask.copy(cmd, 4);
+
+  debug('set event mask - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.reset = function() {
+  var cmd = new Buffer(4);
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(OCF_RESET | OGF_HOST_CTL << 10, 1);
+
+  // length
+  cmd.writeUInt8(0x00, 3);
+
+  debug('reset - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.readLeHostSupported = function() {
+  var cmd = new Buffer(4);
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(READ_LE_HOST_SUPPORTED_CMD, 1);
+
+  // length
+  cmd.writeUInt8(0x00, 3);
+
+  debug('read LE host supported - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.writeLeHostSupported = function() {
+  var cmd = new Buffer(6);
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(WRITE_LE_HOST_SUPPORTED_CMD, 1);
+
+  // length
+  cmd.writeUInt8(0x02, 3);
+
+  // data
+  cmd.writeUInt8(0x01, 4); // le
+  cmd.writeUInt8(0x00, 5); // simul
+
+  debug('write LE host supported - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.readLocalVersion = function() {
+  var cmd = new Buffer(4);
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(READ_LOCAL_VERSION_CMD, 1);
+
+  // length
+  cmd.writeUInt8(0x0, 3);
+
+  debug('read local version - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.readBdAddr = function() {
+  var cmd = new Buffer(4);
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(READ_BD_ADDR_CMD, 1);
+
+  // length
+  cmd.writeUInt8(0x0, 3);
+
+  debug('read bd addr - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.setLeEventMask = function() {
+  var cmd = new Buffer(12);
+  var leEventMask = new Buffer('1f00000000000000', 'hex');
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(LE_SET_EVENT_MASK_CMD, 1);
+
+  // length
+  cmd.writeUInt8(leEventMask.length, 3);
+
+  leEventMask.copy(cmd, 4);
+
+  debug('set le event mask - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.setAdvertisingParameters = function() {
+  var cmd = new Buffer(19);
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(LE_SET_ADVERTISING_PARAMETERS_CMD, 1);
+
+  // length
+  cmd.writeUInt8(15, 3);
+
+  var advertisementInterval = Math.floor((process.env.BLENO_ADVERTISING_INTERVAL ? parseInt(process.env.BLENO_ADVERTISING_INTERVAL) : 100) * 1.6);
+
+  // data
+  cmd.writeUInt16LE(advertisementInterval, 4); // min interval
+  cmd.writeUInt16LE(advertisementInterval, 6); // max interval
+  cmd.writeUInt8(0x00, 8); // adv type
+  cmd.writeUInt8(0x00, 9); // own addr typ
+  cmd.writeUInt8(0x00, 10); // direct addr type
+  (new Buffer('000000000000', 'hex')).copy(cmd, 11); // direct addr
+  cmd.writeUInt8(0x07, 17);
+  cmd.writeUInt8(0x00, 18);
+
+  debug('set advertisement parameters - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.setAdvertisingData = function(data) {
+  var cmd = new Buffer(36);
+
+  cmd.fill(0x00);
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(LE_SET_ADVERTISING_DATA_CMD, 1);
+
+  // length
+  cmd.writeUInt8(32, 3);
+
+  // data
+  cmd.writeUInt8(data.length, 4);
+  data.copy(cmd, 5);
+
+  debug('set advertisement data - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.setScanResponseData = function(data) {
+  var cmd = new Buffer(36);
+
+  cmd.fill(0x00);
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(LE_SET_SCAN_RESPONSE_DATA_CMD, 1);
+
+  // length
+  cmd.writeUInt8(32, 3);
+
+  // data
+  cmd.writeUInt8(data.length, 4);
+  data.copy(cmd, 5);
+
+  debug('set scan response data - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.setAdvertiseEnable = function(enabled) {
+  var cmd = new Buffer(5);
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(LE_SET_ADVERTISE_ENABLE_CMD, 1);
+
+  // length
+  cmd.writeUInt8(0x01, 3);
+
+  // data
+  cmd.writeUInt8(enabled ? 0x01 : 0x00, 4); // enable: 0 -> disabled, 1 -> enabled
+
+  debug('set advertise enable - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.disconnect = function(handle, reason) {
+  var cmd = new Buffer(7);
+
+  reason = reason || HCI_OE_USER_ENDED_CONNECTION;
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(DISCONNECT_CMD, 1);
+
+  // length
+  cmd.writeUInt8(0x03, 3);
+
+  // data
+  cmd.writeUInt16LE(handle, 4); // handle
+  cmd.writeUInt8(reason, 6); // reason
+
+  debug('disconnect - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.readRssi = function(handle) {
+  var cmd = new Buffer(6);
+
+  // header
+  cmd.writeUInt8(HCI_COMMAND_PKT, 0);
+  cmd.writeUInt16LE(READ_RSSI_CMD, 1);
+
+  // length
+  cmd.writeUInt8(0x02, 3);
+
+  // data
+  cmd.writeUInt16LE(handle, 4); // handle
+
+  debug('read rssi - writing: ' + cmd.toString('hex'));
+  this._socket.write(cmd);
+};
+
+Hci.prototype.writeAclDataPkt = function(handle, cid, data) {
+  var pkt = new Buffer(9 + data.length);
+
+  // header
+  pkt.writeUInt8(HCI_ACLDATA_PKT, 0);
+  pkt.writeUInt16LE(handle | ACL_START_NO_FLUSH << 12, 1);
+  pkt.writeUInt16LE(data.length + 4, 3); // data length 1
+  pkt.writeUInt16LE(data.length, 5); // data length 2
+  pkt.writeUInt16LE(cid, 7);
+
+  data.copy(pkt, 9);
+
+  debug('write acl data pkt - writing: ' + pkt.toString('hex'));
+  this._socket.write(pkt);
+};
+
+Hci.prototype.onSocketData = function(data) {
+  debug('onSocketData: ' + data.toString('hex'));
+
+  var eventType = data.readUInt8(0);
+  var handle;
+
+  debug('\tevent type = ' + eventType);
+
+  if (HCI_EVENT_PKT === eventType) {
+    var subEventType = data.readUInt8(1);
+
+    debug('\tsub event type = ' + subEventType);
+
+    if (subEventType === EVT_DISCONN_COMPLETE) {
+      handle =  data.readUInt16LE(4);
+      var reason = data.readUInt8(6);
+
+      debug('\t\thandle = ' + handle);
+      debug('\t\treason = ' + reason);
+
+      this.emit('disconnComplete', handle, reason);
+    } else if (subEventType === EVT_ENCRYPT_CHANGE) {
+      handle =  data.readUInt16LE(4);
+      var encrypt = data.readUInt8(6);
+
+      debug('\t\thandle = ' + handle);
+      debug('\t\tencrypt = ' + encrypt);
+
+      this.emit('encryptChange', handle, encrypt);
+    } else if (subEventType === EVT_CMD_COMPLETE) {
+      var cmd = data.readUInt16LE(4);
+      var status = data.readUInt8(6);
+      var result = data.slice(7);
+
+      debug('\t\tcmd = ' + cmd);
+      debug('\t\tstatus = ' + status);
+      debug('\t\tresult = ' + result.toString('hex'));
+
+      this.processCmdCompleteEvent(cmd, status, result);
+    } else if (subEventType === EVT_LE_META_EVENT) {
+      var leMetaEventType = data.readUInt8(3);
+      var leMetaEventStatus = data.readUInt8(4);
+      var leMetaEventData = data.slice(5);
+
+      debug('\t\tLE meta event type = ' + leMetaEventType);
+      debug('\t\tLE meta event status = ' + leMetaEventStatus);
+      debug('\t\tLE meta event data = ' + leMetaEventData.toString('hex'));
+
+      this.processLeMetaEvent(leMetaEventType, leMetaEventStatus, leMetaEventData);
+    }
+  } else if (HCI_ACLDATA_PKT === eventType) {
+    var flags = data.readUInt16LE(1) >> 12;
+    handle = data.readUInt16LE(1) & 0x0fff;
+
+    if (ACL_START === flags) {
+      var cid = data.readUInt16LE(7);
+
+      var length = data.readUInt16LE(5);
+      var pktData = data.slice(9);
+
+      debug('\t\tcid = ' + cid);
+
+      if (length === pktData.length) {
+        debug('\t\thandle = ' + handle);
+        debug('\t\tdata = ' + pktData.toString('hex'));
+
+        this.emit('aclDataPkt', handle, cid, pktData);
+      } else {
+        this._handleBuffers[handle] = {
+          length: length,
+          cid: cid,
+          data: pktData
+        };
+      }
+    } else if (ACL_CONT === flags) {
+      if (!this._handleBuffers[handle] || !this._handleBuffers[handle].data) {
+        return;
+      }
+
+      this._handleBuffers[handle].data = Buffer.concat([
+        this._handleBuffers[handle].data,
+        data.slice(5)
+      ]);
+
+      if (this._handleBuffers[handle].data.length === this._handleBuffers[handle].length) {
+        this.emit('aclDataPkt', handle, this._handleBuffers[handle].cid, this._handleBuffers[handle].data);
+
+        delete this._handleBuffers[handle];
+      }
+    }
+  }
+};
+
+Hci.prototype.onSocketError = function(error) {
+  debug('onSocketError: ' + error.message);
+
+  if (error.message === 'Operation not permitted') {
+    this.emit('stateChange', 'unauthorized');
+  } else if (error.message === 'Network is down') {
+    // no-op
+  }
+};
+
+Hci.prototype.processCmdCompleteEvent = function(cmd, status, result) {
+  var handle;
+
+  if (cmd === RESET_CMD) {
+
+    this.setEventMask();
+    this.setLeEventMask();
+    this.readLocalVersion();
+    this.writeLeHostSupported();
+    this.readLeHostSupported();
+    this.readBdAddr();
+  } else if (cmd === READ_LE_HOST_SUPPORTED_CMD) {
+    if (status === 0) {
+      var le = result.readUInt8(0);
+      var simul = result.readUInt8(1);
+
+      debug('\t\t\tle = ' + le);
+      debug('\t\t\tsimul = ' + simul);
+    }
+  } else if (cmd === READ_LOCAL_VERSION_CMD) {
+    var hciVer = result.readUInt8(0);
+    var hciRev = result.readUInt16LE(1);
+    var lmpVer = result.readInt8(3);
+    var manufacturer = result.readUInt16LE(4);
+    var lmpSubVer = result.readUInt16LE(6);
+
+    if (hciVer < 0x06) {
+      this.emit('stateChange', 'unsupported');
+    } else if (this._state !== 'poweredOn') {
+      this.setAdvertiseEnable(false);
+      this.setAdvertisingParameters();
+    }
+
+    this.emit('readLocalVersion', hciVer, hciRev, lmpVer, manufacturer, lmpSubVer);
+  } else if (cmd === READ_BD_ADDR_CMD) {
+    this.addressType = 'public';
+    this.address = result.toString('hex').match(/.{1,2}/g).reverse().join(':');
+
+    debug('address = ' + this.address);
+
+    this.emit('addressChange', this.address);
+  } else if (cmd === LE_SET_ADVERTISING_PARAMETERS_CMD) {
+    this.emit('stateChange', 'poweredOn');
+
+    this.emit('leAdvertisingParametersSet', status);
+  } else if (cmd === LE_SET_ADVERTISING_DATA_CMD) {
+    this.emit('leAdvertisingDataSet', status);
+  } else if (cmd === LE_SET_SCAN_RESPONSE_DATA_CMD) {
+    this.emit('leScanResponseDataSet', status);
+  } else if (cmd === LE_SET_ADVERTISE_ENABLE_CMD) {
+    this.emit('leAdvertiseEnableSet', status);
+  } else if (cmd === READ_RSSI_CMD) {
+    handle = result.readUInt16LE(0);
+    var rssi = result.readInt8(2);
+
+    debug('\t\t\thandle = ' + handle);
+    debug('\t\t\trssi = ' + rssi);
+
+    this.emit('rssiRead', handle, rssi);
+  } else if (cmd === LE_LTK_NEG_REPLY_CMD) {
+    handle = result.readUInt16LE(0);
+
+    debug('\t\t\thandle = ' + handle);
+    this.emit('leLtkNegReply', handle);
+  }
+};
+
+Hci.prototype.processLeMetaEvent = function(eventType, status, data) {
+  if (eventType === EVT_LE_CONN_COMPLETE) {
+    this.processLeConnComplete(status, data);
+  } else if (eventType === EVT_LE_CONN_UPDATE_COMPLETE) {
+    this.processLeConnUpdateComplete(status, data);
+  }
+};
+
+Hci.prototype.processLeConnComplete = function(status, data) {
+  var handle = data.readUInt16LE(0);
+  var role = data.readUInt8(2);
+  var addressType = data.readUInt8(3) === 0x01 ? 'random': 'public';
+  var address = data.slice(4, 10).toString('hex').match(/.{1,2}/g).reverse().join(':');
+  var interval = data.readUInt16LE(10) * 1.25;
+  var latency = data.readUInt16LE(12); // TODO: multiplier?
+  var supervisionTimeout = data.readUInt16LE(14) * 10;
+  var masterClockAccuracy = data.readUInt8(16); // TODO: multiplier?
+
+  debug('\t\t\thandle = ' + handle);
+  debug('\t\t\trole = ' + role);
+  debug('\t\t\taddress type = ' + addressType);
+  debug('\t\t\taddress = ' + address);
+  debug('\t\t\tinterval = ' + interval);
+  debug('\t\t\tlatency = ' + latency);
+  debug('\t\t\tsupervision timeout = ' + supervisionTimeout);
+  debug('\t\t\tmaster clock accuracy = ' + masterClockAccuracy);
+
+  this.emit('leConnComplete', status, handle, role, addressType, address, interval, latency, supervisionTimeout, masterClockAccuracy);
+};
+
+Hci.prototype.processLeConnUpdateComplete = function(status, data) {
+  var handle = data.readUInt16LE(0);
+  var interval = data.readUInt16LE(2) * 1.25;
+  var latency = data.readUInt16LE(4); // TODO: multiplier?
+  var supervisionTimeout = data.readUInt16LE(6) * 10;
+
+  debug('\t\t\thandle = ' + handle);
+  debug('\t\t\tinterval = ' + interval);
+  debug('\t\t\tlatency = ' + latency);
+  debug('\t\t\tsupervision timeout = ' + supervisionTimeout);
+
+  this.emit('leConnUpdateComplete', status, handle, interval, latency, supervisionTimeout);
+};
+
+Hci.prototype.onStateChange = function(state) {
+  this._state = state;
+};
+
+module.exports = Hci;
diff --git a/src/js/ble_hci_socket_hci_status.js b/src/js/ble_hci_socket_hci_status.js
new file mode 100644 (file)
index 0000000..ef621d7
--- /dev/null
@@ -0,0 +1,103 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+[
+  "Success",
+  "Unknown HCI Command",
+  "Unknown Connection Identifier",
+  "Hardware Failure",
+  "Page Timeout",
+  "Authentication Failure",
+  "PIN or Key Missing",
+  "Memory Capacity Exceeded",
+  "Connection Timeout",
+  "Connection Limit Exceeded",
+  "Synchronous Connection Limit to a Device Exceeded",
+  "ACL Connection Already Exists",
+  "Command Disallowed",
+  "Connection Rejected due to Limited Resources",
+  "Connection Rejected due to Security Reasons",
+  "Connection Rejected due to Unacceptable BD_ADDR",
+  "Connection Accept Timeout Exceeded",
+  "Unsupported Feature or Parameter Value",
+  "Invalid HCI Command Parameters",
+  "Remote User Terminated Connection",
+  "Remote Device Terminated due to Low Resources",
+  "Remote Device Terminated due to Power Off",
+  "Connection Terminated By Local Host",
+  "Repeated Attempts",
+  "Pairing Not Allowed",
+  "Unknown LMP PDU",
+  "Unsupported Remote Feature / Unsupported LMP Feature",
+  "SCO Offset Rejected",
+  "SCO Interval Rejected",
+  "SCO Air Mode Rejected",
+  "Invalid LMP Parameters / Invalid LL Parameters",
+  "Unspecified Error",
+  "Unsupported LMP Parameter Value / Unsupported LL Parameter Value",
+  "Role Change Not Allowed",
+  "LMP Response Timeout / LL Response Timeout",
+  "LMP Error Transaction Collision",
+  "LMP PDU Not Allowed",
+  "Encryption Mode Not Acceptable",
+  "Link Key cannot be Changed",
+  "Requested QoS Not Supported",
+  "Instant Passed",
+  "Pairing With Unit Key Not Supported",
+  "Different Transaction Collision",
+  "Reserved",
+  "QoS Unacceptable Parameter",
+  "QoS Rejected",
+  "Channel Classification Not Supported",
+  "Insufficient Security",
+  "Parameter Out Of Manadatory Range",
+  "Reserved",
+  "Role Switch Pending",
+  "Reserved",
+  "Reserved Slot Violation",
+  "Role Switch Failed",
+  "Extended Inquiry Response Too Large",
+  "Secure Simple Pairing Not Supported By Host",
+  "Host Busy - Pairing",
+  "Connection Rejected due to No Suitable Channel Found",
+  "Controller Busy",
+  "Unacceptable Connection Parameters" ,
+  "Directed Advertising Timeout",
+  "Connection Terminated due to MIC Failure",
+  "Connection Failed to be Established",
+  "MAC Connection Failed",
+  "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging"
+]
diff --git a/src/js/ble_hci_socket_mgmt.js b/src/js/ble_hci_socket_mgmt.js
new file mode 100644 (file)
index 0000000..b147801
--- /dev/null
@@ -0,0 +1,126 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var debug = console.log; // require('debug')('ble_mgmt');
+
+var events = require('events');
+var util = require('util');
+
+var BluetoothHciSocket = require('ble_hci_socket');
+
+var LTK_INFO_SIZE = 36;
+
+var MGMT_OP_LOAD_LONG_TERM_KEYS = 0x0013;
+
+function Mgmt() {
+  this._socket = new BluetoothHciSocket();
+  this._ltkInfos = [];
+
+  this._socket.on('data', this.onSocketData.bind(this));
+  this._socket.on('error', this.onSocketError.bind(this));
+
+  this._socket.bindControl();
+  this._socket.start();
+}
+
+Mgmt.prototype.onSocketData = function(data) {
+  debug('on data ->' + data.toString('hex'));
+};
+
+Mgmt.prototype.onSocketError = function(error) {
+  debug('on error ->' + error.message);
+};
+
+Mgmt.prototype.addLongTermKey = function(address, addressType, authenticated, master, ediv, rand, key) {
+  var ltkInfo = new Buffer(LTK_INFO_SIZE);
+
+  address.copy(ltkInfo, 0);
+  ltkInfo.writeUInt8(addressType.readUInt8(0) + 1, 6); // BDADDR_LE_PUBLIC = 0x01, BDADDR_LE_RANDOM 0x02, so add one
+
+  ltkInfo.writeUInt8(authenticated, 7);
+  ltkInfo.writeUInt8(master, 8);
+  ltkInfo.writeUInt8(key.length, 9);
+
+  ediv.copy(ltkInfo, 10);
+  rand.copy(ltkInfo, 12);
+  key.copy(ltkInfo, 20);
+
+  this._ltkInfos.push(ltkInfo);
+
+  this.loadLongTermKeys();
+};
+
+Mgmt.prototype.clearLongTermKeys = function() {
+  this._ltkInfos = [];
+
+  this.loadLongTermKeys();
+};
+
+Mgmt.prototype.loadLongTermKeys = function() {
+  var numLongTermKeys = this._ltkInfos.length;
+  var op = new Buffer(2 + numLongTermKeys * LTK_INFO_SIZE);
+
+  op.writeUInt16LE(numLongTermKeys, 0);
+
+  for (var i = 0; i < numLongTermKeys; i++) {
+    this._ltkInfos[i].copy(op, 2 + i * LTK_INFO_SIZE);
+  }
+
+  this.write(MGMT_OP_LOAD_LONG_TERM_KEYS, 0, op);
+};
+
+Mgmt.prototype.write = function(opcode, index, data) {
+  var length = 0;
+
+  if (data) {
+    length = data.length;
+  }
+
+  var pkt = new Buffer(6 + length);
+
+  pkt.writeUInt16LE(opcode, 0);
+  pkt.writeUInt16LE(index, 2);
+  pkt.writeUInt16LE(length, 4);
+
+  if (length) {
+    data.copy(pkt, 6);
+  }
+
+  debug('writing -> ' + pkt.toString('hex'));
+  this._socket.write(pkt);
+};
+
+module.exports = new Mgmt();
diff --git a/src/js/ble_hci_socket_smp.js b/src/js/ble_hci_socket_smp.js
new file mode 100644 (file)
index 0000000..e7bc187
--- /dev/null
@@ -0,0 +1,198 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var debug = console.log; // require('debug')('ble_hci_socket_smp');
+
+var events = require('events');
+var util = require('util');
+
+var crypto = require('ble_hci_socket_crypto');
+var mgmt = require('ble_hci_socket_mgmt');
+
+var SMP_CID = 0x0006;
+
+var SMP_PAIRING_REQUEST = 0x01;
+var SMP_PAIRING_RESPONSE = 0x02;
+var SMP_PAIRING_CONFIRM = 0x03;
+var SMP_PAIRING_RANDOM = 0x04;
+var SMP_PAIRING_FAILED = 0x05;
+var SMP_ENCRYPT_INFO = 0x06;
+var SMP_MASTER_IDENT = 0x07;
+
+var SMP_UNSPECIFIED = 0x08;
+
+var Smp = function(aclStream, localAddressType, localAddress, remoteAddressType, remoteAddress) {
+  this._aclStream = aclStream;
+
+  this._iat = new Buffer([(remoteAddressType === 'random') ? 0x01 : 0x00]);
+  this._ia = new Buffer(remoteAddress.split(':').reverse().join(''), 'hex');
+  this._rat = new Buffer([(localAddressType === 'random') ? 0x01 : 0x00]);
+  this._ra = new Buffer(localAddress.split(':').reverse().join(''), 'hex');
+
+  this._stk = null;
+  this._random = null;
+  this._diversifier = null;
+
+  this.onAclStreamDataBinded = this.onAclStreamData.bind(this);
+  this.onAclStreamEncryptChangeBinded = this.onAclStreamEncryptChange.bind(this);
+  this.onAclStreamLtkNegReplyBinded = this.onAclStreamLtkNegReply.bind(this);
+  this.onAclStreamEndBinded = this.onAclStreamEnd.bind(this);
+
+  this._aclStream.on('data', this.onAclStreamDataBinded);
+  this._aclStream.on('encryptChange', this.onAclStreamEncryptChangeBinded);
+  this._aclStream.on('ltkNegReply', this.onAclStreamLtkNegReplyBinded);
+  this._aclStream.on('end', this.onAclStreamEndBinded);
+};
+
+util.inherits(Smp, events.EventEmitter);
+
+Smp.prototype.onAclStreamData = function(cid, data) {
+  if (cid !== SMP_CID) {
+    return;
+  }
+
+  var code = data.readUInt8(0);
+
+  if (SMP_PAIRING_REQUEST === code) {
+    this.handlePairingRequest(data);
+  } else if (SMP_PAIRING_CONFIRM === code) {
+    this.handlePairingConfirm(data);
+  } else if (SMP_PAIRING_RANDOM === code) {
+    this.handlePairingRandom(data);
+  } else if (SMP_PAIRING_FAILED === code) {
+    this.handlePairingFailed(data);
+  }
+};
+
+Smp.prototype.onAclStreamEncryptChange = function(encrypted) {
+  if (encrypted) {
+    if (this._stk && this._diversifier && this._random) {
+      this.write(Buffer.concat([
+        new Buffer([SMP_ENCRYPT_INFO]),
+        this._stk
+      ]));
+
+      this.write(Buffer.concat([
+        new Buffer([SMP_MASTER_IDENT]),
+        this._diversifier,
+        this._random
+      ]));
+    }
+  }
+};
+
+Smp.prototype.onAclStreamLtkNegReply = function() {
+    this.write(new Buffer([
+      SMP_PAIRING_FAILED,
+      SMP_UNSPECIFIED
+    ]));
+
+    this.emit('fail');
+};
+
+Smp.prototype.onAclStreamEnd = function() {
+  this._aclStream.removeListener('data', this.onAclStreamDataBinded);
+  this._aclStream.removeListener('encryptChange', this.onAclStreamEncryptChangeBinded);
+  this._aclStream.removeListener('ltkNegReply', this.onAclStreamLtkNegReplyBinded);
+  this._aclStream.removeListener('end', this.onAclStreamEndBinded);
+};
+
+Smp.prototype.handlePairingRequest = function(data) {
+  this._preq = data;
+
+  this._pres = new Buffer([
+    SMP_PAIRING_RESPONSE,
+    0x03, // IO capability: NoInputNoOutput
+    0x00, // OOB data: Authentication data not present
+    0x01, // Authentication requirement: Bonding - No MITM
+    0x10, // Max encryption key size
+    0x00, // Initiator key distribution: <none>
+    0x01  // Responder key distribution: EncKey
+  ]);
+
+  this.write(this._pres);
+};
+
+Smp.prototype.handlePairingConfirm = function(data) {
+  this._pcnf = data;
+
+  this._tk = new Buffer('00000000000000000000000000000000', 'hex');
+  this._r = crypto.r();
+
+  this.write(Buffer.concat([
+    new Buffer([SMP_PAIRING_CONFIRM]),
+    crypto.c1(this._tk, this._r, this._pres, this._preq, this._iat, this._ia, this._rat, this._ra)
+  ]));
+};
+
+Smp.prototype.handlePairingRandom = function(data) {
+  var r = data.slice(1);
+
+  var pcnf = Buffer.concat([
+    new Buffer([SMP_PAIRING_CONFIRM]),
+    crypto.c1(this._tk, r, this._pres, this._preq, this._iat, this._ia, this._rat, this._ra)
+  ]);
+
+  if (this._pcnf.toString('hex') === pcnf.toString('hex')) {
+    this._diversifier = new Buffer('0000', 'hex');
+    this._random = new Buffer('0000000000000000', 'hex');
+    this._stk = crypto.s1(this._tk, this._r, r);
+
+    mgmt.addLongTermKey(this._ia, this._iat, 0, 0, this._diversifier, this._random, this._stk);
+
+    this.write(Buffer.concat([
+      new Buffer([SMP_PAIRING_RANDOM]),
+      this._r
+    ]));
+  } else {
+    this.write(new Buffer([
+      SMP_PAIRING_FAILED,
+      SMP_PAIRING_CONFIRM
+    ]));
+
+    this.emit('fail');
+  }
+};
+
+Smp.prototype.handlePairingFailed = function(data) {
+  this.emit('fail');
+};
+
+Smp.prototype.write = function(data) {
+  this._aclStream.write(SMP_CID, data);
+};
+
+module.exports = Smp;
diff --git a/src/js/ble_primary_service.js b/src/js/ble_primary_service.js
new file mode 100644 (file)
index 0000000..b9673e5
--- /dev/null
@@ -0,0 +1,58 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var events = require('events');
+var util = require('util');
+
+var debug = console.log; // require('debug')('ble_primary_service');
+
+var UuidUtil = require('ble_uuid_util');
+
+function PrimaryService(options) {
+  this.uuid = UuidUtil.removeDashes(options.uuid);
+  this.characteristics = options.characteristics || [];
+}
+
+util.inherits(PrimaryService, events.EventEmitter);
+
+PrimaryService.prototype.toString = function() {
+  return JSON.stringify({
+    uuid: this.uuid,
+    characteristics: this.characteristics
+  });
+};
+
+module.exports = PrimaryService;
diff --git a/src/js/ble_uuid_util.js b/src/js/ble_uuid_util.js
new file mode 100644 (file)
index 0000000..c8ee3d3
--- /dev/null
@@ -0,0 +1,43 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+module.exports.removeDashes = function(uuid) {
+  if (uuid) {
+    uuid = uuid.replace(/-/g, '');
+  }
+
+  return uuid;
+};
diff --git a/src/js/buffer.js b/src/js/buffer.js
new file mode 100644 (file)
index 0000000..c4ef579
--- /dev/null
@@ -0,0 +1,318 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var bufferBuiltin = process.binding(process.binding.buffer);
+var util = require('util');
+
+
+function checkInt(buffer, value, offset, ext, max, min) {
+  if (value > max || value < min)
+    throw new TypeError('value is out of bounds');
+  if (offset + ext > buffer.length)
+    throw new RangeError('index out of range');
+}
+
+
+function checkOffset(offset, ext, length) {
+  if (offset + ext > length)
+    throw new RangeError('index out of range');
+}
+
+
+// Buffer constructor
+// [1] new Buffer(size)
+// [2] new Buffer(buffer)
+// [3] new Buffer(string)
+// [4] new Buffer(string, encoding)
+// [5] new Buffer(array)
+function Buffer(subject, encoding) {
+  if (!util.isBuffer(this)) {
+    return new Buffer(subject);
+  }
+
+  if (util.isNumber(subject)) {
+    this.length = subject > 0 ? subject >>> 0 : 0;
+  } else if (util.isString(subject)) {
+    this.length = Buffer.byteLength(subject, encoding);
+  } else if (util.isBuffer(subject) || util.isArray(subject)) {
+    this.length = subject.length;
+  } else {
+    throw new TypeError('Bad arguments: Buffer(string|number|Buffer|Array)');
+  }
+
+  this._builtin = new bufferBuiltin(this, this.length);
+
+  if (util.isString(subject)) {
+    if (!util.isUndefined(encoding) && util.isString(encoding)) {
+      switch (encoding) {
+        case 'hex':
+          if (this._builtin.hexWrite(subject, 0, this.length) != this.length) {
+            throw new TypeError('Invalid hex string');
+          }
+          break;
+        default:
+          this.write(subject);
+      }
+    } else {
+      this.write(subject);
+    }
+  } else if (util.isBuffer(subject)) {
+    subject.copy(this);
+  } else if (util.isArray(subject)) {
+    for (var i = 0; i < this.length; ++i) {
+      this._builtin.writeUInt8(subject[i], i);
+    }
+  }
+}
+
+
+// Buffer.byteLength(string)
+Buffer.byteLength = function(str, encoding) {
+  var len = bufferBuiltin.byteLength(str);
+
+  if (!util.isUndefined(encoding) && util.isString(encoding)) {
+    switch (encoding) {
+      case 'hex':
+        return len >>> 1;
+    }
+  }
+  return len;
+};
+
+
+// Buffer.concat(list)
+Buffer.concat = function(list) {
+  if (!util.isArray(list)) {
+    throw new TypeError('Bad arguments: Buffer.concat([Buffer])');
+  }
+
+  var length = 0;
+  for (var i = 0; i < list.length; ++i) {
+    if (!util.isBuffer(list[i])) {
+      throw new TypeError('Bad arguments: Buffer.concat([Buffer])');
+    }
+    length += list[i].length;
+  }
+
+  var buffer = new Buffer(length);
+  var pos = 0;
+  for (var i = 0; i < list.length; ++i) {
+    list[i].copy(buffer, pos);
+    pos += list[i].length;
+  }
+
+  return buffer;
+};
+
+
+// Buffer.isBuffer(object)
+Buffer.isBuffer = function(object) {
+  return util.isBuffer(object);
+};
+
+
+// buffer.equals(otherBuffer)
+Buffer.prototype.equals = function(otherBuffer) {
+  if (!util.isBuffer(otherBuffer)) {
+    throw new TypeError('Bad arguments: buffer.equals(Buffer)');
+  }
+
+  return this._builtin.compare(otherBuffer._builtin) == 0;
+};
+
+
+// buffer.compare(otherBuffer)
+Buffer.prototype.compare = function(otherBuffer) {
+  if (!util.isBuffer(otherBuffer)) {
+    throw new TypeError('Bad arguments: buffer.compare(Buffer)');
+  }
+
+  return this._builtin.compare(otherBuffer._builtin);
+};
+
+
+// buffer.copy(target[, targetStart[, sourceStart[, sourceEnd]]])
+// [1] buffer.copy(target)
+// [2] buffer.copy(target, targetStart)
+// [3] buffer.copy(target, targetStart, sourceStart)
+// [4] buffer.copy(target, targetStart, sourceStart, sourceEnd)
+// * targetStart - default to 0
+// * sourceStart - default to 0
+// * sourceEnd - default to buffer.length
+Buffer.prototype.copy = function(target, targetStart, sourceStart, sourceEnd) {
+  if (!util.isBuffer(target)) {
+    throw new TypeError('Bad arguments: buff.copy(Buffer)');
+  }
+
+  targetStart = util.isUndefined(targetStart) ? 0 : ~~targetStart;
+  sourceStart = util.isUndefined(sourceStart) ? 0 : ~~sourceStart;
+  sourceEnd = util.isUndefined(sourceEnd) ? this.length : ~~ sourceEnd;
+
+  if ((sourceEnd > sourceStart) && (targetStart < 0)) {
+    throw new RangeError('Attempt to write outside buffer bounds');
+  }
+
+  return this._builtin.copy(target, targetStart, sourceStart, sourceEnd);
+};
+
+
+// buffer.write(string[, offset[, length]])
+// [1] buffer.write(string)
+// [2] buffer.write(string, offset)
+// [3] buffer.write(string, offset, length)
+// * offset - default to 0
+// * length - default to buffer.length - offset
+Buffer.prototype.write = function(string, offset, length) {
+  if (!util.isString(string)) {
+    throw new TypeError('Bad arguments: buff.write(string)');
+  }
+
+  offset = util.isUndefined(offset) ? 0 : ~~offset;
+  if (string.length > 0 && (offset < 0 || offset >= this.length)) {
+    throw new RangeError('Attempt to write outside buffer bounds');
+  }
+
+  var remaining = this.length - offset;
+  length = util.isUndefined(length) ? remaining : ~~length;
+
+  return this._builtin.write(string, offset, length);
+};
+
+
+// buff.slice([start[, end]])
+// [1] buff.slice()
+// [2] buff.slice(start)
+// [3] buff.slice(start, end)
+// * start - default to 0
+// * end - default to buff.length
+Buffer.prototype.slice = function(start, end) {
+  start = util.isUndefined(start) ? 0 : ~~start;
+  end = util.isUndefined(end) ? this.length : ~~end;
+
+  return this._builtin.slice(start, end);
+};
+
+
+// buff.toString([encoding,[,start[, end]]])
+// [1] buff.toString()
+// [2] buff.toString(start)
+// [3] buff.toString(start, end)
+// [4] buff.toString('hex')
+// * start - default to 0
+// * end - default to buff.length
+Buffer.prototype.toString = function(start, end) {
+  if (util.isString(start) && start === "hex" && util.isUndefined(end)) {
+      return this._builtin.toHexString();
+  }
+  start = util.isUndefined(start) ? 0 : ~~start;
+  end = util.isUndefined(end) ? this.length : ~~end;
+
+  return this._builtin.toString(start, end);
+};
+
+
+// buff.writeUInt8(value, offset[,noAssert])
+// [1] buff.writeUInt8(value, offset)
+// [2] buff.writeUInt8(value, offset, noAssert)
+Buffer.prototype.writeUInt8 = function(value, offset, noAssert) {
+  value = +value;
+  offset = offset >>> 0;
+  if (!noAssert)
+    checkInt(this, value, offset, 1, 0xff, 0);
+  this._builtin.writeUInt8(value & 0xff, offset);
+  return offset + 1;
+};
+
+
+// buff.writeUInt16LE(value, offset[,noAssert])
+// [1] buff.writeUInt16LE(value, offset)
+// [2] buff.writeUInt16LE(value, offset, noAssert)
+Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) {
+  value = +value;
+  offset = offset >>> 0;
+  if (!noAssert)
+    checkInt(this, value, offset, 2, 0xffff, 0);
+  this._builtin.writeUInt8(value & 0xff, offset);
+  this._builtin.writeUInt8((value >>> 8) & 0xff, offset + 1);
+  return offset + 2;
+};
+
+
+// buff.writeUInt32LE(value, offset[,noAssert])
+// [1] buff.writeUInt32LE(value, offset)
+// [2] buff.writeUInt32LE(value, offset, noAssert)
+Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) {
+  value = +value;
+  offset = offset >>> 0;
+  if (!noAssert)
+    checkInt(this, value, offset, 4, 0xffffffff, 0);
+  this._builtin.writeUInt8((value >>> 24) & 0xff, offset + 3);
+  this._builtin.writeUInt8((value >>> 16) & 0xff, offset + 2);
+  this._builtin.writeUInt8((value >>> 8) & 0xff, offset + 1);
+  this._builtin.writeUInt8(value & 0xff, offset);
+  return offset + 4;
+};
+
+
+// buff.readUInt8(offset[,noAssert])
+// [1] buff.readUInt8(offset)
+// [2] buff.readUInt8(offset, noAssert)
+Buffer.prototype.readUInt8 = function(offset, noAssert) {
+  offset = offset >>> 0;
+  if (!noAssert)
+    checkOffset(offset, 1, this.length);
+  return this._builtin.readUInt8(offset);
+};
+
+
+// buff.readInt8(offset[,noAssert])
+// [1] buff.readInt8(offset)
+// [2] buff.readInt8(offset, noAssert)
+Buffer.prototype.readInt8 = function(offset, noAssert) {
+  offset = offset >>> 0;
+  if (!noAssert)
+    checkOffset(offset, 1, this.length);
+  var val = this._builtin.readUInt8(offset);
+  return !(val & 0x80) ? val : (0xff - val + 1) * -1;
+};
+
+
+// buff.readUInt16LE(offset[,noAssert])
+// [1] buff.readUInt16LE(offset)
+// [2] buff.readUInt16LE(offset, noAssert)
+Buffer.prototype.readUInt16LE = function(offset, noAssert) {
+  offset = offset >>> 0;
+  if (!noAssert)
+    checkOffset(offset, 2, this.length);
+  return this._builtin.readUInt8(offset) |
+         (this._builtin.readUInt8(offset + 1) << 8);
+};
+
+
+// buff.fill(value)
+Buffer.prototype.fill = function(value) {
+  if (util.isNumber(value)) {
+    value = value & 255;
+    for (var i = 0; i < this.length; i++) {
+      this._builtin.writeUInt8(value, i);
+    }
+  }
+  return this;
+};
+
+
+module.exports = Buffer;
+module.exports.Buffer = Buffer;
diff --git a/src/js/console.js b/src/js/console.js
new file mode 100644 (file)
index 0000000..3d1dfa1
--- /dev/null
@@ -0,0 +1,38 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var util = require('util');
+var consoleBuiltin = process.binding(process.binding.console);
+
+
+function Console() {
+}
+
+
+Console.prototype.log =
+Console.prototype.info = function() {
+  consoleBuiltin.stdout(util.format.apply(this, arguments) + '\n');
+};
+
+
+Console.prototype.warn =
+Console.prototype.error = function() {
+  consoleBuiltin.stderr(util.format.apply(this, arguments) + '\n');
+};
+
+
+module.exports = new Console();
+module.exports.Console = Console;
diff --git a/src/js/constants.js b/src/js/constants.js
new file mode 100644 (file)
index 0000000..a2f9e4d
--- /dev/null
@@ -0,0 +1,17 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+module.exports = process.binding(process.binding.constants);
diff --git a/src/js/dgram.js b/src/js/dgram.js
new file mode 100644 (file)
index 0000000..8d9f0b4
--- /dev/null
@@ -0,0 +1,480 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var util = require('util');
+
+var UDP = process.binding(process.binding.udp);
+
+var BIND_STATE_UNBOUND = 0;
+var BIND_STATE_BINDING = 1;
+var BIND_STATE_BOUND = 2;
+
+// lazily loaded
+var dns = null;
+
+function lookup(address, family, callback) {
+  if (!dns)
+    dns = require('dns');
+
+  return dns.lookup(address, family, callback);
+}
+
+
+function lookup4(address, callback) {
+  return lookup(address || '0.0.0.0', 4, callback);
+}
+
+
+function newHandle(type) {
+  if (type == 'udp4') {
+    var handle = new UDP();
+    handle.lookup = lookup4;
+    return handle;
+  }
+
+  throw new Error('Bad socket type specified. Valid types are: udp4');
+}
+
+
+function Socket(type, listener) {
+  EventEmitter.call(this);
+  var options = undefined;
+
+  if (util.isObject(type)) {
+    options = type;
+    type = options.type;
+  }
+
+  var handle = newHandle(type);
+  handle.owner = this;
+
+  this._handle = handle;
+  this._receiving = false;
+  this._bindState = BIND_STATE_UNBOUND;
+  this.type = type;
+  this.fd = null; // compatibility hack
+
+  // If true - UV_UDP_REUSEADDR flag will be set
+  this._reuseAddr = options && options.reuseAddr;
+
+  if (util.isFunction(listener))
+    this.on('message', listener);
+}
+util.inherits(Socket, EventEmitter);
+exports.Socket = Socket;
+
+exports.createSocket = function(type, listener) {
+  return new Socket(type, listener);
+};
+
+
+function startListening(socket) {
+  socket._handle.onmessage = onMessage;
+  // Todo: handle errors
+  socket._handle.recvStart();
+  socket._receiving = true;
+  socket._bindState = BIND_STATE_BOUND;
+  socket.fd = -42; // compatibility hack
+
+  socket.emit('listening');
+}
+
+
+Socket.prototype.bind = function(port, address, callback) {
+  var self = this;
+
+  self._healthCheck();
+
+  if (this._bindState != BIND_STATE_UNBOUND)
+    throw new Error('Socket is already bound');
+
+  this._bindState = BIND_STATE_BINDING;
+
+  var address;
+
+  if (util.isFunction(port)) {
+    callback = port;
+    port = 0;
+    address = '';
+  } else if (util.isObject(port)) {
+    callback = address;
+    address = port.address || '';
+    port = port.port;
+  } else if (util.isFunction(address)) {
+    callback = address;
+    address = '';
+  }
+
+  if (util.isFunction(callback))
+    self.once('listening', callback);
+
+  // defaulting address for bind to all interfaces
+  if (!address && self._handle.lookup === lookup4) {
+    address = '0.0.0.0';
+  }
+
+  // resolve address first
+  self._handle.lookup(address, function(err, ip) {
+    if (err) {
+      self._bindState = BIND_STATE_UNBOUND;
+      self.emit('error', err);
+      return;
+    }
+
+    if (!self._handle)
+      return; // handle has been closed in the mean time
+
+    self._handle._reuseAddr = self._reuseAddr;
+
+    var err = self._handle.bind(ip, port | 0);
+    if (err) {
+      var ex = util.exceptionWithHostPort(err, 'bind', ip, port);
+      self.emit('error', ex);
+      self._bindState = BIND_STATE_UNBOUND;
+      // Todo: close?
+      return;
+    }
+
+    startListening(self);
+  });
+
+  return self;
+}
+
+
+// thin wrapper around `send`, here for compatibility with dgram_legacy.js
+Socket.prototype.sendto = function(buffer, offset, length, port, address,
+                                   callback) {
+  if (!(util.isNumber(offset)) || !(util.isNumber(length)))
+    throw new Error('send takes offset and length as args 2 and 3');
+
+  if (!(util.isString(address)))
+    throw new Error(this.type + ' sockets must send to port, address');
+
+  this.send(buffer, offset, length, port, address, callback);
+};
+
+
+function sliceBuffer(buffer, offset, length) {
+  if (util.isString(buffer))
+    buffer = new Buffer(buffer);
+  else if (!(util.isBuffer(buffer)))
+    throw new TypeError('First argument must be a buffer or string');
+
+  offset = offset >>> 0;
+  length = length >>> 0;
+
+  return buffer.slice(offset, offset + length);
+}
+
+
+function fixBufferList(list) {
+  var newlist = new Array(list.length);
+
+  for (var i = 0, l = list.length; i < l; i++) {
+    var buf = list[i];
+    if (util.isString(buf))
+      newlist[i] = new Buffer(buf);
+    else if (!(util.isBuffer(buf)))
+      return null;
+    else
+      newlist[i] = buf;
+  }
+
+  return newlist;
+}
+
+
+function enqueue(self, toEnqueue) {
+  // If the send queue hasn't been initialized yet, do it, and install an
+  // event handler that flushes the send queue after binding is done.
+  if (!self._queue) {
+    self._queue = [];
+    self.once('listening', clearQueue);
+  }
+  self._queue.push(toEnqueue);
+  return;
+}
+
+
+function clearQueue() {
+  var queue = this._queue;
+  this._queue = undefined;
+
+  // Flush the send queue.
+  for (var i = 0; i < queue.length; i++)
+    queue[i]();
+}
+
+
+// valid combinations
+// send(buffer, offset, length, port, address, callback)
+// send(buffer, offset, length, port, address)
+// send(buffer, offset, length, port)
+// send(bufferOrList, port, address, callback)
+// send(bufferOrList, port, address)
+// send(bufferOrList, port)
+Socket.prototype.send = function(buffer, offset, length, port, address,
+                                 callback) {
+  var self = this;
+  var list;
+
+  if (address || (port && !(util.isFunction(port)))) {
+    buffer = sliceBuffer(buffer, offset, length);
+  } else {
+    callback = port;
+    port = offset;
+    address = length;
+  }
+
+  if (!util.isArray(buffer)) {
+    if (util.isString(buffer)) {
+      list = [ new Buffer(buffer) ];
+    } else if (!util.isBuffer(buffer)) {
+      throw new TypeError('First argument must be a buffer or a string');
+    } else {
+      list = [ buffer ];
+    }
+  } else if (!(list = fixBufferList(buffer))) {
+    throw new TypeError('Buffer list arguments must be buffers or strings');
+  }
+
+  port = port >>> 0;
+
+  if (port === 0 || port > 65535)
+    throw new RangeError('Port should be > 0 and < 65536');
+
+  // Normalize callback so it's either a function or undefined but not anything
+  // else.
+  if (!(util.isFunction(callback)))
+    callback = undefined;
+
+  self._healthCheck();
+
+  if (self._bindState === BIND_STATE_UNBOUND)
+    self.bind(0, null);
+
+  if (list.length === 0)
+    list.push(new Buffer(0));
+
+  // If the socket hasn't been bound yet, push the outbound packet onto the
+  // send queue and send after binding is complete.
+  if (self._bindState !== BIND_STATE_BOUND) {
+    enqueue(self, self.send.bind(self, list, port, address, callback));
+    return;
+  }
+
+  self._handle.lookup(address, function afterDns(ex, ip) {
+    doSend(ex, self, ip, list, address, port, callback);
+  });
+};
+
+
+function doSend(ex, self, ip, list, address, port, callback) {
+  if (ex) {
+    if (util.isFunction(callback)) {
+      callback(ex);
+      return;
+    }
+
+    self.emit('error', ex);
+    return;
+  } else if (!self._handle) {
+    return;
+  }
+
+  var buf = Buffer.concat(list);
+
+  var err = self._handle.send(buf, port, ip, function (err, length) {
+    if (err) {
+      err = util.exceptionWithHostPort(err, 'send', address, port);
+    } else {
+      err = null;
+    }
+
+    if (util.isFunction(callback)) {
+      callback(err, length);
+    }
+  });
+
+  if (err && callback) {
+    // don't emit as error, dgram_legacy.js compatibility
+    var ex = exceptionWithHostPort(err, 'send', address, port);
+    process.nextTick(callback, ex);
+  }
+}
+
+
+Socket.prototype.close = function(callback) {
+  if (util.isFunction(callback))
+    this.on('close', callback);
+
+  if (this._queue) {
+    this._queue.push(this.close.bind(this));
+    return this;
+  }
+
+  this._healthCheck();
+  this._stopReceiving();
+  this._handle.close();
+  this._handle = null;
+  var self = this;
+  process.nextTick(function() {
+    self.emit('close');
+  });
+
+  return this;
+};
+
+
+Socket.prototype.address = function() {
+  this._healthCheck();
+
+  var out = {};
+  var err = this._handle.getsockname(out);
+  if (err) {
+    throw util.errnoException(err, 'getsockname');
+  }
+
+  return out;
+};
+
+
+Socket.prototype.setBroadcast = function(arg) {
+  var err = this._handle.setBroadcast(arg ? 1 : 0);
+  if (err) {
+    throw util.errnoException(err, 'setBroadcast');
+  }
+};
+
+
+Socket.prototype.setTTL = function(arg) {
+  if (!(util.isNumber(arg))) {
+    throw new TypeError('Argument must be a number');
+  }
+
+  var err = this._handle.setTTL(arg);
+  if (err) {
+    throw util.errnoException(err, 'setTTL');
+  }
+
+  return arg;
+};
+
+
+Socket.prototype.setMulticastTTL = function(arg) {
+  if (!(util.isNumber(arg))) {
+    throw new TypeError('Argument must be a number');
+  }
+
+  var err = this._handle.setMulticastTTL(arg);
+  if (err) {
+    throw util.errnoException(err, 'setMulticastTTL');
+  }
+
+  return arg;
+};
+
+
+Socket.prototype.setMulticastLoopback = function(arg) {
+  var err = this._handle.setMulticastLoopback(arg ? 1 : 0);
+  if (err) {
+    throw util.errnoException(err, 'setMulticastLoopback');
+  }
+
+  return arg; // 0.4 compatibility
+};
+
+
+Socket.prototype.addMembership = function(multicastAddress,
+                                          interfaceAddress) {
+  this._healthCheck();
+
+  if (!multicastAddress) {
+    throw new Error('multicast address must be specified');
+  }
+
+  var err = this._handle.addMembership(multicastAddress, interfaceAddress);
+  if (err) {
+    throw util.errnoException(err, 'addMembership');
+  }
+};
+
+
+Socket.prototype.dropMembership = function(multicastAddress,
+                                           interfaceAddress) {
+  this._healthCheck();
+
+  if (!multicastAddress) {
+    throw new Error('multicast address must be specified');
+  }
+
+  var err = this._handle.dropMembership(multicastAddress, interfaceAddress);
+  if (err) {
+    throw util.errnoException(err, 'dropMembership');
+  }
+};
+
+
+Socket.prototype._healthCheck = function() {
+  if (!this._handle)
+    throw new Error('Not running'); // error message from dgram_legacy.js
+};
+
+
+Socket.prototype._stopReceiving = function() {
+  if (!this._receiving)
+    return;
+
+  this._handle.recvStop();
+  this._receiving = false;
+  this.fd = null; // compatibility hack
+};
+
+
+function onMessage(nread, handle, buf, rinfo) {
+  var self = handle.owner;
+  if (nread < 0) {
+    return self.emit('error', errnoException(nread, 'recvmsg'));
+  }
+
+  rinfo.size = buf.length; // compatibility
+  self.emit('message', buf, rinfo);
+}
+
+
+/*
+TODO: Implement Socket.prototype.ref.
+
+Socket.prototype.ref = function() {
+  if (this._handle)
+    this._handle.ref();
+
+  return this;
+};
+*/
+
+
+/*
+TODO: Implement Socket.prototype.unref.
+
+Socket.prototype.unref = function() {
+  if (this._handle)
+    this._handle.unref();
+
+  return this;
+};
+*/
diff --git a/src/js/dns.js b/src/js/dns.js
new file mode 100644 (file)
index 0000000..1a49965
--- /dev/null
@@ -0,0 +1,92 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+var dnsBuiltin = process.binding(process.binding.dns);
+
+function dnsException(err, syscall, hostname) {
+  var ex = new Error(syscall + ' ' + err + (hostname ? ' ' + hostname : ''));
+  // TODO(hanjoung.lee@samsung.com) err should be a string (currently a number)
+  ex.code = err;
+  ex.errno = err;
+  ex.syscall = syscall;
+  if (hostname) {
+    ex.hostname = hostname;
+  }
+  return ex;
+}
+
+
+exports.lookup = function lookup(hostname, options, callback) {
+  var hints = 0;
+  var family = -1;
+
+  // Parse arguments
+  if (!util.isString(hostname)) {
+    throw TypeError('invalid argument: hostname must be a string');
+  }
+  if (util.isFunction(options)) {
+    callback = options;
+    family = 0;
+  } else if (!util.isFunction(callback)) {
+    throw TypeError('invalid argument: callback must be passed');
+  } else if (util.isObject(options)) {
+    hints = options.hints >>> 0;
+    family = options.family >>> 0;
+
+    if (hints < 0 || hints > (exports.ADDRCONFIG | exports.V4MAPPED)) {
+      throw new TypeError('invalid argument: invalid hints flags');
+    }
+  } else if (util.isNumber(options)) {
+    family = ~~options;
+  } else {
+    throw TypeError(
+        'invalid argument: options must be either an object or number');
+  }
+
+  if (family !== 0 && family !== 4 && family !== 6)
+    throw new TypeError('invalid argument: family must be 4 or 6');
+
+  function getaddrinfo() {
+    var err = dnsBuiltin.getaddrinfo(
+      hostname,
+      family,
+      hints,
+      function(err, address, family) {
+        var errObj = null;
+        if (err) {
+          errObj = dnsException(err, 'getaddrinfo', hostname);
+        }
+        callback(errObj, address, family);
+      });
+      if (err) {
+        callback(dnsException(err, 'getaddrinfo', hostname), address, family);
+      }
+    }
+  if (process.platform != 'nuttx' && process.platform != 'tizenrt') {
+    getaddrinfo();
+  } else {
+    // dnsBuiltin.getaddrinfo is synchronous on these platforms.
+    // needs to be wrapped into an asynchronous call.
+    process.nextTick(function() {
+      getaddrinfo()
+    });
+  }
+};
+
+
+// uv_getaddrinfo flags
+exports.ADDRCONFIG = dnsBuiltin.AI_ADDRCONFIG;
+exports.V4MAPPED = dnsBuiltin.AI_V4MAPPED;
diff --git a/src/js/events.js b/src/js/events.js
new file mode 100644 (file)
index 0000000..992e661
--- /dev/null
@@ -0,0 +1,129 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var util = require('util');
+
+
+function EventEmitter() {
+  this._events = {};
+};
+
+module.exports.EventEmitter = EventEmitter;
+
+
+EventEmitter.prototype.emit = function(type) {
+  if (!this._events) {
+    this._events = {};
+  }
+
+  // About to emit 'error' event but there are no listeners for it.
+  if (type === 'error' && !this._events.error) {
+    var err = arguments[1];
+    if (err instanceof Error) {
+      throw err;
+    } else {
+      throw Error("Uncaught 'error' event");
+    }
+  }
+
+  var listeners = this._events[type];
+  if (util.isArray(listeners)) {
+    listeners = listeners.slice();
+    var args = Array.prototype.slice.call(arguments, 1);
+    for (var i = 0; i < listeners.length; ++i) {
+      listeners[i].apply(this, args);
+    }
+    return true;
+  }
+
+  return false;
+};
+
+
+EventEmitter.prototype.addListener = function(type, listener) {
+  if (!util.isFunction(listener)) {
+    throw new TypeError('listener must be a function');
+  }
+
+  if (!this._events) {
+    this._events = {};
+  }
+  if (!this._events[type]) {
+    this._events[type] = [];
+  }
+
+  this._events[type].push(listener);
+
+  return this;
+};
+
+
+EventEmitter.prototype.on = EventEmitter.prototype.addListener;
+
+
+EventEmitter.prototype.once = function(type, listener) {
+  if (!util.isFunction(listener)) {
+    throw new TypeError('listener must be a function');
+  }
+
+  var f = function() {
+    // here `this` is this not global, because EventEmitter binds event object
+    // for this when it calls back the handler.
+    this.removeListener(f.type, f);
+    f.listener.apply(this, arguments);
+  };
+
+  f.type = type;
+  f.listener = listener;
+
+  this.on(type, f);
+
+  return this;
+};
+
+
+EventEmitter.prototype.removeListener = function(type, listener) {
+  if (!util.isFunction(listener)) {
+    throw new TypeError('listener must be a function');
+  }
+
+  var list = this._events[type];
+  if (Array.isArray(list)) {
+    for (var i = list.length - 1; i >= 0; --i) {
+      if (list[i] == listener ||
+          (list[i].listener && list[i].listener == listener)) {
+        list.splice(i, 1);
+        if (!list.length) {
+          delete this._events[type];
+        }
+        break;
+      }
+    }
+  }
+
+  return this;
+};
+
+
+EventEmitter.prototype.removeAllListeners = function(type) {
+  if (arguments.length === 0) {
+    this._events = {};
+  } else {
+    delete this._events[type];
+  }
+
+  return this;
+};
diff --git a/src/js/fs.js b/src/js/fs.js
new file mode 100644 (file)
index 0000000..90b6536
--- /dev/null
@@ -0,0 +1,470 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var fs = exports;
+var constants = require('constants');
+var util = require('util');
+var fsBuiltin = process.binding(process.binding.fs);
+
+fs.exists = function(path, callback) {
+  if (!path || !path.length) {
+    process.nextTick(function () {
+      if (callback) callback(false);
+    });
+    return;
+  }
+
+  var cb = function(err, stat) {
+    if (callback) callback(err ? false : true);
+  };
+
+  fsBuiltin.stat(checkArgString(path, 'path'),
+                 checkArgFunction(cb, 'callback'));
+};
+
+
+fs.existsSync = function(path) {
+  if (!path || !path.length) {
+    return false;
+  }
+
+  try {
+    fsBuiltin.stat(checkArgString(path, 'path'));
+    return true;
+  } catch (e) {
+    return false;
+  }
+};
+
+
+fs.stat = function(path, callback) {
+  fsBuiltin.stat(checkArgString(path, 'path'),
+                 checkArgFunction(callback, 'callback'));
+};
+
+
+fs.statSync = function(path) {
+  return fsBuiltin.stat(checkArgString(path, 'path'));
+};
+
+
+fs.fstat = function(fd, callback) {
+  fsBuiltin.fstat(checkArgNumber(fd, 'fd'),
+                  checkArgFunction(callback, 'callback'));
+};
+
+
+fs.fstatSync = function(fd) {
+  return fsBuiltin.fstat(checkArgNumber(fd, 'fd'));
+};
+
+
+fs.close = function(fd, callback) {
+  fsBuiltin.close(checkArgNumber(fd, 'fd'),
+                  checkArgFunction(callback, 'callback'));
+};
+
+
+fs.closeSync = function(fd) {
+  fsBuiltin.close(checkArgNumber(fd, 'fd'));
+};
+
+
+fs.open = function(path, flags, mode, callback) {
+  fsBuiltin.open(checkArgString(path, 'path'),
+                 convertFlags(flags),
+                 convertMode(mode, 438),
+                 checkArgFunction(arguments[arguments.length - 1]), 'callback');
+};
+
+
+fs.openSync = function(path, flags, mode) {
+  return fsBuiltin.open(checkArgString(path, 'path'),
+                        convertFlags(flags),
+                        convertMode(mode, 438));
+};
+
+
+fs.read = function(fd, buffer, offset, length, position, callback) {
+  if (util.isNullOrUndefined(position)) {
+    position = -1; // Read from the current position.
+  }
+
+  callback = checkArgFunction(callback, 'callback');
+
+  var cb = function(err, bytesRead) {
+    callback(err, bytesRead || 0, buffer);
+  };
+
+  return fsBuiltin.read(checkArgNumber(fd, 'fd'),
+                        checkArgBuffer(buffer, 'buffer'),
+                        checkArgNumber(offset, 'offset'),
+                        checkArgNumber(length, 'length'),
+                        checkArgNumber(position, 'position'),
+                        cb);
+};
+
+
+fs.readSync = function(fd, buffer, offset, length, position) {
+  if (util.isNullOrUndefined(position)) {
+    position = -1; // Read from the current position.
+  }
+
+  return fsBuiltin.read(checkArgNumber(fd, 'fd'),
+                        checkArgBuffer(buffer, 'buffer'),
+                        checkArgNumber(offset, 'offset'),
+                        checkArgNumber(length, 'length'),
+                        checkArgNumber(position, 'position'));
+};
+
+
+fs.write = function(fd, buffer, offset, length, position, callback) {
+  if (util.isFunction(position)) {
+    callback = position;
+    position = -1; // write at current position.
+  } else if (util.isNullOrUndefined(position)) {
+    position = -1; // write at current position.
+  }
+
+  callback = checkArgFunction(callback, 'callback');
+
+  var cb = function(err, written) {
+    callback(err, written, buffer);
+  };
+
+  return fsBuiltin.write(checkArgNumber(fd, 'fd'),
+                         checkArgBuffer(buffer, 'buffer'),
+                         checkArgNumber(offset, 'offset'),
+                         checkArgNumber(length, 'length'),
+                         checkArgNumber(position, 'position'),
+                         cb);
+};
+
+
+fs.writeSync = function(fd, buffer, offset, length, position) {
+  if (util.isNullOrUndefined(position)) {
+    position = -1; // write at current position.
+  }
+
+  return fsBuiltin.write(checkArgNumber(fd, 'fd'),
+                         checkArgBuffer(buffer, 'buffer'),
+                         checkArgNumber(offset, 'offset'),
+                         checkArgNumber(length, 'length'),
+                         checkArgNumber(position, 'position'));
+};
+
+
+fs.readFile = function(path, callback) {
+  checkArgString(path);
+  checkArgFunction(callback);
+
+  var fd;
+  var buffers;
+
+  fs.open(path, 'r', function(err, _fd) {
+    if (err) {
+      return callback(err);
+    }
+
+    fd = _fd;
+    buffers = [];
+
+    // start read
+    read();
+  });
+
+  var read = function() {
+    // Read segment of data.
+    var buffer = new Buffer(1023);
+    fs.read(fd, buffer, 0, 1023, -1, afterRead);
+  };
+
+  var afterRead = function(err, bytesRead, buffer) {
+    if (err) {
+      fs.close(fd, function(err) {
+        return callback(err);
+      });
+    }
+
+    if (bytesRead === 0) {
+      // End of file.
+      close();
+    } else {
+      // continue reading.
+      buffers.push(buffer.slice(0, bytesRead));
+      read();
+    }
+  };
+
+  var close = function() {
+    fs.close(fd, function(err) {
+      return callback(err, Buffer.concat(buffers));
+    });
+  }
+};
+
+
+fs.readFileSync = function(path) {
+  checkArgString(path);
+
+  var fd = fs.openSync(path, 'r', 438);
+  var buffers = [];
+
+  while (true) {
+    try {
+      var buffer = new Buffer(1023);
+      var bytesRead = fs.readSync(fd, buffer, 0, 1023);
+      if (bytesRead) {
+        buffers.push(buffer.slice(0, bytesRead));
+      } else {
+        break;
+      }
+    } catch (e) {
+      break;
+    }
+  }
+  fs.closeSync(fd);
+
+  return Buffer.concat(buffers);
+};
+
+
+fs.writeFile = function(path, data, callback) {
+  checkArgString(path);
+  checkArgFunction(callback);
+
+  var fd;
+  var len;
+  var bytesWritten;
+  var buffer = ensureBuffer(data);
+
+  fs.open(path, 'w', function(err, _fd) {
+    if (err) {
+      return callback(err);
+    }
+
+    fd = _fd;
+    len = buffer.length;
+    bytesWritten = 0;
+
+    write();
+  });
+
+  var write = function() {
+    var tryN = (len - bytesWritten) >= 1024 ? 1023 : (len - bytesWritten);
+    fs.write(fd, buffer, bytesWritten, tryN, bytesWritten, afterWrite);
+  };
+
+  var afterWrite = function(err, n) {
+    if (err) {
+      fs.close(fd, function(err) {
+        return callback(err);
+      });
+    }
+
+    if (n <= 0 || bytesWritten + n == len) {
+      // End of buffer
+      fs.close(fd, function(err) {
+        callback(err);
+      });
+    } else {
+      // continue writing
+      bytesWritten += n;
+      write();
+    }
+  };
+};
+
+
+fs.writeFileSync = function(path, data) {
+  checkArgString(path);
+
+  var buffer = ensureBuffer(data);
+  var fd = fs.openSync(path, 'w');
+  var len = buffer.length;
+  var bytesWritten = 0;
+
+  while (true) {
+    try {
+      var tryN = (len - bytesWritten) >= 1024 ? 1023 : (len - bytesWritten);
+      var n = fs.writeSync(fd, buffer, bytesWritten, tryN, bytesWritten);
+      bytesWritten += n;
+      if (bytesWritten == len) {
+        break;
+      }
+    } catch (e) {
+      break;
+    }
+  }
+  fs.closeSync(fd);
+  return bytesWritten;
+};
+
+
+fs.mkdir = function(path, mode, callback) {
+  if (util.isFunction(mode)) callback = mode;
+  checkArgString(path, 'path');
+  checkArgFunction(callback, 'callback');
+  fsBuiltin.mkdir(path, convertMode(mode, 511), callback);
+};
+
+
+fs.mkdirSync = function(path, mode) {
+  return fsBuiltin.mkdir(checkArgString(path, 'path'),
+                         convertMode(mode, 511));
+};
+
+
+fs.rmdir = function(path, callback) {
+  checkArgString(path, 'path');
+  checkArgFunction(callback, 'callback');
+  fsBuiltin.rmdir(path, callback);
+};
+
+
+fs.rmdirSync = function(path) {
+  return fsBuiltin.rmdir(checkArgString(path, 'path'));
+};
+
+
+fs.unlink = function(path, callback) {
+  checkArgString(path);
+  checkArgFunction(callback);
+  fsBuiltin.unlink(path, callback);
+};
+
+
+fs.unlinkSync = function(path) {
+  return fsBuiltin.unlink(checkArgString(path, 'path'));
+};
+
+
+fs.rename = function(oldPath, newPath, callback) {
+  checkArgString(oldPath);
+  checkArgString(newPath);
+  checkArgFunction(callback);
+  fsBuiltin.rename(oldPath, newPath, callback);
+};
+
+
+fs.renameSync = function(oldPath, newPath) {
+  checkArgString(oldPath);
+  checkArgString(newPath);
+  fsBuiltin.rename(oldPath, newPath);
+};
+
+
+fs.readdir = function(path, callback) {
+  checkArgString(path);
+  checkArgFunction(callback);
+  fsBuiltin.readdir(path, callback);
+};
+
+
+fs.readdirSync = function(path) {
+  return fsBuiltin.readdir(checkArgString(path, 'path'));
+};
+
+
+function convertFlags(flag) {
+  var O_APPEND = constants.O_APPEND;
+  var O_CREAT = constants.O_CREAT;
+  var O_EXCL = constants.O_EXCL;
+  var O_RDONLY = constants.O_RDONLY;
+  var O_RDWR = constants.O_RDWR;
+  var O_SYNC = constants.O_SYNC;
+  var O_TRUNC = constants.O_TRUNC;
+  var O_WRONLY = constants.O_WRONLY;
+
+  if (util.isString(flag)) {
+    switch (flag) {
+      case 'r': return O_RDONLY;
+      case 'rs':
+      case 'sr': return O_RDONLY | O_SYNC;
+
+      case 'r+': return O_RDWR;
+      case 'rs+':
+      case 'sr+': return O_RDWR | O_SYNC;
+
+      case 'w': return O_TRUNC | O_CREAT | O_WRONLY;
+      case 'wx':
+      case 'xw': return O_TRUNC | O_CREAT | O_WRONLY | O_EXCL;
+
+      case 'w+': return O_TRUNC | O_CREAT | O_RDWR;
+      case 'wx+':
+      case 'xw+': return O_TRUNC | O_CREAT | O_RDWR | O_EXCL;
+
+      case 'a': return O_APPEND | O_CREAT | O_WRONLY;
+      case 'ax':
+      case 'xa': return O_APPEND | O_CREAT | O_WRONLY | O_EXCL;
+
+      case 'a+': return O_APPEND | O_CREAT | O_RDWR;
+      case 'ax+':
+      case 'xa+': return O_APPEND | O_CREAT | O_RDWR | O_EXCL;
+    }
+  }
+  throw new TypeError('Bad argument: flags');
+}
+
+
+function convertMode(mode, def) {
+  if (util.isNumber(mode)) {
+    return mode;
+  } else if (util.isString(mode)) {
+    return parseInt(mode, 8);
+  } else if (def) {
+    return convertMode(def);
+  }
+  return undefined;
+}
+
+
+function ensureBuffer(data) {
+  if (util.isBuffer(data)) {
+    return data;
+  }
+
+  return new Buffer(data + ''); // coert to string and make it a buffer
+}
+
+
+function checkArgType(value, name, checkFunc) {
+  if (checkFunc(value)) {
+    return value;
+  } else {
+    throw new TypeError('Bad arguments: ' + name);
+  }
+}
+
+
+function checkArgBuffer(value, name) {
+  return checkArgType(value, name, util.isBuffer);
+}
+
+
+function checkArgNumber(value, name) {
+  return checkArgType(value, name, util.isNumber);
+}
+
+
+function checkArgString(value, name) {
+  return checkArgType(value, name, util.isString);
+}
+
+
+function checkArgFunction(value, name) {
+  return checkArgType(value, name, util.isFunction);
+}
diff --git a/src/js/gpio.js b/src/js/gpio.js
new file mode 100644 (file)
index 0000000..9880911
--- /dev/null
@@ -0,0 +1,201 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var gpio = process.binding(process.binding.gpio);
+var util = require('util');
+
+
+var defaultConfiguration = {
+  direction: gpio.DIRECTION.OUT,
+  mode: gpio.MODE.NONE,
+  edge: gpio.EDGE.NONE
+};
+
+
+function Gpio() {
+  if (!(this instanceof Gpio)) {
+    return new Gpio();
+  }
+}
+
+Gpio.prototype.open = function(configuration, callback) {
+  return gpioPinOpen(configuration, callback);
+};
+
+Gpio.prototype.DIRECTION = gpio.DIRECTION;
+
+Gpio.prototype.MODE = gpio.MODE;
+
+Gpio.prototype.EDGE = gpio.EDGE;
+
+function gpioPinOpen(configuration, callback) {
+  var _binding = null;
+
+  function GpioPin(configuration, callback) {
+    var self = this;
+
+    // validate pin
+    if (util.isObject(configuration)) {
+      if (!util.isNumber(configuration.pin)) {
+        throw new TypeError('Bad configuration - pin is mandatory and number');
+      }
+    } else {
+      throw new TypeError('Bad arguments - configuration should be Object')
+    }
+
+    // validate direction
+    if (!util.isUndefined(configuration.direction)) {
+      if (configuration.direction !== gpio.DIRECTION.IN &&
+          configuration.direction !== gpio.DIRECTION.OUT) {
+        throw new TypeError(
+          'Bad configuration - direction should be DIRECTION.IN or OUT');
+      }
+    } else {
+      configuration.direction = defaultConfiguration.direction;
+    }
+
+    // validate mode
+    var mode = configuration.mode;
+    if (process.platform === 'nuttx' && !util.isUndefined(mode)) {
+      if (configuration.direction === gpio.DIRECTION.IN) {
+        if (mode !== gpio.MODE.NONE && mode !== gpio.MODE.PULLUP &&
+            mode !== gpio.MODE.PULLDOWN) {
+          throw new TypeError(
+            'Bad configuration - mode should be MODE.NONE, PULLUP or PULLDOWN');
+        }
+      } else if (configuration.direction === gpio.DIRECTION.OUT) {
+        if (mode !== gpio.MODE.NONE && mode !== gpio.MODE.FLOAT &&
+            mode !== gpio.MODE.PUSHPULL && mode !== gpio.MODE.OPENDRAIN) {
+          throw new TypeError(
+            'Bad configuration - ' +
+            'mode should be MODE.NONE, FLOAT, PUSHPULL or OPENDRAIN');
+        }
+      }
+    } else {
+      configuration.mode = defaultConfiguration.mode;
+    }
+
+    // validate edge
+    var edge = configuration.edge;
+    if (!util.isUndefined(configuration.edge)) {
+      if (edge !== gpio.EDGE.NONE && edge !== gpio.EDGE.RISING &&
+          edge !== gpio.EDGE.FALLING && edge !== gpio.EDGE.BOTH) {
+        throw new TypeError(
+          'Bad configuration - ' +
+          'edge should be EDGE.NONE, RISING, FALLING or BOTH');
+      }
+    } else {
+      configuration.edge = defaultConfiguration.edge;
+    }
+
+    EventEmitter.call(this);
+
+    _binding = new gpio.Gpio(configuration, function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+
+    _binding.onChange = function() {
+      self.emit('change');
+    };
+
+    process.on('exit', (function(self) {
+      return function() {
+        if (!util.isNull(_binding)) {
+          self.closeSync();
+        }
+      };
+    })(this));
+  }
+
+  util.inherits(GpioPin, EventEmitter);
+
+  GpioPin.prototype.write = function(value, callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('GPIO pin is not opened');
+    }
+
+    if (!util.isNumber(value) && !util.isBoolean(value)) {
+      throw new TypeError('Bad arguments - value should be Boolean');
+    }
+
+    _binding.write(!!value, function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+  };
+
+  GpioPin.prototype.writeSync = function(value) {
+    if (util.isNull(_binding)) {
+      throw new Error('GPIO pin is not opened');
+    }
+
+    if (!util.isNumber(value) && !util.isBoolean(value)) {
+      throw new TypeError('Bad arguments - value should be Boolean');
+    }
+
+    _binding.write(!!value);
+  };
+
+  GpioPin.prototype.read = function(callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('GPIO pin is not opened');
+    }
+
+    _binding.read(function(err, value) {
+      util.isFunction(callback) && callback.call(self, err, value);
+    });
+  };
+
+  GpioPin.prototype.readSync = function() {
+    if (util.isNull(_binding)) {
+      throw new Error('GPIO pin is not opened');
+    }
+
+    return _binding.read();
+  };
+
+  GpioPin.prototype.close = function(callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('GPIO pin is not opened');
+    }
+
+    _binding.close(function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+
+    _binding = null;
+  };
+
+  GpioPin.prototype.closeSync = function() {
+    if (util.isNull(_binding)) {
+      throw new Error('GPIO pin is not opened');
+    }
+
+    _binding.close();
+
+    _binding = null;
+  };
+
+  return new GpioPin(configuration, callback);
+}
+
+
+module.exports = Gpio;
diff --git a/src/js/http.js b/src/js/http.js
new file mode 100644 (file)
index 0000000..80905e4
--- /dev/null
@@ -0,0 +1,41 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var Server = require('http_server').Server;
+var client = require('http_client');
+var HTTPParser = process.binding(process.binding.httpparser).HTTPParser;
+
+
+var ClientRequest = exports.ClientRequest = client.ClientRequest;
+
+
+exports.request = function(options, cb) {
+  return new ClientRequest(options, cb);
+};
+
+
+exports.createServer = function(requestListener){
+  return new Server(requestListener);
+};
+
+
+exports.METHODS = HTTPParser.methods;
+
+
+exports.get = function(options, cb) {
+  var req = exports.request(options, cb);
+  req.end();
+  return req;
+};
diff --git a/src/js/http_client.js b/src/js/http_client.js
new file mode 100644 (file)
index 0000000..23e6f24
--- /dev/null
@@ -0,0 +1,231 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+var net = require('net');
+var HTTPParser = process.binding(process.binding.httpparser).HTTPParser;
+var IncomingMessage = require('http_incoming').IncomingMessage;
+var OutgoingMessage = require('http_outgoing').OutgoingMessage;
+var Buffer = require('buffer');
+var common = require('http_common');
+
+
+function ClientRequest(options, cb) {
+  var self = this;
+  OutgoingMessage.call(self);
+
+  // get port, host and method.
+  var port = options.port = options.port || 80;
+  var host = options.host = options.hostname || options.host || '127.0.0.1';
+  var method = options.method || 'GET';
+
+  self.path = options.path || '/';
+
+  // If `options` contains header information, save it.
+  if (options.headers) {
+    var keys = Object.keys(options.headers);
+    for (var i = 0, l = keys.length; i < l; i++) {
+      var key = keys[i];
+      self.setHeader(key, options.headers[key]);
+    }
+  }
+
+  // Register response event handler.
+  if (cb) {
+    self.once('response', cb);
+  }
+
+  // Create socket.
+  var conn = new net.Socket();
+
+  // connect server.
+  conn.connect(port, host);
+
+  // setup connection information.
+  setupConnection(self, conn);
+
+  // store first header line to be sent.
+  var firstHeaderLine = method + ' ' + self.path + ' HTTP/1.1\r\n';
+  self._storeHeader(firstHeaderLine);
+}
+
+util.inherits(ClientRequest, OutgoingMessage);
+
+exports.ClientRequest = ClientRequest;
+
+
+function setupConnection(req, socket) {
+  var parser = common.createHTTPParser();
+  parser.reinitialize(HTTPParser.RESPONSE);
+  req.socket = socket;
+  req.connection = socket;
+  parser.socket = socket;
+  parser.incoming = null;
+  parser._headers = [];
+  req.parser = parser;
+
+  socket.parser = parser;
+  socket._httpMessage = req;
+
+  parser.onIncoming = parserOnIncomingClient;
+  socket.on('error', socketOnError);
+  socket.on('data', socketOnData);
+  socket.on('end', socketOnEnd);
+  socket.on('close', socketOnClose);
+
+  // socket emitted when a socket is assigned to req
+  process.nextTick(function() {
+    req.emit('socket', socket);
+  });
+}
+
+
+function socketOnClose() {
+  var socket = this;
+  var req = socket._httpMessage;
+  var parser = socket.parser;
+
+  socket.read();
+
+  req.emit('close');
+
+  if (req.res && req.res.readable) {
+    // Socket closed before we emitted 'end'
+    var res = req.res;
+    res.on('end', function() {
+      res.emit('close');
+    });
+    res.push(null);
+  }
+  else if (!req.res) {
+    // socket closed before response starts.
+    var err = new Error('socket hang up');
+    req.emit('error', err);
+  }
+
+  if (parser) {
+    // unref all links to parser, make parser GCed
+    parser.finish();
+    parser = null;
+    socket.parser = null;
+    req.parser = null;
+  }
+}
+
+
+function socketOnError(er) {
+  var socket = this;
+  var parser = socket.parser;
+
+  if (parser) {
+    // unref all links to parser, make parser GCed
+    parser.finish();
+    parser = null;
+    socket.parser = null;
+  }
+  socket.destroy();
+}
+
+
+function socketOnData(d) {
+  var socket = this;
+  var req = this._httpMessage;
+  var parser = this.parser;
+
+  var ret = parser.execute(d);
+  if (ret instanceof Error) {
+    // unref all links to parser, make parser GCed
+    parser.finish();
+    parser = null;
+    socket.parser = null;
+    req.parser = null;
+
+    socket.destroy();
+    req.emit('error', ret);
+  }
+}
+
+
+function socketOnEnd() {
+  var socket = this;
+  var req = this._httpMessage;
+  var parser = this.parser;
+
+  if (parser) {
+    // unref all links to parser, make parser GCed
+    parser.finish();
+    parser = null;
+    socket.parser = null;
+    req.parser = null;
+  }
+
+  socket.destroy();
+}
+
+
+
+// This is called by parserOnHeadersComplete after response header is parsed.
+// TODO: keepalive support
+function parserOnIncomingClient(res, shouldKeepAlive) {
+  var socket = this.socket;
+  var req = socket._httpMessage;
+
+  if (req.res) {
+    // server sent responses twice.
+    socket.destroy();
+    return false;
+  }
+  req.res = res;
+
+  res.req = req;
+
+  res.on('end', responseOnEnd);
+
+  req.emit('response', res);
+
+  // response to HEAD req has no body
+  var isHeadResponse =  (req.method == 'HEAD');
+
+  return isHeadResponse;
+
+}
+
+var responseOnEnd = function() {
+  var res = this;
+  var req = res.req;
+  var socket = req.socket;
+
+  if (socket._socketState.writable) {
+    socket.destroySoon();
+  }
+};
+
+
+ClientRequest.prototype.setTimeout = function(ms, cb) {
+  var self = this;
+
+  if (cb) self.once('timeout', cb);
+
+  var emitTimeout = function() {
+    self.emit('timeout');
+  };
+
+  // In IoT.js, socket is already assigned,
+  // thus, it is sufficient to trigger timeout on socket 'connect' event.
+  this.socket.once('connect', function() {
+    self.socket.setTimeout(ms, emitTimeout);
+  });
+
+};
diff --git a/src/js/http_common.js b/src/js/http_common.js
new file mode 100644 (file)
index 0000000..480638a
--- /dev/null
@@ -0,0 +1,113 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+var HTTPParser = process.binding(process.binding.httpparser).HTTPParser;
+var IncomingMessage = require('http_incoming').IncomingMessage;
+var OutgoingMessage = require('http_outgoing').OutgoingMessage;
+
+
+
+var createHTTPParser = function() {
+  // REQUEST is the default type.
+  // For RESPONSE, use HTTPParser.reinitialize(HTTPParser.RESPONSE)
+  var parser = new HTTPParser(HTTPParser.REQUEST);
+  // cb during  http parsing from C side(http_parser)
+  parser.OnHeaders = parserOnHeaders;
+  parser.OnHeadersComplete = parserOnHeadersComplete;
+  parser.OnBody = parserOnBody;
+  parser.OnMessageComplete = parserOnMessageComplete;
+  return parser;
+};
+
+exports.createHTTPParser = createHTTPParser;
+
+
+// This is called when parsing of incoming http msg done
+function parserOnMessageComplete() {
+  var stream = this.incoming;
+
+  if (stream) {
+    stream.complete = true;
+    // no more data from incoming, stream will emit 'end' event
+    stream.push(null);
+  }
+
+  stream.socket.resume();
+}
+
+
+// This is called when header part in http msg is parsed.
+function parserOnHeadersComplete(info) {
+  var headers = info.headers;
+  var url = info.url;
+
+  if (!url) {
+    url = this._url;
+    this.url = "";
+  }
+
+  if (!headers) {
+    headers = this._headers;
+    this._headers = [];
+  }
+
+
+  this.incoming = new IncomingMessage(this.socket);
+  this.incoming.url = url;
+
+  // add header fields of headers to incoming.headers
+  this.incoming.addHeaders(headers);
+
+  if (util.isNumber(info.method)) {
+    // for server
+    this.incoming.method = HTTPParser.methods[info.method];
+  } else {
+    // for client
+    this.incoming.statusCode = info.status;
+    this.incoming.statusMessage = info.status_msg;
+  }
+
+  // For client side, if response to 'HEAD' request, we will skip parsing body
+  var skipBody = this.onIncoming(this.incoming, info.shouldkeepalive);
+
+  return skipBody;
+}
+
+
+// parserOnBody is called when HTTPParser parses http msg(incoming) and
+// get body part(buf from start at length of len)
+function parserOnBody(buf, start, len) {
+  var stream = this.incoming;
+
+  if (!stream) {
+    return;
+  }
+
+  // Push body part into incoming stream, which will emit 'data' event
+  var body = buf.slice(start, start+len);
+  stream.push(body);
+}
+
+
+// This is called when http header is fragmented and
+// HTTPParser sends it to JS in separate pieces.
+function parserOnHeaders(headers, url) {
+  // push new header parts into existing array
+  this._headers.push.apply(this._headers, headers);
+  if (url) {
+    this._url += url;
+  }
+}
diff --git a/src/js/http_incoming.js b/src/js/http_incoming.js
new file mode 100644 (file)
index 0000000..72249c1
--- /dev/null
@@ -0,0 +1,69 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var util = require('util');
+var stream = require('stream');
+
+function IncomingMessage(socket) {
+  stream.Readable.call(this);
+
+  this.socket = socket;
+  this.connection = socket;
+
+  this.readable = true;
+
+  this.headers = {};
+
+  this.complete = false;
+
+  // for request (server)
+  this.url = '';
+  this.method = null;
+
+  // for response (client)
+  this.statusCode = null;
+  this.statusMessage = null;
+
+}
+
+util.inherits(IncomingMessage, stream.Readable);
+
+exports.IncomingMessage = IncomingMessage;
+
+
+IncomingMessage.prototype.read = function(n) {
+  this.read = stream.Readable.prototype.read;
+  return this.read(n);
+};
+
+
+IncomingMessage.prototype.addHeaders = function(headers) {
+  if (!this.headers) {
+    this.headers = {};
+  }
+
+  // FIXME: handle headers as array if array C API is done.
+  for (var i=0; i<headers.length; i=i+2) {
+    this.headers[headers[i]] = headers[i+1];
+  }
+};
+
+
+IncomingMessage.prototype.setTimeout = function(ms, cb) {
+  if (cb)
+    this.once('timeout', cb);
+  this.socket.setTimeout(ms, cb);
+};
diff --git a/src/js/http_outgoing.js b/src/js/http_outgoing.js
new file mode 100644 (file)
index 0000000..c0585a0
--- /dev/null
@@ -0,0 +1,195 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var util = require('util');
+var stream = require('stream');
+
+
+function OutgoingMessage() {
+  stream.Stream.call(this);
+
+  this.writable = true;
+
+  this._hasBody = true;
+
+  this.finished = false;
+  this._sentHeader = false;
+
+  this.socket = null;
+  this.connection = null;
+  // response header string : same 'content' as this._headers
+  this._header = null;
+  // response header obj : (key, value) pairs
+  this._headers = {};
+
+}
+
+util.inherits(OutgoingMessage, stream.Stream);
+
+exports.OutgoingMessage = OutgoingMessage;
+
+
+OutgoingMessage.prototype.end = function(data, encoding, callback) {
+  var self = this;
+
+  if (util.isFunction(data)) {
+    callback = data;
+    data = null;
+  } else if (util.isFunction(encoding)) {
+    callback = encoding;
+    encoding = null;
+  }
+
+  if (this.finished) {
+    return false;
+  }
+
+  // flush header
+  if (!this._header) {
+    this._implicitHeader();
+  }
+
+  if (data) {
+    this.write(data, encoding);
+  }
+
+  // Register finish event handler.
+  if (util.isFunction(callback)) {
+    this.once('finish', callback);
+  }
+
+  // Force flush buffered data.
+  // After all data was sent, emit 'finish' event meaning segment of header and
+  // body were all sent finished. This means different from 'finish' event
+  // emitted by net which indicate there will be no more data to be sent through
+  // the connection. On the other hand emitting 'finish' event from http does
+  // not neccessarily imply end of data transmission since there might be
+  // another segment of data when connection is 'Keep-Alive'.
+  this._send('', function() {
+    self.emit('finish');
+  });
+
+
+  this.finished = true;
+
+  this._finish();
+
+  return true;
+};
+
+
+OutgoingMessage.prototype._finish = function() {
+  this.emit('prefinish');
+};
+
+
+// This sends chunk directly into socket
+// TODO: buffering of chunk in the case of socket is not available
+OutgoingMessage.prototype._send = function(chunk, encoding, callback) {
+  if (util.isFunction(encoding)) {
+    callback = encoding;
+  }
+
+  if (util.isBuffer(chunk)) {
+    chunk = chunk.toString();
+  }
+
+  if (!this._sentHeader) {
+    chunk = this._header + "\r\n" + chunk;
+    this._sentHeader = true;
+  }
+
+  return this.connection.write(chunk, encoding, callback);
+};
+
+
+OutgoingMessage.prototype.write = function(chunk, encoding, callback) {
+  if (!this._header) {
+    this._implicitHeader();
+  }
+
+  if (!this._hasBody) {
+    return true;
+  }
+
+  var ret = this._send(chunk, encoding, callback);
+
+  return ret;
+
+};
+
+
+// Stringfy header fields of _headers into _header
+OutgoingMessage.prototype._storeHeader = function(statusLine) {
+  var headerStr = '';
+
+  var keys;
+  if (this._headers) {
+    keys = Object.keys(this._headers);
+    for (var i=0; i<keys.length; i++) {
+      var key = keys[i];
+      headerStr += key + ": " + this._headers[key] + '\r\n';
+    }
+  }
+
+  this._header = statusLine + headerStr;
+
+};
+
+
+OutgoingMessage.prototype.setHeader = function(name, value) {
+  if ((typeof name) != 'string') {
+    throw new TypeError('Name must be string.');
+  }
+
+  if (!value) {
+    throw new Error('value required in setHeader(' + name + ', value)');
+  }
+
+  if (this._headers === null) {
+    this._headers = {};
+  }
+
+  this._headers[name] = value;
+
+};
+
+
+OutgoingMessage.prototype.removeHeader = function(name) {
+  if (this._headers === null) {
+    return;
+  }
+
+  delete this._headers[name];
+};
+
+
+OutgoingMessage.prototype.getHeader = function(name) {
+  return this._headers[name];
+};
+
+
+OutgoingMessage.prototype.setTimeout = function(ms, cb) {
+  if (cb)
+    this.once('timeout', cb);
+
+  if (!this.socket) {
+    this.once('socket', function(socket) {
+      socket.setTimeout(msecs);
+    });
+  } else
+    this.socket.setTimeout(msecs);
+};
diff --git a/src/js/http_server.js b/src/js/http_server.js
new file mode 100644 (file)
index 0000000..e2d329c
--- /dev/null
@@ -0,0 +1,302 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+var net = require('net');
+var OutgoingMessage = require('http_outgoing').OutgoingMessage;
+var common = require('http_common');
+
+// RFC 7231 (http://tools.ietf.org/html/rfc7231#page-49)
+var STATUS_CODES = exports.STATUS_CODES = {
+  100 : 'Continue',
+  101 : 'Switching Protocols',
+  200 : 'OK',
+  201 : 'Created',
+  202 : 'Accepted',
+  203 : 'Non-Authoritative Information',
+  204 : 'No Content',
+  205 : 'Reset Content',
+  206 : 'Partial Content',
+  300 : 'Multiple Choices',
+  301 : 'Moved Permanently',
+  302 : 'Found',
+  303 : 'See Other',
+  304 : 'Not Modified',
+  305 : 'Use Proxy',
+  307 : 'Temporary Redirect',
+  400 : 'Bad Request',
+  401 : 'Unauthorized',
+  402 : 'Payment Required',
+  403 : 'Forbidden',
+  404 : 'Not Found',
+  405 : 'Method Not Allowed',
+  406 : 'Not Acceptable',
+  407 : 'Proxy Authentication Required',
+  408 : 'Request Timeout',
+  409 : 'Conflict',
+  410 : 'Gone',
+  411 : 'Length Required',
+  412 : 'Precondition Failed',
+  413 : 'Payload Too Large',
+  414 : 'URI Too Large',
+  415 : 'Unsupported Media Type',
+  416 : 'Range Not Satisfiable',
+  417 : 'Expectation Failed',
+  426 : 'Upgrade Required',
+  500 : 'Internal Server Error',
+  501 : 'Not Implemented',
+  502 : 'Bad Gateway',
+  503 : 'Service Unavailable',
+  504 : 'Gateway Time-out',
+  505 : 'HTTP Version Not Supported'
+};
+
+
+// response to req
+function ServerResponse(req) {
+  OutgoingMessage.call(this);
+  // response to HEAD method has no body
+  if (req.method === 'HEAD') this._hasBody = false;
+}
+
+util.inherits(ServerResponse, OutgoingMessage);
+
+
+// default status code : 200
+ServerResponse.prototype.statusCode = 200;
+ServerResponse.prototype.statusMessage = undefined;
+
+
+// if user does not set Header before write(..),
+// this function set default header(200).
+ServerResponse.prototype._implicitHeader = function() {
+  this.writeHead(this.statusCode, this.statusMessage);
+};
+
+
+ServerResponse.prototype.writeHead = function(statusCode, reason, obj) {
+  if (util.isString(reason)) {
+    this.statusMessage = reason;
+  }
+  else {
+    this.statusMessage = STATUS_CODES[statusCode] || 'unknown';
+    obj = reason;
+  }
+
+  var statusLine = util.format('HTTP/1.1 %s %s\r\n',
+                               statusCode.toString(),
+                               this.statusMessage);
+
+  this.statusCode = statusCode;
+
+  // HTTP response without body
+  if (statusCode === 204 || statusCode === 304 ||
+      (100 <= statusCode && statusCode <= 199)) {
+    this._hasBody = false;
+  }
+
+  if (util.isObject(obj)) {
+    if (util.isNullOrUndefined(this._headers)) {
+      this._headers = {};
+    }
+    for (var key in obj) {
+      if (obj.hasOwnProperty(key)) {
+        this._headers[key] = obj[key];
+      }
+    }
+  }
+
+  this._storeHeader(statusLine);
+};
+
+
+ServerResponse.prototype.assignSocket = function(socket) {
+  socket._httpMessage = this;
+  this.socket = socket;
+  this.connection = socket;
+  socket.on('close', onServerResponseClose);
+  this.emit('socket', socket);
+};
+
+
+function onServerResponseClose() {
+  if (this._httpMessage) {
+    this._httpMessage.emit('close');
+  }
+}
+
+
+ServerResponse.prototype.detachSocket = function() {
+  this.socket._httpMessage = null;
+  this.socket = this.connection = null;
+};
+
+
+function Server(requestListener) {
+  if (!(this instanceof Server)) {
+    return new Server(requestListener);
+  }
+
+  net.Server.call(this, {allowHalfOpen: true});
+
+  if (util.isFunction(requestListener)) {
+    this.addListener('request', requestListener);
+  }
+
+  this.httpAllowHalfOpen = false;
+
+  this.on('connection', connectionListener);
+  this.on('clientError', function(err, conn) {
+    conn.destroy(err);
+  });
+
+  this.timeout = 2 * 1000 * 60; // default timeout is 2 min
+}
+
+util.inherits(Server, net.Server);
+exports.Server = Server;
+
+
+// TODO: Implement Server.prototype.setTimeout function
+// For this, socket.prototype.setTimeout is needed.
+Server.prototype.setTimeout = function (ms, cb) {
+  this.timeout = ms;
+  if (cb) {
+    this.on('timeout', cb);
+  }
+};
+
+
+function connectionListener(socket) {
+  var server = this;
+
+  // cf) In Node.js, freelist returns a new parser.
+  // parser initialize
+  var parser = common.createHTTPParser();
+  parser._headers = [];
+  parser._url = '';
+
+  parser.onIncoming = parserOnIncoming;
+
+  parser.socket = socket;
+  parser.incoming = null;
+  socket.parser = parser;
+
+  socket.on("data", socketOnData);
+  socket.on("end", socketOnEnd);
+  socket.on("close", socketOnClose);
+  socket.on('timeout', socketOnTimeout);
+  socket.on("error", socketOnError);
+
+  if (server.timeout) {
+    socket.setTimeout(server.timeout);
+  }
+}
+
+
+function socketOnData(data) {
+  var socket = this;
+
+  // Begin parsing
+  var ret = socket.parser.execute(data);
+
+  if (ret instanceof Error) {
+    socket.destroy();
+  }
+}
+
+
+function socketOnEnd() {
+  var socket = this;
+  var server = socket._server;
+  var ret = socket.parser.finish();
+
+  if (ret instanceof Error) {
+    socket.destroy();
+    return;
+  }
+
+  socket.parser = null;
+
+  if (!server.httpAllowHalfOpen && socket._socketState.writable) {
+    socket.end();
+  }
+}
+
+
+function socketOnClose() {
+  var socket = this;
+
+  if (socket.parser) {
+    socket.parser = null;
+  }
+}
+
+
+function socketOnTimeout() {
+  var socket = this;
+  var server = socket._server;
+
+  var serverTimeout = server.emit('timeout', socket);
+  var req = socket.parser && socket.parser.incoming;
+  var reqTimeout = req && !req.complete && req.emit('timeout', socket);
+  var res = socket._httpMessage;
+  var resTimeout = res && res.emit('timeout', socket);
+
+  // if user doesn't provide timeout handler, kill socket.
+  // otherwise, user cb must take care of timeouted socket.
+  if (!serverTimeout && !reqTimeout && !resTimeout) {
+    socket.destroy();
+  }
+}
+
+
+function socketOnError(err) {
+  var socket = this;
+  var server = socket._server;
+
+  server.emit("clientError", err, socket);
+}
+
+
+// This is called by parserOnHeadersComplete after req header is parsed.
+// TODO: keepalive support
+function parserOnIncoming(req, shouldKeepAlive) {
+  var socket = req.socket;
+  var server = socket._server;
+
+  var res = new ServerResponse(req);
+  res.assignSocket(socket);
+  res.on('prefinish', resOnFinish);
+
+  server.emit('request', req, res);
+
+  // In server, HTTPParser determines whether body should be parsed or not.
+  // It is fine to return false
+  return false;
+}
+
+
+// This cb is called when response ended
+// (res.end emits 'prefinish' event)
+function resOnFinish() {
+  var res = this;
+  var socket = res.socket;
+
+  res.detachSocket();
+
+  // cf) In Node, ConnectionListener has a list of incoming msgs.
+  socket.destroySoon();
+}
diff --git a/src/js/https.js b/src/js/https.js
new file mode 100644 (file)
index 0000000..7719092
--- /dev/null
@@ -0,0 +1,30 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var client = require('https_client');
+
+var ClientRequest = exports.ClientRequest = client.ClientRequest;
+
+exports.request = function(options, cb) {
+  return new ClientRequest(options, cb);
+};
+
+exports.METHODS = client.METHODS;
+
+exports.get = function(options, cb) {
+  var req = exports.request(options, cb);
+  req.end();
+  return req;
+};
diff --git a/src/js/https_client.js b/src/js/https_client.js
new file mode 100644 (file)
index 0000000..faadadb
--- /dev/null
@@ -0,0 +1,157 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+var incoming = require('https_incoming');
+var stream = require('stream');
+var Buffer = require('buffer');
+var httpsNative = process.binding(process.binding.https);
+
+var methods = {'0': 'DELETE', '1': 'GET', '2': 'HEAD', '3': 'POST',
+    '4': 'PUT', '5': 'CONNECT', '6': 'OPTIONS', '7': 'TRACE'};
+exports.METHODS = methods;
+
+function ClientRequest(options, cb) {
+  this.stream = stream.Writable.call(this, options);
+
+  // get port, host and method.
+  var port = options.port = options.port || 443;
+  var host = options.host = options.hostname || options.host || '127.0.0.1';
+  var path = options.path || '/';
+  var protocol = options.protocol || 'https:';
+
+  this.host = protocol + '//' + host + ':' + port + path;
+  this.method = options.method || 'GET';
+  this.ca = options.ca || '';
+  this.cert = options.cert || '';
+  this.key = options.key || '';
+
+  var isMethodGood = false;
+  for (var key in methods) {
+    if (methods.hasOwnProperty(key)) {
+      if (this.method === methods[key]) {
+        isMethodGood = true;
+        break;
+      }
+    }
+  }
+
+  if (!isMethodGood) {
+    var err = new Error('Incorrect options.method.')
+    this.emit('error', err);
+    return;
+  }
+
+  this._incoming = new incoming.IncomingMessage(this);
+  this._incoming.url = this.host;
+  this._incoming.method = this.method;
+  this.aborted = null;
+
+  // Register response event handler.
+  if (cb) {
+    this.once('response', cb);
+  }
+  this.once('finish', this.onFinish);
+
+  httpsNative.createRequest(this);
+
+  if (options.auth) {
+    var headerString = 'Authorization: Basic ' + toBase64(options.auth);
+    httpsNative.addHeader(headerString, this);
+  }
+  if (options.headers) {
+    var keys = Object.keys(options.headers);
+    for (var i = 0, l = keys.length; i < l; i++) {
+      var key = keys[i];
+      httpsNative.addHeader(key + ': ' + options.headers[key], this);
+    }
+  }
+  httpsNative.sendRequest(this);
+}
+
+util.inherits(ClientRequest, stream.Writable);
+
+// Concrete stream overriding the empty underlying _write method.
+ClientRequest.prototype._write = function(chunk, callback, onwrite) {
+  httpsNative._write(this, chunk.toString(), callback, onwrite);
+};
+
+ClientRequest.prototype.headersComplete = function() {
+  var self = this;
+  self.emit('response', self._incoming);
+  return (self.method == 'HEAD');
+};
+
+ClientRequest.prototype.onError = function(ret) {
+  this.emit('error', ret);
+};
+
+ClientRequest.prototype.onFinish = function() {
+  httpsNative.finishRequest(this);
+};
+
+ClientRequest.prototype.setTimeout = function(ms, cb) {
+  this._incoming.setTimeout(ms, cb);
+};
+
+ClientRequest.prototype.abort = function(doNotEmit) {
+  if (!this.aborted) {
+    httpsNative.abort(this);
+    var date = new Date();
+    this.aborted = date.getTime();
+
+    if (this._incoming.parser) {
+      this._incoming.parser.finish();
+      this._incoming.parser = null;
+    }
+
+    if (!doNotEmit) {
+      this.emit('abort');
+    }
+  }
+};
+
+exports.ClientRequest = ClientRequest;
+
+function toBase64(input) {
+  var output = '';
+  var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
+  var i = 0;
+  //Convert to UTF-8
+  input = Buffer(input).toString();
+  var _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' +
+    '0123456789+/=';
+  while (i < input.length) {
+    chr1 = input.charCodeAt(i++);
+    chr2 = input.charCodeAt(i++);
+    chr3 = input.charCodeAt(i++);
+
+    enc1 = chr1 >> 2;
+    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+    enc4 = chr3 & 63;
+
+    if (isNaN(chr2)) {
+      enc3 = enc4 = 64;
+    } else if (isNaN(chr3)) {
+      enc4 = 64;
+    }
+
+    output = output +
+      _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +
+      _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
+  }
+  return output;
+}
diff --git a/src/js/https_incoming.js b/src/js/https_incoming.js
new file mode 100644 (file)
index 0000000..23b4f90
--- /dev/null
@@ -0,0 +1,242 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+var stream = require('stream');
+var Buffer = require('buffer');
+var httpsNative = process.binding(process.binding.https);
+var HTTPParser = process.binding(process.binding.httpparser).HTTPParser;
+
+function IncomingMessage(clientRequest) {
+  stream.Readable.call(this);
+  this.clientRequest = clientRequest;
+
+  this.headers = {};
+  this.started = false;
+  this.completed = false;
+  this.timeoutCallback = null;
+  // for response (client)
+  this.statusCode = null;
+  this.statusMessage = null;
+  this.url = null;
+  this.method = null;
+
+  this.parser = createHTTPParser(this);
+
+  this.onData = cbOnData;
+  this.onClosed = cbOnClosed;
+  this.onEnd = cbOnEnd;
+  this.onError = cbOnError;
+  this.onSocket = cbOnSocket;
+  this.onTimeout = cbOnTimeout;
+  this.onWritable = cbOnWritable;
+}
+
+util.inherits(IncomingMessage, stream.Readable);
+exports.IncomingMessage = IncomingMessage;
+
+IncomingMessage.prototype.read = function(n) {
+  this.read = stream.Readable.prototype.read;
+  return this.read(n);
+};
+
+IncomingMessage.prototype.setTimeout = function(ms, cb) {
+  if (cb) {
+    this.timeoutCallback = cb;
+    this.once('timeout', cb);
+  }
+  httpsNative.setTimeout(ms, this.clientRequest);
+};
+
+IncomingMessage.prototype.addHeaders = function(headers) {
+  if (!this.headers) {
+    this.headers = {};
+  }
+  if (!headers) {
+    return;
+  }
+
+  for (var i = 0; i < headers.length; i = i + 2) {
+    this.headers[headers[i]] = headers[i + 1];
+  }
+};
+
+// HTTP PARSER Constructor
+var createHTTPParser = function(incoming) {
+  var parser = new HTTPParser(HTTPParser.RESPONSE);
+  parser.incoming = incoming;
+  // cb during http parsing from C side(http_parser)
+  parser.OnHeaders = parserOnHeaders;
+  parser.OnHeadersComplete = parserOnHeadersComplete;
+  parser.OnBody = parserOnBody;
+  parser.OnMessageComplete = parserOnMessageComplete;
+  return parser;
+};
+
+// ------------- HTTP PARSER CALLBACKS -------------
+// This is called when http header is fragmented and
+// HTTPParser sends it to JS in separate pieces.
+function parserOnHeaders(headers, url) {
+  var parser = this;
+  parser.incoming.addHeaders(headers);
+}
+
+// This is called when header part in http msg is parsed.
+function parserOnHeadersComplete(info) {
+  var parser = this;
+  var headers = info.headers;
+
+  if (!headers) {
+    headers = parser._headers;
+    parser.incoming.addHeaders(headers);
+    parser._headers = {};
+  } else {
+    parser.incoming.addHeaders(headers);
+  }
+
+  // add header fields of headers to incoming.headers
+  parser.incoming.addHeaders(headers);
+  parser.incoming.statusCode = info.status;
+  parser.incoming.statusMessage = info.status_msg;
+  parser.incoming.started = true;
+
+  // For client side, if response to 'HEAD' request, we will skip parsing body
+  return parser.incoming.clientRequest.headersComplete();
+}
+
+// parserOnBody is called when HTTPParser parses http msg(incoming) and
+// get body part(buf from start at length of len)
+function parserOnBody(buf, start, len) {
+  var parser = this;
+  var incoming = parser.incoming;
+
+  if (!incoming) {
+    return;
+  }
+
+  // Push body part into incoming stream, which will emit 'data' event
+  var body = buf.slice(start, start + len);
+  incoming.push(body);
+}
+
+// This is called when parsing of incoming http msg done
+function parserOnMessageComplete() {
+  var parser = this;
+  var incoming = parser.incoming;
+
+  if (incoming) {
+    incoming.completed = true;
+    // no more data from incoming, stream will emit 'end' event
+    incoming.push(null);
+  }
+}
+
+//------------ LIBCURL PARSER CALLBACKS -----------------
+// Called by libcurl when Request is Done. Finish parser and unref
+function cbOnEnd() {
+  var incoming = this;
+  var parser = incoming.parser;
+  if (parser) {
+    // Unref all links to parser, make parser GCed
+    parser.finish();
+    parser = null;
+    incoming.parser = null;
+  }
+}
+
+function cbOnClosed() {
+  var incoming = this;
+  var parser = incoming.parser;
+  var clientRequest = incoming.clientRequest;
+
+  if (incoming.started && !incoming.completed) {
+    // Socket closed before we emitted 'end'
+    incoming.on('end', function() {
+      incoming.emit('close');
+      clientRequest.emit('close');
+    });
+    incoming.push(null);
+  } else if (!incoming.started) {
+    incoming.emit('close');
+    clientRequest.emit('close');
+    // Socket closed before response starts.
+    var err = new Error('Could Not Start Connection');
+    clientRequest.onError(err);
+  } else {
+    clientRequest.emit('close');
+  }
+
+  if (parser) {
+    // Unref all links to parser, make parser GCed
+    parser.finish();
+    parser = null;
+    incoming.parser = null;
+  }
+}
+
+// Called by libcurl when Request is Done. Finish parser and unref
+function cbOnData(chunk) {
+  var incoming = this;
+
+  if (!incoming) {
+    return false;
+  }
+
+  var parser = incoming.parser;
+  var clientRequest = incoming.clientRequest;
+
+  chunk = new Buffer(chunk);
+  var ret = parser.execute(chunk);
+
+  if (ret instanceof Error) {
+    parser.finish();
+    // Unref all links to parser, make parser GCed
+    parser = null;
+    clientRequest.onError(ret);
+    return false;
+  }
+  return true;
+}
+
+function cbOnError(er) {
+  var incoming = this;
+  var clientRequest = incoming.clientRequest;
+  var err = new Error(er);
+  clientRequest.onError(err);
+  clientRequest.abort(true);
+  incoming.emit('error', err);
+}
+
+function cbOnTimeout() {
+  var incoming = this;
+  var clientRequest = incoming.clientRequest;
+  incoming.emit('timeout');
+  if (!incoming.timeoutCallback) {
+    clientRequest.abort.call(clientRequest, false);
+  }
+  incoming.emit('aborted');
+}
+
+function cbOnSocket() {
+  var incoming = this;
+  var clientRequest = incoming.clientRequest;
+  clientRequest.emit('socket');
+}
+
+function cbOnWritable() {
+  var incoming = this;
+  var clientRequest = incoming.clientRequest;
+  clientRequest._readyToWrite();
+}
diff --git a/src/js/i2c.js b/src/js/i2c.js
new file mode 100644 (file)
index 0000000..0609634
--- /dev/null
@@ -0,0 +1,133 @@
+/* Copyright (c) 2013, Kelly Korevec <korevec@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the author nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* This file includes all APIs in 'node-i2c'(https://github.com/kelly/node-i2c).
+ * Some functions are translated from coffee script(i2c.coffee) in 'node-i2c'.
+ */
+
+var util = require('util');
+var i2c = process.binding(process.binding.i2c);
+
+function I2C() {
+  if (!(this instanceof I2C)) {
+    return new I2C();
+  }
+}
+
+I2C.prototype.open = function(configurable, callback) {
+  return i2cBusOpen(configurable, callback);
+};
+
+
+function i2cBusOpen(configurable, callback) {
+  var _binding = null;
+
+  function I2CBus(configurable, callback) {
+    if (util.isObject(configurable)) {
+      if (process.platform === 'linux') {
+        if (!util.isString(configurable.device)) {
+          throw new TypeError('Bad configurable - device: String');
+        }
+      } else if (process.platform === 'nuttx') {
+        if (!util.isNumber(configurable.device)) {
+          throw new TypeError('Bad configurable - device: Number');
+        }
+      }
+
+      if (!util.isNumber(configurable.address)) {
+        throw new TypeError('Bad configurable - address: Number');
+      }
+
+      this.address = configurable.address;
+
+      _binding = new i2c(configurable.device, (function(_this) {
+        return function(err) {
+          if (!err) {
+            _this.setAddress(configurable.address);
+          }
+          util.isFunction(callback) && callback(err);
+        };
+      })(this));
+    }
+  }
+
+  I2CBus.prototype.close = function() {
+    _binding.close();
+  };
+
+  I2CBus.prototype.setAddress = function(address, callback) {
+    if (!util.isNumber(address)) {
+      throw new TypeError('Bad argument - address: Number');
+    }
+
+    this.address = address;
+    _binding.setAddress(this.address);
+
+    util.isFunction(callback) && callback();
+  };
+
+  I2CBus.prototype.write = function(array, callback) {
+    if (!util.isArray(array)) {
+      throw new TypeError('Bad argument - array: Array');
+    }
+
+    this.setAddress(this.address);
+    _binding.write(array, function(err) {
+      util.isFunction(callback) && callback(err);
+    });
+  };
+
+  I2CBus.prototype.read = function(length, callback) {
+    if (!util.isNumber(length)) {
+      throw new TypeError('Bad argument - length: Number');
+    }
+
+    this.setAddress(this.address);
+    _binding.read(length, function(err, data) {
+      util.isFunction(callback) && callback(err, data);
+    });
+  };
+
+  return new I2CBus(configurable, callback);
+}
+
+
+module.exports = I2C;
diff --git a/src/js/iotjs.js b/src/js/iotjs.js
new file mode 100644 (file)
index 0000000..1a89156
--- /dev/null
@@ -0,0 +1,168 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+this.global = this;
+
+function Native(id) {
+  this.id = id;
+  this.filename = id + '.js';
+  this.exports = {};
+}
+
+
+Native.cache = {};
+
+
+Native.require = function(id) {
+  if (id == 'native') {
+    return Native;
+  }
+
+  if (Native.cache[id]) {
+    return Native.cache[id].exports;
+  }
+
+  var nativeMod = new Native(id);
+
+  Native.cache[id] = nativeMod;
+  nativeMod.compile();
+
+  return nativeMod.exports;
+}
+
+
+Native.prototype.compile = function() {
+  // process.native_sources has a list of pointers to
+  // the source strings defined in 'iotjs_js.h', not
+  // source strings.
+
+  var fn = process.compileNativePtr(this.id);
+  fn(this.exports, Native.require, this);
+}
+
+global.console = Native.require('console');
+global.Buffer = Native.require('buffer');
+
+(function() {
+  var timers = undefined;
+
+  var _timeoutHandler = function(mode) {
+    if (timers == undefined) {
+      timers = Native.require('timers');
+    }
+    return timers[mode].apply(this, Array.prototype.slice.call(arguments, 1));
+  }
+
+  global.setTimeout = _timeoutHandler.bind(this, 'setTimeout');
+  global.setInterval = _timeoutHandler.bind(this, 'setInterval');
+  global.clearTimeout = _timeoutHandler.bind(this, 'clearTimeout');
+  global.clearInterval = _timeoutHandler.bind(this, 'clearInterval');
+})();
+
+var EventEmitter = Native.require('events').EventEmitter;
+
+EventEmitter.call(process);
+
+var keys = Object.keys(EventEmitter.prototype);
+var keysLength = keys.length;
+for (var i = 0; i < keysLength; ++i) {
+  var key = keys[i];
+  if (!process[key]) {
+    process[key] = EventEmitter.prototype[key];
+  }
+}
+
+var nextTickQueue = [];
+
+process.nextTick = nextTick;
+process._onNextTick = _onNextTick;
+
+
+function _onNextTick() {
+  // clone nextTickQueue to new array object, and calls function
+  // iterating the cloned array. This is because,
+  // during processing nextTick
+  // a callback could add another next tick callback using
+  // `process.nextTick()`, if we calls back iterating original
+  // `nextTickQueue` that could turn into infinite loop.
+
+  var callbacks = nextTickQueue.slice(0);
+  nextTickQueue = [];
+
+  var len = callbacks.length;
+  for (var i = 0; i < len; ++i) {
+    try {
+      callbacks[i]();
+    } catch (e) {
+      process._onUncaughtException(e);
+    }
+  }
+
+  return nextTickQueue.length > 0;
+}
+
+
+function nextTick(callback) {
+  nextTickQueue.push(callback);
+}
+
+
+process._onUncaughtException = _onUncaughtException;
+function _onUncaughtException(error) {
+  var event = 'uncaughtException';
+  if (process._events[event] && process._events[event].length > 0) {
+    try {
+      // Emit uncaughtException event.
+      process.emit('uncaughtException', error);
+    } catch (e) {
+      // Even uncaughtException handler thrown, that could not be handled.
+      console.error('uncaughtException handler throws: ' + e);
+      process.exit(1);
+    }
+  } else {
+    // Exit if there are no handler for uncaught exception.
+    console.error('uncaughtException: ' + error);
+    process.exit(1);
+  }
+}
+
+
+process.exitCode = 0;
+process._exiting = false;
+process.emitExit = function(code) {
+  if (!process._exiting) {
+    process._exiting = true;
+    if (code || code == 0) {
+      process.exitCode = code;
+    }
+    process.emit('exit', process.exitCode || 0);
+  }
+}
+
+
+process.exit = function(code) {
+  try {
+    process.emitExit(code);
+  } catch (e) {
+    process.exitCode = 1;
+    process._onUncaughtException(e);
+  } finally {
+    process.doExit(process.exitCode || 0);
+  }
+}
+
+
+var module = Native.require('module');
+module.runMain();
diff --git a/src/js/module.js b/src/js/module.js
new file mode 100644 (file)
index 0000000..0940e5a
--- /dev/null
@@ -0,0 +1,173 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var Native = require('native');
+var fs = Native.require('fs');
+
+function iotjs_module_t(id, parent) {
+  this.id = id;
+  this.exports = {};
+  this.filename = null;
+  this.parent = parent;
+};
+
+module.exports = iotjs_module_t;
+
+
+iotjs_module_t.cache = {};
+iotjs_module_t.wrapper = Native.wrapper;
+iotjs_module_t.wrap = Native.wrap;
+
+
+var cwd;
+try { cwd = process.cwd(); } catch (e) { }
+
+var moduledirs = [""]
+if(cwd){
+  moduledirs.push(cwd + "/");
+  moduledirs.push(cwd + "/iotjs_modules/");
+}
+if(process.env.HOME){
+  moduledirs.push(process.env.HOME + "/iotjs_modules/");
+}
+if(process.env.IOTJS_PATH){
+  moduledirs.push(process.env.IOTJS_PATH + "/iotjs_modules/")
+}
+
+
+iotjs_module_t.resolveDirectories = function(id, parent) {
+  var dirs = moduledirs;
+  if(parent) {
+    if(!parent.dirs){
+      parent.dirs = [];
+    }
+    dirs = parent.dirs.concat(dirs);
+  }
+  return dirs;
+};
+
+
+iotjs_module_t.resolveFilepath = function(id, directories) {
+
+  for(var i = 0; i<directories.length ; i++) {
+    var dir = directories[i];
+    // 1. 'id'
+    var filepath = iotjs_module_t.tryPath(dir+id);
+
+    if(filepath){
+      return filepath;
+    }
+
+    // 2. 'id.js'
+    filepath = iotjs_module_t.tryPath(dir+id+'.js');
+
+    if(filepath){
+      return filepath;
+    }
+
+    // 3. package path id/
+    var packagepath = dir + id;
+    var jsonpath = packagepath + "/package.json";
+    filepath = iotjs_module_t.tryPath(jsonpath);
+    if(filepath){
+      var pkgSrc = process.readSource(jsonpath);
+      var pkgMainFile = JSON.parse(pkgSrc).main;
+      filepath = iotjs_module_t.tryPath(packagepath + "/" + pkgMainFile);
+      if(filepath){
+        return filepath;
+      }
+      // index.js
+      filepath = iotjs_module_t.tryPath(packagepath + "/" + "index.js");
+      if(filepath){
+        return filepath;
+      }
+    }
+
+  }
+
+  return false;
+};
+
+
+iotjs_module_t.resolveModPath = function(id, parent) {
+
+  // 0. resolve Directory for lookup
+  var directories = iotjs_module_t.resolveDirectories(id, parent);
+
+  var filepath = iotjs_module_t.resolveFilepath(id, directories);
+
+  if(filepath){
+    return filepath;
+  }
+
+  return false;
+};
+
+
+iotjs_module_t.tryPath = function(path) {
+  try {
+    var stats = fs.statSync(path);
+    if(stats && !stats.isDirectory()) {
+      return path;
+    }
+  } catch (ex) {}
+
+  return false;
+};
+
+
+iotjs_module_t.load = function(id, parent, isMain) {
+  if(process.native_sources[id]){
+    return Native.require(id);
+  }
+  var module = new iotjs_module_t(id, parent);
+
+  var modPath = iotjs_module_t.resolveModPath(module.id, module.parent);
+
+  var cachedModule = iotjs_module_t.cache[modPath];
+  if (cachedModule) {
+    return cachedModule.exports;
+  }
+
+  if (!modPath) {
+    throw new Error('Module not found: ' + id);
+  }
+
+  module.filename = modPath;
+  module.dirs = [modPath.substring(0, modPath.lastIndexOf('/') + 1)];
+  module.compile();
+
+  iotjs_module_t.cache[modPath] = module;
+
+  return module.exports;
+};
+
+
+iotjs_module_t.prototype.compile = function() {
+  var source = process.readSource(this.filename);
+  var fn = process.compile(this.filename, source);
+  fn.call(this.exports, this.exports, this.require.bind(this), this);
+};
+
+
+iotjs_module_t.runMain = function(){
+  iotjs_module_t.load(process.argv[1], null, true);
+  while(process._onNextTick());
+};
+
+iotjs_module_t.prototype.require = function(id) {
+  return iotjs_module_t.load(id, this);
+};
diff --git a/src/js/net.js b/src/js/net.js
new file mode 100644 (file)
index 0000000..8cb3eef
--- /dev/null
@@ -0,0 +1,660 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var EventEmitter = require('events').EventEmitter;
+var stream = require('stream');
+var util = require('util');
+var assert = require('assert');
+
+var TCP = process.binding(process.binding.tcp);
+
+
+function createTCP() {
+  var tcp = new TCP();
+  return tcp;
+}
+
+
+function SocketState(options) {
+  // 'true' during connection handshaking.
+  this.connecting = false;
+
+  // become 'true' when connection established.
+  this.connected = false;
+
+  this.writable = true;
+  this.readable = true;
+
+  this.destroyed = false;
+
+  this.allowHalfOpen = options && options.allowHalfOpen || false;
+}
+
+
+function Socket(options) {
+  if (!(this instanceof Socket)) {
+    return new Socket(options);
+  }
+
+  if (util.isUndefined(options)) {
+    options = {};
+  }
+
+  stream.Duplex.call(this, options);
+
+  this._timer = null;
+  this._timeout = 0;
+
+  this._socketState = new SocketState(options);
+
+  if (options.handle) {
+    this._handle = options.handle;
+    this._handle.owner = this;
+  }
+
+  this.on('finish', onSocketFinish);
+  this.on('end', onSocketEnd);
+}
+
+
+// Socket inherits Duplex.
+util.inherits(Socket, stream.Duplex);
+
+
+Socket.prototype.connect = function() {
+  var self = this;
+  var state = self._socketState;
+
+  var args = normalizeConnectArgs(arguments);
+  var options = args[0];
+  var callback = args[1];
+
+  if (state.connecting || state.connected) {
+    return self;
+  }
+
+  if (!self._handle) {
+    self._handle = createTCP();
+    self._handle.owner = self;
+  }
+
+  if (util.isFunction(callback)) {
+    self.once('connect', callback);
+  }
+
+  resetSocketTimeout(self);
+
+  state.connecting = true;
+
+  var dns = require('dns');
+  var host = options.host ? options.host : 'localhost';
+  var port = options.port;
+  var dnsopts = {
+    family: options.family >>> 0,
+    hints: 0
+  };
+
+  if (!util.isNumber(port) || port < 0 || port > 65535)
+    throw new RangeError('port should be >= 0 and < 65536: ' + options.port);
+
+  if (dnsopts.family !== 0 && dnsopts.family !== 4 && dnsopts.family !== 6)
+    throw new RangeError('family should be 4 or 6: ' + dnsopts.family);
+
+  self._host = host;
+  dns.lookup(host, dnsopts, function(err, ip, family) {
+    if (self._socketState.destroyed) {
+      return;
+    }
+    self.emit('lookup', err, ip, family);
+
+    if (err) {
+      process.nextTick(function() {
+        self.emit('error', err);
+        self.destroy();
+      });
+    } else {
+      resetSocketTimeout(self);
+      connect(self, ip, port);
+    }
+  });
+
+  return self;
+};
+
+
+Socket.prototype.write = function(data, callback) {
+  if (!util.isString(data) && !util.isBuffer(data)) {
+    throw new TypeError('invalid argument');
+  }
+
+  return stream.Duplex.prototype.write.call(this, data, callback);
+};
+
+
+Socket.prototype._write = function(chunk, callback, afterWrite) {
+  assert(util.isBuffer(chunk));
+  assert(util.isFunction(afterWrite));
+
+  var self = this;
+
+  resetSocketTimeout(self);
+
+  self._handle.owner = self;
+
+  self._handle.write(chunk, function(status) {
+    afterWrite(status);
+    if (util.isFunction(callback)) {
+      callback.call(self, status);
+    }
+  });
+};
+
+
+Socket.prototype.end = function(data, callback) {
+  var self = this;
+  var state = self._socketState;
+
+  // end of writable stream.
+  stream.Writable.prototype.end.call(self, data, callback);
+
+  // this socket is no longer writable.
+  state.writable = false;
+};
+
+
+// Destroy this socket as fast as possible.
+Socket.prototype.destroy = function() {
+  var self = this;
+  var state = self._socketState;
+
+  if (state.destroyed) {
+    return;
+  }
+
+  if (state.writable) {
+    self.end();
+  }
+
+  // unset timeout
+  clearSocketTimeout(self);
+
+  if (self._writableState.ended && self._handle) {
+    close(self);
+    state.destroyed = true;
+  } else {
+    self.once('finish', function() {
+      self.destroy();
+    });
+  }
+};
+
+
+// Destroy this socket as fast as possible if this socket is no longer readable.
+Socket.prototype.destroySoon = function() {
+  var self = this;
+  var state = self._socketState;
+
+  if (state.writable) {
+    self.end();
+  }
+
+  if (self._writableState.finished) {
+    self.destroy();
+  } else {
+    self.once('finish', self.destroy);
+  }
+}
+
+
+Socket.prototype.setKeepAlive = function(enable, delay) {
+  var self = this;
+  enable = +Boolean(enable);
+  if (self._handle && self._handle.setKeepAlive) {
+    self._handle.setKeepAlive(enable, ~~(delay / 1000));
+  }
+};
+
+
+Socket.prototype.address = function() {
+  if (!this._handle || !this._handle.getsockname) {
+    return {};
+  }
+  if (!this._sockname) {
+    var out = {};
+    var err = this._handle.getsockname(out);
+    if (err) return {};  // FIXME(bnoordhuis) Throw?
+    this._sockname = out;
+  }
+  return this._sockname;
+};
+
+
+Socket.prototype.setTimeout = function(msecs, callback) {
+  var self = this;
+
+  self._timeout = msecs;
+  clearSocketTimeout(self);
+
+  if (msecs === 0) {
+    if (callback) {
+      self.removeListener('timeout', callback);
+    }
+  } else {
+    self._timer = setTimeout(function() {
+      self.emit('timeout');
+      clearSocketTimeout(self);
+    }, msecs);
+    if (callback) {
+      self.once('timeout', callback);
+    }
+  }
+};
+
+
+function connect(socket, ip, port) {
+  var afterConnect = function(status) {
+    var state = socket._socketState;
+    state.connecting = false;
+
+    if (state.destroyed) {
+      return;
+    }
+
+    if (status == 0) {
+      onSocketConnect(socket);
+      socket.emit('connect');
+    } else {
+      socket.destroy();
+      emitError(socket, new Error('connect failed - status: ' +
+        TCP.errname(status)));
+    }
+  };
+
+  var err = socket._handle.connect(ip, port, afterConnect);
+  if (err) {
+    emitError(socket, new Error('connect failed - status: ' +
+      TCP.errname(err)));
+  }
+}
+
+
+function close(socket) {
+  socket._handle.owner = socket;
+  socket._handle.onclose = function() {
+    socket.emit('close');
+  };
+
+  var handle = socket._handle;
+  socket._handle = null;
+  handle.close();
+
+  if (socket._server) {
+    var server = socket._server;
+    server._socketCount--;
+    server._emitCloseIfDrained();
+    socket._server = null;
+  }
+}
+
+
+function resetSocketTimeout(socket) {
+  var state = socket._socketState;
+
+  if (!state.destroyed) {
+    // start timeout over again
+    clearSocketTimeout(socket);
+    socket._timer = setTimeout(function() {
+      socket.emit('timeout');
+      clearSocketTimeout(socket);
+    }, socket._timeout);
+  }
+};
+
+
+function clearSocketTimeout(socket) {
+  if (socket._timer) {
+    clearTimeout(socket._timer);
+    socket._timer = null;
+  }
+};
+
+
+function emitError(socket, err) {
+  socket.emit('error', err);
+}
+
+
+function maybeDestroy(socket) {
+  var state = socket._socketState;
+
+  if (!state.connecting &&
+      !state.writable &&
+      !state.readable) {
+    socket.destroy();
+  }
+}
+
+
+function onSocketConnect(socket) {
+  var state = socket._socketState;
+
+  state.connecting = false;
+  state.connected = true;
+
+  resetSocketTimeout(socket);
+
+  socket._readyToWrite();
+
+  // `readStart` on next tick, after connection event handled.
+  process.nextTick(function() {
+    socket._handle.owner = socket;
+    socket._handle.onread = onread;
+    socket._handle.readStart();
+  });
+}
+
+
+function onread(socket, nread, isEOF, buffer) {
+  var state = socket._socketState;
+
+  resetSocketTimeout(socket);
+
+  if (isEOF) {
+    // pushing readable stream null means EOF.
+    stream.Readable.prototype.push.call(socket, null);
+
+    if (socket._readableState.length == 0) {
+      // this socket is no longer readable.
+      state.readable = false;
+      // destroy if this socket is not writable.
+      maybeDestroy(socket);
+    }
+  } else if (nread < 0) {
+    var err = new Error('read error: ' + nread);
+    stream.Readable.prototype.error.call(socket, err);
+  } else if (nread > 0) {
+    if (process.platform  != 'nuttx') {
+      stream.Readable.prototype.push.call(socket, buffer);
+      return;
+    }
+
+    var str = buffer.toString();
+    var eofNeeded = false;
+    if (str.length >= 6
+      && str.substr(str.length - 6, str.length) == '\\e\\n\\d') {
+      eofNeeded  = true;
+      buffer = buffer.slice(0, str.length - 6);
+    }
+
+    if (str.length == 6 && eofNeeded) {
+      // Socket.prototype.end with no argument
+    } else {
+      stream.Readable.prototype.push.call(socket, buffer);
+    }
+
+    if (eofNeeded) {
+      onread(socket, 0, true, null);
+    }
+  }
+}
+
+
+// Writable stream finished.
+function onSocketFinish() {
+  var self = this;
+  var state = self._socketState;
+
+  if (!state.readable || self._readableState.ended || !self._handle) {
+    // no readable stream or ended, destroy(close) socket.
+    return self.destroy();
+  } else {
+    // Readable stream alive, shutdown only outgoing stream.
+    var err = self._handle.shutdown(function() {
+      if (self._readableState.ended) {
+        self.destroy();
+      }
+    });
+  }
+}
+
+
+// Readable stream ended.
+function onSocketEnd() {
+  var state = this._socketState;
+
+  maybeDestroy(this);
+
+  if (!state.allowHalfOpen) {
+    this.destroySoon();
+  }
+}
+
+
+
+function Server(options, connectionListener) {
+  if (!(this instanceof Server)) {
+    return new Server(options, connectionListener);
+  }
+
+  EventEmitter.call(this);
+
+  if (util.isFunction(options)) {
+    connectionListener = options;
+    options = {};
+  } else {
+    options = options || {};
+  }
+
+  if (util.isFunction(connectionListener)) {
+    this.on('connection', connectionListener);
+  }
+
+  this._handle = null;
+  this._socketCount = 0;
+
+  this.allowHalfOpen = options.allowHalfOpen || false;
+}
+
+// Server inherits EventEmitter.
+util.inherits(Server, EventEmitter);
+
+
+// listen
+Server.prototype.listen = function() {
+  var self = this;
+
+  var args = normalizeListenArgs(arguments);
+
+  var options = args[0];
+  var callback = args[1];
+
+  var port = options.port;
+  var host = util.isString(options.host) ? options.host : '0.0.0.0';
+  var backlog = util.isNumber(options.backlog) ? options.backlog : 511;
+
+  if (!util.isNumber(port)) {
+    throw new Error('invalid argument - need port number');
+  }
+
+  // register listening event listener.
+  if (util.isFunction(callback)) {
+    self.once('listening', callback);
+  }
+
+  // Create server handle.
+  if (!self._handle) {
+    self._handle = createTCP();
+  }
+
+  // bind port
+  var err = self._handle.bind(host, port);
+  if (err) {
+    self._handle.close();
+    return self.emit('error', err);
+  }
+
+  // listen
+  self._handle.onconnection = onconnection;
+  self._handle.createTCP = createTCP;
+  self._handle.owner = self;
+
+  var err = self._handle.listen(backlog);
+
+  if (err) {
+    self._handle.close();
+    return self.emit('error', err);
+  }
+
+  process.nextTick(function() {
+    if (self._handle) {
+      self.emit('listening');
+    }
+  });
+
+  return this;
+};
+
+
+Server.prototype.address = function() {
+  if (this._handle && this._handle.getsockname) {
+    var out = {};
+    this._handle.getsockname(out);
+    // TODO(bnoordhuis) Check err and throw?
+    return out;
+  }
+
+  return null;
+};
+
+
+Server.prototype.close = function(callback) {
+  if (util.isFunction(callback)) {
+    if (!this._handle) {
+      this.once('close', function() {
+        callback(new Error('Not running'));
+      });
+    } else {
+      this.once('close', callback);
+    }
+  }
+  if (this._handle) {
+    this._handle.close();
+    this._handle = null;
+  }
+  this._emitCloseIfDrained();
+  return this;
+};
+
+
+Server.prototype._emitCloseIfDrained = function() {
+  var self = this;
+
+  if (self._handle || self._socketCount > 0) {
+    return;
+  }
+
+  process.nextTick(function() {
+    self.emit('close');
+  });
+};
+
+
+// This function is called after server accepted connection request
+// from a client.
+//  This binding
+//   * server tcp handle
+//  Parameters
+//   * status - status code
+//   * clientHandle - client socket handle (tcp).
+function onconnection(status, clientHandle) {
+  var server = this.owner;
+
+  if (status) {
+    server.emit('error', new Error('accept error: ' + TCP.errname(status)));
+    return;
+  }
+
+  // Create socket object for connecting client.
+  var socket = new Socket({
+    handle: clientHandle,
+    allowHalfOpen: server.allowHalfOpen
+  });
+  socket._server = server;
+
+  onSocketConnect(socket);
+
+  server._socketCount++;
+
+  server.emit('connection', socket);
+}
+
+
+function normalizeListenArgs(args) {
+  var options = {};
+
+  if (util.isObject(args[0])) {
+    options = args[0];
+  } else {
+    var idx = 0;
+    options.port = args[idx++];
+    if (util.isString(args[idx])) {
+      options.host = args[idx++];
+    }
+    if (util.isNumber(args[idx])) {
+      options.backlog = args[idx++];
+    }
+  }
+
+  var cb = args[args.length - 1];
+
+  return util.isFunction(cb) ? [options, cb] : [options];
+}
+
+
+function normalizeConnectArgs(args) {
+  var options = {};
+
+  if (util.isObject(args[0])) {
+    options = args[0];
+  } else {
+    options.port = args[0];
+    if (util.isString(args[1])) {
+      options.host = args[1];
+    }
+  }
+
+  var cb = args[args.length - 1];
+
+  return util.isFunction(cb) ? [options, cb] : [options];
+}
+
+
+exports.createServer = function(options, callback) {
+  return new Server(options, callback);
+};
+
+
+// net.connect(options[, connectListener])
+// net.connect(port[, host][, connectListener])
+exports.connect = exports.createConnection = function() {
+  var args = normalizeConnectArgs(arguments);
+  var socket = new Socket(args[0]);
+  return Socket.prototype.connect.apply(socket, args);
+};
+
+
+module.exports.Socket = Socket;
+module.exports.Server = Server;
diff --git a/src/js/pwm.js b/src/js/pwm.js
new file mode 100644 (file)
index 0000000..da0c696
--- /dev/null
@@ -0,0 +1,241 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+var pwm = process.binding(process.binding.pwm);
+
+
+function Pwm() {
+  if (!(this instanceof Pwm)) {
+    return new Pwm();
+  }
+}
+
+Pwm.prototype.open = function(configuration, callback) {
+  return pwmPinOpen(configuration, callback);
+};
+
+
+function pwmPinOpen(configuration, callback) {
+  var _binding = null;
+
+  function PwmPin(configuration, callback) {
+    var self = this;
+    self._configuration = {};
+
+    if (util.isObject(configuration)) {
+      if (process.platform === 'linux') {
+        if (util.isNumber(configuration.chip)) {
+          self._configuration.chip = configuration.chip
+        } else {
+          self._configuration.chip = 0;
+        }
+      }
+
+      if (!util.isNumber(configuration.pin)) {
+        throw new TypeError(
+          'Bad configuration - pin is mandatory and should be Number');
+      } else {
+        self._configuration.pin = configuration.pin;
+      }
+    } else {
+      throw new TypeError('Bad arguments - configuration should be Object')
+    }
+
+    // validate configuration
+    var dutyCycle = configuration.dutyCycle;
+    var period = configuration.period;
+    if (!util.isNumber(period) && util.isNumber(configuration.frequency)) {
+      period = 1.0 / configuration.frequency;
+    }
+
+    if (util.isNumber(dutyCycle) && dutyCycle >= 0.0 && dutyCycle <= 1.0 &&
+      util.isNumber(period) && util.isFinite(period) && period > 0) {
+      self._configuration.dutyCycle = dutyCycle;
+      self._configuration.period = period;
+    }
+
+    _binding = new pwm(self._configuration, function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+
+    process.on('exit', (function(self) {
+      return function() {
+        if (!util.isNull(_binding)) {
+          self.closeSync();
+        }
+      };
+    })(this));
+  }
+
+  PwmPin.prototype._validatePeriod = function(period) {
+    if (!util.isNumber(period)) {
+      throw new TypeError('Period is not a number(' + typeof(period) + ')');
+    } else if (period < 0) {
+      throw new RangeError('Period(' + period + ') is negative');
+    }
+    return true;
+  };
+
+  PwmPin.prototype._validateFrequency = function(frequency) {
+    if (!util.isNumber(frequency)) {
+      throw new TypeError('Frequency is not a number(' +
+        typeof(frequency) + ')');
+    } else if (frequency <= 0) {
+      throw RangeError('Nonpositivie frequency of ' + frequency);
+    }
+    return true;
+  };
+
+  PwmPin.prototype._validateDutyCycle = function(dutyCycle) {
+    if (!util.isNumber(dutyCycle)) {
+      throw TypeError('DutyCycle is not a number(' + typeof(dutyCycle) + ')');
+    } else if (dutyCycle < 0.0 || dutyCycle > 1.0) {
+      throw RangeError('DutyCycle of ' + dutyCycle + ' out of bounds [0..1]');
+    }
+    return true;
+  };
+
+  PwmPin.prototype.setPeriod = function(period, callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('Pwm pin is not opened');
+    }
+
+    if (this._validatePeriod(period)) {
+      _binding.setPeriod(period, function(err) {
+        util.isFunction(callback) && callback.call(self, err);
+      });
+    }
+  };
+
+  PwmPin.prototype.setPeriodSync = function(period) {
+    if (util.isNull(_binding)) {
+      throw new Error('Pwm pin is not opened');
+    }
+
+    if (this._validatePeriod(period)) {
+      _binding.setPeriod(period);
+    }
+  };
+
+  PwmPin.prototype.setFrequency = function(frequency, callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('Pwm pin is not opened');
+    }
+
+    if (this._validateFrequency(frequency)) {
+      _binding.setPeriod(1.0 / frequency, function(err) {
+        util.isFunction(callback) && callback.call(self, err);
+      });
+    }
+  };
+
+  PwmPin.prototype.setFrequencySync = function(frequency) {
+    if (util.isNull(_binding)) {
+      throw new Error('Pwm pin is not opened');
+    }
+
+    if (this._validateFrequency(frequency)) {
+      _binding.setPeriod(1.0 / frequency);
+    }
+  };
+
+  PwmPin.prototype.setDutyCycle = function(dutyCycle, callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('Pwm pin is not opened');
+    }
+
+    // Check arguments.
+    if (this._validateDutyCycle(dutyCycle)) {
+      _binding.setDutyCycle(dutyCycle, function(err) {
+        util.isFunction(callback) && callback.call(self, err);
+      });
+    }
+  };
+
+  PwmPin.prototype.setDutyCycleSync = function(dutyCycle) {
+    if (util.isNull(_binding)) {
+      throw new Error('Pwm pin is not opened');
+    }
+
+    // Check arguments.
+    if (this._validateDutyCycle(dutyCycle)) {
+      _binding.setDutyCycle(dutyCycle);
+    }
+  };
+
+  PwmPin.prototype.setEnable = function(enable, callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('Pwm pin is not opened');
+    }
+
+    // Check arguments.
+    if (!util.isNumber(enable) && !util.isBoolean(enable)) {
+      throw new TypeError('enable is of type ' + typeof(enable));
+    }
+
+    _binding.setEnable(!!enable, function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+  };
+
+  PwmPin.prototype.setEnableSync = function(enable) {
+    if (util.isNull(_binding)) {
+      throw new Error('Pwm pin is not opened');
+    }
+
+    // Check arguments.
+    if (!util.isNumber(enable) && !util.isBoolean(enable)) {
+      throw new TypeError('enable is of type ' + typeof(enable));
+    }
+
+    _binding.setEnable(!!enable);
+  };
+
+  PwmPin.prototype.close = function(callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('Pwm pin is not opened');
+    }
+
+    _binding.close(function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+    _binding = null;
+  };
+
+  PwmPin.prototype.closeSync = function() {
+    if (util.isNull(_binding)) {
+      throw new Error('Pwm pin is not opened');
+    }
+
+    _binding.close();
+    _binding = null;
+  };
+
+  return new PwmPin(configuration, callback);
+}
+
+
+module.exports = Pwm;
diff --git a/src/js/spi.js b/src/js/spi.js
new file mode 100644 (file)
index 0000000..591d10a
--- /dev/null
@@ -0,0 +1,224 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+var spi = process.binding(process.binding.spi);
+
+var defaultConfiguration = {
+  mode : spi.MODE[0],
+  chipSelect : spi.CHIPSELECT.NONE,
+  maxSpeed : 500000,
+  bitsPerWord : 8,
+  bitOrder : spi.BITORDER.MSB,
+  loopback : false
+};
+
+
+function Spi() {
+  if (!(this instanceof Spi)) {
+    return new Spi();
+  }
+}
+
+Spi.prototype.open = function(configuration, callback) {
+  return spiBusOpen(configuration, callback);
+};
+
+Spi.prototype.MODE = spi.MODE;
+Spi.prototype.CHIPSELECT = spi.CHIPSELECT;
+Spi.prototype.BITORDER = spi.BITORDER;
+
+
+function spiBusOpen(configuration, callback) {
+  var _binding = null;
+
+  function SpiBus(configuration, callback) {
+    var self = this;
+
+    if (process.platform === 'linux') {
+      if (!util.isString(configuration.device)) {
+        throw new TypeError('Bad configuration - device: String');
+      }
+    } else if (process.platform === 'nuttx') {
+      if (!util.isNumber(configuration.bus)) {
+        throw new TypeError('Bad configuration - bus: Number');
+      }
+    }
+
+    // validate mode
+    var mode = configuration.mode;
+    if (!util.isUndefined(mode)) {
+      if (mode !== spi.MODE[0] && mode !== spi.MODE[1] &&
+          mode !== spi.MODE[2] && mode !== spi.MODE[3]) {
+        throw new TypeError(
+          'Bad arguments - mode should be MODE[0], [1], [2] or [3]');
+      }
+    } else {
+      configuration.mode = defaultConfiguration.mode;
+    }
+
+    // validate chip-select
+    var chipSelect = configuration.chipSelect;
+    if (!util.isUndefined(chipSelect)) {
+      if (chipSelect != spi.CHIPSELECT.NONE &&
+          chipSelect != spi.CHIPSELECT.HIGH) {
+        throw new TypeError(
+          'Bad arguments - chipSelect should be CHIPSELECT.NONE or HIGH');
+      }
+    } else {
+      configuration.chipSelect = defaultConfiguration.chipSelect;
+    }
+
+    // validate max speed
+    if (!util.isUndefined(configuration.maxSpeed)) {
+      if (!util.isNumber(configuration.maxSpeed)) {
+        throw new TypeError('Bad arguments - maxSpeed should be Number');
+      }
+    } else {
+      configuration.maxSpeed = defaultConfiguration.maxSpeed
+    }
+
+    // validate bits per word
+    var bitsPerWord = configuration.bitsPerWord;
+    if (!util.isUndefined(bitsPerWord)) {
+      if (bitsPerWord != 8 && bitsPerWord != 9) {
+        throw new TypeError('Bad arguments - bitsPerWord should be 8 or 9');
+      }
+    } else {
+      configuration.bitsPerWord = defaultConfiguration.bitsPerWord;
+    }
+
+    // validate bit order
+    var bitOrder = configuration.bitOrder;
+    if (!util.isUndefined(bitOrder)) {
+      if (bitOrder != spi.BITORDER.MSB && bitOrder != spi.BITORDER.LSB) {
+        throw new TypeError(
+          'Bad arguments - bitOrder should be BITORDER.MSB or LSB');
+      }
+    } else {
+      configuration.bitOrder = defaultConfiguration.bitOrder;
+    }
+
+    // validate loopback
+    var loopback = configuration.loopback;
+    if (!util.isUndefined(loopback)) {
+      if (!util.isBoolean(loopback)) {
+        throw new TypeError('Bad arguments - loopback should be Boolean');
+      }
+    } else {
+      configuration.loopback = defaultConfiguration.loopback;
+    }
+
+    _binding = new spi.Spi(configuration, function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+
+    process.on('exit', (function(self) {
+    return function() {
+      if (!util.isNull(_binding)) {
+        self.closeSync();
+      }
+    };
+    })(this));
+  }
+
+  SpiBus.prototype.transfer = function(txBuffer, rxBuffer, callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('SPI bus is not opened');
+    }
+
+    if (util.isUndefined(txBuffer.length) || util.isUndefined(rxBuffer.length)
+        || txBuffer.length <= 0 || rxBuffer.length <= 0
+        || txBuffer.length != rxBuffer.length) {
+      throw new Error('Bad arguments - buffer length');
+    }
+
+    var rxLength = rxBuffer.length;
+    var afterCallback = function(err, buffer) {
+      for (var i = 0; i < rxLength; i++) {
+        rxBuffer[i] = buffer[i];
+      }
+
+      util.isFunction(callback) && callback.call(self, err);
+    };
+
+    if (util.isArray(txBuffer) && util.isArray(rxBuffer)) {
+      _binding.transferArray(txBuffer, rxBuffer, afterCallback);
+    } else if (util.isBuffer(txBuffer) && util.isBuffer(rxBuffer)) {
+      _binding.transferBuffer(txBuffer, rxBuffer, afterCallback);
+    } else {
+      throw new TypeError('Bad arguments - buffer should be Array or Buffer');
+    }
+  };
+
+  SpiBus.prototype.transferSync = function(txBuffer, rxBuffer) {
+    if (util.isNull(_binding)) {
+      throw new Error('SPI bus is not opened');
+    }
+
+    if (util.isUndefined(txBuffer.length) || util.isUndefined(rxBuffer.length)
+      || txBuffer.length <= 0 || rxBuffer.length <= 0
+      || txBuffer.length != rxBuffer.length) {
+      throw new Error('Bad arguments - buffer length');
+    }
+
+    var data = null;
+    if (util.isArray(txBuffer) && util.isArray(rxBuffer)) {
+      data = _binding.transferArray(txBuffer, rxBuffer);
+    } else if (util.isBuffer(txBuffer) && util.isBuffer(rxBuffer)) {
+      data = _binding.transferBuffer(txBuffer, rxBuffer);
+    } else {
+      throw new TypeError('Bad arguments - buffer should be Array or Buffer');
+    }
+
+    if (data !== null && (util.isArray(data) || util.isBuffer(data)) &&
+      data.length === rxBuffer.length) {
+      for (var i = 0; i < rxBuffer.length; i++) {
+        rxBuffer[i] = data[i];
+      }
+    } else {
+      throw new Error('Spi Transfer Error');
+    }
+  };
+
+  SpiBus.prototype.close = function(callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('SPI bus is not opened');
+    }
+
+    _binding.close(function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+    _binding = null;
+  };
+
+  SpiBus.prototype.closeSync = function() {
+    if (util.isNull(_binding)) {
+      throw new Error('SPI bus is not opened');
+    }
+
+    _binding.close();
+    _binding = null;
+  };
+
+  return new SpiBus(configuration, callback);
+}
+
+
+module.exports = Spi;
diff --git a/src/js/stm32f4dis.js b/src/js/stm32f4dis.js
new file mode 100644 (file)
index 0000000..2cbcb06
--- /dev/null
@@ -0,0 +1,16 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+module.exports = process.binding(process.binding.stm32f4dis);
diff --git a/src/js/stream.js b/src/js/stream.js
new file mode 100644 (file)
index 0000000..bd31230
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var eventEmitter = require('events').EventEmitter;
+var util = require('util');
+
+
+function Stream() {
+  eventEmitter.call(this);
+};
+
+
+util.inherits(Stream, eventEmitter);
+
+
+exports.Stream = Stream;
+
+exports.Readable = require('stream_readable');
+exports.Writable = require('stream_writable');
+exports.Duplex = require('stream_duplex');
diff --git a/src/js/stream_duplex.js b/src/js/stream_duplex.js
new file mode 100644 (file)
index 0000000..7beb75c
--- /dev/null
@@ -0,0 +1,46 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var util = require('util');
+var Readable = require('stream_readable');
+var Writable = require('stream_writable');
+
+
+function Duplex(options) {
+  if (!(this instanceof Duplex)) {
+    return new Duplex(options);
+  }
+
+  Readable.call(this, options);
+  Writable.call(this, options);
+}
+
+// Duplex inherits Readable.
+util.inherits(Duplex, Readable);
+
+
+// Duplex should also inherits Writable but there are no way for inheriting
+// from multiple parents. Copy properties from Writable.
+var keys = Object.keys(Writable.prototype);
+for (var i = 0; i < keys.length; ++i) {
+  var key = keys[i];
+  if (!Duplex.prototype[key]) {
+    Duplex.prototype[key] = Writable.prototype[key];
+  }
+}
+
+
+module.exports = Duplex;
diff --git a/src/js/stream_readable.js b/src/js/stream_readable.js
new file mode 100644 (file)
index 0000000..19112f5
--- /dev/null
@@ -0,0 +1,206 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var Stream = require('stream').Stream;
+var util = require('util');
+var assert = require('assert');
+
+
+function ReadableState(options) {
+  options = options || {};
+
+  // the internal array of buffers.
+  this.buffer = [];
+
+  // the sum of length of buffers.
+  this.length = 0;
+
+  this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+  // true if in flowing mode.
+  this.flowing = false;
+
+  // become `true` when the stream meet EOF.
+  this.ended = false;
+
+  // become `true` just before emit 'end' event.
+  this.endEmitted = false;
+};
+
+
+function Readable(options) {
+  if (!(this instanceof Readable)) {
+    return new Readable(options);
+  }
+
+  this._readableState = new ReadableState(options);
+
+  Stream.call(this);
+};
+
+util.inherits(Readable, Stream);
+
+
+Readable.prototype.read = function(n) {
+  var state = this._readableState;
+  var res;
+
+  if (!util.isNumber(n) || n > state.length) {
+    n = state.length;
+  } else if (n < 0) {
+    n = 0;
+  }
+
+  if (n > 0) {
+    res = readBuffer(this, n);
+  } else {
+    res = null;
+  }
+
+  if (state.ended && state.length == 0) {
+    emitEnd(this);
+  }
+
+  return res;
+};
+
+
+Readable.prototype.on = function(ev, cb) {
+  var res = Stream.prototype.on.call(this, ev, cb);
+  if (ev === 'data') {
+    this.resume();
+  }
+  return res;
+};
+
+
+Readable.prototype.isPaused = function() {
+  return !this._readableState.flowing;
+};
+
+
+Readable.prototype.pause = function() {
+  var state = this._readableState;
+  if (state.flowing) {
+    state.flowing = false;
+    this.emit('pause');
+  }
+  return this;
+};
+
+
+Readable.prototype.resume = function() {
+  var state = this._readableState;
+  if (!state.flowing) {
+    state.flowing = true;
+    if (state.length > 0) {
+      emitData(this, readBuffer(this));
+    }
+  }
+  return this;
+};
+
+
+Readable.prototype.error = function(error) {
+  this.emit('error', error);
+};
+
+
+Readable.prototype.push = function(chunk, encoding) {
+  var state = this._readableState;
+
+  if (util.isNull(chunk)) {
+    onEof(this);
+  } else if (!util.isString(chunk) &&
+             !util.isBuffer(chunk)) {
+    this.error(TypeError('Invalid chunk'));
+  } else if (state.ended) {
+    this.error(Error('stream.push() after EOF'));
+  } else {
+    if (util.isString(chunk)) {
+      encoding = encoding || state.defaultEncoding;
+      chunk = new Buffer(chunk, encoding);
+    }
+    if (state.flowing) {
+      emitData(this, chunk);
+    } else {
+      state.length += chunk.length;
+      state.buffer.push(chunk);
+      this.emit('readable');
+    }
+  }
+};
+
+
+function readBuffer(stream, n) {
+  var state = stream._readableState;
+  var res;
+
+  if (n == 0 || util.isNullOrUndefined(n)) {
+    n = state.length;
+  }
+
+  if (state.buffer.length === 0 || state.length === 0) {
+    res = null;
+  } else if (n >= state.length) {
+    res = Buffer.concat(state.buffer);
+    state.buffer = [];
+    state.length = 0;
+  } else {
+    throw new Error('not implemented');
+  }
+
+  return res;
+};
+
+
+function emitEnd(stream) {
+  var state = stream._readableState;
+
+  if (stream.length > 0 || !state.ended) {
+    throw new Error('stream ended on non-EOF stream');
+  }
+  if (!state.endEmitted) {
+    state.endEmitted = true;
+    stream.emit('end');
+  }
+};
+
+
+function emitData(stream, data) {
+  var state = stream._readableState;
+
+  assert.equal(readBuffer(stream), null);
+  stream.emit('data', data);
+
+  if (state.ended && state.length == 0) {
+    emitEnd(stream);
+  }
+};
+
+
+function onEof(stream) {
+  var state = stream._readableState;
+
+  state.ended = true;
+
+  if (state.length == 0) {
+    emitEnd(stream);
+  }
+};
+
+
+module.exports = Readable;
diff --git a/src/js/stream_writable.js b/src/js/stream_writable.js
new file mode 100644 (file)
index 0000000..e4b285e
--- /dev/null
@@ -0,0 +1,270 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var stream = require('stream');
+var util = require('util');
+var Stream = stream.Stream;
+var Duplex = stream.Duplex;
+
+var defaultHighWaterMark = 128;
+
+
+function WriteReq(chunk, callback) {
+  this.chunk = chunk;
+  this.callback = callback;
+}
+
+
+function WritableState(options) {
+  // buffer of WriteReq
+  this.buffer = [];
+
+  // total length of messages not flushed yet.
+  this.length = 0;
+
+  // high water mark.
+  // The point where write() starts retuning false.
+  this.highWaterMark = (options && util.isNumber(options.highWaterMark)) ?
+    options.highWaterMark : defaultHighWaterMark;
+
+  // 'true' if stream is ready to write.
+  this.ready = false;
+
+  // `true` if stream is writing down data underlying system.
+  this.writing = false;
+
+  // the length of message being writing.
+  this.writingLength = 0;
+
+  // turn 'true' when some messages are buffered. After buffered messages are
+  // all sent, 'drain' event will be emitted.
+  this.needDrain = false;
+
+  // become `true` when `end()` called.
+  this.ending = false;
+
+  // become `true` when there are no date to write.
+  this.ended = false;
+}
+
+
+function Writable(options) {
+  if (!(this instanceof Writable) && !(this instanceof stream.Duplex)) {
+    return new Writable(options);
+  }
+
+  this._writableState = new WritableState(options);
+
+  Stream.call(this);
+}
+
+
+util.inherits(Writable, Stream);
+
+
+// Write chunk of data to underlying system stream.
+//  Control flow in general description
+//    Writable.prototype.write()
+//      ||
+//    writeOrBuffer()
+//      ||
+//    doWrite()
+//      ||
+//    ConcreteStream.prototype._write()
+//      |
+//    underlying stream
+//      |
+//    Writable.prototype._onwrite()
+Writable.prototype.write = function(chunk, callback) {
+  var state = this._writableState;
+
+  if (state.ended) {
+    writeAfterEnd(this, callback);
+    return false;
+  }
+
+  return writeOrBuffer(this, chunk, callback);
+};
+
+
+// This function object never to be called. concrete stream should override
+// this method.
+Writable.prototype._write = function(chunk, callback, onwrite) {
+  throw new Error('unreachable');
+}
+
+
+Writable.prototype.end = function(chunk, callback) {
+  var state = this._writableState;
+
+  // Because NuttX cannot poll 'EOF',so forcely raise EOF event.
+  if (process.platform == 'nuttx') {
+    if (!state.ending) {
+      if (util.isNullOrUndefined(chunk)) {
+        chunk = '\\e\\n\\d';
+      } else {
+        chunk += '\\e\\n\\d';
+      }
+    }
+  }
+
+  if (!util.isNullOrUndefined(chunk)) {
+    this.write(chunk);
+  }
+
+  if (!state.ending) {
+    endWritable(this, callback);
+  }
+};
+
+
+// When stream is ready to write, concrete stream implementation should call
+// this method to inform it.
+Writable.prototype._readyToWrite = function() {
+  var state = this._writableState;
+
+  state.ready = true;
+  writeBuffered(this);
+};
+
+
+// A chunk of data has been written down to stream.
+Writable.prototype._onwrite = function() {
+  var state = this._writableState;
+
+  state.length -= state.writingLength;
+
+  state.writing = false;
+  state.writingLength = 0;
+
+  writeBuffered(this);
+};
+
+
+// A write call occured after end.
+function writeAfterEnd(stream, callback) {
+  var err = new Error('write after end');
+  stream.emit('error', err);
+  if (util.isFunction(callback)) {
+    process.nextTick(callback.bind(undefined, err));
+  }
+}
+
+
+function writeOrBuffer(stream, chunk, callback) {
+  var state = stream._writableState;
+
+  if (util.isString(chunk)) {
+    chunk = new Buffer(chunk);
+  }
+
+  state.length += chunk.length;
+
+  if (!state.ready || state.writing || state.buffer.length > 0) {
+    // stream not yet ready or there is pending request to write.
+    // push this request into write queue.
+    state.buffer.push(new WriteReq(chunk, callback));
+  } else {
+    // here means there is no pending data. write out.
+    doWrite(stream, chunk, callback);
+  }
+
+  // total length of buffered message exceeded high water mark.
+  if (state.length >= state.highWaterMark) {
+    state.needDrain = true;
+  }
+
+  return !state.needDrain;
+}
+
+
+function writeBuffered(stream) {
+  var state = stream._writableState;
+  if (!state.writing) {
+    if (state.buffer.length == 0) {
+      onEmptyBuffer(stream);
+    } else {
+      var req = state.buffer.shift();
+      doWrite(stream, req.chunk, req.callback);
+    }
+  }
+}
+
+
+function doWrite(stream, chunk, callback) {
+  var state = stream._writableState;
+
+  if (state.writing) {
+    return new Error('write during writing');
+  }
+
+  // The stream is now writing.
+  state.writing = true;
+  state.writingLength = chunk.length;
+
+  // Write down the chunk data.
+  stream._write(chunk, callback, stream._onwrite.bind(stream));
+}
+
+
+// No more data to write. if this stream is being finishing, emit 'finish'.
+function onEmptyBuffer(stream) {
+  var state = stream._writableState;
+  if (state.ending) {
+    emitFinish(stream);
+  } else if (state.needDrain) {
+    emitDrain(stream);
+  }
+}
+
+
+// Writable.prototype.end() was called. register callback for 'finish' event.
+// After finish writing out buffered data, 'finish' event will be fired.
+function endWritable(stream, callback) {
+  var state = stream._writableState;
+  state.ending = true;
+  if (callback) {
+    stream.once('finish', callback);
+  }
+
+  // If nothing left, emit finish event at next tick.
+  if (!state.writing && state.buffer.length == 0) {
+    process.nextTick(emitFinish.bind(undefined, stream));
+  }
+}
+
+
+// Emit 'drain' event
+function emitDrain(stream) {
+  var state = stream._writableState;
+  if (state.needDrain) {
+    state.needDrain = false;
+    stream.emit('drain');
+  }
+}
+
+
+// Emit 'finish' event to notify this stream is finished.
+function emitFinish(stream) {
+  var state = stream._writableState;
+  if (!state.ended) {
+    state.ended = true;
+    stream.emit('finish');
+  }
+}
+
+
+module.exports = Writable;
diff --git a/src/js/testdriver.js b/src/js/testdriver.js
new file mode 100644 (file)
index 0000000..1dc0d74
--- /dev/null
@@ -0,0 +1,16 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+module.exports = process.binding(process.binding.testdriver);
diff --git a/src/js/timers.js b/src/js/timers.js
new file mode 100644 (file)
index 0000000..dedc473
--- /dev/null
@@ -0,0 +1,107 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var Timer = process.binding(process.binding.timer);
+
+var util = require('util');
+
+var TIMEOUT_MAX = 2147483647; // 2^31-1
+
+
+function Timeout(after) {
+  this.after = after;
+  this.isrepeat = false;
+  this.callback = null;
+  this.handler = null;
+}
+
+
+Timer.prototype.handleTimeout = function() {
+  var timeout = this.timeoutObj; // 'this' is Timer object
+  if (timeout && timeout.callback) {
+    timeout.callback();
+    if (!timeout.isrepeat) {
+      timeout.unref();
+    }
+  }
+};
+
+
+Timeout.prototype.ref = function() {
+  var repeat = 0;
+  var handler = new Timer();
+
+  if (this.isrepeat) {
+    repeat = this.after;
+
+  }
+
+  handler.timeoutObj = this;
+  this.handler = handler;
+
+  handler.start(this.after, repeat);
+};
+
+
+Timeout.prototype.unref = function() {
+  this.callback = undefined;
+  if (this.handler) {
+    this.handler.timeoutObj = undefined;
+    this.handler.stop();
+    this.handler = undefined;
+  }
+};
+
+function timeoutConfigurator(isrepeat, callback, delay) {
+  if (!util.isFunction(callback)) {
+    throw new TypeError('Bad arguments: callback must be a Function');
+  }
+
+  delay *= 1;
+  if (delay < 1 || delay > TIMEOUT_MAX) {
+    delay = 1;
+  }
+
+  var timeout = new Timeout(delay);
+
+  // set timeout handler.
+  if (arguments.length <= 3) {
+    timeout.callback = callback;
+  } else {
+    var args = Array.prototype.slice.call(arguments, 3);
+    args.splice(0, 0, timeout);
+    timeout.callback = callback.bind.apply(callback, args);
+  }
+  timeout.isrepeat = isrepeat;
+  timeout.ref();
+
+  return timeout;
+}
+
+exports.setTimeout = timeoutConfigurator.bind(undefined, false);
+exports.setInterval = timeoutConfigurator.bind(undefined, true);
+
+function clearTimeoutBase(timeoutType, timeout) {
+  if (timeout) {
+    if (timeout instanceof Timeout) {
+      timeout.unref();
+    } else {
+       throw new Error(timeoutType + '() - invalid timeout');
+    }
+  }
+}
+
+exports.clearTimeout = clearTimeoutBase.bind(undefined, 'clearTimeout');
+exports.clearInterval = clearTimeoutBase.bind(undefined, 'clearInterval');
diff --git a/src/js/uart.js b/src/js/uart.js
new file mode 100644 (file)
index 0000000..253472e
--- /dev/null
@@ -0,0 +1,140 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var util = require('util');
+var uart = process.binding(process.binding.uart);
+
+// VALIDATION ARRAYS
+var BAUDRATE = [0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400
+                , 4800, 9600, 19200, 38400, 57600, 115200, 230400];
+var DATABITS = [5, 6, 7, 8];
+
+var defaultConfiguration = {
+  baudRate: 9600,
+  dataBits: 8
+};
+
+
+function Uart() {
+  if (!(this instanceof Uart)) {
+    return new Uart();
+  }
+}
+
+Uart.prototype.open = function(configuration, callback) {
+  return uartPortOpen(configuration, callback);
+};
+
+
+function uartPortOpen(configuration, callback) {
+  var _binding = null;
+
+  function UartPort(configuration, callback) { //constructor
+    var self = this;
+
+    if (util.isObject(configuration)) {
+      if (!util.isString(configuration.device)) {
+        throw new TypeError(
+          'Bad configuration - device is mandatory and should be String');
+      }
+    } else {
+      throw new TypeError('Bad arguments - configuration should be Object');
+    }
+
+    // validate baud rate
+    if (!util.isUndefined(configuration.baudRate)) {
+      if (BAUDRATE.indexOf(configuration.baudRate) === -1) {
+        throw new TypeError("Invalid 'baudRate': " + configuration.baudRate);
+      }
+    } else {
+      configuration.baudRate = defaultConfiguration.baudRate;
+    }
+
+    // validate data bits
+    if (!util.isUndefined(configuration.dataBits)) {
+      if (DATABITS.indexOf(configuration.dataBits) === -1) {
+        throw new TypeError("Invalid 'databits': " + configuration.dataBits);
+      }
+    } else {
+      configuration.dataBits = defaultConfiguration.dataBits;
+    }
+
+    EventEmitter.call(this);
+
+    _binding = new uart(configuration, this, function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+
+    process.on('exit', (function(self) {
+      return function() {
+        if (!util.isNull(_binding)) {
+          self.closeSync();
+        }
+      };
+    })(this));
+  }
+
+  util.inherits(UartPort, EventEmitter);
+
+  UartPort.prototype.write = function(buffer, callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('UART port is not opened');
+    }
+
+    _binding.write(buffer, function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+  };
+
+  UartPort.prototype.writeSync = function(buffer) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('UART port is not opened');
+    }
+
+    _binding.write(buffer);
+  };
+
+  UartPort.prototype.close = function(callback) {
+    var self = this;
+
+    if (util.isNull(_binding)) {
+      throw new Error('UART port is not opened');
+    }
+
+    _binding.close(function(err) {
+      util.isFunction(callback) && callback.call(self, err);
+    });
+    _binding = null;
+  };
+
+  UartPort.prototype.closeSync = function() {
+    if (util.isNull(_binding)) {
+      throw new Error('UART port is not opened');
+    }
+
+    _binding.close();
+    _binding = null;
+  };
+
+  return new UartPort(configuration, callback);
+}
+
+
+module.exports = Uart;
diff --git a/src/js/util.js b/src/js/util.js
new file mode 100644 (file)
index 0000000..55909ee
--- /dev/null
@@ -0,0 +1,180 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+function isNull(arg) {
+  return arg === null;
+}
+
+
+function isUndefined(arg) {
+  return arg === undefined;
+}
+
+
+function isNullOrUndefined(arg) {
+  return isNull(arg) || isUndefined(arg);
+}
+
+
+function isNumber(arg) {
+  return typeof arg === 'number';
+}
+
+function isFinite(arg) {
+  return (arg == 0) || (arg != arg / 2);
+}
+
+function isBoolean(arg) {
+  return typeof arg === 'boolean';
+}
+
+
+function isString(arg) {
+  return typeof arg === 'string';
+}
+
+
+function isObject(arg) {
+  return typeof arg === 'object' && arg != null;
+}
+
+
+function isFunction(arg) {
+  return typeof arg === 'function';
+}
+
+
+function isBuffer(arg) {
+  return arg instanceof Buffer;
+}
+
+
+function inherits(ctor, superCtor) {
+  ctor.prototype = Object.create(superCtor.prototype, {
+    constructor: {
+      value: ctor,
+      enumerable: false,
+      writable: true,
+      configurable: true
+    }
+  });
+};
+
+
+function format(s) {
+  if (!isString(s)) {
+    var arrs = [];
+    for (var i = 0; i < arguments.length; ++i) {
+        arrs.push(formatValue(arguments[i]));
+    }
+    return arrs.join(' ');
+  }
+
+  var i = 1;
+  var args = arguments;
+  var str = String(s).replace(/%[sdj%]/g, function(m) {
+    if (m === '%%') {
+      return '%';
+    }
+    if (i >= args.length) {
+      return m;
+    }
+    switch (m) {
+      case '%s': return String(args[i++]);
+      case '%d': return Number(args[i++]);
+      case '%j':
+        try {
+          return JSON.stringify(args[i++]);
+        } catch (_) {
+          return '[Circular]';
+        }
+      default: return m;
+    }
+  });
+
+  while (i < args.length) {
+    str += ' ' + formatValue(args[i++]);
+  }
+
+  return str;
+}
+
+function formatValue(v) {
+  if (isUndefined(v)) {
+    return 'undefined';
+  } else if (isNull(v)) {
+    return 'null';
+  } else {
+    return v.toString();
+  }
+}
+
+
+function errnoException(err, syscall, original) {
+  var errname = "error"; // uv.errname(err);
+  var message = syscall + ' ' + errname;
+
+  if (original)
+    message += ' ' + original;
+
+  var e = new Error(message);
+  e.code = errname;
+  e.errno = errname;
+  e.syscall = syscall;
+
+  return e;
+};
+
+
+function exceptionWithHostPort(err, syscall, address, port, additional) {
+  var details;
+  if (port && port > 0) {
+    details = address + ':' + port;
+  } else {
+    details = address;
+  }
+
+  if (additional) {
+    details += ' - Local (' + additional + ')';
+  }
+
+  var ex = exports.errnoException(err, syscall, details);
+  ex.address = address;
+  if (port) {
+    ex.port = port;
+  }
+
+  return ex;
+};
+
+
+exports.isNull = isNull;
+exports.isUndefined = isUndefined;
+exports.isNullOrUndefined = isNullOrUndefined;
+exports.isNumber = isNumber;
+exports.isBoolean = isBoolean;
+exports.isString = isString;
+exports.isObject = isObject;
+exports.isFinite = isFinite;
+exports.isFunction = isFunction;
+exports.isBuffer = isBuffer;
+exports.isArray = Array.isArray;
+exports.exceptionWithHostPort = exceptionWithHostPort;
+exports.errnoException = errnoException;
+
+exports.inherits = inherits;
+
+exports.format = format;
diff --git a/src/modules/iotjs_module_adc.c b/src/modules/iotjs_module_adc.c
new file mode 100644 (file)
index 0000000..cc714fa
--- /dev/null
@@ -0,0 +1,286 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_module_adc.h"
+#include "iotjs_objectwrap.h"
+
+
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(adc);
+static iotjs_adc_t* iotjs_adc_instance_from_jval(const iotjs_jval_t* jadc);
+
+
+static iotjs_adc_t* iotjs_adc_create(const iotjs_jval_t* jadc) {
+  iotjs_adc_t* adc = IOTJS_ALLOC(iotjs_adc_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_adc_t, adc);
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap, jadc,
+                               &this_module_native_info);
+
+  return adc;
+}
+
+
+static void iotjs_adc_destroy(iotjs_adc_t* adc) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_adc_t, adc);
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+#if defined(__linux__)
+  iotjs_string_destroy(&_this->device);
+#endif
+  IOTJS_RELEASE(adc);
+}
+
+
+#define THIS iotjs_adc_reqwrap_t* adc_reqwrap
+
+
+static iotjs_adc_reqwrap_t* iotjs_adc_reqwrap_create(
+    const iotjs_jval_t* jcallback, iotjs_adc_t* adc, AdcOp op) {
+  iotjs_adc_reqwrap_t* adc_reqwrap = IOTJS_ALLOC(iotjs_adc_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_adc_reqwrap_t, adc_reqwrap);
+
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+
+  _this->req_data.op = op;
+  _this->adc_instance = adc;
+  return adc_reqwrap;
+}
+
+
+static void iotjs_adc_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_adc_reqwrap_t, adc_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(adc_reqwrap);
+}
+
+
+static void iotjs_adc_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_adc_reqwrap_t, adc_reqwrap);
+  iotjs_adc_reqwrap_destroy(adc_reqwrap);
+}
+
+
+static uv_work_t* iotjs_adc_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_reqwrap_t, adc_reqwrap);
+  return &_this->req;
+}
+
+
+static const iotjs_jval_t* iotjs_adc_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_reqwrap_t, adc_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+
+static iotjs_adc_t* iotjs_adc_instance_from_jval(const iotjs_jval_t* jadc) {
+  uintptr_t handle = iotjs_jval_get_object_native_handle(jadc);
+  return (iotjs_adc_t*)handle;
+}
+
+
+iotjs_adc_reqwrap_t* iotjs_adc_reqwrap_from_request(uv_work_t* req) {
+  return (iotjs_adc_reqwrap_t*)(iotjs_reqwrap_from_request((uv_req_t*)req));
+}
+
+
+iotjs_adc_reqdata_t* iotjs_adc_reqwrap_data(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_reqwrap_t, adc_reqwrap);
+  return &_this->req_data;
+}
+
+
+iotjs_adc_t* iotjs_adc_instance_from_reqwrap(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_reqwrap_t, adc_reqwrap);
+  return _this->adc_instance;
+}
+
+
+#undef THIS
+
+
+static void iotjs_adc_after_work(uv_work_t* work_req, int status) {
+  iotjs_adc_reqwrap_t* req_wrap = iotjs_adc_reqwrap_from_request(work_req);
+  iotjs_adc_reqdata_t* req_data = iotjs_adc_reqwrap_data(req_wrap);
+  iotjs_jargs_t jargs = iotjs_jargs_create(2);
+  bool result = req_data->result;
+
+  if (status) {
+    iotjs_jval_t error = iotjs_jval_create_error("System error");
+    iotjs_jargs_append_jval(&jargs, &error);
+    iotjs_jval_destroy(&error);
+  } else {
+    switch (req_data->op) {
+      case kAdcOpOpen:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Failed to open ADC device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      case kAdcOpRead:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Cannot read from ADC device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+          iotjs_jargs_append_number(&jargs, req_data->value);
+        }
+        break;
+      case kAdcOpClose:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Cannot close ADC device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      default: {
+        IOTJS_ASSERT(!"Unreachable");
+        break;
+      }
+    }
+  }
+
+  const iotjs_jval_t* jcallback = iotjs_adc_reqwrap_jcallback(req_wrap);
+  iotjs_make_callback(jcallback, iotjs_jval_get_undefined(), &jargs);
+
+  iotjs_jargs_destroy(&jargs);
+
+  iotjs_adc_reqwrap_dispatched(req_wrap);
+}
+
+
+static void iotjs_adc_set_configuration(iotjs_adc_t* adc,
+                                        const iotjs_jval_t* jconfiguration) {
+#if defined(__linux__)
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_t, adc);
+  iotjs_jval_t jdevice =
+      iotjs_jval_get_property(jconfiguration, IOTJS_MAGIC_STRING_DEVICE);
+  _this->device = iotjs_jval_as_string(&jdevice);
+  iotjs_jval_destroy(&jdevice);
+#elif defined(__NUTTX__)
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_t, adc);
+  iotjs_jval_t jpin =
+      iotjs_jval_get_property(jconfiguration, IOTJS_MAGIC_STRING_PIN);
+  _this->pin = iotjs_jval_as_number(&jpin);
+  iotjs_jval_destroy(&jpin);
+#endif
+}
+
+
+static void iotjs_adc_read_worker(uv_work_t* work_req) {
+  ADC_WORKER_INIT;
+  int32_t value = iotjs_adc_read(adc);
+
+  if (value < 0) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->value = value;
+  req_data->result = true;
+}
+
+
+static void iotjs_adc_close_worker(uv_work_t* work_req) {
+  ADC_WORKER_INIT;
+
+  // Release driver
+  if (!iotjs_adc_close(adc)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+#define ADC_ASYNC(call, this, jcallback, op)                                   \
+  do {                                                                         \
+    uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get());         \
+    iotjs_adc_reqwrap_t* req_wrap =                                            \
+        iotjs_adc_reqwrap_create(jcallback, this, op);                         \
+    uv_work_t* req = iotjs_adc_reqwrap_req(req_wrap);                          \
+    uv_queue_work(loop, req, iotjs_adc_##call##_worker, iotjs_adc_after_work); \
+  } while (0)
+
+
+JHANDLER_FUNCTION(AdcConstructor) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(2, object, function);
+
+  // Create ADC object
+  const iotjs_jval_t* jadc = JHANDLER_GET_THIS(object);
+  iotjs_adc_t* adc = iotjs_adc_create(jadc);
+  IOTJS_ASSERT(adc == iotjs_adc_instance_from_jval(jadc));
+
+  iotjs_adc_set_configuration(adc, JHANDLER_GET_ARG(0, object));
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(1, function);
+  ADC_ASYNC(open, adc, jcallback, kAdcOpOpen);
+}
+
+
+JHANDLER_FUNCTION(Read) {
+  JHANDLER_DECLARE_THIS_PTR(adc, adc);
+  DJHANDLER_CHECK_ARG_IF_EXIST(0, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(0, function);
+
+  if (jcallback) {
+    ADC_ASYNC(read, adc, jcallback, kAdcOpRead);
+  } else {
+    int32_t value = iotjs_adc_read(adc);
+    if (value < 0) {
+      JHANDLER_THROW(COMMON, "ADC Read Error");
+    } else {
+      iotjs_jhandler_return_number(jhandler, value);
+    }
+  }
+}
+
+
+JHANDLER_FUNCTION(Close) {
+  JHANDLER_DECLARE_THIS_PTR(adc, adc);
+  DJHANDLER_CHECK_ARG_IF_EXIST(0, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(0, function);
+
+  if (jcallback) {
+    ADC_ASYNC(close, adc, jcallback, kAdcOpClose);
+  } else {
+    if (!iotjs_adc_close(adc)) {
+      JHANDLER_THROW(COMMON, "ADC Close Error");
+    }
+  }
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+iotjs_jval_t InitAdc() {
+  iotjs_jval_t jadc = iotjs_jval_create_object();
+  iotjs_jval_t jadcConstructor =
+      iotjs_jval_create_function_with_dispatch(AdcConstructor);
+  iotjs_jval_set_property_jval(&jadc, IOTJS_MAGIC_STRING_ADC, &jadcConstructor);
+
+  iotjs_jval_t jprototype = iotjs_jval_create_object();
+  iotjs_jval_set_method(&jprototype, IOTJS_MAGIC_STRING_READ, Read);
+  iotjs_jval_set_method(&jprototype, IOTJS_MAGIC_STRING_CLOSE, Close);
+  iotjs_jval_set_property_jval(&jadcConstructor, IOTJS_MAGIC_STRING_PROTOTYPE,
+                               &jprototype);
+
+  iotjs_jval_destroy(&jprototype);
+  iotjs_jval_destroy(&jadcConstructor);
+
+  return jadc;
+}
diff --git a/src/modules/iotjs_module_adc.h b/src/modules/iotjs_module_adc.h
new file mode 100644 (file)
index 0000000..4fd04fd
--- /dev/null
@@ -0,0 +1,81 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_ADC_H
+#define IOTJS_MODULE_ADC_H
+
+#include "iotjs_def.h"
+#include "iotjs_objectwrap.h"
+#include "iotjs_reqwrap.h"
+
+
+typedef enum {
+  kAdcOpOpen,
+  kAdcOpRead,
+  kAdcOpClose,
+} AdcOp;
+
+
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+
+#if defined(__linux__)
+  iotjs_string_t device;
+#elif defined(__NUTTX__)
+  uint32_t pin;
+#endif
+  int32_t device_fd;
+} IOTJS_VALIDATED_STRUCT(iotjs_adc_t);
+
+
+typedef struct {
+  int32_t value;
+
+  bool result;
+  AdcOp op;
+} iotjs_adc_reqdata_t;
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_work_t req;
+  iotjs_adc_reqdata_t req_data;
+  iotjs_adc_t* adc_instance;
+} IOTJS_VALIDATED_STRUCT(iotjs_adc_reqwrap_t);
+
+
+#define THIS iotjs_adc_reqwrap_t* adc_reqwrap
+
+iotjs_adc_reqwrap_t* iotjs_adc_reqwrap_from_request(uv_work_t* req);
+iotjs_adc_reqdata_t* iotjs_adc_reqwrap_data(THIS);
+
+iotjs_adc_t* iotjs_adc_instance_from_reqwrap(THIS);
+
+#undef THIS
+
+
+#define ADC_WORKER_INIT                                                     \
+  iotjs_adc_reqwrap_t* req_wrap = iotjs_adc_reqwrap_from_request(work_req); \
+  iotjs_adc_reqdata_t* req_data = iotjs_adc_reqwrap_data(req_wrap);         \
+  iotjs_adc_t* adc = iotjs_adc_instance_from_reqwrap(req_wrap);
+
+
+int32_t iotjs_adc_read(iotjs_adc_t* adc);
+bool iotjs_adc_close(iotjs_adc_t* adc);
+void iotjs_adc_open_worker(uv_work_t* work_req);
+
+
+#endif /* IOTJS_MODULE_ADC_H */
diff --git a/src/modules/iotjs_module_blehcisocket.c b/src/modules/iotjs_module_blehcisocket.c
new file mode 100644 (file)
index 0000000..6a12b30
--- /dev/null
@@ -0,0 +1,215 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_module_blehcisocket.h"
+#include "iotjs_module_buffer.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#define THIS iotjs_blehcisocket_t* blehcisocket
+
+
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(blehcisocket);
+
+
+iotjs_blehcisocket_t* iotjs_blehcisocket_create(const iotjs_jval_t* jble) {
+  THIS = IOTJS_ALLOC(iotjs_blehcisocket_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_blehcisocket_t, blehcisocket);
+
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap, jble,
+                               &this_module_native_info);
+
+  iotjs_blehcisocket_initialize(blehcisocket);
+
+  return blehcisocket;
+}
+
+
+iotjs_blehcisocket_t* iotjs_blehcisocket_instance_from_jval(
+    const iotjs_jval_t* jble) {
+  iotjs_jobjectwrap_t* jobjectwrap = iotjs_jobjectwrap_from_jobject(jble);
+  return (iotjs_blehcisocket_t*)jobjectwrap;
+}
+
+
+static void iotjs_blehcisocket_destroy(THIS) {
+  iotjs_blehcisocket_close(blehcisocket);
+
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_blehcisocket_t, blehcisocket);
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+  IOTJS_RELEASE(blehcisocket);
+}
+
+
+JHANDLER_FUNCTION(Start) {
+  JHANDLER_DECLARE_THIS_PTR(blehcisocket, blehcisocket);
+  DJHANDLER_CHECK_ARGS(0);
+
+  iotjs_blehcisocket_start(blehcisocket);
+
+  iotjs_jhandler_return_undefined(jhandler);
+}
+
+
+JHANDLER_FUNCTION(BindRaw) {
+  JHANDLER_DECLARE_THIS_PTR(blehcisocket, blehcisocket);
+  JHANDLER_CHECK(ge(iotjs_jhandler_get_arg_length(jhandler), 1));
+
+  int devId = 0;
+  int* pDevId = NULL;
+
+  const iotjs_jval_t* raw = iotjs_jhandler_get_arg(jhandler, 0);
+  if (iotjs_jval_is_number(raw)) {
+    devId = iotjs_jval_as_number(raw);
+    pDevId = &devId;
+  }
+
+  int ret = iotjs_blehcisocket_bindRaw(blehcisocket, pDevId);
+
+  iotjs_jhandler_return_number(jhandler, ret);
+}
+
+
+JHANDLER_FUNCTION(BindUser) {
+  JHANDLER_DECLARE_THIS_PTR(blehcisocket, blehcisocket);
+  DJHANDLER_CHECK_ARGS(1, number);
+
+  int devId = JHANDLER_GET_ARG(0, number);
+  int* pDevId = &devId;
+
+  int ret = iotjs_blehcisocket_bindUser(blehcisocket, pDevId);
+
+  iotjs_jhandler_return_number(jhandler, ret);
+}
+
+
+JHANDLER_FUNCTION(BindControl) {
+  JHANDLER_DECLARE_THIS_PTR(blehcisocket, blehcisocket);
+  DJHANDLER_CHECK_ARGS(0);
+
+  iotjs_blehcisocket_bindControl(blehcisocket);
+
+  iotjs_jhandler_return_undefined(jhandler);
+}
+
+
+JHANDLER_FUNCTION(IsDevUp) {
+  JHANDLER_DECLARE_THIS_PTR(blehcisocket, blehcisocket);
+  DJHANDLER_CHECK_ARGS(0);
+
+  bool ret = iotjs_blehcisocket_isDevUp(blehcisocket);
+
+  iotjs_jhandler_return_boolean(jhandler, ret);
+}
+
+
+JHANDLER_FUNCTION(SetFilter) {
+  JHANDLER_DECLARE_THIS_PTR(blehcisocket, blehcisocket);
+  DJHANDLER_CHECK_ARGS(1, object);
+
+  iotjs_bufferwrap_t* buffer =
+      iotjs_bufferwrap_from_jbuffer(JHANDLER_GET_ARG(0, object));
+
+  iotjs_blehcisocket_setFilter(blehcisocket, iotjs_bufferwrap_buffer(buffer),
+                               iotjs_bufferwrap_length(buffer));
+
+  iotjs_jhandler_return_undefined(jhandler);
+}
+
+
+JHANDLER_FUNCTION(Stop) {
+  JHANDLER_DECLARE_THIS_PTR(blehcisocket, blehcisocket);
+  DJHANDLER_CHECK_ARGS(0);
+
+  iotjs_blehcisocket_stop(blehcisocket);
+
+  iotjs_jhandler_return_undefined(jhandler);
+}
+
+
+JHANDLER_FUNCTION(Write) {
+  JHANDLER_DECLARE_THIS_PTR(blehcisocket, blehcisocket);
+  DJHANDLER_CHECK_ARGS(1, object);
+
+  iotjs_bufferwrap_t* buffer =
+      iotjs_bufferwrap_from_jbuffer(JHANDLER_GET_ARG(0, object));
+
+  iotjs_blehcisocket_write(blehcisocket, iotjs_bufferwrap_buffer(buffer),
+                           iotjs_bufferwrap_length(buffer));
+
+  iotjs_jhandler_return_undefined(jhandler);
+}
+
+
+JHANDLER_FUNCTION(BleHciSocketCons) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(0);
+
+  // Create object
+  const iotjs_jval_t* jblehcisocket = JHANDLER_GET_THIS(object);
+  iotjs_blehcisocket_t* blehcisocket = iotjs_blehcisocket_create(jblehcisocket);
+  IOTJS_ASSERT(blehcisocket ==
+               (iotjs_blehcisocket_t*)(iotjs_jval_get_object_native_handle(
+                   jblehcisocket)));
+}
+
+
+iotjs_jval_t InitBlehcisocket() {
+  iotjs_jval_t jblehcisocketCons =
+      iotjs_jval_create_function_with_dispatch(BleHciSocketCons);
+
+  iotjs_jval_t prototype = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_START, Start);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_BINDRAW, BindRaw);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_BINDUSER, BindUser);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_BINDCONTROL,
+                        BindControl);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_ISDEVUP, IsDevUp);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_SETFILTER, SetFilter);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_STOP, Stop);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_WRITE, Write);
+
+  iotjs_jval_set_property_jval(&jblehcisocketCons, IOTJS_MAGIC_STRING_PROTOTYPE,
+                               &prototype);
+
+  iotjs_jval_destroy(&prototype);
+
+  return jblehcisocketCons;
+}
diff --git a/src/modules/iotjs_module_blehcisocket.h b/src/modules/iotjs_module_blehcisocket.h
new file mode 100644 (file)
index 0000000..2872b49
--- /dev/null
@@ -0,0 +1,87 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef IOTJS_MODULE_BLE_HCI_SOCKET_H
+#define IOTJS_MODULE_BLE_HCI_SOCKET_H
+
+#include "iotjs_def.h"
+#include "iotjs_objectwrap.h"
+#include "iotjs_reqwrap.h"
+
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+
+  int _mode;
+  int _socket;
+  int _devId;
+  uv_poll_t _pollHandle;
+  int _l2sockets[1024];
+  int _l2socketCount;
+  uint8_t _address[6];
+  uint8_t _addressType;
+} IOTJS_VALIDATED_STRUCT(iotjs_blehcisocket_t);
+
+
+#define THIS iotjs_blehcisocket_t* iotjs_blehcisocket
+
+
+iotjs_blehcisocket_t* iotjs_blehcisocket_create(const iotjs_jval_t* jble);
+iotjs_blehcisocket_t* iotjs_blehcisocket_instance_from_jval(
+    const iotjs_jval_t* jble);
+
+
+void iotjs_blehcisocket_initialize(THIS);
+void iotjs_blehcisocket_close(THIS);
+void iotjs_blehcisocket_start(THIS);
+int iotjs_blehcisocket_bindRaw(THIS, int* devId);
+int iotjs_blehcisocket_bindUser(THIS, int* devId);
+void iotjs_blehcisocket_bindControl(THIS);
+bool iotjs_blehcisocket_isDevUp(THIS);
+void iotjs_blehcisocket_setFilter(THIS, char* data, size_t length);
+void iotjs_blehcisocket_poll(THIS);
+void iotjs_blehcisocket_stop(THIS);
+void iotjs_blehcisocket_write(THIS, char* data, size_t length);
+void iotjs_blehcisocket_emitErrnoError(THIS);
+int iotjs_blehcisocket_devIdFor(THIS, int* pDevId, bool isUp);
+int iotjs_blehcisocket_kernelDisconnectWorkArounds(THIS, int length,
+                                                   char* data);
+
+#undef THIS
+
+void iotjs_blehcisocket_poll_cb(uv_poll_t* handle, int status, int events);
+
+
+#endif /* IOTJS_MODULE_BLE_HCI_SOCKET_H */
diff --git a/src/modules/iotjs_module_buffer.c b/src/modules/iotjs_module_buffer.c
new file mode 100644 (file)
index 0000000..96e2cc6
--- /dev/null
@@ -0,0 +1,521 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_module_buffer.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(bufferwrap);
+
+
+iotjs_bufferwrap_t* iotjs_bufferwrap_create(const iotjs_jval_t* jbuiltin,
+                                            size_t length) {
+  iotjs_bufferwrap_t* bufferwrap = IOTJS_ALLOC(iotjs_bufferwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_bufferwrap_t, bufferwrap);
+
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap, jbuiltin,
+                               &this_module_native_info);
+  if (length > 0) {
+    _this->length = length;
+    _this->buffer = iotjs_buffer_allocate(length);
+    IOTJS_ASSERT(_this->buffer != NULL);
+  } else {
+    _this->length = 0;
+    _this->buffer = NULL;
+  }
+
+  IOTJS_ASSERT(
+      bufferwrap ==
+      (iotjs_bufferwrap_t*)(iotjs_jval_get_object_native_handle(jbuiltin)));
+
+  return bufferwrap;
+}
+
+
+static void iotjs_bufferwrap_destroy(iotjs_bufferwrap_t* bufferwrap) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_bufferwrap_t, bufferwrap);
+  if (_this->buffer != NULL) {
+    iotjs_buffer_release(_this->buffer);
+  }
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+  IOTJS_RELEASE(bufferwrap);
+}
+
+
+iotjs_bufferwrap_t* iotjs_bufferwrap_from_jbuiltin(
+    const iotjs_jval_t* jbuiltin) {
+  IOTJS_ASSERT(iotjs_jval_is_object(jbuiltin));
+  iotjs_bufferwrap_t* buffer =
+      (iotjs_bufferwrap_t*)iotjs_jval_get_object_native_handle(jbuiltin);
+  IOTJS_ASSERT(buffer != NULL);
+  return buffer;
+}
+
+
+iotjs_bufferwrap_t* iotjs_bufferwrap_from_jbuffer(const iotjs_jval_t* jbuffer) {
+  IOTJS_ASSERT(iotjs_jval_is_object(jbuffer));
+  iotjs_jval_t jbuiltin =
+      iotjs_jval_get_property(jbuffer, IOTJS_MAGIC_STRING__BUILTIN);
+  iotjs_bufferwrap_t* buffer = iotjs_bufferwrap_from_jbuiltin(&jbuiltin);
+  iotjs_jval_destroy(&jbuiltin);
+  return buffer;
+}
+
+
+iotjs_jval_t* iotjs_bufferwrap_jbuiltin(iotjs_bufferwrap_t* bufferwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_bufferwrap_t, bufferwrap);
+  return iotjs_jobjectwrap_jobject(&_this->jobjectwrap);
+}
+
+
+iotjs_jval_t iotjs_bufferwrap_jbuffer(iotjs_bufferwrap_t* bufferwrap) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_bufferwrap_t, bufferwrap);
+  iotjs_jval_t* jbuiltin = iotjs_bufferwrap_jbuiltin(bufferwrap);
+  return iotjs_jval_get_property(jbuiltin, IOTJS_MAGIC_STRING__BUFFER);
+}
+
+
+char* iotjs_bufferwrap_buffer(iotjs_bufferwrap_t* bufferwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_bufferwrap_t, bufferwrap);
+  return _this->buffer;
+}
+
+
+size_t iotjs_bufferwrap_length(iotjs_bufferwrap_t* bufferwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_bufferwrap_t, bufferwrap);
+#ifndef NDEBUG
+  iotjs_jval_t jbuf = iotjs_bufferwrap_jbuffer(bufferwrap);
+  iotjs_jval_t jlength =
+      iotjs_jval_get_property(&jbuf, IOTJS_MAGIC_STRING_LENGTH);
+  size_t length = iotjs_jval_as_number(&jlength);
+  IOTJS_ASSERT(length == _this->length);
+  iotjs_jval_destroy(&jbuf);
+  iotjs_jval_destroy(&jlength);
+#endif
+  return _this->length;
+}
+
+
+static size_t bound_range(size_t index, size_t low, size_t upper) {
+  if (index == SIZE_MAX) {
+    return low;
+  }
+  if (index > upper) {
+    return upper;
+  }
+  return index;
+}
+
+
+static int8_t hex2bin(char c) {
+  if (c >= '0' && c <= '9')
+    return (int8_t)(c - '0');
+  if (c >= 'A' && c <= 'F')
+    return (int8_t)(10 + (c - 'A'));
+  if (c >= 'a' && c <= 'f')
+    return (int8_t)(10 + (c - 'a'));
+
+  return (int8_t)(-1);
+}
+
+
+static size_t hex_decode(char* buf, size_t len, const char* src,
+                         const size_t srcLen) {
+  size_t i;
+
+  for (i = 0; i < len && i * 2 + 1 < srcLen; ++i) {
+    int8_t a = hex2bin(src[i * 2 + 0]);
+    int8_t b = hex2bin(src[i * 2 + 1]);
+    if (a == -1 || b == -1)
+      return i;
+    buf[i] = (a << 4) | b;
+  }
+
+  return i;
+}
+
+
+static size_t iotjs_convert_double_to_sizet(double value) {
+  size_t new_value;
+
+  if (value < 0 || isnan(value) || isinf(value)) {
+    new_value = SIZE_MAX;
+  } else {
+    new_value = (size_t)value;
+  }
+
+  return new_value;
+}
+
+
+int iotjs_bufferwrap_compare(const iotjs_bufferwrap_t* bufferwrap,
+                             const iotjs_bufferwrap_t* other) {
+  const IOTJS_VALIDATED_STRUCT_METHOD(iotjs_bufferwrap_t, bufferwrap);
+
+  const char* other_buffer = other->unsafe.buffer;
+  size_t other_length = other->unsafe.length;
+
+  size_t i = 0;
+  size_t j = 0;
+  while (i < _this->length && j < other_length) {
+    if (_this->buffer[i] < other_buffer[j]) {
+      return -1;
+    } else if (_this->buffer[i] > other_buffer[j]) {
+      return 1;
+    }
+    ++i;
+    ++j;
+  }
+  if (j < other_length) {
+    return -1;
+  } else if (i < _this->length) {
+    return 1;
+  }
+  return 0;
+}
+
+size_t iotjs_bufferwrap_copy_internal(iotjs_bufferwrap_t* bufferwrap,
+                                      const char* src, size_t src_from,
+                                      size_t src_to, size_t dst_from) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_bufferwrap_t, bufferwrap);
+  size_t copied = 0;
+  size_t dst_length = _this->length;
+  for (size_t i = src_from, j = dst_from; i < src_to && j < dst_length;
+       ++i, ++j) {
+    *(_this->buffer + j) = *(src + i);
+    ++copied;
+  }
+  return copied;
+}
+
+
+size_t iotjs_bufferwrap_copy(iotjs_bufferwrap_t* bufferwrap, const char* src,
+                             size_t len) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_bufferwrap_t, bufferwrap);
+  return iotjs_bufferwrap_copy_internal(bufferwrap, src, 0, len, 0);
+}
+
+
+iotjs_jval_t iotjs_bufferwrap_create_buffer(size_t len) {
+  iotjs_jval_t* jglobal = iotjs_jval_get_global_object();
+
+  iotjs_jval_t jbuffer =
+      iotjs_jval_get_property(jglobal, IOTJS_MAGIC_STRING_BUFFER);
+  IOTJS_ASSERT(iotjs_jval_is_function(&jbuffer));
+
+  iotjs_jargs_t jargs = iotjs_jargs_create(1);
+  iotjs_jargs_append_number(&jargs, len);
+
+  iotjs_jval_t jres =
+      iotjs_jhelper_call_ok(&jbuffer, iotjs_jval_get_undefined(), &jargs);
+  IOTJS_ASSERT(iotjs_jval_is_object(&jres));
+
+  iotjs_jargs_destroy(&jargs);
+  iotjs_jval_destroy(&jbuffer);
+
+  return jres;
+}
+
+
+JHANDLER_FUNCTION(Buffer) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(2, object, number);
+
+  const iotjs_jval_t* jbuiltin = JHANDLER_GET_THIS(object);
+  const iotjs_jval_t* jbuffer = JHANDLER_GET_ARG(0, object);
+  size_t length = JHANDLER_GET_ARG(1, number);
+
+  iotjs_jval_set_property_jval(jbuiltin, IOTJS_MAGIC_STRING__BUFFER, jbuffer);
+
+  iotjs_bufferwrap_t* buffer_wrap = iotjs_bufferwrap_create(jbuiltin, length);
+  IOTJS_UNUSED(buffer_wrap);
+}
+
+
+JHANDLER_FUNCTION(Compare) {
+  JHANDLER_DECLARE_THIS_PTR(bufferwrap, src_buffer_wrap);
+  JHANDLER_DECLARE_OBJECT_PTR(0, bufferwrap, dst_buffer_wrap);
+
+  int compare = iotjs_bufferwrap_compare(src_buffer_wrap, dst_buffer_wrap);
+  iotjs_jhandler_return_number(jhandler, compare);
+}
+
+
+JHANDLER_FUNCTION(Copy) {
+  JHANDLER_DECLARE_THIS_PTR(bufferwrap, src_buffer_wrap);
+  DJHANDLER_CHECK_ARGS(4, object, number, number, number);
+
+  const iotjs_jval_t* jdst_buffer = JHANDLER_GET_ARG(0, object);
+  iotjs_bufferwrap_t* dst_buffer_wrap =
+      iotjs_bufferwrap_from_jbuffer(jdst_buffer);
+
+  size_t dst_length = iotjs_bufferwrap_length(dst_buffer_wrap);
+  size_t src_length = iotjs_bufferwrap_length(src_buffer_wrap);
+
+  size_t dst_start = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(1, number));
+  dst_start = bound_range(dst_start, 0, dst_length);
+
+  size_t src_start = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(2, number));
+  src_start = bound_range(src_start, 0, src_length);
+
+  size_t src_end = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(3, number));
+  src_end = bound_range(src_end, 0, src_length);
+
+  if (src_end < src_start) {
+    src_end = src_start;
+  }
+
+  const char* src_data = iotjs_bufferwrap_buffer(src_buffer_wrap);
+  size_t copied = iotjs_bufferwrap_copy_internal(dst_buffer_wrap, src_data,
+                                                 src_start, src_end, dst_start);
+
+  iotjs_jhandler_return_number(jhandler, copied);
+}
+
+
+JHANDLER_FUNCTION(Write) {
+  JHANDLER_DECLARE_THIS_PTR(bufferwrap, buffer_wrap);
+  DJHANDLER_CHECK_ARGS(3, string, number, number);
+
+  iotjs_string_t src = JHANDLER_GET_ARG(0, string);
+
+  size_t buffer_length = iotjs_bufferwrap_length(buffer_wrap);
+  size_t offset = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(1, number));
+  offset = bound_range(offset, 0, buffer_length);
+
+  size_t length = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(2, number));
+  length = bound_range(length, 0, buffer_length - offset);
+  length = bound_range(length, 0, iotjs_string_size(&src));
+
+  const char* src_data = iotjs_string_data(&src);
+  size_t copied =
+      iotjs_bufferwrap_copy_internal(buffer_wrap, src_data, 0, length, offset);
+
+  iotjs_jhandler_return_number(jhandler, copied);
+
+  iotjs_string_destroy(&src);
+}
+
+
+JHANDLER_FUNCTION(WriteUInt8) {
+  JHANDLER_DECLARE_THIS_PTR(bufferwrap, buffer_wrap);
+  DJHANDLER_CHECK_ARGS(2, number, number);
+
+  const char src[] = { (char)JHANDLER_GET_ARG(0, number) };
+  size_t length = 1;
+
+  size_t buffer_length = iotjs_bufferwrap_length(buffer_wrap);
+  size_t offset = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(1, number));
+  offset = bound_range(offset, 0, buffer_length);
+  length = bound_range(length, 0, buffer_length - offset);
+  length = bound_range(length, 0, 1);
+
+  size_t copied =
+      iotjs_bufferwrap_copy_internal(buffer_wrap, src, 0, length, offset);
+
+  iotjs_jhandler_return_number(jhandler, copied);
+}
+
+
+JHANDLER_FUNCTION(HexWrite) {
+  JHANDLER_DECLARE_THIS_PTR(bufferwrap, buffer_wrap);
+  DJHANDLER_CHECK_ARGS(3, string, number, number);
+
+  iotjs_string_t src = JHANDLER_GET_ARG(0, string);
+
+  size_t buffer_length = iotjs_bufferwrap_length(buffer_wrap);
+  size_t offset = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(1, number));
+  offset = bound_range(offset, 0, buffer_length);
+
+  size_t length = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(2, number));
+  length = bound_range(length, 0, buffer_length - offset);
+
+  const char* src_data = iotjs_string_data(&src);
+  unsigned src_length = iotjs_string_size(&src);
+  char* src_buf = iotjs_buffer_allocate(length);
+
+  size_t nbytes = hex_decode(src_buf, length, src_data, src_length);
+
+  size_t copied =
+      iotjs_bufferwrap_copy_internal(buffer_wrap, src_buf, 0, nbytes, offset);
+
+  iotjs_jhandler_return_number(jhandler, copied);
+
+  iotjs_buffer_release(src_buf);
+  iotjs_string_destroy(&src);
+}
+
+
+JHANDLER_FUNCTION(ReadUInt8) {
+  JHANDLER_DECLARE_THIS_PTR(bufferwrap, buffer_wrap);
+  DJHANDLER_CHECK_ARGS(1, number);
+
+  size_t buffer_length = iotjs_bufferwrap_length(buffer_wrap);
+  size_t offset = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(0, number));
+  offset = bound_range(offset, 0, buffer_length - 1);
+
+  char* buffer = iotjs_bufferwrap_buffer(buffer_wrap);
+  uint8_t result = 0;
+
+  if (buffer != NULL) {
+    result = (uint8_t)buffer[offset];
+  }
+
+  iotjs_jhandler_return_number(jhandler, result);
+}
+
+
+JHANDLER_FUNCTION(Slice) {
+  JHANDLER_DECLARE_THIS_PTR(bufferwrap, buffer_wrap);
+  DJHANDLER_CHECK_ARGS(2, number, number);
+
+  int64_t start = JHANDLER_GET_ARG(0, number);
+  int64_t end = JHANDLER_GET_ARG(1, number);
+  size_t start_idx, end_idx;
+
+  if (start < 0) {
+    size_t len = iotjs_bufferwrap_length(buffer_wrap);
+    if ((size_t)(-start) > len) {
+      start_idx = SIZE_MAX;
+    } else {
+      start_idx = (size_t)start + len;
+    }
+  } else {
+    start_idx = (size_t)start;
+  }
+  start_idx = bound_range(start_idx, 0, iotjs_bufferwrap_length(buffer_wrap));
+
+  if (end < 0) {
+    size_t len = iotjs_bufferwrap_length(buffer_wrap);
+    if ((size_t)(-end) > len) {
+      end_idx = SIZE_MAX;
+    } else {
+      end_idx = (size_t)end + len;
+    }
+  } else {
+    end_idx = (size_t)end;
+  }
+  end_idx = bound_range(end_idx, 0, iotjs_bufferwrap_length(buffer_wrap));
+
+  if (end_idx < start_idx) {
+    end_idx = start_idx;
+  }
+
+  size_t length = (size_t)(end_idx - start_idx);
+
+  iotjs_jval_t jnew_buffer = iotjs_bufferwrap_create_buffer(length);
+  iotjs_bufferwrap_t* new_buffer_wrap =
+      iotjs_bufferwrap_from_jbuffer(&jnew_buffer);
+  iotjs_bufferwrap_copy_internal(new_buffer_wrap,
+                                 iotjs_bufferwrap_buffer(buffer_wrap),
+                                 start_idx, end_idx, 0);
+
+  iotjs_jhandler_return_jval(jhandler, &jnew_buffer);
+  iotjs_jval_destroy(&jnew_buffer);
+}
+
+
+JHANDLER_FUNCTION(ToString) {
+  JHANDLER_DECLARE_THIS_PTR(bufferwrap, buffer_wrap);
+  DJHANDLER_CHECK_ARGS(2, number, number);
+
+  size_t start = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(0, number));
+  start = bound_range(start, 0, iotjs_bufferwrap_length(buffer_wrap));
+
+  size_t end = iotjs_convert_double_to_sizet(JHANDLER_GET_ARG(1, number));
+  end = bound_range(end, 0, iotjs_bufferwrap_length(buffer_wrap));
+
+  if (end < start) {
+    end = start;
+  }
+
+  size_t length = end - start;
+
+  const char* data = iotjs_bufferwrap_buffer(buffer_wrap) + start;
+  length = strnlen(data, length);
+  iotjs_string_t str = iotjs_string_create_with_size(data, length);
+
+  iotjs_jhandler_return_string(jhandler, &str);
+
+  iotjs_string_destroy(&str);
+}
+
+
+JHANDLER_FUNCTION(ToHexString) {
+  JHANDLER_DECLARE_THIS_PTR(bufferwrap, buffer_wrap);
+
+  size_t length = iotjs_bufferwrap_length(buffer_wrap);
+  const char* data = iotjs_bufferwrap_buffer(buffer_wrap);
+
+  char* buffer = iotjs_buffer_allocate(length * 2);
+  iotjs_string_t str = iotjs_string_create_with_buffer(buffer, length * 2);
+
+  for (size_t i = 0; i < length; i++) {
+    memcpy(buffer, &"0123456789abcdef"[data[i] >> 4 & 0xF], 1);
+    buffer++;
+    memcpy(buffer, &"0123456789abcdef"[data[i] >> 0 & 0xF], 1);
+    buffer++;
+  }
+
+  iotjs_jhandler_return_string(jhandler, &str);
+  iotjs_string_destroy(&str);
+}
+
+
+JHANDLER_FUNCTION(ByteLength) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(1, string);
+
+  iotjs_string_t str = JHANDLER_GET_ARG(0, string);
+  iotjs_jval_t size = iotjs_jval_get_string_size(&str);
+
+  iotjs_jhandler_return_jval(jhandler, &size);
+  iotjs_string_destroy(&str);
+  iotjs_jval_destroy(&size);
+}
+
+
+iotjs_jval_t InitBuffer() {
+  iotjs_jval_t buffer = iotjs_jval_create_function_with_dispatch(Buffer);
+
+  iotjs_jval_t prototype = iotjs_jval_create_object();
+  iotjs_jval_t byte_length =
+      iotjs_jval_create_function_with_dispatch(ByteLength);
+
+  iotjs_jval_set_property_jval(&buffer, IOTJS_MAGIC_STRING_PROTOTYPE,
+                               &prototype);
+  iotjs_jval_set_property_jval(&buffer, IOTJS_MAGIC_STRING_BYTELENGTH,
+                               &byte_length);
+
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_COMPARE, Compare);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_COPY, Copy);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_WRITE, Write);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_HEXWRITE, HexWrite);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_WRITEUINT8, WriteUInt8);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_READUINT8, ReadUInt8);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_SLICE, Slice);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_TOSTRING, ToString);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_TOHEXSTRING,
+                        ToHexString);
+
+  iotjs_jval_destroy(&prototype);
+  iotjs_jval_destroy(&byte_length);
+
+  return buffer;
+}
diff --git a/src/modules/iotjs_module_buffer.h b/src/modules/iotjs_module_buffer.h
new file mode 100644 (file)
index 0000000..2f1e53f
--- /dev/null
@@ -0,0 +1,53 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_MODULE_BUFFER_H
+#define IOTJS_MODULE_BUFFER_H
+
+
+#include "iotjs_objectwrap.h"
+
+
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+  char* buffer;
+  size_t length;
+} IOTJS_VALIDATED_STRUCT(iotjs_bufferwrap_t);
+
+
+iotjs_bufferwrap_t* iotjs_bufferwrap_create(const iotjs_jval_t* jbuiltin,
+                                            size_t length);
+
+iotjs_bufferwrap_t* iotjs_bufferwrap_from_jbuiltin(
+    const iotjs_jval_t* jbuiltin);
+iotjs_bufferwrap_t* iotjs_bufferwrap_from_jbuffer(const iotjs_jval_t* jbuffer);
+
+iotjs_jval_t* iotjs_bufferwrap_jbuiltin(iotjs_bufferwrap_t* bufferwrap);
+iotjs_jval_t iotjs_bufferwrap_jbuffer(iotjs_bufferwrap_t* bufferwrap);
+
+char* iotjs_bufferwrap_buffer(iotjs_bufferwrap_t* bufferwrap);
+size_t iotjs_bufferwrap_length(iotjs_bufferwrap_t* bufferwrap);
+
+int iotjs_bufferwrap_compare(const iotjs_bufferwrap_t* bufferwrap,
+                             const iotjs_bufferwrap_t* other);
+
+size_t iotjs_bufferwrap_copy(iotjs_bufferwrap_t* bufferwrap, const char* src,
+                             size_t len);
+
+// Create buffer object.
+iotjs_jval_t iotjs_bufferwrap_create_buffer(size_t len);
+
+
+#endif /* IOTJS_MODULE_BUFFER_H */
diff --git a/src/modules/iotjs_module_console.c b/src/modules/iotjs_module_console.c
new file mode 100644 (file)
index 0000000..c827636
--- /dev/null
@@ -0,0 +1,45 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+
+
+static void Print(iotjs_jhandler_t* jhandler, FILE* out_fd) {
+  JHANDLER_CHECK_ARGS(1, string);
+
+  iotjs_string_t msg = JHANDLER_GET_ARG(0, string);
+  fprintf(out_fd, "%s", iotjs_string_data(&msg));
+  iotjs_string_destroy(&msg);
+}
+
+
+JHANDLER_FUNCTION(Stdout) {
+  Print(jhandler, stdout);
+}
+
+
+JHANDLER_FUNCTION(Stderr) {
+  Print(jhandler, stderr);
+}
+
+
+iotjs_jval_t InitConsole() {
+  iotjs_jval_t console = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&console, IOTJS_MAGIC_STRING_STDOUT, Stdout);
+  iotjs_jval_set_method(&console, IOTJS_MAGIC_STRING_STDERR, Stderr);
+
+  return console;
+}
diff --git a/src/modules/iotjs_module_constants.c b/src/modules/iotjs_module_constants.c
new file mode 100644 (file)
index 0000000..a02e675
--- /dev/null
@@ -0,0 +1,41 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_module.h"
+
+
+#define SET_CONSTANT(object, constant)                           \
+  do {                                                           \
+    iotjs_jval_set_property_number(object, #constant, constant); \
+  } while (0)
+
+iotjs_jval_t InitConstants() {
+  iotjs_jval_t constants = iotjs_jval_create_object();
+
+  SET_CONSTANT(&constants, O_APPEND);
+  SET_CONSTANT(&constants, O_CREAT);
+  SET_CONSTANT(&constants, O_EXCL);
+  SET_CONSTANT(&constants, O_RDONLY);
+  SET_CONSTANT(&constants, O_RDWR);
+  SET_CONSTANT(&constants, O_SYNC);
+  SET_CONSTANT(&constants, O_TRUNC);
+  SET_CONSTANT(&constants, O_WRONLY);
+  SET_CONSTANT(&constants, S_IFMT);
+  SET_CONSTANT(&constants, S_IFDIR);
+  SET_CONSTANT(&constants, S_IFREG);
+
+  return constants;
+}
diff --git a/src/modules/iotjs_module_dns.c b/src/modules/iotjs_module_dns.c
new file mode 100644 (file)
index 0000000..949cbf4
--- /dev/null
@@ -0,0 +1,206 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+
+#include "iotjs_module_dns.h"
+
+#include "iotjs_reqwrap.h"
+#include "uv.h"
+
+
+#define THIS iotjs_getaddrinfo_reqwrap_t* getaddrinfo_reqwrap
+
+iotjs_getaddrinfo_reqwrap_t* iotjs_getaddrinfo_reqwrap_create(
+    const iotjs_jval_t* jcallback) {
+  iotjs_getaddrinfo_reqwrap_t* getaddrinfo_reqwrap =
+      IOTJS_ALLOC(iotjs_getaddrinfo_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_getaddrinfo_reqwrap_t,
+                                     getaddrinfo_reqwrap);
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+  return getaddrinfo_reqwrap;
+}
+
+
+static void iotjs_getaddrinfo_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_getaddrinfo_reqwrap_t,
+                                    getaddrinfo_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(getaddrinfo_reqwrap);
+}
+
+
+void iotjs_getaddrinfo_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_getaddrinfo_reqwrap_t,
+                                           getaddrinfo_reqwrap);
+  iotjs_getaddrinfo_reqwrap_destroy(getaddrinfo_reqwrap);
+}
+
+
+uv_getaddrinfo_t* iotjs_getaddrinfo_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_getaddrinfo_reqwrap_t,
+                                getaddrinfo_reqwrap);
+  return &_this->req;
+}
+
+
+const iotjs_jval_t* iotjs_getaddrinfo_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_getaddrinfo_reqwrap_t,
+                                getaddrinfo_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+#undef THIS
+
+
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+static void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status,
+                             struct addrinfo* res) {
+  iotjs_getaddrinfo_reqwrap_t* req_wrap =
+      (iotjs_getaddrinfo_reqwrap_t*)(req->data);
+
+  iotjs_jargs_t args = iotjs_jargs_create(3);
+  iotjs_jargs_append_number(&args, status);
+
+  if (status == 0) {
+    char ip[INET6_ADDRSTRLEN];
+    int family;
+    const char* addr;
+
+    // Only first address is used
+    if (res->ai_family == AF_INET) {
+      struct sockaddr_in* sockaddr = (struct sockaddr_in*)(res->ai_addr);
+      addr = (char*)(&(sockaddr->sin_addr));
+      family = 4;
+    } else {
+      struct sockaddr_in6* sockaddr = (struct sockaddr_in6*)(res->ai_addr);
+      addr = (char*)(&(sockaddr->sin6_addr));
+      family = 6;
+    }
+
+    int err = uv_inet_ntop(res->ai_family, addr, ip, INET6_ADDRSTRLEN);
+    if (err) {
+      ip[0] = 0;
+    }
+
+    iotjs_jargs_append_string_raw(&args, ip);
+    iotjs_jargs_append_number(&args, family);
+  }
+
+  uv_freeaddrinfo(res);
+
+  // Make the callback into JavaScript
+  iotjs_make_callback(iotjs_getaddrinfo_reqwrap_jcallback(req_wrap),
+                      iotjs_jval_get_undefined(), &args);
+
+  iotjs_jargs_destroy(&args);
+
+  iotjs_getaddrinfo_reqwrap_dispatched(req_wrap);
+}
+#endif
+
+
+JHANDLER_FUNCTION(GetAddrInfo) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(4, string, number, number, function);
+
+  iotjs_string_t hostname = JHANDLER_GET_ARG(0, string);
+  int option = JHANDLER_GET_ARG(1, number);
+  int flags = JHANDLER_GET_ARG(2, number);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(3, function);
+
+  int family;
+  if (option == 0) {
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+    family = AF_INET;
+#else
+    family = AF_UNSPEC;
+#endif
+  } else if (option == 4) {
+    family = AF_INET;
+  } else if (option == 6) {
+    family = AF_INET6;
+  } else {
+    JHANDLER_THROW(TYPE, "bad address family");
+    return;
+  }
+
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+  iotjs_jargs_t args = iotjs_jargs_create(3);
+  int err = 0;
+  char ip[INET6_ADDRSTRLEN];
+  const char* hostname_data = iotjs_string_data(&hostname);
+
+  if (strcmp(hostname_data, "localhost") == 0) {
+    strcpy(ip, "127.0.0.1");
+  } else {
+    struct sockaddr_in addr;
+    int result = inet_pton(family, hostname_data, &(addr.sin_addr));
+
+    if (result != 1) {
+      err = errno;
+    } else {
+      inet_ntop(family, &(addr.sin_addr), ip, INET6_ADDRSTRLEN);
+    }
+  }
+
+  iotjs_jargs_append_number(&args, err);
+  iotjs_jargs_append_string_raw(&args, ip);
+  iotjs_jargs_append_number(&args, option);
+
+  iotjs_make_callback(jcallback, iotjs_jval_get_undefined(), &args);
+  iotjs_jargs_destroy(&args);
+  IOTJS_UNUSED(flags);
+#else
+  iotjs_getaddrinfo_reqwrap_t* req_wrap =
+      iotjs_getaddrinfo_reqwrap_create(jcallback);
+
+  static const struct addrinfo empty_hints;
+  struct addrinfo hints = empty_hints;
+  hints.ai_family = family;
+  hints.ai_socktype = SOCK_STREAM;
+  hints.ai_flags = flags;
+
+  int err =
+      uv_getaddrinfo(iotjs_environment_loop(iotjs_environment_get()),
+                     iotjs_getaddrinfo_reqwrap_req(req_wrap), AfterGetAddrInfo,
+                     iotjs_string_data(&hostname), NULL, &hints);
+
+  if (err) {
+    iotjs_getaddrinfo_reqwrap_dispatched(req_wrap);
+  }
+#endif
+
+  iotjs_jhandler_return_number(jhandler, err);
+
+  iotjs_string_destroy(&hostname);
+}
+
+
+#define SET_CONSTANT(object, constant)                           \
+  do {                                                           \
+    iotjs_jval_set_property_number(object, #constant, constant); \
+  } while (0)
+
+
+iotjs_jval_t InitDns() {
+  iotjs_jval_t dns = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&dns, IOTJS_MAGIC_STRING_GETADDRINFO, GetAddrInfo);
+  SET_CONSTANT(&dns, AI_ADDRCONFIG);
+  SET_CONSTANT(&dns, AI_V4MAPPED);
+
+  return dns;
+}
diff --git a/src/modules/iotjs_module_dns.h b/src/modules/iotjs_module_dns.h
new file mode 100644 (file)
index 0000000..51cc508
--- /dev/null
@@ -0,0 +1,43 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_DNS_H
+#define IOTJS_MODULE_DNS_H
+
+
+#include "iotjs_def.h"
+#include "iotjs_reqwrap.h"
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_getaddrinfo_t req;
+} IOTJS_VALIDATED_STRUCT(iotjs_getaddrinfo_reqwrap_t);
+
+#define THIS iotjs_getaddrinfo_reqwrap_t* getaddrinfo_reqwrap
+
+iotjs_getaddrinfo_reqwrap_t* iotjs_getaddrinfo_reqwrap_create(
+    const iotjs_jval_t* jcallback);
+
+void iotjs_getaddrinfo_reqwrap_dispatched(THIS);
+
+uv_getaddrinfo_t* iotjs_getaddrinfo_reqwrap_req(THIS);
+const iotjs_jval_t* iotjs_getaddrinfo_reqwrap_jcallback(THIS);
+
+#undef THIS
+
+
+#endif /* IOTJS_MODULE_DNS_H */
diff --git a/src/modules/iotjs_module_fs.c b/src/modules/iotjs_module_fs.c
new file mode 100644 (file)
index 0000000..90c002b
--- /dev/null
@@ -0,0 +1,531 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+
+#include "iotjs_module_buffer.h"
+
+#include "iotjs_exception.h"
+#include "iotjs_reqwrap.h"
+
+#undef JHANDLER_FUNCTION
+#define JHANDLER_FUNCTION(name) static void name(iotjs_jhandler_t* jhandler)
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_fs_t req;
+} iotjs_fs_reqwrap_t;
+
+
+iotjs_fs_reqwrap_t* iotjs_fs_reqwrap_create(const iotjs_jval_t* jcallback) {
+  iotjs_fs_reqwrap_t* fs_reqwrap = IOTJS_ALLOC(iotjs_fs_reqwrap_t);
+  iotjs_reqwrap_initialize(&fs_reqwrap->reqwrap, jcallback,
+                           (uv_req_t*)&fs_reqwrap->req);
+  return fs_reqwrap;
+}
+
+
+static void iotjs_fs_reqwrap_destroy(iotjs_fs_reqwrap_t* fs_reqwrap) {
+  uv_fs_req_cleanup(&fs_reqwrap->req);
+  iotjs_reqwrap_destroy(&fs_reqwrap->reqwrap);
+  IOTJS_RELEASE(fs_reqwrap);
+}
+
+iotjs_jval_t MakeStatObject(uv_stat_t* statbuf);
+
+
+static void AfterAsync(uv_fs_t* req) {
+  iotjs_fs_reqwrap_t* req_wrap = (iotjs_fs_reqwrap_t*)(req->data);
+  IOTJS_ASSERT(req_wrap != NULL);
+  IOTJS_ASSERT(&req_wrap->req == req);
+
+  const iotjs_jval_t* cb = iotjs_reqwrap_jcallback(&req_wrap->reqwrap);
+  IOTJS_ASSERT(iotjs_jval_is_function(cb));
+
+  iotjs_jargs_t jarg = iotjs_jargs_create(2);
+  if (req->result < 0) {
+    iotjs_jval_t jerror = iotjs_create_uv_exception(req->result, "open");
+    iotjs_jargs_append_jval(&jarg, &jerror);
+    iotjs_jval_destroy(&jerror);
+  } else {
+    iotjs_jargs_append_null(&jarg);
+    switch (req->fs_type) {
+      case UV_FS_CLOSE: {
+        break;
+      }
+      case UV_FS_OPEN:
+      case UV_FS_READ:
+      case UV_FS_WRITE: {
+        iotjs_jargs_append_number(&jarg, (double)req->result);
+        break;
+      }
+      case UV_FS_SCANDIR: {
+        int r;
+        uv_dirent_t ent;
+        uint32_t idx = 0;
+        iotjs_jval_t ret = iotjs_jval_create_array(0);
+        while ((r = uv_fs_scandir_next(req, &ent)) != UV_EOF) {
+          iotjs_jval_t name = iotjs_jval_create_string_raw(ent.name);
+          iotjs_jval_set_property_by_index(&ret, idx, &name);
+          iotjs_jval_destroy(&name);
+          idx++;
+        }
+        iotjs_jargs_append_jval(&jarg, &ret);
+        iotjs_jval_destroy(&ret);
+        break;
+      }
+      case UV_FS_FSTAT:
+      case UV_FS_STAT: {
+        uv_stat_t s = (req->statbuf);
+        iotjs_jval_t ret = MakeStatObject(&s);
+        iotjs_jargs_append_jval(&jarg, &ret);
+        iotjs_jval_destroy(&ret);
+        break;
+      }
+      default: {
+        iotjs_jargs_append_null(&jarg);
+        break;
+      }
+    }
+  }
+
+  iotjs_make_callback(cb, iotjs_jval_get_undefined(), &jarg);
+
+  iotjs_jargs_destroy(&jarg);
+  iotjs_fs_reqwrap_destroy(req_wrap);
+}
+
+
+static void AfterSync(uv_fs_t* req, int err, const char* syscall_name,
+                      iotjs_jhandler_t* jhandler) {
+  if (err < 0) {
+    iotjs_jval_t jerror = iotjs_create_uv_exception(err, syscall_name);
+    iotjs_jhandler_throw(jhandler, &jerror);
+    iotjs_jval_destroy(&jerror);
+  } else {
+    switch (req->fs_type) {
+      case UV_FS_CLOSE:
+        break;
+      case UV_FS_OPEN:
+      case UV_FS_READ:
+      case UV_FS_WRITE:
+        iotjs_jhandler_return_number(jhandler, err);
+        break;
+      case UV_FS_FSTAT:
+      case UV_FS_STAT: {
+        uv_stat_t* s = &(req->statbuf);
+        iotjs_jval_t stat = MakeStatObject(s);
+        iotjs_jhandler_return_jval(jhandler, &stat);
+        iotjs_jval_destroy(&stat);
+        break;
+      }
+      case UV_FS_MKDIR:
+      case UV_FS_RMDIR:
+      case UV_FS_UNLINK:
+      case UV_FS_RENAME:
+        iotjs_jhandler_return_undefined(jhandler);
+        break;
+      case UV_FS_SCANDIR: {
+        int r;
+        uv_dirent_t ent;
+        uint32_t idx = 0;
+        iotjs_jval_t ret = iotjs_jval_create_array(0);
+        while ((r = uv_fs_scandir_next(req, &ent)) != UV_EOF) {
+          iotjs_jval_t name = iotjs_jval_create_string_raw(ent.name);
+          iotjs_jval_set_property_by_index(&ret, idx, &name);
+          iotjs_jval_destroy(&name);
+          idx++;
+        }
+        iotjs_jhandler_return_jval(jhandler, &ret);
+        iotjs_jval_destroy(&ret);
+        break;
+      }
+      default: {
+        IOTJS_ASSERT(false);
+        break;
+      }
+    }
+  }
+}
+
+
+static inline bool IsWithinBounds(size_t off, size_t len, size_t max) {
+  if (off > max)
+    return false;
+
+  if (max - off < len)
+    return false;
+
+  return true;
+}
+
+#define FS_ASYNC(env, syscall, pcallback, ...)                                \
+  iotjs_fs_reqwrap_t* req_wrap = iotjs_fs_reqwrap_create(pcallback);          \
+  uv_fs_t* fs_req = &req_wrap->req;                                           \
+  int err = uv_fs_##syscall(iotjs_environment_loop(env), fs_req, __VA_ARGS__, \
+                            AfterAsync);                                      \
+  if (err < 0) {                                                              \
+    fs_req->result = err;                                                     \
+    AfterAsync(fs_req);                                                       \
+  }                                                                           \
+  iotjs_jhandler_return_null(jhandler);
+
+
+#define FS_SYNC(env, syscall, ...)                                             \
+  uv_fs_t fs_req;                                                              \
+  int err = uv_fs_##syscall(iotjs_environment_loop(env), &fs_req, __VA_ARGS__, \
+                            NULL);                                             \
+  AfterSync(&fs_req, err, #syscall, jhandler);                                 \
+  uv_fs_req_cleanup(&fs_req);
+
+
+JHANDLER_FUNCTION(Close) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(1, number);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  int fd = JHANDLER_GET_ARG(0, number);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  if (jcallback) {
+    FS_ASYNC(env, close, jcallback, fd);
+  } else {
+    FS_SYNC(env, close, fd);
+  }
+}
+
+
+JHANDLER_FUNCTION(Open) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(3, string, number, number);
+  DJHANDLER_CHECK_ARG_IF_EXIST(3, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  iotjs_string_t path = JHANDLER_GET_ARG(0, string);
+  int flags = JHANDLER_GET_ARG(1, number);
+  int mode = JHANDLER_GET_ARG(2, number);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(3, function);
+
+  if (jcallback) {
+    FS_ASYNC(env, open, jcallback, iotjs_string_data(&path), flags, mode);
+  } else {
+    FS_SYNC(env, open, iotjs_string_data(&path), flags, mode);
+  }
+
+  iotjs_string_destroy(&path);
+}
+
+
+JHANDLER_FUNCTION(Read) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(5, number, object, number, number, number);
+  DJHANDLER_CHECK_ARG_IF_EXIST(5, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  int fd = JHANDLER_GET_ARG(0, number);
+  const iotjs_jval_t* jbuffer = JHANDLER_GET_ARG(1, object);
+  size_t offset = JHANDLER_GET_ARG(2, number);
+  size_t length = JHANDLER_GET_ARG(3, number);
+  int position = JHANDLER_GET_ARG(4, number);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(5, function);
+
+  iotjs_bufferwrap_t* buffer_wrap = iotjs_bufferwrap_from_jbuffer(jbuffer);
+  char* data = iotjs_bufferwrap_buffer(buffer_wrap);
+  size_t data_length = iotjs_bufferwrap_length(buffer_wrap);
+  JHANDLER_CHECK(data != NULL);
+  JHANDLER_CHECK(data_length > 0);
+
+  if (offset >= data_length) {
+    JHANDLER_THROW(RANGE, "offset out of bound");
+    return;
+  }
+  if (!IsWithinBounds(offset, length, data_length)) {
+    JHANDLER_THROW(RANGE, "length out of bound");
+    return;
+  }
+
+  uv_buf_t uvbuf = uv_buf_init(data + offset, length);
+
+  if (jcallback) {
+    FS_ASYNC(env, read, jcallback, fd, &uvbuf, 1, position);
+  } else {
+    FS_SYNC(env, read, fd, &uvbuf, 1, position);
+  }
+}
+
+
+JHANDLER_FUNCTION(Write) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(5, number, object, number, number, number);
+  DJHANDLER_CHECK_ARG_IF_EXIST(5, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  int fd = JHANDLER_GET_ARG(0, number);
+  const iotjs_jval_t* jbuffer = JHANDLER_GET_ARG(1, object);
+  size_t offset = JHANDLER_GET_ARG(2, number);
+  size_t length = JHANDLER_GET_ARG(3, number);
+  int position = JHANDLER_GET_ARG(4, number);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(5, function);
+
+  iotjs_bufferwrap_t* buffer_wrap = iotjs_bufferwrap_from_jbuffer(jbuffer);
+  char* data = iotjs_bufferwrap_buffer(buffer_wrap);
+  size_t data_length = iotjs_bufferwrap_length(buffer_wrap);
+  JHANDLER_CHECK(data != NULL);
+  JHANDLER_CHECK(data_length > 0);
+
+  if (offset >= data_length) {
+    JHANDLER_THROW(RANGE, "offset out of bound");
+    return;
+  }
+  if (!IsWithinBounds(offset, length, data_length)) {
+    JHANDLER_THROW(RANGE, "length out of bound");
+    return;
+  }
+
+  uv_buf_t uvbuf = uv_buf_init(data + offset, length);
+
+  if (jcallback) {
+    FS_ASYNC(env, write, jcallback, fd, &uvbuf, 1, position);
+  } else {
+    FS_SYNC(env, write, fd, &uvbuf, 1, position);
+  }
+}
+
+
+iotjs_jval_t MakeStatObject(uv_stat_t* statbuf) {
+  const iotjs_jval_t* fs = iotjs_module_get(MODULE_FS);
+
+  iotjs_jval_t stat_prototype =
+      iotjs_jval_get_property(fs, IOTJS_MAGIC_STRING_STATS);
+  IOTJS_ASSERT(iotjs_jval_is_object(&stat_prototype));
+
+  iotjs_jval_t jstat = iotjs_jval_create_object();
+  iotjs_jval_set_prototype(&jstat, &stat_prototype);
+
+  iotjs_jval_destroy(&stat_prototype);
+
+
+#define X(statobj, name) \
+  iotjs_jval_set_property_number(statobj, #name, statbuf->st_##name);
+
+  X(&jstat, dev)
+  X(&jstat, mode)
+  X(&jstat, nlink)
+  X(&jstat, uid)
+  X(&jstat, gid)
+  X(&jstat, rdev)
+  X(&jstat, blksize)
+  X(&jstat, ino)
+  X(&jstat, size)
+  X(&jstat, blocks)
+
+#undef X
+
+  return jstat;
+}
+
+
+JHANDLER_FUNCTION(Stat) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(1, string);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  iotjs_string_t path = JHANDLER_GET_ARG(0, string);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  if (jcallback) {
+    FS_ASYNC(env, stat, jcallback, iotjs_string_data(&path));
+  } else {
+    FS_SYNC(env, stat, iotjs_string_data(&path));
+  }
+
+  iotjs_string_destroy(&path);
+}
+
+
+JHANDLER_FUNCTION(Fstat) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(1, number);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  int fd = JHANDLER_GET_ARG(0, number);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  if (jcallback) {
+    FS_ASYNC(env, fstat, jcallback, fd);
+  } else {
+    FS_SYNC(env, fstat, fd);
+  }
+}
+
+
+JHANDLER_FUNCTION(MkDir) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(2, string, number);
+  DJHANDLER_CHECK_ARG_IF_EXIST(2, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  iotjs_string_t path = JHANDLER_GET_ARG(0, string);
+  int mode = JHANDLER_GET_ARG(1, number);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(2, function);
+
+  if (jcallback) {
+    FS_ASYNC(env, mkdir, jcallback, iotjs_string_data(&path), mode);
+  } else {
+    FS_SYNC(env, mkdir, iotjs_string_data(&path), mode);
+  }
+
+  iotjs_string_destroy(&path);
+}
+
+
+JHANDLER_FUNCTION(RmDir) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(1, string);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  iotjs_string_t path = JHANDLER_GET_ARG(0, string);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  if (jcallback) {
+    FS_ASYNC(env, rmdir, jcallback, iotjs_string_data(&path));
+  } else {
+    FS_SYNC(env, rmdir, iotjs_string_data(&path));
+  }
+
+  iotjs_string_destroy(&path);
+}
+
+
+JHANDLER_FUNCTION(Unlink) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(1, string);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  iotjs_string_t path = JHANDLER_GET_ARG(0, string);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  if (jcallback) {
+    FS_ASYNC(env, unlink, jcallback, iotjs_string_data(&path));
+  } else {
+    FS_SYNC(env, unlink, iotjs_string_data(&path));
+  }
+
+  iotjs_string_destroy(&path);
+}
+
+
+JHANDLER_FUNCTION(Rename) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(2, string, string);
+  DJHANDLER_CHECK_ARG_IF_EXIST(2, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  iotjs_string_t oldPath = JHANDLER_GET_ARG(0, string);
+  iotjs_string_t newPath = JHANDLER_GET_ARG(1, string);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(2, function);
+
+  if (jcallback) {
+    FS_ASYNC(env, rename, jcallback, iotjs_string_data(&oldPath),
+             iotjs_string_data(&newPath));
+  } else {
+    FS_SYNC(env, rename, iotjs_string_data(&oldPath),
+            iotjs_string_data(&newPath));
+  }
+
+  iotjs_string_destroy(&oldPath);
+  iotjs_string_destroy(&newPath);
+}
+
+
+JHANDLER_FUNCTION(ReadDir) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(1, string);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+  iotjs_string_t path = JHANDLER_GET_ARG(0, string);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  if (jcallback) {
+    FS_ASYNC(env, scandir, jcallback, iotjs_string_data(&path), 0);
+  } else {
+    FS_SYNC(env, scandir, iotjs_string_data(&path), 0);
+  }
+  iotjs_string_destroy(&path);
+}
+
+static void StatsIsTypeOf(iotjs_jhandler_t* jhandler, int type) {
+  DJHANDLER_CHECK_THIS(object);
+  const iotjs_jval_t* stats = JHANDLER_GET_THIS(object);
+  iotjs_jval_t mode = iotjs_jval_get_property(stats, IOTJS_MAGIC_STRING_MODE);
+
+  int mode_number = (int)iotjs_jval_as_number(&mode);
+
+  iotjs_jval_destroy(&mode);
+
+  iotjs_jhandler_return_boolean(jhandler, (mode_number & S_IFMT) == type);
+}
+
+JHANDLER_FUNCTION(StatsIsDirectory) {
+  StatsIsTypeOf(jhandler, S_IFDIR);
+}
+
+JHANDLER_FUNCTION(StatsIsFile) {
+  StatsIsTypeOf(jhandler, S_IFREG);
+}
+
+iotjs_jval_t InitFs() {
+  iotjs_jval_t fs = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_CLOSE, Close);
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_OPEN, Open);
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_READ, Read);
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_WRITE, Write);
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_STAT, Stat);
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_FSTAT, Fstat);
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_MKDIR, MkDir);
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_RMDIR, RmDir);
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_UNLINK, Unlink);
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_RENAME, Rename);
+  iotjs_jval_set_method(&fs, IOTJS_MAGIC_STRING_READDIR, ReadDir);
+
+  iotjs_jval_t stats_prototype = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&stats_prototype, IOTJS_MAGIC_STRING_ISDIRECTORY,
+                        StatsIsDirectory);
+  iotjs_jval_set_method(&stats_prototype, IOTJS_MAGIC_STRING_ISFILE,
+                        StatsIsFile);
+
+  iotjs_jval_set_property_jval(&fs, IOTJS_MAGIC_STRING_STATS, &stats_prototype);
+  iotjs_jval_destroy(&stats_prototype);
+
+  return fs;
+}
diff --git a/src/modules/iotjs_module_gpio.c b/src/modules/iotjs_module_gpio.c
new file mode 100644 (file)
index 0000000..217998e
--- /dev/null
@@ -0,0 +1,390 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include <string.h>
+
+#include "iotjs_def.h"
+#include "iotjs_module_gpio.h"
+#include "iotjs_objectwrap.h"
+#include <stdio.h>
+
+
+static iotjs_gpio_t* iotjs_gpio_instance_from_jval(const iotjs_jval_t* jgpio);
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(gpio);
+
+
+static iotjs_gpio_t* iotjs_gpio_create(const iotjs_jval_t* jgpio) {
+  iotjs_gpio_t* gpio = IOTJS_ALLOC(iotjs_gpio_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_gpio_t, gpio);
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap, jgpio,
+                               &this_module_native_info);
+#if defined(__linux__)
+  _this->value_fd = -1;
+#endif
+  return gpio;
+}
+
+
+static void iotjs_gpio_destroy(iotjs_gpio_t* gpio) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_gpio_t, gpio);
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+  IOTJS_RELEASE(gpio);
+}
+
+
+#define THIS iotjs_gpio_reqwrap_t* gpio_reqwrap
+
+
+static iotjs_gpio_reqwrap_t* iotjs_gpio_reqwrap_create(
+    const iotjs_jval_t* jcallback, iotjs_gpio_t* gpio, GpioOp op) {
+  iotjs_gpio_reqwrap_t* gpio_reqwrap = IOTJS_ALLOC(iotjs_gpio_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_gpio_reqwrap_t, gpio_reqwrap);
+
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+
+  _this->req_data.op = op;
+  _this->gpio_instance = gpio;
+  return gpio_reqwrap;
+}
+
+
+static void iotjs_gpio_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_gpio_reqwrap_t, gpio_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(gpio_reqwrap);
+}
+
+
+static void iotjs_gpio_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_gpio_reqwrap_t, gpio_reqwrap);
+  iotjs_gpio_reqwrap_destroy(gpio_reqwrap);
+}
+
+
+static uv_work_t* iotjs_gpio_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_reqwrap_t, gpio_reqwrap);
+  return &_this->req;
+}
+
+
+static const iotjs_jval_t* iotjs_gpio_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_reqwrap_t, gpio_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+
+static iotjs_gpio_t* iotjs_gpio_instance_from_jval(const iotjs_jval_t* jgpio) {
+  uintptr_t handle = iotjs_jval_get_object_native_handle(jgpio);
+  return (iotjs_gpio_t*)handle;
+}
+
+
+iotjs_gpio_reqwrap_t* iotjs_gpio_reqwrap_from_request(uv_work_t* req) {
+  return (iotjs_gpio_reqwrap_t*)(iotjs_reqwrap_from_request((uv_req_t*)req));
+}
+
+
+iotjs_gpio_reqdata_t* iotjs_gpio_reqwrap_data(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_reqwrap_t, gpio_reqwrap);
+  return &_this->req_data;
+}
+
+
+iotjs_gpio_t* iotjs_gpio_instance_from_reqwrap(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_reqwrap_t, gpio_reqwrap);
+  return _this->gpio_instance;
+}
+
+
+#undef THIS
+
+
+static void iotjs_gpio_write_worker(uv_work_t* work_req) {
+  GPIO_WORKER_INIT;
+
+  if (!iotjs_gpio_write(gpio, req_data->value)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+static void iotjs_gpio_read_worker(uv_work_t* work_req) {
+  GPIO_WORKER_INIT;
+
+  int result = iotjs_gpio_read(gpio);
+  if (result < 0) {
+    req_data->result = false;
+    return;
+  }
+  req_data->result = true;
+  req_data->value = (bool)result;
+}
+
+
+static void iotjs_gpio_close_worker(uv_work_t* work_req) {
+  GPIO_WORKER_INIT;
+
+  if (!iotjs_gpio_close(gpio)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+static void iotjs_gpio_after_worker(uv_work_t* work_req, int status) {
+  iotjs_gpio_reqwrap_t* req_wrap = iotjs_gpio_reqwrap_from_request(work_req);
+  iotjs_gpio_reqdata_t* req_data = iotjs_gpio_reqwrap_data(req_wrap);
+  iotjs_jargs_t jargs = iotjs_jargs_create(2);
+  bool result = req_data->result;
+
+  if (status) {
+    iotjs_jargs_append_error(&jargs, "GPIO System Error");
+  } else {
+    switch (req_data->op) {
+      case kGpioOpOpen:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "GPIO Open Error");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      case kGpioOpWrite:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "GPIO Write Error");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      case kGpioOpRead:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "GPIO Read Error");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+          iotjs_jargs_append_bool(&jargs, req_data->value);
+        }
+        break;
+      case kGpioOpClose:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "GPIO Close Error");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      default:
+        IOTJS_ASSERT(!"Unreachable");
+        break;
+    }
+  }
+
+  const iotjs_jval_t* jcallback = iotjs_gpio_reqwrap_jcallback(req_wrap);
+  iotjs_make_callback(jcallback, iotjs_jval_get_undefined(), &jargs);
+
+  iotjs_jargs_destroy(&jargs);
+
+  iotjs_gpio_reqwrap_dispatched(req_wrap);
+}
+
+
+static void gpio_set_configurable(iotjs_gpio_t* gpio,
+                                  const iotjs_jval_t* jconfigurable) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  iotjs_jval_t jpin =
+      iotjs_jval_get_property(jconfigurable, IOTJS_MAGIC_STRING_PIN);
+  _this->pin = iotjs_jval_as_number(&jpin);
+  iotjs_jval_destroy(&jpin);
+
+  iotjs_jval_t jdirection =
+      iotjs_jval_get_property(jconfigurable, IOTJS_MAGIC_STRING_DIRECTION);
+  _this->direction = (GpioDirection)iotjs_jval_as_number(&jdirection);
+  iotjs_jval_destroy(&jdirection);
+
+  iotjs_jval_t jmode =
+      iotjs_jval_get_property(jconfigurable, IOTJS_MAGIC_STRING_MODE);
+  _this->mode = (GpioMode)iotjs_jval_as_number(&jmode);
+  iotjs_jval_destroy(&jmode);
+
+  iotjs_jval_t jedge =
+      iotjs_jval_get_property(jconfigurable, IOTJS_MAGIC_STRING_EDGE);
+  _this->edge = (GpioMode)iotjs_jval_as_number(&jedge);
+  iotjs_jval_destroy(&jedge);
+}
+
+
+#define GPIO_ASYNC(call, this, jcallback, op)                          \
+  do {                                                                 \
+    uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get()); \
+    iotjs_gpio_reqwrap_t* req_wrap =                                   \
+        iotjs_gpio_reqwrap_create(jcallback, this, op);                \
+    uv_work_t* req = iotjs_gpio_reqwrap_req(req_wrap);                 \
+    uv_queue_work(loop, req, iotjs_gpio_##call##_worker,               \
+                  iotjs_gpio_after_worker);                            \
+  } while (0)
+
+
+#define GPIO_ASYNC_WITH_VALUE(call, this, jcallback, op, val)           \
+  do {                                                                  \
+    uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get());  \
+    iotjs_gpio_reqwrap_t* req_wrap =                                    \
+        iotjs_gpio_reqwrap_create(jcallback, this, op);                 \
+    uv_work_t* req = iotjs_gpio_reqwrap_req(req_wrap);                  \
+    iotjs_gpio_reqdata_t* req_data = iotjs_gpio_reqwrap_data(req_wrap); \
+    req_data->value = val;                                              \
+    uv_queue_work(loop, req, iotjs_gpio_##call##_worker,                \
+                  iotjs_gpio_after_worker);                             \
+  } while (0)
+
+
+JHANDLER_FUNCTION(GpioConstructor) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(2, object, function);
+
+  // Create GPIO object
+  const iotjs_jval_t* jgpio = JHANDLER_GET_THIS(object);
+  iotjs_gpio_t* gpio = iotjs_gpio_create(jgpio);
+  IOTJS_ASSERT(gpio == iotjs_gpio_instance_from_jval(jgpio));
+
+  gpio_set_configurable(gpio, JHANDLER_GET_ARG(0, object));
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(1, function);
+  GPIO_ASYNC(open, gpio, jcallback, kGpioOpOpen);
+}
+
+
+JHANDLER_FUNCTION(Write) {
+  JHANDLER_DECLARE_THIS_PTR(gpio, gpio);
+  DJHANDLER_CHECK_ARGS(1, boolean);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  bool value = JHANDLER_GET_ARG(0, boolean);
+
+  if (jcallback) {
+    GPIO_ASYNC_WITH_VALUE(write, gpio, jcallback, kGpioOpWrite, value);
+  } else {
+    if (!iotjs_gpio_write(gpio, value)) {
+      JHANDLER_THROW(COMMON, "GPIO WriteSync Error");
+    }
+  }
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+JHANDLER_FUNCTION(Read) {
+  JHANDLER_DECLARE_THIS_PTR(gpio, gpio);
+  DJHANDLER_CHECK_ARGS(0);
+  DJHANDLER_CHECK_ARG_IF_EXIST(0, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(0, function);
+
+  if (jcallback) {
+    GPIO_ASYNC(read, gpio, jcallback, kGpioOpRead);
+    iotjs_jhandler_return_null(jhandler);
+  } else {
+    int value = iotjs_gpio_read(gpio);
+    if (value < 0) {
+      JHANDLER_THROW(COMMON, "GPIO ReadSync Error");
+    }
+    iotjs_jhandler_return_boolean(jhandler, value);
+  }
+}
+
+
+JHANDLER_FUNCTION(Close) {
+  JHANDLER_DECLARE_THIS_PTR(gpio, gpio)
+  DJHANDLER_CHECK_ARG_IF_EXIST(0, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(0, function);
+
+  if (jcallback) {
+    GPIO_ASYNC(close, gpio, jcallback, kGpioOpClose);
+  } else {
+    if (!iotjs_gpio_close(gpio)) {
+      JHANDLER_THROW(COMMON, "GPIO CloseSync Error");
+    }
+  }
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+iotjs_jval_t InitGpio() {
+  iotjs_jval_t jgpio = iotjs_jval_create_object();
+  iotjs_jval_t jgpioConstructor =
+      iotjs_jval_create_function_with_dispatch(GpioConstructor);
+  iotjs_jval_set_property_jval(&jgpio, IOTJS_MAGIC_STRING_GPIO,
+                               &jgpioConstructor);
+
+  iotjs_jval_t jprototype = iotjs_jval_create_object();
+  iotjs_jval_set_method(&jprototype, IOTJS_MAGIC_STRING_WRITE, Write);
+  iotjs_jval_set_method(&jprototype, IOTJS_MAGIC_STRING_READ, Read);
+  iotjs_jval_set_method(&jprototype, IOTJS_MAGIC_STRING_CLOSE, Close);
+  iotjs_jval_set_property_jval(&jgpioConstructor, IOTJS_MAGIC_STRING_PROTOTYPE,
+                               &jprototype);
+  iotjs_jval_destroy(&jprototype);
+  iotjs_jval_destroy(&jgpioConstructor);
+
+  // GPIO direction properties
+  iotjs_jval_t jdirection = iotjs_jval_create_object();
+  iotjs_jval_set_property_number(&jdirection, IOTJS_MAGIC_STRING_IN,
+                                 kGpioDirectionIn);
+  iotjs_jval_set_property_number(&jdirection, IOTJS_MAGIC_STRING_OUT,
+                                 kGpioDirectionOut);
+  iotjs_jval_set_property_jval(&jgpio, IOTJS_MAGIC_STRING_DIRECTION_U,
+                               &jdirection);
+  iotjs_jval_destroy(&jdirection);
+
+
+  // GPIO mode properties
+  iotjs_jval_t jmode = iotjs_jval_create_object();
+  iotjs_jval_set_property_number(&jmode, IOTJS_MAGIC_STRING_NONE,
+                                 kGpioModeNone);
+#if defined(__NUTTX__)
+  iotjs_jval_set_property_number(&jmode, IOTJS_MAGIC_STRING_PULLUP,
+                                 kGpioModePullup);
+  iotjs_jval_set_property_number(&jmode, IOTJS_MAGIC_STRING_PULLDOWN,
+                                 kGpioModePulldown);
+  iotjs_jval_set_property_number(&jmode, IOTJS_MAGIC_STRING_FLOAT,
+                                 kGpioModeFloat);
+  iotjs_jval_set_property_number(&jmode, IOTJS_MAGIC_STRING_PUSHPULL,
+                                 kGpioModePushpull);
+  iotjs_jval_set_property_number(&jmode, IOTJS_MAGIC_STRING_OPENDRAIN,
+                                 kGpioModeOpendrain);
+#endif
+  iotjs_jval_set_property_jval(&jgpio, IOTJS_MAGIC_STRING_MODE_U, &jmode);
+  iotjs_jval_destroy(&jmode);
+
+  // GPIO edge properties
+  iotjs_jval_t jedge = iotjs_jval_create_object();
+  iotjs_jval_set_property_number(&jedge, IOTJS_MAGIC_STRING_NONE,
+                                 kGpioEdgeNone);
+  iotjs_jval_set_property_number(&jedge, IOTJS_MAGIC_STRING_RISING_U,
+                                 kGpioEdgeRising);
+  iotjs_jval_set_property_number(&jedge, IOTJS_MAGIC_STRING_FALLING_U,
+                                 kGpioEdgeFalling);
+  iotjs_jval_set_property_number(&jedge, IOTJS_MAGIC_STRING_BOTH_U,
+                                 kGpioEdgeBoth);
+  iotjs_jval_set_property_jval(&jgpio, IOTJS_MAGIC_STRING_EDGE_U, &jedge);
+  iotjs_jval_destroy(&jedge);
+
+  return jgpio;
+}
diff --git a/src/modules/iotjs_module_gpio.h b/src/modules/iotjs_module_gpio.h
new file mode 100644 (file)
index 0000000..3ba87d3
--- /dev/null
@@ -0,0 +1,114 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_GPIO_H
+#define IOTJS_MODULE_GPIO_H
+
+
+#include "iotjs_def.h"
+#include "iotjs_objectwrap.h"
+#include "iotjs_reqwrap.h"
+
+#if defined(__TIZENRT__)
+#include <iotbus_gpio.h>
+#endif
+
+typedef enum {
+  kGpioDirectionIn = 0,
+  kGpioDirectionOut,
+} GpioDirection;
+
+
+typedef enum {
+  kGpioModeNone = 0,
+  kGpioModePullup,
+  kGpioModePulldown,
+  kGpioModeFloat,
+  kGpioModePushpull,
+  kGpioModeOpendrain,
+} GpioMode;
+
+
+typedef enum {
+  kGpioEdgeNone = 0,
+  kGpioEdgeRising,
+  kGpioEdgeFalling,
+  kGpioEdgeBoth,
+} GpioEdge;
+
+
+typedef enum {
+  kGpioOpOpen,
+  kGpioOpWrite,
+  kGpioOpRead,
+  kGpioOpClose,
+} GpioOp;
+
+
+typedef struct {
+  bool value;
+  bool result;
+  GpioOp op;
+} iotjs_gpio_reqdata_t;
+
+
+// This Gpio class provides interfaces for GPIO operation.
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+  uint32_t pin;
+  GpioDirection direction;
+  GpioMode mode;
+  GpioEdge edge;
+#if defined(__linux__)
+  int value_fd;
+  uv_thread_t thread;
+  uv_mutex_t mutex;
+#elif defined(__TIZENRT__)
+  iotbus_gpio_context_h gpio_context;
+#endif
+} IOTJS_VALIDATED_STRUCT(iotjs_gpio_t);
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_work_t req;
+  iotjs_gpio_reqdata_t req_data;
+  iotjs_gpio_t* gpio_instance;
+} IOTJS_VALIDATED_STRUCT(iotjs_gpio_reqwrap_t);
+
+
+#define THIS iotjs_gpio_reqwrap_t* gpio_reqwrap
+
+iotjs_gpio_reqwrap_t* iotjs_gpio_reqwrap_from_request(uv_work_t* req);
+iotjs_gpio_reqdata_t* iotjs_gpio_reqwrap_data(THIS);
+
+iotjs_gpio_t* iotjs_gpio_instance_from_reqwrap(THIS);
+
+#undef THIS
+
+
+#define GPIO_WORKER_INIT                                                      \
+  iotjs_gpio_reqwrap_t* req_wrap = iotjs_gpio_reqwrap_from_request(work_req); \
+  iotjs_gpio_reqdata_t* req_data = iotjs_gpio_reqwrap_data(req_wrap);         \
+  iotjs_gpio_t* gpio = iotjs_gpio_instance_from_reqwrap(req_wrap);
+
+
+void iotjs_gpio_open_worker(uv_work_t* work_req);
+bool iotjs_gpio_write(iotjs_gpio_t* gpio, bool value);
+int iotjs_gpio_read(iotjs_gpio_t* gpio);
+bool iotjs_gpio_close(iotjs_gpio_t* gpio);
+
+#endif /* IOTJS_MODULE_GPIO_H */
diff --git a/src/modules/iotjs_module_httpparser.c b/src/modules/iotjs_module_httpparser.c
new file mode 100644 (file)
index 0000000..062c6e3
--- /dev/null
@@ -0,0 +1,502 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "iotjs_def.h"
+#include "iotjs_module_httpparser.h"
+#include "iotjs_module_buffer.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#define THIS iotjs_httpparserwrap_t* httpparserwrap
+
+
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(httpparserwrap);
+
+
+iotjs_httpparserwrap_t* iotjs_httpparserwrap_create(const iotjs_jval_t* jparser,
+                                                    http_parser_type type) {
+  iotjs_httpparserwrap_t* httpparserwrap = IOTJS_ALLOC(iotjs_httpparserwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_httpparserwrap_t, httpparserwrap);
+
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap, jparser,
+                               &this_module_native_info);
+
+  _this->url = iotjs_string_create();
+  _this->status_msg = iotjs_string_create();
+  for (size_t i = 0; i < HEADER_MAX; i++) {
+    _this->fields[i] = iotjs_string_create();
+    _this->values[i] = iotjs_string_create();
+  }
+
+  iotjs_httpparserwrap_initialize(httpparserwrap, type);
+  _this->parser.data = httpparserwrap;
+
+  return httpparserwrap;
+}
+
+
+static void iotjs_httpparserwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_httpparserwrap_t, httpparserwrap);
+
+  iotjs_string_destroy(&_this->url);
+  iotjs_string_destroy(&_this->status_msg);
+  for (size_t i = 0; i < HEADER_MAX; i++) {
+    iotjs_string_destroy(&_this->fields[i]);
+    iotjs_string_destroy(&_this->values[i]);
+  }
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+
+  IOTJS_RELEASE(httpparserwrap);
+}
+
+
+void iotjs_httpparserwrap_initialize(THIS, http_parser_type type) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+
+  http_parser_init(&_this->parser, type);
+  iotjs_string_make_empty(&_this->url);
+  iotjs_string_make_empty(&_this->status_msg);
+  _this->n_fields = 0;
+  _this->n_values = 0;
+  _this->flushed = false;
+  _this->cur_jbuf = NULL;
+  _this->cur_buf = NULL;
+  _this->cur_buf_len = 0;
+}
+
+
+// http-parser callbacks
+static int iotjs_httpparserwrap_on_message_begin(http_parser* parser) {
+  iotjs_httpparserwrap_t* httpparserwrap =
+      (iotjs_httpparserwrap_t*)(parser->data);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+  iotjs_string_make_empty(&_this->url);
+  iotjs_string_make_empty(&_this->status_msg);
+  return 0;
+}
+
+
+static int iotjs_httpparserwrap_on_url(http_parser* parser, const char* at,
+                                       size_t length) {
+  iotjs_httpparserwrap_t* httpparserwrap =
+      (iotjs_httpparserwrap_t*)(parser->data);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+  iotjs_string_append(&_this->url, at, length);
+  return 0;
+}
+
+
+static int iotjs_httpparserwrap_on_status(http_parser* parser, const char* at,
+                                          size_t length) {
+  iotjs_httpparserwrap_t* httpparserwrap =
+      (iotjs_httpparserwrap_t*)(parser->data);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+  iotjs_string_append(&_this->status_msg, at, length);
+  return 0;
+}
+
+
+static int iotjs_httpparserwrap_on_header_field(http_parser* parser,
+                                                const char* at, size_t length) {
+  iotjs_httpparserwrap_t* httpparserwrap =
+      (iotjs_httpparserwrap_t*)(parser->data);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+  if (_this->n_fields == _this->n_values) {
+    _this->n_fields++;
+    // values and fields are flushed to JS
+    // before corresponding OnHeaderValue is called.
+    if (_this->n_fields == HEADER_MAX) {
+      iotjs_httpparserwrap_flush(httpparserwrap); // to JS world
+      _this->n_fields = 1;
+      _this->n_values = 0;
+    }
+    iotjs_string_make_empty(&_this->fields[_this->n_fields - 1]);
+  }
+  IOTJS_ASSERT(_this->n_fields == _this->n_values + 1);
+  iotjs_string_append(&_this->fields[_this->n_fields - 1], at, length);
+
+  return 0;
+}
+
+
+static int iotjs_httpparserwrap_on_header_value(http_parser* parser,
+                                                const char* at, size_t length) {
+  iotjs_httpparserwrap_t* httpparserwrap =
+      (iotjs_httpparserwrap_t*)(parser->data);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+  if (_this->n_fields != _this->n_values) {
+    _this->n_values++;
+    iotjs_string_make_empty(&_this->values[_this->n_values - 1]);
+  }
+
+  IOTJS_ASSERT(_this->n_fields == _this->n_values);
+
+  iotjs_string_append(&_this->values[_this->n_values - 1], at, length);
+
+  return 0;
+}
+
+
+static int iotjs_httpparserwrap_on_headers_complete(http_parser* parser) {
+  iotjs_httpparserwrap_t* httpparserwrap =
+      (iotjs_httpparserwrap_t*)(parser->data);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+
+  const iotjs_jval_t* jobj = iotjs_httpparserwrap_jobject(httpparserwrap);
+  iotjs_jval_t func =
+      iotjs_jval_get_property(jobj, IOTJS_MAGIC_STRING_ONHEADERSCOMPLETE);
+  IOTJS_ASSERT(iotjs_jval_is_function(&func));
+
+  // URL
+  iotjs_jargs_t argv = iotjs_jargs_create(1);
+  iotjs_jval_t info = iotjs_jval_create_object();
+
+  if (_this->flushed) {
+    // If some headers already are flushed,
+    // flush the remaining headers.
+    // In Flush function, url is already flushed to JS.
+    iotjs_httpparserwrap_flush(httpparserwrap);
+  } else {
+    // Here, there was no flushed header.
+    // We need to make a new header object with all header fields
+    iotjs_jval_t jheader = iotjs_httpparserwrap_make_header(httpparserwrap);
+    iotjs_jval_set_property_jval(&info, IOTJS_MAGIC_STRING_HEADERS, &jheader);
+    iotjs_jval_destroy(&jheader);
+    if (_this->parser.type == HTTP_REQUEST) {
+      IOTJS_ASSERT(!iotjs_string_is_empty(&_this->url));
+      iotjs_jval_set_property_string(&info, IOTJS_MAGIC_STRING_URL,
+                                     &_this->url);
+    }
+  }
+  _this->n_fields = _this->n_values = 0;
+
+  // Method
+  if (_this->parser.type == HTTP_REQUEST) {
+    iotjs_jval_set_property_number(&info, IOTJS_MAGIC_STRING_METHOD,
+                                   _this->parser.method);
+  }
+
+  // Status
+  if (_this->parser.type == HTTP_RESPONSE) {
+    iotjs_jval_set_property_number(&info, IOTJS_MAGIC_STRING_STATUS,
+                                   _this->parser.status_code);
+    iotjs_jval_set_property_string(&info, IOTJS_MAGIC_STRING_STATUS_MSG,
+                                   &_this->status_msg);
+  }
+
+
+  // For future support, current http_server module does not support
+  // upgrade and keepalive.
+  // upgrade
+  iotjs_jval_set_property_boolean(&info, IOTJS_MAGIC_STRING_UPGRADE,
+                                  _this->parser.upgrade);
+  // shouldkeepalive
+  iotjs_jval_set_property_boolean(&info, IOTJS_MAGIC_STRING_SHOULDKEEPALIVE,
+                                  http_should_keep_alive(&_this->parser));
+
+
+  iotjs_jargs_append_jval(&argv, &info);
+
+  iotjs_jval_t res = iotjs_make_callback_with_result(&func, jobj, &argv);
+
+  int ret = 1;
+  if (iotjs_jval_is_boolean(&res)) {
+    ret = iotjs_jval_as_boolean(&res);
+  } else if (iotjs_jval_is_object(&res)) {
+    // if exception throw occurs in iotjs_make_callback_with_result, then the
+    // result can be an object.
+    ret = 0;
+  }
+
+  iotjs_jargs_destroy(&argv);
+  iotjs_jval_destroy(&func);
+  iotjs_jval_destroy(&res);
+  iotjs_jval_destroy(&info);
+
+  return ret;
+}
+
+
+static int iotjs_httpparserwrap_on_body(http_parser* parser, const char* at,
+                                        size_t length) {
+  iotjs_httpparserwrap_t* httpparserwrap =
+      (iotjs_httpparserwrap_t*)(parser->data);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+
+  const iotjs_jval_t* jobj = iotjs_httpparserwrap_jobject(httpparserwrap);
+  iotjs_jval_t func = iotjs_jval_get_property(jobj, IOTJS_MAGIC_STRING_ONBODY);
+  IOTJS_ASSERT(iotjs_jval_is_function(&func));
+
+  iotjs_jargs_t argv = iotjs_jargs_create(3);
+  iotjs_jargs_append_jval(&argv, _this->cur_jbuf);
+  iotjs_jargs_append_number(&argv, at - _this->cur_buf);
+  iotjs_jargs_append_number(&argv, length);
+
+
+  iotjs_make_callback(&func, jobj, &argv);
+
+  iotjs_jargs_destroy(&argv);
+  iotjs_jval_destroy(&func);
+
+  return 0;
+}
+
+
+static int iotjs_httpparserwrap_on_message_complete(http_parser* parser) {
+  iotjs_httpparserwrap_t* httpparserwrap =
+      (iotjs_httpparserwrap_t*)(parser->data);
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_httpparserwrap_t,
+                                           httpparserwrap);
+
+  const iotjs_jval_t* jobj = iotjs_httpparserwrap_jobject(httpparserwrap);
+  iotjs_jval_t func =
+      iotjs_jval_get_property(jobj, IOTJS_MAGIC_STRING_ONMESSAGECOMPLETE);
+  IOTJS_ASSERT(iotjs_jval_is_function(&func));
+
+  iotjs_make_callback(&func, jobj, iotjs_jargs_get_empty());
+
+  iotjs_jval_destroy(&func);
+
+  return 0;
+}
+
+
+iotjs_jval_t iotjs_httpparserwrap_make_header(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+
+  iotjs_jval_t jheader = iotjs_jval_create_array(_this->n_values * 2);
+  for (size_t i = 0; i < _this->n_values; i++) {
+    iotjs_jval_t f = iotjs_jval_create_string(&_this->fields[i]);
+    iotjs_jval_t v = iotjs_jval_create_string(&_this->values[i]);
+    iotjs_jval_set_property_by_index(&jheader, i * 2, &f);
+    iotjs_jval_set_property_by_index(&jheader, i * 2 + 1, &v);
+    iotjs_jval_destroy(&f);
+    iotjs_jval_destroy(&v);
+  }
+  return jheader;
+}
+
+
+void iotjs_httpparserwrap_flush(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+
+  const iotjs_jval_t* jobj = iotjs_httpparserwrap_jobject(httpparserwrap);
+  iotjs_jval_t func =
+      iotjs_jval_get_property(jobj, IOTJS_MAGIC_STRING_ONHEADERS);
+  IOTJS_ASSERT(iotjs_jval_is_function(&func));
+
+  iotjs_jargs_t argv = iotjs_jargs_create(2);
+  iotjs_jval_t jheader = iotjs_httpparserwrap_make_header(httpparserwrap);
+  iotjs_jargs_append_jval(&argv, &jheader);
+  iotjs_jval_destroy(&jheader);
+  if (_this->parser.type == HTTP_REQUEST &&
+      !iotjs_string_is_empty(&_this->url)) {
+    iotjs_jargs_append_string(&argv, &_this->url);
+  }
+
+  iotjs_make_callback(&func, jobj, &argv);
+
+  iotjs_string_make_empty(&_this->url);
+  iotjs_jargs_destroy(&argv);
+  iotjs_jval_destroy(&func);
+  _this->flushed = true;
+}
+
+
+void iotjs_httpparserwrap_set_buf(THIS, iotjs_jval_t* jbuf, char* buf,
+                                  size_t sz) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+  _this->cur_jbuf = jbuf;
+  _this->cur_buf = buf;
+  _this->cur_buf_len = sz;
+}
+
+
+iotjs_jval_t* iotjs_httpparserwrap_jobject(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+
+  return iotjs_jobjectwrap_jobject(&_this->jobjectwrap);
+}
+
+
+http_parser* iotjs_httpparserwrap_parser(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_httpparserwrap_t, httpparserwrap);
+  return &_this->parser;
+}
+
+
+#undef THIS
+
+
+const struct http_parser_settings settings = {
+  iotjs_httpparserwrap_on_message_begin,
+  iotjs_httpparserwrap_on_url,
+  iotjs_httpparserwrap_on_status,
+  iotjs_httpparserwrap_on_header_field,
+  iotjs_httpparserwrap_on_header_value,
+  iotjs_httpparserwrap_on_headers_complete,
+  iotjs_httpparserwrap_on_body,
+  iotjs_httpparserwrap_on_message_complete,
+  NULL, /* on_chunk_header */
+  NULL, /* on_chunk_complete */
+};
+
+
+JHANDLER_FUNCTION(Reinitialize) {
+  JHANDLER_DECLARE_THIS_PTR(httpparserwrap, parser);
+  DJHANDLER_CHECK_ARGS(1, number);
+
+  http_parser_type httpparser_type =
+      (http_parser_type)(JHANDLER_GET_ARG(0, number));
+  IOTJS_ASSERT(httpparser_type == HTTP_REQUEST ||
+               httpparser_type == HTTP_RESPONSE);
+
+  iotjs_httpparserwrap_initialize(parser, httpparser_type);
+}
+
+
+JHANDLER_FUNCTION(Finish) {
+  JHANDLER_DECLARE_THIS_PTR(httpparserwrap, parser);
+  DJHANDLER_CHECK_ARGS(0);
+
+  http_parser* nativeparser = iotjs_httpparserwrap_parser(parser);
+  size_t rv = http_parser_execute(nativeparser, &settings, NULL, 0);
+
+  if (rv != 0) {
+    enum http_errno err = HTTP_PARSER_ERRNO(nativeparser);
+
+    iotjs_jval_t eobj = iotjs_jval_create_error("Parse Error");
+    iotjs_jval_set_property_number(&eobj, IOTJS_MAGIC_STRING_BYTEPARSED, 0);
+    iotjs_jval_set_property_string_raw(&eobj, IOTJS_MAGIC_STRING_CODE,
+                                       http_errno_name(err));
+    iotjs_jhandler_return_jval(jhandler, &eobj);
+    iotjs_jval_destroy(&eobj);
+  }
+}
+
+
+JHANDLER_FUNCTION(Execute) {
+  JHANDLER_DECLARE_THIS_PTR(httpparserwrap, parser);
+  DJHANDLER_CHECK_ARGS(1, object);
+
+  const iotjs_jval_t* jbuffer = JHANDLER_GET_ARG(0, object);
+  iotjs_bufferwrap_t* buffer_wrap = iotjs_bufferwrap_from_jbuffer(jbuffer);
+  char* buf_data = iotjs_bufferwrap_buffer(buffer_wrap);
+  size_t buf_len = iotjs_bufferwrap_length(buffer_wrap);
+  JHANDLER_CHECK(buf_data != NULL);
+  JHANDLER_CHECK(buf_len > 0);
+
+  iotjs_httpparserwrap_set_buf(parser, (iotjs_jval_t*)jbuffer, buf_data,
+                               buf_len);
+
+  http_parser* nativeparser = iotjs_httpparserwrap_parser(parser);
+  size_t nparsed =
+      http_parser_execute(nativeparser, &settings, buf_data, buf_len);
+
+  iotjs_httpparserwrap_set_buf(parser, NULL, NULL, 0);
+
+
+  if (!nativeparser->upgrade && nparsed != buf_len) {
+    // nparsed should equal to buf_len except UPGRADE protocol
+    enum http_errno err = HTTP_PARSER_ERRNO(nativeparser);
+    iotjs_jval_t eobj = iotjs_jval_create_error("Parse Error");
+    iotjs_jval_set_property_number(&eobj, IOTJS_MAGIC_STRING_BYTEPARSED, 0);
+    iotjs_jval_set_property_string_raw(&eobj, IOTJS_MAGIC_STRING_CODE,
+                                       http_errno_name(err));
+    iotjs_jhandler_return_jval(jhandler, &eobj);
+    iotjs_jval_destroy(&eobj);
+  } else {
+    iotjs_jhandler_return_number(jhandler, nparsed);
+  }
+}
+
+
+JHANDLER_FUNCTION(Pause) {
+  JHANDLER_DECLARE_THIS_PTR(httpparserwrap, parser);
+  DJHANDLER_CHECK_ARGS(0);
+
+  http_parser* nativeparser = iotjs_httpparserwrap_parser(parser);
+  http_parser_pause(nativeparser, 1);
+}
+
+
+JHANDLER_FUNCTION(Resume) {
+  JHANDLER_DECLARE_THIS_PTR(httpparserwrap, parser);
+  DJHANDLER_CHECK_ARGS(0);
+
+  http_parser* nativeparser = iotjs_httpparserwrap_parser(parser);
+  http_parser_pause(nativeparser, 0);
+}
+
+
+JHANDLER_FUNCTION(HTTPParserCons) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(1, number);
+
+  const iotjs_jval_t* jparser = JHANDLER_GET_THIS(object);
+
+  http_parser_type httpparser_type =
+      (http_parser_type)(JHANDLER_GET_ARG(0, number));
+  IOTJS_ASSERT(httpparser_type == HTTP_REQUEST ||
+               httpparser_type == HTTP_RESPONSE);
+  iotjs_httpparserwrap_t* parser =
+      iotjs_httpparserwrap_create(jparser, httpparser_type);
+  IOTJS_ASSERT(iotjs_jval_is_object(iotjs_httpparserwrap_jobject(parser)));
+}
+
+
+iotjs_jval_t InitHttpparser() {
+  iotjs_jval_t httpparser = iotjs_jval_create_object();
+
+  iotjs_jval_t jParserCons =
+      iotjs_jval_create_function_with_dispatch(HTTPParserCons);
+  iotjs_jval_set_property_jval(&httpparser, IOTJS_MAGIC_STRING_HTTPPARSER,
+                               &jParserCons);
+
+  iotjs_jval_set_property_number(&jParserCons, IOTJS_MAGIC_STRING_REQUEST,
+                                 HTTP_REQUEST);
+  iotjs_jval_set_property_number(&jParserCons, IOTJS_MAGIC_STRING_RESPONSE,
+                                 HTTP_RESPONSE);
+
+  iotjs_jval_t methods = iotjs_jval_create_object();
+#define V(num, name, string) \
+  iotjs_jval_set_property_string_raw(&methods, #num, #string);
+  HTTP_METHOD_MAP(V)
+#undef V
+
+  iotjs_jval_set_property_jval(&jParserCons, IOTJS_MAGIC_STRING_METHODS,
+                               &methods);
+
+  iotjs_jval_t prototype = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_EXECUTE, Execute);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_REINITIALIZE,
+                        Reinitialize);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_FINISH, Finish);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_PAUSE, Pause);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_RESUME, Resume);
+
+  iotjs_jval_set_property_jval(&jParserCons, IOTJS_MAGIC_STRING_PROTOTYPE,
+                               &prototype);
+
+  iotjs_jval_destroy(&jParserCons);
+  iotjs_jval_destroy(&methods);
+  iotjs_jval_destroy(&prototype);
+
+  return httpparser;
+}
diff --git a/src/modules/iotjs_module_httpparser.h b/src/modules/iotjs_module_httpparser.h
new file mode 100644 (file)
index 0000000..34e6881
--- /dev/null
@@ -0,0 +1,81 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_HTTPPARSER_H
+#define IOTJS_MODULE_HTTPPARSER_H
+
+
+#include "iotjs_objectwrap.h"
+
+#include "http_parser.h"
+
+
+// If # of header fields == HEADER_MAX, flush header to JS side.
+// This is weired : # of maximum headers in C equals to HEADER_MAX-1.
+// This is because , OnHeaders cb, we increase n_fields first,
+// and check whether field == HEADER_MAX.
+// ex) HEADER_MAX 2 means that we can keep at most 1 header field/value
+// during http parsing.
+// Increase this to minimize inter JS-C call
+#define HEADER_MAX 10
+
+
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+
+  http_parser parser;
+
+  iotjs_string_t url;
+  iotjs_string_t status_msg;
+
+  iotjs_string_t fields[HEADER_MAX];
+  iotjs_string_t values[HEADER_MAX];
+  size_t n_fields;
+  size_t n_values;
+
+  iotjs_jval_t* cur_jbuf;
+  char* cur_buf;
+  size_t cur_buf_len;
+
+  bool flushed;
+} IOTJS_VALIDATED_STRUCT(iotjs_httpparserwrap_t);
+
+
+typedef enum http_parser_type http_parser_type;
+
+
+#define THIS iotjs_httpparserwrap_t* httpparserwrap
+
+
+iotjs_httpparserwrap_t* iotjs_httpparserwrap_create(const iotjs_jval_t* jparser,
+                                                    http_parser_type type);
+
+void iotjs_httpparserwrap_initialize(THIS, http_parser_type type);
+iotjs_jval_t iotjs_httpparserwrap_make_header(THIS);
+
+void iotjs_httpparserwrap_flush(THIS);
+
+void iotjs_httpparserwrap_set_buf(THIS, iotjs_jval_t* jbuf, char* buf,
+                                  size_t sz);
+
+iotjs_jval_t* iotjs_httpparserwrap_jobject(THIS);
+http_parser* iotjs_httpparserwrap_parser(THIS);
+
+
+#undef THIS
+
+
+#endif /* IOTJS_MODULE_HTTPPARSER_H */
diff --git a/src/modules/iotjs_module_https.c b/src/modules/iotjs_module_https.c
new file mode 100644 (file)
index 0000000..dd6f2d2
--- /dev/null
@@ -0,0 +1,855 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_module_https.h"
+#include "iotjs_objectwrap.h"
+#include <inttypes.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdlib.h>
+#include <string.h>
+
+void iotjs_https_destroy(iotjs_https_t* https_data);
+IOTJS_DEFINE_NATIVE_HANDLE_INFO(https);
+
+//-------------Constructor------------
+iotjs_https_t* iotjs_https_create(const char* URL, const char* method,
+                                  const char* ca, const char* cert,
+                                  const char* key, const iotjs_jval_t* jthis) {
+  iotjs_https_t* https_data = IOTJS_ALLOC(iotjs_https_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_https_t, https_data);
+
+  // Original Request Details
+  _this->URL = URL;
+  _this->header_list = NULL;
+  if (strcmp(method, STRING_GET) == 0)
+    _this->method = HTTPS_GET;
+  else if (strcmp(method, STRING_POST) == 0)
+    _this->method = HTTPS_POST;
+  else if (strcmp(method, STRING_PUT) == 0)
+    _this->method = HTTPS_PUT;
+  else if (strcmp(method, STRING_DELETE) == 0)
+    _this->method = HTTPS_DELETE;
+  else if (strcmp(method, STRING_HEAD) == 0)
+    _this->method = HTTPS_HEAD;
+  else if (strcmp(method, STRING_CONNECT) == 0)
+    _this->method = HTTPS_CONNECT;
+  else if (strcmp(method, STRING_OPTIONS) == 0)
+    _this->method = HTTPS_OPTIONS;
+  else if (strcmp(method, STRING_TRACE) == 0)
+    _this->method = HTTPS_TRACE;
+  else {
+    IOTJS_ASSERT(0);
+  }
+
+  // TLS certs stuff
+  _this->ca = ca;
+  _this->cert = cert;
+  _this->key = key;
+  // Content Length stuff
+  _this->content_length = -1;
+
+  // Handles
+  _this->loop = iotjs_environment_loop(iotjs_environment_get());
+  _this->jthis_native = iotjs_jval_create_copied(jthis);
+  iotjs_jval_set_object_native_handle(&(_this->jthis_native),
+                                      (uintptr_t)https_data,
+                                      &https_native_info);
+  _this->curl_multi_handle = curl_multi_init();
+  _this->curl_easy_handle = curl_easy_init();
+  _this->timeout.data = (void*)https_data;
+  uv_timer_init(_this->loop, &(_this->timeout));
+  _this->request_done = false;
+  _this->closing_handles = 3;
+  _this->poll_data = NULL;
+
+  // Timeout stuff
+  _this->timeout_ms = -1;
+  _this->last_bytes_num = -1;
+  _this->last_bytes_time = 0;
+  _this->socket_timeout.data = (void*)https_data;
+  uv_timer_init(_this->loop, &(_this->socket_timeout));
+
+  // ReadData stuff
+  _this->cur_read_index = 0;
+  _this->is_stream_writable = false;
+  _this->stream_ended = false;
+  _this->data_to_read = false;
+  _this->to_destroy_read_onwrite = false;
+  _this->async_read_onwrite.data = (void*)https_data;
+  uv_timer_init(_this->loop, &(_this->async_read_onwrite));
+  // No Need to read data for following types of requests
+  if (_this->method == HTTPS_GET || _this->method == HTTPS_DELETE ||
+      _this->method == HTTPS_HEAD || _this->method == HTTPS_OPTIONS ||
+      _this->method == HTTPS_TRACE)
+    _this->stream_ended = true;
+
+  return https_data;
+}
+
+// Destructor
+void iotjs_https_destroy(iotjs_https_t* https_data) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_https_t, https_data);
+  // To shutup unused variable _this warning
+  _this->URL = NULL;
+  IOTJS_RELEASE(https_data);
+}
+
+//----------------Utility Functions------------------
+void iotjs_https_check_done(iotjs_https_t* https_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  char* done_url;
+  CURLMsg* message;
+  int pending;
+  bool error = false;
+
+  while ((message = curl_multi_info_read(_this->curl_multi_handle, &pending))) {
+    switch (message->msg) {
+      case CURLMSG_DONE:
+        curl_easy_getinfo(message->easy_handle, CURLINFO_EFFECTIVE_URL,
+                          &done_url);
+        break;
+      default:
+        error = true;
+    }
+    if (error) {
+      iotjs_jargs_t jarg = iotjs_jargs_create(1);
+      char error[] = "Unknown Error has occured.";
+      iotjs_string_t jresult_string =
+          iotjs_string_create_with_size(error, strlen(error));
+      iotjs_jargs_append_string(&jarg, &jresult_string);
+      iotjs_https_jcallback(https_data, IOTJS_MAGIC_STRING_ONERROR, &jarg,
+                            false);
+      iotjs_string_destroy(&jresult_string);
+      iotjs_jargs_destroy(&jarg);
+    }
+    if (_this->stream_ended) {
+      iotjs_https_cleanup(https_data);
+    } else {
+      if (_this->to_destroy_read_onwrite) {
+        iotjs_https_call_read_onwrite_async(https_data);
+      }
+      _this->request_done = true;
+    }
+    break;
+  }
+}
+
+// Cleanup before destructor
+void iotjs_https_cleanup(iotjs_https_t* https_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  _this->loop = NULL;
+
+  uv_close((uv_handle_t*)&_this->timeout,
+           (uv_close_cb)iotjs_https_uv_close_callback);
+  uv_close((uv_handle_t*)&_this->socket_timeout,
+           (uv_close_cb)iotjs_https_uv_close_callback);
+  uv_close((uv_handle_t*)&_this->async_read_onwrite,
+           (uv_close_cb)iotjs_https_uv_close_callback);
+
+  iotjs_https_jcallback(https_data, IOTJS_MAGIC_STRING_ONEND,
+                        iotjs_jargs_get_empty(), false);
+  iotjs_https_jcallback(https_data, IOTJS_MAGIC_STRING_ONCLOSED,
+                        iotjs_jargs_get_empty(), false);
+
+  curl_multi_remove_handle(_this->curl_multi_handle, _this->curl_easy_handle);
+  curl_easy_cleanup(_this->curl_easy_handle);
+  _this->curl_easy_handle = NULL;
+  curl_multi_cleanup(_this->curl_multi_handle);
+  _this->curl_multi_handle = NULL;
+  curl_slist_free_all(_this->header_list);
+
+  if (_this->poll_data != NULL)
+    iotjs_https_poll_close_all(_this->poll_data);
+
+  if (_this->to_destroy_read_onwrite) {
+    const iotjs_jargs_t* jarg = iotjs_jargs_get_empty();
+    const iotjs_jval_t* jthis = &(_this->jthis_native);
+    IOTJS_ASSERT(iotjs_jval_is_function(&(_this->read_onwrite)));
+
+    if (!iotjs_jval_is_undefined(&(_this->read_callback)))
+      iotjs_make_callback(&(_this->read_callback), jthis, jarg);
+
+    iotjs_make_callback(&(_this->read_onwrite), jthis, jarg);
+    _this->to_destroy_read_onwrite = false;
+    iotjs_string_destroy(&(_this->read_chunk));
+    iotjs_jval_destroy(&(_this->read_onwrite));
+    iotjs_jval_destroy(&(_this->read_callback));
+  }
+  return;
+}
+
+CURLM* iotjs_https_get_multi_handle(iotjs_https_t* https_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  return _this->curl_multi_handle;
+}
+
+// Set various parameters of curl handles
+void iotjs_https_initialize_curl_opts(iotjs_https_t* https_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+
+  // Setup Some parameters for multi handle
+  curl_multi_setopt(_this->curl_multi_handle, CURLMOPT_SOCKETFUNCTION,
+                    iotjs_https_curl_socket_callback);
+  curl_multi_setopt(_this->curl_multi_handle, CURLMOPT_SOCKETDATA,
+                    (void*)https_data);
+  curl_multi_setopt(_this->curl_multi_handle, CURLMOPT_TIMERFUNCTION,
+                    iotjs_https_curl_start_timeout_callback);
+  curl_multi_setopt(_this->curl_multi_handle, CURLMOPT_TIMERDATA,
+                    (void*)https_data);
+
+  curl_easy_setopt(_this->curl_easy_handle, CURLOPT_PROXY, "");
+  curl_easy_setopt(_this->curl_easy_handle, CURLOPT_HEADERDATA,
+                   (void*)https_data);
+  curl_easy_setopt(_this->curl_easy_handle, CURLOPT_WRITEFUNCTION,
+                   iotjs_https_curl_write_callback);
+  curl_easy_setopt(_this->curl_easy_handle, CURLOPT_WRITEDATA,
+                   (void*)https_data);
+
+  // Read and send data to server only for some request types
+  if (_this->method == HTTPS_POST || _this->method == HTTPS_PUT ||
+      _this->method == HTTPS_CONNECT) {
+    curl_easy_setopt(_this->curl_easy_handle, CURLOPT_READFUNCTION,
+                     iotjs_https_curl_read_callback);
+    curl_easy_setopt(_this->curl_easy_handle, CURLOPT_READDATA,
+                     (void*)https_data);
+  }
+
+  curl_easy_setopt(_this->curl_easy_handle, CURLOPT_SOCKOPTFUNCTION,
+                   iotjs_https_curl_sockopt_callback);
+  curl_easy_setopt(_this->curl_easy_handle, CURLOPT_SOCKOPTDATA,
+                   (void*)https_data);
+
+  curl_easy_setopt(_this->curl_easy_handle, CURLOPT_URL, _this->URL);
+  _this->URL = NULL;
+  curl_easy_setopt(_this->curl_easy_handle, CURLOPT_PROTOCOLS,
+                   CURLPROTO_HTTP | CURLPROTO_HTTPS);
+
+  if (strlen(_this->ca) > 0)
+    curl_easy_setopt(_this->curl_easy_handle, CURLOPT_CAINFO, _this->ca);
+  _this->ca = NULL;
+  if (strlen(_this->cert) > 0)
+    curl_easy_setopt(_this->curl_easy_handle, CURLOPT_SSLCERT, _this->cert);
+  _this->cert = NULL;
+  if (strlen(_this->key) > 0)
+    curl_easy_setopt(_this->curl_easy_handle, CURLOPT_SSLKEY, _this->key);
+  _this->key = NULL;
+
+  // Various request types
+  switch (_this->method) {
+    case HTTPS_GET:
+      curl_easy_setopt(_this->curl_easy_handle, CURLOPT_HTTPGET, 1L);
+      break;
+    case HTTPS_POST:
+      curl_easy_setopt(_this->curl_easy_handle, CURLOPT_POST, 1L);
+      break;
+    case HTTPS_PUT:
+      curl_easy_setopt(_this->curl_easy_handle, CURLOPT_UPLOAD, 1L);
+      break;
+    case HTTPS_DELETE:
+      curl_easy_setopt(_this->curl_easy_handle, CURLOPT_CUSTOMREQUEST,
+                       "DELETE");
+      break;
+    case HTTPS_HEAD:
+      curl_easy_setopt(_this->curl_easy_handle, CURLOPT_NOBODY, 1L);
+      break;
+    case HTTPS_CONNECT:
+      curl_easy_setopt(_this->curl_easy_handle, CURLOPT_CUSTOMREQUEST,
+                       "CONNECT");
+      break;
+    case HTTPS_OPTIONS:
+      curl_easy_setopt(_this->curl_easy_handle, CURLOPT_CUSTOMREQUEST,
+                       "OPTIONS");
+      break;
+    case HTTPS_TRACE:
+      curl_easy_setopt(_this->curl_easy_handle, CURLOPT_CUSTOMREQUEST, "TRACE");
+      break;
+  }
+
+  curl_easy_setopt(_this->curl_easy_handle, CURLOPT_HTTP_TRANSFER_DECODING, 0L);
+}
+
+// Get https.ClientRequest from struct
+iotjs_jval_t* iotjs_https_jthis_from_https(iotjs_https_t* https_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  return &(_this->jthis_native);
+}
+
+// Call any property of ClientRequest._Incoming
+bool iotjs_https_jcallback(iotjs_https_t* https_data, const char* property,
+                           const iotjs_jargs_t* jarg, bool resultvalue) {
+  iotjs_jval_t* jthis = iotjs_https_jthis_from_https(https_data);
+  bool retval = true;
+  if (iotjs_jval_is_null(jthis))
+    return retval;
+
+  iotjs_jval_t jincoming =
+      iotjs_jval_get_property(jthis, IOTJS_MAGIC_STRING__INCOMING);
+  iotjs_jval_t cb = iotjs_jval_get_property(&jincoming, property);
+
+  IOTJS_ASSERT(iotjs_jval_is_function(&cb));
+  if (!resultvalue) {
+    iotjs_make_callback(&cb, &jincoming, jarg);
+  } else {
+    iotjs_jval_t result =
+        iotjs_make_callback_with_result(&cb, &jincoming, jarg);
+    retval = iotjs_jval_as_boolean(&result);
+    iotjs_jval_destroy(&result);
+  }
+
+  iotjs_jval_destroy(&jincoming);
+  iotjs_jval_destroy(&cb);
+  return retval;
+}
+
+// Call onWrite and callback after ClientRequest._write
+void iotjs_https_call_read_onwrite(uv_timer_t* timer) {
+  iotjs_https_t* https_data = (iotjs_https_t*)(timer->data);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+
+  uv_timer_stop(&(_this->async_read_onwrite));
+  if (iotjs_jval_is_null(&_this->jthis_native))
+    return;
+  const iotjs_jargs_t* jarg = iotjs_jargs_get_empty();
+  const iotjs_jval_t* jthis = &(_this->jthis_native);
+  IOTJS_ASSERT(iotjs_jval_is_function(&(_this->read_onwrite)));
+
+  if (!iotjs_jval_is_undefined(&(_this->read_callback)))
+    iotjs_make_callback(&(_this->read_callback), jthis, jarg);
+
+  iotjs_make_callback(&(_this->read_onwrite), jthis, jarg);
+}
+
+// Call the above method Asynchronously
+void iotjs_https_call_read_onwrite_async(iotjs_https_t* https_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  uv_timer_start(&(_this->async_read_onwrite), iotjs_https_call_read_onwrite, 0,
+                 0);
+}
+
+// ------------Functions almost directly called by JS----------
+// Add a header to outgoing request
+void iotjs_https_add_header(iotjs_https_t* https_data,
+                            const char* char_header) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  _this->header_list = curl_slist_append(_this->header_list, char_header);
+  if (_this->method == HTTPS_POST || _this->method == HTTPS_PUT) {
+    if (strncmp(char_header, "Content-Length: ", strlen("Content-Length: ")) ==
+        0) {
+      const char* numberString = char_header + strlen("Content-Length: ");
+      _this->content_length = strtol(numberString, NULL, 10);
+    }
+  }
+}
+
+// Recieved data to write from ClientRequest._write
+void iotjs_https_data_to_write(iotjs_https_t* https_data,
+                               iotjs_string_t read_chunk,
+                               const iotjs_jval_t* callback,
+                               const iotjs_jval_t* onwrite) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+
+  if (_this->to_destroy_read_onwrite) {
+    _this->to_destroy_read_onwrite = false;
+    iotjs_string_destroy(&(_this->read_chunk));
+    iotjs_jval_destroy(&(_this->read_onwrite));
+    iotjs_jval_destroy(&(_this->read_callback));
+  }
+
+  _this->read_chunk = read_chunk;
+  _this->data_to_read = true;
+
+  _this->read_callback = iotjs_jval_create_copied(callback);
+  _this->read_onwrite = iotjs_jval_create_copied(onwrite);
+  _this->to_destroy_read_onwrite = true;
+
+  if (_this->request_done) {
+    iotjs_https_call_read_onwrite_async(https_data);
+  } else if (_this->is_stream_writable) {
+    curl_easy_pause(_this->curl_easy_handle, CURLPAUSE_CONT);
+    uv_timer_stop(&(_this->timeout));
+    uv_timer_start(&(_this->timeout), iotjs_https_uv_timeout_callback, 1, 0);
+  }
+}
+
+// Finish writing all data from ClientRequest Stream
+void iotjs_https_finish_request(iotjs_https_t* https_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  _this->stream_ended = true;
+  if (_this->request_done) {
+    iotjs_https_cleanup(https_data);
+  } else if (_this->is_stream_writable) {
+    curl_easy_pause(_this->curl_easy_handle, CURLPAUSE_CONT);
+    uv_timer_stop(&(_this->timeout));
+    uv_timer_start(&(_this->timeout), iotjs_https_uv_timeout_callback, 1, 0);
+  }
+}
+
+// Start sending the request
+void iotjs_https_send_request(iotjs_https_t* https_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  // Add all the headers to the easy handle
+  curl_easy_setopt(_this->curl_easy_handle, CURLOPT_HTTPHEADER,
+                   _this->header_list);
+
+  if (_this->method == HTTPS_POST && _this->content_length != -1)
+    curl_easy_setopt(_this->curl_easy_handle, CURLOPT_POSTFIELDSIZE,
+                     _this->content_length);
+  else if (_this->method == HTTPS_PUT && _this->content_length != -1)
+    curl_easy_setopt(_this->curl_easy_handle, CURLOPT_INFILESIZE,
+                     _this->content_length);
+
+  curl_multi_add_handle(_this->curl_multi_handle, _this->curl_easy_handle);
+}
+
+// Set timeout for request.
+void iotjs_https_set_timeout(long ms, iotjs_https_t* https_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  if (ms < 0)
+    return;
+  _this->timeout_ms = ms;
+  uv_timer_start(&(_this->socket_timeout),
+                 iotjs_https_uv_socket_timeout_callback, 1, (uint64_t)ms);
+}
+
+
+//--------------CURL Callbacks------------------
+// Read callback is actually to write data to outgoing request
+size_t iotjs_https_curl_read_callback(void* contents, size_t size, size_t nmemb,
+                                      void* userp) {
+  iotjs_https_t* https_data = (iotjs_https_t*)userp;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+
+  // If stream wasnt made writable yet, make it so.
+  if (!_this->is_stream_writable) {
+    _this->is_stream_writable = true;
+    iotjs_https_jcallback(https_data, IOTJS_MAGIC_STRING_ONWRITABLE,
+                          iotjs_jargs_get_empty(), false);
+  }
+
+  if (_this->data_to_read) {
+    size_t real_size = size * nmemb;
+    size_t chunk_size = iotjs_string_size(&(_this->read_chunk));
+    size_t left_to_copy_size = chunk_size - _this->cur_read_index;
+
+    if (real_size < 1)
+      return 0;
+
+    // send some data
+    if (_this->cur_read_index < chunk_size) {
+      size_t num_to_copy =
+          (left_to_copy_size < real_size) ? left_to_copy_size : real_size;
+      const char* buf = iotjs_string_data(&(_this->read_chunk));
+      buf = &buf[_this->cur_read_index];
+      strncpy((char*)contents, buf, num_to_copy);
+      _this->cur_read_index = _this->cur_read_index + num_to_copy;
+      return num_to_copy;
+    }
+
+    // Finished sending one chunk of data
+    _this->cur_read_index = 0;
+    _this->data_to_read = false;
+    iotjs_https_call_read_onwrite_async(https_data);
+  }
+
+  // If the data is sent, and stream hasn't ended, wait for more data
+  if (!_this->stream_ended) {
+    return CURL_READFUNC_PAUSE;
+  }
+
+  // All done, end the transfer
+  return 0;
+}
+
+// Pass Curl events on its fd sockets
+int iotjs_https_curl_socket_callback(CURL* easy, curl_socket_t sockfd,
+                                     int action, void* userp, void* socketp) {
+  iotjs_https_t* https_data = (iotjs_https_t*)userp;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  if (action == CURL_POLL_IN || action == CURL_POLL_OUT ||
+      action == CURL_POLL_INOUT) {
+    iotjs_https_poll_t* poll_data = NULL;
+
+    if (!socketp) {
+      poll_data = iotjs_https_poll_create(_this->loop, sockfd, https_data);
+      curl_multi_assign(_this->curl_multi_handle, sockfd, (void*)poll_data);
+      _this->closing_handles = _this->closing_handles + 1;
+      if (_this->poll_data == NULL)
+        _this->poll_data = poll_data;
+      else
+        iotjs_https_poll_append(_this->poll_data, poll_data);
+    } else
+      poll_data = (iotjs_https_poll_t*)socketp;
+
+    if (action == CURL_POLL_IN)
+      uv_poll_start(iotjs_https_poll_get_poll_handle(poll_data), UV_READABLE,
+                    iotjs_https_uv_poll_callback);
+    else if (action == CURL_POLL_OUT)
+      uv_poll_start(iotjs_https_poll_get_poll_handle(poll_data), UV_WRITABLE,
+                    iotjs_https_uv_poll_callback);
+    else if (action == CURL_POLL_INOUT)
+      uv_poll_start(iotjs_https_poll_get_poll_handle(poll_data),
+                    UV_READABLE | UV_WRITABLE, iotjs_https_uv_poll_callback);
+  } else {
+    if (socketp) {
+      iotjs_https_poll_t* poll_data = (iotjs_https_poll_t*)socketp;
+      iotjs_https_poll_close(poll_data);
+      curl_multi_assign(_this->curl_multi_handle, sockfd, NULL);
+    }
+  }
+  return 0;
+}
+
+// Socket Assigned Callback
+int iotjs_https_curl_sockopt_callback(void* userp, curl_socket_t curlfd,
+                                      curlsocktype purpose) {
+  iotjs_https_t* https_data = (iotjs_https_t*)userp;
+  iotjs_https_jcallback(https_data, IOTJS_MAGIC_STRING_ONSOCKET,
+                        iotjs_jargs_get_empty(), false);
+  return CURL_SOCKOPT_OK;
+}
+
+// Curl wants us to signal after timeout
+int iotjs_https_curl_start_timeout_callback(CURLM* multi, long timeout_ms,
+                                            void* userp) {
+  iotjs_https_t* https_data = (iotjs_https_t*)userp;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  if (timeout_ms < 0)
+    uv_timer_stop(&(_this->timeout));
+  else {
+    if (timeout_ms == 0)
+      timeout_ms = 1;
+    if ((_this->timeout_ms != -1) && (timeout_ms > _this->timeout_ms))
+      timeout_ms = _this->timeout_ms;
+    uv_timer_start(&(_this->timeout), iotjs_https_uv_timeout_callback,
+                   (uint64_t)timeout_ms, 0);
+  }
+  return 0;
+}
+
+// Write Callback is actually to read data from incoming response
+size_t iotjs_https_curl_write_callback(void* contents, size_t size,
+                                       size_t nmemb, void* userp) {
+  iotjs_https_t* https_data = (iotjs_https_t*)userp;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  size_t real_size = size * nmemb;
+  if (iotjs_jval_is_null(&_this->jthis_native))
+    return real_size - 1;
+  iotjs_jargs_t jarg = iotjs_jargs_create(1);
+  iotjs_jval_t jresult_arr = iotjs_jval_create_byte_array(real_size, contents);
+  iotjs_jargs_append_jval(&jarg, &jresult_arr);
+
+  bool result =
+      iotjs_https_jcallback(https_data, IOTJS_MAGIC_STRING_ONDATA, &jarg, true);
+
+  iotjs_jval_destroy(&jresult_arr);
+  iotjs_jargs_destroy(&jarg);
+
+  if (!result) {
+    return real_size - 1;
+  }
+
+  return real_size;
+}
+
+
+//--------------LibTUV Callbacks------------------
+// Callback called on closing handles during cleanup
+void iotjs_https_uv_close_callback(uv_handle_t* handle) {
+  iotjs_https_t* https_data = (iotjs_https_t*)handle->data;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  _this->closing_handles = _this->closing_handles - 1;
+  if (_this->closing_handles <= 0) {
+    if (_this->poll_data != NULL)
+      iotjs_https_poll_destroy(_this->poll_data);
+    iotjs_jval_destroy(&_this->jthis_native);
+  }
+}
+
+// Callback called when poll detects actions on FD
+void iotjs_https_uv_poll_callback(uv_poll_t* poll, int status, int events) {
+  iotjs_https_poll_t* poll_data = (iotjs_https_poll_t*)poll->data;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_poll_t, poll_data);
+  iotjs_https_t* https_data = (iotjs_https_t*)_this->https_data;
+
+  int flags = 0;
+  if (status < 0)
+    flags = CURL_CSELECT_ERR;
+  if (!status && events & UV_READABLE)
+    flags |= CURL_CSELECT_IN;
+  if (!status && events & UV_WRITABLE)
+    flags |= CURL_CSELECT_OUT;
+  int running_handles;
+  curl_multi_socket_action(iotjs_https_get_multi_handle(https_data),
+                           _this->sockfd, flags, &running_handles);
+  iotjs_https_check_done(https_data);
+}
+
+// This function is for signalling to curl a given time has passed.
+// This timeout is usually given by curl itself.
+void iotjs_https_uv_timeout_callback(uv_timer_t* timer) {
+  iotjs_https_t* https_data = (iotjs_https_t*)(timer->data);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  uv_timer_stop(timer);
+  curl_multi_socket_action(_this->curl_multi_handle, CURL_SOCKET_TIMEOUT, 0,
+                           &_this->running_handles);
+  iotjs_https_check_done(https_data);
+}
+
+// Callback called to check if request has timed out
+void iotjs_https_uv_socket_timeout_callback(uv_timer_t* timer) {
+  iotjs_https_t* https_data = (iotjs_https_t*)(timer->data);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_t, https_data);
+  double download_bytes = 0;
+  double upload_bytes = 0;
+  uint64_t total_time_ms = 0;
+
+  if (_this->timeout_ms != -1) {
+    curl_easy_getinfo(_this->curl_easy_handle, CURLINFO_SIZE_DOWNLOAD,
+                      &download_bytes);
+    curl_easy_getinfo(_this->curl_easy_handle, CURLINFO_SIZE_UPLOAD,
+                      &upload_bytes);
+    total_time_ms = uv_now(_this->loop);
+    double total_bytes = download_bytes + upload_bytes;
+
+    if (_this->last_bytes_num == total_bytes) {
+      if (total_time_ms >
+          ((uint64_t)_this->timeout_ms + _this->last_bytes_time)) {
+        if (!_this->request_done) {
+          iotjs_https_jcallback(https_data, IOTJS_MAGIC_STRING_ONTIMEOUT,
+                                iotjs_jargs_get_empty(), false);
+        }
+        uv_timer_stop(&(_this->socket_timeout));
+      }
+    } else {
+      _this->last_bytes_num = total_bytes;
+      _this->last_bytes_time = total_time_ms;
+    }
+  }
+}
+
+//--------------https_poll Functions------------------
+iotjs_https_poll_t* iotjs_https_poll_create(uv_loop_t* loop,
+                                            curl_socket_t sockfd,
+                                            iotjs_https_t* https_data) {
+  iotjs_https_poll_t* poll_data = IOTJS_ALLOC(iotjs_https_poll_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_https_poll_t, poll_data);
+  _this->sockfd = sockfd;
+  _this->poll_handle.data = poll_data;
+  _this->https_data = https_data;
+  _this->closing = false;
+  _this->next = NULL;
+  uv_poll_init_socket(loop, &_this->poll_handle, sockfd);
+  return poll_data;
+}
+
+void iotjs_https_poll_append(iotjs_https_poll_t* head,
+                             iotjs_https_poll_t* poll_data) {
+  iotjs_https_poll_t* current = head;
+  iotjs_https_poll_t* next = iotjs_https_poll_get_next(current);
+  while (next != NULL) {
+    current = next;
+    next = iotjs_https_poll_get_next(current);
+  }
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_poll_t, current);
+  _this->next = poll_data;
+}
+
+iotjs_https_poll_t* iotjs_https_poll_get_next(iotjs_https_poll_t* poll_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_poll_t, poll_data);
+  return _this->next;
+}
+
+uv_poll_t* iotjs_https_poll_get_poll_handle(iotjs_https_poll_t* poll_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_poll_t, poll_data);
+  return &_this->poll_handle;
+}
+
+void iotjs_https_poll_close(iotjs_https_poll_t* poll_data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_https_poll_t, poll_data);
+  if (_this->closing == false) {
+    _this->closing = true;
+    uv_poll_stop(&_this->poll_handle);
+    _this->poll_handle.data = _this->https_data;
+    uv_close((uv_handle_t*)&_this->poll_handle, iotjs_https_uv_close_callback);
+  }
+  return;
+}
+
+void iotjs_https_poll_close_all(iotjs_https_poll_t* head) {
+  iotjs_https_poll_t* current = head;
+  while (current != NULL) {
+    iotjs_https_poll_close(current);
+    current = iotjs_https_poll_get_next(current);
+  }
+}
+
+void iotjs_https_poll_destroy(iotjs_https_poll_t* poll_data) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_https_poll_t, poll_data);
+  if (_this->next != NULL) {
+    iotjs_https_poll_destroy(_this->next);
+  }
+  IOTJS_RELEASE(poll_data);
+}
+
+// ------------JHANDLERS----------------
+
+JHANDLER_FUNCTION(createRequest) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(1, object);
+
+  const iotjs_jval_t* jthis = JHANDLER_GET_ARG(0, object);
+
+  iotjs_jval_t jhost = iotjs_jval_get_property(jthis, IOTJS_MAGIC_STRING_HOST);
+  iotjs_string_t host = iotjs_jval_as_string(&jhost);
+  iotjs_jval_destroy(&jhost);
+
+  iotjs_jval_t jmethod =
+      iotjs_jval_get_property(jthis, IOTJS_MAGIC_STRING_METHOD);
+  iotjs_string_t method = iotjs_jval_as_string(&jmethod);
+  iotjs_jval_destroy(&jmethod);
+
+  iotjs_jval_t jca = iotjs_jval_get_property(jthis, IOTJS_MAGIC_STRING_CA);
+  iotjs_string_t ca = iotjs_jval_as_string(&jca);
+  iotjs_jval_destroy(&jca);
+
+  iotjs_jval_t jcert = iotjs_jval_get_property(jthis, IOTJS_MAGIC_STRING_CERT);
+  iotjs_string_t cert = iotjs_jval_as_string(&jcert);
+  iotjs_jval_destroy(&jcert);
+
+  iotjs_jval_t jkey = iotjs_jval_get_property(jthis, IOTJS_MAGIC_STRING_KEY);
+  iotjs_string_t key = iotjs_jval_as_string(&jkey);
+  iotjs_jval_destroy(&jkey);
+
+  if (curl_global_init(CURL_GLOBAL_SSL)) {
+    return;
+  }
+  iotjs_https_t* https_data =
+      iotjs_https_create(iotjs_string_data(&host), iotjs_string_data(&method),
+                         iotjs_string_data(&ca), iotjs_string_data(&cert),
+                         iotjs_string_data(&key), jthis);
+
+  iotjs_https_initialize_curl_opts(https_data);
+
+  iotjs_string_destroy(&host);
+  iotjs_string_destroy(&method);
+  iotjs_string_destroy(&ca);
+  iotjs_string_destroy(&cert);
+  iotjs_string_destroy(&key);
+  iotjs_jhandler_return_null(jhandler);
+}
+
+JHANDLER_FUNCTION(addHeader) {
+  DJHANDLER_CHECK_THIS(object);
+
+  DJHANDLER_CHECK_ARGS(2, string, object);
+  iotjs_string_t header = JHANDLER_GET_ARG(0, string);
+  const char* char_header = iotjs_string_data(&header);
+
+  const iotjs_jval_t* jthis = JHANDLER_GET_ARG(1, object);
+  iotjs_https_t* https_data =
+      (iotjs_https_t*)iotjs_jval_get_object_native_handle(jthis);
+  iotjs_https_add_header(https_data, char_header);
+
+  iotjs_string_destroy(&header);
+  iotjs_jhandler_return_null(jhandler);
+}
+
+JHANDLER_FUNCTION(sendRequest) {
+  DJHANDLER_CHECK_THIS(object);
+
+  DJHANDLER_CHECK_ARG(0, object);
+  const iotjs_jval_t* jthis = JHANDLER_GET_ARG(0, object);
+  iotjs_https_t* https_data =
+      (iotjs_https_t*)iotjs_jval_get_object_native_handle(jthis);
+  iotjs_https_send_request(https_data);
+  iotjs_jhandler_return_null(jhandler);
+}
+
+JHANDLER_FUNCTION(setTimeout) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(2, number, object);
+
+  double ms = JHANDLER_GET_ARG(0, number);
+  const iotjs_jval_t* jthis = JHANDLER_GET_ARG(1, object);
+
+  iotjs_https_t* https_data =
+      (iotjs_https_t*)iotjs_jval_get_object_native_handle(jthis);
+  iotjs_https_set_timeout((long)ms, https_data);
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+JHANDLER_FUNCTION(_write) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(2, object, string);
+  // Argument 3 can be null, so not checked directly, checked later
+  DJHANDLER_CHECK_ARG(3, function);
+
+  const iotjs_jval_t* jthis = JHANDLER_GET_ARG(0, object);
+  iotjs_string_t read_chunk = JHANDLER_GET_ARG(1, string);
+
+  const iotjs_jval_t* callback = iotjs_jhandler_get_arg(jhandler, 2);
+  const iotjs_jval_t* onwrite = JHANDLER_GET_ARG(3, function);
+
+  iotjs_https_t* https_data =
+      (iotjs_https_t*)iotjs_jval_get_object_native_handle(jthis);
+  iotjs_https_data_to_write(https_data, read_chunk, callback, onwrite);
+
+  // readchunk was copied to https_data, hence not destroyed.
+  iotjs_jhandler_return_null(jhandler);
+}
+
+JHANDLER_FUNCTION(finishRequest) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARG(0, object);
+
+  const iotjs_jval_t* jthis = JHANDLER_GET_ARG(0, object);
+  iotjs_https_t* https_data =
+      (iotjs_https_t*)iotjs_jval_get_object_native_handle(jthis);
+  iotjs_https_finish_request(https_data);
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+JHANDLER_FUNCTION(Abort) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARG(0, object);
+
+  const iotjs_jval_t* jthis = JHANDLER_GET_ARG(0, object);
+  iotjs_https_t* https_data =
+      (iotjs_https_t*)iotjs_jval_get_object_native_handle(jthis);
+  iotjs_https_cleanup(https_data);
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+iotjs_jval_t InitHttps() {
+  iotjs_jval_t https = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&https, IOTJS_MAGIC_STRING_CREATEREQUEST,
+                        createRequest);
+  iotjs_jval_set_method(&https, IOTJS_MAGIC_STRING_ADDHEADER, addHeader);
+  iotjs_jval_set_method(&https, IOTJS_MAGIC_STRING_SENDREQUEST, sendRequest);
+  iotjs_jval_set_method(&https, IOTJS_MAGIC_STRING_SETTIMEOUT, setTimeout);
+  iotjs_jval_set_method(&https, IOTJS_MAGIC_STRING__WRITE, _write);
+  iotjs_jval_set_method(&https, IOTJS_MAGIC_STRING_FINISHREQUEST,
+                        finishRequest);
+  iotjs_jval_set_method(&https, IOTJS_MAGIC_STRING_ABORT, Abort);
+
+  return https;
+}
diff --git a/src/modules/iotjs_module_https.h b/src/modules/iotjs_module_https.h
new file mode 100644 (file)
index 0000000..65f8965
--- /dev/null
@@ -0,0 +1,151 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_MODULE_HTTPS_H
+#define IOTJS_MODULE_HTTPS_H
+
+#include "iotjs_def.h"
+#include <uv.h>
+#include <curl/curl.h>
+
+typedef enum {
+  HTTPS_GET = 0,
+  HTTPS_POST,
+  HTTPS_PUT,
+  HTTPS_DELETE,
+  HTTPS_HEAD,
+  HTTPS_CONNECT,
+  HTTPS_OPTIONS,
+  HTTPS_TRACE
+} HTTPS_Methods;
+
+#define STRING_GET "GET"
+#define STRING_POST "POST"
+#define STRING_PUT "PUT"
+#define STRING_DELETE "DELETE"
+#define STRING_HEAD "HEAD"
+#define STRING_CONNECT "CONNECT"
+#define STRING_OPTIONS "OPTIONS"
+#define STRING_TRACE "TRACE"
+
+// A Per-Request Struct, native bound to https.ClientRequest
+typedef struct {
+  // Original Request Details
+  const char* URL;
+  HTTPS_Methods method;
+  struct curl_slist* header_list;
+  // TLS certs Options
+  const char* ca;
+  const char* cert;
+  const char* key;
+  // Content-Length for Post and Put
+  long content_length;
+
+  // Handles
+  uv_loop_t* loop;
+  iotjs_jval_t jthis_native;
+  CURLM* curl_multi_handle;
+  uv_timer_t timeout;
+  CURL* curl_easy_handle;
+  // Curl Context
+  int running_handles;
+  int closing_handles;
+  bool request_done;
+  struct iotjs_https_poll_t* poll_data;
+
+  // For SetTimeOut
+  uv_timer_t socket_timeout;
+  long timeout_ms;
+  double last_bytes_num;
+  uint64_t last_bytes_time;
+
+  // For Writable Stream ClientRequest
+  size_t cur_read_index;
+  bool is_stream_writable;
+  bool data_to_read;
+  bool stream_ended;
+  bool to_destroy_read_onwrite;
+  iotjs_string_t read_chunk;
+  iotjs_jval_t read_callback;
+  iotjs_jval_t read_onwrite;
+  uv_timer_t async_read_onwrite;
+
+} IOTJS_VALIDATED_STRUCT(iotjs_https_t);
+
+iotjs_https_t* iotjs_https_create(const char* URL, const char* method,
+                                  const char* ca, const char* cert,
+                                  const char* key, const iotjs_jval_t* jthis);
+
+#define THIS iotjs_https_t* https_data
+// Some utility functions
+void iotjs_https_check_done(THIS);
+void iotjs_https_cleanup(THIS);
+CURLM* iotjs_https_get_multi_handle(THIS);
+void iotjs_https_initialize_curl_opts(THIS);
+iotjs_jval_t* iotjs_https_jthis_from_https(THIS);
+bool iotjs_https_jcallback(THIS, const char* property,
+                           const iotjs_jargs_t* jarg, bool resultvalue);
+void iotjs_https_call_read_onwrite(uv_timer_t* timer);
+void iotjs_https_call_read_onwrite_async(THIS);
+
+// Functions almost directly called by JS via JHANDLER
+void iotjs_https_add_header(THIS, const char* char_header);
+void iotjs_https_data_to_write(THIS, iotjs_string_t read_chunk,
+                               const iotjs_jval_t* callback,
+                               const iotjs_jval_t* onwrite);
+void iotjs_https_finish_request(THIS);
+void iotjs_https_send_request(THIS);
+void iotjs_https_set_timeout(long ms, THIS);
+#undef THIS
+
+
+// CURL callbacks
+size_t iotjs_https_curl_read_callback(void* contents, size_t size, size_t nmemb,
+                                      void* userp);
+int iotjs_https_curl_socket_callback(CURL* easy, curl_socket_t sockfd,
+                                     int action, void* userp, void* socketp);
+int iotjs_https_curl_sockopt_callback(void* userp, curl_socket_t curlfd,
+                                      curlsocktype purpose);
+int iotjs_https_curl_start_timeout_callback(CURLM* multi, long timeout_ms,
+                                            void* userp);
+size_t iotjs_https_curl_write_callback(void* contents, size_t size,
+                                       size_t nmemb, void* userp);
+
+// UV Callbacks
+void iotjs_https_uv_close_callback(uv_handle_t* handle);
+void iotjs_https_uv_poll_callback(uv_poll_t* poll, int status, int events);
+void iotjs_https_uv_socket_timeout_callback(uv_timer_t* timer);
+void iotjs_https_uv_timeout_callback(uv_timer_t* timer);
+
+typedef struct {
+  uv_poll_t poll_handle;
+  struct iotjs_https_poll_t* next;
+  struct iotjs_https_t* https_data;
+  curl_socket_t sockfd;
+  bool closing;
+} IOTJS_VALIDATED_STRUCT(iotjs_https_poll_t);
+
+iotjs_https_poll_t* iotjs_https_poll_create(uv_loop_t* loop,
+                                            curl_socket_t sockfd,
+                                            iotjs_https_t* https_data);
+void iotjs_https_poll_append(iotjs_https_poll_t* head,
+                             iotjs_https_poll_t* poll_data);
+iotjs_https_poll_t* iotjs_https_poll_get_next(iotjs_https_poll_t* poll_data);
+uv_poll_t* iotjs_https_poll_get_poll_handle(iotjs_https_poll_t* poll_data);
+void iotjs_https_poll_close(iotjs_https_poll_t* poll_data);
+void iotjs_https_poll_destroy(iotjs_https_poll_t* poll_data);
+void iotjs_https_poll_close_all(iotjs_https_poll_t* head);
+
+#endif /* IOTJS_MODULE_HTTPS_H */
diff --git a/src/modules/iotjs_module_i2c.c b/src/modules/iotjs_module_i2c.c
new file mode 100644 (file)
index 0000000..c247a79
--- /dev/null
@@ -0,0 +1,329 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "iotjs_def.h"
+#include "iotjs_module_i2c.h"
+#include "iotjs_objectwrap.h"
+
+
+#define THIS iotjs_i2c_reqwrap_t* i2c_reqwrap
+
+
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(i2c);
+
+
+iotjs_i2c_reqwrap_t* iotjs_i2c_reqwrap_create(const iotjs_jval_t* jcallback,
+                                              iotjs_i2c_t* i2c, I2cOp op) {
+  iotjs_i2c_reqwrap_t* i2c_reqwrap = IOTJS_ALLOC(iotjs_i2c_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_i2c_reqwrap_t, i2c_reqwrap);
+
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+
+  _this->req_data.op = op;
+#if defined(__linux__) || defined(__APPLE__)
+  _this->req_data.device = iotjs_string_create("");
+#endif
+  _this->i2c_data = i2c;
+  return i2c_reqwrap;
+}
+
+
+static void iotjs_i2c_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_i2c_reqwrap_t, i2c_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+#if defined(__linux__) || defined(__APPLE__)
+  iotjs_string_destroy(&_this->req_data.device);
+#endif
+  IOTJS_RELEASE(i2c_reqwrap);
+}
+
+
+void iotjs_i2c_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_i2c_reqwrap_t, i2c_reqwrap);
+  iotjs_i2c_reqwrap_destroy(i2c_reqwrap);
+}
+
+
+uv_work_t* iotjs_i2c_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_reqwrap_t, i2c_reqwrap);
+  return &_this->req;
+}
+
+
+const iotjs_jval_t* iotjs_i2c_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_reqwrap_t, i2c_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+
+iotjs_i2c_reqwrap_t* iotjs_i2c_reqwrap_from_request(uv_work_t* req) {
+  return (iotjs_i2c_reqwrap_t*)(iotjs_reqwrap_from_request((uv_req_t*)req));
+}
+
+
+iotjs_i2c_reqdata_t* iotjs_i2c_reqwrap_data(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_reqwrap_t, i2c_reqwrap);
+  return &_this->req_data;
+}
+
+
+iotjs_i2c_t* iotjs_i2c_instance_from_reqwrap(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_reqwrap_t, i2c_reqwrap);
+  return _this->i2c_data;
+}
+
+#undef THIS
+
+
+iotjs_i2c_t* iotjs_i2c_create(const iotjs_jval_t* ji2c) {
+  iotjs_i2c_t* i2c = IOTJS_ALLOC(iotjs_i2c_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_i2c_t, i2c);
+
+#if defined(__linux__)
+  _this->device_fd = -1;
+#elif defined(__NUTTX__)
+  _this->i2c_master = NULL;
+#endif
+
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap, ji2c,
+                               &this_module_native_info);
+  return i2c;
+}
+
+
+static void iotjs_i2c_destroy(iotjs_i2c_t* i2c) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_i2c_t, i2c);
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+  IOTJS_RELEASE(i2c);
+}
+
+
+iotjs_i2c_t* iotjs_i2c_instance_from_jval(const iotjs_jval_t* ji2c) {
+  iotjs_jobjectwrap_t* jobjectwrap = iotjs_jobjectwrap_from_jobject(ji2c);
+  return (iotjs_i2c_t*)jobjectwrap;
+}
+
+
+void AfterI2CWork(uv_work_t* work_req, int status) {
+  iotjs_i2c_reqwrap_t* req_wrap = iotjs_i2c_reqwrap_from_request(work_req);
+  iotjs_i2c_reqdata_t* req_data = iotjs_i2c_reqwrap_data(req_wrap);
+
+  iotjs_jargs_t jargs = iotjs_jargs_create(2);
+
+  if (status) {
+    iotjs_jval_t error = iotjs_jval_create_error("System error");
+    iotjs_jargs_append_jval(&jargs, &error);
+    iotjs_jval_destroy(&error);
+  } else {
+    switch (req_data->op) {
+      case kI2cOpOpen: {
+        if (req_data->error == kI2cErrOpen) {
+          iotjs_jval_t error =
+              iotjs_jval_create_error("Failed to open I2C device");
+          iotjs_jargs_append_jval(&jargs, &error);
+          iotjs_jval_destroy(&error);
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      }
+      case kI2cOpWrite: {
+        if (req_data->error == kI2cErrWrite) {
+          iotjs_jval_t error =
+              iotjs_jval_create_error("Cannot write to device");
+          iotjs_jargs_append_jval(&jargs, &error);
+          iotjs_jval_destroy(&error);
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      }
+      case kI2cOpRead: {
+        if (req_data->error == kI2cErrRead) {
+          iotjs_jval_t error =
+              iotjs_jval_create_error("Cannot read from device");
+          iotjs_jargs_append_jval(&jargs, &error);
+          iotjs_jargs_append_null(&jargs);
+          iotjs_jval_destroy(&error);
+        } else {
+          iotjs_jargs_append_null(&jargs);
+          iotjs_jval_t result =
+              iotjs_jval_create_byte_array(req_data->buf_len,
+                                           req_data->buf_data);
+          iotjs_jargs_append_jval(&jargs, &result);
+          iotjs_jval_destroy(&result);
+
+          if (req_data->delay > 0) {
+            uv_sleep(req_data->delay);
+          }
+
+          if (req_data->buf_data != NULL) {
+            iotjs_buffer_release(req_data->buf_data);
+          }
+        }
+        break;
+      }
+      default: {
+        IOTJS_ASSERT(!"Unreachable");
+        break;
+      }
+    }
+  }
+
+  const iotjs_jval_t* jcallback = iotjs_i2c_reqwrap_jcallback(req_wrap);
+  iotjs_make_callback(jcallback, iotjs_jval_get_undefined(), &jargs);
+
+  iotjs_jargs_destroy(&jargs);
+  iotjs_i2c_reqwrap_dispatched(req_wrap);
+}
+
+
+static void GetI2cArray(const iotjs_jval_t* jarray,
+                        iotjs_i2c_reqdata_t* req_data) {
+  // FIXME
+  // Need to implement a function to get array info from iotjs_jval_t Array.
+  iotjs_jval_t jlength =
+      iotjs_jval_get_property(jarray, IOTJS_MAGIC_STRING_LENGTH);
+  IOTJS_ASSERT(!iotjs_jval_is_undefined(&jlength));
+
+  req_data->buf_len = iotjs_jval_as_number(&jlength);
+  req_data->buf_data = iotjs_buffer_allocate(req_data->buf_len);
+
+  for (uint8_t i = 0; i < req_data->buf_len; i++) {
+    iotjs_jval_t jdata = iotjs_jval_get_property_by_index(jarray, i);
+    req_data->buf_data[i] = iotjs_jval_as_number(&jdata);
+    iotjs_jval_destroy(&jdata);
+  }
+
+  iotjs_jval_destroy(&jlength);
+}
+
+
+#define I2C_ASYNC(op)                                                  \
+  do {                                                                 \
+    uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get()); \
+    uv_work_t* req = iotjs_i2c_reqwrap_req(req_wrap);                  \
+    uv_queue_work(loop, req, op##Worker, AfterI2CWork);                \
+  } while (0)
+
+
+JHANDLER_FUNCTION(I2cCons) {
+  DJHANDLER_CHECK_THIS(object);
+#if defined(__linux__) || defined(__APPLE__)
+  DJHANDLER_CHECK_ARGS(2, string, function);
+  iotjs_string_t device = JHANDLER_GET_ARG(0, string);
+#elif defined(__NUTTX__)
+  DJHANDLER_CHECK_ARGS(2, number, function);
+  int device = JHANDLER_GET_ARG(0, number);
+#endif
+
+  // Create I2C object
+  const iotjs_jval_t* ji2c = JHANDLER_GET_THIS(object);
+  iotjs_i2c_t* i2c = iotjs_i2c_create(ji2c);
+  IOTJS_ASSERT(i2c ==
+               (iotjs_i2c_t*)(iotjs_jval_get_object_native_handle(ji2c)));
+
+  // Create I2C request wrap
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(1, function);
+  iotjs_i2c_reqwrap_t* req_wrap =
+      iotjs_i2c_reqwrap_create(jcallback, i2c, kI2cOpOpen);
+
+  iotjs_i2c_reqdata_t* req_data = iotjs_i2c_reqwrap_data(req_wrap);
+#if defined(__linux__) || defined(__APPLE__)
+  iotjs_string_append(&req_data->device, iotjs_string_data(&device),
+                      iotjs_string_size(&device));
+#elif defined(__NUTTX__)
+  req_data->device = device;
+#endif
+
+  I2C_ASYNC(Open);
+}
+
+
+JHANDLER_FUNCTION(SetAddress) {
+  JHANDLER_DECLARE_THIS_PTR(i2c, i2c);
+  DJHANDLER_CHECK_ARGS(1, number);
+
+  I2cSetAddress(i2c, JHANDLER_GET_ARG(0, number));
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+JHANDLER_FUNCTION(Close) {
+  JHANDLER_DECLARE_THIS_PTR(i2c, i2c);
+  DJHANDLER_CHECK_ARGS(0);
+
+  I2cClose(i2c);
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+JHANDLER_FUNCTION(Write) {
+  JHANDLER_DECLARE_THIS_PTR(i2c, i2c);
+  DJHANDLER_CHECK_ARGS(2, array, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(1, function);
+
+  iotjs_i2c_reqwrap_t* req_wrap =
+      iotjs_i2c_reqwrap_create(jcallback, i2c, kI2cOpWrite);
+  iotjs_i2c_reqdata_t* req_data = iotjs_i2c_reqwrap_data(req_wrap);
+
+  GetI2cArray(JHANDLER_GET_ARG(0, array), req_data);
+
+  I2C_ASYNC(Write);
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+JHANDLER_FUNCTION(Read) {
+  JHANDLER_DECLARE_THIS_PTR(i2c, i2c);
+  DJHANDLER_CHECK_ARGS(2, number, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(1, function);
+
+  iotjs_i2c_reqwrap_t* req_wrap =
+      iotjs_i2c_reqwrap_create(jcallback, i2c, kI2cOpRead);
+
+  iotjs_i2c_reqdata_t* req_data = iotjs_i2c_reqwrap_data(req_wrap);
+  req_data->buf_len = JHANDLER_GET_ARG(0, number);
+  req_data->delay = 0;
+
+  I2C_ASYNC(Read);
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+iotjs_jval_t InitI2c() {
+  iotjs_jval_t jI2cCons = iotjs_jval_create_function_with_dispatch(I2cCons);
+
+  iotjs_jval_t prototype = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_SETADDRESS, SetAddress);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_CLOSE, Close);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_WRITE, Write);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_READ, Read);
+
+  iotjs_jval_set_property_jval(&jI2cCons, IOTJS_MAGIC_STRING_PROTOTYPE,
+                               &prototype);
+
+  iotjs_jval_destroy(&prototype);
+
+  return jI2cCons;
+}
diff --git a/src/modules/iotjs_module_i2c.h b/src/modules/iotjs_module_i2c.h
new file mode 100644 (file)
index 0000000..6cba4e9
--- /dev/null
@@ -0,0 +1,104 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_I2C_H
+#define IOTJS_MODULE_I2C_H
+
+#include "iotjs_def.h"
+#include "iotjs_objectwrap.h"
+#include "iotjs_reqwrap.h"
+
+#if defined(__NUTTX__)
+#include <nuttx/i2c/i2c_master.h>
+#endif
+
+typedef enum {
+  kI2cOpSetAddress,
+  kI2cOpOpen,
+  kI2cOpClose,
+  kI2cOpWrite,
+  kI2cOpRead,
+} I2cOp;
+
+typedef enum {
+  kI2cErrOk = 0,
+  kI2cErrOpen = -1,
+  kI2cErrRead = -2,
+  kI2cErrWrite = -3,
+} I2cError;
+
+
+typedef struct {
+#if defined(__linux__) || defined(__APPLE__)
+  iotjs_string_t device;
+#elif defined(__NUTTX__)
+  int device;
+#endif
+  char* buf_data;
+  uint8_t buf_len;
+  uint8_t byte;
+  uint8_t cmd;
+  int32_t delay;
+
+  I2cOp op;
+  I2cError error;
+} iotjs_i2c_reqdata_t;
+
+
+// This I2c class provides interfaces for I2C operation.
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+#if defined(__linux__)
+  int device_fd;
+  uint8_t addr;
+#elif defined(__NUTTX__)
+  struct i2c_master_s* i2c_master;
+  struct i2c_config_s config;
+#endif
+} IOTJS_VALIDATED_STRUCT(iotjs_i2c_t);
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_work_t req;
+  iotjs_i2c_reqdata_t req_data;
+  iotjs_i2c_t* i2c_data;
+} IOTJS_VALIDATED_STRUCT(iotjs_i2c_reqwrap_t);
+
+
+iotjs_i2c_t* iotjs_i2c_create(const iotjs_jval_t* ji2c);
+iotjs_i2c_t* iotjs_i2c_instance_from_jval(const iotjs_jval_t* ji2c);
+
+#define THIS iotjs_i2c_reqwrap_t* i2c_reqwrap
+iotjs_i2c_reqwrap_t* iotjs_i2c_reqwrap_create(const iotjs_jval_t* jcallback,
+                                              iotjs_i2c_t* i2c, I2cOp op);
+void iotjs_i2c_reqwrap_dispatched(THIS);
+uv_work_t* iotjs_i2c_reqwrap_req(THIS);
+const iotjs_jval_t* iotjs_i2c_reqwrap_jcallback(THIS);
+iotjs_i2c_reqwrap_t* iotjs_i2c_reqwrap_from_request(uv_work_t* req);
+iotjs_i2c_reqdata_t* iotjs_i2c_reqwrap_data(THIS);
+iotjs_i2c_t* iotjs_i2c_instance_from_reqwrap(THIS);
+#undef THIS
+
+
+void I2cSetAddress(iotjs_i2c_t* i2c, uint8_t address);
+void OpenWorker(uv_work_t* work_req);
+void I2cClose(iotjs_i2c_t* i2c);
+void WriteWorker(uv_work_t* work_req);
+void ReadWorker(uv_work_t* work_req);
+
+
+#endif /* IOTJS_MODULE_I2C_H */
diff --git a/src/modules/iotjs_module_process.c b/src/modules/iotjs_module_process.c
new file mode 100644 (file)
index 0000000..9e23cb2
--- /dev/null
@@ -0,0 +1,310 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_js.h"
+#include "jerryscript-debugger.h"
+
+#include <stdlib.h>
+
+
+JHANDLER_FUNCTION(Binding) {
+  JHANDLER_CHECK_ARGS(1, number);
+
+  ModuleKind module_kind = (ModuleKind)JHANDLER_GET_ARG(0, number);
+
+  const iotjs_jval_t* jmodule =
+      iotjs_module_initialize_if_necessary(module_kind);
+
+  iotjs_jhandler_return_jval(jhandler, jmodule);
+}
+
+
+static iotjs_jval_t WrapEval(const char* name, size_t name_len,
+                             const char* source, size_t length, bool* throws) {
+  static const char* wrapper[2] = { "(function(exports, require, module) {",
+                                    "\n});\n" };
+
+  size_t len0 = strlen(wrapper[0]);
+  size_t len1 = strlen(wrapper[1]);
+
+  size_t buffer_length = len0 + len1 + length;
+  char* buffer = iotjs_buffer_allocate(buffer_length);
+  memcpy(buffer, wrapper[0], len0);
+  memcpy(buffer + len0, source, length);
+  memcpy(buffer + len0 + length, wrapper[1], len1);
+
+  iotjs_jval_t res = iotjs_jhelper_eval(name, name_len, (uint8_t*)buffer,
+                                        buffer_length, false, throws);
+
+  iotjs_buffer_release(buffer);
+
+  return res;
+}
+
+
+JHANDLER_FUNCTION(Compile) {
+  JHANDLER_CHECK_ARGS(2, string, string);
+
+  iotjs_string_t file = JHANDLER_GET_ARG(0, string);
+  iotjs_string_t source = JHANDLER_GET_ARG(1, string);
+
+  const char* filename = iotjs_string_data(&file);
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  if (iotjs_environment_config(env)->debugger) {
+    jerry_debugger_stop();
+  }
+
+  bool throws;
+  iotjs_jval_t jres =
+      WrapEval(filename, strlen(filename), iotjs_string_data(&source),
+               iotjs_string_size(&source), &throws);
+
+  if (!throws) {
+    iotjs_jhandler_return_jval(jhandler, &jres);
+  } else {
+    iotjs_jhandler_throw(jhandler, &jres);
+  }
+
+  iotjs_string_destroy(&file);
+  iotjs_string_destroy(&source);
+  iotjs_jval_destroy(&jres);
+}
+
+
+JHANDLER_FUNCTION(CompileNativePtr) {
+  JHANDLER_CHECK_ARGS(1, string);
+
+  iotjs_string_t id = JHANDLER_GET_ARG(0, string);
+  const char* name = iotjs_string_data(&id);
+
+  int i = 0;
+  while (natives[i].name != NULL) {
+    if (!strcmp(natives[i].name, name)) {
+      break;
+    }
+
+    i++;
+  }
+
+  if (natives[i].name != NULL) {
+    bool throws;
+#ifdef ENABLE_SNAPSHOT
+    iotjs_jval_t jres = iotjs_jhelper_exec_snapshot(natives[i].code,
+                                                    natives[i].length, &throws);
+#else
+    iotjs_jval_t jres =
+        WrapEval(name, iotjs_string_size(&id), (const char*)natives[i].code,
+                 natives[i].length, &throws);
+#endif
+
+    if (!throws) {
+      iotjs_jhandler_return_jval(jhandler, &jres);
+    } else {
+      iotjs_jhandler_throw(jhandler, &jres);
+    }
+    iotjs_jval_destroy(&jres);
+  } else {
+    iotjs_jval_t jerror = iotjs_jval_create_error("Unknown native module");
+    iotjs_jhandler_throw(jhandler, &jerror);
+    iotjs_jval_destroy(&jerror);
+  }
+
+  iotjs_string_destroy(&id);
+}
+
+
+JHANDLER_FUNCTION(ReadSource) {
+  JHANDLER_CHECK_ARGS(1, string);
+
+  iotjs_string_t path = JHANDLER_GET_ARG(0, string);
+  iotjs_string_t code = iotjs_file_read(iotjs_string_data(&path));
+
+  iotjs_jhandler_return_string(jhandler, &code);
+
+  iotjs_string_destroy(&path);
+  iotjs_string_destroy(&code);
+}
+
+
+JHANDLER_FUNCTION(Cwd) {
+  JHANDLER_CHECK_ARGS(0);
+
+  char path[IOTJS_MAX_PATH_SIZE];
+  size_t size_path = sizeof(path);
+  int err = uv_cwd(path, &size_path);
+  if (err) {
+    JHANDLER_THROW(COMMON, "cwd error");
+    return;
+  }
+  iotjs_jhandler_return_string_raw(jhandler, path);
+}
+
+JHANDLER_FUNCTION(Chdir) {
+  JHANDLER_CHECK_ARGS(1, string);
+
+  iotjs_string_t path = JHANDLER_GET_ARG(0, string);
+  int err = uv_chdir(iotjs_string_data(&path));
+
+  if (err) {
+    iotjs_string_destroy(&path);
+    JHANDLER_THROW(COMMON, "chdir error");
+    return;
+  }
+
+  iotjs_string_destroy(&path);
+}
+
+
+JHANDLER_FUNCTION(DoExit) {
+  JHANDLER_CHECK_ARGS(1, number);
+
+  // Release builtin modules.
+  iotjs_module_list_cleanup();
+
+  // Release commonly used jerry values.
+  iotjs_binding_finalize();
+
+  int exit_code = JHANDLER_GET_ARG(0, number);
+  exit(exit_code);
+}
+
+
+void SetNativeSources(iotjs_jval_t* native_sources) {
+  for (int i = 0; natives[i].name; i++) {
+    iotjs_jval_set_property_jval(native_sources, natives[i].name,
+                                 iotjs_jval_get_boolean(true));
+  }
+}
+
+
+static void SetProcessEnv(iotjs_jval_t* process) {
+  const char *homedir, *iotjspath, *iotjsenv;
+
+  homedir = getenv("HOME");
+  if (homedir == NULL) {
+    homedir = "";
+  }
+
+  iotjspath = getenv("IOTJS_PATH");
+  if (iotjspath == NULL) {
+#if defined(__NUTTX__) || defined(__TIZENRT__)
+    iotjspath = "/mnt/sdcard";
+#else
+    iotjspath = "";
+#endif
+  }
+
+#if defined(EXPERIMENTAL)
+  iotjsenv = "experimental";
+#else
+  iotjsenv = "";
+#endif
+
+  iotjs_jval_t env = iotjs_jval_create_object();
+  iotjs_jval_set_property_string_raw(&env, IOTJS_MAGIC_STRING_HOME, homedir);
+  iotjs_jval_set_property_string_raw(&env, IOTJS_MAGIC_STRING_IOTJS_PATH,
+                                     iotjspath);
+  iotjs_jval_set_property_string_raw(&env, IOTJS_MAGIC_STRING_IOTJS_ENV,
+                                     iotjsenv);
+
+  iotjs_jval_set_property_jval(process, IOTJS_MAGIC_STRING_ENV, &env);
+
+  iotjs_jval_destroy(&env);
+}
+
+
+static void SetProcessIotjs(iotjs_jval_t* process) {
+  // IoT.js specific
+  iotjs_jval_t iotjs = iotjs_jval_create_object();
+  iotjs_jval_set_property_jval(process, IOTJS_MAGIC_STRING_IOTJS, &iotjs);
+
+  iotjs_jval_set_property_string_raw(&iotjs, IOTJS_MAGIC_STRING_BOARD,
+                                     TOSTRING(TARGET_BOARD));
+  iotjs_jval_destroy(&iotjs);
+}
+
+
+static void SetProcessArgv(iotjs_jval_t* process) {
+  const iotjs_environment_t* env = iotjs_environment_get();
+  uint32_t argc = iotjs_environment_argc(env);
+
+  iotjs_jval_t argv = iotjs_jval_create_array(argc);
+
+  for (uint32_t i = 0; i < argc; ++i) {
+    const char* argvi = iotjs_environment_argv(env, i);
+    iotjs_jval_t arg = iotjs_jval_create_string_raw(argvi);
+    iotjs_jval_set_property_by_index(&argv, i, &arg);
+    iotjs_jval_destroy(&arg);
+  }
+  iotjs_jval_set_property_jval(process, IOTJS_MAGIC_STRING_ARGV, &argv);
+
+  iotjs_jval_destroy(&argv);
+}
+
+
+iotjs_jval_t InitProcess() {
+  iotjs_jval_t process = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&process, IOTJS_MAGIC_STRING_BINDING, Binding);
+  iotjs_jval_set_method(&process, IOTJS_MAGIC_STRING_COMPILE, Compile);
+  iotjs_jval_set_method(&process, IOTJS_MAGIC_STRING_COMPILENATIVEPTR,
+                        CompileNativePtr);
+  iotjs_jval_set_method(&process, IOTJS_MAGIC_STRING_READSOURCE, ReadSource);
+  iotjs_jval_set_method(&process, IOTJS_MAGIC_STRING_CWD, Cwd);
+  iotjs_jval_set_method(&process, IOTJS_MAGIC_STRING_CHDIR, Chdir);
+  iotjs_jval_set_method(&process, IOTJS_MAGIC_STRING_DOEXIT, DoExit);
+  SetProcessEnv(&process);
+
+  // process.native_sources
+  iotjs_jval_t native_sources = iotjs_jval_create_object();
+  SetNativeSources(&native_sources);
+  iotjs_jval_set_property_jval(&process, IOTJS_MAGIC_STRING_NATIVE_SOURCES,
+                               &native_sources);
+  iotjs_jval_destroy(&native_sources);
+
+  // process.platform
+  iotjs_jval_set_property_string_raw(&process, IOTJS_MAGIC_STRING_PLATFORM,
+                                     TARGET_OS);
+
+  // process.arch
+  iotjs_jval_set_property_string_raw(&process, IOTJS_MAGIC_STRING_ARCH,
+                                     TARGET_ARCH);
+
+  // process.version
+  iotjs_jval_set_property_string_raw(&process, IOTJS_MAGIC_STRING_VERSION,
+                                     IOTJS_VERSION);
+
+  // Set iotjs
+  SetProcessIotjs(&process);
+
+  SetProcessArgv(&process);
+
+  // Binding module id.
+  iotjs_jval_t jbinding =
+      iotjs_jval_get_property(&process, IOTJS_MAGIC_STRING_BINDING);
+
+#define ENUMDEF_MODULE_LIST(upper, Camel, lower) \
+  iotjs_jval_set_property_number(&jbinding, #lower, MODULE_##upper);
+
+  MAP_MODULE_LIST(ENUMDEF_MODULE_LIST)
+
+#undef ENUMDEF_MODULE_LIST
+
+  iotjs_jval_destroy(&jbinding);
+
+  return process;
+}
diff --git a/src/modules/iotjs_module_pwm.c b/src/modules/iotjs_module_pwm.c
new file mode 100644 (file)
index 0000000..7ef6f8a
--- /dev/null
@@ -0,0 +1,376 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_module_pwm.h"
+#include "iotjs_objectwrap.h"
+
+static iotjs_pwm_t* iotjs_pwm_instance_from_jval(const iotjs_jval_t* jpwm);
+
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(pwm);
+
+
+static iotjs_pwm_t* iotjs_pwm_create(const iotjs_jval_t* jpwm) {
+  iotjs_pwm_t* pwm = IOTJS_ALLOC(iotjs_pwm_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_pwm_t, pwm);
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap, jpwm,
+                               &this_module_native_info);
+
+  _this->period = -1;
+  _this->duty_cycle = 0;
+#if defined(__NUTTX__)
+  _this->device_fd = -1;
+#endif
+  return pwm;
+}
+
+
+static void iotjs_pwm_destroy(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_pwm_t, pwm);
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+#if defined(__linux__)
+  iotjs_string_destroy(&_this->device);
+#endif
+  IOTJS_RELEASE(pwm);
+}
+
+
+#define THIS iotjs_pwm_reqwrap_t* pwm_reqwrap
+
+
+static iotjs_pwm_reqwrap_t* iotjs_pwm_reqwrap_create(
+    const iotjs_jval_t* jcallback, iotjs_pwm_t* pwm, PwmOp op) {
+  iotjs_pwm_reqwrap_t* pwm_reqwrap = IOTJS_ALLOC(iotjs_pwm_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_pwm_reqwrap_t, pwm_reqwrap);
+
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+
+  _this->req_data.op = op;
+  _this->pwm_instance = pwm;
+  _this->req_data.caller = NULL;
+
+  return pwm_reqwrap;
+}
+
+
+static void iotjs_pwm_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_pwm_reqwrap_t, pwm_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(pwm_reqwrap);
+}
+
+
+static void iotjs_pwm_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_pwm_reqwrap_t, pwm_reqwrap);
+  iotjs_pwm_reqwrap_destroy(pwm_reqwrap);
+}
+
+
+static uv_work_t* iotjs_pwm_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_reqwrap_t, pwm_reqwrap);
+  return &_this->req;
+}
+
+
+static const iotjs_jval_t* iotjs_pwm_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_reqwrap_t, pwm_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+
+static iotjs_pwm_t* iotjs_pwm_instance_from_jval(const iotjs_jval_t* jpwm) {
+  uintptr_t handle = iotjs_jval_get_object_native_handle(jpwm);
+  return (iotjs_pwm_t*)handle;
+}
+
+
+iotjs_pwm_reqwrap_t* iotjs_pwm_reqwrap_from_request(uv_work_t* req) {
+  return (iotjs_pwm_reqwrap_t*)(iotjs_reqwrap_from_request((uv_req_t*)req));
+}
+
+
+iotjs_pwm_reqdata_t* iotjs_pwm_reqwrap_data(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_reqwrap_t, pwm_reqwrap);
+  return &_this->req_data;
+}
+
+
+iotjs_pwm_t* iotjs_pwm_instance_from_reqwrap(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_reqwrap_t, pwm_reqwrap);
+  return _this->pwm_instance;
+}
+
+
+static void iotjs_pwm_set_configuration(const iotjs_jval_t* jconfiguration,
+                                        iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  iotjs_jval_t jpin =
+      iotjs_jval_get_property(jconfiguration, IOTJS_MAGIC_STRING_PIN);
+  _this->pin = iotjs_jval_as_number(&jpin);
+
+#if defined(__linux__)
+  iotjs_jval_t jchip =
+      iotjs_jval_get_property(jconfiguration, IOTJS_MAGIC_STRING_CHIP);
+  _this->chip = iotjs_jval_as_number(&jchip);
+  iotjs_jval_destroy(&jchip);
+#endif
+
+  iotjs_jval_t jperiod =
+      iotjs_jval_get_property(jconfiguration, IOTJS_MAGIC_STRING_PERIOD);
+  if (iotjs_jval_is_number(&jperiod))
+    _this->period = iotjs_jval_as_number(&jperiod);
+
+  iotjs_jval_t jduty_cycle =
+      iotjs_jval_get_property(jconfiguration, IOTJS_MAGIC_STRING_DUTYCYCLE);
+  if (iotjs_jval_is_number(&jduty_cycle))
+    _this->duty_cycle = iotjs_jval_as_number(&jduty_cycle);
+
+  iotjs_jval_destroy(&jpin);
+  iotjs_jval_destroy(&jperiod);
+  iotjs_jval_destroy(&jduty_cycle);
+}
+
+#undef THIS
+
+
+static void iotjs_pwm_common_worker(uv_work_t* work_req) {
+  PWM_WORKER_INIT;
+
+  IOTJS_ASSERT(req_data->caller != NULL);
+
+  if (!req_data->caller(pwm)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+static void iotjs_pwm_after_worker(uv_work_t* work_req, int status) {
+  iotjs_pwm_reqwrap_t* req_wrap = iotjs_pwm_reqwrap_from_request(work_req);
+  iotjs_pwm_reqdata_t* req_data = iotjs_pwm_reqwrap_data(req_wrap);
+  iotjs_jargs_t jargs = iotjs_jargs_create(1);
+  bool result = req_data->result;
+
+  if (status) {
+    iotjs_jval_t error = iotjs_jval_create_error("System error");
+    iotjs_jargs_append_jval(&jargs, &error);
+    iotjs_jval_destroy(&error);
+  } else {
+    switch (req_data->op) {
+      case kPwmOpOpen:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Failed to open PWM device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      case kPwmOpSetDutyCycle:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Failed to set duty-cycle");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      case kPwmOpSetPeriod:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Failed to set period");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      case kPwmOpSetEnable:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Failed to set enable");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      case kPwmOpClose:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Cannot close PWM device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      default: {
+        IOTJS_ASSERT(!"Unreachable");
+        break;
+      }
+    }
+  }
+
+  const iotjs_jval_t* jcallback = iotjs_pwm_reqwrap_jcallback(req_wrap);
+  iotjs_make_callback(jcallback, iotjs_jval_get_undefined(), &jargs);
+
+  iotjs_jargs_destroy(&jargs);
+
+  iotjs_pwm_reqwrap_dispatched(req_wrap);
+}
+
+
+#define PWM_ASYNC(call, this, jcallback, op)                           \
+  do {                                                                 \
+    uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get()); \
+    iotjs_pwm_reqwrap_t* req_wrap =                                    \
+        iotjs_pwm_reqwrap_create(jcallback, this, op);                 \
+    uv_work_t* req = iotjs_pwm_reqwrap_req(req_wrap);                  \
+    uv_queue_work(loop, req, iotjs_pwm_##call##_worker,                \
+                  iotjs_pwm_after_worker);                             \
+  } while (0)
+
+
+#define PWM_ASYNC_COMMON_WORKER(call, this, jcallback, op)                     \
+  do {                                                                         \
+    uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get());         \
+    iotjs_pwm_reqwrap_t* req_wrap =                                            \
+        iotjs_pwm_reqwrap_create(jcallback, this, op);                         \
+    uv_work_t* req = iotjs_pwm_reqwrap_req(req_wrap);                          \
+    iotjs_pwm_reqdata_t* req_data = iotjs_pwm_reqwrap_data(req_wrap);          \
+    req_data->caller = call;                                                   \
+    uv_queue_work(loop, req, iotjs_pwm_common_worker, iotjs_pwm_after_worker); \
+  } while (0)
+
+
+JHANDLER_FUNCTION(PWMConstructor) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(2, object, function);
+
+  // Create PWM object
+  const iotjs_jval_t* jpwm = JHANDLER_GET_THIS(object);
+  iotjs_pwm_t* pwm = iotjs_pwm_create(jpwm);
+  IOTJS_ASSERT(pwm == iotjs_pwm_instance_from_jval(jpwm));
+
+  const iotjs_jval_t* jconfiguration = JHANDLER_GET_ARG(0, object);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(1, function);
+
+  // Set configuration
+  iotjs_pwm_set_configuration(jconfiguration, pwm);
+
+  PWM_ASYNC(open, pwm, jcallback, kPwmOpOpen);
+}
+
+
+JHANDLER_FUNCTION(SetPeriod) {
+  JHANDLER_DECLARE_THIS_PTR(pwm, pwm);
+
+  DJHANDLER_CHECK_ARGS(1, number);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+  _this->period = JHANDLER_GET_ARG(0, number);
+
+  if (jcallback) {
+    PWM_ASYNC_COMMON_WORKER(iotjs_pwm_set_period, pwm, jcallback,
+                            kPwmOpSetPeriod);
+  } else {
+    if (!iotjs_pwm_set_period(pwm)) {
+      JHANDLER_THROW(COMMON, "PWM SetPeriod Error");
+    }
+  }
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+JHANDLER_FUNCTION(SetDutyCycle) {
+  JHANDLER_DECLARE_THIS_PTR(pwm, pwm);
+
+  DJHANDLER_CHECK_ARGS(1, number);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+  _this->duty_cycle = JHANDLER_GET_ARG(0, number);
+
+  if (jcallback) {
+    PWM_ASYNC_COMMON_WORKER(iotjs_pwm_set_dutycycle, pwm, jcallback,
+                            kPwmOpSetDutyCycle);
+  } else {
+    if (!iotjs_pwm_set_dutycycle(pwm)) {
+      JHANDLER_THROW(COMMON, "PWM SetDutyCycle Error");
+    }
+  }
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+JHANDLER_FUNCTION(SetEnable) {
+  JHANDLER_DECLARE_THIS_PTR(pwm, pwm);
+
+  DJHANDLER_CHECK_ARGS(1, boolean);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+  _this->enable = JHANDLER_GET_ARG(0, boolean);
+
+  if (jcallback) {
+    PWM_ASYNC_COMMON_WORKER(iotjs_pwm_set_enable, pwm, jcallback,
+                            kPwmOpSetEnable);
+  } else {
+    if (!iotjs_pwm_set_enable(pwm)) {
+      JHANDLER_THROW(COMMON, "PWM SetEnabe Error");
+    }
+  }
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+JHANDLER_FUNCTION(Close) {
+  JHANDLER_DECLARE_THIS_PTR(pwm, pwm);
+  DJHANDLER_CHECK_ARG_IF_EXIST(0, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(0, function);
+
+  if (jcallback) {
+    PWM_ASYNC_COMMON_WORKER(iotjs_pwm_close, pwm, jcallback, kPwmOpClose);
+  } else {
+    if (!iotjs_pwm_close(pwm)) {
+      JHANDLER_THROW(COMMON, "PWM Close Error");
+    }
+  }
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+iotjs_jval_t InitPwm() {
+  iotjs_jval_t jpwm_constructor =
+      iotjs_jval_create_function_with_dispatch(PWMConstructor);
+
+  iotjs_jval_t jprototype = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&jprototype, IOTJS_MAGIC_STRING_SETPERIOD, SetPeriod);
+  iotjs_jval_set_method(&jprototype, IOTJS_MAGIC_STRING_SETDUTYCYCLE,
+                        SetDutyCycle);
+  iotjs_jval_set_method(&jprototype, IOTJS_MAGIC_STRING_SETENABLE, SetEnable);
+  iotjs_jval_set_method(&jprototype, IOTJS_MAGIC_STRING_CLOSE, Close);
+
+  iotjs_jval_set_property_jval(&jpwm_constructor, IOTJS_MAGIC_STRING_PROTOTYPE,
+                               &jprototype);
+
+  iotjs_jval_destroy(&jprototype);
+
+  return jpwm_constructor;
+}
diff --git a/src/modules/iotjs_module_pwm.h b/src/modules/iotjs_module_pwm.h
new file mode 100644 (file)
index 0000000..8bc0c3b
--- /dev/null
@@ -0,0 +1,100 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_PWM_H
+#define IOTJS_MODULE_PWM_H
+
+#include "iotjs_def.h"
+#include "iotjs_objectwrap.h"
+#include "iotjs_reqwrap.h"
+
+#if defined(__TIZENRT__)
+#include <iotbus_pwm.h>
+#include <stdint.h>
+#endif
+
+
+typedef enum {
+  kPwmOpOpen,
+  kPwmOpSetDutyCycle,
+  kPwmOpSetPeriod,
+  kPwmOpSetFrequency,
+  kPwmOpSetEnable,
+  kPwmOpClose,
+} PwmOp;
+
+
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+
+#if defined(__linux__)
+  int chip;
+  iotjs_string_t device;
+#elif defined(__NUTTX__)
+  int device_fd;
+#elif defined(__TIZENRT__)
+  iotbus_pwm_context_h ctx;
+#endif
+  uint32_t pin;
+  double duty_cycle;
+  double period;
+  bool enable;
+} IOTJS_VALIDATED_STRUCT(iotjs_pwm_t);
+
+
+typedef bool (*pwm_func_ptr)(iotjs_pwm_t*);
+
+
+typedef struct {
+  pwm_func_ptr caller;
+  bool result;
+  PwmOp op;
+} iotjs_pwm_reqdata_t;
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_work_t req;
+  iotjs_pwm_reqdata_t req_data;
+  iotjs_pwm_t* pwm_instance;
+} IOTJS_VALIDATED_STRUCT(iotjs_pwm_reqwrap_t);
+
+
+#define THIS iotjs_pwm_reqwrap_t* pwm_reqwrap
+
+iotjs_pwm_reqwrap_t* iotjs_pwm_reqwrap_from_request(uv_work_t* req);
+iotjs_pwm_reqdata_t* iotjs_pwm_reqwrap_data(THIS);
+
+iotjs_pwm_t* iotjs_pwm_instance_from_reqwrap(THIS);
+
+#undef THIS
+
+
+#define PWM_WORKER_INIT                                                     \
+  iotjs_pwm_reqwrap_t* req_wrap = iotjs_pwm_reqwrap_from_request(work_req); \
+  iotjs_pwm_reqdata_t* req_data = iotjs_pwm_reqwrap_data(req_wrap);         \
+  iotjs_pwm_t* pwm = iotjs_pwm_instance_from_reqwrap(req_wrap);
+
+
+void iotjs_pwm_open_worker(uv_work_t* work_req);
+
+bool iotjs_pwm_set_period(iotjs_pwm_t* pwm);
+bool iotjs_pwm_set_dutycycle(iotjs_pwm_t* pwm);
+bool iotjs_pwm_set_enable(iotjs_pwm_t* pwm);
+bool iotjs_pwm_close(iotjs_pwm_t* pwm);
+
+
+#endif /* IOTJS_MODULE_PWM_H */
diff --git a/src/modules/iotjs_module_spi.c b/src/modules/iotjs_module_spi.c
new file mode 100644 (file)
index 0000000..0cd6c71
--- /dev/null
@@ -0,0 +1,468 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_module_spi.h"
+#include "iotjs_module_buffer.h"
+#include "iotjs_objectwrap.h"
+#include <unistd.h>
+
+
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(spi);
+
+static iotjs_spi_t* iotjs_spi_create(const iotjs_jval_t* jspi) {
+  iotjs_spi_t* spi = IOTJS_ALLOC(iotjs_spi_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_spi_t, spi);
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap, jspi,
+                               &this_module_native_info);
+
+#if defined(__linux__)
+  _this->device = iotjs_string_create("");
+#endif
+
+  return spi;
+}
+
+
+static void iotjs_spi_destroy(iotjs_spi_t* spi) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_spi_t, spi);
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+
+#if defined(__linux__)
+  iotjs_string_destroy(&_this->device);
+#endif
+
+  IOTJS_RELEASE(spi);
+}
+
+
+#define THIS iotjs_spi_reqwrap_t* spi_reqwrap
+
+
+static iotjs_spi_reqwrap_t* iotjs_spi_reqwrap_create(
+    const iotjs_jval_t* jcallback, iotjs_spi_t* spi, SpiOp op) {
+  iotjs_spi_reqwrap_t* spi_reqwrap = IOTJS_ALLOC(iotjs_spi_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_spi_reqwrap_t, spi_reqwrap);
+
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+
+  _this->req_data.op = op;
+  _this->spi_instance = spi;
+
+  return spi_reqwrap;
+}
+
+
+static void iotjs_spi_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_spi_reqwrap_t, spi_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(spi_reqwrap);
+}
+
+
+static void iotjs_spi_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_spi_reqwrap_t, spi_reqwrap);
+  iotjs_spi_reqwrap_destroy(spi_reqwrap);
+}
+
+
+static uv_work_t* iotjs_spi_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_reqwrap_t, spi_reqwrap);
+  return &_this->req;
+}
+
+
+static const iotjs_jval_t* iotjs_spi_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_reqwrap_t, spi_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+
+iotjs_spi_reqwrap_t* iotjs_spi_reqwrap_from_request(uv_work_t* req) {
+  return (iotjs_spi_reqwrap_t*)(iotjs_reqwrap_from_request((uv_req_t*)req));
+}
+
+
+iotjs_spi_reqdata_t* iotjs_spi_reqwrap_data(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_reqwrap_t, spi_reqwrap);
+  return &_this->req_data;
+}
+
+
+iotjs_spi_t* iotjs_spi_instance_from_reqwrap(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_reqwrap_t, spi_reqwrap);
+  return _this->spi_instance;
+}
+
+
+#undef THIS
+
+
+static int iotjs_spi_get_array_data(char** buf, const iotjs_jval_t* jarray) {
+  iotjs_jval_t jlength =
+      iotjs_jval_get_property(jarray, IOTJS_MAGIC_STRING_LENGTH);
+  IOTJS_ASSERT(!iotjs_jval_is_undefined(&jlength));
+
+  size_t length = iotjs_jval_as_number(&jlength);
+  IOTJS_ASSERT((int)length >= 0);
+  *buf = iotjs_buffer_allocate(length);
+
+  for (size_t i = 0; i < length; i++) {
+    iotjs_jval_t jdata = iotjs_jval_get_property_by_index(jarray, i);
+    (*buf)[i] = iotjs_jval_as_number(&jdata);
+    iotjs_jval_destroy(&jdata);
+  }
+
+  iotjs_jval_destroy(&jlength);
+
+  return (int)length;
+}
+
+
+static void iotjs_spi_set_array_buffer(iotjs_spi_t* spi,
+                                       const iotjs_jval_t* jtx_buf,
+                                       const iotjs_jval_t* jrx_buf) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+  int tx_buf_len = iotjs_spi_get_array_data(&_this->tx_buf_data, jtx_buf);
+  int rx_buf_len = iotjs_spi_get_array_data(&_this->rx_buf_data, jrx_buf);
+
+  IOTJS_ASSERT(_this->tx_buf_data != NULL && _this->rx_buf_data != NULL);
+  IOTJS_ASSERT(tx_buf_len > 0 && rx_buf_len > 0 && tx_buf_len == rx_buf_len);
+
+  _this->buf_len = tx_buf_len;
+}
+
+
+static void iotjs_spi_set_buffer(iotjs_spi_t* spi, const iotjs_jval_t* jtx_buf,
+                                 const iotjs_jval_t* jrx_buf) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+  iotjs_bufferwrap_t* tx_buf = iotjs_bufferwrap_from_jbuffer(jtx_buf);
+  iotjs_bufferwrap_t* rx_buf = iotjs_bufferwrap_from_jbuffer(jrx_buf);
+
+  _this->tx_buf_data = iotjs_bufferwrap_buffer(tx_buf);
+  uint8_t tx_buf_len = iotjs_bufferwrap_length(tx_buf);
+  _this->rx_buf_data = iotjs_bufferwrap_buffer(rx_buf);
+  uint8_t rx_buf_len = iotjs_bufferwrap_length(rx_buf);
+
+  IOTJS_ASSERT(_this->tx_buf_data != NULL && _this->rx_buf_data != NULL);
+  IOTJS_ASSERT(tx_buf_len > 0 && rx_buf_len > 0 && tx_buf_len == rx_buf_len);
+
+  _this->buf_len = tx_buf_len;
+}
+
+
+static void iotjs_spi_release_buffer(iotjs_spi_t* spi) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+  iotjs_buffer_release(_this->tx_buf_data);
+  iotjs_buffer_release(_this->rx_buf_data);
+}
+
+
+static void iotjs_spi_set_configuration(iotjs_spi_t* spi,
+                                        const iotjs_jval_t* joptions) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+#if defined(__linux__)
+  iotjs_jval_t jdevice =
+      iotjs_jval_get_property(joptions, IOTJS_MAGIC_STRING_DEVICE);
+  _this->device = iotjs_jval_as_string(&jdevice);
+  iotjs_jval_destroy(&jdevice);
+#elif defined(__NUTTX__)
+  iotjs_jval_t jbus = iotjs_jval_get_property(joptions, IOTJS_MAGIC_STRING_BUS);
+  _this->bus = iotjs_jval_as_number(&jbus);
+  iotjs_jval_destroy(&jbus);
+#endif
+  iotjs_jval_t jmode =
+      iotjs_jval_get_property(joptions, IOTJS_MAGIC_STRING_MODE);
+  _this->mode = (SpiMode)iotjs_jval_as_number(&jmode);
+  iotjs_jval_destroy(&jmode);
+
+  iotjs_jval_t jchip_select =
+      iotjs_jval_get_property(joptions, IOTJS_MAGIC_STRING_CHIPSELECT);
+  _this->chip_select = (SpiChipSelect)iotjs_jval_as_number(&jchip_select);
+  iotjs_jval_destroy(&jchip_select);
+
+  iotjs_jval_t jmax_speed =
+      iotjs_jval_get_property(joptions, IOTJS_MAGIC_STRING_MAXSPEED);
+  _this->max_speed = iotjs_jval_as_number(&jmax_speed);
+  iotjs_jval_destroy(&jmax_speed);
+
+  iotjs_jval_t jbits_per_word =
+      iotjs_jval_get_property(joptions, IOTJS_MAGIC_STRING_BITSPERWORD);
+  _this->bits_per_word = (SpiOrder)iotjs_jval_as_number(&jbits_per_word);
+  iotjs_jval_destroy(&jbits_per_word);
+
+  iotjs_jval_t jbit_order =
+      iotjs_jval_get_property(joptions, IOTJS_MAGIC_STRING_BITORDER);
+  _this->bit_order = (SpiOrder)iotjs_jval_as_number(&jbit_order);
+  iotjs_jval_destroy(&jbit_order);
+
+  iotjs_jval_t jloopback =
+      iotjs_jval_get_property(joptions, IOTJS_MAGIC_STRING_LOOPBACK);
+  _this->loopback = iotjs_jval_as_boolean(&jloopback);
+  iotjs_jval_destroy(&jloopback);
+}
+
+
+/*
+ * SPI worker function
+ */
+static void iotjs_spi_transfer_worker(uv_work_t* work_req) {
+  SPI_WORKER_INIT;
+
+  if (!iotjs_spi_transfer(spi)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+static void iotjs_spi_close_worker(uv_work_t* work_req) {
+  SPI_WORKER_INIT;
+
+  if (!iotjs_spi_close(spi)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+static void iotjs_spi_after_work(uv_work_t* work_req, int status) {
+  iotjs_spi_reqwrap_t* req_wrap = iotjs_spi_reqwrap_from_request(work_req);
+  iotjs_spi_reqdata_t* req_data = iotjs_spi_reqwrap_data(req_wrap);
+  iotjs_spi_t* spi = iotjs_spi_instance_from_reqwrap(req_wrap);
+
+  iotjs_jargs_t jargs = iotjs_jargs_create(2);
+
+  bool result = req_data->result;
+
+  if (status) {
+    iotjs_jargs_append_error(&jargs, "System error");
+  } else {
+    switch (req_data->op) {
+      case kSpiOpOpen:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Failed to export SPI device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      case kSpiOpTransferArray:
+      case kSpiOpTransferBuffer:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Cannot transfer from SPI device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+
+          IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+          // Append read data
+          iotjs_jval_t result_data =
+              iotjs_jval_create_byte_array(_this->buf_len, _this->rx_buf_data);
+          iotjs_jargs_append_jval(&jargs, &result_data);
+          iotjs_jval_destroy(&result_data);
+        }
+
+        if (req_data->op == kSpiOpTransferArray)
+          iotjs_spi_release_buffer(spi);
+
+        break;
+      case kSpiOpClose:
+        if (!result) {
+          iotjs_jargs_append_error(&jargs, "Failed to unexport SPI device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      default: {
+        IOTJS_ASSERT(!"Unreachable");
+        break;
+      }
+    }
+  }
+
+  const iotjs_jval_t* jcallback = iotjs_spi_reqwrap_jcallback(req_wrap);
+  iotjs_make_callback(jcallback, iotjs_jval_get_undefined(), &jargs);
+
+  iotjs_jargs_destroy(&jargs);
+
+  iotjs_spi_reqwrap_dispatched(req_wrap);
+}
+
+
+iotjs_spi_t* iotjs_spi_get_instance(const iotjs_jval_t* jspi) {
+  uintptr_t handle = iotjs_jval_get_object_native_handle(jspi);
+  return (iotjs_spi_t*)(handle);
+}
+
+
+#define SPI_ASYNC(call, this, jcallback, op)                                   \
+  do {                                                                         \
+    uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get());         \
+    iotjs_spi_reqwrap_t* req_wrap =                                            \
+        iotjs_spi_reqwrap_create(jcallback, this, op);                         \
+    uv_work_t* req = iotjs_spi_reqwrap_req(req_wrap);                          \
+    uv_queue_work(loop, req, iotjs_spi_##call##_worker, iotjs_spi_after_work); \
+  } while (0)
+
+
+JHANDLER_FUNCTION(SpiConstructor) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(2, object, function);
+
+  // Create SPI object
+  const iotjs_jval_t* jspi = JHANDLER_GET_THIS(object);
+  iotjs_spi_t* spi = iotjs_spi_create(jspi);
+  IOTJS_ASSERT(spi == iotjs_spi_get_instance(jspi));
+
+  // Set configuration
+  const iotjs_jval_t* jconfiguration = JHANDLER_GET_ARG(0, object);
+  iotjs_spi_set_configuration(spi, jconfiguration);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(1, function);
+  SPI_ASYNC(open, spi, jcallback, kSpiOpOpen);
+}
+
+
+// FIXME: do not need transferArray if array buffer is implemented.
+JHANDLER_FUNCTION(TransferArray) {
+  JHANDLER_DECLARE_THIS_PTR(spi, spi);
+
+  DJHANDLER_CHECK_ARGS(2, array, array);
+  DJHANDLER_CHECK_ARG_IF_EXIST(2, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(2, function);
+
+  iotjs_spi_set_array_buffer(spi, JHANDLER_GET_ARG(0, array),
+                             JHANDLER_GET_ARG(1, array));
+
+  if (jcallback) {
+    SPI_ASYNC(transfer, spi, jcallback, kSpiOpTransferArray);
+  } else {
+    if (!iotjs_spi_transfer(spi)) {
+      JHANDLER_THROW(COMMON, "SPI Transfer Error");
+    } else {
+      IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+      iotjs_jval_t result =
+          iotjs_jval_create_byte_array(_this->buf_len, _this->rx_buf_data);
+      iotjs_jhandler_return_jval(jhandler, &result);
+      iotjs_jval_destroy(&result);
+    }
+
+    iotjs_spi_release_buffer(spi);
+  }
+}
+
+
+JHANDLER_FUNCTION(TransferBuffer) {
+  JHANDLER_DECLARE_THIS_PTR(spi, spi);
+
+  DJHANDLER_CHECK_ARGS(2, object, object);
+  DJHANDLER_CHECK_ARG_IF_EXIST(2, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(2, function);
+
+  iotjs_spi_set_buffer(spi, JHANDLER_GET_ARG(0, object),
+                       JHANDLER_GET_ARG(1, object));
+
+  if (jcallback) {
+    SPI_ASYNC(transfer, spi, jcallback, kSpiOpTransferBuffer);
+  } else {
+    if (!iotjs_spi_transfer(spi)) {
+      JHANDLER_THROW(COMMON, "SPI Transfer Error");
+    } else {
+      IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+      iotjs_jval_t result =
+          iotjs_jval_create_byte_array(_this->buf_len, _this->rx_buf_data);
+      iotjs_jhandler_return_jval(jhandler, &result);
+      iotjs_jval_destroy(&result);
+    }
+  }
+}
+
+
+JHANDLER_FUNCTION(Close) {
+  JHANDLER_DECLARE_THIS_PTR(spi, spi);
+
+  DJHANDLER_CHECK_ARG_IF_EXIST(0, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(0, function);
+
+  if (jcallback) {
+    SPI_ASYNC(close, spi, jcallback, kSpiOpClose);
+  } else {
+    if (!iotjs_spi_close(spi)) {
+      JHANDLER_THROW(COMMON, "SPI Close Error");
+    }
+  }
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+iotjs_jval_t InitSpi() {
+  iotjs_jval_t jspi = iotjs_jval_create_object();
+  iotjs_jval_t jspiConstructor =
+      iotjs_jval_create_function_with_dispatch(SpiConstructor);
+  iotjs_jval_set_property_jval(&jspi, IOTJS_MAGIC_STRING_SPI, &jspiConstructor);
+
+  iotjs_jval_t prototype = iotjs_jval_create_object();
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_TRANSFERARRAY,
+                        TransferArray);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_TRANSFERBUFFER,
+                        TransferBuffer);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_CLOSE, Close);
+  iotjs_jval_set_property_jval(&jspiConstructor, IOTJS_MAGIC_STRING_PROTOTYPE,
+                               &prototype);
+  iotjs_jval_destroy(&prototype);
+  iotjs_jval_destroy(&jspiConstructor);
+
+  // SPI mode properties
+  iotjs_jval_t jmode = iotjs_jval_create_object();
+  iotjs_jval_set_property_number(&jmode, IOTJS_MAGIC_STRING_0, kSpiMode_0);
+  iotjs_jval_set_property_number(&jmode, IOTJS_MAGIC_STRING_1, kSpiMode_1);
+  iotjs_jval_set_property_number(&jmode, IOTJS_MAGIC_STRING_2, kSpiMode_2);
+  iotjs_jval_set_property_number(&jmode, IOTJS_MAGIC_STRING_3, kSpiMode_3);
+  iotjs_jval_set_property_jval(&jspi, IOTJS_MAGIC_STRING_MODE_U, &jmode);
+  iotjs_jval_destroy(&jmode);
+
+  // SPI mode properties
+  iotjs_jval_t jcs = iotjs_jval_create_object();
+  iotjs_jval_set_property_number(&jcs, IOTJS_MAGIC_STRING_NONE, kSpiCsNone);
+  iotjs_jval_set_property_number(&jcs, IOTJS_MAGIC_STRING_HIGH, kSpiCsHigh);
+  iotjs_jval_set_property_jval(&jspi, IOTJS_MAGIC_STRING_CHIPSELECT_U, &jcs);
+  iotjs_jval_destroy(&jcs);
+
+  // SPI order properties
+  iotjs_jval_t jbit_order = iotjs_jval_create_object();
+  iotjs_jval_set_property_number(&jbit_order, IOTJS_MAGIC_STRING_MSB,
+                                 kSpiOrderMsb);
+  iotjs_jval_set_property_number(&jbit_order, IOTJS_MAGIC_STRING_LSB,
+                                 kSpiOrderLsb);
+  iotjs_jval_set_property_jval(&jspi, IOTJS_MAGIC_STRING_BITORDER_U,
+                               &jbit_order);
+  iotjs_jval_destroy(&jbit_order);
+
+  return jspi;
+}
diff --git a/src/modules/iotjs_module_spi.h b/src/modules/iotjs_module_spi.h
new file mode 100644 (file)
index 0000000..7ba3fdf
--- /dev/null
@@ -0,0 +1,114 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_SPI_H
+#define IOTJS_MODULE_SPI_H
+
+#include "iotjs_def.h"
+#include "iotjs_module_buffer.h"
+#include "iotjs_objectwrap.h"
+#include "iotjs_reqwrap.h"
+
+
+#if defined(__NUTTX__)
+#include <nuttx/spi/spi.h>
+#endif
+
+typedef enum {
+  kSpiOpOpen,
+  kSpiOpTransferArray,
+  kSpiOpTransferBuffer,
+  kSpiOpClose,
+} SpiOp;
+
+typedef enum {
+  kSpiMode_0,
+  kSpiMode_1,
+  kSpiMode_2,
+  kSpiMode_3,
+} SpiMode;
+
+typedef enum {
+  kSpiCsNone,
+  kSpiCsHigh,
+} SpiChipSelect;
+
+typedef enum { kSpiOrderMsb, kSpiOrderLsb } SpiOrder;
+
+
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+#if defined(__linux__)
+  iotjs_string_t device;
+  int32_t device_fd;
+#elif defined(__NUTTX__)
+  int bus;
+  uint32_t cs_chip;
+  struct spi_dev_s* spi_dev;
+#endif
+  SpiMode mode;
+  SpiChipSelect chip_select;
+  SpiOrder bit_order;
+  uint8_t bits_per_word;
+  uint16_t delay;
+  uint32_t max_speed;
+  bool loopback;
+
+  // SPI buffer
+  char* tx_buf_data;
+  char* rx_buf_data;
+  uint8_t buf_len;
+
+} IOTJS_VALIDATED_STRUCT(iotjs_spi_t);
+
+
+typedef struct {
+  bool result;
+  SpiOp op;
+} iotjs_spi_reqdata_t;
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_work_t req;
+  iotjs_spi_reqdata_t req_data;
+  iotjs_spi_t* spi_instance;
+} IOTJS_VALIDATED_STRUCT(iotjs_spi_reqwrap_t);
+
+
+#define THIS iotjs_spi_reqwrap_t* spi_reqwrap
+
+iotjs_spi_reqwrap_t* iotjs_spi_reqwrap_from_request(uv_work_t* req);
+iotjs_spi_reqdata_t* iotjs_spi_reqwrap_data(THIS);
+
+iotjs_spi_t* iotjs_spi_instance_from_reqwrap(THIS);
+
+#undef THIS
+
+
+#define SPI_WORKER_INIT                                                     \
+  iotjs_spi_reqwrap_t* req_wrap = iotjs_spi_reqwrap_from_request(work_req); \
+  iotjs_spi_reqdata_t* req_data = iotjs_spi_reqwrap_data(req_wrap);         \
+  iotjs_spi_t* spi = iotjs_spi_instance_from_reqwrap(req_wrap);
+
+
+bool iotjs_spi_transfer(iotjs_spi_t* spi);
+bool iotjs_spi_close(iotjs_spi_t* spi);
+
+void iotjs_spi_open_worker(uv_work_t* work_req);
+
+
+#endif /* IOTJS_MODULE_SPI_H */
diff --git a/src/modules/iotjs_module_stm32f4dis.c b/src/modules/iotjs_module_stm32f4dis.c
new file mode 100644 (file)
index 0000000..672a504
--- /dev/null
@@ -0,0 +1,30 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_module_stm32f4dis.h"
+
+
+iotjs_jval_t InitStm32f4dis() {
+  iotjs_jval_t stm32f4dis = iotjs_jval_create_object();
+
+#if defined(__NUTTX__)
+
+  iotjs_stm32f4dis_pin_initialize(&stm32f4dis);
+
+#endif
+
+  return stm32f4dis;
+}
diff --git a/src/modules/iotjs_module_stm32f4dis.h b/src/modules/iotjs_module_stm32f4dis.h
new file mode 100644 (file)
index 0000000..f14d608
--- /dev/null
@@ -0,0 +1,23 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_MODULE_STM32F4DIS_H
+#define IOTJS_MODULE_STM32F4DIS_H
+
+
+void iotjs_stm32f4dis_pin_initialize(const iotjs_jval_t* jobj);
+
+
+#endif /* IOTJS_MODULE_STM32F4DIS_H */
diff --git a/src/modules/iotjs_module_tcp.c b/src/modules/iotjs_module_tcp.c
new file mode 100644 (file)
index 0000000..aa210b9
--- /dev/null
@@ -0,0 +1,666 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "iotjs_def.h"
+#include "iotjs_module_tcp.h"
+
+#include "iotjs_handlewrap.h"
+#include "iotjs_module_buffer.h"
+#include "iotjs_reqwrap.h"
+
+
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(tcpwrap);
+
+
+iotjs_tcpwrap_t* iotjs_tcpwrap_create(const iotjs_jval_t* jtcp) {
+  iotjs_tcpwrap_t* tcpwrap = IOTJS_ALLOC(iotjs_tcpwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_tcpwrap_t, tcpwrap);
+
+  iotjs_handlewrap_initialize(&_this->handlewrap, jtcp,
+                              (uv_handle_t*)(&_this->handle),
+                              &this_module_native_info);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+  uv_tcp_init(iotjs_environment_loop(env), &_this->handle);
+
+  return tcpwrap;
+}
+
+
+static void iotjs_tcpwrap_destroy(iotjs_tcpwrap_t* tcpwrap) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_tcpwrap_t, tcpwrap);
+  iotjs_handlewrap_destroy(&_this->handlewrap);
+  IOTJS_RELEASE(tcpwrap);
+}
+
+
+iotjs_tcpwrap_t* iotjs_tcpwrap_from_handle(uv_tcp_t* tcp_handle) {
+  uv_handle_t* handle = (uv_handle_t*)(tcp_handle);
+  iotjs_handlewrap_t* handlewrap = iotjs_handlewrap_from_handle(handle);
+  iotjs_tcpwrap_t* tcpwrap = (iotjs_tcpwrap_t*)handlewrap;
+  IOTJS_ASSERT(iotjs_tcpwrap_tcp_handle(tcpwrap) == tcp_handle);
+  return tcpwrap;
+}
+
+
+iotjs_tcpwrap_t* iotjs_tcpwrap_from_jobject(const iotjs_jval_t* jtcp) {
+  iotjs_handlewrap_t* handlewrap = iotjs_handlewrap_from_jobject(jtcp);
+  return (iotjs_tcpwrap_t*)handlewrap;
+}
+
+
+uv_tcp_t* iotjs_tcpwrap_tcp_handle(iotjs_tcpwrap_t* tcpwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_tcpwrap_t, tcpwrap);
+  uv_handle_t* handle = iotjs_handlewrap_get_uv_handle(&_this->handlewrap);
+  return (uv_tcp_t*)handle;
+}
+
+
+iotjs_jval_t* iotjs_tcpwrap_jobject(iotjs_tcpwrap_t* tcpwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_tcpwrap_t, tcpwrap);
+  return iotjs_handlewrap_jobject(&_this->handlewrap);
+}
+
+
+#define THIS iotjs_connect_reqwrap_t* connect_reqwrap
+
+
+static void iotjs_connect_reqwrap_destroy(THIS);
+
+
+iotjs_connect_reqwrap_t* iotjs_connect_reqwrap_create(
+    const iotjs_jval_t* jcallback) {
+  iotjs_connect_reqwrap_t* connect_reqwrap =
+      IOTJS_ALLOC(iotjs_connect_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_connect_reqwrap_t, connect_reqwrap);
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+  return connect_reqwrap;
+}
+
+
+static void iotjs_connect_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_connect_reqwrap_t, connect_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(connect_reqwrap);
+}
+
+
+void iotjs_connect_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_connect_reqwrap_t,
+                                           connect_reqwrap);
+  iotjs_connect_reqwrap_destroy(connect_reqwrap);
+}
+
+
+uv_connect_t* iotjs_connect_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_connect_reqwrap_t, connect_reqwrap);
+  return &_this->req;
+}
+
+
+const iotjs_jval_t* iotjs_connect_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_connect_reqwrap_t, connect_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+#undef THIS
+
+
+#define THIS iotjs_write_reqwrap_t* write_reqwrap
+
+
+static void iotjs_write_reqwrap_destroy(THIS);
+
+
+iotjs_write_reqwrap_t* iotjs_write_reqwrap_create(
+    const iotjs_jval_t* jcallback) {
+  iotjs_write_reqwrap_t* write_reqwrap = IOTJS_ALLOC(iotjs_write_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_write_reqwrap_t, write_reqwrap);
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+  return write_reqwrap;
+}
+
+
+static void iotjs_write_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_write_reqwrap_t, write_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(write_reqwrap);
+}
+
+
+void iotjs_write_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_write_reqwrap_t,
+                                           write_reqwrap);
+  iotjs_write_reqwrap_destroy(write_reqwrap);
+}
+
+
+uv_write_t* iotjs_write_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_write_reqwrap_t, write_reqwrap);
+  return &_this->req;
+}
+
+
+const iotjs_jval_t* iotjs_write_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_write_reqwrap_t, write_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+#undef THIS
+
+
+#define THIS iotjs_shutdown_reqwrap_t* shutdown_reqwrap
+
+
+static void iotjs_shutdown_reqwrap_destroy(THIS);
+
+
+iotjs_shutdown_reqwrap_t* iotjs_shutdown_reqwrap_create(
+    const iotjs_jval_t* jcallback) {
+  iotjs_shutdown_reqwrap_t* shutdown_reqwrap =
+      IOTJS_ALLOC(iotjs_shutdown_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_shutdown_reqwrap_t,
+                                     shutdown_reqwrap);
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+  return shutdown_reqwrap;
+}
+
+
+static void iotjs_shutdown_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_shutdown_reqwrap_t, shutdown_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(shutdown_reqwrap);
+}
+
+
+void iotjs_shutdown_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_shutdown_reqwrap_t,
+                                           shutdown_reqwrap);
+  iotjs_shutdown_reqwrap_destroy(shutdown_reqwrap);
+}
+
+
+uv_shutdown_t* iotjs_shutdown_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_shutdown_reqwrap_t, shutdown_reqwrap);
+  return &_this->req;
+}
+
+
+const iotjs_jval_t* iotjs_shutdown_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_shutdown_reqwrap_t, shutdown_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+#undef THIS
+
+
+JHANDLER_FUNCTION(TCP) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(0);
+
+  const iotjs_jval_t* jtcp = JHANDLER_GET_THIS(object);
+  iotjs_tcpwrap_t* tcp_wrap = iotjs_tcpwrap_create(jtcp);
+  IOTJS_UNUSED(tcp_wrap);
+}
+
+
+JHANDLER_FUNCTION(Open) {
+}
+
+
+// Socket close result handler.
+void AfterClose(uv_handle_t* handle) {
+  iotjs_handlewrap_t* wrap = iotjs_handlewrap_from_handle(handle);
+
+  // tcp object.
+  const iotjs_jval_t* jtcp = iotjs_handlewrap_jobject(wrap);
+
+  // callback function.
+  iotjs_jval_t jcallback =
+      iotjs_jval_get_property(jtcp, IOTJS_MAGIC_STRING_ONCLOSE);
+  if (iotjs_jval_is_function(&jcallback)) {
+    iotjs_make_callback(&jcallback, iotjs_jval_get_undefined(),
+                        iotjs_jargs_get_empty());
+  }
+  iotjs_jval_destroy(&jcallback);
+}
+
+
+// Close socket
+JHANDLER_FUNCTION(Close) {
+  JHANDLER_DECLARE_THIS_PTR(handlewrap, wrap);
+  DJHANDLER_CHECK_ARGS(0);
+
+  // close uv handle, `AfterClose` will be called after socket closed.
+  iotjs_handlewrap_close(wrap, AfterClose);
+}
+
+
+// Socket binding, this function would be called from server socket before
+// start listening.
+// [0] address
+// [1] port
+JHANDLER_FUNCTION(Bind) {
+  JHANDLER_DECLARE_THIS_PTR(tcpwrap, tcp_wrap);
+
+  DJHANDLER_CHECK_ARGS(2, string, number);
+
+  iotjs_string_t address = JHANDLER_GET_ARG(0, string);
+  int port = JHANDLER_GET_ARG(1, number);
+
+  sockaddr_in addr;
+  int err = uv_ip4_addr(iotjs_string_data(&address), port, &addr);
+
+  if (err == 0) {
+    err = uv_tcp_bind(iotjs_tcpwrap_tcp_handle(tcp_wrap),
+                      (const sockaddr*)(&addr), 0);
+  }
+
+  iotjs_jhandler_return_number(jhandler, err);
+
+  iotjs_string_destroy(&address);
+}
+
+
+// Connection request result handler.
+static void AfterConnect(uv_connect_t* req, int status) {
+  iotjs_connect_reqwrap_t* req_wrap = (iotjs_connect_reqwrap_t*)(req->data);
+  IOTJS_ASSERT(req_wrap != NULL);
+
+  // Take callback function object.
+  // function afterConnect(status)
+  const iotjs_jval_t* jcallback = iotjs_connect_reqwrap_jcallback(req_wrap);
+  IOTJS_ASSERT(iotjs_jval_is_function(jcallback));
+
+  // Only parameter is status code.
+  iotjs_jargs_t args = iotjs_jargs_create(1);
+  iotjs_jargs_append_number(&args, status);
+
+  // Make callback.
+  iotjs_make_callback(jcallback, iotjs_jval_get_undefined(), &args);
+
+  // Destroy args
+  iotjs_jargs_destroy(&args);
+
+  // Release request wrapper.
+  iotjs_connect_reqwrap_dispatched(req_wrap);
+}
+
+
+// Create a connection using the socket.
+// [0] address
+// [1] port
+// [2] callback
+JHANDLER_FUNCTION(Connect) {
+  JHANDLER_DECLARE_THIS_PTR(tcpwrap, tcp_wrap);
+
+  DJHANDLER_CHECK_ARGS(3, string, number, function);
+
+  iotjs_string_t address = JHANDLER_GET_ARG(0, string);
+  int port = JHANDLER_GET_ARG(1, number);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(2, function);
+
+  sockaddr_in addr;
+  int err = uv_ip4_addr(iotjs_string_data(&address), port, &addr);
+
+  if (err == 0) {
+    // Create connection request wrapper.
+    iotjs_connect_reqwrap_t* req_wrap = iotjs_connect_reqwrap_create(jcallback);
+
+    // Create connection request.
+    err = uv_tcp_connect(iotjs_connect_reqwrap_req(req_wrap),
+                         iotjs_tcpwrap_tcp_handle(tcp_wrap),
+                         (const sockaddr*)(&addr), AfterConnect);
+
+    if (err) {
+      iotjs_connect_reqwrap_dispatched(req_wrap);
+    }
+  }
+
+  iotjs_jhandler_return_number(jhandler, err);
+
+  iotjs_string_destroy(&address);
+}
+
+
+// A client socket wants to connect to this server.
+// Parameters:
+//   * uv_stream_t* handle - server handle
+//   * int status - status code
+static void OnConnection(uv_stream_t* handle, int status) {
+  // Server tcp wrapper.
+  iotjs_tcpwrap_t* tcp_wrap = iotjs_tcpwrap_from_handle((uv_tcp_t*)handle);
+
+  // Tcp object
+  const iotjs_jval_t* jtcp = iotjs_tcpwrap_jobject(tcp_wrap);
+
+  // `onconnection` callback.
+  iotjs_jval_t jonconnection =
+      iotjs_jval_get_property(jtcp, IOTJS_MAGIC_STRING_ONCONNECTION);
+  IOTJS_ASSERT(iotjs_jval_is_function(&jonconnection));
+
+  // The callback takes two parameter
+  // [0] status
+  // [1] client tcp object
+  iotjs_jargs_t args = iotjs_jargs_create(2);
+  iotjs_jargs_append_number(&args, status);
+
+  if (status == 0) {
+    // Create client socket handle wrapper.
+    iotjs_jval_t jcreate_tcp =
+        iotjs_jval_get_property(jtcp, IOTJS_MAGIC_STRING_CREATETCP);
+    IOTJS_ASSERT(iotjs_jval_is_function(&jcreate_tcp));
+
+    iotjs_jval_t jclient_tcp =
+        iotjs_jhelper_call_ok(&jcreate_tcp, iotjs_jval_get_undefined(),
+                              iotjs_jargs_get_empty());
+    IOTJS_ASSERT(iotjs_jval_is_object(&jclient_tcp));
+
+    iotjs_tcpwrap_t* tcp_wrap_client =
+        (iotjs_tcpwrap_t*)(iotjs_jval_get_object_native_handle(&jclient_tcp));
+
+    uv_stream_t* client_handle =
+        (uv_stream_t*)(iotjs_tcpwrap_tcp_handle(tcp_wrap_client));
+
+    int err = uv_accept(handle, client_handle);
+    if (err) {
+      return;
+    }
+
+    iotjs_jargs_append_jval(&args, &jclient_tcp);
+    iotjs_jval_destroy(&jcreate_tcp);
+    iotjs_jval_destroy(&jclient_tcp);
+  }
+
+  iotjs_make_callback(&jonconnection, jtcp, &args);
+
+  iotjs_jval_destroy(&jonconnection);
+  iotjs_jargs_destroy(&args);
+}
+
+
+JHANDLER_FUNCTION(Listen) {
+  JHANDLER_DECLARE_THIS_PTR(tcpwrap, tcp_wrap);
+  DJHANDLER_CHECK_ARGS(1, number);
+
+  int backlog = JHANDLER_GET_ARG(0, number);
+
+  int err = uv_listen((uv_stream_t*)(iotjs_tcpwrap_tcp_handle(tcp_wrap)),
+                      backlog, OnConnection);
+
+  iotjs_jhandler_return_number(jhandler, err);
+}
+
+
+void AfterWrite(uv_write_t* req, int status) {
+  iotjs_write_reqwrap_t* req_wrap = (iotjs_write_reqwrap_t*)(req->data);
+  iotjs_tcpwrap_t* tcp_wrap = (iotjs_tcpwrap_t*)(req->handle->data);
+  IOTJS_ASSERT(req_wrap != NULL);
+  IOTJS_ASSERT(tcp_wrap != NULL);
+
+  // Take callback function object.
+  const iotjs_jval_t* jcallback = iotjs_write_reqwrap_jcallback(req_wrap);
+
+  // Only parameter is status code.
+  iotjs_jargs_t args = iotjs_jargs_create(1);
+  iotjs_jargs_append_number(&args, status);
+
+  // Make callback.
+  iotjs_make_callback(jcallback, iotjs_jval_get_undefined(), &args);
+
+  // Destroy args
+  iotjs_jargs_destroy(&args);
+
+  // Release request wrapper.
+  iotjs_write_reqwrap_dispatched(req_wrap);
+}
+
+
+JHANDLER_FUNCTION(Write) {
+  JHANDLER_DECLARE_THIS_PTR(tcpwrap, tcp_wrap);
+  DJHANDLER_CHECK_ARGS(2, object, function);
+
+  const iotjs_jval_t* jbuffer = JHANDLER_GET_ARG(0, object);
+  iotjs_bufferwrap_t* buffer_wrap = iotjs_bufferwrap_from_jbuffer(jbuffer);
+  char* buffer = iotjs_bufferwrap_buffer(buffer_wrap);
+  size_t len = iotjs_bufferwrap_length(buffer_wrap);
+
+  uv_buf_t buf;
+  buf.base = buffer;
+  buf.len = len;
+
+  const iotjs_jval_t* arg1 = JHANDLER_GET_ARG(1, object);
+  iotjs_write_reqwrap_t* req_wrap = iotjs_write_reqwrap_create(arg1);
+
+  int err = uv_write(iotjs_write_reqwrap_req(req_wrap),
+                     (uv_stream_t*)(iotjs_tcpwrap_tcp_handle(tcp_wrap)), &buf,
+                     1, AfterWrite);
+
+  if (err) {
+    iotjs_write_reqwrap_dispatched(req_wrap);
+  }
+
+  iotjs_jhandler_return_number(jhandler, err);
+}
+
+
+void OnAlloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {
+  if (suggested_size > IOTJS_MAX_READ_BUFFER_SIZE) {
+    suggested_size = IOTJS_MAX_READ_BUFFER_SIZE;
+  }
+
+  buf->base = iotjs_buffer_allocate(suggested_size);
+  buf->len = suggested_size;
+}
+
+
+void OnRead(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) {
+  iotjs_tcpwrap_t* tcp_wrap = iotjs_tcpwrap_from_handle((uv_tcp_t*)handle);
+
+  // tcp handle
+  const iotjs_jval_t* jtcp = iotjs_tcpwrap_jobject(tcp_wrap);
+
+  // socket object
+  iotjs_jval_t jsocket =
+      iotjs_jval_get_property(jtcp, IOTJS_MAGIC_STRING_OWNER);
+  IOTJS_ASSERT(iotjs_jval_is_object(&jsocket));
+
+  // onread callback
+  iotjs_jval_t jonread =
+      iotjs_jval_get_property(jtcp, IOTJS_MAGIC_STRING_ONREAD);
+  IOTJS_ASSERT(iotjs_jval_is_function(&jonread));
+
+  iotjs_jargs_t jargs = iotjs_jargs_create(4);
+  iotjs_jargs_append_jval(&jargs, &jsocket);
+  iotjs_jargs_append_number(&jargs, nread);
+  iotjs_jargs_append_bool(&jargs, false);
+
+  if (nread <= 0) {
+    if (buf->base != NULL) {
+      iotjs_buffer_release(buf->base);
+    }
+    if (nread < 0) {
+      if (nread == UV__EOF) {
+        iotjs_jargs_replace(&jargs, 2, iotjs_jval_get_boolean(true));
+      }
+
+      iotjs_make_callback(&jonread, iotjs_jval_get_undefined(), &jargs);
+    }
+  } else {
+    iotjs_jval_t jbuffer = iotjs_bufferwrap_create_buffer((size_t)nread);
+    iotjs_bufferwrap_t* buffer_wrap = iotjs_bufferwrap_from_jbuffer(&jbuffer);
+
+    iotjs_bufferwrap_copy(buffer_wrap, buf->base, (size_t)nread);
+
+    iotjs_jargs_append_jval(&jargs, &jbuffer);
+    iotjs_make_callback(&jonread, iotjs_jval_get_undefined(), &jargs);
+
+    iotjs_jval_destroy(&jbuffer);
+    iotjs_buffer_release(buf->base);
+  }
+
+  iotjs_jargs_destroy(&jargs);
+  iotjs_jval_destroy(&jonread);
+  iotjs_jval_destroy(&jsocket);
+}
+
+
+JHANDLER_FUNCTION(ReadStart) {
+  JHANDLER_DECLARE_THIS_PTR(tcpwrap, tcp_wrap);
+
+  int err = uv_read_start((uv_stream_t*)(iotjs_tcpwrap_tcp_handle(tcp_wrap)),
+                          OnAlloc, OnRead);
+
+  iotjs_jhandler_return_number(jhandler, err);
+}
+
+
+static void AfterShutdown(uv_shutdown_t* req, int status) {
+  iotjs_shutdown_reqwrap_t* req_wrap = (iotjs_shutdown_reqwrap_t*)(req->data);
+  iotjs_tcpwrap_t* tcp_wrap = (iotjs_tcpwrap_t*)(req->handle->data);
+  IOTJS_ASSERT(req_wrap != NULL);
+  IOTJS_ASSERT(tcp_wrap != NULL);
+
+  // function onShutdown(status)
+  const iotjs_jval_t* jonshutdown = iotjs_shutdown_reqwrap_jcallback(req_wrap);
+  IOTJS_ASSERT(iotjs_jval_is_function(jonshutdown));
+
+  iotjs_jargs_t args = iotjs_jargs_create(1);
+  iotjs_jargs_append_number(&args, status);
+
+  iotjs_make_callback(jonshutdown, iotjs_jval_get_undefined(), &args);
+
+  iotjs_jargs_destroy(&args);
+
+  iotjs_shutdown_reqwrap_dispatched(req_wrap);
+}
+
+
+JHANDLER_FUNCTION(Shutdown) {
+  JHANDLER_DECLARE_THIS_PTR(tcpwrap, tcp_wrap);
+
+  DJHANDLER_CHECK_ARGS(1, function);
+
+  const iotjs_jval_t* arg0 = JHANDLER_GET_ARG(0, object);
+  iotjs_shutdown_reqwrap_t* req_wrap = iotjs_shutdown_reqwrap_create(arg0);
+
+  int err = uv_shutdown(iotjs_shutdown_reqwrap_req(req_wrap),
+                        (uv_stream_t*)(iotjs_tcpwrap_tcp_handle(tcp_wrap)),
+                        AfterShutdown);
+
+  if (err) {
+    iotjs_shutdown_reqwrap_dispatched(req_wrap);
+  }
+
+  iotjs_jhandler_return_number(jhandler, err);
+}
+
+
+// Enable/Disable keepalive option.
+// [0] enable
+// [1] delay
+JHANDLER_FUNCTION(SetKeepAlive) {
+  JHANDLER_DECLARE_THIS_PTR(tcpwrap, tcp_wrap);
+
+  DJHANDLER_CHECK_ARGS(2, number, number);
+
+  int enable = JHANDLER_GET_ARG(0, number);
+  unsigned delay = JHANDLER_GET_ARG(1, number);
+
+  int err = uv_tcp_keepalive(iotjs_tcpwrap_tcp_handle(tcp_wrap), enable, delay);
+
+  iotjs_jhandler_return_number(jhandler, err);
+}
+
+JHANDLER_FUNCTION(ErrName) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(1, number);
+
+  int errorcode = JHANDLER_GET_ARG(0, number);
+  iotjs_jhandler_return_string_raw(jhandler, uv_err_name(errorcode));
+}
+
+// used in iotjs_module_udp.cpp
+void AddressToJS(const iotjs_jval_t* obj, const sockaddr* addr) {
+  char ip[INET6_ADDRSTRLEN];
+  const sockaddr_in* a4;
+  const sockaddr_in6* a6;
+  int port;
+
+  switch (addr->sa_family) {
+    case AF_INET6: {
+      a6 = (const sockaddr_in6*)(addr);
+      uv_inet_ntop(AF_INET6, &a6->sin6_addr, ip, sizeof ip);
+      port = ntohs(a6->sin6_port);
+      iotjs_jval_set_property_string_raw(obj, IOTJS_MAGIC_STRING_ADDRESS, ip);
+      iotjs_jval_set_property_string_raw(obj, IOTJS_MAGIC_STRING_FAMILY,
+                                         IOTJS_MAGIC_STRING_IPV6);
+      iotjs_jval_set_property_number(obj, IOTJS_MAGIC_STRING_PORT, port);
+      break;
+    }
+
+    case AF_INET: {
+      a4 = (const sockaddr_in*)(addr);
+      uv_inet_ntop(AF_INET, &a4->sin_addr, ip, sizeof ip);
+      port = ntohs(a4->sin_port);
+      iotjs_jval_set_property_string_raw(obj, IOTJS_MAGIC_STRING_ADDRESS, ip);
+      iotjs_jval_set_property_string_raw(obj, IOTJS_MAGIC_STRING_FAMILY,
+                                         IOTJS_MAGIC_STRING_IPV4);
+      iotjs_jval_set_property_number(obj, IOTJS_MAGIC_STRING_PORT, port);
+      break;
+    }
+
+    default: {
+      iotjs_jval_set_property_string_raw(obj, IOTJS_MAGIC_STRING_ADDRESS, "");
+      break;
+    }
+  }
+}
+
+GetSockNameFunction(tcpwrap, tcp_handle, uv_tcp_getsockname);
+
+
+JHANDLER_FUNCTION(GetSockeName) {
+  DoGetSockName(jhandler);
+}
+
+iotjs_jval_t InitTcp() {
+  iotjs_jval_t tcp = iotjs_jval_create_function_with_dispatch(TCP);
+
+  iotjs_jval_t prototype = iotjs_jval_create_object();
+  iotjs_jval_t errname = iotjs_jval_create_function_with_dispatch(ErrName);
+
+  iotjs_jval_set_property_jval(&tcp, IOTJS_MAGIC_STRING_PROTOTYPE, &prototype);
+  iotjs_jval_set_property_jval(&tcp, IOTJS_MAGIC_STRING_ERRNAME, &errname);
+
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_OPEN, Open);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_CLOSE, Close);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_CONNECT, Connect);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_BIND, Bind);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_LISTEN, Listen);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_WRITE, Write);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_READSTART, ReadStart);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_SHUTDOWN, Shutdown);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_SETKEEPALIVE,
+                        SetKeepAlive);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_GETSOCKNAME,
+                        GetSockeName);
+
+  iotjs_jval_destroy(&prototype);
+  iotjs_jval_destroy(&errname);
+
+  return tcp;
+}
diff --git a/src/modules/iotjs_module_tcp.h b/src/modules/iotjs_module_tcp.h
new file mode 100644 (file)
index 0000000..156bf89
--- /dev/null
@@ -0,0 +1,110 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_TCP_H
+#define IOTJS_MODULE_TCP_H
+
+
+#include "iotjs_binding.h"
+#include "iotjs_handlewrap.h"
+#include "iotjs_reqwrap.h"
+
+
+typedef struct sockaddr sockaddr;
+typedef struct sockaddr_in sockaddr_in;
+typedef struct sockaddr_in6 sockaddr_in6;
+typedef struct sockaddr_storage sockaddr_storage;
+
+
+typedef struct {
+  iotjs_handlewrap_t handlewrap;
+  uv_tcp_t handle;
+} IOTJS_VALIDATED_STRUCT(iotjs_tcpwrap_t);
+
+
+iotjs_tcpwrap_t* iotjs_tcpwrap_create(const iotjs_jval_t* jtcp);
+
+iotjs_tcpwrap_t* iotjs_tcpwrap_from_handle(uv_tcp_t* handle);
+iotjs_tcpwrap_t* iotjs_tcpwrap_from_jobject(const iotjs_jval_t* jtcp);
+
+uv_tcp_t* iotjs_tcpwrap_tcp_handle(iotjs_tcpwrap_t* tcpwrap);
+iotjs_jval_t* iotjs_tcpwrap_jobject(iotjs_tcpwrap_t* tcpwrap);
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_connect_t req;
+} IOTJS_VALIDATED_STRUCT(iotjs_connect_reqwrap_t);
+
+#define THIS iotjs_connect_reqwrap_t* connect_reqwrap
+iotjs_connect_reqwrap_t* iotjs_connect_reqwrap_create(
+    const iotjs_jval_t* jcallback);
+void iotjs_connect_reqwrap_dispatched(THIS);
+uv_connect_t* iotjs_connect_reqwrap_req(THIS);
+const iotjs_jval_t* iotjs_connect_reqwrap_jcallback(THIS);
+#undef THIS
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_write_t req;
+} IOTJS_VALIDATED_STRUCT(iotjs_write_reqwrap_t);
+
+#define THIS iotjs_write_reqwrap_t* write_reqwrap
+iotjs_write_reqwrap_t* iotjs_write_reqwrap_create(
+    const iotjs_jval_t* jcallback);
+void iotjs_write_reqwrap_dispatched(THIS);
+uv_write_t* iotjs_write_reqwrap_req(THIS);
+const iotjs_jval_t* iotjs_write_reqwrap_jcallback(THIS);
+#undef THIS
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_shutdown_t req;
+} IOTJS_VALIDATED_STRUCT(iotjs_shutdown_reqwrap_t);
+
+#define THIS iotjs_shutdown_reqwrap_t* shutdown_reqwrap
+iotjs_shutdown_reqwrap_t* iotjs_shutdown_reqwrap_create(
+    const iotjs_jval_t* jcallback);
+void iotjs_shutdown_reqwrap_dispatched(THIS);
+uv_shutdown_t* iotjs_shutdown_reqwrap_req(THIS);
+const iotjs_jval_t* iotjs_shutdown_reqwrap_jcallback(THIS);
+#undef THIS
+
+
+void AddressToJS(const iotjs_jval_t* obj, const sockaddr* addr);
+
+
+#define GetSockNameFunction(wraptype, handletype, function)                    \
+  static void DoGetSockName(iotjs_jhandler_t* jhandler) {                      \
+    DJHANDLER_CHECK_ARGS(1, object);                                           \
+                                                                               \
+    iotjs_##wraptype##_t* wrap =                                               \
+        iotjs_##wraptype##_from_jobject(JHANDLER_GET_THIS(object));            \
+    IOTJS_ASSERT(wrap != NULL);                                                \
+                                                                               \
+    sockaddr_storage storage;                                                  \
+    int addrlen = sizeof(storage);                                             \
+    sockaddr* const addr = (sockaddr*)(&storage);                              \
+    int err = function(iotjs_##wraptype##_##handletype(wrap), addr, &addrlen); \
+    if (err == 0)                                                              \
+      AddressToJS(JHANDLER_GET_ARG(0, object), addr);                          \
+    iotjs_jhandler_return_number(jhandler, err);                               \
+  }
+
+
+#endif /* IOTJS_MODULE_TCP_H */
diff --git a/src/modules/iotjs_module_testdriver.c b/src/modules/iotjs_module_testdriver.c
new file mode 100644 (file)
index 0000000..2e8a722
--- /dev/null
@@ -0,0 +1,71 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_module_timer.h"
+
+
+// Only for test driver
+JHANDLER_FUNCTION(IsAliveExceptFor) {
+  JHANDLER_CHECK(iotjs_jhandler_get_arg_length(jhandler) == 1);
+  const iotjs_environment_t* env = iotjs_environment_get();
+  uv_loop_t* loop = iotjs_environment_loop(env);
+
+  const iotjs_jval_t* arg0 = iotjs_jhandler_get_arg(jhandler, 0);
+
+  if (iotjs_jval_is_null(arg0)) {
+    int alive = uv_loop_alive(loop);
+
+    iotjs_jhandler_return_boolean(jhandler, alive);
+  } else {
+    JHANDLER_CHECK(iotjs_jval_is_object(arg0));
+
+    iotjs_jval_t jtimer =
+        iotjs_jval_get_property(arg0, IOTJS_MAGIC_STRING_HANDLER);
+
+    iotjs_timerwrap_t* timer_wrap = iotjs_timerwrap_from_jobject(&jtimer);
+    iotjs_jval_destroy(&jtimer);
+
+    bool has_active_reqs = uv_loop_has_active_reqs(loop);
+    bool has_closing_handler = loop->closing_handles != NULL;
+
+    bool ret = true;
+    bool alive = !has_active_reqs && !has_closing_handler;
+    if (alive) {
+      unsigned int active_handlers = loop->active_handles;
+      if (active_handlers == 1u) {
+        const uv_timer_t* timer_handle = iotjs_timerwrap_handle(timer_wrap);
+        int timer_alive = uv_is_active((uv_handle_t*)timer_handle);
+
+        if (timer_alive) {
+          // If the timer handler we set for test driver is alive,
+          // then it can be safely terminated.
+          ret = false;
+        }
+      }
+    }
+
+    iotjs_jhandler_return_boolean(jhandler, ret);
+  }
+}
+
+
+iotjs_jval_t InitTestdriver() {
+  iotjs_jval_t testdriver = iotjs_jval_create_object();
+  iotjs_jval_set_method(&testdriver, IOTJS_MAGIC_STRING_ISALIVEEXCEPTFOR,
+                        IsAliveExceptFor);
+
+  return testdriver;
+}
diff --git a/src/modules/iotjs_module_timer.c b/src/modules/iotjs_module_timer.c
new file mode 100644 (file)
index 0000000..c08b108
--- /dev/null
@@ -0,0 +1,175 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+#include "iotjs_module_timer.h"
+
+
+static void iotjs_timerwrap_destroy(iotjs_timerwrap_t* timerwrap);
+static void iotjs_timerwrap_on_timeout(iotjs_timerwrap_t* timerwrap);
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(timerwrap);
+
+
+iotjs_timerwrap_t* iotjs_timerwrap_create(const iotjs_jval_t* jtimer) {
+  iotjs_timerwrap_t* timerwrap = IOTJS_ALLOC(iotjs_timerwrap_t);
+  uv_timer_t* uv_timer = IOTJS_ALLOC(uv_timer_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_timerwrap_t, timerwrap);
+
+  iotjs_handlewrap_initialize(&_this->handlewrap, jtimer,
+                              (uv_handle_t*)(uv_timer),
+                              &this_module_native_info);
+
+  // Initialize timer handler.
+  const iotjs_environment_t* env = iotjs_environment_get();
+  uv_timer_init(iotjs_environment_loop(env), uv_timer);
+
+  return timerwrap;
+}
+
+
+static void iotjs_timerwrap_destroy(iotjs_timerwrap_t* timerwrap) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_timerwrap_t, timerwrap);
+  iotjs_handlewrap_destroy(&_this->handlewrap);
+
+  IOTJS_RELEASE(timerwrap);
+}
+
+static void TimoutHandlerDestroy(uv_handle_t* handle) {
+  IOTJS_RELEASE(handle);
+}
+
+// This function is called from uv when timeout expires.
+static void TimeoutHandler(uv_timer_t* handle) {
+  // Find timer wrap from handle.
+  iotjs_timerwrap_t* timer_wrap = iotjs_timerwrap_from_handle(handle);
+
+  // Call the timeout handler.
+  iotjs_timerwrap_on_timeout(timer_wrap);
+}
+
+
+int iotjs_timerwrap_start(iotjs_timerwrap_t* timerwrap, uint64_t timeout,
+                          uint64_t repeat) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_timerwrap_t, timerwrap);
+
+  // Start uv timer.
+  uv_timer_t* uv_timer =
+      (uv_timer_t*)iotjs_handlewrap_get_uv_handle(&_this->handlewrap);
+  return uv_timer_start(uv_timer, TimeoutHandler, timeout, repeat);
+}
+
+
+int iotjs_timerwrap_stop(iotjs_timerwrap_t* timerwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_timerwrap_t, timerwrap);
+
+  if (!uv_is_closing(iotjs_handlewrap_get_uv_handle(&_this->handlewrap))) {
+    iotjs_handlewrap_close(&_this->handlewrap, TimoutHandlerDestroy);
+  }
+
+  return 0;
+}
+
+
+static void iotjs_timerwrap_on_timeout(iotjs_timerwrap_t* timerwrap) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_timerwrap_t, timerwrap);
+
+  // Call javascript timeout handler function.
+  const iotjs_jval_t* jobject = iotjs_timerwrap_jobject(timerwrap);
+  iotjs_jval_t jcallback =
+      iotjs_jval_get_property(jobject, IOTJS_MAGIC_STRING_HANDLETIMEOUT);
+  iotjs_make_callback(&jcallback, jobject, iotjs_jargs_get_empty());
+  iotjs_jval_destroy(&jcallback);
+}
+
+
+uv_timer_t* iotjs_timerwrap_handle(iotjs_timerwrap_t* timerwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_timerwrap_t, timerwrap);
+  return (uv_timer_t*)iotjs_handlewrap_get_uv_handle(&_this->handlewrap);
+}
+
+
+iotjs_jval_t* iotjs_timerwrap_jobject(iotjs_timerwrap_t* timerwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_timerwrap_t, timerwrap);
+  iotjs_jval_t* jobject = iotjs_handlewrap_jobject(&_this->handlewrap);
+  IOTJS_ASSERT(iotjs_jval_is_object(jobject));
+  return jobject;
+}
+
+
+iotjs_timerwrap_t* iotjs_timerwrap_from_handle(uv_timer_t* timer_handle) {
+  uv_handle_t* handle = (uv_handle_t*)(timer_handle);
+  iotjs_handlewrap_t* handlewrap = iotjs_handlewrap_from_handle(handle);
+  iotjs_timerwrap_t* timerwrap = (iotjs_timerwrap_t*)handlewrap;
+  IOTJS_ASSERT(iotjs_timerwrap_handle(timerwrap) == timer_handle);
+  return timerwrap;
+}
+
+
+iotjs_timerwrap_t* iotjs_timerwrap_from_jobject(const iotjs_jval_t* jtimer) {
+  iotjs_handlewrap_t* handlewrap = iotjs_handlewrap_from_jobject(jtimer);
+  return (iotjs_timerwrap_t*)handlewrap;
+}
+
+
+JHANDLER_FUNCTION(Start) {
+  // Check parameters.
+  JHANDLER_DECLARE_THIS_PTR(timerwrap, timer_wrap);
+  JHANDLER_CHECK_ARGS(2, number, number);
+
+  // parameters.
+  uint64_t timeout = JHANDLER_GET_ARG(0, number);
+  uint64_t repeat = JHANDLER_GET_ARG(1, number);
+
+  // Start timer.
+  int res = iotjs_timerwrap_start(timer_wrap, timeout, repeat);
+
+  iotjs_jhandler_return_number(jhandler, res);
+}
+
+
+JHANDLER_FUNCTION(Stop) {
+  JHANDLER_DECLARE_THIS_PTR(timerwrap, timer_wrap);
+  // Stop timer.
+  int res = iotjs_timerwrap_stop(timer_wrap);
+
+  iotjs_jhandler_return_number(jhandler, res);
+}
+
+
+JHANDLER_FUNCTION(Timer) {
+  JHANDLER_CHECK_THIS(object);
+
+  const iotjs_jval_t* jtimer = JHANDLER_GET_THIS(object);
+
+  iotjs_timerwrap_t* timer_wrap = iotjs_timerwrap_create(jtimer);
+  IOTJS_ASSERT(iotjs_jval_is_object(iotjs_timerwrap_jobject(timer_wrap)));
+  IOTJS_ASSERT(iotjs_jval_get_object_native_handle(jtimer) != 0);
+}
+
+
+iotjs_jval_t InitTimer() {
+  iotjs_jval_t timer = iotjs_jval_create_function_with_dispatch(Timer);
+
+  iotjs_jval_t prototype = iotjs_jval_create_object();
+  iotjs_jval_set_property_jval(&timer, IOTJS_MAGIC_STRING_PROTOTYPE,
+                               &prototype);
+
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_START, Start);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_STOP, Stop);
+
+  iotjs_jval_destroy(&prototype);
+
+  return timer;
+}
diff --git a/src/modules/iotjs_module_timer.h b/src/modules/iotjs_module_timer.h
new file mode 100644 (file)
index 0000000..de03875
--- /dev/null
@@ -0,0 +1,44 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_MODULE_TIMER_H
+#define IOTJS_MODULE_TIMER_H
+
+
+#include "iotjs_binding.h"
+#include "iotjs_handlewrap.h"
+
+
+typedef struct {
+  iotjs_handlewrap_t handlewrap;
+} IOTJS_VALIDATED_STRUCT(iotjs_timerwrap_t);
+
+
+iotjs_timerwrap_t* iotjs_timerwrap_create(const iotjs_jval_t* jtimer);
+
+iotjs_timerwrap_t* iotjs_timerwrap_from_jobject(const iotjs_jval_t* jtimer);
+iotjs_timerwrap_t* iotjs_timerwrap_from_handle(uv_timer_t* timer_handle);
+
+uv_timer_t* iotjs_timerwrap_handle(iotjs_timerwrap_t* timerwrap);
+iotjs_jval_t* iotjs_timerwrap_jobject(iotjs_timerwrap_t* timerwrap);
+
+// Start timer.
+int iotjs_timerwrap_start(iotjs_timerwrap_t* timerwrap, uint64_t timeout,
+                          uint64_t repeat);
+// Stop & close timer.
+int iotjs_timerwrap_stop(iotjs_timerwrap_t* timerwrap);
+
+
+#endif /* IOTJS_MODULE_TIMER_H */
diff --git a/src/modules/iotjs_module_uart.c b/src/modules/iotjs_module_uart.c
new file mode 100644 (file)
index 0000000..dd2a83b
--- /dev/null
@@ -0,0 +1,354 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include <unistd.h>
+
+#include "iotjs_def.h"
+#include "iotjs_module_uart.h"
+#include "iotjs_objectwrap.h"
+
+
+static iotjs_uart_t* iotjs_uart_instance_from_jval(const iotjs_jval_t* juart);
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(uart);
+
+static iotjs_uart_t* iotjs_uart_create(const iotjs_jval_t* juart) {
+  iotjs_uart_t* uart = IOTJS_ALLOC(iotjs_uart_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_uart_t, uart);
+  iotjs_jobjectwrap_initialize(&_this->jobjectwrap, juart,
+                               &this_module_native_info);
+
+  _this->device_fd = -1;
+
+  return uart;
+}
+
+static void iotjs_uart_destroy(iotjs_uart_t* uart) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_uart_t, uart);
+  iotjs_jobjectwrap_destroy(&_this->jobjectwrap);
+  iotjs_string_destroy(&_this->device_path);
+  IOTJS_RELEASE(uart);
+}
+
+
+#define THIS iotjs_uart_reqwrap_t* uart_reqwrap
+
+
+static iotjs_uart_reqwrap_t* iotjs_uart_reqwrap_create(
+    const iotjs_jval_t* jcallback, iotjs_uart_t* uart, UartOp op) {
+  iotjs_uart_reqwrap_t* uart_reqwrap = IOTJS_ALLOC(iotjs_uart_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_uart_reqwrap_t, uart_reqwrap);
+
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+
+  _this->req_data.op = op;
+  _this->uart_instance = uart;
+
+  return uart_reqwrap;
+}
+
+
+static void iotjs_uart_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_uart_reqwrap_t, uart_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(uart_reqwrap);
+}
+
+
+static void iotjs_uart_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_uart_reqwrap_t, uart_reqwrap);
+  iotjs_uart_reqwrap_destroy(uart_reqwrap);
+}
+
+
+static uv_work_t* iotjs_uart_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_reqwrap_t, uart_reqwrap);
+  return &_this->req;
+}
+
+
+static const iotjs_jval_t* iotjs_uart_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_reqwrap_t, uart_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+
+static iotjs_uart_t* iotjs_uart_instance_from_jval(const iotjs_jval_t* juart) {
+  iotjs_jobjectwrap_t* jobjectwrap = iotjs_jobjectwrap_from_jobject(juart);
+  return (iotjs_uart_t*)jobjectwrap;
+}
+
+
+iotjs_uart_reqwrap_t* iotjs_uart_reqwrap_from_request(uv_work_t* req) {
+  return (iotjs_uart_reqwrap_t*)(iotjs_reqwrap_from_request((uv_req_t*)req));
+}
+
+
+iotjs_uart_reqdata_t* iotjs_uart_reqwrap_data(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_reqwrap_t, uart_reqwrap);
+  return &_this->req_data;
+}
+
+
+iotjs_uart_t* iotjs_uart_instance_from_reqwrap(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_reqwrap_t, uart_reqwrap);
+  return _this->uart_instance;
+}
+
+
+#undef THIS
+
+
+static bool iotjs_uart_close(iotjs_uart_t* uart) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+  uv_poll_t* poll_handle = &_this->poll_handle;
+
+  if (_this->device_fd > 0) {
+    if (!uv_is_closing((uv_handle_t*)poll_handle)) {
+      uv_close((uv_handle_t*)poll_handle, NULL);
+    }
+    if (close(_this->device_fd) < 0) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
+
+static void iotjs_uart_write_worker(uv_work_t* work_req) {
+  UART_WORKER_INIT;
+
+  if (!iotjs_uart_write(uart)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+static void iotjs_uart_close_worker(uv_work_t* work_req) {
+  UART_WORKER_INIT;
+
+  if (!iotjs_uart_close(uart)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+static void iotjs_uart_after_worker(uv_work_t* work_req, int status) {
+  iotjs_uart_reqwrap_t* req_wrap = iotjs_uart_reqwrap_from_request(work_req);
+  iotjs_uart_reqdata_t* req_data = iotjs_uart_reqwrap_data(req_wrap);
+
+  iotjs_jargs_t jargs = iotjs_jargs_create(1);
+
+  if (status) {
+    iotjs_jval_t error = iotjs_jval_create_error("System error");
+    iotjs_jargs_append_jval(&jargs, &error);
+    iotjs_jval_destroy(&error);
+  } else {
+    switch (req_data->op) {
+      case kUartOpOpen: {
+        if (!req_data->result) {
+          iotjs_jargs_append_error(&jargs, "Failed to open UART device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      }
+      case kUartOpWrite: {
+        iotjs_uart_t* uart = iotjs_uart_instance_from_reqwrap(req_wrap);
+        IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+
+        iotjs_string_destroy(&_this->buf_data);
+
+        if (!req_data->result) {
+          iotjs_jargs_append_error(&jargs, "Cannot write to device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      }
+      case kUartOpClose: {
+        if (!req_data->result) {
+          iotjs_jargs_append_error(&jargs, "Failed to close UART device");
+        } else {
+          iotjs_jargs_append_null(&jargs);
+        }
+        break;
+      }
+      default: {
+        IOTJS_ASSERT(!"Unreachable");
+        break;
+      }
+    }
+  }
+
+  const iotjs_jval_t* jcallback = iotjs_uart_reqwrap_jcallback(req_wrap);
+  iotjs_make_callback(jcallback, iotjs_jval_get_undefined(), &jargs);
+
+  iotjs_jargs_destroy(&jargs);
+  iotjs_uart_reqwrap_dispatched(req_wrap);
+}
+
+
+static void iotjs_uart_onread(iotjs_jval_t* jthis, char* buf) {
+  iotjs_jval_t jemit = iotjs_jval_get_property(jthis, "emit");
+  IOTJS_ASSERT(iotjs_jval_is_function(&jemit));
+
+  iotjs_jargs_t jargs = iotjs_jargs_create(2);
+  iotjs_jval_t str = iotjs_jval_create_string_raw("data");
+  iotjs_jval_t data = iotjs_jval_create_string_raw(buf);
+  iotjs_jargs_append_jval(&jargs, &str);
+  iotjs_jargs_append_jval(&jargs, &data);
+  iotjs_jhelper_call_ok(&jemit, jthis, &jargs);
+
+  iotjs_jval_destroy(&str);
+  iotjs_jval_destroy(&data);
+  iotjs_jargs_destroy(&jargs);
+  iotjs_jval_destroy(&jemit);
+}
+
+
+void iotjs_uart_read_cb(uv_poll_t* req, int status, int events) {
+  iotjs_uart_t* uart = (iotjs_uart_t*)req->data;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+
+  char buf[UART_WRITE_BUFFER_SIZE];
+  int i = read(_this->device_fd, buf, UART_WRITE_BUFFER_SIZE - 1);
+  if (i > 0) {
+    buf[i] = '\0';
+    DDDLOG("%s - read data: %s", __func__, buf);
+    iotjs_uart_onread(&_this->jemitter_this, buf);
+  }
+}
+
+
+#define UART_ASYNC(call, this, jcallback, op)                          \
+  do {                                                                 \
+    uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get()); \
+    iotjs_uart_reqwrap_t* req_wrap =                                   \
+        iotjs_uart_reqwrap_create(jcallback, this, op);                \
+    uv_work_t* req = iotjs_uart_reqwrap_req(req_wrap);                 \
+    uv_queue_work(loop, req, iotjs_uart_##call##_worker,               \
+                  iotjs_uart_after_worker);                            \
+  } while (0)
+
+
+JHANDLER_FUNCTION(UartConstructor) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(3, object, object, function);
+
+  // Create UART object
+  const iotjs_jval_t* juart = JHANDLER_GET_THIS(object);
+  iotjs_uart_t* uart = iotjs_uart_create(juart);
+  IOTJS_ASSERT(uart == iotjs_uart_instance_from_jval(juart));
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+
+  const iotjs_jval_t* jconfiguration = JHANDLER_GET_ARG(0, object);
+  const iotjs_jval_t* jemitter_this = JHANDLER_GET_ARG(1, object);
+  _this->jemitter_this = iotjs_jval_create_copied(jemitter_this);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(2, function);
+
+  // set configuration
+  iotjs_jval_t jdevice =
+      iotjs_jval_get_property(jconfiguration, IOTJS_MAGIC_STRING_DEVICE);
+  iotjs_jval_t jbaud_rate =
+      iotjs_jval_get_property(jconfiguration, IOTJS_MAGIC_STRING_BAUDRATE);
+  iotjs_jval_t jdata_bits =
+      iotjs_jval_get_property(jconfiguration, IOTJS_MAGIC_STRING_DATABITS);
+
+  _this->device_path = iotjs_jval_as_string(&jdevice);
+  _this->baud_rate = iotjs_jval_as_number(&jbaud_rate);
+  _this->data_bits = iotjs_jval_as_number(&jdata_bits);
+
+  DDDLOG("%s - path: %s, baudRate: %d, dataBits: %d", __func__,
+         iotjs_string_data(&_this->device_path), _this->baud_rate,
+         _this->data_bits);
+
+  iotjs_jval_destroy(&jdevice);
+  iotjs_jval_destroy(&jbaud_rate);
+  iotjs_jval_destroy(&jdata_bits);
+
+  UART_ASYNC(open, uart, jcallback, kUartOpOpen);
+}
+
+
+JHANDLER_FUNCTION(Write) {
+  JHANDLER_DECLARE_THIS_PTR(uart, uart);
+  DJHANDLER_CHECK_ARGS(1, string);
+  DJHANDLER_CHECK_ARG_IF_EXIST(1, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(1, function);
+
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+
+  _this->buf_data = JHANDLER_GET_ARG(0, string);
+  _this->buf_len = iotjs_string_size(&_this->buf_data);
+
+  if (jcallback) {
+    UART_ASYNC(write, uart, jcallback, kUartOpWrite);
+  } else {
+    bool result = iotjs_uart_write(uart);
+    iotjs_string_destroy(&_this->buf_data);
+
+    if (!result) {
+      JHANDLER_THROW(COMMON, "UART Write Error");
+      return;
+    }
+  }
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+JHANDLER_FUNCTION(Close) {
+  JHANDLER_DECLARE_THIS_PTR(uart, uart);
+  DJHANDLER_CHECK_ARG_IF_EXIST(0, function);
+
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG_IF_EXIST(0, function);
+
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+  iotjs_jval_destroy(&_this->jemitter_this);
+
+  if (jcallback) {
+    UART_ASYNC(close, uart, jcallback, kUartOpClose);
+  } else {
+    if (!iotjs_uart_close(uart)) {
+      JHANDLER_THROW(COMMON, "UART Close Error");
+    }
+  }
+}
+
+
+iotjs_jval_t InitUart() {
+  iotjs_jval_t juart_constructor =
+      iotjs_jval_create_function_with_dispatch(UartConstructor);
+
+  iotjs_jval_t prototype = iotjs_jval_create_object();
+
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_WRITE, Write);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_CLOSE, Close);
+
+  iotjs_jval_set_property_jval(&juart_constructor, IOTJS_MAGIC_STRING_PROTOTYPE,
+                               &prototype);
+
+  iotjs_jval_destroy(&prototype);
+
+  return juart_constructor;
+}
diff --git a/src/modules/iotjs_module_uart.h b/src/modules/iotjs_module_uart.h
new file mode 100644 (file)
index 0000000..3b1c72f
--- /dev/null
@@ -0,0 +1,82 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_UART_H
+#define IOTJS_MODULE_UART_H
+
+#include "iotjs_def.h"
+#include "iotjs_objectwrap.h"
+#include "iotjs_reqwrap.h"
+
+
+#define UART_WRITE_BUFFER_SIZE 512
+
+
+typedef enum {
+  kUartOpOpen,
+  kUartOpClose,
+  kUartOpWrite,
+} UartOp;
+
+
+typedef struct {
+  iotjs_jobjectwrap_t jobjectwrap;
+  iotjs_jval_t jemitter_this;
+  int device_fd;
+  int baud_rate;
+  uint8_t data_bits;
+  iotjs_string_t device_path;
+  iotjs_string_t buf_data;
+  unsigned buf_len;
+  uv_poll_t poll_handle;
+} IOTJS_VALIDATED_STRUCT(iotjs_uart_t);
+
+
+typedef struct {
+  UartOp op;
+  bool result;
+} iotjs_uart_reqdata_t;
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_work_t req;
+  iotjs_uart_reqdata_t req_data;
+  iotjs_uart_t* uart_instance;
+} IOTJS_VALIDATED_STRUCT(iotjs_uart_reqwrap_t);
+
+#define THIS iotjs_uart_reqwrap_t* uart_reqwrap
+
+iotjs_uart_reqwrap_t* iotjs_uart_reqwrap_from_request(uv_work_t* req);
+iotjs_uart_reqdata_t* iotjs_uart_reqwrap_data(THIS);
+
+iotjs_uart_t* iotjs_uart_instance_from_reqwrap(THIS);
+
+#undef THIS
+
+
+#define UART_WORKER_INIT                                                      \
+  iotjs_uart_reqwrap_t* req_wrap = iotjs_uart_reqwrap_from_request(work_req); \
+  iotjs_uart_reqdata_t* req_data = iotjs_uart_reqwrap_data(req_wrap);         \
+  iotjs_uart_t* uart = iotjs_uart_instance_from_reqwrap(req_wrap);
+
+
+void iotjs_uart_read_cb(uv_poll_t* req, int status, int events);
+
+void iotjs_uart_open_worker(uv_work_t* work_req);
+bool iotjs_uart_write(iotjs_uart_t* uart);
+
+#endif /* IOTJS_MODULE_UART_H */
diff --git a/src/modules/iotjs_module_udp.c b/src/modules/iotjs_module_udp.c
new file mode 100644 (file)
index 0000000..635cd7a
--- /dev/null
@@ -0,0 +1,488 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#include "iotjs_def.h"
+
+#include "iotjs_module_udp.h"
+
+#include "iotjs_handlewrap.h"
+#include "iotjs_module_buffer.h"
+#include "iotjs_module_tcp.h"
+#include "iotjs_reqwrap.h"
+
+
+IOTJS_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(udpwrap);
+
+
+iotjs_udpwrap_t* iotjs_udpwrap_create(const iotjs_jval_t* judp) {
+  iotjs_udpwrap_t* udpwrap = IOTJS_ALLOC(iotjs_udpwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_udpwrap_t, udpwrap);
+
+  iotjs_handlewrap_initialize(&_this->handlewrap, judp,
+                              (uv_handle_t*)(&_this->handle),
+                              &this_module_native_info);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+  uv_udp_init(iotjs_environment_loop(env), &_this->handle);
+
+  return udpwrap;
+}
+
+
+static void iotjs_udpwrap_destroy(iotjs_udpwrap_t* udpwrap) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_udpwrap_t, udpwrap);
+  iotjs_handlewrap_destroy(&_this->handlewrap);
+  IOTJS_RELEASE(udpwrap);
+}
+
+
+iotjs_udpwrap_t* iotjs_udpwrap_from_handle(uv_udp_t* udp_handle) {
+  uv_handle_t* handle = (uv_handle_t*)(udp_handle);
+  iotjs_handlewrap_t* handlewrap = iotjs_handlewrap_from_handle(handle);
+  iotjs_udpwrap_t* udpwrap = (iotjs_udpwrap_t*)handlewrap;
+  IOTJS_ASSERT(iotjs_udpwrap_udp_handle(udpwrap) == udp_handle);
+  return udpwrap;
+}
+
+
+iotjs_udpwrap_t* iotjs_udpwrap_from_jobject(const iotjs_jval_t* judp) {
+  iotjs_handlewrap_t* handlewrap = iotjs_handlewrap_from_jobject(judp);
+  return (iotjs_udpwrap_t*)handlewrap;
+}
+
+
+uv_udp_t* iotjs_udpwrap_udp_handle(iotjs_udpwrap_t* udpwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_udpwrap_t, udpwrap);
+  uv_handle_t* handle = iotjs_handlewrap_get_uv_handle(&_this->handlewrap);
+  return (uv_udp_t*)handle;
+}
+
+
+iotjs_jval_t* iotjs_udpwrap_jobject(iotjs_udpwrap_t* udpwrap) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_udpwrap_t, udpwrap);
+  return iotjs_handlewrap_jobject(&_this->handlewrap);
+}
+
+
+#define THIS iotjs_send_reqwrap_t* send_reqwrap
+
+iotjs_send_reqwrap_t* iotjs_send_reqwrap_create(const iotjs_jval_t* jcallback,
+                                                const size_t msg_size) {
+  iotjs_send_reqwrap_t* send_reqwrap = IOTJS_ALLOC(iotjs_send_reqwrap_t);
+  IOTJS_VALIDATED_STRUCT_CONSTRUCTOR(iotjs_send_reqwrap_t, send_reqwrap);
+
+  iotjs_reqwrap_initialize(&_this->reqwrap, jcallback, (uv_req_t*)&_this->req);
+  _this->msg_size = msg_size;
+
+  return send_reqwrap;
+}
+
+
+static void iotjs_send_reqwrap_destroy(THIS) {
+  IOTJS_VALIDATED_STRUCT_DESTRUCTOR(iotjs_send_reqwrap_t, send_reqwrap);
+  iotjs_reqwrap_destroy(&_this->reqwrap);
+  IOTJS_RELEASE(send_reqwrap);
+}
+
+
+void iotjs_send_reqwrap_dispatched(THIS) {
+  IOTJS_VALIDATABLE_STRUCT_METHOD_VALIDATE(iotjs_send_reqwrap_t, send_reqwrap);
+  iotjs_send_reqwrap_destroy(send_reqwrap);
+}
+
+
+uv_udp_send_t* iotjs_send_reqwrap_req(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_send_reqwrap_t, send_reqwrap);
+  return &_this->req;
+}
+
+
+const iotjs_jval_t* iotjs_send_reqwrap_jcallback(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_send_reqwrap_t, send_reqwrap);
+  return iotjs_reqwrap_jcallback(&_this->reqwrap);
+}
+
+
+size_t iotjs_send_reqwrap_msg_size(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_send_reqwrap_t, send_reqwrap);
+  return _this->msg_size;
+}
+
+#undef THIS
+
+
+JHANDLER_FUNCTION(UDP) {
+  DJHANDLER_CHECK_THIS(object);
+  DJHANDLER_CHECK_ARGS(0);
+
+  const iotjs_jval_t* judp = JHANDLER_GET_THIS(object);
+  iotjs_udpwrap_t* udp_wrap = iotjs_udpwrap_create(judp);
+  IOTJS_UNUSED(udp_wrap);
+}
+
+
+JHANDLER_FUNCTION(Bind) {
+  JHANDLER_DECLARE_THIS_PTR(udpwrap, udp_wrap);
+  DJHANDLER_CHECK_ARGS(2, string, number);
+
+  iotjs_string_t address = JHANDLER_GET_ARG(0, string);
+  const int port = JHANDLER_GET_ARG(1, number);
+  const iotjs_jval_t* this_obj = JHANDLER_GET_THIS(object);
+  iotjs_jval_t reuse_addr =
+      iotjs_jval_get_property(this_obj, IOTJS_MAGIC_STRING__REUSEADDR);
+  IOTJS_ASSERT(iotjs_jval_is_boolean(&reuse_addr) ||
+               iotjs_jval_is_undefined(&reuse_addr));
+
+  unsigned int flags = 0;
+  if (!iotjs_jval_is_undefined(&reuse_addr)) {
+    flags = iotjs_jval_as_boolean(&reuse_addr) ? UV_UDP_REUSEADDR : 0;
+  }
+
+  char addr[sizeof(sockaddr_in6)];
+  int err =
+      uv_ip4_addr(iotjs_string_data(&address), port, (sockaddr_in*)(&addr));
+
+  if (err == 0) {
+    err = uv_udp_bind(iotjs_udpwrap_udp_handle(udp_wrap),
+                      (const sockaddr*)(&addr), flags);
+  }
+
+  iotjs_jhandler_return_number(jhandler, err);
+
+  iotjs_jval_destroy(&reuse_addr);
+  iotjs_string_destroy(&address);
+}
+
+
+static void OnAlloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {
+  if (suggested_size > IOTJS_MAX_READ_BUFFER_SIZE) {
+    suggested_size = IOTJS_MAX_READ_BUFFER_SIZE;
+  }
+
+  buf->base = iotjs_buffer_allocate(suggested_size);
+  buf->len = suggested_size;
+}
+
+
+static void OnRecv(uv_udp_t* handle, ssize_t nread, const uv_buf_t* buf,
+                   const struct sockaddr* addr, unsigned int flags) {
+  if (nread == 0 && addr == NULL) {
+    if (buf->base != NULL)
+      iotjs_buffer_release(buf->base);
+    return;
+  }
+
+  iotjs_udpwrap_t* udp_wrap = iotjs_udpwrap_from_handle(handle);
+
+  // udp handle
+  const iotjs_jval_t* judp = iotjs_udpwrap_jobject(udp_wrap);
+  IOTJS_ASSERT(iotjs_jval_is_object(judp));
+
+  // onmessage callback
+  iotjs_jval_t jonmessage =
+      iotjs_jval_get_property(judp, IOTJS_MAGIC_STRING_ONMESSAGE);
+  IOTJS_ASSERT(iotjs_jval_is_function(&jonmessage));
+
+  iotjs_jargs_t jargs = iotjs_jargs_create(4);
+  iotjs_jargs_append_number(&jargs, nread);
+  iotjs_jargs_append_jval(&jargs, judp);
+
+  if (nread < 0) {
+    if (buf->base != NULL)
+      iotjs_buffer_release(buf->base);
+    iotjs_make_callback(&jonmessage, iotjs_jval_get_undefined(), &jargs);
+    iotjs_jval_destroy(&jonmessage);
+    iotjs_jargs_destroy(&jargs);
+    return;
+  }
+
+  iotjs_jval_t jbuffer = iotjs_bufferwrap_create_buffer((size_t)nread);
+  iotjs_bufferwrap_t* buffer_wrap = iotjs_bufferwrap_from_jbuffer(&jbuffer);
+
+  iotjs_bufferwrap_copy(buffer_wrap, buf->base, (size_t)nread);
+
+  iotjs_jargs_append_jval(&jargs, &jbuffer);
+
+  iotjs_jval_t rinfo = iotjs_jval_create_object();
+  AddressToJS(&rinfo, addr);
+  iotjs_jargs_append_jval(&jargs, &rinfo);
+
+  iotjs_make_callback(&jonmessage, iotjs_jval_get_undefined(), &jargs);
+
+  iotjs_jval_destroy(&rinfo);
+  iotjs_jval_destroy(&jbuffer);
+  iotjs_jval_destroy(&jonmessage);
+  iotjs_buffer_release(buf->base);
+  iotjs_jargs_destroy(&jargs);
+}
+
+
+JHANDLER_FUNCTION(RecvStart) {
+  JHANDLER_DECLARE_THIS_PTR(udpwrap, udp_wrap);
+  DJHANDLER_CHECK_ARGS(0);
+
+  int err =
+      uv_udp_recv_start(iotjs_udpwrap_udp_handle(udp_wrap), OnAlloc, OnRecv);
+
+  // UV_EALREADY means that the socket is already bound but that's okay
+  if (err == UV_EALREADY)
+    err = 0;
+
+  iotjs_jhandler_return_number(jhandler, err);
+}
+
+
+JHANDLER_FUNCTION(RecvStop) {
+  JHANDLER_DECLARE_THIS_PTR(udpwrap, udp_wrap);
+  DJHANDLER_CHECK_ARGS(0);
+
+  int r = uv_udp_recv_stop(iotjs_udpwrap_udp_handle(udp_wrap));
+
+  iotjs_jhandler_return_number(jhandler, r);
+}
+
+
+static void OnSend(uv_udp_send_t* req, int status) {
+  iotjs_send_reqwrap_t* req_wrap = (iotjs_send_reqwrap_t*)(req->data);
+  IOTJS_ASSERT(req_wrap != NULL);
+
+  // Take callback function object.
+  const iotjs_jval_t* jcallback = iotjs_send_reqwrap_jcallback(req_wrap);
+
+  if (iotjs_jval_is_function(jcallback)) {
+    // Take callback function object.
+
+    iotjs_jargs_t jargs = iotjs_jargs_create(2);
+    iotjs_jargs_append_number(&jargs, status);
+    iotjs_jargs_append_number(&jargs, iotjs_send_reqwrap_msg_size(req_wrap));
+
+    iotjs_make_callback(jcallback, iotjs_jval_get_undefined(), &jargs);
+    iotjs_jargs_destroy(&jargs);
+  }
+
+  iotjs_send_reqwrap_dispatched(req_wrap);
+}
+
+
+// Send messages using the socket.
+// [0] buffer
+// [1] port
+// [2] ip
+// [3] callback function
+JHANDLER_FUNCTION(Send) {
+  JHANDLER_DECLARE_THIS_PTR(udpwrap, udp_wrap);
+  DJHANDLER_CHECK_ARGS(3, object, number, string);
+  IOTJS_ASSERT(iotjs_jval_is_function(iotjs_jhandler_get_arg(jhandler, 3)) ||
+               iotjs_jval_is_undefined(iotjs_jhandler_get_arg(jhandler, 3)));
+
+  const iotjs_jval_t* jbuffer = JHANDLER_GET_ARG(0, object);
+  const unsigned short port = JHANDLER_GET_ARG(1, number);
+  iotjs_string_t address = JHANDLER_GET_ARG(2, string);
+  const iotjs_jval_t* jcallback = JHANDLER_GET_ARG(3, object);
+
+  iotjs_bufferwrap_t* buffer_wrap = iotjs_bufferwrap_from_jbuffer(jbuffer);
+  char* buffer = iotjs_bufferwrap_buffer(buffer_wrap);
+  size_t len = iotjs_bufferwrap_length(buffer_wrap);
+
+  iotjs_send_reqwrap_t* req_wrap = iotjs_send_reqwrap_create(jcallback, len);
+
+  uv_buf_t buf;
+  buf.base = buffer;
+  buf.len = len;
+
+  char addr[sizeof(sockaddr_in6)];
+  int err =
+      uv_ip4_addr(iotjs_string_data(&address), port, (sockaddr_in*)(&addr));
+
+  if (err == 0) {
+    err = uv_udp_send(iotjs_send_reqwrap_req(req_wrap),
+                      iotjs_udpwrap_udp_handle(udp_wrap), &buf, 1,
+                      (const sockaddr*)(&addr), OnSend);
+  }
+
+  if (err) {
+    iotjs_send_reqwrap_dispatched(req_wrap);
+  }
+
+  iotjs_jhandler_return_number(jhandler, err);
+
+  iotjs_string_destroy(&address);
+}
+
+
+// Close socket
+JHANDLER_FUNCTION(Close) {
+  JHANDLER_DECLARE_THIS_PTR(handlewrap, wrap);
+  DJHANDLER_CHECK_ARGS(0);
+
+  iotjs_handlewrap_close(wrap, NULL);
+}
+
+
+GetSockNameFunction(udpwrap, udp_handle, uv_udp_getsockname);
+
+
+JHANDLER_FUNCTION(GetSockeName) {
+  DoGetSockName(jhandler);
+}
+
+
+#define IOTJS_UV_SET_SOCKOPT(fn)                          \
+  JHANDLER_DECLARE_THIS_PTR(udpwrap, udp_wrap);           \
+  DJHANDLER_CHECK_ARGS(1, number);                        \
+                                                          \
+  int flag = JHANDLER_GET_ARG(0, number);                 \
+  int err = fn(iotjs_udpwrap_udp_handle(udp_wrap), flag); \
+                                                          \
+  iotjs_jhandler_return_number(jhandler, err);
+
+
+JHANDLER_FUNCTION(SetBroadcast) {
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  IOTJS_UV_SET_SOCKOPT(uv_udp_set_broadcast);
+#else
+  IOTJS_ASSERT(!"Not implemented");
+
+  iotjs_jhandler_return_null(jhandler);
+#endif
+}
+
+
+JHANDLER_FUNCTION(SetTTL) {
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  IOTJS_UV_SET_SOCKOPT(uv_udp_set_ttl);
+#else
+  IOTJS_ASSERT(!"Not implemented");
+
+  iotjs_jhandler_return_null(jhandler);
+#endif
+}
+
+
+JHANDLER_FUNCTION(SetMulticastTTL) {
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  IOTJS_UV_SET_SOCKOPT(uv_udp_set_multicast_ttl);
+#else
+  IOTJS_ASSERT(!"Not implemented");
+
+  iotjs_jhandler_return_null(jhandler);
+#endif
+}
+
+
+JHANDLER_FUNCTION(SetMulticastLoopback) {
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  IOTJS_UV_SET_SOCKOPT(uv_udp_set_multicast_loop);
+#else
+  IOTJS_ASSERT(!"Not implemented");
+
+  iotjs_jhandler_return_null(jhandler);
+#endif
+}
+
+#undef IOTJS_UV_SET_SOCKOPT
+
+
+void SetMembership(iotjs_jhandler_t* jhandler, uv_membership membership) {
+#if !defined(__NUTTX__) && !defined(__TIZENRT__)
+  JHANDLER_DECLARE_THIS_PTR(udpwrap, udp_wrap);
+  DJHANDLER_CHECK_ARGS(1, string);
+
+  iotjs_string_t address = JHANDLER_GET_ARG(0, string);
+  const iotjs_jval_t* arg1 = iotjs_jhandler_get_arg(jhandler, 1);
+  bool isUndefinedOrNull =
+      iotjs_jval_is_undefined(arg1) || iotjs_jval_is_null(arg1);
+  iotjs_string_t iface;
+
+  const char* iface_cstr;
+  if (isUndefinedOrNull) {
+    iface_cstr = NULL;
+  } else {
+    iface = iotjs_jval_as_string(arg1);
+    iface_cstr = iotjs_string_data(&iface);
+  }
+
+  int err = uv_udp_set_membership(iotjs_udpwrap_udp_handle(udp_wrap),
+                                  iotjs_string_data(&address), iface_cstr,
+                                  membership);
+
+  iotjs_jhandler_return_number(jhandler, err);
+
+  iotjs_string_destroy(&address);
+  if (!isUndefinedOrNull)
+    iotjs_string_destroy(&iface);
+#else
+  IOTJS_ASSERT(!"Not implemented");
+
+  iotjs_jhandler_return_null(jhandler);
+#endif
+}
+
+
+JHANDLER_FUNCTION(AddMembership) {
+  SetMembership(jhandler, UV_JOIN_GROUP);
+}
+
+
+JHANDLER_FUNCTION(DropMembership) {
+  SetMembership(jhandler, UV_LEAVE_GROUP);
+}
+
+
+JHANDLER_FUNCTION(Ref) {
+  IOTJS_ASSERT(!"Not implemented");
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+JHANDLER_FUNCTION(Unref) {
+  IOTJS_ASSERT(!"Not implemented");
+
+  iotjs_jhandler_return_null(jhandler);
+}
+
+
+iotjs_jval_t InitUdp() {
+  iotjs_jval_t udp = iotjs_jval_create_function_with_dispatch(UDP);
+
+  iotjs_jval_t prototype = iotjs_jval_create_object();
+  iotjs_jval_set_property_jval(&udp, IOTJS_MAGIC_STRING_PROTOTYPE, &prototype);
+
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_BIND, Bind);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_RECVSTART, RecvStart);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_RECVSTOP, RecvStop);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_SEND, Send);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_CLOSE, Close);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_GETSOCKNAME,
+                        GetSockeName);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_SETBROADCAST,
+                        SetBroadcast);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_SETTTL, SetTTL);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_SETMULTICASTTTL,
+                        SetMulticastTTL);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_SETMULTICASTLOOPBACK,
+                        SetMulticastLoopback);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_ADDMEMBERSHIP,
+                        AddMembership);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_DROPMEMBERSHIP,
+                        DropMembership);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_REF, Ref);
+  iotjs_jval_set_method(&prototype, IOTJS_MAGIC_STRING_UNREF, Unref);
+
+  iotjs_jval_destroy(&prototype);
+
+  return udp;
+}
diff --git a/src/modules/iotjs_module_udp.h b/src/modules/iotjs_module_udp.h
new file mode 100644 (file)
index 0000000..2d9e669
--- /dev/null
@@ -0,0 +1,60 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_UDP_H
+#define IOTJS_MODULE_UDP_H
+
+
+#include "iotjs_def.h"
+#include "iotjs_handlewrap.h"
+#include "iotjs_reqwrap.h"
+
+
+typedef struct {
+  iotjs_handlewrap_t handlewrap;
+  uv_udp_t handle;
+} IOTJS_VALIDATED_STRUCT(iotjs_udpwrap_t);
+
+
+iotjs_udpwrap_t* iotjs_udpwrap_create(const iotjs_jval_t* judp);
+
+iotjs_udpwrap_t* iotjs_udpwrap_from_handle(uv_udp_t* handle);
+iotjs_udpwrap_t* iotjs_udpwrap_from_jobject(const iotjs_jval_t* judp);
+
+uv_udp_t* iotjs_udpwrap_udp_handle(iotjs_udpwrap_t* udpwrap);
+iotjs_jval_t* iotjs_udpwrap_jobject(iotjs_udpwrap_t* udpwrap);
+
+
+typedef struct {
+  iotjs_reqwrap_t reqwrap;
+  uv_udp_send_t req;
+  size_t msg_size;
+} IOTJS_VALIDATED_STRUCT(iotjs_send_reqwrap_t);
+
+#define THIS iotjs_send_reqwrap_t* send_reqwrap
+
+iotjs_send_reqwrap_t* iotjs_send_reqwrap_create(const iotjs_jval_t* jcallback,
+                                                const size_t msg_size);
+
+void iotjs_send_reqwrap_dispatched(THIS);
+
+uv_udp_send_t* iotjs_send_reqwrap_req(THIS);
+const iotjs_jval_t* iotjs_send_reqwrap_jcallback(THIS);
+
+#undef THIS
+
+
+#endif /* IOTJS_MODULE_UDP_H */
diff --git a/src/platform/linux/iotjs_module_adc-linux.c b/src/platform/linux/iotjs_module_adc-linux.c
new file mode 100644 (file)
index 0000000..930370c
--- /dev/null
@@ -0,0 +1,68 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_MODULE_ADC_LINUX_GENERAL_INL_H
+#define IOTJS_MODULE_ADC_LINUX_GENERAL_INL_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "iotjs_systemio-linux.h"
+#include "modules/iotjs_module_adc.h"
+
+
+#define ADC_PIN_FORMAT ADC_INTERFACE ADC_PIN_INTERFACE
+
+#define ADC_PATH_BUFFER_SIZE DEVICE_IO_PATH_BUFFER_SIZE
+#define ADC_PIN_BUFFER_SIZE DEVICE_IO_PIN_BUFFER_SIZE
+#define ADC_VALUE_BUFFER_SIZE 64
+
+
+// Implementation used here are based on:
+//  https://www.kernel.org/doc/Documentation/adc/sysfs.txt
+
+int32_t iotjs_adc_read(iotjs_adc_t* adc) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_t, adc);
+
+  const char* device_path = iotjs_string_data(&_this->device);
+  char buffer[ADC_VALUE_BUFFER_SIZE];
+
+  if (!iotjs_systemio_open_read_close(device_path, buffer, sizeof(buffer))) {
+    return -1;
+  }
+
+  return atoi(buffer);
+}
+
+
+bool iotjs_adc_close(iotjs_adc_t* adc) {
+  return true;
+}
+
+void iotjs_adc_open_worker(uv_work_t* work_req) {
+  ADC_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_t, adc);
+
+  DDDLOG("%s()", __func__);
+  const char* device_path = iotjs_string_data(&_this->device);
+
+  // Check if ADC interface exists.
+  req_data->result = iotjs_systemio_check_path(device_path);
+}
+
+
+#endif /* IOTJS_MODULE_ADC_LINUX_GENERAL_INL_H */
diff --git a/src/platform/linux/iotjs_module_blehcisocket-linux.c b/src/platform/linux/iotjs_module_blehcisocket-linux.c
new file mode 100644 (file)
index 0000000..776adfa
--- /dev/null
@@ -0,0 +1,469 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef IOTJS_MODULE_BLE_HCI_SOCKET_LINUX_GENERAL_INL_H
+#define IOTJS_MODULE_BLE_HCI_SOCKET_LINUX_GENERAL_INL_H
+
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "iotjs_def.h"
+#include "modules/iotjs_module_blehcisocket.h"
+#include "modules/iotjs_module_buffer.h"
+
+#define BTPROTO_L2CAP 0
+#define BTPROTO_HCI 1
+
+#define SOL_HCI 0
+#define HCI_FILTER 2
+
+#define HCIGETDEVLIST _IOR('H', 210, int)
+#define HCIGETDEVINFO _IOR('H', 211, int)
+
+#define HCI_CHANNEL_RAW 0
+#define HCI_CHANNEL_USER 1
+#define HCI_CHANNEL_CONTROL 3
+
+#define HCI_DEV_NONE 0xffff
+
+#define HCI_MAX_DEV 16
+
+#define ATT_CID 4
+
+enum {
+  HCI_UP,
+  HCI_INIT,
+  HCI_RUNNING,
+
+  HCI_PSCAN,
+  HCI_ISCAN,
+  HCI_AUTH,
+  HCI_ENCRYPT,
+  HCI_INQUIRY,
+
+  HCI_RAW,
+};
+
+struct sockaddr_hci {
+  sa_family_t hci_family;
+  unsigned short hci_dev;
+  unsigned short hci_channel;
+};
+
+struct hci_dev_req {
+  uint16_t dev_id;
+  uint32_t dev_opt;
+};
+
+struct hci_dev_list_req {
+  uint16_t dev_num;
+  struct hci_dev_req dev_req[0];
+};
+
+typedef struct hci_dev_list_req hci_dev_list_req_type;
+
+typedef struct { uint8_t b[6]; } __attribute__((packed)) bdaddr_t;
+
+struct hci_dev_info {
+  uint16_t dev_id;
+  char name[8];
+
+  bdaddr_t bdaddr;
+
+  uint32_t flags;
+  uint8_t type;
+
+  uint8_t features[8];
+
+  uint32_t pkt_type;
+  uint32_t link_policy;
+  uint32_t link_mode;
+
+  uint16_t acl_mtu;
+  uint16_t acl_pkts;
+  uint16_t sco_mtu;
+  uint16_t sco_pkts;
+
+  // hci_dev_stats
+  uint32_t err_rx;
+  uint32_t err_tx;
+  uint32_t cmd_tx;
+  uint32_t evt_rx;
+  uint32_t acl_tx;
+  uint32_t acl_rx;
+  uint32_t sco_tx;
+  uint32_t sco_rx;
+  uint32_t byte_rx;
+  uint32_t byte_tx;
+};
+
+struct sockaddr_l2 {
+  sa_family_t l2_family;
+  unsigned short l2_psm;
+  bdaddr_t l2_bdaddr;
+  unsigned short l2_cid;
+  uint8_t l2_bdaddr_type;
+};
+
+
+#define THIS iotjs_blehcisocket_t* blehcisocket
+
+
+void iotjs_blehcisocket_initialize(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  _this->_l2socketCount = 0;
+
+  _this->_socket = socket(AF_BLUETOOTH, SOCK_RAW | SOCK_CLOEXEC, BTPROTO_HCI);
+
+  uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get());
+  uv_poll_init(loop, &(_this->_pollHandle), _this->_socket);
+
+  _this->_pollHandle.data = blehcisocket;
+}
+
+
+void iotjs_blehcisocket_close(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  uv_close((uv_handle_t*)&(_this->_pollHandle), NULL);
+
+  close(_this->_socket);
+}
+
+
+void iotjs_blehcisocket_start(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  uv_poll_start(&_this->_pollHandle, UV_READABLE, iotjs_blehcisocket_poll_cb);
+}
+
+
+int iotjs_blehcisocket_bindRaw(THIS, int* devId) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  struct sockaddr_hci a;
+  struct hci_dev_info di;
+
+  memset(&a, 0, sizeof(a));
+  a.hci_family = AF_BLUETOOTH;
+  a.hci_dev = iotjs_blehcisocket_devIdFor(blehcisocket, devId, true);
+  a.hci_channel = HCI_CHANNEL_RAW;
+
+  _this->_devId = a.hci_dev;
+  _this->_mode = HCI_CHANNEL_RAW;
+
+  if (bind(_this->_socket, (struct sockaddr*)&a, sizeof(a)) < 0) {
+    DLOG("ERROR on binding: %s", strerror(errno));
+    return _this->_devId;
+  }
+
+  // get the local address and address type
+  memset(&di, 0x00, sizeof(di));
+  di.dev_id = _this->_devId;
+  memset(_this->_address, 0, sizeof(_this->_address));
+  _this->_addressType = 0;
+
+  if (ioctl(_this->_socket, HCIGETDEVINFO, (void*)&di) > -1) {
+    memcpy(_this->_address, &di.bdaddr, sizeof(di.bdaddr));
+    _this->_addressType = di.type;
+
+    if (_this->_addressType == 3) {
+      // 3 is a weird type, use 1 (public) instead
+      _this->_addressType = 1;
+    }
+  }
+
+  return _this->_devId;
+}
+
+
+int iotjs_blehcisocket_bindUser(THIS, int* devId) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  struct sockaddr_hci a;
+
+  memset(&a, 0, sizeof(a));
+  a.hci_family = AF_BLUETOOTH;
+  a.hci_dev = iotjs_blehcisocket_devIdFor(blehcisocket, devId, false);
+  a.hci_channel = HCI_CHANNEL_USER;
+
+  _this->_devId = a.hci_dev;
+  _this->_mode = HCI_CHANNEL_USER;
+
+  if (bind(_this->_socket, (struct sockaddr*)&a, sizeof(a)) < 0) {
+    DLOG("ERROR on binding: %s", strerror(errno));
+  }
+
+  return _this->_devId;
+}
+
+
+void iotjs_blehcisocket_bindControl(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  struct sockaddr_hci a;
+
+  memset(&a, 0, sizeof(a));
+  a.hci_family = AF_BLUETOOTH;
+  a.hci_dev = HCI_DEV_NONE;
+  a.hci_channel = HCI_CHANNEL_CONTROL;
+
+  _this->_mode = HCI_CHANNEL_CONTROL;
+
+  if (bind(_this->_socket, (struct sockaddr*)&a, sizeof(a)) < 0) {
+    DLOG("ERROR on binding: %s", strerror(errno));
+  }
+}
+
+
+bool iotjs_blehcisocket_isDevUp(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  struct hci_dev_info di;
+  bool isUp = false;
+
+  memset(&di, 0x00, sizeof(di));
+  di.dev_id = _this->_devId;
+
+  if (ioctl(_this->_socket, HCIGETDEVINFO, (void*)&di) > -1) {
+    isUp = (di.flags & (1 << HCI_UP)) != 0;
+  }
+
+  return isUp;
+}
+
+
+void iotjs_blehcisocket_setFilter(THIS, char* data, size_t length) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  if (setsockopt(_this->_socket, SOL_HCI, HCI_FILTER, data, (socklen_t)length) <
+      0) {
+    iotjs_blehcisocket_emitErrnoError(blehcisocket);
+  }
+}
+
+
+void iotjs_blehcisocket_poll(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  int length = 0;
+  char data[1024];
+
+  length = read(_this->_socket, data, sizeof(data));
+
+  if (length > 0) {
+    if (_this->_mode == HCI_CHANNEL_RAW) {
+      if (iotjs_blehcisocket_kernelDisconnectWorkArounds(blehcisocket, length,
+                                                         data) < 0) {
+        return;
+      }
+    }
+
+    iotjs_jval_t* jhcisocket = iotjs_jobjectwrap_jobject(&_this->jobjectwrap);
+    iotjs_jval_t jemit = iotjs_jval_get_property(jhcisocket, "emit");
+    IOTJS_ASSERT(iotjs_jval_is_function(&jemit));
+
+    iotjs_jargs_t jargs = iotjs_jargs_create(2);
+    iotjs_jval_t str = iotjs_jval_create_string_raw("data");
+    IOTJS_ASSERT(length >= 0);
+    iotjs_jval_t jbuf = iotjs_bufferwrap_create_buffer((size_t)length);
+    iotjs_bufferwrap_t* buf_wrap = iotjs_bufferwrap_from_jbuffer(&jbuf);
+    iotjs_bufferwrap_copy(buf_wrap, data, (size_t)length);
+    iotjs_jargs_append_jval(&jargs, &str);
+    iotjs_jargs_append_jval(&jargs, &jbuf);
+    iotjs_jhelper_call_ok(&jemit, jhcisocket, &jargs);
+
+    iotjs_jval_destroy(&str);
+    iotjs_jval_destroy(&jbuf);
+    iotjs_jargs_destroy(&jargs);
+    iotjs_jval_destroy(&jemit);
+  }
+}
+
+
+void iotjs_blehcisocket_stop(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  uv_poll_stop(&_this->_pollHandle);
+}
+
+
+void iotjs_blehcisocket_write(THIS, char* data, size_t length) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  if (write(_this->_socket, data, length) < 0) {
+    iotjs_blehcisocket_emitErrnoError(blehcisocket);
+  }
+}
+
+
+void iotjs_blehcisocket_emitErrnoError(THIS) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  iotjs_jval_t* jhcisocket = iotjs_jobjectwrap_jobject(&_this->jobjectwrap);
+  iotjs_jval_t jemit = iotjs_jval_get_property(jhcisocket, "emit");
+  IOTJS_ASSERT(iotjs_jval_is_function(&jemit));
+
+  iotjs_jargs_t jargs = iotjs_jargs_create(2);
+  iotjs_jval_t str = iotjs_jval_create_string_raw("error");
+  iotjs_jval_t jerror = iotjs_jval_create_error(strerror(errno));
+  iotjs_jargs_append_jval(&jargs, &str);
+  iotjs_jargs_append_jval(&jargs, &jerror);
+  iotjs_jhelper_call_ok(&jemit, jhcisocket, &jargs);
+
+  iotjs_jval_destroy(&str);
+  iotjs_jval_destroy(&jerror);
+  iotjs_jargs_destroy(&jargs);
+  iotjs_jval_destroy(&jemit);
+}
+
+
+int iotjs_blehcisocket_devIdFor(THIS, int* pDevId, bool isUp) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  int devId = 0; // default
+
+  if (pDevId == NULL) {
+    struct hci_dev_list_req* dl;
+    struct hci_dev_req* dr;
+
+    dl = (struct hci_dev_list_req*)calloc(HCI_MAX_DEV * sizeof(*dr) +
+                                              sizeof(*dl),
+                                          1);
+    dr = dl->dev_req;
+
+    dl->dev_num = HCI_MAX_DEV;
+
+    if (ioctl(_this->_socket, HCIGETDEVLIST, dl) > -1) {
+      for (int i = 0; i < dl->dev_num; i++, dr++) {
+        bool devUp = dr->dev_opt & (1 << HCI_UP);
+        bool match = isUp ? devUp : !devUp;
+
+        if (match) {
+          devId = dr->dev_id;
+          break;
+        }
+      }
+    }
+
+    free(dl);
+  } else {
+    devId = *pDevId;
+  }
+
+  return devId;
+}
+
+
+int iotjs_blehcisocket_kernelDisconnectWorkArounds(THIS, int length,
+                                                   char* data) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_blehcisocket_t, blehcisocket);
+
+  if (length == 22 && data[0] == 0x04 && data[1] == 0x3e && data[2] == 0x13 &&
+      data[3] == 0x01 && data[4] == 0x00) {
+    int l2socket;
+    struct sockaddr_l2 l2a;
+    unsigned short l2cid;
+    unsigned short handle = *((unsigned short*)(&data[5]));
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+    l2cid = ATT_CID;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+    l2cid = bswap_16(ATT_CID);
+#else
+#error "Unknown byte order"
+#endif
+
+    l2socket = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP);
+
+    if (l2socket < 0) {
+      DLOG("ERROR creating socket: %s", strerror(errno));
+      return -1;
+    }
+
+    memset(&l2a, 0, sizeof(l2a));
+    l2a.l2_family = AF_BLUETOOTH;
+    l2a.l2_cid = l2cid;
+    memcpy(&l2a.l2_bdaddr, _this->_address, sizeof(l2a.l2_bdaddr));
+    l2a.l2_bdaddr_type = _this->_addressType;
+
+    if (bind(l2socket, (struct sockaddr*)&l2a, sizeof(l2a)) < 0) {
+      DLOG("ERROR on binding: %s", strerror(errno));
+      close(l2socket);
+      return -1;
+    }
+
+    memset(&l2a, 0, sizeof(l2a));
+    l2a.l2_family = AF_BLUETOOTH;
+    memcpy(&l2a.l2_bdaddr, &data[9], sizeof(l2a.l2_bdaddr));
+    l2a.l2_cid = l2cid;
+    l2a.l2_bdaddr_type = data[8] + 1;
+
+    if (connect(l2socket, (struct sockaddr*)&l2a, sizeof(l2a)) < 0) {
+      DLOG("ERROR connecting socket: %s", strerror(errno));
+      close(l2socket);
+      return -1;
+    }
+
+    _this->_l2sockets[handle] = l2socket;
+    _this->_l2socketCount++;
+  } else if (length == 7 && data[0] == 0x04 && data[1] == 0x05 &&
+             data[2] == 0x04 && data[3] == 0x00) {
+    unsigned short handle = *((unsigned short*)(&data[4]));
+
+    if (_this->_l2socketCount > 0) {
+      close(_this->_l2sockets[handle]);
+      _this->_l2socketCount--;
+    }
+  }
+
+  return 0;
+}
+
+#undef THIS
+
+void iotjs_blehcisocket_poll_cb(uv_poll_t* handle, int status, int events) {
+  iotjs_blehcisocket_t* blehcisocket = (iotjs_blehcisocket_t*)handle->data;
+
+  iotjs_blehcisocket_poll(blehcisocket);
+}
+
+#endif /* IOTJS_MODULE_BLE_HCI_SOCKET_LINUX_GENERAL_INL_H */
diff --git a/src/platform/linux/iotjs_module_gpio-linux.c b/src/platform/linux/iotjs_module_gpio-linux.c
new file mode 100644 (file)
index 0000000..5071cf8
--- /dev/null
@@ -0,0 +1,284 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include <poll.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "iotjs_systemio-linux.h"
+#include "modules/iotjs_module_gpio.h"
+
+
+#define GPIO_INTERFACE "/sys/class/gpio/"
+#define GPIO_EXPORT "export"
+#define GPIO_UNEXPORT "unexport"
+#define GPIO_DIRECTION "direction"
+#define GPIO_EDGE "edge"
+#define GPIO_VALUE "value"
+#define GPIO_PIN_INTERFACE "gpio%d/"
+#define GPIO_PIN_FORMAT_EXPORT GPIO_INTERFACE "export"
+#define GPIO_PIN_FORMAT_UNEXPORT GPIO_INTERFACE "unexport"
+#define GPIO_PIN_FORMAT GPIO_INTERFACE GPIO_PIN_INTERFACE
+#define GPIO_PIN_FORMAT_DIRECTION GPIO_PIN_FORMAT GPIO_DIRECTION
+#define GPIO_PIN_FORMAT_EDGE GPIO_PIN_FORMAT GPIO_EDGE
+#define GPIO_PIN_FORMAT_VALUE GPIO_PIN_FORMAT GPIO_VALUE
+
+#define GPIO_PATH_BUFFER_SIZE DEVICE_IO_PATH_BUFFER_SIZE
+#define GPIO_PIN_BUFFER_SIZE DEVICE_IO_PIN_BUFFER_SIZE
+#define GPIO_VALUE_BUFFER_SIZE 10
+
+
+// Implementation used here are based on:
+//  https://www.kernel.org/doc/Documentation/gpio/sysfs.txt
+
+
+static const char* gpio_edge_string[] = { "none", "rising", "falling", "both" };
+
+
+static int gpio_get_value_fd(iotjs_gpio_t* gpio) {
+  int fd;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  uv_mutex_lock(&_this->mutex);
+  fd = _this->value_fd;
+  uv_mutex_unlock(&_this->mutex);
+
+  return fd;
+}
+
+
+static void gpio_set_value_fd(iotjs_gpio_t* gpio, int fd) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  uv_mutex_lock(&_this->mutex);
+  _this->value_fd = fd;
+  uv_mutex_unlock(&_this->mutex);
+}
+
+
+static void gpio_emit_change_event(iotjs_gpio_t* gpio) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  iotjs_jval_t* jgpio = iotjs_jobjectwrap_jobject(&_this->jobjectwrap);
+  iotjs_jval_t jonChange = iotjs_jval_get_property(jgpio, "onChange");
+  IOTJS_ASSERT(iotjs_jval_is_function(&jonChange));
+
+  iotjs_jhelper_call_ok(&jonChange, jgpio, iotjs_jargs_get_empty());
+
+  iotjs_jval_destroy(&jonChange);
+}
+
+
+static bool gpio_clear_dummy_value(int fd) {
+  char buffer[1];
+
+  if (lseek(fd, 0, SEEK_SET) < 0) {
+    DLOG("GPIO Error in lseek");
+    return false;
+  }
+
+  if (read(fd, &buffer, 1) < 0) {
+    DLOG("GPIO Error in read");
+    return false;
+  }
+
+  return true;
+}
+
+
+static int gpio_edge_poll(struct pollfd* pollfd) {
+  int ret;
+
+  // Wait edge
+  if ((ret = poll(pollfd, 1, -1)) > 0) {
+    if (!gpio_clear_dummy_value(pollfd->fd))
+      return -1;
+  }
+
+  return ret;
+}
+
+
+static void gpio_edge_detection_cb(void* data) {
+  int fd;
+  iotjs_gpio_t* gpio = (iotjs_gpio_t*)data;
+  struct pollfd pollfd;
+
+  if ((fd = gpio_get_value_fd(gpio)) < 0) {
+    DLOG("GPIO Error: cannot start edge detection");
+    return;
+  }
+
+  memset(&pollfd, 0, sizeof(pollfd));
+  pollfd.fd = fd;
+  pollfd.events = POLLPRI | POLLERR;
+
+  if (!gpio_clear_dummy_value(fd))
+    return;
+
+  while (true) {
+    if ((fd = gpio_get_value_fd(gpio)) < 0)
+      return;
+
+    if (gpio_edge_poll(&pollfd) > 0) {
+      gpio_emit_change_event(gpio);
+    } else {
+      DLOG("GPIO Error on poll: %s", strerror(errno));
+    }
+  }
+}
+
+
+static bool gpio_set_direction(uint32_t pin, GpioDirection direction) {
+  IOTJS_ASSERT(direction == kGpioDirectionIn || direction == kGpioDirectionOut);
+
+  char direction_path[GPIO_PATH_BUFFER_SIZE];
+  snprintf(direction_path, GPIO_PATH_BUFFER_SIZE, GPIO_PIN_FORMAT_DIRECTION,
+           pin);
+
+  const char* buffer = (direction == kGpioDirectionIn) ? "in" : "out";
+
+  DDDLOG("%s - path: %s, dir: %s", __func__, direction_path, buffer);
+
+  return iotjs_systemio_open_write_close(direction_path, buffer);
+}
+
+
+// FIXME: Implement SetPinMode()
+static bool gpio_set_mode(uint32_t pin, GpioMode mode) {
+  return true;
+}
+
+
+static bool gpio_set_edge(iotjs_gpio_t* gpio) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  char edge_path[GPIO_PATH_BUFFER_SIZE];
+  snprintf(edge_path, GPIO_PATH_BUFFER_SIZE, GPIO_PIN_FORMAT_EDGE, _this->pin);
+  iotjs_systemio_open_write_close(edge_path, gpio_edge_string[_this->edge]);
+
+  if (_this->direction == kGpioDirectionIn && _this->edge != kGpioEdgeNone) {
+    char value_path[GPIO_PATH_BUFFER_SIZE];
+    snprintf(value_path, GPIO_PATH_BUFFER_SIZE, GPIO_PIN_FORMAT_VALUE,
+             _this->pin);
+    if ((_this->value_fd = open(value_path, O_RDONLY)) < 0) {
+      DLOG("GPIO Error in open");
+      return false;
+    }
+
+    uv_mutex_init(&_this->mutex);
+
+    // Create edge detection thread
+    // When the GPIO pin is closed, thread is terminated.
+    if (uv_thread_create(&_this->thread, gpio_edge_detection_cb, (void*)gpio) <
+        0) {
+      DLOG("GPIO Error in uv_thread_create");
+    }
+    return false;
+  }
+
+  return true;
+}
+
+
+bool iotjs_gpio_write(iotjs_gpio_t* gpio, bool value) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  char value_path[GPIO_PATH_BUFFER_SIZE];
+  snprintf(value_path, GPIO_PATH_BUFFER_SIZE, GPIO_PIN_FORMAT_VALUE,
+           _this->pin);
+
+  const char* buffer = value ? "1" : "0";
+
+  DDDLOG("%s - pin: %d, value: %d", __func__, _this->pin, value);
+
+  return iotjs_systemio_open_write_close(value_path, buffer);
+}
+
+
+int iotjs_gpio_read(iotjs_gpio_t* gpio) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  char buffer[GPIO_VALUE_BUFFER_SIZE];
+  char value_path[GPIO_PATH_BUFFER_SIZE];
+  snprintf(value_path, GPIO_PATH_BUFFER_SIZE, GPIO_PIN_FORMAT_VALUE,
+           _this->pin);
+
+  if (!iotjs_systemio_open_read_close(value_path, buffer,
+                                      GPIO_VALUE_BUFFER_SIZE - 1)) {
+    return -1;
+  }
+
+  return atoi(buffer);
+}
+
+
+bool iotjs_gpio_close(iotjs_gpio_t* gpio) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  char buff[GPIO_PIN_BUFFER_SIZE];
+  snprintf(buff, GPIO_PIN_BUFFER_SIZE, "%d", _this->pin);
+
+  gpio_set_value_fd(gpio, -1);
+  close(_this->value_fd);
+
+  return iotjs_systemio_open_write_close(GPIO_PIN_FORMAT_UNEXPORT, buff);
+}
+
+
+void iotjs_gpio_open_worker(uv_work_t* work_req) {
+  GPIO_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  DDDLOG("%s - pin: %d, dir: %d, mode: %d", __func__, _this->pin,
+         _this->direction, _this->mode);
+
+  // Open GPIO pin.
+  char exported_path[GPIO_PATH_BUFFER_SIZE];
+  snprintf(exported_path, GPIO_PATH_BUFFER_SIZE, GPIO_PIN_FORMAT, _this->pin);
+
+  const char* created_files[] = { GPIO_DIRECTION, GPIO_EDGE, GPIO_VALUE };
+  int created_files_length = sizeof(created_files) / sizeof(created_files[0]);
+
+  if (!iotjs_systemio_device_open(GPIO_PIN_FORMAT_EXPORT, _this->pin,
+                                  exported_path, created_files,
+                                  created_files_length)) {
+    req_data->result = false;
+    return;
+  }
+
+  // Set direction.
+  if (!gpio_set_direction(_this->pin, _this->direction)) {
+    req_data->result = false;
+    return;
+  }
+
+  // Set mode.
+  if (!gpio_set_mode(_this->pin, _this->mode)) {
+    req_data->result = false;
+    return;
+  }
+
+  // Set edge
+  if (!gpio_set_edge(gpio)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
diff --git a/src/platform/linux/iotjs_module_i2c-linux.c b/src/platform/linux/iotjs_module_i2c-linux.c
new file mode 100644 (file)
index 0000000..c8e7731
--- /dev/null
@@ -0,0 +1,154 @@
+/* The MIT License (MIT)
+ *
+ * Copyright (c) 2005-2014 RoadNarrows LLC.
+ * http://roadnarrows.com
+ * All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+/* Some functions are modified from the RoadNarrows-robotics i2c library.
+ * (distributed under the MIT license.)
+ */
+
+
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+
+#include "modules/iotjs_module_i2c.h"
+
+
+#define I2C_SLAVE_FORCE 0x0706
+#define I2C_SMBUS 0x0720
+#define I2C_SMBUS_READ 1
+#define I2C_SMBUS_WRITE 0
+#define I2C_NOCMD 0
+#define I2C_SMBUS_BYTE 1
+#define I2C_SMBUS_BLOCK_DATA 5
+#define I2C_SMBUS_I2C_BLOCK_DATA 8
+#define I2C_SMBUS_BLOCK_MAX 32
+#define I2C_MAX_ADDRESS 128
+
+
+typedef union I2cSmbusDataUnion {
+  uint8_t byte;
+  unsigned short word;
+  uint8_t block[I2C_SMBUS_BLOCK_MAX + 2];
+} I2cSmbusData;
+
+
+typedef struct I2cSmbusIoctlDataStruct {
+  uint8_t read_write;
+  uint8_t command;
+  int size;
+  I2cSmbusData* data;
+} I2cSmbusIoctlData;
+
+
+#define I2C_WORKER_INIT_TEMPLATE                                            \
+  iotjs_i2c_reqwrap_t* req_wrap = iotjs_i2c_reqwrap_from_request(work_req); \
+  iotjs_i2c_reqdata_t* req_data = iotjs_i2c_reqwrap_data(req_wrap);
+
+
+void I2cSetAddress(iotjs_i2c_t* i2c, uint8_t address) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_t, i2c);
+  _this->addr = address;
+  ioctl(_this->device_fd, I2C_SLAVE_FORCE, _this->addr);
+}
+
+
+void OpenWorker(uv_work_t* work_req) {
+  I2C_WORKER_INIT_TEMPLATE;
+  iotjs_i2c_t* i2c = iotjs_i2c_instance_from_reqwrap(req_wrap);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_t, i2c);
+
+  _this->device_fd = open(iotjs_string_data(&req_data->device), O_RDWR);
+
+  if (_this->device_fd == -1) {
+    req_data->error = kI2cErrOpen;
+  } else {
+    req_data->error = kI2cErrOk;
+  }
+}
+
+
+void I2cClose(iotjs_i2c_t* i2c) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_t, i2c);
+
+  if (_this->device_fd > 0) {
+    close(_this->device_fd);
+    _this->device_fd = -1;
+  }
+}
+
+
+void WriteWorker(uv_work_t* work_req) {
+  I2C_WORKER_INIT_TEMPLATE;
+  iotjs_i2c_t* i2c = iotjs_i2c_instance_from_reqwrap(req_wrap);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_t, i2c);
+
+  uint8_t len = req_data->buf_len;
+  char* data = req_data->buf_data;
+
+  if (write(_this->device_fd, data, len) != len) {
+    req_data->error = kI2cErrWrite;
+  }
+
+  if (req_data->buf_data != NULL) {
+    iotjs_buffer_release(req_data->buf_data);
+  }
+}
+
+
+void ReadWorker(uv_work_t* work_req) {
+  I2C_WORKER_INIT_TEMPLATE;
+  iotjs_i2c_t* i2c = iotjs_i2c_instance_from_reqwrap(req_wrap);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_t, i2c);
+
+  uint8_t len = req_data->buf_len;
+  req_data->buf_data = iotjs_buffer_allocate(len);
+
+  if (read(_this->device_fd, req_data->buf_data, len) != len) {
+    req_data->error = kI2cErrRead;
+  }
+}
diff --git a/src/platform/linux/iotjs_module_pwm-linux.c b/src/platform/linux/iotjs_module_pwm-linux.c
new file mode 100644 (file)
index 0000000..bfca967
--- /dev/null
@@ -0,0 +1,230 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_MODULE_PWM_LINUX_GENERAL_INL_H
+#define IOTJS_MODULE_PWM_LINUX_GENERAL_INL_H
+
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "iotjs_systemio-linux.h"
+#include "modules/iotjs_module_pwm.h"
+
+
+// Generic PWM implementation for linux.
+
+
+#define PWM_INTERFACE "/sys/class/pwm/pwmchip%d/"
+#define PWM_PIN_INTERFACE "pwm%d/"
+#define PWM_PIN_FORMAT PWM_INTERFACE PWM_PIN_INTERFACE
+#define PWM_EXPORT PWM_INTERFACE "export"
+#define PWM_UNEXPORT PWM_INTERFACE "unexport"
+#define PWM_PIN_DUTYCYCLE "duty_cycle"
+#define PWM_PIN_PERIOD "period"
+#define PWM_PIN_ENABlE "enable"
+
+#define PWM_PATH_BUFFER_SIZE 64
+#define PWM_VALUE_BUFFER_SIZE 32
+
+
+// Generate device path for specified PWM device.
+// The path may include node suffix if passed ('enable', 'period', 'duty_cycle')
+// Pointer to a allocated string is returned, or null in case of error.
+// If PWM_PIN_FORMAT format results in an empty string,
+// NULL is returned (and fileName is ignored).
+static char* generate_device_subpath(iotjs_string_t* device,
+                                     const char* fileName) {
+  char* devicePath = NULL;
+  // Do not print anything, only calculate resulting string length.
+  size_t prefixSize = iotjs_string_size(device);
+  if (prefixSize > 0) {
+    size_t suffixSize = fileName ? strlen(fileName) : 0;
+    devicePath = iotjs_buffer_allocate(prefixSize + suffixSize + 1);
+    if (devicePath) {
+      // Do not need to check bounds, the buffer is of exact required size.
+      memcpy(devicePath, iotjs_string_data(device), prefixSize);
+      memcpy(devicePath + prefixSize, fileName, suffixSize);
+      devicePath[prefixSize + suffixSize] = 0;
+    }
+  }
+  return devicePath;
+}
+
+// Limit period to [0..1]s
+static double adjust_period(double period) {
+  if (period < 0) {
+    return 0.0;
+  } else if (period > 1) {
+    return 1.0;
+  } else {
+    return period;
+  }
+}
+
+
+void iotjs_pwm_open_worker(uv_work_t* work_req) {
+  PWM_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  char path[PWM_PATH_BUFFER_SIZE] = { 0 };
+  if (snprintf(path, PWM_PATH_BUFFER_SIZE, PWM_PIN_FORMAT, _this->chip,
+               _this->pin) < 0) {
+    req_data->result = false;
+    return;
+  }
+
+  _this->device = iotjs_string_create_with_size(path, strlen(path));
+
+  // See if the PWM is already opened.
+  if (!iotjs_systemio_check_path(path)) {
+    // Write exporting PWM path
+    char export_path[PWM_PATH_BUFFER_SIZE] = { 0 };
+    snprintf(export_path, PWM_PATH_BUFFER_SIZE, PWM_EXPORT, _this->chip);
+
+    const char* created_files[] = { PWM_PIN_DUTYCYCLE, PWM_PIN_PERIOD,
+                                    PWM_PIN_ENABlE };
+    int created_files_length = sizeof(created_files) / sizeof(created_files[0]);
+    if (!iotjs_systemio_device_open(export_path, _this->pin, path,
+                                    created_files, created_files_length)) {
+      req_data->result = false;
+      return;
+    }
+  }
+
+  // Set options.
+  if (_this->period >= 0) {
+    if (!iotjs_pwm_set_period(pwm)) {
+      req_data->result = false;
+      return;
+    }
+    if (_this->duty_cycle >= 0) {
+      if (!iotjs_pwm_set_dutycycle(pwm)) {
+        req_data->result = false;
+        return;
+      }
+    }
+  }
+
+  DDDLOG("%s - path: %s", __func__, path);
+
+  req_data->result = true;
+}
+
+
+bool iotjs_pwm_set_period(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  bool result = false;
+  if (isfinite(_this->period) && _this->period >= 0.0) {
+    char* devicePath = generate_device_subpath(&_this->device, PWM_PIN_PERIOD);
+    if (devicePath) {
+      // Linux API uses nanoseconds, thus 1E9
+      unsigned int value = (unsigned)(adjust_period(_this->period) * 1.E9);
+      DDDLOG("%s - path: %s, value: %fs", __func__, devicePath, 1.E-9 * value);
+      char buf[PWM_VALUE_BUFFER_SIZE];
+      if (snprintf(buf, sizeof(buf), "%d", value) > 0) {
+        result = iotjs_systemio_open_write_close(devicePath, buf);
+      }
+      free(devicePath);
+    }
+  }
+  return result;
+}
+
+
+bool iotjs_pwm_set_dutycycle(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  bool result = false;
+  double dutyCycle = _this->duty_cycle;
+  if (isfinite(_this->period) && _this->period >= 0.0 && isfinite(dutyCycle) &&
+      0.0 <= dutyCycle && dutyCycle <= 1.0) {
+    char* devicePath =
+        generate_device_subpath(&_this->device, PWM_PIN_DUTYCYCLE);
+    if (devicePath) {
+      double period = adjust_period(_this->period);
+      // Linux API uses nanoseconds, thus 1E9
+      unsigned dutyCycleValue = (unsigned)(period * _this->duty_cycle * 1E9);
+
+      DDDLOG("%s - path: %s, value: %d\n", __func__, devicePath,
+             dutyCycleValue);
+      char buf[PWM_VALUE_BUFFER_SIZE];
+      if (snprintf(buf, sizeof(buf), "%d", dutyCycleValue) < 0) {
+        return false;
+      }
+
+      result = iotjs_systemio_open_write_close(devicePath, buf);
+      free(devicePath);
+    }
+  }
+  return result;
+}
+
+
+bool iotjs_pwm_set_enable(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  bool result = false;
+
+  char* devicePath = generate_device_subpath(&_this->device, PWM_PIN_ENABlE);
+  if (devicePath) {
+    char value[4];
+    if (snprintf(value, sizeof(value), "%d", _this->enable) < 0) {
+      return false;
+    }
+
+    DDDLOG("%s - path: %s, set: %d\n", __func__, devicePath, _this->enable);
+    char buf[PWM_VALUE_BUFFER_SIZE];
+    if (snprintf(buf, sizeof(buf), "%d", _this->enable) < 0) {
+      return false;
+    }
+
+    result = iotjs_systemio_open_write_close(devicePath, buf);
+    free(devicePath);
+  }
+  return result;
+}
+
+
+bool iotjs_pwm_close(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  char path[PWM_PATH_BUFFER_SIZE] = { 0 };
+  if (snprintf(path, PWM_PATH_BUFFER_SIZE, PWM_PIN_FORMAT, _this->chip,
+               _this->pin) < 0) {
+    return false;
+  }
+
+  if (iotjs_systemio_check_path(path)) {
+    // Write exporting pin path
+    char unexport_path[PWM_PATH_BUFFER_SIZE] = { 0 };
+    if (snprintf(unexport_path, PWM_PATH_BUFFER_SIZE, PWM_UNEXPORT,
+                 _this->chip) < 0) {
+      return false;
+    }
+
+    iotjs_systemio_device_close(unexport_path, _this->pin);
+  }
+
+  DDDLOG("%s- path: %s", __func__, path);
+
+  return true;
+}
+
+
+#endif /* IOTJS_MODULE_PWM_LINUX_GENERAL_INL_H */
diff --git a/src/platform/linux/iotjs_module_spi-linux.c b/src/platform/linux/iotjs_module_spi-linux.c
new file mode 100644 (file)
index 0000000..ab4e8be
--- /dev/null
@@ -0,0 +1,169 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_MODULE_SPI_LINUX_GENERAL_INL_H
+#define IOTJS_MODULE_SPI_LINUX_GENERAL_INL_H
+
+
+#include <uv.h>
+#include <linux/spi/spidev.h>
+#include <sys/ioctl.h>
+
+#include "iotjs_def.h"
+#include "iotjs_systemio-linux.h"
+#include "modules/iotjs_module_buffer.h"
+#include "modules/iotjs_module_spi.h"
+
+#define ADC_DEVICE_PATH_FORMAT "/dev/spidev%d.%d"
+#define ADC_DEVICE_PATH_BUFFER_SIZE 16
+
+
+static bool iotjs_spi_set_configuration(iotjs_spi_t* spi) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+  int fd = _this->device_fd;
+  if (fd < 0) {
+    return false;
+  }
+
+  uint8_t data;
+
+  switch (_this->mode) {
+    case kSpiMode_0:
+      data = SPI_MODE_0;
+      break;
+    case kSpiMode_1:
+      data = SPI_MODE_1;
+      break;
+    case kSpiMode_2:
+      data = SPI_MODE_2;
+      break;
+    case kSpiMode_3:
+      data = SPI_MODE_3;
+      break;
+    default:
+      data = SPI_MODE_0;
+  }
+  if (_this->loopback) {
+    data |= SPI_LOOP;
+  }
+
+  if (_this->chip_select == kSpiCsHigh) {
+    data |= SPI_CS_HIGH;
+  }
+
+  if (ioctl(fd, SPI_IOC_WR_MODE, &_this->mode) < 0) {
+    return false;
+  }
+
+
+  if (_this->bit_order == kSpiOrderLsb) {
+    data = 1;
+    if (ioctl(fd, SPI_IOC_WR_LSB_FIRST, &data) < 0) {
+      return false;
+    }
+  }
+
+  if (ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &_this->bits_per_word) < 0) {
+    return false;
+  }
+
+  if (ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &_this->max_speed) < 0) {
+    return false;
+  }
+
+  DDDLOG(
+      "SPI Options \n mode: %d\n chipSelect: %d\n bitOrder: %d\n "
+      "maxSpeed: %d\n bitPerWord: %d\n loopback: %d",
+      _this->mode, _this->chip_select, _this->bit_order, _this->max_speed,
+      _this->bits_per_word, _this->loopback);
+
+  return true;
+}
+
+
+bool iotjs_spi_transfer(iotjs_spi_t* spi) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+  struct spi_ioc_transfer data = {.tx_buf = (unsigned long)_this->tx_buf_data,
+                                  .rx_buf = (unsigned long)_this->rx_buf_data,
+                                  .len = _this->buf_len,
+                                  .speed_hz = _this->max_speed,
+                                  .bits_per_word = _this->bits_per_word,
+                                  .delay_usecs = 0 };
+
+  // Transfer data
+  int err = ioctl(_this->device_fd, SPI_IOC_MESSAGE(1), &data);
+  if (err < 1) {
+    DLOG("%s - transfer failed: %d", __func__, err);
+    return false;
+  }
+
+  return true;
+}
+
+
+bool iotjs_spi_close(iotjs_spi_t* spi) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+  if (_this->device_fd >= 0) {
+    const iotjs_environment_t* env = iotjs_environment_get();
+    uv_loop_t* loop = iotjs_environment_loop(env);
+    uv_fs_t fs_close_req;
+
+    int err = uv_fs_close(loop, &fs_close_req, _this->device_fd, NULL);
+    uv_fs_req_cleanup(&fs_close_req);
+    if (err < 0) {
+      DLOG("%s - close failed: %d", __func__, err);
+      return false;
+    }
+    _this->device_fd = -1;
+  }
+
+  return true;
+}
+
+
+void iotjs_spi_open_worker(uv_work_t* work_req) {
+  SPI_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+  const char* device_path = iotjs_string_data(&_this->device);
+  if (iotjs_systemio_check_path(device_path)) {
+    // Open file
+    const iotjs_environment_t* env = iotjs_environment_get();
+    uv_loop_t* loop = iotjs_environment_loop(env);
+
+    uv_fs_t open_req;
+    int result = uv_fs_open(loop, &open_req, device_path, O_RDONLY, 0666, NULL);
+    uv_fs_req_cleanup(&open_req);
+    if (result < 0) {
+      req_data->result = false;
+    }
+    _this->device_fd = open_req.result;
+
+    // Set options
+    if (!iotjs_spi_set_configuration(spi)) {
+      req_data->result = false;
+      return;
+    }
+    req_data->result = true;
+  } else {
+    req_data->result = false;
+  }
+}
+
+
+#endif /* IOTJS_MODULE_SPI_LINUX_GENERAL_INL_H */
diff --git a/src/platform/linux/iotjs_module_uart-linux.c b/src/platform/linux/iotjs_module_uart-linux.c
new file mode 100644 (file)
index 0000000..714e175
--- /dev/null
@@ -0,0 +1,154 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#ifndef IOTJS_MODULE_UART_LINUX_GENERAL_INL_H
+#define IOTJS_MODULE_UART_LINUX_GENERAL_INL_H
+
+#include <errno.h>
+#include <fcntl.h>
+#include <termios.h>
+#include <unistd.h>
+
+#include "modules/iotjs_module_uart.h"
+
+static int baud_to_constant(int baudRate) {
+  switch (baudRate) {
+    case 0:
+      return B0;
+    case 50:
+      return B50;
+    case 75:
+      return B75;
+    case 110:
+      return B110;
+    case 134:
+      return B134;
+    case 150:
+      return B150;
+    case 200:
+      return B200;
+    case 300:
+      return B300;
+    case 600:
+      return B600;
+    case 1200:
+      return B1200;
+    case 1800:
+      return B1800;
+    case 2400:
+      return B2400;
+    case 4800:
+      return B4800;
+    case 9600:
+      return B9600;
+    case 19200:
+      return B19200;
+    case 38400:
+      return B38400;
+    case 57600:
+      return B57600;
+    case 115200:
+      return B115200;
+    case 230400:
+      return B230400;
+  }
+  return -1;
+}
+
+
+static int databits_to_constant(int dataBits) {
+  switch (dataBits) {
+    case 8:
+      return CS8;
+    case 7:
+      return CS7;
+    case 6:
+      return CS6;
+    case 5:
+      return CS5;
+  }
+  return -1;
+}
+
+
+void iotjs_uart_open_worker(uv_work_t* work_req) {
+  UART_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+
+  int fd = open(iotjs_string_data(&_this->device_path),
+                O_RDWR | O_NOCTTY | O_NDELAY);
+  if (fd < 0) {
+    req_data->result = false;
+    return;
+  }
+
+  struct termios options;
+  tcgetattr(fd, &options);
+  options.c_cflag = CLOCAL | CREAD;
+  options.c_cflag |= (tcflag_t)baud_to_constant(_this->baud_rate);
+  options.c_cflag |= (tcflag_t)databits_to_constant(_this->data_bits);
+  options.c_iflag = IGNPAR;
+  options.c_oflag = 0;
+  options.c_lflag = 0;
+  tcflush(fd, TCIFLUSH);
+  tcsetattr(fd, TCSANOW, &options);
+
+  _this->device_fd = fd;
+  uv_poll_t* poll_handle = &_this->poll_handle;
+
+  uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get());
+  uv_poll_init(loop, poll_handle, fd);
+  poll_handle->data = uart;
+  uv_poll_start(poll_handle, UV_READABLE, iotjs_uart_read_cb);
+
+  req_data->result = true;
+}
+
+
+bool iotjs_uart_write(iotjs_uart_t* uart) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+  int bytesWritten = 0;
+  unsigned offset = 0;
+  int fd = _this->device_fd;
+  const char* buf_data = iotjs_string_data(&_this->buf_data);
+
+  DDDLOG("%s - data: %s", __func__, buf_data);
+
+  do {
+    errno = 0;
+    bytesWritten = write(fd, buf_data + offset, _this->buf_len - offset);
+    tcdrain(fd);
+
+    DDDLOG("%s - size: %d", __func__, _this->buf_len - offset);
+
+    if (bytesWritten != -1) {
+      offset += (unsigned)bytesWritten;
+      continue;
+    }
+
+    if (errno == EINTR) {
+      continue;
+    }
+
+    return false;
+
+  } while (_this->buf_len > offset);
+
+  return true;
+}
+
+
+#endif /* IOTJS_MODULE_UART_LINUX_GENERAL_INL_H */
diff --git a/src/platform/linux/iotjs_systemio-linux.c b/src/platform/linux/iotjs_systemio-linux.c
new file mode 100644 (file)
index 0000000..e6a05fb
--- /dev/null
@@ -0,0 +1,192 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include <uv.h>
+#include <unistd.h>
+
+#include "iotjs_systemio-linux.h"
+
+
+// Checks if given directory exists.
+bool iotjs_systemio_check_path(const char* path) {
+  const iotjs_environment_t* env = iotjs_environment_get();
+
+  DDDLOG("%s - path: %s", __func__, path);
+
+  // stat for the path.
+  uv_fs_t fs_req;
+  int err = uv_fs_stat(iotjs_environment_loop(env), &fs_req, path, NULL);
+  uv_fs_req_cleanup(&fs_req);
+
+  // exist?
+  if (err || fs_req.result) {
+    return false;
+  }
+
+  DDDLOG("%s - path exist", __func__);
+
+  return true;
+}
+
+
+bool iotjs_systemio_open_write_close(const char* path, const char* value) {
+  const iotjs_environment_t* env = iotjs_environment_get();
+  uv_loop_t* loop = iotjs_environment_loop(env);
+
+  DDDLOG("%s - path %s, value: %s", __func__, path, value);
+
+  // Open file
+  uv_fs_t fs_req;
+  int fd = uv_fs_open(loop, &fs_req, path, O_WRONLY, 0666, NULL);
+  uv_fs_req_cleanup(&fs_req);
+  if (fd < 0) {
+    DLOG("%s - open %s failed: %d", __func__, path, fd);
+    return false;
+  }
+
+  // Write value
+  // We remove const because `uv_buf_init` requires char* for only reading case.
+  uv_buf_t uvbuf = uv_buf_init((char*)value, strlen(value));
+  int write_err = uv_fs_write(loop, &fs_req, fd, &uvbuf, 1, 0, NULL);
+  uv_fs_req_cleanup(&fs_req);
+
+  // Close file
+  int close_err = uv_fs_close(loop, &fs_req, fd, NULL);
+  uv_fs_req_cleanup(&fs_req);
+
+  if (write_err < 0) {
+    DLOG("%s - write %s %s failed: %d", __func__, path, value, write_err);
+    return false;
+  }
+
+  if (close_err < 0) {
+    DLOG("%s - close failed: %d", __func__, close_err);
+    return false;
+  }
+
+  return true;
+}
+
+
+bool iotjs_systemio_open_read_close(const char* path, char* buffer,
+                                    unsigned buffer_len) {
+  const iotjs_environment_t* env = iotjs_environment_get();
+  uv_loop_t* loop = iotjs_environment_loop(env);
+
+  DDDLOG("%s - path %s", __func__, path);
+
+  // Open file
+  uv_fs_t fs_open_req;
+  int fd = uv_fs_open(loop, &fs_open_req, path, O_RDONLY, 0666, NULL);
+  uv_fs_req_cleanup(&fs_open_req);
+  if (fd < 0) {
+    DLOG("%s - open %s failed: %d", __func__, path, fd);
+    return false;
+  }
+
+  // Read value
+  uv_fs_t fs_write_req;
+  uv_buf_t uvbuf = uv_buf_init(buffer, buffer_len);
+  int err = uv_fs_read(loop, &fs_write_req, fd, &uvbuf, 1, 0, NULL);
+  uv_fs_req_cleanup(&fs_write_req);
+  if (err < 0) {
+    DLOG("%s - read failed: %d", __func__, err);
+    return false;
+  }
+
+  DDDLOG("%s - read value: %s", __func__, buffer);
+
+  // Close file
+  uv_fs_t fs_close_req;
+  err = uv_fs_close(loop, &fs_close_req, fd, NULL);
+  uv_fs_req_cleanup(&fs_close_req);
+  if (err < 0) {
+    DLOG("%s - close failed: %d", __func__, err);
+    return false;
+  }
+
+  return true;
+}
+
+
+// Device Open
+bool iotjs_systemio_device_open(const char* export_path, uint32_t value,
+                                const char* exported_path,
+                                const char** created_files,
+                                int created_files_length) {
+  // Be already exported
+  if (iotjs_systemio_check_path(exported_path)) {
+    return true;
+  }
+
+  DDDLOG("%s - path: %s", __func__, export_path);
+
+  // Write export pin.
+  char buff[DEVICE_IO_PIN_BUFFER_SIZE] = { 0 };
+  snprintf(buff, DEVICE_IO_PIN_BUFFER_SIZE - 1, "%d", value);
+
+  if (!iotjs_systemio_open_write_close(export_path, buff)) {
+    return false;
+  }
+
+  // Wait for directory creation.
+  int count = 0;
+  int count_limit = created_files_length * 10;
+  char buffer[DEVICE_IO_PIN_BUFFER_SIZE];
+  char path[DEVICE_IO_PATH_BUFFER_SIZE] = { 0 };
+  char check_format[DEVICE_IO_PATH_BUFFER_SIZE] = { 0 };
+
+  while (!iotjs_systemio_check_path(exported_path) && count < count_limit) {
+    usleep(100 * 1000); // sleep 100 miliseconds.
+    count++;
+  }
+
+  strcat(check_format, exported_path);
+  strcat(check_format, "%s");
+
+  for (int i = 0; i < created_files_length; i++) {
+    snprintf(path, DEVICE_IO_PATH_BUFFER_SIZE - 1, check_format,
+             created_files[i]);
+
+    DDDLOG("%s - created file: %s", __func__, path);
+
+    while (!iotjs_systemio_open_read_close(path, buffer,
+                                           DEVICE_IO_PIN_BUFFER_SIZE) &&
+           count < count_limit) {
+      usleep(100 * 1000); // sleep 100 miliseconds.
+      count++;
+    }
+  }
+
+  usleep(1000 * 100); // sleep another 1000 milisec.
+
+  return count < count_limit;
+}
+
+
+// Device close
+bool iotjs_systemio_device_close(const char* export_path, uint32_t value) {
+  DDDLOG("%s - path: %s", __func__, export_path);
+
+  char buff[DEVICE_IO_PIN_BUFFER_SIZE];
+  snprintf(buff, DEVICE_IO_PIN_BUFFER_SIZE - 1, "%d", value);
+
+  if (!iotjs_systemio_open_write_close(export_path, buff)) {
+    return false;
+  }
+
+  return true;
+}
diff --git a/src/platform/linux/iotjs_systemio-linux.h b/src/platform/linux/iotjs_systemio-linux.h
new file mode 100644 (file)
index 0000000..8ec7855
--- /dev/null
@@ -0,0 +1,40 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_DEVICE_IO_LINUX_GENERAL_H
+#define IOTJS_DEVICE_IO_LINUX_GENERAL_H
+
+#include "iotjs_def.h"
+
+#define DEVICE_IO_PATH_BUFFER_SIZE 64
+#define DEVICE_IO_PIN_BUFFER_SIZE 10
+
+
+bool iotjs_systemio_check_path(const char* path);
+
+bool iotjs_systemio_open_write_close(const char* path, const char* value);
+
+bool iotjs_systemio_open_read_close(const char* path, char* buffer,
+                                    unsigned buffer_len);
+
+bool iotjs_systemio_device_open(const char* export_path, uint32_t value,
+                                const char* exported_path,
+                                const char** created_files,
+                                int created_files_length);
+
+bool iotjs_systemio_device_close(const char* export_path, uint32_t value);
+
+
+#endif /* IOTJS_DEVICE_IO_LINUX_GENERAL_H */
diff --git a/src/platform/nuttx/iotjs_module_adc-nuttx.c b/src/platform/nuttx/iotjs_module_adc-nuttx.c
new file mode 100644 (file)
index 0000000..4397c05
--- /dev/null
@@ -0,0 +1,134 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#if defined(__NUTTX__)
+
+
+#include <uv.h>
+#include <nuttx/analog/adc.h>
+#include <stdlib.h>
+
+#include "iotjs_def.h"
+#include "iotjs_systemio-nuttx.h"
+#include "modules/iotjs_module_adc.h"
+#include "modules/iotjs_module_stm32f4dis.h"
+
+
+#define ADC_DEVICE_PATH_FORMAT "/dev/adc%d"
+#define ADC_DEVICE_PATH_BUFFER_SIZE 12
+
+
+static void iotjs_adc_get_path(char* buffer, int32_t number) {
+  // Create ADC device path
+  snprintf(buffer, ADC_DEVICE_PATH_BUFFER_SIZE - 1, ADC_DEVICE_PATH_FORMAT,
+           number);
+}
+
+
+static bool iotjs_adc_read_data(uint32_t pin, struct adc_msg_s* msg) {
+  int32_t adc_number = ADC_GET_NUMBER(pin);
+  char path[ADC_DEVICE_PATH_BUFFER_SIZE] = { 0 };
+  iotjs_adc_get_path(path, adc_number);
+
+  const iotjs_environment_t* env = iotjs_environment_get();
+  uv_loop_t* loop = iotjs_environment_loop(env);
+  int result, close_result;
+
+  // Open file
+  uv_fs_t open_req;
+  result = uv_fs_open(loop, &open_req, path, O_RDONLY, 0666, NULL);
+  uv_fs_req_cleanup(&open_req);
+  if (result < 0) {
+    return false;
+  }
+
+  // Read value
+  uv_fs_t read_req;
+  uv_buf_t uvbuf = uv_buf_init((char*)msg, sizeof(*msg));
+  result = uv_fs_read(loop, &read_req, open_req.result, &uvbuf, 1, 0, NULL);
+  uv_fs_req_cleanup(&read_req);
+
+  // Close file
+  uv_fs_t close_req;
+  close_result = uv_fs_close(loop, &close_req, open_req.result, NULL);
+  uv_fs_req_cleanup(&close_req);
+  if (result < 0 || close_result < 0) {
+    return false;
+  }
+
+  DDDLOG("ADC Read - path: %s, value: %d", path, msg->am_data);
+
+  return true;
+}
+
+
+int32_t iotjs_adc_read(iotjs_adc_t* adc) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_t, adc);
+
+  struct adc_msg_s msg;
+
+  if (!iotjs_adc_read_data(_this->pin, &msg)) {
+    return -1;
+  }
+
+  return msg.am_data;
+}
+
+
+bool iotjs_adc_close(iotjs_adc_t* adc) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_t, adc);
+
+  uint32_t pin = _this->pin;
+  int32_t adc_number = ADC_GET_NUMBER(pin);
+
+  char path[ADC_DEVICE_PATH_BUFFER_SIZE] = { 0 };
+  iotjs_adc_get_path(path, adc_number);
+
+  // Release driver
+  if (unregister_driver(path) < 0) {
+    return false;
+  }
+
+  iotjs_gpio_unconfig_nuttx(pin);
+
+  return true;
+}
+
+
+void iotjs_adc_open_worker(uv_work_t* work_req) {
+  ADC_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_adc_t, adc);
+
+  uint32_t pin = _this->pin;
+  int32_t adc_number = ADC_GET_NUMBER(pin);
+  int32_t timer = SYSIO_GET_TIMER(pin);
+  struct adc_dev_s* adc_dev = iotjs_adc_config_nuttx(adc_number, timer, pin);
+
+  char path[ADC_DEVICE_PATH_BUFFER_SIZE] = { 0 };
+  iotjs_adc_get_path(path, adc_number);
+
+  if (adc_register(path, adc_dev) != 0) {
+    req_data->result = false;
+    return;
+  }
+
+  DDDLOG("%s - path: %s, number: %d, timer: %d", __func__, path, adc_number,
+         timer);
+
+  req_data->result = true;
+}
+
+
+#endif // __NUTTX__
diff --git a/src/platform/nuttx/iotjs_module_blehcisocket-nuttx.c b/src/platform/nuttx/iotjs_module_blehcisocket-nuttx.c
new file mode 100644 (file)
index 0000000..45e76c1
--- /dev/null
@@ -0,0 +1,104 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_MODULE_BLE_HCI_SOCKET_LINUX_GENERAL_INL_H
+#define IOTJS_MODULE_BLE_HCI_SOCKET_LINUX_GENERAL_INL_H
+
+
+#include "iotjs_def.h"
+#include "modules/iotjs_module_blehcisocket.h"
+
+#define THIS iotjs_blehcisocket_t* blehcisocket
+
+
+void iotjs_blehcisocket_initialize(THIS) {
+  IOTJS_ASSERT(!"Not implemented");
+}
+
+
+void iotjs_blehcisocket_close(THIS) {
+  IOTJS_ASSERT(!"Not implemented");
+}
+
+
+void iotjs_blehcisocket_start(THIS) {
+  IOTJS_ASSERT(!"Not implemented");
+}
+
+
+int iotjs_blehcisocket_bindRaw(THIS, int* devId) {
+  IOTJS_ASSERT(!"Not implemented");
+  return 0;
+}
+
+
+int iotjs_blehcisocket_bindUser(THIS, int* devId) {
+  IOTJS_ASSERT(!"Not implemented");
+  return 0;
+}
+
+
+void iotjs_blehcisocket_bindControl(THIS) {
+  IOTJS_ASSERT(!"Not implemented");
+}
+
+
+bool iotjs_blehcisocket_isDevUp(THIS) {
+  IOTJS_ASSERT(!"Not implemented");
+  return false;
+}
+
+
+void iotjs_blehcisocket_setFilter(THIS, char* data, size_t length) {
+  IOTJS_ASSERT(!"Not implemented");
+}
+
+
+void iotjs_blehcisocket_poll(THIS) {
+  IOTJS_ASSERT(!"Not implemented");
+}
+
+
+void iotjs_blehcisocket_stop(THIS) {
+  IOTJS_ASSERT(!"Not implemented");
+}
+
+
+void iotjs_blehcisocket_write(THIS, char* data, size_t length) {
+  IOTJS_ASSERT(!"Not implemented");
+}
+
+
+void iotjs_blehcisocket_emitErrnoError(THIS) {
+  IOTJS_ASSERT(!"Not implemented");
+}
+
+
+int iotjs_blehcisocket_devIdFor(THIS, int* pDevId, bool isUp) {
+  IOTJS_ASSERT(!"Not implemented");
+  return 0;
+}
+
+
+int iotjs_blehcisocket_kernelDisconnectWorkArounds(THIS, int length,
+                                                   char* data) {
+  IOTJS_ASSERT(!"Not implemented");
+  return 0;
+}
+
+
+#undef THIS
+
+#endif /* IOTJS_MODULE_BLE_HCI_SOCKET_LINUX_GENERAL_INL_H */
diff --git a/src/platform/nuttx/iotjs_module_i2c-nuttx.c b/src/platform/nuttx/iotjs_module_i2c-nuttx.c
new file mode 100644 (file)
index 0000000..31f73fe
--- /dev/null
@@ -0,0 +1,112 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#if defined(__NUTTX__)
+
+#include "iotjs_systemio-nuttx.h"
+
+#include "modules/iotjs_module_i2c.h"
+
+
+#define I2C_DEFAULT_FREQUENCY 400000
+
+
+void I2cSetAddress(iotjs_i2c_t* i2c, uint8_t address) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_t, i2c);
+  _this->config.address = address;
+  _this->config.addrlen = 7;
+}
+
+
+#define I2C_WORKER_INIT_TEMPLATE                                            \
+  iotjs_i2c_reqwrap_t* req_wrap = iotjs_i2c_reqwrap_from_request(work_req); \
+  iotjs_i2c_reqdata_t* req_data = iotjs_i2c_reqwrap_data(req_wrap);
+
+
+void OpenWorker(uv_work_t* work_req) {
+  I2C_WORKER_INIT_TEMPLATE;
+  iotjs_i2c_t* i2c = iotjs_i2c_instance_from_reqwrap(req_wrap);
+
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_t, i2c);
+  _this->i2c_master = iotjs_i2c_config_nuttx(req_data->device);
+  if (!_this->i2c_master) {
+    DLOG("I2C OpenWorker : cannot open");
+    req_data->error = kI2cErrOpen;
+    return;
+  }
+
+  _this->config.frequency = I2C_DEFAULT_FREQUENCY;
+
+  req_data->error = kI2cErrOk;
+}
+
+
+void I2cClose(iotjs_i2c_t* i2c) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_t, i2c);
+
+  iotjs_i2c_unconfig_nuttx(_this->i2c_master);
+}
+
+
+void WriteWorker(uv_work_t* work_req) {
+  I2C_WORKER_INIT_TEMPLATE;
+  iotjs_i2c_t* i2c = iotjs_i2c_instance_from_reqwrap(req_wrap);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_t, i2c);
+
+  uint8_t len = req_data->buf_len;
+  uint8_t* data = (uint8_t*)req_data->buf_data;
+
+  IOTJS_ASSERT(_this->i2c_master);
+  IOTJS_ASSERT(len > 0);
+
+  int ret = i2c_write(_this->i2c_master, &_this->config, data, len);
+  if (ret < 0) {
+    DLOG("I2C WriteWorker : cannot write - %d", ret);
+    req_data->error = kI2cErrWrite;
+  } else {
+    req_data->error = kI2cErrOk;
+  }
+
+  if (req_data->buf_data != NULL) {
+    iotjs_buffer_release(req_data->buf_data);
+  }
+
+  req_data->error = kI2cErrOk;
+}
+
+
+void ReadWorker(uv_work_t* work_req) {
+  I2C_WORKER_INIT_TEMPLATE;
+  iotjs_i2c_t* i2c = iotjs_i2c_instance_from_reqwrap(req_wrap);
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_i2c_t, i2c);
+
+  uint8_t len = req_data->buf_len;
+  req_data->buf_data = iotjs_buffer_allocate(len);
+
+  IOTJS_ASSERT(_this->i2c_master);
+  IOTJS_ASSERT(len > 0);
+
+  int ret = i2c_read(_this->i2c_master, &_this->config,
+                     (uint8_t*)req_data->buf_data, len);
+  if (ret != 0) {
+    DLOG("I2C ReadWorker : cannot read - %d", ret);
+    req_data->error = kI2cErrRead;
+    return;
+  }
+  req_data->error = kI2cErrOk;
+}
+
+
+#endif // __NUTTX__
diff --git a/src/platform/nuttx/iotjs_module_pwm-nuttx.c b/src/platform/nuttx/iotjs_module_pwm-nuttx.c
new file mode 100644 (file)
index 0000000..f1b676c
--- /dev/null
@@ -0,0 +1,175 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#if defined(__NUTTX__)
+
+
+#include <nuttx/drivers/pwm.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+
+#include "iotjs_def.h"
+#include "iotjs_systemio-nuttx.h"
+#include "modules/iotjs_module_pwm.h"
+
+
+#define PWM_DEVICE_PATH_FORMAT "/dev/pwm%d"
+#define PWM_DEVICE_PATH_BUFFER_SIZE 12
+
+
+static bool iotjs_pwm_set_options(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  int fd = _this->device_fd;
+  if (fd < 0) {
+    DLOG("%s - file open failed", __func__);
+    return false;
+  }
+
+  struct pwm_info_s info;
+
+  // Clamp so that the value inverted fits into uint32
+  if (_this->period < 2.33E-10)
+    _this->period = 2.33E-10;
+  info.frequency = (uint32_t)(1.0 / _this->period);
+
+  double duty_value = _this->duty_cycle * (1 << 16); // 16 bit timer
+  if (duty_value > 0xffff)
+    duty_value = 0xffff;
+  else if (duty_value < 1)
+    duty_value = 1;
+  info.duty = (ub16_t)duty_value;
+
+  DDDLOG("%s - frequency: %d, duty: %d", __func__, info.frequency, info.duty);
+
+  // Set Pwm info
+  if (ioctl(fd, PWMIOC_SETCHARACTERISTICS, (unsigned long)((uintptr_t)&info)) <
+      0) {
+    return false;
+  }
+
+  return true;
+}
+
+
+void iotjs_pwm_open_worker(uv_work_t* work_req) {
+  PWM_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  int timer = SYSIO_GET_TIMER(_this->pin);
+  char path[PWM_DEVICE_PATH_BUFFER_SIZE] = { 0 };
+
+  if (snprintf(path, PWM_DEVICE_PATH_BUFFER_SIZE, PWM_DEVICE_PATH_FORMAT,
+               timer) < 0) {
+    req_data->result = false;
+    return;
+  }
+
+  struct pwm_lowerhalf_s* pwm_lowerhalf =
+      iotjs_pwm_config_nuttx(timer, _this->pin);
+
+  DDDLOG("%s - path: %s, timer: %d\n", __func__, path, timer);
+
+  if (pwm_register(path, pwm_lowerhalf) != 0) {
+    req_data->result = false;
+    return;
+  }
+
+  // File open
+  _this->device_fd = open(path, O_RDONLY);
+  if (_this->device_fd < 0) {
+    DLOG("%s - file open failed", __func__);
+    req_data->result = false;
+    return;
+  }
+
+  if (!iotjs_pwm_set_options(pwm)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+bool iotjs_pwm_set_period(iotjs_pwm_t* pwm) {
+  return iotjs_pwm_set_options(pwm);
+}
+
+
+bool iotjs_pwm_set_dutycycle(iotjs_pwm_t* pwm) {
+  return iotjs_pwm_set_options(pwm);
+}
+
+
+bool iotjs_pwm_set_enable(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  int fd = _this->device_fd;
+  if (fd < 0) {
+    DLOG("%s - file open failed", __func__);
+    return false;
+  }
+
+  DDDLOG("%s - enable: %d", __func__, _this->enable);
+
+  int ret;
+  if (_this->enable) {
+    ret = ioctl(fd, PWMIOC_START, 0);
+  } else {
+    ret = ioctl(fd, PWMIOC_STOP, 0);
+  }
+
+  if (ret < 0) {
+    DLOG("%s - setEnable failed", __func__);
+    return false;
+  }
+
+  return true;
+}
+
+
+bool iotjs_pwm_close(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  int fd = _this->device_fd;
+  if (fd < 0) {
+    DLOG("%s - file not opened", __func__);
+    return false;
+  }
+
+  DDDLOG("%s", __func__);
+
+  // Close file
+  close(fd);
+  _this->device_fd = -1;
+
+  uint32_t timer = SYSIO_GET_TIMER(_this->pin);
+  char path[PWM_DEVICE_PATH_BUFFER_SIZE] = { 0 };
+  if (snprintf(path, PWM_DEVICE_PATH_BUFFER_SIZE - 1, PWM_DEVICE_PATH_FORMAT,
+               timer) < 0) {
+    return false;
+  }
+
+  // Release driver
+  unregister_driver(path);
+
+  iotjs_gpio_unconfig_nuttx(_this->pin);
+
+  return true;
+}
+
+
+#endif // __NUTTX__
diff --git a/src/platform/nuttx/iotjs_module_spi-nuttx.c b/src/platform/nuttx/iotjs_module_spi-nuttx.c
new file mode 100644 (file)
index 0000000..905ede3
--- /dev/null
@@ -0,0 +1,86 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#if defined(__NUTTX__)
+
+#include <nuttx/board.h>
+
+#include "iotjs_systemio-nuttx.h"
+#include "chip.h"
+#include "modules/iotjs_module_spi.h"
+
+
+bool iotjs_spi_transfer(iotjs_spi_t* spi) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+  struct spi_dev_s* spi_dev = _this->spi_dev;
+
+  SPI_LOCK(spi_dev, true);
+
+  SPI_SETFREQUENCY(spi_dev, _this->max_speed);
+
+  SPI_SETMODE(spi_dev, _this->mode);
+  SPI_SETBITS(spi_dev, _this->bits_per_word);
+
+  // Select the SPI
+  iotjs_gpio_write_nuttx(_this->cs_chip, false);
+
+  SPI_EXCHANGE(spi_dev, _this->tx_buf_data, _this->rx_buf_data, _this->buf_len);
+
+  // Unselect the SPI device
+  iotjs_gpio_write_nuttx(_this->cs_chip, true);
+
+  SPI_LOCK(spi_dev, false);
+
+  return true;
+}
+
+
+bool iotjs_spi_close(iotjs_spi_t* spi) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+  iotjs_gpio_unconfig_nuttx(_this->cs_chip);
+
+  return true;
+}
+
+
+void iotjs_spi_open_worker(uv_work_t* work_req) {
+  SPI_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_spi_t, spi);
+
+  switch (_this->bus) {
+    case 1:
+      _this->cs_chip = (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz |
+                        GPIO_PORTA | GPIO_PIN15 | GPIO_OUTPUT_SET);
+      break;
+    default:
+      req_data->result = false;
+      return;
+  }
+
+  iotjs_gpio_config_nuttx(_this->cs_chip);
+
+  if (!(_this->spi_dev = iotjs_spi_config_nuttx(_this->bus, _this->cs_chip))) {
+    DLOG("%s - SPI open failed %d", __func__, _this->bus);
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+#endif // __NUTTX__
diff --git a/src/platform/nuttx/iotjs_module_stm32f4dis-nuttx.c b/src/platform/nuttx/iotjs_module_stm32f4dis-nuttx.c
new file mode 100644 (file)
index 0000000..8815b50
--- /dev/null
@@ -0,0 +1,204 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#if defined(__NUTTX__) && TARGET_BOARD == STM32F4DIS
+
+
+#include "iotjs_def.h"
+#include "iotjs_systemio-nuttx.h"
+#include "stm32_gpio.h"
+
+#include "modules/iotjs_module_stm32f4dis.h"
+
+
+#if ENABLE_MODULE_ADC
+static void iotjs_pin_initialize_adc(const iotjs_jval_t* jobj) {
+  unsigned int number_bit;
+
+// ADC pin name is "ADC.(number)_(timer)".
+#define SET_ADC_CONSTANT(number, timer)        \
+  number_bit = (GPIO_ADC##number##_IN##timer); \
+  number_bit |= (ADC_NUMBER(number));          \
+  number_bit |= (SYSIO_TIMER_NUMBER(timer));   \
+  iotjs_jval_set_property_number(jobj, "ADC" #number "_" #timer, number_bit);
+
+#define SET_ADC_CONSTANT_NUMBER(number) \
+  SET_ADC_CONSTANT(number, 0);          \
+  SET_ADC_CONSTANT(number, 1);          \
+  SET_ADC_CONSTANT(number, 2);          \
+  SET_ADC_CONSTANT(number, 3);          \
+  SET_ADC_CONSTANT(number, 4);          \
+  SET_ADC_CONSTANT(number, 5);          \
+  SET_ADC_CONSTANT(number, 6);          \
+  SET_ADC_CONSTANT(number, 7);          \
+  SET_ADC_CONSTANT(number, 8);          \
+  SET_ADC_CONSTANT(number, 9);          \
+  SET_ADC_CONSTANT(number, 10);         \
+  SET_ADC_CONSTANT(number, 11);         \
+  SET_ADC_CONSTANT(number, 12);         \
+  SET_ADC_CONSTANT(number, 13);         \
+  SET_ADC_CONSTANT(number, 14);         \
+  SET_ADC_CONSTANT(number, 15);
+
+  SET_ADC_CONSTANT_NUMBER(1);
+  SET_ADC_CONSTANT_NUMBER(2);
+  SET_ADC_CONSTANT_NUMBER(3);
+
+#undef SET_ADC_CONSTANT_NUMBER
+#undef SET_ADC_CONSTANT
+}
+#endif /* ENABLE_MODULE_ADC */
+
+
+#if ENABLE_MODULE_GPIO
+
+static void iotjs_pin_initialize_gpio(const iotjs_jval_t* jobj) {
+// Set GPIO pin from configuration bits of nuttx.
+// GPIO pin name is "P(port)(pin)".
+#define SET_GPIO_CONSTANT(port, pin)                   \
+  iotjs_jval_set_property_number(jobj, "P" #port #pin, \
+                                 (GPIO_PORT##port | GPIO_PIN##pin));
+
+#define SET_GPIO_CONSTANT_PORT(port) \
+  SET_GPIO_CONSTANT(port, 0);        \
+  SET_GPIO_CONSTANT(port, 1);        \
+  SET_GPIO_CONSTANT(port, 2);        \
+  SET_GPIO_CONSTANT(port, 3);        \
+  SET_GPIO_CONSTANT(port, 4);        \
+  SET_GPIO_CONSTANT(port, 5);        \
+  SET_GPIO_CONSTANT(port, 6);        \
+  SET_GPIO_CONSTANT(port, 7);        \
+  SET_GPIO_CONSTANT(port, 8);        \
+  SET_GPIO_CONSTANT(port, 9);        \
+  SET_GPIO_CONSTANT(port, 10);       \
+  SET_GPIO_CONSTANT(port, 11);       \
+  SET_GPIO_CONSTANT(port, 12);       \
+  SET_GPIO_CONSTANT(port, 13);       \
+  SET_GPIO_CONSTANT(port, 14);       \
+  SET_GPIO_CONSTANT(port, 15);
+
+  SET_GPIO_CONSTANT_PORT(A);
+  SET_GPIO_CONSTANT_PORT(B);
+  SET_GPIO_CONSTANT_PORT(C);
+  SET_GPIO_CONSTANT_PORT(D);
+  SET_GPIO_CONSTANT_PORT(E);
+
+  SET_GPIO_CONSTANT(H, 0);
+  SET_GPIO_CONSTANT(H, 1);
+
+#undef SET_GPIO_CONSTANT_PORT
+#undef SET_GPIO_CONSTANT
+}
+
+#endif /* ENABLE_MODULE_GPIO */
+
+
+#if ENABLE_MODULE_PWM
+
+static void iotjs_pin_initialize_pwm(const iotjs_jval_t* jobj) {
+  unsigned int timer_bit;
+
+// Set PWM pin from configuration bits of nuttx.
+// PWM pin name is "PWM(timer).CH(channel)_(n)".
+#define SET_GPIO_CONSTANT(timer, channel, order)                         \
+  timer_bit = (GPIO_TIM##timer##_CH##channel##OUT_##order);              \
+  timer_bit |= (SYSIO_TIMER_NUMBER(timer));                              \
+  iotjs_jval_set_property_number(&jtim##timer, "CH" #channel "_" #order, \
+                                 timer_bit);
+
+#define SET_GPIO_CONSTANT_CHANNEL(timer, channel) \
+  SET_GPIO_CONSTANT(timer, channel, 1);           \
+  SET_GPIO_CONSTANT(timer, channel, 2);
+
+#define SET_GPIO_CONSTANT_TIM(timer)                     \
+  iotjs_jval_t jtim##timer = iotjs_jval_create_object(); \
+  iotjs_jval_set_property_jval(jobj, "PWM" #timer, &jtim##timer);
+
+#define SET_GPIO_CONSTANT_TIM_1(timer) \
+  SET_GPIO_CONSTANT_TIM(timer);        \
+  SET_GPIO_CONSTANT_CHANNEL(timer, 1);
+
+#define SET_GPIO_CONSTANT_TIM_2(timer) \
+  SET_GPIO_CONSTANT_TIM(timer);        \
+  SET_GPIO_CONSTANT_CHANNEL(timer, 1); \
+  SET_GPIO_CONSTANT_CHANNEL(timer, 2);
+
+#define SET_GPIO_CONSTANT_TIM_4(timer) \
+  SET_GPIO_CONSTANT_TIM(timer);        \
+  SET_GPIO_CONSTANT_CHANNEL(timer, 1); \
+  SET_GPIO_CONSTANT_CHANNEL(timer, 2); \
+  SET_GPIO_CONSTANT_CHANNEL(timer, 3); \
+  SET_GPIO_CONSTANT_CHANNEL(timer, 4);
+
+  SET_GPIO_CONSTANT_TIM_4(1); // PA8, PE9, PA9, PE11, PA10, PE13, PA11, PE14
+  iotjs_jval_destroy(&jtim1);
+  SET_GPIO_CONSTANT_TIM_4(2); // PA0, PA15, PA1, PB3, PA2, PB10, PA3, PB11
+  iotjs_jval_set_property_number(&jtim2, "CH1_3", GPIO_TIM2_CH1OUT_3); // PA5
+  iotjs_jval_destroy(&jtim2);
+  SET_GPIO_CONSTANT_TIM_4(3); // PA6, PB4, PA7, PB5, PB0, PC8, PB1, PC9
+  iotjs_jval_set_property_number(&jtim3, "CH1_3", GPIO_TIM3_CH1OUT_3); // PC6
+  iotjs_jval_set_property_number(&jtim3, "CH2_3", GPIO_TIM3_CH2OUT_3); // PC7
+  iotjs_jval_destroy(&jtim3);
+  SET_GPIO_CONSTANT_TIM_4(4); // PB6, PD12, PB7, PD13, PB8, PD14, PB9, PD15
+  iotjs_jval_destroy(&jtim4);
+  SET_GPIO_CONSTANT_TIM_4(5); // PA0, PH10, PA1, PH11, PA2, PH12, PA3, PI0
+  iotjs_jval_destroy(&jtim5);
+  SET_GPIO_CONSTANT_TIM_4(8); // PC6, PI5, PC7, PI6, PC8, PI7, PC9, PI2
+  iotjs_jval_destroy(&jtim8);
+  SET_GPIO_CONSTANT_TIM_2(9); // PA2, PE5, PA3, PE6
+  iotjs_jval_destroy(&jtim9);
+  SET_GPIO_CONSTANT_TIM_1(10); // PB8, PF6
+  iotjs_jval_destroy(&jtim10);
+  SET_GPIO_CONSTANT_TIM_1(11); // PB9, PF7
+  iotjs_jval_destroy(&jtim11);
+  SET_GPIO_CONSTANT_TIM_2(12); // PH6, PB14, PB15, PH9
+  iotjs_jval_destroy(&jtim12);
+  SET_GPIO_CONSTANT_TIM_1(13); // PA6, PF8
+  iotjs_jval_destroy(&jtim13);
+  SET_GPIO_CONSTANT_TIM_1(14); // PA7, PF9
+  iotjs_jval_destroy(&jtim14);
+
+#undef SET_GPIO_CONSTANT_TIM_4
+#undef SET_GPIO_CONSTANT_TIM_2
+#undef SET_GPIO_CONSTANT_TIM_1
+#undef SET_GPIO_CONSTANT_TIM
+#undef SET_GPIO_CONSTANT_CHANNEL
+#undef SET_GPIO_CONSTANT
+}
+
+#endif /* ENABLE_MODULE_PWM */
+
+
+void iotjs_stm32f4dis_pin_initialize(const iotjs_jval_t* jobj) {
+  iotjs_jval_t jpin = iotjs_jval_create_object();
+  iotjs_jval_set_property_jval(jobj, "pin", &jpin);
+
+#if ENABLE_MODULE_ADC
+  iotjs_pin_initialize_adc(&jpin);
+#endif /* ENABLE_MODULE_ADC */
+
+#if ENABLE_MODULE_GPIO
+  iotjs_pin_initialize_gpio(&jpin);
+#endif /* ENABLE_MODULE_GPIO */
+
+#if ENABLE_MODULE_PWM
+  iotjs_pin_initialize_pwm(&jpin);
+#endif /* ENABLE_MODULE_PWM */
+
+  iotjs_jval_destroy(&jpin);
+}
+
+
+#endif // __NUTTX__
diff --git a/src/platform/nuttx/iotjs_module_uart-nuttx.c b/src/platform/nuttx/iotjs_module_uart-nuttx.c
new file mode 100644 (file)
index 0000000..ff42bcf
--- /dev/null
@@ -0,0 +1,78 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#if defined(__NUTTX__)
+
+
+#include "modules/iotjs_module_uart.h"
+
+
+void iotjs_uart_open_worker(uv_work_t* work_req) {
+  UART_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+
+  int fd = open(iotjs_string_data(&_this->device_path),
+                O_RDWR | O_NOCTTY | O_NDELAY);
+
+  if (fd < 0) {
+    req_data->result = false;
+    return;
+  }
+
+  _this->device_fd = fd;
+  uv_poll_t* poll_handle = &_this->poll_handle;
+
+  uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get());
+  uv_poll_init(loop, poll_handle, fd);
+  poll_handle->data = uart;
+  uv_poll_start(poll_handle, UV_READABLE, iotjs_uart_read_cb);
+
+  req_data->result = true;
+}
+
+
+bool iotjs_uart_write(iotjs_uart_t* uart) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+  int bytesWritten = 0;
+  unsigned offset = 0;
+  int fd = _this->device_fd;
+  const char* buf_data = iotjs_string_data(&_this->buf_data);
+
+  DDDLOG("%s - data: %s", __func__, buf_data);
+
+  do {
+    errno = 0;
+    bytesWritten = write(fd, buf_data + offset, _this->buf_len - offset);
+
+    DDDLOG("%s - size: %d", __func__, _this->buf_len - offset);
+
+    if (bytesWritten != -1) {
+      offset += (unsigned)bytesWritten;
+      continue;
+    }
+
+    if (errno == EINTR) {
+      continue;
+    }
+
+    return false;
+
+  } while (_this->buf_len > offset);
+
+  return true;
+}
+
+
+#endif // __NUTTX__
diff --git a/src/platform/nuttx/iotjs_systemio-nuttx.h b/src/platform/nuttx/iotjs_systemio-nuttx.h
new file mode 100644 (file)
index 0000000..66dfe6e
--- /dev/null
@@ -0,0 +1,81 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#ifndef IOTJS_SYSTEMIO_ARM_NUTTX_H
+#define IOTJS_SYSTEMIO_ARM_NUTTX_H
+
+#include <stdint.h>
+
+#include "iotjs_def.h"
+
+void iotjs_gpio_config_nuttx(uint32_t pin);
+void iotjs_gpio_unconfig_nuttx(uint32_t pin);
+void iotjs_gpio_write_nuttx(uint32_t pin, bool value);
+
+
+#if ENABLE_MODULE_ADC || ENABLE_MODULE_PWM
+
+#define SYSIO_TIMER_PIN_SHIFT 21 /* Bits 21-24: Timer number */
+#define SYSIO_TIMER_PIN_MASK 15
+#define SYSIO_TIMER_NUMBER(n) ((n) << SYSIO_TIMER_PIN_SHIFT)
+#define SYSIO_GET_TIMER(n) \
+  (((n) >> SYSIO_TIMER_PIN_SHIFT) & SYSIO_TIMER_PIN_MASK)
+
+#endif /* ENABLE_MODULE_ADC || ENABLE_MODULE_PWM */
+
+
+#if ENABLE_MODULE_ADC
+
+#include <nuttx/analog/adc.h>
+
+#define ADC_NUMBER_SHIFT 25 /* Bits 25-26: ADC number */
+#define ADC_NUMBER_MASK 3
+#define ADC_NUMBER(n) ((n) << ADC_NUMBER_SHIFT)
+#define ADC_GET_NUMBER(n) (((n) >> ADC_NUMBER_SHIFT) & ADC_NUMBER_MASK)
+
+struct adc_dev_s* iotjs_adc_config_nuttx(int number, int timer, uint32_t pin);
+
+#endif /* ENABLE_MODULE_ADC */
+
+
+#if ENABLE_MODULE_I2C
+
+#include <nuttx/i2c/i2c_master.h>
+
+struct i2c_master_s* iotjs_i2c_config_nuttx(int port);
+int iotjs_i2c_unconfig_nuttx(struct i2c_master_s* i2c);
+
+#endif /* ENABLE_MODULE_I2C */
+
+
+#if ENABLE_MODULE_PWM
+
+#include <nuttx/drivers/pwm.h>
+
+struct pwm_lowerhalf_s* iotjs_pwm_config_nuttx(int timer, uint32_t pin);
+
+#endif /* ENABLE_MODULE_PWM */
+
+
+#if ENABLE_MODULE_SPI
+
+#include <nuttx/spi/spi.h>
+
+struct spi_dev_s* iotjs_spi_config_nuttx(int bus, uint32_t cs_chip);
+
+#endif /* ENABLE_MODULE_SPI */
+
+
+#endif /* IOTJS_SYSTEMIO_ARM_NUTTX_H */
diff --git a/src/platform/nuttx/stm32f4dis/iotjs_module_gpio-nuttx-stm32f4dis.c b/src/platform/nuttx/stm32f4dis/iotjs_module_gpio-nuttx-stm32f4dis.c
new file mode 100644 (file)
index 0000000..832b3c4
--- /dev/null
@@ -0,0 +1,80 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "modules/iotjs_module_gpio.h"
+#include "stm32_gpio.h"
+
+#define GPIO_FREQUENCY_DEFAULT GPIO_SPEED_25MHz
+#define GPIO_PINCNT_IN_NUTTXPORT 16
+
+#define GPIO_CONFIG_OK 0
+
+
+uint32_t gpioDirection[] = {
+  GPIO_INPUT, GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_FREQUENCY_DEFAULT,
+};
+
+
+uint32_t gpioMode[] = {
+  0, // none
+  GPIO_PULLUP, GPIO_PULLDOWN, GPIO_FLOAT, GPIO_PUSHPULL, GPIO_OPENDRAIN,
+};
+
+
+bool iotjs_gpio_write(iotjs_gpio_t* gpio, bool value) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  DDDLOG("%s - pin: %d, value: %d", __func__, _this->pin, value);
+  stm32_gpiowrite(_this->pin, value);
+
+  return true;
+}
+
+
+int iotjs_gpio_read(iotjs_gpio_t* gpio) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  DDDLOG("%s - pin: %d", __func__, _this->pin);
+  return stm32_gpioread(_this->pin);
+}
+
+
+bool iotjs_gpio_close(iotjs_gpio_t* gpio) {
+  iotjs_gpio_write(gpio, 0);
+
+  return true;
+}
+
+
+void iotjs_gpio_open_worker(uv_work_t* work_req) {
+  GPIO_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  DDDLOG("%s - pin: %d, dir: %d, mode: %d", __func__, _this->pin,
+         _this->direction, _this->mode);
+
+  uint32_t cfgset = 0;
+
+  // Set pin direction and mode
+  cfgset = gpioDirection[_this->direction] | gpioMode[_this->mode] | _this->pin;
+
+  if (stm32_configgpio(cfgset) != GPIO_CONFIG_OK) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
diff --git a/src/platform/nuttx/stm32f4dis/iotjs_systemio-nuttx-stm32f4dis.c b/src/platform/nuttx/stm32f4dis/iotjs_systemio-nuttx-stm32f4dis.c
new file mode 100644 (file)
index 0000000..29abfe2
--- /dev/null
@@ -0,0 +1,97 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#if defined(__NUTTX__) && TARGET_BOARD == STM32F4DIS
+
+#include <stdint.h>
+
+#include "../iotjs_systemio-nuttx.h"
+#include "stm32_gpio.h"
+
+
+void iotjs_gpio_config_nuttx(uint32_t pin) {
+  stm32_configgpio(pin);
+}
+
+
+void iotjs_gpio_unconfig_nuttx(uint32_t pin) {
+  stm32_unconfiggpio(pin);
+}
+
+
+void iotjs_gpio_write_nuttx(uint32_t pin, bool value) {
+  stm32_gpiowrite(pin, value);
+}
+
+
+#if ENABLE_MODULE_ADC
+
+#include "stm32_adc.h"
+
+struct adc_dev_s* iotjs_adc_config_nuttx(int number, int timer, uint32_t pin) {
+  stm32_configgpio(pin);
+
+  uint8_t channel_list[1] = { timer };
+  return stm32_adcinitialize(number, channel_list, 1);
+}
+
+#endif /* ENABLE_MODULE_ADC */
+
+
+#if ENABLE_MODULE_I2C
+
+#include "stm32_i2c.h"
+
+struct i2c_master_s* iotjs_i2c_config_nuttx(int port) {
+  return stm32_i2cbus_initialize(port);
+}
+
+
+int iotjs_i2c_unconfig_nuttx(struct i2c_master_s* i2c) {
+  return stm32_i2cbus_uninitialize(i2c);
+}
+
+#endif /* ENABLE_MODULE_I2C */
+
+
+#if ENABLE_MODULE_PWM
+
+#include "stm32_pwm.h"
+
+struct pwm_lowerhalf_s* iotjs_pwm_config_nuttx(int timer, uint32_t pin) {
+  // Set alternative function
+  stm32_configgpio(pin);
+
+  // PWM initialize
+  return stm32_pwminitialize(timer);
+}
+
+#endif /* ENABLE_MODULE_PWM */
+
+
+#if ENABLE_MODULE_SPI
+
+#include "stm32_spi.h"
+
+struct spi_dev_s* iotjs_spi_config_nuttx(int bus, uint32_t cs_chip) {
+  stm32_configgpio(cs_chip);
+
+  return stm32_spibus_initialize(bus);
+}
+
+#endif /* ENABLE_MODULE_PWM */
+
+
+#endif // __NUTTX__
diff --git a/src/platform/tizenrt/iotjs_module_gpio-tizenrt.c b/src/platform/tizenrt/iotjs_module_gpio-tizenrt.c
new file mode 100644 (file)
index 0000000..934ef0f
--- /dev/null
@@ -0,0 +1,76 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+#include "modules/iotjs_module_gpio.h"
+
+
+void iotjs_gpio_open_worker(uv_work_t* work_req) {
+  GPIO_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  DDDLOG("%s - pin: %d, direction: %d, mode: %d", __func__, _this->pin,
+         _this->direction, _this->mode);
+
+  // Open gpio pin
+  _this->gpio_context = iotbus_gpio_open((int)_this->pin);
+  if (_this->gpio_context == NULL) {
+    req_data->result = false;
+    return;
+  }
+
+  // Set direction
+  iotbus_gpio_direction_e direction;
+  if (_this->direction == kGpioDirectionIn) {
+    direction = IOTBUS_GPIO_DIRECTION_IN;
+  } else if (_this->direction == kGpioDirectionOut) {
+    direction = IOTBUS_GPIO_DIRECTION_OUT;
+  } else {
+    direction = IOTBUS_GPIO_DIRECTION_NONE;
+  }
+  if (iotbus_gpio_set_direction(_this->gpio_context, direction) < 0) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+
+bool iotjs_gpio_write(iotjs_gpio_t* gpio, bool value) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  if (iotbus_gpio_write(_this->gpio_context, value) < 0) {
+    return false;
+  }
+  return true;
+}
+
+
+int iotjs_gpio_read(iotjs_gpio_t* gpio) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  return iotbus_gpio_read(_this->gpio_context);
+}
+
+
+bool iotjs_gpio_close(iotjs_gpio_t* gpio) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio);
+
+  if (iotbus_gpio_close(_this->gpio_context) < 0) {
+    return false;
+  }
+  return true;
+}
diff --git a/src/platform/tizenrt/iotjs_module_pwm-tizenrt.c b/src/platform/tizenrt/iotjs_module_pwm-tizenrt.c
new file mode 100644 (file)
index 0000000..a61ffc8
--- /dev/null
@@ -0,0 +1,134 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#if defined(__TIZENRT__)
+
+#include <stdlib.h>
+#include <sys/ioctl.h>
+
+#include <iotbus_error.h>
+#include <iotbus_pwm.h>
+
+#include "modules/iotjs_module_pwm.h"
+
+static bool iotjs_pwm_set_options(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  iotbus_pwm_context_h ctx = _this->ctx;
+  if (ctx == NULL) {
+    DLOG("%s - file open failed", __func__);
+    return false;
+  }
+
+  DDDLOG("%s - period: %d, duty: %d", __func__, (int)_this->period,
+         (int)(_this->duty_cycle * 100));
+
+  return iotjs_pwm_set_dutycycle(pwm) && iotjs_pwm_set_period(pwm);
+}
+
+void iotjs_pwm_open_worker(uv_work_t* work_req) {
+  PWM_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  _this->ctx = iotbus_pwm_open(0, (int)_this->pin);
+  if (_this->ctx == NULL) {
+    DLOG("%s - file open failed", __func__);
+    req_data->result = false;
+    return;
+  }
+
+  if (!iotjs_pwm_set_options(pwm)) {
+    req_data->result = false;
+    return;
+  }
+
+  req_data->result = true;
+}
+
+bool iotjs_pwm_set_period(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  iotbus_pwm_context_h ctx = _this->ctx;
+  if (ctx == NULL) {
+    DLOG("%s - file open failed", __func__);
+    return false;
+  }
+
+  uint32_t period_us = (uint32_t)(1000000 * _this->period);
+
+  return iotbus_pwm_set_period(ctx, period_us) == 0;
+}
+
+
+bool iotjs_pwm_set_dutycycle(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  iotbus_pwm_context_h ctx = _this->ctx;
+  if (ctx == NULL) {
+    DLOG("%s - file open failed", __func__);
+    return false;
+  }
+
+  uint32_t duty_cycle_per_cent = (uint32_t)(_this->duty_cycle * 100);
+
+  return iotbus_pwm_set_duty_cycle(ctx, duty_cycle_per_cent) == 0;
+}
+
+
+bool iotjs_pwm_set_enable(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  iotbus_pwm_context_h ctx = _this->ctx;
+  if (ctx == NULL) {
+    DLOG("%s - file open failed", __func__);
+    return false;
+  }
+
+  DDDLOG("%s - enable: %d", __func__, _this->enable);
+
+  int ret;
+  if (_this->enable) {
+    ret = iotbus_pwm_set_enabled(ctx, IOTBUS_PWM_ENABLE);
+  } else {
+    ret = iotbus_pwm_set_enabled(ctx, IOTBUS_PWM_DISABLE);
+  }
+
+  if (ret < 0) {
+    DLOG("%s - setEnable failed", __func__);
+    return false;
+  }
+
+  return true;
+}
+
+bool iotjs_pwm_close(iotjs_pwm_t* pwm) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_pwm_t, pwm);
+
+  iotbus_pwm_context_h ctx = _this->ctx;
+  if (ctx == NULL) {
+    DLOG("%s - file not opened", __func__);
+    return false;
+  }
+
+  DDDLOG("%s", __func__);
+
+  iotbus_pwm_close(ctx);
+  _this->ctx = NULL;
+
+  return true;
+}
+
+
+#endif // __TIZENRT__
diff --git a/src/platform/tizenrt/iotjs_module_uart-tizenrt.c b/src/platform/tizenrt/iotjs_module_uart-tizenrt.c
new file mode 100644 (file)
index 0000000..bc2b9ed
--- /dev/null
@@ -0,0 +1,77 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+#if defined(__TIZENRT__)
+
+
+#include "modules/iotjs_module_uart.h"
+
+void iotjs_uart_open_worker(uv_work_t* work_req) {
+  UART_WORKER_INIT;
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+
+  int fd = open(iotjs_string_data(&_this->device_path),
+                O_RDWR | O_NOCTTY | O_NDELAY);
+
+  if (fd < 0) {
+    req_data->result = false;
+    return;
+  }
+
+  _this->device_fd = fd;
+  uv_poll_t* poll_handle = &_this->poll_handle;
+
+  uv_loop_t* loop = iotjs_environment_loop(iotjs_environment_get());
+  uv_poll_init(loop, poll_handle, fd);
+  poll_handle->data = uart;
+  uv_poll_start(poll_handle, UV_READABLE, iotjs_uart_read_cb);
+
+  req_data->result = true;
+}
+
+
+bool iotjs_uart_write(iotjs_uart_t* uart) {
+  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_uart_t, uart);
+  int bytesWritten = 0;
+  unsigned offset = 0;
+  int fd = _this->device_fd;
+  const char* buf_data = iotjs_string_data(&_this->buf_data);
+
+  DDDLOG("%s - data: %s", __func__, buf_data);
+
+  do {
+    errno = 0;
+    bytesWritten = write(fd, buf_data + offset, _this->buf_len - offset);
+
+    DDDLOG("%s - size: %d", __func__, _this->buf_len - offset);
+
+    if (bytesWritten != -1) {
+      offset += (unsigned)bytesWritten;
+      continue;
+    }
+
+    if (errno == EINTR) {
+      continue;
+    }
+
+    return false;
+
+  } while (_this->buf_len > offset);
+
+  return true;
+}
+
+
+#endif // __TIZENRT__
diff --git a/test/node/common.js b/test/node/common.js
new file mode 100644 (file)
index 0000000..f00d34f
--- /dev/null
@@ -0,0 +1,559 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+/* eslint-disable required-modules */
+'use strict';
+var fs = require('fs');
+var assert = require('assert');
+var stream = require('stream');
+var util = require('util');
+
+var __dirname = process.cwd();
+
+var testRoot = __dirname;
+
+// PORT should match the definition in test/testpy/__init__.py.
+exports.PORT = +process.env.NODE_COMMON_PORT || 12346;
+exports.isWindows = process.platform === 'win32';
+exports.isWOW64 = exports.isWindows &&
+                  (process.env.PROCESSOR_ARCHITEW6432 !== undefined);
+exports.isAix = process.platform === 'aix';
+exports.isLinuxPPCBE = (process.platform === 'linux') &&
+                       (process.arch === 'ppc64') &&
+                       (os.endianness() === 'BE');
+exports.isSunOS = process.platform === 'sunos';
+exports.isFreeBSD = process.platform === 'freebsd';
+exports.isLinux = process.platform === 'linux';
+exports.isOSX = process.platform === 'darwin';
+
+exports.enoughTestMem = false;
+exports.enoughTestCpu = false;
+
+exports.rootDir = exports.isWindows ? 'c:\\' : '/';
+
+var dirsep = exports.isWindows ? '\\' : '/';
+
+exports.fixturesDir = __dirname + dirsep + 'fixtures';
+exports.tmpDirName = 'tmp';
+
+function rimrafSync(p) {
+  var st;
+  try {
+    st = fs.lstatSync(p);
+  } catch (e) {
+    if (e.code === 'ENOENT')
+      return;
+  }
+
+  try {
+    if (st && st.isDirectory())
+      rmdirSync(p, null);
+    else
+      fs.unlinkSync(p);
+  } catch (e) {
+    if (e.code === 'ENOENT')
+      return;
+    if (e.code === 'EPERM')
+      return rmdirSync(p, e);
+    if (e.code !== 'EISDIR')
+      throw e;
+    rmdirSync(p, e);
+  }
+}
+
+function rmdirSync(p, originalEr) {
+  try {
+    fs.rmdirSync(p);
+  } catch (e) {
+    if (e.code === 'ENOTDIR')
+      throw originalEr;
+    if (e.code === 'ENOTEMPTY' || e.code === 'EEXIST' || e.code === 'EPERM') {
+      var enc = exports.isLinux ? 'buffer' : 'utf8';
+      fs.readdirSync(p, enc).forEach(function(f) {
+        if (f instanceof Buffer) {
+          var buf = Buffer.concat([Buffer.from(p), Buffer.from(path.sep), f]);
+          rimrafSync(buf);
+        } else {
+          rimrafSync(path.join(p, f));
+        }
+      });
+      fs.rmdirSync(p);
+    }
+  }
+}
+
+exports.refreshTmpDir = function() {
+  rimrafSync(exports.tmpDir);
+  fs.mkdirSync(exports.tmpDir);
+};
+
+if (process.env.TEST_THREAD_ID) {
+  exports.PORT += process.env.TEST_THREAD_ID * 100;
+  exports.tmpDirName += '.' + process.env.TEST_THREAD_ID;
+}
+exports.tmpDir = testRoot + dirsep + exports.tmpDirName;
+
+var opensslCli = null;
+var inFreeBSDJail = null;
+var localhostIPv4 = null;
+
+exports.localIPv6Hosts = ['localhost'];
+if (exports.isLinux) {
+  exports.localIPv6Hosts = [
+    // Debian/Ubuntu
+    'ip6-localhost',
+    'ip6-loopback',
+
+    // SUSE
+    'ipv6-localhost',
+    'ipv6-loopback',
+
+    // Typically universal
+    'localhost',
+  ];
+}
+
+Object.defineProperty(exports, 'inFreeBSDJail', {
+  get: function() {
+    if (inFreeBSDJail !== null) return inFreeBSDJail;
+
+    if (exports.isFreeBSD &&
+      child_process.execSync('sysctl -n security.jail.jailed').toString() ===
+      '1\n') {
+      inFreeBSDJail = true;
+    } else {
+      inFreeBSDJail = false;
+    }
+    return inFreeBSDJail;
+  }
+});
+
+Object.defineProperty(exports, 'localhostIPv4', {
+  get: function() {
+    if (localhostIPv4 !== null) return localhostIPv4;
+
+    if (exports.inFreeBSDJail) {
+      // Jailed network interfaces are a bit special - since we need to jump
+      // through loops, as well as this being an exception case, assume the
+      // user will provide this instead.
+      if (process.env.LOCALHOST) {
+        localhostIPv4 = process.env.LOCALHOST;
+      } else {
+        console.error('Looks like we\'re in a FreeBSD Jail. ' +
+                      'Please provide your default interface address ' +
+                      'as LOCALHOST or expect some tests to fail.');
+      }
+    }
+
+    if (localhostIPv4 === null) localhostIPv4 = '127.0.0.1';
+
+    return localhostIPv4;
+  }
+});
+
+Object.defineProperty(exports, 'hasCrypto', {
+  get: function() {
+    return process.versions.openssl ? true : false;
+  }
+});
+
+Object.defineProperty(exports, 'hasFipsCrypto', {
+  get: function() {
+    return exports.hasCrypto && require('crypto').fips;
+  }
+});
+
+if (exports.isWindows) {
+  exports.PIPE = '\\\\.\\pipe\\libuv-test';
+  if (process.env.TEST_THREAD_ID) {
+    exports.PIPE += '.' + process.env.TEST_THREAD_ID;
+  }
+} else {
+  exports.PIPE = exports.tmpDir + '/test.sock';
+}
+
+exports.hasIPv6 = false;
+
+/*
+ * Check that when running a test with
+ * `$node --abort-on-uncaught-exception $file child`
+ * the process aborts.
+ */
+exports.childShouldThrowAndAbort = function() {
+  var testCmd = '';
+  if (!exports.isWindows) {
+    // Do not create core files, as it can take a lot of disk space on
+    // continuous testing and developers' machines
+    testCmd += 'ulimit -c 0 && ';
+  }
+  testCmd += process.argv[0] + ' --abort-on-uncaught-exception ';
+  testCmd += process.argv[1] + ' child';
+  var child = child_process.exec(testCmd);
+  child.on('exit', function onExit(exitCode, signal) {
+    var errMsg = 'Test should have aborted ' +
+                 'but instead exited with exit code ' + exitCode +
+                 ' and signal ' + signal;
+    assert(exports.nodeProcessAborted(exitCode, signal), errMsg);
+  });
+};
+
+exports.ddCommand = function(filename, kilobytes) {
+  if (exports.isWindows) {
+    var p = path.resolve(exports.fixturesDir, 'create-file.js');
+    return '"' + process.argv[0] + '" "' + p + '" "' +
+           filename + '" ' + (kilobytes * 1024);
+  } else {
+    return 'dd if=/dev/zero of="' + filename + '" bs=1024 count=' + kilobytes;
+  }
+};
+
+
+exports.spawnCat = function(options) {
+  var spawn = require('child_process').spawn;
+
+  if (exports.isWindows) {
+    return spawn('more', [], options);
+  } else {
+    return spawn('cat', [], options);
+  }
+};
+
+
+exports.spawnSyncCat = function(options) {
+  var spawnSync = require('child_process').spawnSync;
+
+  if (exports.isWindows) {
+    return spawnSync('more', [], options);
+  } else {
+    return spawnSync('cat', [], options);
+  }
+};
+
+
+exports.spawnPwd = function(options) {
+  var spawn = require('child_process').spawn;
+
+  if (exports.isWindows) {
+    return spawn('cmd.exe', ['/c', 'cd'], options);
+  } else {
+    return spawn('pwd', [], options);
+  }
+};
+
+
+exports.spawnSyncPwd = function(options) {
+  var spawnSync = require('child_process').spawnSync;
+
+  if (exports.isWindows) {
+    return spawnSync('cmd.exe', ['/c', 'cd'], options);
+  } else {
+    return spawnSync('pwd', [], options);
+  }
+};
+
+exports.platformTimeout = function(ms) {
+  if (process.config.target_defaults.default_configuration === 'Debug')
+    ms = 2 * ms;
+
+  if (exports.isAix)
+    return 2 * ms; // default localhost speed is slower on AIX
+
+  if (process.arch !== 'arm')
+    return ms;
+
+  var armv = process.config.variables.arm_version;
+
+  if (armv === '6')
+    return 7 * ms;  // ARMv6
+
+  if (armv === '7')
+    return 2 * ms;  // ARMv7
+
+  return ms; // ARMv8+
+};
+
+var knownGlobals = [
+  Buffer,
+  clearInterval,
+  clearTimeout,
+  console,
+  constructor, // Enumerable in V8 3.21.
+  global,
+  process,
+  setInterval,
+  setTimeout
+];
+
+if (global.gc) {
+  knownGlobals.push(global.gc);
+}
+
+if (global.DTRACE_HTTP_SERVER_RESPONSE) {
+  knownGlobals.push(DTRACE_HTTP_SERVER_RESPONSE);
+  knownGlobals.push(DTRACE_HTTP_SERVER_REQUEST);
+  knownGlobals.push(DTRACE_HTTP_CLIENT_RESPONSE);
+  knownGlobals.push(DTRACE_HTTP_CLIENT_REQUEST);
+  knownGlobals.push(DTRACE_NET_STREAM_END);
+  knownGlobals.push(DTRACE_NET_SERVER_CONNECTION);
+}
+
+if (global.COUNTER_NET_SERVER_CONNECTION) {
+  knownGlobals.push(COUNTER_NET_SERVER_CONNECTION);
+  knownGlobals.push(COUNTER_NET_SERVER_CONNECTION_CLOSE);
+  knownGlobals.push(COUNTER_HTTP_SERVER_REQUEST);
+  knownGlobals.push(COUNTER_HTTP_SERVER_RESPONSE);
+  knownGlobals.push(COUNTER_HTTP_CLIENT_REQUEST);
+  knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE);
+}
+
+if (global.LTTNG_HTTP_SERVER_RESPONSE) {
+  knownGlobals.push(LTTNG_HTTP_SERVER_RESPONSE);
+  knownGlobals.push(LTTNG_HTTP_SERVER_REQUEST);
+  knownGlobals.push(LTTNG_HTTP_CLIENT_RESPONSE);
+  knownGlobals.push(LTTNG_HTTP_CLIENT_REQUEST);
+  knownGlobals.push(LTTNG_NET_STREAM_END);
+  knownGlobals.push(LTTNG_NET_SERVER_CONNECTION);
+}
+
+if (global.ArrayBuffer) {
+  knownGlobals.push(ArrayBuffer);
+  knownGlobals.push(Int8Array);
+  knownGlobals.push(Uint8Array);
+  knownGlobals.push(Uint8ClampedArray);
+  knownGlobals.push(Int16Array);
+  knownGlobals.push(Uint16Array);
+  knownGlobals.push(Int32Array);
+  knownGlobals.push(Uint32Array);
+  knownGlobals.push(Float32Array);
+  knownGlobals.push(Float64Array);
+  knownGlobals.push(DataView);
+}
+
+// Harmony features.
+if (global.Proxy) {
+  knownGlobals.push(Proxy);
+}
+
+if (global.Symbol) {
+  knownGlobals.push(Symbol);
+}
+
+function allowGlobals() {
+  knownGlobals = knownGlobals.concat(arguments);
+}
+exports.allowGlobals = allowGlobals;
+
+function leakedGlobals() {
+  var leaked = [];
+
+  for (var val in global) {
+    if (knownGlobals.indexOf(global[val]) == -1)
+      leaked.push(val);
+  }
+
+  return leaked;
+}
+exports.leakedGlobals = leakedGlobals;
+
+// TODO: fix the knownGlobal list
+// Turn this on if the test should check for global leaks.
+exports.globalCheck = false;
+
+process.on('exit', function() {
+  if (!exports.globalCheck) return;
+  var leaked = leakedGlobals();
+  if (leaked.length > 0) {
+    console.error('Unexpected global(s) found: ' + leaked.join(', '));
+  }
+});
+
+
+var mustCallChecks = [];
+
+
+function runCallChecks(exitCode) {
+  if (exitCode !== 0) return;
+
+  var failed = mustCallChecks.filter(function(context) {
+    return context.actual !== context.expected;
+  });
+
+  failed.forEach(function(context) {
+    console.log('Mismatched %s function calls. Expected %d, actual %d.',
+                context.name,
+                context.expected,
+                context.actual);
+    console.log(context.stack.split('\n').slice(2).join('\n'));
+  });
+
+  if (failed.length) process.exit(1);
+}
+
+
+exports.mustCall = function(fn, expected) {
+  if (expected === undefined)
+    expected = 1;
+  else if (typeof expected !== 'number')
+    throw new TypeError('Invalid expected value: ' + expected);
+
+  var context = {
+    expected: expected,
+    actual: 0,
+    stack: (new Error()).stack,
+    name: fn.name || '<anonymous>'
+  };
+
+  // add the exit listener only once to avoid listener leak warnings
+  if (mustCallChecks.length === 0) process.on('exit', runCallChecks);
+
+  mustCallChecks.push(context);
+
+  return function() {
+    context.actual++;
+    return fn.apply(this, arguments);
+  };
+};
+
+exports.hasMultiLocalhost = function hasMultiLocalhost() {
+  var TCP = process.binding('tcp_wrap').TCP;
+  var t = new TCP();
+  var ret = t.bind('127.0.0.2', exports.PORT);
+  t.close();
+  return ret === 0;
+};
+
+exports.fileExists = function(pathname) {
+  try {
+    fs.accessSync(pathname);
+    return true;
+  } catch (err) {
+    return false;
+  }
+};
+
+function fail(msg) {
+  assert.fail(null, null, msg);
+}
+exports.fail = fail;
+
+exports.skip = function(msg) {
+  console.log('1..0 # Skipped: ' + msg);
+};
+
+// A stream to push an array into a REPL
+function ArrayStream() {
+  this.run = function(data) {
+    data.forEach(function(line) {
+      this.emit('data', line + '\n');
+    });
+  };
+}
+
+util.inherits(ArrayStream, stream.Stream);
+exports.ArrayStream = ArrayStream;
+ArrayStream.prototype.readable = true;
+ArrayStream.prototype.writable = true;
+ArrayStream.prototype.pause = function() {};
+ArrayStream.prototype.resume = function() {};
+ArrayStream.prototype.write = function() {};
+
+// Returns true if the exit code "exitCode" and/or signal name "signal"
+// represent the exit code and/or signal name of a node process that aborted,
+// false otherwise.
+exports.nodeProcessAborted = function nodeProcessAborted(exitCode, signal) {
+  // Depending on the compiler used, node will exit with either
+  // exit code 132 (SIGILL), 133 (SIGTRAP) or 134 (SIGABRT).
+  var expectedExitCodes = [132, 133, 134];
+
+  // On platforms using KSH as the default shell (like SmartOS),
+  // when a process aborts, KSH exits with an exit code that is
+  // greater than 256, and thus the exit code emitted with the 'exit'
+  // event is null and the signal is set to either SIGILL, SIGTRAP,
+  // or SIGABRT (depending on the compiler).
+  var expectedSignals = ['SIGILL', 'SIGTRAP', 'SIGABRT'];
+
+  // On Windows, v8's base::OS::Abort triggers an access violation,
+  // which corresponds to exit code 3221225477 (0xC0000005)
+  if (exports.isWindows)
+    expectedExitCodes = [3221225477];
+
+  // When using --abort-on-uncaught-exception, V8 will use
+  // base::OS::Abort to terminate the process.
+  // Depending on the compiler used, the shell or other aspects of
+  // the platform used to build the node binary, this will actually
+  // make V8 exit by aborting or by raising a signal. In any case,
+  // one of them (exit code or signal) needs to be set to one of
+  // the expected exit codes or signals.
+  if (signal !== null) {
+    return expectedSignals.includes(signal);
+  } else {
+    return expectedExitCodes.includes(exitCode);
+  }
+};
+
+exports.busyLoop = function busyLoop(time) {
+  var startTime = Date.now();
+  var stopTime = startTime + time;
+  while (Date.now() < stopTime) {}
+};
+
+exports.isAlive = function isAlive(pid) {
+  try {
+    process.kill(pid, 'SIGCONT');
+    return true;
+  } catch (e) {
+    return false;
+  }
+};
+
+exports.expectWarning = function(name, expected) {
+  if (typeof expected === 'string')
+    expected = [expected];
+  process.on('warning', exports.mustCall(function(warning) {
+    assert.strictEqual(warning.name, name);
+    assert.ok(expected.includes(warning.message),
+              'unexpected error message: "' + warning.message + '"');
+    // Remove a warning message after it is seen so that we guarantee that we
+    // get each message only once.
+    expected.splice(expected.indexOf(warning.message), 1);
+  }, expected.length));
+};
+
+// IoT.js extensions
+
+assert.ok = function(value, message) {
+  assert.equal(!!value, true, message);
+}
diff --git a/test/node/parallel/test-assert.js b/test/node/parallel/test-assert.js
new file mode 100644 (file)
index 0000000..a83e213
--- /dev/null
@@ -0,0 +1,185 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+require('node/common');
+
+var assert = require('assert');
+var a = require('assert');
+
+// Test starts here
+
+function makeBlock(f) {
+  var args = Array.prototype.slice.call(arguments, 1);
+  return function() {
+    return f.apply(this, args);
+  };
+}
+
+assert.ok(a.AssertionError.prototype instanceof Error,
+          'a.AssertionError instanceof Error');
+
+assert.throws(makeBlock(a, false), a.AssertionError, 'ok(false)');
+
+assert.doesNotThrow(makeBlock(a, true), a.AssertionError, 'ok(true)');
+
+assert.doesNotThrow(makeBlock(a, 'test', 'ok(\'test\')'));
+
+assert.throws(makeBlock(a.ok, false),
+              a.AssertionError, 'ok(false)');
+
+assert.doesNotThrow(makeBlock(a.ok, true),
+                    a.AssertionError, 'ok(true)');
+
+assert.doesNotThrow(makeBlock(a.ok, 'test'), 'ok(\'test\')');
+
+assert.throws(makeBlock(a.equal, true, false),
+              a.AssertionError, 'equal(true, false)');
+
+assert.doesNotThrow(makeBlock(a.equal, null, null),
+                    'equal(null, null)');
+
+assert.doesNotThrow(makeBlock(a.equal, undefined, undefined),
+                    'equal(undefined, undefined)');
+
+assert.doesNotThrow(makeBlock(a.equal, null, undefined),
+                    'equal(null, undefined)');
+
+assert.doesNotThrow(makeBlock(a.equal, true, true), 'equal(true, true)');
+
+assert.doesNotThrow(makeBlock(a.equal, 2, '2'), 'equal(2, \'2\')');
+
+assert.doesNotThrow(makeBlock(a.notEqual, true, false),
+                    'notEqual(true, false)');
+
+assert.throws(makeBlock(a.notEqual, true, true),
+              a.AssertionError, 'notEqual(true, true)');
+
+assert.throws(makeBlock(a.strictEqual, 2, '2'),
+              a.AssertionError, 'strictEqual(2, \'2\')');
+
+assert.throws(makeBlock(a.strictEqual, null, undefined),
+              a.AssertionError, 'strictEqual(null, undefined)');
+
+assert.throws(makeBlock(a.notStrictEqual, 2, 2),
+              a.AssertionError, 'notStrictEqual(2, 2)');
+
+assert.doesNotThrow(makeBlock(a.notStrictEqual, 2, '2'),
+                    'notStrictEqual(2, \'2\')');
+
+// Testing the throwing
+function thrower(errorConstructor) {
+  throw new errorConstructor('test');
+}
+
+// the basic calls work
+assert.throws(makeBlock(thrower, a.AssertionError),
+              a.AssertionError, 'message');
+assert.throws(makeBlock(thrower, a.AssertionError), a.AssertionError);
+assert.throws(makeBlock(thrower, a.AssertionError));
+
+// if not passing an error, catch all.
+assert.throws(makeBlock(thrower, TypeError));
+
+// when passing a type, only catch errors of the appropriate type
+var threw = false;
+try {
+  a.throws(makeBlock(thrower, TypeError), a.AssertionError);
+} catch (e) {
+  threw = true;
+  assert.ok(e instanceof TypeError, 'type');
+}
+assert.strictEqual(true, threw,
+                   'a.throws with an explicit error is eating extra errors',
+                   a.AssertionError);
+threw = false;
+
+// key difference is that throwing our correct error makes an assertion error
+try {
+  a.doesNotThrow(makeBlock(thrower, TypeError), TypeError);
+} catch (e) {
+  threw = true;
+  assert.ok(e instanceof a.AssertionError);
+}
+assert.strictEqual(true, threw,
+                   'a.doesNotThrow is not catching type matching errors');
+
+var circular = {y: 1};
+circular.x = circular;
+
+function testAssertionMessage(actual, expected) {
+  try {
+    assert.strictEqual(actual, '');
+  } catch (e) {
+    assert.ok(e.toString());
+  }
+}
+
+testAssertionMessage(undefined, 'undefined');
+testAssertionMessage(null, 'null');
+testAssertionMessage(true, 'true');
+testAssertionMessage(false, 'false');
+testAssertionMessage(0, '0');
+testAssertionMessage(100, '100');
+testAssertionMessage(NaN, 'NaN');
+testAssertionMessage(Infinity, 'Infinity');
+testAssertionMessage(-Infinity, '-Infinity');
+testAssertionMessage('', '""');
+testAssertionMessage('foo', '\'foo\'');
+testAssertionMessage([], '[]');
+testAssertionMessage([1, 2, 3], '[ 1, 2, 3 ]');
+testAssertionMessage(/a/, '/a/');
+testAssertionMessage(/abc/gim, '/abc/gim');
+testAssertionMessage(function f() {}, '[Function: f]');
+testAssertionMessage(function() {}, '[Function]');
+testAssertionMessage({}, '{}');
+testAssertionMessage(circular, '{ y: 1, x: [Circular] }');
+testAssertionMessage({a: undefined, b: null}, '{ a: undefined, b: null }');
+testAssertionMessage({a: NaN, b: Infinity, c: -Infinity},
+                     '{ a: NaN, b: Infinity, c: -Infinity }');
+
+// #2893
+try {
+  assert.throws(function() {
+    assert.ifError(null);
+  });
+} catch (e) {
+  threw = true;
+  assert.strictEqual(e.message, 'Missing expected exception..');
+}
+assert.ok(threw);
+
+console.log('All OK');
diff --git a/test/node/parallel/test-http-catch-uncaughtexception.js b/test/node/parallel/test-http-catch-uncaughtexception.js
new file mode 100644 (file)
index 0000000..43d857b
--- /dev/null
@@ -0,0 +1,61 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+var common = require('node/common');
+var assert = require('assert');
+var http = require('http');
+
+var uncaughtCallback = common.mustCall(function(er) {
+  assert.strictEqual(er.message, 'get did fail');
+});
+
+process.on('uncaughtException', uncaughtCallback);
+
+var server = http.createServer(function(req, res) {
+  res.writeHead(200, { 'Content-Type': 'text/plain' });
+  res.end('bye');
+
+}).listen(0, function() {
+  http.get({ port: this.address().port }, function(res) {
+    res.resume();
+    throw new Error('get did fail');
+
+  }).on('close', function() {
+    server.close();
+  });
+});
diff --git a/test/node/parallel/test-http-status-message.js b/test/node/parallel/test-http-status-message.js
new file mode 100644 (file)
index 0000000..021bba3
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+require('node/common');
+var assert = require('assert');
+var http = require('http');
+var net = require('net');
+
+var s = http.createServer(function (req, res) {
+  res.statusCode = 200;
+  res.statusMessage = 'Custom Message';
+  res.end('');
+});
+
+s.listen(0, test);
+
+function test() {
+  var bufs = [];
+  var client = net.connect(this.address().port, function () {
+    client.write('GET / HTTP/1.1\r\nConnection: close\r\n\r\n');
+  });
+  client.on('data', function (chunk) {
+    bufs.push(chunk);
+  });
+  client.on('end', function () {
+    var head = Buffer.concat(bufs).toString().split('\r\n')[0];
+    assert.strictEqual('HTTP/1.1 200 Custom Message', head);
+    console.log('ok');
+    s.close();
+  });
+}
diff --git a/test/node/parallel/test-http-write-head.js b/test/node/parallel/test-http-write-head.js
new file mode 100644 (file)
index 0000000..fdac555
--- /dev/null
@@ -0,0 +1,91 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+var common = require('node/common');
+var assert = require('assert');
+var http = require('http');
+
+// Verify that ServerResponse.writeHead() works as setHeader.
+// Issue 5036 on github.
+
+var s = http.createServer(common.mustCall(function (req, res) {
+  res.setHeader('test', '1');
+
+  // toLowerCase() is used on the name argument, so it must be a string.
+  var threw = false;
+  try {
+    res.setHeader(0xf00, 'bar');
+  } catch (e) {
+    assert.ok(e instanceof TypeError);
+    threw = true;
+  }
+  assert.ok(threw, 'Non-string names should throw');
+
+  // undefined value should throw, via 979d0ca8
+  threw = false;
+  try {
+    res.setHeader('foo', undefined);
+  } catch (e) {
+    assert.ok(e instanceof Error);
+    assert.strictEqual(e.message, 'value required in setHeader(foo, value)');
+    threw = true;
+  }
+  assert.ok(threw, 'Undefined value should throw');
+
+  res.writeHead(200, { Test: '2' });
+
+  // assert.throws(function () {
+  assert.doesNotThrow(function () {
+    res.writeHead(100, {});
+  });
+
+  res.end();
+}));
+
+s.listen(0, common.mustCall(runTest));
+
+function runTest() {
+  http.get({ port: this.address().port }, common.mustCall(function (response) {
+    response.on('end', common.mustCall(function () {
+      assert.strictEqual(response.headers['test'], '1' /*'2'*/);
+      // assert.notStrictEqual(response.rawHeaders.indexOf('Test'), -1);
+      s.close();
+    }));
+    response.resume();
+  }));
+}
diff --git a/test/node/parallel/test-net-after-close.js b/test/node/parallel/test-net-after-close.js
new file mode 100644 (file)
index 0000000..fc9693d
--- /dev/null
@@ -0,0 +1,62 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+var common = require('node/common');
+var assert = require('assert');
+var net = require('net');
+
+var server = net.createServer(function(s) {
+  console.error('SERVER: got connection');
+  s.end();
+});
+
+server.listen(0, common.mustCall(function() {
+  var c = net.createConnection(this.address().port);
+  c.on('close', common.mustCall(function() {
+    console.error('connection closed');
+    assert.strictEqual(c._handle, null);
+    assert.doesNotThrow(function() {
+      c.setKeepAlive();
+      c.pause();
+      c.resume();
+      c.address();
+      c.remoteAddress;
+      c.remotePort;
+    });
+    server.close();
+  }));
+}));
diff --git a/test/node/parallel/test-net-bind-twice.js b/test/node/parallel/test-net-bind-twice.js
new file mode 100644 (file)
index 0000000..56336f8
--- /dev/null
@@ -0,0 +1,60 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+var common = require('node/common');
+var assert = require('assert');
+var net = require('net');
+
+var server1 = net.createServer(common.fail);
+server1.listen(0, '127.0.0.1', common.mustCall(function() {
+
+  var server2 = net.createServer(common.fail);
+
+  server2.on('error', common.mustCall(function(e) {
+    // EADDRINUSE have different value on OSX.
+    if (common.isOSX) {
+      assert.strictEqual(e, -48);
+    } else {
+      assert.strictEqual(e, -98);
+    }
+
+    server1.close();
+  }));
+
+  server2.listen(this.address().port, '127.0.0.1', common.fail);
+}));
diff --git a/test/node/parallel/test-net-end-without-connect.js b/test/node/parallel/test-net-end-without-connect.js
new file mode 100644 (file)
index 0000000..d90e5e8
--- /dev/null
@@ -0,0 +1,42 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+require('node/common');
+var net = require('net');
+
+var sock = new net.Socket();
+sock.end(); // Should not throw.
diff --git a/test/node/parallel/test-net-keepalive.js b/test/node/parallel/test-net-keepalive.js
new file mode 100644 (file)
index 0000000..5903e95
--- /dev/null
@@ -0,0 +1,65 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+var common = require('node/common');
+var assert = require('assert');
+var net = require('net');
+
+var serverConnection;
+var clientConnection;
+var echoServer = net.createServer(function(connection) {
+  serverConnection = connection;
+  setTimeout(function() {
+    serverConnection.end();
+    clientConnection.end();
+    echoServer.close();
+  }, 100);
+  connection.setTimeout(0);
+  assert.notStrictEqual(connection.setKeepAlive, undefined);
+  // send a keepalive packet after 50 ms
+  connection.setKeepAlive(true, 50);
+  connection.on('end', function() {
+    connection.end();
+  });
+});
+echoServer.listen(0);
+
+echoServer.on('listening', function() {
+  clientConnection = net.createConnection(this.address().port);
+  clientConnection.setTimeout(0);
+});
diff --git a/test/node/parallel/test-timers-clear-null-does-not-throw-error.js b/test/node/parallel/test-timers-clear-null-does-not-throw-error.js
new file mode 100644 (file)
index 0000000..25e8a87
--- /dev/null
@@ -0,0 +1,54 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+require('node/common');
+var assert = require('assert');
+
+// This test makes sure clearing timers with
+// 'null' or no input does not throw error
+
+assert.doesNotThrow(function() { clearInterval(null) });
+
+assert.doesNotThrow(function() { clearInterval() });
+
+assert.doesNotThrow(function() { clearTimeout(null) });
+
+assert.doesNotThrow(function() { clearTimeout() });
+
+// assert.doesNotThrow(function() { clearImmediate(null) });
+
+// assert.doesNotThrow(function() { clearImmediate() });
diff --git a/test/resources/greeting.txt b/test/resources/greeting.txt
new file mode 100644 (file)
index 0000000..3c3130b
--- /dev/null
@@ -0,0 +1 @@
+Hello IoT.js!!
\ No newline at end of file
diff --git a/test/resources/process/package.json b/test/resources/process/package.json
new file mode 100644 (file)
index 0000000..c827db8
--- /dev/null
@@ -0,0 +1,30 @@
+{
+  "version": "2.9.1",
+  "name": "npm",
+  "description": "a package manager for JavaScript",
+  "config": {
+    "publishtest": false
+  },
+  "homepage": "https://docs.npmjs.com/",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/npm/npm"
+  },
+  "bugs": {
+    "url": "http://github.com/npm/npm/issues"
+  },
+  "directories": {
+    "doc": "./doc",
+    "man": "./man",
+    "lib": "./lib",
+    "bin": "./bin"
+  },
+  "main": "./lib/npm.js",
+  "bin": "./bin/npm-cli.js",
+  "scripts": {
+    "test-legacy": "node ./test/run.js",
+    "test": "tap --timeout 240 test/tap/*.js",
+    "tap": "tap --timeout 240 test/tap/*.js"
+  },
+  "license": "Artistic-2.0"
+}
diff --git a/test/resources/readdir/DO_NOT_MODIFY_THIS_FOLDER b/test/resources/readdir/DO_NOT_MODIFY_THIS_FOLDER
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/test/resources/readdir/This_is_a_directory/.gitkeep b/test/resources/readdir/This_is_a_directory/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/test/resources/readdir/This_is_another_directory/.gitkeep b/test/resources/readdir/This_is_another_directory/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/test/resources/readdir/regular.txt b/test/resources/readdir/regular.txt
new file mode 100644 (file)
index 0000000..3c3130b
--- /dev/null
@@ -0,0 +1 @@
+Hello IoT.js!!
\ No newline at end of file
diff --git a/test/resources/rename.txt b/test/resources/rename.txt
new file mode 100644 (file)
index 0000000..3c3130b
--- /dev/null
@@ -0,0 +1 @@
+Hello IoT.js!!
\ No newline at end of file
diff --git a/test/resources/test1.txt b/test/resources/test1.txt
new file mode 100644 (file)
index 0000000..3c3ecf7
--- /dev/null
@@ -0,0 +1 @@
+TEST File Read & Write
diff --git a/test/resources/test2.txt b/test/resources/test2.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/test/resources/test_console_stdout.txt b/test/resources/test_console_stdout.txt
new file mode 100644 (file)
index 0000000..ea97cf7
--- /dev/null
@@ -0,0 +1,8 @@
+Hello IoT.js!!
+1
+2
+3
+13
+1,2,3
+1 2 3
+a 1 b 2 c 3
diff --git a/test/resources/tobeornottobe.txt b/test/resources/tobeornottobe.txt
new file mode 100644 (file)
index 0000000..08687b1
--- /dev/null
@@ -0,0 +1,35 @@
+To be, or not to be, that is the Question:
+Whether ’tis Nobler in the mind to ſuffer
+The Slings and Arrows of outragious Fortune,
+Or to take Armes against a Sea of troubles,
+And by opposing end them: to dye, to ſleepe
+No more; and by a sleep, to say we end
+The Heart-ake, and the thouſand Naturall ſhockes
+That Flesh is there too? "Tis a consummation
+Deuoutly to be wiſh'd. To dye to sleepe,
+To sleep, perchance to Dream; I, there's the rub,
+For in that sleep of death, what dreams may come,
+When we haue ſhufflel’d off this mortall coile,
+Muſt giue us pause. There's the respect
+That makes Calamity of long life:
+For who would beare the Whips and Scornes of time,
+The Oppreſſors wrong, the poore mans Contumely,
+The pangs of diſpriz’d Loue, the Lawes delay,
+The inſolence of Office, and the Spurnes
+That patient merit of the vnworthy takes,
+When he himſelfe might his Quietus make
+With a bare Bodkin? Who would theſe Fardles beare
+To grunt and ſweat vnder a weary life,
+But that the dread of ſomething after death,
+The vndiſcouered Countrey, from whoſe Borne
+No Traueller returnes, Puzels the will,
+And makes vs rather beare those illes we haue,
+Then flye to others that we know not of.
+Thus Conſcience does make Cowards of vs all,
+And thus the Natiue hew of Resolution
+Is ſicklied o’re, with the pale caſt of Thought,
+And enterprizes of great pith and moment,
+With this regard their Currants turne away,
+And looſe the name of Action. Soft you now,
+The faire Ophelia? Nimph, in thy Orizons
+Be all my ſinnes remembred.
\ No newline at end of file
diff --git a/test/run_fail/test_assert_equal.js b/test/run_fail/test_assert_equal.js
new file mode 100644 (file)
index 0000000..b82766c
--- /dev/null
@@ -0,0 +1,19 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+
+assert.equal(1, 2);
diff --git a/test/run_fail/test_assert_fail.js b/test/run_fail/test_assert_fail.js
new file mode 100644 (file)
index 0000000..3c6cd84
--- /dev/null
@@ -0,0 +1,19 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+
+assert.fail();
diff --git a/test/run_fail/test_assert_notequal.js b/test/run_fail/test_assert_notequal.js
new file mode 100644 (file)
index 0000000..cf155b9
--- /dev/null
@@ -0,0 +1,19 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+
+assert.notEqual(1, 1);
diff --git a/test/run_fail/test_events_emit_error.js b/test/run_fail/test_events_emit_error.js
new file mode 100644 (file)
index 0000000..9140e7f
--- /dev/null
@@ -0,0 +1,21 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var EventEmitter = require('events').EventEmitter;
+
+var ee = new EventEmitter();
+
+ee.emit('error');
diff --git a/test/run_fail/test_fs_callbacks_called.js b/test/run_fail/test_fs_callbacks_called.js
new file mode 100644 (file)
index 0000000..0df7a85
--- /dev/null
@@ -0,0 +1,40 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert')
+var invocation_count = 0;
+var callback_count = 13;
+
+var callback = function () {
+    if (++invocation_count == callback_count) {
+        assert.fail("pass") // All the callbacks were called
+    }
+}
+
+var fs = require('fs');
+fs.open("", "r", callback);
+fs.close(0, callback);
+fs.read(0, Buffer(1), 0, 0, 0, callback);
+fs.write(0, Buffer(1), 0, 0, 0, callback);
+fs.readFile("", callback);
+fs.writeFile("", Buffer(1), callback);
+fs.rename("", "", callback);
+fs.stat("", callback);
+fs.exists("", callback);
+fs.unlink("", callback);
+fs.mkdir("", callback);
+fs.rmdir("", callback);
+fs.readdir("", callback);
diff --git a/test/run_fail/test_iotjs_runtime_error.js b/test/run_fail/test_iotjs_runtime_error.js
new file mode 100644 (file)
index 0000000..d0ea00d
--- /dev/null
@@ -0,0 +1,19 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var a = null;
+
+a.no_exist_function();
diff --git a/test/run_fail/test_iotjs_syntax_error.js b/test/run_fail/test_iotjs_syntax_error.js
new file mode 100644 (file)
index 0000000..76725e0
--- /dev/null
@@ -0,0 +1,16 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+for syntax error
diff --git a/test/run_fail/test_module_require_invalid_file.js b/test/run_fail/test_module_require_invalid_file.js
new file mode 100644 (file)
index 0000000..f1acad0
--- /dev/null
@@ -0,0 +1,17 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+require('no exist file path');
diff --git a/test/run_fail/test_process_exitcode_arg.js b/test/run_fail/test_process_exitcode_arg.js
new file mode 100644 (file)
index 0000000..1808c7c
--- /dev/null
@@ -0,0 +1,24 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+
+process.on('exit', function(code) {
+  assert.equal(1, code);
+  assert.fail();
+});
+
+process.exit(1);
diff --git a/test/run_fail/test_process_exitcode_var.js b/test/run_fail/test_process_exitcode_var.js
new file mode 100644 (file)
index 0000000..3bafef7
--- /dev/null
@@ -0,0 +1,25 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+
+ process.on('exit', function(code) {
+   assert.equal(2, code);
+   assert.fail();
+ });
+
+process.exitCode = 2;
+process.exit();
diff --git a/test/run_fail/test_process_explicit_exit.js b/test/run_fail/test_process_explicit_exit.js
new file mode 100644 (file)
index 0000000..e1a20bd
--- /dev/null
@@ -0,0 +1,23 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+
+process.on('exit', function() {
+  assert.fail();
+});
+
+process.exit();
diff --git a/test/run_fail/test_process_implicit_exit.js b/test/run_fail/test_process_implicit_exit.js
new file mode 100644 (file)
index 0000000..a6d5a78
--- /dev/null
@@ -0,0 +1,21 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+
+process.on('exit', function() {
+  assert.fail();
+});
diff --git a/test/run_pass/issue/issue-1046.js b/test/run_pass/issue/issue-1046.js
new file mode 100644 (file)
index 0000000..1ae5a96
--- /dev/null
@@ -0,0 +1,19 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var Buffer = require('buffer');
+var assert = require('assert');
+
+assert.equal(Buffer("").readUInt16LE(10, true), 0);
diff --git a/test/run_pass/issue/issue-133.js b/test/run_pass/issue/issue-133.js
new file mode 100644 (file)
index 0000000..a58d3e4
--- /dev/null
@@ -0,0 +1,18 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+// FIX: issue #133.
+console.log("");
diff --git a/test/run_pass/issue/issue-137.js b/test/run_pass/issue/issue-137.js
new file mode 100644 (file)
index 0000000..51b9c08
--- /dev/null
@@ -0,0 +1,37 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+// FIX: issue #137.
+console.log('hello world');
+console.log(1);
+console.log(9 + 10);
+console.log(null);
+console.log(true);
+console.log(false);
+console.log(undefined);
+console.log(0.09);
+console.log(NaN);
+console.log(function () {});
+console.log(function f() { return 0; });
+console.log({});
+console.log({a:1, b:2});
+console.log([]);
+console.log([1,2,3]);
+console.log("%s=%d", "1+10", 1 + 10);
+console.log("%s+%s=%d", 2, 10, 2 + 10);
+console.log("%d+%d=%d", 3, 10, 3 + 10);
+console.log("%s+%s=%s", 4, 10, 4 + 10);
+console.log("%d+%d=%d", "5", "10", 5 + 10);
diff --git a/test/run_pass/issue/issue-198.js b/test/run_pass/issue/issue-198.js
new file mode 100644 (file)
index 0000000..23bec1b
--- /dev/null
@@ -0,0 +1,24 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+
+assert.throws(
+  function() {
+    process.binding("builtin not exist");
+  }
+  , Error
+);
diff --git a/test/run_pass/issue/issue-223.js b/test/run_pass/issue/issue-223.js
new file mode 100644 (file)
index 0000000..ba8ba0a
--- /dev/null
@@ -0,0 +1,26 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+var net = require("net");
+
+
+assert.throws(
+  function() {
+    net.Server.prototype._createTCP(375);
+  },
+  Error
+);
diff --git a/test/run_pass/issue/issue-266.js b/test/run_pass/issue/issue-266.js
new file mode 100644 (file)
index 0000000..4f6541c
--- /dev/null
@@ -0,0 +1,43 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var net = require('net');
+var assert = require('assert');
+
+
+var server = net.createServer();
+var port = 30266;
+
+server.listen(port);
+
+server.on('connection', function(socket) {
+  socket.on('data', function(data) {
+    server.close()
+  });
+  socket.on('finish', function() {
+    socket.destroy();
+    socket.destroy();
+    socket.destroy();
+  });
+});
+
+var socket = new net.Socket();
+socket.connect(port, "127.0.0.1");
+socket.end('test');
+
+process.on('exit', function() {
+  assert.equal(server._socketCount, 0);
+});
diff --git a/test/run_pass/issue/issue-323.js b/test/run_pass/issue/issue-323.js
new file mode 100644 (file)
index 0000000..db6b1f6
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var fileName = "";
+
+assert.throws(
+    function() {
+      var stats1 = fs.statSync(fileName);
+    },
+    Error
+);
+
+assert.throws(
+  function() {
+    var open1 = fs.openSync(fileName, 'r');
+  },
+  Error
+);
diff --git a/test/run_pass/issue/issue-816.js b/test/run_pass/issue/issue-816.js
new file mode 100644 (file)
index 0000000..9adf128
--- /dev/null
@@ -0,0 +1,31 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var Buffer = require('buffer');
+var assert = require('assert');
+
+assert.throws(function () {
+  var buf = new Buffer("ABCDEF");
+  var o = {
+    _builtin: {
+      compare: function () {
+        buf._builtin.compare.call(this, arguments);
+      }
+    },
+    compare: buf.compare
+  };
+
+  o.compare(buf);
+}, Error);
diff --git a/test/run_pass/require1/module_cache.js b/test/run_pass/require1/module_cache.js
new file mode 100644 (file)
index 0000000..feb94b3
--- /dev/null
@@ -0,0 +1,20 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/**
+  @NOTEST
+*/
+
+exports.i = -100;
diff --git a/test/run_pass/require1/require_add.js b/test/run_pass/require1/require_add.js
new file mode 100644 (file)
index 0000000..6daa934
--- /dev/null
@@ -0,0 +1,22 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/*
+  @NOTEST
+*/
+
+exports.add = function(a, b) {
+  return a + b;
+};
diff --git a/test/run_pass/require1/test_index/add2.js b/test/run_pass/require1/test_index/add2.js
new file mode 100644 (file)
index 0000000..9841ea6
--- /dev/null
@@ -0,0 +1,22 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/*
+  @NOTEST
+*/
+
+exports.add2 = function(a, b) {
+  return a + b;
+}
diff --git a/test/run_pass/require1/test_index/index.js b/test/run_pass/require1/test_index/index.js
new file mode 100644 (file)
index 0000000..590c324
--- /dev/null
@@ -0,0 +1,26 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/*
+  @NOTEST
+*/
+
+exports.add = function(a, b) {
+  return a + b;
+};
+
+var x = require("lib/multi.js");
+exports.multi = x.multi;
+exports.add2 = x.add2;
diff --git a/test/run_pass/require1/test_index/lib/multi.js b/test/run_pass/require1/test_index/lib/multi.js
new file mode 100644 (file)
index 0000000..b757e5b
--- /dev/null
@@ -0,0 +1,24 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/*
+  @NOTEST
+*/
+
+exports.multi = function(a, b) {
+  return a * b;
+};
+
+exports.add2 = require('../add2').add2;
diff --git a/test/run_pass/require1/test_index/package.json b/test/run_pass/require1/test_index/package.json
new file mode 100644 (file)
index 0000000..2584036
--- /dev/null
@@ -0,0 +1,3 @@
+{
+  "main": "index_test"
+}
diff --git a/test/run_pass/require1/test_pkg/add2.js b/test/run_pass/require1/test_pkg/add2.js
new file mode 100644 (file)
index 0000000..9841ea6
--- /dev/null
@@ -0,0 +1,22 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/*
+  @NOTEST
+*/
+
+exports.add2 = function(a, b) {
+  return a + b;
+}
diff --git a/test/run_pass/require1/test_pkg/lib/multi.js b/test/run_pass/require1/test_pkg/lib/multi.js
new file mode 100644 (file)
index 0000000..b757e5b
--- /dev/null
@@ -0,0 +1,24 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/*
+  @NOTEST
+*/
+
+exports.multi = function(a, b) {
+  return a * b;
+};
+
+exports.add2 = require('../add2').add2;
diff --git a/test/run_pass/require1/test_pkg/main.js b/test/run_pass/require1/test_pkg/main.js
new file mode 100644 (file)
index 0000000..590c324
--- /dev/null
@@ -0,0 +1,26 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/*
+  @NOTEST
+*/
+
+exports.add = function(a, b) {
+  return a + b;
+};
+
+var x = require("lib/multi.js");
+exports.multi = x.multi;
+exports.add2 = x.add2;
diff --git a/test/run_pass/require1/test_pkg/package.json b/test/run_pass/require1/test_pkg/package.json
new file mode 100644 (file)
index 0000000..c13b8cf
--- /dev/null
@@ -0,0 +1,3 @@
+{
+  "main": "main.js"
+}
diff --git a/test/run_pass/test_adc.js b/test/run_pass/test_adc.js
new file mode 100644 (file)
index 0000000..6302467
--- /dev/null
@@ -0,0 +1,94 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var Adc = require('adc');
+var assert = require('assert');
+var adc = new Adc();
+var configuration = {};
+
+if (process.platform === 'linux') {
+  configuration.device =
+    '/sys/devices/12d10000.adc/iio:device0/in_voltage0_raw';
+} else if (process.platform === 'nuttx') {
+  configuration.pin = require('stm32f4dis').pin.ADC1_3;
+} else {
+  assert.fail();
+}
+
+asyncTest();
+
+// read async test
+function asyncTest() {
+  var adc0 = adc.open(configuration, function(err) {
+    console.log('ADC initialized');
+
+    if (err) {
+      assert.fail();
+    }
+
+    var loopCnt = 5;
+
+    console.log('test1 start(read async test)');
+    var test1Loop = setInterval(function() {
+      if (--loopCnt < 0) {
+        console.log('test1 complete');
+        clearInterval(test1Loop);
+        adc0.closeSync();
+        syncTestst();
+      } else {
+        adc0.read(function(err, value) {
+          if (err) {
+            console.log('read failed');
+            assert.fail();
+          }
+
+          console.log(value);
+        });
+      }
+    }, 1000);
+  });
+}
+
+// read sync test
+function syncTestst() {
+  var adc0 = adc.open(configuration, function(err) {
+    console.log('ADC initialized');
+
+    if (err) {
+      assert.fail();
+    }
+
+    var loopCnt = 5,
+        value = -1;
+
+    console.log('test2 start(read sync test)');
+    var test2Loop = setInterval(function() {
+      if (--loopCnt < 0) {
+        console.log('test2 complete');
+        clearInterval(test2Loop);
+        adc0.close();
+      } else {
+        value = adc0.readSync();
+        if (value < 0) {
+          console.log('read failed');
+          assert.fail();
+        } else {
+          console.log(value);
+        }
+      }
+    }, 1000);
+  });
+}
diff --git a/test/run_pass/test_assert.js b/test/run_pass/test_assert.js
new file mode 100644 (file)
index 0000000..a694931
--- /dev/null
@@ -0,0 +1,118 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+
+
+assert.assert(1 == 1);
+
+assert.equal(1, 1);
+assert.notEqual(1, 2);
+
+assert.strictEqual(0, 0);
+assert.throws(function() {
+  assert.strictEqual(1, 0); },
+  assert.AssertionError);
+
+assert.throws(function() {
+  assert.notStrictEqual(true, true);
+}, assert.AssertionError);
+
+assert.throws(function() {
+  assert.notStrictEqual(true, true);
+}, assert.AssertionError, "something");
+
+assert.throws(function() {
+  assert.throws(function() {});
+}, assert.AssertionError);
+
+assert.throws(function() {
+  assert.throws(function() {
+    assert.strictEqual(1, 0);
+  }, TypeError);
+}, assert.AssertionError);
+
+assert.doesNotThrow(function() {
+  assert.strictEqual(1, 1);
+}, "something");
+
+assert.throws(function() {
+  assert.strictEqual(1, 0);
+}, assert.AssertionError, assert.AssertionError.name="something");
+
+assert.equal(0, false);
+assert.notStrictEqual(0, false);
+
+assert.throws(
+  function() {
+    assert.equal(1, 2);
+  },
+  assert.AssertionError
+);
+
+assert.throws(
+  function() {
+    assert.assert(1 == 2);
+  },
+  assert.AssertionError
+);
+
+assert.doesNotThrow(
+  function() {
+    assert.assert(1 == 1);
+  }
+);
+
+assert.throws(
+  function() {
+    assert.doesNotThrow(
+      function() {
+        assert.assert(1 == 2);
+      }
+    );
+  },
+  assert.AssertionError
+);
+
+try {
+  assert.assert(false, 'assert test');
+} catch (e) {
+  assert.equal(e.name, 'AssertionError');
+  assert.equal(e.actual, false);
+  assert.equal(e.expected, true);
+  assert.equal(e.operator, '==');
+  assert.equal(e.message, 'assert test');
+}
+
+try {
+  assert.equal(1, 2, 'assert.equal test');
+} catch (e) {
+  assert.equal(e.name, 'AssertionError');
+  assert.equal(e.actual, 1);
+  assert.equal(e.expected, 2);
+  assert.equal(e.operator, '==');
+  assert.equal(e.message, 'assert.equal test');
+}
+
+
+try {
+  assert.fail('actual', 'expected', 'message', 'operator');
+} catch (e) {
+  assert.equal(e.name, 'AssertionError');
+  assert.equal(e.actual, 'actual');
+  assert.equal(e.expected, 'expected');
+  assert.equal(e.operator, 'operator');
+  assert.equal(e.message, 'message');
+}
diff --git a/test/run_pass/test_ble_advertisement.js b/test/run_pass/test_ble_advertisement.js
new file mode 100644 (file)
index 0000000..2cdb910
--- /dev/null
@@ -0,0 +1,40 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var ble = require('ble');
+
+ble.on('stateChange', function(state){
+  console.log('onStateChange: ' + state);
+
+  if (state == 'poweredOn') {
+    ble.startAdvertising('iotjs', ['180F'], function(err) {
+      if (err) console.log(err);
+      else {
+
+        setTimeout(function() {
+          ble.stopAdvertising(function(err) {
+            if (err) console.log(err);
+            else console.log('stop advertising.');
+          });
+        }, 5000);
+      }
+    });
+  } else {
+    ble.stopAdvertising(function(err) {
+      if (err) console.log(err);
+      else console.log('stop advertising.');
+    });
+  }
+});
diff --git a/test/run_pass/test_ble_setservices.js b/test/run_pass/test_ble_setservices.js
new file mode 100644 (file)
index 0000000..999ee26
--- /dev/null
@@ -0,0 +1,114 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var ble = require('ble');
+
+var BlenoPrimaryService = ble.PrimaryService;
+var BlenoCharacteristic = ble.Characteristic;
+
+var util = require('util');
+
+var EchoCharacteristic = function() {
+  BlenoCharacteristic.call(this, {
+    uuid: 'ec0e',
+    properties: ['read', 'write', 'notify'],
+    value: null
+  });
+
+  this._value = new Buffer(0);
+  this._updateValueCallback = null;
+};
+
+util.inherits(EchoCharacteristic, BlenoCharacteristic);
+
+EchoCharacteristic.prototype.onReadRequest = function(offset, callback) {
+  console.log('EchoCharacteristic - onReadRequest: value = ' + this._value.toString('hex'));
+
+  callback(this.RESULT_SUCCESS, this._value);
+};
+
+EchoCharacteristic.prototype.onWriteRequest = function(data, offset, withoutResponse, callback) {
+  this._value = data;
+
+  console.log('EchoCharacteristic - onWriteRequest: value = ' + this._value.toString('hex'));
+
+  if (this._updateValueCallback) {
+    console.log('EchoCharacteristic - onWriteRequest: notifying');
+
+    this._updateValueCallback(this._value);
+  }
+
+  callback(this.RESULT_SUCCESS);
+};
+
+EchoCharacteristic.prototype.onSubscribe = function(maxValueSize, updateValueCallback) {
+  console.log('EchoCharacteristic - onSubscribe');
+
+  this._updateValueCallback = updateValueCallback;
+};
+
+EchoCharacteristic.prototype.onUnsubscribe = function() {
+  console.log('EchoCharacteristic - onUnsubscribe');
+
+  this._updateValueCallback = null;
+};
+
+console.log('ble - echo');
+
+ble.on('stateChange', function(state) {
+  console.log('on -> stateChange: ' + state);
+
+  if (state === 'poweredOn') {
+    ble.startAdvertising('iotjs_echo', ['ec00']);
+  } else {
+    ble.stopAdvertising();
+  }
+});
+
+ble.on('advertisingStart', function(error) {
+  console.log('on -> advertisingStart: ' + (error ? 'error ' + error : 'success'));
+
+  if (!error) {
+    ble.setServices([
+      new BlenoPrimaryService({
+        uuid: 'ec00',
+        characteristics: [
+          new EchoCharacteristic()
+        ]
+      })
+    ]);
+  }
+});
diff --git a/test/run_pass/test_ble_setservices_central.js b/test/run_pass/test_ble_setservices_central.js
new file mode 100644 (file)
index 0000000..30bff79
--- /dev/null
@@ -0,0 +1,132 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* Copyright (C) 2015 Sandeep Mistry sandeep.mistry@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+var noble = require('../..');
+
+var echoServiceUuid = 'ec00';
+var echoCharacteristicUuid = 'ec0e';
+
+noble.on('stateChange', function(state) {
+  if (state === 'poweredOn') {
+    //
+    // Once the BLE radio has been powered on, it is possible
+    // to begin scanning for services. Pass an empty array to
+    // scan for all services (uses more time and power).
+    //
+    console.log('scanning...');
+    noble.startScanning([echoServiceUuid], false);
+  }
+  else {
+    noble.stopScanning();
+  }
+})
+
+var echoService = null;
+var echoCharacteristic = null;
+
+noble.on('discover', function(peripheral) {
+  // we found a peripheral, stop scanning
+  noble.stopScanning();
+
+  //
+  // The advertisment data contains a name, power level (if available),
+  // certain advertised service uuids, as well as manufacturer data,
+  // which could be formatted as an iBeacon.
+  //
+  console.log('found peripheral:', peripheral.advertisement);
+  //
+  // Once the peripheral has been discovered, then connect to it.
+  // It can also be constructed if the uuid is already known.
+  ///
+  peripheral.connect(function(err) {
+    //
+    // Once the peripheral has been connected, then discover the
+    // services and characteristics of interest.
+    //
+    peripheral.discoverServices([echoServiceUuid], function(err, services) {
+      services.forEach(function(service) {
+        //
+        // This must be the service we were looking for.
+        //
+        console.log('found service:', service.uuid);
+
+        //
+        // So, discover its characteristics.
+        //
+        service.discoverCharacteristics([], function(err, characteristics) {
+
+          characteristics.forEach(function(characteristic) {
+            //
+            // Loop through each characteristic and match them to the
+            // UUIDs that we know about.
+            //
+            console.log('found characteristic:', characteristic.uuid);
+
+            if (echoCharacteristicUuid == characteristic.uuid) {
+              echoCharacteristic = characteristic;
+            }
+          })
+
+          //
+          // Check to see if we found all of our characteristics.
+          //
+          if (echoCharacteristic) {
+            bakePizza();
+          }
+          else {
+            console.log('missing characteristics');
+          }
+        })
+      })
+    })
+  })
+})
+
+function bakePizza() {
+  var crust = new Buffer("Hello BLE Service.");
+  echoCharacteristic.write(crust, false, function(err) {
+    if (!err) {
+      echoCharacteristic.read(function (err, buffer) {
+        if (!err) {
+          console.log('BLE says' + buffer.toString());
+        }
+      });
+    }
+    else {
+      console.log('crust error');
+    }
+  })
+}
diff --git a/test/run_pass/test_buffer.js b/test/run_pass/test_buffer.js
new file mode 100644 (file)
index 0000000..3d0664d
--- /dev/null
@@ -0,0 +1,179 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var assert = require('assert');
+
+var buff1 = new Buffer("test");
+assert.equal(buff1.toString(), "test");
+assert.equal(buff1.toString(0, 0), "");
+assert.equal(buff1.toString(0, 1), "t");
+assert.equal(buff1.toString(0, 2), "te");
+assert.equal(buff1.toString(0, 3), "tes");
+assert.equal(buff1.toString(0, 4), "test");
+assert.equal(buff1.toString(1, 4), "est");
+assert.equal(buff1.toString(2, 4), "st");
+assert.equal(buff1.toString(3, 4), "t");
+assert.equal(buff1.toString(4, 4), "");
+assert.equal(buff1.length, 4);
+
+var buff2 = new Buffer(10);
+buff2.write("abcde");
+assert.equal(buff2.toString(), "abcde");
+assert.equal(buff2.length ,10);
+
+buff2.write("fgh", 5);
+assert.equal(buff2.toString(), "abcdefgh");
+assert.equal(buff2.length ,10);
+
+assert.throws(function() { buff2.write("ijk", -1); }, RangeError);
+assert.throws(function() { buff2.write("ijk", 10); }, RangeError);
+
+var buff3 = Buffer.concat([buff1, buff2]);
+assert.equal(buff3.toString(), "testabcdefgh");
+assert.equal(buff3.length ,14);
+
+var buff4 = new Buffer(10);
+var buff5 = new Buffer('a1b2c3');
+buff5.copy(buff4);
+assert.equal(buff4.toString(), 'a1b2c3');
+buff5.copy(buff4, 4, 2);
+assert.equal(buff4.toString(), 'a1b2b2c3');
+assert.throws(function() { buff5.copy(buff4, -1); }, RangeError);
+assert.throws(function() { buff2.write(null, 0, 0);}, TypeError);
+assert.throws(function() { buff5.copy(null); }, TypeError);
+assert.throws(function() { buff5.compare(null); }, TypeError);
+assert.throws(function() { buff5.equals(null); }, TypeError);
+assert.throws(function() { Buffer.concat([buff1, null]);}, TypeError);
+assert.throws(function() {Buffer.concat(null, null); }, TypeError);
+assert.throws(function() {var buff_err = new Buffer(null); }, TypeError);
+
+var buffer_err = new Buffer(-1);
+
+var buff_1 = new Buffer("asd");
+var buff_2 = new Buffer(2);
+buff_1.copy(buff_2, 0, 0, 2);
+buff_2.write("asd", 0, 3);
+
+assert.throws(function() {var buff_3 = new Buffer('asd', 'hex'); }, TypeError);
+
+var buff_3 = new Buffer(4);
+assert.throws(function() {buff_3.writeUInt8(10000, 0); }, TypeError);
+var buff_4 = new Buffer(4);
+assert.throws(function() {buff_4.writeUInt8(0x11, 3000); }, RangeError);
+var buff_5 = new Buffer(4);
+assert.throws(function() {buff_5.readUInt8(3000); }, RangeError);
+var buff_6 = buff_5.slice(undefined, 2);
+
+buff_5.fill("asd");
+
+buff_5.readInt8(3, true);
+buff_5.writeUInt32LE(0, 0, true);
+buff_5.writeUInt8(0, 0, true);
+buff_5.writeUInt16LE(0, 0, true);
+
+
+var buff6 = buff3.slice(1);
+assert.equal(buff6.toString(), 'estabcdefgh');
+assert.equal(buff6.length, 13);
+
+var buff7 = buff6.slice(3, 5);
+assert.equal(buff7.toString(), 'ab');
+assert.equal(buff7.length, 2);
+
+var buff8 = new Buffer(buff5);
+assert.equal(buff8.toString(), 'a1b2c3');
+assert.equal(buff8.equals(buff5), true);
+assert.equal(buff8.equals(buff6), false);
+
+var buff9 = new Buffer('abcabcabcd');
+var buff10 = buff9.slice(0, 3);
+var buff11 = buff9.slice(3, 6);
+var buff12 = buff9.slice(6);
+assert.equal(buff10.equals(buff11), true);
+assert.equal(buff11.equals(buff10), true);
+assert.equal(buff11.equals(buff12), false);
+assert.equal(buff10.compare(buff11), 0);
+assert.equal(buff11.compare(buff10), 0);
+assert.equal(buff11.compare(buff12), -1);
+assert.equal(buff12.compare(buff11), 1);
+
+assert.equal(buff9.slice(-2).toString(), 'cd');
+assert.equal(buff9.slice(-3, -2).toString(), 'b');
+assert.equal(buff9.slice(0, -2).toString(), 'abcabcab');
+
+
+assert.equal(Buffer.isBuffer(buff9), true);
+assert.equal(Buffer.isBuffer(1), false);
+assert.equal(Buffer.isBuffer({}), false);
+assert.equal(Buffer.isBuffer('1'), false);
+assert.equal(Buffer.isBuffer([1]), false);
+assert.equal(Buffer.isBuffer([buff1]), false);
+assert.equal(Buffer.isBuffer({obj:buff1}), false);
+
+
+assert.equal(buff3.toString(), 'testabcdefgh');
+
+
+var buff13 = new Buffer(4);
+buff13.writeUInt8(0x11, 0);
+assert.equal(buff13.readUInt8(0), 0x11);
+buff13.writeUInt16LE(0x3456, 1);
+assert.equal(buff13.readUInt8(1), 0x56);
+assert.equal(buff13.readUInt8(2), 0x34);
+assert.equal(buff13.readUInt16LE(1), 0x3456);
+buff13.writeUInt32LE(0x89abcdef, 0);
+assert.equal(buff13.readUInt8(0), 0xef);
+assert.equal(buff13.readUInt8(1), 0xcd);
+assert.equal(buff13.readUInt8(2), 0xab);
+assert.equal(buff13.readUInt8(3), 0x89);
+assert.equal(buff13.readUInt16LE(0), 0xcdef);
+assert.equal(buff13.readUInt16LE(2), 0x89ab);
+
+
+var buff14 = new Buffer([0x01, 0xa1, 0xfb]);
+assert.equal(buff14.readUInt8(0), 0x01);
+assert.equal(buff14.readUInt8(1), 0xa1);
+assert.equal(buff14.readUInt8(2), 0xfb);
+assert.equal(buff14.readInt8(2), -5);
+assert.equal(buff14.toString('hex'), '01a1fb');
+
+var buff15 = new Buffer('7456a9', 'hex');
+assert.equal(buff15.length, 3);
+assert.equal(buff15.readUInt8(0), 0x74);
+assert.equal(buff15.readUInt8(1), 0x56);
+assert.equal(buff15.readUInt8(2), 0xa9);
+assert.equal(buff15.toString('hex'), '7456a9');
+
+var buff16 = new Buffer(4);
+var ret = buff16.fill(7);
+assert.equal(buff16.readInt8(0), 7);
+assert.equal(buff16.readInt8(1), 7);
+assert.equal(buff16.readInt8(2), 7);
+assert.equal(buff16.readInt8(3), 7);
+assert.equal(buff16, ret);
+buff16.fill(13+1024);
+assert.equal(buff16.readInt8(0), 13);
+assert.equal(buff16.readInt8(1), 13);
+assert.equal(buff16.readInt8(2), 13);
+assert.equal(buff16.readInt8(3), 13);
+
+assert.equal(Buffer(new Array()).toString(), '');
+assert.equal(new Buffer(1).readUInt8(1, true), 0);
+assert.equal(new Buffer(1).readUInt16LE({}, true), 0);
+
+var buff17 = new Buffer("a");
+assert.throws(function() { buff17.fill(8071).toString(); }, TypeError);
diff --git a/test/run_pass/test_buffer_builtin.js b/test/run_pass/test_buffer_builtin.js
new file mode 100644 (file)
index 0000000..66d3d57
--- /dev/null
@@ -0,0 +1,111 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var assert = require('assert');
+
+
+var buff1 = new Buffer("test");
+assert.equal(buff1._builtin.toString(0, 0), "");
+assert.equal(buff1._builtin.toString(0, 1), "t");
+assert.equal(buff1._builtin.toString(0, 2), "te");
+assert.equal(buff1._builtin.toString(0, 3), "tes");
+assert.equal(buff1._builtin.toString(0, 4), "test");
+assert.equal(buff1._builtin.toString(1, 4), "est");
+assert.equal(buff1._builtin.toString(2, 4), "st");
+assert.equal(buff1._builtin.toString(3, 4), "t");
+assert.equal(buff1._builtin.toString(4, 4), "");
+
+assert.equal(buff1._builtin.toString(-1, 5), "test");
+assert.equal(buff1._builtin.toString(-1, 2), "te");
+assert.equal(buff1._builtin.toString(2, 5), "st");
+
+
+var buff2 = new Buffer(10);
+buff2._builtin.write("abcde", 0, 5);
+assert.equal(buff2.toString(), "abcde");
+assert.equal(buff2.length, 10);
+
+buff2._builtin.write("fgh", 5, 3);
+assert.equal(buff2.toString(), "abcdefgh");
+assert.equal(buff2.length, 10);
+
+buff2._builtin.write("AB", 0, 10);
+assert.equal(buff2.toString(), "ABcdefgh");
+assert.equal(buff2.length, 10);
+
+buff2._builtin.write("ab", -1, 11);
+assert.equal(buff2.toString(), "abcdefgh");
+assert.equal(buff2.length, 10);
+
+buff2._builtin.write("ijklmnopqrstu", 8, 5);
+assert.equal(buff2.toString(), "abcdefghij");
+assert.equal(buff2.length, 10);
+
+buff2._builtin.write("\0\0", 8, 2);
+assert.equal(buff2.toString(), "abcdefgh");
+assert.equal(buff2.length, 10);
+
+
+var buff3 = Buffer.concat([buff1, buff2]);
+
+
+var buff4 = new Buffer(10);
+var buff5 = new Buffer('a1b2c3');
+buff5._builtin.copy(buff4, 0, 0, 6);
+assert.equal(buff4.toString(), 'a1b2c3');
+buff5._builtin.copy(buff4, 4, 2, 6);
+assert.equal(buff4.toString(), 'a1b2b2c3');
+
+
+var buff6 = buff3._builtin.slice(1, buff3.length);
+assert.equal(buff6.toString(), 'estabcdefgh');
+assert.equal(buff6.length, 13);
+
+var buff7 = buff6._builtin.slice(3, 5);
+assert.equal(buff7.toString(), 'ab');
+assert.equal(buff7.length, 2);
+
+var buff8 = new Buffer(buff5);
+assert.equal(buff8.toString(), 'a1b2c3');
+assert.equal(buff8.equals(buff5), true);
+assert.equal(buff8.equals(buff6), false);
+
+var buff9 = new Buffer('abcabcabcd');
+var buff10 = buff9._builtin.slice(0, 3);
+var buff11 = buff9._builtin.slice(3, 6);
+var buff12 = buff9._builtin.slice(6, buff9.length);
+assert.equal(buff10.equals(buff11), true);
+assert.equal(buff11.equals(buff10), true);
+assert.equal(buff11.equals(buff12), false);
+assert.equal(buff10.compare(buff11), 0);
+assert.equal(buff11.compare(buff10), 0);
+assert.equal(buff11.compare(buff12), -1);
+assert.equal(buff12.compare(buff11), 1);
+
+assert.equal(buff9._builtin.slice(-2, buff9.length).toString(), 'cd');
+assert.equal(buff9._builtin.slice(-3, -2).toString(), 'b');
+assert.equal(buff9._builtin.slice(0, -2).toString(), 'abcabcab');
+
+
+assert.equal(buff3.toString(), 'testabcdefgh');
+
+
+assert.equal(Buffer.byteLength('\u007F'), 1);
+assert.equal(Buffer.byteLength('\u008F'), 2);
+assert.equal(Buffer.byteLength('\u08FF'), 3);
+assert.equal(Buffer.byteLength('abc'), 'abc'.length);
+assert.notEqual(Buffer.byteLength('\u2040'), '\u2040'.length);
diff --git a/test/run_pass/test_console.js b/test/run_pass/test_console.js
new file mode 100644 (file)
index 0000000..437dc24
--- /dev/null
@@ -0,0 +1,35 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var console = require('console');
+
+console.log("Hello IoT.js!!");
+console.log(1);
+console.log(2);
+console.log(3);
+console.log(3+5*2);
+console.log([1, 2, 3]);
+console.log(1, 2, 3);
+console.log('a', 1, 'b', 2, 'c', 3);
+console.log("test", null, undefined);
+
+console.error("Hello IoT.js!!");
+console.error(1);
+console.error(2);
+console.error(3);
+console.error(3+5*2);
+console.error([1, 2, 3]);
+console.error(1, 2, 3);
+console.error('a', 1, 'b', 2, 'c', 3);
diff --git a/test/run_pass/test_dgram_1_server_1_client.js b/test/run_pass/test_dgram_1_server_1_client.js
new file mode 100644 (file)
index 0000000..6f03661
--- /dev/null
@@ -0,0 +1,71 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var dgram = require('dgram');
+
+var port = 41234;
+var msg = 'Hello IoT.js';
+var server = dgram.createSocket('udp4');
+
+server.on('error', function(err) {
+  assert.fail();
+  server.close();
+});
+
+server.on('message', function(data, rinfo) {
+  console.log('server got data : ' + data);
+  console.log('client address : ' + rinfo.address);
+  console.log('client port : ' + rinfo.port);
+  console.log('client family : ' + rinfo.family);
+  assert.equal(data, msg);
+  server.send(msg, rinfo.port, 'localhost', function (err, len) {
+    assert.equal(err, null);
+    assert.equal(len, msg.length);
+    server.close();
+  });
+});
+
+server.on('listening', function() {
+  console.log('listening');
+});
+
+server.bind(port);
+
+var client = dgram.createSocket('udp4');
+
+client.send(msg, port, 'localhost', function(err, len) {
+  assert.equal(err, null);
+  assert.equal(len, msg.length);
+});
+
+client.on('error', function(err) {
+  assert.fail();
+  client.close();
+});
+
+client.on('message', function(data, rinfo) {
+  console.log('client got data : ' + data);
+  console.log('server address : ' + rinfo.address);
+  console.log('server port : ' + rinfo.port);
+  console.log('server family : ' + rinfo.family);
+  assert.equal(port, rinfo.port);
+  assert.equal(data, msg);
+  client.close();
+});
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+});
diff --git a/test/run_pass/test_dgram_1_server_n_clients.js b/test/run_pass/test_dgram_1_server_n_clients.js
new file mode 100644 (file)
index 0000000..8373188
--- /dev/null
@@ -0,0 +1,72 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var dgram = require('dgram');
+
+var port = 41235;
+var msg = '';
+var sockcount = 5;
+var sendcount = 0;
+var server = dgram.createSocket('udp4');
+
+server.on('error', function(err) {
+  assert.fail();
+  server.close();
+});
+
+server.on('message', function(data, rinfo) {
+  console.log('server got data : ' + data);
+  msg += data;
+
+  server.send(data, rinfo.port, 'localhost', function (err, len) {
+    sendcount++;
+    if (sendcount >= sockcount) {
+      server.close();
+    }
+  });
+});
+
+server.bind(port);
+
+for (var i = 0; i < sockcount; i++) {
+  (function sendAndRecieve(i) {
+    var client = dgram.createSocket('udp4');
+
+    client.send(i.toString(), port, 'localhost');
+
+    client.on('error', function(err) {
+      assert.fail();
+      client.close();
+    });
+
+    client.on('message', function(data, rinfo) {
+      console.log('client got data : ' + data);
+      assert.equal(port, rinfo.port);
+      assert.equal(data, i.toString());
+      client.close();
+    });
+  })(i);
+}
+
+process.on('exit', function(code) {
+  assert.equal(msg.length, sockcount);
+  for (var i = 0; i < sockcount; i++) {
+      if (msg.indexOf(i.toString()) == -1) {
+        assert.fail();
+      }
+  }
+  assert.equal(code, 0);
+});
diff --git a/test/run_pass/test_dgram_address.js b/test/run_pass/test_dgram_address.js
new file mode 100644 (file)
index 0000000..2422f6d
--- /dev/null
@@ -0,0 +1,63 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var dgram = require('dgram');
+
+var port = 41236;
+var msg = 'Hello IoT.js';
+var client = dgram.createSocket({ type: 'udp4', reuseAddr: true });
+var server = dgram.createSocket({ type: 'udp4', reuseAddr: true });
+var server_address, server_port, client_address, client_port;
+
+server.on('error', function(err) {
+  assert.fail();
+  server.close();
+});
+
+server.on('message', function(data, rinfo) {
+  var address = client.address();
+  client_address = address.address;
+  client_port = address.port;
+  assert.equal('0.0.0.0', client_address);
+  assert.equal(rinfo.port, client_port);
+  server.send(msg, rinfo.port, 'localhost');
+});
+
+server.on('listening', function() {
+  var address = server.address();
+  server_address = address.address;
+  server_port = address.port;
+})
+
+server.bind(port);
+
+client.send(msg, port, 'localhost');
+
+client.on('error', function(err) {
+  assert.fail();
+  client.close();
+});
+
+client.on('message', function(data, rinfo) {
+  assert.equal('0.0.0.0', server_address);
+  assert.equal(rinfo.port, server_port);
+  client.close();
+  server.close();
+});
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+});
diff --git a/test/run_pass/test_dgram_broadcast.js b/test/run_pass/test_dgram_broadcast.js
new file mode 100644 (file)
index 0000000..18d06cf
--- /dev/null
@@ -0,0 +1,90 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var dgram = require('dgram');
+
+var port = 41237;
+var broadcast_address = '255.255.255.255';
+var interval = 100;
+
+var msg_count = 0, msg_count2 = 0, msg_count3 = 0, send_count = 0;
+
+var msg = 'Hello IoT.js';
+var socket = dgram.createSocket({type: 'udp4', reuseAddr: true});
+var socket2 = dgram.createSocket({type: 'udp4', reuseAddr: true});
+var socket3 = dgram.createSocket({type: 'udp4', reuseAddr: true});
+
+socket.on('error', function(err) {
+  assert.fail();
+  socket.close();
+});
+
+socket2.on('error', function(err) {
+  assert.fail();
+  socket2.close();
+});
+
+socket3.on('error', function(err) {
+  assert.fail();
+  socket3.close();
+});
+
+socket.on('message', function(data, rinfo) {
+  console.log('socket got data : ' + data);
+  msg_count++;
+  if (msg_count == 3) {
+    socket.close();
+  }
+});
+
+socket2.on('message', function(data, rinfo) {
+  console.log('socket2 got data : ' + data);
+  msg_count2++;
+  if (msg_count2 == 3) {
+    socket2.close();
+  }
+});
+
+socket3.on('message', function(data, rinfo) {
+  console.log('socket3 got data : ' + data);
+  msg_count3++;
+  if (msg_count3 == 3) {
+    socket3.close();
+  }
+});
+
+socket.bind(port, function() {
+  socket.setBroadcast(true);
+  var timer = setInterval(function () {
+    send_count++;
+    socket.send(msg, port, broadcast_address);
+    if (send_count == 3) {
+      clearInterval(timer);
+    }
+  }, interval);
+});
+
+socket2.bind(port);
+
+socket3.bind(port);
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+  assert.equal(msg_count, 3);
+  assert.equal(msg_count2, 3);
+  assert.equal(msg_count3, 3);
+  assert.equal(send_count, 3);
+});
diff --git a/test/run_pass/test_dgram_multicast_membership.js b/test/run_pass/test_dgram_multicast_membership.js
new file mode 100644 (file)
index 0000000..fff837a
--- /dev/null
@@ -0,0 +1,63 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var dgram = require('dgram');
+
+var port = 41239;
+var multicast_address = '230.255.255.250';
+var interval = 100;
+
+var recv_count = 0, send_count = 0;
+
+var msg = 'Hello IoT.js';
+var client = dgram.createSocket('udp4');
+var server = dgram.createSocket('udp4');
+
+server.on('error', function(err) {
+  assert.fail();
+  server.close();
+});
+
+server.on('message', function(data, rinfo) {
+  console.log('server got data : ' + data);
+  recv_count++;
+  if (recv_count == 1) {
+    server.dropMembership(multicast_address);
+  }
+});
+
+server.bind(port, function() {
+  server.addMembership(multicast_address);
+});
+
+var timer = setInterval(function () {
+  send_count++;
+  client.send(msg, port, multicast_address);
+  if (send_count == 3) {
+    clearInterval(timer);
+  }
+}, interval);
+
+setTimeout(function() {
+  server.close();
+  client.close();
+}, 1000);
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+  assert.equal(recv_count, 1);
+  assert.equal(send_count, 3);
+});
diff --git a/test/run_pass/test_dgram_multicast_set_multicast_loop.js b/test/run_pass/test_dgram_multicast_set_multicast_loop.js
new file mode 100644 (file)
index 0000000..9838c84
--- /dev/null
@@ -0,0 +1,45 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var dgram = require('dgram');
+
+var port = 41240;
+var multicast_address = '230.255.255.250';
+
+var msg = 'Hello IoT.js';
+var server = dgram.createSocket('udp4');
+
+server.on('error', function(err) {
+  assert.fail();
+});
+
+server.on('message', function(data, rinfo) {
+  assert.fail();
+});
+
+server.bind(port, function() {
+  server.setMulticastLoopback(false);
+  server.addMembership(multicast_address);
+  server.send(msg, port, multicast_address);
+});
+
+setTimeout(function() {
+  server.close();
+}, 1000);
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+});
diff --git a/test/run_pass/test_dgram_setttl_client.js b/test/run_pass/test_dgram_setttl_client.js
new file mode 100644 (file)
index 0000000..6e91bd4
--- /dev/null
@@ -0,0 +1,48 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var dgram = require('dgram');
+
+var port = 41234;
+var msg = 'Hello IoT.js';
+var addr = '192.168.0.1'; // Change to your ip address
+var server = dgram.createSocket('udp4');
+
+var client = dgram.createSocket('udp4');
+
+client.send(msg, port, addr, function(err, len) {
+  assert.equal(err, null);
+  assert.equal(len, msg.length);
+});
+
+client.on('error', function(err) {
+  assert.fail();
+});
+
+client.on('listening', function(err) {
+  client.setTTL(1);
+});
+
+client.on('message', function(data, rinfo) {
+  console.log('client got data : ' + data);
+  console.log('server address : ' + rinfo.address);
+  console.log('server port : ' + rinfo.port);
+  console.log('server family : ' + rinfo.family);
+  assert.equal(port, rinfo.port);
+  assert.equal(data, msg);
+  client.close();
+});
+
diff --git a/test/run_pass/test_dgram_setttl_server.js b/test/run_pass/test_dgram_setttl_server.js
new file mode 100644 (file)
index 0000000..b71bade
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var dgram = require('dgram');
+
+var port = 41234;
+var msg = 'Hello IoT.js';
+var server = dgram.createSocket('udp4');
+
+server.on('error', function(err) {
+  assert.fail();
+  server.close();
+});
+
+server.on('message', function(data, rinfo) {
+  console.log('server got data : ' + data);
+  console.log('client address : ' + rinfo.address);
+  console.log('client port : ' + rinfo.port);
+  console.log('client family : ' + rinfo.family);
+  assert.equal(data, msg);
+  server.send(msg, rinfo.port, rinfo.address, function (err, len) {
+    assert.equal(err, null);
+    assert.equal(len, msg.length);
+  });
+});
+
+server.on('listening', function() {
+  console.log('listening');
+});
+
+server.bind(port, function() {
+  server.setTTL(1);
+});
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+});
diff --git a/test/run_pass/test_dns.js b/test/run_pass/test_dns.js
new file mode 100644 (file)
index 0000000..de75547
--- /dev/null
@@ -0,0 +1,58 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var net = require('net');
+var assert = require('assert');
+
+
+var server = net.createServer();
+var port = 1236;
+
+server.listen(port, 5);
+
+server.on('connection', function(socket) {
+  socket.on('data', function(data) {
+    socket.end('Hello IoT.js');
+  });
+  socket.on('close', function() {
+    server.close();
+  });
+});
+
+
+var socket = new net.Socket();
+var msg = "";
+var lookupHandled = false;
+
+socket.on('lookup', function(err, ip, family) {
+  lookupHandled = true;
+});
+
+socket.connect(port, "localhost");  // connect with hostname
+socket.write("Hello IoT.js");
+
+socket.on('data', function(data) {
+  msg += data;
+});
+
+socket.on('end', function() {
+  socket.end();
+});
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+  assert.equal(msg, "Hello IoT.js");
+  assert.equal(lookupHandled, true);
+});
diff --git a/test/run_pass/test_dns_lookup.js b/test/run_pass/test_dns_lookup.js
new file mode 100644 (file)
index 0000000..f225b86
--- /dev/null
@@ -0,0 +1,112 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var dns = require('dns');
+var assert = require('assert');
+
+var options = {
+  family: 4,
+  hints: dns.ADDRCONFIG | dns.V4MAPPED,
+};
+
+function isIPv4(ip) {
+  var IPv4Regex = new RegExp(
+    '^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'
+  );
+
+  return IPv4Regex.test(ip);
+}
+
+dns.lookup('localhost', 4, function(err, ip, family) {
+  assert.equal(err, null);
+  assert.equal(isIPv4(ip), true);
+  assert.equal(ip, '127.0.0.1');
+  assert.strictEqual(family, 4);
+});
+
+// Test with IPv4 option.
+dns.lookup('localhost', 4, function(err, ip, family) {
+  assert.equal(err, null);
+  assert.equal(isIPv4(ip), true);
+  assert.equal(ip, '127.0.0.1');
+  assert.strictEqual(family, 4);
+});
+
+// Test without explicit options parameter.
+dns.lookup('localhost', function(err, ip, family) {
+  assert.equal(err, null);
+  assert.equal(isIPv4(ip), true);
+  assert.equal(ip, '127.0.0.1');
+});
+
+// Test with invalid hostname.
+dns.lookup('invalid', 4, function(err, ip, family) {
+  assert.notEqual(err, null);
+  assert.equal(err.code == -3008 || err.code == -3007, true);
+});
+
+// Test with empty hostname.
+dns.lookup('', 4, function(err, ip, family) {
+  assert.notEqual(err, null);
+  assert.equal(err.code == -3008 || err.code == -3007, true);
+});
+
+// Test with non string hostname.
+assert.throws(function() {
+  dns.lookup(5000, options, function(err, ip, family) {});
+}, TypeError);
+
+// Test without callback function.
+assert.throws(function() {
+  dns.lookup('localhost', options);
+}, TypeError);
+
+// Test with invalid callback parameter.
+assert.throws(function() {
+  dns.lookup('localhost', options, 5000);
+}, TypeError);
+
+assert.throws(function() {
+  dns.lookup('localhost', options, 'callback');
+}, TypeError);
+
+// Test with invalid hints option.
+options.hints = -1;
+assert.throws(function() {
+  dns.lookup('localhost', options, function(err, ip, family) {});
+}, TypeError);
+
+options.hints = 5000;
+assert.throws(function() {
+  dns.lookup('localhost', options, function(err, ip, family) {});
+}, TypeError);
+
+// Test with invalid options parameter.
+assert.throws(function() {
+  dns.lookup('localhost', 'options', function(err, ip, family) {});
+}, TypeError);
+
+assert.throws(function() {
+  dns.lookup('localhost', '', function(err, ip, family) {});
+}, TypeError);
+
+// Test with invalid family option.
+assert.throws(function() {
+  dns.lookup('localhost', 10, function(err, ip, family) {});
+}, TypeError);
+
+assert.throws(function() {
+  dns.lookup('localhost', -5, function(err, ip, family) {});
+}, TypeError);
diff --git a/test/run_pass/test_events.js b/test/run_pass/test_events.js
new file mode 100644 (file)
index 0000000..71a4da4
--- /dev/null
@@ -0,0 +1,249 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var assert = require('assert');
+
+
+var emitter = new EventEmitter();
+
+var eventCnt1 = 0;
+var eventCnt2 = 0;
+var eventCnt3 = 0;
+var onceCnt = 0;
+var eventSequence = "";
+
+emitter.once('once', function() {
+  onceCnt += 1;
+});
+
+
+assert.equal(onceCnt, 0);
+emitter.emit('once');
+assert.equal(onceCnt, 1);
+emitter.emit('once');
+assert.equal(onceCnt, 1);
+
+
+{
+  var emit_test = new EventEmitter();
+  emit_test._events = false;
+  emit_test.emit();
+}
+{
+  var emit_test = new EventEmitter();
+  emit_test._events.error = false;
+  emit_test.emit(null);
+}
+{
+  var emit_test = new EventEmitter();
+  emit_test._events = false;
+  assert.throws(function() { emit_test.addListener(null, null); }, TypeError);
+}
+{
+  var emit_test = new EventEmitter();
+  emit_test._events = false;
+  emit_test.addListener('event', function() { });
+}
+{
+  var emit_test = new EventEmitter();
+  assert.throws(function() { emit_test.once(null, null); }, TypeError);
+}
+{
+  var emit_test = new EventEmitter();
+  assert.throws(function() {
+    emit_test.removeListener(null, null);
+  }, TypeError);
+}
+{
+  var emit_test = new EventEmitter();
+  emit_test._events = false;
+  emit_test.removeListener('rmtest', function() { });
+}
+
+emitter.once('once2', function() {
+  onceCnt += 1;
+  assert.equal(arguments.length, 14);
+  assert.equal(arguments[0], 0);
+  assert.equal(arguments[1], 1);
+  assert.equal(arguments[2], 2);
+  assert.equal(arguments[3], 3);
+  assert.equal(arguments[4], 4);
+  assert.equal(arguments[5], 5);
+  assert.equal(arguments[6], 6);
+  assert.equal(arguments[7], 7);
+  assert.equal(arguments[8], 8);
+  assert.equal(arguments[9], 9);
+  assert.equal(arguments[10], "a");
+  assert.equal(arguments[11], "b");
+  assert.equal(arguments[12], "c");
+  assert.equal(arguments[13].a, 123);
+});
+
+assert.equal(onceCnt, 1);
+emitter.emit('once2', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", { a: 123});
+assert.equal(onceCnt, 2);
+emitter.emit('once2', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", { a: 123});
+assert.equal(onceCnt, 2);
+
+emitter.addListener('event', function() {
+  eventCnt1 += 1;
+  eventSequence += "1";
+});
+
+assert.equal(eventCnt1, 0);
+emitter.emit('event');
+assert.equal(eventCnt1, 1);
+
+emitter.addListener('event', function() {
+  eventCnt2 += 1;
+  eventSequence += "2";
+});
+
+assert.equal(eventCnt2, 0);
+emitter.emit('event');
+assert.equal(eventCnt1, 2);
+assert.equal(eventCnt2, 1);
+
+emitter.addListener('event', function() {
+  eventCnt3 += 1;
+  eventSequence += "3";
+});
+
+assert.equal(eventCnt3, 0);
+emitter.emit('event');
+assert.equal(eventCnt1, 3);
+assert.equal(eventCnt2, 2);
+assert.equal(eventCnt3, 1);
+emitter.emit('event');
+assert.equal(eventCnt1, 4);
+assert.equal(eventCnt2, 3);
+assert.equal(eventCnt3, 2);
+emitter.emit('no receiver');
+assert.equal(eventCnt1, 4);
+assert.equal(eventCnt2, 3);
+assert.equal(eventCnt3, 2);
+
+
+emitter.addListener('args', function() {
+  assert.equal(arguments.length, 14);
+  assert.equal(arguments[0], 0);
+  assert.equal(arguments[1], 1);
+  assert.equal(arguments[2], 2);
+  assert.equal(arguments[3], 3);
+  assert.equal(arguments[4], 4);
+  assert.equal(arguments[5], 5);
+  assert.equal(arguments[6], 6);
+  assert.equal(arguments[7], 7);
+  assert.equal(arguments[8], 8);
+  assert.equal(arguments[9], 9);
+  assert.equal(arguments[10], "a");
+  assert.equal(arguments[11], "b");
+  assert.equal(arguments[12], "c");
+  assert.equal(arguments[13].a, 123);
+  eventSequence += "4";
+});
+
+emitter.addListener('args', function() {
+  assert.equal(arguments.length, 14);
+  eventSequence += "5";
+})
+
+emitter.emit('args', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", { a: 123});
+
+
+var listener1 = function() {
+  eventSequence += '6';
+};
+
+emitter.addListener('rmTest', listener1);
+emitter.emit('rmTest');
+emitter.removeListener('rmTest', function() {});
+emitter.emit('rmTest');
+emitter.removeListener('rmTest', listener1);
+emitter.emit('rmTest');
+
+
+var listener2 = function() {
+  eventSequence += '7';
+};
+
+emitter.addListener('rmTest', listener2);
+emitter.addListener('rmTest', listener2);
+emitter.emit('rmTest');
+eventSequence += "|"
+emitter.removeListener('rmTest', listener2);
+emitter.emit('rmTest');
+eventSequence += "|"
+emitter.removeListener('rmTest', listener2);
+emitter.emit('rmTest');
+eventSequence += "|"
+
+
+var listener3 = function() {
+  eventSequence += '8';
+};
+
+emitter.addListener('rmTest', listener3);
+emitter.addListener('rmTest', listener3);
+emitter.emit('rmTest');
+eventSequence += "|";
+emitter.removeAllListeners('rmTest');
+emitter.emit('rmTest');
+eventSequence += "|";
+
+
+emitter.emit('event');
+eventSequence += "|";
+emitter.removeAllListeners();
+emitter.emit('event');
+eventSequence += "|";
+
+
+assert.equal(eventSequence, "112123123456677|7||88||123||");
+
+
+/* Test if an event listener for a once
+   call can be removed.
+ */
+var removableListenerCnt = 0;
+function removableListener() {
+  removableListenerCnt++;
+}
+
+emitter.once('onceRemove', removableListener);
+assert.equal(removableListenerCnt, 0);
+emitter.removeListener('onceRemove', removableListener);
+emitter.emit('onceRemove');
+assert.equal(removableListenerCnt, 0,
+    'a listener for a "once" typed event should be removable');
+
+/*
+ * Test when the last listener is removed from an object,
+ * the related property doesn't exist anymore.
+ */
+var listener1 = function() {
+};
+
+emitter.addListener('event1', listener1);
+emitter.removeListener('event1', listener1);
+var res = emitter.emit('event1');
+assert.equal(res, false);
+
+emitter.addListener('event2', listener1);
+emitter.addListener('event2', listener1);
+emitter.removeAllListeners('event2');
+res = emitter.emit('event2');
+assert.equal(res, false);
diff --git a/test/run_pass/test_events_assert_emit_error.js b/test/run_pass/test_events_assert_emit_error.js
new file mode 100644 (file)
index 0000000..1420615
--- /dev/null
@@ -0,0 +1,26 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+var EventEmitter = require('events').EventEmitter;
+
+
+var ee = new EventEmitter();
+
+assert.throws(
+  function() {
+   ee.emit('error');
+ }, Error);
diff --git a/test/run_pass/test_events_uncaught_error.js b/test/run_pass/test_events_uncaught_error.js
new file mode 100644 (file)
index 0000000..0eb61a6
--- /dev/null
@@ -0,0 +1,35 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+var EventEmitter = require('events').EventEmitter;
+
+
+var uncaught_error = false;
+
+process.on('uncaughtException', function(err) {
+  assert.equal(err.message, "Uncaught 'error' event");
+  uncaught_error = true;
+});
+
+process.on('exit', function(code) {
+  process.removeAllListeners('uncaughtException');
+  assert.equal(code, 0);
+  assert(uncaught_error);
+});
+
+var ee = new EventEmitter();
+ee.emit('error');
diff --git a/test/run_pass/test_fs_event.js b/test/run_pass/test_fs_event.js
new file mode 100644 (file)
index 0000000..5bc4822
--- /dev/null
@@ -0,0 +1,67 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var fs = require('fs');
+var assert = require('assert');
+
+
+var srcFilePath = process.cwd() + "/resources/test1.txt";
+var dstFilePath = process.cwd() + "/tmp/test_fs2.txt";
+
+var data;
+
+function onWrite(err, written, buffer) {
+  if (err) {
+    throw err;
+  } else {
+    var fd = fs.openSync(dstFilePath, 'r');
+    var buffer = new Buffer(128);
+    fs.readSync(fd, buffer, 0, buffer.length, 0);
+
+    var result = 'TEST File Read & Write\n';
+
+    assert.equal(buffer.toString(), result);
+  }
+}
+
+function onOpenForWrite(err, fd) {
+  if (err) {
+    throw err;
+  } else {
+    fs.write(fd, data, 0, data.length, onWrite);
+  }
+}
+
+function onRead(err, bytesRead, buffer) {
+  if (err) {
+    throw err;
+  } else {
+    data = new Buffer(buffer.toString());
+    fs.open(dstFilePath, 'w', onOpenForWrite);
+  }
+}
+
+function onOpenForRead(err, fd) {
+  if (err) {
+    throw err;
+  } else {
+    var buffer = new Buffer(128);
+    fs.read(fd, buffer, 0, buffer.length, 0, onRead);
+  }
+}
+
+fs.open(srcFilePath, 'r', onOpenForRead);
diff --git a/test/run_pass/test_fs_exists.js b/test/run_pass/test_fs_exists.js
new file mode 100644 (file)
index 0000000..e380baf
--- /dev/null
@@ -0,0 +1,65 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+{
+  var filePath = process.cwd() + "/resources/tobeornottobe.txt";
+
+  fs.exists(filePath, function(exists) {
+    assert.equal(exists, true);
+  });
+}
+
+{
+  var filePath = "";
+
+  assert.doesNotThrow(function(){
+    fs.exists(filePath);
+  });
+}
+
+{
+  var filePath = process.cwd() + "/resources/tobeornottobe.txt";
+
+  assert.doesNotThrow(function(){
+    fs.exists(filePath);
+  });
+}
+
+{
+  var filePath = process.cwd() + "/resources/empty.txt";
+
+  fs.exists(filePath, function(exists) {
+    assert.equal(exists, false);
+  });
+}
+
+{
+  var filePath = "";
+
+  fs.exists(filePath, function(exists) {
+    assert.equal(exists, false);
+  });
+}
+
+{
+  var filePath = " ";
+
+  fs.exists(filePath, function(exists) {
+    assert.equal(exists, false);
+  });
+}
diff --git a/test/run_pass/test_fs_exists_sync.js b/test/run_pass/test_fs_exists_sync.js
new file mode 100644 (file)
index 0000000..7aa2f1b
--- /dev/null
@@ -0,0 +1,45 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+{
+  var filePath = process.cwd() + "/resources/tobeornottobe.txt";
+
+  var result = fs.existsSync(filePath);
+  assert.equal(result, true);
+}
+
+{
+  var filePath = process.cwd() + "/resources/empty.txt";
+
+  var result = fs.existsSync(filePath);
+  assert.equal(result, false);
+}
+
+{
+  var filePath = "";
+
+  var result = fs.existsSync(filePath);
+  assert.equal(result, false);
+}
+
+{
+  var filePath = " ";
+
+  var result = fs.existsSync(filePath);
+  assert.equal(result, false);
+}
diff --git a/test/run_pass/test_fs_fstat.js b/test/run_pass/test_fs_fstat.js
new file mode 100644 (file)
index 0000000..2128f49
--- /dev/null
@@ -0,0 +1,63 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var testfile = process.cwd() + "/run_pass/test_fs_fstat.js";
+var testdir = process.cwd() + "/resources";
+var flags = "r";
+
+
+// fstat - file
+fs.open(testfile, flags, function(err, fd) {
+  if (err) {
+    throw err;
+  }
+  fs.fstat(fd, function(err, stat) {
+    if (err) {
+      throw err;
+    }
+    assert.equal(stat.isFile(), true);
+    assert.equal(stat.isDirectory(), false);
+
+    fs.close(fd, function(err) {
+      if (err) {
+        throw err;
+      }
+    });
+  });
+});
+
+
+// fstat - directory
+fs.open(testdir, flags, function(err, fd) {
+  if (err) {
+    throw err;
+  }
+  fs.fstat(fd, function(err, stat) {
+    if (err) {
+      throw err;
+    }
+    assert.equal(stat.isFile(), false);
+    assert.equal(stat.isDirectory(), true);
+
+    fs.close(fd, function(err) {
+      if (err) {
+        throw err;
+      }
+    });
+  });
+});
diff --git a/test/run_pass/test_fs_fstat_sync.js b/test/run_pass/test_fs_fstat_sync.js
new file mode 100644 (file)
index 0000000..98b4351
--- /dev/null
@@ -0,0 +1,47 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var testfile = process.cwd() + "/run_pass/test_fs_fstat_sync.js";
+var testdir = process.cwd() + "/resources";
+var flags = "r";
+
+
+// fstatSync - file
+try {
+  var fd = fs.openSync(testfile, flags);
+  var stat = fs.fstatSync(fd);
+
+  assert.equal(stat.isFile(), true);
+  assert.equal(stat.isDirectory(), false);
+  fs.closeSync(fd);
+} catch (err) {
+  throw err;
+}
+
+
+// fstatSync - directory
+try {
+  var fd = fs.openSync(testdir, flags);
+  var stat = fs.fstatSync(fd);
+
+  assert.equal(stat.isFile(), false);
+  assert.equal(stat.isDirectory(), true);
+  fs.closeSync(fd);
+} catch (err) {
+  throw err;
+}
diff --git a/test/run_pass/test_fs_mkdir_rmdir.js b/test/run_pass/test_fs_mkdir_rmdir.js
new file mode 100644 (file)
index 0000000..b7e4d6d
--- /dev/null
@@ -0,0 +1,85 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+function unlink(path) {
+  try {
+    fs.rmdirSync(path);
+  } catch (e) {
+  }
+  assert.equal(fs.existsSync(path), false);
+}
+
+{
+  var root = process.cwd() + "/resources/test_dir";
+  var sub1 = process.cwd() + "/resources/test_dir/file1";
+  var sub2 = process.cwd() + "/resources/test_dir/file2";
+
+  unlink(sub1);
+  unlink(sub2);
+  unlink(root);
+
+  fs.mkdir(root, function(err) {
+    assert.equal(err, null);
+    assert.equal(fs.existsSync(root), true);
+    assert.equal(fs.mkdirSync(sub1), undefined);
+    assert.equal(fs.mkdirSync(sub2), undefined);
+    assert.equal(fs.existsSync(sub1), true);
+    assert.equal(fs.existsSync(sub2), true);
+
+    unlink(sub1);
+    unlink(sub2);
+
+    fs.rmdir(root, function() {
+      assert.equal(fs.existsSync(root), false);
+    });
+
+    var root2 = process.cwd() + "/resources/test_dir2";
+
+    fs.mkdir(root2, 777, function(err) {
+      assert.equal(err, null);
+      assert.equal(fs.existsSync(root2), true);
+
+      fs.rmdir(root2, function(){
+        assert.equal(fs.existsSync(root2), false);
+      });
+
+      // Run read-only directory test only on linux
+      // NuttX does not support read-only attribute.
+      if (process.platform === 'linux') {
+        // Try to create a folder in a read-only directory.
+        fs.mkdir(root, '0444', function(err) {
+          assert.equal(fs.existsSync(root), true);
+
+          var dirname = root + "/permission_test";
+          try {
+            fs.mkdirSync(dirname);
+            assert.assert(false);
+          } catch (e) {
+            assert.equal(e instanceof Error, true);
+            assert.equal(e instanceof assert.AssertionError, false);
+          }
+
+          assert.equal(fs.existsSync(dirname), false);
+          fs.rmdir(root, function() {
+            assert.equal(fs.existsSync(root), false);
+          });
+        });
+      }
+    });
+  });
+}
diff --git a/test/run_pass/test_fs_open_close.js b/test/run_pass/test_fs_open_close.js
new file mode 100644 (file)
index 0000000..5284081
--- /dev/null
@@ -0,0 +1,147 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var fs = require('fs');
+var assert = require('assert');
+
+
+var fileName = process.cwd() + "/resources/greeting.txt";
+
+
+// test sync open & close.
+
+// test normal sequence.
+try {
+  var fd = fs.openSync(fileName, 'r');
+  fs.closeSync(fd);
+} catch (err) {
+  throw err;
+}
+
+
+// test trying to open not exist file - expecting exception.
+try {
+  var fd = fs.openSync('not_exist_file', 'r');
+  assert.fail('none', 'exception');
+} catch (err) {
+}
+
+
+// test trying to close with bad fd - expecting exception.
+try {
+  fs.closeSync(-1);
+  assert.fail('none', 'exception');
+} catch (err) {
+}
+
+
+// test async open & close.
+
+// test normal sequence.
+var fs_async_normal_ok = false;
+fs.open(fileName, 'r', function(err, fd) {
+  if (err) {
+    throw err;
+  } else {
+    fs.close(fd, function(err) {
+      if (err) {
+        throw err;
+      } else {
+        fs_async_normal_ok = true;
+      }
+    });
+  }
+});
+
+
+// test not exist file - expecting exception.
+var fs_async_open_not_exist_ok = false;
+fs.open('not_exist_file', 'r', function(err, fd) {
+  if (err) {
+    fs_async_open_not_exist_ok = true;
+  } else {
+    assert.fail('none', 'exception');
+  }
+});
+
+
+// test trying to close with bad fd - expecting exception.
+var fs_async_close_bad_fd_ok = false;
+fs.close(-1, function(err) {
+  if (err) {
+    fs_async_close_bad_fd_ok = true;
+  } else {
+    assert.fail('none', 'exception');
+  }
+});
+
+var buffer = new Buffer(10);
+// expect length out of bound
+assert.throws(function () { fs.readSync(5, buffer, 0, 20); }, RangeError);
+// expect offset out of bound
+assert.throws(function () { fs.readSync(5, buffer, -1, 20); }, RangeError);
+
+var fs_async_normal_ok2 = false;
+fs.open(fileName, 'r', '4' ,function(err, fd) {
+  if (err) {
+    throw err;
+  } else {
+    fs.close(fd, function(err) {
+      if (err) {
+        throw err;
+      } else {
+        fs_async_normal_ok2 = true;
+      }
+    });
+  }
+});
+
+process.on('exit', function() {
+  assert.equal(fs_async_normal_ok, true);
+  assert.equal(fs_async_normal_ok2, true);
+  assert.equal(fs_async_open_not_exist_ok, true);
+  assert.equal(fs_async_close_bad_fd_ok, true);
+});
+
+
+assert.throws (function() {
+   var fd = fs.openSync(null, 123);
+ }, TypeError);
+assert.throws (function() {
+  var fd = fs.openSync(process.cwd() + '/run_pass/test_fs_stat.js', 'k');
+}, TypeError);
+assert.throws (function() {
+  var fd = fs.openSync(process.cwd() + '/resources/test2.txt', null);
+}, TypeError);
+
+('rs sr r+ rs+ sr+ a a+')
+  .split(' ').forEach(function (flag){
+    assert.doesNotThrow(function (){
+      var fd = fs.openSync(process.cwd() + '/resources/test2.txt', flag);
+      fs.closeSync(fd);
+    }, 'file could not be opened with ' + flag);
+  });
+
+('wx xw w+ wx+ xw+ ax+ xa+ ax xa')
+  .split(' ').forEach(function (flag){
+    assert.doesNotThrow(function(){
+      var file = process.cwd() + '/resources/TEMP' + flag + '.txt';
+      var fd = fs.openSync(file, flag);
+      fs.unlinkSync(file);
+      fs.closeSync(fd);
+    }, 'file could not be opened with ' + flag);
+  });
diff --git a/test/run_pass/test_fs_open_read.js b/test/run_pass/test_fs_open_read.js
new file mode 100644 (file)
index 0000000..8ab09bf
--- /dev/null
@@ -0,0 +1,71 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var fs = require('fs');
+var assert = require('assert');
+
+
+var fileName = process.cwd() + "/resources/greeting.txt";
+var expectedContents = "Hello IoT.js!!";
+var flags = "r";
+var mode = 438;
+
+
+// test async open & read
+fs.open(fileName, flags, mode, function(err, fd) {
+  if (err) {
+    throw err;
+  } else {
+    var buffer = new Buffer(64);
+    fs.read(fd, buffer, 0, buffer.length, 0, function(err, bytesRead, buffer) {
+      if (err) {
+        throw err;
+      } else {
+        assert.equal(buffer.toString(), expectedContents);
+      }
+    });
+  }
+});
+
+
+// error test
+assert.throws(
+  function() {
+    fs.openSync("non_exist_file", flags, mode);
+  },
+  Error
+);
+
+// test the position argument of fs.read()
+fs.open(fileName, flags, function(err, fd) {
+  if (err) {
+    throw err;
+  }
+  var buffer = new Buffer(64);
+  fs.read(fd, buffer, 0, 7, null, function(err, bytesRead, buffer) {
+    if (err) {
+      throw err;
+    }
+    fs.read(fd, buffer, 7, 7, null, function(err, bytesRead, buffer) {
+      if (err) {
+        throw err;
+      }
+      assert.equal(buffer.toString(), expectedContents);
+      fs.closeSync(fd);
+    });
+  });
+});
diff --git a/test/run_pass/test_fs_open_read_sync_1.js b/test/run_pass/test_fs_open_read_sync_1.js
new file mode 100644 (file)
index 0000000..57ea947
--- /dev/null
@@ -0,0 +1,52 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var fs = require('fs');
+var assert = require('assert');
+
+
+var srcFilePath = process.cwd() + "/resources/test1.txt";
+var dstFilePath = process.cwd() + "/tmp/test_fs1.txt";
+
+try {
+  var fd1 = fs.openSync(srcFilePath, 'r');
+  var buffer = new Buffer(128);
+  var bytes1 = fs.readSync(fd1, buffer, 0, buffer.length, 0);
+  fs.closeSync(fd1);
+
+  var fd2 = fs.openSync(dstFilePath, 'w');
+  var bytes2 = fs.writeSync(fd2, buffer, 0, bytes1, 0);
+  var bytes4 = fs.writeSync(fd2, buffer, 0, bytes1, null);
+  var bytes5 = fs.writeSync(fd2, buffer, 0, bytes1, undefined);
+  fs.closeSync(fd2);
+
+  assert.equal(bytes1, bytes2);
+  assert.equal(bytes1, bytes4);
+  assert.equal(bytes1, bytes5);
+
+  var fd3 = fs.openSync(srcFilePath, 'r');
+  var bytes3 = fs.readSync(fd3, buffer, 0, buffer.length, 0);
+  fs.closeSync(fd3);
+
+  assert.equal(bytes1, bytes3);
+
+  var result = 'TEST File Read & Write\n';
+
+  assert.equal(buffer.toString(), result);
+} catch (err) {
+  throw err;
+}
diff --git a/test/run_pass/test_fs_open_read_sync_2.js b/test/run_pass/test_fs_open_read_sync_2.js
new file mode 100644 (file)
index 0000000..7369bfb
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var fileName = process.cwd() + "/resources/greeting.txt";
+var expectedContents = "Hello IoT.js!!";
+var flags = "r";
+var mode = 438;
+
+
+// test sync open & read
+try {
+  var fd = fs.openSync(fileName, flags, mode);
+  var buffer = new Buffer(64);
+  fs.readSync(fd, buffer, 0, buffer.length, 0);
+  assert.equal(buffer.toString(), expectedContents);
+} catch (err) {
+  throw err;
+}
diff --git a/test/run_pass/test_fs_open_read_sync_3.js b/test/run_pass/test_fs_open_read_sync_3.js
new file mode 100644 (file)
index 0000000..abacc03
--- /dev/null
@@ -0,0 +1,35 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var fileName = process.cwd() + "/resources/greeting.txt";
+var expectedContents = "Hello IoT.js!!";
+var flags = "r";
+
+
+// test the position argument of fs.readSync()
+try {
+  var buffer = new Buffer(64);
+  var fd = fs.openSync(fileName, flags);
+  var bytes1 = fs.readSync(fd, buffer, 0, 7, null);
+  var bytes2 = fs.readSync(fd, buffer, 7, 7, null);
+
+  assert.equal(buffer.toString(), expectedContents);
+  fs.closeSync(fd);
+} catch (err) {
+  throw err;
+}
diff --git a/test/run_pass/test_fs_readdir.js b/test/run_pass/test_fs_readdir.js
new file mode 100644 (file)
index 0000000..d826d2d
--- /dev/null
@@ -0,0 +1,42 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var path = process.cwd() + '/resources/readdir'
+var ans = 'DO_NOT_MODIFY_THIS_FOLDER\n'+
+          'This_is_a_directory\n'+
+          'This_is_another_directory\n'+
+          'regular.txt\n';
+
+var res;
+var items;
+
+res = "";
+items = fs.readdirSync(path);
+items.sort();
+for (i = 0; i < items.length; i++)
+  res += items[i] + '\n';
+assert.equal(res, ans);
+
+res = "";
+fs.readdir(path, function(err, items) {
+  assert.equal(err, null);
+  items.sort();
+  for (i = 0; i < items.length; i++)
+    res += items[i] + '\n';
+  assert.equal(res, ans);
+});
diff --git a/test/run_pass/test_fs_readfile.js b/test/run_pass/test_fs_readfile.js
new file mode 100644 (file)
index 0000000..038c0b8
--- /dev/null
@@ -0,0 +1,61 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var fs = require('fs');
+var assert = require('assert');
+
+var filePath = process.cwd() + "/resources/tobeornottobe.txt";
+
+fs.readFile(filePath, function(err, data) {
+  assert.equal(err, null);
+  var result =
+  "To be, or not to be, that is the Question:\n" +
+  "Whether ’tis Nobler in the mind to ſuffer\n" +
+  "The Slings and Arrows of outragious Fortune,\n" +
+  "Or to take Armes against a Sea of troubles,\n" +
+  "And by opposing end them: to dye, to ſleepe\n" +
+  "No more; and by a sleep, to say we end\n" +
+  "The Heart-ake, and the thouſand Naturall ſhockes\n" +
+  'That Flesh is there too? "Tis a consummation\n' +
+  "Deuoutly to be wiſh'd. To dye to sleepe,\n" +
+  "To sleep, perchance to Dream; I, there's the rub,\n" +
+  "For in that sleep of death, what dreams may come,\n" +
+  "When we haue ſhufflel’d off this mortall coile,\n" +
+  "Muſt giue us pause. There's the respect\n" +
+  "That makes Calamity of long life:\n" +
+  "For who would beare the Whips and Scornes of time,\n" +
+  "The Oppreſſors wrong, the poore mans Contumely,\n" +
+  "The pangs of diſpriz’d Loue, the Lawes delay,\n" +
+  "The inſolence of Office, and the Spurnes\n" +
+  "That patient merit of the vnworthy takes,\n" +
+  "When he himſelfe might his Quietus make\n" +
+  "With a bare Bodkin? Who would theſe Fardles beare\n" +
+  "To grunt and ſweat vnder a weary life,\n" +
+  "But that the dread of ſomething after death,\n" +
+  "The vndiſcouered Countrey, from whoſe Borne\n" +
+  "No Traueller returnes, Puzels the will,\n" +
+  "And makes vs rather beare those illes we haue,\n" +
+  "Then flye to others that we know not of.\n" +
+  "Thus Conſcience does make Cowards of vs all,\n" +
+  "And thus the Natiue hew of Resolution\n" +
+  "Is ſicklied o’re, with the pale caſt of Thought,\n" +
+  "And enterprizes of great pith and moment,\n" +
+  "With this regard their Currants turne away,\n" +
+  "And looſe the name of Action. Soft you now,\n" +
+  "The faire Ophelia? Nimph, in thy Orizons\n" +
+  "Be all my ſinnes remembred."
+  assert.equal(data, result);
+});
diff --git a/test/run_pass/test_fs_readfile_sync.js b/test/run_pass/test_fs_readfile_sync.js
new file mode 100644 (file)
index 0000000..a2a9128
--- /dev/null
@@ -0,0 +1,60 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var fs = require('fs');
+var assert = require('assert');
+
+var filePath = process.cwd() + "/resources/tobeornottobe.txt";
+
+var data = fs.readFileSync(filePath);
+
+var result =
+  "To be, or not to be, that is the Question:\n" +
+  "Whether ’tis Nobler in the mind to ſuffer\n" +
+  "The Slings and Arrows of outragious Fortune,\n" +
+  "Or to take Armes against a Sea of troubles,\n" +
+  "And by opposing end them: to dye, to ſleepe\n" +
+  "No more; and by a sleep, to say we end\n" +
+  "The Heart-ake, and the thouſand Naturall ſhockes\n" +
+  'That Flesh is there too? "Tis a consummation\n' +
+  "Deuoutly to be wiſh'd. To dye to sleepe,\n" +
+  "To sleep, perchance to Dream; I, there's the rub,\n" +
+  "For in that sleep of death, what dreams may come,\n" +
+  "When we haue ſhufflel’d off this mortall coile,\n" +
+  "Muſt giue us pause. There's the respect\n" +
+  "That makes Calamity of long life:\n" +
+  "For who would beare the Whips and Scornes of time,\n" +
+  "The Oppreſſors wrong, the poore mans Contumely,\n" +
+  "The pangs of diſpriz’d Loue, the Lawes delay,\n" +
+  "The inſolence of Office, and the Spurnes\n" +
+  "That patient merit of the vnworthy takes,\n" +
+  "When he himſelfe might his Quietus make\n" +
+  "With a bare Bodkin? Who would theſe Fardles beare\n" +
+  "To grunt and ſweat vnder a weary life,\n" +
+  "But that the dread of ſomething after death,\n" +
+  "The vndiſcouered Countrey, from whoſe Borne\n" +
+  "No Traueller returnes, Puzels the will,\n" +
+  "And makes vs rather beare those illes we haue,\n" +
+  "Then flye to others that we know not of.\n" +
+  "Thus Conſcience does make Cowards of vs all,\n" +
+  "And thus the Natiue hew of Resolution\n" +
+  "Is ſicklied o’re, with the pale caſt of Thought,\n" +
+  "And enterprizes of great pith and moment,\n" +
+  "With this regard their Currants turne away,\n" +
+  "And looſe the name of Action. Soft you now,\n" +
+  "The faire Ophelia? Nimph, in thy Orizons\n" +
+  "Be all my ſinnes remembred."
+assert.equal(data, result);
diff --git a/test/run_pass/test_fs_rename.js b/test/run_pass/test_fs_rename.js
new file mode 100644 (file)
index 0000000..27778f3
--- /dev/null
@@ -0,0 +1,34 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+ /*
+ @STDOUT=Pass
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var file1 = process.cwd() + "/resources/rename.txt";
+var file2 = process.cwd() + "/resources/rename.txt.async";
+
+fs.rename(file1, file2, function(err) {
+  assert.equal(err, null);
+  assert.equal(fs.existsSync(file1), false);
+  assert.equal(fs.existsSync(file2), true);
+  fs.rename(file2, file1, function(err) {
+    assert.equal(err, null);
+    console.log("Pass");
+  });
+});
diff --git a/test/run_pass/test_fs_rename_sync.js b/test/run_pass/test_fs_rename_sync.js
new file mode 100644 (file)
index 0000000..363fe56
--- /dev/null
@@ -0,0 +1,25 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var file1 = process.cwd() + "/resources/rename.txt";
+var file2 = process.cwd() + "/resources/rename.txt.sync";
+
+fs.renameSync(file1, file2);
+assert.equal(fs.existsSync(file1), false);
+assert.equal(fs.existsSync(file2), true);
+fs.renameSync(file2, file1);
diff --git a/test/run_pass/test_fs_stat.js b/test/run_pass/test_fs_stat.js
new file mode 100644 (file)
index 0000000..976199a
--- /dev/null
@@ -0,0 +1,57 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var fs = require('fs');
+var assert = require('assert');
+
+
+var stats1 = fs.statSync(process.cwd() + '/run_pass/test_fs_stat.js');
+assert.equal(stats1.isFile(), true);
+assert.equal(stats1.isDirectory(), false);
+
+fs.stat(process.cwd() + '/run_pass/test_fs_stat.js', function(err, stats) {
+  if (!err) {
+    assert.equal(stats.isFile(), true);
+    assert.equal(stats.isDirectory(), false);
+  }
+  else {
+    throw err;
+  }
+});
+
+
+var stats2 = fs.statSync(process.cwd() + '/resources');
+assert.equal(stats2.isDirectory(), true);
+assert.equal(stats2.isFile(), false);
+
+fs.stat(process.cwd() + '/resources', function(err, stats) {
+  if (!err) {
+    assert.equal(stats.isDirectory(), true);
+    assert.equal(stats.isFile(), false);
+  }
+  else {
+    throw err
+  }
+});
+
+// fs.statSync throws an exception for a non-existing file.
+try {
+  var stats3 = fs.statSync(process.cwd() + '/non_existing.js');
+  assert.assert(false);
+} catch(e) {
+  assert.equal(e instanceof Error, true);
+  assert.equal(e instanceof assert.AssertionError, false);
+}
diff --git a/test/run_pass/test_fs_write.js b/test/run_pass/test_fs_write.js
new file mode 100644 (file)
index 0000000..823bfa4
--- /dev/null
@@ -0,0 +1,56 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var dstFilePath = process.cwd() + "/tmp/test_fs3.txt";
+var buff1 = new Buffer("IoT");
+var buff2 = new Buffer(".js");
+
+fs.open(dstFilePath, 'w+', function(err, fd) {
+  if (err) {
+    throw err;
+  }
+
+  // Test the position argument of fs.write().
+  fs.write(fd, buff1, 0, buff1.length, undefined, function(err, bytes, buffer) {
+    if (err) {
+      throw err;
+    }
+
+    fs.write(fd, buff2, 0, buff2.length, null, function(err, bytes, buffer) {
+      if (err) {
+        throw err;
+      }
+
+      // Check the result.
+      var result = new Buffer(6);
+      fs.read(fd, result, 0, result.length, 0, function(err, bytes, buffer) {
+        if (err) {
+          throw err;
+        }
+        var init_buffers = Buffer.concat([buff1, buff2]);
+        assert.assert(result.equals(init_buffers));
+
+        fs.close(fd, function(err) {
+          if (err) {
+            throw err;
+          }
+        });
+      });
+    });
+  });
+});
diff --git a/test/run_pass/test_fs_writefile.js b/test/run_pass/test_fs_writefile.js
new file mode 100644 (file)
index 0000000..c2c4be2
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+ /*
+  @STDOUT=Pass
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var file = process.cwd() + '/resources/test';
+var buff1 = new Buffer('test string1');
+var str = 'test string2';
+var num = 1;
+
+fs.writeFile(file, buff1, function (err) {
+  assert.equal(err, null);
+  fs.readFile(file, function (err, buff2) {
+    assert.equal(err, null);
+      assert.equal(buff2.equals(buff1), true);
+      fs.writeFile(file, str, function (err) {
+        assert.equal(err, null);
+        fs.readFile(file, function (err, buff2) {
+          assert.equal(err, null);
+          assert.equal(str.valueOf(), buff2.toString('utf8'));
+            fs.writeFile(file, num, function (err) {
+            assert.equal(err, null);
+              fs.readFile(file, function (err, buff2) {
+                assert.equal(err, null);
+                assert.equal(num, parseInt(buff2.toString('utf8'), 10));
+                console.log('Pass');
+                fs.unlinkSync(file);
+              });
+            });
+        });
+      });
+    });
+});
diff --git a/test/run_pass/test_fs_writefile_sync.js b/test/run_pass/test_fs_writefile_sync.js
new file mode 100644 (file)
index 0000000..0df492e
--- /dev/null
@@ -0,0 +1,45 @@
+
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+ /*
+  @STDOUT=Pass
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var file = process.cwd() + '/resources/test';
+var buff1 = new Buffer('test string1');
+var buff2 = null;
+var str = 'test string2';
+var num = 1;
+
+fs.writeFileSync(file, buff1);
+buff2 = fs.readFileSync(file);
+assert.equal(buff2.equals(buff1), true);
+
+fs.writeFileSync(file, str);
+buff2 = fs.readFileSync(file);
+assert.equal(str.valueOf(), buff2.toString('utf8'));
+
+
+fs.writeFileSync(file, num);
+buff2 = fs.readFileSync(file);
+assert.equal(num, parseInt(buff2.toString('utf8'), 10));
+
+console.log('Pass');
+
+fs.unlinkSync(file);
diff --git a/test/run_pass/test_fs_writefile_unlink.js b/test/run_pass/test_fs_writefile_unlink.js
new file mode 100644 (file)
index 0000000..4c49701
--- /dev/null
@@ -0,0 +1,45 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+ /*
+  @STDOUT=Pass
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var file1 = process.cwd() + "/resources/tobeornottobe.txt";
+var file2 = process.cwd() + "/resources/tobeornottobe_async.txt";
+
+fs.readFile(file1, function(err, buf1) {
+  assert.equal(err, null);
+  fs.writeFile(file2, buf1, function(err) {
+    assert.equal(err, null);
+    fs.exists(file2, function(exists) {
+      assert.equal(exists, true);
+      fs.readFile(file1, function(err, buf2) {
+        assert.equal(err, null);
+        assert.equal(buf1.toString(), buf2.toString());
+        fs.unlink(file2, function(err) {
+          assert.equal(err, null);
+          fs.exists(file2, function(exists) {
+            assert.equal(exists, false);
+            console.log("Pass");
+          });
+        });
+      });
+    });
+  });
+});
diff --git a/test/run_pass/test_fs_writefile_unlink_sync.js b/test/run_pass/test_fs_writefile_unlink_sync.js
new file mode 100644 (file)
index 0000000..926ed4c
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var assert = require('assert');
+
+var file1 = process.cwd() + "/resources/tobeornottobe.txt";
+var file2 = process.cwd() + "/resources/tobeornottobe_sync.txt";
+
+/* make a new file2 from file1 */
+var buf1 = fs.readFileSync(file1);
+fs.writeFileSync(file2, buf1);
+
+/* Does file2 exists ? */
+var result = fs.existsSync(file2);
+assert.equal(result, true);
+
+/* Is file2 equal to file1 */
+var buf2 = fs.readFileSync(file2);
+assert(buf1.toString(), buf2.toString());
+
+/* Remove file2 */
+fs.unlinkSync(file2);
+
+/* Is file2 removed? */
+result = fs.existsSync(file2);
+assert.equal(result, false);
diff --git a/test/run_pass/test_gpio_event.js b/test/run_pass/test_gpio_event.js
new file mode 100644 (file)
index 0000000..7a4cb39
--- /dev/null
@@ -0,0 +1,48 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var Gpio = require('gpio');
+var gpio = new Gpio();
+
+var testGpioInfo = [
+  {
+    pin: 13,
+    edge: gpio.EDGE.RISING
+  },
+  {
+    pin: 19,
+    edge: gpio.EDGE.FALLING
+  },
+  {
+    pin: 26,
+    edge: gpio.EDGE.BOTH
+  }
+];
+
+testGpioInfo.forEach(function(info) {
+  var switchGpio = gpio.open({
+    pin: info.pin,
+    edge: info.edge,
+    direction: gpio.DIRECTION.IN
+  }, function() {
+    switchGpio.on('change', function() {
+      console.log('pin:', info.pin, ', current value:', this.readSync());
+    });
+  });
+});
+
+setTimeout(function(){
+  console.log('finish test');
+}, 10000);
diff --git a/test/run_pass/test_gpio_input.js b/test/run_pass/test_gpio_input.js
new file mode 100644 (file)
index 0000000..220526e
--- /dev/null
@@ -0,0 +1,87 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+var Gpio = require('gpio');
+var gpio = new Gpio();
+
+var ledGpio = null, switchGpio = null;
+var ledPin, switchPin, ledMode;
+
+var SWITCH_ON = false,
+    LED_ON = true,
+    LED_OFF = false;
+
+var loopCnt = 0;
+
+if (process.platform === 'linux') {
+  ledPin = 20;
+  switchPin = 13;
+  ledMode = gpio.MODE.NONE;
+} else if (process.platform === 'nuttx') {
+  var pin = require('stm32f4dis').pin;
+  ledPin = pin.PA10;
+  switchPin = pin.PA15;
+  ledMode = gpio.MODE.PUSHPULL;
+} else if(process.platform === 'tizenrt') {
+  ledPin = 41;
+  switchPin = 39;
+  ledMode = gpio.MODE.NONE;
+} else {
+  assert.fail();
+}
+
+ledGpio = gpio.open({
+  pin: ledPin,
+  direction: gpio.DIRECTION.OUT,
+  mode: ledMode
+}, function() {
+  this.writeSync(LED_OFF);
+});
+
+switchGpio = gpio.open({
+  pin: switchPin,
+  direction: gpio.DIRECTION.IN
+});
+
+var loop = setInterval(function() {
+  if (!ledGpio || !switchGpio) {
+    return;
+  }
+
+  if ((++loopCnt) == 10) {
+    clearInterval(loop);
+    ledGpio.closeSync();
+    switchGpio.closeSync();
+    ledGpio = switchGpio = null;
+    console.log('finish test');
+    return;
+  }
+
+  switchGpio.read(function(err, value) {
+    if (err) {
+      clearInterval(loop);
+      assert.fail();
+    }
+
+    if (value === SWITCH_ON) {
+      console.log('led on');
+      ledGpio.writeSync(LED_ON);
+    } else {
+      ledGpio.writeSync(LED_OFF);
+    }
+  });
+}, 500);
diff --git a/test/run_pass/test_gpio_output.js b/test/run_pass/test_gpio_output.js
new file mode 100644 (file)
index 0000000..e9b972e
--- /dev/null
@@ -0,0 +1,83 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+var Gpio = require('gpio');
+var gpio = new Gpio();
+
+var LED_ON = true,
+  LED_OFF = false;
+var pin, mode;
+var gpio20;
+
+if (process.platform === 'linux') {
+  pin = 20;
+  mode = gpio.MODE.NONE;
+} else if (process.platform === 'nuttx') {
+  pin = require('stm32f4dis').pin.PA10;
+  mode = gpio.MODE.PUSHPULL;
+} else if(process.platform === 'tizenrt') {
+  pin = 41;
+  mode = gpio.MODE.NONE;
+} else {
+  assert.fail();
+}
+
+test1();
+
+gpio20 = gpio.open({
+  pin: pin,
+  direction: gpio.DIRECTION.OUT,
+  mode: mode
+}, test2);
+
+function test1() {
+  assert.notEqual(gpio.DIRECTION.IN, undefined);
+  assert.notEqual(gpio.DIRECTION.OUT, undefined);
+  assert.notEqual(gpio.MODE.NONE, undefined);
+  if (process.platform === 'nuttx') {
+    assert.notEqual(gpio.MODE.PULLUP, undefined);
+    assert.notEqual(gpio.MODE.PULLDOWN, undefined);
+    assert.notEqual(gpio.MODE.FLOAT, undefined);
+    assert.notEqual(gpio.MODE.PUSHPULL, undefined);
+    assert.notEqual(gpio.MODE.OPENDRAIN, undefined);
+  }
+}
+
+// turn on LED for 3000ms
+function test2(err) {
+  assert.equal(err, null);
+
+  gpio20.write(LED_ON, function(writeErr) {
+    assert.equal(writeErr, null);
+    console.log('gpio write');
+
+    gpio20.read(function(readErr, value) {
+      assert.equal(readErr, null);
+      console.log('gpio read:', value);
+      assert.equal(LED_ON, value);
+
+      setTimeout(function() {
+        gpio20.writeSync(LED_OFF);
+        var value = gpio20.readSync();
+        console.log('gpio read:', value);
+        assert.equal(LED_OFF, value);
+        gpio20.close();
+        console.log('finish test');
+      }, 3000);
+    });
+  });
+}
diff --git a/test/run_pass/test_https_get.js b/test/run_pass/test_https_get.js
new file mode 100644 (file)
index 0000000..3ef93e2
--- /dev/null
@@ -0,0 +1,85 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+var https = require('https');
+
+
+var isRequest1Finished = false;
+// 1. GET req
+options = {
+  method: 'GET',
+  host: "httpbin.org",
+  path: '/user-agent',
+  headers: {'user-agent': 'iotjs'}
+};
+
+var getResponseHandler = function (res) {
+  var res_body = '';
+
+  assert.equal(200, res.statusCode);
+
+  var endHandler = function(){
+    var response = JSON.parse(res_body);
+    assert.equal('iotjs', response['user-agent']);
+    isRequest1Finished = true;
+  };
+  res.on('end', endHandler);
+
+  res.on('data', function(chunk){
+    res_body += chunk.toString();
+  });
+};
+
+https.get(options, getResponseHandler);
+
+// 2. close server req
+var testMsg = 'Hello IoT.js';
+var finalOptions = {
+  method: 'POST',
+  host: "httpbin.org",
+  path: '/post',
+  headers: {'Content-Length': testMsg.length,
+    'Content-Type': 'application/json'}
+};
+var isRequest2Finished = false;
+
+var finalResponseHandler = function (res) {
+  var res_body = '';
+
+  assert.equal(200, res.statusCode);
+
+  var endHandler = function(){
+    var response = JSON.parse(res_body);
+    assert.equal(testMsg, response['data']);
+    isRequest2Finished = true;
+  };
+  res.on('end', endHandler);
+
+  res.on('data', function(chunk){
+    res_body += chunk.toString();
+  });
+};
+
+var finalReq = https.request(finalOptions, finalResponseHandler);
+finalReq.write(testMsg);
+finalReq.end();
+
+
+process.on('exit', function() {
+  assert.equal(isRequest1Finished, true);
+  assert.equal(isRequest2Finished, true);
+});
diff --git a/test/run_pass/test_https_request_response.js b/test/run_pass/test_https_request_response.js
new file mode 100644 (file)
index 0000000..5054afd
--- /dev/null
@@ -0,0 +1,119 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var http = require('http');
+var https = require('https');
+var net = require('net');
+
+// Messages for further requests.
+var message = 'Hello IoT.js';
+
+// Options for further requests.
+var options = {
+  method: 'POST',
+  host: "httpbin.org",
+  path: '/post',
+  headers: {'Content-Length': message.length,
+    'Content-Type': 'application/json'}
+};
+
+// Simple request with valid utf-8 message.
+var isRequest1Finished = false;
+var request1 = https.request(options, function(response) {
+  var str = '';
+
+  response.on('data', function(chunk) {
+    str += chunk.toString();
+  });
+
+  response.on('end', function() {
+    var response = JSON.parse(str);
+    assert.equal(message, response['data']);
+    isRequest1Finished = true;
+  });
+});
+request1.end(message);
+
+
+// Simple request with multiple end callback.
+var isRequest2Finished = false;
+var request2 = https.request(options, function(response) {
+  var str = '';
+
+  response.on('data', function(chunk) {
+    str += chunk.toString();
+  });
+
+  response.on('end', function() {
+    var response = JSON.parse(str);
+    assert.equal(message, response['data']);
+  });
+});
+
+request2.end(message, function() {
+  isRequest2Finished = true;
+});
+
+// Call the request2 end again to test the finish state.
+request2.end(message, function() {
+  // This clabback should never be called.
+  assert.equal(isRequest2Finished, false);
+});
+
+
+// Simple request with buffer chunk as message parameter.
+var isRequest3Finished = false;
+var request3 = https.request(options, function(response) {
+  var str = '';
+
+  response.on('data', function(chunk) {
+    str += chunk;
+  });
+
+  response.on('end', function() {
+    var response = JSON.parse(str);
+    assert.equal(message, response['data']);
+    isRequest3Finished = true;
+  });
+});
+request3.end(new Buffer(message));
+
+
+// Test the IncomingMessage read function.
+var isRequest4Finished = false;
+var readRequest = https.request({
+  method: 'GET',
+  host: "httpbin.org",
+  path: '/get'
+});
+
+readRequest.on('response', function(incomingMessage) {
+  incomingMessage.on('readable', function() {
+    var inc = incomingMessage.read();
+    assert.equal(inc instanceof Buffer, true);
+    assert(inc.toString('utf8').length > 0);
+    isRequest4Finished = true;
+  });
+});
+readRequest.end();
+
+
+process.on('exit', function() {
+  assert.equal(isRequest1Finished, true);
+  assert.equal(isRequest2Finished, true);
+  assert.equal(isRequest3Finished, true);
+  assert.equal(isRequest4Finished, true);
+});
diff --git a/test/run_pass/test_https_timeout.js b/test/run_pass/test_https_timeout.js
new file mode 100644 (file)
index 0000000..95531b6
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var assert = require('assert');
+var https = require('https');
+
+options = {
+  method: 'GET',
+  host: 'httpbin.org',
+  path: '/delay/10'
+};
+
+var getReq = https.get(options);
+
+getReq.on('error', function(){});
+
+var timeouted = false;
+getReq.setTimeout(5000, function() {
+  timeouted = true;
+  getReq.abort();
+});
+
+process.on('exit', function(code) {
+  assert.equal(timeouted, true);
+});
diff --git a/test/run_pass/test_i2c.js b/test/run_pass/test_i2c.js
new file mode 100644 (file)
index 0000000..3752130
--- /dev/null
@@ -0,0 +1,51 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+/* This test is based on Raspberry Pi with GY-30 Sensor. */
+
+var assert = require('assert');
+var I2C = require('i2c');
+
+var i2c = new I2C();
+var configuration = {};
+
+configuration.address = 0x23;
+if (process.platform === 'linux') {
+  configuration.device = '/dev/i2c-1';
+} else if (process.platform === 'nuttx') {
+  configuration.device = 1;
+} else {
+  assert.fail();
+}
+
+var wire = i2c.open(configuration, function(err) {
+  if (err) {
+    throw err;
+  }
+
+  wire.write([0x10], function(err) {
+    assert.equal(err, null);
+    console.log('write done');
+
+    wire.read(2, function(err, res) {
+      assert.equal(err, null);
+      assert.equal(res.length, 2, 'I2C read failed.(length is not equal)');
+      console.log('read result: '+res[0]+', '+res[1]);
+      wire.close();
+      console.log('test ok');
+    });
+  });
+});
+
diff --git a/test/run_pass/test_iotjs_promise.js b/test/run_pass/test_iotjs_promise.js
new file mode 100644 (file)
index 0000000..f2725cd
--- /dev/null
@@ -0,0 +1,29 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+var assert = require('assert');
+var fulfill_ret;
+var p = new Promise(function(resolve, reject) {
+  // mimic asynchronous operation via setTimeout
+  setTimeout(function() { resolve("Resolved") }, 100);;
+});
+
+p.then(function (msg) {
+  // Promise does not like throwing error in fulfill handler
+  // So just set the message in global variable.
+  fulfill_ret = msg;
+});
+
+// If Promise's fulfill worked well, assertion must be valid.
+setTimeout(function() { assert.equal(fulfill_ret, "Resolved"); }, 200);
diff --git a/test/run_pass/test_module_cache.js b/test/run_pass/test_module_cache.js
new file mode 100644 (file)
index 0000000..65f3cc3
--- /dev/null
@@ -0,0 +1,22 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+
+var module_cache = require('run_pass/require1/module_cache.js');
+module_cache.i = 100;
+module_cache = require('run_pass/require1/module_cache.js');
+
+assert.equal(module_cache.i, 100);
diff --git a/test/run_pass/test_module_require.js b/test/run_pass/test_module_require.js
new file mode 100644 (file)
index 0000000..6f350fe
--- /dev/null
@@ -0,0 +1,42 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+
+var dir = process.cwd() + "/run_pass/require1/";
+
+// Load a JS file.
+var x = require(dir + "require_add");
+assert.equal(x.add(1,4), 5);
+
+// Load a package.
+var pkg1 = require(dir + "test_pkg");
+assert.equal(pkg1.add(22, 44), 66);
+assert.equal(pkg1.multi(22, 44), 968);
+assert.equal(pkg1.add2(22, 44), 66);
+
+var pkg2 = require(dir + "test_index");
+assert.equal(pkg2.add(22, 44), 66);
+assert.equal(pkg2.multi(22, 44), 968);
+assert.equal(pkg2.add2(22, 44), 66);
+
+// Load invalid modules.
+assert.throws(function() {
+  var test3 = require('run_pass/require1/babel-template');
+}, Error);
+
+assert.throws(function() {
+  var test4 = require('tmp');
+}, Error);
diff --git a/test/run_pass/test_net_1.js b/test/run_pass/test_net_1.js
new file mode 100644 (file)
index 0000000..3a5df6e
--- /dev/null
@@ -0,0 +1,51 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var net = require('net');
+var assert = require('assert');
+
+
+var server = net.createServer();
+var port = 22701;
+
+server.listen(port, 5);
+
+server.on('connection', function(socket) {
+  socket.on('data', function(data) {
+    socket.end('Hello IoT.js');
+  });
+  socket.on('close', function() {
+    server.close();
+  });
+});
+
+
+var socket = new net.Socket();
+var msg = "";
+
+socket.connect(port, "127.0.0.1");
+socket.write("Hello IoT.js");
+
+socket.on('data', function(data) {
+  msg += data;
+});
+
+socket.on('end', function() {
+  socket.end();
+});
+
+process.on('exit', function(code) {
+  assert.equal(msg, "Hello IoT.js");
+});
diff --git a/test/run_pass/test_net_10.js b/test/run_pass/test_net_10.js
new file mode 100644 (file)
index 0000000..974398c
--- /dev/null
@@ -0,0 +1,55 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var net = require('net');
+var assert = require('assert');
+
+var server = net.createServer();
+var port = 22709;
+
+var timedout = false;
+var connected = false;
+
+server.listen(port, 1);
+
+server.on('connection', function(newSocket) {
+  connected = true;
+  console.log("Connected!");
+
+  newSocket.on('error', function() {
+    assert.fail();
+  });
+
+  newSocket.setTimeout(500);
+
+  newSocket.on('timeout', function() {
+    console.log("Timeout");
+    timedout = true;
+    newSocket.destroy();
+    socket.destroy();
+    server.close();
+  });
+});
+
+var socket = net.createConnection(port);
+
+socket.on('error', function() {
+  assert.fail();
+});
+
+process.on('exit', function() {
+  assert(timedout);
+  assert(connected);
+});
diff --git a/test/run_pass/test_net_2.js b/test/run_pass/test_net_2.js
new file mode 100644 (file)
index 0000000..4f14943
--- /dev/null
@@ -0,0 +1,53 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var net = require('net');
+var assert = require('assert');
+
+var port = 22702;
+
+var server = net.createServer({
+  allowHalfOpen: true
+});
+
+server.listen(port, 5);
+
+server.on('connection', function(socket) {
+  var msg = '';
+  socket.on('data', function(data) {
+    msg += data;
+  });
+  socket.on('end', function() {
+    socket.end(msg);
+    server.close();
+  });
+});
+
+
+var socket = new net.Socket();
+var echo_msg = '';
+
+socket.connect(port, '127.0.0.1', function() {
+  socket.end('Hello IoT.js');
+});
+
+socket.on('data', function(data) {
+  echo_msg += data;
+});
+
+socket.on('end', function() {
+  assert.equal(echo_msg, "Hello IoT.js");
+});
diff --git a/test/run_pass/test_net_3.js b/test/run_pass/test_net_3.js
new file mode 100644 (file)
index 0000000..1b34918
--- /dev/null
@@ -0,0 +1,89 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var net = require('net');
+var assert = require('assert');
+
+
+var port = 22703;
+var limit = 200;
+var server = net.createServer();
+
+server.listen({ port: port });
+
+server.on('connection', function(socket) {
+  var i = 0;
+  var writing = function() {
+    var ok;
+    do {
+      ok = socket.write("" + (i % 10));
+      if (++i == limit) {
+        socket.end();
+        ok = false;
+      }
+    } while (ok);
+  };
+  socket.on('drain', writing);
+  writing();
+});
+
+
+var msg1 = '';
+var socket1 = net.createConnection(port);
+
+socket1.on('data', function(data) {
+  msg1 += data;
+});
+
+
+var msg2 = '';
+var socket2 = net.createConnection({port: port});
+
+socket2.on('data', function(data) {
+  msg2 += data;
+});
+
+
+var msg3 = '';
+var socket3 = net.createConnection({port: port, host: '127.0.0.1'});
+
+socket3.on('data', function(data) {
+  msg3 += data;
+});
+
+
+var msg4 = '';
+var connectListenerCheck = false;
+var socket4 = net.createConnection({port: port}, function() {
+  connectListenerCheck = true;
+});
+
+socket4.on('data', function(data) {
+  msg4 += data;
+});
+
+socket4.on('end', function() {
+  server.close();
+});
+
+
+process.on('exit', function(code) {
+  assert.equal(msg1.length, limit);
+  assert.equal(msg2.length, limit);
+  assert.equal(msg3.length, limit);
+  assert.equal(msg4.length, limit);
+  assert(connectListenerCheck);
+});
diff --git a/test/run_pass/test_net_4.js b/test/run_pass/test_net_4.js
new file mode 100644 (file)
index 0000000..d8817a0
--- /dev/null
@@ -0,0 +1,57 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var net = require('net');
+var assert = require('assert');
+var timers = require('timers');
+
+
+var server = net.createServer();
+var port = 22704;
+var timeout = 1000;
+var writeat = 2000;
+
+server.listen(port, 5);
+
+server.on('connection', function(socket) {
+  socket.setTimeout(timeout, function() {
+    socket.end();
+  });
+  socket.on('data', function(data) {
+    socket.end();
+  });
+  socket.on('close', function() {
+    server.close();
+  });
+});
+
+
+var socket = new net.Socket();
+
+socket.connect(port, "127.0.0.1");
+
+socket.on('connect', function() {
+  timers.setTimeout(function() {
+    assert.throws(
+      function() {
+        socket.write('Hello IoT.js');
+      }, Error);
+  }, writeat);
+});
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+});
diff --git a/test/run_pass/test_net_5.js b/test/run_pass/test_net_5.js
new file mode 100644 (file)
index 0000000..1374e1e
--- /dev/null
@@ -0,0 +1,60 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var net = require('net');
+var assert = require('assert');
+var timers = require('timers');
+
+
+var server = net.createServer();
+var port = 22705;
+var timeout = 2000;
+var writeat = 1000;
+var msg = '';
+
+server.listen(port, 5);
+
+server.on('connection', function(socket) {
+  socket.setTimeout(timeout, function() {
+    assert.equal(msg, 'Hello IoT.js');
+    socket.end();
+  });
+  socket.on('data', function(data) {
+    msg = data;
+  });
+  socket.on('close', function() {
+    server.close();
+  });
+});
+
+
+var socket = new net.Socket();
+
+socket.connect(port, "127.0.0.1");
+
+socket.on('end', function() {
+  socket.end();
+});
+
+socket.on('connect', function() {
+  timers.setTimeout(function() {
+    socket.write('Hello IoT.js');
+  }, writeat);
+});
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+});
diff --git a/test/run_pass/test_net_6.js b/test/run_pass/test_net_6.js
new file mode 100644 (file)
index 0000000..0541322
--- /dev/null
@@ -0,0 +1,67 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var net = require('net');
+var assert = require('assert');
+var timers = require('timers');
+
+
+var server = net.createServer();
+var port = 22706;
+
+server.listen(port, 5);
+
+server.on('connection', function(socket) {
+  socket.on('data', function(data) {
+    msg += data;
+    socket.end();
+  });
+  socket.on('close', function() {
+    server.close();
+  });
+
+  // as soon as connection established, pause the socket
+  socket.pause();
+
+  // resume after 2 secs
+  timers.setTimeout(function() {
+    socket.resume();
+  }, 2000);
+});
+
+
+var socket = new net.Socket();
+var msg = "";
+
+socket.connect(port, "127.0.0.1");
+socket.on('connect', function() {
+  // client writes "1" first, but server is paused for 2 secs
+  // server gets "1" after 2 secs
+  socket.write("1");
+
+  // "2" is appended to msg before "1"
+  timers.setTimeout(function() {
+    msg += "2";
+  }, 1000);
+});
+
+socket.on('end', function() {
+  socket.end();
+});
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+  assert.equal(msg, "21");
+});
diff --git a/test/run_pass/test_net_7.js b/test/run_pass/test_net_7.js
new file mode 100644 (file)
index 0000000..faa4a14
--- /dev/null
@@ -0,0 +1,75 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var net = require('net');
+var assert = require('assert');
+var timers = require('timers');
+
+var port = 22707;
+
+var count = 40;
+var check = [];
+
+function serverListen() {
+  var server = net.createServer({
+    allowHalfOpen: true
+  });
+
+  var cnt = 0;
+
+  server.listen(port);
+
+  server.on('connection', function(socket) {
+    var msg = '';
+    socket.on('data', function(data) {
+      msg += data;
+    });
+    socket.on('end', function() {
+      socket.end(msg);
+      cnt++;
+
+      if (cnt == count) {
+        server.close();
+      }
+    });
+  });
+}
+
+serverListen();
+
+for (var i = 0; i < count; ++i) {
+  (function(i) {
+    var socket = new net.Socket();
+    var msg = "";
+
+    socket.connect(port, "localhost");
+    socket.on('connect', function() {
+      socket.end(i.toString());
+    });
+    socket.on('data', function(data) {
+      check[data] = true;
+    });
+  })(i);
+}
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+  for (var i = 0; i < count; ++i) {
+    if (!check[i]) {
+      assert.fail();
+    }
+  }
+});
diff --git a/test/run_pass/test_net_8.js b/test/run_pass/test_net_8.js
new file mode 100644 (file)
index 0000000..f83db72
--- /dev/null
@@ -0,0 +1,73 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var net = require('net');
+var assert = require('assert');
+var timers = require('timers');
+
+var port = 22708;
+
+var server = net.createServer();
+
+server.listen(port, 5);
+
+server.on('close', function() {
+  assert.equal(msg, '12');
+});
+
+server.on('connection', function(socket) {
+  socket.on('data', function(data) {
+    socket.end(data);
+  });
+  socket.on('close', function() {
+    server.close();
+  });
+});
+
+var sock1 = new net.Socket();
+var sock2 = new net.Socket();
+
+var msg = '';
+
+sock1.connect(port, 'localhost');
+sock2.connect(port, 'localhost');
+
+sock1.on('data', function(data) {
+  msg += data;
+});
+
+sock1.on('end', function() {
+  sock1.end();
+});
+
+sock2.on('data', function(data) {
+  msg += data;
+});
+
+sock2.on('end', function() {
+  sock2.end();
+});
+
+timers.setTimeout(function() {
+  sock1.write('1');
+}, 1000);
+
+timers.setTimeout(function() {
+  sock2.write('2');
+}, 2000);
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+});
diff --git a/test/run_pass/test_net_9.js b/test/run_pass/test_net_9.js
new file mode 100644 (file)
index 0000000..6bd2dee
--- /dev/null
@@ -0,0 +1,56 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var net = require('net');
+var assert = require('assert');
+
+
+var server = net.createServer();
+var port = 22709;
+
+server.listen(port, 5);
+
+server.on('close', function() {
+});
+
+server.on('connection', function(socket) {
+  socket.on('data', function(data) {
+    socket.end('Hello IoT.js');
+  });
+  socket.on('close', function() {
+    server.close();
+  });
+});
+
+
+var socket = new net.Socket();
+var msg = "";
+
+socket.connect(port, "127.0.0.1");
+socket.write("Hello IoT.js");
+
+socket.on('data', function(data) {
+  msg += data;
+});
+
+socket.on('end', function() {
+  socket.end();
+});
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+  assert.equal(msg, "Hello IoT.js");
+});
diff --git a/test/run_pass/test_net_connect.js b/test/run_pass/test_net_connect.js
new file mode 100644 (file)
index 0000000..d1e46e1
--- /dev/null
@@ -0,0 +1,51 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var net = require('net');
+var host = '127.0.0.1';
+var port = 5696;
+var msg = 'Hello IoT.js';
+
+var server = net.createServer({
+    allowHalfOpen: true,
+  },
+  function(socket) {
+    server.close();
+  }
+).listen(port);
+
+server.on('connection', function(socket) {
+  var data = '';
+  socket.on('data', function(chuck) {
+    data += chuck;
+  });
+  socket.on('end', function() {
+    socket.end(data);
+  });
+});
+
+var socket = net.connect(port, host, function() {
+  var data = '';
+  socket.on('data', function(chuck) {
+    data += chuck;
+  });
+
+  socket.on('end', function() {
+    assert.equal(data, msg);
+  });
+
+  socket.end(msg);
+});
diff --git a/test/run_pass/test_net_headers.js b/test/run_pass/test_net_headers.js
new file mode 100644 (file)
index 0000000..7a559e6
--- /dev/null
@@ -0,0 +1,98 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var assert = require('assert');
+var http = require('http');
+var checkReqFinish = false;
+
+// server side code
+// Server just ends after sending with some headers.
+
+var server = http.createServer(function (req, res) {
+
+  req.on('data', function (chunk) {
+    body += chunk;
+  });
+
+  var endHandler = function () {
+    // this should return.
+    res.removeHeader('h1');
+
+    res.setHeader('h1','h1');
+    res.setHeader('h2','h2');
+    res.setHeader('h3','h3');
+    res.removeHeader('h2');
+    if (res.getHeader('h3') == 'h3') {
+      res.setHeader('h3','h3prime'); // h3 value should be overwrited
+    }
+    // final res.headers = { 'h1' : 'h1', 'h3': 'h3prime' }
+
+    var responseSize;
+    if (process.platform === 'linux') {
+      // For Desktop and RPI, test with large header.
+      responseSize = 500;
+    } else {
+      // NuttX and TizenRt cannot handle large header.
+      responseSize = 10;
+    }
+    for (var i = 0; i < responseSize; i++) {
+      res.setHeader('h' + (5 + i), 'h' + (5 + i));
+    }
+
+    res.end(function(){
+      server.close();
+    });
+  };
+
+  req.on('end', endHandler);
+
+});
+server.listen(3045, 3);
+
+
+// client req code
+
+var options = {
+  method : 'GET',
+  port : 3045
+};
+
+
+var postResponseHandler = function (res) {
+  var res_body = '';
+
+  assert.equal(200, res.statusCode);
+  assert.equal(res.headers['h1'], 'h1');
+  assert.equal(res.headers['h2'], undefined);
+  assert.equal(res.headers['h3'], 'h3prime');
+
+  var endHandler = function(){
+    checkReqFinish = true;
+  };
+  res.on('end', endHandler);
+
+  res.on('data', function(chunk){
+    res_body += chunk.toString();
+  });
+};
+
+var req = http.request(options, postResponseHandler);
+req.end();
+
+process.on('exit', function() {
+  assert.equal(checkReqFinish, true);
+});
diff --git a/test/run_pass/test_net_http_get.js b/test/run_pass/test_net_http_get.js
new file mode 100644 (file)
index 0000000..7f9ff4d
--- /dev/null
@@ -0,0 +1,98 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+var http = require('http');
+
+
+var server = http.createServer(function (req, res) {
+
+  var body = '';
+  var url = req.url;
+
+  req.on('data', function (chunk) {
+    body += chunk;
+  });
+
+  var endHandler = function () {
+
+    res.writeHead(200, { 'Connection' : 'close',
+                         'Content-Length' : body.length
+                       });
+    res.write(body);
+    res.end(function(){
+      if(body == 'close server') server.close();
+    });
+  };
+
+  req.on('end', endHandler);
+
+});
+
+server.listen(3005,5);
+
+
+// 1. GET req
+options = {
+  method : 'GET',
+  port : 3005
+};
+
+var getResponseHandler = function (res) {
+  var res_body = '';
+
+  assert.equal(200, res.statusCode);
+
+  var endHandler = function(){
+    // GET msg, no received body
+    assert.equal('', res_body);
+  };
+  res.on('end', endHandler);
+
+  res.on('data', function(chunk){
+    res_body += chunk.toString();
+  });
+};
+
+http.get(options, getResponseHandler);
+
+
+// 2. close server req
+var finalMsg = 'close server';
+var finalOptions = {
+  method : 'POST',
+  port : 3005,
+  headers : {'Content-Length': finalMsg.length}
+};
+
+var finalResponseHandler = function (res) {
+  var res_body = '';
+
+  assert.equal(200, res.statusCode);
+
+  var endHandler = function(){
+    assert.equal(finalMsg, res_body);
+  };
+  res.on('end', endHandler);
+
+  res.on('data', function(chunk){
+    res_body += chunk.toString();
+  });
+};
+
+var finalReq = http.request(finalOptions, finalResponseHandler);
+finalReq.write(finalMsg);
+finalReq.end();
diff --git a/test/run_pass/test_net_http_request_response.js b/test/run_pass/test_net_http_request_response.js
new file mode 100644 (file)
index 0000000..c94202f
--- /dev/null
@@ -0,0 +1,195 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var http = require('http');
+var net = require('net');
+
+// Messages for further requests.
+var message = 'Hello IoT.js';
+
+// Options for further requests.
+var options = {
+  method: 'POST',
+  port: 3005,
+  path: '/',
+  headers : {'Content-Length': message.length}
+};
+
+var server1 = http.createServer(function(request, response) {
+  var str = '';
+
+  request.on('data', function (chunk) {
+    str += chunk.toString();
+  });
+
+  request.on('end', function() {
+    assert.equal(str, message);
+    response.end();
+  });
+});
+server1.listen(3005, 5);
+
+// Simple request with valid utf-8 message.
+var isRequest1Finished = false;
+var request1 = http.request(options, function(response) {
+  var str = '';
+
+  response.on('data', function(chunk) {
+    str += chunk.toString();
+  });
+
+  response.on('end', function() {
+    isRequest1Finished = true;
+    server1.close();
+  });
+});
+request1.end(message, 'utf-8');
+
+
+var server2 = http.createServer(function(request, response) {
+  response.end();
+});
+server2.listen(3006, 5);
+
+// Simple request with end callback.
+var isRequest2Finished = false;
+options.port = 3006;
+var request2 = http.request(options);
+request2.end(message, function() {
+  server2.close();
+  isRequest2Finished = true;
+});
+
+// Call the request2 end again to test the finish state.
+request2.end(message, function() {
+  // This clabback should never be called.
+  assert.equal(isRequest2Finished, false);
+});
+
+
+var server3 = http.createServer(function(request, response) {
+  var str = '';
+
+  request.on('data', function(chunk) {
+    str += chunk;
+  });
+
+  request.on('end', function() {
+    // Check if we got the proper message.
+    assert.equal(str, message);
+    response.end();
+  });
+});
+server3.listen(3007, 5);
+
+// Simple request with buffer chunk as message parameter.
+options.port = 3007;
+var isRequest3Finished = false;
+var request3 = http.request(options, function(response) {
+  var str = '';
+
+  response.on('data', function(chunk) {
+    str += chunk;
+  });
+
+  response.on('end', function() {
+    isRequest3Finished = true;
+    server3.close();
+  });
+});
+request3.end(new Buffer(message));
+
+
+// This test is to make sure that when the HTTP server
+// responds to a HEAD request, it does not send any body.
+var server4 = http.createServer(function(request, response) {
+  response.writeHead(200);
+  response.end();
+});
+server4.listen(3008, 5);
+
+var isRequest4Finished = false;
+var request4 = http.request({
+  method: 'HEAD',
+  port: 3008,
+  path: '/'
+}, function(response) {
+  response.on('end', function() {
+    isRequest4Finished = true;
+    assert.equal(response.statusCode, 200);
+    server4.close();
+  });
+});
+request4.end();
+
+
+// Write a header twice in the server response.
+var server5 = http.createServer(function(request, response) {
+  var str = '';
+
+  request.on('data', function(chunk) {
+    str += chunk;
+  });
+
+  request.on('end', function() {
+    response.writeHead(200, 'OK', {'Connection' : 'close1'});
+    // Wrote the same head twice.
+    response.writeHead(200, 'OK', {'Connection' : 'close2'});
+    // Wrote a new head.
+    response.writeHead(200, {'Head' : 'Value'});
+    response.end();
+  });
+});
+server5.listen(3009, 5);
+
+options.port = 3009;
+options.headers = null;
+var isRequest5Finished = false;
+var request5 = http.request(options, function(response) {
+  response.on('end', function() {
+    isRequest5Finished = true;
+    assert.equal(response.headers['Connection'], 'close2');
+    assert.equal(response.headers['Head'], 'Value');
+    server5.close();
+  });
+});
+request5.end();
+
+
+// Test the IncomingMessage read function.
+var readRequest = http.request({
+  host: 'localhost',
+  port: 80,
+  path: '/',
+  method: 'GET'
+});
+readRequest.end();
+readRequest.on('response', function(incomingMessage) {
+  incomingMessage.on('readable', function() {
+    var inc = incomingMessage.read();
+    assert.equal(inc instanceof Buffer, true);
+    assert(inc.toString('utf8').length > 0);
+  });
+});
+
+
+process.on('exit', function() {
+  assert.equal(isRequest1Finished, true);
+  assert.equal(isRequest2Finished, true);
+  assert.equal(isRequest3Finished, true);
+  assert.equal(isRequest4Finished, true);
+  assert.equal(isRequest5Finished, true);
+});
diff --git a/test/run_pass/test_net_http_response_twice.js b/test/run_pass/test_net_http_response_twice.js
new file mode 100644 (file)
index 0000000..db93ee5
--- /dev/null
@@ -0,0 +1,61 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var http = require('http');
+var net = require('net');
+
+var body = 'Hello IoT.js\r\n';
+var fullResponse =
+  'HTTP/1.1 500 Internal Server Error\r\n' +
+  'Content-Length: ' + body.length + '\r\n' +
+  'Content-Type: text/plain\r\n' +
+  'Date: Fri + 5 May 2017 10:22:45 GMT\r\n' +
+  'Host: 127.0.0.1\r\n' +
+  'Access-Control-Allow-Credentials: true\r\n' +
+  'Server: badly broken/0.1 (OS NAME)\r\n' +
+  '\r\n' +
+  body;
+
+var server = net.createServer(function(socket) {
+  var postBody = '';
+
+  socket.on('data', function(chunk) {
+    postBody += chunk;
+
+    if (postBody.indexOf('\r\n') > -1) {
+      socket.write(fullResponse);
+      // Wrote the response twice.
+      socket.end(fullResponse);
+    }
+  });
+
+  socket.on('error', function(err) {});
+});
+
+server.listen(3085, function() {
+  http.get({ port: 3085 }, function(response) {
+    var buffer = '';
+
+    response.on('data', function(chunk) {
+      buffer += chunk;
+    });
+
+    response.on('end', function() {
+      assert.equal(body, buffer);
+      server.close();
+    });
+  });
+});
diff --git a/test/run_pass/test_net_http_status_codes.js b/test/run_pass/test_net_http_status_codes.js
new file mode 100644 (file)
index 0000000..4f3af50
--- /dev/null
@@ -0,0 +1,89 @@
+
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var http = require('http');
+
+var codes = ["100", "150", "199", "200", "204", "304", "404", "510"];
+var responses = [];
+var completedResponses = 0;
+
+var server = http.createServer(function (request, response) {
+  var str = '';
+
+  request.on('data', function (chunk) {
+      str += chunk;
+  });
+
+  request.on('end', function() {
+    if (codes.indexOf(str) > -1) {
+      response.writeHead(parseInt(str));
+    }
+
+    response.write(str);
+    response.end(function() {
+      if(str == 'close server') {
+        server.close();
+      }
+    });
+  });
+});
+
+server.listen(3008, 5);
+
+var options = {
+  method: 'POST',
+  port: 3008,
+  headers: {'Content-Length': 3}
+};
+
+
+for (var i = 0; i < codes.length; i++) {
+  var request = http.request(options, function(response) {
+    responses.push(response.statusCode);
+    completedResponses++;
+    if (completedResponses == codes.length) {
+      // Done with downloads.
+      for (var j = 0; j < codes.length; j++) {
+        assert(responses.indexOf(parseInt(codes[j])) > -1);
+      }
+    }
+  }).end(codes[i]);
+}
+
+var closeMessage = 'close server';
+var closeOptions = {
+  method : 'POST',
+  port : 3008,
+  headers : {'Content-Length': closeMessage.length}
+};
+var closeHandler = function(response) {
+  var str = '';
+
+  assert.equal(200, response.statusCode);
+
+  response.on('end', function() {
+    assert.equal(closeMessage, str);
+  });
+
+  response.on('data', function(chunk) {
+    str += chunk;
+  });
+};
+
+closeRequest = http.request(closeOptions, closeHandler);
+closeRequest.write(closeMessage);
+closeRequest.end();
diff --git a/test/run_pass/test_net_httpclient_error.js b/test/run_pass/test_net_httpclient_error.js
new file mode 100644 (file)
index 0000000..1f628ad
--- /dev/null
@@ -0,0 +1,65 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+var assert = require('assert');
+var http = require('http');
+
+var recievedResponse = false;
+
+var server = http.createServer(function(request, response) {
+  var str = '';
+
+  request.on('data', function (chunk) {
+    str += chunk;
+  });
+
+  request.on('end', function() {
+    response.end();
+  });
+});
+
+server.listen(20004, 5);
+
+// Connection refusal: The request will try to connect to a server,
+// however the connection can not be created because the port is invalid.
+var req = http.request({
+  host: 'localhost',
+  port: 20002,
+  path: '/',
+  method: 'GET'
+}, function(response) {
+  var str = '';
+
+  response.on('data', function(chunk) {
+    str += chunk;
+  });
+
+  response.on('end', function() {
+    recievedResponse = true;
+    server.close();
+  });
+});
+
+req.on('error', function() {
+  recievedResponse = false;
+  server.close();
+});
+
+req.setTimeout(100, function(){
+  req.end();
+});
+
+process.on('exit', function() {
+  assert.equal(recievedResponse, false);
+});
diff --git a/test/run_pass/test_net_httpclient_parse_error.js b/test/run_pass/test_net_httpclient_parse_error.js
new file mode 100644 (file)
index 0000000..ec66d00
--- /dev/null
@@ -0,0 +1,45 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+var assert = require('assert');
+var http = require('http');
+var net = require('net');
+
+var errors = 0;
+
+// Create a TCP server
+var server = net.createServer(function(socket) {
+  socket.end('Bad http\r\n\r\n'); // This should trigger the Parse Error.
+  server.close();
+});
+
+server.listen(3085, '127.0.0.1');
+
+// Create a simple get request.
+var request = http.request({
+  host: '127.0.0.1',
+  port: 3085,
+  method: 'GET',
+  path: '/'
+});
+request.on('error', function(err) {
+  errors++;
+});
+request.end();
+
+process.on('exit', function() {
+  // The first error is a Parse Error.
+  // The second error is the socket hang up.
+  assert.equal(errors, 2);
+});
diff --git a/test/run_pass/test_net_httpclient_timeout_1.js b/test/run_pass/test_net_httpclient_timeout_1.js
new file mode 100644 (file)
index 0000000..73551b9
--- /dev/null
@@ -0,0 +1,70 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var assert = require('assert');
+var http = require('http');
+var IncomingMessage = require('http_incoming').IncomingMessage;
+var OutgoingMessage = require('http_outgoing').OutgoingMessage;
+var net = require('net');
+
+var timeouted = false;
+
+var options = {
+  method: 'GET',
+  port: 3002
+};
+
+var incTimeout = 0;
+var outTimeout = 0;
+
+var socket = new net.Socket();
+var inc = new IncomingMessage(socket);
+inc.setTimeout(100, function() {
+  incTimeout++;
+});
+var out = new OutgoingMessage();
+out.setTimeout(100, function() {
+  outTimeout++;
+});
+out.emit('timeout');
+
+var server = http.createServer(function(req, res) {
+  // do nothing
+});
+
+server.listen(options.port, function() {
+  var req = http.request(options, function(res) {
+  });
+  req.on('close', function() {
+    server.close();
+  });
+  var destroyer = function() {
+    timeouted = true;
+    req.socket.destroy();
+  }
+  req.setTimeout(100, destroyer);
+  req.on('error', function(){});
+  req.end();
+});
+
+
+process.on('exit', function(code) {
+  assert.equal(code,0);
+  assert.equal(timeouted, true);
+  assert.equal(incTimeout, 1);
+  assert.equal(outTimeout, 1);
+});
diff --git a/test/run_pass/test_net_httpclient_timeout_2.js b/test/run_pass/test_net_httpclient_timeout_2.js
new file mode 100644 (file)
index 0000000..141197c
--- /dev/null
@@ -0,0 +1,63 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var assert = require('assert');
+var http = require('http');
+
+var timeouted = false;
+
+var options = {
+  method: 'GET',
+  port: 3004
+};
+
+var server = http.createServer(function(req, res) {
+  res.write(".");
+});
+
+
+server.listen(options.port, function() {
+  var req = http.request(options, function(res) {
+    var destroyer = function() {
+      timeouted = true;
+      req.socket.destroy();
+      server.close();
+    }
+
+    res.on('data', function() {
+      // after connection established
+      req.setTimeout(100, destroyer);
+    });
+  });
+
+  req.on('close', function() {
+    server.close();
+  });
+
+  var before = function(){
+    /* this handler must not be called  */
+  };
+  req.setTimeout(1000, before);
+
+  req.on('error', function(){});
+  req.end();
+});
+
+
+process.on('exit', function(code) {
+  assert.equal(timeouted, true);
+});
diff --git a/test/run_pass/test_net_httpserver.js b/test/run_pass/test_net_httpserver.js
new file mode 100644 (file)
index 0000000..912c9ec
--- /dev/null
@@ -0,0 +1,195 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var Server = require('http_server').Server;
+var http = require('http');
+
+
+var responseCheck = '';
+var connectionEvent = 0;
+var serverCloseEvent = 0;
+var requestEvent = 0;
+var responseEvent = 0;
+var socketEvent = 0;
+// server side code
+// server will return the received msg from client
+// and shutdown
+var server = http.createServer(function (req, res) {
+
+  var body = '';
+  var url = req.url;
+
+  req.on('data', function (chunk) {
+    body += chunk;
+  });
+
+  var endHandler = function () {
+
+    res.writeHead(200, { 'Connection' : 'close',
+                         'Content-Length' : body.length
+                       });
+    res.write(body);
+    res.end(function(){
+      if(body == 'close server') {
+        server.close();
+      }
+    });
+  };
+
+  req.on('end', endHandler);
+
+});
+
+server.on('request', function() {
+  requestEvent++;
+});
+
+server.on('connection', function() {
+  connectionEvent++;
+});
+
+server.on('close', function() {
+  serverCloseEvent++;
+});
+
+server.listen(3001, 3);
+
+
+// client side code
+// 1. send POST req to server and check response msg
+// 2. send GET req to server and check response msg
+// 3. send 'close server' msg
+
+// 1. POST req
+var msg = 'http request test msg';
+var options = {
+  method : 'POST',
+  port : 3001,
+  headers : {'Content-Length': msg.length}
+};
+
+
+var postResponseHandler = function (res) {
+  var res_body = '';
+
+  assert.equal(200, res.statusCode);
+  var endHandler = function(){
+    assert.equal(msg, res_body);
+    responseCheck += '1';
+  };
+  res.on('end', endHandler);
+
+  res.on('data', function(chunk){
+    res_body += chunk.toString();
+  });
+};
+
+var req = http.request(options, postResponseHandler);
+req.on('response', function() {
+  responseEvent++;
+});
+req.on('socket', function() {
+  socketEvent++;
+});
+req.write(msg);
+req.end();
+
+
+// 2. GET req
+options = {
+  method : 'GET',
+  port : 3001
+};
+
+var getResponseHandler = function (res) {
+  var res_body = '';
+
+  assert.equal(200, res.statusCode);
+
+  var endHandler = function(){
+    // GET msg, no received body
+    assert.equal('', res_body);
+    responseCheck += '2';
+  };
+  res.on('end', endHandler);
+
+  res.on('data', function(chunk){
+    res_body += chunk.toString();
+  });
+};
+
+
+var getReq = http.request(options, getResponseHandler);
+getReq.on('response', function() {
+  responseEvent++;
+});
+getReq.on('socket', function() {
+  socketEvent++;
+});
+getReq.end();
+
+
+
+// 3. close server req
+var finalMsg = 'close server';
+var finalOptions = {
+  method : 'POST',
+  port : 3001,
+  headers : {'Content-Length': finalMsg.length}
+};
+
+var finalResponseHandler = function (res) {
+  var res_body = '';
+
+  assert.equal(200, res.statusCode);
+
+  var endHandler = function(){
+    assert.equal(finalMsg, res_body);
+    responseCheck += '3';
+  };
+  res.on('end', endHandler);
+
+  res.on('data', function(chunk){
+    res_body += chunk.toString();
+  });
+};
+
+var finalReq = http.request(finalOptions, finalResponseHandler);
+finalReq.on('response', function() {
+  responseEvent++;
+});
+finalReq.on('socket', function() {
+  socketEvent++;
+});
+finalReq.write(finalMsg);
+finalReq.end();
+
+// Create server without requestListener.
+var server2 = http.createServer();
+
+// Create server instance without new keyword.
+var server3 = Server(function(request, response) {});
+
+process.on('exit', function() {
+  assert.equal(responseCheck.length, 3);
+  assert.equal(connectionEvent, 3);
+  assert.equal(serverCloseEvent, 1);
+  assert.equal(requestEvent, 3);
+  assert.equal(responseEvent, 3);
+  assert.equal(socketEvent, 3);
+  assert.equal(server2 instanceof Server, true);
+  assert.equal(server3 instanceof Server, true);
+});
diff --git a/test/run_pass/test_net_httpserver_timeout.js b/test/run_pass/test_net_httpserver_timeout.js
new file mode 100644 (file)
index 0000000..5139066
--- /dev/null
@@ -0,0 +1,49 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var assert = require('assert');
+var http = require('http');
+
+var timeouted = false;
+
+var server = http.createServer(function(req, res) {
+  // do nothing
+});
+
+server.listen(3003);
+
+server.setTimeout(100, function(socket) {
+  timeouted = true;
+  socket.destroy();
+  server.close();
+});
+
+
+// client will connect to server, and do nothing.
+var options = {
+  method : 'GET',
+  port : 3003
+};
+
+
+var getReq = http.request(options);
+getReq.on('error', function() {});
+
+process.on('exit', function(code) {
+  assert.equal(timeouted, true);
+  assert.equal(code, 0);
+});
diff --git a/test/run_pass/test_process.js b/test/run_pass/test_process.js
new file mode 100644 (file)
index 0000000..292f03a
--- /dev/null
@@ -0,0 +1,28 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+
+var sequence = '';
+
+process.nextTick(function() {
+  sequence += '2'
+});
+
+sequence = '1';
+
+process.on('exit', function() {
+  assert.equal(sequence, '12');
+});
diff --git a/test/run_pass/test_process_chdir.js b/test/run_pass/test_process_chdir.js
new file mode 100644 (file)
index 0000000..bd8b6f0
--- /dev/null
@@ -0,0 +1,27 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+var assert = require('assert');
+
+var currentPath = process.cwd();
+
+try {
+  process.chdir('/');
+} catch (err) {
+  console.log('invalid path');
+}
+
+assert.equal(process.cwd(), '/');
+
+process.chdir(currentPath);
diff --git a/test/run_pass/test_process_cwd.js b/test/run_pass/test_process_cwd.js
new file mode 100644 (file)
index 0000000..5d8cdad
--- /dev/null
@@ -0,0 +1,17 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+console.log(process.cwd());
diff --git a/test/run_pass/test_process_exit.js b/test/run_pass/test_process_exit.js
new file mode 100644 (file)
index 0000000..3f0adc6
--- /dev/null
@@ -0,0 +1,17 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+process.exit(0);
diff --git a/test/run_pass/test_process_experimental_off.js b/test/run_pass/test_process_experimental_off.js
new file mode 100644 (file)
index 0000000..43fa20e
--- /dev/null
@@ -0,0 +1,18 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+
+assert.notEqual(process.env.IOTJS_ENV, 'experimental');
diff --git a/test/run_pass/test_process_experimental_on.js b/test/run_pass/test_process_experimental_on.js
new file mode 100644 (file)
index 0000000..5218fed
--- /dev/null
@@ -0,0 +1,18 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+
+assert.equal(process.env.IOTJS_ENV, 'experimental');
diff --git a/test/run_pass/test_process_next_tick.js b/test/run_pass/test_process_next_tick.js
new file mode 100644 (file)
index 0000000..279de36
--- /dev/null
@@ -0,0 +1,41 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+
+
+var tickTrace = "";
+
+process.nextTick(function() {
+  tickTrace += "1";
+  process.nextTick(function() {
+    tickTrace += "2";
+    process.nextTick(function() {
+      tickTrace += "3";
+      process.nextTick(function() {
+        tickTrace += "4";
+        process.nextTick(function() {
+          tickTrace += "5";
+        });
+      });
+    });
+  });
+});
+
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+  assert.equal(tickTrace, "12345");
+});
diff --git a/test/run_pass/test_process_readsource.js b/test/run_pass/test_process_readsource.js
new file mode 100644 (file)
index 0000000..a582d44
--- /dev/null
@@ -0,0 +1,27 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+
+var json_file = process.cwd() + "/resources/process/package.json";
+
+// Load a JSON file.
+var str = process.readSource(json_file);
+var json = JSON.parse(str);
+
+assert.equal(json.version, "2.9.1");
+assert.equal(json.name, "npm");
+assert.equal(json.main, "./lib/npm.js");
+assert.equal(json.repository.type, "git");
diff --git a/test/run_pass/test_process_uncaught_order.js b/test/run_pass/test_process_uncaught_order.js
new file mode 100644 (file)
index 0000000..48d5877
--- /dev/null
@@ -0,0 +1,41 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var assert = require('assert');
+
+var trace = '';
+
+process.on('uncaughtException', function (err) {
+  trace += 'A';
+});
+
+process.on('uncaughtException', function (err) {
+  trace += 'B';
+});
+
+process.on('exit', function() {
+  trace += 'C';
+  process.removeAllListeners('uncaughtException');
+  assert.equal(trace, 'ABABC');
+});
+
+
+process.nextTick(function() {
+  assert.fail();
+});
+
+assert.fail();
diff --git a/test/run_pass/test_process_uncaught_simple.js b/test/run_pass/test_process_uncaught_simple.js
new file mode 100644 (file)
index 0000000..84180bd
--- /dev/null
@@ -0,0 +1,37 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+
+var assert = require('assert');
+
+var trace = '';
+
+process.on('uncaughtException', function (err) {
+  trace += 'A';
+});
+
+process.on('exit', function() {
+  process.removeAllListeners('uncaughtException');
+  assert.equal(trace, 'AB');
+});
+
+setTimeout(function() {
+  trace += 'B'
+}, 500);
+
+nonexistentFunc();
+
+trace += 'C';
diff --git a/test/run_pass/test_pwm.js b/test/run_pass/test_pwm.js
new file mode 100644 (file)
index 0000000..fba7ae0
--- /dev/null
@@ -0,0 +1,129 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+var Pwm = require('pwm');
+
+var pwm = new Pwm();
+
+var configuration = {
+  period: 0.001  // 1kHz
+};
+
+if (process.platform === 'linux') {
+  configuration.pin = 0;
+} else if (process.platform === 'nuttx') {
+  configuration.pin = require('stm32f4dis').pin.PWM1.CH1_1;
+} else if (process.platform === 'tizenrt') {
+  configuration.pin = 0;
+} else {
+  assert.fail();
+}
+
+var periodOptions = {
+  dutyCycle: 0.5,
+  // The platform PWM is tested on (artik10/tizen 3.0) has an upper limit
+  // of 75.2 Hz of PWM0 frequency.
+  //values: [0.2, 0.4, 0.6, 0.8, 1]
+  values: [ 0.5 ]
+};
+
+var dutyOptions = {
+  period: 0.5,
+  values: [ 0, 0.1, 0.5, 0.9, 1 ]
+};
+
+var testCb = function (err) {
+  if (err) {
+    assert.fail();
+  }
+};
+
+var pwm0;
+testPeriods();
+
+function testPeriods() {
+  pwm0 = pwm.open(configuration, function (err) {
+    console.log('PWM initialized');
+
+    if (err) {
+      console.log('Have an error: ' + err.message);
+      assert.fail();
+    }
+
+    pwm0.setEnable(1, function(err) {
+      testCb(err);
+
+      var options = periodOptions;
+      console.log('PWM: period test start ');
+      var idx = 0;
+      var period = options.values[idx++];
+      console.log("Period(%d)", period);
+      pwm0.setFrequencySync(1.0 / period);
+      pwm0.setDutyCycleSync(options.dutyCycle);
+
+      var loop = setInterval(function () {
+        if (idx == options.values.length) {
+          clearInterval(loop);
+          console.log('PWM period test complete');
+          pwm0.setPeriodSync(options.values[0]);
+          pwm0.setEnableSync(0);
+          pwm0.closeSync();
+          testDutyCycles();
+        } else {
+          period = options.values[idx++];
+          console.log("Period(%d)", period);
+          pwm0.setPeriod(period, testCb);
+        }
+      }, 1000);
+    });
+  });
+}
+
+function testDutyCycles() {
+  var options = dutyOptions;
+
+  console.log('PWM: duty cycle test start');
+  pwm0 = pwm.open(configuration, function (err) {
+    console.log('PWM initialized');
+
+    if (err) {
+      console.log('Have an error: ' + err.message);
+      assert.fail();
+    }
+
+    pwm0.setPeriod(options.period, function(err) {
+      testCb(err);
+
+      pwm0.setEnableSync(1, testCb);
+      pwm0.setFrequency(1.0 / options.period, function(err) {
+        testCb(err);
+        var idx = 0;
+        var loop = setInterval(function () {
+          console.log('Duty cycle %d', options.values[idx]);
+          pwm0.setDutyCycle(options.values[idx], testCb);
+
+          if (++idx == options.values.length) {
+            clearInterval(loop);
+            pwm0.setEnableSync(0);
+            pwm0.close(testCb.bind(err));
+            console.log('PWM duty cycle test complete');
+          }
+        }, 1000);
+      });
+    });
+  });
+}
diff --git a/test/run_pass/test_spi_buffer.js b/test/run_pass/test_spi_buffer.js
new file mode 100644 (file)
index 0000000..83bdc5e
--- /dev/null
@@ -0,0 +1,60 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var Spi = require('spi');
+
+var spi = new Spi();
+
+var configuration = {};
+
+if (process.platform === 'linux') {
+  configuration.device = '/dev/spidev0.0';
+} else if (process.platform === 'nuttx') {
+  configuration.bus = 1;
+} else {
+  assert.fail();
+}
+
+// Buffer test
+var spi1 = spi.open(configuration, function() {
+  var data = 'Hello IoTjs';
+  var tx = new Buffer(data);
+  var rx = new Buffer(11);
+
+  this.transferSync(tx, rx);
+  var value = '';
+  for (var i = 0; i < 11; i++) {
+    value += String.fromCharCode(rx[i]);
+  }
+  console.log(value);
+  assert.equal(value, data);
+
+  setTimeout(function() {
+    spi1.transfer(tx, rx, function(err) {
+      assert.equal(err, null);
+      assert.equal(rx.length, 11);
+
+      var value = '';
+      for (var i = 0; i < 11; i++) {
+        value += String.fromCharCode(rx[i]);
+      }
+      console.log(value);
+      assert.equal(value, data);
+
+      spi1.close();
+    });
+  }, 500);
+});
diff --git a/test/run_pass/test_spi_mcp3008.js b/test/run_pass/test_spi_mcp3008.js
new file mode 100644 (file)
index 0000000..7f02099
--- /dev/null
@@ -0,0 +1,58 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var Spi = require('spi');
+
+var spi = new Spi();
+
+var configuration = {};
+
+if (process.platform === 'linux') {
+  configuration.device = '/dev/spidev0.0';
+} else if (process.platform === 'nuttx') {
+  configuration.bus = 1;
+} else {
+  assert.fail();
+}
+
+//  mcp3008 test
+var channel = 0;
+var spi0 = spi.open(configuration, function() {
+  var mode = (8 + channel) << 4;
+  var tx = [1, mode, 0];
+  var rx = [0, 0, 0];
+
+  spi0.transferSync(tx, rx);
+  console.log(((rx[1] & 0x03) << 8) + rx[2]);
+
+  var loopCnt = 10;
+  var loop = setInterval(function() {
+    spi0.transfer(tx, rx, function(err) {
+      assert.equal(err, null);
+      assert.equal(rx.length, 3);
+
+      var value = ((rx[1] & 0x03) << 8) + rx[2];
+      console.log(value);
+
+      if (--loopCnt < 0) {
+        spi0.closeSync();
+        clearInterval(loop);
+        console.log('finish test');
+      }
+
+    });
+  }, 500);
+});
diff --git a/test/run_pass/test_stream.js b/test/run_pass/test_stream.js
new file mode 100644 (file)
index 0000000..f3450c9
--- /dev/null
@@ -0,0 +1,165 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var Readable = require('stream').Readable;
+var assert = require('assert');
+
+
+var readable1 = new Readable();
+var d = "";
+var e = "";
+
+
+readable1.on('error', function(err) {
+  e += ".";
+});
+
+readable1.on('data', function(data) {
+  d += data.toString();
+});
+
+readable1.on('end', function() {
+  e += 'e';
+});
+
+
+readable1.pause();
+readable1.push('abcde');
+readable1.push('12345');
+assert.equal(d, '');
+assert.equal(e, '');
+
+readable1.resume();
+assert.equal(d, 'abcde12345');
+assert.equal(e, '');
+
+readable1.push('a');
+readable1.push('1');
+readable1.push('b');
+readable1.push('2');
+assert.equal(d, 'abcde12345a1b2');
+assert.equal(e, '');
+
+assert.equal(readable1.isPaused(), false);
+readable1.pause();
+assert.equal(d, 'abcde12345a1b2');
+assert.equal(e, '');
+assert.equal(readable1.isPaused(), true);
+
+// Pause the readable again. This should do nothing.
+readable1.pause();
+assert.equal(readable1.isPaused(), true);
+
+readable1.push('c');
+readable1.push('3');
+readable1.push('d');
+readable1.push('4');
+assert.equal(d, 'abcde12345a1b2');
+assert.equal(e, '');
+
+readable1.resume();
+assert.equal(d, 'abcde12345a1b2c3d4');
+assert.equal(e, '');
+
+readable1.push(null);
+assert.equal(d, 'abcde12345a1b2c3d4');
+assert.equal(e, 'e');
+
+readable1.push('push after eof');
+assert.equal(d, 'abcde12345a1b2c3d4');
+assert.equal(e, 'e.');
+
+
+// Create a readable stream without the new keyword.
+var readable2 = Readable({encoding: 'utf8'});
+
+// Push an invalid chunk into it.
+assert.throws(function() {
+  readable2.push(undefined);
+}, TypeError);
+
+assert.throws(function() {
+  readable2.push(5001);
+}, TypeError);
+
+assert.throws(function() {
+  readable2.push(5001.5);
+}, TypeError);
+
+assert.throws(function() {
+  readable2.push([]);
+}, TypeError);
+
+assert.throws(function() {
+  readable2.push([5001, 'string']);
+}, TypeError);
+
+assert.throws(function() {
+  readable2.push({});
+}, TypeError);
+
+assert.throws(function() {
+  readable2.push({obj: 'string', second: 5001});
+}, TypeError);
+
+// Read with irregular parameters from an empty stream.
+assert.equal(readable2.read(-2), null);
+assert.equal(readable2.read(0), null);
+
+readable2.push('qwerty');
+assert.equal(readable2.read(6), 'qwerty');
+
+// Throw not implemented Error when we trying to read less length data.
+readable2.push('new-data');
+assert.throws(function() {
+  readable2.read(1);
+}, Error);
+
+var readable3 = new Readable();
+var readable3End = false;
+var paused = false;
+var str = 'test';
+
+readable3.on('data', function(data) {
+  assert.equal(paused, true);
+  assert.equal(data, str);
+});
+
+readable3.on('end', function() {
+  readable3End = true;
+});
+
+readable3.pause();
+readable3.push(str);
+readable3.push(null);
+
+setTimeout(function() {
+  paused = true;
+  readable3.resume();
+}, 1000);
+
+// End on non-EOF stream
+var readable4 = new Readable();
+readable4.length = 10;
+assert.throws(function() {
+  readable4.push(null);
+}, Error);
+
+
+process.on('exit', function() {
+  assert.equal(readable2 instanceof Readable, true);
+  assert.equal(readable3End, true);
+});
diff --git a/test/run_pass/test_stream_duplex.js b/test/run_pass/test_stream_duplex.js
new file mode 100644 (file)
index 0000000..a501f14
--- /dev/null
@@ -0,0 +1,38 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var Duplex = require('stream').Duplex;
+
+var duplex = Duplex({ highWaterMark: 0 });
+
+assert(duplex instanceof Duplex);
+assert(duplex.write);
+assert(duplex.read);
+
+var msg1 = 'message 1';
+var msg2 = 'message 2';
+
+duplex._write = function(chunk, callback) {
+  assert.equal(chunk == msg1, true);
+  duplex.push(msg2);
+  duplex.end();
+}
+duplex._readyToWrite();
+duplex.write(msg1);
+
+process.on('exit', function() {
+  assert.equal(duplex.read() == msg2, true);
+});
diff --git a/test/run_pass/test_timers_arguments.js b/test/run_pass/test_timers_arguments.js
new file mode 100644 (file)
index 0000000..587f57c
--- /dev/null
@@ -0,0 +1,61 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+var util = require('util');
+
+
+var timerFired = false;
+var shouldnotFired = false;
+
+setTimeout(function(a, b, c) {
+  assert.equal(arguments.length, 3);
+  assert.equal(arguments[0], 1);
+  assert.equal(arguments[1], 2);
+  assert.equal(arguments[2], 3);
+  assert.equal(a, 1);
+  assert.equal(b, 2);
+  assert.equal(c, 3);
+  timerFired = true;
+}, 100, 1, 2, 3);
+
+
+var i = 0;
+setInterval(function(list) {
+  assert.equal(arguments.length, 1);
+  assert(util.isArray(list));
+  assert.equal(list.length, 5);
+  if (i >= list.length) {
+    clearInterval(this);
+  } else {
+    assert.equal(list[i], i * i);
+    i++;
+  }
+}, 100, [0, 1, 4, 9, 16]);
+
+
+var t = setTimeout(function() {
+  shouldnotFired = true;
+}, 100);
+clearTimeout(t);
+
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+  assert(timerFired);
+  assert.equal(i, 5);
+  assert.equal(shouldnotFired, false);
+});
diff --git a/test/run_pass/test_timers_error.js b/test/run_pass/test_timers_error.js
new file mode 100644 (file)
index 0000000..df09613
--- /dev/null
@@ -0,0 +1,132 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+
+// Timeout without callback function.
+assert.throws(function() {
+  setTimeout(1000);
+}, TypeError);
+
+// Timeout with invalid callback function parameter.
+assert.throws(function() {
+  setTimeout({function: null}, 1000);
+}, TypeError);
+
+assert.throws(function() {
+  setTimeout({function: null, value: function() {}}, 1000);
+}, TypeError);
+
+assert.throws(function() {
+  setTimeout(null, 1000);
+}, TypeError);
+
+assert.throws(function() {
+  setTimeout(undefined, 1000);
+}, TypeError);
+
+assert.throws(function() {
+  setTimeout([10, 100, 1000], 1000);
+}, TypeError);
+
+assert.throws(function() {
+  setTimeout('callback', 1000);
+}, TypeError);
+
+// ClearTimeout without timeout parameter.
+assert.doesNotThrow(function() {
+  clearTimeout();
+});
+
+assert.throws(function() {
+  clearTimeout('timeout');
+}, Error);
+
+assert.throws(function() {
+  clearTimeout(1000);
+}, Error);
+
+assert.doesNotThrow(function() {
+  clearTimeout(null);
+});
+
+assert.doesNotThrow(function() {
+  clearTimeout(undefined);
+});
+
+assert.throws(function() {
+  clearTimeout({timeout: 1000});
+}, Error);
+
+// SetInterval without callback function.
+assert.throws(function() {
+  setInterval(10);
+}, TypeError);
+
+// SetInterval with invalid callback function parameter.
+assert.throws(function() {
+  setInterval(1000, 10);
+}, TypeError);
+
+assert.throws(function() {
+  setInterval('callback', 10);
+}, TypeError);
+
+assert.throws(function() {
+  setInterval({function: null, value: function() {}}, 10);
+}, TypeError);
+
+assert.throws(function() {
+  setInterval(null, 10);
+}, TypeError);
+
+assert.throws(function() {
+  setInterval(undefined, 10);
+}, TypeError);
+
+assert.throws(function() {
+  setInterval([10, 100, 1000], 10);
+}, TypeError);
+
+// ClearInterval without interval parameter.
+assert.doesNotThrow(function() {
+  clearInterval();
+});
+
+// ClearInterval with invalid interval parameter.
+assert.doesNotThrow(function() {
+  clearInterval(null);
+});
+
+assert.doesNotThrow(function() {
+  clearInterval(undefined);
+});
+
+assert.throws(function() {
+  clearInterval('interval');
+}, Error);
+
+assert.throws(function() {
+  clearInterval(1000);
+}, Error);
+
+assert.throws(function() {
+  clearInterval([interval, 1000]);
+}, Error);
+
+assert.throws(function() {
+  clearInterval({interval: function() {}, value: 1000});
+}, Error);
diff --git a/test/run_pass/test_timers_simple.js b/test/run_pass/test_timers_simple.js
new file mode 100644 (file)
index 0000000..ae5fe07
--- /dev/null
@@ -0,0 +1,52 @@
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+
+var assert = require('assert');
+
+
+var timerACnt = 0;
+var timerBCnt = 0;
+var timerCCnt = 0;
+var timerSequence = '';
+
+var timerA = setTimeout(function() {
+  timerSequence += 'A';
+  timerACnt++;
+}, 1000);
+
+var timerB = setInterval(function() {
+  timerSequence += 'B';
+  timerBCnt++;
+  if (timerBCnt > 5) {
+    clearInterval(timerB);
+  }
+}, 300);
+
+var timerC = setInterval(function() {
+  timerSequence += 'C';
+  timerCCnt++;
+  if (timerCCnt > 10) {
+    clearInterval(timerC);
+  }
+}, 0);
+
+process.on('exit', function(code) {
+  assert.equal(code, 0);
+  assert.equal(timerACnt, 1);
+  assert.equal(timerBCnt, 6);
+  assert.equal(timerCCnt, 11);
+  assert.equal(timerSequence.length, 18);
+});
diff --git a/test/run_pass/test_uart.js b/test/run_pass/test_uart.js
new file mode 100644 (file)
index 0000000..c3ba71e
--- /dev/null
@@ -0,0 +1,80 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var assert = require('assert');
+var Uart = require('uart');
+
+var uart = new Uart();
+
+var configuration = {
+  baudRate: 115200,
+  dataBits: 8
+};
+
+if (process.platform === 'linux') {
+  configuration.device = '/dev/ttyS0';
+} else if (process.platform === 'nuttx') {
+  configuration.device = '/dev/ttyS1';
+} else if (process.platform === 'tizenrt') {
+  configuration.device = '/dev/ttyDBG';
+} else {
+  assert.fail();
+}
+
+writeTest();
+
+function writeTest() {
+  var serial = uart.open(configuration, function(err) {
+    assert.equal(err, null);
+    console.log('open done');
+
+    serial.writeSync("Hello IoT.js.\n\r");
+    serial.closeSync();
+    console.log('close done');
+    writeReadTest();
+  });
+}
+
+function writeReadTest() {
+  var read = 0;
+  var write = 0;
+
+  var serial = uart.open(configuration, function(err) {
+    assert.equal(err, null);
+    console.log('open done');
+
+    serial.on('data', function(data) {
+      console.log('read result: ' + data.toString());
+      read = 1;
+
+      if (read && write) {
+        serial.close();
+        console.log('close done');
+      }
+    });
+
+    serial.write("Hello there?\n\r", function(err) {
+      assert.equal(err, null);
+      console.log('write done');
+      write = 1;
+
+      if (read && write) {
+        serial.close();
+        console.log('close done');
+      }
+    });
+  });
+}
+
diff --git a/test/run_pass/test_util.js b/test/run_pass/test_util.js
new file mode 100644 (file)
index 0000000..0a34452
--- /dev/null
@@ -0,0 +1,189 @@
+/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var util = require('util');
+var assert = require('assert');
+
+assert.equal(util.isNull(null), true);
+assert.equal(util.isNull(0), false);
+assert.equal(util.isNull('null'), false);
+
+
+assert.equal(util.isUndefined(undefined), true);
+assert.equal(util.isUndefined(0), false);
+assert.equal(util.isUndefined('undefined'), false);
+
+
+assert.equal(util.isNumber(0), true);
+assert.equal(util.isNumber(5001), true);
+assert.equal(util.isNumber(3.14), true);
+assert.equal(util.isNumber(-5001), true);
+assert.equal(util.isNumber('5000'), false);
+assert.equal(util.isNumber(null), false);
+assert.equal(util.isNumber([0,1,2,3,4,5]), false);
+
+
+assert.equal(util.isFinite(5001), true);
+assert.equal(util.isFinite(-5001), true);
+assert.equal(util.isFinite(3.14), true);
+assert.equal(util.isFinite(-3.14), true);
+assert.equal(util.isFinite(0), true);
+assert.equal(util.isFinite(Infinity), false);
+
+
+assert.equal(util.isBoolean(true), true);
+assert.equal(util.isBoolean(false), true);
+assert.equal(util.isBoolean(Boolean(5001)), true);
+assert.equal(util.isBoolean(Boolean(0)), true);
+assert.equal(util.isBoolean(Boolean(-5001)), true);
+assert.equal(util.isBoolean(Boolean('Hello IoT.js')), true);
+
+
+assert.equal(util.isString('Hello IoT.js'), true);
+assert.equal(util.isString(['Hello IoT.js']), false);
+assert.equal(util.isString(-5001), false);
+assert.equal(util.isString(5001), false);
+assert.equal(util.isString(null), false);
+
+
+var object = {
+  value1: 0,
+  value2: 5001,
+  value3: -5001,
+  value4: 3.14,
+  value5: 'Hello IoT.js'
+};
+assert.equal(util.isObject(object), true);
+assert.equal(util.isObject({obj: 5001}), true);
+assert.equal(util.isObject({obj: object}), true);
+assert.equal(util.isObject({}), true);
+assert.equal(util.isObject([5001]), true);
+assert.equal(util.isObject(['Hello IoT.js']), true);
+assert.equal(util.isObject(null), false);
+assert.equal(util.isObject(5001), false);
+assert.equal(util.isObject('Hello IoT.js'), false);
+
+
+var func1 = function() {};
+assert.equal(util.isFunction(func1), true);
+assert.equal(util.isFunction(function(arg) {/*do nothing*/}), true);
+assert.equal(util.isFunction(null), false);
+assert.equal(util.isFunction(5001), false);
+assert.equal(util.isFunction([5001]), false);
+assert.equal(util.isFunction([func1]), false);
+assert.equal(util.isFunction({}), false);
+assert.equal(util.isFunction('Hello IoT.js'), false);
+
+
+var buff = new Buffer('Hello IoT.js');
+assert.equal(util.isBuffer(buff), true);
+assert.equal(util.isBuffer(new Buffer(5001)), true);
+assert.equal(util.isBuffer(5001), false);
+assert.equal(util.isBuffer({}), false);
+assert.equal(util.isBuffer('5001'), false);
+assert.equal(util.isBuffer([5001]), false);
+assert.equal(util.isBuffer([buff]), false);
+assert.equal(util.isBuffer({obj: buff}), false);
+
+
+function Parent() {}
+function Child() {}
+util.inherits(Child, Parent);
+var child = new Child();
+assert.equal(child instanceof Parent, true);
+assert.equal(child instanceof Buffer, false);
+
+
+assert.equal(util.format(), '');
+assert.equal(util.format(''), '');
+assert.equal(util.format(null), 'null');
+assert.equal(util.format(true), 'true');
+assert.equal(util.format(false), 'false');
+assert.equal(util.format('Hello IoT.js'), 'Hello IoT.js');
+assert.equal(util.format(5001), '5001');
+
+assert.equal(util.format('%d', 5001.5), '5001.5');
+assert.equal(util.format('Hello IoT.js - %d', 5001), 'Hello IoT.js - 5001');
+assert.equal(
+  util.format('%s IoT.js - %d', 'Hello', 5001),
+  'Hello IoT.js - 5001'
+);
+assert.equal(util.format('%d%%', 5001), '5001%');
+
+var json = {
+  "first":"1st",
+  "second":"2nd"
+};
+assert.equal(
+  util.format('%s: %j', 'Object', json),
+  'Object: {"first":"1st","second":"2nd"}'
+);
+assert.equal(
+  util.format('%d-%j-%s', 5001, json, 'IoT.js', 'end'),
+  '5001-{"first":"1st","second":"2nd"}-IoT.js end'
+);
+json.json = json;
+assert.equal(util.format('%j', json), '[Circular]');
+
+assert.equal(util.format('%s', '5001'), '5001');
+assert.equal(util.format('%j', '5001'), '"5001"');
+assert.equal(util.format('%d%d', 5001), '5001%d');
+assert.equal(util.format('%s%d%s%d', 'IoT.js ', 5001), 'IoT.js 5001%s%d');
+assert.equal(util.format('%d%% %s', 100, 'IoT.js'), '100% IoT.js');
+assert.equal(util.format(new Error('format')), 'Error: format');
+
+var err1 = util.errnoException(3008, 'syscall', 'original message');
+assert.equal(err1 instanceof Error, true);
+assert.equal(err1, 'Error: syscall error original message');
+assert.equal(err1.code, 'error');
+assert.equal(err1.errno, 'error');
+assert.equal(err1.syscall, 'syscall');
+
+var err2 = util.errnoException(1, 'getSyscall');
+assert.equal(err2 instanceof Error, true);
+assert.equal(err2, 'Error: getSyscall error');
+assert.equal(err2.code, 'error');
+assert.equal(err2.errno, 'error');
+assert.equal(err2.syscall, 'getSyscall');
+
+
+var err3 = util.exceptionWithHostPort(1,
+                                      'syscall',
+                                      '127.0.0.1',
+                                      5001,
+                                      'additional info');
+assert.equal(err3 instanceof Error, true);
+assert.equal(
+  err3,
+  'Error: syscall error 127.0.0.1:5001 - Local (additional info)'
+);
+assert.equal(err3.code, 'error');
+assert.equal(err3.errno, 'error');
+assert.equal(err3.syscall, 'syscall');
+assert.equal(err3.address, '127.0.0.1');
+assert.equal(err3.port, 5001);
+
+var err4 = util.exceptionWithHostPort(3008,
+                                      'getSyscall',
+                                      '127.0.0.1');
+assert.equal(err4 instanceof Error, true);
+assert.equal(
+  err4,
+  'Error: getSyscall error 127.0.0.1'
+);
+assert.equal(err4.code, 'error');
+assert.equal(err4.errno, 'error');
+assert.equal(err4.syscall, 'getSyscall');
+assert.equal(err4.address, '127.0.0.1');
diff --git a/test/testsets.json b/test/testsets.json
new file mode 100644 (file)
index 0000000..e9b64c9
--- /dev/null
@@ -0,0 +1,131 @@
+{
+  "run_pass":  [
+    { "name": "test_adc.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_assert.js" },
+    { "name": "test_ble_advertisement.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_ble_setservices.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_ble_setservices_central.js", "skip": ["all"], "reason": "run it with nodejs after running test_ble_setservices.js" },
+    { "name": "test_buffer_builtin.js" },
+    { "name": "test_buffer.js" },
+    { "name": "test_console.js" },
+    { "name": "test_dgram_1_server_1_client.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_dgram_1_server_n_clients.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_dgram_address.js", "skip": ["all"], "reason": "need to setup test environment"  },
+    { "name": "test_dgram_broadcast.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_dgram_multicast_membership.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_dgram_multicast_set_multicast_loop.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_dgram_setttl_client.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_dgram_setttl_server.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_dns.js" },
+    { "name": "test_dns_lookup.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_events.js" },
+    { "name": "test_events_assert_emit_error.js", "uncaught": true },
+    { "name": "test_events_uncaught_error.js", "uncaught": true },
+    { "name": "test_fs_exists.js" },
+    { "name": "test_fs_exists_sync.js" },
+    { "name": "test_fs_fstat.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_fs_fstat_sync.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_fs_mkdir_rmdir.js", "skip": ["nuttx"], "reason": "implemented, run manually in default configuration" },
+    { "name": "test_fs_open_close.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_fs_readdir.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_fs_readfile.js" },
+    { "name": "test_fs_readfile_sync.js" },
+    { "name": "test_fs_rename.js" },
+    { "name": "test_fs_rename_sync.js" },
+    { "name": "test_fs_stat.js" },
+    { "name": "test_fs_write.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_fs_writefile.js" },
+    { "name": "test_fs_writefile_sync.js" },
+    { "name": "test_fs_writefile_unlink.js" },
+    { "name": "test_fs_writefile_unlink_sync.js" },
+    { "name": "test_fs_event.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_fs_open_read.js" },
+    { "name": "test_fs_open_read_sync_1.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_fs_open_read_sync_2.js" },
+    { "name": "test_fs_open_read_sync_3.js" },
+    { "name": "test_gpio_input.js", "skip": ["all"], "reason": "needs hardware" },
+    { "name": "test_gpio_output.js", "skip": ["all"], "reason": "need user input"},
+    { "name": "test_https_get.js", "timeout": 40, "skip": ["all"], "reason": "Only tizen support https, and on tizen we test manually" },
+    { "name": "test_https_request_response.js", "timeout": 40, "skip": ["all"], "reason": "Only tizen support https, and on tizen we test manually" },
+    { "name": "test_https_timeout.js", "timeout": 40, "skip": ["all"], "reason": "Only tizen support https, and on tizen we test manually" },
+    { "name": "test_i2c.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_iotjs_promise.js", "skip": ["all"], "reason": "es2015 is off by default" },
+    { "name": "test_module_cache.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_module_require.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_net_1.js" },
+    { "name": "test_net_2.js" },
+    { "name": "test_net_3.js", "timeout": 100, "skip": ["nuttx"], "reason": "requires too many socket descriptors and too large buffers" },
+    { "name": "test_net_4.js" },
+    { "name": "test_net_5.js" },
+    { "name": "test_net_6.js" },
+    { "name": "test_net_7.js", "skip": ["nuttx"], "reason": "requires too many socket descriptors" },
+    { "name": "test_net_8.js" },
+    { "name": "test_net_9.js" },
+    { "name": "test_net_10.js" },
+    { "name": "test_net_connect.js", "timeout": 10 },
+    { "name": "test_net_headers.js" },
+    { "name": "test_net_http_get.js", "timeout": 20 },
+    { "name": "test_net_http_response_twice.js", "timeout": 10 },
+    { "name": "test_net_http_request_response.js", "timeout": 10, "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_net_http_status_codes.js", "timeout": 20, "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_net_httpclient_error.js", "timeout": 10, "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_net_httpclient_parse_error.js", "timeout": 10 },
+    { "name": "test_net_httpclient_timeout_1.js", "timeout": 10 },
+    { "name": "test_net_httpclient_timeout_2.js", "timeout": 15 },
+    { "name": "test_net_httpserver_timeout.js", "timeout": 10 },
+    { "name": "test_net_httpserver.js", "timeout": 20, "skip": ["nuttx"], "reason": "not implemented for nuttx" },
+    { "name": "test_process.js" },
+    { "name": "test_process_chdir.js" },
+    { "name": "test_process_cwd.js" },
+    { "name": "test_process_exit.js" },
+    { "name": "test_process_experimental_off.js", "skip": ["experimental"], "reason": "needed if testing stablity is set with stable" },
+    { "name": "test_process_experimental_on.js", "skip": ["stable"], "reason": "needed if testing stablity is set with experimental" },
+    { "name": "test_process_next_tick.js" },
+    { "name": "test_process_readsource.js" },
+    { "name": "test_process_uncaught_order.js", "uncaught": true },
+    { "name": "test_process_uncaught_simple.js", "uncaught": true },
+    { "name": "test_pwm.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_spi.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_stream.js" },
+    { "name": "test_stream_duplex.js"},
+    { "name": "test_timers_arguments.js" },
+    { "name": "test_timers_error.js" },
+    { "name": "test_timers_simple.js", "timeout": 10 },
+    { "name": "test_uart.js", "skip": ["all"], "reason": "need to setup test environment" },
+    { "name": "test_util.js" }
+  ],
+  "run_pass/issue": [
+    { "name": "issue-133.js" },
+    { "name": "issue-137.js" },
+    { "name": "issue-198.js" },
+    { "name": "issue-223.js" },
+    { "name": "issue-266.js" },
+    { "name": "issue-323.js" },
+    { "name": "issue-816.js" },
+    { "name": "issue-1046.js" }
+  ],
+  "run_fail":  [
+    { "name": "test_assert_equal.js", "expected-failure": true },
+    { "name": "test_assert_fail.js", "expected-failure": true },
+    { "name": "test_assert_notequal.js", "expected-failure": true },
+    { "name": "test_events_emit_error.js", "expected-failure": true },
+    { "name": "test_fs_callbacks_called.js", "expected-failure": true },
+    { "name": "test_iotjs_runtime_error.js", "expected-failure": true },
+    { "name": "test_iotjs_syntax_error.js", "expected-failure": true },
+    { "name": "test_module_require_invalid_file.js", "expected-failure": true },
+    { "name": "test_process_exitcode_arg.js", "expected-failure": true },
+    { "name": "test_process_exitcode_var.js", "expected-failure": true },
+    { "name": "test_process_explicit_exit.js", "expected-failure": true },
+    { "name": "test_process_implicit_exit.js", "expected-failure": true }
+  ],
+  "node/parallel": [
+    { "name": "test-assert.js" },
+    { "name": "test-http-catch-uncaughtexception.js" },
+    { "name": "test-http-status-message.js" },
+    { "name": "test-http-write-head.js" },
+    { "name": "test-net-bind-twice.js" },
+    { "name": "test-net-end-without-connect.js" },
+    { "name": "test-net-keepalive.js" },
+    { "name": "test-timers-clear-null-does-not-throw-error.js" }
+  ]
+}
diff --git a/tools/__init__.py b/tools/__init__.py
new file mode 100644 (file)
index 0000000..ef65bee
--- /dev/null
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/tools/apt-get-install-arm.sh b/tools/apt-get-install-arm.sh
new file mode 100755 (executable)
index 0000000..e6c6d59
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+sudo apt-get update -q
+sudo apt-get install -q -y \
+    gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
diff --git a/tools/apt-get-install-deps.sh b/tools/apt-get-install-deps.sh
new file mode 100755 (executable)
index 0000000..e7045d7
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+sudo apt-get update -q
+sudo apt-get install -q -y \
+    cmake gcc valgrind clang-format-3.8
diff --git a/tools/apt-get-install-nuttx.sh b/tools/apt-get-install-nuttx.sh
new file mode 100755 (executable)
index 0000000..012d01f
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+sudo apt-get update -q
+sudo apt-get install -q -y \
+    autoconf libtool gperf flex bison autoconf2.13 \
+    cmake libncurses-dev libusb-1.0-0-dev \
+    libsgutils2-dev gcc-arm-none-eabi
diff --git a/tools/apt-get-install-tizen.sh b/tools/apt-get-install-tizen.sh
new file mode 100755 (executable)
index 0000000..cb6d460
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+wget https://releases.linaro.org/components/\
+toolchain/binaries/4.9-2017.01/arm-linux-gnueabi/\
+gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz
+tar Jxf gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz
+mv gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi arm-linux-gnueabi
+export PATH=$(pwd)/arm-linux-gnueabi/bin:$PATH
+arm-linux-gnueabi-gcc --version
diff --git a/tools/apt-get-install-tizenrt.sh b/tools/apt-get-install-tizenrt.sh
new file mode 100755 (executable)
index 0000000..1abf8d0
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+
+sudo apt-get update
+sudo apt-get install gcc-arm-none-eabi
+arm-none-eabi-gcc --version
diff --git a/tools/apt-get-install-travis-i686.sh b/tools/apt-get-install-travis-i686.sh
new file mode 100755 (executable)
index 0000000..2dd6931
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+sudo dpkg --add-architecture i386
+sudo apt-get update -q
+sudo apt-get install -q -y \
+    linux-libc-dev:i386
diff --git a/tools/brew-install-deps.sh b/tools/brew-install-deps.sh
new file mode 100755 (executable)
index 0000000..7f4e9af
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+brew update
+
+PKGS="
+    cmake
+    "
+
+for pkg in $PKGS
+do
+    if ! ( brew list -1 | grep -q "^${pkg}\$" )
+    then
+        brew install $pkg
+    fi
+done
diff --git a/tools/build.py b/tools/build.py
new file mode 100755 (executable)
index 0000000..b002380
--- /dev/null
@@ -0,0 +1,480 @@
+#!/usr/bin/env python
+
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+from __future__ import print_function
+try:
+    basestring
+except:
+    # in Python 3.x there is no basestring just str
+    basestring = str
+
+import argparse
+import json
+import sys
+import re
+import os
+
+from js2c import js2c
+from module_analyzer import resolve_modules, analyze_module_dependency
+from common_py import path
+from common_py.system.filesystem import FileSystem as fs
+from common_py.system.executor import Executor as ex
+from common_py.system.platform import Platform
+
+platform = Platform()
+
+
+# Initialize build options.
+def init_options():
+    # Check config options.
+    arg_config = list(filter(lambda x: x.startswith('--config='), sys.argv))
+    config_path = path.BUILD_CONFIG_PATH
+
+    if arg_config:
+        config_path = arg_config[-1].split('=', 1)[1]
+
+    # Read config file and apply it to argv.
+    argv = []
+    with open(config_path, 'rb') as f:
+        config = json.loads(f.read().decode('ascii'))
+        config_option = config['build_option']
+        for opt_key in config_option:
+            opt_val = config_option[opt_key]
+            if isinstance(opt_val, basestring) and opt_val != '':
+                argv.append('--%s=%s' % (opt_key, opt_val))
+            elif isinstance(opt_val, bool):
+                if opt_val:
+                    argv.append('--%s' % opt_key)
+            elif isinstance(opt_val, int):
+                argv.append('--%s=%s' % (opt_key, opt_val))
+            elif isinstance(opt_val, list):
+                for val in opt_val:
+                    argv.append('--%s=%s' % (opt_key, val))
+
+    # Apply command line argument to argv.
+    argv = argv + sys.argv[1:]
+
+    # Prepare argument parser.
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument('--buildtype',
+        choices=['debug', 'release'], default='debug',
+        help='Specify the build type: %(choices)s (default: %(default)s)')
+
+    parser.add_argument('--builddir', default=path.BUILD_ROOT,
+        help='Specify the build directory (default: %(default)s)')
+    parser.add_argument('--buildlib', action='store_true', default=False,
+        help='Build IoT.js library only (default: %(default)s)')
+
+    parser.add_argument('--clean', action='store_true', default=False,
+        help='Clean build directory before build (default: %(default)s)')
+
+    parser.add_argument('--config', default=path.BUILD_CONFIG_PATH,
+        help='Specify the config file (default: %(default)s)',
+        dest='config_path')
+
+    parser.add_argument('--target-arch',
+        choices=['arm', 'x86', 'i686', 'x86_64', 'x64'],
+        default=platform.arch(),
+        help='Specify the target architecture: '
+             '%(choices)s (default: %(default)s)')
+    parser.add_argument('--target-os',
+        choices=['linux', 'darwin', 'osx', 'nuttx', 'tizen', 'tizenrt'],
+        default=platform.os(),
+        help='Specify the target os: %(choices)s (default: %(default)s)')
+
+    parser.add_argument('--target-board',
+        choices=['none', 'artik10', 'stm32f4dis', 'rpi2', 'artik05x'],
+        default='none', help='Specify the targeted board (if needed): '
+             '%(choices)s (default: %(default)s)')
+    parser.add_argument('--nuttx-home', default=None, dest='sysroot',
+        help='Specify the NuttX base directory (required for NuttX build)')
+
+    parser.add_argument('--cross-compile', dest='cross_compile',
+        action='store', help='Specify the cross compilation toolkit prefix.')
+    parser.add_argument('--sysroot', action='store',
+        help='The location of the development tree root directory (sysroot).'
+        'Must be compatible with used toolchain.')
+
+    parser.add_argument('--cmake-param',
+        action='append', default=[],
+        help='Specify additional cmake parameters '
+             '(can be used multiple times)')
+    parser.add_argument('--compile-flag',
+        action='append', default=[],
+        help='Specify additional compile flags (can be used multiple times)')
+    parser.add_argument('--link-flag',
+        action='append', default=[],
+        help='Specify additional linker flags (can be used multiple times)')
+
+    parser.add_argument('--external-include-dir',
+        action='append', default=[],
+        help='Specify additional external include directory '
+             '(can be used multiple times)')
+    parser.add_argument('--external-static-lib',
+        action='append', default=[],
+        help='Specify additional external static library '
+             '(can be used multiple times)')
+    parser.add_argument('--external-shared-lib',
+        action='append', default=[],
+        help='Specify additional external shared library '
+             '(can be used multiple times)')
+
+    parser.add_argument('--iotjs-include-module',
+        action='store', default=set(), type=lambda x: set(x.split(',')),
+        help='Specify iotjs modules which should be included '
+             '(format: module_1,module_2,...)')
+    parser.add_argument('--iotjs-exclude-module',
+        action='store', default=set(), type=lambda x: set(x.split(',')),
+        help='Specify iotjs modules which should be excluded '
+             '(format: module_1,module_2,...)')
+
+    parser.add_argument('--iotjs-minimal-profile',
+        action='store_true', default=False,
+        help='Build IoT.js with minimal profile')
+
+    parser.add_argument('--jerry-cmake-param',
+        action='append', default=[],
+        help='Specify additional cmake parameters for JerryScript '
+        '(can be used multiple times')
+    parser.add_argument('--jerry-compile-flag',
+        action='append', default=[],
+        help='Specify additional compile flags for JerryScript '
+             '(can be used multiple times')
+    parser.add_argument('--jerry-lto',
+        action='store_true', default=False,
+        help='Build JerryScript with LTO enabled')
+
+    parser.add_argument('--jerry-heap-section',
+        action='store', default=None,
+        help='Specify the name of the JerryScript heap section')
+    parser.add_argument('--jerry-heaplimit',
+        type=int, default=config['build_option']['jerry-heaplimit'],
+        help='Specify the size of the JerryScript max heap size '
+             '(default: %(default)s)')
+
+    parser.add_argument('--jerry-memstat',
+        action='store_true', default=False,
+        help='Enable JerryScript heap statistics')
+
+    parser.add_argument('--jerry-profile',
+        choices=['es5.1', 'es2015-subset'], default='es5.1',
+        help='Specify the profile for JerryScript: %(choices)s'
+             ' (default: %(default)s)')
+    parser.add_argument('--jerry-debugger',
+        action='store_true', default=False,
+        help='Enable JerryScript-debugger')
+    parser.add_argument('--jerry-debugger-port',
+        type=int, default=5001,
+        help='Specify the port of JerryScript-debugger (default: %(default)s)')
+    parser.add_argument('--no-init-submodule',
+        action='store_true', default=False,
+        help='Disable initialization of git submodules')
+    parser.add_argument('--no-check-valgrind',
+        action='store_true', default=False,
+        help='Disable test execution with valgrind after build')
+    parser.add_argument('--no-check-test',
+        action='store_true', default=False,
+        help='Disable test exection after build')
+    parser.add_argument('--no-parallel-build',
+        action='store_true', default=False,
+        help='Disable parallel build')
+    parser.add_argument('--no-snapshot',
+        action='store_true', default=False,
+        help='Disable snapshot generation for IoT.js')
+    parser.add_argument('-e', '--experimental',
+        action='store_true', default=False,
+        help='Enable to build experimental features')
+
+    options = parser.parse_args(argv)
+    options.config = config
+
+    return options
+
+
+def adjust_options(options):
+    # First fix some option inconsistencies.
+    if options.target_os in ['nuttx', 'tizenrt']:
+        options.buildlib = True
+        if not options.sysroot:
+            ex.fail('--sysroot needed for nuttx target')
+
+        options.sysroot = fs.abspath(options.sysroot)
+        if not fs.exists(options.sysroot):
+            ex.fail('NuttX sysroot %s does not exist' % options.sysroot)
+
+    if options.target_arch == 'x86':
+        options.target_arch = 'i686'
+    if options.target_arch == 'x64':
+        options.target_arch = 'x86_64'
+
+    if options.target_os == 'darwin':
+        options.no_check_valgrind = True
+
+    if options.target_board in ['rpi2', 'artik10', 'artik05x']:
+        options.no_check_valgrind = True
+    elif options.target_board == 'none':
+        options.target_board = None
+
+    if options.iotjs_minimal_profile:
+        options.no_check_test = True
+
+    # Then add calculated options.
+    options.host_tuple = '%s-%s' % (platform.arch(), platform.os())
+    options.target_tuple = '%s-%s' % (options.target_arch, options.target_os)
+
+    options.host_build_root = fs.join(path.PROJECT_ROOT,
+                                     options.builddir,
+                                     'host',
+                                     options.host_tuple,
+                                     options.buildtype)
+    options.host_build_bins = fs.join(options.host_build_root, 'bin')
+
+    options.build_root = fs.join(path.PROJECT_ROOT,
+                                 options.builddir,
+                                 options.target_tuple,
+                                 options.buildtype)
+    options.build_bins = fs.join(options.build_root, 'bin')
+    options.build_libs = fs.join(options.build_root, 'lib')
+
+    cmake_path = fs.join(path.PROJECT_ROOT, 'cmake', 'config', '%s.cmake')
+    options.cmake_toolchain_file = cmake_path % options.target_tuple
+    options.host_cmake_toolchain_file = cmake_path % options.host_tuple
+
+    # Specify the file of JerryScript profile.
+    options.jerry_profile = fs.join(path.JERRY_PROFILE_ROOT,
+                                    options.jerry_profile + '.profile')
+
+
+def print_build_option(options):
+    print('=================================================')
+    option_vars = vars(options)
+    for opt in option_vars:
+        print(' --%s: %s' % (opt, option_vars[opt]))
+    print()
+
+
+def print_progress(msg):
+    print('==> %s\n' % msg)
+
+
+def init_submodule():
+    ex.check_run_cmd('git', ['submodule', 'init'])
+    ex.check_run_cmd('git', ['submodule', 'update'])
+
+
+def build_cmake_args(options, for_jerry=False):
+    cmake_args = []
+    # compile flags
+    compile_flags = []
+
+    config_compile_flags = options.config['compile_flags']
+    compile_flags += config_compile_flags['os'][options.target_os]
+    compile_flags += config_compile_flags['arch'][options.target_arch]
+    compile_flags += config_compile_flags['buildtype'][options.buildtype]
+    if options.target_board:
+        compile_flags += config_compile_flags['board'][options.target_board]
+
+    compile_flags += options.compile_flag
+    compile_flags += options.jerry_compile_flag if for_jerry else []
+
+    cmake_args.append("-DCMAKE_C_FLAGS='%s'" % (' '.join(compile_flags)))
+
+    # link flags
+    link_flags = []
+
+    config_link_flags = options.config['link_flags']
+    link_flags += config_link_flags['os'][options.target_os]
+    link_flags += options.link_flag
+
+    if options.jerry_lto:
+        link_flags.append('-flto')
+
+    cmake_args.append("-DCMAKE_EXE_LINKER_FLAGS='%s'" % (' '.join(link_flags)))
+
+    # external include dir
+    include_dirs = []
+    if options.target_os in ['nuttx', 'tizenrt'] and options.sysroot:
+        include_dirs.append('%s/include' % options.sysroot)
+        if options.target_board == 'stm32f4dis':
+            include_dirs.append('%s/arch/arm/src/stm32' % options.sysroot)
+
+    if options.target_os == 'tizenrt':
+        include_dirs.append('%s/../framework/include/iotbus' % options.sysroot)
+
+    include_dirs.extend(options.external_include_dir)
+    cmake_args.append("-DEXTERNAL_INCLUDE_DIR='%s'" % (' '.join(include_dirs)))
+
+    return cmake_args
+
+
+def run_make(options, build_home, *args):
+    make_opt = ['-C', build_home]
+    make_opt.extend(args)
+    if not options.no_parallel_build:
+        make_opt.append('-j')
+
+    ex.check_run_cmd('make', make_opt)
+
+
+def get_on_off(boolean_value):
+    if boolean_value:
+        return 'ON'
+
+    return 'OFF'
+
+
+def build_iotjs(options):
+    print_progress('Build IoT.js')
+
+    # Set IoT.js cmake options.
+    cmake_opt = [
+        '-B%s' % options.build_root,
+        '-H%s' % path.PROJECT_ROOT,
+        "-DCMAKE_TOOLCHAIN_FILE='%s'" % options.cmake_toolchain_file,
+        '-DCMAKE_BUILD_TYPE=%s' % options.buildtype.capitalize(),
+        '-DTARGET_OS=%s' % options.target_os,
+        '-DTARGET_BOARD=%s' % options.target_board,
+        '-DPLATFORM_DESCRIPTOR=%s' % options.target_tuple,
+        '-DENABLE_LTO=%s' % get_on_off(options.jerry_lto), # --jerry-lto
+        '-DENABLE_SNAPSHOT=%s' % get_on_off(not options.no_snapshot),
+        '-DENABLE_MINIMAL=%s' % get_on_off(options.iotjs_minimal_profile),
+        '-DBUILD_LIB_ONLY=%s' % get_on_off(options.buildlib), # --build-lib
+        # --jerry-memstat
+        '-DFEATURE_MEM_STATS=%s' % get_on_off(options.jerry_memstat),
+        # --iotjs-include-module
+        "-DIOTJS_INCLUDE_MODULE='%s'" % ','.join(options.iotjs_include_module),
+        # --iotjs-exclude-module
+        "-DIOTJS_EXCLUDE_MODULE='%s'" % ','.join(options.iotjs_exclude_module),
+        # --jerry-profile
+        "-DFEATURE_PROFILE='%s'" % options.jerry_profile,
+    ]
+
+    if options.target_os in ['nuttx', 'tizenrt']:
+        cmake_opt.append("-DEXTERNAL_LIBC_INTERFACE='%s'" %
+                         fs.join(options.sysroot, 'include'))
+        cmake_opt.append("-DTARGET_SYSTEMROOT='%s'" % options.sysroot)
+        cmake_opt.append("-DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=arm")
+
+    # --jerry-heaplimit
+    if options.jerry_heaplimit:
+        cmake_opt.append('-DMEM_HEAP_SIZE_KB=%d' % options.jerry_heaplimit)
+
+    # --jerry-heap-section
+    if options.jerry_heap_section:
+        cmake_opt.append("-DJERRY_HEAP_SECTION_ATTR='%s'" %
+                         options.jerry_heap_section)
+
+    # --jerry-debugger
+    if options.jerry_debugger:
+        cmake_opt.append('-DFEATURE_DEBUGGER=ON')
+        cmake_opt.append('-DFEATURE_DEBUGGER_PORT=%d' %
+                          options.jerry_debugger_port)
+
+    # --cmake-param
+    cmake_opt.extend(options.cmake_param)
+
+    # --external-static-lib
+    cmake_opt.append("-DEXTERNAL_STATIC_LIB='%s'" %
+                     (' '.join(options.external_static_lib)))
+
+    # --external-shared-lib
+    shared_libs = []
+    shared_libs.extend(options.external_shared_lib)
+    shared_libs.extend(options.config['shared_libs']['os'][options.target_os])
+    cmake_opt.append("-DEXTERNAL_SHARED_LIB='%s'" % (' '.join(shared_libs)))
+
+    # --jerry-cmake-param
+    if options.jerry_cmake_param:
+        cmake_opt.append("-DEXTRA_JERRY_CMAKE_PARAMS='%s'" %
+                         ' '.join(options.jerry_cmake_param))
+
+    # --experimental
+    if options.experimental:
+        options.compile_flag.append('-DEXPERIMENTAL')
+
+    # Add common cmake options.
+    cmake_opt.extend(build_cmake_args(options))
+
+    # Run cmake.
+    ex.check_run_cmd('cmake', cmake_opt)
+
+    run_make(options, options.build_root)
+
+
+def run_checktest(options):
+    checktest_quiet = 'yes'
+    if os.getenv('TRAVIS') == "true":
+        checktest_quiet = 'no'
+
+    # IoT.js executable
+    iotjs = fs.join(options.build_root, 'bin', 'iotjs')
+    build_args = ['quiet=' + checktest_quiet]
+    if options.iotjs_exclude_module:
+        skip_module = ','.join(options.iotjs_exclude_module)
+        build_args.append('skip-module=' + skip_module)
+
+    # experimental
+    if options.experimental:
+        build_args.append('experimental=' + 'yes');
+
+    fs.chdir(path.PROJECT_ROOT)
+    code = ex.run_cmd(iotjs, [path.CHECKTEST_PATH] + build_args)
+    if code != 0:
+        ex.fail('Failed to pass unit tests')
+    if not options.no_check_valgrind:
+        code = ex.run_cmd('valgrind', ['--leak-check=full',
+                                       '--error-exitcode=5',
+                                       '--undef-value-errors=no',
+                                       iotjs,
+                                       path.CHECKTEST_PATH] + build_args)
+        if code == 5:
+            ex.fail('Failed to pass valgrind test')
+        if code != 0:
+            ex.fail('Failed to pass unit tests in valgrind environment')
+
+
+if __name__ == '__main__':
+    # Initialize build option object.
+    options = init_options()
+    adjust_options(options)
+    print_build_option(options)
+
+    if options.clean:
+        print_progress('Clear build directory')
+        fs.rmtree(options.build_root)
+        fs.rmtree(options.host_build_root)
+
+    # Perform init-submodule.
+    if not options.no_init_submodule:
+        print_progress('Initialize submodule')
+        init_submodule()
+
+    build_iotjs(options)
+
+    # Run tests.
+    if not options.no_check_test:
+        print_progress('Run tests')
+        if options.buildlib:
+            print("Skip unit tests - build target is library\n")
+        elif (options.host_tuple == options.target_tuple or
+              (options.host_tuple == 'x86_64-linux' and
+               options.target_tuple == 'i686-linux')):
+             run_checktest(options)
+        else:
+            print("Skip unit tests - target-host pair is not allowed\n")
+
+    print("\n%sIoT.js Build Succeeded!!%s\n" % (ex._TERM_GREEN, ex._TERM_EMPTY))
diff --git a/tools/check_license.py b/tools/check_license.py
new file mode 100755 (executable)
index 0000000..d9ddece
--- /dev/null
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+import re
+
+
+class CheckLicenser(object):
+    _license = re.compile(
+u"""((#|//|\*) Copyright .* Samsung Electronics Co., Ltd. and other contribu.*)+
+\s?\\2
+\s?\\2 Licensed under the Apache License, Version 2.0 \(the "License"\);
+\s?\\2 you may not use this file except in compliance with the License.
+\s?\\2 You may obtain a copy of the License at
+\s?\\2
+\s?\\2     http://www.apache.org/licenses/LICENSE-2.0
+\s?\\2
+\s?\\2 Unless required by applicable law or agreed to in writing, software
+\s?\\2 distributed under the License is distributed on an "AS IS" BASIS
+\s?\\2 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+\s?\\2 See the License for the specific language governing permissions and
+\s?\\2 limitations under the License.""")
+
+    @staticmethod
+    def check(filename):
+        with open(filename, 'r') as f:
+            contents = f.read()
+            return bool(CheckLicenser._license.search(contents))
diff --git a/tools/check_signed_off.sh b/tools/check_signed_off.sh
new file mode 100755 (executable)
index 0000000..584da04
--- /dev/null
@@ -0,0 +1,111 @@
+#!/bin/bash
+
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+# Copyright 2016 University of Szeged
+#
+# 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.
+
+# Usage
+function print_usage
+{
+ echo "Usage: $0 [--help] [--tolerant] [--travis]"
+}
+
+function print_help
+{
+ echo "$0: Check Signed-off-by message of the latest commit"
+ echo ""
+ print_usage
+ echo ""
+ echo "Optional arguments:"
+ echo "  --help            print this help message"
+ echo "  --tolerant        check the existence of the message only but don't"
+ echo "                    require the name and email address to match the author"
+ echo "                    of the commit"
+ echo "  --travis          perform check in tolerant mode if on Travis CI and not"
+ echo "                    checking a pull request, perform strict check otherwise"
+ echo ""
+ echo "The last line of every commit message must follow the form of:"
+ echo "'IoT.js-DCO-1.0-Signed-off-by: NAME EMAIL', where NAME and EMAIL must"
+ echo "match the name and email address of the author of the commit (unless in"
+ echo "tolerant mode)."
+}
+
+# Processing command line
+TOLERANT="no"
+while [ "$#" -gt 0 ]
+do
+ if [ "$1" == "--help" ]
+ then
+  print_help
+  exit 0
+ elif [ "$1" == "--tolerant" ]
+ then
+  TOLERANT="yes"
+  shift
+ elif [ "$1" == "--travis" ]
+ then
+  if [ "$TRAVIS_PULL_REQUEST" == "" ]
+  then
+   echo -e "\e[1;33mWarning! Travis-tolerant mode requested but not running on Travis CI! \e[0m"
+  elif [ "$TRAVIS_PULL_REQUEST" == "false" ]
+  then
+   TOLERANT="yes"
+  else
+   TOLERANT="no"
+  fi
+  shift
+ else
+  print_usage
+  exit 1
+ fi
+done
+
+# Determining latest commit
+parent_hashes=(`git show -s --format=%p HEAD | head -1`)
+
+if [ "${#parent_hashes[@]}" -eq 1 ]
+then
+ commit_hash=`git show -s --format=%h HEAD | head -1`
+elif [ "${#parent_hashes[@]}" -eq 2 ]
+then
+ commit_hash=${parent_hashes[1]}
+else
+ echo "$0: cannot handle commit with ${#parent_hashes[@]} parents ${parent_hashes[@]}"
+ exit 1
+fi
+
+# Checking the last line
+actual_signed_off_by_line=`git show -s --format=%B $commit_hash | sed '/^$/d' | tr -d '\015' | tail -n 1`
+
+if [ "$TOLERANT" == "no" ]
+then
+ author_name=`git show -s --format=%an $commit_hash`
+ author_email=`git show -s --format=%ae $commit_hash`
+ required_signed_off_by_line="IoT.js-DCO-1.0-Signed-off-by: $author_name $author_email"
+
+ if [ "$actual_signed_off_by_line" != "$required_signed_off_by_line" ]
+ then
+  echo -e "\e[1;33mSigned-off-by message is incorrect. The following line should be at the end of the $commit_hash commit's message: '$required_signed_off_by_line'. \e[0m"
+  exit 1
+ fi
+else
+  echo -e "\e[1;33mWarning! The name and email address of the author of the $commit_hash commit is not checked in tolerant mode! \e[0m"
+  if echo "$actual_signed_off_by_line" | grep -q -v '^IoT.js-DCO-1.0-Signed-off-by:'
+  then
+   echo -e "\e[1;33mSigned-off-by message is incorrect. The following line should be at the end of the $commit_hash commit's message: '$required_signed_off_by_line'. \e[0m"
+   exit 1
+  fi
+fi
+
+exit 0
diff --git a/tools/check_test.js b/tools/check_test.js
new file mode 100644 (file)
index 0000000..52c7d1e
--- /dev/null
@@ -0,0 +1,262 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+var Runner = require('test_runner').Runner;
+var Logger = require('common_js/logger').Logger;
+var OptionParser = require('common_js/option_parser').OptionParser;
+var util = require('common_js/util');
+var EventEmitter = require('events').EventEmitter;
+
+var root = 'test';
+var parent = '..';
+
+function Driver() {
+  this.results = {
+    pass: 0,
+    fail: 0,
+    skip: 0,
+    timeout: 0,
+  };
+
+  this.emitter = new EventEmitter();
+  this.emitter.addListener('nextTest', function(driver, status, test) {
+    if (driver.runner) {
+      driver.runner.cleanup();
+    }
+    var filename = test['name'];
+
+    if (status == 'pass') {
+      driver.results.pass++;
+      driver.logger.message('PASS : ' + filename, status);
+    } else if (status == 'fail') {
+      driver.results.fail++;
+      driver.logger.message('FAIL : ' + filename, status);
+    } else if (status == 'skip') {
+      driver.results.skip++;
+      driver.logger.message('SKIP : ' + filename +
+                   '   (reason : ' + test.reason + ")", status);
+    } else if (status == 'timeout') {
+      driver.results.timeout++;
+      driver.logger.message('TIMEOUT : ' + filename, status);
+    }
+    driver.fIdx++;
+    driver.runNextTest();
+  });
+
+  this.os = process.platform;
+  this.board = process.iotjs.board;
+
+  this.root = util.absolutePath(root);
+  process.chdir(this.root);
+
+  return this;
+}
+
+Driver.prototype.config = function() {
+  var parser = new OptionParser();
+
+  parser.addOption('start-from', "", "",
+    "a test case file name where the driver starts.");
+  parser.addOption('quiet', "yes|no", "yes",
+    "a flag that indicates if the driver suppresses " +
+    "console outputs of test case");
+  parser.addOption('output-file', "", "",
+    "a file name where the driver leaves output");
+  parser.addOption('skip-module', "", "",
+    "a module list to skip test of specific modules");
+  parser.addOption('output-coverage', "yes|no", "no",
+    "output coverage information");
+  parser.addOption('experimental', "yes|no", "no",
+    "a flag that indicates if tests for experimental are needed");
+
+  var options = parser.parse();
+
+  if (options == null) {
+    parser.printHelp();
+    return false;
+  }
+
+  var output = options['output-file'];
+  if (output) {
+    if (this.os == 'nuttx') {
+      var path = util.join('/mnt/sdcard', output);
+    } else {
+      var path = util.join(this.root, '..', output);
+    }
+    fs.writeFileSync(path, new Buffer(''));
+  }
+  var skipModule = options['skip-module'];
+  if (skipModule) {
+    this.skipModule = skipModule.split(',');
+  }
+
+  var experimental = options['experimental'];
+  if (experimental == 'no') {
+    this.stability = 'stable';
+  } else {
+    this.stability = 'experimental';
+  }
+
+  this.logger = new Logger(path);
+
+  this.options = options;
+
+  var testfile = util.join(this.root, 'testsets.json');
+  var testsets = fs.readFileSync(testfile).toString();
+
+  this.tests = JSON.parse(testsets);
+
+  this.dIdx = 0;
+  this.dLength = Object.keys(this.tests).length;
+
+  var skipped = this.skipTestSet(options['start-from']);
+
+  this.nextTestSet(skipped);
+  return true;
+};
+
+Driver.prototype.runNextTest = function() {
+  if (this.dIdx == this.dLength) {
+    this.finish();
+  } else {
+    if (this.fIdx == this.fLength) {
+      this.dIdx++;
+      if (this.dIdx == this.dLength) {
+        this.finish();
+      } else {
+        this.nextTestSet();
+        this.runNextTest();
+      }
+    } else {
+      this.runner = new Runner(this);
+      this.runner.run();
+    }
+  }
+};
+
+Driver.prototype.skipTestSet = function(filename) {
+  if (!filename)
+    return false;
+
+  var dLength = this.dLength;
+  for (var dIdx = 0; dIdx < dLength; dIdx++) {
+    var dirname = Object.keys(this.tests)[dIdx];
+    var dir = this.tests[dirname];
+    var fLength = dir.length;
+    for (var fIdx = 0; fIdx < fLength; fIdx++) {
+      if (dir[fIdx]['name'] == filename) {
+        this.fIdx = fIdx;
+        this.dIdx = dIdx;
+        return true;
+      }
+    }
+  }
+
+  return false;
+};
+
+Driver.prototype.nextTestSet = function(skipped) {
+  if (!skipped) {
+    this.fIdx = 0;
+  }
+
+  var dirname = this.dirname();
+  this.fLength = this.tests[dirname].length;
+  this.logger.message("\n");
+  this.logger.message(">>>> " + dirname, "summary");
+};
+
+Driver.prototype.dirname = function() {
+  return Object.keys(this.tests)[this.dIdx]
+};
+
+Driver.prototype.currentTest = function() {
+  var dirname = this.dirname();
+  return this.tests[dirname][this.fIdx];
+};
+
+Driver.prototype.test = function() {
+  var test = this.currentTest();
+  var dirname = this.dirname();
+  var testfile = util.absolutePath(util.join(dirname, test['name']));
+
+  return fs.readFileSync(testfile).toString();
+};
+
+Driver.prototype.finish = function() {
+  this.logger.message('\n\nfinish all tests', this.logger.status.summary);
+
+  this.logger.message('PASS : ' + this.results.pass, this.logger.status.pass);
+  this.logger.message('FAIL : ' + this.results.fail, this.logger.status.fail);
+  this.logger.message('TIMEOUT : ' +
+    this.results.timeout, this.logger.status.timeout);
+  this.logger.message('SKIP : ' + this.results.skip, this.logger.status.skip);
+
+  if (this.options["output-coverage"] == "yes"
+      && typeof __coverage__ !== "undefined") {
+    data = JSON.stringify(__coverage__);
+
+    if (!fs.existsSync("../.coverage_output/")) {
+        fs.mkdirSync("../.coverage_output/");
+    }
+
+    fs.writeFileSync("../.coverage_output/js_coverage.data", Buffer(data));
+  }
+  else if (this.results.fail > 0 || this.results.timeout > 0) {
+    originalExit(1);
+  }
+
+  originalExit(0);
+};
+
+var driver = new Driver();
+
+var originalExit = process.exit;
+process.exit = function(code) {
+  // this function is called when the following happens.
+  // 1. the test case is finished normally.
+  // 2. assertion inside the callback function is failed.
+  var should_fail = driver.runner.test['expected-failure'];
+  try {
+    process.emitExit(code);
+  } catch(e) {
+    // when assertion inside the process.on('exit', function { ... }) is failed,
+    // this procedure is executed.
+    process.removeAllListeners('exit');
+
+    if (should_fail) {
+      driver.runner.finish('pass');
+    } else {
+      console.error(e);
+      driver.runner.finish('fail');
+    }
+  } finally {
+    process.removeAllListeners('exit');
+
+    if (code != 0 && !should_fail) {
+      driver.runner.finish('fail');
+    } else if (code == 0 && should_fail) {
+      driver.runner.finish('fail');
+    } else {
+      driver.runner.finish('pass');
+    }
+  }
+};
+
+var conf = driver.config();
+if (conf) {
+  driver.runNextTest();
+}
diff --git a/tools/check_tidy.py b/tools/check_tidy.py
new file mode 100755 (executable)
index 0000000..7b098f9
--- /dev/null
@@ -0,0 +1,222 @@
+#!/usr/bin/env python
+
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+from __future__ import print_function
+
+import argparse
+import fileinput
+import functools
+import os
+import subprocess
+import tempfile
+
+from distutils import spawn
+
+from check_license import CheckLicenser
+from common_py.system.filesystem import FileSystem as fs
+from common_py.system.executor import Executor as ex
+
+
+def parse_option():
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--autoedit', action='store_true', default=False,
+        help='Automatically edit the detected clang format errors.'
+        'No diffs will be displayed')
+
+    option = parser.parse_args()
+    return option
+
+
+class StyleChecker(object):
+
+    column_limit = 80
+
+    def __init__(self):
+        self.count_lines = 0
+        self.count_empty_lines = 0
+        self.errors = []
+
+    @property
+    def error_count(self):
+        return len(self.errors)
+
+    @property
+    def count_valid_lines(self):
+        return self.count_lines - self.count_empty_lines
+
+    def report_error(self, msg):
+        name = fileinput.filename()
+        line = fileinput.filelineno()
+        self.errors.append("%s:%d: %s" % (name, line, msg))
+
+    def check(self, files):
+        for line in fileinput.input(files):
+            if '\t' in line:
+                self.report_error('TAB character')
+            if '\r' in line:
+                self.report_error('CR character')
+            if line.endswith(' \n') or line.endswith('\t\n'):
+                self.report_error('trailing whitespace')
+            if not line.endswith('\n'):
+                self.report_error('line ends without NEW LINE character')
+
+            if len(line) - 1 > StyleChecker.column_limit:
+                self.report_error('line exceeds %d characters'
+                                  % StyleChecker.column_limit)
+
+            if fileinput.isfirstline():
+                if not CheckLicenser.check(fileinput.filename()):
+                    self.report_error('incorrect license')
+
+
+            self.count_lines += 1
+            if not line.strip():
+                self.count_empty_lines += 1
+
+
+class ClangFormat(object):
+
+    def __init__(self, extensions, skip_files=None, options=None):
+        self.diffs = []
+        self._extensions = extensions
+        self._skip_files = skip_files
+        self._options = options
+        self._check_clang_format("clang-format-3.8")
+
+    def _check_clang_format(self, base):
+        clang_format = spawn.find_executable(base)
+
+        if not clang_format:
+            clang_format = spawn.find_executable("clang-format")
+            if clang_format:
+                print("%sUsing %s instead of %s%s"
+                      % (ex._TERM_YELLOW, clang_format, base, ex._TERM_EMPTY))
+            else:
+                print("%sNo %s found, skipping checks!%s"
+                      % (ex._TERM_RED, base, ex._TERM_EMPTY))
+
+        self._clang_format = clang_format
+
+    @property
+    def error_count(self):
+        return len(self.diffs)
+
+    def is_checked_by_clang(self, file):
+        _, ext = fs.splitext(file)
+        return ext in self._extensions and file not in self._skip_files
+
+    def check(self, files):
+        if not self._clang_format:
+            return
+
+        for file in filter(self.is_checked_by_clang, files):
+            args = ['-style=file', file]
+            if self._options and self._options.autoedit:
+                args.append('-i')
+            output = ex.run_cmd_output(self._clang_format,
+                                       args,
+                                       quiet=True)
+
+            if output:
+                with tempfile.NamedTemporaryFile() as temp:
+                    temp.write(output)
+                    temp.flush() # just to be really safe
+                    self._diff(file, temp.name)
+
+    def _diff(self, original, formatted):
+        try:
+            subprocess.check_output(['diff', '-u', original, formatted])
+        except subprocess.CalledProcessError as error:
+            # if there is a difference between the two files
+            # this error will be generated and we can extract
+            # the diff from that it. Otherwise nothing to do.
+            self.diffs.append(error.output.decode())
+
+
+class FileFilter(object):
+
+    def __init__(self, allowed_exts, allowed_files, skip_files):
+        self._allowed_exts = allowed_exts
+        self._allowed_files = allowed_files
+        self._skip_files = skip_files
+
+    def __call__(self, dir_path, file):
+        if file in self._allowed_files:
+            return True
+
+        if file in self._skip_files:
+            return False
+
+        _, ext = fs.splitext(file)
+        return ext in self._allowed_exts
+
+
+def check_tidy(src_dir, options=None):
+    allowed_exts = ['.c', '.h', '.js', '.py', '.sh', '.cmake']
+    allowed_files = ['CMakeLists.txt']
+    clang_format_exts = ['.c', '.h']
+    skip_dirs = ['deps', 'build', '.git', 'node_modules', 'coverage']
+    skip_files = ['check_signed_off.sh', '__init__.py',
+                  'iotjs_js.c', 'iotjs_js.h', 'iotjs_string_ext.inl.h',
+                  'ble.js',
+                  'ble_hci_socket_acl_stream.js',
+                  'ble_hci_socket_smp.js',
+                  'ble_hci_socket_hci.js',
+                  'ble_hci_socket_gap.js',
+                  'ble_hci_socket_gatt.js',
+                  'ble_hci_socket_mgmt.js',
+                  'ble_hci_socket_bindings.js',
+                  'ble_characteristic.js',
+                  'test_ble_setservices.js',
+                  ]
+
+    style = StyleChecker()
+    clang = ClangFormat(clang_format_exts, skip_files, options)
+
+    file_filter = FileFilter(allowed_exts, allowed_files, skip_files)
+    files = fs.files_under(src_dir, skip_dirs, file_filter)
+
+    clang.check(files)
+    style.check(files)
+
+    if clang.error_count:
+        print("Detected clang-format problems:")
+        print("".join(clang.diffs))
+        print()
+
+    if style.error_count:
+        print("Detected style problems:")
+        print("\n".join(style.errors))
+        print()
+
+    total_errors = style.error_count + clang.error_count
+    print("* total lines of code: %d" % style.count_lines)
+    print("* total non-blank lines of code: %d" % style.count_valid_lines)
+    print("* style errors: %d" % style.error_count)
+    print("* clang-format errors: %d" % clang.error_count)
+
+    msg_color = ex._TERM_RED if total_errors > 0 else ex._TERM_GREEN
+    print("%s* total errors: %d%s" % (msg_color, total_errors, ex._TERM_EMPTY))
+    print()
+
+    return total_errors == 0
+
+
+
+if __name__ == '__main__':
+    from common_py import path
+    options = parse_option()
+    check_tidy(path.PROJECT_ROOT, options)
diff --git a/tools/common_js/logger.js b/tools/common_js/logger.js
new file mode 100644 (file)
index 0000000..043eb31
--- /dev/null
@@ -0,0 +1,58 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+
+function Logger(path) {
+  this.text_colors = {
+    red: "\033[1;31m",
+    yellow: "\033[1;33m",
+    green: "\033[1;32m",
+    blue: "\033[1;34m",
+    empty: "\033[0m",
+  };
+  this.status = {
+    pass: "pass",
+    skip: "skip",
+    fail: "fail",
+    timeout: "timeout",
+    summary: "summary"
+  }
+  this.path = path;
+
+  return this;
+}
+
+Logger.prototype.message = function (msg, status) {
+  if (this.path) {
+    // FIXME : After fs.appendFile is implemented, it should be replaced.
+    var data = fs.readFileSync(this.path);
+    var newData = data + msg + "\n";
+    fs.writeFileSync(this.path, new Buffer(newData));
+  }
+  if (status == this.status.pass) {
+    console.log(this.text_colors.green + msg + this.text_colors.empty);
+  } else if (status == this.status.skip) {
+    console.log(this.text_colors.yellow + msg + this.text_colors.empty);
+  } else if (status == this.status.fail || status == this.status.timeout){
+    console.log(this.text_colors.red + msg + this.text_colors.empty);
+  } else if (status == this.status.summary){
+    console.log(this.text_colors.blue + msg + this.text_colors.empty);
+  } else {
+    console.log(msg);
+  }
+}
+
+module.exports.Logger = Logger;
diff --git a/tools/common_js/module/console.js b/tools/common_js/module/console.js
new file mode 100644 (file)
index 0000000..4aac72a
--- /dev/null
@@ -0,0 +1,29 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var fs = require('fs');
+
+function Console() {
+  return this;
+}
+
+Console.prototype.log =
+Console.prototype.info =
+Console.prototype.warn =
+Console.prototype.error = function() {
+  /* Do Nothing */
+};
+
+module.exports = new Console();
diff --git a/tools/common_js/option_parser.js b/tools/common_js/option_parser.js
new file mode 100644 (file)
index 0000000..dbdcc8b
--- /dev/null
@@ -0,0 +1,89 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+function Option(arg, value, default_value, help) {
+  this.arg = arg;
+  this.value = value;
+  this.default_value = default_value;
+  this.help = help;
+
+  return this;
+}
+
+Option.prototype.printHelp = function() {
+  console.log("\t" + this.arg + "=[" + this.value + "](default: " +
+              this.default_value + ") : " + this.help);
+}
+
+function OptionParser() {
+  this.options = [];
+  return this;
+}
+
+OptionParser.prototype.addOption = function(arg, value, default_value, help) {
+  var option  = new Option(arg, value, default_value, help);
+  this.options.push(option);
+}
+
+OptionParser.prototype.parse = function() {
+  var options = {};
+
+  for (var idx in this.options) {
+    var option = this.options[idx];
+    var default_value = option.default_value;
+    if (default_value !== "") {
+      options[option.arg] = default_value;
+    }
+  }
+
+  for (var aIdx = 2; aIdx < process.argv.length; aIdx++) {
+    var option = process.argv[aIdx];
+    var arg_val = option.split("=");
+
+    if (arg_val.length != 2 || !arg_val[0] || !arg_val[1]) {
+      return null;
+    }
+
+    var arg = arg_val[0];
+    var val = arg_val[1];
+    var found = false;
+
+    for (var oIdx in this.options) {
+      if (arg == this.options[oIdx].arg) {
+        options[arg] = val;
+        found = true;
+        break;
+      }
+    }
+
+    if (!found)
+      return null;
+  }
+
+  return options;
+}
+
+OptionParser.prototype.printHelp = function() {
+  console.log(process.argv[1]);
+  console.log("\noptional arguments");
+  for (var idx in this.options) {
+    this.options[idx].printHelp();
+  }
+}
+
+
+
+
+ module.exports.OptionParser = OptionParser;
diff --git a/tools/common_js/util.js b/tools/common_js/util.js
new file mode 100644 (file)
index 0000000..ca79704
--- /dev/null
@@ -0,0 +1,29 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+function absolutePath(path) {
+  // FIXME: On NuttX side, when dealing with file, path should be absolute.
+  // So workaround this problem, test driver converts relative path
+  // to absolute one.
+  return process.cwd() + '/' + path;
+}
+
+function join() {
+  var path = Array.prototype.join.call(arguments, '/');
+  return path;
+}
+
+module.exports.absolutePath = absolutePath;
+module.exports.join = join;
diff --git a/tools/common_py/__init__.py b/tools/common_py/__init__.py
new file mode 100644 (file)
index 0000000..ef65bee
--- /dev/null
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/tools/common_py/path.py b/tools/common_py/path.py
new file mode 100644 (file)
index 0000000..b00ca52
--- /dev/null
@@ -0,0 +1,59 @@
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+""" common path for scripts """
+
+from common_py.system.filesystem import FileSystem as fs
+
+# Root directory for the project.
+PROJECT_ROOT = fs.abspath(fs.join(fs.dirname(__file__), fs.pardir, fs.pardir))
+
+# Source code directory.
+SRC_ROOT = fs.join(PROJECT_ROOT, 'src')
+
+# Root Build directory.
+BUILD_ROOT = fs.join(PROJECT_ROOT, 'build')
+
+# Root Build directory.
+TOOLS_ROOT = fs.join(PROJECT_ROOT, 'tools')
+
+# Root directory for dependencies.
+DEPS_ROOT = fs.join(PROJECT_ROOT, 'deps')
+
+# Root directory for test.
+TEST_ROOT = fs.join(PROJECT_ROOT, 'test')
+
+RUN_PASS_DIR = fs.join(TEST_ROOT, 'run_pass')
+
+RUN_FAIL_DIR = fs.join(TEST_ROOT, 'run_fail')
+
+RESOURCE_DIR = fs.join(TEST_ROOT, 'resources')
+
+# Root directory for JerryScript submodule.
+JERRY_ROOT = fs.join(DEPS_ROOT, 'jerry')
+
+# Root directory of JerryScript profiles.
+JERRY_PROFILE_ROOT = fs.join(JERRY_ROOT, 'jerry-core', 'profiles')
+
+# Root directory for libtuv submodule.
+TUV_ROOT = fs.join(DEPS_ROOT, 'libtuv')
+
+# Root directory for http-parser submodule.
+HTTPPARSER_ROOT = fs.join(DEPS_ROOT, 'http-parser')
+
+# checktest
+CHECKTEST_PATH = fs.join(TOOLS_ROOT, 'check_test.js')
+
+# Build configuration file path.
+BUILD_CONFIG_PATH = fs.join(PROJECT_ROOT, 'build.config')
diff --git a/tools/common_py/system/__init__.py b/tools/common_py/system/__init__.py
new file mode 100644 (file)
index 0000000..ef65bee
--- /dev/null
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/tools/common_py/system/executor.py b/tools/common_py/system/executor.py
new file mode 100644 (file)
index 0000000..a8d721e
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+from __future__ import print_function
+
+import subprocess
+
+
+class Executor(object):
+    _TERM_RED = "\033[1;31m"
+    _TERM_YELLOW = "\033[1;33m"
+    _TERM_GREEN = "\033[1;32m"
+    _TERM_BLUE = "\033[1;34m"
+    _TERM_EMPTY = "\033[0m"
+
+    @staticmethod
+    def cmd_line(cmd, args=[]):
+        return ' '.join([cmd] + args)
+
+    @staticmethod
+    def print_cmd_line(cmd, args=[]):
+        print("%s%s%s" % (Executor._TERM_BLUE, Executor.cmd_line(cmd, args),
+                          Executor._TERM_EMPTY))
+        print()
+
+    @staticmethod
+    def fail(msg):
+        print()
+        print("%s%s%s" % (Executor._TERM_RED, msg, Executor._TERM_EMPTY))
+        print()
+        exit(1)
+
+    @staticmethod
+    def run_cmd(cmd, args=[], quiet=False):
+        if not quiet:
+            Executor.print_cmd_line(cmd, args)
+        try:
+            return subprocess.call([cmd] + args)
+        except OSError as e:
+            Executor.fail("[Failed - %s] %s" % (cmd, e.strerror))
+
+    @staticmethod
+    def run_cmd_output(cmd, args=[], quiet=False):
+        if not quiet:
+            Executor.print_cmd_line(cmd, args)
+        try:
+            return subprocess.check_output([cmd] + args)
+        except OSError as e:
+            Executor.fail("[Failed - %s] %s" % (cmd, e.strerror))
+
+    @staticmethod
+    def check_run_cmd(cmd, args=[], quiet=False):
+        retcode = Executor.run_cmd(cmd, args, quiet)
+        if retcode != 0:
+            Executor.fail("[Failed - %d] %s" % (retcode,
+                                                Executor.cmd_line(cmd, args)))
diff --git a/tools/common_py/system/filesystem.py b/tools/common_py/system/filesystem.py
new file mode 100644 (file)
index 0000000..7f47075
--- /dev/null
@@ -0,0 +1,385 @@
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimecd r.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+""" Wrapper object for the file system """
+
+
+import codecs
+import errno
+import filecmp
+import glob
+import hashlib
+import os
+import shutil
+import sys
+import tempfile
+import time
+try:
+    import exceptions
+except ImportError:
+    class exceptions(object):
+        OSError = OSError
+
+
+class FileSystem(object):
+    """FileSystem interface for IoT.js.
+
+    Unless otherwise noted, all paths are allowed to be either absolute
+    or relative."""
+    sep = os.sep
+    pardir = os.pardir
+
+    @staticmethod
+    def abspath(path):
+        # FIXME: This gross hack is needed while we transition from Cygwin
+        # to native Windows, because we have some mixing of file conventions
+        # from different tools:
+        if sys.platform == 'cygwin':
+            path = os.path.normpath(path)
+            path_components = path.split(os.sep)
+            if (path_components and len(path_components[0]) == 2
+                    and path_components[0][1] == ':'):
+                path_components[0] = path_components[0][0]
+                path = os.path.join('/', 'cygdrive', *path_components)
+
+        return os.path.abspath(path)
+
+    @staticmethod
+    def realpath(path):
+        return os.path.realpath(path)
+
+    @staticmethod
+    def path_to_module(module_name):
+        """A wrapper for all calls to __file__ to allow easy unit testing."""
+        # FIXME: This is the only use of sys in this file. It's possible this
+        # function should move elsewhere.
+        # __file__ is always an absolute path.
+        return sys.modules[module_name].__file__
+
+    @staticmethod
+    def expanduser(path):
+        return os.path.expanduser(path)
+
+    @staticmethod
+    def basename(path):
+        return os.path.basename(path)
+
+    @staticmethod
+    def chdir(path):
+        return os.chdir(path)
+
+    @staticmethod
+    def copy(source, destination):
+        shutil.copy(source, destination)
+
+    @staticmethod
+    def copyfile(source, destination):
+        shutil.copyfile(source, destination)
+
+    @staticmethod
+    def dirname(path):
+        return os.path.dirname(path)
+
+    @staticmethod
+    def exists(path):
+        return os.path.exists(path)
+
+    @staticmethod
+    def dirs_under(path, dir_filter=None):
+        """Return the list of all directories under the given path in
+        topdown order.
+
+        Args:
+            dir_filter: if not None, the filter will be invoked
+                with the filesystem object and the path of each dirfound.
+                The dir is included in the result if the callback returns True.
+        """
+        def filter_all(dirpath):
+            return True
+        dir_filter = dir_filter or filter_all
+
+        dirs = []
+        for (dirpath, dirnames, filenames) in os.walk(path):
+            if dir_filter(dirpath):
+                dirs.append(dirpath)
+        return dirs
+
+    @staticmethod
+    def files_under(path, dirs_to_skip=[], file_filter=None):
+        """Return the list of all files under the given path in topdown order.
+
+        Args:
+            dirs_to_skip: a list of directories to skip over during the
+                traversal (e.g., .svn, resources, etc.)
+            file_filter: if not None, the filter will be invoked
+                with the filesystem object and the dirname and basename of
+                each file found. The file is included in the result if the
+                callback returns True.
+        """
+        def filter_all(dirpath, basename):
+            return True
+
+        file_filter = file_filter or filter_all
+        files = []
+        if FileSystem.isfile(path):
+            if file_filter(dirname(path), FileSystem.basename(path)):
+                files.append(path)
+            return files
+
+        if FileSystem.basename(path) in dirs_to_skip:
+            return []
+
+        for (dirpath, dirnames, filenames) in os.walk(path):
+            for d in dirs_to_skip:
+                if d in dirnames:
+                    dirnames.remove(d)
+
+            for filename in filenames:
+                if file_filter(dirpath, filename):
+                    files.append(FileSystem.join(dirpath, filename))
+        return files
+
+    @staticmethod
+    def getcwd():
+        return os.getcwd()
+
+    @staticmethod
+    def glob(path):
+        return glob.glob(path)
+
+    @staticmethod
+    def isabs(path):
+        return os.path.isabs(path)
+
+    @staticmethod
+    def isfile(path):
+        return os.path.isfile(path)
+
+    @staticmethod
+    def getsize(path):
+        return os.path.getsize(path)
+
+    @staticmethod
+    def isdir(path):
+        return os.path.isdir(path)
+
+    @staticmethod
+    def join(*comps):
+        return os.path.join(*comps)
+
+    @staticmethod
+    def listdir(path):
+        return os.listdir(path)
+
+    @staticmethod
+    def mkdtemp(**kwargs):
+        """Create and return a uniquely named directory.
+
+        This is like tempfile.mkdtemp, but if used in a with statement
+        the directory will self-delete at the end of the block (if the
+        directory is empty; non-empty directories raise errors). The
+        directory can be safely deleted inside the block as well, if so
+        desired.
+
+        Note that the object returned is not a string and does not support
+        all of the string methods. If you need a string, coerce the object
+        to a string and go from there.
+        """
+        class TemporaryDirectory(object):
+            def __init__(self, **kwargs):
+                self._kwargs = kwargs
+                self._directory_path = tempfile.mkdtemp(**self._kwargs)
+
+            def __str__(self):
+                return self._directory_path
+
+            def __enter__(self):
+                return self._directory_path
+
+            def __exit__(self, type, value, traceback):
+                # Only self-delete if necessary.
+
+                # FIXME: Should we delete non-empty directories?
+                if os.path.exists(self._directory_path):
+                    os.rmdir(self._directory_path)
+
+        return TemporaryDirectory(**kwargs)
+
+    @staticmethod
+    def maybe_make_directory(*path):
+        """Create the specified directory if it doesn't already exist."""
+        try:
+            os.makedirs(FileSystem.join(*path))
+        except OSError as e:
+            if e.errno != errno.EEXIST:
+                raise
+
+    @staticmethod
+    def move(source, destination):
+        shutil.move(source, destination)
+
+    @staticmethod
+    def mtime(path):
+        return os.stat(path).st_mtime
+
+    @staticmethod
+    def normpath(path):
+        return os.path.normpath(path)
+
+    @staticmethod
+    def open_binary_tempfile(suffix):
+        """Create, open, and return a binary temp file. Returns a tuple of
+        the file and the name."""
+        temp_fd, temp_name = tempfile.mkstemp(suffix)
+        f = os.fdopen(temp_fd, 'wb')
+        return f, temp_name
+
+    @staticmethod
+    def open_binary_file_for_reading(path):
+        return codecs.open(path, 'rb')
+
+    @staticmethod
+    def read_binary_file(path):
+        """Return the contents of the file at the given path as a
+        byte string."""
+        with file(path, 'rb') as f:
+            return f.read()
+
+    @staticmethod
+    def write_binary_file(path, contents):
+        with file(path, 'wb') as f:
+            f.write(contents)
+
+    @staticmethod
+    def open_text_file_for_reading(path, errors='strict'):
+        # Note: There appears to be an issue with the returned file objects
+        # not being seekable. See http://stackoverflow.com/questions/1510188/
+        # can-seek-and-tell-work-with-utf-8-encoded-documents-in-python .
+        return codecs.open(path, 'r', 'utf8', errors)
+
+    @staticmethod
+    def open_text_file_for_writing(path):
+        return codecs.open(path, 'w', 'utf8')
+
+    @staticmethod
+    def open_stdin():
+        return codecs.StreamReaderWriter(sys.stdin,
+                                         codecs.getreader('utf8'),
+                                         codecs.getwriter('utf8'),
+                                         'replace')
+
+    @staticmethod
+    def read_text_file(path):
+        """Return the contents of the file at the given path as
+        a Unicode string.
+
+        The file is read assuming it is a UTF-8 encoded file with no BOM."""
+        with codecs.open(path, 'r', 'utf8') as f:
+            return f.read()
+
+    @staticmethod
+    def write_text_file(path, contents):
+        """Write the contents to the file at the given location.
+
+        The file is written encoded as UTF-8 with no BOM."""
+        with codecs.open(path, 'w', 'utf-8') as f:
+            f.write(contents.decode('utf-8') if type(contents) == str
+                    else contents)
+
+    @staticmethod
+    def sha1(path):
+        contents = FileSystem.read_binary_file(path)
+        return hashlib.sha1(contents).hexdigest()
+
+    @staticmethod
+    def relpath(path, start='.'):
+        return os.path.relpath(path, start)
+
+    class _WindowsError(exceptions.OSError):
+        """Fake exception for Linux and Mac."""
+        pass
+
+    @staticmethod
+    def remove(path, osremove=os.remove):
+        """On Windows, if a process was recently killed and it held on to a
+        file, the OS will hold on to the file for a short while.  This makes
+        attempts to delete the file fail.  To work around that, this method
+        will retry for a few seconds until Windows is done with the file."""
+        try:
+            exceptions.WindowsError
+        except AttributeError:
+            exceptions.WindowsError = FileSystem._WindowsError
+
+        retry_timeout_sec = 3.0
+        sleep_interval = 0.1
+        while True:
+            try:
+                osremove(path)
+                return True
+            except exceptions.WindowsError as e:
+                time.sleep(sleep_interval)
+                retry_timeout_sec -= sleep_interval
+                if retry_timeout_sec < 0:
+                    raise e
+
+    @staticmethod
+    def rmtree(path):
+        """Delete the directory rooted at path, whether empty or not."""
+        shutil.rmtree(path, ignore_errors=True)
+
+    @staticmethod
+    def copytree(source, destination):
+        shutil.copytree(source, destination)
+
+    @staticmethod
+    def split(path):
+        """Return (dirname, basename + '.' + ext)"""
+        return os.path.split(path)
+
+    @staticmethod
+    def splitext(path):
+        """Return (dirname + os.sep + basename, '.' + ext)"""
+        return os.path.splitext(path)
+
+    @staticmethod
+    def compare(path1, path2):
+        return filecmp.cmp(path1, path2)
diff --git a/tools/common_py/system/platform.py b/tools/common_py/system/platform.py
new file mode 100644 (file)
index 0000000..5f7c7f3
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+import os
+
+
+class Platform(object):
+    def __init__(self):
+        _os, _, _, _, _arch = os.uname()
+        self._os = _os
+        self._arch = _arch
+
+    def os(self):
+        """ Retrieve host OS name. """
+        return self._os.lower()
+
+    def arch(self):
+        """ Retrieve host arch name. """
+        arch = self._arch.lower()
+        if arch in ["armv7l"]:
+            arch = "arm"
+        return arch
diff --git a/tools/js2c.py b/tools/js2c.py
new file mode 100755 (executable)
index 0000000..d4478f1
--- /dev/null
@@ -0,0 +1,311 @@
+#!/usr/bin/env python
+
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+#
+#  This file converts src/js/*.js to a C-array in src/iotjs_js.[h|c] file.
+# And this file also generates magic string list in src/iotjs_string_ext.inl.h
+# file to reduce JerryScript heap usage.
+
+import re
+import subprocess
+import struct
+
+from common_py.system.filesystem import FileSystem as fs
+from common_py import path
+
+
+def regroup(l, n):
+    return [l[i:i+n] for i in range(0, len(l), n)]
+
+
+def remove_comments(code):
+    pattern = r'(\".*?\"|\'.*?\')|(/\*.*?\*/|//[^\r\n]*$)'
+    regex = re.compile(pattern, re.MULTILINE | re.DOTALL)
+
+    def _replacer(match):
+        if match.group(2) is not None:
+            return ""
+        else:
+            return match.group(1)
+
+    return regex.sub(_replacer, code)
+
+
+def remove_whitespaces(code):
+    return re.sub('\n+', '\n', re.sub('\n +', '\n', code))
+
+
+def force_str(string):
+    if not isinstance(string, str):
+        return string.decode('utf-8')
+    else:
+        return string
+
+
+def parse_literals(code):
+    JERRY_SNAPSHOT_VERSION = 7
+
+    literals = set()
+
+    header = struct.unpack('IIII', code[0:16])
+    if header[0] != JERRY_SNAPSHOT_VERSION :
+        print ('Please check jerry snapshot version (Last confirmed: %d)'
+               % JERRY_SNAPSHOT_VERSION)
+        exit(1)
+
+    code_ptr = header[1] + 8
+    while code_ptr < len(code):
+        length = struct.unpack('H', code[code_ptr : code_ptr + 2])[0]
+        code_ptr = code_ptr + 2
+        if length == 0:
+            continue
+        if length < 32:
+            item = struct.unpack('%ds' % length,
+                                 code[code_ptr : code_ptr + length])
+            literals.add(force_str(item[0]))
+        code_ptr = code_ptr + length + (length % 2)
+
+    return literals
+
+
+LICENSE = '''
+/* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ *
+ * This file is generated by tools/js2c.py
+ * Do not modify this.
+ */
+'''
+
+HEADER1 = '''#ifndef IOTJS_JS_H
+#define IOTJS_JS_H
+'''
+
+FOOTER1 = '''
+#endif
+'''
+
+HEADER2 = '''#include <stdio.h>
+#include <stdint.h>
+#include "iotjs_js.h"
+'''
+
+EMPTY_LINE = '\n'
+
+MAGIC_STRINGS_HEADER = '#define JERRY_MAGIC_STRING_ITEMS \\\n'
+
+
+MODULE_VARIABLES_H = '''
+extern const char {NAME}_n[];
+extern const uint8_t {NAME}_s[];
+extern const size_t {NAME}_l;
+'''
+
+MODULE_VARIABLES_C = '''
+#define SIZE_{NAME_UPPER} {SIZE}
+const size_t {NAME}_l = SIZE_{NAME_UPPER};
+const char {NAME}_n[] = "{NAME}";
+const uint8_t {NAME}_s[] = {{
+{CODE}
+}};
+'''
+
+NATIVE_STRUCT_H = '''
+typedef struct {
+  const char* name;
+  const void* code;
+  const size_t length;
+} iotjs_js_module;
+
+extern const iotjs_js_module natives[];
+'''
+
+NATIVE_STRUCT_C = '''
+const iotjs_js_module natives[] = {{
+{MODULES}
+}};
+'''
+
+
+def hex_format(ch):
+    if isinstance(ch, str):
+        ch = ord(ch)
+
+    return "0x{:02x}".format(ch)
+
+
+def format_code(code, indent):
+    lines = []
+    # convert all characters to hex format
+    converted_code = map(hex_format, code)
+    # 10 hex number per line
+    for line in regroup(", ".join(converted_code), 10 * 6):
+        lines.append(('  ' * indent) + line.strip())
+
+    return "\n".join(lines)
+
+
+def get_snapshot_contents(module_name, snapshot_generator):
+    """ Convert the given module with the snapshot generator
+        and return the resulting bytes.
+    """
+    js_path = fs.join(path.SRC_ROOT, 'js', module_name + '.js')
+    wrapped_path = js_path + ".wrapped"
+    snapshot_path = js_path + ".snapshot"
+
+    with open(wrapped_path, 'w') as fwrapped, open(js_path, "r") as fmodule:
+        if module_name != "iotjs":
+            fwrapped.write("(function(exports, require, module) {\n")
+
+        fwrapped.write(fmodule.read())
+
+        if module_name != "iotjs":
+            fwrapped.write("});\n")
+
+    ret = subprocess.call([snapshot_generator,
+                           "--save-snapshot-for-eval",
+                           snapshot_path,
+                           wrapped_path])
+    if ret != 0:
+        msg = "Failed to dump %s: - %d" % (js_path, ret)
+        print("%s%s%s" % ("\033[1;31m", msg, "\033[0m"))
+        exit(1)
+
+    with open(snapshot_path, 'rb') as snapshot:
+        code = snapshot.read()
+
+    fs.remove(wrapped_path)
+    fs.remove(snapshot_path)
+
+    return code
+
+
+def get_js_contents(name, is_debug_mode=False):
+    """ Read the contents of the given js module. """
+    js_path = fs.join(path.SRC_ROOT, 'js', name + '.js')
+    with open(js_path, "r") as f:
+         code = f.read()
+
+    # minimize code when in release mode
+    if not is_debug_mode:
+        code = remove_comments(code)
+        code = remove_whitespaces(code)
+    return code
+
+
+def js2c(buildtype, no_snapshot, js_modules, js_dumper, verbose=False):
+    is_debug_mode = buildtype == "debug"
+    magic_string_set = set()
+
+    str_const_regex = re.compile('^#define IOTJS_MAGIC_STRING_\w+\s+"(\w+)"$')
+    with open(fs.join(path.SRC_ROOT, 'iotjs_magic_strings.h'), 'r') as fin_h:
+        for line in fin_h:
+            result = str_const_regex.search(line)
+            if result:
+                magic_string_set.add(result.group(1))
+
+    # generate the code for the modules
+    with open(fs.join(path.SRC_ROOT, 'iotjs_js.h'), 'w') as fout_h, \
+         open(fs.join(path.SRC_ROOT, 'iotjs_js.c'), 'w') as fout_c:
+
+        fout_h.write(LICENSE)
+        fout_h.write(HEADER1)
+        fout_c.write(LICENSE)
+        fout_c.write(HEADER2)
+
+        for name in sorted(js_modules):
+            if verbose:
+                print('Processing module: %s' % name)
+
+            if no_snapshot:
+                code = get_js_contents(name, is_debug_mode)
+            else:
+                code = get_snapshot_contents(name, js_dumper)
+                magic_string_set |= parse_literals(code)
+
+            code_string = format_code(code, 1)
+
+            fout_h.write(MODULE_VARIABLES_H.format(NAME=name))
+            fout_c.write(MODULE_VARIABLES_C.format(NAME=name,
+                                                   NAME_UPPER=name.upper(),
+                                                   SIZE=len(code),
+                                                   CODE=code_string))
+
+        fout_h.write(NATIVE_STRUCT_H)
+        fout_h.write(FOOTER1)
+
+        modules_struct = [
+            '  {{ {0}_n, {0}_s, SIZE_{1} }},'.format(name, name.upper())
+            for name in sorted(js_modules)
+        ]
+        modules_struct.append('  { NULL, NULL, 0 }')
+
+        fout_c.write(NATIVE_STRUCT_C.format(MODULES="\n".join(modules_struct)))
+        fout_c.write(EMPTY_LINE)
+
+    # Write out the external magic strings
+    magic_str_path = fs.join(path.SRC_ROOT, 'iotjs_string_ext.inl.h')
+    with open(magic_str_path, 'w') as fout_magic_str:
+        fout_magic_str.write(LICENSE)
+        fout_magic_str.write(MAGIC_STRINGS_HEADER)
+
+        sorted_strings = sorted(magic_string_set, key=lambda x: (len(x), x))
+        for idx, magic_string in enumerate(sorted_strings):
+            magic_text = repr(magic_string)[1:-1]
+
+            fout_magic_str.write('  MAGICSTR_EX_DEF(MAGIC_STR_%d, "%s") \\\n'
+                                 % (idx, magic_text))
+        # an empty line is required to avoid compile warning
+        fout_magic_str.write(EMPTY_LINE)
+
+
+if __name__ == "__main__":
+    import argparse
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument('--buildtype',
+        choices=['debug', 'release'], default='debug',
+        help='Specify the build type: %(choices)s (default: %(default)s)')
+    parser.add_argument('--modules', required=True,
+        help='List of JS modules to process. Format: <module>,<module2>,...')
+    parser.add_argument('--snapshot-generator', default=None,
+        help='Executable to use for generating snapshots from the JS files. '
+             'If not specified the JS files will be directly processed.')
+    parser.add_argument('-v', '--verbose', default=False,
+        help='Enable verbose output.')
+
+    options = parser.parse_args()
+
+    if not options.snapshot_generator:
+        print('Converting JS modules to C arrays (no snapshot)')
+        no_snapshot = True
+    else:
+        print('Using "%s" as snapshot generator' % options.snapshot_generator)
+        no_snapshot = False
+
+    modules = options.modules.replace(',', ' ').split()
+    js2c(options.buildtype, no_snapshot, modules, options.snapshot_generator,
+         options.verbose)
diff --git a/tools/measure_coverage.sh b/tools/measure_coverage.sh
new file mode 100755 (executable)
index 0000000..395465d
--- /dev/null
@@ -0,0 +1,170 @@
+#!/bin/bash
+
+# Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+print_dep()
+{
+  echo "The following dependencies are required:"
+  echo "    sudo apt install lcov gcc-multilib"
+  echo ""
+}
+
+print_nvm_dep()
+{
+  echo "The nvm (node version manager) is required to install node and npm."
+  echo "Use the following command to install nvm:"
+  echo "    curl \
+https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash"
+  echo ""
+}
+
+print_npm_dep()
+{
+  echo "The following node dependencies are required: "
+  echo "    npm install babel-cli nyc babel-plugin-istanbul merge-source-map"
+  echo ""
+}
+
+check_architecture()
+{
+  architecture=$(uname -m)
+  case $architecture in
+    i386|i686|x86_32)
+      ;;
+    *)
+      echo "Error: You can measure test coverage only on x86 32-bit."
+      exit 1
+  esac
+}
+
+if [ "$#" -gt "0" ] && ( [ "$1" == "-h" ] || [ "$1" == "--help" ] ); then
+    echo "Measure JavaScript and C coverage and create a html report"
+    echo "out of the results"
+    echo ""
+    echo "Usage: $0 [NODE_MODULES_DIR]"
+    echo ""
+    echo "Optional Arguments:"
+    echo "  NODE_MODULES_DIR    Specifies the node_module directory, where"
+    echo "                      the nodejs dependencies are installed."
+    echo ""
+    echo "The created html reports can be found in the 'coverage' directory,"
+    echo "which will be created in the IoT.js project source dir. The C and"
+    echo "JavaScript coverage reports are in the 'c' and 'js' subdirectories"
+    echo "respectively. The reports can be viewed by opening the 'index.html'"
+    echo "file in a web browser of your choice."
+    echo ""
+    echo "Running the script will require some additional dependencies."
+    echo ""
+    print_dep
+    print_nvm_dep
+    print_npm_dep
+    exit 0
+fi
+
+# Don't run this script on x86_64 architecture, only on x86_32
+check_architecture
+
+tools_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+iotjs_root=$(readlink -f "$tools_dir/..")
+
+test -e ~/.nvm
+
+if [ "$?" -ne "0" ]; then
+    print_nvm_dep
+    exit 1
+fi
+
+# Make available the nvm command.
+. ~/.nvm/nvm.sh
+. ~/.profile
+
+# Istanbul and babel require node version > 4.0.
+nvm install 6.11.0
+
+dpkg -l lcov >> /dev/null 2>&1 && \
+dpkg -l gcc-multilib >> /dev/null 2>&1
+
+if [ "$?" -ne "0" ]; then
+    print_dep
+    exit 1
+fi
+
+modules_dir=$(readlink -f "$(npm bin)/..")
+
+if [ "$#" -gt "0" ]; then
+    path=$(readlink -f $1)
+    if [ ! -d "$path" ] || [ $(basename "$path") != "node_modules" ]; then
+        echo "'$1' is not a node_modules directory"
+        exit 1
+    fi
+
+    test -e $path/.bin/nyc && \
+    test -e $path/.bin/babel
+
+    if [ "$?" -ne "0" ]; then
+        print_npm_dep
+        exit 1
+    fi
+
+    modules_dir="$path"
+else
+    test -e $modules_dir/.bin/nyc && \
+    test -e $modules_dir/.bin/babel
+
+    if [ "$?" -ne "0" ]; then
+        print_npm_dep
+        exit 1
+    fi
+fi
+
+cd $iotjs_root
+
+# Transpile JS files to provide line counters
+$modules_dir/.bin/babel --plugins="babel-plugin-istanbul" \
+    src/js/ --out-dir src/cover_js/
+
+# Backup original module files, and replace them with the transpiled files
+mv src/js src/orig_js
+mv src/cover_js src/js
+
+# Build iot.js
+# We need to use the system allocator to have enough memory, for now this can
+# only be done with a 32-bit build
+tools/build.py --jerry-cmake-param="-DFEATURE_SYSTEM_ALLOCATOR=ON" \
+    --target-arch=x86 --compile-flag="-coverage" --no-snapshot --no-check-test
+
+# Run tests
+build/i686-linux/debug/bin/iotjs tools/check_test.js -- output-coverage=yes
+
+# Revert to original module files
+rm -rf src/js
+mv src/orig_js src/js
+
+# Generate js coverage report
+mkdir -p .coverage_output
+$modules_dir/.bin/nyc report --reporter=lcov \
+    --report-dir=coverage --temp-directory=.coverage_output
+rm -rf .coverage_output
+
+rm -rf coverage/js
+mv coverage/lcov-report coverage/js
+
+# Generate c coverage report
+lcov -t "c_coverage" -o ".c-coverage.info" -c -d build/i686-linux/debug/
+lcov --remove ".c-coverage.info" 'iotjs/deps/*' -o ".c-coverage.info"
+genhtml -o coverage/c .c-coverage.info
+rm .c-coverage.info
+
+cd -
diff --git a/tools/measure_js_heap.py b/tools/measure_js_heap.py
new file mode 100755 (executable)
index 0000000..319a9b1
--- /dev/null
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+
+# Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+from __future__ import print_function
+
+import argparse
+import os
+import re
+import subprocess
+import sys
+
+from common_py import path
+from common_py.system.filesystem import FileSystem as fs
+
+def get_arguments():
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--base', required=True,
+        help='Path to the base IoT.js binary')
+    parser.add_argument('--new',  required=True,
+        help='Path to the new IoT.js binary')
+
+    script_args = parser.parse_args()
+
+    return script_args
+
+def run_iotjs(cmd):
+    pattern = re.compile(r'Peak allocated = (\d+) bytes')
+
+    try:
+        output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+    except subprocess.CalledProcessError as err:
+        return ""
+
+    match = pattern.search(str(output))
+
+    if match:
+        return match.group(1)
+    else:
+        return ""
+
+
+if __name__ == "__main__":
+    script_args = get_arguments()
+    print("**JS heap peak (bytes)**\n")
+    print("| {0:^40} | {1:^10} | {2:^10} |".format("Test file", "base", "new"))
+    print("| {0} | {1} | {2} |".format("-"*40, "-"*10, "-"*10))
+
+    for test_file in os.listdir(path.RUN_PASS_DIR):
+        if test_file.endswith(".js"):
+            line = "| " + test_file + " | "
+            cmd = [script_args.base, '--memstat',
+                os.path.join(path.RUN_PASS_DIR, test_file)
+            ]
+            base_out = run_iotjs(cmd)
+
+            cmd = [script_args.new, '--memstat',
+                os.path.join(path.RUN_PASS_DIR, test_file)
+            ]
+            new_out = run_iotjs(cmd)
+
+            if base_out or new_out:
+                print("| {0:40} | {1:^10} | {2:^10} |"
+                    .format(test_file, base_out, new_out))
diff --git a/tools/mem_stats.sh b/tools/mem_stats.sh
new file mode 100755 (executable)
index 0000000..cccb23a
--- /dev/null
@@ -0,0 +1,124 @@
+#!/bin/bash
+
+# Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+# Usage
+if [ "$#" -lt 3 ]
+then
+  echo "$0: Benchmark memory usage of IoT.js"
+  echo ""
+  echo "Usage: $0 [-d] IOTJS IOTJS_MEMSTATS BENCHMARK..."
+  echo ""
+  echo "Positional arguments:"
+  echo "  IOTJS             path to IoT.js engine built without memory"
+  echo "                    statistics support"
+  echo "  IOTJS_MEMSTATS    path to IoT.js engine built with memory statistics"
+  echo "                    support"
+  echo "  BENCHMARK...      paths to JavaScript programs to be used as the"
+  echo "                    benchmark suite"
+  echo ""
+  echo "Optional arguments:"
+  echo "  -d                generate semicolon-delimited output (default:"
+  echo "                    formatted human-readable output)"
+  echo ""
+  echo "The tool benchmarks the memory usage of IoT.js with the help of two"
+  echo "different builds and a suite of JavaScript programs. Each benchmark"
+  echo "script is executed by both builds: the \"memstats\" build reports"
+  echo "statistics retrieved from JerryScript, while the \"normal\" build"
+  echo "reports RSS results."
+  exit 1
+fi
+
+# Choosing table or semicolon-separated output mode
+if [ "$1" == "-d" ]
+then
+  TABLE="no"
+  PRINT_TEST_NAME_AWK_SCRIPT='{printf "%s;", $1}'
+  PRINT_TOTAL_AWK_SCRIPT='{printf "%d;%d\n", $1, $2 * 1024}'
+
+  shift
+else
+  PRINT_TEST_NAME_AWK_SCRIPT='{printf "%30s", $1}'
+  PRINT_TOTAL_AWK_SCRIPT='{printf "%25d%25d\n", $1, $2 * 1024}'
+  TABLE="yes"
+fi
+
+function fail_msg
+{
+  echo "$1"
+  exit 1
+}
+
+# Engine
+
+# Check if the specified build supports memory statistics options
+function is_mem_stats_build
+{
+  [ -x "$1" ] || fail_msg "Engine '$1' is not executable"
+
+  tmpfile=`mktemp`
+  "$1" --memstat $tmpfile 2>&1 | \
+    grep -- "Ignoring memory statistics option" 2>&1 > /dev/null
+  code=$?
+  rm $tmpfile
+
+  return $code
+}
+
+IOTJS=$(readlink -f "$1")
+shift
+is_mem_stats_build "$IOTJS" || fail_msg \
+  "First engine specified should be built without memory statistics support"
+
+IOTJS_MEM_STATS=$(readlink -f "$1")
+shift
+is_mem_stats_build "$IOTJS_MEM_STATS" && fail_msg \
+  "Second engine specified should be built with memory statistics support"
+
+# Benchmarks list
+BENCHMARKS=""
+
+while [ $# -ne 0 ]
+do
+  BENCHMARKS="$BENCHMARKS $1"
+  shift
+done
+
+# Running
+if [ "$TABLE" == "yes" ]
+then
+  awk 'BEGIN {printf "%30s%25s%25s\n", "Test name", "Peak Heap (jerry)", \
+    "Maximum RSS"}'
+  echo
+fi
+
+STARTDIR=$(pwd)
+
+for bench in $BENCHMARKS
+do
+  bench_name=$(basename -s '.js' $bench)
+  bench_canon=$(readlink -f $bench)
+
+  cd `dirname $bench_canon`
+
+  echo "$bench_name" | awk "$PRINT_TEST_NAME_AWK_SCRIPT"
+  MEM_STATS=$("$IOTJS_MEM_STATS" --memstat $bench_canon | \
+    grep -e "Peak allocated =" | grep -o "[0-9]*")
+  RSS=$($STARTDIR/deps/jerry/tools/rss-measure.sh "$IOTJS" $bench_canon | \
+    tail -n 1 | grep -o "[0-9]*")
+  echo $MEM_STATS $RSS | xargs | awk "$PRINT_TOTAL_AWK_SCRIPT"
+
+  cd $STARTDIR
+done
diff --git a/tools/module_analyzer.py b/tools/module_analyzer.py
new file mode 100644 (file)
index 0000000..20a6bb2
--- /dev/null
@@ -0,0 +1,223 @@
+#!/usr/bin/env python
+
+# Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+from __future__ import print_function
+
+import re
+
+from common_py.system.filesystem import FileSystem as fs
+from common_py.system.executor import Executor as ex
+from common_py.system.platform import Platform
+from common_py import path
+
+platform = Platform()
+
+def resolve_modules(options):
+    """ Resolve include/exclude module lists based on command line arguments
+        and build config.
+    """
+    # Load the modules which are always enabled and the include/exclude sets
+    build_modules_always = set(options.config['module']['always'])
+    build_modules_includes = set(options.config['module']['include'])
+    build_modules_excludes = set(options.config['module']['exclude']['all'])
+
+    if options.target_os:
+        system_os = options.target_os
+        build_modules_excludes |= set(
+            options.config['module']['exclude'][system_os])
+
+    # Build options has higher priority than defaults
+    build_modules_excludes -= options.iotjs_include_module
+
+    # By default the target included modules are:
+    #  - always module set from the build config
+    #  - modules specified by the command line argument
+    include_modules = set() | build_modules_always
+    include_modules |= options.iotjs_include_module
+
+    if not options.iotjs_minimal_profile:
+        # Add the include set from the build config to
+        # the target include modules set
+        include_modules |= build_modules_includes
+
+    # Check if there are any modules which are not allowed to be excluded
+    impossible_to_exclude = options.iotjs_exclude_module & build_modules_always
+    if impossible_to_exclude:
+        ex.fail('Cannot exclude modules which are always enabled: %s' %
+                ', '.join(impossible_to_exclude))
+
+    # Finally build up the excluded module set:
+    #  - use the command line exclude set
+    #  - use the exclude set from the build config
+    exclude_modules = options.iotjs_exclude_module | build_modules_excludes
+
+    # Remove the excluded modules from the included modules set
+    include_modules -= exclude_modules
+
+    return include_modules, exclude_modules
+
+
+def analyze_module_dependency(include_modules, exclude_modules):
+    analyze_queue = set(include_modules) # copy the set
+    analyze_queue.add('iotjs')
+
+    js_modules = { 'native' }
+    native_modules = { 'process' }
+    while analyze_queue:
+        item = analyze_queue.pop()
+        js_modules.add(item)
+        js_module_path = fs.join(path.PROJECT_ROOT,
+                                 'src', 'js', item + '.js')
+        if not fs.exists(js_module_path):
+            ex.fail('Cannot read file "%s"' % js_module_path)
+        with open(js_module_path) as module:
+            content = module.read()
+
+        # Pretend to ignore comments in JavaScript
+        re_js_comments = "\/\/.*|\/\*.*\*\/";
+        content = re.sub(re_js_comments, "", content)
+
+        # Get all required modules
+        re_js_module = 'require\([\'\"](.*?)[\'\"]\)'
+        required_modules = set(re.findall(re_js_module, content))
+        # Check if there is any required modules in the exclude set
+        problem_modules = required_modules & exclude_modules
+        if problem_modules:
+            ex.fail('Cannot exclude module(s) "%s" since "%s" requires them' %
+                    (', '.join(problem_modules), item))
+
+        # Add all modules to analytze queue which are not yet analyzed
+        analyze_queue |= required_modules - js_modules
+
+        # Get all native modules
+        re_native_module = 'process.binding\(process.binding.(.*?)\)'
+        native_modules |= set(re.findall(re_native_module, content))
+
+    js_modules.remove('native')
+
+    modules = {'js': sorted(js_modules), 'native': sorted(native_modules)}
+
+    return modules
+
+
+def _normalize_module_set(argument):
+    """ Split up argument via commas and make sure they have a valid value """
+    return set([module.strip() for module in argument.split(',')
+                if module.strip()])
+
+
+def _load_options(argv):
+    try:
+        basestring
+    except:
+        # in Python 3.x there is no basestring just str
+        basestring = str
+
+    # Specify the allowed options for the script
+    opts = [
+        {'name': 'iotjs-minimal-profile',
+         'args': dict(action='store_true', default=False,
+            help='Build IoT.js with minimal profile')
+        },
+        {'name': 'iotjs-include-module',
+         'args': dict(action='store', default=set(),
+            type=_normalize_module_set,
+            help='Specify iotjs modules which should be included '
+                 '(format: module_1,module_2,...)')
+        },
+        {'name': 'iotjs-exclude-module',
+         'args': dict(action='store', default=set(),
+            type=_normalize_module_set,
+            help='Specify iotjs modules which should be excluded '
+                 '(format: module_1,module_2,...)')
+        },
+        {'name': 'target-os',
+         'args': dict(choices=['linux', 'darwin', 'nuttx', 'tizen', 'tizenrt'],
+            default=platform.os, type=str.lower,
+            help='Specify the target os: %(choices)s (default: %(default)s)')
+        },
+        {'name': 'mode',
+         'args': dict(choices=['verbose', 'cmake-dump'],
+            default='verbose',
+            help='Execution mode of the script. Choices: %(choices)s '
+                 '(default: %(default)s)'
+            ),
+        },
+    ]
+    allowed_options = [opt['name'] for opt in opts]
+
+    arg_config = list(filter(lambda x: x.startswith('--config='), argv))
+    config_path = path.BUILD_CONFIG_PATH
+
+    if arg_config:
+        config_path = arg_config[-1].split('=', 1)[1]
+
+    # Read config file and apply it to argv.
+    with open(config_path, 'rb') as f:
+        config = json.loads(f.read().decode('ascii'))
+
+    loaded_argv = []
+    for opt_key, opt_value in config['build_option'].items():
+        if opt_key not in allowed_options:
+            continue # ignore any option that is not for us
+
+        if isinstance(opt_value, basestring) and opt_value:
+            loaded_argv.append('--%s=%s' % (opt_key, opt_value))
+        elif isinstance(opt_value, bool):
+            if opt_value:
+                loaded_argv.append('--%s' % opt_key)
+        elif isinstance(opt_value, int):
+            loaded_argv.append('--%s=%s' % (opt_key, opt_value))
+        elif isinstance(opt_value, list):
+            for val in opt_value:
+                loaded_argv.append('--%s=%s' % (opt_key, val))
+
+    # Apply command line argument to argv.
+    loaded_argv.extend([arg for arg in argv[1:]
+                       if not arg.startswith('--config=')])
+
+    # Build up the argument parser and process the args
+    parser = argparse.ArgumentParser()
+
+    for opt in opts:
+        parser.add_argument('--%s' % opt['name'], **opt['args'])
+
+    options = parser.parse_args(loaded_argv)
+    options.config = config
+
+    return options
+
+
+def _main():
+    options = _load_options(sys.argv)
+
+    includes, excludes = resolve_modules(options)
+    modules = analyze_module_dependency(includes, excludes)
+
+    if options.mode == 'cmake-dump':
+        print('IOTJS_JS_MODULES=' + ';'.join(modules['js']))
+        print('IOTJS_NATIVE_MODULES=' + ';'.join(modules['native']))
+    else:
+        print('Selected js modules: %s' % ', '.join(modules['js']))
+        print('Selected native modules: %s' % ', '.join(modules['native']))
+
+
+if __name__ == '__main__':
+    import argparse
+    import json
+    import sys
+
+    _main()
diff --git a/tools/precommit.py b/tools/precommit.py
new file mode 100755 (executable)
index 0000000..93e7a06
--- /dev/null
@@ -0,0 +1,258 @@
+#!/usr/bin/env python
+
+# Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+#
+# 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.
+
+from __future__ import print_function
+
+import argparse
+import sys
+import os
+import json
+from common_py import path
+from common_py.system.filesystem import FileSystem as fs
+from common_py.system.executor import Executor as ex
+from common_py.system.platform import Platform
+from check_tidy import check_tidy
+
+TESTS=['host-linux', 'host-darwin', 'rpi2', 'nuttx', 'misc',
+       'artik10', 'artik053', 'coverity']
+BUILDTYPES=['debug', 'release']
+NUTTXTAG = 'nuttx-7.19'
+
+def get_config():
+    config_path = path.BUILD_CONFIG_PATH
+    with open(config_path, 'r') as f:
+        config = json.loads(f.read().encode('ascii'))
+    return config
+
+
+def parse_option():
+    parser = argparse.ArgumentParser(
+         description='IoT.js pre-commit script.',
+         epilog='If no arguments are given, runs full test.')
+    parser.add_argument('--test', choices=TESTS, action='append')
+    parser.add_argument('--buildtype', choices=BUILDTYPES, action='append')
+    parser.add_argument('--buildoptions', action='store', default='',
+                        help='A comma separated list of extra buildoptions')
+
+    option = parser.parse_args(sys.argv[1:])
+    if option.test is None:
+        option.test = TESTS
+    if option.buildtype is None:
+        option.buildtype = BUILDTYPES
+    return option
+
+
+def setup_nuttx_root(nuttx_root):
+    # Step 1
+    fs.maybe_make_directory(nuttx_root)
+    fs.chdir(nuttx_root)
+    if not fs.exists('nuttx'):
+        ex.check_run_cmd('git', ['clone',
+                                 'https://bitbucket.org/nuttx/nuttx.git'])
+    fs.chdir('nuttx')
+    ex.check_run_cmd('git', ['checkout', NUTTXTAG])
+    fs.chdir('..')
+
+    if not fs.exists('apps'):
+        ex.check_run_cmd('git', ['clone',
+                                 'https://bitbucket.org/nuttx/apps.git'])
+    fs.chdir('apps')
+    ex.check_run_cmd('git', ['checkout', NUTTXTAG])
+    fs.chdir('..')
+
+    # Step 2
+    fs.maybe_make_directory(fs.join(nuttx_root, 'apps', 'system', 'iotjs'))
+    for file in fs.listdir(fs.join(path.PROJECT_ROOT,
+                                   'config', 'nuttx', 'stm32f4dis','app')):
+        fs.copy(fs.join(path.PROJECT_ROOT, 'config',
+                        'nuttx', 'stm32f4dis', 'app', file),
+                fs.join(nuttx_root, 'apps', 'system', 'iotjs'))
+
+    # Step 3
+    fs.chdir(fs.join(nuttx_root, 'nuttx', 'tools'))
+    ex.check_run_cmd('./configure.sh', ['stm32f4discovery/usbnsh'])
+    fs.chdir('..')
+    fs.copy(fs.join(path.PROJECT_ROOT,
+                    'config',
+                    'nuttx',
+                    'stm32f4dis',
+                    '.config.travis'),
+            '.config')
+
+
+def build_nuttx(nuttx_root, buildtype, maketarget):
+    fs.chdir(fs.join(nuttx_root, 'nuttx'))
+    if buildtype == "release":
+        rflag = 'R=1'
+    else:
+        rflag = 'R=0'
+    ex.check_run_cmd('make',
+                     [maketarget, 'IOTJS_ROOT_DIR=' + path.PROJECT_ROOT, rflag])
+
+
+def setup_tizen_root(tizen_root):
+    if fs.exists(tizen_root):
+        fs.chdir(tizen_root)
+        ex.check_run_cmd('git', ['pull'])
+        fs.chdir(path.PROJECT_ROOT)
+    else:
+        ex.check_run_cmd('git', ['clone',
+            'https://github.com/pmarcinkiew/tizen3.0_rootstrap.git',
+            tizen_root])
+
+def copy_tiznert_stuff(tizenrt_root, iotjs_dir):
+    tizenrt_iotjsapp_dir = fs.join(tizenrt_root, 'apps/system/iotjs')
+    if not fs.exists(tizenrt_iotjsapp_dir):
+        iotjs_tizenrt_appdir = fs.join(iotjs_dir,
+                                       'config/tizenrt/artik05x/app')
+        ex.check_run_cmd('cp',
+                         ['-r', iotjs_tizenrt_appdir, tizenrt_iotjsapp_dir])
+
+    tizenrt_config_dir = fs.join(tizenrt_root, 'build/configs/artik053/iotjs')
+    if not fs.exists(tizenrt_config_dir):
+        iotjs_config_dir = \
+            fs.join(iotjs_dir, 'config/tizenrt/artik05x/configs')
+        ex.check_run_cmd('cp',
+                         ['-r', iotjs_config_dir, tizenrt_config_dir])
+
+def setup_tizenrt_repo(tizenrt_root):
+    if fs.exists(tizenrt_root):
+        fs.chdir(tizenrt_root)
+        ex.check_run_cmd('git', ['pull'])
+        fs.chdir(path.PROJECT_ROOT)
+    else:
+        ex.check_run_cmd('git', ['clone',
+            'https://github.com/Samsung/TizenRT.git',
+            tizenrt_root])
+    copy_tiznert_stuff(tizenrt_root, path.PROJECT_ROOT)
+
+def configure_trizenrt(tizenrt_root, buildtype):
+    # TODO: handle buildtype (build vs release) for tizenrt build
+    tizenrt_tools = fs.join(tizenrt_root, 'os/tools')
+    fs.chdir(tizenrt_tools)
+    ex.check_run_cmd('./configure.sh', ['artik053/iotjs'])
+    fs.chdir('..')
+    ex.check_run_cmd('make', ['context'])
+
+def build_tizenrt(tizenrt_root, iotjs_rootdir, buildtype):
+    fs.chdir(fs.join(tizenrt_root, 'os'))
+    iotjs_libdir = iotjs_rootdir + '/build/arm-tizenrt/' + buildtype + '/lib'
+    ex.check_run_cmd('make', ['IOTJS_ROOT_DIR=' + iotjs_rootdir,
+                              'IOTJS_LIB_DIR=' + iotjs_libdir])
+
+def build(buildtype, args=[]):
+    fs.chdir(path.PROJECT_ROOT)
+    ex.check_run_cmd('./tools/build.py', ['--buildtype=' + buildtype] + args)
+
+
+def get_os_dependency_exclude_module(exclude_module):
+    os_dependency_module = {}
+    all_module = set(exclude_module['all'])
+    for os_name in exclude_module.keys():
+        if not os_name == 'all':
+            os_dependency_module[os_name] = \
+              list(all_module | set(exclude_module[os_name]))
+    return os_dependency_module
+
+
+option = parse_option()
+config = get_config()
+os_dependency_module = \
+    get_os_dependency_exclude_module(config['module']['exclude'])
+
+# Excluded modules are also included in the build test.
+# Travis will test all implemented modules.
+for os_name in os_dependency_module:
+    if os_dependency_module[os_name]:
+        os_dependency_module[os_name] = \
+        ['--iotjs-include-module=' + ','.join(os_dependency_module[os_name])]
+
+build_args = []
+
+if option.buildoptions:
+    build_args.extend(option.buildoptions.split(','))
+
+for test in option.test:
+    if test == "host-linux":
+        for buildtype in option.buildtype:
+            build(buildtype, os_dependency_module['linux'] + build_args)
+
+    if test == "host-darwin":
+        for buildtype in option.buildtype:
+            build(buildtype, os_dependency_module['darwin'] + build_args)
+
+    elif test == "rpi2":
+        for buildtype in option.buildtype:
+            build(buildtype, ['--target-arch=arm', '--target-board=rpi2']
+                              + os_dependency_module['linux'] + build_args)
+
+    elif test == "artik10":
+        for buildtype in option.buildtype:
+            tizen_root = fs.join(path.PROJECT_ROOT, 'deps', 'tizen')
+            setup_tizen_root(tizen_root)
+            build(buildtype, ['--target-arch=arm',
+                              '--target-os=tizen',
+                              '--target-board=artik10',
+                              '--compile-flag=--sysroot=' + tizen_root
+                              ] + os_dependency_module['linux'] + build_args)
+
+    elif test == "artik053":
+        for buildtype in option.buildtype:
+            tizenrt_root = fs.join(path.PROJECT_ROOT, 'deps', 'tizenrt')
+            setup_tizenrt_repo(tizenrt_root)
+            configure_trizenrt(tizenrt_root, buildtype)
+            build(buildtype, ['--target-arch=arm',
+                              '--target-os=tizenrt',
+                              '--target-board=artik05x',
+                              '--sysroot=' + tizenrt_root + '/os',
+                              '--jerry-heaplimit=128',
+                              '--clean',
+                              ] + os_dependency_module['tizenrt'] + build_args)
+            build_tizenrt(tizenrt_root, path.PROJECT_ROOT, buildtype)
+
+    elif test == "nuttx":
+        current_dir = os.getcwd()
+        for buildtype in option.buildtype:
+            nuttx_root=fs.join(path.PROJECT_ROOT, 'deps', 'nuttx')
+            setup_nuttx_root(nuttx_root)
+            build_nuttx(nuttx_root, buildtype, 'context')
+            build(buildtype, ['--target-arch=arm',
+                              '--target-os=nuttx',
+                              '--nuttx-home=' + fs.join(nuttx_root, 'nuttx'),
+                              '--target-board=stm32f4dis',
+                              '--jerry-heaplimit=78']
+                              + os_dependency_module['nuttx'] + build_args)
+            build_nuttx(nuttx_root, buildtype, 'all')
+            fs.chdir(current_dir)
+
+    elif test == "misc":
+
+        args = []
+        if os.getenv('TRAVIS') != None:
+            args = ['--travis']
+        ex.check_run_cmd('tools/check_signed_off.sh', args)
+
+        if not check_tidy(path.PROJECT_ROOT):
+            ex.fail("Failed tidy check")
+
+        build("debug", build_args)
+        build("debug", ['--no-snapshot', '--jerry-lto']
+                       + os_dependency_module['linux'] + build_args)
+
+        build("debug", ['--iotjs-minimal-profile'] + build_args)
+
+    elif test == "coverity":
+        build("debug", os_dependency_module['linux'] + build_args)
diff --git a/tools/test_runner.js b/tools/test_runner.js
new file mode 100644 (file)
index 0000000..c56c674
--- /dev/null
@@ -0,0 +1,169 @@
+/* Copyright 2016-present Samsung Electronics Co., Ltd. and other contributors
+ *
+ * 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.
+ */
+
+var testdriver = require('testdriver');
+var console_wrapper = require('common_js/module/console');
+var builtin_modules =
+  Object.keys(process.native_sources).concat(Object.keys(process.binding));
+
+function Runner(driver) {
+  process._exiting = false;
+
+  this.driver = driver;
+  this.test = driver.currentTest();
+  this.finished = false;
+  if (driver.skipModule) {
+    this.skipModule = driver.skipModule;
+    this.skipModuleLength = this.skipModule.length;
+  } else {
+    this.skipModuleLength = 0;
+  }
+  if (driver.options.quiet == 'yes') {
+    this.console = console;
+    console = console_wrapper;
+  }
+
+  return this;
+}
+
+Runner.prototype.cleanup = function() {
+  if (this.driver.options.quiet == 'yes') {
+    console = this.console;
+  }
+
+  this.driver = null;
+  this.attr = null;
+  if (this.timer != null) {
+    clearTimeout(this.timer);
+    this.timer = null;
+  }
+};
+
+Runner.prototype.spin = function() {
+  var that = this;
+  setTimeout(function() {
+      var timerOnlyAlive = !testdriver.isAliveExceptFor(that.timer);
+      if (timerOnlyAlive) {
+        timerOnlyAlive = !process._onNextTick();
+      }
+
+      if (timerOnlyAlive) {
+        process.exit(0);
+      } else {
+        if (!that.finished) {
+          that.spin();
+        }
+      }
+  }, 0);
+};
+
+Runner.prototype.checkSkipModule = function() {
+  for (var i = 0; i < this.skipModuleLength; i++) {
+    if (this.test['name'].indexOf(this.skipModule[i]) >= 0) {
+      return true;
+    }
+  }
+
+  return false;
+};
+
+Runner.prototype.checkSupportedModule = function() {
+  // Cut off the '.js' ending
+  var name = this.test['name'].slice(0, -3);
+
+  // test_mod_smt -> [test, mod, smt]
+  // test_modsmt -> [test, modsmt]
+  var parts = name.split('_');
+  if (parts[0] != 'test') {
+    // test filename does not start with 'test_' so we'll just
+    // assume we support it.
+    return true;
+  }
+
+  // The second part of the array contains the module
+  // which is under test
+  var tested_module = parts[1];
+  for (var i = 0; i < builtin_modules.length; i++) {
+    if (tested_module == builtin_modules[i]) {
+      return true;
+    }
+  }
+
+  // In any other case we do not support this js file.
+  return false;
+}
+
+Runner.prototype.run = function() {
+  if (!this.checkSupportedModule()) {
+    this.test.reason = 'unsupported module by iotjs build';
+    this.finish('skip');
+    return;
+  }
+
+  var skip = this.test['skip'];
+  if (skip) {
+    if ((skip.indexOf('all') >= 0) || (skip.indexOf(this.driver.os) >= 0)
+      || (skip.indexOf(this.driver.stability) >= 0)) {
+      this.finish('skip');
+      return;
+    }
+  }
+
+  if (this.skipModuleLength && this.checkSkipModule()) {
+    this.test.reason = 'exclude module';
+    this.finish('skip');
+    return;
+  }
+
+  this.timer = null;
+  if (this.test['timeout']) {
+    var timeout = this.test['timeout'];
+    if (timeout) {
+      var that = this;
+      this.timer = setTimeout(function () {
+        that.finish('timeout');
+      }, timeout * 1000);
+    }
+  }
+
+  try {
+    var source = this.driver.test();
+    eval(source);
+  } catch(e) {
+    if (this.test['expected-failure']) {
+      this.finish('pass');
+    } else if (this.test['uncaught']) {
+      throw e;
+    } else {
+      console.error(e);
+      this.finish('fail');
+    }
+  } finally {
+    if (!this.finished) {
+      this.spin();
+    }
+  }
+};
+
+Runner.prototype.finish = function(status) {
+  if (this.finished)
+    return;
+
+  this.finished = true;
+
+  this.driver.emitter.emit('nextTest', this.driver, status, this.test);
+};
+
+module.exports.Runner = Runner;